From 8f7ceee36af93cda9c1653cb14ee282d7285800a Mon Sep 17 00:00:00 2001 From: Peter Tissen Date: Sun, 9 Feb 2014 21:45:53 +0100 Subject: [PATCH] remove local copy of wxWidgets --- wxWidgets/art/addbookm.xpm | 24 - wxWidgets/art/back.xpm | 21 - wxWidgets/art/cdrom.xpm | 57 - wxWidgets/art/copy.xpm | 44 - wxWidgets/art/cross.xpm | 17 - wxWidgets/art/cut.xpm | 46 - wxWidgets/art/deffile.xpm | 54 - wxWidgets/art/delbookm.xpm | 24 - wxWidgets/art/delete.xpm | 42 - wxWidgets/art/dir_up.xpm | 52 - wxWidgets/art/down.xpm | 21 - wxWidgets/art/exefile.xpm | 73 - wxWidgets/art/fileopen.xpm | 57 - wxWidgets/art/filesave.xpm | 42 - wxWidgets/art/filesaveas.xpm | 44 - wxWidgets/art/find.xpm | 62 - wxWidgets/art/findrepl.xpm | 63 - wxWidgets/art/floppy.xpm | 39 - wxWidgets/art/folder.xpm | 43 - wxWidgets/art/folder_open.xpm | 52 - wxWidgets/art/forward.xpm | 21 - wxWidgets/art/harddisk.xpm | 60 - wxWidgets/art/helpicon.xpm | 44 - wxWidgets/art/home.xpm | 24 - wxWidgets/art/htmbook.xpm | 25 - wxWidgets/art/htmfoldr.xpm | 25 - wxWidgets/art/htmoptns.xpm | 20 - wxWidgets/art/htmpage.xpm | 23 - wxWidgets/art/htmsidep.xpm | 27 - wxWidgets/art/listview.xpm | 25 - wxWidgets/art/missimg.xpm | 43 - wxWidgets/art/new.xpm | 50 - wxWidgets/art/new_dir.xpm | 43 - wxWidgets/art/paste.xpm | 46 - wxWidgets/art/print.xpm | 60 - wxWidgets/art/quit.xpm | 90 - wxWidgets/art/redo.xpm | 58 - wxWidgets/art/removable.xpm | 44 - wxWidgets/art/repview.xpm | 24 - wxWidgets/art/tick.xpm | 17 - wxWidgets/art/tipicon.xpm | 47 - wxWidgets/art/toparent.xpm | 21 - wxWidgets/art/undo.xpm | 58 - wxWidgets/art/up.xpm | 21 - wxWidgets/art/wxwin.ico | Bin 1078 -> 0 bytes wxWidgets/art/wxwin16x16.png | Bin 1241 -> 0 bytes wxWidgets/art/wxwin16x16.xpm | 25 - wxWidgets/art/wxwin32x32.png | Bin 1267 -> 0 bytes wxWidgets/art/wxwin32x32.xpm | 41 - wxWidgets/build/msw/wx_adv.vcxproj | 3152 - wxWidgets/build/msw/wx_adv.vcxproj.filters | 250 - wxWidgets/build/msw/wx_aui.vcxproj | 2420 - wxWidgets/build/msw/wx_aui.vcxproj.filters | 85 - wxWidgets/build/msw/wx_base.vcxproj | 5394 -- wxWidgets/build/msw/wx_base.vcxproj.filters | 697 - wxWidgets/build/msw/wx_core.vcxproj | 13643 ---- wxWidgets/build/msw/wx_core.vcxproj.filters | 2281 - wxWidgets/build/msw/wx_dbgrid.vcxproj | 2244 - wxWidgets/build/msw/wx_dbgrid.vcxproj.filters | 49 - wxWidgets/build/msw/wx_gl.vcxproj | 2244 - wxWidgets/build/msw/wx_gl.vcxproj.filters | 46 - wxWidgets/build/msw/wx_html.vcxproj | 3043 - wxWidgets/build/msw/wx_html.vcxproj.filters | 178 - wxWidgets/build/msw/wx_media.vcxproj | 2381 - wxWidgets/build/msw/wx_media.vcxproj.filters | 64 - wxWidgets/build/msw/wx_net.vcxproj | 2629 - wxWidgets/build/msw/wx_net.vcxproj.filters | 115 - wxWidgets/build/msw/wx_odbc.vcxproj | 2280 - wxWidgets/build/msw/wx_odbc.vcxproj.filters | 58 - wxWidgets/build/msw/wx_qa.vcxproj | 2278 - wxWidgets/build/msw/wx_qa.vcxproj.filters | 55 - wxWidgets/build/msw/wx_richtext.vcxproj | 2524 - .../build/msw/wx_richtext.vcxproj.filters | 100 - wxWidgets/build/msw/wx_wxexpat.vcxproj | 1609 - .../build/msw/wx_wxexpat.vcxproj.filters | 19 - wxWidgets/build/msw/wx_wxjpeg.vcxproj | 3071 - wxWidgets/build/msw/wx_wxjpeg.vcxproj.filters | 148 - wxWidgets/build/msw/wx_wxpng.vcxproj | 2085 - wxWidgets/build/msw/wx_wxpng.vcxproj.filters | 61 - wxWidgets/build/msw/wx_wxregex.vcxproj | 1837 - .../build/msw/wx_wxregex.vcxproj.filters | 36 - wxWidgets/build/msw/wx_wxtiff.vcxproj | 2697 - wxWidgets/build/msw/wx_wxtiff.vcxproj.filters | 115 - wxWidgets/build/msw/wx_wxzlib.vcxproj | 1883 - wxWidgets/build/msw/wx_wxzlib.vcxproj.filters | 46 - wxWidgets/build/msw/wx_xml.vcxproj | 2279 - wxWidgets/build/msw/wx_xml.vcxproj.filters | 58 - wxWidgets/build/msw/wx_xrc.vcxproj | 4169 - wxWidgets/build/msw/wx_xrc.vcxproj.filters | 382 - wxWidgets/include/msvc/wx/setup.h | 249 - wxWidgets/include/wx/aboutdlg.h | 161 - wxWidgets/include/wx/accel.h | 170 - wxWidgets/include/wx/access.h | 377 - wxWidgets/include/wx/afterstd.h | 71 - wxWidgets/include/wx/anidecod.h | 77 - wxWidgets/include/wx/animate.h | 124 - wxWidgets/include/wx/animdecod.h | 146 - wxWidgets/include/wx/app.h | 708 - wxWidgets/include/wx/apptrait.h | 272 - wxWidgets/include/wx/archive.h | 381 - wxWidgets/include/wx/arrimpl.cpp | 120 - wxWidgets/include/wx/arrstr.h | 377 - wxWidgets/include/wx/artprov.h | 204 - wxWidgets/include/wx/aui/aui.h | 23 - wxWidgets/include/wx/aui/auibar.h | 685 - wxWidgets/include/wx/aui/auibook.h | 753 - wxWidgets/include/wx/aui/dockart.h | 173 - wxWidgets/include/wx/aui/floatpane.h | 81 - wxWidgets/include/wx/aui/framemanager.h | 856 - wxWidgets/include/wx/aui/tabmdi.h | 269 - wxWidgets/include/wx/beforestd.h | 75 - wxWidgets/include/wx/bitmap.h | 241 - wxWidgets/include/wx/bmpbuttn.h | 122 - wxWidgets/include/wx/bmpcbox.h | 49 - wxWidgets/include/wx/bookctrl.h | 403 - wxWidgets/include/wx/brush.h | 54 - wxWidgets/include/wx/buffer.h | 314 - wxWidgets/include/wx/build.h | 149 - wxWidgets/include/wx/busyinfo.h | 21 - wxWidgets/include/wx/button.h | 106 - wxWidgets/include/wx/calctrl.h | 232 - wxWidgets/include/wx/caret.h | 252 - wxWidgets/include/wx/checkbox.h | 156 - wxWidgets/include/wx/checklst.h | 64 - wxWidgets/include/wx/chkconf.h | 1871 - wxWidgets/include/wx/choicdlg.h | 22 - wxWidgets/include/wx/choice.h | 88 - wxWidgets/include/wx/choicebk.h | 154 - wxWidgets/include/wx/clipbrd.h | 145 - wxWidgets/include/wx/clntdata.h | 273 - wxWidgets/include/wx/clrpicker.h | 200 - wxWidgets/include/wx/cmdline.h | 239 - wxWidgets/include/wx/cmdproc.h | 144 - wxWidgets/include/wx/cmndata.h | 454 - wxWidgets/include/wx/collpane.h | 104 - wxWidgets/include/wx/colordlg.h | 41 - wxWidgets/include/wx/colour.h | 154 - wxWidgets/include/wx/combo.h | 757 - wxWidgets/include/wx/combobox.h | 97 - wxWidgets/include/wx/confbase.h | 359 - wxWidgets/include/wx/config.h | 33 - wxWidgets/include/wx/containr.h | 142 - wxWidgets/include/wx/control.h | 117 - wxWidgets/include/wx/convauto.h | 108 - wxWidgets/include/wx/cpp.h | 57 - wxWidgets/include/wx/cppunit.h | 129 - wxWidgets/include/wx/cshelp.h | 244 - wxWidgets/include/wx/ctrlsub.h | 210 - wxWidgets/include/wx/cursor.h | 79 - wxWidgets/include/wx/dataobj.h | 540 - wxWidgets/include/wx/dataview.h | 480 - wxWidgets/include/wx/datectrl.h | 112 - wxWidgets/include/wx/dateevt.h | 69 - wxWidgets/include/wx/datetime.h | 2137 - wxWidgets/include/wx/datstrm.h | 170 - wxWidgets/include/wx/db.h | 853 - wxWidgets/include/wx/dbgrid.h | 177 - wxWidgets/include/wx/dbkeyg.h | 41 - wxWidgets/include/wx/dbtable.h | 377 - wxWidgets/include/wx/dc.h | 1008 - wxWidgets/include/wx/dcbuffer.h | 276 - wxWidgets/include/wx/dcclient.h | 42 - wxWidgets/include/wx/dcgraph.h | 190 - wxWidgets/include/wx/dcmemory.h | 76 - wxWidgets/include/wx/dcmirror.h | 287 - wxWidgets/include/wx/dcprint.h | 33 - wxWidgets/include/wx/dcps.h | 18 - wxWidgets/include/wx/dcscreen.h | 42 - wxWidgets/include/wx/dde.h | 32 - wxWidgets/include/wx/debug.h | 316 - wxWidgets/include/wx/debugrpt.h | 235 - wxWidgets/include/wx/defs.h | 2907 - wxWidgets/include/wx/dialog.h | 167 - wxWidgets/include/wx/dialup.h | 201 - wxWidgets/include/wx/dir.h | 161 - wxWidgets/include/wx/dirctrl.h | 18 - wxWidgets/include/wx/dirdlg.h | 141 - wxWidgets/include/wx/display.h | 128 - wxWidgets/include/wx/display_impl.h | 110 - wxWidgets/include/wx/dlimpexp.h | 275 - wxWidgets/include/wx/dnd.h | 267 - wxWidgets/include/wx/docmdi.h | 107 - wxWidgets/include/wx/docview.h | 675 - wxWidgets/include/wx/dragimag.h | 54 - wxWidgets/include/wx/dynarray.h | 1044 - wxWidgets/include/wx/dynlib.h | 359 - wxWidgets/include/wx/dynload.h | 153 - wxWidgets/include/wx/effects.h | 75 - wxWidgets/include/wx/encconv.h | 159 - wxWidgets/include/wx/encinfo.h | 74 - wxWidgets/include/wx/event.h | 3121 - wxWidgets/include/wx/evtloop.h | 229 - wxWidgets/include/wx/except.h | 30 - wxWidgets/include/wx/fdrepdlg.h | 195 - wxWidgets/include/wx/features.h | 64 - wxWidgets/include/wx/ffile.h | 115 - wxWidgets/include/wx/file.h | 201 - wxWidgets/include/wx/fileconf.h | 246 - wxWidgets/include/wx/filedlg.h | 226 - wxWidgets/include/wx/filefn.h | 770 - wxWidgets/include/wx/filename.h | 547 - wxWidgets/include/wx/filepicker.h | 398 - wxWidgets/include/wx/filesys.h | 300 - wxWidgets/include/wx/flags.h | 165 - wxWidgets/include/wx/fmappriv.h | 74 - wxWidgets/include/wx/font.h | 251 - wxWidgets/include/wx/fontdlg.h | 118 - wxWidgets/include/wx/fontenc.h | 151 - wxWidgets/include/wx/fontenum.h | 88 - wxWidgets/include/wx/fontmap.h | 290 - wxWidgets/include/wx/fontpicker.h | 223 - wxWidgets/include/wx/fontutil.h | 242 - wxWidgets/include/wx/frame.h | 262 - wxWidgets/include/wx/fs_arc.h | 56 - wxWidgets/include/wx/fs_filter.h | 41 - wxWidgets/include/wx/fs_inet.h | 33 - wxWidgets/include/wx/fs_mem.h | 127 - wxWidgets/include/wx/fs_zip.h | 23 - wxWidgets/include/wx/gauge.h | 126 - wxWidgets/include/wx/gbsizer.h | 303 - wxWidgets/include/wx/gdicmn.h | 755 - wxWidgets/include/wx/gdiobj.h | 51 - wxWidgets/include/wx/generic/aboutdlgg.h | 87 - wxWidgets/include/wx/generic/accel.h | 50 - wxWidgets/include/wx/generic/animate.h | 178 - wxWidgets/include/wx/generic/bmpcbox.h | 170 - wxWidgets/include/wx/generic/busyinfo.h | 42 - wxWidgets/include/wx/generic/buttonbar.h | 123 - wxWidgets/include/wx/generic/calctrl.h | 324 - wxWidgets/include/wx/generic/caret.h | 95 - wxWidgets/include/wx/generic/choicdgg.h | 320 - wxWidgets/include/wx/generic/clrpickerg.h | 98 - wxWidgets/include/wx/generic/collpaneg.h | 105 - wxWidgets/include/wx/generic/colour.h | 75 - wxWidgets/include/wx/generic/colrdlgg.h | 120 - wxWidgets/include/wx/generic/combo.h | 140 - wxWidgets/include/wx/generic/dataview.h | 311 - wxWidgets/include/wx/generic/datectrl.h | 91 - wxWidgets/include/wx/generic/dcpsg.h | 154 - wxWidgets/include/wx/generic/dirctrlg.h | 295 - wxWidgets/include/wx/generic/dirdlgg.h | 89 - wxWidgets/include/wx/generic/dragimgg.h | 271 - wxWidgets/include/wx/generic/fdrepdlg.h | 71 - wxWidgets/include/wx/generic/filedlgg.h | 307 - wxWidgets/include/wx/generic/filepickerg.h | 213 - wxWidgets/include/wx/generic/fontdlgg.h | 120 - wxWidgets/include/wx/generic/fontpickerg.h | 82 - wxWidgets/include/wx/generic/grid.h | 2307 - wxWidgets/include/wx/generic/gridctrl.h | 158 - wxWidgets/include/wx/generic/gridsel.h | 88 - wxWidgets/include/wx/generic/helpext.h | 166 - wxWidgets/include/wx/generic/icon.h | 56 - wxWidgets/include/wx/generic/imaglist.h | 82 - wxWidgets/include/wx/generic/laywin.h | 222 - wxWidgets/include/wx/generic/listctrl.h | 280 - wxWidgets/include/wx/generic/logg.h | 129 - wxWidgets/include/wx/generic/mask.h | 54 - wxWidgets/include/wx/generic/mdig.h | 335 - wxWidgets/include/wx/generic/msgdlgg.h | 44 - wxWidgets/include/wx/generic/notebook.h | 160 - wxWidgets/include/wx/generic/numdlgg.h | 79 - wxWidgets/include/wx/generic/paletteg.h | 49 - wxWidgets/include/wx/generic/panelg.h | 95 - wxWidgets/include/wx/generic/printps.h | 68 - wxWidgets/include/wx/generic/prntdlgg.h | 256 - wxWidgets/include/wx/generic/progdlgg.h | 172 - wxWidgets/include/wx/generic/propdlg.h | 163 - wxWidgets/include/wx/generic/region.h | 79 - wxWidgets/include/wx/generic/sashwin.h | 261 - wxWidgets/include/wx/generic/scrolwin.h | 27 - wxWidgets/include/wx/generic/spinctlg.h | 183 - wxWidgets/include/wx/generic/splash.h | 92 - wxWidgets/include/wx/generic/splitter.h | 406 - wxWidgets/include/wx/generic/srchctlg.h | 275 - wxWidgets/include/wx/generic/statline.h | 62 - wxWidgets/include/wx/generic/statusbr.h | 107 - wxWidgets/include/wx/generic/tabg.h | 363 - wxWidgets/include/wx/generic/textdlgg.h | 113 - wxWidgets/include/wx/generic/timer.h | 45 - wxWidgets/include/wx/generic/treectlg.h | 383 - wxWidgets/include/wx/generic/wizard.h | 142 - wxWidgets/include/wx/geometry.h | 814 - wxWidgets/include/wx/gifdecod.h | 110 - wxWidgets/include/wx/glcanvas.h | 86 - wxWidgets/include/wx/graphics.h | 735 - wxWidgets/include/wx/grid.h | 18 - wxWidgets/include/wx/gsocket.h | 184 - wxWidgets/include/wx/hash.h | 630 - wxWidgets/include/wx/hashmap.h | 739 - wxWidgets/include/wx/hashset.h | 135 - wxWidgets/include/wx/help.h | 48 - wxWidgets/include/wx/helpbase.h | 106 - wxWidgets/include/wx/helphtml.h | 20 - wxWidgets/include/wx/helpwin.h | 22 - wxWidgets/include/wx/html/forcelnk.h | 62 - wxWidgets/include/wx/html/helpctrl.h | 153 - wxWidgets/include/wx/html/helpdata.h | 266 - wxWidgets/include/wx/html/helpdlg.h | 90 - wxWidgets/include/wx/html/helpfrm.h | 147 - wxWidgets/include/wx/html/helpwnd.h | 300 - wxWidgets/include/wx/html/htmlcell.h | 673 - wxWidgets/include/wx/html/htmldefs.h | 104 - wxWidgets/include/wx/html/htmlfilt.h | 82 - wxWidgets/include/wx/html/htmlpars.h | 283 - wxWidgets/include/wx/html/htmlproc.h | 58 - wxWidgets/include/wx/html/htmltag.h | 148 - wxWidgets/include/wx/html/htmlwin.h | 651 - wxWidgets/include/wx/html/htmprint.h | 305 - wxWidgets/include/wx/html/m_templ.h | 84 - wxWidgets/include/wx/html/webkit.h | 231 - wxWidgets/include/wx/html/winpars.h | 292 - wxWidgets/include/wx/htmllbox.h | 325 - wxWidgets/include/wx/hyperlink.h | 231 - wxWidgets/include/wx/icon.h | 53 - wxWidgets/include/wx/iconbndl.h | 69 - wxWidgets/include/wx/iconloc.h | 81 - wxWidgets/include/wx/imagbmp.h | 165 - wxWidgets/include/wx/image.h | 454 - wxWidgets/include/wx/imaggif.h | 48 - wxWidgets/include/wx/imagiff.h | 44 - wxWidgets/include/wx/imagjpeg.h | 48 - wxWidgets/include/wx/imaglist.h | 55 - wxWidgets/include/wx/imagpcx.h | 47 - wxWidgets/include/wx/imagpng.h | 60 - wxWidgets/include/wx/imagpnm.h | 46 - wxWidgets/include/wx/imagtga.h | 46 - wxWidgets/include/wx/imagtiff.h | 49 - wxWidgets/include/wx/imagxpm.h | 45 - wxWidgets/include/wx/init.h | 105 - wxWidgets/include/wx/intl.h | 632 - wxWidgets/include/wx/iosfwrap.h | 26 - wxWidgets/include/wx/ioswrap.h | 26 - wxWidgets/include/wx/ipc.h | 45 - wxWidgets/include/wx/ipcbase.h | 163 - wxWidgets/include/wx/isql.h | 248 - wxWidgets/include/wx/isqlext.h | 1178 - wxWidgets/include/wx/joystick.h | 38 - wxWidgets/include/wx/layout.h | 191 - wxWidgets/include/wx/laywin.h | 18 - wxWidgets/include/wx/link.h | 32 - wxWidgets/include/wx/list.h | 1308 - wxWidgets/include/wx/listbase.h | 491 - wxWidgets/include/wx/listbook.h | 152 - wxWidgets/include/wx/listbox.h | 166 - wxWidgets/include/wx/listctrl.h | 110 - wxWidgets/include/wx/listimpl.cpp | 39 - wxWidgets/include/wx/log.h | 653 - wxWidgets/include/wx/longlong.h | 1080 - wxWidgets/include/wx/math.h | 140 - wxWidgets/include/wx/matrix.h | 235 - wxWidgets/include/wx/mdi.h | 40 - wxWidgets/include/wx/mediactrl.h | 422 - wxWidgets/include/wx/memconf.h | 54 - wxWidgets/include/wx/memory.h | 373 - wxWidgets/include/wx/memtext.h | 54 - wxWidgets/include/wx/menu.h | 555 - wxWidgets/include/wx/menuitem.h | 203 - wxWidgets/include/wx/metafile.h | 62 - wxWidgets/include/wx/mimetype.h | 453 - wxWidgets/include/wx/minifram.h | 43 - wxWidgets/include/wx/module.h | 103 - wxWidgets/include/wx/msgdlg.h | 79 - wxWidgets/include/wx/msgout.h | 113 - wxWidgets/include/wx/mstream.h | 92 - wxWidgets/include/wx/msw/accel.h | 46 - wxWidgets/include/wx/msw/amd64.manifest | 22 - wxWidgets/include/wx/msw/app.h | 147 - wxWidgets/include/wx/msw/apptbase.h | 46 - wxWidgets/include/wx/msw/apptrait.h | 45 - wxWidgets/include/wx/msw/bitmap.h | 282 - wxWidgets/include/wx/msw/blank.cur | Bin 326 -> 0 bytes wxWidgets/include/wx/msw/bmpbuttn.h | 73 - wxWidgets/include/wx/msw/brush.h | 60 - wxWidgets/include/wx/msw/bullseye.cur | Bin 326 -> 0 bytes wxWidgets/include/wx/msw/button.h | 82 - wxWidgets/include/wx/msw/caret.h | 64 - wxWidgets/include/wx/msw/cdrom.ico | Bin 1718 -> 0 bytes wxWidgets/include/wx/msw/checkbox.h | 86 - wxWidgets/include/wx/msw/checklst.h | 96 - wxWidgets/include/wx/msw/child.ico | Bin 1078 -> 0 bytes wxWidgets/include/wx/msw/chkconf.h | 387 - wxWidgets/include/wx/msw/choice.h | 135 - wxWidgets/include/wx/msw/clipbrd.h | 98 - wxWidgets/include/wx/msw/colordlg.h | 56 - wxWidgets/include/wx/msw/colour.h | 88 - wxWidgets/include/wx/msw/colours.bmp | Bin 122 -> 0 bytes wxWidgets/include/wx/msw/combo.h | 111 - wxWidgets/include/wx/msw/combobox.h | 138 - wxWidgets/include/wx/msw/computer.ico | Bin 1718 -> 0 bytes wxWidgets/include/wx/msw/control.h | 141 - wxWidgets/include/wx/msw/crashrpt.h | 120 - wxWidgets/include/wx/msw/cross.cur | Bin 326 -> 0 bytes wxWidgets/include/wx/msw/csquery.bmp | Bin 206 -> 0 bytes wxWidgets/include/wx/msw/cursor.h | 47 - wxWidgets/include/wx/msw/datectrl.h | 70 - wxWidgets/include/wx/msw/dc.h | 345 - wxWidgets/include/wx/msw/dcclient.h | 118 - wxWidgets/include/wx/msw/dcmemory.h | 45 - wxWidgets/include/wx/msw/dcprint.h | 70 - wxWidgets/include/wx/msw/dcscreen.h | 40 - wxWidgets/include/wx/msw/dde.h | 144 - wxWidgets/include/wx/msw/debughlp.h | 228 - wxWidgets/include/wx/msw/dialog.h | 140 - wxWidgets/include/wx/msw/dib.h | 255 - wxWidgets/include/wx/msw/dirdlg.h | 35 - wxWidgets/include/wx/msw/dragimag.h | 274 - wxWidgets/include/wx/msw/drive.ico | Bin 1718 -> 0 bytes wxWidgets/include/wx/msw/enhmeta.h | 196 - wxWidgets/include/wx/msw/evtloop.h | 69 - wxWidgets/include/wx/msw/fdrepdlg.h | 62 - wxWidgets/include/wx/msw/file1.ico | Bin 1718 -> 0 bytes wxWidgets/include/wx/msw/filedlg.h | 55 - wxWidgets/include/wx/msw/floppy.ico | Bin 1718 -> 0 bytes wxWidgets/include/wx/msw/folder1.ico | Bin 1718 -> 0 bytes wxWidgets/include/wx/msw/folder2.ico | Bin 1718 -> 0 bytes wxWidgets/include/wx/msw/font.h | 148 - wxWidgets/include/wx/msw/fontdlg.h | 46 - wxWidgets/include/wx/msw/fontenum.h | 40 - wxWidgets/include/wx/msw/frame.h | 172 - wxWidgets/include/wx/msw/gauge95.h | 70 - wxWidgets/include/wx/msw/gccpriv.h | 127 - wxWidgets/include/wx/msw/gdiimage.h | 189 - wxWidgets/include/wx/msw/genrcdefs.h | 43 - wxWidgets/include/wx/msw/glcanvas.h | 128 - wxWidgets/include/wx/msw/gsockmsw.h | 145 - wxWidgets/include/wx/msw/hand.cur | Bin 326 -> 0 bytes wxWidgets/include/wx/msw/helpbest.h | 129 - wxWidgets/include/wx/msw/helpchm.h | 60 - wxWidgets/include/wx/msw/helpwin.h | 56 - wxWidgets/include/wx/msw/htmlhelp.h | 465 - wxWidgets/include/wx/msw/ia64.manifest | 22 - wxWidgets/include/wx/msw/icon.h | 95 - wxWidgets/include/wx/msw/imaglist.h | 206 - wxWidgets/include/wx/msw/iniconf.h | 101 - wxWidgets/include/wx/msw/joystick.h | 90 - wxWidgets/include/wx/msw/libraries.h | 27 - wxWidgets/include/wx/msw/listbox.h | 183 - wxWidgets/include/wx/msw/listctrl.h | 449 - wxWidgets/include/wx/msw/magnif1.cur | Bin 326 -> 0 bytes wxWidgets/include/wx/msw/mdi.h | 238 - wxWidgets/include/wx/msw/mdi.ico | Bin 1078 -> 0 bytes wxWidgets/include/wx/msw/menu.h | 241 - wxWidgets/include/wx/msw/menuitem.h | 100 - wxWidgets/include/wx/msw/metafile.h | 171 - wxWidgets/include/wx/msw/microwin.h | 235 - wxWidgets/include/wx/msw/mimetype.h | 122 - wxWidgets/include/wx/msw/minifram.h | 52 - wxWidgets/include/wx/msw/missing.h | 495 - wxWidgets/include/wx/msw/msgdlg.h | 42 - wxWidgets/include/wx/msw/mslu.h | 23 - wxWidgets/include/wx/msw/msvcrt.h | 69 - wxWidgets/include/wx/msw/notebook.h | 254 - wxWidgets/include/wx/msw/ole/access.h | 68 - wxWidgets/include/wx/msw/ole/activex.h | 221 - wxWidgets/include/wx/msw/ole/automtn.h | 101 - wxWidgets/include/wx/msw/ole/dataform.h | 68 - wxWidgets/include/wx/msw/ole/dataobj.h | 79 - wxWidgets/include/wx/msw/ole/dataobj2.h | 146 - wxWidgets/include/wx/msw/ole/dropsrc.h | 79 - wxWidgets/include/wx/msw/ole/droptgt.h | 72 - wxWidgets/include/wx/msw/ole/oleutils.h | 256 - wxWidgets/include/wx/msw/ole/uuid.h | 92 - wxWidgets/include/wx/msw/palette.h | 58 - wxWidgets/include/wx/msw/pbrush.cur | Bin 326 -> 0 bytes wxWidgets/include/wx/msw/pen.h | 132 - wxWidgets/include/wx/msw/pencil.cur | Bin 326 -> 0 bytes wxWidgets/include/wx/msw/pntleft.cur | Bin 326 -> 0 bytes wxWidgets/include/wx/msw/pntright.cur | Bin 326 -> 0 bytes wxWidgets/include/wx/msw/popupwin.h | 45 - wxWidgets/include/wx/msw/printdlg.h | 124 - wxWidgets/include/wx/msw/printwin.h | 66 - wxWidgets/include/wx/msw/private.h | 953 - wxWidgets/include/wx/msw/question.ico | Bin 2238 -> 0 bytes wxWidgets/include/wx/msw/radiobox.h | 175 - wxWidgets/include/wx/msw/radiobut.h | 70 - wxWidgets/include/wx/msw/rcdefs.h | 15 - wxWidgets/include/wx/msw/regconf.h | 116 - wxWidgets/include/wx/msw/region.h | 104 - wxWidgets/include/wx/msw/registry.h | 247 - wxWidgets/include/wx/msw/removble.ico | Bin 1718 -> 0 bytes wxWidgets/include/wx/msw/rightarr.cur | Bin 326 -> 0 bytes wxWidgets/include/wx/msw/roller.cur | Bin 326 -> 0 bytes wxWidgets/include/wx/msw/scrolbar.h | 72 - wxWidgets/include/wx/msw/seh.h | 74 - wxWidgets/include/wx/msw/setup.h | 1361 - wxWidgets/include/wx/msw/setup0.h | 1361 - wxWidgets/include/wx/msw/setup_microwin.h | 1179 - wxWidgets/include/wx/msw/slider95.h | 137 - wxWidgets/include/wx/msw/sound.h | 52 - wxWidgets/include/wx/msw/spinbutt.h | 72 - wxWidgets/include/wx/msw/spinctrl.h | 142 - wxWidgets/include/wx/msw/stackwalk.h | 103 - wxWidgets/include/wx/msw/statbmp.h | 90 - wxWidgets/include/wx/msw/statbox.h | 73 - wxWidgets/include/wx/msw/statbr95.h | 76 - wxWidgets/include/wx/msw/statline.h | 52 - wxWidgets/include/wx/msw/stattext.h | 56 - wxWidgets/include/wx/msw/std.ico | Bin 1078 -> 0 bytes wxWidgets/include/wx/msw/stdpaths.h | 53 - wxWidgets/include/wx/msw/subwin.h | 195 - wxWidgets/include/wx/msw/tabctrl.h | 160 - wxWidgets/include/wx/msw/taskbar.h | 82 - wxWidgets/include/wx/msw/tbar95.h | 156 - wxWidgets/include/wx/msw/textctrl.h | 291 - wxWidgets/include/wx/msw/tglbtn.h | 60 - wxWidgets/include/wx/msw/timer.h | 40 - wxWidgets/include/wx/msw/tooltip.h | 71 - wxWidgets/include/wx/msw/toplevel.h | 197 - wxWidgets/include/wx/msw/treectrl.h | 315 - wxWidgets/include/wx/msw/uxtheme.h | 230 - wxWidgets/include/wx/msw/uxthemep.h | 169 - wxWidgets/include/wx/msw/wince/checklst.h | 95 - wxWidgets/include/wx/msw/wince/chkconf.h | 100 - wxWidgets/include/wx/msw/wince/choicece.h | 142 - wxWidgets/include/wx/msw/wince/helpwce.h | 58 - wxWidgets/include/wx/msw/wince/libraries.h | 59 - wxWidgets/include/wx/msw/wince/missing.h | 140 - wxWidgets/include/wx/msw/wince/net.h | 21 - wxWidgets/include/wx/msw/wince/resources.h | 25 - wxWidgets/include/wx/msw/wince/setup.h | 1295 - wxWidgets/include/wx/msw/wince/smartphone.rc | 67 - wxWidgets/include/wx/msw/wince/tbarwce.h | 168 - wxWidgets/include/wx/msw/wince/textctrlce.h | 236 - wxWidgets/include/wx/msw/wince/time.h | 53 - wxWidgets/include/wx/msw/wince/wince.rc | 26 - wxWidgets/include/wx/msw/window.h | 601 - wxWidgets/include/wx/msw/winundef.h | 490 - wxWidgets/include/wx/msw/wrapcctl.h | 62 - wxWidgets/include/wx/msw/wrapcdlg.h | 28 - wxWidgets/include/wx/msw/wrapshl.h | 90 - wxWidgets/include/wx/msw/wrapwin.h | 99 - wxWidgets/include/wx/msw/wx.manifest | 22 - wxWidgets/include/wx/msw/wx.rc | 119 - wxWidgets/include/wx/notebook.h | 183 - wxWidgets/include/wx/numdlg.h | 23 - wxWidgets/include/wx/object.h | 569 - wxWidgets/include/wx/odcombo.h | 393 - wxWidgets/include/wx/overlay.h | 97 - wxWidgets/include/wx/ownerdrw.h | 184 - wxWidgets/include/wx/palette.h | 59 - wxWidgets/include/wx/panel.h | 18 - wxWidgets/include/wx/paper.h | 122 - wxWidgets/include/wx/pen.h | 40 - wxWidgets/include/wx/pickerbase.h | 189 - wxWidgets/include/wx/platform.h | 664 - wxWidgets/include/wx/platinfo.h | 313 - wxWidgets/include/wx/popupwin.h | 192 - wxWidgets/include/wx/power.h | 111 - wxWidgets/include/wx/print.h | 39 - wxWidgets/include/wx/printdlg.h | 122 - wxWidgets/include/wx/private/browserhack28.h | 20 - wxWidgets/include/wx/private/fileback.h | 83 - wxWidgets/include/wx/private/filename.h | 56 - wxWidgets/include/wx/private/fontmgr.h | 255 - wxWidgets/include/wx/private/overlay.h | 72 - .../include/wx/private/socketevtdispatch.h | 67 - wxWidgets/include/wx/prntbase.h | 665 - wxWidgets/include/wx/process.h | 172 - wxWidgets/include/wx/progdlg.h | 36 - wxWidgets/include/wx/propdlg.h | 19 - wxWidgets/include/wx/protocol/file.h | 37 - wxWidgets/include/wx/protocol/ftp.h | 182 - wxWidgets/include/wx/protocol/http.h | 91 - wxWidgets/include/wx/protocol/protocol.h | 131 - wxWidgets/include/wx/ptr_scpd.h | 222 - wxWidgets/include/wx/quantize.h | 76 - wxWidgets/include/wx/radiobox.h | 181 - wxWidgets/include/wx/radiobut.h | 61 - wxWidgets/include/wx/rawbmp.h | 713 - wxWidgets/include/wx/recguard.h | 53 - wxWidgets/include/wx/regex.h | 166 - wxWidgets/include/wx/region.h | 300 - wxWidgets/include/wx/renderer.h | 436 - .../include/wx/richtext/richtextbuffer.h | 2398 - .../include/wx/richtext/richtextbulletspage.h | 217 - wxWidgets/include/wx/richtext/richtextctrl.h | 984 - .../include/wx/richtext/richtextfontpage.h | 167 - .../include/wx/richtext/richtextformatdlg.h | 327 - wxWidgets/include/wx/richtext/richtexthtml.h | 148 - .../include/wx/richtext/richtextindentspage.h | 165 - .../wx/richtext/richtextliststylepage.h | 276 - wxWidgets/include/wx/richtext/richtextprint.h | 247 - .../include/wx/richtext/richtextstyledlg.h | 241 - .../include/wx/richtext/richtextstylepage.h | 91 - .../include/wx/richtext/richtextstyles.h | 683 - .../include/wx/richtext/richtextsymboldlg.h | 370 - .../include/wx/richtext/richtexttabspage.h | 129 - wxWidgets/include/wx/richtext/richtextxml.h | 79 - wxWidgets/include/wx/sashwin.h | 18 - wxWidgets/include/wx/sckaddr.h | 193 - wxWidgets/include/wx/sckipc.h | 150 - wxWidgets/include/wx/sckstrm.h | 72 - wxWidgets/include/wx/scopeguard.h | 373 - wxWidgets/include/wx/scrolbar.h | 80 - wxWidgets/include/wx/scrolwin.h | 314 - wxWidgets/include/wx/selstore.h | 104 - wxWidgets/include/wx/settings.h | 214 - wxWidgets/include/wx/setup.h | 1361 - wxWidgets/include/wx/setup_inc.h | 1198 - wxWidgets/include/wx/setup_redirect.h | 18 - wxWidgets/include/wx/sizer.h | 1092 - wxWidgets/include/wx/slider.h | 151 - wxWidgets/include/wx/snglinst.h | 65 - wxWidgets/include/wx/socket.h | 335 - wxWidgets/include/wx/sound.h | 98 - wxWidgets/include/wx/spinbutt.h | 129 - wxWidgets/include/wx/spinctrl.h | 83 - wxWidgets/include/wx/splash.h | 18 - wxWidgets/include/wx/splitter.h | 47 - wxWidgets/include/wx/srchctrl.h | 91 - wxWidgets/include/wx/sstream.h | 103 - wxWidgets/include/wx/stack.h | 44 - wxWidgets/include/wx/stackwalk.h | 156 - wxWidgets/include/wx/statbmp.h | 74 - wxWidgets/include/wx/statbox.h | 74 - wxWidgets/include/wx/statline.h | 103 - wxWidgets/include/wx/stattext.h | 69 - wxWidgets/include/wx/statusbr.h | 174 - wxWidgets/include/wx/stdpaths.h | 179 - wxWidgets/include/wx/stockitem.h | 73 - wxWidgets/include/wx/stopwatch.h | 102 - wxWidgets/include/wx/strconv.h | 553 - wxWidgets/include/wx/stream.h | 609 - wxWidgets/include/wx/string.h | 1653 - wxWidgets/include/wx/sysopt.h | 71 - wxWidgets/include/wx/tab.h | 22 - wxWidgets/include/wx/tabctrl.h | 34 - wxWidgets/include/wx/tarstrm.h | 352 - wxWidgets/include/wx/taskbar.h | 124 - wxWidgets/include/wx/tbarbase.h | 607 - wxWidgets/include/wx/textbuf.h | 208 - wxWidgets/include/wx/textctrl.h | 601 - wxWidgets/include/wx/textdlg.h | 23 - wxWidgets/include/wx/textfile.h | 62 - wxWidgets/include/wx/tglbtn.h | 51 - wxWidgets/include/wx/thread.h | 764 - wxWidgets/include/wx/thrimpl.cpp | 332 - wxWidgets/include/wx/timer.h | 201 - wxWidgets/include/wx/tipdlg.h | 84 - wxWidgets/include/wx/tipwin.h | 98 - wxWidgets/include/wx/tokenzr.h | 135 - wxWidgets/include/wx/toolbar.h | 93 - wxWidgets/include/wx/toolbook.h | 163 - wxWidgets/include/wx/tooltip.h | 39 - wxWidgets/include/wx/toplevel.h | 375 - wxWidgets/include/wx/treebase.h | 426 - wxWidgets/include/wx/treebook.h | 283 - wxWidgets/include/wx/treectrl.h | 459 - wxWidgets/include/wx/txtstrm.h | 160 - wxWidgets/include/wx/types.h | 93 - wxWidgets/include/wx/univ/app.h | 21 - wxWidgets/include/wx/univ/bmpbuttn.h | 72 - wxWidgets/include/wx/univ/button.h | 139 - wxWidgets/include/wx/univ/checkbox.h | 150 - wxWidgets/include/wx/univ/checklst.h | 114 - wxWidgets/include/wx/univ/chkconf.h | 117 - wxWidgets/include/wx/univ/choice.h | 64 - wxWidgets/include/wx/univ/colschem.h | 103 - wxWidgets/include/wx/univ/combobox.h | 167 - wxWidgets/include/wx/univ/control.h | 102 - wxWidgets/include/wx/univ/dialog.h | 88 - wxWidgets/include/wx/univ/frame.h | 92 - wxWidgets/include/wx/univ/gauge.h | 75 - wxWidgets/include/wx/univ/inpcons.h | 153 - wxWidgets/include/wx/univ/inphand.h | 116 - wxWidgets/include/wx/univ/listbox.h | 300 - wxWidgets/include/wx/univ/menu.h | 282 - wxWidgets/include/wx/univ/menuitem.h | 135 - wxWidgets/include/wx/univ/notebook.h | 257 - wxWidgets/include/wx/univ/radiobox.h | 151 - wxWidgets/include/wx/univ/radiobut.h | 76 - wxWidgets/include/wx/univ/renderer.h | 932 - wxWidgets/include/wx/univ/scrarrow.h | 112 - wxWidgets/include/wx/univ/scrolbar.h | 283 - wxWidgets/include/wx/univ/scrthumb.h | 140 - wxWidgets/include/wx/univ/scrtimer.h | 51 - wxWidgets/include/wx/univ/setup.h | 1328 - wxWidgets/include/wx/univ/setup0.h | 1328 - wxWidgets/include/wx/univ/slider.h | 226 - wxWidgets/include/wx/univ/spinbutt.h | 122 - wxWidgets/include/wx/univ/statbmp.h | 74 - wxWidgets/include/wx/univ/statbox.h | 65 - wxWidgets/include/wx/univ/statline.h | 56 - wxWidgets/include/wx/univ/stattext.h | 66 - wxWidgets/include/wx/univ/statusbr.h | 110 - wxWidgets/include/wx/univ/stdrend.h | 352 - wxWidgets/include/wx/univ/textctrl.h | 534 - wxWidgets/include/wx/univ/tglbtn.h | 70 - wxWidgets/include/wx/univ/theme.h | 202 - wxWidgets/include/wx/univ/toolbar.h | 138 - wxWidgets/include/wx/univ/toplevel.h | 197 - wxWidgets/include/wx/univ/window.h | 287 - wxWidgets/include/wx/unix/apptbase.h | 54 - wxWidgets/include/wx/unix/apptrait.h | 55 - wxWidgets/include/wx/unix/execute.h | 79 - wxWidgets/include/wx/unix/fontutil.h | 37 - wxWidgets/include/wx/unix/gsockunx.h | 145 - wxWidgets/include/wx/unix/joystick.h | 95 - wxWidgets/include/wx/unix/mimetype.h | 215 - wxWidgets/include/wx/unix/pipe.h | 114 - wxWidgets/include/wx/unix/private.h | 47 - wxWidgets/include/wx/unix/sound.h | 161 - wxWidgets/include/wx/unix/stackwalk.h | 97 - wxWidgets/include/wx/unix/stdpaths.h | 56 - wxWidgets/include/wx/unix/taskbarx11.h | 46 - wxWidgets/include/wx/unix/utilsx11.h | 53 - wxWidgets/include/wx/uri.h | 151 - wxWidgets/include/wx/url.h | 129 - wxWidgets/include/wx/utils.h | 747 - wxWidgets/include/wx/valgen.h | 69 - wxWidgets/include/wx/validate.h | 98 - wxWidgets/include/wx/valtext.h | 122 - wxWidgets/include/wx/variant.h | 423 - wxWidgets/include/wx/vector.h | 212 - wxWidgets/include/wx/version.h | 91 - wxWidgets/include/wx/vidmode.h | 73 - wxWidgets/include/wx/vlbox.h | 296 - wxWidgets/include/wx/vms_x_fix.h | 1213 - wxWidgets/include/wx/volume.h | 146 - wxWidgets/include/wx/vscroll.h | 223 - wxWidgets/include/wx/wave.h | 36 - wxWidgets/include/wx/wfstream.h | 204 - wxWidgets/include/wx/window.h | 1671 - wxWidgets/include/wx/wizard.h | 323 - wxWidgets/include/wx/wupdlock.h | 37 - wxWidgets/include/wx/wx.h | 105 - wxWidgets/include/wx/wx_cw.h | 65 - wxWidgets/include/wx/wx_cw_cm.h | 88 - wxWidgets/include/wx/wx_cw_d.h | 46 - wxWidgets/include/wx/wx_cwc.h | 49 - wxWidgets/include/wx/wx_cwc_d.h | 38 - wxWidgets/include/wx/wx_cwcocoa.h | 66 - wxWidgets/include/wx/wx_cwcocoa_cm.h | 85 - wxWidgets/include/wx/wx_cwcocoa_d.h | 47 - wxWidgets/include/wx/wx_cwu_d.h | 46 - wxWidgets/include/wx/wxchar.h | 1413 - wxWidgets/include/wx/wxhtml.h | 22 - wxWidgets/include/wx/wxprec.h | 70 - wxWidgets/include/wx/wxshlb_cw.h | 65 - wxWidgets/include/wx/wxshlb_cw_d.h | 46 - wxWidgets/include/wx/wxshlb_cwc.h | 45 - wxWidgets/include/wx/wxshlb_cwc_d.h | 38 - wxWidgets/include/wx/wxshlba_cw.h | 65 - wxWidgets/include/wx/wxshlba_cw_d.h | 46 - wxWidgets/include/wx/wxshlba_cwc.h | 45 - wxWidgets/include/wx/wxshlba_cwc_d.h | 38 - wxWidgets/include/wx/xml/xml.h | 272 - wxWidgets/include/wx/xpmdecod.h | 47 - wxWidgets/include/wx/xpmhand.h | 25 - wxWidgets/include/wx/xrc/xh_all.h | 74 - wxWidgets/include/wx/xrc/xh_animatctrl.h | 30 - wxWidgets/include/wx/xrc/xh_bmp.h | 40 - wxWidgets/include/wx/xrc/xh_bmpbt.h | 30 - wxWidgets/include/wx/xrc/xh_bmpcbox.h | 36 - wxWidgets/include/wx/xrc/xh_bttn.h | 30 - wxWidgets/include/wx/xrc/xh_cald.h | 30 - wxWidgets/include/wx/xrc/xh_chckb.h | 31 - wxWidgets/include/wx/xrc/xh_chckl.h | 34 - wxWidgets/include/wx/xrc/xh_choic.h | 34 - wxWidgets/include/wx/xrc/xh_choicbk.h | 34 - wxWidgets/include/wx/xrc/xh_clrpicker.h | 30 - wxWidgets/include/wx/xrc/xh_collpane.h | 36 - wxWidgets/include/wx/xrc/xh_combo.h | 34 - wxWidgets/include/wx/xrc/xh_datectrl.h | 30 - wxWidgets/include/wx/xrc/xh_dirpicker.h | 30 - wxWidgets/include/wx/xrc/xh_dlg.h | 30 - wxWidgets/include/wx/xrc/xh_filepicker.h | 30 - wxWidgets/include/wx/xrc/xh_fontpicker.h | 30 - wxWidgets/include/wx/xrc/xh_frame.h | 30 - wxWidgets/include/wx/xrc/xh_gauge.h | 34 - wxWidgets/include/wx/xrc/xh_gdctl.h | 30 - wxWidgets/include/wx/xrc/xh_grid.h | 31 - wxWidgets/include/wx/xrc/xh_html.h | 30 - wxWidgets/include/wx/xrc/xh_htmllbox.h | 34 - wxWidgets/include/wx/xrc/xh_hyperlink.h | 37 - wxWidgets/include/wx/xrc/xh_listb.h | 34 - wxWidgets/include/wx/xrc/xh_listbk.h | 34 - wxWidgets/include/wx/xrc/xh_listc.h | 30 - wxWidgets/include/wx/xrc/xh_mdi.h | 35 - wxWidgets/include/wx/xrc/xh_menu.h | 43 - wxWidgets/include/wx/xrc/xh_notbk.h | 35 - wxWidgets/include/wx/xrc/xh_odcombo.h | 35 - wxWidgets/include/wx/xrc/xh_panel.h | 30 - wxWidgets/include/wx/xrc/xh_propdlg.h | 38 - wxWidgets/include/wx/xrc/xh_radbt.h | 30 - wxWidgets/include/wx/xrc/xh_radbx.h | 43 - wxWidgets/include/wx/xrc/xh_richtext.h | 30 - wxWidgets/include/wx/xrc/xh_scrol.h | 36 - wxWidgets/include/wx/xrc/xh_scwin.h | 30 - wxWidgets/include/wx/xrc/xh_sizer.h | 80 - wxWidgets/include/wx/xrc/xh_slidr.h | 36 - wxWidgets/include/wx/xrc/xh_spin.h | 61 - wxWidgets/include/wx/xrc/xh_split.h | 30 - wxWidgets/include/wx/xrc/xh_statbar.h | 30 - wxWidgets/include/wx/xrc/xh_stbmp.h | 30 - wxWidgets/include/wx/xrc/xh_stbox.h | 30 - wxWidgets/include/wx/xrc/xh_stlin.h | 30 - wxWidgets/include/wx/xrc/xh_sttxt.h | 30 - wxWidgets/include/wx/xrc/xh_text.h | 30 - wxWidgets/include/wx/xrc/xh_tglbtn.h | 30 - wxWidgets/include/wx/xrc/xh_toolb.h | 36 - wxWidgets/include/wx/xrc/xh_tree.h | 30 - wxWidgets/include/wx/xrc/xh_treebk.h | 83 - wxWidgets/include/wx/xrc/xh_unkwn.h | 30 - wxWidgets/include/wx/xrc/xh_wizrd.h | 37 - wxWidgets/include/wx/xrc/xmlres.h | 528 - wxWidgets/include/wx/xti.h | 2102 - wxWidgets/include/wx/xtistrm.h | 429 - wxWidgets/include/wx/xtixml.h | 106 - wxWidgets/include/wx/zipstrm.h | 574 - wxWidgets/include/wx/zstream.h | 146 - wxWidgets/include/wx_pb.h | 20 - wxWidgets/src/Wxwindll.icc | 314 - wxWidgets/src/aui/auibar.cpp | 2682 - wxWidgets/src/aui/auibook.cpp | 4610 -- wxWidgets/src/aui/descrip.mms | 72 - wxWidgets/src/aui/dockart.cpp | 771 - wxWidgets/src/aui/floatpane.cpp | 323 - wxWidgets/src/aui/framemanager.cpp | 4683 -- wxWidgets/src/aui/tabmdi.cpp | 837 - wxWidgets/src/common/accesscmn.cpp | 26 - wxWidgets/src/common/anidecod.cpp | 345 - wxWidgets/src/common/animatecmn.cpp | 103 - wxWidgets/src/common/appbase.cpp | 846 - wxWidgets/src/common/appcmn.cpp | 691 - wxWidgets/src/common/arcall.cpp | 41 - wxWidgets/src/common/arcfind.cpp | 43 - wxWidgets/src/common/archive.cpp | 98 - wxWidgets/src/common/artprov.cpp | 354 - wxWidgets/src/common/artstd.cpp | 267 - wxWidgets/src/common/base.rc | 49 - wxWidgets/src/common/bmpbase.cpp | 211 - wxWidgets/src/common/bookctrl.cpp | 497 - wxWidgets/src/common/choiccmn.cpp | 55 - wxWidgets/src/common/clipcmn.cpp | 63 - wxWidgets/src/common/clntdata.cpp | 83 - wxWidgets/src/common/clrpickercmn.cpp | 149 - wxWidgets/src/common/cmdline.cpp | 1246 - wxWidgets/src/common/cmdproc.cpp | 325 - wxWidgets/src/common/cmndata.cpp | 660 - wxWidgets/src/common/colourcmn.cpp | 126 - wxWidgets/src/common/combocmn.cpp | 2340 - wxWidgets/src/common/config.cpp | 490 - wxWidgets/src/common/containr.cpp | 678 - wxWidgets/src/common/convauto.cpp | 214 - wxWidgets/src/common/cshelp.cpp | 512 - wxWidgets/src/common/ctrlcmn.cpp | 188 - wxWidgets/src/common/ctrlsub.cpp | 197 - wxWidgets/src/common/datacmn.cpp | 83 - wxWidgets/src/common/datavcmn.cpp | 911 - wxWidgets/src/common/datetime.cpp | 4615 -- wxWidgets/src/common/datstrm.cpp | 745 - wxWidgets/src/common/db.cpp | 4524 -- wxWidgets/src/common/dbgrid.cpp | 727 - wxWidgets/src/common/dbtable.cpp | 2946 - wxWidgets/src/common/dcbase.cpp | 1174 - wxWidgets/src/common/dcbufcmn.cpp | 95 - wxWidgets/src/common/dcgraph.cpp | 1034 - wxWidgets/src/common/debugrpt.cpp | 698 - wxWidgets/src/common/descrip.mms | 583 - wxWidgets/src/common/dircmn.cpp | 357 - wxWidgets/src/common/dlgcmn.cpp | 565 - wxWidgets/src/common/dndcmn.cpp | 31 - wxWidgets/src/common/dobjcmn.cpp | 517 - wxWidgets/src/common/docmdi.cpp | 206 - wxWidgets/src/common/docview.cpp | 2491 - wxWidgets/src/common/dpycmn.cpp | 269 - wxWidgets/src/common/dseldlg.cpp | 55 - wxWidgets/src/common/dummy.cpp | 32 - wxWidgets/src/common/dynarray.cpp | 527 - wxWidgets/src/common/dynlib.cpp | 323 - wxWidgets/src/common/dynload.cpp | 362 - wxWidgets/src/common/effects.cpp | 124 - wxWidgets/src/common/emptydmy.cpp | 3 - wxWidgets/src/common/encconv.cpp | 531 - wxWidgets/src/common/event.cpp | 1499 - wxWidgets/src/common/evtloopcmn.cpp | 172 - wxWidgets/src/common/execcmn.cpp | 122 - wxWidgets/src/common/extended.c | 196 - wxWidgets/src/common/fddlgcmn.cpp | 102 - wxWidgets/src/common/ffile.cpp | 256 - wxWidgets/src/common/file.cpp | 559 - wxWidgets/src/common/fileback.cpp | 338 - wxWidgets/src/common/fileconf.cpp | 2131 - wxWidgets/src/common/filefn.cpp | 2123 - wxWidgets/src/common/filename.cpp | 2558 - wxWidgets/src/common/filepickercmn.cpp | 224 - wxWidgets/src/common/filesys.cpp | 700 - wxWidgets/src/common/filtall.cpp | 36 - wxWidgets/src/common/filtfind.cpp | 43 - wxWidgets/src/common/fldlgcmn.cpp | 348 - wxWidgets/src/common/fmapbase.cpp | 737 - wxWidgets/src/common/fontcmn.cpp | 784 - wxWidgets/src/common/fontenumcmn.cpp | 131 - wxWidgets/src/common/fontmap.cpp | 519 - wxWidgets/src/common/fontmgrcmn.cpp | 348 - wxWidgets/src/common/fontpickercmn.cpp | 181 - wxWidgets/src/common/framecmn.cpp | 590 - wxWidgets/src/common/fs_arc.cpp | 533 - wxWidgets/src/common/fs_filter.cpp | 92 - wxWidgets/src/common/fs_inet.cpp | 167 - wxWidgets/src/common/fs_mem.cpp | 288 - wxWidgets/src/common/ftp.cpp | 1008 - wxWidgets/src/common/gaugecmn.cpp | 156 - wxWidgets/src/common/gbsizer.cpp | 784 - wxWidgets/src/common/gdicmn.cpp | 871 - wxWidgets/src/common/geometry.cpp | 364 - wxWidgets/src/common/gifdecod.cpp | 933 - wxWidgets/src/common/glob.inc | 367 - wxWidgets/src/common/graphcmn.cpp | 776 - wxWidgets/src/common/hash.cpp | 1077 - wxWidgets/src/common/hashmap.cpp | 152 - wxWidgets/src/common/helpbase.cpp | 28 - wxWidgets/src/common/http.cpp | 422 - wxWidgets/src/common/iconbndl.cpp | 142 - wxWidgets/src/common/imagall.cpp | 64 - wxWidgets/src/common/imagbmp.cpp | 1383 - wxWidgets/src/common/image.cpp | 3126 - wxWidgets/src/common/imagfill.cpp | 325 - wxWidgets/src/common/imaggif.cpp | 105 - wxWidgets/src/common/imagiff.cpp | 794 - wxWidgets/src/common/imagjpeg.cpp | 480 - wxWidgets/src/common/imagpcx.cpp | 500 - wxWidgets/src/common/imagpng.cpp | 869 - wxWidgets/src/common/imagpnm.cpp | 201 - wxWidgets/src/common/imagtga.cpp | 750 - wxWidgets/src/common/imagtiff.cpp | 525 - wxWidgets/src/common/imagxpm.cpp | 224 - wxWidgets/src/common/init.cpp | 505 - wxWidgets/src/common/intl.cpp | 3784 - wxWidgets/src/common/ipcbase.cpp | 87 - wxWidgets/src/common/layout.cpp | 1026 - wxWidgets/src/common/lboxcmn.cpp | 147 - wxWidgets/src/common/list.cpp | 768 - wxWidgets/src/common/listctrlcmn.cpp | 54 - wxWidgets/src/common/log.cpp | 838 - wxWidgets/src/common/longlong.cpp | 1363 - wxWidgets/src/common/matrix.cpp | 601 - wxWidgets/src/common/mediactrlcmn.cpp | 559 - wxWidgets/src/common/memory.cpp | 1148 - wxWidgets/src/common/menucmn.cpp | 1173 - wxWidgets/src/common/mimecmn.cpp | 752 - wxWidgets/src/common/module.cpp | 202 - wxWidgets/src/common/msgout.cpp | 222 - wxWidgets/src/common/mstream.cpp | 174 - wxWidgets/src/common/nbkbase.cpp | 84 - wxWidgets/src/common/object.cpp | 390 - wxWidgets/src/common/overlaycmn.cpp | 197 - wxWidgets/src/common/paper.cpp | 376 - wxWidgets/src/common/pickerbase.cpp | 175 - wxWidgets/src/common/platinfo.cpp | 336 - wxWidgets/src/common/popupcmn.cpp | 623 - wxWidgets/src/common/powercmn.cpp | 59 - wxWidgets/src/common/prntbase.cpp | 1869 - wxWidgets/src/common/process.cpp | 172 - wxWidgets/src/common/protocol.cpp | 215 - wxWidgets/src/common/quantize.cpp | 1654 - wxWidgets/src/common/radiocmn.cpp | 304 - wxWidgets/src/common/regex.cpp | 689 - wxWidgets/src/common/rendcmn.cpp | 208 - wxWidgets/src/common/rgncmn.cpp | 192 - wxWidgets/src/common/sckaddr.cpp | 349 - wxWidgets/src/common/sckfile.cpp | 57 - wxWidgets/src/common/sckipc.cpp | 769 - wxWidgets/src/common/sckstrm.cpp | 135 - wxWidgets/src/common/settcmn.cpp | 88 - wxWidgets/src/common/sizer.cpp | 2265 - wxWidgets/src/common/socket.cpp | 1420 - wxWidgets/src/common/socketevtdispatch.cpp | 339 - wxWidgets/src/common/srchcmn.cpp | 42 - wxWidgets/src/common/sstream.cpp | 235 - wxWidgets/src/common/statbar.cpp | 368 - wxWidgets/src/common/stdpbase.cpp | 172 - wxWidgets/src/common/stockitem.cpp | 278 - wxWidgets/src/common/stopwatch.cpp | 372 - wxWidgets/src/common/strconv.cpp | 3742 - wxWidgets/src/common/stream.cpp | 1388 - wxWidgets/src/common/string.cpp | 2659 - wxWidgets/src/common/sysopt.cpp | 111 - wxWidgets/src/common/tarstrm.cpp | 1534 - wxWidgets/src/common/taskbarcmn.cpp | 54 - wxWidgets/src/common/tbarbase.cpp | 746 - wxWidgets/src/common/textbuf.cpp | 284 - wxWidgets/src/common/textcmn.cpp | 553 - wxWidgets/src/common/textfile.cpp | 295 - wxWidgets/src/common/timercmn.cpp | 88 - wxWidgets/src/common/tokenzr.cpp | 229 - wxWidgets/src/common/toplvcmn.cpp | 431 - wxWidgets/src/common/treebase.cpp | 239 - wxWidgets/src/common/txtstrm.cpp | 520 - wxWidgets/src/common/unictabl.inc | 872 - wxWidgets/src/common/uri.cpp | 1295 - wxWidgets/src/common/url.cpp | 533 - wxWidgets/src/common/utilscmn.cpp | 1417 - wxWidgets/src/common/valgen.cpp | 591 - wxWidgets/src/common/validate.cpp | 45 - wxWidgets/src/common/valtext.cpp | 344 - wxWidgets/src/common/variant.cpp | 2040 - wxWidgets/src/common/wfstream.cpp | 418 - wxWidgets/src/common/wincmn.cpp | 3255 - wxWidgets/src/common/wxchar.cpp | 2293 - wxWidgets/src/common/xpmdecod.cpp | 833 - wxWidgets/src/common/xti.cpp | 767 - wxWidgets/src/common/xtistrm.cpp | 847 - wxWidgets/src/common/xtixml.cpp | 538 - wxWidgets/src/common/zipstrm.cpp | 2425 - wxWidgets/src/common/zstream.cpp | 428 - wxWidgets/src/cwcopysetup.bat | 32 - wxWidgets/src/cwdcopysetup.bat | 32 - wxWidgets/src/cygnus.bat | 11 - wxWidgets/src/expat/COPYING | 22 - wxWidgets/src/expat/Changes | 107 - wxWidgets/src/expat/MANIFEST | 92 - wxWidgets/src/expat/Makefile.in | 173 - wxWidgets/src/expat/README | 112 - wxWidgets/src/expat/aclocal.m4 | 6035 -- wxWidgets/src/expat/bcb5/README.txt | 86 - wxWidgets/src/expat/bcb5/elements.bpf | 4 - wxWidgets/src/expat/bcb5/elements.bpr | 149 - wxWidgets/src/expat/bcb5/elements.mak | 186 - wxWidgets/src/expat/bcb5/expat.bpf | 6 - wxWidgets/src/expat/bcb5/expat.bpr | 140 - wxWidgets/src/expat/bcb5/expat.mak | 187 - wxWidgets/src/expat/bcb5/expat_static.bpf | 5 - wxWidgets/src/expat/bcb5/expat_static.bpr | 143 - wxWidgets/src/expat/bcb5/expat_static.mak | 189 - wxWidgets/src/expat/bcb5/expatw.bpf | 6 - wxWidgets/src/expat/bcb5/expatw.bpr | 146 - wxWidgets/src/expat/bcb5/expatw.mak | 187 - wxWidgets/src/expat/bcb5/expatw_static.bpf | 5 - wxWidgets/src/expat/bcb5/expatw_static.bpr | 152 - wxWidgets/src/expat/bcb5/expatw_static.mak | 190 - wxWidgets/src/expat/bcb5/libexpat_mtd.def | 133 - wxWidgets/src/expat/bcb5/libexpatw_mtd.def | 133 - wxWidgets/src/expat/bcb5/makefile.mak | 37 - wxWidgets/src/expat/bcb5/outline.bpf | 4 - wxWidgets/src/expat/bcb5/outline.bpr | 132 - wxWidgets/src/expat/bcb5/outline.mak | 186 - wxWidgets/src/expat/bcb5/setup.bat | 9 - wxWidgets/src/expat/bcb5/xmlwf.bpf | 7 - wxWidgets/src/expat/bcb5/xmlwf.bpr | 136 - wxWidgets/src/expat/bcb5/xmlwf.mak | 187 - wxWidgets/src/expat/configure | 10129 --- wxWidgets/src/expat/configure.in | 127 - wxWidgets/src/expat/conftools/PrintPath | 116 - .../expat/conftools/ac_c_bigendian_cross.m4 | 81 - wxWidgets/src/expat/conftools/config.guess | 1344 - wxWidgets/src/expat/conftools/config.sub | 1507 - wxWidgets/src/expat/conftools/expat.m4 | 43 - wxWidgets/src/expat/conftools/install-sh | 251 - wxWidgets/src/expat/conftools/libtool.m4 | 3573 - wxWidgets/src/expat/conftools/ltmain.sh | 4984 -- wxWidgets/src/expat/conftools/mkinstalldirs | 40 - wxWidgets/src/expat/doc/reference.html | 1896 - wxWidgets/src/expat/doc/style.css | 51 - wxWidgets/src/expat/doc/valid-xhtml10.png | Bin 2414 -> 0 bytes wxWidgets/src/expat/doc/xmlwf.1 | 251 - wxWidgets/src/expat/doc/xmlwf.sgml | 473 - wxWidgets/src/expat/examples/elements.c | 50 - wxWidgets/src/expat/examples/outline.c | 90 - wxWidgets/src/expat/expat.dsp | 110 - wxWidgets/src/expat/expat_config.h.in | 89 - wxWidgets/src/expat/lib/ascii.h | 85 - wxWidgets/src/expat/lib/asciitab.h | 36 - wxWidgets/src/expat/lib/dosconfig.h | 25 - wxWidgets/src/expat/lib/expat.h | 918 - wxWidgets/src/expat/lib/iasciitab.h | 37 - wxWidgets/src/expat/lib/internal.h | 77 - wxWidgets/src/expat/lib/latin1tab.h | 36 - wxWidgets/src/expat/lib/macconfig.h | 104 - wxWidgets/src/expat/lib/nametab.h | 150 - wxWidgets/src/expat/lib/os2config.h | 26 - wxWidgets/src/expat/lib/utf8tab.h | 37 - wxWidgets/src/expat/lib/winconfig.h | 30 - wxWidgets/src/expat/lib/xmlparse.c | 5711 -- wxWidgets/src/expat/lib/xmlrole.c | 1325 - wxWidgets/src/expat/lib/xmlrole.h | 114 - wxWidgets/src/expat/lib/xmltok.c | 1636 - wxWidgets/src/expat/lib/xmltok.h | 315 - wxWidgets/src/expat/lib/xmltok_impl.c | 1779 - wxWidgets/src/expat/lib/xmltok_impl.h | 46 - wxWidgets/src/expat/lib/xmltok_ns.c | 106 - wxWidgets/src/expat/vms/README.vms | 23 - wxWidgets/src/expat/vms/descrip.mms | 69 - wxWidgets/src/expat/vms/expat_config.h | 61 - wxWidgets/src/expat/win32/MANIFEST.txt | 29 - wxWidgets/src/expat/win32/expat.iss | 61 - wxWidgets/src/expat/xmlwf/codepage.c | 68 - wxWidgets/src/expat/xmlwf/codepage.h | 6 - wxWidgets/src/expat/xmlwf/ct.c | 147 - wxWidgets/src/expat/xmlwf/filemap.h | 17 - wxWidgets/src/expat/xmlwf/readfilemap.c | 78 - wxWidgets/src/expat/xmlwf/unixfilemap.c | 58 - wxWidgets/src/expat/xmlwf/win32filemap.c | 96 - wxWidgets/src/expat/xmlwf/xmlfile.c | 231 - wxWidgets/src/expat/xmlwf/xmlfile.h | 10 - wxWidgets/src/expat/xmlwf/xmlmime.c | 163 - wxWidgets/src/expat/xmlwf/xmlmime.h | 19 - wxWidgets/src/expat/xmlwf/xmltchar.h | 36 - wxWidgets/src/expat/xmlwf/xmlurl.h | 13 - wxWidgets/src/expat/xmlwf/xmlwf.c | 842 - wxWidgets/src/expat/xmlwf/xmlwin32url.cxx | 395 - wxWidgets/src/generic/aboutdlgg.cpp | 258 - wxWidgets/src/generic/accel.cpp | 220 - wxWidgets/src/generic/animateg.cpp | 690 - wxWidgets/src/generic/bmpcboxg.cpp | 477 - wxWidgets/src/generic/busyinfo.cpp | 135 - wxWidgets/src/generic/buttonbar.cpp | 555 - wxWidgets/src/generic/calctrl.cpp | 1838 - wxWidgets/src/generic/caret.cpp | 310 - wxWidgets/src/generic/choicbkg.cpp | 332 - wxWidgets/src/generic/choicdgg.cpp | 556 - wxWidgets/src/generic/clrpickerg.cpp | 188 - wxWidgets/src/generic/collpaneg.cpp | 307 - wxWidgets/src/generic/colour.cpp | 72 - wxWidgets/src/generic/colrdlgg.cpp | 586 - wxWidgets/src/generic/combog.cpp | 489 - wxWidgets/src/generic/datavgen.cpp | 1911 - wxWidgets/src/generic/datectlg.cpp | 545 - wxWidgets/src/generic/dbgrptg.cpp | 525 - wxWidgets/src/generic/dcpsg.cpp | 2262 - wxWidgets/src/generic/descrip.mms | 276 - wxWidgets/src/generic/dirctrlg.cpp | 1700 - wxWidgets/src/generic/dirdlgg.cpp | 369 - wxWidgets/src/generic/dragimgg.cpp | 574 - wxWidgets/src/generic/fdrepdlg.cpp | 291 - wxWidgets/src/generic/filedlgg.cpp | 1645 - wxWidgets/src/generic/filepickerg.cpp | 86 - wxWidgets/src/generic/fontdlgg.cpp | 623 - wxWidgets/src/generic/fontpickerg.cpp | 120 - wxWidgets/src/generic/graphicc.cpp | 1615 - wxWidgets/src/generic/grid.cpp | 11472 --- wxWidgets/src/generic/gridctrl.cpp | 418 - wxWidgets/src/generic/gridsel.cpp | 1177 - wxWidgets/src/generic/helpext.cpp | 485 - wxWidgets/src/generic/htmllbox.cpp | 682 - wxWidgets/src/generic/hyperlink.cpp | 285 - wxWidgets/src/generic/icon.cpp | 45 - wxWidgets/src/generic/imaglist.cpp | 278 - wxWidgets/src/generic/laywin.cpp | 341 - wxWidgets/src/generic/listbkg.cpp | 416 - wxWidgets/src/generic/listctrl.cpp | 5976 -- wxWidgets/src/generic/logg.cpp | 1229 - wxWidgets/src/generic/mask.cpp | 76 - wxWidgets/src/generic/mdig.cpp | 820 - wxWidgets/src/generic/msgdlgg.cpp | 159 - wxWidgets/src/generic/notebook.cpp | 762 - wxWidgets/src/generic/numdlgg.cpp | 181 - wxWidgets/src/generic/odcombo.cpp | 1126 - wxWidgets/src/generic/paletteg.cpp | 145 - wxWidgets/src/generic/panelg.cpp | 180 - wxWidgets/src/generic/printps.cpp | 370 - wxWidgets/src/generic/prntdlgg.cpp | 1102 - wxWidgets/src/generic/progdlgg.cpp | 673 - wxWidgets/src/generic/propdlg.cpp | 226 - wxWidgets/src/generic/regiong.cpp | 1919 - wxWidgets/src/generic/renderg.cpp | 678 - wxWidgets/src/generic/sashwin.cpp | 708 - wxWidgets/src/generic/scrlwing.cpp | 1542 - wxWidgets/src/generic/selstore.cpp | 216 - wxWidgets/src/generic/spinctlg.cpp | 391 - wxWidgets/src/generic/splash.cpp | 202 - wxWidgets/src/generic/splitter.cpp | 1064 - wxWidgets/src/generic/srchctlg.cpp | 1216 - wxWidgets/src/generic/statline.cpp | 88 - wxWidgets/src/generic/statusbr.cpp | 488 - wxWidgets/src/generic/tabg.cpp | 1290 - wxWidgets/src/generic/textdlgg.cpp | 185 - wxWidgets/src/generic/timer.cpp | 283 - wxWidgets/src/generic/tipdlg.cpp | 347 - wxWidgets/src/generic/tipwin.cpp | 380 - wxWidgets/src/generic/toolbkg.cpp | 442 - wxWidgets/src/generic/treebkg.cpp | 794 - wxWidgets/src/generic/treectlg.cpp | 3823 - wxWidgets/src/generic/vlbox.cpp | 653 - wxWidgets/src/generic/vscroll.cpp | 519 - wxWidgets/src/generic/wizard.cpp | 882 - wxWidgets/src/html/chm.cpp | 914 - wxWidgets/src/html/descrip.mms | 96 - wxWidgets/src/html/helpctrl.cpp | 442 - wxWidgets/src/html/helpdata.cpp | 1077 - wxWidgets/src/html/helpdlg.cpp | 132 - wxWidgets/src/html/helpfrm.cpp | 241 - wxWidgets/src/html/helpwnd.cpp | 1774 - wxWidgets/src/html/htmlcell.cpp | 1609 - wxWidgets/src/html/htmlctrl/webkit/webkit.mm | 892 - wxWidgets/src/html/htmlfilt.cpp | 223 - wxWidgets/src/html/htmlpars.cpp | 961 - wxWidgets/src/html/htmltag.cpp | 521 - wxWidgets/src/html/htmlwin.cpp | 1683 - wxWidgets/src/html/htmprint.cpp | 728 - wxWidgets/src/html/m_dflist.cpp | 86 - wxWidgets/src/html/m_fonts.cpp | 322 - wxWidgets/src/html/m_hline.cpp | 111 - wxWidgets/src/html/m_image.cpp | 735 - wxWidgets/src/html/m_layout.cpp | 474 - wxWidgets/src/html/m_links.cpp | 107 - wxWidgets/src/html/m_list.cpp | 307 - wxWidgets/src/html/m_pre.cpp | 144 - wxWidgets/src/html/m_style.cpp | 46 - wxWidgets/src/html/m_tables.cpp | 799 - wxWidgets/src/html/winpars.cpp | 853 - wxWidgets/src/iodbc/AUTHORS | 4 - wxWidgets/src/iodbc/COPYING | 482 - wxWidgets/src/iodbc/Changes.log | 67 - wxWidgets/src/iodbc/IAFA-PACKAGE | 40 - wxWidgets/src/iodbc/INSTALL | 182 - wxWidgets/src/iodbc/NEWS | 8 - wxWidgets/src/iodbc/README | 187 - wxWidgets/src/iodbc/autoconfig | 230 - wxWidgets/src/iodbc/catalog.c | 987 - wxWidgets/src/iodbc/config.h | 100 - wxWidgets/src/iodbc/connect.c | 1241 - wxWidgets/src/iodbc/dlf.c | 612 - wxWidgets/src/iodbc/dlf.h | 55 - wxWidgets/src/iodbc/dlproc.c | 119 - wxWidgets/src/iodbc/dlproc.h | 55 - wxWidgets/src/iodbc/execute.c | 768 - wxWidgets/src/iodbc/fetch.c | 649 - wxWidgets/src/iodbc/hdbc.c | 811 - wxWidgets/src/iodbc/hdbc.h | 93 - wxWidgets/src/iodbc/henv.c | 89 - wxWidgets/src/iodbc/henv.ci | 117 - wxWidgets/src/iodbc/henv.h | 160 - wxWidgets/src/iodbc/herr.c | 378 - wxWidgets/src/iodbc/herr.ci | 124 - wxWidgets/src/iodbc/herr.h | 153 - wxWidgets/src/iodbc/hstmt.c | 600 - wxWidgets/src/iodbc/hstmt.h | 75 - wxWidgets/src/iodbc/info.c | 521 - wxWidgets/src/iodbc/iodbc.h | 66 - wxWidgets/src/iodbc/isql.h | 235 - wxWidgets/src/iodbc/isqlext.h | 1177 - wxWidgets/src/iodbc/itrace.c | 117 - wxWidgets/src/iodbc/itrace.h | 124 - wxWidgets/src/iodbc/misc.c | 413 - wxWidgets/src/iodbc/prepare.c | 525 - wxWidgets/src/iodbc/result.c | 523 - wxWidgets/src/iodbc/shrsub.exp | 64 - wxWidgets/src/jpeg/MAKEFILE.VA | 335 - wxWidgets/src/jpeg/README | 385 - wxWidgets/src/jpeg/ansi2knr.1 | 36 - wxWidgets/src/jpeg/ansi2knr.c | 693 - wxWidgets/src/jpeg/change.log | 217 - wxWidgets/src/jpeg/jcapimin.c | 280 - wxWidgets/src/jpeg/jcapistd.c | 161 - wxWidgets/src/jpeg/jccoefct.c | 449 - wxWidgets/src/jpeg/jccolor.c | 459 - wxWidgets/src/jpeg/jcdctmgr.c | 387 - wxWidgets/src/jpeg/jchuff.c | 909 - wxWidgets/src/jpeg/jchuff.h | 47 - wxWidgets/src/jpeg/jcinit.c | 72 - wxWidgets/src/jpeg/jcmainct.c | 293 - wxWidgets/src/jpeg/jcmarker.c | 664 - wxWidgets/src/jpeg/jcmaster.c | 590 - wxWidgets/src/jpeg/jcomapi.c | 106 - wxWidgets/src/jpeg/jconfig.h | 109 - wxWidgets/src/jpeg/jconfig.vc | 45 - wxWidgets/src/jpeg/jcparam.c | 610 - wxWidgets/src/jpeg/jcphuff.c | 833 - wxWidgets/src/jpeg/jcprepct.c | 354 - wxWidgets/src/jpeg/jcsample.c | 519 - wxWidgets/src/jpeg/jctrans.c | 402 - wxWidgets/src/jpeg/jdapimin.c | 395 - wxWidgets/src/jpeg/jdapistd.c | 275 - wxWidgets/src/jpeg/jdatadst.c | 151 - wxWidgets/src/jpeg/jdatasrc.c | 212 - wxWidgets/src/jpeg/jdcoefct.c | 745 - wxWidgets/src/jpeg/jdcolor.c | 410 - wxWidgets/src/jpeg/jdct.h | 176 - wxWidgets/src/jpeg/jddctmgr.c | 269 - wxWidgets/src/jpeg/jdhuff.c | 651 - wxWidgets/src/jpeg/jdhuff.h | 201 - wxWidgets/src/jpeg/jdinput.c | 385 - wxWidgets/src/jpeg/jdmainct.c | 529 - wxWidgets/src/jpeg/jdmarker.c | 1360 - wxWidgets/src/jpeg/jdmaster.c | 557 - wxWidgets/src/jpeg/jdmerge.c | 399 - wxWidgets/src/jpeg/jdphuff.c | 668 - wxWidgets/src/jpeg/jdpostct.c | 290 - wxWidgets/src/jpeg/jdsample.c | 478 - wxWidgets/src/jpeg/jdtrans.c | 143 - wxWidgets/src/jpeg/jerror.c | 252 - wxWidgets/src/jpeg/jerror.h | 291 - wxWidgets/src/jpeg/jfdctflt.c | 168 - wxWidgets/src/jpeg/jfdctfst.c | 224 - wxWidgets/src/jpeg/jfdctint.c | 283 - wxWidgets/src/jpeg/jidctflt.c | 242 - wxWidgets/src/jpeg/jidctfst.c | 368 - wxWidgets/src/jpeg/jidctint.c | 389 - wxWidgets/src/jpeg/jidctred.c | 398 - wxWidgets/src/jpeg/jinclude.h | 91 - wxWidgets/src/jpeg/jmemansi.c | 167 - wxWidgets/src/jpeg/jmemdos.c | 638 - wxWidgets/src/jpeg/jmemdosa.asm | 379 - wxWidgets/src/jpeg/jmemmac.c | 289 - wxWidgets/src/jpeg/jmemmgr.c | 1118 - wxWidgets/src/jpeg/jmemname.c | 276 - wxWidgets/src/jpeg/jmemnobs.c | 109 - wxWidgets/src/jpeg/jmemsys.h | 198 - wxWidgets/src/jpeg/jmorecfg.h | 420 - wxWidgets/src/jpeg/jpeg.dsp | 872 - wxWidgets/src/jpeg/jpegM8.xml | 3328 - wxWidgets/src/jpeg/jpeg_CW_Prefix.h | 6 - wxWidgets/src/jpeg/jpegint.h | 400 - wxWidgets/src/jpeg/jpeglib.h | 1096 - wxWidgets/src/jpeg/jpegtran.1 | 238 - wxWidgets/src/jpeg/jpegtran.c | 504 - wxWidgets/src/jpeg/jquant1.c | 856 - wxWidgets/src/jpeg/jquant2.c | 1310 - wxWidgets/src/jpeg/jutils.c | 179 - wxWidgets/src/jpeg/jversion.h | 14 - wxWidgets/src/jpeg/makefile.unx | 36 - wxWidgets/src/jpeg/makefile.vc | 201 - wxWidgets/src/makeb32.env | 173 - wxWidgets/src/makebcc.env | 34 - wxWidgets/src/makefile.va | 35 - wxWidgets/src/makefile.vc | 35 - wxWidgets/src/makeg95.env | 437 - wxWidgets/src/makelib.b32 | 32 - wxWidgets/src/makelib.bcc | 37 - wxWidgets/src/makelib.g95 | 24 - wxWidgets/src/makelib.vc | 49 - wxWidgets/src/makemsc.env | 72 - wxWidgets/src/makeprog.b32 | 118 - wxWidgets/src/makeprog.bcc | 35 - wxWidgets/src/makeprog.g95 | 32 - wxWidgets/src/makeprog.sl | 28 - wxWidgets/src/makeprog.va | 59 - wxWidgets/src/makeprog.vc | 79 - wxWidgets/src/makesl.env | 53 - wxWidgets/src/makeva.env | 200 - wxWidgets/src/makevc.env | 335 - wxWidgets/src/mingegcs.bat | 17 - wxWidgets/src/mingw32.bat | 16 - wxWidgets/src/msw/aboutdlg.cpp | 70 - wxWidgets/src/msw/accel.cpp | 160 - wxWidgets/src/msw/app.cpp | 809 - wxWidgets/src/msw/basemsw.cpp | 73 - wxWidgets/src/msw/bitmap.cpp | 1809 - wxWidgets/src/msw/bmpbuttn.cpp | 646 - wxWidgets/src/msw/brush.cpp | 327 - wxWidgets/src/msw/button.cpp | 890 - wxWidgets/src/msw/caret.cpp | 188 - wxWidgets/src/msw/checkbox.cpp | 588 - wxWidgets/src/msw/checklst.cpp | 546 - wxWidgets/src/msw/choice.cpp | 802 - wxWidgets/src/msw/clipbrd.cpp | 931 - wxWidgets/src/msw/colordlg.cpp | 224 - wxWidgets/src/msw/colour.cpp | 90 - wxWidgets/src/msw/combo.cpp | 920 - wxWidgets/src/msw/combobox.cpp | 808 - wxWidgets/src/msw/control.cpp | 483 - wxWidgets/src/msw/crashrpt.cpp | 383 - wxWidgets/src/msw/cursor.cpp | 407 - wxWidgets/src/msw/data.cpp | 18 - wxWidgets/src/msw/datectrl.cpp | 368 - wxWidgets/src/msw/dc.cpp | 2780 - wxWidgets/src/msw/dcclient.cpp | 357 - wxWidgets/src/msw/dcmemory.cpp | 194 - wxWidgets/src/msw/dcprint.cpp | 484 - wxWidgets/src/msw/dcscreen.cpp | 38 - wxWidgets/src/msw/dde.cpp | 1095 - wxWidgets/src/msw/debughlp.cpp | 767 - wxWidgets/src/msw/dialog.cpp | 497 - wxWidgets/src/msw/dialup.cpp | 1338 - wxWidgets/src/msw/dib.cpp | 814 - wxWidgets/src/msw/dir.cpp | 404 - wxWidgets/src/msw/dirdlg.cpp | 251 - wxWidgets/src/msw/display.cpp | 1047 - wxWidgets/src/msw/dlmsw.cpp | 339 - wxWidgets/src/msw/dragimag.cpp | 458 - wxWidgets/src/msw/enhmeta.cpp | 527 - wxWidgets/src/msw/evtloop.cpp | 296 - wxWidgets/src/msw/fdrepdlg.cpp | 546 - wxWidgets/src/msw/filedlg.cpp | 568 - wxWidgets/src/msw/font.cpp | 1122 - wxWidgets/src/msw/fontdlg.cpp | 131 - wxWidgets/src/msw/fontenum.cpp | 292 - wxWidgets/src/msw/fontutil.cpp | 294 - wxWidgets/src/msw/frame.cpp | 1163 - wxWidgets/src/msw/gauge95.cpp | 280 - wxWidgets/src/msw/gdiimage.cpp | 609 - wxWidgets/src/msw/gdiobj.cpp | 60 - wxWidgets/src/msw/glcanvas.cpp | 665 - wxWidgets/src/msw/graphics.cpp | 1680 - wxWidgets/src/msw/gsocket.cpp | 1569 - wxWidgets/src/msw/gsockmsw.cpp | 487 - wxWidgets/src/msw/helpbest.cpp | 103 - wxWidgets/src/msw/helpchm.cpp | 252 - wxWidgets/src/msw/helpwin.cpp | 126 - wxWidgets/src/msw/icon.cpp | 158 - wxWidgets/src/msw/imaglist.cpp | 402 - wxWidgets/src/msw/iniconf.cpp | 457 - wxWidgets/src/msw/joystick.cpp | 627 - wxWidgets/src/msw/listbox.cpp | 878 - wxWidgets/src/msw/listctrl.cpp | 3237 - wxWidgets/src/msw/main.cpp | 409 - wxWidgets/src/msw/makebase.b32 | 456 - wxWidgets/src/msw/makebase.vc | 264 - wxWidgets/src/msw/makefile.mic | 356 - wxWidgets/src/msw/makefile.sl | 914 - wxWidgets/src/msw/mdi.cpp | 1500 - wxWidgets/src/msw/mediactrl.cpp | 4172 - wxWidgets/src/msw/mediactrl_am.cpp | 2273 - wxWidgets/src/msw/mediactrl_qt.cpp | 1312 - wxWidgets/src/msw/mediactrl_wmp10.cpp | 1516 - wxWidgets/src/msw/menu.cpp | 1397 - wxWidgets/src/msw/menuitem.cpp | 446 - wxWidgets/src/msw/metafile.cpp | 533 - wxWidgets/src/msw/microwin.c | 365 - wxWidgets/src/msw/mimetype.cpp | 850 - wxWidgets/src/msw/minifram.cpp | 25 - wxWidgets/src/msw/msgdlg.cpp | 154 - wxWidgets/src/msw/mslu.cpp | 248 - wxWidgets/src/msw/nativdlg.cpp | 330 - wxWidgets/src/msw/notebook.cpp | 1454 - wxWidgets/src/msw/ole/access.cpp | 2014 - wxWidgets/src/msw/ole/activex.cpp | 1158 - wxWidgets/src/msw/ole/automtn.cpp | 969 - wxWidgets/src/msw/ole/dataobj.cpp | 1343 - wxWidgets/src/msw/ole/dropsrc.cpp | 248 - wxWidgets/src/msw/ole/droptgt.cpp | 575 - wxWidgets/src/msw/ole/oleutils.cpp | 322 - wxWidgets/src/msw/ole/uuid.cpp | 184 - wxWidgets/src/msw/ownerdrw.cpp | 487 - wxWidgets/src/msw/palette.cpp | 164 - wxWidgets/src/msw/pen.cpp | 387 - wxWidgets/src/msw/penwin.cpp | 114 - wxWidgets/src/msw/popupwin.cpp | 113 - wxWidgets/src/msw/power.cpp | 112 - wxWidgets/src/msw/printdlg.cpp | 1175 - wxWidgets/src/msw/printwin.cpp | 447 - wxWidgets/src/msw/radiobox.cpp | 886 - wxWidgets/src/msw/radiobut.cpp | 349 - wxWidgets/src/msw/regconf.cpp | 731 - wxWidgets/src/msw/region.cpp | 468 - wxWidgets/src/msw/registry.cpp | 1428 - wxWidgets/src/msw/renderer.cpp | 709 - wxWidgets/src/msw/salford.lnk | 152 - wxWidgets/src/msw/scrolbar.cpp | 342 - wxWidgets/src/msw/settings.cpp | 498 - wxWidgets/src/msw/slider95.cpp | 686 - wxWidgets/src/msw/snglinst.cpp | 130 - wxWidgets/src/msw/sound.cpp | 209 - wxWidgets/src/msw/spinbutt.cpp | 340 - wxWidgets/src/msw/spinctrl.cpp | 720 - wxWidgets/src/msw/stackwalk.cpp | 414 - wxWidgets/src/msw/statbmp.cpp | 345 - wxWidgets/src/msw/statbox.cpp | 570 - wxWidgets/src/msw/statbr95.cpp | 417 - wxWidgets/src/msw/statline.cpp | 131 - wxWidgets/src/msw/stattext.cpp | 222 - wxWidgets/src/msw/stdpaths.cpp | 344 - wxWidgets/src/msw/tabctrl.cpp | 432 - wxWidgets/src/msw/taskbar.cpp | 327 - wxWidgets/src/msw/tbar95.cpp | 1848 - wxWidgets/src/msw/textctrl.cpp | 2967 - wxWidgets/src/msw/tglbtn.cpp | 170 - wxWidgets/src/msw/thread.cpp | 1408 - wxWidgets/src/msw/timer.cpp | 262 - wxWidgets/src/msw/tooltip.cpp | 464 - wxWidgets/src/msw/toplevel.cpp | 1287 - wxWidgets/src/msw/treectrl.cpp | 3161 - wxWidgets/src/msw/urlmsw.cpp | 249 - wxWidgets/src/msw/utils.cpp | 1576 - wxWidgets/src/msw/utilsexc.cpp | 1003 - wxWidgets/src/msw/utilsgui.cpp | 503 - wxWidgets/src/msw/uxtheme.cpp | 177 - wxWidgets/src/msw/version.rc | 62 - wxWidgets/src/msw/volume.cpp | 608 - wxWidgets/src/msw/wince/checklst.cpp | 425 - wxWidgets/src/msw/wince/choicece.cpp | 588 - wxWidgets/src/msw/wince/clean_vcp.py | 49 - wxWidgets/src/msw/wince/crt.cpp | 72 - wxWidgets/src/msw/wince/filedlgwce.cpp | 133 - wxWidgets/src/msw/wince/filefnwce.cpp | 211 - wxWidgets/src/msw/wince/helpwce.cpp | 123 - wxWidgets/src/msw/wince/menuce.cpp | 277 - wxWidgets/src/msw/wince/net.cpp | 243 - wxWidgets/src/msw/wince/tbarwce.cpp | 655 - wxWidgets/src/msw/wince/textctrlce.cpp | 1214 - wxWidgets/src/msw/wince/time.cpp | 762 - wxWidgets/src/msw/window.cpp | 6891 -- wxWidgets/src/msw/winestub.c | 45 - wxWidgets/src/ntwxwin.mak | 3 - wxWidgets/src/png/ANNOUNCE | 29 - wxWidgets/src/png/CHANGES | 1373 - wxWidgets/src/png/INSTALL | 167 - wxWidgets/src/png/KNOWNBUG | 11 - wxWidgets/src/png/LICENSE | 109 - wxWidgets/src/png/MAKEFILE.VA | 139 - wxWidgets/src/png/README | 260 - wxWidgets/src/png/TODO | 24 - wxWidgets/src/png/Y2KINFO | 55 - wxWidgets/src/png/ansi2knr.1 | 36 - wxWidgets/src/png/ansi2knr.c | 695 - wxWidgets/src/png/configure | 13 - wxWidgets/src/png/example.c | 808 - wxWidgets/src/png/libpng.3 | 4016 - wxWidgets/src/png/libpng.txt | 2958 - wxWidgets/src/png/libpngpf.3 | 1096 - wxWidgets/src/png/makefile.unx | 30 - wxWidgets/src/png/makefile.vc | 31 - wxWidgets/src/png/png.5 | 74 - wxWidgets/src/png/png.c | 826 - wxWidgets/src/png/png.dsp | 160 - wxWidgets/src/png/png.h | 3364 - wxWidgets/src/png/pngM8.xml | 2760 - wxWidgets/src/png/pngasmrd.h | 11 - wxWidgets/src/png/pngbar.jpg | Bin 2498 -> 0 bytes wxWidgets/src/png/pngbar.png | Bin 2399 -> 0 bytes wxWidgets/src/png/pngconf.h | 1394 - wxWidgets/src/png/pngerror.c | 295 - wxWidgets/src/png/pnggccrd.c | 5408 -- wxWidgets/src/png/pngget.c | 934 - wxWidgets/src/png/pngmem.c | 595 - wxWidgets/src/png/pngnow.png | Bin 2069 -> 0 bytes wxWidgets/src/png/pngpread.c | 1573 - wxWidgets/src/png/pngread.c | 1453 - wxWidgets/src/png/pngrio.c | 161 - wxWidgets/src/png/pngrtran.c | 4177 - wxWidgets/src/png/pngrutil.c | 3124 - wxWidgets/src/png/pngset.c | 1219 - wxWidgets/src/png/pngtest.c | 1554 - wxWidgets/src/png/pngtest.png | Bin 8574 -> 0 bytes wxWidgets/src/png/pngtrans.c | 644 - wxWidgets/src/png/pngvcrd.c | 3903 - wxWidgets/src/png/pngwio.c | 228 - wxWidgets/src/png/pngwrite.c | 1464 - wxWidgets/src/png/pngwtran.c | 563 - wxWidgets/src/png/pngwutil.c | 2726 - .../src/png/projects/beos/x86-shared.proj | Bin 7699 -> 0 bytes .../src/png/projects/beos/x86-shared.txt | 22 - .../src/png/projects/beos/x86-static.proj | Bin 7699 -> 0 bytes .../src/png/projects/beos/x86-static.txt | 22 - .../src/png/projects/cbuilder5/libpng.bpf | 22 - .../src/png/projects/cbuilder5/libpng.bpg | 25 - .../src/png/projects/cbuilder5/libpng.bpr | 157 - .../src/png/projects/cbuilder5/libpng.cpp | 29 - .../png/projects/cbuilder5/libpng.readme.txt | 25 - .../src/png/projects/cbuilder5/libpngstat.bpf | 22 - .../src/png/projects/cbuilder5/libpngstat.bpr | 109 - .../png/projects/cbuilder5/zlib.readme.txt | 14 - wxWidgets/src/png/projects/netware.txt | 6 - .../src/png/projects/visualc6/README.txt | 64 - .../src/png/projects/visualc6/libpng.dsp | 507 - .../src/png/projects/visualc6/pngtest.dsp | 314 - wxWidgets/src/png/projects/wince.txt | 6 - wxWidgets/src/png/scripts/SCOPTIONS.ppc | 7 - wxWidgets/src/png/scripts/descrip.mms | 52 - .../src/png/scripts/libpng-config-body.in | 96 - .../src/png/scripts/libpng-config-head.in | 21 - wxWidgets/src/png/scripts/libpng.icc | 44 - wxWidgets/src/png/scripts/libpng.pc.in | 11 - wxWidgets/src/png/scripts/makefile.32sunu | 235 - wxWidgets/src/png/scripts/makefile.64sunu | 236 - wxWidgets/src/png/scripts/makefile.acorn | 51 - wxWidgets/src/png/scripts/makefile.aix | 111 - wxWidgets/src/png/scripts/makefile.amiga | 48 - wxWidgets/src/png/scripts/makefile.atari | 51 - wxWidgets/src/png/scripts/makefile.bc32 | 151 - wxWidgets/src/png/scripts/makefile.beos | 210 - wxWidgets/src/png/scripts/makefile.bor | 162 - wxWidgets/src/png/scripts/makefile.cygwin | 315 - wxWidgets/src/png/scripts/makefile.darwin | 216 - wxWidgets/src/png/scripts/makefile.dec | 196 - wxWidgets/src/png/scripts/makefile.dj2 | 55 - wxWidgets/src/png/scripts/makefile.freebsd | 48 - wxWidgets/src/png/scripts/makefile.gcc | 66 - wxWidgets/src/png/scripts/makefile.gcmmx | 260 - wxWidgets/src/png/scripts/makefile.hp64 | 216 - wxWidgets/src/png/scripts/makefile.hpgcc | 228 - wxWidgets/src/png/scripts/makefile.hpux | 213 - wxWidgets/src/png/scripts/makefile.ibmc | 71 - wxWidgets/src/png/scripts/makefile.intel | 114 - wxWidgets/src/png/scripts/makefile.knr | 99 - wxWidgets/src/png/scripts/makefile.linux | 234 - wxWidgets/src/png/scripts/makefile.macosx | 190 - wxWidgets/src/png/scripts/makefile.mips | 83 - wxWidgets/src/png/scripts/makefile.msc | 86 - wxWidgets/src/png/scripts/makefile.ne12bsd | 44 - wxWidgets/src/png/scripts/makefile.netbsd | 44 - wxWidgets/src/png/scripts/makefile.openbsd | 72 - wxWidgets/src/png/scripts/makefile.os2 | 69 - wxWidgets/src/png/scripts/makefile.sco | 212 - wxWidgets/src/png/scripts/makefile.sggcc | 224 - wxWidgets/src/png/scripts/makefile.sgi | 230 - wxWidgets/src/png/scripts/makefile.so9 | 234 - wxWidgets/src/png/scripts/makefile.solaris | 231 - wxWidgets/src/png/scripts/makefile.std | 89 - wxWidgets/src/png/scripts/makefile.sunos | 93 - wxWidgets/src/png/scripts/makefile.tc3 | 89 - wxWidgets/src/png/scripts/makefile.vcawin32 | 103 - wxWidgets/src/png/scripts/makefile.vcwin32 | 99 - wxWidgets/src/png/scripts/makefile.watcom | 109 - wxWidgets/src/png/scripts/makevms.com | 144 - wxWidgets/src/png/scripts/pngos2.def | 248 - wxWidgets/src/png/scripts/pngw32.def | 227 - wxWidgets/src/png/scripts/pngw32.rc | 95 - wxWidgets/src/png/scripts/smakefile.ppc | 30 - wxWidgets/src/regex/COPYRIGHT | 86 - wxWidgets/src/regex/README | 41 - wxWidgets/src/regex/re_syntax.n | 970 - wxWidgets/src/regex/regc_color.c | 778 - wxWidgets/src/regex/regc_cvec.c | 208 - wxWidgets/src/regex/regc_lex.c | 1061 - wxWidgets/src/regex/regc_locale.c | 1178 - wxWidgets/src/regex/regc_nfa.c | 1582 - wxWidgets/src/regex/regcomp.c | 2179 - wxWidgets/src/regex/regcustom.h | 126 - wxWidgets/src/regex/rege_dfa.c | 683 - wxWidgets/src/regex/regerror.c | 109 - wxWidgets/src/regex/regerrs.h | 18 - wxWidgets/src/regex/regex.dsp | 378 - wxWidgets/src/regex/regex.h | 337 - wxWidgets/src/regex/regexM8.xml | 2418 - wxWidgets/src/regex/regexec.c | 1038 - wxWidgets/src/regex/regfree.c | 53 - wxWidgets/src/regex/regfronts.c | 83 - wxWidgets/src/regex/regguts.h | 416 - wxWidgets/src/regex/splice.sh | 69 - wxWidgets/src/regex/tclUniData.c | 904 - wxWidgets/src/richtext/richtextbuffer.cpp | 9757 --- .../src/richtext/richtextbulletspage.cpp | 964 - wxWidgets/src/richtext/richtextctrl.cpp | 3706 - wxWidgets/src/richtext/richtextdialogs.pjd | 14780 ---- wxWidgets/src/richtext/richtextfontpage.cpp | 862 - wxWidgets/src/richtext/richtextformatdlg.cpp | 659 - wxWidgets/src/richtext/richtexthtml.cpp | 660 - .../src/richtext/richtextindentspage.cpp | 727 - .../src/richtext/richtextliststylepage.cpp | 1361 - wxWidgets/src/richtext/richtextprint.cpp | 707 - wxWidgets/src/richtext/richtextstyledlg.cpp | 885 - wxWidgets/src/richtext/richtextstylepage.cpp | 305 - wxWidgets/src/richtext/richtextstyles.cpp | 1265 - wxWidgets/src/richtext/richtextsymboldlg.cpp | 1308 - wxWidgets/src/richtext/richtexttabspage.cpp | 361 - wxWidgets/src/richtext/richtextxml.cpp | 1358 - wxWidgets/src/tiff/COPYRIGHT | 21 - wxWidgets/src/tiff/MAKEFILE.VA | 230 - wxWidgets/src/tiff/Makefile.lcc | 129 - wxWidgets/src/tiff/README | 61 - wxWidgets/src/tiff/TODO | 7 - wxWidgets/src/tiff/VERSION | 1 - wxWidgets/src/tiff/fax3sm_winnt.c | 1046 - wxWidgets/src/tiff/libtiff.def | 102 - wxWidgets/src/tiff/makefile.vc | 93 - wxWidgets/src/tiff/mkg3states.c | 436 - wxWidgets/src/tiff/mkspans.c | 72 - wxWidgets/src/tiff/mkversion.c | 148 - wxWidgets/src/tiff/port.h | 61 - wxWidgets/src/tiff/t4.h | 285 - wxWidgets/src/tiff/tif_acorn.c | 519 - wxWidgets/src/tiff/tif_apple.c | 274 - wxWidgets/src/tiff/tif_atari.c | 243 - wxWidgets/src/tiff/tif_aux.c | 248 - wxWidgets/src/tiff/tif_close.c | 80 - wxWidgets/src/tiff/tif_codec.c | 150 - wxWidgets/src/tiff/tif_color.c | 268 - wxWidgets/src/tiff/tif_compress.c | 235 - wxWidgets/src/tiff/tif_dir.c | 1435 - wxWidgets/src/tiff/tif_dir.h | 267 - wxWidgets/src/tiff/tif_dirinfo.c | 486 - wxWidgets/src/tiff/tif_dirread.c | 1518 - wxWidgets/src/tiff/tif_dirwrite.c | 1256 - wxWidgets/src/tiff/tif_dumpmode.c | 118 - wxWidgets/src/tiff/tif_error.c | 49 - wxWidgets/src/tiff/tif_extension.c | 112 - wxWidgets/src/tiff/tif_fax3.c | 1527 - wxWidgets/src/tiff/tif_fax3.h | 525 - wxWidgets/src/tiff/tif_fax3sm.c | 1046 - wxWidgets/src/tiff/tif_flush.c | 67 - wxWidgets/src/tiff/tif_getimage.c | 2585 - wxWidgets/src/tiff/tif_jpeg.c | 1673 - wxWidgets/src/tiff/tif_luv.c | 1597 - wxWidgets/src/tiff/tif_lzw.c | 745 - wxWidgets/src/tiff/tif_msdos.c | 179 - wxWidgets/src/tiff/tif_next.c | 142 - wxWidgets/src/tiff/tif_ojpeg.c | 2630 - wxWidgets/src/tiff/tif_open.c | 495 - wxWidgets/src/tiff/tif_os2.c | 338 - wxWidgets/src/tiff/tif_packbits.c | 300 - wxWidgets/src/tiff/tif_pixarlog.c | 1328 - wxWidgets/src/tiff/tif_predict.c | 464 - wxWidgets/src/tiff/tif_predict.h | 61 - wxWidgets/src/tiff/tif_print.c | 613 - wxWidgets/src/tiff/tif_read.c | 637 - wxWidgets/src/tiff/tif_strip.c | 254 - wxWidgets/src/tiff/tif_swab.c | 217 - wxWidgets/src/tiff/tif_thunder.c | 156 - wxWidgets/src/tiff/tif_tile.c | 257 - wxWidgets/src/tiff/tif_unix.c | 228 - wxWidgets/src/tiff/tif_version.c | 33 - wxWidgets/src/tiff/tif_vms.c | 588 - wxWidgets/src/tiff/tif_warning.c | 49 - wxWidgets/src/tiff/tif_win3.c | 225 - wxWidgets/src/tiff/tif_win32.c | 329 - wxWidgets/src/tiff/tif_write.c | 703 - wxWidgets/src/tiff/tif_zip.c | 368 - wxWidgets/src/tiff/tiff.dsp | 696 - wxWidgets/src/tiff/tiff.h | 482 - wxWidgets/src/tiff/tiffM8.xml | 3330 - wxWidgets/src/tiff/tiff_CW_Prefix.h | 12 - wxWidgets/src/tiff/tiffcomp.h | 225 - wxWidgets/src/tiff/tiffconf.h | 153 - wxWidgets/src/tiff/tiffio.h | 477 - wxWidgets/src/tiff/tiffiop.h | 289 - wxWidgets/src/tiff/tiffvers.h | 9 - wxWidgets/src/tiff/uvcode.h | 173 - wxWidgets/src/univ/bmpbuttn.cpp | 155 - wxWidgets/src/univ/button.cpp | 466 - wxWidgets/src/univ/checkbox.cpp | 367 - wxWidgets/src/univ/checklst.cpp | 303 - wxWidgets/src/univ/choice.cpp | 94 - wxWidgets/src/univ/colschem.cpp | 102 - wxWidgets/src/univ/combobox.cpp | 559 - wxWidgets/src/univ/control.cpp | 140 - wxWidgets/src/univ/ctrlrend.cpp | 532 - wxWidgets/src/univ/descrip.mms | 150 - wxWidgets/src/univ/dialog.cpp | 222 - wxWidgets/src/univ/framuniv.cpp | 328 - wxWidgets/src/univ/gauge.cpp | 128 - wxWidgets/src/univ/inpcons.cpp | 114 - wxWidgets/src/univ/inphand.cpp | 61 - wxWidgets/src/univ/listbox.cpp | 1579 - wxWidgets/src/univ/menu.cpp | 2605 - wxWidgets/src/univ/notebook.cpp | 1463 - wxWidgets/src/univ/radiobox.cpp | 526 - wxWidgets/src/univ/radiobut.cpp | 179 - wxWidgets/src/univ/scrarrow.cpp | 301 - wxWidgets/src/univ/scrolbar.cpp | 1207 - wxWidgets/src/univ/scrthumb.cpp | 291 - wxWidgets/src/univ/slider.cpp | 1101 - wxWidgets/src/univ/spinbutt.cpp | 436 - wxWidgets/src/univ/statbmp.cpp | 108 - wxWidgets/src/univ/statbox.cpp | 121 - wxWidgets/src/univ/statline.cpp | 85 - wxWidgets/src/univ/stattext.cpp | 94 - wxWidgets/src/univ/statusbr.cpp | 326 - wxWidgets/src/univ/stdrend.cpp | 1267 - wxWidgets/src/univ/textctrl.cpp | 5011 -- wxWidgets/src/univ/tglbtn.cpp | 98 - wxWidgets/src/univ/theme.cpp | 204 - wxWidgets/src/univ/themes/gtk.cpp | 2739 - wxWidgets/src/univ/themes/metal.cpp | 548 - wxWidgets/src/univ/themes/mono.cpp | 1104 - wxWidgets/src/univ/themes/win32.cpp | 3779 - wxWidgets/src/univ/toolbar.cpp | 967 - wxWidgets/src/univ/topluniv.cpp | 961 - wxWidgets/src/univ/winuniv.cpp | 1449 - wxWidgets/src/unix/baseunix.cpp | 83 - wxWidgets/src/unix/descrip.mms | 120 - wxWidgets/src/unix/dialup.cpp | 828 - wxWidgets/src/unix/dir.cpp | 334 - wxWidgets/src/unix/displayx11.cpp | 426 - wxWidgets/src/unix/dlunix.cpp | 461 - wxWidgets/src/unix/fontenum.cpp | 362 - wxWidgets/src/unix/fontutil.cpp | 1441 - wxWidgets/src/unix/gsocket.cpp | 2299 - wxWidgets/src/unix/joystick.cpp | 496 - wxWidgets/src/unix/mediactrl.cpp | 1607 - wxWidgets/src/unix/mimetype.cpp | 3011 - wxWidgets/src/unix/snglinst.cpp | 398 - wxWidgets/src/unix/sound.cpp | 722 - wxWidgets/src/unix/sound_sdl.cpp | 335 - wxWidgets/src/unix/stackwalk.cpp | 309 - wxWidgets/src/unix/stdpaths.cpp | 220 - wxWidgets/src/unix/taskbarx11.cpp | 346 - wxWidgets/src/unix/threadpsx.cpp | 1746 - wxWidgets/src/unix/utilsunx.cpp | 1362 - wxWidgets/src/unix/utilsx11.cpp | 847 - wxWidgets/src/version.mak | 24 - wxWidgets/src/wxJpeg.icc | 59 - wxWidgets/src/wxPng.icc | 28 - wxWidgets/src/wxTiff.icc | 47 - wxWidgets/src/wxWin.icc | 281 - wxWidgets/src/wxWindowsClassicM8.xml | 39547 --------- wxWidgets/src/wxWindowsM8.xml | 66645 ---------------- wxWidgets/src/wxWindowsW7.xml | 20334 ----- wxWidgets/src/wxXpm.icc | 32 - wxWidgets/src/wxZlib.icc | 26 - wxWidgets/src/xml/descrip.mms | 68 - wxWidgets/src/xml/xml.cpp | 960 - wxWidgets/src/xrc/descrip.mms | 144 - wxWidgets/src/xrc/xh_animatctrl.cpp | 57 - wxWidgets/src/xrc/xh_bmp.cpp | 64 - wxWidgets/src/xrc/xh_bmpbt.cpp | 72 - wxWidgets/src/xrc/xh_bmpcbox.cpp | 103 - wxWidgets/src/xrc/xh_bttn.cpp | 63 - wxWidgets/src/xrc/xh_cald.cpp | 67 - wxWidgets/src/xrc/xh_chckb.cpp | 61 - wxWidgets/src/xrc/xh_chckl.cpp | 121 - wxWidgets/src/xrc/xh_choic.cpp | 87 - wxWidgets/src/xrc/xh_choicbk.cpp | 127 - wxWidgets/src/xrc/xh_clrpicker.cpp | 55 - wxWidgets/src/xrc/xh_collpane.cpp | 101 - wxWidgets/src/xrc/xh_combo.cpp | 94 - wxWidgets/src/xrc/xh_datectrl.cpp | 57 - wxWidgets/src/xrc/xh_dirpicker.cpp | 57 - wxWidgets/src/xrc/xh_dlg.cpp | 93 - wxWidgets/src/xrc/xh_filepicker.cpp | 60 - wxWidgets/src/xrc/xh_fontpicker.cpp | 60 - wxWidgets/src/xrc/xh_frame.cpp | 99 - wxWidgets/src/xrc/xh_gauge.cpp | 75 - wxWidgets/src/xrc/xh_gdctl.cpp | 64 - wxWidgets/src/xrc/xh_grid.cpp | 51 - wxWidgets/src/xrc/xh_html.cpp | 81 - wxWidgets/src/xrc/xh_htmllbox.cpp | 86 - wxWidgets/src/xrc/xh_hyperlink.cpp | 88 - wxWidgets/src/xrc/xh_listb.cpp | 94 - wxWidgets/src/xrc/xh_listbk.cpp | 127 - wxWidgets/src/xrc/xh_listc.cpp | 77 - wxWidgets/src/xrc/xh_mdi.cpp | 139 - wxWidgets/src/xrc/xh_menu.cpp | 162 - wxWidgets/src/xrc/xh_notbk.cpp | 133 - wxWidgets/src/xrc/xh_odcombo.cpp | 117 - wxWidgets/src/xrc/xh_panel.cpp | 61 - wxWidgets/src/xrc/xh_propdlg.cpp | 150 - wxWidgets/src/xrc/xh_radbt.cpp | 66 - wxWidgets/src/xrc/xh_radbx.cpp | 142 - wxWidgets/src/xrc/xh_richtext.cpp | 63 - wxWidgets/src/xrc/xh_scrol.cpp | 63 - wxWidgets/src/xrc/xh_scwin.cpp | 72 - wxWidgets/src/xrc/xh_sizer.cpp | 455 - wxWidgets/src/xrc/xh_slidr.cpp | 94 - wxWidgets/src/xrc/xh_spin.cpp | 104 - wxWidgets/src/xrc/xh_split.cpp | 113 - wxWidgets/src/xrc/xh_statbar.cpp | 108 - wxWidgets/src/xrc/xh_stbmp.cpp | 55 - wxWidgets/src/xrc/xh_stbox.cpp | 55 - wxWidgets/src/xrc/xh_stlin.cpp | 53 - wxWidgets/src/xrc/xh_sttxt.cpp | 63 - wxWidgets/src/xrc/xh_text.cpp | 79 - wxWidgets/src/xrc/xh_tglbtn.cpp | 57 - wxWidgets/src/xrc/xh_toolb.cpp | 181 - wxWidgets/src/xrc/xh_tree.cpp | 66 - wxWidgets/src/xrc/xh_treebk.cpp | 141 - wxWidgets/src/xrc/xh_unkwn.cpp | 109 - wxWidgets/src/xrc/xh_wizrd.cpp | 104 - wxWidgets/src/xrc/xmlres.cpp | 1789 - wxWidgets/src/xrc/xmlrsall.cpp | 187 - wxWidgets/src/zlib/ChangeLog | 855 - wxWidgets/src/zlib/FAQ | 339 - wxWidgets/src/zlib/INDEX | 51 - wxWidgets/src/zlib/README | 125 - wxWidgets/src/zlib/adler32.c | 149 - wxWidgets/src/zlib/algorithm.txt | 209 - wxWidgets/src/zlib/compress.c | 79 - wxWidgets/src/zlib/crc32.c | 423 - wxWidgets/src/zlib/crc32.h | 441 - wxWidgets/src/zlib/deflate.c | 1736 - wxWidgets/src/zlib/deflate.h | 331 - wxWidgets/src/zlib/example.c | 565 - wxWidgets/src/zlib/gzio.c | 1026 - wxWidgets/src/zlib/infback.c | 623 - wxWidgets/src/zlib/inffast.c | 318 - wxWidgets/src/zlib/inffast.h | 11 - wxWidgets/src/zlib/inffixed.h | 94 - wxWidgets/src/zlib/inflate.c | 1368 - wxWidgets/src/zlib/inflate.h | 115 - wxWidgets/src/zlib/inftrees.c | 329 - wxWidgets/src/zlib/inftrees.h | 55 - wxWidgets/src/zlib/minigzip.c | 322 - wxWidgets/src/zlib/trees.c | 1219 - wxWidgets/src/zlib/trees.h | 128 - wxWidgets/src/zlib/uncompr.c | 61 - wxWidgets/src/zlib/zconf.h | 332 - wxWidgets/src/zlib/zlib.3 | 159 - wxWidgets/src/zlib/zlib.h | 1357 - wxWidgets/src/zlib/zlibM8.xml | 2236 - wxWidgets/src/zlib/zutil.c | 318 - wxWidgets/src/zlib/zutil.h | 269 - 1873 files changed, 995399 deletions(-) delete mode 100644 wxWidgets/art/addbookm.xpm delete mode 100644 wxWidgets/art/back.xpm delete mode 100644 wxWidgets/art/cdrom.xpm delete mode 100644 wxWidgets/art/copy.xpm delete mode 100644 wxWidgets/art/cross.xpm delete mode 100644 wxWidgets/art/cut.xpm delete mode 100644 wxWidgets/art/deffile.xpm delete mode 100644 wxWidgets/art/delbookm.xpm delete mode 100644 wxWidgets/art/delete.xpm delete mode 100644 wxWidgets/art/dir_up.xpm delete mode 100644 wxWidgets/art/down.xpm delete mode 100644 wxWidgets/art/exefile.xpm delete mode 100644 wxWidgets/art/fileopen.xpm delete mode 100644 wxWidgets/art/filesave.xpm delete mode 100644 wxWidgets/art/filesaveas.xpm delete mode 100644 wxWidgets/art/find.xpm delete mode 100644 wxWidgets/art/findrepl.xpm delete mode 100644 wxWidgets/art/floppy.xpm delete mode 100644 wxWidgets/art/folder.xpm delete mode 100644 wxWidgets/art/folder_open.xpm delete mode 100644 wxWidgets/art/forward.xpm delete mode 100644 wxWidgets/art/harddisk.xpm delete mode 100644 wxWidgets/art/helpicon.xpm delete mode 100644 wxWidgets/art/home.xpm delete mode 100644 wxWidgets/art/htmbook.xpm delete mode 100644 wxWidgets/art/htmfoldr.xpm delete mode 100644 wxWidgets/art/htmoptns.xpm delete mode 100644 wxWidgets/art/htmpage.xpm delete mode 100644 wxWidgets/art/htmsidep.xpm delete mode 100644 wxWidgets/art/listview.xpm delete mode 100644 wxWidgets/art/missimg.xpm delete mode 100644 wxWidgets/art/new.xpm delete mode 100644 wxWidgets/art/new_dir.xpm delete mode 100644 wxWidgets/art/paste.xpm delete mode 100644 wxWidgets/art/print.xpm delete mode 100644 wxWidgets/art/quit.xpm delete mode 100644 wxWidgets/art/redo.xpm delete mode 100644 wxWidgets/art/removable.xpm delete mode 100644 wxWidgets/art/repview.xpm delete mode 100644 wxWidgets/art/tick.xpm delete mode 100644 wxWidgets/art/tipicon.xpm delete mode 100644 wxWidgets/art/toparent.xpm delete mode 100644 wxWidgets/art/undo.xpm delete mode 100644 wxWidgets/art/up.xpm delete mode 100644 wxWidgets/art/wxwin.ico delete mode 100644 wxWidgets/art/wxwin16x16.png delete mode 100644 wxWidgets/art/wxwin16x16.xpm delete mode 100644 wxWidgets/art/wxwin32x32.png delete mode 100644 wxWidgets/art/wxwin32x32.xpm delete mode 100644 wxWidgets/build/msw/wx_adv.vcxproj delete mode 100644 wxWidgets/build/msw/wx_adv.vcxproj.filters delete mode 100644 wxWidgets/build/msw/wx_aui.vcxproj delete mode 100644 wxWidgets/build/msw/wx_aui.vcxproj.filters delete mode 100644 wxWidgets/build/msw/wx_base.vcxproj delete mode 100644 wxWidgets/build/msw/wx_base.vcxproj.filters delete mode 100644 wxWidgets/build/msw/wx_core.vcxproj delete mode 100644 wxWidgets/build/msw/wx_core.vcxproj.filters delete mode 100644 wxWidgets/build/msw/wx_dbgrid.vcxproj delete mode 100644 wxWidgets/build/msw/wx_dbgrid.vcxproj.filters delete mode 100644 wxWidgets/build/msw/wx_gl.vcxproj delete mode 100644 wxWidgets/build/msw/wx_gl.vcxproj.filters delete mode 100644 wxWidgets/build/msw/wx_html.vcxproj delete mode 100644 wxWidgets/build/msw/wx_html.vcxproj.filters delete mode 100644 wxWidgets/build/msw/wx_media.vcxproj delete mode 100644 wxWidgets/build/msw/wx_media.vcxproj.filters delete mode 100644 wxWidgets/build/msw/wx_net.vcxproj delete mode 100644 wxWidgets/build/msw/wx_net.vcxproj.filters delete mode 100644 wxWidgets/build/msw/wx_odbc.vcxproj delete mode 100644 wxWidgets/build/msw/wx_odbc.vcxproj.filters delete mode 100644 wxWidgets/build/msw/wx_qa.vcxproj delete mode 100644 wxWidgets/build/msw/wx_qa.vcxproj.filters delete mode 100644 wxWidgets/build/msw/wx_richtext.vcxproj delete mode 100644 wxWidgets/build/msw/wx_richtext.vcxproj.filters delete mode 100644 wxWidgets/build/msw/wx_wxexpat.vcxproj delete mode 100644 wxWidgets/build/msw/wx_wxexpat.vcxproj.filters delete mode 100644 wxWidgets/build/msw/wx_wxjpeg.vcxproj delete mode 100644 wxWidgets/build/msw/wx_wxjpeg.vcxproj.filters delete mode 100644 wxWidgets/build/msw/wx_wxpng.vcxproj delete mode 100644 wxWidgets/build/msw/wx_wxpng.vcxproj.filters delete mode 100644 wxWidgets/build/msw/wx_wxregex.vcxproj delete mode 100644 wxWidgets/build/msw/wx_wxregex.vcxproj.filters delete mode 100644 wxWidgets/build/msw/wx_wxtiff.vcxproj delete mode 100644 wxWidgets/build/msw/wx_wxtiff.vcxproj.filters delete mode 100644 wxWidgets/build/msw/wx_wxzlib.vcxproj delete mode 100644 wxWidgets/build/msw/wx_wxzlib.vcxproj.filters delete mode 100644 wxWidgets/build/msw/wx_xml.vcxproj delete mode 100644 wxWidgets/build/msw/wx_xml.vcxproj.filters delete mode 100644 wxWidgets/build/msw/wx_xrc.vcxproj delete mode 100644 wxWidgets/build/msw/wx_xrc.vcxproj.filters delete mode 100644 wxWidgets/include/msvc/wx/setup.h delete mode 100644 wxWidgets/include/wx/aboutdlg.h delete mode 100644 wxWidgets/include/wx/accel.h delete mode 100644 wxWidgets/include/wx/access.h delete mode 100644 wxWidgets/include/wx/afterstd.h delete mode 100644 wxWidgets/include/wx/anidecod.h delete mode 100644 wxWidgets/include/wx/animate.h delete mode 100644 wxWidgets/include/wx/animdecod.h delete mode 100644 wxWidgets/include/wx/app.h delete mode 100644 wxWidgets/include/wx/apptrait.h delete mode 100644 wxWidgets/include/wx/archive.h delete mode 100644 wxWidgets/include/wx/arrimpl.cpp delete mode 100644 wxWidgets/include/wx/arrstr.h delete mode 100644 wxWidgets/include/wx/artprov.h delete mode 100644 wxWidgets/include/wx/aui/aui.h delete mode 100644 wxWidgets/include/wx/aui/auibar.h delete mode 100644 wxWidgets/include/wx/aui/auibook.h delete mode 100644 wxWidgets/include/wx/aui/dockart.h delete mode 100644 wxWidgets/include/wx/aui/floatpane.h delete mode 100644 wxWidgets/include/wx/aui/framemanager.h delete mode 100644 wxWidgets/include/wx/aui/tabmdi.h delete mode 100644 wxWidgets/include/wx/beforestd.h delete mode 100644 wxWidgets/include/wx/bitmap.h delete mode 100644 wxWidgets/include/wx/bmpbuttn.h delete mode 100644 wxWidgets/include/wx/bmpcbox.h delete mode 100644 wxWidgets/include/wx/bookctrl.h delete mode 100644 wxWidgets/include/wx/brush.h delete mode 100644 wxWidgets/include/wx/buffer.h delete mode 100644 wxWidgets/include/wx/build.h delete mode 100644 wxWidgets/include/wx/busyinfo.h delete mode 100644 wxWidgets/include/wx/button.h delete mode 100644 wxWidgets/include/wx/calctrl.h delete mode 100644 wxWidgets/include/wx/caret.h delete mode 100644 wxWidgets/include/wx/checkbox.h delete mode 100644 wxWidgets/include/wx/checklst.h delete mode 100644 wxWidgets/include/wx/chkconf.h delete mode 100644 wxWidgets/include/wx/choicdlg.h delete mode 100644 wxWidgets/include/wx/choice.h delete mode 100644 wxWidgets/include/wx/choicebk.h delete mode 100644 wxWidgets/include/wx/clipbrd.h delete mode 100644 wxWidgets/include/wx/clntdata.h delete mode 100644 wxWidgets/include/wx/clrpicker.h delete mode 100644 wxWidgets/include/wx/cmdline.h delete mode 100644 wxWidgets/include/wx/cmdproc.h delete mode 100644 wxWidgets/include/wx/cmndata.h delete mode 100644 wxWidgets/include/wx/collpane.h delete mode 100644 wxWidgets/include/wx/colordlg.h delete mode 100644 wxWidgets/include/wx/colour.h delete mode 100644 wxWidgets/include/wx/combo.h delete mode 100644 wxWidgets/include/wx/combobox.h delete mode 100644 wxWidgets/include/wx/confbase.h delete mode 100644 wxWidgets/include/wx/config.h delete mode 100644 wxWidgets/include/wx/containr.h delete mode 100644 wxWidgets/include/wx/control.h delete mode 100644 wxWidgets/include/wx/convauto.h delete mode 100644 wxWidgets/include/wx/cpp.h delete mode 100644 wxWidgets/include/wx/cppunit.h delete mode 100644 wxWidgets/include/wx/cshelp.h delete mode 100644 wxWidgets/include/wx/ctrlsub.h delete mode 100644 wxWidgets/include/wx/cursor.h delete mode 100644 wxWidgets/include/wx/dataobj.h delete mode 100644 wxWidgets/include/wx/dataview.h delete mode 100644 wxWidgets/include/wx/datectrl.h delete mode 100644 wxWidgets/include/wx/dateevt.h delete mode 100644 wxWidgets/include/wx/datetime.h delete mode 100644 wxWidgets/include/wx/datstrm.h delete mode 100644 wxWidgets/include/wx/db.h delete mode 100644 wxWidgets/include/wx/dbgrid.h delete mode 100644 wxWidgets/include/wx/dbkeyg.h delete mode 100644 wxWidgets/include/wx/dbtable.h delete mode 100644 wxWidgets/include/wx/dc.h delete mode 100644 wxWidgets/include/wx/dcbuffer.h delete mode 100644 wxWidgets/include/wx/dcclient.h delete mode 100644 wxWidgets/include/wx/dcgraph.h delete mode 100644 wxWidgets/include/wx/dcmemory.h delete mode 100644 wxWidgets/include/wx/dcmirror.h delete mode 100644 wxWidgets/include/wx/dcprint.h delete mode 100644 wxWidgets/include/wx/dcps.h delete mode 100644 wxWidgets/include/wx/dcscreen.h delete mode 100644 wxWidgets/include/wx/dde.h delete mode 100644 wxWidgets/include/wx/debug.h delete mode 100644 wxWidgets/include/wx/debugrpt.h delete mode 100644 wxWidgets/include/wx/defs.h delete mode 100644 wxWidgets/include/wx/dialog.h delete mode 100644 wxWidgets/include/wx/dialup.h delete mode 100644 wxWidgets/include/wx/dir.h delete mode 100644 wxWidgets/include/wx/dirctrl.h delete mode 100644 wxWidgets/include/wx/dirdlg.h delete mode 100644 wxWidgets/include/wx/display.h delete mode 100644 wxWidgets/include/wx/display_impl.h delete mode 100644 wxWidgets/include/wx/dlimpexp.h delete mode 100644 wxWidgets/include/wx/dnd.h delete mode 100644 wxWidgets/include/wx/docmdi.h delete mode 100644 wxWidgets/include/wx/docview.h delete mode 100644 wxWidgets/include/wx/dragimag.h delete mode 100644 wxWidgets/include/wx/dynarray.h delete mode 100644 wxWidgets/include/wx/dynlib.h delete mode 100644 wxWidgets/include/wx/dynload.h delete mode 100644 wxWidgets/include/wx/effects.h delete mode 100644 wxWidgets/include/wx/encconv.h delete mode 100644 wxWidgets/include/wx/encinfo.h delete mode 100644 wxWidgets/include/wx/event.h delete mode 100644 wxWidgets/include/wx/evtloop.h delete mode 100644 wxWidgets/include/wx/except.h delete mode 100644 wxWidgets/include/wx/fdrepdlg.h delete mode 100644 wxWidgets/include/wx/features.h delete mode 100644 wxWidgets/include/wx/ffile.h delete mode 100644 wxWidgets/include/wx/file.h delete mode 100644 wxWidgets/include/wx/fileconf.h delete mode 100644 wxWidgets/include/wx/filedlg.h delete mode 100644 wxWidgets/include/wx/filefn.h delete mode 100644 wxWidgets/include/wx/filename.h delete mode 100644 wxWidgets/include/wx/filepicker.h delete mode 100644 wxWidgets/include/wx/filesys.h delete mode 100644 wxWidgets/include/wx/flags.h delete mode 100644 wxWidgets/include/wx/fmappriv.h delete mode 100644 wxWidgets/include/wx/font.h delete mode 100644 wxWidgets/include/wx/fontdlg.h delete mode 100644 wxWidgets/include/wx/fontenc.h delete mode 100644 wxWidgets/include/wx/fontenum.h delete mode 100644 wxWidgets/include/wx/fontmap.h delete mode 100644 wxWidgets/include/wx/fontpicker.h delete mode 100644 wxWidgets/include/wx/fontutil.h delete mode 100644 wxWidgets/include/wx/frame.h delete mode 100644 wxWidgets/include/wx/fs_arc.h delete mode 100644 wxWidgets/include/wx/fs_filter.h delete mode 100644 wxWidgets/include/wx/fs_inet.h delete mode 100644 wxWidgets/include/wx/fs_mem.h delete mode 100644 wxWidgets/include/wx/fs_zip.h delete mode 100644 wxWidgets/include/wx/gauge.h delete mode 100644 wxWidgets/include/wx/gbsizer.h delete mode 100644 wxWidgets/include/wx/gdicmn.h delete mode 100644 wxWidgets/include/wx/gdiobj.h delete mode 100644 wxWidgets/include/wx/generic/aboutdlgg.h delete mode 100644 wxWidgets/include/wx/generic/accel.h delete mode 100644 wxWidgets/include/wx/generic/animate.h delete mode 100644 wxWidgets/include/wx/generic/bmpcbox.h delete mode 100644 wxWidgets/include/wx/generic/busyinfo.h delete mode 100644 wxWidgets/include/wx/generic/buttonbar.h delete mode 100644 wxWidgets/include/wx/generic/calctrl.h delete mode 100644 wxWidgets/include/wx/generic/caret.h delete mode 100644 wxWidgets/include/wx/generic/choicdgg.h delete mode 100644 wxWidgets/include/wx/generic/clrpickerg.h delete mode 100644 wxWidgets/include/wx/generic/collpaneg.h delete mode 100644 wxWidgets/include/wx/generic/colour.h delete mode 100644 wxWidgets/include/wx/generic/colrdlgg.h delete mode 100644 wxWidgets/include/wx/generic/combo.h delete mode 100644 wxWidgets/include/wx/generic/dataview.h delete mode 100644 wxWidgets/include/wx/generic/datectrl.h delete mode 100644 wxWidgets/include/wx/generic/dcpsg.h delete mode 100644 wxWidgets/include/wx/generic/dirctrlg.h delete mode 100644 wxWidgets/include/wx/generic/dirdlgg.h delete mode 100644 wxWidgets/include/wx/generic/dragimgg.h delete mode 100644 wxWidgets/include/wx/generic/fdrepdlg.h delete mode 100644 wxWidgets/include/wx/generic/filedlgg.h delete mode 100644 wxWidgets/include/wx/generic/filepickerg.h delete mode 100644 wxWidgets/include/wx/generic/fontdlgg.h delete mode 100644 wxWidgets/include/wx/generic/fontpickerg.h delete mode 100644 wxWidgets/include/wx/generic/grid.h delete mode 100644 wxWidgets/include/wx/generic/gridctrl.h delete mode 100644 wxWidgets/include/wx/generic/gridsel.h delete mode 100644 wxWidgets/include/wx/generic/helpext.h delete mode 100644 wxWidgets/include/wx/generic/icon.h delete mode 100644 wxWidgets/include/wx/generic/imaglist.h delete mode 100644 wxWidgets/include/wx/generic/laywin.h delete mode 100644 wxWidgets/include/wx/generic/listctrl.h delete mode 100644 wxWidgets/include/wx/generic/logg.h delete mode 100644 wxWidgets/include/wx/generic/mask.h delete mode 100644 wxWidgets/include/wx/generic/mdig.h delete mode 100644 wxWidgets/include/wx/generic/msgdlgg.h delete mode 100644 wxWidgets/include/wx/generic/notebook.h delete mode 100644 wxWidgets/include/wx/generic/numdlgg.h delete mode 100644 wxWidgets/include/wx/generic/paletteg.h delete mode 100644 wxWidgets/include/wx/generic/panelg.h delete mode 100644 wxWidgets/include/wx/generic/printps.h delete mode 100644 wxWidgets/include/wx/generic/prntdlgg.h delete mode 100644 wxWidgets/include/wx/generic/progdlgg.h delete mode 100644 wxWidgets/include/wx/generic/propdlg.h delete mode 100644 wxWidgets/include/wx/generic/region.h delete mode 100644 wxWidgets/include/wx/generic/sashwin.h delete mode 100644 wxWidgets/include/wx/generic/scrolwin.h delete mode 100644 wxWidgets/include/wx/generic/spinctlg.h delete mode 100644 wxWidgets/include/wx/generic/splash.h delete mode 100644 wxWidgets/include/wx/generic/splitter.h delete mode 100644 wxWidgets/include/wx/generic/srchctlg.h delete mode 100644 wxWidgets/include/wx/generic/statline.h delete mode 100644 wxWidgets/include/wx/generic/statusbr.h delete mode 100644 wxWidgets/include/wx/generic/tabg.h delete mode 100644 wxWidgets/include/wx/generic/textdlgg.h delete mode 100644 wxWidgets/include/wx/generic/timer.h delete mode 100644 wxWidgets/include/wx/generic/treectlg.h delete mode 100644 wxWidgets/include/wx/generic/wizard.h delete mode 100644 wxWidgets/include/wx/geometry.h delete mode 100644 wxWidgets/include/wx/gifdecod.h delete mode 100644 wxWidgets/include/wx/glcanvas.h delete mode 100644 wxWidgets/include/wx/graphics.h delete mode 100644 wxWidgets/include/wx/grid.h delete mode 100644 wxWidgets/include/wx/gsocket.h delete mode 100644 wxWidgets/include/wx/hash.h delete mode 100644 wxWidgets/include/wx/hashmap.h delete mode 100644 wxWidgets/include/wx/hashset.h delete mode 100644 wxWidgets/include/wx/help.h delete mode 100644 wxWidgets/include/wx/helpbase.h delete mode 100644 wxWidgets/include/wx/helphtml.h delete mode 100644 wxWidgets/include/wx/helpwin.h delete mode 100644 wxWidgets/include/wx/html/forcelnk.h delete mode 100644 wxWidgets/include/wx/html/helpctrl.h delete mode 100644 wxWidgets/include/wx/html/helpdata.h delete mode 100644 wxWidgets/include/wx/html/helpdlg.h delete mode 100644 wxWidgets/include/wx/html/helpfrm.h delete mode 100644 wxWidgets/include/wx/html/helpwnd.h delete mode 100644 wxWidgets/include/wx/html/htmlcell.h delete mode 100644 wxWidgets/include/wx/html/htmldefs.h delete mode 100644 wxWidgets/include/wx/html/htmlfilt.h delete mode 100644 wxWidgets/include/wx/html/htmlpars.h delete mode 100644 wxWidgets/include/wx/html/htmlproc.h delete mode 100644 wxWidgets/include/wx/html/htmltag.h delete mode 100644 wxWidgets/include/wx/html/htmlwin.h delete mode 100644 wxWidgets/include/wx/html/htmprint.h delete mode 100644 wxWidgets/include/wx/html/m_templ.h delete mode 100644 wxWidgets/include/wx/html/webkit.h delete mode 100644 wxWidgets/include/wx/html/winpars.h delete mode 100644 wxWidgets/include/wx/htmllbox.h delete mode 100644 wxWidgets/include/wx/hyperlink.h delete mode 100644 wxWidgets/include/wx/icon.h delete mode 100644 wxWidgets/include/wx/iconbndl.h delete mode 100644 wxWidgets/include/wx/iconloc.h delete mode 100644 wxWidgets/include/wx/imagbmp.h delete mode 100644 wxWidgets/include/wx/image.h delete mode 100644 wxWidgets/include/wx/imaggif.h delete mode 100644 wxWidgets/include/wx/imagiff.h delete mode 100644 wxWidgets/include/wx/imagjpeg.h delete mode 100644 wxWidgets/include/wx/imaglist.h delete mode 100644 wxWidgets/include/wx/imagpcx.h delete mode 100644 wxWidgets/include/wx/imagpng.h delete mode 100644 wxWidgets/include/wx/imagpnm.h delete mode 100644 wxWidgets/include/wx/imagtga.h delete mode 100644 wxWidgets/include/wx/imagtiff.h delete mode 100644 wxWidgets/include/wx/imagxpm.h delete mode 100644 wxWidgets/include/wx/init.h delete mode 100644 wxWidgets/include/wx/intl.h delete mode 100644 wxWidgets/include/wx/iosfwrap.h delete mode 100644 wxWidgets/include/wx/ioswrap.h delete mode 100644 wxWidgets/include/wx/ipc.h delete mode 100644 wxWidgets/include/wx/ipcbase.h delete mode 100644 wxWidgets/include/wx/isql.h delete mode 100644 wxWidgets/include/wx/isqlext.h delete mode 100644 wxWidgets/include/wx/joystick.h delete mode 100644 wxWidgets/include/wx/layout.h delete mode 100644 wxWidgets/include/wx/laywin.h delete mode 100644 wxWidgets/include/wx/link.h delete mode 100644 wxWidgets/include/wx/list.h delete mode 100644 wxWidgets/include/wx/listbase.h delete mode 100644 wxWidgets/include/wx/listbook.h delete mode 100644 wxWidgets/include/wx/listbox.h delete mode 100644 wxWidgets/include/wx/listctrl.h delete mode 100644 wxWidgets/include/wx/listimpl.cpp delete mode 100644 wxWidgets/include/wx/log.h delete mode 100644 wxWidgets/include/wx/longlong.h delete mode 100644 wxWidgets/include/wx/math.h delete mode 100644 wxWidgets/include/wx/matrix.h delete mode 100644 wxWidgets/include/wx/mdi.h delete mode 100644 wxWidgets/include/wx/mediactrl.h delete mode 100644 wxWidgets/include/wx/memconf.h delete mode 100644 wxWidgets/include/wx/memory.h delete mode 100644 wxWidgets/include/wx/memtext.h delete mode 100644 wxWidgets/include/wx/menu.h delete mode 100644 wxWidgets/include/wx/menuitem.h delete mode 100644 wxWidgets/include/wx/metafile.h delete mode 100644 wxWidgets/include/wx/mimetype.h delete mode 100644 wxWidgets/include/wx/minifram.h delete mode 100644 wxWidgets/include/wx/module.h delete mode 100644 wxWidgets/include/wx/msgdlg.h delete mode 100644 wxWidgets/include/wx/msgout.h delete mode 100644 wxWidgets/include/wx/mstream.h delete mode 100644 wxWidgets/include/wx/msw/accel.h delete mode 100644 wxWidgets/include/wx/msw/amd64.manifest delete mode 100644 wxWidgets/include/wx/msw/app.h delete mode 100644 wxWidgets/include/wx/msw/apptbase.h delete mode 100644 wxWidgets/include/wx/msw/apptrait.h delete mode 100644 wxWidgets/include/wx/msw/bitmap.h delete mode 100644 wxWidgets/include/wx/msw/blank.cur delete mode 100644 wxWidgets/include/wx/msw/bmpbuttn.h delete mode 100644 wxWidgets/include/wx/msw/brush.h delete mode 100644 wxWidgets/include/wx/msw/bullseye.cur delete mode 100644 wxWidgets/include/wx/msw/button.h delete mode 100644 wxWidgets/include/wx/msw/caret.h delete mode 100644 wxWidgets/include/wx/msw/cdrom.ico delete mode 100644 wxWidgets/include/wx/msw/checkbox.h delete mode 100644 wxWidgets/include/wx/msw/checklst.h delete mode 100644 wxWidgets/include/wx/msw/child.ico delete mode 100644 wxWidgets/include/wx/msw/chkconf.h delete mode 100644 wxWidgets/include/wx/msw/choice.h delete mode 100644 wxWidgets/include/wx/msw/clipbrd.h delete mode 100644 wxWidgets/include/wx/msw/colordlg.h delete mode 100644 wxWidgets/include/wx/msw/colour.h delete mode 100644 wxWidgets/include/wx/msw/colours.bmp delete mode 100644 wxWidgets/include/wx/msw/combo.h delete mode 100644 wxWidgets/include/wx/msw/combobox.h delete mode 100644 wxWidgets/include/wx/msw/computer.ico delete mode 100644 wxWidgets/include/wx/msw/control.h delete mode 100644 wxWidgets/include/wx/msw/crashrpt.h delete mode 100644 wxWidgets/include/wx/msw/cross.cur delete mode 100644 wxWidgets/include/wx/msw/csquery.bmp delete mode 100644 wxWidgets/include/wx/msw/cursor.h delete mode 100644 wxWidgets/include/wx/msw/datectrl.h delete mode 100644 wxWidgets/include/wx/msw/dc.h delete mode 100644 wxWidgets/include/wx/msw/dcclient.h delete mode 100644 wxWidgets/include/wx/msw/dcmemory.h delete mode 100644 wxWidgets/include/wx/msw/dcprint.h delete mode 100644 wxWidgets/include/wx/msw/dcscreen.h delete mode 100644 wxWidgets/include/wx/msw/dde.h delete mode 100644 wxWidgets/include/wx/msw/debughlp.h delete mode 100644 wxWidgets/include/wx/msw/dialog.h delete mode 100644 wxWidgets/include/wx/msw/dib.h delete mode 100644 wxWidgets/include/wx/msw/dirdlg.h delete mode 100644 wxWidgets/include/wx/msw/dragimag.h delete mode 100644 wxWidgets/include/wx/msw/drive.ico delete mode 100644 wxWidgets/include/wx/msw/enhmeta.h delete mode 100644 wxWidgets/include/wx/msw/evtloop.h delete mode 100644 wxWidgets/include/wx/msw/fdrepdlg.h delete mode 100644 wxWidgets/include/wx/msw/file1.ico delete mode 100644 wxWidgets/include/wx/msw/filedlg.h delete mode 100644 wxWidgets/include/wx/msw/floppy.ico delete mode 100644 wxWidgets/include/wx/msw/folder1.ico delete mode 100644 wxWidgets/include/wx/msw/folder2.ico delete mode 100644 wxWidgets/include/wx/msw/font.h delete mode 100644 wxWidgets/include/wx/msw/fontdlg.h delete mode 100644 wxWidgets/include/wx/msw/fontenum.h delete mode 100644 wxWidgets/include/wx/msw/frame.h delete mode 100644 wxWidgets/include/wx/msw/gauge95.h delete mode 100644 wxWidgets/include/wx/msw/gccpriv.h delete mode 100644 wxWidgets/include/wx/msw/gdiimage.h delete mode 100644 wxWidgets/include/wx/msw/genrcdefs.h delete mode 100644 wxWidgets/include/wx/msw/glcanvas.h delete mode 100644 wxWidgets/include/wx/msw/gsockmsw.h delete mode 100644 wxWidgets/include/wx/msw/hand.cur delete mode 100644 wxWidgets/include/wx/msw/helpbest.h delete mode 100644 wxWidgets/include/wx/msw/helpchm.h delete mode 100644 wxWidgets/include/wx/msw/helpwin.h delete mode 100644 wxWidgets/include/wx/msw/htmlhelp.h delete mode 100644 wxWidgets/include/wx/msw/ia64.manifest delete mode 100644 wxWidgets/include/wx/msw/icon.h delete mode 100644 wxWidgets/include/wx/msw/imaglist.h delete mode 100644 wxWidgets/include/wx/msw/iniconf.h delete mode 100644 wxWidgets/include/wx/msw/joystick.h delete mode 100644 wxWidgets/include/wx/msw/libraries.h delete mode 100644 wxWidgets/include/wx/msw/listbox.h delete mode 100644 wxWidgets/include/wx/msw/listctrl.h delete mode 100644 wxWidgets/include/wx/msw/magnif1.cur delete mode 100644 wxWidgets/include/wx/msw/mdi.h delete mode 100644 wxWidgets/include/wx/msw/mdi.ico delete mode 100644 wxWidgets/include/wx/msw/menu.h delete mode 100644 wxWidgets/include/wx/msw/menuitem.h delete mode 100644 wxWidgets/include/wx/msw/metafile.h delete mode 100644 wxWidgets/include/wx/msw/microwin.h delete mode 100644 wxWidgets/include/wx/msw/mimetype.h delete mode 100644 wxWidgets/include/wx/msw/minifram.h delete mode 100644 wxWidgets/include/wx/msw/missing.h delete mode 100644 wxWidgets/include/wx/msw/msgdlg.h delete mode 100644 wxWidgets/include/wx/msw/mslu.h delete mode 100644 wxWidgets/include/wx/msw/msvcrt.h delete mode 100644 wxWidgets/include/wx/msw/notebook.h delete mode 100644 wxWidgets/include/wx/msw/ole/access.h delete mode 100644 wxWidgets/include/wx/msw/ole/activex.h delete mode 100644 wxWidgets/include/wx/msw/ole/automtn.h delete mode 100644 wxWidgets/include/wx/msw/ole/dataform.h delete mode 100644 wxWidgets/include/wx/msw/ole/dataobj.h delete mode 100644 wxWidgets/include/wx/msw/ole/dataobj2.h delete mode 100644 wxWidgets/include/wx/msw/ole/dropsrc.h delete mode 100644 wxWidgets/include/wx/msw/ole/droptgt.h delete mode 100644 wxWidgets/include/wx/msw/ole/oleutils.h delete mode 100644 wxWidgets/include/wx/msw/ole/uuid.h delete mode 100644 wxWidgets/include/wx/msw/palette.h delete mode 100644 wxWidgets/include/wx/msw/pbrush.cur delete mode 100644 wxWidgets/include/wx/msw/pen.h delete mode 100644 wxWidgets/include/wx/msw/pencil.cur delete mode 100644 wxWidgets/include/wx/msw/pntleft.cur delete mode 100644 wxWidgets/include/wx/msw/pntright.cur delete mode 100644 wxWidgets/include/wx/msw/popupwin.h delete mode 100644 wxWidgets/include/wx/msw/printdlg.h delete mode 100644 wxWidgets/include/wx/msw/printwin.h delete mode 100644 wxWidgets/include/wx/msw/private.h delete mode 100644 wxWidgets/include/wx/msw/question.ico delete mode 100644 wxWidgets/include/wx/msw/radiobox.h delete mode 100644 wxWidgets/include/wx/msw/radiobut.h delete mode 100644 wxWidgets/include/wx/msw/rcdefs.h delete mode 100644 wxWidgets/include/wx/msw/regconf.h delete mode 100644 wxWidgets/include/wx/msw/region.h delete mode 100644 wxWidgets/include/wx/msw/registry.h delete mode 100644 wxWidgets/include/wx/msw/removble.ico delete mode 100644 wxWidgets/include/wx/msw/rightarr.cur delete mode 100644 wxWidgets/include/wx/msw/roller.cur delete mode 100644 wxWidgets/include/wx/msw/scrolbar.h delete mode 100644 wxWidgets/include/wx/msw/seh.h delete mode 100644 wxWidgets/include/wx/msw/setup.h delete mode 100644 wxWidgets/include/wx/msw/setup0.h delete mode 100644 wxWidgets/include/wx/msw/setup_microwin.h delete mode 100644 wxWidgets/include/wx/msw/slider95.h delete mode 100644 wxWidgets/include/wx/msw/sound.h delete mode 100644 wxWidgets/include/wx/msw/spinbutt.h delete mode 100644 wxWidgets/include/wx/msw/spinctrl.h delete mode 100644 wxWidgets/include/wx/msw/stackwalk.h delete mode 100644 wxWidgets/include/wx/msw/statbmp.h delete mode 100644 wxWidgets/include/wx/msw/statbox.h delete mode 100644 wxWidgets/include/wx/msw/statbr95.h delete mode 100644 wxWidgets/include/wx/msw/statline.h delete mode 100644 wxWidgets/include/wx/msw/stattext.h delete mode 100644 wxWidgets/include/wx/msw/std.ico delete mode 100644 wxWidgets/include/wx/msw/stdpaths.h delete mode 100644 wxWidgets/include/wx/msw/subwin.h delete mode 100644 wxWidgets/include/wx/msw/tabctrl.h delete mode 100644 wxWidgets/include/wx/msw/taskbar.h delete mode 100644 wxWidgets/include/wx/msw/tbar95.h delete mode 100644 wxWidgets/include/wx/msw/textctrl.h delete mode 100644 wxWidgets/include/wx/msw/tglbtn.h delete mode 100644 wxWidgets/include/wx/msw/timer.h delete mode 100644 wxWidgets/include/wx/msw/tooltip.h delete mode 100644 wxWidgets/include/wx/msw/toplevel.h delete mode 100644 wxWidgets/include/wx/msw/treectrl.h delete mode 100644 wxWidgets/include/wx/msw/uxtheme.h delete mode 100644 wxWidgets/include/wx/msw/uxthemep.h delete mode 100644 wxWidgets/include/wx/msw/wince/checklst.h delete mode 100644 wxWidgets/include/wx/msw/wince/chkconf.h delete mode 100644 wxWidgets/include/wx/msw/wince/choicece.h delete mode 100644 wxWidgets/include/wx/msw/wince/helpwce.h delete mode 100644 wxWidgets/include/wx/msw/wince/libraries.h delete mode 100644 wxWidgets/include/wx/msw/wince/missing.h delete mode 100644 wxWidgets/include/wx/msw/wince/net.h delete mode 100644 wxWidgets/include/wx/msw/wince/resources.h delete mode 100644 wxWidgets/include/wx/msw/wince/setup.h delete mode 100644 wxWidgets/include/wx/msw/wince/smartphone.rc delete mode 100644 wxWidgets/include/wx/msw/wince/tbarwce.h delete mode 100644 wxWidgets/include/wx/msw/wince/textctrlce.h delete mode 100644 wxWidgets/include/wx/msw/wince/time.h delete mode 100644 wxWidgets/include/wx/msw/wince/wince.rc delete mode 100644 wxWidgets/include/wx/msw/window.h delete mode 100644 wxWidgets/include/wx/msw/winundef.h delete mode 100644 wxWidgets/include/wx/msw/wrapcctl.h delete mode 100644 wxWidgets/include/wx/msw/wrapcdlg.h delete mode 100644 wxWidgets/include/wx/msw/wrapshl.h delete mode 100644 wxWidgets/include/wx/msw/wrapwin.h delete mode 100644 wxWidgets/include/wx/msw/wx.manifest delete mode 100644 wxWidgets/include/wx/msw/wx.rc delete mode 100644 wxWidgets/include/wx/notebook.h delete mode 100644 wxWidgets/include/wx/numdlg.h delete mode 100644 wxWidgets/include/wx/object.h delete mode 100644 wxWidgets/include/wx/odcombo.h delete mode 100644 wxWidgets/include/wx/overlay.h delete mode 100644 wxWidgets/include/wx/ownerdrw.h delete mode 100644 wxWidgets/include/wx/palette.h delete mode 100644 wxWidgets/include/wx/panel.h delete mode 100644 wxWidgets/include/wx/paper.h delete mode 100644 wxWidgets/include/wx/pen.h delete mode 100644 wxWidgets/include/wx/pickerbase.h delete mode 100644 wxWidgets/include/wx/platform.h delete mode 100644 wxWidgets/include/wx/platinfo.h delete mode 100644 wxWidgets/include/wx/popupwin.h delete mode 100644 wxWidgets/include/wx/power.h delete mode 100644 wxWidgets/include/wx/print.h delete mode 100644 wxWidgets/include/wx/printdlg.h delete mode 100644 wxWidgets/include/wx/private/browserhack28.h delete mode 100644 wxWidgets/include/wx/private/fileback.h delete mode 100644 wxWidgets/include/wx/private/filename.h delete mode 100644 wxWidgets/include/wx/private/fontmgr.h delete mode 100644 wxWidgets/include/wx/private/overlay.h delete mode 100644 wxWidgets/include/wx/private/socketevtdispatch.h delete mode 100644 wxWidgets/include/wx/prntbase.h delete mode 100644 wxWidgets/include/wx/process.h delete mode 100644 wxWidgets/include/wx/progdlg.h delete mode 100644 wxWidgets/include/wx/propdlg.h delete mode 100644 wxWidgets/include/wx/protocol/file.h delete mode 100644 wxWidgets/include/wx/protocol/ftp.h delete mode 100644 wxWidgets/include/wx/protocol/http.h delete mode 100644 wxWidgets/include/wx/protocol/protocol.h delete mode 100644 wxWidgets/include/wx/ptr_scpd.h delete mode 100644 wxWidgets/include/wx/quantize.h delete mode 100644 wxWidgets/include/wx/radiobox.h delete mode 100644 wxWidgets/include/wx/radiobut.h delete mode 100644 wxWidgets/include/wx/rawbmp.h delete mode 100644 wxWidgets/include/wx/recguard.h delete mode 100644 wxWidgets/include/wx/regex.h delete mode 100644 wxWidgets/include/wx/region.h delete mode 100644 wxWidgets/include/wx/renderer.h delete mode 100644 wxWidgets/include/wx/richtext/richtextbuffer.h delete mode 100644 wxWidgets/include/wx/richtext/richtextbulletspage.h delete mode 100644 wxWidgets/include/wx/richtext/richtextctrl.h delete mode 100644 wxWidgets/include/wx/richtext/richtextfontpage.h delete mode 100644 wxWidgets/include/wx/richtext/richtextformatdlg.h delete mode 100644 wxWidgets/include/wx/richtext/richtexthtml.h delete mode 100644 wxWidgets/include/wx/richtext/richtextindentspage.h delete mode 100644 wxWidgets/include/wx/richtext/richtextliststylepage.h delete mode 100644 wxWidgets/include/wx/richtext/richtextprint.h delete mode 100644 wxWidgets/include/wx/richtext/richtextstyledlg.h delete mode 100644 wxWidgets/include/wx/richtext/richtextstylepage.h delete mode 100644 wxWidgets/include/wx/richtext/richtextstyles.h delete mode 100644 wxWidgets/include/wx/richtext/richtextsymboldlg.h delete mode 100644 wxWidgets/include/wx/richtext/richtexttabspage.h delete mode 100644 wxWidgets/include/wx/richtext/richtextxml.h delete mode 100644 wxWidgets/include/wx/sashwin.h delete mode 100644 wxWidgets/include/wx/sckaddr.h delete mode 100644 wxWidgets/include/wx/sckipc.h delete mode 100644 wxWidgets/include/wx/sckstrm.h delete mode 100644 wxWidgets/include/wx/scopeguard.h delete mode 100644 wxWidgets/include/wx/scrolbar.h delete mode 100644 wxWidgets/include/wx/scrolwin.h delete mode 100644 wxWidgets/include/wx/selstore.h delete mode 100644 wxWidgets/include/wx/settings.h delete mode 100644 wxWidgets/include/wx/setup.h delete mode 100644 wxWidgets/include/wx/setup_inc.h delete mode 100644 wxWidgets/include/wx/setup_redirect.h delete mode 100644 wxWidgets/include/wx/sizer.h delete mode 100644 wxWidgets/include/wx/slider.h delete mode 100644 wxWidgets/include/wx/snglinst.h delete mode 100644 wxWidgets/include/wx/socket.h delete mode 100644 wxWidgets/include/wx/sound.h delete mode 100644 wxWidgets/include/wx/spinbutt.h delete mode 100644 wxWidgets/include/wx/spinctrl.h delete mode 100644 wxWidgets/include/wx/splash.h delete mode 100644 wxWidgets/include/wx/splitter.h delete mode 100644 wxWidgets/include/wx/srchctrl.h delete mode 100644 wxWidgets/include/wx/sstream.h delete mode 100644 wxWidgets/include/wx/stack.h delete mode 100644 wxWidgets/include/wx/stackwalk.h delete mode 100644 wxWidgets/include/wx/statbmp.h delete mode 100644 wxWidgets/include/wx/statbox.h delete mode 100644 wxWidgets/include/wx/statline.h delete mode 100644 wxWidgets/include/wx/stattext.h delete mode 100644 wxWidgets/include/wx/statusbr.h delete mode 100644 wxWidgets/include/wx/stdpaths.h delete mode 100644 wxWidgets/include/wx/stockitem.h delete mode 100644 wxWidgets/include/wx/stopwatch.h delete mode 100644 wxWidgets/include/wx/strconv.h delete mode 100644 wxWidgets/include/wx/stream.h delete mode 100644 wxWidgets/include/wx/string.h delete mode 100644 wxWidgets/include/wx/sysopt.h delete mode 100644 wxWidgets/include/wx/tab.h delete mode 100644 wxWidgets/include/wx/tabctrl.h delete mode 100644 wxWidgets/include/wx/tarstrm.h delete mode 100644 wxWidgets/include/wx/taskbar.h delete mode 100644 wxWidgets/include/wx/tbarbase.h delete mode 100644 wxWidgets/include/wx/textbuf.h delete mode 100644 wxWidgets/include/wx/textctrl.h delete mode 100644 wxWidgets/include/wx/textdlg.h delete mode 100644 wxWidgets/include/wx/textfile.h delete mode 100644 wxWidgets/include/wx/tglbtn.h delete mode 100644 wxWidgets/include/wx/thread.h delete mode 100644 wxWidgets/include/wx/thrimpl.cpp delete mode 100644 wxWidgets/include/wx/timer.h delete mode 100644 wxWidgets/include/wx/tipdlg.h delete mode 100644 wxWidgets/include/wx/tipwin.h delete mode 100644 wxWidgets/include/wx/tokenzr.h delete mode 100644 wxWidgets/include/wx/toolbar.h delete mode 100644 wxWidgets/include/wx/toolbook.h delete mode 100644 wxWidgets/include/wx/tooltip.h delete mode 100644 wxWidgets/include/wx/toplevel.h delete mode 100644 wxWidgets/include/wx/treebase.h delete mode 100644 wxWidgets/include/wx/treebook.h delete mode 100644 wxWidgets/include/wx/treectrl.h delete mode 100644 wxWidgets/include/wx/txtstrm.h delete mode 100644 wxWidgets/include/wx/types.h delete mode 100644 wxWidgets/include/wx/univ/app.h delete mode 100644 wxWidgets/include/wx/univ/bmpbuttn.h delete mode 100644 wxWidgets/include/wx/univ/button.h delete mode 100644 wxWidgets/include/wx/univ/checkbox.h delete mode 100644 wxWidgets/include/wx/univ/checklst.h delete mode 100644 wxWidgets/include/wx/univ/chkconf.h delete mode 100644 wxWidgets/include/wx/univ/choice.h delete mode 100644 wxWidgets/include/wx/univ/colschem.h delete mode 100644 wxWidgets/include/wx/univ/combobox.h delete mode 100644 wxWidgets/include/wx/univ/control.h delete mode 100644 wxWidgets/include/wx/univ/dialog.h delete mode 100644 wxWidgets/include/wx/univ/frame.h delete mode 100644 wxWidgets/include/wx/univ/gauge.h delete mode 100644 wxWidgets/include/wx/univ/inpcons.h delete mode 100644 wxWidgets/include/wx/univ/inphand.h delete mode 100644 wxWidgets/include/wx/univ/listbox.h delete mode 100644 wxWidgets/include/wx/univ/menu.h delete mode 100644 wxWidgets/include/wx/univ/menuitem.h delete mode 100644 wxWidgets/include/wx/univ/notebook.h delete mode 100644 wxWidgets/include/wx/univ/radiobox.h delete mode 100644 wxWidgets/include/wx/univ/radiobut.h delete mode 100644 wxWidgets/include/wx/univ/renderer.h delete mode 100644 wxWidgets/include/wx/univ/scrarrow.h delete mode 100644 wxWidgets/include/wx/univ/scrolbar.h delete mode 100644 wxWidgets/include/wx/univ/scrthumb.h delete mode 100644 wxWidgets/include/wx/univ/scrtimer.h delete mode 100644 wxWidgets/include/wx/univ/setup.h delete mode 100644 wxWidgets/include/wx/univ/setup0.h delete mode 100644 wxWidgets/include/wx/univ/slider.h delete mode 100644 wxWidgets/include/wx/univ/spinbutt.h delete mode 100644 wxWidgets/include/wx/univ/statbmp.h delete mode 100644 wxWidgets/include/wx/univ/statbox.h delete mode 100644 wxWidgets/include/wx/univ/statline.h delete mode 100644 wxWidgets/include/wx/univ/stattext.h delete mode 100644 wxWidgets/include/wx/univ/statusbr.h delete mode 100644 wxWidgets/include/wx/univ/stdrend.h delete mode 100644 wxWidgets/include/wx/univ/textctrl.h delete mode 100644 wxWidgets/include/wx/univ/tglbtn.h delete mode 100644 wxWidgets/include/wx/univ/theme.h delete mode 100644 wxWidgets/include/wx/univ/toolbar.h delete mode 100644 wxWidgets/include/wx/univ/toplevel.h delete mode 100644 wxWidgets/include/wx/univ/window.h delete mode 100644 wxWidgets/include/wx/unix/apptbase.h delete mode 100644 wxWidgets/include/wx/unix/apptrait.h delete mode 100644 wxWidgets/include/wx/unix/execute.h delete mode 100644 wxWidgets/include/wx/unix/fontutil.h delete mode 100644 wxWidgets/include/wx/unix/gsockunx.h delete mode 100644 wxWidgets/include/wx/unix/joystick.h delete mode 100644 wxWidgets/include/wx/unix/mimetype.h delete mode 100644 wxWidgets/include/wx/unix/pipe.h delete mode 100644 wxWidgets/include/wx/unix/private.h delete mode 100644 wxWidgets/include/wx/unix/sound.h delete mode 100644 wxWidgets/include/wx/unix/stackwalk.h delete mode 100644 wxWidgets/include/wx/unix/stdpaths.h delete mode 100644 wxWidgets/include/wx/unix/taskbarx11.h delete mode 100644 wxWidgets/include/wx/unix/utilsx11.h delete mode 100644 wxWidgets/include/wx/uri.h delete mode 100644 wxWidgets/include/wx/url.h delete mode 100644 wxWidgets/include/wx/utils.h delete mode 100644 wxWidgets/include/wx/valgen.h delete mode 100644 wxWidgets/include/wx/validate.h delete mode 100644 wxWidgets/include/wx/valtext.h delete mode 100644 wxWidgets/include/wx/variant.h delete mode 100644 wxWidgets/include/wx/vector.h delete mode 100644 wxWidgets/include/wx/version.h delete mode 100644 wxWidgets/include/wx/vidmode.h delete mode 100644 wxWidgets/include/wx/vlbox.h delete mode 100644 wxWidgets/include/wx/vms_x_fix.h delete mode 100644 wxWidgets/include/wx/volume.h delete mode 100644 wxWidgets/include/wx/vscroll.h delete mode 100644 wxWidgets/include/wx/wave.h delete mode 100644 wxWidgets/include/wx/wfstream.h delete mode 100644 wxWidgets/include/wx/window.h delete mode 100644 wxWidgets/include/wx/wizard.h delete mode 100644 wxWidgets/include/wx/wupdlock.h delete mode 100644 wxWidgets/include/wx/wx.h delete mode 100644 wxWidgets/include/wx/wx_cw.h delete mode 100644 wxWidgets/include/wx/wx_cw_cm.h delete mode 100644 wxWidgets/include/wx/wx_cw_d.h delete mode 100644 wxWidgets/include/wx/wx_cwc.h delete mode 100644 wxWidgets/include/wx/wx_cwc_d.h delete mode 100644 wxWidgets/include/wx/wx_cwcocoa.h delete mode 100644 wxWidgets/include/wx/wx_cwcocoa_cm.h delete mode 100644 wxWidgets/include/wx/wx_cwcocoa_d.h delete mode 100644 wxWidgets/include/wx/wx_cwu_d.h delete mode 100644 wxWidgets/include/wx/wxchar.h delete mode 100644 wxWidgets/include/wx/wxhtml.h delete mode 100644 wxWidgets/include/wx/wxprec.h delete mode 100644 wxWidgets/include/wx/wxshlb_cw.h delete mode 100644 wxWidgets/include/wx/wxshlb_cw_d.h delete mode 100644 wxWidgets/include/wx/wxshlb_cwc.h delete mode 100644 wxWidgets/include/wx/wxshlb_cwc_d.h delete mode 100644 wxWidgets/include/wx/wxshlba_cw.h delete mode 100644 wxWidgets/include/wx/wxshlba_cw_d.h delete mode 100644 wxWidgets/include/wx/wxshlba_cwc.h delete mode 100644 wxWidgets/include/wx/wxshlba_cwc_d.h delete mode 100644 wxWidgets/include/wx/xml/xml.h delete mode 100644 wxWidgets/include/wx/xpmdecod.h delete mode 100644 wxWidgets/include/wx/xpmhand.h delete mode 100644 wxWidgets/include/wx/xrc/xh_all.h delete mode 100644 wxWidgets/include/wx/xrc/xh_animatctrl.h delete mode 100644 wxWidgets/include/wx/xrc/xh_bmp.h delete mode 100644 wxWidgets/include/wx/xrc/xh_bmpbt.h delete mode 100644 wxWidgets/include/wx/xrc/xh_bmpcbox.h delete mode 100644 wxWidgets/include/wx/xrc/xh_bttn.h delete mode 100644 wxWidgets/include/wx/xrc/xh_cald.h delete mode 100644 wxWidgets/include/wx/xrc/xh_chckb.h delete mode 100644 wxWidgets/include/wx/xrc/xh_chckl.h delete mode 100644 wxWidgets/include/wx/xrc/xh_choic.h delete mode 100644 wxWidgets/include/wx/xrc/xh_choicbk.h delete mode 100644 wxWidgets/include/wx/xrc/xh_clrpicker.h delete mode 100644 wxWidgets/include/wx/xrc/xh_collpane.h delete mode 100644 wxWidgets/include/wx/xrc/xh_combo.h delete mode 100644 wxWidgets/include/wx/xrc/xh_datectrl.h delete mode 100644 wxWidgets/include/wx/xrc/xh_dirpicker.h delete mode 100644 wxWidgets/include/wx/xrc/xh_dlg.h delete mode 100644 wxWidgets/include/wx/xrc/xh_filepicker.h delete mode 100644 wxWidgets/include/wx/xrc/xh_fontpicker.h delete mode 100644 wxWidgets/include/wx/xrc/xh_frame.h delete mode 100644 wxWidgets/include/wx/xrc/xh_gauge.h delete mode 100644 wxWidgets/include/wx/xrc/xh_gdctl.h delete mode 100644 wxWidgets/include/wx/xrc/xh_grid.h delete mode 100644 wxWidgets/include/wx/xrc/xh_html.h delete mode 100644 wxWidgets/include/wx/xrc/xh_htmllbox.h delete mode 100644 wxWidgets/include/wx/xrc/xh_hyperlink.h delete mode 100644 wxWidgets/include/wx/xrc/xh_listb.h delete mode 100644 wxWidgets/include/wx/xrc/xh_listbk.h delete mode 100644 wxWidgets/include/wx/xrc/xh_listc.h delete mode 100644 wxWidgets/include/wx/xrc/xh_mdi.h delete mode 100644 wxWidgets/include/wx/xrc/xh_menu.h delete mode 100644 wxWidgets/include/wx/xrc/xh_notbk.h delete mode 100644 wxWidgets/include/wx/xrc/xh_odcombo.h delete mode 100644 wxWidgets/include/wx/xrc/xh_panel.h delete mode 100644 wxWidgets/include/wx/xrc/xh_propdlg.h delete mode 100644 wxWidgets/include/wx/xrc/xh_radbt.h delete mode 100644 wxWidgets/include/wx/xrc/xh_radbx.h delete mode 100644 wxWidgets/include/wx/xrc/xh_richtext.h delete mode 100644 wxWidgets/include/wx/xrc/xh_scrol.h delete mode 100644 wxWidgets/include/wx/xrc/xh_scwin.h delete mode 100644 wxWidgets/include/wx/xrc/xh_sizer.h delete mode 100644 wxWidgets/include/wx/xrc/xh_slidr.h delete mode 100644 wxWidgets/include/wx/xrc/xh_spin.h delete mode 100644 wxWidgets/include/wx/xrc/xh_split.h delete mode 100644 wxWidgets/include/wx/xrc/xh_statbar.h delete mode 100644 wxWidgets/include/wx/xrc/xh_stbmp.h delete mode 100644 wxWidgets/include/wx/xrc/xh_stbox.h delete mode 100644 wxWidgets/include/wx/xrc/xh_stlin.h delete mode 100644 wxWidgets/include/wx/xrc/xh_sttxt.h delete mode 100644 wxWidgets/include/wx/xrc/xh_text.h delete mode 100644 wxWidgets/include/wx/xrc/xh_tglbtn.h delete mode 100644 wxWidgets/include/wx/xrc/xh_toolb.h delete mode 100644 wxWidgets/include/wx/xrc/xh_tree.h delete mode 100644 wxWidgets/include/wx/xrc/xh_treebk.h delete mode 100644 wxWidgets/include/wx/xrc/xh_unkwn.h delete mode 100644 wxWidgets/include/wx/xrc/xh_wizrd.h delete mode 100644 wxWidgets/include/wx/xrc/xmlres.h delete mode 100644 wxWidgets/include/wx/xti.h delete mode 100644 wxWidgets/include/wx/xtistrm.h delete mode 100644 wxWidgets/include/wx/xtixml.h delete mode 100644 wxWidgets/include/wx/zipstrm.h delete mode 100644 wxWidgets/include/wx/zstream.h delete mode 100644 wxWidgets/include/wx_pb.h delete mode 100644 wxWidgets/src/Wxwindll.icc delete mode 100644 wxWidgets/src/aui/auibar.cpp delete mode 100644 wxWidgets/src/aui/auibook.cpp delete mode 100644 wxWidgets/src/aui/descrip.mms delete mode 100644 wxWidgets/src/aui/dockart.cpp delete mode 100644 wxWidgets/src/aui/floatpane.cpp delete mode 100644 wxWidgets/src/aui/framemanager.cpp delete mode 100644 wxWidgets/src/aui/tabmdi.cpp delete mode 100644 wxWidgets/src/common/accesscmn.cpp delete mode 100644 wxWidgets/src/common/anidecod.cpp delete mode 100644 wxWidgets/src/common/animatecmn.cpp delete mode 100644 wxWidgets/src/common/appbase.cpp delete mode 100644 wxWidgets/src/common/appcmn.cpp delete mode 100644 wxWidgets/src/common/arcall.cpp delete mode 100644 wxWidgets/src/common/arcfind.cpp delete mode 100644 wxWidgets/src/common/archive.cpp delete mode 100644 wxWidgets/src/common/artprov.cpp delete mode 100644 wxWidgets/src/common/artstd.cpp delete mode 100644 wxWidgets/src/common/base.rc delete mode 100644 wxWidgets/src/common/bmpbase.cpp delete mode 100644 wxWidgets/src/common/bookctrl.cpp delete mode 100644 wxWidgets/src/common/choiccmn.cpp delete mode 100644 wxWidgets/src/common/clipcmn.cpp delete mode 100644 wxWidgets/src/common/clntdata.cpp delete mode 100644 wxWidgets/src/common/clrpickercmn.cpp delete mode 100644 wxWidgets/src/common/cmdline.cpp delete mode 100644 wxWidgets/src/common/cmdproc.cpp delete mode 100644 wxWidgets/src/common/cmndata.cpp delete mode 100644 wxWidgets/src/common/colourcmn.cpp delete mode 100644 wxWidgets/src/common/combocmn.cpp delete mode 100644 wxWidgets/src/common/config.cpp delete mode 100644 wxWidgets/src/common/containr.cpp delete mode 100644 wxWidgets/src/common/convauto.cpp delete mode 100644 wxWidgets/src/common/cshelp.cpp delete mode 100644 wxWidgets/src/common/ctrlcmn.cpp delete mode 100644 wxWidgets/src/common/ctrlsub.cpp delete mode 100644 wxWidgets/src/common/datacmn.cpp delete mode 100644 wxWidgets/src/common/datavcmn.cpp delete mode 100644 wxWidgets/src/common/datetime.cpp delete mode 100644 wxWidgets/src/common/datstrm.cpp delete mode 100644 wxWidgets/src/common/db.cpp delete mode 100644 wxWidgets/src/common/dbgrid.cpp delete mode 100644 wxWidgets/src/common/dbtable.cpp delete mode 100644 wxWidgets/src/common/dcbase.cpp delete mode 100644 wxWidgets/src/common/dcbufcmn.cpp delete mode 100644 wxWidgets/src/common/dcgraph.cpp delete mode 100644 wxWidgets/src/common/debugrpt.cpp delete mode 100644 wxWidgets/src/common/descrip.mms delete mode 100644 wxWidgets/src/common/dircmn.cpp delete mode 100644 wxWidgets/src/common/dlgcmn.cpp delete mode 100644 wxWidgets/src/common/dndcmn.cpp delete mode 100644 wxWidgets/src/common/dobjcmn.cpp delete mode 100644 wxWidgets/src/common/docmdi.cpp delete mode 100644 wxWidgets/src/common/docview.cpp delete mode 100644 wxWidgets/src/common/dpycmn.cpp delete mode 100644 wxWidgets/src/common/dseldlg.cpp delete mode 100644 wxWidgets/src/common/dummy.cpp delete mode 100644 wxWidgets/src/common/dynarray.cpp delete mode 100644 wxWidgets/src/common/dynlib.cpp delete mode 100644 wxWidgets/src/common/dynload.cpp delete mode 100644 wxWidgets/src/common/effects.cpp delete mode 100644 wxWidgets/src/common/emptydmy.cpp delete mode 100644 wxWidgets/src/common/encconv.cpp delete mode 100644 wxWidgets/src/common/event.cpp delete mode 100644 wxWidgets/src/common/evtloopcmn.cpp delete mode 100644 wxWidgets/src/common/execcmn.cpp delete mode 100644 wxWidgets/src/common/extended.c delete mode 100644 wxWidgets/src/common/fddlgcmn.cpp delete mode 100644 wxWidgets/src/common/ffile.cpp delete mode 100644 wxWidgets/src/common/file.cpp delete mode 100644 wxWidgets/src/common/fileback.cpp delete mode 100644 wxWidgets/src/common/fileconf.cpp delete mode 100644 wxWidgets/src/common/filefn.cpp delete mode 100644 wxWidgets/src/common/filename.cpp delete mode 100644 wxWidgets/src/common/filepickercmn.cpp delete mode 100644 wxWidgets/src/common/filesys.cpp delete mode 100644 wxWidgets/src/common/filtall.cpp delete mode 100644 wxWidgets/src/common/filtfind.cpp delete mode 100644 wxWidgets/src/common/fldlgcmn.cpp delete mode 100644 wxWidgets/src/common/fmapbase.cpp delete mode 100644 wxWidgets/src/common/fontcmn.cpp delete mode 100644 wxWidgets/src/common/fontenumcmn.cpp delete mode 100644 wxWidgets/src/common/fontmap.cpp delete mode 100644 wxWidgets/src/common/fontmgrcmn.cpp delete mode 100644 wxWidgets/src/common/fontpickercmn.cpp delete mode 100644 wxWidgets/src/common/framecmn.cpp delete mode 100644 wxWidgets/src/common/fs_arc.cpp delete mode 100644 wxWidgets/src/common/fs_filter.cpp delete mode 100644 wxWidgets/src/common/fs_inet.cpp delete mode 100644 wxWidgets/src/common/fs_mem.cpp delete mode 100644 wxWidgets/src/common/ftp.cpp delete mode 100644 wxWidgets/src/common/gaugecmn.cpp delete mode 100644 wxWidgets/src/common/gbsizer.cpp delete mode 100644 wxWidgets/src/common/gdicmn.cpp delete mode 100644 wxWidgets/src/common/geometry.cpp delete mode 100644 wxWidgets/src/common/gifdecod.cpp delete mode 100644 wxWidgets/src/common/glob.inc delete mode 100644 wxWidgets/src/common/graphcmn.cpp delete mode 100644 wxWidgets/src/common/hash.cpp delete mode 100644 wxWidgets/src/common/hashmap.cpp delete mode 100644 wxWidgets/src/common/helpbase.cpp delete mode 100644 wxWidgets/src/common/http.cpp delete mode 100644 wxWidgets/src/common/iconbndl.cpp delete mode 100644 wxWidgets/src/common/imagall.cpp delete mode 100644 wxWidgets/src/common/imagbmp.cpp delete mode 100644 wxWidgets/src/common/image.cpp delete mode 100644 wxWidgets/src/common/imagfill.cpp delete mode 100644 wxWidgets/src/common/imaggif.cpp delete mode 100644 wxWidgets/src/common/imagiff.cpp delete mode 100644 wxWidgets/src/common/imagjpeg.cpp delete mode 100644 wxWidgets/src/common/imagpcx.cpp delete mode 100644 wxWidgets/src/common/imagpng.cpp delete mode 100644 wxWidgets/src/common/imagpnm.cpp delete mode 100644 wxWidgets/src/common/imagtga.cpp delete mode 100644 wxWidgets/src/common/imagtiff.cpp delete mode 100644 wxWidgets/src/common/imagxpm.cpp delete mode 100644 wxWidgets/src/common/init.cpp delete mode 100644 wxWidgets/src/common/intl.cpp delete mode 100644 wxWidgets/src/common/ipcbase.cpp delete mode 100644 wxWidgets/src/common/layout.cpp delete mode 100644 wxWidgets/src/common/lboxcmn.cpp delete mode 100644 wxWidgets/src/common/list.cpp delete mode 100644 wxWidgets/src/common/listctrlcmn.cpp delete mode 100644 wxWidgets/src/common/log.cpp delete mode 100644 wxWidgets/src/common/longlong.cpp delete mode 100644 wxWidgets/src/common/matrix.cpp delete mode 100644 wxWidgets/src/common/mediactrlcmn.cpp delete mode 100644 wxWidgets/src/common/memory.cpp delete mode 100644 wxWidgets/src/common/menucmn.cpp delete mode 100644 wxWidgets/src/common/mimecmn.cpp delete mode 100644 wxWidgets/src/common/module.cpp delete mode 100644 wxWidgets/src/common/msgout.cpp delete mode 100644 wxWidgets/src/common/mstream.cpp delete mode 100644 wxWidgets/src/common/nbkbase.cpp delete mode 100644 wxWidgets/src/common/object.cpp delete mode 100644 wxWidgets/src/common/overlaycmn.cpp delete mode 100644 wxWidgets/src/common/paper.cpp delete mode 100644 wxWidgets/src/common/pickerbase.cpp delete mode 100644 wxWidgets/src/common/platinfo.cpp delete mode 100644 wxWidgets/src/common/popupcmn.cpp delete mode 100644 wxWidgets/src/common/powercmn.cpp delete mode 100644 wxWidgets/src/common/prntbase.cpp delete mode 100644 wxWidgets/src/common/process.cpp delete mode 100644 wxWidgets/src/common/protocol.cpp delete mode 100644 wxWidgets/src/common/quantize.cpp delete mode 100644 wxWidgets/src/common/radiocmn.cpp delete mode 100644 wxWidgets/src/common/regex.cpp delete mode 100644 wxWidgets/src/common/rendcmn.cpp delete mode 100644 wxWidgets/src/common/rgncmn.cpp delete mode 100644 wxWidgets/src/common/sckaddr.cpp delete mode 100644 wxWidgets/src/common/sckfile.cpp delete mode 100644 wxWidgets/src/common/sckipc.cpp delete mode 100644 wxWidgets/src/common/sckstrm.cpp delete mode 100644 wxWidgets/src/common/settcmn.cpp delete mode 100644 wxWidgets/src/common/sizer.cpp delete mode 100644 wxWidgets/src/common/socket.cpp delete mode 100644 wxWidgets/src/common/socketevtdispatch.cpp delete mode 100644 wxWidgets/src/common/srchcmn.cpp delete mode 100644 wxWidgets/src/common/sstream.cpp delete mode 100644 wxWidgets/src/common/statbar.cpp delete mode 100644 wxWidgets/src/common/stdpbase.cpp delete mode 100644 wxWidgets/src/common/stockitem.cpp delete mode 100644 wxWidgets/src/common/stopwatch.cpp delete mode 100644 wxWidgets/src/common/strconv.cpp delete mode 100644 wxWidgets/src/common/stream.cpp delete mode 100644 wxWidgets/src/common/string.cpp delete mode 100644 wxWidgets/src/common/sysopt.cpp delete mode 100644 wxWidgets/src/common/tarstrm.cpp delete mode 100644 wxWidgets/src/common/taskbarcmn.cpp delete mode 100644 wxWidgets/src/common/tbarbase.cpp delete mode 100644 wxWidgets/src/common/textbuf.cpp delete mode 100644 wxWidgets/src/common/textcmn.cpp delete mode 100644 wxWidgets/src/common/textfile.cpp delete mode 100644 wxWidgets/src/common/timercmn.cpp delete mode 100644 wxWidgets/src/common/tokenzr.cpp delete mode 100644 wxWidgets/src/common/toplvcmn.cpp delete mode 100644 wxWidgets/src/common/treebase.cpp delete mode 100644 wxWidgets/src/common/txtstrm.cpp delete mode 100644 wxWidgets/src/common/unictabl.inc delete mode 100644 wxWidgets/src/common/uri.cpp delete mode 100644 wxWidgets/src/common/url.cpp delete mode 100644 wxWidgets/src/common/utilscmn.cpp delete mode 100644 wxWidgets/src/common/valgen.cpp delete mode 100644 wxWidgets/src/common/validate.cpp delete mode 100644 wxWidgets/src/common/valtext.cpp delete mode 100644 wxWidgets/src/common/variant.cpp delete mode 100644 wxWidgets/src/common/wfstream.cpp delete mode 100644 wxWidgets/src/common/wincmn.cpp delete mode 100644 wxWidgets/src/common/wxchar.cpp delete mode 100644 wxWidgets/src/common/xpmdecod.cpp delete mode 100644 wxWidgets/src/common/xti.cpp delete mode 100644 wxWidgets/src/common/xtistrm.cpp delete mode 100644 wxWidgets/src/common/xtixml.cpp delete mode 100644 wxWidgets/src/common/zipstrm.cpp delete mode 100644 wxWidgets/src/common/zstream.cpp delete mode 100644 wxWidgets/src/cwcopysetup.bat delete mode 100644 wxWidgets/src/cwdcopysetup.bat delete mode 100644 wxWidgets/src/cygnus.bat delete mode 100644 wxWidgets/src/expat/COPYING delete mode 100644 wxWidgets/src/expat/Changes delete mode 100644 wxWidgets/src/expat/MANIFEST delete mode 100644 wxWidgets/src/expat/Makefile.in delete mode 100644 wxWidgets/src/expat/README delete mode 100644 wxWidgets/src/expat/aclocal.m4 delete mode 100644 wxWidgets/src/expat/bcb5/README.txt delete mode 100644 wxWidgets/src/expat/bcb5/elements.bpf delete mode 100644 wxWidgets/src/expat/bcb5/elements.bpr delete mode 100644 wxWidgets/src/expat/bcb5/elements.mak delete mode 100644 wxWidgets/src/expat/bcb5/expat.bpf delete mode 100644 wxWidgets/src/expat/bcb5/expat.bpr delete mode 100644 wxWidgets/src/expat/bcb5/expat.mak delete mode 100644 wxWidgets/src/expat/bcb5/expat_static.bpf delete mode 100644 wxWidgets/src/expat/bcb5/expat_static.bpr delete mode 100644 wxWidgets/src/expat/bcb5/expat_static.mak delete mode 100644 wxWidgets/src/expat/bcb5/expatw.bpf delete mode 100644 wxWidgets/src/expat/bcb5/expatw.bpr delete mode 100644 wxWidgets/src/expat/bcb5/expatw.mak delete mode 100644 wxWidgets/src/expat/bcb5/expatw_static.bpf delete mode 100644 wxWidgets/src/expat/bcb5/expatw_static.bpr delete mode 100644 wxWidgets/src/expat/bcb5/expatw_static.mak delete mode 100644 wxWidgets/src/expat/bcb5/libexpat_mtd.def delete mode 100644 wxWidgets/src/expat/bcb5/libexpatw_mtd.def delete mode 100644 wxWidgets/src/expat/bcb5/makefile.mak delete mode 100644 wxWidgets/src/expat/bcb5/outline.bpf delete mode 100644 wxWidgets/src/expat/bcb5/outline.bpr delete mode 100644 wxWidgets/src/expat/bcb5/outline.mak delete mode 100644 wxWidgets/src/expat/bcb5/setup.bat delete mode 100644 wxWidgets/src/expat/bcb5/xmlwf.bpf delete mode 100644 wxWidgets/src/expat/bcb5/xmlwf.bpr delete mode 100644 wxWidgets/src/expat/bcb5/xmlwf.mak delete mode 100644 wxWidgets/src/expat/configure delete mode 100644 wxWidgets/src/expat/configure.in delete mode 100644 wxWidgets/src/expat/conftools/PrintPath delete mode 100644 wxWidgets/src/expat/conftools/ac_c_bigendian_cross.m4 delete mode 100644 wxWidgets/src/expat/conftools/config.guess delete mode 100644 wxWidgets/src/expat/conftools/config.sub delete mode 100644 wxWidgets/src/expat/conftools/expat.m4 delete mode 100644 wxWidgets/src/expat/conftools/install-sh delete mode 100644 wxWidgets/src/expat/conftools/libtool.m4 delete mode 100644 wxWidgets/src/expat/conftools/ltmain.sh delete mode 100644 wxWidgets/src/expat/conftools/mkinstalldirs delete mode 100644 wxWidgets/src/expat/doc/reference.html delete mode 100644 wxWidgets/src/expat/doc/style.css delete mode 100644 wxWidgets/src/expat/doc/valid-xhtml10.png delete mode 100644 wxWidgets/src/expat/doc/xmlwf.1 delete mode 100644 wxWidgets/src/expat/doc/xmlwf.sgml delete mode 100644 wxWidgets/src/expat/examples/elements.c delete mode 100644 wxWidgets/src/expat/examples/outline.c delete mode 100644 wxWidgets/src/expat/expat.dsp delete mode 100644 wxWidgets/src/expat/expat_config.h.in delete mode 100644 wxWidgets/src/expat/lib/ascii.h delete mode 100644 wxWidgets/src/expat/lib/asciitab.h delete mode 100644 wxWidgets/src/expat/lib/dosconfig.h delete mode 100644 wxWidgets/src/expat/lib/expat.h delete mode 100644 wxWidgets/src/expat/lib/iasciitab.h delete mode 100644 wxWidgets/src/expat/lib/internal.h delete mode 100644 wxWidgets/src/expat/lib/latin1tab.h delete mode 100644 wxWidgets/src/expat/lib/macconfig.h delete mode 100644 wxWidgets/src/expat/lib/nametab.h delete mode 100644 wxWidgets/src/expat/lib/os2config.h delete mode 100644 wxWidgets/src/expat/lib/utf8tab.h delete mode 100644 wxWidgets/src/expat/lib/winconfig.h delete mode 100644 wxWidgets/src/expat/lib/xmlparse.c delete mode 100644 wxWidgets/src/expat/lib/xmlrole.c delete mode 100644 wxWidgets/src/expat/lib/xmlrole.h delete mode 100644 wxWidgets/src/expat/lib/xmltok.c delete mode 100644 wxWidgets/src/expat/lib/xmltok.h delete mode 100644 wxWidgets/src/expat/lib/xmltok_impl.c delete mode 100644 wxWidgets/src/expat/lib/xmltok_impl.h delete mode 100644 wxWidgets/src/expat/lib/xmltok_ns.c delete mode 100644 wxWidgets/src/expat/vms/README.vms delete mode 100644 wxWidgets/src/expat/vms/descrip.mms delete mode 100644 wxWidgets/src/expat/vms/expat_config.h delete mode 100644 wxWidgets/src/expat/win32/MANIFEST.txt delete mode 100644 wxWidgets/src/expat/win32/expat.iss delete mode 100644 wxWidgets/src/expat/xmlwf/codepage.c delete mode 100644 wxWidgets/src/expat/xmlwf/codepage.h delete mode 100644 wxWidgets/src/expat/xmlwf/ct.c delete mode 100644 wxWidgets/src/expat/xmlwf/filemap.h delete mode 100644 wxWidgets/src/expat/xmlwf/readfilemap.c delete mode 100644 wxWidgets/src/expat/xmlwf/unixfilemap.c delete mode 100644 wxWidgets/src/expat/xmlwf/win32filemap.c delete mode 100644 wxWidgets/src/expat/xmlwf/xmlfile.c delete mode 100644 wxWidgets/src/expat/xmlwf/xmlfile.h delete mode 100644 wxWidgets/src/expat/xmlwf/xmlmime.c delete mode 100644 wxWidgets/src/expat/xmlwf/xmlmime.h delete mode 100644 wxWidgets/src/expat/xmlwf/xmltchar.h delete mode 100644 wxWidgets/src/expat/xmlwf/xmlurl.h delete mode 100644 wxWidgets/src/expat/xmlwf/xmlwf.c delete mode 100644 wxWidgets/src/expat/xmlwf/xmlwin32url.cxx delete mode 100644 wxWidgets/src/generic/aboutdlgg.cpp delete mode 100644 wxWidgets/src/generic/accel.cpp delete mode 100644 wxWidgets/src/generic/animateg.cpp delete mode 100644 wxWidgets/src/generic/bmpcboxg.cpp delete mode 100644 wxWidgets/src/generic/busyinfo.cpp delete mode 100644 wxWidgets/src/generic/buttonbar.cpp delete mode 100644 wxWidgets/src/generic/calctrl.cpp delete mode 100644 wxWidgets/src/generic/caret.cpp delete mode 100644 wxWidgets/src/generic/choicbkg.cpp delete mode 100644 wxWidgets/src/generic/choicdgg.cpp delete mode 100644 wxWidgets/src/generic/clrpickerg.cpp delete mode 100644 wxWidgets/src/generic/collpaneg.cpp delete mode 100644 wxWidgets/src/generic/colour.cpp delete mode 100644 wxWidgets/src/generic/colrdlgg.cpp delete mode 100644 wxWidgets/src/generic/combog.cpp delete mode 100644 wxWidgets/src/generic/datavgen.cpp delete mode 100644 wxWidgets/src/generic/datectlg.cpp delete mode 100644 wxWidgets/src/generic/dbgrptg.cpp delete mode 100644 wxWidgets/src/generic/dcpsg.cpp delete mode 100644 wxWidgets/src/generic/descrip.mms delete mode 100644 wxWidgets/src/generic/dirctrlg.cpp delete mode 100644 wxWidgets/src/generic/dirdlgg.cpp delete mode 100644 wxWidgets/src/generic/dragimgg.cpp delete mode 100644 wxWidgets/src/generic/fdrepdlg.cpp delete mode 100644 wxWidgets/src/generic/filedlgg.cpp delete mode 100644 wxWidgets/src/generic/filepickerg.cpp delete mode 100644 wxWidgets/src/generic/fontdlgg.cpp delete mode 100644 wxWidgets/src/generic/fontpickerg.cpp delete mode 100644 wxWidgets/src/generic/graphicc.cpp delete mode 100644 wxWidgets/src/generic/grid.cpp delete mode 100644 wxWidgets/src/generic/gridctrl.cpp delete mode 100644 wxWidgets/src/generic/gridsel.cpp delete mode 100644 wxWidgets/src/generic/helpext.cpp delete mode 100644 wxWidgets/src/generic/htmllbox.cpp delete mode 100644 wxWidgets/src/generic/hyperlink.cpp delete mode 100644 wxWidgets/src/generic/icon.cpp delete mode 100644 wxWidgets/src/generic/imaglist.cpp delete mode 100644 wxWidgets/src/generic/laywin.cpp delete mode 100644 wxWidgets/src/generic/listbkg.cpp delete mode 100644 wxWidgets/src/generic/listctrl.cpp delete mode 100644 wxWidgets/src/generic/logg.cpp delete mode 100644 wxWidgets/src/generic/mask.cpp delete mode 100644 wxWidgets/src/generic/mdig.cpp delete mode 100644 wxWidgets/src/generic/msgdlgg.cpp delete mode 100644 wxWidgets/src/generic/notebook.cpp delete mode 100644 wxWidgets/src/generic/numdlgg.cpp delete mode 100644 wxWidgets/src/generic/odcombo.cpp delete mode 100644 wxWidgets/src/generic/paletteg.cpp delete mode 100644 wxWidgets/src/generic/panelg.cpp delete mode 100644 wxWidgets/src/generic/printps.cpp delete mode 100644 wxWidgets/src/generic/prntdlgg.cpp delete mode 100644 wxWidgets/src/generic/progdlgg.cpp delete mode 100644 wxWidgets/src/generic/propdlg.cpp delete mode 100644 wxWidgets/src/generic/regiong.cpp delete mode 100644 wxWidgets/src/generic/renderg.cpp delete mode 100644 wxWidgets/src/generic/sashwin.cpp delete mode 100644 wxWidgets/src/generic/scrlwing.cpp delete mode 100644 wxWidgets/src/generic/selstore.cpp delete mode 100644 wxWidgets/src/generic/spinctlg.cpp delete mode 100644 wxWidgets/src/generic/splash.cpp delete mode 100644 wxWidgets/src/generic/splitter.cpp delete mode 100644 wxWidgets/src/generic/srchctlg.cpp delete mode 100644 wxWidgets/src/generic/statline.cpp delete mode 100644 wxWidgets/src/generic/statusbr.cpp delete mode 100644 wxWidgets/src/generic/tabg.cpp delete mode 100644 wxWidgets/src/generic/textdlgg.cpp delete mode 100644 wxWidgets/src/generic/timer.cpp delete mode 100644 wxWidgets/src/generic/tipdlg.cpp delete mode 100644 wxWidgets/src/generic/tipwin.cpp delete mode 100644 wxWidgets/src/generic/toolbkg.cpp delete mode 100644 wxWidgets/src/generic/treebkg.cpp delete mode 100644 wxWidgets/src/generic/treectlg.cpp delete mode 100644 wxWidgets/src/generic/vlbox.cpp delete mode 100644 wxWidgets/src/generic/vscroll.cpp delete mode 100644 wxWidgets/src/generic/wizard.cpp delete mode 100644 wxWidgets/src/html/chm.cpp delete mode 100644 wxWidgets/src/html/descrip.mms delete mode 100644 wxWidgets/src/html/helpctrl.cpp delete mode 100644 wxWidgets/src/html/helpdata.cpp delete mode 100644 wxWidgets/src/html/helpdlg.cpp delete mode 100644 wxWidgets/src/html/helpfrm.cpp delete mode 100644 wxWidgets/src/html/helpwnd.cpp delete mode 100644 wxWidgets/src/html/htmlcell.cpp delete mode 100644 wxWidgets/src/html/htmlctrl/webkit/webkit.mm delete mode 100644 wxWidgets/src/html/htmlfilt.cpp delete mode 100644 wxWidgets/src/html/htmlpars.cpp delete mode 100644 wxWidgets/src/html/htmltag.cpp delete mode 100644 wxWidgets/src/html/htmlwin.cpp delete mode 100644 wxWidgets/src/html/htmprint.cpp delete mode 100644 wxWidgets/src/html/m_dflist.cpp delete mode 100644 wxWidgets/src/html/m_fonts.cpp delete mode 100644 wxWidgets/src/html/m_hline.cpp delete mode 100644 wxWidgets/src/html/m_image.cpp delete mode 100644 wxWidgets/src/html/m_layout.cpp delete mode 100644 wxWidgets/src/html/m_links.cpp delete mode 100644 wxWidgets/src/html/m_list.cpp delete mode 100644 wxWidgets/src/html/m_pre.cpp delete mode 100644 wxWidgets/src/html/m_style.cpp delete mode 100644 wxWidgets/src/html/m_tables.cpp delete mode 100644 wxWidgets/src/html/winpars.cpp delete mode 100644 wxWidgets/src/iodbc/AUTHORS delete mode 100644 wxWidgets/src/iodbc/COPYING delete mode 100644 wxWidgets/src/iodbc/Changes.log delete mode 100644 wxWidgets/src/iodbc/IAFA-PACKAGE delete mode 100644 wxWidgets/src/iodbc/INSTALL delete mode 100644 wxWidgets/src/iodbc/NEWS delete mode 100644 wxWidgets/src/iodbc/README delete mode 100644 wxWidgets/src/iodbc/autoconfig delete mode 100644 wxWidgets/src/iodbc/catalog.c delete mode 100644 wxWidgets/src/iodbc/config.h delete mode 100644 wxWidgets/src/iodbc/connect.c delete mode 100644 wxWidgets/src/iodbc/dlf.c delete mode 100644 wxWidgets/src/iodbc/dlf.h delete mode 100644 wxWidgets/src/iodbc/dlproc.c delete mode 100644 wxWidgets/src/iodbc/dlproc.h delete mode 100644 wxWidgets/src/iodbc/execute.c delete mode 100644 wxWidgets/src/iodbc/fetch.c delete mode 100644 wxWidgets/src/iodbc/hdbc.c delete mode 100644 wxWidgets/src/iodbc/hdbc.h delete mode 100644 wxWidgets/src/iodbc/henv.c delete mode 100644 wxWidgets/src/iodbc/henv.ci delete mode 100644 wxWidgets/src/iodbc/henv.h delete mode 100644 wxWidgets/src/iodbc/herr.c delete mode 100644 wxWidgets/src/iodbc/herr.ci delete mode 100644 wxWidgets/src/iodbc/herr.h delete mode 100644 wxWidgets/src/iodbc/hstmt.c delete mode 100644 wxWidgets/src/iodbc/hstmt.h delete mode 100644 wxWidgets/src/iodbc/info.c delete mode 100644 wxWidgets/src/iodbc/iodbc.h delete mode 100644 wxWidgets/src/iodbc/isql.h delete mode 100644 wxWidgets/src/iodbc/isqlext.h delete mode 100644 wxWidgets/src/iodbc/itrace.c delete mode 100644 wxWidgets/src/iodbc/itrace.h delete mode 100644 wxWidgets/src/iodbc/misc.c delete mode 100644 wxWidgets/src/iodbc/prepare.c delete mode 100644 wxWidgets/src/iodbc/result.c delete mode 100644 wxWidgets/src/iodbc/shrsub.exp delete mode 100644 wxWidgets/src/jpeg/MAKEFILE.VA delete mode 100644 wxWidgets/src/jpeg/README delete mode 100644 wxWidgets/src/jpeg/ansi2knr.1 delete mode 100644 wxWidgets/src/jpeg/ansi2knr.c delete mode 100644 wxWidgets/src/jpeg/change.log delete mode 100644 wxWidgets/src/jpeg/jcapimin.c delete mode 100644 wxWidgets/src/jpeg/jcapistd.c delete mode 100644 wxWidgets/src/jpeg/jccoefct.c delete mode 100644 wxWidgets/src/jpeg/jccolor.c delete mode 100644 wxWidgets/src/jpeg/jcdctmgr.c delete mode 100644 wxWidgets/src/jpeg/jchuff.c delete mode 100644 wxWidgets/src/jpeg/jchuff.h delete mode 100644 wxWidgets/src/jpeg/jcinit.c delete mode 100644 wxWidgets/src/jpeg/jcmainct.c delete mode 100644 wxWidgets/src/jpeg/jcmarker.c delete mode 100644 wxWidgets/src/jpeg/jcmaster.c delete mode 100644 wxWidgets/src/jpeg/jcomapi.c delete mode 100644 wxWidgets/src/jpeg/jconfig.h delete mode 100644 wxWidgets/src/jpeg/jconfig.vc delete mode 100644 wxWidgets/src/jpeg/jcparam.c delete mode 100644 wxWidgets/src/jpeg/jcphuff.c delete mode 100644 wxWidgets/src/jpeg/jcprepct.c delete mode 100644 wxWidgets/src/jpeg/jcsample.c delete mode 100644 wxWidgets/src/jpeg/jctrans.c delete mode 100644 wxWidgets/src/jpeg/jdapimin.c delete mode 100644 wxWidgets/src/jpeg/jdapistd.c delete mode 100644 wxWidgets/src/jpeg/jdatadst.c delete mode 100644 wxWidgets/src/jpeg/jdatasrc.c delete mode 100644 wxWidgets/src/jpeg/jdcoefct.c delete mode 100644 wxWidgets/src/jpeg/jdcolor.c delete mode 100644 wxWidgets/src/jpeg/jdct.h delete mode 100644 wxWidgets/src/jpeg/jddctmgr.c delete mode 100644 wxWidgets/src/jpeg/jdhuff.c delete mode 100644 wxWidgets/src/jpeg/jdhuff.h delete mode 100644 wxWidgets/src/jpeg/jdinput.c delete mode 100644 wxWidgets/src/jpeg/jdmainct.c delete mode 100644 wxWidgets/src/jpeg/jdmarker.c delete mode 100644 wxWidgets/src/jpeg/jdmaster.c delete mode 100644 wxWidgets/src/jpeg/jdmerge.c delete mode 100644 wxWidgets/src/jpeg/jdphuff.c delete mode 100644 wxWidgets/src/jpeg/jdpostct.c delete mode 100644 wxWidgets/src/jpeg/jdsample.c delete mode 100644 wxWidgets/src/jpeg/jdtrans.c delete mode 100644 wxWidgets/src/jpeg/jerror.c delete mode 100644 wxWidgets/src/jpeg/jerror.h delete mode 100644 wxWidgets/src/jpeg/jfdctflt.c delete mode 100644 wxWidgets/src/jpeg/jfdctfst.c delete mode 100644 wxWidgets/src/jpeg/jfdctint.c delete mode 100644 wxWidgets/src/jpeg/jidctflt.c delete mode 100644 wxWidgets/src/jpeg/jidctfst.c delete mode 100644 wxWidgets/src/jpeg/jidctint.c delete mode 100644 wxWidgets/src/jpeg/jidctred.c delete mode 100644 wxWidgets/src/jpeg/jinclude.h delete mode 100644 wxWidgets/src/jpeg/jmemansi.c delete mode 100644 wxWidgets/src/jpeg/jmemdos.c delete mode 100644 wxWidgets/src/jpeg/jmemdosa.asm delete mode 100644 wxWidgets/src/jpeg/jmemmac.c delete mode 100644 wxWidgets/src/jpeg/jmemmgr.c delete mode 100644 wxWidgets/src/jpeg/jmemname.c delete mode 100644 wxWidgets/src/jpeg/jmemnobs.c delete mode 100644 wxWidgets/src/jpeg/jmemsys.h delete mode 100644 wxWidgets/src/jpeg/jmorecfg.h delete mode 100644 wxWidgets/src/jpeg/jpeg.dsp delete mode 100644 wxWidgets/src/jpeg/jpegM8.xml delete mode 100644 wxWidgets/src/jpeg/jpeg_CW_Prefix.h delete mode 100644 wxWidgets/src/jpeg/jpegint.h delete mode 100644 wxWidgets/src/jpeg/jpeglib.h delete mode 100644 wxWidgets/src/jpeg/jpegtran.1 delete mode 100644 wxWidgets/src/jpeg/jpegtran.c delete mode 100644 wxWidgets/src/jpeg/jquant1.c delete mode 100644 wxWidgets/src/jpeg/jquant2.c delete mode 100644 wxWidgets/src/jpeg/jutils.c delete mode 100644 wxWidgets/src/jpeg/jversion.h delete mode 100644 wxWidgets/src/jpeg/makefile.unx delete mode 100644 wxWidgets/src/jpeg/makefile.vc delete mode 100644 wxWidgets/src/makeb32.env delete mode 100644 wxWidgets/src/makebcc.env delete mode 100644 wxWidgets/src/makefile.va delete mode 100644 wxWidgets/src/makefile.vc delete mode 100644 wxWidgets/src/makeg95.env delete mode 100644 wxWidgets/src/makelib.b32 delete mode 100644 wxWidgets/src/makelib.bcc delete mode 100644 wxWidgets/src/makelib.g95 delete mode 100644 wxWidgets/src/makelib.vc delete mode 100644 wxWidgets/src/makemsc.env delete mode 100644 wxWidgets/src/makeprog.b32 delete mode 100644 wxWidgets/src/makeprog.bcc delete mode 100644 wxWidgets/src/makeprog.g95 delete mode 100644 wxWidgets/src/makeprog.sl delete mode 100644 wxWidgets/src/makeprog.va delete mode 100644 wxWidgets/src/makeprog.vc delete mode 100644 wxWidgets/src/makesl.env delete mode 100644 wxWidgets/src/makeva.env delete mode 100644 wxWidgets/src/makevc.env delete mode 100644 wxWidgets/src/mingegcs.bat delete mode 100644 wxWidgets/src/mingw32.bat delete mode 100644 wxWidgets/src/msw/aboutdlg.cpp delete mode 100644 wxWidgets/src/msw/accel.cpp delete mode 100644 wxWidgets/src/msw/app.cpp delete mode 100644 wxWidgets/src/msw/basemsw.cpp delete mode 100644 wxWidgets/src/msw/bitmap.cpp delete mode 100644 wxWidgets/src/msw/bmpbuttn.cpp delete mode 100644 wxWidgets/src/msw/brush.cpp delete mode 100644 wxWidgets/src/msw/button.cpp delete mode 100644 wxWidgets/src/msw/caret.cpp delete mode 100644 wxWidgets/src/msw/checkbox.cpp delete mode 100644 wxWidgets/src/msw/checklst.cpp delete mode 100644 wxWidgets/src/msw/choice.cpp delete mode 100644 wxWidgets/src/msw/clipbrd.cpp delete mode 100644 wxWidgets/src/msw/colordlg.cpp delete mode 100644 wxWidgets/src/msw/colour.cpp delete mode 100644 wxWidgets/src/msw/combo.cpp delete mode 100644 wxWidgets/src/msw/combobox.cpp delete mode 100644 wxWidgets/src/msw/control.cpp delete mode 100644 wxWidgets/src/msw/crashrpt.cpp delete mode 100644 wxWidgets/src/msw/cursor.cpp delete mode 100644 wxWidgets/src/msw/data.cpp delete mode 100644 wxWidgets/src/msw/datectrl.cpp delete mode 100644 wxWidgets/src/msw/dc.cpp delete mode 100644 wxWidgets/src/msw/dcclient.cpp delete mode 100644 wxWidgets/src/msw/dcmemory.cpp delete mode 100644 wxWidgets/src/msw/dcprint.cpp delete mode 100644 wxWidgets/src/msw/dcscreen.cpp delete mode 100644 wxWidgets/src/msw/dde.cpp delete mode 100644 wxWidgets/src/msw/debughlp.cpp delete mode 100644 wxWidgets/src/msw/dialog.cpp delete mode 100644 wxWidgets/src/msw/dialup.cpp delete mode 100644 wxWidgets/src/msw/dib.cpp delete mode 100644 wxWidgets/src/msw/dir.cpp delete mode 100644 wxWidgets/src/msw/dirdlg.cpp delete mode 100644 wxWidgets/src/msw/display.cpp delete mode 100644 wxWidgets/src/msw/dlmsw.cpp delete mode 100644 wxWidgets/src/msw/dragimag.cpp delete mode 100644 wxWidgets/src/msw/enhmeta.cpp delete mode 100644 wxWidgets/src/msw/evtloop.cpp delete mode 100644 wxWidgets/src/msw/fdrepdlg.cpp delete mode 100644 wxWidgets/src/msw/filedlg.cpp delete mode 100644 wxWidgets/src/msw/font.cpp delete mode 100644 wxWidgets/src/msw/fontdlg.cpp delete mode 100644 wxWidgets/src/msw/fontenum.cpp delete mode 100644 wxWidgets/src/msw/fontutil.cpp delete mode 100644 wxWidgets/src/msw/frame.cpp delete mode 100644 wxWidgets/src/msw/gauge95.cpp delete mode 100644 wxWidgets/src/msw/gdiimage.cpp delete mode 100644 wxWidgets/src/msw/gdiobj.cpp delete mode 100644 wxWidgets/src/msw/glcanvas.cpp delete mode 100644 wxWidgets/src/msw/graphics.cpp delete mode 100644 wxWidgets/src/msw/gsocket.cpp delete mode 100644 wxWidgets/src/msw/gsockmsw.cpp delete mode 100644 wxWidgets/src/msw/helpbest.cpp delete mode 100644 wxWidgets/src/msw/helpchm.cpp delete mode 100644 wxWidgets/src/msw/helpwin.cpp delete mode 100644 wxWidgets/src/msw/icon.cpp delete mode 100644 wxWidgets/src/msw/imaglist.cpp delete mode 100644 wxWidgets/src/msw/iniconf.cpp delete mode 100644 wxWidgets/src/msw/joystick.cpp delete mode 100644 wxWidgets/src/msw/listbox.cpp delete mode 100644 wxWidgets/src/msw/listctrl.cpp delete mode 100644 wxWidgets/src/msw/main.cpp delete mode 100644 wxWidgets/src/msw/makebase.b32 delete mode 100644 wxWidgets/src/msw/makebase.vc delete mode 100644 wxWidgets/src/msw/makefile.mic delete mode 100644 wxWidgets/src/msw/makefile.sl delete mode 100644 wxWidgets/src/msw/mdi.cpp delete mode 100644 wxWidgets/src/msw/mediactrl.cpp delete mode 100644 wxWidgets/src/msw/mediactrl_am.cpp delete mode 100644 wxWidgets/src/msw/mediactrl_qt.cpp delete mode 100644 wxWidgets/src/msw/mediactrl_wmp10.cpp delete mode 100644 wxWidgets/src/msw/menu.cpp delete mode 100644 wxWidgets/src/msw/menuitem.cpp delete mode 100644 wxWidgets/src/msw/metafile.cpp delete mode 100644 wxWidgets/src/msw/microwin.c delete mode 100644 wxWidgets/src/msw/mimetype.cpp delete mode 100644 wxWidgets/src/msw/minifram.cpp delete mode 100644 wxWidgets/src/msw/msgdlg.cpp delete mode 100644 wxWidgets/src/msw/mslu.cpp delete mode 100644 wxWidgets/src/msw/nativdlg.cpp delete mode 100644 wxWidgets/src/msw/notebook.cpp delete mode 100644 wxWidgets/src/msw/ole/access.cpp delete mode 100644 wxWidgets/src/msw/ole/activex.cpp delete mode 100644 wxWidgets/src/msw/ole/automtn.cpp delete mode 100644 wxWidgets/src/msw/ole/dataobj.cpp delete mode 100644 wxWidgets/src/msw/ole/dropsrc.cpp delete mode 100644 wxWidgets/src/msw/ole/droptgt.cpp delete mode 100644 wxWidgets/src/msw/ole/oleutils.cpp delete mode 100644 wxWidgets/src/msw/ole/uuid.cpp delete mode 100644 wxWidgets/src/msw/ownerdrw.cpp delete mode 100644 wxWidgets/src/msw/palette.cpp delete mode 100644 wxWidgets/src/msw/pen.cpp delete mode 100644 wxWidgets/src/msw/penwin.cpp delete mode 100644 wxWidgets/src/msw/popupwin.cpp delete mode 100644 wxWidgets/src/msw/power.cpp delete mode 100644 wxWidgets/src/msw/printdlg.cpp delete mode 100644 wxWidgets/src/msw/printwin.cpp delete mode 100644 wxWidgets/src/msw/radiobox.cpp delete mode 100644 wxWidgets/src/msw/radiobut.cpp delete mode 100644 wxWidgets/src/msw/regconf.cpp delete mode 100644 wxWidgets/src/msw/region.cpp delete mode 100644 wxWidgets/src/msw/registry.cpp delete mode 100644 wxWidgets/src/msw/renderer.cpp delete mode 100644 wxWidgets/src/msw/salford.lnk delete mode 100644 wxWidgets/src/msw/scrolbar.cpp delete mode 100644 wxWidgets/src/msw/settings.cpp delete mode 100644 wxWidgets/src/msw/slider95.cpp delete mode 100644 wxWidgets/src/msw/snglinst.cpp delete mode 100644 wxWidgets/src/msw/sound.cpp delete mode 100644 wxWidgets/src/msw/spinbutt.cpp delete mode 100644 wxWidgets/src/msw/spinctrl.cpp delete mode 100644 wxWidgets/src/msw/stackwalk.cpp delete mode 100644 wxWidgets/src/msw/statbmp.cpp delete mode 100644 wxWidgets/src/msw/statbox.cpp delete mode 100644 wxWidgets/src/msw/statbr95.cpp delete mode 100644 wxWidgets/src/msw/statline.cpp delete mode 100644 wxWidgets/src/msw/stattext.cpp delete mode 100644 wxWidgets/src/msw/stdpaths.cpp delete mode 100644 wxWidgets/src/msw/tabctrl.cpp delete mode 100644 wxWidgets/src/msw/taskbar.cpp delete mode 100644 wxWidgets/src/msw/tbar95.cpp delete mode 100644 wxWidgets/src/msw/textctrl.cpp delete mode 100644 wxWidgets/src/msw/tglbtn.cpp delete mode 100644 wxWidgets/src/msw/thread.cpp delete mode 100644 wxWidgets/src/msw/timer.cpp delete mode 100644 wxWidgets/src/msw/tooltip.cpp delete mode 100644 wxWidgets/src/msw/toplevel.cpp delete mode 100644 wxWidgets/src/msw/treectrl.cpp delete mode 100644 wxWidgets/src/msw/urlmsw.cpp delete mode 100644 wxWidgets/src/msw/utils.cpp delete mode 100644 wxWidgets/src/msw/utilsexc.cpp delete mode 100644 wxWidgets/src/msw/utilsgui.cpp delete mode 100644 wxWidgets/src/msw/uxtheme.cpp delete mode 100644 wxWidgets/src/msw/version.rc delete mode 100644 wxWidgets/src/msw/volume.cpp delete mode 100644 wxWidgets/src/msw/wince/checklst.cpp delete mode 100644 wxWidgets/src/msw/wince/choicece.cpp delete mode 100644 wxWidgets/src/msw/wince/clean_vcp.py delete mode 100644 wxWidgets/src/msw/wince/crt.cpp delete mode 100644 wxWidgets/src/msw/wince/filedlgwce.cpp delete mode 100644 wxWidgets/src/msw/wince/filefnwce.cpp delete mode 100644 wxWidgets/src/msw/wince/helpwce.cpp delete mode 100644 wxWidgets/src/msw/wince/menuce.cpp delete mode 100644 wxWidgets/src/msw/wince/net.cpp delete mode 100644 wxWidgets/src/msw/wince/tbarwce.cpp delete mode 100644 wxWidgets/src/msw/wince/textctrlce.cpp delete mode 100644 wxWidgets/src/msw/wince/time.cpp delete mode 100644 wxWidgets/src/msw/window.cpp delete mode 100644 wxWidgets/src/msw/winestub.c delete mode 100644 wxWidgets/src/ntwxwin.mak delete mode 100644 wxWidgets/src/png/ANNOUNCE delete mode 100644 wxWidgets/src/png/CHANGES delete mode 100644 wxWidgets/src/png/INSTALL delete mode 100644 wxWidgets/src/png/KNOWNBUG delete mode 100644 wxWidgets/src/png/LICENSE delete mode 100644 wxWidgets/src/png/MAKEFILE.VA delete mode 100644 wxWidgets/src/png/README delete mode 100644 wxWidgets/src/png/TODO delete mode 100644 wxWidgets/src/png/Y2KINFO delete mode 100644 wxWidgets/src/png/ansi2knr.1 delete mode 100644 wxWidgets/src/png/ansi2knr.c delete mode 100644 wxWidgets/src/png/configure delete mode 100644 wxWidgets/src/png/example.c delete mode 100644 wxWidgets/src/png/libpng.3 delete mode 100644 wxWidgets/src/png/libpng.txt delete mode 100644 wxWidgets/src/png/libpngpf.3 delete mode 100644 wxWidgets/src/png/makefile.unx delete mode 100644 wxWidgets/src/png/makefile.vc delete mode 100644 wxWidgets/src/png/png.5 delete mode 100644 wxWidgets/src/png/png.c delete mode 100644 wxWidgets/src/png/png.dsp delete mode 100644 wxWidgets/src/png/png.h delete mode 100644 wxWidgets/src/png/pngM8.xml delete mode 100644 wxWidgets/src/png/pngasmrd.h delete mode 100644 wxWidgets/src/png/pngbar.jpg delete mode 100644 wxWidgets/src/png/pngbar.png delete mode 100644 wxWidgets/src/png/pngconf.h delete mode 100644 wxWidgets/src/png/pngerror.c delete mode 100644 wxWidgets/src/png/pnggccrd.c delete mode 100644 wxWidgets/src/png/pngget.c delete mode 100644 wxWidgets/src/png/pngmem.c delete mode 100644 wxWidgets/src/png/pngnow.png delete mode 100644 wxWidgets/src/png/pngpread.c delete mode 100644 wxWidgets/src/png/pngread.c delete mode 100644 wxWidgets/src/png/pngrio.c delete mode 100644 wxWidgets/src/png/pngrtran.c delete mode 100644 wxWidgets/src/png/pngrutil.c delete mode 100644 wxWidgets/src/png/pngset.c delete mode 100644 wxWidgets/src/png/pngtest.c delete mode 100644 wxWidgets/src/png/pngtest.png delete mode 100644 wxWidgets/src/png/pngtrans.c delete mode 100644 wxWidgets/src/png/pngvcrd.c delete mode 100644 wxWidgets/src/png/pngwio.c delete mode 100644 wxWidgets/src/png/pngwrite.c delete mode 100644 wxWidgets/src/png/pngwtran.c delete mode 100644 wxWidgets/src/png/pngwutil.c delete mode 100644 wxWidgets/src/png/projects/beos/x86-shared.proj delete mode 100644 wxWidgets/src/png/projects/beos/x86-shared.txt delete mode 100644 wxWidgets/src/png/projects/beos/x86-static.proj delete mode 100644 wxWidgets/src/png/projects/beos/x86-static.txt delete mode 100644 wxWidgets/src/png/projects/cbuilder5/libpng.bpf delete mode 100644 wxWidgets/src/png/projects/cbuilder5/libpng.bpg delete mode 100644 wxWidgets/src/png/projects/cbuilder5/libpng.bpr delete mode 100644 wxWidgets/src/png/projects/cbuilder5/libpng.cpp delete mode 100644 wxWidgets/src/png/projects/cbuilder5/libpng.readme.txt delete mode 100644 wxWidgets/src/png/projects/cbuilder5/libpngstat.bpf delete mode 100644 wxWidgets/src/png/projects/cbuilder5/libpngstat.bpr delete mode 100644 wxWidgets/src/png/projects/cbuilder5/zlib.readme.txt delete mode 100644 wxWidgets/src/png/projects/netware.txt delete mode 100644 wxWidgets/src/png/projects/visualc6/README.txt delete mode 100644 wxWidgets/src/png/projects/visualc6/libpng.dsp delete mode 100644 wxWidgets/src/png/projects/visualc6/pngtest.dsp delete mode 100644 wxWidgets/src/png/projects/wince.txt delete mode 100644 wxWidgets/src/png/scripts/SCOPTIONS.ppc delete mode 100644 wxWidgets/src/png/scripts/descrip.mms delete mode 100644 wxWidgets/src/png/scripts/libpng-config-body.in delete mode 100644 wxWidgets/src/png/scripts/libpng-config-head.in delete mode 100644 wxWidgets/src/png/scripts/libpng.icc delete mode 100644 wxWidgets/src/png/scripts/libpng.pc.in delete mode 100644 wxWidgets/src/png/scripts/makefile.32sunu delete mode 100644 wxWidgets/src/png/scripts/makefile.64sunu delete mode 100644 wxWidgets/src/png/scripts/makefile.acorn delete mode 100644 wxWidgets/src/png/scripts/makefile.aix delete mode 100644 wxWidgets/src/png/scripts/makefile.amiga delete mode 100644 wxWidgets/src/png/scripts/makefile.atari delete mode 100644 wxWidgets/src/png/scripts/makefile.bc32 delete mode 100644 wxWidgets/src/png/scripts/makefile.beos delete mode 100644 wxWidgets/src/png/scripts/makefile.bor delete mode 100644 wxWidgets/src/png/scripts/makefile.cygwin delete mode 100644 wxWidgets/src/png/scripts/makefile.darwin delete mode 100644 wxWidgets/src/png/scripts/makefile.dec delete mode 100644 wxWidgets/src/png/scripts/makefile.dj2 delete mode 100644 wxWidgets/src/png/scripts/makefile.freebsd delete mode 100644 wxWidgets/src/png/scripts/makefile.gcc delete mode 100644 wxWidgets/src/png/scripts/makefile.gcmmx delete mode 100644 wxWidgets/src/png/scripts/makefile.hp64 delete mode 100644 wxWidgets/src/png/scripts/makefile.hpgcc delete mode 100644 wxWidgets/src/png/scripts/makefile.hpux delete mode 100644 wxWidgets/src/png/scripts/makefile.ibmc delete mode 100644 wxWidgets/src/png/scripts/makefile.intel delete mode 100644 wxWidgets/src/png/scripts/makefile.knr delete mode 100644 wxWidgets/src/png/scripts/makefile.linux delete mode 100644 wxWidgets/src/png/scripts/makefile.macosx delete mode 100644 wxWidgets/src/png/scripts/makefile.mips delete mode 100644 wxWidgets/src/png/scripts/makefile.msc delete mode 100644 wxWidgets/src/png/scripts/makefile.ne12bsd delete mode 100644 wxWidgets/src/png/scripts/makefile.netbsd delete mode 100644 wxWidgets/src/png/scripts/makefile.openbsd delete mode 100644 wxWidgets/src/png/scripts/makefile.os2 delete mode 100644 wxWidgets/src/png/scripts/makefile.sco delete mode 100644 wxWidgets/src/png/scripts/makefile.sggcc delete mode 100644 wxWidgets/src/png/scripts/makefile.sgi delete mode 100644 wxWidgets/src/png/scripts/makefile.so9 delete mode 100644 wxWidgets/src/png/scripts/makefile.solaris delete mode 100644 wxWidgets/src/png/scripts/makefile.std delete mode 100644 wxWidgets/src/png/scripts/makefile.sunos delete mode 100644 wxWidgets/src/png/scripts/makefile.tc3 delete mode 100644 wxWidgets/src/png/scripts/makefile.vcawin32 delete mode 100644 wxWidgets/src/png/scripts/makefile.vcwin32 delete mode 100644 wxWidgets/src/png/scripts/makefile.watcom delete mode 100644 wxWidgets/src/png/scripts/makevms.com delete mode 100644 wxWidgets/src/png/scripts/pngos2.def delete mode 100644 wxWidgets/src/png/scripts/pngw32.def delete mode 100644 wxWidgets/src/png/scripts/pngw32.rc delete mode 100644 wxWidgets/src/png/scripts/smakefile.ppc delete mode 100644 wxWidgets/src/regex/COPYRIGHT delete mode 100644 wxWidgets/src/regex/README delete mode 100644 wxWidgets/src/regex/re_syntax.n delete mode 100644 wxWidgets/src/regex/regc_color.c delete mode 100644 wxWidgets/src/regex/regc_cvec.c delete mode 100644 wxWidgets/src/regex/regc_lex.c delete mode 100644 wxWidgets/src/regex/regc_locale.c delete mode 100644 wxWidgets/src/regex/regc_nfa.c delete mode 100644 wxWidgets/src/regex/regcomp.c delete mode 100644 wxWidgets/src/regex/regcustom.h delete mode 100644 wxWidgets/src/regex/rege_dfa.c delete mode 100644 wxWidgets/src/regex/regerror.c delete mode 100644 wxWidgets/src/regex/regerrs.h delete mode 100644 wxWidgets/src/regex/regex.dsp delete mode 100644 wxWidgets/src/regex/regex.h delete mode 100644 wxWidgets/src/regex/regexM8.xml delete mode 100644 wxWidgets/src/regex/regexec.c delete mode 100644 wxWidgets/src/regex/regfree.c delete mode 100644 wxWidgets/src/regex/regfronts.c delete mode 100644 wxWidgets/src/regex/regguts.h delete mode 100644 wxWidgets/src/regex/splice.sh delete mode 100644 wxWidgets/src/regex/tclUniData.c delete mode 100644 wxWidgets/src/richtext/richtextbuffer.cpp delete mode 100644 wxWidgets/src/richtext/richtextbulletspage.cpp delete mode 100644 wxWidgets/src/richtext/richtextctrl.cpp delete mode 100644 wxWidgets/src/richtext/richtextdialogs.pjd delete mode 100644 wxWidgets/src/richtext/richtextfontpage.cpp delete mode 100644 wxWidgets/src/richtext/richtextformatdlg.cpp delete mode 100644 wxWidgets/src/richtext/richtexthtml.cpp delete mode 100644 wxWidgets/src/richtext/richtextindentspage.cpp delete mode 100644 wxWidgets/src/richtext/richtextliststylepage.cpp delete mode 100644 wxWidgets/src/richtext/richtextprint.cpp delete mode 100644 wxWidgets/src/richtext/richtextstyledlg.cpp delete mode 100644 wxWidgets/src/richtext/richtextstylepage.cpp delete mode 100644 wxWidgets/src/richtext/richtextstyles.cpp delete mode 100644 wxWidgets/src/richtext/richtextsymboldlg.cpp delete mode 100644 wxWidgets/src/richtext/richtexttabspage.cpp delete mode 100644 wxWidgets/src/richtext/richtextxml.cpp delete mode 100644 wxWidgets/src/tiff/COPYRIGHT delete mode 100644 wxWidgets/src/tiff/MAKEFILE.VA delete mode 100644 wxWidgets/src/tiff/Makefile.lcc delete mode 100644 wxWidgets/src/tiff/README delete mode 100644 wxWidgets/src/tiff/TODO delete mode 100644 wxWidgets/src/tiff/VERSION delete mode 100644 wxWidgets/src/tiff/fax3sm_winnt.c delete mode 100644 wxWidgets/src/tiff/libtiff.def delete mode 100644 wxWidgets/src/tiff/makefile.vc delete mode 100644 wxWidgets/src/tiff/mkg3states.c delete mode 100644 wxWidgets/src/tiff/mkspans.c delete mode 100644 wxWidgets/src/tiff/mkversion.c delete mode 100644 wxWidgets/src/tiff/port.h delete mode 100644 wxWidgets/src/tiff/t4.h delete mode 100644 wxWidgets/src/tiff/tif_acorn.c delete mode 100644 wxWidgets/src/tiff/tif_apple.c delete mode 100644 wxWidgets/src/tiff/tif_atari.c delete mode 100644 wxWidgets/src/tiff/tif_aux.c delete mode 100644 wxWidgets/src/tiff/tif_close.c delete mode 100644 wxWidgets/src/tiff/tif_codec.c delete mode 100644 wxWidgets/src/tiff/tif_color.c delete mode 100644 wxWidgets/src/tiff/tif_compress.c delete mode 100644 wxWidgets/src/tiff/tif_dir.c delete mode 100644 wxWidgets/src/tiff/tif_dir.h delete mode 100644 wxWidgets/src/tiff/tif_dirinfo.c delete mode 100644 wxWidgets/src/tiff/tif_dirread.c delete mode 100644 wxWidgets/src/tiff/tif_dirwrite.c delete mode 100644 wxWidgets/src/tiff/tif_dumpmode.c delete mode 100644 wxWidgets/src/tiff/tif_error.c delete mode 100644 wxWidgets/src/tiff/tif_extension.c delete mode 100644 wxWidgets/src/tiff/tif_fax3.c delete mode 100644 wxWidgets/src/tiff/tif_fax3.h delete mode 100644 wxWidgets/src/tiff/tif_fax3sm.c delete mode 100644 wxWidgets/src/tiff/tif_flush.c delete mode 100644 wxWidgets/src/tiff/tif_getimage.c delete mode 100644 wxWidgets/src/tiff/tif_jpeg.c delete mode 100644 wxWidgets/src/tiff/tif_luv.c delete mode 100644 wxWidgets/src/tiff/tif_lzw.c delete mode 100644 wxWidgets/src/tiff/tif_msdos.c delete mode 100644 wxWidgets/src/tiff/tif_next.c delete mode 100644 wxWidgets/src/tiff/tif_ojpeg.c delete mode 100644 wxWidgets/src/tiff/tif_open.c delete mode 100644 wxWidgets/src/tiff/tif_os2.c delete mode 100644 wxWidgets/src/tiff/tif_packbits.c delete mode 100644 wxWidgets/src/tiff/tif_pixarlog.c delete mode 100644 wxWidgets/src/tiff/tif_predict.c delete mode 100644 wxWidgets/src/tiff/tif_predict.h delete mode 100644 wxWidgets/src/tiff/tif_print.c delete mode 100644 wxWidgets/src/tiff/tif_read.c delete mode 100644 wxWidgets/src/tiff/tif_strip.c delete mode 100644 wxWidgets/src/tiff/tif_swab.c delete mode 100644 wxWidgets/src/tiff/tif_thunder.c delete mode 100644 wxWidgets/src/tiff/tif_tile.c delete mode 100644 wxWidgets/src/tiff/tif_unix.c delete mode 100644 wxWidgets/src/tiff/tif_version.c delete mode 100644 wxWidgets/src/tiff/tif_vms.c delete mode 100644 wxWidgets/src/tiff/tif_warning.c delete mode 100644 wxWidgets/src/tiff/tif_win3.c delete mode 100644 wxWidgets/src/tiff/tif_win32.c delete mode 100644 wxWidgets/src/tiff/tif_write.c delete mode 100644 wxWidgets/src/tiff/tif_zip.c delete mode 100644 wxWidgets/src/tiff/tiff.dsp delete mode 100644 wxWidgets/src/tiff/tiff.h delete mode 100644 wxWidgets/src/tiff/tiffM8.xml delete mode 100644 wxWidgets/src/tiff/tiff_CW_Prefix.h delete mode 100644 wxWidgets/src/tiff/tiffcomp.h delete mode 100644 wxWidgets/src/tiff/tiffconf.h delete mode 100644 wxWidgets/src/tiff/tiffio.h delete mode 100644 wxWidgets/src/tiff/tiffiop.h delete mode 100644 wxWidgets/src/tiff/tiffvers.h delete mode 100644 wxWidgets/src/tiff/uvcode.h delete mode 100644 wxWidgets/src/univ/bmpbuttn.cpp delete mode 100644 wxWidgets/src/univ/button.cpp delete mode 100644 wxWidgets/src/univ/checkbox.cpp delete mode 100644 wxWidgets/src/univ/checklst.cpp delete mode 100644 wxWidgets/src/univ/choice.cpp delete mode 100644 wxWidgets/src/univ/colschem.cpp delete mode 100644 wxWidgets/src/univ/combobox.cpp delete mode 100644 wxWidgets/src/univ/control.cpp delete mode 100644 wxWidgets/src/univ/ctrlrend.cpp delete mode 100644 wxWidgets/src/univ/descrip.mms delete mode 100644 wxWidgets/src/univ/dialog.cpp delete mode 100644 wxWidgets/src/univ/framuniv.cpp delete mode 100644 wxWidgets/src/univ/gauge.cpp delete mode 100644 wxWidgets/src/univ/inpcons.cpp delete mode 100644 wxWidgets/src/univ/inphand.cpp delete mode 100644 wxWidgets/src/univ/listbox.cpp delete mode 100644 wxWidgets/src/univ/menu.cpp delete mode 100644 wxWidgets/src/univ/notebook.cpp delete mode 100644 wxWidgets/src/univ/radiobox.cpp delete mode 100644 wxWidgets/src/univ/radiobut.cpp delete mode 100644 wxWidgets/src/univ/scrarrow.cpp delete mode 100644 wxWidgets/src/univ/scrolbar.cpp delete mode 100644 wxWidgets/src/univ/scrthumb.cpp delete mode 100644 wxWidgets/src/univ/slider.cpp delete mode 100644 wxWidgets/src/univ/spinbutt.cpp delete mode 100644 wxWidgets/src/univ/statbmp.cpp delete mode 100644 wxWidgets/src/univ/statbox.cpp delete mode 100644 wxWidgets/src/univ/statline.cpp delete mode 100644 wxWidgets/src/univ/stattext.cpp delete mode 100644 wxWidgets/src/univ/statusbr.cpp delete mode 100644 wxWidgets/src/univ/stdrend.cpp delete mode 100644 wxWidgets/src/univ/textctrl.cpp delete mode 100644 wxWidgets/src/univ/tglbtn.cpp delete mode 100644 wxWidgets/src/univ/theme.cpp delete mode 100644 wxWidgets/src/univ/themes/gtk.cpp delete mode 100644 wxWidgets/src/univ/themes/metal.cpp delete mode 100644 wxWidgets/src/univ/themes/mono.cpp delete mode 100644 wxWidgets/src/univ/themes/win32.cpp delete mode 100644 wxWidgets/src/univ/toolbar.cpp delete mode 100644 wxWidgets/src/univ/topluniv.cpp delete mode 100644 wxWidgets/src/univ/winuniv.cpp delete mode 100644 wxWidgets/src/unix/baseunix.cpp delete mode 100644 wxWidgets/src/unix/descrip.mms delete mode 100644 wxWidgets/src/unix/dialup.cpp delete mode 100644 wxWidgets/src/unix/dir.cpp delete mode 100644 wxWidgets/src/unix/displayx11.cpp delete mode 100644 wxWidgets/src/unix/dlunix.cpp delete mode 100644 wxWidgets/src/unix/fontenum.cpp delete mode 100644 wxWidgets/src/unix/fontutil.cpp delete mode 100644 wxWidgets/src/unix/gsocket.cpp delete mode 100644 wxWidgets/src/unix/joystick.cpp delete mode 100644 wxWidgets/src/unix/mediactrl.cpp delete mode 100644 wxWidgets/src/unix/mimetype.cpp delete mode 100644 wxWidgets/src/unix/snglinst.cpp delete mode 100644 wxWidgets/src/unix/sound.cpp delete mode 100644 wxWidgets/src/unix/sound_sdl.cpp delete mode 100644 wxWidgets/src/unix/stackwalk.cpp delete mode 100644 wxWidgets/src/unix/stdpaths.cpp delete mode 100644 wxWidgets/src/unix/taskbarx11.cpp delete mode 100644 wxWidgets/src/unix/threadpsx.cpp delete mode 100644 wxWidgets/src/unix/utilsunx.cpp delete mode 100644 wxWidgets/src/unix/utilsx11.cpp delete mode 100644 wxWidgets/src/version.mak delete mode 100644 wxWidgets/src/wxJpeg.icc delete mode 100644 wxWidgets/src/wxPng.icc delete mode 100644 wxWidgets/src/wxTiff.icc delete mode 100644 wxWidgets/src/wxWin.icc delete mode 100644 wxWidgets/src/wxWindowsClassicM8.xml delete mode 100644 wxWidgets/src/wxWindowsM8.xml delete mode 100644 wxWidgets/src/wxWindowsW7.xml delete mode 100644 wxWidgets/src/wxXpm.icc delete mode 100644 wxWidgets/src/wxZlib.icc delete mode 100644 wxWidgets/src/xml/descrip.mms delete mode 100644 wxWidgets/src/xml/xml.cpp delete mode 100644 wxWidgets/src/xrc/descrip.mms delete mode 100644 wxWidgets/src/xrc/xh_animatctrl.cpp delete mode 100644 wxWidgets/src/xrc/xh_bmp.cpp delete mode 100644 wxWidgets/src/xrc/xh_bmpbt.cpp delete mode 100644 wxWidgets/src/xrc/xh_bmpcbox.cpp delete mode 100644 wxWidgets/src/xrc/xh_bttn.cpp delete mode 100644 wxWidgets/src/xrc/xh_cald.cpp delete mode 100644 wxWidgets/src/xrc/xh_chckb.cpp delete mode 100644 wxWidgets/src/xrc/xh_chckl.cpp delete mode 100644 wxWidgets/src/xrc/xh_choic.cpp delete mode 100644 wxWidgets/src/xrc/xh_choicbk.cpp delete mode 100644 wxWidgets/src/xrc/xh_clrpicker.cpp delete mode 100644 wxWidgets/src/xrc/xh_collpane.cpp delete mode 100644 wxWidgets/src/xrc/xh_combo.cpp delete mode 100644 wxWidgets/src/xrc/xh_datectrl.cpp delete mode 100644 wxWidgets/src/xrc/xh_dirpicker.cpp delete mode 100644 wxWidgets/src/xrc/xh_dlg.cpp delete mode 100644 wxWidgets/src/xrc/xh_filepicker.cpp delete mode 100644 wxWidgets/src/xrc/xh_fontpicker.cpp delete mode 100644 wxWidgets/src/xrc/xh_frame.cpp delete mode 100644 wxWidgets/src/xrc/xh_gauge.cpp delete mode 100644 wxWidgets/src/xrc/xh_gdctl.cpp delete mode 100644 wxWidgets/src/xrc/xh_grid.cpp delete mode 100644 wxWidgets/src/xrc/xh_html.cpp delete mode 100644 wxWidgets/src/xrc/xh_htmllbox.cpp delete mode 100644 wxWidgets/src/xrc/xh_hyperlink.cpp delete mode 100644 wxWidgets/src/xrc/xh_listb.cpp delete mode 100644 wxWidgets/src/xrc/xh_listbk.cpp delete mode 100644 wxWidgets/src/xrc/xh_listc.cpp delete mode 100644 wxWidgets/src/xrc/xh_mdi.cpp delete mode 100644 wxWidgets/src/xrc/xh_menu.cpp delete mode 100644 wxWidgets/src/xrc/xh_notbk.cpp delete mode 100644 wxWidgets/src/xrc/xh_odcombo.cpp delete mode 100644 wxWidgets/src/xrc/xh_panel.cpp delete mode 100644 wxWidgets/src/xrc/xh_propdlg.cpp delete mode 100644 wxWidgets/src/xrc/xh_radbt.cpp delete mode 100644 wxWidgets/src/xrc/xh_radbx.cpp delete mode 100644 wxWidgets/src/xrc/xh_richtext.cpp delete mode 100644 wxWidgets/src/xrc/xh_scrol.cpp delete mode 100644 wxWidgets/src/xrc/xh_scwin.cpp delete mode 100644 wxWidgets/src/xrc/xh_sizer.cpp delete mode 100644 wxWidgets/src/xrc/xh_slidr.cpp delete mode 100644 wxWidgets/src/xrc/xh_spin.cpp delete mode 100644 wxWidgets/src/xrc/xh_split.cpp delete mode 100644 wxWidgets/src/xrc/xh_statbar.cpp delete mode 100644 wxWidgets/src/xrc/xh_stbmp.cpp delete mode 100644 wxWidgets/src/xrc/xh_stbox.cpp delete mode 100644 wxWidgets/src/xrc/xh_stlin.cpp delete mode 100644 wxWidgets/src/xrc/xh_sttxt.cpp delete mode 100644 wxWidgets/src/xrc/xh_text.cpp delete mode 100644 wxWidgets/src/xrc/xh_tglbtn.cpp delete mode 100644 wxWidgets/src/xrc/xh_toolb.cpp delete mode 100644 wxWidgets/src/xrc/xh_tree.cpp delete mode 100644 wxWidgets/src/xrc/xh_treebk.cpp delete mode 100644 wxWidgets/src/xrc/xh_unkwn.cpp delete mode 100644 wxWidgets/src/xrc/xh_wizrd.cpp delete mode 100644 wxWidgets/src/xrc/xmlres.cpp delete mode 100644 wxWidgets/src/xrc/xmlrsall.cpp delete mode 100644 wxWidgets/src/zlib/ChangeLog delete mode 100644 wxWidgets/src/zlib/FAQ delete mode 100644 wxWidgets/src/zlib/INDEX delete mode 100644 wxWidgets/src/zlib/README delete mode 100644 wxWidgets/src/zlib/adler32.c delete mode 100644 wxWidgets/src/zlib/algorithm.txt delete mode 100644 wxWidgets/src/zlib/compress.c delete mode 100644 wxWidgets/src/zlib/crc32.c delete mode 100644 wxWidgets/src/zlib/crc32.h delete mode 100644 wxWidgets/src/zlib/deflate.c delete mode 100644 wxWidgets/src/zlib/deflate.h delete mode 100644 wxWidgets/src/zlib/example.c delete mode 100644 wxWidgets/src/zlib/gzio.c delete mode 100644 wxWidgets/src/zlib/infback.c delete mode 100644 wxWidgets/src/zlib/inffast.c delete mode 100644 wxWidgets/src/zlib/inffast.h delete mode 100644 wxWidgets/src/zlib/inffixed.h delete mode 100644 wxWidgets/src/zlib/inflate.c delete mode 100644 wxWidgets/src/zlib/inflate.h delete mode 100644 wxWidgets/src/zlib/inftrees.c delete mode 100644 wxWidgets/src/zlib/inftrees.h delete mode 100644 wxWidgets/src/zlib/minigzip.c delete mode 100644 wxWidgets/src/zlib/trees.c delete mode 100644 wxWidgets/src/zlib/trees.h delete mode 100644 wxWidgets/src/zlib/uncompr.c delete mode 100644 wxWidgets/src/zlib/zconf.h delete mode 100644 wxWidgets/src/zlib/zlib.3 delete mode 100644 wxWidgets/src/zlib/zlib.h delete mode 100644 wxWidgets/src/zlib/zlibM8.xml delete mode 100644 wxWidgets/src/zlib/zutil.c delete mode 100644 wxWidgets/src/zlib/zutil.h diff --git a/wxWidgets/art/addbookm.xpm b/wxWidgets/art/addbookm.xpm deleted file mode 100644 index 7d5f69900e..0000000000 --- a/wxWidgets/art/addbookm.xpm +++ /dev/null @@ -1,24 +0,0 @@ -/* XPM */ -static const char * addbookm_xpm[] = { -/* columns rows colors chars-per-pixel */ -"16 15 3 1", -". c Black", -"X c #00C000", -" c None", -/* pixels */ -" ....... ", -" .XXXXX. ", -" .. .XXXXX. ", -" .. .XXXXX. ", -" ...... .XXXXX. ", -" ...... .XXXXX. ", -" .. .XXXXX. ", -" .. .XXXXX. ", -" .XXXXX. ", -" .XXXXX. ", -" .XXXXX. ", -" .XXXXX. ", -" .XX.XX. ", -" .X. .X. ", -" .. .. " -}; diff --git a/wxWidgets/art/back.xpm b/wxWidgets/art/back.xpm deleted file mode 100644 index b48af706cc..0000000000 --- a/wxWidgets/art/back.xpm +++ /dev/null @@ -1,21 +0,0 @@ -/* XPM */ -static const char * back_xpm[] = { -"16 15 3 1", -" c None", -". c Black", -"X c Gray100", -" ", -" ", -" . ", -" .. ", -" .X. ", -" .XX........ ", -" .XXXXXXXXXX. ", -" .XXXXXXXXXXX. ", -" .XXXXXXXXXXX. ", -" .XXXXXXXXXX. ", -" .XX........ ", -" .X. ", -" .. ", -" . ", -" "}; diff --git a/wxWidgets/art/cdrom.xpm b/wxWidgets/art/cdrom.xpm deleted file mode 100644 index b72d529e1c..0000000000 --- a/wxWidgets/art/cdrom.xpm +++ /dev/null @@ -1,57 +0,0 @@ -/* XPM */ -static const char * cdrom_xpm[] = { -/* columns rows colors chars-per-pixel */ -"16 15 36 1", -"= c #9BACC2", -"y c #547B99", -"$ c #FFFFFF", -"@ c #839CB5", -"o c #547897", -"4 c #4D7492", -"% c #F1F4F7", -"X c #5A809C", -"< c #8497A5", -"0 c #7898AD", -"+ c #CAD2DC", -"r c #ACAEB2", -"2 c #BECAD9", -"* c #65839D", -"e c #DCE2EA", -"- c #ADBED2", -"t c #597B9A", -" c None", -"1 c #467291", -"9 c #D6DFE7", -"O c #7393AB", -"u c #49708B", -"5 c #A0BACB", -"& c #AABFCD", -"8 c #B9CBD5", -"; c #B4C4D3", -": c #6F90A6", -"3 c #A8B6CA", -"# c #ADBACE", -"w c #E4E9ED", -". c #8EA9BC", -"> c #B3BFD1", -", c #C2CBDB", -"6 c #C0D1DC", -"7 c #A2B3C5", -"q c #5D7C93", -/* pixels */ -" .XooOo+ ", -" X@#$$$%o& ", -" *=-;$$$$$o+ ", -" +O#;-$$$$$$: ", -" o=>,-<1<$2-o ", -" o3>--1$122-* ", -" o=--$<4<22-X ", -" o5$$$$$26;7* ", -" X%$$$$2;-X8 ", -" 90*9$$$-7Xqo ", -" wXwe@O44X422222<<*4", -" ttyyyoo4441uuuo", -" t>$$$$$$$$$$$>o", -" XXXtyyyoo44411u" -}; diff --git a/wxWidgets/art/copy.xpm b/wxWidgets/art/copy.xpm deleted file mode 100644 index aa6094f00f..0000000000 --- a/wxWidgets/art/copy.xpm +++ /dev/null @@ -1,44 +0,0 @@ -/* XPM */ -static const char * copy_xpm[] = { -/* columns rows colors chars-per-pixel */ -"16 15 23 1", -"o c #97C4E7", -"* c #FFFFFF", -"@ c #60A9DA", -"= c #D1E5F5", -"& c #C3DDF1", -". c #7EA6C0", -" c None", -"X c #2F93CD", -"O c #85BBE2", -", c #EFF6FC", -"; c #DEEDF8", -"+ c #72B2DD", -"3 c #F7FBFD", -"4 c #FAFCFE", -": c #DAEAF7", -"< c #E9F3FA", -"1 c #E2EFF8", -"- c #FDFDFE", -"% c #B6D5EE", -"$ c #A5CCEA", -"> c #E5F0F9", -"# c #AFD1EC", -"2 c #F4F9FD", -/* pixels */ -" .....XX ", -" .oO+@X#X ", -" .$oO+X##X ", -" .%$o........ ", -" .&%$.*=&#o.-. ", -" .=&%.*;=&#.--. ", -" .:=&.*>;=&.... ", -" .>:=.*,>;=&#o. ", -" .<1:.*2,>:=&#. ", -" .2<1.*32,>:=&. ", -" .32<.*432,>:=. ", -" .32<.*-432,>:. ", -" .....**-432,>. ", -" .***-432,. ", -" .......... " -}; diff --git a/wxWidgets/art/cross.xpm b/wxWidgets/art/cross.xpm deleted file mode 100644 index 5fe844ab75..0000000000 --- a/wxWidgets/art/cross.xpm +++ /dev/null @@ -1,17 +0,0 @@ -/* XPM */ -static const char * cross_xpm[] = { -/* columns rows colors chars-per-pixel */ -"10 10 2 1", -" c Gray0", -"# c None", -/* pixels */ -" ######## ", -" #### ", -"# ## #", -"## ##", -"### ###", -"### ###", -"## ##", -"# ## #", -" #### ", -" ###### "}; diff --git a/wxWidgets/art/cut.xpm b/wxWidgets/art/cut.xpm deleted file mode 100644 index 83ff3bb955..0000000000 --- a/wxWidgets/art/cut.xpm +++ /dev/null @@ -1,46 +0,0 @@ -/* XPM */ -static const char * cut_xpm[] = { -/* columns rows colors chars-per-pixel */ -"16 15 25 1", -"6 c #D8BDC0", -": c #C3C3C4", -"- c #FFFFFF", -". c #6C6D70", -"2 c #AD3A45", -"o c #DBDBDB", -"# c #939495", -"< c #E42234", -"& c #C3C5C8", -"; c #C6CCD3", -"% c #B7B7B8", -" c None", -"* c #DFE0E2", -"5 c #B69596", -"3 c #9C2A35", -"1 c #CFCFD0", -", c #AB5C64", -"+ c #D2D3D4", -"$ c #BCBDBE", -"@ c #C6C8CA", -"> c #CDC0C1", -"O c #826F72", -"X c #979BA0", -"4 c #9B8687", -"= c #9FA0A0", -/* pixels */ -" .X .o ", -" O.+ @. ", -" O. .. ", -" O#$ %.& ", -" O.*.. ", -" #%#.. ", -" O=-.. ", -" #%#;. ", -" OO:=O ", -" >,,<, ,<,,1 ", -" ><23<1 1<32<1 ", -" ,2 4< <5 2, ", -" <, ,2 2, ,< ", -" 23,<5 5<,32 ", -" 6225 522> " -}; diff --git a/wxWidgets/art/deffile.xpm b/wxWidgets/art/deffile.xpm deleted file mode 100644 index f08974b32c..0000000000 --- a/wxWidgets/art/deffile.xpm +++ /dev/null @@ -1,54 +0,0 @@ -/* XPM */ -static const char * deffile_xpm[] = { -/* columns rows colors chars-per-pixel */ -"16 16 32 1", -"= c #97C4E7", -": c #72A8D2", -"1 c #FFFFFF", -"w c #839CB5", -"X c #6B98B8", -". c #5A89A6", -"@ c #3A749C", -", c #D1E5F5", -"< c #67A1CF", -"> c #F1F4F7", -"e c #85A7BC", -"% c #C3DDF1", -"0 c #749BB4", -"2 c #7EA6C0", -"; c #5F9BC8", -" c None", -"O c #538DB3", -"- c #85BBE2", -"$ c #D6DFE7", -"9 c #EFF6FC", -"o c #6591AE", -"4 c #F7FBFD", -"8 c #FAFCFE", -"6 c #DAEAF7", -"7 c #E9F3FA", -"q c #FDFDFE", -"3 c #E2EFF8", -"# c #8EA9BC", -"& c #B6D5EE", -"* c #A5CCEA", -"5 c #F4F9FD", -"+ c #4581AA", -/* pixels */ -" ..XooO+@#$ ", -" .%%&*=-;:;> ", -" .,,%&*=<1=X> ", -" #%%%%&*211=X ", -" #3----- c #5A7BB4", -"% c #5F7FB5", -/* pixels */ -" ", -" .Xo OO ", -" +@#. $@% ", -" &@@X .*@*o ", -" =@= .*@*. ", -" -@@X*@*. ", -" .#@@@$. ", -" ;@@: ", -" ;@@@+ ", -" .>@#%@@. ", -" o*@*oO@@, ", -" <#@*. .@@= ", -"&@@$ :@@1 ", -";#& 2#>. ", -" " -}; diff --git a/wxWidgets/art/dir_up.xpm b/wxWidgets/art/dir_up.xpm deleted file mode 100644 index 0c2f71d092..0000000000 --- a/wxWidgets/art/dir_up.xpm +++ /dev/null @@ -1,52 +0,0 @@ -/* XPM */ -static const char * dir_up_xpm[] = { -/* columns rows colors chars-per-pixel */ -"16 15 31 1", -"6 c #9BACC2", -"o c #9AEA53", -"7 c #94A5BD", -"8 c #547897", -"5 c #839CB5", -"@ c #376485", -"$ c #5A809C", -"# c #7F99B4", -": c #D1D9E5", -"< c #EAEDF3", -"& c #446A8C", -"q c #65839D", -"> c #DCE2EA", -", c #E1E6EE", -"2 c #F5F6F7", -"O c #8DA0B9", -" c None", -"% c #467291", -". c #305F81", -"X c #7393AB", -"+ c #6A89A2", -"4 c #A8B6CA", -"1 c #EEF1F3", -"3 c #F8F9FA", -"0 c #215579", -"9 c #7F97B0", -"* c #B3BFD1", -"w c #7A90AC", -"- c #C2CBDB", -"; c #CAD6E1", -"= c #BBC4D6", -/* pixels */ -" .. ", -" X.o. ", -".... X.ooo. ", -".OO+....ooooo. ", -".OOOOOO@@ooo.. ", -".OOOO#OO@ooo.$ ", -".OOOOOOO@ooo.$ ", -".O%............&", -".O&*=-;:>,<1231.", -".+.4*=-;:>,<12$.", -"..564*=-;:>,<1. ", -".@O764*=-;:>,<. ", -".89O764*=-;:>$$ ", -"0qw9O764*=-;:. ", -"0............. " -}; diff --git a/wxWidgets/art/down.xpm b/wxWidgets/art/down.xpm deleted file mode 100644 index 1f9cf29373..0000000000 --- a/wxWidgets/art/down.xpm +++ /dev/null @@ -1,21 +0,0 @@ -/* XPM */ -static const char * down_xpm[] = { -"16 15 3 1", -" c None", -". c Black", -"X c Gray100", -" ", -" ...... ", -" .XXXX. ", -" .XXXX. ", -" .XXXX. ", -" .XXXX. ", -" .XXXX. ", -" .XXXX. ", -" ....XXXX.... ", -" .XXXXXXXX. ", -" .XXXXXX. ", -" .XXXX. ", -" .XX. ", -" .. ", -" "}; diff --git a/wxWidgets/art/exefile.xpm b/wxWidgets/art/exefile.xpm deleted file mode 100644 index 7ecdec3e7b..0000000000 --- a/wxWidgets/art/exefile.xpm +++ /dev/null @@ -1,73 +0,0 @@ -/* XPM */ -static const char * exefile_xpm[] = { -/* columns rows colors chars-per-pixel */ -"16 16 51 1", -"% c #E8E8EC", -"= c #E8E8ED", -"z c #CACAD4", -"8 c #D9D9E1", -"p c #D2D2DA", -"u c #E1E1E7", -"a c #D2D2DB", -"< c #E9E9ED", -"q c #DADAE1", -"+ c #F1F1F4", -"g c #D3D3DB", -"1 c #E2E2E8", -"x c #D3D3DC", -"5 c #00A5FF", -"$ c #EAEAEE", -"4 c #DBDBE2", -"h c #CCCCD6", -"y c #D4D4DC", -"r c #E3E3E9", -"d c #D4D4DD", -"7 c #DCDCE2", -": c #EBEBEF", -"0 c #DCDCE3", -" c None", -"O c #F3F3F5", -"> c #E4E4E9", -"& c #F3F3F6", -"j c #D5D5DD", -"6 c #E4E4EA", -". c #C6C6D5", -"# c #ECECF0", -"f c #CECED7", -"l c #CECED8", -"e c #D6D6DE", -"; c #EDEDF0", -"3 c #DEDEE4", -", c #EDEDF1", -"c c #CFCFD8", -"o c #F5F5F7", -"- c #E6E6EB", -"w c #D7D7DF", -"v c #C8C8D3", -"i c #DFDFE5", -"@ c #EEEEF2", -"s c #D0D0D9", -"X c #9494AD", -"9 c #D8D8DF", -"t c #D8D8E0", -"* c #EFEFF2", -"2 c #E0E0E6", -"k c #D1D1DA", -/* pixels */ -" ........X ", -" .oO+@#$%XX ", -" .&+*#$=-XXX ", -" .+*;:=->XXXX ", -" .*,:<->1234X ", -" .,5:5612378X ", -" 5,5559530qwX ", -" 55555550q9eX ", -" 5555r5555teyX ", -" 55rui559eypX ", -" 5555i5555yasX ", -" 5555555dasfX ", -" 5355595gsfhX ", -" .3595jgklhzX ", -" .0qwjxkchzvX ", -" XXXXXXXXXXXX " -}; diff --git a/wxWidgets/art/fileopen.xpm b/wxWidgets/art/fileopen.xpm deleted file mode 100644 index 9cf25ccc5b..0000000000 --- a/wxWidgets/art/fileopen.xpm +++ /dev/null @@ -1,57 +0,0 @@ -/* XPM */ -static const char * fileopen_xpm[] = { -/* columns rows colors chars-per-pixel */ -"16 15 36 1", -"6 c #9BACC2", -"< c #9AEA53", -"9 c #94A5BD", -"5 c #839CB5", -"; c #4D7492", -". c #376485", -"$ c #7F99B4", -"r c #D1D9E5", -"7 c #EAEDF3", -"@ c #CAD2DC", -"% c #718BA7", -"t c #BECAD9", -"& c #65839D", -"0 c #DCE2EA", -"4 c #F5F6F7", -"w c #597B9A", -"O c #8DA0B9", -" c None", -"+ c #467291", -"u c #305F81", -"= c #B4C4D3", -"# c #CAE2AA", -"1 c #FAFCFE", -"3 c #A8B6CA", -"q c #E4E9ED", -"8 c #EEF1F3", -"X c #215579", -"2 c #7F97B0", -": c #B3BFD1", -"y c #7A90AC", -", c #C2CBDB", -"- c #ADD668", -"* c #B6D791", -"e c #CAD6E1", -"o c #DFF0D0", -"> c #BBC4D6", -/* pixels */ -" ", -" .... ", -"XXXXX .oo. ", -"XOOOO+@.#o. ", -"XOOOO$%&.*oXXX ", -"XOOOOOOO.*oX=X ", -"XOXXXX...-oXXXX;", -"XOX:>,.<<<<,.<<>.>.X0q7; ", -"Xw2O963:>>er0t; ", -"X&y2O963:>,er; ", -"uXXXXXXXXXXXX; ", -" " -}; diff --git a/wxWidgets/art/filesave.xpm b/wxWidgets/art/filesave.xpm deleted file mode 100644 index 04b7539e28..0000000000 --- a/wxWidgets/art/filesave.xpm +++ /dev/null @@ -1,42 +0,0 @@ -/* XPM */ -static const char * filesave_xpm[] = { -/* columns rows colors chars-per-pixel */ -"16 15 21 1", -"O c #FFFFFF", -"> c #D5D6D8", -"; c #446A8C", -"1 c #CAD2DC", -": c #C0C7D1", -" c #5F666D", -"% c #A5B0BA", -"o c #65839D", -", c #DCE2EA", -"< c #C3C5C8", -"- c #E1E6EE", -"* c #C6CCD3", -". c None", -"$ c #305F81", -"2 c #D6DFE7", -"= c #D2D9E0", -"& c #B7BFC7", -"X c #1B4467", -"# c #BCBDBE", -"@ c #7A90AC", -"+ c #5D7C93", -/* pixels */ -" .", -" XoOOOOOOOOO+X .", -" @oO#######O+@ .", -" @oOOOOOOOOO+@ .", -" @oO#######O+@ .", -" @oOOOOOOOOO+@ .", -" @@+++++++++@@ .", -" @@@@@@@@@@@@@ .", -" @@@$$$$$$$$@@ .", -" @@$%%%&*=-O$@ .", -" @@$%X;;*=-O$@ .", -" @@$%X;;:>,O$@ .", -" @@$%X;;<12O$@ .", -" @@$<<2OOOOO$@ .", -". .." -}; diff --git a/wxWidgets/art/filesaveas.xpm b/wxWidgets/art/filesaveas.xpm deleted file mode 100644 index 3c45bc808d..0000000000 --- a/wxWidgets/art/filesaveas.xpm +++ /dev/null @@ -1,44 +0,0 @@ -/* XPM */ -static const char * filesaveas_xpm[] = { -/* columns rows colors chars-per-pixel */ -"16 15 23 1", -"X c Black", -"+ c #FFFFFF", -"< c #D5D6D8", -"> c #446A8C", -"3 c #CAD2DC", -", c #C0C7D1", -" c #5F666D", -"* c #A5B0BA", -"O c #65839D", -"1 c #DCE2EA", -"2 c #C3C5C8", -": c #E1E6EE", -". c #FFFF00", -"- c #C6CCD3", -"@ c None", -"& c #305F81", -"4 c #D6DFE7", -"; c #D2D9E0", -"= c #B7BFC7", -"o c #1B4467", -"$ c #BCBDBE", -"# c #7A90AC", -"% c #5D7C93", -/* pixels */ -" .X .XX.", -" oO+++++++.X.X.@", -" #O+$$$$$XX...XX", -" #O++++++.......", -" #O+$$$$$XX...XX", -" #O+++++++.X.X.@", -" ##%%%%%%.X%.X .", -" ############# @", -" ###&&&&&&&&## @", -" ##&***=-;:+&# @", -" ##&*o>>-;:+&# @", -" ##&*o>>,<1+&# @", -" ##&*o>>234+&# @", -" ##&224+++++&# @", -"@ @@" -}; diff --git a/wxWidgets/art/find.xpm b/wxWidgets/art/find.xpm deleted file mode 100644 index 51544e98b8..0000000000 --- a/wxWidgets/art/find.xpm +++ /dev/null @@ -1,62 +0,0 @@ -/* XPM */ -static const char * find_xpm[] = { -/* columns rows colors chars-per-pixel */ -"16 15 41 1", -"y c #A06959", -"9 c #A7DAF2", -"$ c #B5CAD7", -"> c #35B4E1", -"t c #6B98B8", -"w c #B6E0F4", -"q c #AEC9D7", -"1 c #5A89A6", -"+ c #98B3C6", -"4 c #EAF6FC", -"3 c #DEF1FA", -"= c #4CBCE3", -"d c #DB916B", -"X c #85A7BC", -"s c #D8BCA4", -"o c #749BB4", -"e c #BCD9EF", -"* c #62B4DD", -"< c #91D2EF", -"a c #E6DED2", -"0 c #E9F4FB", -" c None", -"@ c #A0BACB", -"O c #AABFCD", -"i c #6591AE", -": c #B9CBD5", -"- c #71C5E7", -"5 c #D3ECF8", -"% c #81A3B9", -"6 c #8AD0EE", -"8 c #FDFDFE", -"p c #8EA9BC", -"r c #B6D5EE", -", c #81CCEB", -". c #ACC4D3", -"; c #AFD1DE", -"7 c #EFF8FC", -"u c #C2CBDB", -"# c #C0D1DC", -"2 c #CAD6E1", -"& c #8FB0C3", -/* pixels */ -" .XooXO ", -" +@###$+% ", -" .&#*==-;@@ ", -" o:*>,<--:X ", -" 12>-345-#% ", -" 12>678392% ", -" %$*,3059q& ", -" @Oq,wwer@@ ", -" t@q22q&+ ", -" yyui+%o%p ", -" yasy ", -" yasdy ", -" yasdy ", -" ysdy ", -" yy " -}; diff --git a/wxWidgets/art/findrepl.xpm b/wxWidgets/art/findrepl.xpm deleted file mode 100644 index 33b083b5fd..0000000000 --- a/wxWidgets/art/findrepl.xpm +++ /dev/null @@ -1,63 +0,0 @@ -/* XPM */ -static const char * findrepl_xpm[] = { -/* columns rows colors chars-per-pixel */ -"16 15 42 1", -"y c #A06959", -"9 c #A7DAF2", -"$ c #B5CAD7", -"> c #35B4E1", -"t c #6B98B8", -"w c #B6E0F4", -"q c #AEC9D7", -"1 c #5A89A6", -"+ c #98B3C6", -"4 c #EAF6FC", -"d c #008000", -"3 c #DEF1FA", -"= c #4CBCE3", -"f c #DB916B", -"X c #85A7BC", -"s c #D8BCA4", -"o c #749BB4", -"e c #BCD9EF", -"* c #62B4DD", -"< c #91D2EF", -"a c #E6DED2", -"0 c #E9F4FB", -" c None", -"@ c #A0BACB", -"O c #AABFCD", -"i c #6591AE", -": c #B9CBD5", -"- c #71C5E7", -"5 c #D3ECF8", -"% c #81A3B9", -"6 c #8AD0EE", -"8 c #FDFDFE", -"p c #8EA9BC", -"r c #B6D5EE", -", c #81CCEB", -". c #ACC4D3", -"; c #AFD1DE", -"7 c #EFF8FC", -"u c #C2CBDB", -"# c #C0D1DC", -"2 c #CAD6E1", -"& c #8FB0C3", -/* pixels */ -" .XooXO ", -" +@###$+% ", -" .&#*==-;@@ ", -" o:*>,<--:X ", -" 12>-345-#% ", -" 12>678392% ", -" %$*,3059q& ", -" @Oq,wwer@@ ", -" t@q22q&+ ", -" yyui+%o%p ", -" yasy d d ", -" yasfy dd dd ", -"yasfy ddddddddd", -"ysfy dd dd ", -" yy d d " -}; diff --git a/wxWidgets/art/floppy.xpm b/wxWidgets/art/floppy.xpm deleted file mode 100644 index 4d6b7d8fe3..0000000000 --- a/wxWidgets/art/floppy.xpm +++ /dev/null @@ -1,39 +0,0 @@ -/* XPM */ -static const char * floppy_xpm[] = { -/* columns rows colors chars-per-pixel */ -"16 15 18 1", -"& c #E3E4E6", -"+ c #FFFFFF", -". c #446A8C", -"o c #697787", -"> c #5F666D", -"* c #B2B3B3", -" c None", -", c #4B4C4D", -"= c #DCDBDA", -"$ c #1B4467", -": c #E4E9ED", -"@ c #979BA0", -"X c #203646", -"O c #215579", -"- c #545B63", -"; c #636465", -"# c #CAD6E1", -"% c #7F8286", -/* pixels */ -" .XoooooooXO ", -" .o+++++++.O ", -" .o+OOOOO+.O ", -" .o+++++++.O ", -" .o@@@@@@@.O ", -" ..........O ", -" ..#+++++#.O ", -" ..+$O+++#.O ", -" ..+$O+++#.O ", -" %&.........*% ", -"%=+++++++++++&% ", -"--------------; ", -"-:::::::::::::- ", -"-:X:XXXXXXXXX:> ", -"-*************, " -}; diff --git a/wxWidgets/art/folder.xpm b/wxWidgets/art/folder.xpm deleted file mode 100644 index 60a4207884..0000000000 --- a/wxWidgets/art/folder.xpm +++ /dev/null @@ -1,43 +0,0 @@ -/* XPM */ -static const char * folder_xpm[] = { -/* columns rows colors chars-per-pixel */ -"16 15 22 1", -"> c #9BACC2", -". c #547897", -"1 c #7F99B4", -"X c #D1D9E5", -"< c #EAEDF3", -"+ c #CAD2DC", -"3 c #718BA7", -"O c #BECAD9", -"$ c #E1E6EE", -"* c #F5F6F7", -", c #8DA0B9", -" c None", -"# c #D6DFE7", -"@ c #D2D9E0", -"- c #FAFCFE", -"; c #ADBACE", -"& c #EEF1F3", -"= c #F8F9FA", -"o c #B3BFD1", -"2 c #7A90AC", -": c #A2B3C5", -"% c #E5EAF1", -/* pixels */ -" ", -" ..... ", -" .XXXX. ", -" ............. ", -" .oO+@#$%&*=-. ", -" .oO+@#$%&*=-. ", -" .;oO+X#$%&*=. ", -" .:;oO+X#$%&*. ", -" .>:;oO+X#$%&. ", -" .,>:;oO+X#$<. ", -" .1,>:;oO+X#$. ", -" .21,>:;oO+X#. ", -" .321,>:;oO+X. ", -" ............. ", -" " -}; diff --git a/wxWidgets/art/folder_open.xpm b/wxWidgets/art/folder_open.xpm deleted file mode 100644 index 60b1e65add..0000000000 --- a/wxWidgets/art/folder_open.xpm +++ /dev/null @@ -1,52 +0,0 @@ -/* XPM */ -static const char * folder_open_xpm[] = { -/* columns rows colors chars-per-pixel */ -"16 15 31 1", -"6 c #9BACC2", -"w c #547B99", -"5 c #94A5BD", -". c #376485", -"; c #F1F4F7", -"o c #7F99B4", -"2 c #D1D9E5", -"- c #EAEDF3", -"O c #718BA7", -"0 c #65839D", -"* c #DCE2EA", -": c #F5F6F7", -"7 c #597B9A", -"X c #8DA0B9", -" c None", -"+ c #467291", -"q c #305F81", -"& c #D6DFE7", -"3 c #6A89A2", -"1 c #A8B6CA", -"= c #E4E9ED", -"> c #F8F9FA", -", c #FDFDFE", -"9 c #215579", -"8 c #7F97B0", -"@ c #B3BFD1", -"< c #7A90AC", -"$ c #C2CBDB", -"4 c #A2B3C5", -"% c #CAD6E1", -"# c #BBC4D6", -/* pixels */ -" ", -"..... ", -".XXXo. ", -".XXXXO........ ", -".XXXXXXXXXXXX. ", -".XXXXXXXXXXXX. ", -".X++++++++++++++", -".X+@#$%&*=-;:>,+", -".<.1@#$%2*=-;:23", -"..X41@#$%2*=-;3 ", -"..X561@#$%2*=-3 ", -".78X561@#$%2*%3 ", -"90<8X561@#$%23 ", -"q++++++++++++w ", -" " -}; diff --git a/wxWidgets/art/forward.xpm b/wxWidgets/art/forward.xpm deleted file mode 100644 index 56df17bccf..0000000000 --- a/wxWidgets/art/forward.xpm +++ /dev/null @@ -1,21 +0,0 @@ -/* XPM */ -static const char * forward_xpm[] = { -"16 15 3 1", -" c None", -". c Black", -"X c Gray100", -" ", -" ", -" . ", -" .. ", -" .X. ", -" ........XX. ", -" .XXXXXXXXXX. ", -" .XXXXXXXXXXX. ", -" .XXXXXXXXXXX. ", -" .XXXXXXXXXX. ", -" ........XX. ", -" .X. ", -" .. ", -" . ", -" "}; diff --git a/wxWidgets/art/harddisk.xpm b/wxWidgets/art/harddisk.xpm deleted file mode 100644 index bdff0763a1..0000000000 --- a/wxWidgets/art/harddisk.xpm +++ /dev/null @@ -1,60 +0,0 @@ -/* XPM */ -static const char * harddisk_xpm[] = { -/* columns rows colors chars-per-pixel */ -"16 15 39 1", -"7 c #E3E4E6", -"4 c #FFFFFF", -"5 c #839CB5", -". c #547897", -"1 c #4D7492", -"@ c #376485", -"o c #7A92A3", -"u c #D1D9E5", -"y c #446A8C", -"i c #51B03D", -"> c #CAD2DC", -"O c #718BA7", -"2 c #65839D", -"6 c #DCE2EA", -"0 c #C3C5C8", -"9 c #F5F6F7", -": c #EBEBEC", -"< c #597B9A", -"t c #C6CCD3", -" c None", -"* c #DFE0E2", -"e c #467291", -"a c #526E8B", -", c #7393AB", -"p c #130A0B", -"# c #AABFCD", -"r c #B4C4D3", -"; c #CFCFD0", -"X c #6F90A6", -"+ c #6A89A2", -"- c #D2D3D4", -"= c #DCDBDA", -"w c #E4E9ED", -"q c #C6C8CA", -"% c #215579", -"$ c #E7E7E7", -"3 c #7F97B0", -"8 c #C0D1DC", -"& c #5D7C93", -/* pixels */ -" ", -" .XoooXO+@ ", -" #$$%%%%$$$X ", -" &$*==-;$$$& ", -" &:>+,<1234o5 ", -" ###+67;;78242 ", -" &4,49*0q*9we4. ", -" &4+49*,,*9wo4. ", -"&4%r,67;;782t%4.", -"&44468rrrr84444,", -"y11111111111111e", -"1uu1:::::::::::1", -"1uu1::::::::ip:1", -"auu&:::::::::::1", -"1111111111111111" -}; diff --git a/wxWidgets/art/helpicon.xpm b/wxWidgets/art/helpicon.xpm deleted file mode 100644 index 6abce2c0dd..0000000000 --- a/wxWidgets/art/helpicon.xpm +++ /dev/null @@ -1,44 +0,0 @@ -/* XPM */ -static const char * helpicon_xpm[] = { -/* columns rows colors chars-per-pixel */ -"32 32 6 1", -" c Gray0", -". c Blue", -"X c #808080808080", -"o c #c0c0c0c0c0c0", -"O c Gray100", -"+ c None", -/* pixels */ -"+++++++++++XXXXXXXX+++++++++++++", -"++++++++XXXoOOOOOOoXXX++++++++++", -"++++++XXoOOOOOOOOOOOOoXX++++++++", -"+++++XoOOOOOOOOOOOOOOOOoX+++++++", -"++++XOOOOOOOOOOOOOOOOOOOO ++++++", -"+++XOOOOOOOo......oOOOOOOO +++++", -"++XOOOOOOOo.oOO....oOOOOOOO ++++", -"+XoOOOOOOO..OOOO....OOOOOOOo +++", -"+XOOOOOOOO....OO....OOOOOOOO X++", -"XoOOOOOOOO....Oo....OOOOOOOOo X+", -"XOOOOOOOOOo..oO....OOOOOOOOOO X+", -"XOOOOOOOOOOOOOo...OOOOOOOOOOO XX", -"XOOOOOOOOOOOOO...OOOOOOOOOOOO XX", -"XOOOOOOOOOOOOO..oOOOOOOOOOOOO XX", -"XOOOOOOOOOOOOO..OOOOOOOOOOOOO XX", -"XoOOOOOOOOOOOOOOOOOOOOOOOOOOo XX", -"+XOOOOOOOOOOOo..oOOOOOOOOOOO XXX", -"+XoOOOOOOOOOO....OOOOOOOOOOo XXX", -"++XOOOOOOOOOO....OOOOOOOOOO XXX+", -"+++ OOOOOOOOOo..oOOOOOOOOO XXXX+", -"++++ OOOOOOOOOOOOOOOOOOOO XXXX++", -"+++++ oOOOOOOOOOOOOOOOOo XXXX+++", -"++++++ oOOOOOOOOOOOOo XXXX++++", -"+++++++X oOOOOOOo XXXXX+++++", -"++++++++XXX oOOO XXXXXXX++++++", -"++++++++++XXXX OOO XXXXX++++++++", -"+++++++++++++X OOO XX+++++++++++", -"+++++++++++++++ OO XX+++++++++++", -"++++++++++++++++ O XX+++++++++++", -"+++++++++++++++++ XX+++++++++++", -"++++++++++++++++++XXX+++++++++++", -"+++++++++++++++++++XX+++++++++++" -}; diff --git a/wxWidgets/art/home.xpm b/wxWidgets/art/home.xpm deleted file mode 100644 index 078e7d6c65..0000000000 --- a/wxWidgets/art/home.xpm +++ /dev/null @@ -1,24 +0,0 @@ -/* XPM */ -static const char * home_xpm[] = { -/* columns rows colors chars-per-pixel */ -"16 15 3 1", -". c Black", -"X c #FFFFFF", -" c None", -/* pixels */ -" .... ", -" .XXXX. ", -" .XXXXXX. ", -" .XXXXXXXX. ", -" .XXXXXXXXXX. ", -" .............. ", -" .XXXXXXXXXXXX. ", -" .XXXXXXXXXXXX. ", -" .XXXXXXXXXXXX. ", -" .X.....X....X. ", -" .X. .X. .X. ", -" .X. .X. .X. ", -" .X.....X. .X. ", -" .XXXXXXX. .X. ", -" ......... ... " -}; diff --git a/wxWidgets/art/htmbook.xpm b/wxWidgets/art/htmbook.xpm deleted file mode 100644 index eb343cbe3b..0000000000 --- a/wxWidgets/art/htmbook.xpm +++ /dev/null @@ -1,25 +0,0 @@ -/* XPM */ -static const char * htmbook_xpm[] = { -"16 16 6 1", -" c None", -". c Black", -"X c #000080", -"o c #c0c0c0", -"O c #808080", -"+ c Gray100", -" ", -" .. ", -" ..XX. ", -" ..XXXXX. ", -" ..XXXXXXXX. ", -".oXXXXXXXXXX. ", -".XoXXXXXXXXXX. ", -".XXoXXXXXXXXXX. ", -".XXXoXXXXXXXXX..", -".XXXXoXXXXXX..O ", -" .XXXXoXXX..O+O ", -" .XXXXo..O++o..", -" .XXX.O+++o.. ", -" .XX.o+o.. ", -" .X.o.. ", -" ... "}; diff --git a/wxWidgets/art/htmfoldr.xpm b/wxWidgets/art/htmfoldr.xpm deleted file mode 100644 index fc14e60cc7..0000000000 --- a/wxWidgets/art/htmfoldr.xpm +++ /dev/null @@ -1,25 +0,0 @@ -/* XPM */ -static const char * htmfoldr_xpm[] = { -"16 16 6 1", -" c None", -". c Black", -"X c #000080", -"o c #c0c0c0", -"O c #808080", -"+ c Gray100", -" ", -" .. ", -" ..XX. ", -" ..XXXXX. ", -" ..XXXXXXXX. ", -".oXXXXXXXXXX. ", -".XoXXXXXXXXXX. ", -".XXoXXXXXXXXXX. ", -".XXXoXXXXXXXXX..", -".XXXXoXXXXXX..O ", -" .XXXXoXXX..O+O ", -" .XXXXo..O++o..", -" .XXX.O+++o.. ", -" .XX.o+o.. ", -" .X.o.. ", -" ... "}; diff --git a/wxWidgets/art/htmoptns.xpm b/wxWidgets/art/htmoptns.xpm deleted file mode 100644 index 8649f79398..0000000000 --- a/wxWidgets/art/htmoptns.xpm +++ /dev/null @@ -1,20 +0,0 @@ -/* XPM */ -static const char * htmoptns_xpm[] = { -"16 15 2 1", -" c None", -". c #000000", -" ", -" .. ", -" ... ", -" .... ", -" . ... ", -" .. ... ", -" . .. ", -" .. ... ", -" . .. ", -" ......... ", -" .. ... ", -" . ... ", -" .. ... ", -" .... ....... ", -" "}; diff --git a/wxWidgets/art/htmpage.xpm b/wxWidgets/art/htmpage.xpm deleted file mode 100644 index bf934b981b..0000000000 --- a/wxWidgets/art/htmpage.xpm +++ /dev/null @@ -1,23 +0,0 @@ -/* XPM */ -static const char * htmpage_xpm[] = { -"16 16 4 1", -" c None", -". c #808080", -"X c Gray100", -"o c Black", -" ", -" .......... ", -" .XXXXXXXX.. ", -" .XXXXXXXXooo ", -" .X......XXXo ", -" .XXXXXXXXXXo ", -" .X........Xo ", -" .XXXXXXXXXXo ", -" .X........Xo ", -" .XXXXXXXXXXo ", -" .X........Xo ", -" .XXXXXXXXXXo ", -" .X........Xo ", -" .XXXXXXXXXXo ", -" .XXXXXXXXXXo ", -" oooooooooooo "}; diff --git a/wxWidgets/art/htmsidep.xpm b/wxWidgets/art/htmsidep.xpm deleted file mode 100644 index 514d7de0bb..0000000000 --- a/wxWidgets/art/htmsidep.xpm +++ /dev/null @@ -1,27 +0,0 @@ -/* XPM */ -static const char * htmsidep_xpm[] = { -/* columns rows colors chars-per-pixel */ -"16 15 6 1", -". c Black", -"X c #FFFFFF", -"+ c #808080", -" c None", -"O c #0000C0", -"o c #C0C0C0", -/* pixels */ -" ", -" .............. ", -" .XXXX.ooooooo. ", -" .XOXX.oo...oo. ", -" .XXOX.ooooooo. ", -" .OOOO.o...+.o. ", -" .XXOX.ooooooo. ", -" .XOXX.ooooooo. ", -" .XXXX.o..+ooo. ", -" .XXOX.ooooooo. ", -" .XOXX.o...+.o. ", -" .OOOO.ooooooo. ", -" .XOXX.o.+...o. ", -" .XXOX.ooooooo. ", -" .............. " -}; diff --git a/wxWidgets/art/listview.xpm b/wxWidgets/art/listview.xpm deleted file mode 100644 index e17781e2f0..0000000000 --- a/wxWidgets/art/listview.xpm +++ /dev/null @@ -1,25 +0,0 @@ -/* XPM */ -static const char * listview_xpm[] = { -/* columns rows colors chars-per-pixel */ -"16 15 4 1", -" c Black", -". c #FFFFFF", -"X c #000084", -"o c #848484", -/* pixels */ -" ", -" .............. ", -" .XXX.......... ", -" .XXX. o o . ", -" .XXX.......... ", -" .............. ", -" .XXX.......... ", -" .XXX. o . ", -" .XXX.......... ", -" .............. ", -" .XXX.......... ", -" .XXX. o o . ", -" .XXX.......... ", -" .............. ", -" " -}; diff --git a/wxWidgets/art/missimg.xpm b/wxWidgets/art/missimg.xpm deleted file mode 100644 index ca96c3a2ef..0000000000 --- a/wxWidgets/art/missimg.xpm +++ /dev/null @@ -1,43 +0,0 @@ -/* XPM */ -static const char * missimg_xpm[] = { -/* columns rows colors chars-per-pixel */ -"32 32 5 1", -"X c Black", -"o c #FFFFFF", -" c None", -". c #C0C0C0", -"O c #E0E0E0", -/* pixels */ -" .............................X ", -" .ooooooooooooooooooooooooooooX ", -" .ooooooooooooooooooooooooooooX ", -" .ooOOOOOOOOOOOOOOOOOOOOOOOOooX ", -" .ooOOOOOOOOOOOOOOOOOOOOOOOOooX ", -" .ooOOOOOOOOOOOOOOOOOOOOOOOOooX ", -" .ooOOOOOOOOOOOOOOOOOOOOOOOOooX ", -" .ooOOOOOOOOOOOOOOOOOOOOOOOOooX ", -" .ooOOOOOOOOOOOOOOOOOOOOOOOOooX ", -" .ooOOOOOOOXOOOOOOOOOOOOOOOOooX ", -" XXXOOOOOXX XOOOOOOOOOOOOOOOooX ", -" XXXXX XOOOOOOOOOOOOOOooX ", -" XOOOXXXOOOOOOOooX ", -" XXX XXOOOOOooX ", -" XOOOOooX ", -" . XOOOooX ", -" .. XXOooX ", -" .o.. XooX ", -" .ooO... XXX ", -" .ooOOOO.......... ", -" .ooOOOOOOOOOOOOOO.. ", -" .ooOOOOOOOOOOOOOOOO.. ", -" .ooOOOOOOOOOOOOOOOOOO......... ", -" .ooOOOOOOOOOOOOOOOOOOOOOOOOooX ", -" .ooOOOOOOOOOOOOOOOOOOOOOOOOooX ", -" .ooOOOOOOOOOOOOOOOOOOOOOOOOooX ", -" .ooOOOOOOOOOOOOOOOOOOOOOOOOooX ", -" .ooOOOOOOOOOOOOOOOOOOOOOOOOooX ", -" .ooOOOOOOOOOOOOOOOOOOOOOOOOooX ", -" .ooooooooooooooooooooooooooooX ", -" .ooooooooooooooooooooooooooooX ", -" XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX " -}; diff --git a/wxWidgets/art/new.xpm b/wxWidgets/art/new.xpm deleted file mode 100644 index 7b6143098e..0000000000 --- a/wxWidgets/art/new.xpm +++ /dev/null @@ -1,50 +0,0 @@ -/* XPM */ -static const char * new_xpm[] = { -/* columns rows colors chars-per-pixel */ -"16 15 29 1", -"* c #97C4E7", -"- c #72A8D2", -": c #FFFFFF", -"9 c #839CB5", -"o c #6B98B8", -"X c #5A89A6", -"# c #3A749C", -", c #D1E5F5", -"0 c #85A7BC", -"$ c #C3DDF1", -"8 c #749BB4", -"; c #5F9BC8", -" c None", -"+ c #538DB3", -"= c #85BBE2", -"3 c #EFF6FC", -"O c #6591AE", -"5 c #F7FBFD", -"7 c #FAFCFE", -"< c #DAEAF7", -"4 c #E9F3FA", -"6 c #FDFDFE", -"1 c #E2EFF8", -". c #8EA9BC", -"% c #B6D5EE", -"& c #A5CCEA", -"> c #ACE95B", -"2 c #F4F9FD", -"@ c #4581AA", -/* pixels */ -" .XoOO+@#. ", -" .$$%&*=O-; ", -" @@@@$%&*O:*o ", -" @>>@$$%&O::*o ", -"@@@>>@@@$%OOoO+ ", -"@>>>>>>@,$%&*=+ ", -"@>>>>>>@<,$%&*+ ", -"@@@>>@@@1<,$%&O ", -" @>>@2341<,$%O ", -" @@@@52341<,$o ", -" .:6752341<,8 ", -" .::6752341<8 ", -" .:::67523419 ", -" .::::6752340 ", -" ............ " -}; diff --git a/wxWidgets/art/new_dir.xpm b/wxWidgets/art/new_dir.xpm deleted file mode 100644 index 9eebabfa05..0000000000 --- a/wxWidgets/art/new_dir.xpm +++ /dev/null @@ -1,43 +0,0 @@ -/* XPM */ -static const char * new_dir_xpm[] = { -/* columns rows colors chars-per-pixel */ -"16 15 22 1", -"X c Black", -"> c #9BACC2", -"o c #547897", -"1 c #7F99B4", -"O c #D1D9E5", -"< c #EAEDF3", -"# c #CAD2DC", -"3 c #718BA7", -"@ c #BECAD9", -"& c #E1E6EE", -"; c #F5F6F7", -". c #FFFF00", -", c #8DA0B9", -" c None", -"% c #D6DFE7", -"$ c #D2D9E0", -"- c #ADBACE", -"= c #EEF1F3", -"+ c #B3BFD1", -"2 c #7A90AC", -": c #A2B3C5", -"* c #E5EAF1", -/* pixels */ -" .X .XX.", -" ooooo .X.X. ", -" oOOOOo XX...XX", -" oooooooo.......", -" o+@#$%&*XX...XX", -" o+@#$%&*=.X.X. ", -" o-+@#O%&.X;.X .", -" o:-+@#O%&*=;o ", -" o>:-+@#O%&*=o ", -" o,>:-+@#O%&:-+@#O%&o ", -" o21,>:-+@#O%o ", -" o321,>:-+@#Oo ", -" ooooooooooooo ", -" " -}; diff --git a/wxWidgets/art/paste.xpm b/wxWidgets/art/paste.xpm deleted file mode 100644 index 028fa485b7..0000000000 --- a/wxWidgets/art/paste.xpm +++ /dev/null @@ -1,46 +0,0 @@ -/* XPM */ -static const char * paste_xpm[] = { -/* columns rows colors chars-per-pixel */ -"16 15 25 1", -"< c #FEECE4", -"> c #FEE3D7", -"O c #FFFFFF", -"o c #7B767D", -"% c #F79586", -"& c #CAE1F3", -"@ c #F08B62", -"# c #FCCBB8", -"- c #FDD8C9", -"4 c #FFF8F4", -"5 c #FFF5F0", -" c None", -"$ c #F8AA8F", -", c #EFF6FC", -"1 c #F7FBFD", -"2 c #FAFCFE", -"; c #DAEAF7", -": c #E9F3FA", -"6 c #FFFAF8", -". c #3C78A6", -"3 c #FFF1ED", -"X c #9B8687", -"+ c #FBBCA4", -"* c #B6D5EE", -"= c #F4F9FD", -/* pixels */ -" ...... ", -" .XoOOOOoo. ", -".+XOOOOOOX@. ", -".+XXXXXXXX@. ", -".#++$$%@..... ", -".##++$$%.&*.=. ", -".-##++$$.;&.==. ", -".--##++$.:;.... ", -".>--##++.,:;&*. ", -".<>--##+.1,:;&. ", -".<<>--##.21,:;. ", -".3<<>--#.O21=:. ", -".45<<>--....... ", -".6453<>----. ", -"............ " -}; diff --git a/wxWidgets/art/print.xpm b/wxWidgets/art/print.xpm deleted file mode 100644 index e91d170a20..0000000000 --- a/wxWidgets/art/print.xpm +++ /dev/null @@ -1,60 +0,0 @@ -/* XPM */ -static const char * print_xpm[] = { -/* columns rows colors chars-per-pixel */ -"16 15 39 1", -"< c #E3E4E6", -"+ c #C3C3C4", -"i c #FFFFFF", -": c #74879B", -"# c #5A89A6", -"a c #F1F4F7", -"r c #5A809C", -"@ c #BDCCD9", -"e c #7A92A4", -"% c #3F6F93", -"t c #9FA2A6", -"3 c #939495", -"w c #5F666D", -"9 c #65839E", -"5 c #4A7291", -"$ c #4B7F9E", -" c None", -"O c #DFE0E2", -"o c #F3F3F3", -"; c #84A5BB", -"& c #467291", -". c #7897AD", -"* c #407598", -"4 c #CFCFD0", -"7 c #6F90A6", -"y c #6A89A2", -"0 c #AAADB2", -"1 c #D2D3D4", -"u c #4F7592", -", c #BCBDBE", -"p c #57778E", -"q c #979BA0", -"2 c #ABABAC", -"- c #E7E7E7", -"= c #D6DEE6", -"> c #9FA0A0", -"8 c #829EB5", -"X c #8FB0C3", -"6 c #5D7C93", -/* pixels */ -" .XXXXXXXX ", -" .oooooooX ", -" .OOOOOOOX ", -" .+++++++X ", -"@##$%&&&&&%*##@ ", -"$=-;:>,<123$-=$ ", -".44.5678.96$44. ", -"7,,,,,,,,,,,,,7 ", -"900qwwwwwwwe009 ", -"rtt9ryyyyyyuttr ", -"6qq6iiiiiii%qq6 ", -"633paiiiiii%336 ", -"XXX*iiiiiii%XXX ", -" 6iiiiiii% ", -" $XXXXXXX# " -}; diff --git a/wxWidgets/art/quit.xpm b/wxWidgets/art/quit.xpm deleted file mode 100644 index 659093233f..0000000000 --- a/wxWidgets/art/quit.xpm +++ /dev/null @@ -1,90 +0,0 @@ -/* XPM */ -static const char * quit_xpm[] = { -/* columns rows colors chars-per-pixel */ -"16 15 69 1", -"@ c Black", -"i c #9AEA53", -"D c #7E9BB1", -"H c #839FB4", -", c #B7C7D3", -"8 c #BCCBD6", -"7 c #C1CFDA", -"v c #92ABBD", -"- c #D0DBE2", -"O c #547897", -"+ c #376485", -"L c #7090A8", -"t c #AEC0CE", -"g c #B3C4D1", -"S c #84A0B4", -"G c #89A4B8", -"> c #BDCCD7", -"F c #5A809C", -"2 c #C2D0DA", -"k c #93ACBE", -"= c #D6E0E6", -"* c #446A8C", -"z c #A5B9C8", -"# c #DEE5EB", -"0 c #AFC1CE", -"r c #B4C5D2", -"p c #B9C9D5", -"A c #8AA5B8", -"M c #92AABD", -"j c #A6BAC9", -"K c #7796AC", -"l c #ABBECC", -"o c #E4EAEF", -"9 c #B5C6D2", -" c None", -"; c #C9D6DF", -"X c #305F81", -"m c #98AFC0", -"V c #9DB3C3", -"% c #D1DBE3", -"u c #A2B7C6", -"y c #A7BBCA", -"h c #ACBFCD", -"4 c #B6C7D3", -"w c #C0CFD9", -"d c #982106", -"B c #85A0B5", -"6 c #C8D4DE", -"c c #99B0C1", -"x c #9EB4C4", -"$ c #D7E0E7", -"q c #A8BCCA", -"s c #ADC0CD", -"3 c #BCCCD7", -"N c #8BA5B9", -": c #C4D1DB", -"1 c #C9D5DE", -"f c #9AB1C2", -"n c #A4B9C8", -"a c #B3C5D1", -". c #215579", -"J c #7D9AB0", -"& c #829EB5", -"e c #BBCAD6", -"b c #8CA6B9", -"Z c #91AABC", -"C c #96AEC0", -"< c #CFDAE2", -"5 c #AFC2CF", -/* pixels */ -" ..XXXXXXXXXX ", -" XoO+X@@@@@@X ", -" X#$%&X*@@@@X ", -" X=-;:>,X@@@X ", -" X<12345X@@@X ", -" X67890qX@XXX ", -" XwertyuX@XiX ", -" XpasddfX++iiX ", -" XghjddkXiiiiiX ", -" XlzxcvbXiiiiiiX", -" XnxmMNBXiiiiiX ", -" XVCZASDXXXiiX ", -" XXFGHJKX XiX ", -" FXXFLX XX ", -" XX* " -}; diff --git a/wxWidgets/art/redo.xpm b/wxWidgets/art/redo.xpm deleted file mode 100644 index 844403e791..0000000000 --- a/wxWidgets/art/redo.xpm +++ /dev/null @@ -1,58 +0,0 @@ -/* XPM */ -static const char * redo_xpm[] = { -/* columns rows colors chars-per-pixel */ -"16 15 37 1", -"4 c #9BACC2", -"; c #4C7398", -"3 c #547B99", -"* c #547897", -"# c #5A89A6", -"8 c #3A749C", -"5 c #5A809C", -", c #7F99B4", -"& c #3F6F93", -"9 c #85A7BC", -"+ c #749BB4", -"> c #718BA7", -"e c #A5B3C8", -"w c #BECAD9", -": c #65839D", -"u c #E1E6EE", -"o c #236289", -"r c #ADBED2", -"= c #597B9A", -"2 c #8DA0B9", -" c None", -"% c #467291", -"1 c #7393AB", -"i c #4C809F", -"- c #A0BACB", -"O c #6591AE", -"X c #407598", -"6 c #6F90A6", -"t c #D2D9E0", -"7 c #ADBACE", -"@ c #326A8F", -"0 c #467A9C", -". c #ACC4D3", -"< c #7F97B0", -"y c #B3BFD1", -"q c #A2B3C5", -"$ c #8FB0C3", -/* pixels */ -" .XoooO ", -" +o@@@@@o# +", -" $@%%&@&%%&@ +o", -" X*=@+-+@*=;@#&@", -" @:=+ @=:=*:@", -" &>:$ @:>>>@", -" &,,,,&", -" +123 @<2222&", -" X44X #@56<44X", -" O1748 .9#&o", -" 0qwe8 ", -" 8rty8 ", -" 8wu+ ", -" i## ", -" " -}; diff --git a/wxWidgets/art/removable.xpm b/wxWidgets/art/removable.xpm deleted file mode 100644 index fcc52ff810..0000000000 --- a/wxWidgets/art/removable.xpm +++ /dev/null @@ -1,44 +0,0 @@ -/* XPM */ -static const char * removable_xpm[] = { -/* columns rows colors chars-per-pixel */ -"16 15 23 1", -"@ c #C3C3C4", -"4 c #FFFFFF", -"o c #D5D6D8", -"> c #7A92A3", -". c #8497A5", -"% c #ACAEB2", -"2 c #4A7898", -": c #DCE2EA", -", c #F5F6F7", -"= c #EBEBEC", -"$ c #B7B7B8", -" c None", -"X c #DFE0E2", -"* c #A6A8AD", -"1 c #4C809F", -"3 c #407598", -"O c #CFCFD0", -"; c #9EA2A8", -"# c #BCBDBE", -"+ c #C6C8CA", -"- c #979BA0", -"& c #E7E7E7", -"< c #8FB0C3", -/* pixels */ -" ......... ", -" .XoO+@#$%. ", -" .XoO+@#$%. ", -" .&XoO+@#$%*. ", -" .&XoO+@#$%*. ", -" .=&XoO+@#$%*-. ", -" .=&XoO+@#$%*;. ", -".:=&XoO+@#$%*;>.", -".,=&XoO+@#$%*;-.", -"<..............<", -"<,=&XoO+@#$%%%%.", -" c #718BA7", -"0 c #A5B3C8", -"q c #BECAD9", -": c #65839D", -"u c #E1E6EE", -"X c #236289", -"y c #ADBED2", -"= c #597B9A", -"1 c #8DA0B9", -" c None", -"% c #467291", -"3 c #7393AB", -"i c #4C809F", -"; c #A0BACB", -". c #6591AE", -"o c #407598", -"5 c #6F90A6", -"t c #D2D9E0", -"9 c #ADBACE", -"# c #326A8F", -"e c #467A9C", -"O c #ACC4D3", -"< c #7F97B0", -"r c #B3BFD1", -"w c #A2B3C5", -"& c #8FB0C3", -/* pixels */ -" .XXXoO ", -"+ @X#####X+ ", -"X+ #$%%$#$%%#& ", -"#$@#*=-#+;+#=-o ", -"#:-=:=# +=:# ", -"#>>>:# &:>$ ", -"$,,,>o o<,$ ", -"$1111<# 213+ ", -"o44<56#@ o44o ", -"X$@7O 8493. ", -" 80qwe ", -" 8rty8 ", -" +uq8 ", -" @@i ", -" " -}; diff --git a/wxWidgets/art/up.xpm b/wxWidgets/art/up.xpm deleted file mode 100644 index 922eb6483a..0000000000 --- a/wxWidgets/art/up.xpm +++ /dev/null @@ -1,21 +0,0 @@ -/* XPM */ -static const char * up_xpm[] = { -"16 15 3 1", -" c None", -". c Black", -"X c Gray100", -" ", -" .. ", -" .XX. ", -" .XXXX. ", -" .XXXXXX. ", -" .XXXXXXXX. ", -" ....XXXX.... ", -" .XXXX. ", -" .XXXX. ", -" .XXXX. ", -" .XXXX. ", -" .XXXX. ", -" .XXXX. ", -" ...... ", -" "}; diff --git a/wxWidgets/art/wxwin.ico b/wxWidgets/art/wxwin.ico deleted file mode 100644 index 8d2dc18c6b92c1b714dcca114e1caddc605c2714..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1078 zcmcIjIda1=5Q8i>8qYZTK~!b@3>ADBpWs%%aG!?HNvS>s11xooBu)yC*T#b2E|)AI zpuz=R*ODE6F2EOnw$1up0k;~sbFU+MLVb$B-t!17vJyfjW-bw9B&(3@kCe0`_|uls zo1+;NkL8wwPE-B*t#~#?op$xIw#%+--FZey^Lm#y^_|wNT+i<-YP&Qi>-YV#^RL$X zw*5Q340^+Y9ykPQ8p9BQ`UHh{WN*n|%Yb=M=EF@X$>%N65wp)D*XI%FaaQPQBW5mN z@;Uv;fxw5D{xkj+bCcW*&i7fb=LB4S^vR0{?%1Sg>G8Lqh{7 z`GS%$hyv1}1pWWN-TN(XfCB$Yg8YKP0wa}RxN(!G5Ev4Uo-U3d6}P6Ix8`C{;Bh(l zws+_MRMyXeG0m;}&ME421Rj!BP|lERzQ+*b@coUV(niME1#Feu4xVV&y5M%`=JDrh Y3AgIcu*N=31RBQR>FVdQ&MBb@0A8AA3jhEB diff --git a/wxWidgets/art/wxwin16x16.xpm b/wxWidgets/art/wxwin16x16.xpm deleted file mode 100644 index 81b85169d2..0000000000 --- a/wxWidgets/art/wxwin16x16.xpm +++ /dev/null @@ -1,25 +0,0 @@ -/* XPM */ -static const char * wxwin16x16_xpm[] = { -"16 16 6 1", -" c None", -". c #000000", -"X c #000084", -"o c #FFFFFF", -"O c #FFFF00", -"+ c #FF0000", -" ", -" ", -" ....... ", -" .XXXXX. ", -" .oXXXX. ", -" .oXXX.......", -".....oXXX.OOOOO.", -".+++.XXXX.oOOOO.", -".o++......oOOOO.", -".o++++. .oOOOO.", -".o++++. .OOOOO.", -".+++++. .......", -"....... ", -" ", -" ", -" "}; diff --git a/wxWidgets/art/wxwin32x32.png b/wxWidgets/art/wxwin32x32.png deleted file mode 100644 index 20eda44161cbf3397a03b044cea10b78ddbb76db..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1267 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE3?yBabR7dyq9v{oCC){ui6xo&c?uz!xv327 zm$+F4m5iBJ-(Ch(z+U3%>k1aqREmFh@I6q7v%n*=n1O*?2!t6g-L3n>z`)E9;1l8s zlxzUw1~AnCK@<0elbFeIWqT^vIyZk@gC$aO%0$K~S9 z@aO-g>vFK&TIqH~XG{HGF*TPvlRv08_{;5BqM)#y@dq>KiAg6EJ*F`g@lIfyC%EXr zS@v%etUmBv(8=Ob`EvYu!?O(c<5iCyw>UEL&Sg0w-!<(X&>99$S3j3^P6 - - - - Debug - Win32 - - - Debug - x64 - - - DLL Debug - Win32 - - - DLL Debug - x64 - - - DLL Release - Win32 - - - DLL Release - x64 - - - DLL Unicode Debug - Win32 - - - DLL Unicode Debug - x64 - - - DLL Unicode Release - Win32 - - - DLL Unicode Release - x64 - - - DLL Universal Debug - Win32 - - - DLL Universal Debug - x64 - - - DLL Universal Release - Win32 - - - DLL Universal Release - x64 - - - DLL Universal Unicode Debug - Win32 - - - DLL Universal Unicode Debug - x64 - - - DLL Universal Unicode Release - Win32 - - - DLL Universal Unicode Release - x64 - - - Release - Win32 - - - Release - x64 - - - Template - Win32 - - - Template - x64 - - - Unicode Debug - Win32 - - - Unicode Debug - x64 - - - Unicode Release - Win32 - - - Unicode Release - x64 - - - Universal Debug - Win32 - - - Universal Debug - x64 - - - Universal Release - Win32 - - - Universal Release - x64 - - - Universal Unicode Debug - Win32 - - - Universal Unicode Debug - x64 - - - Universal Unicode Release - Win32 - - - Universal Unicode Release - x64 - - - - adv - - - {6FCB55A5-563F-4039-1D79-1EB6ED8AAB82} - - - - Application - v110 - - - Application - v110 - - - DynamicLibrary - false - Unicode - v110 - - - DynamicLibrary - false - Unicode - v110 - - - DynamicLibrary - false - v110 - - - DynamicLibrary - false - v110 - - - DynamicLibrary - false - Unicode - v110 - - - DynamicLibrary - false - Unicode - v110 - - - StaticLibrary - false - Unicode - v110 - - - StaticLibrary - false - Unicode - v110 - - - StaticLibrary - false - Unicode - v110 - - - StaticLibrary - false - Unicode - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - Unicode - v110 - - - StaticLibrary - false - Unicode - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - Unicode - v110 - - - StaticLibrary - false - Unicode - v110 - - - DynamicLibrary - false - v110 - - - DynamicLibrary - false - v110 - - - DynamicLibrary - false - Unicode - v110 - - - DynamicLibrary - false - Unicode - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - DynamicLibrary - false - v110 - - - DynamicLibrary - false - v110 - - - DynamicLibrary - false - v110 - - - DynamicLibrary - false - v110 - - - DynamicLibrary - false - Unicode - v110 - - - DynamicLibrary - false - Unicode - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - .\..\..\lib\vc_lib\ - .\vc_mswuniv\adv\ - - - .\..\..\lib\vc_lib\ - .\vc_mswuniv\adv\ - - - .\..\..\lib\vc_dll\ - .\vc_mswudll\adv\ - false - - - .\..\..\lib\vc_dll\ - .\vc_mswudll\adv\ - false - - - .\..\..\lib\vc_dll\ - .\vc_mswunivddll\adv\ - true - - - .\..\..\lib\vc_dll\ - .\vc_mswunivddll\adv\ - true - - - .\..\..\lib\vc_dll\ - .\vc_mswdll\adv\ - false - - - .\..\..\lib\vc_dll\ - .\vc_mswdll\adv\ - false - - - .\..\..\..\libs\$(Configuration) - .\vc_msw\adv\ - - - .\..\..\..\libs\$(Configuration) - .\vc_msw\adv\ - - - .\..\..\lib\vc_dll\ - .\vc_mswuddll\adv\ - true - - - .\..\..\lib\vc_dll\ - .\vc_mswuddll\adv\ - true - - - .\..\..\lib\vc_dll\ - .\vc_mswunivdll\adv\ - false - - - .\..\..\lib\vc_dll\ - .\vc_mswunivdll\adv\ - false - - - .\..\..\lib\vc_lib\ - .\vc_mswunivud\adv\ - - - .\..\..\lib\vc_lib\ - .\vc_mswunivud\adv\ - - - .\..\..\..\libs\$(Configuration)\ - .\vc_mswd\adv\ - $(ProjectName) - - - .\..\..\..\libs\$(Configuration)\ - .\vc_mswd\adv\ - $(ProjectName) - - - .\..\..\lib\vc_lib\ - .\vc_mswu\adv\ - - - .\..\..\lib\vc_lib\ - .\vc_mswu\adv\ - - - .\..\..\lib\vc_lib\ - .\vc_mswunivd\adv\ - - - .\..\..\lib\vc_lib\ - .\vc_mswunivd\adv\ - - - .\..\..\lib\vc_lib\ - .\vc_mswud\adv\ - - - .\..\..\lib\vc_lib\ - .\vc_mswud\adv\ - - - .\..\..\lib\vc_lib\ - .\vc_mswunivu\adv\ - - - .\..\..\lib\vc_lib\ - .\vc_mswunivu\adv\ - - - .\..\..\lib\vc_dll\ - .\vc_mswunivudll\adv\ - false - - - .\..\..\lib\vc_dll\ - .\vc_mswunivudll\adv\ - false - - - .\..\..\lib\vc_dll\ - .\vc_mswddll\adv\ - true - - - .\..\..\lib\vc_dll\ - .\vc_mswddll\adv\ - true - - - .\..\..\lib\vc_dll\ - .\vc_mswunivuddll\adv\ - true - - - .\..\..\lib\vc_dll\ - .\vc_mswunivuddll\adv\ - true - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_lib\mswuniv;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;__WXMSW__;__WXUNIVERSAL__;NDEBUG;WXBUILDING;%(PreprocessorDefinitions) - .\vc_mswuniv\adv\ - vc_mswuniv\wxprec_advlib.pch - Use - wx/wxprec.h - .\vc_mswuniv\adv\ - ..\..\lib\vc_lib\wxmswuniv28_adv.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_adv.bsc - - - true - ..\..\lib\vc_lib\wxmswuniv28_adv.lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_lib\mswuniv;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;__WXMSW__;__WXUNIVERSAL__;NDEBUG;WXBUILDING;%(PreprocessorDefinitions) - .\vc_mswuniv\adv\ - vc_mswuniv\wxprec_advlib.pch - Use - wx/wxprec.h - .\vc_mswuniv\adv\ - ..\..\lib\vc_lib\wxmswuniv28_adv.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_adv.bsc - - - true - ..\..\lib\vc_lib\wxmswuniv28_adv.lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_dll\mswu;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;NDEBUG;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_ADV;%(PreprocessorDefinitions) - .\vc_mswudll\adv\ - vc_mswudll\wxprec_advdll.pch - Use - wx/wxprec.h - .\vc_mswudll\adv\ - ..\..\lib\vc_dll\wxmsw28u_adv_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;NDEBUG;_UNICODE;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_ADV;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_adv.tlb - true - Win32 - - - 0x0409 - ..\..\lib\vc_dll\mswu;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - __WXMSW__;NDEBUG;_UNICODE;WXBUILDING;WXDLLNAME=wxmsw28u_adv_vc_custom;WXUSINGDLL;WXMAKINGDLL_ADV;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_adv.bsc - - - true - true - Console - ..\..\lib\vc_dll\wxmsw28u_adv_vc_custom.dll - ..\..\lib\vc_dll\wxmsw28u_adv.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxtiff.lib;wxjpeg.lib;wxpng.lib;wxzlib.lib;wxregexu.lib;wxexpat.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxmsw28u_core.lib;..\..\lib\vc_dll\wxbase28u.lib;%(AdditionalDependencies) - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_dll\mswu;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;NDEBUG;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_ADV;%(PreprocessorDefinitions) - .\vc_mswudll\adv\ - vc_mswudll\wxprec_advdll.pch - Use - wx/wxprec.h - .\vc_mswudll\adv\ - ..\..\lib\vc_dll\wxmsw28u_adv_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;NDEBUG;_UNICODE;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_ADV;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_adv.tlb - true - - - 0x0409 - ..\..\lib\vc_dll\mswu;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - __WXMSW__;NDEBUG;_UNICODE;WXBUILDING;WXDLLNAME=wxmsw28u_adv_vc_custom;WXUSINGDLL;WXMAKINGDLL_ADV;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_adv.bsc - - - true - true - Console - ..\..\lib\vc_dll\wxmsw28u_adv_vc_custom.dll - ..\..\lib\vc_dll\wxmsw28u_adv.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxtiff.lib;wxjpeg.lib;wxpng.lib;wxzlib.lib;wxregexu.lib;wxexpat.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxmsw28u_core.lib;..\..\lib\vc_dll\wxbase28u.lib;%(AdditionalDependencies) - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - true - ..\..\lib\vc_dll\mswunivd;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_ADV;%(PreprocessorDefinitions) - .\vc_mswunivddll\adv\ - vc_mswunivddll\wxprec_advdll.pch - Use - wx/wxprec.h - .\vc_mswunivddll\adv\ - ..\..\lib\vc_dll\wxmswuniv28d_adv_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_ADV;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_adv.tlb - true - Win32 - - - 0x0409 - ..\..\lib\vc_dll\mswunivd;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - _DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;WXBUILDING;WXDLLNAME=wxmswuniv28d_adv_vc_custom;WXUSINGDLL;WXMAKINGDLL_ADV;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_adv.bsc - - - true - true - true - Console - ..\..\lib\vc_dll\wxmswuniv28d_adv_vc_custom.dll - ..\..\lib\vc_dll\wxmswuniv28d_adv.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxtiffd.lib;wxjpegd.lib;wxpngd.lib;wxzlibd.lib;wxregexd.lib;wxexpatd.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxmswuniv28d_core.lib;..\..\lib\vc_dll\wxbase28d.lib;%(AdditionalDependencies) - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - ..\..\lib\vc_dll\mswunivd;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_ADV;%(PreprocessorDefinitions) - .\vc_mswunivddll\adv\ - vc_mswunivddll\wxprec_advdll.pch - Use - wx/wxprec.h - .\vc_mswunivddll\adv\ - ..\..\lib\vc_dll\wxmswuniv28d_adv_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_ADV;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_adv.tlb - true - - - 0x0409 - ..\..\lib\vc_dll\mswunivd;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - _DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;WXBUILDING;WXDLLNAME=wxmswuniv28d_adv_vc_custom;WXUSINGDLL;WXMAKINGDLL_ADV;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_adv.bsc - - - true - true - true - Console - ..\..\lib\vc_dll\wxmswuniv28d_adv_vc_custom.dll - ..\..\lib\vc_dll\wxmswuniv28d_adv.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxtiffd.lib;wxjpegd.lib;wxpngd.lib;wxzlibd.lib;wxregexd.lib;wxexpatd.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxmswuniv28d_core.lib;..\..\lib\vc_dll\wxbase28d.lib;%(AdditionalDependencies) - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_dll\msw;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;NDEBUG;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_ADV;%(PreprocessorDefinitions) - .\vc_mswdll\adv\ - vc_mswdll\wxprec_advdll.pch - Use - wx/wxprec.h - .\vc_mswdll\adv\ - ..\..\lib\vc_dll\wxmsw28_adv_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;NDEBUG;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_ADV;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_adv.tlb - true - Win32 - - - 0x0409 - ..\..\lib\vc_dll\msw;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - __WXMSW__;NDEBUG;WXBUILDING;WXDLLNAME=wxmsw28_adv_vc_custom;WXUSINGDLL;WXMAKINGDLL_ADV;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_adv.bsc - - - true - true - Console - ..\..\lib\vc_dll\wxmsw28_adv_vc_custom.dll - ..\..\lib\vc_dll\wxmsw28_adv.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxtiff.lib;wxjpeg.lib;wxpng.lib;wxzlib.lib;wxregex.lib;wxexpat.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxmsw28_core.lib;..\..\lib\vc_dll\wxbase28.lib;%(AdditionalDependencies) - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_dll\msw;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;NDEBUG;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_ADV;%(PreprocessorDefinitions) - .\vc_mswdll\adv\ - vc_mswdll\wxprec_advdll.pch - Use - wx/wxprec.h - .\vc_mswdll\adv\ - ..\..\lib\vc_dll\wxmsw28_adv_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;NDEBUG;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_ADV;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_adv.tlb - true - - - 0x0409 - ..\..\lib\vc_dll\msw;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - __WXMSW__;NDEBUG;WXBUILDING;WXDLLNAME=wxmsw28_adv_vc_custom;WXUSINGDLL;WXMAKINGDLL_ADV;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_adv.bsc - - - true - true - Console - ..\..\lib\vc_dll\wxmsw28_adv_vc_custom.dll - ..\..\lib\vc_dll\wxmsw28_adv.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxtiff.lib;wxjpeg.lib;wxpng.lib;wxzlib.lib;wxregex.lib;wxexpat.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxmsw28_core.lib;..\..\lib\vc_dll\wxbase28.lib;%(AdditionalDependencies) - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_lib\msw;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;__WXMSW__;NDEBUG;WXBUILDING;%(PreprocessorDefinitions) - .\vc_msw\adv\ - vc_msw\wxprec_advlib.pch - Use - wx/wxprec.h - .\vc_msw\adv\ - ..\..\lib\vc_lib\wxmsw28_adv.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_adv.bsc - - - true - .\..\..\..\libs\$(Configuration)\$(ProjectName).lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_lib\msw;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;__WXMSW__;NDEBUG;WXBUILDING;%(PreprocessorDefinitions) - .\vc_msw\adv\ - vc_msw\wxprec_advlib.pch - Use - wx/wxprec.h - .\vc_msw\adv\ - ..\..\lib\vc_lib\wxmsw28_adv.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_adv.bsc - - - true - .\..\..\..\libs\$(Configuration)\$(ProjectName).lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - true - ..\..\lib\vc_dll\mswud;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXDEBUG__;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_ADV;%(PreprocessorDefinitions) - .\vc_mswuddll\adv\ - vc_mswuddll\wxprec_advdll.pch - Use - wx/wxprec.h - .\vc_mswuddll\adv\ - ..\..\lib\vc_dll\wxmsw28ud_adv_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXDEBUG__;_UNICODE;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_ADV;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_adv.tlb - true - Win32 - - - 0x0409 - ..\..\lib\vc_dll\mswud;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - _DEBUG;__WXMSW__;__WXDEBUG__;_UNICODE;WXBUILDING;WXDLLNAME=wxmsw28ud_adv_vc_custom;WXUSINGDLL;WXMAKINGDLL_ADV;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_adv.bsc - - - true - true - true - Console - ..\..\lib\vc_dll\wxmsw28ud_adv_vc_custom.dll - ..\..\lib\vc_dll\wxmsw28ud_adv.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxtiffd.lib;wxjpegd.lib;wxpngd.lib;wxzlibd.lib;wxregexud.lib;wxexpatd.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxmsw28ud_core.lib;..\..\lib\vc_dll\wxbase28ud.lib;%(AdditionalDependencies) - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - ..\..\lib\vc_dll\mswud;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXDEBUG__;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_ADV;%(PreprocessorDefinitions) - .\vc_mswuddll\adv\ - vc_mswuddll\wxprec_advdll.pch - Use - wx/wxprec.h - .\vc_mswuddll\adv\ - ..\..\lib\vc_dll\wxmsw28ud_adv_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXDEBUG__;_UNICODE;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_ADV;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_adv.tlb - true - - - 0x0409 - ..\..\lib\vc_dll\mswud;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - _DEBUG;__WXMSW__;__WXDEBUG__;_UNICODE;WXBUILDING;WXDLLNAME=wxmsw28ud_adv_vc_custom;WXUSINGDLL;WXMAKINGDLL_ADV;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_adv.bsc - - - true - true - true - Console - ..\..\lib\vc_dll\wxmsw28ud_adv_vc_custom.dll - ..\..\lib\vc_dll\wxmsw28ud_adv.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxtiffd.lib;wxjpegd.lib;wxpngd.lib;wxzlibd.lib;wxregexud.lib;wxexpatd.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxmsw28ud_core.lib;..\..\lib\vc_dll\wxbase28ud.lib;%(AdditionalDependencies) - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_dll\mswuniv;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;__WXUNIVERSAL__;NDEBUG;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_ADV;%(PreprocessorDefinitions) - .\vc_mswunivdll\adv\ - vc_mswunivdll\wxprec_advdll.pch - Use - wx/wxprec.h - .\vc_mswunivdll\adv\ - ..\..\lib\vc_dll\wxmswuniv28_adv_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;__WXUNIVERSAL__;NDEBUG;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_ADV;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_adv.tlb - true - Win32 - - - 0x0409 - ..\..\lib\vc_dll\mswuniv;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - __WXMSW__;__WXUNIVERSAL__;NDEBUG;WXBUILDING;WXDLLNAME=wxmswuniv28_adv_vc_custom;WXUSINGDLL;WXMAKINGDLL_ADV;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_adv.bsc - - - true - true - Console - ..\..\lib\vc_dll\wxmswuniv28_adv_vc_custom.dll - ..\..\lib\vc_dll\wxmswuniv28_adv.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxtiff.lib;wxjpeg.lib;wxpng.lib;wxzlib.lib;wxregex.lib;wxexpat.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxmswuniv28_core.lib;..\..\lib\vc_dll\wxbase28.lib;%(AdditionalDependencies) - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_dll\mswuniv;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;__WXUNIVERSAL__;NDEBUG;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_ADV;%(PreprocessorDefinitions) - .\vc_mswunivdll\adv\ - vc_mswunivdll\wxprec_advdll.pch - Use - wx/wxprec.h - .\vc_mswunivdll\adv\ - ..\..\lib\vc_dll\wxmswuniv28_adv_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;__WXUNIVERSAL__;NDEBUG;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_ADV;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_adv.tlb - true - - - 0x0409 - ..\..\lib\vc_dll\mswuniv;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - __WXMSW__;__WXUNIVERSAL__;NDEBUG;WXBUILDING;WXDLLNAME=wxmswuniv28_adv_vc_custom;WXUSINGDLL;WXMAKINGDLL_ADV;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_adv.bsc - - - true - true - Console - ..\..\lib\vc_dll\wxmswuniv28_adv_vc_custom.dll - ..\..\lib\vc_dll\wxmswuniv28_adv.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxtiff.lib;wxjpeg.lib;wxpng.lib;wxzlib.lib;wxregex.lib;wxexpat.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxmswuniv28_core.lib;..\..\lib\vc_dll\wxbase28.lib;%(AdditionalDependencies) - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - true - ..\..\lib\vc_lib\mswunivud;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;WXBUILDING;%(PreprocessorDefinitions) - .\vc_mswunivud\adv\ - vc_mswunivud\wxprec_advlib.pch - Use - wx/wxprec.h - .\vc_mswunivud\adv\ - ..\..\lib\vc_lib\wxmswuniv28ud_adv.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_adv.bsc - - - true - ..\..\lib\vc_lib\wxmswuniv28ud_adv.lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - ..\..\lib\vc_lib\mswunivud;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;WXBUILDING;%(PreprocessorDefinitions) - .\vc_mswunivud\adv\ - vc_mswunivud\wxprec_advlib.pch - Use - wx/wxprec.h - .\vc_mswunivud\adv\ - ..\..\lib\vc_lib\wxmswuniv28ud_adv.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_adv.bsc - - - true - ..\..\lib\vc_lib\wxmswuniv28ud_adv.lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - true - ..\..\lib\vc_lib\mswd;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;__WXMSW__;__WXDEBUG__;WXBUILDING;%(PreprocessorDefinitions) - .\vc_mswd\adv\ - vc_mswd\wxprec_advlib.pch - Use - wx/wxprec.h - .\vc_mswd\adv\ - ..\..\lib\vc_lib\$(ProjectName).pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_adv.bsc - - - true - .\..\..\..\libs\$(Configuration)\$(ProjectName).lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - ..\..\lib\vc_lib\mswd;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;__WXMSW__;__WXDEBUG__;WXBUILDING;%(PreprocessorDefinitions) - .\vc_mswd\adv\ - vc_mswd\wxprec_advlib.pch - Use - wx/wxprec.h - .\vc_mswd\adv\ - ..\..\lib\vc_lib\$(ProjectName).pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_adv.bsc - - - true - .\..\..\..\libs\$(Configuration)\$(ProjectName).lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_lib\mswu;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;__WXMSW__;NDEBUG;WXBUILDING;%(PreprocessorDefinitions) - .\vc_mswu\adv\ - vc_mswu\wxprec_advlib.pch - Use - wx/wxprec.h - .\vc_mswu\adv\ - ..\..\lib\vc_lib\wxmsw28u_adv.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_adv.bsc - - - true - ..\..\lib\vc_lib\wxmsw28u_adv.lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_lib\mswu;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;__WXMSW__;NDEBUG;WXBUILDING;%(PreprocessorDefinitions) - .\vc_mswu\adv\ - vc_mswu\wxprec_advlib.pch - Use - wx/wxprec.h - .\vc_mswu\adv\ - ..\..\lib\vc_lib\wxmsw28u_adv.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_adv.bsc - - - true - ..\..\lib\vc_lib\wxmsw28u_adv.lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - true - ..\..\lib\vc_lib\mswunivd;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;WXBUILDING;%(PreprocessorDefinitions) - .\vc_mswunivd\adv\ - vc_mswunivd\wxprec_advlib.pch - Use - wx/wxprec.h - .\vc_mswunivd\adv\ - ..\..\lib\vc_lib\wxmswuniv28d_adv.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_adv.bsc - - - true - ..\..\lib\vc_lib\wxmswuniv28d_adv.lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - ..\..\lib\vc_lib\mswunivd;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;WXBUILDING;%(PreprocessorDefinitions) - .\vc_mswunivd\adv\ - vc_mswunivd\wxprec_advlib.pch - Use - wx/wxprec.h - .\vc_mswunivd\adv\ - ..\..\lib\vc_lib\wxmswuniv28d_adv.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_adv.bsc - - - true - ..\..\lib\vc_lib\wxmswuniv28d_adv.lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - true - ..\..\lib\vc_lib\mswud;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;__WXMSW__;__WXDEBUG__;WXBUILDING;%(PreprocessorDefinitions) - .\vc_mswud\adv\ - vc_mswud\wxprec_advlib.pch - Use - wx/wxprec.h - .\vc_mswud\adv\ - ..\..\lib\vc_lib\wxmsw28ud_adv.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_adv.bsc - - - true - ..\..\lib\vc_lib\wxmsw28ud_adv.lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - ..\..\lib\vc_lib\mswud;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;__WXMSW__;__WXDEBUG__;WXBUILDING;%(PreprocessorDefinitions) - .\vc_mswud\adv\ - vc_mswud\wxprec_advlib.pch - Use - wx/wxprec.h - .\vc_mswud\adv\ - ..\..\lib\vc_lib\wxmsw28ud_adv.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_adv.bsc - - - true - ..\..\lib\vc_lib\wxmsw28ud_adv.lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_lib\mswunivu;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;__WXMSW__;__WXUNIVERSAL__;NDEBUG;WXBUILDING;%(PreprocessorDefinitions) - .\vc_mswunivu\adv\ - vc_mswunivu\wxprec_advlib.pch - Use - wx/wxprec.h - .\vc_mswunivu\adv\ - ..\..\lib\vc_lib\wxmswuniv28u_adv.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_adv.bsc - - - true - ..\..\lib\vc_lib\wxmswuniv28u_adv.lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_lib\mswunivu;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;__WXMSW__;__WXUNIVERSAL__;NDEBUG;WXBUILDING;%(PreprocessorDefinitions) - .\vc_mswunivu\adv\ - vc_mswunivu\wxprec_advlib.pch - Use - wx/wxprec.h - .\vc_mswunivu\adv\ - ..\..\lib\vc_lib\wxmswuniv28u_adv.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_adv.bsc - - - true - ..\..\lib\vc_lib\wxmswuniv28u_adv.lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_dll\mswunivu;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;__WXUNIVERSAL__;NDEBUG;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_ADV;%(PreprocessorDefinitions) - .\vc_mswunivudll\adv\ - vc_mswunivudll\wxprec_advdll.pch - Use - wx/wxprec.h - .\vc_mswunivudll\adv\ - ..\..\lib\vc_dll\wxmswuniv28u_adv_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;__WXUNIVERSAL__;NDEBUG;_UNICODE;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_ADV;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_adv.tlb - true - Win32 - - - 0x0409 - ..\..\lib\vc_dll\mswunivu;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - __WXMSW__;__WXUNIVERSAL__;NDEBUG;_UNICODE;WXBUILDING;WXDLLNAME=wxmswuniv28u_adv_vc_custom;WXUSINGDLL;WXMAKINGDLL_ADV;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_adv.bsc - - - true - true - Console - ..\..\lib\vc_dll\wxmswuniv28u_adv_vc_custom.dll - ..\..\lib\vc_dll\wxmswuniv28u_adv.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxtiff.lib;wxjpeg.lib;wxpng.lib;wxzlib.lib;wxregexu.lib;wxexpat.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxmswuniv28u_core.lib;..\..\lib\vc_dll\wxbase28u.lib;%(AdditionalDependencies) - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_dll\mswunivu;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;__WXUNIVERSAL__;NDEBUG;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_ADV;%(PreprocessorDefinitions) - .\vc_mswunivudll\adv\ - vc_mswunivudll\wxprec_advdll.pch - Use - wx/wxprec.h - .\vc_mswunivudll\adv\ - ..\..\lib\vc_dll\wxmswuniv28u_adv_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;__WXUNIVERSAL__;NDEBUG;_UNICODE;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_ADV;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_adv.tlb - true - - - 0x0409 - ..\..\lib\vc_dll\mswunivu;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - __WXMSW__;__WXUNIVERSAL__;NDEBUG;_UNICODE;WXBUILDING;WXDLLNAME=wxmswuniv28u_adv_vc_custom;WXUSINGDLL;WXMAKINGDLL_ADV;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_adv.bsc - - - true - true - Console - ..\..\lib\vc_dll\wxmswuniv28u_adv_vc_custom.dll - ..\..\lib\vc_dll\wxmswuniv28u_adv.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxtiff.lib;wxjpeg.lib;wxpng.lib;wxzlib.lib;wxregexu.lib;wxexpat.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxmswuniv28u_core.lib;..\..\lib\vc_dll\wxbase28u.lib;%(AdditionalDependencies) - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - true - ..\..\lib\vc_dll\mswd;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXDEBUG__;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_ADV;%(PreprocessorDefinitions) - .\vc_mswddll\adv\ - vc_mswddll\wxprec_advdll.pch - Use - wx/wxprec.h - .\vc_mswddll\adv\ - ..\..\lib\vc_dll\wxmsw28d_adv_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXDEBUG__;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_ADV;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_adv.tlb - true - Win32 - - - 0x0409 - ..\..\lib\vc_dll\mswd;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - _DEBUG;__WXMSW__;__WXDEBUG__;WXBUILDING;WXDLLNAME=wxmsw28d_adv_vc_custom;WXUSINGDLL;WXMAKINGDLL_ADV;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_adv.bsc - - - true - true - true - Console - ..\..\lib\vc_dll\wxmsw28d_adv_vc_custom.dll - ..\..\lib\vc_dll\wxmsw28d_adv.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxtiffd.lib;wxjpegd.lib;wxpngd.lib;wxzlibd.lib;wxregexd.lib;wxexpatd.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxmsw28d_core.lib;..\..\lib\vc_dll\wxbase28d.lib;%(AdditionalDependencies) - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - ..\..\lib\vc_dll\mswd;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXDEBUG__;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_ADV;%(PreprocessorDefinitions) - .\vc_mswddll\adv\ - vc_mswddll\wxprec_advdll.pch - Use - wx/wxprec.h - .\vc_mswddll\adv\ - ..\..\lib\vc_dll\wxmsw28d_adv_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXDEBUG__;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_ADV;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_adv.tlb - true - - - 0x0409 - ..\..\lib\vc_dll\mswd;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - _DEBUG;__WXMSW__;__WXDEBUG__;WXBUILDING;WXDLLNAME=wxmsw28d_adv_vc_custom;WXUSINGDLL;WXMAKINGDLL_ADV;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_adv.bsc - - - true - true - true - Console - ..\..\lib\vc_dll\wxmsw28d_adv_vc_custom.dll - ..\..\lib\vc_dll\wxmsw28d_adv.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxtiffd.lib;wxjpegd.lib;wxpngd.lib;wxzlibd.lib;wxregexd.lib;wxexpatd.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxmsw28d_core.lib;..\..\lib\vc_dll\wxbase28d.lib;%(AdditionalDependencies) - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - true - ..\..\lib\vc_dll\mswunivud;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_ADV;%(PreprocessorDefinitions) - .\vc_mswunivuddll\adv\ - vc_mswunivuddll\wxprec_advdll.pch - Use - wx/wxprec.h - .\vc_mswunivuddll\adv\ - ..\..\lib\vc_dll\wxmswuniv28ud_adv_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;_UNICODE;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_ADV;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_adv.tlb - true - Win32 - - - 0x0409 - ..\..\lib\vc_dll\mswunivud;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - _DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;_UNICODE;WXBUILDING;WXDLLNAME=wxmswuniv28ud_adv_vc_custom;WXUSINGDLL;WXMAKINGDLL_ADV;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_adv.bsc - - - true - true - true - Console - ..\..\lib\vc_dll\wxmswuniv28ud_adv_vc_custom.dll - ..\..\lib\vc_dll\wxmswuniv28ud_adv.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxtiffd.lib;wxjpegd.lib;wxpngd.lib;wxzlibd.lib;wxregexud.lib;wxexpatd.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxmswuniv28ud_core.lib;..\..\lib\vc_dll\wxbase28ud.lib;%(AdditionalDependencies) - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - ..\..\lib\vc_dll\mswunivud;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_ADV;%(PreprocessorDefinitions) - .\vc_mswunivuddll\adv\ - vc_mswunivuddll\wxprec_advdll.pch - Use - wx/wxprec.h - .\vc_mswunivuddll\adv\ - ..\..\lib\vc_dll\wxmswuniv28ud_adv_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;_UNICODE;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_ADV;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_adv.tlb - true - - - 0x0409 - ..\..\lib\vc_dll\mswunivud;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - _DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;_UNICODE;WXBUILDING;WXDLLNAME=wxmswuniv28ud_adv_vc_custom;WXUSINGDLL;WXMAKINGDLL_ADV;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_adv.bsc - - - true - true - true - Console - ..\..\lib\vc_dll\wxmswuniv28ud_adv_vc_custom.dll - ..\..\lib\vc_dll\wxmswuniv28ud_adv.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxtiffd.lib;wxjpegd.lib;wxpngd.lib;wxzlibd.lib;wxregexud.lib;wxexpatd.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxmswuniv28ud_core.lib;..\..\lib\vc_dll\wxbase28ud.lib;%(AdditionalDependencies) - - - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - - - true - true - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - true - true - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - true - true - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - true - true - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - true - true - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - true - true - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - true - true - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - true - true - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - - - - - copy "%(FullPath)" ..\..\lib\vc_dll\mswu\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_dll\mswu\wx\setup.h - Creating ..\..\lib\vc_dll\mswu\wx\setup.h - Creating ..\..\lib\vc_dll\mswu\wx\setup.h - ..\..\lib\vc_dll\mswu\wx\setup.h;%(Outputs) - ..\..\lib\vc_dll\mswu\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_dll\msw\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_dll\msw\wx\setup.h - Creating ..\..\lib\vc_dll\msw\wx\setup.h - Creating ..\..\lib\vc_dll\msw\wx\setup.h - ..\..\lib\vc_dll\msw\wx\setup.h;%(Outputs) - ..\..\lib\vc_dll\msw\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_lib\msw\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_lib\msw\wx\setup.h - Creating ..\..\lib\vc_lib\msw\wx\setup.h - Creating ..\..\lib\vc_lib\msw\wx\setup.h - ..\..\lib\vc_lib\msw\wx\setup.h;%(Outputs) - ..\..\lib\vc_lib\msw\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_dll\mswud\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_dll\mswud\wx\setup.h - Creating ..\..\lib\vc_dll\mswud\wx\setup.h - Creating ..\..\lib\vc_dll\mswud\wx\setup.h - ..\..\lib\vc_dll\mswud\wx\setup.h;%(Outputs) - ..\..\lib\vc_dll\mswud\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_lib\mswd\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_lib\mswd\wx\setup.h - Creating ..\..\lib\vc_lib\mswd\wx\setup.h - Creating ..\..\lib\vc_lib\mswd\wx\setup.h - ..\..\lib\vc_lib\mswd\wx\setup.h;%(Outputs) - ..\..\lib\vc_lib\mswd\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_lib\mswu\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_lib\mswu\wx\setup.h - Creating ..\..\lib\vc_lib\mswu\wx\setup.h - Creating ..\..\lib\vc_lib\mswu\wx\setup.h - ..\..\lib\vc_lib\mswu\wx\setup.h;%(Outputs) - ..\..\lib\vc_lib\mswu\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_lib\mswud\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_lib\mswud\wx\setup.h - Creating ..\..\lib\vc_lib\mswud\wx\setup.h - Creating ..\..\lib\vc_lib\mswud\wx\setup.h - ..\..\lib\vc_lib\mswud\wx\setup.h;%(Outputs) - ..\..\lib\vc_lib\mswud\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_dll\mswd\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_dll\mswd\wx\setup.h - Creating ..\..\lib\vc_dll\mswd\wx\setup.h - Creating ..\..\lib\vc_dll\mswd\wx\setup.h - ..\..\lib\vc_dll\mswd\wx\setup.h;%(Outputs) - ..\..\lib\vc_dll\mswd\wx\setup.h;%(Outputs) - - - copy "%(FullPath)" ..\..\lib\vc_lib\mswuniv\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_lib\mswuniv\wx\setup.h - Creating ..\..\lib\vc_lib\mswuniv\wx\setup.h - Creating ..\..\lib\vc_lib\mswuniv\wx\setup.h - ..\..\lib\vc_lib\mswuniv\wx\setup.h;%(Outputs) - ..\..\lib\vc_lib\mswuniv\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_dll\mswunivd\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_dll\mswunivd\wx\setup.h - Creating ..\..\lib\vc_dll\mswunivd\wx\setup.h - Creating ..\..\lib\vc_dll\mswunivd\wx\setup.h - ..\..\lib\vc_dll\mswunivd\wx\setup.h;%(Outputs) - ..\..\lib\vc_dll\mswunivd\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_dll\mswuniv\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_dll\mswuniv\wx\setup.h - Creating ..\..\lib\vc_dll\mswuniv\wx\setup.h - Creating ..\..\lib\vc_dll\mswuniv\wx\setup.h - ..\..\lib\vc_dll\mswuniv\wx\setup.h;%(Outputs) - ..\..\lib\vc_dll\mswuniv\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_lib\mswunivud\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_lib\mswunivud\wx\setup.h - Creating ..\..\lib\vc_lib\mswunivud\wx\setup.h - Creating ..\..\lib\vc_lib\mswunivud\wx\setup.h - ..\..\lib\vc_lib\mswunivud\wx\setup.h;%(Outputs) - ..\..\lib\vc_lib\mswunivud\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_lib\mswunivd\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_lib\mswunivd\wx\setup.h - Creating ..\..\lib\vc_lib\mswunivd\wx\setup.h - Creating ..\..\lib\vc_lib\mswunivd\wx\setup.h - ..\..\lib\vc_lib\mswunivd\wx\setup.h;%(Outputs) - ..\..\lib\vc_lib\mswunivd\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_lib\mswunivu\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_lib\mswunivu\wx\setup.h - Creating ..\..\lib\vc_lib\mswunivu\wx\setup.h - Creating ..\..\lib\vc_lib\mswunivu\wx\setup.h - ..\..\lib\vc_lib\mswunivu\wx\setup.h;%(Outputs) - ..\..\lib\vc_lib\mswunivu\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_dll\mswunivu\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_dll\mswunivu\wx\setup.h - Creating ..\..\lib\vc_dll\mswunivu\wx\setup.h - Creating ..\..\lib\vc_dll\mswunivu\wx\setup.h - ..\..\lib\vc_dll\mswunivu\wx\setup.h;%(Outputs) - ..\..\lib\vc_dll\mswunivu\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_dll\mswunivud\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_dll\mswunivud\wx\setup.h - Creating ..\..\lib\vc_dll\mswunivud\wx\setup.h - Creating ..\..\lib\vc_dll\mswunivud\wx\setup.h - ..\..\lib\vc_dll\mswunivud\wx\setup.h;%(Outputs) - ..\..\lib\vc_dll\mswunivud\wx\setup.h;%(Outputs) - - - - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswuniv\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswuniv\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_lib\mswuniv\wx\msw\rcdefs.h - Creating ..\..\lib\vc_lib\mswuniv\wx\msw\rcdefs.h - ..\..\lib\vc_lib\mswuniv\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_lib\mswuniv\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswu\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswu\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_dll\mswu\wx\msw\rcdefs.h - Creating ..\..\lib\vc_dll\mswu\wx\msw\rcdefs.h - ..\..\lib\vc_dll\mswu\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_dll\mswu\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswunivd\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswunivd\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_dll\mswunivd\wx\msw\rcdefs.h - Creating ..\..\lib\vc_dll\mswunivd\wx\msw\rcdefs.h - ..\..\lib\vc_dll\mswunivd\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_dll\mswunivd\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\msw\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\msw\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_dll\msw\wx\msw\rcdefs.h - Creating ..\..\lib\vc_dll\msw\wx\msw\rcdefs.h - ..\..\lib\vc_dll\msw\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_dll\msw\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\msw\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\msw\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_lib\msw\wx\msw\rcdefs.h - Creating ..\..\lib\vc_lib\msw\wx\msw\rcdefs.h - ..\..\lib\vc_lib\msw\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_lib\msw\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswud\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswud\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_dll\mswud\wx\msw\rcdefs.h - Creating ..\..\lib\vc_dll\mswud\wx\msw\rcdefs.h - ..\..\lib\vc_dll\mswud\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_dll\mswud\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswuniv\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswuniv\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_dll\mswuniv\wx\msw\rcdefs.h - Creating ..\..\lib\vc_dll\mswuniv\wx\msw\rcdefs.h - ..\..\lib\vc_dll\mswuniv\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_dll\mswuniv\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswunivud\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswunivud\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_lib\mswunivud\wx\msw\rcdefs.h - Creating ..\..\lib\vc_lib\mswunivud\wx\msw\rcdefs.h - ..\..\lib\vc_lib\mswunivud\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_lib\mswunivud\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswd\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswd\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_lib\mswd\wx\msw\rcdefs.h - Creating ..\..\lib\vc_lib\mswd\wx\msw\rcdefs.h - ..\..\lib\vc_lib\mswd\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_lib\mswd\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswu\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswu\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_lib\mswu\wx\msw\rcdefs.h - Creating ..\..\lib\vc_lib\mswu\wx\msw\rcdefs.h - ..\..\lib\vc_lib\mswu\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_lib\mswu\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswunivd\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswunivd\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_lib\mswunivd\wx\msw\rcdefs.h - Creating ..\..\lib\vc_lib\mswunivd\wx\msw\rcdefs.h - ..\..\lib\vc_lib\mswunivd\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_lib\mswunivd\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswud\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswud\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_lib\mswud\wx\msw\rcdefs.h - Creating ..\..\lib\vc_lib\mswud\wx\msw\rcdefs.h - ..\..\lib\vc_lib\mswud\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_lib\mswud\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswunivu\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswunivu\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_lib\mswunivu\wx\msw\rcdefs.h - Creating ..\..\lib\vc_lib\mswunivu\wx\msw\rcdefs.h - ..\..\lib\vc_lib\mswunivu\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_lib\mswunivu\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswunivu\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswunivu\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_dll\mswunivu\wx\msw\rcdefs.h - Creating ..\..\lib\vc_dll\mswunivu\wx\msw\rcdefs.h - ..\..\lib\vc_dll\mswunivu\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_dll\mswunivu\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswd\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswd\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_dll\mswd\wx\msw\rcdefs.h - Creating ..\..\lib\vc_dll\mswd\wx\msw\rcdefs.h - ..\..\lib\vc_dll\mswd\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_dll\mswd\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswunivud\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswunivud\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_dll\mswunivud\wx\msw\rcdefs.h - Creating ..\..\lib\vc_dll\mswunivud\wx\msw\rcdefs.h - ..\..\lib\vc_dll\mswunivud\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_dll\mswunivud\wx\msw\rcdefs.h;%(Outputs) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/wxWidgets/build/msw/wx_adv.vcxproj.filters b/wxWidgets/build/msw/wx_adv.vcxproj.filters deleted file mode 100644 index b6e398d9a9..0000000000 --- a/wxWidgets/build/msw/wx_adv.vcxproj.filters +++ /dev/null @@ -1,250 +0,0 @@ - - - - - {6826e769-5784-453f-ac2d-103dd2f914e0} - - - {14c72ea6-534f-4a4b-a2b9-8c03fcbcc8ed} - - - {e7f2ee27-1be7-4506-80d3-4220641ade46} - - - {cbb52b26-4d02-437b-bc8e-cd8f883624a0} - - - {982c2c65-a317-4cfa-bc70-a109372bdc9d} - - - {6a83b727-2d93-4155-9044-f3b76e14ab79} - - - {0e3f2ed8-62c0-4d64-ab73-40db7b43758c} - - - - - Common Sources - - - Common Sources - - - Common Sources - - - Common Sources - - - MSW Sources - - - MSW Sources - - - MSW Sources - - - MSW Sources - - - MSW Sources - - - Generic Sources - - - Generic Sources - - - Generic Sources - - - Generic Sources - - - Generic Sources - - - Generic Sources - - - Generic Sources - - - Generic Sources - - - Generic Sources - - - Generic Sources - - - Generic Sources - - - Generic Sources - - - Generic Sources - - - Generic Sources - - - Generic Sources - - - Generic Sources - - - Generic Sources - - - Generic Sources - - - - - MSW Sources - - - - - MSW Headers - - - MSW Headers - - - MSW Headers - - - MSW Headers - - - Generic Headers - - - Generic Headers - - - Generic Headers - - - Generic Headers - - - Generic Headers - - - Generic Headers - - - Generic Headers - - - Generic Headers - - - Generic Headers - - - Generic Headers - - - Generic Headers - - - Generic Headers - - - Generic Headers - - - Generic Headers - - - Generic Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - - - Setup Headers - - - Setup Headers - - - MSW Headers - - - \ No newline at end of file diff --git a/wxWidgets/build/msw/wx_aui.vcxproj b/wxWidgets/build/msw/wx_aui.vcxproj deleted file mode 100644 index 0ecdce4880..0000000000 --- a/wxWidgets/build/msw/wx_aui.vcxproj +++ /dev/null @@ -1,2420 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - DLL Debug - Win32 - - - DLL Debug - x64 - - - DLL Release - Win32 - - - DLL Release - x64 - - - DLL Unicode Debug - Win32 - - - DLL Unicode Debug - x64 - - - DLL Unicode Release - Win32 - - - DLL Unicode Release - x64 - - - DLL Universal Debug - Win32 - - - DLL Universal Debug - x64 - - - DLL Universal Release - Win32 - - - DLL Universal Release - x64 - - - DLL Universal Unicode Debug - Win32 - - - DLL Universal Unicode Debug - x64 - - - DLL Universal Unicode Release - Win32 - - - DLL Universal Unicode Release - x64 - - - Release - Win32 - - - Release - x64 - - - Template - Win32 - - - Template - x64 - - - Unicode Debug - Win32 - - - Unicode Debug - x64 - - - Unicode Release - Win32 - - - Unicode Release - x64 - - - Universal Debug - Win32 - - - Universal Debug - x64 - - - Universal Release - Win32 - - - Universal Release - x64 - - - Universal Unicode Debug - Win32 - - - Universal Unicode Debug - x64 - - - Universal Unicode Release - Win32 - - - Universal Unicode Release - x64 - - - - aui - - - {7047EE97-7F80-A70D-6147-BC11102DB6F4} - - - - Application - v110 - - - Application - v110 - - - DynamicLibrary - false - Unicode - v110 - - - DynamicLibrary - false - Unicode - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - DynamicLibrary - false - v110 - - - DynamicLibrary - false - v110 - - - DynamicLibrary - false - Unicode - v110 - - - DynamicLibrary - false - Unicode - v110 - - - StaticLibrary - false - Unicode - v110 - - - StaticLibrary - false - Unicode - v110 - - - StaticLibrary - false - Unicode - v110 - - - StaticLibrary - false - Unicode - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - Unicode - v110 - - - StaticLibrary - false - Unicode - v110 - - - StaticLibrary - false - Unicode - v110 - - - StaticLibrary - false - Unicode - v110 - - - DynamicLibrary - false - v110 - - - DynamicLibrary - false - v110 - - - DynamicLibrary - false - Unicode - v110 - - - DynamicLibrary - false - Unicode - v110 - - - DynamicLibrary - false - v110 - - - DynamicLibrary - false - v110 - - - DynamicLibrary - false - v110 - - - DynamicLibrary - false - v110 - - - DynamicLibrary - false - Unicode - v110 - - - DynamicLibrary - false - Unicode - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - .\..\..\lib\vc_lib\ - .\vc_mswuniv\aui\ - - - .\..\..\lib\vc_lib\ - .\vc_mswuniv\aui\ - - - .\..\..\lib\vc_dll\ - .\vc_mswudll\aui\ - false - - - .\..\..\lib\vc_dll\ - .\vc_mswudll\aui\ - false - - - .\..\..\lib\vc_dll\ - .\vc_mswunivddll\aui\ - true - - - .\..\..\lib\vc_dll\ - .\vc_mswunivddll\aui\ - true - - - .\..\..\lib\vc_dll\ - .\vc_mswdll\aui\ - false - - - .\..\..\lib\vc_dll\ - .\vc_mswdll\aui\ - false - - - .\..\..\lib\vc_dll\ - .\vc_mswuddll\aui\ - true - - - .\..\..\lib\vc_dll\ - .\vc_mswuddll\aui\ - true - - - .\..\..\lib\vc_dll\ - .\vc_mswunivdll\aui\ - false - - - .\..\..\lib\vc_dll\ - .\vc_mswunivdll\aui\ - false - - - .\..\..\lib\vc_lib\ - .\vc_mswunivud\aui\ - - - .\..\..\lib\vc_lib\ - .\vc_mswunivud\aui\ - - - .\..\..\lib\vc_lib\ - .\vc_mswu\aui\ - - - .\..\..\lib\vc_lib\ - .\vc_mswu\aui\ - - - .\..\..\lib\vc_lib\ - .\vc_mswunivd\aui\ - - - .\..\..\lib\vc_lib\ - .\vc_mswunivd\aui\ - - - .\..\..\lib\vc_lib\ - .\vc_mswud\aui\ - - - .\..\..\lib\vc_lib\ - .\vc_mswud\aui\ - - - .\..\..\lib\vc_lib\ - .\vc_mswunivu\aui\ - - - .\..\..\lib\vc_lib\ - .\vc_mswunivu\aui\ - - - .\..\..\lib\vc_dll\ - .\vc_mswunivudll\aui\ - false - - - .\..\..\lib\vc_dll\ - .\vc_mswunivudll\aui\ - false - - - .\..\..\lib\vc_dll\ - .\vc_mswddll\aui\ - true - - - .\..\..\lib\vc_dll\ - .\vc_mswddll\aui\ - true - - - .\..\..\..\libs\$(Configuration) - .\vc_mswd\aui\ - - - .\..\..\..\libs\$(Configuration) - .\vc_mswd\aui\ - - - .\..\..\..\libs\$(Configuration) - .\vc_msw\aui\ - - - .\..\..\..\libs\$(Configuration) - .\vc_msw\aui\ - - - .\..\..\lib\vc_dll\ - .\vc_mswunivuddll\aui\ - true - - - .\..\..\lib\vc_dll\ - .\vc_mswunivuddll\aui\ - true - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_lib\mswuniv;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;__WXMSW__;__WXUNIVERSAL__;NDEBUG;WXBUILDING;%(PreprocessorDefinitions) - .\vc_mswuniv\aui\ - vc_mswuniv\wxprec_auilib.pch - Use - wx/wxprec.h - .\vc_mswuniv\aui\ - ..\..\lib\vc_lib\wxmswuniv28_aui.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_aui.bsc - - - true - ..\..\lib\vc_lib\wxmswuniv28_aui.lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_lib\mswuniv;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;__WXMSW__;__WXUNIVERSAL__;NDEBUG;WXBUILDING;%(PreprocessorDefinitions) - .\vc_mswuniv\aui\ - vc_mswuniv\wxprec_auilib.pch - Use - wx/wxprec.h - .\vc_mswuniv\aui\ - ..\..\lib\vc_lib\wxmswuniv28_aui.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_aui.bsc - - - true - ..\..\lib\vc_lib\wxmswuniv28_aui.lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_dll\mswu;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;NDEBUG;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_AUI;%(PreprocessorDefinitions) - .\vc_mswudll\aui\ - vc_mswudll\wxprec_auidll.pch - Use - wx/wxprec.h - .\vc_mswudll\aui\ - ..\..\lib\vc_dll\wxmsw28u_aui_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;NDEBUG;_UNICODE;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_AUI;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_aui.tlb - true - Win32 - - - 0x0409 - ..\..\lib\vc_dll\mswu;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - __WXMSW__;NDEBUG;_UNICODE;WXBUILDING;WXDLLNAME=wxmsw28u_aui_vc_custom;WXUSINGDLL;WXMAKINGDLL_AUI;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_aui.bsc - - - true - true - Console - ..\..\lib\vc_dll\wxmsw28u_aui_vc_custom.dll - ..\..\lib\vc_dll\wxmsw28u_aui.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxtiff.lib;wxjpeg.lib;wxpng.lib;wxzlib.lib;wxregexu.lib;wxexpat.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxmsw28u_adv.lib;..\..\lib\vc_dll\wxmsw28u_core.lib;..\..\lib\vc_dll\wxbase28u.lib;%(AdditionalDependencies) - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_dll\mswu;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;NDEBUG;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_AUI;%(PreprocessorDefinitions) - .\vc_mswudll\aui\ - vc_mswudll\wxprec_auidll.pch - Use - wx/wxprec.h - .\vc_mswudll\aui\ - ..\..\lib\vc_dll\wxmsw28u_aui_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;NDEBUG;_UNICODE;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_AUI;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_aui.tlb - true - - - 0x0409 - ..\..\lib\vc_dll\mswu;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - __WXMSW__;NDEBUG;_UNICODE;WXBUILDING;WXDLLNAME=wxmsw28u_aui_vc_custom;WXUSINGDLL;WXMAKINGDLL_AUI;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_aui.bsc - - - true - true - Console - ..\..\lib\vc_dll\wxmsw28u_aui_vc_custom.dll - ..\..\lib\vc_dll\wxmsw28u_aui.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxtiff.lib;wxjpeg.lib;wxpng.lib;wxzlib.lib;wxregexu.lib;wxexpat.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxmsw28u_adv.lib;..\..\lib\vc_dll\wxmsw28u_core.lib;..\..\lib\vc_dll\wxbase28u.lib;%(AdditionalDependencies) - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - true - ..\..\lib\vc_dll\mswunivd;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_AUI;%(PreprocessorDefinitions) - .\vc_mswunivddll\aui\ - vc_mswunivddll\wxprec_auidll.pch - Use - wx/wxprec.h - .\vc_mswunivddll\aui\ - ..\..\lib\vc_dll\wxmswuniv28d_aui_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_AUI;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_aui.tlb - true - Win32 - - - 0x0409 - ..\..\lib\vc_dll\mswunivd;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - _DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;WXBUILDING;WXDLLNAME=wxmswuniv28d_aui_vc_custom;WXUSINGDLL;WXMAKINGDLL_AUI;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_aui.bsc - - - true - true - true - Console - ..\..\lib\vc_dll\wxmswuniv28d_aui_vc_custom.dll - ..\..\lib\vc_dll\wxmswuniv28d_aui.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxtiffd.lib;wxjpegd.lib;wxpngd.lib;wxzlibd.lib;wxregexd.lib;wxexpatd.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxmswuniv28d_adv.lib;..\..\lib\vc_dll\wxmswuniv28d_core.lib;..\..\lib\vc_dll\wxbase28d.lib;%(AdditionalDependencies) - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - ..\..\lib\vc_dll\mswunivd;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_AUI;%(PreprocessorDefinitions) - .\vc_mswunivddll\aui\ - vc_mswunivddll\wxprec_auidll.pch - Use - wx/wxprec.h - .\vc_mswunivddll\aui\ - ..\..\lib\vc_dll\wxmswuniv28d_aui_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_AUI;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_aui.tlb - true - - - 0x0409 - ..\..\lib\vc_dll\mswunivd;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - _DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;WXBUILDING;WXDLLNAME=wxmswuniv28d_aui_vc_custom;WXUSINGDLL;WXMAKINGDLL_AUI;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_aui.bsc - - - true - true - true - Console - ..\..\lib\vc_dll\wxmswuniv28d_aui_vc_custom.dll - ..\..\lib\vc_dll\wxmswuniv28d_aui.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxtiffd.lib;wxjpegd.lib;wxpngd.lib;wxzlibd.lib;wxregexd.lib;wxexpatd.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxmswuniv28d_adv.lib;..\..\lib\vc_dll\wxmswuniv28d_core.lib;..\..\lib\vc_dll\wxbase28d.lib;%(AdditionalDependencies) - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_dll\msw;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;NDEBUG;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_AUI;%(PreprocessorDefinitions) - .\vc_mswdll\aui\ - vc_mswdll\wxprec_auidll.pch - Use - wx/wxprec.h - .\vc_mswdll\aui\ - ..\..\lib\vc_dll\wxmsw28_aui_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;NDEBUG;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_AUI;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_aui.tlb - true - Win32 - - - 0x0409 - ..\..\lib\vc_dll\msw;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - __WXMSW__;NDEBUG;WXBUILDING;WXDLLNAME=wxmsw28_aui_vc_custom;WXUSINGDLL;WXMAKINGDLL_AUI;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_aui.bsc - - - true - true - Console - ..\..\lib\vc_dll\wxmsw28_aui_vc_custom.dll - ..\..\lib\vc_dll\wxmsw28_aui.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxtiff.lib;wxjpeg.lib;wxpng.lib;wxzlib.lib;wxregex.lib;wxexpat.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxmsw28_adv.lib;..\..\lib\vc_dll\wxmsw28_core.lib;..\..\lib\vc_dll\wxbase28.lib;%(AdditionalDependencies) - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_dll\msw;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;NDEBUG;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_AUI;%(PreprocessorDefinitions) - .\vc_mswdll\aui\ - vc_mswdll\wxprec_auidll.pch - Use - wx/wxprec.h - .\vc_mswdll\aui\ - ..\..\lib\vc_dll\wxmsw28_aui_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;NDEBUG;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_AUI;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_aui.tlb - true - - - 0x0409 - ..\..\lib\vc_dll\msw;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - __WXMSW__;NDEBUG;WXBUILDING;WXDLLNAME=wxmsw28_aui_vc_custom;WXUSINGDLL;WXMAKINGDLL_AUI;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_aui.bsc - - - true - true - Console - ..\..\lib\vc_dll\wxmsw28_aui_vc_custom.dll - ..\..\lib\vc_dll\wxmsw28_aui.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxtiff.lib;wxjpeg.lib;wxpng.lib;wxzlib.lib;wxregex.lib;wxexpat.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxmsw28_adv.lib;..\..\lib\vc_dll\wxmsw28_core.lib;..\..\lib\vc_dll\wxbase28.lib;%(AdditionalDependencies) - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - true - ..\..\lib\vc_dll\mswud;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXDEBUG__;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_AUI;%(PreprocessorDefinitions) - .\vc_mswuddll\aui\ - vc_mswuddll\wxprec_auidll.pch - Use - wx/wxprec.h - .\vc_mswuddll\aui\ - ..\..\lib\vc_dll\wxmsw28ud_aui_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXDEBUG__;_UNICODE;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_AUI;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_aui.tlb - true - Win32 - - - 0x0409 - ..\..\lib\vc_dll\mswud;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - _DEBUG;__WXMSW__;__WXDEBUG__;_UNICODE;WXBUILDING;WXDLLNAME=wxmsw28ud_aui_vc_custom;WXUSINGDLL;WXMAKINGDLL_AUI;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_aui.bsc - - - true - true - true - Console - ..\..\lib\vc_dll\wxmsw28ud_aui_vc_custom.dll - ..\..\lib\vc_dll\wxmsw28ud_aui.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxtiffd.lib;wxjpegd.lib;wxpngd.lib;wxzlibd.lib;wxregexud.lib;wxexpatd.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxmsw28ud_adv.lib;..\..\lib\vc_dll\wxmsw28ud_core.lib;..\..\lib\vc_dll\wxbase28ud.lib;%(AdditionalDependencies) - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - ..\..\lib\vc_dll\mswud;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXDEBUG__;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_AUI;%(PreprocessorDefinitions) - .\vc_mswuddll\aui\ - vc_mswuddll\wxprec_auidll.pch - Use - wx/wxprec.h - .\vc_mswuddll\aui\ - ..\..\lib\vc_dll\wxmsw28ud_aui_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXDEBUG__;_UNICODE;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_AUI;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_aui.tlb - true - - - 0x0409 - ..\..\lib\vc_dll\mswud;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - _DEBUG;__WXMSW__;__WXDEBUG__;_UNICODE;WXBUILDING;WXDLLNAME=wxmsw28ud_aui_vc_custom;WXUSINGDLL;WXMAKINGDLL_AUI;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_aui.bsc - - - true - true - true - Console - ..\..\lib\vc_dll\wxmsw28ud_aui_vc_custom.dll - ..\..\lib\vc_dll\wxmsw28ud_aui.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxtiffd.lib;wxjpegd.lib;wxpngd.lib;wxzlibd.lib;wxregexud.lib;wxexpatd.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxmsw28ud_adv.lib;..\..\lib\vc_dll\wxmsw28ud_core.lib;..\..\lib\vc_dll\wxbase28ud.lib;%(AdditionalDependencies) - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_dll\mswuniv;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;__WXUNIVERSAL__;NDEBUG;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_AUI;%(PreprocessorDefinitions) - .\vc_mswunivdll\aui\ - vc_mswunivdll\wxprec_auidll.pch - Use - wx/wxprec.h - .\vc_mswunivdll\aui\ - ..\..\lib\vc_dll\wxmswuniv28_aui_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;__WXUNIVERSAL__;NDEBUG;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_AUI;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_aui.tlb - true - Win32 - - - 0x0409 - ..\..\lib\vc_dll\mswuniv;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - __WXMSW__;__WXUNIVERSAL__;NDEBUG;WXBUILDING;WXDLLNAME=wxmswuniv28_aui_vc_custom;WXUSINGDLL;WXMAKINGDLL_AUI;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_aui.bsc - - - true - true - Console - ..\..\lib\vc_dll\wxmswuniv28_aui_vc_custom.dll - ..\..\lib\vc_dll\wxmswuniv28_aui.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxtiff.lib;wxjpeg.lib;wxpng.lib;wxzlib.lib;wxregex.lib;wxexpat.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxmswuniv28_adv.lib;..\..\lib\vc_dll\wxmswuniv28_core.lib;..\..\lib\vc_dll\wxbase28.lib;%(AdditionalDependencies) - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_dll\mswuniv;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;__WXUNIVERSAL__;NDEBUG;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_AUI;%(PreprocessorDefinitions) - .\vc_mswunivdll\aui\ - vc_mswunivdll\wxprec_auidll.pch - Use - wx/wxprec.h - .\vc_mswunivdll\aui\ - ..\..\lib\vc_dll\wxmswuniv28_aui_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;__WXUNIVERSAL__;NDEBUG;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_AUI;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_aui.tlb - true - - - 0x0409 - ..\..\lib\vc_dll\mswuniv;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - __WXMSW__;__WXUNIVERSAL__;NDEBUG;WXBUILDING;WXDLLNAME=wxmswuniv28_aui_vc_custom;WXUSINGDLL;WXMAKINGDLL_AUI;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_aui.bsc - - - true - true - Console - ..\..\lib\vc_dll\wxmswuniv28_aui_vc_custom.dll - ..\..\lib\vc_dll\wxmswuniv28_aui.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxtiff.lib;wxjpeg.lib;wxpng.lib;wxzlib.lib;wxregex.lib;wxexpat.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxmswuniv28_adv.lib;..\..\lib\vc_dll\wxmswuniv28_core.lib;..\..\lib\vc_dll\wxbase28.lib;%(AdditionalDependencies) - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - true - ..\..\lib\vc_lib\mswunivud;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;WXBUILDING;%(PreprocessorDefinitions) - .\vc_mswunivud\aui\ - vc_mswunivud\wxprec_auilib.pch - Use - wx/wxprec.h - .\vc_mswunivud\aui\ - ..\..\lib\vc_lib\wxmswuniv28ud_aui.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_aui.bsc - - - true - ..\..\lib\vc_lib\wxmswuniv28ud_aui.lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - ..\..\lib\vc_lib\mswunivud;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;WXBUILDING;%(PreprocessorDefinitions) - .\vc_mswunivud\aui\ - vc_mswunivud\wxprec_auilib.pch - Use - wx/wxprec.h - .\vc_mswunivud\aui\ - ..\..\lib\vc_lib\wxmswuniv28ud_aui.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_aui.bsc - - - true - ..\..\lib\vc_lib\wxmswuniv28ud_aui.lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_lib\mswu;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;__WXMSW__;NDEBUG;WXBUILDING;%(PreprocessorDefinitions) - .\vc_mswu\aui\ - vc_mswu\wxprec_auilib.pch - Use - wx/wxprec.h - .\vc_mswu\aui\ - ..\..\lib\vc_lib\wxmsw28u_aui.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_aui.bsc - - - true - ..\..\lib\vc_lib\wxmsw28u_aui.lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_lib\mswu;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;__WXMSW__;NDEBUG;WXBUILDING;%(PreprocessorDefinitions) - .\vc_mswu\aui\ - vc_mswu\wxprec_auilib.pch - Use - wx/wxprec.h - .\vc_mswu\aui\ - ..\..\lib\vc_lib\wxmsw28u_aui.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_aui.bsc - - - true - ..\..\lib\vc_lib\wxmsw28u_aui.lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - true - ..\..\lib\vc_lib\mswunivd;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;WXBUILDING;%(PreprocessorDefinitions) - .\vc_mswunivd\aui\ - vc_mswunivd\wxprec_auilib.pch - Use - wx/wxprec.h - .\vc_mswunivd\aui\ - ..\..\lib\vc_lib\wxmswuniv28d_aui.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_aui.bsc - - - true - ..\..\lib\vc_lib\wxmswuniv28d_aui.lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - ..\..\lib\vc_lib\mswunivd;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;WXBUILDING;%(PreprocessorDefinitions) - .\vc_mswunivd\aui\ - vc_mswunivd\wxprec_auilib.pch - Use - wx/wxprec.h - .\vc_mswunivd\aui\ - ..\..\lib\vc_lib\wxmswuniv28d_aui.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_aui.bsc - - - true - ..\..\lib\vc_lib\wxmswuniv28d_aui.lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - true - ..\..\lib\vc_lib\mswud;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;__WXMSW__;__WXDEBUG__;WXBUILDING;%(PreprocessorDefinitions) - .\vc_mswud\aui\ - vc_mswud\wxprec_auilib.pch - Use - wx/wxprec.h - .\vc_mswud\aui\ - ..\..\lib\vc_lib\wxmsw28ud_aui.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_aui.bsc - - - true - ..\..\lib\vc_lib\wxmsw28ud_aui.lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - ..\..\lib\vc_lib\mswud;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;__WXMSW__;__WXDEBUG__;WXBUILDING;%(PreprocessorDefinitions) - .\vc_mswud\aui\ - vc_mswud\wxprec_auilib.pch - Use - wx/wxprec.h - .\vc_mswud\aui\ - ..\..\lib\vc_lib\wxmsw28ud_aui.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_aui.bsc - - - true - ..\..\lib\vc_lib\wxmsw28ud_aui.lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_lib\mswunivu;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;__WXMSW__;__WXUNIVERSAL__;NDEBUG;WXBUILDING;%(PreprocessorDefinitions) - .\vc_mswunivu\aui\ - vc_mswunivu\wxprec_auilib.pch - Use - wx/wxprec.h - .\vc_mswunivu\aui\ - ..\..\lib\vc_lib\wxmswuniv28u_aui.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_aui.bsc - - - true - ..\..\lib\vc_lib\wxmswuniv28u_aui.lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_lib\mswunivu;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;__WXMSW__;__WXUNIVERSAL__;NDEBUG;WXBUILDING;%(PreprocessorDefinitions) - .\vc_mswunivu\aui\ - vc_mswunivu\wxprec_auilib.pch - Use - wx/wxprec.h - .\vc_mswunivu\aui\ - ..\..\lib\vc_lib\wxmswuniv28u_aui.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_aui.bsc - - - true - ..\..\lib\vc_lib\wxmswuniv28u_aui.lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_dll\mswunivu;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;__WXUNIVERSAL__;NDEBUG;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_AUI;%(PreprocessorDefinitions) - .\vc_mswunivudll\aui\ - vc_mswunivudll\wxprec_auidll.pch - Use - wx/wxprec.h - .\vc_mswunivudll\aui\ - ..\..\lib\vc_dll\wxmswuniv28u_aui_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;__WXUNIVERSAL__;NDEBUG;_UNICODE;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_AUI;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_aui.tlb - true - Win32 - - - 0x0409 - ..\..\lib\vc_dll\mswunivu;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - __WXMSW__;__WXUNIVERSAL__;NDEBUG;_UNICODE;WXBUILDING;WXDLLNAME=wxmswuniv28u_aui_vc_custom;WXUSINGDLL;WXMAKINGDLL_AUI;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_aui.bsc - - - true - true - Console - ..\..\lib\vc_dll\wxmswuniv28u_aui_vc_custom.dll - ..\..\lib\vc_dll\wxmswuniv28u_aui.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxtiff.lib;wxjpeg.lib;wxpng.lib;wxzlib.lib;wxregexu.lib;wxexpat.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxmswuniv28u_adv.lib;..\..\lib\vc_dll\wxmswuniv28u_core.lib;..\..\lib\vc_dll\wxbase28u.lib;%(AdditionalDependencies) - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_dll\mswunivu;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;__WXUNIVERSAL__;NDEBUG;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_AUI;%(PreprocessorDefinitions) - .\vc_mswunivudll\aui\ - vc_mswunivudll\wxprec_auidll.pch - Use - wx/wxprec.h - .\vc_mswunivudll\aui\ - ..\..\lib\vc_dll\wxmswuniv28u_aui_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;__WXUNIVERSAL__;NDEBUG;_UNICODE;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_AUI;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_aui.tlb - true - - - 0x0409 - ..\..\lib\vc_dll\mswunivu;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - __WXMSW__;__WXUNIVERSAL__;NDEBUG;_UNICODE;WXBUILDING;WXDLLNAME=wxmswuniv28u_aui_vc_custom;WXUSINGDLL;WXMAKINGDLL_AUI;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_aui.bsc - - - true - true - Console - ..\..\lib\vc_dll\wxmswuniv28u_aui_vc_custom.dll - ..\..\lib\vc_dll\wxmswuniv28u_aui.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxtiff.lib;wxjpeg.lib;wxpng.lib;wxzlib.lib;wxregexu.lib;wxexpat.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxmswuniv28u_adv.lib;..\..\lib\vc_dll\wxmswuniv28u_core.lib;..\..\lib\vc_dll\wxbase28u.lib;%(AdditionalDependencies) - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - true - ..\..\lib\vc_dll\mswd;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXDEBUG__;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_AUI;%(PreprocessorDefinitions) - .\vc_mswddll\aui\ - vc_mswddll\wxprec_auidll.pch - Use - wx/wxprec.h - .\vc_mswddll\aui\ - ..\..\lib\vc_dll\wxmsw28d_aui_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXDEBUG__;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_AUI;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_aui.tlb - true - Win32 - - - 0x0409 - ..\..\lib\vc_dll\mswd;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - _DEBUG;__WXMSW__;__WXDEBUG__;WXBUILDING;WXDLLNAME=wxmsw28d_aui_vc_custom;WXUSINGDLL;WXMAKINGDLL_AUI;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_aui.bsc - - - true - true - true - Console - ..\..\lib\vc_dll\wxmsw28d_aui_vc_custom.dll - ..\..\lib\vc_dll\wxmsw28d_aui.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxtiffd.lib;wxjpegd.lib;wxpngd.lib;wxzlibd.lib;wxregexd.lib;wxexpatd.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxmsw28d_adv.lib;..\..\lib\vc_dll\wxmsw28d_core.lib;..\..\lib\vc_dll\wxbase28d.lib;%(AdditionalDependencies) - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - ..\..\lib\vc_dll\mswd;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXDEBUG__;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_AUI;%(PreprocessorDefinitions) - .\vc_mswddll\aui\ - vc_mswddll\wxprec_auidll.pch - Use - wx/wxprec.h - .\vc_mswddll\aui\ - ..\..\lib\vc_dll\wxmsw28d_aui_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXDEBUG__;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_AUI;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_aui.tlb - true - - - 0x0409 - ..\..\lib\vc_dll\mswd;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - _DEBUG;__WXMSW__;__WXDEBUG__;WXBUILDING;WXDLLNAME=wxmsw28d_aui_vc_custom;WXUSINGDLL;WXMAKINGDLL_AUI;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_aui.bsc - - - true - true - true - Console - ..\..\lib\vc_dll\wxmsw28d_aui_vc_custom.dll - ..\..\lib\vc_dll\wxmsw28d_aui.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxtiffd.lib;wxjpegd.lib;wxpngd.lib;wxzlibd.lib;wxregexd.lib;wxexpatd.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxmsw28d_adv.lib;..\..\lib\vc_dll\wxmsw28d_core.lib;..\..\lib\vc_dll\wxbase28d.lib;%(AdditionalDependencies) - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - true - ..\..\lib\vc_lib\mswd;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;__WXMSW__;__WXDEBUG__;WXBUILDING;%(PreprocessorDefinitions) - .\vc_mswd\aui\ - vc_mswd\wxprec_auilib.pch - Use - wx/wxprec.h - .\vc_mswd\aui\ - ..\..\lib\vc_lib\wxmsw28d_aui.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_aui.bsc - - - true - .\..\..\..\libs\$(Configuration)\$(ProjectName).lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - ..\..\lib\vc_lib\mswd;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;__WXMSW__;__WXDEBUG__;WXBUILDING;%(PreprocessorDefinitions) - .\vc_mswd\aui\ - vc_mswd\wxprec_auilib.pch - Use - wx/wxprec.h - .\vc_mswd\aui\ - ..\..\lib\vc_lib\wxmsw28d_aui.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_aui.bsc - - - true - .\..\..\..\libs\$(Configuration)\$(ProjectName).lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_lib\msw;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;__WXMSW__;NDEBUG;WXBUILDING;%(PreprocessorDefinitions) - .\vc_msw\aui\ - vc_msw\wxprec_auilib.pch - Use - wx/wxprec.h - .\vc_msw\aui\ - ..\..\lib\vc_lib\wxmsw28_aui.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_aui.bsc - - - true - .\..\..\..\libs\$(Configuration)\$(ProjectName).lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_lib\msw;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;__WXMSW__;NDEBUG;WXBUILDING;%(PreprocessorDefinitions) - .\vc_msw\aui\ - vc_msw\wxprec_auilib.pch - Use - wx/wxprec.h - .\vc_msw\aui\ - ..\..\lib\vc_lib\wxmsw28_aui.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_aui.bsc - - - true - .\..\..\..\libs\$(Configuration)\$(ProjectName).lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - true - ..\..\lib\vc_dll\mswunivud;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_AUI;%(PreprocessorDefinitions) - .\vc_mswunivuddll\aui\ - vc_mswunivuddll\wxprec_auidll.pch - Use - wx/wxprec.h - .\vc_mswunivuddll\aui\ - ..\..\lib\vc_dll\wxmswuniv28ud_aui_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;_UNICODE;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_AUI;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_aui.tlb - true - Win32 - - - 0x0409 - ..\..\lib\vc_dll\mswunivud;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - _DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;_UNICODE;WXBUILDING;WXDLLNAME=wxmswuniv28ud_aui_vc_custom;WXUSINGDLL;WXMAKINGDLL_AUI;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_aui.bsc - - - true - true - true - Console - ..\..\lib\vc_dll\wxmswuniv28ud_aui_vc_custom.dll - ..\..\lib\vc_dll\wxmswuniv28ud_aui.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxtiffd.lib;wxjpegd.lib;wxpngd.lib;wxzlibd.lib;wxregexud.lib;wxexpatd.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxmswuniv28ud_adv.lib;..\..\lib\vc_dll\wxmswuniv28ud_core.lib;..\..\lib\vc_dll\wxbase28ud.lib;%(AdditionalDependencies) - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - ..\..\lib\vc_dll\mswunivud;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_AUI;%(PreprocessorDefinitions) - .\vc_mswunivuddll\aui\ - vc_mswunivuddll\wxprec_auidll.pch - Use - wx/wxprec.h - .\vc_mswunivuddll\aui\ - ..\..\lib\vc_dll\wxmswuniv28ud_aui_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;_UNICODE;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_AUI;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_aui.tlb - true - - - 0x0409 - ..\..\lib\vc_dll\mswunivud;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - _DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;_UNICODE;WXBUILDING;WXDLLNAME=wxmswuniv28ud_aui_vc_custom;WXUSINGDLL;WXMAKINGDLL_AUI;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_aui.bsc - - - true - true - true - Console - ..\..\lib\vc_dll\wxmswuniv28ud_aui_vc_custom.dll - ..\..\lib\vc_dll\wxmswuniv28ud_aui.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxtiffd.lib;wxjpegd.lib;wxpngd.lib;wxzlibd.lib;wxregexud.lib;wxexpatd.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxmswuniv28ud_adv.lib;..\..\lib\vc_dll\wxmswuniv28ud_core.lib;..\..\lib\vc_dll\wxbase28ud.lib;%(AdditionalDependencies) - - - - - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - - - true - true - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - true - true - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - true - true - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - true - true - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - true - true - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - true - true - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - true - true - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - true - true - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - - - - - copy "%(FullPath)" ..\..\lib\vc_dll\mswu\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_dll\mswu\wx\setup.h - Creating ..\..\lib\vc_dll\mswu\wx\setup.h - Creating ..\..\lib\vc_dll\mswu\wx\setup.h - ..\..\lib\vc_dll\mswu\wx\setup.h;%(Outputs) - ..\..\lib\vc_dll\mswu\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_dll\msw\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_dll\msw\wx\setup.h - Creating ..\..\lib\vc_dll\msw\wx\setup.h - Creating ..\..\lib\vc_dll\msw\wx\setup.h - ..\..\lib\vc_dll\msw\wx\setup.h;%(Outputs) - ..\..\lib\vc_dll\msw\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_dll\mswud\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_dll\mswud\wx\setup.h - Creating ..\..\lib\vc_dll\mswud\wx\setup.h - Creating ..\..\lib\vc_dll\mswud\wx\setup.h - ..\..\lib\vc_dll\mswud\wx\setup.h;%(Outputs) - ..\..\lib\vc_dll\mswud\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_lib\mswu\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_lib\mswu\wx\setup.h - Creating ..\..\lib\vc_lib\mswu\wx\setup.h - Creating ..\..\lib\vc_lib\mswu\wx\setup.h - ..\..\lib\vc_lib\mswu\wx\setup.h;%(Outputs) - ..\..\lib\vc_lib\mswu\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_lib\mswud\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_lib\mswud\wx\setup.h - Creating ..\..\lib\vc_lib\mswud\wx\setup.h - Creating ..\..\lib\vc_lib\mswud\wx\setup.h - ..\..\lib\vc_lib\mswud\wx\setup.h;%(Outputs) - ..\..\lib\vc_lib\mswud\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_dll\mswd\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_dll\mswd\wx\setup.h - Creating ..\..\lib\vc_dll\mswd\wx\setup.h - Creating ..\..\lib\vc_dll\mswd\wx\setup.h - ..\..\lib\vc_dll\mswd\wx\setup.h;%(Outputs) - ..\..\lib\vc_dll\mswd\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_lib\mswd\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_lib\mswd\wx\setup.h - Creating ..\..\lib\vc_lib\mswd\wx\setup.h - Creating ..\..\lib\vc_lib\mswd\wx\setup.h - ..\..\lib\vc_lib\mswd\wx\setup.h;%(Outputs) - ..\..\lib\vc_lib\mswd\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_lib\msw\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_lib\msw\wx\setup.h - Creating ..\..\lib\vc_lib\msw\wx\setup.h - Creating ..\..\lib\vc_lib\msw\wx\setup.h - ..\..\lib\vc_lib\msw\wx\setup.h;%(Outputs) - ..\..\lib\vc_lib\msw\wx\setup.h;%(Outputs) - - - copy "%(FullPath)" ..\..\lib\vc_lib\mswuniv\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_lib\mswuniv\wx\setup.h - Creating ..\..\lib\vc_lib\mswuniv\wx\setup.h - Creating ..\..\lib\vc_lib\mswuniv\wx\setup.h - ..\..\lib\vc_lib\mswuniv\wx\setup.h;%(Outputs) - ..\..\lib\vc_lib\mswuniv\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_dll\mswunivd\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_dll\mswunivd\wx\setup.h - Creating ..\..\lib\vc_dll\mswunivd\wx\setup.h - Creating ..\..\lib\vc_dll\mswunivd\wx\setup.h - ..\..\lib\vc_dll\mswunivd\wx\setup.h;%(Outputs) - ..\..\lib\vc_dll\mswunivd\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_dll\mswuniv\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_dll\mswuniv\wx\setup.h - Creating ..\..\lib\vc_dll\mswuniv\wx\setup.h - Creating ..\..\lib\vc_dll\mswuniv\wx\setup.h - ..\..\lib\vc_dll\mswuniv\wx\setup.h;%(Outputs) - ..\..\lib\vc_dll\mswuniv\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_lib\mswunivud\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_lib\mswunivud\wx\setup.h - Creating ..\..\lib\vc_lib\mswunivud\wx\setup.h - Creating ..\..\lib\vc_lib\mswunivud\wx\setup.h - ..\..\lib\vc_lib\mswunivud\wx\setup.h;%(Outputs) - ..\..\lib\vc_lib\mswunivud\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_lib\mswunivd\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_lib\mswunivd\wx\setup.h - Creating ..\..\lib\vc_lib\mswunivd\wx\setup.h - Creating ..\..\lib\vc_lib\mswunivd\wx\setup.h - ..\..\lib\vc_lib\mswunivd\wx\setup.h;%(Outputs) - ..\..\lib\vc_lib\mswunivd\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_lib\mswunivu\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_lib\mswunivu\wx\setup.h - Creating ..\..\lib\vc_lib\mswunivu\wx\setup.h - Creating ..\..\lib\vc_lib\mswunivu\wx\setup.h - ..\..\lib\vc_lib\mswunivu\wx\setup.h;%(Outputs) - ..\..\lib\vc_lib\mswunivu\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_dll\mswunivu\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_dll\mswunivu\wx\setup.h - Creating ..\..\lib\vc_dll\mswunivu\wx\setup.h - Creating ..\..\lib\vc_dll\mswunivu\wx\setup.h - ..\..\lib\vc_dll\mswunivu\wx\setup.h;%(Outputs) - ..\..\lib\vc_dll\mswunivu\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_dll\mswunivud\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_dll\mswunivud\wx\setup.h - Creating ..\..\lib\vc_dll\mswunivud\wx\setup.h - Creating ..\..\lib\vc_dll\mswunivud\wx\setup.h - ..\..\lib\vc_dll\mswunivud\wx\setup.h;%(Outputs) - ..\..\lib\vc_dll\mswunivud\wx\setup.h;%(Outputs) - - - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswuniv\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswuniv\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_lib\mswuniv\wx\msw\rcdefs.h - Creating ..\..\lib\vc_lib\mswuniv\wx\msw\rcdefs.h - ..\..\lib\vc_lib\mswuniv\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_lib\mswuniv\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswu\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswu\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_dll\mswu\wx\msw\rcdefs.h - Creating ..\..\lib\vc_dll\mswu\wx\msw\rcdefs.h - ..\..\lib\vc_dll\mswu\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_dll\mswu\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswunivd\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswunivd\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_dll\mswunivd\wx\msw\rcdefs.h - Creating ..\..\lib\vc_dll\mswunivd\wx\msw\rcdefs.h - ..\..\lib\vc_dll\mswunivd\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_dll\mswunivd\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\msw\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\msw\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_dll\msw\wx\msw\rcdefs.h - Creating ..\..\lib\vc_dll\msw\wx\msw\rcdefs.h - ..\..\lib\vc_dll\msw\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_dll\msw\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswud\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswud\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_dll\mswud\wx\msw\rcdefs.h - Creating ..\..\lib\vc_dll\mswud\wx\msw\rcdefs.h - ..\..\lib\vc_dll\mswud\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_dll\mswud\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswuniv\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswuniv\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_dll\mswuniv\wx\msw\rcdefs.h - Creating ..\..\lib\vc_dll\mswuniv\wx\msw\rcdefs.h - ..\..\lib\vc_dll\mswuniv\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_dll\mswuniv\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswunivud\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswunivud\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_lib\mswunivud\wx\msw\rcdefs.h - Creating ..\..\lib\vc_lib\mswunivud\wx\msw\rcdefs.h - ..\..\lib\vc_lib\mswunivud\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_lib\mswunivud\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswu\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswu\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_lib\mswu\wx\msw\rcdefs.h - Creating ..\..\lib\vc_lib\mswu\wx\msw\rcdefs.h - ..\..\lib\vc_lib\mswu\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_lib\mswu\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswunivd\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswunivd\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_lib\mswunivd\wx\msw\rcdefs.h - Creating ..\..\lib\vc_lib\mswunivd\wx\msw\rcdefs.h - ..\..\lib\vc_lib\mswunivd\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_lib\mswunivd\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswud\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswud\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_lib\mswud\wx\msw\rcdefs.h - Creating ..\..\lib\vc_lib\mswud\wx\msw\rcdefs.h - ..\..\lib\vc_lib\mswud\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_lib\mswud\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswunivu\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswunivu\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_lib\mswunivu\wx\msw\rcdefs.h - Creating ..\..\lib\vc_lib\mswunivu\wx\msw\rcdefs.h - ..\..\lib\vc_lib\mswunivu\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_lib\mswunivu\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswunivu\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswunivu\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_dll\mswunivu\wx\msw\rcdefs.h - Creating ..\..\lib\vc_dll\mswunivu\wx\msw\rcdefs.h - ..\..\lib\vc_dll\mswunivu\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_dll\mswunivu\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswd\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswd\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_dll\mswd\wx\msw\rcdefs.h - Creating ..\..\lib\vc_dll\mswd\wx\msw\rcdefs.h - ..\..\lib\vc_dll\mswd\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_dll\mswd\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswd\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswd\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_lib\mswd\wx\msw\rcdefs.h - Creating ..\..\lib\vc_lib\mswd\wx\msw\rcdefs.h - ..\..\lib\vc_lib\mswd\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_lib\mswd\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\msw\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\msw\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_lib\msw\wx\msw\rcdefs.h - Creating ..\..\lib\vc_lib\msw\wx\msw\rcdefs.h - ..\..\lib\vc_lib\msw\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_lib\msw\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswunivud\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswunivud\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_dll\mswunivud\wx\msw\rcdefs.h - Creating ..\..\lib\vc_dll\mswunivud\wx\msw\rcdefs.h - ..\..\lib\vc_dll\mswunivud\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_dll\mswunivud\wx\msw\rcdefs.h;%(Outputs) - - - - - - - - - - - - - \ No newline at end of file diff --git a/wxWidgets/build/msw/wx_aui.vcxproj.filters b/wxWidgets/build/msw/wx_aui.vcxproj.filters deleted file mode 100644 index 4710096e48..0000000000 --- a/wxWidgets/build/msw/wx_aui.vcxproj.filters +++ /dev/null @@ -1,85 +0,0 @@ - - - - - {b142602d-0a95-45a3-b837-dcddca002552} - - - {f70ea64d-0a52-42a4-8641-d2ece3fe5e0e} - - - {a743ff29-e03d-4329-ac71-afcfec157836} - - - {f76baf16-b205-4b59-81cf-98e628ad9e12} - - - {a0c703c4-b94d-424d-be67-9072c4cd71ac} - - - {bc5219aa-aa4a-41e5-9d8a-9926baa3d676} - - - - - Common Sources - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - - - MSW Sources - - - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - - - Setup Headers - - - Setup Headers - - - MSW Headers - - - \ No newline at end of file diff --git a/wxWidgets/build/msw/wx_base.vcxproj b/wxWidgets/build/msw/wx_base.vcxproj deleted file mode 100644 index 5ebfeb4d6b..0000000000 --- a/wxWidgets/build/msw/wx_base.vcxproj +++ /dev/null @@ -1,5394 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - DLL Debug - Win32 - - - DLL Debug - x64 - - - DLL Release - Win32 - - - DLL Release - x64 - - - DLL Unicode Debug - Win32 - - - DLL Unicode Debug - x64 - - - DLL Unicode Release - Win32 - - - DLL Unicode Release - x64 - - - DLL Universal Debug - Win32 - - - DLL Universal Debug - x64 - - - DLL Universal Release - Win32 - - - DLL Universal Release - x64 - - - DLL Universal Unicode Debug - Win32 - - - DLL Universal Unicode Debug - x64 - - - DLL Universal Unicode Release - Win32 - - - DLL Universal Unicode Release - x64 - - - Release - Win32 - - - Release - x64 - - - Template - Win32 - - - Template - x64 - - - Unicode Debug - Win32 - - - Unicode Debug - x64 - - - Unicode Release - Win32 - - - Unicode Release - x64 - - - Universal Debug - Win32 - - - Universal Debug - x64 - - - Universal Release - Win32 - - - Universal Release - x64 - - - Universal Unicode Debug - Win32 - - - Universal Unicode Debug - x64 - - - Universal Unicode Release - Win32 - - - Universal Unicode Release - x64 - - - - base - - - {3111D679-7796-23C4-BA0C-271F1145DA24} - - - - Application - v110 - - - Application - v110 - - - DynamicLibrary - false - v110 - - - DynamicLibrary - false - v110 - - - StaticLibrary - false - Unicode - v110 - - - StaticLibrary - false - Unicode - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - Unicode - v110 - - - StaticLibrary - false - Unicode - v110 - - - DynamicLibrary - false - Unicode - v110 - - - DynamicLibrary - false - Unicode - v110 - - - StaticLibrary - false - Unicode - v110 - - - StaticLibrary - false - Unicode - v110 - - - DynamicLibrary - false - Unicode - v110 - - - DynamicLibrary - false - Unicode - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - DynamicLibrary - false - v110 - - - DynamicLibrary - false - v110 - - - DynamicLibrary - false - Unicode - v110 - - - DynamicLibrary - false - Unicode - v110 - - - DynamicLibrary - false - Unicode - v110 - - - DynamicLibrary - false - Unicode - v110 - - - DynamicLibrary - false - v110 - - - DynamicLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - DynamicLibrary - false - v110 - - - DynamicLibrary - false - v110 - - - StaticLibrary - false - Unicode - v110 - - - StaticLibrary - false - Unicode - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - .\..\..\lib\vc_lib\ - .\vc_mswd\base\ - - - .\..\..\lib\vc_lib\ - .\vc_mswd\base\ - - - .\..\..\lib\vc_lib\ - .\vc_mswunivu\base\ - - - .\..\..\lib\vc_lib\ - .\vc_mswunivu\base\ - - - .\..\..\lib\vc_dll\ - .\vc_mswddll\base\ - true - - - .\..\..\lib\vc_dll\ - .\vc_mswddll\base\ - true - - - .\..\..\lib\vc_lib\ - .\vc_msw\base\ - - - .\..\..\lib\vc_lib\ - .\vc_msw\base\ - - - .\..\..\lib\vc_dll\ - .\vc_mswdll\base\ - false - - - .\..\..\lib\vc_dll\ - .\vc_mswdll\base\ - false - - - .\..\..\lib\vc_dll\ - .\vc_mswunivuddll\base\ - true - - - .\..\..\lib\vc_dll\ - .\vc_mswunivuddll\base\ - true - - - .\..\..\lib\vc_dll\ - .\vc_mswunivudll\base\ - false - - - .\..\..\lib\vc_dll\ - .\vc_mswunivudll\base\ - false - - - .\..\..\lib\vc_dll\ - .\vc_mswunivdll\base\ - false - - - .\..\..\lib\vc_dll\ - .\vc_mswunivdll\base\ - false - - - .\..\..\lib\vc_lib\ - .\vc_mswuniv\base\ - - - .\..\..\lib\vc_lib\ - .\vc_mswuniv\base\ - - - .\..\..\lib\vc_dll\ - .\vc_mswudll\base\ - false - - - .\..\..\lib\vc_dll\ - .\vc_mswudll\base\ - false - - - .\..\..\lib\vc_lib\ - .\vc_mswunivud\base\ - - - .\..\..\lib\vc_lib\ - .\vc_mswunivud\base\ - - - .\..\..\lib\vc_dll\ - .\vc_mswuddll\base\ - true - - - .\..\..\lib\vc_dll\ - .\vc_mswuddll\base\ - true - - - .\..\..\lib\vc_lib\ - .\vc_mswud\base\ - - - .\..\..\lib\vc_lib\ - .\vc_mswud\base\ - - - .\..\..\lib\vc_lib\ - .\vc_mswunivd\base\ - - - .\..\..\lib\vc_lib\ - .\vc_mswunivd\base\ - - - .\..\..\lib\vc_lib\ - .\vc_mswu\base\ - - - .\..\..\lib\vc_lib\ - .\vc_mswu\base\ - - - .\..\..\lib\vc_dll\ - .\vc_mswunivddll\base\ - true - - - .\..\..\lib\vc_dll\ - .\vc_mswunivddll\base\ - true - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - true - ..\..\lib\vc_lib\mswd;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;__WXMSW__;__WXDEBUG__;WXBUILDING;wxUSE_GUI=0;wxUSE_BASE=1;%(PreprocessorDefinitions) - .\vc_mswd\base\ - vc_mswd\wxprec_baselib.pch - Use - wx/wxprec.h - .\vc_mswd\base\ - ..\..\lib\vc_lib\wxbase28d.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_base.bsc - - - true - .\..\..\..\libs\$(Configuration)\$(ProjectName).lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - ..\..\lib\vc_lib\mswd;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;__WXMSW__;__WXDEBUG__;WXBUILDING;wxUSE_GUI=0;wxUSE_BASE=1;%(PreprocessorDefinitions) - .\vc_mswd\base\ - vc_mswd\wxprec_baselib.pch - Use - wx/wxprec.h - .\vc_mswd\base\ - ..\..\lib\vc_lib\wxbase28d.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_base.bsc - - - true - .\..\..\..\libs\$(Configuration)\$(ProjectName).lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_lib\mswunivu;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;__WXMSW__;__WXUNIVERSAL__;NDEBUG;WXBUILDING;wxUSE_GUI=0;wxUSE_BASE=1;%(PreprocessorDefinitions) - .\vc_mswunivu\base\ - vc_mswunivu\wxprec_baselib.pch - Use - wx/wxprec.h - .\vc_mswunivu\base\ - ..\..\lib\vc_lib\wxbase28u.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_base.bsc - - - true - ..\..\lib\vc_lib\wxbase28u.lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_lib\mswunivu;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;__WXMSW__;__WXUNIVERSAL__;NDEBUG;WXBUILDING;wxUSE_GUI=0;wxUSE_BASE=1;%(PreprocessorDefinitions) - .\vc_mswunivu\base\ - vc_mswunivu\wxprec_baselib.pch - Use - wx/wxprec.h - .\vc_mswunivu\base\ - ..\..\lib\vc_lib\wxbase28u.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_base.bsc - - - true - ..\..\lib\vc_lib\wxbase28u.lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - true - ..\..\lib\vc_dll\mswd;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXDEBUG__;WXBUILDING;wxUSE_GUI=0;WXMAKINGDLL_BASE;wxUSE_BASE=1;%(PreprocessorDefinitions) - .\vc_mswddll\base\ - vc_mswddll\wxprec_basedll.pch - Use - wx/wxprec.h - .\vc_mswddll\base\ - ..\..\lib\vc_dll\wxbase28d_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXDEBUG__;WXBUILDING;wxUSE_GUI=0;WXMAKINGDLL_BASE;wxUSE_BASE=1;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_base.tlb - true - Win32 - - - 0x0409 - ..\..\lib\vc_dll\mswd;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - _DEBUG;__WXMSW__;__WXDEBUG__;WXBUILDING;WXDLLNAME=wxbase28d_vc_custom;wxUSE_GUI=0;WXMAKINGDLL_BASE;wxUSE_BASE=1;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_base.bsc - - - true - true - true - Console - ..\..\lib\vc_dll\wxbase28d_vc_custom.dll - ..\..\lib\vc_dll\wxbase28d.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxzlibd.lib;wxregexd.lib;wxexpatd.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;%(AdditionalDependencies) - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - ..\..\lib\vc_dll\mswd;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXDEBUG__;WXBUILDING;wxUSE_GUI=0;WXMAKINGDLL_BASE;wxUSE_BASE=1;%(PreprocessorDefinitions) - .\vc_mswddll\base\ - vc_mswddll\wxprec_basedll.pch - Use - wx/wxprec.h - .\vc_mswddll\base\ - ..\..\lib\vc_dll\wxbase28d_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXDEBUG__;WXBUILDING;wxUSE_GUI=0;WXMAKINGDLL_BASE;wxUSE_BASE=1;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_base.tlb - true - - - 0x0409 - ..\..\lib\vc_dll\mswd;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - _DEBUG;__WXMSW__;__WXDEBUG__;WXBUILDING;WXDLLNAME=wxbase28d_vc_custom;wxUSE_GUI=0;WXMAKINGDLL_BASE;wxUSE_BASE=1;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_base.bsc - - - true - true - true - Console - ..\..\lib\vc_dll\wxbase28d_vc_custom.dll - ..\..\lib\vc_dll\wxbase28d.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxzlibd.lib;wxregexd.lib;wxexpatd.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;%(AdditionalDependencies) - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_lib\msw;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;__WXMSW__;NDEBUG;WXBUILDING;wxUSE_GUI=0;wxUSE_BASE=1;%(PreprocessorDefinitions) - .\vc_msw\base\ - vc_msw\wxprec_baselib.pch - Use - wx/wxprec.h - .\vc_msw\base\ - ..\..\lib\vc_lib\wxbase28.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_base.bsc - - - true - .\..\..\..\libs\$(Configuration)\$(ProjectName).lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_lib\msw;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;__WXMSW__;NDEBUG;WXBUILDING;wxUSE_GUI=0;wxUSE_BASE=1;%(PreprocessorDefinitions) - .\vc_msw\base\ - vc_msw\wxprec_baselib.pch - Use - wx/wxprec.h - .\vc_msw\base\ - ..\..\lib\vc_lib\wxbase28.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_base.bsc - - - true - .\..\..\..\libs\$(Configuration)\$(ProjectName).lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_dll\msw;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;NDEBUG;WXBUILDING;wxUSE_GUI=0;WXMAKINGDLL_BASE;wxUSE_BASE=1;%(PreprocessorDefinitions) - .\vc_mswdll\base\ - vc_mswdll\wxprec_basedll.pch - Use - wx/wxprec.h - .\vc_mswdll\base\ - ..\..\lib\vc_dll\wxbase28_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;NDEBUG;WXBUILDING;wxUSE_GUI=0;WXMAKINGDLL_BASE;wxUSE_BASE=1;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_base.tlb - true - Win32 - - - 0x0409 - ..\..\lib\vc_dll\msw;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - __WXMSW__;NDEBUG;WXBUILDING;WXDLLNAME=wxbase28_vc_custom;wxUSE_GUI=0;WXMAKINGDLL_BASE;wxUSE_BASE=1;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_base.bsc - - - true - true - Console - ..\..\lib\vc_dll\wxbase28_vc_custom.dll - ..\..\lib\vc_dll\wxbase28.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxzlib.lib;wxregex.lib;wxexpat.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;%(AdditionalDependencies) - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_dll\msw;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;NDEBUG;WXBUILDING;wxUSE_GUI=0;WXMAKINGDLL_BASE;wxUSE_BASE=1;%(PreprocessorDefinitions) - .\vc_mswdll\base\ - vc_mswdll\wxprec_basedll.pch - Use - wx/wxprec.h - .\vc_mswdll\base\ - ..\..\lib\vc_dll\wxbase28_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;NDEBUG;WXBUILDING;wxUSE_GUI=0;WXMAKINGDLL_BASE;wxUSE_BASE=1;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_base.tlb - true - - - 0x0409 - ..\..\lib\vc_dll\msw;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - __WXMSW__;NDEBUG;WXBUILDING;WXDLLNAME=wxbase28_vc_custom;wxUSE_GUI=0;WXMAKINGDLL_BASE;wxUSE_BASE=1;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_base.bsc - - - true - true - Console - ..\..\lib\vc_dll\wxbase28_vc_custom.dll - ..\..\lib\vc_dll\wxbase28.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxzlib.lib;wxregex.lib;wxexpat.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;%(AdditionalDependencies) - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - true - ..\..\lib\vc_dll\mswunivud;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;WXBUILDING;wxUSE_GUI=0;WXMAKINGDLL_BASE;wxUSE_BASE=1;%(PreprocessorDefinitions) - .\vc_mswunivuddll\base\ - vc_mswunivuddll\wxprec_basedll.pch - Use - wx/wxprec.h - .\vc_mswunivuddll\base\ - ..\..\lib\vc_dll\wxbase28ud_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;_UNICODE;WXBUILDING;wxUSE_GUI=0;WXMAKINGDLL_BASE;wxUSE_BASE=1;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_base.tlb - true - Win32 - - - 0x0409 - ..\..\lib\vc_dll\mswunivud;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - _DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;_UNICODE;WXBUILDING;WXDLLNAME=wxbase28ud_vc_custom;wxUSE_GUI=0;WXMAKINGDLL_BASE;wxUSE_BASE=1;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_base.bsc - - - true - true - true - Console - ..\..\lib\vc_dll\wxbase28ud_vc_custom.dll - ..\..\lib\vc_dll\wxbase28ud.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxzlibd.lib;wxregexud.lib;wxexpatd.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;%(AdditionalDependencies) - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - ..\..\lib\vc_dll\mswunivud;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;WXBUILDING;wxUSE_GUI=0;WXMAKINGDLL_BASE;wxUSE_BASE=1;%(PreprocessorDefinitions) - .\vc_mswunivuddll\base\ - vc_mswunivuddll\wxprec_basedll.pch - Use - wx/wxprec.h - .\vc_mswunivuddll\base\ - ..\..\lib\vc_dll\wxbase28ud_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;_UNICODE;WXBUILDING;wxUSE_GUI=0;WXMAKINGDLL_BASE;wxUSE_BASE=1;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_base.tlb - true - - - 0x0409 - ..\..\lib\vc_dll\mswunivud;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - _DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;_UNICODE;WXBUILDING;WXDLLNAME=wxbase28ud_vc_custom;wxUSE_GUI=0;WXMAKINGDLL_BASE;wxUSE_BASE=1;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_base.bsc - - - true - true - true - Console - ..\..\lib\vc_dll\wxbase28ud_vc_custom.dll - ..\..\lib\vc_dll\wxbase28ud.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxzlibd.lib;wxregexud.lib;wxexpatd.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;%(AdditionalDependencies) - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_dll\mswunivu;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;__WXUNIVERSAL__;NDEBUG;WXBUILDING;wxUSE_GUI=0;WXMAKINGDLL_BASE;wxUSE_BASE=1;%(PreprocessorDefinitions) - .\vc_mswunivudll\base\ - vc_mswunivudll\wxprec_basedll.pch - Use - wx/wxprec.h - .\vc_mswunivudll\base\ - ..\..\lib\vc_dll\wxbase28u_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;__WXUNIVERSAL__;NDEBUG;_UNICODE;WXBUILDING;wxUSE_GUI=0;WXMAKINGDLL_BASE;wxUSE_BASE=1;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_base.tlb - true - Win32 - - - 0x0409 - ..\..\lib\vc_dll\mswunivu;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - __WXMSW__;__WXUNIVERSAL__;NDEBUG;_UNICODE;WXBUILDING;WXDLLNAME=wxbase28u_vc_custom;wxUSE_GUI=0;WXMAKINGDLL_BASE;wxUSE_BASE=1;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_base.bsc - - - true - true - Console - ..\..\lib\vc_dll\wxbase28u_vc_custom.dll - ..\..\lib\vc_dll\wxbase28u.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxzlib.lib;wxregexu.lib;wxexpat.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;%(AdditionalDependencies) - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_dll\mswunivu;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;__WXUNIVERSAL__;NDEBUG;WXBUILDING;wxUSE_GUI=0;WXMAKINGDLL_BASE;wxUSE_BASE=1;%(PreprocessorDefinitions) - .\vc_mswunivudll\base\ - vc_mswunivudll\wxprec_basedll.pch - Use - wx/wxprec.h - .\vc_mswunivudll\base\ - ..\..\lib\vc_dll\wxbase28u_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;__WXUNIVERSAL__;NDEBUG;_UNICODE;WXBUILDING;wxUSE_GUI=0;WXMAKINGDLL_BASE;wxUSE_BASE=1;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_base.tlb - true - - - 0x0409 - ..\..\lib\vc_dll\mswunivu;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - __WXMSW__;__WXUNIVERSAL__;NDEBUG;_UNICODE;WXBUILDING;WXDLLNAME=wxbase28u_vc_custom;wxUSE_GUI=0;WXMAKINGDLL_BASE;wxUSE_BASE=1;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_base.bsc - - - true - true - Console - ..\..\lib\vc_dll\wxbase28u_vc_custom.dll - ..\..\lib\vc_dll\wxbase28u.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxzlib.lib;wxregexu.lib;wxexpat.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;%(AdditionalDependencies) - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_dll\mswuniv;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;__WXUNIVERSAL__;NDEBUG;WXBUILDING;wxUSE_GUI=0;WXMAKINGDLL_BASE;wxUSE_BASE=1;%(PreprocessorDefinitions) - .\vc_mswunivdll\base\ - vc_mswunivdll\wxprec_basedll.pch - Use - wx/wxprec.h - .\vc_mswunivdll\base\ - ..\..\lib\vc_dll\wxbase28_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;__WXUNIVERSAL__;NDEBUG;WXBUILDING;wxUSE_GUI=0;WXMAKINGDLL_BASE;wxUSE_BASE=1;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_base.tlb - true - Win32 - - - 0x0409 - ..\..\lib\vc_dll\mswuniv;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - __WXMSW__;__WXUNIVERSAL__;NDEBUG;WXBUILDING;WXDLLNAME=wxbase28_vc_custom;wxUSE_GUI=0;WXMAKINGDLL_BASE;wxUSE_BASE=1;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_base.bsc - - - true - true - Console - ..\..\lib\vc_dll\wxbase28_vc_custom.dll - ..\..\lib\vc_dll\wxbase28.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxzlib.lib;wxregex.lib;wxexpat.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;%(AdditionalDependencies) - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_dll\mswuniv;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;__WXUNIVERSAL__;NDEBUG;WXBUILDING;wxUSE_GUI=0;WXMAKINGDLL_BASE;wxUSE_BASE=1;%(PreprocessorDefinitions) - .\vc_mswunivdll\base\ - vc_mswunivdll\wxprec_basedll.pch - Use - wx/wxprec.h - .\vc_mswunivdll\base\ - ..\..\lib\vc_dll\wxbase28_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;__WXUNIVERSAL__;NDEBUG;WXBUILDING;wxUSE_GUI=0;WXMAKINGDLL_BASE;wxUSE_BASE=1;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_base.tlb - true - - - 0x0409 - ..\..\lib\vc_dll\mswuniv;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - __WXMSW__;__WXUNIVERSAL__;NDEBUG;WXBUILDING;WXDLLNAME=wxbase28_vc_custom;wxUSE_GUI=0;WXMAKINGDLL_BASE;wxUSE_BASE=1;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_base.bsc - - - true - true - Console - ..\..\lib\vc_dll\wxbase28_vc_custom.dll - ..\..\lib\vc_dll\wxbase28.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxzlib.lib;wxregex.lib;wxexpat.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;%(AdditionalDependencies) - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_lib\mswuniv;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;__WXMSW__;__WXUNIVERSAL__;NDEBUG;WXBUILDING;wxUSE_GUI=0;wxUSE_BASE=1;%(PreprocessorDefinitions) - .\vc_mswuniv\base\ - vc_mswuniv\wxprec_baselib.pch - Use - wx/wxprec.h - .\vc_mswuniv\base\ - ..\..\lib\vc_lib\wxbase28.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_base.bsc - - - true - ..\..\lib\vc_lib\wxbase28.lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_lib\mswuniv;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;__WXMSW__;__WXUNIVERSAL__;NDEBUG;WXBUILDING;wxUSE_GUI=0;wxUSE_BASE=1;%(PreprocessorDefinitions) - .\vc_mswuniv\base\ - vc_mswuniv\wxprec_baselib.pch - Use - wx/wxprec.h - .\vc_mswuniv\base\ - ..\..\lib\vc_lib\wxbase28.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_base.bsc - - - true - ..\..\lib\vc_lib\wxbase28.lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_dll\mswu;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;NDEBUG;WXBUILDING;wxUSE_GUI=0;WXMAKINGDLL_BASE;wxUSE_BASE=1;%(PreprocessorDefinitions) - .\vc_mswudll\base\ - vc_mswudll\wxprec_basedll.pch - Use - wx/wxprec.h - .\vc_mswudll\base\ - ..\..\lib\vc_dll\wxbase28u_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;NDEBUG;_UNICODE;WXBUILDING;wxUSE_GUI=0;WXMAKINGDLL_BASE;wxUSE_BASE=1;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_base.tlb - true - Win32 - - - 0x0409 - ..\..\lib\vc_dll\mswu;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - __WXMSW__;NDEBUG;_UNICODE;WXBUILDING;WXDLLNAME=wxbase28u_vc_custom;wxUSE_GUI=0;WXMAKINGDLL_BASE;wxUSE_BASE=1;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_base.bsc - - - true - true - Console - ..\..\lib\vc_dll\wxbase28u_vc_custom.dll - ..\..\lib\vc_dll\wxbase28u.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxzlib.lib;wxregexu.lib;wxexpat.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;%(AdditionalDependencies) - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_dll\mswu;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;NDEBUG;WXBUILDING;wxUSE_GUI=0;WXMAKINGDLL_BASE;wxUSE_BASE=1;%(PreprocessorDefinitions) - .\vc_mswudll\base\ - vc_mswudll\wxprec_basedll.pch - Use - wx/wxprec.h - .\vc_mswudll\base\ - ..\..\lib\vc_dll\wxbase28u_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;NDEBUG;_UNICODE;WXBUILDING;wxUSE_GUI=0;WXMAKINGDLL_BASE;wxUSE_BASE=1;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_base.tlb - true - - - 0x0409 - ..\..\lib\vc_dll\mswu;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - __WXMSW__;NDEBUG;_UNICODE;WXBUILDING;WXDLLNAME=wxbase28u_vc_custom;wxUSE_GUI=0;WXMAKINGDLL_BASE;wxUSE_BASE=1;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_base.bsc - - - true - true - Console - ..\..\lib\vc_dll\wxbase28u_vc_custom.dll - ..\..\lib\vc_dll\wxbase28u.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxzlib.lib;wxregexu.lib;wxexpat.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;%(AdditionalDependencies) - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - true - ..\..\lib\vc_lib\mswunivud;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;WXBUILDING;wxUSE_GUI=0;wxUSE_BASE=1;%(PreprocessorDefinitions) - .\vc_mswunivud\base\ - vc_mswunivud\wxprec_baselib.pch - Use - wx/wxprec.h - .\vc_mswunivud\base\ - ..\..\lib\vc_lib\wxbase28ud.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_base.bsc - - - true - ..\..\lib\vc_lib\wxbase28ud.lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - ..\..\lib\vc_lib\mswunivud;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;WXBUILDING;wxUSE_GUI=0;wxUSE_BASE=1;%(PreprocessorDefinitions) - .\vc_mswunivud\base\ - vc_mswunivud\wxprec_baselib.pch - Use - wx/wxprec.h - .\vc_mswunivud\base\ - ..\..\lib\vc_lib\wxbase28ud.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_base.bsc - - - true - ..\..\lib\vc_lib\wxbase28ud.lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - true - ..\..\lib\vc_dll\mswud;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXDEBUG__;WXBUILDING;wxUSE_GUI=0;WXMAKINGDLL_BASE;wxUSE_BASE=1;%(PreprocessorDefinitions) - .\vc_mswuddll\base\ - vc_mswuddll\wxprec_basedll.pch - Use - wx/wxprec.h - .\vc_mswuddll\base\ - ..\..\lib\vc_dll\wxbase28ud_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXDEBUG__;_UNICODE;WXBUILDING;wxUSE_GUI=0;WXMAKINGDLL_BASE;wxUSE_BASE=1;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_base.tlb - true - Win32 - - - 0x0409 - ..\..\lib\vc_dll\mswud;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - _DEBUG;__WXMSW__;__WXDEBUG__;_UNICODE;WXBUILDING;WXDLLNAME=wxbase28ud_vc_custom;wxUSE_GUI=0;WXMAKINGDLL_BASE;wxUSE_BASE=1;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_base.bsc - - - true - true - true - Console - ..\..\lib\vc_dll\wxbase28ud_vc_custom.dll - ..\..\lib\vc_dll\wxbase28ud.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxzlibd.lib;wxregexud.lib;wxexpatd.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;%(AdditionalDependencies) - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - ..\..\lib\vc_dll\mswud;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXDEBUG__;WXBUILDING;wxUSE_GUI=0;WXMAKINGDLL_BASE;wxUSE_BASE=1;%(PreprocessorDefinitions) - .\vc_mswuddll\base\ - vc_mswuddll\wxprec_basedll.pch - Use - wx/wxprec.h - .\vc_mswuddll\base\ - ..\..\lib\vc_dll\wxbase28ud_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXDEBUG__;_UNICODE;WXBUILDING;wxUSE_GUI=0;WXMAKINGDLL_BASE;wxUSE_BASE=1;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_base.tlb - true - - - 0x0409 - ..\..\lib\vc_dll\mswud;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - _DEBUG;__WXMSW__;__WXDEBUG__;_UNICODE;WXBUILDING;WXDLLNAME=wxbase28ud_vc_custom;wxUSE_GUI=0;WXMAKINGDLL_BASE;wxUSE_BASE=1;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_base.bsc - - - true - true - true - Console - ..\..\lib\vc_dll\wxbase28ud_vc_custom.dll - ..\..\lib\vc_dll\wxbase28ud.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxzlibd.lib;wxregexud.lib;wxexpatd.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;%(AdditionalDependencies) - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - true - ..\..\lib\vc_lib\mswud;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;__WXMSW__;__WXDEBUG__;WXBUILDING;wxUSE_GUI=0;wxUSE_BASE=1;%(PreprocessorDefinitions) - .\vc_mswud\base\ - vc_mswud\wxprec_baselib.pch - Use - wx/wxprec.h - .\vc_mswud\base\ - ..\..\lib\vc_lib\wxbase28ud.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_base.bsc - - - true - ..\..\lib\vc_lib\wxbase28ud.lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - ..\..\lib\vc_lib\mswud;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;__WXMSW__;__WXDEBUG__;WXBUILDING;wxUSE_GUI=0;wxUSE_BASE=1;%(PreprocessorDefinitions) - .\vc_mswud\base\ - vc_mswud\wxprec_baselib.pch - Use - wx/wxprec.h - .\vc_mswud\base\ - ..\..\lib\vc_lib\wxbase28ud.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_base.bsc - - - true - ..\..\lib\vc_lib\wxbase28ud.lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - true - ..\..\lib\vc_lib\mswunivd;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;WXBUILDING;wxUSE_GUI=0;wxUSE_BASE=1;%(PreprocessorDefinitions) - .\vc_mswunivd\base\ - vc_mswunivd\wxprec_baselib.pch - Use - wx/wxprec.h - .\vc_mswunivd\base\ - ..\..\lib\vc_lib\wxbase28d.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_base.bsc - - - true - ..\..\lib\vc_lib\wxbase28d.lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - ..\..\lib\vc_lib\mswunivd;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;WXBUILDING;wxUSE_GUI=0;wxUSE_BASE=1;%(PreprocessorDefinitions) - .\vc_mswunivd\base\ - vc_mswunivd\wxprec_baselib.pch - Use - wx/wxprec.h - .\vc_mswunivd\base\ - ..\..\lib\vc_lib\wxbase28d.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_base.bsc - - - true - ..\..\lib\vc_lib\wxbase28d.lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_lib\mswu;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;__WXMSW__;NDEBUG;WXBUILDING;wxUSE_GUI=0;wxUSE_BASE=1;%(PreprocessorDefinitions) - .\vc_mswu\base\ - vc_mswu\wxprec_baselib.pch - Use - wx/wxprec.h - .\vc_mswu\base\ - ..\..\lib\vc_lib\wxbase28u.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_base.bsc - - - true - ..\..\lib\vc_lib\wxbase28u.lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_lib\mswu;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;__WXMSW__;NDEBUG;WXBUILDING;wxUSE_GUI=0;wxUSE_BASE=1;%(PreprocessorDefinitions) - .\vc_mswu\base\ - vc_mswu\wxprec_baselib.pch - Use - wx/wxprec.h - .\vc_mswu\base\ - ..\..\lib\vc_lib\wxbase28u.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_base.bsc - - - true - ..\..\lib\vc_lib\wxbase28u.lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - true - ..\..\lib\vc_dll\mswunivd;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;WXBUILDING;wxUSE_GUI=0;WXMAKINGDLL_BASE;wxUSE_BASE=1;%(PreprocessorDefinitions) - .\vc_mswunivddll\base\ - vc_mswunivddll\wxprec_basedll.pch - Use - wx/wxprec.h - .\vc_mswunivddll\base\ - ..\..\lib\vc_dll\wxbase28d_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;WXBUILDING;wxUSE_GUI=0;WXMAKINGDLL_BASE;wxUSE_BASE=1;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_base.tlb - true - Win32 - - - 0x0409 - ..\..\lib\vc_dll\mswunivd;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - _DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;WXBUILDING;WXDLLNAME=wxbase28d_vc_custom;wxUSE_GUI=0;WXMAKINGDLL_BASE;wxUSE_BASE=1;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_base.bsc - - - true - true - true - Console - ..\..\lib\vc_dll\wxbase28d_vc_custom.dll - ..\..\lib\vc_dll\wxbase28d.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxzlibd.lib;wxregexd.lib;wxexpatd.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;%(AdditionalDependencies) - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - ..\..\lib\vc_dll\mswunivd;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;WXBUILDING;wxUSE_GUI=0;WXMAKINGDLL_BASE;wxUSE_BASE=1;%(PreprocessorDefinitions) - .\vc_mswunivddll\base\ - vc_mswunivddll\wxprec_basedll.pch - Use - wx/wxprec.h - .\vc_mswunivddll\base\ - ..\..\lib\vc_dll\wxbase28d_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;WXBUILDING;wxUSE_GUI=0;WXMAKINGDLL_BASE;wxUSE_BASE=1;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_base.tlb - true - - - 0x0409 - ..\..\lib\vc_dll\mswunivd;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - _DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;WXBUILDING;WXDLLNAME=wxbase28d_vc_custom;wxUSE_GUI=0;WXMAKINGDLL_BASE;wxUSE_BASE=1;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_base.bsc - - - true - true - true - Console - ..\..\lib\vc_dll\wxbase28d_vc_custom.dll - ..\..\lib\vc_dll\wxbase28d.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxzlibd.lib;wxregexd.lib;wxexpatd.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;%(AdditionalDependencies) - - - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - - - - - /EHsc /EHsc - /EHsc /EHsc - - - - - /EHsc /EHsc - /EHsc /EHsc - - - - - /EHsc /EHsc - /EHsc /EHsc - - - - - /EHsc /EHsc - /EHsc /EHsc - - - - - /EHsc /EHsc - /EHsc /EHsc - - - - - /EHsc /EHsc - /EHsc /EHsc - - - - - /EHsc /EHsc - /EHsc /EHsc - - - - - /EHsc /EHsc - /EHsc /EHsc - - - - - /EHsc /EHsc - /EHsc /EHsc - - - - - /EHsc /EHsc - /EHsc /EHsc - - - - - /EHsc /EHsc - /EHsc /EHsc - - - - - /EHsc /EHsc - /EHsc /EHsc - - - - - /EHsc /EHsc - /EHsc /EHsc - - - - - /EHsc /EHsc - /EHsc /EHsc - - - - - /EHsc /EHsc - /EHsc /EHsc - - - - - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - - - true - true - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - true - true - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - true - true - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - true - true - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - true - true - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - true - true - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - true - true - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - true - true - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - - - - - copy "%(FullPath)" ..\..\lib\vc_lib\mswd\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_lib\mswd\wx\setup.h - Creating ..\..\lib\vc_lib\mswd\wx\setup.h - Creating ..\..\lib\vc_lib\mswd\wx\setup.h - ..\..\lib\vc_lib\mswd\wx\setup.h;%(Outputs) - ..\..\lib\vc_lib\mswd\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_dll\mswd\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_dll\mswd\wx\setup.h - Creating ..\..\lib\vc_dll\mswd\wx\setup.h - Creating ..\..\lib\vc_dll\mswd\wx\setup.h - ..\..\lib\vc_dll\mswd\wx\setup.h;%(Outputs) - ..\..\lib\vc_dll\mswd\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_lib\msw\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_lib\msw\wx\setup.h - Creating ..\..\lib\vc_lib\msw\wx\setup.h - Creating ..\..\lib\vc_lib\msw\wx\setup.h - ..\..\lib\vc_lib\msw\wx\setup.h;%(Outputs) - ..\..\lib\vc_lib\msw\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_dll\msw\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_dll\msw\wx\setup.h - Creating ..\..\lib\vc_dll\msw\wx\setup.h - Creating ..\..\lib\vc_dll\msw\wx\setup.h - ..\..\lib\vc_dll\msw\wx\setup.h;%(Outputs) - ..\..\lib\vc_dll\msw\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_dll\mswu\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_dll\mswu\wx\setup.h - Creating ..\..\lib\vc_dll\mswu\wx\setup.h - Creating ..\..\lib\vc_dll\mswu\wx\setup.h - ..\..\lib\vc_dll\mswu\wx\setup.h;%(Outputs) - ..\..\lib\vc_dll\mswu\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_dll\mswud\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_dll\mswud\wx\setup.h - Creating ..\..\lib\vc_dll\mswud\wx\setup.h - Creating ..\..\lib\vc_dll\mswud\wx\setup.h - ..\..\lib\vc_dll\mswud\wx\setup.h;%(Outputs) - ..\..\lib\vc_dll\mswud\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_lib\mswud\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_lib\mswud\wx\setup.h - Creating ..\..\lib\vc_lib\mswud\wx\setup.h - Creating ..\..\lib\vc_lib\mswud\wx\setup.h - ..\..\lib\vc_lib\mswud\wx\setup.h;%(Outputs) - ..\..\lib\vc_lib\mswud\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_lib\mswu\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_lib\mswu\wx\setup.h - Creating ..\..\lib\vc_lib\mswu\wx\setup.h - Creating ..\..\lib\vc_lib\mswu\wx\setup.h - ..\..\lib\vc_lib\mswu\wx\setup.h;%(Outputs) - ..\..\lib\vc_lib\mswu\wx\setup.h;%(Outputs) - - - copy "%(FullPath)" ..\..\lib\vc_lib\mswunivu\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_lib\mswunivu\wx\setup.h - Creating ..\..\lib\vc_lib\mswunivu\wx\setup.h - Creating ..\..\lib\vc_lib\mswunivu\wx\setup.h - ..\..\lib\vc_lib\mswunivu\wx\setup.h;%(Outputs) - ..\..\lib\vc_lib\mswunivu\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_dll\mswunivud\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_dll\mswunivud\wx\setup.h - Creating ..\..\lib\vc_dll\mswunivud\wx\setup.h - Creating ..\..\lib\vc_dll\mswunivud\wx\setup.h - ..\..\lib\vc_dll\mswunivud\wx\setup.h;%(Outputs) - ..\..\lib\vc_dll\mswunivud\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_dll\mswunivu\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_dll\mswunivu\wx\setup.h - Creating ..\..\lib\vc_dll\mswunivu\wx\setup.h - Creating ..\..\lib\vc_dll\mswunivu\wx\setup.h - ..\..\lib\vc_dll\mswunivu\wx\setup.h;%(Outputs) - ..\..\lib\vc_dll\mswunivu\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_dll\mswuniv\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_dll\mswuniv\wx\setup.h - Creating ..\..\lib\vc_dll\mswuniv\wx\setup.h - Creating ..\..\lib\vc_dll\mswuniv\wx\setup.h - ..\..\lib\vc_dll\mswuniv\wx\setup.h;%(Outputs) - ..\..\lib\vc_dll\mswuniv\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_lib\mswuniv\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_lib\mswuniv\wx\setup.h - Creating ..\..\lib\vc_lib\mswuniv\wx\setup.h - Creating ..\..\lib\vc_lib\mswuniv\wx\setup.h - ..\..\lib\vc_lib\mswuniv\wx\setup.h;%(Outputs) - ..\..\lib\vc_lib\mswuniv\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_lib\mswunivud\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_lib\mswunivud\wx\setup.h - Creating ..\..\lib\vc_lib\mswunivud\wx\setup.h - Creating ..\..\lib\vc_lib\mswunivud\wx\setup.h - ..\..\lib\vc_lib\mswunivud\wx\setup.h;%(Outputs) - ..\..\lib\vc_lib\mswunivud\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_lib\mswunivd\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_lib\mswunivd\wx\setup.h - Creating ..\..\lib\vc_lib\mswunivd\wx\setup.h - Creating ..\..\lib\vc_lib\mswunivd\wx\setup.h - ..\..\lib\vc_lib\mswunivd\wx\setup.h;%(Outputs) - ..\..\lib\vc_lib\mswunivd\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_dll\mswunivd\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_dll\mswunivd\wx\setup.h - Creating ..\..\lib\vc_dll\mswunivd\wx\setup.h - Creating ..\..\lib\vc_dll\mswunivd\wx\setup.h - ..\..\lib\vc_dll\mswunivd\wx\setup.h;%(Outputs) - ..\..\lib\vc_dll\mswunivd\wx\setup.h;%(Outputs) - - - - - - - - - - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswd\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswd\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_lib\mswd\wx\msw\rcdefs.h - Creating ..\..\lib\vc_lib\mswd\wx\msw\rcdefs.h - ..\..\lib\vc_lib\mswd\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_lib\mswd\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswunivu\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswunivu\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_lib\mswunivu\wx\msw\rcdefs.h - Creating ..\..\lib\vc_lib\mswunivu\wx\msw\rcdefs.h - ..\..\lib\vc_lib\mswunivu\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_lib\mswunivu\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswd\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswd\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_dll\mswd\wx\msw\rcdefs.h - Creating ..\..\lib\vc_dll\mswd\wx\msw\rcdefs.h - ..\..\lib\vc_dll\mswd\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_dll\mswd\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\msw\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\msw\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_lib\msw\wx\msw\rcdefs.h - Creating ..\..\lib\vc_lib\msw\wx\msw\rcdefs.h - ..\..\lib\vc_lib\msw\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_lib\msw\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\msw\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\msw\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_dll\msw\wx\msw\rcdefs.h - Creating ..\..\lib\vc_dll\msw\wx\msw\rcdefs.h - ..\..\lib\vc_dll\msw\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_dll\msw\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswunivud\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswunivud\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_dll\mswunivud\wx\msw\rcdefs.h - Creating ..\..\lib\vc_dll\mswunivud\wx\msw\rcdefs.h - ..\..\lib\vc_dll\mswunivud\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_dll\mswunivud\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswunivu\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswunivu\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_dll\mswunivu\wx\msw\rcdefs.h - Creating ..\..\lib\vc_dll\mswunivu\wx\msw\rcdefs.h - ..\..\lib\vc_dll\mswunivu\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_dll\mswunivu\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswuniv\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswuniv\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_dll\mswuniv\wx\msw\rcdefs.h - Creating ..\..\lib\vc_dll\mswuniv\wx\msw\rcdefs.h - ..\..\lib\vc_dll\mswuniv\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_dll\mswuniv\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswuniv\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswuniv\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_lib\mswuniv\wx\msw\rcdefs.h - Creating ..\..\lib\vc_lib\mswuniv\wx\msw\rcdefs.h - ..\..\lib\vc_lib\mswuniv\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_lib\mswuniv\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswu\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswu\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_dll\mswu\wx\msw\rcdefs.h - Creating ..\..\lib\vc_dll\mswu\wx\msw\rcdefs.h - ..\..\lib\vc_dll\mswu\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_dll\mswu\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswunivud\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswunivud\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_lib\mswunivud\wx\msw\rcdefs.h - Creating ..\..\lib\vc_lib\mswunivud\wx\msw\rcdefs.h - ..\..\lib\vc_lib\mswunivud\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_lib\mswunivud\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswud\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswud\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_dll\mswud\wx\msw\rcdefs.h - Creating ..\..\lib\vc_dll\mswud\wx\msw\rcdefs.h - ..\..\lib\vc_dll\mswud\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_dll\mswud\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswud\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswud\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_lib\mswud\wx\msw\rcdefs.h - Creating ..\..\lib\vc_lib\mswud\wx\msw\rcdefs.h - ..\..\lib\vc_lib\mswud\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_lib\mswud\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswunivd\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswunivd\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_lib\mswunivd\wx\msw\rcdefs.h - Creating ..\..\lib\vc_lib\mswunivd\wx\msw\rcdefs.h - ..\..\lib\vc_lib\mswunivd\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_lib\mswunivd\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswu\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswu\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_lib\mswu\wx\msw\rcdefs.h - Creating ..\..\lib\vc_lib\mswu\wx\msw\rcdefs.h - ..\..\lib\vc_lib\mswu\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_lib\mswu\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswunivd\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswunivd\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_dll\mswunivd\wx\msw\rcdefs.h - Creating ..\..\lib\vc_dll\mswunivd\wx\msw\rcdefs.h - ..\..\lib\vc_dll\mswunivd\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_dll\mswunivd\wx\msw\rcdefs.h;%(Outputs) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/wxWidgets/build/msw/wx_base.vcxproj.filters b/wxWidgets/build/msw/wx_base.vcxproj.filters deleted file mode 100644 index 5088a8c2ba..0000000000 --- a/wxWidgets/build/msw/wx_base.vcxproj.filters +++ /dev/null @@ -1,697 +0,0 @@ - - - - - {4566db7a-6b6b-4fbc-83a9-7bc27376f6b6} - - - {1f10d9e4-4dd2-483c-b62d-a1cdeed6d9cc} - - - {7f17bacd-9d02-45cd-a33d-0c6304eb8ee0} - - - {cf5bbe92-a724-4a33-96cf-ff2456a9a9dc} - - - {31212346-ea3d-4dfb-8f7a-344a9268f8e1} - - - {f76d4343-4421-4a74-978f-029264b756d9} - - - - - Common Sources - - - Common Sources - - - Common Sources - - - Common Sources - - - Common Sources - - - Common Sources - - - Common Sources - - - Common Sources - - - Common Sources - - - Common Sources - - - Common Sources - - - Common Sources - - - Common Sources - - - Common Sources - - - Common Sources - - - Common Sources - - - Common Sources - - - Common Sources - - - Common Sources - - - Common Sources - - - Common Sources - - - Common Sources - - - Common Sources - - - Common Sources - - - Common Sources - - - Common Sources - - - Common Sources - - - Common Sources - - - Common Sources - - - Common Sources - - - Common Sources - - - Common Sources - - - Common Sources - - - Common Sources - - - Common Sources - - - Common Sources - - - Common Sources - - - Common Sources - - - Common Sources - - - Common Sources - - - Common Sources - - - Common Sources - - - Common Sources - - - Common Sources - - - Common Sources - - - Common Sources - - - Common Sources - - - Common Sources - - - Common Sources - - - Common Sources - - - Common Sources - - - Common Sources - - - Common Sources - - - Common Sources - - - Common Sources - - - Common Sources - - - Common Sources - - - Common Sources - - - Common Sources - - - Common Sources - - - Common Sources - - - Common Sources - - - Common Sources - - - Common Sources - - - Common Sources - - - Common Sources - - - Common Sources - - - Common Sources - - - Common Sources - - - Common Sources - - - MSW Sources - - - MSW Sources - - - MSW Sources - - - MSW Sources - - - MSW Sources - - - MSW Sources - - - MSW Sources - - - MSW Sources - - - MSW Sources - - - MSW Sources - - - MSW Sources - - - MSW Sources - - - MSW Sources - - - MSW Sources - - - MSW Sources - - - MSW Sources - - - MSW Sources - - - MSW Sources - - - MSW Sources - - - - - MSW Sources - - - - - MSW Headers - - - MSW Headers - - - MSW Headers - - - MSW Headers - - - MSW Headers - - - MSW Headers - - - MSW Headers - - - MSW Headers - - - MSW Headers - - - MSW Headers - - - MSW Headers - - - MSW Headers - - - MSW Headers - - - MSW Headers - - - MSW Headers - - - MSW Headers - - - MSW Headers - - - MSW Headers - - - MSW Headers - - - MSW Headers - - - wxHTML Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - - - Setup Headers - - - Setup Headers - - - MSW Headers - - - \ No newline at end of file diff --git a/wxWidgets/build/msw/wx_core.vcxproj b/wxWidgets/build/msw/wx_core.vcxproj deleted file mode 100644 index 746fa8bcfa..0000000000 --- a/wxWidgets/build/msw/wx_core.vcxproj +++ /dev/null @@ -1,13643 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - DLL Debug - Win32 - - - DLL Debug - x64 - - - DLL Release - Win32 - - - DLL Release - x64 - - - DLL Unicode Debug - Win32 - - - DLL Unicode Debug - x64 - - - DLL Unicode Release - Win32 - - - DLL Unicode Release - x64 - - - DLL Universal Debug - Win32 - - - DLL Universal Debug - x64 - - - DLL Universal Release - Win32 - - - DLL Universal Release - x64 - - - DLL Universal Unicode Debug - Win32 - - - DLL Universal Unicode Debug - x64 - - - DLL Universal Unicode Release - Win32 - - - DLL Universal Unicode Release - x64 - - - Release - Win32 - - - Release - x64 - - - Template - Win32 - - - Template - x64 - - - Unicode Debug - Win32 - - - Unicode Debug - x64 - - - Unicode Release - Win32 - - - Unicode Release - x64 - - - Universal Debug - Win32 - - - Universal Debug - x64 - - - Universal Release - Win32 - - - Universal Release - x64 - - - Universal Unicode Debug - Win32 - - - Universal Unicode Debug - x64 - - - Universal Unicode Release - Win32 - - - Universal Unicode Release - x64 - - - - core - - - {067D9406-2A93-DACA-9449-93A2D356357D} - - - - Application - v110 - - - Application - v110 - - - StaticLibrary - false - Unicode - v110 - - - StaticLibrary - false - Unicode - v110 - - - StaticLibrary - false - Unicode - v110 - - - StaticLibrary - false - Unicode - v110 - - - DynamicLibrary - false - v110 - - - DynamicLibrary - false - v110 - - - DynamicLibrary - false - Unicode - v110 - - - DynamicLibrary - false - Unicode - v110 - - - DynamicLibrary - false - Unicode - v110 - - - DynamicLibrary - false - Unicode - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - Unicode - v110 - - - StaticLibrary - false - Unicode - v110 - - - DynamicLibrary - false - v110 - - - DynamicLibrary - false - v110 - - - DynamicLibrary - false - v110 - - - DynamicLibrary - false - v110 - - - DynamicLibrary - false - Unicode - v110 - - - DynamicLibrary - false - Unicode - v110 - - - DynamicLibrary - false - Unicode - v110 - - - DynamicLibrary - false - Unicode - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - Unicode - v110 - - - StaticLibrary - false - Unicode - v110 - - - DynamicLibrary - false - v110 - - - DynamicLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - .\..\..\lib\vc_lib\ - .\vc_mswd\core\ - - - .\..\..\lib\vc_lib\ - .\vc_mswd\core\ - - - .\..\..\lib\vc_dll\ - .\vc_mswunivddll\core\ - true - - - .\..\..\lib\vc_dll\ - .\vc_mswunivddll\core\ - true - - - .\..\..\lib\vc_lib\ - .\vc_mswud\core\ - - - .\..\..\lib\vc_lib\ - .\vc_mswud\core\ - - - .\..\..\lib\vc_lib\ - .\vc_mswuniv\core\ - - - .\..\..\lib\vc_lib\ - .\vc_mswuniv\core\ - - - .\..\..\lib\vc_lib\ - .\vc_mswunivd\core\ - - - .\..\..\lib\vc_lib\ - .\vc_mswunivd\core\ - - - .\..\..\lib\vc_dll\ - .\vc_mswunivuddll\core\ - true - - - .\..\..\lib\vc_dll\ - .\vc_mswunivuddll\core\ - true - - - .\..\..\lib\vc_dll\ - .\vc_mswunivudll\core\ - false - - - .\..\..\lib\vc_dll\ - .\vc_mswunivudll\core\ - false - - - .\..\..\lib\vc_dll\ - .\vc_mswddll\core\ - true - - - .\..\..\lib\vc_dll\ - .\vc_mswddll\core\ - true - - - .\..\..\lib\vc_dll\ - .\vc_mswdll\core\ - false - - - .\..\..\lib\vc_dll\ - .\vc_mswdll\core\ - false - - - .\..\..\lib\vc_lib\ - .\vc_mswunivud\core\ - - - .\..\..\lib\vc_lib\ - .\vc_mswunivud\core\ - - - .\..\..\lib\vc_lib\ - .\vc_msw\core\ - - - .\..\..\lib\vc_lib\ - .\vc_msw\core\ - - - .\..\..\lib\vc_dll\ - .\vc_mswuddll\core\ - true - - - .\..\..\lib\vc_dll\ - .\vc_mswuddll\core\ - true - - - .\..\..\lib\vc_dll\ - .\vc_mswudll\core\ - false - - - .\..\..\lib\vc_dll\ - .\vc_mswudll\core\ - false - - - .\..\..\lib\vc_dll\ - .\vc_mswunivdll\core\ - false - - - .\..\..\lib\vc_dll\ - .\vc_mswunivdll\core\ - false - - - .\..\..\lib\vc_lib\ - .\vc_mswunivu\core\ - - - .\..\..\lib\vc_lib\ - .\vc_mswunivu\core\ - - - .\..\..\lib\vc_lib\ - .\vc_mswu\core\ - - - .\..\..\lib\vc_lib\ - .\vc_mswu\core\ - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - true - ..\..\lib\vc_lib\mswd;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;__WXMSW__;__WXDEBUG__;WXBUILDING;wxUSE_BASE=0;%(PreprocessorDefinitions) - .\vc_mswd\core\ - vc_mswd\wxprec_corelib.pch - Use - wx/wxprec.h - .\vc_mswd\core\ - ..\..\lib\vc_lib\wxmsw28d_core.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_core.bsc - - - true - .\..\..\..\libs\$(Configuration)\$(ProjectName).lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - ..\..\lib\vc_lib\mswd;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;__WXMSW__;__WXDEBUG__;WXBUILDING;wxUSE_BASE=0;%(PreprocessorDefinitions) - .\vc_mswd\core\ - vc_mswd\wxprec_corelib.pch - Use - wx/wxprec.h - .\vc_mswd\core\ - ..\..\lib\vc_lib\wxmsw28d_core.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_core.bsc - - - true - .\..\..\..\libs\$(Configuration)\$(ProjectName).lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - true - ..\..\lib\vc_dll\mswunivd;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_CORE;wxUSE_BASE=0;%(PreprocessorDefinitions) - .\vc_mswunivddll\core\ - vc_mswunivddll\wxprec_coredll.pch - Use - wx/wxprec.h - .\vc_mswunivddll\core\ - ..\..\lib\vc_dll\wxmswuniv28d_core_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_CORE;wxUSE_BASE=0;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_core.tlb - true - Win32 - - - 0x0409 - ..\..\lib\vc_dll\mswunivd;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - _DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;WXBUILDING;WXDLLNAME=wxmswuniv28d_core_vc_custom;WXUSINGDLL;WXMAKINGDLL_CORE;wxUSE_BASE=0;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_core.bsc - - - true - true - true - Console - ..\..\lib\vc_dll\wxmswuniv28d_core_vc_custom.dll - ..\..\lib\vc_dll\wxmswuniv28d_core.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxtiffd.lib;wxjpegd.lib;wxpngd.lib;wxzlibd.lib;wxregexd.lib;wxexpatd.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxbase28d.lib;%(AdditionalDependencies) - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - ..\..\lib\vc_dll\mswunivd;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_CORE;wxUSE_BASE=0;%(PreprocessorDefinitions) - .\vc_mswunivddll\core\ - vc_mswunivddll\wxprec_coredll.pch - Use - wx/wxprec.h - .\vc_mswunivddll\core\ - ..\..\lib\vc_dll\wxmswuniv28d_core_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_CORE;wxUSE_BASE=0;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_core.tlb - true - - - 0x0409 - ..\..\lib\vc_dll\mswunivd;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - _DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;WXBUILDING;WXDLLNAME=wxmswuniv28d_core_vc_custom;WXUSINGDLL;WXMAKINGDLL_CORE;wxUSE_BASE=0;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_core.bsc - - - true - true - true - Console - ..\..\lib\vc_dll\wxmswuniv28d_core_vc_custom.dll - ..\..\lib\vc_dll\wxmswuniv28d_core.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxtiffd.lib;wxjpegd.lib;wxpngd.lib;wxzlibd.lib;wxregexd.lib;wxexpatd.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxbase28d.lib;%(AdditionalDependencies) - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - true - ..\..\lib\vc_lib\mswud;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;__WXMSW__;__WXDEBUG__;WXBUILDING;wxUSE_BASE=0;%(PreprocessorDefinitions) - .\vc_mswud\core\ - vc_mswud\wxprec_corelib.pch - Use - wx/wxprec.h - .\vc_mswud\core\ - ..\..\lib\vc_lib\wxmsw28ud_core.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_core.bsc - - - true - ..\..\lib\vc_lib\wxmsw28ud_core.lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - ..\..\lib\vc_lib\mswud;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;__WXMSW__;__WXDEBUG__;WXBUILDING;wxUSE_BASE=0;%(PreprocessorDefinitions) - .\vc_mswud\core\ - vc_mswud\wxprec_corelib.pch - Use - wx/wxprec.h - .\vc_mswud\core\ - ..\..\lib\vc_lib\wxmsw28ud_core.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_core.bsc - - - true - ..\..\lib\vc_lib\wxmsw28ud_core.lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_lib\mswuniv;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;__WXMSW__;__WXUNIVERSAL__;NDEBUG;WXBUILDING;wxUSE_BASE=0;%(PreprocessorDefinitions) - .\vc_mswuniv\core\ - vc_mswuniv\wxprec_corelib.pch - Use - wx/wxprec.h - .\vc_mswuniv\core\ - ..\..\lib\vc_lib\wxmswuniv28_core.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_core.bsc - - - true - ..\..\lib\vc_lib\wxmswuniv28_core.lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_lib\mswuniv;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;__WXMSW__;__WXUNIVERSAL__;NDEBUG;WXBUILDING;wxUSE_BASE=0;%(PreprocessorDefinitions) - .\vc_mswuniv\core\ - vc_mswuniv\wxprec_corelib.pch - Use - wx/wxprec.h - .\vc_mswuniv\core\ - ..\..\lib\vc_lib\wxmswuniv28_core.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_core.bsc - - - true - ..\..\lib\vc_lib\wxmswuniv28_core.lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - true - ..\..\lib\vc_lib\mswunivd;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;WXBUILDING;wxUSE_BASE=0;%(PreprocessorDefinitions) - .\vc_mswunivd\core\ - vc_mswunivd\wxprec_corelib.pch - Use - wx/wxprec.h - .\vc_mswunivd\core\ - ..\..\lib\vc_lib\wxmswuniv28d_core.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_core.bsc - - - true - ..\..\lib\vc_lib\wxmswuniv28d_core.lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - ..\..\lib\vc_lib\mswunivd;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;WXBUILDING;wxUSE_BASE=0;%(PreprocessorDefinitions) - .\vc_mswunivd\core\ - vc_mswunivd\wxprec_corelib.pch - Use - wx/wxprec.h - .\vc_mswunivd\core\ - ..\..\lib\vc_lib\wxmswuniv28d_core.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_core.bsc - - - true - ..\..\lib\vc_lib\wxmswuniv28d_core.lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - true - ..\..\lib\vc_dll\mswunivud;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_CORE;wxUSE_BASE=0;%(PreprocessorDefinitions) - .\vc_mswunivuddll\core\ - vc_mswunivuddll\wxprec_coredll.pch - Use - wx/wxprec.h - .\vc_mswunivuddll\core\ - ..\..\lib\vc_dll\wxmswuniv28ud_core_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;_UNICODE;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_CORE;wxUSE_BASE=0;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_core.tlb - true - Win32 - - - 0x0409 - ..\..\lib\vc_dll\mswunivud;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - _DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;_UNICODE;WXBUILDING;WXDLLNAME=wxmswuniv28ud_core_vc_custom;WXUSINGDLL;WXMAKINGDLL_CORE;wxUSE_BASE=0;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_core.bsc - - - true - true - true - Console - ..\..\lib\vc_dll\wxmswuniv28ud_core_vc_custom.dll - ..\..\lib\vc_dll\wxmswuniv28ud_core.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxtiffd.lib;wxjpegd.lib;wxpngd.lib;wxzlibd.lib;wxregexud.lib;wxexpatd.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxbase28ud.lib;%(AdditionalDependencies) - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - ..\..\lib\vc_dll\mswunivud;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_CORE;wxUSE_BASE=0;%(PreprocessorDefinitions) - .\vc_mswunivuddll\core\ - vc_mswunivuddll\wxprec_coredll.pch - Use - wx/wxprec.h - .\vc_mswunivuddll\core\ - ..\..\lib\vc_dll\wxmswuniv28ud_core_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;_UNICODE;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_CORE;wxUSE_BASE=0;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_core.tlb - true - - - 0x0409 - ..\..\lib\vc_dll\mswunivud;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - _DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;_UNICODE;WXBUILDING;WXDLLNAME=wxmswuniv28ud_core_vc_custom;WXUSINGDLL;WXMAKINGDLL_CORE;wxUSE_BASE=0;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_core.bsc - - - true - true - true - Console - ..\..\lib\vc_dll\wxmswuniv28ud_core_vc_custom.dll - ..\..\lib\vc_dll\wxmswuniv28ud_core.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxtiffd.lib;wxjpegd.lib;wxpngd.lib;wxzlibd.lib;wxregexud.lib;wxexpatd.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxbase28ud.lib;%(AdditionalDependencies) - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_dll\mswunivu;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;__WXUNIVERSAL__;NDEBUG;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_CORE;wxUSE_BASE=0;%(PreprocessorDefinitions) - .\vc_mswunivudll\core\ - vc_mswunivudll\wxprec_coredll.pch - Use - wx/wxprec.h - .\vc_mswunivudll\core\ - ..\..\lib\vc_dll\wxmswuniv28u_core_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;__WXUNIVERSAL__;NDEBUG;_UNICODE;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_CORE;wxUSE_BASE=0;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_core.tlb - true - Win32 - - - 0x0409 - ..\..\lib\vc_dll\mswunivu;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - __WXMSW__;__WXUNIVERSAL__;NDEBUG;_UNICODE;WXBUILDING;WXDLLNAME=wxmswuniv28u_core_vc_custom;WXUSINGDLL;WXMAKINGDLL_CORE;wxUSE_BASE=0;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_core.bsc - - - true - true - Console - ..\..\lib\vc_dll\wxmswuniv28u_core_vc_custom.dll - ..\..\lib\vc_dll\wxmswuniv28u_core.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxtiff.lib;wxjpeg.lib;wxpng.lib;wxzlib.lib;wxregexu.lib;wxexpat.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxbase28u.lib;%(AdditionalDependencies) - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_dll\mswunivu;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;__WXUNIVERSAL__;NDEBUG;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_CORE;wxUSE_BASE=0;%(PreprocessorDefinitions) - .\vc_mswunivudll\core\ - vc_mswunivudll\wxprec_coredll.pch - Use - wx/wxprec.h - .\vc_mswunivudll\core\ - ..\..\lib\vc_dll\wxmswuniv28u_core_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;__WXUNIVERSAL__;NDEBUG;_UNICODE;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_CORE;wxUSE_BASE=0;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_core.tlb - true - - - 0x0409 - ..\..\lib\vc_dll\mswunivu;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - __WXMSW__;__WXUNIVERSAL__;NDEBUG;_UNICODE;WXBUILDING;WXDLLNAME=wxmswuniv28u_core_vc_custom;WXUSINGDLL;WXMAKINGDLL_CORE;wxUSE_BASE=0;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_core.bsc - - - true - true - Console - ..\..\lib\vc_dll\wxmswuniv28u_core_vc_custom.dll - ..\..\lib\vc_dll\wxmswuniv28u_core.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxtiff.lib;wxjpeg.lib;wxpng.lib;wxzlib.lib;wxregexu.lib;wxexpat.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxbase28u.lib;%(AdditionalDependencies) - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - true - ..\..\lib\vc_dll\mswd;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXDEBUG__;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_CORE;wxUSE_BASE=0;%(PreprocessorDefinitions) - .\vc_mswddll\core\ - vc_mswddll\wxprec_coredll.pch - Use - wx/wxprec.h - .\vc_mswddll\core\ - ..\..\lib\vc_dll\wxmsw28d_core_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXDEBUG__;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_CORE;wxUSE_BASE=0;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_core.tlb - true - Win32 - - - 0x0409 - ..\..\lib\vc_dll\mswd;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - _DEBUG;__WXMSW__;__WXDEBUG__;WXBUILDING;WXDLLNAME=wxmsw28d_core_vc_custom;WXUSINGDLL;WXMAKINGDLL_CORE;wxUSE_BASE=0;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_core.bsc - - - true - true - true - Console - ..\..\lib\vc_dll\wxmsw28d_core_vc_custom.dll - ..\..\lib\vc_dll\wxmsw28d_core.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxtiffd.lib;wxjpegd.lib;wxpngd.lib;wxzlibd.lib;wxregexd.lib;wxexpatd.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxbase28d.lib;%(AdditionalDependencies) - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - ..\..\lib\vc_dll\mswd;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXDEBUG__;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_CORE;wxUSE_BASE=0;%(PreprocessorDefinitions) - .\vc_mswddll\core\ - vc_mswddll\wxprec_coredll.pch - Use - wx/wxprec.h - .\vc_mswddll\core\ - ..\..\lib\vc_dll\wxmsw28d_core_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXDEBUG__;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_CORE;wxUSE_BASE=0;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_core.tlb - true - - - 0x0409 - ..\..\lib\vc_dll\mswd;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - _DEBUG;__WXMSW__;__WXDEBUG__;WXBUILDING;WXDLLNAME=wxmsw28d_core_vc_custom;WXUSINGDLL;WXMAKINGDLL_CORE;wxUSE_BASE=0;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_core.bsc - - - true - true - true - Console - ..\..\lib\vc_dll\wxmsw28d_core_vc_custom.dll - ..\..\lib\vc_dll\wxmsw28d_core.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxtiffd.lib;wxjpegd.lib;wxpngd.lib;wxzlibd.lib;wxregexd.lib;wxexpatd.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxbase28d.lib;%(AdditionalDependencies) - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_dll\msw;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;NDEBUG;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_CORE;wxUSE_BASE=0;%(PreprocessorDefinitions) - .\vc_mswdll\core\ - vc_mswdll\wxprec_coredll.pch - Use - wx/wxprec.h - .\vc_mswdll\core\ - ..\..\lib\vc_dll\wxmsw28_core_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;NDEBUG;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_CORE;wxUSE_BASE=0;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_core.tlb - true - Win32 - - - 0x0409 - ..\..\lib\vc_dll\msw;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - __WXMSW__;NDEBUG;WXBUILDING;WXDLLNAME=wxmsw28_core_vc_custom;WXUSINGDLL;WXMAKINGDLL_CORE;wxUSE_BASE=0;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_core.bsc - - - true - true - Console - ..\..\lib\vc_dll\wxmsw28_core_vc_custom.dll - ..\..\lib\vc_dll\wxmsw28_core.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxtiff.lib;wxjpeg.lib;wxpng.lib;wxzlib.lib;wxregex.lib;wxexpat.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxbase28.lib;%(AdditionalDependencies) - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_dll\msw;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;NDEBUG;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_CORE;wxUSE_BASE=0;%(PreprocessorDefinitions) - .\vc_mswdll\core\ - vc_mswdll\wxprec_coredll.pch - Use - wx/wxprec.h - .\vc_mswdll\core\ - ..\..\lib\vc_dll\wxmsw28_core_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;NDEBUG;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_CORE;wxUSE_BASE=0;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_core.tlb - true - - - 0x0409 - ..\..\lib\vc_dll\msw;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - __WXMSW__;NDEBUG;WXBUILDING;WXDLLNAME=wxmsw28_core_vc_custom;WXUSINGDLL;WXMAKINGDLL_CORE;wxUSE_BASE=0;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_core.bsc - - - true - true - Console - ..\..\lib\vc_dll\wxmsw28_core_vc_custom.dll - ..\..\lib\vc_dll\wxmsw28_core.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxtiff.lib;wxjpeg.lib;wxpng.lib;wxzlib.lib;wxregex.lib;wxexpat.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxbase28.lib;%(AdditionalDependencies) - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - true - ..\..\lib\vc_lib\mswunivud;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;WXBUILDING;wxUSE_BASE=0;%(PreprocessorDefinitions) - .\vc_mswunivud\core\ - vc_mswunivud\wxprec_corelib.pch - Use - wx/wxprec.h - .\vc_mswunivud\core\ - ..\..\lib\vc_lib\wxmswuniv28ud_core.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_core.bsc - - - true - ..\..\lib\vc_lib\wxmswuniv28ud_core.lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - ..\..\lib\vc_lib\mswunivud;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;WXBUILDING;wxUSE_BASE=0;%(PreprocessorDefinitions) - .\vc_mswunivud\core\ - vc_mswunivud\wxprec_corelib.pch - Use - wx/wxprec.h - .\vc_mswunivud\core\ - ..\..\lib\vc_lib\wxmswuniv28ud_core.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_core.bsc - - - true - ..\..\lib\vc_lib\wxmswuniv28ud_core.lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_lib\msw;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;__WXMSW__;NDEBUG;WXBUILDING;wxUSE_BASE=0;%(PreprocessorDefinitions) - .\vc_msw\core\ - vc_msw\wxprec_corelib.pch - Use - wx/wxprec.h - .\vc_msw\core\ - ..\..\lib\vc_lib\wxmsw28_core.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_core.bsc - - - true - .\..\..\..\libs\$(Configuration)\$(ProjectName).lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_lib\msw;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;__WXMSW__;NDEBUG;WXBUILDING;wxUSE_BASE=0;%(PreprocessorDefinitions) - .\vc_msw\core\ - vc_msw\wxprec_corelib.pch - Use - wx/wxprec.h - .\vc_msw\core\ - ..\..\lib\vc_lib\wxmsw28_core.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_core.bsc - - - true - .\..\..\..\libs\$(Configuration)\$(ProjectName).lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - true - ..\..\lib\vc_dll\mswud;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXDEBUG__;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_CORE;wxUSE_BASE=0;%(PreprocessorDefinitions) - .\vc_mswuddll\core\ - vc_mswuddll\wxprec_coredll.pch - Use - wx/wxprec.h - .\vc_mswuddll\core\ - ..\..\lib\vc_dll\wxmsw28ud_core_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXDEBUG__;_UNICODE;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_CORE;wxUSE_BASE=0;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_core.tlb - true - Win32 - - - 0x0409 - ..\..\lib\vc_dll\mswud;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - _DEBUG;__WXMSW__;__WXDEBUG__;_UNICODE;WXBUILDING;WXDLLNAME=wxmsw28ud_core_vc_custom;WXUSINGDLL;WXMAKINGDLL_CORE;wxUSE_BASE=0;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_core.bsc - - - true - true - true - Console - ..\..\lib\vc_dll\wxmsw28ud_core_vc_custom.dll - ..\..\lib\vc_dll\wxmsw28ud_core.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxtiffd.lib;wxjpegd.lib;wxpngd.lib;wxzlibd.lib;wxregexud.lib;wxexpatd.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxbase28ud.lib;%(AdditionalDependencies) - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - ..\..\lib\vc_dll\mswud;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXDEBUG__;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_CORE;wxUSE_BASE=0;%(PreprocessorDefinitions) - .\vc_mswuddll\core\ - vc_mswuddll\wxprec_coredll.pch - Use - wx/wxprec.h - .\vc_mswuddll\core\ - ..\..\lib\vc_dll\wxmsw28ud_core_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXDEBUG__;_UNICODE;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_CORE;wxUSE_BASE=0;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_core.tlb - true - - - 0x0409 - ..\..\lib\vc_dll\mswud;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - _DEBUG;__WXMSW__;__WXDEBUG__;_UNICODE;WXBUILDING;WXDLLNAME=wxmsw28ud_core_vc_custom;WXUSINGDLL;WXMAKINGDLL_CORE;wxUSE_BASE=0;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_core.bsc - - - true - true - true - Console - ..\..\lib\vc_dll\wxmsw28ud_core_vc_custom.dll - ..\..\lib\vc_dll\wxmsw28ud_core.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxtiffd.lib;wxjpegd.lib;wxpngd.lib;wxzlibd.lib;wxregexud.lib;wxexpatd.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxbase28ud.lib;%(AdditionalDependencies) - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_dll\mswu;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;NDEBUG;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_CORE;wxUSE_BASE=0;%(PreprocessorDefinitions) - .\vc_mswudll\core\ - vc_mswudll\wxprec_coredll.pch - Use - wx/wxprec.h - .\vc_mswudll\core\ - ..\..\lib\vc_dll\wxmsw28u_core_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;NDEBUG;_UNICODE;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_CORE;wxUSE_BASE=0;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_core.tlb - true - Win32 - - - 0x0409 - ..\..\lib\vc_dll\mswu;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - __WXMSW__;NDEBUG;_UNICODE;WXBUILDING;WXDLLNAME=wxmsw28u_core_vc_custom;WXUSINGDLL;WXMAKINGDLL_CORE;wxUSE_BASE=0;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_core.bsc - - - true - true - Console - ..\..\lib\vc_dll\wxmsw28u_core_vc_custom.dll - ..\..\lib\vc_dll\wxmsw28u_core.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxtiff.lib;wxjpeg.lib;wxpng.lib;wxzlib.lib;wxregexu.lib;wxexpat.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxbase28u.lib;%(AdditionalDependencies) - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_dll\mswu;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;NDEBUG;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_CORE;wxUSE_BASE=0;%(PreprocessorDefinitions) - .\vc_mswudll\core\ - vc_mswudll\wxprec_coredll.pch - Use - wx/wxprec.h - .\vc_mswudll\core\ - ..\..\lib\vc_dll\wxmsw28u_core_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;NDEBUG;_UNICODE;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_CORE;wxUSE_BASE=0;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_core.tlb - true - - - 0x0409 - ..\..\lib\vc_dll\mswu;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - __WXMSW__;NDEBUG;_UNICODE;WXBUILDING;WXDLLNAME=wxmsw28u_core_vc_custom;WXUSINGDLL;WXMAKINGDLL_CORE;wxUSE_BASE=0;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_core.bsc - - - true - true - Console - ..\..\lib\vc_dll\wxmsw28u_core_vc_custom.dll - ..\..\lib\vc_dll\wxmsw28u_core.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxtiff.lib;wxjpeg.lib;wxpng.lib;wxzlib.lib;wxregexu.lib;wxexpat.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxbase28u.lib;%(AdditionalDependencies) - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_dll\mswuniv;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;__WXUNIVERSAL__;NDEBUG;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_CORE;wxUSE_BASE=0;%(PreprocessorDefinitions) - .\vc_mswunivdll\core\ - vc_mswunivdll\wxprec_coredll.pch - Use - wx/wxprec.h - .\vc_mswunivdll\core\ - ..\..\lib\vc_dll\wxmswuniv28_core_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;__WXUNIVERSAL__;NDEBUG;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_CORE;wxUSE_BASE=0;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_core.tlb - true - Win32 - - - 0x0409 - ..\..\lib\vc_dll\mswuniv;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - __WXMSW__;__WXUNIVERSAL__;NDEBUG;WXBUILDING;WXDLLNAME=wxmswuniv28_core_vc_custom;WXUSINGDLL;WXMAKINGDLL_CORE;wxUSE_BASE=0;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_core.bsc - - - true - true - Console - ..\..\lib\vc_dll\wxmswuniv28_core_vc_custom.dll - ..\..\lib\vc_dll\wxmswuniv28_core.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxtiff.lib;wxjpeg.lib;wxpng.lib;wxzlib.lib;wxregex.lib;wxexpat.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxbase28.lib;%(AdditionalDependencies) - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_dll\mswuniv;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;__WXUNIVERSAL__;NDEBUG;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_CORE;wxUSE_BASE=0;%(PreprocessorDefinitions) - .\vc_mswunivdll\core\ - vc_mswunivdll\wxprec_coredll.pch - Use - wx/wxprec.h - .\vc_mswunivdll\core\ - ..\..\lib\vc_dll\wxmswuniv28_core_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;__WXUNIVERSAL__;NDEBUG;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_CORE;wxUSE_BASE=0;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_core.tlb - true - - - 0x0409 - ..\..\lib\vc_dll\mswuniv;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - __WXMSW__;__WXUNIVERSAL__;NDEBUG;WXBUILDING;WXDLLNAME=wxmswuniv28_core_vc_custom;WXUSINGDLL;WXMAKINGDLL_CORE;wxUSE_BASE=0;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_core.bsc - - - true - true - Console - ..\..\lib\vc_dll\wxmswuniv28_core_vc_custom.dll - ..\..\lib\vc_dll\wxmswuniv28_core.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxtiff.lib;wxjpeg.lib;wxpng.lib;wxzlib.lib;wxregex.lib;wxexpat.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxbase28.lib;%(AdditionalDependencies) - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_lib\mswunivu;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;__WXMSW__;__WXUNIVERSAL__;NDEBUG;WXBUILDING;wxUSE_BASE=0;%(PreprocessorDefinitions) - .\vc_mswunivu\core\ - vc_mswunivu\wxprec_corelib.pch - Use - wx/wxprec.h - .\vc_mswunivu\core\ - ..\..\lib\vc_lib\wxmswuniv28u_core.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_core.bsc - - - true - ..\..\lib\vc_lib\wxmswuniv28u_core.lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_lib\mswunivu;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;__WXMSW__;__WXUNIVERSAL__;NDEBUG;WXBUILDING;wxUSE_BASE=0;%(PreprocessorDefinitions) - .\vc_mswunivu\core\ - vc_mswunivu\wxprec_corelib.pch - Use - wx/wxprec.h - .\vc_mswunivu\core\ - ..\..\lib\vc_lib\wxmswuniv28u_core.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_core.bsc - - - true - ..\..\lib\vc_lib\wxmswuniv28u_core.lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_lib\mswu;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;__WXMSW__;NDEBUG;WXBUILDING;wxUSE_BASE=0;%(PreprocessorDefinitions) - .\vc_mswu\core\ - vc_mswu\wxprec_corelib.pch - Use - wx/wxprec.h - .\vc_mswu\core\ - ..\..\lib\vc_lib\wxmsw28u_core.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_core.bsc - - - true - ..\..\lib\vc_lib\wxmsw28u_core.lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_lib\mswu;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;__WXMSW__;NDEBUG;WXBUILDING;wxUSE_BASE=0;%(PreprocessorDefinitions) - .\vc_mswu\core\ - vc_mswu\wxprec_corelib.pch - Use - wx/wxprec.h - .\vc_mswu\core\ - ..\..\lib\vc_lib\wxmsw28u_core.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_core.bsc - - - true - ..\..\lib\vc_lib\wxmsw28u_core.lib - - - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - - - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - - - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - - - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - - - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - - - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - - - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - - - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - - - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - - - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - - - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - - - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - - - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - - - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - - - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - - - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - - - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - - - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - - - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - - - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - - - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - - - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - - - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - - - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - - - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - - - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - - - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - - - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - - - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - - - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - - - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - - - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - - - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - - - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - - - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - - - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - - - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - - - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - - - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - - - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - - - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - - - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - true - true - /EHsc /EHsc - /EHsc /EHsc - - - - - true - true - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - true - true - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - true - true - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - true - true - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - true - true - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - true - true - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - true - true - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - true - true - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - - - - - copy "%(FullPath)" ..\..\lib\vc_lib\mswd\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_lib\mswd\wx\setup.h - Creating ..\..\lib\vc_lib\mswd\wx\setup.h - Creating ..\..\lib\vc_lib\mswd\wx\setup.h - ..\..\lib\vc_lib\mswd\wx\setup.h;%(Outputs) - ..\..\lib\vc_lib\mswd\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_lib\mswud\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_lib\mswud\wx\setup.h - Creating ..\..\lib\vc_lib\mswud\wx\setup.h - Creating ..\..\lib\vc_lib\mswud\wx\setup.h - ..\..\lib\vc_lib\mswud\wx\setup.h;%(Outputs) - ..\..\lib\vc_lib\mswud\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_dll\mswd\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_dll\mswd\wx\setup.h - Creating ..\..\lib\vc_dll\mswd\wx\setup.h - Creating ..\..\lib\vc_dll\mswd\wx\setup.h - ..\..\lib\vc_dll\mswd\wx\setup.h;%(Outputs) - ..\..\lib\vc_dll\mswd\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_dll\msw\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_dll\msw\wx\setup.h - Creating ..\..\lib\vc_dll\msw\wx\setup.h - Creating ..\..\lib\vc_dll\msw\wx\setup.h - ..\..\lib\vc_dll\msw\wx\setup.h;%(Outputs) - ..\..\lib\vc_dll\msw\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_lib\msw\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_lib\msw\wx\setup.h - Creating ..\..\lib\vc_lib\msw\wx\setup.h - Creating ..\..\lib\vc_lib\msw\wx\setup.h - ..\..\lib\vc_lib\msw\wx\setup.h;%(Outputs) - ..\..\lib\vc_lib\msw\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_dll\mswud\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_dll\mswud\wx\setup.h - Creating ..\..\lib\vc_dll\mswud\wx\setup.h - Creating ..\..\lib\vc_dll\mswud\wx\setup.h - ..\..\lib\vc_dll\mswud\wx\setup.h;%(Outputs) - ..\..\lib\vc_dll\mswud\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_dll\mswu\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_dll\mswu\wx\setup.h - Creating ..\..\lib\vc_dll\mswu\wx\setup.h - Creating ..\..\lib\vc_dll\mswu\wx\setup.h - ..\..\lib\vc_dll\mswu\wx\setup.h;%(Outputs) - ..\..\lib\vc_dll\mswu\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_lib\mswu\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_lib\mswu\wx\setup.h - Creating ..\..\lib\vc_lib\mswu\wx\setup.h - Creating ..\..\lib\vc_lib\mswu\wx\setup.h - ..\..\lib\vc_lib\mswu\wx\setup.h;%(Outputs) - ..\..\lib\vc_lib\mswu\wx\setup.h;%(Outputs) - - - copy "%(FullPath)" ..\..\lib\vc_dll\mswunivd\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_dll\mswunivd\wx\setup.h - Creating ..\..\lib\vc_dll\mswunivd\wx\setup.h - Creating ..\..\lib\vc_dll\mswunivd\wx\setup.h - ..\..\lib\vc_dll\mswunivd\wx\setup.h;%(Outputs) - ..\..\lib\vc_dll\mswunivd\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_lib\mswuniv\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_lib\mswuniv\wx\setup.h - Creating ..\..\lib\vc_lib\mswuniv\wx\setup.h - Creating ..\..\lib\vc_lib\mswuniv\wx\setup.h - ..\..\lib\vc_lib\mswuniv\wx\setup.h;%(Outputs) - ..\..\lib\vc_lib\mswuniv\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_lib\mswunivd\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_lib\mswunivd\wx\setup.h - Creating ..\..\lib\vc_lib\mswunivd\wx\setup.h - Creating ..\..\lib\vc_lib\mswunivd\wx\setup.h - ..\..\lib\vc_lib\mswunivd\wx\setup.h;%(Outputs) - ..\..\lib\vc_lib\mswunivd\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_dll\mswunivud\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_dll\mswunivud\wx\setup.h - Creating ..\..\lib\vc_dll\mswunivud\wx\setup.h - Creating ..\..\lib\vc_dll\mswunivud\wx\setup.h - ..\..\lib\vc_dll\mswunivud\wx\setup.h;%(Outputs) - ..\..\lib\vc_dll\mswunivud\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_dll\mswunivu\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_dll\mswunivu\wx\setup.h - Creating ..\..\lib\vc_dll\mswunivu\wx\setup.h - Creating ..\..\lib\vc_dll\mswunivu\wx\setup.h - ..\..\lib\vc_dll\mswunivu\wx\setup.h;%(Outputs) - ..\..\lib\vc_dll\mswunivu\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_lib\mswunivud\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_lib\mswunivud\wx\setup.h - Creating ..\..\lib\vc_lib\mswunivud\wx\setup.h - Creating ..\..\lib\vc_lib\mswunivud\wx\setup.h - ..\..\lib\vc_lib\mswunivud\wx\setup.h;%(Outputs) - ..\..\lib\vc_lib\mswunivud\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_dll\mswuniv\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_dll\mswuniv\wx\setup.h - Creating ..\..\lib\vc_dll\mswuniv\wx\setup.h - Creating ..\..\lib\vc_dll\mswuniv\wx\setup.h - ..\..\lib\vc_dll\mswuniv\wx\setup.h;%(Outputs) - ..\..\lib\vc_dll\mswuniv\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_lib\mswunivu\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_lib\mswunivu\wx\setup.h - Creating ..\..\lib\vc_lib\mswunivu\wx\setup.h - Creating ..\..\lib\vc_lib\mswunivu\wx\setup.h - ..\..\lib\vc_lib\mswunivu\wx\setup.h;%(Outputs) - ..\..\lib\vc_lib\mswunivu\wx\setup.h;%(Outputs) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswd\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswd\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_lib\mswd\wx\msw\rcdefs.h - Creating ..\..\lib\vc_lib\mswd\wx\msw\rcdefs.h - ..\..\lib\vc_lib\mswd\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_lib\mswd\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswunivd\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswunivd\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_dll\mswunivd\wx\msw\rcdefs.h - Creating ..\..\lib\vc_dll\mswunivd\wx\msw\rcdefs.h - ..\..\lib\vc_dll\mswunivd\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_dll\mswunivd\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswud\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswud\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_lib\mswud\wx\msw\rcdefs.h - Creating ..\..\lib\vc_lib\mswud\wx\msw\rcdefs.h - ..\..\lib\vc_lib\mswud\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_lib\mswud\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswuniv\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswuniv\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_lib\mswuniv\wx\msw\rcdefs.h - Creating ..\..\lib\vc_lib\mswuniv\wx\msw\rcdefs.h - ..\..\lib\vc_lib\mswuniv\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_lib\mswuniv\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswunivd\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswunivd\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_lib\mswunivd\wx\msw\rcdefs.h - Creating ..\..\lib\vc_lib\mswunivd\wx\msw\rcdefs.h - ..\..\lib\vc_lib\mswunivd\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_lib\mswunivd\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswunivud\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswunivud\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_dll\mswunivud\wx\msw\rcdefs.h - Creating ..\..\lib\vc_dll\mswunivud\wx\msw\rcdefs.h - ..\..\lib\vc_dll\mswunivud\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_dll\mswunivud\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswunivu\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswunivu\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_dll\mswunivu\wx\msw\rcdefs.h - Creating ..\..\lib\vc_dll\mswunivu\wx\msw\rcdefs.h - ..\..\lib\vc_dll\mswunivu\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_dll\mswunivu\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswd\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswd\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_dll\mswd\wx\msw\rcdefs.h - Creating ..\..\lib\vc_dll\mswd\wx\msw\rcdefs.h - ..\..\lib\vc_dll\mswd\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_dll\mswd\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\msw\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\msw\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_dll\msw\wx\msw\rcdefs.h - Creating ..\..\lib\vc_dll\msw\wx\msw\rcdefs.h - ..\..\lib\vc_dll\msw\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_dll\msw\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswunivud\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswunivud\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_lib\mswunivud\wx\msw\rcdefs.h - Creating ..\..\lib\vc_lib\mswunivud\wx\msw\rcdefs.h - ..\..\lib\vc_lib\mswunivud\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_lib\mswunivud\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\msw\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\msw\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_lib\msw\wx\msw\rcdefs.h - Creating ..\..\lib\vc_lib\msw\wx\msw\rcdefs.h - ..\..\lib\vc_lib\msw\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_lib\msw\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswud\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswud\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_dll\mswud\wx\msw\rcdefs.h - Creating ..\..\lib\vc_dll\mswud\wx\msw\rcdefs.h - ..\..\lib\vc_dll\mswud\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_dll\mswud\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswu\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswu\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_dll\mswu\wx\msw\rcdefs.h - Creating ..\..\lib\vc_dll\mswu\wx\msw\rcdefs.h - ..\..\lib\vc_dll\mswu\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_dll\mswu\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswuniv\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswuniv\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_dll\mswuniv\wx\msw\rcdefs.h - Creating ..\..\lib\vc_dll\mswuniv\wx\msw\rcdefs.h - ..\..\lib\vc_dll\mswuniv\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_dll\mswuniv\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswunivu\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswunivu\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_lib\mswunivu\wx\msw\rcdefs.h - Creating ..\..\lib\vc_lib\mswunivu\wx\msw\rcdefs.h - ..\..\lib\vc_lib\mswunivu\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_lib\mswunivu\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswu\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswu\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_lib\mswu\wx\msw\rcdefs.h - Creating ..\..\lib\vc_lib\mswu\wx\msw\rcdefs.h - ..\..\lib\vc_lib\mswu\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_lib\mswu\wx\msw\rcdefs.h;%(Outputs) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/wxWidgets/build/msw/wx_core.vcxproj.filters b/wxWidgets/build/msw/wx_core.vcxproj.filters deleted file mode 100644 index 29b1ddb16a..0000000000 --- a/wxWidgets/build/msw/wx_core.vcxproj.filters +++ /dev/null @@ -1,2281 +0,0 @@ - - - - - {a71bc7ee-1cf5-4888-9dec-c110059bb906} - - - {11fdbf74-a904-4aff-963b-bbf9678dc32d} - - - {2aa85aa6-bff4-447e-a167-54df22ee9490} - - - {6649bf1b-346d-4e0a-b2f6-7cc50aaf37a7} - - - {1ffe1f09-14bc-4bf5-bc25-9f335a4e9182} - - - {0e2c9ec0-f729-4b2e-b803-470d3e707202} - - - {5f5d28d6-d330-45e3-abdd-3682392cedb7} - - - {9465099f-0417-469d-89d3-f2a832edfbe2} - - - {6227f6cf-92b8-42e4-a349-37bd60c910a3} - - - {752fbe29-63a8-4b25-8c9f-f3d5673a385d} - - - - - Common Sources - - - Common Sources - - - Common Sources - - - Common Sources - - - Common Sources - - - Common Sources - - - Common Sources - - - Common Sources - - - Common Sources - - - Common Sources - - - Common Sources - - - Common Sources - - - Common Sources - - - Common Sources - - - Common Sources - - - Common Sources - - - Common Sources - - - Common Sources - - - Common Sources - - - Common Sources - - - Common Sources - - - Common Sources - - - Common Sources - - - Common Sources - - - Common Sources - - - Common Sources - - - Common Sources - - - Common Sources - - - Common Sources - - - Common Sources - - - Common Sources - - - Common Sources - - - Common Sources - - - Common Sources - - - Common Sources - - - Common Sources - - - Common Sources - - - Common Sources - - - Common Sources - - - Common Sources - - - Common Sources - - - Common Sources - - - Common Sources - - - Common Sources - - - Common Sources - - - Common Sources - - - Common Sources - - - Common Sources - - - Common Sources - - - Common Sources - - - Common Sources - - - Common Sources - - - Common Sources - - - Common Sources - - - Common Sources - - - Common Sources - - - Common Sources - - - Common Sources - - - Common Sources - - - Common Sources - - - Common Sources - - - Common Sources - - - Common Sources - - - Common Sources - - - Common Sources - - - Common Sources - - - Common Sources - - - Common Sources - - - Common Sources - - - Common Sources - - - Common Sources - - - Common Sources - - - Common Sources - - - Common Sources - - - Common Sources - - - Common Sources - - - Common Sources - - - Common Sources - - - Common Sources - - - Common Sources - - - Common Sources - - - Common Sources - - - Common Sources - - - Common Sources - - - Common Sources - - - Common Sources - - - Common Sources - - - Common Sources - - - Common Sources - - - Common Sources - - - Common Sources - - - Common Sources - - - Common Sources - - - Common Sources - - - Common Sources - - - MSW Sources - - - MSW Sources - - - MSW Sources - - - MSW Sources - - - MSW Sources - - - MSW Sources - - - MSW Sources - - - MSW Sources - - - MSW Sources - - - MSW Sources - - - MSW Sources - - - MSW Sources - - - MSW Sources - - - MSW Sources - - - MSW Sources - - - MSW Sources - - - MSW Sources - - - MSW Sources - - - MSW Sources - - - MSW Sources - - - MSW Sources - - - MSW Sources - - - MSW Sources - - - MSW Sources - - - MSW Sources - - - MSW Sources - - - MSW Sources - - - MSW Sources - - - MSW Sources - - - MSW Sources - - - MSW Sources - - - MSW Sources - - - MSW Sources - - - MSW Sources - - - MSW Sources - - - MSW Sources - - - MSW Sources - - - MSW Sources - - - MSW Sources - - - MSW Sources - - - MSW Sources - - - MSW Sources - - - MSW Sources - - - MSW Sources - - - MSW Sources - - - MSW Sources - - - MSW Sources - - - MSW Sources - - - MSW Sources - - - MSW Sources - - - MSW Sources - - - MSW Sources - - - MSW Sources - - - MSW Sources - - - MSW Sources - - - MSW Sources - - - MSW Sources - - - MSW Sources - - - MSW Sources - - - MSW Sources - - - MSW Sources - - - MSW Sources - - - MSW Sources - - - MSW Sources - - - MSW Sources - - - MSW Sources - - - MSW Sources - - - MSW Sources - - - MSW Sources - - - MSW Sources - - - MSW Sources - - - MSW Sources - - - MSW Sources - - - MSW Sources - - - MSW Sources - - - MSW Sources - - - MSW Sources - - - MSW Sources - - - MSW Sources - - - MSW Sources - - - MSW Sources - - - MSW Sources - - - MSW Sources - - - MSW Sources - - - MSW Sources - - - MSW Sources - - - MSW Sources - - - MSW Sources - - - MSW Sources - - - MSW Sources - - - MSW Sources - - - MSW Sources - - - MSW Sources - - - MSW Sources - - - MSW Sources - - - MSW Sources - - - MSW Sources - - - MSW Sources - - - MSW Sources - - - Generic Sources - - - Generic Sources - - - Generic Sources - - - Generic Sources - - - Generic Sources - - - Generic Sources - - - Generic Sources - - - Generic Sources - - - Generic Sources - - - Generic Sources - - - Generic Sources - - - Generic Sources - - - Generic Sources - - - Generic Sources - - - Generic Sources - - - Generic Sources - - - Generic Sources - - - Generic Sources - - - Generic Sources - - - Generic Sources - - - Generic Sources - - - Generic Sources - - - Generic Sources - - - Generic Sources - - - Generic Sources - - - Generic Sources - - - Generic Sources - - - Generic Sources - - - Generic Sources - - - Generic Sources - - - Generic Sources - - - Generic Sources - - - Generic Sources - - - Generic Sources - - - Generic Sources - - - Generic Sources - - - Generic Sources - - - Generic Sources - - - Generic Sources - - - Generic Sources - - - Generic Sources - - - Generic Sources - - - Generic Sources - - - Generic Sources - - - wxUniv Sources - - - wxUniv Sources - - - wxUniv Sources - - - wxUniv Sources - - - wxUniv Sources - - - wxUniv Sources - - - wxUniv Sources - - - wxUniv Sources - - - wxUniv Sources - - - wxUniv Sources - - - wxUniv Sources - - - wxUniv Sources - - - wxUniv Sources - - - wxUniv Sources - - - wxUniv Sources - - - wxUniv Sources - - - wxUniv Sources - - - wxUniv Sources - - - wxUniv Sources - - - wxUniv Sources - - - wxUniv Sources - - - wxUniv Sources - - - wxUniv Sources - - - wxUniv Sources - - - wxUniv Sources - - - wxUniv Sources - - - wxUniv Sources - - - wxUniv Sources - - - wxUniv Sources - - - wxUniv Sources - - - wxUniv Sources - - - wxUniv Sources - - - wxUniv Sources - - - wxUniv Sources - - - wxUniv Sources - - - wxUniv Sources - - - wxUniv Sources - - - wxUniv Sources - - - wxUniv Sources - - - wxUniv Sources - - - - - MSW Sources - - - - - MSW Headers - - - MSW Headers - - - MSW Headers - - - MSW Headers - - - MSW Headers - - - MSW Headers - - - MSW Headers - - - MSW Headers - - - MSW Headers - - - MSW Headers - - - MSW Headers - - - MSW Headers - - - MSW Headers - - - MSW Headers - - - MSW Headers - - - MSW Headers - - - MSW Headers - - - MSW Headers - - - MSW Headers - - - MSW Headers - - - MSW Headers - - - MSW Headers - - - MSW Headers - - - MSW Headers - - - MSW Headers - - - MSW Headers - - - MSW Headers - - - MSW Headers - - - MSW Headers - - - MSW Headers - - - MSW Headers - - - MSW Headers - - - MSW Headers - - - MSW Headers - - - MSW Headers - - - MSW Headers - - - MSW Headers - - - MSW Headers - - - MSW Headers - - - MSW Headers - - - MSW Headers - - - MSW Headers - - - MSW Headers - - - MSW Headers - - - MSW Headers - - - MSW Headers - - - MSW Headers - - - MSW Headers - - - MSW Headers - - - MSW Headers - - - MSW Headers - - - MSW Headers - - - MSW Headers - - - MSW Headers - - - MSW Headers - - - MSW Headers - - - MSW Headers - - - MSW Headers - - - MSW Headers - - - MSW Headers - - - MSW Headers - - - MSW Headers - - - MSW Headers - - - MSW Headers - - - MSW Headers - - - MSW Headers - - - MSW Headers - - - MSW Headers - - - MSW Headers - - - MSW Headers - - - MSW Headers - - - MSW Headers - - - MSW Headers - - - MSW Headers - - - MSW Headers - - - MSW Headers - - - MSW Headers - - - MSW Headers - - - MSW Headers - - - MSW Headers - - - MSW Headers - - - MSW Headers - - - MSW Headers - - - MSW Headers - - - MSW Headers - - - MSW Headers - - - MSW Headers - - - MSW Headers - - - MSW Headers - - - MSW Headers - - - MSW Headers - - - MSW Headers - - - MSW Headers - - - MSW Headers - - - MSW Headers - - - MSW Headers - - - MSW Headers - - - MSW Headers - - - Generic Headers - - - Generic Headers - - - Generic Headers - - - Generic Headers - - - Generic Headers - - - Generic Headers - - - Generic Headers - - - Generic Headers - - - Generic Headers - - - Generic Headers - - - Generic Headers - - - Generic Headers - - - Generic Headers - - - Generic Headers - - - Generic Headers - - - Generic Headers - - - Generic Headers - - - Generic Headers - - - Generic Headers - - - Generic Headers - - - Generic Headers - - - Generic Headers - - - Generic Headers - - - Generic Headers - - - Generic Headers - - - Generic Headers - - - Generic Headers - - - Generic Headers - - - Generic Headers - - - Generic Headers - - - Generic Headers - - - Generic Headers - - - Generic Headers - - - Generic Headers - - - Generic Headers - - - Generic Headers - - - Generic Headers - - - Generic Headers - - - Generic Headers - - - Generic Headers - - - Generic Headers - - - Generic Headers - - - Generic Headers - - - Generic Headers - - - Generic Headers - - - Generic Headers - - - Generic Headers - - - Generic Headers - - - Generic Headers - - - Generic Headers - - - Generic Headers - - - wxUniv Headers - - - wxUniv Headers - - - wxUniv Headers - - - wxUniv Headers - - - wxUniv Headers - - - wxUniv Headers - - - wxUniv Headers - - - wxUniv Headers - - - wxUniv Headers - - - wxUniv Headers - - - wxUniv Headers - - - wxUniv Headers - - - wxUniv Headers - - - wxUniv Headers - - - wxUniv Headers - - - wxUniv Headers - - - wxUniv Headers - - - wxUniv Headers - - - wxUniv Headers - - - wxUniv Headers - - - wxUniv Headers - - - wxUniv Headers - - - wxUniv Headers - - - wxUniv Headers - - - wxUniv Headers - - - wxUniv Headers - - - wxUniv Headers - - - wxUniv Headers - - - wxUniv Headers - - - wxUniv Headers - - - wxUniv Headers - - - wxUniv Headers - - - wxUniv Headers - - - wxUniv Headers - - - wxUniv Headers - - - wxUniv Headers - - - wxUniv Headers - - - wxUniv Headers - - - wxUniv Headers - - - wxUniv Headers - - - wxHTML Headers - - - wxHTML Headers - - - wxHTML Headers - - - wxHTML Headers - - - wxHTML Headers - - - wxHTML Headers - - - wxHTML Headers - - - wxHTML Headers - - - wxHTML Headers - - - wxHTML Headers - - - wxHTML Headers - - - wxHTML Headers - - - wxHTML Headers - - - wxHTML Headers - - - wxHTML Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - - - Setup Headers - - - Setup Headers - - - MSW Headers - - - \ No newline at end of file diff --git a/wxWidgets/build/msw/wx_dbgrid.vcxproj b/wxWidgets/build/msw/wx_dbgrid.vcxproj deleted file mode 100644 index b78be01a84..0000000000 --- a/wxWidgets/build/msw/wx_dbgrid.vcxproj +++ /dev/null @@ -1,2244 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - DLL Debug - Win32 - - - DLL Debug - x64 - - - DLL Release - Win32 - - - DLL Release - x64 - - - DLL Unicode Debug - Win32 - - - DLL Unicode Debug - x64 - - - DLL Unicode Release - Win32 - - - DLL Unicode Release - x64 - - - DLL Universal Debug - Win32 - - - DLL Universal Debug - x64 - - - DLL Universal Release - Win32 - - - DLL Universal Release - x64 - - - DLL Universal Unicode Debug - Win32 - - - DLL Universal Unicode Debug - x64 - - - DLL Universal Unicode Release - Win32 - - - DLL Universal Unicode Release - x64 - - - Release - Win32 - - - Release - x64 - - - Template - Win32 - - - Template - x64 - - - Unicode Debug - Win32 - - - Unicode Debug - x64 - - - Unicode Release - Win32 - - - Unicode Release - x64 - - - Universal Debug - Win32 - - - Universal Debug - x64 - - - Universal Release - Win32 - - - Universal Release - x64 - - - Universal Unicode Debug - Win32 - - - Universal Unicode Debug - x64 - - - Universal Unicode Release - Win32 - - - Universal Unicode Release - x64 - - - - dbgrid - - - {9ED1866B-D4AE-3440-24E4-7A9475B163B2} - - - - Application - v110 - - - Application - v110 - - - StaticLibrary - false - Unicode - v110 - - - StaticLibrary - false - Unicode - v110 - - - DynamicLibrary - false - v110 - - - DynamicLibrary - false - v110 - - - DynamicLibrary - false - Unicode - v110 - - - DynamicLibrary - false - Unicode - v110 - - - StaticLibrary - false - Unicode - v110 - - - StaticLibrary - false - Unicode - v110 - - - DynamicLibrary - false - v110 - - - DynamicLibrary - false - v110 - - - StaticLibrary - false - Unicode - v110 - - - StaticLibrary - false - Unicode - v110 - - - DynamicLibrary - false - Unicode - v110 - - - DynamicLibrary - false - Unicode - v110 - - - DynamicLibrary - false - v110 - - - DynamicLibrary - false - v110 - - - DynamicLibrary - false - Unicode - v110 - - - DynamicLibrary - false - Unicode - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - DynamicLibrary - false - Unicode - v110 - - - DynamicLibrary - false - Unicode - v110 - - - StaticLibrary - false - Unicode - v110 - - - StaticLibrary - false - Unicode - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - DynamicLibrary - false - v110 - - - DynamicLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - .\..\..\lib\vc_lib\ - .\vc_mswunivd\dbgrid\ - - - .\..\..\lib\vc_lib\ - .\vc_mswunivd\dbgrid\ - - - .\..\..\lib\vc_lib\ - .\vc_mswuniv\dbgrid\ - - - .\..\..\lib\vc_lib\ - .\vc_mswuniv\dbgrid\ - - - .\..\..\lib\vc_dll\ - .\vc_mswddll\dbgrid\ - true - - - .\..\..\lib\vc_dll\ - .\vc_mswddll\dbgrid\ - true - - - .\..\..\lib\vc_lib\ - .\vc_mswd\dbgrid\ - - - .\..\..\lib\vc_lib\ - .\vc_mswd\dbgrid\ - - - .\..\..\lib\vc_lib\ - .\vc_mswunivu\dbgrid\ - - - .\..\..\lib\vc_lib\ - .\vc_mswunivu\dbgrid\ - - - .\..\..\lib\vc_dll\ - .\vc_mswunivudll\dbgrid\ - false - - - .\..\..\lib\vc_dll\ - .\vc_mswunivudll\dbgrid\ - false - - - .\..\..\lib\vc_lib\ - .\vc_msw\dbgrid\ - - - .\..\..\lib\vc_lib\ - .\vc_msw\dbgrid\ - - - .\..\..\lib\vc_dll\ - .\vc_mswunivuddll\dbgrid\ - true - - - .\..\..\lib\vc_dll\ - .\vc_mswunivuddll\dbgrid\ - true - - - .\..\..\lib\vc_dll\ - .\vc_mswdll\dbgrid\ - false - - - .\..\..\lib\vc_dll\ - .\vc_mswdll\dbgrid\ - false - - - .\..\..\lib\vc_dll\ - .\vc_mswudll\dbgrid\ - false - - - .\..\..\lib\vc_dll\ - .\vc_mswudll\dbgrid\ - false - - - .\..\..\lib\vc_lib\ - .\vc_mswunivud\dbgrid\ - - - .\..\..\lib\vc_lib\ - .\vc_mswunivud\dbgrid\ - - - .\..\..\lib\vc_dll\ - .\vc_mswunivdll\dbgrid\ - false - - - .\..\..\lib\vc_dll\ - .\vc_mswunivdll\dbgrid\ - false - - - .\..\..\lib\vc_lib\ - .\vc_mswu\dbgrid\ - - - .\..\..\lib\vc_lib\ - .\vc_mswu\dbgrid\ - - - .\..\..\lib\vc_dll\ - .\vc_mswuddll\dbgrid\ - true - - - .\..\..\lib\vc_dll\ - .\vc_mswuddll\dbgrid\ - true - - - .\..\..\lib\vc_dll\ - .\vc_mswunivddll\dbgrid\ - true - - - .\..\..\lib\vc_dll\ - .\vc_mswunivddll\dbgrid\ - true - - - .\..\..\lib\vc_lib\ - .\vc_mswud\dbgrid\ - - - .\..\..\lib\vc_lib\ - .\vc_mswud\dbgrid\ - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - true - ..\..\lib\vc_lib\mswunivd;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;WXBUILDING;%(PreprocessorDefinitions) - .\vc_mswunivd\dbgrid\ - vc_mswunivd\wxprec_dbgridlib.pch - Use - wx/wxprec.h - .\vc_mswunivd\dbgrid\ - ..\..\lib\vc_lib\wxmswuniv28d_dbgrid.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_dbgrid.bsc - - - true - ..\..\lib\vc_lib\wxmswuniv28d_dbgrid.lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - ..\..\lib\vc_lib\mswunivd;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;WXBUILDING;%(PreprocessorDefinitions) - .\vc_mswunivd\dbgrid\ - vc_mswunivd\wxprec_dbgridlib.pch - Use - wx/wxprec.h - .\vc_mswunivd\dbgrid\ - ..\..\lib\vc_lib\wxmswuniv28d_dbgrid.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_dbgrid.bsc - - - true - ..\..\lib\vc_lib\wxmswuniv28d_dbgrid.lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_lib\mswuniv;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;__WXMSW__;__WXUNIVERSAL__;NDEBUG;WXBUILDING;%(PreprocessorDefinitions) - .\vc_mswuniv\dbgrid\ - vc_mswuniv\wxprec_dbgridlib.pch - Use - wx/wxprec.h - .\vc_mswuniv\dbgrid\ - ..\..\lib\vc_lib\wxmswuniv28_dbgrid.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_dbgrid.bsc - - - true - ..\..\lib\vc_lib\wxmswuniv28_dbgrid.lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_lib\mswuniv;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;__WXMSW__;__WXUNIVERSAL__;NDEBUG;WXBUILDING;%(PreprocessorDefinitions) - .\vc_mswuniv\dbgrid\ - vc_mswuniv\wxprec_dbgridlib.pch - Use - wx/wxprec.h - .\vc_mswuniv\dbgrid\ - ..\..\lib\vc_lib\wxmswuniv28_dbgrid.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_dbgrid.bsc - - - true - ..\..\lib\vc_lib\wxmswuniv28_dbgrid.lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - true - ..\..\lib\vc_dll\mswd;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXDEBUG__;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_DBGRID;%(PreprocessorDefinitions) - .\vc_mswddll\dbgrid\ - vc_mswddll\wxprec_dbgriddll.pch - Use - wx/wxprec.h - .\vc_mswddll\dbgrid\ - ..\..\lib\vc_dll\wxmsw28d_dbgrid_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXDEBUG__;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_DBGRID;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_dbgrid.tlb - true - Win32 - - - 0x0409 - ..\..\lib\vc_dll\mswd;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - _DEBUG;__WXMSW__;__WXDEBUG__;WXBUILDING;WXDLLNAME=wxmsw28d_dbgrid_vc_custom;WXUSINGDLL;WXMAKINGDLL_DBGRID;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_dbgrid.bsc - - - true - true - true - Console - ..\..\lib\vc_dll\wxmsw28d_dbgrid_vc_custom.dll - ..\..\lib\vc_dll\wxmsw28d_dbgrid.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxtiffd.lib;wxjpegd.lib;wxpngd.lib;wxzlibd.lib;wxregexd.lib;wxexpatd.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxmsw28d_adv.lib;..\..\lib\vc_dll\wxbase28d_odbc.lib;..\..\lib\vc_dll\wxmsw28d_core.lib;..\..\lib\vc_dll\wxbase28d.lib;%(AdditionalDependencies) - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - ..\..\lib\vc_dll\mswd;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXDEBUG__;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_DBGRID;%(PreprocessorDefinitions) - .\vc_mswddll\dbgrid\ - vc_mswddll\wxprec_dbgriddll.pch - Use - wx/wxprec.h - .\vc_mswddll\dbgrid\ - ..\..\lib\vc_dll\wxmsw28d_dbgrid_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXDEBUG__;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_DBGRID;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_dbgrid.tlb - true - - - 0x0409 - ..\..\lib\vc_dll\mswd;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - _DEBUG;__WXMSW__;__WXDEBUG__;WXBUILDING;WXDLLNAME=wxmsw28d_dbgrid_vc_custom;WXUSINGDLL;WXMAKINGDLL_DBGRID;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_dbgrid.bsc - - - true - true - true - Console - ..\..\lib\vc_dll\wxmsw28d_dbgrid_vc_custom.dll - ..\..\lib\vc_dll\wxmsw28d_dbgrid.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxtiffd.lib;wxjpegd.lib;wxpngd.lib;wxzlibd.lib;wxregexd.lib;wxexpatd.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxmsw28d_adv.lib;..\..\lib\vc_dll\wxbase28d_odbc.lib;..\..\lib\vc_dll\wxmsw28d_core.lib;..\..\lib\vc_dll\wxbase28d.lib;%(AdditionalDependencies) - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - true - ..\..\lib\vc_lib\mswd;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;__WXMSW__;__WXDEBUG__;WXBUILDING;%(PreprocessorDefinitions) - .\vc_mswd\dbgrid\ - vc_mswd\wxprec_dbgridlib.pch - Use - wx/wxprec.h - .\vc_mswd\dbgrid\ - ..\..\lib\vc_lib\wxmsw28d_dbgrid.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_dbgrid.bsc - - - true - .\..\..\..\libs\$(Configuration)\$(ProjectName).lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - ..\..\lib\vc_lib\mswd;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;__WXMSW__;__WXDEBUG__;WXBUILDING;%(PreprocessorDefinitions) - .\vc_mswd\dbgrid\ - vc_mswd\wxprec_dbgridlib.pch - Use - wx/wxprec.h - .\vc_mswd\dbgrid\ - ..\..\lib\vc_lib\wxmsw28d_dbgrid.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_dbgrid.bsc - - - true - .\..\..\..\libs\$(Configuration)\$(ProjectName).lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_lib\mswunivu;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;__WXMSW__;__WXUNIVERSAL__;NDEBUG;WXBUILDING;%(PreprocessorDefinitions) - .\vc_mswunivu\dbgrid\ - vc_mswunivu\wxprec_dbgridlib.pch - Use - wx/wxprec.h - .\vc_mswunivu\dbgrid\ - ..\..\lib\vc_lib\wxmswuniv28u_dbgrid.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_dbgrid.bsc - - - true - ..\..\lib\vc_lib\wxmswuniv28u_dbgrid.lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_lib\mswunivu;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;__WXMSW__;__WXUNIVERSAL__;NDEBUG;WXBUILDING;%(PreprocessorDefinitions) - .\vc_mswunivu\dbgrid\ - vc_mswunivu\wxprec_dbgridlib.pch - Use - wx/wxprec.h - .\vc_mswunivu\dbgrid\ - ..\..\lib\vc_lib\wxmswuniv28u_dbgrid.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_dbgrid.bsc - - - true - ..\..\lib\vc_lib\wxmswuniv28u_dbgrid.lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_dll\mswunivu;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;__WXUNIVERSAL__;NDEBUG;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_DBGRID;%(PreprocessorDefinitions) - .\vc_mswunivudll\dbgrid\ - vc_mswunivudll\wxprec_dbgriddll.pch - Use - wx/wxprec.h - .\vc_mswunivudll\dbgrid\ - ..\..\lib\vc_dll\wxmswuniv28u_dbgrid_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;__WXUNIVERSAL__;NDEBUG;_UNICODE;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_DBGRID;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_dbgrid.tlb - true - Win32 - - - 0x0409 - ..\..\lib\vc_dll\mswunivu;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - __WXMSW__;__WXUNIVERSAL__;NDEBUG;_UNICODE;WXBUILDING;WXDLLNAME=wxmswuniv28u_dbgrid_vc_custom;WXUSINGDLL;WXMAKINGDLL_DBGRID;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_dbgrid.bsc - - - true - true - Console - ..\..\lib\vc_dll\wxmswuniv28u_dbgrid_vc_custom.dll - ..\..\lib\vc_dll\wxmswuniv28u_dbgrid.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxtiff.lib;wxjpeg.lib;wxpng.lib;wxzlib.lib;wxregexu.lib;wxexpat.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxmswuniv28u_adv.lib;..\..\lib\vc_dll\wxbase28u_odbc.lib;..\..\lib\vc_dll\wxmswuniv28u_core.lib;..\..\lib\vc_dll\wxbase28u.lib;%(AdditionalDependencies) - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_dll\mswunivu;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;__WXUNIVERSAL__;NDEBUG;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_DBGRID;%(PreprocessorDefinitions) - .\vc_mswunivudll\dbgrid\ - vc_mswunivudll\wxprec_dbgriddll.pch - Use - wx/wxprec.h - .\vc_mswunivudll\dbgrid\ - ..\..\lib\vc_dll\wxmswuniv28u_dbgrid_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;__WXUNIVERSAL__;NDEBUG;_UNICODE;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_DBGRID;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_dbgrid.tlb - true - - - 0x0409 - ..\..\lib\vc_dll\mswunivu;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - __WXMSW__;__WXUNIVERSAL__;NDEBUG;_UNICODE;WXBUILDING;WXDLLNAME=wxmswuniv28u_dbgrid_vc_custom;WXUSINGDLL;WXMAKINGDLL_DBGRID;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_dbgrid.bsc - - - true - true - Console - ..\..\lib\vc_dll\wxmswuniv28u_dbgrid_vc_custom.dll - ..\..\lib\vc_dll\wxmswuniv28u_dbgrid.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxtiff.lib;wxjpeg.lib;wxpng.lib;wxzlib.lib;wxregexu.lib;wxexpat.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxmswuniv28u_adv.lib;..\..\lib\vc_dll\wxbase28u_odbc.lib;..\..\lib\vc_dll\wxmswuniv28u_core.lib;..\..\lib\vc_dll\wxbase28u.lib;%(AdditionalDependencies) - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_lib\msw;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;__WXMSW__;NDEBUG;WXBUILDING;%(PreprocessorDefinitions) - .\vc_msw\dbgrid\ - vc_msw\wxprec_dbgridlib.pch - Use - wx/wxprec.h - .\vc_msw\dbgrid\ - ..\..\lib\vc_lib\wxmsw28_dbgrid.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_dbgrid.bsc - - - true - .\..\..\..\libs\$(Configuration)\$(ProjectName).lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_lib\msw;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;__WXMSW__;NDEBUG;WXBUILDING;%(PreprocessorDefinitions) - .\vc_msw\dbgrid\ - vc_msw\wxprec_dbgridlib.pch - Use - wx/wxprec.h - .\vc_msw\dbgrid\ - ..\..\lib\vc_lib\wxmsw28_dbgrid.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_dbgrid.bsc - - - true - .\..\..\..\libs\$(Configuration)\$(ProjectName).lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - true - ..\..\lib\vc_dll\mswunivud;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_DBGRID;%(PreprocessorDefinitions) - .\vc_mswunivuddll\dbgrid\ - vc_mswunivuddll\wxprec_dbgriddll.pch - Use - wx/wxprec.h - .\vc_mswunivuddll\dbgrid\ - ..\..\lib\vc_dll\wxmswuniv28ud_dbgrid_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;_UNICODE;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_DBGRID;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_dbgrid.tlb - true - Win32 - - - 0x0409 - ..\..\lib\vc_dll\mswunivud;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - _DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;_UNICODE;WXBUILDING;WXDLLNAME=wxmswuniv28ud_dbgrid_vc_custom;WXUSINGDLL;WXMAKINGDLL_DBGRID;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_dbgrid.bsc - - - true - true - true - Console - ..\..\lib\vc_dll\wxmswuniv28ud_dbgrid_vc_custom.dll - ..\..\lib\vc_dll\wxmswuniv28ud_dbgrid.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxtiffd.lib;wxjpegd.lib;wxpngd.lib;wxzlibd.lib;wxregexud.lib;wxexpatd.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxmswuniv28ud_adv.lib;..\..\lib\vc_dll\wxbase28ud_odbc.lib;..\..\lib\vc_dll\wxmswuniv28ud_core.lib;..\..\lib\vc_dll\wxbase28ud.lib;%(AdditionalDependencies) - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - ..\..\lib\vc_dll\mswunivud;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_DBGRID;%(PreprocessorDefinitions) - .\vc_mswunivuddll\dbgrid\ - vc_mswunivuddll\wxprec_dbgriddll.pch - Use - wx/wxprec.h - .\vc_mswunivuddll\dbgrid\ - ..\..\lib\vc_dll\wxmswuniv28ud_dbgrid_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;_UNICODE;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_DBGRID;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_dbgrid.tlb - true - - - 0x0409 - ..\..\lib\vc_dll\mswunivud;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - _DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;_UNICODE;WXBUILDING;WXDLLNAME=wxmswuniv28ud_dbgrid_vc_custom;WXUSINGDLL;WXMAKINGDLL_DBGRID;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_dbgrid.bsc - - - true - true - true - Console - ..\..\lib\vc_dll\wxmswuniv28ud_dbgrid_vc_custom.dll - ..\..\lib\vc_dll\wxmswuniv28ud_dbgrid.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxtiffd.lib;wxjpegd.lib;wxpngd.lib;wxzlibd.lib;wxregexud.lib;wxexpatd.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxmswuniv28ud_adv.lib;..\..\lib\vc_dll\wxbase28ud_odbc.lib;..\..\lib\vc_dll\wxmswuniv28ud_core.lib;..\..\lib\vc_dll\wxbase28ud.lib;%(AdditionalDependencies) - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_dll\msw;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;NDEBUG;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_DBGRID;%(PreprocessorDefinitions) - .\vc_mswdll\dbgrid\ - vc_mswdll\wxprec_dbgriddll.pch - Use - wx/wxprec.h - .\vc_mswdll\dbgrid\ - ..\..\lib\vc_dll\wxmsw28_dbgrid_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;NDEBUG;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_DBGRID;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_dbgrid.tlb - true - Win32 - - - 0x0409 - ..\..\lib\vc_dll\msw;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - __WXMSW__;NDEBUG;WXBUILDING;WXDLLNAME=wxmsw28_dbgrid_vc_custom;WXUSINGDLL;WXMAKINGDLL_DBGRID;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_dbgrid.bsc - - - true - true - Console - ..\..\lib\vc_dll\wxmsw28_dbgrid_vc_custom.dll - ..\..\lib\vc_dll\wxmsw28_dbgrid.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxtiff.lib;wxjpeg.lib;wxpng.lib;wxzlib.lib;wxregex.lib;wxexpat.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxmsw28_adv.lib;..\..\lib\vc_dll\wxbase28_odbc.lib;..\..\lib\vc_dll\wxmsw28_core.lib;..\..\lib\vc_dll\wxbase28.lib;%(AdditionalDependencies) - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_dll\msw;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;NDEBUG;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_DBGRID;%(PreprocessorDefinitions) - .\vc_mswdll\dbgrid\ - vc_mswdll\wxprec_dbgriddll.pch - Use - wx/wxprec.h - .\vc_mswdll\dbgrid\ - ..\..\lib\vc_dll\wxmsw28_dbgrid_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;NDEBUG;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_DBGRID;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_dbgrid.tlb - true - - - 0x0409 - ..\..\lib\vc_dll\msw;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - __WXMSW__;NDEBUG;WXBUILDING;WXDLLNAME=wxmsw28_dbgrid_vc_custom;WXUSINGDLL;WXMAKINGDLL_DBGRID;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_dbgrid.bsc - - - true - true - Console - ..\..\lib\vc_dll\wxmsw28_dbgrid_vc_custom.dll - ..\..\lib\vc_dll\wxmsw28_dbgrid.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxtiff.lib;wxjpeg.lib;wxpng.lib;wxzlib.lib;wxregex.lib;wxexpat.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxmsw28_adv.lib;..\..\lib\vc_dll\wxbase28_odbc.lib;..\..\lib\vc_dll\wxmsw28_core.lib;..\..\lib\vc_dll\wxbase28.lib;%(AdditionalDependencies) - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_dll\mswu;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;NDEBUG;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_DBGRID;%(PreprocessorDefinitions) - .\vc_mswudll\dbgrid\ - vc_mswudll\wxprec_dbgriddll.pch - Use - wx/wxprec.h - .\vc_mswudll\dbgrid\ - ..\..\lib\vc_dll\wxmsw28u_dbgrid_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;NDEBUG;_UNICODE;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_DBGRID;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_dbgrid.tlb - true - Win32 - - - 0x0409 - ..\..\lib\vc_dll\mswu;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - __WXMSW__;NDEBUG;_UNICODE;WXBUILDING;WXDLLNAME=wxmsw28u_dbgrid_vc_custom;WXUSINGDLL;WXMAKINGDLL_DBGRID;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_dbgrid.bsc - - - true - true - Console - ..\..\lib\vc_dll\wxmsw28u_dbgrid_vc_custom.dll - ..\..\lib\vc_dll\wxmsw28u_dbgrid.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxtiff.lib;wxjpeg.lib;wxpng.lib;wxzlib.lib;wxregexu.lib;wxexpat.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxmsw28u_adv.lib;..\..\lib\vc_dll\wxbase28u_odbc.lib;..\..\lib\vc_dll\wxmsw28u_core.lib;..\..\lib\vc_dll\wxbase28u.lib;%(AdditionalDependencies) - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_dll\mswu;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;NDEBUG;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_DBGRID;%(PreprocessorDefinitions) - .\vc_mswudll\dbgrid\ - vc_mswudll\wxprec_dbgriddll.pch - Use - wx/wxprec.h - .\vc_mswudll\dbgrid\ - ..\..\lib\vc_dll\wxmsw28u_dbgrid_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;NDEBUG;_UNICODE;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_DBGRID;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_dbgrid.tlb - true - - - 0x0409 - ..\..\lib\vc_dll\mswu;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - __WXMSW__;NDEBUG;_UNICODE;WXBUILDING;WXDLLNAME=wxmsw28u_dbgrid_vc_custom;WXUSINGDLL;WXMAKINGDLL_DBGRID;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_dbgrid.bsc - - - true - true - Console - ..\..\lib\vc_dll\wxmsw28u_dbgrid_vc_custom.dll - ..\..\lib\vc_dll\wxmsw28u_dbgrid.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxtiff.lib;wxjpeg.lib;wxpng.lib;wxzlib.lib;wxregexu.lib;wxexpat.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxmsw28u_adv.lib;..\..\lib\vc_dll\wxbase28u_odbc.lib;..\..\lib\vc_dll\wxmsw28u_core.lib;..\..\lib\vc_dll\wxbase28u.lib;%(AdditionalDependencies) - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - true - ..\..\lib\vc_lib\mswunivud;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;WXBUILDING;%(PreprocessorDefinitions) - .\vc_mswunivud\dbgrid\ - vc_mswunivud\wxprec_dbgridlib.pch - Use - wx/wxprec.h - .\vc_mswunivud\dbgrid\ - ..\..\lib\vc_lib\wxmswuniv28ud_dbgrid.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_dbgrid.bsc - - - true - ..\..\lib\vc_lib\wxmswuniv28ud_dbgrid.lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - ..\..\lib\vc_lib\mswunivud;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;WXBUILDING;%(PreprocessorDefinitions) - .\vc_mswunivud\dbgrid\ - vc_mswunivud\wxprec_dbgridlib.pch - Use - wx/wxprec.h - .\vc_mswunivud\dbgrid\ - ..\..\lib\vc_lib\wxmswuniv28ud_dbgrid.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_dbgrid.bsc - - - true - ..\..\lib\vc_lib\wxmswuniv28ud_dbgrid.lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_dll\mswuniv;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;__WXUNIVERSAL__;NDEBUG;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_DBGRID;%(PreprocessorDefinitions) - .\vc_mswunivdll\dbgrid\ - vc_mswunivdll\wxprec_dbgriddll.pch - Use - wx/wxprec.h - .\vc_mswunivdll\dbgrid\ - ..\..\lib\vc_dll\wxmswuniv28_dbgrid_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;__WXUNIVERSAL__;NDEBUG;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_DBGRID;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_dbgrid.tlb - true - Win32 - - - 0x0409 - ..\..\lib\vc_dll\mswuniv;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - __WXMSW__;__WXUNIVERSAL__;NDEBUG;WXBUILDING;WXDLLNAME=wxmswuniv28_dbgrid_vc_custom;WXUSINGDLL;WXMAKINGDLL_DBGRID;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_dbgrid.bsc - - - true - true - Console - ..\..\lib\vc_dll\wxmswuniv28_dbgrid_vc_custom.dll - ..\..\lib\vc_dll\wxmswuniv28_dbgrid.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxtiff.lib;wxjpeg.lib;wxpng.lib;wxzlib.lib;wxregex.lib;wxexpat.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxmswuniv28_adv.lib;..\..\lib\vc_dll\wxbase28_odbc.lib;..\..\lib\vc_dll\wxmswuniv28_core.lib;..\..\lib\vc_dll\wxbase28.lib;%(AdditionalDependencies) - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_dll\mswuniv;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;__WXUNIVERSAL__;NDEBUG;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_DBGRID;%(PreprocessorDefinitions) - .\vc_mswunivdll\dbgrid\ - vc_mswunivdll\wxprec_dbgriddll.pch - Use - wx/wxprec.h - .\vc_mswunivdll\dbgrid\ - ..\..\lib\vc_dll\wxmswuniv28_dbgrid_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;__WXUNIVERSAL__;NDEBUG;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_DBGRID;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_dbgrid.tlb - true - - - 0x0409 - ..\..\lib\vc_dll\mswuniv;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - __WXMSW__;__WXUNIVERSAL__;NDEBUG;WXBUILDING;WXDLLNAME=wxmswuniv28_dbgrid_vc_custom;WXUSINGDLL;WXMAKINGDLL_DBGRID;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_dbgrid.bsc - - - true - true - Console - ..\..\lib\vc_dll\wxmswuniv28_dbgrid_vc_custom.dll - ..\..\lib\vc_dll\wxmswuniv28_dbgrid.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxtiff.lib;wxjpeg.lib;wxpng.lib;wxzlib.lib;wxregex.lib;wxexpat.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxmswuniv28_adv.lib;..\..\lib\vc_dll\wxbase28_odbc.lib;..\..\lib\vc_dll\wxmswuniv28_core.lib;..\..\lib\vc_dll\wxbase28.lib;%(AdditionalDependencies) - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_lib\mswu;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;__WXMSW__;NDEBUG;WXBUILDING;%(PreprocessorDefinitions) - .\vc_mswu\dbgrid\ - vc_mswu\wxprec_dbgridlib.pch - Use - wx/wxprec.h - .\vc_mswu\dbgrid\ - ..\..\lib\vc_lib\wxmsw28u_dbgrid.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_dbgrid.bsc - - - true - ..\..\lib\vc_lib\wxmsw28u_dbgrid.lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_lib\mswu;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;__WXMSW__;NDEBUG;WXBUILDING;%(PreprocessorDefinitions) - .\vc_mswu\dbgrid\ - vc_mswu\wxprec_dbgridlib.pch - Use - wx/wxprec.h - .\vc_mswu\dbgrid\ - ..\..\lib\vc_lib\wxmsw28u_dbgrid.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_dbgrid.bsc - - - true - ..\..\lib\vc_lib\wxmsw28u_dbgrid.lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - true - ..\..\lib\vc_dll\mswud;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXDEBUG__;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_DBGRID;%(PreprocessorDefinitions) - .\vc_mswuddll\dbgrid\ - vc_mswuddll\wxprec_dbgriddll.pch - Use - wx/wxprec.h - .\vc_mswuddll\dbgrid\ - ..\..\lib\vc_dll\wxmsw28ud_dbgrid_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXDEBUG__;_UNICODE;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_DBGRID;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_dbgrid.tlb - true - Win32 - - - 0x0409 - ..\..\lib\vc_dll\mswud;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - _DEBUG;__WXMSW__;__WXDEBUG__;_UNICODE;WXBUILDING;WXDLLNAME=wxmsw28ud_dbgrid_vc_custom;WXUSINGDLL;WXMAKINGDLL_DBGRID;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_dbgrid.bsc - - - true - true - true - Console - ..\..\lib\vc_dll\wxmsw28ud_dbgrid_vc_custom.dll - ..\..\lib\vc_dll\wxmsw28ud_dbgrid.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxtiffd.lib;wxjpegd.lib;wxpngd.lib;wxzlibd.lib;wxregexud.lib;wxexpatd.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxmsw28ud_adv.lib;..\..\lib\vc_dll\wxbase28ud_odbc.lib;..\..\lib\vc_dll\wxmsw28ud_core.lib;..\..\lib\vc_dll\wxbase28ud.lib;%(AdditionalDependencies) - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - ..\..\lib\vc_dll\mswud;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXDEBUG__;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_DBGRID;%(PreprocessorDefinitions) - .\vc_mswuddll\dbgrid\ - vc_mswuddll\wxprec_dbgriddll.pch - Use - wx/wxprec.h - .\vc_mswuddll\dbgrid\ - ..\..\lib\vc_dll\wxmsw28ud_dbgrid_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXDEBUG__;_UNICODE;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_DBGRID;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_dbgrid.tlb - true - - - 0x0409 - ..\..\lib\vc_dll\mswud;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - _DEBUG;__WXMSW__;__WXDEBUG__;_UNICODE;WXBUILDING;WXDLLNAME=wxmsw28ud_dbgrid_vc_custom;WXUSINGDLL;WXMAKINGDLL_DBGRID;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_dbgrid.bsc - - - true - true - true - Console - ..\..\lib\vc_dll\wxmsw28ud_dbgrid_vc_custom.dll - ..\..\lib\vc_dll\wxmsw28ud_dbgrid.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxtiffd.lib;wxjpegd.lib;wxpngd.lib;wxzlibd.lib;wxregexud.lib;wxexpatd.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxmsw28ud_adv.lib;..\..\lib\vc_dll\wxbase28ud_odbc.lib;..\..\lib\vc_dll\wxmsw28ud_core.lib;..\..\lib\vc_dll\wxbase28ud.lib;%(AdditionalDependencies) - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - true - ..\..\lib\vc_dll\mswunivd;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_DBGRID;%(PreprocessorDefinitions) - .\vc_mswunivddll\dbgrid\ - vc_mswunivddll\wxprec_dbgriddll.pch - Use - wx/wxprec.h - .\vc_mswunivddll\dbgrid\ - ..\..\lib\vc_dll\wxmswuniv28d_dbgrid_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_DBGRID;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_dbgrid.tlb - true - Win32 - - - 0x0409 - ..\..\lib\vc_dll\mswunivd;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - _DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;WXBUILDING;WXDLLNAME=wxmswuniv28d_dbgrid_vc_custom;WXUSINGDLL;WXMAKINGDLL_DBGRID;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_dbgrid.bsc - - - true - true - true - Console - ..\..\lib\vc_dll\wxmswuniv28d_dbgrid_vc_custom.dll - ..\..\lib\vc_dll\wxmswuniv28d_dbgrid.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxtiffd.lib;wxjpegd.lib;wxpngd.lib;wxzlibd.lib;wxregexd.lib;wxexpatd.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxmswuniv28d_adv.lib;..\..\lib\vc_dll\wxbase28d_odbc.lib;..\..\lib\vc_dll\wxmswuniv28d_core.lib;..\..\lib\vc_dll\wxbase28d.lib;%(AdditionalDependencies) - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - ..\..\lib\vc_dll\mswunivd;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_DBGRID;%(PreprocessorDefinitions) - .\vc_mswunivddll\dbgrid\ - vc_mswunivddll\wxprec_dbgriddll.pch - Use - wx/wxprec.h - .\vc_mswunivddll\dbgrid\ - ..\..\lib\vc_dll\wxmswuniv28d_dbgrid_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_DBGRID;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_dbgrid.tlb - true - - - 0x0409 - ..\..\lib\vc_dll\mswunivd;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - _DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;WXBUILDING;WXDLLNAME=wxmswuniv28d_dbgrid_vc_custom;WXUSINGDLL;WXMAKINGDLL_DBGRID;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_dbgrid.bsc - - - true - true - true - Console - ..\..\lib\vc_dll\wxmswuniv28d_dbgrid_vc_custom.dll - ..\..\lib\vc_dll\wxmswuniv28d_dbgrid.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxtiffd.lib;wxjpegd.lib;wxpngd.lib;wxzlibd.lib;wxregexd.lib;wxexpatd.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxmswuniv28d_adv.lib;..\..\lib\vc_dll\wxbase28d_odbc.lib;..\..\lib\vc_dll\wxmswuniv28d_core.lib;..\..\lib\vc_dll\wxbase28d.lib;%(AdditionalDependencies) - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - true - ..\..\lib\vc_lib\mswud;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;__WXMSW__;__WXDEBUG__;WXBUILDING;%(PreprocessorDefinitions) - .\vc_mswud\dbgrid\ - vc_mswud\wxprec_dbgridlib.pch - Use - wx/wxprec.h - .\vc_mswud\dbgrid\ - ..\..\lib\vc_lib\wxmsw28ud_dbgrid.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_dbgrid.bsc - - - true - ..\..\lib\vc_lib\wxmsw28ud_dbgrid.lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - ..\..\lib\vc_lib\mswud;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;__WXMSW__;__WXDEBUG__;WXBUILDING;%(PreprocessorDefinitions) - .\vc_mswud\dbgrid\ - vc_mswud\wxprec_dbgridlib.pch - Use - wx/wxprec.h - .\vc_mswud\dbgrid\ - ..\..\lib\vc_lib\wxmsw28ud_dbgrid.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_dbgrid.bsc - - - true - ..\..\lib\vc_lib\wxmsw28ud_dbgrid.lib - - - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - - - - - true - true - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - true - true - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - true - true - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - true - true - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - true - true - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - true - true - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - true - true - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - true - true - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - - - - - copy "%(FullPath)" ..\..\lib\vc_dll\mswd\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_dll\mswd\wx\setup.h - Creating ..\..\lib\vc_dll\mswd\wx\setup.h - Creating ..\..\lib\vc_dll\mswd\wx\setup.h - ..\..\lib\vc_dll\mswd\wx\setup.h;%(Outputs) - ..\..\lib\vc_dll\mswd\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_lib\mswd\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_lib\mswd\wx\setup.h - Creating ..\..\lib\vc_lib\mswd\wx\setup.h - Creating ..\..\lib\vc_lib\mswd\wx\setup.h - ..\..\lib\vc_lib\mswd\wx\setup.h;%(Outputs) - ..\..\lib\vc_lib\mswd\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_lib\msw\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_lib\msw\wx\setup.h - Creating ..\..\lib\vc_lib\msw\wx\setup.h - Creating ..\..\lib\vc_lib\msw\wx\setup.h - ..\..\lib\vc_lib\msw\wx\setup.h;%(Outputs) - ..\..\lib\vc_lib\msw\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_dll\msw\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_dll\msw\wx\setup.h - Creating ..\..\lib\vc_dll\msw\wx\setup.h - Creating ..\..\lib\vc_dll\msw\wx\setup.h - ..\..\lib\vc_dll\msw\wx\setup.h;%(Outputs) - ..\..\lib\vc_dll\msw\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_dll\mswu\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_dll\mswu\wx\setup.h - Creating ..\..\lib\vc_dll\mswu\wx\setup.h - Creating ..\..\lib\vc_dll\mswu\wx\setup.h - ..\..\lib\vc_dll\mswu\wx\setup.h;%(Outputs) - ..\..\lib\vc_dll\mswu\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_lib\mswu\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_lib\mswu\wx\setup.h - Creating ..\..\lib\vc_lib\mswu\wx\setup.h - Creating ..\..\lib\vc_lib\mswu\wx\setup.h - ..\..\lib\vc_lib\mswu\wx\setup.h;%(Outputs) - ..\..\lib\vc_lib\mswu\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_dll\mswud\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_dll\mswud\wx\setup.h - Creating ..\..\lib\vc_dll\mswud\wx\setup.h - Creating ..\..\lib\vc_dll\mswud\wx\setup.h - ..\..\lib\vc_dll\mswud\wx\setup.h;%(Outputs) - ..\..\lib\vc_dll\mswud\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_lib\mswud\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_lib\mswud\wx\setup.h - Creating ..\..\lib\vc_lib\mswud\wx\setup.h - Creating ..\..\lib\vc_lib\mswud\wx\setup.h - ..\..\lib\vc_lib\mswud\wx\setup.h;%(Outputs) - ..\..\lib\vc_lib\mswud\wx\setup.h;%(Outputs) - - - copy "%(FullPath)" ..\..\lib\vc_lib\mswunivd\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_lib\mswunivd\wx\setup.h - Creating ..\..\lib\vc_lib\mswunivd\wx\setup.h - Creating ..\..\lib\vc_lib\mswunivd\wx\setup.h - ..\..\lib\vc_lib\mswunivd\wx\setup.h;%(Outputs) - ..\..\lib\vc_lib\mswunivd\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_lib\mswuniv\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_lib\mswuniv\wx\setup.h - Creating ..\..\lib\vc_lib\mswuniv\wx\setup.h - Creating ..\..\lib\vc_lib\mswuniv\wx\setup.h - ..\..\lib\vc_lib\mswuniv\wx\setup.h;%(Outputs) - ..\..\lib\vc_lib\mswuniv\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_lib\mswunivu\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_lib\mswunivu\wx\setup.h - Creating ..\..\lib\vc_lib\mswunivu\wx\setup.h - Creating ..\..\lib\vc_lib\mswunivu\wx\setup.h - ..\..\lib\vc_lib\mswunivu\wx\setup.h;%(Outputs) - ..\..\lib\vc_lib\mswunivu\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_dll\mswunivu\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_dll\mswunivu\wx\setup.h - Creating ..\..\lib\vc_dll\mswunivu\wx\setup.h - Creating ..\..\lib\vc_dll\mswunivu\wx\setup.h - ..\..\lib\vc_dll\mswunivu\wx\setup.h;%(Outputs) - ..\..\lib\vc_dll\mswunivu\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_dll\mswunivud\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_dll\mswunivud\wx\setup.h - Creating ..\..\lib\vc_dll\mswunivud\wx\setup.h - Creating ..\..\lib\vc_dll\mswunivud\wx\setup.h - ..\..\lib\vc_dll\mswunivud\wx\setup.h;%(Outputs) - ..\..\lib\vc_dll\mswunivud\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_lib\mswunivud\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_lib\mswunivud\wx\setup.h - Creating ..\..\lib\vc_lib\mswunivud\wx\setup.h - Creating ..\..\lib\vc_lib\mswunivud\wx\setup.h - ..\..\lib\vc_lib\mswunivud\wx\setup.h;%(Outputs) - ..\..\lib\vc_lib\mswunivud\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_dll\mswuniv\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_dll\mswuniv\wx\setup.h - Creating ..\..\lib\vc_dll\mswuniv\wx\setup.h - Creating ..\..\lib\vc_dll\mswuniv\wx\setup.h - ..\..\lib\vc_dll\mswuniv\wx\setup.h;%(Outputs) - ..\..\lib\vc_dll\mswuniv\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_dll\mswunivd\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_dll\mswunivd\wx\setup.h - Creating ..\..\lib\vc_dll\mswunivd\wx\setup.h - Creating ..\..\lib\vc_dll\mswunivd\wx\setup.h - ..\..\lib\vc_dll\mswunivd\wx\setup.h;%(Outputs) - ..\..\lib\vc_dll\mswunivd\wx\setup.h;%(Outputs) - - - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswunivd\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswunivd\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_lib\mswunivd\wx\msw\rcdefs.h - Creating ..\..\lib\vc_lib\mswunivd\wx\msw\rcdefs.h - ..\..\lib\vc_lib\mswunivd\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_lib\mswunivd\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswuniv\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswuniv\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_lib\mswuniv\wx\msw\rcdefs.h - Creating ..\..\lib\vc_lib\mswuniv\wx\msw\rcdefs.h - ..\..\lib\vc_lib\mswuniv\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_lib\mswuniv\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswd\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswd\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_dll\mswd\wx\msw\rcdefs.h - Creating ..\..\lib\vc_dll\mswd\wx\msw\rcdefs.h - ..\..\lib\vc_dll\mswd\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_dll\mswd\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswd\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswd\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_lib\mswd\wx\msw\rcdefs.h - Creating ..\..\lib\vc_lib\mswd\wx\msw\rcdefs.h - ..\..\lib\vc_lib\mswd\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_lib\mswd\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswunivu\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswunivu\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_lib\mswunivu\wx\msw\rcdefs.h - Creating ..\..\lib\vc_lib\mswunivu\wx\msw\rcdefs.h - ..\..\lib\vc_lib\mswunivu\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_lib\mswunivu\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswunivu\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswunivu\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_dll\mswunivu\wx\msw\rcdefs.h - Creating ..\..\lib\vc_dll\mswunivu\wx\msw\rcdefs.h - ..\..\lib\vc_dll\mswunivu\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_dll\mswunivu\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\msw\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\msw\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_lib\msw\wx\msw\rcdefs.h - Creating ..\..\lib\vc_lib\msw\wx\msw\rcdefs.h - ..\..\lib\vc_lib\msw\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_lib\msw\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswunivud\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswunivud\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_dll\mswunivud\wx\msw\rcdefs.h - Creating ..\..\lib\vc_dll\mswunivud\wx\msw\rcdefs.h - ..\..\lib\vc_dll\mswunivud\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_dll\mswunivud\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\msw\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\msw\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_dll\msw\wx\msw\rcdefs.h - Creating ..\..\lib\vc_dll\msw\wx\msw\rcdefs.h - ..\..\lib\vc_dll\msw\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_dll\msw\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswu\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswu\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_dll\mswu\wx\msw\rcdefs.h - Creating ..\..\lib\vc_dll\mswu\wx\msw\rcdefs.h - ..\..\lib\vc_dll\mswu\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_dll\mswu\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswunivud\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswunivud\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_lib\mswunivud\wx\msw\rcdefs.h - Creating ..\..\lib\vc_lib\mswunivud\wx\msw\rcdefs.h - ..\..\lib\vc_lib\mswunivud\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_lib\mswunivud\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswuniv\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswuniv\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_dll\mswuniv\wx\msw\rcdefs.h - Creating ..\..\lib\vc_dll\mswuniv\wx\msw\rcdefs.h - ..\..\lib\vc_dll\mswuniv\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_dll\mswuniv\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswu\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswu\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_lib\mswu\wx\msw\rcdefs.h - Creating ..\..\lib\vc_lib\mswu\wx\msw\rcdefs.h - ..\..\lib\vc_lib\mswu\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_lib\mswu\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswud\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswud\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_dll\mswud\wx\msw\rcdefs.h - Creating ..\..\lib\vc_dll\mswud\wx\msw\rcdefs.h - ..\..\lib\vc_dll\mswud\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_dll\mswud\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswunivd\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswunivd\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_dll\mswunivd\wx\msw\rcdefs.h - Creating ..\..\lib\vc_dll\mswunivd\wx\msw\rcdefs.h - ..\..\lib\vc_dll\mswunivd\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_dll\mswunivd\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswud\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswud\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_lib\mswud\wx\msw\rcdefs.h - Creating ..\..\lib\vc_lib\mswud\wx\msw\rcdefs.h - ..\..\lib\vc_lib\mswud\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_lib\mswud\wx\msw\rcdefs.h;%(Outputs) - - - - - - - \ No newline at end of file diff --git a/wxWidgets/build/msw/wx_dbgrid.vcxproj.filters b/wxWidgets/build/msw/wx_dbgrid.vcxproj.filters deleted file mode 100644 index 0cdea5a19a..0000000000 --- a/wxWidgets/build/msw/wx_dbgrid.vcxproj.filters +++ /dev/null @@ -1,49 +0,0 @@ - - - - - {7a6ba939-3802-4ce2-9a8e-54e209f5fee4} - - - {078b3083-8f67-428e-a4c2-09d213bfc0e0} - - - {d9f13b51-dc93-4c78-a52e-109a5d3f98da} - - - {270151d6-c81e-41f0-a176-26a1d0d117fb} - - - {cc06adf9-b86b-4d6c-87c4-0cd556f1c6f1} - - - - - Common Sources - - - Common Sources - - - - - MSW Sources - - - - - Common Headers - - - - - Setup Headers - - - Setup Headers - - - MSW Headers - - - \ No newline at end of file diff --git a/wxWidgets/build/msw/wx_gl.vcxproj b/wxWidgets/build/msw/wx_gl.vcxproj deleted file mode 100644 index 45ef9447cf..0000000000 --- a/wxWidgets/build/msw/wx_gl.vcxproj +++ /dev/null @@ -1,2244 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - DLL Debug - Win32 - - - DLL Debug - x64 - - - DLL Release - Win32 - - - DLL Release - x64 - - - DLL Unicode Debug - Win32 - - - DLL Unicode Debug - x64 - - - DLL Unicode Release - Win32 - - - DLL Unicode Release - x64 - - - DLL Universal Debug - Win32 - - - DLL Universal Debug - x64 - - - DLL Universal Release - Win32 - - - DLL Universal Release - x64 - - - DLL Universal Unicode Debug - Win32 - - - DLL Universal Unicode Debug - x64 - - - DLL Universal Unicode Release - Win32 - - - DLL Universal Unicode Release - x64 - - - Release - Win32 - - - Release - x64 - - - Template - Win32 - - - Template - x64 - - - Unicode Debug - Win32 - - - Unicode Debug - x64 - - - Unicode Release - Win32 - - - Unicode Release - x64 - - - Universal Debug - Win32 - - - Universal Debug - x64 - - - Universal Release - Win32 - - - Universal Release - x64 - - - Universal Unicode Debug - Win32 - - - Universal Unicode Debug - x64 - - - Universal Unicode Release - Win32 - - - Universal Unicode Release - x64 - - - - gl - - - {99C9EB95-DB4C-1996-490E-5212EFBF07C3} - - - - Application - v110 - - - Application - v110 - - - DynamicLibrary - false - v110 - - - DynamicLibrary - false - v110 - - - StaticLibrary - false - Unicode - v110 - - - StaticLibrary - false - Unicode - v110 - - - DynamicLibrary - false - Unicode - v110 - - - DynamicLibrary - false - Unicode - v110 - - - DynamicLibrary - false - v110 - - - DynamicLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - Unicode - v110 - - - StaticLibrary - false - Unicode - v110 - - - DynamicLibrary - false - Unicode - v110 - - - DynamicLibrary - false - Unicode - v110 - - - DynamicLibrary - false - Unicode - v110 - - - DynamicLibrary - false - Unicode - v110 - - - DynamicLibrary - false - Unicode - v110 - - - DynamicLibrary - false - Unicode - v110 - - - StaticLibrary - false - Unicode - v110 - - - StaticLibrary - false - Unicode - v110 - - - DynamicLibrary - false - v110 - - - DynamicLibrary - false - v110 - - - DynamicLibrary - false - v110 - - - DynamicLibrary - false - v110 - - - StaticLibrary - false - Unicode - v110 - - - StaticLibrary - false - Unicode - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - .\..\..\lib\vc_lib\ - .\vc_mswuniv\gl\ - - - .\..\..\lib\vc_lib\ - .\vc_mswuniv\gl\ - - - .\..\..\lib\vc_lib\ - .\vc_mswunivu\gl\ - - - .\..\..\lib\vc_lib\ - .\vc_mswunivu\gl\ - - - .\..\..\lib\vc_dll\ - .\vc_mswddll\gl\ - true - - - .\..\..\lib\vc_dll\ - .\vc_mswddll\gl\ - true - - - .\..\..\lib\vc_dll\ - .\vc_mswdll\gl\ - false - - - .\..\..\lib\vc_dll\ - .\vc_mswdll\gl\ - false - - - .\..\..\lib\vc_lib\ - .\vc_mswunivud\gl\ - - - .\..\..\lib\vc_lib\ - .\vc_mswunivud\gl\ - - - .\..\..\lib\vc_dll\ - .\vc_mswunivudll\gl\ - false - - - .\..\..\lib\vc_dll\ - .\vc_mswunivudll\gl\ - false - - - .\..\..\lib\vc_dll\ - .\vc_mswuddll\gl\ - true - - - .\..\..\lib\vc_dll\ - .\vc_mswuddll\gl\ - true - - - .\..\..\lib\vc_dll\ - .\vc_mswudll\gl\ - false - - - .\..\..\lib\vc_dll\ - .\vc_mswudll\gl\ - false - - - .\..\..\lib\vc_lib\ - .\vc_mswud\gl\ - - - .\..\..\lib\vc_lib\ - .\vc_mswud\gl\ - - - .\..\..\lib\vc_lib\ - .\vc_mswunivd\gl\ - - - .\..\..\lib\vc_lib\ - .\vc_mswunivd\gl\ - - - .\..\..\..\libs\$(Configuration) - .\vc_msw\gl\ - - - .\..\..\..\libs\$(Configuration) - .\vc_msw\gl\ - - - .\..\..\..\libs\$(Configuration) - .\vc_mswd\gl\ - - - .\..\..\..\libs\$(Configuration) - .\vc_mswd\gl\ - - - .\..\..\lib\vc_dll\ - .\vc_mswunivddll\gl\ - true - - - .\..\..\lib\vc_dll\ - .\vc_mswunivddll\gl\ - true - - - .\..\..\lib\vc_dll\ - .\vc_mswunivuddll\gl\ - true - - - .\..\..\lib\vc_dll\ - .\vc_mswunivuddll\gl\ - true - - - .\..\..\lib\vc_lib\ - .\vc_mswu\gl\ - - - .\..\..\lib\vc_lib\ - .\vc_mswu\gl\ - - - .\..\..\lib\vc_dll\ - .\vc_mswunivdll\gl\ - false - - - .\..\..\lib\vc_dll\ - .\vc_mswunivdll\gl\ - false - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_lib\mswuniv;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;__WXMSW__;__WXUNIVERSAL__;NDEBUG;WXBUILDING;%(PreprocessorDefinitions) - .\vc_mswuniv\gl\ - vc_mswuniv\wxprec_gllib.pch - Use - wx/wxprec.h - .\vc_mswuniv\gl\ - ..\..\lib\vc_lib\wxmswuniv28_gl.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_gl.bsc - - - true - ..\..\lib\vc_lib\wxmswuniv28_gl.lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_lib\mswuniv;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;__WXMSW__;__WXUNIVERSAL__;NDEBUG;WXBUILDING;%(PreprocessorDefinitions) - .\vc_mswuniv\gl\ - vc_mswuniv\wxprec_gllib.pch - Use - wx/wxprec.h - .\vc_mswuniv\gl\ - ..\..\lib\vc_lib\wxmswuniv28_gl.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_gl.bsc - - - true - ..\..\lib\vc_lib\wxmswuniv28_gl.lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_lib\mswunivu;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;__WXMSW__;__WXUNIVERSAL__;NDEBUG;WXBUILDING;%(PreprocessorDefinitions) - .\vc_mswunivu\gl\ - vc_mswunivu\wxprec_gllib.pch - Use - wx/wxprec.h - .\vc_mswunivu\gl\ - ..\..\lib\vc_lib\wxmswuniv28u_gl.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_gl.bsc - - - true - ..\..\lib\vc_lib\wxmswuniv28u_gl.lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_lib\mswunivu;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;__WXMSW__;__WXUNIVERSAL__;NDEBUG;WXBUILDING;%(PreprocessorDefinitions) - .\vc_mswunivu\gl\ - vc_mswunivu\wxprec_gllib.pch - Use - wx/wxprec.h - .\vc_mswunivu\gl\ - ..\..\lib\vc_lib\wxmswuniv28u_gl.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_gl.bsc - - - true - ..\..\lib\vc_lib\wxmswuniv28u_gl.lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - true - ..\..\lib\vc_dll\mswd;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXDEBUG__;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_GL;%(PreprocessorDefinitions) - .\vc_mswddll\gl\ - vc_mswddll\wxprec_gldll.pch - Use - wx/wxprec.h - .\vc_mswddll\gl\ - ..\..\lib\vc_dll\wxmsw28d_gl_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXDEBUG__;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_GL;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_gl.tlb - true - Win32 - - - 0x0409 - ..\..\lib\vc_dll\mswd;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - _DEBUG;__WXMSW__;__WXDEBUG__;WXBUILDING;WXDLLNAME=wxmsw28d_gl_vc_custom;WXUSINGDLL;WXMAKINGDLL_GL;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_gl.bsc - - - true - true - true - Console - ..\..\lib\vc_dll\wxmsw28d_gl_vc_custom.dll - ..\..\lib\vc_dll\wxmsw28d_gl.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxtiffd.lib;wxjpegd.lib;wxpngd.lib;wxzlibd.lib;wxregexd.lib;wxexpatd.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;wxmsw28d_core.lib;wxbase28d.lib;opengl32.lib;glu32.lib;%(AdditionalDependencies) - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - ..\..\lib\vc_dll\mswd;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXDEBUG__;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_GL;%(PreprocessorDefinitions) - .\vc_mswddll\gl\ - vc_mswddll\wxprec_gldll.pch - Use - wx/wxprec.h - .\vc_mswddll\gl\ - ..\..\lib\vc_dll\wxmsw28d_gl_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXDEBUG__;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_GL;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_gl.tlb - true - - - 0x0409 - ..\..\lib\vc_dll\mswd;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - _DEBUG;__WXMSW__;__WXDEBUG__;WXBUILDING;WXDLLNAME=wxmsw28d_gl_vc_custom;WXUSINGDLL;WXMAKINGDLL_GL;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_gl.bsc - - - true - true - true - Console - ..\..\lib\vc_dll\wxmsw28d_gl_vc_custom.dll - ..\..\lib\vc_dll\wxmsw28d_gl.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxtiffd.lib;wxjpegd.lib;wxpngd.lib;wxzlibd.lib;wxregexd.lib;wxexpatd.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;wxmsw28d_core.lib;wxbase28d.lib;opengl32.lib;glu32.lib;%(AdditionalDependencies) - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_dll\msw;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;NDEBUG;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_GL;%(PreprocessorDefinitions) - .\vc_mswdll\gl\ - vc_mswdll\wxprec_gldll.pch - Use - wx/wxprec.h - .\vc_mswdll\gl\ - ..\..\lib\vc_dll\wxmsw28_gl_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;NDEBUG;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_GL;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_gl.tlb - true - Win32 - - - 0x0409 - ..\..\lib\vc_dll\msw;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - __WXMSW__;NDEBUG;WXBUILDING;WXDLLNAME=wxmsw28_gl_vc_custom;WXUSINGDLL;WXMAKINGDLL_GL;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_gl.bsc - - - true - true - Console - ..\..\lib\vc_dll\wxmsw28_gl_vc_custom.dll - ..\..\lib\vc_dll\wxmsw28_gl.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxtiff.lib;wxjpeg.lib;wxpng.lib;wxzlib.lib;wxregex.lib;wxexpat.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;wxmsw28_core.lib;wxbase28.lib;opengl32.lib;glu32.lib;%(AdditionalDependencies) - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_dll\msw;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;NDEBUG;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_GL;%(PreprocessorDefinitions) - .\vc_mswdll\gl\ - vc_mswdll\wxprec_gldll.pch - Use - wx/wxprec.h - .\vc_mswdll\gl\ - ..\..\lib\vc_dll\wxmsw28_gl_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;NDEBUG;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_GL;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_gl.tlb - true - - - 0x0409 - ..\..\lib\vc_dll\msw;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - __WXMSW__;NDEBUG;WXBUILDING;WXDLLNAME=wxmsw28_gl_vc_custom;WXUSINGDLL;WXMAKINGDLL_GL;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_gl.bsc - - - true - true - Console - ..\..\lib\vc_dll\wxmsw28_gl_vc_custom.dll - ..\..\lib\vc_dll\wxmsw28_gl.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxtiff.lib;wxjpeg.lib;wxpng.lib;wxzlib.lib;wxregex.lib;wxexpat.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;wxmsw28_core.lib;wxbase28.lib;opengl32.lib;glu32.lib;%(AdditionalDependencies) - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - true - ..\..\lib\vc_lib\mswunivud;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;WXBUILDING;%(PreprocessorDefinitions) - .\vc_mswunivud\gl\ - vc_mswunivud\wxprec_gllib.pch - Use - wx/wxprec.h - .\vc_mswunivud\gl\ - ..\..\lib\vc_lib\wxmswuniv28ud_gl.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_gl.bsc - - - true - ..\..\lib\vc_lib\wxmswuniv28ud_gl.lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - ..\..\lib\vc_lib\mswunivud;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;WXBUILDING;%(PreprocessorDefinitions) - .\vc_mswunivud\gl\ - vc_mswunivud\wxprec_gllib.pch - Use - wx/wxprec.h - .\vc_mswunivud\gl\ - ..\..\lib\vc_lib\wxmswuniv28ud_gl.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_gl.bsc - - - true - ..\..\lib\vc_lib\wxmswuniv28ud_gl.lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_dll\mswunivu;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;__WXUNIVERSAL__;NDEBUG;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_GL;%(PreprocessorDefinitions) - .\vc_mswunivudll\gl\ - vc_mswunivudll\wxprec_gldll.pch - Use - wx/wxprec.h - .\vc_mswunivudll\gl\ - ..\..\lib\vc_dll\wxmswuniv28u_gl_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;__WXUNIVERSAL__;NDEBUG;_UNICODE;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_GL;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_gl.tlb - true - Win32 - - - 0x0409 - ..\..\lib\vc_dll\mswunivu;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - __WXMSW__;__WXUNIVERSAL__;NDEBUG;_UNICODE;WXBUILDING;WXDLLNAME=wxmswuniv28u_gl_vc_custom;WXUSINGDLL;WXMAKINGDLL_GL;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_gl.bsc - - - true - true - Console - ..\..\lib\vc_dll\wxmswuniv28u_gl_vc_custom.dll - ..\..\lib\vc_dll\wxmswuniv28u_gl.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxtiff.lib;wxjpeg.lib;wxpng.lib;wxzlib.lib;wxregexu.lib;wxexpat.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;wxmswuniv28u_core.lib;wxbase28u.lib;opengl32.lib;glu32.lib;%(AdditionalDependencies) - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_dll\mswunivu;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;__WXUNIVERSAL__;NDEBUG;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_GL;%(PreprocessorDefinitions) - .\vc_mswunivudll\gl\ - vc_mswunivudll\wxprec_gldll.pch - Use - wx/wxprec.h - .\vc_mswunivudll\gl\ - ..\..\lib\vc_dll\wxmswuniv28u_gl_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;__WXUNIVERSAL__;NDEBUG;_UNICODE;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_GL;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_gl.tlb - true - - - 0x0409 - ..\..\lib\vc_dll\mswunivu;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - __WXMSW__;__WXUNIVERSAL__;NDEBUG;_UNICODE;WXBUILDING;WXDLLNAME=wxmswuniv28u_gl_vc_custom;WXUSINGDLL;WXMAKINGDLL_GL;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_gl.bsc - - - true - true - Console - ..\..\lib\vc_dll\wxmswuniv28u_gl_vc_custom.dll - ..\..\lib\vc_dll\wxmswuniv28u_gl.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxtiff.lib;wxjpeg.lib;wxpng.lib;wxzlib.lib;wxregexu.lib;wxexpat.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;wxmswuniv28u_core.lib;wxbase28u.lib;opengl32.lib;glu32.lib;%(AdditionalDependencies) - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - true - ..\..\lib\vc_dll\mswud;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXDEBUG__;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_GL;%(PreprocessorDefinitions) - .\vc_mswuddll\gl\ - vc_mswuddll\wxprec_gldll.pch - Use - wx/wxprec.h - .\vc_mswuddll\gl\ - ..\..\lib\vc_dll\wxmsw28ud_gl_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXDEBUG__;_UNICODE;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_GL;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_gl.tlb - true - Win32 - - - 0x0409 - ..\..\lib\vc_dll\mswud;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - _DEBUG;__WXMSW__;__WXDEBUG__;_UNICODE;WXBUILDING;WXDLLNAME=wxmsw28ud_gl_vc_custom;WXUSINGDLL;WXMAKINGDLL_GL;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_gl.bsc - - - true - true - true - Console - ..\..\lib\vc_dll\wxmsw28ud_gl_vc_custom.dll - ..\..\lib\vc_dll\wxmsw28ud_gl.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxtiffd.lib;wxjpegd.lib;wxpngd.lib;wxzlibd.lib;wxregexud.lib;wxexpatd.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;wxmsw28ud_core.lib;wxbase28ud.lib;opengl32.lib;glu32.lib;%(AdditionalDependencies) - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - ..\..\lib\vc_dll\mswud;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXDEBUG__;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_GL;%(PreprocessorDefinitions) - .\vc_mswuddll\gl\ - vc_mswuddll\wxprec_gldll.pch - Use - wx/wxprec.h - .\vc_mswuddll\gl\ - ..\..\lib\vc_dll\wxmsw28ud_gl_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXDEBUG__;_UNICODE;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_GL;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_gl.tlb - true - - - 0x0409 - ..\..\lib\vc_dll\mswud;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - _DEBUG;__WXMSW__;__WXDEBUG__;_UNICODE;WXBUILDING;WXDLLNAME=wxmsw28ud_gl_vc_custom;WXUSINGDLL;WXMAKINGDLL_GL;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_gl.bsc - - - true - true - true - Console - ..\..\lib\vc_dll\wxmsw28ud_gl_vc_custom.dll - ..\..\lib\vc_dll\wxmsw28ud_gl.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxtiffd.lib;wxjpegd.lib;wxpngd.lib;wxzlibd.lib;wxregexud.lib;wxexpatd.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;wxmsw28ud_core.lib;wxbase28ud.lib;opengl32.lib;glu32.lib;%(AdditionalDependencies) - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_dll\mswu;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;NDEBUG;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_GL;%(PreprocessorDefinitions) - .\vc_mswudll\gl\ - vc_mswudll\wxprec_gldll.pch - Use - wx/wxprec.h - .\vc_mswudll\gl\ - ..\..\lib\vc_dll\wxmsw28u_gl_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;NDEBUG;_UNICODE;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_GL;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_gl.tlb - true - Win32 - - - 0x0409 - ..\..\lib\vc_dll\mswu;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - __WXMSW__;NDEBUG;_UNICODE;WXBUILDING;WXDLLNAME=wxmsw28u_gl_vc_custom;WXUSINGDLL;WXMAKINGDLL_GL;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_gl.bsc - - - true - true - Console - ..\..\lib\vc_dll\wxmsw28u_gl_vc_custom.dll - ..\..\lib\vc_dll\wxmsw28u_gl.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxtiff.lib;wxjpeg.lib;wxpng.lib;wxzlib.lib;wxregexu.lib;wxexpat.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;wxmsw28u_core.lib;wxbase28u.lib;opengl32.lib;glu32.lib;%(AdditionalDependencies) - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_dll\mswu;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;NDEBUG;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_GL;%(PreprocessorDefinitions) - .\vc_mswudll\gl\ - vc_mswudll\wxprec_gldll.pch - Use - wx/wxprec.h - .\vc_mswudll\gl\ - ..\..\lib\vc_dll\wxmsw28u_gl_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;NDEBUG;_UNICODE;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_GL;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_gl.tlb - true - - - 0x0409 - ..\..\lib\vc_dll\mswu;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - __WXMSW__;NDEBUG;_UNICODE;WXBUILDING;WXDLLNAME=wxmsw28u_gl_vc_custom;WXUSINGDLL;WXMAKINGDLL_GL;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_gl.bsc - - - true - true - Console - ..\..\lib\vc_dll\wxmsw28u_gl_vc_custom.dll - ..\..\lib\vc_dll\wxmsw28u_gl.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxtiff.lib;wxjpeg.lib;wxpng.lib;wxzlib.lib;wxregexu.lib;wxexpat.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;wxmsw28u_core.lib;wxbase28u.lib;opengl32.lib;glu32.lib;%(AdditionalDependencies) - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - true - ..\..\lib\vc_lib\mswud;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;__WXMSW__;__WXDEBUG__;WXBUILDING;%(PreprocessorDefinitions) - .\vc_mswud\gl\ - vc_mswud\wxprec_gllib.pch - Use - wx/wxprec.h - .\vc_mswud\gl\ - ..\..\lib\vc_lib\wxmsw28ud_gl.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_gl.bsc - - - true - ..\..\lib\vc_lib\wxmsw28ud_gl.lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - ..\..\lib\vc_lib\mswud;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;__WXMSW__;__WXDEBUG__;WXBUILDING;%(PreprocessorDefinitions) - .\vc_mswud\gl\ - vc_mswud\wxprec_gllib.pch - Use - wx/wxprec.h - .\vc_mswud\gl\ - ..\..\lib\vc_lib\wxmsw28ud_gl.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_gl.bsc - - - true - ..\..\lib\vc_lib\wxmsw28ud_gl.lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - true - ..\..\lib\vc_lib\mswunivd;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;WXBUILDING;%(PreprocessorDefinitions) - .\vc_mswunivd\gl\ - vc_mswunivd\wxprec_gllib.pch - Use - wx/wxprec.h - .\vc_mswunivd\gl\ - ..\..\lib\vc_lib\wxmswuniv28d_gl.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_gl.bsc - - - true - ..\..\lib\vc_lib\wxmswuniv28d_gl.lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - ..\..\lib\vc_lib\mswunivd;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;WXBUILDING;%(PreprocessorDefinitions) - .\vc_mswunivd\gl\ - vc_mswunivd\wxprec_gllib.pch - Use - wx/wxprec.h - .\vc_mswunivd\gl\ - ..\..\lib\vc_lib\wxmswuniv28d_gl.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_gl.bsc - - - true - ..\..\lib\vc_lib\wxmswuniv28d_gl.lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_lib\msw;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;__WXMSW__;NDEBUG;WXBUILDING;%(PreprocessorDefinitions) - .\vc_msw\gl\ - vc_msw\wxprec_gllib.pch - Use - wx/wxprec.h - .\vc_msw\gl\ - ..\..\lib\vc_lib\wxmsw28_gl.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_gl.bsc - - - true - .\..\..\..\libs\$(Configuration)\$(ProjectName).lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_lib\msw;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;__WXMSW__;NDEBUG;WXBUILDING;%(PreprocessorDefinitions) - .\vc_msw\gl\ - vc_msw\wxprec_gllib.pch - Use - wx/wxprec.h - .\vc_msw\gl\ - ..\..\lib\vc_lib\wxmsw28_gl.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_gl.bsc - - - true - .\..\..\..\libs\$(Configuration)\$(ProjectName).lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - true - ..\..\lib\vc_lib\mswd;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;__WXMSW__;__WXDEBUG__;WXBUILDING;%(PreprocessorDefinitions) - .\vc_mswd\gl\ - vc_mswd\wxprec_gllib.pch - Use - wx/wxprec.h - .\vc_mswd\gl\ - ..\..\lib\vc_lib\wxmsw28d_gl.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_gl.bsc - - - true - .\..\..\..\libs\$(Configuration)\$(ProjectName).lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - ..\..\lib\vc_lib\mswd;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;__WXMSW__;__WXDEBUG__;WXBUILDING;%(PreprocessorDefinitions) - .\vc_mswd\gl\ - vc_mswd\wxprec_gllib.pch - Use - wx/wxprec.h - .\vc_mswd\gl\ - ..\..\lib\vc_lib\wxmsw28d_gl.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_gl.bsc - - - true - .\..\..\..\libs\$(Configuration)\$(ProjectName).lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - true - ..\..\lib\vc_dll\mswunivd;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_GL;%(PreprocessorDefinitions) - .\vc_mswunivddll\gl\ - vc_mswunivddll\wxprec_gldll.pch - Use - wx/wxprec.h - .\vc_mswunivddll\gl\ - ..\..\lib\vc_dll\wxmswuniv28d_gl_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_GL;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_gl.tlb - true - Win32 - - - 0x0409 - ..\..\lib\vc_dll\mswunivd;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - _DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;WXBUILDING;WXDLLNAME=wxmswuniv28d_gl_vc_custom;WXUSINGDLL;WXMAKINGDLL_GL;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_gl.bsc - - - true - true - true - Console - ..\..\lib\vc_dll\wxmswuniv28d_gl_vc_custom.dll - ..\..\lib\vc_dll\wxmswuniv28d_gl.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxtiffd.lib;wxjpegd.lib;wxpngd.lib;wxzlibd.lib;wxregexd.lib;wxexpatd.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;wxmswuniv28d_core.lib;wxbase28d.lib;opengl32.lib;glu32.lib;%(AdditionalDependencies) - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - ..\..\lib\vc_dll\mswunivd;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_GL;%(PreprocessorDefinitions) - .\vc_mswunivddll\gl\ - vc_mswunivddll\wxprec_gldll.pch - Use - wx/wxprec.h - .\vc_mswunivddll\gl\ - ..\..\lib\vc_dll\wxmswuniv28d_gl_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_GL;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_gl.tlb - true - - - 0x0409 - ..\..\lib\vc_dll\mswunivd;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - _DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;WXBUILDING;WXDLLNAME=wxmswuniv28d_gl_vc_custom;WXUSINGDLL;WXMAKINGDLL_GL;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_gl.bsc - - - true - true - true - Console - ..\..\lib\vc_dll\wxmswuniv28d_gl_vc_custom.dll - ..\..\lib\vc_dll\wxmswuniv28d_gl.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxtiffd.lib;wxjpegd.lib;wxpngd.lib;wxzlibd.lib;wxregexd.lib;wxexpatd.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;wxmswuniv28d_core.lib;wxbase28d.lib;opengl32.lib;glu32.lib;%(AdditionalDependencies) - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - true - ..\..\lib\vc_dll\mswunivud;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_GL;%(PreprocessorDefinitions) - .\vc_mswunivuddll\gl\ - vc_mswunivuddll\wxprec_gldll.pch - Use - wx/wxprec.h - .\vc_mswunivuddll\gl\ - ..\..\lib\vc_dll\wxmswuniv28ud_gl_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;_UNICODE;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_GL;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_gl.tlb - true - Win32 - - - 0x0409 - ..\..\lib\vc_dll\mswunivud;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - _DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;_UNICODE;WXBUILDING;WXDLLNAME=wxmswuniv28ud_gl_vc_custom;WXUSINGDLL;WXMAKINGDLL_GL;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_gl.bsc - - - true - true - true - Console - ..\..\lib\vc_dll\wxmswuniv28ud_gl_vc_custom.dll - ..\..\lib\vc_dll\wxmswuniv28ud_gl.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxtiffd.lib;wxjpegd.lib;wxpngd.lib;wxzlibd.lib;wxregexud.lib;wxexpatd.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;wxmswuniv28ud_core.lib;wxbase28ud.lib;opengl32.lib;glu32.lib;%(AdditionalDependencies) - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - ..\..\lib\vc_dll\mswunivud;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_GL;%(PreprocessorDefinitions) - .\vc_mswunivuddll\gl\ - vc_mswunivuddll\wxprec_gldll.pch - Use - wx/wxprec.h - .\vc_mswunivuddll\gl\ - ..\..\lib\vc_dll\wxmswuniv28ud_gl_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;_UNICODE;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_GL;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_gl.tlb - true - - - 0x0409 - ..\..\lib\vc_dll\mswunivud;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - _DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;_UNICODE;WXBUILDING;WXDLLNAME=wxmswuniv28ud_gl_vc_custom;WXUSINGDLL;WXMAKINGDLL_GL;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_gl.bsc - - - true - true - true - Console - ..\..\lib\vc_dll\wxmswuniv28ud_gl_vc_custom.dll - ..\..\lib\vc_dll\wxmswuniv28ud_gl.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxtiffd.lib;wxjpegd.lib;wxpngd.lib;wxzlibd.lib;wxregexud.lib;wxexpatd.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;wxmswuniv28ud_core.lib;wxbase28ud.lib;opengl32.lib;glu32.lib;%(AdditionalDependencies) - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_lib\mswu;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;__WXMSW__;NDEBUG;WXBUILDING;%(PreprocessorDefinitions) - .\vc_mswu\gl\ - vc_mswu\wxprec_gllib.pch - Use - wx/wxprec.h - .\vc_mswu\gl\ - ..\..\lib\vc_lib\wxmsw28u_gl.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_gl.bsc - - - true - ..\..\lib\vc_lib\wxmsw28u_gl.lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_lib\mswu;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;__WXMSW__;NDEBUG;WXBUILDING;%(PreprocessorDefinitions) - .\vc_mswu\gl\ - vc_mswu\wxprec_gllib.pch - Use - wx/wxprec.h - .\vc_mswu\gl\ - ..\..\lib\vc_lib\wxmsw28u_gl.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_gl.bsc - - - true - ..\..\lib\vc_lib\wxmsw28u_gl.lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_dll\mswuniv;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;__WXUNIVERSAL__;NDEBUG;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_GL;%(PreprocessorDefinitions) - .\vc_mswunivdll\gl\ - vc_mswunivdll\wxprec_gldll.pch - Use - wx/wxprec.h - .\vc_mswunivdll\gl\ - ..\..\lib\vc_dll\wxmswuniv28_gl_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;__WXUNIVERSAL__;NDEBUG;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_GL;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_gl.tlb - true - Win32 - - - 0x0409 - ..\..\lib\vc_dll\mswuniv;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - __WXMSW__;__WXUNIVERSAL__;NDEBUG;WXBUILDING;WXDLLNAME=wxmswuniv28_gl_vc_custom;WXUSINGDLL;WXMAKINGDLL_GL;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_gl.bsc - - - true - true - Console - ..\..\lib\vc_dll\wxmswuniv28_gl_vc_custom.dll - ..\..\lib\vc_dll\wxmswuniv28_gl.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxtiff.lib;wxjpeg.lib;wxpng.lib;wxzlib.lib;wxregex.lib;wxexpat.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;wxmswuniv28_core.lib;wxbase28.lib;opengl32.lib;glu32.lib;%(AdditionalDependencies) - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_dll\mswuniv;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;__WXUNIVERSAL__;NDEBUG;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_GL;%(PreprocessorDefinitions) - .\vc_mswunivdll\gl\ - vc_mswunivdll\wxprec_gldll.pch - Use - wx/wxprec.h - .\vc_mswunivdll\gl\ - ..\..\lib\vc_dll\wxmswuniv28_gl_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;__WXUNIVERSAL__;NDEBUG;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_GL;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_gl.tlb - true - - - 0x0409 - ..\..\lib\vc_dll\mswuniv;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - __WXMSW__;__WXUNIVERSAL__;NDEBUG;WXBUILDING;WXDLLNAME=wxmswuniv28_gl_vc_custom;WXUSINGDLL;WXMAKINGDLL_GL;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_gl.bsc - - - true - true - Console - ..\..\lib\vc_dll\wxmswuniv28_gl_vc_custom.dll - ..\..\lib\vc_dll\wxmswuniv28_gl.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxtiff.lib;wxjpeg.lib;wxpng.lib;wxzlib.lib;wxregex.lib;wxexpat.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;wxmswuniv28_core.lib;wxbase28.lib;opengl32.lib;glu32.lib;%(AdditionalDependencies) - - - - - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - - - true - true - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - true - true - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - true - true - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - true - true - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - true - true - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - true - true - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - true - true - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - true - true - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - - - - - copy "%(FullPath)" ..\..\lib\vc_dll\mswd\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_dll\mswd\wx\setup.h - Creating ..\..\lib\vc_dll\mswd\wx\setup.h - Creating ..\..\lib\vc_dll\mswd\wx\setup.h - ..\..\lib\vc_dll\mswd\wx\setup.h;%(Outputs) - ..\..\lib\vc_dll\mswd\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_dll\msw\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_dll\msw\wx\setup.h - Creating ..\..\lib\vc_dll\msw\wx\setup.h - Creating ..\..\lib\vc_dll\msw\wx\setup.h - ..\..\lib\vc_dll\msw\wx\setup.h;%(Outputs) - ..\..\lib\vc_dll\msw\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_dll\mswud\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_dll\mswud\wx\setup.h - Creating ..\..\lib\vc_dll\mswud\wx\setup.h - Creating ..\..\lib\vc_dll\mswud\wx\setup.h - ..\..\lib\vc_dll\mswud\wx\setup.h;%(Outputs) - ..\..\lib\vc_dll\mswud\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_dll\mswu\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_dll\mswu\wx\setup.h - Creating ..\..\lib\vc_dll\mswu\wx\setup.h - Creating ..\..\lib\vc_dll\mswu\wx\setup.h - ..\..\lib\vc_dll\mswu\wx\setup.h;%(Outputs) - ..\..\lib\vc_dll\mswu\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_lib\mswud\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_lib\mswud\wx\setup.h - Creating ..\..\lib\vc_lib\mswud\wx\setup.h - Creating ..\..\lib\vc_lib\mswud\wx\setup.h - ..\..\lib\vc_lib\mswud\wx\setup.h;%(Outputs) - ..\..\lib\vc_lib\mswud\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_lib\msw\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_lib\msw\wx\setup.h - Creating ..\..\lib\vc_lib\msw\wx\setup.h - Creating ..\..\lib\vc_lib\msw\wx\setup.h - ..\..\lib\vc_lib\msw\wx\setup.h;%(Outputs) - ..\..\lib\vc_lib\msw\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_lib\mswd\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_lib\mswd\wx\setup.h - Creating ..\..\lib\vc_lib\mswd\wx\setup.h - Creating ..\..\lib\vc_lib\mswd\wx\setup.h - ..\..\lib\vc_lib\mswd\wx\setup.h;%(Outputs) - ..\..\lib\vc_lib\mswd\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_lib\mswu\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_lib\mswu\wx\setup.h - Creating ..\..\lib\vc_lib\mswu\wx\setup.h - Creating ..\..\lib\vc_lib\mswu\wx\setup.h - ..\..\lib\vc_lib\mswu\wx\setup.h;%(Outputs) - ..\..\lib\vc_lib\mswu\wx\setup.h;%(Outputs) - - - copy "%(FullPath)" ..\..\lib\vc_lib\mswuniv\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_lib\mswuniv\wx\setup.h - Creating ..\..\lib\vc_lib\mswuniv\wx\setup.h - Creating ..\..\lib\vc_lib\mswuniv\wx\setup.h - ..\..\lib\vc_lib\mswuniv\wx\setup.h;%(Outputs) - ..\..\lib\vc_lib\mswuniv\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_lib\mswunivu\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_lib\mswunivu\wx\setup.h - Creating ..\..\lib\vc_lib\mswunivu\wx\setup.h - Creating ..\..\lib\vc_lib\mswunivu\wx\setup.h - ..\..\lib\vc_lib\mswunivu\wx\setup.h;%(Outputs) - ..\..\lib\vc_lib\mswunivu\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_lib\mswunivud\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_lib\mswunivud\wx\setup.h - Creating ..\..\lib\vc_lib\mswunivud\wx\setup.h - Creating ..\..\lib\vc_lib\mswunivud\wx\setup.h - ..\..\lib\vc_lib\mswunivud\wx\setup.h;%(Outputs) - ..\..\lib\vc_lib\mswunivud\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_dll\mswunivu\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_dll\mswunivu\wx\setup.h - Creating ..\..\lib\vc_dll\mswunivu\wx\setup.h - Creating ..\..\lib\vc_dll\mswunivu\wx\setup.h - ..\..\lib\vc_dll\mswunivu\wx\setup.h;%(Outputs) - ..\..\lib\vc_dll\mswunivu\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_lib\mswunivd\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_lib\mswunivd\wx\setup.h - Creating ..\..\lib\vc_lib\mswunivd\wx\setup.h - Creating ..\..\lib\vc_lib\mswunivd\wx\setup.h - ..\..\lib\vc_lib\mswunivd\wx\setup.h;%(Outputs) - ..\..\lib\vc_lib\mswunivd\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_dll\mswunivd\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_dll\mswunivd\wx\setup.h - Creating ..\..\lib\vc_dll\mswunivd\wx\setup.h - Creating ..\..\lib\vc_dll\mswunivd\wx\setup.h - ..\..\lib\vc_dll\mswunivd\wx\setup.h;%(Outputs) - ..\..\lib\vc_dll\mswunivd\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_dll\mswunivud\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_dll\mswunivud\wx\setup.h - Creating ..\..\lib\vc_dll\mswunivud\wx\setup.h - Creating ..\..\lib\vc_dll\mswunivud\wx\setup.h - ..\..\lib\vc_dll\mswunivud\wx\setup.h;%(Outputs) - ..\..\lib\vc_dll\mswunivud\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_dll\mswuniv\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_dll\mswuniv\wx\setup.h - Creating ..\..\lib\vc_dll\mswuniv\wx\setup.h - Creating ..\..\lib\vc_dll\mswuniv\wx\setup.h - ..\..\lib\vc_dll\mswuniv\wx\setup.h;%(Outputs) - ..\..\lib\vc_dll\mswuniv\wx\setup.h;%(Outputs) - - - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswuniv\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswuniv\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_lib\mswuniv\wx\msw\rcdefs.h - Creating ..\..\lib\vc_lib\mswuniv\wx\msw\rcdefs.h - ..\..\lib\vc_lib\mswuniv\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_lib\mswuniv\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswunivu\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswunivu\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_lib\mswunivu\wx\msw\rcdefs.h - Creating ..\..\lib\vc_lib\mswunivu\wx\msw\rcdefs.h - ..\..\lib\vc_lib\mswunivu\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_lib\mswunivu\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswd\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswd\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_dll\mswd\wx\msw\rcdefs.h - Creating ..\..\lib\vc_dll\mswd\wx\msw\rcdefs.h - ..\..\lib\vc_dll\mswd\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_dll\mswd\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\msw\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\msw\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_dll\msw\wx\msw\rcdefs.h - Creating ..\..\lib\vc_dll\msw\wx\msw\rcdefs.h - ..\..\lib\vc_dll\msw\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_dll\msw\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswunivud\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswunivud\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_lib\mswunivud\wx\msw\rcdefs.h - Creating ..\..\lib\vc_lib\mswunivud\wx\msw\rcdefs.h - ..\..\lib\vc_lib\mswunivud\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_lib\mswunivud\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswunivu\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswunivu\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_dll\mswunivu\wx\msw\rcdefs.h - Creating ..\..\lib\vc_dll\mswunivu\wx\msw\rcdefs.h - ..\..\lib\vc_dll\mswunivu\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_dll\mswunivu\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswud\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswud\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_dll\mswud\wx\msw\rcdefs.h - Creating ..\..\lib\vc_dll\mswud\wx\msw\rcdefs.h - ..\..\lib\vc_dll\mswud\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_dll\mswud\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswu\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswu\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_dll\mswu\wx\msw\rcdefs.h - Creating ..\..\lib\vc_dll\mswu\wx\msw\rcdefs.h - ..\..\lib\vc_dll\mswu\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_dll\mswu\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswud\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswud\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_lib\mswud\wx\msw\rcdefs.h - Creating ..\..\lib\vc_lib\mswud\wx\msw\rcdefs.h - ..\..\lib\vc_lib\mswud\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_lib\mswud\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswunivd\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswunivd\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_lib\mswunivd\wx\msw\rcdefs.h - Creating ..\..\lib\vc_lib\mswunivd\wx\msw\rcdefs.h - ..\..\lib\vc_lib\mswunivd\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_lib\mswunivd\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\msw\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\msw\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_lib\msw\wx\msw\rcdefs.h - Creating ..\..\lib\vc_lib\msw\wx\msw\rcdefs.h - ..\..\lib\vc_lib\msw\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_lib\msw\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswd\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswd\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_lib\mswd\wx\msw\rcdefs.h - Creating ..\..\lib\vc_lib\mswd\wx\msw\rcdefs.h - ..\..\lib\vc_lib\mswd\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_lib\mswd\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswunivd\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswunivd\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_dll\mswunivd\wx\msw\rcdefs.h - Creating ..\..\lib\vc_dll\mswunivd\wx\msw\rcdefs.h - ..\..\lib\vc_dll\mswunivd\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_dll\mswunivd\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswunivud\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswunivud\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_dll\mswunivud\wx\msw\rcdefs.h - Creating ..\..\lib\vc_dll\mswunivud\wx\msw\rcdefs.h - ..\..\lib\vc_dll\mswunivud\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_dll\mswunivud\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswu\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswu\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_lib\mswu\wx\msw\rcdefs.h - Creating ..\..\lib\vc_lib\mswu\wx\msw\rcdefs.h - ..\..\lib\vc_lib\mswu\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_lib\mswu\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswuniv\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswuniv\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_dll\mswuniv\wx\msw\rcdefs.h - Creating ..\..\lib\vc_dll\mswuniv\wx\msw\rcdefs.h - ..\..\lib\vc_dll\mswuniv\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_dll\mswuniv\wx\msw\rcdefs.h;%(Outputs) - - - - - - - \ No newline at end of file diff --git a/wxWidgets/build/msw/wx_gl.vcxproj.filters b/wxWidgets/build/msw/wx_gl.vcxproj.filters deleted file mode 100644 index fc452cddc2..0000000000 --- a/wxWidgets/build/msw/wx_gl.vcxproj.filters +++ /dev/null @@ -1,46 +0,0 @@ - - - - - {cbc17920-610f-4b04-8cd6-82c95662c90b} - - - {23972b3f-a98f-4367-afa3-0c29fe8e0995} - - - {f62e6546-0ce9-4f77-ae93-3e0ffa476e3b} - - - {b65b254b-de55-4eda-927e-8a2b06def7ab} - - - - - Common Sources - - - MSW Sources - - - - - MSW Sources - - - - - MSW Headers - - - - - Setup Headers - - - Setup Headers - - - MSW Headers - - - \ No newline at end of file diff --git a/wxWidgets/build/msw/wx_html.vcxproj b/wxWidgets/build/msw/wx_html.vcxproj deleted file mode 100644 index 6b7a250982..0000000000 --- a/wxWidgets/build/msw/wx_html.vcxproj +++ /dev/null @@ -1,3043 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - DLL Debug - Win32 - - - DLL Debug - x64 - - - DLL Release - Win32 - - - DLL Release - x64 - - - DLL Unicode Debug - Win32 - - - DLL Unicode Debug - x64 - - - DLL Unicode Release - Win32 - - - DLL Unicode Release - x64 - - - DLL Universal Debug - Win32 - - - DLL Universal Debug - x64 - - - DLL Universal Release - Win32 - - - DLL Universal Release - x64 - - - DLL Universal Unicode Debug - Win32 - - - DLL Universal Unicode Debug - x64 - - - DLL Universal Unicode Release - Win32 - - - DLL Universal Unicode Release - x64 - - - Release - Win32 - - - Release - x64 - - - Template - Win32 - - - Template - x64 - - - Unicode Debug - Win32 - - - Unicode Debug - x64 - - - Unicode Release - Win32 - - - Unicode Release - x64 - - - Universal Debug - Win32 - - - Universal Debug - x64 - - - Universal Release - Win32 - - - Universal Release - x64 - - - Universal Unicode Debug - Win32 - - - Universal Unicode Debug - x64 - - - Universal Unicode Release - Win32 - - - Universal Unicode Release - x64 - - - - html - - - {6EDC3B79-D217-F11A-406F-F11D856493F9} - - - - Application - v110 - - - Application - v110 - - - DynamicLibrary - false - v110 - - - DynamicLibrary - false - v110 - - - StaticLibrary - false - Unicode - v110 - - - StaticLibrary - false - Unicode - v110 - - - DynamicLibrary - false - v110 - - - DynamicLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - DynamicLibrary - false - v110 - - - DynamicLibrary - false - v110 - - - DynamicLibrary - false - Unicode - v110 - - - DynamicLibrary - false - Unicode - v110 - - - DynamicLibrary - false - Unicode - v110 - - - DynamicLibrary - false - Unicode - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - DynamicLibrary - false - Unicode - v110 - - - DynamicLibrary - false - Unicode - v110 - - - StaticLibrary - false - Unicode - v110 - - - StaticLibrary - false - Unicode - v110 - - - StaticLibrary - false - Unicode - v110 - - - StaticLibrary - false - Unicode - v110 - - - DynamicLibrary - false - Unicode - v110 - - - DynamicLibrary - false - Unicode - v110 - - - StaticLibrary - false - Unicode - v110 - - - StaticLibrary - false - Unicode - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - DynamicLibrary - false - v110 - - - DynamicLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - .\..\..\lib\vc_lib\ - .\vc_msw\html\ - - - .\..\..\lib\vc_lib\ - .\vc_msw\html\ - - - .\..\..\lib\vc_dll\ - .\vc_mswdll\html\ - false - - - .\..\..\lib\vc_dll\ - .\vc_mswdll\html\ - false - - - .\..\..\lib\vc_lib\ - .\vc_mswunivd\html\ - - - .\..\..\lib\vc_lib\ - .\vc_mswunivd\html\ - - - .\..\..\lib\vc_lib\ - .\vc_mswud\html\ - - - .\..\..\lib\vc_lib\ - .\vc_mswud\html\ - - - .\..\..\lib\vc_dll\ - .\vc_mswunivuddll\html\ - true - - - .\..\..\lib\vc_dll\ - .\vc_mswunivuddll\html\ - true - - - .\..\..\lib\vc_lib\ - .\vc_mswu\html\ - - - .\..\..\lib\vc_lib\ - .\vc_mswu\html\ - - - .\..\..\lib\vc_lib\ - .\vc_mswunivu\html\ - - - .\..\..\lib\vc_lib\ - .\vc_mswunivu\html\ - - - .\..\..\lib\vc_dll\ - .\vc_mswuddll\html\ - true - - - .\..\..\lib\vc_dll\ - .\vc_mswuddll\html\ - true - - - .\..\..\lib\vc_lib\ - .\vc_mswuniv\html\ - - - .\..\..\lib\vc_lib\ - .\vc_mswuniv\html\ - - - .\..\..\lib\vc_dll\ - .\vc_mswudll\html\ - false - - - .\..\..\lib\vc_dll\ - .\vc_mswudll\html\ - false - - - .\..\..\lib\vc_dll\ - .\vc_mswunivudll\html\ - false - - - .\..\..\lib\vc_dll\ - .\vc_mswunivudll\html\ - false - - - .\..\..\lib\vc_dll\ - .\vc_mswunivdll\html\ - false - - - .\..\..\lib\vc_dll\ - .\vc_mswunivdll\html\ - false - - - .\..\..\lib\vc_lib\ - .\vc_mswd\html\ - - - .\..\..\lib\vc_lib\ - .\vc_mswd\html\ - - - .\..\..\lib\vc_dll\ - .\vc_mswunivddll\html\ - true - - - .\..\..\lib\vc_dll\ - .\vc_mswunivddll\html\ - true - - - .\..\..\lib\vc_lib\ - .\vc_mswunivud\html\ - - - .\..\..\lib\vc_lib\ - .\vc_mswunivud\html\ - - - .\..\..\lib\vc_dll\ - .\vc_mswddll\html\ - true - - - .\..\..\lib\vc_dll\ - .\vc_mswddll\html\ - true - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_lib\msw;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;__WXMSW__;NDEBUG;WXBUILDING;%(PreprocessorDefinitions) - .\vc_msw\html\ - vc_msw\wxprec_htmllib.pch - Use - wx/wxprec.h - .\vc_msw\html\ - ..\..\lib\vc_lib\wxmsw28_html.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_html.bsc - - - true - .\..\..\..\libs\$(Configuration)\$(ProjectName).lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_lib\msw;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;__WXMSW__;NDEBUG;WXBUILDING;%(PreprocessorDefinitions) - .\vc_msw\html\ - vc_msw\wxprec_htmllib.pch - Use - wx/wxprec.h - .\vc_msw\html\ - ..\..\lib\vc_lib\wxmsw28_html.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_html.bsc - - - true - .\..\..\..\libs\$(Configuration)\$(ProjectName).lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_dll\msw;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;NDEBUG;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_HTML;%(PreprocessorDefinitions) - .\vc_mswdll\html\ - vc_mswdll\wxprec_htmldll.pch - Use - wx/wxprec.h - .\vc_mswdll\html\ - ..\..\lib\vc_dll\wxmsw28_html_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;NDEBUG;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_HTML;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_html.tlb - true - Win32 - - - 0x0409 - ..\..\lib\vc_dll\msw;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - __WXMSW__;NDEBUG;WXBUILDING;WXDLLNAME=wxmsw28_html_vc_custom;WXUSINGDLL;WXMAKINGDLL_HTML;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_html.bsc - - - true - true - Console - ..\..\lib\vc_dll\wxmsw28_html_vc_custom.dll - ..\..\lib\vc_dll\wxmsw28_html.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxtiff.lib;wxjpeg.lib;wxpng.lib;wxzlib.lib;wxregex.lib;wxexpat.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxmsw28_core.lib;..\..\lib\vc_dll\wxbase28.lib;%(AdditionalDependencies) - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_dll\msw;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;NDEBUG;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_HTML;%(PreprocessorDefinitions) - .\vc_mswdll\html\ - vc_mswdll\wxprec_htmldll.pch - Use - wx/wxprec.h - .\vc_mswdll\html\ - ..\..\lib\vc_dll\wxmsw28_html_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;NDEBUG;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_HTML;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_html.tlb - true - - - 0x0409 - ..\..\lib\vc_dll\msw;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - __WXMSW__;NDEBUG;WXBUILDING;WXDLLNAME=wxmsw28_html_vc_custom;WXUSINGDLL;WXMAKINGDLL_HTML;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_html.bsc - - - true - true - Console - ..\..\lib\vc_dll\wxmsw28_html_vc_custom.dll - ..\..\lib\vc_dll\wxmsw28_html.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxtiff.lib;wxjpeg.lib;wxpng.lib;wxzlib.lib;wxregex.lib;wxexpat.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxmsw28_core.lib;..\..\lib\vc_dll\wxbase28.lib;%(AdditionalDependencies) - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - true - ..\..\lib\vc_lib\mswunivd;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;WXBUILDING;%(PreprocessorDefinitions) - .\vc_mswunivd\html\ - vc_mswunivd\wxprec_htmllib.pch - Use - wx/wxprec.h - .\vc_mswunivd\html\ - ..\..\lib\vc_lib\wxmswuniv28d_html.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_html.bsc - - - true - ..\..\lib\vc_lib\wxmswuniv28d_html.lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - ..\..\lib\vc_lib\mswunivd;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;WXBUILDING;%(PreprocessorDefinitions) - .\vc_mswunivd\html\ - vc_mswunivd\wxprec_htmllib.pch - Use - wx/wxprec.h - .\vc_mswunivd\html\ - ..\..\lib\vc_lib\wxmswuniv28d_html.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_html.bsc - - - true - ..\..\lib\vc_lib\wxmswuniv28d_html.lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - true - ..\..\lib\vc_lib\mswud;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;__WXMSW__;__WXDEBUG__;WXBUILDING;%(PreprocessorDefinitions) - .\vc_mswud\html\ - vc_mswud\wxprec_htmllib.pch - Use - wx/wxprec.h - .\vc_mswud\html\ - ..\..\lib\vc_lib\wxmsw28ud_html.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_html.bsc - - - true - ..\..\lib\vc_lib\wxmsw28ud_html.lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - ..\..\lib\vc_lib\mswud;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;__WXMSW__;__WXDEBUG__;WXBUILDING;%(PreprocessorDefinitions) - .\vc_mswud\html\ - vc_mswud\wxprec_htmllib.pch - Use - wx/wxprec.h - .\vc_mswud\html\ - ..\..\lib\vc_lib\wxmsw28ud_html.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_html.bsc - - - true - ..\..\lib\vc_lib\wxmsw28ud_html.lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - true - ..\..\lib\vc_dll\mswunivud;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_HTML;%(PreprocessorDefinitions) - .\vc_mswunivuddll\html\ - vc_mswunivuddll\wxprec_htmldll.pch - Use - wx/wxprec.h - .\vc_mswunivuddll\html\ - ..\..\lib\vc_dll\wxmswuniv28ud_html_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;_UNICODE;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_HTML;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_html.tlb - true - Win32 - - - 0x0409 - ..\..\lib\vc_dll\mswunivud;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - _DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;_UNICODE;WXBUILDING;WXDLLNAME=wxmswuniv28ud_html_vc_custom;WXUSINGDLL;WXMAKINGDLL_HTML;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_html.bsc - - - true - true - true - Console - ..\..\lib\vc_dll\wxmswuniv28ud_html_vc_custom.dll - ..\..\lib\vc_dll\wxmswuniv28ud_html.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxtiffd.lib;wxjpegd.lib;wxpngd.lib;wxzlibd.lib;wxregexud.lib;wxexpatd.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxmswuniv28ud_core.lib;..\..\lib\vc_dll\wxbase28ud.lib;%(AdditionalDependencies) - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - ..\..\lib\vc_dll\mswunivud;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_HTML;%(PreprocessorDefinitions) - .\vc_mswunivuddll\html\ - vc_mswunivuddll\wxprec_htmldll.pch - Use - wx/wxprec.h - .\vc_mswunivuddll\html\ - ..\..\lib\vc_dll\wxmswuniv28ud_html_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;_UNICODE;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_HTML;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_html.tlb - true - - - 0x0409 - ..\..\lib\vc_dll\mswunivud;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - _DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;_UNICODE;WXBUILDING;WXDLLNAME=wxmswuniv28ud_html_vc_custom;WXUSINGDLL;WXMAKINGDLL_HTML;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_html.bsc - - - true - true - true - Console - ..\..\lib\vc_dll\wxmswuniv28ud_html_vc_custom.dll - ..\..\lib\vc_dll\wxmswuniv28ud_html.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxtiffd.lib;wxjpegd.lib;wxpngd.lib;wxzlibd.lib;wxregexud.lib;wxexpatd.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxmswuniv28ud_core.lib;..\..\lib\vc_dll\wxbase28ud.lib;%(AdditionalDependencies) - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_lib\mswu;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;__WXMSW__;NDEBUG;WXBUILDING;%(PreprocessorDefinitions) - .\vc_mswu\html\ - vc_mswu\wxprec_htmllib.pch - Use - wx/wxprec.h - .\vc_mswu\html\ - ..\..\lib\vc_lib\wxmsw28u_html.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_html.bsc - - - true - ..\..\lib\vc_lib\wxmsw28u_html.lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_lib\mswu;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;__WXMSW__;NDEBUG;WXBUILDING;%(PreprocessorDefinitions) - .\vc_mswu\html\ - vc_mswu\wxprec_htmllib.pch - Use - wx/wxprec.h - .\vc_mswu\html\ - ..\..\lib\vc_lib\wxmsw28u_html.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_html.bsc - - - true - ..\..\lib\vc_lib\wxmsw28u_html.lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_lib\mswunivu;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;__WXMSW__;__WXUNIVERSAL__;NDEBUG;WXBUILDING;%(PreprocessorDefinitions) - .\vc_mswunivu\html\ - vc_mswunivu\wxprec_htmllib.pch - Use - wx/wxprec.h - .\vc_mswunivu\html\ - ..\..\lib\vc_lib\wxmswuniv28u_html.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_html.bsc - - - true - ..\..\lib\vc_lib\wxmswuniv28u_html.lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_lib\mswunivu;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;__WXMSW__;__WXUNIVERSAL__;NDEBUG;WXBUILDING;%(PreprocessorDefinitions) - .\vc_mswunivu\html\ - vc_mswunivu\wxprec_htmllib.pch - Use - wx/wxprec.h - .\vc_mswunivu\html\ - ..\..\lib\vc_lib\wxmswuniv28u_html.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_html.bsc - - - true - ..\..\lib\vc_lib\wxmswuniv28u_html.lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - true - ..\..\lib\vc_dll\mswud;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXDEBUG__;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_HTML;%(PreprocessorDefinitions) - .\vc_mswuddll\html\ - vc_mswuddll\wxprec_htmldll.pch - Use - wx/wxprec.h - .\vc_mswuddll\html\ - ..\..\lib\vc_dll\wxmsw28ud_html_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXDEBUG__;_UNICODE;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_HTML;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_html.tlb - true - Win32 - - - 0x0409 - ..\..\lib\vc_dll\mswud;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - _DEBUG;__WXMSW__;__WXDEBUG__;_UNICODE;WXBUILDING;WXDLLNAME=wxmsw28ud_html_vc_custom;WXUSINGDLL;WXMAKINGDLL_HTML;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_html.bsc - - - true - true - true - Console - ..\..\lib\vc_dll\wxmsw28ud_html_vc_custom.dll - ..\..\lib\vc_dll\wxmsw28ud_html.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxtiffd.lib;wxjpegd.lib;wxpngd.lib;wxzlibd.lib;wxregexud.lib;wxexpatd.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxmsw28ud_core.lib;..\..\lib\vc_dll\wxbase28ud.lib;%(AdditionalDependencies) - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - ..\..\lib\vc_dll\mswud;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXDEBUG__;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_HTML;%(PreprocessorDefinitions) - .\vc_mswuddll\html\ - vc_mswuddll\wxprec_htmldll.pch - Use - wx/wxprec.h - .\vc_mswuddll\html\ - ..\..\lib\vc_dll\wxmsw28ud_html_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXDEBUG__;_UNICODE;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_HTML;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_html.tlb - true - - - 0x0409 - ..\..\lib\vc_dll\mswud;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - _DEBUG;__WXMSW__;__WXDEBUG__;_UNICODE;WXBUILDING;WXDLLNAME=wxmsw28ud_html_vc_custom;WXUSINGDLL;WXMAKINGDLL_HTML;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_html.bsc - - - true - true - true - Console - ..\..\lib\vc_dll\wxmsw28ud_html_vc_custom.dll - ..\..\lib\vc_dll\wxmsw28ud_html.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxtiffd.lib;wxjpegd.lib;wxpngd.lib;wxzlibd.lib;wxregexud.lib;wxexpatd.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxmsw28ud_core.lib;..\..\lib\vc_dll\wxbase28ud.lib;%(AdditionalDependencies) - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_lib\mswuniv;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;__WXMSW__;__WXUNIVERSAL__;NDEBUG;WXBUILDING;%(PreprocessorDefinitions) - .\vc_mswuniv\html\ - vc_mswuniv\wxprec_htmllib.pch - Use - wx/wxprec.h - .\vc_mswuniv\html\ - ..\..\lib\vc_lib\wxmswuniv28_html.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_html.bsc - - - true - ..\..\lib\vc_lib\wxmswuniv28_html.lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_lib\mswuniv;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;__WXMSW__;__WXUNIVERSAL__;NDEBUG;WXBUILDING;%(PreprocessorDefinitions) - .\vc_mswuniv\html\ - vc_mswuniv\wxprec_htmllib.pch - Use - wx/wxprec.h - .\vc_mswuniv\html\ - ..\..\lib\vc_lib\wxmswuniv28_html.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_html.bsc - - - true - ..\..\lib\vc_lib\wxmswuniv28_html.lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_dll\mswu;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;NDEBUG;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_HTML;%(PreprocessorDefinitions) - .\vc_mswudll\html\ - vc_mswudll\wxprec_htmldll.pch - Use - wx/wxprec.h - .\vc_mswudll\html\ - ..\..\lib\vc_dll\wxmsw28u_html_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;NDEBUG;_UNICODE;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_HTML;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_html.tlb - true - Win32 - - - 0x0409 - ..\..\lib\vc_dll\mswu;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - __WXMSW__;NDEBUG;_UNICODE;WXBUILDING;WXDLLNAME=wxmsw28u_html_vc_custom;WXUSINGDLL;WXMAKINGDLL_HTML;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_html.bsc - - - true - true - Console - ..\..\lib\vc_dll\wxmsw28u_html_vc_custom.dll - ..\..\lib\vc_dll\wxmsw28u_html.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxtiff.lib;wxjpeg.lib;wxpng.lib;wxzlib.lib;wxregexu.lib;wxexpat.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxmsw28u_core.lib;..\..\lib\vc_dll\wxbase28u.lib;%(AdditionalDependencies) - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_dll\mswu;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;NDEBUG;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_HTML;%(PreprocessorDefinitions) - .\vc_mswudll\html\ - vc_mswudll\wxprec_htmldll.pch - Use - wx/wxprec.h - .\vc_mswudll\html\ - ..\..\lib\vc_dll\wxmsw28u_html_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;NDEBUG;_UNICODE;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_HTML;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_html.tlb - true - - - 0x0409 - ..\..\lib\vc_dll\mswu;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - __WXMSW__;NDEBUG;_UNICODE;WXBUILDING;WXDLLNAME=wxmsw28u_html_vc_custom;WXUSINGDLL;WXMAKINGDLL_HTML;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_html.bsc - - - true - true - Console - ..\..\lib\vc_dll\wxmsw28u_html_vc_custom.dll - ..\..\lib\vc_dll\wxmsw28u_html.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxtiff.lib;wxjpeg.lib;wxpng.lib;wxzlib.lib;wxregexu.lib;wxexpat.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxmsw28u_core.lib;..\..\lib\vc_dll\wxbase28u.lib;%(AdditionalDependencies) - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_dll\mswunivu;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;__WXUNIVERSAL__;NDEBUG;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_HTML;%(PreprocessorDefinitions) - .\vc_mswunivudll\html\ - vc_mswunivudll\wxprec_htmldll.pch - Use - wx/wxprec.h - .\vc_mswunivudll\html\ - ..\..\lib\vc_dll\wxmswuniv28u_html_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;__WXUNIVERSAL__;NDEBUG;_UNICODE;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_HTML;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_html.tlb - true - Win32 - - - 0x0409 - ..\..\lib\vc_dll\mswunivu;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - __WXMSW__;__WXUNIVERSAL__;NDEBUG;_UNICODE;WXBUILDING;WXDLLNAME=wxmswuniv28u_html_vc_custom;WXUSINGDLL;WXMAKINGDLL_HTML;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_html.bsc - - - true - true - Console - ..\..\lib\vc_dll\wxmswuniv28u_html_vc_custom.dll - ..\..\lib\vc_dll\wxmswuniv28u_html.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxtiff.lib;wxjpeg.lib;wxpng.lib;wxzlib.lib;wxregexu.lib;wxexpat.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxmswuniv28u_core.lib;..\..\lib\vc_dll\wxbase28u.lib;%(AdditionalDependencies) - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_dll\mswunivu;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;__WXUNIVERSAL__;NDEBUG;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_HTML;%(PreprocessorDefinitions) - .\vc_mswunivudll\html\ - vc_mswunivudll\wxprec_htmldll.pch - Use - wx/wxprec.h - .\vc_mswunivudll\html\ - ..\..\lib\vc_dll\wxmswuniv28u_html_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;__WXUNIVERSAL__;NDEBUG;_UNICODE;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_HTML;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_html.tlb - true - - - 0x0409 - ..\..\lib\vc_dll\mswunivu;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - __WXMSW__;__WXUNIVERSAL__;NDEBUG;_UNICODE;WXBUILDING;WXDLLNAME=wxmswuniv28u_html_vc_custom;WXUSINGDLL;WXMAKINGDLL_HTML;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_html.bsc - - - true - true - Console - ..\..\lib\vc_dll\wxmswuniv28u_html_vc_custom.dll - ..\..\lib\vc_dll\wxmswuniv28u_html.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxtiff.lib;wxjpeg.lib;wxpng.lib;wxzlib.lib;wxregexu.lib;wxexpat.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxmswuniv28u_core.lib;..\..\lib\vc_dll\wxbase28u.lib;%(AdditionalDependencies) - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_dll\mswuniv;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;__WXUNIVERSAL__;NDEBUG;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_HTML;%(PreprocessorDefinitions) - .\vc_mswunivdll\html\ - vc_mswunivdll\wxprec_htmldll.pch - Use - wx/wxprec.h - .\vc_mswunivdll\html\ - ..\..\lib\vc_dll\wxmswuniv28_html_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;__WXUNIVERSAL__;NDEBUG;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_HTML;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_html.tlb - true - Win32 - - - 0x0409 - ..\..\lib\vc_dll\mswuniv;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - __WXMSW__;__WXUNIVERSAL__;NDEBUG;WXBUILDING;WXDLLNAME=wxmswuniv28_html_vc_custom;WXUSINGDLL;WXMAKINGDLL_HTML;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_html.bsc - - - true - true - Console - ..\..\lib\vc_dll\wxmswuniv28_html_vc_custom.dll - ..\..\lib\vc_dll\wxmswuniv28_html.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxtiff.lib;wxjpeg.lib;wxpng.lib;wxzlib.lib;wxregex.lib;wxexpat.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxmswuniv28_core.lib;..\..\lib\vc_dll\wxbase28.lib;%(AdditionalDependencies) - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_dll\mswuniv;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;__WXUNIVERSAL__;NDEBUG;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_HTML;%(PreprocessorDefinitions) - .\vc_mswunivdll\html\ - vc_mswunivdll\wxprec_htmldll.pch - Use - wx/wxprec.h - .\vc_mswunivdll\html\ - ..\..\lib\vc_dll\wxmswuniv28_html_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;__WXUNIVERSAL__;NDEBUG;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_HTML;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_html.tlb - true - - - 0x0409 - ..\..\lib\vc_dll\mswuniv;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - __WXMSW__;__WXUNIVERSAL__;NDEBUG;WXBUILDING;WXDLLNAME=wxmswuniv28_html_vc_custom;WXUSINGDLL;WXMAKINGDLL_HTML;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_html.bsc - - - true - true - Console - ..\..\lib\vc_dll\wxmswuniv28_html_vc_custom.dll - ..\..\lib\vc_dll\wxmswuniv28_html.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxtiff.lib;wxjpeg.lib;wxpng.lib;wxzlib.lib;wxregex.lib;wxexpat.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxmswuniv28_core.lib;..\..\lib\vc_dll\wxbase28.lib;%(AdditionalDependencies) - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - true - ..\..\lib\vc_lib\mswd;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;__WXMSW__;__WXDEBUG__;WXBUILDING;%(PreprocessorDefinitions) - .\vc_mswd\html\ - vc_mswd\wxprec_htmllib.pch - Use - wx/wxprec.h - .\vc_mswd\html\ - ..\..\lib\vc_lib\wxmsw28d_html.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_html.bsc - - - true - .\..\..\..\libs\$(Configuration)\$(ProjectName).lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - ..\..\lib\vc_lib\mswd;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;__WXMSW__;__WXDEBUG__;WXBUILDING;%(PreprocessorDefinitions) - .\vc_mswd\html\ - vc_mswd\wxprec_htmllib.pch - Use - wx/wxprec.h - .\vc_mswd\html\ - ..\..\lib\vc_lib\wxmsw28d_html.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_html.bsc - - - true - .\..\..\..\libs\$(Configuration)\$(ProjectName).lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - true - ..\..\lib\vc_dll\mswunivd;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_HTML;%(PreprocessorDefinitions) - .\vc_mswunivddll\html\ - vc_mswunivddll\wxprec_htmldll.pch - Use - wx/wxprec.h - .\vc_mswunivddll\html\ - ..\..\lib\vc_dll\wxmswuniv28d_html_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_HTML;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_html.tlb - true - Win32 - - - 0x0409 - ..\..\lib\vc_dll\mswunivd;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - _DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;WXBUILDING;WXDLLNAME=wxmswuniv28d_html_vc_custom;WXUSINGDLL;WXMAKINGDLL_HTML;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_html.bsc - - - true - true - true - Console - ..\..\lib\vc_dll\wxmswuniv28d_html_vc_custom.dll - ..\..\lib\vc_dll\wxmswuniv28d_html.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxtiffd.lib;wxjpegd.lib;wxpngd.lib;wxzlibd.lib;wxregexd.lib;wxexpatd.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxmswuniv28d_core.lib;..\..\lib\vc_dll\wxbase28d.lib;%(AdditionalDependencies) - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - ..\..\lib\vc_dll\mswunivd;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_HTML;%(PreprocessorDefinitions) - .\vc_mswunivddll\html\ - vc_mswunivddll\wxprec_htmldll.pch - Use - wx/wxprec.h - .\vc_mswunivddll\html\ - ..\..\lib\vc_dll\wxmswuniv28d_html_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_HTML;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_html.tlb - true - - - 0x0409 - ..\..\lib\vc_dll\mswunivd;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - _DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;WXBUILDING;WXDLLNAME=wxmswuniv28d_html_vc_custom;WXUSINGDLL;WXMAKINGDLL_HTML;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_html.bsc - - - true - true - true - Console - ..\..\lib\vc_dll\wxmswuniv28d_html_vc_custom.dll - ..\..\lib\vc_dll\wxmswuniv28d_html.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxtiffd.lib;wxjpegd.lib;wxpngd.lib;wxzlibd.lib;wxregexd.lib;wxexpatd.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxmswuniv28d_core.lib;..\..\lib\vc_dll\wxbase28d.lib;%(AdditionalDependencies) - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - true - ..\..\lib\vc_lib\mswunivud;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;WXBUILDING;%(PreprocessorDefinitions) - .\vc_mswunivud\html\ - vc_mswunivud\wxprec_htmllib.pch - Use - wx/wxprec.h - .\vc_mswunivud\html\ - ..\..\lib\vc_lib\wxmswuniv28ud_html.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_html.bsc - - - true - ..\..\lib\vc_lib\wxmswuniv28ud_html.lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - ..\..\lib\vc_lib\mswunivud;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;WXBUILDING;%(PreprocessorDefinitions) - .\vc_mswunivud\html\ - vc_mswunivud\wxprec_htmllib.pch - Use - wx/wxprec.h - .\vc_mswunivud\html\ - ..\..\lib\vc_lib\wxmswuniv28ud_html.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_html.bsc - - - true - ..\..\lib\vc_lib\wxmswuniv28ud_html.lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - true - ..\..\lib\vc_dll\mswd;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXDEBUG__;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_HTML;%(PreprocessorDefinitions) - .\vc_mswddll\html\ - vc_mswddll\wxprec_htmldll.pch - Use - wx/wxprec.h - .\vc_mswddll\html\ - ..\..\lib\vc_dll\wxmsw28d_html_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXDEBUG__;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_HTML;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_html.tlb - true - Win32 - - - 0x0409 - ..\..\lib\vc_dll\mswd;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - _DEBUG;__WXMSW__;__WXDEBUG__;WXBUILDING;WXDLLNAME=wxmsw28d_html_vc_custom;WXUSINGDLL;WXMAKINGDLL_HTML;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_html.bsc - - - true - true - true - Console - ..\..\lib\vc_dll\wxmsw28d_html_vc_custom.dll - ..\..\lib\vc_dll\wxmsw28d_html.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxtiffd.lib;wxjpegd.lib;wxpngd.lib;wxzlibd.lib;wxregexd.lib;wxexpatd.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxmsw28d_core.lib;..\..\lib\vc_dll\wxbase28d.lib;%(AdditionalDependencies) - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - ..\..\lib\vc_dll\mswd;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXDEBUG__;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_HTML;%(PreprocessorDefinitions) - .\vc_mswddll\html\ - vc_mswddll\wxprec_htmldll.pch - Use - wx/wxprec.h - .\vc_mswddll\html\ - ..\..\lib\vc_dll\wxmsw28d_html_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXDEBUG__;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_HTML;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_html.tlb - true - - - 0x0409 - ..\..\lib\vc_dll\mswd;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - _DEBUG;__WXMSW__;__WXDEBUG__;WXBUILDING;WXDLLNAME=wxmsw28d_html_vc_custom;WXUSINGDLL;WXMAKINGDLL_HTML;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_html.bsc - - - true - true - true - Console - ..\..\lib\vc_dll\wxmsw28d_html_vc_custom.dll - ..\..\lib\vc_dll\wxmsw28d_html.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxtiffd.lib;wxjpegd.lib;wxpngd.lib;wxzlibd.lib;wxregexd.lib;wxexpatd.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxmsw28d_core.lib;..\..\lib\vc_dll\wxbase28d.lib;%(AdditionalDependencies) - - - - - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - - - true - true - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - true - true - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - true - true - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - true - true - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - true - true - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - true - true - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - true - true - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - true - true - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - - - - - copy "%(FullPath)" ..\..\lib\vc_lib\msw\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_lib\msw\wx\setup.h - Creating ..\..\lib\vc_lib\msw\wx\setup.h - Creating ..\..\lib\vc_lib\msw\wx\setup.h - ..\..\lib\vc_lib\msw\wx\setup.h;%(Outputs) - ..\..\lib\vc_lib\msw\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_dll\msw\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_dll\msw\wx\setup.h - Creating ..\..\lib\vc_dll\msw\wx\setup.h - Creating ..\..\lib\vc_dll\msw\wx\setup.h - ..\..\lib\vc_dll\msw\wx\setup.h;%(Outputs) - ..\..\lib\vc_dll\msw\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_lib\mswud\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_lib\mswud\wx\setup.h - Creating ..\..\lib\vc_lib\mswud\wx\setup.h - Creating ..\..\lib\vc_lib\mswud\wx\setup.h - ..\..\lib\vc_lib\mswud\wx\setup.h;%(Outputs) - ..\..\lib\vc_lib\mswud\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_lib\mswu\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_lib\mswu\wx\setup.h - Creating ..\..\lib\vc_lib\mswu\wx\setup.h - Creating ..\..\lib\vc_lib\mswu\wx\setup.h - ..\..\lib\vc_lib\mswu\wx\setup.h;%(Outputs) - ..\..\lib\vc_lib\mswu\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_dll\mswud\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_dll\mswud\wx\setup.h - Creating ..\..\lib\vc_dll\mswud\wx\setup.h - Creating ..\..\lib\vc_dll\mswud\wx\setup.h - ..\..\lib\vc_dll\mswud\wx\setup.h;%(Outputs) - ..\..\lib\vc_dll\mswud\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_dll\mswu\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_dll\mswu\wx\setup.h - Creating ..\..\lib\vc_dll\mswu\wx\setup.h - Creating ..\..\lib\vc_dll\mswu\wx\setup.h - ..\..\lib\vc_dll\mswu\wx\setup.h;%(Outputs) - ..\..\lib\vc_dll\mswu\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_lib\mswd\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_lib\mswd\wx\setup.h - Creating ..\..\lib\vc_lib\mswd\wx\setup.h - Creating ..\..\lib\vc_lib\mswd\wx\setup.h - ..\..\lib\vc_lib\mswd\wx\setup.h;%(Outputs) - ..\..\lib\vc_lib\mswd\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_dll\mswd\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_dll\mswd\wx\setup.h - Creating ..\..\lib\vc_dll\mswd\wx\setup.h - Creating ..\..\lib\vc_dll\mswd\wx\setup.h - ..\..\lib\vc_dll\mswd\wx\setup.h;%(Outputs) - ..\..\lib\vc_dll\mswd\wx\setup.h;%(Outputs) - - - copy "%(FullPath)" ..\..\lib\vc_lib\mswunivd\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_lib\mswunivd\wx\setup.h - Creating ..\..\lib\vc_lib\mswunivd\wx\setup.h - Creating ..\..\lib\vc_lib\mswunivd\wx\setup.h - ..\..\lib\vc_lib\mswunivd\wx\setup.h;%(Outputs) - ..\..\lib\vc_lib\mswunivd\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_dll\mswunivud\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_dll\mswunivud\wx\setup.h - Creating ..\..\lib\vc_dll\mswunivud\wx\setup.h - Creating ..\..\lib\vc_dll\mswunivud\wx\setup.h - ..\..\lib\vc_dll\mswunivud\wx\setup.h;%(Outputs) - ..\..\lib\vc_dll\mswunivud\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_lib\mswunivu\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_lib\mswunivu\wx\setup.h - Creating ..\..\lib\vc_lib\mswunivu\wx\setup.h - Creating ..\..\lib\vc_lib\mswunivu\wx\setup.h - ..\..\lib\vc_lib\mswunivu\wx\setup.h;%(Outputs) - ..\..\lib\vc_lib\mswunivu\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_lib\mswuniv\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_lib\mswuniv\wx\setup.h - Creating ..\..\lib\vc_lib\mswuniv\wx\setup.h - Creating ..\..\lib\vc_lib\mswuniv\wx\setup.h - ..\..\lib\vc_lib\mswuniv\wx\setup.h;%(Outputs) - ..\..\lib\vc_lib\mswuniv\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_dll\mswunivu\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_dll\mswunivu\wx\setup.h - Creating ..\..\lib\vc_dll\mswunivu\wx\setup.h - Creating ..\..\lib\vc_dll\mswunivu\wx\setup.h - ..\..\lib\vc_dll\mswunivu\wx\setup.h;%(Outputs) - ..\..\lib\vc_dll\mswunivu\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_dll\mswuniv\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_dll\mswuniv\wx\setup.h - Creating ..\..\lib\vc_dll\mswuniv\wx\setup.h - Creating ..\..\lib\vc_dll\mswuniv\wx\setup.h - ..\..\lib\vc_dll\mswuniv\wx\setup.h;%(Outputs) - ..\..\lib\vc_dll\mswuniv\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_dll\mswunivd\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_dll\mswunivd\wx\setup.h - Creating ..\..\lib\vc_dll\mswunivd\wx\setup.h - Creating ..\..\lib\vc_dll\mswunivd\wx\setup.h - ..\..\lib\vc_dll\mswunivd\wx\setup.h;%(Outputs) - ..\..\lib\vc_dll\mswunivd\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_lib\mswunivud\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_lib\mswunivud\wx\setup.h - Creating ..\..\lib\vc_lib\mswunivud\wx\setup.h - Creating ..\..\lib\vc_lib\mswunivud\wx\setup.h - ..\..\lib\vc_lib\mswunivud\wx\setup.h;%(Outputs) - ..\..\lib\vc_lib\mswunivud\wx\setup.h;%(Outputs) - - - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\msw\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\msw\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_lib\msw\wx\msw\rcdefs.h - Creating ..\..\lib\vc_lib\msw\wx\msw\rcdefs.h - ..\..\lib\vc_lib\msw\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_lib\msw\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\msw\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\msw\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_dll\msw\wx\msw\rcdefs.h - Creating ..\..\lib\vc_dll\msw\wx\msw\rcdefs.h - ..\..\lib\vc_dll\msw\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_dll\msw\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswunivd\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswunivd\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_lib\mswunivd\wx\msw\rcdefs.h - Creating ..\..\lib\vc_lib\mswunivd\wx\msw\rcdefs.h - ..\..\lib\vc_lib\mswunivd\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_lib\mswunivd\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswud\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswud\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_lib\mswud\wx\msw\rcdefs.h - Creating ..\..\lib\vc_lib\mswud\wx\msw\rcdefs.h - ..\..\lib\vc_lib\mswud\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_lib\mswud\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswunivud\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswunivud\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_dll\mswunivud\wx\msw\rcdefs.h - Creating ..\..\lib\vc_dll\mswunivud\wx\msw\rcdefs.h - ..\..\lib\vc_dll\mswunivud\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_dll\mswunivud\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswu\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswu\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_lib\mswu\wx\msw\rcdefs.h - Creating ..\..\lib\vc_lib\mswu\wx\msw\rcdefs.h - ..\..\lib\vc_lib\mswu\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_lib\mswu\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswunivu\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswunivu\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_lib\mswunivu\wx\msw\rcdefs.h - Creating ..\..\lib\vc_lib\mswunivu\wx\msw\rcdefs.h - ..\..\lib\vc_lib\mswunivu\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_lib\mswunivu\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswud\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswud\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_dll\mswud\wx\msw\rcdefs.h - Creating ..\..\lib\vc_dll\mswud\wx\msw\rcdefs.h - ..\..\lib\vc_dll\mswud\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_dll\mswud\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswuniv\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswuniv\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_lib\mswuniv\wx\msw\rcdefs.h - Creating ..\..\lib\vc_lib\mswuniv\wx\msw\rcdefs.h - ..\..\lib\vc_lib\mswuniv\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_lib\mswuniv\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswu\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswu\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_dll\mswu\wx\msw\rcdefs.h - Creating ..\..\lib\vc_dll\mswu\wx\msw\rcdefs.h - ..\..\lib\vc_dll\mswu\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_dll\mswu\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswunivu\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswunivu\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_dll\mswunivu\wx\msw\rcdefs.h - Creating ..\..\lib\vc_dll\mswunivu\wx\msw\rcdefs.h - ..\..\lib\vc_dll\mswunivu\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_dll\mswunivu\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswuniv\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswuniv\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_dll\mswuniv\wx\msw\rcdefs.h - Creating ..\..\lib\vc_dll\mswuniv\wx\msw\rcdefs.h - ..\..\lib\vc_dll\mswuniv\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_dll\mswuniv\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswd\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswd\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_lib\mswd\wx\msw\rcdefs.h - Creating ..\..\lib\vc_lib\mswd\wx\msw\rcdefs.h - ..\..\lib\vc_lib\mswd\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_lib\mswd\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswunivd\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswunivd\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_dll\mswunivd\wx\msw\rcdefs.h - Creating ..\..\lib\vc_dll\mswunivd\wx\msw\rcdefs.h - ..\..\lib\vc_dll\mswunivd\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_dll\mswunivd\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswunivud\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswunivud\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_lib\mswunivud\wx\msw\rcdefs.h - Creating ..\..\lib\vc_lib\mswunivud\wx\msw\rcdefs.h - ..\..\lib\vc_lib\mswunivud\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_lib\mswunivud\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswd\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswd\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_dll\mswd\wx\msw\rcdefs.h - Creating ..\..\lib\vc_dll\mswd\wx\msw\rcdefs.h - ..\..\lib\vc_dll\mswd\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_dll\mswd\wx\msw\rcdefs.h;%(Outputs) - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/wxWidgets/build/msw/wx_html.vcxproj.filters b/wxWidgets/build/msw/wx_html.vcxproj.filters deleted file mode 100644 index 5f75570d74..0000000000 --- a/wxWidgets/build/msw/wx_html.vcxproj.filters +++ /dev/null @@ -1,178 +0,0 @@ - - - - - {65dabab9-7370-4f4e-a704-2ac6205ce0a4} - - - {e8aeb286-f791-4e18-985d-00fac7f31927} - - - {f268a26d-c412-4da4-8e31-0cc9276a9162} - - - {2870fdb6-0d25-4eb0-bafe-ec0e909f3694} - - - {da6f13b9-61f3-4e37-83eb-bd3b6791d408} - - - {e36f7228-4220-4818-b7e1-cf8746f46ee8} - - - {336f8bc5-928c-4d17-8fd5-dc4f3a7506ed} - - - {1df488d5-3f6f-4fa8-8d42-72580e5cc2d3} - - - - - Common Sources - - - MSW Sources - - - Generic Sources - - - wxHTML Sources - - - wxHTML Sources - - - wxHTML Sources - - - wxHTML Sources - - - wxHTML Sources - - - wxHTML Sources - - - wxHTML Sources - - - wxHTML Sources - - - wxHTML Sources - - - wxHTML Sources - - - wxHTML Sources - - - wxHTML Sources - - - wxHTML Sources - - - wxHTML Sources - - - wxHTML Sources - - - wxHTML Sources - - - wxHTML Sources - - - wxHTML Sources - - - wxHTML Sources - - - wxHTML Sources - - - wxHTML Sources - - - wxHTML Sources - - - - - MSW Sources - - - - - MSW Headers - - - wxHTML Headers - - - wxHTML Headers - - - wxHTML Headers - - - wxHTML Headers - - - wxHTML Headers - - - wxHTML Headers - - - wxHTML Headers - - - wxHTML Headers - - - wxHTML Headers - - - wxHTML Headers - - - wxHTML Headers - - - wxHTML Headers - - - wxHTML Headers - - - wxHTML Headers - - - wxHTML Headers - - - Common Headers - - - Common Headers - - - - - Setup Headers - - - Setup Headers - - - MSW Headers - - - \ No newline at end of file diff --git a/wxWidgets/build/msw/wx_media.vcxproj b/wxWidgets/build/msw/wx_media.vcxproj deleted file mode 100644 index dbc2f63740..0000000000 --- a/wxWidgets/build/msw/wx_media.vcxproj +++ /dev/null @@ -1,2381 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - DLL Debug - Win32 - - - DLL Debug - x64 - - - DLL Release - Win32 - - - DLL Release - x64 - - - DLL Unicode Debug - Win32 - - - DLL Unicode Debug - x64 - - - DLL Unicode Release - Win32 - - - DLL Unicode Release - x64 - - - DLL Universal Debug - Win32 - - - DLL Universal Debug - x64 - - - DLL Universal Release - Win32 - - - DLL Universal Release - x64 - - - DLL Universal Unicode Debug - Win32 - - - DLL Universal Unicode Debug - x64 - - - DLL Universal Unicode Release - Win32 - - - DLL Universal Unicode Release - x64 - - - Release - Win32 - - - Release - x64 - - - Template - Win32 - - - Template - x64 - - - Unicode Debug - Win32 - - - Unicode Debug - x64 - - - Unicode Release - Win32 - - - Unicode Release - x64 - - - Universal Debug - Win32 - - - Universal Debug - x64 - - - Universal Release - Win32 - - - Universal Release - x64 - - - Universal Unicode Debug - Win32 - - - Universal Unicode Debug - x64 - - - Universal Unicode Release - Win32 - - - Universal Unicode Release - x64 - - - - media - - - {A9AC9CF5-8E6C-0BA2-0769-6E42EDB88E25} - - - - Application - v110 - - - Application - v110 - - - DynamicLibrary - false - Unicode - v110 - - - DynamicLibrary - false - Unicode - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - DynamicLibrary - false - v110 - - - DynamicLibrary - false - v110 - - - StaticLibrary - false - Unicode - v110 - - - StaticLibrary - false - Unicode - v110 - - - DynamicLibrary - false - Unicode - v110 - - - DynamicLibrary - false - Unicode - v110 - - - DynamicLibrary - false - Unicode - v110 - - - DynamicLibrary - false - Unicode - v110 - - - StaticLibrary - false - Unicode - v110 - - - StaticLibrary - false - Unicode - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - DynamicLibrary - false - v110 - - - DynamicLibrary - false - v110 - - - DynamicLibrary - false - Unicode - v110 - - - DynamicLibrary - false - Unicode - v110 - - - DynamicLibrary - false - v110 - - - DynamicLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - Unicode - v110 - - - StaticLibrary - false - Unicode - v110 - - - StaticLibrary - false - Unicode - v110 - - - StaticLibrary - false - Unicode - v110 - - - DynamicLibrary - false - v110 - - - DynamicLibrary - false - v110 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - .\..\..\lib\vc_dll\ - .\vc_mswdll\media\ - false - - - .\..\..\lib\vc_dll\ - .\vc_mswdll\media\ - false - - - .\..\..\lib\vc_lib\ - .\vc_mswu\media\ - - - .\..\..\lib\vc_lib\ - .\vc_mswu\media\ - - - .\..\..\lib\vc_lib\ - .\vc_mswunivud\media\ - - - .\..\..\lib\vc_lib\ - .\vc_mswunivud\media\ - - - .\..\..\lib\vc_lib\ - .\vc_mswunivd\media\ - - - .\..\..\lib\vc_lib\ - .\vc_mswunivd\media\ - - - .\..\..\lib\vc_dll\ - .\vc_mswunivdll\media\ - false - - - .\..\..\lib\vc_dll\ - .\vc_mswunivdll\media\ - false - - - .\..\..\lib\vc_dll\ - .\vc_mswunivudll\media\ - false - - - .\..\..\lib\vc_dll\ - .\vc_mswunivudll\media\ - false - - - .\..\..\lib\vc_dll\ - .\vc_mswddll\media\ - true - - - .\..\..\lib\vc_dll\ - .\vc_mswddll\media\ - true - - - .\..\..\lib\vc_lib\ - .\vc_mswd\media\ - - - .\..\..\lib\vc_lib\ - .\vc_mswd\media\ - - - .\..\..\lib\vc_lib\ - .\vc_mswuniv\media\ - - - .\..\..\lib\vc_lib\ - .\vc_mswuniv\media\ - - - .\..\..\lib\vc_lib\ - .\vc_mswud\media\ - - - .\..\..\lib\vc_lib\ - .\vc_mswud\media\ - - - .\..\..\lib\vc_dll\ - .\vc_mswuddll\media\ - true - - - .\..\..\lib\vc_dll\ - .\vc_mswuddll\media\ - true - - - .\..\..\lib\vc_dll\ - .\vc_mswudll\media\ - false - - - .\..\..\lib\vc_dll\ - .\vc_mswudll\media\ - false - - - .\..\..\lib\vc_lib\ - .\vc_mswunivu\media\ - - - .\..\..\lib\vc_lib\ - .\vc_mswunivu\media\ - - - .\..\..\lib\vc_dll\ - .\vc_mswunivddll\media\ - true - - - .\..\..\lib\vc_dll\ - .\vc_mswunivddll\media\ - true - - - .\..\..\lib\vc_lib\ - .\vc_msw\media\ - - - .\..\..\lib\vc_lib\ - .\vc_msw\media\ - - - .\..\..\lib\vc_dll\ - .\vc_mswunivuddll\media\ - true - - - .\..\..\lib\vc_dll\ - .\vc_mswunivuddll\media\ - true - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_dll\msw;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;NDEBUG;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_MEDIA;%(PreprocessorDefinitions) - .\vc_mswdll\media\ - vc_mswdll\wxprec_mediadll.pch - Use - wx/wxprec.h - .\vc_mswdll\media\ - ..\..\lib\vc_dll\wxmsw28_media_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;NDEBUG;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_MEDIA;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_media.tlb - true - Win32 - - - 0x0409 - ..\..\lib\vc_dll\msw;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - __WXMSW__;NDEBUG;WXBUILDING;WXDLLNAME=wxmsw28_media_vc_custom;WXUSINGDLL;WXMAKINGDLL_MEDIA;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_media.bsc - - - true - true - Console - ..\..\lib\vc_dll\wxmsw28_media_vc_custom.dll - ..\..\lib\vc_dll\wxmsw28_media.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxtiff.lib;wxjpeg.lib;wxpng.lib;wxzlib.lib;wxregex.lib;wxexpat.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxmsw28_core.lib;..\..\lib\vc_dll\wxbase28.lib;%(AdditionalDependencies) - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_dll\msw;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;NDEBUG;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_MEDIA;%(PreprocessorDefinitions) - .\vc_mswdll\media\ - vc_mswdll\wxprec_mediadll.pch - Use - wx/wxprec.h - .\vc_mswdll\media\ - ..\..\lib\vc_dll\wxmsw28_media_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;NDEBUG;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_MEDIA;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_media.tlb - true - - - 0x0409 - ..\..\lib\vc_dll\msw;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - __WXMSW__;NDEBUG;WXBUILDING;WXDLLNAME=wxmsw28_media_vc_custom;WXUSINGDLL;WXMAKINGDLL_MEDIA;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_media.bsc - - - true - true - Console - ..\..\lib\vc_dll\wxmsw28_media_vc_custom.dll - ..\..\lib\vc_dll\wxmsw28_media.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxtiff.lib;wxjpeg.lib;wxpng.lib;wxzlib.lib;wxregex.lib;wxexpat.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxmsw28_core.lib;..\..\lib\vc_dll\wxbase28.lib;%(AdditionalDependencies) - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_lib\mswu;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;__WXMSW__;NDEBUG;WXBUILDING;%(PreprocessorDefinitions) - .\vc_mswu\media\ - vc_mswu\wxprec_medialib.pch - Use - wx/wxprec.h - .\vc_mswu\media\ - ..\..\lib\vc_lib\wxmsw28u_media.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_media.bsc - - - true - ..\..\lib\vc_lib\wxmsw28u_media.lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_lib\mswu;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;__WXMSW__;NDEBUG;WXBUILDING;%(PreprocessorDefinitions) - .\vc_mswu\media\ - vc_mswu\wxprec_medialib.pch - Use - wx/wxprec.h - .\vc_mswu\media\ - ..\..\lib\vc_lib\wxmsw28u_media.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_media.bsc - - - true - ..\..\lib\vc_lib\wxmsw28u_media.lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - true - ..\..\lib\vc_lib\mswunivud;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;WXBUILDING;%(PreprocessorDefinitions) - .\vc_mswunivud\media\ - vc_mswunivud\wxprec_medialib.pch - Use - wx/wxprec.h - .\vc_mswunivud\media\ - ..\..\lib\vc_lib\wxmswuniv28ud_media.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_media.bsc - - - true - ..\..\lib\vc_lib\wxmswuniv28ud_media.lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - ..\..\lib\vc_lib\mswunivud;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;WXBUILDING;%(PreprocessorDefinitions) - .\vc_mswunivud\media\ - vc_mswunivud\wxprec_medialib.pch - Use - wx/wxprec.h - .\vc_mswunivud\media\ - ..\..\lib\vc_lib\wxmswuniv28ud_media.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_media.bsc - - - true - ..\..\lib\vc_lib\wxmswuniv28ud_media.lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - true - ..\..\lib\vc_lib\mswunivd;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;WXBUILDING;%(PreprocessorDefinitions) - .\vc_mswunivd\media\ - vc_mswunivd\wxprec_medialib.pch - Use - wx/wxprec.h - .\vc_mswunivd\media\ - ..\..\lib\vc_lib\wxmswuniv28d_media.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_media.bsc - - - true - ..\..\lib\vc_lib\wxmswuniv28d_media.lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - ..\..\lib\vc_lib\mswunivd;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;WXBUILDING;%(PreprocessorDefinitions) - .\vc_mswunivd\media\ - vc_mswunivd\wxprec_medialib.pch - Use - wx/wxprec.h - .\vc_mswunivd\media\ - ..\..\lib\vc_lib\wxmswuniv28d_media.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_media.bsc - - - true - ..\..\lib\vc_lib\wxmswuniv28d_media.lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_dll\mswuniv;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;__WXUNIVERSAL__;NDEBUG;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_MEDIA;%(PreprocessorDefinitions) - .\vc_mswunivdll\media\ - vc_mswunivdll\wxprec_mediadll.pch - Use - wx/wxprec.h - .\vc_mswunivdll\media\ - ..\..\lib\vc_dll\wxmswuniv28_media_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;__WXUNIVERSAL__;NDEBUG;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_MEDIA;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_media.tlb - true - Win32 - - - 0x0409 - ..\..\lib\vc_dll\mswuniv;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - __WXMSW__;__WXUNIVERSAL__;NDEBUG;WXBUILDING;WXDLLNAME=wxmswuniv28_media_vc_custom;WXUSINGDLL;WXMAKINGDLL_MEDIA;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_media.bsc - - - true - true - Console - ..\..\lib\vc_dll\wxmswuniv28_media_vc_custom.dll - ..\..\lib\vc_dll\wxmswuniv28_media.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxtiff.lib;wxjpeg.lib;wxpng.lib;wxzlib.lib;wxregex.lib;wxexpat.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxmswuniv28_core.lib;..\..\lib\vc_dll\wxbase28.lib;%(AdditionalDependencies) - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_dll\mswuniv;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;__WXUNIVERSAL__;NDEBUG;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_MEDIA;%(PreprocessorDefinitions) - .\vc_mswunivdll\media\ - vc_mswunivdll\wxprec_mediadll.pch - Use - wx/wxprec.h - .\vc_mswunivdll\media\ - ..\..\lib\vc_dll\wxmswuniv28_media_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;__WXUNIVERSAL__;NDEBUG;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_MEDIA;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_media.tlb - true - - - 0x0409 - ..\..\lib\vc_dll\mswuniv;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - __WXMSW__;__WXUNIVERSAL__;NDEBUG;WXBUILDING;WXDLLNAME=wxmswuniv28_media_vc_custom;WXUSINGDLL;WXMAKINGDLL_MEDIA;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_media.bsc - - - true - true - Console - ..\..\lib\vc_dll\wxmswuniv28_media_vc_custom.dll - ..\..\lib\vc_dll\wxmswuniv28_media.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxtiff.lib;wxjpeg.lib;wxpng.lib;wxzlib.lib;wxregex.lib;wxexpat.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxmswuniv28_core.lib;..\..\lib\vc_dll\wxbase28.lib;%(AdditionalDependencies) - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_dll\mswunivu;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;__WXUNIVERSAL__;NDEBUG;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_MEDIA;%(PreprocessorDefinitions) - .\vc_mswunivudll\media\ - vc_mswunivudll\wxprec_mediadll.pch - Use - wx/wxprec.h - .\vc_mswunivudll\media\ - ..\..\lib\vc_dll\wxmswuniv28u_media_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;__WXUNIVERSAL__;NDEBUG;_UNICODE;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_MEDIA;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_media.tlb - true - Win32 - - - 0x0409 - ..\..\lib\vc_dll\mswunivu;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - __WXMSW__;__WXUNIVERSAL__;NDEBUG;_UNICODE;WXBUILDING;WXDLLNAME=wxmswuniv28u_media_vc_custom;WXUSINGDLL;WXMAKINGDLL_MEDIA;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_media.bsc - - - true - true - Console - ..\..\lib\vc_dll\wxmswuniv28u_media_vc_custom.dll - ..\..\lib\vc_dll\wxmswuniv28u_media.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxtiff.lib;wxjpeg.lib;wxpng.lib;wxzlib.lib;wxregexu.lib;wxexpat.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxmswuniv28u_core.lib;..\..\lib\vc_dll\wxbase28u.lib;%(AdditionalDependencies) - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_dll\mswunivu;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;__WXUNIVERSAL__;NDEBUG;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_MEDIA;%(PreprocessorDefinitions) - .\vc_mswunivudll\media\ - vc_mswunivudll\wxprec_mediadll.pch - Use - wx/wxprec.h - .\vc_mswunivudll\media\ - ..\..\lib\vc_dll\wxmswuniv28u_media_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;__WXUNIVERSAL__;NDEBUG;_UNICODE;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_MEDIA;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_media.tlb - true - - - 0x0409 - ..\..\lib\vc_dll\mswunivu;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - __WXMSW__;__WXUNIVERSAL__;NDEBUG;_UNICODE;WXBUILDING;WXDLLNAME=wxmswuniv28u_media_vc_custom;WXUSINGDLL;WXMAKINGDLL_MEDIA;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_media.bsc - - - true - true - Console - ..\..\lib\vc_dll\wxmswuniv28u_media_vc_custom.dll - ..\..\lib\vc_dll\wxmswuniv28u_media.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxtiff.lib;wxjpeg.lib;wxpng.lib;wxzlib.lib;wxregexu.lib;wxexpat.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxmswuniv28u_core.lib;..\..\lib\vc_dll\wxbase28u.lib;%(AdditionalDependencies) - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - true - ..\..\lib\vc_dll\mswd;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXDEBUG__;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_MEDIA;%(PreprocessorDefinitions) - .\vc_mswddll\media\ - vc_mswddll\wxprec_mediadll.pch - Use - wx/wxprec.h - .\vc_mswddll\media\ - ..\..\lib\vc_dll\wxmsw28d_media_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXDEBUG__;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_MEDIA;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_media.tlb - true - Win32 - - - 0x0409 - ..\..\lib\vc_dll\mswd;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - _DEBUG;__WXMSW__;__WXDEBUG__;WXBUILDING;WXDLLNAME=wxmsw28d_media_vc_custom;WXUSINGDLL;WXMAKINGDLL_MEDIA;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_media.bsc - - - true - true - true - Console - ..\..\lib\vc_dll\wxmsw28d_media_vc_custom.dll - ..\..\lib\vc_dll\wxmsw28d_media.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxtiffd.lib;wxjpegd.lib;wxpngd.lib;wxzlibd.lib;wxregexd.lib;wxexpatd.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxmsw28d_core.lib;..\..\lib\vc_dll\wxbase28d.lib;%(AdditionalDependencies) - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - ..\..\lib\vc_dll\mswd;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXDEBUG__;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_MEDIA;%(PreprocessorDefinitions) - .\vc_mswddll\media\ - vc_mswddll\wxprec_mediadll.pch - Use - wx/wxprec.h - .\vc_mswddll\media\ - ..\..\lib\vc_dll\wxmsw28d_media_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXDEBUG__;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_MEDIA;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_media.tlb - true - - - 0x0409 - ..\..\lib\vc_dll\mswd;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - _DEBUG;__WXMSW__;__WXDEBUG__;WXBUILDING;WXDLLNAME=wxmsw28d_media_vc_custom;WXUSINGDLL;WXMAKINGDLL_MEDIA;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_media.bsc - - - true - true - true - Console - ..\..\lib\vc_dll\wxmsw28d_media_vc_custom.dll - ..\..\lib\vc_dll\wxmsw28d_media.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxtiffd.lib;wxjpegd.lib;wxpngd.lib;wxzlibd.lib;wxregexd.lib;wxexpatd.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxmsw28d_core.lib;..\..\lib\vc_dll\wxbase28d.lib;%(AdditionalDependencies) - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - true - ..\..\lib\vc_lib\mswd;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;__WXMSW__;__WXDEBUG__;WXBUILDING;%(PreprocessorDefinitions) - .\vc_mswd\media\ - vc_mswd\wxprec_medialib.pch - Use - wx/wxprec.h - .\vc_mswd\media\ - ..\..\lib\vc_lib\wxmsw28d_media.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_media.bsc - - - true - .\..\..\..\libs\$(Configuration)\$(ProjectName).lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - ..\..\lib\vc_lib\mswd;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;__WXMSW__;__WXDEBUG__;WXBUILDING;%(PreprocessorDefinitions) - .\vc_mswd\media\ - vc_mswd\wxprec_medialib.pch - Use - wx/wxprec.h - .\vc_mswd\media\ - ..\..\lib\vc_lib\wxmsw28d_media.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_media.bsc - - - true - .\..\..\..\libs\$(Configuration)\$(ProjectName).lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_lib\mswuniv;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;__WXMSW__;__WXUNIVERSAL__;NDEBUG;WXBUILDING;%(PreprocessorDefinitions) - .\vc_mswuniv\media\ - vc_mswuniv\wxprec_medialib.pch - Use - wx/wxprec.h - .\vc_mswuniv\media\ - ..\..\lib\vc_lib\wxmswuniv28_media.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_media.bsc - - - true - ..\..\lib\vc_lib\wxmswuniv28_media.lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_lib\mswuniv;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;__WXMSW__;__WXUNIVERSAL__;NDEBUG;WXBUILDING;%(PreprocessorDefinitions) - .\vc_mswuniv\media\ - vc_mswuniv\wxprec_medialib.pch - Use - wx/wxprec.h - .\vc_mswuniv\media\ - ..\..\lib\vc_lib\wxmswuniv28_media.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_media.bsc - - - true - ..\..\lib\vc_lib\wxmswuniv28_media.lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - true - ..\..\lib\vc_lib\mswud;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;__WXMSW__;__WXDEBUG__;WXBUILDING;%(PreprocessorDefinitions) - .\vc_mswud\media\ - vc_mswud\wxprec_medialib.pch - Use - wx/wxprec.h - .\vc_mswud\media\ - ..\..\lib\vc_lib\wxmsw28ud_media.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_media.bsc - - - true - ..\..\lib\vc_lib\wxmsw28ud_media.lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - ..\..\lib\vc_lib\mswud;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;__WXMSW__;__WXDEBUG__;WXBUILDING;%(PreprocessorDefinitions) - .\vc_mswud\media\ - vc_mswud\wxprec_medialib.pch - Use - wx/wxprec.h - .\vc_mswud\media\ - ..\..\lib\vc_lib\wxmsw28ud_media.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_media.bsc - - - true - ..\..\lib\vc_lib\wxmsw28ud_media.lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - true - ..\..\lib\vc_dll\mswud;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXDEBUG__;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_MEDIA;%(PreprocessorDefinitions) - .\vc_mswuddll\media\ - vc_mswuddll\wxprec_mediadll.pch - Use - wx/wxprec.h - .\vc_mswuddll\media\ - ..\..\lib\vc_dll\wxmsw28ud_media_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXDEBUG__;_UNICODE;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_MEDIA;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_media.tlb - true - Win32 - - - 0x0409 - ..\..\lib\vc_dll\mswud;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - _DEBUG;__WXMSW__;__WXDEBUG__;_UNICODE;WXBUILDING;WXDLLNAME=wxmsw28ud_media_vc_custom;WXUSINGDLL;WXMAKINGDLL_MEDIA;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_media.bsc - - - true - true - true - Console - ..\..\lib\vc_dll\wxmsw28ud_media_vc_custom.dll - ..\..\lib\vc_dll\wxmsw28ud_media.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxtiffd.lib;wxjpegd.lib;wxpngd.lib;wxzlibd.lib;wxregexud.lib;wxexpatd.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxmsw28ud_core.lib;..\..\lib\vc_dll\wxbase28ud.lib;%(AdditionalDependencies) - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - ..\..\lib\vc_dll\mswud;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXDEBUG__;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_MEDIA;%(PreprocessorDefinitions) - .\vc_mswuddll\media\ - vc_mswuddll\wxprec_mediadll.pch - Use - wx/wxprec.h - .\vc_mswuddll\media\ - ..\..\lib\vc_dll\wxmsw28ud_media_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXDEBUG__;_UNICODE;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_MEDIA;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_media.tlb - true - - - 0x0409 - ..\..\lib\vc_dll\mswud;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - _DEBUG;__WXMSW__;__WXDEBUG__;_UNICODE;WXBUILDING;WXDLLNAME=wxmsw28ud_media_vc_custom;WXUSINGDLL;WXMAKINGDLL_MEDIA;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_media.bsc - - - true - true - true - Console - ..\..\lib\vc_dll\wxmsw28ud_media_vc_custom.dll - ..\..\lib\vc_dll\wxmsw28ud_media.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxtiffd.lib;wxjpegd.lib;wxpngd.lib;wxzlibd.lib;wxregexud.lib;wxexpatd.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxmsw28ud_core.lib;..\..\lib\vc_dll\wxbase28ud.lib;%(AdditionalDependencies) - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_dll\mswu;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;NDEBUG;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_MEDIA;%(PreprocessorDefinitions) - .\vc_mswudll\media\ - vc_mswudll\wxprec_mediadll.pch - Use - wx/wxprec.h - .\vc_mswudll\media\ - ..\..\lib\vc_dll\wxmsw28u_media_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;NDEBUG;_UNICODE;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_MEDIA;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_media.tlb - true - Win32 - - - 0x0409 - ..\..\lib\vc_dll\mswu;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - __WXMSW__;NDEBUG;_UNICODE;WXBUILDING;WXDLLNAME=wxmsw28u_media_vc_custom;WXUSINGDLL;WXMAKINGDLL_MEDIA;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_media.bsc - - - true - true - Console - ..\..\lib\vc_dll\wxmsw28u_media_vc_custom.dll - ..\..\lib\vc_dll\wxmsw28u_media.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxtiff.lib;wxjpeg.lib;wxpng.lib;wxzlib.lib;wxregexu.lib;wxexpat.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxmsw28u_core.lib;..\..\lib\vc_dll\wxbase28u.lib;%(AdditionalDependencies) - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_dll\mswu;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;NDEBUG;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_MEDIA;%(PreprocessorDefinitions) - .\vc_mswudll\media\ - vc_mswudll\wxprec_mediadll.pch - Use - wx/wxprec.h - .\vc_mswudll\media\ - ..\..\lib\vc_dll\wxmsw28u_media_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;NDEBUG;_UNICODE;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_MEDIA;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_media.tlb - true - - - 0x0409 - ..\..\lib\vc_dll\mswu;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - __WXMSW__;NDEBUG;_UNICODE;WXBUILDING;WXDLLNAME=wxmsw28u_media_vc_custom;WXUSINGDLL;WXMAKINGDLL_MEDIA;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_media.bsc - - - true - true - Console - ..\..\lib\vc_dll\wxmsw28u_media_vc_custom.dll - ..\..\lib\vc_dll\wxmsw28u_media.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxtiff.lib;wxjpeg.lib;wxpng.lib;wxzlib.lib;wxregexu.lib;wxexpat.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxmsw28u_core.lib;..\..\lib\vc_dll\wxbase28u.lib;%(AdditionalDependencies) - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_lib\mswunivu;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;__WXMSW__;__WXUNIVERSAL__;NDEBUG;WXBUILDING;%(PreprocessorDefinitions) - .\vc_mswunivu\media\ - vc_mswunivu\wxprec_medialib.pch - Use - wx/wxprec.h - .\vc_mswunivu\media\ - ..\..\lib\vc_lib\wxmswuniv28u_media.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_media.bsc - - - true - ..\..\lib\vc_lib\wxmswuniv28u_media.lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_lib\mswunivu;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;__WXMSW__;__WXUNIVERSAL__;NDEBUG;WXBUILDING;%(PreprocessorDefinitions) - .\vc_mswunivu\media\ - vc_mswunivu\wxprec_medialib.pch - Use - wx/wxprec.h - .\vc_mswunivu\media\ - ..\..\lib\vc_lib\wxmswuniv28u_media.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_media.bsc - - - true - ..\..\lib\vc_lib\wxmswuniv28u_media.lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - true - ..\..\lib\vc_dll\mswunivd;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_MEDIA;%(PreprocessorDefinitions) - .\vc_mswunivddll\media\ - vc_mswunivddll\wxprec_mediadll.pch - Use - wx/wxprec.h - .\vc_mswunivddll\media\ - ..\..\lib\vc_dll\wxmswuniv28d_media_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_MEDIA;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_media.tlb - true - Win32 - - - 0x0409 - ..\..\lib\vc_dll\mswunivd;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - _DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;WXBUILDING;WXDLLNAME=wxmswuniv28d_media_vc_custom;WXUSINGDLL;WXMAKINGDLL_MEDIA;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_media.bsc - - - true - true - true - Console - ..\..\lib\vc_dll\wxmswuniv28d_media_vc_custom.dll - ..\..\lib\vc_dll\wxmswuniv28d_media.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxtiffd.lib;wxjpegd.lib;wxpngd.lib;wxzlibd.lib;wxregexd.lib;wxexpatd.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxmswuniv28d_core.lib;..\..\lib\vc_dll\wxbase28d.lib;%(AdditionalDependencies) - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - ..\..\lib\vc_dll\mswunivd;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_MEDIA;%(PreprocessorDefinitions) - .\vc_mswunivddll\media\ - vc_mswunivddll\wxprec_mediadll.pch - Use - wx/wxprec.h - .\vc_mswunivddll\media\ - ..\..\lib\vc_dll\wxmswuniv28d_media_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_MEDIA;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_media.tlb - true - - - 0x0409 - ..\..\lib\vc_dll\mswunivd;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - _DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;WXBUILDING;WXDLLNAME=wxmswuniv28d_media_vc_custom;WXUSINGDLL;WXMAKINGDLL_MEDIA;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_media.bsc - - - true - true - true - Console - ..\..\lib\vc_dll\wxmswuniv28d_media_vc_custom.dll - ..\..\lib\vc_dll\wxmswuniv28d_media.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxtiffd.lib;wxjpegd.lib;wxpngd.lib;wxzlibd.lib;wxregexd.lib;wxexpatd.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxmswuniv28d_core.lib;..\..\lib\vc_dll\wxbase28d.lib;%(AdditionalDependencies) - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_lib\msw;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;__WXMSW__;NDEBUG;WXBUILDING;%(PreprocessorDefinitions) - .\vc_msw\media\ - vc_msw\wxprec_medialib.pch - Use - wx/wxprec.h - .\vc_msw\media\ - ..\..\lib\vc_lib\wxmsw28_media.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_media.bsc - - - true - .\..\..\..\libs\$(Configuration)\$(ProjectName).lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_lib\msw;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;__WXMSW__;NDEBUG;WXBUILDING;%(PreprocessorDefinitions) - .\vc_msw\media\ - vc_msw\wxprec_medialib.pch - Use - wx/wxprec.h - .\vc_msw\media\ - ..\..\lib\vc_lib\wxmsw28_media.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_media.bsc - - - true - .\..\..\..\libs\$(Configuration)\$(ProjectName).lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - true - ..\..\lib\vc_dll\mswunivud;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_MEDIA;%(PreprocessorDefinitions) - .\vc_mswunivuddll\media\ - vc_mswunivuddll\wxprec_mediadll.pch - Use - wx/wxprec.h - .\vc_mswunivuddll\media\ - ..\..\lib\vc_dll\wxmswuniv28ud_media_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;_UNICODE;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_MEDIA;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_media.tlb - true - Win32 - - - 0x0409 - ..\..\lib\vc_dll\mswunivud;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - _DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;_UNICODE;WXBUILDING;WXDLLNAME=wxmswuniv28ud_media_vc_custom;WXUSINGDLL;WXMAKINGDLL_MEDIA;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_media.bsc - - - true - true - true - Console - ..\..\lib\vc_dll\wxmswuniv28ud_media_vc_custom.dll - ..\..\lib\vc_dll\wxmswuniv28ud_media.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxtiffd.lib;wxjpegd.lib;wxpngd.lib;wxzlibd.lib;wxregexud.lib;wxexpatd.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxmswuniv28ud_core.lib;..\..\lib\vc_dll\wxbase28ud.lib;%(AdditionalDependencies) - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - ..\..\lib\vc_dll\mswunivud;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_MEDIA;%(PreprocessorDefinitions) - .\vc_mswunivuddll\media\ - vc_mswunivuddll\wxprec_mediadll.pch - Use - wx/wxprec.h - .\vc_mswunivuddll\media\ - ..\..\lib\vc_dll\wxmswuniv28ud_media_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;_UNICODE;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_MEDIA;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_media.tlb - true - - - 0x0409 - ..\..\lib\vc_dll\mswunivud;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - _DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;_UNICODE;WXBUILDING;WXDLLNAME=wxmswuniv28ud_media_vc_custom;WXUSINGDLL;WXMAKINGDLL_MEDIA;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_media.bsc - - - true - true - true - Console - ..\..\lib\vc_dll\wxmswuniv28ud_media_vc_custom.dll - ..\..\lib\vc_dll\wxmswuniv28ud_media.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxtiffd.lib;wxjpegd.lib;wxpngd.lib;wxzlibd.lib;wxregexud.lib;wxexpatd.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxmswuniv28ud_core.lib;..\..\lib\vc_dll\wxbase28ud.lib;%(AdditionalDependencies) - - - - - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - - - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - true - true - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - true - true - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - true - true - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - true - true - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - true - true - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - true - true - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - true - true - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - true - true - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - - - - - copy "%(FullPath)" ..\..\lib\vc_dll\msw\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_dll\msw\wx\setup.h - Creating ..\..\lib\vc_dll\msw\wx\setup.h - Creating ..\..\lib\vc_dll\msw\wx\setup.h - ..\..\lib\vc_dll\msw\wx\setup.h;%(Outputs) - ..\..\lib\vc_dll\msw\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_lib\mswu\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_lib\mswu\wx\setup.h - Creating ..\..\lib\vc_lib\mswu\wx\setup.h - Creating ..\..\lib\vc_lib\mswu\wx\setup.h - ..\..\lib\vc_lib\mswu\wx\setup.h;%(Outputs) - ..\..\lib\vc_lib\mswu\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_dll\mswd\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_dll\mswd\wx\setup.h - Creating ..\..\lib\vc_dll\mswd\wx\setup.h - Creating ..\..\lib\vc_dll\mswd\wx\setup.h - ..\..\lib\vc_dll\mswd\wx\setup.h;%(Outputs) - ..\..\lib\vc_dll\mswd\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_lib\mswd\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_lib\mswd\wx\setup.h - Creating ..\..\lib\vc_lib\mswd\wx\setup.h - Creating ..\..\lib\vc_lib\mswd\wx\setup.h - ..\..\lib\vc_lib\mswd\wx\setup.h;%(Outputs) - ..\..\lib\vc_lib\mswd\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_lib\mswud\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_lib\mswud\wx\setup.h - Creating ..\..\lib\vc_lib\mswud\wx\setup.h - Creating ..\..\lib\vc_lib\mswud\wx\setup.h - ..\..\lib\vc_lib\mswud\wx\setup.h;%(Outputs) - ..\..\lib\vc_lib\mswud\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_dll\mswud\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_dll\mswud\wx\setup.h - Creating ..\..\lib\vc_dll\mswud\wx\setup.h - Creating ..\..\lib\vc_dll\mswud\wx\setup.h - ..\..\lib\vc_dll\mswud\wx\setup.h;%(Outputs) - ..\..\lib\vc_dll\mswud\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_dll\mswu\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_dll\mswu\wx\setup.h - Creating ..\..\lib\vc_dll\mswu\wx\setup.h - Creating ..\..\lib\vc_dll\mswu\wx\setup.h - ..\..\lib\vc_dll\mswu\wx\setup.h;%(Outputs) - ..\..\lib\vc_dll\mswu\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_lib\msw\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_lib\msw\wx\setup.h - Creating ..\..\lib\vc_lib\msw\wx\setup.h - Creating ..\..\lib\vc_lib\msw\wx\setup.h - ..\..\lib\vc_lib\msw\wx\setup.h;%(Outputs) - ..\..\lib\vc_lib\msw\wx\setup.h;%(Outputs) - - - copy "%(FullPath)" ..\..\lib\vc_lib\mswunivud\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_lib\mswunivud\wx\setup.h - Creating ..\..\lib\vc_lib\mswunivud\wx\setup.h - Creating ..\..\lib\vc_lib\mswunivud\wx\setup.h - ..\..\lib\vc_lib\mswunivud\wx\setup.h;%(Outputs) - ..\..\lib\vc_lib\mswunivud\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_lib\mswunivd\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_lib\mswunivd\wx\setup.h - Creating ..\..\lib\vc_lib\mswunivd\wx\setup.h - Creating ..\..\lib\vc_lib\mswunivd\wx\setup.h - ..\..\lib\vc_lib\mswunivd\wx\setup.h;%(Outputs) - ..\..\lib\vc_lib\mswunivd\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_dll\mswuniv\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_dll\mswuniv\wx\setup.h - Creating ..\..\lib\vc_dll\mswuniv\wx\setup.h - Creating ..\..\lib\vc_dll\mswuniv\wx\setup.h - ..\..\lib\vc_dll\mswuniv\wx\setup.h;%(Outputs) - ..\..\lib\vc_dll\mswuniv\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_dll\mswunivu\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_dll\mswunivu\wx\setup.h - Creating ..\..\lib\vc_dll\mswunivu\wx\setup.h - Creating ..\..\lib\vc_dll\mswunivu\wx\setup.h - ..\..\lib\vc_dll\mswunivu\wx\setup.h;%(Outputs) - ..\..\lib\vc_dll\mswunivu\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_lib\mswuniv\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_lib\mswuniv\wx\setup.h - Creating ..\..\lib\vc_lib\mswuniv\wx\setup.h - Creating ..\..\lib\vc_lib\mswuniv\wx\setup.h - ..\..\lib\vc_lib\mswuniv\wx\setup.h;%(Outputs) - ..\..\lib\vc_lib\mswuniv\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_lib\mswunivu\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_lib\mswunivu\wx\setup.h - Creating ..\..\lib\vc_lib\mswunivu\wx\setup.h - Creating ..\..\lib\vc_lib\mswunivu\wx\setup.h - ..\..\lib\vc_lib\mswunivu\wx\setup.h;%(Outputs) - ..\..\lib\vc_lib\mswunivu\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_dll\mswunivd\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_dll\mswunivd\wx\setup.h - Creating ..\..\lib\vc_dll\mswunivd\wx\setup.h - Creating ..\..\lib\vc_dll\mswunivd\wx\setup.h - ..\..\lib\vc_dll\mswunivd\wx\setup.h;%(Outputs) - ..\..\lib\vc_dll\mswunivd\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_dll\mswunivud\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_dll\mswunivud\wx\setup.h - Creating ..\..\lib\vc_dll\mswunivud\wx\setup.h - Creating ..\..\lib\vc_dll\mswunivud\wx\setup.h - ..\..\lib\vc_dll\mswunivud\wx\setup.h;%(Outputs) - ..\..\lib\vc_dll\mswunivud\wx\setup.h;%(Outputs) - - - - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\msw\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\msw\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_dll\msw\wx\msw\rcdefs.h - Creating ..\..\lib\vc_dll\msw\wx\msw\rcdefs.h - ..\..\lib\vc_dll\msw\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_dll\msw\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswu\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswu\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_lib\mswu\wx\msw\rcdefs.h - Creating ..\..\lib\vc_lib\mswu\wx\msw\rcdefs.h - ..\..\lib\vc_lib\mswu\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_lib\mswu\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswunivud\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswunivud\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_lib\mswunivud\wx\msw\rcdefs.h - Creating ..\..\lib\vc_lib\mswunivud\wx\msw\rcdefs.h - ..\..\lib\vc_lib\mswunivud\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_lib\mswunivud\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswunivd\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswunivd\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_lib\mswunivd\wx\msw\rcdefs.h - Creating ..\..\lib\vc_lib\mswunivd\wx\msw\rcdefs.h - ..\..\lib\vc_lib\mswunivd\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_lib\mswunivd\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswuniv\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswuniv\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_dll\mswuniv\wx\msw\rcdefs.h - Creating ..\..\lib\vc_dll\mswuniv\wx\msw\rcdefs.h - ..\..\lib\vc_dll\mswuniv\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_dll\mswuniv\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswunivu\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswunivu\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_dll\mswunivu\wx\msw\rcdefs.h - Creating ..\..\lib\vc_dll\mswunivu\wx\msw\rcdefs.h - ..\..\lib\vc_dll\mswunivu\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_dll\mswunivu\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswd\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswd\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_dll\mswd\wx\msw\rcdefs.h - Creating ..\..\lib\vc_dll\mswd\wx\msw\rcdefs.h - ..\..\lib\vc_dll\mswd\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_dll\mswd\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswd\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswd\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_lib\mswd\wx\msw\rcdefs.h - Creating ..\..\lib\vc_lib\mswd\wx\msw\rcdefs.h - ..\..\lib\vc_lib\mswd\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_lib\mswd\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswuniv\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswuniv\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_lib\mswuniv\wx\msw\rcdefs.h - Creating ..\..\lib\vc_lib\mswuniv\wx\msw\rcdefs.h - ..\..\lib\vc_lib\mswuniv\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_lib\mswuniv\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswud\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswud\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_lib\mswud\wx\msw\rcdefs.h - Creating ..\..\lib\vc_lib\mswud\wx\msw\rcdefs.h - ..\..\lib\vc_lib\mswud\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_lib\mswud\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswud\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswud\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_dll\mswud\wx\msw\rcdefs.h - Creating ..\..\lib\vc_dll\mswud\wx\msw\rcdefs.h - ..\..\lib\vc_dll\mswud\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_dll\mswud\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswu\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswu\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_dll\mswu\wx\msw\rcdefs.h - Creating ..\..\lib\vc_dll\mswu\wx\msw\rcdefs.h - ..\..\lib\vc_dll\mswu\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_dll\mswu\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswunivu\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswunivu\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_lib\mswunivu\wx\msw\rcdefs.h - Creating ..\..\lib\vc_lib\mswunivu\wx\msw\rcdefs.h - ..\..\lib\vc_lib\mswunivu\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_lib\mswunivu\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswunivd\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswunivd\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_dll\mswunivd\wx\msw\rcdefs.h - Creating ..\..\lib\vc_dll\mswunivd\wx\msw\rcdefs.h - ..\..\lib\vc_dll\mswunivd\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_dll\mswunivd\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\msw\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\msw\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_lib\msw\wx\msw\rcdefs.h - Creating ..\..\lib\vc_lib\msw\wx\msw\rcdefs.h - ..\..\lib\vc_lib\msw\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_lib\msw\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswunivud\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswunivud\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_dll\mswunivud\wx\msw\rcdefs.h - Creating ..\..\lib\vc_dll\mswunivud\wx\msw\rcdefs.h - ..\..\lib\vc_dll\mswunivud\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_dll\mswunivud\wx\msw\rcdefs.h;%(Outputs) - - - - - - - \ No newline at end of file diff --git a/wxWidgets/build/msw/wx_media.vcxproj.filters b/wxWidgets/build/msw/wx_media.vcxproj.filters deleted file mode 100644 index acde6d3f03..0000000000 --- a/wxWidgets/build/msw/wx_media.vcxproj.filters +++ /dev/null @@ -1,64 +0,0 @@ - - - - - {f137e3ae-488b-4f36-a069-5e4af32c91c5} - - - {03f7fffb-d663-4b5d-b841-6a9227efb928} - - - {181482b5-4d88-48cd-bb7e-3be6c33c8e1e} - - - {468fdee8-cfd1-43b9-9905-8c00980da334} - - - {2bc8b577-a69f-4e92-9cda-7ec0089f3684} - - - - - Common Sources - - - Common Sources - - - MSW Sources - - - MSW Sources - - - MSW Sources - - - MSW Sources - - - - - MSW Sources - - - - - MSW Headers - - - Common Headers - - - - - Setup Headers - - - Setup Headers - - - MSW Headers - - - \ No newline at end of file diff --git a/wxWidgets/build/msw/wx_net.vcxproj b/wxWidgets/build/msw/wx_net.vcxproj deleted file mode 100644 index 9c4bdbddff..0000000000 --- a/wxWidgets/build/msw/wx_net.vcxproj +++ /dev/null @@ -1,2629 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - DLL Debug - Win32 - - - DLL Debug - x64 - - - DLL Release - Win32 - - - DLL Release - x64 - - - DLL Unicode Debug - Win32 - - - DLL Unicode Debug - x64 - - - DLL Unicode Release - Win32 - - - DLL Unicode Release - x64 - - - DLL Universal Debug - Win32 - - - DLL Universal Debug - x64 - - - DLL Universal Release - Win32 - - - DLL Universal Release - x64 - - - DLL Universal Unicode Debug - Win32 - - - DLL Universal Unicode Debug - x64 - - - DLL Universal Unicode Release - Win32 - - - DLL Universal Unicode Release - x64 - - - Release - Win32 - - - Release - x64 - - - Template - Win32 - - - Template - x64 - - - Unicode Debug - Win32 - - - Unicode Debug - x64 - - - Unicode Release - Win32 - - - Unicode Release - x64 - - - Universal Debug - Win32 - - - Universal Debug - x64 - - - Universal Release - Win32 - - - Universal Release - x64 - - - Universal Unicode Debug - Win32 - - - Universal Unicode Debug - x64 - - - Universal Unicode Release - Win32 - - - Universal Unicode Release - x64 - - - - net - - - {CD478F02-7550-58A5-E085-CE4BC0C0AD23} - - - - Application - v110 - - - Application - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - Unicode - v110 - - - StaticLibrary - false - Unicode - v110 - - - DynamicLibrary - false - Unicode - v110 - - - DynamicLibrary - false - Unicode - v110 - - - DynamicLibrary - false - v110 - - - DynamicLibrary - false - v110 - - - StaticLibrary - false - Unicode - v110 - - - StaticLibrary - false - Unicode - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - DynamicLibrary - false - Unicode - v110 - - - DynamicLibrary - false - Unicode - v110 - - - StaticLibrary - false - Unicode - v110 - - - StaticLibrary - false - Unicode - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - DynamicLibrary - false - Unicode - v110 - - - DynamicLibrary - false - Unicode - v110 - - - DynamicLibrary - false - v110 - - - DynamicLibrary - false - v110 - - - StaticLibrary - false - Unicode - v110 - - - StaticLibrary - false - Unicode - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - DynamicLibrary - false - Unicode - v110 - - - DynamicLibrary - false - Unicode - v110 - - - DynamicLibrary - false - v110 - - - DynamicLibrary - false - v110 - - - DynamicLibrary - false - v110 - - - DynamicLibrary - false - v110 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - .\..\..\lib\vc_dll\ - .\vc_mswdll\net\ - false - - - .\..\..\lib\vc_dll\ - .\vc_mswdll\net\ - false - - - .\..\..\lib\vc_dll\ - .\vc_mswunivdll\net\ - false - - - .\..\..\lib\vc_dll\ - .\vc_mswunivdll\net\ - false - - - .\..\..\lib\vc_dll\ - .\vc_mswunivudll\net\ - false - - - .\..\..\lib\vc_dll\ - .\vc_mswunivudll\net\ - false - - - .\..\..\lib\vc_lib\ - .\vc_mswuniv\net\ - - - .\..\..\lib\vc_lib\ - .\vc_mswuniv\net\ - - - .\..\..\lib\vc_lib\ - .\vc_mswunivud\net\ - - - .\..\..\lib\vc_lib\ - .\vc_mswunivud\net\ - - - .\..\..\lib\vc_dll\ - .\vc_mswunivddll\net\ - true - - - .\..\..\lib\vc_dll\ - .\vc_mswunivddll\net\ - true - - - .\..\..\lib\vc_dll\ - .\vc_mswunivuddll\net\ - true - - - .\..\..\lib\vc_dll\ - .\vc_mswunivuddll\net\ - true - - - .\..\..\lib\vc_lib\ - .\vc_mswunivd\net\ - - - .\..\..\lib\vc_lib\ - .\vc_mswunivd\net\ - - - .\..\..\lib\vc_lib\ - .\vc_mswud\net\ - - - .\..\..\lib\vc_lib\ - .\vc_mswud\net\ - - - .\..\..\lib\vc_dll\ - .\vc_mswudll\net\ - false - - - .\..\..\lib\vc_dll\ - .\vc_mswudll\net\ - false - - - .\..\..\lib\vc_lib\ - .\vc_mswd\net\ - - - .\..\..\lib\vc_lib\ - .\vc_mswd\net\ - - - .\..\..\lib\vc_lib\ - .\vc_mswu\net\ - - - .\..\..\lib\vc_lib\ - .\vc_mswu\net\ - - - .\..\..\lib\vc_dll\ - .\vc_mswddll\net\ - true - - - .\..\..\lib\vc_dll\ - .\vc_mswddll\net\ - true - - - .\..\..\lib\vc_dll\ - .\vc_mswuddll\net\ - true - - - .\..\..\lib\vc_dll\ - .\vc_mswuddll\net\ - true - - - .\..\..\lib\vc_lib\ - .\vc_mswunivu\net\ - - - .\..\..\lib\vc_lib\ - .\vc_mswunivu\net\ - - - .\..\..\lib\vc_lib\ - .\vc_msw\net\ - - - .\..\..\lib\vc_lib\ - .\vc_msw\net\ - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_dll\msw;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;NDEBUG;WXBUILDING;wxUSE_GUI=0;WXUSINGDLL;WXMAKINGDLL_NET;%(PreprocessorDefinitions) - .\vc_mswdll\net\ - vc_mswdll\wxprec_netdll.pch - Use - wx/wxprec.h - .\vc_mswdll\net\ - ..\..\lib\vc_dll\wxbase28_net_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;NDEBUG;WXBUILDING;wxUSE_GUI=0;WXUSINGDLL;WXMAKINGDLL_NET;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_net.tlb - true - Win32 - - - 0x0409 - ..\..\lib\vc_dll\msw;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - __WXMSW__;NDEBUG;WXBUILDING;WXDLLNAME=wxbase28_net_vc_custom;wxUSE_GUI=0;WXUSINGDLL;WXMAKINGDLL_NET;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_net.bsc - - - true - true - Console - ..\..\lib\vc_dll\wxbase28_net_vc_custom.dll - ..\..\lib\vc_dll\wxbase28_net.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxzlib.lib;wxregex.lib;wxexpat.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxbase28.lib;%(AdditionalDependencies) - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_dll\msw;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;NDEBUG;WXBUILDING;wxUSE_GUI=0;WXUSINGDLL;WXMAKINGDLL_NET;%(PreprocessorDefinitions) - .\vc_mswdll\net\ - vc_mswdll\wxprec_netdll.pch - Use - wx/wxprec.h - .\vc_mswdll\net\ - ..\..\lib\vc_dll\wxbase28_net_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;NDEBUG;WXBUILDING;wxUSE_GUI=0;WXUSINGDLL;WXMAKINGDLL_NET;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_net.tlb - true - - - 0x0409 - ..\..\lib\vc_dll\msw;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - __WXMSW__;NDEBUG;WXBUILDING;WXDLLNAME=wxbase28_net_vc_custom;wxUSE_GUI=0;WXUSINGDLL;WXMAKINGDLL_NET;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_net.bsc - - - true - true - Console - ..\..\lib\vc_dll\wxbase28_net_vc_custom.dll - ..\..\lib\vc_dll\wxbase28_net.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxzlib.lib;wxregex.lib;wxexpat.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxbase28.lib;%(AdditionalDependencies) - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_dll\mswuniv;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;__WXUNIVERSAL__;NDEBUG;WXBUILDING;wxUSE_GUI=0;WXUSINGDLL;WXMAKINGDLL_NET;%(PreprocessorDefinitions) - .\vc_mswunivdll\net\ - vc_mswunivdll\wxprec_netdll.pch - Use - wx/wxprec.h - .\vc_mswunivdll\net\ - ..\..\lib\vc_dll\wxbase28_net_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;__WXUNIVERSAL__;NDEBUG;WXBUILDING;wxUSE_GUI=0;WXUSINGDLL;WXMAKINGDLL_NET;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_net.tlb - true - Win32 - - - 0x0409 - ..\..\lib\vc_dll\mswuniv;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - __WXMSW__;__WXUNIVERSAL__;NDEBUG;WXBUILDING;WXDLLNAME=wxbase28_net_vc_custom;wxUSE_GUI=0;WXUSINGDLL;WXMAKINGDLL_NET;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_net.bsc - - - true - true - Console - ..\..\lib\vc_dll\wxbase28_net_vc_custom.dll - ..\..\lib\vc_dll\wxbase28_net.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxzlib.lib;wxregex.lib;wxexpat.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxbase28.lib;%(AdditionalDependencies) - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_dll\mswuniv;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;__WXUNIVERSAL__;NDEBUG;WXBUILDING;wxUSE_GUI=0;WXUSINGDLL;WXMAKINGDLL_NET;%(PreprocessorDefinitions) - .\vc_mswunivdll\net\ - vc_mswunivdll\wxprec_netdll.pch - Use - wx/wxprec.h - .\vc_mswunivdll\net\ - ..\..\lib\vc_dll\wxbase28_net_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;__WXUNIVERSAL__;NDEBUG;WXBUILDING;wxUSE_GUI=0;WXUSINGDLL;WXMAKINGDLL_NET;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_net.tlb - true - - - 0x0409 - ..\..\lib\vc_dll\mswuniv;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - __WXMSW__;__WXUNIVERSAL__;NDEBUG;WXBUILDING;WXDLLNAME=wxbase28_net_vc_custom;wxUSE_GUI=0;WXUSINGDLL;WXMAKINGDLL_NET;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_net.bsc - - - true - true - Console - ..\..\lib\vc_dll\wxbase28_net_vc_custom.dll - ..\..\lib\vc_dll\wxbase28_net.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxzlib.lib;wxregex.lib;wxexpat.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxbase28.lib;%(AdditionalDependencies) - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_dll\mswunivu;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;__WXUNIVERSAL__;NDEBUG;WXBUILDING;wxUSE_GUI=0;WXUSINGDLL;WXMAKINGDLL_NET;%(PreprocessorDefinitions) - .\vc_mswunivudll\net\ - vc_mswunivudll\wxprec_netdll.pch - Use - wx/wxprec.h - .\vc_mswunivudll\net\ - ..\..\lib\vc_dll\wxbase28u_net_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;__WXUNIVERSAL__;NDEBUG;_UNICODE;WXBUILDING;wxUSE_GUI=0;WXUSINGDLL;WXMAKINGDLL_NET;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_net.tlb - true - Win32 - - - 0x0409 - ..\..\lib\vc_dll\mswunivu;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - __WXMSW__;__WXUNIVERSAL__;NDEBUG;_UNICODE;WXBUILDING;WXDLLNAME=wxbase28u_net_vc_custom;wxUSE_GUI=0;WXUSINGDLL;WXMAKINGDLL_NET;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_net.bsc - - - true - true - Console - ..\..\lib\vc_dll\wxbase28u_net_vc_custom.dll - ..\..\lib\vc_dll\wxbase28u_net.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxzlib.lib;wxregexu.lib;wxexpat.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxbase28u.lib;%(AdditionalDependencies) - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_dll\mswunivu;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;__WXUNIVERSAL__;NDEBUG;WXBUILDING;wxUSE_GUI=0;WXUSINGDLL;WXMAKINGDLL_NET;%(PreprocessorDefinitions) - .\vc_mswunivudll\net\ - vc_mswunivudll\wxprec_netdll.pch - Use - wx/wxprec.h - .\vc_mswunivudll\net\ - ..\..\lib\vc_dll\wxbase28u_net_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;__WXUNIVERSAL__;NDEBUG;_UNICODE;WXBUILDING;wxUSE_GUI=0;WXUSINGDLL;WXMAKINGDLL_NET;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_net.tlb - true - - - 0x0409 - ..\..\lib\vc_dll\mswunivu;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - __WXMSW__;__WXUNIVERSAL__;NDEBUG;_UNICODE;WXBUILDING;WXDLLNAME=wxbase28u_net_vc_custom;wxUSE_GUI=0;WXUSINGDLL;WXMAKINGDLL_NET;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_net.bsc - - - true - true - Console - ..\..\lib\vc_dll\wxbase28u_net_vc_custom.dll - ..\..\lib\vc_dll\wxbase28u_net.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxzlib.lib;wxregexu.lib;wxexpat.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxbase28u.lib;%(AdditionalDependencies) - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_lib\mswuniv;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;__WXMSW__;__WXUNIVERSAL__;NDEBUG;WXBUILDING;wxUSE_GUI=0;%(PreprocessorDefinitions) - .\vc_mswuniv\net\ - vc_mswuniv\wxprec_netlib.pch - Use - wx/wxprec.h - .\vc_mswuniv\net\ - ..\..\lib\vc_lib\wxbase28_net.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_net.bsc - - - true - ..\..\lib\vc_lib\wxbase28_net.lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_lib\mswuniv;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;__WXMSW__;__WXUNIVERSAL__;NDEBUG;WXBUILDING;wxUSE_GUI=0;%(PreprocessorDefinitions) - .\vc_mswuniv\net\ - vc_mswuniv\wxprec_netlib.pch - Use - wx/wxprec.h - .\vc_mswuniv\net\ - ..\..\lib\vc_lib\wxbase28_net.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_net.bsc - - - true - ..\..\lib\vc_lib\wxbase28_net.lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - true - ..\..\lib\vc_lib\mswunivud;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;WXBUILDING;wxUSE_GUI=0;%(PreprocessorDefinitions) - .\vc_mswunivud\net\ - vc_mswunivud\wxprec_netlib.pch - Use - wx/wxprec.h - .\vc_mswunivud\net\ - ..\..\lib\vc_lib\wxbase28ud_net.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_net.bsc - - - true - ..\..\lib\vc_lib\wxbase28ud_net.lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - ..\..\lib\vc_lib\mswunivud;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;WXBUILDING;wxUSE_GUI=0;%(PreprocessorDefinitions) - .\vc_mswunivud\net\ - vc_mswunivud\wxprec_netlib.pch - Use - wx/wxprec.h - .\vc_mswunivud\net\ - ..\..\lib\vc_lib\wxbase28ud_net.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_net.bsc - - - true - ..\..\lib\vc_lib\wxbase28ud_net.lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - true - ..\..\lib\vc_dll\mswunivd;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;WXBUILDING;wxUSE_GUI=0;WXUSINGDLL;WXMAKINGDLL_NET;%(PreprocessorDefinitions) - .\vc_mswunivddll\net\ - vc_mswunivddll\wxprec_netdll.pch - Use - wx/wxprec.h - .\vc_mswunivddll\net\ - ..\..\lib\vc_dll\wxbase28d_net_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;WXBUILDING;wxUSE_GUI=0;WXUSINGDLL;WXMAKINGDLL_NET;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_net.tlb - true - Win32 - - - 0x0409 - ..\..\lib\vc_dll\mswunivd;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - _DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;WXBUILDING;WXDLLNAME=wxbase28d_net_vc_custom;wxUSE_GUI=0;WXUSINGDLL;WXMAKINGDLL_NET;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_net.bsc - - - true - true - true - Console - ..\..\lib\vc_dll\wxbase28d_net_vc_custom.dll - ..\..\lib\vc_dll\wxbase28d_net.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxzlibd.lib;wxregexd.lib;wxexpatd.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxbase28d.lib;%(AdditionalDependencies) - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - ..\..\lib\vc_dll\mswunivd;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;WXBUILDING;wxUSE_GUI=0;WXUSINGDLL;WXMAKINGDLL_NET;%(PreprocessorDefinitions) - .\vc_mswunivddll\net\ - vc_mswunivddll\wxprec_netdll.pch - Use - wx/wxprec.h - .\vc_mswunivddll\net\ - ..\..\lib\vc_dll\wxbase28d_net_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;WXBUILDING;wxUSE_GUI=0;WXUSINGDLL;WXMAKINGDLL_NET;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_net.tlb - true - - - 0x0409 - ..\..\lib\vc_dll\mswunivd;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - _DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;WXBUILDING;WXDLLNAME=wxbase28d_net_vc_custom;wxUSE_GUI=0;WXUSINGDLL;WXMAKINGDLL_NET;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_net.bsc - - - true - true - true - Console - ..\..\lib\vc_dll\wxbase28d_net_vc_custom.dll - ..\..\lib\vc_dll\wxbase28d_net.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxzlibd.lib;wxregexd.lib;wxexpatd.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxbase28d.lib;%(AdditionalDependencies) - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - true - ..\..\lib\vc_dll\mswunivud;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;WXBUILDING;wxUSE_GUI=0;WXUSINGDLL;WXMAKINGDLL_NET;%(PreprocessorDefinitions) - .\vc_mswunivuddll\net\ - vc_mswunivuddll\wxprec_netdll.pch - Use - wx/wxprec.h - .\vc_mswunivuddll\net\ - ..\..\lib\vc_dll\wxbase28ud_net_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;_UNICODE;WXBUILDING;wxUSE_GUI=0;WXUSINGDLL;WXMAKINGDLL_NET;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_net.tlb - true - Win32 - - - 0x0409 - ..\..\lib\vc_dll\mswunivud;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - _DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;_UNICODE;WXBUILDING;WXDLLNAME=wxbase28ud_net_vc_custom;wxUSE_GUI=0;WXUSINGDLL;WXMAKINGDLL_NET;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_net.bsc - - - true - true - true - Console - ..\..\lib\vc_dll\wxbase28ud_net_vc_custom.dll - ..\..\lib\vc_dll\wxbase28ud_net.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxzlibd.lib;wxregexud.lib;wxexpatd.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxbase28ud.lib;%(AdditionalDependencies) - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - ..\..\lib\vc_dll\mswunivud;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;WXBUILDING;wxUSE_GUI=0;WXUSINGDLL;WXMAKINGDLL_NET;%(PreprocessorDefinitions) - .\vc_mswunivuddll\net\ - vc_mswunivuddll\wxprec_netdll.pch - Use - wx/wxprec.h - .\vc_mswunivuddll\net\ - ..\..\lib\vc_dll\wxbase28ud_net_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;_UNICODE;WXBUILDING;wxUSE_GUI=0;WXUSINGDLL;WXMAKINGDLL_NET;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_net.tlb - true - - - 0x0409 - ..\..\lib\vc_dll\mswunivud;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - _DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;_UNICODE;WXBUILDING;WXDLLNAME=wxbase28ud_net_vc_custom;wxUSE_GUI=0;WXUSINGDLL;WXMAKINGDLL_NET;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_net.bsc - - - true - true - true - Console - ..\..\lib\vc_dll\wxbase28ud_net_vc_custom.dll - ..\..\lib\vc_dll\wxbase28ud_net.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxzlibd.lib;wxregexud.lib;wxexpatd.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxbase28ud.lib;%(AdditionalDependencies) - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - true - ..\..\lib\vc_lib\mswunivd;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;WXBUILDING;wxUSE_GUI=0;%(PreprocessorDefinitions) - .\vc_mswunivd\net\ - vc_mswunivd\wxprec_netlib.pch - Use - wx/wxprec.h - .\vc_mswunivd\net\ - ..\..\lib\vc_lib\wxbase28d_net.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_net.bsc - - - true - ..\..\lib\vc_lib\wxbase28d_net.lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - ..\..\lib\vc_lib\mswunivd;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;WXBUILDING;wxUSE_GUI=0;%(PreprocessorDefinitions) - .\vc_mswunivd\net\ - vc_mswunivd\wxprec_netlib.pch - Use - wx/wxprec.h - .\vc_mswunivd\net\ - ..\..\lib\vc_lib\wxbase28d_net.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_net.bsc - - - true - ..\..\lib\vc_lib\wxbase28d_net.lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - true - ..\..\lib\vc_lib\mswud;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;__WXMSW__;__WXDEBUG__;WXBUILDING;wxUSE_GUI=0;%(PreprocessorDefinitions) - .\vc_mswud\net\ - vc_mswud\wxprec_netlib.pch - Use - wx/wxprec.h - .\vc_mswud\net\ - ..\..\lib\vc_lib\wxbase28ud_net.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_net.bsc - - - true - ..\..\lib\vc_lib\wxbase28ud_net.lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - ..\..\lib\vc_lib\mswud;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;__WXMSW__;__WXDEBUG__;WXBUILDING;wxUSE_GUI=0;%(PreprocessorDefinitions) - .\vc_mswud\net\ - vc_mswud\wxprec_netlib.pch - Use - wx/wxprec.h - .\vc_mswud\net\ - ..\..\lib\vc_lib\wxbase28ud_net.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_net.bsc - - - true - ..\..\lib\vc_lib\wxbase28ud_net.lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_dll\mswu;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;NDEBUG;WXBUILDING;wxUSE_GUI=0;WXUSINGDLL;WXMAKINGDLL_NET;%(PreprocessorDefinitions) - .\vc_mswudll\net\ - vc_mswudll\wxprec_netdll.pch - Use - wx/wxprec.h - .\vc_mswudll\net\ - ..\..\lib\vc_dll\wxbase28u_net_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;NDEBUG;_UNICODE;WXBUILDING;wxUSE_GUI=0;WXUSINGDLL;WXMAKINGDLL_NET;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_net.tlb - true - Win32 - - - 0x0409 - ..\..\lib\vc_dll\mswu;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - __WXMSW__;NDEBUG;_UNICODE;WXBUILDING;WXDLLNAME=wxbase28u_net_vc_custom;wxUSE_GUI=0;WXUSINGDLL;WXMAKINGDLL_NET;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_net.bsc - - - true - true - Console - ..\..\lib\vc_dll\wxbase28u_net_vc_custom.dll - ..\..\lib\vc_dll\wxbase28u_net.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxzlib.lib;wxregexu.lib;wxexpat.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxbase28u.lib;%(AdditionalDependencies) - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_dll\mswu;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;NDEBUG;WXBUILDING;wxUSE_GUI=0;WXUSINGDLL;WXMAKINGDLL_NET;%(PreprocessorDefinitions) - .\vc_mswudll\net\ - vc_mswudll\wxprec_netdll.pch - Use - wx/wxprec.h - .\vc_mswudll\net\ - ..\..\lib\vc_dll\wxbase28u_net_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;NDEBUG;_UNICODE;WXBUILDING;wxUSE_GUI=0;WXUSINGDLL;WXMAKINGDLL_NET;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_net.tlb - true - - - 0x0409 - ..\..\lib\vc_dll\mswu;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - __WXMSW__;NDEBUG;_UNICODE;WXBUILDING;WXDLLNAME=wxbase28u_net_vc_custom;wxUSE_GUI=0;WXUSINGDLL;WXMAKINGDLL_NET;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_net.bsc - - - true - true - Console - ..\..\lib\vc_dll\wxbase28u_net_vc_custom.dll - ..\..\lib\vc_dll\wxbase28u_net.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxzlib.lib;wxregexu.lib;wxexpat.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxbase28u.lib;%(AdditionalDependencies) - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - true - ..\..\lib\vc_lib\mswd;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;__WXMSW__;__WXDEBUG__;WXBUILDING;wxUSE_GUI=0;%(PreprocessorDefinitions) - .\vc_mswd\net\ - vc_mswd\wxprec_netlib.pch - Use - wx/wxprec.h - .\vc_mswd\net\ - ..\..\lib\vc_lib\wxbase28d_net.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_net.bsc - - - true - .\..\..\..\libs\$(Configuration)\$(ProjectName).lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - ..\..\lib\vc_lib\mswd;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;__WXMSW__;__WXDEBUG__;WXBUILDING;wxUSE_GUI=0;%(PreprocessorDefinitions) - .\vc_mswd\net\ - vc_mswd\wxprec_netlib.pch - Use - wx/wxprec.h - .\vc_mswd\net\ - ..\..\lib\vc_lib\wxbase28d_net.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_net.bsc - - - true - .\..\..\..\libs\$(Configuration)\$(ProjectName).lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_lib\mswu;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;__WXMSW__;NDEBUG;WXBUILDING;wxUSE_GUI=0;%(PreprocessorDefinitions) - .\vc_mswu\net\ - vc_mswu\wxprec_netlib.pch - Use - wx/wxprec.h - .\vc_mswu\net\ - ..\..\lib\vc_lib\wxbase28u_net.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_net.bsc - - - true - ..\..\lib\vc_lib\wxbase28u_net.lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_lib\mswu;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;__WXMSW__;NDEBUG;WXBUILDING;wxUSE_GUI=0;%(PreprocessorDefinitions) - .\vc_mswu\net\ - vc_mswu\wxprec_netlib.pch - Use - wx/wxprec.h - .\vc_mswu\net\ - ..\..\lib\vc_lib\wxbase28u_net.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_net.bsc - - - true - ..\..\lib\vc_lib\wxbase28u_net.lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - true - ..\..\lib\vc_dll\mswd;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXDEBUG__;WXBUILDING;wxUSE_GUI=0;WXUSINGDLL;WXMAKINGDLL_NET;%(PreprocessorDefinitions) - .\vc_mswddll\net\ - vc_mswddll\wxprec_netdll.pch - Use - wx/wxprec.h - .\vc_mswddll\net\ - ..\..\lib\vc_dll\wxbase28d_net_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXDEBUG__;WXBUILDING;wxUSE_GUI=0;WXUSINGDLL;WXMAKINGDLL_NET;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_net.tlb - true - Win32 - - - 0x0409 - ..\..\lib\vc_dll\mswd;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - _DEBUG;__WXMSW__;__WXDEBUG__;WXBUILDING;WXDLLNAME=wxbase28d_net_vc_custom;wxUSE_GUI=0;WXUSINGDLL;WXMAKINGDLL_NET;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_net.bsc - - - true - true - true - Console - ..\..\lib\vc_dll\wxbase28d_net_vc_custom.dll - ..\..\lib\vc_dll\wxbase28d_net.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxzlibd.lib;wxregexd.lib;wxexpatd.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxbase28d.lib;%(AdditionalDependencies) - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - ..\..\lib\vc_dll\mswd;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXDEBUG__;WXBUILDING;wxUSE_GUI=0;WXUSINGDLL;WXMAKINGDLL_NET;%(PreprocessorDefinitions) - .\vc_mswddll\net\ - vc_mswddll\wxprec_netdll.pch - Use - wx/wxprec.h - .\vc_mswddll\net\ - ..\..\lib\vc_dll\wxbase28d_net_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXDEBUG__;WXBUILDING;wxUSE_GUI=0;WXUSINGDLL;WXMAKINGDLL_NET;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_net.tlb - true - - - 0x0409 - ..\..\lib\vc_dll\mswd;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - _DEBUG;__WXMSW__;__WXDEBUG__;WXBUILDING;WXDLLNAME=wxbase28d_net_vc_custom;wxUSE_GUI=0;WXUSINGDLL;WXMAKINGDLL_NET;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_net.bsc - - - true - true - true - Console - ..\..\lib\vc_dll\wxbase28d_net_vc_custom.dll - ..\..\lib\vc_dll\wxbase28d_net.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxzlibd.lib;wxregexd.lib;wxexpatd.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxbase28d.lib;%(AdditionalDependencies) - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - true - ..\..\lib\vc_dll\mswud;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXDEBUG__;WXBUILDING;wxUSE_GUI=0;WXUSINGDLL;WXMAKINGDLL_NET;%(PreprocessorDefinitions) - .\vc_mswuddll\net\ - vc_mswuddll\wxprec_netdll.pch - Use - wx/wxprec.h - .\vc_mswuddll\net\ - ..\..\lib\vc_dll\wxbase28ud_net_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXDEBUG__;_UNICODE;WXBUILDING;wxUSE_GUI=0;WXUSINGDLL;WXMAKINGDLL_NET;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_net.tlb - true - Win32 - - - 0x0409 - ..\..\lib\vc_dll\mswud;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - _DEBUG;__WXMSW__;__WXDEBUG__;_UNICODE;WXBUILDING;WXDLLNAME=wxbase28ud_net_vc_custom;wxUSE_GUI=0;WXUSINGDLL;WXMAKINGDLL_NET;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_net.bsc - - - true - true - true - Console - ..\..\lib\vc_dll\wxbase28ud_net_vc_custom.dll - ..\..\lib\vc_dll\wxbase28ud_net.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxzlibd.lib;wxregexud.lib;wxexpatd.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxbase28ud.lib;%(AdditionalDependencies) - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - ..\..\lib\vc_dll\mswud;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXDEBUG__;WXBUILDING;wxUSE_GUI=0;WXUSINGDLL;WXMAKINGDLL_NET;%(PreprocessorDefinitions) - .\vc_mswuddll\net\ - vc_mswuddll\wxprec_netdll.pch - Use - wx/wxprec.h - .\vc_mswuddll\net\ - ..\..\lib\vc_dll\wxbase28ud_net_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXDEBUG__;_UNICODE;WXBUILDING;wxUSE_GUI=0;WXUSINGDLL;WXMAKINGDLL_NET;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_net.tlb - true - - - 0x0409 - ..\..\lib\vc_dll\mswud;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - _DEBUG;__WXMSW__;__WXDEBUG__;_UNICODE;WXBUILDING;WXDLLNAME=wxbase28ud_net_vc_custom;wxUSE_GUI=0;WXUSINGDLL;WXMAKINGDLL_NET;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_net.bsc - - - true - true - true - Console - ..\..\lib\vc_dll\wxbase28ud_net_vc_custom.dll - ..\..\lib\vc_dll\wxbase28ud_net.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxzlibd.lib;wxregexud.lib;wxexpatd.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxbase28ud.lib;%(AdditionalDependencies) - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_lib\mswunivu;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;__WXMSW__;__WXUNIVERSAL__;NDEBUG;WXBUILDING;wxUSE_GUI=0;%(PreprocessorDefinitions) - .\vc_mswunivu\net\ - vc_mswunivu\wxprec_netlib.pch - Use - wx/wxprec.h - .\vc_mswunivu\net\ - ..\..\lib\vc_lib\wxbase28u_net.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_net.bsc - - - true - ..\..\lib\vc_lib\wxbase28u_net.lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_lib\mswunivu;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;__WXMSW__;__WXUNIVERSAL__;NDEBUG;WXBUILDING;wxUSE_GUI=0;%(PreprocessorDefinitions) - .\vc_mswunivu\net\ - vc_mswunivu\wxprec_netlib.pch - Use - wx/wxprec.h - .\vc_mswunivu\net\ - ..\..\lib\vc_lib\wxbase28u_net.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_net.bsc - - - true - ..\..\lib\vc_lib\wxbase28u_net.lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_lib\msw;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;__WXMSW__;NDEBUG;WXBUILDING;wxUSE_GUI=0;%(PreprocessorDefinitions) - .\vc_msw\net\ - vc_msw\wxprec_netlib.pch - Use - wx/wxprec.h - .\vc_msw\net\ - ..\..\lib\vc_lib\wxbase28_net.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_net.bsc - - - true - .\..\..\..\libs\$(Configuration)\$(ProjectName).lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_lib\msw;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;__WXMSW__;NDEBUG;WXBUILDING;wxUSE_GUI=0;%(PreprocessorDefinitions) - .\vc_msw\net\ - vc_msw\wxprec_netlib.pch - Use - wx/wxprec.h - .\vc_msw\net\ - ..\..\lib\vc_lib\wxbase28_net.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_net.bsc - - - true - .\..\..\..\libs\$(Configuration)\$(ProjectName).lib - - - - - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - - - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - true - true - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - true - true - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - true - true - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - true - true - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - true - true - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - true - true - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - true - true - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - true - true - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - - - - - copy "%(FullPath)" ..\..\lib\vc_dll\msw\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_dll\msw\wx\setup.h - Creating ..\..\lib\vc_dll\msw\wx\setup.h - Creating ..\..\lib\vc_dll\msw\wx\setup.h - ..\..\lib\vc_dll\msw\wx\setup.h;%(Outputs) - ..\..\lib\vc_dll\msw\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_lib\mswud\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_lib\mswud\wx\setup.h - Creating ..\..\lib\vc_lib\mswud\wx\setup.h - Creating ..\..\lib\vc_lib\mswud\wx\setup.h - ..\..\lib\vc_lib\mswud\wx\setup.h;%(Outputs) - ..\..\lib\vc_lib\mswud\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_dll\mswu\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_dll\mswu\wx\setup.h - Creating ..\..\lib\vc_dll\mswu\wx\setup.h - Creating ..\..\lib\vc_dll\mswu\wx\setup.h - ..\..\lib\vc_dll\mswu\wx\setup.h;%(Outputs) - ..\..\lib\vc_dll\mswu\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_lib\mswd\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_lib\mswd\wx\setup.h - Creating ..\..\lib\vc_lib\mswd\wx\setup.h - Creating ..\..\lib\vc_lib\mswd\wx\setup.h - ..\..\lib\vc_lib\mswd\wx\setup.h;%(Outputs) - ..\..\lib\vc_lib\mswd\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_lib\mswu\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_lib\mswu\wx\setup.h - Creating ..\..\lib\vc_lib\mswu\wx\setup.h - Creating ..\..\lib\vc_lib\mswu\wx\setup.h - ..\..\lib\vc_lib\mswu\wx\setup.h;%(Outputs) - ..\..\lib\vc_lib\mswu\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_dll\mswd\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_dll\mswd\wx\setup.h - Creating ..\..\lib\vc_dll\mswd\wx\setup.h - Creating ..\..\lib\vc_dll\mswd\wx\setup.h - ..\..\lib\vc_dll\mswd\wx\setup.h;%(Outputs) - ..\..\lib\vc_dll\mswd\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_dll\mswud\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_dll\mswud\wx\setup.h - Creating ..\..\lib\vc_dll\mswud\wx\setup.h - Creating ..\..\lib\vc_dll\mswud\wx\setup.h - ..\..\lib\vc_dll\mswud\wx\setup.h;%(Outputs) - ..\..\lib\vc_dll\mswud\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_lib\msw\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_lib\msw\wx\setup.h - Creating ..\..\lib\vc_lib\msw\wx\setup.h - Creating ..\..\lib\vc_lib\msw\wx\setup.h - ..\..\lib\vc_lib\msw\wx\setup.h;%(Outputs) - ..\..\lib\vc_lib\msw\wx\setup.h;%(Outputs) - - - copy "%(FullPath)" ..\..\lib\vc_dll\mswuniv\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_dll\mswuniv\wx\setup.h - Creating ..\..\lib\vc_dll\mswuniv\wx\setup.h - Creating ..\..\lib\vc_dll\mswuniv\wx\setup.h - ..\..\lib\vc_dll\mswuniv\wx\setup.h;%(Outputs) - ..\..\lib\vc_dll\mswuniv\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_dll\mswunivu\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_dll\mswunivu\wx\setup.h - Creating ..\..\lib\vc_dll\mswunivu\wx\setup.h - Creating ..\..\lib\vc_dll\mswunivu\wx\setup.h - ..\..\lib\vc_dll\mswunivu\wx\setup.h;%(Outputs) - ..\..\lib\vc_dll\mswunivu\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_lib\mswuniv\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_lib\mswuniv\wx\setup.h - Creating ..\..\lib\vc_lib\mswuniv\wx\setup.h - Creating ..\..\lib\vc_lib\mswuniv\wx\setup.h - ..\..\lib\vc_lib\mswuniv\wx\setup.h;%(Outputs) - ..\..\lib\vc_lib\mswuniv\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_lib\mswunivud\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_lib\mswunivud\wx\setup.h - Creating ..\..\lib\vc_lib\mswunivud\wx\setup.h - Creating ..\..\lib\vc_lib\mswunivud\wx\setup.h - ..\..\lib\vc_lib\mswunivud\wx\setup.h;%(Outputs) - ..\..\lib\vc_lib\mswunivud\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_dll\mswunivd\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_dll\mswunivd\wx\setup.h - Creating ..\..\lib\vc_dll\mswunivd\wx\setup.h - Creating ..\..\lib\vc_dll\mswunivd\wx\setup.h - ..\..\lib\vc_dll\mswunivd\wx\setup.h;%(Outputs) - ..\..\lib\vc_dll\mswunivd\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_dll\mswunivud\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_dll\mswunivud\wx\setup.h - Creating ..\..\lib\vc_dll\mswunivud\wx\setup.h - Creating ..\..\lib\vc_dll\mswunivud\wx\setup.h - ..\..\lib\vc_dll\mswunivud\wx\setup.h;%(Outputs) - ..\..\lib\vc_dll\mswunivud\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_lib\mswunivd\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_lib\mswunivd\wx\setup.h - Creating ..\..\lib\vc_lib\mswunivd\wx\setup.h - Creating ..\..\lib\vc_lib\mswunivd\wx\setup.h - ..\..\lib\vc_lib\mswunivd\wx\setup.h;%(Outputs) - ..\..\lib\vc_lib\mswunivd\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_lib\mswunivu\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_lib\mswunivu\wx\setup.h - Creating ..\..\lib\vc_lib\mswunivu\wx\setup.h - Creating ..\..\lib\vc_lib\mswunivu\wx\setup.h - ..\..\lib\vc_lib\mswunivu\wx\setup.h;%(Outputs) - ..\..\lib\vc_lib\mswunivu\wx\setup.h;%(Outputs) - - - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\msw\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\msw\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_dll\msw\wx\msw\rcdefs.h - Creating ..\..\lib\vc_dll\msw\wx\msw\rcdefs.h - ..\..\lib\vc_dll\msw\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_dll\msw\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswuniv\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswuniv\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_dll\mswuniv\wx\msw\rcdefs.h - Creating ..\..\lib\vc_dll\mswuniv\wx\msw\rcdefs.h - ..\..\lib\vc_dll\mswuniv\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_dll\mswuniv\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswunivu\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswunivu\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_dll\mswunivu\wx\msw\rcdefs.h - Creating ..\..\lib\vc_dll\mswunivu\wx\msw\rcdefs.h - ..\..\lib\vc_dll\mswunivu\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_dll\mswunivu\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswuniv\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswuniv\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_lib\mswuniv\wx\msw\rcdefs.h - Creating ..\..\lib\vc_lib\mswuniv\wx\msw\rcdefs.h - ..\..\lib\vc_lib\mswuniv\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_lib\mswuniv\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswunivud\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswunivud\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_lib\mswunivud\wx\msw\rcdefs.h - Creating ..\..\lib\vc_lib\mswunivud\wx\msw\rcdefs.h - ..\..\lib\vc_lib\mswunivud\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_lib\mswunivud\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswunivd\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswunivd\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_dll\mswunivd\wx\msw\rcdefs.h - Creating ..\..\lib\vc_dll\mswunivd\wx\msw\rcdefs.h - ..\..\lib\vc_dll\mswunivd\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_dll\mswunivd\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswunivud\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswunivud\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_dll\mswunivud\wx\msw\rcdefs.h - Creating ..\..\lib\vc_dll\mswunivud\wx\msw\rcdefs.h - ..\..\lib\vc_dll\mswunivud\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_dll\mswunivud\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswunivd\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswunivd\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_lib\mswunivd\wx\msw\rcdefs.h - Creating ..\..\lib\vc_lib\mswunivd\wx\msw\rcdefs.h - ..\..\lib\vc_lib\mswunivd\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_lib\mswunivd\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswud\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswud\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_lib\mswud\wx\msw\rcdefs.h - Creating ..\..\lib\vc_lib\mswud\wx\msw\rcdefs.h - ..\..\lib\vc_lib\mswud\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_lib\mswud\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswu\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswu\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_dll\mswu\wx\msw\rcdefs.h - Creating ..\..\lib\vc_dll\mswu\wx\msw\rcdefs.h - ..\..\lib\vc_dll\mswu\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_dll\mswu\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswd\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswd\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_lib\mswd\wx\msw\rcdefs.h - Creating ..\..\lib\vc_lib\mswd\wx\msw\rcdefs.h - ..\..\lib\vc_lib\mswd\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_lib\mswd\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswu\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswu\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_lib\mswu\wx\msw\rcdefs.h - Creating ..\..\lib\vc_lib\mswu\wx\msw\rcdefs.h - ..\..\lib\vc_lib\mswu\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_lib\mswu\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswd\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswd\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_dll\mswd\wx\msw\rcdefs.h - Creating ..\..\lib\vc_dll\mswd\wx\msw\rcdefs.h - ..\..\lib\vc_dll\mswd\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_dll\mswd\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswud\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswud\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_dll\mswud\wx\msw\rcdefs.h - Creating ..\..\lib\vc_dll\mswud\wx\msw\rcdefs.h - ..\..\lib\vc_dll\mswud\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_dll\mswud\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswunivu\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswunivu\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_lib\mswunivu\wx\msw\rcdefs.h - Creating ..\..\lib\vc_lib\mswunivu\wx\msw\rcdefs.h - ..\..\lib\vc_lib\mswunivu\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_lib\mswunivu\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\msw\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\msw\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_lib\msw\wx\msw\rcdefs.h - Creating ..\..\lib\vc_lib\msw\wx\msw\rcdefs.h - ..\..\lib\vc_lib\msw\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_lib\msw\wx\msw\rcdefs.h;%(Outputs) - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/wxWidgets/build/msw/wx_net.vcxproj.filters b/wxWidgets/build/msw/wx_net.vcxproj.filters deleted file mode 100644 index e895da5f6a..0000000000 --- a/wxWidgets/build/msw/wx_net.vcxproj.filters +++ /dev/null @@ -1,115 +0,0 @@ - - - - - {a018d9f6-58dd-43ad-8c60-5a21cb33d2bd} - - - {592c9611-2fda-455f-b115-485cbd371768} - - - {4475d662-e64b-4d5d-870e-d6d9b935cecf} - - - {07172645-b7bf-4be1-8667-4aa212e23dbf} - - - {7e2602bf-0f5d-4b8c-88f2-2f2486d2214e} - - - - - Common Sources - - - Common Sources - - - Common Sources - - - Common Sources - - - Common Sources - - - Common Sources - - - Common Sources - - - Common Sources - - - Common Sources - - - Common Sources - - - Common Sources - - - MSW Sources - - - MSW Sources - - - - - MSW Sources - - - - - MSW Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - - - Setup Headers - - - Setup Headers - - - MSW Headers - - - \ No newline at end of file diff --git a/wxWidgets/build/msw/wx_odbc.vcxproj b/wxWidgets/build/msw/wx_odbc.vcxproj deleted file mode 100644 index 128504f7da..0000000000 --- a/wxWidgets/build/msw/wx_odbc.vcxproj +++ /dev/null @@ -1,2280 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - DLL Debug - Win32 - - - DLL Debug - x64 - - - DLL Release - Win32 - - - DLL Release - x64 - - - DLL Unicode Debug - Win32 - - - DLL Unicode Debug - x64 - - - DLL Unicode Release - Win32 - - - DLL Unicode Release - x64 - - - DLL Universal Debug - Win32 - - - DLL Universal Debug - x64 - - - DLL Universal Release - Win32 - - - DLL Universal Release - x64 - - - DLL Universal Unicode Debug - Win32 - - - DLL Universal Unicode Debug - x64 - - - DLL Universal Unicode Release - Win32 - - - DLL Universal Unicode Release - x64 - - - Release - Win32 - - - Release - x64 - - - Template - Win32 - - - Template - x64 - - - Unicode Debug - Win32 - - - Unicode Debug - x64 - - - Unicode Release - Win32 - - - Unicode Release - x64 - - - Universal Debug - Win32 - - - Universal Debug - x64 - - - Universal Release - Win32 - - - Universal Release - x64 - - - Universal Unicode Debug - Win32 - - - Universal Unicode Debug - x64 - - - Universal Unicode Release - Win32 - - - Universal Unicode Release - x64 - - - - odbc - - - {C051C502-820F-2983-EF97-144C0CD92905} - - - - Application - v110 - - - Application - v110 - - - DynamicLibrary - false - v110 - - - DynamicLibrary - false - v110 - - - StaticLibrary - false - Unicode - v110 - - - StaticLibrary - false - Unicode - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - DynamicLibrary - false - v110 - - - DynamicLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - DynamicLibrary - false - Unicode - v110 - - - DynamicLibrary - false - Unicode - v110 - - - DynamicLibrary - false - Unicode - v110 - - - DynamicLibrary - false - Unicode - v110 - - - DynamicLibrary - false - v110 - - - DynamicLibrary - false - v110 - - - DynamicLibrary - false - Unicode - v110 - - - DynamicLibrary - false - Unicode - v110 - - - StaticLibrary - false - Unicode - v110 - - - StaticLibrary - false - Unicode - v110 - - - StaticLibrary - false - Unicode - v110 - - - StaticLibrary - false - Unicode - v110 - - - StaticLibrary - false - Unicode - v110 - - - StaticLibrary - false - Unicode - v110 - - - DynamicLibrary - false - Unicode - v110 - - - DynamicLibrary - false - Unicode - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - DynamicLibrary - false - v110 - - - DynamicLibrary - false - v110 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - .\..\..\lib\vc_dll\ - .\vc_mswunivdll\odbc\ - false - - - .\..\..\lib\vc_dll\ - .\vc_mswunivdll\odbc\ - false - - - .\..\..\lib\vc_lib\ - .\vc_mswd\odbc\ - - - .\..\..\lib\vc_lib\ - .\vc_mswd\odbc\ - - - .\..\..\lib\vc_lib\ - .\vc_mswunivd\odbc\ - - - .\..\..\lib\vc_lib\ - .\vc_mswunivd\odbc\ - - - .\..\..\lib\vc_dll\ - .\vc_mswunivudll\odbc\ - false - - - .\..\..\lib\vc_dll\ - .\vc_mswunivudll\odbc\ - false - - - .\..\..\lib\vc_lib\ - .\vc_mswunivu\odbc\ - - - .\..\..\lib\vc_lib\ - .\vc_mswunivu\odbc\ - - - .\..\..\lib\vc_lib\ - .\vc_mswunivud\odbc\ - - - .\..\..\lib\vc_lib\ - .\vc_mswunivud\odbc\ - - - .\..\..\lib\vc_lib\ - .\vc_mswu\odbc\ - - - .\..\..\lib\vc_lib\ - .\vc_mswu\odbc\ - - - .\..\..\lib\vc_dll\ - .\vc_mswunivuddll\odbc\ - true - - - .\..\..\lib\vc_dll\ - .\vc_mswunivuddll\odbc\ - true - - - .\..\..\lib\vc_dll\ - .\vc_mswdll\odbc\ - false - - - .\..\..\lib\vc_dll\ - .\vc_mswdll\odbc\ - false - - - .\..\..\lib\vc_dll\ - .\vc_mswudll\odbc\ - false - - - .\..\..\lib\vc_dll\ - .\vc_mswudll\odbc\ - false - - - .\..\..\lib\vc_dll\ - .\vc_mswuddll\odbc\ - true - - - .\..\..\lib\vc_dll\ - .\vc_mswuddll\odbc\ - true - - - .\..\..\lib\vc_lib\ - .\vc_msw\odbc\ - - - .\..\..\lib\vc_lib\ - .\vc_msw\odbc\ - - - .\..\..\lib\vc_dll\ - .\vc_mswddll\odbc\ - true - - - .\..\..\lib\vc_dll\ - .\vc_mswddll\odbc\ - true - - - .\..\..\lib\vc_lib\ - .\vc_mswuniv\odbc\ - - - .\..\..\lib\vc_lib\ - .\vc_mswuniv\odbc\ - - - .\..\..\lib\vc_lib\ - .\vc_mswud\odbc\ - - - .\..\..\lib\vc_lib\ - .\vc_mswud\odbc\ - - - .\..\..\lib\vc_dll\ - .\vc_mswunivddll\odbc\ - true - - - .\..\..\lib\vc_dll\ - .\vc_mswunivddll\odbc\ - true - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_dll\mswuniv;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;__WXUNIVERSAL__;NDEBUG;WXBUILDING;wxUSE_GUI=0;WXUSINGDLL;WXMAKINGDLL_ODBC;%(PreprocessorDefinitions) - .\vc_mswunivdll\odbc\ - vc_mswunivdll\wxprec_odbcdll.pch - Use - wx/wxprec.h - .\vc_mswunivdll\odbc\ - ..\..\lib\vc_dll\wxbase28_odbc_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;__WXUNIVERSAL__;NDEBUG;WXBUILDING;wxUSE_GUI=0;WXUSINGDLL;WXMAKINGDLL_ODBC;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_odbc.tlb - true - Win32 - - - 0x0409 - ..\..\lib\vc_dll\mswuniv;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - __WXMSW__;__WXUNIVERSAL__;NDEBUG;WXBUILDING;WXDLLNAME=wxbase28_odbc_vc_custom;wxUSE_GUI=0;WXUSINGDLL;WXMAKINGDLL_ODBC;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_odbc.bsc - - - true - true - Console - ..\..\lib\vc_dll\wxbase28_odbc_vc_custom.dll - ..\..\lib\vc_dll\wxbase28_odbc.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxzlib.lib;wxregex.lib;wxexpat.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxbase28.lib;%(AdditionalDependencies) - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_dll\mswuniv;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;__WXUNIVERSAL__;NDEBUG;WXBUILDING;wxUSE_GUI=0;WXUSINGDLL;WXMAKINGDLL_ODBC;%(PreprocessorDefinitions) - .\vc_mswunivdll\odbc\ - vc_mswunivdll\wxprec_odbcdll.pch - Use - wx/wxprec.h - .\vc_mswunivdll\odbc\ - ..\..\lib\vc_dll\wxbase28_odbc_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;__WXUNIVERSAL__;NDEBUG;WXBUILDING;wxUSE_GUI=0;WXUSINGDLL;WXMAKINGDLL_ODBC;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_odbc.tlb - true - - - 0x0409 - ..\..\lib\vc_dll\mswuniv;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - __WXMSW__;__WXUNIVERSAL__;NDEBUG;WXBUILDING;WXDLLNAME=wxbase28_odbc_vc_custom;wxUSE_GUI=0;WXUSINGDLL;WXMAKINGDLL_ODBC;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_odbc.bsc - - - true - true - Console - ..\..\lib\vc_dll\wxbase28_odbc_vc_custom.dll - ..\..\lib\vc_dll\wxbase28_odbc.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxzlib.lib;wxregex.lib;wxexpat.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxbase28.lib;%(AdditionalDependencies) - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - true - ..\..\lib\vc_lib\mswd;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;__WXMSW__;__WXDEBUG__;WXBUILDING;wxUSE_GUI=0;%(PreprocessorDefinitions) - .\vc_mswd\odbc\ - vc_mswd\wxprec_odbclib.pch - Use - wx/wxprec.h - .\vc_mswd\odbc\ - ..\..\lib\vc_lib\wxbase28d_odbc.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_odbc.bsc - - - true - .\..\..\..\libs\$(Configuration)\$(ProjectName).lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - ..\..\lib\vc_lib\mswd;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;__WXMSW__;__WXDEBUG__;WXBUILDING;wxUSE_GUI=0;%(PreprocessorDefinitions) - .\vc_mswd\odbc\ - vc_mswd\wxprec_odbclib.pch - Use - wx/wxprec.h - .\vc_mswd\odbc\ - ..\..\lib\vc_lib\wxbase28d_odbc.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_odbc.bsc - - - true - .\..\..\..\libs\$(Configuration)\$(ProjectName).lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - true - ..\..\lib\vc_lib\mswunivd;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;WXBUILDING;wxUSE_GUI=0;%(PreprocessorDefinitions) - .\vc_mswunivd\odbc\ - vc_mswunivd\wxprec_odbclib.pch - Use - wx/wxprec.h - .\vc_mswunivd\odbc\ - ..\..\lib\vc_lib\wxbase28d_odbc.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_odbc.bsc - - - true - ..\..\lib\vc_lib\wxbase28d_odbc.lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - ..\..\lib\vc_lib\mswunivd;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;WXBUILDING;wxUSE_GUI=0;%(PreprocessorDefinitions) - .\vc_mswunivd\odbc\ - vc_mswunivd\wxprec_odbclib.pch - Use - wx/wxprec.h - .\vc_mswunivd\odbc\ - ..\..\lib\vc_lib\wxbase28d_odbc.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_odbc.bsc - - - true - ..\..\lib\vc_lib\wxbase28d_odbc.lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_dll\mswunivu;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;__WXUNIVERSAL__;NDEBUG;WXBUILDING;wxUSE_GUI=0;WXUSINGDLL;WXMAKINGDLL_ODBC;%(PreprocessorDefinitions) - .\vc_mswunivudll\odbc\ - vc_mswunivudll\wxprec_odbcdll.pch - Use - wx/wxprec.h - .\vc_mswunivudll\odbc\ - ..\..\lib\vc_dll\wxbase28u_odbc_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;__WXUNIVERSAL__;NDEBUG;_UNICODE;WXBUILDING;wxUSE_GUI=0;WXUSINGDLL;WXMAKINGDLL_ODBC;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_odbc.tlb - true - Win32 - - - 0x0409 - ..\..\lib\vc_dll\mswunivu;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - __WXMSW__;__WXUNIVERSAL__;NDEBUG;_UNICODE;WXBUILDING;WXDLLNAME=wxbase28u_odbc_vc_custom;wxUSE_GUI=0;WXUSINGDLL;WXMAKINGDLL_ODBC;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_odbc.bsc - - - true - true - Console - ..\..\lib\vc_dll\wxbase28u_odbc_vc_custom.dll - ..\..\lib\vc_dll\wxbase28u_odbc.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxzlib.lib;wxregexu.lib;wxexpat.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxbase28u.lib;%(AdditionalDependencies) - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_dll\mswunivu;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;__WXUNIVERSAL__;NDEBUG;WXBUILDING;wxUSE_GUI=0;WXUSINGDLL;WXMAKINGDLL_ODBC;%(PreprocessorDefinitions) - .\vc_mswunivudll\odbc\ - vc_mswunivudll\wxprec_odbcdll.pch - Use - wx/wxprec.h - .\vc_mswunivudll\odbc\ - ..\..\lib\vc_dll\wxbase28u_odbc_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;__WXUNIVERSAL__;NDEBUG;_UNICODE;WXBUILDING;wxUSE_GUI=0;WXUSINGDLL;WXMAKINGDLL_ODBC;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_odbc.tlb - true - - - 0x0409 - ..\..\lib\vc_dll\mswunivu;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - __WXMSW__;__WXUNIVERSAL__;NDEBUG;_UNICODE;WXBUILDING;WXDLLNAME=wxbase28u_odbc_vc_custom;wxUSE_GUI=0;WXUSINGDLL;WXMAKINGDLL_ODBC;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_odbc.bsc - - - true - true - Console - ..\..\lib\vc_dll\wxbase28u_odbc_vc_custom.dll - ..\..\lib\vc_dll\wxbase28u_odbc.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxzlib.lib;wxregexu.lib;wxexpat.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxbase28u.lib;%(AdditionalDependencies) - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_lib\mswunivu;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;__WXMSW__;__WXUNIVERSAL__;NDEBUG;WXBUILDING;wxUSE_GUI=0;%(PreprocessorDefinitions) - .\vc_mswunivu\odbc\ - vc_mswunivu\wxprec_odbclib.pch - Use - wx/wxprec.h - .\vc_mswunivu\odbc\ - ..\..\lib\vc_lib\wxbase28u_odbc.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_odbc.bsc - - - true - ..\..\lib\vc_lib\wxbase28u_odbc.lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_lib\mswunivu;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;__WXMSW__;__WXUNIVERSAL__;NDEBUG;WXBUILDING;wxUSE_GUI=0;%(PreprocessorDefinitions) - .\vc_mswunivu\odbc\ - vc_mswunivu\wxprec_odbclib.pch - Use - wx/wxprec.h - .\vc_mswunivu\odbc\ - ..\..\lib\vc_lib\wxbase28u_odbc.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_odbc.bsc - - - true - ..\..\lib\vc_lib\wxbase28u_odbc.lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - true - ..\..\lib\vc_lib\mswunivud;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;WXBUILDING;wxUSE_GUI=0;%(PreprocessorDefinitions) - .\vc_mswunivud\odbc\ - vc_mswunivud\wxprec_odbclib.pch - Use - wx/wxprec.h - .\vc_mswunivud\odbc\ - ..\..\lib\vc_lib\wxbase28ud_odbc.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_odbc.bsc - - - true - ..\..\lib\vc_lib\wxbase28ud_odbc.lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - ..\..\lib\vc_lib\mswunivud;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;WXBUILDING;wxUSE_GUI=0;%(PreprocessorDefinitions) - .\vc_mswunivud\odbc\ - vc_mswunivud\wxprec_odbclib.pch - Use - wx/wxprec.h - .\vc_mswunivud\odbc\ - ..\..\lib\vc_lib\wxbase28ud_odbc.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_odbc.bsc - - - true - ..\..\lib\vc_lib\wxbase28ud_odbc.lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_lib\mswu;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;__WXMSW__;NDEBUG;WXBUILDING;wxUSE_GUI=0;%(PreprocessorDefinitions) - .\vc_mswu\odbc\ - vc_mswu\wxprec_odbclib.pch - Use - wx/wxprec.h - .\vc_mswu\odbc\ - ..\..\lib\vc_lib\wxbase28u_odbc.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_odbc.bsc - - - true - ..\..\lib\vc_lib\wxbase28u_odbc.lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_lib\mswu;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;__WXMSW__;NDEBUG;WXBUILDING;wxUSE_GUI=0;%(PreprocessorDefinitions) - .\vc_mswu\odbc\ - vc_mswu\wxprec_odbclib.pch - Use - wx/wxprec.h - .\vc_mswu\odbc\ - ..\..\lib\vc_lib\wxbase28u_odbc.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_odbc.bsc - - - true - ..\..\lib\vc_lib\wxbase28u_odbc.lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - true - ..\..\lib\vc_dll\mswunivud;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;WXBUILDING;wxUSE_GUI=0;WXUSINGDLL;WXMAKINGDLL_ODBC;%(PreprocessorDefinitions) - .\vc_mswunivuddll\odbc\ - vc_mswunivuddll\wxprec_odbcdll.pch - Use - wx/wxprec.h - .\vc_mswunivuddll\odbc\ - ..\..\lib\vc_dll\wxbase28ud_odbc_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;_UNICODE;WXBUILDING;wxUSE_GUI=0;WXUSINGDLL;WXMAKINGDLL_ODBC;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_odbc.tlb - true - Win32 - - - 0x0409 - ..\..\lib\vc_dll\mswunivud;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - _DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;_UNICODE;WXBUILDING;WXDLLNAME=wxbase28ud_odbc_vc_custom;wxUSE_GUI=0;WXUSINGDLL;WXMAKINGDLL_ODBC;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_odbc.bsc - - - true - true - true - Console - ..\..\lib\vc_dll\wxbase28ud_odbc_vc_custom.dll - ..\..\lib\vc_dll\wxbase28ud_odbc.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxzlibd.lib;wxregexud.lib;wxexpatd.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxbase28ud.lib;%(AdditionalDependencies) - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - ..\..\lib\vc_dll\mswunivud;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;WXBUILDING;wxUSE_GUI=0;WXUSINGDLL;WXMAKINGDLL_ODBC;%(PreprocessorDefinitions) - .\vc_mswunivuddll\odbc\ - vc_mswunivuddll\wxprec_odbcdll.pch - Use - wx/wxprec.h - .\vc_mswunivuddll\odbc\ - ..\..\lib\vc_dll\wxbase28ud_odbc_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;_UNICODE;WXBUILDING;wxUSE_GUI=0;WXUSINGDLL;WXMAKINGDLL_ODBC;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_odbc.tlb - true - - - 0x0409 - ..\..\lib\vc_dll\mswunivud;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - _DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;_UNICODE;WXBUILDING;WXDLLNAME=wxbase28ud_odbc_vc_custom;wxUSE_GUI=0;WXUSINGDLL;WXMAKINGDLL_ODBC;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_odbc.bsc - - - true - true - true - Console - ..\..\lib\vc_dll\wxbase28ud_odbc_vc_custom.dll - ..\..\lib\vc_dll\wxbase28ud_odbc.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxzlibd.lib;wxregexud.lib;wxexpatd.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxbase28ud.lib;%(AdditionalDependencies) - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_dll\msw;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;NDEBUG;WXBUILDING;wxUSE_GUI=0;WXUSINGDLL;WXMAKINGDLL_ODBC;%(PreprocessorDefinitions) - .\vc_mswdll\odbc\ - vc_mswdll\wxprec_odbcdll.pch - Use - wx/wxprec.h - .\vc_mswdll\odbc\ - ..\..\lib\vc_dll\wxbase28_odbc_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;NDEBUG;WXBUILDING;wxUSE_GUI=0;WXUSINGDLL;WXMAKINGDLL_ODBC;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_odbc.tlb - true - Win32 - - - 0x0409 - ..\..\lib\vc_dll\msw;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - __WXMSW__;NDEBUG;WXBUILDING;WXDLLNAME=wxbase28_odbc_vc_custom;wxUSE_GUI=0;WXUSINGDLL;WXMAKINGDLL_ODBC;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_odbc.bsc - - - true - true - Console - ..\..\lib\vc_dll\wxbase28_odbc_vc_custom.dll - ..\..\lib\vc_dll\wxbase28_odbc.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxzlib.lib;wxregex.lib;wxexpat.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxbase28.lib;%(AdditionalDependencies) - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_dll\msw;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;NDEBUG;WXBUILDING;wxUSE_GUI=0;WXUSINGDLL;WXMAKINGDLL_ODBC;%(PreprocessorDefinitions) - .\vc_mswdll\odbc\ - vc_mswdll\wxprec_odbcdll.pch - Use - wx/wxprec.h - .\vc_mswdll\odbc\ - ..\..\lib\vc_dll\wxbase28_odbc_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;NDEBUG;WXBUILDING;wxUSE_GUI=0;WXUSINGDLL;WXMAKINGDLL_ODBC;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_odbc.tlb - true - - - 0x0409 - ..\..\lib\vc_dll\msw;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - __WXMSW__;NDEBUG;WXBUILDING;WXDLLNAME=wxbase28_odbc_vc_custom;wxUSE_GUI=0;WXUSINGDLL;WXMAKINGDLL_ODBC;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_odbc.bsc - - - true - true - Console - ..\..\lib\vc_dll\wxbase28_odbc_vc_custom.dll - ..\..\lib\vc_dll\wxbase28_odbc.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxzlib.lib;wxregex.lib;wxexpat.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxbase28.lib;%(AdditionalDependencies) - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_dll\mswu;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;NDEBUG;WXBUILDING;wxUSE_GUI=0;WXUSINGDLL;WXMAKINGDLL_ODBC;%(PreprocessorDefinitions) - .\vc_mswudll\odbc\ - vc_mswudll\wxprec_odbcdll.pch - Use - wx/wxprec.h - .\vc_mswudll\odbc\ - ..\..\lib\vc_dll\wxbase28u_odbc_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;NDEBUG;_UNICODE;WXBUILDING;wxUSE_GUI=0;WXUSINGDLL;WXMAKINGDLL_ODBC;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_odbc.tlb - true - Win32 - - - 0x0409 - ..\..\lib\vc_dll\mswu;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - __WXMSW__;NDEBUG;_UNICODE;WXBUILDING;WXDLLNAME=wxbase28u_odbc_vc_custom;wxUSE_GUI=0;WXUSINGDLL;WXMAKINGDLL_ODBC;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_odbc.bsc - - - true - true - Console - ..\..\lib\vc_dll\wxbase28u_odbc_vc_custom.dll - ..\..\lib\vc_dll\wxbase28u_odbc.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxzlib.lib;wxregexu.lib;wxexpat.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxbase28u.lib;%(AdditionalDependencies) - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_dll\mswu;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;NDEBUG;WXBUILDING;wxUSE_GUI=0;WXUSINGDLL;WXMAKINGDLL_ODBC;%(PreprocessorDefinitions) - .\vc_mswudll\odbc\ - vc_mswudll\wxprec_odbcdll.pch - Use - wx/wxprec.h - .\vc_mswudll\odbc\ - ..\..\lib\vc_dll\wxbase28u_odbc_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;NDEBUG;_UNICODE;WXBUILDING;wxUSE_GUI=0;WXUSINGDLL;WXMAKINGDLL_ODBC;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_odbc.tlb - true - - - 0x0409 - ..\..\lib\vc_dll\mswu;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - __WXMSW__;NDEBUG;_UNICODE;WXBUILDING;WXDLLNAME=wxbase28u_odbc_vc_custom;wxUSE_GUI=0;WXUSINGDLL;WXMAKINGDLL_ODBC;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_odbc.bsc - - - true - true - Console - ..\..\lib\vc_dll\wxbase28u_odbc_vc_custom.dll - ..\..\lib\vc_dll\wxbase28u_odbc.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxzlib.lib;wxregexu.lib;wxexpat.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxbase28u.lib;%(AdditionalDependencies) - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - true - ..\..\lib\vc_dll\mswud;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXDEBUG__;WXBUILDING;wxUSE_GUI=0;WXUSINGDLL;WXMAKINGDLL_ODBC;%(PreprocessorDefinitions) - .\vc_mswuddll\odbc\ - vc_mswuddll\wxprec_odbcdll.pch - Use - wx/wxprec.h - .\vc_mswuddll\odbc\ - ..\..\lib\vc_dll\wxbase28ud_odbc_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXDEBUG__;_UNICODE;WXBUILDING;wxUSE_GUI=0;WXUSINGDLL;WXMAKINGDLL_ODBC;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_odbc.tlb - true - Win32 - - - 0x0409 - ..\..\lib\vc_dll\mswud;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - _DEBUG;__WXMSW__;__WXDEBUG__;_UNICODE;WXBUILDING;WXDLLNAME=wxbase28ud_odbc_vc_custom;wxUSE_GUI=0;WXUSINGDLL;WXMAKINGDLL_ODBC;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_odbc.bsc - - - true - true - true - Console - ..\..\lib\vc_dll\wxbase28ud_odbc_vc_custom.dll - ..\..\lib\vc_dll\wxbase28ud_odbc.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxzlibd.lib;wxregexud.lib;wxexpatd.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxbase28ud.lib;%(AdditionalDependencies) - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - ..\..\lib\vc_dll\mswud;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXDEBUG__;WXBUILDING;wxUSE_GUI=0;WXUSINGDLL;WXMAKINGDLL_ODBC;%(PreprocessorDefinitions) - .\vc_mswuddll\odbc\ - vc_mswuddll\wxprec_odbcdll.pch - Use - wx/wxprec.h - .\vc_mswuddll\odbc\ - ..\..\lib\vc_dll\wxbase28ud_odbc_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXDEBUG__;_UNICODE;WXBUILDING;wxUSE_GUI=0;WXUSINGDLL;WXMAKINGDLL_ODBC;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_odbc.tlb - true - - - 0x0409 - ..\..\lib\vc_dll\mswud;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - _DEBUG;__WXMSW__;__WXDEBUG__;_UNICODE;WXBUILDING;WXDLLNAME=wxbase28ud_odbc_vc_custom;wxUSE_GUI=0;WXUSINGDLL;WXMAKINGDLL_ODBC;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_odbc.bsc - - - true - true - true - Console - ..\..\lib\vc_dll\wxbase28ud_odbc_vc_custom.dll - ..\..\lib\vc_dll\wxbase28ud_odbc.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxzlibd.lib;wxregexud.lib;wxexpatd.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxbase28ud.lib;%(AdditionalDependencies) - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_lib\msw;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;__WXMSW__;NDEBUG;WXBUILDING;wxUSE_GUI=0;%(PreprocessorDefinitions) - .\vc_msw\odbc\ - vc_msw\wxprec_odbclib.pch - Use - wx/wxprec.h - .\vc_msw\odbc\ - ..\..\lib\vc_lib\wxbase28_odbc.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_odbc.bsc - - - true - .\..\..\..\libs\$(Configuration)\$(ProjectName).lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_lib\msw;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;__WXMSW__;NDEBUG;WXBUILDING;wxUSE_GUI=0;%(PreprocessorDefinitions) - .\vc_msw\odbc\ - vc_msw\wxprec_odbclib.pch - Use - wx/wxprec.h - .\vc_msw\odbc\ - ..\..\lib\vc_lib\wxbase28_odbc.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_odbc.bsc - - - true - .\..\..\..\libs\$(Configuration)\$(ProjectName).lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - true - ..\..\lib\vc_dll\mswd;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXDEBUG__;WXBUILDING;wxUSE_GUI=0;WXUSINGDLL;WXMAKINGDLL_ODBC;%(PreprocessorDefinitions) - .\vc_mswddll\odbc\ - vc_mswddll\wxprec_odbcdll.pch - Use - wx/wxprec.h - .\vc_mswddll\odbc\ - ..\..\lib\vc_dll\wxbase28d_odbc_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXDEBUG__;WXBUILDING;wxUSE_GUI=0;WXUSINGDLL;WXMAKINGDLL_ODBC;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_odbc.tlb - true - Win32 - - - 0x0409 - ..\..\lib\vc_dll\mswd;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - _DEBUG;__WXMSW__;__WXDEBUG__;WXBUILDING;WXDLLNAME=wxbase28d_odbc_vc_custom;wxUSE_GUI=0;WXUSINGDLL;WXMAKINGDLL_ODBC;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_odbc.bsc - - - true - true - true - Console - ..\..\lib\vc_dll\wxbase28d_odbc_vc_custom.dll - ..\..\lib\vc_dll\wxbase28d_odbc.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxzlibd.lib;wxregexd.lib;wxexpatd.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxbase28d.lib;%(AdditionalDependencies) - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - ..\..\lib\vc_dll\mswd;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXDEBUG__;WXBUILDING;wxUSE_GUI=0;WXUSINGDLL;WXMAKINGDLL_ODBC;%(PreprocessorDefinitions) - .\vc_mswddll\odbc\ - vc_mswddll\wxprec_odbcdll.pch - Use - wx/wxprec.h - .\vc_mswddll\odbc\ - ..\..\lib\vc_dll\wxbase28d_odbc_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXDEBUG__;WXBUILDING;wxUSE_GUI=0;WXUSINGDLL;WXMAKINGDLL_ODBC;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_odbc.tlb - true - - - 0x0409 - ..\..\lib\vc_dll\mswd;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - _DEBUG;__WXMSW__;__WXDEBUG__;WXBUILDING;WXDLLNAME=wxbase28d_odbc_vc_custom;wxUSE_GUI=0;WXUSINGDLL;WXMAKINGDLL_ODBC;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_odbc.bsc - - - true - true - true - Console - ..\..\lib\vc_dll\wxbase28d_odbc_vc_custom.dll - ..\..\lib\vc_dll\wxbase28d_odbc.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxzlibd.lib;wxregexd.lib;wxexpatd.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxbase28d.lib;%(AdditionalDependencies) - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_lib\mswuniv;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;__WXMSW__;__WXUNIVERSAL__;NDEBUG;WXBUILDING;wxUSE_GUI=0;%(PreprocessorDefinitions) - .\vc_mswuniv\odbc\ - vc_mswuniv\wxprec_odbclib.pch - Use - wx/wxprec.h - .\vc_mswuniv\odbc\ - ..\..\lib\vc_lib\wxbase28_odbc.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_odbc.bsc - - - true - ..\..\lib\vc_lib\wxbase28_odbc.lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_lib\mswuniv;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;__WXMSW__;__WXUNIVERSAL__;NDEBUG;WXBUILDING;wxUSE_GUI=0;%(PreprocessorDefinitions) - .\vc_mswuniv\odbc\ - vc_mswuniv\wxprec_odbclib.pch - Use - wx/wxprec.h - .\vc_mswuniv\odbc\ - ..\..\lib\vc_lib\wxbase28_odbc.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_odbc.bsc - - - true - ..\..\lib\vc_lib\wxbase28_odbc.lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - true - ..\..\lib\vc_lib\mswud;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;__WXMSW__;__WXDEBUG__;WXBUILDING;wxUSE_GUI=0;%(PreprocessorDefinitions) - .\vc_mswud\odbc\ - vc_mswud\wxprec_odbclib.pch - Use - wx/wxprec.h - .\vc_mswud\odbc\ - ..\..\lib\vc_lib\wxbase28ud_odbc.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_odbc.bsc - - - true - ..\..\lib\vc_lib\wxbase28ud_odbc.lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - ..\..\lib\vc_lib\mswud;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;__WXMSW__;__WXDEBUG__;WXBUILDING;wxUSE_GUI=0;%(PreprocessorDefinitions) - .\vc_mswud\odbc\ - vc_mswud\wxprec_odbclib.pch - Use - wx/wxprec.h - .\vc_mswud\odbc\ - ..\..\lib\vc_lib\wxbase28ud_odbc.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_odbc.bsc - - - true - ..\..\lib\vc_lib\wxbase28ud_odbc.lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - true - ..\..\lib\vc_dll\mswunivd;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;WXBUILDING;wxUSE_GUI=0;WXUSINGDLL;WXMAKINGDLL_ODBC;%(PreprocessorDefinitions) - .\vc_mswunivddll\odbc\ - vc_mswunivddll\wxprec_odbcdll.pch - Use - wx/wxprec.h - .\vc_mswunivddll\odbc\ - ..\..\lib\vc_dll\wxbase28d_odbc_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;WXBUILDING;wxUSE_GUI=0;WXUSINGDLL;WXMAKINGDLL_ODBC;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_odbc.tlb - true - Win32 - - - 0x0409 - ..\..\lib\vc_dll\mswunivd;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - _DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;WXBUILDING;WXDLLNAME=wxbase28d_odbc_vc_custom;wxUSE_GUI=0;WXUSINGDLL;WXMAKINGDLL_ODBC;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_odbc.bsc - - - true - true - true - Console - ..\..\lib\vc_dll\wxbase28d_odbc_vc_custom.dll - ..\..\lib\vc_dll\wxbase28d_odbc.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxzlibd.lib;wxregexd.lib;wxexpatd.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxbase28d.lib;%(AdditionalDependencies) - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - ..\..\lib\vc_dll\mswunivd;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;WXBUILDING;wxUSE_GUI=0;WXUSINGDLL;WXMAKINGDLL_ODBC;%(PreprocessorDefinitions) - .\vc_mswunivddll\odbc\ - vc_mswunivddll\wxprec_odbcdll.pch - Use - wx/wxprec.h - .\vc_mswunivddll\odbc\ - ..\..\lib\vc_dll\wxbase28d_odbc_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;WXBUILDING;wxUSE_GUI=0;WXUSINGDLL;WXMAKINGDLL_ODBC;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_odbc.tlb - true - - - 0x0409 - ..\..\lib\vc_dll\mswunivd;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - _DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;WXBUILDING;WXDLLNAME=wxbase28d_odbc_vc_custom;wxUSE_GUI=0;WXUSINGDLL;WXMAKINGDLL_ODBC;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_odbc.bsc - - - true - true - true - Console - ..\..\lib\vc_dll\wxbase28d_odbc_vc_custom.dll - ..\..\lib\vc_dll\wxbase28d_odbc.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxzlibd.lib;wxregexd.lib;wxexpatd.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxbase28d.lib;%(AdditionalDependencies) - - - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - - - - - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - true - true - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - true - true - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - true - true - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - true - true - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - true - true - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - true - true - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - true - true - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - true - true - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - - - - - copy "%(FullPath)" ..\..\lib\vc_lib\mswd\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_lib\mswd\wx\setup.h - Creating ..\..\lib\vc_lib\mswd\wx\setup.h - Creating ..\..\lib\vc_lib\mswd\wx\setup.h - ..\..\lib\vc_lib\mswd\wx\setup.h;%(Outputs) - ..\..\lib\vc_lib\mswd\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_lib\mswu\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_lib\mswu\wx\setup.h - Creating ..\..\lib\vc_lib\mswu\wx\setup.h - Creating ..\..\lib\vc_lib\mswu\wx\setup.h - ..\..\lib\vc_lib\mswu\wx\setup.h;%(Outputs) - ..\..\lib\vc_lib\mswu\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_dll\msw\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_dll\msw\wx\setup.h - Creating ..\..\lib\vc_dll\msw\wx\setup.h - Creating ..\..\lib\vc_dll\msw\wx\setup.h - ..\..\lib\vc_dll\msw\wx\setup.h;%(Outputs) - ..\..\lib\vc_dll\msw\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_dll\mswu\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_dll\mswu\wx\setup.h - Creating ..\..\lib\vc_dll\mswu\wx\setup.h - Creating ..\..\lib\vc_dll\mswu\wx\setup.h - ..\..\lib\vc_dll\mswu\wx\setup.h;%(Outputs) - ..\..\lib\vc_dll\mswu\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_dll\mswud\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_dll\mswud\wx\setup.h - Creating ..\..\lib\vc_dll\mswud\wx\setup.h - Creating ..\..\lib\vc_dll\mswud\wx\setup.h - ..\..\lib\vc_dll\mswud\wx\setup.h;%(Outputs) - ..\..\lib\vc_dll\mswud\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_lib\msw\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_lib\msw\wx\setup.h - Creating ..\..\lib\vc_lib\msw\wx\setup.h - Creating ..\..\lib\vc_lib\msw\wx\setup.h - ..\..\lib\vc_lib\msw\wx\setup.h;%(Outputs) - ..\..\lib\vc_lib\msw\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_dll\mswd\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_dll\mswd\wx\setup.h - Creating ..\..\lib\vc_dll\mswd\wx\setup.h - Creating ..\..\lib\vc_dll\mswd\wx\setup.h - ..\..\lib\vc_dll\mswd\wx\setup.h;%(Outputs) - ..\..\lib\vc_dll\mswd\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_lib\mswud\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_lib\mswud\wx\setup.h - Creating ..\..\lib\vc_lib\mswud\wx\setup.h - Creating ..\..\lib\vc_lib\mswud\wx\setup.h - ..\..\lib\vc_lib\mswud\wx\setup.h;%(Outputs) - ..\..\lib\vc_lib\mswud\wx\setup.h;%(Outputs) - - - copy "%(FullPath)" ..\..\lib\vc_dll\mswuniv\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_dll\mswuniv\wx\setup.h - Creating ..\..\lib\vc_dll\mswuniv\wx\setup.h - Creating ..\..\lib\vc_dll\mswuniv\wx\setup.h - ..\..\lib\vc_dll\mswuniv\wx\setup.h;%(Outputs) - ..\..\lib\vc_dll\mswuniv\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_lib\mswunivd\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_lib\mswunivd\wx\setup.h - Creating ..\..\lib\vc_lib\mswunivd\wx\setup.h - Creating ..\..\lib\vc_lib\mswunivd\wx\setup.h - ..\..\lib\vc_lib\mswunivd\wx\setup.h;%(Outputs) - ..\..\lib\vc_lib\mswunivd\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_dll\mswunivu\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_dll\mswunivu\wx\setup.h - Creating ..\..\lib\vc_dll\mswunivu\wx\setup.h - Creating ..\..\lib\vc_dll\mswunivu\wx\setup.h - ..\..\lib\vc_dll\mswunivu\wx\setup.h;%(Outputs) - ..\..\lib\vc_dll\mswunivu\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_lib\mswunivu\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_lib\mswunivu\wx\setup.h - Creating ..\..\lib\vc_lib\mswunivu\wx\setup.h - Creating ..\..\lib\vc_lib\mswunivu\wx\setup.h - ..\..\lib\vc_lib\mswunivu\wx\setup.h;%(Outputs) - ..\..\lib\vc_lib\mswunivu\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_lib\mswunivud\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_lib\mswunivud\wx\setup.h - Creating ..\..\lib\vc_lib\mswunivud\wx\setup.h - Creating ..\..\lib\vc_lib\mswunivud\wx\setup.h - ..\..\lib\vc_lib\mswunivud\wx\setup.h;%(Outputs) - ..\..\lib\vc_lib\mswunivud\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_dll\mswunivud\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_dll\mswunivud\wx\setup.h - Creating ..\..\lib\vc_dll\mswunivud\wx\setup.h - Creating ..\..\lib\vc_dll\mswunivud\wx\setup.h - ..\..\lib\vc_dll\mswunivud\wx\setup.h;%(Outputs) - ..\..\lib\vc_dll\mswunivud\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_lib\mswuniv\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_lib\mswuniv\wx\setup.h - Creating ..\..\lib\vc_lib\mswuniv\wx\setup.h - Creating ..\..\lib\vc_lib\mswuniv\wx\setup.h - ..\..\lib\vc_lib\mswuniv\wx\setup.h;%(Outputs) - ..\..\lib\vc_lib\mswuniv\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_dll\mswunivd\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_dll\mswunivd\wx\setup.h - Creating ..\..\lib\vc_dll\mswunivd\wx\setup.h - Creating ..\..\lib\vc_dll\mswunivd\wx\setup.h - ..\..\lib\vc_dll\mswunivd\wx\setup.h;%(Outputs) - ..\..\lib\vc_dll\mswunivd\wx\setup.h;%(Outputs) - - - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswuniv\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswuniv\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_dll\mswuniv\wx\msw\rcdefs.h - Creating ..\..\lib\vc_dll\mswuniv\wx\msw\rcdefs.h - ..\..\lib\vc_dll\mswuniv\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_dll\mswuniv\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswd\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswd\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_lib\mswd\wx\msw\rcdefs.h - Creating ..\..\lib\vc_lib\mswd\wx\msw\rcdefs.h - ..\..\lib\vc_lib\mswd\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_lib\mswd\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswunivd\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswunivd\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_lib\mswunivd\wx\msw\rcdefs.h - Creating ..\..\lib\vc_lib\mswunivd\wx\msw\rcdefs.h - ..\..\lib\vc_lib\mswunivd\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_lib\mswunivd\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswunivu\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswunivu\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_dll\mswunivu\wx\msw\rcdefs.h - Creating ..\..\lib\vc_dll\mswunivu\wx\msw\rcdefs.h - ..\..\lib\vc_dll\mswunivu\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_dll\mswunivu\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswunivu\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswunivu\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_lib\mswunivu\wx\msw\rcdefs.h - Creating ..\..\lib\vc_lib\mswunivu\wx\msw\rcdefs.h - ..\..\lib\vc_lib\mswunivu\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_lib\mswunivu\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswunivud\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswunivud\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_lib\mswunivud\wx\msw\rcdefs.h - Creating ..\..\lib\vc_lib\mswunivud\wx\msw\rcdefs.h - ..\..\lib\vc_lib\mswunivud\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_lib\mswunivud\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswu\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswu\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_lib\mswu\wx\msw\rcdefs.h - Creating ..\..\lib\vc_lib\mswu\wx\msw\rcdefs.h - ..\..\lib\vc_lib\mswu\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_lib\mswu\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswunivud\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswunivud\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_dll\mswunivud\wx\msw\rcdefs.h - Creating ..\..\lib\vc_dll\mswunivud\wx\msw\rcdefs.h - ..\..\lib\vc_dll\mswunivud\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_dll\mswunivud\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\msw\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\msw\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_dll\msw\wx\msw\rcdefs.h - Creating ..\..\lib\vc_dll\msw\wx\msw\rcdefs.h - ..\..\lib\vc_dll\msw\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_dll\msw\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswu\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswu\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_dll\mswu\wx\msw\rcdefs.h - Creating ..\..\lib\vc_dll\mswu\wx\msw\rcdefs.h - ..\..\lib\vc_dll\mswu\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_dll\mswu\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswud\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswud\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_dll\mswud\wx\msw\rcdefs.h - Creating ..\..\lib\vc_dll\mswud\wx\msw\rcdefs.h - ..\..\lib\vc_dll\mswud\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_dll\mswud\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\msw\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\msw\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_lib\msw\wx\msw\rcdefs.h - Creating ..\..\lib\vc_lib\msw\wx\msw\rcdefs.h - ..\..\lib\vc_lib\msw\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_lib\msw\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswd\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswd\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_dll\mswd\wx\msw\rcdefs.h - Creating ..\..\lib\vc_dll\mswd\wx\msw\rcdefs.h - ..\..\lib\vc_dll\mswd\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_dll\mswd\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswuniv\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswuniv\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_lib\mswuniv\wx\msw\rcdefs.h - Creating ..\..\lib\vc_lib\mswuniv\wx\msw\rcdefs.h - ..\..\lib\vc_lib\mswuniv\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_lib\mswuniv\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswud\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswud\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_lib\mswud\wx\msw\rcdefs.h - Creating ..\..\lib\vc_lib\mswud\wx\msw\rcdefs.h - ..\..\lib\vc_lib\mswud\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_lib\mswud\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswunivd\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswunivd\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_dll\mswunivd\wx\msw\rcdefs.h - Creating ..\..\lib\vc_dll\mswunivd\wx\msw\rcdefs.h - ..\..\lib\vc_dll\mswunivd\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_dll\mswunivd\wx\msw\rcdefs.h;%(Outputs) - - - - - - - - - \ No newline at end of file diff --git a/wxWidgets/build/msw/wx_odbc.vcxproj.filters b/wxWidgets/build/msw/wx_odbc.vcxproj.filters deleted file mode 100644 index 53180462ad..0000000000 --- a/wxWidgets/build/msw/wx_odbc.vcxproj.filters +++ /dev/null @@ -1,58 +0,0 @@ - - - - - {ea3aa45a-8663-4648-b3fd-9c69935400a8} - - - {e45f891b-ae45-41e7-8ac9-6188e92e2168} - - - {54510d4e-d65b-4028-8c49-7a9ba66dfc27} - - - {b363a02d-7cb9-43a1-84d9-af6a0595d9f2} - - - {2a488be5-c65c-4617-b6e4-244fe85b64fa} - - - - - Common Sources - - - Common Sources - - - Common Sources - - - - - MSW Sources - - - - - Common Headers - - - Common Headers - - - Common Headers - - - - - Setup Headers - - - Setup Headers - - - MSW Headers - - - \ No newline at end of file diff --git a/wxWidgets/build/msw/wx_qa.vcxproj b/wxWidgets/build/msw/wx_qa.vcxproj deleted file mode 100644 index 81d201e4a8..0000000000 --- a/wxWidgets/build/msw/wx_qa.vcxproj +++ /dev/null @@ -1,2278 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - DLL Debug - Win32 - - - DLL Debug - x64 - - - DLL Release - Win32 - - - DLL Release - x64 - - - DLL Unicode Debug - Win32 - - - DLL Unicode Debug - x64 - - - DLL Unicode Release - Win32 - - - DLL Unicode Release - x64 - - - DLL Universal Debug - Win32 - - - DLL Universal Debug - x64 - - - DLL Universal Release - Win32 - - - DLL Universal Release - x64 - - - DLL Universal Unicode Debug - Win32 - - - DLL Universal Unicode Debug - x64 - - - DLL Universal Unicode Release - Win32 - - - DLL Universal Unicode Release - x64 - - - Release - Win32 - - - Release - x64 - - - Template - Win32 - - - Template - x64 - - - Unicode Debug - Win32 - - - Unicode Debug - x64 - - - Unicode Release - Win32 - - - Unicode Release - x64 - - - Universal Debug - Win32 - - - Universal Debug - x64 - - - Universal Release - Win32 - - - Universal Release - x64 - - - Universal Unicode Debug - Win32 - - - Universal Unicode Debug - x64 - - - Universal Unicode Release - Win32 - - - Universal Unicode Release - x64 - - - - qa - - - {22B14659-C5B6-B775-868D-A49198FEAD4A} - - - - Application - v110 - - - Application - v110 - - - DynamicLibrary - false - Unicode - v110 - - - DynamicLibrary - false - Unicode - v110 - - - DynamicLibrary - false - Unicode - v110 - - - DynamicLibrary - false - Unicode - v110 - - - DynamicLibrary - false - Unicode - v110 - - - DynamicLibrary - false - Unicode - v110 - - - DynamicLibrary - false - Unicode - v110 - - - DynamicLibrary - false - Unicode - v110 - - - StaticLibrary - false - Unicode - v110 - - - StaticLibrary - false - Unicode - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - Unicode - v110 - - - StaticLibrary - false - Unicode - v110 - - - StaticLibrary - false - Unicode - v110 - - - StaticLibrary - false - Unicode - v110 - - - DynamicLibrary - false - v110 - - - DynamicLibrary - false - v110 - - - StaticLibrary - false - Unicode - v110 - - - StaticLibrary - false - Unicode - v110 - - - DynamicLibrary - false - v110 - - - DynamicLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - DynamicLibrary - false - v110 - - - DynamicLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - DynamicLibrary - false - v110 - - - DynamicLibrary - false - v110 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - .\..\..\lib\vc_dll\ - .\vc_mswddll\qa\ - true - - - .\..\..\lib\vc_dll\ - .\vc_mswddll\qa\ - true - - - .\..\..\lib\vc_lib\ - .\vc_msw\qa\ - - - .\..\..\lib\vc_lib\ - .\vc_msw\qa\ - - - .\..\..\lib\vc_lib\ - .\vc_mswuniv\qa\ - - - .\..\..\lib\vc_lib\ - .\vc_mswuniv\qa\ - - - .\..\..\lib\vc_dll\ - .\vc_mswunivddll\qa\ - true - - - .\..\..\lib\vc_dll\ - .\vc_mswunivddll\qa\ - true - - - .\..\..\lib\vc_lib\ - .\vc_mswd\qa\ - - - .\..\..\lib\vc_lib\ - .\vc_mswd\qa\ - - - .\..\..\lib\vc_dll\ - .\vc_mswunivdll\qa\ - false - - - .\..\..\lib\vc_dll\ - .\vc_mswunivdll\qa\ - false - - - .\..\..\lib\vc_lib\ - .\vc_mswunivud\qa\ - - - .\..\..\lib\vc_lib\ - .\vc_mswunivud\qa\ - - - .\..\..\lib\vc_dll\ - .\vc_mswdll\qa\ - false - - - .\..\..\lib\vc_dll\ - .\vc_mswdll\qa\ - false - - - .\..\..\lib\vc_lib\ - .\vc_mswud\qa\ - - - .\..\..\lib\vc_lib\ - .\vc_mswud\qa\ - - - .\..\..\lib\vc_lib\ - .\vc_mswunivu\qa\ - - - .\..\..\lib\vc_lib\ - .\vc_mswunivu\qa\ - - - .\..\..\lib\vc_lib\ - .\vc_mswunivd\qa\ - - - .\..\..\lib\vc_lib\ - .\vc_mswunivd\qa\ - - - .\..\..\lib\vc_lib\ - .\vc_mswu\qa\ - - - .\..\..\lib\vc_lib\ - .\vc_mswu\qa\ - - - .\..\..\lib\vc_dll\ - .\vc_mswunivuddll\qa\ - true - - - .\..\..\lib\vc_dll\ - .\vc_mswunivuddll\qa\ - true - - - .\..\..\lib\vc_dll\ - .\vc_mswudll\qa\ - false - - - .\..\..\lib\vc_dll\ - .\vc_mswudll\qa\ - false - - - .\..\..\lib\vc_dll\ - .\vc_mswuddll\qa\ - true - - - .\..\..\lib\vc_dll\ - .\vc_mswuddll\qa\ - true - - - .\..\..\lib\vc_dll\ - .\vc_mswunivudll\qa\ - false - - - .\..\..\lib\vc_dll\ - .\vc_mswunivudll\qa\ - false - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - true - ..\..\lib\vc_dll\mswd;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXDEBUG__;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_QA;%(PreprocessorDefinitions) - .\vc_mswddll\qa\ - vc_mswddll\wxprec_qadll.pch - Use - wx/wxprec.h - .\vc_mswddll\qa\ - ..\..\lib\vc_dll\wxmsw28d_qa_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXDEBUG__;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_QA;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_qa.tlb - true - Win32 - - - 0x0409 - ..\..\lib\vc_dll\mswd;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - _DEBUG;__WXMSW__;__WXDEBUG__;WXBUILDING;WXDLLNAME=wxmsw28d_qa_vc_custom;WXUSINGDLL;WXMAKINGDLL_QA;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_qa.bsc - - - true - true - true - Console - ..\..\lib\vc_dll\wxmsw28d_qa_vc_custom.dll - ..\..\lib\vc_dll\wxmsw28d_qa.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxtiffd.lib;wxjpegd.lib;wxpngd.lib;wxzlibd.lib;wxregexd.lib;wxexpatd.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxmsw28d_core.lib;..\..\lib\vc_dll\wxbase28d.lib;..\..\lib\vc_dll\wxbase28d_xml.lib;%(AdditionalDependencies) - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - ..\..\lib\vc_dll\mswd;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXDEBUG__;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_QA;%(PreprocessorDefinitions) - .\vc_mswddll\qa\ - vc_mswddll\wxprec_qadll.pch - Use - wx/wxprec.h - .\vc_mswddll\qa\ - ..\..\lib\vc_dll\wxmsw28d_qa_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXDEBUG__;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_QA;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_qa.tlb - true - - - 0x0409 - ..\..\lib\vc_dll\mswd;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - _DEBUG;__WXMSW__;__WXDEBUG__;WXBUILDING;WXDLLNAME=wxmsw28d_qa_vc_custom;WXUSINGDLL;WXMAKINGDLL_QA;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_qa.bsc - - - true - true - true - Console - ..\..\lib\vc_dll\wxmsw28d_qa_vc_custom.dll - ..\..\lib\vc_dll\wxmsw28d_qa.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxtiffd.lib;wxjpegd.lib;wxpngd.lib;wxzlibd.lib;wxregexd.lib;wxexpatd.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxmsw28d_core.lib;..\..\lib\vc_dll\wxbase28d.lib;..\..\lib\vc_dll\wxbase28d_xml.lib;%(AdditionalDependencies) - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_lib\msw;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;__WXMSW__;NDEBUG;WXBUILDING;%(PreprocessorDefinitions) - .\vc_msw\qa\ - vc_msw\wxprec_qalib.pch - Use - wx/wxprec.h - .\vc_msw\qa\ - ..\..\lib\vc_lib\wxmsw28_qa.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_qa.bsc - - - true - .\..\..\..\libs\$(Configuration)\$(ProjectName).lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_lib\msw;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;__WXMSW__;NDEBUG;WXBUILDING;%(PreprocessorDefinitions) - .\vc_msw\qa\ - vc_msw\wxprec_qalib.pch - Use - wx/wxprec.h - .\vc_msw\qa\ - ..\..\lib\vc_lib\wxmsw28_qa.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_qa.bsc - - - true - .\..\..\..\libs\$(Configuration)\$(ProjectName).lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_lib\mswuniv;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;__WXMSW__;__WXUNIVERSAL__;NDEBUG;WXBUILDING;%(PreprocessorDefinitions) - .\vc_mswuniv\qa\ - vc_mswuniv\wxprec_qalib.pch - Use - wx/wxprec.h - .\vc_mswuniv\qa\ - ..\..\lib\vc_lib\wxmswuniv28_qa.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_qa.bsc - - - true - ..\..\lib\vc_lib\wxmswuniv28_qa.lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_lib\mswuniv;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;__WXMSW__;__WXUNIVERSAL__;NDEBUG;WXBUILDING;%(PreprocessorDefinitions) - .\vc_mswuniv\qa\ - vc_mswuniv\wxprec_qalib.pch - Use - wx/wxprec.h - .\vc_mswuniv\qa\ - ..\..\lib\vc_lib\wxmswuniv28_qa.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_qa.bsc - - - true - ..\..\lib\vc_lib\wxmswuniv28_qa.lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - true - ..\..\lib\vc_dll\mswunivd;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_QA;%(PreprocessorDefinitions) - .\vc_mswunivddll\qa\ - vc_mswunivddll\wxprec_qadll.pch - Use - wx/wxprec.h - .\vc_mswunivddll\qa\ - ..\..\lib\vc_dll\wxmswuniv28d_qa_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_QA;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_qa.tlb - true - Win32 - - - 0x0409 - ..\..\lib\vc_dll\mswunivd;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - _DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;WXBUILDING;WXDLLNAME=wxmswuniv28d_qa_vc_custom;WXUSINGDLL;WXMAKINGDLL_QA;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_qa.bsc - - - true - true - true - Console - ..\..\lib\vc_dll\wxmswuniv28d_qa_vc_custom.dll - ..\..\lib\vc_dll\wxmswuniv28d_qa.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxtiffd.lib;wxjpegd.lib;wxpngd.lib;wxzlibd.lib;wxregexd.lib;wxexpatd.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxmswuniv28d_core.lib;..\..\lib\vc_dll\wxbase28d.lib;..\..\lib\vc_dll\wxbase28d_xml.lib;%(AdditionalDependencies) - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - ..\..\lib\vc_dll\mswunivd;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_QA;%(PreprocessorDefinitions) - .\vc_mswunivddll\qa\ - vc_mswunivddll\wxprec_qadll.pch - Use - wx/wxprec.h - .\vc_mswunivddll\qa\ - ..\..\lib\vc_dll\wxmswuniv28d_qa_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_QA;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_qa.tlb - true - - - 0x0409 - ..\..\lib\vc_dll\mswunivd;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - _DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;WXBUILDING;WXDLLNAME=wxmswuniv28d_qa_vc_custom;WXUSINGDLL;WXMAKINGDLL_QA;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_qa.bsc - - - true - true - true - Console - ..\..\lib\vc_dll\wxmswuniv28d_qa_vc_custom.dll - ..\..\lib\vc_dll\wxmswuniv28d_qa.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxtiffd.lib;wxjpegd.lib;wxpngd.lib;wxzlibd.lib;wxregexd.lib;wxexpatd.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxmswuniv28d_core.lib;..\..\lib\vc_dll\wxbase28d.lib;..\..\lib\vc_dll\wxbase28d_xml.lib;%(AdditionalDependencies) - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - true - ..\..\lib\vc_lib\mswd;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;__WXMSW__;__WXDEBUG__;WXBUILDING;%(PreprocessorDefinitions) - .\vc_mswd\qa\ - vc_mswd\wxprec_qalib.pch - Use - wx/wxprec.h - .\vc_mswd\qa\ - ..\..\lib\vc_lib\wxmsw28d_qa.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_qa.bsc - - - true - .\..\..\..\libs\$(Configuration)\$(ProjectName).lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - ..\..\lib\vc_lib\mswd;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;__WXMSW__;__WXDEBUG__;WXBUILDING;%(PreprocessorDefinitions) - .\vc_mswd\qa\ - vc_mswd\wxprec_qalib.pch - Use - wx/wxprec.h - .\vc_mswd\qa\ - ..\..\lib\vc_lib\wxmsw28d_qa.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_qa.bsc - - - true - .\..\..\..\libs\$(Configuration)\$(ProjectName).lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_dll\mswuniv;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;__WXUNIVERSAL__;NDEBUG;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_QA;%(PreprocessorDefinitions) - .\vc_mswunivdll\qa\ - vc_mswunivdll\wxprec_qadll.pch - Use - wx/wxprec.h - .\vc_mswunivdll\qa\ - ..\..\lib\vc_dll\wxmswuniv28_qa_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;__WXUNIVERSAL__;NDEBUG;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_QA;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_qa.tlb - true - Win32 - - - 0x0409 - ..\..\lib\vc_dll\mswuniv;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - __WXMSW__;__WXUNIVERSAL__;NDEBUG;WXBUILDING;WXDLLNAME=wxmswuniv28_qa_vc_custom;WXUSINGDLL;WXMAKINGDLL_QA;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_qa.bsc - - - true - true - Console - ..\..\lib\vc_dll\wxmswuniv28_qa_vc_custom.dll - ..\..\lib\vc_dll\wxmswuniv28_qa.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxtiff.lib;wxjpeg.lib;wxpng.lib;wxzlib.lib;wxregex.lib;wxexpat.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxmswuniv28_core.lib;..\..\lib\vc_dll\wxbase28.lib;..\..\lib\vc_dll\wxbase28_xml.lib;%(AdditionalDependencies) - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_dll\mswuniv;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;__WXUNIVERSAL__;NDEBUG;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_QA;%(PreprocessorDefinitions) - .\vc_mswunivdll\qa\ - vc_mswunivdll\wxprec_qadll.pch - Use - wx/wxprec.h - .\vc_mswunivdll\qa\ - ..\..\lib\vc_dll\wxmswuniv28_qa_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;__WXUNIVERSAL__;NDEBUG;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_QA;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_qa.tlb - true - - - 0x0409 - ..\..\lib\vc_dll\mswuniv;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - __WXMSW__;__WXUNIVERSAL__;NDEBUG;WXBUILDING;WXDLLNAME=wxmswuniv28_qa_vc_custom;WXUSINGDLL;WXMAKINGDLL_QA;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_qa.bsc - - - true - true - Console - ..\..\lib\vc_dll\wxmswuniv28_qa_vc_custom.dll - ..\..\lib\vc_dll\wxmswuniv28_qa.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxtiff.lib;wxjpeg.lib;wxpng.lib;wxzlib.lib;wxregex.lib;wxexpat.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxmswuniv28_core.lib;..\..\lib\vc_dll\wxbase28.lib;..\..\lib\vc_dll\wxbase28_xml.lib;%(AdditionalDependencies) - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - true - ..\..\lib\vc_lib\mswunivud;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;WXBUILDING;%(PreprocessorDefinitions) - .\vc_mswunivud\qa\ - vc_mswunivud\wxprec_qalib.pch - Use - wx/wxprec.h - .\vc_mswunivud\qa\ - ..\..\lib\vc_lib\wxmswuniv28ud_qa.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_qa.bsc - - - true - ..\..\lib\vc_lib\wxmswuniv28ud_qa.lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - ..\..\lib\vc_lib\mswunivud;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;WXBUILDING;%(PreprocessorDefinitions) - .\vc_mswunivud\qa\ - vc_mswunivud\wxprec_qalib.pch - Use - wx/wxprec.h - .\vc_mswunivud\qa\ - ..\..\lib\vc_lib\wxmswuniv28ud_qa.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_qa.bsc - - - true - ..\..\lib\vc_lib\wxmswuniv28ud_qa.lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_dll\msw;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;NDEBUG;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_QA;%(PreprocessorDefinitions) - .\vc_mswdll\qa\ - vc_mswdll\wxprec_qadll.pch - Use - wx/wxprec.h - .\vc_mswdll\qa\ - ..\..\lib\vc_dll\wxmsw28_qa_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;NDEBUG;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_QA;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_qa.tlb - true - Win32 - - - 0x0409 - ..\..\lib\vc_dll\msw;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - __WXMSW__;NDEBUG;WXBUILDING;WXDLLNAME=wxmsw28_qa_vc_custom;WXUSINGDLL;WXMAKINGDLL_QA;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_qa.bsc - - - true - true - Console - ..\..\lib\vc_dll\wxmsw28_qa_vc_custom.dll - ..\..\lib\vc_dll\wxmsw28_qa.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxtiff.lib;wxjpeg.lib;wxpng.lib;wxzlib.lib;wxregex.lib;wxexpat.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxmsw28_core.lib;..\..\lib\vc_dll\wxbase28.lib;..\..\lib\vc_dll\wxbase28_xml.lib;%(AdditionalDependencies) - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_dll\msw;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;NDEBUG;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_QA;%(PreprocessorDefinitions) - .\vc_mswdll\qa\ - vc_mswdll\wxprec_qadll.pch - Use - wx/wxprec.h - .\vc_mswdll\qa\ - ..\..\lib\vc_dll\wxmsw28_qa_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;NDEBUG;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_QA;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_qa.tlb - true - - - 0x0409 - ..\..\lib\vc_dll\msw;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - __WXMSW__;NDEBUG;WXBUILDING;WXDLLNAME=wxmsw28_qa_vc_custom;WXUSINGDLL;WXMAKINGDLL_QA;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_qa.bsc - - - true - true - Console - ..\..\lib\vc_dll\wxmsw28_qa_vc_custom.dll - ..\..\lib\vc_dll\wxmsw28_qa.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxtiff.lib;wxjpeg.lib;wxpng.lib;wxzlib.lib;wxregex.lib;wxexpat.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxmsw28_core.lib;..\..\lib\vc_dll\wxbase28.lib;..\..\lib\vc_dll\wxbase28_xml.lib;%(AdditionalDependencies) - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - true - ..\..\lib\vc_lib\mswud;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;__WXMSW__;__WXDEBUG__;WXBUILDING;%(PreprocessorDefinitions) - .\vc_mswud\qa\ - vc_mswud\wxprec_qalib.pch - Use - wx/wxprec.h - .\vc_mswud\qa\ - ..\..\lib\vc_lib\wxmsw28ud_qa.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_qa.bsc - - - true - ..\..\lib\vc_lib\wxmsw28ud_qa.lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - ..\..\lib\vc_lib\mswud;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;__WXMSW__;__WXDEBUG__;WXBUILDING;%(PreprocessorDefinitions) - .\vc_mswud\qa\ - vc_mswud\wxprec_qalib.pch - Use - wx/wxprec.h - .\vc_mswud\qa\ - ..\..\lib\vc_lib\wxmsw28ud_qa.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_qa.bsc - - - true - ..\..\lib\vc_lib\wxmsw28ud_qa.lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_lib\mswunivu;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;__WXMSW__;__WXUNIVERSAL__;NDEBUG;WXBUILDING;%(PreprocessorDefinitions) - .\vc_mswunivu\qa\ - vc_mswunivu\wxprec_qalib.pch - Use - wx/wxprec.h - .\vc_mswunivu\qa\ - ..\..\lib\vc_lib\wxmswuniv28u_qa.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_qa.bsc - - - true - ..\..\lib\vc_lib\wxmswuniv28u_qa.lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_lib\mswunivu;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;__WXMSW__;__WXUNIVERSAL__;NDEBUG;WXBUILDING;%(PreprocessorDefinitions) - .\vc_mswunivu\qa\ - vc_mswunivu\wxprec_qalib.pch - Use - wx/wxprec.h - .\vc_mswunivu\qa\ - ..\..\lib\vc_lib\wxmswuniv28u_qa.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_qa.bsc - - - true - ..\..\lib\vc_lib\wxmswuniv28u_qa.lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - true - ..\..\lib\vc_lib\mswunivd;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;WXBUILDING;%(PreprocessorDefinitions) - .\vc_mswunivd\qa\ - vc_mswunivd\wxprec_qalib.pch - Use - wx/wxprec.h - .\vc_mswunivd\qa\ - ..\..\lib\vc_lib\wxmswuniv28d_qa.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_qa.bsc - - - true - ..\..\lib\vc_lib\wxmswuniv28d_qa.lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - ..\..\lib\vc_lib\mswunivd;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;WXBUILDING;%(PreprocessorDefinitions) - .\vc_mswunivd\qa\ - vc_mswunivd\wxprec_qalib.pch - Use - wx/wxprec.h - .\vc_mswunivd\qa\ - ..\..\lib\vc_lib\wxmswuniv28d_qa.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_qa.bsc - - - true - ..\..\lib\vc_lib\wxmswuniv28d_qa.lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_lib\mswu;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;__WXMSW__;NDEBUG;WXBUILDING;%(PreprocessorDefinitions) - .\vc_mswu\qa\ - vc_mswu\wxprec_qalib.pch - Use - wx/wxprec.h - .\vc_mswu\qa\ - ..\..\lib\vc_lib\wxmsw28u_qa.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_qa.bsc - - - true - ..\..\lib\vc_lib\wxmsw28u_qa.lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_lib\mswu;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;__WXMSW__;NDEBUG;WXBUILDING;%(PreprocessorDefinitions) - .\vc_mswu\qa\ - vc_mswu\wxprec_qalib.pch - Use - wx/wxprec.h - .\vc_mswu\qa\ - ..\..\lib\vc_lib\wxmsw28u_qa.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_qa.bsc - - - true - ..\..\lib\vc_lib\wxmsw28u_qa.lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - true - ..\..\lib\vc_dll\mswunivud;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_QA;%(PreprocessorDefinitions) - .\vc_mswunivuddll\qa\ - vc_mswunivuddll\wxprec_qadll.pch - Use - wx/wxprec.h - .\vc_mswunivuddll\qa\ - ..\..\lib\vc_dll\wxmswuniv28ud_qa_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;_UNICODE;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_QA;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_qa.tlb - true - Win32 - - - 0x0409 - ..\..\lib\vc_dll\mswunivud;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - _DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;_UNICODE;WXBUILDING;WXDLLNAME=wxmswuniv28ud_qa_vc_custom;WXUSINGDLL;WXMAKINGDLL_QA;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_qa.bsc - - - true - true - true - Console - ..\..\lib\vc_dll\wxmswuniv28ud_qa_vc_custom.dll - ..\..\lib\vc_dll\wxmswuniv28ud_qa.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxtiffd.lib;wxjpegd.lib;wxpngd.lib;wxzlibd.lib;wxregexud.lib;wxexpatd.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxmswuniv28ud_core.lib;..\..\lib\vc_dll\wxbase28ud.lib;..\..\lib\vc_dll\wxbase28ud_xml.lib;%(AdditionalDependencies) - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - ..\..\lib\vc_dll\mswunivud;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_QA;%(PreprocessorDefinitions) - .\vc_mswunivuddll\qa\ - vc_mswunivuddll\wxprec_qadll.pch - Use - wx/wxprec.h - .\vc_mswunivuddll\qa\ - ..\..\lib\vc_dll\wxmswuniv28ud_qa_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;_UNICODE;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_QA;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_qa.tlb - true - - - 0x0409 - ..\..\lib\vc_dll\mswunivud;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - _DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;_UNICODE;WXBUILDING;WXDLLNAME=wxmswuniv28ud_qa_vc_custom;WXUSINGDLL;WXMAKINGDLL_QA;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_qa.bsc - - - true - true - true - Console - ..\..\lib\vc_dll\wxmswuniv28ud_qa_vc_custom.dll - ..\..\lib\vc_dll\wxmswuniv28ud_qa.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxtiffd.lib;wxjpegd.lib;wxpngd.lib;wxzlibd.lib;wxregexud.lib;wxexpatd.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxmswuniv28ud_core.lib;..\..\lib\vc_dll\wxbase28ud.lib;..\..\lib\vc_dll\wxbase28ud_xml.lib;%(AdditionalDependencies) - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_dll\mswu;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;NDEBUG;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_QA;%(PreprocessorDefinitions) - .\vc_mswudll\qa\ - vc_mswudll\wxprec_qadll.pch - Use - wx/wxprec.h - .\vc_mswudll\qa\ - ..\..\lib\vc_dll\wxmsw28u_qa_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;NDEBUG;_UNICODE;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_QA;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_qa.tlb - true - Win32 - - - 0x0409 - ..\..\lib\vc_dll\mswu;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - __WXMSW__;NDEBUG;_UNICODE;WXBUILDING;WXDLLNAME=wxmsw28u_qa_vc_custom;WXUSINGDLL;WXMAKINGDLL_QA;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_qa.bsc - - - true - true - Console - ..\..\lib\vc_dll\wxmsw28u_qa_vc_custom.dll - ..\..\lib\vc_dll\wxmsw28u_qa.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxtiff.lib;wxjpeg.lib;wxpng.lib;wxzlib.lib;wxregexu.lib;wxexpat.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxmsw28u_core.lib;..\..\lib\vc_dll\wxbase28u.lib;..\..\lib\vc_dll\wxbase28u_xml.lib;%(AdditionalDependencies) - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_dll\mswu;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;NDEBUG;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_QA;%(PreprocessorDefinitions) - .\vc_mswudll\qa\ - vc_mswudll\wxprec_qadll.pch - Use - wx/wxprec.h - .\vc_mswudll\qa\ - ..\..\lib\vc_dll\wxmsw28u_qa_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;NDEBUG;_UNICODE;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_QA;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_qa.tlb - true - - - 0x0409 - ..\..\lib\vc_dll\mswu;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - __WXMSW__;NDEBUG;_UNICODE;WXBUILDING;WXDLLNAME=wxmsw28u_qa_vc_custom;WXUSINGDLL;WXMAKINGDLL_QA;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_qa.bsc - - - true - true - Console - ..\..\lib\vc_dll\wxmsw28u_qa_vc_custom.dll - ..\..\lib\vc_dll\wxmsw28u_qa.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxtiff.lib;wxjpeg.lib;wxpng.lib;wxzlib.lib;wxregexu.lib;wxexpat.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxmsw28u_core.lib;..\..\lib\vc_dll\wxbase28u.lib;..\..\lib\vc_dll\wxbase28u_xml.lib;%(AdditionalDependencies) - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - true - ..\..\lib\vc_dll\mswud;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXDEBUG__;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_QA;%(PreprocessorDefinitions) - .\vc_mswuddll\qa\ - vc_mswuddll\wxprec_qadll.pch - Use - wx/wxprec.h - .\vc_mswuddll\qa\ - ..\..\lib\vc_dll\wxmsw28ud_qa_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXDEBUG__;_UNICODE;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_QA;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_qa.tlb - true - Win32 - - - 0x0409 - ..\..\lib\vc_dll\mswud;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - _DEBUG;__WXMSW__;__WXDEBUG__;_UNICODE;WXBUILDING;WXDLLNAME=wxmsw28ud_qa_vc_custom;WXUSINGDLL;WXMAKINGDLL_QA;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_qa.bsc - - - true - true - true - Console - ..\..\lib\vc_dll\wxmsw28ud_qa_vc_custom.dll - ..\..\lib\vc_dll\wxmsw28ud_qa.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxtiffd.lib;wxjpegd.lib;wxpngd.lib;wxzlibd.lib;wxregexud.lib;wxexpatd.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxmsw28ud_core.lib;..\..\lib\vc_dll\wxbase28ud.lib;..\..\lib\vc_dll\wxbase28ud_xml.lib;%(AdditionalDependencies) - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - ..\..\lib\vc_dll\mswud;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXDEBUG__;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_QA;%(PreprocessorDefinitions) - .\vc_mswuddll\qa\ - vc_mswuddll\wxprec_qadll.pch - Use - wx/wxprec.h - .\vc_mswuddll\qa\ - ..\..\lib\vc_dll\wxmsw28ud_qa_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXDEBUG__;_UNICODE;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_QA;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_qa.tlb - true - - - 0x0409 - ..\..\lib\vc_dll\mswud;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - _DEBUG;__WXMSW__;__WXDEBUG__;_UNICODE;WXBUILDING;WXDLLNAME=wxmsw28ud_qa_vc_custom;WXUSINGDLL;WXMAKINGDLL_QA;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_qa.bsc - - - true - true - true - Console - ..\..\lib\vc_dll\wxmsw28ud_qa_vc_custom.dll - ..\..\lib\vc_dll\wxmsw28ud_qa.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxtiffd.lib;wxjpegd.lib;wxpngd.lib;wxzlibd.lib;wxregexud.lib;wxexpatd.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxmsw28ud_core.lib;..\..\lib\vc_dll\wxbase28ud.lib;..\..\lib\vc_dll\wxbase28ud_xml.lib;%(AdditionalDependencies) - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_dll\mswunivu;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;__WXUNIVERSAL__;NDEBUG;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_QA;%(PreprocessorDefinitions) - .\vc_mswunivudll\qa\ - vc_mswunivudll\wxprec_qadll.pch - Use - wx/wxprec.h - .\vc_mswunivudll\qa\ - ..\..\lib\vc_dll\wxmswuniv28u_qa_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;__WXUNIVERSAL__;NDEBUG;_UNICODE;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_QA;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_qa.tlb - true - Win32 - - - 0x0409 - ..\..\lib\vc_dll\mswunivu;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - __WXMSW__;__WXUNIVERSAL__;NDEBUG;_UNICODE;WXBUILDING;WXDLLNAME=wxmswuniv28u_qa_vc_custom;WXUSINGDLL;WXMAKINGDLL_QA;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_qa.bsc - - - true - true - Console - ..\..\lib\vc_dll\wxmswuniv28u_qa_vc_custom.dll - ..\..\lib\vc_dll\wxmswuniv28u_qa.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxtiff.lib;wxjpeg.lib;wxpng.lib;wxzlib.lib;wxregexu.lib;wxexpat.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxmswuniv28u_core.lib;..\..\lib\vc_dll\wxbase28u.lib;..\..\lib\vc_dll\wxbase28u_xml.lib;%(AdditionalDependencies) - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_dll\mswunivu;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;__WXUNIVERSAL__;NDEBUG;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_QA;%(PreprocessorDefinitions) - .\vc_mswunivudll\qa\ - vc_mswunivudll\wxprec_qadll.pch - Use - wx/wxprec.h - .\vc_mswunivudll\qa\ - ..\..\lib\vc_dll\wxmswuniv28u_qa_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;__WXUNIVERSAL__;NDEBUG;_UNICODE;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_QA;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_qa.tlb - true - - - 0x0409 - ..\..\lib\vc_dll\mswunivu;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - __WXMSW__;__WXUNIVERSAL__;NDEBUG;_UNICODE;WXBUILDING;WXDLLNAME=wxmswuniv28u_qa_vc_custom;WXUSINGDLL;WXMAKINGDLL_QA;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_qa.bsc - - - true - true - Console - ..\..\lib\vc_dll\wxmswuniv28u_qa_vc_custom.dll - ..\..\lib\vc_dll\wxmswuniv28u_qa.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxtiff.lib;wxjpeg.lib;wxpng.lib;wxzlib.lib;wxregexu.lib;wxexpat.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxmswuniv28u_core.lib;..\..\lib\vc_dll\wxbase28u.lib;..\..\lib\vc_dll\wxbase28u_xml.lib;%(AdditionalDependencies) - - - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - - - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - true - true - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - true - true - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - true - true - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - true - true - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - true - true - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - true - true - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - true - true - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - true - true - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - - - - - copy "%(FullPath)" ..\..\lib\vc_dll\mswd\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_dll\mswd\wx\setup.h - Creating ..\..\lib\vc_dll\mswd\wx\setup.h - Creating ..\..\lib\vc_dll\mswd\wx\setup.h - ..\..\lib\vc_dll\mswd\wx\setup.h;%(Outputs) - ..\..\lib\vc_dll\mswd\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_lib\msw\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_lib\msw\wx\setup.h - Creating ..\..\lib\vc_lib\msw\wx\setup.h - Creating ..\..\lib\vc_lib\msw\wx\setup.h - ..\..\lib\vc_lib\msw\wx\setup.h;%(Outputs) - ..\..\lib\vc_lib\msw\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_lib\mswd\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_lib\mswd\wx\setup.h - Creating ..\..\lib\vc_lib\mswd\wx\setup.h - Creating ..\..\lib\vc_lib\mswd\wx\setup.h - ..\..\lib\vc_lib\mswd\wx\setup.h;%(Outputs) - ..\..\lib\vc_lib\mswd\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_dll\msw\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_dll\msw\wx\setup.h - Creating ..\..\lib\vc_dll\msw\wx\setup.h - Creating ..\..\lib\vc_dll\msw\wx\setup.h - ..\..\lib\vc_dll\msw\wx\setup.h;%(Outputs) - ..\..\lib\vc_dll\msw\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_lib\mswud\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_lib\mswud\wx\setup.h - Creating ..\..\lib\vc_lib\mswud\wx\setup.h - Creating ..\..\lib\vc_lib\mswud\wx\setup.h - ..\..\lib\vc_lib\mswud\wx\setup.h;%(Outputs) - ..\..\lib\vc_lib\mswud\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_lib\mswu\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_lib\mswu\wx\setup.h - Creating ..\..\lib\vc_lib\mswu\wx\setup.h - Creating ..\..\lib\vc_lib\mswu\wx\setup.h - ..\..\lib\vc_lib\mswu\wx\setup.h;%(Outputs) - ..\..\lib\vc_lib\mswu\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_dll\mswu\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_dll\mswu\wx\setup.h - Creating ..\..\lib\vc_dll\mswu\wx\setup.h - Creating ..\..\lib\vc_dll\mswu\wx\setup.h - ..\..\lib\vc_dll\mswu\wx\setup.h;%(Outputs) - ..\..\lib\vc_dll\mswu\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_dll\mswud\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_dll\mswud\wx\setup.h - Creating ..\..\lib\vc_dll\mswud\wx\setup.h - Creating ..\..\lib\vc_dll\mswud\wx\setup.h - ..\..\lib\vc_dll\mswud\wx\setup.h;%(Outputs) - ..\..\lib\vc_dll\mswud\wx\setup.h;%(Outputs) - - - copy "%(FullPath)" ..\..\lib\vc_lib\mswuniv\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_lib\mswuniv\wx\setup.h - Creating ..\..\lib\vc_lib\mswuniv\wx\setup.h - Creating ..\..\lib\vc_lib\mswuniv\wx\setup.h - ..\..\lib\vc_lib\mswuniv\wx\setup.h;%(Outputs) - ..\..\lib\vc_lib\mswuniv\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_dll\mswunivd\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_dll\mswunivd\wx\setup.h - Creating ..\..\lib\vc_dll\mswunivd\wx\setup.h - Creating ..\..\lib\vc_dll\mswunivd\wx\setup.h - ..\..\lib\vc_dll\mswunivd\wx\setup.h;%(Outputs) - ..\..\lib\vc_dll\mswunivd\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_dll\mswuniv\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_dll\mswuniv\wx\setup.h - Creating ..\..\lib\vc_dll\mswuniv\wx\setup.h - Creating ..\..\lib\vc_dll\mswuniv\wx\setup.h - ..\..\lib\vc_dll\mswuniv\wx\setup.h;%(Outputs) - ..\..\lib\vc_dll\mswuniv\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_lib\mswunivud\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_lib\mswunivud\wx\setup.h - Creating ..\..\lib\vc_lib\mswunivud\wx\setup.h - Creating ..\..\lib\vc_lib\mswunivud\wx\setup.h - ..\..\lib\vc_lib\mswunivud\wx\setup.h;%(Outputs) - ..\..\lib\vc_lib\mswunivud\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_lib\mswunivu\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_lib\mswunivu\wx\setup.h - Creating ..\..\lib\vc_lib\mswunivu\wx\setup.h - Creating ..\..\lib\vc_lib\mswunivu\wx\setup.h - ..\..\lib\vc_lib\mswunivu\wx\setup.h;%(Outputs) - ..\..\lib\vc_lib\mswunivu\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_lib\mswunivd\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_lib\mswunivd\wx\setup.h - Creating ..\..\lib\vc_lib\mswunivd\wx\setup.h - Creating ..\..\lib\vc_lib\mswunivd\wx\setup.h - ..\..\lib\vc_lib\mswunivd\wx\setup.h;%(Outputs) - ..\..\lib\vc_lib\mswunivd\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_dll\mswunivud\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_dll\mswunivud\wx\setup.h - Creating ..\..\lib\vc_dll\mswunivud\wx\setup.h - Creating ..\..\lib\vc_dll\mswunivud\wx\setup.h - ..\..\lib\vc_dll\mswunivud\wx\setup.h;%(Outputs) - ..\..\lib\vc_dll\mswunivud\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_dll\mswunivu\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_dll\mswunivu\wx\setup.h - Creating ..\..\lib\vc_dll\mswunivu\wx\setup.h - Creating ..\..\lib\vc_dll\mswunivu\wx\setup.h - ..\..\lib\vc_dll\mswunivu\wx\setup.h;%(Outputs) - ..\..\lib\vc_dll\mswunivu\wx\setup.h;%(Outputs) - - - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswd\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswd\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_dll\mswd\wx\msw\rcdefs.h - Creating ..\..\lib\vc_dll\mswd\wx\msw\rcdefs.h - ..\..\lib\vc_dll\mswd\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_dll\mswd\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\msw\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\msw\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_lib\msw\wx\msw\rcdefs.h - Creating ..\..\lib\vc_lib\msw\wx\msw\rcdefs.h - ..\..\lib\vc_lib\msw\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_lib\msw\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswuniv\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswuniv\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_lib\mswuniv\wx\msw\rcdefs.h - Creating ..\..\lib\vc_lib\mswuniv\wx\msw\rcdefs.h - ..\..\lib\vc_lib\mswuniv\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_lib\mswuniv\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswunivd\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswunivd\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_dll\mswunivd\wx\msw\rcdefs.h - Creating ..\..\lib\vc_dll\mswunivd\wx\msw\rcdefs.h - ..\..\lib\vc_dll\mswunivd\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_dll\mswunivd\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswd\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswd\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_lib\mswd\wx\msw\rcdefs.h - Creating ..\..\lib\vc_lib\mswd\wx\msw\rcdefs.h - ..\..\lib\vc_lib\mswd\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_lib\mswd\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswuniv\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswuniv\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_dll\mswuniv\wx\msw\rcdefs.h - Creating ..\..\lib\vc_dll\mswuniv\wx\msw\rcdefs.h - ..\..\lib\vc_dll\mswuniv\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_dll\mswuniv\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswunivud\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswunivud\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_lib\mswunivud\wx\msw\rcdefs.h - Creating ..\..\lib\vc_lib\mswunivud\wx\msw\rcdefs.h - ..\..\lib\vc_lib\mswunivud\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_lib\mswunivud\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\msw\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\msw\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_dll\msw\wx\msw\rcdefs.h - Creating ..\..\lib\vc_dll\msw\wx\msw\rcdefs.h - ..\..\lib\vc_dll\msw\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_dll\msw\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswud\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswud\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_lib\mswud\wx\msw\rcdefs.h - Creating ..\..\lib\vc_lib\mswud\wx\msw\rcdefs.h - ..\..\lib\vc_lib\mswud\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_lib\mswud\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswunivu\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswunivu\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_lib\mswunivu\wx\msw\rcdefs.h - Creating ..\..\lib\vc_lib\mswunivu\wx\msw\rcdefs.h - ..\..\lib\vc_lib\mswunivu\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_lib\mswunivu\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswunivd\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswunivd\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_lib\mswunivd\wx\msw\rcdefs.h - Creating ..\..\lib\vc_lib\mswunivd\wx\msw\rcdefs.h - ..\..\lib\vc_lib\mswunivd\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_lib\mswunivd\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswu\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswu\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_lib\mswu\wx\msw\rcdefs.h - Creating ..\..\lib\vc_lib\mswu\wx\msw\rcdefs.h - ..\..\lib\vc_lib\mswu\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_lib\mswu\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswunivud\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswunivud\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_dll\mswunivud\wx\msw\rcdefs.h - Creating ..\..\lib\vc_dll\mswunivud\wx\msw\rcdefs.h - ..\..\lib\vc_dll\mswunivud\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_dll\mswunivud\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswu\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswu\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_dll\mswu\wx\msw\rcdefs.h - Creating ..\..\lib\vc_dll\mswu\wx\msw\rcdefs.h - ..\..\lib\vc_dll\mswu\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_dll\mswu\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswud\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswud\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_dll\mswud\wx\msw\rcdefs.h - Creating ..\..\lib\vc_dll\mswud\wx\msw\rcdefs.h - ..\..\lib\vc_dll\mswud\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_dll\mswud\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswunivu\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswunivu\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_dll\mswunivu\wx\msw\rcdefs.h - Creating ..\..\lib\vc_dll\mswunivu\wx\msw\rcdefs.h - ..\..\lib\vc_dll\mswunivu\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_dll\mswunivu\wx\msw\rcdefs.h;%(Outputs) - - - - - - - \ No newline at end of file diff --git a/wxWidgets/build/msw/wx_qa.vcxproj.filters b/wxWidgets/build/msw/wx_qa.vcxproj.filters deleted file mode 100644 index fc2e5a22b7..0000000000 --- a/wxWidgets/build/msw/wx_qa.vcxproj.filters +++ /dev/null @@ -1,55 +0,0 @@ - - - - - {d4e05382-ece8-447a-8024-350f855f5751} - - - {1586562e-a0b5-4de1-ba12-095fb6caf819} - - - {2a215482-1aa1-4121-af55-caf7e4d3fb75} - - - {eddbe6a9-f2a5-4cc3-b2a7-3abda81467c1} - - - {363395db-d80a-446a-8872-e0b4b50bfd79} - - - {ead23d01-e706-4375-bf93-9379f55fd2ca} - - - - - Common Sources - - - Common Sources - - - Generic Sources - - - - - MSW Sources - - - - - Common Headers - - - - - Setup Headers - - - Setup Headers - - - MSW Headers - - - \ No newline at end of file diff --git a/wxWidgets/build/msw/wx_richtext.vcxproj b/wxWidgets/build/msw/wx_richtext.vcxproj deleted file mode 100644 index e60408d367..0000000000 --- a/wxWidgets/build/msw/wx_richtext.vcxproj +++ /dev/null @@ -1,2524 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - DLL Debug - Win32 - - - DLL Debug - x64 - - - DLL Release - Win32 - - - DLL Release - x64 - - - DLL Unicode Debug - Win32 - - - DLL Unicode Debug - x64 - - - DLL Unicode Release - Win32 - - - DLL Unicode Release - x64 - - - DLL Universal Debug - Win32 - - - DLL Universal Debug - x64 - - - DLL Universal Release - Win32 - - - DLL Universal Release - x64 - - - DLL Universal Unicode Debug - Win32 - - - DLL Universal Unicode Debug - x64 - - - DLL Universal Unicode Release - Win32 - - - DLL Universal Unicode Release - x64 - - - Release - Win32 - - - Release - x64 - - - Template - Win32 - - - Template - x64 - - - Unicode Debug - Win32 - - - Unicode Debug - x64 - - - Unicode Release - Win32 - - - Unicode Release - x64 - - - Universal Debug - Win32 - - - Universal Debug - x64 - - - Universal Release - Win32 - - - Universal Release - x64 - - - Universal Unicode Debug - Win32 - - - Universal Unicode Debug - x64 - - - Universal Unicode Release - Win32 - - - Universal Unicode Release - x64 - - - - richtext - - - {FAF0CB93-F7CE-A6B8-8342-19CE99BAF774} - - - - Application - v110 - - - Application - v110 - - - DynamicLibrary - false - v110 - - - DynamicLibrary - false - v110 - - - DynamicLibrary - false - Unicode - v110 - - - DynamicLibrary - false - Unicode - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - Unicode - v110 - - - StaticLibrary - false - Unicode - v110 - - - DynamicLibrary - false - v110 - - - DynamicLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - DynamicLibrary - false - v110 - - - DynamicLibrary - false - v110 - - - DynamicLibrary - false - Unicode - v110 - - - DynamicLibrary - false - Unicode - v110 - - - DynamicLibrary - false - Unicode - v110 - - - DynamicLibrary - false - Unicode - v110 - - - DynamicLibrary - false - v110 - - - DynamicLibrary - false - v110 - - - StaticLibrary - false - Unicode - v110 - - - StaticLibrary - false - Unicode - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - DynamicLibrary - false - Unicode - v110 - - - DynamicLibrary - false - Unicode - v110 - - - StaticLibrary - false - Unicode - v110 - - - StaticLibrary - false - Unicode - v110 - - - StaticLibrary - false - Unicode - v110 - - - StaticLibrary - false - Unicode - v110 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - .\..\..\lib\vc_lib\ - .\vc_mswud\richtext\ - - - .\..\..\lib\vc_lib\ - .\vc_mswud\richtext\ - - - .\..\..\lib\vc_lib\ - .\vc_mswu\richtext\ - - - .\..\..\lib\vc_lib\ - .\vc_mswu\richtext\ - - - .\..\..\lib\vc_dll\ - .\vc_mswunivudll\richtext\ - false - - - .\..\..\lib\vc_dll\ - .\vc_mswunivudll\richtext\ - false - - - .\..\..\lib\vc_lib\ - .\vc_mswuniv\richtext\ - - - .\..\..\lib\vc_lib\ - .\vc_mswuniv\richtext\ - - - .\..\..\lib\vc_lib\ - .\vc_mswunivud\richtext\ - - - .\..\..\lib\vc_lib\ - .\vc_mswunivud\richtext\ - - - .\..\..\lib\vc_dll\ - .\vc_mswddll\richtext\ - true - - - .\..\..\lib\vc_dll\ - .\vc_mswddll\richtext\ - true - - - .\..\..\lib\vc_dll\ - .\vc_mswuddll\richtext\ - true - - - .\..\..\lib\vc_dll\ - .\vc_mswuddll\richtext\ - true - - - .\..\..\lib\vc_dll\ - .\vc_mswudll\richtext\ - false - - - .\..\..\lib\vc_dll\ - .\vc_mswudll\richtext\ - false - - - .\..\..\lib\vc_dll\ - .\vc_mswunivddll\richtext\ - true - - - .\..\..\lib\vc_dll\ - .\vc_mswunivddll\richtext\ - true - - - .\..\..\lib\vc_lib\ - .\vc_msw\richtext\ - - - .\..\..\lib\vc_lib\ - .\vc_msw\richtext\ - - - .\..\..\lib\vc_lib\ - .\vc_mswunivd\richtext\ - - - .\..\..\lib\vc_lib\ - .\vc_mswunivd\richtext\ - - - .\..\..\lib\vc_dll\ - .\vc_mswdll\richtext\ - false - - - .\..\..\lib\vc_dll\ - .\vc_mswdll\richtext\ - false - - - .\..\..\lib\vc_lib\ - .\vc_mswunivu\richtext\ - - - .\..\..\lib\vc_lib\ - .\vc_mswunivu\richtext\ - - - .\..\..\lib\vc_lib\ - .\vc_mswd\richtext\ - - - .\..\..\lib\vc_lib\ - .\vc_mswd\richtext\ - - - .\..\..\lib\vc_dll\ - .\vc_mswunivuddll\richtext\ - true - - - .\..\..\lib\vc_dll\ - .\vc_mswunivuddll\richtext\ - true - - - .\..\..\lib\vc_dll\ - .\vc_mswunivdll\richtext\ - false - - - .\..\..\lib\vc_dll\ - .\vc_mswunivdll\richtext\ - false - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - true - ..\..\lib\vc_lib\mswud;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;__WXMSW__;__WXDEBUG__;WXBUILDING;%(PreprocessorDefinitions) - .\vc_mswud\richtext\ - vc_mswud\wxprec_richtextlib.pch - Use - wx/wxprec.h - .\vc_mswud\richtext\ - ..\..\lib\vc_lib\wxmsw28ud_richtext.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_richtext.bsc - - - true - ..\..\lib\vc_lib\wxmsw28ud_richtext.lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - ..\..\lib\vc_lib\mswud;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;__WXMSW__;__WXDEBUG__;WXBUILDING;%(PreprocessorDefinitions) - .\vc_mswud\richtext\ - vc_mswud\wxprec_richtextlib.pch - Use - wx/wxprec.h - .\vc_mswud\richtext\ - ..\..\lib\vc_lib\wxmsw28ud_richtext.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_richtext.bsc - - - true - ..\..\lib\vc_lib\wxmsw28ud_richtext.lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_lib\mswu;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;__WXMSW__;NDEBUG;WXBUILDING;%(PreprocessorDefinitions) - .\vc_mswu\richtext\ - vc_mswu\wxprec_richtextlib.pch - Use - wx/wxprec.h - .\vc_mswu\richtext\ - ..\..\lib\vc_lib\wxmsw28u_richtext.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_richtext.bsc - - - true - ..\..\lib\vc_lib\wxmsw28u_richtext.lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_lib\mswu;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;__WXMSW__;NDEBUG;WXBUILDING;%(PreprocessorDefinitions) - .\vc_mswu\richtext\ - vc_mswu\wxprec_richtextlib.pch - Use - wx/wxprec.h - .\vc_mswu\richtext\ - ..\..\lib\vc_lib\wxmsw28u_richtext.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_richtext.bsc - - - true - ..\..\lib\vc_lib\wxmsw28u_richtext.lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_dll\mswunivu;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;__WXUNIVERSAL__;NDEBUG;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_RICHTEXT;%(PreprocessorDefinitions) - .\vc_mswunivudll\richtext\ - vc_mswunivudll\wxprec_richtextdll.pch - Use - wx/wxprec.h - .\vc_mswunivudll\richtext\ - ..\..\lib\vc_dll\wxmswuniv28u_richtext_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;__WXUNIVERSAL__;NDEBUG;_UNICODE;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_RICHTEXT;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_richtext.tlb - true - Win32 - - - 0x0409 - ..\..\lib\vc_dll\mswunivu;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - __WXMSW__;__WXUNIVERSAL__;NDEBUG;_UNICODE;WXBUILDING;WXDLLNAME=wxmswuniv28u_richtext_vc_custom;WXUSINGDLL;WXMAKINGDLL_RICHTEXT;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_richtext.bsc - - - true - true - Console - ..\..\lib\vc_dll\wxmswuniv28u_richtext_vc_custom.dll - ..\..\lib\vc_dll\wxmswuniv28u_richtext.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxtiff.lib;wxjpeg.lib;wxpng.lib;wxzlib.lib;wxregexu.lib;wxexpat.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxmswuniv28u_adv.lib;..\..\lib\vc_dll\wxmswuniv28u_html.lib;..\..\lib\vc_dll\wxbase28u_xml.lib;..\..\lib\vc_dll\wxmswuniv28u_core.lib;..\..\lib\vc_dll\wxbase28u.lib;%(AdditionalDependencies) - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_dll\mswunivu;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;__WXUNIVERSAL__;NDEBUG;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_RICHTEXT;%(PreprocessorDefinitions) - .\vc_mswunivudll\richtext\ - vc_mswunivudll\wxprec_richtextdll.pch - Use - wx/wxprec.h - .\vc_mswunivudll\richtext\ - ..\..\lib\vc_dll\wxmswuniv28u_richtext_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;__WXUNIVERSAL__;NDEBUG;_UNICODE;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_RICHTEXT;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_richtext.tlb - true - - - 0x0409 - ..\..\lib\vc_dll\mswunivu;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - __WXMSW__;__WXUNIVERSAL__;NDEBUG;_UNICODE;WXBUILDING;WXDLLNAME=wxmswuniv28u_richtext_vc_custom;WXUSINGDLL;WXMAKINGDLL_RICHTEXT;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_richtext.bsc - - - true - true - Console - ..\..\lib\vc_dll\wxmswuniv28u_richtext_vc_custom.dll - ..\..\lib\vc_dll\wxmswuniv28u_richtext.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxtiff.lib;wxjpeg.lib;wxpng.lib;wxzlib.lib;wxregexu.lib;wxexpat.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxmswuniv28u_adv.lib;..\..\lib\vc_dll\wxmswuniv28u_html.lib;..\..\lib\vc_dll\wxbase28u_xml.lib;..\..\lib\vc_dll\wxmswuniv28u_core.lib;..\..\lib\vc_dll\wxbase28u.lib;%(AdditionalDependencies) - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_lib\mswuniv;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;__WXMSW__;__WXUNIVERSAL__;NDEBUG;WXBUILDING;%(PreprocessorDefinitions) - .\vc_mswuniv\richtext\ - vc_mswuniv\wxprec_richtextlib.pch - Use - wx/wxprec.h - .\vc_mswuniv\richtext\ - ..\..\lib\vc_lib\wxmswuniv28_richtext.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_richtext.bsc - - - true - ..\..\lib\vc_lib\wxmswuniv28_richtext.lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_lib\mswuniv;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;__WXMSW__;__WXUNIVERSAL__;NDEBUG;WXBUILDING;%(PreprocessorDefinitions) - .\vc_mswuniv\richtext\ - vc_mswuniv\wxprec_richtextlib.pch - Use - wx/wxprec.h - .\vc_mswuniv\richtext\ - ..\..\lib\vc_lib\wxmswuniv28_richtext.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_richtext.bsc - - - true - ..\..\lib\vc_lib\wxmswuniv28_richtext.lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - true - ..\..\lib\vc_lib\mswunivud;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;WXBUILDING;%(PreprocessorDefinitions) - .\vc_mswunivud\richtext\ - vc_mswunivud\wxprec_richtextlib.pch - Use - wx/wxprec.h - .\vc_mswunivud\richtext\ - ..\..\lib\vc_lib\wxmswuniv28ud_richtext.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_richtext.bsc - - - true - ..\..\lib\vc_lib\wxmswuniv28ud_richtext.lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - ..\..\lib\vc_lib\mswunivud;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;WXBUILDING;%(PreprocessorDefinitions) - .\vc_mswunivud\richtext\ - vc_mswunivud\wxprec_richtextlib.pch - Use - wx/wxprec.h - .\vc_mswunivud\richtext\ - ..\..\lib\vc_lib\wxmswuniv28ud_richtext.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_richtext.bsc - - - true - ..\..\lib\vc_lib\wxmswuniv28ud_richtext.lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - true - ..\..\lib\vc_dll\mswd;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXDEBUG__;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_RICHTEXT;%(PreprocessorDefinitions) - .\vc_mswddll\richtext\ - vc_mswddll\wxprec_richtextdll.pch - Use - wx/wxprec.h - .\vc_mswddll\richtext\ - ..\..\lib\vc_dll\wxmsw28d_richtext_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXDEBUG__;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_RICHTEXT;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_richtext.tlb - true - Win32 - - - 0x0409 - ..\..\lib\vc_dll\mswd;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - _DEBUG;__WXMSW__;__WXDEBUG__;WXBUILDING;WXDLLNAME=wxmsw28d_richtext_vc_custom;WXUSINGDLL;WXMAKINGDLL_RICHTEXT;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_richtext.bsc - - - true - true - true - Console - ..\..\lib\vc_dll\wxmsw28d_richtext_vc_custom.dll - ..\..\lib\vc_dll\wxmsw28d_richtext.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxtiffd.lib;wxjpegd.lib;wxpngd.lib;wxzlibd.lib;wxregexd.lib;wxexpatd.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxmsw28d_adv.lib;..\..\lib\vc_dll\wxmsw28d_html.lib;..\..\lib\vc_dll\wxbase28d_xml.lib;..\..\lib\vc_dll\wxmsw28d_core.lib;..\..\lib\vc_dll\wxbase28d.lib;%(AdditionalDependencies) - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - ..\..\lib\vc_dll\mswd;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXDEBUG__;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_RICHTEXT;%(PreprocessorDefinitions) - .\vc_mswddll\richtext\ - vc_mswddll\wxprec_richtextdll.pch - Use - wx/wxprec.h - .\vc_mswddll\richtext\ - ..\..\lib\vc_dll\wxmsw28d_richtext_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXDEBUG__;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_RICHTEXT;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_richtext.tlb - true - - - 0x0409 - ..\..\lib\vc_dll\mswd;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - _DEBUG;__WXMSW__;__WXDEBUG__;WXBUILDING;WXDLLNAME=wxmsw28d_richtext_vc_custom;WXUSINGDLL;WXMAKINGDLL_RICHTEXT;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_richtext.bsc - - - true - true - true - Console - ..\..\lib\vc_dll\wxmsw28d_richtext_vc_custom.dll - ..\..\lib\vc_dll\wxmsw28d_richtext.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxtiffd.lib;wxjpegd.lib;wxpngd.lib;wxzlibd.lib;wxregexd.lib;wxexpatd.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxmsw28d_adv.lib;..\..\lib\vc_dll\wxmsw28d_html.lib;..\..\lib\vc_dll\wxbase28d_xml.lib;..\..\lib\vc_dll\wxmsw28d_core.lib;..\..\lib\vc_dll\wxbase28d.lib;%(AdditionalDependencies) - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - true - ..\..\lib\vc_dll\mswud;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXDEBUG__;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_RICHTEXT;%(PreprocessorDefinitions) - .\vc_mswuddll\richtext\ - vc_mswuddll\wxprec_richtextdll.pch - Use - wx/wxprec.h - .\vc_mswuddll\richtext\ - ..\..\lib\vc_dll\wxmsw28ud_richtext_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXDEBUG__;_UNICODE;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_RICHTEXT;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_richtext.tlb - true - Win32 - - - 0x0409 - ..\..\lib\vc_dll\mswud;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - _DEBUG;__WXMSW__;__WXDEBUG__;_UNICODE;WXBUILDING;WXDLLNAME=wxmsw28ud_richtext_vc_custom;WXUSINGDLL;WXMAKINGDLL_RICHTEXT;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_richtext.bsc - - - true - true - true - Console - ..\..\lib\vc_dll\wxmsw28ud_richtext_vc_custom.dll - ..\..\lib\vc_dll\wxmsw28ud_richtext.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxtiffd.lib;wxjpegd.lib;wxpngd.lib;wxzlibd.lib;wxregexud.lib;wxexpatd.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxmsw28ud_adv.lib;..\..\lib\vc_dll\wxmsw28ud_html.lib;..\..\lib\vc_dll\wxbase28ud_xml.lib;..\..\lib\vc_dll\wxmsw28ud_core.lib;..\..\lib\vc_dll\wxbase28ud.lib;%(AdditionalDependencies) - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - ..\..\lib\vc_dll\mswud;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXDEBUG__;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_RICHTEXT;%(PreprocessorDefinitions) - .\vc_mswuddll\richtext\ - vc_mswuddll\wxprec_richtextdll.pch - Use - wx/wxprec.h - .\vc_mswuddll\richtext\ - ..\..\lib\vc_dll\wxmsw28ud_richtext_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXDEBUG__;_UNICODE;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_RICHTEXT;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_richtext.tlb - true - - - 0x0409 - ..\..\lib\vc_dll\mswud;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - _DEBUG;__WXMSW__;__WXDEBUG__;_UNICODE;WXBUILDING;WXDLLNAME=wxmsw28ud_richtext_vc_custom;WXUSINGDLL;WXMAKINGDLL_RICHTEXT;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_richtext.bsc - - - true - true - true - Console - ..\..\lib\vc_dll\wxmsw28ud_richtext_vc_custom.dll - ..\..\lib\vc_dll\wxmsw28ud_richtext.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxtiffd.lib;wxjpegd.lib;wxpngd.lib;wxzlibd.lib;wxregexud.lib;wxexpatd.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxmsw28ud_adv.lib;..\..\lib\vc_dll\wxmsw28ud_html.lib;..\..\lib\vc_dll\wxbase28ud_xml.lib;..\..\lib\vc_dll\wxmsw28ud_core.lib;..\..\lib\vc_dll\wxbase28ud.lib;%(AdditionalDependencies) - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_dll\mswu;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;NDEBUG;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_RICHTEXT;%(PreprocessorDefinitions) - .\vc_mswudll\richtext\ - vc_mswudll\wxprec_richtextdll.pch - Use - wx/wxprec.h - .\vc_mswudll\richtext\ - ..\..\lib\vc_dll\wxmsw28u_richtext_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;NDEBUG;_UNICODE;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_RICHTEXT;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_richtext.tlb - true - Win32 - - - 0x0409 - ..\..\lib\vc_dll\mswu;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - __WXMSW__;NDEBUG;_UNICODE;WXBUILDING;WXDLLNAME=wxmsw28u_richtext_vc_custom;WXUSINGDLL;WXMAKINGDLL_RICHTEXT;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_richtext.bsc - - - true - true - Console - ..\..\lib\vc_dll\wxmsw28u_richtext_vc_custom.dll - ..\..\lib\vc_dll\wxmsw28u_richtext.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxtiff.lib;wxjpeg.lib;wxpng.lib;wxzlib.lib;wxregexu.lib;wxexpat.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxmsw28u_adv.lib;..\..\lib\vc_dll\wxmsw28u_html.lib;..\..\lib\vc_dll\wxbase28u_xml.lib;..\..\lib\vc_dll\wxmsw28u_core.lib;..\..\lib\vc_dll\wxbase28u.lib;%(AdditionalDependencies) - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_dll\mswu;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;NDEBUG;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_RICHTEXT;%(PreprocessorDefinitions) - .\vc_mswudll\richtext\ - vc_mswudll\wxprec_richtextdll.pch - Use - wx/wxprec.h - .\vc_mswudll\richtext\ - ..\..\lib\vc_dll\wxmsw28u_richtext_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;NDEBUG;_UNICODE;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_RICHTEXT;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_richtext.tlb - true - - - 0x0409 - ..\..\lib\vc_dll\mswu;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - __WXMSW__;NDEBUG;_UNICODE;WXBUILDING;WXDLLNAME=wxmsw28u_richtext_vc_custom;WXUSINGDLL;WXMAKINGDLL_RICHTEXT;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_richtext.bsc - - - true - true - Console - ..\..\lib\vc_dll\wxmsw28u_richtext_vc_custom.dll - ..\..\lib\vc_dll\wxmsw28u_richtext.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxtiff.lib;wxjpeg.lib;wxpng.lib;wxzlib.lib;wxregexu.lib;wxexpat.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxmsw28u_adv.lib;..\..\lib\vc_dll\wxmsw28u_html.lib;..\..\lib\vc_dll\wxbase28u_xml.lib;..\..\lib\vc_dll\wxmsw28u_core.lib;..\..\lib\vc_dll\wxbase28u.lib;%(AdditionalDependencies) - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - true - ..\..\lib\vc_dll\mswunivd;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_RICHTEXT;%(PreprocessorDefinitions) - .\vc_mswunivddll\richtext\ - vc_mswunivddll\wxprec_richtextdll.pch - Use - wx/wxprec.h - .\vc_mswunivddll\richtext\ - ..\..\lib\vc_dll\wxmswuniv28d_richtext_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_RICHTEXT;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_richtext.tlb - true - Win32 - - - 0x0409 - ..\..\lib\vc_dll\mswunivd;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - _DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;WXBUILDING;WXDLLNAME=wxmswuniv28d_richtext_vc_custom;WXUSINGDLL;WXMAKINGDLL_RICHTEXT;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_richtext.bsc - - - true - true - true - Console - ..\..\lib\vc_dll\wxmswuniv28d_richtext_vc_custom.dll - ..\..\lib\vc_dll\wxmswuniv28d_richtext.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxtiffd.lib;wxjpegd.lib;wxpngd.lib;wxzlibd.lib;wxregexd.lib;wxexpatd.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxmswuniv28d_adv.lib;..\..\lib\vc_dll\wxmswuniv28d_html.lib;..\..\lib\vc_dll\wxbase28d_xml.lib;..\..\lib\vc_dll\wxmswuniv28d_core.lib;..\..\lib\vc_dll\wxbase28d.lib;%(AdditionalDependencies) - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - ..\..\lib\vc_dll\mswunivd;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_RICHTEXT;%(PreprocessorDefinitions) - .\vc_mswunivddll\richtext\ - vc_mswunivddll\wxprec_richtextdll.pch - Use - wx/wxprec.h - .\vc_mswunivddll\richtext\ - ..\..\lib\vc_dll\wxmswuniv28d_richtext_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_RICHTEXT;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_richtext.tlb - true - - - 0x0409 - ..\..\lib\vc_dll\mswunivd;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - _DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;WXBUILDING;WXDLLNAME=wxmswuniv28d_richtext_vc_custom;WXUSINGDLL;WXMAKINGDLL_RICHTEXT;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_richtext.bsc - - - true - true - true - Console - ..\..\lib\vc_dll\wxmswuniv28d_richtext_vc_custom.dll - ..\..\lib\vc_dll\wxmswuniv28d_richtext.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxtiffd.lib;wxjpegd.lib;wxpngd.lib;wxzlibd.lib;wxregexd.lib;wxexpatd.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxmswuniv28d_adv.lib;..\..\lib\vc_dll\wxmswuniv28d_html.lib;..\..\lib\vc_dll\wxbase28d_xml.lib;..\..\lib\vc_dll\wxmswuniv28d_core.lib;..\..\lib\vc_dll\wxbase28d.lib;%(AdditionalDependencies) - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_lib\msw;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;__WXMSW__;NDEBUG;WXBUILDING;%(PreprocessorDefinitions) - .\vc_msw\richtext\ - vc_msw\wxprec_richtextlib.pch - Use - wx/wxprec.h - .\vc_msw\richtext\ - ..\..\lib\vc_lib\wxmsw28_richtext.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_richtext.bsc - - - true - .\..\..\..\libs\$(Configuration)\$(ProjectName).lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_lib\msw;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;__WXMSW__;NDEBUG;WXBUILDING;%(PreprocessorDefinitions) - .\vc_msw\richtext\ - vc_msw\wxprec_richtextlib.pch - Use - wx/wxprec.h - .\vc_msw\richtext\ - ..\..\lib\vc_lib\wxmsw28_richtext.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_richtext.bsc - - - true - .\..\..\..\libs\$(Configuration)\$(ProjectName).lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - true - ..\..\lib\vc_lib\mswunivd;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;WXBUILDING;%(PreprocessorDefinitions) - .\vc_mswunivd\richtext\ - vc_mswunivd\wxprec_richtextlib.pch - Use - wx/wxprec.h - .\vc_mswunivd\richtext\ - ..\..\lib\vc_lib\wxmswuniv28d_richtext.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_richtext.bsc - - - true - ..\..\lib\vc_lib\wxmswuniv28d_richtext.lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - ..\..\lib\vc_lib\mswunivd;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;WXBUILDING;%(PreprocessorDefinitions) - .\vc_mswunivd\richtext\ - vc_mswunivd\wxprec_richtextlib.pch - Use - wx/wxprec.h - .\vc_mswunivd\richtext\ - ..\..\lib\vc_lib\wxmswuniv28d_richtext.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_richtext.bsc - - - true - ..\..\lib\vc_lib\wxmswuniv28d_richtext.lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_dll\msw;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;NDEBUG;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_RICHTEXT;%(PreprocessorDefinitions) - .\vc_mswdll\richtext\ - vc_mswdll\wxprec_richtextdll.pch - Use - wx/wxprec.h - .\vc_mswdll\richtext\ - ..\..\lib\vc_dll\wxmsw28_richtext_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;NDEBUG;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_RICHTEXT;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_richtext.tlb - true - Win32 - - - 0x0409 - ..\..\lib\vc_dll\msw;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - __WXMSW__;NDEBUG;WXBUILDING;WXDLLNAME=wxmsw28_richtext_vc_custom;WXUSINGDLL;WXMAKINGDLL_RICHTEXT;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_richtext.bsc - - - true - true - Console - ..\..\lib\vc_dll\wxmsw28_richtext_vc_custom.dll - ..\..\lib\vc_dll\wxmsw28_richtext.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxtiff.lib;wxjpeg.lib;wxpng.lib;wxzlib.lib;wxregex.lib;wxexpat.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxmsw28_adv.lib;..\..\lib\vc_dll\wxmsw28_html.lib;..\..\lib\vc_dll\wxbase28_xml.lib;..\..\lib\vc_dll\wxmsw28_core.lib;..\..\lib\vc_dll\wxbase28.lib;%(AdditionalDependencies) - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_dll\msw;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;NDEBUG;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_RICHTEXT;%(PreprocessorDefinitions) - .\vc_mswdll\richtext\ - vc_mswdll\wxprec_richtextdll.pch - Use - wx/wxprec.h - .\vc_mswdll\richtext\ - ..\..\lib\vc_dll\wxmsw28_richtext_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;NDEBUG;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_RICHTEXT;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_richtext.tlb - true - - - 0x0409 - ..\..\lib\vc_dll\msw;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - __WXMSW__;NDEBUG;WXBUILDING;WXDLLNAME=wxmsw28_richtext_vc_custom;WXUSINGDLL;WXMAKINGDLL_RICHTEXT;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_richtext.bsc - - - true - true - Console - ..\..\lib\vc_dll\wxmsw28_richtext_vc_custom.dll - ..\..\lib\vc_dll\wxmsw28_richtext.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxtiff.lib;wxjpeg.lib;wxpng.lib;wxzlib.lib;wxregex.lib;wxexpat.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxmsw28_adv.lib;..\..\lib\vc_dll\wxmsw28_html.lib;..\..\lib\vc_dll\wxbase28_xml.lib;..\..\lib\vc_dll\wxmsw28_core.lib;..\..\lib\vc_dll\wxbase28.lib;%(AdditionalDependencies) - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_lib\mswunivu;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;__WXMSW__;__WXUNIVERSAL__;NDEBUG;WXBUILDING;%(PreprocessorDefinitions) - .\vc_mswunivu\richtext\ - vc_mswunivu\wxprec_richtextlib.pch - Use - wx/wxprec.h - .\vc_mswunivu\richtext\ - ..\..\lib\vc_lib\wxmswuniv28u_richtext.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_richtext.bsc - - - true - ..\..\lib\vc_lib\wxmswuniv28u_richtext.lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_lib\mswunivu;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;__WXMSW__;__WXUNIVERSAL__;NDEBUG;WXBUILDING;%(PreprocessorDefinitions) - .\vc_mswunivu\richtext\ - vc_mswunivu\wxprec_richtextlib.pch - Use - wx/wxprec.h - .\vc_mswunivu\richtext\ - ..\..\lib\vc_lib\wxmswuniv28u_richtext.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_richtext.bsc - - - true - ..\..\lib\vc_lib\wxmswuniv28u_richtext.lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - true - ..\..\lib\vc_lib\mswd;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;__WXMSW__;__WXDEBUG__;WXBUILDING;%(PreprocessorDefinitions) - .\vc_mswd\richtext\ - vc_mswd\wxprec_richtextlib.pch - Use - wx/wxprec.h - .\vc_mswd\richtext\ - ..\..\lib\vc_lib\wxmsw28d_richtext.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_richtext.bsc - - - true - .\..\..\..\libs\$(Configuration)\$(ProjectName).lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - ..\..\lib\vc_lib\mswd;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;__WXMSW__;__WXDEBUG__;WXBUILDING;%(PreprocessorDefinitions) - .\vc_mswd\richtext\ - vc_mswd\wxprec_richtextlib.pch - Use - wx/wxprec.h - .\vc_mswd\richtext\ - ..\..\lib\vc_lib\wxmsw28d_richtext.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_richtext.bsc - - - true - .\..\..\..\libs\$(Configuration)\$(ProjectName).lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - true - ..\..\lib\vc_dll\mswunivud;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_RICHTEXT;%(PreprocessorDefinitions) - .\vc_mswunivuddll\richtext\ - vc_mswunivuddll\wxprec_richtextdll.pch - Use - wx/wxprec.h - .\vc_mswunivuddll\richtext\ - ..\..\lib\vc_dll\wxmswuniv28ud_richtext_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;_UNICODE;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_RICHTEXT;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_richtext.tlb - true - Win32 - - - 0x0409 - ..\..\lib\vc_dll\mswunivud;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - _DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;_UNICODE;WXBUILDING;WXDLLNAME=wxmswuniv28ud_richtext_vc_custom;WXUSINGDLL;WXMAKINGDLL_RICHTEXT;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_richtext.bsc - - - true - true - true - Console - ..\..\lib\vc_dll\wxmswuniv28ud_richtext_vc_custom.dll - ..\..\lib\vc_dll\wxmswuniv28ud_richtext.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxtiffd.lib;wxjpegd.lib;wxpngd.lib;wxzlibd.lib;wxregexud.lib;wxexpatd.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxmswuniv28ud_adv.lib;..\..\lib\vc_dll\wxmswuniv28ud_html.lib;..\..\lib\vc_dll\wxbase28ud_xml.lib;..\..\lib\vc_dll\wxmswuniv28ud_core.lib;..\..\lib\vc_dll\wxbase28ud.lib;%(AdditionalDependencies) - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - ..\..\lib\vc_dll\mswunivud;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_RICHTEXT;%(PreprocessorDefinitions) - .\vc_mswunivuddll\richtext\ - vc_mswunivuddll\wxprec_richtextdll.pch - Use - wx/wxprec.h - .\vc_mswunivuddll\richtext\ - ..\..\lib\vc_dll\wxmswuniv28ud_richtext_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;_UNICODE;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_RICHTEXT;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_richtext.tlb - true - - - 0x0409 - ..\..\lib\vc_dll\mswunivud;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - _DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;_UNICODE;WXBUILDING;WXDLLNAME=wxmswuniv28ud_richtext_vc_custom;WXUSINGDLL;WXMAKINGDLL_RICHTEXT;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_richtext.bsc - - - true - true - true - Console - ..\..\lib\vc_dll\wxmswuniv28ud_richtext_vc_custom.dll - ..\..\lib\vc_dll\wxmswuniv28ud_richtext.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxtiffd.lib;wxjpegd.lib;wxpngd.lib;wxzlibd.lib;wxregexud.lib;wxexpatd.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxmswuniv28ud_adv.lib;..\..\lib\vc_dll\wxmswuniv28ud_html.lib;..\..\lib\vc_dll\wxbase28ud_xml.lib;..\..\lib\vc_dll\wxmswuniv28ud_core.lib;..\..\lib\vc_dll\wxbase28ud.lib;%(AdditionalDependencies) - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_dll\mswuniv;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;__WXUNIVERSAL__;NDEBUG;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_RICHTEXT;%(PreprocessorDefinitions) - .\vc_mswunivdll\richtext\ - vc_mswunivdll\wxprec_richtextdll.pch - Use - wx/wxprec.h - .\vc_mswunivdll\richtext\ - ..\..\lib\vc_dll\wxmswuniv28_richtext_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;__WXUNIVERSAL__;NDEBUG;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_RICHTEXT;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_richtext.tlb - true - Win32 - - - 0x0409 - ..\..\lib\vc_dll\mswuniv;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - __WXMSW__;__WXUNIVERSAL__;NDEBUG;WXBUILDING;WXDLLNAME=wxmswuniv28_richtext_vc_custom;WXUSINGDLL;WXMAKINGDLL_RICHTEXT;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_richtext.bsc - - - true - true - Console - ..\..\lib\vc_dll\wxmswuniv28_richtext_vc_custom.dll - ..\..\lib\vc_dll\wxmswuniv28_richtext.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxtiff.lib;wxjpeg.lib;wxpng.lib;wxzlib.lib;wxregex.lib;wxexpat.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxmswuniv28_adv.lib;..\..\lib\vc_dll\wxmswuniv28_html.lib;..\..\lib\vc_dll\wxbase28_xml.lib;..\..\lib\vc_dll\wxmswuniv28_core.lib;..\..\lib\vc_dll\wxbase28.lib;%(AdditionalDependencies) - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_dll\mswuniv;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;__WXUNIVERSAL__;NDEBUG;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_RICHTEXT;%(PreprocessorDefinitions) - .\vc_mswunivdll\richtext\ - vc_mswunivdll\wxprec_richtextdll.pch - Use - wx/wxprec.h - .\vc_mswunivdll\richtext\ - ..\..\lib\vc_dll\wxmswuniv28_richtext_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;__WXUNIVERSAL__;NDEBUG;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_RICHTEXT;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_richtext.tlb - true - - - 0x0409 - ..\..\lib\vc_dll\mswuniv;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - __WXMSW__;__WXUNIVERSAL__;NDEBUG;WXBUILDING;WXDLLNAME=wxmswuniv28_richtext_vc_custom;WXUSINGDLL;WXMAKINGDLL_RICHTEXT;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_richtext.bsc - - - true - true - Console - ..\..\lib\vc_dll\wxmswuniv28_richtext_vc_custom.dll - ..\..\lib\vc_dll\wxmswuniv28_richtext.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxtiff.lib;wxjpeg.lib;wxpng.lib;wxzlib.lib;wxregex.lib;wxexpat.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxmswuniv28_adv.lib;..\..\lib\vc_dll\wxmswuniv28_html.lib;..\..\lib\vc_dll\wxbase28_xml.lib;..\..\lib\vc_dll\wxmswuniv28_core.lib;..\..\lib\vc_dll\wxbase28.lib;%(AdditionalDependencies) - - - - - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - - - true - true - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - true - true - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - true - true - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - true - true - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - true - true - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - true - true - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - true - true - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - true - true - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - - - - - copy "%(FullPath)" ..\..\lib\vc_lib\mswud\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_lib\mswud\wx\setup.h - Creating ..\..\lib\vc_lib\mswud\wx\setup.h - Creating ..\..\lib\vc_lib\mswud\wx\setup.h - ..\..\lib\vc_lib\mswud\wx\setup.h;%(Outputs) - ..\..\lib\vc_lib\mswud\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_lib\mswu\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_lib\mswu\wx\setup.h - Creating ..\..\lib\vc_lib\mswu\wx\setup.h - Creating ..\..\lib\vc_lib\mswu\wx\setup.h - ..\..\lib\vc_lib\mswu\wx\setup.h;%(Outputs) - ..\..\lib\vc_lib\mswu\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_dll\mswd\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_dll\mswd\wx\setup.h - Creating ..\..\lib\vc_dll\mswd\wx\setup.h - Creating ..\..\lib\vc_dll\mswd\wx\setup.h - ..\..\lib\vc_dll\mswd\wx\setup.h;%(Outputs) - ..\..\lib\vc_dll\mswd\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_dll\mswud\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_dll\mswud\wx\setup.h - Creating ..\..\lib\vc_dll\mswud\wx\setup.h - Creating ..\..\lib\vc_dll\mswud\wx\setup.h - ..\..\lib\vc_dll\mswud\wx\setup.h;%(Outputs) - ..\..\lib\vc_dll\mswud\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_dll\mswu\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_dll\mswu\wx\setup.h - Creating ..\..\lib\vc_dll\mswu\wx\setup.h - Creating ..\..\lib\vc_dll\mswu\wx\setup.h - ..\..\lib\vc_dll\mswu\wx\setup.h;%(Outputs) - ..\..\lib\vc_dll\mswu\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_lib\msw\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_lib\msw\wx\setup.h - Creating ..\..\lib\vc_lib\msw\wx\setup.h - Creating ..\..\lib\vc_lib\msw\wx\setup.h - ..\..\lib\vc_lib\msw\wx\setup.h;%(Outputs) - ..\..\lib\vc_lib\msw\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_dll\msw\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_dll\msw\wx\setup.h - Creating ..\..\lib\vc_dll\msw\wx\setup.h - Creating ..\..\lib\vc_dll\msw\wx\setup.h - ..\..\lib\vc_dll\msw\wx\setup.h;%(Outputs) - ..\..\lib\vc_dll\msw\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_lib\mswd\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_lib\mswd\wx\setup.h - Creating ..\..\lib\vc_lib\mswd\wx\setup.h - Creating ..\..\lib\vc_lib\mswd\wx\setup.h - ..\..\lib\vc_lib\mswd\wx\setup.h;%(Outputs) - ..\..\lib\vc_lib\mswd\wx\setup.h;%(Outputs) - - - copy "%(FullPath)" ..\..\lib\vc_dll\mswunivu\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_dll\mswunivu\wx\setup.h - Creating ..\..\lib\vc_dll\mswunivu\wx\setup.h - Creating ..\..\lib\vc_dll\mswunivu\wx\setup.h - ..\..\lib\vc_dll\mswunivu\wx\setup.h;%(Outputs) - ..\..\lib\vc_dll\mswunivu\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_lib\mswuniv\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_lib\mswuniv\wx\setup.h - Creating ..\..\lib\vc_lib\mswuniv\wx\setup.h - Creating ..\..\lib\vc_lib\mswuniv\wx\setup.h - ..\..\lib\vc_lib\mswuniv\wx\setup.h;%(Outputs) - ..\..\lib\vc_lib\mswuniv\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_lib\mswunivud\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_lib\mswunivud\wx\setup.h - Creating ..\..\lib\vc_lib\mswunivud\wx\setup.h - Creating ..\..\lib\vc_lib\mswunivud\wx\setup.h - ..\..\lib\vc_lib\mswunivud\wx\setup.h;%(Outputs) - ..\..\lib\vc_lib\mswunivud\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_dll\mswunivd\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_dll\mswunivd\wx\setup.h - Creating ..\..\lib\vc_dll\mswunivd\wx\setup.h - Creating ..\..\lib\vc_dll\mswunivd\wx\setup.h - ..\..\lib\vc_dll\mswunivd\wx\setup.h;%(Outputs) - ..\..\lib\vc_dll\mswunivd\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_lib\mswunivd\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_lib\mswunivd\wx\setup.h - Creating ..\..\lib\vc_lib\mswunivd\wx\setup.h - Creating ..\..\lib\vc_lib\mswunivd\wx\setup.h - ..\..\lib\vc_lib\mswunivd\wx\setup.h;%(Outputs) - ..\..\lib\vc_lib\mswunivd\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_lib\mswunivu\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_lib\mswunivu\wx\setup.h - Creating ..\..\lib\vc_lib\mswunivu\wx\setup.h - Creating ..\..\lib\vc_lib\mswunivu\wx\setup.h - ..\..\lib\vc_lib\mswunivu\wx\setup.h;%(Outputs) - ..\..\lib\vc_lib\mswunivu\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_dll\mswunivud\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_dll\mswunivud\wx\setup.h - Creating ..\..\lib\vc_dll\mswunivud\wx\setup.h - Creating ..\..\lib\vc_dll\mswunivud\wx\setup.h - ..\..\lib\vc_dll\mswunivud\wx\setup.h;%(Outputs) - ..\..\lib\vc_dll\mswunivud\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_dll\mswuniv\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_dll\mswuniv\wx\setup.h - Creating ..\..\lib\vc_dll\mswuniv\wx\setup.h - Creating ..\..\lib\vc_dll\mswuniv\wx\setup.h - ..\..\lib\vc_dll\mswuniv\wx\setup.h;%(Outputs) - ..\..\lib\vc_dll\mswuniv\wx\setup.h;%(Outputs) - - - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswud\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswud\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_lib\mswud\wx\msw\rcdefs.h - Creating ..\..\lib\vc_lib\mswud\wx\msw\rcdefs.h - ..\..\lib\vc_lib\mswud\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_lib\mswud\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswu\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswu\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_lib\mswu\wx\msw\rcdefs.h - Creating ..\..\lib\vc_lib\mswu\wx\msw\rcdefs.h - ..\..\lib\vc_lib\mswu\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_lib\mswu\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswunivu\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswunivu\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_dll\mswunivu\wx\msw\rcdefs.h - Creating ..\..\lib\vc_dll\mswunivu\wx\msw\rcdefs.h - ..\..\lib\vc_dll\mswunivu\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_dll\mswunivu\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswuniv\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswuniv\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_lib\mswuniv\wx\msw\rcdefs.h - Creating ..\..\lib\vc_lib\mswuniv\wx\msw\rcdefs.h - ..\..\lib\vc_lib\mswuniv\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_lib\mswuniv\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswunivud\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswunivud\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_lib\mswunivud\wx\msw\rcdefs.h - Creating ..\..\lib\vc_lib\mswunivud\wx\msw\rcdefs.h - ..\..\lib\vc_lib\mswunivud\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_lib\mswunivud\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswd\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswd\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_dll\mswd\wx\msw\rcdefs.h - Creating ..\..\lib\vc_dll\mswd\wx\msw\rcdefs.h - ..\..\lib\vc_dll\mswd\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_dll\mswd\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswud\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswud\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_dll\mswud\wx\msw\rcdefs.h - Creating ..\..\lib\vc_dll\mswud\wx\msw\rcdefs.h - ..\..\lib\vc_dll\mswud\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_dll\mswud\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswu\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswu\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_dll\mswu\wx\msw\rcdefs.h - Creating ..\..\lib\vc_dll\mswu\wx\msw\rcdefs.h - ..\..\lib\vc_dll\mswu\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_dll\mswu\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswunivd\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswunivd\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_dll\mswunivd\wx\msw\rcdefs.h - Creating ..\..\lib\vc_dll\mswunivd\wx\msw\rcdefs.h - ..\..\lib\vc_dll\mswunivd\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_dll\mswunivd\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\msw\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\msw\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_lib\msw\wx\msw\rcdefs.h - Creating ..\..\lib\vc_lib\msw\wx\msw\rcdefs.h - ..\..\lib\vc_lib\msw\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_lib\msw\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswunivd\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswunivd\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_lib\mswunivd\wx\msw\rcdefs.h - Creating ..\..\lib\vc_lib\mswunivd\wx\msw\rcdefs.h - ..\..\lib\vc_lib\mswunivd\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_lib\mswunivd\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\msw\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\msw\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_dll\msw\wx\msw\rcdefs.h - Creating ..\..\lib\vc_dll\msw\wx\msw\rcdefs.h - ..\..\lib\vc_dll\msw\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_dll\msw\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswunivu\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswunivu\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_lib\mswunivu\wx\msw\rcdefs.h - Creating ..\..\lib\vc_lib\mswunivu\wx\msw\rcdefs.h - ..\..\lib\vc_lib\mswunivu\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_lib\mswunivu\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswd\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswd\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_lib\mswd\wx\msw\rcdefs.h - Creating ..\..\lib\vc_lib\mswd\wx\msw\rcdefs.h - ..\..\lib\vc_lib\mswd\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_lib\mswd\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswunivud\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswunivud\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_dll\mswunivud\wx\msw\rcdefs.h - Creating ..\..\lib\vc_dll\mswunivud\wx\msw\rcdefs.h - ..\..\lib\vc_dll\mswunivud\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_dll\mswunivud\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswuniv\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswuniv\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_dll\mswuniv\wx\msw\rcdefs.h - Creating ..\..\lib\vc_dll\mswuniv\wx\msw\rcdefs.h - ..\..\lib\vc_dll\mswuniv\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_dll\mswuniv\wx\msw\rcdefs.h;%(Outputs) - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/wxWidgets/build/msw/wx_richtext.vcxproj.filters b/wxWidgets/build/msw/wx_richtext.vcxproj.filters deleted file mode 100644 index 3f19939d65..0000000000 --- a/wxWidgets/build/msw/wx_richtext.vcxproj.filters +++ /dev/null @@ -1,100 +0,0 @@ - - - - - {e74810f4-1ca9-4f0e-881b-34260accf026} - - - {00431e48-85e1-4f18-9c97-3a87a90e960e} - - - {dcacdf64-bd96-467c-aba3-fca959965a72} - - - {09c7a06f-df3b-4208-9e33-2b317e2cf77d} - - - {23eab9e8-db14-4948-bc01-84265f7f9edb} - - - {92033cd9-5169-401c-8729-dc8ec4f5c80b} - - - - - Common Sources - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - - - MSW Sources - - - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - - - Setup Headers - - - Setup Headers - - - MSW Headers - - - \ No newline at end of file diff --git a/wxWidgets/build/msw/wx_wxexpat.vcxproj b/wxWidgets/build/msw/wx_wxexpat.vcxproj deleted file mode 100644 index 577746b8e4..0000000000 --- a/wxWidgets/build/msw/wx_wxexpat.vcxproj +++ /dev/null @@ -1,1609 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - DLL Debug - Win32 - - - DLL Debug - x64 - - - DLL Release - Win32 - - - DLL Release - x64 - - - DLL Unicode Debug - Win32 - - - DLL Unicode Debug - x64 - - - DLL Unicode Release - Win32 - - - DLL Unicode Release - x64 - - - DLL Universal Debug - Win32 - - - DLL Universal Debug - x64 - - - DLL Universal Release - Win32 - - - DLL Universal Release - x64 - - - DLL Universal Unicode Debug - Win32 - - - DLL Universal Unicode Debug - x64 - - - DLL Universal Unicode Release - Win32 - - - DLL Universal Unicode Release - x64 - - - Release - Win32 - - - Release - x64 - - - Template - Win32 - - - Template - x64 - - - Unicode Debug - Win32 - - - Unicode Debug - x64 - - - Unicode Release - Win32 - - - Unicode Release - x64 - - - Universal Debug - Win32 - - - Universal Debug - x64 - - - Universal Release - Win32 - - - Universal Release - x64 - - - Universal Unicode Debug - Win32 - - - Universal Unicode Debug - x64 - - - Universal Unicode Release - Win32 - - - Universal Unicode Release - x64 - - - - wxexpat - - - {46333DC3-B4A5-3DCC-E8BF-A3F20ADC56D2} - - - - Application - v110 - - - Application - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - .\..\..\lib\vc_dll\ - .\vc_mswunivddll\wxexpat\ - - - .\..\..\lib\vc_dll\ - .\vc_mswunivddll\wxexpat\ - - - .\..\..\lib\vc_lib\ - .\vc_mswud\wxexpat\ - - - .\..\..\lib\vc_lib\ - .\vc_mswud\wxexpat\ - - - .\..\..\lib\vc_dll\ - .\vc_mswudll\wxexpat\ - - - .\..\..\lib\vc_dll\ - .\vc_mswudll\wxexpat\ - - - .\..\..\lib\vc_lib\ - .\vc_mswu\wxexpat\ - - - .\..\..\lib\vc_lib\ - .\vc_mswu\wxexpat\ - - - .\..\..\lib\vc_lib\ - .\vc_mswunivud\wxexpat\ - - - .\..\..\lib\vc_lib\ - .\vc_mswunivud\wxexpat\ - - - .\..\..\lib\vc_dll\ - .\vc_mswunivudll\wxexpat\ - - - .\..\..\lib\vc_dll\ - .\vc_mswunivudll\wxexpat\ - - - .\..\..\lib\vc_dll\ - .\vc_mswunivdll\wxexpat\ - - - .\..\..\lib\vc_dll\ - .\vc_mswunivdll\wxexpat\ - - - .\..\..\lib\vc_dll\ - .\vc_mswunivuddll\wxexpat\ - - - .\..\..\lib\vc_dll\ - .\vc_mswunivuddll\wxexpat\ - - - .\..\..\lib\vc_dll\ - .\vc_mswuddll\wxexpat\ - - - .\..\..\lib\vc_dll\ - .\vc_mswuddll\wxexpat\ - - - .\..\..\lib\vc_lib\ - .\vc_mswd\wxexpat\ - - - .\..\..\lib\vc_lib\ - .\vc_mswd\wxexpat\ - - - .\..\..\lib\vc_lib\ - .\vc_mswunivd\wxexpat\ - - - .\..\..\lib\vc_lib\ - .\vc_mswunivd\wxexpat\ - - - .\..\..\lib\vc_lib\ - .\vc_mswunivu\wxexpat\ - - - .\..\..\lib\vc_lib\ - .\vc_mswunivu\wxexpat\ - - - .\..\..\lib\vc_dll\ - .\vc_mswddll\wxexpat\ - - - .\..\..\lib\vc_dll\ - .\vc_mswddll\wxexpat\ - - - .\..\..\lib\vc_lib\ - .\vc_msw\wxexpat\ - - - .\..\..\lib\vc_lib\ - .\vc_msw\wxexpat\ - - - .\..\..\lib\vc_lib\ - .\vc_mswuniv\wxexpat\ - - - .\..\..\lib\vc_lib\ - .\vc_mswuniv\wxexpat\ - - - .\..\..\lib\vc_dll\ - .\vc_mswdll\wxexpat\ - - - .\..\..\lib\vc_dll\ - .\vc_mswdll\wxexpat\ - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - true - true - ..\..\lib\vc_dll;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;COMPILED_FROM_DSP;%(PreprocessorDefinitions) - .\vc_mswunivddll\wxexpat\ - .\vc_mswunivddll\wxexpat\wx_wxexpat.pch - .\vc_mswunivddll\wxexpat\ - ..\..\lib\vc_dll\wxexpatd.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_dll\wx_wxexpat.bsc - - - true - ..\..\lib\vc_dll\wxexpatd.lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - true - ..\..\lib\vc_dll;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;COMPILED_FROM_DSP;%(PreprocessorDefinitions) - .\vc_mswunivddll\wxexpat\ - .\vc_mswunivddll\wxexpat\wx_wxexpat.pch - .\vc_mswunivddll\wxexpat\ - ..\..\lib\vc_dll\wxexpatd.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_dll\wx_wxexpat.bsc - - - true - ..\..\lib\vc_dll\wxexpatd.lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - true - true - ..\..\lib\vc_lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;COMPILED_FROM_DSP;%(PreprocessorDefinitions) - .\vc_mswud\wxexpat\ - .\vc_mswud\wxexpat\wx_wxexpat.pch - .\vc_mswud\wxexpat\ - ..\..\lib\vc_lib\wxexpatd.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_wxexpat.bsc - - - true - ..\..\lib\vc_lib\wxexpatd.lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - true - ..\..\lib\vc_lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;COMPILED_FROM_DSP;%(PreprocessorDefinitions) - .\vc_mswud\wxexpat\ - .\vc_mswud\wxexpat\wx_wxexpat.pch - .\vc_mswud\wxexpat\ - ..\..\lib\vc_lib\wxexpatd.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_wxexpat.bsc - - - true - ..\..\lib\vc_lib\wxexpatd.lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - true - ..\..\lib\vc_dll;%(AdditionalIncludeDirectories) - WIN32;_LIB;COMPILED_FROM_DSP;%(PreprocessorDefinitions) - .\vc_mswudll\wxexpat\ - .\vc_mswudll\wxexpat\wx_wxexpat.pch - .\vc_mswudll\wxexpat\ - ..\..\lib\vc_dll\wxexpat.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_dll\wx_wxexpat.bsc - - - true - ..\..\lib\vc_dll\wxexpat.lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - true - ..\..\lib\vc_dll;%(AdditionalIncludeDirectories) - WIN32;_LIB;COMPILED_FROM_DSP;%(PreprocessorDefinitions) - .\vc_mswudll\wxexpat\ - .\vc_mswudll\wxexpat\wx_wxexpat.pch - .\vc_mswudll\wxexpat\ - ..\..\lib\vc_dll\wxexpat.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_dll\wx_wxexpat.bsc - - - true - ..\..\lib\vc_dll\wxexpat.lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - true - ..\..\lib\vc_lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;COMPILED_FROM_DSP;%(PreprocessorDefinitions) - .\vc_mswu\wxexpat\ - .\vc_mswu\wxexpat\wx_wxexpat.pch - .\vc_mswu\wxexpat\ - ..\..\lib\vc_lib\wxexpat.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_wxexpat.bsc - - - true - ..\..\lib\vc_lib\wxexpat.lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - true - ..\..\lib\vc_lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;COMPILED_FROM_DSP;%(PreprocessorDefinitions) - .\vc_mswu\wxexpat\ - .\vc_mswu\wxexpat\wx_wxexpat.pch - .\vc_mswu\wxexpat\ - ..\..\lib\vc_lib\wxexpat.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_wxexpat.bsc - - - true - ..\..\lib\vc_lib\wxexpat.lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - true - true - ..\..\lib\vc_lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;COMPILED_FROM_DSP;%(PreprocessorDefinitions) - .\vc_mswunivud\wxexpat\ - .\vc_mswunivud\wxexpat\wx_wxexpat.pch - .\vc_mswunivud\wxexpat\ - ..\..\lib\vc_lib\wxexpatd.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_wxexpat.bsc - - - true - ..\..\lib\vc_lib\wxexpatd.lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - true - ..\..\lib\vc_lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;COMPILED_FROM_DSP;%(PreprocessorDefinitions) - .\vc_mswunivud\wxexpat\ - .\vc_mswunivud\wxexpat\wx_wxexpat.pch - .\vc_mswunivud\wxexpat\ - ..\..\lib\vc_lib\wxexpatd.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_wxexpat.bsc - - - true - ..\..\lib\vc_lib\wxexpatd.lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - true - ..\..\lib\vc_dll;%(AdditionalIncludeDirectories) - WIN32;_LIB;COMPILED_FROM_DSP;%(PreprocessorDefinitions) - .\vc_mswunivudll\wxexpat\ - .\vc_mswunivudll\wxexpat\wx_wxexpat.pch - .\vc_mswunivudll\wxexpat\ - ..\..\lib\vc_dll\wxexpat.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_dll\wx_wxexpat.bsc - - - true - ..\..\lib\vc_dll\wxexpat.lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - true - ..\..\lib\vc_dll;%(AdditionalIncludeDirectories) - WIN32;_LIB;COMPILED_FROM_DSP;%(PreprocessorDefinitions) - .\vc_mswunivudll\wxexpat\ - .\vc_mswunivudll\wxexpat\wx_wxexpat.pch - .\vc_mswunivudll\wxexpat\ - ..\..\lib\vc_dll\wxexpat.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_dll\wx_wxexpat.bsc - - - true - ..\..\lib\vc_dll\wxexpat.lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - true - ..\..\lib\vc_dll;%(AdditionalIncludeDirectories) - WIN32;_LIB;COMPILED_FROM_DSP;%(PreprocessorDefinitions) - .\vc_mswunivdll\wxexpat\ - .\vc_mswunivdll\wxexpat\wx_wxexpat.pch - .\vc_mswunivdll\wxexpat\ - ..\..\lib\vc_dll\wxexpat.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_dll\wx_wxexpat.bsc - - - true - ..\..\lib\vc_dll\wxexpat.lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - true - ..\..\lib\vc_dll;%(AdditionalIncludeDirectories) - WIN32;_LIB;COMPILED_FROM_DSP;%(PreprocessorDefinitions) - .\vc_mswunivdll\wxexpat\ - .\vc_mswunivdll\wxexpat\wx_wxexpat.pch - .\vc_mswunivdll\wxexpat\ - ..\..\lib\vc_dll\wxexpat.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_dll\wx_wxexpat.bsc - - - true - ..\..\lib\vc_dll\wxexpat.lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - true - true - ..\..\lib\vc_dll;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;COMPILED_FROM_DSP;%(PreprocessorDefinitions) - .\vc_mswunivuddll\wxexpat\ - .\vc_mswunivuddll\wxexpat\wx_wxexpat.pch - .\vc_mswunivuddll\wxexpat\ - ..\..\lib\vc_dll\wxexpatd.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_dll\wx_wxexpat.bsc - - - true - ..\..\lib\vc_dll\wxexpatd.lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - true - ..\..\lib\vc_dll;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;COMPILED_FROM_DSP;%(PreprocessorDefinitions) - .\vc_mswunivuddll\wxexpat\ - .\vc_mswunivuddll\wxexpat\wx_wxexpat.pch - .\vc_mswunivuddll\wxexpat\ - ..\..\lib\vc_dll\wxexpatd.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_dll\wx_wxexpat.bsc - - - true - ..\..\lib\vc_dll\wxexpatd.lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - true - true - ..\..\lib\vc_dll;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;COMPILED_FROM_DSP;%(PreprocessorDefinitions) - .\vc_mswuddll\wxexpat\ - .\vc_mswuddll\wxexpat\wx_wxexpat.pch - .\vc_mswuddll\wxexpat\ - ..\..\lib\vc_dll\wxexpatd.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_dll\wx_wxexpat.bsc - - - true - ..\..\lib\vc_dll\wxexpatd.lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - true - ..\..\lib\vc_dll;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;COMPILED_FROM_DSP;%(PreprocessorDefinitions) - .\vc_mswuddll\wxexpat\ - .\vc_mswuddll\wxexpat\wx_wxexpat.pch - .\vc_mswuddll\wxexpat\ - ..\..\lib\vc_dll\wxexpatd.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_dll\wx_wxexpat.bsc - - - true - ..\..\lib\vc_dll\wxexpatd.lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - true - true - ..\..\lib\vc_lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;COMPILED_FROM_DSP;%(PreprocessorDefinitions) - .\vc_mswd\wxexpat\ - .\vc_mswd\wxexpat\wx_wxexpat.pch - .\vc_mswd\wxexpat\ - ..\..\lib\vc_lib\wxexpatd.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_wxexpat.bsc - - - true - .\..\..\..\libs\$(Configuration)\$(ProjectName).lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - true - ..\..\lib\vc_lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;COMPILED_FROM_DSP;%(PreprocessorDefinitions) - .\vc_mswd\wxexpat\ - .\vc_mswd\wxexpat\wx_wxexpat.pch - .\vc_mswd\wxexpat\ - ..\..\lib\vc_lib\wxexpatd.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_wxexpat.bsc - - - true - .\..\..\..\libs\$(Configuration)\$(ProjectName).lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - true - true - ..\..\lib\vc_lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;COMPILED_FROM_DSP;%(PreprocessorDefinitions) - .\vc_mswunivd\wxexpat\ - .\vc_mswunivd\wxexpat\wx_wxexpat.pch - .\vc_mswunivd\wxexpat\ - ..\..\lib\vc_lib\wxexpatd.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_wxexpat.bsc - - - true - ..\..\lib\vc_lib\wxexpatd.lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - true - ..\..\lib\vc_lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;COMPILED_FROM_DSP;%(PreprocessorDefinitions) - .\vc_mswunivd\wxexpat\ - .\vc_mswunivd\wxexpat\wx_wxexpat.pch - .\vc_mswunivd\wxexpat\ - ..\..\lib\vc_lib\wxexpatd.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_wxexpat.bsc - - - true - ..\..\lib\vc_lib\wxexpatd.lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - true - ..\..\lib\vc_lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;COMPILED_FROM_DSP;%(PreprocessorDefinitions) - .\vc_mswunivu\wxexpat\ - .\vc_mswunivu\wxexpat\wx_wxexpat.pch - .\vc_mswunivu\wxexpat\ - ..\..\lib\vc_lib\wxexpat.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_wxexpat.bsc - - - true - ..\..\lib\vc_lib\wxexpat.lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - true - ..\..\lib\vc_lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;COMPILED_FROM_DSP;%(PreprocessorDefinitions) - .\vc_mswunivu\wxexpat\ - .\vc_mswunivu\wxexpat\wx_wxexpat.pch - .\vc_mswunivu\wxexpat\ - ..\..\lib\vc_lib\wxexpat.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_wxexpat.bsc - - - true - ..\..\lib\vc_lib\wxexpat.lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - true - true - ..\..\lib\vc_dll;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;COMPILED_FROM_DSP;%(PreprocessorDefinitions) - .\vc_mswddll\wxexpat\ - .\vc_mswddll\wxexpat\wx_wxexpat.pch - .\vc_mswddll\wxexpat\ - ..\..\lib\vc_dll\wxexpatd.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_dll\wx_wxexpat.bsc - - - true - ..\..\lib\vc_dll\wxexpatd.lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - true - ..\..\lib\vc_dll;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;COMPILED_FROM_DSP;%(PreprocessorDefinitions) - .\vc_mswddll\wxexpat\ - .\vc_mswddll\wxexpat\wx_wxexpat.pch - .\vc_mswddll\wxexpat\ - ..\..\lib\vc_dll\wxexpatd.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_dll\wx_wxexpat.bsc - - - true - ..\..\lib\vc_dll\wxexpatd.lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - true - ..\..\lib\vc_lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;COMPILED_FROM_DSP;%(PreprocessorDefinitions) - .\vc_msw\wxexpat\ - .\vc_msw\wxexpat\wx_wxexpat.pch - .\vc_msw\wxexpat\ - ..\..\lib\vc_lib\wxexpat.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_wxexpat.bsc - - - true - .\..\..\..\libs\$(Configuration)\$(ProjectName).lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - true - ..\..\lib\vc_lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;COMPILED_FROM_DSP;%(PreprocessorDefinitions) - .\vc_msw\wxexpat\ - .\vc_msw\wxexpat\wx_wxexpat.pch - .\vc_msw\wxexpat\ - ..\..\lib\vc_lib\wxexpat.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_wxexpat.bsc - - - true - .\..\..\..\libs\$(Configuration)\$(ProjectName).lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - true - ..\..\lib\vc_lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;COMPILED_FROM_DSP;%(PreprocessorDefinitions) - .\vc_mswuniv\wxexpat\ - .\vc_mswuniv\wxexpat\wx_wxexpat.pch - .\vc_mswuniv\wxexpat\ - ..\..\lib\vc_lib\wxexpat.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_wxexpat.bsc - - - true - ..\..\lib\vc_lib\wxexpat.lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - true - ..\..\lib\vc_lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;COMPILED_FROM_DSP;%(PreprocessorDefinitions) - .\vc_mswuniv\wxexpat\ - .\vc_mswuniv\wxexpat\wx_wxexpat.pch - .\vc_mswuniv\wxexpat\ - ..\..\lib\vc_lib\wxexpat.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_wxexpat.bsc - - - true - ..\..\lib\vc_lib\wxexpat.lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - true - ..\..\lib\vc_dll;%(AdditionalIncludeDirectories) - WIN32;_LIB;COMPILED_FROM_DSP;%(PreprocessorDefinitions) - .\vc_mswdll\wxexpat\ - .\vc_mswdll\wxexpat\wx_wxexpat.pch - .\vc_mswdll\wxexpat\ - ..\..\lib\vc_dll\wxexpat.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_dll\wx_wxexpat.bsc - - - true - ..\..\lib\vc_dll\wxexpat.lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - true - ..\..\lib\vc_dll;%(AdditionalIncludeDirectories) - WIN32;_LIB;COMPILED_FROM_DSP;%(PreprocessorDefinitions) - .\vc_mswdll\wxexpat\ - .\vc_mswdll\wxexpat\wx_wxexpat.pch - .\vc_mswdll\wxexpat\ - ..\..\lib\vc_dll\wxexpat.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_dll\wx_wxexpat.bsc - - - true - ..\..\lib\vc_dll\wxexpat.lib - - - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - - - - \ No newline at end of file diff --git a/wxWidgets/build/msw/wx_wxexpat.vcxproj.filters b/wxWidgets/build/msw/wx_wxexpat.vcxproj.filters deleted file mode 100644 index 949adcf282..0000000000 --- a/wxWidgets/build/msw/wx_wxexpat.vcxproj.filters +++ /dev/null @@ -1,19 +0,0 @@ - - - - - {8a4fd1ba-2f11-41ca-b538-3fe2f95c88b4} - - - - - Source Files - - - Source Files - - - Source Files - - - \ No newline at end of file diff --git a/wxWidgets/build/msw/wx_wxjpeg.vcxproj b/wxWidgets/build/msw/wx_wxjpeg.vcxproj deleted file mode 100644 index 9d36152184..0000000000 --- a/wxWidgets/build/msw/wx_wxjpeg.vcxproj +++ /dev/null @@ -1,3071 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - DLL Debug - Win32 - - - DLL Debug - x64 - - - DLL Release - Win32 - - - DLL Release - x64 - - - DLL Unicode Debug - Win32 - - - DLL Unicode Debug - x64 - - - DLL Unicode Release - Win32 - - - DLL Unicode Release - x64 - - - DLL Universal Debug - Win32 - - - DLL Universal Debug - x64 - - - DLL Universal Release - Win32 - - - DLL Universal Release - x64 - - - DLL Universal Unicode Debug - Win32 - - - DLL Universal Unicode Debug - x64 - - - DLL Universal Unicode Release - Win32 - - - DLL Universal Unicode Release - x64 - - - Release - Win32 - - - Release - x64 - - - Template - Win32 - - - Template - x64 - - - Unicode Debug - Win32 - - - Unicode Debug - x64 - - - Unicode Release - Win32 - - - Unicode Release - x64 - - - Universal Debug - Win32 - - - Universal Debug - x64 - - - Universal Release - Win32 - - - Universal Release - x64 - - - Universal Unicode Debug - Win32 - - - Universal Unicode Debug - x64 - - - Universal Unicode Release - Win32 - - - Universal Unicode Release - x64 - - - - wxjpeg - - - {5C363C34-4741-7036-861C-2E2279CF552E} - - - - Application - v110 - - - Application - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - .\..\..\lib\vc_dll\ - .\vc_mswdll\wxjpeg\ - - - .\..\..\lib\vc_dll\ - .\vc_mswdll\wxjpeg\ - - - .\..\..\lib\vc_dll\ - .\vc_mswunivudll\wxjpeg\ - - - .\..\..\lib\vc_dll\ - .\vc_mswunivudll\wxjpeg\ - - - .\..\..\lib\vc_lib\ - .\vc_msw\wxjpeg\ - - - .\..\..\lib\vc_lib\ - .\vc_msw\wxjpeg\ - - - .\..\..\lib\vc_dll\ - .\vc_mswunivuddll\wxjpeg\ - - - .\..\..\lib\vc_dll\ - .\vc_mswunivuddll\wxjpeg\ - - - .\..\..\lib\vc_lib\ - .\vc_mswunivu\wxjpeg\ - - - .\..\..\lib\vc_lib\ - .\vc_mswunivu\wxjpeg\ - - - .\..\..\lib\vc_dll\ - .\vc_mswunivddll\wxjpeg\ - - - .\..\..\lib\vc_dll\ - .\vc_mswunivddll\wxjpeg\ - - - .\..\..\lib\vc_dll\ - .\vc_mswunivdll\wxjpeg\ - - - .\..\..\lib\vc_dll\ - .\vc_mswunivdll\wxjpeg\ - - - .\..\..\lib\vc_lib\ - .\vc_mswud\wxjpeg\ - - - .\..\..\lib\vc_lib\ - .\vc_mswud\wxjpeg\ - - - .\..\..\lib\vc_lib\ - .\vc_mswunivd\wxjpeg\ - - - .\..\..\lib\vc_lib\ - .\vc_mswunivd\wxjpeg\ - - - .\..\..\lib\vc_lib\ - .\vc_mswd\wxjpeg\ - - - .\..\..\lib\vc_lib\ - .\vc_mswd\wxjpeg\ - - - .\..\..\lib\vc_lib\ - .\vc_mswuniv\wxjpeg\ - - - .\..\..\lib\vc_lib\ - .\vc_mswuniv\wxjpeg\ - - - .\..\..\lib\vc_dll\ - .\vc_mswudll\wxjpeg\ - - - .\..\..\lib\vc_dll\ - .\vc_mswudll\wxjpeg\ - - - .\..\..\lib\vc_dll\ - .\vc_mswuddll\wxjpeg\ - - - .\..\..\lib\vc_dll\ - .\vc_mswuddll\wxjpeg\ - - - .\..\..\lib\vc_lib\ - .\vc_mswunivud\wxjpeg\ - - - .\..\..\lib\vc_lib\ - .\vc_mswunivud\wxjpeg\ - - - .\..\..\lib\vc_lib\ - .\vc_mswu\wxjpeg\ - - - .\..\..\lib\vc_lib\ - .\vc_mswu\wxjpeg\ - - - .\..\..\lib\vc_dll\ - .\vc_mswddll\wxjpeg\ - - - .\..\..\lib\vc_dll\ - .\vc_mswddll\wxjpeg\ - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - true - ..\..\lib\vc_dll\msw;%(AdditionalIncludeDirectories) - WIN32;_LIB;%(PreprocessorDefinitions) - .\vc_mswdll\wxjpeg\ - .\vc_mswdll\wxjpeg\wx_wxjpeg.pch - .\vc_mswdll\wxjpeg\ - ..\..\lib\vc_dll\wxjpeg.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_dll\wx_wxjpeg.bsc - - - true - ..\..\lib\vc_dll\wxjpeg.lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - true - ..\..\lib\vc_dll\msw;%(AdditionalIncludeDirectories) - WIN32;_LIB;%(PreprocessorDefinitions) - .\vc_mswdll\wxjpeg\ - .\vc_mswdll\wxjpeg\wx_wxjpeg.pch - .\vc_mswdll\wxjpeg\ - ..\..\lib\vc_dll\wxjpeg.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_dll\wx_wxjpeg.bsc - - - true - ..\..\lib\vc_dll\wxjpeg.lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - true - ..\..\lib\vc_dll\mswunivu;%(AdditionalIncludeDirectories) - WIN32;_LIB;%(PreprocessorDefinitions) - .\vc_mswunivudll\wxjpeg\ - .\vc_mswunivudll\wxjpeg\wx_wxjpeg.pch - .\vc_mswunivudll\wxjpeg\ - ..\..\lib\vc_dll\wxjpeg.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_dll\wx_wxjpeg.bsc - - - true - ..\..\lib\vc_dll\wxjpeg.lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - true - ..\..\lib\vc_dll\mswunivu;%(AdditionalIncludeDirectories) - WIN32;_LIB;%(PreprocessorDefinitions) - .\vc_mswunivudll\wxjpeg\ - .\vc_mswunivudll\wxjpeg\wx_wxjpeg.pch - .\vc_mswunivudll\wxjpeg\ - ..\..\lib\vc_dll\wxjpeg.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_dll\wx_wxjpeg.bsc - - - true - ..\..\lib\vc_dll\wxjpeg.lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - true - ..\..\lib\vc_lib\msw;%(AdditionalIncludeDirectories) - WIN32;_LIB;%(PreprocessorDefinitions) - .\vc_msw\wxjpeg\ - .\vc_msw\wxjpeg\wx_wxjpeg.pch - .\vc_msw\wxjpeg\ - ..\..\lib\vc_lib\wxjpeg.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_wxjpeg.bsc - - - true - .\..\..\..\libs\$(Configuration)\$(ProjectName).lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - true - ..\..\lib\vc_lib\msw;%(AdditionalIncludeDirectories) - WIN32;_LIB;%(PreprocessorDefinitions) - .\vc_msw\wxjpeg\ - .\vc_msw\wxjpeg\wx_wxjpeg.pch - .\vc_msw\wxjpeg\ - ..\..\lib\vc_lib\wxjpeg.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_wxjpeg.bsc - - - true - .\..\..\..\libs\$(Configuration)\$(ProjectName).lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - true - true - ..\..\lib\vc_dll\mswunivud;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;%(PreprocessorDefinitions) - .\vc_mswunivuddll\wxjpeg\ - .\vc_mswunivuddll\wxjpeg\wx_wxjpeg.pch - .\vc_mswunivuddll\wxjpeg\ - ..\..\lib\vc_dll\wxjpegd.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_dll\wx_wxjpeg.bsc - - - true - ..\..\lib\vc_dll\wxjpegd.lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - true - ..\..\lib\vc_dll\mswunivud;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;%(PreprocessorDefinitions) - .\vc_mswunivuddll\wxjpeg\ - .\vc_mswunivuddll\wxjpeg\wx_wxjpeg.pch - .\vc_mswunivuddll\wxjpeg\ - ..\..\lib\vc_dll\wxjpegd.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_dll\wx_wxjpeg.bsc - - - true - ..\..\lib\vc_dll\wxjpegd.lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - true - ..\..\lib\vc_lib\mswunivu;%(AdditionalIncludeDirectories) - WIN32;_LIB;%(PreprocessorDefinitions) - .\vc_mswunivu\wxjpeg\ - .\vc_mswunivu\wxjpeg\wx_wxjpeg.pch - .\vc_mswunivu\wxjpeg\ - ..\..\lib\vc_lib\wxjpeg.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_wxjpeg.bsc - - - true - ..\..\lib\vc_lib\wxjpeg.lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - true - ..\..\lib\vc_lib\mswunivu;%(AdditionalIncludeDirectories) - WIN32;_LIB;%(PreprocessorDefinitions) - .\vc_mswunivu\wxjpeg\ - .\vc_mswunivu\wxjpeg\wx_wxjpeg.pch - .\vc_mswunivu\wxjpeg\ - ..\..\lib\vc_lib\wxjpeg.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_wxjpeg.bsc - - - true - ..\..\lib\vc_lib\wxjpeg.lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - true - true - ..\..\lib\vc_dll\mswunivd;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;%(PreprocessorDefinitions) - .\vc_mswunivddll\wxjpeg\ - .\vc_mswunivddll\wxjpeg\wx_wxjpeg.pch - .\vc_mswunivddll\wxjpeg\ - ..\..\lib\vc_dll\wxjpegd.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_dll\wx_wxjpeg.bsc - - - true - ..\..\lib\vc_dll\wxjpegd.lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - true - ..\..\lib\vc_dll\mswunivd;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;%(PreprocessorDefinitions) - .\vc_mswunivddll\wxjpeg\ - .\vc_mswunivddll\wxjpeg\wx_wxjpeg.pch - .\vc_mswunivddll\wxjpeg\ - ..\..\lib\vc_dll\wxjpegd.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_dll\wx_wxjpeg.bsc - - - true - ..\..\lib\vc_dll\wxjpegd.lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - true - ..\..\lib\vc_dll\mswuniv;%(AdditionalIncludeDirectories) - WIN32;_LIB;%(PreprocessorDefinitions) - .\vc_mswunivdll\wxjpeg\ - .\vc_mswunivdll\wxjpeg\wx_wxjpeg.pch - .\vc_mswunivdll\wxjpeg\ - ..\..\lib\vc_dll\wxjpeg.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_dll\wx_wxjpeg.bsc - - - true - ..\..\lib\vc_dll\wxjpeg.lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - true - ..\..\lib\vc_dll\mswuniv;%(AdditionalIncludeDirectories) - WIN32;_LIB;%(PreprocessorDefinitions) - .\vc_mswunivdll\wxjpeg\ - .\vc_mswunivdll\wxjpeg\wx_wxjpeg.pch - .\vc_mswunivdll\wxjpeg\ - ..\..\lib\vc_dll\wxjpeg.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_dll\wx_wxjpeg.bsc - - - true - ..\..\lib\vc_dll\wxjpeg.lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - true - true - ..\..\lib\vc_lib\mswud;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;%(PreprocessorDefinitions) - .\vc_mswud\wxjpeg\ - .\vc_mswud\wxjpeg\wx_wxjpeg.pch - .\vc_mswud\wxjpeg\ - ..\..\lib\vc_lib\wxjpegd.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_wxjpeg.bsc - - - true - ..\..\lib\vc_lib\wxjpegd.lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - true - ..\..\lib\vc_lib\mswud;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;%(PreprocessorDefinitions) - .\vc_mswud\wxjpeg\ - .\vc_mswud\wxjpeg\wx_wxjpeg.pch - .\vc_mswud\wxjpeg\ - ..\..\lib\vc_lib\wxjpegd.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_wxjpeg.bsc - - - true - ..\..\lib\vc_lib\wxjpegd.lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - true - true - ..\..\lib\vc_lib\mswunivd;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;%(PreprocessorDefinitions) - .\vc_mswunivd\wxjpeg\ - .\vc_mswunivd\wxjpeg\wx_wxjpeg.pch - .\vc_mswunivd\wxjpeg\ - ..\..\lib\vc_lib\wxjpegd.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_wxjpeg.bsc - - - true - ..\..\lib\vc_lib\wxjpegd.lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - true - ..\..\lib\vc_lib\mswunivd;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;%(PreprocessorDefinitions) - .\vc_mswunivd\wxjpeg\ - .\vc_mswunivd\wxjpeg\wx_wxjpeg.pch - .\vc_mswunivd\wxjpeg\ - ..\..\lib\vc_lib\wxjpegd.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_wxjpeg.bsc - - - true - ..\..\lib\vc_lib\wxjpegd.lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - true - true - ..\..\lib\vc_lib\mswd;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;%(PreprocessorDefinitions) - .\vc_mswd\wxjpeg\ - .\vc_mswd\wxjpeg\wx_wxjpeg.pch - .\vc_mswd\wxjpeg\ - ..\..\lib\vc_lib\wxjpegd.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_wxjpeg.bsc - - - true - .\..\..\..\libs\$(Configuration)\$(ProjectName).lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - true - ..\..\lib\vc_lib\mswd;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;%(PreprocessorDefinitions) - .\vc_mswd\wxjpeg\ - .\vc_mswd\wxjpeg\wx_wxjpeg.pch - .\vc_mswd\wxjpeg\ - ..\..\lib\vc_lib\wxjpegd.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_wxjpeg.bsc - - - true - .\..\..\..\libs\$(Configuration)\$(ProjectName).lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - true - ..\..\lib\vc_lib\mswuniv;%(AdditionalIncludeDirectories) - WIN32;_LIB;%(PreprocessorDefinitions) - .\vc_mswuniv\wxjpeg\ - .\vc_mswuniv\wxjpeg\wx_wxjpeg.pch - .\vc_mswuniv\wxjpeg\ - ..\..\lib\vc_lib\wxjpeg.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_wxjpeg.bsc - - - true - ..\..\lib\vc_lib\wxjpeg.lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - true - ..\..\lib\vc_lib\mswuniv;%(AdditionalIncludeDirectories) - WIN32;_LIB;%(PreprocessorDefinitions) - .\vc_mswuniv\wxjpeg\ - .\vc_mswuniv\wxjpeg\wx_wxjpeg.pch - .\vc_mswuniv\wxjpeg\ - ..\..\lib\vc_lib\wxjpeg.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_wxjpeg.bsc - - - true - ..\..\lib\vc_lib\wxjpeg.lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - true - ..\..\lib\vc_dll\mswu;%(AdditionalIncludeDirectories) - WIN32;_LIB;%(PreprocessorDefinitions) - .\vc_mswudll\wxjpeg\ - .\vc_mswudll\wxjpeg\wx_wxjpeg.pch - .\vc_mswudll\wxjpeg\ - ..\..\lib\vc_dll\wxjpeg.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_dll\wx_wxjpeg.bsc - - - true - ..\..\lib\vc_dll\wxjpeg.lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - true - ..\..\lib\vc_dll\mswu;%(AdditionalIncludeDirectories) - WIN32;_LIB;%(PreprocessorDefinitions) - .\vc_mswudll\wxjpeg\ - .\vc_mswudll\wxjpeg\wx_wxjpeg.pch - .\vc_mswudll\wxjpeg\ - ..\..\lib\vc_dll\wxjpeg.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_dll\wx_wxjpeg.bsc - - - true - ..\..\lib\vc_dll\wxjpeg.lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - true - true - ..\..\lib\vc_dll\mswud;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;%(PreprocessorDefinitions) - .\vc_mswuddll\wxjpeg\ - .\vc_mswuddll\wxjpeg\wx_wxjpeg.pch - .\vc_mswuddll\wxjpeg\ - ..\..\lib\vc_dll\wxjpegd.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_dll\wx_wxjpeg.bsc - - - true - ..\..\lib\vc_dll\wxjpegd.lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - true - ..\..\lib\vc_dll\mswud;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;%(PreprocessorDefinitions) - .\vc_mswuddll\wxjpeg\ - .\vc_mswuddll\wxjpeg\wx_wxjpeg.pch - .\vc_mswuddll\wxjpeg\ - ..\..\lib\vc_dll\wxjpegd.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_dll\wx_wxjpeg.bsc - - - true - ..\..\lib\vc_dll\wxjpegd.lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - true - true - ..\..\lib\vc_lib\mswunivud;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;%(PreprocessorDefinitions) - .\vc_mswunivud\wxjpeg\ - .\vc_mswunivud\wxjpeg\wx_wxjpeg.pch - .\vc_mswunivud\wxjpeg\ - ..\..\lib\vc_lib\wxjpegd.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_wxjpeg.bsc - - - true - ..\..\lib\vc_lib\wxjpegd.lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - true - ..\..\lib\vc_lib\mswunivud;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;%(PreprocessorDefinitions) - .\vc_mswunivud\wxjpeg\ - .\vc_mswunivud\wxjpeg\wx_wxjpeg.pch - .\vc_mswunivud\wxjpeg\ - ..\..\lib\vc_lib\wxjpegd.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_wxjpeg.bsc - - - true - ..\..\lib\vc_lib\wxjpegd.lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - true - ..\..\lib\vc_lib\mswu;%(AdditionalIncludeDirectories) - WIN32;_LIB;%(PreprocessorDefinitions) - .\vc_mswu\wxjpeg\ - .\vc_mswu\wxjpeg\wx_wxjpeg.pch - .\vc_mswu\wxjpeg\ - ..\..\lib\vc_lib\wxjpeg.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_wxjpeg.bsc - - - true - ..\..\lib\vc_lib\wxjpeg.lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - true - ..\..\lib\vc_lib\mswu;%(AdditionalIncludeDirectories) - WIN32;_LIB;%(PreprocessorDefinitions) - .\vc_mswu\wxjpeg\ - .\vc_mswu\wxjpeg\wx_wxjpeg.pch - .\vc_mswu\wxjpeg\ - ..\..\lib\vc_lib\wxjpeg.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_wxjpeg.bsc - - - true - ..\..\lib\vc_lib\wxjpeg.lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - true - true - ..\..\lib\vc_dll\mswd;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;%(PreprocessorDefinitions) - .\vc_mswddll\wxjpeg\ - .\vc_mswddll\wxjpeg\wx_wxjpeg.pch - .\vc_mswddll\wxjpeg\ - ..\..\lib\vc_dll\wxjpegd.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_dll\wx_wxjpeg.bsc - - - true - ..\..\lib\vc_dll\wxjpegd.lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - true - ..\..\lib\vc_dll\mswd;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;%(PreprocessorDefinitions) - .\vc_mswddll\wxjpeg\ - .\vc_mswddll\wxjpeg\wx_wxjpeg.pch - .\vc_mswddll\wxjpeg\ - ..\..\lib\vc_dll\wxjpegd.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_dll\wx_wxjpeg.bsc - - - true - ..\..\lib\vc_dll\wxjpegd.lib - - - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - - - - \ No newline at end of file diff --git a/wxWidgets/build/msw/wx_wxjpeg.vcxproj.filters b/wxWidgets/build/msw/wx_wxjpeg.vcxproj.filters deleted file mode 100644 index 00b3e89dba..0000000000 --- a/wxWidgets/build/msw/wx_wxjpeg.vcxproj.filters +++ /dev/null @@ -1,148 +0,0 @@ - - - - - {4a19a073-3947-4fba-9105-d0f74fe25812} - - - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - \ No newline at end of file diff --git a/wxWidgets/build/msw/wx_wxpng.vcxproj b/wxWidgets/build/msw/wx_wxpng.vcxproj deleted file mode 100644 index cde597214a..0000000000 --- a/wxWidgets/build/msw/wx_wxpng.vcxproj +++ /dev/null @@ -1,2085 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - DLL Debug - Win32 - - - DLL Debug - x64 - - - DLL Release - Win32 - - - DLL Release - x64 - - - DLL Unicode Debug - Win32 - - - DLL Unicode Debug - x64 - - - DLL Unicode Release - Win32 - - - DLL Unicode Release - x64 - - - DLL Universal Debug - Win32 - - - DLL Universal Debug - x64 - - - DLL Universal Release - Win32 - - - DLL Universal Release - x64 - - - DLL Universal Unicode Debug - Win32 - - - DLL Universal Unicode Debug - x64 - - - DLL Universal Unicode Release - Win32 - - - DLL Universal Unicode Release - x64 - - - Release - Win32 - - - Release - x64 - - - Template - Win32 - - - Template - x64 - - - Unicode Debug - Win32 - - - Unicode Debug - x64 - - - Unicode Release - Win32 - - - Unicode Release - x64 - - - Universal Debug - Win32 - - - Universal Debug - x64 - - - Universal Release - Win32 - - - Universal Release - x64 - - - Universal Unicode Debug - Win32 - - - Universal Unicode Debug - x64 - - - Universal Unicode Release - Win32 - - - Universal Unicode Release - x64 - - - - wxpng - - - {76169FE8-0814-4F36-6409-699EF1A23001} - - - - Application - v110 - - - Application - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - .\..\..\lib\vc_lib\ - .\vc_mswunivud\wxpng\ - - - .\..\..\lib\vc_lib\ - .\vc_mswunivud\wxpng\ - - - .\..\..\lib\vc_lib\ - .\vc_msw\wxpng\ - - - .\..\..\lib\vc_lib\ - .\vc_msw\wxpng\ - - - .\..\..\lib\vc_dll\ - .\vc_mswunivuddll\wxpng\ - - - .\..\..\lib\vc_dll\ - .\vc_mswunivuddll\wxpng\ - - - .\..\..\lib\vc_lib\ - .\vc_mswd\wxpng\ - - - .\..\..\lib\vc_lib\ - .\vc_mswd\wxpng\ - - - .\..\..\lib\vc_lib\ - .\vc_mswunivd\wxpng\ - - - .\..\..\lib\vc_lib\ - .\vc_mswunivd\wxpng\ - - - .\..\..\lib\vc_dll\ - .\vc_mswudll\wxpng\ - - - .\..\..\lib\vc_dll\ - .\vc_mswudll\wxpng\ - - - .\..\..\lib\vc_dll\ - .\vc_mswdll\wxpng\ - - - .\..\..\lib\vc_dll\ - .\vc_mswdll\wxpng\ - - - .\..\..\lib\vc_dll\ - .\vc_mswuddll\wxpng\ - - - .\..\..\lib\vc_dll\ - .\vc_mswuddll\wxpng\ - - - .\..\..\lib\vc_dll\ - .\vc_mswunivdll\wxpng\ - - - .\..\..\lib\vc_dll\ - .\vc_mswunivdll\wxpng\ - - - .\..\..\lib\vc_dll\ - .\vc_mswunivddll\wxpng\ - - - .\..\..\lib\vc_dll\ - .\vc_mswunivddll\wxpng\ - - - .\..\..\lib\vc_lib\ - .\vc_mswud\wxpng\ - - - .\..\..\lib\vc_lib\ - .\vc_mswud\wxpng\ - - - .\..\..\lib\vc_lib\ - .\vc_mswu\wxpng\ - - - .\..\..\lib\vc_lib\ - .\vc_mswu\wxpng\ - - - .\..\..\lib\vc_lib\ - .\vc_mswuniv\wxpng\ - - - .\..\..\lib\vc_lib\ - .\vc_mswuniv\wxpng\ - - - .\..\..\lib\vc_lib\ - .\vc_mswunivu\wxpng\ - - - .\..\..\lib\vc_lib\ - .\vc_mswunivu\wxpng\ - - - .\..\..\lib\vc_dll\ - .\vc_mswunivudll\wxpng\ - - - .\..\..\lib\vc_dll\ - .\vc_mswunivudll\wxpng\ - - - .\..\..\lib\vc_dll\ - .\vc_mswddll\wxpng\ - - - .\..\..\lib\vc_dll\ - .\vc_mswddll\wxpng\ - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - true - true - ..\..\src\zlib;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;%(PreprocessorDefinitions) - .\vc_mswunivud\wxpng\ - .\vc_mswunivud\wxpng\wx_wxpng.pch - .\vc_mswunivud\wxpng\ - ..\..\lib\vc_lib\wxpngd.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_wxpng.bsc - - - true - ..\..\lib\vc_lib\wxpngd.lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - true - ..\..\src\zlib;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;%(PreprocessorDefinitions) - .\vc_mswunivud\wxpng\ - .\vc_mswunivud\wxpng\wx_wxpng.pch - .\vc_mswunivud\wxpng\ - ..\..\lib\vc_lib\wxpngd.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_wxpng.bsc - - - true - ..\..\lib\vc_lib\wxpngd.lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - true - ..\..\src\zlib;%(AdditionalIncludeDirectories) - WIN32;_LIB;%(PreprocessorDefinitions) - .\vc_msw\wxpng\ - .\vc_msw\wxpng\wx_wxpng.pch - .\vc_msw\wxpng\ - ..\..\lib\vc_lib\wxpng.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_wxpng.bsc - - - true - .\..\..\..\libs\$(Configuration)\$(ProjectName).lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - true - ..\..\src\zlib;%(AdditionalIncludeDirectories) - WIN32;_LIB;%(PreprocessorDefinitions) - .\vc_msw\wxpng\ - .\vc_msw\wxpng\wx_wxpng.pch - .\vc_msw\wxpng\ - ..\..\lib\vc_lib\wxpng.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_wxpng.bsc - - - true - .\..\..\..\libs\$(Configuration)\$(ProjectName).lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - true - true - ..\..\src\zlib;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;%(PreprocessorDefinitions) - .\vc_mswunivuddll\wxpng\ - .\vc_mswunivuddll\wxpng\wx_wxpng.pch - .\vc_mswunivuddll\wxpng\ - ..\..\lib\vc_dll\wxpngd.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_dll\wx_wxpng.bsc - - - true - ..\..\lib\vc_dll\wxpngd.lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - true - ..\..\src\zlib;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;%(PreprocessorDefinitions) - .\vc_mswunivuddll\wxpng\ - .\vc_mswunivuddll\wxpng\wx_wxpng.pch - .\vc_mswunivuddll\wxpng\ - ..\..\lib\vc_dll\wxpngd.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_dll\wx_wxpng.bsc - - - true - ..\..\lib\vc_dll\wxpngd.lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - true - true - ..\..\src\zlib;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;%(PreprocessorDefinitions) - .\vc_mswd\wxpng\ - .\vc_mswd\wxpng\wx_wxpng.pch - .\vc_mswd\wxpng\ - ..\..\lib\vc_lib\wxpngd.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_wxpng.bsc - - - true - .\..\..\..\libs\$(Configuration)\$(ProjectName).lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - true - ..\..\src\zlib;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;%(PreprocessorDefinitions) - .\vc_mswd\wxpng\ - .\vc_mswd\wxpng\wx_wxpng.pch - .\vc_mswd\wxpng\ - ..\..\lib\vc_lib\wxpngd.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_wxpng.bsc - - - true - .\..\..\..\libs\$(Configuration)\$(ProjectName).lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - true - true - ..\..\src\zlib;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;%(PreprocessorDefinitions) - .\vc_mswunivd\wxpng\ - .\vc_mswunivd\wxpng\wx_wxpng.pch - .\vc_mswunivd\wxpng\ - ..\..\lib\vc_lib\wxpngd.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_wxpng.bsc - - - true - ..\..\lib\vc_lib\wxpngd.lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - true - ..\..\src\zlib;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;%(PreprocessorDefinitions) - .\vc_mswunivd\wxpng\ - .\vc_mswunivd\wxpng\wx_wxpng.pch - .\vc_mswunivd\wxpng\ - ..\..\lib\vc_lib\wxpngd.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_wxpng.bsc - - - true - ..\..\lib\vc_lib\wxpngd.lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - true - ..\..\src\zlib;%(AdditionalIncludeDirectories) - WIN32;_LIB;%(PreprocessorDefinitions) - .\vc_mswudll\wxpng\ - .\vc_mswudll\wxpng\wx_wxpng.pch - .\vc_mswudll\wxpng\ - ..\..\lib\vc_dll\wxpng.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_dll\wx_wxpng.bsc - - - true - ..\..\lib\vc_dll\wxpng.lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - true - ..\..\src\zlib;%(AdditionalIncludeDirectories) - WIN32;_LIB;%(PreprocessorDefinitions) - .\vc_mswudll\wxpng\ - .\vc_mswudll\wxpng\wx_wxpng.pch - .\vc_mswudll\wxpng\ - ..\..\lib\vc_dll\wxpng.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_dll\wx_wxpng.bsc - - - true - ..\..\lib\vc_dll\wxpng.lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - true - ..\..\src\zlib;%(AdditionalIncludeDirectories) - WIN32;_LIB;%(PreprocessorDefinitions) - .\vc_mswdll\wxpng\ - .\vc_mswdll\wxpng\wx_wxpng.pch - .\vc_mswdll\wxpng\ - ..\..\lib\vc_dll\wxpng.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_dll\wx_wxpng.bsc - - - true - ..\..\lib\vc_dll\wxpng.lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - true - ..\..\src\zlib;%(AdditionalIncludeDirectories) - WIN32;_LIB;%(PreprocessorDefinitions) - .\vc_mswdll\wxpng\ - .\vc_mswdll\wxpng\wx_wxpng.pch - .\vc_mswdll\wxpng\ - ..\..\lib\vc_dll\wxpng.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_dll\wx_wxpng.bsc - - - true - ..\..\lib\vc_dll\wxpng.lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - true - true - ..\..\src\zlib;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;%(PreprocessorDefinitions) - .\vc_mswuddll\wxpng\ - .\vc_mswuddll\wxpng\wx_wxpng.pch - .\vc_mswuddll\wxpng\ - ..\..\lib\vc_dll\wxpngd.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_dll\wx_wxpng.bsc - - - true - ..\..\lib\vc_dll\wxpngd.lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - true - ..\..\src\zlib;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;%(PreprocessorDefinitions) - .\vc_mswuddll\wxpng\ - .\vc_mswuddll\wxpng\wx_wxpng.pch - .\vc_mswuddll\wxpng\ - ..\..\lib\vc_dll\wxpngd.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_dll\wx_wxpng.bsc - - - true - ..\..\lib\vc_dll\wxpngd.lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - true - ..\..\src\zlib;%(AdditionalIncludeDirectories) - WIN32;_LIB;%(PreprocessorDefinitions) - .\vc_mswunivdll\wxpng\ - .\vc_mswunivdll\wxpng\wx_wxpng.pch - .\vc_mswunivdll\wxpng\ - ..\..\lib\vc_dll\wxpng.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_dll\wx_wxpng.bsc - - - true - ..\..\lib\vc_dll\wxpng.lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - true - ..\..\src\zlib;%(AdditionalIncludeDirectories) - WIN32;_LIB;%(PreprocessorDefinitions) - .\vc_mswunivdll\wxpng\ - .\vc_mswunivdll\wxpng\wx_wxpng.pch - .\vc_mswunivdll\wxpng\ - ..\..\lib\vc_dll\wxpng.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_dll\wx_wxpng.bsc - - - true - ..\..\lib\vc_dll\wxpng.lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - true - true - ..\..\src\zlib;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;%(PreprocessorDefinitions) - .\vc_mswunivddll\wxpng\ - .\vc_mswunivddll\wxpng\wx_wxpng.pch - .\vc_mswunivddll\wxpng\ - ..\..\lib\vc_dll\wxpngd.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_dll\wx_wxpng.bsc - - - true - ..\..\lib\vc_dll\wxpngd.lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - true - ..\..\src\zlib;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;%(PreprocessorDefinitions) - .\vc_mswunivddll\wxpng\ - .\vc_mswunivddll\wxpng\wx_wxpng.pch - .\vc_mswunivddll\wxpng\ - ..\..\lib\vc_dll\wxpngd.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_dll\wx_wxpng.bsc - - - true - ..\..\lib\vc_dll\wxpngd.lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - true - true - ..\..\src\zlib;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;%(PreprocessorDefinitions) - .\vc_mswud\wxpng\ - .\vc_mswud\wxpng\wx_wxpng.pch - .\vc_mswud\wxpng\ - ..\..\lib\vc_lib\wxpngd.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_wxpng.bsc - - - true - ..\..\lib\vc_lib\wxpngd.lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - true - ..\..\src\zlib;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;%(PreprocessorDefinitions) - .\vc_mswud\wxpng\ - .\vc_mswud\wxpng\wx_wxpng.pch - .\vc_mswud\wxpng\ - ..\..\lib\vc_lib\wxpngd.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_wxpng.bsc - - - true - ..\..\lib\vc_lib\wxpngd.lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - true - ..\..\src\zlib;%(AdditionalIncludeDirectories) - WIN32;_LIB;%(PreprocessorDefinitions) - .\vc_mswu\wxpng\ - .\vc_mswu\wxpng\wx_wxpng.pch - .\vc_mswu\wxpng\ - ..\..\lib\vc_lib\wxpng.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_wxpng.bsc - - - true - ..\..\lib\vc_lib\wxpng.lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - true - ..\..\src\zlib;%(AdditionalIncludeDirectories) - WIN32;_LIB;%(PreprocessorDefinitions) - .\vc_mswu\wxpng\ - .\vc_mswu\wxpng\wx_wxpng.pch - .\vc_mswu\wxpng\ - ..\..\lib\vc_lib\wxpng.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_wxpng.bsc - - - true - ..\..\lib\vc_lib\wxpng.lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - true - ..\..\src\zlib;%(AdditionalIncludeDirectories) - WIN32;_LIB;%(PreprocessorDefinitions) - .\vc_mswuniv\wxpng\ - .\vc_mswuniv\wxpng\wx_wxpng.pch - .\vc_mswuniv\wxpng\ - ..\..\lib\vc_lib\wxpng.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_wxpng.bsc - - - true - ..\..\lib\vc_lib\wxpng.lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - true - ..\..\src\zlib;%(AdditionalIncludeDirectories) - WIN32;_LIB;%(PreprocessorDefinitions) - .\vc_mswuniv\wxpng\ - .\vc_mswuniv\wxpng\wx_wxpng.pch - .\vc_mswuniv\wxpng\ - ..\..\lib\vc_lib\wxpng.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_wxpng.bsc - - - true - ..\..\lib\vc_lib\wxpng.lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - true - ..\..\src\zlib;%(AdditionalIncludeDirectories) - WIN32;_LIB;%(PreprocessorDefinitions) - .\vc_mswunivu\wxpng\ - .\vc_mswunivu\wxpng\wx_wxpng.pch - .\vc_mswunivu\wxpng\ - ..\..\lib\vc_lib\wxpng.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_wxpng.bsc - - - true - ..\..\lib\vc_lib\wxpng.lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - true - ..\..\src\zlib;%(AdditionalIncludeDirectories) - WIN32;_LIB;%(PreprocessorDefinitions) - .\vc_mswunivu\wxpng\ - .\vc_mswunivu\wxpng\wx_wxpng.pch - .\vc_mswunivu\wxpng\ - ..\..\lib\vc_lib\wxpng.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_wxpng.bsc - - - true - ..\..\lib\vc_lib\wxpng.lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - true - ..\..\src\zlib;%(AdditionalIncludeDirectories) - WIN32;_LIB;%(PreprocessorDefinitions) - .\vc_mswunivudll\wxpng\ - .\vc_mswunivudll\wxpng\wx_wxpng.pch - .\vc_mswunivudll\wxpng\ - ..\..\lib\vc_dll\wxpng.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_dll\wx_wxpng.bsc - - - true - ..\..\lib\vc_dll\wxpng.lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - true - ..\..\src\zlib;%(AdditionalIncludeDirectories) - WIN32;_LIB;%(PreprocessorDefinitions) - .\vc_mswunivudll\wxpng\ - .\vc_mswunivudll\wxpng\wx_wxpng.pch - .\vc_mswunivudll\wxpng\ - ..\..\lib\vc_dll\wxpng.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_dll\wx_wxpng.bsc - - - true - ..\..\lib\vc_dll\wxpng.lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - true - true - ..\..\src\zlib;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;%(PreprocessorDefinitions) - .\vc_mswddll\wxpng\ - .\vc_mswddll\wxpng\wx_wxpng.pch - .\vc_mswddll\wxpng\ - ..\..\lib\vc_dll\wxpngd.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_dll\wx_wxpng.bsc - - - true - ..\..\lib\vc_dll\wxpngd.lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - true - ..\..\src\zlib;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;%(PreprocessorDefinitions) - .\vc_mswddll\wxpng\ - .\vc_mswddll\wxpng\wx_wxpng.pch - .\vc_mswddll\wxpng\ - ..\..\lib\vc_dll\wxpngd.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_dll\wx_wxpng.bsc - - - true - ..\..\lib\vc_dll\wxpngd.lib - - - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - - - - \ No newline at end of file diff --git a/wxWidgets/build/msw/wx_wxpng.vcxproj.filters b/wxWidgets/build/msw/wx_wxpng.vcxproj.filters deleted file mode 100644 index 6f2081f674..0000000000 --- a/wxWidgets/build/msw/wx_wxpng.vcxproj.filters +++ /dev/null @@ -1,61 +0,0 @@ - - - - - {6b0d3caa-b3b3-48b2-b592-891799023b22} - - - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - \ No newline at end of file diff --git a/wxWidgets/build/msw/wx_wxregex.vcxproj b/wxWidgets/build/msw/wx_wxregex.vcxproj deleted file mode 100644 index 9e61d48ff8..0000000000 --- a/wxWidgets/build/msw/wx_wxregex.vcxproj +++ /dev/null @@ -1,1837 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - DLL Debug - Win32 - - - DLL Debug - x64 - - - DLL Release - Win32 - - - DLL Release - x64 - - - DLL Unicode Debug - Win32 - - - DLL Unicode Debug - x64 - - - DLL Unicode Release - Win32 - - - DLL Unicode Release - x64 - - - DLL Universal Debug - Win32 - - - DLL Universal Debug - x64 - - - DLL Universal Release - Win32 - - - DLL Universal Release - x64 - - - DLL Universal Unicode Debug - Win32 - - - DLL Universal Unicode Debug - x64 - - - DLL Universal Unicode Release - Win32 - - - DLL Universal Unicode Release - x64 - - - Release - Win32 - - - Release - x64 - - - Unicode Debug - Win32 - - - Unicode Debug - x64 - - - Unicode Release - Win32 - - - Unicode Release - x64 - - - Universal Debug - Win32 - - - Universal Debug - x64 - - - Universal Release - Win32 - - - Universal Release - x64 - - - Universal Unicode Debug - Win32 - - - Universal Unicode Debug - x64 - - - Universal Unicode Release - Win32 - - - Universal Unicode Release - x64 - - - - wxregex - - - {949C6DB8-E638-6EC6-AB31-BCCFD1379E01} - - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - Unicode - v110 - - - StaticLibrary - false - Unicode - v110 - - - StaticLibrary - false - Unicode - v110 - - - StaticLibrary - false - Unicode - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - Unicode - v110 - - - StaticLibrary - false - Unicode - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - Unicode - v110 - - - StaticLibrary - false - Unicode - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - Unicode - v110 - - - StaticLibrary - false - Unicode - v110 - - - StaticLibrary - false - Unicode - v110 - - - StaticLibrary - false - Unicode - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - Unicode - v110 - - - StaticLibrary - false - Unicode - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - Unicode - v110 - - - StaticLibrary - false - Unicode - v110 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - .\..\..\lib\vc_dll\ - .\vc_mswunivudll\wxregex\ - - - .\..\..\lib\vc_dll\ - .\vc_mswunivudll\wxregex\ - - - .\..\..\lib\vc_lib\ - .\vc_mswunivd\wxregex\ - - - .\..\..\lib\vc_lib\ - .\vc_mswunivd\wxregex\ - - - .\..\..\lib\vc_dll\ - .\vc_mswdll\wxregex\ - - - .\..\..\lib\vc_dll\ - .\vc_mswdll\wxregex\ - - - .\..\..\lib\vc_dll\ - .\vc_mswuddll\wxregex\ - - - .\..\..\lib\vc_dll\ - .\vc_mswuddll\wxregex\ - - - .\..\..\lib\vc_dll\ - .\vc_mswunivdll\wxregex\ - - - .\..\..\lib\vc_dll\ - .\vc_mswunivdll\wxregex\ - - - .\..\..\lib\vc_lib\ - .\vc_mswunivud\wxregex\ - - - .\..\..\lib\vc_lib\ - .\vc_mswunivud\wxregex\ - - - .\..\..\lib\vc_lib\ - .\vc_mswud\wxregex\ - - - .\..\..\lib\vc_lib\ - .\vc_mswud\wxregex\ - - - .\..\..\lib\vc_lib\ - .\vc_mswuniv\wxregex\ - - - .\..\..\lib\vc_lib\ - .\vc_mswuniv\wxregex\ - - - .\..\..\lib\vc_dll\ - .\vc_mswunivuddll\wxregex\ - - - .\..\..\lib\vc_dll\ - .\vc_mswunivuddll\wxregex\ - - - .\..\..\lib\vc_dll\ - .\vc_mswddll\wxregex\ - - - .\..\..\lib\vc_dll\ - .\vc_mswddll\wxregex\ - - - .\..\..\lib\vc_dll\ - .\vc_mswudll\wxregex\ - - - .\..\..\lib\vc_dll\ - .\vc_mswudll\wxregex\ - - - .\..\..\lib\vc_lib\ - .\vc_mswd\wxregex\ - - - .\..\..\lib\vc_lib\ - .\vc_mswd\wxregex\ - - - .\..\..\lib\vc_lib\ - .\vc_msw\wxregex\ - - - .\..\..\lib\vc_lib\ - .\vc_msw\wxregex\ - - - .\..\..\lib\vc_lib\ - .\vc_mswu\wxregex\ - - - .\..\..\lib\vc_lib\ - .\vc_mswu\wxregex\ - - - .\..\..\lib\vc_lib\ - .\vc_mswunivu\wxregex\ - - - .\..\..\lib\vc_lib\ - .\vc_mswunivu\wxregex\ - - - .\..\..\lib\vc_dll\ - .\vc_mswunivddll\wxregex\ - - - .\..\..\lib\vc_dll\ - .\vc_mswunivddll\wxregex\ - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - true - ..\..\include;..\..\lib\vc_dll\mswunivu;%(AdditionalIncludeDirectories) - WIN32;_LIB;__WXMSW__;__WXUNIVERSAL__;%(PreprocessorDefinitions) - .\vc_mswunivudll\wxregex\ - .\vc_mswunivudll\wxregex\wx_wxregex.pch - .\vc_mswunivudll\wxregex\ - ..\..\lib\vc_dll\wxregexu.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_dll\wx_wxregex.bsc - - - true - ..\..\lib\vc_dll\wxregexu.lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - true - ..\..\include;..\..\lib\vc_dll\mswunivu;%(AdditionalIncludeDirectories) - WIN32;_LIB;__WXMSW__;__WXUNIVERSAL__;%(PreprocessorDefinitions) - .\vc_mswunivudll\wxregex\ - .\vc_mswunivudll\wxregex\wx_wxregex.pch - .\vc_mswunivudll\wxregex\ - ..\..\lib\vc_dll\wxregexu.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_dll\wx_wxregex.bsc - - - true - ..\..\lib\vc_dll\wxregexu.lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - true - true - ..\..\include;..\..\lib\vc_lib\mswunivd;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;__WXMSW__;__WXUNIVERSAL__;%(PreprocessorDefinitions) - .\vc_mswunivd\wxregex\ - .\vc_mswunivd\wxregex\wx_wxregex.pch - .\vc_mswunivd\wxregex\ - ..\..\lib\vc_lib\wxregexd.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_wxregex.bsc - - - true - ..\..\lib\vc_lib\wxregexd.lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - true - ..\..\include;..\..\lib\vc_lib\mswunivd;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;__WXMSW__;__WXUNIVERSAL__;%(PreprocessorDefinitions) - .\vc_mswunivd\wxregex\ - .\vc_mswunivd\wxregex\wx_wxregex.pch - .\vc_mswunivd\wxregex\ - ..\..\lib\vc_lib\wxregexd.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_wxregex.bsc - - - true - ..\..\lib\vc_lib\wxregexd.lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - true - ..\..\include;..\..\lib\vc_dll\msw;%(AdditionalIncludeDirectories) - WIN32;_LIB;__WXMSW__;%(PreprocessorDefinitions) - .\vc_mswdll\wxregex\ - .\vc_mswdll\wxregex\wx_wxregex.pch - .\vc_mswdll\wxregex\ - ..\..\lib\vc_dll\wxregex.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_dll\wx_wxregex.bsc - - - true - ..\..\lib\vc_dll\wxregex.lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - true - ..\..\include;..\..\lib\vc_dll\msw;%(AdditionalIncludeDirectories) - WIN32;_LIB;__WXMSW__;%(PreprocessorDefinitions) - .\vc_mswdll\wxregex\ - .\vc_mswdll\wxregex\wx_wxregex.pch - .\vc_mswdll\wxregex\ - ..\..\lib\vc_dll\wxregex.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_dll\wx_wxregex.bsc - - - true - ..\..\lib\vc_dll\wxregex.lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - true - true - ..\..\include;..\..\lib\vc_dll\mswud;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;__WXMSW__;%(PreprocessorDefinitions) - .\vc_mswuddll\wxregex\ - .\vc_mswuddll\wxregex\wx_wxregex.pch - .\vc_mswuddll\wxregex\ - ..\..\lib\vc_dll\wxregexud.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_dll\wx_wxregex.bsc - - - true - ..\..\lib\vc_dll\wxregexud.lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - true - ..\..\include;..\..\lib\vc_dll\mswud;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;__WXMSW__;%(PreprocessorDefinitions) - .\vc_mswuddll\wxregex\ - .\vc_mswuddll\wxregex\wx_wxregex.pch - .\vc_mswuddll\wxregex\ - ..\..\lib\vc_dll\wxregexud.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_dll\wx_wxregex.bsc - - - true - ..\..\lib\vc_dll\wxregexud.lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - true - ..\..\include;..\..\lib\vc_dll\mswuniv;%(AdditionalIncludeDirectories) - WIN32;_LIB;__WXMSW__;__WXUNIVERSAL__;%(PreprocessorDefinitions) - .\vc_mswunivdll\wxregex\ - .\vc_mswunivdll\wxregex\wx_wxregex.pch - .\vc_mswunivdll\wxregex\ - ..\..\lib\vc_dll\wxregex.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_dll\wx_wxregex.bsc - - - true - ..\..\lib\vc_dll\wxregex.lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - true - ..\..\include;..\..\lib\vc_dll\mswuniv;%(AdditionalIncludeDirectories) - WIN32;_LIB;__WXMSW__;__WXUNIVERSAL__;%(PreprocessorDefinitions) - .\vc_mswunivdll\wxregex\ - .\vc_mswunivdll\wxregex\wx_wxregex.pch - .\vc_mswunivdll\wxregex\ - ..\..\lib\vc_dll\wxregex.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_dll\wx_wxregex.bsc - - - true - ..\..\lib\vc_dll\wxregex.lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - true - true - ..\..\include;..\..\lib\vc_lib\mswunivud;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;__WXMSW__;__WXUNIVERSAL__;%(PreprocessorDefinitions) - .\vc_mswunivud\wxregex\ - .\vc_mswunivud\wxregex\wx_wxregex.pch - .\vc_mswunivud\wxregex\ - ..\..\lib\vc_lib\wxregexud.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_wxregex.bsc - - - true - ..\..\lib\vc_lib\wxregexud.lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - true - ..\..\include;..\..\lib\vc_lib\mswunivud;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;__WXMSW__;__WXUNIVERSAL__;%(PreprocessorDefinitions) - .\vc_mswunivud\wxregex\ - .\vc_mswunivud\wxregex\wx_wxregex.pch - .\vc_mswunivud\wxregex\ - ..\..\lib\vc_lib\wxregexud.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_wxregex.bsc - - - true - ..\..\lib\vc_lib\wxregexud.lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - true - true - ..\..\include;..\..\lib\vc_lib\mswud;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;__WXMSW__;%(PreprocessorDefinitions) - .\vc_mswud\wxregex\ - .\vc_mswud\wxregex\wx_wxregex.pch - .\vc_mswud\wxregex\ - ..\..\lib\vc_lib\wxregexud.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_wxregex.bsc - - - true - ..\..\lib\vc_lib\wxregexud.lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - true - ..\..\include;..\..\lib\vc_lib\mswud;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;__WXMSW__;%(PreprocessorDefinitions) - .\vc_mswud\wxregex\ - .\vc_mswud\wxregex\wx_wxregex.pch - .\vc_mswud\wxregex\ - ..\..\lib\vc_lib\wxregexud.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_wxregex.bsc - - - true - ..\..\lib\vc_lib\wxregexud.lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - true - ..\..\include;..\..\lib\vc_lib\mswuniv;%(AdditionalIncludeDirectories) - WIN32;_LIB;__WXMSW__;__WXUNIVERSAL__;%(PreprocessorDefinitions) - .\vc_mswuniv\wxregex\ - .\vc_mswuniv\wxregex\wx_wxregex.pch - .\vc_mswuniv\wxregex\ - ..\..\lib\vc_lib\wxregex.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_wxregex.bsc - - - true - ..\..\lib\vc_lib\wxregex.lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - true - ..\..\include;..\..\lib\vc_lib\mswuniv;%(AdditionalIncludeDirectories) - WIN32;_LIB;__WXMSW__;__WXUNIVERSAL__;%(PreprocessorDefinitions) - .\vc_mswuniv\wxregex\ - .\vc_mswuniv\wxregex\wx_wxregex.pch - .\vc_mswuniv\wxregex\ - ..\..\lib\vc_lib\wxregex.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_wxregex.bsc - - - true - ..\..\lib\vc_lib\wxregex.lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - true - true - ..\..\include;..\..\lib\vc_dll\mswunivud;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;__WXMSW__;__WXUNIVERSAL__;%(PreprocessorDefinitions) - .\vc_mswunivuddll\wxregex\ - .\vc_mswunivuddll\wxregex\wx_wxregex.pch - .\vc_mswunivuddll\wxregex\ - ..\..\lib\vc_dll\wxregexud.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_dll\wx_wxregex.bsc - - - true - ..\..\lib\vc_dll\wxregexud.lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - true - ..\..\include;..\..\lib\vc_dll\mswunivud;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;__WXMSW__;__WXUNIVERSAL__;%(PreprocessorDefinitions) - .\vc_mswunivuddll\wxregex\ - .\vc_mswunivuddll\wxregex\wx_wxregex.pch - .\vc_mswunivuddll\wxregex\ - ..\..\lib\vc_dll\wxregexud.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_dll\wx_wxregex.bsc - - - true - ..\..\lib\vc_dll\wxregexud.lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - true - true - ..\..\include;..\..\lib\vc_dll\mswd;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;__WXMSW__;%(PreprocessorDefinitions) - .\vc_mswddll\wxregex\ - .\vc_mswddll\wxregex\wx_wxregex.pch - .\vc_mswddll\wxregex\ - ..\..\lib\vc_dll\wxregexd.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_dll\wx_wxregex.bsc - - - true - ..\..\lib\vc_dll\wxregexd.lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - true - ..\..\include;..\..\lib\vc_dll\mswd;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;__WXMSW__;%(PreprocessorDefinitions) - .\vc_mswddll\wxregex\ - .\vc_mswddll\wxregex\wx_wxregex.pch - .\vc_mswddll\wxregex\ - ..\..\lib\vc_dll\wxregexd.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_dll\wx_wxregex.bsc - - - true - ..\..\lib\vc_dll\wxregexd.lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - true - ..\..\include;..\..\lib\vc_dll\mswu;%(AdditionalIncludeDirectories) - WIN32;_LIB;__WXMSW__;%(PreprocessorDefinitions) - .\vc_mswudll\wxregex\ - .\vc_mswudll\wxregex\wx_wxregex.pch - .\vc_mswudll\wxregex\ - ..\..\lib\vc_dll\wxregexu.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_dll\wx_wxregex.bsc - - - true - ..\..\lib\vc_dll\wxregexu.lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - true - ..\..\include;..\..\lib\vc_dll\mswu;%(AdditionalIncludeDirectories) - WIN32;_LIB;__WXMSW__;%(PreprocessorDefinitions) - .\vc_mswudll\wxregex\ - .\vc_mswudll\wxregex\wx_wxregex.pch - .\vc_mswudll\wxregex\ - ..\..\lib\vc_dll\wxregexu.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_dll\wx_wxregex.bsc - - - true - ..\..\lib\vc_dll\wxregexu.lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - true - true - ..\..\include;..\..\lib\vc_lib\mswd;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;__WXMSW__;%(PreprocessorDefinitions) - .\vc_mswd\wxregex\ - .\vc_mswd\wxregex\wx_wxregex.pch - .\vc_mswd\wxregex\ - ..\..\lib\vc_lib\wxregexd.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_wxregex.bsc - - - true - .\..\..\..\libs\$(Configuration)\$(ProjectName).lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - true - ..\..\include;..\..\lib\vc_lib\mswd;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;__WXMSW__;%(PreprocessorDefinitions) - .\vc_mswd\wxregex\ - .\vc_mswd\wxregex\wx_wxregex.pch - .\vc_mswd\wxregex\ - ..\..\lib\vc_lib\wxregexd.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_wxregex.bsc - - - true - .\..\..\..\libs\$(Configuration)\$(ProjectName).lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - true - ..\..\include;..\..\lib\vc_lib\msw;%(AdditionalIncludeDirectories) - WIN32;_LIB;__WXMSW__;%(PreprocessorDefinitions) - .\vc_msw\wxregex\ - .\vc_msw\wxregex\wx_wxregex.pch - .\vc_msw\wxregex\ - ..\..\lib\vc_lib\wxregex.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_wxregex.bsc - - - true - .\..\..\..\libs\$(Configuration)\$(ProjectName).lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - true - ..\..\include;..\..\lib\vc_lib\msw;%(AdditionalIncludeDirectories) - WIN32;_LIB;__WXMSW__;%(PreprocessorDefinitions) - .\vc_msw\wxregex\ - .\vc_msw\wxregex\wx_wxregex.pch - .\vc_msw\wxregex\ - ..\..\lib\vc_lib\wxregex.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_wxregex.bsc - - - true - .\..\..\..\libs\$(Configuration)\$(ProjectName).lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - true - ..\..\include;..\..\lib\vc_lib\mswu;%(AdditionalIncludeDirectories) - WIN32;_LIB;__WXMSW__;%(PreprocessorDefinitions) - .\vc_mswu\wxregex\ - .\vc_mswu\wxregex\wx_wxregex.pch - .\vc_mswu\wxregex\ - ..\..\lib\vc_lib\wxregexu.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_wxregex.bsc - - - true - ..\..\lib\vc_lib\wxregexu.lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - true - ..\..\include;..\..\lib\vc_lib\mswu;%(AdditionalIncludeDirectories) - WIN32;_LIB;__WXMSW__;%(PreprocessorDefinitions) - .\vc_mswu\wxregex\ - .\vc_mswu\wxregex\wx_wxregex.pch - .\vc_mswu\wxregex\ - ..\..\lib\vc_lib\wxregexu.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_wxregex.bsc - - - true - ..\..\lib\vc_lib\wxregexu.lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - true - ..\..\include;..\..\lib\vc_lib\mswunivu;%(AdditionalIncludeDirectories) - WIN32;_LIB;__WXMSW__;__WXUNIVERSAL__;%(PreprocessorDefinitions) - .\vc_mswunivu\wxregex\ - .\vc_mswunivu\wxregex\wx_wxregex.pch - .\vc_mswunivu\wxregex\ - ..\..\lib\vc_lib\wxregexu.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_wxregex.bsc - - - true - ..\..\lib\vc_lib\wxregexu.lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - true - ..\..\include;..\..\lib\vc_lib\mswunivu;%(AdditionalIncludeDirectories) - WIN32;_LIB;__WXMSW__;__WXUNIVERSAL__;%(PreprocessorDefinitions) - .\vc_mswunivu\wxregex\ - .\vc_mswunivu\wxregex\wx_wxregex.pch - .\vc_mswunivu\wxregex\ - ..\..\lib\vc_lib\wxregexu.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_wxregex.bsc - - - true - ..\..\lib\vc_lib\wxregexu.lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - true - true - ..\..\include;..\..\lib\vc_dll\mswunivd;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;__WXMSW__;__WXUNIVERSAL__;%(PreprocessorDefinitions) - .\vc_mswunivddll\wxregex\ - .\vc_mswunivddll\wxregex\wx_wxregex.pch - .\vc_mswunivddll\wxregex\ - ..\..\lib\vc_dll\wxregexd.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_dll\wx_wxregex.bsc - - - true - ..\..\lib\vc_dll\wxregexd.lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - true - ..\..\include;..\..\lib\vc_dll\mswunivd;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;__WXMSW__;__WXUNIVERSAL__;%(PreprocessorDefinitions) - .\vc_mswunivddll\wxregex\ - .\vc_mswunivddll\wxregex\wx_wxregex.pch - .\vc_mswunivddll\wxregex\ - ..\..\lib\vc_dll\wxregexd.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_dll\wx_wxregex.bsc - - - true - ..\..\lib\vc_dll\wxregexd.lib - - - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - - - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswunivu\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswunivu\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_dll\mswunivu\wx\msw\rcdefs.h - Creating ..\..\lib\vc_dll\mswunivu\wx\msw\rcdefs.h - ..\..\lib\vc_dll\mswunivu\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_dll\mswunivu\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswunivd\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswunivd\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_lib\mswunivd\wx\msw\rcdefs.h - Creating ..\..\lib\vc_lib\mswunivd\wx\msw\rcdefs.h - ..\..\lib\vc_lib\mswunivd\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_lib\mswunivd\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\msw\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\msw\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_dll\msw\wx\msw\rcdefs.h - Creating ..\..\lib\vc_dll\msw\wx\msw\rcdefs.h - ..\..\lib\vc_dll\msw\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_dll\msw\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswud\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswud\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_dll\mswud\wx\msw\rcdefs.h - Creating ..\..\lib\vc_dll\mswud\wx\msw\rcdefs.h - ..\..\lib\vc_dll\mswud\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_dll\mswud\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswuniv\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswuniv\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_dll\mswuniv\wx\msw\rcdefs.h - Creating ..\..\lib\vc_dll\mswuniv\wx\msw\rcdefs.h - ..\..\lib\vc_dll\mswuniv\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_dll\mswuniv\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswunivud\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswunivud\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_lib\mswunivud\wx\msw\rcdefs.h - Creating ..\..\lib\vc_lib\mswunivud\wx\msw\rcdefs.h - ..\..\lib\vc_lib\mswunivud\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_lib\mswunivud\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswud\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswud\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_lib\mswud\wx\msw\rcdefs.h - Creating ..\..\lib\vc_lib\mswud\wx\msw\rcdefs.h - ..\..\lib\vc_lib\mswud\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_lib\mswud\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswuniv\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswuniv\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_lib\mswuniv\wx\msw\rcdefs.h - Creating ..\..\lib\vc_lib\mswuniv\wx\msw\rcdefs.h - ..\..\lib\vc_lib\mswuniv\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_lib\mswuniv\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswunivud\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswunivud\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_dll\mswunivud\wx\msw\rcdefs.h - Creating ..\..\lib\vc_dll\mswunivud\wx\msw\rcdefs.h - ..\..\lib\vc_dll\mswunivud\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_dll\mswunivud\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswd\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswd\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_dll\mswd\wx\msw\rcdefs.h - Creating ..\..\lib\vc_dll\mswd\wx\msw\rcdefs.h - ..\..\lib\vc_dll\mswd\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_dll\mswd\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswu\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswu\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_dll\mswu\wx\msw\rcdefs.h - Creating ..\..\lib\vc_dll\mswu\wx\msw\rcdefs.h - ..\..\lib\vc_dll\mswu\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_dll\mswu\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswd\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswd\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_lib\mswd\wx\msw\rcdefs.h - Creating ..\..\lib\vc_lib\mswd\wx\msw\rcdefs.h - ..\..\lib\vc_lib\mswd\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_lib\mswd\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\msw\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\msw\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_lib\msw\wx\msw\rcdefs.h - Creating ..\..\lib\vc_lib\msw\wx\msw\rcdefs.h - ..\..\lib\vc_lib\msw\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_lib\msw\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswu\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswu\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_lib\mswu\wx\msw\rcdefs.h - Creating ..\..\lib\vc_lib\mswu\wx\msw\rcdefs.h - ..\..\lib\vc_lib\mswu\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_lib\mswu\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswunivu\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswunivu\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_lib\mswunivu\wx\msw\rcdefs.h - Creating ..\..\lib\vc_lib\mswunivu\wx\msw\rcdefs.h - ..\..\lib\vc_lib\mswunivu\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_lib\mswunivu\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswunivd\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswunivd\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_dll\mswunivd\wx\msw\rcdefs.h - Creating ..\..\lib\vc_dll\mswunivd\wx\msw\rcdefs.h - ..\..\lib\vc_dll\mswunivd\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_dll\mswunivd\wx\msw\rcdefs.h;%(Outputs) - - - copy "%(FullPath)" ..\..\lib\vc_dll\msw\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_dll\msw\wx\setup.h - Creating ..\..\lib\vc_dll\msw\wx\setup.h - Creating ..\..\lib\vc_dll\msw\wx\setup.h - ..\..\lib\vc_dll\msw\wx\setup.h;%(Outputs) - ..\..\lib\vc_dll\msw\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_dll\mswud\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_dll\mswud\wx\setup.h - Creating ..\..\lib\vc_dll\mswud\wx\setup.h - Creating ..\..\lib\vc_dll\mswud\wx\setup.h - ..\..\lib\vc_dll\mswud\wx\setup.h;%(Outputs) - ..\..\lib\vc_dll\mswud\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_lib\mswud\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_lib\mswud\wx\setup.h - Creating ..\..\lib\vc_lib\mswud\wx\setup.h - Creating ..\..\lib\vc_lib\mswud\wx\setup.h - ..\..\lib\vc_lib\mswud\wx\setup.h;%(Outputs) - ..\..\lib\vc_lib\mswud\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_dll\mswd\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_dll\mswd\wx\setup.h - Creating ..\..\lib\vc_dll\mswd\wx\setup.h - Creating ..\..\lib\vc_dll\mswd\wx\setup.h - ..\..\lib\vc_dll\mswd\wx\setup.h;%(Outputs) - ..\..\lib\vc_dll\mswd\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_dll\mswu\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_dll\mswu\wx\setup.h - Creating ..\..\lib\vc_dll\mswu\wx\setup.h - Creating ..\..\lib\vc_dll\mswu\wx\setup.h - ..\..\lib\vc_dll\mswu\wx\setup.h;%(Outputs) - ..\..\lib\vc_dll\mswu\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_lib\mswd\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_lib\mswd\wx\setup.h - Creating ..\..\lib\vc_lib\mswd\wx\setup.h - Creating ..\..\lib\vc_lib\mswd\wx\setup.h - ..\..\lib\vc_lib\mswd\wx\setup.h;%(Outputs) - ..\..\lib\vc_lib\mswd\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_lib\msw\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_lib\msw\wx\setup.h - Creating ..\..\lib\vc_lib\msw\wx\setup.h - Creating ..\..\lib\vc_lib\msw\wx\setup.h - ..\..\lib\vc_lib\msw\wx\setup.h;%(Outputs) - ..\..\lib\vc_lib\msw\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_lib\mswu\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_lib\mswu\wx\setup.h - Creating ..\..\lib\vc_lib\mswu\wx\setup.h - Creating ..\..\lib\vc_lib\mswu\wx\setup.h - ..\..\lib\vc_lib\mswu\wx\setup.h;%(Outputs) - ..\..\lib\vc_lib\mswu\wx\setup.h;%(Outputs) - - - copy "%(FullPath)" ..\..\lib\vc_dll\mswunivu\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_dll\mswunivu\wx\setup.h - Creating ..\..\lib\vc_dll\mswunivu\wx\setup.h - Creating ..\..\lib\vc_dll\mswunivu\wx\setup.h - ..\..\lib\vc_dll\mswunivu\wx\setup.h;%(Outputs) - ..\..\lib\vc_dll\mswunivu\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_lib\mswunivd\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_lib\mswunivd\wx\setup.h - Creating ..\..\lib\vc_lib\mswunivd\wx\setup.h - Creating ..\..\lib\vc_lib\mswunivd\wx\setup.h - ..\..\lib\vc_lib\mswunivd\wx\setup.h;%(Outputs) - ..\..\lib\vc_lib\mswunivd\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_dll\mswuniv\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_dll\mswuniv\wx\setup.h - Creating ..\..\lib\vc_dll\mswuniv\wx\setup.h - Creating ..\..\lib\vc_dll\mswuniv\wx\setup.h - ..\..\lib\vc_dll\mswuniv\wx\setup.h;%(Outputs) - ..\..\lib\vc_dll\mswuniv\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_lib\mswunivud\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_lib\mswunivud\wx\setup.h - Creating ..\..\lib\vc_lib\mswunivud\wx\setup.h - Creating ..\..\lib\vc_lib\mswunivud\wx\setup.h - ..\..\lib\vc_lib\mswunivud\wx\setup.h;%(Outputs) - ..\..\lib\vc_lib\mswunivud\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_lib\mswuniv\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_lib\mswuniv\wx\setup.h - Creating ..\..\lib\vc_lib\mswuniv\wx\setup.h - Creating ..\..\lib\vc_lib\mswuniv\wx\setup.h - ..\..\lib\vc_lib\mswuniv\wx\setup.h;%(Outputs) - ..\..\lib\vc_lib\mswuniv\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_dll\mswunivud\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_dll\mswunivud\wx\setup.h - Creating ..\..\lib\vc_dll\mswunivud\wx\setup.h - Creating ..\..\lib\vc_dll\mswunivud\wx\setup.h - ..\..\lib\vc_dll\mswunivud\wx\setup.h;%(Outputs) - ..\..\lib\vc_dll\mswunivud\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_lib\mswunivu\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_lib\mswunivu\wx\setup.h - Creating ..\..\lib\vc_lib\mswunivu\wx\setup.h - Creating ..\..\lib\vc_lib\mswunivu\wx\setup.h - ..\..\lib\vc_lib\mswunivu\wx\setup.h;%(Outputs) - ..\..\lib\vc_lib\mswunivu\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_dll\mswunivd\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_dll\mswunivd\wx\setup.h - Creating ..\..\lib\vc_dll\mswunivd\wx\setup.h - Creating ..\..\lib\vc_dll\mswunivd\wx\setup.h - ..\..\lib\vc_dll\mswunivd\wx\setup.h;%(Outputs) - ..\..\lib\vc_dll\mswunivd\wx\setup.h;%(Outputs) - - - - - - \ No newline at end of file diff --git a/wxWidgets/build/msw/wx_wxregex.vcxproj.filters b/wxWidgets/build/msw/wx_wxregex.vcxproj.filters deleted file mode 100644 index c1ba430713..0000000000 --- a/wxWidgets/build/msw/wx_wxregex.vcxproj.filters +++ /dev/null @@ -1,36 +0,0 @@ - - - - - {d24becda-b44f-483b-8e04-37e268036929} - - - {e525b21d-00b7-4eae-9637-417dd71ed225} - - - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - - - Header Files - - - Header Files - - - Header Files - - - \ No newline at end of file diff --git a/wxWidgets/build/msw/wx_wxtiff.vcxproj b/wxWidgets/build/msw/wx_wxtiff.vcxproj deleted file mode 100644 index c971c37413..0000000000 --- a/wxWidgets/build/msw/wx_wxtiff.vcxproj +++ /dev/null @@ -1,2697 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - DLL Debug - Win32 - - - DLL Debug - x64 - - - DLL Release - Win32 - - - DLL Release - x64 - - - DLL Unicode Debug - Win32 - - - DLL Unicode Debug - x64 - - - DLL Unicode Release - Win32 - - - DLL Unicode Release - x64 - - - DLL Universal Debug - Win32 - - - DLL Universal Debug - x64 - - - DLL Universal Release - Win32 - - - DLL Universal Release - x64 - - - DLL Universal Unicode Debug - Win32 - - - DLL Universal Unicode Debug - x64 - - - DLL Universal Unicode Release - Win32 - - - DLL Universal Unicode Release - x64 - - - Release - Win32 - - - Release - x64 - - - Template - Win32 - - - Template - x64 - - - Unicode Debug - Win32 - - - Unicode Debug - x64 - - - Unicode Release - Win32 - - - Unicode Release - x64 - - - Universal Debug - Win32 - - - Universal Debug - x64 - - - Universal Release - Win32 - - - Universal Release - x64 - - - Universal Unicode Debug - Win32 - - - Universal Unicode Debug - x64 - - - Universal Unicode Release - Win32 - - - Universal Unicode Release - x64 - - - - wxtiff - - - {B87216CD-6C64-1DB0-D900-BC6E745C1DF9} - - - - Application - v110 - - - Application - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - .\..\..\lib\vc_dll\ - .\vc_mswddll\wxtiff\ - - - .\..\..\lib\vc_dll\ - .\vc_mswddll\wxtiff\ - - - .\..\..\lib\vc_dll\ - .\vc_mswuddll\wxtiff\ - - - .\..\..\lib\vc_dll\ - .\vc_mswuddll\wxtiff\ - - - .\..\..\lib\vc_dll\ - .\vc_mswudll\wxtiff\ - - - .\..\..\lib\vc_dll\ - .\vc_mswudll\wxtiff\ - - - .\..\..\lib\vc_lib\ - .\vc_mswunivud\wxtiff\ - - - .\..\..\lib\vc_lib\ - .\vc_mswunivud\wxtiff\ - - - .\..\..\lib\vc_lib\ - .\vc_mswu\wxtiff\ - - - .\..\..\lib\vc_lib\ - .\vc_mswu\wxtiff\ - - - .\..\..\lib\vc_lib\ - .\vc_mswunivu\wxtiff\ - - - .\..\..\lib\vc_lib\ - .\vc_mswunivu\wxtiff\ - - - .\..\..\lib\vc_dll\ - .\vc_mswdll\wxtiff\ - - - .\..\..\lib\vc_dll\ - .\vc_mswdll\wxtiff\ - - - .\..\..\lib\vc_dll\ - .\vc_mswunivdll\wxtiff\ - - - .\..\..\lib\vc_dll\ - .\vc_mswunivdll\wxtiff\ - - - .\..\..\lib\vc_dll\ - .\vc_mswunivddll\wxtiff\ - - - .\..\..\lib\vc_dll\ - .\vc_mswunivddll\wxtiff\ - - - .\..\..\lib\vc_lib\ - .\vc_mswd\wxtiff\ - - - .\..\..\lib\vc_lib\ - .\vc_mswd\wxtiff\ - - - .\..\..\lib\vc_lib\ - .\vc_msw\wxtiff\ - - - .\..\..\lib\vc_lib\ - .\vc_msw\wxtiff\ - - - .\..\..\lib\vc_lib\ - .\vc_mswunivd\wxtiff\ - - - .\..\..\lib\vc_lib\ - .\vc_mswunivd\wxtiff\ - - - .\..\..\lib\vc_dll\ - .\vc_mswunivuddll\wxtiff\ - - - .\..\..\lib\vc_dll\ - .\vc_mswunivuddll\wxtiff\ - - - .\..\..\lib\vc_lib\ - .\vc_mswud\wxtiff\ - - - .\..\..\lib\vc_lib\ - .\vc_mswud\wxtiff\ - - - .\..\..\lib\vc_lib\ - .\vc_mswuniv\wxtiff\ - - - .\..\..\lib\vc_lib\ - .\vc_mswuniv\wxtiff\ - - - .\..\..\lib\vc_dll\ - .\vc_mswunivudll\wxtiff\ - - - .\..\..\lib\vc_dll\ - .\vc_mswunivudll\wxtiff\ - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - true - true - ..\..\src\zlib;..\..\src\jpeg;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;%(PreprocessorDefinitions) - .\vc_mswddll\wxtiff\ - .\vc_mswddll\wxtiff\wx_wxtiff.pch - .\vc_mswddll\wxtiff\ - ..\..\lib\vc_dll\wxtiffd.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_dll\wx_wxtiff.bsc - - - true - ..\..\lib\vc_dll\wxtiffd.lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - true - ..\..\src\zlib;..\..\src\jpeg;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;%(PreprocessorDefinitions) - .\vc_mswddll\wxtiff\ - .\vc_mswddll\wxtiff\wx_wxtiff.pch - .\vc_mswddll\wxtiff\ - ..\..\lib\vc_dll\wxtiffd.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_dll\wx_wxtiff.bsc - - - true - ..\..\lib\vc_dll\wxtiffd.lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - true - true - ..\..\src\zlib;..\..\src\jpeg;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;%(PreprocessorDefinitions) - .\vc_mswuddll\wxtiff\ - .\vc_mswuddll\wxtiff\wx_wxtiff.pch - .\vc_mswuddll\wxtiff\ - ..\..\lib\vc_dll\wxtiffd.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_dll\wx_wxtiff.bsc - - - true - ..\..\lib\vc_dll\wxtiffd.lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - true - ..\..\src\zlib;..\..\src\jpeg;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;%(PreprocessorDefinitions) - .\vc_mswuddll\wxtiff\ - .\vc_mswuddll\wxtiff\wx_wxtiff.pch - .\vc_mswuddll\wxtiff\ - ..\..\lib\vc_dll\wxtiffd.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_dll\wx_wxtiff.bsc - - - true - ..\..\lib\vc_dll\wxtiffd.lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - true - ..\..\src\zlib;..\..\src\jpeg;%(AdditionalIncludeDirectories) - WIN32;_LIB;%(PreprocessorDefinitions) - .\vc_mswudll\wxtiff\ - .\vc_mswudll\wxtiff\wx_wxtiff.pch - .\vc_mswudll\wxtiff\ - ..\..\lib\vc_dll\wxtiff.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_dll\wx_wxtiff.bsc - - - true - ..\..\lib\vc_dll\wxtiff.lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - true - ..\..\src\zlib;..\..\src\jpeg;%(AdditionalIncludeDirectories) - WIN32;_LIB;%(PreprocessorDefinitions) - .\vc_mswudll\wxtiff\ - .\vc_mswudll\wxtiff\wx_wxtiff.pch - .\vc_mswudll\wxtiff\ - ..\..\lib\vc_dll\wxtiff.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_dll\wx_wxtiff.bsc - - - true - ..\..\lib\vc_dll\wxtiff.lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - true - true - ..\..\src\zlib;..\..\src\jpeg;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;%(PreprocessorDefinitions) - .\vc_mswunivud\wxtiff\ - .\vc_mswunivud\wxtiff\wx_wxtiff.pch - .\vc_mswunivud\wxtiff\ - ..\..\lib\vc_lib\wxtiffd.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_wxtiff.bsc - - - true - ..\..\lib\vc_lib\wxtiffd.lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - true - ..\..\src\zlib;..\..\src\jpeg;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;%(PreprocessorDefinitions) - .\vc_mswunivud\wxtiff\ - .\vc_mswunivud\wxtiff\wx_wxtiff.pch - .\vc_mswunivud\wxtiff\ - ..\..\lib\vc_lib\wxtiffd.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_wxtiff.bsc - - - true - ..\..\lib\vc_lib\wxtiffd.lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - true - ..\..\src\zlib;..\..\src\jpeg;%(AdditionalIncludeDirectories) - WIN32;_LIB;%(PreprocessorDefinitions) - .\vc_mswu\wxtiff\ - .\vc_mswu\wxtiff\wx_wxtiff.pch - .\vc_mswu\wxtiff\ - ..\..\lib\vc_lib\wxtiff.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_wxtiff.bsc - - - true - ..\..\lib\vc_lib\wxtiff.lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - true - ..\..\src\zlib;..\..\src\jpeg;%(AdditionalIncludeDirectories) - WIN32;_LIB;%(PreprocessorDefinitions) - .\vc_mswu\wxtiff\ - .\vc_mswu\wxtiff\wx_wxtiff.pch - .\vc_mswu\wxtiff\ - ..\..\lib\vc_lib\wxtiff.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_wxtiff.bsc - - - true - ..\..\lib\vc_lib\wxtiff.lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - true - ..\..\src\zlib;..\..\src\jpeg;%(AdditionalIncludeDirectories) - WIN32;_LIB;%(PreprocessorDefinitions) - .\vc_mswunivu\wxtiff\ - .\vc_mswunivu\wxtiff\wx_wxtiff.pch - .\vc_mswunivu\wxtiff\ - ..\..\lib\vc_lib\wxtiff.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_wxtiff.bsc - - - true - ..\..\lib\vc_lib\wxtiff.lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - true - ..\..\src\zlib;..\..\src\jpeg;%(AdditionalIncludeDirectories) - WIN32;_LIB;%(PreprocessorDefinitions) - .\vc_mswunivu\wxtiff\ - .\vc_mswunivu\wxtiff\wx_wxtiff.pch - .\vc_mswunivu\wxtiff\ - ..\..\lib\vc_lib\wxtiff.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_wxtiff.bsc - - - true - ..\..\lib\vc_lib\wxtiff.lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - true - ..\..\src\zlib;..\..\src\jpeg;%(AdditionalIncludeDirectories) - WIN32;_LIB;%(PreprocessorDefinitions) - .\vc_mswdll\wxtiff\ - .\vc_mswdll\wxtiff\wx_wxtiff.pch - .\vc_mswdll\wxtiff\ - ..\..\lib\vc_dll\wxtiff.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_dll\wx_wxtiff.bsc - - - true - ..\..\lib\vc_dll\wxtiff.lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - true - ..\..\src\zlib;..\..\src\jpeg;%(AdditionalIncludeDirectories) - WIN32;_LIB;%(PreprocessorDefinitions) - .\vc_mswdll\wxtiff\ - .\vc_mswdll\wxtiff\wx_wxtiff.pch - .\vc_mswdll\wxtiff\ - ..\..\lib\vc_dll\wxtiff.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_dll\wx_wxtiff.bsc - - - true - ..\..\lib\vc_dll\wxtiff.lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - true - ..\..\src\zlib;..\..\src\jpeg;%(AdditionalIncludeDirectories) - WIN32;_LIB;%(PreprocessorDefinitions) - .\vc_mswunivdll\wxtiff\ - .\vc_mswunivdll\wxtiff\wx_wxtiff.pch - .\vc_mswunivdll\wxtiff\ - ..\..\lib\vc_dll\wxtiff.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_dll\wx_wxtiff.bsc - - - true - ..\..\lib\vc_dll\wxtiff.lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - true - ..\..\src\zlib;..\..\src\jpeg;%(AdditionalIncludeDirectories) - WIN32;_LIB;%(PreprocessorDefinitions) - .\vc_mswunivdll\wxtiff\ - .\vc_mswunivdll\wxtiff\wx_wxtiff.pch - .\vc_mswunivdll\wxtiff\ - ..\..\lib\vc_dll\wxtiff.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_dll\wx_wxtiff.bsc - - - true - ..\..\lib\vc_dll\wxtiff.lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - true - true - ..\..\src\zlib;..\..\src\jpeg;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;%(PreprocessorDefinitions) - .\vc_mswunivddll\wxtiff\ - .\vc_mswunivddll\wxtiff\wx_wxtiff.pch - .\vc_mswunivddll\wxtiff\ - ..\..\lib\vc_dll\wxtiffd.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_dll\wx_wxtiff.bsc - - - true - ..\..\lib\vc_dll\wxtiffd.lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - true - ..\..\src\zlib;..\..\src\jpeg;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;%(PreprocessorDefinitions) - .\vc_mswunivddll\wxtiff\ - .\vc_mswunivddll\wxtiff\wx_wxtiff.pch - .\vc_mswunivddll\wxtiff\ - ..\..\lib\vc_dll\wxtiffd.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_dll\wx_wxtiff.bsc - - - true - ..\..\lib\vc_dll\wxtiffd.lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - true - true - ..\..\src\zlib;..\..\src\jpeg;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;%(PreprocessorDefinitions) - .\vc_mswd\wxtiff\ - .\vc_mswd\wxtiff\wx_wxtiff.pch - .\vc_mswd\wxtiff\ - ..\..\lib\vc_lib\wxtiffd.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_wxtiff.bsc - - - true - .\..\..\..\libs\$(Configuration)\$(ProjectName).lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - true - ..\..\src\zlib;..\..\src\jpeg;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;%(PreprocessorDefinitions) - .\vc_mswd\wxtiff\ - .\vc_mswd\wxtiff\wx_wxtiff.pch - .\vc_mswd\wxtiff\ - ..\..\lib\vc_lib\wxtiffd.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_wxtiff.bsc - - - true - .\..\..\..\libs\$(Configuration)\$(ProjectName).lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - true - ..\..\src\zlib;..\..\src\jpeg;%(AdditionalIncludeDirectories) - WIN32;_LIB;%(PreprocessorDefinitions) - .\vc_msw\wxtiff\ - .\vc_msw\wxtiff\wx_wxtiff.pch - .\vc_msw\wxtiff\ - ..\..\lib\vc_lib\wxtiff.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_wxtiff.bsc - - - true - .\..\..\..\libs\$(Configuration)\$(ProjectName).lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - true - ..\..\src\zlib;..\..\src\jpeg;%(AdditionalIncludeDirectories) - WIN32;_LIB;%(PreprocessorDefinitions) - .\vc_msw\wxtiff\ - .\vc_msw\wxtiff\wx_wxtiff.pch - .\vc_msw\wxtiff\ - ..\..\lib\vc_lib\wxtiff.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_wxtiff.bsc - - - true - .\..\..\..\libs\$(Configuration)\$(ProjectName).lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - true - true - ..\..\src\zlib;..\..\src\jpeg;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;%(PreprocessorDefinitions) - .\vc_mswunivd\wxtiff\ - .\vc_mswunivd\wxtiff\wx_wxtiff.pch - .\vc_mswunivd\wxtiff\ - ..\..\lib\vc_lib\wxtiffd.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_wxtiff.bsc - - - true - ..\..\lib\vc_lib\wxtiffd.lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - true - ..\..\src\zlib;..\..\src\jpeg;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;%(PreprocessorDefinitions) - .\vc_mswunivd\wxtiff\ - .\vc_mswunivd\wxtiff\wx_wxtiff.pch - .\vc_mswunivd\wxtiff\ - ..\..\lib\vc_lib\wxtiffd.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_wxtiff.bsc - - - true - ..\..\lib\vc_lib\wxtiffd.lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - true - true - ..\..\src\zlib;..\..\src\jpeg;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;%(PreprocessorDefinitions) - .\vc_mswunivuddll\wxtiff\ - .\vc_mswunivuddll\wxtiff\wx_wxtiff.pch - .\vc_mswunivuddll\wxtiff\ - ..\..\lib\vc_dll\wxtiffd.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_dll\wx_wxtiff.bsc - - - true - ..\..\lib\vc_dll\wxtiffd.lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - true - ..\..\src\zlib;..\..\src\jpeg;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;%(PreprocessorDefinitions) - .\vc_mswunivuddll\wxtiff\ - .\vc_mswunivuddll\wxtiff\wx_wxtiff.pch - .\vc_mswunivuddll\wxtiff\ - ..\..\lib\vc_dll\wxtiffd.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_dll\wx_wxtiff.bsc - - - true - ..\..\lib\vc_dll\wxtiffd.lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - true - true - ..\..\src\zlib;..\..\src\jpeg;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;%(PreprocessorDefinitions) - .\vc_mswud\wxtiff\ - .\vc_mswud\wxtiff\wx_wxtiff.pch - .\vc_mswud\wxtiff\ - ..\..\lib\vc_lib\wxtiffd.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_wxtiff.bsc - - - true - ..\..\lib\vc_lib\wxtiffd.lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - true - ..\..\src\zlib;..\..\src\jpeg;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;%(PreprocessorDefinitions) - .\vc_mswud\wxtiff\ - .\vc_mswud\wxtiff\wx_wxtiff.pch - .\vc_mswud\wxtiff\ - ..\..\lib\vc_lib\wxtiffd.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_wxtiff.bsc - - - true - ..\..\lib\vc_lib\wxtiffd.lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - true - ..\..\src\zlib;..\..\src\jpeg;%(AdditionalIncludeDirectories) - WIN32;_LIB;%(PreprocessorDefinitions) - .\vc_mswuniv\wxtiff\ - .\vc_mswuniv\wxtiff\wx_wxtiff.pch - .\vc_mswuniv\wxtiff\ - ..\..\lib\vc_lib\wxtiff.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_wxtiff.bsc - - - true - ..\..\lib\vc_lib\wxtiff.lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - true - ..\..\src\zlib;..\..\src\jpeg;%(AdditionalIncludeDirectories) - WIN32;_LIB;%(PreprocessorDefinitions) - .\vc_mswuniv\wxtiff\ - .\vc_mswuniv\wxtiff\wx_wxtiff.pch - .\vc_mswuniv\wxtiff\ - ..\..\lib\vc_lib\wxtiff.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_wxtiff.bsc - - - true - ..\..\lib\vc_lib\wxtiff.lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - true - ..\..\src\zlib;..\..\src\jpeg;%(AdditionalIncludeDirectories) - WIN32;_LIB;%(PreprocessorDefinitions) - .\vc_mswunivudll\wxtiff\ - .\vc_mswunivudll\wxtiff\wx_wxtiff.pch - .\vc_mswunivudll\wxtiff\ - ..\..\lib\vc_dll\wxtiff.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_dll\wx_wxtiff.bsc - - - true - ..\..\lib\vc_dll\wxtiff.lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - true - ..\..\src\zlib;..\..\src\jpeg;%(AdditionalIncludeDirectories) - WIN32;_LIB;%(PreprocessorDefinitions) - .\vc_mswunivudll\wxtiff\ - .\vc_mswunivudll\wxtiff\wx_wxtiff.pch - .\vc_mswunivudll\wxtiff\ - ..\..\lib\vc_dll\wxtiff.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_dll\wx_wxtiff.bsc - - - true - ..\..\lib\vc_dll\wxtiff.lib - - - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - - - - \ No newline at end of file diff --git a/wxWidgets/build/msw/wx_wxtiff.vcxproj.filters b/wxWidgets/build/msw/wx_wxtiff.vcxproj.filters deleted file mode 100644 index b392cffcf5..0000000000 --- a/wxWidgets/build/msw/wx_wxtiff.vcxproj.filters +++ /dev/null @@ -1,115 +0,0 @@ - - - - - {e34ebbbb-0cc8-41ac-b82a-08c218190468} - - - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - \ No newline at end of file diff --git a/wxWidgets/build/msw/wx_wxzlib.vcxproj b/wxWidgets/build/msw/wx_wxzlib.vcxproj deleted file mode 100644 index 6ccf7871a4..0000000000 --- a/wxWidgets/build/msw/wx_wxzlib.vcxproj +++ /dev/null @@ -1,1883 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - DLL Debug - Win32 - - - DLL Debug - x64 - - - DLL Release - Win32 - - - DLL Release - x64 - - - DLL Unicode Debug - Win32 - - - DLL Unicode Debug - x64 - - - DLL Unicode Release - Win32 - - - DLL Unicode Release - x64 - - - DLL Universal Debug - Win32 - - - DLL Universal Debug - x64 - - - DLL Universal Release - Win32 - - - DLL Universal Release - x64 - - - DLL Universal Unicode Debug - Win32 - - - DLL Universal Unicode Debug - x64 - - - DLL Universal Unicode Release - Win32 - - - DLL Universal Unicode Release - x64 - - - Release - Win32 - - - Release - x64 - - - Template - Win32 - - - Template - x64 - - - Unicode Debug - Win32 - - - Unicode Debug - x64 - - - Unicode Release - Win32 - - - Unicode Release - x64 - - - Universal Debug - Win32 - - - Universal Debug - x64 - - - Universal Release - Win32 - - - Universal Release - x64 - - - Universal Unicode Debug - Win32 - - - Universal Unicode Debug - x64 - - - Universal Unicode Release - Win32 - - - Universal Unicode Release - x64 - - - - wxzlib - - - {AFF2C68B-B867-DD50-6AC5-74B09D41F8EA} - - - - Application - v110 - - - Application - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - .\..\..\lib\vc_lib\ - .\vc_mswuniv\wxzlib\ - - - .\..\..\lib\vc_lib\ - .\vc_mswuniv\wxzlib\ - - - .\..\..\lib\vc_lib\ - .\vc_mswud\wxzlib\ - - - .\..\..\lib\vc_lib\ - .\vc_mswud\wxzlib\ - - - .\..\..\lib\vc_lib\ - .\vc_mswunivd\wxzlib\ - - - .\..\..\lib\vc_lib\ - .\vc_mswunivd\wxzlib\ - - - .\..\..\lib\vc_lib\ - .\vc_mswunivu\wxzlib\ - - - .\..\..\lib\vc_lib\ - .\vc_mswunivu\wxzlib\ - - - .\..\..\lib\vc_lib\ - .\vc_mswunivud\wxzlib\ - - - .\..\..\lib\vc_lib\ - .\vc_mswunivud\wxzlib\ - - - .\..\..\lib\vc_dll\ - .\vc_mswuddll\wxzlib\ - - - .\..\..\lib\vc_dll\ - .\vc_mswuddll\wxzlib\ - - - .\..\..\lib\vc_lib\ - .\vc_msw\wxzlib\ - - - .\..\..\lib\vc_lib\ - .\vc_msw\wxzlib\ - - - .\..\..\lib\vc_dll\ - .\vc_mswdll\wxzlib\ - - - .\..\..\lib\vc_dll\ - .\vc_mswdll\wxzlib\ - - - .\..\..\lib\vc_lib\ - .\vc_mswu\wxzlib\ - - - .\..\..\lib\vc_lib\ - .\vc_mswu\wxzlib\ - - - .\..\..\lib\vc_dll\ - .\vc_mswddll\wxzlib\ - - - .\..\..\lib\vc_dll\ - .\vc_mswddll\wxzlib\ - - - .\..\..\lib\vc_dll\ - .\vc_mswunivddll\wxzlib\ - - - .\..\..\lib\vc_dll\ - .\vc_mswunivddll\wxzlib\ - - - .\..\..\lib\vc_dll\ - .\vc_mswunivuddll\wxzlib\ - - - .\..\..\lib\vc_dll\ - .\vc_mswunivuddll\wxzlib\ - - - .\..\..\lib\vc_dll\ - .\vc_mswunivdll\wxzlib\ - - - .\..\..\lib\vc_dll\ - .\vc_mswunivdll\wxzlib\ - - - .\..\..\lib\vc_dll\ - .\vc_mswunivudll\wxzlib\ - - - .\..\..\lib\vc_dll\ - .\vc_mswunivudll\wxzlib\ - - - .\..\..\lib\vc_lib\ - .\vc_mswd\wxzlib\ - - - .\..\..\lib\vc_lib\ - .\vc_mswd\wxzlib\ - - - .\..\..\lib\vc_dll\ - .\vc_mswudll\wxzlib\ - - - .\..\..\lib\vc_dll\ - .\vc_mswudll\wxzlib\ - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - true - WIN32;_LIB;%(PreprocessorDefinitions) - .\vc_mswuniv\wxzlib\ - .\vc_mswuniv\wxzlib\wx_wxzlib.pch - .\vc_mswuniv\wxzlib\ - ..\..\lib\vc_lib\wxzlib.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_wxzlib.bsc - - - true - ..\..\lib\vc_lib\wxzlib.lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - true - WIN32;_LIB;%(PreprocessorDefinitions) - .\vc_mswuniv\wxzlib\ - .\vc_mswuniv\wxzlib\wx_wxzlib.pch - .\vc_mswuniv\wxzlib\ - ..\..\lib\vc_lib\wxzlib.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_wxzlib.bsc - - - true - ..\..\lib\vc_lib\wxzlib.lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - true - true - WIN32;_LIB;_DEBUG;%(PreprocessorDefinitions) - .\vc_mswud\wxzlib\ - .\vc_mswud\wxzlib\wx_wxzlib.pch - .\vc_mswud\wxzlib\ - ..\..\lib\vc_lib\wxzlibd.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_wxzlib.bsc - - - true - ..\..\lib\vc_lib\wxzlibd.lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - true - WIN32;_LIB;_DEBUG;%(PreprocessorDefinitions) - .\vc_mswud\wxzlib\ - .\vc_mswud\wxzlib\wx_wxzlib.pch - .\vc_mswud\wxzlib\ - ..\..\lib\vc_lib\wxzlibd.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_wxzlib.bsc - - - true - ..\..\lib\vc_lib\wxzlibd.lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - true - true - WIN32;_LIB;_DEBUG;%(PreprocessorDefinitions) - .\vc_mswunivd\wxzlib\ - .\vc_mswunivd\wxzlib\wx_wxzlib.pch - .\vc_mswunivd\wxzlib\ - ..\..\lib\vc_lib\wxzlibd.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_wxzlib.bsc - - - true - ..\..\lib\vc_lib\wxzlibd.lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - true - WIN32;_LIB;_DEBUG;%(PreprocessorDefinitions) - .\vc_mswunivd\wxzlib\ - .\vc_mswunivd\wxzlib\wx_wxzlib.pch - .\vc_mswunivd\wxzlib\ - ..\..\lib\vc_lib\wxzlibd.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_wxzlib.bsc - - - true - ..\..\lib\vc_lib\wxzlibd.lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - true - WIN32;_LIB;%(PreprocessorDefinitions) - .\vc_mswunivu\wxzlib\ - .\vc_mswunivu\wxzlib\wx_wxzlib.pch - .\vc_mswunivu\wxzlib\ - ..\..\lib\vc_lib\wxzlib.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_wxzlib.bsc - - - true - ..\..\lib\vc_lib\wxzlib.lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - true - WIN32;_LIB;%(PreprocessorDefinitions) - .\vc_mswunivu\wxzlib\ - .\vc_mswunivu\wxzlib\wx_wxzlib.pch - .\vc_mswunivu\wxzlib\ - ..\..\lib\vc_lib\wxzlib.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_wxzlib.bsc - - - true - ..\..\lib\vc_lib\wxzlib.lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - true - true - WIN32;_LIB;_DEBUG;%(PreprocessorDefinitions) - .\vc_mswunivud\wxzlib\ - .\vc_mswunivud\wxzlib\wx_wxzlib.pch - .\vc_mswunivud\wxzlib\ - ..\..\lib\vc_lib\wxzlibd.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_wxzlib.bsc - - - true - ..\..\lib\vc_lib\wxzlibd.lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - true - WIN32;_LIB;_DEBUG;%(PreprocessorDefinitions) - .\vc_mswunivud\wxzlib\ - .\vc_mswunivud\wxzlib\wx_wxzlib.pch - .\vc_mswunivud\wxzlib\ - ..\..\lib\vc_lib\wxzlibd.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_wxzlib.bsc - - - true - ..\..\lib\vc_lib\wxzlibd.lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - true - true - WIN32;_LIB;_DEBUG;%(PreprocessorDefinitions) - .\vc_mswuddll\wxzlib\ - .\vc_mswuddll\wxzlib\wx_wxzlib.pch - .\vc_mswuddll\wxzlib\ - ..\..\lib\vc_dll\wxzlibd.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_dll\wx_wxzlib.bsc - - - true - ..\..\lib\vc_dll\wxzlibd.lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - true - WIN32;_LIB;_DEBUG;%(PreprocessorDefinitions) - .\vc_mswuddll\wxzlib\ - .\vc_mswuddll\wxzlib\wx_wxzlib.pch - .\vc_mswuddll\wxzlib\ - ..\..\lib\vc_dll\wxzlibd.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_dll\wx_wxzlib.bsc - - - true - ..\..\lib\vc_dll\wxzlibd.lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - true - WIN32;_LIB;%(PreprocessorDefinitions) - .\vc_msw\wxzlib\ - .\vc_msw\wxzlib\wx_wxzlib.pch - .\vc_msw\wxzlib\ - ..\..\lib\vc_lib\wxzlib.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_wxzlib.bsc - - - true - .\..\..\..\libs\$(Configuration)\$(ProjectName).lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - true - WIN32;_LIB;%(PreprocessorDefinitions) - .\vc_msw\wxzlib\ - .\vc_msw\wxzlib\wx_wxzlib.pch - .\vc_msw\wxzlib\ - ..\..\lib\vc_lib\wxzlib.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_wxzlib.bsc - - - true - .\..\..\..\libs\$(Configuration)\$(ProjectName).lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - true - WIN32;_LIB;%(PreprocessorDefinitions) - .\vc_mswdll\wxzlib\ - .\vc_mswdll\wxzlib\wx_wxzlib.pch - .\vc_mswdll\wxzlib\ - ..\..\lib\vc_dll\wxzlib.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_dll\wx_wxzlib.bsc - - - true - ..\..\lib\vc_dll\wxzlib.lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - true - WIN32;_LIB;%(PreprocessorDefinitions) - .\vc_mswdll\wxzlib\ - .\vc_mswdll\wxzlib\wx_wxzlib.pch - .\vc_mswdll\wxzlib\ - ..\..\lib\vc_dll\wxzlib.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_dll\wx_wxzlib.bsc - - - true - ..\..\lib\vc_dll\wxzlib.lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - true - WIN32;_LIB;%(PreprocessorDefinitions) - .\vc_mswu\wxzlib\ - .\vc_mswu\wxzlib\wx_wxzlib.pch - .\vc_mswu\wxzlib\ - ..\..\lib\vc_lib\wxzlib.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_wxzlib.bsc - - - true - ..\..\lib\vc_lib\wxzlib.lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - true - WIN32;_LIB;%(PreprocessorDefinitions) - .\vc_mswu\wxzlib\ - .\vc_mswu\wxzlib\wx_wxzlib.pch - .\vc_mswu\wxzlib\ - ..\..\lib\vc_lib\wxzlib.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_wxzlib.bsc - - - true - ..\..\lib\vc_lib\wxzlib.lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - true - true - WIN32;_LIB;_DEBUG;%(PreprocessorDefinitions) - .\vc_mswddll\wxzlib\ - .\vc_mswddll\wxzlib\wx_wxzlib.pch - .\vc_mswddll\wxzlib\ - ..\..\lib\vc_dll\wxzlibd.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_dll\wx_wxzlib.bsc - - - true - ..\..\lib\vc_dll\wxzlibd.lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - true - WIN32;_LIB;_DEBUG;%(PreprocessorDefinitions) - .\vc_mswddll\wxzlib\ - .\vc_mswddll\wxzlib\wx_wxzlib.pch - .\vc_mswddll\wxzlib\ - ..\..\lib\vc_dll\wxzlibd.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_dll\wx_wxzlib.bsc - - - true - ..\..\lib\vc_dll\wxzlibd.lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - true - true - WIN32;_LIB;_DEBUG;%(PreprocessorDefinitions) - .\vc_mswunivddll\wxzlib\ - .\vc_mswunivddll\wxzlib\wx_wxzlib.pch - .\vc_mswunivddll\wxzlib\ - ..\..\lib\vc_dll\wxzlibd.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_dll\wx_wxzlib.bsc - - - true - ..\..\lib\vc_dll\wxzlibd.lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - true - WIN32;_LIB;_DEBUG;%(PreprocessorDefinitions) - .\vc_mswunivddll\wxzlib\ - .\vc_mswunivddll\wxzlib\wx_wxzlib.pch - .\vc_mswunivddll\wxzlib\ - ..\..\lib\vc_dll\wxzlibd.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_dll\wx_wxzlib.bsc - - - true - ..\..\lib\vc_dll\wxzlibd.lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - true - true - WIN32;_LIB;_DEBUG;%(PreprocessorDefinitions) - .\vc_mswunivuddll\wxzlib\ - .\vc_mswunivuddll\wxzlib\wx_wxzlib.pch - .\vc_mswunivuddll\wxzlib\ - ..\..\lib\vc_dll\wxzlibd.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_dll\wx_wxzlib.bsc - - - true - ..\..\lib\vc_dll\wxzlibd.lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - true - WIN32;_LIB;_DEBUG;%(PreprocessorDefinitions) - .\vc_mswunivuddll\wxzlib\ - .\vc_mswunivuddll\wxzlib\wx_wxzlib.pch - .\vc_mswunivuddll\wxzlib\ - ..\..\lib\vc_dll\wxzlibd.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_dll\wx_wxzlib.bsc - - - true - ..\..\lib\vc_dll\wxzlibd.lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - true - WIN32;_LIB;%(PreprocessorDefinitions) - .\vc_mswunivdll\wxzlib\ - .\vc_mswunivdll\wxzlib\wx_wxzlib.pch - .\vc_mswunivdll\wxzlib\ - ..\..\lib\vc_dll\wxzlib.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_dll\wx_wxzlib.bsc - - - true - ..\..\lib\vc_dll\wxzlib.lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - true - WIN32;_LIB;%(PreprocessorDefinitions) - .\vc_mswunivdll\wxzlib\ - .\vc_mswunivdll\wxzlib\wx_wxzlib.pch - .\vc_mswunivdll\wxzlib\ - ..\..\lib\vc_dll\wxzlib.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_dll\wx_wxzlib.bsc - - - true - ..\..\lib\vc_dll\wxzlib.lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - true - WIN32;_LIB;%(PreprocessorDefinitions) - .\vc_mswunivudll\wxzlib\ - .\vc_mswunivudll\wxzlib\wx_wxzlib.pch - .\vc_mswunivudll\wxzlib\ - ..\..\lib\vc_dll\wxzlib.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_dll\wx_wxzlib.bsc - - - true - ..\..\lib\vc_dll\wxzlib.lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - true - WIN32;_LIB;%(PreprocessorDefinitions) - .\vc_mswunivudll\wxzlib\ - .\vc_mswunivudll\wxzlib\wx_wxzlib.pch - .\vc_mswunivudll\wxzlib\ - ..\..\lib\vc_dll\wxzlib.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_dll\wx_wxzlib.bsc - - - true - ..\..\lib\vc_dll\wxzlib.lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - true - true - WIN32;_LIB;_DEBUG;%(PreprocessorDefinitions) - .\vc_mswd\wxzlib\ - .\vc_mswd\wxzlib\wx_wxzlib.pch - .\vc_mswd\wxzlib\ - ..\..\lib\vc_lib\wxzlibd.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_wxzlib.bsc - - - true - .\..\..\..\libs\$(Configuration)\$(ProjectName).lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - true - WIN32;_LIB;_DEBUG;%(PreprocessorDefinitions) - .\vc_mswd\wxzlib\ - .\vc_mswd\wxzlib\wx_wxzlib.pch - .\vc_mswd\wxzlib\ - ..\..\lib\vc_lib\wxzlibd.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_wxzlib.bsc - - - true - .\..\..\..\libs\$(Configuration)\$(ProjectName).lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - true - WIN32;_LIB;%(PreprocessorDefinitions) - .\vc_mswudll\wxzlib\ - .\vc_mswudll\wxzlib\wx_wxzlib.pch - .\vc_mswudll\wxzlib\ - ..\..\lib\vc_dll\wxzlib.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_dll\wx_wxzlib.bsc - - - true - ..\..\lib\vc_dll\wxzlib.lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - true - WIN32;_LIB;%(PreprocessorDefinitions) - .\vc_mswudll\wxzlib\ - .\vc_mswudll\wxzlib\wx_wxzlib.pch - .\vc_mswudll\wxzlib\ - ..\..\lib\vc_dll\wxzlib.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_dll\wx_wxzlib.bsc - - - true - ..\..\lib\vc_dll\wxzlib.lib - - - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - - - - \ No newline at end of file diff --git a/wxWidgets/build/msw/wx_wxzlib.vcxproj.filters b/wxWidgets/build/msw/wx_wxzlib.vcxproj.filters deleted file mode 100644 index 7c0ebf222c..0000000000 --- a/wxWidgets/build/msw/wx_wxzlib.vcxproj.filters +++ /dev/null @@ -1,46 +0,0 @@ - - - - - {90e2ba8e-45a6-4181-9816-1f87cd1c4e7b} - - - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - \ No newline at end of file diff --git a/wxWidgets/build/msw/wx_xml.vcxproj b/wxWidgets/build/msw/wx_xml.vcxproj deleted file mode 100644 index 0934d68028..0000000000 --- a/wxWidgets/build/msw/wx_xml.vcxproj +++ /dev/null @@ -1,2279 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - DLL Debug - Win32 - - - DLL Debug - x64 - - - DLL Release - Win32 - - - DLL Release - x64 - - - DLL Unicode Debug - Win32 - - - DLL Unicode Debug - x64 - - - DLL Unicode Release - Win32 - - - DLL Unicode Release - x64 - - - DLL Universal Debug - Win32 - - - DLL Universal Debug - x64 - - - DLL Universal Release - Win32 - - - DLL Universal Release - x64 - - - DLL Universal Unicode Debug - Win32 - - - DLL Universal Unicode Debug - x64 - - - DLL Universal Unicode Release - Win32 - - - DLL Universal Unicode Release - x64 - - - Release - Win32 - - - Release - x64 - - - Template - Win32 - - - Template - x64 - - - Unicode Debug - Win32 - - - Unicode Debug - x64 - - - Unicode Release - Win32 - - - Unicode Release - x64 - - - Universal Debug - Win32 - - - Universal Debug - x64 - - - Universal Release - Win32 - - - Universal Release - x64 - - - Universal Unicode Debug - Win32 - - - Universal Unicode Debug - x64 - - - Universal Unicode Release - Win32 - - - Universal Unicode Release - x64 - - - - xml - - - {6FDC76D5-CB44-B9F8-5EF6-C59B020719DF} - - - - Application - v110 - - - Application - v110 - - - DynamicLibrary - false - Unicode - v110 - - - DynamicLibrary - false - Unicode - v110 - - - DynamicLibrary - false - Unicode - v110 - - - DynamicLibrary - false - Unicode - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - DynamicLibrary - false - Unicode - v110 - - - DynamicLibrary - false - Unicode - v110 - - - DynamicLibrary - false - v110 - - - DynamicLibrary - false - v110 - - - DynamicLibrary - false - v110 - - - DynamicLibrary - false - v110 - - - DynamicLibrary - false - v110 - - - DynamicLibrary - false - v110 - - - StaticLibrary - false - Unicode - v110 - - - StaticLibrary - false - Unicode - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - Unicode - v110 - - - StaticLibrary - false - Unicode - v110 - - - DynamicLibrary - false - Unicode - v110 - - - DynamicLibrary - false - Unicode - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - Unicode - v110 - - - StaticLibrary - false - Unicode - v110 - - - DynamicLibrary - false - v110 - - - DynamicLibrary - false - v110 - - - StaticLibrary - false - Unicode - v110 - - - StaticLibrary - false - Unicode - v110 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - .\..\..\lib\vc_lib\ - .\vc_mswud\xml\ - - - .\..\..\lib\vc_lib\ - .\vc_mswud\xml\ - - - .\..\..\lib\vc_dll\ - .\vc_mswddll\xml\ - true - - - .\..\..\lib\vc_dll\ - .\vc_mswddll\xml\ - true - - - .\..\..\lib\vc_lib\ - .\vc_mswunivu\xml\ - - - .\..\..\lib\vc_lib\ - .\vc_mswunivu\xml\ - - - .\..\..\lib\vc_lib\ - .\vc_mswunivd\xml\ - - - .\..\..\lib\vc_lib\ - .\vc_mswunivd\xml\ - - - .\..\..\lib\vc_dll\ - .\vc_mswunivudll\xml\ - false - - - .\..\..\lib\vc_dll\ - .\vc_mswunivudll\xml\ - false - - - .\..\..\lib\vc_lib\ - .\vc_mswunivud\xml\ - - - .\..\..\lib\vc_lib\ - .\vc_mswunivud\xml\ - - - .\..\..\lib\vc_lib\ - .\vc_mswd\xml\ - - - .\..\..\lib\vc_lib\ - .\vc_mswd\xml\ - - - .\..\..\lib\vc_lib\ - .\vc_msw\xml\ - - - .\..\..\lib\vc_lib\ - .\vc_msw\xml\ - - - .\..\..\lib\vc_lib\ - .\vc_mswu\xml\ - - - .\..\..\lib\vc_lib\ - .\vc_mswu\xml\ - - - .\..\..\lib\vc_dll\ - .\vc_mswunivdll\xml\ - false - - - .\..\..\lib\vc_dll\ - .\vc_mswunivdll\xml\ - false - - - .\..\..\lib\vc_dll\ - .\vc_mswunivddll\xml\ - true - - - .\..\..\lib\vc_dll\ - .\vc_mswunivddll\xml\ - true - - - .\..\..\lib\vc_dll\ - .\vc_mswdll\xml\ - false - - - .\..\..\lib\vc_dll\ - .\vc_mswdll\xml\ - false - - - .\..\..\lib\vc_dll\ - .\vc_mswudll\xml\ - false - - - .\..\..\lib\vc_dll\ - .\vc_mswudll\xml\ - false - - - .\..\..\lib\vc_lib\ - .\vc_mswuniv\xml\ - - - .\..\..\lib\vc_lib\ - .\vc_mswuniv\xml\ - - - .\..\..\lib\vc_dll\ - .\vc_mswuddll\xml\ - true - - - .\..\..\lib\vc_dll\ - .\vc_mswuddll\xml\ - true - - - .\..\..\lib\vc_dll\ - .\vc_mswunivuddll\xml\ - true - - - .\..\..\lib\vc_dll\ - .\vc_mswunivuddll\xml\ - true - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - true - ..\..\lib\vc_lib\mswud;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;__WXMSW__;__WXDEBUG__;WXBUILDING;wxUSE_GUI=0;%(PreprocessorDefinitions) - .\vc_mswud\xml\ - vc_mswud\wxprec_xmllib.pch - Use - wx/wxprec.h - .\vc_mswud\xml\ - ..\..\lib\vc_lib\wxbase28ud_xml.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_xml.bsc - - - true - ..\..\lib\vc_lib\wxbase28ud_xml.lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - ..\..\lib\vc_lib\mswud;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;__WXMSW__;__WXDEBUG__;WXBUILDING;wxUSE_GUI=0;%(PreprocessorDefinitions) - .\vc_mswud\xml\ - vc_mswud\wxprec_xmllib.pch - Use - wx/wxprec.h - .\vc_mswud\xml\ - ..\..\lib\vc_lib\wxbase28ud_xml.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_xml.bsc - - - true - ..\..\lib\vc_lib\wxbase28ud_xml.lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - true - ..\..\lib\vc_dll\mswd;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXDEBUG__;WXBUILDING;wxUSE_GUI=0;WXUSINGDLL;WXMAKINGDLL_XML;%(PreprocessorDefinitions) - .\vc_mswddll\xml\ - vc_mswddll\wxprec_xmldll.pch - Use - wx/wxprec.h - .\vc_mswddll\xml\ - ..\..\lib\vc_dll\wxbase28d_xml_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXDEBUG__;WXBUILDING;wxUSE_GUI=0;WXUSINGDLL;WXMAKINGDLL_XML;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_xml.tlb - true - Win32 - - - 0x0409 - ..\..\lib\vc_dll\mswd;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - _DEBUG;__WXMSW__;__WXDEBUG__;WXBUILDING;WXDLLNAME=wxbase28d_xml_vc_custom;wxUSE_GUI=0;WXUSINGDLL;WXMAKINGDLL_XML;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_xml.bsc - - - true - true - true - Console - ..\..\lib\vc_dll\wxbase28d_xml_vc_custom.dll - ..\..\lib\vc_dll\wxbase28d_xml.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxzlibd.lib;wxregexd.lib;wxexpatd.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxbase28d.lib;%(AdditionalDependencies) - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - ..\..\lib\vc_dll\mswd;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXDEBUG__;WXBUILDING;wxUSE_GUI=0;WXUSINGDLL;WXMAKINGDLL_XML;%(PreprocessorDefinitions) - .\vc_mswddll\xml\ - vc_mswddll\wxprec_xmldll.pch - Use - wx/wxprec.h - .\vc_mswddll\xml\ - ..\..\lib\vc_dll\wxbase28d_xml_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXDEBUG__;WXBUILDING;wxUSE_GUI=0;WXUSINGDLL;WXMAKINGDLL_XML;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_xml.tlb - true - - - 0x0409 - ..\..\lib\vc_dll\mswd;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - _DEBUG;__WXMSW__;__WXDEBUG__;WXBUILDING;WXDLLNAME=wxbase28d_xml_vc_custom;wxUSE_GUI=0;WXUSINGDLL;WXMAKINGDLL_XML;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_xml.bsc - - - true - true - true - Console - ..\..\lib\vc_dll\wxbase28d_xml_vc_custom.dll - ..\..\lib\vc_dll\wxbase28d_xml.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxzlibd.lib;wxregexd.lib;wxexpatd.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxbase28d.lib;%(AdditionalDependencies) - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_lib\mswunivu;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;__WXMSW__;__WXUNIVERSAL__;NDEBUG;WXBUILDING;wxUSE_GUI=0;%(PreprocessorDefinitions) - .\vc_mswunivu\xml\ - vc_mswunivu\wxprec_xmllib.pch - Use - wx/wxprec.h - .\vc_mswunivu\xml\ - ..\..\lib\vc_lib\wxbase28u_xml.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_xml.bsc - - - true - ..\..\lib\vc_lib\wxbase28u_xml.lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_lib\mswunivu;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;__WXMSW__;__WXUNIVERSAL__;NDEBUG;WXBUILDING;wxUSE_GUI=0;%(PreprocessorDefinitions) - .\vc_mswunivu\xml\ - vc_mswunivu\wxprec_xmllib.pch - Use - wx/wxprec.h - .\vc_mswunivu\xml\ - ..\..\lib\vc_lib\wxbase28u_xml.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_xml.bsc - - - true - ..\..\lib\vc_lib\wxbase28u_xml.lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - true - ..\..\lib\vc_lib\mswunivd;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;WXBUILDING;wxUSE_GUI=0;%(PreprocessorDefinitions) - .\vc_mswunivd\xml\ - vc_mswunivd\wxprec_xmllib.pch - Use - wx/wxprec.h - .\vc_mswunivd\xml\ - ..\..\lib\vc_lib\wxbase28d_xml.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_xml.bsc - - - true - ..\..\lib\vc_lib\wxbase28d_xml.lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - ..\..\lib\vc_lib\mswunivd;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;WXBUILDING;wxUSE_GUI=0;%(PreprocessorDefinitions) - .\vc_mswunivd\xml\ - vc_mswunivd\wxprec_xmllib.pch - Use - wx/wxprec.h - .\vc_mswunivd\xml\ - ..\..\lib\vc_lib\wxbase28d_xml.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_xml.bsc - - - true - ..\..\lib\vc_lib\wxbase28d_xml.lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_dll\mswunivu;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;__WXUNIVERSAL__;NDEBUG;WXBUILDING;wxUSE_GUI=0;WXUSINGDLL;WXMAKINGDLL_XML;%(PreprocessorDefinitions) - .\vc_mswunivudll\xml\ - vc_mswunivudll\wxprec_xmldll.pch - Use - wx/wxprec.h - .\vc_mswunivudll\xml\ - ..\..\lib\vc_dll\wxbase28u_xml_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;__WXUNIVERSAL__;NDEBUG;_UNICODE;WXBUILDING;wxUSE_GUI=0;WXUSINGDLL;WXMAKINGDLL_XML;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_xml.tlb - true - Win32 - - - 0x0409 - ..\..\lib\vc_dll\mswunivu;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - __WXMSW__;__WXUNIVERSAL__;NDEBUG;_UNICODE;WXBUILDING;WXDLLNAME=wxbase28u_xml_vc_custom;wxUSE_GUI=0;WXUSINGDLL;WXMAKINGDLL_XML;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_xml.bsc - - - true - true - Console - ..\..\lib\vc_dll\wxbase28u_xml_vc_custom.dll - ..\..\lib\vc_dll\wxbase28u_xml.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxzlib.lib;wxregexu.lib;wxexpat.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxbase28u.lib;%(AdditionalDependencies) - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_dll\mswunivu;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;__WXUNIVERSAL__;NDEBUG;WXBUILDING;wxUSE_GUI=0;WXUSINGDLL;WXMAKINGDLL_XML;%(PreprocessorDefinitions) - .\vc_mswunivudll\xml\ - vc_mswunivudll\wxprec_xmldll.pch - Use - wx/wxprec.h - .\vc_mswunivudll\xml\ - ..\..\lib\vc_dll\wxbase28u_xml_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;__WXUNIVERSAL__;NDEBUG;_UNICODE;WXBUILDING;wxUSE_GUI=0;WXUSINGDLL;WXMAKINGDLL_XML;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_xml.tlb - true - - - 0x0409 - ..\..\lib\vc_dll\mswunivu;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - __WXMSW__;__WXUNIVERSAL__;NDEBUG;_UNICODE;WXBUILDING;WXDLLNAME=wxbase28u_xml_vc_custom;wxUSE_GUI=0;WXUSINGDLL;WXMAKINGDLL_XML;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_xml.bsc - - - true - true - Console - ..\..\lib\vc_dll\wxbase28u_xml_vc_custom.dll - ..\..\lib\vc_dll\wxbase28u_xml.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxzlib.lib;wxregexu.lib;wxexpat.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxbase28u.lib;%(AdditionalDependencies) - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - true - ..\..\lib\vc_lib\mswunivud;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;WXBUILDING;wxUSE_GUI=0;%(PreprocessorDefinitions) - .\vc_mswunivud\xml\ - vc_mswunivud\wxprec_xmllib.pch - Use - wx/wxprec.h - .\vc_mswunivud\xml\ - ..\..\lib\vc_lib\wxbase28ud_xml.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_xml.bsc - - - true - ..\..\lib\vc_lib\wxbase28ud_xml.lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - ..\..\lib\vc_lib\mswunivud;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;WXBUILDING;wxUSE_GUI=0;%(PreprocessorDefinitions) - .\vc_mswunivud\xml\ - vc_mswunivud\wxprec_xmllib.pch - Use - wx/wxprec.h - .\vc_mswunivud\xml\ - ..\..\lib\vc_lib\wxbase28ud_xml.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_xml.bsc - - - true - ..\..\lib\vc_lib\wxbase28ud_xml.lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - true - ..\..\lib\vc_lib\mswd;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;__WXMSW__;__WXDEBUG__;WXBUILDING;wxUSE_GUI=0;%(PreprocessorDefinitions) - .\vc_mswd\xml\ - vc_mswd\wxprec_xmllib.pch - Use - wx/wxprec.h - .\vc_mswd\xml\ - ..\..\lib\vc_lib\wxbase28d_xml.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_xml.bsc - - - true - .\..\..\..\libs\$(Configuration)\$(ProjectName).lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - ..\..\lib\vc_lib\mswd;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;__WXMSW__;__WXDEBUG__;WXBUILDING;wxUSE_GUI=0;%(PreprocessorDefinitions) - .\vc_mswd\xml\ - vc_mswd\wxprec_xmllib.pch - Use - wx/wxprec.h - .\vc_mswd\xml\ - ..\..\lib\vc_lib\wxbase28d_xml.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_xml.bsc - - - true - .\..\..\..\libs\$(Configuration)\$(ProjectName).lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_lib\msw;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;__WXMSW__;NDEBUG;WXBUILDING;wxUSE_GUI=0;%(PreprocessorDefinitions) - .\vc_msw\xml\ - vc_msw\wxprec_xmllib.pch - Use - wx/wxprec.h - .\vc_msw\xml\ - ..\..\lib\vc_lib\wxbase28_xml.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_xml.bsc - - - true - .\..\..\..\libs\$(Configuration)\$(ProjectName).lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_lib\msw;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;__WXMSW__;NDEBUG;WXBUILDING;wxUSE_GUI=0;%(PreprocessorDefinitions) - .\vc_msw\xml\ - vc_msw\wxprec_xmllib.pch - Use - wx/wxprec.h - .\vc_msw\xml\ - ..\..\lib\vc_lib\wxbase28_xml.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_xml.bsc - - - true - .\..\..\..\libs\$(Configuration)\$(ProjectName).lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_lib\mswu;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;__WXMSW__;NDEBUG;WXBUILDING;wxUSE_GUI=0;%(PreprocessorDefinitions) - .\vc_mswu\xml\ - vc_mswu\wxprec_xmllib.pch - Use - wx/wxprec.h - .\vc_mswu\xml\ - ..\..\lib\vc_lib\wxbase28u_xml.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_xml.bsc - - - true - ..\..\lib\vc_lib\wxbase28u_xml.lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_lib\mswu;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;__WXMSW__;NDEBUG;WXBUILDING;wxUSE_GUI=0;%(PreprocessorDefinitions) - .\vc_mswu\xml\ - vc_mswu\wxprec_xmllib.pch - Use - wx/wxprec.h - .\vc_mswu\xml\ - ..\..\lib\vc_lib\wxbase28u_xml.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_xml.bsc - - - true - ..\..\lib\vc_lib\wxbase28u_xml.lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_dll\mswuniv;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;__WXUNIVERSAL__;NDEBUG;WXBUILDING;wxUSE_GUI=0;WXUSINGDLL;WXMAKINGDLL_XML;%(PreprocessorDefinitions) - .\vc_mswunivdll\xml\ - vc_mswunivdll\wxprec_xmldll.pch - Use - wx/wxprec.h - .\vc_mswunivdll\xml\ - ..\..\lib\vc_dll\wxbase28_xml_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;__WXUNIVERSAL__;NDEBUG;WXBUILDING;wxUSE_GUI=0;WXUSINGDLL;WXMAKINGDLL_XML;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_xml.tlb - true - Win32 - - - 0x0409 - ..\..\lib\vc_dll\mswuniv;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - __WXMSW__;__WXUNIVERSAL__;NDEBUG;WXBUILDING;WXDLLNAME=wxbase28_xml_vc_custom;wxUSE_GUI=0;WXUSINGDLL;WXMAKINGDLL_XML;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_xml.bsc - - - true - true - Console - ..\..\lib\vc_dll\wxbase28_xml_vc_custom.dll - ..\..\lib\vc_dll\wxbase28_xml.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxzlib.lib;wxregex.lib;wxexpat.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxbase28.lib;%(AdditionalDependencies) - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_dll\mswuniv;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;__WXUNIVERSAL__;NDEBUG;WXBUILDING;wxUSE_GUI=0;WXUSINGDLL;WXMAKINGDLL_XML;%(PreprocessorDefinitions) - .\vc_mswunivdll\xml\ - vc_mswunivdll\wxprec_xmldll.pch - Use - wx/wxprec.h - .\vc_mswunivdll\xml\ - ..\..\lib\vc_dll\wxbase28_xml_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;__WXUNIVERSAL__;NDEBUG;WXBUILDING;wxUSE_GUI=0;WXUSINGDLL;WXMAKINGDLL_XML;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_xml.tlb - true - - - 0x0409 - ..\..\lib\vc_dll\mswuniv;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - __WXMSW__;__WXUNIVERSAL__;NDEBUG;WXBUILDING;WXDLLNAME=wxbase28_xml_vc_custom;wxUSE_GUI=0;WXUSINGDLL;WXMAKINGDLL_XML;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_xml.bsc - - - true - true - Console - ..\..\lib\vc_dll\wxbase28_xml_vc_custom.dll - ..\..\lib\vc_dll\wxbase28_xml.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxzlib.lib;wxregex.lib;wxexpat.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxbase28.lib;%(AdditionalDependencies) - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - true - ..\..\lib\vc_dll\mswunivd;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;WXBUILDING;wxUSE_GUI=0;WXUSINGDLL;WXMAKINGDLL_XML;%(PreprocessorDefinitions) - .\vc_mswunivddll\xml\ - vc_mswunivddll\wxprec_xmldll.pch - Use - wx/wxprec.h - .\vc_mswunivddll\xml\ - ..\..\lib\vc_dll\wxbase28d_xml_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;WXBUILDING;wxUSE_GUI=0;WXUSINGDLL;WXMAKINGDLL_XML;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_xml.tlb - true - Win32 - - - 0x0409 - ..\..\lib\vc_dll\mswunivd;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - _DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;WXBUILDING;WXDLLNAME=wxbase28d_xml_vc_custom;wxUSE_GUI=0;WXUSINGDLL;WXMAKINGDLL_XML;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_xml.bsc - - - true - true - true - Console - ..\..\lib\vc_dll\wxbase28d_xml_vc_custom.dll - ..\..\lib\vc_dll\wxbase28d_xml.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxzlibd.lib;wxregexd.lib;wxexpatd.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxbase28d.lib;%(AdditionalDependencies) - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - ..\..\lib\vc_dll\mswunivd;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;WXBUILDING;wxUSE_GUI=0;WXUSINGDLL;WXMAKINGDLL_XML;%(PreprocessorDefinitions) - .\vc_mswunivddll\xml\ - vc_mswunivddll\wxprec_xmldll.pch - Use - wx/wxprec.h - .\vc_mswunivddll\xml\ - ..\..\lib\vc_dll\wxbase28d_xml_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;WXBUILDING;wxUSE_GUI=0;WXUSINGDLL;WXMAKINGDLL_XML;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_xml.tlb - true - - - 0x0409 - ..\..\lib\vc_dll\mswunivd;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - _DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;WXBUILDING;WXDLLNAME=wxbase28d_xml_vc_custom;wxUSE_GUI=0;WXUSINGDLL;WXMAKINGDLL_XML;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_xml.bsc - - - true - true - true - Console - ..\..\lib\vc_dll\wxbase28d_xml_vc_custom.dll - ..\..\lib\vc_dll\wxbase28d_xml.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxzlibd.lib;wxregexd.lib;wxexpatd.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxbase28d.lib;%(AdditionalDependencies) - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_dll\msw;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;NDEBUG;WXBUILDING;wxUSE_GUI=0;WXUSINGDLL;WXMAKINGDLL_XML;%(PreprocessorDefinitions) - .\vc_mswdll\xml\ - vc_mswdll\wxprec_xmldll.pch - Use - wx/wxprec.h - .\vc_mswdll\xml\ - ..\..\lib\vc_dll\wxbase28_xml_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;NDEBUG;WXBUILDING;wxUSE_GUI=0;WXUSINGDLL;WXMAKINGDLL_XML;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_xml.tlb - true - Win32 - - - 0x0409 - ..\..\lib\vc_dll\msw;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - __WXMSW__;NDEBUG;WXBUILDING;WXDLLNAME=wxbase28_xml_vc_custom;wxUSE_GUI=0;WXUSINGDLL;WXMAKINGDLL_XML;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_xml.bsc - - - true - true - Console - ..\..\lib\vc_dll\wxbase28_xml_vc_custom.dll - ..\..\lib\vc_dll\wxbase28_xml.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxzlib.lib;wxregex.lib;wxexpat.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxbase28.lib;%(AdditionalDependencies) - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_dll\msw;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;NDEBUG;WXBUILDING;wxUSE_GUI=0;WXUSINGDLL;WXMAKINGDLL_XML;%(PreprocessorDefinitions) - .\vc_mswdll\xml\ - vc_mswdll\wxprec_xmldll.pch - Use - wx/wxprec.h - .\vc_mswdll\xml\ - ..\..\lib\vc_dll\wxbase28_xml_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;NDEBUG;WXBUILDING;wxUSE_GUI=0;WXUSINGDLL;WXMAKINGDLL_XML;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_xml.tlb - true - - - 0x0409 - ..\..\lib\vc_dll\msw;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - __WXMSW__;NDEBUG;WXBUILDING;WXDLLNAME=wxbase28_xml_vc_custom;wxUSE_GUI=0;WXUSINGDLL;WXMAKINGDLL_XML;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_xml.bsc - - - true - true - Console - ..\..\lib\vc_dll\wxbase28_xml_vc_custom.dll - ..\..\lib\vc_dll\wxbase28_xml.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxzlib.lib;wxregex.lib;wxexpat.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxbase28.lib;%(AdditionalDependencies) - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_dll\mswu;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;NDEBUG;WXBUILDING;wxUSE_GUI=0;WXUSINGDLL;WXMAKINGDLL_XML;%(PreprocessorDefinitions) - .\vc_mswudll\xml\ - vc_mswudll\wxprec_xmldll.pch - Use - wx/wxprec.h - .\vc_mswudll\xml\ - ..\..\lib\vc_dll\wxbase28u_xml_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;NDEBUG;_UNICODE;WXBUILDING;wxUSE_GUI=0;WXUSINGDLL;WXMAKINGDLL_XML;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_xml.tlb - true - Win32 - - - 0x0409 - ..\..\lib\vc_dll\mswu;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - __WXMSW__;NDEBUG;_UNICODE;WXBUILDING;WXDLLNAME=wxbase28u_xml_vc_custom;wxUSE_GUI=0;WXUSINGDLL;WXMAKINGDLL_XML;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_xml.bsc - - - true - true - Console - ..\..\lib\vc_dll\wxbase28u_xml_vc_custom.dll - ..\..\lib\vc_dll\wxbase28u_xml.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxzlib.lib;wxregexu.lib;wxexpat.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxbase28u.lib;%(AdditionalDependencies) - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_dll\mswu;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;NDEBUG;WXBUILDING;wxUSE_GUI=0;WXUSINGDLL;WXMAKINGDLL_XML;%(PreprocessorDefinitions) - .\vc_mswudll\xml\ - vc_mswudll\wxprec_xmldll.pch - Use - wx/wxprec.h - .\vc_mswudll\xml\ - ..\..\lib\vc_dll\wxbase28u_xml_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;NDEBUG;_UNICODE;WXBUILDING;wxUSE_GUI=0;WXUSINGDLL;WXMAKINGDLL_XML;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_xml.tlb - true - - - 0x0409 - ..\..\lib\vc_dll\mswu;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - __WXMSW__;NDEBUG;_UNICODE;WXBUILDING;WXDLLNAME=wxbase28u_xml_vc_custom;wxUSE_GUI=0;WXUSINGDLL;WXMAKINGDLL_XML;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_xml.bsc - - - true - true - Console - ..\..\lib\vc_dll\wxbase28u_xml_vc_custom.dll - ..\..\lib\vc_dll\wxbase28u_xml.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxzlib.lib;wxregexu.lib;wxexpat.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxbase28u.lib;%(AdditionalDependencies) - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_lib\mswuniv;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;__WXMSW__;__WXUNIVERSAL__;NDEBUG;WXBUILDING;wxUSE_GUI=0;%(PreprocessorDefinitions) - .\vc_mswuniv\xml\ - vc_mswuniv\wxprec_xmllib.pch - Use - wx/wxprec.h - .\vc_mswuniv\xml\ - ..\..\lib\vc_lib\wxbase28_xml.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_xml.bsc - - - true - ..\..\lib\vc_lib\wxbase28_xml.lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_lib\mswuniv;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;__WXMSW__;__WXUNIVERSAL__;NDEBUG;WXBUILDING;wxUSE_GUI=0;%(PreprocessorDefinitions) - .\vc_mswuniv\xml\ - vc_mswuniv\wxprec_xmllib.pch - Use - wx/wxprec.h - .\vc_mswuniv\xml\ - ..\..\lib\vc_lib\wxbase28_xml.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_xml.bsc - - - true - ..\..\lib\vc_lib\wxbase28_xml.lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - true - ..\..\lib\vc_dll\mswud;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXDEBUG__;WXBUILDING;wxUSE_GUI=0;WXUSINGDLL;WXMAKINGDLL_XML;%(PreprocessorDefinitions) - .\vc_mswuddll\xml\ - vc_mswuddll\wxprec_xmldll.pch - Use - wx/wxprec.h - .\vc_mswuddll\xml\ - ..\..\lib\vc_dll\wxbase28ud_xml_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXDEBUG__;_UNICODE;WXBUILDING;wxUSE_GUI=0;WXUSINGDLL;WXMAKINGDLL_XML;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_xml.tlb - true - Win32 - - - 0x0409 - ..\..\lib\vc_dll\mswud;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - _DEBUG;__WXMSW__;__WXDEBUG__;_UNICODE;WXBUILDING;WXDLLNAME=wxbase28ud_xml_vc_custom;wxUSE_GUI=0;WXUSINGDLL;WXMAKINGDLL_XML;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_xml.bsc - - - true - true - true - Console - ..\..\lib\vc_dll\wxbase28ud_xml_vc_custom.dll - ..\..\lib\vc_dll\wxbase28ud_xml.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxzlibd.lib;wxregexud.lib;wxexpatd.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxbase28ud.lib;%(AdditionalDependencies) - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - ..\..\lib\vc_dll\mswud;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXDEBUG__;WXBUILDING;wxUSE_GUI=0;WXUSINGDLL;WXMAKINGDLL_XML;%(PreprocessorDefinitions) - .\vc_mswuddll\xml\ - vc_mswuddll\wxprec_xmldll.pch - Use - wx/wxprec.h - .\vc_mswuddll\xml\ - ..\..\lib\vc_dll\wxbase28ud_xml_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXDEBUG__;_UNICODE;WXBUILDING;wxUSE_GUI=0;WXUSINGDLL;WXMAKINGDLL_XML;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_xml.tlb - true - - - 0x0409 - ..\..\lib\vc_dll\mswud;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - _DEBUG;__WXMSW__;__WXDEBUG__;_UNICODE;WXBUILDING;WXDLLNAME=wxbase28ud_xml_vc_custom;wxUSE_GUI=0;WXUSINGDLL;WXMAKINGDLL_XML;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_xml.bsc - - - true - true - true - Console - ..\..\lib\vc_dll\wxbase28ud_xml_vc_custom.dll - ..\..\lib\vc_dll\wxbase28ud_xml.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxzlibd.lib;wxregexud.lib;wxexpatd.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxbase28ud.lib;%(AdditionalDependencies) - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - true - ..\..\lib\vc_dll\mswunivud;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;WXBUILDING;wxUSE_GUI=0;WXUSINGDLL;WXMAKINGDLL_XML;%(PreprocessorDefinitions) - .\vc_mswunivuddll\xml\ - vc_mswunivuddll\wxprec_xmldll.pch - Use - wx/wxprec.h - .\vc_mswunivuddll\xml\ - ..\..\lib\vc_dll\wxbase28ud_xml_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;_UNICODE;WXBUILDING;wxUSE_GUI=0;WXUSINGDLL;WXMAKINGDLL_XML;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_xml.tlb - true - Win32 - - - 0x0409 - ..\..\lib\vc_dll\mswunivud;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - _DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;_UNICODE;WXBUILDING;WXDLLNAME=wxbase28ud_xml_vc_custom;wxUSE_GUI=0;WXUSINGDLL;WXMAKINGDLL_XML;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_xml.bsc - - - true - true - true - Console - ..\..\lib\vc_dll\wxbase28ud_xml_vc_custom.dll - ..\..\lib\vc_dll\wxbase28ud_xml.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxzlibd.lib;wxregexud.lib;wxexpatd.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxbase28ud.lib;%(AdditionalDependencies) - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - ..\..\lib\vc_dll\mswunivud;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;WXBUILDING;wxUSE_GUI=0;WXUSINGDLL;WXMAKINGDLL_XML;%(PreprocessorDefinitions) - .\vc_mswunivuddll\xml\ - vc_mswunivuddll\wxprec_xmldll.pch - Use - wx/wxprec.h - .\vc_mswunivuddll\xml\ - ..\..\lib\vc_dll\wxbase28ud_xml_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;_UNICODE;WXBUILDING;wxUSE_GUI=0;WXUSINGDLL;WXMAKINGDLL_XML;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_xml.tlb - true - - - 0x0409 - ..\..\lib\vc_dll\mswunivud;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - _DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;_UNICODE;WXBUILDING;WXDLLNAME=wxbase28ud_xml_vc_custom;wxUSE_GUI=0;WXUSINGDLL;WXMAKINGDLL_XML;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_xml.bsc - - - true - true - true - Console - ..\..\lib\vc_dll\wxbase28ud_xml_vc_custom.dll - ..\..\lib\vc_dll\wxbase28ud_xml.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxzlibd.lib;wxregexud.lib;wxexpatd.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxbase28ud.lib;%(AdditionalDependencies) - - - - - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - - - true - true - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - true - true - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - true - true - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - true - true - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - true - true - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - true - true - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - true - true - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - true - true - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - - - - - copy "%(FullPath)" ..\..\lib\vc_lib\mswud\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_lib\mswud\wx\setup.h - Creating ..\..\lib\vc_lib\mswud\wx\setup.h - Creating ..\..\lib\vc_lib\mswud\wx\setup.h - ..\..\lib\vc_lib\mswud\wx\setup.h;%(Outputs) - ..\..\lib\vc_lib\mswud\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_dll\mswd\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_dll\mswd\wx\setup.h - Creating ..\..\lib\vc_dll\mswd\wx\setup.h - Creating ..\..\lib\vc_dll\mswd\wx\setup.h - ..\..\lib\vc_dll\mswd\wx\setup.h;%(Outputs) - ..\..\lib\vc_dll\mswd\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_lib\mswd\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_lib\mswd\wx\setup.h - Creating ..\..\lib\vc_lib\mswd\wx\setup.h - Creating ..\..\lib\vc_lib\mswd\wx\setup.h - ..\..\lib\vc_lib\mswd\wx\setup.h;%(Outputs) - ..\..\lib\vc_lib\mswd\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_lib\msw\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_lib\msw\wx\setup.h - Creating ..\..\lib\vc_lib\msw\wx\setup.h - Creating ..\..\lib\vc_lib\msw\wx\setup.h - ..\..\lib\vc_lib\msw\wx\setup.h;%(Outputs) - ..\..\lib\vc_lib\msw\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_lib\mswu\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_lib\mswu\wx\setup.h - Creating ..\..\lib\vc_lib\mswu\wx\setup.h - Creating ..\..\lib\vc_lib\mswu\wx\setup.h - ..\..\lib\vc_lib\mswu\wx\setup.h;%(Outputs) - ..\..\lib\vc_lib\mswu\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_dll\msw\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_dll\msw\wx\setup.h - Creating ..\..\lib\vc_dll\msw\wx\setup.h - Creating ..\..\lib\vc_dll\msw\wx\setup.h - ..\..\lib\vc_dll\msw\wx\setup.h;%(Outputs) - ..\..\lib\vc_dll\msw\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_dll\mswu\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_dll\mswu\wx\setup.h - Creating ..\..\lib\vc_dll\mswu\wx\setup.h - Creating ..\..\lib\vc_dll\mswu\wx\setup.h - ..\..\lib\vc_dll\mswu\wx\setup.h;%(Outputs) - ..\..\lib\vc_dll\mswu\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_dll\mswud\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_dll\mswud\wx\setup.h - Creating ..\..\lib\vc_dll\mswud\wx\setup.h - Creating ..\..\lib\vc_dll\mswud\wx\setup.h - ..\..\lib\vc_dll\mswud\wx\setup.h;%(Outputs) - ..\..\lib\vc_dll\mswud\wx\setup.h;%(Outputs) - - - copy "%(FullPath)" ..\..\lib\vc_lib\mswunivu\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_lib\mswunivu\wx\setup.h - Creating ..\..\lib\vc_lib\mswunivu\wx\setup.h - Creating ..\..\lib\vc_lib\mswunivu\wx\setup.h - ..\..\lib\vc_lib\mswunivu\wx\setup.h;%(Outputs) - ..\..\lib\vc_lib\mswunivu\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_lib\mswunivd\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_lib\mswunivd\wx\setup.h - Creating ..\..\lib\vc_lib\mswunivd\wx\setup.h - Creating ..\..\lib\vc_lib\mswunivd\wx\setup.h - ..\..\lib\vc_lib\mswunivd\wx\setup.h;%(Outputs) - ..\..\lib\vc_lib\mswunivd\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_dll\mswunivu\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_dll\mswunivu\wx\setup.h - Creating ..\..\lib\vc_dll\mswunivu\wx\setup.h - Creating ..\..\lib\vc_dll\mswunivu\wx\setup.h - ..\..\lib\vc_dll\mswunivu\wx\setup.h;%(Outputs) - ..\..\lib\vc_dll\mswunivu\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_lib\mswunivud\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_lib\mswunivud\wx\setup.h - Creating ..\..\lib\vc_lib\mswunivud\wx\setup.h - Creating ..\..\lib\vc_lib\mswunivud\wx\setup.h - ..\..\lib\vc_lib\mswunivud\wx\setup.h;%(Outputs) - ..\..\lib\vc_lib\mswunivud\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_dll\mswuniv\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_dll\mswuniv\wx\setup.h - Creating ..\..\lib\vc_dll\mswuniv\wx\setup.h - Creating ..\..\lib\vc_dll\mswuniv\wx\setup.h - ..\..\lib\vc_dll\mswuniv\wx\setup.h;%(Outputs) - ..\..\lib\vc_dll\mswuniv\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_dll\mswunivd\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_dll\mswunivd\wx\setup.h - Creating ..\..\lib\vc_dll\mswunivd\wx\setup.h - Creating ..\..\lib\vc_dll\mswunivd\wx\setup.h - ..\..\lib\vc_dll\mswunivd\wx\setup.h;%(Outputs) - ..\..\lib\vc_dll\mswunivd\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_lib\mswuniv\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_lib\mswuniv\wx\setup.h - Creating ..\..\lib\vc_lib\mswuniv\wx\setup.h - Creating ..\..\lib\vc_lib\mswuniv\wx\setup.h - ..\..\lib\vc_lib\mswuniv\wx\setup.h;%(Outputs) - ..\..\lib\vc_lib\mswuniv\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_dll\mswunivud\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_dll\mswunivud\wx\setup.h - Creating ..\..\lib\vc_dll\mswunivud\wx\setup.h - Creating ..\..\lib\vc_dll\mswunivud\wx\setup.h - ..\..\lib\vc_dll\mswunivud\wx\setup.h;%(Outputs) - ..\..\lib\vc_dll\mswunivud\wx\setup.h;%(Outputs) - - - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswud\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswud\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_lib\mswud\wx\msw\rcdefs.h - Creating ..\..\lib\vc_lib\mswud\wx\msw\rcdefs.h - ..\..\lib\vc_lib\mswud\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_lib\mswud\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswd\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswd\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_dll\mswd\wx\msw\rcdefs.h - Creating ..\..\lib\vc_dll\mswd\wx\msw\rcdefs.h - ..\..\lib\vc_dll\mswd\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_dll\mswd\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswunivu\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswunivu\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_lib\mswunivu\wx\msw\rcdefs.h - Creating ..\..\lib\vc_lib\mswunivu\wx\msw\rcdefs.h - ..\..\lib\vc_lib\mswunivu\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_lib\mswunivu\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswunivd\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswunivd\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_lib\mswunivd\wx\msw\rcdefs.h - Creating ..\..\lib\vc_lib\mswunivd\wx\msw\rcdefs.h - ..\..\lib\vc_lib\mswunivd\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_lib\mswunivd\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswunivu\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswunivu\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_dll\mswunivu\wx\msw\rcdefs.h - Creating ..\..\lib\vc_dll\mswunivu\wx\msw\rcdefs.h - ..\..\lib\vc_dll\mswunivu\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_dll\mswunivu\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswunivud\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswunivud\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_lib\mswunivud\wx\msw\rcdefs.h - Creating ..\..\lib\vc_lib\mswunivud\wx\msw\rcdefs.h - ..\..\lib\vc_lib\mswunivud\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_lib\mswunivud\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswd\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswd\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_lib\mswd\wx\msw\rcdefs.h - Creating ..\..\lib\vc_lib\mswd\wx\msw\rcdefs.h - ..\..\lib\vc_lib\mswd\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_lib\mswd\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\msw\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\msw\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_lib\msw\wx\msw\rcdefs.h - Creating ..\..\lib\vc_lib\msw\wx\msw\rcdefs.h - ..\..\lib\vc_lib\msw\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_lib\msw\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswu\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswu\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_lib\mswu\wx\msw\rcdefs.h - Creating ..\..\lib\vc_lib\mswu\wx\msw\rcdefs.h - ..\..\lib\vc_lib\mswu\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_lib\mswu\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswuniv\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswuniv\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_dll\mswuniv\wx\msw\rcdefs.h - Creating ..\..\lib\vc_dll\mswuniv\wx\msw\rcdefs.h - ..\..\lib\vc_dll\mswuniv\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_dll\mswuniv\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswunivd\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswunivd\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_dll\mswunivd\wx\msw\rcdefs.h - Creating ..\..\lib\vc_dll\mswunivd\wx\msw\rcdefs.h - ..\..\lib\vc_dll\mswunivd\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_dll\mswunivd\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\msw\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\msw\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_dll\msw\wx\msw\rcdefs.h - Creating ..\..\lib\vc_dll\msw\wx\msw\rcdefs.h - ..\..\lib\vc_dll\msw\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_dll\msw\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswu\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswu\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_dll\mswu\wx\msw\rcdefs.h - Creating ..\..\lib\vc_dll\mswu\wx\msw\rcdefs.h - ..\..\lib\vc_dll\mswu\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_dll\mswu\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswuniv\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswuniv\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_lib\mswuniv\wx\msw\rcdefs.h - Creating ..\..\lib\vc_lib\mswuniv\wx\msw\rcdefs.h - ..\..\lib\vc_lib\mswuniv\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_lib\mswuniv\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswud\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswud\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_dll\mswud\wx\msw\rcdefs.h - Creating ..\..\lib\vc_dll\mswud\wx\msw\rcdefs.h - ..\..\lib\vc_dll\mswud\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_dll\mswud\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswunivud\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswunivud\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_dll\mswunivud\wx\msw\rcdefs.h - Creating ..\..\lib\vc_dll\mswunivud\wx\msw\rcdefs.h - ..\..\lib\vc_dll\mswunivud\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_dll\mswunivud\wx\msw\rcdefs.h;%(Outputs) - - - - - - - - \ No newline at end of file diff --git a/wxWidgets/build/msw/wx_xml.vcxproj.filters b/wxWidgets/build/msw/wx_xml.vcxproj.filters deleted file mode 100644 index eb65d11821..0000000000 --- a/wxWidgets/build/msw/wx_xml.vcxproj.filters +++ /dev/null @@ -1,58 +0,0 @@ - - - - - {38457f94-abeb-457b-9766-29c786999fce} - - - {50ce604c-ded9-45cb-85fc-b38bb553c7ee} - - - {17207715-be08-4867-af6d-14a682c71d2b} - - - {999c4856-6e76-47f5-bac1-debb074e701c} - - - {6c45504c-1087-474b-ad6c-be3189d3560e} - - - {2cadb36a-f3eb-4891-bf1b-afc0640dacf9} - - - - - Common Sources - - - Common Sources - - - Source Files - - - - - MSW Sources - - - - - Common Headers - - - Common Headers - - - - - Setup Headers - - - Setup Headers - - - MSW Headers - - - \ No newline at end of file diff --git a/wxWidgets/build/msw/wx_xrc.vcxproj b/wxWidgets/build/msw/wx_xrc.vcxproj deleted file mode 100644 index 4424dd3d90..0000000000 --- a/wxWidgets/build/msw/wx_xrc.vcxproj +++ /dev/null @@ -1,4169 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - DLL Debug - Win32 - - - DLL Debug - x64 - - - DLL Release - Win32 - - - DLL Release - x64 - - - DLL Unicode Debug - Win32 - - - DLL Unicode Debug - x64 - - - DLL Unicode Release - Win32 - - - DLL Unicode Release - x64 - - - DLL Universal Debug - Win32 - - - DLL Universal Debug - x64 - - - DLL Universal Release - Win32 - - - DLL Universal Release - x64 - - - DLL Universal Unicode Debug - Win32 - - - DLL Universal Unicode Debug - x64 - - - DLL Universal Unicode Release - Win32 - - - DLL Universal Unicode Release - x64 - - - Release - Win32 - - - Release - x64 - - - Template - Win32 - - - Template - x64 - - - Unicode Debug - Win32 - - - Unicode Debug - x64 - - - Unicode Release - Win32 - - - Unicode Release - x64 - - - Universal Debug - Win32 - - - Universal Debug - x64 - - - Universal Release - Win32 - - - Universal Release - x64 - - - Universal Unicode Debug - Win32 - - - Universal Unicode Debug - x64 - - - Universal Unicode Release - Win32 - - - Universal Unicode Release - x64 - - - - xrc - - - {8BECCA95-C7D7-CFF8-FDB1-4950E9F8E8E6} - - - - Application - v110 - - - Application - v110 - - - DynamicLibrary - false - Unicode - v110 - - - DynamicLibrary - false - Unicode - v110 - - - DynamicLibrary - false - Unicode - v110 - - - DynamicLibrary - false - Unicode - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - DynamicLibrary - false - Unicode - v110 - - - DynamicLibrary - false - Unicode - v110 - - - DynamicLibrary - false - v110 - - - DynamicLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - DynamicLibrary - false - v110 - - - DynamicLibrary - false - v110 - - - DynamicLibrary - false - v110 - - - DynamicLibrary - false - v110 - - - StaticLibrary - false - Unicode - v110 - - - StaticLibrary - false - Unicode - v110 - - - StaticLibrary - false - Unicode - v110 - - - StaticLibrary - false - Unicode - v110 - - - DynamicLibrary - false - Unicode - v110 - - - DynamicLibrary - false - Unicode - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - Unicode - v110 - - - StaticLibrary - false - Unicode - v110 - - - DynamicLibrary - false - v110 - - - DynamicLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - v110 - - - StaticLibrary - false - Unicode - v110 - - - StaticLibrary - false - Unicode - v110 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - .\..\..\lib\vc_lib\ - .\vc_mswud\xrc\ - - - .\..\..\lib\vc_lib\ - .\vc_mswud\xrc\ - - - .\..\..\lib\vc_lib\ - .\vc_msw\xrc\ - - - .\..\..\lib\vc_lib\ - .\vc_msw\xrc\ - - - .\..\..\lib\vc_dll\ - .\vc_mswddll\xrc\ - true - - - .\..\..\lib\vc_dll\ - .\vc_mswddll\xrc\ - true - - - .\..\..\lib\vc_lib\ - .\vc_mswunivu\xrc\ - - - .\..\..\lib\vc_lib\ - .\vc_mswunivu\xrc\ - - - .\..\..\lib\vc_lib\ - .\vc_mswunivd\xrc\ - - - .\..\..\lib\vc_lib\ - .\vc_mswunivd\xrc\ - - - .\..\..\lib\vc_dll\ - .\vc_mswunivudll\xrc\ - false - - - .\..\..\lib\vc_dll\ - .\vc_mswunivudll\xrc\ - false - - - .\..\..\lib\vc_lib\ - .\vc_mswunivud\xrc\ - - - .\..\..\lib\vc_lib\ - .\vc_mswunivud\xrc\ - - - .\..\..\lib\vc_lib\ - .\vc_mswu\xrc\ - - - .\..\..\lib\vc_lib\ - .\vc_mswu\xrc\ - - - .\..\..\lib\vc_dll\ - .\vc_mswunivdll\xrc\ - false - - - .\..\..\lib\vc_dll\ - .\vc_mswunivdll\xrc\ - false - - - .\..\..\lib\vc_dll\ - .\vc_mswunivddll\xrc\ - true - - - .\..\..\lib\vc_dll\ - .\vc_mswunivddll\xrc\ - true - - - .\..\..\lib\vc_lib\ - .\vc_mswd\xrc\ - - - .\..\..\lib\vc_lib\ - .\vc_mswd\xrc\ - - - .\..\..\lib\vc_dll\ - .\vc_mswdll\xrc\ - false - - - .\..\..\lib\vc_dll\ - .\vc_mswdll\xrc\ - false - - - .\..\..\lib\vc_dll\ - .\vc_mswudll\xrc\ - false - - - .\..\..\lib\vc_dll\ - .\vc_mswudll\xrc\ - false - - - .\..\..\lib\vc_lib\ - .\vc_mswuniv\xrc\ - - - .\..\..\lib\vc_lib\ - .\vc_mswuniv\xrc\ - - - .\..\..\lib\vc_dll\ - .\vc_mswuddll\xrc\ - true - - - .\..\..\lib\vc_dll\ - .\vc_mswuddll\xrc\ - true - - - .\..\..\lib\vc_dll\ - .\vc_mswunivuddll\xrc\ - true - - - .\..\..\lib\vc_dll\ - .\vc_mswunivuddll\xrc\ - true - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - true - ..\..\lib\vc_lib\mswud;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;__WXMSW__;__WXDEBUG__;WXBUILDING;%(PreprocessorDefinitions) - .\vc_mswud\xrc\ - vc_mswud\wxprec_xrclib.pch - Use - wx/wxprec.h - .\vc_mswud\xrc\ - ..\..\lib\vc_lib\wxmsw28ud_xrc.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_xrc.bsc - - - true - ..\..\lib\vc_lib\wxmsw28ud_xrc.lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - ..\..\lib\vc_lib\mswud;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;__WXMSW__;__WXDEBUG__;WXBUILDING;%(PreprocessorDefinitions) - .\vc_mswud\xrc\ - vc_mswud\wxprec_xrclib.pch - Use - wx/wxprec.h - .\vc_mswud\xrc\ - ..\..\lib\vc_lib\wxmsw28ud_xrc.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_xrc.bsc - - - true - ..\..\lib\vc_lib\wxmsw28ud_xrc.lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_lib\msw;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;__WXMSW__;NDEBUG;WXBUILDING;%(PreprocessorDefinitions) - .\vc_msw\xrc\ - vc_msw\wxprec_xrclib.pch - Use - wx/wxprec.h - .\vc_msw\xrc\ - ..\..\lib\vc_lib\wxmsw28_xrc.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_xrc.bsc - - - true - .\..\..\..\libs\$(Configuration)\$(ProjectName).lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_lib\msw;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;__WXMSW__;NDEBUG;WXBUILDING;%(PreprocessorDefinitions) - .\vc_msw\xrc\ - vc_msw\wxprec_xrclib.pch - Use - wx/wxprec.h - .\vc_msw\xrc\ - ..\..\lib\vc_lib\wxmsw28_xrc.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_xrc.bsc - - - true - .\..\..\..\libs\$(Configuration)\$(ProjectName).lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - true - ..\..\lib\vc_dll\mswd;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXDEBUG__;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_XRC;%(PreprocessorDefinitions) - .\vc_mswddll\xrc\ - vc_mswddll\wxprec_xrcdll.pch - Use - wx/wxprec.h - .\vc_mswddll\xrc\ - ..\..\lib\vc_dll\wxmsw28d_xrc_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXDEBUG__;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_XRC;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_xrc.tlb - true - Win32 - - - 0x0409 - ..\..\lib\vc_dll\mswd;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - _DEBUG;__WXMSW__;__WXDEBUG__;WXBUILDING;WXDLLNAME=wxmsw28d_xrc_vc_custom;WXUSINGDLL;WXMAKINGDLL_XRC;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_xrc.bsc - - - true - true - true - Console - ..\..\lib\vc_dll\wxmsw28d_xrc_vc_custom.dll - ..\..\lib\vc_dll\wxmsw28d_xrc.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxtiffd.lib;wxjpegd.lib;wxpngd.lib;wxzlibd.lib;wxregexd.lib;wxexpatd.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxmsw28d_html.lib;..\..\lib\vc_dll\wxmsw28d_adv.lib;..\..\lib\vc_dll\wxmsw28d_core.lib;..\..\lib\vc_dll\wxbase28d_xml.lib;..\..\lib\vc_dll\wxbase28d.lib;%(AdditionalDependencies) - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - ..\..\lib\vc_dll\mswd;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXDEBUG__;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_XRC;%(PreprocessorDefinitions) - .\vc_mswddll\xrc\ - vc_mswddll\wxprec_xrcdll.pch - Use - wx/wxprec.h - .\vc_mswddll\xrc\ - ..\..\lib\vc_dll\wxmsw28d_xrc_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXDEBUG__;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_XRC;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_xrc.tlb - true - - - 0x0409 - ..\..\lib\vc_dll\mswd;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - _DEBUG;__WXMSW__;__WXDEBUG__;WXBUILDING;WXDLLNAME=wxmsw28d_xrc_vc_custom;WXUSINGDLL;WXMAKINGDLL_XRC;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_xrc.bsc - - - true - true - true - Console - ..\..\lib\vc_dll\wxmsw28d_xrc_vc_custom.dll - ..\..\lib\vc_dll\wxmsw28d_xrc.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxtiffd.lib;wxjpegd.lib;wxpngd.lib;wxzlibd.lib;wxregexd.lib;wxexpatd.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxmsw28d_html.lib;..\..\lib\vc_dll\wxmsw28d_adv.lib;..\..\lib\vc_dll\wxmsw28d_core.lib;..\..\lib\vc_dll\wxbase28d_xml.lib;..\..\lib\vc_dll\wxbase28d.lib;%(AdditionalDependencies) - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_lib\mswunivu;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;__WXMSW__;__WXUNIVERSAL__;NDEBUG;WXBUILDING;%(PreprocessorDefinitions) - .\vc_mswunivu\xrc\ - vc_mswunivu\wxprec_xrclib.pch - Use - wx/wxprec.h - .\vc_mswunivu\xrc\ - ..\..\lib\vc_lib\wxmswuniv28u_xrc.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_xrc.bsc - - - true - ..\..\lib\vc_lib\wxmswuniv28u_xrc.lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_lib\mswunivu;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;__WXMSW__;__WXUNIVERSAL__;NDEBUG;WXBUILDING;%(PreprocessorDefinitions) - .\vc_mswunivu\xrc\ - vc_mswunivu\wxprec_xrclib.pch - Use - wx/wxprec.h - .\vc_mswunivu\xrc\ - ..\..\lib\vc_lib\wxmswuniv28u_xrc.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_xrc.bsc - - - true - ..\..\lib\vc_lib\wxmswuniv28u_xrc.lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - true - ..\..\lib\vc_lib\mswunivd;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;WXBUILDING;%(PreprocessorDefinitions) - .\vc_mswunivd\xrc\ - vc_mswunivd\wxprec_xrclib.pch - Use - wx/wxprec.h - .\vc_mswunivd\xrc\ - ..\..\lib\vc_lib\wxmswuniv28d_xrc.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_xrc.bsc - - - true - ..\..\lib\vc_lib\wxmswuniv28d_xrc.lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - ..\..\lib\vc_lib\mswunivd;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;WXBUILDING;%(PreprocessorDefinitions) - .\vc_mswunivd\xrc\ - vc_mswunivd\wxprec_xrclib.pch - Use - wx/wxprec.h - .\vc_mswunivd\xrc\ - ..\..\lib\vc_lib\wxmswuniv28d_xrc.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_xrc.bsc - - - true - ..\..\lib\vc_lib\wxmswuniv28d_xrc.lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_dll\mswunivu;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;__WXUNIVERSAL__;NDEBUG;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_XRC;%(PreprocessorDefinitions) - .\vc_mswunivudll\xrc\ - vc_mswunivudll\wxprec_xrcdll.pch - Use - wx/wxprec.h - .\vc_mswunivudll\xrc\ - ..\..\lib\vc_dll\wxmswuniv28u_xrc_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;__WXUNIVERSAL__;NDEBUG;_UNICODE;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_XRC;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_xrc.tlb - true - Win32 - - - 0x0409 - ..\..\lib\vc_dll\mswunivu;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - __WXMSW__;__WXUNIVERSAL__;NDEBUG;_UNICODE;WXBUILDING;WXDLLNAME=wxmswuniv28u_xrc_vc_custom;WXUSINGDLL;WXMAKINGDLL_XRC;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_xrc.bsc - - - true - true - Console - ..\..\lib\vc_dll\wxmswuniv28u_xrc_vc_custom.dll - ..\..\lib\vc_dll\wxmswuniv28u_xrc.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxtiff.lib;wxjpeg.lib;wxpng.lib;wxzlib.lib;wxregexu.lib;wxexpat.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxmswuniv28u_html.lib;..\..\lib\vc_dll\wxmswuniv28u_adv.lib;..\..\lib\vc_dll\wxmswuniv28u_core.lib;..\..\lib\vc_dll\wxbase28u_xml.lib;..\..\lib\vc_dll\wxbase28u.lib;%(AdditionalDependencies) - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_dll\mswunivu;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;__WXUNIVERSAL__;NDEBUG;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_XRC;%(PreprocessorDefinitions) - .\vc_mswunivudll\xrc\ - vc_mswunivudll\wxprec_xrcdll.pch - Use - wx/wxprec.h - .\vc_mswunivudll\xrc\ - ..\..\lib\vc_dll\wxmswuniv28u_xrc_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;__WXUNIVERSAL__;NDEBUG;_UNICODE;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_XRC;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_xrc.tlb - true - - - 0x0409 - ..\..\lib\vc_dll\mswunivu;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - __WXMSW__;__WXUNIVERSAL__;NDEBUG;_UNICODE;WXBUILDING;WXDLLNAME=wxmswuniv28u_xrc_vc_custom;WXUSINGDLL;WXMAKINGDLL_XRC;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_xrc.bsc - - - true - true - Console - ..\..\lib\vc_dll\wxmswuniv28u_xrc_vc_custom.dll - ..\..\lib\vc_dll\wxmswuniv28u_xrc.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxtiff.lib;wxjpeg.lib;wxpng.lib;wxzlib.lib;wxregexu.lib;wxexpat.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxmswuniv28u_html.lib;..\..\lib\vc_dll\wxmswuniv28u_adv.lib;..\..\lib\vc_dll\wxmswuniv28u_core.lib;..\..\lib\vc_dll\wxbase28u_xml.lib;..\..\lib\vc_dll\wxbase28u.lib;%(AdditionalDependencies) - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - true - ..\..\lib\vc_lib\mswunivud;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;WXBUILDING;%(PreprocessorDefinitions) - .\vc_mswunivud\xrc\ - vc_mswunivud\wxprec_xrclib.pch - Use - wx/wxprec.h - .\vc_mswunivud\xrc\ - ..\..\lib\vc_lib\wxmswuniv28ud_xrc.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_xrc.bsc - - - true - ..\..\lib\vc_lib\wxmswuniv28ud_xrc.lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - ..\..\lib\vc_lib\mswunivud;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;WXBUILDING;%(PreprocessorDefinitions) - .\vc_mswunivud\xrc\ - vc_mswunivud\wxprec_xrclib.pch - Use - wx/wxprec.h - .\vc_mswunivud\xrc\ - ..\..\lib\vc_lib\wxmswuniv28ud_xrc.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_xrc.bsc - - - true - ..\..\lib\vc_lib\wxmswuniv28ud_xrc.lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_lib\mswu;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;__WXMSW__;NDEBUG;WXBUILDING;%(PreprocessorDefinitions) - .\vc_mswu\xrc\ - vc_mswu\wxprec_xrclib.pch - Use - wx/wxprec.h - .\vc_mswu\xrc\ - ..\..\lib\vc_lib\wxmsw28u_xrc.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_xrc.bsc - - - true - ..\..\lib\vc_lib\wxmsw28u_xrc.lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_lib\mswu;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;__WXMSW__;NDEBUG;WXBUILDING;%(PreprocessorDefinitions) - .\vc_mswu\xrc\ - vc_mswu\wxprec_xrclib.pch - Use - wx/wxprec.h - .\vc_mswu\xrc\ - ..\..\lib\vc_lib\wxmsw28u_xrc.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_xrc.bsc - - - true - ..\..\lib\vc_lib\wxmsw28u_xrc.lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_dll\mswuniv;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;__WXUNIVERSAL__;NDEBUG;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_XRC;%(PreprocessorDefinitions) - .\vc_mswunivdll\xrc\ - vc_mswunivdll\wxprec_xrcdll.pch - Use - wx/wxprec.h - .\vc_mswunivdll\xrc\ - ..\..\lib\vc_dll\wxmswuniv28_xrc_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;__WXUNIVERSAL__;NDEBUG;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_XRC;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_xrc.tlb - true - Win32 - - - 0x0409 - ..\..\lib\vc_dll\mswuniv;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - __WXMSW__;__WXUNIVERSAL__;NDEBUG;WXBUILDING;WXDLLNAME=wxmswuniv28_xrc_vc_custom;WXUSINGDLL;WXMAKINGDLL_XRC;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_xrc.bsc - - - true - true - Console - ..\..\lib\vc_dll\wxmswuniv28_xrc_vc_custom.dll - ..\..\lib\vc_dll\wxmswuniv28_xrc.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxtiff.lib;wxjpeg.lib;wxpng.lib;wxzlib.lib;wxregex.lib;wxexpat.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxmswuniv28_html.lib;..\..\lib\vc_dll\wxmswuniv28_adv.lib;..\..\lib\vc_dll\wxmswuniv28_core.lib;..\..\lib\vc_dll\wxbase28_xml.lib;..\..\lib\vc_dll\wxbase28.lib;%(AdditionalDependencies) - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_dll\mswuniv;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;__WXUNIVERSAL__;NDEBUG;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_XRC;%(PreprocessorDefinitions) - .\vc_mswunivdll\xrc\ - vc_mswunivdll\wxprec_xrcdll.pch - Use - wx/wxprec.h - .\vc_mswunivdll\xrc\ - ..\..\lib\vc_dll\wxmswuniv28_xrc_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;__WXUNIVERSAL__;NDEBUG;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_XRC;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_xrc.tlb - true - - - 0x0409 - ..\..\lib\vc_dll\mswuniv;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - __WXMSW__;__WXUNIVERSAL__;NDEBUG;WXBUILDING;WXDLLNAME=wxmswuniv28_xrc_vc_custom;WXUSINGDLL;WXMAKINGDLL_XRC;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_xrc.bsc - - - true - true - Console - ..\..\lib\vc_dll\wxmswuniv28_xrc_vc_custom.dll - ..\..\lib\vc_dll\wxmswuniv28_xrc.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxtiff.lib;wxjpeg.lib;wxpng.lib;wxzlib.lib;wxregex.lib;wxexpat.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxmswuniv28_html.lib;..\..\lib\vc_dll\wxmswuniv28_adv.lib;..\..\lib\vc_dll\wxmswuniv28_core.lib;..\..\lib\vc_dll\wxbase28_xml.lib;..\..\lib\vc_dll\wxbase28.lib;%(AdditionalDependencies) - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - true - ..\..\lib\vc_dll\mswunivd;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_XRC;%(PreprocessorDefinitions) - .\vc_mswunivddll\xrc\ - vc_mswunivddll\wxprec_xrcdll.pch - Use - wx/wxprec.h - .\vc_mswunivddll\xrc\ - ..\..\lib\vc_dll\wxmswuniv28d_xrc_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_XRC;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_xrc.tlb - true - Win32 - - - 0x0409 - ..\..\lib\vc_dll\mswunivd;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - _DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;WXBUILDING;WXDLLNAME=wxmswuniv28d_xrc_vc_custom;WXUSINGDLL;WXMAKINGDLL_XRC;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_xrc.bsc - - - true - true - true - Console - ..\..\lib\vc_dll\wxmswuniv28d_xrc_vc_custom.dll - ..\..\lib\vc_dll\wxmswuniv28d_xrc.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxtiffd.lib;wxjpegd.lib;wxpngd.lib;wxzlibd.lib;wxregexd.lib;wxexpatd.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxmswuniv28d_html.lib;..\..\lib\vc_dll\wxmswuniv28d_adv.lib;..\..\lib\vc_dll\wxmswuniv28d_core.lib;..\..\lib\vc_dll\wxbase28d_xml.lib;..\..\lib\vc_dll\wxbase28d.lib;%(AdditionalDependencies) - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - ..\..\lib\vc_dll\mswunivd;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_XRC;%(PreprocessorDefinitions) - .\vc_mswunivddll\xrc\ - vc_mswunivddll\wxprec_xrcdll.pch - Use - wx/wxprec.h - .\vc_mswunivddll\xrc\ - ..\..\lib\vc_dll\wxmswuniv28d_xrc_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_XRC;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_xrc.tlb - true - - - 0x0409 - ..\..\lib\vc_dll\mswunivd;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - _DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;WXBUILDING;WXDLLNAME=wxmswuniv28d_xrc_vc_custom;WXUSINGDLL;WXMAKINGDLL_XRC;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_xrc.bsc - - - true - true - true - Console - ..\..\lib\vc_dll\wxmswuniv28d_xrc_vc_custom.dll - ..\..\lib\vc_dll\wxmswuniv28d_xrc.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxtiffd.lib;wxjpegd.lib;wxpngd.lib;wxzlibd.lib;wxregexd.lib;wxexpatd.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxmswuniv28d_html.lib;..\..\lib\vc_dll\wxmswuniv28d_adv.lib;..\..\lib\vc_dll\wxmswuniv28d_core.lib;..\..\lib\vc_dll\wxbase28d_xml.lib;..\..\lib\vc_dll\wxbase28d.lib;%(AdditionalDependencies) - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - true - ..\..\lib\vc_lib\mswd;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;__WXMSW__;__WXDEBUG__;WXBUILDING;%(PreprocessorDefinitions) - .\vc_mswd\xrc\ - vc_mswd\wxprec_xrclib.pch - Use - wx/wxprec.h - .\vc_mswd\xrc\ - ..\..\lib\vc_lib\wxmsw28d_xrc.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_xrc.bsc - - - true - .\..\..\..\libs\$(Configuration)\$(ProjectName).lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - ..\..\lib\vc_lib\mswd;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;_DEBUG;__WXMSW__;__WXDEBUG__;WXBUILDING;%(PreprocessorDefinitions) - .\vc_mswd\xrc\ - vc_mswd\wxprec_xrclib.pch - Use - wx/wxprec.h - .\vc_mswd\xrc\ - ..\..\lib\vc_lib\wxmsw28d_xrc.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_xrc.bsc - - - true - .\..\..\..\libs\$(Configuration)\$(ProjectName).lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_dll\msw;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;NDEBUG;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_XRC;%(PreprocessorDefinitions) - .\vc_mswdll\xrc\ - vc_mswdll\wxprec_xrcdll.pch - Use - wx/wxprec.h - .\vc_mswdll\xrc\ - ..\..\lib\vc_dll\wxmsw28_xrc_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;NDEBUG;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_XRC;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_xrc.tlb - true - Win32 - - - 0x0409 - ..\..\lib\vc_dll\msw;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - __WXMSW__;NDEBUG;WXBUILDING;WXDLLNAME=wxmsw28_xrc_vc_custom;WXUSINGDLL;WXMAKINGDLL_XRC;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_xrc.bsc - - - true - true - Console - ..\..\lib\vc_dll\wxmsw28_xrc_vc_custom.dll - ..\..\lib\vc_dll\wxmsw28_xrc.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxtiff.lib;wxjpeg.lib;wxpng.lib;wxzlib.lib;wxregex.lib;wxexpat.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxmsw28_html.lib;..\..\lib\vc_dll\wxmsw28_adv.lib;..\..\lib\vc_dll\wxmsw28_core.lib;..\..\lib\vc_dll\wxbase28_xml.lib;..\..\lib\vc_dll\wxbase28.lib;%(AdditionalDependencies) - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_dll\msw;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;NDEBUG;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_XRC;%(PreprocessorDefinitions) - .\vc_mswdll\xrc\ - vc_mswdll\wxprec_xrcdll.pch - Use - wx/wxprec.h - .\vc_mswdll\xrc\ - ..\..\lib\vc_dll\wxmsw28_xrc_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;NDEBUG;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_XRC;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_xrc.tlb - true - - - 0x0409 - ..\..\lib\vc_dll\msw;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - __WXMSW__;NDEBUG;WXBUILDING;WXDLLNAME=wxmsw28_xrc_vc_custom;WXUSINGDLL;WXMAKINGDLL_XRC;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_xrc.bsc - - - true - true - Console - ..\..\lib\vc_dll\wxmsw28_xrc_vc_custom.dll - ..\..\lib\vc_dll\wxmsw28_xrc.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxtiff.lib;wxjpeg.lib;wxpng.lib;wxzlib.lib;wxregex.lib;wxexpat.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxmsw28_html.lib;..\..\lib\vc_dll\wxmsw28_adv.lib;..\..\lib\vc_dll\wxmsw28_core.lib;..\..\lib\vc_dll\wxbase28_xml.lib;..\..\lib\vc_dll\wxbase28.lib;%(AdditionalDependencies) - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_dll\mswu;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;NDEBUG;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_XRC;%(PreprocessorDefinitions) - .\vc_mswudll\xrc\ - vc_mswudll\wxprec_xrcdll.pch - Use - wx/wxprec.h - .\vc_mswudll\xrc\ - ..\..\lib\vc_dll\wxmsw28u_xrc_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;NDEBUG;_UNICODE;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_XRC;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_xrc.tlb - true - Win32 - - - 0x0409 - ..\..\lib\vc_dll\mswu;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - __WXMSW__;NDEBUG;_UNICODE;WXBUILDING;WXDLLNAME=wxmsw28u_xrc_vc_custom;WXUSINGDLL;WXMAKINGDLL_XRC;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_xrc.bsc - - - true - true - Console - ..\..\lib\vc_dll\wxmsw28u_xrc_vc_custom.dll - ..\..\lib\vc_dll\wxmsw28u_xrc.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxtiff.lib;wxjpeg.lib;wxpng.lib;wxzlib.lib;wxregexu.lib;wxexpat.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxmsw28u_html.lib;..\..\lib\vc_dll\wxmsw28u_adv.lib;..\..\lib\vc_dll\wxmsw28u_core.lib;..\..\lib\vc_dll\wxbase28u_xml.lib;..\..\lib\vc_dll\wxbase28u.lib;%(AdditionalDependencies) - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_dll\mswu;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;NDEBUG;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_XRC;%(PreprocessorDefinitions) - .\vc_mswudll\xrc\ - vc_mswudll\wxprec_xrcdll.pch - Use - wx/wxprec.h - .\vc_mswudll\xrc\ - ..\..\lib\vc_dll\wxmsw28u_xrc_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;__WXMSW__;NDEBUG;_UNICODE;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_XRC;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_xrc.tlb - true - - - 0x0409 - ..\..\lib\vc_dll\mswu;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - __WXMSW__;NDEBUG;_UNICODE;WXBUILDING;WXDLLNAME=wxmsw28u_xrc_vc_custom;WXUSINGDLL;WXMAKINGDLL_XRC;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_xrc.bsc - - - true - true - Console - ..\..\lib\vc_dll\wxmsw28u_xrc_vc_custom.dll - ..\..\lib\vc_dll\wxmsw28u_xrc.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxtiff.lib;wxjpeg.lib;wxpng.lib;wxzlib.lib;wxregexu.lib;wxexpat.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxmsw28u_html.lib;..\..\lib\vc_dll\wxmsw28u_adv.lib;..\..\lib\vc_dll\wxmsw28u_core.lib;..\..\lib\vc_dll\wxbase28u_xml.lib;..\..\lib\vc_dll\wxbase28u.lib;%(AdditionalDependencies) - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_lib\mswuniv;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;__WXMSW__;__WXUNIVERSAL__;NDEBUG;WXBUILDING;%(PreprocessorDefinitions) - .\vc_mswuniv\xrc\ - vc_mswuniv\wxprec_xrclib.pch - Use - wx/wxprec.h - .\vc_mswuniv\xrc\ - ..\..\lib\vc_lib\wxmswuniv28_xrc.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_xrc.bsc - - - true - ..\..\lib\vc_lib\wxmswuniv28_xrc.lib - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MaxSpeed - true - Level4 - true - ..\..\lib\vc_lib\mswuniv;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_LIB;__WXMSW__;__WXUNIVERSAL__;NDEBUG;WXBUILDING;%(PreprocessorDefinitions) - .\vc_mswuniv\xrc\ - vc_mswuniv\wxprec_xrclib.pch - Use - wx/wxprec.h - .\vc_mswuniv\xrc\ - ..\..\lib\vc_lib\wxmswuniv28_xrc.pdb - /EHsc - - - 0x0409 - - - true - .\..\..\lib\vc_lib\wx_xrc.bsc - - - true - ..\..\lib\vc_lib\wxmswuniv28_xrc.lib - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - true - ..\..\lib\vc_dll\mswud;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXDEBUG__;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_XRC;%(PreprocessorDefinitions) - .\vc_mswuddll\xrc\ - vc_mswuddll\wxprec_xrcdll.pch - Use - wx/wxprec.h - .\vc_mswuddll\xrc\ - ..\..\lib\vc_dll\wxmsw28ud_xrc_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXDEBUG__;_UNICODE;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_XRC;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_xrc.tlb - true - Win32 - - - 0x0409 - ..\..\lib\vc_dll\mswud;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - _DEBUG;__WXMSW__;__WXDEBUG__;_UNICODE;WXBUILDING;WXDLLNAME=wxmsw28ud_xrc_vc_custom;WXUSINGDLL;WXMAKINGDLL_XRC;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_xrc.bsc - - - true - true - true - Console - ..\..\lib\vc_dll\wxmsw28ud_xrc_vc_custom.dll - ..\..\lib\vc_dll\wxmsw28ud_xrc.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxtiffd.lib;wxjpegd.lib;wxpngd.lib;wxzlibd.lib;wxregexud.lib;wxexpatd.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxmsw28ud_html.lib;..\..\lib\vc_dll\wxmsw28ud_adv.lib;..\..\lib\vc_dll\wxmsw28ud_core.lib;..\..\lib\vc_dll\wxbase28ud_xml.lib;..\..\lib\vc_dll\wxbase28ud.lib;%(AdditionalDependencies) - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - ..\..\lib\vc_dll\mswud;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXDEBUG__;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_XRC;%(PreprocessorDefinitions) - .\vc_mswuddll\xrc\ - vc_mswuddll\wxprec_xrcdll.pch - Use - wx/wxprec.h - .\vc_mswuddll\xrc\ - ..\..\lib\vc_dll\wxmsw28ud_xrc_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXDEBUG__;_UNICODE;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_XRC;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_xrc.tlb - true - - - 0x0409 - ..\..\lib\vc_dll\mswud;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - _DEBUG;__WXMSW__;__WXDEBUG__;_UNICODE;WXBUILDING;WXDLLNAME=wxmsw28ud_xrc_vc_custom;WXUSINGDLL;WXMAKINGDLL_XRC;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_xrc.bsc - - - true - true - true - Console - ..\..\lib\vc_dll\wxmsw28ud_xrc_vc_custom.dll - ..\..\lib\vc_dll\wxmsw28ud_xrc.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxtiffd.lib;wxjpegd.lib;wxpngd.lib;wxzlibd.lib;wxregexud.lib;wxexpatd.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxmsw28ud_html.lib;..\..\lib\vc_dll\wxmsw28ud_adv.lib;..\..\lib\vc_dll\wxmsw28ud_core.lib;..\..\lib\vc_dll\wxbase28ud_xml.lib;..\..\lib\vc_dll\wxbase28ud.lib;%(AdditionalDependencies) - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - true - ..\..\lib\vc_dll\mswunivud;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_XRC;%(PreprocessorDefinitions) - .\vc_mswunivuddll\xrc\ - vc_mswunivuddll\wxprec_xrcdll.pch - Use - wx/wxprec.h - .\vc_mswunivuddll\xrc\ - ..\..\lib\vc_dll\wxmswuniv28ud_xrc_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;_UNICODE;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_XRC;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_xrc.tlb - true - Win32 - - - 0x0409 - ..\..\lib\vc_dll\mswunivud;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - _DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;_UNICODE;WXBUILDING;WXDLLNAME=wxmswuniv28ud_xrc_vc_custom;WXUSINGDLL;WXMAKINGDLL_XRC;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_xrc.bsc - - - true - true - true - Console - ..\..\lib\vc_dll\wxmswuniv28ud_xrc_vc_custom.dll - ..\..\lib\vc_dll\wxmswuniv28ud_xrc.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxtiffd.lib;wxjpegd.lib;wxpngd.lib;wxzlibd.lib;wxregexud.lib;wxexpatd.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxmswuniv28ud_html.lib;..\..\lib\vc_dll\wxmswuniv28ud_adv.lib;..\..\lib\vc_dll\wxmswuniv28ud_core.lib;..\..\lib\vc_dll\wxbase28ud_xml.lib;..\..\lib\vc_dll\wxbase28ud.lib;%(AdditionalDependencies) - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - Level4 - true - ..\..\lib\vc_dll\mswunivud;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_XRC;%(PreprocessorDefinitions) - .\vc_mswunivuddll\xrc\ - vc_mswunivuddll\wxprec_xrcdll.pch - Use - wx/wxprec.h - .\vc_mswunivuddll\xrc\ - ..\..\lib\vc_dll\wxmswuniv28ud_xrc_vc_custom.pdb - /EHsc - - - true - WIN32;_USRDLL;DLL_EXPORTS;_DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;_UNICODE;WXBUILDING;WXUSINGDLL;WXMAKINGDLL_XRC;%(PreprocessorDefinitions) - .\..\..\lib\vc_dll\wx_xrc.tlb - true - - - 0x0409 - ..\..\lib\vc_dll\mswunivud;..\..\include;..\..\src\tiff;..\..\src\jpeg;..\..\src\png;..\..\src\zlib;..\..\src\regex;..\..\src\expat\lib;%(AdditionalIncludeDirectories) - _DEBUG;__WXMSW__;__WXUNIVERSAL__;__WXDEBUG__;_UNICODE;WXBUILDING;WXDLLNAME=wxmswuniv28ud_xrc_vc_custom;WXUSINGDLL;WXMAKINGDLL_XRC;%(PreprocessorDefinitions) - - - true - .\..\..\lib\vc_dll\wx_xrc.bsc - - - true - true - true - Console - ..\..\lib\vc_dll\wxmswuniv28ud_xrc_vc_custom.dll - ..\..\lib\vc_dll\wxmswuniv28ud_xrc.lib - ..\..\lib\vc_dll;%(AdditionalLibraryDirectories) - wxtiffd.lib;wxjpegd.lib;wxpngd.lib;wxzlibd.lib;wxregexud.lib;wxexpatd.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;..\..\lib\vc_dll\wxmswuniv28ud_html.lib;..\..\lib\vc_dll\wxmswuniv28ud_adv.lib;..\..\lib\vc_dll\wxmswuniv28ud_core.lib;..\..\lib\vc_dll\wxbase28ud_xml.lib;..\..\lib\vc_dll\wxbase28ud.lib;%(AdditionalDependencies) - - - - - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - Create - Create - wx/wxprec.h - wx/wxprec.h - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - /EHsc /EHsc - - - - - true - true - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - true - true - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - true - true - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - true - true - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - true - true - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - true - true - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - true - true - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - true - true - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - \wxWidgets-2.8.12\src\msw;%(AdditionalIncludeDirectories) - - - - - copy "%(FullPath)" ..\..\lib\vc_lib\mswud\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_lib\mswud\wx\setup.h - Creating ..\..\lib\vc_lib\mswud\wx\setup.h - Creating ..\..\lib\vc_lib\mswud\wx\setup.h - ..\..\lib\vc_lib\mswud\wx\setup.h;%(Outputs) - ..\..\lib\vc_lib\mswud\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_lib\msw\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_lib\msw\wx\setup.h - Creating ..\..\lib\vc_lib\msw\wx\setup.h - Creating ..\..\lib\vc_lib\msw\wx\setup.h - ..\..\lib\vc_lib\msw\wx\setup.h;%(Outputs) - ..\..\lib\vc_lib\msw\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_dll\mswd\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_dll\mswd\wx\setup.h - Creating ..\..\lib\vc_dll\mswd\wx\setup.h - Creating ..\..\lib\vc_dll\mswd\wx\setup.h - ..\..\lib\vc_dll\mswd\wx\setup.h;%(Outputs) - ..\..\lib\vc_dll\mswd\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_lib\mswu\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_lib\mswu\wx\setup.h - Creating ..\..\lib\vc_lib\mswu\wx\setup.h - Creating ..\..\lib\vc_lib\mswu\wx\setup.h - ..\..\lib\vc_lib\mswu\wx\setup.h;%(Outputs) - ..\..\lib\vc_lib\mswu\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_lib\mswd\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_lib\mswd\wx\setup.h - Creating ..\..\lib\vc_lib\mswd\wx\setup.h - Creating ..\..\lib\vc_lib\mswd\wx\setup.h - ..\..\lib\vc_lib\mswd\wx\setup.h;%(Outputs) - ..\..\lib\vc_lib\mswd\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_dll\msw\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_dll\msw\wx\setup.h - Creating ..\..\lib\vc_dll\msw\wx\setup.h - Creating ..\..\lib\vc_dll\msw\wx\setup.h - ..\..\lib\vc_dll\msw\wx\setup.h;%(Outputs) - ..\..\lib\vc_dll\msw\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_dll\mswu\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_dll\mswu\wx\setup.h - Creating ..\..\lib\vc_dll\mswu\wx\setup.h - Creating ..\..\lib\vc_dll\mswu\wx\setup.h - ..\..\lib\vc_dll\mswu\wx\setup.h;%(Outputs) - ..\..\lib\vc_dll\mswu\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_dll\mswud\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_dll\mswud\wx\setup.h - Creating ..\..\lib\vc_dll\mswud\wx\setup.h - Creating ..\..\lib\vc_dll\mswud\wx\setup.h - ..\..\lib\vc_dll\mswud\wx\setup.h;%(Outputs) - ..\..\lib\vc_dll\mswud\wx\setup.h;%(Outputs) - - - copy "%(FullPath)" ..\..\lib\vc_lib\mswunivu\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_lib\mswunivu\wx\setup.h - Creating ..\..\lib\vc_lib\mswunivu\wx\setup.h - Creating ..\..\lib\vc_lib\mswunivu\wx\setup.h - ..\..\lib\vc_lib\mswunivu\wx\setup.h;%(Outputs) - ..\..\lib\vc_lib\mswunivu\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_lib\mswunivd\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_lib\mswunivd\wx\setup.h - Creating ..\..\lib\vc_lib\mswunivd\wx\setup.h - Creating ..\..\lib\vc_lib\mswunivd\wx\setup.h - ..\..\lib\vc_lib\mswunivd\wx\setup.h;%(Outputs) - ..\..\lib\vc_lib\mswunivd\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_dll\mswunivu\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_dll\mswunivu\wx\setup.h - Creating ..\..\lib\vc_dll\mswunivu\wx\setup.h - Creating ..\..\lib\vc_dll\mswunivu\wx\setup.h - ..\..\lib\vc_dll\mswunivu\wx\setup.h;%(Outputs) - ..\..\lib\vc_dll\mswunivu\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_lib\mswunivud\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_lib\mswunivud\wx\setup.h - Creating ..\..\lib\vc_lib\mswunivud\wx\setup.h - Creating ..\..\lib\vc_lib\mswunivud\wx\setup.h - ..\..\lib\vc_lib\mswunivud\wx\setup.h;%(Outputs) - ..\..\lib\vc_lib\mswunivud\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_dll\mswuniv\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_dll\mswuniv\wx\setup.h - Creating ..\..\lib\vc_dll\mswuniv\wx\setup.h - Creating ..\..\lib\vc_dll\mswuniv\wx\setup.h - ..\..\lib\vc_dll\mswuniv\wx\setup.h;%(Outputs) - ..\..\lib\vc_dll\mswuniv\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_dll\mswunivd\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_dll\mswunivd\wx\setup.h - Creating ..\..\lib\vc_dll\mswunivd\wx\setup.h - Creating ..\..\lib\vc_dll\mswunivd\wx\setup.h - ..\..\lib\vc_dll\mswunivd\wx\setup.h;%(Outputs) - ..\..\lib\vc_dll\mswunivd\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_lib\mswuniv\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_lib\mswuniv\wx\setup.h - Creating ..\..\lib\vc_lib\mswuniv\wx\setup.h - Creating ..\..\lib\vc_lib\mswuniv\wx\setup.h - ..\..\lib\vc_lib\mswuniv\wx\setup.h;%(Outputs) - ..\..\lib\vc_lib\mswuniv\wx\setup.h;%(Outputs) - copy "%(FullPath)" ..\..\lib\vc_dll\mswunivud\wx\setup.h - copy "%(FullPath)" ..\..\lib\vc_dll\mswunivud\wx\setup.h - Creating ..\..\lib\vc_dll\mswunivud\wx\setup.h - Creating ..\..\lib\vc_dll\mswunivud\wx\setup.h - ..\..\lib\vc_dll\mswunivud\wx\setup.h;%(Outputs) - ..\..\lib\vc_dll\mswunivud\wx\setup.h;%(Outputs) - - - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswud\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswud\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_lib\mswud\wx\msw\rcdefs.h - Creating ..\..\lib\vc_lib\mswud\wx\msw\rcdefs.h - ..\..\lib\vc_lib\mswud\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_lib\mswud\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\msw\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\msw\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_lib\msw\wx\msw\rcdefs.h - Creating ..\..\lib\vc_lib\msw\wx\msw\rcdefs.h - ..\..\lib\vc_lib\msw\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_lib\msw\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswd\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswd\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_dll\mswd\wx\msw\rcdefs.h - Creating ..\..\lib\vc_dll\mswd\wx\msw\rcdefs.h - ..\..\lib\vc_dll\mswd\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_dll\mswd\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswunivu\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswunivu\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_lib\mswunivu\wx\msw\rcdefs.h - Creating ..\..\lib\vc_lib\mswunivu\wx\msw\rcdefs.h - ..\..\lib\vc_lib\mswunivu\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_lib\mswunivu\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswunivd\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswunivd\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_lib\mswunivd\wx\msw\rcdefs.h - Creating ..\..\lib\vc_lib\mswunivd\wx\msw\rcdefs.h - ..\..\lib\vc_lib\mswunivd\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_lib\mswunivd\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswunivu\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswunivu\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_dll\mswunivu\wx\msw\rcdefs.h - Creating ..\..\lib\vc_dll\mswunivu\wx\msw\rcdefs.h - ..\..\lib\vc_dll\mswunivu\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_dll\mswunivu\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswunivud\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswunivud\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_lib\mswunivud\wx\msw\rcdefs.h - Creating ..\..\lib\vc_lib\mswunivud\wx\msw\rcdefs.h - ..\..\lib\vc_lib\mswunivud\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_lib\mswunivud\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswu\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswu\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_lib\mswu\wx\msw\rcdefs.h - Creating ..\..\lib\vc_lib\mswu\wx\msw\rcdefs.h - ..\..\lib\vc_lib\mswu\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_lib\mswu\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswuniv\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswuniv\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_dll\mswuniv\wx\msw\rcdefs.h - Creating ..\..\lib\vc_dll\mswuniv\wx\msw\rcdefs.h - ..\..\lib\vc_dll\mswuniv\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_dll\mswuniv\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswunivd\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswunivd\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_dll\mswunivd\wx\msw\rcdefs.h - Creating ..\..\lib\vc_dll\mswunivd\wx\msw\rcdefs.h - ..\..\lib\vc_dll\mswunivd\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_dll\mswunivd\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswd\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswd\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_lib\mswd\wx\msw\rcdefs.h - Creating ..\..\lib\vc_lib\mswd\wx\msw\rcdefs.h - ..\..\lib\vc_lib\mswd\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_lib\mswd\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\msw\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\msw\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_dll\msw\wx\msw\rcdefs.h - Creating ..\..\lib\vc_dll\msw\wx\msw\rcdefs.h - ..\..\lib\vc_dll\msw\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_dll\msw\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswu\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswu\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_dll\mswu\wx\msw\rcdefs.h - Creating ..\..\lib\vc_dll\mswu\wx\msw\rcdefs.h - ..\..\lib\vc_dll\mswu\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_dll\mswu\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswuniv\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_lib\mswuniv\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_lib\mswuniv\wx\msw\rcdefs.h - Creating ..\..\lib\vc_lib\mswuniv\wx\msw\rcdefs.h - ..\..\lib\vc_lib\mswuniv\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_lib\mswuniv\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswud\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswud\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_dll\mswud\wx\msw\rcdefs.h - Creating ..\..\lib\vc_dll\mswud\wx\msw\rcdefs.h - ..\..\lib\vc_dll\mswud\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_dll\mswud\wx\msw\rcdefs.h;%(Outputs) - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswunivud\wx\msw\rcdefs.h" - cl /EP /nologo "%(FullPath)" > "..\..\lib\vc_dll\mswunivud\wx\msw\rcdefs.h" - Creating ..\..\lib\vc_dll\mswunivud\wx\msw\rcdefs.h - Creating ..\..\lib\vc_dll\mswunivud\wx\msw\rcdefs.h - ..\..\lib\vc_dll\mswunivud\wx\msw\rcdefs.h;%(Outputs) - ..\..\lib\vc_dll\mswunivud\wx\msw\rcdefs.h;%(Outputs) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/wxWidgets/build/msw/wx_xrc.vcxproj.filters b/wxWidgets/build/msw/wx_xrc.vcxproj.filters deleted file mode 100644 index 48033470c1..0000000000 --- a/wxWidgets/build/msw/wx_xrc.vcxproj.filters +++ /dev/null @@ -1,382 +0,0 @@ - - - - - {9cf0c991-6b9f-467f-a5c7-9dea65352867} - - - {5dda3f7c-5b3e-4fff-b619-5520730c44bd} - - - {4079fba8-080a-400c-a452-90bfce1b4afa} - - - {8b509fe5-4cde-4f72-a4a8-dca90d167565} - - - {8cb49bfc-a8c5-4462-8761-acc8721b7beb} - - - {127c07da-0aa0-42c2-989b-26f843cfcdce} - - - - - Common Sources - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - - - MSW Sources - - - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - Common Headers - - - - - Setup Headers - - - Setup Headers - - - MSW Headers - - - \ No newline at end of file diff --git a/wxWidgets/include/msvc/wx/setup.h b/wxWidgets/include/msvc/wx/setup.h deleted file mode 100644 index 3f0e0cd5e4..0000000000 --- a/wxWidgets/include/msvc/wx/setup.h +++ /dev/null @@ -1,249 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: msvc/wx/msw/setup.h -// Purpose: wrapper around the real wx/setup.h for Visual C++ -// Author: Vadim Zeitlin -// Modified by: -// Created: 2004-12-12 -// RCS-ID: $Id: setup.h 43687 2006-11-27 15:03:59Z VZ $ -// Copyright: (c) 2004 Vadim Zeitlin -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// VC++ IDE predefines _DEBUG and _UNICODE for the new projects itself, but -// the other symbols (WXUSINGDLL, __WXUNIVERSAL__, ...) should be defined -// explicitly! - -#ifdef _MSC_VER - #ifdef _UNICODE - #ifdef WXUSINGDLL - #ifdef _DEBUG - #include "../../../lib/vc_dll/mswud/wx/setup.h" - #else - #include "../../../lib/vc_dll/mswu/wx/setup.h" - #endif - #else - #ifdef _DEBUG - #include "../../../lib/vc_lib/mswud/wx/setup.h" - #else - #include "../../../lib/vc_lib/mswu/wx/setup.h" - #endif - #endif - - #ifdef _DEBUG - #pragma comment(lib,"wxbase28ud") - #pragma comment(lib,"wxbase28ud_net") - #pragma comment(lib,"wxbase28ud_xml") - #if wxUSE_REGEX - #pragma comment(lib,"wxregexud") - #endif - - #if wxUSE_GUI - #if wxUSE_XML - #pragma comment(lib,"wxexpatd") - #endif - #if wxUSE_LIBJPEG - #pragma comment(lib,"wxjpegd") - #endif - #if wxUSE_LIBPNG - #pragma comment(lib,"wxpngd") - #endif - #if wxUSE_LIBTIFF - #pragma comment(lib,"wxtiffd") - #endif - #if wxUSE_ZLIB - #pragma comment(lib,"wxzlibd") - #endif - #pragma comment(lib,"wxmsw28ud_adv") - #pragma comment(lib,"wxmsw28ud_core") - #pragma comment(lib,"wxmsw28ud_html") - #if wxUSE_GLCANVAS - #pragma comment(lib,"wxmsw28ud_gl") - #endif - #if wxUSE_DEBUGREPORT - #pragma comment(lib,"wxmsw28ud_qa") - #endif - #if wxUSE_XRC - #pragma comment(lib,"wxmsw28ud_xrc") - #endif - #if wxUSE_AUI - #pragma comment(lib,"wxmsw28ud_aui") - #endif - #if wxUSE_RICHTEXT - #pragma comment(lib,"wxmsw28ud_richtext") - #endif - #if wxUSE_MEDIACTRL - #pragma comment(lib,"wxmsw28ud_media") - #endif - #if wxUSE_ODBC - #pragma comment(lib,"wxbase28ud_odbc") - #endif - #endif // wxUSE_GUI - #else // release - #pragma comment(lib,"wxbase28u") - #pragma comment(lib,"wxbase28u_net") - #pragma comment(lib,"wxbase28u_xml") - #if wxUSE_REGEX - #pragma comment(lib,"wxregexu") - #endif - - #if wxUSE_GUI - #if wxUSE_XML - #pragma comment(lib,"wxexpat") - #endif - #if wxUSE_LIBJPEG - #pragma comment(lib,"wxjpeg") - #endif - #if wxUSE_LIBPNG - #pragma comment(lib,"wxpng") - #endif - #if wxUSE_LIBTIFF - #pragma comment(lib,"wxtiff") - #endif - #if wxUSE_ZLIB - #pragma comment(lib,"wxzlib") - #endif - #pragma comment(lib,"wxmsw28u_adv") - #pragma comment(lib,"wxmsw28u_core") - #pragma comment(lib,"wxmsw28u_html") - #if wxUSE_GLCANVAS - #pragma comment(lib,"wxmsw28u_gl") - #endif - #if wxUSE_DEBUGREPORT - #pragma comment(lib,"wxmsw28u_qa") - #endif - #if wxUSE_XRC - #pragma comment(lib,"wxmsw28u_xrc") - #endif - #if wxUSE_AUI - #pragma comment(lib,"wxmsw28u_aui") - #endif - #if wxUSE_RICHTEXT - #pragma comment(lib,"wxmsw28u_richtext") - #endif - #if wxUSE_MEDIACTRL - #pragma comment(lib,"wxmsw28u_media") - #endif - #if wxUSE_ODBC - #pragma comment(lib,"wxbase28u_odbc") - #endif - #endif // wxUSE_GUI - #endif // debug/release - #else // !_UNICODE - #ifdef WXUSINGDLL - #ifdef _DEBUG - #include "../../../lib/vc_dll/mswd/wx/setup.h" - #else - #include "../../../lib/vc_dll/msw/wx/setup.h" - #endif - #else // static lib - #ifdef _DEBUG - #include "../../../lib/vc_lib/mswd/wx/setup.h" - #else - #include "../../../lib/vc_lib/msw/wx/setup.h" - #endif - #endif // shared/static - - #ifdef _DEBUG - #pragma comment(lib,"wxbase28d") - #pragma comment(lib,"wxbase28d_net") - #pragma comment(lib,"wxbase28d_xml") - #if wxUSE_REGEX - #pragma comment(lib,"wxregexd") - #endif - - #if wxUSE_GUI - #if wxUSE_XML - #pragma comment(lib,"wxexpatd") - #endif - #if wxUSE_LIBJPEG - #pragma comment(lib,"wxjpegd") - #endif - #if wxUSE_LIBPNG - #pragma comment(lib,"wxpngd") - #endif - #if wxUSE_LIBTIFF - #pragma comment(lib,"wxtiffd") - #endif - #if wxUSE_ZLIB - #pragma comment(lib,"wxzlibd") - #endif - #pragma comment(lib,"wxmsw28d_adv") - #pragma comment(lib,"wxmsw28d_core") - #pragma comment(lib,"wxmsw28d_html") - #if wxUSE_GLCANVAS - #pragma comment(lib,"wxmsw28d_gl") - #endif - #if wxUSE_DEBUGREPORT - #pragma comment(lib,"wxmsw28d_qa") - #endif - #if wxUSE_XRC - #pragma comment(lib,"wxmsw28d_xrc") - #endif - #if wxUSE_AUI - #pragma comment(lib,"wxmsw28d_aui") - #endif - #if wxUSE_RICHTEXT - #pragma comment(lib,"wxmsw28d_richtext") - #endif - #if wxUSE_MEDIACTRL - #pragma comment(lib,"wxmsw28d_media") - #endif - #if wxUSE_ODBC - #pragma comment(lib,"wxbase28d_odbc") - #endif - #endif // wxUSE_GUI - #else // release - #pragma comment(lib,"wxbase28") - #pragma comment(lib,"wxbase28_net") - #pragma comment(lib,"wxbase28_xml") - #if wxUSE_REGEX - #pragma comment(lib,"wxregex") - #endif - - #if wxUSE_GUI - #if wxUSE_XML - #pragma comment(lib,"wxexpat") - #endif - #if wxUSE_LIBJPEG - #pragma comment(lib,"wxjpeg") - #endif - #if wxUSE_LIBPNG - #pragma comment(lib,"wxpng") - #endif - #if wxUSE_LIBTIFF - #pragma comment(lib,"wxtiff") - #endif - #if wxUSE_ZLIB - #pragma comment(lib,"wxzlib") - #endif - #pragma comment(lib,"wxmsw28_adv") - #pragma comment(lib,"wxmsw28_core") - #pragma comment(lib,"wxmsw28_html") - #if wxUSE_GLCANVAS - #pragma comment(lib,"wxmsw28_gl") - #endif - #if wxUSE_DEBUGREPORT - #pragma comment(lib,"wxmsw28_qa") - #endif - #if wxUSE_XRC - #pragma comment(lib,"wxmsw28_xrc") - #endif - #if wxUSE_AUI - #pragma comment(lib,"wxmsw28_aui") - #endif - #if wxUSE_RICHTEXT - #pragma comment(lib,"wxmsw28_richtext") - #endif - #if wxUSE_MEDIACTRL - #pragma comment(lib,"wxmsw28_media") - #endif - #if wxUSE_ODBC - #pragma comment(lib,"wxbase28_odbc") - #endif - #endif // wxUSE_GUI - #endif // debug/release - #endif // _UNICODE/!_UNICODE -#else - #error "This file should only be included when using Microsoft Visual C++" -#endif - diff --git a/wxWidgets/include/wx/aboutdlg.h b/wxWidgets/include/wx/aboutdlg.h deleted file mode 100644 index 19a6fb949c..0000000000 --- a/wxWidgets/include/wx/aboutdlg.h +++ /dev/null @@ -1,161 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: wx/aboutdlg.h -// Purpose: declaration of wxAboutDialog class -// Author: Vadim Zeitlin -// Created: 2006-10-07 -// RCS-ID: $Id: aboutdlg.h 58748 2009-02-08 09:46:03Z VZ $ -// Copyright: (c) 2006 Vadim Zeitlin -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_ABOUTDLG_H_ -#define _WX_ABOUTDLG_H_ - -#include "wx/defs.h" - -#if wxUSE_ABOUTDLG - -#include "wx/app.h" -#include "wx/icon.h" - -// ---------------------------------------------------------------------------- -// wxAboutDialogInfo: information shown by the standard "About" dialog -// ---------------------------------------------------------------------------- - -class WXDLLIMPEXP_ADV wxAboutDialogInfo -{ -public: - // all fields are initially uninitialized - wxAboutDialogInfo() { } - - // accessors for various simply fields - // ----------------------------------- - - // name of the program, if not used defaults wxApp::GetAppName() - void SetName(const wxString& name) { m_name = name; } - wxString GetName() const - { return m_name.empty() ? wxTheApp->GetAppName() : m_name; } - - // version of the program, in free format (but without "version" word) - void SetVersion(const wxString& version) { m_version = version; } - bool HasVersion() const { return !m_version.empty(); } - wxString GetVersion() const { return m_version; } - - // brief, but possibly multiline, description of the program - void SetDescription(const wxString& desc) { m_description = desc; } - bool HasDescription() const { return !m_description.empty(); } - wxString GetDescription() const { return m_description; } - - // short string containing the program copyright information - void SetCopyright(const wxString& copyright) { m_copyright = copyright; } - bool HasCopyright() const { return !m_copyright.empty(); } - wxString GetCopyright() const { return m_copyright; } - - // long, multiline string containing the text of the program licence - void SetLicence(const wxString& licence) { m_licence = licence; } - void SetLicense(const wxString& licence) { m_licence = licence; } - bool HasLicence() const { return !m_licence.empty(); } - wxString GetLicence() const { return m_licence; } - - // icon to be shown in the dialog, defaults to the main frame icon - void SetIcon(const wxIcon& icon) { m_icon = icon; } - bool HasIcon() const { return m_icon.Ok(); } - wxIcon GetIcon() const; - - // web site for the program and its description (defaults to URL itself if - // empty) - void SetWebSite(const wxString& url, const wxString& desc = wxEmptyString) - { - m_url = url; - m_urlDesc = desc.empty() ? url : desc; - } - - bool HasWebSite() const { return !m_url.empty(); } - - wxString GetWebSiteURL() const { return m_url; } - wxString GetWebSiteDescription() const { return m_urlDesc; } - - // accessors for the arrays - // ------------------------ - - // the list of developers of the program - void SetDevelopers(const wxArrayString& developers) - { m_developers = developers; } - void AddDeveloper(const wxString& developer) - { m_developers.push_back(developer); } - - bool HasDevelopers() const { return !m_developers.empty(); } - const wxArrayString& GetDevelopers() const { return m_developers; } - - // the list of documentation writers - void SetDocWriters(const wxArrayString& docwriters) - { m_docwriters = docwriters; } - void AddDocWriter(const wxString& docwriter) - { m_docwriters.push_back(docwriter); } - - bool HasDocWriters() const { return !m_docwriters.empty(); } - const wxArrayString& GetDocWriters() const { return m_docwriters; } - - // the list of artists for the program art - void SetArtists(const wxArrayString& artists) - { m_artists = artists; } - void AddArtist(const wxString& artist) - { m_artists.push_back(artist); } - - bool HasArtists() const { return !m_artists.empty(); } - const wxArrayString& GetArtists() const { return m_artists; } - - // the list of translators - void SetTranslators(const wxArrayString& translators) - { m_translators = translators; } - void AddTranslator(const wxString& translator) - { m_translators.push_back(translator); } - - bool HasTranslators() const { return !m_translators.empty(); } - const wxArrayString& GetTranslators() const { return m_translators; } - - - // implementation only - // ------------------- - - // "simple" about dialog shows only textual information (with possibly - // default icon but without hyperlink nor any long texts such as the - // licence text) - bool IsSimple() const - { return !HasWebSite() && !HasIcon() && !HasLicence(); } - - // get the description and credits (i.e. all of developers, doc writers, - // artists and translators) as a one long multiline string - wxString GetDescriptionAndCredits() const; - -#if wxABI_VERSION >= 20810 - // returns the copyright with the (C) string substituted by the Unicode - // character U+00A9 - wxString GetCopyrightToDisplay() const; -#endif // wx 2.8.10+ - -private: - wxString m_name, - m_version, - m_description, - m_copyright, - m_licence; - - wxIcon m_icon; - - wxString m_url, - m_urlDesc; - - wxArrayString m_developers, - m_docwriters, - m_artists, - m_translators; -}; - -// functions to show the about dialog box -WXDLLIMPEXP_ADV void wxAboutBox(const wxAboutDialogInfo& info); - -#endif // wxUSE_ABOUTDLG - -#endif // _WX_ABOUTDLG_H_ - diff --git a/wxWidgets/include/wx/accel.h b/wxWidgets/include/wx/accel.h deleted file mode 100644 index 8d178f5223..0000000000 --- a/wxWidgets/include/wx/accel.h +++ /dev/null @@ -1,170 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: wx/accel.h -// Purpose: wxAcceleratorEntry and wxAcceleratorTable classes -// Author: Julian Smart, Robert Roebling, Vadim Zeitlin -// Modified by: -// Created: 31.05.01 (extracted from other files) -// RCS-ID: $Id: accel.h 66927 2011-02-16 23:27:30Z JS $ -// Copyright: (c) wxWidgets team -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_ACCEL_H_BASE_ -#define _WX_ACCEL_H_BASE_ - -#include "wx/defs.h" - -#if wxUSE_ACCEL - -#include "wx/object.h" - -class WXDLLIMPEXP_FWD_CORE wxAcceleratorTable; -class WXDLLIMPEXP_FWD_CORE wxMenuItem; -class WXDLLIMPEXP_FWD_CORE wxKeyEvent; - -// ---------------------------------------------------------------------------- -// constants -// ---------------------------------------------------------------------------- - -// wxAcceleratorEntry flags -enum -{ - wxACCEL_NORMAL = 0x0000, // no modifiers - wxACCEL_ALT = 0x0001, // hold Alt key down - wxACCEL_CTRL = 0x0002, // hold Ctrl key down - wxACCEL_SHIFT = 0x0004, // hold Shift key down -#if defined(__WXMAC__) || defined(__WXCOCOA__) - wxACCEL_CMD = 0x0008 // Command key on OS X -#else - wxACCEL_CMD = wxACCEL_CTRL -#endif -}; - -// ---------------------------------------------------------------------------- -// an entry in wxAcceleratorTable corresponds to one accelerator -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxAcceleratorEntry -{ -public: - wxAcceleratorEntry(int flags = 0, int keyCode = 0, int cmd = 0, - wxMenuItem *item = NULL) - : m_flags(flags) - , m_keyCode(keyCode) - , m_command(cmd) - , m_item(item) - { } - - wxAcceleratorEntry(const wxAcceleratorEntry& entry) - : m_flags(entry.m_flags) - , m_keyCode(entry.m_keyCode) - , m_command(entry.m_command) - , m_item(entry.m_item) - { } - - // create accelerator corresponding to the specified string, return NULL if - // string couldn't be parsed or a pointer to be deleted by the caller - static wxAcceleratorEntry *Create(const wxString& str); - - wxAcceleratorEntry& operator=(const wxAcceleratorEntry& entry) - { - Set(entry.m_flags, entry.m_keyCode, entry.m_command, entry.m_item); - return *this; - } - - void Set(int flags, int keyCode, int cmd, wxMenuItem *item = NULL) - { - m_flags = flags; - m_keyCode = keyCode; - m_command = cmd; - m_item = item; - } - - void SetMenuItem(wxMenuItem *item) { m_item = item; } - - int GetFlags() const { return m_flags; } - int GetKeyCode() const { return m_keyCode; } - int GetCommand() const { return m_command; } - - wxMenuItem *GetMenuItem() const { return m_item; } - - bool operator==(const wxAcceleratorEntry& entry) const - { - return m_flags == entry.m_flags && - m_keyCode == entry.m_keyCode && - m_command == entry.m_command && - m_item == entry.m_item; - } - - bool operator!=(const wxAcceleratorEntry& entry) const - { return !(*this == entry); } - -#if defined(__WXMOTIF__) - // Implementation use only - bool MatchesEvent(const wxKeyEvent& event) const; -#endif - - bool IsOk() const - { - return m_keyCode != 0; - } - - - // string <-> wxAcceleratorEntry conversion - // ---------------------------------------- - - // returns a wxString for the this accelerator. - // this function formats it using the - format - // where maybe a hyphen-separed list of "shift|alt|ctrl" - wxString ToString() const; - - // returns true if the given string correctly initialized this object - // (i.e. if IsOk() returns true after this call) - bool FromString(const wxString& str); - - -private: - // common part of Create() and FromString() - static bool ParseAccel(const wxString& str, int *flags, int *keycode); - - - int m_flags; // combination of wxACCEL_XXX constants - int m_keyCode; // ASCII or virtual keycode - int m_command; // Command id to generate - - // the menu item this entry corresponds to, may be NULL - wxMenuItem *m_item; - - // for compatibility with old code, use accessors now! - friend class WXDLLIMPEXP_FWD_CORE wxMenu; -}; - -// ---------------------------------------------------------------------------- -// include wxAcceleratorTable class declaration, it is only used by the library -// and so doesn't have any published user visible interface -// ---------------------------------------------------------------------------- - -#if defined(__WXUNIVERSAL__) - #include "wx/generic/accel.h" -#elif defined(__WXMSW__) - #include "wx/msw/accel.h" -#elif defined(__WXMOTIF__) - #include "wx/motif/accel.h" -#elif defined(__WXGTK20__) - #include "wx/gtk/accel.h" -#elif defined(__WXGTK__) - #include "wx/gtk1/accel.h" -#elif defined(__WXMAC__) - #include "wx/mac/accel.h" -#elif defined(__WXCOCOA__) - #include "wx/generic/accel.h" -#elif defined(__WXPM__) - #include "wx/os2/accel.h" -#endif - -extern WXDLLEXPORT_DATA(wxAcceleratorTable) wxNullAcceleratorTable; - -#endif // wxUSE_ACCEL - -#endif - // _WX_ACCEL_H_BASE_ diff --git a/wxWidgets/include/wx/access.h b/wxWidgets/include/wx/access.h deleted file mode 100644 index 0a83346ab2..0000000000 --- a/wxWidgets/include/wx/access.h +++ /dev/null @@ -1,377 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/access.h -// Purpose: Accessibility classes -// Author: Julian Smart -// Modified by: -// Created: 2003-02-12 -// RCS-ID: $Id: access.h 51246 2008-01-16 12:56:37Z VZ $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_ACCESSBASE_H_ -#define _WX_ACCESSBASE_H_ - -// ---------------------------------------------------------------------------- -// headers we have to include here -// ---------------------------------------------------------------------------- - -#include "wx/defs.h" - -#if wxUSE_ACCESSIBILITY - -#include "wx/variant.h" - -typedef enum -{ - wxACC_FAIL, - wxACC_FALSE, - wxACC_OK, - wxACC_NOT_IMPLEMENTED, - wxACC_NOT_SUPPORTED -} wxAccStatus; - -// Child ids are integer identifiers from 1 up. -// So zero represents 'this' object. -#define wxACC_SELF 0 - -// Navigation constants - -typedef enum -{ - wxNAVDIR_DOWN, - wxNAVDIR_FIRSTCHILD, - wxNAVDIR_LASTCHILD, - wxNAVDIR_LEFT, - wxNAVDIR_NEXT, - wxNAVDIR_PREVIOUS, - wxNAVDIR_RIGHT, - wxNAVDIR_UP -} wxNavDir; - -// Role constants - -typedef enum { - wxROLE_NONE, - wxROLE_SYSTEM_ALERT, - wxROLE_SYSTEM_ANIMATION, - wxROLE_SYSTEM_APPLICATION, - wxROLE_SYSTEM_BORDER, - wxROLE_SYSTEM_BUTTONDROPDOWN, - wxROLE_SYSTEM_BUTTONDROPDOWNGRID, - wxROLE_SYSTEM_BUTTONMENU, - wxROLE_SYSTEM_CARET, - wxROLE_SYSTEM_CELL, - wxROLE_SYSTEM_CHARACTER, - wxROLE_SYSTEM_CHART, - wxROLE_SYSTEM_CHECKBUTTON, - wxROLE_SYSTEM_CLIENT, - wxROLE_SYSTEM_CLOCK, - wxROLE_SYSTEM_COLUMN, - wxROLE_SYSTEM_COLUMNHEADER, - wxROLE_SYSTEM_COMBOBOX, - wxROLE_SYSTEM_CURSOR, - wxROLE_SYSTEM_DIAGRAM, - wxROLE_SYSTEM_DIAL, - wxROLE_SYSTEM_DIALOG, - wxROLE_SYSTEM_DOCUMENT, - wxROLE_SYSTEM_DROPLIST, - wxROLE_SYSTEM_EQUATION, - wxROLE_SYSTEM_GRAPHIC, - wxROLE_SYSTEM_GRIP, - wxROLE_SYSTEM_GROUPING, - wxROLE_SYSTEM_HELPBALLOON, - wxROLE_SYSTEM_HOTKEYFIELD, - wxROLE_SYSTEM_INDICATOR, - wxROLE_SYSTEM_LINK, - wxROLE_SYSTEM_LIST, - wxROLE_SYSTEM_LISTITEM, - wxROLE_SYSTEM_MENUBAR, - wxROLE_SYSTEM_MENUITEM, - wxROLE_SYSTEM_MENUPOPUP, - wxROLE_SYSTEM_OUTLINE, - wxROLE_SYSTEM_OUTLINEITEM, - wxROLE_SYSTEM_PAGETAB, - wxROLE_SYSTEM_PAGETABLIST, - wxROLE_SYSTEM_PANE, - wxROLE_SYSTEM_PROGRESSBAR, - wxROLE_SYSTEM_PROPERTYPAGE, - wxROLE_SYSTEM_PUSHBUTTON, - wxROLE_SYSTEM_RADIOBUTTON, - wxROLE_SYSTEM_ROW, - wxROLE_SYSTEM_ROWHEADER, - wxROLE_SYSTEM_SCROLLBAR, - wxROLE_SYSTEM_SEPARATOR, - wxROLE_SYSTEM_SLIDER, - wxROLE_SYSTEM_SOUND, - wxROLE_SYSTEM_SPINBUTTON, - wxROLE_SYSTEM_STATICTEXT, - wxROLE_SYSTEM_STATUSBAR, - wxROLE_SYSTEM_TABLE, - wxROLE_SYSTEM_TEXT, - wxROLE_SYSTEM_TITLEBAR, - wxROLE_SYSTEM_TOOLBAR, - wxROLE_SYSTEM_TOOLTIP, - wxROLE_SYSTEM_WHITESPACE, - wxROLE_SYSTEM_WINDOW -} wxAccRole; - -// Object types - -typedef enum { - wxOBJID_WINDOW = 0x00000000, - wxOBJID_SYSMENU = 0xFFFFFFFF, - wxOBJID_TITLEBAR = 0xFFFFFFFE, - wxOBJID_MENU = 0xFFFFFFFD, - wxOBJID_CLIENT = 0xFFFFFFFC, - wxOBJID_VSCROLL = 0xFFFFFFFB, - wxOBJID_HSCROLL = 0xFFFFFFFA, - wxOBJID_SIZEGRIP = 0xFFFFFFF9, - wxOBJID_CARET = 0xFFFFFFF8, - wxOBJID_CURSOR = 0xFFFFFFF7, - wxOBJID_ALERT = 0xFFFFFFF6, - wxOBJID_SOUND = 0xFFFFFFF5 -} wxAccObject; - -// Accessible states - -#define wxACC_STATE_SYSTEM_ALERT_HIGH 0x00000001 -#define wxACC_STATE_SYSTEM_ALERT_MEDIUM 0x00000002 -#define wxACC_STATE_SYSTEM_ALERT_LOW 0x00000004 -#define wxACC_STATE_SYSTEM_ANIMATED 0x00000008 -#define wxACC_STATE_SYSTEM_BUSY 0x00000010 -#define wxACC_STATE_SYSTEM_CHECKED 0x00000020 -#define wxACC_STATE_SYSTEM_COLLAPSED 0x00000040 -#define wxACC_STATE_SYSTEM_DEFAULT 0x00000080 -#define wxACC_STATE_SYSTEM_EXPANDED 0x00000100 -#define wxACC_STATE_SYSTEM_EXTSELECTABLE 0x00000200 -#define wxACC_STATE_SYSTEM_FLOATING 0x00000400 -#define wxACC_STATE_SYSTEM_FOCUSABLE 0x00000800 -#define wxACC_STATE_SYSTEM_FOCUSED 0x00001000 -#define wxACC_STATE_SYSTEM_HOTTRACKED 0x00002000 -#define wxACC_STATE_SYSTEM_INVISIBLE 0x00004000 -#define wxACC_STATE_SYSTEM_MARQUEED 0x00008000 -#define wxACC_STATE_SYSTEM_MIXED 0x00010000 -#define wxACC_STATE_SYSTEM_MULTISELECTABLE 0x00020000 -#define wxACC_STATE_SYSTEM_OFFSCREEN 0x00040000 -#define wxACC_STATE_SYSTEM_PRESSED 0x00080000 -#define wxACC_STATE_SYSTEM_PROTECTED 0x00100000 -#define wxACC_STATE_SYSTEM_READONLY 0x00200000 -#define wxACC_STATE_SYSTEM_SELECTABLE 0x00400000 -#define wxACC_STATE_SYSTEM_SELECTED 0x00800000 -#define wxACC_STATE_SYSTEM_SELFVOICING 0x01000000 -#define wxACC_STATE_SYSTEM_UNAVAILABLE 0x02000000 - -// Selection flag - -typedef enum -{ - wxACC_SEL_NONE = 0, - wxACC_SEL_TAKEFOCUS = 1, - wxACC_SEL_TAKESELECTION = 2, - wxACC_SEL_EXTENDSELECTION = 4, - wxACC_SEL_ADDSELECTION = 8, - wxACC_SEL_REMOVESELECTION = 16 -} wxAccSelectionFlags; - -// Accessibility event identifiers - -#define wxACC_EVENT_SYSTEM_SOUND 0x0001 -#define wxACC_EVENT_SYSTEM_ALERT 0x0002 -#define wxACC_EVENT_SYSTEM_FOREGROUND 0x0003 -#define wxACC_EVENT_SYSTEM_MENUSTART 0x0004 -#define wxACC_EVENT_SYSTEM_MENUEND 0x0005 -#define wxACC_EVENT_SYSTEM_MENUPOPUPSTART 0x0006 -#define wxACC_EVENT_SYSTEM_MENUPOPUPEND 0x0007 -#define wxACC_EVENT_SYSTEM_CAPTURESTART 0x0008 -#define wxACC_EVENT_SYSTEM_CAPTUREEND 0x0009 -#define wxACC_EVENT_SYSTEM_MOVESIZESTART 0x000A -#define wxACC_EVENT_SYSTEM_MOVESIZEEND 0x000B -#define wxACC_EVENT_SYSTEM_CONTEXTHELPSTART 0x000C -#define wxACC_EVENT_SYSTEM_CONTEXTHELPEND 0x000D -#define wxACC_EVENT_SYSTEM_DRAGDROPSTART 0x000E -#define wxACC_EVENT_SYSTEM_DRAGDROPEND 0x000F -#define wxACC_EVENT_SYSTEM_DIALOGSTART 0x0010 -#define wxACC_EVENT_SYSTEM_DIALOGEND 0x0011 -#define wxACC_EVENT_SYSTEM_SCROLLINGSTART 0x0012 -#define wxACC_EVENT_SYSTEM_SCROLLINGEND 0x0013 -#define wxACC_EVENT_SYSTEM_SWITCHSTART 0x0014 -#define wxACC_EVENT_SYSTEM_SWITCHEND 0x0015 -#define wxACC_EVENT_SYSTEM_MINIMIZESTART 0x0016 -#define wxACC_EVENT_SYSTEM_MINIMIZEEND 0x0017 -#define wxACC_EVENT_OBJECT_CREATE 0x8000 -#define wxACC_EVENT_OBJECT_DESTROY 0x8001 -#define wxACC_EVENT_OBJECT_SHOW 0x8002 -#define wxACC_EVENT_OBJECT_HIDE 0x8003 -#define wxACC_EVENT_OBJECT_REORDER 0x8004 -#define wxACC_EVENT_OBJECT_FOCUS 0x8005 -#define wxACC_EVENT_OBJECT_SELECTION 0x8006 -#define wxACC_EVENT_OBJECT_SELECTIONADD 0x8007 -#define wxACC_EVENT_OBJECT_SELECTIONREMOVE 0x8008 -#define wxACC_EVENT_OBJECT_SELECTIONWITHIN 0x8009 -#define wxACC_EVENT_OBJECT_STATECHANGE 0x800A -#define wxACC_EVENT_OBJECT_LOCATIONCHANGE 0x800B -#define wxACC_EVENT_OBJECT_NAMECHANGE 0x800C -#define wxACC_EVENT_OBJECT_DESCRIPTIONCHANGE 0x800D -#define wxACC_EVENT_OBJECT_VALUECHANGE 0x800E -#define wxACC_EVENT_OBJECT_PARENTCHANGE 0x800F -#define wxACC_EVENT_OBJECT_HELPCHANGE 0x8010 -#define wxACC_EVENT_OBJECT_DEFACTIONCHANGE 0x8011 -#define wxACC_EVENT_OBJECT_ACCELERATORCHANGE 0x8012 - -// ---------------------------------------------------------------------------- -// wxAccessible -// All functions return an indication of success, failure, or not implemented. -// ---------------------------------------------------------------------------- - -class WXDLLIMPEXP_FWD_CORE wxAccessible; -class WXDLLIMPEXP_FWD_CORE wxWindow; -class WXDLLIMPEXP_FWD_CORE wxPoint; -class WXDLLIMPEXP_FWD_CORE wxRect; -class WXDLLEXPORT wxAccessibleBase : public wxObject -{ - DECLARE_NO_COPY_CLASS(wxAccessibleBase) - -public: - wxAccessibleBase(wxWindow* win): m_window(win) {} - virtual ~wxAccessibleBase() {} - -// Overridables - - // Can return either a child object, or an integer - // representing the child element, starting from 1. - // pt is in screen coordinates. - virtual wxAccStatus HitTest(const wxPoint& WXUNUSED(pt), int* WXUNUSED(childId), wxAccessible** WXUNUSED(childObject)) - { return wxACC_NOT_IMPLEMENTED; } - - // Returns the rectangle for this object (id = 0) or a child element (id > 0). - // rect is in screen coordinates. - virtual wxAccStatus GetLocation(wxRect& WXUNUSED(rect), int WXUNUSED(elementId)) - { return wxACC_NOT_IMPLEMENTED; } - - // Navigates from fromId to toId/toObject. - virtual wxAccStatus Navigate(wxNavDir WXUNUSED(navDir), int WXUNUSED(fromId), - int* WXUNUSED(toId), wxAccessible** WXUNUSED(toObject)) - { return wxACC_NOT_IMPLEMENTED; } - - // Gets the name of the specified object. - virtual wxAccStatus GetName(int WXUNUSED(childId), wxString* WXUNUSED(name)) - { return wxACC_NOT_IMPLEMENTED; } - - // Gets the number of children. - virtual wxAccStatus GetChildCount(int* WXUNUSED(childCount)) - { return wxACC_NOT_IMPLEMENTED; } - - // Gets the specified child (starting from 1). - // If *child is NULL and return value is wxACC_OK, - // this means that the child is a simple element and - // not an accessible object. - virtual wxAccStatus GetChild(int WXUNUSED(childId), wxAccessible** WXUNUSED(child)) - { return wxACC_NOT_IMPLEMENTED; } - - // Gets the parent, or NULL. - virtual wxAccStatus GetParent(wxAccessible** WXUNUSED(parent)) - { return wxACC_NOT_IMPLEMENTED; } - - // Performs the default action. childId is 0 (the action for this object) - // or > 0 (the action for a child). - // Return wxACC_NOT_SUPPORTED if there is no default action for this - // window (e.g. an edit control). - virtual wxAccStatus DoDefaultAction(int WXUNUSED(childId)) - { return wxACC_NOT_IMPLEMENTED; } - - // Gets the default action for this object (0) or > 0 (the action for a child). - // Return wxACC_OK even if there is no action. actionName is the action, or the empty - // string if there is no action. - // The retrieved string describes the action that is performed on an object, - // not what the object does as a result. For example, a toolbar button that prints - // a document has a default action of "Press" rather than "Prints the current document." - virtual wxAccStatus GetDefaultAction(int WXUNUSED(childId), wxString* WXUNUSED(actionName)) - { return wxACC_NOT_IMPLEMENTED; } - - // Returns the description for this object or a child. - virtual wxAccStatus GetDescription(int WXUNUSED(childId), wxString* WXUNUSED(description)) - { return wxACC_NOT_IMPLEMENTED; } - - // Returns help text for this object or a child, similar to tooltip text. - virtual wxAccStatus GetHelpText(int WXUNUSED(childId), wxString* WXUNUSED(helpText)) - { return wxACC_NOT_IMPLEMENTED; } - - // Returns the keyboard shortcut for this object or child. - // Return e.g. ALT+K - virtual wxAccStatus GetKeyboardShortcut(int WXUNUSED(childId), wxString* WXUNUSED(shortcut)) - { return wxACC_NOT_IMPLEMENTED; } - - // Returns a role constant. - virtual wxAccStatus GetRole(int WXUNUSED(childId), wxAccRole* WXUNUSED(role)) - { return wxACC_NOT_IMPLEMENTED; } - - // Returns a state constant. - virtual wxAccStatus GetState(int WXUNUSED(childId), long* WXUNUSED(state)) - { return wxACC_NOT_IMPLEMENTED; } - - // Returns a localized string representing the value for the object - // or child. - virtual wxAccStatus GetValue(int WXUNUSED(childId), wxString* WXUNUSED(strValue)) - { return wxACC_NOT_IMPLEMENTED; } - - // Selects the object or child. - virtual wxAccStatus Select(int WXUNUSED(childId), wxAccSelectionFlags WXUNUSED(selectFlags)) - { return wxACC_NOT_IMPLEMENTED; } - - // Gets the window with the keyboard focus. - // If childId is 0 and child is NULL, no object in - // this subhierarchy has the focus. - // If this object has the focus, child should be 'this'. - virtual wxAccStatus GetFocus(int* WXUNUSED(childId), wxAccessible** WXUNUSED(child)) - { return wxACC_NOT_IMPLEMENTED; } - -#if wxUSE_VARIANT - // Gets a variant representing the selected children - // of this object. - // Acceptable values: - // - a null variant (IsNull() returns TRUE) - // - a list variant (GetType() == wxT("list")) - // - an integer representing the selected child element, - // or 0 if this object is selected (GetType() == wxT("long")) - // - a "void*" pointer to a wxAccessible child object - virtual wxAccStatus GetSelections(wxVariant* WXUNUSED(selections)) - { return wxACC_NOT_IMPLEMENTED; } -#endif // wxUSE_VARIANT - -// Accessors - - // Returns the window associated with this object. - - wxWindow* GetWindow() { return m_window; } - - // Sets the window associated with this object. - - void SetWindow(wxWindow* window) { m_window = window; } - -// Operations - - // Each platform's implementation must define this - // static void NotifyEvent(int eventType, wxWindow* window, wxAccObject objectType, - // int objectId); - -private: - -// Data members - - wxWindow* m_window; -}; - - -// ---------------------------------------------------------------------------- -// now include the declaration of the real class -// ---------------------------------------------------------------------------- - -#if defined(__WXMSW__) - #include "wx/msw/ole/access.h" -#endif - -#endif // wxUSE_ACCESSIBILITY - -#endif // _WX_ACCESSBASE_H_ - diff --git a/wxWidgets/include/wx/afterstd.h b/wxWidgets/include/wx/afterstd.h deleted file mode 100644 index 7f30773435..0000000000 --- a/wxWidgets/include/wx/afterstd.h +++ /dev/null @@ -1,71 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: include/wx/afterstd.h -// Purpose: #include after STL headers -// Author: Vadim Zeitlin -// Modified by: -// Created: 07/07/03 -// RCS-ID: $Id: afterstd.h 61871 2009-09-09 22:29:51Z VZ $ -// Copyright: (c) 2003 Vadim Zeitlin -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -/** - See the comments in beforestd.h. - */ - -#if defined(__WXMSW__) - #include "wx/msw/winundef.h" -#endif - -// undo what we did in wx/beforestd.h -#if defined(__VISUALC__) && __VISUALC__ <= 1201 - // MSVC 5 does not have this - #if _MSC_VER > 1100 - // don't restore this one for VC6, it gives it in each try/catch which is a - // bit annoying to say the least - #if _MSC_VER >= 0x1300 - // unreachable code - #pragma warning(default:4702) - #endif // VC++ >= 7 - - #pragma warning(pop) - #else - // 'expression' : signed/unsigned mismatch - #pragma warning(default:4018) - - // 'identifier' : unreferenced formal parameter - #pragma warning(default:4100) - - // 'conversion' : conversion from 'type1' to 'type2', - // possible loss of data - #pragma warning(default:4244) - - // C++ language change: to explicitly specialize class template - // 'identifier' use the following syntax - #pragma warning(default:4663) - #endif -#endif - -/* - Redefine _T if we undefined it in wx/beforestd.h (see comment there about - why do we do it) and if we need it (we always do when building wx itself - and might also need when compiling the user code but this must be indicated - by the special wxNEEDS__T macro) - */ -#if defined(__SUNPRO_CC) || defined(__SUNPRO_C) - #if defined(WXBUILDING) || defined(wxNEEDS_T) - /* - Undefine _T in case it was defined in the standard header. - */ - #undef _T - - /* - And define it again in the same way as it's done in wx/wxchar.h. - */ - #if wxUSE_UNICODE - #define _T(x) wxCONCAT_HELPER(L, x) - #else /* !Unicode */ - #define _T(x) x - #endif /* Unicode/!Unicode */ - #endif /* we need _T() to be defined */ -#endif /* defined(__SUNPRO_CC) || defined(__SUNPRO_C) */ diff --git a/wxWidgets/include/wx/anidecod.h b/wxWidgets/include/wx/anidecod.h deleted file mode 100644 index 0b664d86b8..0000000000 --- a/wxWidgets/include/wx/anidecod.h +++ /dev/null @@ -1,77 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/anidecod.h -// Purpose: wxANIDecoder, ANI reader for wxImage and wxAnimation -// Author: Francesco Montorsi -// CVS-ID: $Id: anidecod.h 45563 2007-04-21 18:17:50Z VZ $ -// Copyright: (c) 2006 Francesco Montorsi -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_ANIDECOD_H -#define _WX_ANIDECOD_H - -#include "wx/defs.h" - -#if wxUSE_STREAMS && wxUSE_ICO_CUR - -#include "wx/stream.h" -#include "wx/image.h" -#include "wx/animdecod.h" -#include "wx/dynarray.h" - - -class /*WXDLLEXPORT*/ wxANIFrameInfo; - -WX_DECLARE_EXPORTED_OBJARRAY(wxANIFrameInfo, wxANIFrameInfoArray); -WX_DECLARE_EXPORTED_OBJARRAY(wxImage, wxImageArray); - -// -------------------------------------------------------------------------- -// wxANIDecoder class -// -------------------------------------------------------------------------- - -class WXDLLEXPORT wxANIDecoder : public wxAnimationDecoder -{ -public: - // constructor, destructor, etc. - wxANIDecoder(); - ~wxANIDecoder(); - - - virtual wxSize GetFrameSize(unsigned int frame) const; - virtual wxPoint GetFramePosition(unsigned int frame) const; - virtual wxAnimationDisposal GetDisposalMethod(unsigned int frame) const; - virtual long GetDelay(unsigned int frame) const; - virtual wxColour GetTransparentColour(unsigned int frame) const; - - // implementation of wxAnimationDecoder's pure virtuals - virtual bool CanRead( wxInputStream& stream ) const; - virtual bool Load( wxInputStream& stream ); - - bool ConvertToImage(unsigned int frame, wxImage *image) const; - - wxAnimationDecoder *Clone() const - { return new wxANIDecoder; } - wxAnimationType GetType() const - { return wxANIMATION_TYPE_ANI; } - -private: - // frames stored as wxImage(s): ANI files are meant to be used mostly for animated - // cursors and thus they do not use any optimization to encode differences between - // two frames: they are just a list of images to display sequentially. - wxImageArray m_images; - - // the info about each image stored in m_images. - // NB: m_info.GetCount() may differ from m_images.GetCount()! - wxANIFrameInfoArray m_info; - - // this is the wxCURHandler used to load the ICON chunk of the ANI files - static wxCURHandler sm_handler; - - - DECLARE_NO_COPY_CLASS(wxANIDecoder) -}; - - -#endif // wxUSE_STREAM && wxUSE_ICO_CUR - -#endif // _WX_ANIDECOD_H diff --git a/wxWidgets/include/wx/animate.h b/wxWidgets/include/wx/animate.h deleted file mode 100644 index 451cce52fc..0000000000 --- a/wxWidgets/include/wx/animate.h +++ /dev/null @@ -1,124 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/animate.h -// Purpose: wxAnimation and wxAnimationCtrl -// Author: Julian Smart and Guillermo Rodriguez Garcia -// Modified by: Francesco Montorsi -// Created: 13/8/99 -// RCS-ID: $Id: animate.h 53135 2008-04-12 02:31:04Z VZ $ -// Copyright: (c) Julian Smart and Guillermo Rodriguez Garcia -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_ANIMATE_H_ -#define _WX_ANIMATE_H_ - -#include "wx/defs.h" - -#if wxUSE_ANIMATIONCTRL - -#include "wx/animdecod.h" -#include "wx/control.h" -#include "wx/timer.h" -#include "wx/bitmap.h" - -class WXDLLIMPEXP_FWD_ADV wxAnimation; - -extern WXDLLIMPEXP_DATA_ADV(wxAnimation) wxNullAnimation; -extern WXDLLIMPEXP_DATA_ADV(const wxChar) wxAnimationCtrlNameStr[]; - - -// ---------------------------------------------------------------------------- -// wxAnimationBase -// ---------------------------------------------------------------------------- - -class WXDLLIMPEXP_ADV wxAnimationBase : public wxGDIObject -{ -public: - wxAnimationBase() {} - - virtual bool IsOk() const = 0; - - // can be -1 - virtual int GetDelay(unsigned int frame) const = 0; - - virtual unsigned int GetFrameCount() const = 0; - virtual wxImage GetFrame(unsigned int frame) const = 0; - virtual wxSize GetSize() const = 0; - - virtual bool LoadFile(const wxString& name, - wxAnimationType type = wxANIMATION_TYPE_ANY) = 0; - virtual bool Load(wxInputStream& stream, - wxAnimationType type = wxANIMATION_TYPE_ANY) = 0; - -protected: - DECLARE_ABSTRACT_CLASS(wxAnimationBase) -}; - - - -// ---------------------------------------------------------------------------- -// wxAnimationCtrlBase -// ---------------------------------------------------------------------------- - -// do not autoresize to the animation's size when SetAnimation() is called -#define wxAC_NO_AUTORESIZE (0x0010) - -// default style does not include wxAC_NO_AUTORESIZE, that is, the control -// auto-resizes by default to fit the new animation when SetAnimation() is called -#define wxAC_DEFAULT_STYLE (wxNO_BORDER) - -class WXDLLIMPEXP_ADV wxAnimationCtrlBase : public wxControl -{ -public: - wxAnimationCtrlBase() { } - - // public API - virtual bool LoadFile(const wxString& filename, - wxAnimationType type = wxANIMATION_TYPE_ANY) = 0; - - virtual void SetAnimation(const wxAnimation &anim) = 0; - virtual wxAnimation GetAnimation() const = 0; - - virtual bool Play() = 0; - virtual void Stop() = 0; - - virtual bool IsPlaying() const = 0; - - virtual void SetInactiveBitmap(const wxBitmap &bmp); - - // always return the original bitmap set in this control - wxBitmap GetInactiveBitmap() const - { return m_bmpStatic; } - -protected: - // the inactive bitmap as it was set by the user - wxBitmap m_bmpStatic; - - // the inactive bitmap currently shown in the control - // (may differ in the size from m_bmpStatic) - wxBitmap m_bmpStaticReal; - - // updates m_bmpStaticReal from m_bmpStatic if needed - virtual void UpdateStaticImage(); - - // called by SetInactiveBitmap - virtual void DisplayStaticImage() = 0; - -private: - DECLARE_ABSTRACT_CLASS(wxAnimationCtrlBase) -}; - - -// ---------------------------------------------------------------------------- -// include the platform-specific version of the wxAnimationCtrl class -// ---------------------------------------------------------------------------- - -#if defined(__WXGTK20__) && !defined(__WXUNIVERSAL__) - #include "wx/gtk/animate.h" -#else - #include "wx/generic/animate.h" -#endif - -#endif // wxUSE_ANIMATIONCTRL - -#endif // _WX_ANIMATE_H_ diff --git a/wxWidgets/include/wx/animdecod.h b/wxWidgets/include/wx/animdecod.h deleted file mode 100644 index d6dc9a48df..0000000000 --- a/wxWidgets/include/wx/animdecod.h +++ /dev/null @@ -1,146 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/animdecod.h -// Purpose: wxAnimationDecoder -// Author: Francesco Montorsi -// CVS-ID: $Id: animdecod.h 49563 2007-10-31 20:46:21Z VZ $ -// Copyright: (c) 2006 Francesco Montorsi -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_ANIMDECOD_H -#define _WX_ANIMDECOD_H - -#include "wx/defs.h" - -#if wxUSE_STREAMS - -#include "wx/colour.h" -#include "wx/gdicmn.h" - -class WXDLLIMPEXP_FWD_BASE wxInputStream; -class WXDLLIMPEXP_FWD_CORE wxImage; - -/* - - Differences between a wxAnimationDecoder and a wxImageHandler: - - 1) wxImageHandlers always load an input stream directly into a given wxImage - object converting from the format-specific data representation to the - wxImage native format (RGB24). - wxAnimationDecoders always load an input stream using some optimized format - to store it which is format-depedent. This allows to store a (possibly big) - animation using a format which is a good compromise between required memory - and time required to blit in on the screen. - - 2) wxAnimationDecoders contain the animation data in some internal var. - That's why they derive from wxObjectRefData: they are data which can be shared. - - 3) wxAnimationDecoders can be used by a wxImageHandler to retrieve a frame - in wxImage format; the viceversa cannot be done. - - 4) wxAnimationDecoders are decoders only, thus do not support save features. - - 5) wxAnimationDecoders are directly used by wxAnimation (generic implementation) - as wxObjectRefData while they need to be 'wrapped' by a wxImageHandler for - wxImage uses. - -*/ - - -// -------------------------------------------------------------------------- -// Constants -// -------------------------------------------------------------------------- - -// NB: the values of these enum items are not casual but coincide with the -// GIF disposal codes. Do not change them !! -enum wxAnimationDisposal -{ - // No disposal specified. The decoder is not required to take any action. - wxANIM_UNSPECIFIED = -1, - - // Do not dispose. The graphic is to be left in place. - wxANIM_DONOTREMOVE = 0, - - // Restore to background color. The area used by the graphic must be - // restored to the background color. - wxANIM_TOBACKGROUND = 1, - - // Restore to previous. The decoder is required to restore the area - // overwritten by the graphic with what was there prior to rendering the graphic. - wxANIM_TOPREVIOUS = 2 -}; - -enum wxAnimationType -{ - wxANIMATION_TYPE_INVALID, - wxANIMATION_TYPE_GIF, - wxANIMATION_TYPE_ANI, - - wxANIMATION_TYPE_ANY -}; - - -// -------------------------------------------------------------------------- -// wxAnimationDecoder class -// -------------------------------------------------------------------------- - -class WXDLLEXPORT wxAnimationDecoder : public wxObjectRefData -{ -public: - wxAnimationDecoder() - { - m_background = wxNullColour; - m_nFrames = 0; - } - virtual ~wxAnimationDecoder() { } - - - virtual bool Load( wxInputStream& stream ) = 0; - virtual bool CanRead( wxInputStream& stream ) const = 0; - - virtual wxAnimationDecoder *Clone() const = 0; - virtual wxAnimationType GetType() const = 0; - - // convert given frame to wxImage - virtual bool ConvertToImage(unsigned int frame, wxImage *image) const = 0; - - - // frame specific data getters - - // not all frames may be of the same size; e.g. GIF allows to - // specify that between two frames only a smaller portion of the - // entire animation has changed. - virtual wxSize GetFrameSize(unsigned int frame) const = 0; - - // the position of this frame in case it's not as big as m_szAnimation - // or wxPoint(0,0) otherwise. - virtual wxPoint GetFramePosition(unsigned int frame) const = 0; - - // what should be done after displaying this frame. - virtual wxAnimationDisposal GetDisposalMethod(unsigned int frame) const = 0; - - // the number of milliseconds this frame should be displayed. - // if returns -1 then the frame must be displayed forever. - virtual long GetDelay(unsigned int frame) const = 0; - - // the transparent colour for this frame if any or wxNullColour. - virtual wxColour GetTransparentColour(unsigned int frame) const = 0; - - // get global data - wxSize GetAnimationSize() const { return m_szAnimation; } - wxColour GetBackgroundColour() const { return m_background; } - unsigned int GetFrameCount() const { return m_nFrames; } - -protected: - wxSize m_szAnimation; - unsigned int m_nFrames; - - // this is the colour to use for the wxANIM_TOBACKGROUND disposal. - // if not specified by the animation, it's set to wxNullColour - wxColour m_background; -}; - - -#endif // wxUSE_STREAM -#endif // _WX_ANIMDECOD_H - diff --git a/wxWidgets/include/wx/app.h b/wxWidgets/include/wx/app.h deleted file mode 100644 index 1846d563e2..0000000000 --- a/wxWidgets/include/wx/app.h +++ /dev/null @@ -1,708 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/app.h -// Purpose: wxAppBase class and macros used for declaration of wxApp -// derived class in the user code -// Author: Julian Smart -// Modified by: -// Created: 01/02/97 -// RCS-ID: $Id: app.h 51592 2008-02-08 08:17:41Z VZ $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_APP_H_BASE_ -#define _WX_APP_H_BASE_ - -// ---------------------------------------------------------------------------- -// headers we have to include here -// ---------------------------------------------------------------------------- - -#include "wx/event.h" // for the base class -#include "wx/build.h" -#include "wx/init.h" // we must declare wxEntry() -#include "wx/intl.h" // for wxLayoutDirection - -class WXDLLIMPEXP_FWD_BASE wxAppConsole; -class WXDLLIMPEXP_FWD_BASE wxAppTraits; -class WXDLLIMPEXP_FWD_BASE wxCmdLineParser; -class WXDLLIMPEXP_FWD_BASE wxLog; -class WXDLLIMPEXP_FWD_BASE wxMessageOutput; - -#if wxUSE_GUI - class WXDLLIMPEXP_FWD_BASE wxEventLoop; - struct WXDLLIMPEXP_FWD_CORE wxVideoMode; -#endif - -// ---------------------------------------------------------------------------- -// typedefs -// ---------------------------------------------------------------------------- - -// the type of the function used to create a wxApp object on program start up -typedef wxAppConsole* (*wxAppInitializerFunction)(); - -// ---------------------------------------------------------------------------- -// constants -// ---------------------------------------------------------------------------- - -enum -{ - wxPRINT_WINDOWS = 1, - wxPRINT_POSTSCRIPT = 2 -}; - -// ---------------------------------------------------------------------------- -// wxAppConsole: wxApp for non-GUI applications -// ---------------------------------------------------------------------------- - -class WXDLLIMPEXP_BASE wxAppConsole : public wxEvtHandler -{ -public: - // ctor and dtor - wxAppConsole(); - virtual ~wxAppConsole(); - - - // the virtual functions which may/must be overridden in the derived class - // ----------------------------------------------------------------------- - - // This is the very first function called for a newly created wxApp object, - // it is used by the library to do the global initialization. If, for some - // reason, you must override it (instead of just overriding OnInit(), as - // usual, for app-specific initializations), do not forget to call the base - // class version! - virtual bool Initialize(int& argc, wxChar **argv); - - // This gives wxCocoa a chance to call OnInit() with a memory pool in place - virtual bool CallOnInit() { return OnInit(); } - - // Called before OnRun(), this is a good place to do initialization -- if - // anything fails, return false from here to prevent the program from - // continuing. The command line is normally parsed here, call the base - // class OnInit() to do it. - virtual bool OnInit(); - - // this is here only temporary hopefully (FIXME) - virtual bool OnInitGui() { return true; } - - // This is the replacement for the normal main(): all program work should - // be done here. When OnRun() returns, the programs starts shutting down. - virtual int OnRun() = 0; - - // This is only called if OnInit() returned true so it's a good place to do - // any cleanup matching the initializations done there. - virtual int OnExit(); - - // This is the very last function called on wxApp object before it is - // destroyed. If you override it (instead of overriding OnExit() as usual) - // do not forget to call the base class version! - virtual void CleanUp(); - - // Called when a fatal exception occurs, this function should take care not - // to do anything which might provoke a nested exception! It may be - // overridden if you wish to react somehow in non-default way (core dump - // under Unix, application crash under Windows) to fatal program errors, - // however extreme care should be taken if you don't want this function to - // crash. - virtual void OnFatalException() { } - - // Called from wxExit() function, should terminate the application a.s.a.p. - virtual void Exit(); - - - // application info: name, description, vendor - // ------------------------------------------- - - // NB: all these should be set by the application itself, there are no - // reasonable default except for the application name which is taken to - // be argv[0] - - // set/get the application name - wxString GetAppName() const - { - return m_appName.empty() ? m_className : m_appName; - } - void SetAppName(const wxString& name) { m_appName = name; } - - // set/get the app class name - wxString GetClassName() const { return m_className; } - void SetClassName(const wxString& name) { m_className = name; } - - // set/get the vendor name - const wxString& GetVendorName() const { return m_vendorName; } - void SetVendorName(const wxString& name) { m_vendorName = name; } - - - // cmd line parsing stuff - // ---------------------- - - // all of these methods may be overridden in the derived class to - // customize the command line parsing (by default only a few standard - // options are handled) - // - // you also need to call wxApp::OnInit() from YourApp::OnInit() for all - // this to work - -#if wxUSE_CMDLINE_PARSER - // this one is called from OnInit() to add all supported options - // to the given parser (don't forget to call the base class version if you - // override it!) - virtual void OnInitCmdLine(wxCmdLineParser& parser); - - // called after successfully parsing the command line, return true - // to continue and false to exit (don't forget to call the base class - // version if you override it!) - virtual bool OnCmdLineParsed(wxCmdLineParser& parser); - - // called if "--help" option was specified, return true to continue - // and false to exit - virtual bool OnCmdLineHelp(wxCmdLineParser& parser); - - // called if incorrect command line options were given, return - // false to abort and true to continue - virtual bool OnCmdLineError(wxCmdLineParser& parser); -#endif // wxUSE_CMDLINE_PARSER - - - // miscellaneous customization functions - // ------------------------------------- - - // create the app traits object to which we delegate for everything which - // either should be configurable by the user (then he can change the - // default behaviour simply by overriding CreateTraits() and returning his - // own traits object) or which is GUI/console dependent as then wxAppTraits - // allows us to abstract the differences behind the common façade - wxAppTraits *GetTraits(); - - // the functions below shouldn't be used now that we have wxAppTraits -#if WXWIN_COMPATIBILITY_2_4 - -#if wxUSE_LOG - // override this function to create default log target of arbitrary - // user-defined class (default implementation creates a wxLogGui - // object) -- this log object is used by default by all wxLogXXX() - // functions. - wxDEPRECATED( virtual wxLog *CreateLogTarget() ); -#endif // wxUSE_LOG - - // similar to CreateLogTarget() but for the global wxMessageOutput - // object - wxDEPRECATED( virtual wxMessageOutput *CreateMessageOutput() ); - -#endif // WXWIN_COMPATIBILITY_2_4 - - - // event processing functions - // -------------------------- - - // this method allows to filter all the events processed by the program, so - // you should try to return quickly from it to avoid slowing down the - // program to the crawl - // - // return value should be -1 to continue with the normal event processing, - // or TRUE or FALSE to stop further processing and pretend that the event - // had been already processed or won't be processed at all, respectively - virtual int FilterEvent(wxEvent& event); - -#if wxUSE_EXCEPTIONS - // call the specified handler on the given object with the given event - // - // this method only exists to allow catching the exceptions thrown by any - // event handler, it would lead to an extra (useless) virtual function call - // if the exceptions were not used, so it doesn't even exist in that case - virtual void HandleEvent(wxEvtHandler *handler, - wxEventFunction func, - wxEvent& event) const; - - // Called when an unhandled C++ exception occurs inside OnRun(): note that - // the exception type is lost by now, so if you really want to handle the - // exception you should override OnRun() and put a try/catch around - // MainLoop() call there or use OnExceptionInMainLoop() - virtual void OnUnhandledException() { } -#endif // wxUSE_EXCEPTIONS - - // process all events in the wxPendingEvents list -- it is necessary to - // call this function to process posted events. This happens during each - // event loop iteration in GUI mode but if there is no main loop, it may be - // also called directly. - virtual void ProcessPendingEvents(); - - // doesn't do anything in this class, just a hook for GUI wxApp - virtual bool Yield(bool WXUNUSED(onlyIfNeeded) = false) { return true; } - - // make sure that idle events are sent again - virtual void WakeUpIdle() { } - - // this is just a convenience: by providing its implementation here we - // avoid #ifdefs in the code using it - static bool IsMainLoopRunning() { return false; } - - - // debugging support - // ----------------- - -#ifdef __WXDEBUG__ - // this function is called when an assert failure occurs, the base class - // version does the normal processing (i.e. shows the usual assert failure - // dialog box) - // - // the arguments are the location of the failed assert (func may be empty - // if the compiler doesn't support C99 __FUNCTION__), the text of the - // assert itself and the user-specified message - virtual void OnAssertFailure(const wxChar *file, - int line, - const wxChar *func, - const wxChar *cond, - const wxChar *msg); - - // old version of the function without func parameter, for compatibility - // only, override OnAssertFailure() in the new code - virtual void OnAssert(const wxChar *file, - int line, - const wxChar *cond, - const wxChar *msg); -#endif // __WXDEBUG__ - - // check that the wxBuildOptions object (constructed in the application - // itself, usually the one from IMPLEMENT_APP() macro) matches the build - // options of the library and abort if it doesn't - static bool CheckBuildOptions(const char *optionsSignature, - const char *componentName); -#if WXWIN_COMPATIBILITY_2_4 - wxDEPRECATED( static bool CheckBuildOptions(const wxBuildOptions& buildOptions) ); -#endif - - // implementation only from now on - // ------------------------------- - - // helpers for dynamic wxApp construction - static void SetInitializerFunction(wxAppInitializerFunction fn) - { ms_appInitFn = fn; } - static wxAppInitializerFunction GetInitializerFunction() - { return ms_appInitFn; } - - // accessors for ms_appInstance field (external code might wish to modify - // it, this is why we provide a setter here as well, but you should really - // know what you're doing if you call it), wxTheApp is usually used instead - // of GetInstance() - static wxAppConsole *GetInstance() { return ms_appInstance; } - static void SetInstance(wxAppConsole *app) { ms_appInstance = app; } - - - // command line arguments (public for backwards compatibility) - int argc; - wxChar **argv; - -protected: - // the function which creates the traits object when GetTraits() needs it - // for the first time - virtual wxAppTraits *CreateTraits(); - - - // function used for dynamic wxApp creation - static wxAppInitializerFunction ms_appInitFn; - - // the one and only global application object - static wxAppConsole *ms_appInstance; - - - // application info (must be set from the user code) - wxString m_vendorName, // vendor name (ACME Inc) - m_appName, // app name - m_className; // class name - - // the class defining the application behaviour, NULL initially and created - // by GetTraits() when first needed - wxAppTraits *m_traits; - - - // the application object is a singleton anyhow, there is no sense in - // copying it - DECLARE_NO_COPY_CLASS(wxAppConsole) -}; - -// ---------------------------------------------------------------------------- -// wxAppBase: the common part of wxApp implementations for all platforms -// ---------------------------------------------------------------------------- - -#if wxUSE_GUI - -class WXDLLIMPEXP_CORE wxAppBase : public wxAppConsole -{ -public: - wxAppBase(); - virtual ~wxAppBase(); - - // the virtual functions which may/must be overridden in the derived class - // ----------------------------------------------------------------------- - - // very first initialization function - // - // Override: very rarely - virtual bool Initialize(int& argc, wxChar **argv); - - // a platform-dependent version of OnInit(): the code here is likely to - // depend on the toolkit. default version does nothing. - // - // Override: rarely. - virtual bool OnInitGui(); - - // called to start program execution - the default version just enters - // the main GUI loop in which events are received and processed until - // the last window is not deleted (if GetExitOnFrameDelete) or - // ExitMainLoop() is called. In console mode programs, the execution - // of the program really starts here - // - // Override: rarely in GUI applications, always in console ones. - virtual int OnRun(); - - // a matching function for OnInit() - virtual int OnExit(); - - // very last clean up function - // - // Override: very rarely - virtual void CleanUp(); - - - // the worker functions - usually not used directly by the user code - // ----------------------------------------------------------------- - - // return true if we're running main loop, i.e. if the events can - // (already) be dispatched - static bool IsMainLoopRunning() - { - wxAppBase *app = wx_static_cast(wxAppBase *, GetInstance()); - return app && app->m_mainLoop != NULL; - } - - // execute the main GUI loop, the function returns when the loop ends - virtual int MainLoop(); - - // exit the main loop thus terminating the application - virtual void Exit(); - - // exit the main GUI loop during the next iteration (i.e. it does not - // stop the program immediately!) - virtual void ExitMainLoop(); - - // returns true if there are unprocessed events in the event queue - virtual bool Pending(); - - // process the first event in the event queue (blocks until an event - // appears if there are none currently, use Pending() if this is not - // wanted), returns false if the event loop should stop and true - // otherwise - virtual bool Dispatch(); - - // process all currently pending events right now - // - // it is an error to call Yield() recursively unless the value of - // onlyIfNeeded is true - // - // WARNING: this function is dangerous as it can lead to unexpected - // reentrancies (i.e. when called from an event handler it - // may result in calling the same event handler again), use - // with _extreme_ care or, better, don't use at all! - virtual bool Yield(bool onlyIfNeeded = false) = 0; - - // this virtual function is called in the GUI mode when the application - // becomes idle and normally just sends wxIdleEvent to all interested - // parties - // - // it should return true if more idle events are needed, false if not - virtual bool ProcessIdle(); - - // Send idle event to window and all subwindows - // Returns true if more idle time is requested. - virtual bool SendIdleEvents(wxWindow* win, wxIdleEvent& event); - - -#if wxUSE_EXCEPTIONS - // Function called if an uncaught exception is caught inside the main - // event loop: it may return true to continue running the event loop or - // false to stop it (in the latter case it may rethrow the exception as - // well) - virtual bool OnExceptionInMainLoop(); -#endif // wxUSE_EXCEPTIONS - - - // top level window functions - // -------------------------- - - // return true if our app has focus - virtual bool IsActive() const { return m_isActive; } - - // set the "main" top level window - void SetTopWindow(wxWindow *win) { m_topWindow = win; } - - // return the "main" top level window (if it hadn't been set previously - // with SetTopWindow(), will return just some top level window and, if - // there are none, will return NULL) - virtual wxWindow *GetTopWindow() const; - - // control the exit behaviour: by default, the program will exit the - // main loop (and so, usually, terminate) when the last top-level - // program window is deleted. Beware that if you disable this behaviour - // (with SetExitOnFrameDelete(false)), you'll have to call - // ExitMainLoop() explicitly from somewhere. - void SetExitOnFrameDelete(bool flag) - { m_exitOnFrameDelete = flag ? Yes : No; } - bool GetExitOnFrameDelete() const - { return m_exitOnFrameDelete == Yes; } - - - // display mode, visual, printing mode, ... - // ------------------------------------------------------------------------ - - // Get display mode that is used use. This is only used in framebuffer - // wxWin ports (such as wxMGL or wxDFB). - virtual wxVideoMode GetDisplayMode() const; - // Set display mode to use. This is only used in framebuffer wxWin - // ports (such as wxMGL or wxDFB). This method should be called from - // wxApp::OnInitGui - virtual bool SetDisplayMode(const wxVideoMode& WXUNUSED(info)) { return true; } - - // set use of best visual flag (see below) - void SetUseBestVisual( bool flag, bool forceTrueColour = false ) - { m_useBestVisual = flag; m_forceTrueColour = forceTrueColour; } - bool GetUseBestVisual() const { return m_useBestVisual; } - - // set/get printing mode: see wxPRINT_XXX constants. - // - // default behaviour is the normal one for Unix: always use PostScript - // printing. - virtual void SetPrintMode(int WXUNUSED(mode)) { } - int GetPrintMode() const { return wxPRINT_POSTSCRIPT; } - - // Return the layout direction for the current locale or wxLayout_Default - // if it's unknown - virtual wxLayoutDirection GetLayoutDirection() const; - - - // command line parsing (GUI-specific) - // ------------------------------------------------------------------------ - -#if wxUSE_CMDLINE_PARSER - virtual bool OnCmdLineParsed(wxCmdLineParser& parser); - virtual void OnInitCmdLine(wxCmdLineParser& parser); -#endif - - // miscellaneous other stuff - // ------------------------------------------------------------------------ - - // called by toolkit-specific code to set the app status: active (we have - // focus) or not and also the last window which had focus before we were - // deactivated - virtual void SetActive(bool isActive, wxWindow *lastFocus); - -#if WXWIN_COMPATIBILITY_2_6 - // OBSOLETE: don't use, always returns true - // - // returns true if the program is successfully initialized - wxDEPRECATED( bool Initialized() ); -#endif // WXWIN_COMPATIBILITY_2_6 - - // perform standard OnIdle behaviour, ensure that this is always called - void OnIdle(wxIdleEvent& event); - - -protected: - // delete all objects in wxPendingDelete list - void DeletePendingObjects(); - - // override base class method to use GUI traits - virtual wxAppTraits *CreateTraits(); - - - // the main event loop of the application (may be NULL if the loop hasn't - // been started yet or has already terminated) - wxEventLoop *m_mainLoop; - - // the main top level window (may be NULL) - wxWindow *m_topWindow; - - // if Yes, exit the main loop when the last top level window is deleted, if - // No don't do it and if Later -- only do it once we reach our OnRun() - // - // the explanation for using this strange scheme is given in appcmn.cpp - enum - { - Later = -1, - No, - Yes - } m_exitOnFrameDelete; - - // true if the app wants to use the best visual on systems where - // more than one are available (Sun, SGI, XFree86 4.0 ?) - bool m_useBestVisual; - // force TrueColour just in case "best" isn't TrueColour - bool m_forceTrueColour; - - // does any of our windows have focus? - bool m_isActive; - - - DECLARE_NO_COPY_CLASS(wxAppBase) -}; - -#if WXWIN_COMPATIBILITY_2_6 - inline bool wxAppBase::Initialized() { return true; } -#endif // WXWIN_COMPATIBILITY_2_6 - -#endif // wxUSE_GUI - -// ---------------------------------------------------------------------------- -// now include the declaration of the real class -// ---------------------------------------------------------------------------- - -#if wxUSE_GUI - #if defined(__WXPALMOS__) - #include "wx/palmos/app.h" - #elif defined(__WXMSW__) - #include "wx/msw/app.h" - #elif defined(__WXMOTIF__) - #include "wx/motif/app.h" - #elif defined(__WXMGL__) - #include "wx/mgl/app.h" - #elif defined(__WXDFB__) - #include "wx/dfb/app.h" - #elif defined(__WXGTK20__) - #include "wx/gtk/app.h" - #elif defined(__WXGTK__) - #include "wx/gtk1/app.h" - #elif defined(__WXX11__) - #include "wx/x11/app.h" - #elif defined(__WXMAC__) - #include "wx/mac/app.h" - #elif defined(__WXCOCOA__) - #include "wx/cocoa/app.h" - #elif defined(__WXPM__) - #include "wx/os2/app.h" - #endif -#else // !GUI - // allow using just wxApp (instead of wxAppConsole) in console programs - typedef wxAppConsole wxApp; -#endif // GUI/!GUI - -// ---------------------------------------------------------------------------- -// the global data -// ---------------------------------------------------------------------------- - -// for compatibility, we define this macro to access the global application -// object of type wxApp -// -// note that instead of using of wxTheApp in application code you should -// consider using DECLARE_APP() after which you may call wxGetApp() which will -// return the object of the correct type (i.e. MyApp and not wxApp) -// -// the cast is safe as in GUI build we only use wxApp, not wxAppConsole, and in -// console mode it does nothing at all -#define wxTheApp wx_static_cast(wxApp*, wxApp::GetInstance()) - -// ---------------------------------------------------------------------------- -// global functions -// ---------------------------------------------------------------------------- - -// event loop related functions only work in GUI programs -// ------------------------------------------------------ - -// Force an exit from main loop -extern void WXDLLIMPEXP_BASE wxExit(); - -// avoid redeclaring this function here if it had been already declated by -// wx/utils.h, this results in warnings from g++ with -Wredundant-decls -#ifndef wx_YIELD_DECLARED -#define wx_YIELD_DECLARED - -// Yield to other apps/messages -extern bool WXDLLIMPEXP_BASE wxYield(); - -#endif // wx_YIELD_DECLARED - -// Yield to other apps/messages -extern void WXDLLIMPEXP_BASE wxWakeUpIdle(); - -// ---------------------------------------------------------------------------- -// macros for dynamic creation of the application object -// ---------------------------------------------------------------------------- - -// Having a global instance of this class allows wxApp to be aware of the app -// creator function. wxApp can then call this function to create a new app -// object. Convoluted, but necessary. - -class WXDLLIMPEXP_BASE wxAppInitializer -{ -public: - wxAppInitializer(wxAppInitializerFunction fn) - { wxApp::SetInitializerFunction(fn); } -}; - -// the code below defines a IMPLEMENT_WXWIN_MAIN macro which you can use if -// your compiler really, really wants main() to be in your main program (e.g. -// hello.cpp). Now IMPLEMENT_APP should add this code if required. - -#define IMPLEMENT_WXWIN_MAIN_CONSOLE \ - int main(int argc, char **argv) { return wxEntry(argc, argv); } - -// port-specific header could have defined it already in some special way -#ifndef IMPLEMENT_WXWIN_MAIN - #define IMPLEMENT_WXWIN_MAIN IMPLEMENT_WXWIN_MAIN_CONSOLE -#endif // defined(IMPLEMENT_WXWIN_MAIN) - -#ifdef __WXUNIVERSAL__ - #include "wx/univ/theme.h" - - #ifdef wxUNIV_DEFAULT_THEME - #define IMPLEMENT_WX_THEME_SUPPORT \ - WX_USE_THEME(wxUNIV_DEFAULT_THEME); - #else - #define IMPLEMENT_WX_THEME_SUPPORT - #endif -#else - #define IMPLEMENT_WX_THEME_SUPPORT -#endif - -// Use this macro if you want to define your own main() or WinMain() function -// and call wxEntry() from there. -#define IMPLEMENT_APP_NO_MAIN(appname) \ - wxAppConsole *wxCreateApp() \ - { \ - wxAppConsole::CheckBuildOptions(WX_BUILD_OPTIONS_SIGNATURE, \ - "your program"); \ - return new appname; \ - } \ - wxAppInitializer \ - wxTheAppInitializer((wxAppInitializerFunction) wxCreateApp); \ - DECLARE_APP(appname) \ - appname& wxGetApp() { return *wx_static_cast(appname*, wxApp::GetInstance()); } - -// Same as IMPLEMENT_APP() normally but doesn't include themes support in -// wxUniversal builds -#define IMPLEMENT_APP_NO_THEMES(appname) \ - IMPLEMENT_APP_NO_MAIN(appname) \ - IMPLEMENT_WXWIN_MAIN - -// Use this macro exactly once, the argument is the name of the wxApp-derived -// class which is the class of your application. -#define IMPLEMENT_APP(appname) \ - IMPLEMENT_APP_NO_THEMES(appname) \ - IMPLEMENT_WX_THEME_SUPPORT - -// Same as IMPLEMENT_APP(), but for console applications. -#define IMPLEMENT_APP_CONSOLE(appname) \ - IMPLEMENT_APP_NO_MAIN(appname) \ - IMPLEMENT_WXWIN_MAIN_CONSOLE - -// this macro can be used multiple times and just allows you to use wxGetApp() -// function -#define DECLARE_APP(appname) extern appname& wxGetApp(); - - -// declare the stuff defined by IMPLEMENT_APP() macro, it's not really needed -// anywhere else but at the very least it suppresses icc warnings about -// defining extern symbols without prior declaration, and it shouldn't do any -// harm -extern wxAppConsole *wxCreateApp(); -extern wxAppInitializer wxTheAppInitializer; - -#endif // _WX_APP_H_BASE_ diff --git a/wxWidgets/include/wx/apptrait.h b/wxWidgets/include/wx/apptrait.h deleted file mode 100644 index 3bb91f520a..0000000000 --- a/wxWidgets/include/wx/apptrait.h +++ /dev/null @@ -1,272 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: wx/apptrait.h -// Purpose: declaration of wxAppTraits and derived classes -// Author: Vadim Zeitlin -// Modified by: -// Created: 19.06.2003 -// RCS-ID: $Id: apptrait.h 49804 2007-11-10 01:09:42Z VZ $ -// Copyright: (c) 2003 Vadim Zeitlin -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_APPTRAIT_H_ -#define _WX_APPTRAIT_H_ - -#include "wx/string.h" -#include "wx/platinfo.h" - -class WXDLLIMPEXP_FWD_BASE wxObject; -class WXDLLIMPEXP_FWD_BASE wxAppTraits; -#if wxUSE_FONTMAP - class WXDLLIMPEXP_FWD_CORE wxFontMapper; -#endif // wxUSE_FONTMAP -class WXDLLIMPEXP_FWD_BASE wxLog; -class WXDLLIMPEXP_FWD_BASE wxMessageOutput; -class WXDLLIMPEXP_FWD_CORE wxRendererNative; -class WXDLLIMPEXP_FWD_BASE wxString; - -class GSocketGUIFunctionsTable; - - -// ---------------------------------------------------------------------------- -// wxAppTraits: this class defines various configurable aspects of wxApp -// ---------------------------------------------------------------------------- - -class WXDLLIMPEXP_FWD_BASE wxStandardPathsBase; - -class WXDLLIMPEXP_BASE wxAppTraitsBase -{ -public: - // needed since this class declares virtual members - virtual ~wxAppTraitsBase() { } - - // hooks for creating the global objects, may be overridden by the user - // ------------------------------------------------------------------------ - -#if wxUSE_LOG - // create the default log target - virtual wxLog *CreateLogTarget() = 0; -#endif // wxUSE_LOG - - // create the global object used for printing out messages - virtual wxMessageOutput *CreateMessageOutput() = 0; - -#if wxUSE_FONTMAP - // create the global font mapper object used for encodings/charset mapping - virtual wxFontMapper *CreateFontMapper() = 0; -#endif // wxUSE_FONTMAP - - // get the renderer to use for drawing the generic controls (return value - // may be NULL in which case the default renderer for the current platform - // is used); this is used in GUI only and always returns NULL in console - // - // NB: returned pointer will be deleted by the caller - virtual wxRendererNative *CreateRenderer() = 0; - -#if wxUSE_STDPATHS - // wxStandardPaths object is normally the same for wxBase and wxGUI - // except in the case of wxMac and wxCocoa - virtual wxStandardPathsBase& GetStandardPaths(); -#endif // wxUSE_STDPATHS - - // functions abstracting differences between GUI and console modes - // ------------------------------------------------------------------------ - -#ifdef __WXDEBUG__ - // show the assert dialog with the specified message in GUI or just print - // the string to stderr in console mode - // - // base class version has an implementation (in spite of being pure - // virtual) in base/appbase.cpp which can be called as last resort. - // - // return true to suppress subsequent asserts, false to continue as before - virtual bool ShowAssertDialog(const wxString& msg) = 0; -#endif // __WXDEBUG__ - - // return true if fprintf(stderr) goes somewhere, false otherwise - virtual bool HasStderr() = 0; - - // managing "pending delete" list: in GUI mode we can't immediately delete - // some objects because there may be unprocessed events for them and so we - // only do it during the next idle loop iteration while this is, of course, - // unnecessary in wxBase, so we have a few functions to abstract these - // operations - - // add the object to the pending delete list in GUI, delete it immediately - // in wxBase - virtual void ScheduleForDestroy(wxObject *object) = 0; - - // remove this object from the pending delete list in GUI, do nothing in - // wxBase - virtual void RemoveFromPendingDelete(wxObject *object) = 0; - -#if wxUSE_SOCKETS - // return table of GUI callbacks for GSocket code or NULL in wxBase. This - // is needed because networking classes are in their own library and so - // they can't directly call GUI functions (the same net library can be - // used in both GUI and base apps). To complicate it further, GUI library - // ("wxCore") doesn't depend on networking library and so only a functions - // table can be passed around - virtual GSocketGUIFunctionsTable* GetSocketGUIFunctionsTable() = 0; -#endif - - // return information about the (native) toolkit currently used and its - // runtime (not compile-time) version. - // returns wxPORT_BASE for console applications and one of the remaining - // wxPORT_* values for GUI applications. - virtual wxPortId GetToolkitVersion(int *majVer, int *minVer) const = 0; - - // return true if the port is using wxUniversal for the GUI, false if not - virtual bool IsUsingUniversalWidgets() const = 0; - - // return the name of the Desktop Environment such as - // "KDE" or "GNOME". May return an empty string. - virtual wxString GetDesktopEnvironment() const { return wxEmptyString; } - -protected: -#if wxUSE_STACKWALKER && defined( __WXDEBUG__ ) - // utility function: returns the stack frame as a plain wxString - virtual wxString GetAssertStackTrace(); -#endif -}; - -// ---------------------------------------------------------------------------- -// include the platform-specific version of the class -// ---------------------------------------------------------------------------- - -// NB: test for __UNIX__ before __WXMAC__ as under Darwin we want to use the -// Unix code (and otherwise __UNIX__ wouldn't be defined) -// ABX: check __WIN32__ instead of __WXMSW__ for the same MSWBase in any Win32 port -#if defined(__WXPALMOS__) - #include "wx/palmos/apptbase.h" -#elif defined(__WIN32__) - #include "wx/msw/apptbase.h" -#elif defined(__UNIX__) && !defined(__EMX__) - #include "wx/unix/apptbase.h" -#elif defined(__WXMAC__) - #include "wx/mac/apptbase.h" -#elif defined(__OS2__) - #include "wx/os2/apptbase.h" -#else // no platform-specific methods to add to wxAppTraits - // wxAppTraits must be a class because it was forward declared as class - class WXDLLIMPEXP_BASE wxAppTraits : public wxAppTraitsBase - { - }; -#endif // platform - -// ============================================================================ -// standard traits for console and GUI applications -// ============================================================================ - -// ---------------------------------------------------------------------------- -// wxConsoleAppTraitsBase: wxAppTraits implementation for the console apps -// ---------------------------------------------------------------------------- - -class WXDLLIMPEXP_BASE wxConsoleAppTraitsBase : public wxAppTraits -{ -public: -#if wxUSE_LOG - virtual wxLog *CreateLogTarget(); -#endif // wxUSE_LOG - virtual wxMessageOutput *CreateMessageOutput(); -#if wxUSE_FONTMAP - virtual wxFontMapper *CreateFontMapper(); -#endif // wxUSE_FONTMAP - virtual wxRendererNative *CreateRenderer(); -#if wxUSE_SOCKETS - virtual GSocketGUIFunctionsTable* GetSocketGUIFunctionsTable(); -#endif - -#ifdef __WXDEBUG__ - virtual bool ShowAssertDialog(const wxString& msg); -#endif // __WXDEBUG__ - virtual bool HasStderr(); - - virtual void ScheduleForDestroy(wxObject *object); - virtual void RemoveFromPendingDelete(wxObject *object); - - // the GetToolkitVersion for console application is always the same - virtual wxPortId GetToolkitVersion(int *verMaj, int *verMin) const - { - // no toolkits (wxBase is for console applications without GUI support) - // NB: zero means "no toolkit", -1 means "not initialized yet" - // so we must use zero here! - if (verMaj) *verMaj = 0; - if (verMin) *verMin = 0; - return wxPORT_BASE; - } - - virtual bool IsUsingUniversalWidgets() const { return false; } -}; - -// ---------------------------------------------------------------------------- -// wxGUIAppTraitsBase: wxAppTraits implementation for the GUI apps -// ---------------------------------------------------------------------------- - -#if wxUSE_GUI - -class WXDLLEXPORT wxGUIAppTraitsBase : public wxAppTraits -{ -public: -#if wxUSE_LOG - virtual wxLog *CreateLogTarget(); -#endif // wxUSE_LOG - virtual wxMessageOutput *CreateMessageOutput(); -#if wxUSE_FONTMAP - virtual wxFontMapper *CreateFontMapper(); -#endif // wxUSE_FONTMAP - virtual wxRendererNative *CreateRenderer(); -#if wxUSE_SOCKETS - virtual GSocketGUIFunctionsTable* GetSocketGUIFunctionsTable(); -#endif - -#ifdef __WXDEBUG__ - virtual bool ShowAssertDialog(const wxString& msg); -#endif // __WXDEBUG__ - virtual bool HasStderr(); - - virtual void ScheduleForDestroy(wxObject *object); - virtual void RemoveFromPendingDelete(wxObject *object); - - virtual bool IsUsingUniversalWidgets() const - { - #ifdef __WXUNIVERSAL__ - return true; - #else - return false; - #endif - } -}; - -#endif // wxUSE_GUI - -// ---------------------------------------------------------------------------- -// include the platform-specific version of the classes above -// ---------------------------------------------------------------------------- - -// ABX: check __WIN32__ instead of __WXMSW__ for the same MSWBase in any Win32 port -#if defined(__WXPALMOS__) - #include "wx/palmos/apptrait.h" -#elif defined(__WIN32__) - #include "wx/msw/apptrait.h" -#elif defined(__OS2__) - #include "wx/os2/apptrait.h" -#elif defined(__UNIX__) - #include "wx/unix/apptrait.h" -#elif defined(__WXMAC__) - #include "wx/mac/apptrait.h" -#elif defined(__DOS__) - #include "wx/msdos/apptrait.h" -#else - #if wxUSE_GUI - class wxGUIAppTraits : public wxGUIAppTraitsBase - { - }; - #endif // wxUSE_GUI - class wxConsoleAppTraits: public wxConsoleAppTraitsBase - { - }; -#endif // platform - -#endif // _WX_APPTRAIT_H_ - diff --git a/wxWidgets/include/wx/archive.h b/wxWidgets/include/wx/archive.h deleted file mode 100644 index 43b9ec0256..0000000000 --- a/wxWidgets/include/wx/archive.h +++ /dev/null @@ -1,381 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/archive.h -// Purpose: Streams for archive formats -// Author: Mike Wetherell -// RCS-ID: $Id: archive.h 43445 2006-11-16 14:30:20Z MW $ -// Copyright: (c) 2004 Mike Wetherell -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_ARCHIVE_H__ -#define _WX_ARCHIVE_H__ - -#include "wx/defs.h" - -#if wxUSE_STREAMS && wxUSE_ARCHIVE_STREAMS - -#include "wx/stream.h" -#include "wx/filename.h" - - -///////////////////////////////////////////////////////////////////////////// -// wxArchiveNotifier - -class WXDLLIMPEXP_BASE wxArchiveNotifier -{ -public: - virtual ~wxArchiveNotifier() { } - - virtual void OnEntryUpdated(class wxArchiveEntry& entry) = 0; -}; - - -///////////////////////////////////////////////////////////////////////////// -// wxArchiveEntry -// -// Holds an entry's meta data, such as filename and timestamp. - -class WXDLLIMPEXP_BASE wxArchiveEntry : public wxObject -{ -public: - virtual ~wxArchiveEntry() { } - - virtual wxDateTime GetDateTime() const = 0; - virtual wxFileOffset GetSize() const = 0; - virtual wxFileOffset GetOffset() const = 0; - virtual bool IsDir() const = 0; - virtual bool IsReadOnly() const = 0; - virtual wxString GetInternalName() const = 0; - virtual wxPathFormat GetInternalFormat() const = 0; - virtual wxString GetName(wxPathFormat format = wxPATH_NATIVE) const = 0; - - virtual void SetDateTime(const wxDateTime& dt) = 0; - virtual void SetSize(wxFileOffset size) = 0; - virtual void SetIsDir(bool isDir = true) = 0; - virtual void SetIsReadOnly(bool isReadOnly = true) = 0; - virtual void SetName(const wxString& name, - wxPathFormat format = wxPATH_NATIVE) = 0; - - wxArchiveEntry *Clone() const { return DoClone(); } - - void SetNotifier(wxArchiveNotifier& notifier); - virtual void UnsetNotifier() { m_notifier = NULL; } - -protected: - wxArchiveEntry() : m_notifier(NULL) { } - wxArchiveEntry(const wxArchiveEntry& e) : wxObject(e), m_notifier(NULL) { } - - virtual void SetOffset(wxFileOffset offset) = 0; - virtual wxArchiveEntry* DoClone() const = 0; - - wxArchiveNotifier *GetNotifier() const { return m_notifier; } - wxArchiveEntry& operator=(const wxArchiveEntry& entry); - -private: - wxArchiveNotifier *m_notifier; - - DECLARE_ABSTRACT_CLASS(wxArchiveEntry) -}; - - -///////////////////////////////////////////////////////////////////////////// -// wxArchiveInputStream -// -// GetNextEntry() returns an wxArchiveEntry object containing the meta-data -// for the next entry in the archive (and gives away ownership). Reading from -// the wxArchiveInputStream then returns the entry's data. Eof() becomes true -// after an attempt has been made to read past the end of the entry's data. -// -// When there are no more entries, GetNextEntry() returns NULL and sets Eof(). - -class WXDLLIMPEXP_BASE wxArchiveInputStream : public wxFilterInputStream -{ -public: - typedef wxArchiveEntry entry_type; - - virtual ~wxArchiveInputStream() { } - - virtual bool OpenEntry(wxArchiveEntry& entry) = 0; - virtual bool CloseEntry() = 0; - - wxArchiveEntry *GetNextEntry() { return DoGetNextEntry(); } - - virtual char Peek() { return wxInputStream::Peek(); } - -protected: - wxArchiveInputStream(wxInputStream& stream, wxMBConv& conv); - wxArchiveInputStream(wxInputStream *stream, wxMBConv& conv); - - virtual wxArchiveEntry *DoGetNextEntry() = 0; - - wxMBConv& GetConv() const { return m_conv; } - -private: - wxMBConv& m_conv; -}; - - -///////////////////////////////////////////////////////////////////////////// -// wxArchiveOutputStream -// -// PutNextEntry is used to create a new entry in the output archive, then -// the entry's data is written to the wxArchiveOutputStream. -// -// Only one entry can be open for output at a time; another call to -// PutNextEntry closes the current entry and begins the next. -// -// The overload 'bool PutNextEntry(wxArchiveEntry *entry)' takes ownership -// of the entry object. - -class WXDLLIMPEXP_BASE wxArchiveOutputStream : public wxFilterOutputStream -{ -public: - virtual ~wxArchiveOutputStream() { } - - virtual bool PutNextEntry(wxArchiveEntry *entry) = 0; - - virtual bool PutNextEntry(const wxString& name, - const wxDateTime& dt = wxDateTime::Now(), - wxFileOffset size = wxInvalidOffset) = 0; - - virtual bool PutNextDirEntry(const wxString& name, - const wxDateTime& dt = wxDateTime::Now()) = 0; - - virtual bool CopyEntry(wxArchiveEntry *entry, - wxArchiveInputStream& stream) = 0; - - virtual bool CopyArchiveMetaData(wxArchiveInputStream& stream) = 0; - - virtual bool CloseEntry() = 0; - -protected: - wxArchiveOutputStream(wxOutputStream& stream, wxMBConv& conv); - wxArchiveOutputStream(wxOutputStream *stream, wxMBConv& conv); - - wxMBConv& GetConv() const { return m_conv; } - -private: - wxMBConv& m_conv; -}; - - -///////////////////////////////////////////////////////////////////////////// -// wxArchiveIterator -// -// An input iterator that can be used to transfer an archive's catalog to -// a container. - -#if wxUSE_STL || defined WX_TEST_ARCHIVE_ITERATOR -#include -#include - -template inline -void _wxSetArchiveIteratorValue( - X& val, Y entry, void *WXUNUSED(d)) -{ - val = X(entry); -} -template inline -void _wxSetArchiveIteratorValue( - std::pair& val, Z entry, Z WXUNUSED(d)) -{ - val = std::make_pair(X(entry->GetInternalName()), Y(entry)); -} - -#if defined _MSC_VER && _MSC_VER < 1300 -template -#else -template -#endif -class wxArchiveIterator -{ -public: - typedef std::input_iterator_tag iterator_category; - typedef T value_type; - typedef ptrdiff_t difference_type; - typedef T* pointer; - typedef T& reference; - - wxArchiveIterator() : m_rep(NULL) { } - - wxArchiveIterator(Arc& arc) { - typename Arc::entry_type* entry = arc.GetNextEntry(); - m_rep = entry ? new Rep(arc, entry) : NULL; - } - - wxArchiveIterator(const wxArchiveIterator& it) : m_rep(it.m_rep) { - if (m_rep) - m_rep->AddRef(); - } - - ~wxArchiveIterator() { - if (m_rep) - m_rep->UnRef(); - } - - const T& operator *() const { - return m_rep->GetValue(); - } - - const T* operator ->() const { - return &**this; - } - - wxArchiveIterator& operator =(const wxArchiveIterator& it) { - if (it.m_rep) - it.m_rep.AddRef(); - if (m_rep) - m_rep.UnRef(); - m_rep = it.m_rep; - return *this; - } - - wxArchiveIterator& operator ++() { - m_rep = m_rep->Next(); - return *this; - } - - wxArchiveIterator operator ++(int) { - wxArchiveIterator it(*this); - ++(*this); - return it; - } - - bool operator ==(const wxArchiveIterator& j) const { - return m_rep == j.m_rep; - } - - bool operator !=(const wxArchiveIterator& j) const { - return !(*this == j); - } - -private: - class Rep { - Arc& m_arc; - typename Arc::entry_type* m_entry; - T m_value; - int m_ref; - - public: - Rep(Arc& arc, typename Arc::entry_type* entry) - : m_arc(arc), m_entry(entry), m_value(), m_ref(1) { } - ~Rep() - { delete m_entry; } - - void AddRef() { - m_ref++; - } - - void UnRef() { - if (--m_ref == 0) - delete this; - } - - Rep *Next() { - typename Arc::entry_type* entry = m_arc.GetNextEntry(); - if (!entry) { - UnRef(); - return NULL; - } - if (m_ref > 1) { - m_ref--; - return new Rep(m_arc, entry); - } - delete m_entry; - m_entry = entry; - m_value = T(); - return this; - } - - const T& GetValue() { - if (m_entry) { - _wxSetArchiveIteratorValue(m_value, m_entry, m_entry); - m_entry = NULL; - } - return m_value; - } - } *m_rep; -}; - -typedef wxArchiveIterator wxArchiveIter; -typedef wxArchiveIterator > wxArchivePairIter; - -#endif // wxUSE_STL || defined WX_TEST_ARCHIVE_ITERATOR - - -///////////////////////////////////////////////////////////////////////////// -// wxArchiveClassFactory -// -// A wxArchiveClassFactory instance for a particular archive type allows -// the creation of the other classes that may be needed. - -void WXDLLIMPEXP_BASE wxUseArchiveClasses(); - -class WXDLLIMPEXP_BASE wxArchiveClassFactory : public wxFilterClassFactoryBase -{ -public: - typedef wxArchiveEntry entry_type; - typedef wxArchiveInputStream instream_type; - typedef wxArchiveOutputStream outstream_type; - typedef wxArchiveNotifier notifier_type; -#if wxUSE_STL || defined WX_TEST_ARCHIVE_ITERATOR - typedef wxArchiveIter iter_type; - typedef wxArchivePairIter pairiter_type; -#endif - - virtual ~wxArchiveClassFactory() { } - - wxArchiveEntry *NewEntry() const - { return DoNewEntry(); } - wxArchiveInputStream *NewStream(wxInputStream& stream) const - { return DoNewStream(stream); } - wxArchiveOutputStream *NewStream(wxOutputStream& stream) const - { return DoNewStream(stream); } - wxArchiveInputStream *NewStream(wxInputStream *stream) const - { return DoNewStream(stream); } - wxArchiveOutputStream *NewStream(wxOutputStream *stream) const - { return DoNewStream(stream); } - - virtual wxString GetInternalName( - const wxString& name, - wxPathFormat format = wxPATH_NATIVE) const = 0; - - void SetConv(wxMBConv& conv) { m_pConv = &conv; } - wxMBConv& GetConv() const - { if (m_pConv) return *m_pConv; else return wxConvLocal; } - - static const wxArchiveClassFactory *Find(const wxChar *protocol, - wxStreamProtocolType type - = wxSTREAM_PROTOCOL); - - static const wxArchiveClassFactory *GetFirst(); - const wxArchiveClassFactory *GetNext() const { return m_next; } - - void PushFront() { Remove(); m_next = sm_first; sm_first = this; } - void Remove(); - -protected: - // old compilers don't support covarient returns, so 'Do' methods are - // used to simulate them - virtual wxArchiveEntry *DoNewEntry() const = 0; - virtual wxArchiveInputStream *DoNewStream(wxInputStream& stream) const = 0; - virtual wxArchiveOutputStream *DoNewStream(wxOutputStream& stream) const = 0; - virtual wxArchiveInputStream *DoNewStream(wxInputStream *stream) const = 0; - virtual wxArchiveOutputStream *DoNewStream(wxOutputStream *stream) const = 0; - - wxArchiveClassFactory() : m_pConv(NULL), m_next(this) { } - wxArchiveClassFactory& operator=(const wxArchiveClassFactory& WXUNUSED(f)) - { return *this; } - -private: - wxMBConv *m_pConv; - static wxArchiveClassFactory *sm_first; - wxArchiveClassFactory *m_next; - - DECLARE_ABSTRACT_CLASS(wxArchiveClassFactory) -}; - -#endif // wxUSE_STREAMS && wxUSE_ARCHIVE_STREAMS - -#endif // _WX_ARCHIVE_H__ diff --git a/wxWidgets/include/wx/arrimpl.cpp b/wxWidgets/include/wx/arrimpl.cpp deleted file mode 100644 index 33e25091b9..0000000000 --- a/wxWidgets/include/wx/arrimpl.cpp +++ /dev/null @@ -1,120 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: wx/arrimpl.cpp -// Purpose: helper file for implementation of dynamic lists -// Author: Vadim Zeitlin -// Modified by: -// Created: 16.10.97 -// RCS-ID: $Id: arrimpl.cpp 34241 2005-05-22 12:10:55Z JS $ -// Copyright: (c) 1997 Vadim Zeitlin -// Licence: wxWindows license -/////////////////////////////////////////////////////////////////////////////// - -/***************************************************************************** - * Purpose: implements methods of "template" class declared in * - * DECLARE_OBJARRAY macro and which couldn't be implemented inline * - * (because they need the full definition of type T in scope) * - * * - * Usage: 1) #include dynarray.h * - * 2) WX_DECLARE_OBJARRAY * - * 3) #include arrimpl.cpp * - * 4) WX_DEFINE_OBJARRAY * - *****************************************************************************/ - -// needed to resolve the conflict between global T and macro parameter T - -#define _WX_ERROR_REMOVE2(x) wxT("bad index in ") wxT(#x) wxT("::RemoveAt()") - -// macro implements remaining (not inline) methods of template list -// (it's private to this file) -#undef _DEFINE_OBJARRAY -#define _DEFINE_OBJARRAY(T, name) \ -name::~name() \ -{ \ - Empty(); \ -} \ - \ -void name::DoCopy(const name& src) \ -{ \ - for ( size_t ui = 0; ui < src.size(); ui++ ) \ - Add(src[ui]); \ -} \ - \ -name& name::operator=(const name& src) \ -{ \ - Empty(); \ - DoCopy(src); \ - \ - return *this; \ -} \ - \ -name::name(const name& src) : wxArrayPtrVoid() \ -{ \ - DoCopy(src); \ -} \ - \ -void name::DoEmpty() \ -{ \ - for ( size_t ui = 0; ui < size(); ui++ ) \ - delete (T*)base_array::operator[](ui); \ -} \ - \ -void name::RemoveAt(size_t uiIndex, size_t nRemove) \ -{ \ - wxCHECK_RET( uiIndex < size(), _WX_ERROR_REMOVE2(name) ); \ - \ - for (size_t i = 0; i < nRemove; i++ ) \ - delete (T*)base_array::operator[](uiIndex + i); \ - \ - base_array::erase(begin() + uiIndex, begin() + uiIndex + nRemove); \ -} \ - \ -void name::Add(const T& item, size_t nInsert) \ -{ \ - if (nInsert == 0) \ - return; \ - T* pItem = new T(item); \ - size_t nOldSize = size(); \ - if ( pItem != NULL ) \ - base_array::insert(end(), nInsert, pItem); \ - for (size_t i = 1; i < nInsert; i++) \ - base_array::operator[](nOldSize + i) = new T(item); \ -} \ - \ -void name::Insert(const T& item, size_t uiIndex, size_t nInsert) \ -{ \ - if (nInsert == 0) \ - return; \ - T* pItem = new T(item); \ - if ( pItem != NULL ) \ - base_array::insert(begin() + uiIndex, nInsert, pItem); \ - for (size_t i = 1; i < nInsert; i++) \ - base_array::operator[](uiIndex + i) = new T(item); \ -} \ - \ -int name::Index(const T& Item, bool bFromEnd) const \ -{ \ - if ( bFromEnd ) { \ - if ( size() > 0 ) { \ - size_t ui = size() - 1; \ - do { \ - if ( (T*)base_array::operator[](ui) == &Item ) \ - return wx_static_cast(int, ui); \ - ui--; \ - } \ - while ( ui != 0 ); \ - } \ - } \ - else { \ - for( size_t ui = 0; ui < size(); ui++ ) { \ - if( (T*)base_array::operator[](ui) == &Item ) \ - return wx_static_cast(int, ui); \ - } \ - } \ - \ - return wxNOT_FOUND; \ -} - -// redefine the macro so that now it will generate the class implementation -// old value would provoke a compile-time error if this file is not included -#undef WX_DEFINE_OBJARRAY -#define WX_DEFINE_OBJARRAY(name) _DEFINE_OBJARRAY(_wxObjArray##name, name) diff --git a/wxWidgets/include/wx/arrstr.h b/wxWidgets/include/wx/arrstr.h deleted file mode 100644 index 2aeaea7955..0000000000 --- a/wxWidgets/include/wx/arrstr.h +++ /dev/null @@ -1,377 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: include/wx/arrstr.h -// Purpose: wxArrayString class -// Author: Mattia Barbon and Vadim Zeitlin -// Modified by: -// Created: 07/07/03 -// RCS-ID: $Id: arrstr.h 61872 2009-09-09 22:37:05Z VZ $ -// Copyright: (c) 2003 Vadim Zeitlin -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_ARRSTR_H -#define _WX_ARRSTR_H - -#include "wx/defs.h" -#include "wx/string.h" - -WXDLLIMPEXP_BASE int wxCMPFUNC_CONV wxStringSortAscending(wxString*, wxString*); -WXDLLIMPEXP_BASE int wxCMPFUNC_CONV wxStringSortDescending(wxString*, wxString*); - -#if wxUSE_STL - -#include "wx/dynarray.h" - -typedef int (wxCMPFUNC_CONV *CMPFUNCwxString)(wxString*, wxString*); -typedef wxString _wxArraywxBaseArrayStringBase; -_WX_DECLARE_BASEARRAY_2(_wxArraywxBaseArrayStringBase, wxBaseArrayStringBase, - wxArray_SortFunction, - class WXDLLIMPEXP_BASE); -WX_DEFINE_USER_EXPORTED_TYPEARRAY(wxString, wxArrayStringBase, - wxBaseArrayStringBase, WXDLLIMPEXP_BASE); -_WX_DEFINE_SORTED_TYPEARRAY_2(wxString, wxSortedArrayStringBase, - wxBaseArrayStringBase, = wxStringSortAscending, - class WXDLLIMPEXP_BASE, CMPFUNCwxString); - -class WXDLLIMPEXP_BASE wxArrayString : public wxArrayStringBase -{ -public: - // type of function used by wxArrayString::Sort() - typedef int (wxCMPFUNC_CONV *CompareFunction)(const wxString& first, - const wxString& second); - - wxArrayString() { } - wxArrayString(const wxArrayString& a) : wxArrayStringBase(a) { } - wxArrayString(size_t sz, const wxChar** a); - wxArrayString(size_t sz, const wxString* a); - - int Index(const wxChar* sz, bool bCase = true, bool bFromEnd = false) const; - - void Sort(bool reverseOrder = false); - void Sort(CompareFunction function); - void Sort(CMPFUNCwxString function) { wxArrayStringBase::Sort(function); } - - size_t Add(const wxString& string, size_t copies = 1) - { - wxArrayStringBase::Add(string, copies); - return size() - copies; - } -}; - -class WXDLLIMPEXP_BASE wxSortedArrayString : public wxSortedArrayStringBase -{ -public: - wxSortedArrayString() : wxSortedArrayStringBase(wxStringSortAscending) - { } - wxSortedArrayString(const wxSortedArrayString& array) - : wxSortedArrayStringBase(array) - { } - wxSortedArrayString(const wxArrayString& src) - : wxSortedArrayStringBase(wxStringSortAscending) - { - reserve(src.size()); - - for ( size_t n = 0; n < src.size(); n++ ) - Add(src[n]); - } - - int Index(const wxChar* sz, bool bCase = true, bool bFromEnd = false) const; -}; - -#else // if !wxUSE_STL - -// ---------------------------------------------------------------------------- -// The string array uses it's knowledge of internal structure of the wxString -// class to optimize string storage. Normally, we would store pointers to -// string, but as wxString is, in fact, itself a pointer (sizeof(wxString) is -// sizeof(char *)) we store these pointers instead. The cast to "wxString *" is -// really all we need to turn such pointer into a string! -// -// Of course, it can be called a dirty hack, but we use twice less memory and -// this approach is also more speed efficient, so it's probably worth it. -// -// Usage notes: when a string is added/inserted, a new copy of it is created, -// so the original string may be safely deleted. When a string is retrieved -// from the array (operator[] or Item() method), a reference is returned. -// ---------------------------------------------------------------------------- - -class WXDLLIMPEXP_BASE wxArrayString -{ -public: - // type of function used by wxArrayString::Sort() - typedef int (wxCMPFUNC_CONV *CompareFunction)(const wxString& first, - const wxString& second); - // type of function used by wxArrayString::Sort(), for compatibility with - // wxArray - typedef int (wxCMPFUNC_CONV *CompareFunction2)(wxString* first, - wxString* second); - - // constructors and destructor - // default ctor - wxArrayString() { Init(false); } - // if autoSort is true, the array is always sorted (in alphabetical order) - // - // NB: the reason for using int and not bool is that like this we can avoid - // using this ctor for implicit conversions from "const char *" (which - // we'd like to be implicitly converted to wxString instead!) - // - // of course, using explicit would be even better - if all compilers - // supported it... - wxArrayString(int autoSort) { Init(autoSort != 0); } - // C string array ctor - wxArrayString(size_t sz, const wxChar** a); - // wxString string array ctor - wxArrayString(size_t sz, const wxString* a); - // copy ctor - wxArrayString(const wxArrayString& array); - // assignment operator - wxArrayString& operator=(const wxArrayString& src); - // not virtual, this class should not be derived from - ~wxArrayString(); - - // memory management - // empties the list, but doesn't release memory - void Empty(); - // empties the list and releases memory - void Clear(); - // preallocates memory for given number of items - void Alloc(size_t nCount); - // minimzes the memory usage (by freeing all extra memory) - void Shrink(); - - // simple accessors - // number of elements in the array - size_t GetCount() const { return m_nCount; } - // is it empty? - bool IsEmpty() const { return m_nCount == 0; } - // number of elements in the array (GetCount is preferred API) - size_t Count() const { return m_nCount; } - - // items access (range checking is done in debug version) - // get item at position uiIndex - wxString& Item(size_t nIndex) const - { - wxASSERT_MSG( nIndex < m_nCount, - wxT("wxArrayString: index out of bounds") ); - - return *(wxString *)&(m_pItems[nIndex]); - } - - // same as Item() - wxString& operator[](size_t nIndex) const { return Item(nIndex); } - // get last item - wxString& Last() const - { - wxASSERT_MSG( !IsEmpty(), - wxT("wxArrayString: index out of bounds") ); - return Item(Count() - 1); - } - - // return a wxString[], useful for the controls which - // take one in their ctor. You must delete[] it yourself - // once you are done with it. Will return NULL if the - // ArrayString was empty. -#if WXWIN_COMPATIBILITY_2_4 - wxDEPRECATED( wxString* GetStringArray() const ); -#endif - - // item management - // Search the element in the array, starting from the beginning if - // bFromEnd is false or from end otherwise. If bCase, comparison is case - // sensitive (default). Returns index of the first item matched or - // wxNOT_FOUND - int Index (const wxChar *sz, bool bCase = true, bool bFromEnd = false) const; - // add new element at the end (if the array is not sorted), return its - // index - size_t Add(const wxString& str, size_t nInsert = 1); - // add new element at given position - void Insert(const wxString& str, size_t uiIndex, size_t nInsert = 1); - // expand the array to have count elements - void SetCount(size_t count); - // remove first item matching this value - void Remove(const wxChar *sz); - // remove item by index -#if WXWIN_COMPATIBILITY_2_4 - wxDEPRECATED( void Remove(size_t nIndex, size_t nRemove = 1) ); -#endif - void RemoveAt(size_t nIndex, size_t nRemove = 1); - - // sorting - // sort array elements in alphabetical order (or reversed alphabetical - // order if reverseOrder parameter is true) - void Sort(bool reverseOrder = false); - // sort array elements using specified comparaison function - void Sort(CompareFunction compareFunction); - void Sort(CompareFunction2 compareFunction); - - // comparison - // compare two arrays case sensitively - bool operator==(const wxArrayString& a) const; - // compare two arrays case sensitively - bool operator!=(const wxArrayString& a) const { return !(*this == a); } - - // STL-like interface - typedef wxString value_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type* iterator; - typedef const value_type* const_iterator; - typedef value_type& reference; - typedef const value_type& const_reference; - typedef int difference_type; - typedef size_t size_type; - - // TODO: this code duplicates the one in dynarray.h - class reverse_iterator - { - typedef wxString value_type; - typedef value_type* pointer; - typedef value_type& reference; - typedef reverse_iterator itor; - friend itor operator+(int o, const itor& it); - friend itor operator+(const itor& it, int o); - friend itor operator-(const itor& it, int o); - friend difference_type operator -(const itor& i1, const itor& i2); - public: - pointer m_ptr; - reverse_iterator() : m_ptr(NULL) { } - reverse_iterator(pointer ptr) : m_ptr(ptr) { } - reverse_iterator(const itor& it) : m_ptr(it.m_ptr) { } - reference operator*() const { return *m_ptr; } - pointer operator->() const { return m_ptr; } - itor& operator++() { --m_ptr; return *this; } - const itor operator++(int) - { reverse_iterator tmp = *this; --m_ptr; return tmp; } - itor& operator--() { ++m_ptr; return *this; } - const itor operator--(int) { itor tmp = *this; ++m_ptr; return tmp; } - bool operator ==(const itor& it) const { return m_ptr == it.m_ptr; } - bool operator !=(const itor& it) const { return m_ptr != it.m_ptr; } - }; - - class const_reverse_iterator - { - typedef wxString value_type; - typedef const value_type* pointer; - typedef const value_type& reference; - typedef const_reverse_iterator itor; - friend itor operator+(int o, const itor& it); - friend itor operator+(const itor& it, int o); - friend itor operator-(const itor& it, int o); - friend difference_type operator -(const itor& i1, const itor& i2); - public: - pointer m_ptr; - const_reverse_iterator() : m_ptr(NULL) { } - const_reverse_iterator(pointer ptr) : m_ptr(ptr) { } - const_reverse_iterator(const itor& it) : m_ptr(it.m_ptr) { } - const_reverse_iterator(const reverse_iterator& it) : m_ptr(it.m_ptr) { } - reference operator*() const { return *m_ptr; } - pointer operator->() const { return m_ptr; } - itor& operator++() { --m_ptr; return *this; } - const itor operator++(int) - { itor tmp = *this; --m_ptr; return tmp; } - itor& operator--() { ++m_ptr; return *this; } - const itor operator--(int) { itor tmp = *this; ++m_ptr; return tmp; } - bool operator ==(const itor& it) const { return m_ptr == it.m_ptr; } - bool operator !=(const itor& it) const { return m_ptr != it.m_ptr; } - }; - - wxArrayString(const_iterator first, const_iterator last) - { Init(false); assign(first, last); } - wxArrayString(size_type n, const_reference v) { Init(false); assign(n, v); } - void assign(const_iterator first, const_iterator last); - void assign(size_type n, const_reference v) - { clear(); Add(v, n); } - reference back() { return *(end() - 1); } - const_reference back() const { return *(end() - 1); } - iterator begin() { return (wxString *)&(m_pItems[0]); } - const_iterator begin() const { return (wxString *)&(m_pItems[0]); } - size_type capacity() const { return m_nSize; } - void clear() { Clear(); } - bool empty() const { return IsEmpty(); } - iterator end() { return begin() + GetCount(); } - const_iterator end() const { return begin() + GetCount(); } - iterator erase(iterator first, iterator last) - { - size_t idx = first - begin(); - RemoveAt(idx, last - first); - return begin() + idx; - } - iterator erase(iterator it) { return erase(it, it + 1); } - reference front() { return *begin(); } - const_reference front() const { return *begin(); } - void insert(iterator it, size_type n, const_reference v) - { Insert(v, it - begin(), n); } - iterator insert(iterator it, const_reference v = value_type()) - { size_t idx = it - begin(); Insert(v, idx); return begin() + idx; } - void insert(iterator it, const_iterator first, const_iterator last); - size_type max_size() const { return INT_MAX; } - void pop_back() { RemoveAt(GetCount() - 1); } - void push_back(const_reference v) { Add(v); } - reverse_iterator rbegin() { return reverse_iterator(end() - 1); } - const_reverse_iterator rbegin() const; - reverse_iterator rend() { return reverse_iterator(begin() - 1); } - const_reverse_iterator rend() const; - void reserve(size_type n) /* base::reserve*/; - void resize(size_type n, value_type v = value_type()); - size_type size() const { return GetCount(); } - -protected: - void Init(bool autoSort); // common part of all ctors - void Copy(const wxArrayString& src); // copies the contents of another array - -private: - void Grow(size_t nIncrement = 0); // makes array bigger if needed - void Free(); // free all the strings stored - - void DoSort(); // common part of all Sort() variants - - size_t m_nSize, // current size of the array - m_nCount; // current number of elements - - wxChar **m_pItems; // pointer to data - - bool m_autoSort; // if true, keep the array always sorted -}; - -class WXDLLIMPEXP_BASE wxSortedArrayString : public wxArrayString -{ -public: - wxSortedArrayString() : wxArrayString(true) - { } - wxSortedArrayString(const wxArrayString& array) : wxArrayString(true) - { Copy(array); } -}; - -#endif // !wxUSE_STL - -// this class provides a temporary wxString* from a -// wxArrayString -class WXDLLIMPEXP_BASE wxCArrayString -{ -public: - wxCArrayString( const wxArrayString& array ) - : m_array( array ), m_strings( NULL ) - { } - ~wxCArrayString() { delete[] m_strings; } - - size_t GetCount() const { return m_array.GetCount(); } - wxString* GetStrings() - { - if( m_strings ) return m_strings; - size_t count = m_array.GetCount(); - m_strings = new wxString[count]; - for( size_t i = 0; i < count; ++i ) - m_strings[i] = m_array[i]; - return m_strings; - } - -#if wxABI_VERSION >= 20810 - wxString* Release(); -#endif // wxABI_VERSION >= 20810 - -private: - const wxArrayString& m_array; - wxString* m_strings; -}; - -#endif diff --git a/wxWidgets/include/wx/artprov.h b/wxWidgets/include/wx/artprov.h deleted file mode 100644 index 0172621f7d..0000000000 --- a/wxWidgets/include/wx/artprov.h +++ /dev/null @@ -1,204 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/artprov.h -// Purpose: wxArtProvider class -// Author: Vaclav Slavik -// Modified by: -// Created: 18/03/2002 -// RCS-ID: $Id: artprov.h 61872 2009-09-09 22:37:05Z VZ $ -// Copyright: (c) Vaclav Slavik -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_ARTPROV_H_ -#define _WX_ARTPROV_H_ - -#include "wx/string.h" -#include "wx/bitmap.h" -#include "wx/icon.h" - -class WXDLLIMPEXP_FWD_CORE wxArtProvidersList; -class WXDLLIMPEXP_FWD_CORE wxArtProviderCache; -class wxArtProviderModule; - -// ---------------------------------------------------------------------------- -// Types -// ---------------------------------------------------------------------------- - -typedef wxString wxArtClient; -typedef wxString wxArtID; - -#define wxART_MAKE_CLIENT_ID_FROM_STR(id) (id + wxT("_C")) -#define wxART_MAKE_CLIENT_ID(id) wxT(#id) wxT("_C") -#define wxART_MAKE_ART_ID_FROM_STR(id) (id) -#define wxART_MAKE_ART_ID(id) wxT(#id) - -// ---------------------------------------------------------------------------- -// Art clients -// ---------------------------------------------------------------------------- - -#define wxART_TOOLBAR wxART_MAKE_CLIENT_ID(wxART_TOOLBAR) -#define wxART_MENU wxART_MAKE_CLIENT_ID(wxART_MENU) -#define wxART_FRAME_ICON wxART_MAKE_CLIENT_ID(wxART_FRAME_ICON) - -#define wxART_CMN_DIALOG wxART_MAKE_CLIENT_ID(wxART_CMN_DIALOG) -#define wxART_HELP_BROWSER wxART_MAKE_CLIENT_ID(wxART_HELP_BROWSER) -#define wxART_MESSAGE_BOX wxART_MAKE_CLIENT_ID(wxART_MESSAGE_BOX) -#define wxART_BUTTON wxART_MAKE_CLIENT_ID(wxART_BUTTON) - -#define wxART_OTHER wxART_MAKE_CLIENT_ID(wxART_OTHER) - -// ---------------------------------------------------------------------------- -// Art IDs -// ---------------------------------------------------------------------------- - -#define wxART_ADD_BOOKMARK wxART_MAKE_ART_ID(wxART_ADD_BOOKMARK) -#define wxART_DEL_BOOKMARK wxART_MAKE_ART_ID(wxART_DEL_BOOKMARK) -#define wxART_HELP_SIDE_PANEL wxART_MAKE_ART_ID(wxART_HELP_SIDE_PANEL) -#define wxART_HELP_SETTINGS wxART_MAKE_ART_ID(wxART_HELP_SETTINGS) -#define wxART_HELP_BOOK wxART_MAKE_ART_ID(wxART_HELP_BOOK) -#define wxART_HELP_FOLDER wxART_MAKE_ART_ID(wxART_HELP_FOLDER) -#define wxART_HELP_PAGE wxART_MAKE_ART_ID(wxART_HELP_PAGE) -#define wxART_GO_BACK wxART_MAKE_ART_ID(wxART_GO_BACK) -#define wxART_GO_FORWARD wxART_MAKE_ART_ID(wxART_GO_FORWARD) -#define wxART_GO_UP wxART_MAKE_ART_ID(wxART_GO_UP) -#define wxART_GO_DOWN wxART_MAKE_ART_ID(wxART_GO_DOWN) -#define wxART_GO_TO_PARENT wxART_MAKE_ART_ID(wxART_GO_TO_PARENT) -#define wxART_GO_HOME wxART_MAKE_ART_ID(wxART_GO_HOME) -#define wxART_FILE_OPEN wxART_MAKE_ART_ID(wxART_FILE_OPEN) -#define wxART_FILE_SAVE wxART_MAKE_ART_ID(wxART_FILE_SAVE) -#define wxART_FILE_SAVE_AS wxART_MAKE_ART_ID(wxART_FILE_SAVE_AS) -#define wxART_PRINT wxART_MAKE_ART_ID(wxART_PRINT) -#define wxART_HELP wxART_MAKE_ART_ID(wxART_HELP) -#define wxART_TIP wxART_MAKE_ART_ID(wxART_TIP) -#define wxART_REPORT_VIEW wxART_MAKE_ART_ID(wxART_REPORT_VIEW) -#define wxART_LIST_VIEW wxART_MAKE_ART_ID(wxART_LIST_VIEW) -#define wxART_NEW_DIR wxART_MAKE_ART_ID(wxART_NEW_DIR) -#define wxART_HARDDISK wxART_MAKE_ART_ID(wxART_HARDDISK) -#define wxART_FLOPPY wxART_MAKE_ART_ID(wxART_FLOPPY) -#define wxART_CDROM wxART_MAKE_ART_ID(wxART_CDROM) -#define wxART_REMOVABLE wxART_MAKE_ART_ID(wxART_REMOVABLE) -#define wxART_FOLDER wxART_MAKE_ART_ID(wxART_FOLDER) -#define wxART_FOLDER_OPEN wxART_MAKE_ART_ID(wxART_FOLDER_OPEN) -#define wxART_GO_DIR_UP wxART_MAKE_ART_ID(wxART_GO_DIR_UP) -#define wxART_EXECUTABLE_FILE wxART_MAKE_ART_ID(wxART_EXECUTABLE_FILE) -#define wxART_NORMAL_FILE wxART_MAKE_ART_ID(wxART_NORMAL_FILE) -#define wxART_TICK_MARK wxART_MAKE_ART_ID(wxART_TICK_MARK) -#define wxART_CROSS_MARK wxART_MAKE_ART_ID(wxART_CROSS_MARK) -#define wxART_ERROR wxART_MAKE_ART_ID(wxART_ERROR) -#define wxART_QUESTION wxART_MAKE_ART_ID(wxART_QUESTION) -#define wxART_WARNING wxART_MAKE_ART_ID(wxART_WARNING) -#define wxART_INFORMATION wxART_MAKE_ART_ID(wxART_INFORMATION) -#define wxART_MISSING_IMAGE wxART_MAKE_ART_ID(wxART_MISSING_IMAGE) - -#define wxART_COPY wxART_MAKE_ART_ID(wxART_COPY) -#define wxART_CUT wxART_MAKE_ART_ID(wxART_CUT) -#define wxART_PASTE wxART_MAKE_ART_ID(wxART_PASTE) -#define wxART_DELETE wxART_MAKE_ART_ID(wxART_DELETE) -#define wxART_NEW wxART_MAKE_ART_ID(wxART_NEW) - -#define wxART_UNDO wxART_MAKE_ART_ID(wxART_UNDO) -#define wxART_REDO wxART_MAKE_ART_ID(wxART_REDO) - -#define wxART_QUIT wxART_MAKE_ART_ID(wxART_QUIT) - -#define wxART_FIND wxART_MAKE_ART_ID(wxART_FIND) -#define wxART_FIND_AND_REPLACE wxART_MAKE_ART_ID(wxART_FIND_AND_REPLACE) - - -// ---------------------------------------------------------------------------- -// wxArtProvider class -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxArtProvider : public wxObject -{ -public: - // Dtor removes the provider from providers stack if it's still on it - virtual ~wxArtProvider(); - - - // Add new provider to the top of providers stack (i.e. the provider will - // be queried first of all). - static void Push(wxArtProvider *provider); - - // Add new provider to the bottom of providers stack (i.e. the provider - // will be queried as the last one). -#if wxABI_VERSION >= 20810 - static void PushBack(wxArtProvider *provider); -#endif - // same as PushBack() - static void Insert(wxArtProvider *provider); - - // Remove latest added provider and delete it. - static bool Pop(); - - // Remove provider from providers stack but don't delete it. - static bool Remove(wxArtProvider *provider); - - // Delete the given provider and remove it from the providers stack. - static bool Delete(wxArtProvider *provider); - - - // Query the providers for bitmap with given ID and return it. Return - // wxNullBitmap if no provider provides it. - static wxBitmap GetBitmap(const wxArtID& id, - const wxArtClient& client = wxART_OTHER, - const wxSize& size = wxDefaultSize); - - // Query the providers for icon with given ID and return it. Return - // wxNullIcon if no provider provides it. - static wxIcon GetIcon(const wxArtID& id, - const wxArtClient& client = wxART_OTHER, - const wxSize& size = wxDefaultSize); - - // Get the size hint of an icon from a specific wxArtClient, queries - // the topmost provider if platform_dependent = false - static wxSize GetSizeHint(const wxArtClient& client, bool platform_dependent = false); - -#if WXWIN_COMPATIBILITY_2_6 - // use the corresponding methods without redundant "Provider" suffix - wxDEPRECATED( static void PushProvider(wxArtProvider *provider) ); - wxDEPRECATED( static void InsertProvider(wxArtProvider *provider) ); - wxDEPRECATED( static bool PopProvider() ); - - // use Delete() if this is what you really need, or just delete the - // provider pointer, do not use Remove() as it does not delete the pointer - // unlike RemoveProvider() which does - wxDEPRECATED( static bool RemoveProvider(wxArtProvider *provider) ); -#endif // WXWIN_COMPATIBILITY_2_6 - -protected: - friend class wxArtProviderModule; - // Initializes default provider - static void InitStdProvider(); - // Initializes platform's native provider, if available (e.g. GTK2) - static void InitNativeProvider(); - // Destroy caches & all providers - static void CleanUpProviders(); - - // Get the default size of an icon for a specific client - virtual wxSize DoGetSizeHint(const wxArtClient& client) - { - return GetSizeHint(client, true); - } - - // Derived classes must override this method to create requested - // art resource. This method is called only once per instance's - // lifetime for each requested wxArtID. - virtual wxBitmap CreateBitmap(const wxArtID& WXUNUSED(id), - const wxArtClient& WXUNUSED(client), - const wxSize& WXUNUSED(size)) = 0; - -private: - static void CommonAddingProvider(); - -private: - // list of providers: - static wxArtProvidersList *sm_providers; - // art resources cache (so that CreateXXX is not called that often): - static wxArtProviderCache *sm_cache; - - DECLARE_ABSTRACT_CLASS(wxArtProvider) -}; - - -#endif // _WX_ARTPROV_H_ diff --git a/wxWidgets/include/wx/aui/aui.h b/wxWidgets/include/wx/aui/aui.h deleted file mode 100644 index 72273dd488..0000000000 --- a/wxWidgets/include/wx/aui/aui.h +++ /dev/null @@ -1,23 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: wx/aui/aui.h -// Purpose: wxaui: wx advanced user interface - docking window manager -// Author: Benjamin I. Williams -// Modified by: -// Created: 2005-05-17 -// RCS-ID: $Id: aui.h 55195 2008-08-23 06:31:01Z BIW $ -// Copyright: (C) Copyright 2005, Kirix Corporation, All Rights Reserved. -// Licence: wxWindows Library Licence, Version 3.1 -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_AUI_H_ -#define _WX_AUI_H_ - -#include "wx/aui/framemanager.h" -#include "wx/aui/dockart.h" -#include "wx/aui/floatpane.h" -#include "wx/aui/auibar.h" -#include "wx/aui/auibook.h" -#include "wx/aui/tabmdi.h" - -#endif // _WX_AUI_H_ - diff --git a/wxWidgets/include/wx/aui/auibar.h b/wxWidgets/include/wx/aui/auibar.h deleted file mode 100644 index a6b855b050..0000000000 --- a/wxWidgets/include/wx/aui/auibar.h +++ /dev/null @@ -1,685 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: wx/aui/toolbar.h -// Purpose: wxaui: wx advanced user interface - docking window manager -// Author: Benjamin I. Williams -// Modified by: -// Created: 2008-08-04 -// RCS-ID: $Id: auibar.h 59850 2009-03-25 13:41:38Z BIW $ -// Copyright: (C) Copyright 2005, Kirix Corporation, All Rights Reserved. -// Licence: wxWindows Library Licence, Version 3.1 -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_AUIBAR_H_ -#define _WX_AUIBAR_H_ - -#include "wx/defs.h" - -#if wxUSE_AUI - -#if wxABI_VERSION >= 20809 - -#include "wx/control.h" - -enum wxAuiToolBarStyle -{ - wxAUI_TB_TEXT = 1 << 0, - wxAUI_TB_NO_TOOLTIPS = 1 << 1, - wxAUI_TB_NO_AUTORESIZE = 1 << 2, - wxAUI_TB_GRIPPER = 1 << 3, - wxAUI_TB_OVERFLOW = 1 << 4, - wxAUI_TB_VERTICAL = 1 << 5, - wxAUI_TB_HORZ_LAYOUT = 1 << 6, - wxAUI_TB_HORZ_TEXT = (wxAUI_TB_HORZ_LAYOUT | wxAUI_TB_TEXT), - wxAUI_TB_DEFAULT_STYLE = 0 -}; - -enum wxAuiToolBarArtSetting -{ - wxAUI_TBART_SEPARATOR_SIZE = 0, - wxAUI_TBART_GRIPPER_SIZE = 1, - wxAUI_TBART_OVERFLOW_SIZE = 2 -}; - -enum wxAuiToolBarToolTextOrientation -{ - wxAUI_TBTOOL_TEXT_LEFT = 0, // unused/unimplemented - wxAUI_TBTOOL_TEXT_RIGHT = 1, - wxAUI_TBTOOL_TEXT_TOP = 2, // unused/unimplemented - wxAUI_TBTOOL_TEXT_BOTTOM = 3 -}; - - -// aui toolbar event class - -class WXDLLIMPEXP_AUI wxAuiToolBarEvent : public wxNotifyEvent -{ -public: - wxAuiToolBarEvent(wxEventType command_type = wxEVT_NULL, - int win_id = 0) - : wxNotifyEvent(command_type, win_id) - { - is_dropdown_clicked = false; - click_pt = wxPoint(-1, -1); - rect = wxRect(-1,-1, 0, 0); - tool_id = -1; - } -#ifndef SWIG - wxAuiToolBarEvent(const wxAuiToolBarEvent& c) : wxNotifyEvent(c) - { - is_dropdown_clicked = c.is_dropdown_clicked; - click_pt = c.click_pt; - rect = c.rect; - tool_id = c.tool_id; - } -#endif - wxEvent *Clone() const { return new wxAuiToolBarEvent(*this); } - - bool IsDropDownClicked() const { return is_dropdown_clicked; } - void SetDropDownClicked(bool c) { is_dropdown_clicked = c; } - - wxPoint GetClickPoint() const { return click_pt; } - void SetClickPoint(const wxPoint& p) { click_pt = p; } - - wxRect GetItemRect() const { return rect; } - void SetItemRect(const wxRect& r) { rect = r; } - - int GetToolId() const { return tool_id; } - void SetToolId(int id) { tool_id = id; } - -private: - - bool is_dropdown_clicked; - wxPoint click_pt; - wxRect rect; - int tool_id; - -#ifndef SWIG -private: - DECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxAuiToolBarEvent) -#endif -}; - - -class WXDLLIMPEXP_AUI wxAuiToolBarItem -{ - friend class wxAuiToolBar; - -public: - - wxAuiToolBarItem() - { - window = NULL; - sizer_item = NULL; - spacer_pixels = 0; - id = 0; - kind = wxITEM_NORMAL; - state = 0; // normal, enabled - proportion = 0; - active = true; - dropdown = true; - sticky = true; - user_data = 0; - } - - wxAuiToolBarItem(const wxAuiToolBarItem& c) - { - Assign(c); - } - - wxAuiToolBarItem& operator=(const wxAuiToolBarItem& c) - { - Assign(c); - return *this; - } - - void Assign(const wxAuiToolBarItem& c) - { - window = c.window; - label = c.label; - bitmap = c.bitmap; - disabled_bitmap = c.disabled_bitmap; - hover_bitmap = c.hover_bitmap; - short_help = c.short_help; - long_help = c.long_help; - sizer_item = c.sizer_item; - min_size = c.min_size; - spacer_pixels = c.spacer_pixels; - id = c.id; - kind = c.kind; - state = c.state; - proportion = c.proportion; - active = c.active; - dropdown = c.dropdown; - sticky = c.sticky; - user_data = c.user_data; - } - - - void SetWindow(wxWindow* w) { window = w; } - wxWindow* GetWindow() { return window; } - - void SetId(int new_id) { id = new_id; } - int GetId() const { return id; } - - void SetKind(int new_kind) { kind = new_kind; } - int GetKind() const { return kind; } - - void SetState(int new_state) { state = new_state; } - int GetState() const { return state; } - - void SetSizerItem(wxSizerItem* s) { sizer_item = s; } - wxSizerItem* GetSizerItem() const { return sizer_item; } - - void SetLabel(const wxString& s) { label = s; } - const wxString& GetLabel() const { return label; } - - void SetBitmap(const wxBitmap& bmp) { bitmap = bmp; } - const wxBitmap& GetBitmap() const { return bitmap; } - - void SetDisabledBitmap(const wxBitmap& bmp) { disabled_bitmap = bmp; } - const wxBitmap& GetDisabledBitmap() const { return disabled_bitmap; } - - void SetHoverBitmap(const wxBitmap& bmp) { hover_bitmap = bmp; } - const wxBitmap& GetHoverBitmap() const { return hover_bitmap; } - - void SetShortHelp(const wxString& s) { short_help = s; } - const wxString& GetShortHelp() const { return short_help; } - - void SetLongHelp(const wxString& s) { long_help = s; } - const wxString& GetLongHelp() const { return long_help; } - - void SetMinSize(const wxSize& s) { min_size = s; } - const wxSize& GetMinSize() const { return min_size; } - - void SetSpacerPixels(int s) { spacer_pixels = s; } - int GetSpacerPixels() const { return spacer_pixels; } - - void SetProportion(int p) { proportion = p; } - int GetProportion() const { return proportion; } - - void SetActive(bool b) { active = b; } - bool IsActive() const { return active; } - - void SetHasDropDown(bool b) { dropdown = b; } - bool HasDropDown() const { return dropdown; } - - void SetSticky(bool b) { sticky = b; } - bool IsSticky() const { return sticky; } - - void SetUserData(long l) { user_data = l; } - long GetUserData() const { return user_data; } - -private: - - wxWindow* window; // item's associated window - wxString label; // label displayed on the item - wxBitmap bitmap; // item's bitmap - wxBitmap disabled_bitmap; // item's disabled bitmap - wxBitmap hover_bitmap; // item's hover bitmap - wxString short_help; // short help (for tooltip) - wxString long_help; // long help (for status bar) - wxSizerItem* sizer_item; // sizer item - wxSize min_size; // item's minimum size - int spacer_pixels; // size of a spacer - int id; // item's id - int kind; // item's kind - int state; // state - int proportion; // proportion - bool active; // true if the item is currently active - bool dropdown; // true if the item has a dropdown button - bool sticky; // overrides button states if true (always active) - long user_data; // user-specified data -}; - -#ifndef SWIG -WX_DECLARE_USER_EXPORTED_OBJARRAY(wxAuiToolBarItem, wxAuiToolBarItemArray, WXDLLIMPEXP_AUI); -#endif - - - - -// tab art class - -class WXDLLIMPEXP_AUI wxAuiToolBarArt -{ -public: - - wxAuiToolBarArt() { } - virtual ~wxAuiToolBarArt() { } - - virtual wxAuiToolBarArt* Clone() = 0; - virtual void SetFlags(unsigned int flags) = 0; - virtual void SetFont(const wxFont& font) = 0; - virtual void SetTextOrientation(int orientation) = 0; - - virtual void DrawBackground( - wxDC& dc, - wxWindow* wnd, - const wxRect& rect) = 0; - - virtual void DrawLabel( - wxDC& dc, - wxWindow* wnd, - const wxAuiToolBarItem& item, - const wxRect& rect) = 0; - - virtual void DrawButton( - wxDC& dc, - wxWindow* wnd, - const wxAuiToolBarItem& item, - const wxRect& rect) = 0; - - virtual void DrawDropDownButton( - wxDC& dc, - wxWindow* wnd, - const wxAuiToolBarItem& item, - const wxRect& rect) = 0; - - virtual void DrawControlLabel( - wxDC& dc, - wxWindow* wnd, - const wxAuiToolBarItem& item, - const wxRect& rect) = 0; - - virtual void DrawSeparator( - wxDC& dc, - wxWindow* wnd, - const wxRect& rect) = 0; - - virtual void DrawGripper( - wxDC& dc, - wxWindow* wnd, - const wxRect& rect) = 0; - - virtual void DrawOverflowButton( - wxDC& dc, - wxWindow* wnd, - const wxRect& rect, - int state) = 0; - - virtual wxSize GetLabelSize( - wxDC& dc, - wxWindow* wnd, - const wxAuiToolBarItem& item) = 0; - - virtual wxSize GetToolSize( - wxDC& dc, - wxWindow* wnd, - const wxAuiToolBarItem& item) = 0; - - virtual int GetElementSize(int element_id) = 0; - virtual void SetElementSize(int element_id, int size) = 0; - - virtual int ShowDropDown( - wxWindow* wnd, - const wxAuiToolBarItemArray& items) = 0; -}; - - - -class WXDLLIMPEXP_AUI wxAuiDefaultToolBarArt : public wxAuiToolBarArt -{ - -public: - - wxAuiDefaultToolBarArt(); - virtual ~wxAuiDefaultToolBarArt(); - - virtual wxAuiToolBarArt* Clone(); - virtual void SetFlags(unsigned int flags); - virtual void SetFont(const wxFont& font); - virtual void SetTextOrientation(int orientation); - - virtual void DrawBackground( - wxDC& dc, - wxWindow* wnd, - const wxRect& rect); - - virtual void DrawLabel( - wxDC& dc, - wxWindow* wnd, - const wxAuiToolBarItem& item, - const wxRect& rect); - - virtual void DrawButton( - wxDC& dc, - wxWindow* wnd, - const wxAuiToolBarItem& item, - const wxRect& rect); - - virtual void DrawDropDownButton( - wxDC& dc, - wxWindow* wnd, - const wxAuiToolBarItem& item, - const wxRect& rect); - - virtual void DrawControlLabel( - wxDC& dc, - wxWindow* wnd, - const wxAuiToolBarItem& item, - const wxRect& rect); - - virtual void DrawSeparator( - wxDC& dc, - wxWindow* wnd, - const wxRect& rect); - - virtual void DrawGripper( - wxDC& dc, - wxWindow* wnd, - const wxRect& rect); - - virtual void DrawOverflowButton( - wxDC& dc, - wxWindow* wnd, - const wxRect& rect, - int state); - - virtual wxSize GetLabelSize( - wxDC& dc, - wxWindow* wnd, - const wxAuiToolBarItem& item); - - virtual wxSize GetToolSize( - wxDC& dc, - wxWindow* wnd, - const wxAuiToolBarItem& item); - - virtual int GetElementSize(int element); - virtual void SetElementSize(int element_id, int size); - - virtual int ShowDropDown(wxWindow* wnd, - const wxAuiToolBarItemArray& items); - -protected: - - wxBitmap m_button_dropdown_bmp; - wxBitmap m_disabled_button_dropdown_bmp; - wxBitmap m_overflow_bmp; - wxBitmap m_disabled_overflow_bmp; - wxColour m_base_colour; - wxColour m_highlight_colour; - wxFont m_font; - unsigned int m_flags; - int m_text_orientation; - - wxPen m_gripper_pen1; - wxPen m_gripper_pen2; - wxPen m_gripper_pen3; - - int m_separator_size; - int m_gripper_size; - int m_overflow_size; -}; - - - - -class WXDLLIMPEXP_AUI wxAuiToolBar : public wxControl -{ -public: - - wxAuiToolBar(wxWindow* parent, - wxWindowID id = -1, - const wxPoint& position = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = wxAUI_TB_DEFAULT_STYLE); - ~wxAuiToolBar(); - - void SetWindowStyleFlag(long style); - long GetWindowStyleFlag() const; - - void SetArtProvider(wxAuiToolBarArt* art); - wxAuiToolBarArt* GetArtProvider() const; - - bool SetFont(const wxFont& font); - - - void AddTool(int tool_id, - const wxString& label, - const wxBitmap& bitmap, - const wxString& short_help_string = wxEmptyString, - wxItemKind kind = wxITEM_NORMAL); - - void AddTool(int tool_id, - const wxString& label, - const wxBitmap& bitmap, - const wxBitmap& disabled_bitmap, - wxItemKind kind, - const wxString& short_help_string, - const wxString& long_help_string, - wxObject* client_data); - - void AddTool(int tool_id, - const wxBitmap& bitmap, - const wxBitmap& disabled_bitmap, - bool toggle = false, - wxObject* client_data = NULL, - const wxString& short_help_string = wxEmptyString, - const wxString& long_help_string = wxEmptyString) - { - AddTool(tool_id, - wxEmptyString, - bitmap, - disabled_bitmap, - toggle ? wxITEM_CHECK : wxITEM_NORMAL, - short_help_string, - long_help_string, - client_data); - } - - void AddLabel(int tool_id, - const wxString& label = wxEmptyString, - const int width = -1); - void AddControl(wxControl* control, - const wxString& label = wxEmptyString); - void AddSeparator(); - void AddSpacer(int pixels); - void AddStretchSpacer(int proportion = 1); - - bool Realize(); - - wxControl* FindControl(int window_id); - wxAuiToolBarItem* FindToolByPosition(wxCoord x, wxCoord y) const; - wxAuiToolBarItem* FindToolByIndex(int idx) const; - wxAuiToolBarItem* FindTool(int tool_id) const; - - void ClearTools() { Clear() ; } - void Clear(); - bool DeleteTool(int tool_id); - bool DeleteByIndex(int tool_id); - - size_t GetToolCount() const; - int GetToolPos(int tool_id) const { return GetToolIndex(tool_id); } - int GetToolIndex(int tool_id) const; - bool GetToolFits(int tool_id) const; - wxRect GetToolRect(int tool_id) const; - bool GetToolFitsByIndex(int tool_id) const; - bool GetToolBarFits() const; - - void SetMargins(const wxSize& size) { SetMargins(size.x, size.x, size.y, size.y); } - void SetMargins(int x, int y) { SetMargins(x, x, y, y); } - void SetMargins(int left, int right, int top, int bottom); - - void SetToolBitmapSize(const wxSize& size); - wxSize GetToolBitmapSize() const; - - bool GetOverflowVisible() const; - void SetOverflowVisible(bool visible); - - bool GetGripperVisible() const; - void SetGripperVisible(bool visible); - - void ToggleTool(int tool_id, bool state); - bool GetToolToggled(int tool_id) const; - - void EnableTool(int tool_id, bool state); - bool GetToolEnabled(int tool_id) const; - - void SetToolDropDown(int tool_id, bool dropdown); - bool GetToolDropDown(int tool_id) const; - - void SetToolBorderPadding(int padding); - int GetToolBorderPadding() const; - - void SetToolTextOrientation(int orientation); - int GetToolTextOrientation() const; - - void SetToolPacking(int packing); - int GetToolPacking() const; - - void SetToolProportion(int tool_id, int proportion); - int GetToolProportion(int tool_id) const; - - void SetToolSeparation(int separation); - int GetToolSeparation() const; - - void SetToolSticky(int tool_id, bool sticky); - bool GetToolSticky(int tool_id) const; - - wxString GetToolLabel(int tool_id) const; - void SetToolLabel(int tool_id, const wxString& label); - - wxBitmap GetToolBitmap(int tool_id) const; - void SetToolBitmap(int tool_id, const wxBitmap& bitmap); - - wxString GetToolShortHelp(int tool_id) const; - void SetToolShortHelp(int tool_id, const wxString& help_string); - - wxString GetToolLongHelp(int tool_id) const; - void SetToolLongHelp(int tool_id, const wxString& help_string); - - void SetCustomOverflowItems(const wxAuiToolBarItemArray& prepend, - const wxAuiToolBarItemArray& append); - -protected: - - virtual void OnCustomRender(wxDC& WXUNUSED(dc), - const wxAuiToolBarItem& WXUNUSED(item), - const wxRect& WXUNUSED(rect)) { } - -protected: - - void DoIdleUpdate(); - void SetOrientation(int orientation); - void SetHoverItem(wxAuiToolBarItem* item); - void SetPressedItem(wxAuiToolBarItem* item); - void RefreshOverflowState(); - - int GetOverflowState() const; - wxRect GetOverflowRect() const; - wxSize GetLabelSize(const wxString& label); - wxAuiToolBarItem* FindToolByPositionWithPacking(wxCoord x, wxCoord y) const; - - void DoSetSize(int x, - int y, - int width, - int height, - int sizeFlags = wxSIZE_AUTO); - -protected: // handlers - - void OnSize(wxSizeEvent& evt); - void OnIdle(wxIdleEvent& evt); - void OnPaint(wxPaintEvent& evt); - void OnEraseBackground(wxEraseEvent& evt); - void OnLeftDown(wxMouseEvent& evt); - void OnLeftUp(wxMouseEvent& evt); - void OnRightDown(wxMouseEvent& evt); - void OnRightUp(wxMouseEvent& evt); - void OnMiddleDown(wxMouseEvent& evt); - void OnMiddleUp(wxMouseEvent& evt); - void OnMotion(wxMouseEvent& evt); - void OnLeaveWindow(wxMouseEvent& evt); - void OnSetCursor(wxSetCursorEvent& evt); - -protected: - - wxAuiToolBarItemArray m_items; // array of toolbar items - wxAuiToolBarArt* m_art; // art provider - wxBoxSizer* m_sizer; // main sizer for toolbar - wxAuiToolBarItem* m_action_item; // item that's being acted upon (pressed) - wxAuiToolBarItem* m_tip_item; // item that has its tooltip shown - wxBitmap m_bitmap; // double-buffer bitmap - wxSizerItem* m_gripper_sizer_item; - wxSizerItem* m_overflow_sizer_item; - wxSize m_absolute_min_size; - wxPoint m_action_pos; // position of left-mouse down - wxAuiToolBarItemArray m_custom_overflow_prepend; - wxAuiToolBarItemArray m_custom_overflow_append; - - int m_button_width; - int m_button_height; - int m_sizer_element_count; - int m_left_padding; - int m_right_padding; - int m_top_padding; - int m_bottom_padding; - int m_tool_packing; - int m_tool_border_padding; - int m_tool_text_orientation; - int m_overflow_state; - bool m_dragging; - bool m_gripper_visible; - bool m_overflow_visible; - long m_style; - - DECLARE_EVENT_TABLE() - DECLARE_CLASS(wxAuiToolBar) -}; - - - - -// wx event machinery - -#ifndef SWIG - -BEGIN_DECLARE_EVENT_TYPES() - DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_AUI, wxEVT_COMMAND_AUITOOLBAR_TOOL_DROPDOWN, 0) - DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_AUI, wxEVT_COMMAND_AUITOOLBAR_OVERFLOW_CLICK, 0) - DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_AUI, wxEVT_COMMAND_AUITOOLBAR_RIGHT_CLICK, 0) - DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_AUI, wxEVT_COMMAND_AUITOOLBAR_MIDDLE_CLICK, 0) - DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_AUI, wxEVT_COMMAND_AUITOOLBAR_BEGIN_DRAG, 0) -END_DECLARE_EVENT_TYPES() - -typedef void (wxEvtHandler::*wxAuiToolBarEventFunction)(wxAuiToolBarEvent&); - -#define wxAuiToolBarEventHandler(func) \ - (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxAuiToolBarEventFunction, &func) - -#define EVT_AUITOOLBAR_TOOL_DROPDOWN(winid, fn) \ - wx__DECLARE_EVT1(wxEVT_COMMAND_AUITOOLBAR_TOOL_DROPDOWN, winid, wxAuiToolBarEventHandler(fn)) -#define EVT_AUITOOLBAR_OVERFLOW_CLICK(winid, fn) \ - wx__DECLARE_EVT1(wxEVT_COMMAND_AUITOOLBAR_OVERFLOW_CLICK, winid, wxAuiToolBarEventHandler(fn)) -#define EVT_AUITOOLBAR_RIGHT_CLICK(winid, fn) \ - wx__DECLARE_EVT1(wxEVT_COMMAND_AUITOOLBAR_RIGHT_CLICK, winid, wxAuiToolBarEventHandler(fn)) -#define EVT_AUITOOLBAR_MIDDLE_CLICK(winid, fn) \ - wx__DECLARE_EVT1(wxEVT_COMMAND_AUITOOLBAR_MIDDLE_CLICK, winid, wxAuiToolBarEventHandler(fn)) -#define EVT_AUITOOLBAR_BEGIN_DRAG(winid, fn) \ - wx__DECLARE_EVT1(wxEVT_COMMAND_AUITOOLBAR_BEGIN_DRAG, winid, wxAuiToolBarEventHandler(fn)) - -#else - -// wxpython/swig event work -%constant wxEventType wxEVT_COMMAND_AUITOOLBAR_TOOL_DROPDOWN; -%constant wxEventType wxEVT_COMMAND_AUITOOLBAR_OVERFLOW_CLICK; -%constant wxEventType wxEVT_COMMAND_AUITOOLBAR_RIGHT_CLICK; -%constant wxEventType wxEVT_COMMAND_AUITOOLBAR_MIDDLE_CLICK; -%constant wxEventType wxEVT_COMMAND_AUITOOLBAR_BEGIN_DRAG; - -%pythoncode { - EVT_AUITOOLBAR_TOOL_DROPDOWN = wx.PyEventBinder( wxEVT_COMMAND_AUITOOLBAR_TOOL_DROPDOWN, 1 ) - EVT_AUITOOLBAR_OVERFLOW_CLICK = wx.PyEventBinder( wxEVT_COMMAND_AUITOOLBAR_OVERFLOW_CLICK, 1 ) - EVT_AUITOOLBAR_RIGHT_CLICK = wx.PyEventBinder( wxEVT_COMMAND_AUITOOLBAR_RIGHT_CLICK, 1 ) - EVT_AUITOOLBAR_MIDDLE_CLICK = wx.PyEventBinder( wxEVT_COMMAND_AUITOOLBAR_MIDDLE_CLICK, 1 ) - EVT_AUITOOLBAR_BEGIN_DRAG = wx.PyEventBinder( wxEVT_COMMAND_AUITOOLBAR_BEGIN_DRAG, 1 ) -} -#endif // SWIG - -#endif // wxABI_VERSION >= 20809 - -#endif // wxUSE_AUI - -#endif // _WX_AUIBAR_H_ - diff --git a/wxWidgets/include/wx/aui/auibook.h b/wxWidgets/include/wx/aui/auibook.h deleted file mode 100644 index 0fc290a3c5..0000000000 --- a/wxWidgets/include/wx/aui/auibook.h +++ /dev/null @@ -1,753 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: wx/aui/auibook.h -// Purpose: wxaui: wx advanced user interface - notebook -// Author: Benjamin I. Williams -// Modified by: -// Created: 2006-06-28 -// Copyright: (C) Copyright 2006, Kirix Corporation, All Rights Reserved. -// Licence: wxWindows Library Licence, Version 3.1 -/////////////////////////////////////////////////////////////////////////////// - - - -#ifndef _WX_AUINOTEBOOK_H_ -#define _WX_AUINOTEBOOK_H_ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -#include "wx/defs.h" - -#if wxUSE_AUI - -#include "wx/aui/framemanager.h" -#include "wx/aui/dockart.h" -#include "wx/aui/floatpane.h" -#include "wx/control.h" - - -class wxAuiNotebook; - - -enum wxAuiNotebookOption -{ - wxAUI_NB_TOP = 1 << 0, - wxAUI_NB_LEFT = 1 << 1, // not implemented yet - wxAUI_NB_RIGHT = 1 << 2, // not implemented yet - wxAUI_NB_BOTTOM = 1 << 3, - wxAUI_NB_TAB_SPLIT = 1 << 4, - wxAUI_NB_TAB_MOVE = 1 << 5, - wxAUI_NB_TAB_EXTERNAL_MOVE = 1 << 6, - wxAUI_NB_TAB_FIXED_WIDTH = 1 << 7, - wxAUI_NB_SCROLL_BUTTONS = 1 << 8, - wxAUI_NB_WINDOWLIST_BUTTON = 1 << 9, - wxAUI_NB_CLOSE_BUTTON = 1 << 10, - wxAUI_NB_CLOSE_ON_ACTIVE_TAB = 1 << 11, - wxAUI_NB_CLOSE_ON_ALL_TABS = 1 << 12, - wxAUI_NB_MIDDLE_CLICK_CLOSE = 1 << 13, - - wxAUI_NB_DEFAULT_STYLE = wxAUI_NB_TOP | - wxAUI_NB_TAB_SPLIT | - wxAUI_NB_TAB_MOVE | - wxAUI_NB_SCROLL_BUTTONS | - wxAUI_NB_CLOSE_ON_ACTIVE_TAB | - wxAUI_NB_MIDDLE_CLICK_CLOSE -}; - - - - -// aui notebook event class - -class WXDLLIMPEXP_AUI wxAuiNotebookEvent : public wxNotifyEvent -{ -public: - wxAuiNotebookEvent(wxEventType command_type = wxEVT_NULL, - int win_id = 0) - : wxNotifyEvent(command_type, win_id) - { - old_selection = -1; - selection = -1; - drag_source = NULL; - } -#ifndef SWIG - wxAuiNotebookEvent(const wxAuiNotebookEvent& c) : wxNotifyEvent(c) - { - old_selection = c.old_selection; - selection = c.selection; - drag_source = c.drag_source; - } -#endif - wxEvent *Clone() const { return new wxAuiNotebookEvent(*this); } - - void SetSelection(int s) { selection = s; m_commandInt = s; } - int GetSelection() const { return selection; } - - void SetOldSelection(int s) { old_selection = s; } - int GetOldSelection() const { return old_selection; } - - void SetDragSource(wxAuiNotebook* s) { drag_source = s; } - wxAuiNotebook* GetDragSource() const { return drag_source; } - -public: - int old_selection; - int selection; - wxAuiNotebook* drag_source; - -#ifndef SWIG -private: - DECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxAuiNotebookEvent) -#endif -}; - - -class WXDLLIMPEXP_AUI wxAuiNotebookPage -{ -public: - wxWindow* window; // page's associated window - wxString caption; // caption displayed on the tab - wxBitmap bitmap; // tab's bitmap - wxRect rect; // tab's hit rectangle - bool active; // true if the page is currently active -}; - -class WXDLLIMPEXP_AUI wxAuiTabContainerButton -{ -public: - - int id; // button's id - int cur_state; // current state (normal, hover, pressed, etc.) - int location; // buttons location (wxLEFT, wxRIGHT, or wxCENTER) - wxBitmap bitmap; // button's hover bitmap - wxBitmap dis_bitmap; // button's disabled bitmap - wxRect rect; // button's hit rectangle -}; - - -#ifndef SWIG -WX_DECLARE_USER_EXPORTED_OBJARRAY(wxAuiNotebookPage, wxAuiNotebookPageArray, WXDLLIMPEXP_AUI); -WX_DECLARE_USER_EXPORTED_OBJARRAY(wxAuiTabContainerButton, wxAuiTabContainerButtonArray, WXDLLIMPEXP_AUI); -#endif - - -// tab art class - -class WXDLLIMPEXP_AUI wxAuiTabArt -{ -public: - - wxAuiTabArt() { } - virtual ~wxAuiTabArt() { } - - virtual wxAuiTabArt* Clone() = 0; - virtual void SetFlags(unsigned int flags) = 0; - - virtual void SetSizingInfo(const wxSize& tab_ctrl_size, - size_t tab_count) = 0; - - virtual void SetNormalFont(const wxFont& font) = 0; - virtual void SetSelectedFont(const wxFont& font) = 0; - virtual void SetMeasuringFont(const wxFont& font) = 0; - - virtual void DrawBackground( - wxDC& dc, - wxWindow* wnd, - const wxRect& rect) = 0; - - virtual void DrawTab(wxDC& dc, - wxWindow* wnd, - const wxAuiNotebookPage& pane, - const wxRect& in_rect, - int close_button_state, - wxRect* out_tab_rect, - wxRect* out_button_rect, - int* x_extent) = 0; - - virtual void DrawButton( - wxDC& dc, - wxWindow* wnd, - const wxRect& in_rect, - int bitmap_id, - int button_state, - int orientation, - wxRect* out_rect) = 0; - - virtual wxSize GetTabSize( - wxDC& dc, - wxWindow* wnd, - const wxString& caption, - const wxBitmap& bitmap, - bool active, - int close_button_state, - int* x_extent) = 0; - - virtual int ShowDropDown( - wxWindow* wnd, - const wxAuiNotebookPageArray& items, - int active_idx) = 0; - - virtual int GetIndentSize() = 0; - - virtual int GetBestTabCtrlSize( - wxWindow* wnd, - const wxAuiNotebookPageArray& pages, - const wxSize& required_bmp_size) = 0; -}; - - -class WXDLLIMPEXP_AUI wxAuiDefaultTabArt : public wxAuiTabArt -{ - -public: - - wxAuiDefaultTabArt(); - virtual ~wxAuiDefaultTabArt(); - - wxAuiTabArt* Clone(); - void SetFlags(unsigned int flags); - void SetSizingInfo(const wxSize& tab_ctrl_size, - size_t tab_count); - - void SetNormalFont(const wxFont& font); - void SetSelectedFont(const wxFont& font); - void SetMeasuringFont(const wxFont& font); - - void DrawBackground( - wxDC& dc, - wxWindow* wnd, - const wxRect& rect); - - void DrawTab(wxDC& dc, - wxWindow* wnd, - const wxAuiNotebookPage& pane, - const wxRect& in_rect, - int close_button_state, - wxRect* out_tab_rect, - wxRect* out_button_rect, - int* x_extent); - - void DrawButton( - wxDC& dc, - wxWindow* wnd, - const wxRect& in_rect, - int bitmap_id, - int button_state, - int orientation, - wxRect* out_rect); - - int GetIndentSize(); - - wxSize GetTabSize( - wxDC& dc, - wxWindow* wnd, - const wxString& caption, - const wxBitmap& bitmap, - bool active, - int close_button_state, - int* x_extent); - - int ShowDropDown( - wxWindow* wnd, - const wxAuiNotebookPageArray& items, - int active_idx); - - int GetBestTabCtrlSize(wxWindow* wnd, - const wxAuiNotebookPageArray& pages, - const wxSize& required_bmp_size); - -protected: - - wxFont m_normal_font; - wxFont m_selected_font; - wxFont m_measuring_font; - wxColour m_base_colour; - wxPen m_base_colour_pen; - wxPen m_border_pen; - wxBrush m_base_colour_brush; - wxBitmap m_active_close_bmp; - wxBitmap m_disabled_close_bmp; - wxBitmap m_active_left_bmp; - wxBitmap m_disabled_left_bmp; - wxBitmap m_active_right_bmp; - wxBitmap m_disabled_right_bmp; - wxBitmap m_active_windowlist_bmp; - wxBitmap m_disabled_windowlist_bmp; - - int m_fixed_tab_width; - int m_tab_ctrl_height; - unsigned int m_flags; -}; - - -class WXDLLIMPEXP_AUI wxAuiSimpleTabArt : public wxAuiTabArt -{ - -public: - - wxAuiSimpleTabArt(); - virtual ~wxAuiSimpleTabArt(); - - wxAuiTabArt* Clone(); - void SetFlags(unsigned int flags); - - void SetSizingInfo(const wxSize& tab_ctrl_size, - size_t tab_count); - - void SetNormalFont(const wxFont& font); - void SetSelectedFont(const wxFont& font); - void SetMeasuringFont(const wxFont& font); - - void DrawBackground( - wxDC& dc, - wxWindow* wnd, - const wxRect& rect); - - void DrawTab(wxDC& dc, - wxWindow* wnd, - const wxAuiNotebookPage& pane, - const wxRect& in_rect, - int close_button_state, - wxRect* out_tab_rect, - wxRect* out_button_rect, - int* x_extent); - - void DrawButton( - wxDC& dc, - wxWindow* wnd, - const wxRect& in_rect, - int bitmap_id, - int button_state, - int orientation, - wxRect* out_rect); - - int GetIndentSize(); - - wxSize GetTabSize( - wxDC& dc, - wxWindow* wnd, - const wxString& caption, - const wxBitmap& bitmap, - bool active, - int close_button_state, - int* x_extent); - - int ShowDropDown( - wxWindow* wnd, - const wxAuiNotebookPageArray& items, - int active_idx); - - int GetBestTabCtrlSize(wxWindow* wnd, - const wxAuiNotebookPageArray& pages, - const wxSize& required_bmp_size); - -protected: - - wxFont m_normal_font; - wxFont m_selected_font; - wxFont m_measuring_font; - wxPen m_normal_bkpen; - wxPen m_selected_bkpen; - wxBrush m_normal_bkbrush; - wxBrush m_selected_bkbrush; - wxBrush m_bkbrush; - wxBitmap m_active_close_bmp; - wxBitmap m_disabled_close_bmp; - wxBitmap m_active_left_bmp; - wxBitmap m_disabled_left_bmp; - wxBitmap m_active_right_bmp; - wxBitmap m_disabled_right_bmp; - wxBitmap m_active_windowlist_bmp; - wxBitmap m_disabled_windowlist_bmp; - - int m_fixed_tab_width; - unsigned int m_flags; -}; - - - - - - - - - -class WXDLLIMPEXP_AUI wxAuiTabContainer -{ -public: - - wxAuiTabContainer(); - virtual ~wxAuiTabContainer(); - - void SetArtProvider(wxAuiTabArt* art); - wxAuiTabArt* GetArtProvider() const; - - void SetFlags(unsigned int flags); - unsigned int GetFlags() const; - - bool AddPage(wxWindow* page, const wxAuiNotebookPage& info); - bool InsertPage(wxWindow* page, const wxAuiNotebookPage& info, size_t idx); - bool MovePage(wxWindow* page, size_t new_idx); - bool RemovePage(wxWindow* page); - bool SetActivePage(wxWindow* page); - bool SetActivePage(size_t page); - void SetNoneActive(); - int GetActivePage() const; - bool TabHitTest(int x, int y, wxWindow** hit) const; - bool ButtonHitTest(int x, int y, wxAuiTabContainerButton** hit) const; - wxWindow* GetWindowFromIdx(size_t idx) const; - int GetIdxFromWindow(wxWindow* page) const; - size_t GetPageCount() const; - wxAuiNotebookPage& GetPage(size_t idx); - const wxAuiNotebookPage& GetPage(size_t idx) const; - wxAuiNotebookPageArray& GetPages(); - void SetNormalFont(const wxFont& normal_font); - void SetSelectedFont(const wxFont& selected_font); - void SetMeasuringFont(const wxFont& measuring_font); - void DoShowHide(); - void SetRect(const wxRect& rect); - - void RemoveButton(int id); - void AddButton(int id, - int location, - const wxBitmap& normal_bitmap = wxNullBitmap, - const wxBitmap& disabled_bitmap = wxNullBitmap); - - size_t GetTabOffset() const; - void SetTabOffset(size_t offset); - - // Is the tab visible? - bool IsTabVisible(int tabPage, int tabOffset, wxDC* dc, wxWindow* wnd); - - // Make the tab visible if it wasn't already - void MakeTabVisible(int tabPage, wxWindow* win); - -protected: - - virtual void Render(wxDC* dc, wxWindow* wnd); - -protected: - - wxAuiTabArt* m_art; - wxAuiNotebookPageArray m_pages; - wxAuiTabContainerButtonArray m_buttons; - wxAuiTabContainerButtonArray m_tab_close_buttons; - wxRect m_rect; - size_t m_tab_offset; - unsigned int m_flags; -}; - - - -class WXDLLIMPEXP_AUI wxAuiTabCtrl : public wxControl, - public wxAuiTabContainer -{ -public: - - wxAuiTabCtrl(wxWindow* parent, - wxWindowID id = wxID_ANY, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = 0); - - ~wxAuiTabCtrl(); - -#if wxABI_VERSION >= 20805 - bool IsDragging() const { return m_is_dragging; } -#endif - -protected: - - void OnPaint(wxPaintEvent& evt); - void OnEraseBackground(wxEraseEvent& evt); - void OnSize(wxSizeEvent& evt); - void OnLeftDown(wxMouseEvent& evt); - void OnLeftUp(wxMouseEvent& evt); -#if wxABI_VERSION >= 20805 - void OnMiddleDown(wxMouseEvent& evt); - void OnMiddleUp(wxMouseEvent& evt); - void OnRightDown(wxMouseEvent& evt); - void OnRightUp(wxMouseEvent& evt); - void OnLeftDClick(wxMouseEvent& evt); - void OnSetFocus(wxFocusEvent& evt); - void OnKillFocus(wxFocusEvent& evt); - void OnChar(wxKeyEvent& evt); -#endif -#if wxABI_VERSION >= 20809 - void OnCaptureLost(wxMouseCaptureLostEvent& evt); -#endif - void OnMotion(wxMouseEvent& evt); - void OnLeaveWindow(wxMouseEvent& evt); - void OnButton(wxAuiNotebookEvent& evt); - -protected: - - wxPoint m_click_pt; - wxWindow* m_click_tab; - bool m_is_dragging; - wxAuiTabContainerButton* m_hover_button; - wxAuiTabContainerButton* m_pressed_button; - -#ifndef SWIG - DECLARE_CLASS(wxAuiTabCtrl) - DECLARE_EVENT_TABLE() -#endif -}; - - - - -class WXDLLIMPEXP_AUI wxAuiNotebook : public wxControl -{ - -public: - - wxAuiNotebook(); - - wxAuiNotebook(wxWindow* parent, - wxWindowID id = wxID_ANY, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = wxAUI_NB_DEFAULT_STYLE); - - virtual ~wxAuiNotebook(); - - bool Create(wxWindow* parent, - wxWindowID id = wxID_ANY, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = 0); - - void SetWindowStyleFlag(long style); - void SetArtProvider(wxAuiTabArt* art); - wxAuiTabArt* GetArtProvider() const; - - virtual void SetUniformBitmapSize(const wxSize& size); - virtual void SetTabCtrlHeight(int height); - - bool AddPage(wxWindow* page, - const wxString& caption, - bool select = false, - const wxBitmap& bitmap = wxNullBitmap); - - bool InsertPage(size_t page_idx, - wxWindow* page, - const wxString& caption, - bool select = false, - const wxBitmap& bitmap = wxNullBitmap); - - bool DeletePage(size_t page); - bool RemovePage(size_t page); - - size_t GetPageCount() const; - wxWindow* GetPage(size_t page_idx) const; - int GetPageIndex(wxWindow* page_wnd) const; - - bool SetPageText(size_t page, const wxString& text); - wxString GetPageText(size_t page_idx) const; - - bool SetPageBitmap(size_t page, const wxBitmap& bitmap); - wxBitmap GetPageBitmap(size_t page_idx) const; - - size_t SetSelection(size_t new_page); - int GetSelection() const; - - virtual void Split(size_t page, int direction); - -#if wxABI_VERSION >= 20801 - const wxAuiManager& GetAuiManager() const { return m_mgr; } -#endif - -#if wxABI_VERSION >= 20805 - // Sets the normal font - void SetNormalFont(const wxFont& font); - - // Sets the selected tab font - void SetSelectedFont(const wxFont& font); - - // Sets the measuring font - void SetMeasuringFont(const wxFont& font); - - // Sets the tab font - virtual bool SetFont(const wxFont& font); - - // Gets the tab control height - int GetTabCtrlHeight() const; - - // Gets the height of the notebook for a given page height - int GetHeightForPageHeight(int pageHeight); - - // Advances the selection, generation page selection events - void AdvanceSelection(bool forward = true); - - // Shows the window menu - bool ShowWindowMenu(); -#endif - -protected: - - // these can be overridden - virtual void UpdateTabCtrlHeight(); - virtual int CalculateTabCtrlHeight(); - virtual wxSize CalculateNewSplitSize(); - -protected: - - void DoSizing(); - void InitNotebook(long style); - wxAuiTabCtrl* GetTabCtrlFromPoint(const wxPoint& pt); - wxWindow* GetTabFrameFromTabCtrl(wxWindow* tab_ctrl); - wxAuiTabCtrl* GetActiveTabCtrl(); - bool FindTab(wxWindow* page, wxAuiTabCtrl** ctrl, int* idx); - void RemoveEmptyTabFrames(); - void UpdateHintWindowSize(); - -protected: - - void OnChildFocus(wxChildFocusEvent& evt); - void OnRender(wxAuiManagerEvent& evt); - void OnSize(wxSizeEvent& evt); - void OnTabClicked(wxCommandEvent& evt); - void OnTabBeginDrag(wxCommandEvent& evt); - void OnTabDragMotion(wxCommandEvent& evt); - void OnTabEndDrag(wxCommandEvent& evt); - void OnTabButton(wxCommandEvent& evt); -#if wxABI_VERSION >= 20805 - void OnTabMiddleDown(wxCommandEvent& evt); - void OnTabMiddleUp(wxCommandEvent& evt); - void OnTabRightDown(wxCommandEvent& evt); - void OnTabRightUp(wxCommandEvent& evt); - void OnNavigationKey(wxNavigationKeyEvent& event); - void OnTabBgDClick(wxCommandEvent& evt); -#endif - -protected: - - wxAuiManager m_mgr; - wxAuiTabContainer m_tabs; - int m_curpage; - int m_tab_id_counter; - wxWindow* m_dummy_wnd; - - wxSize m_requested_bmp_size; - int m_requested_tabctrl_height; - wxFont m_selected_font; - wxFont m_normal_font; - int m_tab_ctrl_height; - - int m_last_drag_x; - unsigned int m_flags; - -#ifndef SWIG - DECLARE_CLASS(wxAuiNotebook) - DECLARE_EVENT_TABLE() -#endif -}; - - - - -// wx event machinery - -#ifndef SWIG - -BEGIN_DECLARE_EVENT_TYPES() - DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_AUI, wxEVT_COMMAND_AUINOTEBOOK_PAGE_CLOSE, 0) - DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_AUI, wxEVT_COMMAND_AUINOTEBOOK_PAGE_CHANGED, 0) - DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_AUI, wxEVT_COMMAND_AUINOTEBOOK_PAGE_CHANGING, 0) - DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_AUI, wxEVT_COMMAND_AUINOTEBOOK_BUTTON, 0) - DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_AUI, wxEVT_COMMAND_AUINOTEBOOK_BEGIN_DRAG, 0) - DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_AUI, wxEVT_COMMAND_AUINOTEBOOK_END_DRAG, 0) - DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_AUI, wxEVT_COMMAND_AUINOTEBOOK_DRAG_MOTION, 0) - DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_AUI, wxEVT_COMMAND_AUINOTEBOOK_ALLOW_DND, 0) -#if wxABI_VERSION >= 20805 - DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_AUI, wxEVT_COMMAND_AUINOTEBOOK_TAB_MIDDLE_DOWN, 0) - DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_AUI, wxEVT_COMMAND_AUINOTEBOOK_TAB_MIDDLE_UP, 0) - DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_AUI, wxEVT_COMMAND_AUINOTEBOOK_TAB_RIGHT_DOWN, 0) - DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_AUI, wxEVT_COMMAND_AUINOTEBOOK_TAB_RIGHT_UP, 0) - DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_AUI, wxEVT_COMMAND_AUINOTEBOOK_PAGE_CLOSED, 0) - DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_AUI, wxEVT_COMMAND_AUINOTEBOOK_DRAG_DONE, 0) - DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_AUI, wxEVT_COMMAND_AUINOTEBOOK_BG_DCLICK, 0) -#endif -END_DECLARE_EVENT_TYPES() - -typedef void (wxEvtHandler::*wxAuiNotebookEventFunction)(wxAuiNotebookEvent&); - -#define wxAuiNotebookEventHandler(func) \ - (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxAuiNotebookEventFunction, &func) - -#define EVT_AUINOTEBOOK_PAGE_CLOSE(winid, fn) \ - wx__DECLARE_EVT1(wxEVT_COMMAND_AUINOTEBOOK_PAGE_CLOSE, winid, wxAuiNotebookEventHandler(fn)) -#define EVT_AUINOTEBOOK_PAGE_CLOSED(winid, fn) \ - wx__DECLARE_EVT1(wxEVT_COMMAND_AUINOTEBOOK_PAGE_CLOSED, winid, wxAuiNotebookEventHandler(fn)) -#define EVT_AUINOTEBOOK_PAGE_CHANGED(winid, fn) \ - wx__DECLARE_EVT1(wxEVT_COMMAND_AUINOTEBOOK_PAGE_CHANGED, winid, wxAuiNotebookEventHandler(fn)) -#define EVT_AUINOTEBOOK_PAGE_CHANGING(winid, fn) \ - wx__DECLARE_EVT1(wxEVT_COMMAND_AUINOTEBOOK_PAGE_CHANGING, winid, wxAuiNotebookEventHandler(fn)) -#define EVT_AUINOTEBOOK_BUTTON(winid, fn) \ - wx__DECLARE_EVT1(wxEVT_COMMAND_AUINOTEBOOK_BUTTON, winid, wxAuiNotebookEventHandler(fn)) -#define EVT_AUINOTEBOOK_BEGIN_DRAG(winid, fn) \ - wx__DECLARE_EVT1(wxEVT_COMMAND_AUINOTEBOOK_BEGIN_DRAG, winid, wxAuiNotebookEventHandler(fn)) -#define EVT_AUINOTEBOOK_END_DRAG(winid, fn) \ - wx__DECLARE_EVT1(wxEVT_COMMAND_AUINOTEBOOK_END_DRAG, winid, wxAuiNotebookEventHandler(fn)) -#define EVT_AUINOTEBOOK_DRAG_MOTION(winid, fn) \ - wx__DECLARE_EVT1(wxEVT_COMMAND_AUINOTEBOOK_DRAG_MOTION, winid, wxAuiNotebookEventHandler(fn)) -#define EVT_AUINOTEBOOK_ALLOW_DND(winid, fn) \ - wx__DECLARE_EVT1(wxEVT_COMMAND_AUINOTEBOOK_ALLOW_DND, winid, wxAuiNotebookEventHandler(fn)) - -#if wxABI_VERSION >= 20805 -#define EVT_AUINOTEBOOK_TAB_MIDDLE_DOWN(winid, fn) \ - wx__DECLARE_EVT1(wxEVT_COMMAND_AUINOTEBOOK_TAB_MIDDLE_DOWN, winid, wxAuiNotebookEventHandler(fn)) -#define EVT_AUINOTEBOOK_TAB_MIDDLE_UP(winid, fn) \ - wx__DECLARE_EVT1(wxEVT_COMMAND_AUINOTEBOOK_TAB_MIDDLE_UP, winid, wxAuiNotebookEventHandler(fn)) -#define EVT_AUINOTEBOOK_TAB_RIGHT_DOWN(winid, fn) \ - wx__DECLARE_EVT1(wxEVT_COMMAND_AUINOTEBOOK_TAB_RIGHT_DOWN, winid, wxAuiNotebookEventHandler(fn)) -#define EVT_AUINOTEBOOK_TAB_RIGHT_UP(winid, fn) \ - wx__DECLARE_EVT1(wxEVT_COMMAND_AUINOTEBOOK_TAB_RIGHT_UP, winid, wxAuiNotebookEventHandler(fn)) -#define EVT_AUINOTEBOOK_DRAG_DONE(winid, fn) \ - wx__DECLARE_EVT1(wxEVT_COMMAND_AUINOTEBOOK_DRAG_DONE, winid, wxAuiNotebookEventHandler(fn)) -#define EVT_AUINOTEBOOK_BG_DCLICK(winid, fn) \ - wx__DECLARE_EVT1(wxEVT_COMMAND_AUINOTEBOOK_BG_DCLICK, winid, wxAuiNotebookEventHandler(fn)) -#endif - -#else - -// wxpython/swig event work -%constant wxEventType wxEVT_COMMAND_AUINOTEBOOK_PAGE_CLOSE; -%constant wxEventType wxEVT_COMMAND_AUINOTEBOOK_PAGE_CLOSED; -%constant wxEventType wxEVT_COMMAND_AUINOTEBOOK_PAGE_CHANGED; -%constant wxEventType wxEVT_COMMAND_AUINOTEBOOK_PAGE_CHANGING; -%constant wxEventType wxEVT_COMMAND_AUINOTEBOOK_BUTTON; -%constant wxEventType wxEVT_COMMAND_AUINOTEBOOK_BEGIN_DRAG; -%constant wxEventType wxEVT_COMMAND_AUINOTEBOOK_END_DRAG; -%constant wxEventType wxEVT_COMMAND_AUINOTEBOOK_DRAG_MOTION; -%constant wxEventType wxEVT_COMMAND_AUINOTEBOOK_ALLOW_DND; -%constant wxEventType wxEVT_COMMAND_AUINOTEBOOK_DRAG_DONE; -%constant wxEventType wxEVT_COMMAND_AUINOTEBOOK_BG_DCLICK; -%constant wxEventType wxEVT_COMMAND_AUINOTEBOOK_TAB_MIDDLE_DOWN; -%constant wxEventType wxEVT_COMMAND_AUINOTEBOOK_TAB_MIDDLE_UP; -%constant wxEventType wxEVT_COMMAND_AUINOTEBOOK_TAB_RIGHT_DOWN; -%constant wxEventType wxEVT_COMMAND_AUINOTEBOOK_TAB_RIGHT_UP; - -%pythoncode { - EVT_AUINOTEBOOK_PAGE_CLOSE = wx.PyEventBinder( wxEVT_COMMAND_AUINOTEBOOK_PAGE_CLOSE, 1 ) - EVT_AUINOTEBOOK_PAGE_CLOSED = wx.PyEventBinder( wxEVT_COMMAND_AUINOTEBOOK_PAGE_CLOSED, 1 ) - EVT_AUINOTEBOOK_PAGE_CHANGED = wx.PyEventBinder( wxEVT_COMMAND_AUINOTEBOOK_PAGE_CHANGED, 1 ) - EVT_AUINOTEBOOK_PAGE_CHANGING = wx.PyEventBinder( wxEVT_COMMAND_AUINOTEBOOK_PAGE_CHANGING, 1 ) - EVT_AUINOTEBOOK_BUTTON = wx.PyEventBinder( wxEVT_COMMAND_AUINOTEBOOK_BUTTON, 1 ) - EVT_AUINOTEBOOK_BEGIN_DRAG = wx.PyEventBinder( wxEVT_COMMAND_AUINOTEBOOK_BEGIN_DRAG, 1 ) - EVT_AUINOTEBOOK_END_DRAG = wx.PyEventBinder( wxEVT_COMMAND_AUINOTEBOOK_END_DRAG, 1 ) - EVT_AUINOTEBOOK_DRAG_MOTION = wx.PyEventBinder( wxEVT_COMMAND_AUINOTEBOOK_DRAG_MOTION, 1 ) - EVT_AUINOTEBOOK_ALLOW_DND = wx.PyEventBinder( wxEVT_COMMAND_AUINOTEBOOK_ALLOW_DND, 1 ) - EVT_AUINOTEBOOK_DRAG_DONE = wx.PyEventBinder( wxEVT_COMMAND_AUINOTEBOOK_DRAG_DONE, 1 ) - EVT_AUINOTEBOOK_BG_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_AUINOTEBOOK_BG_DCLICK, 1 ) - EVT_AUINOTEBOOK_TAB_MIDDLE_DOWN = wx.PyEventBinder( wxEVT_COMMAND_AUINOTEBOOK_TAB_MIDDLE_DOWN, 1 ) - EVT_AUINOTEBOOK_TAB_MIDDLE_UP = wx.PyEventBinder( wxEVT_COMMAND_AUINOTEBOOK_TAB_MIDDLE_UP , 1 ) - EVT_AUINOTEBOOK_TAB_RIGHT_DOWN = wx.PyEventBinder( wxEVT_COMMAND_AUINOTEBOOK_TAB_RIGHT_DOWN, 1 ) - EVT_AUINOTEBOOK_TAB_RIGHT_UP = wx.PyEventBinder( wxEVT_COMMAND_AUINOTEBOOK_TAB_RIGHT_UP, 1 ) -} -#endif - - -#endif // wxUSE_AUI -#endif // _WX_AUINOTEBOOK_H_ diff --git a/wxWidgets/include/wx/aui/dockart.h b/wxWidgets/include/wx/aui/dockart.h deleted file mode 100644 index 0c5bfe2a6a..0000000000 --- a/wxWidgets/include/wx/aui/dockart.h +++ /dev/null @@ -1,173 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: wx/aui/dockart.h -// Purpose: wxaui: wx advanced user interface - docking window manager -// Author: Benjamin I. Williams -// Modified by: -// Created: 2005-05-17 -// RCS-ID: $Id: dockart.h 43154 2006-11-07 10:29:02Z BIW $ -// Copyright: (C) Copyright 2005, Kirix Corporation, All Rights Reserved. -// Licence: wxWindows Library Licence, Version 3.1 -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_DOCKART_H_ -#define _WX_DOCKART_H_ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -#include "wx/defs.h" - -#if wxUSE_AUI - -#include "wx/pen.h" -#include "wx/brush.h" -#include "wx/bitmap.h" -#include "wx/colour.h" - -// dock art provider code - a dock provider provides all drawing -// functionality to the wxAui dock manager. This allows the dock -// manager to have plugable look-and-feels - -class WXDLLIMPEXP_AUI wxAuiDockArt -{ -public: - - wxAuiDockArt() { } - virtual ~wxAuiDockArt() { } - - virtual int GetMetric(int id) = 0; - virtual void SetMetric(int id, int new_val) = 0; - virtual void SetFont(int id, const wxFont& font) = 0; - virtual wxFont GetFont(int id) = 0; - virtual wxColour GetColour(int id) = 0; - virtual void SetColour(int id, const wxColor& colour) = 0; - wxColour GetColor(int id) { return GetColour(id); } - void SetColor(int id, const wxColour& color) { SetColour(id, color); } - - virtual void DrawSash(wxDC& dc, - wxWindow* window, - int orientation, - const wxRect& rect) = 0; - - virtual void DrawBackground(wxDC& dc, - wxWindow* window, - int orientation, - const wxRect& rect) = 0; - - virtual void DrawCaption(wxDC& dc, - wxWindow* window, - const wxString& text, - const wxRect& rect, - wxAuiPaneInfo& pane) = 0; - - virtual void DrawGripper(wxDC& dc, - wxWindow* window, - const wxRect& rect, - wxAuiPaneInfo& pane) = 0; - - virtual void DrawBorder(wxDC& dc, - wxWindow* window, - const wxRect& rect, - wxAuiPaneInfo& pane) = 0; - - virtual void DrawPaneButton(wxDC& dc, - wxWindow* window, - int button, - int button_state, - const wxRect& rect, - wxAuiPaneInfo& pane) = 0; -}; - - -// this is the default art provider for wxAuiManager. Dock art -// can be customized by creating a class derived from this one, -// or replacing this class entirely - -class WXDLLIMPEXP_AUI wxAuiDefaultDockArt : public wxAuiDockArt -{ -public: - - wxAuiDefaultDockArt(); - - int GetMetric(int metric_id); - void SetMetric(int metric_id, int new_val); - wxColour GetColour(int id); - void SetColour(int id, const wxColor& colour); - void SetFont(int id, const wxFont& font); - wxFont GetFont(int id); - - void DrawSash(wxDC& dc, - wxWindow *window, - int orientation, - const wxRect& rect); - - void DrawBackground(wxDC& dc, - wxWindow *window, - int orientation, - const wxRect& rect); - - void DrawCaption(wxDC& dc, - wxWindow *window, - const wxString& text, - const wxRect& rect, - wxAuiPaneInfo& pane); - - void DrawGripper(wxDC& dc, - wxWindow *window, - const wxRect& rect, - wxAuiPaneInfo& pane); - - void DrawBorder(wxDC& dc, - wxWindow *window, - const wxRect& rect, - wxAuiPaneInfo& pane); - - void DrawPaneButton(wxDC& dc, - wxWindow *window, - int button, - int button_state, - const wxRect& rect, - wxAuiPaneInfo& pane); - -protected: - - void DrawCaptionBackground(wxDC& dc, const wxRect& rect, bool active); - -protected: - - wxPen m_border_pen; - wxBrush m_sash_brush; - wxBrush m_background_brush; - wxBrush m_gripper_brush; - wxFont m_caption_font; - wxBitmap m_inactive_close_bitmap; - wxBitmap m_inactive_pin_bitmap; - wxBitmap m_inactive_maximize_bitmap; - wxBitmap m_inactive_restore_bitmap; - wxBitmap m_active_close_bitmap; - wxBitmap m_active_pin_bitmap; - wxBitmap m_active_maximize_bitmap; - wxBitmap m_active_restore_bitmap; - wxPen m_gripper_pen1; - wxPen m_gripper_pen2; - wxPen m_gripper_pen3; - wxColour m_base_colour; - wxColour m_active_caption_colour; - wxColour m_active_caption_gradient_colour; - wxColour m_active_caption_text_colour; - wxColour m_inactive_caption_colour; - wxColour m_inactive_caption_gradient_colour; - wxColour m_inactive_caption_text_colour; - int m_border_size; - int m_caption_size; - int m_sash_size; - int m_button_size; - int m_gripper_size; - int m_gradient_type; -}; - - - -#endif // wxUSE_AUI -#endif //_WX_DOCKART_H_ diff --git a/wxWidgets/include/wx/aui/floatpane.h b/wxWidgets/include/wx/aui/floatpane.h deleted file mode 100644 index 7529594771..0000000000 --- a/wxWidgets/include/wx/aui/floatpane.h +++ /dev/null @@ -1,81 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: wx/aui/floatpane.h -// Purpose: wxaui: wx advanced user interface - docking window manager -// Author: Benjamin I. Williams -// Modified by: -// Created: 2005-05-17 -// RCS-ID: $Id: floatpane.h 43467 2006-11-17 13:07:01Z BIW $ -// Copyright: (C) Copyright 2005, Kirix Corporation, All Rights Reserved. -// Licence: wxWindows Library Licence, Version 3.1 -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_FLOATPANE_H_ -#define _WX_FLOATPANE_H_ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -#include "wx/defs.h" - -#if wxUSE_AUI - -#include "wx/frame.h" - -#if defined( __WXMSW__ ) || defined( __WXMAC__ ) || defined( __WXGTK__ ) -#include "wx/minifram.h" -#define wxAuiFloatingFrameBaseClass wxMiniFrame -#else -#define wxAuiFloatingFrameBaseClass wxFrame -#endif - -class WXDLLIMPEXP_AUI wxAuiFloatingFrame : public wxAuiFloatingFrameBaseClass -{ -public: - wxAuiFloatingFrame(wxWindow* parent, - wxAuiManager* owner_mgr, - const wxAuiPaneInfo& pane, - wxWindowID id = wxID_ANY, - long style = wxRESIZE_BORDER | wxSYSTEM_MENU | wxCAPTION | - wxFRAME_NO_TASKBAR | wxFRAME_FLOAT_ON_PARENT | - wxCLIP_CHILDREN - ); - virtual ~wxAuiFloatingFrame(); - void SetPaneWindow(const wxAuiPaneInfo& pane); - wxAuiManager* GetOwnerManager() const; - -protected: - virtual void OnMoveStart(); - virtual void OnMoving(const wxRect& window_rect, wxDirection dir); - virtual void OnMoveFinished(); - -private: - void OnSize(wxSizeEvent& event); - void OnClose(wxCloseEvent& event); - void OnMoveEvent(wxMoveEvent& event); - void OnIdle(wxIdleEvent& event); - void OnActivate(wxActivateEvent& event); - static bool isMouseDown(); - -private: - wxWindow* m_pane_window; // pane window being managed - bool m_solid_drag; // true if system uses solid window drag - bool m_moving; - wxRect m_last_rect; - wxRect m_last2_rect; - wxRect m_last3_rect; - wxSize m_last_size; - wxDirection m_lastDirection; - - wxAuiManager* m_owner_mgr; - wxAuiManager m_mgr; - -#ifndef SWIG - DECLARE_EVENT_TABLE() - DECLARE_CLASS(wxAuiFloatingFrame) -#endif // SWIG -}; - -#endif // wxUSE_AUI -#endif //_WX_FLOATPANE_H_ - diff --git a/wxWidgets/include/wx/aui/framemanager.h b/wxWidgets/include/wx/aui/framemanager.h deleted file mode 100644 index c267ad233b..0000000000 --- a/wxWidgets/include/wx/aui/framemanager.h +++ /dev/null @@ -1,856 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: wx/aui/framemanager.h -// Purpose: wxaui: wx advanced user interface - docking window manager -// Author: Benjamin I. Williams -// Modified by: -// Created: 2005-05-17 -// RCS-ID: $Id: framemanager.h 57885 2009-01-07 14:51:49Z JS $ -// Copyright: (C) Copyright 2005, Kirix Corporation, All Rights Reserved. -// Licence: wxWindows Library Licence, Version 3.1 -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_FRAMEMANAGER_H_ -#define _WX_FRAMEMANAGER_H_ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -#include "wx/defs.h" - -#if wxUSE_AUI - -#include "wx/dynarray.h" -#include "wx/gdicmn.h" -#include "wx/window.h" -#include "wx/timer.h" -#include "wx/sizer.h" - -enum wxAuiManagerDock -{ - wxAUI_DOCK_NONE = 0, - wxAUI_DOCK_TOP = 1, - wxAUI_DOCK_RIGHT = 2, - wxAUI_DOCK_BOTTOM = 3, - wxAUI_DOCK_LEFT = 4, - wxAUI_DOCK_CENTER = 5, - wxAUI_DOCK_CENTRE = wxAUI_DOCK_CENTER -}; - -enum wxAuiManagerOption -{ - wxAUI_MGR_ALLOW_FLOATING = 1 << 0, - wxAUI_MGR_ALLOW_ACTIVE_PANE = 1 << 1, - wxAUI_MGR_TRANSPARENT_DRAG = 1 << 2, - wxAUI_MGR_TRANSPARENT_HINT = 1 << 3, - wxAUI_MGR_VENETIAN_BLINDS_HINT = 1 << 4, - wxAUI_MGR_RECTANGLE_HINT = 1 << 5, - wxAUI_MGR_HINT_FADE = 1 << 6, - wxAUI_MGR_NO_VENETIAN_BLINDS_FADE = 1 << 7, - wxAUI_MGR_LIVE_RESIZE = 1 << 8, - - wxAUI_MGR_DEFAULT = wxAUI_MGR_ALLOW_FLOATING | - wxAUI_MGR_TRANSPARENT_HINT | - wxAUI_MGR_HINT_FADE | - wxAUI_MGR_NO_VENETIAN_BLINDS_FADE -}; - - -enum wxAuiPaneDockArtSetting -{ - wxAUI_DOCKART_SASH_SIZE = 0, - wxAUI_DOCKART_CAPTION_SIZE = 1, - wxAUI_DOCKART_GRIPPER_SIZE = 2, - wxAUI_DOCKART_PANE_BORDER_SIZE = 3, - wxAUI_DOCKART_PANE_BUTTON_SIZE = 4, - wxAUI_DOCKART_BACKGROUND_COLOUR = 5, - wxAUI_DOCKART_SASH_COLOUR = 6, - wxAUI_DOCKART_ACTIVE_CAPTION_COLOUR = 7, - wxAUI_DOCKART_ACTIVE_CAPTION_GRADIENT_COLOUR = 8, - wxAUI_DOCKART_INACTIVE_CAPTION_COLOUR = 9, - wxAUI_DOCKART_INACTIVE_CAPTION_GRADIENT_COLOUR = 10, - wxAUI_DOCKART_ACTIVE_CAPTION_TEXT_COLOUR = 11, - wxAUI_DOCKART_INACTIVE_CAPTION_TEXT_COLOUR = 12, - wxAUI_DOCKART_BORDER_COLOUR = 13, - wxAUI_DOCKART_GRIPPER_COLOUR = 14, - wxAUI_DOCKART_CAPTION_FONT = 15, - wxAUI_DOCKART_GRADIENT_TYPE = 16 -}; - -enum wxAuiPaneDockArtGradients -{ - wxAUI_GRADIENT_NONE = 0, - wxAUI_GRADIENT_VERTICAL = 1, - wxAUI_GRADIENT_HORIZONTAL = 2 -}; - -enum wxAuiPaneButtonState -{ - wxAUI_BUTTON_STATE_NORMAL = 0, - wxAUI_BUTTON_STATE_HOVER = 1 << 1, - wxAUI_BUTTON_STATE_PRESSED = 1 << 2, - wxAUI_BUTTON_STATE_DISABLED = 1 << 3, - wxAUI_BUTTON_STATE_HIDDEN = 1 << 4, - wxAUI_BUTTON_STATE_CHECKED = 1 << 5 -}; - -enum wxAuiButtonId -{ - wxAUI_BUTTON_CLOSE = 101, - wxAUI_BUTTON_MAXIMIZE_RESTORE = 102, - wxAUI_BUTTON_MINIMIZE = 103, - wxAUI_BUTTON_PIN = 104, - wxAUI_BUTTON_OPTIONS = 105, - wxAUI_BUTTON_WINDOWLIST = 106, - wxAUI_BUTTON_LEFT = 107, - wxAUI_BUTTON_RIGHT = 108, - wxAUI_BUTTON_UP = 109, - wxAUI_BUTTON_DOWN = 110, - wxAUI_BUTTON_CUSTOM1 = 201, - wxAUI_BUTTON_CUSTOM2 = 202, - wxAUI_BUTTON_CUSTOM3 = 203 -}; - -enum wxAuiPaneInsertLevel -{ - wxAUI_INSERT_PANE = 0, - wxAUI_INSERT_ROW = 1, - wxAUI_INSERT_DOCK = 2 -}; - - - - -// forwards and array declarations -class wxAuiDockUIPart; -class wxAuiPaneButton; -class wxAuiPaneInfo; -class wxAuiDockInfo; -class wxAuiDockArt; -class wxAuiManagerEvent; - -#ifndef SWIG -WX_DECLARE_USER_EXPORTED_OBJARRAY(wxAuiDockInfo, wxAuiDockInfoArray, WXDLLIMPEXP_AUI); -WX_DECLARE_USER_EXPORTED_OBJARRAY(wxAuiDockUIPart, wxAuiDockUIPartArray, WXDLLIMPEXP_AUI); -WX_DECLARE_USER_EXPORTED_OBJARRAY(wxAuiPaneButton, wxAuiPaneButtonArray, WXDLLIMPEXP_AUI); -WX_DECLARE_USER_EXPORTED_OBJARRAY(wxAuiPaneInfo, wxAuiPaneInfoArray, WXDLLIMPEXP_AUI); -WX_DEFINE_USER_EXPORTED_ARRAY_PTR(wxAuiPaneInfo*, wxAuiPaneInfoPtrArray, class WXDLLIMPEXP_AUI); -WX_DEFINE_USER_EXPORTED_ARRAY_PTR(wxAuiDockInfo*, wxAuiDockInfoPtrArray, class WXDLLIMPEXP_AUI); -#endif // SWIG - -extern WXDLLIMPEXP_AUI wxAuiDockInfo wxAuiNullDockInfo; -extern WXDLLIMPEXP_AUI wxAuiPaneInfo wxAuiNullPaneInfo; - - - -class WXDLLIMPEXP_AUI wxAuiPaneInfo -{ -public: - - wxAuiPaneInfo() - { - window = NULL; - frame = NULL; - state = 0; - dock_direction = wxAUI_DOCK_LEFT; - dock_layer = 0; - dock_row = 0; - dock_pos = 0; - floating_pos = wxDefaultPosition; - floating_size = wxDefaultSize; - best_size = wxDefaultSize; - min_size = wxDefaultSize; - max_size = wxDefaultSize; - dock_proportion = 0; - - DefaultPane(); - } - - ~wxAuiPaneInfo() {} - -#ifndef SWIG - wxAuiPaneInfo(const wxAuiPaneInfo& c) - { - name = c.name; - caption = c.caption; - window = c.window; - frame = c.frame; - state = c.state; - dock_direction = c.dock_direction; - dock_layer = c.dock_layer; - dock_row = c.dock_row; - dock_pos = c.dock_pos; - best_size = c.best_size; - min_size = c.min_size; - max_size = c.max_size; - floating_pos = c.floating_pos; - floating_size = c.floating_size; - dock_proportion = c.dock_proportion; - buttons = c.buttons; - rect = c.rect; - } - - wxAuiPaneInfo& operator=(const wxAuiPaneInfo& c) - { - name = c.name; - caption = c.caption; - window = c.window; - frame = c.frame; - state = c.state; - dock_direction = c.dock_direction; - dock_layer = c.dock_layer; - dock_row = c.dock_row; - dock_pos = c.dock_pos; - best_size = c.best_size; - min_size = c.min_size; - max_size = c.max_size; - floating_pos = c.floating_pos; - floating_size = c.floating_size; - dock_proportion = c.dock_proportion; - buttons = c.buttons; - rect = c.rect; - return *this; - } -#endif // SWIG - - // Write the safe parts of a newly loaded PaneInfo structure "source" into "this" - // used on loading perspectives etc. - void SafeSet(wxAuiPaneInfo source) - { - // note source is not passed by reference so we can overwrite, to keep the - // unsafe bits of "dest" - source.window = window; - source.frame = frame; - source.buttons = buttons; - // now assign - *this = source; - } - - bool IsOk() const { return (window != NULL) ? true : false; } - bool IsFixed() const { return !HasFlag(optionResizable); } - bool IsResizable() const { return HasFlag(optionResizable); } - bool IsShown() const { return !HasFlag(optionHidden); } - bool IsFloating() const { return HasFlag(optionFloating); } - bool IsDocked() const { return !HasFlag(optionFloating); } - bool IsToolbar() const { return HasFlag(optionToolbar); } - bool IsTopDockable() const { return HasFlag(optionTopDockable); } - bool IsBottomDockable() const { return HasFlag(optionBottomDockable); } - bool IsLeftDockable() const { return HasFlag(optionLeftDockable); } - bool IsRightDockable() const { return HasFlag(optionRightDockable); } - bool IsFloatable() const { return HasFlag(optionFloatable); } - bool IsMovable() const { return HasFlag(optionMovable); } - bool IsDestroyOnClose() const { return HasFlag(optionDestroyOnClose); } - bool IsMaximized() const { return HasFlag(optionMaximized); } - bool HasCaption() const { return HasFlag(optionCaption); } - bool HasGripper() const { return HasFlag(optionGripper); } - bool HasBorder() const { return HasFlag(optionPaneBorder); } - bool HasCloseButton() const { return HasFlag(buttonClose); } - bool HasMaximizeButton() const { return HasFlag(buttonMaximize); } - bool HasMinimizeButton() const { return HasFlag(buttonMinimize); } - bool HasPinButton() const { return HasFlag(buttonPin); } - bool HasGripperTop() const { return HasFlag(optionGripperTop); } - -#ifdef SWIG - %typemap(out) wxAuiPaneInfo& { $result = $self; Py_INCREF($result); } -#endif - wxAuiPaneInfo& Window(wxWindow* w) { window = w; return *this; } - wxAuiPaneInfo& Name(const wxString& n) { name = n; return *this; } - wxAuiPaneInfo& Caption(const wxString& c) { caption = c; return *this; } - wxAuiPaneInfo& Left() { dock_direction = wxAUI_DOCK_LEFT; return *this; } - wxAuiPaneInfo& Right() { dock_direction = wxAUI_DOCK_RIGHT; return *this; } - wxAuiPaneInfo& Top() { dock_direction = wxAUI_DOCK_TOP; return *this; } - wxAuiPaneInfo& Bottom() { dock_direction = wxAUI_DOCK_BOTTOM; return *this; } - wxAuiPaneInfo& Center() { dock_direction = wxAUI_DOCK_CENTER; return *this; } - wxAuiPaneInfo& Centre() { dock_direction = wxAUI_DOCK_CENTRE; return *this; } - wxAuiPaneInfo& Direction(int direction) { dock_direction = direction; return *this; } - wxAuiPaneInfo& Layer(int layer) { dock_layer = layer; return *this; } - wxAuiPaneInfo& Row(int row) { dock_row = row; return *this; } - wxAuiPaneInfo& Position(int pos) { dock_pos = pos; return *this; } - wxAuiPaneInfo& BestSize(const wxSize& size) { best_size = size; return *this; } - wxAuiPaneInfo& MinSize(const wxSize& size) { min_size = size; return *this; } - wxAuiPaneInfo& MaxSize(const wxSize& size) { max_size = size; return *this; } - wxAuiPaneInfo& BestSize(int x, int y) { best_size.Set(x,y); return *this; } - wxAuiPaneInfo& MinSize(int x, int y) { min_size.Set(x,y); return *this; } - wxAuiPaneInfo& MaxSize(int x, int y) { max_size.Set(x,y); return *this; } - wxAuiPaneInfo& FloatingPosition(const wxPoint& pos) { floating_pos = pos; return *this; } - wxAuiPaneInfo& FloatingPosition(int x, int y) { floating_pos.x = x; floating_pos.y = y; return *this; } - wxAuiPaneInfo& FloatingSize(const wxSize& size) { floating_size = size; return *this; } - wxAuiPaneInfo& FloatingSize(int x, int y) { floating_size.Set(x,y); return *this; } - wxAuiPaneInfo& Fixed() { return SetFlag(optionResizable, false); } - wxAuiPaneInfo& Resizable(bool resizable = true) { return SetFlag(optionResizable, resizable); } - wxAuiPaneInfo& Dock() { return SetFlag(optionFloating, false); } - wxAuiPaneInfo& Float() { return SetFlag(optionFloating, true); } - wxAuiPaneInfo& Hide() { return SetFlag(optionHidden, true); } - wxAuiPaneInfo& Show(bool show = true) { return SetFlag(optionHidden, !show); } - wxAuiPaneInfo& CaptionVisible(bool visible = true) { return SetFlag(optionCaption, visible); } - wxAuiPaneInfo& Maximize() { return SetFlag(optionMaximized, true); } - wxAuiPaneInfo& Restore() { return SetFlag(optionMaximized, false); } - wxAuiPaneInfo& PaneBorder(bool visible = true) { return SetFlag(optionPaneBorder, visible); } - wxAuiPaneInfo& Gripper(bool visible = true) { return SetFlag(optionGripper, visible); } - wxAuiPaneInfo& GripperTop(bool attop = true) { return SetFlag(optionGripperTop, attop); } - wxAuiPaneInfo& CloseButton(bool visible = true) { return SetFlag(buttonClose, visible); } - wxAuiPaneInfo& MaximizeButton(bool visible = true) { return SetFlag(buttonMaximize, visible); } - wxAuiPaneInfo& MinimizeButton(bool visible = true) { return SetFlag(buttonMinimize, visible); } - wxAuiPaneInfo& PinButton(bool visible = true) { return SetFlag(buttonPin, visible); } - wxAuiPaneInfo& DestroyOnClose(bool b = true) { return SetFlag(optionDestroyOnClose, b); } - wxAuiPaneInfo& TopDockable(bool b = true) { return SetFlag(optionTopDockable, b); } - wxAuiPaneInfo& BottomDockable(bool b = true) { return SetFlag(optionBottomDockable, b); } - wxAuiPaneInfo& LeftDockable(bool b = true) { return SetFlag(optionLeftDockable, b); } - wxAuiPaneInfo& RightDockable(bool b = true) { return SetFlag(optionRightDockable, b); } - wxAuiPaneInfo& Floatable(bool b = true) { return SetFlag(optionFloatable, b); } - wxAuiPaneInfo& Movable(bool b = true) { return SetFlag(optionMovable, b); } -#if wxABI_VERSION >= 20807 - wxAuiPaneInfo& DockFixed(bool b = true) { return SetFlag(optionDockFixed, b); } -#endif - - wxAuiPaneInfo& Dockable(bool b = true) - { - return TopDockable(b).BottomDockable(b).LeftDockable(b).RightDockable(b); - } - - wxAuiPaneInfo& DefaultPane() - { - state |= optionTopDockable | optionBottomDockable | - optionLeftDockable | optionRightDockable | - optionFloatable | optionMovable | optionResizable | - optionCaption | optionPaneBorder | buttonClose; - return *this; - } - - wxAuiPaneInfo& CentrePane() { return CenterPane(); } - wxAuiPaneInfo& CenterPane() - { - state = 0; - return Center().PaneBorder().Resizable(); - } - - wxAuiPaneInfo& ToolbarPane() - { - DefaultPane(); - state |= (optionToolbar | optionGripper); - state &= ~(optionResizable | optionCaption); - if (dock_layer == 0) - dock_layer = 10; - return *this; - } - - wxAuiPaneInfo& SetFlag(unsigned int flag, bool option_state) - { - if (option_state) - state |= flag; - else - state &= ~flag; - return *this; - } - - bool HasFlag(unsigned int flag) const - { - return (state & flag) ? true:false; - } - -#ifdef SWIG - %typemap(out) wxAuiPaneInfo& ; -#endif - -public: - - // NOTE: You can add and subtract flags from this list, - // but do not change the values of the flags, because - // they are stored in a binary integer format in the - // perspective string. If you really need to change the - // values around, you'll have to ensure backwards-compatibility - // in the perspective loading code. - enum wxAuiPaneState - { - optionFloating = 1 << 0, - optionHidden = 1 << 1, - optionLeftDockable = 1 << 2, - optionRightDockable = 1 << 3, - optionTopDockable = 1 << 4, - optionBottomDockable = 1 << 5, - optionFloatable = 1 << 6, - optionMovable = 1 << 7, - optionResizable = 1 << 8, - optionPaneBorder = 1 << 9, - optionCaption = 1 << 10, - optionGripper = 1 << 11, - optionDestroyOnClose = 1 << 12, - optionToolbar = 1 << 13, - optionActive = 1 << 14, - optionGripperTop = 1 << 15, - optionMaximized = 1 << 16, - optionDockFixed = 1 << 17, - - buttonClose = 1 << 21, - buttonMaximize = 1 << 22, - buttonMinimize = 1 << 23, - buttonPin = 1 << 24, - - buttonCustom1 = 1 << 26, - buttonCustom2 = 1 << 27, - buttonCustom3 = 1 << 28, - - savedHiddenState = 1 << 30, // used internally - actionPane = 1 << 31 // used internally - }; - -public: - wxString name; // name of the pane - wxString caption; // caption displayed on the window - - wxWindow* window; // window that is in this pane - wxFrame* frame; // floating frame window that holds the pane - unsigned int state; // a combination of wxPaneState values - - int dock_direction; // dock direction (top, bottom, left, right, center) - int dock_layer; // layer number (0 = innermost layer) - int dock_row; // row number on the docking bar (0 = first row) - int dock_pos; // position inside the row (0 = first position) - - wxSize best_size; // size that the layout engine will prefer - wxSize min_size; // minimum size the pane window can tolerate - wxSize max_size; // maximum size the pane window can tolerate - - wxPoint floating_pos; // position while floating - wxSize floating_size; // size while floating - int dock_proportion; // proportion while docked - - wxAuiPaneButtonArray buttons; // buttons on the pane - - wxRect rect; // current rectangle (populated by wxAUI) -}; - - - -class WXDLLIMPEXP_FWD_AUI wxAuiFloatingFrame; - -class WXDLLIMPEXP_AUI wxAuiManager : public wxEvtHandler -{ -friend class wxAuiFloatingFrame; - -public: - - wxAuiManager(wxWindow* managed_wnd = NULL, - unsigned int flags = wxAUI_MGR_DEFAULT); - virtual ~wxAuiManager(); - void UnInit(); - - void SetFlags(unsigned int flags); - unsigned int GetFlags() const; - - void SetManagedWindow(wxWindow* managed_wnd); - wxWindow* GetManagedWindow() const; - - static wxAuiManager* GetManager(wxWindow* window); - - void SetArtProvider(wxAuiDockArt* art_provider); - wxAuiDockArt* GetArtProvider() const; - - wxAuiPaneInfo& GetPane(wxWindow* window); - wxAuiPaneInfo& GetPane(const wxString& name); - wxAuiPaneInfoArray& GetAllPanes(); - - bool AddPane(wxWindow* window, - const wxAuiPaneInfo& pane_info); - - bool AddPane(wxWindow* window, - const wxAuiPaneInfo& pane_info, - const wxPoint& drop_pos); - - bool AddPane(wxWindow* window, - int direction = wxLEFT, - const wxString& caption = wxEmptyString); - - bool InsertPane(wxWindow* window, - const wxAuiPaneInfo& insert_location, - int insert_level = wxAUI_INSERT_PANE); - - bool DetachPane(wxWindow* window); - - void Update(); - - wxString SavePaneInfo(wxAuiPaneInfo& pane); - void LoadPaneInfo(wxString pane_part, wxAuiPaneInfo &pane); - wxString SavePerspective(); - bool LoadPerspective(const wxString& perspective, bool update = true); - - void SetDockSizeConstraint(double width_pct, double height_pct); - void GetDockSizeConstraint(double* width_pct, double* height_pct) const; - - void ClosePane(wxAuiPaneInfo& pane_info); - void MaximizePane(wxAuiPaneInfo& pane_info); - void RestorePane(wxAuiPaneInfo& pane_info); - void RestoreMaximizedPane(); - -public: - - virtual wxAuiFloatingFrame* CreateFloatingFrame(wxWindow* parent, const wxAuiPaneInfo& p); - - void StartPaneDrag( - wxWindow* pane_window, - const wxPoint& offset); - - wxRect CalculateHintRect( - wxWindow* pane_window, - const wxPoint& pt, - const wxPoint& offset); - - void DrawHintRect( - wxWindow* pane_window, - const wxPoint& pt, - const wxPoint& offset); - - virtual void ShowHint(const wxRect& rect); - virtual void HideHint(); - -public: - - // deprecated -- please use SetManagedWindow() and - // and GetManagedWindow() instead - - wxDEPRECATED( void SetFrame(wxFrame* frame) ); - wxDEPRECATED( wxFrame* GetFrame() const ); - -protected: - - void UpdateHintWindowConfig(); - - void DoFrameLayout(); - - void LayoutAddPane(wxSizer* container, - wxAuiDockInfo& dock, - wxAuiPaneInfo& pane, - wxAuiDockUIPartArray& uiparts, - bool spacer_only); - - void LayoutAddDock(wxSizer* container, - wxAuiDockInfo& dock, - wxAuiDockUIPartArray& uiparts, - bool spacer_only); - - wxSizer* LayoutAll(wxAuiPaneInfoArray& panes, - wxAuiDockInfoArray& docks, - wxAuiDockUIPartArray& uiparts, - bool spacer_only = false); - - virtual bool ProcessDockResult(wxAuiPaneInfo& target, - const wxAuiPaneInfo& new_pos); - - bool DoDrop(wxAuiDockInfoArray& docks, - wxAuiPaneInfoArray& panes, - wxAuiPaneInfo& drop, - const wxPoint& pt, - const wxPoint& action_offset = wxPoint(0,0)); - - wxAuiDockUIPart* HitTest(int x, int y); - wxAuiDockUIPart* GetPanePart(wxWindow* pane); - int GetDockPixelOffset(wxAuiPaneInfo& test); - void OnFloatingPaneMoveStart(wxWindow* window); - void OnFloatingPaneMoving(wxWindow* window, wxDirection dir ); - void OnFloatingPaneMoved(wxWindow* window, wxDirection dir); - void OnFloatingPaneActivated(wxWindow* window); - void OnFloatingPaneClosed(wxWindow* window, wxCloseEvent& evt); - void OnFloatingPaneResized(wxWindow* window, const wxSize& size); - void Render(wxDC* dc); - void Repaint(wxDC* dc = NULL); - void ProcessMgrEvent(wxAuiManagerEvent& event); - void UpdateButtonOnScreen(wxAuiDockUIPart* button_ui_part, - const wxMouseEvent& event); - void GetPanePositionsAndSizes(wxAuiDockInfo& dock, - wxArrayInt& positions, - wxArrayInt& sizes); - -#if wxABI_VERSION >= 20810 - /// Ends a resize action, or for live update, resizes the sash - bool DoEndResizeAction(wxMouseEvent& event); -#endif - -public: - - // public events (which can be invoked externally) - void OnRender(wxAuiManagerEvent& evt); - void OnPaneButton(wxAuiManagerEvent& evt); - -protected: - - // protected events - void OnPaint(wxPaintEvent& evt); - void OnEraseBackground(wxEraseEvent& evt); - void OnSize(wxSizeEvent& evt); - void OnSetCursor(wxSetCursorEvent& evt); - void OnLeftDown(wxMouseEvent& evt); - void OnLeftUp(wxMouseEvent& evt); - void OnMotion(wxMouseEvent& evt); - void OnLeaveWindow(wxMouseEvent& evt); - void OnChildFocus(wxChildFocusEvent& evt); - void OnHintFadeTimer(wxTimerEvent& evt); - void OnFindManager(wxAuiManagerEvent& evt); - -protected: - - enum - { - actionNone = 0, - actionResize, - actionClickButton, - actionClickCaption, - actionDragToolbarPane, - actionDragFloatingPane - }; - -protected: - - wxWindow* m_frame; // the window being managed - wxAuiDockArt* m_art; // dock art object which does all drawing - unsigned int m_flags; // manager flags wxAUI_MGR_* - - wxAuiPaneInfoArray m_panes; // array of panes structures - wxAuiDockInfoArray m_docks; // array of docks structures - wxAuiDockUIPartArray m_uiparts; // array of UI parts (captions, buttons, etc) - - int m_action; // current mouse action - wxPoint m_action_start; // position where the action click started - wxPoint m_action_offset; // offset from upper left of the item clicked - wxAuiDockUIPart* m_action_part; // ptr to the part the action happened to - wxWindow* m_action_window; // action frame or window (NULL if none) - wxRect m_action_hintrect; // hint rectangle for the action - wxRect m_last_rect; - wxAuiDockUIPart* m_hover_button;// button uipart being hovered over - wxRect m_last_hint; // last hint rectangle - wxPoint m_last_mouse_move; // last mouse move position (see OnMotion) - bool m_skipping; - bool m_has_maximized; - - double m_dock_constraint_x; // 0.0 .. 1.0; max pct of window width a dock can consume - double m_dock_constraint_y; // 0.0 .. 1.0; max pct of window height a dock can consume - - wxFrame* m_hint_wnd; // transparent hint window, if supported by platform - wxTimer m_hint_fadetimer; // transparent fade timer - wxByte m_hint_fadeamt; // transparent fade amount - wxByte m_hint_fademax; // maximum value of hint fade - - void* m_reserved; - -#ifndef SWIG - DECLARE_EVENT_TABLE() - DECLARE_CLASS(wxAuiManager) -#endif // SWIG -}; - - - -// event declarations/classes - -class WXDLLIMPEXP_AUI wxAuiManagerEvent : public wxEvent -{ -public: - wxAuiManagerEvent(wxEventType type=wxEVT_NULL) : wxEvent(0, type) - { - manager = NULL; - pane = NULL; - button = 0; - veto_flag = false; - canveto_flag = true; - dc = NULL; - } -#ifndef SWIG - wxAuiManagerEvent(const wxAuiManagerEvent& c) : wxEvent(c) - { - manager = c.manager; - pane = c.pane; - button = c.button; - veto_flag = c.veto_flag; - canveto_flag = c.canveto_flag; - dc = c.dc; - } -#endif - wxEvent *Clone() const { return new wxAuiManagerEvent(*this); } - - void SetManager(wxAuiManager* mgr) { manager = mgr; } - void SetPane(wxAuiPaneInfo* p) { pane = p; } - void SetButton(int b) { button = b; } - void SetDC(wxDC* pdc) { dc = pdc; } - - wxAuiManager* GetManager() const { return manager; } - wxAuiPaneInfo* GetPane() const { return pane; } - int GetButton() const { return button; } - wxDC* GetDC() const { return dc; } - - void Veto(bool veto = true) { veto_flag = veto; } - bool GetVeto() const { return veto_flag; } - void SetCanVeto(bool can_veto) { canveto_flag = can_veto; } - bool CanVeto() const { return canveto_flag && veto_flag; } - -public: - wxAuiManager* manager; - wxAuiPaneInfo* pane; - int button; - bool veto_flag; - bool canveto_flag; - wxDC* dc; - -#ifndef SWIG -private: - DECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxAuiManagerEvent) -#endif -}; - - -class WXDLLIMPEXP_AUI wxAuiDockInfo -{ -public: - wxAuiDockInfo() - { - dock_direction = 0; - dock_layer = 0; - dock_row = 0; - size = 0; - min_size = 0; - resizable = true; - fixed = false; - toolbar = false; - reserved1 = false; - } - -#ifndef SWIG - wxAuiDockInfo(const wxAuiDockInfo& c) - { - dock_direction = c.dock_direction; - dock_layer = c.dock_layer; - dock_row = c.dock_row; - size = c.size; - min_size = c.min_size; - resizable = c.resizable; - fixed = c.fixed; - toolbar = c.toolbar; - panes = c.panes; - rect = c.rect; - reserved1 = c.reserved1; - } - - wxAuiDockInfo& operator=(const wxAuiDockInfo& c) - { - dock_direction = c.dock_direction; - dock_layer = c.dock_layer; - dock_row = c.dock_row; - size = c.size; - min_size = c.min_size; - resizable = c.resizable; - fixed = c.fixed; - toolbar = c.toolbar; - panes = c.panes; - rect = c.rect; - reserved1 = c.reserved1; - return *this; - } -#endif // SWIG - - bool IsOk() const { return (dock_direction != 0) ? true : false; } - bool IsHorizontal() const { return (dock_direction == wxAUI_DOCK_TOP || - dock_direction == wxAUI_DOCK_BOTTOM) ? true:false; } - bool IsVertical() const { return (dock_direction == wxAUI_DOCK_LEFT || - dock_direction == wxAUI_DOCK_RIGHT || - dock_direction == wxAUI_DOCK_CENTER) ? true:false; } -public: - wxAuiPaneInfoPtrArray panes; // array of panes - wxRect rect; // current rectangle - int dock_direction; // dock direction (top, bottom, left, right, center) - int dock_layer; // layer number (0 = innermost layer) - int dock_row; // row number on the docking bar (0 = first row) - int size; // size of the dock - int min_size; // minimum size of a dock (0 if there is no min) - bool resizable; // flag indicating whether the dock is resizable - bool toolbar; // flag indicating dock contains only toolbars - bool fixed; // flag indicating that the dock operates on - // absolute coordinates as opposed to proportional - bool reserved1; -}; - - -class WXDLLIMPEXP_AUI wxAuiDockUIPart -{ -public: - enum - { - typeCaption, - typeGripper, - typeDock, - typeDockSizer, - typePane, - typePaneSizer, - typeBackground, - typePaneBorder, - typePaneButton - }; - - int type; // ui part type (see enum above) - int orientation; // orientation (either wxHORIZONTAL or wxVERTICAL) - wxAuiDockInfo* dock; // which dock the item is associated with - wxAuiPaneInfo* pane; // which pane the item is associated with - wxAuiPaneButton* button; // which pane button the item is associated with - wxSizer* cont_sizer; // the part's containing sizer - wxSizerItem* sizer_item; // the sizer item of the part - wxRect rect; // client coord rectangle of the part itself -}; - - -class WXDLLIMPEXP_AUI wxAuiPaneButton -{ -public: - int button_id; // id of the button (e.g. buttonClose) -}; - - - -#ifndef SWIG -// wx event machinery - -BEGIN_DECLARE_EVENT_TYPES() - DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_AUI, wxEVT_AUI_PANE_BUTTON, 0) - DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_AUI, wxEVT_AUI_PANE_CLOSE, 0) - DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_AUI, wxEVT_AUI_PANE_MAXIMIZE, 0) - DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_AUI, wxEVT_AUI_PANE_RESTORE, 0) - DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_AUI, wxEVT_AUI_RENDER, 0) - DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_AUI, wxEVT_AUI_FIND_MANAGER, 0) -END_DECLARE_EVENT_TYPES() - -typedef void (wxEvtHandler::*wxAuiManagerEventFunction)(wxAuiManagerEvent&); - -#define wxAuiManagerEventHandler(func) \ - (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxAuiManagerEventFunction, &func) - -#define EVT_AUI_PANE_BUTTON(func) \ - wx__DECLARE_EVT0(wxEVT_AUI_PANE_BUTTON, wxAuiManagerEventHandler(func)) -#define EVT_AUI_PANE_CLOSE(func) \ - wx__DECLARE_EVT0(wxEVT_AUI_PANE_CLOSE, wxAuiManagerEventHandler(func)) -#define EVT_AUI_PANE_MAXIMIZE(func) \ - wx__DECLARE_EVT0(wxEVT_AUI_PANE_MAXIMIZE, wxAuiManagerEventHandler(func)) -#define EVT_AUI_PANE_RESTORE(func) \ - wx__DECLARE_EVT0(wxEVT_AUI_PANE_RESTORE, wxAuiManagerEventHandler(func)) -#define EVT_AUI_RENDER(func) \ - wx__DECLARE_EVT0(wxEVT_AUI_RENDER, wxAuiManagerEventHandler(func)) -#define EVT_AUI_FIND_MANAGER(func) \ - wx__DECLARE_EVT0(wxEVT_AUI_FIND_MANAGER, wxAuiManagerEventHandler(func)) - -#else - -%constant wxEventType wxEVT_AUI_PANE_BUTTON; -%constant wxEventType wxEVT_AUI_PANE_CLOSE; -%constant wxEventType wxEVT_AUI_PANE_MAXIMIZE; -%constant wxEventType wxEVT_AUI_PANE_RESTORE; -%constant wxEventType wxEVT_AUI_RENDER; -%constant wxEventType wxEVT_AUI_FIND_MANAGER; - -%pythoncode { - EVT_AUI_PANE_BUTTON = wx.PyEventBinder( wxEVT_AUI_PANE_BUTTON ) - EVT_AUI_PANE_CLOSE = wx.PyEventBinder( wxEVT_AUI_PANE_CLOSE ) - EVT_AUI_PANE_MAXIMIZE = wx.PyEventBinder( wxEVT_AUI_PANE_MAXIMIZE ) - EVT_AUI_PANE_RESTORE = wx.PyEventBinder( wxEVT_AUI_PANE_RESTORE ) - EVT_AUI_RENDER = wx.PyEventBinder( wxEVT_AUI_RENDER ) - EVT_AUI_FIND_MANAGER = wx.PyEventBinder( wxEVT_AUI_FIND_MANAGER ) -} -#endif // SWIG - -#endif // wxUSE_AUI -#endif //_WX_FRAMEMANAGER_H_ - diff --git a/wxWidgets/include/wx/aui/tabmdi.h b/wxWidgets/include/wx/aui/tabmdi.h deleted file mode 100644 index 6fa7ac095a..0000000000 --- a/wxWidgets/include/wx/aui/tabmdi.h +++ /dev/null @@ -1,269 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/generic/tabmdi.h -// Purpose: Generic MDI (Multiple Document Interface) classes -// Author: Hans Van Leemputten -// Modified by: Benjamin I. Williams / Kirix Corporation -// Created: 29/07/2002 -// RCS-ID: $Id: tabmdi.h 53135 2008-04-12 02:31:04Z VZ $ -// Copyright: (c) Hans Van Leemputten -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_AUITABMDI_H_ -#define _WX_AUITABMDI_H_ - -#if wxUSE_AUI - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -#include "wx/frame.h" -#include "wx/panel.h" -#include "wx/notebook.h" -#include "wx/icon.h" -#include "wx/aui/auibook.h" - -//----------------------------------------------------------------------------- -// classes -//----------------------------------------------------------------------------- - -class WXDLLIMPEXP_FWD_AUI wxAuiMDIParentFrame; -class WXDLLIMPEXP_FWD_AUI wxAuiMDIClientWindow; -class WXDLLIMPEXP_FWD_AUI wxAuiMDIChildFrame; - -//----------------------------------------------------------------------------- -// wxAuiMDIParentFrame -//----------------------------------------------------------------------------- - -class WXDLLIMPEXP_AUI wxAuiMDIParentFrame : public wxFrame -{ -public: - wxAuiMDIParentFrame(); - wxAuiMDIParentFrame(wxWindow *parent, - wxWindowID winid, - const wxString& title, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = wxDEFAULT_FRAME_STYLE | wxVSCROLL | wxHSCROLL, - const wxString& name = wxFrameNameStr); - - ~wxAuiMDIParentFrame(); - - bool Create(wxWindow *parent, - wxWindowID winid, - const wxString& title, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = wxDEFAULT_FRAME_STYLE | wxVSCROLL | wxHSCROLL, - const wxString& name = wxFrameNameStr ); - - void SetArtProvider(wxAuiTabArt* provider); - wxAuiTabArt* GetArtProvider(); - wxAuiNotebook* GetNotebook() const; - -#if wxUSE_MENUS - wxMenu* GetWindowMenu() const { return m_pWindowMenu; } - void SetWindowMenu(wxMenu* pMenu); - - virtual void SetMenuBar(wxMenuBar *pMenuBar); -#endif // wxUSE_MENUS - - void SetChildMenuBar(wxAuiMDIChildFrame *pChild); - - virtual bool ProcessEvent(wxEvent& event); - - wxAuiMDIChildFrame *GetActiveChild() const; - void SetActiveChild(wxAuiMDIChildFrame* pChildFrame); - - wxAuiMDIClientWindow *GetClientWindow() const; - virtual wxAuiMDIClientWindow *OnCreateClient(); - - virtual void Cascade() { /* Has no effect */ } - virtual void Tile(wxOrientation orient = wxHORIZONTAL); - virtual void ArrangeIcons() { /* Has no effect */ } - virtual void ActivateNext(); - virtual void ActivatePrevious(); - -protected: - wxAuiMDIClientWindow* m_pClientWindow; - wxAuiMDIChildFrame* m_pActiveChild; - wxEvent* m_pLastEvt; - -#if wxUSE_MENUS - wxMenu *m_pWindowMenu; - wxMenuBar *m_pMyMenuBar; -#endif // wxUSE_MENUS - -protected: - void Init(); - -#if wxUSE_MENUS - void RemoveWindowMenu(wxMenuBar *pMenuBar); - void AddWindowMenu(wxMenuBar *pMenuBar); - - void DoHandleMenu(wxCommandEvent &event); -#endif // wxUSE_MENUS - - virtual void DoGetClientSize(int *width, int *height) const; - -private: - DECLARE_EVENT_TABLE() - DECLARE_DYNAMIC_CLASS(wxAuiMDIParentFrame) -}; - -//----------------------------------------------------------------------------- -// wxAuiMDIChildFrame -//----------------------------------------------------------------------------- - -class WXDLLIMPEXP_AUI wxAuiMDIChildFrame : public wxPanel -{ -public: - wxAuiMDIChildFrame(); - wxAuiMDIChildFrame(wxAuiMDIParentFrame *parent, - wxWindowID winid, - const wxString& title, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = wxDEFAULT_FRAME_STYLE, - const wxString& name = wxFrameNameStr); - - virtual ~wxAuiMDIChildFrame(); - bool Create(wxAuiMDIParentFrame *parent, - wxWindowID winid, - const wxString& title, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = wxDEFAULT_FRAME_STYLE, - const wxString& name = wxFrameNameStr); - -#if wxUSE_MENUS - virtual void SetMenuBar(wxMenuBar *menu_bar); - virtual wxMenuBar *GetMenuBar() const; -#endif // wxUSE_MENUS - - virtual void SetTitle(const wxString& title); - virtual wxString GetTitle() const; - - virtual void SetIcons(const wxIconBundle& icons); - virtual const wxIconBundle& GetIcons() const; - - virtual void SetIcon(const wxIcon& icon); - virtual const wxIcon& GetIcon() const; - - virtual void Activate(); - virtual bool Destroy(); - -#if wxUSE_STATUSBAR - // no status bars - virtual wxStatusBar* CreateStatusBar(int WXUNUSED(number) = 1, - long WXUNUSED(style) = 1, - wxWindowID WXUNUSED(winid) = 1, - const wxString& WXUNUSED(name) = wxEmptyString) - { return (wxStatusBar*)NULL; } - - virtual wxStatusBar *GetStatusBar() const { return (wxStatusBar*)NULL; } - virtual void SetStatusText( const wxString &WXUNUSED(text), int WXUNUSED(number)=0 ) {} - virtual void SetStatusWidths( int WXUNUSED(n), const int WXUNUSED(widths_field)[] ) {} -#endif - - // no size hints - virtual void DoSetSizeHints(int WXUNUSED(minW), - int WXUNUSED(minH), - int WXUNUSED(maxW) = wxDefaultCoord, - int WXUNUSED(maxH) = wxDefaultCoord, - int WXUNUSED(incW) = wxDefaultCoord, - int WXUNUSED(incH) = wxDefaultCoord) {} -#if wxUSE_TOOLBAR - // no toolbar bars - virtual wxToolBar* CreateToolBar(long WXUNUSED(style), - wxWindowID WXUNUSED(winid), - const wxString& WXUNUSED(name)) - { return (wxToolBar*)NULL; } - virtual wxToolBar *GetToolBar() const { return (wxToolBar*)NULL; } -#endif - - - // no maximize etc - virtual void Maximize(bool WXUNUSED(maximize) = true) { /* Has no effect */ } - virtual void Restore() { /* Has no effect */ } - virtual void Iconize(bool WXUNUSED(iconize) = true) { /* Has no effect */ } - virtual bool IsMaximized() const { return true; } - virtual bool IsIconized() const { return false; } - virtual bool ShowFullScreen(bool WXUNUSED(show), long WXUNUSED(style)) { return false; } - virtual bool IsFullScreen() const { return false; } - - virtual bool IsTopLevel() const { return false; } - - void OnMenuHighlight(wxMenuEvent& evt); - void OnActivate(wxActivateEvent& evt); - void OnCloseWindow(wxCloseEvent& evt); - - void SetMDIParentFrame(wxAuiMDIParentFrame* parent); - wxAuiMDIParentFrame* GetMDIParentFrame() const; - -protected: - void Init(); - virtual bool Show(bool show = true); - virtual void DoSetSize(int x, int y, int width, int height, int size_flags); - virtual void DoMoveWindow(int x, int y, int width, int height); - -public: - // This function needs to be called when a size change is confirmed, - // we needed this function to prevent anybody from the outside - // changing the panel... it messes the UI layout when we would allow it. - void ApplyMDIChildFrameRect(); - void DoShow(bool show); - -protected: - wxAuiMDIParentFrame* m_pMDIParentFrame; - wxRect m_mdi_newrect; - wxRect m_mdi_currect; - wxString m_title; - wxIcon m_icon; - wxIconBundle m_icon_bundle; - bool m_activate_on_create; - -#if wxUSE_MENUS - wxMenuBar* m_pMenuBar; -#endif // wxUSE_MENUS - - - -private: - DECLARE_DYNAMIC_CLASS(wxAuiMDIChildFrame) - DECLARE_EVENT_TABLE() - - friend class wxAuiMDIClientWindow; -}; - -//----------------------------------------------------------------------------- -// wxAuiMDIClientWindow -//----------------------------------------------------------------------------- - -class WXDLLIMPEXP_AUI wxAuiMDIClientWindow : public wxAuiNotebook -{ -public: - wxAuiMDIClientWindow(); - wxAuiMDIClientWindow(wxAuiMDIParentFrame *parent, long style = 0); - ~wxAuiMDIClientWindow(); - - virtual bool CreateClient(wxAuiMDIParentFrame *parent, - long style = wxVSCROLL | wxHSCROLL); - - virtual int SetSelection(size_t page); - -protected: - - void PageChanged(int old_selection, int new_selection); - void OnPageClose(wxAuiNotebookEvent& evt); - void OnPageChanged(wxAuiNotebookEvent& evt); - void OnSize(wxSizeEvent& evt); - -private: - DECLARE_DYNAMIC_CLASS(wxAuiMDIClientWindow) - DECLARE_EVENT_TABLE() -}; -#endif // wxUSE_AUI - -#endif // _WX_AUITABMDI_H_ diff --git a/wxWidgets/include/wx/beforestd.h b/wxWidgets/include/wx/beforestd.h deleted file mode 100644 index 8370259dd3..0000000000 --- a/wxWidgets/include/wx/beforestd.h +++ /dev/null @@ -1,75 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: include/wx/beforestd.h -// Purpose: #include before STL headers -// Author: Vadim Zeitlin -// Modified by: -// Created: 07/07/03 -// RCS-ID: $Id: beforestd.h 61871 2009-09-09 22:29:51Z VZ $ -// Copyright: (c) 2003 Vadim Zeitlin -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -/** - Unfortunately, when compiling at maximum warning level, the standard - headers themselves may generate warnings -- and really lots of them. So - before including them, this header should be included to temporarily - suppress the warnings and after this the header afterstd.h should be - included to enable them back again. - - Note that there are intentionally no inclusion guards in this file, because - it can be included several times. - */ - -// VC 7.x isn't as bad as VC6 and doesn't give these warnings but eVC (which -// defines _MSC_VER as 1201) does need to be included as it's VC6-like -#if defined(__VISUALC__) && __VISUALC__ <= 1201 - // MSVC 5 does not have this - #if __VISUALC__ > 1100 - // we have to disable (and reenable in afterstd.h) this one because, - // even though it is of level 4, it is not disabled by warning(push, 1) - // below for VC7.1! - - // unreachable code - #pragma warning(disable:4702) - - #pragma warning(push, 1) - #else // VC 5 - // 'expression' : signed/unsigned mismatch - #pragma warning(disable:4018) - - // 'identifier' : unreferenced formal parameter - #pragma warning(disable:4100) - - // 'conversion' : conversion from 'type1' to 'type2', - // possible loss of data - #pragma warning(disable:4244) - - // C++ language change: to explicitly specialize class template - // 'identifier' use the following syntax - #pragma warning(disable:4663) - #endif - - // these warning have to be disabled and not just temporarily disabled - // because they will be given at the end of the compilation of the - // current source and there is absolutely nothing we can do about them - - // 'foo': unreferenced inline function has been removed - #pragma warning(disable:4514) - - // 'function' : function not inlined - #pragma warning(disable:4710) - - // 'id': identifier was truncated to 'num' characters in the debug info - #pragma warning(disable:4786) -#endif // VC++ < 7 - -/* - Recent versions of Sun C++ compiler use _T in their standard headers and - our definition of it in wx/wxchar.h conflicts with them and breaks - compilation, so undefine _T before including them and redefine it back in - wx/afterstd.h if needed. - */ -#if defined(__SUNPRO_CC) || defined(__SUNPRO_C) - #undef _T -#endif /* SUNCC */ - diff --git a/wxWidgets/include/wx/bitmap.h b/wxWidgets/include/wx/bitmap.h deleted file mode 100644 index 92d4564780..0000000000 --- a/wxWidgets/include/wx/bitmap.h +++ /dev/null @@ -1,241 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: wx/bitmap.h -// Purpose: wxBitmap class interface -// Author: Vaclav Slavik -// Modified by: -// Created: 22.04.01 -// RCS-ID: $Id: bitmap.h 49563 2007-10-31 20:46:21Z VZ $ -// Copyright: (c) wxWidgets team -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_BITMAP_H_BASE_ -#define _WX_BITMAP_H_BASE_ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -#include "wx/string.h" -#include "wx/gdicmn.h" // for wxBitmapType -#include "wx/colour.h" - -class WXDLLIMPEXP_FWD_CORE wxBitmap; -class WXDLLIMPEXP_FWD_CORE wxBitmapHandler; -class WXDLLIMPEXP_FWD_CORE wxIcon; -class WXDLLIMPEXP_FWD_CORE wxImage; -class WXDLLIMPEXP_FWD_CORE wxMask; -class WXDLLIMPEXP_FWD_CORE wxPalette; - -// ---------------------------------------------------------------------------- -// wxVariant support -// ---------------------------------------------------------------------------- - -#if wxUSE_VARIANT -#include "wx/variant.h" -DECLARE_VARIANT_OBJECT_EXPORTED(wxBitmap,WXDLLEXPORT) -#endif - -// ---------------------------------------------------------------------------- -// wxMask represents the transparent area of the bitmap -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxMaskBase : public wxObject -{ -public: - // create the mask from bitmap pixels of the given colour - bool Create(const wxBitmap& bitmap, const wxColour& colour); - -#if wxUSE_PALETTE - // create the mask from bitmap pixels with the given palette index - bool Create(const wxBitmap& bitmap, int paletteIndex); -#endif // wxUSE_PALETTE - - // create the mask from the given mono bitmap - bool Create(const wxBitmap& bitmap); - -protected: - // this function is called from Create() to free the existing mask data - virtual void FreeData() = 0; - - // these functions must be overridden to implement the corresponding public - // Create() methods, they shouldn't call FreeData() as it's already called - // by the public wrappers - virtual bool InitFromColour(const wxBitmap& bitmap, - const wxColour& colour) = 0; - virtual bool InitFromMonoBitmap(const wxBitmap& bitmap) = 0; -}; - -#if defined(__WXMGL__) || \ - defined(__WXDFB__) || \ - defined(__WXMAC__) || \ - defined(__WXGTK__) || \ - defined(__WXCOCOA__) || \ - defined(__WXMOTIF__) || \ - defined(__WXX11__) - #define wxUSE_BITMAP_BASE 1 -#else - #define wxUSE_BITMAP_BASE 0 -#endif - -// Only used by some ports -// FIXME -- make all ports (but MSW which uses wxGDIImage) use these base classes -#if wxUSE_BITMAP_BASE - -// ---------------------------------------------------------------------------- -// wxBitmapHandler: class which knows how to create/load/save bitmaps in -// different formats -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxBitmapHandlerBase : public wxObject -{ -public: - wxBitmapHandlerBase() { m_type = wxBITMAP_TYPE_INVALID; } - virtual ~wxBitmapHandlerBase() { } - - virtual bool Create(wxBitmap *bitmap, const 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(wxBitmapType type) { m_type = type; } - const wxString& GetName() const { return m_name; } - const wxString& GetExtension() const { return m_extension; } - wxBitmapType GetType() const { return m_type; } - -private: - wxString m_name; - wxString m_extension; - wxBitmapType m_type; - - DECLARE_ABSTRACT_CLASS(wxBitmapHandlerBase) -}; - -class WXDLLEXPORT wxBitmapBase : public wxGDIObject -{ -public: - /* - Derived class must implement these: - - wxBitmap(); - wxBitmap(int width, int height, int depth = -1); - wxBitmap(const char bits[], int width, int height, int depth = 1); - wxBitmap(const char* const* bits); - wxBitmap(const wxString &filename, wxBitmapType type = wxBITMAP_TYPE_XPM); - wxBitmap(const wxImage& image, int depth = -1); - - bool Create(int width, int height, int depth = -1); - - static void InitStandardHandlers(); - */ - - virtual bool Ok() const { return IsOk(); } - virtual bool IsOk() const = 0; - - virtual int GetHeight() const = 0; - virtual int GetWidth() const = 0; - virtual int GetDepth() const = 0; - - virtual wxImage ConvertToImage() const = 0; - - virtual wxMask *GetMask() const = 0; - virtual void SetMask(wxMask *mask) = 0; - - virtual wxBitmap GetSubBitmap(const wxRect& rect) const = 0; - - virtual bool SaveFile(const wxString &name, wxBitmapType type, - const wxPalette *palette = (wxPalette *)NULL) const = 0; - virtual bool LoadFile(const wxString &name, wxBitmapType type) = 0; - - /* - If raw bitmap access is supported (see wx/rawbmp.h), the following - methods should be implemented: - - virtual bool GetRawData(wxRawBitmapData *data) = 0; - virtual void UngetRawData(wxRawBitmapData *data) = 0; - */ - -#if wxUSE_PALETTE - virtual wxPalette *GetPalette() const = 0; - virtual void SetPalette(const wxPalette& palette) = 0; -#endif // wxUSE_PALETTE - - // copies the contents and mask of the given (colour) icon to the bitmap - virtual bool CopyFromIcon(const wxIcon& icon) = 0; - - // implementation: - virtual void SetHeight(int height) = 0; - virtual void SetWidth(int width) = 0; - virtual void SetDepth(int depth) = 0; - - // Format handling - static inline wxList& GetHandlers() { return sm_handlers; } - static void AddHandler(wxBitmapHandlerBase *handler); - static void InsertHandler(wxBitmapHandlerBase *handler); - static bool RemoveHandler(const wxString& name); - static wxBitmapHandler *FindHandler(const wxString& name); - static wxBitmapHandler *FindHandler(const wxString& extension, wxBitmapType bitmapType); - static wxBitmapHandler *FindHandler(wxBitmapType bitmapType); - - //static void InitStandardHandlers(); - // (wxBitmap must implement this one) - - static void CleanUpHandlers(); - - // this method is only used by the generic implementation of wxMask - // currently but could be useful elsewhere in the future: it can be - // overridden to quantize the colour to correspond to bitmap colour depth - // if necessary; default implementation simply returns the colour as is - virtual wxColour QuantizeColour(const wxColour& colour) const - { - return colour; - } - -protected: - static wxList sm_handlers; - - DECLARE_ABSTRACT_CLASS(wxBitmapBase) -}; - -#endif // wxUSE_BITMAP_BASE - -#if defined(__WXPALMOS__) - #include "wx/palmos/bitmap.h" -#elif defined(__WXMSW__) - #include "wx/msw/bitmap.h" -#elif defined(__WXMOTIF__) - #include "wx/x11/bitmap.h" -#elif defined(__WXGTK20__) - #include "wx/gtk/bitmap.h" -#elif defined(__WXGTK__) - #include "wx/gtk1/bitmap.h" -#elif defined(__WXX11__) - #include "wx/x11/bitmap.h" -#elif defined(__WXMGL__) - #include "wx/mgl/bitmap.h" -#elif defined(__WXDFB__) - #include "wx/dfb/bitmap.h" -#elif defined(__WXMAC__) - #include "wx/mac/bitmap.h" -#elif defined(__WXCOCOA__) - #include "wx/cocoa/bitmap.h" -#elif defined(__WXPM__) - #include "wx/os2/bitmap.h" -#endif - -// we must include generic mask.h after wxBitmap definition -#if defined(__WXMGL__) || defined(__WXDFB__) - #define wxUSE_GENERIC_MASK 1 -#else - #define wxUSE_GENERIC_MASK 0 -#endif - -#if wxUSE_GENERIC_MASK - #include "wx/generic/mask.h" -#endif - -#endif // _WX_BITMAP_H_BASE_ diff --git a/wxWidgets/include/wx/bmpbuttn.h b/wxWidgets/include/wx/bmpbuttn.h deleted file mode 100644 index c37d2cd7c5..0000000000 --- a/wxWidgets/include/wx/bmpbuttn.h +++ /dev/null @@ -1,122 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/bmpbutton.h -// Purpose: wxBitmapButton class interface -// Author: Vadim Zeitlin -// Modified by: -// Created: 25.08.00 -// RCS-ID: $Id: bmpbuttn.h 45498 2007-04-16 13:03:05Z VZ $ -// Copyright: (c) 2000 Vadim Zeitlin -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_BMPBUTTON_H_BASE_ -#define _WX_BMPBUTTON_H_BASE_ - -#include "wx/defs.h" - -#if wxUSE_BMPBUTTON - -#include "wx/bitmap.h" -#include "wx/button.h" - -extern WXDLLEXPORT_DATA(const wxChar) wxButtonNameStr[]; - -// ---------------------------------------------------------------------------- -// wxBitmapButton: a button which shows bitmaps instead of the usual string. -// It has different bitmaps for different states (focused/disabled/pressed) -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxBitmapButtonBase : public wxButton -{ -public: - wxBitmapButtonBase() - { - m_marginX = - m_marginY = 0; - } - - // set the bitmaps - void SetBitmapLabel(const wxBitmap& bitmap) - { m_bmpNormal = bitmap; OnSetBitmap(); } - void SetBitmapSelected(const wxBitmap& sel) - { m_bmpSelected = sel; OnSetBitmap(); } - void SetBitmapFocus(const wxBitmap& focus) - { m_bmpFocus = focus; OnSetBitmap(); } - void SetBitmapDisabled(const wxBitmap& disabled) - { m_bmpDisabled = disabled; OnSetBitmap(); } - void SetBitmapHover(const wxBitmap& hover) - { m_bmpHover = hover; OnSetBitmap(); } - - // retrieve the bitmaps - const wxBitmap& GetBitmapLabel() const { return m_bmpNormal; } - const wxBitmap& GetBitmapSelected() const { return m_bmpSelected; } - const wxBitmap& GetBitmapFocus() const { return m_bmpFocus; } - const wxBitmap& GetBitmapDisabled() const { return m_bmpDisabled; } - const wxBitmap& GetBitmapHover() const { return m_bmpHover; } - wxBitmap& GetBitmapLabel() { return m_bmpNormal; } - wxBitmap& GetBitmapSelected() { return m_bmpSelected; } - wxBitmap& GetBitmapFocus() { return m_bmpFocus; } - wxBitmap& GetBitmapDisabled() { return m_bmpDisabled; } - wxBitmap& GetBitmapHover() { return m_bmpHover; } - - // set/get the margins around the button - virtual void SetMargins(int x, int y) { m_marginX = x; m_marginY = y; } - int GetMarginX() const { return m_marginX; } - int GetMarginY() const { return m_marginY; } - - // deprecated synonym for SetBitmapLabel() -#if WXWIN_COMPATIBILITY_2_6 - wxDEPRECATED( void SetLabel(const wxBitmap& bitmap) ); - - // prevent virtual function hiding - virtual void SetLabel(const wxString& label) - { wxWindow::SetLabel(label); } -#endif // WXWIN_COMPATIBILITY_2_6 - -protected: - // function called when any of the bitmaps changes - virtual void OnSetBitmap() { InvalidateBestSize(); Refresh(); } - - // the bitmaps for various states - wxBitmap m_bmpNormal, - m_bmpSelected, - m_bmpFocus, - m_bmpDisabled, - m_bmpHover; - - // the margins around the bitmap - int m_marginX, - m_marginY; - - - DECLARE_NO_COPY_CLASS(wxBitmapButtonBase) -}; - -#if WXWIN_COMPATIBILITY_2_6 -inline void wxBitmapButtonBase::SetLabel(const wxBitmap& bitmap) -{ - SetBitmapLabel(bitmap); -} -#endif // WXWIN_COMPATIBILITY_2_6 - -#if defined(__WXUNIVERSAL__) - #include "wx/univ/bmpbuttn.h" -#elif defined(__WXMSW__) - #include "wx/msw/bmpbuttn.h" -#elif defined(__WXMOTIF__) - #include "wx/motif/bmpbuttn.h" -#elif defined(__WXGTK20__) - #include "wx/gtk/bmpbuttn.h" -#elif defined(__WXGTK__) - #include "wx/gtk1/bmpbuttn.h" -#elif defined(__WXMAC__) - #include "wx/mac/bmpbuttn.h" -#elif defined(__WXCOCOA__) - #include "wx/cocoa/bmpbuttn.h" -#elif defined(__WXPM__) - #include "wx/os2/bmpbuttn.h" -#endif - -#endif // wxUSE_BMPBUTTON - -#endif // _WX_BMPBUTTON_H_BASE_ diff --git a/wxWidgets/include/wx/bmpcbox.h b/wxWidgets/include/wx/bmpcbox.h deleted file mode 100644 index 09fb32c4cb..0000000000 --- a/wxWidgets/include/wx/bmpcbox.h +++ /dev/null @@ -1,49 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/bmpcbox.h -// Purpose: wxBitmapComboBox base header -// Author: Jaakko Salli -// Modified by: -// Created: Aug-31-2006 -// Copyright: (c) Jaakko Salli -// RCS-ID: $Id: bmpcbox.h 42046 2006-10-16 09:30:01Z ABX $ -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_BMPCBOX_H_BASE_ -#define _WX_BMPCBOX_H_BASE_ - - -#include "wx/defs.h" - -#if wxUSE_BITMAPCOMBOBOX - -#include "wx/bitmap.h" - - -extern WXDLLIMPEXP_DATA_ADV(const wxChar) wxBitmapComboBoxNameStr[]; - - -class WXDLLIMPEXP_ADV wxBitmapComboBoxBase -{ -public: - // ctors and such - wxBitmapComboBoxBase() { } - - virtual ~wxBitmapComboBoxBase() { } - - // Returns the image of the item with the given index. - virtual wxBitmap GetItemBitmap(unsigned int n) const = 0; - - // Sets the image for the given item. - virtual void SetItemBitmap(unsigned int n, const wxBitmap& bitmap) = 0; - - // Returns size of the image used in list - virtual wxSize GetBitmapSize() const = 0; -}; - - -#include "wx/generic/bmpcbox.h" - -#endif // wxUSE_BITMAPCOMBOBOX - -#endif // _WX_BMPCBOX_H_BASE_ diff --git a/wxWidgets/include/wx/bookctrl.h b/wxWidgets/include/wx/bookctrl.h deleted file mode 100644 index ba1bdfe5bc..0000000000 --- a/wxWidgets/include/wx/bookctrl.h +++ /dev/null @@ -1,403 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: wx/bookctrl.h -// Purpose: wxBookCtrlBase: common base class for wxList/Tree/Notebook -// Author: Vadim Zeitlin -// Modified by: -// Created: 19.08.03 -// RCS-ID: $Id: bookctrl.h 49563 2007-10-31 20:46:21Z VZ $ -// Copyright: (c) 2003 Vadim Zeitlin -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_BOOKCTRL_H_ -#define _WX_BOOKCTRL_H_ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -#include "wx/defs.h" - -#if wxUSE_BOOKCTRL - -#include "wx/control.h" -#include "wx/dynarray.h" - -WX_DEFINE_EXPORTED_ARRAY_PTR(wxWindow *, wxArrayPages); - -class WXDLLIMPEXP_FWD_CORE wxImageList; -class WXDLLIMPEXP_FWD_CORE wxBookCtrlBaseEvent; - -// ---------------------------------------------------------------------------- -// constants -// ---------------------------------------------------------------------------- - -// wxBookCtrl hit results -enum -{ - wxBK_HITTEST_NOWHERE = 1, // not on tab - wxBK_HITTEST_ONICON = 2, // on icon - wxBK_HITTEST_ONLABEL = 4, // on label - wxBK_HITTEST_ONITEM = wxBK_HITTEST_ONICON | wxBK_HITTEST_ONLABEL, - wxBK_HITTEST_ONPAGE = 8 // not on tab control, but over the selected page -}; - -// wxBookCtrl flags (common for wxNotebook, wxListbook, wxChoicebook, wxTreebook) -#define wxBK_DEFAULT 0x0000 -#define wxBK_TOP 0x0010 -#define wxBK_BOTTOM 0x0020 -#define wxBK_LEFT 0x0040 -#define wxBK_RIGHT 0x0080 -#define wxBK_ALIGN_MASK (wxBK_TOP | wxBK_BOTTOM | wxBK_LEFT | wxBK_RIGHT) - -// ---------------------------------------------------------------------------- -// wxBookCtrlBase -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxBookCtrlBase : public wxControl -{ -public: - // construction - // ------------ - - wxBookCtrlBase() - { - Init(); - } - - wxBookCtrlBase(wxWindow *parent, - wxWindowID winid, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = 0, - const wxString& name = wxEmptyString) - { - Init(); - - (void)Create(parent, winid, pos, size, style, name); - } - - // quasi ctor - bool Create(wxWindow *parent, - wxWindowID winid, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = 0, - const wxString& name = wxEmptyString); - - // dtor - virtual ~wxBookCtrlBase(); - - - // accessors - // --------- - - // get number of pages in the dialog - virtual size_t GetPageCount() const { return m_pages.size(); } - - // get the panel which represents the given page - wxWindow *GetPage(size_t n) { return m_pages[n]; } - wxWindow *GetPage(size_t n) const { return m_pages[n]; } - - // get the current page or NULL if none - wxWindow *GetCurrentPage() const - { - const int n = GetSelection(); - return n == wxNOT_FOUND ? NULL : GetPage(n); - } - - // get the currently selected page or wxNOT_FOUND if none - virtual int GetSelection() const = 0; - - // set/get the title of a page - virtual bool SetPageText(size_t n, const wxString& strText) = 0; - virtual wxString GetPageText(size_t n) const = 0; - - - // image list stuff: each page may have an image associated with it (all - // images belong to the same image list) - // --------------------------------------------------------------------- - - // sets the image list to use, it is *not* deleted by the control - virtual void SetImageList(wxImageList *imageList); - - // as SetImageList() but we will delete the image list ourselves - void AssignImageList(wxImageList *imageList); - - // get pointer (may be NULL) to the associated image list - wxImageList* GetImageList() const { return m_imageList; } - - // sets/returns item's image index in the current image list - virtual int GetPageImage(size_t n) const = 0; - virtual bool SetPageImage(size_t n, int imageId) = 0; - - - // geometry - // -------- - - // resize the notebook so that all pages will have the specified size - virtual void SetPageSize(const wxSize& size); - - // calculate the size of the control from the size of its page - virtual wxSize CalcSizeFromPage(const wxSize& sizePage) const = 0; - - // get/set size of area between book control area and page area - unsigned int GetInternalBorder() const { return m_internalBorder; } - void SetInternalBorder(unsigned int border) { m_internalBorder = border; } - - // Sets/gets the margin around the controller - void SetControlMargin(int margin) { m_controlMargin = margin; } - int GetControlMargin() const { return m_controlMargin; } - - // returns true if we have wxBK_TOP or wxBK_BOTTOM style - bool IsVertical() const { return HasFlag(wxBK_BOTTOM | wxBK_TOP); } - - // set/get option to shrink to fit current page - void SetFitToCurrentPage(bool fit) { m_fitToCurrentPage = fit; } - bool GetFitToCurrentPage() const { return m_fitToCurrentPage; } - - // returns the sizer containing the control, if any - wxSizer* GetControlSizer() const { return m_controlSizer; } - - // operations - // ---------- - - // remove one page from the control and delete it - virtual bool DeletePage(size_t n); - - // remove one page from the notebook, without deleting it - virtual bool RemovePage(size_t n) - { - DoInvalidateBestSize(); - return DoRemovePage(n) != NULL; - } - - // remove all pages and delete them - virtual bool DeleteAllPages() - { - DoInvalidateBestSize(); - WX_CLEAR_ARRAY(m_pages); - return true; - } - - // adds a new page to the control - virtual bool AddPage(wxWindow *page, - const wxString& text, - bool bSelect = false, - int imageId = -1) - { - DoInvalidateBestSize(); - return InsertPage(GetPageCount(), page, text, bSelect, imageId); - } - - // the same as AddPage(), but adds the page at the specified position - virtual bool InsertPage(size_t n, - wxWindow *page, - const wxString& text, - bool bSelect = false, - int imageId = -1) = 0; - - // set the currently selected page, return the index of the previously - // selected one (or -1 on error) - // - // NB: this function will generate PAGE_CHANGING/ED events - virtual int SetSelection(size_t n) = 0; - - // acts as SetSelection but does not generate events - virtual int ChangeSelection(size_t n) = 0; - - - // cycle thru the pages - void AdvanceSelection(bool forward = true) - { - int nPage = GetNextPage(forward); - if ( nPage != -1 ) - { - // cast is safe because of the check above - SetSelection((size_t)nPage); - } - } - - // hit test: returns which page is hit and, optionally, where (icon, label) - virtual int HitTest(const wxPoint& WXUNUSED(pt), - long * WXUNUSED(flags) = NULL) const - { - return wxNOT_FOUND; - } - - - // we do have multiple pages - virtual bool HasMultiplePages() const { return true; } - - -protected: - // flags for DoSetSelection() - enum - { - SetSelection_SendEvent = 1 - }; - - // set the selection to the given page, sending the events (which can - // possibly prevent the page change from taking place) if SendEvent flag is - // included - virtual int DoSetSelection(size_t nPage, int flags = 0); - - // if the derived class uses DoSetSelection() for implementing - // [Set|Change]Selection, it must override UpdateSelectedPage(), - // CreatePageChangingEvent() and MakeChangedEvent(), but as it might not - // use it, these functions are not pure virtual - - // called to notify the control about a new current page - virtual void UpdateSelectedPage(size_t WXUNUSED(newsel)) - { wxFAIL_MSG(wxT("Override this function!")); } - - // create a new "page changing" event - virtual wxBookCtrlBaseEvent* CreatePageChangingEvent() const - { wxFAIL_MSG(wxT("Override this function!")); return NULL; } - - // modify the event created by CreatePageChangingEvent() to "page changed" - // event, usually by just calling SetEventType() on it - virtual void MakeChangedEvent(wxBookCtrlBaseEvent& WXUNUSED(event)) - { wxFAIL_MSG(wxT("Override this function!")); } - - - // Should we accept NULL page pointers in Add/InsertPage()? - // - // Default is no but derived classes may override it if they can treat NULL - // pages in some sensible way (e.g. wxTreebook overrides this to allow - // having nodes without any associated page) - virtual bool AllowNullPage() const { return false; } - - // remove the page and return a pointer to it - virtual wxWindow *DoRemovePage(size_t page) = 0; - - // our best size is the size which fits all our pages - virtual wxSize DoGetBestSize() const; - - // helper: get the next page wrapping if we reached the end - int GetNextPage(bool forward) const; - - // Lay out controls - void DoSize(); - - // This method also invalidates the size of the controller and should be - // called instead of just InvalidateBestSize() whenever pages are added or - // removed as this also affects the controller - void DoInvalidateBestSize(); - -#if wxUSE_HELP - // Show the help for the corresponding page - void OnHelp(wxHelpEvent& event); -#endif // wxUSE_HELP - - - // the array of all pages of this control - wxArrayPages m_pages; - - // the associated image list or NULL - wxImageList *m_imageList; - - // true if we must delete m_imageList - bool m_ownsImageList; - - // get the page area - wxRect GetPageRect() const; - - // event handlers - virtual wxSize GetControllerSize() const; - void OnSize(wxSizeEvent& event); - - // controller buddy if available, NULL otherwise (usually for native book controls like wxNotebook) - wxControl *m_bookctrl; - - // Whether to shrink to fit current page - bool m_fitToCurrentPage; - - // the sizer containing the choice control - wxSizer *m_controlSizer; - - // the margin around the choice control - int m_controlMargin; - -private: - - // common part of all ctors - void Init(); - - // internal border - unsigned int m_internalBorder; - - DECLARE_ABSTRACT_CLASS(wxBookCtrlBase) - DECLARE_NO_COPY_CLASS(wxBookCtrlBase) - DECLARE_EVENT_TABLE() -}; - -// ---------------------------------------------------------------------------- -// wxBookCtrlBaseEvent: page changing events generated by derived classes -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxBookCtrlBaseEvent : public wxNotifyEvent -{ -public: - wxBookCtrlBaseEvent(wxEventType commandType = wxEVT_NULL, int winid = 0, - int nSel = -1, int nOldSel = -1) - : wxNotifyEvent(commandType, winid) - { - m_nSel = nSel; - m_nOldSel = nOldSel; - } - - wxBookCtrlBaseEvent(const wxBookCtrlBaseEvent& event) - : wxNotifyEvent(event) - { - m_nSel = event.m_nSel; - m_nOldSel = event.m_nOldSel; - } - - // accessors - // the currently selected page (-1 if none) - int GetSelection() const { return m_nSel; } - void SetSelection(int nSel) { m_nSel = nSel; } - // the page that was selected before the change (-1 if none) - int GetOldSelection() const { return m_nOldSel; } - void SetOldSelection(int nOldSel) { m_nOldSel = nOldSel; } - -private: - int m_nSel, // currently selected page - m_nOldSel; // previously selected page -}; - -// make a default book control for given platform -#if wxUSE_NOTEBOOK - // dedicated to majority of desktops - #include "wx/notebook.h" - #define wxBookCtrl wxNotebook - #define wxBookCtrlEvent wxNotebookEvent - #define wxEVT_COMMAND_BOOKCTRL_PAGE_CHANGED wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED - #define wxEVT_COMMAND_BOOKCTRL_PAGE_CHANGING wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING - #define EVT_BOOKCTRL_PAGE_CHANGED(id, fn) EVT_NOTEBOOK_PAGE_CHANGED(id, fn) - #define EVT_BOOKCTRL_PAGE_CHANGING(id, fn) EVT_NOTEBOOK_PAGE_CHANGING(id, fn) - #define wxBookctrlEventHandler(func) wxNotebookEventHandler(func) -#else - // dedicated to Smartphones - #include "wx/choicebk.h" - #define wxBookCtrl wxChoicebook - #define wxBookCtrlEvent wxChoicebookEvent - #define wxEVT_COMMAND_BOOKCTRL_PAGE_CHANGED wxEVT_COMMAND_CHOICEBOOK_PAGE_CHANGED - #define wxEVT_COMMAND_BOOKCTRL_PAGE_CHANGING wxEVT_COMMAND_CHOICEBOOK_PAGE_CHANGING - #define EVT_BOOKCTRL_PAGE_CHANGED(id, fn) EVT_CHOICEBOOK_PAGE_CHANGED(id, fn) - #define EVT_BOOKCTRL_PAGE_CHANGING(id, fn) EVT_CHOICEBOOK_PAGE_CHANGING(id, fn) - #define wxBookctrlEventHandler(func) wxChoicebookEventHandler(func) -#endif - -#if WXWIN_COMPATIBILITY_2_6 - #define wxBC_TOP wxBK_TOP - #define wxBC_BOTTOM wxBK_BOTTOM - #define wxBC_LEFT wxBK_LEFT - #define wxBC_RIGHT wxBK_RIGHT - #define wxBC_DEFAULT wxBK_DEFAULT -#endif - -#endif // wxUSE_BOOKCTRL - -#endif // _WX_BOOKCTRL_H_ diff --git a/wxWidgets/include/wx/brush.h b/wxWidgets/include/wx/brush.h deleted file mode 100644 index cbf7287282..0000000000 --- a/wxWidgets/include/wx/brush.h +++ /dev/null @@ -1,54 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/brush.h -// Purpose: Includes platform-specific wxBrush file -// Author: Julian Smart -// Modified by: -// Created: -// RCS-ID: $Id: brush.h 40865 2006-08-27 09:42:42Z VS $ -// Copyright: Julian Smart -// Licence: wxWindows Licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_BRUSH_H_BASE_ -#define _WX_BRUSH_H_BASE_ - -#include "wx/defs.h" -#include "wx/object.h" -#include "wx/gdiobj.h" - -// wxBrushBase -class WXDLLEXPORT wxBrushBase: public wxGDIObject -{ -public: - virtual ~wxBrushBase() { } - - virtual int GetStyle() const = 0; - - virtual bool IsHatch() const - { return (GetStyle()>=wxFIRST_HATCH) && (GetStyle()<=wxLAST_HATCH); } -}; - -#if defined(__WXPALMOS__) - #include "wx/palmos/brush.h" -#elif defined(__WXMSW__) - #include "wx/msw/brush.h" -#elif defined(__WXMOTIF__) || defined(__WXX11__) - #include "wx/x11/brush.h" -#elif defined(__WXGTK20__) - #include "wx/gtk/brush.h" -#elif defined(__WXGTK__) - #include "wx/gtk1/brush.h" -#elif defined(__WXMGL__) - #include "wx/mgl/brush.h" -#elif defined(__WXDFB__) - #include "wx/dfb/brush.h" -#elif defined(__WXMAC__) - #include "wx/mac/brush.h" -#elif defined(__WXCOCOA__) - #include "wx/cocoa/brush.h" -#elif defined(__WXPM__) - #include "wx/os2/brush.h" -#endif - -#endif - // _WX_BRUSH_H_BASE_ diff --git a/wxWidgets/include/wx/buffer.h b/wxWidgets/include/wx/buffer.h deleted file mode 100644 index 8d23856371..0000000000 --- a/wxWidgets/include/wx/buffer.h +++ /dev/null @@ -1,314 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: wx/buffer.h -// Purpose: auto buffer classes: buffers which automatically free memory -// Author: Vadim Zeitlin -// Modified by: -// Created: 12.04.99 -// RCS-ID: $Id: buffer.h 61872 2009-09-09 22:37:05Z VZ $ -// Copyright: (c) 1998 Vadim Zeitlin -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_BUFFER_H -#define _WX_BUFFER_H - -#include "wx/wxchar.h" - -#include // malloc() and free() - -// ---------------------------------------------------------------------------- -// Special classes for (wide) character strings: they use malloc/free instead -// of new/delete -// ---------------------------------------------------------------------------- - -#define DEFINE_BUFFER(classname, chartype, strdupfunc) \ -class WXDLLIMPEXP_BASE classname \ -{ \ -public: \ - classname(const chartype *str = NULL) \ - : m_str(str ? strdupfunc(str) : NULL) \ - { \ - } \ - \ - classname(size_t len) \ - : m_str((chartype *)malloc((len + 1)*sizeof(chartype))) \ - { \ - m_str[len] = (chartype)0; \ - } \ - \ - /* no need to check for NULL, free() does it */ \ - ~classname() { free(m_str); } \ - \ - /* \ - WARNING: \ - \ - the copy ctor and assignment operators change the passed in object \ - even although it is declared as "const", so: \ - \ - a) it shouldn't be really const \ - b) you shouldn't use it afterwards (or know that it was reset) \ - \ - This is very ugly but is unfortunately needed to make the normal use\ - of classname buffer objects possible and is very similar to what \ - std::auto_ptr<> does (as if it were an excuse...) \ - */ \ - \ - /* \ - because of the remark above, release() is declared const even if it \ - isn't really const \ - */ \ - chartype *release() const \ - { \ - chartype *p = m_str; \ - ((classname *)this)->m_str = NULL; \ - return p; \ - } \ - \ - void reset() \ - { \ - free(m_str); \ - m_str = NULL; \ - } \ - \ - classname(const classname& src) \ - : m_str(src.release()) \ - { \ - } \ - \ - classname& operator=(const chartype *str) \ - { \ - free(m_str); \ - m_str = str ? strdupfunc(str) : NULL; \ - return *this; \ - } \ - \ - classname& operator=(const classname& src) \ - { \ - free(m_str); \ - m_str = src.release(); \ - \ - return *this; \ - } \ - \ - bool extend(size_t len) \ - { \ - chartype * \ - str = (chartype *)realloc(m_str, (len + 1)*sizeof(chartype)); \ - if ( !str ) \ - return false; \ - \ - m_str = str; \ - \ - return true; \ - } \ - \ - chartype *data() { return m_str; } \ - const chartype *data() const { return m_str; } \ - operator const chartype *() const { return m_str; } \ - chartype operator[](size_t n) const { return m_str[n]; } \ - \ -private: \ - chartype *m_str; \ -} - -#if wxABI_VERSION >= 20804 -// needed for wxString::char_str() and wchar_str() -#define DEFINE_WRITABLE_BUFFER(classname, baseclass, chartype) \ -class WXDLLIMPEXP_BASE classname : public baseclass \ -{ \ -public: \ - classname(const baseclass& src) : baseclass(src) {} \ - classname(const chartype *str = NULL) : baseclass(str) {} \ - \ - operator chartype*() { return this->data(); } \ -} -#endif // wxABI_VERSION >= 20804 - -DEFINE_BUFFER(wxCharBuffer, char, wxStrdupA); -#if wxABI_VERSION >= 20804 -DEFINE_WRITABLE_BUFFER(wxWritableCharBuffer, wxCharBuffer, char); -#endif - -#if wxUSE_WCHAR_T - -DEFINE_BUFFER(wxWCharBuffer, wchar_t, wxStrdupW); -#if wxABI_VERSION >= 20804 -DEFINE_WRITABLE_BUFFER(wxWritableWCharBuffer, wxWCharBuffer, wchar_t); -#endif - -#endif // wxUSE_WCHAR_T - -#undef DEFINE_BUFFER -#undef DEFINE_WRITABLE_BUFFER - -#if wxUSE_UNICODE - typedef wxWCharBuffer wxWxCharBuffer; - - #define wxMB2WXbuf wxWCharBuffer - #define wxWX2MBbuf wxCharBuffer - #define wxWC2WXbuf wxChar* - #define wxWX2WCbuf wxChar* -#else // ANSI - typedef wxCharBuffer wxWxCharBuffer; - - #define wxMB2WXbuf wxChar* - #define wxWX2MBbuf wxChar* - #define wxWC2WXbuf wxCharBuffer - #define wxWX2WCbuf wxWCharBuffer -#endif // Unicode/ANSI - -// ---------------------------------------------------------------------------- -// A class for holding growable data buffers (not necessarily strings) -// ---------------------------------------------------------------------------- - -// This class manages the actual data buffer pointer and is ref-counted. -class wxMemoryBufferData -{ -public: - // the initial size and also the size added by ResizeIfNeeded() - enum { DefBufSize = 1024 }; - - friend class wxMemoryBuffer; - - // everyting is private as it can only be used by wxMemoryBuffer -private: - wxMemoryBufferData(size_t size = wxMemoryBufferData::DefBufSize) - : m_data(size ? malloc(size) : NULL), m_size(size), m_len(0), m_ref(0) - { - } - ~wxMemoryBufferData() { free(m_data); } - - - void ResizeIfNeeded(size_t newSize) - { - if (newSize > m_size) - { - void *dataOld = m_data; - m_data = realloc(m_data, newSize + wxMemoryBufferData::DefBufSize); - if ( !m_data ) - { - free(dataOld); - } - - m_size = newSize + wxMemoryBufferData::DefBufSize; - } - } - - void IncRef() { m_ref += 1; } - void DecRef() - { - m_ref -= 1; - if (m_ref == 0) // are there no more references? - delete this; - } - - - // the buffer containing the data - void *m_data; - - // the size of the buffer - size_t m_size; - - // the amount of data currently in the buffer - size_t m_len; - - // the reference count - size_t m_ref; - - DECLARE_NO_COPY_CLASS(wxMemoryBufferData) -}; - - -class wxMemoryBuffer -{ -public: - // ctor and dtor - wxMemoryBuffer(size_t size = wxMemoryBufferData::DefBufSize) - { - m_bufdata = new wxMemoryBufferData(size); - m_bufdata->IncRef(); - } - - ~wxMemoryBuffer() { m_bufdata->DecRef(); } - - - // copy and assignment - wxMemoryBuffer(const wxMemoryBuffer& src) - : m_bufdata(src.m_bufdata) - { - m_bufdata->IncRef(); - } - - wxMemoryBuffer& operator=(const wxMemoryBuffer& src) - { - m_bufdata->DecRef(); - m_bufdata = src.m_bufdata; - m_bufdata->IncRef(); - return *this; - } - - - // Accessors - void *GetData() const { return m_bufdata->m_data; } - size_t GetBufSize() const { return m_bufdata->m_size; } - size_t GetDataLen() const { return m_bufdata->m_len; } - - void SetBufSize(size_t size) { m_bufdata->ResizeIfNeeded(size); } - void SetDataLen(size_t len) - { - wxASSERT(len <= m_bufdata->m_size); - m_bufdata->m_len = len; - } - - // Ensure the buffer is big enough and return a pointer to it - void *GetWriteBuf(size_t sizeNeeded) - { - m_bufdata->ResizeIfNeeded(sizeNeeded); - return m_bufdata->m_data; - } - - // Update the length after the write - void UngetWriteBuf(size_t sizeUsed) { SetDataLen(sizeUsed); } - - // Like the above, but appends to the buffer - void *GetAppendBuf(size_t sizeNeeded) - { - m_bufdata->ResizeIfNeeded(m_bufdata->m_len + sizeNeeded); - return (char*)m_bufdata->m_data + m_bufdata->m_len; - } - - // Update the length after the append - void UngetAppendBuf(size_t sizeUsed) - { - SetDataLen(m_bufdata->m_len + sizeUsed); - } - - // Other ways to append to the buffer - void AppendByte(char data) - { - wxCHECK_RET( m_bufdata->m_data, wxT("invalid wxMemoryBuffer") ); - - m_bufdata->ResizeIfNeeded(m_bufdata->m_len + 1); - *(((char*)m_bufdata->m_data) + m_bufdata->m_len) = data; - m_bufdata->m_len += 1; - } - - void AppendData(const void *data, size_t len) - { - memcpy(GetAppendBuf(len), data, len); - UngetAppendBuf(len); - } - - operator const char *() const { return (const char*)GetData(); } - -private: - wxMemoryBufferData* m_bufdata; -}; - -// ---------------------------------------------------------------------------- -// template class for any kind of data -// ---------------------------------------------------------------------------- - -// TODO - -#endif // _WX_BUFFER_H diff --git a/wxWidgets/include/wx/build.h b/wxWidgets/include/wx/build.h deleted file mode 100644 index 989d5e611a..0000000000 --- a/wxWidgets/include/wx/build.h +++ /dev/null @@ -1,149 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: wx/build.h -// Purpose: Runtime build options checking -// Author: Vadim Zeitlin, Vaclav Slavik -// Modified by: -// Created: 07.05.02 -// RCS-ID: $Id: build.h 35858 2005-10-09 15:48:42Z MBN $ -// Copyright: (c) 2002 Vadim Zeitlin -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_BUILD_H_ -#define _WX_BUILD_H_ - -#include "wx/version.h" - -// NB: This file contains macros for checking binary compatibility of libraries -// in multilib buildm, plugins and user components. -// The WX_BUILD_OPTIONS_SIGNATURE macro expands into string that should -// uniquely identify binary compatible builds: i.e. if two builds of the -// library are binary compatible, their signature string should be the -// same; if two builds are binary incompatible, their signatures should -// be different. -// -// Therefore, wxUSE_XXX flags that affect binary compatibility (vtables, -// function signatures) should be accounted for here. So should compilers -// and compiler versions (but note that binary compatible compiler versions -// such as gcc-2.95.2 and gcc-2.95.3 should have same signature!). - -// ---------------------------------------------------------------------------- -// WX_BUILD_OPTIONS_SIGNATURE -// ---------------------------------------------------------------------------- - -#define __WX_BO_STRINGIZE(x) __WX_BO_STRINGIZE0(x) -#define __WX_BO_STRINGIZE0(x) #x - -#if (wxMINOR_VERSION % 2) == 0 - #define __WX_BO_VERSION(x,y,z) \ - __WX_BO_STRINGIZE(x) "." __WX_BO_STRINGIZE(y) -#else - #define __WX_BO_VERSION(x,y,z) \ - __WX_BO_STRINGIZE(x) "." __WX_BO_STRINGIZE(y) "." __WX_BO_STRINGIZE(z) -#endif - -#ifdef __WXDEBUG__ - #define __WX_BO_DEBUG "debug" -#else - #define __WX_BO_DEBUG "no debug" -#endif - -#if wxUSE_UNICODE - #define __WX_BO_UNICODE "Unicode" -#else - #define __WX_BO_UNICODE "ANSI" -#endif - -// GCC and Intel C++ share same C++ ABI (and possibly others in the future), -// check if compiler versions are compatible: -#if defined(__GXX_ABI_VERSION) - #define __WX_BO_COMPILER \ - ",compiler with C++ ABI " __WX_BO_STRINGIZE(__GXX_ABI_VERSION) -#elif defined(__INTEL_COMPILER) - #define __WX_BO_COMPILER ",Intel C++" -#elif defined(__GNUG__) - #define __WX_BO_COMPILER ",GCC " \ - __WX_BO_STRINGIZE(__GNUC__) "." __WX_BO_STRINGIZE(__GNUC_MINOR__) -#elif defined(__VISUALC__) - #define __WX_BO_COMPILER ",Visual C++" -#elif defined(__BORLANDC__) - #define __WX_BO_COMPILER ",Borland C++" -#elif defined(__DIGITALMARS__) - #define __WX_BO_COMPILER ",DigitalMars" -#elif defined(__WATCOMC__) - #define __WX_BO_COMPILER ",Watcom C++" -#else - #define __WX_BO_COMPILER -#endif - -// WXWIN_COMPATIBILITY macros affect presence of virtual functions -#if WXWIN_COMPATIBILITY_2_4 - #define __WX_BO_WXWIN_COMPAT_2_4 ",compatible with 2.4" -#else - #define __WX_BO_WXWIN_COMPAT_2_4 -#endif -#if WXWIN_COMPATIBILITY_2_6 - #define __WX_BO_WXWIN_COMPAT_2_6 ",compatible with 2.6" -#else - #define __WX_BO_WXWIN_COMPAT_2_6 -#endif - -// deriving wxWin containers from STL ones changes them completely: -#if wxUSE_STL - #define __WX_BO_STL ",STL containers" -#else - #define __WX_BO_STL ",wx containers" -#endif - -// This macro is passed as argument to wxConsoleApp::CheckBuildOptions() -#define WX_BUILD_OPTIONS_SIGNATURE \ - __WX_BO_VERSION(wxMAJOR_VERSION, wxMINOR_VERSION, wxRELEASE_NUMBER) \ - " (" __WX_BO_DEBUG "," __WX_BO_UNICODE \ - __WX_BO_COMPILER \ - __WX_BO_STL \ - __WX_BO_WXWIN_COMPAT_2_4 __WX_BO_WXWIN_COMPAT_2_6 \ - ")" - - -// ---------------------------------------------------------------------------- -// WX_CHECK_BUILD_OPTIONS -// ---------------------------------------------------------------------------- - -// Use this macro to check build options. Adding it to a file in DLL will -// ensure that the DLL checks build options in same way IMPLEMENT_APP() does. -#define WX_CHECK_BUILD_OPTIONS(libName) \ - static struct wxBuildOptionsChecker \ - { \ - wxBuildOptionsChecker() \ - { \ - wxAppConsole::CheckBuildOptions(WX_BUILD_OPTIONS_SIGNATURE, \ - libName); \ - } \ - } gs_buildOptionsCheck; - - -#if WXWIN_COMPATIBILITY_2_4 - -// ---------------------------------------------------------------------------- -// wxBuildOptions -// ---------------------------------------------------------------------------- - -// NB: Don't use this class in new code, it relies on the ctor being always -// inlined. WX_BUILD_OPTIONS_SIGNATURE always works. -class wxBuildOptions -{ -public: - // the ctor must be inline to get the compilation settings of the code - // which included this header - wxBuildOptions() : m_signature(WX_BUILD_OPTIONS_SIGNATURE) {} - -private: - const char *m_signature; - - // actually only CheckBuildOptions() should be our friend but well... - friend class wxAppConsole; -}; - -#endif // WXWIN_COMPATIBILITY_2_4 - -#endif // _WX_BUILD_H_ diff --git a/wxWidgets/include/wx/busyinfo.h b/wxWidgets/include/wx/busyinfo.h deleted file mode 100644 index ae63552870..0000000000 --- a/wxWidgets/include/wx/busyinfo.h +++ /dev/null @@ -1,21 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/busyinfo.h -// Purpose: Information window (when app is busy) -// Author: Vaclav Slavik -// Copyright: (c) 1999 Vaclav Slavik -// RCS-ID: $Id: busyinfo.h 37158 2006-01-26 15:40:46Z ABX $ -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef __BUSYINFO_H_BASE__ -#define __BUSYINFO_H_BASE__ - -#include "wx/defs.h" - -#if wxUSE_BUSYINFO - -#include "wx/generic/busyinfo.h" - -#endif // wxUSE_BUSYINFO - -#endif // __BUSYINFO_H_BASE__ diff --git a/wxWidgets/include/wx/button.h b/wxWidgets/include/wx/button.h deleted file mode 100644 index a4448f81f9..0000000000 --- a/wxWidgets/include/wx/button.h +++ /dev/null @@ -1,106 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/button.h -// Purpose: wxButtonBase class -// Author: Vadim Zetlin -// Modified by: -// Created: 15.08.00 -// RCS-ID: $Id: button.h 49563 2007-10-31 20:46:21Z VZ $ -// Copyright: (c) Vadim Zetlin -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_BUTTON_H_BASE_ -#define _WX_BUTTON_H_BASE_ - -#include "wx/defs.h" - -// ---------------------------------------------------------------------------- -// wxButton flags shared with other classes -// ---------------------------------------------------------------------------- - -#if wxUSE_TOGGLEBTN || wxUSE_BUTTON - -// These flags affect label alignment -#define wxBU_LEFT 0x0040 -#define wxBU_TOP 0x0080 -#define wxBU_RIGHT 0x0100 -#define wxBU_BOTTOM 0x0200 -#define wxBU_ALIGN_MASK ( wxBU_LEFT | wxBU_TOP | wxBU_RIGHT | wxBU_BOTTOM ) -#endif - -#if wxUSE_BUTTON - -// ---------------------------------------------------------------------------- -// wxButton specific flags -// ---------------------------------------------------------------------------- - -// These two flags are obsolete -#define wxBU_NOAUTODRAW 0x0000 -#define wxBU_AUTODRAW 0x0004 - -// by default, the buttons will be created with some (system dependent) -// minimal size to make them look nicer, giving this style will make them as -// small as possible -#define wxBU_EXACTFIT 0x0001 - -#include "wx/control.h" - -class WXDLLIMPEXP_FWD_CORE wxBitmap; - -extern WXDLLEXPORT_DATA(const wxChar) wxButtonNameStr[]; - -// ---------------------------------------------------------------------------- -// wxButton: a push button -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxButtonBase : public wxControl -{ -public: - wxButtonBase() { } - - // show the image in the button in addition to the label - virtual void SetImageLabel(const wxBitmap& WXUNUSED(bitmap)) { } - - // set the margins around the image - virtual void SetImageMargins(wxCoord WXUNUSED(x), wxCoord WXUNUSED(y)) { } - - // this wxButton method is called when the button becomes the default one - // on its panel - virtual void SetDefault() { } - - // Buttons on MSW can look bad if they are not native colours, because - // then they become owner-drawn and not theme-drawn. Disable it here - // in wxButtonBase to make it consistent. - virtual bool ShouldInheritColours() const { return false; } - - // returns the default button size for this platform - static wxSize GetDefaultSize(); - -protected: - DECLARE_NO_COPY_CLASS(wxButtonBase) -}; - -#if defined(__WXUNIVERSAL__) - #include "wx/univ/button.h" -#elif defined(__WXMSW__) - #include "wx/msw/button.h" -#elif defined(__WXMOTIF__) - #include "wx/motif/button.h" -#elif defined(__WXGTK20__) - #include "wx/gtk/button.h" -#elif defined(__WXGTK__) - #include "wx/gtk1/button.h" -#elif defined(__WXMAC__) - #include "wx/mac/button.h" -#elif defined(__WXCOCOA__) - #include "wx/cocoa/button.h" -#elif defined(__WXPM__) - #include "wx/os2/button.h" -#elif defined(__WXPALMOS__) - #include "wx/palmos/button.h" -#endif - -#endif // wxUSE_BUTTON - -#endif - // _WX_BUTTON_H_BASE_ diff --git a/wxWidgets/include/wx/calctrl.h b/wxWidgets/include/wx/calctrl.h deleted file mode 100644 index ace3b2262b..0000000000 --- a/wxWidgets/include/wx/calctrl.h +++ /dev/null @@ -1,232 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: wx/calctrl.h -// Purpose: date-picker control -// Author: Vadim Zeitlin -// Modified by: -// Created: 29.12.99 -// RCS-ID: $Id: calctrl.h 53135 2008-04-12 02:31:04Z VZ $ -// Copyright: (c) 1999 Vadim Zeitlin -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -/* - TODO - - 1. implement multiple selections for date ranges - 2. background bitmap for the calendar? - */ - -#ifndef _WX_CALCTRL_H_ -#define _WX_CALCTRL_H_ - -#include "wx/defs.h" - -#if wxUSE_CALENDARCTRL - -#include "wx/dateevt.h" -#include "wx/colour.h" -#include "wx/font.h" - -// ---------------------------------------------------------------------------- -// wxCalendarCtrl flags -// ---------------------------------------------------------------------------- - -enum -{ - // show Sunday as the first day of the week (default) - wxCAL_SUNDAY_FIRST = 0x0000, - - // show Monder as the first day of the week - wxCAL_MONDAY_FIRST = 0x0001, - - // highlight holidays - wxCAL_SHOW_HOLIDAYS = 0x0002, - - // disable the year change control, show only the month change one - wxCAL_NO_YEAR_CHANGE = 0x0004, - - // don't allow changing neither month nor year (implies - // wxCAL_NO_YEAR_CHANGE) - wxCAL_NO_MONTH_CHANGE = 0x000c, - - // use MS-style month-selection instead of combo-spin combination - wxCAL_SEQUENTIAL_MONTH_SELECTION = 0x0010, - - // show the neighbouring weeks in the previous and next month - wxCAL_SHOW_SURROUNDING_WEEKS = 0x0020 -}; - -// ---------------------------------------------------------------------------- -// constants -// ---------------------------------------------------------------------------- - -// return values for the HitTest() method -enum wxCalendarHitTestResult -{ - wxCAL_HITTEST_NOWHERE, // outside of anything - wxCAL_HITTEST_HEADER, // on the header (weekdays) - wxCAL_HITTEST_DAY, // on a day in the calendar - wxCAL_HITTEST_INCMONTH, - wxCAL_HITTEST_DECMONTH, - wxCAL_HITTEST_SURROUNDING_WEEK -}; - -// border types for a date -enum wxCalendarDateBorder -{ - wxCAL_BORDER_NONE, // no border (default) - wxCAL_BORDER_SQUARE, // a rectangular border - wxCAL_BORDER_ROUND // a round border -}; - -// ---------------------------------------------------------------------------- -// wxCalendarDateAttr: custom attributes for a calendar date -// ---------------------------------------------------------------------------- - -class WXDLLIMPEXP_ADV wxCalendarDateAttr -{ -#if !defined(__VISAGECPP__) -protected: - // This has to be before the use of Init(), for MSVC++ 1.5 - // But dorks up Visualage! - void Init(wxCalendarDateBorder border = wxCAL_BORDER_NONE) - { - m_border = border; - m_holiday = false; - } -#endif -public: - // ctors - wxCalendarDateAttr() { Init(); } - wxCalendarDateAttr(const wxColour& colText, - const wxColour& colBack = wxNullColour, - const wxColour& colBorder = wxNullColour, - const wxFont& font = wxNullFont, - wxCalendarDateBorder border = wxCAL_BORDER_NONE) - : m_colText(colText), m_colBack(colBack), - m_colBorder(colBorder), m_font(font) - { - Init(border); - } - wxCalendarDateAttr(wxCalendarDateBorder border, - const wxColour& colBorder = wxNullColour) - : m_colBorder(colBorder) - { - Init(border); - } - - // setters - void SetTextColour(const wxColour& colText) { m_colText = colText; } - void SetBackgroundColour(const wxColour& colBack) { m_colBack = colBack; } - void SetBorderColour(const wxColour& col) { m_colBorder = col; } - void SetFont(const wxFont& font) { m_font = font; } - void SetBorder(wxCalendarDateBorder border) { m_border = border; } - void SetHoliday(bool holiday) { m_holiday = holiday; } - - // accessors - bool HasTextColour() const { return m_colText.Ok(); } - bool HasBackgroundColour() const { return m_colBack.Ok(); } - bool HasBorderColour() const { return m_colBorder.Ok(); } - bool HasFont() const { return m_font.Ok(); } - bool HasBorder() const { return m_border != wxCAL_BORDER_NONE; } - - bool IsHoliday() const { return m_holiday; } - - const wxColour& GetTextColour() const { return m_colText; } - const wxColour& GetBackgroundColour() const { return m_colBack; } - const wxColour& GetBorderColour() const { return m_colBorder; } - const wxFont& GetFont() const { return m_font; } - wxCalendarDateBorder GetBorder() const { return m_border; } -#if defined(__VISAGECPP__) -protected: - // This has to be here for VisualAge - void Init(wxCalendarDateBorder border = wxCAL_BORDER_NONE) - { - m_border = border; - m_holiday = false; - } -#endif -private: - wxColour m_colText, - m_colBack, - m_colBorder; - wxFont m_font; - wxCalendarDateBorder m_border; - bool m_holiday; -}; - -// ---------------------------------------------------------------------------- -// wxCalendarCtrl events -// ---------------------------------------------------------------------------- - -class WXDLLIMPEXP_FWD_ADV wxCalendarCtrl; - -class WXDLLIMPEXP_ADV wxCalendarEvent : public wxDateEvent -{ -friend class wxCalendarCtrl; -public: - wxCalendarEvent() { Init(); } - inline wxCalendarEvent(wxCalendarCtrl *cal, wxEventType type); - - void SetWeekDay(const wxDateTime::WeekDay wd) { m_wday = wd; } - wxDateTime::WeekDay GetWeekDay() const { return m_wday; } - -protected: - void Init() - { - m_wday = wxDateTime::Inv_WeekDay; - } - -private: - wxDateTime::WeekDay m_wday; - - DECLARE_DYNAMIC_CLASS_NO_COPY(wxCalendarEvent) -}; - -// ---------------------------------------------------------------------------- -// wxCalendarCtrl -// ---------------------------------------------------------------------------- - -// so far we only have a generic version, so keep it simple -#include "wx/generic/calctrl.h" - - -// now we can define the inline ctor using wxCalendarCtrl -inline -wxCalendarEvent::wxCalendarEvent(wxCalendarCtrl *cal, wxEventType type) - : wxDateEvent(cal, cal->GetDate(), type) -{ -} - -// ---------------------------------------------------------------------------- -// calendar event types and macros for handling them -// ---------------------------------------------------------------------------- - -BEGIN_DECLARE_EVENT_TYPES() - DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_ADV, wxEVT_CALENDAR_SEL_CHANGED, 950) - DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_ADV, wxEVT_CALENDAR_DAY_CHANGED, 951) - DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_ADV, wxEVT_CALENDAR_MONTH_CHANGED, 952) - DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_ADV, wxEVT_CALENDAR_YEAR_CHANGED, 953) - DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_ADV, wxEVT_CALENDAR_DOUBLECLICKED, 954) - DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_ADV, wxEVT_CALENDAR_WEEKDAY_CLICKED, 955) -END_DECLARE_EVENT_TYPES() - -typedef void (wxEvtHandler::*wxCalendarEventFunction)(wxCalendarEvent&); - -#define wxCalendarEventHandler(func) \ - (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxCalendarEventFunction, &func) - -#define wx__DECLARE_CALEVT(evt, id, fn) \ - wx__DECLARE_EVT1(wxEVT_CALENDAR_ ## evt, id, wxCalendarEventHandler(fn)) - -#define EVT_CALENDAR(id, fn) wx__DECLARE_CALEVT(DOUBLECLICKED, id, fn) -#define EVT_CALENDAR_SEL_CHANGED(id, fn) wx__DECLARE_CALEVT(SEL_CHANGED, id, fn) -#define EVT_CALENDAR_DAY(id, fn) wx__DECLARE_CALEVT(DAY_CHANGED, id, fn) -#define EVT_CALENDAR_MONTH(id, fn) wx__DECLARE_CALEVT(MONTH_CHANGED, id, fn) -#define EVT_CALENDAR_YEAR(id, fn) wx__DECLARE_CALEVT(YEAR_CHANGED, id, fn) -#define EVT_CALENDAR_WEEKDAY_CLICKED(id, fn) wx__DECLARE_CALEVT(WEEKDAY_CLICKED, id, fn) - -#endif // wxUSE_CALENDARCTRL - -#endif // _WX_CALCTRL_H_ - diff --git a/wxWidgets/include/wx/caret.h b/wxWidgets/include/wx/caret.h deleted file mode 100644 index 25b606699c..0000000000 --- a/wxWidgets/include/wx/caret.h +++ /dev/null @@ -1,252 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: wx/caret.h -// Purpose: wxCaretBase class - the interface of wxCaret -// Author: Vadim Zeitlin -// Modified by: -// Created: 23.05.99 -// RCS-ID: $Id: caret.h 49804 2007-11-10 01:09:42Z VZ $ -// Copyright: (c) wxWidgets team -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_CARET_H_BASE_ -#define _WX_CARET_H_BASE_ - -#include "wx/defs.h" - -#if wxUSE_CARET - -// --------------------------------------------------------------------------- -// forward declarations -// --------------------------------------------------------------------------- - -class WXDLLIMPEXP_FWD_CORE wxWindow; -class WXDLLIMPEXP_FWD_CORE wxWindowBase; - -// ---------------------------------------------------------------------------- -// headers we have to include -// ---------------------------------------------------------------------------- - -#include "wx/gdicmn.h" // for wxPoint, wxSize - -// ---------------------------------------------------------------------------- -// A caret is a blinking cursor showing the position where the typed text will -// appear. It can be either a solid block or a custom bitmap (TODO) -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxCaretBase -{ -public: - // ctors - // ----- - // default - use Create - wxCaretBase() { Init(); } - // create the caret of given (in pixels) width and height and associate - // with the given window - wxCaretBase(wxWindowBase *window, int width, int height) - { - Init(); - - (void)Create(window, width, height); - } - // same as above - wxCaretBase(wxWindowBase *window, const wxSize& size) - { - Init(); - - (void)Create(window, size); - } - - // a virtual dtor has been provided since this class has virtual members - virtual ~wxCaretBase() { } - - // Create() functions - same as ctor but returns the success code - // -------------------------------------------------------------- - - // same as ctor - bool Create(wxWindowBase *window, int width, int height) - { return DoCreate(window, width, height); } - // same as ctor - bool Create(wxWindowBase *window, const wxSize& size) - { return DoCreate(window, size.x, size.y); } - - // accessors - // --------- - - // is the caret valid? - bool IsOk() const { return m_width != 0 && m_height != 0; } - - // is the caret currently shown? - bool IsVisible() const { return m_countVisible > 0; } - - // get the caret position - void GetPosition(int *x, int *y) const - { - if ( x ) *x = m_x; - if ( y ) *y = m_y; - } - wxPoint GetPosition() const { return wxPoint(m_x, m_y); } - - // get the caret size - void GetSize(int *width, int *height) const - { - if ( width ) *width = m_width; - if ( height ) *height = m_height; - } - wxSize GetSize() const { return wxSize(m_width, m_height); } - - // get the window we're associated with - wxWindow *GetWindow() const { return (wxWindow *)m_window; } - - // change the size of the caret - void SetSize(int width, int height) { - m_width = width; - m_height = height; - DoSize(); - } - void SetSize(const wxSize& size) { SetSize(size.x, size.y); } - - - // operations - // ---------- - - // move the caret to given position (in logical coords) - void Move(int x, int y) { m_x = x; m_y = y; DoMove(); } - void Move(const wxPoint& pt) { m_x = pt.x; m_y = pt.y; DoMove(); } - - // show/hide the caret (should be called by wxWindow when needed): - // Show() must be called as many times as Hide() + 1 to make the caret - // visible - virtual void Show(bool show = true) - { - if ( show ) - { - if ( m_countVisible++ == 0 ) - DoShow(); - } - else - { - if ( --m_countVisible == 0 ) - DoHide(); - } - } - virtual void Hide() { Show(false); } - - // blink time is measured in milliseconds and is the time elapsed - // between 2 inversions of the caret (blink time of the caret is common - // to all carets in the Universe, so these functions are static) - static int GetBlinkTime(); - static void SetBlinkTime(int milliseconds); - - // implementation from now on - // -------------------------- - - // these functions should be called by wxWindow when the window gets/loses - // the focus - we create/show and hide/destroy the caret here - virtual void OnSetFocus() { } - virtual void OnKillFocus() { } - -protected: - // these functions may be overriden in the derived classes, but they - // should call the base class version first - virtual bool DoCreate(wxWindowBase *window, int width, int height) - { - m_window = window; - m_width = width; - m_height = height; - - return true; - } - - // pure virtuals to implement in the derived class - virtual void DoShow() = 0; - virtual void DoHide() = 0; - virtual void DoMove() = 0; - virtual void DoSize() { } - - // the common initialization - void Init() - { - m_window = (wxWindowBase *)NULL; - m_x = m_y = 0; - m_width = m_height = 0; - m_countVisible = 0; - } - - // the size of the caret - int m_width, m_height; - - // the position of the caret - int m_x, m_y; - - // the window we're associated with - wxWindowBase *m_window; - - // visibility count: the caret is visible only if it's positive - int m_countVisible; - -private: - DECLARE_NO_COPY_CLASS(wxCaretBase) -}; - -// --------------------------------------------------------------------------- -// now include the real thing -// --------------------------------------------------------------------------- - -#if defined(__WXMSW__) - #include "wx/msw/caret.h" -#else - #include "wx/generic/caret.h" -#endif // platform - -// ---------------------------------------------------------------------------- -// wxCaretSuspend: a simple class which hides the caret in its ctor and -// restores it in the dtor, this should be used when drawing on the screen to -// avoid overdrawing the caret -// ---------------------------------------------------------------------------- - -#ifdef wxHAS_CARET_USING_OVERLAYS - -// we don't need to hide the caret if it's rendered using overlays -class WXDLLEXPORT wxCaretSuspend -{ -public: - wxCaretSuspend(wxWindow *WXUNUSED(win)) {} - - DECLARE_NO_COPY_CLASS(wxCaretSuspend) -}; - -#else // !wxHAS_CARET_USING_OVERLAYS - -class WXDLLEXPORT wxCaretSuspend -{ -public: - wxCaretSuspend(wxWindow *win) - { - m_caret = win->GetCaret(); - m_show = false; - if ( m_caret && m_caret->IsVisible() ) - { - m_caret->Hide(); - m_show = true; - } - } - - ~wxCaretSuspend() - { - if ( m_caret && m_show ) - m_caret->Show(); - } - -private: - wxCaret *m_caret; - bool m_show; - - DECLARE_NO_COPY_CLASS(wxCaretSuspend) -}; - -#endif // wxHAS_CARET_USING_OVERLAYS/!wxHAS_CARET_USING_OVERLAYS - -#endif // wxUSE_CARET - -#endif // _WX_CARET_H_BASE_ diff --git a/wxWidgets/include/wx/checkbox.h b/wxWidgets/include/wx/checkbox.h deleted file mode 100644 index 3d76b4a195..0000000000 --- a/wxWidgets/include/wx/checkbox.h +++ /dev/null @@ -1,156 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: wx/checkbox.h -// Purpose: wxCheckBox class interface -// Author: Vadim Zeitlin -// Modified by: -// Created: 07.09.00 -// RCS-ID: $Id: checkbox.h 39901 2006-06-30 10:51:44Z VS $ -// Copyright: (c) wxWidgets team -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_CHECKBOX_H_BASE_ -#define _WX_CHECKBOX_H_BASE_ - -#include "wx/defs.h" - -#if wxUSE_CHECKBOX - -#include "wx/control.h" - - -/* - * wxCheckBox style flags - * (Using wxCHK_* because wxCB_* is used by wxComboBox). - * Determine whether to use a 3-state or 2-state - * checkbox. 3-state enables to differentiate - * between 'unchecked', 'checked' and 'undetermined'. - */ -#define wxCHK_2STATE 0x0000 -#define wxCHK_3STATE 0x1000 - -/* - * If this style is set the user can set the checkbox to the - * undetermined state. If not set the undetermined set can only - * be set programmatically. - * This style can only be used with 3 state checkboxes. - */ -#define wxCHK_ALLOW_3RD_STATE_FOR_USER 0x2000 - -/* - * The possible states of a 3-state checkbox (Compatible - * with the 2-state checkbox). - */ -enum wxCheckBoxState -{ - wxCHK_UNCHECKED, - wxCHK_CHECKED, - wxCHK_UNDETERMINED /* 3-state checkbox only */ -}; - - -extern WXDLLEXPORT_DATA(const wxChar) wxCheckBoxNameStr[]; - -// ---------------------------------------------------------------------------- -// wxCheckBox: a control which shows a label and a box which may be checked -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxCheckBoxBase : public wxControl -{ -public: - wxCheckBoxBase() { } - - // set/get the checked status of the listbox - virtual void SetValue(bool value) = 0; - virtual bool GetValue() const = 0; - - bool IsChecked() const - { - wxASSERT_MSG( !Is3State(), wxT("Calling IsChecked() doesn't make sense for") - wxT(" a three state checkbox, Use Get3StateValue() instead") ); - - return GetValue(); - } - - wxCheckBoxState Get3StateValue() const - { - wxCheckBoxState state = DoGet3StateValue(); - - if ( state == wxCHK_UNDETERMINED && !Is3State() ) - { - // Undetermined state with a 2-state checkbox?? - wxFAIL_MSG( wxT("DoGet3StateValue() says the 2-state checkbox is ") - wxT("in an undetermined/third state") ); - - state = wxCHK_UNCHECKED; - } - - return state; - } - - void Set3StateValue(wxCheckBoxState state) - { - if ( state == wxCHK_UNDETERMINED && !Is3State() ) - { - wxFAIL_MSG(wxT("Setting a 2-state checkbox to undetermined state")); - state = wxCHK_UNCHECKED; - } - - DoSet3StateValue(state); - } - - bool Is3State() const { return HasFlag(wxCHK_3STATE); } - - bool Is3rdStateAllowedForUser() const - { - return HasFlag(wxCHK_ALLOW_3RD_STATE_FOR_USER); - } - - virtual bool HasTransparentBackground() { return true; } - - // wxCheckBox-specific processing after processing the update event - virtual void DoUpdateWindowUI(wxUpdateUIEvent& event) - { - wxControl::DoUpdateWindowUI(event); - - if ( event.GetSetChecked() ) - SetValue(event.GetChecked()); - } - -protected: - virtual void DoSet3StateValue(wxCheckBoxState WXUNUSED(state)) { wxFAIL; } - - virtual wxCheckBoxState DoGet3StateValue() const - { - wxFAIL; - return wxCHK_UNCHECKED; - } - -private: - DECLARE_NO_COPY_CLASS(wxCheckBoxBase) -}; - -#if defined(__WXUNIVERSAL__) - #include "wx/univ/checkbox.h" -#elif defined(__WXMSW__) - #include "wx/msw/checkbox.h" -#elif defined(__WXMOTIF__) - #include "wx/motif/checkbox.h" -#elif defined(__WXGTK20__) - #include "wx/gtk/checkbox.h" -#elif defined(__WXGTK__) - #include "wx/gtk1/checkbox.h" -#elif defined(__WXMAC__) - #include "wx/mac/checkbox.h" -#elif defined(__WXCOCOA__) - #include "wx/cocoa/checkbox.h" -#elif defined(__WXPM__) - #include "wx/os2/checkbox.h" -#elif defined(__WXPALMOS__) - #include "wx/palmos/checkbox.h" -#endif - -#endif // wxUSE_CHECKBOX - -#endif - // _WX_CHECKBOX_H_BASE_ diff --git a/wxWidgets/include/wx/checklst.h b/wxWidgets/include/wx/checklst.h deleted file mode 100644 index b83c8536f5..0000000000 --- a/wxWidgets/include/wx/checklst.h +++ /dev/null @@ -1,64 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: wx/checklst.h -// Purpose: wxCheckListBox class interface -// Author: Vadim Zeitlin -// Modified by: -// Created: 12.09.00 -// RCS-ID: $Id: checklst.h 38319 2006-03-23 22:05:23Z VZ $ -// Copyright: (c) Vadim Zeitlin -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_CHECKLST_H_BASE_ -#define _WX_CHECKLST_H_BASE_ - -#if wxUSE_CHECKLISTBOX - -#include "wx/listbox.h" - -// ---------------------------------------------------------------------------- -// wxCheckListBox: a listbox whose items may be checked -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxCheckListBoxBase : public - #ifdef __WXWINCE__ - // keep virtuals synchronised - wxListBoxBase - #else - wxListBox - #endif -{ -public: - wxCheckListBoxBase() { } - - // check list box specific methods - virtual bool IsChecked(unsigned int item) const = 0; - virtual void Check(unsigned int item, bool check = true) = 0; - - DECLARE_NO_COPY_CLASS(wxCheckListBoxBase) -}; - -#if defined(__WXUNIVERSAL__) - #include "wx/univ/checklst.h" -#elif defined(__WXWINCE__) - #include "wx/msw/wince/checklst.h" -#elif defined(__WXMSW__) - #include "wx/msw/checklst.h" -#elif defined(__WXMOTIF__) - #include "wx/motif/checklst.h" -#elif defined(__WXGTK20__) - #include "wx/gtk/checklst.h" -#elif defined(__WXGTK__) - #include "wx/gtk1/checklst.h" -#elif defined(__WXMAC__) - #include "wx/mac/checklst.h" -#elif defined(__WXCOCOA__) - #include "wx/cocoa/checklst.h" -#elif defined(__WXPM__) - #include "wx/os2/checklst.h" -#endif - -#endif // wxUSE_CHECKLISTBOX - -#endif - // _WX_CHECKLST_H_BASE_ diff --git a/wxWidgets/include/wx/chkconf.h b/wxWidgets/include/wx/chkconf.h deleted file mode 100644 index e0717b9d58..0000000000 --- a/wxWidgets/include/wx/chkconf.h +++ /dev/null @@ -1,1871 +0,0 @@ -/* - * Name: wx/chkconf.h - * Purpose: check the config settings for consistency - * Author: Vadim Zeitlin - * Modified by: - * Created: 09.08.00 - * RCS-ID: $Id: chkconf.h 48113 2007-08-15 17:43:50Z DE $ - * Copyright: (c) 2000 Vadim Zeitlin - * Licence: wxWindows licence - */ - -/* THIS IS A C FILE, DON'T USE C++ FEATURES (IN PARTICULAR COMMENTS) IN IT */ - -/* - Platform-specific checking. - */ - -#if defined(__WXPALMOS__) -# include "wx/palmos/chkconf.h" -#elif defined(__WXWINCE__) -# include "wx/msw/wince/chkconf.h" -#elif defined(__WXMSW__) -# include "wx/msw/chkconf.h" -#elif defined(__WXMAC__) -# include "wx/mac/chkconf.h" -#elif defined(__OS2__) -# include "wx/os2/chkconf.h" -#elif defined(__WXMGL__) -# include "wx/mgl/chkconf.h" -#elif defined(__WXDFB__) -# include "wx/dfb/chkconf.h" -#elif defined(__WXMOTIF__) -# include "wx/motif/chkconf.h" -#elif defined(__WXX11__) -# include "wx/x11/chkconf.h" -#endif - -#ifdef __WXUNIVERSAL__ -# include "wx/univ/chkconf.h" -#endif - -/* - this global setting determines what should we do if the setting FOO - requires BAR and BAR is not set: we can either silently unset FOO as well - (do this if you're trying to build the smallest possible library) or give an - error and abort (default as leads to least surprizing behaviour) - */ -#define wxABORT_ON_CONFIG_ERROR - -/* - global features - */ - -/* GUI build by default */ -#if !defined(wxUSE_GUI) -# define wxUSE_GUI 1 -#endif /* !defined(wxUSE_GUI) */ - -/* Turn off wxUSE_ABI_INCOMPATIBLE_FEATURES if not specified. */ -#if !defined(wxUSE_ABI_INCOMPATIBLE_FEATURES) -# define wxUSE_ABI_INCOMPATIBLE_FEATURES 0 -#endif /* !defined(wxUSE_ABI_INCOMPATIBLE_FEATURES) */ - -/* - If we're compiling without support for threads/exceptions we have to - disable the corresponding features. - */ -#ifdef wxNO_THREADS -# undef wxUSE_THREADS -# define wxUSE_THREADS 0 -#endif /* wxNO_THREADS */ - -#ifdef wxNO_EXCEPTIONS -# undef wxUSE_EXCEPTIONS -# define wxUSE_EXCEPTIONS 0 -#endif /* wxNO_EXCEPTIONS */ - -/* we also must disable exceptions if compiler doesn't support them */ -#if defined(_MSC_VER) && !defined(_CPPUNWIND) -# undef wxUSE_EXCEPTIONS -# define wxUSE_EXCEPTIONS 0 -#endif /* VC++ without exceptions support */ - - -/* - tests for non GUI features - - please keep the options in alphabetical order! - */ - -#ifndef wxUSE_CRASHREPORT - /* this one is special: as currently it is Windows-only, don't force it - to be defined on other platforms */ -# if defined(wxABORT_ON_CONFIG_ERROR) && defined(__WXMSW__) -# error "wxUSE_CRASHREPORT must be defined." -# else -# define wxUSE_CRASHREPORT 0 -# endif -#endif /* !defined(wxUSE_CRASHREPORT) */ - -#ifndef wxUSE_DYNLIB_CLASS -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxUSE_DYNLIB_CLASS must be defined." -# else -# define wxUSE_DYNLIB_CLASS 0 -# endif -#endif /* !defined(wxUSE_DYNLIB_CLASS) */ - -#ifndef wxUSE_EXCEPTIONS -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxUSE_EXCEPTIONS must be defined." -# else -# define wxUSE_EXCEPTIONS 0 -# endif -#endif /* !defined(wxUSE_EXCEPTIONS) */ - -#ifndef wxUSE_FILESYSTEM -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxUSE_FILESYSTEM must be defined." -# else -# define wxUSE_FILESYSTEM 0 -# endif -#endif /* !defined(wxUSE_FILESYSTEM) */ - -#ifndef wxUSE_FS_ARCHIVE -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxUSE_FS_ARCHIVE must be defined." -# else -# define wxUSE_FS_ARCHIVE 0 -# endif -#endif /* !defined(wxUSE_FS_ARCHIVE) */ - -/* don't give an error about this one yet, it's not fully implemented */ -#ifndef wxUSE_FSVOLUME -# define wxUSE_FSVOLUME 0 -#endif /* !defined(wxUSE_FSVOLUME) */ - -#ifndef wxUSE_DYNAMIC_LOADER -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxUSE_DYNAMIC_LOADER must be defined." -# else -# define wxUSE_DYNAMIC_LOADER 0 -# endif -#endif /* !defined(wxUSE_DYNAMIC_LOADER) */ - -#ifndef wxUSE_LOG -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxUSE_LOG must be defined." -# else -# define wxUSE_LOG 0 -# endif -#endif /* !defined(wxUSE_LOG) */ - -#ifndef wxUSE_LONGLONG -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxUSE_LONGLONG must be defined." -# else -# define wxUSE_LONGLONG 0 -# endif -#endif /* !defined(wxUSE_LONGLONG) */ - -#ifndef wxUSE_MIMETYPE -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxUSE_MIMETYPE must be defined." -# else -# define wxUSE_MIMETYPE 0 -# endif -#endif /* !defined(wxUSE_MIMETYPE) */ - -#ifndef wxUSE_ON_FATAL_EXCEPTION -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxUSE_ON_FATAL_EXCEPTION must be defined." -# else -# define wxUSE_ON_FATAL_EXCEPTION 0 -# endif -#endif /* !defined(wxUSE_ON_FATAL_EXCEPTION) */ - -#ifndef wxUSE_PRINTF_POS_PARAMS -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxUSE_PRINTF_POS_PARAMS must be defined." -# else -# define wxUSE_PRINTF_POS_PARAMS 0 -# endif -#endif /* !defined(wxUSE_PRINTF_POS_PARAMS) */ - -#ifndef wxUSE_PROTOCOL -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxUSE_PROTOCOL must be defined." -# else -# define wxUSE_PROTOCOL 0 -# endif -#endif /* !defined(wxUSE_PROTOCOL) */ - -/* we may not define wxUSE_PROTOCOL_XXX if wxUSE_PROTOCOL is set to 0 */ -#if !wxUSE_PROTOCOL -# undef wxUSE_PROTOCOL_HTTP -# undef wxUSE_PROTOCOL_FTP -# undef wxUSE_PROTOCOL_FILE -# define wxUSE_PROTOCOL_HTTP 0 -# define wxUSE_PROTOCOL_FTP 0 -# define wxUSE_PROTOCOL_FILE 0 -#endif /* wxUSE_PROTOCOL */ - -#ifndef wxUSE_PROTOCOL_HTTP -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxUSE_PROTOCOL_HTTP must be defined." -# else -# define wxUSE_PROTOCOL_HTTP 0 -# endif -#endif /* !defined(wxUSE_PROTOCOL_HTTP) */ - -#ifndef wxUSE_PROTOCOL_FTP -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxUSE_PROTOCOL_FTP must be defined." -# else -# define wxUSE_PROTOCOL_FTP 0 -# endif -#endif /* !defined(wxUSE_PROTOCOL_FTP) */ - -#ifndef wxUSE_PROTOCOL_FILE -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxUSE_PROTOCOL_FILE must be defined." -# else -# define wxUSE_PROTOCOL_FILE 0 -# endif -#endif /* !defined(wxUSE_PROTOCOL_FILE) */ - -#ifndef wxUSE_REGEX -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxUSE_REGEX must be defined." -# else -# define wxUSE_REGEX 0 -# endif -#endif /* !defined(wxUSE_REGEX) */ - -#ifndef wxUSE_STDPATHS -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxUSE_STDPATHS must be defined." -# else -# define wxUSE_STDPATHS 1 -# endif -#endif /* !defined(wxUSE_STDPATHS) */ - -#ifndef wxUSE_XML -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxUSE_XML must be defined." -# else -# define wxUSE_XML 0 -# endif -#endif /* !defined(wxUSE_XML) */ - -#ifndef wxUSE_SOCKETS -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxUSE_SOCKETS must be defined." -# else -# define wxUSE_SOCKETS 0 -# endif -#endif /* !defined(wxUSE_SOCKETS) */ - -#ifndef wxUSE_STREAMS -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxUSE_STREAMS must be defined." -# else -# define wxUSE_STREAMS 0 -# endif -#endif /* !defined(wxUSE_STREAMS) */ - -#ifndef wxUSE_STOPWATCH -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxUSE_STOPWATCH must be defined." -# else -# define wxUSE_STOPWATCH 0 -# endif -#endif /* !defined(wxUSE_STOPWATCH) */ - -#ifndef wxUSE_TEXTBUFFER -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxUSE_TEXTBUFFER must be defined." -# else -# define wxUSE_TEXTBUFFER 0 -# endif -#endif /* !defined(wxUSE_TEXTBUFFER) */ - -#ifndef wxUSE_TEXTFILE -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxUSE_TEXTFILE must be defined." -# else -# define wxUSE_TEXTFILE 0 -# endif -#endif /* !defined(wxUSE_TEXTFILE) */ - -#ifndef wxUSE_UNICODE -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxUSE_UNICODE must be defined." -# else -# define wxUSE_UNICODE 0 -# endif -#endif /* !defined(wxUSE_UNICODE) */ - -#ifndef wxUSE_URL -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxUSE_URL must be defined." -# else -# define wxUSE_URL 0 -# endif -#endif /* !defined(wxUSE_URL) */ - -#ifndef wxUSE_VARIANT -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxUSE_VARIANT must be defined." -# else -# define wxUSE_VARIANT 0 -# endif -#endif /* wxUSE_VARIANT */ - -/* - all these tests are for GUI only - - please keep the options in alphabetical order! - */ -#if wxUSE_GUI - -/* - all of the settings tested below must be defined or we'd get an error from - preprocessor about invalid integer expression - */ - -#ifndef wxUSE_ABOUTDLG -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxUSE_ABOUTDLG must be defined." -# else -# define wxUSE_ABOUTDLG 0 -# endif -#endif /* !defined(wxUSE_ABOUTDLG) */ - -#ifndef wxUSE_ACCEL -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxUSE_ACCEL must be defined." -# else -# define wxUSE_ACCEL 0 -# endif -#endif /* !defined(wxUSE_ACCEL) */ - -#ifndef wxUSE_ANIMATIONCTRL -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxUSE_ANIMATIONCTRL must be defined." -# else -# define wxUSE_ANIMATIONCTRL 0 -# endif -#endif /* !defined(wxUSE_ANIMATIONCTRL) */ - -#ifndef wxUSE_BITMAPCOMBOBOX -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxUSE_BITMAPCOMBOBOX must be defined." -# else -# define wxUSE_BITMAPCOMBOBOX 0 -# endif -#endif /* !defined(wxUSE_BITMAPCOMBOBOX) */ - -#ifndef wxUSE_BMPBUTTON -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxUSE_BMPBUTTON must be defined." -# else -# define wxUSE_BMPBUTTON 0 -# endif -#endif /* !defined(wxUSE_BMPBUTTON) */ - -#ifndef wxUSE_BUTTON -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxUSE_BUTTON must be defined." -# else -# define wxUSE_BUTTON 0 -# endif -#endif /* !defined(wxUSE_BUTTON) */ - -#ifndef wxUSE_CALENDARCTRL -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxUSE_CALENDARCTRL must be defined." -# else -# define wxUSE_CALENDARCTRL 0 -# endif -#endif /* !defined(wxUSE_CALENDARCTRL) */ - -#ifndef wxUSE_CARET -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxUSE_CARET must be defined." -# else -# define wxUSE_CARET 0 -# endif -#endif /* !defined(wxUSE_CARET) */ - -#ifndef wxUSE_CHECKBOX -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxUSE_CHECKBOX must be defined." -# else -# define wxUSE_CHECKBOX 0 -# endif -#endif /* !defined(wxUSE_CHECKBOX) */ - -#ifndef wxUSE_CHECKLISTBOX -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxUSE_CHECKLISTBOX must be defined." -# else -# define wxUSE_CHECKLISTBOX 0 -# endif -#endif /* !defined(wxUSE_CHECKLISTBOX) */ - -#ifndef wxUSE_CHOICE -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxUSE_CHOICE must be defined." -# else -# define wxUSE_CHOICE 0 -# endif -#endif /* !defined(wxUSE_CHOICE) */ - -#ifndef wxUSE_CHOICEBOOK -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxUSE_CHOICEBOOK must be defined." -# else -# define wxUSE_CHOICEBOOK 0 -# endif -#endif /* !defined(wxUSE_CHOICEBOOK) */ - -#ifndef wxUSE_CHOICEDLG -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxUSE_CHOICEDLG must be defined." -# else -# define wxUSE_CHOICEDLG 0 -# endif -#endif /* !defined(wxUSE_CHOICEDLG) */ - -#ifndef wxUSE_CLIPBOARD -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxUSE_CLIPBOARD must be defined." -# else -# define wxUSE_CLIPBOARD 0 -# endif -#endif /* !defined(wxUSE_CLIPBOARD) */ - -#ifndef wxUSE_COLLPANE -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxUSE_COLLPANE must be defined." -# else -# define wxUSE_COLLPANE 0 -# endif -#endif /* !defined(wxUSE_COLLPANE) */ - -#ifndef wxUSE_COLOURDLG -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxUSE_COLOURDLG must be defined." -# else -# define wxUSE_COLOURDLG 0 -# endif -#endif /* !defined(wxUSE_COLOURDLG) */ - -#ifndef wxUSE_COLOURPICKERCTRL -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxUSE_COLOURPICKERCTRL must be defined." -# else -# define wxUSE_COLOURPICKERCTRL 0 -# endif -#endif /* !defined(wxUSE_COLOURPICKERCTRL) */ - -#ifndef wxUSE_COMBOBOX -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxUSE_COMBOBOX must be defined." -# else -# define wxUSE_COMBOBOX 0 -# endif -#endif /* !defined(wxUSE_COMBOBOX) */ - -#ifndef wxUSE_COMBOCTRL -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxUSE_COMBOCTRL must be defined." -# else -# define wxUSE_COMBOCTRL 0 -# endif -#endif /* !defined(wxUSE_COMBOCTRL) */ - -#ifndef wxUSE_DATAOBJ -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxUSE_DATAOBJ must be defined." -# else -# define wxUSE_DATAOBJ 0 -# endif -#endif /* !defined(wxUSE_DATAOBJ) */ - -#ifndef wxUSE_DATAVIEWCTRL -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxUSE_DATAVIEWCTRL must be defined." -# else -# define wxUSE_DATAVIEWCTRL 0 -# endif -#endif /* !defined(wxUSE_DATAVIEWCTRL) */ - -#ifndef wxUSE_DATEPICKCTRL -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxUSE_DATEPICKCTRL must be defined." -# else -# define wxUSE_DATEPICKCTRL 0 -# endif -#endif /* !defined(wxUSE_DATEPICKCTRL) */ - -#ifndef wxUSE_DIRPICKERCTRL -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxUSE_DIRPICKERCTRL must be defined." -# else -# define wxUSE_DIRPICKERCTRL 0 -# endif -#endif /* !defined(wxUSE_DIRPICKERCTRL) */ - -#ifndef wxUSE_DISPLAY -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxUSE_DISPLAY must be defined." -# else -# define wxUSE_DISPLAY 0 -# endif -#endif /* !defined(wxUSE_DISPLAY) */ - -#ifndef wxUSE_DOC_VIEW_ARCHITECTURE -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxUSE_DOC_VIEW_ARCHITECTURE must be defined." -# else -# define wxUSE_DOC_VIEW_ARCHITECTURE 0 -# endif -#endif /* !defined(wxUSE_DOC_VIEW_ARCHITECTURE) */ - -#ifndef wxUSE_FILEDLG -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxUSE_FILEDLG must be defined." -# else -# define wxUSE_FILEDLG 0 -# endif -#endif /* !defined(wxUSE_FILEDLG) */ - -#ifndef wxUSE_FILEPICKERCTRL -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxUSE_FILEPICKERCTRL must be defined." -# else -# define wxUSE_FILEPICKERCTRL 0 -# endif -#endif /* !defined(wxUSE_FILEPICKERCTRL) */ - -#ifndef wxUSE_FONTDLG -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxUSE_FONTDLG must be defined." -# else -# define wxUSE_FONTDLG 0 -# endif -#endif /* !defined(wxUSE_FONTDLG) */ - -#ifndef wxUSE_FONTMAP -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxUSE_FONTMAP must be defined." -# else -# define wxUSE_FONTMAP 0 -# endif -#endif /* !defined(wxUSE_FONTMAP) */ - -#ifndef wxUSE_FONTPICKERCTRL -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxUSE_FONTPICKERCTRL must be defined." -# else -# define wxUSE_FONTPICKERCTRL 0 -# endif -#endif /* !defined(wxUSE_FONTPICKERCTRL) */ - -#ifndef wxUSE_GAUGE -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxUSE_GAUGE must be defined." -# else -# define wxUSE_GAUGE 0 -# endif -#endif /* !defined(wxUSE_GAUGE) */ - -#ifndef wxUSE_GRAPHICS_CONTEXT -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxUSE_GRAPHICS_CONTEXT must be defined." -# else -# define wxUSE_GRAPHICS_CONTEXT 0 -# endif -#endif /* !defined(wxUSE_GRAPHICS_CONTEXT) */ - - -#ifndef wxUSE_GRID -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxUSE_GRID must be defined." -# else -# define wxUSE_GRID 0 -# endif -#endif /* !defined(wxUSE_GRID) */ - -#ifndef wxUSE_HELP -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxUSE_HELP must be defined." -# else -# define wxUSE_HELP 0 -# endif -#endif /* !defined(wxUSE_HELP) */ - -#ifndef wxUSE_HYPERLINKCTRL -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxUSE_HYPERLINKCTRL must be defined." -# else -# define wxUSE_HYPERLINKCTRL 0 -# endif -#endif /* !defined(wxUSE_HYPERLINKCTRL) */ - -#ifndef wxUSE_HTML -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxUSE_HTML must be defined." -# else -# define wxUSE_HTML 0 -# endif -#endif /* !defined(wxUSE_HTML) */ - -#ifndef wxUSE_LIBMSPACK -# ifndef __UNIX__ - /* set to 0 on platforms that don't have libmspack */ -# define wxUSE_LIBMSPACK 0 -# else -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxUSE_LIBMSPACK must be defined." -# else -# define wxUSE_LIBMSPACK 0 -# endif -# endif -#endif /* !defined(wxUSE_LIBMSPACK) */ - -#ifndef wxUSE_ICO_CUR -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxUSE_ICO_CUR must be defined." -# else -# define wxUSE_ICO_CUR 0 -# endif -#endif /* !defined(wxUSE_ICO_CUR) */ - -#ifndef wxUSE_IFF -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxUSE_IFF must be defined." -# else -# define wxUSE_IFF 0 -# endif -#endif /* !defined(wxUSE_IFF) */ - -#ifndef wxUSE_IMAGLIST -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxUSE_IMAGLIST must be defined." -# else -# define wxUSE_IMAGLIST 0 -# endif -#endif /* !defined(wxUSE_IMAGLIST) */ - -#ifndef wxUSE_JOYSTICK -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxUSE_JOYSTICK must be defined." -# else -# define wxUSE_JOYSTICK 0 -# endif -#endif /* !defined(wxUSE_JOYSTICK) */ - -#ifndef wxUSE_LISTBOOK -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxUSE_LISTBOOK must be defined." -# else -# define wxUSE_LISTBOOK 0 -# endif -#endif /* !defined(wxUSE_LISTBOOK) */ - -#ifndef wxUSE_LISTBOX -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxUSE_LISTBOX must be defined." -# else -# define wxUSE_LISTBOX 0 -# endif -#endif /* !defined(wxUSE_LISTBOX) */ - -#ifndef wxUSE_LISTCTRL -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxUSE_LISTCTRL must be defined." -# else -# define wxUSE_LISTCTRL 0 -# endif -#endif /* !defined(wxUSE_LISTCTRL) */ - -#ifndef wxUSE_LOGGUI -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxUSE_LOGGUI must be defined." -# else -# define wxUSE_LOGGUI 0 -# endif -#endif /* !defined(wxUSE_LOGGUI) */ - -#ifndef wxUSE_LOGWINDOW -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxUSE_LOGWINDOW must be defined." -# else -# define wxUSE_LOGWINDOW 0 -# endif -#endif /* !defined(wxUSE_LOGWINDOW) */ - -#ifndef wxUSE_LOG_DIALOG -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxUSE_LOG_DIALOG must be defined." -# else -# define wxUSE_LOG_DIALOG 0 -# endif -#endif /* !defined(wxUSE_LOG_DIALOG) */ - -#ifndef wxUSE_MDI -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxUSE_MDI must be defined." -# else -# define wxUSE_MDI 0 -# endif -#endif /* !defined(wxUSE_MDI) */ - -#ifndef wxUSE_MDI_ARCHITECTURE -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxUSE_MDI_ARCHITECTURE must be defined." -# else -# define wxUSE_MDI_ARCHITECTURE 0 -# endif -#endif /* !defined(wxUSE_MDI_ARCHITECTURE) */ - -#ifndef wxUSE_MENUS -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxUSE_MENUS must be defined." -# else -# define wxUSE_MENUS 0 -# endif -#endif /* !defined(wxUSE_MENUS) */ - -#ifndef wxUSE_MSGDLG -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxUSE_MSGDLG must be defined." -# else -# define wxUSE_MSGDLG 0 -# endif -#endif /* !defined(wxUSE_MSGDLG) */ - -#ifndef wxUSE_NOTEBOOK -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxUSE_NOTEBOOK must be defined." -# else -# define wxUSE_NOTEBOOK 0 -# endif -#endif /* !defined(wxUSE_NOTEBOOK) */ - -#ifndef wxUSE_ODCOMBOBOX -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxUSE_ODCOMBOBOX must be defined." -# else -# define wxUSE_ODCOMBOBOX 0 -# endif -#endif /* !defined(wxUSE_ODCOMBOBOX) */ - -#ifndef wxUSE_PALETTE -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxUSE_PALETTE must be defined." -# else -# define wxUSE_PALETTE 0 -# endif -#endif /* !defined(wxUSE_PALETTE) */ - -#ifndef wxUSE_POPUPWIN -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxUSE_POPUPWIN must be defined." -# else -# define wxUSE_POPUPWIN 0 -# endif -#endif /* !defined(wxUSE_POPUPWIN) */ - -#ifndef wxUSE_PRINTING_ARCHITECTURE -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxUSE_PRINTING_ARCHITECTURE must be defined." -# else -# define wxUSE_PRINTING_ARCHITECTURE 0 -# endif -#endif /* !defined(wxUSE_PRINTING_ARCHITECTURE) */ - -#ifndef wxUSE_RADIOBOX -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxUSE_RADIOBOX must be defined." -# else -# define wxUSE_RADIOBOX 0 -# endif -#endif /* !defined(wxUSE_RADIOBOX) */ - -#ifndef wxUSE_RADIOBTN -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxUSE_RADIOBTN must be defined." -# else -# define wxUSE_RADIOBTN 0 -# endif -#endif /* !defined(wxUSE_RADIOBTN) */ - -#ifndef wxUSE_SASH -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxUSE_SASH must be defined." -# else -# define wxUSE_SASH 0 -# endif -#endif /* !defined(wxUSE_SASH) */ - -#ifndef wxUSE_SCROLLBAR -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxUSE_SCROLLBAR must be defined." -# else -# define wxUSE_SCROLLBAR 0 -# endif -#endif /* !defined(wxUSE_SCROLLBAR) */ - -#ifndef wxUSE_SLIDER -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxUSE_SLIDER must be defined." -# else -# define wxUSE_SLIDER 0 -# endif -#endif /* !defined(wxUSE_SLIDER) */ - -#ifndef wxUSE_SOUND -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxUSE_SOUND must be defined." -# else -# define wxUSE_SOUND 0 -# endif -#endif /* !defined(wxUSE_SOUND) */ - -#ifndef wxUSE_SPINBTN -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxUSE_SPINBTN must be defined." -# else -# define wxUSE_SPINBTN 0 -# endif -#endif /* !defined(wxUSE_SPINBTN) */ - -#ifndef wxUSE_SPINCTRL -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxUSE_SPINCTRL must be defined." -# else -# define wxUSE_SPINCTRL 0 -# endif -#endif /* !defined(wxUSE_SPINCTRL) */ - -#ifndef wxUSE_SPLASH -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxUSE_SPLASH must be defined." -# else -# define wxUSE_SPLASH 0 -# endif -#endif /* !defined(wxUSE_SPLASH) */ - -#ifndef wxUSE_SPLITTER -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxUSE_SPLITTER must be defined." -# else -# define wxUSE_SPLITTER 0 -# endif -#endif /* !defined(wxUSE_SPLITTER) */ - -#ifndef wxUSE_STATBMP -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxUSE_STATBMP must be defined." -# else -# define wxUSE_STATBMP 0 -# endif -#endif /* !defined(wxUSE_STATBMP) */ - -#ifndef wxUSE_STATBOX -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxUSE_STATBOX must be defined." -# else -# define wxUSE_STATBOX 0 -# endif -#endif /* !defined(wxUSE_STATBOX) */ - -#ifndef wxUSE_STATLINE -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxUSE_STATLINE must be defined." -# else -# define wxUSE_STATLINE 0 -# endif -#endif /* !defined(wxUSE_STATLINE) */ - -#ifndef wxUSE_STATTEXT -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxUSE_STATTEXT must be defined." -# else -# define wxUSE_STATTEXT 0 -# endif -#endif /* !defined(wxUSE_STATTEXT) */ - -#ifndef wxUSE_STATUSBAR -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxUSE_STATUSBAR must be defined." -# else -# define wxUSE_STATUSBAR 0 -# endif -#endif /* !defined(wxUSE_STATUSBAR) */ - -#ifndef wxUSE_TAB_DIALOG -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxUSE_TAB_DIALOG must be defined." -# else -# define wxUSE_TAB_DIALOG 0 -# endif -#endif /* !defined(wxUSE_TAB_DIALOG) */ - -#ifndef wxUSE_TEXTCTRL -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxUSE_TEXTCTRL must be defined." -# else -# define wxUSE_TEXTCTRL 0 -# endif -#endif /* !defined(wxUSE_TEXTCTRL) */ - -#ifndef wxUSE_TIPWINDOW -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxUSE_TIPWINDOW must be defined." -# else -# define wxUSE_TIPWINDOW 0 -# endif -#endif /* !defined(wxUSE_TIPWINDOW) */ - -#ifndef wxUSE_TOOLBAR -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxUSE_TOOLBAR must be defined." -# else -# define wxUSE_TOOLBAR 0 -# endif -#endif /* !defined(wxUSE_TOOLBAR) */ - -#ifndef wxUSE_TOOLTIPS -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxUSE_TOOLTIPS must be defined." -# else -# define wxUSE_TOOLTIPS 0 -# endif -#endif /* !defined(wxUSE_TOOLTIPS) */ - -#ifndef wxUSE_TREECTRL -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxUSE_TREECTRL must be defined." -# else -# define wxUSE_TREECTRL 0 -# endif -#endif /* !defined(wxUSE_TREECTRL) */ - -#ifndef wxUSE_VALIDATORS -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxUSE_VALIDATORS must be defined." -# else -# define wxUSE_VALIDATORS 0 -# endif -#endif /* !defined(wxUSE_VALIDATORS) */ - -#ifndef wxUSE_WXHTML_HELP -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxUSE_WXHTML_HELP must be defined." -# else -# define wxUSE_WXHTML_HELP 0 -# endif -#endif /* !defined(wxUSE_WXHTML_HELP) */ - -#ifndef wxUSE_XRC -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxUSE_XRC must be defined." -# else -# define wxUSE_XRC 0 -# endif -#endif /* !defined(wxUSE_XRC) */ - -#endif /* wxUSE_GUI */ - -/* - check consistency of the settings - */ - -#if WXWIN_COMPATIBILITY_2_4 -# if !WXWIN_COMPATIBILITY_2_6 -# ifdef wxABORT_ON_CONFIG_ERROR -# error "2.4.X compatibility requires 2.6.X compatibility" -# else -# undef WXWIN_COMPATIBILITY_2_6 -# define WXWIN_COMPATIBILITY_2_6 1 -# endif -# endif -#endif /* WXWIN_COMPATIBILITY_2_4 */ - -#if wxUSE_ARCHIVE_STREAMS -# if !wxUSE_DATETIME -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxArchive requires wxUSE_DATETIME" -# else -# undef wxUSE_ARCHIVE_STREAMS -# define wxUSE_ARCHIVE_STREAMS 0 -# endif -# endif -#endif /* wxUSE_ARCHIVE_STREAMS */ - -#if wxUSE_CRASHREPORT && !wxUSE_ON_FATAL_EXCEPTION -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxUSE_CRASHREPORT requires wxUSE_ON_FATAL_EXCEPTION" -# else -# undef wxUSE_CRASHREPORT -# define wxUSE_CRASHREPORT 0 -# endif -#endif /* wxUSE_CRASHREPORT */ - -#if wxUSE_PROTOCOL_FILE || wxUSE_PROTOCOL_FTP || wxUSE_PROTOCOL_HTTP -# if !wxUSE_PROTOCOL -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxUSE_PROTOCOL_XXX requires wxUSE_PROTOCOL" -# else -# undef wxUSE_PROTOCOL -# define wxUSE_PROTOCOL 1 -# endif -# endif -#endif /* wxUSE_PROTOCOL_XXX */ - -#if wxUSE_URL -# if !wxUSE_PROTOCOL -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxUSE_URL requires wxUSE_PROTOCOL" -# else -# undef wxUSE_PROTOCOL -# define wxUSE_PROTOCOL 1 -# endif -# endif -#endif /* wxUSE_URL */ - -#if wxUSE_PROTOCOL -# if !wxUSE_SOCKETS -# if wxUSE_PROTOCOL_HTTP || wxUSE_PROTOCOL_FTP -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxUSE_PROTOCOL_FTP/HTTP requires wxUSE_SOCKETS" -# else -# undef wxUSE_SOCKETS -# define wxUSE_SOCKETS 1 -# endif -# endif -# endif - -# if !wxUSE_STREAMS -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxUSE_PROTOCOL requires wxUSE_STREAMS" -# else -# undef wxUSE_STREAMS -# define wxUSE_STREAMS 1 -# endif -# endif -#endif /* wxUSE_PROTOCOL */ - -/* have to test for wxUSE_HTML before wxUSE_FILESYSTEM */ -#if wxUSE_HTML -# if !wxUSE_FILESYSTEM -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxHTML requires wxFileSystem" -# else -# undef wxUSE_FILESYSTEM -# define wxUSE_FILESYSTEM 1 -# endif -# endif -#endif /* wxUSE_HTML */ - -#if wxUSE_FS_ARCHIVE -# if !wxUSE_FILESYSTEM -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxArchiveFSHandler requires wxFileSystem" -# else -# undef wxUSE_FILESYSTEM -# define wxUSE_FILESYSTEM 1 -# endif -# endif -# if !wxUSE_ARCHIVE_STREAMS -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxArchiveFSHandler requires wxArchive" -# else -# undef wxUSE_ARCHIVE_STREAMS -# define wxUSE_ARCHIVE_STREAMS 1 -# endif -# endif -#endif /* wxUSE_FS_ARCHIVE */ - -#if wxUSE_FILESYSTEM -# if !wxUSE_STREAMS -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxUSE_FILESYSTEM requires wxUSE_STREAMS" -# else -# undef wxUSE_STREAMS -# define wxUSE_STREAMS 1 -# endif -# endif -# if !wxUSE_FILE && !wxUSE_FFILE -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxUSE_FILESYSTEM requires either wxUSE_FILE or wxUSE_FFILE" -# else -# undef wxUSE_FILE -# define wxUSE_FILE 1 -# undef wxUSE_FFILE -# define wxUSE_FFILE 1 -# endif -# endif -#endif /* wxUSE_FILESYSTEM */ - -#if wxUSE_FS_INET -# if !wxUSE_PROTOCOL -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxUSE_FS_INET requires wxUSE_PROTOCOL" -# else -# undef wxUSE_PROTOCOL -# define wxUSE_PROTOCOL 1 -# endif -# endif -#endif /* wxUSE_FS_INET */ - -#if wxUSE_STOPWATCH || wxUSE_DATETIME -# if !wxUSE_LONGLONG -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxUSE_STOPWATCH and wxUSE_DATETIME require wxUSE_LONGLONG" -# else -# undef wxUSE_LONGLONG -# define wxUSE_LONGLONG 1 -# endif -# endif -#endif /* wxUSE_STOPWATCH */ - -#if wxUSE_MIMETYPE && !wxUSE_TEXTFILE -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxUSE_MIMETYPE requires wxUSE_TEXTFILE" -# else -# undef wxUSE_TEXTFILE -# define wxUSE_TEXTFILE 1 -# endif -#endif /* wxUSE_MIMETYPE */ - -#if wxUSE_ODBC -# if !wxUSE_DATETIME -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxODBC requires wxUSE_DATETIME" -# else -# undef wxUSE_ODBC -# define wxUSE_ODBC 0 -# endif -# endif -#endif /* wxUSE_ODBC */ - -#if wxUSE_TEXTFILE && !wxUSE_TEXTBUFFER -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxUSE_TEXTFILE requires wxUSE_TEXTBUFFER" -# else -# undef wxUSE_TEXTBUFFER -# define wxUSE_TEXTBUFFER 1 -# endif -#endif /* wxUSE_TEXTFILE */ - -#if wxUSE_TEXTFILE && !wxUSE_FILE -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxUSE_TEXTFILE requires wxUSE_FILE" -# else -# undef wxUSE_FILE -# define wxUSE_FILE 1 -# endif -#endif /* wxUSE_TEXTFILE */ - -#if wxUSE_XML && !wxUSE_WCHAR_T -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxUSE_XML requires wxUSE_WCHAR_T" -# else -# undef wxUSE_XML -# define wxUSE_XML 0 -# endif -#endif /* wxUSE_XML */ - -#if !wxUSE_DYNLIB_CLASS -# if wxUSE_DYNAMIC_LOADER -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxUSE_DYNAMIC_LOADER requires wxUSE_DYNLIB_CLASS." -# else -# define wxUSE_DYNLIB_CLASS 1 -# endif -# endif -#endif /* wxUSE_DYNLIB_CLASS */ - -#if wxUSE_ZIPSTREAM -# if !wxUSE_ZLIB -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxZip requires wxZlib" -# else -# undef wxUSE_ZLIB -# define wxUSE_ZLIB 1 -# endif -# endif -# if !wxUSE_ARCHIVE_STREAMS -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxZip requires wxArchive" -# else -# undef wxUSE_ARCHIVE_STREAMS -# define wxUSE_ARCHIVE_STREAMS 1 -# endif -# endif -#endif /* wxUSE_ZIPSTREAM */ - -#if wxUSE_TARSTREAM - /* wxTar doesn't currently compile without wchar_t */ -# if !wxUSE_WCHAR_T -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxTar requires wchar_t" -# else -# undef wxUSE_TARSTREAM -# define wxUSE_TARSTREAM 0 -# endif -# endif -#endif /* wxUSE_TARSTREAM */ - -#if wxUSE_TARSTREAM -# if !wxUSE_ARCHIVE_STREAMS -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxTar requires wxArchive" -# else -# undef wxUSE_ARCHIVE_STREAMS -# define wxUSE_ARCHIVE_STREAMS 1 -# endif -# endif -#endif /* wxUSE_TARSTREAM */ - -/* the rest of the tests is for the GUI settings only */ -#if wxUSE_GUI - -#if wxUSE_BUTTON || \ - wxUSE_CALENDARCTRL || \ - wxUSE_CARET || \ - wxUSE_COMBOBOX || \ - wxUSE_BMPBUTTON || \ - wxUSE_CHECKBOX || \ - wxUSE_CHECKLISTBOX || \ - wxUSE_CHOICE || \ - wxUSE_GAUGE || \ - wxUSE_GRID || \ - wxUSE_LISTBOX || \ - wxUSE_LISTCTRL || \ - wxUSE_NOTEBOOK || \ - wxUSE_RADIOBOX || \ - wxUSE_RADIOBTN || \ - wxUSE_SCROLLBAR || \ - wxUSE_SLIDER || \ - wxUSE_SPINBTN || \ - wxUSE_SPINCTRL || \ - wxUSE_STATBMP || \ - wxUSE_STATBOX || \ - wxUSE_STATLINE || \ - wxUSE_STATTEXT || \ - wxUSE_STATUSBAR || \ - wxUSE_TEXTCTRL || \ - wxUSE_TOOLBAR || \ - wxUSE_TREECTRL -# if !wxUSE_CONTROLS -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxUSE_CONTROLS unset but some controls used" -# else -# undef wxUSE_CONTROLS -# define wxUSE_CONTROLS 1 -# endif -# endif -#endif /* controls */ - -#if wxUSE_BMPBUTTON -# if !wxUSE_BUTTON -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxUSE_BMPBUTTON requires wxUSE_BUTTON" -# else -# undef wxUSE_BUTTON -# define wxUSE_BUTTON 1 -# endif -# endif -#endif /* wxUSE_BMPBUTTON */ - -/* - wxUSE_BOOKCTRL should be only used if any of the controls deriving from it - are used - */ -#ifdef wxUSE_BOOKCTRL -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxUSE_BOOKCTRL is defined automatically, don't define it" -# else -# undef wxUSE_BOOKCTRL -# endif -#endif - -#define wxUSE_BOOKCTRL (wxUSE_NOTEBOOK || \ - wxUSE_LISTBOOK || \ - wxUSE_CHOICEBOOK || \ - wxUSE_TOOLBOOK || \ - wxUSE_TREEBOOK) - -#if wxUSE_COLLPANE -# if !wxUSE_BUTTON || !wxUSE_STATLINE -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxUSE_COLLPANE requires wxUSE_BUTTON and wxUSE_STATLINE" -# else -# undef wxUSE_COLLPANE -# define wxUSE_COLLPANE 0 -# endif -# endif -#endif /* wxUSE_COLLPANE */ - -#if wxUSE_LISTBOOK -# if !wxUSE_LISTCTRL -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxListbook requires wxListCtrl" -# else -# undef wxUSE_LISTCTRL -# define wxUSE_LISTCTRL 1 -# endif -# endif -#endif /* wxUSE_LISTBOOK */ - -#if wxUSE_CHOICEBOOK -# if !wxUSE_CHOICE -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxChoicebook requires wxChoice" -# else -# undef wxUSE_CHOICE -# define wxUSE_CHOICE 1 -# endif -# endif -#endif /* wxUSE_CHOICEBOOK */ - -#if wxUSE_TOOLBOOK -# if !wxUSE_TOOLBAR -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxToolbook requires wxToolBar" -# else -# undef wxUSE_TOOLBAR -# define wxUSE_TOOLBAR 1 -# endif -# endif -#endif /* wxUSE_TOOLBOOK */ - -#if !wxUSE_ODCOMBOBOX -# if wxUSE_BITMAPCOMBOBOX -# error "wxBitmapComboBox requires wxOwnerDrawnComboBox" -# else -# undef wxUSE_BITMAPCOMBOBOX -# define wxUSE_BITMAPCOMBOBOX 0 -# endif -#endif /* !wxUSE_ODCOMBOBOX */ - -/* don't attempt to use native status bar on the platforms not having it */ -#ifndef wxUSE_NATIVE_STATUSBAR -# define wxUSE_NATIVE_STATUSBAR 0 -#elif wxUSE_NATIVE_STATUSBAR -# if defined(__WXUNIVERSAL__) || !( defined(__WXMSW__) || \ - defined(__WXMAC__) || \ - defined(__WXPALMOS__) ) -# undef wxUSE_NATIVE_STATUSBAR -# define wxUSE_NATIVE_STATUSBAR 0 -# endif -#endif - -#if wxUSE_GRAPHICS_CONTEXT && !wxUSE_GEOMETRY -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxUSE_GRAPHICS_CONTEXT requires wxUSE_GEOMETRY" -# else -# undef wxUSE_GRAPHICS_CONTEXT -# define wxUSE_GRAPHICS_CONTEXT 0 -# endif -#endif /* wxUSE_GRAPHICS_CONTEXT */ - - -/* wxGTK-specific dependencies */ -#ifdef __WXGTK__ -# ifndef __WXUNIVERSAL__ -# if wxUSE_MDI_ARCHITECTURE && !wxUSE_MENUS -# ifdef wxABORT_ON_CONFIG_ERROR -# error "MDI requires wxUSE_MENUS in wxGTK" -# else -# undef wxUSE_MENUS -# define wxUSE_MENUS 1 -# endif -# endif -# endif /* !__WXUNIVERSAL__ */ - -# if wxUSE_JOYSTICK -# if !wxUSE_THREADS -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxJoystick requires threads in wxGTK" -# else -# undef wxUSE_JOYSTICK -# define wxUSE_JOYSTICK 0 -# endif -# endif -# endif -#endif /* wxGTK && !wxUniv */ - -/* Hopefully we can emulate these dialogs in due course */ -#if defined(__SMARTPHONE__) && defined(__WXWINCE__) -# ifdef wxUSE_COLOURDLG -# undef wxUSE_COLOURDLG -# define wxUSE_COLOURDLG 0 -# endif -#endif /* __SMARTPHONE__ && __WXWINCE__ */ - - -/* generic controls dependencies */ -#if !defined(__WXMSW__) || defined(__WXUNIVERSAL__) -# if wxUSE_FONTDLG || wxUSE_FILEDLG || wxUSE_CHOICEDLG - /* all common controls are needed by these dialogs */ -# if !defined(wxUSE_CHOICE) || \ - !defined(wxUSE_TEXTCTRL) || \ - !defined(wxUSE_BUTTON) || \ - !defined(wxUSE_CHECKBOX) || \ - !defined(wxUSE_STATTEXT) -# ifdef wxABORT_ON_CONFIG_ERROR -# error "These common controls are needed by common dialogs" -# else -# undef wxUSE_CHOICE -# define wxUSE_CHOICE 1 -# undef wxUSE_TEXTCTRL -# define wxUSE_TEXTCTRL 1 -# undef wxUSE_BUTTON -# define wxUSE_BUTTON 1 -# undef wxUSE_CHECKBOX -# define wxUSE_CHECKBOX 1 -# undef wxUSE_STATTEXT -# define wxUSE_STATTEXT 1 -# endif -# endif -# endif -#endif /* !wxMSW || wxUniv */ - -/* common dependencies */ -#if wxUSE_CALENDARCTRL -# if !(wxUSE_SPINBTN && wxUSE_COMBOBOX) -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxCalendarCtrl requires wxSpinButton and wxComboBox" -# else -# undef wxUSE_SPINBTN -# undef wxUSE_COMBOBOX -# define wxUSE_SPINBTN 1 -# define wxUSE_COMBOBOX 1 -# endif -# endif - -# if !wxUSE_DATETIME -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxCalendarCtrl requires wxUSE_DATETIME" -# else -# undef wxUSE_DATETIME -# define wxUSE_DATETIME 1 -# endif -# endif -#endif /* wxUSE_CALENDARCTRL */ - -#if wxUSE_DATEPICKCTRL -# if !wxUSE_DATETIME -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxDatePickerCtrl requires wxUSE_DATETIME" -# else -# undef wxUSE_DATETIME -# define wxUSE_DATETIME 1 -# endif -# endif -#endif /* wxUSE_DATEPICKCTRL */ - -#if wxUSE_CHECKLISTBOX -# if !wxUSE_LISTBOX -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxCheckListBox requires wxListBox" -# else -# undef wxUSE_LISTBOX -# define wxUSE_LISTBOX 1 -# endif -# endif -#endif /* wxUSE_CHECKLISTBOX */ - -#if wxUSE_CHOICEDLG -# if !wxUSE_LISTBOX -# ifdef wxABORT_ON_CONFIG_ERROR -# error "Choice dialogs requires wxListBox" -# else -# undef wxUSE_LISTBOX -# define wxUSE_LISTBOX 1 -# endif -# endif -#endif /* wxUSE_CHOICEDLG */ - -#if wxUSE_HELP -# if !wxUSE_BMPBUTTON -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxUSE_HELP requires wxUSE_BMPBUTTON" -# else -# undef wxUSE_BMPBUTTON -# define wxUSE_BMPBUTTON 1 -# endif -# endif - -# if !wxUSE_CHOICEDLG -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxUSE_HELP requires wxUSE_CHOICEDLG" -# else -# undef wxUSE_CHOICEDLG -# define wxUSE_CHOICEDLG 1 -# endif -# endif -#endif /* wxUSE_HELP */ - -#if wxUSE_MS_HTML_HELP - /* - this doesn't make sense for platforms other than MSW but we still - define it in wx/setup_inc.h so don't complain if it happens to be - defined under another platform but just silently fix it. - */ -# ifndef __WXMSW__ -# undef wxUSE_MS_HTML_HELP -# define wxUSE_MS_HTML_HELP 0 -# endif -#endif /* wxUSE_MS_HTML_HELP */ - -#if wxUSE_WXHTML_HELP -# if !wxUSE_HELP || !wxUSE_HTML || !wxUSE_COMBOBOX || !wxUSE_NOTEBOOK || !wxUSE_SPINCTRL -# ifdef wxABORT_ON_CONFIG_ERROR -# error "Built in help controller can't be compiled" -# else -# undef wxUSE_HELP -# define wxUSE_HELP 1 -# undef wxUSE_HTML -# define wxUSE_HTML 1 -# undef wxUSE_COMBOBOX -# define wxUSE_COMBOBOX 1 -# undef wxUSE_NOTEBOOK -# define wxUSE_NOTEBOOK 1 -# undef wxUSE_SPINCTRL -# define wxUSE_SPINCTRL 1 -# endif -# endif -#endif /* wxUSE_WXHTML_HELP */ - -#if !wxUSE_IMAGE -/* - The default wxUSE_IMAGE setting is 1, so if it's set to 0 we assume the - user explicitly wants this and disable all other features that require - wxUSE_IMAGE. - */ -# if wxUSE_DRAGIMAGE -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxUSE_DRAGIMAGE requires wxUSE_IMAGE" -# else -# undef wxUSE_DRAGIMAGE -# define wxUSE_DRAGIMAGE 0 -# endif -# endif - -# if wxUSE_LIBPNG -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxUSE_LIBPNG requires wxUSE_IMAGE" -# else -# undef wxUSE_LIBPNG -# define wxUSE_LIBPNG 0 -# endif -# endif - -# if wxUSE_LIBJPEG -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxUSE_LIBJPEG requires wxUSE_IMAGE" -# else -# undef wxUSE_LIBJPEG -# define wxUSE_LIBJPEG 0 -# endif -# endif - -# if wxUSE_LIBTIFF -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxUSE_LIBTIFF requires wxUSE_IMAGE" -# else -# undef wxUSE_LIBTIFF -# define wxUSE_LIBTIFF 0 -# endif -# endif - -# if wxUSE_GIF -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxUSE_GIF requires wxUSE_IMAGE" -# else -# undef wxUSE_GIF -# define wxUSE_GIF 0 -# endif -# endif - -# if wxUSE_PNM -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxUSE_PNM requires wxUSE_IMAGE" -# else -# undef wxUSE_PNM -# define wxUSE_PNM 0 -# endif -# endif - -# if wxUSE_PCX -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxUSE_PCX requires wxUSE_IMAGE" -# else -# undef wxUSE_PCX -# define wxUSE_PCX 0 -# endif -# endif - -# if wxUSE_IFF -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxUSE_IFF requires wxUSE_IMAGE" -# else -# undef wxUSE_IFF -# define wxUSE_IFF 0 -# endif -# endif - -# if wxUSE_TOOLBAR -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxUSE_TOOLBAR requires wxUSE_IMAGE" -# else -# undef wxUSE_TOOLBAR -# define wxUSE_TOOLBAR 0 -# endif -# endif - -# if wxUSE_XPM -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxUSE_XPM requires wxUSE_IMAGE" -# else -# undef wxUSE_XPM -# define wxUSE_XPM 0 -# endif -# endif - -#endif /* !wxUSE_IMAGE */ - -#if wxUSE_DOC_VIEW_ARCHITECTURE -# if !wxUSE_MENUS -# ifdef wxABORT_ON_CONFIG_ERROR -# error "DocView requires wxUSE_MENUS" -# else -# undef wxUSE_MENUS -# define wxUSE_MENUS 1 -# endif -# endif - -# if !wxUSE_CHOICEDLG -# ifdef wxABORT_ON_CONFIG_ERROR -# error "DocView requires wxUSE_CHOICEDLG" -# else -# undef wxUSE_CHOICEDLG -# define wxUSE_CHOICEDLG 1 -# endif -# endif - -# if !wxUSE_STREAMS && !wxUSE_STD_IOSTREAM -# ifdef wxABORT_ON_CONFIG_ERROR -# error "DocView requires wxUSE_STREAMS or wxUSE_STD_IOSTREAM" -# else -# undef wxUSE_STREAMS -# define wxUSE_STREAMS 1 -# endif -# endif -#endif /* wxUSE_DOC_VIEW_ARCHITECTURE */ - -#if wxUSE_PRINTING_ARCHITECTURE -# if !wxUSE_COMBOBOX -# ifdef wxABORT_ON_CONFIG_ERROR -# error "Print dialog requires wxUSE_COMBOBOX" -# else -# undef wxUSE_COMBOBOX -# define wxUSE_COMBOBOX 1 -# endif -# endif -#endif /* wxUSE_PRINTING_ARCHITECTURE */ - -#if wxUSE_MDI_ARCHITECTURE -# if !wxUSE_MDI -# ifdef wxABORT_ON_CONFIG_ERROR -# error "MDI requires wxUSE_MDI" -# else -# undef wxUSE_MDI -# define wxUSE_MDI 1 -# endif -# endif - -# if !wxUSE_DOC_VIEW_ARCHITECTURE -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxUSE_MDI_ARCHITECTURE requires wxUSE_DOC_VIEW_ARCHITECTURE" -# else -# undef wxUSE_DOC_VIEW_ARCHITECTURE -# define wxUSE_DOC_VIEW_ARCHITECTURE 1 -# endif -# endif -#endif /* wxUSE_MDI_ARCHITECTURE */ - -#if !wxUSE_FILEDLG -# if wxUSE_DOC_VIEW_ARCHITECTURE || wxUSE_WXHTML_HELP -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxUSE_FILEDLG is required by wxUSE_DOC_VIEW_ARCHITECTURE and wxUSE_WXHTML_HELP!" -# else -# undef wxUSE_FILEDLG -# define wxUSE_FILEDLG 1 -# endif -# endif -#endif /* wxUSE_FILEDLG */ - -#if !wxUSE_GAUGE || !wxUSE_BUTTON -# if wxUSE_PROGRESSDLG && !defined(__WXPALMOS__) -# ifdef wxABORT_ON_CONFIG_ERROR -# error "Generic progress dialog requires wxUSE_GAUGE and wxUSE_BUTTON" -# else -# undef wxUSE_GAUGE -# undef wxUSE_BUTTON -# define wxUSE_GAUGE 1 -# define wxUSE_BUTTON 1 -# endif -# endif -#endif /* !wxUSE_GAUGE */ - -#if !wxUSE_BUTTON -# if wxUSE_FONTDLG || \ - wxUSE_FILEDLG || \ - wxUSE_CHOICEDLG || \ - wxUSE_NUMBERDLG || \ - wxUSE_TEXTDLG || \ - wxUSE_DIRDLG || \ - wxUSE_STARTUP_TIPS || \ - wxUSE_WIZARDDLG -# ifdef wxABORT_ON_CONFIG_ERROR -# error "Common and generic dialogs require wxUSE_BUTTON" -# else -# undef wxUSE_BUTTON -# define wxUSE_BUTTON 1 -# endif -# endif -#endif /* !wxUSE_BUTTON */ - -#if !wxUSE_TOOLBAR -# if wxUSE_TOOLBAR_NATIVE -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxUSE_TOOLBAR is set to 0 but wxUSE_TOOLBAR_NATIVE is set to 1" -# else -# undef wxUSE_TOOLBAR_NATIVE -# define wxUSE_TOOLBAR_NATIVE 0 -# endif -# endif -#endif - -#if !wxUSE_IMAGLIST -# if wxUSE_TREECTRL || wxUSE_NOTEBOOK || wxUSE_LISTCTRL -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxImageList must be compiled as well" -# else -# undef wxUSE_IMAGLIST -# define wxUSE_IMAGLIST 1 -# endif -# endif -#endif /* !wxUSE_IMAGLIST */ - -#if !wxUSE_MSGDLG -# ifdef wxABORT_ON_CONFIG_ERROR - /* FIXME: should compile without it, of course, but doesn't */ -# error "wxMessageBox is always needed" -# else -# undef wxUSE_MSGDLG -# define wxUSE_MSGDLG 1 -# endif -#endif - -#if wxUSE_RADIOBOX -# if !wxUSE_RADIOBTN -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxUSE_RADIOBOX requires wxUSE_RADIOBTN" -# else -# undef wxUSE_RADIOBTN -# define wxUSE_RADIOBTN 1 -# endif -# endif -# if !wxUSE_STATBOX && !defined(__WXPALMOS__) -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxUSE_RADIOBOX requires wxUSE_STATBOX" -# else -# undef wxUSE_STATBOX -# define wxUSE_STATBOX 1 -# endif -# endif -#endif /* wxUSE_RADIOBOX */ - -#if wxUSE_LOGWINDOW -# if !wxUSE_TEXTCTRL -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxUSE_LOGWINDOW requires wxUSE_TEXTCTRL" -# else -# undef wxUSE_TEXTCTRL -# define wxUSE_TEXTCTRL 1 -# endif -# endif -#endif /* wxUSE_LOGWINDOW */ - -#if wxUSE_LOG_DIALOG -# if !wxUSE_LISTCTRL || !wxUSE_BUTTON -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxUSE_LOG_DIALOG requires wxUSE_LISTCTRL and wxUSE_BUTTON" -# else -# undef wxUSE_LISTCTRL -# define wxUSE_LISTCTRL 1 -# undef wxUSE_BUTTON -# define wxUSE_BUTTON 1 -# endif -# endif -#endif /* wxUSE_LOG_DIALOG */ - -#if wxUSE_CLIPBOARD && !wxUSE_DATAOBJ -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxClipboard requires wxDataObject" -# else -# undef wxUSE_DATAOBJ -# define wxUSE_DATAOBJ 1 -# endif -#endif /* wxUSE_CLIPBOARD */ - -#if wxUSE_WX_RESOURCES && !wxUSE_PROLOGIO -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxr resources require PrologIO" -# else -# undef wxUSE_PROLOGIO -# define wxUSE_PROLOGIO 1 -# endif -#endif /* wxUSE_WX_RESOURCES */ - -#if wxUSE_XRC && !wxUSE_XML -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxUSE_XRC requires wxUSE_XML" -# else -# undef wxUSE_XRC -# define wxUSE_XRC 0 -# endif -#endif /* wxUSE_XRC */ - -#if wxUSE_SOCKETS && !wxUSE_STOPWATCH -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxUSE_SOCKETS requires wxUSE_STOPWATCH" -# else -# undef wxUSE_SOCKETS -# define wxUSE_SOCKETS 0 -# endif -#endif /* wxUSE_SOCKETS */ - -#if !wxUSE_VARIANT -# if wxUSE_DATAVIEWCTRL -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxDataViewCtrl requires wxVariant" -# else -# undef wxUSE_DATAVIEWCTRL -# define wxUSE_DATAVIEWCTRL 0 -# endif -# endif - -# if wxUSE_ODBC -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxUSE_ODBC requires wxVariant" -# else -# undef wxUSE_ODBC -# define wxUSE_ODBC 0 -# endif -# endif -#endif /* wxUSE_VARIANT */ - -#endif /* wxUSE_GUI */ diff --git a/wxWidgets/include/wx/choicdlg.h b/wxWidgets/include/wx/choicdlg.h deleted file mode 100644 index 29cd37867d..0000000000 --- a/wxWidgets/include/wx/choicdlg.h +++ /dev/null @@ -1,22 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/choicdgg.h -// Purpose: Includes generic choice dialog file -// Author: Julian Smart -// Modified by: -// Created: -// RCS-ID: $Id: choicdlg.h 33948 2005-05-04 18:57:50Z JS $ -// Copyright: Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_CHOICDLG_H_BASE_ -#define _WX_CHOICDLG_H_BASE_ - -#if wxUSE_CHOICEDLG - -#include "wx/generic/choicdgg.h" - -#endif - -#endif - // _WX_CHOICDLG_H_BASE_ diff --git a/wxWidgets/include/wx/choice.h b/wxWidgets/include/wx/choice.h deleted file mode 100644 index 5c4ebb0cc1..0000000000 --- a/wxWidgets/include/wx/choice.h +++ /dev/null @@ -1,88 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/choice.h -// Purpose: wxChoice class interface -// Author: Vadim Zeitlin -// Modified by: -// Created: 26.07.99 -// RCS-ID: $Id: choice.h 42727 2006-10-30 16:04:27Z VZ $ -// Copyright: (c) wxWidgets team -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_CHOICE_H_BASE_ -#define _WX_CHOICE_H_BASE_ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -#include "wx/defs.h" - -#if wxUSE_CHOICE - -#include "wx/ctrlsub.h" // the base class - -// ---------------------------------------------------------------------------- -// global data -// ---------------------------------------------------------------------------- - -extern WXDLLEXPORT_DATA(const wxChar) wxChoiceNameStr[]; - -// ---------------------------------------------------------------------------- -// wxChoice allows to select one of a non-modifiable list of strings -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxChoiceBase : public wxControlWithItems -{ -public: - wxChoiceBase() { } - virtual ~wxChoiceBase(); - - // all generic methods are in wxControlWithItems - - // get the current selection: this can only be different from the normal - // selection if the popup items list is currently opened and the user - // selected some item in it but didn't close the list yet; otherwise (and - // currently always on platforms other than MSW) this is the same as - // GetSelection() - virtual int GetCurrentSelection() const { return GetSelection(); } - - // set/get the number of columns in the control (as they're not supported on - // most platforms, they do nothing by default) - virtual void SetColumns(int WXUNUSED(n) = 1 ) { } - virtual int GetColumns() const { return 1 ; } - - // emulate selecting the item event.GetInt() - void Command(wxCommandEvent& event); - -private: - DECLARE_NO_COPY_CLASS(wxChoiceBase) -}; - -// ---------------------------------------------------------------------------- -// include the platform-dependent class definition -// ---------------------------------------------------------------------------- - -#if defined(__WXUNIVERSAL__) - #include "wx/univ/choice.h" -#elif defined(__SMARTPHONE__) && defined(__WXWINCE__) - #include "wx/msw/wince/choicece.h" -#elif defined(__WXMSW__) - #include "wx/msw/choice.h" -#elif defined(__WXMOTIF__) - #include "wx/motif/choice.h" -#elif defined(__WXGTK20__) - #include "wx/gtk/choice.h" -#elif defined(__WXGTK__) - #include "wx/gtk1/choice.h" -#elif defined(__WXMAC__) - #include "wx/mac/choice.h" -#elif defined(__WXCOCOA__) - #include "wx/cocoa/choice.h" -#elif defined(__WXPM__) - #include "wx/os2/choice.h" -#endif - -#endif // wxUSE_CHOICE - -#endif // _WX_CHOICE_H_BASE_ diff --git a/wxWidgets/include/wx/choicebk.h b/wxWidgets/include/wx/choicebk.h deleted file mode 100644 index 0bbedefd95..0000000000 --- a/wxWidgets/include/wx/choicebk.h +++ /dev/null @@ -1,154 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: wx/choicebk.h -// Purpose: wxChoicebook: wxChoice and wxNotebook combination -// Author: Vadim Zeitlin -// Modified by: Wlodzimierz ABX Skiba from wx/listbook.h -// Created: 15.09.04 -// RCS-ID: $Id: choicebk.h 59616 2009-03-18 21:58:15Z VZ $ -// Copyright: (c) Vadim Zeitlin, Wlodzimierz Skiba -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_CHOICEBOOK_H_ -#define _WX_CHOICEBOOK_H_ - -#include "wx/defs.h" - -#if wxUSE_CHOICEBOOK - -#include "wx/bookctrl.h" -#include "wx/choice.h" - -class WXDLLIMPEXP_FWD_CORE wxChoice; - -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_COMMAND_CHOICEBOOK_PAGE_CHANGED; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_COMMAND_CHOICEBOOK_PAGE_CHANGING; - -// wxChoicebook flags -#define wxCHB_DEFAULT wxBK_DEFAULT -#define wxCHB_TOP wxBK_TOP -#define wxCHB_BOTTOM wxBK_BOTTOM -#define wxCHB_LEFT wxBK_LEFT -#define wxCHB_RIGHT wxBK_RIGHT -#define wxCHB_ALIGN_MASK wxBK_ALIGN_MASK - -// ---------------------------------------------------------------------------- -// wxChoicebook -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxChoicebook : public wxBookCtrlBase -{ -public: - wxChoicebook() - { - Init(); - } - - wxChoicebook(wxWindow *parent, - wxWindowID id, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = 0, - const wxString& name = wxEmptyString) - { - Init(); - - (void)Create(parent, id, pos, size, style, name); - } - - // quasi ctor - bool Create(wxWindow *parent, - wxWindowID id, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = 0, - const wxString& name = wxEmptyString); - - - virtual int GetSelection() const; - virtual bool SetPageText(size_t n, const wxString& strText); - virtual wxString GetPageText(size_t n) const; - virtual int GetPageImage(size_t n) const; - virtual bool SetPageImage(size_t n, int imageId); - virtual wxSize CalcSizeFromPage(const wxSize& sizePage) const; - virtual bool InsertPage(size_t n, - wxWindow *page, - const wxString& text, - bool bSelect = false, - int imageId = -1); - virtual int SetSelection(size_t n) { return DoSetSelection(n, SetSelection_SendEvent); } - virtual int ChangeSelection(size_t n) { return DoSetSelection(n); } - virtual void SetImageList(wxImageList *imageList); - - virtual bool DeleteAllPages(); - - // returns the choice control - wxChoice* GetChoiceCtrl() const { return (wxChoice*)m_bookctrl; } - -protected: - virtual wxWindow *DoRemovePage(size_t page); - - // get the size which the choice control should have - virtual wxSize GetControllerSize() const; - - void UpdateSelectedPage(size_t newsel) - { - m_selection = wx_static_cast(int, newsel); - GetChoiceCtrl()->Select(m_selection); - } - - wxBookCtrlBaseEvent* CreatePageChangingEvent() const; - void MakeChangedEvent(wxBookCtrlBaseEvent &event); - - // event handlers - void OnChoiceSelected(wxCommandEvent& event); - - // the currently selected page or wxNOT_FOUND if none - int m_selection; - -private: - // common part of all constructors - void Init(); - - DECLARE_EVENT_TABLE() - DECLARE_DYNAMIC_CLASS_NO_COPY(wxChoicebook) -}; - -// ---------------------------------------------------------------------------- -// choicebook event class and related stuff -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxChoicebookEvent : public wxBookCtrlBaseEvent -{ -public: - wxChoicebookEvent(wxEventType commandType = wxEVT_NULL, int id = 0, - int nSel = -1, int nOldSel = -1) - : wxBookCtrlBaseEvent(commandType, id, nSel, nOldSel) - { - } - - wxChoicebookEvent(const wxChoicebookEvent& event) - : wxBookCtrlBaseEvent(event) - { - } - - virtual wxEvent *Clone() const { return new wxChoicebookEvent(*this); } - -private: - DECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxChoicebookEvent) -}; - -typedef void (wxEvtHandler::*wxChoicebookEventFunction)(wxChoicebookEvent&); - -#define wxChoicebookEventHandler(func) \ - (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxChoicebookEventFunction, &func) - -#define EVT_CHOICEBOOK_PAGE_CHANGED(winid, fn) \ - wx__DECLARE_EVT1(wxEVT_COMMAND_CHOICEBOOK_PAGE_CHANGED, winid, wxChoicebookEventHandler(fn)) - -#define EVT_CHOICEBOOK_PAGE_CHANGING(winid, fn) \ - wx__DECLARE_EVT1(wxEVT_COMMAND_CHOICEBOOK_PAGE_CHANGING, winid, wxChoicebookEventHandler(fn)) - -#endif // wxUSE_CHOICEBOOK - -#endif // _WX_CHOICEBOOK_H_ diff --git a/wxWidgets/include/wx/clipbrd.h b/wxWidgets/include/wx/clipbrd.h deleted file mode 100644 index 6f6ab4bf96..0000000000 --- a/wxWidgets/include/wx/clipbrd.h +++ /dev/null @@ -1,145 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/clipbrd.h -// Purpose: wxClipboad class and clipboard functions -// Author: Vadim Zeitlin -// Modified by: -// Created: 19.10.99 -// RCS-ID: $Id: clipbrd.h 49563 2007-10-31 20:46:21Z VZ $ -// Copyright: (c) wxWidgets Team -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_CLIPBRD_H_BASE_ -#define _WX_CLIPBRD_H_BASE_ - -#include "wx/defs.h" - -#if wxUSE_CLIPBOARD - - -#include "wx/object.h" -#include "wx/wxchar.h" - -class WXDLLIMPEXP_FWD_CORE wxDataFormat; -class WXDLLIMPEXP_FWD_CORE wxDataObject; -class WXDLLIMPEXP_FWD_CORE wxClipboard; - -// ---------------------------------------------------------------------------- -// wxClipboard represents the system clipboard. Normally, you should use -// wxTheClipboard which is a global pointer to the (unique) clipboard. -// -// Clipboard can be used to copy data to/paste data from. It works together -// with wxDataObject. -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxClipboardBase : public wxObject -{ -public: - wxClipboardBase() {} - - // open the clipboard before Add/SetData() and GetData() - virtual bool Open() = 0; - - // close the clipboard after Add/SetData() and GetData() - virtual void Close() = 0; - - // query whether the clipboard is opened - virtual bool IsOpened() const = 0; - - // add to the clipboard data - // - // NB: the clipboard owns the pointer and will delete it, so data must be - // allocated on the heap - virtual bool AddData( wxDataObject *data ) = 0; - - // set the clipboard data, this is the same as Clear() followed by - // AddData() - virtual bool SetData( wxDataObject *data ) = 0; - - // ask if data in correct format is available - virtual bool IsSupported( const wxDataFormat& format ) = 0; - - // fill data with data on the clipboard (if available) - virtual bool GetData( wxDataObject& data ) = 0; - - // clears wxTheClipboard and the system's clipboard if possible - virtual void Clear() = 0; - - // 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() { return false; } - - // X11 has two clipboards which get selected by this call. Empty on MSW. - virtual void UsePrimarySelection( bool WXUNUSED(primary) = false ) { } - - // Returns global instance (wxTheClipboard) of the object: - static wxClipboard *Get(); -}; - -// ---------------------------------------------------------------------------- -// globals -// ---------------------------------------------------------------------------- - -// The global clipboard object - backward compatible access macro: -#define wxTheClipboard (wxClipboard::Get()) - -// ---------------------------------------------------------------------------- -// include platform-specific class declaration -// ---------------------------------------------------------------------------- - -#if defined(__WXMSW__) - #include "wx/msw/clipbrd.h" -#elif defined(__WXMOTIF__) - #include "wx/motif/clipbrd.h" -#elif defined(__WXGTK20__) - #include "wx/gtk/clipbrd.h" -#elif defined(__WXGTK__) - #include "wx/gtk1/clipbrd.h" -#elif defined(__WXX11__) - #include "wx/x11/clipbrd.h" -#elif defined(__WXMGL__) - #include "wx/mgl/clipbrd.h" -#elif defined(__WXMAC__) - #include "wx/mac/clipbrd.h" -#elif defined(__WXCOCOA__) - #include "wx/cocoa/clipbrd.h" -#elif defined(__WXPM__) - #include "wx/os2/clipbrd.h" -#endif - -// ---------------------------------------------------------------------------- -// helpful class for opening the clipboard and automatically closing it -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxClipboardLocker -{ -public: - wxClipboardLocker(wxClipboard *clipboard = (wxClipboard *)NULL) - { - m_clipboard = clipboard ? clipboard : wxTheClipboard; - if ( m_clipboard ) - { - m_clipboard->Open(); - } - } - - bool operator!() const { return !m_clipboard->IsOpened(); } - - ~wxClipboardLocker() - { - if ( m_clipboard ) - { - m_clipboard->Close(); - } - } - -private: - wxClipboard *m_clipboard; - - DECLARE_NO_COPY_CLASS(wxClipboardLocker) -}; - -#endif // wxUSE_CLIPBOARD - -#endif // _WX_CLIPBRD_H_BASE_ diff --git a/wxWidgets/include/wx/clntdata.h b/wxWidgets/include/wx/clntdata.h deleted file mode 100644 index 1707ac7648..0000000000 --- a/wxWidgets/include/wx/clntdata.h +++ /dev/null @@ -1,273 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/clntdata.h -// Purpose: A mixin class for holding a wxClientData or void pointer -// Author: Robin Dunn -// Modified by: -// Created: 9-Oct-2001 -// RCS-ID: $Id: clntdata.h 36973 2006-01-18 16:45:41Z JS $ -// Copyright: (c) wxWidgets team -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_CLNTDATAH__ -#define _WX_CLNTDATAH__ - -#include "wx/defs.h" -#include "wx/string.h" -#include "wx/hashmap.h" - -typedef int (*wxShadowObjectMethod)(void*, void*); -WX_DECLARE_STRING_HASH_MAP_WITH_DECL( - wxShadowObjectMethod, - wxShadowObjectMethods, - class WXDLLIMPEXP_BASE -); -WX_DECLARE_STRING_HASH_MAP_WITH_DECL( - void *, - wxShadowObjectFields, - class WXDLLIMPEXP_BASE -); - -class WXDLLIMPEXP_BASE wxShadowObject -{ -public: - wxShadowObject() { } - - void AddMethod( const wxString &name, wxShadowObjectMethod method ) - { - wxShadowObjectMethods::iterator it = m_methods.find( name ); - if (it == m_methods.end()) - m_methods[ name ] = method; - else - it->second = method; - } - - bool InvokeMethod( const wxString &name, void* window, void* param, int* returnValue ) - { - wxShadowObjectMethods::iterator it = m_methods.find( name ); - if (it == m_methods.end()) - return false; - wxShadowObjectMethod method = it->second; - int ret = (*method)(window, param); - if (returnValue) - *returnValue = ret; - return true; - } - - void AddField( const wxString &name, void* initialValue = NULL ) - { - wxShadowObjectFields::iterator it = m_fields.find( name ); - if (it == m_fields.end()) - m_fields[ name ] = initialValue; - else - it->second = initialValue; - } - - void SetField( const wxString &name, void* value ) - { - wxShadowObjectFields::iterator it = m_fields.find( name ); - if (it == m_fields.end()) - return; - it->second = value; - } - - void* GetField( const wxString &name, void *defaultValue = NULL ) - { - wxShadowObjectFields::iterator it = m_fields.find( name ); - if (it == m_fields.end()) - return defaultValue; - return it->second; - } - -private: - wxShadowObjectMethods m_methods; - wxShadowObjectFields m_fields; -}; - - -// ---------------------------------------------------------------------------- - -// what kind of client data do we have? -enum wxClientDataType -{ - wxClientData_None, // we don't know yet because we don't have it at all - wxClientData_Object, // our client data is typed and we own it - wxClientData_Void // client data is untyped and we don't own it -}; - -class WXDLLIMPEXP_BASE wxClientData -{ -public: - wxClientData() { } - virtual ~wxClientData() { } -}; - -class WXDLLIMPEXP_BASE wxStringClientData : public wxClientData -{ -public: - wxStringClientData() : m_data() { } - wxStringClientData( const wxString &data ) : m_data(data) { } - void SetData( const wxString &data ) { m_data = data; } - const wxString& GetData() const { return m_data; } - -private: - wxString m_data; -}; - -// This class is a mixin that provides storage and management of "client -// data." The client data stored can either be a pointer to a wxClientData -// object in which case it is managed by the container (i.e. it will delete -// the data when it's destroyed) or an untyped pointer which won't be deleted -// by the container - but not both of them -// -// NOTE: This functionality is currently duplicated in wxEvtHandler in order -// to avoid having more than one vtable in that class hierarchy. - -class WXDLLIMPEXP_BASE wxClientDataContainer -{ -public: - wxClientDataContainer(); - virtual ~wxClientDataContainer(); - - void SetClientObject( wxClientData *data ) { DoSetClientObject(data); } - wxClientData *GetClientObject() const { return DoGetClientObject(); } - - void SetClientData( void *data ) { DoSetClientData(data); } - void *GetClientData() const { return DoGetClientData(); } - -protected: - // The user data: either an object which will be deleted by the container - // when it's deleted or some raw pointer which we do nothing with. Only - // one type of data can be used with the given window, i.e. you cannot set - // the void data and then associate the container with wxClientData or vice - // versa. - union - { - wxClientData *m_clientObject; - void *m_clientData; - }; - - // client data accessors - virtual void DoSetClientObject( wxClientData *data ); - virtual wxClientData *DoGetClientObject() const; - - virtual void DoSetClientData( void *data ); - virtual void *DoGetClientData() const; - - // what kind of data do we have? - wxClientDataType m_clientDataType; - -}; - -#include "wx/vector.h" - -struct WXDLLIMPEXP_BASE wxClientDataDictionaryPair -{ - wxClientDataDictionaryPair( size_t idx ) : index( idx ), data( 0 ) { } - - size_t index; - wxClientData* data; -}; - -_WX_DECLARE_VECTOR( - wxClientDataDictionaryPair, - wxClientDataDictionaryPairVector, - WXDLLIMPEXP_BASE -); - -// this class is used internally to maintain the association between items -// of (some subclasses of) wxControlWithItems and their client data -// NOTE: this class does not keep track of whether it contains -// wxClientData or void*. The client must ensure that -// it does not contain a mix of the two, and that -// DestroyData is called if it contains wxClientData -class WXDLLIMPEXP_BASE wxClientDataDictionary -{ -public: - wxClientDataDictionary() {} - - // deletes all the data - void DestroyData() - { - for( size_t i = 0, end = m_vec.size(); i != end; ++i ) - delete m_vec[i].data; - m_vec.clear(); - } - - // if data for the given index is not present, add it, - // if it is present, delete the old data and replace it with - // the new one - void Set( size_t index, wxClientData* data, bool doDelete ) - { - size_t ptr = Find( index ); - - if( !data ) - { - if( ptr == m_vec.size() ) return; - if( doDelete ) - delete m_vec[ptr].data; - m_vec.erase( ptr ); - } - else - { - if( ptr == m_vec.size() ) - { - m_vec.push_back( wxClientDataDictionaryPair( index ) ); - ptr = m_vec.size() - 1; - } - - if( doDelete ) - delete m_vec[ptr].data; - m_vec[ptr].data = data; - } - } - - // get the data associated with the given index, - // return 0 if not found - wxClientData* Get( size_t index ) const - { - size_t it = Find( index ); - if( it == m_vec.size() ) return 0; - return (wxClientData*)m_vec[it].data; // const cast - } - - // delete the data associated with the given index - // it also decreases by one the indices of all the elements - // with an index greater than the given index - void Delete( size_t index, bool doDelete ) - { - size_t todel = m_vec.size(); - - for( size_t i = 0, end = m_vec.size(); i != end; ++i ) - { - if( m_vec[i].index == index ) - todel = i; - else if( m_vec[i].index > index ) - --(m_vec[i].index); - } - - if( todel != m_vec.size() ) - { - if( doDelete ) - delete m_vec[todel].data; - m_vec.erase( todel ); - } - } -private: - // returns MyVec.size() if not found - size_t Find( size_t index ) const - { - for( size_t i = 0, end = m_vec.size(); i != end; ++i ) - { - if( m_vec[i].index == index ) - return i; - } - - return m_vec.size(); - } - - wxClientDataDictionaryPairVector m_vec; -}; - -#endif // _WX_CLNTDATAH__ - diff --git a/wxWidgets/include/wx/clrpicker.h b/wxWidgets/include/wx/clrpicker.h deleted file mode 100644 index 1dd2c4b3d0..0000000000 --- a/wxWidgets/include/wx/clrpicker.h +++ /dev/null @@ -1,200 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/clrpicker.h -// Purpose: wxColourPickerCtrl base header -// Author: Francesco Montorsi (based on Vadim Zeitlin's code) -// Modified by: -// Created: 14/4/2006 -// Copyright: (c) Vadim Zeitlin, Francesco Montorsi -// RCS-ID: $Id: clrpicker.h 53135 2008-04-12 02:31:04Z VZ $ -// Licence: wxWindows Licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_CLRPICKER_H_BASE_ -#define _WX_CLRPICKER_H_BASE_ - -#include "wx/defs.h" - - -#if wxUSE_COLOURPICKERCTRL - -#include "wx/pickerbase.h" - - -class WXDLLIMPEXP_FWD_CORE wxColourPickerEvent; - -extern WXDLLEXPORT_DATA(const wxChar) wxColourPickerWidgetNameStr[]; -extern WXDLLEXPORT_DATA(const wxChar) wxColourPickerCtrlNameStr[]; - - -// ---------------------------------------------------------------------------- -// wxColourPickerWidgetBase: a generic abstract interface which must be -// implemented by controls used by wxColourPickerCtrl -// ---------------------------------------------------------------------------- - -class WXDLLIMPEXP_CORE wxColourPickerWidgetBase -{ -public: - wxColourPickerWidgetBase() { m_colour = *wxBLACK; } - virtual ~wxColourPickerWidgetBase() {} - - wxColour GetColour() const - { return m_colour; } - virtual void SetColour(const wxColour &col) - { m_colour = col; UpdateColour(); } - virtual void SetColour(const wxString &col) - { m_colour.Set(col); UpdateColour(); } - -protected: - - virtual void UpdateColour() = 0; - - // the current colour (may be invalid if none) - wxColour m_colour; -}; - - -// Styles which must be supported by all controls implementing wxColourPickerWidgetBase -// NB: these styles must be defined to carefully-chosen values to -// avoid conflicts with wxButton's styles - -// show the colour in HTML form (#AABBCC) as colour button label -// (instead of no label at all) -// NOTE: this style is supported just by wxColourButtonGeneric and -// thus is not exposed in wxColourPickerCtrl -#define wxCLRP_SHOW_LABEL 0x0008 - -// map platform-dependent controls which implement the wxColourPickerWidgetBase -// under the name "wxColourPickerWidget". -// NOTE: wxColourPickerCtrl allocates a wxColourPickerWidget and relies on the -// fact that all classes being mapped as wxColourPickerWidget have the -// same prototype for their contructor (and also explains why we use -// define instead of a typedef) -// since GTK > 2.4, there is GtkColorButton -#if defined(__WXGTK24__) && !defined(__WXUNIVERSAL__) - #include "wx/gtk/clrpicker.h" - #define wxColourPickerWidget wxColourButton -#else - #include "wx/generic/clrpickerg.h" - #define wxColourPickerWidget wxGenericColourButton -#endif - - -// ---------------------------------------------------------------------------- -// wxColourPickerCtrl: platform-independent class which embeds a -// platform-dependent wxColourPickerWidget and, if wxCLRP_USE_TEXTCTRL style is -// used, a textctrl next to it. -// ---------------------------------------------------------------------------- - -#define wxCLRP_USE_TEXTCTRL (wxPB_USE_TEXTCTRL) -#define wxCLRP_DEFAULT_STYLE 0 - -class WXDLLIMPEXP_CORE wxColourPickerCtrl : public wxPickerBase -{ -public: - wxColourPickerCtrl() : m_bIgnoreNextTextCtrlUpdate(false) {} - virtual ~wxColourPickerCtrl() {} - - - wxColourPickerCtrl(wxWindow *parent, wxWindowID id, - const wxColour& col = *wxBLACK, const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, long style = wxCLRP_DEFAULT_STYLE, - const wxValidator& validator = wxDefaultValidator, - const wxString& name = wxColourPickerCtrlNameStr) - : m_bIgnoreNextTextCtrlUpdate(false) - { Create(parent, id, col, pos, size, style, validator, name); } - - bool Create(wxWindow *parent, wxWindowID id, - const wxColour& col = *wxBLACK, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = wxCLRP_DEFAULT_STYLE, - const wxValidator& validator = wxDefaultValidator, - const wxString& name = wxColourPickerCtrlNameStr); - - -public: // public API - - // get the colour chosen - wxColour GetColour() const - { return ((wxColourPickerWidget *)m_picker)->GetColour(); } - - // set currently displayed color - void SetColour(const wxColour& col); - - // set colour using RGB(r,g,b) syntax or considering given text as a colour name; - // returns true if the given text was successfully recognized. - bool SetColour(const wxString& text); - - -public: // internal functions - - // update the button colour to match the text control contents - void UpdatePickerFromTextCtrl(); - - // update the text control to match the button's colour - void UpdateTextCtrlFromPicker(); - - // event handler for our picker - void OnColourChange(wxColourPickerEvent &); - -protected: - virtual long GetPickerStyle(long style) const - { return (style & wxCLRP_SHOW_LABEL); } - - // true if the next UpdateTextCtrl() call is to ignore - bool m_bIgnoreNextTextCtrlUpdate; - -private: - DECLARE_DYNAMIC_CLASS(wxColourPickerCtrl) -}; - - -// ---------------------------------------------------------------------------- -// wxColourPickerEvent: used by wxColourPickerCtrl only -// ---------------------------------------------------------------------------- - -BEGIN_DECLARE_EVENT_TYPES() - DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_CORE, wxEVT_COMMAND_COLOURPICKER_CHANGED, 1102) -END_DECLARE_EVENT_TYPES() - -class WXDLLIMPEXP_CORE wxColourPickerEvent : public wxCommandEvent -{ -public: - wxColourPickerEvent() {} - wxColourPickerEvent(wxObject *generator, int id, const wxColour &col) - : wxCommandEvent(wxEVT_COMMAND_COLOURPICKER_CHANGED, id), - m_colour(col) - { - SetEventObject(generator); - } - - wxColour GetColour() const { return m_colour; } - void SetColour(const wxColour &c) { m_colour = c; } - - - // default copy ctor, assignment operator and dtor are ok - virtual wxEvent *Clone() const { return new wxColourPickerEvent(*this); } - -private: - wxColour m_colour; - - DECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxColourPickerEvent) -}; - -// ---------------------------------------------------------------------------- -// event types and macros -// ---------------------------------------------------------------------------- - -typedef void (wxEvtHandler::*wxColourPickerEventFunction)(wxColourPickerEvent&); - -#define wxColourPickerEventHandler(func) \ - (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxColourPickerEventFunction, &func) - -#define EVT_COLOURPICKER_CHANGED(id, fn) \ - wx__DECLARE_EVT1(wxEVT_COMMAND_COLOURPICKER_CHANGED, id, wxColourPickerEventHandler(fn)) - - -#endif // wxUSE_COLOURPICKERCTRL - -#endif // _WX_CLRPICKER_H_BASE_ - diff --git a/wxWidgets/include/wx/cmdline.h b/wxWidgets/include/wx/cmdline.h deleted file mode 100644 index 50a17ce7a7..0000000000 --- a/wxWidgets/include/wx/cmdline.h +++ /dev/null @@ -1,239 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: wx/cmdline.h -// Purpose: wxCmdLineParser and related classes for parsing the command -// line options -// Author: Vadim Zeitlin -// Modified by: -// Created: 04.01.00 -// RCS-ID: $Id: cmdline.h 49563 2007-10-31 20:46:21Z VZ $ -// Copyright: (c) 2000 Vadim Zeitlin -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_CMDLINE_H_ -#define _WX_CMDLINE_H_ - -#include "wx/defs.h" - -#include "wx/string.h" -#include "wx/arrstr.h" - -#if wxUSE_CMDLINE_PARSER - -class WXDLLIMPEXP_FWD_BASE wxDateTime; - -// ---------------------------------------------------------------------------- -// constants -// ---------------------------------------------------------------------------- - -// by default, options are optional (sic) and each call to AddParam() allows -// one more parameter - this may be changed by giving non-default flags to it -enum -{ - wxCMD_LINE_OPTION_MANDATORY = 0x01, // this option must be given - wxCMD_LINE_PARAM_OPTIONAL = 0x02, // the parameter may be omitted - wxCMD_LINE_PARAM_MULTIPLE = 0x04, // the parameter may be repeated - wxCMD_LINE_OPTION_HELP = 0x08, // this option is a help request - wxCMD_LINE_NEEDS_SEPARATOR = 0x10 // must have sep before the value -}; - -// an option value or parameter may be a string (the most common case), a -// number or a date -enum wxCmdLineParamType -{ - wxCMD_LINE_VAL_STRING, // should be 0 (default) - wxCMD_LINE_VAL_NUMBER, - wxCMD_LINE_VAL_DATE, - wxCMD_LINE_VAL_NONE -}; - -// for constructing the cmd line description using Init() -enum wxCmdLineEntryType -{ - wxCMD_LINE_SWITCH, - wxCMD_LINE_OPTION, - wxCMD_LINE_PARAM, - wxCMD_LINE_NONE // to terminate the list -}; - -// ---------------------------------------------------------------------------- -// wxCmdLineEntryDesc is a description of one command line -// switch/option/parameter -// ---------------------------------------------------------------------------- - -struct wxCmdLineEntryDesc -{ - wxCmdLineEntryType kind; - const wxChar *shortName; - const wxChar *longName; - const wxChar *description; - wxCmdLineParamType type; - int flags; -}; - -// ---------------------------------------------------------------------------- -// wxCmdLineParser is a class for parsing command line. -// -// It has the following features: -// -// 1. distinguishes options, switches and parameters; allows option grouping -// 2. allows both short and long options -// 3. automatically generates the usage message from the cmd line description -// 4. does type checks on the options values (number, date, ...) -// -// To use it you should: -// -// 1. construct it giving it the cmd line to parse and optionally its desc -// 2. construct the cmd line description using AddXXX() if not done in (1) -// 3. call Parse() -// 4. use GetXXX() to retrieve the parsed info -// ---------------------------------------------------------------------------- - -class WXDLLIMPEXP_BASE wxCmdLineParser -{ -public: - // ctors and initializers - // ---------------------- - - // default ctor or ctor giving the cmd line in either Unix or Win form - wxCmdLineParser() { Init(); } - wxCmdLineParser(int argc, char **argv) { Init(); SetCmdLine(argc, argv); } -#if wxUSE_UNICODE - wxCmdLineParser(int argc, wxChar **argv) { Init(); SetCmdLine(argc, argv); } -#endif // wxUSE_UNICODE - wxCmdLineParser(const wxString& cmdline) { Init(); SetCmdLine(cmdline); } - - // the same as above, but also gives the cmd line description - otherwise, - // use AddXXX() later - wxCmdLineParser(const wxCmdLineEntryDesc *desc) - { Init(); SetDesc(desc); } - wxCmdLineParser(const wxCmdLineEntryDesc *desc, int argc, char **argv) - { Init(); SetCmdLine(argc, argv); SetDesc(desc); } -#if wxUSE_UNICODE - wxCmdLineParser(const wxCmdLineEntryDesc *desc, int argc, wxChar **argv) - { Init(); SetCmdLine(argc, argv); SetDesc(desc); } -#endif // wxUSE_UNICODE - wxCmdLineParser(const wxCmdLineEntryDesc *desc, const wxString& cmdline) - { Init(); SetCmdLine(cmdline); SetDesc(desc); } - - // set cmd line to parse after using one of the ctors which don't do it - void SetCmdLine(int argc, char **argv); -#if wxUSE_UNICODE - void SetCmdLine(int argc, wxChar **argv); -#endif // wxUSE_UNICODE - void SetCmdLine(const wxString& cmdline); - - // not virtual, don't use this class polymorphically - ~wxCmdLineParser(); - - // set different parser options - // ---------------------------- - - // by default, '-' is switch char under Unix, '-' or '/' under Win: - // switchChars contains all characters with which an option or switch may - // start - void SetSwitchChars(const wxString& switchChars); - - // long options are not POSIX-compliant, this option allows to disable them - void EnableLongOptions(bool enable = true); - void DisableLongOptions() { EnableLongOptions(false); } - - bool AreLongOptionsEnabled(); - - // extra text may be shown by Usage() method if set by this function - void SetLogo(const wxString& logo); - - // construct the cmd line description - // ---------------------------------- - - // take the cmd line description from the wxCMD_LINE_NONE terminated table - void SetDesc(const wxCmdLineEntryDesc *desc); - - // a switch: i.e. an option without value - void AddSwitch(const wxString& name, const wxString& lng = wxEmptyString, - const wxString& desc = wxEmptyString, - int flags = 0); - - // an option taking a value of the given type - void AddOption(const wxString& name, const wxString& lng = wxEmptyString, - const wxString& desc = wxEmptyString, - wxCmdLineParamType type = wxCMD_LINE_VAL_STRING, - int flags = 0); - - // a parameter - void AddParam(const wxString& desc = wxEmptyString, - wxCmdLineParamType type = wxCMD_LINE_VAL_STRING, - int flags = 0); - - // actions - // ------- - - // parse the command line, return 0 if ok, -1 if "-h" or "--help" option - // was encountered and the help message was given or a positive value if a - // syntax error occurred - // - // if showUsage is true, Usage() is called in case of syntax error or if - // help was requested - int Parse(bool showUsage = true); - - // give the usage message describing all program options - void Usage(); - - // get the command line arguments - // ------------------------------ - - // returns true if the given switch was found - bool Found(const wxString& name) const; - - // returns true if an option taking a string value was found and stores the - // value in the provided pointer - bool Found(const wxString& name, wxString *value) const; - - // returns true if an option taking an integer value was found and stores - // the value in the provided pointer - bool Found(const wxString& name, long *value) const; - -#if wxUSE_DATETIME - // returns true if an option taking a date value was found and stores the - // value in the provided pointer - bool Found(const wxString& name, wxDateTime *value) const; -#endif // wxUSE_DATETIME - - // gets the number of parameters found - size_t GetParamCount() const; - - // gets the value of Nth parameter (as string only for now) - wxString GetParam(size_t n = 0u) const; - - // Resets switches and options - void Reset(); - - // break down the command line in arguments - static wxArrayString ConvertStringToArgs(const wxChar *cmdline); - -private: - // get usage string - wxString GetUsageString(); - - // common part of all ctors - void Init(); - - struct wxCmdLineParserData *m_data; - - DECLARE_NO_COPY_CLASS(wxCmdLineParser) -}; - -#else // !wxUSE_CMDLINE_PARSER - -// this function is always available (even if !wxUSE_CMDLINE_PARSER) because it -// is used by wxWin itself under Windows -class WXDLLIMPEXP_BASE wxCmdLineParser -{ -public: - static wxArrayString ConvertStringToArgs(const wxChar *cmdline); -}; - -#endif // wxUSE_CMDLINE_PARSER/!wxUSE_CMDLINE_PARSER - -#endif // _WX_CMDLINE_H_ - diff --git a/wxWidgets/include/wx/cmdproc.h b/wxWidgets/include/wx/cmdproc.h deleted file mode 100644 index 0b101a14aa..0000000000 --- a/wxWidgets/include/wx/cmdproc.h +++ /dev/null @@ -1,144 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: wx/cmdproc.h -// Purpose: undo/redo capable command processing framework -// Author: Julian Smart (extracted from docview.h by VZ) -// Modified by: -// Created: 05.11.00 -// RCS-ID: $Id: cmdproc.h 49804 2007-11-10 01:09:42Z VZ $ -// Copyright: (c) wxWidgets team -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_CMDPROC_H_ -#define _WX_CMDPROC_H_ - -#include "wx/defs.h" -#include "wx/object.h" -#include "wx/list.h" - -class WXDLLIMPEXP_FWD_CORE wxMenu; - -// ---------------------------------------------------------------------------- -// wxCommand: a single command capable of performing itself -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxCommand : public wxObject -{ -public: - wxCommand(bool canUndoIt = false, const wxString& name = wxEmptyString); - virtual ~wxCommand(){} - - // Override this to perform a command - virtual bool Do() = 0; - - // Override this to undo a command - virtual bool Undo() = 0; - - virtual bool CanUndo() const { return m_canUndo; } - virtual wxString GetName() const { return m_commandName; } - -protected: - bool m_canUndo; - wxString m_commandName; - -private: - DECLARE_CLASS(wxCommand) -}; - -// ---------------------------------------------------------------------------- -// wxCommandProcessor: wxCommand manager -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxCommandProcessor : public wxObject -{ -public: - // if max number of commands is -1, it is unlimited - wxCommandProcessor(int maxCommands = -1); - virtual ~wxCommandProcessor(); - - // Pass a command to the processor. The processor calls Do(); if - // successful, is appended to the command history unless storeIt is false. - virtual bool Submit(wxCommand *command, bool storeIt = true); - - // just store the command without executing it - virtual void Store(wxCommand *command); - - virtual bool Undo(); - virtual bool Redo(); - virtual bool CanUndo() const; - virtual bool CanRedo() const; - - // Initialises the current command and menu strings. - virtual void Initialize(); - - // Sets the Undo/Redo menu strings for the current menu. - virtual void SetMenuStrings(); - - // Gets the current Undo menu label. - wxString GetUndoMenuLabel() const; - - // Gets the current Undo menu label. - wxString GetRedoMenuLabel() const; - -#if wxUSE_MENUS - // Call this to manage an edit menu. - void SetEditMenu(wxMenu *menu) { m_commandEditMenu = menu; } - wxMenu *GetEditMenu() const { return m_commandEditMenu; } -#endif // wxUSE_MENUS - - // command list access - wxList& GetCommands() { return m_commands; } - const wxList& GetCommands() const { return m_commands; } - wxCommand *GetCurrentCommand() const - { - return (wxCommand *)(m_currentCommand ? m_currentCommand->GetData() : NULL); - } - int GetMaxCommands() const { return m_maxNoCommands; } - virtual void ClearCommands(); - - // Has the current project been changed? - virtual bool IsDirty() const - { - return m_currentCommand && (m_lastSavedCommand != m_currentCommand); - } - - // Mark the current command as the one where the last save took place - void MarkAsSaved() - { - m_lastSavedCommand = m_currentCommand; - } - - - // By default, the accelerators are "\tCtrl+Z" and "\tCtrl+Y" - const wxString& GetUndoAccelerator() const { return m_undoAccelerator; } - const wxString& GetRedoAccelerator() const { return m_redoAccelerator; } - - void SetUndoAccelerator(const wxString& accel) { m_undoAccelerator = accel; } - void SetRedoAccelerator(const wxString& accel) { m_redoAccelerator = accel; } - -protected: - // for further flexibility, command processor doesn't call wxCommand::Do() - // and Undo() directly but uses these functions which can be overridden in - // the derived class - virtual bool DoCommand(wxCommand& cmd); - virtual bool UndoCommand(wxCommand& cmd); - - int m_maxNoCommands; - wxList m_commands; - wxList::compatibility_iterator m_currentCommand, - m_lastSavedCommand; - -#if wxUSE_MENUS - wxMenu* m_commandEditMenu; -#endif // wxUSE_MENUS - - wxString m_undoAccelerator; - wxString m_redoAccelerator; - -private: - DECLARE_DYNAMIC_CLASS(wxCommandProcessor) - DECLARE_NO_COPY_CLASS(wxCommandProcessor) -}; - -#endif // _WX_CMDPROC_H_ - diff --git a/wxWidgets/include/wx/cmndata.h b/wxWidgets/include/wx/cmndata.h deleted file mode 100644 index 30310e21c4..0000000000 --- a/wxWidgets/include/wx/cmndata.h +++ /dev/null @@ -1,454 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/cmndata.h -// Purpose: Common GDI data classes -// Author: Julian Smart and others -// Modified by: -// Created: 01/02/97 -// RCS-ID: $Id: cmndata.h 53135 2008-04-12 02:31:04Z VZ $ -// Copyright: (c) -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_CMNDATA_H_BASE_ -#define _WX_CMNDATA_H_BASE_ - -#include "wx/window.h" -#include "wx/font.h" -#include "wx/encinfo.h" -#include "wx/colour.h" -#include "wx/gdicmn.h" - -#if wxUSE_STREAMS -#include "wx/stream.h" -#endif - - -class WXDLLIMPEXP_FWD_CORE wxPrintNativeDataBase; - - -class WXDLLEXPORT wxColourData: public wxObject -{ -public: - wxColourData(); - wxColourData(const wxColourData& data); - virtual ~wxColourData(); - - void SetChooseFull(bool flag) { m_chooseFull = flag; } - bool GetChooseFull() const { return m_chooseFull; } - void SetColour(const wxColour& colour) { m_dataColour = colour; } - const wxColour& GetColour() const { return m_dataColour; } - wxColour& GetColour() { return m_dataColour; } - - // Array of 16 custom colours - void SetCustomColour(int i, const wxColour& colour); - wxColour GetCustomColour(int i); - - void operator=(const wxColourData& data); - -public: - wxColour m_dataColour; - wxColour m_custColours[16]; - bool m_chooseFull; - -private: - DECLARE_DYNAMIC_CLASS(wxColourData) -}; - -class WXDLLEXPORT wxFontData : public wxObject -{ -public: - wxFontData(); - virtual ~wxFontData(); - - wxFontData(const wxFontData& data) - : wxObject(), - m_fontColour(data.m_fontColour), - m_showHelp(data.m_showHelp), - m_allowSymbols(data.m_allowSymbols), - m_enableEffects(data.m_enableEffects), - m_initialFont(data.m_initialFont), - m_chosenFont(data.m_chosenFont), - m_minSize(data.m_minSize), - m_maxSize(data.m_maxSize), - m_encoding(data.m_encoding), - m_encodingInfo(data.m_encodingInfo) - { - } - - wxFontData& operator=(const wxFontData& data) - { - wxObject::operator=(data); - m_fontColour = data.m_fontColour; - m_showHelp = data.m_showHelp; - m_allowSymbols = data.m_allowSymbols; - m_enableEffects = data.m_enableEffects; - m_initialFont = data.m_initialFont; - m_chosenFont = data.m_chosenFont; - m_minSize = data.m_minSize; - m_maxSize = data.m_maxSize; - m_encoding = data.m_encoding; - m_encodingInfo = data.m_encodingInfo; - return *this; - } - - void SetAllowSymbols(bool flag) { m_allowSymbols = flag; } - bool GetAllowSymbols() const { return m_allowSymbols; } - - void SetColour(const wxColour& colour) { m_fontColour = colour; } - const wxColour& GetColour() const { return m_fontColour; } - - void SetShowHelp(bool flag) { m_showHelp = flag; } - bool GetShowHelp() const { return m_showHelp; } - - void EnableEffects(bool flag) { m_enableEffects = flag; } - bool GetEnableEffects() const { return m_enableEffects; } - - void SetInitialFont(const wxFont& font) { m_initialFont = font; } - wxFont GetInitialFont() const { return m_initialFont; } - - void SetChosenFont(const wxFont& font) { m_chosenFont = font; } - wxFont GetChosenFont() const { return m_chosenFont; } - - void SetRange(int minRange, int maxRange) { m_minSize = minRange; m_maxSize = maxRange; } - - // encoding info is split into 2 parts: the logical wxWin encoding - // (wxFontEncoding) and a structure containing the native parameters for - // it (wxNativeEncodingInfo) - wxFontEncoding GetEncoding() const { return m_encoding; } - void SetEncoding(wxFontEncoding encoding) { m_encoding = encoding; } - - wxNativeEncodingInfo& EncodingInfo() { return m_encodingInfo; } - - - // public for backwards compatibility only: don't use directly -public: - wxColour m_fontColour; - bool m_showHelp; - bool m_allowSymbols; - bool m_enableEffects; - wxFont m_initialFont; - wxFont m_chosenFont; - int m_minSize; - int m_maxSize; - -private: - wxFontEncoding m_encoding; - wxNativeEncodingInfo m_encodingInfo; - -private: - DECLARE_DYNAMIC_CLASS(wxFontData) -}; - -#if wxUSE_PRINTING_ARCHITECTURE -/* - * wxPrintData - * Encapsulates printer information (not printer dialog information) - */ - -enum wxPrintBin -{ - wxPRINTBIN_DEFAULT, - - wxPRINTBIN_ONLYONE, - wxPRINTBIN_LOWER, - wxPRINTBIN_MIDDLE, - wxPRINTBIN_MANUAL, - wxPRINTBIN_ENVELOPE, - wxPRINTBIN_ENVMANUAL, - wxPRINTBIN_AUTO, - wxPRINTBIN_TRACTOR, - wxPRINTBIN_SMALLFMT, - wxPRINTBIN_LARGEFMT, - wxPRINTBIN_LARGECAPACITY, - wxPRINTBIN_CASSETTE, - wxPRINTBIN_FORMSOURCE, - - wxPRINTBIN_USER -}; - -const int wxPRINTMEDIA_DEFAULT = 0; - -class WXDLLEXPORT wxPrintData: public wxObject -{ -public: - wxPrintData(); - wxPrintData(const wxPrintData& printData); - virtual ~wxPrintData(); - - int GetNoCopies() const { return m_printNoCopies; } - bool GetCollate() const { return m_printCollate; } - int GetOrientation() const { return m_printOrientation; } - bool IsOrientationReversed() const { return m_printOrientationReversed; } - - // Is this data OK for showing the print dialog? - bool Ok() const { return IsOk(); } - bool IsOk() const ; - - const wxString& GetPrinterName() const { return m_printerName; } - bool GetColour() const { return m_colour; } - wxDuplexMode GetDuplex() const { return m_duplexMode; } - wxPaperSize GetPaperId() const { return m_paperId; } - const wxSize& GetPaperSize() const { return m_paperSize; } // Not used yet: confusable with paper size - // in wxPageSetupDialogData - wxPrintQuality GetQuality() const { return m_printQuality; } - wxPrintBin GetBin() const { return m_bin; } - wxPrintMode GetPrintMode() const { return m_printMode; } - int GetMedia() const { return m_media; } - - void SetNoCopies(int v) { m_printNoCopies = v; } - void SetCollate(bool flag) { m_printCollate = flag; } - void SetOrientation(int orient) { m_printOrientation = orient; } - void SetOrientationReversed(bool reversed) { m_printOrientationReversed = reversed; } - - void SetPrinterName(const wxString& name) { m_printerName = name; } - void SetColour(bool colour) { m_colour = colour; } - void SetDuplex(wxDuplexMode duplex) { m_duplexMode = duplex; } - void SetPaperId(wxPaperSize sizeId) { m_paperId = sizeId; } - void SetPaperSize(const wxSize& sz) { m_paperSize = sz; } - void SetQuality(wxPrintQuality quality) { m_printQuality = quality; } - void SetBin(wxPrintBin bin) { m_bin = bin; } - void SetMedia(int media) { m_media = media; } - void SetPrintMode(wxPrintMode printMode) { m_printMode = printMode; } - - wxString GetFilename() const { return m_filename; } - void SetFilename( const wxString &filename ) { m_filename = filename; } - - void operator=(const wxPrintData& data); - - char* GetPrivData() const { return m_privData; } - int GetPrivDataLen() const { return m_privDataLen; } - void SetPrivData( char *privData, int len ); - - -#if WXWIN_COMPATIBILITY_2_4 - // PostScript-specific data - wxString GetPrinterCommand() const; - wxString GetPrinterOptions() const; - wxString GetPreviewCommand() const; - wxString GetFontMetricPath() const; - double GetPrinterScaleX() const; - double GetPrinterScaleY() const; - long GetPrinterTranslateX() const; - long GetPrinterTranslateY() const; - - void SetPrinterCommand(const wxString& command); - void SetPrinterOptions(const wxString& options); - void SetPreviewCommand(const wxString& command); - void SetFontMetricPath(const wxString& path); - void SetPrinterScaleX(double x); - void SetPrinterScaleY(double y); - void SetPrinterScaling(double x, double y); - void SetPrinterTranslateX(long x); - void SetPrinterTranslateY(long y); - void SetPrinterTranslation(long x, long y); -#endif - - // Convert between wxPrintData and native data - void ConvertToNative(); - void ConvertFromNative(); - // Holds the native print data - wxPrintNativeDataBase *GetNativeData() const { return m_nativeData; } - -private: - wxPrintBin m_bin; - int m_media; - wxPrintMode m_printMode; - - int m_printNoCopies; - int m_printOrientation; - bool m_printOrientationReversed; - bool m_printCollate; - - wxString m_printerName; - bool m_colour; - wxDuplexMode m_duplexMode; - wxPrintQuality m_printQuality; - wxPaperSize m_paperId; - wxSize m_paperSize; - - wxString m_filename; - - char* m_privData; - int m_privDataLen; - - wxPrintNativeDataBase *m_nativeData; - -private: - DECLARE_DYNAMIC_CLASS(wxPrintData) -}; - -/* - * wxPrintDialogData - * Encapsulates information displayed and edited in the printer dialog box. - * Contains a wxPrintData object which is filled in according to the values retrieved - * from the dialog. - */ - -class WXDLLEXPORT wxPrintDialogData: public wxObject -{ -public: - wxPrintDialogData(); - wxPrintDialogData(const wxPrintDialogData& dialogData); - wxPrintDialogData(const wxPrintData& printData); - virtual ~wxPrintDialogData(); - - int GetFromPage() const { return m_printFromPage; } - int GetToPage() const { return m_printToPage; } - int GetMinPage() const { return m_printMinPage; } - int GetMaxPage() const { return m_printMaxPage; } - int GetNoCopies() const { return m_printNoCopies; } - bool GetAllPages() const { return m_printAllPages; } - bool GetSelection() const { return m_printSelection; } - bool GetCollate() const { return m_printCollate; } - bool GetPrintToFile() const { return m_printToFile; } -#if WXWIN_COMPATIBILITY_2_4 - bool GetSetupDialog() const { return m_printSetupDialog; } -#endif - void SetFromPage(int v) { m_printFromPage = v; } - void SetToPage(int v) { m_printToPage = v; } - void SetMinPage(int v) { m_printMinPage = v; } - void SetMaxPage(int v) { m_printMaxPage = v; } - void SetNoCopies(int v) { m_printNoCopies = v; } - void SetAllPages(bool flag) { m_printAllPages = flag; } - void SetSelection(bool flag) { m_printSelection = flag; } - void SetCollate(bool flag) { m_printCollate = flag; } - void SetPrintToFile(bool flag) { m_printToFile = flag; } -#if WXWIN_COMPATIBILITY_2_4 - void SetSetupDialog(bool flag) { m_printSetupDialog = flag; } -#endif - void EnablePrintToFile(bool flag) { m_printEnablePrintToFile = flag; } - void EnableSelection(bool flag) { m_printEnableSelection = flag; } - void EnablePageNumbers(bool flag) { m_printEnablePageNumbers = flag; } - void EnableHelp(bool flag) { m_printEnableHelp = flag; } - - bool GetEnablePrintToFile() const { return m_printEnablePrintToFile; } - bool GetEnableSelection() const { return m_printEnableSelection; } - bool GetEnablePageNumbers() const { return m_printEnablePageNumbers; } - bool GetEnableHelp() const { return m_printEnableHelp; } - - // Is this data OK for showing the print dialog? - bool Ok() const { return IsOk(); } - bool IsOk() const { return m_printData.Ok() ; } - - wxPrintData& GetPrintData() { return m_printData; } - void SetPrintData(const wxPrintData& printData) { m_printData = printData; } - - void operator=(const wxPrintDialogData& data); - void operator=(const wxPrintData& data); // Sets internal m_printData member - -private: - int m_printFromPage; - int m_printToPage; - int m_printMinPage; - int m_printMaxPage; - int m_printNoCopies; - bool m_printAllPages; - bool m_printCollate; - bool m_printToFile; - bool m_printSelection; - bool m_printEnableSelection; - bool m_printEnablePageNumbers; - bool m_printEnableHelp; - bool m_printEnablePrintToFile; -#if WXWIN_COMPATIBILITY_2_4 - bool m_printSetupDialog; -#endif - wxPrintData m_printData; - -private: - DECLARE_DYNAMIC_CLASS(wxPrintDialogData) -}; - -/* -* This is the data used (and returned) by the wxPageSetupDialog. -*/ - -// Compatibility with old name -#define wxPageSetupData wxPageSetupDialogData - -class WXDLLEXPORT wxPageSetupDialogData: public wxObject -{ -public: - wxPageSetupDialogData(); - wxPageSetupDialogData(const wxPageSetupDialogData& dialogData); - wxPageSetupDialogData(const wxPrintData& printData); - virtual ~wxPageSetupDialogData(); - - wxSize GetPaperSize() const { return m_paperSize; } - wxPaperSize GetPaperId() const { return m_printData.GetPaperId(); } - wxPoint GetMinMarginTopLeft() const { return m_minMarginTopLeft; } - wxPoint GetMinMarginBottomRight() const { return m_minMarginBottomRight; } - wxPoint GetMarginTopLeft() const { return m_marginTopLeft; } - wxPoint GetMarginBottomRight() const { return m_marginBottomRight; } - - bool GetDefaultMinMargins() const { return m_defaultMinMargins; } - bool GetEnableMargins() const { return m_enableMargins; } - bool GetEnableOrientation() const { return m_enableOrientation; } - bool GetEnablePaper() const { return m_enablePaper; } - bool GetEnablePrinter() const { return m_enablePrinter; } - bool GetDefaultInfo() const { return m_getDefaultInfo; } - bool GetEnableHelp() const { return m_enableHelp; } - - // Is this data OK for showing the page setup dialog? - bool Ok() const { return IsOk(); } - bool IsOk() const { return m_printData.Ok() ; } - - // If a corresponding paper type is found in the paper database, will set the m_printData - // paper size id member as well. - void SetPaperSize(const wxSize& sz); - - void SetPaperId(wxPaperSize id) { m_printData.SetPaperId(id); } - - // Sets the wxPrintData id, plus the paper width/height if found in the paper database. - void SetPaperSize(wxPaperSize id); - - void SetMinMarginTopLeft(const wxPoint& pt) { m_minMarginTopLeft = pt; } - void SetMinMarginBottomRight(const wxPoint& pt) { m_minMarginBottomRight = pt; } - void SetMarginTopLeft(const wxPoint& pt) { m_marginTopLeft = pt; } - void SetMarginBottomRight(const wxPoint& pt) { m_marginBottomRight = pt; } - void SetDefaultMinMargins(bool flag) { m_defaultMinMargins = flag; } - void SetDefaultInfo(bool flag) { m_getDefaultInfo = flag; } - - void EnableMargins(bool flag) { m_enableMargins = flag; } - void EnableOrientation(bool flag) { m_enableOrientation = flag; } - void EnablePaper(bool flag) { m_enablePaper = flag; } - void EnablePrinter(bool flag) { m_enablePrinter = flag; } - void EnableHelp(bool flag) { m_enableHelp = flag; } - - // Use paper size defined in this object to set the wxPrintData - // paper id - void CalculateIdFromPaperSize(); - - // Use paper id in wxPrintData to set this object's paper size - void CalculatePaperSizeFromId(); - - wxPageSetupDialogData& operator=(const wxPageSetupData& data); - wxPageSetupDialogData& operator=(const wxPrintData& data); - - wxPrintData& GetPrintData() { return m_printData; } - const wxPrintData& GetPrintData() const { return m_printData; } - void SetPrintData(const wxPrintData& printData); - -private: - wxSize m_paperSize; // The dimensions selected by the user (on return, same as in wxPrintData?) - wxPoint m_minMarginTopLeft; - wxPoint m_minMarginBottomRight; - wxPoint m_marginTopLeft; - wxPoint m_marginBottomRight; - bool m_defaultMinMargins; - bool m_enableMargins; - bool m_enableOrientation; - bool m_enablePaper; - bool m_enablePrinter; - bool m_getDefaultInfo; // Equiv. to PSD_RETURNDEFAULT - bool m_enableHelp; - wxPrintData m_printData; - -private: - DECLARE_DYNAMIC_CLASS(wxPageSetupDialogData) -}; - -#endif // wxUSE_PRINTING_ARCHITECTURE - -#endif -// _WX_CMNDATA_H_BASE_ diff --git a/wxWidgets/include/wx/collpane.h b/wxWidgets/include/wx/collpane.h deleted file mode 100644 index 1db6bfb540..0000000000 --- a/wxWidgets/include/wx/collpane.h +++ /dev/null @@ -1,104 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/collpane.h -// Purpose: wxCollapsiblePane -// Author: Francesco Montorsi -// Modified by: -// Created: 8/10/2006 -// RCS-ID: $Id: collpane.h 43300 2006-11-11 07:32:08Z RD $ -// Copyright: (c) Francesco Montorsi -// Licence: wxWindows Licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_COLLAPSABLE_PANE_H_BASE_ -#define _WX_COLLAPSABLE_PANE_H_BASE_ - -#include "wx/defs.h" - - -#if wxUSE_COLLPANE - -#include "wx/control.h" - - -// ---------------------------------------------------------------------------- -// wxCollapsiblePaneBase: interface for wxCollapsiblePane -// ---------------------------------------------------------------------------- - -#define wxCP_DEFAULT_STYLE (wxTAB_TRAVERSAL | wxNO_BORDER) -#define wxCP_NO_TLW_RESIZE (0x0002) - -class WXDLLIMPEXP_CORE wxCollapsiblePaneBase : public wxControl -{ -public: - wxCollapsiblePaneBase() {} - - virtual void Collapse(bool collapse = true) = 0; - void Expand() { Collapse(false); } - - virtual bool IsCollapsed() const = 0; - bool IsExpanded() const { return !IsCollapsed(); } - - virtual wxWindow *GetPane() const = 0; - - virtual wxString GetLabel() const = 0; - virtual void SetLabel(const wxString& label) = 0; -}; - - -// ---------------------------------------------------------------------------- -// event types and macros -// ---------------------------------------------------------------------------- - -BEGIN_DECLARE_EVENT_TYPES() - DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_CORE, wxEVT_COMMAND_COLLPANE_CHANGED, 1102) -END_DECLARE_EVENT_TYPES() - -class WXDLLIMPEXP_CORE wxCollapsiblePaneEvent : public wxCommandEvent -{ -public: - wxCollapsiblePaneEvent() {} - wxCollapsiblePaneEvent(wxObject *generator, int id, bool collapsed) - : wxCommandEvent(wxEVT_COMMAND_COLLPANE_CHANGED, id), - m_bCollapsed(collapsed) - { - SetEventObject(generator); - } - - bool GetCollapsed() const { return m_bCollapsed; } - void SetCollapsed(bool c) { m_bCollapsed = c; } - - - // default copy ctor, assignment operator and dtor are ok - virtual wxEvent *Clone() const { return new wxCollapsiblePaneEvent(*this); } - -private: - bool m_bCollapsed; - - DECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxCollapsiblePaneEvent) -}; - -// ---------------------------------------------------------------------------- -// event types and macros -// ---------------------------------------------------------------------------- - -typedef void (wxEvtHandler::*wxCollapsiblePaneEventFunction)(wxCollapsiblePaneEvent&); - -#define wxCollapsiblePaneEventHandler(func) \ - (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxCollapsiblePaneEventFunction, &func) - -#define EVT_COLLAPSIBLEPANE_CHANGED(id, fn) \ - wx__DECLARE_EVT1(wxEVT_COMMAND_COLLPANE_CHANGED, id, wxCollapsiblePaneEventHandler(fn)) - - -#if defined(__WXGTK24__) && !defined(__WXUNIVERSAL__) - #include "wx/gtk/collpane.h" -#else - #include "wx/generic/collpaneg.h" - - // use #define and not a typedef to allow forward declaring the class - #define wxCollapsiblePane wxGenericCollapsiblePane -#endif - -#endif // wxUSE_COLLPANE - -#endif // _WX_COLLAPSABLE_PANE_H_BASE_ diff --git a/wxWidgets/include/wx/colordlg.h b/wxWidgets/include/wx/colordlg.h deleted file mode 100644 index 83e416dcb4..0000000000 --- a/wxWidgets/include/wx/colordlg.h +++ /dev/null @@ -1,41 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/colrdlgg.h -// Purpose: wxColourDialog -// Author: Vadim Zeitiln -// Modified by: -// Created: 01/02/97 -// RCS-ID: $Id: colordlg.h 36623 2006-01-02 14:26:36Z JS $ -// Copyright: (c) wxWidgets team -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_COLORDLG_H_BASE_ -#define _WX_COLORDLG_H_BASE_ - -#include "wx/defs.h" - -#if wxUSE_COLOURDLG - -#if defined(__WXMSW__) && !defined(__WXUNIVERSAL__) - #include "wx/msw/colordlg.h" -#elif defined(__WXMAC__) && !defined(__WXUNIVERSAL__) - #include "wx/mac/colordlg.h" -#elif defined(__WXGTK20__) && !defined(__WXUNIVERSAL__) - #include "wx/gtk/colordlg.h" -#elif defined(__WXPALMOS__) - #include "wx/palmos/colordlg.h" -#else - #include "wx/generic/colrdlgg.h" - - #define wxColourDialog wxGenericColourDialog -#endif - -// get the colour from user and return it -wxColour WXDLLEXPORT -wxGetColourFromUser(wxWindow *parent = (wxWindow *)NULL, - const wxColour& colInit = wxNullColour, const wxString& caption = wxEmptyString); - -#endif // wxUSE_COLOURDLG - -#endif - // _WX_COLORDLG_H_BASE_ diff --git a/wxWidgets/include/wx/colour.h b/wxWidgets/include/wx/colour.h deleted file mode 100644 index bb396f0fed..0000000000 --- a/wxWidgets/include/wx/colour.h +++ /dev/null @@ -1,154 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/colour.h -// Purpose: wxColourBase definition -// Author: Julian Smart -// Modified by: Francesco Montorsi -// Created: -// RCS-ID: $Id: colour.h 53135 2008-04-12 02:31:04Z VZ $ -// Copyright: Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_COLOUR_H_BASE_ -#define _WX_COLOUR_H_BASE_ - -#include "wx/defs.h" -#include "wx/gdiobj.h" - - -class WXDLLIMPEXP_FWD_CORE wxColour; - -// the standard wxColour constructors; -// this macro avoids to repeat these lines across all colour.h files, since -// Set() is a virtual function and thus cannot be called by wxColourBase -// constructors -#define DEFINE_STD_WXCOLOUR_CONSTRUCTORS \ - wxColour( ChannelType red, ChannelType green, ChannelType blue, \ - ChannelType alpha = wxALPHA_OPAQUE ) \ - { Set(red, green, blue, alpha); } \ - wxColour( unsigned long colRGB ) { Set(colRGB); } \ - wxColour(const wxString &colourName) { Set(colourName); } \ - wxColour(const wxChar *colourName) { Set(colourName); } - - -// flags for wxColour -> wxString conversion (see wxColour::GetAsString) -#define wxC2S_NAME 1 // return colour name, when possible -#define wxC2S_CSS_SYNTAX 2 // return colour in rgb(r,g,b) syntax -#define wxC2S_HTML_SYNTAX 4 // return colour in #rrggbb syntax - - -const unsigned char wxALPHA_TRANSPARENT = 0; -const unsigned char wxALPHA_OPAQUE = 0xff; - -// ---------------------------------------------------------------------------- -// wxVariant support -// ---------------------------------------------------------------------------- - -#if wxUSE_VARIANT -#include "wx/variant.h" -DECLARE_VARIANT_OBJECT_EXPORTED(wxColour,WXDLLEXPORT) -#endif - -//----------------------------------------------------------------------------- -// wxColourBase: this class has no data members, just some functions to avoid -// code redundancy in all native wxColour implementations -//----------------------------------------------------------------------------- - -class WXDLLEXPORT wxColourBase : public wxGDIObject -{ -public: - // type of a single colour component - typedef unsigned char ChannelType; - - wxColourBase() {} - virtual ~wxColourBase() {} - - - // Set() functions - // --------------- - - void Set(ChannelType red, - ChannelType green, - ChannelType blue, - ChannelType alpha = wxALPHA_OPAQUE) - { InitRGBA(red,green,blue, alpha); } - - // implemented in colourcmn.cpp - bool Set(const wxChar *str) - { return FromString(str); } - - bool Set(const wxString &str) - { return FromString(str); } - - 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((ChannelType)(0xFF & colRGB), - (ChannelType)(0xFF & (colRGB >> 8)), - (ChannelType)(0xFF & (colRGB >> 16))); - } - - - - // accessors - // --------- - - virtual bool Ok() const { return IsOk(); } - virtual bool IsOk() const = 0; - - virtual ChannelType Red() const = 0; - virtual ChannelType Green() const = 0; - virtual ChannelType Blue() const = 0; - virtual ChannelType Alpha() const - { return wxALPHA_OPAQUE ; } - - // implemented in colourcmn.cpp - virtual wxString GetAsString(long flags = wxC2S_NAME | wxC2S_CSS_SYNTAX) const; - - - - // old, deprecated - // --------------- - -#if WXWIN_COMPATIBILITY_2_6 - wxDEPRECATED( static wxColour CreateByName(const wxString& name) ); - wxDEPRECATED( void InitFromName(const wxString& col) ); -#endif - -protected: - virtual void - InitRGBA(ChannelType r, ChannelType g, ChannelType b, ChannelType a) = 0; - - virtual bool FromString(const wxChar *s); -}; - - - -#if defined(__WXPALMOS__) - #include "wx/generic/colour.h" -#elif defined(__WXMSW__) - #include "wx/msw/colour.h" -#elif defined(__WXMOTIF__) - #include "wx/motif/colour.h" -#elif defined(__WXGTK20__) - #include "wx/gtk/colour.h" -#elif defined(__WXGTK__) - #include "wx/gtk1/colour.h" -#elif defined(__WXMGL__) - #include "wx/generic/colour.h" -#elif defined(__WXDFB__) - #include "wx/generic/colour.h" -#elif defined(__WXX11__) - #include "wx/x11/colour.h" -#elif defined(__WXMAC__) - #include "wx/mac/colour.h" -#elif defined(__WXCOCOA__) - #include "wx/cocoa/colour.h" -#elif defined(__WXPM__) - #include "wx/os2/colour.h" -#endif - -#define wxColor wxColour - -#endif // _WX_COLOUR_H_BASE_ diff --git a/wxWidgets/include/wx/combo.h b/wxWidgets/include/wx/combo.h deleted file mode 100644 index 1c27d020fc..0000000000 --- a/wxWidgets/include/wx/combo.h +++ /dev/null @@ -1,757 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: wx/combo.h -// Purpose: wxComboCtrl declaration -// Author: Jaakko Salli -// Modified by: -// Created: Apr-30-2006 -// RCS-ID: $Id: combo.h 64412 2010-05-27 15:11:58Z JMS $ -// Copyright: (c) Jaakko Salli -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_COMBOCONTROL_H_BASE_ -#define _WX_COMBOCONTROL_H_BASE_ - - -/* - A few words about all the classes defined in this file are probably in - order: why do we need extra wxComboCtrl and wxComboPopup classes? - - This is because a traditional combobox is a combination of a text control - (with a button allowing to open the pop down list) with a listbox and - wxComboBox class is exactly such control, however we want to also have other - combinations - in fact, we want to allow anything at all to be used as pop - down list, not just a wxListBox. - - So we define a base wxComboCtrl which can use any control as pop down - list and wxComboBox deriving from it which implements the standard wxWidgets - combobox API. wxComboCtrl needs to be told somehow which control to use - and this is done by SetPopupControl(). However, we need something more than - just a wxControl in this method as, for example, we need to call - SetSelection("initial text value") and wxControl doesn't have such method. - So we also need a wxComboPopup which is just a very simple interface which - must be implemented by a control to be usable as a popup. - - We couldn't derive wxComboPopup from wxControl as this would make it - impossible to have a class deriving from both wxListBx and from it, so - instead it is just a mix-in. - */ - - -#include "wx/defs.h" - -#if wxUSE_COMBOCTRL - -#include "wx/control.h" -#include "wx/renderer.h" // this is needed for wxCONTROL_XXX flags -#include "wx/bitmap.h" // wxBitmap used by-value - -class WXDLLIMPEXP_FWD_CORE wxTextCtrl; -class WXDLLIMPEXP_FWD_CORE wxComboPopup; - -// -// New window styles for wxComboCtrlBase -// -enum -{ - // Double-clicking a read-only combo triggers call to popup's OnComboPopup. - // In wxOwnerDrawnComboBox, for instance, it cycles item. - wxCC_SPECIAL_DCLICK = 0x0100, - - // Dropbutton acts like standard push button. - wxCC_STD_BUTTON = 0x0200 -}; - - -// wxComboCtrl internal flags -enum -{ - // First those that can be passed to Customize. - // It is Windows style for all flags to be clear. - - // Button is preferred outside the border (GTK style) - wxCC_BUTTON_OUTSIDE_BORDER = 0x0001, - // Show popup on mouse up instead of mouse down (which is the Windows style) - wxCC_POPUP_ON_MOUSE_UP = 0x0002, - // All text is not automatically selected on click - wxCC_NO_TEXT_AUTO_SELECT = 0x0004, - // Drop-button stays down as long as popup is displayed. - wxCC_BUTTON_STAYS_DOWN = 0x0008, - // Drop-button covers the entire control. - wxCC_FULL_BUTTON = 0x0010, - // Drop-button goes over the custom-border (used under WinVista). - wxCC_BUTTON_COVERS_BORDER = 0x0020, - - // Internal use: signals creation is complete - wxCC_IFLAG_CREATED = 0x0100, - // Internal use: really put button outside - wxCC_IFLAG_BUTTON_OUTSIDE = 0x0200, - // Internal use: SetTextIndent has been called - wxCC_IFLAG_INDENT_SET = 0x0400, - // Internal use: Set wxTAB_TRAVERSAL to parent when popup is dismissed - wxCC_IFLAG_PARENT_TAB_TRAVERSAL = 0x0800, - // Internal use: Secondary popup window type should be used (if available). - wxCC_IFLAG_USE_ALT_POPUP = 0x1000, - // Internal use: Skip popup animation. - wxCC_IFLAG_DISABLE_POPUP_ANIM = 0x2000, - // Internal use: Drop-button is a bitmap button or has non-default size - // (but can still be on either side of the control), regardless whether - // specified by the platform or the application. - wxCC_IFLAG_HAS_NONSTANDARD_BUTTON = 0x4000 -}; - - -// Flags used by PreprocessMouseEvent and HandleButtonMouseEvent -enum -{ - wxCC_MF_ON_BUTTON = 0x0001, // cursor is on dropbutton area - wxCC_MF_ON_CLICK_AREA = 0x0002 // cursor is on dropbutton or other area - // that can be clicked to show the popup. -}; - - -// Namespace for wxComboCtrl feature flags -struct wxComboCtrlFeatures -{ - enum - { - MovableButton = 0x0001, // Button can be on either side of control - BitmapButton = 0x0002, // Button may be replaced with bitmap - ButtonSpacing = 0x0004, // Button can have spacing from the edge - // of the control - TextIndent = 0x0008, // SetTextIndent can be used - PaintControl = 0x0010, // Combo control itself can be custom painted - PaintWritable = 0x0020, // A variable-width area in front of writable - // combo control's textctrl can be custom - // painted - Borderless = 0x0040, // wxNO_BORDER window style works - - // There are no feature flags for... - // PushButtonBitmapBackground - if its in wxRendererNative, then it should be - // not an issue to have it automatically under the bitmap. - - All = MovableButton|BitmapButton| - ButtonSpacing|TextIndent| - PaintControl|PaintWritable| - Borderless - }; -}; - - -class WXDLLEXPORT wxComboCtrlBase : public wxControl -{ - friend class wxComboPopup; -public: - // ctors and such - wxComboCtrlBase() : wxControl() { Init(); } - - bool Create(wxWindow *parent, - wxWindowID id, - const wxString& value, - const wxPoint& pos, - const wxSize& size, - long style, - const wxValidator& validator, - const wxString& name); - - virtual ~wxComboCtrlBase(); - - // show/hide popup window - virtual void ShowPopup(); - virtual void HidePopup(); - - // Override for totally custom combo action - virtual void OnButtonClick(); - - // return true if the popup is currently shown - bool IsPopupShown() const { return m_popupWinState == Visible; } - - // set interface class instance derived from wxComboPopup - // NULL popup can be used to indicate default in a derived class - void SetPopupControl( wxComboPopup* popup ) - { - DoSetPopupControl(popup); - } - - // get interface class instance derived from wxComboPopup - wxComboPopup* GetPopupControl() - { - EnsurePopupControl(); - return m_popupInterface; - } - - // get the popup window containing the popup control - wxWindow *GetPopupWindow() const { return m_winPopup; } - - // Get the text control which is part of the combobox. - wxTextCtrl *GetTextCtrl() const { return m_text; } - - // get the dropdown button which is part of the combobox - // note: its not necessarily a wxButton or wxBitmapButton - wxWindow *GetButton() const { return m_btn; } - - // forward these methods to all subcontrols - virtual bool Enable(bool enable = true); - virtual bool Show(bool show = true); - virtual bool SetFont(const wxFont& font); -#if wxUSE_VALIDATORS - virtual void SetValidator(const wxValidator &validator); - virtual wxValidator *GetValidator(); -#endif // wxUSE_VALIDATORS - - // wxTextCtrl methods - for readonly combo they should return - // without errors. - virtual wxString GetValue() const; - virtual void SetValue(const wxString& value); - 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 Undo(); - - // This method sets the text without affecting list selection - // (ie. wxComboPopup::SetStringValue doesn't get called). - void SetText(const wxString& value); - - // This method sets value and also optionally sends EVT_TEXT - // (needed by combo popups) - void SetValueWithEvent(const wxString& value, bool withEvent = true); - - // - // Popup customization methods - // - - // Sets minimum width of the popup. If wider than combo control, it will extend to the left. - // Remarks: - // * Value -1 indicates the default. - // * Custom popup may choose to ignore this (wxOwnerDrawnComboBox does not). - void SetPopupMinWidth( int width ) - { - m_widthMinPopup = width; - } - - // Sets preferred maximum height of the popup. - // Remarks: - // * Value -1 indicates the default. - // * Custom popup may choose to ignore this (wxOwnerDrawnComboBox does not). - void SetPopupMaxHeight( int height ) - { - m_heightPopup = height; - } - - // Extends popup size horizontally, relative to the edges of the combo control. - // Remarks: - // * Popup minimum width may override extLeft (ie. it has higher precedence). - // * Values 0 indicate default. - // * Custom popup may not take this fully into account (wxOwnerDrawnComboBox takes). - void SetPopupExtents( int extLeft, int extRight ) - { - m_extLeft = extLeft; - m_extRight = extRight; - } - - // Set width, in pixels, of custom paint area in writable combo. - // In read-only, used to indicate area that is not covered by the - // focus rectangle (which may or may not be drawn, depending on the - // popup type). - void SetCustomPaintWidth( int width ); - int GetCustomPaintWidth() const { return m_widthCustomPaint; } - - // Set side of the control to which the popup will align itself. - // Valid values are wxLEFT, wxRIGHT and 0. The default value 0 wmeans - // that the side of the button will be used. - void SetPopupAnchor( int anchorSide ) - { - m_anchorSide = anchorSide; - } - - // Set position of dropdown button. - // width: button width. <= 0 for default. - // height: button height. <= 0 for default. - // side: wxLEFT or wxRIGHT, indicates on which side the button will be placed. - // spacingX: empty space on sides of the button. Default is 0. - // Remarks: - // There is no spacingY - the button will be centered vertically. - void SetButtonPosition( int width = -1, - int height = -1, - int side = wxRIGHT, - int spacingX = 0 ); - - // Returns current size of the dropdown button. - wxSize GetButtonSize(); - - // - // Sets dropbutton to be drawn with custom bitmaps. - // - // bmpNormal: drawn when cursor is not on button - // pushButtonBg: Draw push button background below the image. - // NOTE! This is usually only properly supported on platforms with appropriate - // method in wxRendererNative. - // bmpPressed: drawn when button is depressed - // bmpHover: drawn when cursor hovers on button. This is ignored on platforms - // that do not generally display hover differently. - // bmpDisabled: drawn when combobox is disabled. - void SetButtonBitmaps( const wxBitmap& bmpNormal, - bool pushButtonBg = false, - const wxBitmap& bmpPressed = wxNullBitmap, - const wxBitmap& bmpHover = wxNullBitmap, - const wxBitmap& bmpDisabled = wxNullBitmap ); - - // - // This will set the space in pixels between left edge of the control and the - // text, regardless whether control is read-only (ie. no wxTextCtrl) or not. - // Platform-specific default can be set with value-1. - // Remarks - // * This method may do nothing on some native implementations. - void SetTextIndent( int indent ); - - // Returns actual indentation in pixels. - wxCoord GetTextIndent() const - { - return m_absIndent; - } - - // Returns area covered by the text field. - const wxRect& GetTextRect() const - { - return m_tcArea; - } - - // Call with enable as true to use a type of popup window that guarantees ability - // to focus the popup control, and normal function of common native controls. - // This alternative popup window is usually a wxDialog, and as such it's parent - // frame will appear as if the focus has been lost from it. - void UseAltPopupWindow( bool enable = true ) - { - wxASSERT_MSG( !m_winPopup, - wxT("call this only before SetPopupControl") ); - - if ( enable ) - m_iFlags |= wxCC_IFLAG_USE_ALT_POPUP; - else - m_iFlags &= ~wxCC_IFLAG_USE_ALT_POPUP; - } - - // Call with false to disable popup animation, if any. - void EnablePopupAnimation( bool enable = true ) - { - if ( enable ) - m_iFlags &= ~wxCC_IFLAG_DISABLE_POPUP_ANIM; - else - m_iFlags |= wxCC_IFLAG_DISABLE_POPUP_ANIM; - } - - // - // Utilies needed by the popups or native implementations - // - - // Returns true if given key combination should toggle the popup. - // NB: This is a separate from other keyboard handling because: - // 1) Replaceability. - // 2) Centralized code (otherwise it'd be split up between - // wxComboCtrl key handler and wxVListBoxComboPopup's - // key handler). - virtual bool IsKeyPopupToggle(const wxKeyEvent& event) const = 0; - - // Prepare background of combo control or an item in a dropdown list - // in a way typical on platform. This includes painting the focus/disabled - // background and setting the clipping region. - // Unless you plan to paint your own focus indicator, you should always call this - // in your wxComboPopup::PaintComboControl implementation. - // In addition, it sets pen and text colour to what looks good and proper - // against the background. - // flags: wxRendererNative flags: wxCONTROL_ISSUBMENU: is drawing a list item instead of combo control - // wxCONTROL_SELECTED: list item is selected - // wxCONTROL_DISABLED: control/item is disabled - virtual void PrepareBackground( wxDC& dc, const wxRect& rect, int flags ) const; - - // Returns true if focus indicator should be drawn in the control. - bool ShouldDrawFocus() const - { - const wxWindow* curFocus = FindFocus(); - return ( IsPopupWindowState(Hidden) && - (curFocus == m_mainCtrlWnd || (m_btn && curFocus == m_btn)) && - (m_windowStyle & wxCB_READONLY) ); - } - - // These methods return references to appropriate dropbutton bitmaps - const wxBitmap& GetBitmapNormal() const { return m_bmpNormal; } - const wxBitmap& GetBitmapPressed() const { return m_bmpPressed; } - const wxBitmap& GetBitmapHover() const { return m_bmpHover; } - const wxBitmap& GetBitmapDisabled() const { return m_bmpDisabled; } - - // Return internal flags - wxUint32 GetInternalFlags() const { return m_iFlags; } - - // Return true if Create has finished - bool IsCreated() const { return m_iFlags & wxCC_IFLAG_CREATED ? true : false; } - - // common code to be called on popup hide/dismiss - void OnPopupDismiss(); - - // PopupShown states - enum - { - Hidden = 0, - //Closing = 1, - Animating = 2, - Visible = 3 - }; - - bool IsPopupWindowState( int state ) const { return (state == m_popupWinState) ? true : false; } - - wxByte GetPopupWindowState() const { return m_popupWinState; } - - // Set value returned by GetMainWindowOfCompositeControl - void SetCtrlMainWnd( wxWindow* wnd ) { m_mainCtrlWnd = wnd; } - -protected: - - // - // Override these for customization purposes - // - - // called from wxSizeEvent handler - virtual void OnResize() = 0; - - // Return native text identation (for pure text, not textctrl) - virtual wxCoord GetNativeTextIndent() const; - - // Called in syscolourchanged handler and base create - virtual void OnThemeChange(); - - // Creates wxTextCtrl. - // extraStyle: Extra style parameters - void CreateTextCtrl( int extraStyle, const wxValidator& validator ); - - // Installs standard input handler to combo (and optionally to the textctrl) - void InstallInputHandlers(); - - // flags for DrawButton() - enum - { - Draw_PaintBg = 1, - Draw_BitmapOnly = 2 - }; - - // Draws dropbutton. Using wxRenderer or bitmaps, as appropriate. - void DrawButton( wxDC& dc, const wxRect& rect, int flags = Draw_PaintBg ); - - // Call if cursor is on button area or mouse is captured for the button. - //bool HandleButtonMouseEvent( wxMouseEvent& event, bool isInside ); - bool HandleButtonMouseEvent( wxMouseEvent& event, int flags ); - - // returns true if event was consumed or filtered (event type is also set to 0 in this case) - bool PreprocessMouseEvent( wxMouseEvent& event, int flags ); - - // - // This will handle left_down and left_dclick events outside button in a Windows-like manner. - // If you need alternate behaviour, it is recommended you manipulate and filter events to it - // instead of building your own handling routine (for reference, on wxEVT_LEFT_DOWN it will - // toggle popup and on wxEVT_LEFT_DCLICK it will do the same or run the popup's dclick method, - // if defined - you should pass events of other types of it for common processing). - void HandleNormalMouseEvent( wxMouseEvent& event ); - - // Creates popup window, calls interface->Create(), etc - void CreatePopup(); - - // Destroy popup window and all related constructs - void DestroyPopup(); - - // override the base class virtuals involved in geometry calculations - virtual wxSize DoGetBestSize() const; - - // NULL popup can be used to indicate default in a derived class - virtual void DoSetPopupControl(wxComboPopup* popup); - - // ensures there is atleast the default popup - void EnsurePopupControl(); - - // Recalculates button and textctrl areas. Called when size or button setup change. - // btnWidth: default/calculated width of the dropbutton. 0 means unchanged, - // just recalculate. - void CalculateAreas( int btnWidth = 0 ); - - // Standard textctrl positioning routine. Just give it platform-dependant - // textctrl coordinate adjustment. - void PositionTextCtrl( int textCtrlXAdjust, int textCtrlYAdjust ); - - // event handlers - void OnSizeEvent( wxSizeEvent& event ); - void OnFocusEvent(wxFocusEvent& event); - void OnIdleEvent(wxIdleEvent& event); - void OnTextCtrlEvent(wxCommandEvent& event); - void OnSysColourChanged(wxSysColourChangedEvent& event); - void OnKeyEvent(wxKeyEvent& event); - - // Set customization flags (directs how wxComboCtrlBase helpers behave) - void Customize( wxUint32 flags ) { m_iFlags |= flags; } - - // Dispatches size event and refreshes - void RecalcAndRefresh(); - - // Flags for DoShowPopup and AnimateShow - enum - { - ShowBelow = 0x0000, // Showing popup below the control - ShowAbove = 0x0001, // Showing popup above the control - CanDeferShow = 0x0002 // Can only return true from AnimateShow if this is set - }; - - // Shows and positions the popup. - virtual void DoShowPopup( const wxRect& rect, int flags ); - - // Implement in derived class to create a drop-down animation. - // Return true if finished immediately. Otherwise popup is only - // shown when the derived class call DoShowPopup. - // Flags are same as for DoShowPopup. - virtual bool AnimateShow( const wxRect& rect, int flags ); - -#if wxUSE_TOOLTIPS - virtual void DoSetToolTip( wxToolTip *tip ); -#endif - - virtual wxWindow *GetMainWindowOfCompositeControl() - { return m_mainCtrlWnd; } - - // This is used when m_text is hidden (readonly). - wxString m_valueString; - - // the text control and button we show all the time - wxTextCtrl* m_text; - wxWindow* m_btn; - - // wxPopupWindow or similar containing the window managed by the interface. - wxWindow* m_winPopup; - - // the popup control/panel - wxWindow* m_popup; - - // popup interface - wxComboPopup* m_popupInterface; - - // this is input etc. handler for the text control - wxEvtHandler* m_textEvtHandler; - - // this is for the top level window - wxEvtHandler* m_toplevEvtHandler; - - // this is for the control in popup - wxEvtHandler* m_popupExtraHandler; - - // this is for the popup window - wxEvtHandler* m_popupWinEvtHandler; - - // main (ie. topmost) window of a composite control (default = this) - wxWindow* m_mainCtrlWnd; - - // used to prevent immediate re-popupping incase closed popup - // by clicking on the combo control (needed because of inconsistent - // transient implementation across platforms). - wxLongLong m_timeCanAcceptClick; - - // how much popup should expand to the left/right of the control - wxCoord m_extLeft; - wxCoord m_extRight; - - // minimum popup width - wxCoord m_widthMinPopup; - - // preferred popup height - wxCoord m_heightPopup; - - // how much of writable combo is custom-paint by callback? - // also used to indicate area that is not covered by "blue" - // selection indicator. - wxCoord m_widthCustomPaint; - - // absolute text indentation, in pixels - wxCoord m_absIndent; - - // side on which the popup is aligned - int m_anchorSide; - - // Width of the "fake" border - wxCoord m_widthCustomBorder; - - // The button and textctrl click/paint areas - wxRect m_tcArea; - wxRect m_btnArea; - - // current button state (uses renderer flags) - int m_btnState; - - // button position - int m_btnWid; - int m_btnHei; - int m_btnSide; - int m_btnSpacingX; - - // last default button width - int m_btnWidDefault; - - // custom dropbutton bitmaps - wxBitmap m_bmpNormal; - wxBitmap m_bmpPressed; - wxBitmap m_bmpHover; - wxBitmap m_bmpDisabled; - - // area used by the button - wxSize m_btnSize; - - // platform-dependant customization and other flags - wxUint32 m_iFlags; - - // draw blank button background under bitmap? - bool m_blankButtonBg; - - // is the popup window currenty shown? - wxByte m_popupWinState; - - // should the focus be reset to the textctrl in idle time? - bool m_resetFocus; - -private: - void Init(); - - wxByte m_ignoreEvtText; // Number of next EVT_TEXTs to ignore - - // Is popup window wxPopupTransientWindow, wxPopupWindow or wxDialog? - wxByte m_popupWinType; - - DECLARE_EVENT_TABLE() - - DECLARE_ABSTRACT_CLASS(wxComboCtrlBase) -}; - - -// ---------------------------------------------------------------------------- -// wxComboPopup is the interface which must be implemented by a control to be -// used as a popup by wxComboCtrl -// ---------------------------------------------------------------------------- - - -// wxComboPopup internal flags -enum -{ - wxCP_IFLAG_CREATED = 0x0001 // Set by wxComboCtrlBase after Create is called -}; - - -class WXDLLEXPORT wxComboPopup -{ - friend class wxComboCtrlBase; -public: - wxComboPopup() - { - m_combo = (wxComboCtrlBase*) NULL; - m_iFlags = 0; - } - - // This is called immediately after construction finishes. m_combo member - // variable has been initialized before the call. - // NOTE: It is not in constructor so the derived class doesn't need to redefine - // a default constructor of its own. - virtual void Init() { } - - virtual ~wxComboPopup(); - - // Create the popup child control. - // Return true for success. - virtual bool Create(wxWindow* parent) = 0; - - // We must have an associated control which is subclassed by the combobox. - virtual wxWindow *GetControl() = 0; - - // Called immediately after the popup is shown - virtual void OnPopup(); - - // Called when popup is dismissed - virtual void OnDismiss(); - - // Called just prior to displaying popup. - // Default implementation does nothing. - virtual void SetStringValue( const wxString& value ); - - // Gets displayed string representation of the value. - virtual wxString GetStringValue() const = 0; - - // This is called to custom paint in the combo control itself (ie. not the popup). - // Default implementation draws value as string. - virtual void PaintComboControl( wxDC& dc, const wxRect& rect ); - - // Receives key events from the parent wxComboCtrl. - // Events not handled should be skipped, as usual. - virtual void OnComboKeyEvent( wxKeyEvent& event ); - - // Implement if you need to support special action when user - // double-clicks on the parent wxComboCtrl. - virtual void OnComboDoubleClick(); - - // Return final size of popup. Called on every popup, just prior to OnShow. - // minWidth = preferred minimum width for window - // prefHeight = preferred height. Only applies if > 0, - // maxHeight = max height for window, as limited by screen size - // and should only be rounded down, if necessary. - virtual wxSize GetAdjustedSize( int minWidth, int prefHeight, int maxHeight ); - - // Return true if you want delay call to Create until the popup is shown - // for the first time. It is more efficient, but note that it is often - // more convenient to have the control created immediately. - // Default returns false. - virtual bool LazyCreate(); - - // - // Utilies - // - - // Hides the popup - void Dismiss(); - - // Returns true if Create has been called. - bool IsCreated() const - { - return (m_iFlags & wxCP_IFLAG_CREATED) ? true : false; - } - - // Default PaintComboControl behaviour - static void DefaultPaintComboControl( wxComboCtrlBase* combo, - wxDC& dc, - const wxRect& rect ); - -protected: - wxComboCtrlBase* m_combo; - wxUint32 m_iFlags; - -private: - // Called in wxComboCtrlBase::SetPopupControl - void InitBase(wxComboCtrlBase *combo) - { - m_combo = combo; - } -}; - - -// ---------------------------------------------------------------------------- -// include the platform-dependent header defining the real class -// ---------------------------------------------------------------------------- - -#if defined(__WXUNIVERSAL__) - // No native universal (but it must still be first in the list) -#elif defined(__WXMSW__) - #include "wx/msw/combo.h" -#endif - -// Any ports may need generic as an alternative -#include "wx/generic/combo.h" - -#endif // wxUSE_COMBOCTRL - -#endif - // _WX_COMBOCONTROL_H_BASE_ diff --git a/wxWidgets/include/wx/combobox.h b/wxWidgets/include/wx/combobox.h deleted file mode 100644 index 1b31705675..0000000000 --- a/wxWidgets/include/wx/combobox.h +++ /dev/null @@ -1,97 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: wx/combobox.h -// Purpose: wxComboBox declaration -// Author: Vadim Zeitlin -// Modified by: -// Created: 24.12.00 -// RCS-ID: $Id: combobox.h 42727 2006-10-30 16:04:27Z VZ $ -// Copyright: (c) 1996-2000 wxWidgets team -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_COMBOBOX_H_BASE_ -#define _WX_COMBOBOX_H_BASE_ - -#include "wx/defs.h" - -#if wxUSE_COMBOBOX - -extern WXDLLEXPORT_DATA(const wxChar) wxComboBoxNameStr[]; - -// ---------------------------------------------------------------------------- -// wxComboBoxBase: this interface defines the methods wxComboBox must implement -// ---------------------------------------------------------------------------- - -#include "wx/textctrl.h" -#include "wx/ctrlsub.h" - -class WXDLLEXPORT wxComboBoxBase : public wxItemContainer -{ -public: - // wxTextCtrl-like methods wxComboBox must implement - virtual wxString GetValue() const = 0; - virtual void SetValue(const wxString& value) = 0; - - virtual void Copy() = 0; - virtual void Cut() = 0; - virtual void Paste() = 0; - virtual void SetInsertionPoint(long pos) = 0; - virtual long GetInsertionPoint() const = 0; - virtual wxTextPos GetLastPosition() const = 0; - virtual void Replace(long from, long to, const wxString& value) = 0; - virtual void SetSelection(long from, long to) = 0; - virtual void SetEditable(bool editable) = 0; - - virtual void SetInsertionPointEnd() - { SetInsertionPoint(GetLastPosition()); } - virtual void Remove(long from, long to) - { Replace(from, to, wxEmptyString); } - - virtual bool IsEditable() const = 0; - - virtual void Undo() = 0; - virtual void Redo() = 0; - virtual void SelectAll() = 0; - - virtual bool CanCopy() const = 0; - virtual bool CanCut() const = 0; - virtual bool CanPaste() const = 0; - virtual bool CanUndo() const = 0; - virtual bool CanRedo() const = 0; - - // may return value different from GetSelection() when the combobox - // dropdown is shown and the user selected, but not yet accepted, a value - // different from the old one in it - virtual int GetCurrentSelection() const { return GetSelection(); } - - // redeclare inherited SetSelection() overload here as well to avoid - // virtual function hiding - virtual void SetSelection(int n) = 0; -}; - -// ---------------------------------------------------------------------------- -// include the platform-dependent header defining the real class -// ---------------------------------------------------------------------------- - -#if defined(__WXUNIVERSAL__) - #include "wx/univ/combobox.h" -#elif defined(__WXMSW__) - #include "wx/msw/combobox.h" -#elif defined(__WXMOTIF__) - #include "wx/motif/combobox.h" -#elif defined(__WXGTK20__) - #include "wx/gtk/combobox.h" -#elif defined(__WXGTK__) - #include "wx/gtk1/combobox.h" -#elif defined(__WXMAC__) - #include "wx/mac/combobox.h" -#elif defined(__WXCOCOA__) - #include "wx/cocoa/combobox.h" -#elif defined(__WXPM__) - #include "wx/os2/combobox.h" -#endif - -#endif // wxUSE_COMBOBOX - -#endif - // _WX_COMBOBOX_H_BASE_ diff --git a/wxWidgets/include/wx/confbase.h b/wxWidgets/include/wx/confbase.h deleted file mode 100644 index 366665c263..0000000000 --- a/wxWidgets/include/wx/confbase.h +++ /dev/null @@ -1,359 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: confbase.h -// Purpose: declaration of the base class of all config implementations -// (see also: fileconf.h and msw/regconf.h and iniconf.h) -// Author: Karsten Ballueder & Vadim Zeitlin -// Modified by: -// Created: 07.04.98 (adapted from appconf.h) -// RCS-ID: $Id: confbase.h 61872 2009-09-09 22:37:05Z VZ $ -// Copyright: (c) 1997 Karsten Ballueder Ballueder@usa.net -// Vadim Zeitlin -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_CONFBASE_H_ -#define _WX_CONFBASE_H_ - -#include "wx/defs.h" -#include "wx/string.h" - -class WXDLLIMPEXP_FWD_BASE wxArrayString; - -// ---------------------------------------------------------------------------- -// constants -// ---------------------------------------------------------------------------- - -/// shall we be case sensitive in parsing variable names? -#ifndef wxCONFIG_CASE_SENSITIVE - #define wxCONFIG_CASE_SENSITIVE 0 -#endif - -/// separates group and entry names (probably shouldn't be changed) -#ifndef wxCONFIG_PATH_SEPARATOR - #define wxCONFIG_PATH_SEPARATOR wxT('/') -#endif - -/// introduces immutable entries -// (i.e. the ones which can't be changed from the local config file) -#ifndef wxCONFIG_IMMUTABLE_PREFIX - #define wxCONFIG_IMMUTABLE_PREFIX wxT('!') -#endif - -#if wxUSE_CONFIG - -#include "wx/string.h" - -/// should we use registry instead of configuration files under Windows? -// (i.e. whether wxConfigBase::Create() will create a wxFileConfig (if it's -// false) or wxRegConfig (if it's true and we're under Win32)) -#ifndef wxUSE_CONFIG_NATIVE - #define wxUSE_CONFIG_NATIVE 1 -#endif - -// Style flags for constructor style parameter -enum -{ - wxCONFIG_USE_LOCAL_FILE = 1, - wxCONFIG_USE_GLOBAL_FILE = 2, - wxCONFIG_USE_RELATIVE_PATH = 4, - wxCONFIG_USE_NO_ESCAPE_CHARACTERS = 8, - wxCONFIG_USE_SUBDIR = 16 -}; - -// ---------------------------------------------------------------------------- -// abstract base class wxConfigBase which defines the interface for derived -// classes -// -// wxConfig organizes the items in a tree-like structure (modeled after the -// Unix/Dos filesystem). There are groups (directories) and keys (files). -// There is always one current group given by the current path. -// -// Keys are pairs "key_name = value" where value may be of string or integer -// (long) type (TODO doubles and other types such as wxDate coming soon). -// ---------------------------------------------------------------------------- - -class WXDLLIMPEXP_BASE wxConfigBase -{ -public: - // constants - // the type of an entry - enum EntryType - { - Type_Unknown, - Type_String, - Type_Boolean, - Type_Integer, // use Read(long *) - Type_Float // use Read(double *) - }; - - // static functions - // sets the config object, returns the previous pointer - static wxConfigBase *Set(wxConfigBase *pConfig); - // get the config object, creates it on demand unless DontCreateOnDemand - // was called - static wxConfigBase *Get(bool createOnDemand = true) - { if ( createOnDemand && (!ms_pConfig) ) Create(); return ms_pConfig; } - // create a new config object: this function will create the "best" - // implementation of wxConfig available for the current platform, see - // comments near definition wxUSE_CONFIG_NATIVE for details. It returns - // the created object and also sets it as ms_pConfig. - static wxConfigBase *Create(); - // should Get() try to create a new log object if the current one is NULL? - static void DontCreateOnDemand() { ms_bAutoCreate = false; } - - // ctor & virtual dtor - // ctor (can be used as default ctor too) - // - // Not all args will always be used by derived classes, but including - // them all in each class ensures compatibility. If appName is empty, - // uses wxApp name - wxConfigBase(const wxString& appName = wxEmptyString, - const wxString& vendorName = wxEmptyString, - const wxString& localFilename = wxEmptyString, - const wxString& globalFilename = wxEmptyString, - long style = 0); - - // empty but ensures that dtor of all derived classes is virtual - virtual ~wxConfigBase(); - - // path management - // set current path: if the first character is '/', it's the absolute path, - // otherwise it's a relative path. '..' is supported. If the strPath - // doesn't exist it is created. - virtual void SetPath(const wxString& strPath) = 0; - // retrieve the current path (always as absolute path) - virtual const wxString& GetPath() const = 0; - - // enumeration: all functions here return false when there are no more items. - // you must pass the same lIndex to GetNext and GetFirst (don't modify it) - // enumerate subgroups - virtual bool GetFirstGroup(wxString& str, long& lIndex) const = 0; - virtual bool GetNextGroup (wxString& str, long& lIndex) const = 0; - // enumerate entries - virtual bool GetFirstEntry(wxString& str, long& lIndex) const = 0; - virtual bool GetNextEntry (wxString& str, long& lIndex) const = 0; - // get number of entries/subgroups in the current group, with or without - // it's subgroups - virtual size_t GetNumberOfEntries(bool bRecursive = false) const = 0; - virtual size_t GetNumberOfGroups(bool bRecursive = false) const = 0; - - // tests of existence - // returns true if the group by this name exists - virtual bool HasGroup(const wxString& strName) const = 0; - // same as above, but for an entry - virtual bool HasEntry(const wxString& strName) const = 0; - // returns true if either a group or an entry with a given name exist - bool Exists(const wxString& strName) const - { return HasGroup(strName) || HasEntry(strName); } - - // get the entry type - virtual EntryType GetEntryType(const wxString& name) const - { - // by default all entries are strings - return HasEntry(name) ? Type_String : Type_Unknown; - } - - // key access: returns true if value was really read, false if default used - // (and if the key is not found the default value is returned.) - - // read a string from the key - bool Read(const wxString& key, wxString *pStr) const; - bool Read(const wxString& key, wxString *pStr, const wxString& defVal) const; - - // read a number (long) - bool Read(const wxString& key, long *pl) const; - bool Read(const wxString& key, long *pl, long defVal) const; - - // read an int - bool Read(const wxString& key, int *pi) const; - bool Read(const wxString& key, int *pi, int defVal) const; - - // read a double - bool Read(const wxString& key, double* val) const; - bool Read(const wxString& key, double* val, double defVal) const; - - // read a bool - bool Read(const wxString& key, bool* val) const; - bool Read(const wxString& key, bool* val, bool defVal) const; - - // convenience functions returning directly the value (we don't have them for - // int/double/bool as there would be ambiguities with the long one then) - wxString Read(const wxString& key, - const wxString& defVal = wxEmptyString) const - { wxString s; (void)Read(key, &s, defVal); return s; } - - long Read(const wxString& key, long defVal) const - { long l; (void)Read(key, &l, defVal); return l; } - - // write the value (return true on success) - bool Write(const wxString& key, const wxString& value) - { return DoWriteString(key, value); } - - bool Write(const wxString& key, long value) - { return DoWriteLong(key, value); } - - bool Write(const wxString& key, int value) - { return DoWriteInt(key, value); } - - bool Write(const wxString& key, double value) - { return DoWriteDouble(key, value); } - - bool Write(const wxString& key, bool value) - { return DoWriteBool(key, value); } - - // we have to provide a separate version for C strings as otherwise they - // would be converted to bool and not to wxString as expected! - bool Write(const wxString& key, const wxChar *value) - { return Write(key, wxString(value)); } - - // permanently writes all changes - virtual bool Flush(bool bCurrentOnly = false) = 0; - - // renaming, all functions return false on failure (probably because the new - // name is already taken by an existing entry) - // rename an entry - virtual bool RenameEntry(const wxString& oldName, - const wxString& newName) = 0; - // rename a group - virtual bool RenameGroup(const wxString& oldName, - const wxString& newName) = 0; - - // delete entries/groups - // deletes the specified entry and the group it belongs to if - // it was the last key in it and the second parameter is true - virtual bool DeleteEntry(const wxString& key, - bool bDeleteGroupIfEmpty = true) = 0; - // delete the group (with all subgroups) - virtual bool DeleteGroup(const wxString& key) = 0; - // delete the whole underlying object (disk file, registry key, ...) - // primarily for use by uninstallation routine. - virtual bool DeleteAll() = 0; - - // options - // we can automatically expand environment variables in the config entries - // (this option is on by default, you can turn it on/off at any time) - bool IsExpandingEnvVars() const { return m_bExpandEnvVars; } - void SetExpandEnvVars(bool bDoIt = true) { m_bExpandEnvVars = bDoIt; } - // recording of default values - void SetRecordDefaults(bool bDoIt = true) { m_bRecordDefaults = bDoIt; } - bool IsRecordingDefaults() const { return m_bRecordDefaults; } - // does expansion only if needed - wxString ExpandEnvVars(const wxString& str) const; - - // misc accessors - wxString GetAppName() const { return m_appName; } - wxString GetVendorName() const { return m_vendorName; } - - // Used wxIniConfig to set members in constructor - void SetAppName(const wxString& appName) { m_appName = appName; } - void SetVendorName(const wxString& vendorName) { m_vendorName = vendorName; } - - void SetStyle(long style) { m_style = style; } - long GetStyle() const { return m_style; } - -protected: - static bool IsImmutable(const wxString& key) - { return !key.IsEmpty() && key[0] == wxCONFIG_IMMUTABLE_PREFIX; } - - // return the path without trailing separator, if any: this should be called - // to sanitize paths referring to the group names before passing them to - // wxConfigPathChanger as "/foo/bar/" should be the same as "/foo/bar" and it - // isn't interpreted in the same way by it (and this can't be changed there - // as it's not the same for the entries names) - static wxString RemoveTrailingSeparator(const wxString& key); - - // do read/write the values of different types - virtual bool DoReadString(const wxString& key, wxString *pStr) const = 0; - virtual bool DoReadLong(const wxString& key, long *pl) const = 0; - virtual bool DoReadInt(const wxString& key, int *pi) const; - virtual bool DoReadDouble(const wxString& key, double* val) const; - virtual bool DoReadBool(const wxString& key, bool* val) const; - - virtual bool DoWriteString(const wxString& key, const wxString& value) = 0; - virtual bool DoWriteLong(const wxString& key, long value) = 0; - virtual bool DoWriteInt(const wxString& key, int value); - virtual bool DoWriteDouble(const wxString& key, double value); - virtual bool DoWriteBool(const wxString& key, bool value); - -private: - // are we doing automatic environment variable expansion? - bool m_bExpandEnvVars; - // do we record default values? - bool m_bRecordDefaults; - - // static variables - static wxConfigBase *ms_pConfig; - static bool ms_bAutoCreate; - - // Application name and organisation name - wxString m_appName; - wxString m_vendorName; - - // Style flag - long m_style; -}; - -// a handy little class which changes current path to the path of given entry -// and restores it in dtor: so if you declare a local variable of this type, -// you work in the entry directory and the path is automatically restored -// when the function returns -// Taken out of wxConfig since not all compilers can cope with nested classes. -class WXDLLIMPEXP_BASE wxConfigPathChanger -{ -public: - // ctor/dtor do path changing/restoring of the path - wxConfigPathChanger(const wxConfigBase *pContainer, const wxString& strEntry); - ~wxConfigPathChanger(); - - // get the key name - const wxString& Name() const { return m_strName; } - - // this method must be called if the original path (i.e. the current path at - // the moment of creation of this object) could have been deleted to prevent - // us from restoring the not existing (any more) path - // - // if the original path doesn't exist any more, the path will be restored to - // the deepest still existing component of the old path - void UpdateIfDeleted(); - -private: - wxConfigBase *m_pContainer; // object we live in - wxString m_strName, // name of entry (i.e. name only) - m_strOldPath; // saved path - bool m_bChanged; // was the path changed? - - DECLARE_NO_COPY_CLASS(wxConfigPathChanger) -}; - - -// ---------------------------------------------------------------------------- -// the native wxConfigBase implementation -// ---------------------------------------------------------------------------- - -// under Windows we prefer to use the native implementation -// wxIniConfig isn't native anywhere after droping win16 in wxWidgets 2.6 -#if defined(__WXMSW__) && wxUSE_CONFIG_NATIVE - #define wxConfig wxRegConfig -#else // either we're under Unix or wish to use files even under Windows - #define wxConfig wxFileConfig -#endif - -#endif // wxUSE_CONFIG - -/* - Replace environment variables ($SOMETHING) with their values. The format is - $VARNAME or ${VARNAME} where VARNAME contains alphanumeric characters and - '_' only. '$' must be escaped ('\$') in order to be taken literally. -*/ - -WXDLLIMPEXP_BASE wxString wxExpandEnvVars(const wxString &sz); - -/* - Split path into parts removing '..' in progress - */ -WXDLLIMPEXP_BASE void wxSplitPath(wxArrayString& aParts, const wxChar *sz); - - -#endif - // _WX_CONFIG_H_ - diff --git a/wxWidgets/include/wx/config.h b/wxWidgets/include/wx/config.h deleted file mode 100644 index e20bb7fa15..0000000000 --- a/wxWidgets/include/wx/config.h +++ /dev/null @@ -1,33 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: config.h -// Purpose: wxConfig base header -// Author: Julian Smart -// Modified by: -// Created: -// Copyright: (c) Julian Smart -// RCS-ID: $Id: config.h 60524 2009-05-05 22:51:44Z PC $ -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_CONFIG_H_BASE_ -#define _WX_CONFIG_H_BASE_ - -#include "wx/confbase.h" - -#if wxUSE_CONFIG - -#if defined(__WXMSW__) && wxUSE_CONFIG_NATIVE -# ifdef __WIN32__ -# include "wx/msw/regconf.h" -# else -# include "wx/msw/iniconf.h" -# endif -#elif defined(__WXPALMOS__) && wxUSE_CONFIG_NATIVE -# include "wx/palmos/prefconf.h" -#else -# include "wx/fileconf.h" -#endif - -#endif // wxUSE_CONFIG - -#endif // _WX_CONFIG_H_BASE_ diff --git a/wxWidgets/include/wx/containr.h b/wxWidgets/include/wx/containr.h deleted file mode 100644 index 79eb4f4b8e..0000000000 --- a/wxWidgets/include/wx/containr.h +++ /dev/null @@ -1,142 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: wx/containr.h -// Purpose: wxControlContainer class declration: a "mix-in" class which -// implements the TAB navigation between the controls -// Author: Vadim Zeitlin -// Modified by: -// Created: 06.08.01 -// RCS-ID: $Id: containr.h 50863 2007-12-20 18:32:55Z VS $ -// Copyright: (c) 2001 Vadim Zeitlin -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_CONTAINR_H_ -#define _WX_CONTAINR_H_ - -class WXDLLIMPEXP_FWD_CORE wxFocusEvent; -class WXDLLIMPEXP_FWD_CORE wxNavigationKeyEvent; -class WXDLLIMPEXP_FWD_CORE wxWindow; -class WXDLLIMPEXP_FWD_CORE wxWindowBase; - -/* - Implementation note: wxControlContainer is not a real mix-in but rather - a class meant to be agregated with (and not inherited from). Although - logically it should be a mix-in, doing it like this has no advantage from - the point of view of the existing code but does have some problems (we'd - need to play tricks with event handlers which may be difficult to do - safely). The price we pay for this simplicity is the ugly macros below. - */ - -// ---------------------------------------------------------------------------- -// wxControlContainer -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxControlContainer -{ -public: - // ctors and such - wxControlContainer(wxWindow *winParent = NULL); - void SetContainerWindow(wxWindow *winParent) { m_winParent = winParent; } - - // the methods to be called from the window event handlers - void HandleOnNavigationKey(wxNavigationKeyEvent& event); - void HandleOnFocus(wxFocusEvent& event); - void HandleOnWindowDestroy(wxWindowBase *child); - - // should be called from SetFocus(), returns false if we did nothing with - // the focus and the default processing should take place - bool DoSetFocus(); - - // can our child get the focus? - bool AcceptsFocus() const; - - // called from OnChildFocus() handler, i.e. when one of our (grand) - // children gets the focus - void SetLastFocus(wxWindow *win); - -protected: - // set the focus to the child which had it the last time - bool SetFocusToChild(); - - // the parent window we manage the children for - wxWindow *m_winParent; - - // the child which had the focus last time this panel was activated - wxWindow *m_winLastFocused; - - // a guard against infinite recursion - bool m_inSetFocus; - - DECLARE_NO_COPY_CLASS(wxControlContainer) -}; - -// this function is for wxWidgets internal use only -extern bool wxSetFocusToChild(wxWindow *win, wxWindow **child); - -// ---------------------------------------------------------------------------- -// macros which may be used by the classes wishing to implement TAB navigation -// among their children -// ---------------------------------------------------------------------------- - -// declare the methods to be forwarded -#define WX_DECLARE_CONTROL_CONTAINER() \ -public: \ - void OnNavigationKey(wxNavigationKeyEvent& event); \ - void OnFocus(wxFocusEvent& event); \ - virtual void OnChildFocus(wxChildFocusEvent& event); \ - virtual void SetFocus(); \ - virtual void SetFocusIgnoringChildren(); \ - virtual void RemoveChild(wxWindowBase *child); \ - virtual bool AcceptsFocus() const; \ -\ -protected: \ - wxControlContainer m_container - -// implement the event table entries for wxControlContainer -#define WX_EVENT_TABLE_CONTROL_CONTAINER(classname) \ - EVT_SET_FOCUS(classname::OnFocus) \ - EVT_CHILD_FOCUS(classname::OnChildFocus) \ - EVT_NAVIGATION_KEY(classname::OnNavigationKey) - -// implement the methods forwarding to the wxControlContainer -#define WX_DELEGATE_TO_CONTROL_CONTAINER(classname, basename) \ -void classname::OnNavigationKey( wxNavigationKeyEvent& event ) \ -{ \ - m_container.HandleOnNavigationKey(event); \ -} \ - \ -void classname::RemoveChild(wxWindowBase *child) \ -{ \ - m_container.HandleOnWindowDestroy(child); \ - \ - basename::RemoveChild(child); \ -} \ - \ -void classname::SetFocus() \ -{ \ - if ( !m_container.DoSetFocus() ) \ - basename::SetFocus(); \ -} \ - \ -void classname::SetFocusIgnoringChildren() \ -{ \ - basename::SetFocus(); \ -} \ - \ -void classname::OnChildFocus(wxChildFocusEvent& event) \ -{ \ - m_container.SetLastFocus(event.GetWindow()); \ - event.Skip(); \ -} \ - \ -void classname::OnFocus(wxFocusEvent& event) \ -{ \ - m_container.HandleOnFocus(event); \ -} \ -bool classname::AcceptsFocus() const \ -{ \ - return m_container.AcceptsFocus(); \ -} - - -#endif // _WX_CONTAINR_H_ diff --git a/wxWidgets/include/wx/control.h b/wxWidgets/include/wx/control.h deleted file mode 100644 index b5208d07d5..0000000000 --- a/wxWidgets/include/wx/control.h +++ /dev/null @@ -1,117 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/control.h -// Purpose: wxControl common interface -// Author: Vadim Zeitlin -// Modified by: -// Created: 26.07.99 -// RCS-ID: $Id: control.h 42816 2006-10-31 08:50:17Z RD $ -// Copyright: (c) wxWidgets team -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_CONTROL_H_BASE_ -#define _WX_CONTROL_H_BASE_ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -#include "wx/defs.h" - -#if wxUSE_CONTROLS - -#include "wx/window.h" // base class - -extern WXDLLEXPORT_DATA(const wxChar) wxControlNameStr[]; - -// ---------------------------------------------------------------------------- -// wxControl is the base class for all controls -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxControlBase : public wxWindow -{ -public: - wxControlBase() { } - - virtual ~wxControlBase(); - - // Create() function adds the validator parameter - 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); - - // get the control alignment (left/right/centre, top/bottom/centre) - int GetAlignment() const { return m_windowStyle & wxALIGN_MASK; } - - // get the string without mnemonic characters ('&') - static wxString GetLabelText(const wxString& label); - - // get just the text of the label, without mnemonic characters ('&') - wxString GetLabelText() const { return GetLabelText(GetLabel()); } - - // controls by default inherit the colours of their parents, if a - // particular control class doesn't want to do it, it can override - // ShouldInheritColours() to return false - virtual bool ShouldInheritColours() const { return true; } - - - // WARNING: this doesn't work for all controls nor all platforms! - // - // simulates the event of given type (i.e. wxButton::Command() is just as - // if the button was clicked) - virtual void Command(wxCommandEvent &event); - - virtual void SetLabel( const wxString &label ); - virtual bool SetFont(const wxFont& font); - - // wxControl-specific processing after processing the update event - virtual void DoUpdateWindowUI(wxUpdateUIEvent& event); - -protected: - // creates the control (calls wxWindowBase::CreateBase inside) and adds it - // to the list of parents children - bool CreateControl(wxWindowBase *parent, - wxWindowID id, - const wxPoint& pos, - const wxSize& size, - long style, - const wxValidator& validator, - const wxString& name); - - // initialize the common fields of wxCommandEvent - void InitCommandEvent(wxCommandEvent& event) const; - - DECLARE_NO_COPY_CLASS(wxControlBase) -}; - -// ---------------------------------------------------------------------------- -// include platform-dependent wxControl declarations -// ---------------------------------------------------------------------------- - -#if defined(__WXUNIVERSAL__) - #include "wx/univ/control.h" -#elif defined(__WXPALMOS__) - #include "wx/palmos/control.h" -#elif defined(__WXMSW__) - #include "wx/msw/control.h" -#elif defined(__WXMOTIF__) - #include "wx/motif/control.h" -#elif defined(__WXGTK20__) - #include "wx/gtk/control.h" -#elif defined(__WXGTK__) - #include "wx/gtk1/control.h" -#elif defined(__WXMAC__) - #include "wx/mac/control.h" -#elif defined(__WXCOCOA__) - #include "wx/cocoa/control.h" -#elif defined(__WXPM__) - #include "wx/os2/control.h" -#endif - -#endif // wxUSE_CONTROLS - -#endif - // _WX_CONTROL_H_BASE_ diff --git a/wxWidgets/include/wx/convauto.h b/wxWidgets/include/wx/convauto.h deleted file mode 100644 index 8d96afa557..0000000000 --- a/wxWidgets/include/wx/convauto.h +++ /dev/null @@ -1,108 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: wx/convauto.h -// Purpose: wxConvAuto class declaration -// Author: Vadim Zeitlin -// Created: 2006-04-03 -// RCS-ID: $Id: convauto.h 45893 2007-05-08 20:05:16Z VZ $ -// Copyright: (c) 2006 Vadim Zeitlin -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_CONVAUTO_H_ -#define _WX_CONVAUTO_H_ - -#include "wx/strconv.h" - -#if wxUSE_WCHAR_T - -// ---------------------------------------------------------------------------- -// wxConvAuto: uses BOM to automatically detect input encoding -// ---------------------------------------------------------------------------- - -class WXDLLIMPEXP_BASE wxConvAuto : public wxMBConv -{ -public: - // default ctor, the real conversion will be created on demand - wxConvAuto() { m_conv = NULL; /* the rest will be initialized later */ } - - // copy ctor doesn't initialize anything neither as conversion can only be - // deduced on first use - wxConvAuto(const wxConvAuto& WXUNUSED(other)) : wxMBConv() { m_conv = NULL; } - - virtual ~wxConvAuto() { if ( m_conv && m_ownsConv ) delete m_conv; } - - // override the base class virtual function(s) to use our m_conv - virtual size_t ToWChar(wchar_t *dst, size_t dstLen, - const char *src, size_t srcLen = wxNO_LEN) const; - - virtual size_t FromWChar(char *dst, size_t dstLen, - const wchar_t *src, size_t srcLen = wxNO_LEN) const; - - virtual size_t GetMBNulLen() const { return m_conv->GetMBNulLen(); } - - virtual wxMBConv *Clone() const { return new wxConvAuto(*this); } - -private: - // all currently recognized BOM values - enum BOMType - { - BOM_None, - BOM_UTF32BE, - BOM_UTF32LE, - BOM_UTF16BE, - BOM_UTF16LE, - BOM_UTF8 - }; - - // return the BOM type of this buffer - static BOMType DetectBOM(const char *src, size_t srcLen); - - // initialize m_conv with the conversion to use by default (UTF-8) - void InitWithDefault() - { - m_conv = &wxConvUTF8; - m_ownsConv = false; - } - - // create the correct conversion object for the given BOM type - void InitFromBOM(BOMType bomType); - - // create the correct conversion object for the BOM present in the - // beginning of the buffer; adjust the buffer to skip the BOM if found - void InitFromInput(const char **src, size_t *len); - - // adjust src and len to skip over the BOM (identified by m_bomType) at the - // start of the buffer - void SkipBOM(const char **src, size_t *len) const; - - - // conversion object which we really use, NULL until the first call to - // either ToWChar() or FromWChar() - wxMBConv *m_conv; - - // our BOM type - BOMType m_bomType; - - // true if we allocated m_conv ourselves, false if we just use an existing - // global conversion - bool m_ownsConv; - - // true if we already skipped BOM when converting (and not just calculating - // the size) - bool m_consumedBOM; - - - DECLARE_NO_ASSIGN_CLASS(wxConvAuto) -}; - -#else // !wxUSE_WCHAR_T - -// it doesn't matter how we define it in this case as it's unused anyhow, but -// do define it to allow the code using wxConvAuto() as default argument (this -// is done in many places) to compile -typedef wxMBConv wxConvAuto; - -#endif // wxUSE_WCHAR_T/!wxUSE_WCHAR_T - -#endif // _WX_CONVAUTO_H_ - diff --git a/wxWidgets/include/wx/cpp.h b/wxWidgets/include/wx/cpp.h deleted file mode 100644 index 3e23273acd..0000000000 --- a/wxWidgets/include/wx/cpp.h +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Name: wx/cpp.h - * Purpose: Various preprocessor helpers - * Author: Vadim Zeitlin - * Created: 2006-09-30 - * RCS-ID: $Id: cpp.h 42993 2006-11-03 21:06:57Z VZ $ - * Copyright: (c) 2006 Vadim Zeitlin - * Licence: wxWindows licence - */ - -/* THIS IS A C FILE, DON'T USE C++ FEATURES (IN PARTICULAR COMMENTS) IN IT */ - -#ifndef _WX_CPP_H_ -#define _WX_CPP_H_ - -/* wxCONCAT works like preprocessor ## operator but also works with macros */ -#define wxCONCAT_HELPER(text, line) text ## line -#define wxCONCAT(text, line) wxCONCAT_HELPER(text, line) - -/* wxSTRINGIZE works as the preprocessor # operator but also works with macros */ -#define wxSTRINGIZE_HELPER(x) #x -#define wxSTRINGIZE(x) wxSTRINGIZE_HELPER(x) - -/* a Unicode-friendly version of wxSTRINGIZE_T */ -#define wxSTRINGIZE_T(x) wxAPPLY_T(wxSTRINGIZE(x)) - -/* - Helper macros for wxMAKE_UNIQUE_NAME: normally this works by appending the - current line number to the given identifier to reduce the probability of the - conflict (it may still happen if this is used in the headers, hence you - should avoid doing it or provide unique prefixes then) but we have to do it - differently for VC++ - */ -#if defined(__VISUALC__) && (__VISUALC__ >= 1300) - /* - __LINE__ handling is completely broken in VC++ when using "Edit and - Continue" (/ZI option) and results in preprocessor errors if we use it - inside the macros. Luckily VC7 has another standard macro which can be - used like this and is even better than __LINE__ because it is globally - unique. - */ -# define wxCONCAT_LINE(text) wxCONCAT(text, __COUNTER__) -#else /* normal compilers */ -# define wxCONCAT_LINE(text) wxCONCAT(text, __LINE__) -#endif - -/* Create a "unique" name with the given prefix */ -#define wxMAKE_UNIQUE_NAME(text) wxCONCAT_LINE(text) - -/* - This macro can be passed as argument to another macro when you don't have - anything to pass in fact. - */ -#define wxEMPTY_PARAMETER_VALUE /* Fake macro parameter value */ - -#endif // _WX_CPP_H_ - diff --git a/wxWidgets/include/wx/cppunit.h b/wxWidgets/include/wx/cppunit.h deleted file mode 100644 index c7d3a14d74..0000000000 --- a/wxWidgets/include/wx/cppunit.h +++ /dev/null @@ -1,129 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/cppunit.h -// Purpose: wrapper header for CppUnit headers -// Author: Vadim Zeitlin -// Created: 15.02.04 -// RCS-ID: $Id: cppunit.h 61872 2009-09-09 22:37:05Z VZ $ -// Copyright: (c) 2004 Vadim Zeitlin -// Licence: wxWindows Licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_CPPUNIT_H_ -#define _WX_CPPUNIT_H_ - -/////////////////////////////////////////////////////////////////////////////// -// using CPPUNIT_TEST() macro results in this warning, disable it as there is -// no other way to get rid of it and it's not very useful anyhow -#ifdef __VISUALC__ - // typedef-name 'foo' used as synonym for class-name 'bar' - #pragma warning(disable:4097) - - // unreachable code: we don't care about warnings in CppUnit headers - #pragma warning(disable:4702) - - // 'id': identifier was truncated to 'num' characters in the debug info - #pragma warning(disable:4786) -#endif // __VISUALC__ - -#ifdef __BORLANDC__ - #pragma warn -8022 -#endif - -#ifndef CPPUNIT_STD_NEED_ALLOCATOR - #define CPPUNIT_STD_NEED_ALLOCATOR 0 -#endif - -/////////////////////////////////////////////////////////////////////////////// -// Set the default format for the errors, which can be used by an IDE to jump -// to the error location. This default gets overridden by the cppunit headers -// for some compilers (e.g. VC++). - -#ifndef CPPUNIT_COMPILER_LOCATION_FORMAT - #define CPPUNIT_COMPILER_LOCATION_FORMAT "%p:%l:" -#endif - - -/////////////////////////////////////////////////////////////////////////////// -// Include all needed cppunit headers. -// - -#include "wx/beforestd.h" -#include -#include -#include -#include -#include -#include "wx/afterstd.h" - - -/////////////////////////////////////////////////////////////////////////////// -// Set of helpful test macros. -// - -// Base macro for wrapping CPPUNIT_TEST macros and so making them conditional -// tests, meaning that the test only get registered and thus run when a given -// runtime condition is true. -// In case the condition is evaluated as false a skip message is logged -// (the message will only be shown in verbose mode). -#define WXTEST_ANY_WITH_CONDITION(suiteName, Condition, testMethod, anyTest) \ - if (Condition) \ - { anyTest; } \ - else \ - wxLogInfo(wxString::Format(wxT("skipping: %s.%s\n reason: %s equals false\n"), \ - wxString(suiteName, wxConvUTF8).c_str(), \ - wxString(#testMethod, wxConvUTF8).c_str(), \ - wxString(#Condition, wxConvUTF8).c_str())) - -// Conditional CPPUNIT_TEST macro. -#define WXTEST_WITH_CONDITION(suiteName, Condition, testMethod) \ - WXTEST_ANY_WITH_CONDITION(suiteName, Condition, testMethod, CPPUNIT_TEST(testMethod)) -// Conditional CPPUNIT_TEST_FAIL macro. -#define WXTEST_FAIL_WITH_CONDITION(suiteName, Condition, testMethod) \ - WXTEST_ANY_WITH_CONDITION(suiteName, Condition, testMethod, CPPUNIT_TEST_FAIL(testMethod)) - -// Use this macro to compare a wxString with a literal string. -#define WX_ASSERT_STR_EQUAL(p, s) CPPUNIT_ASSERT_EQUAL(wxString(p), s) - -// Use this macro to compare a size_t with a literal integer -#define WX_ASSERT_SIZET_EQUAL(n, m) CPPUNIT_ASSERT_EQUAL(((size_t)n), m) - -// Use this macro to compare the expected time_t value with the result of not -// necessarily time_t type -#define WX_ASSERT_TIME_T_EQUAL(t, n) CPPUNIT_ASSERT_EQUAL((t), (time_t)(n)) - - -/////////////////////////////////////////////////////////////////////////////// -// stream inserter for wxString -// - -#include "wx/string.h" - -inline std::ostream& operator<<(std::ostream& o, const wxString& s) -{ - return o << s.mb_str(); -} - - -/////////////////////////////////////////////////////////////////////////////// -// Some more compiler warning tweaking and auto linking. -// - -#ifdef __BORLANDC__ - #pragma warn .8022 -#endif - -#ifdef _MSC_VER - #pragma warning(default:4702) -#endif // _MSC_VER - -// for VC++ automatically link in cppunit library -#ifdef __VISUALC__ - #ifdef NDEBUG - #pragma comment(lib, "cppunit.lib") - #else // Debug - #pragma comment(lib, "cppunitd.lib") - #endif // Release/Debug -#endif - -#endif // _WX_CPPUNIT_H_ - diff --git a/wxWidgets/include/wx/cshelp.h b/wxWidgets/include/wx/cshelp.h deleted file mode 100644 index 92fe0ffab8..0000000000 --- a/wxWidgets/include/wx/cshelp.h +++ /dev/null @@ -1,244 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/cshelp.h -// Purpose: Context-sensitive help support classes -// Author: Julian Smart, Vadim Zeitlin -// Modified by: -// Created: 08/09/2000 -// RCS-ID: $Id: cshelp.h 61872 2009-09-09 22:37:05Z VZ $ -// Copyright: (c) 2000 Julian Smart, Vadim Zeitlin -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_CSHELP_H_ -#define _WX_CSHELP_H_ - -#include "wx/defs.h" - -#if wxUSE_HELP - -#include "wx/help.h" - -#include "wx/hashmap.h" -#if wxUSE_BMPBUTTON -#include "wx/bmpbuttn.h" -#endif - -#include "wx/event.h" - -// ---------------------------------------------------------------------------- -// classes used to implement context help UI -// ---------------------------------------------------------------------------- - -/* - * wxContextHelp - * Invokes context-sensitive help. When the user - * clicks on a window, a wxEVT_HELP event will be sent to that - * window for the application to display help for. - */ - -class WXDLLEXPORT wxContextHelp : public wxObject -{ -public: - wxContextHelp(wxWindow* win = NULL, bool beginHelp = true); - virtual ~wxContextHelp(); - - bool BeginContextHelp(wxWindow* win); - bool EndContextHelp(); - - bool EventLoop(); - bool DispatchEvent(wxWindow* win, const wxPoint& pt); - - void SetStatus(bool status) { m_status = status; } - -protected: - bool m_inHelp; - bool m_status; // true if the user left-clicked - -private: - DECLARE_DYNAMIC_CLASS(wxContextHelp) -}; - -#if wxUSE_BMPBUTTON -/* - * wxContextHelpButton - * You can add this to your dialogs (especially on non-Windows platforms) - * to put the application into context help mode. - */ - -class WXDLLEXPORT wxContextHelpButton : public wxBitmapButton -{ -public: - wxContextHelpButton(wxWindow* parent, - wxWindowID id = wxID_CONTEXT_HELP, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = wxBU_AUTODRAW); - - void OnContextHelp(wxCommandEvent& event); - -private: - DECLARE_DYNAMIC_CLASS_NO_COPY(wxContextHelpButton) - DECLARE_EVENT_TABLE() -}; - -#endif - -// ---------------------------------------------------------------------------- -// classes used to implement context help support -// ---------------------------------------------------------------------------- - -// wxHelpProvider is an abstract class used by the program implementing context help to -// show the help text (or whatever: it may be HTML page or anything else) for -// the given window. -// -// The current help provider must be explicitly set by the application using -// wxHelpProvider::Set(). -// -// Special note about ShowHelpAtPoint() and ShowHelp(): we want to be able to -// override ShowHelpAtPoint() when we need to use different help messages for -// different parts of the window, but it should also be possible to override -// just ShowHelp() both for backwards compatibility and just because most -// often the help does not, in fact, depend on the position and so -// implementing just ShowHelp() is simpler and more natural, so by default -// ShowHelpAtPoint() forwards to ShowHelp(). But this means that -// wxSimpleHelpProvider has to override ShowHelp() and not ShowHelpAtPoint() -// for backwards compatibility as otherwise the existing code deriving from it -// and overriding ShowHelp() but calling the base class version wouldn't work -// any more, which forces us to use a rather ugly hack and pass the extra -// parameters of ShowHelpAtPoint() to ShowHelp() via member variables. -class WXDLLEXPORT wxHelpProvider -{ -public: - // get/set the current (application-global) help provider (Set() returns - // the previous one) - static wxHelpProvider *Set(wxHelpProvider *helpProvider) - { - wxHelpProvider *helpProviderOld = ms_helpProvider; - ms_helpProvider = helpProvider; - return helpProviderOld; - } - - // unlike some other class, the help provider is not created on demand, - // this must be explicitly done by the application - static wxHelpProvider *Get() { return ms_helpProvider; } - - // get the help string (whose interpretation is help provider dependent - // except that empty string always means that no help is associated with - // the window) for this window - virtual wxString GetHelp(const wxWindowBase *window) = 0; - - // do show help for the given window (uses window->GetHelpAtPoint() - // internally if applicable), return true if it was done or false - // if no help available for this window - virtual bool ShowHelpAtPoint(wxWindowBase *window, - const wxPoint& pt, - wxHelpEvent::Origin origin) - { - wxCHECK_MSG( window, false, wxT("window must not be NULL") ); - - m_helptextAtPoint = pt; - m_helptextOrigin = origin; - - return ShowHelp(window); - } - - // show help for the given window, see ShowHelpAtPoint() above - virtual bool ShowHelp(wxWindowBase * WXUNUSED(window)) { return false; } - - // associate the text with the given window or id: although all help - // providers have these functions to allow making wxWindow::SetHelpText() - // work, not all of them implement them - virtual void AddHelp(wxWindowBase *window, const wxString& text); - - // this version associates the given text with all window with this id - // (may be used to set the same help string for all [Cancel] buttons in - // the application, for example) - virtual void AddHelp(wxWindowID id, const wxString& text); - - // removes the association - virtual void RemoveHelp(wxWindowBase* window); - - // virtual dtor for any base class - virtual ~wxHelpProvider(); - -protected: - wxHelpProvider() - : m_helptextAtPoint(wxDefaultPosition), - m_helptextOrigin(wxHelpEvent::Origin_Unknown) - { - } - - // helper method used by ShowHelp(): returns the help string to use by - // using m_helptextAtPoint/m_helptextOrigin if they're set or just GetHelp - // otherwise - wxString GetHelpTextMaybeAtPoint(wxWindowBase *window); - - - // parameters of the last ShowHelpAtPoint() call, used by ShowHelp() - wxPoint m_helptextAtPoint; - wxHelpEvent::Origin m_helptextOrigin; - -private: - static wxHelpProvider *ms_helpProvider; -}; - -WX_DECLARE_EXPORTED_HASH_MAP( wxUIntPtr, wxString, wxIntegerHash, - wxIntegerEqual, wxSimpleHelpProviderHashMap ); - -// wxSimpleHelpProvider is an implementation of wxHelpProvider which supports -// only plain text help strings and shows the string associated with the -// control (if any) in a tooltip -class WXDLLEXPORT wxSimpleHelpProvider : public wxHelpProvider -{ -public: - // implement wxHelpProvider methods - virtual wxString GetHelp(const wxWindowBase *window); - - // override ShowHelp() and not ShowHelpAtPoint() as explained above - virtual bool ShowHelp(wxWindowBase *window); - - virtual void AddHelp(wxWindowBase *window, const wxString& text); - virtual void AddHelp(wxWindowID id, const wxString& text); - virtual void RemoveHelp(wxWindowBase* window); - -protected: - // we use 2 hashes for storing the help strings associated with windows - // and the ids - wxSimpleHelpProviderHashMap m_hashWindows, - m_hashIds; -}; - -// wxHelpControllerHelpProvider is an implementation of wxHelpProvider which supports -// both context identifiers and plain text help strings. If the help text is an integer, -// it is passed to wxHelpController::DisplayContextPopup. Otherwise, it shows the string -// in a tooltip as per wxSimpleHelpProvider. -class WXDLLEXPORT wxHelpControllerHelpProvider : public wxSimpleHelpProvider -{ -public: - // Note that it doesn't own the help controller. The help controller - // should be deleted separately. - wxHelpControllerHelpProvider(wxHelpControllerBase* hc = (wxHelpControllerBase*) NULL); - - // implement wxHelpProvider methods - - // again (see above): this should be ShowHelpAtPoint() but we need to - // override ShowHelp() to avoid breaking existing code - virtual bool ShowHelp(wxWindowBase *window); - - // Other accessors - void SetHelpController(wxHelpControllerBase* hc) { m_helpController = hc; } - wxHelpControllerBase* GetHelpController() const { return m_helpController; } - -protected: - wxHelpControllerBase* m_helpController; - - DECLARE_NO_COPY_CLASS(wxHelpControllerHelpProvider) -}; - -// Convenience function for turning context id into wxString -WXDLLEXPORT wxString wxContextId(int id); - -#endif // wxUSE_HELP - -#endif // _WX_CSHELP_H_ - diff --git a/wxWidgets/include/wx/ctrlsub.h b/wxWidgets/include/wx/ctrlsub.h deleted file mode 100644 index 6697bb6b32..0000000000 --- a/wxWidgets/include/wx/ctrlsub.h +++ /dev/null @@ -1,210 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/ctrlsub.h (read: "wxConTRoL with SUBitems") -// Purpose: wxControlWithItems interface -// Author: Vadim Zeitlin -// Modified by: -// Created: 22.10.99 -// RCS-ID: $Id: ctrlsub.h 42816 2006-10-31 08:50:17Z RD $ -// Copyright: (c) wxWidgets team -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_CTRLSUB_H_BASE_ -#define _WX_CTRLSUB_H_BASE_ - -#include "wx/defs.h" - -#if wxUSE_CONTROLS - -#include "wx/control.h" // base class - -// ---------------------------------------------------------------------------- -// wxItemContainer defines an interface which is implemented by all controls -// which have string subitems each of which may be selected. -// -// It is decomposed in wxItemContainerImmutable which omits all methods -// adding/removing items and is used by wxRadioBox and wxItemContainer itself. -// -// Examples: wxListBox, wxCheckListBox, wxChoice and wxComboBox (which -// implements an extended interface deriving from this one) -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxItemContainerImmutable -{ -public: - wxItemContainerImmutable() { } - virtual ~wxItemContainerImmutable(); - - // accessing strings - // ----------------- - - virtual unsigned int GetCount() const = 0; - bool IsEmpty() const { return GetCount() == 0; } - - virtual wxString GetString(unsigned int n) const = 0; - wxArrayString GetStrings() const; - virtual void SetString(unsigned int n, const wxString& s) = 0; - - // finding string natively is either case sensitive or insensitive - // but never both so fall back to this base version for not - // supported search type - virtual int FindString(const wxString& s, bool bCase = false) const - { - unsigned int count = GetCount(); - - for ( unsigned int i = 0; i < count ; ++i ) - { - if (GetString(i).IsSameAs( s , bCase )) - return (int)i; - } - - return wxNOT_FOUND; - } - - - // selection - // --------- - - virtual void SetSelection(int n) = 0; - virtual int GetSelection() const = 0; - - // set selection to the specified string, return false if not found - bool SetStringSelection(const wxString& s); - - // return the selected string or empty string if none - wxString GetStringSelection() const; - - // this is the same as SetSelection( for single-selection controls but - // reads better for multi-selection ones - void Select(int n) { SetSelection(n); } - - -protected: - - // check that the index is valid - inline bool IsValid(unsigned int n) const { return n < GetCount(); } - inline bool IsValidInsert(unsigned int n) const { return n <= GetCount(); } -}; - -class WXDLLEXPORT wxItemContainer : public wxItemContainerImmutable -{ -public: - wxItemContainer() { m_clientDataItemsType = wxClientData_None; } - virtual ~wxItemContainer(); - - // adding items - // ------------ - - int Append(const wxString& item) - { return DoAppend(item); } - int Append(const wxString& item, void *clientData) - { int n = DoAppend(item); SetClientData(n, clientData); return n; } - int Append(const wxString& item, wxClientData *clientData) - { int n = DoAppend(item); SetClientObject(n, clientData); return n; } - - // only for rtti needs (separate name) - void AppendString( const wxString& item) - { Append( item ); } - - // append several items at once to the control - void Append(const wxArrayString& strings); - - int Insert(const wxString& item, unsigned int pos) - { return DoInsert(item, pos); } - int Insert(const wxString& item, unsigned int pos, void *clientData); - int Insert(const wxString& item, unsigned int pos, wxClientData *clientData); - - // deleting items - // -------------- - - virtual void Clear() = 0; - virtual void Delete(unsigned int n) = 0; - - // misc - // ---- - - // client data stuff - void SetClientData(unsigned int n, void* clientData); - void* GetClientData(unsigned int n) const; - - void SetClientObject(unsigned int n, wxClientData* clientData); - wxClientData* GetClientObject(unsigned int n) const; - - bool HasClientObjectData() const - { return m_clientDataItemsType == wxClientData_Object; } - bool HasClientUntypedData() const - { return m_clientDataItemsType == wxClientData_Void; } - -protected: - virtual int DoAppend(const wxString& item) = 0; - virtual int DoInsert(const wxString& item, unsigned int pos) = 0; - - virtual void DoSetItemClientData(unsigned int n, void* clientData) = 0; - virtual void* DoGetItemClientData(unsigned int n) const = 0; - virtual void DoSetItemClientObject(unsigned int n, wxClientData* clientData) = 0; - virtual wxClientData* DoGetItemClientObject(unsigned int n) const = 0; - - - // the type of the client data for the items - wxClientDataType m_clientDataItemsType; -}; - -// this macro must (unfortunately) be used in any class deriving from both -// wxItemContainer and wxControl because otherwise there is ambiguity when -// calling GetClientXXX() functions -- the compiler can't choose between the -// two versions -#define wxCONTROL_ITEMCONTAINER_CLIENTDATAOBJECT_RECAST \ - void SetClientData(void *data) \ - { wxEvtHandler::SetClientData(data); } \ - void *GetClientData() const \ - { return wxEvtHandler::GetClientData(); } \ - void SetClientObject(wxClientData *data) \ - { wxEvtHandler::SetClientObject(data); } \ - wxClientData *GetClientObject() const \ - { return wxEvtHandler::GetClientObject(); } \ - void SetClientData(unsigned int n, void* clientData) \ - { wxItemContainer::SetClientData(n, clientData); } \ - void* GetClientData(unsigned int n) const \ - { return wxItemContainer::GetClientData(n); } \ - void SetClientObject(unsigned int n, wxClientData* clientData) \ - { wxItemContainer::SetClientObject(n, clientData); } \ - wxClientData* GetClientObject(unsigned int n) const \ - { return wxItemContainer::GetClientObject(n); } - -class WXDLLEXPORT wxControlWithItems : public wxControl, public wxItemContainer -{ -public: - wxControlWithItems() { } - virtual ~wxControlWithItems(); - - // we have to redefine these functions here to avoid ambiguities in classes - // deriving from us which would arise otherwise because both base classses - // have the methods with the same names - hopefully, a smart compiler can - // optimize away these simple inline wrappers so we don't suffer much from - // this - wxCONTROL_ITEMCONTAINER_CLIENTDATAOBJECT_RECAST - - // usually the controls like list/combo boxes have their own background - // colour - virtual bool ShouldInheritColours() const { return false; } - -protected: - // fill in the client object or data field of the event as appropriate - // - // calls InitCommandEvent() and, if n != wxNOT_FOUND, also sets the per - // item client data - void InitCommandEventWithItems(wxCommandEvent& event, int n); - -private: - DECLARE_ABSTRACT_CLASS(wxControlWithItems) - DECLARE_NO_COPY_CLASS(wxControlWithItems) -}; - - -// ---------------------------------------------------------------------------- -// inline functions -// ---------------------------------------------------------------------------- - -#endif // wxUSE_CONTROLS - -#endif // _WX_CTRLSUB_H_BASE_ diff --git a/wxWidgets/include/wx/cursor.h b/wxWidgets/include/wx/cursor.h deleted file mode 100644 index 39b4e21940..0000000000 --- a/wxWidgets/include/wx/cursor.h +++ /dev/null @@ -1,79 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/cursor.h -// Purpose: wxCursor base header -// Author: Julian Smart -// Modified by: -// Created: -// Copyright: (c) Julian Smart -// RCS-ID: $Id: cursor.h 40865 2006-08-27 09:42:42Z VS $ -// Licence: wxWindows Licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_CURSOR_H_BASE_ -#define _WX_CURSOR_H_BASE_ - -#include "wx/defs.h" - -#if defined(__WXPALMOS__) - #include "wx/palmos/cursor.h" -#elif defined(__WXMSW__) - #include "wx/msw/cursor.h" -#elif defined(__WXMOTIF__) - #include "wx/motif/cursor.h" -#elif defined(__WXGTK20__) - #include "wx/gtk/cursor.h" -#elif defined(__WXGTK__) - #include "wx/gtk1/cursor.h" -#elif defined(__WXX11__) - #include "wx/x11/cursor.h" -#elif defined(__WXMGL__) - #include "wx/mgl/cursor.h" -#elif defined(__WXDFB__) - #include "wx/dfb/cursor.h" -#elif defined(__WXMAC__) - #include "wx/mac/cursor.h" -#elif defined(__WXCOCOA__) - #include "wx/cocoa/cursor.h" -#elif defined(__WXPM__) - #include "wx/os2/cursor.h" -#endif - -#include "wx/utils.h" - -/* This is a small class which can be used by all ports - to temporarily suspend the busy cursor. Useful in modal - dialogs. - - Actually that is not (any longer) quite true.. currently it is - only used in wxGTK Dialog::ShowModal() and now uses static - wxBusyCursor methods that are only implemented for wxGTK so far. - The BusyCursor handling code should probably be implemented in - common code somewhere instead of the separate implementations we - currently have. Also the name BusyCursorSuspender is a little - misleading since it doesn't actually suspend the BusyCursor, just - masks one that is already showing. - If another call to wxBeginBusyCursor is made while this is active - the Busy Cursor will again be shown. But at least now it doesn't - interfere with the state of wxIsBusy() -- RL - -*/ -class wxBusyCursorSuspender -{ -public: - wxBusyCursorSuspender() - { - if( wxIsBusy() ) - { - wxSetCursor( wxBusyCursor::GetStoredCursor() ); - } - } - ~wxBusyCursorSuspender() - { - if( wxIsBusy() ) - { - wxSetCursor( wxBusyCursor::GetBusyCursor() ); - } - } -}; -#endif - // _WX_CURSOR_H_BASE_ diff --git a/wxWidgets/include/wx/dataobj.h b/wxWidgets/include/wx/dataobj.h deleted file mode 100644 index 4c290dc340..0000000000 --- a/wxWidgets/include/wx/dataobj.h +++ /dev/null @@ -1,540 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: wx/dataobj.h -// Purpose: common data object classes -// Author: Vadim Zeitlin, Robert Roebling -// Modified by: -// Created: 26.05.99 -// RCS-ID: $Id: dataobj.h 40772 2006-08-23 13:38:45Z VZ $ -// Copyright: (c) wxWidgets Team -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_DATAOBJ_H_BASE_ -#define _WX_DATAOBJ_H_BASE_ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- -#include "wx/defs.h" - -#if wxUSE_DATAOBJ - -#include "wx/string.h" -#include "wx/bitmap.h" -#include "wx/list.h" -#include "wx/arrstr.h" - -// ============================================================================ -/* - Generic data transfer related classes. The class hierarchy is as follows: - - - wxDataObject- - / \ - / \ - wxDataObjectSimple wxDataObjectComposite - / | \ - / | \ - wxTextDataObject | wxBitmapDataObject - | - wxCustomDataObject - -*/ -// ============================================================================ - -// ---------------------------------------------------------------------------- -// wxDataFormat class is declared in platform-specific headers: it represents -// a format for data which may be either one of the standard ones (text, -// bitmap, ...) or a custom one which is then identified by a unique string. -// ---------------------------------------------------------------------------- - -/* the class interface looks like this (pseudo code): - -class wxDataFormat -{ -public: - typedef NativeFormat; - - wxDataFormat(NativeFormat format = wxDF_INVALID); - wxDataFormat(const wxChar *format); - - wxDataFormat& operator=(NativeFormat format); - wxDataFormat& operator=(const wxDataFormat& format); - - bool operator==(NativeFormat format) const; - bool operator!=(NativeFormat format) const; - - void SetType(NativeFormat format); - NativeFormat GetType() const; - - wxString GetId() const; - void SetId(const wxChar *format); -}; - -*/ - -#if defined(__WXMSW__) - #include "wx/msw/ole/dataform.h" -#elif defined(__WXMOTIF__) - #include "wx/motif/dataform.h" -#elif defined(__WXGTK20__) - #include "wx/gtk/dataform.h" -#elif defined(__WXGTK__) - #include "wx/gtk1/dataform.h" -#elif defined(__WXX11__) - #include "wx/x11/dataform.h" -#elif defined(__WXMAC__) - #include "wx/mac/dataform.h" -#elif defined(__WXCOCOA__) - #include "wx/cocoa/dataform.h" -#elif defined(__WXPM__) - #include "wx/os2/dataform.h" -#endif - -// the value for default argument to some functions (corresponds to -// wxDF_INVALID) -extern WXDLLEXPORT const wxDataFormat& wxFormatInvalid; - -// ---------------------------------------------------------------------------- -// wxDataObject represents a piece of data which knows which formats it -// supports and knows how to render itself in each of them - GetDataHere(), -// and how to restore data from the buffer (SetData()). -// -// Although this class may be used directly (i.e. custom classes may be -// derived from it), in many cases it might be simpler to use either -// wxDataObjectSimple or wxDataObjectComposite classes. -// -// A data object may be "read only", i.e. support only GetData() functions or -// "read-write", i.e. support both GetData() and SetData() (in principle, it -// might be "write only" too, but this is rare). Moreover, it doesn't have to -// support the same formats in Get() and Set() directions: for example, a data -// object containing JPEG image might accept BMPs in GetData() because JPEG -// image may be easily transformed into BMP but not in SetData(). Accordingly, -// all methods dealing with formats take an additional "direction" argument -// which is either SET or GET and which tells the function if the format needs -// to be supported by SetData() or GetDataHere(). -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxDataObjectBase -{ -public: - enum Direction - { - Get = 0x01, // format is supported by GetDataHere() - Set = 0x02, // format is supported by SetData() - Both = 0x03 // format is supported by both (unused currently) - }; - - // this class is polymorphic, hence it needs a virtual dtor - virtual ~wxDataObjectBase(); - - // get the best suited format for rendering our data - virtual wxDataFormat GetPreferredFormat(Direction dir = Get) const = 0; - - // get the number of formats we support - virtual size_t GetFormatCount(Direction dir = Get) const = 0; - - // return all formats in the provided array (of size GetFormatCount()) - virtual void GetAllFormats(wxDataFormat *formats, - Direction dir = Get) const = 0; - - // get the (total) size of data for the given format - virtual size_t GetDataSize(const wxDataFormat& format) const = 0; - - // copy raw data (in the specified format) to the provided buffer, return - // true if data copied successfully, false otherwise - virtual bool GetDataHere(const wxDataFormat& format, void *buf) const = 0; - - // get data from the buffer of specified length (in the given format), - // return true if the data was read successfully, false otherwise - virtual bool SetData(const wxDataFormat& WXUNUSED(format), - size_t WXUNUSED(len), const void * WXUNUSED(buf)) - { - return false; - } - - // returns true if this format is supported - bool IsSupported(const wxDataFormat& format, Direction dir = Get) const; -}; - -// ---------------------------------------------------------------------------- -// include the platform-specific declarations of wxDataObject -// ---------------------------------------------------------------------------- - -#if defined(__WXMSW__) - #include "wx/msw/ole/dataobj.h" -#elif defined(__WXMOTIF__) - #include "wx/motif/dataobj.h" -#elif defined(__WXX11__) - #include "wx/x11/dataobj.h" -#elif defined(__WXGTK20__) - #include "wx/gtk/dataobj.h" -#elif defined(__WXGTK__) - #include "wx/gtk1/dataobj.h" -#elif defined(__WXMAC__) - #include "wx/mac/dataobj.h" -#elif defined(__WXCOCOA__) - #include "wx/cocoa/dataobj.h" -#elif defined(__WXPM__) - #include "wx/os2/dataobj.h" -#endif - -// ---------------------------------------------------------------------------- -// wxDataObjectSimple is a wxDataObject which only supports one format (in -// both Get and Set directions, but you may return false from GetDataHere() or -// SetData() if one of them is not supported). This is the simplest possible -// wxDataObject implementation. -// -// This is still an "abstract base class" (although it doesn't have any pure -// virtual functions), to use it you should derive from it and implement -// GetDataSize(), GetDataHere() and SetData() functions because the base class -// versions don't do anything - they just return "not implemented". -// -// This class should be used when you provide data in only one format (no -// conversion to/from other formats), either a standard or a custom one. -// Otherwise, you should use wxDataObjectComposite or wxDataObject directly. -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxDataObjectSimple : public wxDataObject -{ -public: - // ctor takes the format we support, but it can also be set later with - // SetFormat() - wxDataObjectSimple(const wxDataFormat& format = wxFormatInvalid) - : m_format(format) - { - } - - // get/set the format we support - const wxDataFormat& GetFormat() const { return m_format; } - void SetFormat(const wxDataFormat& format) { m_format = format; } - - // virtual functions to override in derived class (the base class versions - // just return "not implemented") - // ----------------------------------------------------------------------- - - // get the size of our data - virtual size_t GetDataSize() const - { return 0; } - - // copy our data to the buffer - virtual bool GetDataHere(void *WXUNUSED(buf)) const - { return false; } - - // copy data from buffer to our data - virtual bool SetData(size_t WXUNUSED(len), const void *WXUNUSED(buf)) - { return false; } - - // implement base class pure virtuals - // ---------------------------------- - virtual wxDataFormat GetPreferredFormat(wxDataObjectBase::Direction WXUNUSED(dir) = Get) const - { return m_format; } - virtual size_t GetFormatCount(wxDataObjectBase::Direction WXUNUSED(dir) = Get) const - { return 1; } - virtual void GetAllFormats(wxDataFormat *formats, - wxDataObjectBase::Direction WXUNUSED(dir) = Get) const - { *formats = m_format; } - 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); } - -private: - // the one and only format we support - wxDataFormat m_format; - - DECLARE_NO_COPY_CLASS(wxDataObjectSimple) -}; - -// ---------------------------------------------------------------------------- -// wxDataObjectComposite is the simplest way to implement wxDataObject -// supporting multiple formats. It contains several wxDataObjectSimple and -// supports all formats supported by any of them. -// -// This class shouldn't be (normally) derived from, but may be used directly. -// If you need more flexibility than what it provides, you should probably use -// wxDataObject directly. -// ---------------------------------------------------------------------------- - -WX_DECLARE_EXPORTED_LIST(wxDataObjectSimple, wxSimpleDataObjectList); - -class WXDLLEXPORT wxDataObjectComposite : public wxDataObject -{ -public: - // ctor - wxDataObjectComposite(); - virtual ~wxDataObjectComposite(); - - // add data object (it will be deleted by wxDataObjectComposite, hence it - // must be allocated on the heap) whose format will become the preferred - // one if preferred == true - void Add(wxDataObjectSimple *dataObject, bool preferred = false); - - // Report the format passed to the SetData method. This should be the - // format of the data object within the composite that recieved data from - // the clipboard or the DnD operation. You can use this method to find - // out what kind of data object was recieved. - wxDataFormat GetReceivedFormat() const; - - // implement base class pure virtuals - // ---------------------------------- - virtual wxDataFormat GetPreferredFormat(wxDataObjectBase::Direction dir = Get) const; - virtual size_t GetFormatCount(wxDataObjectBase::Direction dir = Get) const; - virtual void GetAllFormats(wxDataFormat *formats, wxDataObjectBase::Direction dir = Get) const; - virtual size_t GetDataSize(const wxDataFormat& format) const; - virtual bool GetDataHere(const wxDataFormat& format, void *buf) const; - virtual bool SetData(const wxDataFormat& format, size_t len, const void *buf); -#if defined(__WXMSW__) - virtual const void* GetSizeFromBuffer( const void* buffer, size_t* size, - const wxDataFormat& format ); - virtual void* SetSizeInBuffer( void* buffer, size_t size, - const wxDataFormat& format ); - virtual size_t GetBufferOffset( const wxDataFormat& format ); -#endif - -protected: - // returns the pointer to the object which supports this format or NULL - wxDataObjectSimple *GetObject(const wxDataFormat& format) const; - -private: - // the list of all (simple) data objects whose formats we support - wxSimpleDataObjectList m_dataObjects; - - // the index of the preferred one (0 initially, so by default the first - // one is the preferred) - size_t m_preferred; - - wxDataFormat m_receivedFormat; - - DECLARE_NO_COPY_CLASS(wxDataObjectComposite) -}; - -// ============================================================================ -// Standard implementations of wxDataObjectSimple which can be used directly -// (i.e. without having to derive from them) for standard data type transfers. -// -// Note that although all of them can work with provided data, you can also -// override their virtual GetXXX() functions to only provide data on demand. -// ============================================================================ - -// ---------------------------------------------------------------------------- -// wxTextDataObject contains text data -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxTextDataObject : public wxDataObjectSimple -{ -public: - // ctor: you can specify the text here or in SetText(), or override - // GetText() - wxTextDataObject(const wxString& text = wxEmptyString) - : wxDataObjectSimple( -#if wxUSE_UNICODE - wxDF_UNICODETEXT -#else - wxDF_TEXT -#endif - ), - m_text(text) - { - } - - // virtual functions which you may override if you want to provide text on - // demand only - otherwise, the trivial default versions will be used - virtual size_t GetTextLength() const { return m_text.Len() + 1; } - virtual wxString GetText() const { return m_text; } - virtual void SetText(const wxString& text) { m_text = text; } - - // implement base class pure virtuals - // ---------------------------------- - - // some platforms have 2 and not 1 format for text data -#if wxUSE_UNICODE && (defined(__WXGTK20__) || defined(__WXMAC__)) - virtual size_t GetFormatCount(Direction WXUNUSED(dir) = Get) const { return 2; } - virtual void GetAllFormats(wxDataFormat *formats, - wxDataObjectBase::Direction WXUNUSED(dir) = Get) const; - - virtual size_t GetDataSize() const { return GetDataSize(GetPreferredFormat()); } - virtual bool GetDataHere(void *buf) const { return GetDataHere(GetPreferredFormat(), buf); } - virtual bool SetData(size_t len, const void *buf) { return SetData(GetPreferredFormat(), len, buf); } - - size_t GetDataSize(const wxDataFormat& format) const; - bool GetDataHere(const wxDataFormat& format, void *pBuf) const; - bool SetData(const wxDataFormat& format, size_t nLen, const void* pBuf); -#else - virtual size_t GetDataSize() const; - virtual bool GetDataHere(void *buf) const; - virtual bool SetData(size_t len, const void *buf); - // Must provide overloads to avoid hiding them (and warnings about it) - virtual size_t GetDataSize(const wxDataFormat&) const - { - return GetDataSize(); - } - virtual bool GetDataHere(const wxDataFormat&, void *buf) const - { - return GetDataHere(buf); - } - virtual bool SetData(const wxDataFormat&, size_t len, const void *buf) - { - return SetData(len, buf); - } -#endif - -private: - wxString m_text; - - DECLARE_NO_COPY_CLASS(wxTextDataObject) -}; - -// ---------------------------------------------------------------------------- -// wxBitmapDataObject contains a bitmap -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxBitmapDataObjectBase : public wxDataObjectSimple -{ -public: - // ctor: you can specify the bitmap here or in SetBitmap(), or override - // GetBitmap() - wxBitmapDataObjectBase(const wxBitmap& bitmap = wxNullBitmap) - : wxDataObjectSimple(wxDF_BITMAP), m_bitmap(bitmap) - { - } - - // virtual functions which you may override if you want to provide data on - // demand only - otherwise, the trivial default versions will be used - virtual wxBitmap GetBitmap() const { return m_bitmap; } - virtual void SetBitmap(const wxBitmap& bitmap) { m_bitmap = bitmap; } - -protected: - wxBitmap m_bitmap; - - DECLARE_NO_COPY_CLASS(wxBitmapDataObjectBase) -}; - -// ---------------------------------------------------------------------------- -// wxFileDataObject contains a list of filenames -// -// NB: notice that this is a "write only" object, it can only be filled with -// data from drag and drop operation. -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxFileDataObjectBase : public wxDataObjectSimple -{ -public: - // ctor: use AddFile() later to fill the array - wxFileDataObjectBase() : wxDataObjectSimple(wxDF_FILENAME) { } - - // get a reference to our array - const wxArrayString& GetFilenames() const { return m_filenames; } - -protected: - wxArrayString m_filenames; - - DECLARE_NO_COPY_CLASS(wxFileDataObjectBase) -}; - -// ---------------------------------------------------------------------------- -// wxCustomDataObject contains arbitrary untyped user data. -// -// It is understood that this data can be copied bitwise. -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxCustomDataObject : public wxDataObjectSimple -{ -public: - // if you don't specify the format in the ctor, you can still use - // SetFormat() later - wxCustomDataObject(const wxDataFormat& format = wxFormatInvalid); - - // the dtor calls Free() - virtual ~wxCustomDataObject(); - - // you can call SetData() to set m_data: it will make a copy of the data - // you pass - or you can use TakeData() which won't copy anything, but - // will take ownership of data (i.e. will call Free() on it later) - void TakeData(size_t size, void *data); - - // this function is called to allocate "size" bytes of memory from - // SetData(). The default version uses operator new[]. - virtual void *Alloc(size_t size); - - // this function is called when the data is freed, you may override it to - // anything you want (or may be nothing at all). The default version calls - // operator delete[] on m_data - virtual void Free(); - - // get data: you may override these functions if you wish to provide data - // only when it's requested - virtual size_t GetSize() const { return m_size; } - virtual void *GetData() const { return m_data; } - - // implement base class pure virtuals - // ---------------------------------- - virtual size_t GetDataSize() const; - virtual bool GetDataHere(void *buf) const; - virtual bool SetData(size_t size, const void *buf); - // Must provide overloads to avoid hiding them (and warnings about it) - virtual size_t GetDataSize(const wxDataFormat&) const - { - return GetDataSize(); - } - virtual bool GetDataHere(const wxDataFormat&, void *buf) const - { - return GetDataHere(buf); - } - virtual bool SetData(const wxDataFormat&, size_t len, const void *buf) - { - return SetData(len, buf); - } - -private: - size_t m_size; - void *m_data; - - DECLARE_NO_COPY_CLASS(wxCustomDataObject) -}; - -// ---------------------------------------------------------------------------- -// include platform-specific declarations of wxXXXBase classes -// ---------------------------------------------------------------------------- - -#if defined(__WXMSW__) - #include "wx/msw/ole/dataobj2.h" - - // wxURLDataObject defined in msw/ole/dataobj2.h -#else // !__WXMSW__ - #if defined(__WXGTK20__) - #include "wx/gtk/dataobj2.h" - #elif defined(__WXGTK__) - #include "wx/gtk1/dataobj2.h" - #elif defined(__WXX11__) - #include "wx/x11/dataobj2.h" - #elif defined(__WXMOTIF__) - #include "wx/motif/dataobj2.h" - #elif defined(__WXMAC__) - #include "wx/mac/dataobj2.h" - #elif defined(__WXCOCOA__) - #include "wx/cocoa/dataobj2.h" - #elif defined(__WXPM__) - #include "wx/os2/dataobj2.h" - #endif - - // wxURLDataObject is simply wxTextDataObject with a different name - class WXDLLEXPORT wxURLDataObject : public wxTextDataObject - { - public: - wxURLDataObject(const wxString& url = wxEmptyString) - : wxTextDataObject(url) - { - } - - wxString GetURL() const { return GetText(); } - void SetURL(const wxString& url) { SetText(url); } - }; -#endif // __WXMSW__/!__WXMSW__ - -#endif // wxUSE_DATAOBJ - -#endif // _WX_DATAOBJ_H_BASE_ diff --git a/wxWidgets/include/wx/dataview.h b/wxWidgets/include/wx/dataview.h deleted file mode 100644 index fe2b5729d3..0000000000 --- a/wxWidgets/include/wx/dataview.h +++ /dev/null @@ -1,480 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/dataview.h -// Purpose: wxDataViewCtrl base classes -// Author: Robert Roebling -// Modified by: -// Created: 08.01.06 -// RCS-ID: $Id: dataview.h 66925 2011-02-16 23:19:32Z JS $ -// Copyright: (c) Robert Roebling -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_DATAVIEW_H_BASE_ -#define _WX_DATAVIEW_H_BASE_ - -#include "wx/defs.h" - -#if wxUSE_DATAVIEWCTRL - -#include "wx/control.h" -#include "wx/textctrl.h" -#include "wx/bitmap.h" -#include "wx/variant.h" - - -#if defined(__WXGTK20__) - // for testing - // #define wxUSE_GENERICDATAVIEWCTRL 1 -#elif defined(__WXMAC__) - #define wxUSE_GENERICDATAVIEWCTRL 1 -#else - #define wxUSE_GENERICDATAVIEWCTRL 1 -#endif - -// ---------------------------------------------------------------------------- -// wxDataViewCtrl flags -// ---------------------------------------------------------------------------- - -// ---------------------------------------------------------------------------- -// wxDataViewCtrl globals -// ---------------------------------------------------------------------------- - -class WXDLLIMPEXP_FWD_ADV wxDataViewModel; -class WXDLLIMPEXP_FWD_ADV wxDataViewListModel; -class WXDLLIMPEXP_FWD_ADV wxDataViewCtrl; -class WXDLLIMPEXP_FWD_ADV wxDataViewColumn; -class WXDLLIMPEXP_FWD_ADV wxDataViewRenderer; - -extern WXDLLIMPEXP_DATA_ADV(const wxChar) wxDataViewCtrlNameStr[]; - -// --------------------------------------------------------- -// wxDataViewModel -// --------------------------------------------------------- - -class WXDLLIMPEXP_ADV wxDataViewModel: public wxObject -{ -public: - wxDataViewModel() { } - virtual ~wxDataViewModel() { } - -protected: - DECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewModel) -}; - -// --------------------------------------------------------- -// wxDataViewListModelNotifier -// --------------------------------------------------------- - - -class WXDLLIMPEXP_ADV wxDataViewListModelNotifier: public wxObject -{ -public: - wxDataViewListModelNotifier() { } - virtual ~wxDataViewListModelNotifier() { } - - virtual bool RowAppended() = 0; - virtual bool RowPrepended() = 0; - virtual bool RowInserted( unsigned int before ) = 0; - virtual bool RowDeleted( unsigned int row ) = 0; - virtual bool RowChanged( unsigned int row ) = 0; - virtual bool ValueChanged( unsigned int col, unsigned int row ) = 0; - virtual bool RowsReordered( unsigned int *new_order ) = 0; - virtual bool Cleared() = 0; - - void SetOwner( wxDataViewListModel *owner ) { m_owner = owner; } - wxDataViewListModel *GetOwner() { return m_owner; } - -private: - wxDataViewListModel *m_owner; -}; - -// --------------------------------------------------------- -// wxDataViewListModel -// --------------------------------------------------------- - -class WXDLLIMPEXP_ADV wxDataViewViewingColumn: public wxObject -{ -public: - wxDataViewViewingColumn( wxDataViewColumn *view_column, unsigned int model_column ) - { - m_viewColumn = view_column; - m_modelColumn = model_column; - } - - wxDataViewColumn *m_viewColumn; - unsigned int m_modelColumn; -}; - -class WXDLLIMPEXP_ADV wxDataViewListModel: public wxDataViewModel -{ -public: - wxDataViewListModel(); - virtual ~wxDataViewListModel(); - - virtual unsigned int GetNumberOfRows() = 0; - virtual unsigned int GetNumberOfCols() = 0; - // return type as reported by wxVariant - virtual wxString GetColType( unsigned int col ) = 0; - // get value into a wxVariant - virtual void GetValue( wxVariant &variant, unsigned int col, unsigned int row ) = 0; - // set value, call ValueChanged() afterwards! - virtual bool SetValue( wxVariant &variant, unsigned int col, unsigned int row ) = 0; - -#if wxABI_VERSION >= 20812 - // Notes: - // - In wx 2.9 GetValue/SetValue are removed, replaced with GetValueByRow and SetValueByRow - // - GetValueByRow/SetValueByRow has (row,col) parameters, GetValue/SetValue is vice versa, (col,row) - - // virtual in wx 2.9 - void GetValueByRow(wxVariant& variant, unsigned row, unsigned col) const - { - const_cast(this)->GetValue(variant, col, row); - } - - // virtual in wx 2.9 - bool SetValueByRow(const wxVariant& variant, unsigned row, unsigned col) - { - return SetValue((wxVariant&)variant, col, row); - } -#endif // wx >= 2.8.12 - - // delegated notifiers - virtual bool RowAppended(); - virtual bool RowPrepended(); - virtual bool RowInserted( unsigned int before ); - virtual bool RowDeleted( unsigned int row ); - virtual bool RowChanged( unsigned int row ); - virtual bool ValueChanged( unsigned int col, unsigned int row ); - virtual bool RowsReordered( unsigned int *new_order ); - virtual bool Cleared(); - - // Used internally - void AddViewingColumn( wxDataViewColumn *view_column, unsigned int model_column ); - void RemoveViewingColumn( wxDataViewColumn *column ); - - void AddNotifier( wxDataViewListModelNotifier *notifier ); - void RemoveNotifier( wxDataViewListModelNotifier *notifier ); - - wxList m_notifiers; - wxList m_viewingColumns; - -protected: - DECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewListModel) -}; - -// --------------------------------------------------------- -// wxDataViewSortedListModel -// --------------------------------------------------------- - -typedef int (wxCALLBACK *wxDataViewListModelCompare) - (unsigned int row1, unsigned int row2, unsigned int col, wxDataViewListModel* model ); - -WX_DEFINE_SORTED_USER_EXPORTED_ARRAY_SIZE_T(unsigned int, wxDataViewSortedIndexArray, WXDLLIMPEXP_ADV); - -class WXDLLIMPEXP_ADV wxDataViewSortedListModel: public wxDataViewListModel -{ -public: - wxDataViewSortedListModel( wxDataViewListModel *child ); - virtual ~wxDataViewSortedListModel(); - - void SetAscending( bool ascending ) { m_ascending = ascending; } - bool GetAscending() { return m_ascending; } - - virtual unsigned int GetNumberOfRows(); - virtual unsigned int GetNumberOfCols(); - // return type as reported by wxVariant - virtual wxString GetColType( unsigned int col ); - // get value into a wxVariant - virtual void GetValue( wxVariant &variant, unsigned int col, unsigned int row ); - // set value, call ValueChanged() afterwards! - virtual bool SetValue( wxVariant &variant, unsigned int col, unsigned int row ); - - // called from user - virtual bool RowAppended(); - virtual bool RowPrepended(); - virtual bool RowInserted( unsigned int before ); - virtual bool RowDeleted( unsigned int row ); - virtual bool RowChanged( unsigned int row ); - virtual bool ValueChanged( unsigned int col, unsigned int row ); - virtual bool RowsReordered( unsigned int *new_order ); - virtual bool Cleared(); - - // called if child's notifiers are called - bool ChildRowAppended(); - bool ChildRowPrepended(); - bool ChildRowInserted( unsigned int before ); - bool ChildRowDeleted( unsigned int row ); - bool ChildRowChanged( unsigned int row ); - bool ChildValueChanged( unsigned int col, unsigned int row ); - bool ChildRowsReordered( unsigned int *new_order ); - bool ChildCleared(); - - virtual void Resort(); - -private: - bool m_ascending; - wxDataViewListModel *m_child; - wxDataViewSortedIndexArray m_array; - wxDataViewListModelNotifier *m_notifierOnChild; - - void InitStatics(); // BAD - -protected: - DECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewSortedListModel) -}; - -// --------------------------------------------------------- -// wxDataViewRendererBase -// --------------------------------------------------------- - -enum wxDataViewCellMode -{ - wxDATAVIEW_CELL_INERT, - wxDATAVIEW_CELL_ACTIVATABLE, - wxDATAVIEW_CELL_EDITABLE -}; - -enum wxDataViewCellRenderState -{ - wxDATAVIEW_CELL_SELECTED = 1, - wxDATAVIEW_CELL_PRELIT = 2, - wxDATAVIEW_CELL_INSENSITIVE = 4, - wxDATAVIEW_CELL_FOCUSED = 8 -}; - -class WXDLLIMPEXP_ADV wxDataViewRendererBase: public wxObject -{ -public: - wxDataViewRendererBase( const wxString &varianttype, wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT ); - - virtual bool SetValue( const wxVariant& WXUNUSED(value) ) { return true; } - virtual bool GetValue( wxVariant& WXUNUSED(value) ) { return true; } - virtual bool Validate( wxVariant& WXUNUSED(value) ) { return true; } - - wxString GetVariantType() { return m_variantType; } - wxDataViewCellMode GetMode() { return m_mode; } - - void SetOwner( wxDataViewColumn *owner ) { m_owner = owner; } - wxDataViewColumn* GetOwner() { return m_owner; } - -protected: - wxDataViewCellMode m_mode; - wxString m_variantType; - wxDataViewColumn *m_owner; - -protected: - DECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewRendererBase) -}; - -// --------------------------------------------------------- -// wxDataViewColumnBase -// --------------------------------------------------------- - -enum wxDataViewColumnFlags -{ - wxDATAVIEW_COL_RESIZABLE = 1, - wxDATAVIEW_COL_SORTABLE = 2, - wxDATAVIEW_COL_HIDDEN = 4 -}; - -class WXDLLIMPEXP_ADV wxDataViewColumnBase: public wxObject -{ -public: - wxDataViewColumnBase( const wxString &title, wxDataViewRenderer *renderer, unsigned int model_column, - int width = 80, int flags = wxDATAVIEW_COL_RESIZABLE ); - wxDataViewColumnBase( const wxBitmap &bitmap, wxDataViewRenderer *renderer, unsigned int model_column, - int width = 80, int flags = wxDATAVIEW_COL_RESIZABLE ); - virtual ~wxDataViewColumnBase(); - - virtual void SetTitle( const wxString &title ); - virtual wxString GetTitle(); - - virtual void SetBitmap( const wxBitmap &bitmap ); - virtual const wxBitmap &GetBitmap(); - - virtual void SetAlignment( wxAlignment align ) = 0; - - virtual void SetSortable( bool sortable ) = 0; - virtual bool GetSortable() = 0; - virtual void SetSortOrder( bool ascending ) = 0; - virtual bool IsSortOrderAscending() = 0; - - wxDataViewRenderer* GetRenderer() { return m_renderer; } - - unsigned int GetModelColumn() { return m_model_column; } - - virtual void SetOwner( wxDataViewCtrl *owner ) { m_owner = owner; } - wxDataViewCtrl *GetOwner() { return m_owner; } - - virtual int GetWidth() = 0; - -private: - wxDataViewCtrl *m_ctrl; - wxDataViewRenderer *m_renderer; - int m_model_column; - int m_flags; - wxString m_title; - wxBitmap m_bitmap; - wxDataViewCtrl *m_owner; - -protected: - DECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewColumnBase) -}; - -// --------------------------------------------------------- -// wxDataViewCtrlBase -// --------------------------------------------------------- - -#define wxDV_SINGLE 0x0000 // for convenience -#define wxDV_MULTIPLE 0x0020 // can select multiple items - -class WXDLLIMPEXP_ADV wxDataViewCtrlBase: public wxControl -{ -public: - wxDataViewCtrlBase(); - virtual ~wxDataViewCtrlBase(); - - virtual bool AssociateModel( wxDataViewListModel *model ); - wxDataViewListModel* GetModel(); - - // short cuts - bool AppendTextColumn( const wxString &label, unsigned int model_column, - wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT, int width = -1 ); - bool AppendToggleColumn( const wxString &label, unsigned int model_column, - wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT, int width = 30 ); - bool AppendProgressColumn( const wxString &label, unsigned int model_column, - wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT, int width = 80 ); - bool AppendDateColumn( const wxString &label, unsigned int model_column, - wxDataViewCellMode mode = wxDATAVIEW_CELL_ACTIVATABLE, int width = -1 ); - bool AppendBitmapColumn( const wxString &label, unsigned int model_column, - wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT, int width = -1 ); - bool AppendTextColumn( const wxBitmap &label, unsigned int model_column, - wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT, int width = -1 ); - bool AppendToggleColumn( const wxBitmap &label, unsigned int model_column, - wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT, int width = 30 ); - bool AppendProgressColumn( const wxBitmap &label, unsigned int model_column, - wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT, int width = 80 ); - bool AppendDateColumn( const wxBitmap &label, unsigned int model_column, - wxDataViewCellMode mode = wxDATAVIEW_CELL_ACTIVATABLE, int width = -1 ); - bool AppendBitmapColumn( const wxBitmap &label, unsigned int model_column, - wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT, int width = -1 ); - - virtual bool AppendColumn( wxDataViewColumn *col ); - virtual unsigned int GetNumberOfColumns(); - virtual bool DeleteColumn( unsigned int pos ); - virtual bool ClearColumns(); - virtual wxDataViewColumn* GetColumn( unsigned int pos ); - - virtual void SetSelection( int row ) = 0; // -1 for unselect - inline void ClearSelection() { SetSelection( -1 ); } - virtual void Unselect( unsigned int row ) = 0; - virtual void SetSelectionRange( unsigned int from, unsigned int to ) = 0; - virtual void SetSelections( const wxArrayInt& aSelections) = 0; - - virtual bool IsSelected( unsigned int row ) const = 0; - virtual int GetSelection() const = 0; - virtual int GetSelections(wxArrayInt& aSelections) const = 0; - -private: - wxDataViewListModel *m_model; - wxList m_cols; - -protected: - DECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewCtrlBase) -}; - - -// ---------------------------------------------------------------------------- -// wxDataViewEvent - the event class for the wxDataViewCtrl notifications -// ---------------------------------------------------------------------------- - -class WXDLLIMPEXP_ADV wxDataViewEvent : public wxNotifyEvent -{ -public: - wxDataViewEvent(wxEventType commandType = wxEVT_NULL, int winid = 0) - : wxNotifyEvent(commandType, winid), - m_col(-1), - m_row(-1), - m_model(NULL), - m_value(wxNullVariant), - m_editCancelled(false), - m_column(NULL) - { } - - wxDataViewEvent(const wxDataViewEvent& event) - : wxNotifyEvent(event), - m_col(event.m_col), - m_row(event.m_col), - m_model(event.m_model), - m_value(event.m_value), - m_editCancelled(event.m_editCancelled), - m_column(event.m_column) - { } - - int GetColumn() const { return m_col; } - void SetColumn( int col ) { m_col = col; } - int GetRow() const { return m_row; } - void SetRow( int row ) { m_row = row; } - wxDataViewModel* GetModel() const { return m_model; } - void SetModel( wxDataViewModel *model ) { m_model = model; } - const wxVariant &GetValue() const { return m_value; } - void SetValue( const wxVariant &value ) { m_value = value; } - - // for wxEVT_DATAVIEW_COLUMN_HEADER_CLICKED only - void SetDataViewColumn( wxDataViewColumn *col ) { m_column = col; } - wxDataViewColumn *GetDataViewColumn() { return m_column; } - - // was label editing canceled? (for wxEVT_COMMAND_DATVIEW_END_LABEL_EDIT only) - bool IsEditCancelled() const { return m_editCancelled; } - void SetEditCanceled(bool editCancelled) { m_editCancelled = editCancelled; } - - virtual wxEvent *Clone() const { return new wxDataViewEvent(*this); } - -protected: - int m_col; - int m_row; - wxDataViewModel *m_model; - wxVariant m_value; - bool m_editCancelled; - wxDataViewColumn *m_column; - -private: - DECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxDataViewEvent) -}; - -BEGIN_DECLARE_EVENT_TYPES() - DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_ADV, wxEVT_COMMAND_DATAVIEW_ROW_SELECTED, -1) - DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_ADV, wxEVT_COMMAND_DATAVIEW_ROW_ACTIVATED, -1) - DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_ADV, wxEVT_COMMAND_DATAVIEW_COLUMN_HEADER_CLICK, -1) - DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_ADV, wxEVT_COMMAND_DATAVIEW_COLUMN_HEADER_RIGHT_CLICK, -1) -END_DECLARE_EVENT_TYPES() - -typedef void (wxEvtHandler::*wxDataViewEventFunction)(wxDataViewEvent&); - -#define wxDataViewEventHandler(func) \ - (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxDataViewEventFunction, &func) - -#define wx__DECLARE_DATAVIEWEVT(evt, id, fn) \ - wx__DECLARE_EVT1(wxEVT_COMMAND_DATAVIEW_ ## evt, id, wxDataViewEventHandler(fn)) - -#define EVT_DATAVIEW_ROW_SELECTED(id, fn) wx__DECLARE_DATAVIEWEVT(ROW_SELECTED, id, fn) -#define EVT_DATAVIEW_ROW_ACTIVATED(id, fn) wx__DECLARE_DATAVIEWEVT(ROW_ACTIVATED, id, fn) -#define EVT_DATAVIEW_COLUMN_HEADER_CLICK(id, fn) wx__DECLARE_DATAVIEWEVT(COLUMN_HEADER_CLICK, id, fn) -#define EVT_DATAVIEW_COLUMN_HEADER_RIGHT_CLICKED(id, fn) wx__DECLARE_DATAVIEWEVT(COLUMN_HEADER_RIGHT_CLICK, id, fn) - - -#if defined(wxUSE_GENERICDATAVIEWCTRL) - #include "wx/generic/dataview.h" -#elif defined(__WXGTK20__) - #include "wx/gtk/dataview.h" -#elif defined(__WXMAC__) - // TODO - // #include "wx/mac/dataview.h" -#else - #include "wx/generic/dataview.h" -#endif - -#endif // wxUSE_DATAVIEWCTRL - -#endif - // _WX_DATAVIEW_H_BASE_ diff --git a/wxWidgets/include/wx/datectrl.h b/wxWidgets/include/wx/datectrl.h deleted file mode 100644 index a7a552715c..0000000000 --- a/wxWidgets/include/wx/datectrl.h +++ /dev/null @@ -1,112 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: wx/datectrl.h -// Purpose: implements wxDatePickerCtrl -// Author: Vadim Zeitlin -// Modified by: -// Created: 2005-01-09 -// RCS-ID: $Id: datectrl.h 61872 2009-09-09 22:37:05Z VZ $ -// Copyright: (c) 2005 Vadim Zeitlin -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_DATECTRL_H_ -#define _WX_DATECTRL_H_ - -#include "wx/defs.h" - -#if wxUSE_DATEPICKCTRL - -#include "wx/control.h" // the base class -#include "wx/datetime.h" - -#define wxDatePickerCtrlNameStr wxT("datectrl") - -// wxDatePickerCtrl styles -enum -{ - // default style on this platform, either wxDP_SPIN or wxDP_DROPDOWN - wxDP_DEFAULT = 0, - - // a spin control-like date picker (not supported in generic version) - wxDP_SPIN = 1, - - // a combobox-like date picker (not supported in mac version) - wxDP_DROPDOWN = 2, - - // always show century in the default date display (otherwise it depends on - // the system date format which may include the century or not) - wxDP_SHOWCENTURY = 4, - - // allow not having any valid date in the control (by default it always has - // some date, today initially if no valid date specified in ctor) - wxDP_ALLOWNONE = 8 -}; - -// ---------------------------------------------------------------------------- -// wxDatePickerCtrl: allow the user to enter the date -// ---------------------------------------------------------------------------- - -class WXDLLIMPEXP_ADV wxDatePickerCtrlBase : public wxControl -{ -public: - /* - The derived classes should implement ctor and Create() method with the - following signature: - - bool Create(wxWindow *parent, - wxWindowID id, - const wxDateTime& dt = wxDefaultDateTime, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = wxDP_DEFAULT | wxDP_SHOWCENTURY, - const wxValidator& validator = wxDefaultValidator, - const wxString& name = wxDatePickerCtrlNameStr); - */ - - // set/get the date - virtual void SetValue(const wxDateTime& dt) = 0; - virtual wxDateTime GetValue() const = 0; - - // set/get the allowed valid range for the dates, if either/both of them - // are invalid, there is no corresponding limit and if neither is set - // GetRange() returns false - virtual void SetRange(const wxDateTime& dt1, const wxDateTime& dt2) = 0; - virtual bool GetRange(wxDateTime *dt1, wxDateTime *dt2) const = 0; -}; - -#if defined(__WXPALMOS__) - #include "wx/palmos/datectrl.h" - - #define wxHAS_NATIVE_DATEPICKCTRL -#elif defined(__WXMSW__) && !defined(__WXUNIVERSAL__) - #include "wx/msw/datectrl.h" - - #define wxHAS_NATIVE_DATEPICKCTRL -#else - #include "wx/generic/datectrl.h" - - class WXDLLIMPEXP_ADV wxDatePickerCtrl : public wxDatePickerCtrlGeneric - { - public: - wxDatePickerCtrl() { } - wxDatePickerCtrl(wxWindow *parent, - wxWindowID id, - const wxDateTime& date = wxDefaultDateTime, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = wxDP_DEFAULT | wxDP_SHOWCENTURY, - const wxValidator& validator = wxDefaultValidator, - const wxString& name = wxDatePickerCtrlNameStr) - : wxDatePickerCtrlGeneric(parent, id, date, pos, size, style, validator, name) - { - } - - private: - DECLARE_DYNAMIC_CLASS_NO_COPY(wxDatePickerCtrl) - }; -#endif - -#endif // wxUSE_DATEPICKCTRL - -#endif // _WX_DATECTRL_H_ - diff --git a/wxWidgets/include/wx/dateevt.h b/wxWidgets/include/wx/dateevt.h deleted file mode 100644 index ba62954406..0000000000 --- a/wxWidgets/include/wx/dateevt.h +++ /dev/null @@ -1,69 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: wx/dateevt.h -// Purpose: declares wxDateEvent class -// Author: Vadim Zeitlin -// Modified by: -// Created: 2005-01-10 -// RCS-ID: $Id: dateevt.h 39637 2006-06-08 18:27:44Z RD $ -// Copyright: (c) 2005 Vadim Zeitlin -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_DATEEVT_H_ -#define _WX_DATEEVT_H_ - -#include "wx/event.h" -#include "wx/datetime.h" -#include "wx/window.h" - -// ---------------------------------------------------------------------------- -// wxDateEvent: used by wxCalendarCtrl and wxDatePickerCtrl -// ---------------------------------------------------------------------------- - -class WXDLLIMPEXP_ADV wxDateEvent : public wxCommandEvent -{ -public: - wxDateEvent() { } - wxDateEvent(wxWindow *win, const wxDateTime& dt, wxEventType type) - : wxCommandEvent(type, win->GetId()), - m_date(dt) - { - SetEventObject(win); - } - - const wxDateTime& GetDate() const { return m_date; } - void SetDate(const wxDateTime &date) { m_date = date; } - - // default copy ctor, assignment operator and dtor are ok - virtual wxEvent *Clone() const { return new wxDateEvent(*this); } - -private: - wxDateTime m_date; - - DECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxDateEvent) -}; - -// ---------------------------------------------------------------------------- -// event types and macros for handling them -// ---------------------------------------------------------------------------- - -BEGIN_DECLARE_EVENT_TYPES() - DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_ADV, wxEVT_DATE_CHANGED, 1101) -END_DECLARE_EVENT_TYPES() - -typedef void (wxEvtHandler::*wxDateEventFunction)(wxDateEvent&); - -#define wxDateEventHandler(func) \ - (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxDateEventFunction, &func) - -#define EVT_DATE_CHANGED(id, fn) \ - wx__DECLARE_EVT1(wxEVT_DATE_CHANGED, id, wxDateEventHandler(fn)) - -#ifdef _WX_DEFINE_DATE_EVENTS_ - DEFINE_EVENT_TYPE(wxEVT_DATE_CHANGED) - - IMPLEMENT_DYNAMIC_CLASS(wxDateEvent, wxCommandEvent) -#endif - -#endif // _WX_DATEEVT_H_ - diff --git a/wxWidgets/include/wx/datetime.h b/wxWidgets/include/wx/datetime.h deleted file mode 100644 index 6f873f91a5..0000000000 --- a/wxWidgets/include/wx/datetime.h +++ /dev/null @@ -1,2137 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/datetime.h -// Purpose: declarations of time/date related classes (wxDateTime, -// wxTimeSpan) -// Author: Vadim Zeitlin -// Modified by: -// Created: 10.02.99 -// RCS-ID: $Id: datetime.h 61872 2009-09-09 22:37:05Z VZ $ -// Copyright: (c) 1998 Vadim Zeitlin -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_DATETIME_H -#define _WX_DATETIME_H - -#include "wx/defs.h" - -#if wxUSE_DATETIME - -#ifndef __WXWINCE__ -#include -#else -#include "wx/msw/wince/time.h" -#endif - -#include // for INT_MIN - -#include "wx/longlong.h" - -class WXDLLIMPEXP_FWD_BASE wxDateTime; -class WXDLLIMPEXP_FWD_BASE wxTimeSpan; -class WXDLLIMPEXP_FWD_BASE wxDateSpan; - -#include "wx/dynarray.h" - -// not all c-runtimes are based on 1/1/1970 being (time_t) 0 -// set this to the corresponding value in seconds 1/1/1970 has on your -// systems c-runtime - -#if defined(__WXMAC__) && !defined(__DARWIN__) && __MSL__ < 0x6000 - #define WX_TIME_BASE_OFFSET ( 2082844800L + 126144000L ) -#else - #define WX_TIME_BASE_OFFSET 0 -#endif -/* - * TODO - * - * + 1. Time zones with minutes (make TimeZone a class) - * ? 2. getdate() function like under Solaris - * + 3. text conversion for wxDateSpan - * + 4. pluggable modules for the workdays calculations - * 5. wxDateTimeHolidayAuthority for Easter and other christian feasts - */ - -/* Two wrapper functions for thread safety */ -#ifdef HAVE_LOCALTIME_R -#define wxLocaltime_r localtime_r -#else -WXDLLIMPEXP_BASE struct tm *wxLocaltime_r(const time_t*, struct tm*); -#if wxUSE_THREADS && !defined(__WINDOWS__) && !defined(__WATCOMC__) - // On Windows, localtime _is_ threadsafe! -#warning using pseudo thread-safe wrapper for localtime to emulate localtime_r -#endif -#endif - -#ifdef HAVE_GMTIME_R -#define wxGmtime_r gmtime_r -#else -WXDLLIMPEXP_BASE struct tm *wxGmtime_r(const time_t*, struct tm*); -#if wxUSE_THREADS && !defined(__WINDOWS__) && !defined(__WATCOMC__) - // On Windows, gmtime _is_ threadsafe! -#warning using pseudo thread-safe wrapper for gmtime to emulate gmtime_r -#endif -#endif - -/* - The three (main) classes declared in this header represent: - - 1. An absolute moment in the time (wxDateTime) - 2. A difference between two moments in the time, positive or negative - (wxTimeSpan) - 3. A logical difference between two dates expressed in - years/months/weeks/days (wxDateSpan) - - The following arithmetic operations are permitted (all others are not): - - addition - -------- - - wxDateTime + wxTimeSpan = wxDateTime - wxDateTime + wxDateSpan = wxDateTime - wxTimeSpan + wxTimeSpan = wxTimeSpan - wxDateSpan + wxDateSpan = wxDateSpan - - subtraction - ------------ - wxDateTime - wxDateTime = wxTimeSpan - wxDateTime - wxTimeSpan = wxDateTime - wxDateTime - wxDateSpan = wxDateTime - wxTimeSpan - wxTimeSpan = wxTimeSpan - wxDateSpan - wxDateSpan = wxDateSpan - - multiplication - -------------- - wxTimeSpan * number = wxTimeSpan - number * wxTimeSpan = wxTimeSpan - wxDateSpan * number = wxDateSpan - number * wxDateSpan = wxDateSpan - - unitary minus - ------------- - -wxTimeSpan = wxTimeSpan - -wxDateSpan = wxDateSpan - - For each binary operation OP (+, -, *) we have the following operatorOP=() as - a method and the method with a symbolic name OPER (Add, Subtract, Multiply) - as a synonym for it and another const method with the same name which returns - the changed copy of the object and operatorOP() as a global function which is - implemented in terms of the const version of OPEN. For the unary - we have - operator-() as a method, Neg() as synonym for it and Negate() which returns - the copy of the object with the changed sign. -*/ - -// an invalid/default date time object which may be used as the default -// argument for arguments of type wxDateTime; it is also returned by all -// functions returning wxDateTime on failure (this is why it is also called -// wxInvalidDateTime) -class WXDLLIMPEXP_FWD_BASE wxDateTime; - -extern WXDLLIMPEXP_DATA_BASE(const wxChar*) wxDefaultDateTimeFormat; -extern WXDLLIMPEXP_DATA_BASE(const wxChar*) wxDefaultTimeSpanFormat; -extern WXDLLIMPEXP_DATA_BASE(const wxDateTime) wxDefaultDateTime; - -#define wxInvalidDateTime wxDefaultDateTime - -// ---------------------------------------------------------------------------- -// wxDateTime represents an absolute moment in the time -// ---------------------------------------------------------------------------- - -class WXDLLIMPEXP_BASE wxDateTime -{ -public: - // types - // ------------------------------------------------------------------------ - - // a small unsigned integer type for storing things like minutes, - // seconds &c. It should be at least short (i.e. not char) to contain - // the number of milliseconds - it may also be 'int' because there is - // no size penalty associated with it in our code, we don't store any - // data in this format - typedef unsigned short wxDateTime_t; - - // constants - // ------------------------------------------------------------------------ - - // the timezones - enum TZ - { - // the time in the current time zone - Local, - - // zones from GMT (= Greenwhich Mean Time): they're guaranteed to be - // consequent numbers, so writing something like `GMT0 + offset' is - // safe if abs(offset) <= 12 - - // underscore stands for minus - GMT_12, GMT_11, GMT_10, GMT_9, GMT_8, GMT_7, - GMT_6, GMT_5, GMT_4, GMT_3, GMT_2, GMT_1, - GMT0, - GMT1, GMT2, GMT3, GMT4, GMT5, GMT6, - GMT7, GMT8, GMT9, GMT10, GMT11, GMT12, GMT13, - // Note that GMT12 and GMT_12 are not the same: there is a difference - // of exactly one day between them - - // some symbolic names for TZ - - // Europe - WET = GMT0, // Western Europe Time - WEST = GMT1, // Western Europe Summer Time - CET = GMT1, // Central Europe Time - CEST = GMT2, // Central Europe Summer Time - EET = GMT2, // Eastern Europe Time - EEST = GMT3, // Eastern Europe Summer Time - MSK = GMT3, // Moscow Time - MSD = GMT4, // Moscow Summer Time - - // US and Canada - AST = GMT_4, // Atlantic Standard Time - ADT = GMT_3, // Atlantic Daylight Time - EST = GMT_5, // Eastern Standard Time - EDT = GMT_4, // Eastern Daylight Saving Time - CST = GMT_6, // Central Standard Time - CDT = GMT_5, // Central Daylight Saving Time - MST = GMT_7, // Mountain Standard Time - MDT = GMT_6, // Mountain Daylight Saving Time - PST = GMT_8, // Pacific Standard Time - PDT = GMT_7, // Pacific Daylight Saving Time - HST = GMT_10, // Hawaiian Standard Time - AKST = GMT_9, // Alaska Standard Time - AKDT = GMT_8, // Alaska Daylight Saving Time - - // Australia - - A_WST = GMT8, // Western Standard Time - A_CST = GMT13 + 1, // Central Standard Time (+9.5) - A_EST = GMT10, // Eastern Standard Time - A_ESST = GMT11, // Eastern Summer Time - - // New Zealand - NZST = GMT12, // Standard Time - NZDT = GMT13, // Daylight Saving Time - - // TODO add more symbolic timezone names here - - // Universal Coordinated Time = the new and politically correct name - // for GMT - UTC = GMT0 - }; - - // the calendar systems we know about: notice that it's valid (for - // this classes purpose anyhow) to work with any of these calendars - // even with the dates before the historical appearance of the - // calendar - enum Calendar - { - Gregorian, // current calendar - Julian // calendar in use since -45 until the 1582 (or later) - - // TODO Hebrew, Chinese, Maya, ... (just kidding) (or then may be not?) - }; - - // these values only are used to identify the different dates of - // adoption of the Gregorian calendar (see IsGregorian()) - // - // All data and comments taken verbatim from "The Calendar FAQ (v 2.0)" - // by Claus Tøndering, http://www.pip.dknet.dk/~c-t/calendar.html - // except for the comments "we take". - // - // Symbol "->" should be read as "was followed by" in the comments - // which follow. - enum GregorianAdoption - { - Gr_Unknown, // no data for this country or it's too uncertain to use - Gr_Standard, // on the day 0 of Gregorian calendar: 15 Oct 1582 - - Gr_Alaska, // Oct 1867 when Alaska became part of the USA - Gr_Albania, // Dec 1912 - - Gr_Austria = Gr_Unknown, // Different regions on different dates - Gr_Austria_Brixen, // 5 Oct 1583 -> 16 Oct 1583 - Gr_Austria_Salzburg = Gr_Austria_Brixen, - Gr_Austria_Tyrol = Gr_Austria_Brixen, - Gr_Austria_Carinthia, // 14 Dec 1583 -> 25 Dec 1583 - Gr_Austria_Styria = Gr_Austria_Carinthia, - - Gr_Belgium, // Then part of the Netherlands - - Gr_Bulgaria = Gr_Unknown, // Unknown precisely (from 1915 to 1920) - Gr_Bulgaria_1, // 18 Mar 1916 -> 1 Apr 1916 - Gr_Bulgaria_2, // 31 Mar 1916 -> 14 Apr 1916 - Gr_Bulgaria_3, // 3 Sep 1920 -> 17 Sep 1920 - - Gr_Canada = Gr_Unknown, // Different regions followed the changes in - // Great Britain or France - - Gr_China = Gr_Unknown, // Different authorities say: - Gr_China_1, // 18 Dec 1911 -> 1 Jan 1912 - Gr_China_2, // 18 Dec 1928 -> 1 Jan 1929 - - Gr_Czechoslovakia, // (Bohemia and Moravia) 6 Jan 1584 -> 17 Jan 1584 - Gr_Denmark, // (including Norway) 18 Feb 1700 -> 1 Mar 1700 - Gr_Egypt, // 1875 - Gr_Estonia, // 1918 - Gr_Finland, // Then part of Sweden - - Gr_France, // 9 Dec 1582 -> 20 Dec 1582 - Gr_France_Alsace, // 4 Feb 1682 -> 16 Feb 1682 - Gr_France_Lorraine, // 16 Feb 1760 -> 28 Feb 1760 - Gr_France_Strasbourg, // February 1682 - - Gr_Germany = Gr_Unknown, // Different states on different dates: - Gr_Germany_Catholic, // 1583-1585 (we take 1584) - Gr_Germany_Prussia, // 22 Aug 1610 -> 2 Sep 1610 - Gr_Germany_Protestant, // 18 Feb 1700 -> 1 Mar 1700 - - Gr_GreatBritain, // 2 Sep 1752 -> 14 Sep 1752 (use 'cal(1)') - - Gr_Greece, // 9 Mar 1924 -> 23 Mar 1924 - Gr_Hungary, // 21 Oct 1587 -> 1 Nov 1587 - Gr_Ireland = Gr_GreatBritain, - Gr_Italy = Gr_Standard, - - Gr_Japan = Gr_Unknown, // Different authorities say: - Gr_Japan_1, // 19 Dec 1872 -> 1 Jan 1873 - Gr_Japan_2, // 19 Dec 1892 -> 1 Jan 1893 - Gr_Japan_3, // 18 Dec 1918 -> 1 Jan 1919 - - Gr_Latvia, // 1915-1918 (we take 1915) - Gr_Lithuania, // 1915 - Gr_Luxemburg, // 14 Dec 1582 -> 25 Dec 1582 - Gr_Netherlands = Gr_Belgium, // (including Belgium) 1 Jan 1583 - - // this is too weird to take into account: the Gregorian calendar was - // introduced twice in Groningen, first time 28 Feb 1583 was followed - // by 11 Mar 1583, then it has gone back to Julian in the summer of - // 1584 and then 13 Dec 1700 -> 12 Jan 1701 - which is - // the date we take here - Gr_Netherlands_Groningen, // 13 Dec 1700 -> 12 Jan 1701 - Gr_Netherlands_Gelderland, // 30 Jun 1700 -> 12 Jul 1700 - Gr_Netherlands_Utrecht, // (and Overijssel) 30 Nov 1700->12 Dec 1700 - Gr_Netherlands_Friesland, // (and Drenthe) 31 Dec 1700 -> 12 Jan 1701 - - Gr_Norway = Gr_Denmark, // Then part of Denmark - Gr_Poland = Gr_Standard, - Gr_Portugal = Gr_Standard, - Gr_Romania, // 31 Mar 1919 -> 14 Apr 1919 - Gr_Russia, // 31 Jan 1918 -> 14 Feb 1918 - Gr_Scotland = Gr_GreatBritain, - Gr_Spain = Gr_Standard, - - // Sweden has a curious history. Sweden decided to make a gradual - // change from the Julian to the Gregorian calendar. By dropping every - // leap year from 1700 through 1740 the eleven superfluous days would - // be omitted and from 1 Mar 1740 they would be in sync with the - // Gregorian calendar. (But in the meantime they would be in sync with - // nobody!) - // - // So 1700 (which should have been a leap year in the Julian calendar) - // was not a leap year in Sweden. However, by mistake 1704 and 1708 - // became leap years. This left Sweden out of synchronisation with - // both the Julian and the Gregorian world, so they decided to go back - // to the Julian calendar. In order to do this, they inserted an extra - // day in 1712, making that year a double leap year! So in 1712, - // February had 30 days in Sweden. - // - // Later, in 1753, Sweden changed to the Gregorian calendar by - // dropping 11 days like everyone else. - Gr_Sweden = Gr_Finland, // 17 Feb 1753 -> 1 Mar 1753 - - Gr_Switzerland = Gr_Unknown,// Different cantons used different dates - Gr_Switzerland_Catholic, // 1583, 1584 or 1597 (we take 1584) - Gr_Switzerland_Protestant, // 31 Dec 1700 -> 12 Jan 1701 - - Gr_Turkey, // 1 Jan 1927 - Gr_USA = Gr_GreatBritain, - Gr_Wales = Gr_GreatBritain, - Gr_Yugoslavia // 1919 - }; - - // the country parameter is used so far for calculating the start and - // the end of DST period and for deciding whether the date is a work - // day or not - // - // TODO move this to intl.h - -// Required for WinCE -#ifdef USA -#undef USA -#endif - - enum Country - { - Country_Unknown, // no special information for this country - Country_Default, // set the default country with SetCountry() method - // or use the default country with any other - - // TODO add more countries (for this we must know about DST and/or - // holidays for this country) - - // Western European countries: we assume that they all follow the same - // DST rules (true or false?) - Country_WesternEurope_Start, - Country_EEC = Country_WesternEurope_Start, - France, - Germany, - UK, - Country_WesternEurope_End = UK, - - Russia, - USA - }; - // symbolic names for the months - enum Month - { - Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec, Inv_Month - }; - - // symbolic names for the weekdays - enum WeekDay - { - Sun, Mon, Tue, Wed, Thu, Fri, Sat, Inv_WeekDay - }; - - // invalid value for the year - enum Year - { - Inv_Year = SHRT_MIN // should hold in wxDateTime_t - }; - - // flags for GetWeekDayName and GetMonthName - enum NameFlags - { - Name_Full = 0x01, // return full name - Name_Abbr = 0x02 // return abbreviated name - }; - - // flags for GetWeekOfYear and GetWeekOfMonth - enum WeekFlags - { - Default_First, // Sunday_First for US, Monday_First for the rest - Monday_First, // week starts with a Monday - Sunday_First // week starts with a Sunday - }; - - // helper classes - // ------------------------------------------------------------------------ - - // a class representing a time zone: basicly, this is just an offset - // (in seconds) from GMT - class WXDLLIMPEXP_BASE TimeZone - { - public: - TimeZone(TZ tz); - - // don't use this ctor, it doesn't work for negative offsets (but can't - // be removed or changed to avoid breaking ABI in 2.8) - TimeZone(wxDateTime_t offset = 0) { m_offset = offset; } - -#if wxABI_VERSION >= 20808 - // create time zone object with the given offset - static TimeZone Make(long offset) - { - TimeZone tz; - tz.m_offset = offset; - return tz; - } -#endif // wxABI 2.8.8+ - - long GetOffset() const { return m_offset; } - - private: - // offset for this timezone from GMT in seconds - long m_offset; - }; - - // standard struct tm is limited to the years from 1900 (because - // tm_year field is the offset from 1900), so we use our own struct - // instead to represent broken down time - // - // NB: this struct should always be kept normalized (i.e. mon should - // be < 12, 1 <= day <= 31 &c), so use AddMonths(), AddDays() - // instead of modifying the member fields directly! - struct WXDLLIMPEXP_BASE Tm - { - wxDateTime_t msec, sec, min, hour, mday; - Month mon; - int year; - - // default ctor inits the object to an invalid value - Tm(); - - // ctor from struct tm and the timezone - Tm(const struct tm& tm, const TimeZone& tz); - - // check that the given date/time is valid (in Gregorian calendar) - bool IsValid() const; - - // get the week day - WeekDay GetWeekDay() // not const because wday may be changed - { - if ( wday == Inv_WeekDay ) - ComputeWeekDay(); - - return (WeekDay)wday; - } - - // add the given number of months to the date keeping it normalized - void AddMonths(int monDiff); - - // add the given number of months to the date keeping it normalized - void AddDays(int dayDiff); - - private: - // compute the weekday from other fields - void ComputeWeekDay(); - - // the timezone we correspond to - TimeZone m_tz; - - // these values can't be accessed directly because they're not always - // computed and we calculate them on demand - wxDateTime_t wday, yday; - }; - - // static methods - // ------------------------------------------------------------------------ - - // set the current country - static void SetCountry(Country country); - // get the current country - static Country GetCountry(); - - // return true if the country is a West European one (in practice, - // this means that the same DST rules as for EEC apply) - static bool IsWestEuropeanCountry(Country country = Country_Default); - - // return the current year - static int GetCurrentYear(Calendar cal = Gregorian); - - // convert the year as returned by wxDateTime::GetYear() to a year - // suitable for BC/AD notation. The difference is that BC year 1 - // corresponds to the year 0 (while BC year 0 didn't exist) and AD - // year N is just year N. - static int ConvertYearToBC(int year); - - // return the current month - static Month GetCurrentMonth(Calendar cal = Gregorian); - - // returns true if the given year is a leap year in the given calendar - static bool IsLeapYear(int year = Inv_Year, Calendar cal = Gregorian); - - // get the century (19 for 1999, 20 for 2000 and -5 for 492 BC) - static int GetCentury(int year); - - // returns the number of days in this year (356 or 355 for Gregorian - // calendar usually :-) - static wxDateTime_t GetNumberOfDays(int year, Calendar cal = Gregorian); - - // get the number of the days in the given month (default value for - // the year means the current one) - static wxDateTime_t GetNumberOfDays(Month month, - int year = Inv_Year, - Calendar cal = Gregorian); - - // get the full (default) or abbreviated month name in the current - // locale, returns empty string on error - static wxString GetMonthName(Month month, - NameFlags flags = Name_Full); - - // get the full (default) or abbreviated weekday name in the current - // locale, returns empty string on error - static wxString GetWeekDayName(WeekDay weekday, - NameFlags flags = Name_Full); - - // get the AM and PM strings in the current locale (may be empty) - static void GetAmPmStrings(wxString *am, wxString *pm); - - // return true if the given country uses DST for this year - static bool IsDSTApplicable(int year = Inv_Year, - Country country = Country_Default); - - // get the beginning of DST for this year, will return invalid object - // if no DST applicable in this year. The default value of the - // parameter means to take the current year. - static wxDateTime GetBeginDST(int year = Inv_Year, - Country country = Country_Default); - // get the end of DST for this year, will return invalid object - // if no DST applicable in this year. The default value of the - // parameter means to take the current year. - static wxDateTime GetEndDST(int year = Inv_Year, - Country country = Country_Default); - - // return the wxDateTime object for the current time - static inline wxDateTime Now(); - - // return the wxDateTime object for the current time with millisecond - // precision (if available on this platform) - static wxDateTime UNow(); - - // return the wxDateTime object for today midnight: i.e. as Now() but - // with time set to 0 - static inline wxDateTime Today(); - - // constructors: you should test whether the constructor succeeded with - // IsValid() function. The values Inv_Month and Inv_Year for the - // parameters mean take current month and/or year values. - // ------------------------------------------------------------------------ - - // default ctor does not initialize the object, use Set()! - wxDateTime() { m_time = wxLongLong((wxInt32)UINT_MAX, UINT_MAX); } - - // from time_t: seconds since the Epoch 00:00:00 UTC, Jan 1, 1970) -#if (!(defined(__VISAGECPP__) && __IBMCPP__ >= 400)) -// VA C++ confuses this with wxDateTime(double jdn) thinking it is a duplicate declaration - inline wxDateTime(time_t timet); -#endif - // from broken down time/date (only for standard Unix range) - inline wxDateTime(const struct tm& tm); - // from broken down time/date (any range) - inline wxDateTime(const Tm& tm); - - // from JDN (beware of rounding errors) - inline wxDateTime(double jdn); - - // from separate values for each component, date set to today - inline wxDateTime(wxDateTime_t hour, - wxDateTime_t minute = 0, - wxDateTime_t second = 0, - wxDateTime_t millisec = 0); - // from separate values for each component with explicit date - inline wxDateTime(wxDateTime_t day, // day of the month - Month month, - int year = Inv_Year, // 1999, not 99 please! - wxDateTime_t hour = 0, - wxDateTime_t minute = 0, - wxDateTime_t second = 0, - wxDateTime_t millisec = 0); - - // default copy ctor ok - - // no dtor - - // assignment operators and Set() functions: all non const methods return - // the reference to this object. IsValid() should be used to test whether - // the function succeeded. - // ------------------------------------------------------------------------ - - // set to the current time - inline wxDateTime& SetToCurrent(); - -#if (!(defined(__VISAGECPP__) && __IBMCPP__ >= 400)) -// VA C++ confuses this with wxDateTime(double jdn) thinking it is a duplicate declaration - // set to given time_t value - inline wxDateTime& Set(time_t timet); -#endif - - // set to given broken down time/date - wxDateTime& Set(const struct tm& tm); - - // set to given broken down time/date - inline wxDateTime& Set(const Tm& tm); - - // set to given JDN (beware of rounding errors) - wxDateTime& Set(double jdn); - - // set to given time, date = today - wxDateTime& Set(wxDateTime_t hour, - wxDateTime_t minute = 0, - wxDateTime_t second = 0, - wxDateTime_t millisec = 0); - - // from separate values for each component with explicit date - // (defaults for month and year are the current values) - wxDateTime& Set(wxDateTime_t day, - Month month, - int year = Inv_Year, // 1999, not 99 please! - wxDateTime_t hour = 0, - wxDateTime_t minute = 0, - wxDateTime_t second = 0, - wxDateTime_t millisec = 0); - - // resets time to 00:00:00, doesn't change the date - wxDateTime& ResetTime(); - -#if wxABI_VERSION >= 20802 - // get the date part of this object only, i.e. the object which has the - // same date as this one but time of 00:00:00 - wxDateTime GetDateOnly() const; -#endif // wxABI 2.8.1+ - - // the following functions don't change the values of the other - // fields, i.e. SetMinute() won't change either hour or seconds value - - // set the year - wxDateTime& SetYear(int year); - // set the month - wxDateTime& SetMonth(Month month); - // set the day of the month - wxDateTime& SetDay(wxDateTime_t day); - // set hour - wxDateTime& SetHour(wxDateTime_t hour); - // set minute - wxDateTime& SetMinute(wxDateTime_t minute); - // set second - wxDateTime& SetSecond(wxDateTime_t second); - // set millisecond - wxDateTime& SetMillisecond(wxDateTime_t millisecond); - - // assignment operator from time_t - wxDateTime& operator=(time_t timet) { return Set(timet); } - - // assignment operator from broken down time/date - wxDateTime& operator=(const struct tm& tm) { return Set(tm); } - - // assignment operator from broken down time/date - wxDateTime& operator=(const Tm& tm) { return Set(tm); } - - // default assignment operator is ok - - // calendar calculations (functions which set the date only leave the time - // unchanged, e.g. don't explictly zero it): SetXXX() functions modify the - // object itself, GetXXX() ones return a new object. - // ------------------------------------------------------------------------ - - // set to the given week day in the same week as this one - wxDateTime& SetToWeekDayInSameWeek(WeekDay weekday, - WeekFlags flags = Monday_First); - inline wxDateTime GetWeekDayInSameWeek(WeekDay weekday, - WeekFlags flags = Monday_First) const; - - // set to the next week day following this one - wxDateTime& SetToNextWeekDay(WeekDay weekday); - inline wxDateTime GetNextWeekDay(WeekDay weekday) const; - - // set to the previous week day before this one - wxDateTime& SetToPrevWeekDay(WeekDay weekday); - inline wxDateTime GetPrevWeekDay(WeekDay weekday) const; - - // set to Nth occurence of given weekday in the given month of the - // given year (time is set to 0), return true on success and false on - // failure. n may be positive (1..5) or negative to count from the end - // of the month (see helper function SetToLastWeekDay()) - bool SetToWeekDay(WeekDay weekday, - int n = 1, - Month month = Inv_Month, - int year = Inv_Year); - inline wxDateTime GetWeekDay(WeekDay weekday, - int n = 1, - Month month = Inv_Month, - int year = Inv_Year) const; - - // sets to the last weekday in the given month, year - inline bool SetToLastWeekDay(WeekDay weekday, - Month month = Inv_Month, - int year = Inv_Year); - inline wxDateTime GetLastWeekDay(WeekDay weekday, - Month month = Inv_Month, - int year = Inv_Year); - -#if WXWIN_COMPATIBILITY_2_6 - // sets the date to the given day of the given week in the year, - // returns true on success and false if given date doesn't exist (e.g. - // numWeek is > 53) - // - // these functions are badly defined as they're not the reverse of - // GetWeekOfYear(), use SetToTheWeekOfYear() instead - wxDEPRECATED( bool SetToTheWeek(wxDateTime_t numWeek, - WeekDay weekday = Mon, - WeekFlags flags = Monday_First) ); - wxDEPRECATED( wxDateTime GetWeek(wxDateTime_t numWeek, - WeekDay weekday = Mon, - WeekFlags flags = Monday_First) const ); -#endif // WXWIN_COMPATIBILITY_2_6 - - // returns the date corresponding to the given week day of the given - // week (in ISO notation) of the specified year - static wxDateTime SetToWeekOfYear(int year, - wxDateTime_t numWeek, - WeekDay weekday = Mon); - - // sets the date to the last day of the given (or current) month or the - // given (or current) year - wxDateTime& SetToLastMonthDay(Month month = Inv_Month, - int year = Inv_Year); - inline wxDateTime GetLastMonthDay(Month month = Inv_Month, - int year = Inv_Year) const; - - // sets to the given year day (1..365 or 366) - wxDateTime& SetToYearDay(wxDateTime_t yday); - inline wxDateTime GetYearDay(wxDateTime_t yday) const; - - // The definitions below were taken verbatim from - // - // http://www.capecod.net/~pbaum/date/date0.htm - // - // (Peter Baum's home page) - // - // definition: The Julian Day Number, Julian Day, or JD of a - // particular instant of time is the number of days and fractions of a - // day since 12 hours Universal Time (Greenwich mean noon) on January - // 1 of the year -4712, where the year is given in the Julian - // proleptic calendar. The idea of using this reference date was - // originally proposed by Joseph Scalizer in 1582 to count years but - // it was modified by 19th century astronomers to count days. One - // could have equivalently defined the reference time to be noon of - // November 24, -4713 if were understood that Gregorian calendar rules - // were applied. Julian days are Julian Day Numbers and are not to be - // confused with Julian dates. - // - // definition: The Rata Die number is a date specified as the number - // of days relative to a base date of December 31 of the year 0. Thus - // January 1 of the year 1 is Rata Die day 1. - - // get the Julian Day number (the fractional part specifies the time of - // the day, related to noon - beware of rounding errors!) - double GetJulianDayNumber() const; - double GetJDN() const { return GetJulianDayNumber(); } - - // get the Modified Julian Day number: it is equal to JDN - 2400000.5 - // and so integral MJDs correspond to the midnights (and not noons). - // MJD 0 is Nov 17, 1858 - double GetModifiedJulianDayNumber() const { return GetJDN() - 2400000.5; } - double GetMJD() const { return GetModifiedJulianDayNumber(); } - - // get the Rata Die number - double GetRataDie() const; - - // TODO algorithms for calculating some important dates, such as - // religious holidays (Easter...) or moon/solar eclipses? Some - // algorithms can be found in the calendar FAQ - - - // Timezone stuff: a wxDateTime object constructed using given - // day/month/year/hour/min/sec values is interpreted as this moment in - // local time. Using the functions below, it may be converted to another - // time zone (e.g., the Unix epoch is wxDateTime(1, Jan, 1970).ToGMT()). - // - // These functions try to handle DST internally, but there is no magical - // way to know all rules for it in all countries in the world, so if the - // program can handle it itself (or doesn't want to handle it at all for - // whatever reason), the DST handling can be disabled with noDST. - // ------------------------------------------------------------------------ - - // transform to any given timezone - inline wxDateTime ToTimezone(const TimeZone& tz, bool noDST = false) const; - wxDateTime& MakeTimezone(const TimeZone& tz, bool noDST = false); - - // interpret current value as being in another timezone and transform - // it to local one - inline wxDateTime FromTimezone(const TimeZone& tz, bool noDST = false) const; - wxDateTime& MakeFromTimezone(const TimeZone& tz, bool noDST = false); - - // transform to/from GMT/UTC - wxDateTime ToUTC(bool noDST = false) const { return ToTimezone(UTC, noDST); } - wxDateTime& MakeUTC(bool noDST = false) { return MakeTimezone(UTC, noDST); } - - wxDateTime ToGMT(bool noDST = false) const { return ToUTC(noDST); } - wxDateTime& MakeGMT(bool noDST = false) { return MakeUTC(noDST); } - - wxDateTime FromUTC(bool noDST = false) const - { return FromTimezone(UTC, noDST); } - wxDateTime& MakeFromUTC(bool noDST = false) - { return MakeFromTimezone(UTC, noDST); } - - // is daylight savings time in effect at this moment according to the - // rules of the specified country? - // - // Return value is > 0 if DST is in effect, 0 if it is not and -1 if - // the information is not available (this is compatible with ANSI C) - int IsDST(Country country = Country_Default) const; - - - // accessors: many of them take the timezone parameter which indicates the - // timezone for which to make the calculations and the default value means - // to do it for the current timezone of this machine (even if the function - // only operates with the date it's necessary because a date may wrap as - // result of timezone shift) - // ------------------------------------------------------------------------ - - // is the date valid? - inline bool IsValid() const { return m_time != wxInvalidDateTime.m_time; } - - // get the broken down date/time representation in the given timezone - // - // If you wish to get several time components (day, month and year), - // consider getting the whole Tm strcuture first and retrieving the - // value from it - this is much more efficient - Tm GetTm(const TimeZone& tz = Local) const; - - // get the number of seconds since the Unix epoch - returns (time_t)-1 - // if the value is out of range - inline time_t GetTicks() const; - - // get the century, same as GetCentury(GetYear()) - int GetCentury(const TimeZone& tz = Local) const - { return GetCentury(GetYear(tz)); } - // get the year (returns Inv_Year if date is invalid) - int GetYear(const TimeZone& tz = Local) const - { return GetTm(tz).year; } - // get the month (Inv_Month if date is invalid) - Month GetMonth(const TimeZone& tz = Local) const - { return (Month)GetTm(tz).mon; } - // get the month day (in 1..31 range, 0 if date is invalid) - wxDateTime_t GetDay(const TimeZone& tz = Local) const - { return GetTm(tz).mday; } - // get the day of the week (Inv_WeekDay if date is invalid) - WeekDay GetWeekDay(const TimeZone& tz = Local) const - { return GetTm(tz).GetWeekDay(); } - // get the hour of the day - wxDateTime_t GetHour(const TimeZone& tz = Local) const - { return GetTm(tz).hour; } - // get the minute - wxDateTime_t GetMinute(const TimeZone& tz = Local) const - { return GetTm(tz).min; } - // get the second - wxDateTime_t GetSecond(const TimeZone& tz = Local) const - { return GetTm(tz).sec; } - // get milliseconds - wxDateTime_t GetMillisecond(const TimeZone& tz = Local) const - { return GetTm(tz).msec; } - - // get the day since the year start (1..366, 0 if date is invalid) - wxDateTime_t GetDayOfYear(const TimeZone& tz = Local) const; - // get the week number since the year start (1..52 or 53, 0 if date is - // invalid) - wxDateTime_t GetWeekOfYear(WeekFlags flags = Monday_First, - const TimeZone& tz = Local) const; - // get the week number since the month start (1..5, 0 if date is - // invalid) - wxDateTime_t GetWeekOfMonth(WeekFlags flags = Monday_First, - const TimeZone& tz = Local) const; - - // is this date a work day? This depends on a country, of course, - // because the holidays are different in different countries - bool IsWorkDay(Country country = Country_Default) const; - - // is this date later than Gregorian calendar introduction for the - // given country (see enum GregorianAdoption)? - // - // NB: this function shouldn't be considered as absolute authority in - // the matter. Besides, for some countries the exact date of - // adoption of the Gregorian calendar is simply unknown. - bool IsGregorianDate(GregorianAdoption country = Gr_Standard) const; - - // dos date and time format - // ------------------------------------------------------------------------ - - // set from the DOS packed format - wxDateTime& SetFromDOS(unsigned long ddt); - - // pack the date in DOS format - unsigned long GetAsDOS() const; - - // comparison (see also functions below for operator versions) - // ------------------------------------------------------------------------ - - // returns true if the two moments are strictly identical - inline bool IsEqualTo(const wxDateTime& datetime) const; - - // returns true if the date is strictly earlier than the given one - inline bool IsEarlierThan(const wxDateTime& datetime) const; - - // returns true if the date is strictly later than the given one - inline bool IsLaterThan(const wxDateTime& datetime) const; - - // returns true if the date is strictly in the given range - inline bool IsStrictlyBetween(const wxDateTime& t1, - const wxDateTime& t2) const; - - // returns true if the date is in the given range - inline bool IsBetween(const wxDateTime& t1, const wxDateTime& t2) const; - - // do these two objects refer to the same date? - inline bool IsSameDate(const wxDateTime& dt) const; - - // do these two objects have the same time? - inline bool IsSameTime(const wxDateTime& dt) const; - - // are these two objects equal up to given timespan? - inline bool IsEqualUpTo(const wxDateTime& dt, const wxTimeSpan& ts) const; - - inline bool operator<(const wxDateTime& dt) const - { - wxASSERT_MSG( IsValid() && dt.IsValid(), wxT("invalid wxDateTime") ); - return GetValue() < dt.GetValue(); - } - - inline bool operator<=(const wxDateTime& dt) const - { - wxASSERT_MSG( IsValid() && dt.IsValid(), wxT("invalid wxDateTime") ); - return GetValue() <= dt.GetValue(); - } - - inline bool operator>(const wxDateTime& dt) const - { - wxASSERT_MSG( IsValid() && dt.IsValid(), wxT("invalid wxDateTime") ); - return GetValue() > dt.GetValue(); - } - - inline bool operator>=(const wxDateTime& dt) const - { - wxASSERT_MSG( IsValid() && dt.IsValid(), wxT("invalid wxDateTime") ); - return GetValue() >= dt.GetValue(); - } - - inline bool operator==(const wxDateTime& dt) const - { - wxASSERT_MSG( IsValid() && dt.IsValid(), wxT("invalid wxDateTime") ); - return GetValue() == dt.GetValue(); - } - - inline bool operator!=(const wxDateTime& dt) const - { - wxASSERT_MSG( IsValid() && dt.IsValid(), wxT("invalid wxDateTime") ); - return GetValue() != dt.GetValue(); - } - - // arithmetics with dates (see also below for more operators) - // ------------------------------------------------------------------------ - - // return the sum of the date with a time span (positive or negative) - inline wxDateTime Add(const wxTimeSpan& diff) const; - // add a time span (positive or negative) - inline wxDateTime& Add(const wxTimeSpan& diff); - // add a time span (positive or negative) - inline wxDateTime& operator+=(const wxTimeSpan& diff); - inline wxDateTime operator+(const wxTimeSpan& ts) const - { - wxDateTime dt(*this); - dt.Add(ts); - return dt; - } - - // return the difference of the date with a time span - inline wxDateTime Subtract(const wxTimeSpan& diff) const; - // subtract a time span (positive or negative) - inline wxDateTime& Subtract(const wxTimeSpan& diff); - // subtract a time span (positive or negative) - inline wxDateTime& operator-=(const wxTimeSpan& diff); - inline wxDateTime operator-(const wxTimeSpan& ts) const - { - wxDateTime dt(*this); - dt.Subtract(ts); - return dt; - } - - // return the sum of the date with a date span - inline wxDateTime Add(const wxDateSpan& diff) const; - // add a date span (positive or negative) - wxDateTime& Add(const wxDateSpan& diff); - // add a date span (positive or negative) - inline wxDateTime& operator+=(const wxDateSpan& diff); - inline wxDateTime operator+(const wxDateSpan& ds) const - { - wxDateTime dt(*this); - dt.Add(ds); - return dt; - } - - // return the difference of the date with a date span - inline wxDateTime Subtract(const wxDateSpan& diff) const; - // subtract a date span (positive or negative) - inline wxDateTime& Subtract(const wxDateSpan& diff); - // subtract a date span (positive or negative) - inline wxDateTime& operator-=(const wxDateSpan& diff); - inline wxDateTime operator-(const wxDateSpan& ds) const - { - wxDateTime dt(*this); - dt.Subtract(ds); - return dt; - } - - // return the difference between two dates - inline wxTimeSpan Subtract(const wxDateTime& dt) const; - inline wxTimeSpan operator-(const wxDateTime& dt2) const; - - // conversion to/from text: all conversions from text return the pointer to - // the next character following the date specification (i.e. the one where - // the scan had to stop) or NULL on failure. - // ------------------------------------------------------------------------ - - // parse a string in RFC 822 format (found e.g. in mail headers and - // having the form "Wed, 10 Feb 1999 19:07:07 +0100") - const wxChar *ParseRfc822Date(const wxChar* date); - // parse a date/time in the given format (see strptime(3)), fill in - // the missing (in the string) fields with the values of dateDef (by - // default, they will not change if they had valid values or will - // default to Today() otherwise) - const wxChar *ParseFormat(const wxChar *date, - const wxChar *format = wxDefaultDateTimeFormat, - const wxDateTime& dateDef = wxDefaultDateTime); - // parse a string containing the date/time in "free" format, this - // function will try to make an educated guess at the string contents - const wxChar *ParseDateTime(const wxChar *datetime); - // parse a string containing the date only in "free" format (less - // flexible than ParseDateTime) - const wxChar *ParseDate(const wxChar *date); - // parse a string containing the time only in "free" format - const wxChar *ParseTime(const wxChar *time); - - // this function accepts strftime()-like format string (default - // argument corresponds to the preferred date and time representation - // for the current locale) and returns the string containing the - // resulting text representation - wxString Format(const wxChar *format = wxDefaultDateTimeFormat, - const TimeZone& tz = Local) const; - // preferred date representation for the current locale - wxString FormatDate() const { return Format(wxT("%x")); } - // preferred time representation for the current locale - wxString FormatTime() const { return Format(wxT("%X")); } - // returns the string representing the date in ISO 8601 format - // (YYYY-MM-DD) - wxString FormatISODate() const { return Format(wxT("%Y-%m-%d")); } - // returns the string representing the time in ISO 8601 format - // (HH:MM:SS) - wxString FormatISOTime() const { return Format(wxT("%H:%M:%S")); } - - // implementation - // ------------------------------------------------------------------------ - - // construct from internal representation - wxDateTime(const wxLongLong& time) { m_time = time; } - - // get the internal representation - inline wxLongLong GetValue() const; - - // a helper function to get the current time_t - static time_t GetTimeNow() { return time((time_t *)NULL); } - - // another one to get the current time broken down - static struct tm *GetTmNow() - { - static struct tm l_CurrentTime; - return GetTmNow(&l_CurrentTime); - } - - // get current time using thread-safe function - static struct tm *GetTmNow(struct tm *tmstruct); - -private: - // the current country - as it's the same for all program objects (unless - // it runs on a _really_ big cluster system :-), this is a static member: - // see SetCountry() and GetCountry() - static Country ms_country; - - // this constant is used to transform a time_t value to the internal - // representation, as time_t is in seconds and we use milliseconds it's - // fixed to 1000 - static const long TIME_T_FACTOR; - - // returns true if we fall in range in which we can use standard ANSI C - // functions - inline bool IsInStdRange() const; - - // the internal representation of the time is the amount of milliseconds - // elapsed since the origin which is set by convention to the UNIX/C epoch - // value: the midnight of January 1, 1970 (UTC) - wxLongLong m_time; -}; - -// ---------------------------------------------------------------------------- -// This class contains a difference between 2 wxDateTime values, so it makes -// sense to add it to wxDateTime and it is the result of subtraction of 2 -// objects of that class. See also wxDateSpan. -// ---------------------------------------------------------------------------- - -class WXDLLIMPEXP_BASE wxTimeSpan -{ -public: - // constructors - // ------------------------------------------------------------------------ - - // return the timespan for the given number of milliseconds - static wxTimeSpan Milliseconds(wxLongLong ms) { return wxTimeSpan(0, 0, 0, ms); } - static wxTimeSpan Millisecond() { return Milliseconds(1); } - - // return the timespan for the given number of seconds - static wxTimeSpan Seconds(wxLongLong sec) { return wxTimeSpan(0, 0, sec); } - static wxTimeSpan Second() { return Seconds(1); } - - // return the timespan for the given number of minutes - static wxTimeSpan Minutes(long min) { return wxTimeSpan(0, min, 0 ); } - static wxTimeSpan Minute() { return Minutes(1); } - - // return the timespan for the given number of hours - static wxTimeSpan Hours(long hours) { return wxTimeSpan(hours, 0, 0); } - static wxTimeSpan Hour() { return Hours(1); } - - // return the timespan for the given number of days - static wxTimeSpan Days(long days) { return Hours(24 * days); } - static wxTimeSpan Day() { return Days(1); } - - // return the timespan for the given number of weeks - static wxTimeSpan Weeks(long days) { return Days(7 * days); } - static wxTimeSpan Week() { return Weeks(1); } - - // default ctor constructs the 0 time span - wxTimeSpan() { } - - // from separate values for each component, date set to 0 (hours are - // not restricted to 0..24 range, neither are minutes, seconds or - // milliseconds) - inline wxTimeSpan(long hours, - long minutes = 0, - wxLongLong seconds = 0, - wxLongLong milliseconds = 0); - - // default copy ctor is ok - - // no dtor - - // arithmetics with time spans (see also below for more operators) - // ------------------------------------------------------------------------ - - // return the sum of two timespans - inline wxTimeSpan Add(const wxTimeSpan& diff) const; - // add two timespans together - inline wxTimeSpan& Add(const wxTimeSpan& diff); - // add two timespans together - wxTimeSpan& operator+=(const wxTimeSpan& diff) { return Add(diff); } - inline wxTimeSpan operator+(const wxTimeSpan& ts) const - { - return wxTimeSpan(GetValue() + ts.GetValue()); - } - - // return the difference of two timespans - inline wxTimeSpan Subtract(const wxTimeSpan& diff) const; - // subtract another timespan - inline wxTimeSpan& Subtract(const wxTimeSpan& diff); - // subtract another timespan - wxTimeSpan& operator-=(const wxTimeSpan& diff) { return Subtract(diff); } - inline wxTimeSpan operator-(const wxTimeSpan& ts) - { - return wxTimeSpan(GetValue() - ts.GetValue()); - } - - // multiply timespan by a scalar - inline wxTimeSpan Multiply(int n) const; - // multiply timespan by a scalar - inline wxTimeSpan& Multiply(int n); - // multiply timespan by a scalar - wxTimeSpan& operator*=(int n) { return Multiply(n); } - inline wxTimeSpan operator*(int n) const - { - return wxTimeSpan(*this).Multiply(n); - } - - // return this timespan with opposite sign - wxTimeSpan Negate() const { return wxTimeSpan(-GetValue()); } - // negate the value of the timespan - wxTimeSpan& Neg() { m_diff = -GetValue(); return *this; } - // negate the value of the timespan - wxTimeSpan& operator-() { return Neg(); } - - // return the absolute value of the timespan: does _not_ modify the - // object - inline wxTimeSpan Abs() const; - - // there is intentionally no division because we don't want to - // introduce rounding errors in time calculations - - // comparaison (see also operator versions below) - // ------------------------------------------------------------------------ - - // is the timespan null? - bool IsNull() const { return m_diff == 0l; } - // returns true if the timespan is null - bool operator!() const { return !IsNull(); } - - // is the timespan positive? - bool IsPositive() const { return m_diff > 0l; } - - // is the timespan negative? - bool IsNegative() const { return m_diff < 0l; } - - // are two timespans equal? - inline bool IsEqualTo(const wxTimeSpan& ts) const; - // compare two timestamps: works with the absolute values, i.e. -2 - // hours is longer than 1 hour. Also, it will return false if the - // timespans are equal in absolute value. - inline bool IsLongerThan(const wxTimeSpan& ts) const; - // compare two timestamps: works with the absolute values, i.e. 1 - // hour is shorter than -2 hours. Also, it will return false if the - // timespans are equal in absolute value. - bool IsShorterThan(const wxTimeSpan& t) const { return !IsLongerThan(t); } - - inline bool operator<(const wxTimeSpan &ts) const - { - return GetValue() < ts.GetValue(); - } - - inline bool operator<=(const wxTimeSpan &ts) const - { - return GetValue() <= ts.GetValue(); - } - - inline bool operator>(const wxTimeSpan &ts) const - { - return GetValue() > ts.GetValue(); - } - - inline bool operator>=(const wxTimeSpan &ts) const - { - return GetValue() >= ts.GetValue(); - } - - inline bool operator==(const wxTimeSpan &ts) const - { - return GetValue() == ts.GetValue(); - } - - inline bool operator!=(const wxTimeSpan &ts) const - { - return GetValue() != ts.GetValue(); - } - - // breaking into days, hours, minutes and seconds - // ------------------------------------------------------------------------ - - // get the max number of weeks in this timespan - inline int GetWeeks() const; - // get the max number of days in this timespan - inline int GetDays() const; - // get the max number of hours in this timespan - inline int GetHours() const; - // get the max number of minutes in this timespan - inline int GetMinutes() const; - // get the max number of seconds in this timespan - inline wxLongLong GetSeconds() const; - // get the number of milliseconds in this timespan - wxLongLong GetMilliseconds() const { return m_diff; } - - // conversion to text - // ------------------------------------------------------------------------ - - // this function accepts strftime()-like format string (default - // argument corresponds to the preferred date and time representation - // for the current locale) and returns the string containing the - // resulting text representation. Notice that only some of format - // specifiers valid for wxDateTime are valid for wxTimeSpan: hours, - // minutes and seconds make sense, but not "PM/AM" string for example. - wxString Format(const wxChar *format = wxDefaultTimeSpanFormat) const; - - // implementation - // ------------------------------------------------------------------------ - - // construct from internal representation - wxTimeSpan(const wxLongLong& diff) { m_diff = diff; } - - // get the internal representation - wxLongLong GetValue() const { return m_diff; } - -private: - // the (signed) time span in milliseconds - wxLongLong m_diff; -}; - -// ---------------------------------------------------------------------------- -// This class is a "logical time span" and is useful for implementing program -// logic for such things as "add one month to the date" which, in general, -// doesn't mean to add 60*60*24*31 seconds to it, but to take the same date -// the next month (to understand that this is indeed different consider adding -// one month to Feb, 15 - we want to get Mar, 15, of course). -// -// When adding a month to the date, all lesser components (days, hours, ...) -// won't be changed unless the resulting date would be invalid: for example, -// Jan 31 + 1 month will be Feb 28, not (non existing) Feb 31. -// -// Because of this feature, adding and subtracting back again the same -// wxDateSpan will *not*, in general give back the original date: Feb 28 - 1 -// month will be Jan 28, not Jan 31! -// -// wxDateSpan can be either positive or negative. They may be -// multiplied by scalars which multiply all deltas by the scalar: i.e. 2*(1 -// month and 1 day) is 2 months and 2 days. They can be added together and -// with wxDateTime or wxTimeSpan, but the type of result is different for each -// case. -// -// Beware about weeks: if you specify both weeks and days, the total number of -// days added will be 7*weeks + days! See also GetTotalDays() function. -// -// Equality operators are defined for wxDateSpans. Two datespans are equal if -// they both give the same target date when added to *every* source date. -// Thus wxDateSpan::Months(1) is not equal to wxDateSpan::Days(30), because -// they not give the same date when added to 1 Feb. But wxDateSpan::Days(14) is -// equal to wxDateSpan::Weeks(2) -// -// Finally, notice that for adding hours, minutes &c you don't need this -// class: wxTimeSpan will do the job because there are no subtleties -// associated with those. -// ---------------------------------------------------------------------------- - -class WXDLLIMPEXP_BASE wxDateSpan -{ -public: - // constructors - // ------------------------------------------------------------------------ - - // this many years/months/weeks/days - wxDateSpan(int years = 0, int months = 0, int weeks = 0, int days = 0) - { - m_years = years; - m_months = months; - m_weeks = weeks; - m_days = days; - } - - // get an object for the given number of days - static wxDateSpan Days(int days) { return wxDateSpan(0, 0, 0, days); } - static wxDateSpan Day() { return Days(1); } - - // get an object for the given number of weeks - static wxDateSpan Weeks(int weeks) { return wxDateSpan(0, 0, weeks, 0); } - static wxDateSpan Week() { return Weeks(1); } - - // get an object for the given number of months - static wxDateSpan Months(int mon) { return wxDateSpan(0, mon, 0, 0); } - static wxDateSpan Month() { return Months(1); } - - // get an object for the given number of years - static wxDateSpan Years(int years) { return wxDateSpan(years, 0, 0, 0); } - static wxDateSpan Year() { return Years(1); } - - // default copy ctor is ok - - // no dtor - - // accessors (all SetXXX() return the (modified) wxDateSpan object) - // ------------------------------------------------------------------------ - - // set number of years - wxDateSpan& SetYears(int n) { m_years = n; return *this; } - // set number of months - wxDateSpan& SetMonths(int n) { m_months = n; return *this; } - // set number of weeks - wxDateSpan& SetWeeks(int n) { m_weeks = n; return *this; } - // set number of days - wxDateSpan& SetDays(int n) { m_days = n; return *this; } - - // get number of years - int GetYears() const { return m_years; } - // get number of months - int GetMonths() const { return m_months; } - // get number of weeks - int GetWeeks() const { return m_weeks; } - // get number of days - int GetDays() const { return m_days; } - // returns 7*GetWeeks() + GetDays() - int GetTotalDays() const { return 7*m_weeks + m_days; } - - // arithmetics with date spans (see also below for more operators) - // ------------------------------------------------------------------------ - - // return sum of two date spans - inline wxDateSpan Add(const wxDateSpan& other) const; - // add another wxDateSpan to us - inline wxDateSpan& Add(const wxDateSpan& other); - // add another wxDateSpan to us - inline wxDateSpan& operator+=(const wxDateSpan& other); - inline wxDateSpan operator+(const wxDateSpan& ds) const - { - return wxDateSpan(GetYears() + ds.GetYears(), - GetMonths() + ds.GetMonths(), - GetWeeks() + ds.GetWeeks(), - GetDays() + ds.GetDays()); - } - - // return difference of two date spans - inline wxDateSpan Subtract(const wxDateSpan& other) const; - // subtract another wxDateSpan from us - inline wxDateSpan& Subtract(const wxDateSpan& other); - // subtract another wxDateSpan from us - inline wxDateSpan& operator-=(const wxDateSpan& other); - inline wxDateSpan operator-(const wxDateSpan& ds) const - { - return wxDateSpan(GetYears() - ds.GetYears(), - GetMonths() - ds.GetMonths(), - GetWeeks() - ds.GetWeeks(), - GetDays() - ds.GetDays()); - } - - // return a copy of this time span with changed sign - inline wxDateSpan Negate() const; - // inverse the sign of this timespan - inline wxDateSpan& Neg(); - // inverse the sign of this timespan - wxDateSpan& operator-() { return Neg(); } - - // return the date span proportional to this one with given factor - inline wxDateSpan Multiply(int factor) const; - // multiply all components by a (signed) number - inline wxDateSpan& Multiply(int factor); - // multiply all components by a (signed) number - inline wxDateSpan& operator*=(int factor) { return Multiply(factor); } - inline wxDateSpan operator*(int n) const - { - return wxDateSpan(*this).Multiply(n); - } - - // ds1 == d2 if and only if for every wxDateTime t t + ds1 == t + ds2 - inline bool operator==(const wxDateSpan& ds) const - { - return GetYears() == ds.GetYears() && - GetMonths() == ds.GetMonths() && - GetTotalDays() == ds.GetTotalDays(); - } - - inline bool operator!=(const wxDateSpan& ds) const - { - return !(*this == ds); - } - -private: - int m_years, - m_months, - m_weeks, - m_days; -}; - -// ---------------------------------------------------------------------------- -// wxDateTimeArray: array of dates. -// ---------------------------------------------------------------------------- - -WX_DECLARE_USER_EXPORTED_OBJARRAY(wxDateTime, wxDateTimeArray, WXDLLIMPEXP_BASE); - -// ---------------------------------------------------------------------------- -// wxDateTimeHolidayAuthority: an object of this class will decide whether a -// given date is a holiday and is used by all functions working with "work -// days". -// -// NB: the base class is an ABC, derived classes must implement the pure -// virtual methods to work with the holidays they correspond to. -// ---------------------------------------------------------------------------- - -class WXDLLIMPEXP_FWD_BASE wxDateTimeHolidayAuthority; -WX_DEFINE_USER_EXPORTED_ARRAY_PTR(wxDateTimeHolidayAuthority *, - wxHolidayAuthoritiesArray, - class WXDLLIMPEXP_BASE); - -class wxDateTimeHolidaysModule; -class WXDLLIMPEXP_BASE wxDateTimeHolidayAuthority -{ -friend class wxDateTimeHolidaysModule; -public: - // returns true if the given date is a holiday - static bool IsHoliday(const wxDateTime& dt); - - // fills the provided array with all holidays in the given range, returns - // the number of them - static size_t GetHolidaysInRange(const wxDateTime& dtStart, - const wxDateTime& dtEnd, - wxDateTimeArray& holidays); - - // clear the list of holiday authorities - static void ClearAllAuthorities(); - - // add a new holiday authority (the pointer will be deleted by - // wxDateTimeHolidayAuthority) - static void AddAuthority(wxDateTimeHolidayAuthority *auth); - - // the base class must have a virtual dtor - virtual ~wxDateTimeHolidayAuthority(); - -protected: - // this function is called to determine whether a given day is a holiday - virtual bool DoIsHoliday(const wxDateTime& dt) const = 0; - - // this function should fill the array with all holidays between the two - // given dates - it is implemented in the base class, but in a very - // inefficient way (it just iterates over all days and uses IsHoliday() for - // each of them), so it must be overridden in the derived class where the - // base class version may be explicitly used if needed - // - // returns the number of holidays in the given range and fills holidays - // array - virtual size_t DoGetHolidaysInRange(const wxDateTime& dtStart, - const wxDateTime& dtEnd, - wxDateTimeArray& holidays) const = 0; - -private: - // all holiday authorities - static wxHolidayAuthoritiesArray ms_authorities; -}; - -// the holidays for this class are all Saturdays and Sundays -class WXDLLIMPEXP_BASE wxDateTimeWorkDays : public wxDateTimeHolidayAuthority -{ -protected: - virtual bool DoIsHoliday(const wxDateTime& dt) const; - virtual size_t DoGetHolidaysInRange(const wxDateTime& dtStart, - const wxDateTime& dtEnd, - wxDateTimeArray& holidays) const; -}; - -// ============================================================================ -// inline functions implementation -// ============================================================================ - -// ---------------------------------------------------------------------------- -// private macros -// ---------------------------------------------------------------------------- - -#define MILLISECONDS_PER_DAY 86400000l - -// some broken compilers (HP-UX CC) refuse to compile the "normal" version, but -// using a temp variable always might prevent other compilers from optimising -// it away - hence use of this ugly macro -#ifndef __HPUX__ - #define MODIFY_AND_RETURN(op) return wxDateTime(*this).op -#else - #define MODIFY_AND_RETURN(op) wxDateTime dt(*this); dt.op; return dt -#endif - -// ---------------------------------------------------------------------------- -// wxDateTime construction -// ---------------------------------------------------------------------------- - -inline bool wxDateTime::IsInStdRange() const -{ - return m_time >= 0l && (m_time / TIME_T_FACTOR) < LONG_MAX; -} - -/* static */ -inline wxDateTime wxDateTime::Now() -{ - struct tm tmstruct; - return wxDateTime(*GetTmNow(&tmstruct)); -} - -/* static */ -inline wxDateTime wxDateTime::Today() -{ - wxDateTime dt(Now()); - dt.ResetTime(); - - return dt; -} - -#if (!(defined(__VISAGECPP__) && __IBMCPP__ >= 400)) -inline wxDateTime& wxDateTime::Set(time_t timet) -{ - // assign first to avoid long multiplication overflow! - m_time = timet - WX_TIME_BASE_OFFSET ; - m_time *= TIME_T_FACTOR; - - return *this; -} -#endif - -inline wxDateTime& wxDateTime::SetToCurrent() -{ - *this = Now(); - return *this; -} - -#if (!(defined(__VISAGECPP__) && __IBMCPP__ >= 400)) -inline wxDateTime::wxDateTime(time_t timet) -{ - Set(timet); -} -#endif - -inline wxDateTime::wxDateTime(const struct tm& tm) -{ - Set(tm); -} - -inline wxDateTime::wxDateTime(const Tm& tm) -{ - Set(tm); -} - -inline wxDateTime::wxDateTime(double jdn) -{ - Set(jdn); -} - -inline wxDateTime& wxDateTime::Set(const Tm& tm) -{ - wxASSERT_MSG( tm.IsValid(), wxT("invalid broken down date/time") ); - - return Set(tm.mday, (Month)tm.mon, tm.year, - tm.hour, tm.min, tm.sec, tm.msec); -} - -inline wxDateTime::wxDateTime(wxDateTime_t hour, - wxDateTime_t minute, - wxDateTime_t second, - wxDateTime_t millisec) -{ - Set(hour, minute, second, millisec); -} - -inline wxDateTime::wxDateTime(wxDateTime_t day, - Month month, - int year, - wxDateTime_t hour, - wxDateTime_t minute, - wxDateTime_t second, - wxDateTime_t millisec) -{ - Set(day, month, year, hour, minute, second, millisec); -} - -// ---------------------------------------------------------------------------- -// wxDateTime accessors -// ---------------------------------------------------------------------------- - -inline wxLongLong wxDateTime::GetValue() const -{ - wxASSERT_MSG( IsValid(), wxT("invalid wxDateTime")); - - return m_time; -} - -inline time_t wxDateTime::GetTicks() const -{ - wxASSERT_MSG( IsValid(), wxT("invalid wxDateTime")); - if ( !IsInStdRange() ) - { - return (time_t)-1; - } - - return (time_t)((m_time / (long)TIME_T_FACTOR).ToLong()) + WX_TIME_BASE_OFFSET; -} - -inline bool wxDateTime::SetToLastWeekDay(WeekDay weekday, - Month month, - int year) -{ - return SetToWeekDay(weekday, -1, month, year); -} - -inline wxDateTime -wxDateTime::GetWeekDayInSameWeek(WeekDay weekday, - WeekFlags WXUNUSED(flags)) const -{ - MODIFY_AND_RETURN( SetToWeekDayInSameWeek(weekday) ); -} - -inline wxDateTime wxDateTime::GetNextWeekDay(WeekDay weekday) const -{ - MODIFY_AND_RETURN( SetToNextWeekDay(weekday) ); -} - -inline wxDateTime wxDateTime::GetPrevWeekDay(WeekDay weekday) const -{ - MODIFY_AND_RETURN( SetToPrevWeekDay(weekday) ); -} - -inline wxDateTime wxDateTime::GetWeekDay(WeekDay weekday, - int n, - Month month, - int year) const -{ - wxDateTime dt(*this); - - return dt.SetToWeekDay(weekday, n, month, year) ? dt : wxInvalidDateTime; -} - -inline wxDateTime wxDateTime::GetLastWeekDay(WeekDay weekday, - Month month, - int year) -{ - wxDateTime dt(*this); - - return dt.SetToLastWeekDay(weekday, month, year) ? dt : wxInvalidDateTime; -} - -inline wxDateTime wxDateTime::GetLastMonthDay(Month month, int year) const -{ - MODIFY_AND_RETURN( SetToLastMonthDay(month, year) ); -} - -inline wxDateTime wxDateTime::GetYearDay(wxDateTime_t yday) const -{ - MODIFY_AND_RETURN( SetToYearDay(yday) ); -} - -// ---------------------------------------------------------------------------- -// wxDateTime comparison -// ---------------------------------------------------------------------------- - -inline bool wxDateTime::IsEqualTo(const wxDateTime& datetime) const -{ - wxASSERT_MSG( IsValid() && datetime.IsValid(), wxT("invalid wxDateTime")); - - return m_time == datetime.m_time; -} - -inline bool wxDateTime::IsEarlierThan(const wxDateTime& datetime) const -{ - wxASSERT_MSG( IsValid() && datetime.IsValid(), wxT("invalid wxDateTime")); - - return m_time < datetime.m_time; -} - -inline bool wxDateTime::IsLaterThan(const wxDateTime& datetime) const -{ - wxASSERT_MSG( IsValid() && datetime.IsValid(), wxT("invalid wxDateTime")); - - return m_time > datetime.m_time; -} - -inline bool wxDateTime::IsStrictlyBetween(const wxDateTime& t1, - const wxDateTime& t2) const -{ - // no need for assert, will be checked by the functions we call - return IsLaterThan(t1) && IsEarlierThan(t2); -} - -inline bool wxDateTime::IsBetween(const wxDateTime& t1, - const wxDateTime& t2) const -{ - // no need for assert, will be checked by the functions we call - return IsEqualTo(t1) || IsEqualTo(t2) || IsStrictlyBetween(t1, t2); -} - -inline bool wxDateTime::IsSameDate(const wxDateTime& dt) const -{ - Tm tm1 = GetTm(), - tm2 = dt.GetTm(); - - return tm1.year == tm2.year && - tm1.mon == tm2.mon && - tm1.mday == tm2.mday; -} - -inline bool wxDateTime::IsSameTime(const wxDateTime& dt) const -{ - // notice that we can't do something like this: - // - // m_time % MILLISECONDS_PER_DAY == dt.m_time % MILLISECONDS_PER_DAY - // - // because we have also to deal with (possibly) different DST settings! - Tm tm1 = GetTm(), - tm2 = dt.GetTm(); - - return tm1.hour == tm2.hour && - tm1.min == tm2.min && - tm1.sec == tm2.sec && - tm1.msec == tm2.msec; -} - -inline bool wxDateTime::IsEqualUpTo(const wxDateTime& dt, - const wxTimeSpan& ts) const -{ - return IsBetween(dt.Subtract(ts), dt.Add(ts)); -} - -// ---------------------------------------------------------------------------- -// wxDateTime arithmetics -// ---------------------------------------------------------------------------- - -inline wxDateTime wxDateTime::Add(const wxTimeSpan& diff) const -{ - wxASSERT_MSG( IsValid(), wxT("invalid wxDateTime")); - - return wxDateTime(m_time + diff.GetValue()); -} - -inline wxDateTime& wxDateTime::Add(const wxTimeSpan& diff) -{ - wxASSERT_MSG( IsValid(), wxT("invalid wxDateTime")); - - m_time += diff.GetValue(); - - return *this; -} - -inline wxDateTime& wxDateTime::operator+=(const wxTimeSpan& diff) -{ - return Add(diff); -} - -inline wxDateTime wxDateTime::Subtract(const wxTimeSpan& diff) const -{ - wxASSERT_MSG( IsValid(), wxT("invalid wxDateTime")); - - return wxDateTime(m_time - diff.GetValue()); -} - -inline wxDateTime& wxDateTime::Subtract(const wxTimeSpan& diff) -{ - wxASSERT_MSG( IsValid(), wxT("invalid wxDateTime")); - - m_time -= diff.GetValue(); - - return *this; -} - -inline wxDateTime& wxDateTime::operator-=(const wxTimeSpan& diff) -{ - return Subtract(diff); -} - -inline wxTimeSpan wxDateTime::Subtract(const wxDateTime& datetime) const -{ - wxASSERT_MSG( IsValid() && datetime.IsValid(), wxT("invalid wxDateTime")); - - return wxTimeSpan(GetValue() - datetime.GetValue()); -} - -inline wxTimeSpan wxDateTime::operator-(const wxDateTime& dt2) const -{ - return this->Subtract(dt2); -} - -inline wxDateTime wxDateTime::Add(const wxDateSpan& diff) const -{ - return wxDateTime(*this).Add(diff); -} - -inline wxDateTime& wxDateTime::Subtract(const wxDateSpan& diff) -{ - return Add(diff.Negate()); -} - -inline wxDateTime wxDateTime::Subtract(const wxDateSpan& diff) const -{ - return wxDateTime(*this).Subtract(diff); -} - -inline wxDateTime& wxDateTime::operator-=(const wxDateSpan& diff) -{ - return Subtract(diff); -} - -inline wxDateTime& wxDateTime::operator+=(const wxDateSpan& diff) -{ - return Add(diff); -} - -// ---------------------------------------------------------------------------- -// wxDateTime and timezones -// ---------------------------------------------------------------------------- - -inline wxDateTime -wxDateTime::ToTimezone(const wxDateTime::TimeZone& tz, bool noDST) const -{ - MODIFY_AND_RETURN( MakeTimezone(tz, noDST) ); -} - -inline wxDateTime -wxDateTime::FromTimezone(const wxDateTime::TimeZone& tz, bool noDST) const -{ - MODIFY_AND_RETURN( MakeFromTimezone(tz, noDST) ); -} - -// ---------------------------------------------------------------------------- -// wxTimeSpan construction -// ---------------------------------------------------------------------------- - -inline wxTimeSpan::wxTimeSpan(long hours, - long minutes, - wxLongLong seconds, - wxLongLong milliseconds) -{ - // assign first to avoid precision loss - m_diff = hours; - m_diff *= 60l; - m_diff += minutes; - m_diff *= 60l; - m_diff += seconds; - m_diff *= 1000l; - m_diff += milliseconds; -} - -// ---------------------------------------------------------------------------- -// wxTimeSpan accessors -// ---------------------------------------------------------------------------- - -inline wxLongLong wxTimeSpan::GetSeconds() const -{ - return m_diff / 1000l; -} - -inline int wxTimeSpan::GetMinutes() const -{ - // explicit cast to int suppresses a warning with CodeWarrior and possibly - // others (changing the return type to long from int is impossible in 2.8) - return (int)((GetSeconds() / 60l).GetLo()); -} - -inline int wxTimeSpan::GetHours() const -{ - return GetMinutes() / 60; -} - -inline int wxTimeSpan::GetDays() const -{ - return GetHours() / 24; -} - -inline int wxTimeSpan::GetWeeks() const -{ - return GetDays() / 7; -} - -// ---------------------------------------------------------------------------- -// wxTimeSpan arithmetics -// ---------------------------------------------------------------------------- - -inline wxTimeSpan wxTimeSpan::Add(const wxTimeSpan& diff) const -{ - return wxTimeSpan(m_diff + diff.GetValue()); -} - -inline wxTimeSpan& wxTimeSpan::Add(const wxTimeSpan& diff) -{ - m_diff += diff.GetValue(); - - return *this; -} - -inline wxTimeSpan wxTimeSpan::Subtract(const wxTimeSpan& diff) const -{ - return wxTimeSpan(m_diff - diff.GetValue()); -} - -inline wxTimeSpan& wxTimeSpan::Subtract(const wxTimeSpan& diff) -{ - m_diff -= diff.GetValue(); - - return *this; -} - -inline wxTimeSpan& wxTimeSpan::Multiply(int n) -{ - m_diff *= (long)n; - - return *this; -} - -inline wxTimeSpan wxTimeSpan::Multiply(int n) const -{ - return wxTimeSpan(m_diff * (long)n); -} - -inline wxTimeSpan wxTimeSpan::Abs() const -{ - return wxTimeSpan(GetValue().Abs()); -} - -inline bool wxTimeSpan::IsEqualTo(const wxTimeSpan& ts) const -{ - return GetValue() == ts.GetValue(); -} - -inline bool wxTimeSpan::IsLongerThan(const wxTimeSpan& ts) const -{ - return GetValue().Abs() > ts.GetValue().Abs(); -} - -// ---------------------------------------------------------------------------- -// wxDateSpan -// ---------------------------------------------------------------------------- - -inline wxDateSpan& wxDateSpan::operator+=(const wxDateSpan& other) -{ - m_years += other.m_years; - m_months += other.m_months; - m_weeks += other.m_weeks; - m_days += other.m_days; - - return *this; -} - -inline wxDateSpan& wxDateSpan::Add(const wxDateSpan& other) -{ - return *this += other; -} - -inline wxDateSpan wxDateSpan::Add(const wxDateSpan& other) const -{ - wxDateSpan ds(*this); - ds.Add(other); - return ds; -} - -inline wxDateSpan& wxDateSpan::Multiply(int factor) -{ - m_years *= factor; - m_months *= factor; - m_weeks *= factor; - m_days *= factor; - - return *this; -} - -inline wxDateSpan wxDateSpan::Multiply(int factor) const -{ - wxDateSpan ds(*this); - ds.Multiply(factor); - return ds; -} - -inline wxDateSpan wxDateSpan::Negate() const -{ - return wxDateSpan(-m_years, -m_months, -m_weeks, -m_days); -} - -inline wxDateSpan& wxDateSpan::Neg() -{ - m_years = -m_years; - m_months = -m_months; - m_weeks = -m_weeks; - m_days = -m_days; - - return *this; -} - -inline wxDateSpan& wxDateSpan::operator-=(const wxDateSpan& other) -{ - return *this += other.Negate(); -} - -inline wxDateSpan& wxDateSpan::Subtract(const wxDateSpan& other) -{ - return *this -= other; -} - -inline wxDateSpan wxDateSpan::Subtract(const wxDateSpan& other) const -{ - wxDateSpan ds(*this); - ds.Subtract(other); - return ds; -} - -#undef MILLISECONDS_PER_DAY - -#undef MODIFY_AND_RETURN - -// ============================================================================ -// binary operators -// ============================================================================ - -// ---------------------------------------------------------------------------- -// wxTimeSpan operators -// ---------------------------------------------------------------------------- - -wxTimeSpan WXDLLIMPEXP_BASE operator*(int n, const wxTimeSpan& ts); - -// ---------------------------------------------------------------------------- -// wxDateSpan -// ---------------------------------------------------------------------------- - -wxDateSpan WXDLLIMPEXP_BASE operator*(int n, const wxDateSpan& ds); - -// ============================================================================ -// other helper functions -// ============================================================================ - -// ---------------------------------------------------------------------------- -// iteration helpers: can be used to write a for loop over enum variable like -// this: -// for ( m = wxDateTime::Jan; m < wxDateTime::Inv_Month; wxNextMonth(m) ) -// ---------------------------------------------------------------------------- - -WXDLLIMPEXP_BASE void wxNextMonth(wxDateTime::Month& m); -WXDLLIMPEXP_BASE void wxPrevMonth(wxDateTime::Month& m); -WXDLLIMPEXP_BASE void wxNextWDay(wxDateTime::WeekDay& wd); -WXDLLIMPEXP_BASE void wxPrevWDay(wxDateTime::WeekDay& wd); - -#endif // wxUSE_DATETIME - -#endif // _WX_DATETIME_H diff --git a/wxWidgets/include/wx/datstrm.h b/wxWidgets/include/wx/datstrm.h deleted file mode 100644 index 709e1007ba..0000000000 --- a/wxWidgets/include/wx/datstrm.h +++ /dev/null @@ -1,170 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: datstrm.h -// Purpose: Data stream classes -// Author: Guilhem Lavaux -// Modified by: Mickael Gilabert -// Created: 28/06/1998 -// RCS-ID: $Id: datstrm.h 38576 2006-04-05 16:10:08Z VZ $ -// Copyright: (c) Guilhem Lavaux -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_DATSTREAM_H_ -#define _WX_DATSTREAM_H_ - -#include "wx/stream.h" -#include "wx/longlong.h" -#include "wx/convauto.h" - -#if wxUSE_STREAMS - -class WXDLLIMPEXP_BASE wxDataInputStream -{ -public: -#if wxUSE_UNICODE - wxDataInputStream(wxInputStream& s, const wxMBConv& conv = wxConvAuto()); -#else - wxDataInputStream(wxInputStream& s); -#endif - ~wxDataInputStream(); - - bool IsOk() { return m_input->IsOk(); } - -#if wxHAS_INT64 - wxUint64 Read64(); -#endif -#if wxUSE_LONGLONG - wxLongLong ReadLL(); -#endif - wxUint32 Read32(); - wxUint16 Read16(); - wxUint8 Read8(); - double ReadDouble(); - wxString ReadString(); - -#if wxHAS_INT64 - void Read64(wxUint64 *buffer, size_t size); - void Read64(wxInt64 *buffer, size_t size); -#endif -#if defined(wxLongLong_t) && wxUSE_LONGLONG - void Read64(wxULongLong *buffer, size_t size); - void Read64(wxLongLong *buffer, size_t size); -#endif -#if wxUSE_LONGLONG - void ReadLL(wxULongLong *buffer, size_t size); - void ReadLL(wxLongLong *buffer, size_t size); -#endif - void Read32(wxUint32 *buffer, size_t size); - void Read16(wxUint16 *buffer, size_t size); - void Read8(wxUint8 *buffer, size_t size); - void ReadDouble(double *buffer, size_t size); - - wxDataInputStream& operator>>(wxString& s); - wxDataInputStream& operator>>(wxInt8& c); - wxDataInputStream& operator>>(wxInt16& i); - wxDataInputStream& operator>>(wxInt32& i); - wxDataInputStream& operator>>(wxUint8& c); - wxDataInputStream& operator>>(wxUint16& i); - wxDataInputStream& operator>>(wxUint32& i); -#if wxHAS_INT64 - wxDataInputStream& operator>>(wxUint64& i); - wxDataInputStream& operator>>(wxInt64& i); -#endif -#if defined(wxLongLong_t) && wxUSE_LONGLONG - wxDataInputStream& operator>>(wxULongLong& i); - wxDataInputStream& operator>>(wxLongLong& i); -#endif - wxDataInputStream& operator>>(double& i); - wxDataInputStream& operator>>(float& f); - - void BigEndianOrdered(bool be_order) { m_be_order = be_order; } - -protected: - wxInputStream *m_input; - bool m_be_order; -#if wxUSE_UNICODE - wxMBConv *m_conv; -#endif - - DECLARE_NO_COPY_CLASS(wxDataInputStream) -}; - -class WXDLLIMPEXP_BASE wxDataOutputStream -{ -public: -#if wxUSE_UNICODE - wxDataOutputStream(wxOutputStream& s, const wxMBConv& conv = wxConvAuto()); -#else - wxDataOutputStream(wxOutputStream& s); -#endif - ~wxDataOutputStream(); - - bool IsOk() { return m_output->IsOk(); } - -#if wxHAS_INT64 - void Write64(wxUint64 i); - void Write64(wxInt64 i); -#endif -#if wxUSE_LONGLONG - void WriteLL(const wxLongLong &ll); - void WriteLL(const wxULongLong &ll); -#endif - void Write32(wxUint32 i); - void Write16(wxUint16 i); - void Write8(wxUint8 i); - void WriteDouble(double d); - void WriteString(const wxString& string); - -#if wxHAS_INT64 - void Write64(const wxUint64 *buffer, size_t size); - void Write64(const wxInt64 *buffer, size_t size); -#endif -#if defined(wxLongLong_t) && wxUSE_LONGLONG - void Write64(const wxULongLong *buffer, size_t size); - void Write64(const wxLongLong *buffer, size_t size); -#endif -#if wxUSE_LONGLONG - void WriteLL(const wxULongLong *buffer, size_t size); - void WriteLL(const wxLongLong *buffer, size_t size); -#endif - void Write32(const wxUint32 *buffer, size_t size); - void Write16(const wxUint16 *buffer, size_t size); - void Write8(const wxUint8 *buffer, size_t size); - void WriteDouble(const double *buffer, size_t size); - - wxDataOutputStream& operator<<(const wxChar *string); - wxDataOutputStream& operator<<(const wxString& string); - wxDataOutputStream& operator<<(wxInt8 c); - wxDataOutputStream& operator<<(wxInt16 i); - wxDataOutputStream& operator<<(wxInt32 i); - wxDataOutputStream& operator<<(wxUint8 c); - wxDataOutputStream& operator<<(wxUint16 i); - wxDataOutputStream& operator<<(wxUint32 i); -#if wxHAS_INT64 - wxDataOutputStream& operator<<(wxUint64 i); - wxDataOutputStream& operator<<(wxInt64 i); -#endif -#if defined(wxLongLong_t) && wxUSE_LONGLONG - wxDataOutputStream& operator<<(const wxULongLong &i); - wxDataOutputStream& operator<<(const wxLongLong &i); -#endif - wxDataOutputStream& operator<<(double f); - wxDataOutputStream& operator<<(float f); - - void BigEndianOrdered(bool be_order) { m_be_order = be_order; } - -protected: - wxOutputStream *m_output; - bool m_be_order; -#if wxUSE_UNICODE - wxMBConv *m_conv; -#endif - - DECLARE_NO_COPY_CLASS(wxDataOutputStream) -}; - -#endif - // wxUSE_STREAMS - -#endif - // _WX_DATSTREAM_H_ diff --git a/wxWidgets/include/wx/db.h b/wxWidgets/include/wx/db.h deleted file mode 100644 index 013bc22760..0000000000 --- a/wxWidgets/include/wx/db.h +++ /dev/null @@ -1,853 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: wx/db.h -// Purpose: Header file wxDb class. The wxDb class represents a connection -// to an ODBC data source. The wxDb class allows operations on the data -// source such as opening and closing the data source. -// Author: Doug Card -// Modified by: George Tasker -// Bart Jourquin -// Mark Johnson, wxWindows@mj10777.de -// Mods: Dec, 1998: -// -Added support for SQL statement logging and database cataloging -// April, 1999 -// -Added QUERY_ONLY mode support to reduce default number of cursors -// -Added additional SQL logging code -// -Added DEBUG-ONLY tracking of Ctable objects to detect orphaned DB connections -// -Set ODBC option to only read committed writes to the DB so all -// databases operate the same in that respect -// -// Created: 9.96 -// RCS-ID: $Id: db.h 56697 2008-11-07 22:45:47Z VZ $ -// Copyright: (c) 1996 Remstar International, Inc. -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_DB_H_ -#define _WX_DB_H_ - - -// BJO 20000503: introduce new GetColumns members which are more database independent and -// return columns in the order they were created -#define OLD_GETCOLUMNS 1 -#define EXPERIMENTAL_WXDB_FUNCTIONS 1 - -#include "wx/defs.h" -#include "wx/string.h" - -#if defined(__VISUALC__) - // we need to include standard Windows headers but we can't include - // directly when using MFC because it includes it itself in a - // different manner - #if wxUSE_MFC - #include - #else // !wxUSE_MFC - #include "wx/msw/wrapwin.h" - #endif // wxUSE_MFC/!wxUSE_MFC - - // If you use the wxDbCreateDataSource() function with MSW/VC6, - // you cannot use the iODBC headers, you must use the VC headers, - // plus the odbcinst.h header - gt Nov 2 2000 - // - // Must add "odbccp32.lib" in \wx2\wxWidgets\src\makevc.env to the WINLIBS= line - // - #include "sql.h" - #include "sqlext.h" - //#if wxUSE_UNICODE - // #include - //#endif - #include "odbcinst.h" -#else - #if defined(__WINDOWS__) && ( defined(HAVE_W32API_H) || defined(__BORLANDC__) || defined (__DMC__)) - #include "wx/msw/wrapwin.h" - #endif - extern "C" { - #if defined(wxUSE_BUILTIN_IODBC) && wxUSE_BUILTIN_IODBC - // Use the ones from the library - #include "wx/isql.h" - #include "wx/isqlext.h" - // Not available in v2.x of iODBC - #ifndef __WXMSW__ - #if wxUSE_UNICODE - typedef wxChar SQLTCHAR; - #else - typedef UCHAR SQLTCHAR; - #endif - #endif - #else // !wxUSE_BUILTIN_IODBC - // SQL headers define BOOL if it's not defined yet but BOOL is also - // defined in many other places on other systems (Motif, at least on - // OpenVMS; Cocoa and X11) so prevent the problem by defining it before - // including these headers - #ifndef BOOL - #define BOOL int - #include - #include - #undef BOOL - #else - #include - #include - #endif - #endif // wxUSE_BUILTIN_IODBC/!wxUSE_BUILTIN_IODBC - } -#endif - -#if wxUSE_UNICODE -#define SQL_C_WXCHAR SQL_C_WCHAR -#else -#define SQL_C_WXCHAR SQL_C_CHAR -#endif - -#ifdef __DIGITALMARS__ -#if wxUSE_UNICODE -typedef wxChar SQLTCHAR; -#else -typedef UCHAR SQLTCHAR; -#endif -#endif - -typedef float SFLOAT; -typedef double SDOUBLE; -typedef unsigned int UINT; -#define ULONG UDWORD - -#ifndef wxODBC_FWD_ONLY_CURSORS -#define wxODBC_FWD_ONLY_CURSORS 1 -#endif - -enum enumDummy {enumDum1}; - -#ifndef SQL_C_BOOLEAN - #define SQL_C_BOOLEAN(datatype) (sizeof(datatype) == 1 ? SQL_C_UTINYINT : (sizeof(datatype) == 2 ? SQL_C_USHORT : SQL_C_ULONG)) -#endif - -#ifndef SQL_C_ENUM - #define SQL_C_ENUM (sizeof(enumDummy) == 2 ? SQL_C_USHORT : SQL_C_ULONG) -#endif - -// NOTE: If SQL_C_BLOB is defined, and it is not SQL_C_BINARY, iODBC 2.x -// may not function correctly. Likely best to use SQL_C_BINARY direct -#ifndef SQL_C_BLOB - #ifdef SQL_C_BINARY - #define SQL_C_BLOB SQL_C_BINARY - #endif -#endif - -#ifndef _WIN64 -#ifndef SQLLEN -#define SQLLEN SQLINTEGER -#endif -#ifndef SQLULEN -#define SQLULEN SQLUINTEGER -#endif -#endif - -const int wxDB_PATH_MAX = 254; - -extern WXDLLIMPEXP_DATA_ODBC(wxChar const *) SQL_LOG_FILENAME; -extern WXDLLIMPEXP_DATA_ODBC(wxChar const *) SQL_CATALOG_FILENAME; - -// Database Globals -const int DB_TYPE_NAME_LEN = 40; -const int DB_MAX_STATEMENT_LEN = 4096; -const int DB_MAX_WHERE_CLAUSE_LEN = 2048; -const int DB_MAX_ERROR_MSG_LEN = 512; -const int DB_MAX_ERROR_HISTORY = 5; -const int DB_MAX_TABLE_NAME_LEN = 128; -const int DB_MAX_COLUMN_NAME_LEN = 128; - -const int DB_DATA_TYPE_VARCHAR = 1; -const int DB_DATA_TYPE_INTEGER = 2; -const int DB_DATA_TYPE_FLOAT = 3; -const int DB_DATA_TYPE_DATE = 4; -const int DB_DATA_TYPE_BLOB = 5; -const int DB_DATA_TYPE_MEMO = 6; - -const int DB_SELECT_KEYFIELDS = 1; -const int DB_SELECT_WHERE = 2; -const int DB_SELECT_MATCHING = 3; -const int DB_SELECT_STATEMENT = 4; - -const int DB_UPD_KEYFIELDS = 1; -const int DB_UPD_WHERE = 2; - -const int DB_DEL_KEYFIELDS = 1; -const int DB_DEL_WHERE = 2; -const int DB_DEL_MATCHING = 3; - -const int DB_WHERE_KEYFIELDS = 1; -const int DB_WHERE_MATCHING = 2; - -const int DB_GRANT_SELECT = 1; -const int DB_GRANT_INSERT = 2; -const int DB_GRANT_UPDATE = 4; -const int DB_GRANT_DELETE = 8; -const int DB_GRANT_ALL = DB_GRANT_SELECT | DB_GRANT_INSERT | DB_GRANT_UPDATE | DB_GRANT_DELETE; - -// ODBC Error codes (derived from ODBC SqlState codes) -enum wxODBC_ERRORS -{ - DB_FAILURE = 0, - DB_SUCCESS = 1, - DB_ERR_NOT_IN_USE, - DB_ERR_GENERAL_WARNING, // SqlState = '01000' - DB_ERR_DISCONNECT_ERROR, // SqlState = '01002' - DB_ERR_DATA_TRUNCATED, // SqlState = '01004' - DB_ERR_PRIV_NOT_REVOKED, // SqlState = '01006' - DB_ERR_INVALID_CONN_STR_ATTR, // SqlState = '01S00' - DB_ERR_ERROR_IN_ROW, // SqlState = '01S01' - DB_ERR_OPTION_VALUE_CHANGED, // SqlState = '01S02' - DB_ERR_NO_ROWS_UPD_OR_DEL, // SqlState = '01S03' - DB_ERR_MULTI_ROWS_UPD_OR_DEL, // SqlState = '01S04' - DB_ERR_WRONG_NO_OF_PARAMS, // SqlState = '07001' - DB_ERR_DATA_TYPE_ATTR_VIOL, // SqlState = '07006' - DB_ERR_UNABLE_TO_CONNECT, // SqlState = '08001' - DB_ERR_CONNECTION_IN_USE, // SqlState = '08002' - DB_ERR_CONNECTION_NOT_OPEN, // SqlState = '08003' - DB_ERR_REJECTED_CONNECTION, // SqlState = '08004' - DB_ERR_CONN_FAIL_IN_TRANS, // SqlState = '08007' - DB_ERR_COMM_LINK_FAILURE, // SqlState = '08S01' - DB_ERR_INSERT_VALUE_LIST_MISMATCH, // SqlState = '21S01' - DB_ERR_DERIVED_TABLE_MISMATCH, // SqlState = '21S02' - DB_ERR_STRING_RIGHT_TRUNC, // SqlState = '22001' - DB_ERR_NUMERIC_VALUE_OUT_OF_RNG, // SqlState = '22003' - DB_ERR_ERROR_IN_ASSIGNMENT, // SqlState = '22005' - DB_ERR_DATETIME_FLD_OVERFLOW, // SqlState = '22008' - DB_ERR_DIVIDE_BY_ZERO, // SqlState = '22012' - DB_ERR_STR_DATA_LENGTH_MISMATCH, // SqlState = '22026' - DB_ERR_INTEGRITY_CONSTRAINT_VIOL, // SqlState = '23000' - DB_ERR_INVALID_CURSOR_STATE, // SqlState = '24000' - DB_ERR_INVALID_TRANS_STATE, // SqlState = '25000' - DB_ERR_INVALID_AUTH_SPEC, // SqlState = '28000' - DB_ERR_INVALID_CURSOR_NAME, // SqlState = '34000' - DB_ERR_SYNTAX_ERROR_OR_ACCESS_VIOL, // SqlState = '37000' - DB_ERR_DUPLICATE_CURSOR_NAME, // SqlState = '3C000' - DB_ERR_SERIALIZATION_FAILURE, // SqlState = '40001' - DB_ERR_SYNTAX_ERROR_OR_ACCESS_VIOL2, // SqlState = '42000' - DB_ERR_OPERATION_ABORTED, // SqlState = '70100' - DB_ERR_UNSUPPORTED_FUNCTION, // SqlState = 'IM001' - DB_ERR_NO_DATA_SOURCE, // SqlState = 'IM002' - DB_ERR_DRIVER_LOAD_ERROR, // SqlState = 'IM003' - DB_ERR_SQLALLOCENV_FAILED, // SqlState = 'IM004' - DB_ERR_SQLALLOCCONNECT_FAILED, // SqlState = 'IM005' - DB_ERR_SQLSETCONNECTOPTION_FAILED, // SqlState = 'IM006' - DB_ERR_NO_DATA_SOURCE_DLG_PROHIB, // SqlState = 'IM007' - DB_ERR_DIALOG_FAILED, // SqlState = 'IM008' - DB_ERR_UNABLE_TO_LOAD_TRANSLATION_DLL, // SqlState = 'IM009' - DB_ERR_DATA_SOURCE_NAME_TOO_LONG, // SqlState = 'IM010' - DB_ERR_DRIVER_NAME_TOO_LONG, // SqlState = 'IM011' - DB_ERR_DRIVER_KEYWORD_SYNTAX_ERROR, // SqlState = 'IM012' - DB_ERR_TRACE_FILE_ERROR, // SqlState = 'IM013' - DB_ERR_TABLE_OR_VIEW_ALREADY_EXISTS, // SqlState = 'S0001' - DB_ERR_TABLE_NOT_FOUND, // SqlState = 'S0002' - DB_ERR_INDEX_ALREADY_EXISTS, // SqlState = 'S0011' - DB_ERR_INDEX_NOT_FOUND, // SqlState = 'S0012' - DB_ERR_COLUMN_ALREADY_EXISTS, // SqlState = 'S0021' - DB_ERR_COLUMN_NOT_FOUND, // SqlState = 'S0022' - DB_ERR_NO_DEFAULT_FOR_COLUMN, // SqlState = 'S0023' - DB_ERR_GENERAL_ERROR, // SqlState = 'S1000' - DB_ERR_MEMORY_ALLOCATION_FAILURE, // SqlState = 'S1001' - DB_ERR_INVALID_COLUMN_NUMBER, // SqlState = 'S1002' - DB_ERR_PROGRAM_TYPE_OUT_OF_RANGE, // SqlState = 'S1003' - DB_ERR_SQL_DATA_TYPE_OUT_OF_RANGE, // SqlState = 'S1004' - DB_ERR_OPERATION_CANCELLED, // SqlState = 'S1008' - DB_ERR_INVALID_ARGUMENT_VALUE, // SqlState = 'S1009' - DB_ERR_FUNCTION_SEQUENCE_ERROR, // SqlState = 'S1010' - DB_ERR_OPERATION_INVALID_AT_THIS_TIME, // SqlState = 'S1011' - DB_ERR_INVALID_TRANS_OPERATION_CODE, // SqlState = 'S1012' - DB_ERR_NO_CURSOR_NAME_AVAIL, // SqlState = 'S1015' - DB_ERR_INVALID_STR_OR_BUF_LEN, // SqlState = 'S1090' - DB_ERR_DESCRIPTOR_TYPE_OUT_OF_RANGE, // SqlState = 'S1091' - DB_ERR_OPTION_TYPE_OUT_OF_RANGE, // SqlState = 'S1092' - DB_ERR_INVALID_PARAM_NO, // SqlState = 'S1093' - DB_ERR_INVALID_SCALE_VALUE, // SqlState = 'S1094' - DB_ERR_FUNCTION_TYPE_OUT_OF_RANGE, // SqlState = 'S1095' - DB_ERR_INF_TYPE_OUT_OF_RANGE, // SqlState = 'S1096' - DB_ERR_COLUMN_TYPE_OUT_OF_RANGE, // SqlState = 'S1097' - DB_ERR_SCOPE_TYPE_OUT_OF_RANGE, // SqlState = 'S1098' - DB_ERR_NULLABLE_TYPE_OUT_OF_RANGE, // SqlState = 'S1099' - DB_ERR_UNIQUENESS_OPTION_TYPE_OUT_OF_RANGE, // SqlState = 'S1100' - DB_ERR_ACCURACY_OPTION_TYPE_OUT_OF_RANGE, // SqlState = 'S1101' - DB_ERR_DIRECTION_OPTION_OUT_OF_RANGE, // SqlState = 'S1103' - DB_ERR_INVALID_PRECISION_VALUE, // SqlState = 'S1104' - DB_ERR_INVALID_PARAM_TYPE, // SqlState = 'S1105' - DB_ERR_FETCH_TYPE_OUT_OF_RANGE, // SqlState = 'S1106' - DB_ERR_ROW_VALUE_OUT_OF_RANGE, // SqlState = 'S1107' - DB_ERR_CONCURRENCY_OPTION_OUT_OF_RANGE, // SqlState = 'S1108' - DB_ERR_INVALID_CURSOR_POSITION, // SqlState = 'S1109' - DB_ERR_INVALID_DRIVER_COMPLETION, // SqlState = 'S1110' - DB_ERR_INVALID_BOOKMARK_VALUE, // SqlState = 'S1111' - DB_ERR_DRIVER_NOT_CAPABLE, // SqlState = 'S1C00' - DB_ERR_TIMEOUT_EXPIRED // SqlState = 'S1T00' -}; - -#ifndef MAXNAME - #define MAXNAME 31 -#endif - -#ifndef SQL_MAX_AUTHSTR_LEN - // There does not seem to be a standard for this, so I am - // defaulting to the value that MS uses - #define SQL_MAX_AUTHSTR_LEN MAXNAME -#endif - -#ifndef SQL_MAX_CONNECTSTR_LEN - // There does not seem to be a standard for this, so I am - // defaulting to the value that MS recommends - #define SQL_MAX_CONNECTSTR_LEN 1024 -#endif - - -class WXDLLIMPEXP_ODBC wxDbConnectInf -{ - private: - bool freeHenvOnDestroy; - bool useConnectionStr; - - public: - HENV Henv; - wxChar Dsn[SQL_MAX_DSN_LENGTH+1]; // Data Source Name - wxChar Uid[SQL_MAX_USER_NAME_LEN+1]; // User ID - wxChar AuthStr[SQL_MAX_AUTHSTR_LEN+1]; // Authorization string (password) - wxChar ConnectionStr[SQL_MAX_CONNECTSTR_LEN+1]; // Connection string (password) - - wxString Description; // Not sure what the max length is - wxString FileType; // Not sure what the max length is - - // Optionals needed for some databases like dBase - wxString DefaultDir; // Directory that db file resides in - - public: - - wxDbConnectInf(); - wxDbConnectInf(HENV henv, const wxString &dsn, const wxString &userID=wxEmptyString, - const wxString &password=wxEmptyString, const wxString &defaultDir=wxEmptyString, - const wxString &description=wxEmptyString, const wxString &fileType=wxEmptyString); - - ~wxDbConnectInf(); - - bool Initialize(); - - bool AllocHenv(); - void FreeHenv(); - - // Accessors - const HENV &GetHenv() { return Henv; } - - const wxChar *GetDsn() { return Dsn; } - - const wxChar *GetUid() { return Uid; } - const wxChar *GetUserID() { return Uid; } - - const wxChar *GetAuthStr() { return AuthStr; } - const wxChar *GetPassword() { return AuthStr; } - - const wxChar *GetConnectionStr() { return ConnectionStr; } - bool UseConnectionStr() { return useConnectionStr; } - - const wxChar *GetDescription() { return Description; } - const wxChar *GetFileType() { return FileType; } - const wxChar *GetDefaultDir() { return DefaultDir; } - - void SetHenv(const HENV henv) { Henv = henv; } - - void SetDsn(const wxString &dsn); - - void SetUserID(const wxString &userID); - void SetUid(const wxString &uid) { SetUserID(uid); } - - void SetPassword(const wxString &password); - void SetAuthStr(const wxString &authstr) { SetPassword(authstr); } - - void SetConnectionStr(const wxString &connectStr); - - void SetDescription(const wxString &desc) { Description = desc; } - void SetFileType(const wxString &fileType) { FileType = fileType; } - void SetDefaultDir(const wxString &defDir) { DefaultDir = defDir; } -}; // class wxDbConnectInf - - -struct WXDLLIMPEXP_ODBC wxDbSqlTypeInfo -{ - wxString TypeName; - SWORD FsqlType; - long Precision; - short CaseSensitive; - short MaximumScale; -}; - - -class WXDLLIMPEXP_ODBC wxDbColFor -{ -public: - wxString s_Field; // Formatted String for Output - wxString s_Format[7]; // Formatted Objects - TIMESTAMP has the biggest (7) - wxString s_Amount[7]; // Formatted Objects - amount of things that can be formatted - int i_Amount[7]; // Formatted Objects - TT MM YYYY HH MM SS m - int i_Nation; // 0 = timestamp , 1=EU, 2=UK, 3=International, 4=US - int i_dbDataType; // conversion of the 'sqlDataType' to the generic data type used by these classes - SWORD i_sqlDataType; - - wxDbColFor(); - ~wxDbColFor(){} - - void Initialize(); - int Format(int Nation, int dbDataType, SWORD sqlDataType, short columnLength, short decimalDigits); -}; - - -class WXDLLIMPEXP_ODBC wxDbColInf -{ -public: - wxChar catalog[128+1]; - wxChar schema[128+1]; - wxChar tableName[DB_MAX_TABLE_NAME_LEN+1]; - wxChar colName[DB_MAX_COLUMN_NAME_LEN+1]; - SWORD sqlDataType; - wxChar typeName[128+1]; - SWORD columnLength; - SWORD bufferSize; - short decimalDigits; - short numPrecRadix; - short nullable; - wxChar remarks[254+1]; - int dbDataType; // conversion of the 'sqlDataType' to the generic data type used by these classes - // mj10777.19991224 : new - int PkCol; // Primary key column 0=No; 1= First Key, 2 = Second Key etc. - wxChar PkTableName[DB_MAX_TABLE_NAME_LEN+1]; // Tables that use this PKey as a FKey - int FkCol; // Foreign key column 0=No; 1= First Key, 2 = Second Key etc. - wxChar FkTableName[DB_MAX_TABLE_NAME_LEN+1]; // Foreign key table name - wxDbColFor *pColFor; // How should this columns be formatted - - wxDbColInf(); - ~wxDbColInf(); - - bool Initialize(); -}; - - -class WXDLLIMPEXP_ODBC wxDbTableInf // Description of a Table -{ -public: - wxChar tableName[DB_MAX_TABLE_NAME_LEN+1]; - wxChar tableType[254+1]; // "TABLE" or "SYSTEM TABLE" etc. - wxChar tableRemarks[254+1]; - UWORD numCols; // How many Columns does this Table have: GetColumnCount(..); - wxDbColInf *pColInf; // pColInf = NULL ; User can later call GetColumns(..); - - wxDbTableInf(); - ~wxDbTableInf(); - - bool Initialize(); -}; - - -class WXDLLIMPEXP_ODBC wxDbInf // Description of a Database -{ -public: - wxChar catalog[128+1]; - wxChar schema[128+1]; - int numTables; // How many tables does this database have - wxDbTableInf *pTableInf; // pTableInf = new wxDbTableInf[numTables]; - - wxDbInf(); - ~wxDbInf(); - - bool Initialize(); -}; - - -enum wxDbSqlLogState -{ - sqlLogOFF, - sqlLogON -}; - -// These are the databases currently tested and working with these classes -// See the comments in wxDb::Dbms() for exceptions/issues with -// each of these database engines -enum wxDBMS -{ - dbmsUNIDENTIFIED, - dbmsORACLE, - dbmsSYBASE_ASA, // Adaptive Server Anywhere - dbmsSYBASE_ASE, // Adaptive Server Enterprise - dbmsMS_SQL_SERVER, - dbmsMY_SQL, - dbmsPOSTGRES, - dbmsACCESS, - dbmsDBASE, - dbmsINFORMIX, - dbmsVIRTUOSO, - dbmsDB2, - dbmsINTERBASE, - dbmsPERVASIVE_SQL, - dbmsXBASE_SEQUITER, - dbmsFIREBIRD, - dbmsMAXDB, - dbmsFuture1, - dbmsFuture2, - dbmsFuture3, - dbmsFuture4, - dbmsFuture5, - dbmsFuture6, - dbmsFuture7, - dbmsFuture8, - dbmsFuture9, - dbmsFuture10 -}; - - -// The wxDb::errorList is copied to this variable when the wxDb object -// is closed. This way, the error list is still available after the -// database object is closed. This is necessary if the database -// connection fails so the calling application can show the operator -// why the connection failed. Note: as each wxDb object is closed, it -// will overwrite the errors of the previously destroyed wxDb object in -// this variable. - -extern WXDLLIMPEXP_DATA_ODBC(wxChar) - DBerrorList[DB_MAX_ERROR_HISTORY][DB_MAX_ERROR_MSG_LEN+1]; - - -class WXDLLIMPEXP_ODBC wxDb -{ -private: - bool dbIsOpen; - bool dbIsCached; // Was connection created by caching functions - bool dbOpenedWithConnectionString; // Was the database connection opened with a connection string - wxString dsn; // Data source name - wxString uid; // User ID - wxString authStr; // Authorization string (password) - wxString inConnectionStr; // Connection string used to connect to the database - wxString outConnectionStr;// Connection string returned by the database when a connection is successfully opened - FILE *fpSqlLog; // Sql Log file pointer - wxDbSqlLogState sqlLogState; // On or Off - bool fwdOnlyCursors; - wxDBMS dbmsType; // Type of datasource - i.e. Oracle, dBase, SQLServer, etc - - // Private member functions - bool getDbInfo(bool failOnDataTypeUnsupported=true); - bool getDataTypeInfo(SWORD fSqlType, wxDbSqlTypeInfo &structSQLTypeInfo); - bool setConnectionOptions(void); - void logError(const wxString &errMsg, const wxString &SQLState); - const wxChar *convertUserID(const wxChar *userID, wxString &UserID); - bool determineDataTypes(bool failOnDataTypeUnsupported); - void initialize(); - bool open(bool failOnDataTypeUnsupported=true); - -#if !wxODBC_BACKWARD_COMPATABILITY - // ODBC handles - HENV henv; // ODBC Environment handle - HDBC hdbc; // ODBC DB Connection handle - HSTMT hstmt; // ODBC Statement handle - - //Error reporting mode - bool silent; - - // Number of Ctable objects connected to this db object. FOR INTERNAL USE ONLY!!! - unsigned int nTables; - - // Information about logical data types VARCHAR, INTEGER, FLOAT and DATE. - // - // This information is obtained from the ODBC driver by use of the - // SQLGetTypeInfo() function. The key piece of information is the - // type name the data source uses for each logical data type. - // e.g. VARCHAR; Oracle calls it VARCHAR2. - wxDbSqlTypeInfo typeInfVarchar; - wxDbSqlTypeInfo typeInfInteger; - wxDbSqlTypeInfo typeInfFloat; - wxDbSqlTypeInfo typeInfDate; - wxDbSqlTypeInfo typeInfBlob; - wxDbSqlTypeInfo typeInfMemo; -#endif - -public: - - void setCached(bool cached) { dbIsCached = cached; } // This function must only be called by wxDbGetConnection() and wxDbCloseConnections!!! - bool IsCached() { return dbIsCached; } - - bool GetDataTypeInfo(SWORD fSqlType, wxDbSqlTypeInfo &structSQLTypeInfo) - { return getDataTypeInfo(fSqlType, structSQLTypeInfo); } - -#if wxODBC_BACKWARD_COMPATABILITY - // ODBC handles - HENV henv; // ODBC Environment handle - HDBC hdbc; // ODBC DB Connection handle - HSTMT hstmt; // ODBC Statement handle - - //Error reporting mode - bool silent; - - // Number of Ctable objects connected to this db object. FOR INTERNAL USE ONLY!!! - unsigned int nTables; -#endif - - // The following structure contains database information gathered from the - // datasource when the datasource is first opened. - struct - { - wxChar dbmsName[40]; // Name of the dbms product - wxChar dbmsVer[64]; // Version # of the dbms product - wxChar driverName[40]; // Driver name - wxChar odbcVer[60]; // ODBC version of the driver - wxChar drvMgrOdbcVer[60]; // ODBC version of the driver manager - wxChar driverVer[60]; // Driver version - wxChar serverName[80]; // Server Name, typically a connect string - wxChar databaseName[128]; // Database filename - wxChar outerJoins[2]; // Indicates whether the data source supports outer joins - wxChar procedureSupport[2]; // Indicates whether the data source supports stored procedures - wxChar accessibleTables[2]; // Indicates whether the data source only reports accessible tables in SQLTables. - UWORD maxConnections; // Maximum # of connections the data source supports - UWORD maxStmts; // Maximum # of HSTMTs per HDBC - UWORD apiConfLvl; // ODBC API conformance level - UWORD cliConfLvl; // Indicates whether the data source is SAG compliant - UWORD sqlConfLvl; // SQL conformance level - UWORD cursorCommitBehavior; // Indicates how cursors are affected by a db commit - UWORD cursorRollbackBehavior; // Indicates how cursors are affected by a db rollback - UWORD supportNotNullClause; // Indicates if data source supports NOT NULL clause - wxChar supportIEF[2]; // Integrity Enhancement Facility (Referential Integrity) - UDWORD txnIsolation; // Default transaction isolation level supported by the driver - UDWORD txnIsolationOptions; // Transaction isolation level options available - UDWORD fetchDirections; // Fetch directions supported - UDWORD lockTypes; // Lock types supported in SQLSetPos - UDWORD posOperations; // Position operations supported in SQLSetPos - UDWORD posStmts; // Position statements supported - UDWORD scrollConcurrency; // Concurrency control options supported for scrollable cursors - UDWORD scrollOptions; // Scroll Options supported for scrollable cursors - UDWORD staticSensitivity; // Indicates if additions, deletions and updates can be detected - UWORD txnCapable; // Indicates if the data source supports transactions - UDWORD loginTimeout; // Number seconds to wait for a login request - } dbInf; - - // ODBC Error Inf. - SWORD cbErrorMsg; - int DB_STATUS; -#ifdef __VMS - // The DECC compiler chokes when in db.cpp the array is accessed outside - // its bounds. Maybe this change should also applied for other platforms. - wxChar errorList[DB_MAX_ERROR_HISTORY][DB_MAX_ERROR_MSG_LEN+1]; -#else - wxChar errorList[DB_MAX_ERROR_HISTORY][DB_MAX_ERROR_MSG_LEN]; -#endif - wxChar errorMsg[SQL_MAX_MESSAGE_LENGTH]; - SQLINTEGER nativeError; - wxChar sqlState[20]; - -#if wxODBC_BACKWARD_COMPATABILITY - // Information about logical data types VARCHAR, INTEGER, FLOAT and DATE. - // - // This information is obtained from the ODBC driver by use of the - // SQLGetTypeInfo() function. The key piece of information is the - // type name the data source uses for each logical data type. - // e.g. VARCHAR; Oracle calls it VARCHAR2. - wxDbSqlTypeInfo typeInfVarchar; - wxDbSqlTypeInfo typeInfInteger; - wxDbSqlTypeInfo typeInfFloat; - wxDbSqlTypeInfo typeInfDate; - wxDbSqlTypeInfo typeInfBlob; -#endif - - // Public member functions - wxDb(const HENV &aHenv, bool FwdOnlyCursors=(bool)wxODBC_FWD_ONLY_CURSORS); - ~wxDb(); - - // Data Source Name, User ID, Password and whether open should fail on data type not supported - bool Open(const wxString& inConnectStr, bool failOnDataTypeUnsupported=true); - ///This version of Open will open the odbc source selection dialog. Cast a wxWindow::GetHandle() to SQLHWND to use. - bool Open(const wxString& inConnectStr, SQLHWND parentWnd, bool failOnDataTypeUnsupported=true); - bool Open(const wxString &Dsn, const wxString &Uid, const wxString &AuthStr, bool failOnDataTypeUnsupported=true); - bool Open(wxDbConnectInf *dbConnectInf, bool failOnDataTypeUnsupported=true); - bool Open(wxDb *copyDb); // pointer to a wxDb whose connection info should be copied rather than re-queried - void Close(void); - bool CommitTrans(void); - bool RollbackTrans(void); - bool DispAllErrors(HENV aHenv, HDBC aHdbc = SQL_NULL_HDBC, HSTMT aHstmt = SQL_NULL_HSTMT); - bool GetNextError(HENV aHenv, HDBC aHdbc = SQL_NULL_HDBC, HSTMT aHstmt = SQL_NULL_HSTMT); - void DispNextError(void); - bool CreateView(const wxString &viewName, const wxString &colList, const wxString &pSqlStmt, bool attemptDrop=true); - bool DropView(const wxString &viewName); - bool ExecSql(const wxString &pSqlStmt); - bool ExecSql(const wxString &pSqlStmt, wxDbColInf** columns, short& numcols); - bool GetNext(void); - bool GetData(UWORD colNo, SWORD cType, PTR pData, SDWORD maxLen, SQLLEN FAR *cbReturned); - bool Grant(int privileges, const wxString &tableName, const wxString &userList = wxT("PUBLIC")); - int TranslateSqlState(const wxString &SQLState); - wxDbInf *GetCatalog(const wxChar *userID=NULL); - bool Catalog(const wxChar *userID=NULL, const wxString &fileName=SQL_CATALOG_FILENAME); - int GetKeyFields(const wxString &tableName, wxDbColInf* colInf, UWORD noCols); - - wxDbColInf *GetColumns(wxChar *tableName[], const wxChar *userID=NULL); - wxDbColInf *GetColumns(const wxString &tableName, UWORD *numCols, const wxChar *userID=NULL); - - int GetColumnCount(const wxString &tableName, const wxChar *userID=NULL); - const wxChar *GetDatabaseName(void) {return dbInf.dbmsName;} - const wxString &GetDataSource(void) {return dsn;} - const wxString &GetDatasourceName(void){return dsn;} - const wxString &GetUsername(void) {return uid;} - const wxString &GetPassword(void) {return authStr;} - const wxString &GetConnectionInStr(void) {return inConnectionStr;} - const wxString &GetConnectionOutStr(void) {return outConnectionStr;} - bool IsOpen(void) {return dbIsOpen;} - bool OpenedWithConnectionString(void) {return dbOpenedWithConnectionString;} - HENV GetHENV(void) {return henv;} - HDBC GetHDBC(void) {return hdbc;} - HSTMT GetHSTMT(void) {return hstmt;} - int GetTableCount() {return nTables;} // number of tables using this connection - wxDbSqlTypeInfo GetTypeInfVarchar() {return typeInfVarchar;} - wxDbSqlTypeInfo GetTypeInfInteger() {return typeInfInteger;} - wxDbSqlTypeInfo GetTypeInfFloat() {return typeInfFloat;} - wxDbSqlTypeInfo GetTypeInfDate() {return typeInfDate;} - wxDbSqlTypeInfo GetTypeInfBlob() {return typeInfBlob;} - wxDbSqlTypeInfo GetTypeInfMemo() {return typeInfMemo;} - - // tableName can refer to a table, view, alias or synonym - bool TableExists(const wxString &tableName, const wxChar *userID=NULL, - const wxString &tablePath=wxEmptyString); - bool TablePrivileges(const wxString &tableName, const wxString &priv, - const wxChar *userID=NULL, const wxChar *schema=NULL, - const wxString &path=wxEmptyString); - - // These two functions return the table name or column name in a form ready - // for use in SQL statements. For example, if the datasource allows spaces - // in the table name or column name, the returned string will have the - // correct enclosing marks around the name to allow it to be properly - // included in a SQL statement - const wxString SQLTableName(const wxChar *tableName); - const wxString SQLColumnName(const wxChar *colName); - - void LogError(const wxString &errMsg, const wxString &SQLState = wxEmptyString) - { logError(errMsg, SQLState); } - void SetDebugErrorMessages(bool state) { silent = !state; } - bool SetSqlLogging(wxDbSqlLogState state, const wxString &filename = SQL_LOG_FILENAME, - bool append = false); - bool WriteSqlLog(const wxString &logMsg); - - wxDBMS Dbms(void); - bool ModifyColumn(const wxString &tableName, const wxString &columnName, - int dataType, ULONG columnLength=0, - const wxString &optionalParam=wxEmptyString); - - bool FwdOnlyCursors(void) {return fwdOnlyCursors;} - - // return the string with all special SQL characters escaped - wxString EscapeSqlChars(const wxString& value); - - // These two functions are provided strictly for use by wxDbTable. - // DO NOT USE THESE FUNCTIONS, OR MEMORY LEAKS MAY OCCUR - void incrementTableCount() { nTables++; return; } - void decrementTableCount() { nTables--; return; } - -}; // wxDb - - -// This structure forms a node in a linked list. The linked list of "DbList" objects -// keeps track of allocated database connections. This allows the application to -// open more than one database connection through ODBC for multiple transaction support -// or for multiple database support. -struct wxDbList -{ - wxDbList *PtrPrev; // Pointer to previous item in the list - wxString Dsn; // Data Source Name - wxString Uid; // User ID - wxString AuthStr; // Authorization string (password) - wxString ConnectionStr; // Connection string used instead of DSN - wxDb *PtrDb; // Pointer to the wxDb object - bool Free; // Is item free or in use? - wxDbList *PtrNext; // Pointer to next item in the list -}; - - -#ifdef __WXDEBUG__ -#include "wx/object.h" -class wxTablesInUse : public wxObject -{ - public: - const wxChar *tableName; - ULONG tableID; - class wxDb *pDb; -}; // wxTablesInUse -#endif - - -// The following routines allow a user to get new database connections, free them -// for other code segments to use, or close all of them when the application has -// completed. -wxDb WXDLLIMPEXP_ODBC *wxDbGetConnection(wxDbConnectInf *pDbConfig, bool FwdOnlyCursors=(bool)wxODBC_FWD_ONLY_CURSORS); -bool WXDLLIMPEXP_ODBC wxDbFreeConnection(wxDb *pDb); -void WXDLLIMPEXP_ODBC wxDbCloseConnections(void); -int WXDLLIMPEXP_ODBC wxDbConnectionsInUse(void); - - -// Writes a message to the wxLog window (stdout usually) when an internal error -// situation occurs. This function only works in DEBUG builds -const wxChar WXDLLIMPEXP_ODBC * -wxDbLogExtendedErrorMsg(const wxChar *userText, - wxDb *pDb, - const wxChar *ErrFile, - int ErrLine); - - -// This function sets the sql log state for all open wxDb objects -bool WXDLLIMPEXP_ODBC -wxDbSqlLog(wxDbSqlLogState state, const wxString &filename = SQL_LOG_FILENAME); - - -#if 0 -// MSW/VC6 ONLY!!! Experimental -int WXDLLEXPORT wxDbCreateDataSource(const wxString &driverName, const wxString &dsn, const wxString &description=wxEmptyString, - bool sysDSN=false, const wxString &defDir=wxEmptyString, wxWindow *parent=NULL); -#endif - -// This routine allows you to query a driver manager -// for a list of available datasources. Call this routine -// the first time using SQL_FETCH_FIRST. Continue to call it -// using SQL_FETCH_NEXT until you've exhausted the list. -bool WXDLLIMPEXP_ODBC -wxDbGetDataSource(HENV henv, wxChar *Dsn, SWORD DsnMaxLength, wxChar *DsDesc, - SWORD DsDescMaxLength, UWORD direction = SQL_FETCH_NEXT); - - -// Change this to 0 to remove use of all deprecated functions -#if wxODBC_BACKWARD_COMPATABILITY -//################################################################################# -//############### DEPRECATED functions for backward compatibility ################# -//################################################################################# - -// Backward compability structures/classes. This will eventually go away -const int DB_PATH_MAX = wxDB_PATH_MAX; - -typedef wxDb wxDB; -typedef wxDbTableInf wxTableInf; -typedef wxDbColInf wxColInf; -typedef wxDbColInf CcolInf; -typedef wxDbColFor wxColFor; -typedef wxDbSqlTypeInfo SqlTypeInfo; -typedef wxDbSqlTypeInfo wxSqlTypeInfo; -typedef enum wxDbSqlLogState sqlLog; -typedef enum wxDbSqlLogState wxSqlLogState; -typedef enum wxDBMS dbms; -typedef enum wxDBMS DBMS; -typedef wxODBC_ERRORS ODBC_ERRORS; -typedef wxDbConnectInf DbStuff; -typedef wxDbList DbList; -#ifdef __WXDEBUG__ -typedef wxTablesInUse CstructTablesInUse; -#endif - -// Deprecated function names that are replaced by the function names listed above -wxDB WXDLLIMPEXP_ODBC -*GetDbConnection(DbStuff *pDbStuff, bool FwdOnlyCursors=(bool)wxODBC_FWD_ONLY_CURSORS); -bool WXDLLIMPEXP_ODBC FreeDbConnection(wxDB *pDb); -void WXDLLIMPEXP_ODBC CloseDbConnections(void); -int WXDLLIMPEXP_ODBC NumberDbConnectionsInUse(void); - -bool SqlLog(sqlLog state, const wxChar *filename = SQL_LOG_FILENAME); - -bool WXDLLIMPEXP_ODBC -GetDataSource(HENV henv, char *Dsn, SWORD DsnMaxLength, char *DsDesc, SWORD DsDescMaxLength, - UWORD direction = SQL_FETCH_NEXT); - -#endif // Deprecated structures/classes/functions - -#endif // _WX_DB_H_ - diff --git a/wxWidgets/include/wx/dbgrid.h b/wxWidgets/include/wx/dbgrid.h deleted file mode 100644 index d613fd3824..0000000000 --- a/wxWidgets/include/wx/dbgrid.h +++ /dev/null @@ -1,177 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: dbgrid.h -// Purpose: Displays a wxDbTable in a wxGrid. -// Author: Roger Gammans, Paul Gammans -// Modified by: -// Created: -// RCS-ID: $Id: dbgrid.h 61872 2009-09-09 22:37:05Z VZ $ -// Copyright: (c) 1999 The Computer Surgery (roger@computer-surgery.co.uk) -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// -// Branched From : dbgrid.h,v 1.19 2001/03/28 11:16:01 -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_GENERIC_DBGRID_H_ -#define _WX_GENERIC_DBGRID_H_ - -#if wxUSE_ODBC -#if wxUSE_GRID - -#include "wx/log.h" -#include "wx/dbtable.h" -#include "wx/dynarray.h" -#include "wx/grid.h" -#include "wx/dbkeyg.h" - -#define wxGRID_VALUE_DBAUTO wxT("dbauto") - -WX_DECLARE_USER_EXPORTED_OBJARRAY(GenericKey,keyarray,WXDLLIMPEXP_DBGRID); - -static const int wxUSE_QUERY = -1; - -class WXDLLIMPEXP_DBGRID wxDbGridColInfoBase -{ -public: - //Default ctor - wxDbGridColInfoBase() { } - wxDbGridColInfoBase(int colNo, - wxString type, wxString title) : - DbCol(colNo), - wxtypename(type), - Title(title) - { } - //Copy Ctor - wxDbGridColInfoBase(const wxDbGridColInfoBase& ref) - { - DbCol = ref.DbCol; - wxtypename = ref.wxtypename; - Title = ref.Title; - } - //Empty destructor for member obj's - ~wxDbGridColInfoBase() {} - - int DbCol; - wxString wxtypename; - wxString Title; -}; - - -class WXDLLIMPEXP_DBGRID wxDbGridColInfo -{ -public: - wxDbGridColInfo(int colNo, - wxString type, - wxString title, - wxDbGridColInfo *next) : - m_data(colNo,type,title) - { - m_next=next; - } - - //Empty List - ~wxDbGridColInfo() { delete m_next; } - - //Recurse to find length. - int Length() { return (m_next ? m_next->Length() +1 : 1); } - - // Adds a new column info (2 step creation) - void AddColInfo (int colNo, - wxString type, - wxString title) - { - GetLast()->m_next = new wxDbGridColInfo (colNo, type, title, NULL); - } - - // Searches last - wxDbGridColInfo *GetLast() { return (m_next ? m_next->GetLast() : this); } - - - protected: - wxDbGridColInfoBase m_data; - wxDbGridColInfo *m_next; - - friend class wxDbGridTableBase; -}; - - -class WXDLLIMPEXP_DBGRID wxDbGridCellAttrProvider : public wxGridCellAttrProvider -{ -public: - wxDbGridCellAttrProvider(); - wxDbGridCellAttrProvider(wxDbTable *tab, wxDbGridColInfoBase* ColInfo); - virtual ~wxDbGridCellAttrProvider(); - - virtual wxGridCellAttr *GetAttr(int row, int col, - wxGridCellAttr::wxAttrKind kind) const; - virtual void AssignDbTable(wxDbTable *tab); -private: - wxDbTable *m_data; - wxDbGridColInfoBase *m_ColInfo; -}; - - -class WXDLLIMPEXP_DBGRID wxDbGridTableBase : public wxGridTableBase -{ -public: - wxDbGridTableBase(wxDbTable *tab, wxDbGridColInfo *ColInfo, - int count = wxUSE_QUERY, bool takeOwnership = true); - virtual ~wxDbGridTableBase(); - - virtual int GetNumberRows() - { - wxLogDebug(wxT(" GetNumberRows() = %i"),m_rowtotal); - return m_rowtotal; - } - virtual int GetNumberCols() - { - wxLogDebug(wxT(" GetNumberCols() = %i"),m_nocols); - return m_nocols; - } - virtual bool IsEmptyCell(int row, int col) ; - virtual wxString GetValue(int row, int col) ; - virtual void SetValue(int row, int col, const wxString& value); - virtual bool CanHaveAttributes(); - virtual wxString GetTypeName(int row, int col); - virtual bool CanGetValueAs(int row, int col, const wxString& typeName); - virtual bool CanSetValueAs(int row, int col, const wxString& typeName); - virtual long GetValueAsLong(int row, int col); - virtual double GetValueAsDouble(int row, int col); - virtual bool GetValueAsBool(int row, int col); - virtual void SetValueAsLong(int row, int col, long value); - virtual void SetValueAsDouble(int row, int col, double value); - virtual void SetValueAsBool(int row, int col, bool value); - virtual void *GetValueAsCustom(int row, int col, const wxString& typeName); - virtual void SetValueAsCustom(int row, int col, const wxString& typeName, void* value); - - - virtual wxString GetColLabelValue(int col); - - virtual bool AssignDbTable(wxDbTable *tab, int count = wxUSE_QUERY, bool takeOwnership=true); - virtual void ValidateRow(int row); - virtual bool UpdateRow(int row) const - { - if (m_row != row) - return true; - else - return Writeback(); - } - -private: - //Operates on the current row - bool Writeback() const; - - typedef wxGridTableBase inherited; - keyarray m_keys; - wxDbTable *m_data; - bool m_dbowner; - int m_rowtotal; - int m_nocols; - int m_row; - wxDbGridColInfoBase *m_ColInfo; - bool m_rowmodified; -}; - -#endif // #if wxUSE_GRID -#endif // #if wxUSE_ODBC - -#endif // _WX_GENERIC_DBGRID_H_ diff --git a/wxWidgets/include/wx/dbkeyg.h b/wxWidgets/include/wx/dbkeyg.h deleted file mode 100644 index eb91f1ce16..0000000000 --- a/wxWidgets/include/wx/dbkeyg.h +++ /dev/null @@ -1,41 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: dbkeyg.h -// Purpose: Generic key support for wxDbTable -// Author: Roger Gammans -// Modified by: -// Created: -// RCS-ID: $Id: dbkeyg.h 29077 2004-09-10 12:56:07Z ABX $ -// Copyright: (c) 1999 The Computer Surgery (roger@computer-surgery.co.uk) -// Licence: wxWindows licence -// -// NOTE : There is no CPP file to go along with this -// -/////////////////////////////////////////////////////////////////////////////// -// Branched From : gkey.h,v 1.3 2001/06/01 10:31:41 -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_DBGKEY_H_ -#define _WX_DBGKEY_H_ - -class GenericKey -{ -public: - GenericKey(void *blk, size_t sz) { clone(blk,sz); } - GenericKey(const GenericKey &ref) { clone(ref.m_data,ref.m_sz); } - ~GenericKey() { free(m_data); } - - void *GetBlk(void) const { return m_data; } - -private: - void clone(void *blk, size_t sz) - { - m_data = malloc(sz); - memcpy(m_data,blk,sz); - m_sz = sz; - } - - void *m_data; - size_t m_sz; -}; - -#endif // _WX_DBGKEY_H_ diff --git a/wxWidgets/include/wx/dbtable.h b/wxWidgets/include/wx/dbtable.h deleted file mode 100644 index e86c5c4acf..0000000000 --- a/wxWidgets/include/wx/dbtable.h +++ /dev/null @@ -1,377 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: dbtable.h -// Purpose: Declaration of the wxDbTable class. -// Author: Doug Card -// Modified by: George Tasker -// Bart Jourquin -// Mark Johnson -// Created: 9.96 -// RCS-ID: $Id: dbtable.h 61872 2009-09-09 22:37:05Z VZ $ -// Copyright: (c) 1996 Remstar International, Inc. -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -/* -// SYNOPSIS START -// SYNOPSIS STOP -*/ - -#ifndef DBTABLE_DOT_H -#define DBTABLE_DOT_H - -#include "wx/defs.h" - -#include "wx/db.h" - -#include "wx/variant.h" -#include "wx/dbkeyg.h" - -const int wxDB_ROWID_LEN = 24; // 18 is the max, 24 is in case it gets larger -const int wxDB_DEFAULT_CURSOR = 0; -const bool wxDB_QUERY_ONLY = true; -const bool wxDB_DISABLE_VIEW = true; - -// Used to indicate end of a variable length list of -// column numbers passed to member functions -const int wxDB_NO_MORE_COLUMN_NUMBERS = -1; - -// The following class is used to define a column of a table. -// The wxDbTable constructor will dynamically allocate as many of -// these as there are columns in the table. The class derived -// from wxDbTable must initialize these column definitions in it's -// constructor. These column definitions provide inf. to the -// wxDbTable class which allows it to create a table in the data -// source, exchange data between the data source and the C++ -// object, and so on. -class WXDLLIMPEXP_ODBC wxDbColDef -{ -public: - wxChar ColName[DB_MAX_COLUMN_NAME_LEN+1]; // Column Name - int DbDataType; // Logical Data Type; e.g. DB_DATA_TYPE_INTEGER - SWORD SqlCtype; // C data type; e.g. SQL_C_LONG - void *PtrDataObj; // Address of the data object - int SzDataObj; // Size, in bytes, of the data object - bool KeyField; // true if this column is part of the PRIMARY KEY to the table; Date fields should NOT be KeyFields. - bool Updateable; // Specifies whether this column is updateable - bool InsertAllowed; // Specifies whether this column should be included in an INSERT statement - bool DerivedCol; // Specifies whether this column is a derived value - SQLLEN CbValue; // Internal use only!!! - bool Null; // NOT FULLY IMPLEMENTED - Allows NULL values in Inserts and Updates - - wxDbColDef(); - - bool Initialize(); -}; // wxDbColDef - - -class WXDLLIMPEXP_ODBC wxDbColDataPtr -{ -public: - void *PtrDataObj; - int SzDataObj; - SWORD SqlCtype; -}; // wxDbColDataPtr - - -// This structure is used when creating secondary indexes. -class WXDLLIMPEXP_ODBC wxDbIdxDef -{ -public: - wxChar ColName[DB_MAX_COLUMN_NAME_LEN+1]; - bool Ascending; -}; // wxDbIdxDef - - -class WXDLLIMPEXP_ODBC wxDbTable -{ -private: - ULONG tableID; // Used for debugging. This can help to match up mismatched constructors/destructors - - // Private member variables - UDWORD cursorType; - bool insertable; - - // Private member functions - bool initialize(wxDb *pwxDb, const wxString &tblName, const UWORD numColumns, - const wxString &qryTblName, bool qryOnly, const wxString &tblPath); - void cleanup(); - - void setCbValueForColumn(int columnIndex); - bool bindParams(bool forUpdate); // called by the other 'bind' functions - bool bindInsertParams(void); - bool bindUpdateParams(void); - - bool bindCols(HSTMT cursor); - bool getRec(UWORD fetchType); - bool execDelete(const wxString &pSqlStmt); - bool execUpdate(const wxString &pSqlStmt); - bool query(int queryType, bool forUpdate, bool distinct, const wxString &pSqlStmt=wxEmptyString); - -#if !wxODBC_BACKWARD_COMPATABILITY -// these were public - // Where, Order By and From clauses - wxString where; // Standard SQL where clause, minus the word WHERE - wxString orderBy; // Standard SQL order by clause, minus the ORDER BY - wxString from; // Allows for joins in a wxDbTable::Query(). Format: ",tbl,tbl..." - - // ODBC Handles - HENV henv; // ODBC Environment handle - HDBC hdbc; // ODBC DB Connection handle - HSTMT hstmt; // ODBC Statement handle - HSTMT *hstmtDefault; // Default cursor - HSTMT hstmtInsert; // ODBC Statement handle used specifically for inserts - HSTMT hstmtDelete; // ODBC Statement handle used specifically for deletes - HSTMT hstmtUpdate; // ODBC Statement handle used specifically for updates - HSTMT hstmtInternal; // ODBC Statement handle used internally only - HSTMT *hstmtCount; // ODBC Statement handle used by Count() function (No binding of columns) - - // Flags - bool selectForUpdate; - - // Pointer to the database object this table belongs to - wxDb *pDb; - - // Table Inf. - wxString tablePath; // needed for dBase tables - wxString tableName; // Table name - wxString queryTableName; // Query Table Name - UWORD m_numCols; // # of columns in the table - bool queryOnly; // Query Only, no inserts, updates or deletes - - // Column Definitions - wxDbColDef *colDefs; // Array of wxDbColDef structures -#endif -public: -#if wxODBC_BACKWARD_COMPATABILITY - // Where, Order By and From clauses - char *where; // Standard SQL where clause, minus the word WHERE - char *orderBy; // Standard SQL order by clause, minus the ORDER BY - char *from; // Allows for joins in a wxDbTable::Query(). Format: ",tbl,tbl..." - - // ODBC Handles - HENV henv; // ODBC Environment handle - HDBC hdbc; // ODBC DB Connection handle - HSTMT hstmt; // ODBC Statement handle - HSTMT *hstmtDefault; // Default cursor - HSTMT hstmtInsert; // ODBC Statement handle used specifically for inserts - HSTMT hstmtDelete; // ODBC Statement handle used specifically for deletes - HSTMT hstmtUpdate; // ODBC Statement handle used specifically for updates - HSTMT hstmtInternal; // ODBC Statement handle used internally only - HSTMT *hstmtCount; // ODBC Statement handle used by Count() function (No binding of columns) - - // Flags - bool selectForUpdate; - - // Pointer to the database object this table belongs to - wxDb *pDb; - - // Table Inf. - char tablePath[wxDB_PATH_MAX]; // needed for dBase tables - char tableName[DB_MAX_TABLE_NAME_LEN+1]; // Table name - char queryTableName[DB_MAX_TABLE_NAME_LEN+1]; // Query Table Name - UWORD m_numCols; // # of columns in the table - bool queryOnly; // Query Only, no inserts, updates or deletes - - // Column Definitions - wxDbColDef *colDefs; // Array of wxDbColDef structures -#endif - // Public member functions - wxDbTable(wxDb *pwxDb, const wxString &tblName, const UWORD numColumns, - const wxString &qryTblName=wxEmptyString, bool qryOnly = !wxDB_QUERY_ONLY, - const wxString &tblPath=wxEmptyString); - -#if WXWIN_COMPATIBILITY_2_4 - wxDEPRECATED( - wxDbTable(wxDb *pwxDb, const wxString &tblName, const UWORD numColumns, - const wxChar *qryTblName, bool qryOnly, - const wxString &tblPath) - ); -#endif // WXWIN_COMPATIBILITY_2_4 - - virtual ~wxDbTable(); - - bool Open(bool checkPrivileges=false, bool checkTableExists=true); - bool CreateTable(bool attemptDrop=true); - bool DropTable(void); - bool CreateIndex(const wxString &indexName, bool unique, UWORD numIndexColumns, - wxDbIdxDef *pIndexDefs, bool attemptDrop=true); - bool DropIndex(const wxString &indexName); - - // Accessors - - // The member variables returned by these accessors are all - // set when the wxDbTable instance is created and cannot be - // changed, hence there is no corresponding SetXxxx function - wxDb *GetDb() { return pDb; } - const wxString &GetTableName() { return tableName; } - const wxString &GetQueryTableName() { return queryTableName; } - const wxString &GetTablePath() { return tablePath; } - - UWORD GetNumberOfColumns() { return m_numCols; } // number of "defined" columns for this wxDbTable instance - - const wxString &GetFromClause() { return from; } - const wxString &GetOrderByClause() { return orderBy; } - const wxString &GetWhereClause() { return where; } - - bool IsQueryOnly() { return queryOnly; } -#if wxODBC_BACKWARD_COMPATABILITY - void SetFromClause(const char *From) { from = (char *)From; } - void SetOrderByClause(const char *OrderBy) { orderBy = (char *)OrderBy; } - void SetWhereClause(const char *Where) { where = (char *)Where; } -#else - void SetFromClause(const wxString &From) { from = From; } - void SetOrderByClause(const wxString &OrderBy) { orderBy = OrderBy; } - bool SetOrderByColNums(UWORD first, ...); - void SetWhereClause(const wxString &Where) { where = Where; } - void From(const wxString &From) { from = From; } - void OrderBy(const wxString &OrderBy) { orderBy = OrderBy; } - void Where(const wxString &Where) { where = Where; } - const wxString &Where() { return where; } - const wxString &OrderBy() { return orderBy; } - const wxString &From() { return from; } -#endif - int Insert(void); - bool Update(void); - bool Update(const wxString &pSqlStmt); - bool UpdateWhere(const wxString &pWhereClause); - bool Delete(void); - bool DeleteWhere(const wxString &pWhereClause); - bool DeleteMatching(void); - virtual bool Query(bool forUpdate = false, bool distinct = false); - bool QueryBySqlStmt(const wxString &pSqlStmt); - bool QueryMatching(bool forUpdate = false, bool distinct = false); - bool QueryOnKeyFields(bool forUpdate = false, bool distinct = false); - bool Refresh(void); - bool GetNext(void) { return(getRec(SQL_FETCH_NEXT)); } - bool operator++(int) { return(getRec(SQL_FETCH_NEXT)); } - - /***** These four functions only work with wxDb instances that are defined ***** - ***** as not being FwdOnlyCursors *****/ - bool GetPrev(void); - bool operator--(int); - bool GetFirst(void); - bool GetLast(void); - - bool IsCursorClosedOnCommit(void); - UWORD GetRowNum(void); - - void BuildSelectStmt(wxString &pSqlStmt, int typeOfSelect, bool distinct); - void BuildSelectStmt(wxChar *pSqlStmt, int typeOfSelect, bool distinct); - - void BuildDeleteStmt(wxString &pSqlStmt, int typeOfDel, const wxString &pWhereClause=wxEmptyString); - void BuildDeleteStmt(wxChar *pSqlStmt, int typeOfDel, const wxString &pWhereClause=wxEmptyString); - - void BuildUpdateStmt(wxString &pSqlStmt, int typeOfUpdate, const wxString &pWhereClause=wxEmptyString); - void BuildUpdateStmt(wxChar *pSqlStmt, int typeOfUpdate, const wxString &pWhereClause=wxEmptyString); - - void BuildWhereClause(wxString &pWhereClause, int typeOfWhere, const wxString &qualTableName=wxEmptyString, bool useLikeComparison=false); - void BuildWhereClause(wxChar *pWhereClause, int typeOfWhere, const wxString &qualTableName=wxEmptyString, bool useLikeComparison=false); - -#if wxODBC_BACKWARD_COMPATABILITY -// The following member functions are deprecated. You should use the BuildXxxxxStmt functions (above) - void GetSelectStmt(char *pSqlStmt, int typeOfSelect, bool distinct) - { BuildSelectStmt(pSqlStmt,typeOfSelect,distinct); } - void GetDeleteStmt(char *pSqlStmt, int typeOfDel, const char *pWhereClause = NULL) - { BuildDeleteStmt(pSqlStmt,typeOfDel,pWhereClause); } - void GetUpdateStmt(char *pSqlStmt, int typeOfUpdate, const char *pWhereClause = NULL) - { BuildUpdateStmt(pSqlStmt,typeOfUpdate,pWhereClause); } - void GetWhereClause(char *pWhereClause, int typeOfWhere, - const char *qualTableName = NULL, bool useLikeComparison=false) - { BuildWhereClause(pWhereClause,typeOfWhere,qualTableName,useLikeComparison); } -#endif - bool CanSelectForUpdate(void); -#if wxODBC_BACKWARD_COMPATABILITY - bool CanUpdByROWID(void) { return CanUpdateByRowID(); }; -#endif - bool CanUpdateByROWID(void); - void ClearMemberVar(UWORD colNumber, bool setToNull=false); - void ClearMemberVars(bool setToNull=false); - bool SetQueryTimeout(UDWORD nSeconds); - - wxDbColDef *GetColDefs() { return colDefs; } - bool SetColDefs(UWORD index, const wxString &fieldName, int dataType, - void *pData, SWORD cType, - int size, bool keyField = false, bool updateable = true, - bool insertAllowed = true, bool derivedColumn = false); - wxDbColDataPtr *SetColDefs(wxDbColInf *colInfs, UWORD numCols); - - bool CloseCursor(HSTMT cursor); - bool DeleteCursor(HSTMT *hstmtDel); - void SetCursor(HSTMT *hstmtActivate = (void **) wxDB_DEFAULT_CURSOR); - HSTMT GetCursor(void) { return(hstmt); } - HSTMT *GetNewCursor(bool setCursor = false, bool bindColumns = true); -#if wxODBC_BACKWARD_COMPATABILITY -// The following member function is deprecated. You should use the GetNewCursor - HSTMT *NewCursor(bool setCursor = false, bool bindColumns = true) { return GetNewCursor(setCursor,bindColumns); } -#endif - - ULONG Count(const wxString &args=wxT("*")); - int DB_STATUS(void) { return(pDb->DB_STATUS); } - - bool IsColNull(UWORD colNumber) const; - bool SetColNull(UWORD colNumber, bool set=true); - bool SetColNull(const wxString &colName, bool set=true); -#if wxODBC_BACKWARD_COMPATABILITY -// The following member functions are deprecated. You should use the SetColNull() - bool SetNull(int colNumber, bool set=true) { return (SetNull(colNumber,set)); } - bool SetNull(const char *colName, bool set=true) { return (SetNull(colName,set)); } -#endif -#ifdef __WXDEBUG__ - ULONG GetTableID() { return tableID; } -#endif - -//TODO: Need to Document - typedef enum { WX_ROW_MODE_QUERY , WX_ROW_MODE_INDIVIDUAL } rowmode_t; - virtual void SetRowMode(const rowmode_t rowmode); -#if wxODBC_BACKWARD_COMPATABILITY - virtual wxVariant GetCol(const int colNumber) const { return GetColumn(colNumber); }; - virtual void SetCol(const int colNumber, const wxVariant value) { return SetColumn(colNumber, value); }; -#endif - virtual wxVariant GetColumn(const int colNumber) const ; - virtual void SetColumn(const int colNumber, const wxVariant value); - virtual GenericKey GetKey(void); - virtual void SetKey(const GenericKey &key); - - private: - HSTMT *m_hstmtGridQuery; - rowmode_t m_rowmode; - size_t m_keysize; - -// typedef enum {unmodified=0, UpdatePending, InsertPending } recStatus; - -// recStatus get_ModifiedStatus() { return m_recstatus; } - -// void modify() { -// if (m_recstatus==unmodified) -// m_recstatus=UpdatePending; -// } -// protected: -// void insertify() {m_recstatus=InsertPending; } -// void unmodify() {m_recstatus=unmodified; } -// recStatus m_recstatus; -//TODO: Need to Document -}; // wxDbTable - - -// Change this to 0 to remove use of all deprecated functions -#if wxODBC_BACKWARD_COMPATABILITY -//################################################################################# -//############### DEPRECATED functions for backward compatibility ################# -//################################################################################# - -// Backward compability. These will eventually go away -typedef wxDbTable wxTable; -typedef wxDbIdxDef wxIdxDef; -typedef wxDbIdxDef CidxDef; -typedef wxDbColDef wxColDef; -typedef wxDbColDef CcolDef; -typedef wxDbColDataPtr wxColDataPtr; -typedef wxDbColDataPtr CcolDataPtr; - -const int ROWID = wxDB_ROWID_LEN; -const int DEFAULT_CURSOR = wxDB_DEFAULT_CURSOR; -const bool QUERY_ONLY = wxDB_QUERY_ONLY; -const bool DISABLE_VIEW = wxDB_DISABLE_VIEW; -#endif - -#endif diff --git a/wxWidgets/include/wx/dc.h b/wxWidgets/include/wx/dc.h deleted file mode 100644 index b98ab65a5f..0000000000 --- a/wxWidgets/include/wx/dc.h +++ /dev/null @@ -1,1008 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/dc.h -// Purpose: wxDC class -// Author: Vadim Zeitlin -// Modified by: -// Created: 05/25/99 -// RCS-ID: $Id: dc.h 59768 2009-03-23 12:35:12Z VZ $ -// Copyright: (c) wxWidgets team -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_DC_H_BASE_ -#define _WX_DC_H_BASE_ - -// ---------------------------------------------------------------------------- -// headers which we must include here -// ---------------------------------------------------------------------------- - -#include "wx/object.h" // the base class - -#include "wx/intl.h" // for wxLayoutDirection -#include "wx/cursor.h" // we have member variables of these classes -#include "wx/font.h" // so we can't do without them -#include "wx/colour.h" -#include "wx/bitmap.h" // for wxNullBitmap -#include "wx/brush.h" -#include "wx/pen.h" -#include "wx/palette.h" -#include "wx/list.h" // we use wxList in inline functions -#include "wx/dynarray.h" -#include "wx/math.h" - -class WXDLLIMPEXP_FWD_CORE wxDC; -class WXDLLIMPEXP_FWD_CORE wxDCBase; - -class WXDLLEXPORT wxDrawObject -{ -public: - - wxDrawObject() - : m_isBBoxValid(false) - , m_minX(0), m_minY(0), m_maxX(0), m_maxY(0) - { } - - virtual ~wxDrawObject() { } - - virtual void Draw(wxDCBase&) const { } - - virtual void CalcBoundingBox(wxCoord x, wxCoord y) - { - if ( m_isBBoxValid ) - { - if ( x < m_minX ) m_minX = x; - if ( y < m_minY ) m_minY = y; - if ( x > m_maxX ) m_maxX = x; - if ( y > m_maxY ) m_maxY = y; - } - else - { - m_isBBoxValid = true; - - m_minX = x; - m_minY = y; - m_maxX = x; - m_maxY = y; - } - } - - void ResetBoundingBox() - { - m_isBBoxValid = false; - - m_minX = m_maxX = m_minY = m_maxY = 0; - } - - // Get the final bounding box of the PostScript or Metafile picture. - - wxCoord MinX() const { return m_minX; } - wxCoord MaxX() const { return m_maxX; } - wxCoord MinY() const { return m_minY; } - wxCoord MaxY() const { return m_maxY; } - - //to define the type of object for derived objects - virtual int GetType()=0; - -protected: - //for boundingbox calculation - bool m_isBBoxValid:1; - //for boundingbox calculation - wxCoord m_minX, m_minY, m_maxX, m_maxY; -}; - -// --------------------------------------------------------------------------- -// global variables -// --------------------------------------------------------------------------- - -// --------------------------------------------------------------------------- -// wxDC is the device context - object on which any drawing is done -// --------------------------------------------------------------------------- - -class WXDLLEXPORT wxDCBase : public wxObject -{ -public: - wxDCBase() - : m_colour(wxColourDisplay()) - , m_ok(true) - , m_clipping(false) - , m_isInteractive(0) - , m_isBBoxValid(false) - , m_logicalOriginX(0), m_logicalOriginY(0) - , m_deviceOriginX(0), m_deviceOriginY(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_signX(1), m_signY(1) - , m_minX(0), m_minY(0), m_maxX(0), m_maxY(0) - , m_clipX1(0), m_clipY1(0), m_clipX2(0), m_clipY2(0) - , m_logicalFunction(wxCOPY) - , m_backgroundMode(wxTRANSPARENT) - , m_mappingMode(wxMM_TEXT) - , m_pen() - , m_brush() - , m_backgroundBrush(*wxTRANSPARENT_BRUSH) - , m_textForegroundColour(*wxBLACK) - , m_textBackgroundColour(*wxWHITE) - , m_font() -#if wxUSE_PALETTE - , m_palette() - , m_hasCustomPalette(false) -#endif // wxUSE_PALETTE - { - ResetBoundingBox(); - ResetClipping(); - } - - virtual ~wxDCBase() { } - - // graphic primitives - // ------------------ - - virtual void DrawObject(wxDrawObject* drawobject) - { - drawobject->Draw(*this); - CalcBoundingBox(drawobject->MinX(),drawobject->MinY()); - CalcBoundingBox(drawobject->MaxX(),drawobject->MaxY()); - } - - bool FloodFill(wxCoord x, wxCoord y, const wxColour& col, - int style = wxFLOOD_SURFACE) - { return DoFloodFill(x, y, col, style); } - bool FloodFill(const wxPoint& pt, const wxColour& col, - int style = wxFLOOD_SURFACE) - { return DoFloodFill(pt.x, pt.y, col, style); } - - // fill the area specified by rect with a radial gradient, starting from - // initialColour in the centre of the cercle and fading to destColour. - void GradientFillConcentric(const wxRect& rect, - const wxColour& initialColour, - const wxColour& destColour) - { GradientFillConcentric(rect, initialColour, destColour, - wxPoint(rect.GetWidth() / 2, - rect.GetHeight() / 2)); } - - void GradientFillConcentric(const wxRect& rect, - const wxColour& initialColour, - const wxColour& destColour, - const wxPoint& circleCenter) - { DoGradientFillConcentric(rect, initialColour, destColour, circleCenter); } - - // fill the area specified by rect with a linear gradient - void GradientFillLinear(const wxRect& rect, - const wxColour& initialColour, - const wxColour& destColour, - wxDirection nDirection = wxEAST) - { DoGradientFillLinear(rect, initialColour, destColour, nDirection); } - - bool GetPixel(wxCoord x, wxCoord y, wxColour *col) const - { return DoGetPixel(x, y, col); } - bool GetPixel(const wxPoint& pt, wxColour *col) const - { return DoGetPixel(pt.x, pt.y, col); } - - void DrawLine(wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2) - { DoDrawLine(x1, y1, x2, y2); } - void DrawLine(const wxPoint& pt1, const wxPoint& pt2) - { DoDrawLine(pt1.x, pt1.y, pt2.x, pt2.y); } - - void CrossHair(wxCoord x, wxCoord y) - { DoCrossHair(x, y); } - void CrossHair(const wxPoint& pt) - { DoCrossHair(pt.x, pt.y); } - - void DrawArc(wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2, - wxCoord xc, wxCoord yc) - { DoDrawArc(x1, y1, x2, y2, xc, yc); } - void DrawArc(const wxPoint& pt1, const wxPoint& pt2, const wxPoint& centre) - { DoDrawArc(pt1.x, pt1.y, pt2.x, pt2.y, centre.x, centre.y); } - - void DrawCheckMark(wxCoord x, wxCoord y, - wxCoord width, wxCoord height) - { DoDrawCheckMark(x, y, width, height); } - void DrawCheckMark(const wxRect& rect) - { DoDrawCheckMark(rect.x, rect.y, rect.width, rect.height); } - - void DrawEllipticArc(wxCoord x, wxCoord y, wxCoord w, wxCoord h, - double sa, double ea) - { DoDrawEllipticArc(x, y, w, h, sa, ea); } - void DrawEllipticArc(const wxPoint& pt, const wxSize& sz, - double sa, double ea) - { DoDrawEllipticArc(pt.x, pt.y, sz.x, sz.y, sa, ea); } - - void DrawPoint(wxCoord x, wxCoord y) - { DoDrawPoint(x, y); } - void DrawPoint(const wxPoint& pt) - { DoDrawPoint(pt.x, pt.y); } - - void DrawLines(int n, wxPoint points[], - wxCoord xoffset = 0, wxCoord yoffset = 0) - { DoDrawLines(n, points, xoffset, yoffset); } - void DrawLines(const wxList *list, - wxCoord xoffset = 0, wxCoord yoffset = 0); - - void DrawPolygon(int n, wxPoint points[], - wxCoord xoffset = 0, wxCoord yoffset = 0, - int fillStyle = wxODDEVEN_RULE) - { DoDrawPolygon(n, points, xoffset, yoffset, fillStyle); } - - void DrawPolygon(const wxList *list, - wxCoord xoffset = 0, wxCoord yoffset = 0, - int fillStyle = wxODDEVEN_RULE); - - void DrawPolyPolygon(int n, int count[], wxPoint points[], - wxCoord xoffset = 0, wxCoord yoffset = 0, - int fillStyle = wxODDEVEN_RULE) - { DoDrawPolyPolygon(n, count, points, xoffset, yoffset, fillStyle); } - - void DrawRectangle(wxCoord x, wxCoord y, wxCoord width, wxCoord height) - { DoDrawRectangle(x, y, width, height); } - void DrawRectangle(const wxPoint& pt, const wxSize& sz) - { DoDrawRectangle(pt.x, pt.y, sz.x, sz.y); } - void DrawRectangle(const wxRect& rect) - { DoDrawRectangle(rect.x, rect.y, rect.width, rect.height); } - - void DrawRoundedRectangle(wxCoord x, wxCoord y, wxCoord width, wxCoord height, - double radius) - { DoDrawRoundedRectangle(x, y, width, height, radius); } - void DrawRoundedRectangle(const wxPoint& pt, const wxSize& sz, - double radius) - { DoDrawRoundedRectangle(pt.x, pt.y, sz.x, sz.y, radius); } - void DrawRoundedRectangle(const wxRect& r, double radius) - { DoDrawRoundedRectangle(r.x, r.y, r.width, r.height, radius); } - - void DrawCircle(wxCoord x, wxCoord y, wxCoord radius) - { DoDrawEllipse(x - radius, y - radius, 2*radius, 2*radius); } - void DrawCircle(const wxPoint& pt, wxCoord radius) - { DrawCircle(pt.x, pt.y, radius); } - - void DrawEllipse(wxCoord x, wxCoord y, wxCoord width, wxCoord height) - { DoDrawEllipse(x, y, width, height); } - void DrawEllipse(const wxPoint& pt, const wxSize& sz) - { DoDrawEllipse(pt.x, pt.y, sz.x, sz.y); } - void DrawEllipse(const wxRect& rect) - { DoDrawEllipse(rect.x, rect.y, rect.width, rect.height); } - - void DrawIcon(const wxIcon& icon, wxCoord x, wxCoord y) - { DoDrawIcon(icon, x, y); } - void DrawIcon(const wxIcon& icon, const wxPoint& pt) - { DoDrawIcon(icon, pt.x, pt.y); } - - void DrawBitmap(const wxBitmap &bmp, wxCoord x, wxCoord y, - bool useMask = false) - { DoDrawBitmap(bmp, x, y, useMask); } - void DrawBitmap(const wxBitmap &bmp, const wxPoint& pt, - bool useMask = false) - { DoDrawBitmap(bmp, pt.x, pt.y, useMask); } - - void DrawText(const wxString& text, wxCoord x, wxCoord y) - { DoDrawText(text, x, y); } - void DrawText(const wxString& text, const wxPoint& pt) - { DoDrawText(text, pt.x, pt.y); } - - void DrawRotatedText(const wxString& text, wxCoord x, wxCoord y, double angle) - { DoDrawRotatedText(text, x, y, angle); } - void DrawRotatedText(const wxString& text, const wxPoint& pt, double angle) - { DoDrawRotatedText(text, pt.x, pt.y, angle); } - - // this version puts both optional bitmap and the text into the given - // rectangle and aligns is as specified by alignment parameter; it also - // will emphasize the character with the given index if it is != -1 and - // return the bounding rectangle if required - virtual void DrawLabel(const wxString& text, - const wxBitmap& image, - const wxRect& rect, - int alignment = wxALIGN_LEFT | wxALIGN_TOP, - int indexAccel = -1, - wxRect *rectBounding = NULL); - - void DrawLabel(const wxString& text, const wxRect& rect, - int alignment = wxALIGN_LEFT | wxALIGN_TOP, - int indexAccel = -1) - { DrawLabel(text, wxNullBitmap, rect, alignment, indexAccel); } - - bool Blit(wxCoord xdest, wxCoord ydest, wxCoord width, wxCoord height, - wxDC *source, wxCoord xsrc, wxCoord ysrc, - int rop = wxCOPY, bool useMask = false, wxCoord xsrcMask = wxDefaultCoord, wxCoord ysrcMask = wxDefaultCoord) - { - return DoBlit(xdest, ydest, width, height, - source, xsrc, ysrc, rop, useMask, xsrcMask, ysrcMask); - } - bool Blit(const wxPoint& destPt, const wxSize& sz, - wxDC *source, const wxPoint& srcPt, - int rop = wxCOPY, bool useMask = false, const wxPoint& srcPtMask = wxDefaultPosition) - { - return DoBlit(destPt.x, destPt.y, sz.x, sz.y, - source, srcPt.x, srcPt.y, rop, useMask, srcPtMask.x, srcPtMask.y); - } - - wxBitmap GetAsBitmap(const wxRect *subrect = (const wxRect *) NULL) const - { - return DoGetAsBitmap(subrect); - } - -#if wxUSE_SPLINES - // TODO: this API needs fixing (wxPointList, why (!const) "wxList *"?) - void DrawSpline(wxCoord x1, wxCoord y1, - wxCoord x2, wxCoord y2, - wxCoord x3, wxCoord y3); - void DrawSpline(int n, wxPoint points[]); - - void DrawSpline(wxList *points) { DoDrawSpline(points); } -#endif // wxUSE_SPLINES - - // Eventually we will have wxUSE_GENERIC_DRAWELLIPSE -#ifdef __WXWINCE__ - //! Generic method to draw ellipses, circles and arcs with current pen and brush. - /*! \param x Upper left corner of bounding box. - * \param y Upper left corner of bounding box. - * \param w Width of bounding box. - * \param h Height of bounding box. - * \param sa Starting angle of arc - * (counterclockwise, start at 3 o'clock, 360 is full circle). - * \param ea Ending angle of arc. - * \param angle Rotation angle, the Arc will be rotated after - * calculating begin and end. - */ - void DrawEllipticArcRot( wxCoord x, wxCoord y, - wxCoord width, wxCoord height, - double sa = 0, double ea = 0, double angle = 0 ) - { DoDrawEllipticArcRot( x, y, width, height, sa, ea, angle ); } - - void DrawEllipticArcRot( const wxPoint& pt, - const wxSize& sz, - double sa = 0, double ea = 0, double angle = 0 ) - { DoDrawEllipticArcRot( pt.x, pt.y, sz.x, sz.y, sa, ea, angle ); } - - void DrawEllipticArcRot( const wxRect& rect, - double sa = 0, double ea = 0, double angle = 0 ) - { DoDrawEllipticArcRot( rect.x, rect.y, rect.width, rect.height, sa, ea, angle ); } - - virtual void DoDrawEllipticArcRot( wxCoord x, wxCoord y, - wxCoord w, wxCoord h, - double sa = 0, double ea = 0, double angle = 0 ); - - //! Rotates points around center. - /*! This is a quite straight method, it calculates in pixels - * and so it produces rounding errors. - * \param points The points inside will be rotated. - * \param angle Rotating angle (counterclockwise, start at 3 o'clock, 360 is full circle). - * \param center Center of rotation. - */ - void Rotate( wxList* points, double angle, wxPoint center = wxPoint(0,0) ); - - // used by DrawEllipticArcRot - // Careful: wxList gets filled with points you have to delete later. - void CalculateEllipticPoints( wxList* points, - wxCoord xStart, wxCoord yStart, - wxCoord w, wxCoord h, - double sa, double ea ); -#endif - - // global DC operations - // -------------------- - - virtual void Clear() = 0; - - virtual bool StartDoc(const wxString& WXUNUSED(message)) { return true; } - virtual void EndDoc() { } - - virtual void StartPage() { } - virtual void EndPage() { } - -#if WXWIN_COMPATIBILITY_2_6 - wxDEPRECATED( void BeginDrawing() ); - wxDEPRECATED( void EndDrawing() ); -#endif // WXWIN_COMPATIBILITY_2_6 - - - // set objects to use for drawing - // ------------------------------ - - virtual void SetFont(const wxFont& font) = 0; - virtual void SetPen(const wxPen& pen) = 0; - virtual void SetBrush(const wxBrush& brush) = 0; - virtual void SetBackground(const wxBrush& brush) = 0; - virtual void SetBackgroundMode(int mode) = 0; -#if wxUSE_PALETTE - virtual void SetPalette(const wxPalette& palette) = 0; -#endif // wxUSE_PALETTE - - // clipping region - // --------------- - - void SetClippingRegion(wxCoord x, wxCoord y, wxCoord width, wxCoord height) - { DoSetClippingRegion(x, y, width, height); } - void SetClippingRegion(const wxPoint& pt, const wxSize& sz) - { DoSetClippingRegion(pt.x, pt.y, sz.x, sz.y); } - void SetClippingRegion(const wxRect& rect) - { DoSetClippingRegion(rect.x, rect.y, rect.width, rect.height); } - void SetClippingRegion(const wxRegion& region) - { DoSetClippingRegionAsRegion(region); } - -#if wxABI_VERSION >= 20811 - void SetDeviceClippingRegion(const wxRegion& region) - { DoSetClippingRegionAsRegion(region); } -#endif - - virtual void DestroyClippingRegion() { ResetClipping(); } - - void GetClippingBox(wxCoord *x, wxCoord *y, wxCoord *w, wxCoord *h) const - { DoGetClippingBox(x, y, w, h); } - void GetClippingBox(wxRect& rect) const - { - DoGetClippingBox(&rect.x, &rect.y, &rect.width, &rect.height); - } - - // text extent - // ----------- - - virtual wxCoord GetCharHeight() const = 0; - virtual wxCoord GetCharWidth() const = 0; - - // only works for single line strings - void GetTextExtent(const wxString& string, - wxCoord *x, wxCoord *y, - wxCoord *descent = NULL, - wxCoord *externalLeading = NULL, - wxFont *theFont = NULL) const - { DoGetTextExtent(string, x, y, descent, externalLeading, theFont); } - - wxSize GetTextExtent(const wxString& string) const - { - wxCoord w, h; - DoGetTextExtent(string, &w, &h); - return wxSize(w, h); - } - - // works for single as well as multi-line strings - virtual void GetMultiLineTextExtent(const wxString& string, - wxCoord *width, - wxCoord *height, - wxCoord *heightLine = NULL, - wxFont *font = NULL) const; - - wxSize GetMultiLineTextExtent(const wxString& string) const - { - wxCoord w, h; - GetMultiLineTextExtent(string, &w, &h); - return wxSize(w, h); - } - - // Measure cumulative width of text after each character - bool GetPartialTextExtents(const wxString& text, wxArrayInt& widths) const - { return DoGetPartialTextExtents(text, widths); } - - // size and resolution - // ------------------- - - // in device units - void GetSize(int *width, int *height) const - { DoGetSize(width, height); } - wxSize GetSize() const - { - int w, h; - DoGetSize(&w, &h); - - return wxSize(w, h); - } - - // in mm - void GetSizeMM(int* width, int* height) const - { DoGetSizeMM(width, height); } - wxSize GetSizeMM() const - { - int w, h; - DoGetSizeMM(&w, &h); - - return wxSize(w, h); - } - - // coordinates conversions - // ----------------------- - - // This group of functions does actual conversion of the input, as you'd - // expect. - wxCoord DeviceToLogicalX(wxCoord x) const; - wxCoord DeviceToLogicalY(wxCoord y) const; - wxCoord DeviceToLogicalXRel(wxCoord x) const; - wxCoord DeviceToLogicalYRel(wxCoord y) const; - wxCoord LogicalToDeviceX(wxCoord x) const; - wxCoord LogicalToDeviceY(wxCoord y) const; - wxCoord LogicalToDeviceXRel(wxCoord x) const; - wxCoord LogicalToDeviceYRel(wxCoord y) const; - - // query DC capabilities - // --------------------- - - virtual bool CanDrawBitmap() const = 0; - virtual bool CanGetTextExtent() const = 0; - - // colour depth - virtual int GetDepth() const = 0; - - // Resolution in Pixels per inch - virtual wxSize GetPPI() const = 0; - - virtual bool Ok() const { return IsOk(); } - virtual bool IsOk() const { return m_ok; } - - // accessors and setters - // --------------------- - - virtual int GetBackgroundMode() const { return m_backgroundMode; } - virtual const wxBrush& GetBackground() const { return m_backgroundBrush; } - virtual const wxBrush& GetBrush() const { return m_brush; } - virtual const wxFont& GetFont() const { return m_font; } - virtual const wxPen& GetPen() const { return m_pen; } - - virtual const wxColour& GetTextForeground() const { return m_textForegroundColour; } - virtual const wxColour& GetTextBackground() const { return m_textBackgroundColour; } - virtual void SetTextForeground(const wxColour& colour) - { m_textForegroundColour = colour; } - virtual void SetTextBackground(const wxColour& colour) - { m_textBackgroundColour = colour; } - - virtual int GetMapMode() const { return m_mappingMode; } - virtual void SetMapMode(int mode) = 0; - - virtual void GetUserScale(double *x, double *y) const - { - if ( x ) *x = m_userScaleX; - if ( y ) *y = m_userScaleY; - } - virtual void SetUserScale(double x, double y) = 0; - - virtual void GetLogicalScale(double *x, double *y) - { - if ( x ) *x = m_logicalScaleX; - if ( y ) *y = m_logicalScaleY; - } - virtual void SetLogicalScale(double x, double y) - { - m_logicalScaleX = x; - m_logicalScaleY = y; - } - - void GetLogicalOrigin(wxCoord *x, wxCoord *y) const - { DoGetLogicalOrigin(x, y); } - wxPoint GetLogicalOrigin() const - { wxCoord x, y; DoGetLogicalOrigin(&x, &y); return wxPoint(x, y); } - virtual void SetLogicalOrigin(wxCoord x, wxCoord y) = 0; - - void GetDeviceOrigin(wxCoord *x, wxCoord *y) const - { DoGetDeviceOrigin(x, y); } - wxPoint GetDeviceOrigin() const - { wxCoord x, y; DoGetDeviceOrigin(&x, &y); return wxPoint(x, y); } - virtual void SetDeviceOrigin(wxCoord x, wxCoord y) = 0; - - virtual void ComputeScaleAndOrigin() {} - - virtual void SetAxisOrientation(bool xLeftRight, bool yBottomUp) = 0; - - virtual int GetLogicalFunction() const { return m_logicalFunction; } - virtual void SetLogicalFunction(int function) = 0; - -#if WXWIN_COMPATIBILITY_2_4 - virtual void SetOptimization(bool WXUNUSED(opt)) { } - virtual bool GetOptimization() { return false; } -#endif - - // bounding box - // ------------ - - virtual void CalcBoundingBox(wxCoord x, wxCoord y) - { - if ( m_isBBoxValid ) - { - if ( x < m_minX ) m_minX = x; - if ( y < m_minY ) m_minY = y; - if ( x > m_maxX ) m_maxX = x; - if ( y > m_maxY ) m_maxY = y; - } - else - { - m_isBBoxValid = true; - - m_minX = x; - m_minY = y; - m_maxX = x; - m_maxY = y; - } - } - - void ResetBoundingBox() - { - m_isBBoxValid = false; - - m_minX = m_maxX = m_minY = m_maxY = 0; - } - - // Get the final bounding box of the PostScript or Metafile picture. - wxCoord MinX() const { return m_minX; } - wxCoord MaxX() const { return m_maxX; } - wxCoord MinY() const { return m_minY; } - wxCoord MaxY() const { return m_maxY; } - - // misc old functions - // ------------------ - - // for compatibility with the old code when wxCoord was long everywhere - void GetTextExtent(const wxString& string, - long *x, long *y, - long *descent = NULL, - long *externalLeading = NULL, - wxFont *theFont = NULL) const - { - wxCoord x2, y2, descent2, externalLeading2; - DoGetTextExtent(string, &x2, &y2, - &descent2, &externalLeading2, - theFont); - if ( x ) - *x = x2; - if ( y ) - *y = y2; - if ( descent ) - *descent = descent2; - if ( externalLeading ) - *externalLeading = externalLeading2; - } - - void GetLogicalOrigin(long *x, long *y) const - { - wxCoord x2, y2; - DoGetLogicalOrigin(&x2, &y2); - if ( x ) - *x = x2; - if ( y ) - *y = y2; - } - - void GetDeviceOrigin(long *x, long *y) const - { - wxCoord x2, y2; - DoGetDeviceOrigin(&x2, &y2); - if ( x ) - *x = x2; - if ( y ) - *y = y2; - } - void GetClippingBox(long *x, long *y, long *w, long *h) const - { - wxCoord xx,yy,ww,hh; - DoGetClippingBox(&xx, &yy, &ww, &hh); - if (x) *x = xx; - if (y) *y = yy; - if (w) *w = ww; - if (h) *h = hh; - } - - // RTL related functions - // --------------------- - - // get or change the layout direction (LTR or RTL) for this dc, - // wxLayout_Default is returned if layout direction is not supported - virtual wxLayoutDirection GetLayoutDirection() const - { return wxLayout_Default; } - virtual void SetLayoutDirection(wxLayoutDirection WXUNUSED(dir)) - { } - -protected: - // the pure virtual functions which should be implemented by wxDC - virtual bool DoFloodFill(wxCoord x, wxCoord y, const wxColour& col, - int style = wxFLOOD_SURFACE) = 0; - - virtual void DoGradientFillLinear(const wxRect& rect, - const wxColour& initialColour, - const wxColour& destColour, - wxDirection nDirection = wxEAST); - - virtual void DoGradientFillConcentric(const wxRect& rect, - const wxColour& initialColour, - const wxColour& destColour, - const wxPoint& circleCenter); - - virtual bool DoGetPixel(wxCoord x, wxCoord y, wxColour *col) const = 0; - - virtual void DoDrawPoint(wxCoord x, wxCoord y) = 0; - virtual void DoDrawLine(wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2) = 0; - - virtual void DoDrawArc(wxCoord x1, wxCoord y1, - wxCoord x2, wxCoord y2, - wxCoord xc, wxCoord yc) = 0; - virtual void DoDrawCheckMark(wxCoord x, wxCoord y, - wxCoord width, wxCoord height); - virtual void DoDrawEllipticArc(wxCoord x, wxCoord y, wxCoord w, wxCoord h, - double sa, double ea) = 0; - - virtual void DoDrawRectangle(wxCoord x, wxCoord y, wxCoord width, wxCoord height) = 0; - virtual void DoDrawRoundedRectangle(wxCoord x, wxCoord y, - wxCoord width, wxCoord height, - double radius) = 0; - virtual void DoDrawEllipse(wxCoord x, wxCoord y, - wxCoord width, wxCoord height) = 0; - - virtual void DoCrossHair(wxCoord x, wxCoord y) = 0; - - virtual void DoDrawIcon(const wxIcon& icon, wxCoord x, wxCoord y) = 0; - virtual void DoDrawBitmap(const wxBitmap &bmp, wxCoord x, wxCoord y, - bool useMask = false) = 0; - - virtual void DoDrawText(const wxString& text, wxCoord x, wxCoord y) = 0; - virtual void DoDrawRotatedText(const wxString& text, - wxCoord x, wxCoord y, double angle) = 0; - - 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 = wxDefaultCoord, wxCoord ysrcMask = wxDefaultCoord) = 0; - - virtual wxBitmap DoGetAsBitmap(const wxRect *WXUNUSED(subrect)) const { return wxNullBitmap; } - - virtual void DoGetSize(int *width, int *height) const = 0; - virtual void DoGetSizeMM(int* width, int* height) const = 0; - - virtual void DoDrawLines(int n, wxPoint points[], - wxCoord xoffset, wxCoord yoffset) = 0; - virtual void DoDrawPolygon(int n, wxPoint points[], - wxCoord xoffset, wxCoord yoffset, - int fillStyle = wxODDEVEN_RULE) = 0; - virtual void DoDrawPolyPolygon(int n, int count[], wxPoint points[], - wxCoord xoffset, wxCoord yoffset, - int fillStyle); - - virtual void DoSetClippingRegionAsRegion(const wxRegion& region) = 0; - virtual void DoSetClippingRegion(wxCoord x, wxCoord y, - wxCoord width, wxCoord height) = 0; - -#if WXWIN_COMPATIBILITY_2_4 - // this was only for confusing people, use DoGetClippingBox only - virtual void DoGetClippingRegion(wxCoord *x, wxCoord *y, - wxCoord *w, wxCoord *h) - { DoGetClippingBox(x, y, w, h); } -#endif - - virtual void DoGetClippingBox(wxCoord *x, wxCoord *y, - wxCoord *w, wxCoord *h) const - { - if ( x ) - *x = m_clipX1; - if ( y ) - *y = m_clipY1; - if ( w ) - *w = m_clipX2 - m_clipX1; - if ( h ) - *h = m_clipY2 - m_clipY1; - } - - virtual void DoGetLogicalOrigin(wxCoord *x, wxCoord *y) const - { - if ( x ) *x = m_logicalOriginX; - if ( y ) *y = m_logicalOriginY; - } - - virtual void DoGetDeviceOrigin(wxCoord *x, wxCoord *y) const - { - if ( x ) *x = m_deviceOriginX; - if ( y ) *y = m_deviceOriginY; - } - - virtual void DoGetTextExtent(const wxString& string, - wxCoord *x, wxCoord *y, - wxCoord *descent = NULL, - wxCoord *externalLeading = NULL, - wxFont *theFont = NULL) const = 0; - - virtual bool DoGetPartialTextExtents(const wxString& text, wxArrayInt& widths) const; - -#if wxUSE_SPLINES - virtual void DoDrawSpline(wxList *points); -#endif - -#if wxABI_VERSION >= 20810 - // returns adjustment factor for converting wxFont "point size"; in wx - // it is point size on screen and needs to be multiplied by this value - // for rendering on higher-resolution DCs such as printer ones - static float GetFontPointSizeAdjustment(float dpi); -#endif - -protected: - // unset clipping variables (after clipping region was destroyed) - void ResetClipping() - { - m_clipping = false; - - m_clipX1 = m_clipX2 = m_clipY1 = m_clipY2 = 0; - } - - // flags - bool m_colour:1; - bool m_ok:1; - bool m_clipping:1; - bool m_isInteractive:1; - bool m_isBBoxValid:1; - - // coordinate system variables - - // TODO short descriptions of what exactly they are would be nice... - - wxCoord m_logicalOriginX, m_logicalOriginY; - wxCoord m_deviceOriginX, m_deviceOriginY; - - double m_logicalScaleX, m_logicalScaleY; - double m_userScaleX, m_userScaleY; - double m_scaleX, m_scaleY; - - // Used by SetAxisOrientation() to invert the axes - int m_signX, m_signY; - - // bounding and clipping boxes - wxCoord m_minX, m_minY, m_maxX, m_maxY; - wxCoord m_clipX1, m_clipY1, m_clipX2, m_clipY2; - - int m_logicalFunction; - int m_backgroundMode; - int m_mappingMode; - - // GDI objects - wxPen m_pen; - wxBrush m_brush; - wxBrush m_backgroundBrush; - wxColour m_textForegroundColour; - wxColour m_textBackgroundColour; - wxFont m_font; - -#if wxUSE_PALETTE - wxPalette m_palette; - bool m_hasCustomPalette; -#endif // wxUSE_PALETTE - -private: - DECLARE_NO_COPY_CLASS(wxDCBase) - DECLARE_ABSTRACT_CLASS(wxDCBase) -}; - -// ---------------------------------------------------------------------------- -// now include the declaration of wxDC class -// ---------------------------------------------------------------------------- - -#if defined(__WXPALMOS__) - #include "wx/palmos/dc.h" -#elif defined(__WXMSW__) - #include "wx/msw/dc.h" -#elif defined(__WXMOTIF__) - #include "wx/motif/dc.h" -#elif defined(__WXGTK20__) - #include "wx/gtk/dc.h" -#elif defined(__WXGTK__) - #include "wx/gtk1/dc.h" -#elif defined(__WXX11__) - #include "wx/x11/dc.h" -#elif defined(__WXMGL__) - #include "wx/mgl/dc.h" -#elif defined(__WXDFB__) - #include "wx/dfb/dc.h" -#elif defined(__WXMAC__) - #include "wx/mac/dc.h" -#elif defined(__WXCOCOA__) - #include "wx/cocoa/dc.h" -#elif defined(__WXPM__) - #include "wx/os2/dc.h" -#endif - -#if wxUSE_GRAPHICS_CONTEXT - #include "wx/dcgraph.h" -#endif - -// ---------------------------------------------------------------------------- -// helper class: you can use it to temporarily change the DC text colour and -// restore it automatically when the object goes out of scope -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxDCTextColourChanger -{ -public: - wxDCTextColourChanger(wxDC& dc) : m_dc(dc), m_colFgOld() { } - - wxDCTextColourChanger(wxDC& dc, const wxColour& col) : m_dc(dc) - { - Set(col); - } - - ~wxDCTextColourChanger() - { - if ( m_colFgOld.Ok() ) - m_dc.SetTextForeground(m_colFgOld); - } - - void Set(const wxColour& col) - { - if ( !m_colFgOld.Ok() ) - m_colFgOld = m_dc.GetTextForeground(); - m_dc.SetTextForeground(col); - } - -private: - wxDC& m_dc; - - wxColour m_colFgOld; - - DECLARE_NO_COPY_CLASS(wxDCTextColourChanger) -}; - -// ---------------------------------------------------------------------------- -// helper class: you can use it to temporarily change the DC pen and -// restore it automatically when the object goes out of scope -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxDCPenChanger -{ -public: - wxDCPenChanger(wxDC& dc, const wxPen& pen) : m_dc(dc), m_penOld(dc.GetPen()) - { - m_dc.SetPen(pen); - } - - ~wxDCPenChanger() - { - if ( m_penOld.Ok() ) - m_dc.SetPen(m_penOld); - } - -private: - wxDC& m_dc; - - wxPen m_penOld; - - DECLARE_NO_COPY_CLASS(wxDCPenChanger) -}; - -// ---------------------------------------------------------------------------- -// helper class: you can use it to temporarily change the DC brush and -// restore it automatically when the object goes out of scope -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxDCBrushChanger -{ -public: - wxDCBrushChanger(wxDC& dc, const wxBrush& brush) : m_dc(dc), m_brushOld(dc.GetBrush()) - { - m_dc.SetBrush(brush); - } - - ~wxDCBrushChanger() - { - if ( m_brushOld.Ok() ) - m_dc.SetBrush(m_brushOld); - } - -private: - wxDC& m_dc; - - wxBrush m_brushOld; - - DECLARE_NO_COPY_CLASS(wxDCBrushChanger) -}; - -// ---------------------------------------------------------------------------- -// another small helper class: sets the clipping region in its ctor and -// destroys it in the dtor -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxDCClipper -{ -public: - wxDCClipper(wxDC& dc, const wxRegion& r) : m_dc(dc) - { dc.SetClippingRegion(r); } - wxDCClipper(wxDC& dc, const wxRect& r) : m_dc(dc) - { dc.SetClippingRegion(r.x, r.y, r.width, r.height); } - wxDCClipper(wxDC& dc, wxCoord x, wxCoord y, wxCoord w, wxCoord h) : m_dc(dc) - { dc.SetClippingRegion(x, y, w, h); } - - ~wxDCClipper() { m_dc.DestroyClippingRegion(); } - -private: - wxDC& m_dc; - - DECLARE_NO_COPY_CLASS(wxDCClipper) -}; - -#endif // _WX_DC_H_BASE_ diff --git a/wxWidgets/include/wx/dcbuffer.h b/wxWidgets/include/wx/dcbuffer.h deleted file mode 100644 index 3def0b7046..0000000000 --- a/wxWidgets/include/wx/dcbuffer.h +++ /dev/null @@ -1,276 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/dcbuffer.h -// Purpose: wxBufferedDC class -// Author: Ron Lee -// Modified by: Vadim Zeitlin (refactored, added bg preservation) -// Created: 16/03/02 -// RCS-ID: $Id: dcbuffer.h 61872 2009-09-09 22:37:05Z VZ $ -// Copyright: (c) Ron Lee -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_DCBUFFER_H_ -#define _WX_DCBUFFER_H_ - -#include "wx/dcmemory.h" -#include "wx/dcclient.h" -#include "wx/window.h" - -// Split platforms into two groups - those which have well-working -// double-buffering by default, and those which do not. -#if defined(__WXMAC__) || defined(__WXGTK20__) || defined(__WXDFB__) - #define wxALWAYS_NATIVE_DOUBLE_BUFFER 1 -#else - #define wxALWAYS_NATIVE_DOUBLE_BUFFER 0 -#endif - - -// ---------------------------------------------------------------------------- -// Double buffering helper. -// ---------------------------------------------------------------------------- - -// Assumes the buffer bitmap covers the entire scrolled window, -// and prepares the window DC accordingly -#define wxBUFFER_VIRTUAL_AREA 0x01 - -// Assumes the buffer bitmap only covers the client area; -// does not prepare the window DC -#define wxBUFFER_CLIENT_AREA 0x02 - -class WXDLLEXPORT wxBufferedDC : public wxMemoryDC -{ -public: - // Default ctor, must subsequently call Init for two stage construction. - wxBufferedDC() - : m_dc(NULL), - m_buffer(NULL), - m_style(0) - { - } - - // Construct a wxBufferedDC using a user supplied buffer. - wxBufferedDC(wxDC *dc, - wxBitmap& buffer = wxNullBitmap, - int style = wxBUFFER_CLIENT_AREA) - : m_dc(NULL), m_buffer(NULL) - { - Init(dc, buffer, style); - } - - // Construct a wxBufferedDC with an internal buffer of 'area' - // (where area is usually something like the size of the window - // being buffered) - wxBufferedDC(wxDC *dc, const wxSize& area, int style = wxBUFFER_CLIENT_AREA) - : m_dc(NULL), m_buffer(NULL) - { - Init(dc, area, style); - } - - // The usually desired action in the dtor is to blit the buffer. - virtual ~wxBufferedDC() - { - if ( m_dc ) - UnMask(); - } - - // These reimplement the actions of the ctors for two stage creation - void Init(wxDC *dc, - wxBitmap& buffer = wxNullBitmap, - int style = wxBUFFER_CLIENT_AREA) - { - InitCommon(dc, style); - - m_buffer = &buffer; - - UseBuffer(); - } - - void Init(wxDC *dc, const wxSize &area, int style = wxBUFFER_CLIENT_AREA) - { - InitCommon(dc, style); - - UseBuffer(area.x, area.y); - } - - // Blits the buffer to the dc, and detaches the dc from the buffer (so it - // can be effectively used once only). - // - // Usually called in the dtor or by the dtor of derived classes if the - // BufferedDC must blit before the derived class (which may own the dc it's - // blitting to) is destroyed. - void UnMask() - { - wxCHECK_RET( m_dc, wxT("no underlying wxDC?") ); - wxASSERT_MSG( m_buffer && m_buffer->IsOk(), wxT("invalid backing store") ); - - wxCoord x = 0, - y = 0; - - if ( m_style & wxBUFFER_CLIENT_AREA ) - GetDeviceOrigin(&x, &y); - - m_dc->Blit(0, 0, m_buffer->GetWidth(), m_buffer->GetHeight(), - this, -x, -y ); - m_dc = NULL; - } - - // Set and get the style - void SetStyle(int style) { m_style = style; } - int GetStyle() const { return m_style; } - -private: - // common part of Init()s - void InitCommon(wxDC *dc, int style) - { - wxASSERT_MSG( !m_dc, wxT("wxBufferedDC already initialised") ); - - m_dc = dc; - m_style = style; - - // inherit the same layout direction as the original DC - if (dc && dc->IsOk()) - SetLayoutDirection(dc->GetLayoutDirection()); - } - - // check that the bitmap is valid and use it - void UseBuffer(wxCoord w = -1, wxCoord h = -1); - - // the underlying DC to which we copy everything drawn on this one in - // UnMask() - // - // NB: Without the existence of a wxNullDC, this must be a pointer, else it - // could probably be a reference. - wxDC *m_dc; - - // the buffer (selected in this DC), initially invalid - wxBitmap *m_buffer; - - // the buffering style - int m_style; - - DECLARE_DYNAMIC_CLASS(wxBufferedDC) - DECLARE_NO_COPY_CLASS(wxBufferedDC) -}; - - -// ---------------------------------------------------------------------------- -// Double buffered PaintDC. -// ---------------------------------------------------------------------------- - -// Creates a double buffered wxPaintDC, optionally allowing the -// user to specify their own buffer to use. -class WXDLLEXPORT wxBufferedPaintDC : public wxBufferedDC -{ -public: - // If no bitmap is supplied by the user, a temporary one will be created. - wxBufferedPaintDC(wxWindow *window, wxBitmap& buffer, int style = wxBUFFER_CLIENT_AREA) - : m_paintdc(window) - { - // If we're buffering the virtual window, scale the paint DC as well - if (style & wxBUFFER_VIRTUAL_AREA) - window->PrepareDC( m_paintdc ); - - if( buffer.IsOk() ) - Init(&m_paintdc, buffer, style); - else - Init(&m_paintdc, GetBufferedSize(window, style), style); - } - - // If no bitmap is supplied by the user, a temporary one will be created. - wxBufferedPaintDC(wxWindow *window, int style = wxBUFFER_CLIENT_AREA) - : m_paintdc(window) - { - // If we're using the virtual window, scale the paint DC as well - if (style & wxBUFFER_VIRTUAL_AREA) - window->PrepareDC( m_paintdc ); - - Init(&m_paintdc, GetBufferedSize(window, style), style); - } - - // default copy ctor ok. - - virtual ~wxBufferedPaintDC() - { - // We must UnMask here, else by the time the base class - // does it, the PaintDC will have already been destroyed. - UnMask(); - } - -protected: - // return the size needed by the buffer: this depends on whether we're - // buffering just the currently shown part or the total (scrolled) window - static wxSize GetBufferedSize(wxWindow *window, int style) - { - return style & wxBUFFER_VIRTUAL_AREA ? window->GetVirtualSize() - : window->GetClientSize(); - } - -private: - wxPaintDC m_paintdc; - - DECLARE_ABSTRACT_CLASS(wxBufferedPaintDC) - DECLARE_NO_COPY_CLASS(wxBufferedPaintDC) -}; - - - -// -// wxAutoBufferedPaintDC is a wxPaintDC in toolkits which have double- -// buffering by default. Otherwise it is a wxBufferedPaintDC. Thus, -// you can only expect it work with a simple constructor that -// accepts single wxWindow* argument. -// -#if wxALWAYS_NATIVE_DOUBLE_BUFFER - #define wxAutoBufferedPaintDCBase wxPaintDC -#else - #define wxAutoBufferedPaintDCBase wxBufferedPaintDC -#endif - - -#ifdef __WXDEBUG__ - -class wxAutoBufferedPaintDC : public wxAutoBufferedPaintDCBase -{ -public: - - wxAutoBufferedPaintDC(wxWindow* win) - : wxAutoBufferedPaintDCBase(win) - { - TestWinStyle(win); - } - - virtual ~wxAutoBufferedPaintDC() { } - -private: - - void TestWinStyle(wxWindow* win) - { - // Help the user to get the double-buffering working properly. - wxASSERT_MSG( win->GetBackgroundStyle() == wxBG_STYLE_CUSTOM, - wxT("In constructor, you need to call SetBackgroundStyle(wxBG_STYLE_CUSTOM), ") - wxT("and also, if needed, paint the background manually in the paint event handler.")); - } - - DECLARE_NO_COPY_CLASS(wxAutoBufferedPaintDC) -}; - -#else // !__WXDEBUG__ - -// In release builds, just use typedef -typedef wxAutoBufferedPaintDCBase wxAutoBufferedPaintDC; - -#endif - - -// Check if the window is natively double buffered and will return a wxPaintDC -// if it is, a wxBufferedPaintDC otherwise. It is the caller's responsibility -// to delete the wxDC pointer when finished with it. -inline wxDC* wxAutoBufferedPaintDCFactory(wxWindow* window) -{ - if ( window->IsDoubleBuffered() ) - return new wxPaintDC(window); - else - return new wxBufferedPaintDC(window); -} - -#endif // _WX_DCBUFFER_H_ diff --git a/wxWidgets/include/wx/dcclient.h b/wxWidgets/include/wx/dcclient.h deleted file mode 100644 index c8bc31a151..0000000000 --- a/wxWidgets/include/wx/dcclient.h +++ /dev/null @@ -1,42 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/dcclient.h -// Purpose: wxClientDC base header -// Author: Julian Smart -// Modified by: -// Created: -// Copyright: (c) Julian Smart -// RCS-ID: $Id: dcclient.h 40865 2006-08-27 09:42:42Z VS $ -// Licence: wxWindows Licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_DCCLIENT_H_BASE_ -#define _WX_DCCLIENT_H_BASE_ - -#include "wx/defs.h" - -#if defined(__WXPALMOS__) -#include "wx/palmos/dcclient.h" -#elif defined(__WXMSW__) -#include "wx/msw/dcclient.h" -#elif defined(__WXMOTIF__) -#include "wx/motif/dcclient.h" -#elif defined(__WXGTK20__) -#include "wx/gtk/dcclient.h" -#elif defined(__WXGTK__) -#include "wx/gtk1/dcclient.h" -#elif defined(__WXX11__) -#include "wx/x11/dcclient.h" -#elif defined(__WXMGL__) -#include "wx/mgl/dcclient.h" -#elif defined(__WXDFB__) -#include "wx/dfb/dcclient.h" -#elif defined(__WXMAC__) -#include "wx/mac/dcclient.h" -#elif defined(__WXCOCOA__) -#include "wx/cocoa/dcclient.h" -#elif defined(__WXPM__) -#include "wx/os2/dcclient.h" -#endif - -#endif - // _WX_DCCLIENT_H_BASE_ diff --git a/wxWidgets/include/wx/dcgraph.h b/wxWidgets/include/wx/dcgraph.h deleted file mode 100644 index e94996657f..0000000000 --- a/wxWidgets/include/wx/dcgraph.h +++ /dev/null @@ -1,190 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/graphdc.h -// Purpose: graphics context device bridge header -// Author: Stefan Csomor -// Modified by: -// Created: -// Copyright: (c) Stefan Csomor -// RCS-ID: $Id: dcgraph.h 53390 2008-04-28 04:19:15Z KO $ -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_GRAPHICS_DC_H_ -#define _WX_GRAPHICS_DC_H_ - -#if wxUSE_GRAPHICS_CONTEXT - -#include "wx/geometry.h" -#include "wx/dynarray.h" -#include "wx/graphics.h" - -class WXDLLEXPORT wxWindowDC; - -#ifdef __WXMAC__ -#define wxGCDC wxDC -#endif - -class WXDLLEXPORT wxGCDC: -#ifdef __WXMAC__ - public wxDCBase -#else - public wxDC -#endif -{ - DECLARE_DYNAMIC_CLASS(wxGCDC) - DECLARE_NO_COPY_CLASS(wxGCDC) - -public: - wxGCDC(const wxWindowDC& dc); -#ifdef __WXMSW__ - wxGCDC( const wxMemoryDC& dc); -#endif - wxGCDC(); - virtual ~wxGCDC(); - - void Init(); - - - // implement base class pure virtuals - // ---------------------------------- - - virtual void Clear(); - - virtual bool StartDoc( const wxString& message ); - virtual void EndDoc(); - - virtual void StartPage(); - virtual void EndPage(); - - // to be virtualized on next major - // flushing the content of this dc immediately onto screen - void Flush(); - - 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 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); - - virtual void ComputeScaleAndOrigin(); - - wxGraphicsContext* GetGraphicsContext() { return m_graphicContext; } - virtual void SetGraphicsContext( wxGraphicsContext* ctx ); - -protected: - // the true implementations - virtual bool DoFloodFill(wxCoord x, wxCoord y, const wxColour& col, - int style = wxFLOOD_SURFACE); - - virtual void DoGradientFillLinear(const wxRect& rect, - const wxColour& initialColour, - const wxColour& destColour, - wxDirection nDirection = wxEAST); - - virtual void DoGradientFillConcentric(const wxRect& rect, - const wxColour& initialColour, - const wxColour& destColour, - const wxPoint& circleCenter); - - virtual bool DoGetPixel(wxCoord x, wxCoord y, wxColour *col) const; - - virtual void DoDrawPoint(wxCoord x, wxCoord y); - -#if wxUSE_SPLINES - virtual void DoDrawSpline(wxList *points); -#endif - - 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 DoDrawCheckMark(wxCoord x, wxCoord y, - wxCoord width, wxCoord height); - - 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); - - virtual void DoGetSize(int *,int *) const; - 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); - virtual void DoDrawPolyPolygon(int n, int count[], wxPoint points[], - wxCoord xoffset, wxCoord yoffset, - int fillStyle); - - virtual void DoSetClippingRegionAsRegion(const wxRegion& region); - virtual void DoSetClippingRegion(wxCoord x, wxCoord y, - wxCoord width, wxCoord height); - - 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; - -protected: - // scaling variables - bool m_logicalFunctionSupported; - double m_mm_to_pix_x, m_mm_to_pix_y; - wxGraphicsMatrix m_matrixOriginal; - wxGraphicsMatrix m_matrixCurrent; - - double m_formerScaleX, m_formerScaleY; - - wxGraphicsContext* m_graphicContext; -}; - -#endif - -#endif // _WX_GRAPHICS_DC_H_ diff --git a/wxWidgets/include/wx/dcmemory.h b/wxWidgets/include/wx/dcmemory.h deleted file mode 100644 index 68d4355ac9..0000000000 --- a/wxWidgets/include/wx/dcmemory.h +++ /dev/null @@ -1,76 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/dcmemory.h -// Purpose: wxMemoryDC base header -// Author: Julian Smart -// Modified by: -// Created: -// Copyright: (c) Julian Smart -// RCS-ID: $Id: dcmemory.h 43843 2006-12-07 05:44:44Z PC $ -// Licence: wxWindows Licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_DCMEMORY_H_BASE_ -#define _WX_DCMEMORY_H_BASE_ - -#include "wx/bitmap.h" - -// NOTE: different native implementations of wxMemoryDC will derive from -// different wxDC classes (wxPaintDC, wxWindowDC, etc), so that -// we cannot derive wxMemoryDCBase from wxDC and then use it as the -// only base class for native impl of wxMemoryDC... -class WXDLLEXPORT wxMemoryDCBase -{ -public: - wxMemoryDCBase() { } - - // avoid warnings about having virtual functions but non virtual dtor - virtual ~wxMemoryDCBase() { } - - // select the given bitmap to draw on it - void SelectObject(wxBitmap& bmp) - { - // make sure that the given wxBitmap is not sharing its data with other - // wxBitmap instances as its contents will be modified by any drawing - // operation done on this DC - if (bmp.IsOk()) - bmp.UnShare(); - - DoSelect(bmp); - } - - // select the given bitmap for read-only - virtual void SelectObjectAsSource(const wxBitmap& bmp) - { - DoSelect(bmp); - } - -protected: - virtual void DoSelect(const wxBitmap& bmp) = 0; -}; - -#if defined(__WXPALMOS__) -#include "wx/palmos/dcmemory.h" -#elif defined(__WXMSW__) -#include "wx/msw/dcmemory.h" -#elif defined(__WXMOTIF__) -#include "wx/motif/dcmemory.h" -#elif defined(__WXGTK20__) -#include "wx/gtk/dcmemory.h" -#elif defined(__WXGTK__) -#include "wx/gtk1/dcmemory.h" -#elif defined(__WXX11__) -#include "wx/x11/dcmemory.h" -#elif defined(__WXMGL__) -#include "wx/mgl/dcmemory.h" -#elif defined(__WXDFB__) -#include "wx/dfb/dcmemory.h" -#elif defined(__WXMAC__) -#include "wx/mac/dcmemory.h" -#elif defined(__WXCOCOA__) -#include "wx/cocoa/dcmemory.h" -#elif defined(__WXPM__) -#include "wx/os2/dcmemory.h" -#endif - -#endif - // _WX_DCMEMORY_H_BASE_ diff --git a/wxWidgets/include/wx/dcmirror.h b/wxWidgets/include/wx/dcmirror.h deleted file mode 100644 index 24d989f78a..0000000000 --- a/wxWidgets/include/wx/dcmirror.h +++ /dev/null @@ -1,287 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: wx/dcmirror.h -// Purpose: wxMirrorDC class -// Author: Vadim Zeitlin -// Modified by: -// Created: 21.07.2003 -// RCS-ID: $Id: dcmirror.h 61872 2009-09-09 22:37:05Z VZ $ -// Copyright: (c) 2003 Vadim Zeitlin -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_DCMIRROR_H_ -#define _WX_DCMIRROR_H_ - -#include "wx/dc.h" - -// ---------------------------------------------------------------------------- -// wxMirrorDC allows to write the same code for horz/vertical layout -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxMirrorDC : public wxDC -{ -public: - // constructs a mirror DC associated with the given real DC - // - // if mirror parameter is true, all vertical and horizontal coordinates are - // exchanged, otherwise this class behaves in exactly the same way as a - // plain DC - // - // the cast to wxMirrorDC is a dirty hack done to allow us to call the - // protected methods of wxDCBase directly in our code below, without it it - // would be impossible (this is correct from C++ point of view but doesn't - // make any sense in this particular situation) - wxMirrorDC(wxDC& dc, bool mirror) : m_dc((wxMirrorDC&)dc) - { m_mirror = mirror; } - - // wxDCBase operations - virtual void Clear() { m_dc.Clear(); } - virtual void SetFont(const wxFont& font) { m_dc.SetFont(font); } - virtual void SetPen(const wxPen& pen) { m_dc.SetPen(pen); } - virtual void SetBrush(const wxBrush& brush) { m_dc.SetBrush(brush); } - virtual void SetBackground(const wxBrush& brush) - { m_dc.SetBackground(brush); } - virtual void SetBackgroundMode(int mode) { m_dc.SetBackgroundMode(mode); } -#if wxUSE_PALETTE - virtual void SetPalette(const wxPalette& palette) - { m_dc.SetPalette(palette); } -#endif // wxUSE_PALETTE - virtual void DestroyClippingRegion() { m_dc.DestroyClippingRegion(); } - virtual wxCoord GetCharHeight() const { return m_dc.GetCharHeight(); } - virtual wxCoord GetCharWidth() const { return m_dc.GetCharWidth(); } - virtual bool CanDrawBitmap() const { return m_dc.CanDrawBitmap(); } - virtual bool CanGetTextExtent() const { return m_dc.CanGetTextExtent(); } - virtual int GetDepth() const { return m_dc.GetDepth(); } - virtual wxSize GetPPI() const { return m_dc.GetPPI(); } - virtual bool Ok() const { return IsOk(); } - virtual bool IsOk() const { return m_dc.Ok(); } - virtual void SetMapMode(int mode) { m_dc.SetMapMode(mode); } - virtual void SetUserScale(double x, double y) - { m_dc.SetUserScale(GetX(x, y), GetY(x, y)); } - virtual void SetLogicalOrigin(wxCoord x, wxCoord y) - { m_dc.SetLogicalOrigin(GetX(x, y), GetY(x, y)); } - virtual void SetDeviceOrigin(wxCoord x, wxCoord y) - { m_dc.SetDeviceOrigin(GetX(x, y), GetY(x, y)); } - virtual void SetAxisOrientation(bool xLeftRight, bool yBottomUp) - { m_dc.SetAxisOrientation(GetX(xLeftRight, yBottomUp), - GetY(xLeftRight, yBottomUp)); } - virtual void SetLogicalFunction(int function) - { m_dc.SetLogicalFunction(function); } - - // helper functions which may be useful for the users of this class - wxSize Reflect(const wxSize& sizeOrig) - { - return m_mirror ? wxSize(sizeOrig.y, sizeOrig.x) : sizeOrig; - } - -protected: - // returns x and y if not mirroring or y and x if mirroring - wxCoord GetX(wxCoord x, wxCoord y) const { return m_mirror ? y : x; } - wxCoord GetY(wxCoord x, wxCoord y) const { return m_mirror ? x : y; } - double GetX(double x, double y) const { return m_mirror ? y : x; } - double GetY(double x, double y) const { return m_mirror ? x : y; } - bool GetX(bool x, bool y) const { return m_mirror ? y : x; } - bool GetY(bool x, bool y) const { return m_mirror ? x : y; } - - // same thing but for pointers - wxCoord *GetX(wxCoord *x, wxCoord *y) const { return m_mirror ? y : x; } - wxCoord *GetY(wxCoord *x, wxCoord *y) const { return m_mirror ? x : y; } - - // exchange x and y unconditionally - static void Swap(wxCoord& x, wxCoord& y) - { - wxCoord t = x; - x = y; - y = t; - } - - // exchange x and y components of all points in the array if necessary - void Mirror(int n, wxPoint points[]) const - { - if ( m_mirror ) - { - for ( int i = 0; i < n; i++ ) - { - Swap(points[i].x, points[i].y); - } - } - } - - - // wxDCBase functions - virtual bool DoFloodFill(wxCoord x, wxCoord y, const wxColour& col, - int style = wxFLOOD_SURFACE) - { - return m_dc.DoFloodFill(GetX(x, y), GetY(x, y), col, style); - } - - virtual bool DoGetPixel(wxCoord x, wxCoord y, wxColour *col) const - { - return m_dc.DoGetPixel(GetX(x, y), GetY(x, y), col); - } - - - virtual void DoDrawPoint(wxCoord x, wxCoord y) - { - m_dc.DoDrawPoint(GetX(x, y), GetY(x, y)); - } - - virtual void DoDrawLine(wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2) - { - m_dc.DoDrawLine(GetX(x1, y1), GetY(x1, y1), GetX(x2, y2), GetY(x2, y2)); - } - - virtual void DoDrawArc(wxCoord x1, wxCoord y1, - wxCoord x2, wxCoord y2, - wxCoord xc, wxCoord yc) - { - wxFAIL_MSG( wxT("this is probably wrong") ); - - m_dc.DoDrawArc(GetX(x1, y1), GetY(x1, y1), - GetX(x2, y2), GetY(x2, y2), - xc, yc); - } - - virtual void DoDrawCheckMark(wxCoord x, wxCoord y, - wxCoord w, wxCoord h) - { - m_dc.DoDrawCheckMark(GetX(x, y), GetY(x, y), - GetX(w, h), GetY(w, h)); - } - - virtual void DoDrawEllipticArc(wxCoord x, wxCoord y, wxCoord w, wxCoord h, - double sa, double ea) - { - wxFAIL_MSG( wxT("this is probably wrong") ); - - m_dc.DoDrawEllipticArc(GetX(x, y), GetY(x, y), - GetX(w, h), GetY(w, h), - sa, ea); - } - - virtual void DoDrawRectangle(wxCoord x, wxCoord y, wxCoord w, wxCoord h) - { - m_dc.DoDrawRectangle(GetX(x, y), GetY(x, y), GetX(w, h), GetY(w, h)); - } - - virtual void DoDrawRoundedRectangle(wxCoord x, wxCoord y, - wxCoord w, wxCoord h, - double radius) - { - m_dc.DoDrawRoundedRectangle(GetX(x, y), GetY(x, y), - GetX(w, h), GetY(w, h), - radius); - } - - virtual void DoDrawEllipse(wxCoord x, wxCoord y, wxCoord w, wxCoord h) - { - m_dc.DoDrawEllipse(GetX(x, y), GetY(x, y), GetX(w, h), GetY(w, h)); - } - - virtual void DoCrossHair(wxCoord x, wxCoord y) - { - m_dc.DoCrossHair(GetX(x, y), GetY(x, y)); - } - - virtual void DoDrawIcon(const wxIcon& icon, wxCoord x, wxCoord y) - { - m_dc.DoDrawIcon(icon, GetX(x, y), GetY(x, y)); - } - - virtual void DoDrawBitmap(const wxBitmap &bmp, wxCoord x, wxCoord y, - bool useMask = false) - { - m_dc.DoDrawBitmap(bmp, GetX(x, y), GetY(x, y), useMask); - } - - virtual void DoDrawText(const wxString& text, wxCoord x, wxCoord y) - { - // this is never mirrored - m_dc.DoDrawText(text, x, y); - } - - virtual void DoDrawRotatedText(const wxString& text, - wxCoord x, wxCoord y, double angle) - { - // this is never mirrored - m_dc.DoDrawRotatedText(text, x, y, angle); - } - - virtual bool DoBlit(wxCoord xdest, wxCoord ydest, - wxCoord w, wxCoord h, - wxDC *source, wxCoord xsrc, wxCoord ysrc, - int rop = wxCOPY, bool useMask = false, - wxCoord xsrcMask = wxDefaultCoord, wxCoord ysrcMask = wxDefaultCoord) - { - return m_dc.DoBlit(GetX(xdest, ydest), GetY(xdest, ydest), - GetX(w, h), GetY(w, h), - source, GetX(xsrc, ysrc), GetY(xsrc, ysrc), - rop, useMask, - GetX(xsrcMask, ysrcMask), GetX(xsrcMask, ysrcMask)); - } - - virtual void DoGetSize(int *w, int *h) const - { - m_dc.DoGetSize(GetX(w, h), GetY(w, h)); - } - - virtual void DoGetSizeMM(int *w, int *h) const - { - m_dc.DoGetSizeMM(GetX(w, h), GetY(w, h)); - } - - virtual void DoDrawLines(int n, wxPoint points[], - wxCoord xoffset, wxCoord yoffset) - { - Mirror(n, points); - - m_dc.DoDrawLines(n, points, - GetX(xoffset, yoffset), GetY(xoffset, yoffset)); - - Mirror(n, points); - } - - virtual void DoDrawPolygon(int n, wxPoint points[], - wxCoord xoffset, wxCoord yoffset, - int fillStyle = wxODDEVEN_RULE) - { - Mirror(n, points); - - m_dc.DoDrawPolygon(n, points, - GetX(xoffset, yoffset), GetY(xoffset, yoffset), - fillStyle); - - Mirror(n, points); - } - - virtual void DoSetClippingRegionAsRegion(const wxRegion& WXUNUSED(region)) - { - wxFAIL_MSG( wxT("not implemented") ); - } - - virtual void DoSetClippingRegion(wxCoord x, wxCoord y, - wxCoord w, wxCoord h) - { - m_dc.DoSetClippingRegion(GetX(x, y), GetY(x, y), GetX(w, h), GetY(w, h)); - } - - virtual void DoGetTextExtent(const wxString& string, - wxCoord *x, wxCoord *y, - wxCoord *descent = NULL, - wxCoord *externalLeading = NULL, - wxFont *theFont = NULL) const - { - // never mirrored - m_dc.DoGetTextExtent(string, x, y, descent, externalLeading, theFont); - } - -private: - wxMirrorDC& m_dc; - - bool m_mirror; - - DECLARE_NO_COPY_CLASS(wxMirrorDC) -}; - -#endif // _WX_DCMIRROR_H_ - diff --git a/wxWidgets/include/wx/dcprint.h b/wxWidgets/include/wx/dcprint.h deleted file mode 100644 index 5a40911d18..0000000000 --- a/wxWidgets/include/wx/dcprint.h +++ /dev/null @@ -1,33 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/dcprint.h -// Purpose: wxPrinterDC base header -// Author: Julian Smart -// Modified by: -// Created: -// Copyright: (c) Julian Smart -// RCS-ID: $Id: dcprint.h 41240 2006-09-15 16:45:48Z PC $ -// Licence: wxWindows Licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_DCPRINT_H_BASE_ -#define _WX_DCPRINT_H_BASE_ - -#include "wx/defs.h" - -#if wxUSE_PRINTING_ARCHITECTURE - -#if defined(__WXPALMOS__) -#include "wx/palmos/dcprint.h" -#elif defined(__WXMSW__) -#include "wx/msw/dcprint.h" -#endif -#if defined(__WXPM__) -#include "wx/os2/dcprint.h" -#endif -#if defined(__WXMAC__) -#include "wx/mac/dcprint.h" -#endif - -#endif // wxUSE_PRINTING_ARCHITECTURE -#endif - // _WX_DCPRINT_H_BASE_ diff --git a/wxWidgets/include/wx/dcps.h b/wxWidgets/include/wx/dcps.h deleted file mode 100644 index 2615d33243..0000000000 --- a/wxWidgets/include/wx/dcps.h +++ /dev/null @@ -1,18 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/dcps.h -// Purpose: wxPostScriptDC base header -// Author: Julian Smart -// Modified by: -// Created: -// Copyright: (c) Julian Smart -// RCS-ID: $Id: dcps.h 33948 2005-05-04 18:57:50Z JS $ -// Licence: wxWindows Licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_DCPS_H_BASE_ -#define _WX_DCPS_H_BASE_ - -#include "wx/generic/dcpsg.h" - -#endif - diff --git a/wxWidgets/include/wx/dcscreen.h b/wxWidgets/include/wx/dcscreen.h deleted file mode 100644 index 7e59787efa..0000000000 --- a/wxWidgets/include/wx/dcscreen.h +++ /dev/null @@ -1,42 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/dcscreen.h -// Purpose: wxScreenDC base header -// Author: Julian Smart -// Modified by: -// Created: -// Copyright: (c) Julian Smart -// RCS-ID: $Id: dcscreen.h 40865 2006-08-27 09:42:42Z VS $ -// Licence: wxWindows Licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_DCSCREEN_H_BASE_ -#define _WX_DCSCREEN_H_BASE_ - -#include "wx/defs.h" - -#if defined(__WXPALMOS__) -#include "wx/palmos/dcscreen.h" -#elif defined(__WXMSW__) -#include "wx/msw/dcscreen.h" -#elif defined(__WXMOTIF__) -#include "wx/motif/dcscreen.h" -#elif defined(__WXGTK20__) -#include "wx/gtk/dcscreen.h" -#elif defined(__WXGTK__) -#include "wx/gtk1/dcscreen.h" -#elif defined(__WXX11__) -#include "wx/x11/dcscreen.h" -#elif defined(__WXMGL__) -#include "wx/mgl/dcscreen.h" -#elif defined(__WXDFB__) -#include "wx/dfb/dcscreen.h" -#elif defined(__WXMAC__) -#include "wx/mac/dcscreen.h" -#elif defined(__WXCOCOA__) -#include "wx/cocoa/dcscreen.h" -#elif defined(__WXPM__) -#include "wx/os2/dcscreen.h" -#endif - -#endif - // _WX_DCSCREEN_H_BASE_ diff --git a/wxWidgets/include/wx/dde.h b/wxWidgets/include/wx/dde.h deleted file mode 100644 index 402a6ec70d..0000000000 --- a/wxWidgets/include/wx/dde.h +++ /dev/null @@ -1,32 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/dde.h -// Purpose: DDE base header -// Author: Julian Smart -// Modified by: -// Created: -// Copyright: (c) Julian Smart -// RCS-ID: $Id: dde.h 53135 2008-04-12 02:31:04Z VZ $ -// Licence: wxWindows Licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_DDE_H_BASE_ -#define _WX_DDE_H_BASE_ - -#include "wx/list.h" - -class WXDLLIMPEXP_FWD_BASE wxDDEClient; -class WXDLLIMPEXP_FWD_BASE wxDDEServer; -class WXDLLIMPEXP_FWD_BASE wxDDEConnection; - -WX_DECLARE_USER_EXPORTED_LIST(wxDDEClient, wxDDEClientList, WXDLLIMPEXP_BASE); -WX_DECLARE_USER_EXPORTED_LIST(wxDDEServer, wxDDEServerList, WXDLLIMPEXP_BASE); -WX_DECLARE_USER_EXPORTED_LIST(wxDDEConnection, wxDDEConnectionList, WXDLLIMPEXP_BASE); - -#if defined(__WXMSW__) - #include "wx/msw/dde.h" -#else - #error DDE is only supported on MSW -#endif - -#endif - // _WX_DDE_H_BASE_ diff --git a/wxWidgets/include/wx/debug.h b/wxWidgets/include/wx/debug.h deleted file mode 100644 index 41294e4ae2..0000000000 --- a/wxWidgets/include/wx/debug.h +++ /dev/null @@ -1,316 +0,0 @@ -/** -* Name: wx/debug.h -* Purpose: Misc debug functions and macros -* Author: Vadim Zeitlin -* Modified by: Ryan Norton (Converted to C) -* Created: 29/01/98 -* RCS-ID: $Id: debug.h 61872 2009-09-09 22:37:05Z VZ $ -* Copyright: (c) 1998 Vadim Zeitlin -* Licence: wxWindows licence -*/ - -/* THIS IS A C FILE, DON'T USE C++ FEATURES (IN PARTICULAR COMMENTS) IN IT */ - -#ifndef _WX_DEBUG_H_ -#define _WX_DEBUG_H_ - -#ifndef __WXWINCE__ -#include -#endif -#include /* for CHAR_BIT used below */ - -#include "wx/wxchar.h" /* for __TFILE__ and wxChar */ - -/* ---------------------------------------------------------------------------- */ -/* Defines controlling the debugging macros */ -/* ---------------------------------------------------------------------------- */ - -/* if _DEBUG is defined (MS VC++ and others use it in debug builds), define */ -/* __WXDEBUG__ too */ -#ifdef _DEBUG - #ifndef __WXDEBUG__ - #define __WXDEBUG__ - #endif /* !__WXDEBUG__ */ -#endif /* _DEBUG */ - -/* if NDEBUG is defined ( uses it), undef __WXDEBUG__ and WXDEBUG */ -#ifdef NDEBUG - #undef __WXDEBUG__ - #undef WXDEBUG -#endif /* NDEBUG */ - -/* if __WXDEBUG__ is defined, make sure that WXDEBUG is defined and >= 1 */ -#ifdef __WXDEBUG__ - #if !defined(WXDEBUG) || !WXDEBUG - #undef WXDEBUG - #define WXDEBUG 1 - #endif /* !WXDEBUG */ -#endif /* __WXDEBUG__ */ - -#ifndef __WXFUNCTION__ - /* TODO: add more compilers supporting __FUNCTION__ */ - #if defined(__DMC__) - /* - __FUNCTION__ happens to be not defined within class members - http://www.digitalmars.com/drn-bin/wwwnews?c%2B%2B.beta/485 - */ - #define __WXFUNCTION__ (NULL) - #elif defined(__GNUC__) || \ - (defined(_MSC_VER) && _MSC_VER >= 1300) || \ - defined(__FUNCTION__) - #define __WXFUNCTION__ __FUNCTION__ - #else - /* still define __WXFUNCTION__ to avoid #ifdefs elsewhere */ - #define __WXFUNCTION__ (NULL) - #endif -#endif /* __WXFUNCTION__ already defined */ - -/* ---------------------------------------------------------------------------- */ -/* Debugging macros */ -/* */ -/* All debugging macros rely on ASSERT() which in turn calls the user-defined */ -/* OnAssert() function. To keep things simple, it's called even when the */ -/* expression is true (i.e. everything is ok) and by default does nothing: just */ -/* returns the same value back. But if you redefine it to do something more sexy */ -/* (popping up a message box in your favourite GUI, sending you e-mail or */ -/* whatever) it will affect all ASSERTs, FAILs and CHECKs in your code. */ -/* */ -/* Warning: if you don't like advice on programming style, don't read */ -/* further! ;-) */ -/* */ -/* Extensive use of these macros is recommended! Remember that ASSERTs are */ -/* disabled in final build (without __WXDEBUG__ defined), so they add strictly */ -/* nothing to your program's code. On the other hand, CHECK macros do stay */ -/* even in release builds, but in general are not much of a burden, while */ -/* a judicious use of them might increase your program's stability. */ -/* ---------------------------------------------------------------------------- */ - -/* Macros which are completely disabled in 'release' mode */ -/* */ -/* NB: these functions are implemented in src/common/appcmn.cpp */ -#if defined(__cplusplus) && defined(__WXDEBUG__) - /* - This function is called whenever one of debugging macros fails (i.e. - condition is false in an assertion). To customize its behaviour, override - wxApp::OnAssert(). - - Parameters: - szFile and nLine - file name and line number of the ASSERT - szFunc - function name of the ASSERT, may be NULL (NB: ASCII) - szCond - text form of the condition which failed - szMsg - optional message explaining the reason - */ - extern void WXDLLIMPEXP_BASE wxOnAssert(const wxChar *szFile, - int nLine, - const char *szFunc, - const wxChar *szCond, - const wxChar *szMsg = NULL); - - /* call this function to break into the debugger unconditionally (assuming */ - /* the program is running under debugger, of course) */ - extern void WXDLLIMPEXP_BASE wxTrap(); - - /* generic assert macro */ - #define wxASSERT(cond) wxASSERT_MSG(cond, NULL) - - - /* assert with additional message explaining its cause */ - - /* compilers can give a warning (such as "possible unwanted ;") when using */ - /* the default definition of wxASSERT_MSG so we provide an alternative */ - #if defined(__MWERKS__) - #define wxASSERT_MSG(cond, msg) \ - if ( cond ) \ - {} \ - else \ - wxOnAssert(__TFILE__, __LINE__, __WXFUNCTION__, wxT(#cond), msg) - #else - #define wxASSERT_MSG(cond, msg) \ - if ( cond ) \ - ; \ - else \ - wxOnAssert(__TFILE__, __LINE__, __WXFUNCTION__, wxT(#cond), msg) - #endif - - /* special form of assert: always triggers it (in debug mode) */ - #define wxFAIL wxFAIL_MSG(NULL) - - /* FAIL with some message */ - #define wxFAIL_MSG(msg) wxFAIL_COND_MSG("wxAssertFailure", msg) - - /* FAIL with some message and a condition */ - #define wxFAIL_COND_MSG(cond, msg) \ - wxOnAssert(__TFILE__, __LINE__, __WXFUNCTION__, wxT(cond), msg) - - /* An assert helper used to avoid warning when testing constant expressions, */ - /* i.e. wxASSERT( sizeof(int) == 4 ) can generate a compiler warning about */ - /* expression being always true, but not using */ - /* wxASSERT( wxAssertIsEqual(sizeof(int), 4) ) */ - /* */ - /* NB: this is made obsolete by wxCOMPILE_TIME_ASSERT() and should no */ - /* longer be used. */ - extern bool WXDLLIMPEXP_BASE wxAssertIsEqual(int x, int y); -#else - #define wxTrap() - - /* nothing to do in release mode (hopefully at this moment there are */ - /* no more bugs ;-) */ - #define wxASSERT(cond) - #define wxASSERT_MSG(cond, msg) - #define wxFAIL - #define wxFAIL_MSG(msg) - #define wxFAIL_COND_MSG(cond, msg) -#endif /* __WXDEBUG__ */ - -#ifdef __cplusplus - /* Use of wxFalse instead of false suppresses compiler warnings about testing */ - /* constant expression */ - extern WXDLLIMPEXP_DATA_BASE(const bool) wxFalse; -#endif - -#define wxAssertFailure wxFalse - -/* NB: the following macros also work in release mode! */ - -/* - These macros must be used only in invalid situation: for example, an - invalid parameter (e.g. a NULL pointer) is passed to a function. Instead of - dereferencing it and causing core dump the function might try using - CHECK( p != NULL ) or CHECK( p != NULL, return LogError("p is NULL!!") ) -*/ - -/* check that expression is true, "return" if not (also FAILs in debug mode) */ -#define wxCHECK(cond, rc) wxCHECK_MSG(cond, rc, NULL) - -/* as wxCHECK but with a message explaining why we fail */ -#define wxCHECK_MSG(cond, rc, msg) wxCHECK2_MSG(cond, return rc, msg) - -/* check that expression is true, perform op if not */ -#define wxCHECK2(cond, op) wxCHECK2_MSG(cond, op, NULL) - -/* as wxCHECK2 but with a message explaining why we fail */ - -#ifdef __GNUC__ - #define wxFORCE_SEMICOLON typedef int wxDummyCheckInt - /* Note: old gcc versions (e.g. 2.8) give an internal compiler error */ - /* on a simple forward declaration, when used in a template */ - /* function, so rather use a dummy typedef which does work... */ -#else - #define wxFORCE_SEMICOLON struct wxDummyCheckStruct - /* Note2: however, some other compilers (notably Digital Mars */ - /* don't like multiple typedefs (even though the standard */ - /* does allow them), so use a forward declaration for non-gcc. */ -#endif -/* see comment near the definition of wxASSERT_MSG for the # if/else reason */ -#if defined(__MWERKS__) - #define wxCHECK2_MSG(cond, op, msg) \ - if ( cond ) \ - {} \ - else \ - { \ - wxFAIL_COND_MSG(#cond, msg); \ - op; \ - } \ - struct wxDummyCheckStruct /* just to force a semicolon */ -#else - #define wxCHECK2_MSG(cond, op, msg) \ - if ( cond ) \ - ; \ - else \ - { \ - wxFAIL_COND_MSG(#cond, msg); \ - op; \ - } \ - wxFORCE_SEMICOLON /* just to force a semicolon */ -#endif - -/* special form of wxCHECK2: as wxCHECK, but for use in void functions */ -/* */ -/* NB: there is only one form (with msg parameter) and it's intentional: */ -/* there is no other way to tell the caller what exactly went wrong */ -/* from the void function (of course, the function shouldn't be void */ -/* to begin with...) */ -#define wxCHECK_RET(cond, msg) wxCHECK2_MSG(cond, return, msg) - -/* ---------------------------------------------------------------------------- */ -/* Compile time asserts */ -/* */ -/* Unlike the normal assert and related macros above which are checked during */ -/* the program tun-time the macros below will result in a compilation error if */ -/* the condition they check is false. This is usually used to check the */ -/* expressions containing sizeof()s which cannot be tested with the */ -/* preprocessor. If you can use the #if's, do use them as you can give a more */ -/* detailed error message then. */ -/* ---------------------------------------------------------------------------- */ - -/* - How this works (you don't have to understand it to be able to use the - macros): we rely on the fact that it is invalid to define a named bit field - in a struct of width 0. All the rest are just the hacks to minimize the - possibility of the compiler warnings when compiling this macro: in - particular, this is why we define a struct and not an object (which would - result in a warning about unused variable) and a named struct (otherwise we'd - get a warning about an unnamed struct not used to define an object!). - */ - -#define wxMAKE_UNIQUE_ASSERT_NAME wxMAKE_UNIQUE_NAME(wxAssert_) - -/* - The second argument of this macro must be a valid C++ identifier and not a - string. I.e. you should use it like this: - - wxCOMPILE_TIME_ASSERT( sizeof(int) >= 2, YourIntsAreTooSmall ); - - It may be used both within a function and in the global scope. -*/ -#if defined(__WATCOMC__) && defined(__cplusplus) - /* avoid "unused symbol" warning */ - #define wxCOMPILE_TIME_ASSERT(expr, msg) \ - class wxMAKE_UNIQUE_ASSERT_NAME { \ - unsigned int msg: expr; \ - wxMAKE_UNIQUE_ASSERT_NAME() { wxUnusedVar(msg); } \ - } -#else - #define wxCOMPILE_TIME_ASSERT(expr, msg) \ - struct wxMAKE_UNIQUE_ASSERT_NAME { unsigned int msg: expr; } -#endif - -/* - When using VC++ 6 with "Edit and Continue" on, the compiler completely - mishandles __LINE__ and so wxCOMPILE_TIME_ASSERT() doesn't work, provide a - way to make "unique" assert names by specifying a unique prefix explicitly - */ -#define wxMAKE_UNIQUE_ASSERT_NAME2(text) wxCONCAT(wxAssert_, text) - -#define wxCOMPILE_TIME_ASSERT2(expr, msg, text) \ - struct wxMAKE_UNIQUE_ASSERT_NAME2(text) { unsigned int msg: expr; } - -/* helpers for wxCOMPILE_TIME_ASSERT below, for private use only */ -#define wxMAKE_BITSIZE_MSG(type, size) type ## SmallerThan ## size ## Bits - -/* a special case of compile time assert: check that the size of the given type */ -/* is at least the given number of bits */ -#define wxASSERT_MIN_BITSIZE(type, size) \ - wxCOMPILE_TIME_ASSERT(sizeof(type) * CHAR_BIT >= size, \ - wxMAKE_BITSIZE_MSG(type, size)) - -/* ---------------------------------------------------------------------------- */ -/* other miscellaneous debugger-related functions */ -/* ---------------------------------------------------------------------------- */ - -/* - Return true if we're running under debugger. - - Currently this only really works under Win32 and Mac in CodeWarrior builds, - it always returns false in other cases. - */ -#ifdef __cplusplus - /* ABX: check __WIN32__ instead of __WXMSW__ for the same MSWBase in any Win32 port */ - #if defined(__WXMAC__) || defined(__WIN32__) - extern bool WXDLLIMPEXP_BASE wxIsDebuggerRunning(); - #else /* !Mac */ - inline bool wxIsDebuggerRunning() { return false; } - #endif /* Mac/!Mac */ -#endif /* __cplusplus */ - -#endif /* _WX_DEBUG_H_ */ diff --git a/wxWidgets/include/wx/debugrpt.h b/wxWidgets/include/wx/debugrpt.h deleted file mode 100644 index c9bcd8c2bc..0000000000 --- a/wxWidgets/include/wx/debugrpt.h +++ /dev/null @@ -1,235 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: wx/debugrpt.h -// Purpose: declaration of wxDebugReport class -// Author: Vadim Zeitlin -// Created: 2005-01-17 -// RCS-ID: $Id: debugrpt.h 61872 2009-09-09 22:37:05Z VZ $ -// Copyright: (c) 2005 Vadim Zeitlin -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_DEBUGRPT_H_ -#define _WX_DEBUGRPT_H_ - -#include "wx/defs.h" - -#if wxUSE_DEBUGREPORT && wxUSE_XML - -#include "wx/string.h" -#include "wx/arrstr.h" - -class WXDLLIMPEXP_FWD_XML wxXmlNode; - -// ---------------------------------------------------------------------------- -// wxDebugReport: generate a debug report, processing is done in derived class -// ---------------------------------------------------------------------------- - -class WXDLLIMPEXP_QA wxDebugReport -{ -public: - // this is used for the functions which may report either the current state - // or the state during the last (fatal) exception - enum Context { Context_Current, Context_Exception }; - - - // ctor creates a temporary directory where we create the files which will - // be included in the report, use IsOk() to check for errors - wxDebugReport(); - - // dtor normally destroys the temporary directory created in the ctor (with - // all the files it contains), call Reset() to prevent this from happening - virtual ~wxDebugReport(); - - // return the name of the directory used for this report - const wxString& GetDirectory() const { return m_dir; } - - // return true if the object was successfully initialized - bool IsOk() const { return !GetDirectory().empty(); } - - // reset the directory name we use, the object can't be used any more after - // this as it becomes invalid/uninitialized - void Reset() { m_dir.clear(); } - - - // add another file to the report: the file must already exist, its name - // can be either absolute in which case it is copied to the debug report - // directory or relative to GetDirectory() - // - // description is shown to the user in the report summary - virtual void AddFile(const wxString& filename, const wxString& description); - - // convenience function: write the given text to a file with the given name - // and then add it to the report (the difference with AddFile() is that the - // file will be created by this function and doesn't have to already exist) - bool AddText(const wxString& filename, - const wxString& text, - const wxString& description); - -#if wxUSE_STACKWALKER - // add an XML file containing the current or exception context and the - // stack trace - bool AddCurrentContext() { return AddContext(Context_Current); } - bool AddExceptionContext() { return AddContext(Context_Exception); } - virtual bool AddContext(Context ctx); -#endif - -#if wxUSE_CRASHREPORT - // add a file with crash report - bool AddCurrentDump() { return AddDump(Context_Current); } - bool AddExceptionDump() { return AddDump(Context_Exception); } - virtual bool AddDump(Context ctx); -#endif // wxUSE_CRASHREPORT - - // add all available information to the report - void AddAll(Context context = Context_Exception); - - - // process this report: the base class simply notifies the user that the - // report has been generated, this is usually not enough -- instead you - // should override this method to do something more useful to you - bool Process(); - - // get the name used as base name for various files, by default - // wxApp::GetName() - virtual wxString GetReportName() const; - - // get the files in this report - size_t GetFilesCount() const { return m_files.GetCount(); } - bool GetFile(size_t n, wxString *name, wxString *desc) const; - - // remove the file from report: this is used by wxDebugReportPreview to - // allow the user to remove files potentially containing private - // information from the report - void RemoveFile(const wxString& name); - -protected: -#if wxUSE_STACKWALKER - // used by AddContext() - virtual bool DoAddSystemInfo(wxXmlNode *nodeSystemInfo); - virtual bool DoAddLoadedModules(wxXmlNode *nodeModules); - virtual bool DoAddExceptionInfo(wxXmlNode *nodeContext); - virtual void DoAddCustomContext(wxXmlNode * WXUNUSED(nodeRoot)) { } -#endif - - // used by Process() - virtual bool DoProcess(); - -private: - // name of the report directory - wxString m_dir; - - // the arrays of files in this report and their descriptions - wxArrayString m_files, - m_descriptions; -}; - -#if wxUSE_ZIPSTREAM - -// ---------------------------------------------------------------------------- -// wxDebugReportCompress: compress all files of this debug report in a .ZIP -// ---------------------------------------------------------------------------- - -class WXDLLIMPEXP_QA wxDebugReportCompress : public wxDebugReport -{ -public: - wxDebugReportCompress() { } - - // returns the full path of the compressed file (empty if creation failed) - const wxString& GetCompressedFileName() const { return m_zipfile; } - -protected: - virtual bool DoProcess(); - -private: - // full path to the ZIP file we created - wxString m_zipfile; -}; - -// ---------------------------------------------------------------------------- -// wxDebugReportUploader: uploads compressed file using HTTP POST request -// ---------------------------------------------------------------------------- - -class WXDLLIMPEXP_QA wxDebugReportUpload : public wxDebugReportCompress -{ -public: - // this class will upload the compressed file created by its base class to - // an HTML multipart/form-data form at the specified address - // - // the URL is the base address, input is the name of the "type=file" - // control on the form used for the file name and action is the value of - // the form action field - wxDebugReportUpload(const wxString& url, - const wxString& input, - const wxString& action, - const wxString& curl = wxT("curl")); - -protected: - virtual bool DoProcess(); - - // this function may be overridden in a derived class to show the output - // from curl: this may be an HTML page or anything else that the server - // returned - // - // return value becomes the return value of Process() - virtual bool OnServerReply(const wxArrayString& WXUNUSED(reply)) - { - return true; - } - -private: - // the full URL to use with HTTP POST request - wxString m_uploadURL; - - // the name of the input field containing the file name in the form at - // above URL - wxString m_inputField; - - // the curl command (by default it is just "curl" but could be full path to - // curl or a wrapper script with curl-compatible syntax) - wxString m_curlCmd; -}; - -#endif // wxUSE_ZIPSTREAM - - -// ---------------------------------------------------------------------------- -// wxDebugReportPreview: presents the debug report to the user and allows him -// to veto report entirely or remove some parts of it -// ---------------------------------------------------------------------------- - -class WXDLLIMPEXP_QA wxDebugReportPreview -{ -public: - // ctor is trivial - wxDebugReportPreview() { } - - // present the report to the user and allow him to modify it by removing - // some or all of the files and, potentially, adding some notes - // - // return true if the report should be processed or false if the user chose - // to cancel report generation or removed all files from it - virtual bool Show(wxDebugReport& dbgrpt) const = 0; - - // dtor is trivial as well but should be virtual for a base class - virtual ~wxDebugReportPreview() { } -}; - -#if wxUSE_GUI - -// ---------------------------------------------------------------------------- -// wxDebugReportPreviewStd: standard debug report preview window -// ---------------------------------------------------------------------------- - -class WXDLLIMPEXP_QA wxDebugReportPreviewStd : public wxDebugReportPreview -{ -public: - wxDebugReportPreviewStd() { } - - virtual bool Show(wxDebugReport& dbgrpt) const; -}; - -#endif // wxUSE_GUI - -#endif // wxUSE_DEBUGREPORT && wxUSE_XML - -#endif // _WX_DEBUGRPT_H_ diff --git a/wxWidgets/include/wx/defs.h b/wxWidgets/include/wx/defs.h deleted file mode 100644 index c080acfef2..0000000000 --- a/wxWidgets/include/wx/defs.h +++ /dev/null @@ -1,2907 +0,0 @@ -/* - * Name: wx/defs.h - * Purpose: Declarations/definitions common to all wx source files - * Author: Julian Smart and others - * Modified by: Ryan Norton (Converted to C) - * Created: 01/02/97 - * RCS-ID: $Id: defs.h 66923 2011-02-16 22:37:48Z JS $ - * Copyright: (c) Julian Smart - * Licence: wxWindows licence - */ - -/* THIS IS A C FILE, DON'T USE C++ FEATURES (IN PARTICULAR COMMENTS) IN IT */ - -#ifndef _WX_DEFS_H_ -#define _WX_DEFS_H_ - -/* ---------------------------------------------------------------------------- */ -/* compiler and OS identification */ -/* ---------------------------------------------------------------------------- */ - -#include "wx/platform.h" - -#ifdef __cplusplus -/* Make sure the environment is set correctly */ -# if defined(__WXMSW__) && defined(__X__) -# error "Target can't be both X and Windows" -# elif defined(__WXMSW__) && defined(__PALMOS__) -# error "Target can't be both PalmOS and Windows" -# elif !defined(__WXMOTIF__) && \ - !defined(__WXMSW__) && \ - !defined(__WXPALMOS__)&& \ - !defined(__WXGTK__) && \ - !defined(__WXPM__) && \ - !defined(__WXMAC__) && \ - !defined(__WXCOCOA__) && \ - !defined(__X__) && \ - !defined(__WXMGL__) && \ - !defined(__WXDFB__) && \ - !defined(__WXX11__) && \ - wxUSE_GUI -# ifdef __UNIX__ -# error "No Target! You should use wx-config program for compilation flags!" -# else /* !Unix */ -# error "No Target! You should use supplied makefiles for compilation!" -# endif /* Unix/!Unix */ -# endif -#endif /*__cplusplus*/ - -#ifndef __WXWINDOWS__ - #define __WXWINDOWS__ 1 -#endif - -#ifndef wxUSE_BASE - /* by default consider that this is a monolithic build */ - #define wxUSE_BASE 1 -#endif - -#if !wxUSE_GUI && !defined(__WXBASE__) - #define __WXBASE__ -#endif - -/* include the feature test macros */ -#include "wx/features.h" - -/* suppress some Visual C++ warnings */ -#ifdef __VISUALC__ - /* the only "real" warning here is 4244 but there are just too many of them */ - /* in our code... one day someone should go and fix them but until then... */ -# pragma warning(disable:4097) /* typedef used as class */ -# pragma warning(disable:4201) /* nonstandard extension used: nameless struct/union */ -# pragma warning(disable:4244) /* conversion from double to float */ -# pragma warning(disable:4355) /* 'this' used in base member initializer list */ -# pragma warning(disable:4511) /* copy ctor couldn't be generated */ -# pragma warning(disable:4512) /* operator=() couldn't be generated */ -# pragma warning(disable:4710) /* function not inlined */ - - /* For VC++ 5.0 for release mode, the warning 'C4702: unreachable code */ - /* is buggy, and occurs for code that does actually get executed */ -# if !defined __WXDEBUG__ && __VISUALC__ <= 1100 -# pragma warning(disable:4702) /* unreachable code */ -# endif - /* The VC++ 5.0 warning 'C4003: not enough actual parameters for macro' - * is incompatible with the wxWidgets headers since it is given when - * parameters are empty but not missing. */ -# if __VISUALC__ <= 1100 -# pragma warning(disable:4003) /* not enough actual parameters for macro */ -# endif - - /* - VC++ 8 gives a warning when using standard functions such as sprintf, - localtime, ... -- stop this madness, unless the user had already done it - */ - #if __VISUALC__ >= 1400 - #ifndef _CRT_SECURE_NO_DEPRECATE - #define _CRT_SECURE_NO_DEPRECATE 1 - #endif - #ifndef _CRT_NON_CONFORMING_SWPRINTFS - #define _CRT_NON_CONFORMING_SWPRINTFS 1 - #endif - #endif /* VC++ 8 */ -#endif /* __VISUALC__ */ - -/* suppress some Salford C++ warnings */ -#ifdef __SALFORDC__ -# pragma suppress 353 /* Possible nested comments */ -# pragma suppress 593 /* Define not used */ -# pragma suppress 61 /* enum has no name (doesn't suppress!) */ -# pragma suppress 106 /* unnamed, unused parameter */ -# pragma suppress 571 /* Virtual function hiding */ -#endif /* __SALFORDC__ */ - -/* suppress some Borland C++ warnings */ -#ifdef __BORLANDC__ -# pragma warn -inl /* Functions containing reserved words and certain constructs are not expanded inline */ -#endif /* __BORLANDC__ */ - -/* - g++ gives a warning when a class has private dtor if it has no friends but - this is a perfectly valid situation for a ref-counted class which destroys - itself when its ref count drops to 0, so provide a macro to suppress this - warning - */ -#ifdef __GNUG__ -# define wxSUPPRESS_GCC_PRIVATE_DTOR_WARNING(name) \ - friend class wxDummyFriendFor ## name; -#else /* !g++ */ -# define wxSUPPRESS_GCC_PRIVATE_DTOR_WARNING(name) -#endif - -/* ---------------------------------------------------------------------------- */ -/* wxWidgets version and compatibility defines */ -/* ---------------------------------------------------------------------------- */ - -#include "wx/version.h" - -/* ============================================================================ */ -/* non portable C++ features */ -/* ============================================================================ */ - -/* ---------------------------------------------------------------------------- */ -/* compiler defects workarounds */ -/* ---------------------------------------------------------------------------- */ - -/* - Digital Unix C++ compiler only defines this symbol for .cxx and .hxx files, - so define it ourselves (newer versions do it for all files, though, and - don't allow it to be redefined) - */ -#if defined(__DECCXX) && !defined(__VMS) && !defined(__cplusplus) -#define __cplusplus -#endif /* __DECCXX */ - -/* Resolves linking problems under HP-UX when compiling with gcc/g++ */ -#if defined(__HPUX__) && defined(__GNUG__) -#define va_list __gnuc_va_list -#endif /* HP-UX */ - -/* ---------------------------------------------------------------------------- */ -/* check for native bool type and TRUE/FALSE constants */ -/* ---------------------------------------------------------------------------- */ - -/* Add more tests here for Windows compilers that already define bool */ -/* (under Unix, configure tests for this) */ -#ifndef HAVE_BOOL - #if defined( __MWERKS__ ) - #if (__MWERKS__ >= 0x1000) && __option(bool) - #define HAVE_BOOL - #endif - #elif defined(__APPLE__) && defined(__APPLE_CC__) - /* Apple bundled gcc supports bool */ - #define HAVE_BOOL - #elif defined(__VISUALC__) && (__VISUALC__ == 1020) - /* in VC++ 4.2 the bool keyword is reserved (hence can't be typedefed) */ - /* but not implemented, so we must #define it */ - #define bool unsigned int - #elif defined(__VISUALC__) && (__VISUALC__ == 1010) - /* For VisualC++ 4.1, we need to define */ - /* bool as something between 4.0 & 5.0... */ - typedef unsigned int wxbool; - #define bool wxbool - #define HAVE_BOOL - #elif defined(__VISUALC__) && (__VISUALC__ > 1020) - /* VC++ supports bool since 4.2 */ - #define HAVE_BOOL - #elif defined(__BORLANDC__) && (__BORLANDC__ >= 0x500) - /* Borland 5.0+ supports bool */ - #define HAVE_BOOL - #elif wxCHECK_WATCOM_VERSION(1,0) - /* Watcom 11+ supports bool */ - #define HAVE_BOOL - #elif defined(__DIGITALMARS__) - /* DigitalMars supports bool */ - #define HAVE_BOOL - #elif defined(__GNUWIN32__) || defined(__MINGW32__) || defined(__CYGWIN__) - /* Cygwin supports bool */ - #define HAVE_BOOL - #elif defined(__VISAGECPP__) - #if __IBMCPP__ < 400 - typedef unsigned long bool; - #define true ((bool)1) - #define false ((bool)0) - #endif - #define HAVE_BOOL - #endif /* compilers */ -#endif /* HAVE_BOOL */ - -#if !defined(__MWERKS__) || !defined(true) -#if !defined(HAVE_BOOL) && !defined(bool) && !defined(VMS) - /* NB: of course, this doesn't replace the standard type, because, for */ - /* example, overloading based on bool/int parameter doesn't work and */ - /* so should be avoided in portable programs */ - typedef unsigned int bool; -#endif /* bool */ - -/* deal with TRUE/true stuff: we assume that if the compiler supports bool, it */ -/* supports true/false as well and that, OTOH, if it does _not_ support bool, */ -/* it doesn't support these keywords (this is less sure, in particular VC++ */ -/* 4.x could be a problem here) */ -#ifndef HAVE_BOOL - #define true ((bool)1) - #define false ((bool)0) -#endif -#endif - -/* for backwards compatibility, also define TRUE and FALSE */ -/* */ -/* note that these definitions should work both in C++ and C code, so don't */ -/* use true/false below */ -#ifndef TRUE - #define TRUE 1 -#endif - -#ifndef FALSE - #define FALSE 0 -#endif - -typedef short int WXTYPE; - -/* special care should be taken with this type under Windows where the real */ -/* window id is unsigned, so we must always do the cast before comparing them */ -/* (or else they would be always different!). Using wxGetWindowId() which does */ -/* the cast itself is recommended. Note that this type can't be unsigned */ -/* because wxID_ANY == -1 is a valid (and largely used) value for window id. */ -typedef int wxWindowID; - -/* ---------------------------------------------------------------------------- */ -/* other feature tests */ -/* ---------------------------------------------------------------------------- */ - -/* Every ride down a slippery slope begins with a single step.. */ -/* */ -/* Yes, using nested classes is indeed against our coding standards in */ -/* general, but there are places where you can use them to advantage */ -/* without totally breaking ports that cannot use them. If you do, then */ -/* wrap it in this guard, but such cases should still be relatively rare. */ -#define wxUSE_NESTED_CLASSES 1 - -/* check for explicit keyword support */ -#ifndef HAVE_EXPLICIT - #if defined(__VISUALC__) && (__VISUALC__ >= 1100) - /* VC++ 6.0 and 5.0 have explicit (what about earlier versions?) */ - #define HAVE_EXPLICIT - #elif ( defined(__MINGW32__) || defined(__CYGWIN32__) ) \ - && wxCHECK_GCC_VERSION(2, 95) - /* GCC 2.95 has explicit, what about earlier versions? */ - #define HAVE_EXPLICIT - #elif defined(__BORLANDC__) && (__BORLANDC__ >= 0x0520) - /* BC++ 4.52 doesn't support explicit, CBuilder 1 does */ - #define HAVE_EXPLICIT - #elif defined(__MWERKS__) && (__MWERKS__ >= 0x2400) - /* Metrowerks CW6 or higher has explicit */ - #define HAVE_EXPLICIT - #elif defined(__DIGITALMARS__) - #define HAVE_EXPLICIT - #endif -#endif /* !HAVE_EXPLICIT */ - -#ifdef HAVE_EXPLICIT - #define wxEXPLICIT explicit -#else /* !HAVE_EXPLICIT */ - #define wxEXPLICIT -#endif /* HAVE_EXPLICIT/!HAVE_EXPLICIT */ - -/* check for static/const_cast<>() (we don't use the other ones for now) */ -#ifndef HAVE_CXX_CASTS - #if defined(__VISUALC__) && (__VISUALC__ >= 1100) - /* VC++ 6.0 and 5.0 have C++ casts (what about earlier versions?) */ - #define HAVE_CXX_CASTS - #elif defined(__MINGW32__) || defined(__CYGWIN32__) - #if wxCHECK_GCC_VERSION(2, 95) - /* GCC 2.95 has C++ casts, what about earlier versions? */ - #define HAVE_CXX_CASTS - #endif - #endif -#endif /* !HAVE_CXX_CASTS */ - -#ifdef HAVE_CXX_CASTS - #ifndef HAVE_CONST_CAST - #define HAVE_CONST_CAST - #endif - #ifndef HAVE_REINTERPRET_CAST - #define HAVE_REINTERPRET_CAST - #endif - #ifndef HAVE_STATIC_CAST - #define HAVE_STATIC_CAST - #endif - #ifndef HAVE_DYNAMIC_CAST - #define HAVE_DYNAMIC_CAST - #endif -#endif /* HAVE_CXX_CASTS */ - -#ifdef HAVE_STATIC_CAST - #define wx_static_cast(t, x) static_cast(x) -#else - #define wx_static_cast(t, x) ((t)(x)) -#endif - -#ifdef HAVE_CONST_CAST - #define wx_const_cast(t, x) const_cast(x) -#else - #define wx_const_cast(t, x) ((t)(x)) -#endif - -#ifdef HAVE_REINTERPRET_CAST - #define wx_reinterpret_cast(t, x) reinterpret_cast(x) -#else - #define wx_reinterpret_cast(t, x) ((t)(x)) -#endif - -/* - This one is a wx invention: like static cast but used when we intentionally - truncate from a larger to smaller type, static_cast<> can't be used for it - as it results in warnings when using some compilers (SGI mipspro for example) - */ -#if defined(__INTELC__) && defined(__cplusplus) - template - inline T wx_truncate_cast_impl(X x) - { - #pragma warning(push) - /* implicit conversion of a 64-bit integral type to a smaller integral type */ - #pragma warning(disable: 1682) - /* conversion from "X" to "T" may lose significant bits */ - #pragma warning(disable: 810) - - return x; - - #pragma warning(pop) - } - - #define wx_truncate_cast(t, x) wx_truncate_cast_impl(x) - -#elif defined(__cplusplus) && defined(__VISUALC__) && __VISUALC__ >= 1310 - template - inline T wx_truncate_cast_impl(X x) - { - #pragma warning(push) - /* conversion from 'X' to 'T', possible loss of data */ - #pragma warning(disable: 4267) - - return x; - - #pragma warning(pop) - } - - #define wx_truncate_cast(t, x) wx_truncate_cast_impl(x) -#else - #define wx_truncate_cast(t, x) ((t)(x)) -#endif - -/* for consistency with wxStatic/DynamicCast defined in wx/object.h */ -#define wxConstCast(obj, className) wx_const_cast(className *, obj) - -#ifndef HAVE_STD_WSTRING - #if defined(__VISUALC__) && (__VISUALC__ >= 1100) - /* VC++ 6.0 and 5.0 have std::wstring (what about earlier versions?) */ - #define HAVE_STD_WSTRING - #elif ( defined(__MINGW32__) || defined(__CYGWIN32__) ) \ - && wxCHECK_GCC_VERSION(3, 3) - /* GCC 3.1 has std::wstring; 3.0 never was in MinGW, 2.95 hasn't it */ - #define HAVE_STD_WSTRING - #endif -#endif - -#ifndef HAVE_STD_STRING_COMPARE - #if defined(__VISUALC__) && (__VISUALC__ >= 1100) - /* VC++ 6.0 and 5.0 have std::string::compare */ - /* (what about earlier versions?) */ - #define HAVE_STD_STRING_COMPARE - #elif ( defined(__MINGW32__) || defined(__CYGWIN32__) ) \ - && wxCHECK_GCC_VERSION(3, 1) - /* GCC 3.1 has std::string::compare; */ - /* 3.0 never was in MinGW, 2.95 hasn't it */ - #define HAVE_STD_STRING_COMPARE - #endif -#endif - -/* provide replacement for C99 va_copy() if the compiler doesn't have it */ - -/* could be already defined by configure or the user */ -#ifndef wxVaCopy - /* if va_copy is a macro or configure detected that we have it, use it */ - #if defined(va_copy) || defined(HAVE_VA_COPY) - #define wxVaCopy va_copy - #else /* no va_copy, try to provide a replacement */ - /* - configure tries to determine whether va_list is an array or struct - type, but it may not be used under Windows, so deal with a few - special cases. - */ - - #ifdef __WATCOMC__ - /* Watcom uses array type for va_list except for PPC and Alpha */ - #if !defined(__PPC__) && !defined(__AXP__) - #define VA_LIST_IS_ARRAY - #endif - #endif /* __WATCOMC__ */ - - #if defined(__PPC__) && (defined(_CALL_SYSV) || defined (_WIN32)) - /* - PPC using SysV ABI and NT/PPC are special in that they use an - extra level of indirection. - */ - #define VA_LIST_IS_POINTER - #endif /* SysV or Win32 on __PPC__ */ - - /* - note that we use memmove(), not memcpy(), in case anybody tries - to do wxVaCopy(ap, ap) - */ - #if defined(VA_LIST_IS_POINTER) - #define wxVaCopy(d, s) memmove(*(d), *(s), sizeof(va_list)) - #elif defined(VA_LIST_IS_ARRAY) - #define wxVaCopy(d, s) memmove((d), (s), sizeof(va_list)) - #else /* we can only hope that va_lists are simple lvalues */ - #define wxVaCopy(d, s) ((d) = (s)) - #endif - #endif /* va_copy/!va_copy */ -#endif /* wxVaCopy */ - - -/* ---------------------------------------------------------------------------- */ -/* portable calling conventions macros */ -/* ---------------------------------------------------------------------------- */ - -/* stdcall is used for all functions called by Windows under Windows */ -#if defined(__WINDOWS__) - #if defined(__GNUWIN32__) - #define wxSTDCALL __attribute__((stdcall)) - #else - /* both VC++ and Borland understand this */ - #define wxSTDCALL _stdcall - #endif - -#else /* Win */ - /* no such stupidness under Unix */ - #define wxSTDCALL -#endif /* platform */ - -/* LINKAGEMODE mode is empty for everyting except OS/2 */ -#ifndef LINKAGEMODE - #define LINKAGEMODE -#endif /* LINKAGEMODE */ - -/* wxCALLBACK should be used for the functions which are called back by */ -/* Windows (such as compare function for wxListCtrl) */ -#if defined(__WIN32__) && !defined(__WXMICROWIN__) - #define wxCALLBACK wxSTDCALL -#else - /* no stdcall under Unix nor Win16 */ - #define wxCALLBACK -#endif /* platform */ - -/* generic calling convention for the extern "C" functions */ - -#if defined(__VISUALC__) - #define wxC_CALLING_CONV _cdecl -#elif defined(__VISAGECPP__) - #define wxC_CALLING_CONV _Optlink -#else /* !Visual C++ */ - #define wxC_CALLING_CONV -#endif /* compiler */ - -/* callling convention for the qsort(3) callback */ -#define wxCMPFUNC_CONV wxC_CALLING_CONV - -/* compatibility :-( */ -#define CMPFUNC_CONV wxCMPFUNC_CONV - -/* DLL import/export declarations */ -#include "wx/dlimpexp.h" - -/* ---------------------------------------------------------------------------- */ -/* Very common macros */ -/* ---------------------------------------------------------------------------- */ - -/* Printf-like attribute definitions to obtain warnings with GNU C/C++ */ -#ifndef ATTRIBUTE_PRINTF -# if defined(__GNUC__) && !wxUSE_UNICODE -# define ATTRIBUTE_PRINTF(m, n) __attribute__ ((__format__ (__printf__, m, n))) -# else -# define ATTRIBUTE_PRINTF(m, n) -# endif - -# define ATTRIBUTE_PRINTF_1 ATTRIBUTE_PRINTF(1, 2) -# define ATTRIBUTE_PRINTF_2 ATTRIBUTE_PRINTF(2, 3) -# define ATTRIBUTE_PRINTF_3 ATTRIBUTE_PRINTF(3, 4) -# define ATTRIBUTE_PRINTF_4 ATTRIBUTE_PRINTF(4, 5) -# define ATTRIBUTE_PRINTF_5 ATTRIBUTE_PRINTF(5, 6) -#endif /* !defined(ATTRIBUTE_PRINTF) */ - -/* Macro to issue warning when using deprecated functions with gcc3 or MSVC7: */ -#if wxCHECK_GCC_VERSION(3, 1) - #define wxDEPRECATED(x) x __attribute__ ((deprecated)) -#elif defined(__VISUALC__) && (__VISUALC__ >= 1300) - #define wxDEPRECATED(x) __declspec(deprecated) x -#else - #define wxDEPRECATED(x) x -#endif - -/* everybody gets the assert and other debug macros */ -#include "wx/debug.h" - -/* NULL declaration: it must be defined as 0 for C++ programs (in particular, */ -/* it must not be defined as "(void *)0" which is standard for C but completely */ -/* breaks C++ code) */ -#ifndef __HANDHELDPC__ -#include -#endif - -/* delete pointer if it is not NULL and NULL it afterwards */ -/* (checking that it's !NULL before passing it to delete is just a */ -/* a question of style, because delete will do it itself anyhow, but it might */ -/* be considered as an error by some overzealous debugging implementations of */ -/* the library, so we do it ourselves) */ -#define wxDELETE(p) if ( (p) != NULL ) { delete p; p = NULL; } - -/* delete an array and NULL it (see comments above) */ -#define wxDELETEA(p) if ( (p) ) { delete [] (p); p = NULL; } - -/* size of statically declared array */ -#define WXSIZEOF(array) (sizeof(array)/sizeof(array[0])) - -/* symbolic constant used by all Find()-like functions returning positive */ -/* integer on success as failure indicator */ -#define wxNOT_FOUND (-1) - -/* ---------------------------------------------------------------------------- */ -/* macros to avoid compiler warnings */ -/* ---------------------------------------------------------------------------- */ - -/* Macro to cut down on compiler warnings. */ -#if 1 /* there should be no more any compilers needing the "#else" version */ - #define WXUNUSED(identifier) /* identifier */ -#else /* stupid, broken compiler */ - #define WXUNUSED(identifier) identifier -#endif - -/* some arguments are only used in debug mode, but unused in release one */ -#ifdef __WXDEBUG__ - #define WXUNUSED_UNLESS_DEBUG(param) param -#else - #define WXUNUSED_UNLESS_DEBUG(param) WXUNUSED(param) -#endif - -/* some arguments are not used in unicode mode */ -#if wxUSE_UNICODE - #define WXUNUSED_IN_UNICODE(param) WXUNUSED(param) -#else - #define WXUNUSED_IN_UNICODE(param) param -#endif - -/* some arguments are not used in WinCE build */ -#ifdef __WXWINCE__ - #define WXUNUSED_IN_WINCE(param) WXUNUSED(param) -#else - #define WXUNUSED_IN_WINCE(param) param -#endif - -/* unused parameters in non stream builds */ -#if wxUSE_STREAMS - #define WXUNUSED_UNLESS_STREAMS(param) param -#else - #define WXUNUSED_UNLESS_STREAMS(param) WXUNUSED(param) -#endif - -/* some compilers give warning about a possibly unused variable if it is */ -/* initialized in both branches of if/else and shut up if it is initialized */ -/* when declared, but other compilers then give warnings about unused variable */ -/* value -- this should satisfy both of them */ -#if defined(__VISUALC__) - #define wxDUMMY_INITIALIZE(val) = val -#else - #define wxDUMMY_INITIALIZE(val) -#endif - -/* sometimes the value of a variable is *really* not used, to suppress the */ -/* resulting warning you may pass it to this function */ -#ifdef __cplusplus -# ifdef __BORLANDC__ -# define wxUnusedVar(identifier) identifier -# else - template - inline void wxUnusedVar(const T& WXUNUSED(t)) { } -# endif -#endif - -/* ---------------------------------------------------------------------------- */ -/* compiler specific settings */ -/* ---------------------------------------------------------------------------- */ - -/* to allow compiling with warning level 4 under Microsoft Visual C++ some */ -/* warnings just must be disabled */ -#ifdef __VISUALC__ - #pragma warning(disable: 4514) /* unreferenced inline func has been removed */ -/* - you might be tempted to disable this one also: triggered by CHECK and FAIL - macros in debug.h, but it's, overall, a rather useful one, so I leave it and - will try to find some way to disable this warning just for CHECK/FAIL. Anyone? -*/ - #pragma warning(disable: 4127) /* conditional expression is constant */ -#endif /* VC++ */ - -#if defined(__MWERKS__) - #undef try - #undef except - #undef finally - #define except(x) catch(...) -#endif /* Metrowerks */ - -#if wxONLY_WATCOM_EARLIER_THAN(1,4) - typedef short mode_t; -#endif - -/* where should i put this? we need to make sure of this as it breaks */ -/* the code. */ -#if !wxUSE_IOSTREAMH && defined(__WXDEBUG__) -# ifndef __MWERKS__ -/* #undef __WXDEBUG__ */ -# ifdef wxUSE_DEBUG_NEW_ALWAYS -# undef wxUSE_DEBUG_NEW_ALWAYS -# define wxUSE_DEBUG_NEW_ALWAYS 0 -# endif -# endif -#endif - -/* ---------------------------------------------------------------------------- */ -/* standard wxWidgets types */ -/* ---------------------------------------------------------------------------- */ - -/* the type for screen and DC coordinates */ -typedef int wxCoord; - -enum { wxDefaultCoord = -1 }; - -/* ---------------------------------------------------------------------------- */ -/* define fixed length types */ -/* ---------------------------------------------------------------------------- */ - -#if defined(__WXPALMOS__) || defined(__MINGW32__) - #include -#endif - -/* chars are always one byte (by definition), shorts are always two (in */ -/* practice) */ - -/* 8bit */ -#ifndef SIZEOF_CHAR - #define SIZEOF_CHAR 1 -#endif -typedef signed char wxInt8; -typedef unsigned char wxUint8; -typedef wxUint8 wxByte; - - -/* 16bit */ -#ifdef SIZEOF_SHORT - #if SIZEOF_SHORT != 2 - #error "wxWidgets assumes sizeof(short) == 2, please fix the code" - #endif -#else - #define SIZEOF_SHORT 2 -#endif - -typedef signed short wxInt16; -typedef unsigned short wxUint16; - -typedef wxUint16 wxWord; - -/* - things are getting more interesting with ints, longs and pointers - - there are several different standard data models described by this table: - - +-----------+----------------------------+ - |type\model | LP64 ILP64 LLP64 ILP32 LP32| - +-----------+----------------------------+ - |char | 8 8 8 8 8 | - |short | 16 16 16 16 16 | - |int | 32 64 32 32 16 | - |long | 64 64 32 32 32 | - |long long | 64 | - |void * | 64 64 64 32 32 | - +-----------+----------------------------+ - - Win16 used LP32 (but we don't support it any longer), Win32 obviously used - ILP32 and Win64 uses LLP64 (a.k.a. P64) - - Under Unix LP64 is the most widely used (the only I've ever seen, in fact) - */ - -/* 32bit */ -#ifdef __PALMOS__ - typedef int wxInt32; - typedef unsigned int wxUint32; - #define SIZEOF_INT 4 - #define SIZEOF_LONG 4 - #define SIZEOF_WCHAR_T 2 - #define SIZEOF_SIZE_T 4 - #define wxSIZE_T_IS_UINT - #define SIZEOF_VOID_P 4 - #define SIZEOF_SIZE_T 4 -#elif defined(__WINDOWS__) - /* Win64 uses LLP64 model and so ints and longs have the same size as in */ - /* Win32 */ - #if defined(__WIN32__) - typedef int wxInt32; - typedef unsigned int wxUint32; - - /* Assume that if SIZEOF_INT is defined that all the other ones except - SIZEOF_SIZE_T, are too. See next #if below. */ - #ifndef SIZEOF_INT - #define SIZEOF_INT 4 - #define SIZEOF_LONG 4 - #define SIZEOF_WCHAR_T 2 - - /* - under Win64 sizeof(size_t) == 8 and so it is neither unsigned - int nor unsigned long! - */ - #ifdef __WIN64__ - #define SIZEOF_SIZE_T 8 - - #undef wxSIZE_T_IS_UINT - #else /* Win32 */ - #define SIZEOF_SIZE_T 4 - - #define wxSIZE_T_IS_UINT - #endif - #undef wxSIZE_T_IS_ULONG - - #ifdef __WIN64__ - #define SIZEOF_VOID_P 8 - #else /* Win32 */ - #define SIZEOF_VOID_P 4 - #endif /* Win64/32 */ - #endif /* !defined(SIZEOF_INT) */ - - /* - If Python.h was included first, it defines all of the SIZEOF's above - except for SIZEOF_SIZE_T, so we need to do it here to avoid - triggering the #error in the ssize_t typedefs below... - */ - #ifndef SIZEOF_SIZE_T - #ifdef __WIN64__ - #define SIZEOF_SIZE_T 8 - #else /* Win32 */ - #define SIZEOF_SIZE_T 4 - #endif - #endif - #else - #error "Unsupported Windows version" - #endif -#else /* !Windows */ - /* SIZEOF_XXX are normally defined by configure */ - #ifdef SIZEOF_INT - #if SIZEOF_INT == 8 - /* must be ILP64 data model, there is normally a special 32 bit */ - /* type in it but we don't know what it is... */ - #error "No 32bit int type on this platform" - #elif SIZEOF_INT == 4 - typedef int wxInt32; - typedef unsigned int wxUint32; - #elif SIZEOF_INT == 2 - /* must be LP32 */ - #if SIZEOF_LONG != 4 - #error "No 32bit int type on this platform" - #endif - - typedef long wxInt32; - typedef unsigned long wxUint32; - #else - /* wxWidgets is not ready for 128bit systems yet... */ - #error "Unknown sizeof(int) value, what are you compiling for?" - #endif - #else /* !defined(SIZEOF_INT) */ - /* assume default 32bit machine -- what else can we do? */ - wxCOMPILE_TIME_ASSERT( sizeof(int) == 4, IntMustBeExactly4Bytes); - wxCOMPILE_TIME_ASSERT( sizeof(size_t) == 4, SizeTMustBeExactly4Bytes); - wxCOMPILE_TIME_ASSERT( sizeof(void *) == 4, PtrMustBeExactly4Bytes); - - #define SIZEOF_INT 4 - #define SIZEOF_SIZE_T 4 - #define SIZEOF_VOID_P 4 - - typedef int wxInt32; - typedef unsigned int wxUint32; - - #if defined(__MACH__) && !defined(SIZEOF_WCHAR_T) - #define SIZEOF_WCHAR_T 4 - #endif - #if wxUSE_WCHAR_T && !defined(SIZEOF_WCHAR_T) - /* also assume that sizeof(wchar_t) == 2 (under Unix the most */ - /* common case is 4 but there configure would have defined */ - /* SIZEOF_WCHAR_T for us) */ - /* the most common case */ - wxCOMPILE_TIME_ASSERT( sizeof(wchar_t) == 2, - Wchar_tMustBeExactly2Bytes); - - #define SIZEOF_WCHAR_T 2 - #endif /* wxUSE_WCHAR_T */ - #endif -#endif /* Win/!Win */ - -typedef wxUint32 wxDword; - -/* - Define an integral type big enough to contain all of long, size_t and void *. - */ -#if SIZEOF_LONG >= SIZEOF_VOID_P && SIZEOF_LONG >= SIZEOF_SIZE_T - /* normal case */ - typedef unsigned long wxUIntPtr; - typedef long wxIntPtr; -#elif SIZEOF_SIZE_T >= SIZEOF_VOID_P - /* Win64 case */ - typedef size_t wxUIntPtr; - #define wxIntPtr ssize_t -#else - /* - This should never happen for the current architectures but if you're - using one where it does, please contact wx-dev@lists.wxwidgets.org. - */ - #error "Pointers can't be stored inside integer types." -#endif - -#ifdef __cplusplus -/* And also define a couple of simple functions to cast pointer to/from it. */ -inline wxUIntPtr wxPtrToUInt(const void *p) -{ - /* - VC++ 7.1 gives warnings about casts such as below even when they're - explicit with /Wp64 option, suppress them as we really know what we're - doing here. Same thing with icc with -Wall. - */ -#ifdef __VISUALC__ - #if __VISUALC__ >= 1200 - #pragma warning(push) - #endif - /* pointer truncation from '' to '' */ - #pragma warning(disable: 4311) -#elif defined(__INTELC__) - #pragma warning(push) - /* conversion from pointer to same-sized integral type */ - #pragma warning(disable: 1684) -#endif - - return wx_reinterpret_cast(wxUIntPtr, p); - -#if (defined(__VISUALC__) && __VISUALC__ >= 1200) || defined(__INTELC__) - #pragma warning(pop) -#endif -} - -inline void *wxUIntToPtr(wxUIntPtr p) -{ -#ifdef __VISUALC__ - #if __VISUALC__ >= 1200 - #pragma warning(push) - #endif - /* conversion to type of greater size */ - #pragma warning(disable: 4312) -#elif defined(__INTELC__) - #pragma warning(push) - /* invalid type conversion: "wxUIntPtr={unsigned long}" to "void *" */ - #pragma warning(disable: 171) -#endif - - return wx_reinterpret_cast(void *, p); - -#if (defined(__VISUALC__) && __VISUALC__ >= 1200) || defined(__INTELC__) - #pragma warning(pop) -#endif -} -#endif /*__cplusplus*/ - - -/* 64 bit */ - -/* NB: we #define and not typedef wxLongLong_t because we use "#ifdef */ -/* wxLongLong_t" in wx/longlong.h */ - -/* wxULongLong_t is set later (usually to unsigned wxLongLong_t) */ - -/* to avoid compilation problems on 64bit machines with ambiguous method calls */ -/* we will need to define this */ -#undef wxLongLongIsLong - -/* - First check for specific compilers which have known 64 bit integer types, - this avoids clashes with SIZEOF_LONG[_LONG] being defined incorrectly for - e.g. MSVC builds (Python.h defines it as 8 even for MSVC). - - Also notice that we check for "long long" before checking for 64 bit long as - we still want to use "long long" and not "long" for wxLongLong_t on 64 bit - architectures to be able to pass wxLongLong_t to the standard functions - prototyped as taking "long long" such as strtoll(). - */ -#if (defined(__VISUALC__) && defined(__WIN32__)) - #define wxLongLong_t __int64 - #define wxLongLongSuffix i64 - #define wxLongLongFmtSpec wxT("I64") -#elif defined(__BORLANDC__) && defined(__WIN32__) && (__BORLANDC__ >= 0x520) - #define wxLongLong_t __int64 - #define wxLongLongSuffix i64 - #define wxLongLongFmtSpec wxT("L") -#elif (defined(__WATCOMC__) && (defined(__WIN32__) || defined(__DOS__) || defined(__OS2__))) - #define wxLongLong_t __int64 - #define wxLongLongSuffix i64 - #define wxLongLongFmtSpec wxT("L") -#elif defined(__DIGITALMARS__) - #define wxLongLong_t __int64 - #define wxLongLongSuffix LL - #define wxLongLongFmtSpec wxT("ll") -#elif defined(__MINGW32__) - #define wxLongLong_t long long - #define wxLongLongSuffix ll - #define wxLongLongFmtSpec wxT("I64") -#elif defined(__MWERKS__) - #if __option(longlong) - #define wxLongLong_t long long - #define wxLongLongSuffix ll - #define wxLongLongFmtSpec wxT("ll") - #else - #error "The 64 bit integer support in CodeWarrior has been disabled." - #error "See the documentation on the 'longlong' pragma." - #endif -#elif defined(__WXPALMOS__) - #define wxLongLong_t int64_t - #define wxLongLongSuffix ll - #define wxLongLongFmtSpec wxT("ll") -#elif defined(__VISAGECPP__) && __IBMCPP__ >= 400 - #define wxLongLong_t long long -#elif (defined(SIZEOF_LONG_LONG) && SIZEOF_LONG_LONG >= 8) || \ - defined(__GNUC__) || \ - defined(__CYGWIN__) || \ - defined(__WXMICROWIN__) || \ - (defined(__DJGPP__) && __DJGPP__ >= 2) - #define wxLongLong_t long long - #define wxLongLongSuffix ll - #define wxLongLongFmtSpec wxT("ll") -#elif defined(SIZEOF_LONG) && (SIZEOF_LONG == 8) - #define wxLongLong_t long - #define wxLongLongSuffix l - #define wxLongLongFmtSpec wxT("l") - #define wxLongLongIsLong -#endif - - -#ifdef wxLongLong_t - - #ifdef __WXPALMOS__ - #define wxULongLong_t uint64_t - #else - #define wxULongLong_t unsigned wxLongLong_t - #endif - - /* these macros allow to define 64 bit constants in a portable way */ - #define wxLL(x) wxCONCAT(x, wxLongLongSuffix) - #define wxULL(x) wxCONCAT(x, wxCONCAT(u, wxLongLongSuffix)) - - typedef wxLongLong_t wxInt64; - typedef wxULongLong_t wxUint64; - - #define wxHAS_INT64 1 - -#elif wxUSE_LONGLONG - /* these macros allow to define 64 bit constants in a portable way */ - #define wxLL(x) wxLongLong(x) - #define wxULL(x) wxULongLong(x) - - #define wxInt64 wxLongLong - #define wxUint64 wxULongLong - - #define wxHAS_INT64 1 - -#else /* !wxUSE_LONGLONG */ - - #define wxHAS_INT64 0 - -#endif - - -/* Make sure ssize_t is defined (a signed type the same size as size_t) */ -/* HAVE_SSIZE_T should be defined for compiliers that already have it */ -#ifdef __MINGW32__ - #if defined(_SSIZE_T_) && !defined(HAVE_SSIZE_T) - #define HAVE_SSIZE_T - #endif -#endif -#if defined(__PALMOS__) && !defined(HAVE_SSIZE_T) - #define HAVE_SSIZE_T -#endif -#if wxCHECK_WATCOM_VERSION(1,4) - #define HAVE_SSIZE_T -#endif -#ifndef HAVE_SSIZE_T - #if SIZEOF_SIZE_T == 4 - typedef wxInt32 ssize_t; - #elif SIZEOF_SIZE_T == 8 - typedef wxInt64 ssize_t; - #else - #error "error defining ssize_t, size_t is not 4 or 8 bytes" - #endif - - /* prevent ssize_t redefinitions in other libraries */ - #define HAVE_SSIZE_T -#endif - - -/* base floating point types */ -/* wxFloat32: 32 bit IEEE float ( 1 sign, 8 exponent bits, 23 fraction bits */ -/* wxFloat64: 64 bit IEEE float ( 1 sign, 11 exponent bits, 52 fraction bits */ -/* wxDouble: native fastest representation that has at least wxFloat64 */ -/* precision, so use the IEEE types for storage, and this for */ -/* calculations */ - -typedef float wxFloat32; -#if (defined( __WXMAC__ ) || defined(__WXCOCOA__)) && defined (__MWERKS__) - typedef short double wxFloat64; -#else - typedef double wxFloat64; -#endif - -typedef double wxDouble; - -/* - Some (non standard) compilers typedef wchar_t as an existing type instead - of treating it as a real fundamental type, set wxWCHAR_T_IS_REAL_TYPE to 0 - for them and to 1 for all the others. - */ -#if wxUSE_WCHAR_T - /* - VC++ typedefs wchar_t as unsigned short by default, that is unless - /Za or /Zc:wchar_t option is used in which case _WCHAR_T_DEFINED is - defined. - */ -# if defined(__VISUALC__) && !defined(_NATIVE_WCHAR_T_DEFINED) -# define wxWCHAR_T_IS_REAL_TYPE 0 -# else /* compiler having standard-conforming wchar_t */ -# define wxWCHAR_T_IS_REAL_TYPE 1 -# endif -#endif /* wxUSE_WCHAR_T */ - -/* ---------------------------------------------------------------------------- */ -/* byte ordering related definition and macros */ -/* ---------------------------------------------------------------------------- */ - -/* byte sex */ - -#define wxBIG_ENDIAN 4321 -#define wxLITTLE_ENDIAN 1234 -#define wxPDP_ENDIAN 3412 - -#ifdef WORDS_BIGENDIAN -#define wxBYTE_ORDER wxBIG_ENDIAN -#else -#define wxBYTE_ORDER wxLITTLE_ENDIAN -#endif - -/* byte swapping */ - -#if defined (__MWERKS__) && ( (__MWERKS__ < 0x0900) || macintosh ) -/* assembler versions for these */ -#ifdef __POWERPC__ - inline wxUint16 wxUINT16_SWAP_ALWAYS( wxUint16 i ) - {return (__lhbrx( &i , 0 ) );} - inline wxInt16 wxINT16_SWAP_ALWAYS( wxInt16 i ) - {return (__lhbrx( &i , 0 ) );} - inline wxUint32 wxUINT32_SWAP_ALWAYS( wxUint32 i ) - {return (__lwbrx( &i , 0 ) );} - inline wxInt32 wxINT32_SWAP_ALWAYS( wxInt32 i ) - {return (__lwbrx( &i , 0 ) );} -#else - #pragma parameter __D0 wxUINT16_SWAP_ALWAYS(__D0) - pascal wxUint16 wxUINT16_SWAP_ALWAYS(wxUint16 value) - = { 0xE158 }; - - #pragma parameter __D0 wxINT16_SWAP_ALWAYS(__D0) - pascal wxInt16 wxINT16_SWAP_ALWAYS(wxInt16 value) - = { 0xE158 }; - - #pragma parameter __D0 wxUINT32_SWAP_ALWAYS (__D0) - pascal wxUint32 wxUINT32_SWAP_ALWAYS(wxUint32 value) - = { 0xE158, 0x4840, 0xE158 }; - - #pragma parameter __D0 wxINT32_SWAP_ALWAYS (__D0) - pascal wxInt32 wxINT32_SWAP_ALWAYS(wxInt32 value) - = { 0xE158, 0x4840, 0xE158 }; - -#endif -#else /* !MWERKS */ -#define wxUINT16_SWAP_ALWAYS(val) \ - ((wxUint16) ( \ - (((wxUint16) (val) & (wxUint16) 0x00ffU) << 8) | \ - (((wxUint16) (val) & (wxUint16) 0xff00U) >> 8))) - -#define wxINT16_SWAP_ALWAYS(val) \ - ((wxInt16) ( \ - (((wxUint16) (val) & (wxUint16) 0x00ffU) << 8) | \ - (((wxUint16) (val) & (wxUint16) 0xff00U) >> 8))) - -#define wxUINT32_SWAP_ALWAYS(val) \ - ((wxUint32) ( \ - (((wxUint32) (val) & (wxUint32) 0x000000ffU) << 24) | \ - (((wxUint32) (val) & (wxUint32) 0x0000ff00U) << 8) | \ - (((wxUint32) (val) & (wxUint32) 0x00ff0000U) >> 8) | \ - (((wxUint32) (val) & (wxUint32) 0xff000000U) >> 24))) - -#define wxINT32_SWAP_ALWAYS(val) \ - ((wxInt32) ( \ - (((wxUint32) (val) & (wxUint32) 0x000000ffU) << 24) | \ - (((wxUint32) (val) & (wxUint32) 0x0000ff00U) << 8) | \ - (((wxUint32) (val) & (wxUint32) 0x00ff0000U) >> 8) | \ - (((wxUint32) (val) & (wxUint32) 0xff000000U) >> 24))) -#endif -/* machine specific byte swapping */ - -#ifdef wxLongLong_t - #define wxUINT64_SWAP_ALWAYS(val) \ - ((wxUint64) ( \ - (((wxUint64) (val) & (wxUint64) wxULL(0x00000000000000ff)) << 56) | \ - (((wxUint64) (val) & (wxUint64) wxULL(0x000000000000ff00)) << 40) | \ - (((wxUint64) (val) & (wxUint64) wxULL(0x0000000000ff0000)) << 24) | \ - (((wxUint64) (val) & (wxUint64) wxULL(0x00000000ff000000)) << 8) | \ - (((wxUint64) (val) & (wxUint64) wxULL(0x000000ff00000000)) >> 8) | \ - (((wxUint64) (val) & (wxUint64) wxULL(0x0000ff0000000000)) >> 24) | \ - (((wxUint64) (val) & (wxUint64) wxULL(0x00ff000000000000)) >> 40) | \ - (((wxUint64) (val) & (wxUint64) wxULL(0xff00000000000000)) >> 56))) - - #define wxINT64_SWAP_ALWAYS(val) \ - ((wxInt64) ( \ - (((wxUint64) (val) & (wxUint64) wxULL(0x00000000000000ff)) << 56) | \ - (((wxUint64) (val) & (wxUint64) wxULL(0x000000000000ff00)) << 40) | \ - (((wxUint64) (val) & (wxUint64) wxULL(0x0000000000ff0000)) << 24) | \ - (((wxUint64) (val) & (wxUint64) wxULL(0x00000000ff000000)) << 8) | \ - (((wxUint64) (val) & (wxUint64) wxULL(0x000000ff00000000)) >> 8) | \ - (((wxUint64) (val) & (wxUint64) wxULL(0x0000ff0000000000)) >> 24) | \ - (((wxUint64) (val) & (wxUint64) wxULL(0x00ff000000000000)) >> 40) | \ - (((wxUint64) (val) & (wxUint64) wxULL(0xff00000000000000)) >> 56))) -#elif wxUSE_LONGLONG /* !wxLongLong_t */ - #define wxUINT64_SWAP_ALWAYS(val) \ - ((wxUint64) ( \ - ((wxULongLong(val) & wxULongLong(0L, 0x000000ffU)) << 56) | \ - ((wxULongLong(val) & wxULongLong(0L, 0x0000ff00U)) << 40) | \ - ((wxULongLong(val) & wxULongLong(0L, 0x00ff0000U)) << 24) | \ - ((wxULongLong(val) & wxULongLong(0L, 0xff000000U)) << 8) | \ - ((wxULongLong(val) & wxULongLong(0x000000ffL, 0U)) >> 8) | \ - ((wxULongLong(val) & wxULongLong(0x0000ff00L, 0U)) >> 24) | \ - ((wxULongLong(val) & wxULongLong(0x00ff0000L, 0U)) >> 40) | \ - ((wxULongLong(val) & wxULongLong(0xff000000L, 0U)) >> 56))) - - #define wxINT64_SWAP_ALWAYS(val) \ - ((wxInt64) ( \ - ((wxLongLong(val) & wxLongLong(0L, 0x000000ffU)) << 56) | \ - ((wxLongLong(val) & wxLongLong(0L, 0x0000ff00U)) << 40) | \ - ((wxLongLong(val) & wxLongLong(0L, 0x00ff0000U)) << 24) | \ - ((wxLongLong(val) & wxLongLong(0L, 0xff000000U)) << 8) | \ - ((wxLongLong(val) & wxLongLong(0x000000ffL, 0U)) >> 8) | \ - ((wxLongLong(val) & wxLongLong(0x0000ff00L, 0U)) >> 24) | \ - ((wxLongLong(val) & wxLongLong(0x00ff0000L, 0U)) >> 40) | \ - ((wxLongLong(val) & wxLongLong(0xff000000L, 0U)) >> 56))) -#endif /* wxLongLong_t/!wxLongLong_t */ - -#ifdef WORDS_BIGENDIAN - #define wxUINT16_SWAP_ON_BE(val) wxUINT16_SWAP_ALWAYS(val) - #define wxINT16_SWAP_ON_BE(val) wxINT16_SWAP_ALWAYS(val) - #define wxUINT16_SWAP_ON_LE(val) (val) - #define wxINT16_SWAP_ON_LE(val) (val) - #define wxUINT32_SWAP_ON_BE(val) wxUINT32_SWAP_ALWAYS(val) - #define wxINT32_SWAP_ON_BE(val) wxINT32_SWAP_ALWAYS(val) - #define wxUINT32_SWAP_ON_LE(val) (val) - #define wxINT32_SWAP_ON_LE(val) (val) - #if wxHAS_INT64 - #define wxUINT64_SWAP_ON_BE(val) wxUINT64_SWAP_ALWAYS(val) - #define wxUINT64_SWAP_ON_LE(val) (val) - #endif -#else - #define wxUINT16_SWAP_ON_LE(val) wxUINT16_SWAP_ALWAYS(val) - #define wxINT16_SWAP_ON_LE(val) wxINT16_SWAP_ALWAYS(val) - #define wxUINT16_SWAP_ON_BE(val) (val) - #define wxINT16_SWAP_ON_BE(val) (val) - #define wxUINT32_SWAP_ON_LE(val) wxUINT32_SWAP_ALWAYS(val) - #define wxINT32_SWAP_ON_LE(val) wxINT32_SWAP_ALWAYS(val) - #define wxUINT32_SWAP_ON_BE(val) (val) - #define wxINT32_SWAP_ON_BE(val) (val) - #if wxHAS_INT64 - #define wxUINT64_SWAP_ON_LE(val) wxUINT64_SWAP_ALWAYS(val) - #define wxUINT64_SWAP_ON_BE(val) (val) - #endif -#endif - -/* ---------------------------------------------------------------------------- */ -/* Geometric flags */ -/* ---------------------------------------------------------------------------- */ - -enum wxGeometryCentre -{ - wxCENTRE = 0x0001, - wxCENTER = wxCENTRE -}; - -/* centering into frame rather than screen (obsolete) */ -#define wxCENTER_FRAME 0x0000 -/* centre on screen rather than parent */ -#define wxCENTRE_ON_SCREEN 0x0002 -#define wxCENTER_ON_SCREEN wxCENTRE_ON_SCREEN - -enum wxOrientation -{ - /* don't change the values of these elements, they are used elsewhere */ - wxHORIZONTAL = 0x0004, - wxVERTICAL = 0x0008, - - wxBOTH = wxVERTICAL | wxHORIZONTAL -}; - -enum wxDirection -{ - wxLEFT = 0x0010, - wxRIGHT = 0x0020, - wxUP = 0x0040, - wxDOWN = 0x0080, - - wxTOP = wxUP, - wxBOTTOM = wxDOWN, - - wxNORTH = wxUP, - wxSOUTH = wxDOWN, - wxWEST = wxLEFT, - wxEAST = wxRIGHT, - - wxALL = (wxUP | wxDOWN | wxRIGHT | wxLEFT) -}; - -enum wxAlignment -{ - wxALIGN_NOT = 0x0000, - wxALIGN_CENTER_HORIZONTAL = 0x0100, - wxALIGN_CENTRE_HORIZONTAL = wxALIGN_CENTER_HORIZONTAL, - wxALIGN_LEFT = wxALIGN_NOT, - wxALIGN_TOP = wxALIGN_NOT, - wxALIGN_RIGHT = 0x0200, - wxALIGN_BOTTOM = 0x0400, - wxALIGN_CENTER_VERTICAL = 0x0800, - wxALIGN_CENTRE_VERTICAL = wxALIGN_CENTER_VERTICAL, - - wxALIGN_CENTER = (wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL), - wxALIGN_CENTRE = wxALIGN_CENTER, - - /* a mask to extract alignment from the combination of flags */ - wxALIGN_MASK = 0x0f00 -}; - -enum wxStretch -{ - wxSTRETCH_NOT = 0x0000, - wxSHRINK = 0x1000, - wxGROW = 0x2000, - wxEXPAND = wxGROW, - wxSHAPED = 0x4000, - wxFIXED_MINSIZE = 0x8000, -#if wxABI_VERSION >= 20808 - wxRESERVE_SPACE_EVEN_IF_HIDDEN = 0x0002, -#endif - wxTILE = 0xc000, - - /* for compatibility only, default now, don't use explicitly any more */ -#if WXWIN_COMPATIBILITY_2_4 - wxADJUST_MINSIZE = 0x00100000 -#else - wxADJUST_MINSIZE = 0 -#endif -}; - -/* border flags: the values are chosen for backwards compatibility */ -enum wxBorder -{ - /* this is different from wxBORDER_NONE as by default the controls do have */ - /* border */ - wxBORDER_DEFAULT = 0, - - wxBORDER_NONE = 0x00200000, - wxBORDER_STATIC = 0x01000000, - wxBORDER_SIMPLE = 0x02000000, - wxBORDER_RAISED = 0x04000000, - wxBORDER_SUNKEN = 0x08000000, - wxBORDER_DOUBLE = 0x10000000, /* deprecated */ - wxBORDER_THEME = 0x10000000, - - /* a mask to extract border style from the combination of flags */ - wxBORDER_MASK = 0x1f200000 -}; - -/* This makes it easier to specify a 'normal' border for a control */ -#if defined(__SMARTPHONE__) || defined(__POCKETPC__) -#define wxDEFAULT_CONTROL_BORDER wxBORDER_SIMPLE -#else -#define wxDEFAULT_CONTROL_BORDER wxBORDER_SUNKEN -#endif - -/* ---------------------------------------------------------------------------- */ -/* Window style flags */ -/* ---------------------------------------------------------------------------- */ - -/* - * Values are chosen so they can be |'ed in a bit list. - * Some styles are used across more than one group, - * so the values mustn't clash with others in the group. - * Otherwise, numbers can be reused across groups. - * - * From version 1.66: - * Window (cross-group) styles now take up the first half - * of the flag, and control-specific styles the - * second half. - * - */ - -/* - * Window (Frame/dialog/subwindow/panel item) style flags - */ -#define wxVSCROLL 0x80000000 -#define wxHSCROLL 0x40000000 -#define wxCAPTION 0x20000000 - -/* New styles (border styles are now in their own enum) */ -#define wxDOUBLE_BORDER wxBORDER_DOUBLE -#define wxSUNKEN_BORDER wxBORDER_SUNKEN -#define wxRAISED_BORDER wxBORDER_RAISED -#define wxBORDER wxBORDER_SIMPLE -#define wxSIMPLE_BORDER wxBORDER_SIMPLE -#define wxSTATIC_BORDER wxBORDER_STATIC -#define wxNO_BORDER wxBORDER_NONE - -/* wxALWAYS_SHOW_SB: instead of hiding the scrollbar when it is not needed, */ -/* disable it - but still show (see also wxLB_ALWAYS_SB style) */ -/* */ -/* NB: as this style is only supported by wxUniversal and wxMSW so far */ -#define wxALWAYS_SHOW_SB 0x00800000 - -/* Clip children when painting, which reduces flicker in e.g. frames and */ -/* splitter windows, but can't be used in a panel where a static box must be */ -/* 'transparent' (panel paints the background for it) */ -#define wxCLIP_CHILDREN 0x00400000 - -/* Note we're reusing the wxCAPTION style because we won't need captions */ -/* for subwindows/controls */ -#define wxCLIP_SIBLINGS 0x20000000 - -#define wxTRANSPARENT_WINDOW 0x00100000 - -/* Add this style to a panel to get tab traversal working outside of dialogs */ -/* (on by default for wxPanel, wxDialog, wxScrolledWindow) */ -#define wxTAB_TRAVERSAL 0x00080000 - -/* Add this style if the control wants to get all keyboard messages (under */ -/* Windows, it won't normally get the dialog navigation key events) */ -#define wxWANTS_CHARS 0x00040000 - -/* Make window retained (Motif only, see src/generic/scrolwing.cpp) - * This is non-zero only under wxMotif, to avoid a clash with wxPOPUP_WINDOW - * on other platforms - */ - -#ifdef __WXMOTIF__ -#define wxRETAINED 0x00020000 -#else -#define wxRETAINED 0x00000000 -#endif -#define wxBACKINGSTORE wxRETAINED - -/* set this flag to create a special popup window: it will be always shown on */ -/* top of other windows, will capture the mouse and will be dismissed when the */ -/* mouse is clicked outside of it or if it loses focus in any other way */ -#define wxPOPUP_WINDOW 0x00020000 - -/* force a full repaint when the window is resized (instead of repainting just */ -/* the invalidated area) */ -#define wxFULL_REPAINT_ON_RESIZE 0x00010000 - -/* obsolete: now this is the default behaviour */ -/* */ -/* don't invalidate the whole window (resulting in a PAINT event) when the */ -/* window is resized (currently, makes sense for wxMSW only) */ -#define wxNO_FULL_REPAINT_ON_RESIZE 0 - -/* A mask which can be used to filter (out) all wxWindow-specific styles. - */ -#define wxWINDOW_STYLE_MASK \ - (wxVSCROLL|wxHSCROLL|wxBORDER_MASK|wxALWAYS_SHOW_SB|wxCLIP_CHILDREN| \ - wxCLIP_SIBLINGS|wxTRANSPARENT_WINDOW|wxTAB_TRAVERSAL|wxWANTS_CHARS| \ - wxRETAINED|wxPOPUP_WINDOW|wxFULL_REPAINT_ON_RESIZE) - -/* - * Extra window style flags (use wxWS_EX prefix to make it clear that they - * should be passed to wxWindow::SetExtraStyle(), not SetWindowStyle()) - */ - -/* by default, TransferDataTo/FromWindow() only work on direct children of the */ -/* window (compatible behaviour), set this flag to make them recursively */ -/* descend into all subwindows */ -#define wxWS_EX_VALIDATE_RECURSIVELY 0x00000001 - -/* wxCommandEvents and the objects of the derived classes are forwarded to the */ -/* parent window and so on recursively by default. Using this flag for the */ -/* given window allows to block this propagation at this window, i.e. prevent */ -/* the events from being propagated further upwards. The dialogs have this */ -/* flag on by default. */ -#define wxWS_EX_BLOCK_EVENTS 0x00000002 - -/* don't use this window as an implicit parent for the other windows: this must */ -/* be used with transient windows as otherwise there is the risk of creating a */ -/* dialog/frame with this window as a parent which would lead to a crash if the */ -/* parent is destroyed before the child */ -#define wxWS_EX_TRANSIENT 0x00000004 - -/* don't paint the window background, we'll assume it will */ -/* be done by a theming engine. This is not yet used but could */ -/* possibly be made to work in the future, at least on Windows */ -#define wxWS_EX_THEMED_BACKGROUND 0x00000008 - -/* this window should always process idle events */ -#define wxWS_EX_PROCESS_IDLE 0x00000010 - -/* this window should always process UI update events */ -#define wxWS_EX_PROCESS_UI_UPDATES 0x00000020 - -/* Draw the window in a metal theme on Mac */ -#define wxFRAME_EX_METAL 0x00000040 -#define wxDIALOG_EX_METAL 0x00000040 - -/* Use this style to add a context-sensitive help to the window (currently for */ -/* Win32 only and it doesn't work if wxMINIMIZE_BOX or wxMAXIMIZE_BOX are used) */ -#define wxWS_EX_CONTEXTHELP 0x00000080 - -/* synonyms for wxWS_EX_CONTEXTHELP for compatibility */ -#define wxFRAME_EX_CONTEXTHELP wxWS_EX_CONTEXTHELP -#define wxDIALOG_EX_CONTEXTHELP wxWS_EX_CONTEXTHELP - -/* Create a window which is attachable to another top level window */ -#define wxFRAME_DRAWER 0x0020 - -/* - * MDI parent frame style flags - * Can overlap with some of the above. - */ - -#define wxFRAME_NO_WINDOW_MENU 0x0100 - -/* - * wxMenuBar style flags - */ -/* use native docking */ -#define wxMB_DOCKABLE 0x0001 - -/* - * wxMenu style flags - */ -#define wxMENU_TEAROFF 0x0001 - -/* - * Apply to all panel items - */ -#define wxCOLOURED 0x0800 -#define wxFIXED_LENGTH 0x0400 - -/* - * Styles for wxListBox - */ -#define wxLB_SORT 0x0010 -#define wxLB_SINGLE 0x0020 -#define wxLB_MULTIPLE 0x0040 -#define wxLB_EXTENDED 0x0080 -/* wxLB_OWNERDRAW is Windows-only */ -#define wxLB_OWNERDRAW 0x0100 -#define wxLB_NEEDED_SB 0x0200 -#define wxLB_ALWAYS_SB 0x0400 -#define wxLB_HSCROLL wxHSCROLL -/* always show an entire number of rows */ -#define wxLB_INT_HEIGHT 0x0800 - -#if WXWIN_COMPATIBILITY_2_6 - /* deprecated synonyms */ - #define wxPROCESS_ENTER 0x0400 /* wxTE_PROCESS_ENTER */ - #define wxPASSWORD 0x0800 /* wxTE_PASSWORD */ -#endif - -/* - * wxComboBox style flags - */ -#define wxCB_SIMPLE 0x0004 -#define wxCB_SORT 0x0008 -#define wxCB_READONLY 0x0010 -#define wxCB_DROPDOWN 0x0020 - -/* - * wxRadioBox style flags - */ -/* should we number the items from left to right or from top to bottom in a 2d */ -/* radiobox? */ -#define wxRA_LEFTTORIGHT 0x0001 -#define wxRA_TOPTOBOTTOM 0x0002 - -/* New, more intuitive names to specify majorDim argument */ -#define wxRA_SPECIFY_COLS wxHORIZONTAL -#define wxRA_SPECIFY_ROWS wxVERTICAL - -/* Old names for compatibility */ -#define wxRA_HORIZONTAL wxHORIZONTAL -#define wxRA_VERTICAL wxVERTICAL -#define wxRA_USE_CHECKBOX 0x0010 /* alternative native subcontrols (wxPalmOS) */ - -/* - * wxRadioButton style flag - */ -#define wxRB_GROUP 0x0004 -#define wxRB_SINGLE 0x0008 -#define wxRB_USE_CHECKBOX 0x0010 /* alternative native control (wxPalmOS) */ - -/* - * wxScrollBar flags - */ -#define wxSB_HORIZONTAL wxHORIZONTAL -#define wxSB_VERTICAL wxVERTICAL - -/* - * wxSpinButton flags. - * Note that a wxSpinCtrl is sometimes defined as - * a wxTextCtrl, and so the flags must be different - * from wxTextCtrl's. - */ -#define wxSP_HORIZONTAL wxHORIZONTAL /* 4 */ -#define wxSP_VERTICAL wxVERTICAL /* 8 */ -#define wxSP_ARROW_KEYS 0x1000 -#define wxSP_WRAP 0x2000 - -/* - * wxTabCtrl flags - */ -#define wxTC_RIGHTJUSTIFY 0x0010 -#define wxTC_FIXEDWIDTH 0x0020 -#define wxTC_TOP 0x0000 /* default */ -#define wxTC_LEFT 0x0020 -#define wxTC_RIGHT 0x0040 -#define wxTC_BOTTOM 0x0080 -#define wxTC_MULTILINE 0x0200 /* == wxNB_MULTILINE */ -#define wxTC_OWNERDRAW 0x0400 - -/* - * wxStatusBar95 flags - */ -#define wxST_SIZEGRIP 0x0010 - -/* - * wxStaticText flags - */ -#define wxST_NO_AUTORESIZE 0x0001 -#define wxST_DOTS_MIDDLE 0x0002 -#define wxST_DOTS_END 0x0004 - -/* - * wxStaticBitmap flags - */ -#define wxBI_EXPAND wxEXPAND - -/* - * wxStaticLine flags - */ -#define wxLI_HORIZONTAL wxHORIZONTAL -#define wxLI_VERTICAL wxVERTICAL - - -/* - * extended dialog specifiers. these values are stored in a different - * flag and thus do not overlap with other style flags. note that these - * values do not correspond to the return values of the dialogs (for - * those values, look at the wxID_XXX defines). - */ - -/* wxCENTRE already defined as 0x00000001 */ -#define wxYES 0x00000002 -#define wxOK 0x00000004 -#define wxNO 0x00000008 -#define wxYES_NO (wxYES | wxNO) -#define wxCANCEL 0x00000010 - -#define wxYES_DEFAULT 0x00000000 /* has no effect (default) */ -#define wxNO_DEFAULT 0x00000080 - -#define wxICON_EXCLAMATION 0x00000100 -#define wxICON_HAND 0x00000200 -#define wxICON_WARNING wxICON_EXCLAMATION -#define wxICON_ERROR wxICON_HAND -#define wxICON_QUESTION 0x00000400 -#define wxICON_INFORMATION 0x00000800 -#define wxICON_STOP wxICON_HAND -#define wxICON_ASTERISK wxICON_INFORMATION -#define wxICON_MASK (0x00000100|0x00000200|0x00000400|0x00000800) - -#define wxFORWARD 0x00001000 -#define wxBACKWARD 0x00002000 -#define wxRESET 0x00004000 -#define wxHELP 0x00008000 -#define wxMORE 0x00010000 -#define wxSETUP 0x00020000 - -/* - * Background styles. See wxWindow::SetBackgroundStyle - */ - -enum wxBackgroundStyle -{ - wxBG_STYLE_SYSTEM, - wxBG_STYLE_COLOUR, - wxBG_STYLE_CUSTOM -}; - -/* ---------------------------------------------------------------------------- */ -/* standard IDs */ -/* ---------------------------------------------------------------------------- */ - -/* Standard menu IDs */ -enum -{ - /* no id matches this one when compared to it */ - wxID_NONE = -3, - - /* id for a separator line in the menu (invalid for normal item) */ - wxID_SEPARATOR = -2, - - /* any id: means that we don't care about the id, whether when installing - * an event handler or when creating a new window */ - wxID_ANY = -1, - - - /* all predefined ids are between wxID_LOWEST and wxID_HIGHEST */ - wxID_LOWEST = 4999, - - wxID_OPEN, - wxID_CLOSE, - wxID_NEW, - wxID_SAVE, - wxID_SAVEAS, - wxID_REVERT, - wxID_EXIT, - wxID_UNDO, - wxID_REDO, - wxID_HELP, - wxID_PRINT, - wxID_PRINT_SETUP, - wxID_PAGE_SETUP, - wxID_PREVIEW, - wxID_ABOUT, - wxID_HELP_CONTENTS, - wxID_HELP_INDEX, - wxID_HELP_SEARCH, - wxID_HELP_COMMANDS, - wxID_HELP_PROCEDURES, - wxID_HELP_CONTEXT, - wxID_CLOSE_ALL, - wxID_PREFERENCES, - - wxID_EDIT = 5030, - wxID_CUT, - wxID_COPY, - wxID_PASTE, - wxID_CLEAR, - wxID_FIND, - wxID_DUPLICATE, - wxID_SELECTALL, - wxID_DELETE, - wxID_REPLACE, - wxID_REPLACE_ALL, - wxID_PROPERTIES, - - wxID_VIEW_DETAILS, - wxID_VIEW_LARGEICONS, - wxID_VIEW_SMALLICONS, - wxID_VIEW_LIST, - wxID_VIEW_SORTDATE, - wxID_VIEW_SORTNAME, - wxID_VIEW_SORTSIZE, - wxID_VIEW_SORTTYPE, - - wxID_FILE = 5050, - wxID_FILE1, - wxID_FILE2, - wxID_FILE3, - wxID_FILE4, - wxID_FILE5, - wxID_FILE6, - wxID_FILE7, - wxID_FILE8, - wxID_FILE9, - - /* Standard button and menu IDs */ - wxID_OK = 5100, - wxID_CANCEL, - wxID_APPLY, - wxID_YES, - wxID_NO, - wxID_STATIC, - wxID_FORWARD, - wxID_BACKWARD, - wxID_DEFAULT, - wxID_MORE, - wxID_SETUP, - wxID_RESET, - wxID_CONTEXT_HELP, - wxID_YESTOALL, - wxID_NOTOALL, - wxID_ABORT, - wxID_RETRY, - wxID_IGNORE, - wxID_ADD, - wxID_REMOVE, - - wxID_UP, - wxID_DOWN, - wxID_HOME, - wxID_REFRESH, - wxID_STOP, - wxID_INDEX, - - wxID_BOLD, - wxID_ITALIC, - wxID_JUSTIFY_CENTER, - wxID_JUSTIFY_FILL, - wxID_JUSTIFY_RIGHT, - wxID_JUSTIFY_LEFT, - wxID_UNDERLINE, - wxID_INDENT, - wxID_UNINDENT, - wxID_ZOOM_100, - wxID_ZOOM_FIT, - wxID_ZOOM_IN, - wxID_ZOOM_OUT, - wxID_UNDELETE, - wxID_REVERT_TO_SAVED, - - /* System menu IDs (used by wxUniv): */ - wxID_SYSTEM_MENU = 5200, - wxID_CLOSE_FRAME, - wxID_MOVE_FRAME, - wxID_RESIZE_FRAME, - wxID_MAXIMIZE_FRAME, - wxID_ICONIZE_FRAME, - wxID_RESTORE_FRAME, - - /* IDs used by generic file dialog (13 consecutive starting from this value) */ - wxID_FILEDLGG = 5900, - - wxID_HIGHEST = 5999 -}; - -/* ---------------------------------------------------------------------------- */ -/* other constants */ -/* ---------------------------------------------------------------------------- */ - -/* menu and toolbar item kinds */ -enum wxItemKind -{ - wxITEM_SEPARATOR = -1, - wxITEM_NORMAL, - wxITEM_CHECK, - wxITEM_RADIO, - wxITEM_MAX -}; - -/* hit test results */ -enum wxHitTest -{ - wxHT_NOWHERE, - - /* scrollbar */ - wxHT_SCROLLBAR_FIRST = wxHT_NOWHERE, - wxHT_SCROLLBAR_ARROW_LINE_1, /* left or upper arrow to scroll by line */ - wxHT_SCROLLBAR_ARROW_LINE_2, /* right or down */ - wxHT_SCROLLBAR_ARROW_PAGE_1, /* left or upper arrow to scroll by page */ - wxHT_SCROLLBAR_ARROW_PAGE_2, /* right or down */ - wxHT_SCROLLBAR_THUMB, /* on the thumb */ - wxHT_SCROLLBAR_BAR_1, /* bar to the left/above the thumb */ - wxHT_SCROLLBAR_BAR_2, /* bar to the right/below the thumb */ - wxHT_SCROLLBAR_LAST, - - /* window */ - wxHT_WINDOW_OUTSIDE, /* not in this window at all */ - wxHT_WINDOW_INSIDE, /* in the client area */ - wxHT_WINDOW_VERT_SCROLLBAR, /* on the vertical scrollbar */ - wxHT_WINDOW_HORZ_SCROLLBAR, /* on the horizontal scrollbar */ - wxHT_WINDOW_CORNER, /* on the corner between 2 scrollbars */ - - wxHT_MAX -}; - -/* ---------------------------------------------------------------------------- */ -/* Possible SetSize flags */ -/* ---------------------------------------------------------------------------- */ - -/* Use internally-calculated width if -1 */ -#define wxSIZE_AUTO_WIDTH 0x0001 -/* Use internally-calculated height if -1 */ -#define wxSIZE_AUTO_HEIGHT 0x0002 -/* Use internally-calculated width and height if each is -1 */ -#define wxSIZE_AUTO (wxSIZE_AUTO_WIDTH|wxSIZE_AUTO_HEIGHT) -/* Ignore missing (-1) dimensions (use existing). */ -/* For readability only: test for wxSIZE_AUTO_WIDTH/HEIGHT in code. */ -#define wxSIZE_USE_EXISTING 0x0000 -/* Allow -1 as a valid position */ -#define wxSIZE_ALLOW_MINUS_ONE 0x0004 -/* Don't do parent client adjustments (for implementation only) */ -#define wxSIZE_NO_ADJUSTMENTS 0x0008 -/* Change the window position even if it seems to be already correct */ -#define wxSIZE_FORCE 0x0010 - -/* ---------------------------------------------------------------------------- */ -/* GDI descriptions */ -/* ---------------------------------------------------------------------------- */ - -enum -{ - /* Text font families */ - wxDEFAULT = 70, - wxDECORATIVE, - wxROMAN, - wxSCRIPT, - wxSWISS, - wxMODERN, - wxTELETYPE, /* @@@@ */ - - /* Proportional or Fixed width fonts (not yet used) */ - wxVARIABLE = 80, - wxFIXED, - - wxNORMAL = 90, - wxLIGHT, - wxBOLD, - /* Also wxNORMAL for normal (non-italic text) */ - wxITALIC, - wxSLANT, - - /* Pen styles */ - wxSOLID = 100, - wxDOT, - wxLONG_DASH, - wxSHORT_DASH, - wxDOT_DASH, - wxUSER_DASH, - - wxTRANSPARENT, - - /* Brush & Pen Stippling. Note that a stippled pen cannot be dashed!! */ - /* Note also that stippling a Pen IS meaningfull, because a Line is */ - wxSTIPPLE_MASK_OPAQUE, /* mask is used for blitting monochrome using text fore and back ground colors */ - wxSTIPPLE_MASK, /* mask is used for masking areas in the stipple bitmap (TO DO) */ - /* drawn with a Pen, and without any Brush -- and it can be stippled. */ - wxSTIPPLE = 110, - - wxBDIAGONAL_HATCH, /* In wxWidgets < 2.6 use WX_HATCH macro */ - wxCROSSDIAG_HATCH, /* to verify these wx*_HATCH are in style */ - wxFDIAGONAL_HATCH, /* of wxBrush. In wxWidgets >= 2.6 use */ - wxCROSS_HATCH, /* wxBrush::IsHatch() instead. */ - wxHORIZONTAL_HATCH, - wxVERTICAL_HATCH, - wxFIRST_HATCH = wxBDIAGONAL_HATCH, - wxLAST_HATCH = wxVERTICAL_HATCH, - - wxJOIN_BEVEL = 120, - wxJOIN_MITER, - wxJOIN_ROUND, - - wxCAP_ROUND = 130, - wxCAP_PROJECTING, - wxCAP_BUTT -}; - -#if WXWIN_COMPATIBILITY_2_4 - #define IS_HATCH(s) ((s)>=wxFIRST_HATCH && (s)<=wxLAST_HATCH) -#else - /* use wxBrush::IsHatch() instead thought wxMotif still uses it in src/motif/dcclient.cpp */ -#endif - -/* Logical ops */ -typedef enum -{ - wxCLEAR, wxROP_BLACK = wxCLEAR, wxBLIT_BLACKNESS = wxCLEAR, /* 0 */ - wxXOR, wxROP_XORPEN = wxXOR, wxBLIT_SRCINVERT = wxXOR, /* src XOR dst */ - wxINVERT, wxROP_NOT = wxINVERT, wxBLIT_DSTINVERT = wxINVERT, /* NOT dst */ - wxOR_REVERSE, wxROP_MERGEPENNOT = wxOR_REVERSE, wxBLIT_00DD0228 = wxOR_REVERSE, /* src OR (NOT dst) */ - wxAND_REVERSE, wxROP_MASKPENNOT = wxAND_REVERSE, wxBLIT_SRCERASE = wxAND_REVERSE, /* src AND (NOT dst) */ - wxCOPY, wxROP_COPYPEN = wxCOPY, wxBLIT_SRCCOPY = wxCOPY, /* src */ - wxAND, wxROP_MASKPEN = wxAND, wxBLIT_SRCAND = wxAND, /* src AND dst */ - wxAND_INVERT, wxROP_MASKNOTPEN = wxAND_INVERT, wxBLIT_00220326 = wxAND_INVERT, /* (NOT src) AND dst */ - wxNO_OP, wxROP_NOP = wxNO_OP, wxBLIT_00AA0029 = wxNO_OP, /* dst */ - wxNOR, wxROP_NOTMERGEPEN = wxNOR, wxBLIT_NOTSRCERASE = wxNOR, /* (NOT src) AND (NOT dst) */ - wxEQUIV, wxROP_NOTXORPEN = wxEQUIV, wxBLIT_00990066 = wxEQUIV, /* (NOT src) XOR dst */ - wxSRC_INVERT, wxROP_NOTCOPYPEN = wxSRC_INVERT, wxBLIT_NOTSCRCOPY = wxSRC_INVERT, /* (NOT src) */ - wxOR_INVERT, wxROP_MERGENOTPEN = wxOR_INVERT, wxBLIT_MERGEPAINT = wxOR_INVERT, /* (NOT src) OR dst */ - wxNAND, wxROP_NOTMASKPEN = wxNAND, wxBLIT_007700E6 = wxNAND, /* (NOT src) OR (NOT dst) */ - wxOR, wxROP_MERGEPEN = wxOR, wxBLIT_SRCPAINT = wxOR, /* src OR dst */ - wxSET, wxROP_WHITE = wxSET, wxBLIT_WHITENESS = wxSET /* 1 */ -} form_ops_t; - -/* Flood styles */ -enum -{ - wxFLOOD_SURFACE = 1, - wxFLOOD_BORDER -}; - -/* Polygon filling mode */ -enum -{ - wxODDEVEN_RULE = 1, - wxWINDING_RULE -}; - -/* ToolPanel in wxFrame (VZ: unused?) */ -enum -{ - wxTOOL_TOP = 1, - wxTOOL_BOTTOM, - wxTOOL_LEFT, - wxTOOL_RIGHT -}; - -/* the values of the format constants should be the same as corresponding */ -/* CF_XXX constants in Windows API */ -enum wxDataFormatId -{ - wxDF_INVALID = 0, - wxDF_TEXT = 1, /* CF_TEXT */ - wxDF_BITMAP = 2, /* CF_BITMAP */ - wxDF_METAFILE = 3, /* CF_METAFILEPICT */ - wxDF_SYLK = 4, - wxDF_DIF = 5, - wxDF_TIFF = 6, - wxDF_OEMTEXT = 7, /* CF_OEMTEXT */ - wxDF_DIB = 8, /* CF_DIB */ - wxDF_PALETTE = 9, - wxDF_PENDATA = 10, - wxDF_RIFF = 11, - wxDF_WAVE = 12, - wxDF_UNICODETEXT = 13, - wxDF_ENHMETAFILE = 14, - wxDF_FILENAME = 15, /* CF_HDROP */ - wxDF_LOCALE = 16, - wxDF_PRIVATE = 20, - wxDF_HTML = 30, /* Note: does not correspond to CF_ constant */ - wxDF_MAX -}; - -/* Virtual keycodes */ -enum wxKeyCode -{ - WXK_BACK = 8, - WXK_TAB = 9, - WXK_RETURN = 13, - WXK_ESCAPE = 27, - WXK_SPACE = 32, - WXK_DELETE = 127, - - /* These are, by design, not compatible with unicode characters. - If you want to get a unicode character from a key event, use - wxKeyEvent::GetUnicodeKey instead. */ - WXK_START = 300, - WXK_LBUTTON, - WXK_RBUTTON, - WXK_CANCEL, - WXK_MBUTTON, - WXK_CLEAR, - WXK_SHIFT, - WXK_ALT, - WXK_CONTROL, - WXK_MENU, - WXK_PAUSE, - WXK_CAPITAL, - 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_NUMPAD0, - WXK_NUMPAD1, - WXK_NUMPAD2, - WXK_NUMPAD3, - WXK_NUMPAD4, - WXK_NUMPAD5, - WXK_NUMPAD6, - WXK_NUMPAD7, - WXK_NUMPAD8, - WXK_NUMPAD9, - WXK_MULTIPLY, - WXK_ADD, - WXK_SEPARATOR, - WXK_SUBTRACT, - WXK_DECIMAL, - WXK_DIVIDE, - WXK_F1, - WXK_F2, - WXK_F3, - WXK_F4, - WXK_F5, - WXK_F6, - WXK_F7, - WXK_F8, - WXK_F9, - WXK_F10, - WXK_F11, - WXK_F12, - WXK_F13, - WXK_F14, - WXK_F15, - WXK_F16, - WXK_F17, - WXK_F18, - WXK_F19, - WXK_F20, - WXK_F21, - WXK_F22, - WXK_F23, - WXK_F24, - WXK_NUMLOCK, - WXK_SCROLL, - WXK_PAGEUP, - WXK_PAGEDOWN, -#if WXWIN_COMPATIBILITY_2_6 - WXK_PRIOR = WXK_PAGEUP, - WXK_NEXT = WXK_PAGEDOWN, -#endif - - WXK_NUMPAD_SPACE, - WXK_NUMPAD_TAB, - WXK_NUMPAD_ENTER, - WXK_NUMPAD_F1, - WXK_NUMPAD_F2, - WXK_NUMPAD_F3, - WXK_NUMPAD_F4, - WXK_NUMPAD_HOME, - WXK_NUMPAD_LEFT, - WXK_NUMPAD_UP, - WXK_NUMPAD_RIGHT, - WXK_NUMPAD_DOWN, - WXK_NUMPAD_PAGEUP, - WXK_NUMPAD_PAGEDOWN, -#if WXWIN_COMPATIBILITY_2_6 - WXK_NUMPAD_PRIOR = WXK_NUMPAD_PAGEUP, - WXK_NUMPAD_NEXT = WXK_NUMPAD_PAGEDOWN, -#endif - 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, - - /* Hardware-specific buttons */ - WXK_SPECIAL1 = 193, - WXK_SPECIAL2, - WXK_SPECIAL3, - WXK_SPECIAL4, - WXK_SPECIAL5, - WXK_SPECIAL6, - WXK_SPECIAL7, - WXK_SPECIAL8, - WXK_SPECIAL9, - WXK_SPECIAL10, - WXK_SPECIAL11, - WXK_SPECIAL12, - WXK_SPECIAL13, - WXK_SPECIAL14, - WXK_SPECIAL15, - WXK_SPECIAL16, - WXK_SPECIAL17, - WXK_SPECIAL18, - WXK_SPECIAL19, - WXK_SPECIAL20 -}; - -/* This enum contains bit mask constants used in wxKeyEvent */ -enum wxKeyModifier -{ - wxMOD_NONE = 0x0000, - wxMOD_ALT = 0x0001, - wxMOD_CONTROL = 0x0002, - wxMOD_ALTGR = wxMOD_ALT | wxMOD_CONTROL, - wxMOD_SHIFT = 0x0004, - wxMOD_META = 0x0008, - wxMOD_WIN = wxMOD_META, -#if defined(__WXMAC__) || defined(__WXCOCOA__) - wxMOD_CMD = wxMOD_META, -#else - wxMOD_CMD = wxMOD_CONTROL, -#endif - wxMOD_ALL = 0xffff -}; - -/* Mapping modes (same values as used by Windows, don't change) */ -enum -{ - wxMM_TEXT = 1, - wxMM_LOMETRIC, - wxMM_HIMETRIC, - wxMM_LOENGLISH, - wxMM_HIENGLISH, - wxMM_TWIPS, - wxMM_ISOTROPIC, - wxMM_ANISOTROPIC, - wxMM_POINTS, - wxMM_METRIC -}; - -/* Shortcut for easier dialog-unit-to-pixel conversion */ -#define wxDLG_UNIT(parent, pt) parent->ConvertDialogToPixels(pt) - -/* Paper types */ -typedef enum -{ - wxPAPER_NONE, /* Use specific dimensions */ - wxPAPER_LETTER, /* Letter, 8 1/2 by 11 inches */ - wxPAPER_LEGAL, /* Legal, 8 1/2 by 14 inches */ - wxPAPER_A4, /* A4 Sheet, 210 by 297 millimeters */ - wxPAPER_CSHEET, /* C Sheet, 17 by 22 inches */ - wxPAPER_DSHEET, /* D Sheet, 22 by 34 inches */ - wxPAPER_ESHEET, /* E Sheet, 34 by 44 inches */ - wxPAPER_LETTERSMALL, /* Letter Small, 8 1/2 by 11 inches */ - wxPAPER_TABLOID, /* Tabloid, 11 by 17 inches */ - wxPAPER_LEDGER, /* Ledger, 17 by 11 inches */ - wxPAPER_STATEMENT, /* Statement, 5 1/2 by 8 1/2 inches */ - wxPAPER_EXECUTIVE, /* Executive, 7 1/4 by 10 1/2 inches */ - wxPAPER_A3, /* A3 sheet, 297 by 420 millimeters */ - wxPAPER_A4SMALL, /* A4 small sheet, 210 by 297 millimeters */ - wxPAPER_A5, /* A5 sheet, 148 by 210 millimeters */ - wxPAPER_B4, /* B4 sheet, 250 by 354 millimeters */ - wxPAPER_B5, /* B5 sheet, 182-by-257-millimeter paper */ - wxPAPER_FOLIO, /* Folio, 8-1/2-by-13-inch paper */ - wxPAPER_QUARTO, /* Quarto, 215-by-275-millimeter paper */ - wxPAPER_10X14, /* 10-by-14-inch sheet */ - wxPAPER_11X17, /* 11-by-17-inch sheet */ - wxPAPER_NOTE, /* Note, 8 1/2 by 11 inches */ - wxPAPER_ENV_9, /* #9 Envelope, 3 7/8 by 8 7/8 inches */ - wxPAPER_ENV_10, /* #10 Envelope, 4 1/8 by 9 1/2 inches */ - wxPAPER_ENV_11, /* #11 Envelope, 4 1/2 by 10 3/8 inches */ - wxPAPER_ENV_12, /* #12 Envelope, 4 3/4 by 11 inches */ - wxPAPER_ENV_14, /* #14 Envelope, 5 by 11 1/2 inches */ - wxPAPER_ENV_DL, /* DL Envelope, 110 by 220 millimeters */ - wxPAPER_ENV_C5, /* C5 Envelope, 162 by 229 millimeters */ - wxPAPER_ENV_C3, /* C3 Envelope, 324 by 458 millimeters */ - wxPAPER_ENV_C4, /* C4 Envelope, 229 by 324 millimeters */ - wxPAPER_ENV_C6, /* C6 Envelope, 114 by 162 millimeters */ - wxPAPER_ENV_C65, /* C65 Envelope, 114 by 229 millimeters */ - wxPAPER_ENV_B4, /* B4 Envelope, 250 by 353 millimeters */ - wxPAPER_ENV_B5, /* B5 Envelope, 176 by 250 millimeters */ - wxPAPER_ENV_B6, /* B6 Envelope, 176 by 125 millimeters */ - wxPAPER_ENV_ITALY, /* Italy Envelope, 110 by 230 millimeters */ - wxPAPER_ENV_MONARCH, /* Monarch Envelope, 3 7/8 by 7 1/2 inches */ - wxPAPER_ENV_PERSONAL, /* 6 3/4 Envelope, 3 5/8 by 6 1/2 inches */ - wxPAPER_FANFOLD_US, /* US Std Fanfold, 14 7/8 by 11 inches */ - wxPAPER_FANFOLD_STD_GERMAN, /* German Std Fanfold, 8 1/2 by 12 inches */ - wxPAPER_FANFOLD_LGL_GERMAN, /* German Legal Fanfold, 8 1/2 by 13 inches */ - - wxPAPER_ISO_B4, /* B4 (ISO) 250 x 353 mm */ - wxPAPER_JAPANESE_POSTCARD, /* Japanese Postcard 100 x 148 mm */ - wxPAPER_9X11, /* 9 x 11 in */ - wxPAPER_10X11, /* 10 x 11 in */ - wxPAPER_15X11, /* 15 x 11 in */ - wxPAPER_ENV_INVITE, /* Envelope Invite 220 x 220 mm */ - wxPAPER_LETTER_EXTRA, /* Letter Extra 9 \275 x 12 in */ - wxPAPER_LEGAL_EXTRA, /* Legal Extra 9 \275 x 15 in */ - wxPAPER_TABLOID_EXTRA, /* Tabloid Extra 11.69 x 18 in */ - wxPAPER_A4_EXTRA, /* A4 Extra 9.27 x 12.69 in */ - wxPAPER_LETTER_TRANSVERSE, /* Letter Transverse 8 \275 x 11 in */ - wxPAPER_A4_TRANSVERSE, /* A4 Transverse 210 x 297 mm */ - wxPAPER_LETTER_EXTRA_TRANSVERSE, /* Letter Extra Transverse 9\275 x 12 in */ - wxPAPER_A_PLUS, /* SuperA/SuperA/A4 227 x 356 mm */ - wxPAPER_B_PLUS, /* SuperB/SuperB/A3 305 x 487 mm */ - wxPAPER_LETTER_PLUS, /* Letter Plus 8.5 x 12.69 in */ - wxPAPER_A4_PLUS, /* A4 Plus 210 x 330 mm */ - wxPAPER_A5_TRANSVERSE, /* A5 Transverse 148 x 210 mm */ - wxPAPER_B5_TRANSVERSE, /* B5 (JIS) Transverse 182 x 257 mm */ - wxPAPER_A3_EXTRA, /* A3 Extra 322 x 445 mm */ - wxPAPER_A5_EXTRA, /* A5 Extra 174 x 235 mm */ - wxPAPER_B5_EXTRA, /* B5 (ISO) Extra 201 x 276 mm */ - wxPAPER_A2, /* A2 420 x 594 mm */ - wxPAPER_A3_TRANSVERSE, /* A3 Transverse 297 x 420 mm */ - wxPAPER_A3_EXTRA_TRANSVERSE, /* A3 Extra Transverse 322 x 445 mm */ - - wxPAPER_DBL_JAPANESE_POSTCARD,/* Japanese Double Postcard 200 x 148 mm */ - wxPAPER_A6, /* A6 105 x 148 mm */ - wxPAPER_JENV_KAKU2, /* Japanese Envelope Kaku #2 */ - wxPAPER_JENV_KAKU3, /* Japanese Envelope Kaku #3 */ - wxPAPER_JENV_CHOU3, /* Japanese Envelope Chou #3 */ - wxPAPER_JENV_CHOU4, /* Japanese Envelope Chou #4 */ - wxPAPER_LETTER_ROTATED, /* Letter Rotated 11 x 8 1/2 in */ - wxPAPER_A3_ROTATED, /* A3 Rotated 420 x 297 mm */ - wxPAPER_A4_ROTATED, /* A4 Rotated 297 x 210 mm */ - wxPAPER_A5_ROTATED, /* A5 Rotated 210 x 148 mm */ - wxPAPER_B4_JIS_ROTATED, /* B4 (JIS) Rotated 364 x 257 mm */ - wxPAPER_B5_JIS_ROTATED, /* B5 (JIS) Rotated 257 x 182 mm */ - wxPAPER_JAPANESE_POSTCARD_ROTATED,/* Japanese Postcard Rotated 148 x 100 mm */ - wxPAPER_DBL_JAPANESE_POSTCARD_ROTATED,/* Double Japanese Postcard Rotated 148 x 200 mm */ - wxPAPER_A6_ROTATED, /* A6 Rotated 148 x 105 mm */ - wxPAPER_JENV_KAKU2_ROTATED, /* Japanese Envelope Kaku #2 Rotated */ - wxPAPER_JENV_KAKU3_ROTATED, /* Japanese Envelope Kaku #3 Rotated */ - wxPAPER_JENV_CHOU3_ROTATED, /* Japanese Envelope Chou #3 Rotated */ - wxPAPER_JENV_CHOU4_ROTATED, /* Japanese Envelope Chou #4 Rotated */ - wxPAPER_B6_JIS, /* B6 (JIS) 128 x 182 mm */ - wxPAPER_B6_JIS_ROTATED, /* B6 (JIS) Rotated 182 x 128 mm */ - wxPAPER_12X11, /* 12 x 11 in */ - wxPAPER_JENV_YOU4, /* Japanese Envelope You #4 */ - wxPAPER_JENV_YOU4_ROTATED, /* Japanese Envelope You #4 Rotated */ - wxPAPER_P16K, /* PRC 16K 146 x 215 mm */ - wxPAPER_P32K, /* PRC 32K 97 x 151 mm */ - wxPAPER_P32KBIG, /* PRC 32K(Big) 97 x 151 mm */ - wxPAPER_PENV_1, /* PRC Envelope #1 102 x 165 mm */ - wxPAPER_PENV_2, /* PRC Envelope #2 102 x 176 mm */ - wxPAPER_PENV_3, /* PRC Envelope #3 125 x 176 mm */ - wxPAPER_PENV_4, /* PRC Envelope #4 110 x 208 mm */ - wxPAPER_PENV_5, /* PRC Envelope #5 110 x 220 mm */ - wxPAPER_PENV_6, /* PRC Envelope #6 120 x 230 mm */ - wxPAPER_PENV_7, /* PRC Envelope #7 160 x 230 mm */ - wxPAPER_PENV_8, /* PRC Envelope #8 120 x 309 mm */ - wxPAPER_PENV_9, /* PRC Envelope #9 229 x 324 mm */ - wxPAPER_PENV_10, /* PRC Envelope #10 324 x 458 mm */ - wxPAPER_P16K_ROTATED, /* PRC 16K Rotated */ - wxPAPER_P32K_ROTATED, /* PRC 32K Rotated */ - wxPAPER_P32KBIG_ROTATED, /* PRC 32K(Big) Rotated */ - wxPAPER_PENV_1_ROTATED, /* PRC Envelope #1 Rotated 165 x 102 mm */ - wxPAPER_PENV_2_ROTATED, /* PRC Envelope #2 Rotated 176 x 102 mm */ - wxPAPER_PENV_3_ROTATED, /* PRC Envelope #3 Rotated 176 x 125 mm */ - wxPAPER_PENV_4_ROTATED, /* PRC Envelope #4 Rotated 208 x 110 mm */ - wxPAPER_PENV_5_ROTATED, /* PRC Envelope #5 Rotated 220 x 110 mm */ - wxPAPER_PENV_6_ROTATED, /* PRC Envelope #6 Rotated 230 x 120 mm */ - wxPAPER_PENV_7_ROTATED, /* PRC Envelope #7 Rotated 230 x 160 mm */ - wxPAPER_PENV_8_ROTATED, /* PRC Envelope #8 Rotated 309 x 120 mm */ - wxPAPER_PENV_9_ROTATED, /* PRC Envelope #9 Rotated 324 x 229 mm */ - wxPAPER_PENV_10_ROTATED /* PRC Envelope #10 Rotated 458 x 324 m */ -} wxPaperSize; - -/* Printing orientation */ -#ifndef wxPORTRAIT -#define wxPORTRAIT 1 -#define wxLANDSCAPE 2 -#endif - -/* Duplex printing modes - */ - -enum wxDuplexMode -{ - wxDUPLEX_SIMPLEX, /* Non-duplex */ - wxDUPLEX_HORIZONTAL, - wxDUPLEX_VERTICAL -}; - -/* Print quality. - */ - -#define wxPRINT_QUALITY_HIGH -1 -#define wxPRINT_QUALITY_MEDIUM -2 -#define wxPRINT_QUALITY_LOW -3 -#define wxPRINT_QUALITY_DRAFT -4 - -typedef int wxPrintQuality; - -/* Print mode (currently PostScript only) - */ - -enum wxPrintMode -{ - wxPRINT_MODE_NONE = 0, - wxPRINT_MODE_PREVIEW = 1, /* Preview in external application */ - wxPRINT_MODE_FILE = 2, /* Print to file */ - wxPRINT_MODE_PRINTER = 3, /* Send to printer */ - wxPRINT_MODE_STREAM = 4 /* Send postscript data into a stream */ -}; - -/* ---------------------------------------------------------------------------- */ -/* UpdateWindowUI flags */ -/* ---------------------------------------------------------------------------- */ - -enum wxUpdateUI -{ - wxUPDATE_UI_NONE = 0x0000, - wxUPDATE_UI_RECURSE = 0x0001, - wxUPDATE_UI_FROMIDLE = 0x0002 /* Invoked from On(Internal)Idle */ -}; - -/* ---------------------------------------------------------------------------- */ -/* Notification Event flags - used for dock icon bouncing, etc. */ -/* ---------------------------------------------------------------------------- */ - -enum wxNotificationOptions -{ - wxNOTIFY_NONE = 0x0000, - wxNOTIFY_ONCE = 0x0001, - wxNOTIFY_REPEAT = 0x0002 -}; - -/* ---------------------------------------------------------------------------- */ -/* miscellaneous */ -/* ---------------------------------------------------------------------------- */ - -/* define this macro if font handling is done using the X font names */ -#if (defined(__WXGTK__) && !defined(__WXGTK20__)) || defined(__X__) - #define _WX_X_FONTLIKE -#endif - -/* macro to specify "All Files" on different platforms */ -#if defined(__WXMSW__) || defined(__WXPM__) -# define wxALL_FILES_PATTERN wxT("*.*") -# define wxALL_FILES gettext_noop("All files (*.*)|*.*") -#else -# define wxALL_FILES_PATTERN wxT("*") -# define wxALL_FILES gettext_noop("All files (*)|*") -#endif - -#if defined(__CYGWIN__) && defined(__WXMSW__) -# if wxUSE_STL || defined(wxUSE_STD_STRING) - /* - NASTY HACK because the gethostname in sys/unistd.h which the gnu - stl includes and wx builds with by default clash with each other - (windows version 2nd param is int, sys/unistd.h version is unsigned - int). - */ -# define gethostname gethostnameHACK -# include -# undef gethostname -# endif -#endif - -/* --------------------------------------------------------------------------- */ -/* macros that enable wxWidgets apps to be compiled in absence of the */ -/* sytem headers, although some platform specific types are used in the */ -/* platform specific (implementation) parts of the headers */ -/* --------------------------------------------------------------------------- */ - -#ifdef __WXMAC__ - -#define WX_OPAQUE_TYPE( name ) struct wxOpaque##name - -typedef unsigned char WXCOLORREF[6]; -typedef void* WXCGIMAGEREF; -typedef void* WXHBITMAP; -typedef void* WXHCURSOR; -typedef void* WXHRGN; -typedef void* WXRECTPTR; -typedef void* WXPOINTPTR; -typedef void* WXHWND; -typedef void* WXEVENTREF; -typedef void* WXEVENTHANDLERREF; -typedef void* WXEVENTHANDLERCALLREF; -typedef void* WXAPPLEEVENTREF; -typedef void* WXHDC; -typedef void* WXHMENU; -typedef unsigned int WXUINT; -typedef unsigned long WXDWORD; -typedef unsigned short WXWORD; - -typedef WX_OPAQUE_TYPE(CIconHandle ) * WXHICON ; -typedef WX_OPAQUE_TYPE(PicHandle ) * WXHMETAFILE ; - - -/* typedef void* WXWidget; */ -/* typedef void* WXWindow; */ -typedef WX_OPAQUE_TYPE(ControlRef ) * WXWidget ; -typedef WX_OPAQUE_TYPE(WindowRef) * WXWindow ; -typedef void* WXDisplay; - -/* typedef WindowPtr WXHWND; */ -/* typedef Handle WXHANDLE; */ -/* typedef CIconHandle WXHICON; */ -/* typedef unsigned long WXHFONT; */ -/* typedef MenuHandle WXHMENU; */ -/* typedef unsigned long WXHPEN; */ -/* typedef unsigned long WXHBRUSH; */ -/* typedef unsigned long WXHPALETTE; */ -/* typedef CursHandle WXHCURSOR; */ -/* typedef RgnHandle WXHRGN; */ -/* typedef unsigned long WXHACCEL; */ -/* typedef unsigned long WXHINSTANCE; */ -/* typedef unsigned long WXHIMAGELIST; */ -/* typedef unsigned long WXHGLOBAL; */ -/* typedef GrafPtr WXHDC; */ -/* typedef unsigned int WXWPARAM; */ -/* typedef long WXLPARAM; */ -/* typedef void * WXRGNDATA; */ -/* typedef void * WXMSG; */ -/* typedef unsigned long WXHCONV; */ -/* typedef unsigned long WXHKEY; */ -/* typedef void * WXDRAWITEMSTRUCT; */ -/* typedef void * WXMEASUREITEMSTRUCT; */ -/* typedef void * WXLPCREATESTRUCT; */ -/* typedef int (*WXFARPROC)(); */ - -/* typedef WindowPtr WXWindow; */ -/* typedef ControlHandle WXWidget; */ - -#endif - -#if defined( __WXCOCOA__ ) || ( defined(__WXMAC__) && defined(__DARWIN__) ) - -/* Definitions of 32-bit/64-bit types - * These are typedef'd exactly the same way in newer OS X headers so - * redefinition when real headers are included should not be a problem. If - * it is, the types are being defined wrongly here. - * The purpose of these types is so they can be used from public wx headers. - * and also because the older (pre-Leopard) headers don't define them. - */ - -/* NOTE: We don't pollute namespace with CGFLOAT_MIN/MAX/IS_DOUBLE macros - * since they are unlikely to be needed in a public header. - */ -#if defined(__LP64__) && __LP64__ - typedef double CGFloat; -#else - typedef float CGFloat; -#endif - -#if (defined(__LP64__) && __LP64__) || (defined(NS_BUILD_32_LIKE_64) && NS_BUILD_32_LIKE_64) -typedef long NSInteger; -typedef unsigned long NSUInteger; -#else -typedef int NSInteger; -typedef unsigned int NSUInteger; -#endif - -/* Objective-C type declarations. - * These are to be used in public headers in lieu of NSSomething* because - * Objective-C class names are not available in C/C++ code. - */ - -/* NOTE: This ought to work with other compilers too, but I'm being cautious */ -#if (defined(__GNUC__) && defined(__APPLE__)) || defined(__MWERKS__) -/* It's desirable to have type safety for Objective-C(++) code as it does -at least catch typos of method names among other things. However, it -is not possible to declare an Objective-C class from plain old C or C++ -code. Furthermore, because of C++ name mangling, the type name must -be the same for both C++ and Objective-C++ code. Therefore, we define -what should be a pointer to an Objective-C class as a pointer to a plain -old C struct with the same name. Unfortunately, because the compiler -does not see a struct as an Objective-C class we cannot declare it -as a struct in Objective-C(++) mode. -*/ -#if defined(__OBJC__) -#define DECLARE_WXCOCOA_OBJC_CLASS(klass) \ -@class klass; \ -typedef klass *WX_##klass -#else /* not defined(__OBJC__) */ -#define DECLARE_WXCOCOA_OBJC_CLASS(klass) \ -typedef struct klass *WX_##klass -#endif /* defined(__OBJC__) */ - -#else /* not Apple's GNU or CodeWarrior */ -#warning "Objective-C types will not be checked by the compiler." -/* NOTE: typedef struct objc_object *id; */ -/* IOW, we're declaring these using the id type without using that name, */ -/* since "id" is used extensively not only within wxWidgets itself, but */ -/* also in wxWidgets application code. The following works fine when */ -/* compiling C(++) code, and works without typesafety for Obj-C(++) code */ -#define DECLARE_WXCOCOA_OBJC_CLASS(klass) \ -typedef struct objc_object *WX_##klass - -#endif /* (defined(__GNUC__) && defined(__APPLE__)) || defined(__MWERKS__) */ - -DECLARE_WXCOCOA_OBJC_CLASS(NSApplication); -DECLARE_WXCOCOA_OBJC_CLASS(NSBitmapImageRep); -DECLARE_WXCOCOA_OBJC_CLASS(NSBox); -DECLARE_WXCOCOA_OBJC_CLASS(NSButton); -DECLARE_WXCOCOA_OBJC_CLASS(NSColor); -DECLARE_WXCOCOA_OBJC_CLASS(NSColorPanel); -DECLARE_WXCOCOA_OBJC_CLASS(NSControl); -DECLARE_WXCOCOA_OBJC_CLASS(NSCursor); -DECLARE_WXCOCOA_OBJC_CLASS(NSEvent); -DECLARE_WXCOCOA_OBJC_CLASS(NSFontPanel); -DECLARE_WXCOCOA_OBJC_CLASS(NSImage); -DECLARE_WXCOCOA_OBJC_CLASS(NSLayoutManager); -DECLARE_WXCOCOA_OBJC_CLASS(NSMenu); -DECLARE_WXCOCOA_OBJC_CLASS(NSMenuExtra); -DECLARE_WXCOCOA_OBJC_CLASS(NSMenuItem); -DECLARE_WXCOCOA_OBJC_CLASS(NSMutableArray); -DECLARE_WXCOCOA_OBJC_CLASS(NSNotification); -DECLARE_WXCOCOA_OBJC_CLASS(NSObject); -DECLARE_WXCOCOA_OBJC_CLASS(NSPanel); -DECLARE_WXCOCOA_OBJC_CLASS(NSScrollView); -DECLARE_WXCOCOA_OBJC_CLASS(NSSound); -DECLARE_WXCOCOA_OBJC_CLASS(NSStatusItem); -DECLARE_WXCOCOA_OBJC_CLASS(NSTableColumn); -DECLARE_WXCOCOA_OBJC_CLASS(NSTableView); -DECLARE_WXCOCOA_OBJC_CLASS(NSTextContainer); -DECLARE_WXCOCOA_OBJC_CLASS(NSTextField); -DECLARE_WXCOCOA_OBJC_CLASS(NSTextStorage); -DECLARE_WXCOCOA_OBJC_CLASS(NSThread); -DECLARE_WXCOCOA_OBJC_CLASS(NSWindow); -DECLARE_WXCOCOA_OBJC_CLASS(NSView); -#ifdef __WXMAC__ -// things added for __WXMAC__ -DECLARE_WXCOCOA_OBJC_CLASS(NSString); -#else -// things only for __WXCOCOA__ -typedef WX_NSView WXWidget; /* wxWidgets BASE definition */ -#endif -#endif /* __WXCOCOA__ || ( __WXMAC__ &__DARWIN__)*/ - -#if defined(__WXPALMOS__) - -typedef void * WXHWND; -typedef void * WXHANDLE; -typedef void * WXHICON; -typedef void * WXHFONT; -typedef void * WXHMENU; -typedef void * WXHPEN; -typedef void * WXHBRUSH; -typedef void * WXHPALETTE; -typedef void * WXHCURSOR; -typedef void * WXHRGN; -typedef void * WXHACCEL; -typedef void * WXHINSTANCE; -typedef void * WXHBITMAP; -typedef void * WXHIMAGELIST; -typedef void * WXHGLOBAL; -typedef void * WXHDC; -typedef unsigned int WXUINT; -typedef unsigned long WXDWORD; -typedef unsigned short WXWORD; - -typedef unsigned long WXCOLORREF; -typedef struct tagMSG WXMSG; - -typedef WXHWND WXWINHANDLE; /* WinHandle of PalmOS */ -typedef WXWINHANDLE WXWidget; - -typedef void * WXFORMPTR; -typedef void * WXEVENTPTR; -typedef void * WXRECTANGLEPTR; - -#endif /* __WXPALMOS__ */ - - -/* ABX: check __WIN32__ instead of __WXMSW__ for the same MSWBase in any Win32 port */ -#if defined(__WIN32__) - -/* the keywords needed for WinMain() declaration */ -#ifndef WXFAR -# define WXFAR -#endif - -/* Stand-ins for Windows types to avoid #including all of windows.h */ -typedef void * WXHWND; -typedef void * WXHANDLE; -typedef void * WXHICON; -typedef void * WXHFONT; -typedef void * WXHMENU; -typedef void * WXHPEN; -typedef void * WXHBRUSH; -typedef void * WXHPALETTE; -typedef void * WXHCURSOR; -typedef void * WXHRGN; -typedef void * WXRECTPTR; -typedef void * WXHACCEL; -typedef void WXFAR * WXHINSTANCE; -typedef void * WXHBITMAP; -typedef void * WXHIMAGELIST; -typedef void * WXHGLOBAL; -typedef void * WXHDC; -typedef unsigned int WXUINT; -typedef unsigned long WXDWORD; -typedef unsigned short WXWORD; - -typedef unsigned long WXCOLORREF; -typedef void * WXRGNDATA; -typedef struct tagMSG WXMSG; -typedef void * WXHCONV; -typedef void * WXHKEY; -typedef void * WXHTREEITEM; - -typedef void * WXDRAWITEMSTRUCT; -typedef void * WXMEASUREITEMSTRUCT; -typedef void * WXLPCREATESTRUCT; - -typedef WXHWND WXWidget; - -#ifdef __WIN64__ -typedef unsigned __int64 WXWPARAM; -typedef __int64 WXLPARAM; -typedef __int64 WXLRESULT; -#else -typedef unsigned int WXWPARAM; -typedef long WXLPARAM; -typedef long WXLRESULT; -#endif - -#if defined(__GNUWIN32__) || defined(__WXMICROWIN__) -typedef int (*WXFARPROC)(); -#else -typedef int (__stdcall *WXFARPROC)(); -#endif -#endif /* __WIN32__ */ - - -#if defined(__OS2__) -typedef unsigned long DWORD; -typedef unsigned short WORD; -#endif - -#if defined(__WXPM__) || defined(__EMX__) -#ifdef __WXPM__ -/* Stand-ins for OS/2 types, to avoid #including all of os2.h */ -typedef unsigned long WXHWND; -typedef unsigned long WXHANDLE; -typedef unsigned long WXHICON; -typedef unsigned long WXHFONT; -typedef unsigned long WXHMENU; -typedef unsigned long WXHPEN; -typedef unsigned long WXHBRUSH; -typedef unsigned long WXHPALETTE; -typedef unsigned long WXHCURSOR; -typedef unsigned long WXHRGN; -typedef unsigned long WXHACCEL; -typedef unsigned long WXHBITMAP; -typedef unsigned long WXHDC; -typedef unsigned int WXUINT; -typedef unsigned long WXDWORD; -typedef unsigned short WXWORD; - -typedef unsigned long WXCOLORREF; -typedef void * WXMSG; -typedef unsigned long WXHTREEITEM; - -typedef void * WXDRAWITEMSTRUCT; -typedef void * WXMEASUREITEMSTRUCT; -typedef void * WXLPCREATESTRUCT; - -typedef WXHWND WXWidget; -#endif -#ifdef __EMX__ -/* Need a well-known type for WXFARPROC - below. MPARAM is typedef'ed too late. */ -#define WXWPARAM void * -#define WXLPARAM void * -#else -#define WXWPARAM MPARAM -#define WXLPARAM MPARAM -#endif -#define RECT RECTL -#define LOGFONT FATTRS -#define LOWORD SHORT1FROMMP -#define HIWORD SHORT2FROMMP - -typedef unsigned long WXMPARAM; -typedef unsigned long WXMSGID; -typedef void* WXRESULT; -/* typedef int (*WXFARPROC)(); */ -/* some windows handles not defined by PM */ -typedef unsigned long HANDLE; -typedef unsigned long HICON; -typedef unsigned long HFONT; -typedef unsigned long HMENU; -typedef unsigned long HPEN; -typedef unsigned long HBRUSH; -typedef unsigned long HPALETTE; -typedef unsigned long HCURSOR; -typedef unsigned long HINSTANCE; -typedef unsigned long HIMAGELIST; -typedef unsigned long HGLOBAL; -#endif /* WXPM || EMX */ - -#if defined (__WXPM__) -/* WIN32 graphics types for OS/2 GPI */ - -/* RGB under OS2 is more like a PALETTEENTRY struct under Windows so we need a real RGB def */ -#define OS2RGB(r,g,b) ((DWORD)((unsigned char)(b) | ((unsigned char)(g) << 8)) | ((unsigned char)(r) << 16)) - -typedef unsigned long COLORREF; -#define GetRValue(rgb) ((unsigned char)((rgb) >> 16)) -#define GetGValue(rgb) ((unsigned char)(((unsigned short)(rgb)) >> 8)) -#define GetBValue(rgb) ((unsigned char)(rgb)) -#define PALETTEINDEX(i) ((COLORREF)(0x01000000 | (DWORD)(WORD)(i))) -#define PALETTERGB(r,g,b) (0x02000000 | OS2RGB(r,g,b)) -/* OS2's RGB/RGB2 is backwards from this */ -typedef struct tagPALETTEENTRY -{ - char bRed; - char bGreen; - char bBlue; - char bFlags; -} PALETTEENTRY; -typedef struct tagLOGPALETTE -{ - WORD palVersion; - WORD palNumentries; - WORD PALETTEENTRY[1]; -} LOGPALETTE; - -#if (defined(__VISAGECPP__) && (__IBMCPP__ < 400)) || defined (__WATCOMC__) - /* VA 3.0 for some reason needs base data types when typedefing a proc proto??? */ -typedef void* (_System *WXFARPROC)(unsigned long, unsigned long, void*, void*); -#else -#if defined(__EMX__) && !defined(_System) -#define _System -#endif -typedef WXRESULT (_System *WXFARPROC)(WXHWND, WXMSGID, WXWPARAM, WXLPARAM); -#endif - -#endif /* __WXPM__ */ - - -#if defined(__WXMOTIF__) || defined(__WXX11__) -/* Stand-ins for X/Xt/Motif types */ -typedef void* WXWindow; -typedef void* WXWidget; -typedef void* WXAppContext; -typedef void* WXColormap; -typedef void* WXColor; -typedef void WXDisplay; -typedef void WXEvent; -typedef void* WXCursor; -typedef void* WXPixmap; -typedef void* WXFontStructPtr; -typedef void* WXGC; -typedef void* WXRegion; -typedef void* WXFont; -typedef void* WXImage; -typedef void* WXFontList; -typedef void* WXFontSet; -typedef void* WXRendition; -typedef void* WXRenderTable; -typedef void* WXFontType; /* either a XmFontList or XmRenderTable */ -typedef void* WXString; - -typedef unsigned long Atom; /* this might fail on a few architectures */ -typedef long WXPixel; /* safety catch in src/motif/colour.cpp */ - -#endif /* Motif */ - -#ifdef __WXGTK__ - -/* Stand-ins for GLIB types */ -typedef char gchar; -typedef signed char gint8; -typedef int gint; -typedef unsigned guint; -typedef unsigned long gulong; -typedef void* gpointer; -typedef struct _GSList GSList; - -/* Stand-ins for GDK types */ -typedef struct _GdkColor GdkColor; -typedef struct _GdkColormap GdkColormap; -typedef struct _GdkFont GdkFont; -typedef struct _GdkGC GdkGC; -typedef struct _GdkVisual GdkVisual; - -#ifdef __WXGTK20__ -typedef struct _GdkAtom *GdkAtom; -typedef struct _GdkDrawable GdkWindow; -typedef struct _GdkDrawable GdkBitmap; -typedef struct _GdkDrawable GdkPixmap; -#else /* GTK+ 1.2 */ -typedef gulong GdkAtom; -typedef struct _GdkWindow GdkWindow; -typedef struct _GdkWindow GdkBitmap; -typedef struct _GdkWindow GdkPixmap; -#endif /* GTK+ 1.2/2.0 */ - -typedef struct _GdkCursor GdkCursor; -typedef struct _GdkRegion GdkRegion; -typedef struct _GdkDragContext GdkDragContext; - -#ifdef HAVE_XIM -typedef struct _GdkIC GdkIC; -typedef struct _GdkICAttr GdkICAttr; -#endif - -/* Stand-ins for GTK types */ -typedef struct _GtkWidget GtkWidget; -typedef struct _GtkRcStyle GtkRcStyle; -typedef struct _GtkAdjustment GtkAdjustment; -typedef struct _GtkList GtkList; -typedef struct _GtkToolbar GtkToolbar; -typedef struct _GtkTooltips GtkTooltips; -typedef struct _GtkNotebook GtkNotebook; -typedef struct _GtkNotebookPage GtkNotebookPage; -typedef struct _GtkAccelGroup GtkAccelGroup; -typedef struct _GtkItemFactory GtkItemFactory; -typedef struct _GtkSelectionData GtkSelectionData; -typedef struct _GtkTextBuffer GtkTextBuffer; -typedef struct _GtkRange GtkRange; - -typedef GtkWidget *WXWidget; - -#ifndef __WXGTK20__ -#define GTK_OBJECT_GET_CLASS(object) (GTK_OBJECT(object)->klass) -#define GTK_CLASS_TYPE(klass) ((klass)->type) -#endif - -#endif /* __WXGTK__ */ - -#if defined(__WXGTK20__) || (defined(__WXX11__) && wxUSE_UNICODE) -#define wxUSE_PANGO 1 -#else -#define wxUSE_PANGO 0 -#endif - -#if wxUSE_PANGO -/* Stand-ins for Pango types */ -typedef struct _PangoContext PangoContext; -typedef struct _PangoLayout PangoLayout; -typedef struct _PangoFontDescription PangoFontDescription; -#endif - -#ifdef __WXMGL__ -typedef struct window_t *WXWidget; -#endif /* MGL */ - -#ifdef __WXDFB__ -/* DirectFB doesn't have the concept of non-TLW window, so use - something arbitrary */ -typedef const void* WXWidget; -#endif /* DFB */ - -/* This is required because of clashing macros in windows.h, which may be */ -/* included before or after wxWidgets classes, and therefore must be */ -/* disabled here before any significant wxWidgets headers are included. */ -#ifdef __cplusplus -#ifdef __WXMSW__ -#include "wx/msw/winundef.h" -#endif /* __WXMSW__ */ -#endif /* __cplusplus */ - -/* --------------------------------------------------------------------------- */ -/* macro to define a class without copy ctor nor assignment operator */ -/* --------------------------------------------------------------------------- */ - -#define DECLARE_NO_COPY_CLASS(classname) \ - private: \ - classname(const classname&); \ - classname& operator=(const classname&); - -#define DECLARE_NO_ASSIGN_CLASS(classname) \ - private: \ - classname& operator=(const classname&); - -/* --------------------------------------------------------------------------- */ -/* If a manifest is being automatically generated, add common controls 6 to it */ -/* --------------------------------------------------------------------------- */ - -#if (!defined wxUSE_NO_MANIFEST || wxUSE_NO_MANIFEST == 0 ) && \ - ( defined _MSC_FULL_VER && _MSC_FULL_VER >= 140040130 ) - -#define WX_CC_MANIFEST(cpu) \ - "/manifestdependency:\"type='win32' \ - name='Microsoft.Windows.Common-Controls' \ - version='6.0.0.0' \ - processorArchitecture='"cpu"' \ - publicKeyToken='6595b64144ccf1df' \ - language='*'\"" - -#if defined _M_IX86 - #pragma comment(linker, WX_CC_MANIFEST("x86")) -#elif defined _M_X64 - #pragma comment(linker, WX_CC_MANIFEST("amd64")) -#elif defined _M_IA64 - #pragma comment(linker, WX_CC_MANIFEST("ia64")) -#else - #pragma comment(linker, WX_CC_MANIFEST("*")) -#endif - -#endif /* !wxUSE_NO_MANIFEST && _MSC_FULL_VER >= 140040130 */ - -#endif - /* _WX_DEFS_H_ */ diff --git a/wxWidgets/include/wx/dialog.h b/wxWidgets/include/wx/dialog.h deleted file mode 100644 index ffb69db186..0000000000 --- a/wxWidgets/include/wx/dialog.h +++ /dev/null @@ -1,167 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/dialog.h -// Purpose: wxDialogBase class -// Author: Vadim Zeitlin -// Modified by: -// Created: 29.06.99 -// RCS-ID: $Id: dialog.h 49804 2007-11-10 01:09:42Z VZ $ -// Copyright: (c) Vadim Zeitlin -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_DIALOG_H_BASE_ -#define _WX_DIALOG_H_BASE_ - -#include "wx/defs.h" -#include "wx/containr.h" -#include "wx/toplevel.h" - -class WXDLLIMPEXP_FWD_CORE wxSizer; -class WXDLLIMPEXP_FWD_CORE wxStdDialogButtonSizer; - -#define wxDIALOG_NO_PARENT 0x0001 // Don't make owned by apps top window - -#ifdef __WXWINCE__ -#define wxDEFAULT_DIALOG_STYLE (wxCAPTION | wxMAXIMIZE | wxCLOSE_BOX | wxNO_BORDER) -#else -#define wxDEFAULT_DIALOG_STYLE (wxCAPTION | wxSYSTEM_MENU | wxCLOSE_BOX) -#endif - -extern WXDLLEXPORT_DATA(const wxChar) wxDialogNameStr[]; - -class WXDLLEXPORT wxDialogBase : public wxTopLevelWindow -{ -public: - enum - { - // all flags allowed in wxDialogBase::CreateButtonSizer() - ButtonSizerFlags = wxOK|wxCANCEL|wxYES|wxNO|wxHELP|wxNO_DEFAULT - }; - - wxDialogBase() { Init(); } - virtual ~wxDialogBase() { } - - // define public wxDialog methods to be implemented by the derived classes - virtual int ShowModal() = 0; - virtual void EndModal(int retCode) = 0; - virtual bool IsModal() const = 0; - - - // Modal dialogs have a return code - usually the id of the last - // pressed button - void SetReturnCode(int returnCode) { m_returnCode = returnCode; } - int GetReturnCode() const { return m_returnCode; } - - // Set the identifier for the affirmative button: this button will close - // the dialog after validating data and calling TransferDataFromWindow() - void SetAffirmativeId(int affirmativeId); - int GetAffirmativeId() const { return m_affirmativeId; } - - // Set identifier for Esc key translation: the button with this id will - // close the dialog without doing anything else; special value wxID_NONE - // means to not handle Esc at all while wxID_ANY means to map Esc to - // wxID_CANCEL if present and GetAffirmativeId() otherwise - void SetEscapeId(int escapeId); - int GetEscapeId() const { return m_escapeId; } - -#if wxUSE_STATTEXT // && wxUSE_TEXTCTRL - // splits text up at newlines and places the - // lines into a vertical wxBoxSizer - wxSizer *CreateTextSizer( const wxString &message ); -#endif // wxUSE_STATTEXT // && wxUSE_TEXTCTRL - - // returns a horizontal wxBoxSizer containing the given buttons - // - // notice that the returned sizer can be NULL if no buttons are put in the - // sizer (this mostly happens under smart phones and other atypical - // platforms which have hardware buttons replacing OK/Cancel and such) - wxSizer *CreateButtonSizer(long flags); - - // returns the sizer containing CreateButtonSizer() below a separating - // static line for the platforms which use static lines for items - // separation (i.e. not Mac) - wxSizer *CreateSeparatedButtonSizer(long flags); - -#if wxUSE_BUTTON - wxStdDialogButtonSizer *CreateStdDialogButtonSizer( long flags ); -#endif // wxUSE_BUTTON - -protected: - // emulate click of a button with the given id if it's present in the dialog - // - // return true if button was "clicked" or false if we don't have it - bool EmulateButtonClickIfPresent(int id); - - // this function is used by OnCharHook() to decide whether the given key - // should close the dialog - // - // for most platforms the default implementation (which just checks for - // Esc) is sufficient, but Mac port also adds Cmd-. here and other ports - // could do something different if needed - virtual bool IsEscapeKey(const wxKeyEvent& event); - - // end either modal or modeless dialog, for the modal dialog rc is used as - // the dialog return code - void EndDialog(int rc); - - // call Validate() and TransferDataFromWindow() and close dialog with - // wxID_OK return code - void AcceptAndClose(); - - - // The return code from modal dialog - int m_returnCode; - - // The identifier for the affirmative button (usually wxID_OK) - int m_affirmativeId; - - // The identifier for cancel button (usually wxID_CANCEL) - int m_escapeId; - -private: - // common part of all ctors - void Init(); - - // handle Esc key presses - void OnCharHook(wxKeyEvent& event); - - // handle closing the dialog window - void OnCloseWindow(wxCloseEvent& event); - - // handle the standard buttons - void OnButton(wxCommandEvent& event); - - // update the background colour - void OnSysColourChanged(wxSysColourChangedEvent& event); - - - DECLARE_NO_COPY_CLASS(wxDialogBase) - DECLARE_EVENT_TABLE() - WX_DECLARE_CONTROL_CONTAINER(); -}; - - -#if defined(__WXUNIVERSAL__) && !defined(__WXMICROWIN__) - #include "wx/univ/dialog.h" -#else - #if defined(__WXPALMOS__) - #include "wx/palmos/dialog.h" - #elif defined(__WXMSW__) - #include "wx/msw/dialog.h" - #elif defined(__WXMOTIF__) - #include "wx/motif/dialog.h" - #elif defined(__WXGTK20__) - #include "wx/gtk/dialog.h" - #elif defined(__WXGTK__) - #include "wx/gtk1/dialog.h" - #elif defined(__WXMAC__) - #include "wx/mac/dialog.h" - #elif defined(__WXCOCOA__) - #include "wx/cocoa/dialog.h" - #elif defined(__WXPM__) - #include "wx/os2/dialog.h" - #endif -#endif - -#endif - // _WX_DIALOG_H_BASE_ diff --git a/wxWidgets/include/wx/dialup.h b/wxWidgets/include/wx/dialup.h deleted file mode 100644 index c2dd296def..0000000000 --- a/wxWidgets/include/wx/dialup.h +++ /dev/null @@ -1,201 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/dialup.h -// Purpose: Network related wxWidgets classes and functions -// Author: Vadim Zeitlin -// Modified by: -// Created: 07.07.99 -// RCS-ID: $Id: dialup.h 49804 2007-11-10 01:09:42Z VZ $ -// Copyright: (c) Vadim Zeitlin -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_DIALUP_H -#define _WX_DIALUP_H - -#if wxUSE_DIALUP_MANAGER - -#include "wx/event.h" - -// ---------------------------------------------------------------------------- -// misc -// ---------------------------------------------------------------------------- - -class WXDLLIMPEXP_FWD_BASE wxArrayString; - -#define WXDIALUP_MANAGER_DEFAULT_BEACONHOST wxT("www.yahoo.com") - -// ---------------------------------------------------------------------------- -// 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. a function to enumerate all connections (ISPs) and show a dialog in - * Dial() allowing to choose between them if no ISP given - * 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 wxDialUpManager -{ -public: - // this function should create and return the object of the - // platform-specific class derived from wxDialUpManager. It's implemented - // in the platform-specific source files. - static wxDialUpManager *Create(); - - // 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 = 0; - - // virtual dtor for any base class - virtual ~wxDialUpManager() { } - - // operations - // ---------- - - // fills the array with the names of all possible values for the first - // parameter to Dial() on this machine and returns their number (may be 0) - virtual size_t GetISPNames(wxArrayString& names) const = 0; - - // dial the given ISP, use username and password to authentificate - // - // if no nameOfISP is given, the function will select the default one - // - // if no username/password are given, the function will try to do without - // them, but will ask the user if really needed - // - // if async parameter is false, the function waits until the end of dialing - // and returns true upon successful completion. - // if async is true, the function only initiates the connection and returns - // immediately - the result is reported via events (an event is sent - // anyhow, but if dialing failed it will be a DISCONNECTED one) - virtual bool Dial(const wxString& nameOfISP = wxEmptyString, - const wxString& username = wxEmptyString, - const wxString& password = wxEmptyString, - bool async = true) = 0; - - // returns true if (async) dialing is in progress - virtual bool IsDialing() const = 0; - - // cancel dialing the number initiated with Dial(async = true) - // NB: this won't result in DISCONNECTED event being sent - virtual bool CancelDialing() = 0; - - // hang up the currently active dial up connection - virtual bool HangUp() = 0; - - // online status - // ------------- - - // returns true if the computer has a permanent network connection (i.e. is - // on a LAN) and so there is no need to use Dial() function to go online - // - // NB: this functions tries to guess the result and it is not always - // guaranteed to be correct, so it's better to ask user for - // confirmation or give him a possibility to override it - virtual bool IsAlwaysOnline() const = 0; - - // 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 = 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) = 0; - - // 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 = 60) = 0; - - // disable automatic check for connection status change - notice that the - // wxEVT_DIALUP_XXX events won't be sent any more neither. - virtual void DisableAutoCheckOnlineStatus() = 0; - - // additional Unix-only configuration - // ---------------------------------- - - // 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) = 0; - - // Sets the commands to start up the network and to hang up again. Used by - // the Unix implementations only. - virtual void - SetConnectCommand(const wxString& commandDial = wxT("/usr/bin/pon"), - const wxString& commandHangup = wxT("/usr/bin/poff")) = 0; -}; - -// ---------------------------------------------------------------------------- -// wxDialUpManager events -// ---------------------------------------------------------------------------- - -BEGIN_DECLARE_EVENT_TYPES() - DECLARE_EVENT_TYPE(wxEVT_DIALUP_CONNECTED, 450) - DECLARE_EVENT_TYPE(wxEVT_DIALUP_DISCONNECTED, 451) -END_DECLARE_EVENT_TYPES() - -// the event class for the dialup events -class WXDLLEXPORT wxDialUpEvent : public wxEvent -{ -public: - wxDialUpEvent(bool isConnected, bool isOwnEvent) : wxEvent(isOwnEvent) - { - SetEventType(isConnected ? wxEVT_DIALUP_CONNECTED - : wxEVT_DIALUP_DISCONNECTED); - } - - // is this a CONNECTED or DISCONNECTED event? - bool IsConnectedEvent() const - { return GetEventType() == wxEVT_DIALUP_CONNECTED; } - - // does this event come from wxDialUpManager::Dial() or from some extrenal - // process (i.e. does it result from our own attempt to establish the - // connection)? - bool IsOwnEvent() const { return m_id != 0; } - - // implement the base class pure virtual - virtual wxEvent *Clone() const { return new wxDialUpEvent(*this); } - -private: - DECLARE_NO_ASSIGN_CLASS(wxDialUpEvent) -}; - -// the type of dialup event handler function -typedef void (wxEvtHandler::*wxDialUpEventFunction)(wxDialUpEvent&); - -#define wxDialUpEventHandler(func) \ - (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxDialUpEventFunction, &func) - -// macros to catch dialup events -#define EVT_DIALUP_CONNECTED(func) \ - wx__DECLARE_EVT0(wxEVT_DIALUP_CONNECTED, wxDialUpEventHandler(func)) -#define EVT_DIALUP_DISCONNECTED(func) \ - wx__DECLARE_EVT0(wxEVT_DIALUP_DISCONNECTED, wxDialUpEventHandler(func)) - - -#endif // wxUSE_DIALUP_MANAGER - -#endif // _WX_DIALUP_H diff --git a/wxWidgets/include/wx/dir.h b/wxWidgets/include/wx/dir.h deleted file mode 100644 index 0a5b2cffea..0000000000 --- a/wxWidgets/include/wx/dir.h +++ /dev/null @@ -1,161 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/dir.h -// Purpose: wxDir is a class for enumerating the files in a directory -// Author: Vadim Zeitlin -// Modified by: -// Created: 08.12.99 -// RCS-ID: $Id: dir.h 53135 2008-04-12 02:31:04Z VZ $ -// Copyright: (c) 1999 Vadim Zeitlin -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_DIR_H_ -#define _WX_DIR_H_ - -#include "wx/longlong.h" -#include "wx/string.h" - -class WXDLLIMPEXP_FWD_BASE wxArrayString; - -// ---------------------------------------------------------------------------- -// constants -// ---------------------------------------------------------------------------- - -// these flags define what kind of filenames is included in the list of files -// enumerated by GetFirst/GetNext -enum -{ - wxDIR_FILES = 0x0001, // include files - wxDIR_DIRS = 0x0002, // include directories - wxDIR_HIDDEN = 0x0004, // include hidden files - wxDIR_DOTDOT = 0x0008, // include '.' and '..' - - // by default, enumerate everything except '.' and '..' - wxDIR_DEFAULT = wxDIR_FILES | wxDIR_DIRS | wxDIR_HIDDEN -}; - -// these constants are possible return value of wxDirTraverser::OnDir() -enum wxDirTraverseResult -{ - wxDIR_IGNORE = -1, // ignore this directory but continue with others - wxDIR_STOP, // stop traversing - wxDIR_CONTINUE // continue into this directory -}; - -// ---------------------------------------------------------------------------- -// wxDirTraverser: helper class for wxDir::Traverse() -// ---------------------------------------------------------------------------- - -class WXDLLIMPEXP_BASE wxDirTraverser -{ -public: - /// a virtual dtor has been provided since this class has virtual members - virtual ~wxDirTraverser() { } - // called for each file found by wxDir::Traverse() - // - // return wxDIR_STOP or wxDIR_CONTINUE from here (wxDIR_IGNORE doesn't - // make sense) - virtual wxDirTraverseResult OnFile(const wxString& filename) = 0; - - // called for each directory found by wxDir::Traverse() - // - // return one of the enum elements defined above - virtual wxDirTraverseResult OnDir(const wxString& dirname) = 0; - - // called for each directory which we couldn't open during our traversal - // of the directory tyree - // - // this method can also return either wxDIR_STOP, wxDIR_IGNORE or - // wxDIR_CONTINUE but the latter is treated specially: it means to retry - // opening the directory and so may lead to infinite loop if it is - // returned unconditionally, be careful with this! - // - // the base class version always returns wxDIR_IGNORE - virtual wxDirTraverseResult OnOpenError(const wxString& dirname); -}; - -// ---------------------------------------------------------------------------- -// wxDir: portable equivalent of {open/read/close}dir functions -// ---------------------------------------------------------------------------- - -class WXDLLIMPEXP_FWD_BASE wxDirData; - -class WXDLLIMPEXP_BASE wxDir -{ -public: - // test for existence of a directory with the given name - static bool Exists(const wxString& dir); - - // ctors - // ----- - - // default, use Open() - wxDir() { m_data = NULL; } - - // opens the directory for enumeration, use IsOpened() to test success - wxDir(const wxString& dir); - - // dtor cleans up the associated ressources - ~wxDir(); - - // open the directory for enumerating - bool Open(const wxString& dir); - - // returns true if the directory was successfully opened - bool IsOpened() const; - - // get the full name of the directory (without '/' at the end) - wxString GetName() const; - - // file enumeration routines - // ------------------------- - - // start enumerating all files matching filespec (or all files if it is - // empty) and flags, return true on success - bool GetFirst(wxString *filename, - const wxString& filespec = wxEmptyString, - int flags = wxDIR_DEFAULT) const; - - // get next file in the enumeration started with GetFirst() - bool GetNext(wxString *filename) const; - - // return true if this directory has any files in it - bool HasFiles(const wxString& spec = wxEmptyString); - - // return true if this directory has any subdirectories - bool HasSubDirs(const wxString& spec = wxEmptyString); - - // enumerate all files in this directory and its subdirectories - // - // return the number of files found - size_t Traverse(wxDirTraverser& sink, - const wxString& filespec = wxEmptyString, - int flags = wxDIR_DEFAULT) const; - - // simplest version of Traverse(): get the names of all files under this - // directory into filenames array, return the number of files - static size_t GetAllFiles(const wxString& dirname, - wxArrayString *files, - const wxString& filespec = wxEmptyString, - int flags = wxDIR_DEFAULT); - - // check if there any files matching the given filespec under the given - // directory (i.e. searches recursively), return the file path if found or - // empty string otherwise - static wxString FindFirst(const wxString& dirname, - const wxString& filespec, - int flags = wxDIR_DEFAULT); - - // returns the size of all directories recursively found in given path - static wxULongLong GetTotalSize(const wxString &dir, wxArrayString *filesSkipped = NULL); - -private: - friend class wxDirData; - - wxDirData *m_data; - - DECLARE_NO_COPY_CLASS(wxDir) -}; - -#endif // _WX_DIR_H_ - diff --git a/wxWidgets/include/wx/dirctrl.h b/wxWidgets/include/wx/dirctrl.h deleted file mode 100644 index 704f8bb768..0000000000 --- a/wxWidgets/include/wx/dirctrl.h +++ /dev/null @@ -1,18 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/dirctrl.h -// Purpose: Directory control base header -// Author: Julian Smart -// Modified by: -// Created: -// Copyright: (c) Julian Smart -// RCS-ID: $Id: dirctrl.h 33948 2005-05-04 18:57:50Z JS $ -// Licence: wxWindows Licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_DIRCTRL_H_BASE_ -#define _WX_DIRCTRL_H_BASE_ - -#include "wx/generic/dirctrlg.h" - -#endif - // _WX_DIRCTRL_H_BASE_ diff --git a/wxWidgets/include/wx/dirdlg.h b/wxWidgets/include/wx/dirdlg.h deleted file mode 100644 index 22ae354714..0000000000 --- a/wxWidgets/include/wx/dirdlg.h +++ /dev/null @@ -1,141 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/dirdlg.h -// Purpose: wxDirDialog base class -// Author: Robert Roebling -// Modified by: -// Created: -// Copyright: (c) Robert Roebling -// RCS-ID: $Id: dirdlg.h 44027 2006-12-21 19:26:48Z VZ $ -// Licence: wxWindows Licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_DIRDLG_H_BASE_ -#define _WX_DIRDLG_H_BASE_ - -#if wxUSE_DIRDLG - -#include "wx/dialog.h" - -// ---------------------------------------------------------------------------- -// constants -// ---------------------------------------------------------------------------- - -extern WXDLLEXPORT_DATA(const wxChar) wxDirDialogNameStr[]; -extern WXDLLEXPORT_DATA(const wxChar) wxDirDialogDefaultFolderStr[]; -extern WXDLLEXPORT_DATA(const wxChar) wxDirSelectorPromptStr[]; - -#define wxDD_CHANGE_DIR 0x0100 -#define wxDD_DIR_MUST_EXIST 0x0200 - -// deprecated, on by default now, use wxDD_DIR_MUST_EXIST to disable it -#define wxDD_NEW_DIR_BUTTON 0 - -#ifdef __WXWINCE__ - #define wxDD_DEFAULT_STYLE wxDEFAULT_DIALOG_STYLE -#else - #define wxDD_DEFAULT_STYLE (wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER) -#endif - -//------------------------------------------------------------------------- -// wxDirDialogBase -//------------------------------------------------------------------------- - -class WXDLLEXPORT wxDirDialogBase : public wxDialog -{ -public: - wxDirDialogBase() {} - wxDirDialogBase(wxWindow *parent, - const wxString& title = wxDirSelectorPromptStr, - const wxString& defaultPath = wxEmptyString, - long style = wxDD_DEFAULT_STYLE, - const wxPoint& pos = wxDefaultPosition, - const wxSize& sz = wxDefaultSize, - const wxString& name = wxDirDialogNameStr) - { - Create(parent, title, defaultPath, style, pos, sz, name); - } - - virtual ~wxDirDialogBase() {} - - - bool Create(wxWindow *parent, - const wxString& title = wxDirSelectorPromptStr, - const wxString& defaultPath = wxEmptyString, - long style = wxDD_DEFAULT_STYLE, - const wxPoint& pos = wxDefaultPosition, - const wxSize& sz = wxDefaultSize, - const wxString& name = wxDirDialogNameStr) - { - if (!wxDialog::Create(parent, wxID_ANY, title, pos, sz, style, name)) - return false; - m_path = defaultPath; - m_message = title; - return true; - } - -#if WXWIN_COMPATIBILITY_2_6 - - wxDEPRECATED( long GetStyle() const ); - wxDEPRECATED( void SetStyle(long style) ); - -#endif // WXWIN_COMPATIBILITY_2_6 - - virtual void SetMessage(const wxString& message) { m_message = message; } - virtual void SetPath(const wxString& path) { m_path = path; } - - virtual wxString GetMessage() const { return m_message; } - virtual wxString GetPath() const { return m_path; } - -protected: - wxString m_message; - wxString m_path; -}; - - -// Universal and non-port related switches with need for generic implementation -#if defined(__WXUNIVERSAL__) - #include "wx/generic/dirdlgg.h" - #define wxDirDialog wxGenericDirDialog -#elif defined(__WXMSW__) && (defined(__SALFORDC__) || \ - !wxUSE_OLE || \ - (defined (__GNUWIN32__) && !wxUSE_NORLANDER_HEADERS)) - #include "wx/generic/dirdlgg.h" - #define wxDirDialog wxGenericDirDialog -#elif defined(__WXMSW__) && defined(__WXWINCE__) && !defined(__HANDHELDPC__) - #include "wx/generic/dirdlgg.h" // MS PocketPC or MS Smartphone - #define wxDirDialog wxGenericDirDialog -#elif defined(__WXMSW__) - #include "wx/msw/dirdlg.h" // Native MSW -#elif defined(__WXGTK24__) - #include "wx/gtk/dirdlg.h" // Native GTK for gtk2.4 -#elif defined(__WXGTK__) - #include "wx/generic/dirdlgg.h" - #define wxDirDialog wxGenericDirDialog -#elif defined(__WXMAC__) - #include "wx/mac/dirdlg.h" // Native Mac -#elif defined(__WXCOCOA__) - #include "wx/cocoa/dirdlg.h" // Native Cocoa -#elif defined(__WXMOTIF__) || \ - defined(__WXX11__) || \ - defined(__WXMGL__) || \ - defined(__WXCOCOA__) || \ - defined(__WXPM__) - #include "wx/generic/dirdlgg.h" // Other ports use generic implementation - #define wxDirDialog wxGenericDirDialog -#endif - -// ---------------------------------------------------------------------------- -// common ::wxDirSelector() function -// ---------------------------------------------------------------------------- - -WXDLLEXPORT wxString -wxDirSelector(const wxString& message = wxDirSelectorPromptStr, - const wxString& defaultPath = wxEmptyString, - long style = wxDD_DEFAULT_STYLE, - const wxPoint& pos = wxDefaultPosition, - wxWindow *parent = NULL); - -#endif // wxUSE_DIRDLG - -#endif - // _WX_DIRDLG_H_BASE_ diff --git a/wxWidgets/include/wx/display.h b/wxWidgets/include/wx/display.h deleted file mode 100644 index 81f812c601..0000000000 --- a/wxWidgets/include/wx/display.h +++ /dev/null @@ -1,128 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/display.h -// Purpose: wxDisplay class -// Author: Royce Mitchell III, Vadim Zeitlin -// Created: 06/21/02 -// RCS-ID: $Id: display.h 49804 2007-11-10 01:09:42Z VZ $ -// Copyright: (c) 2002-2006 wxWidgets team -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_DISPLAY_H_BASE_ -#define _WX_DISPLAY_H_BASE_ - -// NB: no #if wxUSE_DISPLAY here, the display geometry part of this class (but -// not the video mode stuff) is always available but if wxUSE_DISPLAY == 0 -// it becomes just a trivial wrapper around the old wxDisplayXXX() functions - -#if wxUSE_DISPLAY - #include "wx/dynarray.h" - #include "wx/vidmode.h" - - WX_DECLARE_EXPORTED_OBJARRAY(wxVideoMode, wxArrayVideoModes); - - // default, uninitialized, video mode object - extern WXDLLEXPORT_DATA(const wxVideoMode) wxDefaultVideoMode; -#endif // wxUSE_DISPLAY - -class WXDLLIMPEXP_FWD_CORE wxWindow; -class WXDLLIMPEXP_FWD_CORE wxPoint; -class WXDLLIMPEXP_FWD_CORE wxRect; -class WXDLLIMPEXP_FWD_BASE wxString; - -class WXDLLIMPEXP_FWD_CORE wxDisplayFactory; -class WXDLLIMPEXP_FWD_CORE wxDisplayImpl; - -// ---------------------------------------------------------------------------- -// wxDisplay: represents a display/monitor attached to the system -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxDisplay -{ -public: - // initialize the object containing all information about the given - // display - // - // the displays are numbered from 0 to GetCount() - 1, 0 is always the - // primary display and the only one which is always supported - wxDisplay(unsigned n = 0); - - // dtor is not virtual as this is a concrete class not meant to be derived - // from - ~wxDisplay(); - - - // return the number of available displays, valid parameters to - // wxDisplay ctor are from 0 up to this number - static unsigned GetCount(); - - // find the display where the given point lies, return wxNOT_FOUND if - // it doesn't belong to any display - static int GetFromPoint(const wxPoint& pt); - - // find the display where the given window lies, return wxNOT_FOUND if it - // is not shown at all - static int GetFromWindow(wxWindow *window); - - - // return true if the object was initialized successfully - bool IsOk() const { return m_impl != NULL; } - - // get the full display size - wxRect GetGeometry() const; - - // get the client area of the display, i.e. without taskbars and such - wxRect GetClientArea() const; - - // name may be empty - wxString GetName() const; - - // display 0 is usually the primary display - bool IsPrimary() const; - - -#if wxUSE_DISPLAY - // enumerate all video modes supported by this display matching the given - // one (in the sense of wxVideoMode::Match()) - // - // as any mode matches the default value of the argument and there is - // always at least one video mode supported by display, the returned array - // is only empty for the default value of the argument if this function is - // not supported at all on this platform - wxArrayVideoModes - GetModes(const wxVideoMode& mode = wxDefaultVideoMode) const; - - // get current video mode - wxVideoMode GetCurrentMode() const; - - // change current mode, return true if succeeded, false otherwise - // - // for the default value of the argument restores the video mode to default - bool ChangeMode(const wxVideoMode& mode = wxDefaultVideoMode); - - // restore the default video mode (just a more readable synonym) - void ResetMode() { (void)ChangeMode(); } -#endif // wxUSE_DISPLAY - -private: - // returns the factory used to implement our static methods and create new - // displays - static wxDisplayFactory& Factory(); - - // creates the factory object, called by Factory() when it is called for - // the first time and should return a pointer allocated with new (the - // caller will delete it) - // - // this method must be implemented in platform-specific code if - // wxUSE_DISPLAY == 1 (if it is 0 we provide the stub in common code) - static wxDisplayFactory *CreateFactory(); - - - // the real implementation - wxDisplayImpl *m_impl; - - - DECLARE_NO_COPY_CLASS(wxDisplay) -}; - -#endif // _WX_DISPLAY_H_BASE_ diff --git a/wxWidgets/include/wx/display_impl.h b/wxWidgets/include/wx/display_impl.h deleted file mode 100644 index f79766e030..0000000000 --- a/wxWidgets/include/wx/display_impl.h +++ /dev/null @@ -1,110 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/display_impl.h -// Purpose: wxDisplayImpl class declaration -// Author: Vadim Zeitlin -// Created: 2006-03-15 -// RCS-ID: $Id: display_impl.h 41548 2006-10-02 05:38:05Z PC $ -// Copyright: (c) 2002-2006 Vadim Zeitlin -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_DISPLAY_IMPL_H_BASE_ -#define _WX_DISPLAY_IMPL_H_BASE_ - -#include "wx/gdicmn.h" // for wxRect - -// ---------------------------------------------------------------------------- -// wxDisplayFactory: allows to create wxDisplay objects -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxDisplayFactory -{ -public: - wxDisplayFactory() { } - virtual ~wxDisplayFactory() { } - - // create a new display object - // - // it can return a NULL pointer if the display creation failed - virtual wxDisplayImpl *CreateDisplay(unsigned n) = 0; - - // get the total number of displays - virtual unsigned GetCount() = 0; - - // return the display for the given point or wxNOT_FOUND - virtual int GetFromPoint(const wxPoint& pt) = 0; - - // return the display for the given window or wxNOT_FOUND - // - // the window pointer must not be NULL (i.e. caller should check it) - virtual int GetFromWindow(wxWindow *window); -}; - -// ---------------------------------------------------------------------------- -// wxDisplayImpl: base class for all wxDisplay implementations -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxDisplayImpl -{ -public: - // virtual dtor for this base class - virtual ~wxDisplayImpl() { } - - - // return the full area of this display - virtual wxRect GetGeometry() const = 0; - - // return the area of the display available for normal windows - virtual wxRect GetClientArea() const { return GetGeometry(); } - - // return the name (may be empty) - virtual wxString GetName() const = 0; - - // return the index of this display - unsigned GetIndex() const { return m_index; } - - // return true if this is the primary monitor (usually one with index 0) - virtual bool IsPrimary() const { return GetIndex() == 0; } - - -#if wxUSE_DISPLAY - // implements wxDisplay::GetModes() - virtual wxArrayVideoModes GetModes(const wxVideoMode& mode) const = 0; - - // get current video mode - virtual wxVideoMode GetCurrentMode() const = 0; - - // change current mode, return true if succeeded, false otherwise - virtual bool ChangeMode(const wxVideoMode& mode) = 0; -#endif // wxUSE_DISPLAY - -protected: - // create the object providing access to the display with the given index - wxDisplayImpl(unsigned n) : m_index(n) { } - - - // the index of this display (0 is always the primary one) - const unsigned m_index; - - - friend class wxDisplayFactory; - - DECLARE_NO_COPY_CLASS(wxDisplayImpl) -}; - -// ---------------------------------------------------------------------------- -// wxDisplayFactorySingle -// ---------------------------------------------------------------------------- - -// this is a stub implementation using single/main display only, it is -// available even if wxUSE_DISPLAY == 0 -class WXDLLEXPORT wxDisplayFactorySingle : public wxDisplayFactory -{ -public: - virtual wxDisplayImpl *CreateDisplay(unsigned n); - virtual unsigned GetCount() { return 1; } - virtual int GetFromPoint(const wxPoint& pt); -}; - -#endif // _WX_DISPLAY_IMPL_H_BASE_ - diff --git a/wxWidgets/include/wx/dlimpexp.h b/wxWidgets/include/wx/dlimpexp.h deleted file mode 100644 index c6fc095cee..0000000000 --- a/wxWidgets/include/wx/dlimpexp.h +++ /dev/null @@ -1,275 +0,0 @@ -/* - * Name: wx/dlimpexp.h - * Purpose: Macros for declaring DLL-imported/exported functions - * Author: Vadim Zeitlin - * Modified by: - * Created: 16.10.2003 (extracted from wx/defs.h) - * RCS-ID: $Id: dlimpexp.h 49563 2007-10-31 20:46:21Z VZ $ - * Copyright: (c) 2003 Vadim Zeitlin - * Licence: wxWindows licence - */ - -/* - This is a C file, not C++ one, do not use C++ comments here! - */ - -#ifndef _WX_DLIMPEXP_H_ -#define _WX_DLIMPEXP_H_ - -#if defined(__WXMSW__) - /* - __declspec works in BC++ 5 and later, Watcom C++ 11.0 and later as well - as VC++ and gcc - */ -# if defined(__VISUALC__) || defined(__BORLANDC__) || defined(__GNUC__) || defined(__WATCOMC__) -# define WXEXPORT __declspec(dllexport) -# define WXIMPORT __declspec(dllimport) -# else /* compiler doesn't support __declspec() */ -# define WXEXPORT -# define WXIMPORT -# endif -#elif defined(__WXPM__) -# if defined (__WATCOMC__) -# define WXEXPORT __declspec(dllexport) - /* - __declspec(dllimport) prepends __imp to imported symbols. We do NOT - want that! - */ -# define WXIMPORT -# elif defined(__EMX__) -# define WXEXPORT -# define WXIMPORT -# elif (!(defined(__VISAGECPP__) && (__IBMCPP__ < 400 || __IBMC__ < 400 ))) -# define WXEXPORT _Export -# define WXIMPORT _Export -# endif -#elif defined(__WXMAC__) || defined(__WXCOCOA__) -# ifdef __MWERKS__ -# define WXEXPORT __declspec(export) -# define WXIMPORT __declspec(import) -# endif -#elif defined(__CYGWIN__) -# define WXEXPORT __declspec(dllexport) -# define WXIMPORT __declspec(dllimport) -#endif - -/* for other platforms/compilers we don't anything */ -#ifndef WXEXPORT -# define WXEXPORT -# define WXIMPORT -#endif - -/* - We support building wxWidgets as a set of several libraries but we don't - support arbitrary combinations of libs/DLLs: either we build all of them as - DLLs (in which case WXMAKINGDLL is defined) or none (it isn't). - - However we have a problem because we need separate WXDLLEXPORT versions for - different libraries as, for example, wxString class should be dllexported - when compiled in wxBase and dllimported otherwise, so we do define separate - WXMAKING/USINGDLL_XYZ constants for each component XYZ. - */ -#ifdef WXMAKINGDLL -# if wxUSE_BASE -# define WXMAKINGDLL_BASE -# endif - -# define WXMAKINGDLL_NET -# define WXMAKINGDLL_CORE -# define WXMAKINGDLL_ADV -# define WXMAKINGDLL_QA -# define WXMAKINGDLL_ODBC -# define WXMAKINGDLL_DBGRID -# define WXMAKINGDLL_HTML -# define WXMAKINGDLL_GL -# define WXMAKINGDLL_XML -# define WXMAKINGDLL_XRC -# define WXMAKINGDLL_AUI -# define WXMAKINGDLL_RICHTEXT -# define WXMAKINGDLL_MEDIA -#endif /* WXMAKINGDLL */ - -/* - WXDLLEXPORT maps to export declaration when building the DLL, to import - declaration if using it or to nothing at all if we don't use wxWin as DLL - */ -#ifdef WXMAKINGDLL_BASE -# define WXDLLIMPEXP_BASE WXEXPORT -# define WXDLLIMPEXP_DATA_BASE(type) WXEXPORT type -#elif defined(WXUSINGDLL) -# define WXDLLIMPEXP_BASE WXIMPORT -# define WXDLLIMPEXP_DATA_BASE(type) WXIMPORT type -#else /* not making nor using DLL */ -# define WXDLLIMPEXP_BASE -# define WXDLLIMPEXP_DATA_BASE(type) type -#endif - -#ifdef WXMAKINGDLL_NET -# define WXDLLIMPEXP_NET WXEXPORT -# define WXDLLIMPEXP_DATA_NET(type) WXEXPORT type -#elif defined(WXUSINGDLL) -# define WXDLLIMPEXP_NET WXIMPORT -# define WXDLLIMPEXP_DATA_NET(type) WXIMPORT type -#else /* not making nor using DLL */ -# define WXDLLIMPEXP_NET -# define WXDLLIMPEXP_DATA_NET(type) type -#endif - -#ifdef WXMAKINGDLL_CORE -# define WXDLLIMPEXP_CORE WXEXPORT -# define WXDLLIMPEXP_DATA_CORE(type) WXEXPORT type -#elif defined(WXUSINGDLL) -# define WXDLLIMPEXP_CORE WXIMPORT -# define WXDLLIMPEXP_DATA_CORE(type) WXIMPORT type -#else /* not making nor using DLL */ -# define WXDLLIMPEXP_CORE -# define WXDLLIMPEXP_DATA_CORE(type) type -#endif - -#ifdef WXMAKINGDLL_ADV -# define WXDLLIMPEXP_ADV WXEXPORT -# define WXDLLIMPEXP_DATA_ADV(type) WXEXPORT type -#elif defined(WXUSINGDLL) -# define WXDLLIMPEXP_ADV WXIMPORT -# define WXDLLIMPEXP_DATA_ADV(type) WXIMPORT type -#else /* not making nor using DLL */ -# define WXDLLIMPEXP_ADV -# define WXDLLIMPEXP_DATA_ADV(type) type -#endif - -#ifdef WXMAKINGDLL_ODBC -# define WXDLLIMPEXP_ODBC WXEXPORT -# define WXDLLIMPEXP_DATA_ODBC(type) WXEXPORT type -#elif defined(WXUSINGDLL) -# define WXDLLIMPEXP_ODBC WXIMPORT -# define WXDLLIMPEXP_DATA_ODBC(type) WXIMPORT type -#else /* not making nor using DLL */ -# define WXDLLIMPEXP_ODBC -# define WXDLLIMPEXP_DATA_ODBC(type) type -#endif - -#ifdef WXMAKINGDLL_QA -# define WXDLLIMPEXP_QA WXEXPORT -# define WXDLLIMPEXP_DATA_QA(type) WXEXPORT type -#elif defined(WXUSINGDLL) -# define WXDLLIMPEXP_QA WXIMPORT -# define WXDLLIMPEXP_DATA_QA(type) WXIMPORT type -#else /* not making nor using DLL */ -# define WXDLLIMPEXP_QA -# define WXDLLIMPEXP_DATA_QA(type) type -#endif - -#ifdef WXMAKINGDLL_DBGRID -# define WXDLLIMPEXP_DBGRID WXEXPORT -# define WXDLLIMPEXP_DATA_DBGRID(type) WXEXPORT type -#elif defined(WXUSINGDLL) -# define WXDLLIMPEXP_DBGRID WXIMPORT -# define WXDLLIMPEXP_DATA_DBGRID(type) WXIMPORT type -#else /* not making nor using DLL */ -# define WXDLLIMPEXP_DBGRID -# define WXDLLIMPEXP_DATA_DBGRID(type) type -#endif - -#ifdef WXMAKINGDLL_HTML -# define WXDLLIMPEXP_HTML WXEXPORT -# define WXDLLIMPEXP_DATA_HTML(type) WXEXPORT type -#elif defined(WXUSINGDLL) -# define WXDLLIMPEXP_HTML WXIMPORT -# define WXDLLIMPEXP_DATA_HTML(type) WXIMPORT type -#else /* not making nor using DLL */ -# define WXDLLIMPEXP_HTML -# define WXDLLIMPEXP_DATA_HTML(type) type -#endif - -#ifdef WXMAKINGDLL_GL -# define WXDLLIMPEXP_GL WXEXPORT -#elif defined(WXUSINGDLL) -# define WXDLLIMPEXP_GL WXIMPORT -#else /* not making nor using DLL */ -# define WXDLLIMPEXP_GL -#endif - -#ifdef WXMAKINGDLL_XML -# define WXDLLIMPEXP_XML WXEXPORT -#elif defined(WXUSINGDLL) -# define WXDLLIMPEXP_XML WXIMPORT -#else /* not making nor using DLL */ -# define WXDLLIMPEXP_XML -#endif - -#ifdef WXMAKINGDLL_XRC -# define WXDLLIMPEXP_XRC WXEXPORT -#elif defined(WXUSINGDLL) -# define WXDLLIMPEXP_XRC WXIMPORT -#else /* not making nor using DLL */ -# define WXDLLIMPEXP_XRC -#endif - -#ifdef WXMAKINGDLL_AUI -# define WXDLLIMPEXP_AUI WXEXPORT -#elif defined(WXUSINGDLL) -# define WXDLLIMPEXP_AUI WXIMPORT -#else /* not making nor using DLL */ -# define WXDLLIMPEXP_AUI -#endif - -#ifdef WXMAKINGDLL_RICHTEXT -# define WXDLLIMPEXP_RICHTEXT WXEXPORT -#elif defined(WXUSINGDLL) -# define WXDLLIMPEXP_RICHTEXT WXIMPORT -#else /* not making nor using DLL */ -# define WXDLLIMPEXP_RICHTEXT -#endif - -#ifdef WXMAKINGDLL_MEDIA -# define WXDLLIMPEXP_MEDIA WXEXPORT -#elif defined(WXUSINGDLL) -# define WXDLLIMPEXP_MEDIA WXIMPORT -#else /* not making nor using DLL */ -# define WXDLLIMPEXP_MEDIA -#endif - -/* for backwards compatibility, define suffix-less versions too */ -#define WXDLLEXPORT WXDLLIMPEXP_CORE -#define WXDLLEXPORT_DATA WXDLLIMPEXP_DATA_CORE - -/* wx-2.9 introduces new macros for forward declarations, include them - * here for forward compatibility: - - GCC warns about using __attribute__ (and also __declspec in mingw32 case) on - forward declarations while MSVC complains about forward declarations without - __declspec for the classes later declared with it, so we need a separate set - of macros for forward declarations to hide this difference: - */ -#if defined(__WINDOWS__) && defined(__GNUC__) - #define WXDLLIMPEXP_FWD_BASE - #define WXDLLIMPEXP_FWD_NET - #define WXDLLIMPEXP_FWD_CORE - #define WXDLLIMPEXP_FWD_ADV - #define WXDLLIMPEXP_FWD_QA - #define WXDLLIMPEXP_FWD_HTML - #define WXDLLIMPEXP_FWD_GL - #define WXDLLIMPEXP_FWD_XML - #define WXDLLIMPEXP_FWD_XRC - #define WXDLLIMPEXP_FWD_AUI - #define WXDLLIMPEXP_FWD_RICHTEXT - #define WXDLLIMPEXP_FWD_MEDIA - #define WXDLLIMPEXP_FWD_STC -#else - #define WXDLLIMPEXP_FWD_BASE WXDLLIMPEXP_BASE - #define WXDLLIMPEXP_FWD_NET WXDLLIMPEXP_NET - #define WXDLLIMPEXP_FWD_CORE WXDLLIMPEXP_CORE - #define WXDLLIMPEXP_FWD_ADV WXDLLIMPEXP_ADV - #define WXDLLIMPEXP_FWD_QA WXDLLIMPEXP_QA - #define WXDLLIMPEXP_FWD_HTML WXDLLIMPEXP_HTML - #define WXDLLIMPEXP_FWD_GL WXDLLIMPEXP_GL - #define WXDLLIMPEXP_FWD_XML WXDLLIMPEXP_XML - #define WXDLLIMPEXP_FWD_XRC WXDLLIMPEXP_XRC - #define WXDLLIMPEXP_FWD_AUI WXDLLIMPEXP_AUI - #define WXDLLIMPEXP_FWD_RICHTEXT WXDLLIMPEXP_RICHTEXT - #define WXDLLIMPEXP_FWD_MEDIA WXDLLIMPEXP_MEDIA - #define WXDLLIMPEXP_FWD_STC WXDLLIMPEXP_STC -#endif - -#endif /* _WX_DLIMPEXP_H_ */ - diff --git a/wxWidgets/include/wx/dnd.h b/wxWidgets/include/wx/dnd.h deleted file mode 100644 index 2eab71e654..0000000000 --- a/wxWidgets/include/wx/dnd.h +++ /dev/null @@ -1,267 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: wx/dnd.h -// Purpose: Drag and drop classes declarations -// Author: Vadim Zeitlin, Robert Roebling -// Modified by: -// Created: 26.05.99 -// RCS-ID: $Id: dnd.h 43636 2006-11-25 14:08:27Z VZ $ -// Copyright: (c) wxWidgets Team -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_DND_H_BASE_ -#define _WX_DND_H_BASE_ - -#include "wx/defs.h" - -#if wxUSE_DRAG_AND_DROP - -#include "wx/dataobj.h" -#include "wx/cursor.h" - -// ---------------------------------------------------------------------------- -// constants -// ---------------------------------------------------------------------------- - -// flags for wxDropSource::DoDragDrop() -// -// NB: wxDrag_CopyOnly must be 0 (== FALSE) and wxDrag_AllowMove must be 1 -// (== TRUE) for compatibility with the old DoDragDrop(bool) method! -enum -{ - wxDrag_CopyOnly = 0, // allow only copying - wxDrag_AllowMove = 1, // allow moving (copying is always allowed) - wxDrag_DefaultMove = 3 // the default operation is move, not copy -}; - -// result of wxDropSource::DoDragDrop() call -enum wxDragResult -{ - wxDragError, // error prevented the d&d operation from completing - wxDragNone, // drag target didn't accept the data - wxDragCopy, // the data was successfully copied - wxDragMove, // the data was successfully moved (MSW only) - wxDragLink, // operation is a drag-link - wxDragCancel // the operation was cancelled by user (not an error) -}; - -// return true if res indicates that something was done during a dnd operation, -// i.e. is neither error nor none nor cancel -WXDLLEXPORT bool wxIsDragResultOk(wxDragResult res); - -// ---------------------------------------------------------------------------- -// wxDropSource is the object you need to create (and call DoDragDrop on it) -// to initiate a drag-and-drop operation -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxDropSourceBase -{ -public: - wxDropSourceBase(const wxCursor &cursorCopy = wxNullCursor, - const wxCursor &cursorMove = wxNullCursor, - const wxCursor &cursorStop = wxNullCursor) - : m_cursorCopy(cursorCopy), - m_cursorMove(cursorMove), - m_cursorStop(cursorStop) - { m_data = (wxDataObject *)NULL; } - virtual ~wxDropSourceBase() { } - - // set the data which is transfered by drag and drop - void SetData(wxDataObject& data) - { m_data = &data; } - - wxDataObject *GetDataObject() - { return m_data; } - - // set the icon corresponding to given drag result - void SetCursor(wxDragResult res, const wxCursor& cursor) - { - if ( res == wxDragCopy ) - m_cursorCopy = cursor; - else if ( res == wxDragMove ) - m_cursorMove = cursor; - else - m_cursorStop = cursor; - } - - // start drag action, see enum wxDragResult for return value description - // - // if flags contains wxDrag_AllowMove, moving (and only copying) data is - // allowed, if it contains wxDrag_DefaultMove (which includes the previous - // flag), it is even the default operation - virtual wxDragResult DoDragDrop(int flags = wxDrag_CopyOnly) = 0; - - // override to give feedback depending on the current operation result - // "effect" and return true if you did something, false to let the library - // give the default feedback - virtual bool GiveFeedback(wxDragResult WXUNUSED(effect)) { return false; } - -protected: - const wxCursor& GetCursor(wxDragResult res) const - { - if ( res == wxDragCopy ) - return m_cursorCopy; - else if ( res == wxDragMove ) - return m_cursorMove; - else - return m_cursorStop; - } - - // the data we're dragging - wxDataObject *m_data; - - // the cursors to use for feedback - wxCursor m_cursorCopy, - m_cursorMove, - m_cursorStop; - - DECLARE_NO_COPY_CLASS(wxDropSourceBase) -}; - -// ---------------------------------------------------------------------------- -// wxDropTarget should be associated with a window if it wants to be able to -// receive data via drag and drop. -// -// To use this class, you should derive from wxDropTarget and implement -// OnData() pure virtual method. You may also wish to override OnDrop() if you -// want to accept the data only inside some region of the window (this may -// avoid having to copy the data to this application which happens only when -// OnData() is called) -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxDropTargetBase -{ -public: - // ctor takes a pointer to heap-allocated wxDataObject which will be owned - // by wxDropTarget and deleted by it automatically. If you don't give it - // here, you can use SetDataObject() later. - wxDropTargetBase(wxDataObject *dataObject = (wxDataObject*)NULL) - { m_dataObject = dataObject; m_defaultAction = wxDragNone; } - // dtor deletes our data object - virtual ~wxDropTargetBase() - { delete m_dataObject; } - - // get/set the associated wxDataObject - wxDataObject *GetDataObject() const - { return m_dataObject; } - void SetDataObject(wxDataObject *dataObject) - { if (m_dataObject) delete m_dataObject; - m_dataObject = dataObject; } - - // these functions are called when data is moved over position (x, y) and - // may return either wxDragCopy, wxDragMove or wxDragNone depending on - // what would happen if the data were dropped here. - // - // the last parameter is what would happen by default and is determined by - // the platform-specific logic (for example, under Windows it's wxDragCopy - // if Ctrl key is pressed and wxDragMove otherwise) except that it will - // always be wxDragNone if the carried data is in an unsupported format. - - // called when the mouse enters the window (only once until OnLeave()) - virtual wxDragResult OnEnter(wxCoord x, wxCoord y, wxDragResult def) - { return OnDragOver(x, y, def); } - - // called when the mouse moves in the window - shouldn't take long to - // execute or otherwise mouse movement would be too slow - virtual wxDragResult OnDragOver(wxCoord WXUNUSED(x), wxCoord WXUNUSED(y), - wxDragResult def) - { return def; } - - // called when mouse leaves the window: might be used to remove the - // feedback which was given in OnEnter() - virtual void OnLeave() { } - - // this function is called when data is dropped at position (x, y) - if it - // returns true, OnData() will be called immediately afterwards which will - // allow to retrieve the data dropped. - virtual bool OnDrop(wxCoord x, wxCoord y) = 0; - - // called after OnDrop() returns TRUE: you will usually just call - // GetData() from here and, probably, also refresh something to update the - // new data and, finally, return the code indicating how did the operation - // complete (returning default value in case of success and wxDragError on - // failure is usually ok) - virtual wxDragResult OnData(wxCoord x, wxCoord y, wxDragResult def) = 0; - - // may be called *only* from inside OnData() and will fill m_dataObject - // with the data from the drop source if it returns true - virtual bool GetData() = 0; - - // sets the default action for drag and drop: - // use wxDragMove or wxDragCopy to set deafult action to move or copy - // and use wxDragNone (default) to set default action specified by - // initialization of draging (see wxDropSourceBase::DoDragDrop()) - void SetDefaultAction(wxDragResult action) - { m_defaultAction = action; } - - // returns default action for drag and drop or - // wxDragNone if this not specified - wxDragResult GetDefaultAction() - { return m_defaultAction; } - -protected: - wxDataObject *m_dataObject; - wxDragResult m_defaultAction; - - DECLARE_NO_COPY_CLASS(wxDropTargetBase) -}; - -// ---------------------------------------------------------------------------- -// include platform dependent class declarations -// ---------------------------------------------------------------------------- - -#if defined(__WXMSW__) - #include "wx/msw/ole/dropsrc.h" - #include "wx/msw/ole/droptgt.h" -#elif defined(__WXMOTIF__) - #include "wx/motif/dnd.h" -#elif defined(__WXX11__) - #include "wx/x11/dnd.h" -#elif defined(__WXGTK20__) - #include "wx/gtk/dnd.h" -#elif defined(__WXGTK__) - #include "wx/gtk1/dnd.h" -#elif defined(__WXMAC__) - #include "wx/mac/dnd.h" -#elif defined(__WXPM__) - #include "wx/os2/dnd.h" -#endif - -// ---------------------------------------------------------------------------- -// standard wxDropTarget implementations (implemented in common/dobjcmn.cpp) -// ---------------------------------------------------------------------------- - -// A simple wxDropTarget derived class for text data: you only need to -// override OnDropText() to get something working -class WXDLLEXPORT wxTextDropTarget : public wxDropTarget -{ -public: - wxTextDropTarget(); - - virtual bool OnDropText(wxCoord x, wxCoord y, const wxString& text) = 0; - - virtual wxDragResult OnData(wxCoord x, wxCoord y, wxDragResult def); - -private: - DECLARE_NO_COPY_CLASS(wxTextDropTarget) -}; - -// A drop target which accepts files (dragged from File Manager or Explorer) -class WXDLLEXPORT wxFileDropTarget : public wxDropTarget -{ -public: - wxFileDropTarget(); - - // parameters are the number of files and the array of file names - virtual bool OnDropFiles(wxCoord x, wxCoord y, - const wxArrayString& filenames) = 0; - - virtual wxDragResult OnData(wxCoord x, wxCoord y, wxDragResult def); - -private: - DECLARE_NO_COPY_CLASS(wxFileDropTarget) -}; - -#endif // wxUSE_DRAG_AND_DROP - -#endif // _WX_DND_H_BASE_ diff --git a/wxWidgets/include/wx/docmdi.h b/wxWidgets/include/wx/docmdi.h deleted file mode 100644 index c8ab803c12..0000000000 --- a/wxWidgets/include/wx/docmdi.h +++ /dev/null @@ -1,107 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: docmdi.h -// Purpose: Frame classes for MDI document/view applications -// Author: Julian Smart -// Modified by: -// Created: 01/02/97 -// RCS-ID: $Id: docmdi.h 41020 2006-09-05 20:47:48Z VZ $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_DOCMDI_H_ -#define _WX_DOCMDI_H_ - -#include "wx/defs.h" - -#if wxUSE_MDI_ARCHITECTURE - -#include "wx/docview.h" -#include "wx/mdi.h" - -/* - * Use this instead of wxMDIParentFrame - */ - -class WXDLLEXPORT wxDocMDIParentFrame: public wxMDIParentFrame -{ -public: - wxDocMDIParentFrame(); - wxDocMDIParentFrame(wxDocManager *manager, wxFrame *parent, wxWindowID id, - const wxString& title, const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, long style = wxDEFAULT_FRAME_STYLE, const wxString& name = wxT("frame")); - - bool Create(wxDocManager *manager, wxFrame *parent, wxWindowID id, - const wxString& title, const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, long style = wxDEFAULT_FRAME_STYLE, const wxString& name = wxT("frame")); - - // Extend event processing to search the document manager's event table - virtual bool ProcessEvent(wxEvent& event); - - wxDocManager *GetDocumentManager(void) const { return m_docManager; } - - void OnExit(wxCommandEvent& event); - void OnMRUFile(wxCommandEvent& event); - void OnCloseWindow(wxCloseEvent& event); - -protected: - void Init(); - wxDocManager *m_docManager; - -private: - DECLARE_CLASS(wxDocMDIParentFrame) - DECLARE_EVENT_TABLE() - DECLARE_NO_COPY_CLASS(wxDocMDIParentFrame) -}; - -/* - * Use this instead of wxMDIChildFrame - */ - -class WXDLLEXPORT wxDocMDIChildFrame: public wxMDIChildFrame -{ -public: - wxDocMDIChildFrame(); - wxDocMDIChildFrame(wxDocument *doc, wxView *view, wxMDIParentFrame *frame, wxWindowID id, - const wxString& title, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, - long type = wxDEFAULT_FRAME_STYLE, const wxString& name = wxT("frame")); - virtual ~wxDocMDIChildFrame(); - - bool Create(wxDocument *doc, - wxView *view, - wxMDIParentFrame *frame, - wxWindowID id, - const wxString& title, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long type = wxDEFAULT_FRAME_STYLE, - const wxString& name = wxFrameNameStr); - - // Extend event processing to search the view's event table - virtual bool ProcessEvent(wxEvent& event); - - void OnActivate(wxActivateEvent& event); - void OnCloseWindow(wxCloseEvent& event); - - inline wxDocument *GetDocument() const { return m_childDocument; } - inline wxView *GetView(void) const { return m_childView; } - inline void SetDocument(wxDocument *doc) { m_childDocument = doc; } - inline void SetView(wxView *view) { m_childView = view; } - bool Destroy() { m_childView = (wxView *)NULL; return wxMDIChildFrame::Destroy(); } - -protected: - void Init(); - wxDocument* m_childDocument; - wxView* m_childView; - -private: - DECLARE_EVENT_TABLE() - DECLARE_CLASS(wxDocMDIChildFrame) - DECLARE_NO_COPY_CLASS(wxDocMDIChildFrame) -}; - -#endif - // wxUSE_MDI_ARCHITECTURE - -#endif - // _WX_DOCMDI_H_ diff --git a/wxWidgets/include/wx/docview.h b/wxWidgets/include/wx/docview.h deleted file mode 100644 index 60ed159071..0000000000 --- a/wxWidgets/include/wx/docview.h +++ /dev/null @@ -1,675 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/docview.h -// Purpose: Doc/View classes -// Author: Julian Smart -// Modified by: -// Created: 01/02/97 -// RCS-ID: $Id: docview.h 53546 2008-05-10 21:02:36Z VZ $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_DOCH__ -#define _WX_DOCH__ - -#include "wx/defs.h" - -#if wxUSE_DOC_VIEW_ARCHITECTURE - -#include "wx/list.h" -#include "wx/string.h" -#include "wx/frame.h" - -#if wxUSE_PRINTING_ARCHITECTURE - #include "wx/print.h" -#endif - -class WXDLLIMPEXP_FWD_CORE wxWindow; -class WXDLLIMPEXP_FWD_CORE wxDocument; -class WXDLLIMPEXP_FWD_CORE wxView; -class WXDLLIMPEXP_FWD_CORE wxDocTemplate; -class WXDLLIMPEXP_FWD_CORE wxDocManager; -class WXDLLIMPEXP_FWD_CORE wxPrintInfo; -class WXDLLIMPEXP_FWD_CORE wxCommandProcessor; -class WXDLLIMPEXP_FWD_CORE wxFileHistory; -class WXDLLIMPEXP_FWD_BASE wxConfigBase; - -#if wxUSE_STD_IOSTREAM - #include "wx/iosfwrap.h" -#else - #include "wx/stream.h" -#endif - -// Document manager flags -enum -{ - wxDOC_SDI = 1, - wxDOC_MDI, - wxDOC_NEW, - wxDOC_SILENT, - wxDEFAULT_DOCMAN_FLAGS = wxDOC_SDI -}; - -// Document template flags -enum -{ - wxTEMPLATE_VISIBLE = 1, - wxTEMPLATE_INVISIBLE, - wxDEFAULT_TEMPLATE_FLAGS = wxTEMPLATE_VISIBLE -}; - -#define wxMAX_FILE_HISTORY 9 - -class WXDLLEXPORT wxDocument : public wxEvtHandler -{ -public: - wxDocument(wxDocument *parent = (wxDocument *) NULL); - virtual ~wxDocument(); - - // accessors - void SetFilename(const wxString& filename, bool notifyViews = false); - wxString GetFilename() const { return m_documentFile; } - - void SetTitle(const wxString& title) { m_documentTitle = title; } - wxString GetTitle() const { return m_documentTitle; } - - void SetDocumentName(const wxString& name) { m_documentTypeName = name; } - wxString GetDocumentName() const { return m_documentTypeName; } - - bool GetDocumentSaved() const { return m_savedYet; } - void SetDocumentSaved(bool saved = true) { m_savedYet = saved; } - - virtual bool Close(); - virtual bool Save(); - virtual bool SaveAs(); - virtual bool Revert(); - -#if wxUSE_STD_IOSTREAM - virtual wxSTD ostream& SaveObject(wxSTD ostream& stream); - virtual wxSTD istream& LoadObject(wxSTD istream& stream); -#else - virtual wxOutputStream& SaveObject(wxOutputStream& stream); - virtual wxInputStream& LoadObject(wxInputStream& stream); -#endif - - // Called by wxWidgets - virtual bool OnSaveDocument(const wxString& filename); - virtual bool OnOpenDocument(const wxString& filename); - virtual bool OnNewDocument(); - virtual bool OnCloseDocument(); - - // Prompts for saving if about to close a modified document. Returns true - // if ok to close the document (may have saved in the meantime, or set - // modified to false) - virtual bool OnSaveModified(); - - // Called by framework if created automatically by the default document - // manager: gives document a chance to initialise and (usually) create a - // view - virtual bool OnCreate(const wxString& path, long flags); - - // By default, creates a base wxCommandProcessor. - virtual wxCommandProcessor *OnCreateCommandProcessor(); - virtual wxCommandProcessor *GetCommandProcessor() const { return m_commandProcessor; } - virtual void SetCommandProcessor(wxCommandProcessor *proc) { m_commandProcessor = proc; } - - // Called after a view is added or removed. The default implementation - // deletes the document if this is there are no more views. - virtual void OnChangedViewList(); - - virtual bool DeleteContents(); - - virtual bool Draw(wxDC&); - virtual bool IsModified() const { return m_documentModified; } - virtual void Modify(bool mod) { m_documentModified = mod; } - - virtual bool AddView(wxView *view); - virtual bool RemoveView(wxView *view); - wxList& GetViews() { return m_documentViews; } - const wxList& GetViews() const { return m_documentViews; } - wxView *GetFirstView() const; - - virtual void UpdateAllViews(wxView *sender = (wxView *) NULL, wxObject *hint = (wxObject *) NULL); - virtual void NotifyClosing(); - - // Remove all views (because we're closing the document) - virtual bool DeleteAllViews(); - - // Other stuff - virtual wxDocManager *GetDocumentManager() const; - virtual wxDocTemplate *GetDocumentTemplate() const { return m_documentTemplate; } - virtual void SetDocumentTemplate(wxDocTemplate *temp) { m_documentTemplate = temp; } - - // Get title, or filename if no title, else [unnamed] - // - // NB: this method will be deprecated in wxWidgets 3.0, you still need to - // override it if you need to modify the existing behaviour in this - // version but use GetUserReadableName() below if you just need to call - // it - virtual bool GetPrintableName(wxString& buf) const; - -#if wxABI_VERSION >= 20805 - wxString GetUserReadableName() const - { - wxString s; - GetPrintableName(s); - return s; - } -#endif // wxABI 2.8.5+ - - // Returns a window that can be used as a parent for document-related - // dialogs. Override if necessary. - virtual wxWindow *GetDocumentWindow() const; - -protected: - wxList m_documentViews; - wxString m_documentFile; - wxString m_documentTitle; - wxString m_documentTypeName; - wxDocTemplate* m_documentTemplate; - bool m_documentModified; - wxDocument* m_documentParent; - wxCommandProcessor* m_commandProcessor; - bool m_savedYet; - - // Called by OnSaveDocument and OnOpenDocument to implement standard - // Save/Load behavior. Re-implement in derived class for custom - // behavior. - virtual bool DoSaveDocument(const wxString& file); - virtual bool DoOpenDocument(const wxString& file); - -private: - DECLARE_ABSTRACT_CLASS(wxDocument) - DECLARE_NO_COPY_CLASS(wxDocument) -}; - -class WXDLLEXPORT wxView: public wxEvtHandler -{ -public: - // wxView(wxDocument *doc = (wxDocument *) NULL); - wxView(); - virtual ~wxView(); - - wxDocument *GetDocument() const { return m_viewDocument; } - virtual void SetDocument(wxDocument *doc); - - wxString GetViewName() const { return m_viewTypeName; } - void SetViewName(const wxString& name) { m_viewTypeName = name; } - - wxWindow *GetFrame() const { return m_viewFrame ; } - void SetFrame(wxWindow *frame) { m_viewFrame = frame; } - - virtual void OnActivateView(bool activate, wxView *activeView, wxView *deactiveView); - virtual void OnDraw(wxDC *dc) = 0; - virtual void OnPrint(wxDC *dc, wxObject *info); - virtual void OnUpdate(wxView *sender, wxObject *hint = (wxObject *) NULL); - virtual void OnClosingDocument() {} - virtual void OnChangeFilename(); - - // Called by framework if created automatically by the default document - // manager class: gives view a chance to initialise - virtual bool OnCreate(wxDocument *WXUNUSED(doc), long WXUNUSED(flags)) { return true; } - - // Checks if the view is the last one for the document; if so, asks user - // to confirm save data (if modified). If ok, deletes itself and returns - // true. - virtual bool Close(bool deleteWindow = true); - - // Override to do cleanup/veto close - virtual bool OnClose(bool deleteWindow); - - // Extend event processing to search the document's event table - virtual bool ProcessEvent(wxEvent& event); - - // A view's window can call this to notify the view it is (in)active. - // The function then notifies the document manager. - virtual void Activate(bool activate); - - wxDocManager *GetDocumentManager() const - { return m_viewDocument->GetDocumentManager(); } - -#if wxUSE_PRINTING_ARCHITECTURE - virtual wxPrintout *OnCreatePrintout(); -#endif - -protected: - wxDocument* m_viewDocument; - wxString m_viewTypeName; - wxWindow* m_viewFrame; - -private: - DECLARE_ABSTRACT_CLASS(wxView) - DECLARE_NO_COPY_CLASS(wxView) -}; - -// Represents user interface (and other) properties of documents and views -class WXDLLEXPORT wxDocTemplate: public wxObject -{ - -friend class WXDLLIMPEXP_FWD_CORE wxDocManager; - -public: - // Associate document and view types. They're for identifying what view is - // associated with what template/document type - wxDocTemplate(wxDocManager *manager, - const wxString& descr, - const wxString& filter, - const wxString& dir, - const wxString& ext, - const wxString& docTypeName, - const wxString& viewTypeName, - wxClassInfo *docClassInfo = (wxClassInfo *) NULL, - wxClassInfo *viewClassInfo = (wxClassInfo *)NULL, - long flags = wxDEFAULT_TEMPLATE_FLAGS); - - virtual ~wxDocTemplate(); - - // By default, these two member functions dynamically creates document and - // view using dynamic instance construction. Override these if you need a - // different method of construction. - virtual wxDocument *CreateDocument(const wxString& path, long flags = 0); - virtual wxView *CreateView(wxDocument *doc, long flags = 0); - - // Helper method for CreateDocument; also allows you to do your own document - // creation - virtual bool InitDocument(wxDocument* doc, const wxString& path, long flags = 0); - - wxString GetDefaultExtension() const { return m_defaultExt; } - wxString GetDescription() const { return m_description; } - wxString GetDirectory() const { return m_directory; } - wxDocManager *GetDocumentManager() const { return m_documentManager; } - void SetDocumentManager(wxDocManager *manager) { m_documentManager = manager; } - wxString GetFileFilter() const { return m_fileFilter; } - long GetFlags() const { return m_flags; } - virtual wxString GetViewName() const { return m_viewTypeName; } - virtual wxString GetDocumentName() const { return m_docTypeName; } - - void SetFileFilter(const wxString& filter) { m_fileFilter = filter; } - void SetDirectory(const wxString& dir) { m_directory = dir; } - void SetDescription(const wxString& descr) { m_description = descr; } - void SetDefaultExtension(const wxString& ext) { m_defaultExt = ext; } - void SetFlags(long flags) { m_flags = flags; } - - bool IsVisible() const { return ((m_flags & wxTEMPLATE_VISIBLE) == wxTEMPLATE_VISIBLE); } - - wxClassInfo* GetDocClassInfo() const { return m_docClassInfo; } - wxClassInfo* GetViewClassInfo() const { return m_viewClassInfo; } - - virtual bool FileMatchesTemplate(const wxString& path); - -protected: - long m_flags; - wxString m_fileFilter; - wxString m_directory; - wxString m_description; - wxString m_defaultExt; - wxString m_docTypeName; - wxString m_viewTypeName; - wxDocManager* m_documentManager; - - // For dynamic creation of appropriate instances. - wxClassInfo* m_docClassInfo; - wxClassInfo* m_viewClassInfo; - - // Called by CreateDocument and CreateView to create the actual document/view object. - // By default uses the ClassInfo provided to the constructor. Override these functions - // to provide a different method of creation. - virtual wxDocument *DoCreateDocument(); - virtual wxView *DoCreateView(); - -private: - DECLARE_CLASS(wxDocTemplate) - DECLARE_NO_COPY_CLASS(wxDocTemplate) -}; - -// One object of this class may be created in an application, to manage all -// the templates and documents. -class WXDLLEXPORT wxDocManager: public wxEvtHandler -{ -public: - wxDocManager(long flags = wxDEFAULT_DOCMAN_FLAGS, bool initialize = true); - virtual ~wxDocManager(); - - virtual bool Initialize(); - - // Handlers for common user commands - void OnFileClose(wxCommandEvent& event); - void OnFileCloseAll(wxCommandEvent& event); - void OnFileNew(wxCommandEvent& event); - void OnFileOpen(wxCommandEvent& event); - void OnFileRevert(wxCommandEvent& event); - void OnFileSave(wxCommandEvent& event); - void OnFileSaveAs(wxCommandEvent& event); - void OnPrint(wxCommandEvent& event); - void OnPreview(wxCommandEvent& event); - void OnUndo(wxCommandEvent& event); - void OnRedo(wxCommandEvent& event); - - // Handlers for UI update commands - void OnUpdateFileOpen(wxUpdateUIEvent& event); - void OnUpdateFileClose(wxUpdateUIEvent& event); - void OnUpdateFileRevert(wxUpdateUIEvent& event); - void OnUpdateFileNew(wxUpdateUIEvent& event); - void OnUpdateFileSave(wxUpdateUIEvent& event); - void OnUpdateFileSaveAs(wxUpdateUIEvent& event); - void OnUpdateUndo(wxUpdateUIEvent& event); - void OnUpdateRedo(wxUpdateUIEvent& event); - - void OnUpdatePrint(wxUpdateUIEvent& event); - void OnUpdatePreview(wxUpdateUIEvent& event); - - // Extend event processing to search the view's event table - virtual bool ProcessEvent(wxEvent& event); - - // called when file format detection didn't work, can be overridden to do - // something in this case - virtual void OnOpenFileFailure() { } - - virtual wxDocument *CreateDocument(const wxString& path, long flags = 0); - virtual wxView *CreateView(wxDocument *doc, long flags = 0); - virtual void DeleteTemplate(wxDocTemplate *temp, long flags = 0); - virtual bool FlushDoc(wxDocument *doc); - virtual wxDocTemplate *MatchTemplate(const wxString& path); - virtual wxDocTemplate *SelectDocumentPath(wxDocTemplate **templates, - int noTemplates, wxString& path, long flags, bool save = false); - virtual wxDocTemplate *SelectDocumentType(wxDocTemplate **templates, - int noTemplates, bool sort = false); - virtual wxDocTemplate *SelectViewType(wxDocTemplate **templates, - int noTemplates, bool sort = false); - virtual wxDocTemplate *FindTemplateForPath(const wxString& path); - - void AssociateTemplate(wxDocTemplate *temp); - void DisassociateTemplate(wxDocTemplate *temp); - - wxDocument *GetCurrentDocument() const; - - void SetMaxDocsOpen(int n) { m_maxDocsOpen = n; } - int GetMaxDocsOpen() const { return m_maxDocsOpen; } - - // Add and remove a document from the manager's list - void AddDocument(wxDocument *doc); - void RemoveDocument(wxDocument *doc); - - // closes all currently open documents - bool CloseDocuments(bool force = true); - - // closes the specified document - bool CloseDocument(wxDocument* doc, bool force = false); - - // Clear remaining documents and templates - bool Clear(bool force = true); - - // Views or windows should inform the document manager - // when a view is going in or out of focus - virtual void ActivateView(wxView *view, bool activate = true); - virtual wxView *GetCurrentView() const; - - wxList& GetDocuments() { return m_docs; } - wxList& GetTemplates() { return m_templates; } - - // Make a default document name - // - // NB: this method is renamed to MakeNewDocumentName() in wx 3.0, you still - // need to override it if your code needs to customize the default name - // generation but if you just use it from your code, prefer the version - // below which is forward-compatible with wx 3.0 - virtual bool MakeDefaultName(wxString& buf); - -#if wxABI_VERSION >= 20808 - wxString MakeNewDocumentName() const - { - wxString s; - wx_const_cast(wxDocManager *, this)->MakeDefaultName(s); - return s; - } -#endif // wx ABI >= 2.8.8 - - // Make a frame title (override this to do something different) - virtual wxString MakeFrameTitle(wxDocument* doc); - - virtual wxFileHistory *OnCreateFileHistory(); - virtual wxFileHistory *GetFileHistory() const { return m_fileHistory; } - - // File history management - virtual void AddFileToHistory(const wxString& file); - virtual void RemoveFileFromHistory(size_t i); - virtual size_t GetHistoryFilesCount() const; - virtual wxString GetHistoryFile(size_t i) const; - virtual void FileHistoryUseMenu(wxMenu *menu); - virtual void FileHistoryRemoveMenu(wxMenu *menu); -#if wxUSE_CONFIG - virtual void FileHistoryLoad(wxConfigBase& config); - virtual void FileHistorySave(wxConfigBase& config); -#endif // wxUSE_CONFIG - - virtual void FileHistoryAddFilesToMenu(); - virtual void FileHistoryAddFilesToMenu(wxMenu* menu); - - wxString GetLastDirectory() const { return m_lastDirectory; } - void SetLastDirectory(const wxString& dir) { m_lastDirectory = dir; } - - // Get the current document manager - static wxDocManager* GetDocumentManager() { return sm_docManager; } - -#if WXWIN_COMPATIBILITY_2_6 - // deprecated, use GetHistoryFilesCount() instead - wxDEPRECATED( size_t GetNoHistoryFiles() const ); -#endif // WXWIN_COMPATIBILITY_2_6 - -protected: - long m_flags; - int m_defaultDocumentNameCounter; - int m_maxDocsOpen; - wxList m_docs; - wxList m_templates; - wxView* m_currentView; - wxFileHistory* m_fileHistory; - wxString m_lastDirectory; - static wxDocManager* sm_docManager; - - DECLARE_EVENT_TABLE() - DECLARE_DYNAMIC_CLASS(wxDocManager) - DECLARE_NO_COPY_CLASS(wxDocManager) -}; - -#if WXWIN_COMPATIBILITY_2_6 -inline size_t wxDocManager::GetNoHistoryFiles() const -{ - return GetHistoryFilesCount(); -} -#endif // WXWIN_COMPATIBILITY_2_6 - -// ---------------------------------------------------------------------------- -// A default child frame -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxDocChildFrame : public wxFrame -{ -public: - wxDocChildFrame(wxDocument *doc, - wxView *view, - wxFrame *frame, - wxWindowID id, - const wxString& title, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long type = wxDEFAULT_FRAME_STYLE, - const wxString& name = wxT("frame")); - virtual ~wxDocChildFrame(){} - - // Extend event processing to search the view's event table - virtual bool ProcessEvent(wxEvent& event); - - void OnActivate(wxActivateEvent& event); - void OnCloseWindow(wxCloseEvent& event); - - wxDocument *GetDocument() const { return m_childDocument; } - wxView *GetView() const { return m_childView; } - void SetDocument(wxDocument *doc) { m_childDocument = doc; } - void SetView(wxView *view) { m_childView = view; } - bool Destroy() { m_childView = (wxView *)NULL; return wxFrame::Destroy(); } - -protected: - wxDocument* m_childDocument; - wxView* m_childView; - -private: - DECLARE_CLASS(wxDocChildFrame) - DECLARE_EVENT_TABLE() - DECLARE_NO_COPY_CLASS(wxDocChildFrame) -}; - -// ---------------------------------------------------------------------------- -// A default parent frame -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxDocParentFrame : public wxFrame -{ -public: - wxDocParentFrame(); - wxDocParentFrame(wxDocManager *manager, - wxFrame *frame, - wxWindowID id, - const wxString& title, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = wxDEFAULT_FRAME_STYLE, - const wxString& name = wxFrameNameStr); - - bool Create(wxDocManager *manager, - wxFrame *frame, - wxWindowID id, - const wxString& title, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = wxDEFAULT_FRAME_STYLE, - const wxString& name = wxFrameNameStr); - - // Extend event processing to search the document manager's event table - virtual bool ProcessEvent(wxEvent& event); - - wxDocManager *GetDocumentManager() const { return m_docManager; } - - void OnExit(wxCommandEvent& event); - void OnMRUFile(wxCommandEvent& event); - void OnCloseWindow(wxCloseEvent& event); - -protected: - wxDocManager *m_docManager; - -private: - typedef wxFrame base_type; - DECLARE_CLASS(wxDocParentFrame) - DECLARE_EVENT_TABLE() - DECLARE_NO_COPY_CLASS(wxDocParentFrame) -}; - -// ---------------------------------------------------------------------------- -// Provide simple default printing facilities -// ---------------------------------------------------------------------------- - -#if wxUSE_PRINTING_ARCHITECTURE -class WXDLLEXPORT wxDocPrintout : public wxPrintout -{ -public: - wxDocPrintout(wxView *view = (wxView *) NULL, const wxString& title = wxT("Printout")); - bool OnPrintPage(int page); - bool HasPage(int page); - bool OnBeginDocument(int startPage, int endPage); - void GetPageInfo(int *minPage, int *maxPage, int *selPageFrom, int *selPageTo); - - virtual wxView *GetView() { return m_printoutView; } - -protected: - wxView* m_printoutView; - -private: - DECLARE_DYNAMIC_CLASS(wxDocPrintout) - DECLARE_NO_COPY_CLASS(wxDocPrintout) -}; -#endif // wxUSE_PRINTING_ARCHITECTURE - -// ---------------------------------------------------------------------------- -// File history management -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxFileHistory : public wxObject -{ -public: - wxFileHistory(size_t maxFiles = 9, wxWindowID idBase = wxID_FILE1); - virtual ~wxFileHistory(); - - // Operations - virtual void AddFileToHistory(const wxString& file); - virtual void RemoveFileFromHistory(size_t i); - virtual int GetMaxFiles() const { return (int)m_fileMaxFiles; } - virtual void UseMenu(wxMenu *menu); - - // Remove menu from the list (MDI child may be closing) - virtual void RemoveMenu(wxMenu *menu); - -#if wxUSE_CONFIG - virtual void Load(wxConfigBase& config); - virtual void Save(wxConfigBase& config); -#endif // wxUSE_CONFIG - - virtual void AddFilesToMenu(); - virtual void AddFilesToMenu(wxMenu* menu); // Single menu - - // Accessors - virtual wxString GetHistoryFile(size_t i) const; - virtual size_t GetCount() const { return m_fileHistoryN; } - - const wxList& GetMenus() const { return m_fileMenus; } - -#if wxABI_VERSION >= 20802 - // Set/get base id - void SetBaseId(wxWindowID baseId) { m_idBase = baseId; } - wxWindowID GetBaseId() const { return m_idBase; } -#endif // wxABI 2.8.2+ - -#if WXWIN_COMPATIBILITY_2_6 - // deprecated, use GetCount() instead - wxDEPRECATED( size_t GetNoHistoryFiles() const ); -#endif // WXWIN_COMPATIBILITY_2_6 - -protected: - // Last n files - wxChar** m_fileHistory; - // Number of files saved - size_t m_fileHistoryN; - // Menus to maintain (may need several for an MDI app) - wxList m_fileMenus; - // Max files to maintain - size_t m_fileMaxFiles; - -private: - // The ID of the first history menu item (Doesn't have to be wxID_FILE1) - wxWindowID m_idBase; - - DECLARE_DYNAMIC_CLASS(wxFileHistory) - DECLARE_NO_COPY_CLASS(wxFileHistory) -}; - -#if WXWIN_COMPATIBILITY_2_6 -inline size_t wxFileHistory::GetNoHistoryFiles() const -{ - return m_fileHistoryN; -} -#endif // WXWIN_COMPATIBILITY_2_6 - -#if wxUSE_STD_IOSTREAM -// For compatibility with existing file formats: -// converts from/to a stream to/from a temporary file. -bool WXDLLEXPORT wxTransferFileToStream(const wxString& filename, wxSTD ostream& stream); -bool WXDLLEXPORT wxTransferStreamToFile(wxSTD istream& stream, const wxString& filename); -#else -// For compatibility with existing file formats: -// converts from/to a stream to/from a temporary file. -bool WXDLLEXPORT wxTransferFileToStream(const wxString& filename, wxOutputStream& stream); -bool WXDLLEXPORT wxTransferStreamToFile(wxInputStream& stream, const wxString& filename); -#endif // wxUSE_STD_IOSTREAM - -#endif // wxUSE_DOC_VIEW_ARCHITECTURE - -#endif // _WX_DOCH__ diff --git a/wxWidgets/include/wx/dragimag.h b/wxWidgets/include/wx/dragimag.h deleted file mode 100644 index 279cd56837..0000000000 --- a/wxWidgets/include/wx/dragimag.h +++ /dev/null @@ -1,54 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/dragimag.h -// Purpose: wxDragImage base header -// Author: Julian Smart -// Modified by: -// Created: -// Copyright: (c) Julian Smart -// RCS-ID: $Id: dragimag.h 33948 2005-05-04 18:57:50Z JS $ -// Licence: wxWindows Licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_DRAGIMAG_H_BASE_ -#define _WX_DRAGIMAG_H_BASE_ - -#if wxUSE_DRAGIMAGE - -class WXDLLEXPORT wxRect; -class WXDLLEXPORT wxMemoryDC; -class WXDLLEXPORT wxDC; - -#if defined(__WXMSW__) -# if defined(__WXUNIVERSAL__) -# include "wx/generic/dragimgg.h" -# define wxDragImage wxGenericDragImage -# else -# include "wx/msw/dragimag.h" -# endif - -#elif defined(__WXMOTIF__) -# include "wx/generic/dragimgg.h" -# define wxDragImage wxGenericDragImage - -#elif defined(__WXGTK__) -# include "wx/generic/dragimgg.h" -# define wxDragImage wxGenericDragImage - -#elif defined(__WXX11__) -# include "wx/generic/dragimgg.h" -# define wxDragImage wxGenericDragImage - -#elif defined(__WXMAC__) -# include "wx/generic/dragimgg.h" -# define wxDragImage wxGenericDragImage - -#elif defined(__WXPM__) -# include "wx/generic/dragimgg.h" -# define wxDragImage wxGenericDragImage - -#endif - -#endif // wxUSE_DRAGIMAGE - -#endif - // _WX_DRAGIMAG_H_BASE_ diff --git a/wxWidgets/include/wx/dynarray.h b/wxWidgets/include/wx/dynarray.h deleted file mode 100644 index 5dfb8bf269..0000000000 --- a/wxWidgets/include/wx/dynarray.h +++ /dev/null @@ -1,1044 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: wx/dynarray.h -// Purpose: auto-resizable (i.e. dynamic) array support -// Author: Vadim Zeitlin -// Modified by: -// Created: 12.09.97 -// RCS-ID: $Id: dynarray.h 45498 2007-04-16 13:03:05Z VZ $ -// Copyright: (c) 1998 Vadim Zeitlin -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _DYNARRAY_H -#define _DYNARRAY_H - -#include "wx/defs.h" - -#if wxUSE_STL - #include "wx/beforestd.h" - #include - #include - #include "wx/afterstd.h" -#endif - -/* - This header defines the dynamic arrays and object arrays (i.e. arrays which - own their elements). Dynamic means that the arrays grow automatically as - needed. - - These macros are ugly (especially if you look in the sources ;-), but they - allow us to define "template" classes without actually using templates and so - this works with all compilers (and may be also much faster to compile even - with a compiler which does support templates). The arrays defined with these - macros are type-safe. - - Range checking is performed in debug build for both arrays and objarrays but - not in release build - so using an invalid index will just lead to a crash - then. - - Note about memory usage: arrays never shrink automatically (although you may - use Shrink() function explicitly), they only grow, so loading 10 millions in - an array only to delete them 2 lines below might be a bad idea if the array - object is not going to be destroyed soon. However, as it does free memory - when destroyed, it is ok if the array is a local variable. - */ - -// ---------------------------------------------------------------------------- -// constants -// ---------------------------------------------------------------------------- - -/* - The initial size by which an array grows when an element is added default - value avoids allocate one or two bytes when the array is created which is - rather inefficient -*/ -#define WX_ARRAY_DEFAULT_INITIAL_SIZE (16) - -// ---------------------------------------------------------------------------- -// types -// ---------------------------------------------------------------------------- - -/* - Callback compare function for quick sort. - - It must return negative value, 0 or positive value if the first item is - less than, equal to or greater than the second one. - */ -extern "C" -{ -typedef int (wxCMPFUNC_CONV *CMPFUNC)(const void* pItem1, const void* pItem2); -} - -// ---------------------------------------------------------------------------- -// Base class managing data having size of type 'long' (not used directly) -// -// NB: for efficiency this often used class has no virtual functions (hence no -// virtual table), even dtor is *not* virtual. If used as expected it -// won't create any problems because ARRAYs from DEFINE_ARRAY have no dtor -// at all, so it's not too important if it's not called (this happens when -// you cast "SomeArray *" as "BaseArray *" and then delete it) -// ---------------------------------------------------------------------------- - -#if wxUSE_STL - -template -class WXDLLIMPEXP_BASE wxArray_SortFunction -{ -public: - typedef int (wxCMPFUNC_CONV *CMPFUNC)(T* pItem1, T* pItem2); - - wxArray_SortFunction(CMPFUNC f) : m_f(f) { } - bool operator()(const T& i1, const T& i2) - { return m_f((T*)&i1, (T*)&i2) < 0; } -private: - CMPFUNC m_f; -}; - -template -class WXDLLIMPEXP_BASE wxSortedArray_SortFunction -{ -public: - typedef F CMPFUNC; - - wxSortedArray_SortFunction(CMPFUNC f) : m_f(f) { } - bool operator()(const T& i1, const T& i2) - { return m_f(i1, i2) < 0; } -private: - CMPFUNC m_f; -}; - -#define _WX_DECLARE_BASEARRAY(T, name, classexp) \ - typedef int (wxCMPFUNC_CONV *CMPFUN##name)(T pItem1, T pItem2); \ - typedef wxSortedArray_SortFunction name##_Predicate; \ - _WX_DECLARE_BASEARRAY_2(T, name, name##_Predicate, classexp) - -#define _WX_DECLARE_BASEARRAY_2(T, name, predicate, classexp) \ -classexp name : public std::vector \ -{ \ - typedef predicate Predicate; \ - typedef predicate::CMPFUNC SCMPFUNC; \ -public: \ - typedef wxArray_SortFunction::CMPFUNC CMPFUNC; \ -public: \ - void Empty() { clear(); } \ - void Clear() { clear(); } \ - void Alloc(size_t uiSize) { reserve(uiSize); } \ - void Shrink(); \ - \ - size_t GetCount() const { return size(); } \ - void SetCount(size_t n, T v = T()) { resize(n, v); } \ - bool IsEmpty() const { return empty(); } \ - size_t Count() const { return size(); } \ - \ - typedef T base_type; \ - \ -protected: \ - T& Item(size_t uiIndex) const \ - { wxASSERT( uiIndex < size() ); return (T&)operator[](uiIndex); } \ - \ - int Index(T e, bool bFromEnd = false) const; \ - int Index(T lItem, CMPFUNC fnCompare) const; \ - size_t IndexForInsert(T lItem, CMPFUNC fnCompare) const; \ - void Add(T lItem, size_t nInsert = 1) \ - { insert(end(), nInsert, lItem); } \ - size_t Add(T lItem, CMPFUNC fnCompare); \ - void Insert(T lItem, size_t uiIndex, size_t nInsert = 1) \ - { insert(begin() + uiIndex, nInsert, lItem); } \ - void Remove(T lItem); \ - void RemoveAt(size_t uiIndex, size_t nRemove = 1) \ - { erase(begin() + uiIndex, begin() + uiIndex + nRemove); } \ - \ - void Sort(CMPFUNC fCmp) \ - { \ - wxArray_SortFunction p(fCmp); \ - std::sort(begin(), end(), p); \ - } \ -} - -#else // if !wxUSE_STL - -#define _WX_DECLARE_BASEARRAY(T, name, classexp) \ -classexp name \ -{ \ - typedef CMPFUNC SCMPFUNC; /* for compatibility wuth wxUSE_STL */ \ -public: \ - name(); \ - name(const name& array); \ - name& operator=(const name& src); \ - ~name(); \ - \ - void Empty() { m_nCount = 0; } \ - void Clear(); \ - void Alloc(size_t n) { if ( n > m_nSize ) Realloc(n); } \ - void Shrink(); \ - \ - size_t GetCount() const { return m_nCount; } \ - void SetCount(size_t n, T defval = T()); \ - bool IsEmpty() const { return m_nCount == 0; } \ - size_t Count() const { return m_nCount; } \ - \ - typedef T base_type; \ - \ -protected: \ - T& Item(size_t uiIndex) const \ - { wxASSERT( uiIndex < m_nCount ); return m_pItems[uiIndex]; } \ - T& operator[](size_t uiIndex) const { return Item(uiIndex); } \ - \ - int Index(T lItem, bool bFromEnd = false) const; \ - int Index(T lItem, CMPFUNC fnCompare) const; \ - size_t IndexForInsert(T lItem, CMPFUNC fnCompare) const; \ - void Add(T lItem, size_t nInsert = 1); \ - size_t Add(T lItem, CMPFUNC fnCompare); \ - void Insert(T lItem, size_t uiIndex, size_t nInsert = 1); \ - void Remove(T lItem); \ - void RemoveAt(size_t uiIndex, size_t nRemove = 1); \ - \ - void Sort(CMPFUNC fnCompare); \ - \ - /* *minimal* STL-ish interface, for derived classes */ \ - typedef T value_type; \ - typedef value_type* iterator; \ - typedef const value_type* const_iterator; \ - typedef value_type& reference; \ - typedef const value_type& const_reference; \ - typedef int difference_type; \ - typedef size_t size_type; \ - \ - void assign(const_iterator first, const_iterator last); \ - void assign(size_type n, const_reference v); \ - size_type capacity() const { return m_nSize; } \ - iterator erase(iterator first, iterator last) \ - { \ - size_type idx = first - begin(); \ - RemoveAt(idx, last - first); \ - return begin() + idx; \ - } \ - iterator erase(iterator it) { return erase(it, it + 1); } \ - void insert(iterator it, size_type n, const value_type& v) \ - { Insert(v, it - begin(), n); } \ - iterator insert(iterator it, const value_type& v = value_type()) \ - { \ - size_type idx = it - begin(); \ - Insert(v, idx); \ - return begin() + idx; \ - } \ - void insert(iterator it, const_iterator first, const_iterator last);\ - void pop_back() { RemoveAt(size() - 1); } \ - void push_back(const value_type& v) { Add(v); } \ - void reserve(size_type n) { Alloc(n); } \ - void resize(size_type n, value_type v = value_type()) \ - { SetCount(n, v); } \ - \ - iterator begin() { return m_pItems; } \ - iterator end() { return m_pItems + m_nCount; } \ - const_iterator begin() const { return m_pItems; } \ - const_iterator end() const { return m_pItems + m_nCount; } \ - \ - /* the following functions may be made directly public because */ \ - /* they don't use the type of the elements at all */ \ -public: \ - void clear() { Clear(); } \ - bool empty() const { return IsEmpty(); } \ - size_type max_size() const { return INT_MAX; } \ - size_type size() const { return GetCount(); } \ - \ -private: \ - void Grow(size_t nIncrement = 0); \ - bool Realloc(size_t nSize); \ - \ - size_t m_nSize, \ - m_nCount; \ - \ - T *m_pItems; \ -} - -#endif // !wxUSE_STL - -// ============================================================================ -// The private helper macros containing the core of the array classes -// ============================================================================ - -// Implementation notes: -// -// JACS: Salford C++ doesn't like 'var->operator=' syntax, as in: -// { ((wxBaseArray *)this)->operator=((const wxBaseArray&)src); -// so using a temporary variable instead. -// -// The classes need a (even trivial) ~name() to link under Mac X -// -// _WX_ERROR_REMOVE is needed to resolve the name conflict between the wxT() -// macro and T typedef: we can't use wxT() inside WX_DEFINE_ARRAY! - -#define _WX_ERROR_REMOVE wxT("removing inexisting element in wxArray::Remove") - -// ---------------------------------------------------------------------------- -// _WX_DEFINE_TYPEARRAY: array for simple types -// ---------------------------------------------------------------------------- - -#if wxUSE_STL - -#define _WX_DEFINE_TYPEARRAY(T, name, base, classexp) \ -typedef int (CMPFUNC_CONV *CMPFUNC##T)(T *pItem1, T *pItem2); \ -classexp name : public base \ -{ \ -public: \ - T& operator[](size_t uiIndex) const \ - { return (T&)(base::operator[](uiIndex)); } \ - T& Item(size_t uiIndex) const \ - { return (T&)/*const cast*/base::operator[](uiIndex); } \ - T& Last() const \ - { return Item(Count() - 1); } \ - \ - int Index(T e, bool bFromEnd = false) const \ - { return base::Index(e, bFromEnd); } \ - \ - void Add(T lItem, size_t nInsert = 1) \ - { insert(end(), nInsert, lItem); } \ - void Insert(T lItem, size_t uiIndex, size_t nInsert = 1) \ - { insert(begin() + uiIndex, nInsert, lItem); } \ - \ - void RemoveAt(size_t uiIndex, size_t nRemove = 1) \ - { base::RemoveAt(uiIndex, nRemove); } \ - void Remove(T lItem) \ - { int iIndex = Index(lItem); \ - wxCHECK2_MSG( iIndex != wxNOT_FOUND, return, \ - _WX_ERROR_REMOVE); \ - RemoveAt((size_t)iIndex); } \ - \ - void Sort(CMPFUNC##T fCmp) { base::Sort((CMPFUNC)fCmp); } \ -} - -#define _WX_DEFINE_TYPEARRAY_PTR(T, name, base, classexp) \ - _WX_DEFINE_TYPEARRAY(T, name, base, classexp) - -#else // if !wxUSE_STL - -// common declaration used by both _WX_DEFINE_TYPEARRAY and -// _WX_DEFINE_TYPEARRAY_PTR -#define _WX_DEFINE_TYPEARRAY_HELPER(T, name, base, classexp, ptrop) \ -wxCOMPILE_TIME_ASSERT2(sizeof(T) <= sizeof(base::base_type), \ - TypeTooBigToBeStoredIn##base, \ - name); \ -typedef int (CMPFUNC_CONV *CMPFUNC##T)(T *pItem1, T *pItem2); \ -classexp name : public base \ -{ \ -public: \ - name() { } \ - ~name() { } \ - \ - name& operator=(const name& src) \ - { base* temp = (base*) this; \ - (*temp) = ((const base&)src); \ - return *this; } \ - \ - T& operator[](size_t uiIndex) const \ - { return (T&)(base::operator[](uiIndex)); } \ - T& Item(size_t uiIndex) const \ - { return (T&)(base::operator[](uiIndex)); } \ - T& Last() const \ - { return (T&)(base::operator[](Count() - 1)); } \ - \ - int Index(T lItem, bool bFromEnd = false) const \ - { return base::Index((base_type)lItem, bFromEnd); } \ - \ - void Add(T lItem, size_t nInsert = 1) \ - { base::Add((base_type)lItem, nInsert); } \ - void Insert(T lItem, size_t uiIndex, size_t nInsert = 1) \ - { base::Insert((base_type)lItem, uiIndex, nInsert) ; } \ - \ - void RemoveAt(size_t uiIndex, size_t nRemove = 1) \ - { base::RemoveAt(uiIndex, nRemove); } \ - void Remove(T lItem) \ - { int iIndex = Index(lItem); \ - wxCHECK2_MSG( iIndex != wxNOT_FOUND, return, \ - _WX_ERROR_REMOVE); \ - base::RemoveAt((size_t)iIndex); } \ - \ - void Sort(CMPFUNC##T fCmp) { base::Sort((CMPFUNC)fCmp); } \ - \ - /* STL-like interface */ \ -private: \ - typedef base::iterator biterator; \ - typedef base::const_iterator bconst_iterator; \ - typedef base::value_type bvalue_type; \ - typedef base::const_reference bconst_reference; \ -public: \ - typedef T value_type; \ - typedef value_type* pointer; \ - typedef const value_type* const_pointer; \ - typedef value_type* iterator; \ - typedef const value_type* const_iterator; \ - typedef value_type& reference; \ - typedef const value_type& const_reference; \ - typedef base::difference_type difference_type; \ - typedef base::size_type size_type; \ - \ - class reverse_iterator \ - { \ - typedef T value_type; \ - typedef value_type& reference; \ - typedef value_type* pointer; \ - typedef reverse_iterator itor; \ - friend inline itor operator+(int o, const itor& it) \ - { return it.m_ptr - o; } \ - friend inline itor operator+(const itor& it, int o) \ - { return it.m_ptr - o; } \ - friend inline itor operator-(const itor& it, int o) \ - { return it.m_ptr + o; } \ - friend inline difference_type operator-(const itor& i1, \ - const itor& i2) \ - { return i1.m_ptr - i2.m_ptr; } \ - \ - public: \ - pointer m_ptr; \ - reverse_iterator() : m_ptr(NULL) { } \ - reverse_iterator(pointer ptr) : m_ptr(ptr) { } \ - reverse_iterator(const itor& it) : m_ptr(it.m_ptr) { } \ - reference operator*() const { return *m_ptr; } \ - ptrop \ - itor& operator++() { --m_ptr; return *this; } \ - const itor operator++(int) \ - { reverse_iterator tmp = *this; --m_ptr; return tmp; } \ - itor& operator--() { ++m_ptr; return *this; } \ - const itor operator--(int) { itor tmp = *this; ++m_ptr; return tmp; }\ - bool operator ==(const itor& it) const { return m_ptr == it.m_ptr; }\ - bool operator !=(const itor& it) const { return m_ptr != it.m_ptr; }\ - }; \ - \ - class const_reverse_iterator \ - { \ - typedef T value_type; \ - typedef const value_type& reference; \ - typedef const value_type* pointer; \ - typedef const_reverse_iterator itor; \ - friend inline itor operator+(int o, const itor& it) \ - { return it.m_ptr - o; } \ - friend inline itor operator+(const itor& it, int o) \ - { return it.m_ptr - o; } \ - friend inline itor operator-(const itor& it, int o) \ - { return it.m_ptr + o; } \ - friend inline difference_type operator-(const itor& i1, \ - const itor& i2) \ - { return i1.m_ptr - i2.m_ptr; } \ - \ - public: \ - pointer m_ptr; \ - const_reverse_iterator() : m_ptr(NULL) { } \ - const_reverse_iterator(pointer ptr) : m_ptr(ptr) { } \ - const_reverse_iterator(const itor& it) : m_ptr(it.m_ptr) { } \ - const_reverse_iterator(const reverse_iterator& it) : m_ptr(it.m_ptr) { }\ - reference operator*() const { return *m_ptr; } \ - ptrop \ - itor& operator++() { --m_ptr; return *this; } \ - const itor operator++(int) \ - { itor tmp = *this; --m_ptr; return tmp; } \ - itor& operator--() { ++m_ptr; return *this; } \ - const itor operator--(int) { itor tmp = *this; ++m_ptr; return tmp; }\ - bool operator ==(const itor& it) const { return m_ptr == it.m_ptr; }\ - bool operator !=(const itor& it) const { return m_ptr != it.m_ptr; }\ - }; \ - \ - name(size_type n, const_reference v) { assign(n, v); } \ - name(const_iterator first, const_iterator last) \ - { assign(first, last); } \ - void assign(const_iterator first, const_iterator last) \ - { base::assign((bconst_iterator)first, (bconst_iterator)last); } \ - void assign(size_type n, const_reference v) \ - { base::assign(n, (bconst_reference)v); } \ - reference back() { return *(end() - 1); } \ - const_reference back() const { return *(end() - 1); } \ - iterator begin() { return (iterator)base::begin(); } \ - const_iterator begin() const { return (const_iterator)base::begin(); }\ - size_type capacity() const { return base::capacity(); } \ - iterator end() { return (iterator)base::end(); } \ - const_iterator end() const { return (const_iterator)base::end(); } \ - iterator erase(iterator first, iterator last) \ - { return (iterator)base::erase((biterator)first, (biterator)last); }\ - iterator erase(iterator it) \ - { return (iterator)base::erase((biterator)it); } \ - reference front() { return *begin(); } \ - const_reference front() const { return *begin(); } \ - void insert(iterator it, size_type n, const_reference v) \ - { base::insert((biterator)it, n, (bconst_reference)v); } \ - iterator insert(iterator it, const_reference v = value_type()) \ - { return (iterator)base::insert((biterator)it, (bconst_reference)v); }\ - void insert(iterator it, const_iterator first, const_iterator last) \ - { base::insert((biterator)it, (bconst_iterator)first, \ - (bconst_iterator)last); } \ - void pop_back() { base::pop_back(); } \ - void push_back(const_reference v) \ - { base::push_back((bconst_reference)v); } \ - reverse_iterator rbegin() { return reverse_iterator(end() - 1); } \ - const_reverse_iterator rbegin() const; \ - reverse_iterator rend() { return reverse_iterator(begin() - 1); } \ - const_reverse_iterator rend() const; \ - void reserve(size_type n) { base::reserve(n); } \ - void resize(size_type n, value_type v = value_type()) \ - { base::resize(n, v); } \ -} - -#define _WX_PTROP pointer operator->() const { return m_ptr; } -#define _WX_PTROP_NONE - -#define _WX_DEFINE_TYPEARRAY(T, name, base, classexp) \ - _WX_DEFINE_TYPEARRAY_HELPER(T, name, base, classexp, _WX_PTROP) -#define _WX_DEFINE_TYPEARRAY_PTR(T, name, base, classexp) \ - _WX_DEFINE_TYPEARRAY_HELPER(T, name, base, classexp, _WX_PTROP_NONE) - -#endif // !wxUSE_STL - -// ---------------------------------------------------------------------------- -// _WX_DEFINE_SORTED_TYPEARRAY: sorted array for simple data types -// cannot handle types with size greater than pointer because of sorting -// ---------------------------------------------------------------------------- - -#define _WX_DEFINE_SORTED_TYPEARRAY_2(T, name, base, defcomp, classexp, comptype)\ -wxCOMPILE_TIME_ASSERT2(sizeof(T) <= sizeof(base::base_type), \ - TypeTooBigToBeStoredInSorted##base, \ - name); \ -classexp name : public base \ -{ \ - typedef comptype SCMPFUNC; \ -public: \ - name(comptype fn defcomp) { m_fnCompare = fn; } \ - \ - name& operator=(const name& src) \ - { base* temp = (base*) this; \ - (*temp) = ((const base&)src); \ - m_fnCompare = src.m_fnCompare; \ - return *this; } \ - \ - T& operator[](size_t uiIndex) const \ - { return (T&)(base::operator[](uiIndex)); } \ - T& Item(size_t uiIndex) const \ - { return (T&)(base::operator[](uiIndex)); } \ - T& Last() const \ - { return (T&)(base::operator[](size() - 1)); } \ - \ - int Index(T lItem) const \ - { return base::Index(lItem, (CMPFUNC)m_fnCompare); } \ - \ - size_t IndexForInsert(T lItem) const \ - { return base::IndexForInsert(lItem, (CMPFUNC)m_fnCompare); } \ - \ - void AddAt(T item, size_t index) \ - { base::insert(begin() + index, item); } \ - \ - size_t Add(T lItem) \ - { return base::Add(lItem, (CMPFUNC)m_fnCompare); } \ - \ - void RemoveAt(size_t uiIndex, size_t nRemove = 1) \ - { base::erase(begin() + uiIndex, begin() + uiIndex + nRemove); } \ - void Remove(T lItem) \ - { int iIndex = Index(lItem); \ - wxCHECK2_MSG( iIndex != wxNOT_FOUND, return, \ - _WX_ERROR_REMOVE ); \ - base::erase(begin() + iIndex); } \ - \ -private: \ - comptype m_fnCompare; \ -} - - -// ---------------------------------------------------------------------------- -// _WX_DECLARE_OBJARRAY: an array for pointers to type T with owning semantics -// ---------------------------------------------------------------------------- - -#define _WX_DECLARE_OBJARRAY(T, name, base, classexp) \ -typedef int (CMPFUNC_CONV *CMPFUNC##T)(T **pItem1, T **pItem2); \ -classexp name : protected base \ -{ \ -typedef int (CMPFUNC_CONV *CMPFUNC##base)(void **pItem1, void **pItem2); \ -typedef base base_array; \ -public: \ - name() { } \ - name(const name& src); \ - name& operator=(const name& src); \ - \ - ~name(); \ - \ - void Alloc(size_t count) { reserve(count); } \ - size_t GetCount() const { return base_array::size(); } \ - size_t size() const { return base_array::size(); } \ - bool IsEmpty() const { return base_array::empty(); } \ - bool empty() const { return base_array::empty(); } \ - size_t Count() const { return base_array::size(); } \ - void Shrink() { base::Shrink(); } \ - \ - T& operator[](size_t uiIndex) const \ - { return *(T*)base::operator[](uiIndex); } \ - T& Item(size_t uiIndex) const \ - { return *(T*)base::operator[](uiIndex); } \ - T& Last() const \ - { return *(T*)(base::operator[](size() - 1)); } \ - \ - int Index(const T& lItem, bool bFromEnd = false) const; \ - \ - void Add(const T& lItem, size_t nInsert = 1); \ - void Add(const T* pItem) \ - { base::push_back((T*)pItem); } \ - void push_back(const T* pItem) \ - { base::push_back((T*)pItem); } \ - void push_back(const T& lItem) \ - { Add(lItem); } \ - \ - void Insert(const T& lItem, size_t uiIndex, size_t nInsert = 1); \ - void Insert(const T* pItem, size_t uiIndex) \ - { base::insert(begin() + uiIndex, (T*)pItem); } \ - \ - void Empty() { DoEmpty(); base::clear(); } \ - void Clear() { DoEmpty(); base::clear(); } \ - \ - T* Detach(size_t uiIndex) \ - { T* p = (T*)base::operator[](uiIndex); \ - base::erase(begin() + uiIndex); return p; } \ - void RemoveAt(size_t uiIndex, size_t nRemove = 1); \ - \ - void Sort(CMPFUNC##T fCmp) { base::Sort((CMPFUNC##base)fCmp); } \ - \ -private: \ - void DoEmpty(); \ - void DoCopy(const name& src); \ -} - -// ============================================================================ -// The public macros for declaration and definition of the dynamic arrays -// ============================================================================ - -// Please note that for each macro WX_FOO_ARRAY we also have -// WX_FOO_EXPORTED_ARRAY and WX_FOO_USER_EXPORTED_ARRAY which are exactly the -// same except that they use an additional __declspec(dllexport) or equivalent -// under Windows if needed. -// -// The first (just EXPORTED) macros do it if wxWidgets was compiled as a DLL -// and so must be used used inside the library. The second kind (USER_EXPORTED) -// allow the user code to do it when it wants. This is needed if you have a dll -// that wants to export a wxArray daubed with your own import/export goo. -// -// Finally, you can define the macro below as something special to modify the -// arrays defined by a simple WX_FOO_ARRAY as well. By default is is empty. -#define wxARRAY_DEFAULT_EXPORT - -// ---------------------------------------------------------------------------- -// WX_DECLARE_BASEARRAY(T, name) declare an array class named "name" containing -// the elements of type T -// ---------------------------------------------------------------------------- - -#define WX_DECLARE_BASEARRAY(T, name) \ - WX_DECLARE_USER_EXPORTED_BASEARRAY(T, name, wxARRAY_DEFAULT_EXPORT) - -#define WX_DECLARE_EXPORTED_BASEARRAY(T, name) \ - WX_DECLARE_USER_EXPORTED_BASEARRAY(T, name, WXDLLEXPORT) - -#define WX_DECLARE_USER_EXPORTED_BASEARRAY(T, name, expmode) \ - typedef T _wxArray##name; \ - _WX_DECLARE_BASEARRAY(_wxArray##name, name, class expmode) - -// ---------------------------------------------------------------------------- -// WX_DEFINE_TYPEARRAY(T, name, base) define an array class named "name" deriving -// from class "base" containing the elements of type T -// -// Note that the class defined has only inline function and doesn't take any -// space at all so there is no size penalty for defining multiple array classes -// ---------------------------------------------------------------------------- - -#define WX_DEFINE_TYPEARRAY(T, name, base) \ - WX_DEFINE_TYPEARRAY_WITH_DECL(T, name, base, class wxARRAY_DEFAULT_EXPORT) - -#define WX_DEFINE_TYPEARRAY_PTR(T, name, base) \ - WX_DEFINE_TYPEARRAY_WITH_DECL_PTR(T, name, base, class wxARRAY_DEFAULT_EXPORT) - -#define WX_DEFINE_EXPORTED_TYPEARRAY(T, name, base) \ - WX_DEFINE_TYPEARRAY_WITH_DECL(T, name, base, class WXDLLEXPORT) - -#define WX_DEFINE_EXPORTED_TYPEARRAY_PTR(T, name, base) \ - WX_DEFINE_TYPEARRAY_WITH_DECL_PTR(T, name, base, class WXDLLEXPORT) - -#define WX_DEFINE_USER_EXPORTED_TYPEARRAY(T, name, base, expdecl) \ - WX_DEFINE_TYPEARRAY_WITH_DECL(T, name, base, class expdecl) - -#define WX_DEFINE_USER_EXPORTED_TYPEARRAY_PTR(T, name, base, expdecl) \ - WX_DEFINE_TYPEARRAY_WITH_DECL_PTR(T, name, base, class expdecl) - -#define WX_DEFINE_TYPEARRAY_WITH_DECL(T, name, base, classdecl) \ - typedef T _wxArray##name; \ - _WX_DEFINE_TYPEARRAY(_wxArray##name, name, base, classdecl) - -#define WX_DEFINE_TYPEARRAY_WITH_DECL_PTR(T, name, base, classdecl) \ - typedef T _wxArray##name; \ - _WX_DEFINE_TYPEARRAY_PTR(_wxArray##name, name, base, classdecl) - -// ---------------------------------------------------------------------------- -// WX_DEFINE_SORTED_TYPEARRAY: this is the same as the previous macro, but it -// defines a sorted array. -// -// Differences: -// 1) it must be given a COMPARE function in ctor which takes 2 items of type -// T* and should return -1, 0 or +1 if the first one is less/greater -// than/equal to the second one. -// 2) the Add() method inserts the item in such was that the array is always -// sorted (it uses the COMPARE function) -// 3) it has no Sort() method because it's always sorted -// 4) Index() method is much faster (the sorted arrays use binary search -// instead of linear one), but Add() is slower. -// 5) there is no Insert() method because you can't insert an item into the -// given position in a sorted array but there is IndexForInsert()/AddAt() -// pair which may be used to optimize a common operation of "insert only if -// not found" -// -// Note that you have to specify the comparison function when creating the -// objects of this array type. If, as in 99% of cases, the comparison function -// is the same for all objects of a class, WX_DEFINE_SORTED_TYPEARRAY_CMP below -// is more convenient. -// -// Summary: use this class when the speed of Index() function is important, use -// the normal arrays otherwise. -// ---------------------------------------------------------------------------- - -// we need a macro which expands to nothing to pass correct number of -// parameters to a nested macro invocation even when we don't have anything to -// pass it -#define wxARRAY_EMPTY - -#define WX_DEFINE_SORTED_TYPEARRAY(T, name, base) \ - WX_DEFINE_SORTED_USER_EXPORTED_TYPEARRAY(T, name, base, \ - wxARRAY_DEFAULT_EXPORT) - -#define WX_DEFINE_SORTED_EXPORTED_TYPEARRAY(T, name, base) \ - WX_DEFINE_SORTED_USER_EXPORTED_TYPEARRAY(T, name, base, WXDLLEXPORT) - -#define WX_DEFINE_SORTED_USER_EXPORTED_TYPEARRAY(T, name, base, expmode) \ - typedef T _wxArray##name; \ - typedef int (CMPFUNC_CONV *SCMPFUNC##name)(T pItem1, T pItem2); \ - _WX_DEFINE_SORTED_TYPEARRAY_2(_wxArray##name, name, base, \ - wxARRAY_EMPTY, class expmode, SCMPFUNC##name) - -// ---------------------------------------------------------------------------- -// WX_DEFINE_SORTED_TYPEARRAY_CMP: exactly the same as above but the comparison -// function is provided by this macro and the objects of this class have a -// default constructor which just uses it. -// -// The arguments are: the element type, the comparison function and the array -// name -// -// NB: this is, of course, how WX_DEFINE_SORTED_TYPEARRAY() should have worked -// from the very beginning - unfortunately I didn't think about this earlier -// ---------------------------------------------------------------------------- - -#define WX_DEFINE_SORTED_TYPEARRAY_CMP(T, cmpfunc, name, base) \ - WX_DEFINE_SORTED_USER_EXPORTED_TYPEARRAY_CMP(T, cmpfunc, name, base, \ - wxARRAY_DEFAULT_EXPORT) - -#define WX_DEFINE_SORTED_EXPORTED_TYPEARRAY_CMP(T, cmpfunc, name, base) \ - WX_DEFINE_SORTED_USER_EXPORTED_TYPEARRAY_CMP(T, cmpfunc, name, base, \ - WXDLLEXPORT) - -#define WX_DEFINE_SORTED_USER_EXPORTED_TYPEARRAY_CMP(T, cmpfunc, name, base, \ - expmode) \ - typedef T _wxArray##name; \ - typedef int (CMPFUNC_CONV *SCMPFUNC##name)(T pItem1, T pItem2); \ - _WX_DEFINE_SORTED_TYPEARRAY_2(_wxArray##name, name, base, = cmpfunc, \ - class expmode, SCMPFUNC##name) - -// ---------------------------------------------------------------------------- -// WX_DECLARE_OBJARRAY(T, name): this macro generates a new array class -// named "name" which owns the objects of type T it contains, i.e. it will -// delete them when it is destroyed. -// -// An element is of type T*, but arguments of type T& are taken (see below!) -// and T& is returned. -// -// Don't use this for simple types such as "int" or "long"! -// -// Note on Add/Insert functions: -// 1) function(T*) gives the object to the array, i.e. it will delete the -// object when it's removed or in the array's dtor -// 2) function(T&) will create a copy of the object and work with it -// -// Also: -// 1) Remove() will delete the object after removing it from the array -// 2) Detach() just removes the object from the array (returning pointer to it) -// -// NB1: Base type T should have an accessible copy ctor if Add(T&) is used -// NB2: Never ever cast a array to it's base type: as dtor is not virtual -// and so you risk having at least the memory leaks and probably worse -// -// Some functions of this class are not inline, so it takes some space to -// define new class from this template even if you don't use it - which is not -// the case for the simple (non-object) array classes -// -// To use an objarray class you must -// #include "dynarray.h" -// WX_DECLARE_OBJARRAY(element_type, list_class_name) -// #include "arrimpl.cpp" -// WX_DEFINE_OBJARRAY(list_class_name) // name must be the same as above! -// -// This is necessary because at the moment of DEFINE_OBJARRAY class parsing the -// element_type must be fully defined (i.e. forward declaration is not -// enough), while WX_DECLARE_OBJARRAY may be done anywhere. The separation of -// two allows to break cicrcular dependencies with classes which have member -// variables of objarray type. -// ---------------------------------------------------------------------------- - -#define WX_DECLARE_OBJARRAY(T, name) \ - WX_DECLARE_USER_EXPORTED_OBJARRAY(T, name, wxARRAY_DEFAULT_EXPORT) - -#define WX_DECLARE_EXPORTED_OBJARRAY(T, name) \ - WX_DECLARE_USER_EXPORTED_OBJARRAY(T, name, WXDLLEXPORT) - -#define WX_DECLARE_OBJARRAY_WITH_DECL(T, name, decl) \ - typedef T _wxObjArray##name; \ - _WX_DECLARE_OBJARRAY(_wxObjArray##name, name, wxArrayPtrVoid, decl) - -#define WX_DECLARE_USER_EXPORTED_OBJARRAY(T, name, expmode) \ - WX_DECLARE_OBJARRAY_WITH_DECL(T, name, class expmode) - -// WX_DEFINE_OBJARRAY is going to be redefined when arrimpl.cpp is included, -// try to provoke a human-understandable error if it used incorrectly. -// -// there is no real need for 3 different macros in the DEFINE case but do it -// anyhow for consistency -#define WX_DEFINE_OBJARRAY(name) DidYouIncludeArrimplCpp -#define WX_DEFINE_EXPORTED_OBJARRAY(name) WX_DEFINE_OBJARRAY(name) -#define WX_DEFINE_USER_EXPORTED_OBJARRAY(name) WX_DEFINE_OBJARRAY(name) - -// ---------------------------------------------------------------------------- -// Some commonly used predefined base arrays -// ---------------------------------------------------------------------------- - -WX_DECLARE_USER_EXPORTED_BASEARRAY(const void *, wxBaseArrayPtrVoid, - WXDLLIMPEXP_BASE); -WX_DECLARE_USER_EXPORTED_BASEARRAY(char, wxBaseArrayChar, WXDLLIMPEXP_BASE); -WX_DECLARE_USER_EXPORTED_BASEARRAY(short, wxBaseArrayShort, WXDLLIMPEXP_BASE); -WX_DECLARE_USER_EXPORTED_BASEARRAY(int, wxBaseArrayInt, WXDLLIMPEXP_BASE); -WX_DECLARE_USER_EXPORTED_BASEARRAY(long, wxBaseArrayLong, WXDLLIMPEXP_BASE); -WX_DECLARE_USER_EXPORTED_BASEARRAY(size_t, wxBaseArraySizeT, WXDLLIMPEXP_BASE); -WX_DECLARE_USER_EXPORTED_BASEARRAY(double, wxBaseArrayDouble, WXDLLIMPEXP_BASE); - -// ---------------------------------------------------------------------------- -// Convenience macros to define arrays from base arrays -// ---------------------------------------------------------------------------- - -#define WX_DEFINE_ARRAY(T, name) \ - WX_DEFINE_TYPEARRAY(T, name, wxBaseArrayPtrVoid) -#define WX_DEFINE_ARRAY_PTR(T, name) \ - WX_DEFINE_TYPEARRAY_PTR(T, name, wxBaseArrayPtrVoid) -#define WX_DEFINE_EXPORTED_ARRAY(T, name) \ - WX_DEFINE_EXPORTED_TYPEARRAY(T, name, wxBaseArrayPtrVoid) -#define WX_DEFINE_EXPORTED_ARRAY_PTR(T, name) \ - WX_DEFINE_EXPORTED_TYPEARRAY_PTR(T, name, wxBaseArrayPtrVoid) -#define WX_DEFINE_ARRAY_WITH_DECL_PTR(T, name, decl) \ - WX_DEFINE_TYPEARRAY_WITH_DECL_PTR(T, name, wxBaseArrayPtrVoid, decl) -#define WX_DEFINE_USER_EXPORTED_ARRAY(T, name, expmode) \ - WX_DEFINE_TYPEARRAY_WITH_DECL(T, name, wxBaseArrayPtrVoid, wxARRAY_EMPTY expmode) -#define WX_DEFINE_USER_EXPORTED_ARRAY_PTR(T, name, expmode) \ - WX_DEFINE_TYPEARRAY_WITH_DECL_PTR(T, name, wxBaseArrayPtrVoid, wxARRAY_EMPTY expmode) - -#define WX_DEFINE_ARRAY_CHAR(T, name) \ - WX_DEFINE_TYPEARRAY_PTR(T, name, wxBaseArrayChar) -#define WX_DEFINE_EXPORTED_ARRAY_CHAR(T, name) \ - WX_DEFINE_EXPORTED_TYPEARRAY_PTR(T, name, wxBaseArrayChar) -#define WX_DEFINE_USER_EXPORTED_ARRAY_CHAR(T, name, expmode) \ - WX_DEFINE_TYPEARRAY_WITH_DECL_PTR(T, name, wxBaseArrayChar, wxARRAY_EMPTY expmode) - -#define WX_DEFINE_ARRAY_SHORT(T, name) \ - WX_DEFINE_TYPEARRAY_PTR(T, name, wxBaseArrayShort) -#define WX_DEFINE_EXPORTED_ARRAY_SHORT(T, name) \ - WX_DEFINE_EXPORTED_TYPEARRAY_PTR(T, name, wxBaseArrayShort) -#define WX_DEFINE_USER_EXPORTED_ARRAY_SHORT(T, name, expmode) \ - WX_DEFINE_TYPEARRAY_WITH_DECL_PTR(T, name, wxBaseArrayShort, wxARRAY_EMPTY expmode) - -#define WX_DEFINE_ARRAY_INT(T, name) \ - WX_DEFINE_TYPEARRAY_PTR(T, name, wxBaseArrayInt) -#define WX_DEFINE_EXPORTED_ARRAY_INT(T, name) \ - WX_DEFINE_EXPORTED_TYPEARRAY_PTR(T, name, wxBaseArrayInt) -#define WX_DEFINE_USER_EXPORTED_ARRAY_INT(T, name, expmode) \ - WX_DEFINE_TYPEARRAY_WITH_DECL_PTR(T, name, wxBaseArrayInt, wxARRAY_EMPTY expmode) - -#define WX_DEFINE_ARRAY_LONG(T, name) \ - WX_DEFINE_TYPEARRAY_PTR(T, name, wxBaseArrayLong) -#define WX_DEFINE_EXPORTED_ARRAY_LONG(T, name) \ - WX_DEFINE_EXPORTED_TYPEARRAY_PTR(T, name, wxBaseArrayLong) -#define WX_DEFINE_USER_EXPORTED_ARRAY_LONG(T, name, expmode) \ - WX_DEFINE_TYPEARRAY_WITH_DECL_PTR(T, name, wxBaseArrayLong, wxARRAY_EMPTY expmode) - -#define WX_DEFINE_ARRAY_SIZE_T(T, name) \ - WX_DEFINE_TYPEARRAY_PTR(T, name, wxBaseArraySizeT) -#define WX_DEFINE_EXPORTED_ARRAY_SIZE_T(T, name) \ - WX_DEFINE_EXPORTED_TYPEARRAY_PTR(T, name, wxBaseArraySizeT) -#define WX_DEFINE_USER_EXPORTED_ARRAY_SIZE_T(T, name, expmode) \ - WX_DEFINE_TYPEARRAY_WITH_DECL_PTR(T, name, wxBaseArraySizeT, wxARRAY_EMPTY expmode) - -#define WX_DEFINE_ARRAY_DOUBLE(T, name) \ - WX_DEFINE_TYPEARRAY_PTR(T, name, wxBaseArrayDouble) -#define WX_DEFINE_EXPORTED_ARRAY_DOUBLE(T, name) \ - WX_DEFINE_EXPORTED_TYPEARRAY_PTR(T, name, wxBaseArrayDouble) -#define WX_DEFINE_USER_EXPORTED_ARRAY_DOUBLE(T, name, expmode) \ - WX_DEFINE_TYPEARRAY_WITH_DECL_PTR(T, name, wxBaseArrayDouble, wxARRAY_EMPTY expmode) - -// ---------------------------------------------------------------------------- -// Convenience macros to define sorted arrays from base arrays -// ---------------------------------------------------------------------------- - -#define WX_DEFINE_SORTED_ARRAY(T, name) \ - WX_DEFINE_SORTED_TYPEARRAY(T, name, wxBaseArrayPtrVoid) -#define WX_DEFINE_SORTED_EXPORTED_ARRAY(T, name) \ - WX_DEFINE_SORTED_EXPORTED_TYPEARRAY(T, name, wxBaseArrayPtrVoid) -#define WX_DEFINE_SORTED_USER_EXPORTED_ARRAY(T, name, expmode) \ - WX_DEFINE_SORTED_USER_EXPORTED_TYPEARRAY(T, name, wxBaseArrayPtrVoid, wxARRAY_EMPTY expmode) - -#define WX_DEFINE_SORTED_ARRAY_CHAR(T, name) \ - WX_DEFINE_SORTED_TYPEARRAY(T, name, wxBaseArrayChar) -#define WX_DEFINE_SORTED_EXPORTED_ARRAY_CHAR(T, name) \ - WX_DEFINE_SORTED_EXPORTED_TYPEARRAY(T, name, wxBaseArrayChar) -#define WX_DEFINE_SORTED_USER_EXPORTED_ARRAY_CHAR(T, name, expmode) \ - WX_DEFINE_SORTED_USER_EXPORTED_TYPEARRAY(T, name, wxBaseArrayChar, wxARRAY_EMPTY expmode) - -#define WX_DEFINE_SORTED_ARRAY_SHORT(T, name) \ - WX_DEFINE_SORTED_TYPEARRAY(T, name, wxBaseArrayShort) -#define WX_DEFINE_SORTED_EXPORTED_ARRAY_SHORT(T, name) \ - WX_DEFINE_SORTED_EXPORTED_TYPEARRAY(T, name, wxBaseArrayShort) -#define WX_DEFINE_SORTED_USER_EXPORTED_ARRAY_SHORT(T, name, expmode) \ - WX_DEFINE_SORTED_USER_EXPORTED_TYPEARRAY(T, name, wxBaseArrayShort, wxARRAY_EMPTY expmode) - -#define WX_DEFINE_SORTED_ARRAY_INT(T, name) \ - WX_DEFINE_SORTED_TYPEARRAY(T, name, wxBaseArrayInt) -#define WX_DEFINE_SORTED_EXPORTED_ARRAY_INT(T, name) \ - WX_DEFINE_SORTED_EXPORTED_TYPEARRAY(T, name, wxBaseArrayInt) -#define WX_DEFINE_SORTED_USER_EXPORTED_ARRAY_INT(T, name, expmode) \ - WX_DEFINE_SORTED_USER_EXPORTED_TYPEARRAY(T, name, wxBaseArrayInt, expmode) - -#define WX_DEFINE_SORTED_ARRAY_LONG(T, name) \ - WX_DEFINE_SORTED_TYPEARRAY(T, name, wxBaseArrayLong) -#define WX_DEFINE_SORTED_EXPORTED_ARRAY_LONG(T, name) \ - WX_DEFINE_SORTED_EXPORTED_TYPEARRAY(T, name, wxBaseArrayLong) -#define WX_DEFINE_SORTED_USER_EXPORTED_ARRAY_LONG(T, name, expmode) \ - WX_DEFINE_SORTED_USER_EXPORTED_TYPEARRAY(T, name, wxBaseArrayLong, expmode) - -#define WX_DEFINE_SORTED_ARRAY_SIZE_T(T, name) \ - WX_DEFINE_SORTED_TYPEARRAY(T, name, wxBaseArraySizeT) -#define WX_DEFINE_SORTED_EXPORTED_ARRAY_SIZE_T(T, name) \ - WX_DEFINE_SORTED_EXPORTED_TYPEARRAY(T, name, wxBaseArraySizeT) -#define WX_DEFINE_SORTED_USER_EXPORTED_ARRAY_SIZE_T(T, name, expmode) \ - WX_DEFINE_SORTED_USER_EXPORTED_TYPEARRAY(T, name, wxBaseArraySizeT, wxARRAY_EMPTY expmode) - -// ---------------------------------------------------------------------------- -// Convenience macros to define sorted arrays from base arrays -// ---------------------------------------------------------------------------- - -#define WX_DEFINE_SORTED_ARRAY_CMP(T, cmpfunc, name) \ - WX_DEFINE_SORTED_TYPEARRAY_CMP(T, cmpfunc, name, wxBaseArrayPtrVoid) -#define WX_DEFINE_SORTED_EXPORTED_ARRAY_CMP(T, cmpfunc, name) \ - WX_DEFINE_SORTED_EXPORTED_TYPEARRAY_CMP(T, cmpfunc, name, wxBaseArrayPtrVoid) -#define WX_DEFINE_SORTED_USER_EXPORTED_ARRAY_CMP(T, cmpfunc, \ - name, expmode) \ - WX_DEFINE_SORTED_USER_EXPORTED_TYPEARRAY_CMP(T, cmpfunc, name, \ - wxBaseArrayPtrVoid, \ - wxARRAY_EMPTY expmode) - -#define WX_DEFINE_SORTED_ARRAY_CMP_CHAR(T, cmpfunc, name) \ - WX_DEFINE_SORTED_TYPEARRAY_CMP(T, cmpfunc, name, wxBaseArrayChar) -#define WX_DEFINE_SORTED_EXPORTED_ARRAY_CMP_CHAR(T, cmpfunc, name) \ - WX_DEFINE_SORTED_EXPORTED_TYPEARRAY_CMP(T, cmpfunc, name, wxBaseArrayChar) -#define WX_DEFINE_SORTED_USER_EXPORTED_ARRAY_CMP_CHAR(T, cmpfunc, \ - name, expmode) \ - WX_DEFINE_SORTED_USER_EXPORTED_TYPEARRAY_CMP(T, cmpfunc, name, \ - wxBaseArrayChar, \ - wxARRAY_EMPTY expmode) - -#define WX_DEFINE_SORTED_ARRAY_CMP_SHORT(T, cmpfunc, name) \ - WX_DEFINE_SORTED_TYPEARRAY_CMP(T, cmpfunc, name, wxBaseArrayShort) -#define WX_DEFINE_SORTED_EXPORTED_ARRAY_CMP_SHORT(T, cmpfunc, name) \ - WX_DEFINE_SORTED_EXPORTED_TYPEARRAY_CMP(T, cmpfunc, name, wxBaseArrayShort) -#define WX_DEFINE_SORTED_USER_EXPORTED_ARRAY_CMP_SHORT(T, cmpfunc, \ - name, expmode) \ - WX_DEFINE_SORTED_USER_EXPORTED_TYPEARRAY_CMP(T, cmpfunc, name, \ - wxBaseArrayShort, \ - wxARRAY_EMPTY expmode) - -#define WX_DEFINE_SORTED_ARRAY_CMP_INT(T, cmpfunc, name) \ - WX_DEFINE_SORTED_TYPEARRAY_CMP(T, cmpfunc, name, wxBaseArrayInt) -#define WX_DEFINE_SORTED_EXPORTED_ARRAY_CMP_INT(T, cmpfunc, name) \ - WX_DEFINE_SORTED_EXPORTED_TYPEARRAY_CMP(T, cmpfunc, name, wxBaseArrayInt) -#define WX_DEFINE_SORTED_USER_EXPORTED_ARRAY_CMP_INT(T, cmpfunc, \ - name, expmode) \ - WX_DEFINE_SORTED_USER_EXPORTED_TYPEARRAY_CMP(T, cmpfunc, name, \ - wxBaseArrayInt, \ - wxARRAY_EMPTY expmode) - -#define WX_DEFINE_SORTED_ARRAY_CMP_LONG(T, cmpfunc, name) \ - WX_DEFINE_SORTED_TYPEARRAY_CMP(T, cmpfunc, name, wxBaseArrayLong) -#define WX_DEFINE_SORTED_EXPORTED_ARRAY_CMP_LONG(T, cmpfunc, name) \ - WX_DEFINE_SORTED_EXPORTED_TYPEARRAY_CMP(T, cmpfunc, name, wxBaseArrayLong) -#define WX_DEFINE_SORTED_USER_EXPORTED_ARRAY_CMP_LONG(T, cmpfunc, \ - name, expmode) \ - WX_DEFINE_SORTED_USER_EXPORTED_TYPEARRAY_CMP(T, cmpfunc, name, \ - wxBaseArrayLong, \ - wxARRAY_EMPTY expmode) - -#define WX_DEFINE_SORTED_ARRAY_CMP_SIZE_T(T, cmpfunc, name) \ - WX_DEFINE_SORTED_TYPEARRAY_CMP(T, cmpfunc, name, wxBaseArraySizeT) -#define WX_DEFINE_SORTED_EXPORTED_ARRAY_CMP_SIZE_T(T, cmpfunc, name) \ - WX_DEFINE_SORTED_EXPORTED_TYPEARRAY_CMP(T, cmpfunc, name, wxBaseArraySizeT) -#define WX_DEFINE_SORTED_USER_EXPORTED_ARRAY_CMP_SIZE_T(T, cmpfunc, \ - name, expmode) \ - WX_DEFINE_SORTED_USER_EXPORTED_TYPEARRAY_CMP(T, cmpfunc, name, \ - wxBaseArraySizeT, \ - wxARRAY_EMPTY expmode) - -// ---------------------------------------------------------------------------- -// Some commonly used predefined arrays -// ---------------------------------------------------------------------------- - -WX_DEFINE_USER_EXPORTED_ARRAY_SHORT(short, wxArrayShort, class WXDLLIMPEXP_BASE); -WX_DEFINE_USER_EXPORTED_ARRAY_INT(int, wxArrayInt, class WXDLLIMPEXP_BASE); -WX_DEFINE_USER_EXPORTED_ARRAY_DOUBLE(double, wxArrayDouble, class WXDLLIMPEXP_BASE); -WX_DEFINE_USER_EXPORTED_ARRAY_LONG(long, wxArrayLong, class WXDLLIMPEXP_BASE); -WX_DEFINE_USER_EXPORTED_ARRAY_PTR(void *, wxArrayPtrVoid, class WXDLLIMPEXP_BASE); - -// ----------------------------------------------------------------------------- -// convenience macros -// ----------------------------------------------------------------------------- - -// prepend all element of one array to another one; e.g. if first array contains -// elements X,Y,Z and the second contains A,B,C (in those orders), then the -// first array will be result as A,B,C,X,Y,Z -#define WX_PREPEND_ARRAY(array, other) \ - { \ - size_t wxAAcnt = (other).size(); \ - (array).Alloc(wxAAcnt); \ - for ( size_t wxAAn = 0; wxAAn < wxAAcnt; wxAAn++ ) \ - { \ - (array).Insert((other)[wxAAn], wxAAn); \ - } \ - } - -// append all element of one array to another one -#define WX_APPEND_ARRAY(array, other) \ - { \ - size_t wxAAcnt = (other).size(); \ - (array).Alloc(wxAAcnt); \ - for ( size_t wxAAn = 0; wxAAn < wxAAcnt; wxAAn++ ) \ - { \ - (array).push_back((other)[wxAAn]); \ - } \ - } - -// delete all array elements -// -// NB: the class declaration of the array elements must be visible from the -// place where you use this macro, otherwise the proper destructor may not -// be called (a decent compiler should give a warning about it, but don't -// count on it)! -#define WX_CLEAR_ARRAY(array) \ - { \ - size_t wxAAcnt = (array).size(); \ - for ( size_t wxAAn = 0; wxAAn < wxAAcnt; wxAAn++ ) \ - { \ - delete (array)[wxAAn]; \ - } \ - \ - (array).clear(); \ - } - -#endif // _DYNARRAY_H diff --git a/wxWidgets/include/wx/dynlib.h b/wxWidgets/include/wx/dynlib.h deleted file mode 100644 index 07265f3535..0000000000 --- a/wxWidgets/include/wx/dynlib.h +++ /dev/null @@ -1,359 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/dynlib.h -// Purpose: Dynamic library loading classes -// Author: Guilhem Lavaux, Vadim Zeitlin, Vaclav Slavik -// Modified by: -// Created: 20/07/98 -// RCS-ID: $Id: dynlib.h 61872 2009-09-09 22:37:05Z VZ $ -// Copyright: (c) 1998 Guilhem Lavaux -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_DYNLIB_H__ -#define _WX_DYNLIB_H__ - -#include "wx/defs.h" - -#if wxUSE_DYNLIB_CLASS - -#include "wx/string.h" -#include "wx/dynarray.h" - -#if defined(__OS2__) || defined(__EMX__) -#include "wx/os2/private.h" -#endif - -#ifdef __WXMSW__ -#include "wx/msw/private.h" -#endif - -// note that we have our own dlerror() implementation under Darwin -#if (defined(HAVE_DLERROR) && !defined(__EMX__)) || defined(__DARWIN__) - #define wxHAVE_DYNLIB_ERROR -#endif - -class WXDLLIMPEXP_FWD_BASE wxDynamicLibraryDetailsCreator; - -// ---------------------------------------------------------------------------- -// conditional compilation -// ---------------------------------------------------------------------------- - -// Note: __OS2__/EMX has to be tested first, since we want to use -// native version, even if configure detected presence of DLOPEN. -#if defined(__OS2__) || defined(__EMX__) || defined(__WINDOWS__) - typedef HMODULE wxDllType; -#elif defined(__DARWIN__) - // Don't include dlfcn.h on Darwin, we may be using our own replacements. - typedef void *wxDllType; -#elif defined(HAVE_DLOPEN) - #include - typedef void *wxDllType; -#elif defined(HAVE_SHL_LOAD) - #include - typedef shl_t wxDllType; -#elif defined(__WXMAC__) - #include - typedef CFragConnectionID wxDllType; -#else - #error "Dynamic Loading classes can't be compiled on this platform, sorry." -#endif - -// ---------------------------------------------------------------------------- -// constants -// ---------------------------------------------------------------------------- - -enum wxDLFlags -{ - wxDL_LAZY = 0x00000001, // resolve undefined symbols at first use - // (only works on some Unix versions) - wxDL_NOW = 0x00000002, // resolve undefined symbols on load - // (default, always the case under Win32) - wxDL_GLOBAL = 0x00000004, // export extern symbols to subsequently - // loaded libs. - wxDL_VERBATIM = 0x00000008, // attempt to load the supplied library - // name without appending the usual dll - // filename extension. - wxDL_NOSHARE = 0x00000010, // load new DLL, don't reuse already loaded - // (only for wxPluginManager) - - wxDL_QUIET = 0x00000020, // don't log an error if failed to load - -#if wxABI_VERSION >= 20810 - // this flag is dangerous, for internal use of wxMSW only, don't use at all - // and especially don't use directly, use wxLoadedDLL instead if you really - // do need it - wxDL_GET_LOADED = 0x00000040, // Win32 only: return handle of already - // loaded DLL or NULL otherwise; Unload() - // should not be called so don't forget to - // Detach() if you use this function -#endif // wx 2.8.10+ - - wxDL_DEFAULT = wxDL_NOW // default flags correspond to Win32 -}; - -enum wxDynamicLibraryCategory -{ - wxDL_LIBRARY, // standard library - wxDL_MODULE // loadable module/plugin -}; - -enum wxPluginCategory -{ - wxDL_PLUGIN_GUI, // plugin that uses GUI classes - wxDL_PLUGIN_BASE // wxBase-only plugin -}; - -// ---------------------------------------------------------------------------- -// macros -// ---------------------------------------------------------------------------- - -// when loading a function from a DLL you always have to cast the returned -// "void *" pointer to the correct type and, even more annoyingly, you have to -// repeat this type twice if you want to declare and define a function pointer -// all in one line -// -// this macro makes this slightly less painful by allowing you to specify the -// type only once, as the first parameter, and creating a variable of this type -// called "pfn" initialized with the "name" from the "dynlib" -#define wxDYNLIB_FUNCTION(type, name, dynlib) \ - type pfn ## name = (type)(dynlib).GetSymbol(wxT(#name)) - -// ---------------------------------------------------------------------------- -// wxDynamicLibraryDetails: contains details about a loaded wxDynamicLibrary -// ---------------------------------------------------------------------------- - -class WXDLLIMPEXP_BASE wxDynamicLibraryDetails -{ -public: - // ctor, normally never used as these objects are only created by - // wxDynamicLibrary::ListLoaded() - wxDynamicLibraryDetails() { m_address = NULL; m_length = 0; } - - // get the (base) name - wxString GetName() const { return m_name; } - - // get the full path of this object - wxString GetPath() const { return m_path; } - - // get the load address and the extent, return true if this information is - // available - bool GetAddress(void **addr, size_t *len) const - { - if ( !m_address ) - return false; - - if ( addr ) - *addr = m_address; - if ( len ) - *len = m_length; - - return true; - } - - // return the version of the DLL (may be empty if no version info) - wxString GetVersion() const - { - return m_version; - } - -private: - wxString m_name, - m_path, - m_version; - - void *m_address; - size_t m_length; - - friend class wxDynamicLibraryDetailsCreator; -}; - -WX_DECLARE_USER_EXPORTED_OBJARRAY(wxDynamicLibraryDetails, - wxDynamicLibraryDetailsArray, - WXDLLIMPEXP_BASE); - -// ---------------------------------------------------------------------------- -// wxDynamicLibrary: represents a handle to a DLL/shared object -// ---------------------------------------------------------------------------- - -class WXDLLIMPEXP_BASE wxDynamicLibrary -{ -public: - // return a valid handle for the main program itself or NULL if back - // linking is not supported by the current platform (e.g. Win32) - static wxDllType GetProgramHandle(); - - // return the platform standard DLL extension (with leading dot) - static const wxChar *GetDllExt() { return ms_dllext; } - - wxDynamicLibrary() : m_handle(0) { } - wxDynamicLibrary(const wxString& libname, int flags = wxDL_DEFAULT) - : m_handle(0) - { - Load(libname, flags); - } - - // NOTE: this class is (deliberately) not virtual, do not attempt - // to use it polymorphically. - ~wxDynamicLibrary() { Unload(); } - - // return true if the library was loaded successfully - bool IsLoaded() const { return m_handle != 0; } - - // load the library with the given name (full or not), return true if ok - bool Load(const wxString& libname, int flags = wxDL_DEFAULT); - - // raw function for loading dynamic libs: always behaves as if - // wxDL_VERBATIM were specified and doesn't log error message if the - // library couldn't be loaded but simply returns NULL - static wxDllType RawLoad(const wxString& libname, int flags = wxDL_DEFAULT); - - // detach the library object from its handle, i.e. prevent the object from - // unloading the library in its dtor -- the caller is now responsible for - // doing this - wxDllType Detach() { wxDllType h = m_handle; m_handle = 0; return h; } - - // unload the given library handle (presumably returned by Detach() before) - static void Unload(wxDllType handle); - - // unload the library, also done automatically in dtor - void Unload() { if ( IsLoaded() ) { Unload(m_handle); m_handle = 0; } } - - // Return the raw handle from dlopen and friends. - wxDllType GetLibHandle() const { return m_handle; } - - // check if the given symbol is present in the library, useful to verify if - // a loadable module is our plugin, for example, without provoking error - // messages from GetSymbol() - bool HasSymbol(const wxString& name) const - { - bool ok; - DoGetSymbol(name, &ok); - return ok; - } - - // resolve a symbol in a loaded DLL, such as a variable or function name. - // 'name' is the (possibly mangled) name of the symbol. (use extern "C" to - // export unmangled names) - // - // Since it is perfectly valid for the returned symbol to actually be NULL, - // that is not always indication of an error. Pass and test the parameter - // 'success' for a true indication of success or failure to load the - // symbol. - // - // Returns a pointer to the symbol on success, or NULL if an error occurred - // or the symbol wasn't found. - void *GetSymbol(const wxString& name, bool *success = NULL) const; - - // low-level version of GetSymbol() - static void *RawGetSymbol(wxDllType handle, const wxString& name); - void *RawGetSymbol(const wxString& name) const - { -#if defined (__WXPM__) || defined(__EMX__) - return GetSymbol(name); -#else - return RawGetSymbol(m_handle, name); -#endif - } - -#ifdef __WXMSW__ - // this function is useful for loading functions from the standard Windows - // DLLs: such functions have an 'A' (in ANSI build) or 'W' (in Unicode, or - // wide character build) suffix if they take string parameters - static void *RawGetSymbolAorW(wxDllType handle, const wxString& name) - { - return RawGetSymbol - ( - handle, - name + -#if wxUSE_UNICODE - L'W' -#else - 'A' -#endif - ); - } - - void *GetSymbolAorW(const wxString& name) const - { - return RawGetSymbolAorW(m_handle, name); - } -#endif // __WXMSW__ - - // return all modules/shared libraries in the address space of this process - // - // returns an empty array if not implemented or an error occurred - static wxDynamicLibraryDetailsArray ListLoaded(); - - // return platform-specific name of dynamic library with proper extension - // and prefix (e.g. "foo.dll" on Windows or "libfoo.so" on Linux) - static wxString CanonicalizeName(const wxString& name, - wxDynamicLibraryCategory cat = wxDL_LIBRARY); - - // return name of wxWidgets plugin (adds compiler and version info - // to the filename): - static wxString - CanonicalizePluginName(const wxString& name, - wxPluginCategory cat = wxDL_PLUGIN_GUI); - - // return plugin directory on platforms where it makes sense and empty - // string on others: - static wxString GetPluginsDirectory(); - - -protected: - // common part of GetSymbol() and HasSymbol() - void *DoGetSymbol(const wxString& name, bool *success = 0) const; - -#ifdef wxHAVE_DYNLIB_ERROR - // log the error after a dlxxx() function failure - static void Error(); -#endif // wxHAVE_DYNLIB_ERROR - - - // platform specific shared lib suffix. - static const wxChar *ms_dllext; - - // the handle to DLL or NULL - wxDllType m_handle; - - // no copy ctor/assignment operators (or we'd try to unload the library - // twice) - DECLARE_NO_COPY_CLASS(wxDynamicLibrary) -}; - -#if defined(__WXMSW__) && wxABI_VERSION >= 20810 - -// ---------------------------------------------------------------------------- -// wxLoadedDLL is a MSW-only internal helper class allowing to dynamically bind -// to a DLL already loaded into the project address space -// ---------------------------------------------------------------------------- - -class wxLoadedDLL : public wxDynamicLibrary -{ -public: - wxLoadedDLL(const wxString& dllname) - : wxDynamicLibrary(dllname, wxDL_GET_LOADED | wxDL_VERBATIM | wxDL_QUIET) - { - } - - ~wxLoadedDLL() - { - Detach(); - } -}; - -#endif // __WXMSW__ - -// ---------------------------------------------------------------------------- -// Interesting defines -// ---------------------------------------------------------------------------- - -#define WXDLL_ENTRY_FUNCTION() \ -extern "C" WXEXPORT const wxClassInfo *wxGetClassFirst(); \ -const wxClassInfo *wxGetClassFirst() { \ - return wxClassInfo::GetFirst(); \ -} - -#endif // wxUSE_DYNLIB_CLASS - -#endif // _WX_DYNLIB_H__ diff --git a/wxWidgets/include/wx/dynload.h b/wxWidgets/include/wx/dynload.h deleted file mode 100644 index a12ee4f51f..0000000000 --- a/wxWidgets/include/wx/dynload.h +++ /dev/null @@ -1,153 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: dynload.h -// Purpose: Dynamic loading framework -// Author: Ron Lee, David Falkinder, Vadim Zeitlin and a cast of 1000's -// (derived in part from dynlib.cpp (c) 1998 Guilhem Lavaux) -// Modified by: -// Created: 03/12/01 -// RCS-ID: $Id: dynload.h 61872 2009-09-09 22:37:05Z VZ $ -// Copyright: (c) 2001 Ron Lee -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_DYNAMICLOADER_H__ -#define _WX_DYNAMICLOADER_H__ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -#include "wx/defs.h" - -#if wxUSE_DYNAMIC_LOADER - -#include "wx/dynlib.h" -#include "wx/hashmap.h" -#include "wx/module.h" - -class WXDLLIMPEXP_FWD_BASE wxPluginLibrary; - - -WX_DECLARE_STRING_HASH_MAP_WITH_DECL(wxPluginLibrary *, wxDLManifest, - class WXDLLIMPEXP_BASE); -typedef wxDLManifest wxDLImports; - -// --------------------------------------------------------------------------- -// wxPluginLibrary -// --------------------------------------------------------------------------- - -// NOTE: Do not attempt to use a base class pointer to this class. -// wxDL is not virtual and we deliberately hide some of it's -// methods here. -// -// Unless you know exacty why you need to, you probably shouldn't -// instantiate this class directly anyway, use wxPluginManager -// instead. - -class WXDLLIMPEXP_BASE wxPluginLibrary : public wxDynamicLibrary -{ -public: - - static wxDLImports* ms_classes; // Static hash of all imported classes. - - wxPluginLibrary( const wxString &libname, int flags = wxDL_DEFAULT ); - ~wxPluginLibrary(); - - wxPluginLibrary *RefLib(); - bool UnrefLib(); - - // These two are called by the PluginSentinel on (PLUGGABLE) object - // creation/destruction. There is usually no reason for the user to - // call them directly. We have to separate this from the link count, - // since the two are not interchangeable. - - // FIXME: for even better debugging PluginSentinel should register - // the name of the class created too, then we can state - // exactly which object was not destroyed which may be - // difficult to find otherwise. Also this code should - // probably only be active in DEBUG mode, but let's just - // get it right first. - - void RefObj() { ++m_objcount; } - void UnrefObj() - { - wxASSERT_MSG( m_objcount > 0, wxT("Too many objects deleted??") ); - --m_objcount; - } - - // Override/hide some base class methods - - bool IsLoaded() const { return m_linkcount > 0; } - void Unload() { UnrefLib(); } - -private: - - wxClassInfo *m_before; // sm_first before loading this lib - wxClassInfo *m_after; // ..and after. - - size_t m_linkcount; // Ref count of library link calls - size_t m_objcount; // ..and (pluggable) object instantiations. - wxModuleList m_wxmodules; // any wxModules that we initialised. - - void UpdateClasses(); // Update ms_classes - void RestoreClasses(); // Removes this library from ms_classes - void RegisterModules(); // Init any wxModules in the lib. - void UnregisterModules(); // Cleanup any wxModules we installed. - - DECLARE_NO_COPY_CLASS(wxPluginLibrary) -}; - - -class WXDLLIMPEXP_BASE wxPluginManager -{ -public: - - // Static accessors. - - static wxPluginLibrary *LoadLibrary( const wxString &libname, - int flags = wxDL_DEFAULT ); - static bool UnloadLibrary(const wxString &libname); - - // Instance methods. - - wxPluginManager() : m_entry(NULL) {} - wxPluginManager(const wxString &libname, int flags = wxDL_DEFAULT) - { - Load(libname, flags); - } - ~wxPluginManager() { if ( IsLoaded() ) Unload(); } - - bool Load(const wxString &libname, int flags = wxDL_DEFAULT); - void Unload(); - - bool IsLoaded() const { return m_entry && m_entry->IsLoaded(); } - void *GetSymbol(const wxString &symbol, bool *success = 0) - { - return m_entry->GetSymbol( symbol, success ); - } - - static void CreateManifest() { ms_manifest = new wxDLManifest(wxKEY_STRING); } - static void ClearManifest() { delete ms_manifest; ms_manifest = NULL; } - -private: - // return the pointer to the entry for the library with given name in - // ms_manifest or NULL if none - static wxPluginLibrary *FindByName(const wxString& name) - { - const wxDLManifest::iterator i = ms_manifest->find(name); - - return i == ms_manifest->end() ? NULL : i->second; - } - - static wxDLManifest* ms_manifest; // Static hash of loaded libs. - wxPluginLibrary* m_entry; // Cache our entry in the manifest. - - // We could allow this class to be copied if we really - // wanted to, but not without modification. - DECLARE_NO_COPY_CLASS(wxPluginManager) -}; - - -#endif // wxUSE_DYNAMIC_LOADER -#endif // _WX_DYNAMICLOADER_H__ - diff --git a/wxWidgets/include/wx/effects.h b/wxWidgets/include/wx/effects.h deleted file mode 100644 index b04a3ba635..0000000000 --- a/wxWidgets/include/wx/effects.h +++ /dev/null @@ -1,75 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/effects.h -// Purpose: wxEffects class -// Draws 3D effects. -// Author: Julian Smart et al -// Modified by: -// Created: 25/4/2000 -// RCS-ID: $Id: effects.h 39109 2006-05-08 11:31:03Z ABX $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_EFFECTS_H_ -#define _WX_EFFECTS_H_ - -/* - * wxEffects: various 3D effects - */ - -#include "wx/object.h" -#include "wx/colour.h" -#include "wx/gdicmn.h" -#include "wx/dc.h" - -class WXDLLEXPORT wxEffects: public wxObject -{ -DECLARE_CLASS(wxEffects) - -public: - // Assume system colours - wxEffects() ; - // Going from lightest to darkest - wxEffects(const wxColour& highlightColour, const wxColour& lightShadow, - const wxColour& faceColour, const wxColour& mediumShadow, - const wxColour& darkShadow) ; - - // Accessors - wxColour GetHighlightColour() const { return m_highlightColour; } - wxColour GetLightShadow() const { return m_lightShadow; } - wxColour GetFaceColour() const { return m_faceColour; } - wxColour GetMediumShadow() const { return m_mediumShadow; } - wxColour GetDarkShadow() const { return m_darkShadow; } - - void SetHighlightColour(const wxColour& c) { m_highlightColour = c; } - void SetLightShadow(const wxColour& c) { m_lightShadow = c; } - void SetFaceColour(const wxColour& c) { m_faceColour = c; } - void SetMediumShadow(const wxColour& c) { m_mediumShadow = c; } - void SetDarkShadow(const wxColour& c) { m_darkShadow = c; } - - void Set(const wxColour& highlightColour, const wxColour& lightShadow, - const wxColour& faceColour, const wxColour& mediumShadow, - const wxColour& darkShadow) - { - SetHighlightColour(highlightColour); - SetLightShadow(lightShadow); - SetFaceColour(faceColour); - SetMediumShadow(mediumShadow); - SetDarkShadow(darkShadow); - } - - // Draw a sunken edge - void DrawSunkenEdge(wxDC& dc, const wxRect& rect, int borderSize = 1); - - // Tile a bitmap - bool TileBitmap(const wxRect& rect, wxDC& dc, const wxBitmap& bitmap); - -protected: - wxColour m_highlightColour; // Usually white - wxColour m_lightShadow; // Usually light grey - wxColour m_faceColour; // Usually grey - wxColour m_mediumShadow; // Usually dark grey - wxColour m_darkShadow; // Usually black -}; - -#endif diff --git a/wxWidgets/include/wx/encconv.h b/wxWidgets/include/wx/encconv.h deleted file mode 100644 index 6a54439eeb..0000000000 --- a/wxWidgets/include/wx/encconv.h +++ /dev/null @@ -1,159 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/encconv.h -// Purpose: wxEncodingConverter class for converting between different -// font encodings -// Author: Vaclav Slavik -// Copyright: (c) 1999 Vaclav Slavik -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_ENCCONV_H_ -#define _WX_ENCCONV_H_ - -#include "wx/defs.h" - -#include "wx/object.h" -#include "wx/fontenc.h" -#include "wx/dynarray.h" - -// ---------------------------------------------------------------------------- -// constants -// ---------------------------------------------------------------------------- - -enum -{ - wxCONVERT_STRICT, - wxCONVERT_SUBSTITUTE -}; - - -enum -{ - wxPLATFORM_CURRENT = -1, - - wxPLATFORM_UNIX = 0, - wxPLATFORM_WINDOWS, - wxPLATFORM_OS2, - wxPLATFORM_MAC -}; - -// ---------------------------------------------------------------------------- -// types -// ---------------------------------------------------------------------------- - -WX_DEFINE_ARRAY_INT(wxFontEncoding, wxFontEncodingArray); - -//-------------------------------------------------------------------------------- -// wxEncodingConverter -// This class is capable of converting strings between any two -// 8bit encodings/charsets. It can also convert from/to Unicode -//-------------------------------------------------------------------------------- - -class WXDLLIMPEXP_BASE wxEncodingConverter : public wxObject -{ - public: - - wxEncodingConverter(); - virtual ~wxEncodingConverter() { if (m_Table) delete[] m_Table; } - - // Initialize conversion. Both output or input encoding may - // be wxFONTENCODING_UNICODE, but only if wxUSE_WCHAR_T is set to 1. - // - // All subsequent calls to Convert() will interpret it's argument - // as a string in input_enc encoding and will output string in - // output_enc encoding. - // - // You must call this method before calling Convert. You may call - // it more than once in order to switch to another conversion - // - // Method affects behaviour of Convert() in case input character - // cannot be converted because it does not exist in output encoding: - // wxCONVERT_STRICT -- - // follow behaviour of GNU Recode - just copy unconvertable - // characters to output and don't change them (it's integer - // value will stay the same) - // wxCONVERT_SUBSTITUTE -- - // try some (lossy) substitutions - e.g. replace - // unconvertable latin capitals with acute by ordinary - // capitals, replace en-dash or em-dash by '-' etc. - // both modes gurantee that output string will have same length - // as input string - // - // Returns false if given conversion is impossible, true otherwise - // (conversion may be impossible either if you try to convert - // to Unicode with non-Unicode build of wxWidgets or if input - // or output encoding is not supported.) - bool Init(wxFontEncoding input_enc, wxFontEncoding output_enc, int method = wxCONVERT_STRICT); - - // Convert input string according to settings passed to Init. - // Note that you must call Init before using Convert! - bool Convert(const char* input, char* output) const; - bool Convert(char* str) const { return Convert(str, str); } - wxString Convert(const wxString& input) const; - -#if wxUSE_WCHAR_T - bool Convert(const char* input, wchar_t* output) const; - bool Convert(const wchar_t* input, char* output) const; - bool Convert(const wchar_t* input, wchar_t* output) const; - bool Convert(wchar_t* str) const { return Convert(str, str); } -#endif - // Return equivalent(s) for given font that are used - // under given platform. wxPLATFORM_CURRENT means the plaform - // this binary was compiled for - // - // Examples: - // current platform enc returned value - // ----------------------------------------------------- - // unix CP1250 {ISO8859_2} - // unix ISO8859_2 {} - // windows ISO8859_2 {CP1250} - // - // Equivalence is defined in terms of convertibility: - // 2 encodings are equivalent if you can convert text between - // then without loosing information (it may - and will - happen - // that you loose special chars like quotation marks or em-dashes - // but you shouldn't loose any diacritics and language-specific - // characters when converting between equivalent encodings). - // - // Convert() method is not limited to converting between - // equivalent encodings, it can convert between arbitrary - // two encodings! - // - // Remember that this function does _NOT_ check for presence of - // fonts in system. It only tells you what are most suitable - // encodings. (It usually returns only one encoding) - // - // Note that argument enc itself may be present in returned array! - // (so that you can -- as a side effect -- detect whether the - // encoding is native for this platform or not) - static wxFontEncodingArray GetPlatformEquivalents(wxFontEncoding enc, int platform = wxPLATFORM_CURRENT); - - // Similar to GetPlatformEquivalent, but this one will return ALL - // equivalent encodings, regardless the platform, including itself. - static wxFontEncodingArray GetAllEquivalents(wxFontEncoding enc); - - // Return true if [any text in] one multibyte encoding can be - // converted to another one losslessly. - // - // Do not call this with wxFONTENCODING_UNICODE, it doesn't make - // sense (always works in one sense and always depends on the text - // to convert in the other) - static bool CanConvert(wxFontEncoding encIn, wxFontEncoding encOut) - { - return GetAllEquivalents(encIn).Index(encOut) != wxNOT_FOUND; - } - - private: - -#if wxUSE_WCHAR_T - wchar_t *m_Table; -#else - char *m_Table; -#endif - bool m_UnicodeInput, m_UnicodeOutput; - bool m_JustCopy; - - DECLARE_NO_COPY_CLASS(wxEncodingConverter) -}; - -#endif // _WX_ENCCONV_H_ diff --git a/wxWidgets/include/wx/encinfo.h b/wxWidgets/include/wx/encinfo.h deleted file mode 100644 index 99dbddb81d..0000000000 --- a/wxWidgets/include/wx/encinfo.h +++ /dev/null @@ -1,74 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: wx/encinfo.h -// Purpose: declares wxNativeEncodingInfo struct -// Author: Vadim Zeitlin -// Modified by: -// Created: 19.09.2003 (extracted from wx/fontenc.h) -// RCS-ID: $Id: encinfo.h 40865 2006-08-27 09:42:42Z VS $ -// Copyright: (c) 2003 Vadim Zeitlin -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_ENCINFO_H_ -#define _WX_ENCINFO_H_ - -#include "wx/string.h" - -// ---------------------------------------------------------------------------- -// wxNativeEncodingInfo contains all encoding parameters for this platform -// ---------------------------------------------------------------------------- - -// This private structure specifies all the parameters needed to create a font -// with the given encoding on this platform. -// -// Under X, it contains the last 2 elements of the font specifications -// (registry and encoding). -// -// Under Windows, it contains a number which is one of predefined CHARSET_XXX -// values. -// -// Under all platforms it also contains a facename string which should be -// used, if not empty, to create fonts in this encoding (this is the only way -// to create a font of non-standard encoding (like KOI8) under Windows - the -// facename specifies the encoding then) - -struct WXDLLEXPORT wxNativeEncodingInfo -{ - wxString facename; // may be empty meaning "any" -#ifndef __WXPALMOS__ - wxFontEncoding encoding; // so that we know what this struct represents - -#if defined(__WXMSW__) || \ - defined(__WXPM__) || \ - defined(__WXMAC__) || \ - defined(__WXCOCOA__) // FIXME: __WXCOCOA__ - - wxNativeEncodingInfo() - : facename() - , encoding(wxFONTENCODING_SYSTEM) - , charset(0) /* ANSI_CHARSET */ - { } - - int charset; -#elif defined(_WX_X_FONTLIKE) - wxString xregistry, - xencoding; -#elif defined(__WXGTK20__) - // No way to specify this in Pango as this - // seems to be handled internally. -#elif defined(__WXMGL__) - int mglEncoding; -#elif defined(__WXDFB__) - // DirectFB uses UTF-8 internally, doesn't use font encodings -#else - #error "Unsupported toolkit" -#endif -#endif // !__WXPALMOS__ - // this struct is saved in config by wxFontMapper, so it should know to - // serialise itself (implemented in platform-specific code) - bool FromString(const wxString& s); - wxString ToString() const; -}; - -#endif // _WX_ENCINFO_H_ - diff --git a/wxWidgets/include/wx/event.h b/wxWidgets/include/wx/event.h deleted file mode 100644 index 73314eef8b..0000000000 --- a/wxWidgets/include/wx/event.h +++ /dev/null @@ -1,3121 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/event.h -// Purpose: Event classes -// Author: Julian Smart -// Modified by: -// Created: 01/02/97 -// RCS-ID: $Id: event.h 61872 2009-09-09 22:37:05Z VZ $ -// Copyright: (c) wxWidgets team -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_EVENT_H__ -#define _WX_EVENT_H__ - -#include "wx/defs.h" -#include "wx/cpp.h" -#include "wx/object.h" -#include "wx/clntdata.h" - -#if wxUSE_GUI - #include "wx/gdicmn.h" - #include "wx/cursor.h" -#endif - -#include "wx/thread.h" - -#include "wx/dynarray.h" - -// ---------------------------------------------------------------------------- -// forward declarations -// ---------------------------------------------------------------------------- - -class WXDLLIMPEXP_FWD_BASE wxList; - -#if wxUSE_GUI - class WXDLLIMPEXP_FWD_CORE wxDC; - class WXDLLIMPEXP_FWD_CORE wxMenu; - class WXDLLIMPEXP_FWD_CORE wxWindow; - class WXDLLIMPEXP_FWD_CORE wxWindowBase; -#endif // wxUSE_GUI - -class WXDLLIMPEXP_FWD_BASE wxEvtHandler; - -// ---------------------------------------------------------------------------- -// Event types -// ---------------------------------------------------------------------------- - -typedef int wxEventType; - -// this is used to make the event table entry type safe, so that for an event -// handler only a function with proper parameter list can be given. -#define wxStaticCastEvent(type, val) wx_static_cast(type, val) - -// in previous versions of wxWidgets the event types used to be constants -// which created difficulties with custom/user event types definition -// -// starting from wxWidgets 2.4 the event types are now dynamically assigned -// using wxNewEventType() which solves this problem, however at price of -// several incompatibilities: -// -// a) event table macros declaration changed, it now uses wxEventTableEntry -// ctor instead of initialisation from an agregate - the macro -// DECLARE_EVENT_TABLE_ENTRY may be used to write code which can compile -// with all versions of wxWidgets -// -// b) event types can't be used as switch() cases as they're not really -// constant any more - there is no magic solution here, you just have to -// change the switch()es to if()s -// -// if these are real problems for you, define WXWIN_COMPATIBILITY_EVENT_TYPES -// as 1 to get 100% old behaviour, however you won't be able to use the -// libraries using the new dynamic event type allocation in such case, so avoid -// it if possible. -#ifndef WXWIN_COMPATIBILITY_EVENT_TYPES - #define WXWIN_COMPATIBILITY_EVENT_TYPES 0 -#endif - -#if WXWIN_COMPATIBILITY_EVENT_TYPES - -#define DECLARE_EVENT_TABLE_ENTRY(type, winid, idLast, fn, obj) \ - { type, winid, idLast, fn, obj } - -#define BEGIN_DECLARE_EVENT_TYPES() enum { -#define END_DECLARE_EVENT_TYPES() }; -#define DECLARE_EVENT_TYPE(name, value) name = wxEVT_FIRST + value, -#define DECLARE_LOCAL_EVENT_TYPE(name, value) name = wxEVT_USER_FIRST + value, -#define DECLARE_EXPORTED_EVENT_TYPE(expdecl, name, value) \ - DECLARE_LOCAL_EVENT_TYPE(name, value) -#define DEFINE_EVENT_TYPE(name) -#define DEFINE_LOCAL_EVENT_TYPE(name) - - -#else // !WXWIN_COMPATIBILITY_EVENT_TYPES - -#define DECLARE_EVENT_TABLE_ENTRY(type, winid, idLast, fn, obj) \ - wxEventTableEntry(type, winid, idLast, fn, obj) - -#define BEGIN_DECLARE_EVENT_TYPES() -#define END_DECLARE_EVENT_TYPES() -#define DECLARE_EXPORTED_EVENT_TYPE(expdecl, name, value) \ - extern expdecl const wxEventType name; -#define DECLARE_EVENT_TYPE(name, value) \ - DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_CORE, name, value) -#define DECLARE_LOCAL_EVENT_TYPE(name, value) \ - DECLARE_EXPORTED_EVENT_TYPE(wxEMPTY_PARAMETER_VALUE, name, value) -#define DEFINE_EVENT_TYPE(name) const wxEventType name = wxNewEventType(); -#define DEFINE_LOCAL_EVENT_TYPE(name) DEFINE_EVENT_TYPE(name) - -// generate a new unique event type -extern WXDLLIMPEXP_BASE wxEventType wxNewEventType(); - -#endif // WXWIN_COMPATIBILITY_EVENT_TYPES/!WXWIN_COMPATIBILITY_EVENT_TYPES - -BEGIN_DECLARE_EVENT_TYPES() - -#if WXWIN_COMPATIBILITY_EVENT_TYPES - wxEVT_NULL = 0, - wxEVT_FIRST = 10000, - wxEVT_USER_FIRST = wxEVT_FIRST + 2000, -#else // !WXWIN_COMPATIBILITY_EVENT_TYPES - // it is important to still have these as constants to avoid - // initialization order related problems - DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_BASE, wxEVT_NULL, 0) - DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_BASE, wxEVT_FIRST, 10000) - DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_BASE, wxEVT_USER_FIRST, wxEVT_FIRST + 2000) -#endif // WXWIN_COMPATIBILITY_EVENT_TYPES/!WXWIN_COMPATIBILITY_EVENT_TYPES - - DECLARE_EVENT_TYPE(wxEVT_COMMAND_BUTTON_CLICKED, 1) - DECLARE_EVENT_TYPE(wxEVT_COMMAND_CHECKBOX_CLICKED, 2) - DECLARE_EVENT_TYPE(wxEVT_COMMAND_CHOICE_SELECTED, 3) - DECLARE_EVENT_TYPE(wxEVT_COMMAND_LISTBOX_SELECTED, 4) - DECLARE_EVENT_TYPE(wxEVT_COMMAND_LISTBOX_DOUBLECLICKED, 5) - DECLARE_EVENT_TYPE(wxEVT_COMMAND_CHECKLISTBOX_TOGGLED, 6) - // now they are in wx/textctrl.h -#if WXWIN_COMPATIBILITY_EVENT_TYPES - DECLARE_EVENT_TYPE(wxEVT_COMMAND_TEXT_UPDATED, 7) - DECLARE_EVENT_TYPE(wxEVT_COMMAND_TEXT_ENTER, 8) - DECLARE_EVENT_TYPE(wxEVT_COMMAND_TEXT_URL, 13) - DECLARE_EVENT_TYPE(wxEVT_COMMAND_TEXT_MAXLEN, 14) -#endif // WXWIN_COMPATIBILITY_EVENT_TYPES - DECLARE_EVENT_TYPE(wxEVT_COMMAND_MENU_SELECTED, 9) - DECLARE_EVENT_TYPE(wxEVT_COMMAND_SLIDER_UPDATED, 10) - DECLARE_EVENT_TYPE(wxEVT_COMMAND_RADIOBOX_SELECTED, 11) - DECLARE_EVENT_TYPE(wxEVT_COMMAND_RADIOBUTTON_SELECTED, 12) - - // wxEVT_COMMAND_SCROLLBAR_UPDATED is now obsolete since we use - // wxEVT_SCROLL... events - - DECLARE_EVENT_TYPE(wxEVT_COMMAND_SCROLLBAR_UPDATED, 13) - DECLARE_EVENT_TYPE(wxEVT_COMMAND_VLBOX_SELECTED, 14) - DECLARE_EVENT_TYPE(wxEVT_COMMAND_COMBOBOX_SELECTED, 15) - DECLARE_EVENT_TYPE(wxEVT_COMMAND_TOOL_RCLICKED, 16) - DECLARE_EVENT_TYPE(wxEVT_COMMAND_TOOL_ENTER, 17) - DECLARE_EVENT_TYPE(wxEVT_COMMAND_SPINCTRL_UPDATED, 18) - - // Sockets and timers send events, too - DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_BASE, wxEVT_SOCKET, 50) - DECLARE_EVENT_TYPE(wxEVT_TIMER , 80) - - // Mouse event types - DECLARE_EVENT_TYPE(wxEVT_LEFT_DOWN, 100) - DECLARE_EVENT_TYPE(wxEVT_LEFT_UP, 101) - DECLARE_EVENT_TYPE(wxEVT_MIDDLE_DOWN, 102) - DECLARE_EVENT_TYPE(wxEVT_MIDDLE_UP, 103) - DECLARE_EVENT_TYPE(wxEVT_RIGHT_DOWN, 104) - DECLARE_EVENT_TYPE(wxEVT_RIGHT_UP, 105) - DECLARE_EVENT_TYPE(wxEVT_MOTION, 106) - DECLARE_EVENT_TYPE(wxEVT_ENTER_WINDOW, 107) - DECLARE_EVENT_TYPE(wxEVT_LEAVE_WINDOW, 108) - DECLARE_EVENT_TYPE(wxEVT_LEFT_DCLICK, 109) - DECLARE_EVENT_TYPE(wxEVT_MIDDLE_DCLICK, 110) - DECLARE_EVENT_TYPE(wxEVT_RIGHT_DCLICK, 111) - DECLARE_EVENT_TYPE(wxEVT_SET_FOCUS, 112) - DECLARE_EVENT_TYPE(wxEVT_KILL_FOCUS, 113) - DECLARE_EVENT_TYPE(wxEVT_CHILD_FOCUS, 114) - DECLARE_EVENT_TYPE(wxEVT_MOUSEWHEEL, 115) - - // Non-client mouse events - DECLARE_EVENT_TYPE(wxEVT_NC_LEFT_DOWN, 200) - DECLARE_EVENT_TYPE(wxEVT_NC_LEFT_UP, 201) - DECLARE_EVENT_TYPE(wxEVT_NC_MIDDLE_DOWN, 202) - DECLARE_EVENT_TYPE(wxEVT_NC_MIDDLE_UP, 203) - DECLARE_EVENT_TYPE(wxEVT_NC_RIGHT_DOWN, 204) - DECLARE_EVENT_TYPE(wxEVT_NC_RIGHT_UP, 205) - DECLARE_EVENT_TYPE(wxEVT_NC_MOTION, 206) - DECLARE_EVENT_TYPE(wxEVT_NC_ENTER_WINDOW, 207) - DECLARE_EVENT_TYPE(wxEVT_NC_LEAVE_WINDOW, 208) - DECLARE_EVENT_TYPE(wxEVT_NC_LEFT_DCLICK, 209) - DECLARE_EVENT_TYPE(wxEVT_NC_MIDDLE_DCLICK, 210) - DECLARE_EVENT_TYPE(wxEVT_NC_RIGHT_DCLICK, 211) - - // Character input event type - DECLARE_EVENT_TYPE(wxEVT_CHAR, 212) - DECLARE_EVENT_TYPE(wxEVT_CHAR_HOOK, 213) - DECLARE_EVENT_TYPE(wxEVT_NAVIGATION_KEY, 214) - DECLARE_EVENT_TYPE(wxEVT_KEY_DOWN, 215) - DECLARE_EVENT_TYPE(wxEVT_KEY_UP, 216) -#if wxUSE_HOTKEY - DECLARE_EVENT_TYPE(wxEVT_HOTKEY, 217) -#endif - // Set cursor event - DECLARE_EVENT_TYPE(wxEVT_SET_CURSOR, 230) - - // wxScrollBar and wxSlider event identifiers - DECLARE_EVENT_TYPE(wxEVT_SCROLL_TOP, 300) - DECLARE_EVENT_TYPE(wxEVT_SCROLL_BOTTOM, 301) - DECLARE_EVENT_TYPE(wxEVT_SCROLL_LINEUP, 302) - DECLARE_EVENT_TYPE(wxEVT_SCROLL_LINEDOWN, 303) - DECLARE_EVENT_TYPE(wxEVT_SCROLL_PAGEUP, 304) - DECLARE_EVENT_TYPE(wxEVT_SCROLL_PAGEDOWN, 305) - DECLARE_EVENT_TYPE(wxEVT_SCROLL_THUMBTRACK, 306) - DECLARE_EVENT_TYPE(wxEVT_SCROLL_THUMBRELEASE, 307) - DECLARE_EVENT_TYPE(wxEVT_SCROLL_CHANGED, 308) - - // Scroll events from wxWindow - DECLARE_EVENT_TYPE(wxEVT_SCROLLWIN_TOP, 320) - DECLARE_EVENT_TYPE(wxEVT_SCROLLWIN_BOTTOM, 321) - DECLARE_EVENT_TYPE(wxEVT_SCROLLWIN_LINEUP, 322) - DECLARE_EVENT_TYPE(wxEVT_SCROLLWIN_LINEDOWN, 323) - DECLARE_EVENT_TYPE(wxEVT_SCROLLWIN_PAGEUP, 324) - DECLARE_EVENT_TYPE(wxEVT_SCROLLWIN_PAGEDOWN, 325) - DECLARE_EVENT_TYPE(wxEVT_SCROLLWIN_THUMBTRACK, 326) - DECLARE_EVENT_TYPE(wxEVT_SCROLLWIN_THUMBRELEASE, 327) - - // System events - DECLARE_EVENT_TYPE(wxEVT_SIZE, 400) - DECLARE_EVENT_TYPE(wxEVT_MOVE, 401) - DECLARE_EVENT_TYPE(wxEVT_CLOSE_WINDOW, 402) - DECLARE_EVENT_TYPE(wxEVT_END_SESSION, 403) - DECLARE_EVENT_TYPE(wxEVT_QUERY_END_SESSION, 404) - DECLARE_EVENT_TYPE(wxEVT_ACTIVATE_APP, 405) - // 406..408 are power events - DECLARE_EVENT_TYPE(wxEVT_ACTIVATE, 409) - DECLARE_EVENT_TYPE(wxEVT_CREATE, 410) - DECLARE_EVENT_TYPE(wxEVT_DESTROY, 411) - DECLARE_EVENT_TYPE(wxEVT_SHOW, 412) - DECLARE_EVENT_TYPE(wxEVT_ICONIZE, 413) - DECLARE_EVENT_TYPE(wxEVT_MAXIMIZE, 414) - DECLARE_EVENT_TYPE(wxEVT_MOUSE_CAPTURE_CHANGED, 415) - DECLARE_EVENT_TYPE(wxEVT_MOUSE_CAPTURE_LOST, 416) - DECLARE_EVENT_TYPE(wxEVT_PAINT, 417) - DECLARE_EVENT_TYPE(wxEVT_ERASE_BACKGROUND, 418) - DECLARE_EVENT_TYPE(wxEVT_NC_PAINT, 419) - DECLARE_EVENT_TYPE(wxEVT_PAINT_ICON, 420) - DECLARE_EVENT_TYPE(wxEVT_MENU_OPEN, 421) - DECLARE_EVENT_TYPE(wxEVT_MENU_CLOSE, 422) - DECLARE_EVENT_TYPE(wxEVT_MENU_HIGHLIGHT, 423) - DECLARE_EVENT_TYPE(wxEVT_CONTEXT_MENU, 424) - DECLARE_EVENT_TYPE(wxEVT_SYS_COLOUR_CHANGED, 425) - DECLARE_EVENT_TYPE(wxEVT_DISPLAY_CHANGED, 426) - DECLARE_EVENT_TYPE(wxEVT_SETTING_CHANGED, 427) - DECLARE_EVENT_TYPE(wxEVT_QUERY_NEW_PALETTE, 428) - DECLARE_EVENT_TYPE(wxEVT_PALETTE_CHANGED, 429) - DECLARE_EVENT_TYPE(wxEVT_JOY_BUTTON_DOWN, 430) - DECLARE_EVENT_TYPE(wxEVT_JOY_BUTTON_UP, 431) - DECLARE_EVENT_TYPE(wxEVT_JOY_MOVE, 432) - DECLARE_EVENT_TYPE(wxEVT_JOY_ZMOVE, 433) - DECLARE_EVENT_TYPE(wxEVT_DROP_FILES, 434) - DECLARE_EVENT_TYPE(wxEVT_DRAW_ITEM, 435) - DECLARE_EVENT_TYPE(wxEVT_MEASURE_ITEM, 436) - DECLARE_EVENT_TYPE(wxEVT_COMPARE_ITEM, 437) - DECLARE_EVENT_TYPE(wxEVT_INIT_DIALOG, 438) - DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_BASE, wxEVT_IDLE, 439) - DECLARE_EVENT_TYPE(wxEVT_UPDATE_UI, 440) - DECLARE_EVENT_TYPE(wxEVT_SIZING, 441) - DECLARE_EVENT_TYPE(wxEVT_MOVING, 442) - DECLARE_EVENT_TYPE(wxEVT_HIBERNATE, 443) - // more power events follow -- see wx/power.h - - // Clipboard events - DECLARE_EVENT_TYPE(wxEVT_COMMAND_TEXT_COPY, 444) - DECLARE_EVENT_TYPE(wxEVT_COMMAND_TEXT_CUT, 445) - DECLARE_EVENT_TYPE(wxEVT_COMMAND_TEXT_PASTE, 446) - - // Generic command events - // Note: a click is a higher-level event than button down/up - DECLARE_EVENT_TYPE(wxEVT_COMMAND_LEFT_CLICK, 500) - DECLARE_EVENT_TYPE(wxEVT_COMMAND_LEFT_DCLICK, 501) - DECLARE_EVENT_TYPE(wxEVT_COMMAND_RIGHT_CLICK, 502) - DECLARE_EVENT_TYPE(wxEVT_COMMAND_RIGHT_DCLICK, 503) - DECLARE_EVENT_TYPE(wxEVT_COMMAND_SET_FOCUS, 504) - DECLARE_EVENT_TYPE(wxEVT_COMMAND_KILL_FOCUS, 505) - DECLARE_EVENT_TYPE(wxEVT_COMMAND_ENTER, 506) - - // Help events - DECLARE_EVENT_TYPE(wxEVT_HELP, 1050) - DECLARE_EVENT_TYPE(wxEVT_DETAILED_HELP, 1051) - -END_DECLARE_EVENT_TYPES() - -// these 2 events are the same -#define wxEVT_COMMAND_TOOL_CLICKED wxEVT_COMMAND_MENU_SELECTED - -// ---------------------------------------------------------------------------- -// Compatibility -// ---------------------------------------------------------------------------- - -// this event is also used by wxComboBox and wxSpinCtrl which don't include -// wx/textctrl.h in all ports [yet], so declare it here as well -// -// still, any new code using it should include wx/textctrl.h explicitly -#if !WXWIN_COMPATIBILITY_EVENT_TYPES - extern const wxEventType WXDLLIMPEXP_CORE wxEVT_COMMAND_TEXT_UPDATED; -#endif - -// the predefined constants for the number of times we propagate event -// upwards window child-parent chain -enum Propagation_state -{ - // don't propagate it at all - wxEVENT_PROPAGATE_NONE = 0, - - // propagate it until it is processed - wxEVENT_PROPAGATE_MAX = INT_MAX -}; - -/* - * wxWidgets events, covering all interesting things that might happen - * (button clicking, resizing, setting text in widgets, etc.). - * - * For each completely new event type, derive a new event class. - * An event CLASS represents a C++ class defining a range of similar event TYPES; - * examples are canvas events, panel item command events. - * An event TYPE is a unique identifier for a particular system event, - * such as a button press or a listbox deselection. - * - */ - -class WXDLLIMPEXP_BASE wxEvent : public wxObject -{ -private: - wxEvent& operator=(const wxEvent&); - -protected: - wxEvent(const wxEvent&); // for implementing Clone() - -public: - wxEvent(int winid = 0, wxEventType commandType = wxEVT_NULL ); - - void SetEventType(wxEventType typ) { m_eventType = typ; } - wxEventType GetEventType() const { return m_eventType; } - wxObject *GetEventObject() const { return m_eventObject; } - void SetEventObject(wxObject *obj) { m_eventObject = obj; } - long GetTimestamp() const { return m_timeStamp; } - void SetTimestamp(long ts = 0) { m_timeStamp = ts; } - int GetId() const { return m_id; } - void SetId(int Id) { m_id = Id; } - - // Can instruct event processor that we wish to ignore this event - // (treat as if the event table entry had not been found): this must be done - // to allow the event processing by the base classes (calling event.Skip() - // is the analog of calling the base class version of a virtual function) - void Skip(bool skip = true) { m_skipped = skip; } - bool GetSkipped() const { return m_skipped; } - - // this function is used to create a copy of the event polymorphically and - // all derived classes must implement it because otherwise wxPostEvent() - // for them wouldn't work (it needs to do a copy of the event) - virtual wxEvent *Clone() const = 0; - - // Implementation only: this test is explicitly anti OO and this function - // exists only for optimization purposes. - bool IsCommandEvent() const { return m_isCommandEvent; } - - // Determine if this event should be propagating to the parent window. - bool ShouldPropagate() const - { return m_propagationLevel != wxEVENT_PROPAGATE_NONE; } - - // Stop an event from propagating to its parent window, returns the old - // propagation level value - int StopPropagation() - { - int propagationLevel = m_propagationLevel; - m_propagationLevel = wxEVENT_PROPAGATE_NONE; - return propagationLevel; - } - - // Resume the event propagation by restoring the propagation level - // (returned by StopPropagation()) - void ResumePropagation(int propagationLevel) - { - m_propagationLevel = propagationLevel; - } - -#if WXWIN_COMPATIBILITY_2_4 -public: -#else -protected: -#endif - wxObject* m_eventObject; - wxEventType m_eventType; - long m_timeStamp; - int m_id; - -public: - // m_callbackUserData is for internal usage only - wxObject* m_callbackUserData; - -protected: - // the propagation level: while it is positive, we propagate the event to - // the parent window (if any) - // - // this one doesn't have to be public, we don't have to worry about - // backwards compatibility as it is new - int m_propagationLevel; - -#if WXWIN_COMPATIBILITY_2_4 -public: -#else -protected: -#endif - bool m_skipped; - bool m_isCommandEvent; - -private: - // it needs to access our m_propagationLevel - friend class WXDLLIMPEXP_FWD_BASE wxPropagateOnce; - - DECLARE_ABSTRACT_CLASS(wxEvent) -}; - -/* - * Helper class to temporarily change an event not to propagate. - */ -class WXDLLIMPEXP_BASE wxPropagationDisabler -{ -public: - wxPropagationDisabler(wxEvent& event) : m_event(event) - { - m_propagationLevelOld = m_event.StopPropagation(); - } - - ~wxPropagationDisabler() - { - m_event.ResumePropagation(m_propagationLevelOld); - } - -private: - wxEvent& m_event; - int m_propagationLevelOld; - - DECLARE_NO_COPY_CLASS(wxPropagationDisabler) -}; - -/* - * Another one to temporarily lower propagation level. - */ -class WXDLLIMPEXP_BASE wxPropagateOnce -{ -public: - wxPropagateOnce(wxEvent& event) : m_event(event) - { - wxASSERT_MSG( m_event.m_propagationLevel > 0, - wxT("shouldn't be used unless ShouldPropagate()!") ); - - m_event.m_propagationLevel--; - } - - ~wxPropagateOnce() - { - m_event.m_propagationLevel++; - } - -private: - wxEvent& m_event; - - DECLARE_NO_COPY_CLASS(wxPropagateOnce) -}; - -#if wxUSE_GUI - - -// Item or menu event class -/* - wxEVT_COMMAND_BUTTON_CLICKED - wxEVT_COMMAND_CHECKBOX_CLICKED - wxEVT_COMMAND_CHOICE_SELECTED - wxEVT_COMMAND_LISTBOX_SELECTED - wxEVT_COMMAND_LISTBOX_DOUBLECLICKED - wxEVT_COMMAND_TEXT_UPDATED - wxEVT_COMMAND_TEXT_ENTER - wxEVT_COMMAND_MENU_SELECTED - wxEVT_COMMAND_SLIDER_UPDATED - wxEVT_COMMAND_RADIOBOX_SELECTED - wxEVT_COMMAND_RADIOBUTTON_SELECTED - wxEVT_COMMAND_SCROLLBAR_UPDATED - wxEVT_COMMAND_VLBOX_SELECTED - wxEVT_COMMAND_COMBOBOX_SELECTED - wxEVT_COMMAND_TOGGLEBUTTON_CLICKED -*/ - -#if WXWIN_COMPATIBILITY_2_4 -// Backwards compatibility for wxCommandEvent::m_commandString, will lead to compilation errors in some cases of usage -class WXDLLIMPEXP_CORE wxCommandEvent; - -class WXDLLIMPEXP_CORE wxCommandEventStringHelper -{ -public: - wxCommandEventStringHelper(wxCommandEvent * evt) - : m_evt(evt) - { } - - void operator=(const wxString &str); - operator wxString(); - const wxChar* c_str() const; - -private: - wxCommandEvent* m_evt; -}; -#endif - -class WXDLLIMPEXP_CORE wxCommandEvent : public wxEvent -{ -public: - wxCommandEvent(wxEventType commandType = wxEVT_NULL, int winid = 0); - - wxCommandEvent(const wxCommandEvent& event) - : wxEvent(event), -#if WXWIN_COMPATIBILITY_2_4 - m_commandString(this), -#endif - m_cmdString(event.m_cmdString), - m_commandInt(event.m_commandInt), - m_extraLong(event.m_extraLong), - m_clientData(event.m_clientData), - m_clientObject(event.m_clientObject) - { } - - // Set/Get client data from controls - void SetClientData(void* clientData) { m_clientData = clientData; } - void *GetClientData() const { return m_clientData; } - - // Set/Get client object from controls - void SetClientObject(wxClientData* clientObject) { m_clientObject = clientObject; } - wxClientData *GetClientObject() const { return m_clientObject; } - - // Get listbox selection if single-choice - int GetSelection() const { return m_commandInt; } - - // Set/Get listbox/choice selection string - void SetString(const wxString& s) { m_cmdString = s; } - wxString GetString() const; - - // Get checkbox value - bool IsChecked() const { return m_commandInt != 0; } - - // true if the listbox event was a selection. - bool IsSelection() const { return (m_extraLong != 0); } - - void SetExtraLong(long extraLong) { m_extraLong = extraLong; } - long GetExtraLong() const { return m_extraLong; } - - void SetInt(int i) { m_commandInt = i; } - int GetInt() const { return m_commandInt; } - - virtual wxEvent *Clone() const { return new wxCommandEvent(*this); } - -#if WXWIN_COMPATIBILITY_2_4 -public: - wxCommandEventStringHelper m_commandString; -#else -protected: -#endif - wxString m_cmdString; // String event argument - int m_commandInt; - long m_extraLong; // Additional information (e.g. select/deselect) - void* m_clientData; // Arbitrary client data - wxClientData* m_clientObject; // Arbitrary client object - -private: - DECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxCommandEvent) -}; - -#if WXWIN_COMPATIBILITY_2_4 -inline void wxCommandEventStringHelper::operator=(const wxString &str) -{ - m_evt->SetString(str); -} - -inline wxCommandEventStringHelper::operator wxString() -{ - return m_evt->GetString(); -} - -inline const wxChar* wxCommandEventStringHelper::c_str() const -{ - return m_evt->GetString().c_str(); -} -#endif - -// this class adds a possibility to react (from the user) code to a control -// notification: allow or veto the operation being reported. -class WXDLLIMPEXP_CORE wxNotifyEvent : public wxCommandEvent -{ -public: - wxNotifyEvent(wxEventType commandType = wxEVT_NULL, int winid = 0) - : wxCommandEvent(commandType, winid) - { m_bAllow = true; } - - wxNotifyEvent(const wxNotifyEvent& event) - : wxCommandEvent(event) - { m_bAllow = event.m_bAllow; } - - // veto the operation (usually it's allowed by default) - void Veto() { m_bAllow = false; } - - // allow the operation if it was disabled by default - void Allow() { m_bAllow = true; } - - // for implementation code only: is the operation allowed? - bool IsAllowed() const { return m_bAllow; } - - virtual wxEvent *Clone() const { return new wxNotifyEvent(*this); } - -private: - bool m_bAllow; - -private: - DECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxNotifyEvent) -}; - -// Scroll event class, derived form wxCommandEvent. wxScrollEvents are -// sent by wxSlider and wxScrollBar. -/* - wxEVT_SCROLL_TOP - wxEVT_SCROLL_BOTTOM - wxEVT_SCROLL_LINEUP - wxEVT_SCROLL_LINEDOWN - wxEVT_SCROLL_PAGEUP - wxEVT_SCROLL_PAGEDOWN - wxEVT_SCROLL_THUMBTRACK - wxEVT_SCROLL_THUMBRELEASE - wxEVT_SCROLL_CHANGED -*/ - -class WXDLLIMPEXP_CORE wxScrollEvent : public wxCommandEvent -{ -public: - wxScrollEvent(wxEventType commandType = wxEVT_NULL, - int winid = 0, int pos = 0, int orient = 0); - - int GetOrientation() const { return (int) m_extraLong; } - int GetPosition() const { return m_commandInt; } - void SetOrientation(int orient) { m_extraLong = (long) orient; } - void SetPosition(int pos) { m_commandInt = pos; } - - virtual wxEvent *Clone() const { return new wxScrollEvent(*this); } - -private: - DECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxScrollEvent) -}; - -// ScrollWin event class, derived fom wxEvent. wxScrollWinEvents -// are sent by wxWindow. -/* - wxEVT_SCROLLWIN_TOP - wxEVT_SCROLLWIN_BOTTOM - wxEVT_SCROLLWIN_LINEUP - wxEVT_SCROLLWIN_LINEDOWN - wxEVT_SCROLLWIN_PAGEUP - wxEVT_SCROLLWIN_PAGEDOWN - wxEVT_SCROLLWIN_THUMBTRACK - wxEVT_SCROLLWIN_THUMBRELEASE -*/ - -class WXDLLIMPEXP_CORE wxScrollWinEvent : public wxEvent -{ -public: - wxScrollWinEvent(wxEventType commandType = wxEVT_NULL, - int pos = 0, int orient = 0); - wxScrollWinEvent(const wxScrollWinEvent & event) : wxEvent(event) - { m_commandInt = event.m_commandInt; - m_extraLong = event.m_extraLong; } - - int GetOrientation() const { return (int) m_extraLong; } - int GetPosition() const { return m_commandInt; } - void SetOrientation(int orient) { m_extraLong = (long) orient; } - void SetPosition(int pos) { m_commandInt = pos; } - - virtual wxEvent *Clone() const { return new wxScrollWinEvent(*this); } - -#if WXWIN_COMPATIBILITY_2_4 -public: -#else -protected: -#endif - int m_commandInt; - long m_extraLong; - -private: - DECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxScrollWinEvent) -}; - -// Mouse event class - -/* - wxEVT_LEFT_DOWN - wxEVT_LEFT_UP - wxEVT_MIDDLE_DOWN - wxEVT_MIDDLE_UP - wxEVT_RIGHT_DOWN - wxEVT_RIGHT_UP - wxEVT_MOTION - wxEVT_ENTER_WINDOW - wxEVT_LEAVE_WINDOW - wxEVT_LEFT_DCLICK - wxEVT_MIDDLE_DCLICK - wxEVT_RIGHT_DCLICK - wxEVT_NC_LEFT_DOWN - wxEVT_NC_LEFT_UP, - wxEVT_NC_MIDDLE_DOWN, - wxEVT_NC_MIDDLE_UP, - wxEVT_NC_RIGHT_DOWN, - wxEVT_NC_RIGHT_UP, - wxEVT_NC_MOTION, - wxEVT_NC_ENTER_WINDOW, - wxEVT_NC_LEAVE_WINDOW, - wxEVT_NC_LEFT_DCLICK, - wxEVT_NC_MIDDLE_DCLICK, - wxEVT_NC_RIGHT_DCLICK, -*/ - -// the symbolic names for the mouse buttons -enum -{ - wxMOUSE_BTN_ANY = -1, - wxMOUSE_BTN_NONE = 0, - wxMOUSE_BTN_LEFT = 1, - wxMOUSE_BTN_MIDDLE = 2, - wxMOUSE_BTN_RIGHT = 3 -}; - -class WXDLLIMPEXP_CORE wxMouseEvent : public wxEvent -{ -public: - wxMouseEvent(wxEventType mouseType = wxEVT_NULL); - wxMouseEvent(const wxMouseEvent& event) : wxEvent(event) - { Assign(event); } - - // Was it a button event? (*doesn't* mean: is any button *down*?) - bool IsButton() const { return Button(wxMOUSE_BTN_ANY); } - - // Was it a down event from this (or any) button? - bool ButtonDown(int but = wxMOUSE_BTN_ANY) const; - - // Was it a dclick event from this (or any) button? - bool ButtonDClick(int but = wxMOUSE_BTN_ANY) const; - - // Was it a up event from this (or any) button? - bool ButtonUp(int but = wxMOUSE_BTN_ANY) const; - - // Was the given button? - bool Button(int but) const; - - // Was the given button in Down state? - bool ButtonIsDown(int but) const; - - // Get the button which is changing state (wxMOUSE_BTN_NONE if none) - int GetButton() const; - - // Find state of shift/control keys - bool ControlDown() const { return m_controlDown; } - bool MetaDown() const { return m_metaDown; } - bool AltDown() const { return m_altDown; } - bool ShiftDown() const { return m_shiftDown; } - bool CmdDown() const - { -#if defined(__WXMAC__) || defined(__WXCOCOA__) - return MetaDown(); -#else - return ControlDown(); -#endif - } - - // Find which event was just generated - bool LeftDown() const { return (m_eventType == wxEVT_LEFT_DOWN); } - bool MiddleDown() const { return (m_eventType == wxEVT_MIDDLE_DOWN); } - bool RightDown() const { return (m_eventType == wxEVT_RIGHT_DOWN); } - - bool LeftUp() const { return (m_eventType == wxEVT_LEFT_UP); } - bool MiddleUp() const { return (m_eventType == wxEVT_MIDDLE_UP); } - bool RightUp() const { return (m_eventType == wxEVT_RIGHT_UP); } - - bool LeftDClick() const { return (m_eventType == wxEVT_LEFT_DCLICK); } - bool MiddleDClick() const { return (m_eventType == wxEVT_MIDDLE_DCLICK); } - bool RightDClick() const { return (m_eventType == wxEVT_RIGHT_DCLICK); } - - // Find the current state of the mouse buttons (regardless - // of current event type) - bool LeftIsDown() const { return m_leftDown; } - bool MiddleIsDown() const { return m_middleDown; } - bool RightIsDown() const { return m_rightDown; } - - // True if a button is down and the mouse is moving - bool Dragging() const - { - return (m_eventType == wxEVT_MOTION) && ButtonIsDown(wxMOUSE_BTN_ANY); - } - - // True if the mouse is moving, and no button is down - bool Moving() const - { - return (m_eventType == wxEVT_MOTION) && !ButtonIsDown(wxMOUSE_BTN_ANY); - } - - // True if the mouse is just entering the window - bool Entering() const { return (m_eventType == wxEVT_ENTER_WINDOW); } - - // True if the mouse is just leaving the window - bool Leaving() const { return (m_eventType == wxEVT_LEAVE_WINDOW); } - - // Find the position of the event - void GetPosition(wxCoord *xpos, wxCoord *ypos) const - { - if (xpos) - *xpos = m_x; - if (ypos) - *ypos = m_y; - } - - void GetPosition(long *xpos, long *ypos) const - { - if (xpos) - *xpos = (long)m_x; - if (ypos) - *ypos = (long)m_y; - } - - // Find the position of the event - wxPoint GetPosition() const { return wxPoint(m_x, m_y); } - - // Find the logical position of the event given the DC - wxPoint GetLogicalPosition(const wxDC& dc) const; - - // Get X position - wxCoord GetX() const { return m_x; } - - // Get Y position - wxCoord GetY() const { return m_y; } - - // Get wheel rotation, positive or negative indicates direction of - // rotation. Current devices all send an event when rotation is equal to - // +/-WheelDelta, but this allows for finer resolution devices to be - // created in the future. Because of this you shouldn't assume that one - // event is equal to 1 line or whatever, but you should be able to either - // do partial line scrolling or wait until +/-WheelDelta rotation values - // have been accumulated before scrolling. - int GetWheelRotation() const { return m_wheelRotation; } - - // Get wheel delta, normally 120. This is the threshold for action to be - // taken, and one such action (for example, scrolling one increment) - // should occur for each delta. - int GetWheelDelta() const { return m_wheelDelta; } - - // Returns the configured number of lines (or whatever) to be scrolled per - // wheel action. Defaults to one. - int GetLinesPerAction() const { return m_linesPerAction; } - - // Is the system set to do page scrolling? - bool IsPageScroll() const { return ((unsigned int)m_linesPerAction == UINT_MAX); } - - virtual wxEvent *Clone() const { return new wxMouseEvent(*this); } - - wxMouseEvent& operator=(const wxMouseEvent& event) { Assign(event); return *this; } - -public: - wxCoord m_x, m_y; - - bool m_leftDown; - bool m_middleDown; - bool m_rightDown; - - bool m_controlDown; - bool m_shiftDown; - bool m_altDown; - bool m_metaDown; - - int m_wheelRotation; - int m_wheelDelta; - int m_linesPerAction; - -protected: - void Assign(const wxMouseEvent& evt); - -private: - DECLARE_DYNAMIC_CLASS(wxMouseEvent) -}; - -// Cursor set event - -/* - wxEVT_SET_CURSOR - */ - -class WXDLLIMPEXP_CORE wxSetCursorEvent : public wxEvent -{ -public: - wxSetCursorEvent(wxCoord x = 0, wxCoord y = 0) - : wxEvent(0, wxEVT_SET_CURSOR), - m_x(x), m_y(y), m_cursor() - { } - - wxSetCursorEvent(const wxSetCursorEvent & event) - : wxEvent(event), - m_x(event.m_x), - m_y(event.m_y), - m_cursor(event.m_cursor) - { } - - wxCoord GetX() const { return m_x; } - wxCoord GetY() const { return m_y; } - - void SetCursor(const wxCursor& cursor) { m_cursor = cursor; } - const wxCursor& GetCursor() const { return m_cursor; } - bool HasCursor() const { return m_cursor.Ok(); } - - virtual wxEvent *Clone() const { return new wxSetCursorEvent(*this); } - -private: - wxCoord m_x, m_y; - wxCursor m_cursor; - -private: - DECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxSetCursorEvent) -}; - -// Keyboard input event class - -/* - wxEVT_CHAR - wxEVT_CHAR_HOOK - wxEVT_KEY_DOWN - wxEVT_KEY_UP - wxEVT_HOTKEY - */ - -class WXDLLIMPEXP_CORE wxKeyEvent : public wxEvent -{ -public: - wxKeyEvent(wxEventType keyType = wxEVT_NULL); - wxKeyEvent(const wxKeyEvent& evt); - - // can be used check if the key event has exactly the given modifiers: - // "GetModifiers() = wxMOD_CONTROL" is easier to write than "ControlDown() - // && !MetaDown() && !AltDown() && !ShiftDown()" - int GetModifiers() const - { - return (m_controlDown ? wxMOD_CONTROL : 0) | - (m_shiftDown ? wxMOD_SHIFT : 0) | - (m_metaDown ? wxMOD_META : 0) | - (m_altDown ? wxMOD_ALT : 0); - } - - // Find state of shift/control keys - bool ControlDown() const { return m_controlDown; } - bool ShiftDown() const { return m_shiftDown; } - bool MetaDown() const { return m_metaDown; } - bool AltDown() const { return m_altDown; } - - // "Cmd" is a pseudo key which is Control for PC and Unix platforms but - // Apple ("Command") key under Macs: it makes often sense to use it instead - // of, say, ControlDown() because Cmd key is used for the same thing under - // Mac as Ctrl elsewhere (but Ctrl still exists, just not used for this - // purpose under Mac) - bool CmdDown() const - { -#if defined(__WXMAC__) || defined(__WXCOCOA__) - return MetaDown(); -#else - return ControlDown(); -#endif - } - - // exclude MetaDown() from HasModifiers() because NumLock under X is often - // configured as mod2 modifier, yet the key events even when it is pressed - // should be processed normally, not like Ctrl- or Alt-key - bool HasModifiers() const { return ControlDown() || AltDown(); } - - // get the key code: an ASCII7 char or an element of wxKeyCode enum - int GetKeyCode() const { return (int)m_keyCode; } - -#if wxUSE_UNICODE - // get the Unicode character corresponding to this key - wxChar GetUnicodeKey() const { return m_uniChar; } -#endif // wxUSE_UNICODE - - // get the raw key code (platform-dependent) - wxUint32 GetRawKeyCode() const { return m_rawCode; } - - // get the raw key flags (platform-dependent) - wxUint32 GetRawKeyFlags() const { return m_rawFlags; } - - // Find the position of the event - void GetPosition(wxCoord *xpos, wxCoord *ypos) const - { - if (xpos) *xpos = m_x; - if (ypos) *ypos = m_y; - } - - void GetPosition(long *xpos, long *ypos) const - { - if (xpos) *xpos = (long)m_x; - if (ypos) *ypos = (long)m_y; - } - - wxPoint GetPosition() const - { return wxPoint(m_x, m_y); } - - // Get X position - wxCoord GetX() const { return m_x; } - - // Get Y position - wxCoord GetY() const { return m_y; } - -#if WXWIN_COMPATIBILITY_2_6 - // deprecated, Use GetKeyCode instead. - wxDEPRECATED( long KeyCode() const ); -#endif // WXWIN_COMPATIBILITY_2_6 - - virtual wxEvent *Clone() const { return new wxKeyEvent(*this); } - - // we do need to copy wxKeyEvent sometimes (in wxTreeCtrl code, for - // example) - wxKeyEvent& operator=(const wxKeyEvent& evt) - { - m_x = evt.m_x; - m_y = evt.m_y; - - m_keyCode = evt.m_keyCode; - - m_controlDown = evt.m_controlDown; - m_shiftDown = evt.m_shiftDown; - m_altDown = evt.m_altDown; - m_metaDown = evt.m_metaDown; - m_scanCode = evt.m_scanCode; - m_rawCode = evt.m_rawCode; - m_rawFlags = evt.m_rawFlags; -#if wxUSE_UNICODE - m_uniChar = evt.m_uniChar; -#endif - - return *this; - } - -public: - wxCoord m_x, m_y; - - long m_keyCode; - - // TODO: replace those with a single m_modifiers bitmask of wxMOD_XXX? - bool m_controlDown; - bool m_shiftDown; - bool m_altDown; - bool m_metaDown; - - // FIXME: what is this for? relation to m_rawXXX? - bool m_scanCode; - -#if wxUSE_UNICODE - // This contains the full Unicode character - // in a character events in Unicode mode - wxChar m_uniChar; -#endif - - // these fields contain the platform-specific information about - // key that was pressed - wxUint32 m_rawCode; - wxUint32 m_rawFlags; - -private: - DECLARE_DYNAMIC_CLASS(wxKeyEvent) -}; - -// Size event class -/* - wxEVT_SIZE - */ - -class WXDLLIMPEXP_CORE wxSizeEvent : public wxEvent -{ -public: - wxSizeEvent() : wxEvent(0, wxEVT_SIZE) - { } - wxSizeEvent(const wxSize& sz, int winid = 0) - : wxEvent(winid, wxEVT_SIZE), - m_size(sz) - { } - wxSizeEvent(const wxSizeEvent & event) - : wxEvent(event), - m_size(event.m_size), m_rect(event.m_rect) - { } - wxSizeEvent(const wxRect& rect, int id = 0) - : m_size(rect.GetSize()), m_rect(rect) - { m_eventType = wxEVT_SIZING; m_id = id; } - - wxSize GetSize() const { return m_size; } - wxRect GetRect() const { return m_rect; } - void SetRect(const wxRect& rect) { m_rect = rect; } - - virtual wxEvent *Clone() const { return new wxSizeEvent(*this); } - -public: - // For internal usage only. Will be converted to protected members. - wxSize m_size; - wxRect m_rect; // Used for wxEVT_SIZING - -private: - DECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxSizeEvent) -}; - -// Move event class - -/* - wxEVT_MOVE - */ - -class WXDLLIMPEXP_CORE wxMoveEvent : public wxEvent -{ -public: - wxMoveEvent() - : wxEvent(0, wxEVT_MOVE) - { } - wxMoveEvent(const wxPoint& pos, int winid = 0) - : wxEvent(winid, wxEVT_MOVE), - m_pos(pos) - { } - wxMoveEvent(const wxMoveEvent& event) - : wxEvent(event), - m_pos(event.m_pos) - { } - wxMoveEvent(const wxRect& rect, int id = 0) - : m_pos(rect.GetPosition()), m_rect(rect) - { m_eventType = wxEVT_MOVING; m_id = id; } - - wxPoint GetPosition() const { return m_pos; } - void SetPosition(const wxPoint& pos) { m_pos = pos; } - wxRect GetRect() const { return m_rect; } - void SetRect(const wxRect& rect) { m_rect = rect; } - - virtual wxEvent *Clone() const { return new wxMoveEvent(*this); } - -#if WXWIN_COMPATIBILITY_2_4 -public: -#else -protected: -#endif - wxPoint m_pos; - wxRect m_rect; - -private: - DECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxMoveEvent) -}; - -// Paint event class -/* - wxEVT_PAINT - wxEVT_NC_PAINT - wxEVT_PAINT_ICON - */ - -#if defined(__WXDEBUG__) && (defined(__WXMSW__) || defined(__WXPM__)) - // see comments in src/msw|os2/dcclient.cpp where g_isPainting is defined - extern WXDLLIMPEXP_CORE int g_isPainting; -#endif // debug - -class WXDLLIMPEXP_CORE wxPaintEvent : public wxEvent -{ -public: - wxPaintEvent(int Id = 0) - : wxEvent(Id, wxEVT_PAINT) - { -#if defined(__WXDEBUG__) && (defined(__WXMSW__) || defined(__WXPM__)) - // set the internal flag for the duration of processing of WM_PAINT - g_isPainting++; -#endif // debug - } - - // default copy ctor and dtor are normally fine, we only need them to keep - // g_isPainting updated in debug build -#if defined(__WXDEBUG__) && (defined(__WXMSW__) || defined(__WXPM__)) - wxPaintEvent(const wxPaintEvent& event) - : wxEvent(event) - { - g_isPainting++; - } - - virtual ~wxPaintEvent() - { - g_isPainting--; - } -#endif // debug - - virtual wxEvent *Clone() const { return new wxPaintEvent(*this); } - -private: - DECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxPaintEvent) -}; - -class WXDLLIMPEXP_CORE wxNcPaintEvent : public wxEvent -{ -public: - wxNcPaintEvent(int winid = 0) - : wxEvent(winid, wxEVT_NC_PAINT) - { } - - virtual wxEvent *Clone() const { return new wxNcPaintEvent(*this); } - -private: - DECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxNcPaintEvent) -}; - -// Erase background event class -/* - wxEVT_ERASE_BACKGROUND - */ - -class WXDLLIMPEXP_CORE wxEraseEvent : public wxEvent -{ -public: - wxEraseEvent(int Id = 0, wxDC *dc = (wxDC *) NULL) - : wxEvent(Id, wxEVT_ERASE_BACKGROUND), - m_dc(dc) - { } - - wxEraseEvent(const wxEraseEvent& event) - : wxEvent(event), - m_dc(event.m_dc) - { } - - wxDC *GetDC() const { return m_dc; } - - virtual wxEvent *Clone() const { return new wxEraseEvent(*this); } - -#if WXWIN_COMPATIBILITY_2_4 -public: -#else -protected: -#endif - wxDC *m_dc; - -private: - DECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxEraseEvent) -}; - -// Focus event class -/* - wxEVT_SET_FOCUS - wxEVT_KILL_FOCUS - */ - -class WXDLLIMPEXP_CORE wxFocusEvent : public wxEvent -{ -public: - wxFocusEvent(wxEventType type = wxEVT_NULL, int winid = 0) - : wxEvent(winid, type) - { m_win = NULL; } - - wxFocusEvent(const wxFocusEvent& event) - : wxEvent(event) - { m_win = event.m_win; } - - // The window associated with this event is the window which had focus - // before for SET event and the window which will have focus for the KILL - // one. NB: it may be NULL in both cases! - wxWindow *GetWindow() const { return m_win; } - void SetWindow(wxWindow *win) { m_win = win; } - - virtual wxEvent *Clone() const { return new wxFocusEvent(*this); } - -private: - wxWindow *m_win; - -private: - DECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxFocusEvent) -}; - -// wxChildFocusEvent notifies the parent that a child has got the focus: unlike -// wxFocusEvent it is propagated upwards the window chain -class WXDLLIMPEXP_CORE wxChildFocusEvent : public wxCommandEvent -{ -public: - wxChildFocusEvent(wxWindow *win = NULL); - - wxWindow *GetWindow() const { return (wxWindow *)GetEventObject(); } - - virtual wxEvent *Clone() const { return new wxChildFocusEvent(*this); } - -private: - DECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxChildFocusEvent) -}; - -// Activate event class -/* - wxEVT_ACTIVATE - wxEVT_ACTIVATE_APP - wxEVT_HIBERNATE - */ - -class WXDLLIMPEXP_CORE wxActivateEvent : public wxEvent -{ -public: - wxActivateEvent(wxEventType type = wxEVT_NULL, bool active = true, int Id = 0) - : wxEvent(Id, type) - { m_active = active; } - wxActivateEvent(const wxActivateEvent& event) - : wxEvent(event) - { m_active = event.m_active; } - - bool GetActive() const { return m_active; } - - virtual wxEvent *Clone() const { return new wxActivateEvent(*this); } - -private: - bool m_active; - -private: - DECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxActivateEvent) -}; - -// InitDialog event class -/* - wxEVT_INIT_DIALOG - */ - -class WXDLLIMPEXP_CORE wxInitDialogEvent : public wxEvent -{ -public: - wxInitDialogEvent(int Id = 0) - : wxEvent(Id, wxEVT_INIT_DIALOG) - { } - - virtual wxEvent *Clone() const { return new wxInitDialogEvent(*this); } - -private: - DECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxInitDialogEvent) -}; - -// Miscellaneous menu event class -/* - wxEVT_MENU_OPEN, - wxEVT_MENU_CLOSE, - wxEVT_MENU_HIGHLIGHT, -*/ - -class WXDLLIMPEXP_CORE wxMenuEvent : public wxEvent -{ -public: - wxMenuEvent(wxEventType type = wxEVT_NULL, int winid = 0, wxMenu* menu = NULL) - : wxEvent(winid, type) - { m_menuId = winid; m_menu = menu; } - wxMenuEvent(const wxMenuEvent & event) - : wxEvent(event) - { m_menuId = event.m_menuId; m_menu = event.m_menu; } - - // only for wxEVT_MENU_HIGHLIGHT - int GetMenuId() const { return m_menuId; } - - // only for wxEVT_MENU_OPEN/CLOSE - bool IsPopup() const { return m_menuId == wxID_ANY; } - - // only for wxEVT_MENU_OPEN/CLOSE - wxMenu* GetMenu() const { return m_menu; } - - virtual wxEvent *Clone() const { return new wxMenuEvent(*this); } - -private: - int m_menuId; - wxMenu* m_menu; - - DECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxMenuEvent) -}; - -// Window close or session close event class -/* - wxEVT_CLOSE_WINDOW, - wxEVT_END_SESSION, - wxEVT_QUERY_END_SESSION - */ - -class WXDLLIMPEXP_CORE wxCloseEvent : public wxEvent -{ -public: - wxCloseEvent(wxEventType type = wxEVT_NULL, int winid = 0) - : wxEvent(winid, type), - m_loggingOff(true), - m_veto(false), // should be false by default - m_canVeto(true) {} - - wxCloseEvent(const wxCloseEvent & event) - : wxEvent(event), - m_loggingOff(event.m_loggingOff), - m_veto(event.m_veto), - m_canVeto(event.m_canVeto) {} - - void SetLoggingOff(bool logOff) { m_loggingOff = logOff; } - bool GetLoggingOff() const - { - // m_loggingOff flag is only used by wxEVT_[QUERY_]END_SESSION, it - // doesn't make sense for wxEVT_CLOSE_WINDOW - wxASSERT_MSG( m_eventType != wxEVT_CLOSE_WINDOW, - wxT("this flag is for end session events only") ); - - return m_loggingOff; - } - - void Veto(bool veto = true) - { - // GetVeto() will return false anyhow... - wxCHECK_RET( m_canVeto, - wxT("call to Veto() ignored (can't veto this event)") ); - - m_veto = veto; - } - void SetCanVeto(bool canVeto) { m_canVeto = canVeto; } - bool CanVeto() const { return m_canVeto; } - bool GetVeto() const { return m_canVeto && m_veto; } - - virtual wxEvent *Clone() const { return new wxCloseEvent(*this); } - -protected: - bool m_loggingOff, - m_veto, - m_canVeto; - -private: - DECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxCloseEvent) -}; - -/* - wxEVT_SHOW - */ - -class WXDLLIMPEXP_CORE wxShowEvent : public wxEvent -{ -public: - wxShowEvent(int winid = 0, bool show = false) - : wxEvent(winid, wxEVT_SHOW) - { m_show = show; } - wxShowEvent(const wxShowEvent & event) - : wxEvent(event) - { m_show = event.m_show; } - - void SetShow(bool show) { m_show = show; } - bool GetShow() const { return m_show; } -#if wxABI_VERSION >= 20811 - bool IsShown() const { return GetShow(); } -#endif - - virtual wxEvent *Clone() const { return new wxShowEvent(*this); } - -protected: - bool m_show; - -private: - DECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxShowEvent) -}; - -/* - wxEVT_ICONIZE - */ - -class WXDLLIMPEXP_CORE wxIconizeEvent : public wxEvent -{ -public: - wxIconizeEvent(int winid = 0, bool iconized = true) - : wxEvent(winid, wxEVT_ICONIZE) - { m_iconized = iconized; } - wxIconizeEvent(const wxIconizeEvent & event) - : wxEvent(event) - { m_iconized = event.m_iconized; } - - // return true if the frame was iconized, false if restored - bool Iconized() const { return m_iconized; } -#if wxABI_VERSION >= 20811 - bool IsIconized() const { return Iconized(); } -#endif - virtual wxEvent *Clone() const { return new wxIconizeEvent(*this); } - -protected: - bool m_iconized; - -private: - DECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxIconizeEvent) -}; -/* - wxEVT_MAXIMIZE - */ - -class WXDLLIMPEXP_CORE wxMaximizeEvent : public wxEvent -{ -public: - wxMaximizeEvent(int winid = 0) - : wxEvent(winid, wxEVT_MAXIMIZE) - { } - - virtual wxEvent *Clone() const { return new wxMaximizeEvent(*this); } - -private: - DECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxMaximizeEvent) -}; - -// Joystick event class -/* - wxEVT_JOY_BUTTON_DOWN, - wxEVT_JOY_BUTTON_UP, - wxEVT_JOY_MOVE, - wxEVT_JOY_ZMOVE -*/ - -// Which joystick? Same as Windows ids so no conversion necessary. -enum -{ - wxJOYSTICK1, - wxJOYSTICK2 -}; - -// Which button is down? -enum -{ - wxJOY_BUTTON_ANY = -1, - wxJOY_BUTTON1 = 1, - wxJOY_BUTTON2 = 2, - wxJOY_BUTTON3 = 4, - wxJOY_BUTTON4 = 8 -}; - -class WXDLLIMPEXP_CORE wxJoystickEvent : public wxEvent -{ -#if WXWIN_COMPATIBILITY_2_4 -public: -#else -protected: -#endif - wxPoint m_pos; - int m_zPosition; - int m_buttonChange; // Which button changed? - int m_buttonState; // Which buttons are down? - int m_joyStick; // Which joystick? - -public: - wxJoystickEvent(wxEventType type = wxEVT_NULL, - int state = 0, - int joystick = wxJOYSTICK1, - int change = 0) - : wxEvent(0, type), - m_pos(), - m_zPosition(0), - m_buttonChange(change), - m_buttonState(state), - m_joyStick(joystick) - { - } - wxJoystickEvent(const wxJoystickEvent & event) - : wxEvent(event), - m_pos(event.m_pos), - m_zPosition(event.m_zPosition), - m_buttonChange(event.m_buttonChange), - m_buttonState(event.m_buttonState), - m_joyStick(event.m_joyStick) - { } - - wxPoint GetPosition() const { return m_pos; } - int GetZPosition() const { return m_zPosition; } - int GetButtonState() const { return m_buttonState; } - int GetButtonChange() const { return m_buttonChange; } - int GetJoystick() const { return m_joyStick; } - - void SetJoystick(int stick) { m_joyStick = stick; } - void SetButtonState(int state) { m_buttonState = state; } - void SetButtonChange(int change) { m_buttonChange = change; } - void SetPosition(const wxPoint& pos) { m_pos = pos; } - void SetZPosition(int zPos) { m_zPosition = zPos; } - - // Was it a button event? (*doesn't* mean: is any button *down*?) - bool IsButton() const { return ((GetEventType() == wxEVT_JOY_BUTTON_DOWN) || - (GetEventType() == wxEVT_JOY_BUTTON_UP)); } - - // Was it a move event? - bool IsMove() const { return (GetEventType() == wxEVT_JOY_MOVE); } - - // Was it a zmove event? - bool IsZMove() const { return (GetEventType() == wxEVT_JOY_ZMOVE); } - - // Was it a down event from button 1, 2, 3, 4 or any? - bool ButtonDown(int but = wxJOY_BUTTON_ANY) const - { return ((GetEventType() == wxEVT_JOY_BUTTON_DOWN) && - ((but == wxJOY_BUTTON_ANY) || (but == m_buttonChange))); } - - // Was it a up event from button 1, 2, 3 or any? - bool ButtonUp(int but = wxJOY_BUTTON_ANY) const - { return ((GetEventType() == wxEVT_JOY_BUTTON_UP) && - ((but == wxJOY_BUTTON_ANY) || (but == m_buttonChange))); } - - // Was the given button 1,2,3,4 or any in Down state? - bool ButtonIsDown(int but = wxJOY_BUTTON_ANY) const - { return (((but == wxJOY_BUTTON_ANY) && (m_buttonState != 0)) || - ((m_buttonState & but) == but)); } - - virtual wxEvent *Clone() const { return new wxJoystickEvent(*this); } - -private: - DECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxJoystickEvent) -}; - -// Drop files event class -/* - wxEVT_DROP_FILES - */ - -class WXDLLIMPEXP_CORE wxDropFilesEvent : public wxEvent -{ -public: - int m_noFiles; - wxPoint m_pos; - wxString* m_files; - - wxDropFilesEvent(wxEventType type = wxEVT_NULL, - int noFiles = 0, - wxString *files = (wxString *) NULL) - : wxEvent(0, type), - m_noFiles(noFiles), - m_pos(), - m_files(files) - { } - - // we need a copy ctor to avoid deleting m_files pointer twice - wxDropFilesEvent(const wxDropFilesEvent& other) - : wxEvent(other), - m_noFiles(other.m_noFiles), - m_pos(other.m_pos), - m_files(NULL) - { - m_files = new wxString[m_noFiles]; - for ( int n = 0; n < m_noFiles; n++ ) - { - m_files[n] = other.m_files[n]; - } - } - - virtual ~wxDropFilesEvent() - { - delete [] m_files; - } - - wxPoint GetPosition() const { return m_pos; } - int GetNumberOfFiles() const { return m_noFiles; } - wxString *GetFiles() const { return m_files; } - - virtual wxEvent *Clone() const { return new wxDropFilesEvent(*this); } - -private: - DECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxDropFilesEvent) -}; - -// Update UI event -/* - wxEVT_UPDATE_UI - */ - -// Whether to always send update events to windows, or -// to only send update events to those with the -// wxWS_EX_PROCESS_UI_UPDATES style. - -enum wxUpdateUIMode -{ - // Send UI update events to all windows - wxUPDATE_UI_PROCESS_ALL, - - // Send UI update events to windows that have - // the wxWS_EX_PROCESS_UI_UPDATES flag specified - wxUPDATE_UI_PROCESS_SPECIFIED -}; - -class WXDLLIMPEXP_CORE wxUpdateUIEvent : public wxCommandEvent -{ -public: - wxUpdateUIEvent(wxWindowID commandId = 0) - : wxCommandEvent(wxEVT_UPDATE_UI, commandId) - { - m_checked = - m_enabled = - m_shown = - m_setEnabled = - m_setShown = - m_setText = - m_setChecked = false; - } - wxUpdateUIEvent(const wxUpdateUIEvent & event) - : wxCommandEvent(event), - m_checked(event.m_checked), - m_enabled(event.m_enabled), - m_shown(event.m_shown), - m_setEnabled(event.m_setEnabled), - m_setShown(event.m_setShown), - m_setText(event.m_setText), - m_setChecked(event.m_setChecked), - m_text(event.m_text) - { } - - bool GetChecked() const { return m_checked; } - bool GetEnabled() const { return m_enabled; } - bool GetShown() const { return m_shown; } - wxString GetText() const { return m_text; } - bool GetSetText() const { return m_setText; } - bool GetSetChecked() const { return m_setChecked; } - bool GetSetEnabled() const { return m_setEnabled; } - bool GetSetShown() const { return m_setShown; } - - void Check(bool check) { m_checked = check; m_setChecked = true; } - void Enable(bool enable) { m_enabled = enable; m_setEnabled = true; } - void Show(bool show) { m_shown = show; m_setShown = true; } - void SetText(const wxString& text) { m_text = text; m_setText = true; } - - // Sets the interval between updates in milliseconds. - // Set to -1 to disable updates, or to 0 to update as frequently as possible. - static void SetUpdateInterval(long updateInterval) { sm_updateInterval = updateInterval; } - - // Returns the current interval between updates in milliseconds - static long GetUpdateInterval() { return sm_updateInterval; } - - // Can we update this window? - static bool CanUpdate(wxWindowBase *win); - - // Reset the update time to provide a delay until the next - // time we should update - static void ResetUpdateTime(); - - // Specify how wxWidgets will send update events: to - // all windows, or only to those which specify that they - // will process the events. - static void SetMode(wxUpdateUIMode mode) { sm_updateMode = mode; } - - // Returns the UI update mode - static wxUpdateUIMode GetMode() { return sm_updateMode; } - - virtual wxEvent *Clone() const { return new wxUpdateUIEvent(*this); } - -protected: - bool m_checked; - bool m_enabled; - bool m_shown; - bool m_setEnabled; - bool m_setShown; - bool m_setText; - bool m_setChecked; - wxString m_text; -#if wxUSE_LONGLONG - static wxLongLong sm_lastUpdate; -#endif - static long sm_updateInterval; - static wxUpdateUIMode sm_updateMode; - -private: - DECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxUpdateUIEvent) -}; - -/* - wxEVT_SYS_COLOUR_CHANGED - */ - -// TODO: shouldn't all events record the window ID? -class WXDLLIMPEXP_CORE wxSysColourChangedEvent : public wxEvent -{ -public: - wxSysColourChangedEvent() - : wxEvent(0, wxEVT_SYS_COLOUR_CHANGED) - { } - - virtual wxEvent *Clone() const { return new wxSysColourChangedEvent(*this); } - -private: - DECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxSysColourChangedEvent) -}; - -/* - wxEVT_MOUSE_CAPTURE_CHANGED - The window losing the capture receives this message - (even if it released the capture itself). - */ - -class WXDLLIMPEXP_CORE wxMouseCaptureChangedEvent : public wxEvent -{ -public: - wxMouseCaptureChangedEvent(wxWindowID winid = 0, wxWindow* gainedCapture = NULL) - : wxEvent(winid, wxEVT_MOUSE_CAPTURE_CHANGED), - m_gainedCapture(gainedCapture) - { } - - wxMouseCaptureChangedEvent(const wxMouseCaptureChangedEvent& event) - : wxEvent(event), - m_gainedCapture(event.m_gainedCapture) - { } - - virtual wxEvent *Clone() const { return new wxMouseCaptureChangedEvent(*this); } - - wxWindow* GetCapturedWindow() const { return m_gainedCapture; } - -private: - wxWindow* m_gainedCapture; - - DECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxMouseCaptureChangedEvent) -}; - -/* - wxEVT_MOUSE_CAPTURE_LOST - The window losing the capture receives this message, unless it released it - it itself or unless wxWindow::CaptureMouse was called on another window - (and so capture will be restored when the new capturer releases it). - */ - -class WXDLLIMPEXP_CORE wxMouseCaptureLostEvent : public wxEvent -{ -public: - wxMouseCaptureLostEvent(wxWindowID winid = 0) - : wxEvent(winid, wxEVT_MOUSE_CAPTURE_LOST) - {} - - wxMouseCaptureLostEvent(const wxMouseCaptureLostEvent& event) - : wxEvent(event) - {} - - virtual wxEvent *Clone() const { return new wxMouseCaptureLostEvent(*this); } - - DECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxMouseCaptureLostEvent) -}; - -/* - wxEVT_DISPLAY_CHANGED - */ -class WXDLLIMPEXP_CORE wxDisplayChangedEvent : public wxEvent -{ -private: - DECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxDisplayChangedEvent) - -public: - wxDisplayChangedEvent() - : wxEvent(0, wxEVT_DISPLAY_CHANGED) - { } - - virtual wxEvent *Clone() const { return new wxDisplayChangedEvent(*this); } -}; - -/* - wxEVT_PALETTE_CHANGED - */ - -class WXDLLIMPEXP_CORE wxPaletteChangedEvent : public wxEvent -{ -public: - wxPaletteChangedEvent(wxWindowID winid = 0) - : wxEvent(winid, wxEVT_PALETTE_CHANGED), - m_changedWindow((wxWindow *) NULL) - { } - - wxPaletteChangedEvent(const wxPaletteChangedEvent& event) - : wxEvent(event), - m_changedWindow(event.m_changedWindow) - { } - - void SetChangedWindow(wxWindow* win) { m_changedWindow = win; } - wxWindow* GetChangedWindow() const { return m_changedWindow; } - - virtual wxEvent *Clone() const { return new wxPaletteChangedEvent(*this); } - -protected: - wxWindow* m_changedWindow; - -private: - DECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxPaletteChangedEvent) -}; - -/* - wxEVT_QUERY_NEW_PALETTE - Indicates the window is getting keyboard focus and should re-do its palette. - */ - -class WXDLLIMPEXP_CORE wxQueryNewPaletteEvent : public wxEvent -{ -public: - wxQueryNewPaletteEvent(wxWindowID winid = 0) - : wxEvent(winid, wxEVT_QUERY_NEW_PALETTE), - m_paletteRealized(false) - { } - wxQueryNewPaletteEvent(const wxQueryNewPaletteEvent & event) - : wxEvent(event), - m_paletteRealized(event.m_paletteRealized) - { } - - // App sets this if it changes the palette. - void SetPaletteRealized(bool realized) { m_paletteRealized = realized; } - bool GetPaletteRealized() const { return m_paletteRealized; } - - virtual wxEvent *Clone() const { return new wxQueryNewPaletteEvent(*this); } - -protected: - bool m_paletteRealized; - -private: - DECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxQueryNewPaletteEvent) -}; - -/* - Event generated by dialog navigation keys - wxEVT_NAVIGATION_KEY - */ -// NB: don't derive from command event to avoid being propagated to the parent -class WXDLLIMPEXP_CORE wxNavigationKeyEvent : public wxEvent -{ -public: - wxNavigationKeyEvent() - : wxEvent(0, wxEVT_NAVIGATION_KEY), - m_flags(IsForward | FromTab), // defaults are for TAB - m_focus((wxWindow *)NULL) - { - m_propagationLevel = wxEVENT_PROPAGATE_NONE; - } - - wxNavigationKeyEvent(const wxNavigationKeyEvent& event) - : wxEvent(event), - m_flags(event.m_flags), - m_focus(event.m_focus) - { } - - // direction: forward (true) or backward (false) - bool GetDirection() const - { return (m_flags & IsForward) != 0; } - void SetDirection(bool bForward) - { if ( bForward ) m_flags |= IsForward; else m_flags &= ~IsForward; } - - // it may be a window change event (MDI, notebook pages...) or a control - // change event - bool IsWindowChange() const - { return (m_flags & WinChange) != 0; } - void SetWindowChange(bool bIs) - { if ( bIs ) m_flags |= WinChange; else m_flags &= ~WinChange; } - - // Set to true under MSW if the event was generated using the tab key. - // This is required for proper navogation over radio buttons - bool IsFromTab() const - { return (m_flags & FromTab) != 0; } - void SetFromTab(bool bIs) - { if ( bIs ) m_flags |= FromTab; else m_flags &= ~FromTab; } - - // the child which has the focus currently (may be NULL - use - // wxWindow::FindFocus then) - wxWindow* GetCurrentFocus() const { return m_focus; } - void SetCurrentFocus(wxWindow *win) { m_focus = win; } - - // Set flags - void SetFlags(long flags) { m_flags = flags; } - - virtual wxEvent *Clone() const { return new wxNavigationKeyEvent(*this); } - - enum - { - IsBackward = 0x0000, - IsForward = 0x0001, - WinChange = 0x0002, - FromTab = 0x0004 - }; - - long m_flags; - wxWindow *m_focus; - -private: - DECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxNavigationKeyEvent) -}; - -// Window creation/destruction events: the first is sent as soon as window is -// created (i.e. the underlying GUI object exists), but when the C++ object is -// fully initialized (so virtual functions may be called). The second, -// wxEVT_DESTROY, is sent right before the window is destroyed - again, it's -// still safe to call virtual functions at this moment -/* - wxEVT_CREATE - wxEVT_DESTROY - */ - -class WXDLLIMPEXP_CORE wxWindowCreateEvent : public wxCommandEvent -{ -public: - wxWindowCreateEvent(wxWindow *win = NULL); - - wxWindow *GetWindow() const { return (wxWindow *)GetEventObject(); } - - virtual wxEvent *Clone() const { return new wxWindowCreateEvent(*this); } - -private: - DECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxWindowCreateEvent) -}; - -class WXDLLIMPEXP_CORE wxWindowDestroyEvent : public wxCommandEvent -{ -public: - wxWindowDestroyEvent(wxWindow *win = NULL); - - wxWindow *GetWindow() const { return (wxWindow *)GetEventObject(); } - - virtual wxEvent *Clone() const { return new wxWindowDestroyEvent(*this); } - -private: - DECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxWindowDestroyEvent) -}; - -// A help event is sent when the user clicks on a window in context-help mode. -/* - wxEVT_HELP - wxEVT_DETAILED_HELP -*/ - -class WXDLLIMPEXP_CORE wxHelpEvent : public wxCommandEvent -{ -public: - // how was this help event generated? - enum Origin - { - Origin_Unknown, // unrecognized event source - Origin_Keyboard, // event generated from F1 key press - Origin_HelpButton // event from [?] button on the title bar (Windows) - }; - - wxHelpEvent(wxEventType type = wxEVT_NULL, - wxWindowID winid = 0, - const wxPoint& pt = wxDefaultPosition, - Origin origin = Origin_Unknown) - : wxCommandEvent(type, winid), - m_pos(pt), - m_origin(GuessOrigin(origin)) - { } - wxHelpEvent(const wxHelpEvent & event) - : wxCommandEvent(event), - m_pos(event.m_pos), - m_target(event.m_target), - m_link(event.m_link), - m_origin(event.m_origin) - { } - - // Position of event (in screen coordinates) - const wxPoint& GetPosition() const { return m_pos; } - void SetPosition(const wxPoint& pos) { m_pos = pos; } - - // Optional link to further help - const wxString& GetLink() const { return m_link; } - void SetLink(const wxString& link) { m_link = link; } - - // Optional target to display help in. E.g. a window specification - const wxString& GetTarget() const { return m_target; } - void SetTarget(const wxString& target) { m_target = target; } - - virtual wxEvent *Clone() const { return new wxHelpEvent(*this); } - - // optional indication of the event source - Origin GetOrigin() const { return m_origin; } - void SetOrigin(Origin origin) { m_origin = origin; } - -protected: - wxPoint m_pos; - wxString m_target; - wxString m_link; - Origin m_origin; - - // we can try to guess the event origin ourselves, even if none is - // specified in the ctor - static Origin GuessOrigin(Origin origin); - -private: - DECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxHelpEvent) -}; - -// A Clipboard Text event is sent when a window intercepts text copy/cut/paste -// message, i.e. the user has cut/copied/pasted data from/into a text control -// via ctrl-C/X/V, ctrl/shift-del/insert, a popup menu command, etc. -// NOTE : under windows these events are *NOT* generated automatically -// for a Rich Edit text control. -/* -wxEVT_COMMAND_TEXT_COPY -wxEVT_COMMAND_TEXT_CUT -wxEVT_COMMAND_TEXT_PASTE -*/ - -class WXDLLIMPEXP_CORE wxClipboardTextEvent : public wxCommandEvent -{ -public: - wxClipboardTextEvent(wxEventType type = wxEVT_NULL, - wxWindowID winid = 0) - : wxCommandEvent(type, winid) - { } - wxClipboardTextEvent(const wxClipboardTextEvent & event) - : wxCommandEvent(event) - { } - - virtual wxEvent *Clone() const { return new wxClipboardTextEvent(*this); } - -private: - DECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxClipboardTextEvent) -}; - -// A Context event is sent when the user right clicks on a window or -// presses Shift-F10 -// NOTE : Under windows this is a repackaged WM_CONTETXMENU message -// Under other systems it may have to be generated from a right click event -/* - wxEVT_CONTEXT_MENU -*/ - -class WXDLLIMPEXP_CORE wxContextMenuEvent : public wxCommandEvent -{ -public: - wxContextMenuEvent(wxEventType type = wxEVT_NULL, - wxWindowID winid = 0, - const wxPoint& pt = wxDefaultPosition) - : wxCommandEvent(type, winid), - m_pos(pt) - { } - wxContextMenuEvent(const wxContextMenuEvent & event) - : wxCommandEvent(event), - m_pos(event.m_pos) - { } - - // Position of event (in screen coordinates) - const wxPoint& GetPosition() const { return m_pos; } - void SetPosition(const wxPoint& pos) { m_pos = pos; } - - virtual wxEvent *Clone() const { return new wxContextMenuEvent(*this); } - -protected: - wxPoint m_pos; - -private: - DECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxContextMenuEvent) -}; - -// Idle event -/* - wxEVT_IDLE - */ - -// Whether to always send idle events to windows, or -// to only send update events to those with the -// wxWS_EX_PROCESS_IDLE style. - -enum wxIdleMode -{ - // Send idle events to all windows - wxIDLE_PROCESS_ALL, - - // Send idle events to windows that have - // the wxWS_EX_PROCESS_IDLE flag specified - wxIDLE_PROCESS_SPECIFIED -}; - -class WXDLLIMPEXP_CORE wxIdleEvent : public wxEvent -{ -public: - wxIdleEvent() - : wxEvent(0, wxEVT_IDLE), - m_requestMore(false) - { } - wxIdleEvent(const wxIdleEvent & event) - : wxEvent(event), - m_requestMore(event.m_requestMore) - { } - - void RequestMore(bool needMore = true) { m_requestMore = needMore; } - bool MoreRequested() const { return m_requestMore; } - - virtual wxEvent *Clone() const { return new wxIdleEvent(*this); } - - // Specify how wxWidgets will send idle events: to - // all windows, or only to those which specify that they - // will process the events. - static void SetMode(wxIdleMode mode) { sm_idleMode = mode; } - - // Returns the idle event mode - static wxIdleMode GetMode() { return sm_idleMode; } - - // Can we send an idle event? - static bool CanSend(wxWindow* win); - -protected: - bool m_requestMore; - static wxIdleMode sm_idleMode; - -private: - DECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxIdleEvent) -}; - -#endif // wxUSE_GUI - -/* TODO - wxEVT_MOUSE_CAPTURE_CHANGED, - wxEVT_SETTING_CHANGED, // WM_WININICHANGE (NT) / WM_SETTINGCHANGE (Win95) -// wxEVT_FONT_CHANGED, // WM_FONTCHANGE: roll into wxEVT_SETTING_CHANGED, but remember to propagate - // wxEVT_FONT_CHANGED to all other windows (maybe). - wxEVT_DRAW_ITEM, // Leave these three as virtual functions in wxControl?? Platform-specific. - wxEVT_MEASURE_ITEM, - wxEVT_COMPARE_ITEM -*/ - - -// ============================================================================ -// event handler and related classes -// ============================================================================ - -// for backwards compatibility and to prevent eVC 4 for ARM from crashing with -// internal compiler error when compiling wx, we define wxObjectEventFunction -// as a wxObject method even though it can only be a wxEvtHandler one -typedef void (wxObject::*wxObjectEventFunction)(wxEvent&); - -// we can't have ctors nor base struct in backwards compatibility mode or -// otherwise we won't be able to initialize the objects with an agregate, so -// we have to keep both versions -#if WXWIN_COMPATIBILITY_EVENT_TYPES - -struct WXDLLIMPEXP_BASE wxEventTableEntry -{ - // For some reason, this can't be wxEventType, or VC++ complains. - int m_eventType; // main event type - int m_id; // control/menu/toolbar id - int m_lastId; // used for ranges of ids - wxObjectEventFunction m_fn; // function to call: not wxEventFunction, - // because of dependency problems - - wxObject* m_callbackUserData; -}; - -#else // !WXWIN_COMPATIBILITY_EVENT_TYPES - -// struct containing the members common to static and dynamic event tables -// entries -struct WXDLLIMPEXP_BASE wxEventTableEntryBase -{ -private: - wxEventTableEntryBase& operator=(const wxEventTableEntryBase& event); - -public: - wxEventTableEntryBase(int winid, int idLast, - wxObjectEventFunction fn, wxObject *data) - : m_id(winid), - m_lastId(idLast), - m_fn(fn), - m_callbackUserData(data) - { } - - wxEventTableEntryBase(const wxEventTableEntryBase& event) - : m_id(event.m_id), - m_lastId(event.m_lastId), - m_fn(event.m_fn), - m_callbackUserData(event.m_callbackUserData) - { } - - // the range of ids for this entry: if m_lastId == wxID_ANY, the range - // consists only of m_id, otherwise it is m_id..m_lastId inclusive - int m_id, - m_lastId; - - // function to call: not wxEventFunction, because of dependency problems - wxObjectEventFunction m_fn; - - // arbitrary user data asosciated with the callback - wxObject* m_callbackUserData; -}; - -// an entry from a static event table -struct WXDLLIMPEXP_BASE wxEventTableEntry : public wxEventTableEntryBase -{ - wxEventTableEntry(const int& evType, int winid, int idLast, - wxObjectEventFunction fn, wxObject *data) - : wxEventTableEntryBase(winid, idLast, fn, data), - m_eventType(evType) - { } - - // the reference to event type: this allows us to not care about the - // (undefined) order in which the event table entries and the event types - // are initialized: initially the value of this reference might be - // invalid, but by the time it is used for the first time, all global - // objects will have been initialized (including the event type constants) - // and so it will have the correct value when it is needed - const int& m_eventType; - -private: - wxEventTableEntry& operator=(const wxEventTableEntry&); -}; - -// an entry used in dynamic event table managed by wxEvtHandler::Connect() -struct WXDLLIMPEXP_BASE wxDynamicEventTableEntry : public wxEventTableEntryBase -{ - wxDynamicEventTableEntry(int evType, int winid, int idLast, - wxObjectEventFunction fn, wxObject *data, wxEvtHandler* eventSink) - : wxEventTableEntryBase(winid, idLast, fn, data), - m_eventType(evType), - m_eventSink(eventSink) - { } - - // not a reference here as we can't keep a reference to a temporary int - // created to wrap the constant value typically passed to Connect() - nor - // do we need it - int m_eventType; - - // Pointer to object whose function is fn - so we don't assume the - // EventFunction is always a member of the EventHandler receiving the - // message - wxEvtHandler* m_eventSink; - - DECLARE_NO_COPY_CLASS(wxDynamicEventTableEntry) -}; - -#endif // !WXWIN_COMPATIBILITY_EVENT_TYPES - -// ---------------------------------------------------------------------------- -// wxEventTable: an array of event entries terminated with {0, 0, 0, 0, 0} -// ---------------------------------------------------------------------------- - -struct WXDLLIMPEXP_BASE wxEventTable -{ - const wxEventTable *baseTable; // base event table (next in chain) - const wxEventTableEntry *entries; // bottom of entry array -}; - -// ---------------------------------------------------------------------------- -// wxEventHashTable: a helper of wxEvtHandler to speed up wxEventTable lookups. -// ---------------------------------------------------------------------------- - -WX_DEFINE_ARRAY_PTR(const wxEventTableEntry*, wxEventTableEntryPointerArray); - -class WXDLLIMPEXP_BASE wxEventHashTable -{ -private: - // Internal data structs - struct EventTypeTable - { - wxEventType eventType; - wxEventTableEntryPointerArray eventEntryTable; - }; - typedef EventTypeTable* EventTypeTablePointer; - -public: - // Constructor, needs the event table it needs to hash later on. - // Note: hashing of the event table is not done in the constructor as it - // can be that the event table is not yet full initialize, the hash - // will gets initialized when handling the first event look-up request. - wxEventHashTable(const wxEventTable &table); - // Destructor. - ~wxEventHashTable(); - - // Handle the given event, in other words search the event table hash - // and call self->ProcessEvent() if a match was found. - bool HandleEvent(wxEvent &event, wxEvtHandler *self); - - // Clear table - void Clear(); - - // Clear all tables - static void ClearAll(); - // Rebuild all tables - static void ReconstructAll(); - -protected: - // Init the hash table with the entries of the static event table. - void InitHashTable(); - // Helper funtion of InitHashTable() to insert 1 entry into the hash table. - void AddEntry(const wxEventTableEntry &entry); - // Allocate and init with null pointers the base hash table. - void AllocEventTypeTable(size_t size); - // Grow the hash table in size and transfer all items currently - // in the table to the correct location in the new table. - void GrowEventTypeTable(); - -protected: - const wxEventTable &m_table; - bool m_rebuildHash; - - size_t m_size; - EventTypeTablePointer *m_eventTypeTable; - - static wxEventHashTable* sm_first; - wxEventHashTable* m_previous; - wxEventHashTable* m_next; - - DECLARE_NO_COPY_CLASS(wxEventHashTable) -}; - -// ---------------------------------------------------------------------------- -// wxEvtHandler: the base class for all objects handling wxWidgets events -// ---------------------------------------------------------------------------- - -class WXDLLIMPEXP_BASE wxEvtHandler : public wxObject -{ -public: - wxEvtHandler(); - virtual ~wxEvtHandler(); - - wxEvtHandler *GetNextHandler() const { return m_nextHandler; } - wxEvtHandler *GetPreviousHandler() const { return m_previousHandler; } - void SetNextHandler(wxEvtHandler *handler) { m_nextHandler = handler; } - void SetPreviousHandler(wxEvtHandler *handler) { m_previousHandler = handler; } - - void SetEvtHandlerEnabled(bool enabled) { m_enabled = enabled; } - bool GetEvtHandlerEnabled() const { return m_enabled; } - - // process an event right now - virtual bool ProcessEvent(wxEvent& event); - - // add an event to be processed later - void AddPendingEvent(wxEvent& event); - - void ProcessPendingEvents(); - -#if wxUSE_THREADS - bool ProcessThreadEvent(wxEvent& event); -#endif - - // Dynamic association of a member function handler with the event handler, - // winid and event type - void Connect(int winid, - int lastId, - int eventType, - wxObjectEventFunction func, - wxObject *userData = (wxObject *) NULL, - wxEvtHandler *eventSink = (wxEvtHandler *) NULL); - - // Convenience function: take just one id - void Connect(int winid, - int eventType, - wxObjectEventFunction func, - wxObject *userData = (wxObject *) NULL, - wxEvtHandler *eventSink = (wxEvtHandler *) NULL) - { Connect(winid, wxID_ANY, eventType, func, userData, eventSink); } - - // Even more convenient: without id (same as using id of wxID_ANY) - void Connect(int eventType, - wxObjectEventFunction func, - wxObject *userData = (wxObject *) NULL, - wxEvtHandler *eventSink = (wxEvtHandler *) NULL) - { Connect(wxID_ANY, wxID_ANY, eventType, func, userData, eventSink); } - - bool Disconnect(int winid, - int lastId, - wxEventType eventType, - wxObjectEventFunction func = NULL, - wxObject *userData = (wxObject *) NULL, - wxEvtHandler *eventSink = (wxEvtHandler *) NULL); - - bool Disconnect(int winid = wxID_ANY, - wxEventType eventType = wxEVT_NULL, - wxObjectEventFunction func = NULL, - wxObject *userData = (wxObject *) NULL, - wxEvtHandler *eventSink = (wxEvtHandler *) NULL) - { return Disconnect(winid, wxID_ANY, eventType, func, userData, eventSink); } - - bool Disconnect(wxEventType eventType, - wxObjectEventFunction func, - wxObject *userData = (wxObject *) NULL, - wxEvtHandler *eventSink = (wxEvtHandler *) NULL) - { return Disconnect(wxID_ANY, eventType, func, userData, eventSink); } - - wxList* GetDynamicEventTable() const { return m_dynamicEvents ; } - - // User data can be associated with each wxEvtHandler - void SetClientObject( wxClientData *data ) { DoSetClientObject(data); } - wxClientData *GetClientObject() const { return DoGetClientObject(); } - - void SetClientData( void *data ) { DoSetClientData(data); } - void *GetClientData() const { return DoGetClientData(); } - - // check if the given event table entry matches this event and call the - // handler if it does - // - // return true if the event was processed, false otherwise (no match or the - // handler decided to skip the event) - static bool ProcessEventIfMatches(const wxEventTableEntryBase& tableEntry, - wxEvtHandler *handler, - wxEvent& event); - - // implementation from now on - virtual bool SearchEventTable(wxEventTable& table, wxEvent& event); - bool SearchDynamicEventTable( wxEvent& event ); - -#if wxUSE_THREADS - void ClearEventLocker(); -#endif // wxUSE_THREADS - - // Avoid problems at exit by cleaning up static hash table gracefully - void ClearEventHashTable() { GetEventHashTable().Clear(); } - -private: - static const wxEventTableEntry sm_eventTableEntries[]; - -protected: - // hooks for wxWindow used by ProcessEvent() - // ----------------------------------------- - - // This one is called before trying our own event table to allow plugging - // in the validators. - // - // NB: This method is intentionally *not* inside wxUSE_VALIDATORS! - // It is part of wxBase which doesn't use validators and the code - // is compiled out when building wxBase w/o GUI classes, which affects - // binary compatibility and wxBase library can't be used by GUI - // ports. - virtual bool TryValidator(wxEvent& WXUNUSED(event)) { return false; } - - // this one is called after failing to find the event handle in our own - // table to give a chance to the other windows to process it - // - // base class implementation passes the event to wxTheApp - virtual bool TryParent(wxEvent& event); - - - static const wxEventTable sm_eventTable; - virtual const wxEventTable *GetEventTable() const; - - static wxEventHashTable sm_eventHashTable; - virtual wxEventHashTable& GetEventHashTable() const; - - wxEvtHandler* m_nextHandler; - wxEvtHandler* m_previousHandler; - wxList* m_dynamicEvents; - wxList* m_pendingEvents; - -#if wxUSE_THREADS -#if defined (__VISAGECPP__) - const wxCriticalSection& Lock() const { return m_eventsLocker; } - wxCriticalSection& Lock() { return m_eventsLocker; } - - wxCriticalSection m_eventsLocker; -# else - const wxCriticalSection& Lock() const { return *m_eventsLocker; } - wxCriticalSection& Lock() { return *m_eventsLocker; } - - wxCriticalSection* m_eventsLocker; -# endif -#endif - - // Is event handler enabled? - bool m_enabled; - - - // The user data: either an object which will be deleted by the container - // when it's deleted or some raw pointer which we do nothing with - only - // one type of data can be used with the given window (i.e. you cannot set - // the void data and then associate the container with wxClientData or vice - // versa) - union - { - wxClientData *m_clientObject; - void *m_clientData; - }; - - // what kind of data do we have? - wxClientDataType m_clientDataType; - - // client data accessors - virtual void DoSetClientObject( wxClientData *data ); - virtual wxClientData *DoGetClientObject() const; - - virtual void DoSetClientData( void *data ); - virtual void *DoGetClientData() const; - -private: - DECLARE_DYNAMIC_CLASS_NO_COPY(wxEvtHandler) -}; - -// Post a message to the given eventhandler which will be processed during the -// next event loop iteration -inline void wxPostEvent(wxEvtHandler *dest, wxEvent& event) -{ - wxCHECK_RET( dest, wxT("need an object to post event to in wxPostEvent") ); - - dest->AddPendingEvent(event); -} - -typedef void (wxEvtHandler::*wxEventFunction)(wxEvent&); - -#define wxEventHandler(func) \ - (wxObjectEventFunction)wxStaticCastEvent(wxEventFunction, &func) - -#if wxUSE_GUI - -typedef void (wxEvtHandler::*wxCommandEventFunction)(wxCommandEvent&); -typedef void (wxEvtHandler::*wxScrollEventFunction)(wxScrollEvent&); -typedef void (wxEvtHandler::*wxScrollWinEventFunction)(wxScrollWinEvent&); -typedef void (wxEvtHandler::*wxSizeEventFunction)(wxSizeEvent&); -typedef void (wxEvtHandler::*wxMoveEventFunction)(wxMoveEvent&); -typedef void (wxEvtHandler::*wxPaintEventFunction)(wxPaintEvent&); -typedef void (wxEvtHandler::*wxNcPaintEventFunction)(wxNcPaintEvent&); -typedef void (wxEvtHandler::*wxEraseEventFunction)(wxEraseEvent&); -typedef void (wxEvtHandler::*wxMouseEventFunction)(wxMouseEvent&); -typedef void (wxEvtHandler::*wxCharEventFunction)(wxKeyEvent&); -typedef void (wxEvtHandler::*wxFocusEventFunction)(wxFocusEvent&); -typedef void (wxEvtHandler::*wxChildFocusEventFunction)(wxChildFocusEvent&); -typedef void (wxEvtHandler::*wxActivateEventFunction)(wxActivateEvent&); -typedef void (wxEvtHandler::*wxMenuEventFunction)(wxMenuEvent&); -typedef void (wxEvtHandler::*wxJoystickEventFunction)(wxJoystickEvent&); -typedef void (wxEvtHandler::*wxDropFilesEventFunction)(wxDropFilesEvent&); -typedef void (wxEvtHandler::*wxInitDialogEventFunction)(wxInitDialogEvent&); -typedef void (wxEvtHandler::*wxSysColourChangedEventFunction)(wxSysColourChangedEvent&); -typedef void (wxEvtHandler::*wxDisplayChangedEventFunction)(wxDisplayChangedEvent&); -typedef void (wxEvtHandler::*wxUpdateUIEventFunction)(wxUpdateUIEvent&); -typedef void (wxEvtHandler::*wxIdleEventFunction)(wxIdleEvent&); -typedef void (wxEvtHandler::*wxCloseEventFunction)(wxCloseEvent&); -typedef void (wxEvtHandler::*wxShowEventFunction)(wxShowEvent&); -typedef void (wxEvtHandler::*wxIconizeEventFunction)(wxIconizeEvent&); -typedef void (wxEvtHandler::*wxMaximizeEventFunction)(wxMaximizeEvent&); -typedef void (wxEvtHandler::*wxNavigationKeyEventFunction)(wxNavigationKeyEvent&); -typedef void (wxEvtHandler::*wxPaletteChangedEventFunction)(wxPaletteChangedEvent&); -typedef void (wxEvtHandler::*wxQueryNewPaletteEventFunction)(wxQueryNewPaletteEvent&); -typedef void (wxEvtHandler::*wxWindowCreateEventFunction)(wxWindowCreateEvent&); -typedef void (wxEvtHandler::*wxWindowDestroyEventFunction)(wxWindowDestroyEvent&); -typedef void (wxEvtHandler::*wxSetCursorEventFunction)(wxSetCursorEvent&); -typedef void (wxEvtHandler::*wxNotifyEventFunction)(wxNotifyEvent&); -typedef void (wxEvtHandler::*wxHelpEventFunction)(wxHelpEvent&); -typedef void (wxEvtHandler::*wxContextMenuEventFunction)(wxContextMenuEvent&); -typedef void (wxEvtHandler::*wxMouseCaptureChangedEventFunction)(wxMouseCaptureChangedEvent&); -typedef void (wxEvtHandler::*wxMouseCaptureLostEventFunction)(wxMouseCaptureLostEvent&); -typedef void (wxEvtHandler::*wxClipboardTextEventFunction)(wxClipboardTextEvent&); - -// these typedefs don't have the same name structure as the others, keep for -// backwards compatibility only -#if WXWIN_COMPATIBILITY_2_4 - typedef wxSysColourChangedEventFunction wxSysColourChangedFunction; - typedef wxDisplayChangedEventFunction wxDisplayChangedFunction; -#endif // WXWIN_COMPATIBILITY_2_4 - - -#define wxCommandEventHandler(func) \ - (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxCommandEventFunction, &func) -#define wxScrollEventHandler(func) \ - (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxScrollEventFunction, &func) -#define wxScrollWinEventHandler(func) \ - (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxScrollWinEventFunction, &func) -#define wxSizeEventHandler(func) \ - (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxSizeEventFunction, &func) -#define wxMoveEventHandler(func) \ - (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxMoveEventFunction, &func) -#define wxPaintEventHandler(func) \ - (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxPaintEventFunction, &func) -#define wxNcPaintEventHandler(func) \ - (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxNcPaintEventFunction, &func) -#define wxEraseEventHandler(func) \ - (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxEraseEventFunction, &func) -#define wxMouseEventHandler(func) \ - (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxMouseEventFunction, &func) -#define wxCharEventHandler(func) \ - (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxCharEventFunction, &func) -#define wxKeyEventHandler(func) wxCharEventHandler(func) -#define wxFocusEventHandler(func) \ - (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxFocusEventFunction, &func) -#define wxChildFocusEventHandler(func) \ - (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxChildFocusEventFunction, &func) -#define wxActivateEventHandler(func) \ - (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxActivateEventFunction, &func) -#define wxMenuEventHandler(func) \ - (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxMenuEventFunction, &func) -#define wxJoystickEventHandler(func) \ - (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxJoystickEventFunction, &func) -#define wxDropFilesEventHandler(func) \ - (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxDropFilesEventFunction, &func) -#define wxInitDialogEventHandler(func) \ - (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxInitDialogEventFunction, &func) -#define wxSysColourChangedEventHandler(func) \ - (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxSysColourChangedEventFunction, &func) -#define wxDisplayChangedEventHandler(func) \ - (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxDisplayChangedEventFunction, &func) -#define wxUpdateUIEventHandler(func) \ - (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxUpdateUIEventFunction, &func) -#define wxIdleEventHandler(func) \ - (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxIdleEventFunction, &func) -#define wxCloseEventHandler(func) \ - (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxCloseEventFunction, &func) -#define wxShowEventHandler(func) \ - (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxShowEventFunction, &func) -#define wxIconizeEventHandler(func) \ - (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxIconizeEventFunction, &func) -#define wxMaximizeEventHandler(func) \ - (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxMaximizeEventFunction, &func) -#define wxNavigationKeyEventHandler(func) \ - (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxNavigationKeyEventFunction, &func) -#define wxPaletteChangedEventHandler(func) \ - (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxPaletteChangedEventFunction, &func) -#define wxQueryNewPaletteEventHandler(func) \ - (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxQueryNewPaletteEventFunction, &func) -#define wxWindowCreateEventHandler(func) \ - (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxWindowCreateEventFunction, &func) -#define wxWindowDestroyEventHandler(func) \ - (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxWindowDestroyEventFunction, &func) -#define wxSetCursorEventHandler(func) \ - (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxSetCursorEventFunction, &func) -#define wxNotifyEventHandler(func) \ - (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxNotifyEventFunction, &func) -#define wxHelpEventHandler(func) \ - (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxHelpEventFunction, &func) -#define wxContextMenuEventHandler(func) \ - (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxContextMenuEventFunction, &func) -#define wxMouseCaptureChangedEventHandler(func) \ - (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxMouseCaptureChangedEventFunction, &func) -#define wxMouseCaptureLostEventHandler(func) \ - (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxMouseCaptureLostEventFunction, &func) -#define wxClipboardTextEventHandler(func) \ - (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxClipboardTextEventFunction, &func) - -#endif // wxUSE_GUI - -// N.B. In GNU-WIN32, you *have* to take the address of a member function -// (use &) or the compiler crashes... - -#define DECLARE_EVENT_TABLE() \ - private: \ - static const wxEventTableEntry sm_eventTableEntries[]; \ - protected: \ - static const wxEventTable sm_eventTable; \ - virtual const wxEventTable* GetEventTable() const; \ - static wxEventHashTable sm_eventHashTable; \ - virtual wxEventHashTable& GetEventHashTable() const; - -// N.B.: when building DLL with Borland C++ 5.5 compiler, you must initialize -// sm_eventTable before using it in GetEventTable() or the compiler gives -// E2233 (see http://groups.google.com/groups?selm=397dcc8a%241_2%40dnews) - -#define BEGIN_EVENT_TABLE(theClass, baseClass) \ - const wxEventTable theClass::sm_eventTable = \ - { &baseClass::sm_eventTable, &theClass::sm_eventTableEntries[0] }; \ - const wxEventTable *theClass::GetEventTable() const \ - { return &theClass::sm_eventTable; } \ - wxEventHashTable theClass::sm_eventHashTable(theClass::sm_eventTable); \ - wxEventHashTable &theClass::GetEventHashTable() const \ - { return theClass::sm_eventHashTable; } \ - const wxEventTableEntry theClass::sm_eventTableEntries[] = { \ - -#define BEGIN_EVENT_TABLE_TEMPLATE1(theClass, baseClass, T1) \ - template \ - const wxEventTable theClass::sm_eventTable = \ - { &baseClass::sm_eventTable, &theClass::sm_eventTableEntries[0] }; \ - template \ - const wxEventTable *theClass::GetEventTable() const \ - { return &theClass::sm_eventTable; } \ - template \ - wxEventHashTable theClass::sm_eventHashTable(theClass::sm_eventTable); \ - template \ - wxEventHashTable &theClass::GetEventHashTable() const \ - { return theClass::sm_eventHashTable; } \ - template \ - const wxEventTableEntry theClass::sm_eventTableEntries[] = { \ - -#define BEGIN_EVENT_TABLE_TEMPLATE2(theClass, baseClass, T1, T2) \ - template \ - const wxEventTable theClass::sm_eventTable = \ - { &baseClass::sm_eventTable, &theClass::sm_eventTableEntries[0] }; \ - template \ - const wxEventTable *theClass::GetEventTable() const \ - { return &theClass::sm_eventTable; } \ - template \ - wxEventHashTable theClass::sm_eventHashTable(theClass::sm_eventTable); \ - template \ - wxEventHashTable &theClass::GetEventHashTable() const \ - { return theClass::sm_eventHashTable; } \ - template \ - const wxEventTableEntry theClass::sm_eventTableEntries[] = { \ - -#define BEGIN_EVENT_TABLE_TEMPLATE3(theClass, baseClass, T1, T2, T3) \ - template \ - const wxEventTable theClass::sm_eventTable = \ - { &baseClass::sm_eventTable, &theClass::sm_eventTableEntries[0] }; \ - template \ - const wxEventTable *theClass::GetEventTable() const \ - { return &theClass::sm_eventTable; } \ - template \ - wxEventHashTable theClass::sm_eventHashTable(theClass::sm_eventTable); \ - template \ - wxEventHashTable &theClass::GetEventHashTable() const \ - { return theClass::sm_eventHashTable; } \ - template \ - const wxEventTableEntry theClass::sm_eventTableEntries[] = { \ - -#define BEGIN_EVENT_TABLE_TEMPLATE4(theClass, baseClass, T1, T2, T3, T4) \ - template \ - const wxEventTable theClass::sm_eventTable = \ - { &baseClass::sm_eventTable, &theClass::sm_eventTableEntries[0] }; \ - template \ - const wxEventTable *theClass::GetEventTable() const \ - { return &theClass::sm_eventTable; } \ - template \ - wxEventHashTable theClass::sm_eventHashTable(theClass::sm_eventTable); \ - template \ - wxEventHashTable &theClass::GetEventHashTable() const \ - { return theClass::sm_eventHashTable; } \ - template \ - const wxEventTableEntry theClass::sm_eventTableEntries[] = { \ - -#define BEGIN_EVENT_TABLE_TEMPLATE5(theClass, baseClass, T1, T2, T3, T4, T5) \ - template \ - const wxEventTable theClass::sm_eventTable = \ - { &baseClass::sm_eventTable, &theClass::sm_eventTableEntries[0] }; \ - template \ - const wxEventTable *theClass::GetEventTable() const \ - { return &theClass::sm_eventTable; } \ - template \ - wxEventHashTable theClass::sm_eventHashTable(theClass::sm_eventTable); \ - template \ - wxEventHashTable &theClass::GetEventHashTable() const \ - { return theClass::sm_eventHashTable; } \ - template \ - const wxEventTableEntry theClass::sm_eventTableEntries[] = { \ - -#define BEGIN_EVENT_TABLE_TEMPLATE7(theClass, baseClass, T1, T2, T3, T4, T5, T6, T7) \ - template \ - const wxEventTable theClass::sm_eventTable = \ - { &baseClass::sm_eventTable, &theClass::sm_eventTableEntries[0] }; \ - template \ - const wxEventTable *theClass::GetEventTable() const \ - { return &theClass::sm_eventTable; } \ - template \ - wxEventHashTable theClass::sm_eventHashTable(theClass::sm_eventTable); \ - template \ - wxEventHashTable &theClass::GetEventHashTable() const \ - { return theClass::sm_eventHashTable; } \ - template \ - const wxEventTableEntry theClass::sm_eventTableEntries[] = { \ - -#define BEGIN_EVENT_TABLE_TEMPLATE8(theClass, baseClass, T1, T2, T3, T4, T5, T6, T7, T8) \ - template \ - const wxEventTable theClass::sm_eventTable = \ - { &baseClass::sm_eventTable, &theClass::sm_eventTableEntries[0] }; \ - template \ - const wxEventTable *theClass::GetEventTable() const \ - { return &theClass::sm_eventTable; } \ - template \ - wxEventHashTable theClass::sm_eventHashTable(theClass::sm_eventTable); \ - template \ - wxEventHashTable &theClass::GetEventHashTable() const \ - { return theClass::sm_eventHashTable; } \ - template \ - const wxEventTableEntry theClass::sm_eventTableEntries[] = { \ - -#define END_EVENT_TABLE() DECLARE_EVENT_TABLE_ENTRY( wxEVT_NULL, 0, 0, 0, 0 ) }; - -/* - * Event table macros - */ - -// helpers for writing shorter code below: declare an event macro taking 2, 1 -// or none ids (the missing ids default to wxID_ANY) -// -// macro arguments: -// - evt one of wxEVT_XXX constants -// - id1, id2 ids of the first/last id -// - fn the function (should be cast to the right type) -#define wx__DECLARE_EVT2(evt, id1, id2, fn) \ - DECLARE_EVENT_TABLE_ENTRY(evt, id1, id2, fn, NULL), -#define wx__DECLARE_EVT1(evt, id, fn) \ - wx__DECLARE_EVT2(evt, id, wxID_ANY, fn) -#define wx__DECLARE_EVT0(evt, fn) \ - wx__DECLARE_EVT1(evt, wxID_ANY, fn) - - -// Generic events -#define EVT_CUSTOM(event, winid, func) \ - wx__DECLARE_EVT1(event, winid, wxEventHandler(func)) -#define EVT_CUSTOM_RANGE(event, id1, id2, func) \ - wx__DECLARE_EVT2(event, id1, id2, wxEventHandler(func)) - -// EVT_COMMAND -#define EVT_COMMAND(winid, event, func) \ - wx__DECLARE_EVT1(event, winid, wxCommandEventHandler(func)) -#define EVT_COMMAND_RANGE(id1, id2, event, func) \ - wx__DECLARE_EVT2(event, id1, id2, wxCommandEventHandler(func)) - -#define EVT_NOTIFY(event, winid, func) \ - wx__DECLARE_EVT1(event, winid, wxNotifyEventHandler(func)) -#define EVT_NOTIFY_RANGE(event, id1, id2, func) \ - wx__DECLARE_EVT2(event, id1, id2, wxNotifyEventHandler(func)) - -// Miscellaneous -#define EVT_SIZE(func) wx__DECLARE_EVT0(wxEVT_SIZE, wxSizeEventHandler(func)) -#define EVT_SIZING(func) wx__DECLARE_EVT0(wxEVT_SIZING, wxSizeEventHandler(func)) -#define EVT_MOVE(func) wx__DECLARE_EVT0(wxEVT_MOVE, wxMoveEventHandler(func)) -#define EVT_MOVING(func) wx__DECLARE_EVT0(wxEVT_MOVING, wxMoveEventHandler(func)) -#define EVT_CLOSE(func) wx__DECLARE_EVT0(wxEVT_CLOSE_WINDOW, wxCloseEventHandler(func)) -#define EVT_END_SESSION(func) wx__DECLARE_EVT0(wxEVT_END_SESSION, wxCloseEventHandler(func)) -#define EVT_QUERY_END_SESSION(func) wx__DECLARE_EVT0(wxEVT_QUERY_END_SESSION, wxCloseEventHandler(func)) -#define EVT_PAINT(func) wx__DECLARE_EVT0(wxEVT_PAINT, wxPaintEventHandler(func)) -#define EVT_NC_PAINT(func) wx__DECLARE_EVT0(wxEVT_NC_PAINT, wxNcPaintEventHandler(func)) -#define EVT_ERASE_BACKGROUND(func) wx__DECLARE_EVT0(wxEVT_ERASE_BACKGROUND, wxEraseEventHandler(func)) -#define EVT_CHAR(func) wx__DECLARE_EVT0(wxEVT_CHAR, wxCharEventHandler(func)) -#define EVT_KEY_DOWN(func) wx__DECLARE_EVT0(wxEVT_KEY_DOWN, wxKeyEventHandler(func)) -#define EVT_KEY_UP(func) wx__DECLARE_EVT0(wxEVT_KEY_UP, wxKeyEventHandler(func)) -#if wxUSE_HOTKEY -#define EVT_HOTKEY(winid, func) wx__DECLARE_EVT1(wxEVT_HOTKEY, winid, wxCharEventHandler(func)) -#endif -#define EVT_CHAR_HOOK(func) wx__DECLARE_EVT0(wxEVT_CHAR_HOOK, wxCharEventHandler(func)) -#define EVT_MENU_OPEN(func) wx__DECLARE_EVT0(wxEVT_MENU_OPEN, wxMenuEventHandler(func)) -#define EVT_MENU_CLOSE(func) wx__DECLARE_EVT0(wxEVT_MENU_CLOSE, wxMenuEventHandler(func)) -#define EVT_MENU_HIGHLIGHT(winid, func) wx__DECLARE_EVT1(wxEVT_MENU_HIGHLIGHT, winid, wxMenuEventHandler(func)) -#define EVT_MENU_HIGHLIGHT_ALL(func) wx__DECLARE_EVT0(wxEVT_MENU_HIGHLIGHT, wxMenuEventHandler(func)) -#define EVT_SET_FOCUS(func) wx__DECLARE_EVT0(wxEVT_SET_FOCUS, wxFocusEventHandler(func)) -#define EVT_KILL_FOCUS(func) wx__DECLARE_EVT0(wxEVT_KILL_FOCUS, wxFocusEventHandler(func)) -#define EVT_CHILD_FOCUS(func) wx__DECLARE_EVT0(wxEVT_CHILD_FOCUS, wxChildFocusEventHandler(func)) -#define EVT_ACTIVATE(func) wx__DECLARE_EVT0(wxEVT_ACTIVATE, wxActivateEventHandler(func)) -#define EVT_ACTIVATE_APP(func) wx__DECLARE_EVT0(wxEVT_ACTIVATE_APP, wxActivateEventHandler(func)) -#define EVT_HIBERNATE(func) wx__DECLARE_EVT0(wxEVT_HIBERNATE, wxActivateEventHandler(func)) -#define EVT_END_SESSION(func) wx__DECLARE_EVT0(wxEVT_END_SESSION, wxCloseEventHandler(func)) -#define EVT_QUERY_END_SESSION(func) wx__DECLARE_EVT0(wxEVT_QUERY_END_SESSION, wxCloseEventHandler(func)) -#define EVT_DROP_FILES(func) wx__DECLARE_EVT0(wxEVT_DROP_FILES, wxDropFilesEventHandler(func)) -#define EVT_INIT_DIALOG(func) wx__DECLARE_EVT0(wxEVT_INIT_DIALOG, wxInitDialogEventHandler(func)) -#define EVT_SYS_COLOUR_CHANGED(func) wx__DECLARE_EVT0(wxEVT_SYS_COLOUR_CHANGED, wxSysColourChangedEventHandler(func)) -#define EVT_DISPLAY_CHANGED(func) wx__DECLARE_EVT0(wxEVT_DISPLAY_CHANGED, wxDisplayChangedEventHandler(func)) -#define EVT_SHOW(func) wx__DECLARE_EVT0(wxEVT_SHOW, wxShowEventHandler(func)) -#define EVT_MAXIMIZE(func) wx__DECLARE_EVT0(wxEVT_MAXIMIZE, wxMaximizeEventHandler(func)) -#define EVT_ICONIZE(func) wx__DECLARE_EVT0(wxEVT_ICONIZE, wxIconizeEventHandler(func)) -#define EVT_NAVIGATION_KEY(func) wx__DECLARE_EVT0(wxEVT_NAVIGATION_KEY, wxNavigationKeyEventHandler(func)) -#define EVT_PALETTE_CHANGED(func) wx__DECLARE_EVT0(wxEVT_PALETTE_CHANGED, wxPaletteChangedEventHandler(func)) -#define EVT_QUERY_NEW_PALETTE(func) wx__DECLARE_EVT0(wxEVT_QUERY_NEW_PALETTE, wxQueryNewPaletteEventHandler(func)) -#define EVT_WINDOW_CREATE(func) wx__DECLARE_EVT0(wxEVT_CREATE, wxWindowCreateEventHandler(func)) -#define EVT_WINDOW_DESTROY(func) wx__DECLARE_EVT0(wxEVT_DESTROY, wxWindowDestroyEventHandler(func)) -#define EVT_SET_CURSOR(func) wx__DECLARE_EVT0(wxEVT_SET_CURSOR, wxSetCursorEventHandler(func)) -#define EVT_MOUSE_CAPTURE_CHANGED(func) wx__DECLARE_EVT0(wxEVT_MOUSE_CAPTURE_CHANGED, wxMouseCaptureChangedEventHandler(func)) -#define EVT_MOUSE_CAPTURE_LOST(func) wx__DECLARE_EVT0(wxEVT_MOUSE_CAPTURE_LOST, wxMouseCaptureLostEventHandler(func)) - -// Mouse events -#define EVT_LEFT_DOWN(func) wx__DECLARE_EVT0(wxEVT_LEFT_DOWN, wxMouseEventHandler(func)) -#define EVT_LEFT_UP(func) wx__DECLARE_EVT0(wxEVT_LEFT_UP, wxMouseEventHandler(func)) -#define EVT_MIDDLE_DOWN(func) wx__DECLARE_EVT0(wxEVT_MIDDLE_DOWN, wxMouseEventHandler(func)) -#define EVT_MIDDLE_UP(func) wx__DECLARE_EVT0(wxEVT_MIDDLE_UP, wxMouseEventHandler(func)) -#define EVT_RIGHT_DOWN(func) wx__DECLARE_EVT0(wxEVT_RIGHT_DOWN, wxMouseEventHandler(func)) -#define EVT_RIGHT_UP(func) wx__DECLARE_EVT0(wxEVT_RIGHT_UP, wxMouseEventHandler(func)) -#define EVT_MOTION(func) wx__DECLARE_EVT0(wxEVT_MOTION, wxMouseEventHandler(func)) -#define EVT_LEFT_DCLICK(func) wx__DECLARE_EVT0(wxEVT_LEFT_DCLICK, wxMouseEventHandler(func)) -#define EVT_MIDDLE_DCLICK(func) wx__DECLARE_EVT0(wxEVT_MIDDLE_DCLICK, wxMouseEventHandler(func)) -#define EVT_RIGHT_DCLICK(func) wx__DECLARE_EVT0(wxEVT_RIGHT_DCLICK, wxMouseEventHandler(func)) -#define EVT_LEAVE_WINDOW(func) wx__DECLARE_EVT0(wxEVT_LEAVE_WINDOW, wxMouseEventHandler(func)) -#define EVT_ENTER_WINDOW(func) wx__DECLARE_EVT0(wxEVT_ENTER_WINDOW, wxMouseEventHandler(func)) -#define EVT_MOUSEWHEEL(func) wx__DECLARE_EVT0(wxEVT_MOUSEWHEEL, wxMouseEventHandler(func)) - -// All mouse events -#define EVT_MOUSE_EVENTS(func) \ - EVT_LEFT_DOWN(func) \ - EVT_LEFT_UP(func) \ - EVT_MIDDLE_DOWN(func) \ - EVT_MIDDLE_UP(func) \ - EVT_RIGHT_DOWN(func) \ - EVT_RIGHT_UP(func) \ - EVT_MOTION(func) \ - EVT_LEFT_DCLICK(func) \ - EVT_MIDDLE_DCLICK(func) \ - EVT_RIGHT_DCLICK(func) \ - EVT_LEAVE_WINDOW(func) \ - EVT_ENTER_WINDOW(func) \ - EVT_MOUSEWHEEL(func) - -// Scrolling from wxWindow (sent to wxScrolledWindow) -#define EVT_SCROLLWIN_TOP(func) wx__DECLARE_EVT0(wxEVT_SCROLLWIN_TOP, wxScrollWinEventHandler(func)) -#define EVT_SCROLLWIN_BOTTOM(func) wx__DECLARE_EVT0(wxEVT_SCROLLWIN_BOTTOM, wxScrollWinEventHandler(func)) -#define EVT_SCROLLWIN_LINEUP(func) wx__DECLARE_EVT0(wxEVT_SCROLLWIN_LINEUP, wxScrollWinEventHandler(func)) -#define EVT_SCROLLWIN_LINEDOWN(func) wx__DECLARE_EVT0(wxEVT_SCROLLWIN_LINEDOWN, wxScrollWinEventHandler(func)) -#define EVT_SCROLLWIN_PAGEUP(func) wx__DECLARE_EVT0(wxEVT_SCROLLWIN_PAGEUP, wxScrollWinEventHandler(func)) -#define EVT_SCROLLWIN_PAGEDOWN(func) wx__DECLARE_EVT0(wxEVT_SCROLLWIN_PAGEDOWN, wxScrollWinEventHandler(func)) -#define EVT_SCROLLWIN_THUMBTRACK(func) wx__DECLARE_EVT0(wxEVT_SCROLLWIN_THUMBTRACK, wxScrollWinEventHandler(func)) -#define EVT_SCROLLWIN_THUMBRELEASE(func) wx__DECLARE_EVT0(wxEVT_SCROLLWIN_THUMBRELEASE, wxScrollWinEventHandler(func)) - -#define EVT_SCROLLWIN(func) \ - EVT_SCROLLWIN_TOP(func) \ - EVT_SCROLLWIN_BOTTOM(func) \ - EVT_SCROLLWIN_LINEUP(func) \ - EVT_SCROLLWIN_LINEDOWN(func) \ - EVT_SCROLLWIN_PAGEUP(func) \ - EVT_SCROLLWIN_PAGEDOWN(func) \ - EVT_SCROLLWIN_THUMBTRACK(func) \ - EVT_SCROLLWIN_THUMBRELEASE(func) - -// Scrolling from wxSlider and wxScrollBar -#define EVT_SCROLL_TOP(func) wx__DECLARE_EVT0(wxEVT_SCROLL_TOP, wxScrollEventHandler(func)) -#define EVT_SCROLL_BOTTOM(func) wx__DECLARE_EVT0(wxEVT_SCROLL_BOTTOM, wxScrollEventHandler(func)) -#define EVT_SCROLL_LINEUP(func) wx__DECLARE_EVT0(wxEVT_SCROLL_LINEUP, wxScrollEventHandler(func)) -#define EVT_SCROLL_LINEDOWN(func) wx__DECLARE_EVT0(wxEVT_SCROLL_LINEDOWN, wxScrollEventHandler(func)) -#define EVT_SCROLL_PAGEUP(func) wx__DECLARE_EVT0(wxEVT_SCROLL_PAGEUP, wxScrollEventHandler(func)) -#define EVT_SCROLL_PAGEDOWN(func) wx__DECLARE_EVT0(wxEVT_SCROLL_PAGEDOWN, wxScrollEventHandler(func)) -#define EVT_SCROLL_THUMBTRACK(func) wx__DECLARE_EVT0(wxEVT_SCROLL_THUMBTRACK, wxScrollEventHandler(func)) -#define EVT_SCROLL_THUMBRELEASE(func) wx__DECLARE_EVT0(wxEVT_SCROLL_THUMBRELEASE, wxScrollEventHandler(func)) -#define EVT_SCROLL_CHANGED(func) wx__DECLARE_EVT0(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(func)) - -#define EVT_SCROLL(func) \ - EVT_SCROLL_TOP(func) \ - EVT_SCROLL_BOTTOM(func) \ - EVT_SCROLL_LINEUP(func) \ - EVT_SCROLL_LINEDOWN(func) \ - EVT_SCROLL_PAGEUP(func) \ - EVT_SCROLL_PAGEDOWN(func) \ - EVT_SCROLL_THUMBTRACK(func) \ - EVT_SCROLL_THUMBRELEASE(func) \ - EVT_SCROLL_CHANGED(func) - -// Scrolling from wxSlider and wxScrollBar, with an id -#define EVT_COMMAND_SCROLL_TOP(winid, func) wx__DECLARE_EVT1(wxEVT_SCROLL_TOP, winid, wxScrollEventHandler(func)) -#define EVT_COMMAND_SCROLL_BOTTOM(winid, func) wx__DECLARE_EVT1(wxEVT_SCROLL_BOTTOM, winid, wxScrollEventHandler(func)) -#define EVT_COMMAND_SCROLL_LINEUP(winid, func) wx__DECLARE_EVT1(wxEVT_SCROLL_LINEUP, winid, wxScrollEventHandler(func)) -#define EVT_COMMAND_SCROLL_LINEDOWN(winid, func) wx__DECLARE_EVT1(wxEVT_SCROLL_LINEDOWN, winid, wxScrollEventHandler(func)) -#define EVT_COMMAND_SCROLL_PAGEUP(winid, func) wx__DECLARE_EVT1(wxEVT_SCROLL_PAGEUP, winid, wxScrollEventHandler(func)) -#define EVT_COMMAND_SCROLL_PAGEDOWN(winid, func) wx__DECLARE_EVT1(wxEVT_SCROLL_PAGEDOWN, winid, wxScrollEventHandler(func)) -#define EVT_COMMAND_SCROLL_THUMBTRACK(winid, func) wx__DECLARE_EVT1(wxEVT_SCROLL_THUMBTRACK, winid, wxScrollEventHandler(func)) -#define EVT_COMMAND_SCROLL_THUMBRELEASE(winid, func) wx__DECLARE_EVT1(wxEVT_SCROLL_THUMBRELEASE, winid, wxScrollEventHandler(func)) -#define EVT_COMMAND_SCROLL_CHANGED(winid, func) wx__DECLARE_EVT1(wxEVT_SCROLL_CHANGED, winid, wxScrollEventHandler(func)) - -#define EVT_COMMAND_SCROLL(winid, func) \ - EVT_COMMAND_SCROLL_TOP(winid, func) \ - EVT_COMMAND_SCROLL_BOTTOM(winid, func) \ - EVT_COMMAND_SCROLL_LINEUP(winid, func) \ - EVT_COMMAND_SCROLL_LINEDOWN(winid, func) \ - EVT_COMMAND_SCROLL_PAGEUP(winid, func) \ - EVT_COMMAND_SCROLL_PAGEDOWN(winid, func) \ - EVT_COMMAND_SCROLL_THUMBTRACK(winid, func) \ - EVT_COMMAND_SCROLL_THUMBRELEASE(winid, func) \ - EVT_COMMAND_SCROLL_CHANGED(winid, func) - -#if WXWIN_COMPATIBILITY_2_6 - // compatibility macros for the old name, deprecated in 2.8 - #define wxEVT_SCROLL_ENDSCROLL wxEVT_SCROLL_CHANGED - #define EVT_COMMAND_SCROLL_ENDSCROLL EVT_COMMAND_SCROLL_CHANGED - #define EVT_SCROLL_ENDSCROLL EVT_SCROLL_CHANGED -#endif // WXWIN_COMPATIBILITY_2_6 - -// Convenience macros for commonly-used commands -#define EVT_CHECKBOX(winid, func) wx__DECLARE_EVT1(wxEVT_COMMAND_CHECKBOX_CLICKED, winid, wxCommandEventHandler(func)) -#define EVT_CHOICE(winid, func) wx__DECLARE_EVT1(wxEVT_COMMAND_CHOICE_SELECTED, winid, wxCommandEventHandler(func)) -#define EVT_LISTBOX(winid, func) wx__DECLARE_EVT1(wxEVT_COMMAND_LISTBOX_SELECTED, winid, wxCommandEventHandler(func)) -#define EVT_LISTBOX_DCLICK(winid, func) wx__DECLARE_EVT1(wxEVT_COMMAND_LISTBOX_DOUBLECLICKED, winid, wxCommandEventHandler(func)) -#define EVT_MENU(winid, func) wx__DECLARE_EVT1(wxEVT_COMMAND_MENU_SELECTED, winid, wxCommandEventHandler(func)) -#define EVT_MENU_RANGE(id1, id2, func) wx__DECLARE_EVT2(wxEVT_COMMAND_MENU_SELECTED, id1, id2, wxCommandEventHandler(func)) -#if defined(__SMARTPHONE__) -# define EVT_BUTTON(winid, func) EVT_MENU(winid, func) -#else -# define EVT_BUTTON(winid, func) wx__DECLARE_EVT1(wxEVT_COMMAND_BUTTON_CLICKED, winid, wxCommandEventHandler(func)) -#endif -#define EVT_SLIDER(winid, func) wx__DECLARE_EVT1(wxEVT_COMMAND_SLIDER_UPDATED, winid, wxCommandEventHandler(func)) -#define EVT_RADIOBOX(winid, func) wx__DECLARE_EVT1(wxEVT_COMMAND_RADIOBOX_SELECTED, winid, wxCommandEventHandler(func)) -#define EVT_RADIOBUTTON(winid, func) wx__DECLARE_EVT1(wxEVT_COMMAND_RADIOBUTTON_SELECTED, winid, wxCommandEventHandler(func)) -// EVT_SCROLLBAR is now obsolete since we use EVT_COMMAND_SCROLL... events -#define EVT_SCROLLBAR(winid, func) wx__DECLARE_EVT1(wxEVT_COMMAND_SCROLLBAR_UPDATED, winid, wxCommandEventHandler(func)) -#define EVT_VLBOX(winid, func) wx__DECLARE_EVT1(wxEVT_COMMAND_VLBOX_SELECTED, winid, wxCommandEventHandler(func)) -#define EVT_COMBOBOX(winid, func) wx__DECLARE_EVT1(wxEVT_COMMAND_COMBOBOX_SELECTED, winid, wxCommandEventHandler(func)) -#define EVT_TOOL(winid, func) wx__DECLARE_EVT1(wxEVT_COMMAND_TOOL_CLICKED, winid, wxCommandEventHandler(func)) -#define EVT_TOOL_RANGE(id1, id2, func) wx__DECLARE_EVT2(wxEVT_COMMAND_TOOL_CLICKED, id1, id2, wxCommandEventHandler(func)) -#define EVT_TOOL_RCLICKED(winid, func) wx__DECLARE_EVT1(wxEVT_COMMAND_TOOL_RCLICKED, winid, wxCommandEventHandler(func)) -#define EVT_TOOL_RCLICKED_RANGE(id1, id2, func) wx__DECLARE_EVT2(wxEVT_COMMAND_TOOL_RCLICKED, id1, id2, wxCommandEventHandler(func)) -#define EVT_TOOL_ENTER(winid, func) wx__DECLARE_EVT1(wxEVT_COMMAND_TOOL_ENTER, winid, wxCommandEventHandler(func)) -#define EVT_CHECKLISTBOX(winid, func) wx__DECLARE_EVT1(wxEVT_COMMAND_CHECKLISTBOX_TOGGLED, winid, wxCommandEventHandler(func)) - -// Generic command events -#define EVT_COMMAND_LEFT_CLICK(winid, func) wx__DECLARE_EVT1(wxEVT_COMMAND_LEFT_CLICK, winid, wxCommandEventHandler(func)) -#define EVT_COMMAND_LEFT_DCLICK(winid, func) wx__DECLARE_EVT1(wxEVT_COMMAND_LEFT_DCLICK, winid, wxCommandEventHandler(func)) -#define EVT_COMMAND_RIGHT_CLICK(winid, func) wx__DECLARE_EVT1(wxEVT_COMMAND_RIGHT_CLICK, winid, wxCommandEventHandler(func)) -#define EVT_COMMAND_RIGHT_DCLICK(winid, func) wx__DECLARE_EVT1(wxEVT_COMMAND_RIGHT_DCLICK, winid, wxCommandEventHandler(func)) -#define EVT_COMMAND_SET_FOCUS(winid, func) wx__DECLARE_EVT1(wxEVT_COMMAND_SET_FOCUS, winid, wxCommandEventHandler(func)) -#define EVT_COMMAND_KILL_FOCUS(winid, func) wx__DECLARE_EVT1(wxEVT_COMMAND_KILL_FOCUS, winid, wxCommandEventHandler(func)) -#define EVT_COMMAND_ENTER(winid, func) wx__DECLARE_EVT1(wxEVT_COMMAND_ENTER, winid, wxCommandEventHandler(func)) - -// Joystick events - -#define EVT_JOY_BUTTON_DOWN(func) wx__DECLARE_EVT0(wxEVT_JOY_BUTTON_DOWN, wxJoystickEventHandler(func)) -#define EVT_JOY_BUTTON_UP(func) wx__DECLARE_EVT0(wxEVT_JOY_BUTTON_UP, wxJoystickEventHandler(func)) -#define EVT_JOY_MOVE(func) wx__DECLARE_EVT0(wxEVT_JOY_MOVE, wxJoystickEventHandler(func)) -#define EVT_JOY_ZMOVE(func) wx__DECLARE_EVT0(wxEVT_JOY_ZMOVE, wxJoystickEventHandler(func)) - -// These are obsolete, see _BUTTON_ events -#if WXWIN_COMPATIBILITY_2_4 - #define EVT_JOY_DOWN(func) EVT_JOY_BUTTON_DOWN(func) - #define EVT_JOY_UP(func) EVT_JOY_BUTTON_UP(func) -#endif // WXWIN_COMPATIBILITY_2_4 - -// All joystick events -#define EVT_JOYSTICK_EVENTS(func) \ - EVT_JOY_BUTTON_DOWN(func) \ - EVT_JOY_BUTTON_UP(func) \ - EVT_JOY_MOVE(func) \ - EVT_JOY_ZMOVE(func) - -// Idle event -#define EVT_IDLE(func) wx__DECLARE_EVT0(wxEVT_IDLE, wxIdleEventHandler(func)) - -// Update UI event -#define EVT_UPDATE_UI(winid, func) wx__DECLARE_EVT1(wxEVT_UPDATE_UI, winid, wxUpdateUIEventHandler(func)) -#define EVT_UPDATE_UI_RANGE(id1, id2, func) wx__DECLARE_EVT2(wxEVT_UPDATE_UI, id1, id2, wxUpdateUIEventHandler(func)) - -// Help events -#define EVT_HELP(winid, func) wx__DECLARE_EVT1(wxEVT_HELP, winid, wxHelpEventHandler(func)) -#define EVT_HELP_RANGE(id1, id2, func) wx__DECLARE_EVT2(wxEVT_HELP, id1, id2, wxHelpEventHandler(func)) -#define EVT_DETAILED_HELP(winid, func) wx__DECLARE_EVT1(wxEVT_DETAILED_HELP, winid, wxHelpEventHandler(func)) -#define EVT_DETAILED_HELP_RANGE(id1, id2, func) wx__DECLARE_EVT2(wxEVT_DETAILED_HELP, id1, id2, wxHelpEventHandler(func)) - -// Context Menu Events -#define EVT_CONTEXT_MENU(func) wx__DECLARE_EVT0(wxEVT_CONTEXT_MENU, wxContextMenuEventHandler(func)) -#define EVT_COMMAND_CONTEXT_MENU(winid, func) wx__DECLARE_EVT1(wxEVT_CONTEXT_MENU, winid, wxContextMenuEventHandler(func)) - -// Clipboard text Events -#define EVT_TEXT_CUT(winid, func) wx__DECLARE_EVT1(wxEVT_COMMAND_TEXT_CUT, winid, wxClipboardTextEventHandler(func)) -#define EVT_TEXT_COPY(winid, func) wx__DECLARE_EVT1(wxEVT_COMMAND_TEXT_COPY, winid, wxClipboardTextEventHandler(func)) -#define EVT_TEXT_PASTE(winid, func) wx__DECLARE_EVT1(wxEVT_COMMAND_TEXT_PASTE, winid, wxClipboardTextEventHandler(func)) - -// ---------------------------------------------------------------------------- -// Global data -// ---------------------------------------------------------------------------- - -// for pending event processing - notice that there is intentionally no -// WXDLLEXPORT here -extern WXDLLIMPEXP_BASE wxList *wxPendingEvents; -#if wxUSE_THREADS - extern WXDLLIMPEXP_BASE wxCriticalSection *wxPendingEventsLocker; -#endif - -// ---------------------------------------------------------------------------- -// Helper functions -// ---------------------------------------------------------------------------- - -#if wxUSE_GUI - -// Find a window with the focus, that is also a descendant of the given window. -// This is used to determine the window to initially send commands to. -WXDLLIMPEXP_CORE wxWindow* wxFindFocusDescendant(wxWindow* ancestor); - -#endif // wxUSE_GUI - -#endif // _WX_EVENT_H__ diff --git a/wxWidgets/include/wx/evtloop.h b/wxWidgets/include/wx/evtloop.h deleted file mode 100644 index 51b58eb55e..0000000000 --- a/wxWidgets/include/wx/evtloop.h +++ /dev/null @@ -1,229 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: wx/evtloop.h -// Purpose: declares wxEventLoop class -// Author: Vadim Zeitlin -// Modified by: -// Created: 01.06.01 -// RCS-ID: $Id: evtloop.h 53607 2008-05-16 15:21:40Z SN $ -// Copyright: (c) 2001 Vadim Zeitlin -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_EVTLOOP_H_ -#define _WX_EVTLOOP_H_ - -#include "wx/utils.h" - -class WXDLLIMPEXP_FWD_CORE wxEventLoop; - -// ---------------------------------------------------------------------------- -// wxEventLoop: a GUI event loop -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxEventLoopBase -{ -public: - // trivial, but needed (because of wxEventLoopBase) ctor - wxEventLoopBase() { } - - // dtor - virtual ~wxEventLoopBase() { } - - // start the event loop, return the exit code when it is finished - virtual int Run() = 0; - - // exit from the loop with the given exit code - virtual void Exit(int rc = 0) = 0; - - // return true if any events are available - virtual bool Pending() const = 0; - - // dispatch a single event, return false if we should exit from the loop - virtual bool Dispatch() = 0; - - // return currently active (running) event loop, may be NULL - static wxEventLoop *GetActive() { return ms_activeLoop; } - - // set currently active (running) event loop - static void SetActive(wxEventLoop* loop) { ms_activeLoop = loop; } - - // is this event loop running now? - // - // notice that even if this event loop hasn't terminated yet but has just - // spawned a nested (e.g. modal) event loop, this would return false - bool IsRunning() const; - -protected: - // this function should be called before the event loop terminates, whether - // this happens normally (because of Exit() call) or abnormally (because of - // an exception thrown from inside the loop) - virtual void OnExit() { } - - - // the pointer to currently active loop - static wxEventLoop *ms_activeLoop; - - DECLARE_NO_COPY_CLASS(wxEventLoopBase) -}; - -#if defined(__WXMSW__) || defined(__WXMAC__) || defined(__WXDFB__) - -// this class can be used to implement a standard event loop logic using -// Pending() and Dispatch() -// -// it also handles idle processing automatically -class WXDLLEXPORT wxEventLoopManual : public wxEventLoopBase -{ -public: - wxEventLoopManual(); - - // enters a loop calling OnNextIteration(), Pending() and Dispatch() and - // terminating when Exit() is called - virtual int Run(); - - // sets the "should exit" flag and wakes up the loop so that it terminates - // soon - virtual void Exit(int rc = 0); - -protected: - // implement this to wake up the loop: usually done by posting a dummy event - // to it (called from Exit()) - virtual void WakeUp() = 0; - - // may be overridden to perform some action at the start of each new event - // loop iteration - virtual void OnNextIteration() { } - - - // the loop exit code - int m_exitcode; - - // should we exit the loop? - bool m_shouldExit; -}; - -#endif // platforms using "manual" loop - -// we're moving away from old m_impl wxEventLoop model as otherwise the user -// code doesn't have access to platform-specific wxEventLoop methods and this -// can sometimes be very useful (e.g. under MSW this is necessary for -// integration with MFC) but currently this is done for MSW only, other ports -// should follow a.s.a.p. -#if defined(__WXPALMOS__) - #include "wx/palmos/evtloop.h" -#elif defined(__WXMSW__) - #include "wx/msw/evtloop.h" -#elif defined(__WXMAC__) - #include "wx/mac/evtloop.h" -#elif defined(__WXDFB__) - #include "wx/dfb/evtloop.h" -#else // other platform - -class WXDLLEXPORT wxEventLoopImpl; - -class WXDLLEXPORT wxEventLoop : public wxEventLoopBase -{ -public: - wxEventLoop() { m_impl = NULL; } - virtual ~wxEventLoop(); - - virtual int Run(); - virtual void Exit(int rc = 0); - virtual bool Pending() const; - virtual bool Dispatch(); - -protected: - // the pointer to the port specific implementation class - wxEventLoopImpl *m_impl; - - DECLARE_NO_COPY_CLASS(wxEventLoop) -}; - -#endif // platforms - -inline bool wxEventLoopBase::IsRunning() const { return GetActive() == this; } - -// ---------------------------------------------------------------------------- -// wxModalEventLoop -// ---------------------------------------------------------------------------- - -// this is a naive generic implementation which uses wxWindowDisabler to -// implement modality, we will surely need platform-specific implementations -// too, this generic implementation is here only temporarily to see how it -// works -class WXDLLEXPORT wxModalEventLoop : public wxEventLoop -{ -public: - wxModalEventLoop(wxWindow *winModal) - { - m_windowDisabler = new wxWindowDisabler(winModal); - } - -protected: - virtual void OnExit() - { - delete m_windowDisabler; - m_windowDisabler = NULL; - - wxEventLoop::OnExit(); - } - -private: - wxWindowDisabler *m_windowDisabler; -}; - -// ---------------------------------------------------------------------------- -// wxEventLoopActivator: helper class for wxEventLoop implementations -// ---------------------------------------------------------------------------- - -// this object sets the wxEventLoop given to the ctor as the currently active -// one and unsets it in its dtor, this is especially useful in presence of -// exceptions but is more tidy even when we don't use them -class wxEventLoopActivator -{ -public: - wxEventLoopActivator(wxEventLoop *evtLoop) - { - m_evtLoopOld = wxEventLoop::GetActive(); - wxEventLoop::SetActive(evtLoop); - } - - ~wxEventLoopActivator() - { - // restore the previously active event loop - wxEventLoop::SetActive(m_evtLoopOld); - } - -private: - wxEventLoop *m_evtLoopOld; -}; - -#if wxABI_VERSION >= 20808 -class wxEventLoopGuarantor -{ -public: - wxEventLoopGuarantor() - { - m_evtLoopNew = NULL; - if (!wxEventLoop::GetActive()) - { - m_evtLoopNew = new wxEventLoop; - wxEventLoop::SetActive(m_evtLoopNew); - } - } - - ~wxEventLoopGuarantor() - { - if (m_evtLoopNew) - { - wxEventLoop::SetActive(NULL); - delete m_evtLoopNew; - } - } - -private: - wxEventLoop *m_evtLoopNew; -}; -#endif // wxABI_VERSION >= 20805 - -#endif // _WX_EVTLOOP_H_ diff --git a/wxWidgets/include/wx/except.h b/wxWidgets/include/wx/except.h deleted file mode 100644 index 9276db65ba..0000000000 --- a/wxWidgets/include/wx/except.h +++ /dev/null @@ -1,30 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: wx/except.h -// Purpose: C++ exception related stuff -// Author: Vadim Zeitlin -// Modified by: -// Created: 17.09.2003 -// RCS-ID: $Id: except.h 27408 2004-05-23 20:53:33Z JS $ -// Copyright: (c) 2003 Vadim Zeitlin -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_EXCEPT_H_ -#define _WX_EXCEPT_H_ - -#include "wx/defs.h" - -// ---------------------------------------------------------------------------- -// macros working whether wxUSE_EXCEPTIONS is 0 or 1 -// ---------------------------------------------------------------------------- - -#if wxUSE_EXCEPTIONS - #define wxTRY try - #define wxCATCH_ALL(code) catch ( ... ) { code } -#else // !wxUSE_EXCEPTIONS - #define wxTRY - #define wxCATCH_ALL(code) -#endif // wxUSE_EXCEPTIONS/!wxUSE_EXCEPTIONS - -#endif // _WX_EXCEPT_H_ - diff --git a/wxWidgets/include/wx/fdrepdlg.h b/wxWidgets/include/wx/fdrepdlg.h deleted file mode 100644 index 43e8c4cef4..0000000000 --- a/wxWidgets/include/wx/fdrepdlg.h +++ /dev/null @@ -1,195 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/fdrepdlg.h -// Purpose: wxFindReplaceDialog class -// Author: Markus Greither and Vadim Zeitlin -// Modified by: -// Created: 23/03/2001 -// RCS-ID: -// Copyright: (c) Markus Greither -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_FINDREPLACEDLG_H_ -#define _WX_FINDREPLACEDLG_H_ - -#include "wx/defs.h" - -#if wxUSE_FINDREPLDLG - -#include "wx/dialog.h" - -class WXDLLIMPEXP_FWD_CORE wxFindDialogEvent; -class WXDLLIMPEXP_FWD_CORE wxFindReplaceDialog; -class WXDLLIMPEXP_FWD_CORE wxFindReplaceData; -class WXDLLIMPEXP_FWD_CORE wxFindReplaceDialogImpl; - -// ---------------------------------------------------------------------------- -// Flags for wxFindReplaceData.Flags -// ---------------------------------------------------------------------------- - -// flages used by wxFindDialogEvent::GetFlags() -enum wxFindReplaceFlags -{ - // downward search/replace selected (otherwise - upwards) - wxFR_DOWN = 1, - - // whole word search/replace selected - wxFR_WHOLEWORD = 2, - - // case sensitive search/replace selected (otherwise - case insensitive) - wxFR_MATCHCASE = 4 -}; - -// these flags can be specified in wxFindReplaceDialog ctor or Create() -enum wxFindReplaceDialogStyles -{ - // replace dialog (otherwise find dialog) - wxFR_REPLACEDIALOG = 1, - - // don't allow changing the search direction - wxFR_NOUPDOWN = 2, - - // don't allow case sensitive searching - wxFR_NOMATCHCASE = 4, - - // don't allow whole word searching - wxFR_NOWHOLEWORD = 8 -}; - -// ---------------------------------------------------------------------------- -// wxFindReplaceData: holds Setup Data/Feedback Data for wxFindReplaceDialog -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxFindReplaceData : public wxObject -{ -public: - wxFindReplaceData() { Init(); } - wxFindReplaceData(wxUint32 flags) { Init(); SetFlags(flags); } - - // accessors - const wxString& GetFindString() { return m_FindWhat; } - const wxString& GetReplaceString() { return m_ReplaceWith; } - - int GetFlags() const { return m_Flags; } - - // setters: may only be called before showing the dialog, no effect later - void SetFlags(wxUint32 flags) { m_Flags = flags; } - - void SetFindString(const wxString& str) { m_FindWhat = str; } - void SetReplaceString(const wxString& str) { m_ReplaceWith = str; } - -protected: - void Init(); - -private: - wxUint32 m_Flags; - wxString m_FindWhat, - m_ReplaceWith; - - friend class wxFindReplaceDialogBase; -}; - -// ---------------------------------------------------------------------------- -// wxFindReplaceDialogBase -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxFindReplaceDialogBase : public wxDialog -{ -public: - // ctors and such - wxFindReplaceDialogBase() { m_FindReplaceData = NULL; } - wxFindReplaceDialogBase(wxWindow * WXUNUSED(parent), - wxFindReplaceData *data, - const wxString& WXUNUSED(title), - int WXUNUSED(style) = 0) - { - m_FindReplaceData = data; - } - - virtual ~wxFindReplaceDialogBase(); - - // find dialog data access - const wxFindReplaceData *GetData() const { return m_FindReplaceData; } - void SetData(wxFindReplaceData *data) { m_FindReplaceData = data; } - - // implementation only, don't use - void Send(wxFindDialogEvent& event); - -protected: - wxFindReplaceData *m_FindReplaceData; - - // the last string we searched for - wxString m_lastSearch; - - DECLARE_NO_COPY_CLASS(wxFindReplaceDialogBase) -}; - -// include wxFindReplaceDialog declaration -#if defined(__WXMSW__) && !defined(__WXUNIVERSAL__) && !defined(__WXWINCE__) - #include "wx/msw/fdrepdlg.h" -#else - #define wxGenericFindReplaceDialog wxFindReplaceDialog - - #include "wx/generic/fdrepdlg.h" -#endif - -// ---------------------------------------------------------------------------- -// wxFindReplaceDialog events -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxFindDialogEvent : public wxCommandEvent -{ -public: - wxFindDialogEvent(wxEventType commandType = wxEVT_NULL, int id = 0) - : wxCommandEvent(commandType, id) { } - - int GetFlags() const { return GetInt(); } - wxString GetFindString() const { return GetString(); } - const wxString& GetReplaceString() const { return m_strReplace; } - - wxFindReplaceDialog *GetDialog() const - { return wxStaticCast(GetEventObject(), wxFindReplaceDialog); } - - // implementation only - void SetFlags(int flags) { SetInt(flags); } - void SetFindString(const wxString& str) { SetString(str); } - void SetReplaceString(const wxString& str) { m_strReplace = str; } - -private: - wxString m_strReplace; - - DECLARE_DYNAMIC_CLASS_NO_COPY(wxFindDialogEvent) -}; - -BEGIN_DECLARE_EVENT_TYPES() - DECLARE_EVENT_TYPE(wxEVT_COMMAND_FIND, 510) - DECLARE_EVENT_TYPE(wxEVT_COMMAND_FIND_NEXT, 511) - DECLARE_EVENT_TYPE(wxEVT_COMMAND_FIND_REPLACE, 512) - DECLARE_EVENT_TYPE(wxEVT_COMMAND_FIND_REPLACE_ALL, 513) - DECLARE_EVENT_TYPE(wxEVT_COMMAND_FIND_CLOSE, 514) -END_DECLARE_EVENT_TYPES() - -typedef void (wxEvtHandler::*wxFindDialogEventFunction)(wxFindDialogEvent&); - -#define wxFindDialogEventHandler(func) \ - (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxFindDialogEventFunction, &func) - -#define EVT_FIND(id, fn) \ - wx__DECLARE_EVT1(wxEVT_COMMAND_FIND, id, wxFindDialogEventHandler(fn)) - -#define EVT_FIND_NEXT(id, fn) \ - wx__DECLARE_EVT1(wxEVT_COMMAND_FIND_NEXT, id, wxFindDialogEventHandler(fn)) - -#define EVT_FIND_REPLACE(id, fn) \ - wx__DECLARE_EVT1(wxEVT_COMMAND_FIND_REPLACE, id, wxFindDialogEventHandler(fn)) - -#define EVT_FIND_REPLACE_ALL(id, fn) \ - wx__DECLARE_EVT1(wxEVT_COMMAND_FIND_REPLACE_ALL, id, wxFindDialogEventHandler(fn)) - -#define EVT_FIND_CLOSE(id, fn) \ - wx__DECLARE_EVT1(wxEVT_COMMAND_FIND_CLOSE, id, wxFindDialogEventHandler(fn)) - -#endif // wxUSE_FINDREPLDLG - -#endif - // _WX_FDREPDLG_H diff --git a/wxWidgets/include/wx/features.h b/wxWidgets/include/wx/features.h deleted file mode 100644 index e9c0554955..0000000000 --- a/wxWidgets/include/wx/features.h +++ /dev/null @@ -1,64 +0,0 @@ -/** -* Name: wx/features.h -* Purpose: test macros for the features which might be available in some -* wxWidgets ports but not others -* Author: Vadim Zeitlin -* Modified by: Ryan Norton (Converted to C) -* Created: 18.03.02 -* RCS-ID: $Id: features.h 40865 2006-08-27 09:42:42Z VS $ -* Copyright: (c) 2002 Vadim Zeitlin -* Licence: wxWindows licence -*/ - -/* THIS IS A C FILE, DON'T USE C++ FEATURES (IN PARTICULAR COMMENTS) IN IT */ - -#ifndef _WX_FEATURES_H_ -#define _WX_FEATURES_H_ - -/* radio menu items are currently not implemented in wxMotif, use this - symbol (kept for compatibility from the time when they were not implemented - under other platforms as well) to test for this */ -#if !defined(__WXMOTIF__) - #define wxHAS_RADIO_MENU_ITEMS -#else - #undef wxHAS_RADIO_MENU_ITEMS -#endif - -/* the raw keyboard codes are generated under wxGTK and wxMSW only */ -#if defined(__WXGTK__) || defined(__WXMSW__) || defined(__WXMAC__) \ - || defined(__WXDFB__) - #define wxHAS_RAW_KEY_CODES -#else - #undef wxHAS_RAW_KEY_CODES -#endif - -/* taskbar is implemented in the major ports */ -#if defined(__WXMSW__) || defined(__WXCOCOA__) \ - || defined(__WXGTK__) || defined(__WXMOTIF__) || defined(__WXX11__) \ - || defined(__WXMAC_OSX__) || defined(__WXCOCOA__) - #define wxHAS_TASK_BAR_ICON -#else - #undef wxHAS_TASK_BAR_ICON -#endif - -/* wxIconLocation appeared in the middle of 2.5.0 so it's handy to have a */ -/* separate define for it */ -#define wxHAS_ICON_LOCATION - -/* same for wxCrashReport */ -#ifdef __WXMSW__ - #define wxHAS_CRASH_REPORT -#else - #undef wxHAS_CRASH_REPORT -#endif - -/* wxRE_ADVANCED is not always available, depending on regex library used - * (it's unavailable only if compiling via configure against system library) */ -#ifndef WX_NO_REGEX_ADVANCED - #define wxHAS_REGEX_ADVANCED -#else - #undef wxHAS_REGEX_ADVANCED -#endif - -#endif /* _WX_FEATURES_H_ */ - diff --git a/wxWidgets/include/wx/ffile.h b/wxWidgets/include/wx/ffile.h deleted file mode 100644 index 3e404530d4..0000000000 --- a/wxWidgets/include/wx/ffile.h +++ /dev/null @@ -1,115 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/ffile.h -// Purpose: wxFFile - encapsulates "FILE *" stream -// Author: Vadim Zeitlin -// Modified by: -// Created: 14.07.99 -// RCS-ID: $Id: ffile.h 61872 2009-09-09 22:37:05Z VZ $ -// Copyright: (c) 1998 Vadim Zeitlin -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_FFILE_H_ -#define _WX_FFILE_H_ - -#include "wx/defs.h" // for wxUSE_FFILE - -#if wxUSE_FFILE - -#include "wx/string.h" -#include "wx/filefn.h" -#include "wx/convauto.h" - -#include - -// ---------------------------------------------------------------------------- -// class wxFFile: standard C stream library IO -// -// NB: for space efficiency this class has no virtual functions, including -// dtor which is _not_ virtual, so it shouldn't be used as a base class. -// ---------------------------------------------------------------------------- - -class WXDLLIMPEXP_BASE wxFFile -{ -public: - // ctors - // ----- - // def ctor - wxFFile() { m_fp = NULL; } - // open specified file (may fail, use IsOpened()) - wxFFile(const wxChar *filename, const wxChar *mode = wxT("r")); - // attach to (already opened) file - wxFFile(FILE *lfp) { m_fp = lfp; } - - // open/close - // open a file (existing or not - the mode controls what happens) - bool Open(const wxChar *filename, const wxChar *mode = wxT("r")); - // closes the opened file (this is a NOP if not opened) - bool Close(); - - // assign an existing file descriptor and get it back from wxFFile object - void Attach(FILE *lfp, const wxString& name = wxEmptyString) - { Close(); m_fp = lfp; m_name = name; } - void Detach() { m_fp = NULL; } - FILE *fp() const { return m_fp; } - - // read/write (unbuffered) - // read all data from the file into a string (useful for text files) - bool ReadAll(wxString *str, const wxMBConv& conv = wxConvAuto()); - // returns number of bytes read - use Eof() and Error() to see if an error - // occurred or not - size_t Read(void *pBuf, size_t nCount); - // returns the number of bytes written - size_t Write(const void *pBuf, size_t nCount); - // returns true on success - bool Write(const wxString& s, const wxMBConv& conv = wxConvAuto()) - { - const wxWX2MBbuf buf = s.mb_str(conv); - size_t size = strlen(buf); - return Write((const char *)buf, size) == size; - } - // flush data not yet written - bool Flush(); - - // file pointer operations (return ofsInvalid on failure) - // move ptr ofs bytes related to start/current pos/end of file - bool Seek(wxFileOffset ofs, wxSeekMode mode = wxFromStart); - // move ptr to ofs bytes before the end - bool SeekEnd(wxFileOffset ofs = 0) { return Seek(ofs, wxFromEnd); } - // get current position in the file - wxFileOffset Tell() const; - // get current file length - wxFileOffset Length() const; - - // simple accessors: note that Eof() and Error() may only be called if - // IsOpened()! - // is file opened? - bool IsOpened() const { return m_fp != NULL; } - // is end of file reached? - bool Eof() const { return feof(m_fp) != 0; } - // has an error occurred? - bool Error() const { return ferror(m_fp) != 0; } - // get the file name - const wxString& GetName() const { return m_name; } - // type such as disk or pipe - wxFileKind GetKind() const { return wxGetFileKind(m_fp); } - - // dtor closes the file if opened - ~wxFFile() { Close(); } - -private: - // copy ctor and assignment operator are private because it doesn't make - // sense to copy files this way: attempt to do it will provoke a compile-time - // error. - wxFFile(const wxFFile&); - wxFFile& operator=(const wxFFile&); - - FILE *m_fp; // IO stream or NULL if not opened - - wxString m_name; // the name of the file (for diagnostic messages) -}; - -#endif // wxUSE_FFILE - -#endif // _WX_FFILE_H_ - diff --git a/wxWidgets/include/wx/file.h b/wxWidgets/include/wx/file.h deleted file mode 100644 index 1691dc0c4d..0000000000 --- a/wxWidgets/include/wx/file.h +++ /dev/null @@ -1,201 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: file.h -// Purpose: wxFile - encapsulates low-level "file descriptor" -// wxTempFile - safely replace the old file -// Author: Vadim Zeitlin -// Modified by: -// Created: 29/01/98 -// RCS-ID: $Id: file.h 46331 2007-06-05 13:16:11Z JS $ -// Copyright: (c) 1998 Vadim Zeitlin -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_FILEH__ -#define _WX_FILEH__ - -#include "wx/defs.h" - -#if wxUSE_FILE - -#include "wx/string.h" -#include "wx/filefn.h" -#include "wx/strconv.h" - -// ---------------------------------------------------------------------------- -// constants -// ---------------------------------------------------------------------------- - -// we redefine these constants here because S_IREAD &c are _not_ standard -// however, we do assume that the values correspond to the Unix umask bits -#define wxS_IRUSR 00400 -#define wxS_IWUSR 00200 -#define wxS_IXUSR 00100 - -#define wxS_IRGRP 00040 -#define wxS_IWGRP 00020 -#define wxS_IXGRP 00010 - -#define wxS_IROTH 00004 -#define wxS_IWOTH 00002 -#define wxS_IXOTH 00001 - -// default mode for the new files: corresponds to umask 022 -#define wxS_DEFAULT (wxS_IRUSR | wxS_IWUSR | wxS_IRGRP | wxS_IWGRP |\ - wxS_IROTH | wxS_IWOTH) - -// ---------------------------------------------------------------------------- -// class wxFile: raw file IO -// -// NB: for space efficiency this class has no virtual functions, including -// dtor which is _not_ virtual, so it shouldn't be used as a base class. -// ---------------------------------------------------------------------------- - -class WXDLLIMPEXP_BASE wxFile -{ -public: - // more file constants - // ------------------- - // opening mode - enum OpenMode { read, write, read_write, write_append, write_excl }; - // standard values for file descriptor - enum { fd_invalid = -1, fd_stdin, fd_stdout, fd_stderr }; - - // static functions - // ---------------- - // check whether a regular file by this name exists - static bool Exists(const wxChar *name); - // check whether we can access the given file in given mode - // (only read and write make sense here) - static bool Access(const wxChar *name, OpenMode mode); - - // ctors - // ----- - // def ctor - wxFile() { m_fd = fd_invalid; m_error = false; } - // open specified file (may fail, use IsOpened()) - wxFile(const wxChar *szFileName, OpenMode mode = read); - // attach to (already opened) file - wxFile(int lfd) { m_fd = lfd; m_error = false; } - - // open/close - // create a new file (with the default value of bOverwrite, it will fail if - // the file already exists, otherwise it will overwrite it and succeed) - bool Create(const wxChar *szFileName, bool bOverwrite = false, - int access = wxS_DEFAULT); - bool Open(const wxChar *szFileName, OpenMode mode = read, - int access = wxS_DEFAULT); - bool Close(); // Close is a NOP if not opened - - // assign an existing file descriptor and get it back from wxFile object - void Attach(int lfd) { Close(); m_fd = lfd; m_error = false; } - void Detach() { m_fd = fd_invalid; } - int fd() const { return m_fd; } - - // read/write (unbuffered) - // returns number of bytes read or wxInvalidOffset on error - ssize_t Read(void *pBuf, size_t nCount); - // returns the number of bytes written - size_t Write(const void *pBuf, size_t nCount); - // returns true on success - bool Write(const wxString& s, const wxMBConv& conv = wxConvUTF8) - { - const wxWX2MBbuf buf = s.mb_str(conv); - if (!buf) - return false; - size_t size = strlen(buf); - return Write((const char *) buf, size) == size; - } - // flush data not yet written - bool Flush(); - - // file pointer operations (return wxInvalidOffset on failure) - // move ptr ofs bytes related to start/current offset/end of file - wxFileOffset Seek(wxFileOffset ofs, wxSeekMode mode = wxFromStart); - // move ptr to ofs bytes before the end - wxFileOffset SeekEnd(wxFileOffset ofs = 0) { return Seek(ofs, wxFromEnd); } - // get current offset - wxFileOffset Tell() const; - // get current file length - wxFileOffset Length() const; - - // simple accessors - // is file opened? - bool IsOpened() const { return m_fd != fd_invalid; } - // is end of file reached? - bool Eof() const; - // has an error occurred? - bool Error() const { return m_error; } - // type such as disk or pipe - wxFileKind GetKind() const { return wxGetFileKind(m_fd); } - - // dtor closes the file if opened - ~wxFile() { Close(); } - -private: - // copy ctor and assignment operator are private because - // it doesn't make sense to copy files this way: - // attempt to do it will provoke a compile-time error. - wxFile(const wxFile&); - wxFile& operator=(const wxFile&); - - int m_fd; // file descriptor or INVALID_FD if not opened - bool m_error; // error memory -}; - -// ---------------------------------------------------------------------------- -// class wxTempFile: if you want to replace another file, create an instance -// of wxTempFile passing the name of the file to be replaced to the ctor. Then -// you can write to wxTempFile and call Commit() function to replace the old -// file (and close this one) or call Discard() to cancel the modification. If -// you call neither of them, dtor will call Discard(). -// ---------------------------------------------------------------------------- - -class WXDLLIMPEXP_BASE wxTempFile -{ -public: - // ctors - // default - wxTempFile() { } - // associates the temp file with the file to be replaced and opens it - wxTempFile(const wxString& strName); - - // open the temp file (strName is the name of file to be replaced) - bool Open(const wxString& strName); - - // is the file opened? - bool IsOpened() const { return m_file.IsOpened(); } - // get current file length - wxFileOffset Length() const { return m_file.Length(); } - // move ptr ofs bytes related to start/current offset/end of file - wxFileOffset Seek(wxFileOffset ofs, wxSeekMode mode = wxFromStart) - { return m_file.Seek(ofs, mode); } - // get current offset - wxFileOffset Tell() const { return m_file.Tell(); } - - // I/O (both functions return true on success, false on failure) - bool Write(const void *p, size_t n) { return m_file.Write(p, n) == n; } - bool Write(const wxString& str, const wxMBConv& conv = wxConvUTF8) - { return m_file.Write(str, conv); } - - // different ways to close the file - // validate changes and delete the old file of name m_strName - bool Commit(); - // discard changes - void Discard(); - - // dtor calls Discard() if file is still opened - ~wxTempFile(); - -private: - // no copy ctor/assignment operator - wxTempFile(const wxTempFile&); - wxTempFile& operator=(const wxTempFile&); - - wxString m_strName, // name of the file to replace in Commit() - m_strTemp; // temporary file name - wxFile m_file; // the temporary file -}; - -#endif // wxUSE_FILE - -#endif // _WX_FILEH__ diff --git a/wxWidgets/include/wx/fileconf.h b/wxWidgets/include/wx/fileconf.h deleted file mode 100644 index 0a76ab4c8a..0000000000 --- a/wxWidgets/include/wx/fileconf.h +++ /dev/null @@ -1,246 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: wx/fileconf.h -// Purpose: wxFileConfig derivation of wxConfigBase -// Author: Vadim Zeitlin -// Modified by: -// Created: 07.04.98 (adapted from appconf.cpp) -// RCS-ID: $Id: fileconf.h 50711 2007-12-15 02:57:58Z VZ $ -// Copyright: (c) 1997 Karsten Ballueder & Vadim Zeitlin -// Ballueder@usa.net -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _FILECONF_H -#define _FILECONF_H - -#include "wx/defs.h" - -#if wxUSE_CONFIG - -#include "wx/textfile.h" -#include "wx/string.h" -#include "wx/confbase.h" - -// ---------------------------------------------------------------------------- -// wxFileConfig -// ---------------------------------------------------------------------------- - -/* - wxFileConfig derives from base Config and implements file based config class, - i.e. it uses ASCII disk files to store the information. These files are - alternatively called INI, .conf or .rc in the documentation. They are - organized in groups or sections, which can nest (i.e. a group contains - subgroups, which contain their own subgroups &c). Each group has some - number of entries, which are "key = value" pairs. More precisely, the format - is: - - # comments are allowed after either ';' or '#' (Win/UNIX standard) - - # blank lines (as above) are ignored - - # global entries are members of special (no name) top group - written_for = Windows - platform = Linux - - # the start of the group 'Foo' - [Foo] # may put comments like this also - # following 3 lines are entries - key = value - another_key = " strings with spaces in the beginning should be quoted, \ - otherwise the spaces are lost" - last_key = but you don't have to put " normally (nor quote them, like here) - - # subgroup of the group 'Foo' - # (order is not important, only the name is: separator is '/', as in paths) - [Foo/Bar] - # entries prefixed with "!" are immutable, i.e. can't be changed if they are - # set in the system-wide config file - !special_key = value - bar_entry = whatever - - [Foo/Bar/Fubar] # depth is (theoretically :-) unlimited - # may have the same name as key in another section - bar_entry = whatever not - - You have {read/write/delete}Entry functions (guess what they do) and also - setCurrentPath to select current group. enum{Subgroups/Entries} allow you - to get all entries in the config file (in the current group). Finally, - flush() writes immediately all changed entries to disk (otherwise it would - be done automatically in dtor) - - wxFileConfig manages not less than 2 config files for each program: global - and local (or system and user if you prefer). Entries are read from both of - them and the local entries override the global ones unless the latter is - immutable (prefixed with '!') in which case a warning message is generated - and local value is ignored. Of course, the changes are always written to local - file only. - - The names of these files can be specified in a number of ways. First of all, - you can use the standard convention: using the ctor which takes 'strAppName' - parameter will probably be sufficient for 90% of cases. If, for whatever - reason you wish to use the files with some other names, you can always use the - second ctor. - - wxFileConfig also may automatically expand the values of environment variables - in the entries it reads: for example, if you have an entry - score_file = $HOME/.score - a call to Read(&str, "score_file") will return a complete path to .score file - unless the expansion was previously disabled with SetExpandEnvVars(false) call - (it's on by default, the current status can be retrieved with - IsExpandingEnvVars function). -*/ -class WXDLLIMPEXP_FWD_BASE wxFileConfigGroup; -class WXDLLIMPEXP_FWD_BASE wxFileConfigEntry; -class WXDLLIMPEXP_FWD_BASE wxFileConfigLineList; - -#if wxUSE_STREAMS -class WXDLLIMPEXP_FWD_BASE wxInputStream; -class WXDLLIMPEXP_FWD_BASE wxOutputStream; -#endif // wxUSE_STREAMS - -class WXDLLIMPEXP_BASE wxFileConfig : public wxConfigBase -{ -public: - // construct the "standard" full name for global (system-wide) and - // local (user-specific) config files from the base file name. - // - // the following are the filenames returned by this functions: - // global local - // Unix /etc/file.ext ~/.file - // Win %windir%\file.ext %USERPROFILE%\file.ext - // - // where file is the basename of szFile, ext is its extension - // or .conf (Unix) or .ini (Win) if it has none - static wxString GetGlobalFileName(const wxChar *szFile); - static wxString GetLocalFileName(const wxChar *szFile); - - // ctor & dtor - // New constructor: one size fits all. Specify wxCONFIG_USE_LOCAL_FILE or - // wxCONFIG_USE_GLOBAL_FILE to say which files should be used. - wxFileConfig(const wxString& appName = wxEmptyString, - const wxString& vendorName = wxEmptyString, - const wxString& localFilename = wxEmptyString, - const wxString& globalFilename = wxEmptyString, - long style = wxCONFIG_USE_LOCAL_FILE | wxCONFIG_USE_GLOBAL_FILE, - const wxMBConv& conv = wxConvAuto()); - -#if wxUSE_STREAMS - // ctor that takes an input stream. - wxFileConfig(wxInputStream &inStream, const wxMBConv& conv = wxConvAuto()); -#endif // wxUSE_STREAMS - - // dtor will save unsaved data - virtual ~wxFileConfig(); - - // under Unix, set the umask to be used for the file creation, do nothing - // under other systems -#ifdef __UNIX__ - void SetUmask(int mode) { m_umask = mode; } -#else // !__UNIX__ - void SetUmask(int WXUNUSED(mode)) { } -#endif // __UNIX__/!__UNIX__ - - // implement inherited pure virtual functions - virtual void SetPath(const wxString& strPath); - virtual const wxString& GetPath() const { return m_strPath; } - - virtual bool GetFirstGroup(wxString& str, long& lIndex) const; - virtual bool GetNextGroup (wxString& str, long& lIndex) const; - virtual bool GetFirstEntry(wxString& str, long& lIndex) const; - virtual bool GetNextEntry (wxString& str, long& lIndex) const; - - virtual size_t GetNumberOfEntries(bool bRecursive = false) const; - virtual size_t GetNumberOfGroups(bool bRecursive = false) const; - - virtual bool HasGroup(const wxString& strName) const; - virtual bool HasEntry(const wxString& strName) const; - - virtual bool Flush(bool bCurrentOnly = false); - - virtual bool RenameEntry(const wxString& oldName, const wxString& newName); - virtual bool RenameGroup(const wxString& oldName, const wxString& newName); - - virtual bool DeleteEntry(const wxString& key, bool bGroupIfEmptyAlso = true); - virtual bool DeleteGroup(const wxString& szKey); - virtual bool DeleteAll(); - - // additional, wxFileConfig-specific, functionality -#if wxUSE_STREAMS - // save the entire config file text to the given stream, note that the text - // won't be saved again in dtor when Flush() is called if you use this method - // as it won't be "changed" any more - virtual bool Save(wxOutputStream& os, const wxMBConv& conv = wxConvAuto()); -#endif // wxUSE_STREAMS - -public: - // functions to work with this list - wxFileConfigLineList *LineListAppend(const wxString& str); - wxFileConfigLineList *LineListInsert(const wxString& str, - wxFileConfigLineList *pLine); // NULL => Prepend() - void LineListRemove(wxFileConfigLineList *pLine); - bool LineListIsEmpty(); - -protected: - virtual bool DoReadString(const wxString& key, wxString *pStr) const; - virtual bool DoReadLong(const wxString& key, long *pl) const; - - virtual bool DoWriteString(const wxString& key, const wxString& szValue); - virtual bool DoWriteLong(const wxString& key, long lValue); - -private: - // GetXXXFileName helpers: return ('/' terminated) directory names - static wxString GetGlobalDir(); - static wxString GetLocalDir(); - - // common part of all ctors (assumes that m_str{Local|Global}File are already - // initialized - void Init(); - - // common part of from dtor and DeleteAll - void CleanUp(); - - // parse the whole file - void Parse(const wxTextBuffer& buffer, bool bLocal); - - // the same as SetPath("/") - void SetRootPath(); - - // real SetPath() implementation, returns true if path could be set or false - // if path doesn't exist and createMissingComponents == false - bool DoSetPath(const wxString& strPath, bool createMissingComponents); - - // set/test the dirty flag - void SetDirty() { m_isDirty = true; } - void ResetDirty() { m_isDirty = false; } - bool IsDirty() const { return m_isDirty; } - - - // member variables - // ---------------- - wxFileConfigLineList *m_linesHead, // head of the linked list - *m_linesTail; // tail - - wxString m_strLocalFile, // local file name passed to ctor - m_strGlobalFile; // global - wxString m_strPath; // current path (not '/' terminated) - - wxFileConfigGroup *m_pRootGroup, // the top (unnamed) group - *m_pCurrentGroup; // the current group - - wxMBConv *m_conv; - -#ifdef __UNIX__ - int m_umask; // the umask to use for file creation -#endif // __UNIX__ - - bool m_isDirty; // if true, we have unsaved changes - - DECLARE_NO_COPY_CLASS(wxFileConfig) -}; - -#endif - // wxUSE_CONFIG - -#endif - //_FILECONF_H - diff --git a/wxWidgets/include/wx/filedlg.h b/wxWidgets/include/wx/filedlg.h deleted file mode 100644 index 8f3fc48d59..0000000000 --- a/wxWidgets/include/wx/filedlg.h +++ /dev/null @@ -1,226 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/filedlg.h -// Purpose: wxFileDialog base header -// Author: Robert Roebling -// Modified by: -// Created: 8/17/99 -// Copyright: (c) Robert Roebling -// RCS-ID: $Id: filedlg.h 44027 2006-12-21 19:26:48Z VZ $ -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_FILEDLG_H_BASE_ -#define _WX_FILEDLG_H_BASE_ - -#include "wx/defs.h" - -#if wxUSE_FILEDLG - -#include "wx/dialog.h" -#include "wx/arrstr.h" - -//---------------------------------------------------------------------------- -// wxFileDialog data -//---------------------------------------------------------------------------- - -/* - The flags below must coexist with the following flags in m_windowStyle - #define wxCAPTION 0x20000000 - #define wxMAXIMIZE 0x00002000 - #define wxCLOSE_BOX 0x00001000 - #define wxSYSTEM_MENU 0x00000800 - wxBORDER_NONE = 0x00200000 - #define wxRESIZE_BORDER 0x00000040 -*/ - -enum -{ - wxFD_OPEN = 0x0001, - wxFD_SAVE = 0x0002, - wxFD_OVERWRITE_PROMPT = 0x0004, - wxFD_FILE_MUST_EXIST = 0x0010, - wxFD_MULTIPLE = 0x0020, - wxFD_CHANGE_DIR = 0x0080, - wxFD_PREVIEW = 0x0100 -}; - -#if WXWIN_COMPATIBILITY_2_6 -enum -{ - wxOPEN = wxFD_OPEN, - wxSAVE = wxFD_SAVE, - wxOVERWRITE_PROMPT = wxFD_OVERWRITE_PROMPT, -#if WXWIN_COMPATIBILITY_2_4 - wxHIDE_READONLY = 0x0008, -#endif - wxFILE_MUST_EXIST = wxFD_FILE_MUST_EXIST, - wxMULTIPLE = wxFD_MULTIPLE, - wxCHANGE_DIR = wxFD_CHANGE_DIR -}; -#endif - -#define wxFD_DEFAULT_STYLE wxFD_OPEN - -extern WXDLLEXPORT_DATA(const wxChar) wxFileDialogNameStr[]; -extern WXDLLEXPORT_DATA(const wxChar) wxFileSelectorPromptStr[]; -extern WXDLLEXPORT_DATA(const wxChar) wxFileSelectorDefaultWildcardStr[]; - -//---------------------------------------------------------------------------- -// wxFileDialogBase -//---------------------------------------------------------------------------- - -class WXDLLEXPORT wxFileDialogBase: public wxDialog -{ -public: - wxFileDialogBase () { Init(); } - - wxFileDialogBase(wxWindow *parent, - const wxString& message = wxFileSelectorPromptStr, - const wxString& defaultDir = wxEmptyString, - const wxString& defaultFile = wxEmptyString, - const wxString& wildCard = wxFileSelectorDefaultWildcardStr, - long style = wxFD_DEFAULT_STYLE, - const wxPoint& pos = wxDefaultPosition, - const wxSize& sz = wxDefaultSize, - const wxString& name = wxFileDialogNameStr) - { - Init(); - Create(parent, message, defaultDir, defaultFile, wildCard, style, pos, sz, name); - } - - bool Create(wxWindow *parent, - const wxString& message = wxFileSelectorPromptStr, - const wxString& defaultDir = wxEmptyString, - const wxString& defaultFile = wxEmptyString, - const wxString& wildCard = wxFileSelectorDefaultWildcardStr, - long style = wxFD_DEFAULT_STYLE, - const wxPoint& pos = wxDefaultPosition, - const wxSize& sz = wxDefaultSize, - const wxString& name = wxFileDialogNameStr); - - bool HasFdFlag(int flag) const { return HasFlag(flag); } - - virtual void SetMessage(const wxString& message) { m_message = message; } - virtual void SetPath(const wxString& path) { m_path = path; } - virtual void SetDirectory(const wxString& dir) { m_dir = dir; } - virtual void SetFilename(const wxString& name) { m_fileName = name; } - virtual void SetWildcard(const wxString& wildCard) { m_wildCard = wildCard; } - virtual void SetFilterIndex(int filterIndex) { m_filterIndex = filterIndex; } - - virtual wxString GetMessage() const { return m_message; } - virtual wxString GetPath() const { return m_path; } - virtual void GetPaths(wxArrayString& paths) const { paths.Empty(); paths.Add(m_path); } - virtual wxString GetDirectory() const { return m_dir; } - virtual wxString GetFilename() const { return m_fileName; } - virtual void GetFilenames(wxArrayString& files) const { files.Empty(); files.Add(m_fileName); } - virtual wxString GetWildcard() const { return m_wildCard; } - virtual int GetFilterIndex() const { return m_filterIndex; } - - // Utility functions - -#if WXWIN_COMPATIBILITY_2_4 - // Parses the wildCard, returning the number of filters. - // Returns 0 if none or if there's a problem, - // The arrays will contain an equal number of items found before the error. - // wildCard is in the form: - // "All files (*)|*|Image Files (*.jpeg *.png)|*.jpg;*.png" - wxDEPRECATED( static int ParseWildcard(const wxString& wildCard, - wxArrayString& descriptions, - wxArrayString& filters) ); -#endif // WXWIN_COMPATIBILITY_2_4 - -#if WXWIN_COMPATIBILITY_2_6 - - wxDEPRECATED( long GetStyle() const ); - wxDEPRECATED( void SetStyle(long style) ); - -#endif // WXWIN_COMPATIBILITY_2_6 - - - // Append first extension to filePath from a ';' separated extensionList - // if filePath = "path/foo.bar" just return it as is - // if filePath = "foo[.]" and extensionList = "*.jpg;*.png" return "foo.jpg" - // if the extension is "*.j?g" (has wildcards) or "jpg" then return filePath - static wxString AppendExtension(const wxString &filePath, - const wxString &extensionList); - -protected: - wxString m_message; - wxString m_dir; - wxString m_path; // Full path - wxString m_fileName; - wxString m_wildCard; - int m_filterIndex; - -private: - void Init(); - DECLARE_DYNAMIC_CLASS(wxFileDialogBase) - DECLARE_NO_COPY_CLASS(wxFileDialogBase) -}; - -//---------------------------------------------------------------------------- -// wxFileDialog convenience functions -//---------------------------------------------------------------------------- - -// File selector - backward compatibility -WXDLLEXPORT wxString -wxFileSelector(const wxChar *message = wxFileSelectorPromptStr, - const wxChar *default_path = NULL, - const wxChar *default_filename = NULL, - const wxChar *default_extension = NULL, - const wxChar *wildcard = wxFileSelectorDefaultWildcardStr, - int flags = 0, - wxWindow *parent = NULL, - int x = wxDefaultCoord, int y = wxDefaultCoord); - -// An extended version of wxFileSelector -WXDLLEXPORT wxString -wxFileSelectorEx(const wxChar *message = wxFileSelectorPromptStr, - const wxChar *default_path = NULL, - const wxChar *default_filename = NULL, - int *indexDefaultExtension = NULL, - const wxChar *wildcard = wxFileSelectorDefaultWildcardStr, - int flags = 0, - wxWindow *parent = NULL, - int x = wxDefaultCoord, int y = wxDefaultCoord); - -// Ask for filename to load -WXDLLEXPORT wxString -wxLoadFileSelector(const wxChar *what, - const wxChar *extension, - const wxChar *default_name = (const wxChar *)NULL, - wxWindow *parent = (wxWindow *) NULL); - -// Ask for filename to save -WXDLLEXPORT wxString -wxSaveFileSelector(const wxChar *what, - const wxChar *extension, - const wxChar *default_name = (const wxChar *) NULL, - wxWindow *parent = (wxWindow *) NULL); - - -#if defined (__WXUNIVERSAL__) -#define wxUSE_GENERIC_FILEDIALOG -#include "wx/generic/filedlgg.h" -#elif defined(__WXMSW__) -#include "wx/msw/filedlg.h" -#elif defined(__WXMOTIF__) -#include "wx/motif/filedlg.h" -#elif defined(__WXGTK24__) -#include "wx/gtk/filedlg.h" // GTK+ > 2.4 has native version -#elif defined(__WXGTK20__) -#define wxUSE_GENERIC_FILEDIALOG -#include "wx/generic/filedlgg.h" -#elif defined(__WXGTK__) -#include "wx/gtk1/filedlg.h" -#elif defined(__WXMAC__) -#include "wx/mac/filedlg.h" -#elif defined(__WXCOCOA__) -#include "wx/cocoa/filedlg.h" -#elif defined(__WXPM__) -#include "wx/os2/filedlg.h" -#endif - -#endif // wxUSE_FILEDLG - -#endif // _WX_FILEDLG_H_BASE_ diff --git a/wxWidgets/include/wx/filefn.h b/wxWidgets/include/wx/filefn.h deleted file mode 100644 index d1a2934baf..0000000000 --- a/wxWidgets/include/wx/filefn.h +++ /dev/null @@ -1,770 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/filefn.h -// Purpose: File- and directory-related functions -// Author: Julian Smart -// Modified by: -// Created: 29/01/98 -// RCS-ID: $Id: filefn.h 63300 2010-01-28 21:36:09Z MW $ -// Copyright: (c) 1998 Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _FILEFN_H_ -#define _FILEFN_H_ - -#include "wx/list.h" -#include "wx/arrstr.h" - -#ifdef __WXWINCE__ - #include "wx/msw/wince/time.h" - #include "wx/msw/private.h" -#else - #include -#endif - -#ifdef __WXWINCE__ -// Nothing -#elif !defined(__MWERKS__) - #include - #include -#else - #ifdef __MACH__ - #include - #include - #include - #include - #else - #include - #include - #include - #endif -#endif - -#ifdef __OS2__ -// need to check for __OS2__ first since currently both -// __OS2__ and __UNIX__ are defined. - #include - #include "wx/os2/private.h" - #ifdef __WATCOMC__ - #include - #endif - #include - #ifdef __EMX__ - #include - #endif -#elif defined(__UNIX__) - #include - #include -#endif - -#if defined(__WINDOWS__) && !defined(__WXMICROWIN__) -#if !defined( __GNUWIN32__ ) && !defined( __MWERKS__ ) && !defined(__SALFORDC__) && !defined(__WXWINCE__) && !defined(__CYGWIN__) - #include - #include - #include -#endif // __WINDOWS__ -#endif // native Win compiler - -#if defined(__DOS__) - #ifdef __WATCOMC__ - #include - #include - #include - #endif - #ifdef __DJGPP__ - #include - #include - #endif -#endif - -#ifdef __BORLANDC__ // Please someone tell me which version of Borland needs - // this (3.1 I believe) and how to test for it. - // If this works for Borland 4.0 as well, then no worries. - #include -#endif - -#ifdef __SALFORDC__ - #include - #include -#endif - -#ifndef __WXWINCE__ - #include // O_RDONLY &c -#endif -// ---------------------------------------------------------------------------- -// constants -// ---------------------------------------------------------------------------- - -#ifdef __WXWINCE__ - typedef long off_t; -#else - // define off_t - #if !defined(__WXMAC__) || defined(__UNIX__) || defined(__MACH__) - #include - #else - typedef long off_t; - #endif -#endif - -#if (defined(__VISUALC__) && !defined(__WXWINCE__)) || ( defined(__MWERKS__) && defined( __INTEL__) ) - typedef _off_t off_t; -#elif defined(__SYMANTEC__) - typedef long off_t; -#elif defined(__MWERKS__) && !defined(__INTEL__) && !defined(__MACH__) - typedef long off_t; -#endif - -enum wxSeekMode -{ - wxFromStart, - wxFromCurrent, - wxFromEnd -}; - -enum wxFileKind -{ - wxFILE_KIND_UNKNOWN, - wxFILE_KIND_DISK, // a file supporting seeking to arbitrary offsets - wxFILE_KIND_TERMINAL, // a tty - wxFILE_KIND_PIPE // a pipe -}; - -// ---------------------------------------------------------------------------- -// declare our versions of low level file functions: some compilers prepend -// underscores to the usual names, some also have Unicode versions of them -// ---------------------------------------------------------------------------- - -// Wrappers around Win32 api functions like CreateFile, ReadFile and such -// Implemented in filefnwce.cpp -#if defined( __WXWINCE__) - typedef __int64 wxFileOffset; - #define wxFileOffsetFmtSpec _("I64") - int wxOpen(const wxChar *filename, int oflag, int WXUNUSED(pmode)); - int wxAccess(const wxChar *name, int WXUNUSED(how)); - int wxClose(int fd); - int wxFsync(int WXUNUSED(fd)); - int wxRead(int fd, void *buf, unsigned int count); - int wxWrite(int fd, const void *buf, unsigned int count); - int wxEof(int fd); - wxFileOffset wxSeek(int fd, wxFileOffset offset, int origin); - #define wxLSeek wxSeek - wxFileOffset wxTell(int fd); - - // always Unicode under WinCE - #define wxMkDir _wmkdir - #define wxRmDir _wrmdir - #define wxStat _wstat - #define wxStructStat struct _stat -#elif (defined(__WXMSW__) || defined(__OS2__)) && !defined(__WXPALMOS__) && \ - ( \ - defined(__VISUALC__) || \ - (defined(__MINGW32__) && !defined(__WINE__) && \ - wxCHECK_W32API_VERSION(0, 5)) || \ - defined(__MWERKS__) || \ - defined(__DMC__) || \ - defined(__WATCOMC__) || \ - defined(__BORLANDC__) \ - ) - - // temporary defines just used immediately below - #undef wxHAS_HUGE_FILES - #undef wxHAS_HUGE_STDIO_FILES - - // detect compilers which have support for huge files - #if defined(__VISUALC__) - #define wxHAS_HUGE_FILES 1 - #elif defined(__MINGW32__) - #define wxHAS_HUGE_FILES 1 - #elif defined(_LARGE_FILES) - #define wxHAS_HUGE_FILES 1 - #endif - - // detect compilers which have support for huge stdio files - #if defined __VISUALC__ && __VISUALC__ >= 1400 - #define wxHAS_HUGE_STDIO_FILES - #define wxFseek _fseeki64 - #define wxFtell _ftelli64 - #elif wxCHECK_MINGW32_VERSION(3, 5) // mingw-runtime version (not gcc) - #define wxHAS_HUGE_STDIO_FILES - #define wxFseek fseeko64 - #define wxFtell ftello64 - #endif - - // other Windows compilers (DMC, Watcom, Metrowerks and Borland) don't have - // huge file support (or at least not all functions needed for it by wx) - // currently - - #ifdef wxHAS_HUGE_FILES - typedef wxLongLong_t wxFileOffset; - #define wxFileOffsetFmtSpec wxLongLongFmtSpec - #else - typedef off_t wxFileOffset; - #endif - - - // functions - - // MSVC and compatible compilers prepend underscores to the POSIX function - // names, other compilers don't and even if their later versions usually do - // define the versions with underscores for MSVC compatibility, it's better - // to avoid using them as they're not present in earlier versions and - // always using the native functions spelling is easier than testing for - // the versions - #if defined(__BORLANDC__) || defined(__DMC__) || defined(__WATCOMC__) || defined(__MINGW64__) - #define wxPOSIX_IDENT(func) ::func - #else // by default assume MSVC-compatible names - #define wxPOSIX_IDENT(func) _ ## func - #define wxHAS_UNDERSCORES_IN_POSIX_IDENTS - #endif - - // at least Borland 5.5 doesn't like "struct ::stat" so don't use the scope - // resolution operator present in wxPOSIX_IDENT for it - #ifdef __BORLANDC__ - #define wxPOSIX_STRUCT(s) struct s - #else - #define wxPOSIX_STRUCT(s) struct wxPOSIX_IDENT(s) - #endif - - // first functions not working with strings, i.e. without ANSI/Unicode - // complications - #define wxClose wxPOSIX_IDENT(close) - - #if defined(__MWERKS__) - #if __MSL__ >= 0x6000 - #define wxRead(fd, buf, nCount) _read(fd, (void *)buf, nCount) - #define wxWrite(fd, buf, nCount) _write(fd, (void *)buf, nCount) - #else - #define wxRead(fd, buf, nCount)\ - _read(fd, (const char *)buf, nCount) - #define wxWrite(fd, buf, nCount)\ - _write(fd, (const char *)buf, nCount) - #endif - #else // __MWERKS__ - #define wxRead wxPOSIX_IDENT(read) - #define wxWrite wxPOSIX_IDENT(write) - #endif - - #ifdef wxHAS_HUGE_FILES - #ifndef __MINGW64__ - #define wxSeek wxPOSIX_IDENT(lseeki64) - #define wxLseek wxPOSIX_IDENT(lseeki64) - #define wxTell wxPOSIX_IDENT(telli64) - #else - // unfortunately, mingw-W64 is somewhat inconsistent... - #define wxSeek _lseeki64 - #define wxLseek _lseeki64 - #define wxTell _telli64 - #endif - #else // !wxHAS_HUGE_FILES - #define wxSeek wxPOSIX_IDENT(lseek) - #define wxLseek wxPOSIX_IDENT(lseek) - #define wxTell wxPOSIX_IDENT(tell) - #endif // wxHAS_HUGE_FILES/!wxHAS_HUGE_FILES - - #ifndef __WATCOMC__ - #if !defined(__BORLANDC__) || (__BORLANDC__ > 0x540) - // NB: this one is not POSIX and always has the underscore - #define wxFsync _commit - - // could be already defined by configure (Cygwin) - #ifndef HAVE_FSYNC - #define HAVE_FSYNC - #endif - #endif // BORLANDC - #endif - - #define wxEof wxPOSIX_IDENT(eof) - - // then the functions taking strings - #if wxUSE_UNICODE - #if wxUSE_UNICODE_MSLU - // implement the missing file functions in Win9x ourselves - #if defined( __VISUALC__ ) \ - || ( defined(__MINGW32__) && wxCHECK_W32API_VERSION( 0, 5 ) ) \ - || ( defined(__MWERKS__) && defined(__WXMSW__) ) \ - || ( defined(__BORLANDC__) && (__BORLANDC__ > 0x460) ) \ - || defined(__DMC__) - - WXDLLIMPEXP_BASE int wxMSLU__wopen(const wxChar *name, - int flags, int mode); - WXDLLIMPEXP_BASE int wxMSLU__waccess(const wxChar *name, - int mode); - WXDLLIMPEXP_BASE int wxMSLU__wmkdir(const wxChar *name); - WXDLLIMPEXP_BASE int wxMSLU__wrmdir(const wxChar *name); - - WXDLLIMPEXP_BASE int - wxMSLU__wstat(const wxChar *name, wxPOSIX_STRUCT(stat) *buffer); - WXDLLIMPEXP_BASE int - wxMSLU__wstati64(const wxChar *name, - wxPOSIX_STRUCT(stati64) *buffer); - #endif // Windows compilers with MSLU support - - #define wxOpen wxMSLU__wopen - - #define wxAccess wxMSLU__waccess - #define wxMkDir wxMSLU__wmkdir - #define wxRmDir wxMSLU__wrmdir - #ifdef wxHAS_HUGE_FILES - #define wxStat wxMSLU__wstati64 - #else - #define wxStat wxMSLU__wstat - #endif - #else // !wxUSE_UNICODE_MSLU - #ifdef __BORLANDC__ - #if __BORLANDC__ >= 0x550 && __BORLANDC__ <= 0x551 - WXDLLIMPEXP_BASE int wxOpen(const wxChar *pathname, - int flags, mode_t mode); - #else - #define wxOpen _wopen - #endif - #define wxAccess _waccess - #define wxMkDir _wmkdir - #define wxRmDir _wrmdir - #ifdef wxHAS_HUGE_FILES - #define wxStat _wstati64 - #else - #define wxStat _wstat - #endif - #else - #define wxOpen _wopen - #define wxAccess _waccess - #define wxMkDir _wmkdir - #define wxRmDir _wrmdir - #ifdef wxHAS_HUGE_FILES - #define wxStat _wstati64 - #else - #define wxStat _wstat - #endif - #endif - #endif // wxUSE_UNICODE_MSLU/!wxUSE_UNICODE_MSLU - #else // !wxUSE_UNICODE - #define wxOpen wxPOSIX_IDENT(open) - #define wxAccess wxPOSIX_IDENT(access) - #define wxMkDir wxPOSIX_IDENT(mkdir) - #define wxRmDir wxPOSIX_IDENT(rmdir) - #ifdef wxHAS_HUGE_FILES - #define wxStat wxPOSIX_IDENT(stati64) - #else - // Unfortunately Watcom is not consistent, so:- - #if defined(__OS2__) && defined(__WATCOMC__) - #define wxStat _stat - #else - #if defined (__BORLANDC__) - #define wxStat _stat //wxPOSIX_IDENT(stat) - #else - #define wxStat wxPOSIX_IDENT(stat) - #endif // !borland - #endif // !watcom - #endif - #endif // wxUSE_UNICODE/!wxUSE_UNICODE - - // Types: Notice that Watcom is the only compiler to have a wide char - // version of struct stat as well as a wide char stat function variant. - // This was droped since OW 1.4 "for consistency across platforms". - #ifdef wxHAS_HUGE_FILES - #if wxUSE_UNICODE && wxONLY_WATCOM_EARLIER_THAN(1,4) - #define wxStructStat struct _wstati64 - #else - #define wxStructStat struct _stati64 - #endif - #else - #if wxUSE_UNICODE && wxONLY_WATCOM_EARLIER_THAN(1,4) - #define wxStructStat struct _wstat - #else - #define wxStructStat struct _stat - #endif - #endif - - // constants (unless already defined by the user code) - #ifdef wxHAS_UNDERSCORES_IN_POSIX_IDENTS - #ifndef O_RDONLY - #define O_RDONLY _O_RDONLY - #define O_WRONLY _O_WRONLY - #define O_RDWR _O_RDWR - #define O_EXCL _O_EXCL - #define O_CREAT _O_CREAT - #define O_BINARY _O_BINARY - #endif - - #ifndef S_IFMT - #define S_IFMT _S_IFMT - #define S_IFDIR _S_IFDIR - #define S_IFREG _S_IFREG - #endif - #endif // wxHAS_UNDERSCORES_IN_POSIX_IDENTS - - #ifdef wxHAS_HUGE_FILES - // wxFile is present and supports large files. - #if wxUSE_FILE - #define wxHAS_LARGE_FILES - #endif - // wxFFile is present and supports large files - #if wxUSE_FFILE && defined wxHAS_HUGE_STDIO_FILES - #define wxHAS_LARGE_FFILES - #endif - #endif - - // private defines, undefine so that nobody gets tempted to use - #undef wxHAS_HUGE_FILES - #undef wxHAS_HUGE_STDIO_FILES -#else // Unix or Windows using unknown compiler, assume POSIX supported - typedef off_t wxFileOffset; - #ifdef _LARGE_FILES - #define wxFileOffsetFmtSpec wxLongLongFmtSpec - wxCOMPILE_TIME_ASSERT( sizeof(off_t) == sizeof(wxLongLong_t), - BadFileSizeType ); - // wxFile is present and supports large files - #ifdef wxUSE_FILE - #define wxHAS_LARGE_FILES - #endif - // wxFFile is present and supports large files - #if SIZEOF_LONG == 8 || defined HAVE_FSEEKO - #define wxHAS_LARGE_FFILES - #endif - #ifdef HAVE_FSEEKO - #define wxFseek fseeko - #define wxFtell ftello - #endif - #else - #define wxFileOffsetFmtSpec wxT("") - #endif - // functions - #define wxClose close - #define wxRead ::read - #define wxWrite ::write - #define wxLseek lseek - #define wxSeek lseek - #define wxFsync fsync - #define wxEof eof - - #define wxMkDir mkdir - #define wxRmDir rmdir - - #define wxTell(fd) lseek(fd, 0, SEEK_CUR) - - #define wxStructStat struct stat - - #if wxUSE_UNICODE - #define wxNEED_WX_UNISTD_H - #if defined(__DMC__) - typedef unsigned long mode_t; - #endif - WXDLLIMPEXP_BASE int wxStat( const wxChar *file_name, wxStructStat *buf ); - WXDLLIMPEXP_BASE int wxLstat( const wxChar *file_name, wxStructStat *buf ); - WXDLLIMPEXP_BASE int wxAccess( const wxChar *pathname, int mode ); - WXDLLIMPEXP_BASE int wxOpen( const wxChar *pathname, int flags, mode_t mode ); - #else - #define wxOpen open - #define wxStat stat - #define wxLstat lstat - #define wxAccess access - #endif - - #define wxHAS_NATIVE_LSTAT -#endif // platforms - -// define wxFseek/wxFtell to large file versions if available (done above) or -// to fseek/ftell if not, to save ifdefs in using code -#ifndef wxFseek - #define wxFseek fseek -#endif -#ifndef wxFtell - #define wxFtell ftell -#endif - -#ifdef O_BINARY - #define wxO_BINARY O_BINARY -#else - #define wxO_BINARY 0 -#endif - -// if the platform doesn't have symlinks, define wxLstat to be the same as -// wxStat to avoid #ifdefs in the code using it -#ifndef wxHAS_NATIVE_LSTAT - #define wxLstat wxStat -#endif - -#if defined(__VISAGECPP__) && __IBMCPP__ >= 400 -// -// VisualAge C++ V4.0 cannot have any external linkage const decs -// in headers included by more than one primary source -// -extern const int wxInvalidOffset; -#else -const int wxInvalidOffset = -1; -#endif - -// ---------------------------------------------------------------------------- -// functions -// ---------------------------------------------------------------------------- -WXDLLIMPEXP_BASE bool wxFileExists(const wxString& filename); - -// does the path exist? (may have or not '/' or '\\' at the end) -WXDLLIMPEXP_BASE bool wxDirExists(const wxChar *pszPathName); - -WXDLLIMPEXP_BASE bool wxIsAbsolutePath(const wxString& filename); - -// Get filename -WXDLLIMPEXP_BASE wxChar* wxFileNameFromPath(wxChar *path); -WXDLLIMPEXP_BASE wxString wxFileNameFromPath(const wxString& path); - -// Get directory -WXDLLIMPEXP_BASE wxString wxPathOnly(const wxString& path); - -// wxString version -WXDLLIMPEXP_BASE wxString wxRealPath(const wxString& path); - -WXDLLIMPEXP_BASE void wxDos2UnixFilename(wxChar *s); - -WXDLLIMPEXP_BASE void wxUnix2DosFilename(wxChar *s); - -// Strip the extension, in situ -WXDLLIMPEXP_BASE void wxStripExtension(wxChar *buffer); -WXDLLIMPEXP_BASE void wxStripExtension(wxString& buffer); - -// Get a temporary filename -WXDLLIMPEXP_BASE wxChar* wxGetTempFileName(const wxString& prefix, wxChar *buf = (wxChar *) NULL); -WXDLLIMPEXP_BASE bool wxGetTempFileName(const wxString& prefix, wxString& buf); - -// Expand file name (~/ and ${OPENWINHOME}/ stuff) -WXDLLIMPEXP_BASE wxChar* wxExpandPath(wxChar *dest, const wxChar *path); -WXDLLIMPEXP_BASE bool wxExpandPath(wxString& dest, const wxChar *path); - -// Contract w.r.t environment ( -> ${OPENWINHOME}/lib) -// and make (if under the home tree) relative to home -// [caller must copy-- volatile] -WXDLLIMPEXP_BASE wxChar* wxContractPath(const wxString& filename, - const wxString& envname = wxEmptyString, - const wxString& user = wxEmptyString); - -// Destructive removal of /./ and /../ stuff -WXDLLIMPEXP_BASE wxChar* wxRealPath(wxChar *path); - -// Allocate a copy of the full absolute path -WXDLLIMPEXP_BASE wxChar* wxCopyAbsolutePath(const wxString& path); - -// Get first file name matching given wild card. -// Flags are reserved for future use. -#define wxFILE 1 -#define wxDIR 2 -WXDLLIMPEXP_BASE wxString wxFindFirstFile(const wxChar *spec, int flags = wxFILE); -WXDLLIMPEXP_BASE wxString wxFindNextFile(); - -// Does the pattern contain wildcards? -WXDLLIMPEXP_BASE bool wxIsWild(const wxString& pattern); - -// Does the pattern match the text (usually a filename)? -// If dot_special is true, doesn't match * against . (eliminating -// `hidden' dot files) -WXDLLIMPEXP_BASE bool wxMatchWild(const wxString& pattern, const wxString& text, bool dot_special = true); - -// Concatenate two files to form third -WXDLLIMPEXP_BASE bool wxConcatFiles(const wxString& file1, const wxString& file2, const wxString& file3); - -// Copy file1 to file2 -WXDLLIMPEXP_BASE bool wxCopyFile(const wxString& file1, const wxString& file2, - bool overwrite = true); - -// Remove file -WXDLLIMPEXP_BASE bool wxRemoveFile(const wxString& file); - -// Rename file -WXDLLIMPEXP_BASE bool wxRenameFile(const wxString& file1, const wxString& file2, bool overwrite = true); - -// Get current working directory. -#if WXWIN_COMPATIBILITY_2_6 -// If buf is NULL, allocates space using new, else -// copies into buf. -// IMPORTANT NOTE getcwd is know not to work under some releases -// of Win32s 1.3, according to MS release notes! -wxDEPRECATED( WXDLLIMPEXP_BASE wxChar* wxGetWorkingDirectory(wxChar *buf = (wxChar *) NULL, int sz = 1000) ); -// new and preferred version of wxGetWorkingDirectory -// NB: can't have the same name because of overloading ambiguity -#endif // WXWIN_COMPATIBILITY_2_6 -WXDLLIMPEXP_BASE wxString wxGetCwd(); - -// Set working directory -WXDLLIMPEXP_BASE bool wxSetWorkingDirectory(const wxString& d); - -// Make directory -WXDLLIMPEXP_BASE bool wxMkdir(const wxString& dir, int perm = 0777); - -// Remove directory. Flags reserved for future use. -WXDLLIMPEXP_BASE bool wxRmdir(const wxString& dir, int flags = 0); - -// Return the type of an open file -WXDLLIMPEXP_BASE wxFileKind wxGetFileKind(int fd); -WXDLLIMPEXP_BASE wxFileKind wxGetFileKind(FILE *fp); - -#if WXWIN_COMPATIBILITY_2_6 -// compatibility defines, don't use in new code -wxDEPRECATED( inline bool wxPathExists(const wxChar *pszPathName) ); -inline bool wxPathExists(const wxChar *pszPathName) -{ - return wxDirExists(pszPathName); -} -#endif //WXWIN_COMPATIBILITY_2_6 - -// permissions; these functions work both on files and directories: -WXDLLIMPEXP_BASE bool wxIsWritable(const wxString &path); -WXDLLIMPEXP_BASE bool wxIsReadable(const wxString &path); -WXDLLIMPEXP_BASE bool wxIsExecutable(const wxString &path); - -// ---------------------------------------------------------------------------- -// separators in file names -// ---------------------------------------------------------------------------- - -// between file name and extension -#define wxFILE_SEP_EXT wxT('.') - -// between drive/volume name and the path -#define wxFILE_SEP_DSK wxT(':') - -// between the path components -#define wxFILE_SEP_PATH_DOS wxT('\\') -#define wxFILE_SEP_PATH_UNIX wxT('/') -#define wxFILE_SEP_PATH_MAC wxT(':') -#define wxFILE_SEP_PATH_VMS wxT('.') // VMS also uses '[' and ']' - -// separator in the path list (as in PATH environment variable) -// there is no PATH variable in Classic Mac OS so just use the -// semicolon (it must be different from the file name separator) -// NB: these are strings and not characters on purpose! -#define wxPATH_SEP_DOS wxT(";") -#define wxPATH_SEP_UNIX wxT(":") -#define wxPATH_SEP_MAC wxT(";") - -// platform independent versions -#if defined(__UNIX__) && !defined(__OS2__) - // CYGWIN also uses UNIX settings - #define wxFILE_SEP_PATH wxFILE_SEP_PATH_UNIX - #define wxPATH_SEP wxPATH_SEP_UNIX -#elif defined(__MAC__) - #define wxFILE_SEP_PATH wxFILE_SEP_PATH_MAC - #define wxPATH_SEP wxPATH_SEP_MAC -#else // Windows and OS/2 - #define wxFILE_SEP_PATH wxFILE_SEP_PATH_DOS - #define wxPATH_SEP wxPATH_SEP_DOS -#endif // Unix/Windows - -// this is useful for wxString::IsSameAs(): to compare two file names use -// filename1.IsSameAs(filename2, wxARE_FILENAMES_CASE_SENSITIVE) -#if defined(__UNIX__) && !defined(__DARWIN__) && !defined(__OS2__) - #define wxARE_FILENAMES_CASE_SENSITIVE true -#else // Windows, Mac OS and OS/2 - #define wxARE_FILENAMES_CASE_SENSITIVE false -#endif // Unix/Windows - -// is the char a path separator? -inline bool wxIsPathSeparator(wxChar c) -{ - // under DOS/Windows we should understand both Unix and DOS file separators -#if ( defined(__UNIX__) && !defined(__OS2__) )|| defined(__MAC__) - return c == wxFILE_SEP_PATH; -#else - return c == wxFILE_SEP_PATH_DOS || c == wxFILE_SEP_PATH_UNIX; -#endif -} - -// does the string ends with path separator? -WXDLLIMPEXP_BASE bool wxEndsWithPathSeparator(const wxChar *pszFileName); - -// split the full path into path (including drive for DOS), name and extension -// (understands both '/' and '\\') -WXDLLIMPEXP_BASE void wxSplitPath(const wxChar *pszFileName, - wxString *pstrPath, - wxString *pstrName, - wxString *pstrExt); - -// find a file in a list of directories, returns false if not found -WXDLLIMPEXP_BASE bool wxFindFileInPath(wxString *pStr, const wxChar *pszPath, const wxChar *pszFile); - -// Get the OS directory if appropriate (such as the Windows directory). -// On non-Windows platform, probably just return the empty string. -WXDLLIMPEXP_BASE wxString wxGetOSDirectory(); - -#if wxUSE_DATETIME - -// Get file modification time -WXDLLIMPEXP_BASE time_t wxFileModificationTime(const wxString& filename); - -#endif // wxUSE_DATETIME - -// Parses the wildCard, returning the number of filters. -// Returns 0 if none or if there's a problem, -// The arrays will contain an equal number of items found before the error. -// wildCard is in the form: -// "All files (*)|*|Image Files (*.jpeg *.png)|*.jpg;*.png" -WXDLLIMPEXP_BASE int wxParseCommonDialogsFilter(const wxString& wildCard, wxArrayString& descriptions, wxArrayString& filters); - -// ---------------------------------------------------------------------------- -// classes -// ---------------------------------------------------------------------------- - -#ifdef __UNIX__ - -// set umask to the given value in ctor and reset it to the old one in dtor -class WXDLLIMPEXP_BASE wxUmaskChanger -{ -public: - // change the umask to the given one if it is not -1: this allows to write - // the same code whether you really want to change umask or not, as is in - // wxFileConfig::Flush() for example - wxUmaskChanger(int umaskNew) - { - m_umaskOld = umaskNew == -1 ? -1 : (int)umask((mode_t)umaskNew); - } - - ~wxUmaskChanger() - { - if ( m_umaskOld != -1 ) - umask((mode_t)m_umaskOld); - } - -private: - int m_umaskOld; -}; - -// this macro expands to an "anonymous" wxUmaskChanger object under Unix and -// nothing elsewhere -#define wxCHANGE_UMASK(m) wxUmaskChanger wxMAKE_UNIQUE_NAME(umaskChanger_)(m) - -#else // !__UNIX__ - -#define wxCHANGE_UMASK(m) - -#endif // __UNIX__/!__UNIX__ - - -// Path searching -class WXDLLIMPEXP_BASE wxPathList : public wxArrayString -{ -public: - wxPathList() {} - wxPathList(const wxArrayString &arr) - { Add(arr); } - - // Adds all paths in environment variable - void AddEnvList(const wxString& envVariable); - - // Adds given path to this list - bool Add(const wxString& path); - void Add(const wxArrayString &paths); - - // Find the first full path for which the file exists - wxString FindValidPath(const wxString& filename) const; - - // Find the first full path for which the file exists; ensure it's an - // absolute path that gets returned. - wxString FindAbsoluteValidPath(const wxString& filename) const; - - // Given full path and filename, add path to list - bool EnsureFileAccessible(const wxString& path); - -#if WXWIN_COMPATIBILITY_2_6 - // Returns true if the path is in the list - wxDEPRECATED( bool Member(const wxString& path) const ); -#endif -}; - -#endif // _WX_FILEFN_H_ diff --git a/wxWidgets/include/wx/filename.h b/wxWidgets/include/wx/filename.h deleted file mode 100644 index 96412dfaaa..0000000000 --- a/wxWidgets/include/wx/filename.h +++ /dev/null @@ -1,547 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/filename.h -// Purpose: wxFileName - encapsulates a file path -// Author: Robert Roebling, Vadim Zeitlin -// Modified by: -// Created: 28.12.00 -// RCS-ID: $Id: filename.h 61872 2009-09-09 22:37:05Z VZ $ -// Copyright: (c) 2000 Robert Roebling -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_FILENAME_H_ -#define _WX_FILENAME_H_ - -/* - TODO: - - 1. support for drives under Windows - 2. more file operations: - a) chmod() - b) [acm]time() - get and set - c) rename()? - 3. SameFileAs() function to compare inodes under Unix - */ - -#include "wx/arrstr.h" -#include "wx/filefn.h" -#include "wx/datetime.h" -#include "wx/intl.h" - -#if wxUSE_FILE -class WXDLLIMPEXP_FWD_BASE wxFile; -#endif - -#if wxUSE_FFILE -class WXDLLIMPEXP_FWD_BASE wxFFile; -#endif - -// ---------------------------------------------------------------------------- -// constants -// ---------------------------------------------------------------------------- - -// the various values for the path format: this mainly affects the path -// separator but also whether or not the path has the drive part (as under -// Windows) -enum wxPathFormat -{ - wxPATH_NATIVE = 0, // the path format for the current platform - wxPATH_UNIX, - wxPATH_BEOS = wxPATH_UNIX, - wxPATH_MAC, - wxPATH_DOS, - wxPATH_WIN = wxPATH_DOS, - wxPATH_OS2 = wxPATH_DOS, - wxPATH_VMS, - - wxPATH_MAX // Not a valid value for specifying path format -}; - -// the kind of normalization to do with the file name: these values can be -// or'd together to perform several operations at once -enum wxPathNormalize -{ - wxPATH_NORM_ENV_VARS = 0x0001, // replace env vars with their values - wxPATH_NORM_DOTS = 0x0002, // squeeze all .. and . and prepend cwd - wxPATH_NORM_TILDE = 0x0004, // Unix only: replace ~ and ~user - wxPATH_NORM_CASE = 0x0008, // if case insensitive => tolower - wxPATH_NORM_ABSOLUTE = 0x0010, // make the path absolute - wxPATH_NORM_LONG = 0x0020, // make the path the long form - wxPATH_NORM_SHORTCUT = 0x0040, // resolve the shortcut, if it is a shortcut - wxPATH_NORM_ALL = 0x00ff & ~wxPATH_NORM_CASE -}; - -// what exactly should GetPath() return? -enum -{ - wxPATH_GET_VOLUME = 0x0001, // include the volume if applicable - wxPATH_GET_SEPARATOR = 0x0002 // terminate the path with the separator -}; - -// MkDir flags -enum -{ - wxPATH_MKDIR_FULL = 0x0001 // create directories recursively -}; - -// error code of wxFileName::GetSize() -extern WXDLLIMPEXP_DATA_BASE(wxULongLong) wxInvalidSize; - - - -// ---------------------------------------------------------------------------- -// wxFileName: encapsulates a file path -// ---------------------------------------------------------------------------- - -class WXDLLIMPEXP_BASE wxFileName -{ -public: - // constructors and assignment - - // the usual stuff - wxFileName() { Clear(); } - wxFileName(const wxFileName& filepath) { Assign(filepath); } - - // from a full filename: if it terminates with a '/', a directory path - // is contructed (the name will be empty), otherwise a file name and - // extension are extracted from it - wxFileName( const wxString& fullpath, wxPathFormat format = wxPATH_NATIVE ) - { Assign( fullpath, format ); } - - // from a directory name and a file name - wxFileName(const wxString& path, - const wxString& name, - wxPathFormat format = wxPATH_NATIVE) - { Assign(path, name, format); } - - // from a volume, directory name, file base name and extension - wxFileName(const wxString& volume, - const wxString& path, - const wxString& name, - const wxString& ext, - wxPathFormat format = wxPATH_NATIVE) - { Assign(volume, path, name, ext, format); } - - // from a directory name, file base name and extension - wxFileName(const wxString& path, - const wxString& name, - const wxString& ext, - wxPathFormat format = wxPATH_NATIVE) - { Assign(path, name, ext, format); } - - // the same for delayed initialization - - void Assign(const wxFileName& filepath); - - void Assign(const wxString& fullpath, - wxPathFormat format = wxPATH_NATIVE); - - void Assign(const wxString& volume, - const wxString& path, - const wxString& name, - const wxString& ext, - bool hasExt, - wxPathFormat format = wxPATH_NATIVE); - - void Assign(const wxString& volume, - const wxString& path, - const wxString& name, - const wxString& ext, - wxPathFormat format = wxPATH_NATIVE) - { Assign(volume, path, name, ext, !ext.empty(), format); } - - void Assign(const wxString& path, - const wxString& name, - wxPathFormat format = wxPATH_NATIVE); - - void Assign(const wxString& path, - const wxString& name, - const wxString& ext, - wxPathFormat format = wxPATH_NATIVE); - - void AssignDir(const wxString& dir, wxPathFormat format = wxPATH_NATIVE); - - // assorted assignment operators - - wxFileName& operator=(const wxFileName& filename) - { Assign(filename); return *this; } - - wxFileName& operator=(const wxString& filename) - { Assign(filename); return *this; } - - // reset all components to default, uninitialized state - void Clear(); - - // static pseudo constructors - static wxFileName FileName(const wxString& file, - wxPathFormat format = wxPATH_NATIVE); - static wxFileName DirName(const wxString& dir, - wxPathFormat format = wxPATH_NATIVE); - - // file tests - - // is the filename valid at all? - bool IsOk() const - { - // we're fine if we have the path or the name or if we're a root dir - return m_dirs.size() != 0 || !m_name.empty() || !m_relative || - !m_ext.empty() || m_hasExt; - } - - // does the file with this name exists? - bool FileExists() const; - static bool FileExists( const wxString &file ); - - // does the directory with this name exists? - bool DirExists() const; - static bool DirExists( const wxString &dir ); - - // checks on most common flags for files/directories; - // more platform-specific features (like e.g. Unix permissions) are not - // available in wxFileName - - bool IsDirWritable() const { return wxIsWritable(GetPath()); } - static bool IsDirWritable(const wxString &path) { return wxDirExists(path) && wxIsWritable(path); } - - bool IsDirReadable() const { return wxIsReadable(GetPath()); } - static bool IsDirReadable(const wxString &path) { return wxDirExists(path) && wxIsReadable(path); } - - // NOTE: IsDirExecutable() is not present because the meaning of "executable" - // directory is very platform-dependent and also not so useful - - bool IsFileWritable() const { return wxIsWritable(GetFullPath()); } - static bool IsFileWritable(const wxString &path) { return wxFileExists(path) && wxIsWritable(path); } - - bool IsFileReadable() const { return wxIsReadable(GetFullPath()); } - static bool IsFileReadable(const wxString &path) { return wxFileExists(path) && wxIsReadable(path); } - - bool IsFileExecutable() const { return wxIsExecutable(GetFullPath()); } - static bool IsFileExecutable(const wxString &path) { return wxFileExists(path) && wxIsExecutable(path); } - - - // time functions -#if wxUSE_DATETIME - // set the file last access/mod and creation times - // (any of the pointers may be NULL) - bool SetTimes(const wxDateTime *dtAccess, - const wxDateTime *dtMod, - const wxDateTime *dtCreate); - - // set the access and modification times to the current moment - bool Touch(); - - // return the last access, last modification and create times - // (any of the pointers may be NULL) - bool GetTimes(wxDateTime *dtAccess, - wxDateTime *dtMod, - wxDateTime *dtCreate) const; - - // convenience wrapper: get just the last mod time of the file - wxDateTime GetModificationTime() const - { - wxDateTime dtMod; - (void)GetTimes(NULL, &dtMod, NULL); - return dtMod; - } -#endif // wxUSE_DATETIME - -#ifdef __WXMAC__ - bool MacSetTypeAndCreator( wxUint32 type , wxUint32 creator ) ; - bool MacGetTypeAndCreator( wxUint32 *type , wxUint32 *creator ) ; - // gets the 'common' type and creator for a certain extension - static bool MacFindDefaultTypeAndCreator( const wxString& ext , wxUint32 *type , wxUint32 *creator ) ; - // registers application defined extensions and their default type and creator - static void MacRegisterDefaultTypeAndCreator( const wxString& ext , wxUint32 type , wxUint32 creator ) ; - // looks up the appropriate type and creator from the registration and then sets - bool MacSetDefaultTypeAndCreator() ; -#endif - - // various file/dir operations - - // retrieve the value of the current working directory - void AssignCwd(const wxString& volume = wxEmptyString); - static wxString GetCwd(const wxString& volume = wxEmptyString); - - // change the current working directory - bool SetCwd(); - static bool SetCwd( const wxString &cwd ); - - // get the value of user home (Unix only mainly) - void AssignHomeDir(); - static wxString GetHomeDir(); - - // get the system temporary directory - static wxString GetTempDir(); - -#if wxUSE_FILE || wxUSE_FFILE - // get a temp file name starting with the specified prefix - void AssignTempFileName(const wxString& prefix); - static wxString CreateTempFileName(const wxString& prefix); -#endif // wxUSE_FILE - -#if wxUSE_FILE - // get a temp file name starting with the specified prefix and open the - // file passed to us using this name for writing (atomically if - // possible) - void AssignTempFileName(const wxString& prefix, wxFile *fileTemp); - static wxString CreateTempFileName(const wxString& prefix, - wxFile *fileTemp); -#endif // wxUSE_FILE - -#if wxUSE_FFILE - // get a temp file name starting with the specified prefix and open the - // file passed to us using this name for writing (atomically if - // possible) - void AssignTempFileName(const wxString& prefix, wxFFile *fileTemp); - static wxString CreateTempFileName(const wxString& prefix, - wxFFile *fileTemp); -#endif // wxUSE_FFILE - - // directory creation and removal. - bool Mkdir( int perm = 0777, int flags = 0); - static bool Mkdir( const wxString &dir, int perm = 0777, int flags = 0 ); - - bool Rmdir(); - static bool Rmdir( const wxString &dir ); - - // operations on the path - - // normalize the path: with the default flags value, the path will be - // made absolute, without any ".." and "." and all environment - // variables will be expanded in it - // - // this may be done using another (than current) value of cwd - bool Normalize(int flags = wxPATH_NORM_ALL, - const wxString& cwd = wxEmptyString, - wxPathFormat format = wxPATH_NATIVE); - - // get a path path relative to the given base directory, i.e. opposite - // of Normalize - // - // pass an empty string to get a path relative to the working directory - // - // returns true if the file name was modified, false if we failed to do - // anything with it (happens when the file is on a different volume, - // for example) - bool MakeRelativeTo(const wxString& pathBase = wxEmptyString, - wxPathFormat format = wxPATH_NATIVE); - - // make the path absolute - // - // this may be done using another (than current) value of cwd - bool MakeAbsolute(const wxString& cwd = wxEmptyString, - wxPathFormat format = wxPATH_NATIVE) - { return Normalize(wxPATH_NORM_DOTS | wxPATH_NORM_ABSOLUTE | - wxPATH_NORM_TILDE, cwd, format); } - -#if defined(__WIN32__) && !defined(__WXWINCE__) && wxUSE_OLE - // if the path is a shortcut, return the target and optionally, - // the arguments - bool GetShortcutTarget(const wxString& shortcutPath, - wxString& targetFilename, - wxString* arguments = NULL); -#endif - - // Comparison - - // compares with the rules of the given platforms format - bool SameAs(const wxFileName& filepath, - wxPathFormat format = wxPATH_NATIVE) const; - - // compare with another filename object - bool operator==(const wxFileName& filename) const - { return SameAs(filename); } - bool operator!=(const wxFileName& filename) const - { return !SameAs(filename); } - - // compare with a filename string interpreted as a native file name - bool operator==(const wxString& filename) const - { return SameAs(wxFileName(filename)); } - bool operator!=(const wxString& filename) const - { return !SameAs(wxFileName(filename)); } - - // are the file names of this type cases sensitive? - static bool IsCaseSensitive( wxPathFormat format = wxPATH_NATIVE ); - - // is this filename absolute? - bool IsAbsolute(wxPathFormat format = wxPATH_NATIVE) const; - - // is this filename relative? - bool IsRelative(wxPathFormat format = wxPATH_NATIVE) const - { return !IsAbsolute(format); } - - // Returns the characters that aren't allowed in filenames - // on the specified platform. - static wxString GetForbiddenChars(wxPathFormat format = wxPATH_NATIVE); - - // Information about path format - - // get the string separating the volume from the path for this format, - // return an empty string if this format doesn't support the notion of - // volumes at all - static wxString GetVolumeSeparator(wxPathFormat format = wxPATH_NATIVE); - - // get the string of path separators for this format - static wxString GetPathSeparators(wxPathFormat format = wxPATH_NATIVE); - - // get the string of path terminators, i.e. characters which terminate the - // path - static wxString GetPathTerminators(wxPathFormat format = wxPATH_NATIVE); - - // get the canonical path separator for this format - static wxChar GetPathSeparator(wxPathFormat format = wxPATH_NATIVE) - { return GetPathSeparators(format)[0u]; } - - // is the char a path separator for this format? - static bool IsPathSeparator(wxChar ch, wxPathFormat format = wxPATH_NATIVE); - - // Dir accessors - size_t GetDirCount() const { return m_dirs.size(); } - void AppendDir(const wxString& dir); - void PrependDir(const wxString& dir); - void InsertDir(size_t before, const wxString& dir); - void RemoveDir(size_t pos); - void RemoveLastDir() { RemoveDir(GetDirCount() - 1); } - - // Other accessors - void SetExt( const wxString &ext ) { m_ext = ext; m_hasExt = !m_ext.empty(); } - void ClearExt() { m_ext = wxEmptyString; m_hasExt = false; } - void SetEmptyExt() { m_ext = wxT(""); m_hasExt = true; } - wxString GetExt() const { return m_ext; } - bool HasExt() const { return m_hasExt; } - - void SetName( const wxString &name ) { m_name = name; } - wxString GetName() const { return m_name; } - bool HasName() const { return !m_name.empty(); } - - void SetVolume( const wxString &volume ) { m_volume = volume; } - wxString GetVolume() const { return m_volume; } - bool HasVolume() const { return !m_volume.empty(); } - - // full name is the file name + extension (but without the path) - void SetFullName(const wxString& fullname); - wxString GetFullName() const; - - const wxArrayString& GetDirs() const { return m_dirs; } - - // flags are combination of wxPATH_GET_XXX flags - wxString GetPath(int flags = wxPATH_GET_VOLUME, - wxPathFormat format = wxPATH_NATIVE) const; - - // Replace current path with this one - void SetPath( const wxString &path, wxPathFormat format = wxPATH_NATIVE ); - - // Construct full path with name and ext - wxString GetFullPath( wxPathFormat format = wxPATH_NATIVE ) const; - - // Return the short form of the path (returns identity on non-Windows platforms) - wxString GetShortPath() const; - - // Return the long form of the path (returns identity on non-Windows platforms) - wxString GetLongPath() const; - - // Is this a file or directory (not necessarily an existing one) - bool IsDir() const { return m_name.empty() && m_ext.empty(); } - - // various helpers - - // get the canonical path format for this platform - static wxPathFormat GetFormat( wxPathFormat format = wxPATH_NATIVE ); - - // split a fullpath into the volume, path, (base) name and extension - // (all of the pointers can be NULL) - static void SplitPath(const wxString& fullpath, - wxString *volume, - wxString *path, - wxString *name, - wxString *ext, - bool *hasExt = NULL, - wxPathFormat format = wxPATH_NATIVE); - - static void SplitPath(const wxString& fullpath, - wxString *volume, - wxString *path, - wxString *name, - wxString *ext, - wxPathFormat format) - { - SplitPath(fullpath, volume, path, name, ext, NULL, format); - } - - // compatibility version: volume is part of path - static void SplitPath(const wxString& fullpath, - wxString *path, - wxString *name, - wxString *ext, - wxPathFormat format = wxPATH_NATIVE); - - // split a path into volume and pure path part - static void SplitVolume(const wxString& fullpathWithVolume, - wxString *volume, - wxString *path, - wxPathFormat format = wxPATH_NATIVE); - -#if wxABI_VERSION >= 20811 - // strip the file extension - static wxString StripExtension(const wxString& fullpath); -#endif // wxABI_VERSION >= 20811 - - - // Filesize - - // returns the size of the given filename - wxULongLong GetSize() const; - static wxULongLong GetSize(const wxString &file); - - // returns the size in a human readable form - wxString GetHumanReadableSize(const wxString &nullsize = wxGetTranslation(wxT("Not available")), - int precision = 1) const; - static wxString GetHumanReadableSize(const wxULongLong &sz, - const wxString &nullsize = wxGetTranslation(wxT("Not available")), - int precision = 1); - - - // deprecated methods, don't use any more - // -------------------------------------- - -#ifndef __DIGITALMARS__ - wxString GetPath( bool withSep, wxPathFormat format = wxPATH_NATIVE ) const - { return GetPath(withSep ? wxPATH_GET_SEPARATOR : 0, format); } -#endif - wxString GetPathWithSep(wxPathFormat format = wxPATH_NATIVE ) const - { return GetPath(wxPATH_GET_VOLUME | wxPATH_GET_SEPARATOR, format); } - -private: - // check whether this dir is valid for Append/Prepend/InsertDir() - static bool IsValidDirComponent(const wxString& dir); - - // the drive/volume/device specification (always empty for Unix) - wxString m_volume; - - // the path components of the file - wxArrayString m_dirs; - - // the file name and extension (empty for directories) - wxString m_name, - m_ext; - - // when m_dirs is empty it may mean either that we have no path at all or - // that our path is '/', i.e. the root directory - // - // we use m_relative to distinguish between these two cases, it will be - // true in the former and false in the latter - // - // NB: the path is not absolute just because m_relative is false, it still - // needs the drive (i.e. volume) in some formats (Windows) - bool m_relative; - - // when m_ext is empty, it may be because we don't have any extension or - // because we have an empty extension - // - // the difference is important as file with name "foo" and without - // extension has full name "foo" while with empty extension it is "foo." - bool m_hasExt; -}; - -#endif // _WX_FILENAME_H_ - diff --git a/wxWidgets/include/wx/filepicker.h b/wxWidgets/include/wx/filepicker.h deleted file mode 100644 index aad2a4f652..0000000000 --- a/wxWidgets/include/wx/filepicker.h +++ /dev/null @@ -1,398 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/filepicker.h -// Purpose: wxFilePickerCtrl, wxDirPickerCtrl base header -// Author: Francesco Montorsi -// Modified by: -// Created: 14/4/2006 -// Copyright: (c) Francesco Montorsi -// RCS-ID: $Id: filepicker.h 49804 2007-11-10 01:09:42Z VZ $ -// Licence: wxWindows Licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_FILEDIRPICKER_H_BASE_ -#define _WX_FILEDIRPICKER_H_BASE_ - -#include "wx/defs.h" - -#if wxUSE_FILEPICKERCTRL || wxUSE_DIRPICKERCTRL - -#include "wx/pickerbase.h" - -class WXDLLIMPEXP_FWD_CORE wxDialog; -class WXDLLIMPEXP_FWD_CORE wxFileDirPickerEvent; - -extern WXDLLEXPORT_DATA(const wxChar) wxFilePickerWidgetLabel[]; -extern WXDLLEXPORT_DATA(const wxChar) wxFilePickerWidgetNameStr[]; -extern WXDLLEXPORT_DATA(const wxChar) wxFilePickerCtrlNameStr[]; -extern WXDLLEXPORT_DATA(const wxChar) wxFileSelectorPromptStr[]; - -extern WXDLLEXPORT_DATA(const wxChar) wxDirPickerWidgetLabel[]; -extern WXDLLEXPORT_DATA(const wxChar) wxDirPickerWidgetNameStr[]; -extern WXDLLEXPORT_DATA(const wxChar) wxDirPickerCtrlNameStr[]; -extern WXDLLEXPORT_DATA(const wxChar) wxDirSelectorPromptStr[]; - - -// ---------------------------------------------------------------------------- -// wxFileDirPickerWidgetBase: a generic abstract interface which must be -// implemented by controls used by wxFileDirPickerCtrlBase -// ---------------------------------------------------------------------------- - -class WXDLLIMPEXP_CORE wxFileDirPickerWidgetBase -{ -public: - wxFileDirPickerWidgetBase() { } - virtual ~wxFileDirPickerWidgetBase() { } - - wxString GetPath() const { return m_path; } - virtual void SetPath(const wxString &str) { m_path=str; } - - // returns the picker widget cast to wxControl - virtual wxControl *AsControl() = 0; - -protected: - virtual void UpdateDialogPath(wxDialog *) = 0; - virtual void UpdatePathFromDialog(wxDialog *) = 0; - - wxString m_path; -}; - -// Styles which must be supported by all controls implementing wxFileDirPickerWidgetBase -// NB: these styles must be defined to carefully-chosen values to -// avoid conflicts with wxButton's styles - -#define wxFLP_OPEN 0x0400 -#define wxFLP_SAVE 0x0800 -#define wxFLP_OVERWRITE_PROMPT 0x1000 -#define wxFLP_FILE_MUST_EXIST 0x2000 -#define wxFLP_CHANGE_DIR 0x4000 - -// NOTE: wxMULTIPLE is not supported ! - - -#define wxDIRP_DIR_MUST_EXIST 0x0008 -#define wxDIRP_CHANGE_DIR 0x0010 - - -// map platform-dependent controls which implement the wxFileDirPickerWidgetBase -// under the name "wxFilePickerWidget" and "wxDirPickerWidget". -// NOTE: wxFileDirPickerCtrlBase will allocate a wx{File|Dir}PickerWidget and this -// requires that all classes being mapped as wx{File|Dir}PickerWidget have the -// same prototype for the contructor... -// since GTK >= 2.6, there is GtkFileButton -#if defined(__WXGTK26__) && !defined(__WXUNIVERSAL__) - #include "wx/gtk/filepicker.h" - #define wxFilePickerWidget wxFileButton - #define wxDirPickerWidget wxDirButton -#else - #include "wx/generic/filepickerg.h" - #define wxFilePickerWidget wxGenericFileButton - #define wxDirPickerWidget wxGenericDirButton -#endif - - - -// ---------------------------------------------------------------------------- -// wxFileDirPickerCtrlBase -// ---------------------------------------------------------------------------- - -class WXDLLIMPEXP_CORE wxFileDirPickerCtrlBase : public wxPickerBase -{ -public: - wxFileDirPickerCtrlBase() : m_bIgnoreNextTextCtrlUpdate(false) {} - -protected: - // NB: no default values since this function will never be used - // directly by the user and derived classes wouldn't use them - bool CreateBase(wxWindow *parent, - wxWindowID id, - const wxString& path, - const wxString &message, - const wxString &wildcard, - const wxPoint& pos, - const wxSize& size, - long style, - const wxValidator& validator, - const wxString& name); - -public: // public API - - wxString GetPath() const; - void SetPath(const wxString &str); - -public: // internal functions - - void UpdatePickerFromTextCtrl(); - void UpdateTextCtrlFromPicker(); - - // event handler for our picker - void OnFileDirChange(wxFileDirPickerEvent &); - - // Returns TRUE if the current path is a valid one - // (i.e. a valid file for a wxFilePickerWidget or a valid - // folder for a wxDirPickerWidget). - virtual bool CheckPath(const wxString &str) const = 0; - - // TRUE if any textctrl change should update the current working directory - virtual bool IsCwdToUpdate() const = 0; - - // Returns the event type sent by this picker - virtual wxEventType GetEventType() const = 0; - - // Returns the filtered value currently placed in the text control (if present). - virtual wxString GetTextCtrlValue() const = 0; - -protected: - // creates the picker control - virtual - wxFileDirPickerWidgetBase *CreatePicker(wxWindow *parent, - const wxString& path, - const wxString& message, - const wxString& wildcard) = 0; - -protected: - - // true if the next UpdateTextCtrl() call is to ignore - bool m_bIgnoreNextTextCtrlUpdate; - - // m_picker object as wxFileDirPickerWidgetBase interface - wxFileDirPickerWidgetBase *m_pickerIface; -}; - -#endif // wxUSE_FILEPICKERCTRL || wxUSE_DIRPICKERCTRL - - -#if wxUSE_FILEPICKERCTRL - -// ---------------------------------------------------------------------------- -// wxFilePickerCtrl: platform-independent class which embeds the -// platform-dependent wxFilePickerWidget and, if wxFLP_USE_TEXTCTRL style is -// used, a textctrl next to it. -// ---------------------------------------------------------------------------- - -#define wxFLP_USE_TEXTCTRL (wxPB_USE_TEXTCTRL) - -#ifdef __WXGTK__ - // GTK apps usually don't have a textctrl next to the picker - #define wxFLP_DEFAULT_STYLE (wxFLP_OPEN|wxFLP_FILE_MUST_EXIST) -#else - #define wxFLP_DEFAULT_STYLE (wxFLP_USE_TEXTCTRL|wxFLP_OPEN|wxFLP_FILE_MUST_EXIST) -#endif - -class WXDLLIMPEXP_CORE wxFilePickerCtrl : public wxFileDirPickerCtrlBase -{ -public: - wxFilePickerCtrl() {} - - wxFilePickerCtrl(wxWindow *parent, - wxWindowID id, - const wxString& path = wxEmptyString, - const wxString& message = wxFileSelectorPromptStr, - const wxString& wildcard = wxFileSelectorDefaultWildcardStr, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = wxFLP_DEFAULT_STYLE, - const wxValidator& validator = wxDefaultValidator, - const wxString& name = wxFilePickerCtrlNameStr) - { - Create(parent, id, path, message, wildcard, pos, size, style, - validator, name); - } - - bool Create(wxWindow *parent, - wxWindowID id, - const wxString& path = wxEmptyString, - const wxString& message = wxFileSelectorPromptStr, - const wxString& wildcard = wxFileSelectorDefaultWildcardStr, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = wxFLP_DEFAULT_STYLE, - const wxValidator& validator = wxDefaultValidator, - const wxString& name = wxFilePickerCtrlNameStr) - { - return wxFileDirPickerCtrlBase::CreateBase(parent, id, path, - message, wildcard, - pos, size, style, - validator, name); - } - - -public: // overrides - - // return true if the given path is valid for this control - bool CheckPath(const wxString& path) const; - - // return the text control value in canonical form - wxString GetTextCtrlValue() const; - - bool IsCwdToUpdate() const - { return HasFlag(wxFLP_CHANGE_DIR); } - - wxEventType GetEventType() const - { return wxEVT_COMMAND_FILEPICKER_CHANGED; } - -protected: - wxFileDirPickerWidgetBase *CreatePicker(wxWindow *parent, - const wxString& path, - const wxString& message, - const wxString& wildcard) - { - return new wxFilePickerWidget(parent, wxID_ANY, - wxFilePickerWidgetLabel, - path, message, wildcard, - wxDefaultPosition, wxDefaultSize, - GetPickerStyle(GetWindowStyle())); - } - - // extracts the style for our picker from wxFileDirPickerCtrlBase's style - long GetPickerStyle(long style) const - { - return (style & (wxFLP_OPEN|wxFLP_SAVE|wxFLP_OVERWRITE_PROMPT| - wxFLP_FILE_MUST_EXIST|wxFLP_CHANGE_DIR)); - } - -private: - DECLARE_DYNAMIC_CLASS(wxFilePickerCtrl) -}; - -#endif // wxUSE_FILEPICKERCTRL - - -#if wxUSE_DIRPICKERCTRL - -// ---------------------------------------------------------------------------- -// wxDirPickerCtrl: platform-independent class which embeds the -// platform-dependent wxDirPickerWidget and eventually a textctrl -// (see wxDIRP_USE_TEXTCTRL) next to it. -// ---------------------------------------------------------------------------- - -#define wxDIRP_USE_TEXTCTRL (wxPB_USE_TEXTCTRL) - -#ifdef __WXGTK__ - // GTK apps usually don't have a textctrl next to the picker - #define wxDIRP_DEFAULT_STYLE (wxDIRP_DIR_MUST_EXIST) -#else - #define wxDIRP_DEFAULT_STYLE (wxDIRP_USE_TEXTCTRL|wxDIRP_DIR_MUST_EXIST) -#endif - -class WXDLLIMPEXP_CORE wxDirPickerCtrl : public wxFileDirPickerCtrlBase -{ -public: - wxDirPickerCtrl() {} - - wxDirPickerCtrl(wxWindow *parent, wxWindowID id, - const wxString& path = wxEmptyString, - const wxString& message = wxDirSelectorPromptStr, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = wxDIRP_DEFAULT_STYLE, - const wxValidator& validator = wxDefaultValidator, - const wxString& name = wxDirPickerCtrlNameStr) - { - Create(parent, id, path, message, pos, size, style, validator, name); - } - - bool Create(wxWindow *parent, wxWindowID id, - const wxString& path = wxEmptyString, - const wxString& message = wxDirSelectorPromptStr, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = wxDIRP_DEFAULT_STYLE, - const wxValidator& validator = wxDefaultValidator, - const wxString& name = wxDirPickerCtrlNameStr) - { - return wxFileDirPickerCtrlBase::CreateBase - ( - parent, id, path, message, wxEmptyString, - pos, size, style, validator, name - ); - } - - -public: // overrides - - bool CheckPath(const wxString &path) const; - - wxString GetTextCtrlValue() const; - - bool IsCwdToUpdate() const - { return HasFlag(wxDIRP_CHANGE_DIR); } - - wxEventType GetEventType() const - { return wxEVT_COMMAND_DIRPICKER_CHANGED; } - -protected: - wxFileDirPickerWidgetBase *CreatePicker(wxWindow *parent, - const wxString& path, - const wxString& message, - const wxString& WXUNUSED(wildcard)) - { - return new wxDirPickerWidget(parent, wxID_ANY, wxDirPickerWidgetLabel, - path, message, - wxDefaultPosition, wxDefaultSize, - GetPickerStyle(GetWindowStyle())); - } - - // extracts the style for our picker from wxFileDirPickerCtrlBase's style - long GetPickerStyle(long style) const - { return (style & (wxDIRP_DIR_MUST_EXIST|wxDIRP_CHANGE_DIR)); } - -private: - DECLARE_DYNAMIC_CLASS(wxDirPickerCtrl) -}; - -#endif // wxUSE_DIRPICKERCTRL - - -#if wxUSE_FILEPICKERCTRL || wxUSE_DIRPICKERCTRL - -// ---------------------------------------------------------------------------- -// wxFileDirPickerEvent: used by wxFilePickerCtrl and wxDirPickerCtrl only -// ---------------------------------------------------------------------------- - -BEGIN_DECLARE_EVENT_TYPES() - DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_CORE, wxEVT_COMMAND_FILEPICKER_CHANGED, 1102) - DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_CORE, wxEVT_COMMAND_DIRPICKER_CHANGED, 1103) -END_DECLARE_EVENT_TYPES() - -class WXDLLIMPEXP_CORE wxFileDirPickerEvent : public wxCommandEvent -{ -public: - wxFileDirPickerEvent() {} - wxFileDirPickerEvent(wxEventType type, wxObject *generator, int id, const wxString &path) - : wxCommandEvent(type, id), - m_path(path) - { - SetEventObject(generator); - } - - wxString GetPath() const { return m_path; } - void SetPath(const wxString &p) { m_path = p; } - - // default copy ctor, assignment operator and dtor are ok - virtual wxEvent *Clone() const { return new wxFileDirPickerEvent(*this); } - -private: - wxString m_path; - - DECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxFileDirPickerEvent) -}; - -// ---------------------------------------------------------------------------- -// event types and macros -// ---------------------------------------------------------------------------- - -typedef void (wxEvtHandler::*wxFileDirPickerEventFunction)(wxFileDirPickerEvent&); - -#define wxFileDirPickerEventHandler(func) \ - (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxFileDirPickerEventFunction, &func) - -#define EVT_FILEPICKER_CHANGED(id, fn) \ - wx__DECLARE_EVT1(wxEVT_COMMAND_FILEPICKER_CHANGED, id, wxFileDirPickerEventHandler(fn)) -#define EVT_DIRPICKER_CHANGED(id, fn) \ - wx__DECLARE_EVT1(wxEVT_COMMAND_DIRPICKER_CHANGED, id, wxFileDirPickerEventHandler(fn)) - - -#endif // wxUSE_FILEPICKERCTRL || wxUSE_DIRPICKERCTRL - -#endif // _WX_FILEDIRPICKER_H_BASE_ - diff --git a/wxWidgets/include/wx/filesys.h b/wxWidgets/include/wx/filesys.h deleted file mode 100644 index 7d1ad27e82..0000000000 --- a/wxWidgets/include/wx/filesys.h +++ /dev/null @@ -1,300 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/filesys.h -// Purpose: class for opening files - virtual file system -// Author: Vaclav Slavik -// Copyright: (c) 1999 Vaclav Slavik -// RCS-ID: $Id: filesys.h 53135 2008-04-12 02:31:04Z VZ $ -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef __FILESYS_H__ -#define __FILESYS_H__ - -#include "wx/defs.h" - -#if !wxUSE_STREAMS -#error You cannot compile virtual file systems without wxUSE_STREAMS -#endif - -#if wxUSE_HTML && !wxUSE_FILESYSTEM -#error You cannot compile wxHTML without virtual file systems -#endif - -#if wxUSE_FILESYSTEM - -#include "wx/stream.h" -#include "wx/datetime.h" -#include "wx/filename.h" -#include "wx/hashmap.h" - -class WXDLLIMPEXP_FWD_BASE wxFSFile; -class WXDLLIMPEXP_FWD_BASE wxFileSystemHandler; -class WXDLLIMPEXP_FWD_BASE wxFileSystem; - -//-------------------------------------------------------------------------------- -// wxFSFile -// This class is a file opened using wxFileSystem. It consists of -// input stream, location, mime type & optional anchor -// (in 'index.htm#chapter2', 'chapter2' is anchor) -//-------------------------------------------------------------------------------- - -class WXDLLIMPEXP_BASE wxFSFile : public wxObject -{ -public: - wxFSFile(wxInputStream *stream, const wxString& loc, - const wxString& mimetype, const wxString& anchor -#if wxUSE_DATETIME - , wxDateTime modif -#endif // wxUSE_DATETIME - ) - { - m_Stream = stream; - m_Location = loc; - m_MimeType = mimetype; m_MimeType.MakeLower(); - m_Anchor = anchor; -#if wxUSE_DATETIME - m_Modif = modif; -#endif // wxUSE_DATETIME - } - - virtual ~wxFSFile() { delete m_Stream; } - - // returns stream. This doesn't give away ownership of the stream object. - wxInputStream *GetStream() const { return m_Stream; } - - // gives away the ownership of the current stream. - wxInputStream *DetachStream() - { - wxInputStream *stream = m_Stream; - m_Stream = NULL; - return stream; - } - - // deletes the current stream and takes ownership of another. - void SetStream(wxInputStream *stream) - { - delete m_Stream; - m_Stream = stream; - } - - // returns file's mime type - const wxString& GetMimeType() const { return m_MimeType; } - - // returns the original location (aka filename) of the file - const wxString& GetLocation() const { return m_Location; } - - const wxString& GetAnchor() const { return m_Anchor; } - -#if wxUSE_DATETIME - wxDateTime GetModificationTime() const { return m_Modif; } -#endif // wxUSE_DATETIME - -private: - wxInputStream *m_Stream; - wxString m_Location; - wxString m_MimeType; - wxString m_Anchor; -#if wxUSE_DATETIME - wxDateTime m_Modif; -#endif // wxUSE_DATETIME - - DECLARE_ABSTRACT_CLASS(wxFSFile) - DECLARE_NO_COPY_CLASS(wxFSFile) -}; - - - - - -//-------------------------------------------------------------------------------- -// wxFileSystemHandler -// This class is FS handler for wxFileSystem. It provides -// interface to access certain -// kinds of files (HTPP, FTP, local, tar.gz etc..) -//-------------------------------------------------------------------------------- - -class WXDLLIMPEXP_BASE wxFileSystemHandler : public wxObject -{ -public: - wxFileSystemHandler() : wxObject() {} - - // returns true if this handler is able to open given location - virtual bool CanOpen(const wxString& location) = 0; - - // opens given file and returns pointer to input stream. - // Returns NULL if opening failed. - // The location is always absolute path. - virtual wxFSFile* OpenFile(wxFileSystem& fs, const wxString& location) = 0; - - // Finds first/next file that matches spec wildcard. flags can be wxDIR for restricting - // the query to directories or wxFILE for files only or 0 for either. - // Returns filename or empty string if no more matching file exists - virtual wxString FindFirst(const wxString& spec, int flags = 0); - virtual wxString FindNext(); - -protected: - // returns protocol ("file", "http", "tar" etc.) The last (most right) - // protocol is used: - // {it returns "tar" for "file:subdir/archive.tar.gz#tar:/README.txt"} - wxString GetProtocol(const wxString& location) const; - - // returns left part of address: - // {it returns "file:subdir/archive.tar.gz" for "file:subdir/archive.tar.gz#tar:/README.txt"} - wxString GetLeftLocation(const wxString& location) const; - - // returns anchor part of address: - // {it returns "anchor" for "file:subdir/archive.tar.gz#tar:/README.txt#anchor"} - // NOTE: anchor is NOT a part of GetLeftLocation()'s return value - wxString GetAnchor(const wxString& location) const; - - // returns right part of address: - // {it returns "/README.txt" for "file:subdir/archive.tar.gz#tar:/README.txt"} - wxString GetRightLocation(const wxString& location) const; - - // Returns MIME type of the file - w/o need to open it - // (default behaviour is that it returns type based on extension) - wxString GetMimeTypeFromExt(const wxString& location); - - DECLARE_ABSTRACT_CLASS(wxFileSystemHandler) -}; - - - - -//-------------------------------------------------------------------------------- -// wxFileSystem -// This class provides simple interface for opening various -// kinds of files (HTPP, FTP, local, tar.gz etc..) -//-------------------------------------------------------------------------------- - -// Open Bit Flags -enum { - wxFS_READ = 1, // Open for reading - wxFS_SEEKABLE = 4 // Returned stream will be seekable -}; - -WX_DECLARE_VOIDPTR_HASH_MAP_WITH_DECL(wxFileSystemHandler*, wxFSHandlerHash, class WXDLLIMPEXP_BASE); - -class WXDLLIMPEXP_BASE wxFileSystem : public wxObject -{ -public: - wxFileSystem() : wxObject() { m_FindFileHandler = NULL;} - virtual ~wxFileSystem(); - - // sets the current location. Every call to OpenFile is - // relative to this location. - // NOTE !! - // unless is_dir = true 'location' is *not* the directory but - // file contained in this directory - // (so ChangePathTo("dir/subdir/xh.htm") sets m_Path to "dir/subdir/") - void ChangePathTo(const wxString& location, bool is_dir = false); - - wxString GetPath() const {return m_Path;} - - // opens given file and returns pointer to input stream. - // Returns NULL if opening failed. - // It first tries to open the file in relative scope - // (based on ChangePathTo()'s value) and then as an absolute - // path. - wxFSFile* OpenFile(const wxString& location, int flags = wxFS_READ); - - // Finds first/next file that matches spec wildcard. flags can be wxDIR for restricting - // the query to directories or wxFILE for files only or 0 for either. - // Returns filename or empty string if no more matching file exists - wxString FindFirst(const wxString& spec, int flags = 0); - wxString FindNext(); - - // find a file in a list of directories, returns false if not found - bool FindFileInPath(wxString *pStr, const wxChar *path, const wxChar *file); - - // Adds FS handler. - // In fact, this class is only front-end to the FS handlers :-) - static void AddHandler(wxFileSystemHandler *handler); - - // Removes FS handler - static wxFileSystemHandler* RemoveHandler(wxFileSystemHandler *handler); - - // Returns true if there is a handler which can open the given location. - static bool HasHandlerForPath(const wxString& location); - - // remove all items from the m_Handlers list - static void CleanUpHandlers(); - - // Returns the native path for a file URL - static wxFileName URLToFileName(const wxString& url); - - // Returns the file URL for a native path - static wxString FileNameToURL(const wxFileName& filename); - - -protected: - wxFileSystemHandler *MakeLocal(wxFileSystemHandler *h); - - wxString m_Path; - // the path (location) we are currently in - // this is path, not file! - // (so if you opened test/demo.htm, it is - // "test/", not "test/demo.htm") - wxString m_LastName; - // name of last opened file (full path) - static wxList m_Handlers; - // list of FS handlers - wxFileSystemHandler *m_FindFileHandler; - // handler that succeed in FindFirst query - wxFSHandlerHash m_LocalHandlers; - // Handlers local to this instance - - DECLARE_DYNAMIC_CLASS(wxFileSystem) - DECLARE_NO_COPY_CLASS(wxFileSystem) -}; - - -/* - -'location' syntax: - -To determine FS type, we're using standard KDE notation: -file:/absolute/path/file.htm -file:relative_path/xxxxx.html -/some/path/x.file ('file:' is default) -http://www.gnome.org -file:subdir/archive.tar.gz#tar:/README.txt - -special characters : - ':' - FS identificator is before this char - '#' - separator. It can be either HTML anchor ("index.html#news") - (in case there is no ':' in the string to the right from it) - or FS separator - (example : http://www.wxhtml.org/wxhtml-0.1.tar.gz#tar:/include/wxhtml/filesys.h" - this would access tgz archive stored on web) - '/' - directory (path) separator. It is used to determine upper-level path. - HEY! Don't use \ even if you're on Windows! - -*/ - - -class WXDLLIMPEXP_BASE wxLocalFSHandler : public wxFileSystemHandler -{ -public: - virtual bool CanOpen(const wxString& location); - virtual wxFSFile* OpenFile(wxFileSystem& fs, const wxString& location); - virtual wxString FindFirst(const wxString& spec, int flags = 0); - virtual wxString FindNext(); - - // wxLocalFSHandler will prefix all filenames with 'root' before accessing - // files on disk. This effectively makes 'root' the top-level directory - // and prevents access to files outside this directory. - // (This is similar to Unix command 'chroot'.) - static void Chroot(const wxString& root) { ms_root = root; } - -protected: - static wxString ms_root; -}; - - - -#endif - // wxUSE_FILESYSTEM - -#endif - // __FILESYS_H__ diff --git a/wxWidgets/include/wx/flags.h b/wxWidgets/include/wx/flags.h deleted file mode 100644 index a266e4dde3..0000000000 --- a/wxWidgets/include/wx/flags.h +++ /dev/null @@ -1,165 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/flags.h -// Purpose: a bitset suited for replacing the current style flags -// Author: Stefan Csomor -// Modified by: -// Created: 27/07/03 -// RCS-ID: $Id: flags.h 35650 2005-09-23 12:56:45Z MR $ -// Copyright: (c) 2003 Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_SETH__ -#define _WX_SETH__ - -// wxBitset should be applied to an enum, then this can be used like -// bitwise operators but keeps the type safety and information, the -// enums must be in a sequence , their value determines the bit position -// that they represent -// The api is made as close as possible to - -template class wxBitset -{ - friend class wxEnumData ; -public: - // creates a wxBitset<> object with all flags initialized to 0 - wxBitset() { m_data = 0; } - - // created a wxBitset<> object initialized according to the bits of the - // integral value val - wxBitset(unsigned long val) { m_data = val ; } - - // copies the content in the new wxBitset<> object from another one - wxBitset(const wxBitset &src) { m_data = src.m_data; } - - // creates a wxBitset<> object that has the specific flag set - wxBitset(const T el) { m_data |= 1 << el; } - - // returns the integral value that the bits of this object represent - unsigned long to_ulong() const { return m_data ; } - - // assignment - wxBitset &operator =(const wxBitset &rhs) - { - m_data = rhs.m_data; - return *this; - } - - // bitwise or operator, sets all bits that are in rhs and leaves - // the rest unchanged - wxBitset &operator |=(const wxBitset &rhs) - { - m_data |= rhs.m_data; - return *this; - } - - // bitwsie exclusive-or operator, toggles the value of all bits - // that are set in bits and leaves all others unchanged - wxBitset &operator ^=(const wxBitset &rhs) // difference - { - m_data ^= rhs.m_data; - return *this; - } - - // bitwise and operator, resets all bits that are not in rhs and leaves - // all others unchanged - wxBitset &operator &=(const wxBitset &rhs) // intersection - { - m_data &= rhs.m_data; - return *this; - } - - // bitwise or operator, returns a new bitset that has all bits set that set are in - // bitset2 or in this bitset - wxBitset operator |(const wxBitset &bitset2) const // union - { - wxBitset s; - s.m_data = m_data | bitset2.m_data; - return s; - } - - // bitwise exclusive-or operator, returns a new bitset that has all bits set that are set either in - // bitset2 or in this bitset but not in both - wxBitset operator ^(const wxBitset &bitset2) const // difference - { - wxBitset s; - s.m_data = m_data ^ bitset2.m_data; - return s; - } - - // bitwise and operator, returns a new bitset that has all bits set that are set both in - // bitset2 and in this bitset - wxBitset operator &(const wxBitset &bitset2) const // intersection - { - wxBitset s; - s.m_data = m_data & bitset2.m_data; - return s; - } - - // sets appropriate the bit to true - wxBitset& set(const T el) //Add element - { - m_data |= 1 << el; - return *this; - } - - // clears the appropriate flag to false - wxBitset& reset(const T el) //remove element - { - m_data &= ~(1 << el); - return *this; - } - - // clear all flags - wxBitset& reset() - { - m_data = 0; - return *this; - } - - // true if this flag is set - bool test(const T el) const - { - return (m_data & (1 << el)) ? true : false; - } - - // true if no flag is set - bool none() const - { - return m_data == 0; - } - - // true if any flag is set - bool any() const - { - return m_data != 0; - } - - // true if both have the same flags - bool operator ==(const wxBitset &rhs) const - { - return m_data == rhs.m_data; - } - - // true if both differ in their flags set - bool operator !=(const wxBitset &rhs) const - { - return !operator==(rhs); - } - - bool operator[] (const T el) const { return test(el) ; } - -private : - unsigned long m_data; -}; - -#define WX_DEFINE_FLAGS( flags ) \ - class WXDLLEXPORT flags \ - {\ - public : \ - flags(long data=0) :m_data(data) {} \ - long m_data ;\ - bool operator ==(const flags &rhs) const { return m_data == rhs.m_data; }\ - } ; - -#endif diff --git a/wxWidgets/include/wx/fmappriv.h b/wxWidgets/include/wx/fmappriv.h deleted file mode 100644 index 06cf2cdb2c..0000000000 --- a/wxWidgets/include/wx/fmappriv.h +++ /dev/null @@ -1,74 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: wx/fmappriv.h -// Purpose: private wxFontMapper stuff, not to be used by the library users -// Author: Vadim Zeitlin -// Modified by: -// Created: 21.06.2003 (extracted from common/fontmap.cpp) -// RCS-ID: $Id: fmappriv.h 27454 2004-05-26 10:49:43Z JS $ -// Copyright: (c) 1999-2003 Vadim Zeitlin -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_FMAPPRIV_H_ -#define _WX_FMAPPRIV_H_ - -// ---------------------------------------------------------------------------- -// constants -// ---------------------------------------------------------------------------- - -// a special pseudo encoding which means "don't ask me about this charset -// any more" -- we need it to avoid driving the user crazy with asking him -// time after time about the same charset which he [presumably] doesn't -// have the fonts for -enum { wxFONTENCODING_UNKNOWN = -2 }; - -// the config paths we use -#if wxUSE_CONFIG - -#define FONTMAPPER_ROOT_PATH wxT("/wxWindows/FontMapper") -#define FONTMAPPER_CHARSET_PATH wxT("Charsets") -#define FONTMAPPER_CHARSET_ALIAS_PATH wxT("Aliases") - -#endif // wxUSE_CONFIG - -// ---------------------------------------------------------------------------- -// wxFontMapperPathChanger: change the config path during our lifetime -// ---------------------------------------------------------------------------- - -#if wxUSE_CONFIG && wxUSE_FILECONFIG - -class wxFontMapperPathChanger -{ -public: - wxFontMapperPathChanger(wxFontMapperBase *fontMapper, const wxString& path) - { - m_fontMapper = fontMapper; - m_ok = m_fontMapper->ChangePath(path, &m_pathOld); - } - - bool IsOk() const { return m_ok; } - - ~wxFontMapperPathChanger() - { - if ( IsOk() ) - m_fontMapper->RestorePath(m_pathOld); - } - -private: - // the fontmapper object we're working with - wxFontMapperBase *m_fontMapper; - - // the old path to be restored if m_ok - wxString m_pathOld; - - // have we changed the path successfully? - bool m_ok; - - - DECLARE_NO_COPY_CLASS(wxFontMapperPathChanger) -}; - -#endif // wxUSE_CONFIG - -#endif // _WX_FMAPPRIV_H_ - diff --git a/wxWidgets/include/wx/font.h b/wxWidgets/include/wx/font.h deleted file mode 100644 index 2fd044c990..0000000000 --- a/wxWidgets/include/wx/font.h +++ /dev/null @@ -1,251 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/font.h -// Purpose: wxFontBase class: the interface of wxFont -// Author: Vadim Zeitlin -// Modified by: -// Created: 20.09.99 -// RCS-ID: $Id: font.h 53135 2008-04-12 02:31:04Z VZ $ -// Copyright: (c) wxWidgets team -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_FONT_H_BASE_ -#define _WX_FONT_H_BASE_ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -#include "wx/defs.h" // for wxDEFAULT &c -#include "wx/fontenc.h" // the font encoding constants -#include "wx/gdiobj.h" // the base class - -// ---------------------------------------------------------------------------- -// forward declarations -// ---------------------------------------------------------------------------- - -class WXDLLIMPEXP_FWD_CORE wxFontData; -class WXDLLIMPEXP_FWD_CORE wxFontBase; -class WXDLLIMPEXP_FWD_CORE wxFont; -class WXDLLIMPEXP_FWD_CORE wxSize; - -// ---------------------------------------------------------------------------- -// font constants -// ---------------------------------------------------------------------------- - -// standard font families: these may be used only for the font creation, it -// doesn't make sense to query an existing font for its font family as, -// especially if the font had been created from a native font description, it -// may be unknown -enum wxFontFamily -{ - wxFONTFAMILY_DEFAULT = wxDEFAULT, - wxFONTFAMILY_DECORATIVE = wxDECORATIVE, - wxFONTFAMILY_ROMAN = wxROMAN, - wxFONTFAMILY_SCRIPT = wxSCRIPT, - wxFONTFAMILY_SWISS = wxSWISS, - wxFONTFAMILY_MODERN = wxMODERN, - wxFONTFAMILY_TELETYPE = wxTELETYPE, - wxFONTFAMILY_MAX, - wxFONTFAMILY_UNKNOWN = wxFONTFAMILY_MAX -}; - -// font styles -enum wxFontStyle -{ - wxFONTSTYLE_NORMAL = wxNORMAL, - wxFONTSTYLE_ITALIC = wxITALIC, - wxFONTSTYLE_SLANT = wxSLANT, - wxFONTSTYLE_MAX -}; - -// font weights -enum wxFontWeight -{ - wxFONTWEIGHT_NORMAL = wxNORMAL, - wxFONTWEIGHT_LIGHT = wxLIGHT, - wxFONTWEIGHT_BOLD = wxBOLD, - wxFONTWEIGHT_MAX -}; - -// the font flag bits for the new font ctor accepting one combined flags word -enum -{ - // no special flags: font with default weight/slant/anti-aliasing - wxFONTFLAG_DEFAULT = 0, - - // slant flags (default: no slant) - wxFONTFLAG_ITALIC = 1 << 0, - wxFONTFLAG_SLANT = 1 << 1, - - // weight flags (default: medium) - wxFONTFLAG_LIGHT = 1 << 2, - wxFONTFLAG_BOLD = 1 << 3, - - // anti-aliasing flag: force on or off (default: the current system default) - wxFONTFLAG_ANTIALIASED = 1 << 4, - wxFONTFLAG_NOT_ANTIALIASED = 1 << 5, - - // underlined/strikethrough flags (default: no lines) - wxFONTFLAG_UNDERLINED = 1 << 6, - wxFONTFLAG_STRIKETHROUGH = 1 << 7, - - // the mask of all currently used flags - wxFONTFLAG_MASK = wxFONTFLAG_ITALIC | - wxFONTFLAG_SLANT | - wxFONTFLAG_LIGHT | - wxFONTFLAG_BOLD | - wxFONTFLAG_ANTIALIASED | - wxFONTFLAG_NOT_ANTIALIASED | - wxFONTFLAG_UNDERLINED | - wxFONTFLAG_STRIKETHROUGH -}; - -// ---------------------------------------------------------------------------- -// wxFontBase represents a font object -// ---------------------------------------------------------------------------- - -class WXDLLIMPEXP_FWD_CORE wxNativeFontInfo; - -class WXDLLEXPORT wxFontBase : public wxGDIObject -{ -public: - // creator function - virtual ~wxFontBase(); - - // from the font components - static wxFont *New( - int pointSize, // size of the font in points - int family, // see wxFontFamily enum - int style, // see wxFontStyle enum - int weight, // see wxFontWeight enum - bool underlined = false, // not underlined by default - const wxString& face = wxEmptyString, // facename - wxFontEncoding encoding = wxFONTENCODING_DEFAULT); // ISO8859-X, ... - - // from the font components but using the font flags instead of separate - // parameters for each flag - static wxFont *New(int pointSize, - wxFontFamily family, - int flags = wxFONTFLAG_DEFAULT, - const wxString& face = wxEmptyString, - wxFontEncoding encoding = wxFONTENCODING_DEFAULT); - - // from the font components - static wxFont *New( - const wxSize& pixelSize, // size of the font in pixels - int family, // see wxFontFamily enum - int style, // see wxFontStyle enum - int weight, // see wxFontWeight enum - bool underlined = false, // not underlined by default - const wxString& face = wxEmptyString, // facename - wxFontEncoding encoding = wxFONTENCODING_DEFAULT); // ISO8859-X, ... - - // from the font components but using the font flags instead of separate - // parameters for each flag - static wxFont *New(const wxSize& pixelSize, - wxFontFamily family, - int flags = wxFONTFLAG_DEFAULT, - const wxString& face = wxEmptyString, - wxFontEncoding encoding = wxFONTENCODING_DEFAULT); - - // from the (opaque) native font description object - static wxFont *New(const wxNativeFontInfo& nativeFontDesc); - - // from the string representation of wxNativeFontInfo - static wxFont *New(const wxString& strNativeFontDesc); - - // was the font successfully created? - bool Ok() const { return IsOk(); } - bool IsOk() const { return m_refData != NULL; } - - // comparison - bool operator == (const wxFont& font) const; - bool operator != (const wxFont& font) const; - - // accessors: get the font characteristics - virtual int GetPointSize() const = 0; - virtual wxSize GetPixelSize() const; - virtual bool IsUsingSizeInPixels() const; - virtual int GetFamily() const = 0; - virtual int GetStyle() const = 0; - virtual int GetWeight() const = 0; - virtual bool GetUnderlined() const = 0; - virtual wxString GetFaceName() const = 0; - virtual wxFontEncoding GetEncoding() const = 0; - virtual const wxNativeFontInfo *GetNativeFontInfo() const = 0; - - virtual bool IsFixedWidth() const; - - wxString GetNativeFontInfoDesc() const; - wxString GetNativeFontInfoUserDesc() const; - - // change the font characteristics - virtual void SetPointSize( int pointSize ) = 0; - virtual void SetPixelSize( const wxSize& pixelSize ); - virtual void SetFamily( int family ) = 0; - virtual void SetStyle( int style ) = 0; - virtual void SetWeight( int weight ) = 0; - virtual void SetUnderlined( bool underlined ) = 0; - virtual void SetEncoding(wxFontEncoding encoding) = 0; - virtual bool SetFaceName( const wxString& faceName ); - void SetNativeFontInfo(const wxNativeFontInfo& info) - { DoSetNativeFontInfo(info); } - - bool SetNativeFontInfo(const wxString& info); - bool SetNativeFontInfoUserDesc(const wxString& info); - - // translate the fonts into human-readable string (i.e. GetStyleString() - // will return "wxITALIC" for an italic font, ...) - wxString GetFamilyString() const; - wxString GetStyleString() const; - wxString GetWeightString() const; - - // Unofficial API, don't use - virtual void SetNoAntiAliasing( bool WXUNUSED(no) = true ) { } - virtual bool GetNoAntiAliasing() const { return false; } - - // the default encoding is used for creating all fonts with default - // encoding parameter - static wxFontEncoding GetDefaultEncoding() { return ms_encodingDefault; } - static void SetDefaultEncoding(wxFontEncoding encoding); - -protected: - // the function called by both overloads of SetNativeFontInfo() - virtual void DoSetNativeFontInfo(const wxNativeFontInfo& info); - -private: - // the currently default encoding: by default, it's the default system - // encoding, but may be changed by the application using - // SetDefaultEncoding() to make all subsequent fonts created without - // specifying encoding parameter using this encoding - static wxFontEncoding ms_encodingDefault; -}; - -// include the real class declaration -#if defined(__WXPALMOS__) - #include "wx/palmos/font.h" -#elif defined(__WXMSW__) - #include "wx/msw/font.h" -#elif defined(__WXMOTIF__) - #include "wx/motif/font.h" -#elif defined(__WXGTK20__) - #include "wx/gtk/font.h" -#elif defined(__WXGTK__) - #include "wx/gtk1/font.h" -#elif defined(__WXX11__) - #include "wx/x11/font.h" -#elif defined(__WXMGL__) - #include "wx/mgl/font.h" -#elif defined(__WXDFB__) - #include "wx/dfb/font.h" -#elif defined(__WXMAC__) - #include "wx/mac/font.h" -#elif defined(__WXCOCOA__) - #include "wx/cocoa/font.h" -#elif defined(__WXPM__) - #include "wx/os2/font.h" -#endif - -#endif - // _WX_FONT_H_BASE_ diff --git a/wxWidgets/include/wx/fontdlg.h b/wxWidgets/include/wx/fontdlg.h deleted file mode 100644 index 280a567bb7..0000000000 --- a/wxWidgets/include/wx/fontdlg.h +++ /dev/null @@ -1,118 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: wx/fontdlg.h -// Purpose: common interface for different wxFontDialog classes -// Author: Vadim Zeitlin -// Modified by: -// Created: 12.05.02 -// RCS-ID: $Id: fontdlg.h 41846 2006-10-09 22:56:48Z VZ $ -// Copyright: (c) 1997-2002 wxWidgets team -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_FONTDLG_H_BASE_ -#define _WX_FONTDLG_H_BASE_ - -#include "wx/defs.h" // for wxUSE_FONTDLG - -#if wxUSE_FONTDLG - -#include "wx/dialog.h" // the base class -#include "wx/cmndata.h" // wxFontData - -// ---------------------------------------------------------------------------- -// wxFontDialog interface -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxFontDialogBase : public wxDialog -{ -public: - // create the font dialog - wxFontDialogBase() { } - wxFontDialogBase(wxWindow *parent) { m_parent = parent; } - wxFontDialogBase(wxWindow *parent, const wxFontData& data) - { m_parent = parent; InitFontData(&data); } - - bool Create(wxWindow *parent) - { return DoCreate(parent); } - bool Create(wxWindow *parent, const wxFontData& data) - { InitFontData(&data); return Create(parent); } - - virtual ~wxFontDialogBase(); - - // retrieve the font data - const wxFontData& GetFontData() const { return m_fontData; } - wxFontData& GetFontData() { return m_fontData; } - -#if WXWIN_COMPATIBILITY_2_6 - // deprecated interface, for compatibility only, don't use - wxDEPRECATED( wxFontDialogBase(wxWindow *parent, const wxFontData *data) ); - - wxDEPRECATED( bool Create(wxWindow *parent, const wxFontData *data) ); -#endif // WXWIN_COMPATIBILITY_2_6 - -protected: - virtual bool DoCreate(wxWindow *parent) { m_parent = parent; return true; } - - void InitFontData(const wxFontData *data = NULL) - { if ( data ) m_fontData = *data; } - - wxFontData m_fontData; - - DECLARE_NO_COPY_CLASS(wxFontDialogBase) -}; - -#if WXWIN_COMPATIBILITY_2_6 - // deprecated interface, for compatibility only, don't use -inline wxFontDialogBase::wxFontDialogBase(wxWindow *parent, const wxFontData *data) -{ m_parent = parent; InitFontData(data); } - -inline bool wxFontDialogBase::Create(wxWindow *parent, const wxFontData *data) -{ InitFontData(data); return Create(parent); } -#endif // WXWIN_COMPATIBILITY_2_6 - -// ---------------------------------------------------------------------------- -// platform-specific wxFontDialog implementation -// ---------------------------------------------------------------------------- - -#if defined( __WXMAC_OSX__ ) && ( MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_2 ) -//set to 1 to use native mac font and color dialogs -#define USE_NATIVE_FONT_DIALOG_FOR_MACOSX 1 -#else -//not supported on these platforms, leave 0 -#define USE_NATIVE_FONT_DIALOG_FOR_MACOSX 0 -#endif - -#if defined(__WXUNIVERSAL__) || \ - defined(__WXMOTIF__) || \ - defined(__WXCOCOA__) || \ - defined(__WXWINCE__) || \ - defined(__WXGPE__) - - #include "wx/generic/fontdlgg.h" - #define wxFontDialog wxGenericFontDialog -#elif defined(__WXMSW__) - #include "wx/msw/fontdlg.h" -#elif defined(__WXGTK20__) - #include "wx/gtk/fontdlg.h" -#elif defined(__WXGTK__) - #include "wx/gtk1/fontdlg.h" -#elif defined(__WXPM__) - #include "wx/os2/fontdlg.h" -#elif defined(__WXMAC__) - #include "wx/mac/fontdlg.h" -#endif - -// ---------------------------------------------------------------------------- -// global public functions -// ---------------------------------------------------------------------------- - -// get the font from user and return it, returns wxNullFont if the dialog was -// cancelled -wxFont WXDLLEXPORT -wxGetFontFromUser(wxWindow *parent = (wxWindow *)NULL, - const wxFont& fontInit = wxNullFont, const wxString& caption = wxEmptyString); - -#endif // wxUSE_FONTDLG - -#endif - // _WX_FONTDLG_H_BASE_ diff --git a/wxWidgets/include/wx/fontenc.h b/wxWidgets/include/wx/fontenc.h deleted file mode 100644 index 7ac0d63a3e..0000000000 --- a/wxWidgets/include/wx/fontenc.h +++ /dev/null @@ -1,151 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/fontenc.h -// Purpose: wxFontEncoding constants -// Author: Vadim Zeitlin -// Modified by: -// Created: 29.03.00 -// RCS-ID: $Id: fontenc.h 29139 2004-09-14 12:08:28Z ABX $ -// Copyright: (c) Vadim Zeitlin -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_FONTENC_H_ -#define _WX_FONTENC_H_ - -// font encodings -enum wxFontEncoding -{ - wxFONTENCODING_SYSTEM = -1, // system default - wxFONTENCODING_DEFAULT, // current default encoding - - // ISO8859 standard defines a number of single-byte charsets - wxFONTENCODING_ISO8859_1, // West European (Latin1) - wxFONTENCODING_ISO8859_2, // Central and East European (Latin2) - wxFONTENCODING_ISO8859_3, // Esperanto (Latin3) - wxFONTENCODING_ISO8859_4, // Baltic (old) (Latin4) - wxFONTENCODING_ISO8859_5, // Cyrillic - wxFONTENCODING_ISO8859_6, // Arabic - wxFONTENCODING_ISO8859_7, // Greek - wxFONTENCODING_ISO8859_8, // Hebrew - wxFONTENCODING_ISO8859_9, // Turkish (Latin5) - wxFONTENCODING_ISO8859_10, // Variation of Latin4 (Latin6) - wxFONTENCODING_ISO8859_11, // Thai - wxFONTENCODING_ISO8859_12, // doesn't exist currently, but put it - // here anyhow to make all ISO8859 - // consecutive numbers - wxFONTENCODING_ISO8859_13, // Baltic (Latin7) - wxFONTENCODING_ISO8859_14, // Latin8 - wxFONTENCODING_ISO8859_15, // Latin9 (a.k.a. Latin0, includes euro) - wxFONTENCODING_ISO8859_MAX, - - // Cyrillic charset soup (see http://czyborra.com/charsets/cyrillic.html) - wxFONTENCODING_KOI8, // KOI8 Russian - wxFONTENCODING_KOI8_U, // KOI8 Ukrainian - wxFONTENCODING_ALTERNATIVE, // same as MS-DOS CP866 - wxFONTENCODING_BULGARIAN, // used under Linux in Bulgaria - - // what would we do without Microsoft? They have their own encodings - // for DOS - wxFONTENCODING_CP437, // original MS-DOS codepage - wxFONTENCODING_CP850, // CP437 merged with Latin1 - wxFONTENCODING_CP852, // CP437 merged with Latin2 - wxFONTENCODING_CP855, // another cyrillic encoding - wxFONTENCODING_CP866, // and another one - // and for Windows - wxFONTENCODING_CP874, // WinThai - wxFONTENCODING_CP932, // Japanese (shift-JIS) - wxFONTENCODING_CP936, // Chinese simplified (GB) - wxFONTENCODING_CP949, // Korean (Hangul charset) - wxFONTENCODING_CP950, // Chinese (traditional - Big5) - wxFONTENCODING_CP1250, // WinLatin2 - wxFONTENCODING_CP1251, // WinCyrillic - wxFONTENCODING_CP1252, // WinLatin1 - wxFONTENCODING_CP1253, // WinGreek (8859-7) - wxFONTENCODING_CP1254, // WinTurkish - wxFONTENCODING_CP1255, // WinHebrew - wxFONTENCODING_CP1256, // WinArabic - wxFONTENCODING_CP1257, // WinBaltic (same as Latin 7) - wxFONTENCODING_CP12_MAX, - - wxFONTENCODING_UTF7, // UTF-7 Unicode encoding - wxFONTENCODING_UTF8, // UTF-8 Unicode encoding - wxFONTENCODING_EUC_JP, // Extended Unix Codepage for Japanese - wxFONTENCODING_UTF16BE, // UTF-16 Big Endian Unicode encoding - wxFONTENCODING_UTF16LE, // UTF-16 Little Endian Unicode encoding - wxFONTENCODING_UTF32BE, // UTF-32 Big Endian Unicode encoding - wxFONTENCODING_UTF32LE, // UTF-32 Little Endian Unicode encoding - - wxFONTENCODING_MACROMAN, // the standard mac encodings - wxFONTENCODING_MACJAPANESE, - wxFONTENCODING_MACCHINESETRAD, - wxFONTENCODING_MACKOREAN, - wxFONTENCODING_MACARABIC, - wxFONTENCODING_MACHEBREW, - wxFONTENCODING_MACGREEK, - wxFONTENCODING_MACCYRILLIC, - wxFONTENCODING_MACDEVANAGARI, - wxFONTENCODING_MACGURMUKHI, - wxFONTENCODING_MACGUJARATI, - wxFONTENCODING_MACORIYA, - wxFONTENCODING_MACBENGALI, - wxFONTENCODING_MACTAMIL, - wxFONTENCODING_MACTELUGU, - wxFONTENCODING_MACKANNADA, - wxFONTENCODING_MACMALAJALAM, - wxFONTENCODING_MACSINHALESE, - wxFONTENCODING_MACBURMESE, - wxFONTENCODING_MACKHMER, - wxFONTENCODING_MACTHAI, - wxFONTENCODING_MACLAOTIAN, - wxFONTENCODING_MACGEORGIAN, - wxFONTENCODING_MACARMENIAN, - wxFONTENCODING_MACCHINESESIMP, - wxFONTENCODING_MACTIBETAN, - wxFONTENCODING_MACMONGOLIAN, - wxFONTENCODING_MACETHIOPIC, - wxFONTENCODING_MACCENTRALEUR, - wxFONTENCODING_MACVIATNAMESE, - wxFONTENCODING_MACARABICEXT, - wxFONTENCODING_MACSYMBOL, - wxFONTENCODING_MACDINGBATS, - wxFONTENCODING_MACTURKISH, - wxFONTENCODING_MACCROATIAN, - wxFONTENCODING_MACICELANDIC, - wxFONTENCODING_MACROMANIAN, - wxFONTENCODING_MACCELTIC, - wxFONTENCODING_MACGAELIC, - wxFONTENCODING_MACKEYBOARD, - - wxFONTENCODING_MAX, // highest enumerated encoding value - - wxFONTENCODING_MACMIN = wxFONTENCODING_MACROMAN , - wxFONTENCODING_MACMAX = wxFONTENCODING_MACKEYBOARD , - - // aliases for endian-dependent UTF encodings -#ifdef WORDS_BIGENDIAN - wxFONTENCODING_UTF16 = wxFONTENCODING_UTF16BE, // native UTF-16 - wxFONTENCODING_UTF32 = wxFONTENCODING_UTF32BE, // native UTF-32 -#else // WORDS_BIGENDIAN - wxFONTENCODING_UTF16 = wxFONTENCODING_UTF16LE, // native UTF-16 - wxFONTENCODING_UTF32 = wxFONTENCODING_UTF32LE, // native UTF-32 -#endif // WORDS_BIGENDIAN - - // alias for the native Unicode encoding on this platform - // (this is used by wxEncodingConverter and wxUTFFile only for now) -#if SIZEOF_WCHAR_T == 2 - wxFONTENCODING_UNICODE = wxFONTENCODING_UTF16, -#else // SIZEOF_WCHAR_T == 4 - wxFONTENCODING_UNICODE = wxFONTENCODING_UTF32, -#endif - - // alternative names for Far Eastern encodings - // Chinese - wxFONTENCODING_GB2312 = wxFONTENCODING_CP936, // Simplified Chinese - wxFONTENCODING_BIG5 = wxFONTENCODING_CP950, // Traditional Chinese - - // Japanese (see http://zsigri.tripod.com/fontboard/cjk/jis.html) - wxFONTENCODING_SHIFT_JIS = wxFONTENCODING_CP932 // Shift JIS -}; - -#endif // _WX_FONTENC_H_ - diff --git a/wxWidgets/include/wx/fontenum.h b/wxWidgets/include/wx/fontenum.h deleted file mode 100644 index c4f8d98819..0000000000 --- a/wxWidgets/include/wx/fontenum.h +++ /dev/null @@ -1,88 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/fontenum.h -// Purpose: wxFontEnumerator class for getting available fonts -// Author: Julian Smart, Vadim Zeitlin -// Modified by: extended to enumerate more than just font facenames and works -// not only on Windows now (VZ) -// Created: 04/01/98 -// RCS-ID: $Id: fontenum.h 43727 2006-12-01 10:14:28Z VS $ -// Copyright: (c) Julian Smart, Vadim Zeitlin -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_FONTENUM_H_ -#define _WX_FONTENUM_H_ - -#include "wx/fontenc.h" -#include "wx/arrstr.h" - -#if wxUSE_PANGO || defined(__WXDFB__) - // defined if the port uses only UTF-8 font encodings internally - #define wxHAS_UTF8_FONTS -#endif - -// ---------------------------------------------------------------------------- -// wxFontEnumerator enumerates all available fonts on the system or only the -// fonts with given attributes -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxFontEnumerator -{ -public: - wxFontEnumerator() {} - - // virtual dtor for the base class - virtual ~wxFontEnumerator() {} - - // start enumerating font facenames (either all of them or those which - // support the given encoding) - will result in OnFacename() being - // called for each available facename (until they are exhausted or - // OnFacename returns false) - virtual bool EnumerateFacenames - ( - wxFontEncoding encoding = wxFONTENCODING_SYSTEM, // all - bool fixedWidthOnly = false - ); - - // enumerate the different encodings either for given font facename or for - // all facenames - will result in OnFontEncoding() being called for each - // available (facename, encoding) couple - virtual bool EnumerateEncodings(const wxString& facename = wxEmptyString); - - // callbacks which are called after one of EnumerateXXX() functions from - // above is invoked - all of them may return false to stop enumeration or - // true to continue with it - - // called by EnumerateFacenames - virtual bool OnFacename(const wxString& WXUNUSED(facename)) - { return true; } - - // called by EnumerateEncodings - virtual bool OnFontEncoding(const wxString& WXUNUSED(facename), - const wxString& WXUNUSED(encoding)) - { return true; } - - - - // convenience function that returns array of facenames. - static wxArrayString - GetFacenames(wxFontEncoding encoding = wxFONTENCODING_SYSTEM, // all - bool fixedWidthOnly = false); - - // convenience function that returns array of all available encodings. - static wxArrayString GetEncodings(const wxString& facename = wxEmptyString); - - // convenience function that returns true if the given face name exist - // in the user's system - static bool IsValidFacename(const wxString &str); - -private: -#ifdef wxHAS_UTF8_FONTS - // helper for ports that only use UTF-8 encoding natively - bool EnumerateEncodingsUTF8(const wxString& facename); -#endif - - DECLARE_NO_COPY_CLASS(wxFontEnumerator) -}; - -#endif // _WX_FONTENUM_H_ diff --git a/wxWidgets/include/wx/fontmap.h b/wxWidgets/include/wx/fontmap.h deleted file mode 100644 index ff6684fa6e..0000000000 --- a/wxWidgets/include/wx/fontmap.h +++ /dev/null @@ -1,290 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/fontmap.h -// Purpose: wxFontMapper class -// Author: Vadim Zeitlin -// Modified by: -// Created: 04.11.99 -// RCS-ID: $Id: fontmap.h 49563 2007-10-31 20:46:21Z VZ $ -// Copyright: (c) Vadim Zeitlin -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_FONTMAPPER_H_ -#define _WX_FONTMAPPER_H_ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -#if wxUSE_FONTMAP - -#include "wx/fontenc.h" // for wxFontEncoding - -#if wxUSE_GUI - #include "wx/fontutil.h" // for wxNativeEncodingInfo -#endif // wxUSE_GUI - -#if wxUSE_CONFIG && wxUSE_FILECONFIG - class WXDLLIMPEXP_FWD_BASE wxConfigBase; -#endif // wxUSE_CONFIG - -class WXDLLIMPEXP_FWD_CORE wxFontMapper; - -#if wxUSE_GUI - class WXDLLIMPEXP_FWD_CORE wxWindow; -#endif // wxUSE_GUI - -// ============================================================================ -// wxFontMapper manages user-definable correspondence between wxWidgets font -// encodings and the fonts present on the machine. -// -// This is a singleton class, font mapper objects can only be accessed using -// wxFontMapper::Get(). -// ============================================================================ - -// ---------------------------------------------------------------------------- -// wxFontMapperBase: this is a non-interactive class which just uses its built -// in knowledge of the encodings equivalence -// ---------------------------------------------------------------------------- - -class WXDLLIMPEXP_BASE wxFontMapperBase -{ -public: - // constructtor and such - // --------------------- - - // default ctor - wxFontMapperBase(); - - // virtual dtor for any base class - virtual ~wxFontMapperBase(); - - // return instance of the wxFontMapper singleton - // wxBase code only cares that it's a wxFontMapperBase - // In wxBase, wxFontMapper is only forward declared - // so one cannot implicitly cast from it to wxFontMapperBase. - static wxFontMapperBase *Get(); - - // set the singleton to 'mapper' instance and return previous one - static wxFontMapper *Set(wxFontMapper *mapper); - - // delete the existing font mapper if any - static void Reset(); - - - // translates charset strings to encoding - // -------------------------------------- - - // returns the encoding for the given charset (in the form of RFC 2046) or - // wxFONTENCODING_SYSTEM if couldn't decode it - // - // interactive parameter is ignored in the base class, we behave as if it - // were always false - virtual wxFontEncoding CharsetToEncoding(const wxString& charset, - bool interactive = true); - - // information about supported encodings - // ------------------------------------- - - // get the number of font encodings we know about - static size_t GetSupportedEncodingsCount(); - - // get the n-th supported encoding - static wxFontEncoding GetEncoding(size_t n); - - // return canonical name of this encoding (this is a short string, - // GetEncodingDescription() returns a longer one) - static wxString GetEncodingName(wxFontEncoding encoding); - - // return a list of all names of this encoding (see GetEncodingName) - static const wxChar** GetAllEncodingNames(wxFontEncoding encoding); - - // return user-readable string describing the given encoding - // - // NB: hard-coded now, but might change later (read it from config?) - static wxString GetEncodingDescription(wxFontEncoding encoding); - - // find the encoding corresponding to the given name, inverse of - // GetEncodingName() and less general than CharsetToEncoding() - // - // returns wxFONTENCODING_MAX if the name is not a supported encoding - static wxFontEncoding GetEncodingFromName(const wxString& name); - - - // functions which allow to configure the config object used: by default, - // the global one (from wxConfigBase::Get() will be used) and the default - // root path for the config settings is the string returned by - // GetDefaultConfigPath() - // ---------------------------------------------------------------------- - -#if wxUSE_CONFIG && wxUSE_FILECONFIG - // set the root config path to use (should be an absolute path) - void SetConfigPath(const wxString& prefix); - - // return default config path - static const wxChar *GetDefaultConfigPath(); -#endif // wxUSE_CONFIG - - - // returns true for the base class and false for a "real" font mapper object - // (implementation-only) - virtual bool IsDummy() { return true; } - -protected: -#if wxUSE_CONFIG && wxUSE_FILECONFIG - // get the config object we're using -- either the global config object - // or a wxMemoryConfig object created by this class otherwise - wxConfigBase *GetConfig(); - - // gets the root path for our settings -- if it wasn't set explicitly, use - // GetDefaultConfigPath() - const wxString& GetConfigPath(); - - // change to the given (relative) path in the config, return true if ok - // (then GetConfig() will return something !NULL), false if no config - // object - // - // caller should provide a pointer to the string variable which should be - // later passed to RestorePath() - bool ChangePath(const wxString& pathNew, wxString *pathOld); - - // restore the config path after use - void RestorePath(const wxString& pathOld); - - // config object and path (in it) to use - wxConfigBase *m_configDummy; - - wxString m_configRootPath; -#endif // wxUSE_CONFIG - - // the real implementation of the base class version of CharsetToEncoding() - // - // returns wxFONTENCODING_UNKNOWN if encoding is unknown and we shouldn't - // ask the user about it, wxFONTENCODING_SYSTEM if it is unknown but we - // should/could ask the user - int NonInteractiveCharsetToEncoding(const wxString& charset); - -private: - // the global fontmapper object or NULL - static wxFontMapper *sm_instance; - - friend class wxFontMapperPathChanger; - - DECLARE_NO_COPY_CLASS(wxFontMapperBase) -}; - -// ---------------------------------------------------------------------------- -// wxFontMapper: interactive extension of wxFontMapperBase -// -// The default implementations of all functions will ask the user if they are -// not capable of finding the answer themselves and store the answer in a -// config file (configurable via SetConfigXXX functions). This behaviour may -// be disabled by giving the value of false to "interactive" parameter. -// However, the functions will always consult the config file to allow the -// user-defined values override the default logic and there is no way to -// disable this -- which shouldn't be ever needed because if "interactive" was -// never true, the config file is never created anyhow. -// ---------------------------------------------------------------------------- - -#if wxUSE_GUI - -class WXDLLIMPEXP_CORE wxFontMapper : public wxFontMapperBase -{ -public: - // default ctor - wxFontMapper(); - - // virtual dtor for a base class - virtual ~wxFontMapper(); - - // working with the encodings - // -------------------------- - - // returns the encoding for the given charset (in the form of RFC 2046) or - // wxFONTENCODING_SYSTEM if couldn't decode it - virtual wxFontEncoding CharsetToEncoding(const wxString& charset, - bool interactive = true); - - // find an alternative for the given encoding (which is supposed to not be - // available on this system). If successful, return true and fill info - // structure with the parameters required to create the font, otherwise - // return false - virtual bool GetAltForEncoding(wxFontEncoding encoding, - wxNativeEncodingInfo *info, - const wxString& facename = wxEmptyString, - bool interactive = true); - - // version better suitable for 'public' use. Returns wxFontEcoding - // that can be used it wxFont ctor - bool GetAltForEncoding(wxFontEncoding encoding, - wxFontEncoding *alt_encoding, - const wxString& facename = wxEmptyString, - bool interactive = true); - - // checks whether given encoding is available in given face or not. - // - // if no facename is given (default), return true if it's available in any - // facename at alll. - virtual bool IsEncodingAvailable(wxFontEncoding encoding, - const wxString& facename = wxEmptyString); - - - // configure the appearance of the dialogs we may popup - // ---------------------------------------------------- - - // the parent window for modal dialogs - void SetDialogParent(wxWindow *parent) { m_windowParent = parent; } - - // the title for the dialogs (note that default is quite reasonable) - void SetDialogTitle(const wxString& title) { m_titleDialog = title; } - - // GUI code needs to know it's a wxFontMapper because there - // are additional methods in the subclass. - static wxFontMapper *Get(); - - // pseudo-RTTI since we aren't a wxObject. - virtual bool IsDummy() { return false; } - -protected: - // GetAltForEncoding() helper: tests for the existence of the given - // encoding and saves the result in config if ok - this results in the - // following (desired) behaviour: when an unknown/unavailable encoding is - // requested for the first time, the user is asked about a replacement, - // but if he doesn't choose any and the default logic finds one, it will - // be saved in the config so that the user won't be asked about it any - // more - bool TestAltEncoding(const wxString& configEntry, - wxFontEncoding encReplacement, - wxNativeEncodingInfo *info); - - // the title for our dialogs - wxString m_titleDialog; - - // the parent window for our dialogs - wxWindow *m_windowParent; - -private: - DECLARE_NO_COPY_CLASS(wxFontMapper) -}; - -#endif // wxUSE_GUI - -// ---------------------------------------------------------------------------- -// global variables -// ---------------------------------------------------------------------------- - -// the default font mapper for wxWidgets programs do NOT use! This is for -// backward compatibility, use wxFontMapper::Get() instead -#define wxTheFontMapper (wxFontMapper::Get()) - -#else // !wxUSE_FONTMAP - -#if wxUSE_GUI - // wxEncodingToCodepage (utils.cpp) needs wxGetNativeFontEncoding - #include "wx/fontutil.h" -#endif - -#endif // wxUSE_FONTMAP/!wxUSE_FONTMAP - -#endif // _WX_FONTMAPPER_H_ - diff --git a/wxWidgets/include/wx/fontpicker.h b/wxWidgets/include/wx/fontpicker.h deleted file mode 100644 index ff02eddd5c..0000000000 --- a/wxWidgets/include/wx/fontpicker.h +++ /dev/null @@ -1,223 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/fontpicker.h -// Purpose: wxFontPickerCtrl base header -// Author: Francesco Montorsi -// Modified by: -// Created: 14/4/2006 -// Copyright: (c) Francesco Montorsi -// RCS-ID: $Id: fontpicker.h 53135 2008-04-12 02:31:04Z VZ $ -// Licence: wxWindows Licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_FONTPICKER_H_BASE_ -#define _WX_FONTPICKER_H_BASE_ - -#include "wx/defs.h" - - -#if wxUSE_FONTPICKERCTRL - -#include "wx/pickerbase.h" - - -class WXDLLIMPEXP_FWD_CORE wxFontPickerEvent; - -extern WXDLLEXPORT_DATA(const wxChar) wxFontPickerWidgetNameStr[]; -extern WXDLLEXPORT_DATA(const wxChar) wxFontPickerCtrlNameStr[]; - - -// ---------------------------------------------------------------------------- -// wxFontPickerWidgetBase: a generic abstract interface which must be -// implemented by controls used by wxFontPickerCtrl -// ---------------------------------------------------------------------------- - -class WXDLLIMPEXP_CORE wxFontPickerWidgetBase -{ -public: - wxFontPickerWidgetBase() { m_selectedFont = *wxNORMAL_FONT; } - virtual ~wxFontPickerWidgetBase() {} - - wxFont GetSelectedFont() const - { return m_selectedFont; } - virtual void SetSelectedFont(const wxFont &f) - { m_selectedFont = f; UpdateFont(); } - -protected: - - virtual void UpdateFont() = 0; - - // the current font (may be invalid if none) - // NOTE: don't call this m_font as wxWindow::m_font already exists - wxFont m_selectedFont; -}; - -// Styles which must be supported by all controls implementing wxFontPickerWidgetBase -// NB: these styles must be defined to carefully-chosen values to -// avoid conflicts with wxButton's styles - - -// keeps the label of the button updated with the fontface name + font size -// E.g. choosing "Times New Roman bold, italic with size 10" from the fontdialog, -// updates the wxFontButtonGeneric's label (overwriting any previous label) -// with the "Times New Roman, 10" text (only fontface + fontsize is displayed -// to avoid extralong labels). -#define wxFNTP_FONTDESC_AS_LABEL 0x0008 - -// uses the currently selected font to draw the label of the button -#define wxFNTP_USEFONT_FOR_LABEL 0x0010 - -// since GTK > 2.4, there is GtkFontButton -#if defined(__WXGTK24__) && !defined(__WXUNIVERSAL__) - #include "wx/gtk/fontpicker.h" - #define wxFontPickerWidget wxFontButton -#else - #include "wx/generic/fontpickerg.h" - #define wxFontPickerWidget wxGenericFontButton -#endif - - -// ---------------------------------------------------------------------------- -// wxFontPickerCtrl specific flags -// ---------------------------------------------------------------------------- - -#define wxFNTP_USE_TEXTCTRL (wxPB_USE_TEXTCTRL) -#define wxFNTP_DEFAULT_STYLE (wxFNTP_FONTDESC_AS_LABEL|wxFNTP_USEFONT_FOR_LABEL) - -// not a style but rather the default value of the maximum pointsize allowed -#define wxFNTP_MAXPOINT_SIZE 100 - - -// ---------------------------------------------------------------------------- -// wxFontPickerCtrl: platform-independent class which embeds the -// platform-dependent wxFontPickerWidget andm if wxFNTP_USE_TEXTCTRL style is -// used, a textctrl next to it. -// ---------------------------------------------------------------------------- - -class WXDLLIMPEXP_CORE wxFontPickerCtrl : public wxPickerBase -{ -public: - wxFontPickerCtrl() - : m_bIgnoreNextTextCtrlUpdate(false), - m_nMaxPointSize(wxFNTP_MAXPOINT_SIZE) - { - } - - virtual ~wxFontPickerCtrl() {} - - - wxFontPickerCtrl(wxWindow *parent, - wxWindowID id, - const wxFont& initial = wxNullFont, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = wxFNTP_DEFAULT_STYLE, - const wxValidator& validator = wxDefaultValidator, - const wxString& name = wxFontPickerCtrlNameStr) - : m_bIgnoreNextTextCtrlUpdate(false), - m_nMaxPointSize(wxFNTP_MAXPOINT_SIZE) - { - Create(parent, id, initial, pos, size, style, validator, name); - } - - bool Create(wxWindow *parent, - wxWindowID id, - const wxFont& initial = wxNullFont, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = wxFNTP_DEFAULT_STYLE, - const wxValidator& validator = wxDefaultValidator, - const wxString& name = wxFontPickerCtrlNameStr); - - -public: // public API - - // get the font chosen - wxFont GetSelectedFont() const - { return ((wxFontPickerWidget *)m_picker)->GetSelectedFont(); } - - // sets currently displayed font - void SetSelectedFont(const wxFont& f); - - // set/get the max pointsize - void SetMaxPointSize(unsigned int max) - { m_nMaxPointSize=max; } - unsigned int GetMaxPointSize() const - { return m_nMaxPointSize; } - -public: // internal functions - - void UpdatePickerFromTextCtrl(); - void UpdateTextCtrlFromPicker(); - - // event handler for our picker - void OnFontChange(wxFontPickerEvent &); - - // used to convert wxString <-> wxFont - virtual wxString Font2String(const wxFont &font); - virtual wxFont String2Font(const wxString &font); - -protected: - - // extracts the style for our picker from wxFontPickerCtrl's style - long GetPickerStyle(long style) const - { return (style & (wxFNTP_FONTDESC_AS_LABEL|wxFNTP_USEFONT_FOR_LABEL)); } - - // true if the next UpdateTextCtrl() call is to ignore - bool m_bIgnoreNextTextCtrlUpdate; - - // the maximum pointsize allowed to the user - unsigned int m_nMaxPointSize; - -private: - DECLARE_DYNAMIC_CLASS(wxFontPickerCtrl) -}; - - -// ---------------------------------------------------------------------------- -// wxFontPickerEvent: used by wxFontPickerCtrl only -// ---------------------------------------------------------------------------- - -BEGIN_DECLARE_EVENT_TYPES() - DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_CORE, wxEVT_COMMAND_FONTPICKER_CHANGED, 1102) -END_DECLARE_EVENT_TYPES() - -class WXDLLIMPEXP_CORE wxFontPickerEvent : public wxCommandEvent -{ -public: - wxFontPickerEvent() {} - wxFontPickerEvent(wxObject *generator, int id, const wxFont &f) - : wxCommandEvent(wxEVT_COMMAND_FONTPICKER_CHANGED, id), - m_font(f) - { - SetEventObject(generator); - } - - wxFont GetFont() const { return m_font; } - void SetFont(const wxFont &c) { m_font = c; } - - // default copy ctor, assignment operator and dtor are ok - virtual wxEvent *Clone() const { return new wxFontPickerEvent(*this); } - -private: - wxFont m_font; - - DECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxFontPickerEvent) -}; - -// ---------------------------------------------------------------------------- -// event types and macros -// ---------------------------------------------------------------------------- - -typedef void (wxEvtHandler::*wxFontPickerEventFunction)(wxFontPickerEvent&); - -#define wxFontPickerEventHandler(func) \ - (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxFontPickerEventFunction, &func) - -#define EVT_FONTPICKER_CHANGED(id, fn) \ - wx__DECLARE_EVT1(wxEVT_COMMAND_FONTPICKER_CHANGED, id, wxFontPickerEventHandler(fn)) - - -#endif // wxUSE_FONTPICKERCTRL - -#endif - // _WX_FONTPICKER_H_BASE_ diff --git a/wxWidgets/include/wx/fontutil.h b/wxWidgets/include/wx/fontutil.h deleted file mode 100644 index a2a1124098..0000000000 --- a/wxWidgets/include/wx/fontutil.h +++ /dev/null @@ -1,242 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/fontutil.h -// Purpose: font-related helper functions -// Author: Vadim Zeitlin -// Modified by: -// Created: 05.11.99 -// RCS-ID: $Id: fontutil.h 49563 2007-10-31 20:46:21Z VZ $ -// Copyright: (c) wxWidgets team -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// General note: this header is private to wxWidgets and is not supposed to be -// included by user code. The functions declared here are implemented in -// msw/fontutil.cpp for Windows, unix/fontutil.cpp for GTK/Motif &c. - -#ifndef _WX_FONTUTIL_H_ -#define _WX_FONTUTIL_H_ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -#include "wx/font.h" // for wxFont and wxFontEncoding - -#if defined(__WXMSW__) - #include "wx/msw/wrapwin.h" -#endif - -class WXDLLIMPEXP_FWD_BASE wxArrayString; -struct WXDLLIMPEXP_FWD_CORE wxNativeEncodingInfo; - -#if defined(_WX_X_FONTLIKE) - -// the symbolic names for the XLFD fields (with examples for their value) -// -// NB: we suppose that the font always starts with the empty token (font name -// registry field) as we never use nor generate it anyhow -enum wxXLFDField -{ - wxXLFD_FOUNDRY, // adobe - wxXLFD_FAMILY, // courier, times, ... - wxXLFD_WEIGHT, // black, bold, demibold, medium, regular, light - wxXLFD_SLANT, // r/i/o (roman/italique/oblique) - wxXLFD_SETWIDTH, // condensed, expanded, ... - wxXLFD_ADDSTYLE, // whatever - usually nothing - wxXLFD_PIXELSIZE, // size in pixels - wxXLFD_POINTSIZE, // size in points - wxXLFD_RESX, // 72, 75, 100, ... - wxXLFD_RESY, - wxXLFD_SPACING, // m/p/c (monospaced/proportional/character cell) - wxXLFD_AVGWIDTH, // average width in 1/10 pixels - wxXLFD_REGISTRY, // iso8859, rawin, koi8, ... - wxXLFD_ENCODING, // 1, r, r, ... - wxXLFD_MAX -}; - -#endif // _WX_X_FONTLIKE - -// ---------------------------------------------------------------------------- -// types -// ---------------------------------------------------------------------------- - -// wxNativeFontInfo is platform-specific font representation: this struct -// should be considered as opaque font description only used by the native -// functions, the user code can only get the objects of this type from -// somewhere and pass it somewhere else (possibly save them somewhere using -// ToString() and restore them using FromString()) -class WXDLLEXPORT wxNativeFontInfo -{ -public: -#if wxUSE_PANGO - PangoFontDescription *description; -#elif defined(_WX_X_FONTLIKE) - // the members can't be accessed directly as we only parse the - // xFontName on demand -private: - // the components of the XLFD - wxString fontElements[wxXLFD_MAX]; - - // the full XLFD - wxString xFontName; - - // true until SetXFontName() is called - bool m_isDefault; - - // return true if we have already initialized fontElements - inline bool HasElements() const; - -public: - // init the elements from an XLFD, return true if ok - bool FromXFontName(const wxString& xFontName); - - // return false if we were never initialized with a valid XLFD - bool IsDefault() const { return m_isDefault; } - - // return the XLFD (using the fontElements if necessary) - wxString GetXFontName() const; - - // get the given XFLD component - wxString GetXFontComponent(wxXLFDField field) const; - - // change the font component - void SetXFontComponent(wxXLFDField field, const wxString& value); - - // set the XFLD - void SetXFontName(const wxString& xFontName); -#elif defined(__WXMSW__) - LOGFONT lf; -#elif defined(__WXPM__) - // OS/2 native structures that define a font - FATTRS fa; - FONTMETRICS fm; - FACENAMEDESC fn; -#else // other platforms - // - // This is a generic implementation that should work on all ports - // without specific support by the port. - // - #define wxNO_NATIVE_FONTINFO - - int pointSize; - wxFontFamily family; - wxFontStyle style; - wxFontWeight weight; - bool underlined; - wxString faceName; - wxFontEncoding encoding; -#endif // platforms - - // default ctor (default copy ctor is ok) - wxNativeFontInfo() { Init(); } - -#if wxUSE_PANGO -private: - void Init(const wxNativeFontInfo& info); - void Free(); - -public: - wxNativeFontInfo(const wxNativeFontInfo& info) { Init(info); } - ~wxNativeFontInfo() { Free(); } - - wxNativeFontInfo& operator=(const wxNativeFontInfo& info) - { - Free(); - Init(info); - return *this; - } -#endif // wxUSE_PANGO - - // reset to the default state - void Init(); - - // init with the parameters of the given font - void InitFromFont(const wxFont& font) - { - // translate all font parameters - SetStyle((wxFontStyle)font.GetStyle()); - SetWeight((wxFontWeight)font.GetWeight()); - SetUnderlined(font.GetUnderlined()); -#if defined(__WXMSW__) - if ( font.IsUsingSizeInPixels() ) - SetPixelSize(font.GetPixelSize()); - else - SetPointSize(font.GetPointSize()); -#else - SetPointSize(font.GetPointSize()); -#endif - - // set the family/facename - SetFamily((wxFontFamily)font.GetFamily()); - const wxString& facename = font.GetFaceName(); - if ( !facename.empty() ) - { - SetFaceName(facename); - } - - // deal with encoding now (it may override the font family and facename - // so do it after setting them) - SetEncoding(font.GetEncoding()); - } - - // accessors and modifiers for the font elements - int GetPointSize() const; - wxSize GetPixelSize() const; - wxFontStyle GetStyle() const; - wxFontWeight GetWeight() const; - bool GetUnderlined() const; - wxString GetFaceName() const; - wxFontFamily GetFamily() const; - wxFontEncoding GetEncoding() const; - - void SetPointSize(int pointsize); - void SetPixelSize(const wxSize& pixelSize); - void SetStyle(wxFontStyle style); - void SetWeight(wxFontWeight weight); - void SetUnderlined(bool underlined); - bool SetFaceName(const wxString& facename); - void SetFamily(wxFontFamily family); - void SetEncoding(wxFontEncoding encoding); - - // sets the first facename in the given array which is found - // to be valid. If no valid facename is given, sets the - // first valid facename returned by wxFontEnumerator::GetFacenames(). - // Does not return a bool since it cannot fail. - void SetFaceName(const wxArrayString &facenames); - - - // it is important to be able to serialize wxNativeFontInfo objects to be - // able to store them (in config file, for example) - bool FromString(const wxString& s); - wxString ToString() const; - - // we also want to present the native font descriptions to the user in some - // human-readable form (it is not platform independent neither, but can - // hopefully be understood by the user) - bool FromUserString(const wxString& s); - wxString ToUserString() const; -}; - -// ---------------------------------------------------------------------------- -// font-related functions (common) -// ---------------------------------------------------------------------------- - -// translate a wxFontEncoding into native encoding parameter (defined above), -// returning true if an (exact) macth could be found, false otherwise (without -// attempting any substitutions) -extern bool wxGetNativeFontEncoding(wxFontEncoding encoding, - wxNativeEncodingInfo *info); - -// test for the existence of the font described by this facename/encoding, -// return true if such font(s) exist, false otherwise -extern bool wxTestFontEncoding(const wxNativeEncodingInfo& info); - -// ---------------------------------------------------------------------------- -// font-related functions (X and GTK) -// ---------------------------------------------------------------------------- - -#ifdef _WX_X_FONTLIKE - #include "wx/unix/fontutil.h" -#endif // X || GDK - -#endif // _WX_FONTUTIL_H_ diff --git a/wxWidgets/include/wx/frame.h b/wxWidgets/include/wx/frame.h deleted file mode 100644 index cecbf1b5d4..0000000000 --- a/wxWidgets/include/wx/frame.h +++ /dev/null @@ -1,262 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/frame.h -// Purpose: wxFrame class interface -// Author: Vadim Zeitlin -// Modified by: -// Created: 15.11.99 -// RCS-ID: $Id: frame.h 49804 2007-11-10 01:09:42Z VZ $ -// Copyright: (c) wxWidgets team -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_FRAME_H_BASE_ -#define _WX_FRAME_H_BASE_ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -#include "wx/toplevel.h" // the base class - -// the default names for various classs -extern WXDLLEXPORT_DATA(const wxChar) wxStatusLineNameStr[]; -extern WXDLLEXPORT_DATA(const wxChar) wxToolBarNameStr[]; - -class WXDLLIMPEXP_FWD_CORE wxFrame; -class WXDLLIMPEXP_FWD_CORE wxMenuBar; -class WXDLLIMPEXP_FWD_CORE wxStatusBar; -class WXDLLIMPEXP_FWD_CORE wxToolBar; - -// ---------------------------------------------------------------------------- -// constants -// ---------------------------------------------------------------------------- - -// wxFrame-specific (i.e. not for wxDialog) styles -#define wxFRAME_NO_TASKBAR 0x0002 // No taskbar button (MSW only) -#define wxFRAME_TOOL_WINDOW 0x0004 // No taskbar button, no system menu -#define wxFRAME_FLOAT_ON_PARENT 0x0008 // Always above its parent -#define wxFRAME_SHAPED 0x0010 // Create a window that is able to be shaped - -// ---------------------------------------------------------------------------- -// wxFrame is a top-level window with optional menubar, statusbar and toolbar -// -// For each of *bars, a frame may have several of them, but only one is -// managed by the frame, i.e. resized/moved when the frame is and whose size -// is accounted for in client size calculations - all others should be taken -// care of manually. The CreateXXXBar() functions create this, main, XXXBar, -// but the actual creation is done in OnCreateXXXBar() functions which may be -// overridden to create custom objects instead of standard ones when -// CreateXXXBar() is called. -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxFrameBase : public wxTopLevelWindow -{ -public: - // construction - wxFrameBase(); - virtual ~wxFrameBase(); - - wxFrame *New(wxWindow *parent, - wxWindowID winid, - const wxString& title, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = wxDEFAULT_FRAME_STYLE, - const wxString& name = wxFrameNameStr); - - // frame state - // ----------- - - // 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; - - // sends a size event to the window using its current size -- this has an - // effect of refreshing the window layout - virtual void SendSizeEvent(); - - // menu bar functions - // ------------------ - -#if wxUSE_MENUS - virtual void SetMenuBar(wxMenuBar *menubar); - virtual wxMenuBar *GetMenuBar() const { return m_frameMenuBar; } -#endif // wxUSE_MENUS - - // process menu command: returns true if processed - bool ProcessCommand(int winid); - - // status bar functions - // -------------------- -#if wxUSE_STATUSBAR - // create the main status bar by calling OnCreateStatusBar() - virtual wxStatusBar* CreateStatusBar(int number = 1, - long style = wxST_SIZEGRIP|wxFULL_REPAINT_ON_RESIZE, - wxWindowID winid = 0, - const wxString& name = - wxStatusLineNameStr); - // return a new status bar - virtual wxStatusBar *OnCreateStatusBar(int number, - long style, - wxWindowID winid, - const wxString& name); - // get the main status bar - virtual wxStatusBar *GetStatusBar() const { return m_frameStatusBar; } - - // sets the main status bar - virtual void SetStatusBar(wxStatusBar *statBar); - - // forward these to status bar - virtual void SetStatusText(const wxString &text, int number = 0); - virtual void SetStatusWidths(int n, const int widths_field[]); - void PushStatusText(const wxString &text, int number = 0); - void PopStatusText(int number = 0); - - // set the status bar pane the help will be shown in - void SetStatusBarPane(int n) { m_statusBarPane = n; } - int GetStatusBarPane() const { return m_statusBarPane; } -#endif // wxUSE_STATUSBAR - - // toolbar functions - // ----------------- - -#if wxUSE_TOOLBAR - // create main toolbar bycalling OnCreateToolBar() - virtual wxToolBar* CreateToolBar(long style = -1, - wxWindowID winid = wxID_ANY, - const wxString& name = wxToolBarNameStr); - // return a new toolbar - virtual wxToolBar *OnCreateToolBar(long style, - wxWindowID winid, - const wxString& name ); - - // get/set the main toolbar - virtual wxToolBar *GetToolBar() const { return m_frameToolBar; } - virtual void SetToolBar(wxToolBar *toolbar); -#endif // wxUSE_TOOLBAR - - // implementation only from now on - // ------------------------------- - - // event handlers -#if wxUSE_MENUS -#if wxUSE_STATUSBAR - void OnMenuOpen(wxMenuEvent& event); - void OnMenuClose(wxMenuEvent& event); - void OnMenuHighlight(wxMenuEvent& event); -#endif // wxUSE_STATUSBAR - - // send wxUpdateUIEvents for all menu items in the menubar, - // or just for menu if non-NULL - virtual void DoMenuUpdates(wxMenu* menu = NULL); -#endif // wxUSE_MENUS - - // do the UI update processing for this window - virtual void UpdateWindowUI(long flags = wxUPDATE_UI_NONE); - - // Implement internal behaviour (menu updating on some platforms) - virtual void OnInternalIdle(); - - // if there is no real wxTopLevelWindow on this platform we have to define - // some wxTopLevelWindowBase pure virtual functions here to avoid breaking - // old ports (wxMotif) which don't define them in wxFrame -#ifndef wxTopLevelWindowNative - virtual bool ShowFullScreen(bool WXUNUSED(show), - long WXUNUSED(style) = wxFULLSCREEN_ALL) - { return false; } - virtual bool IsFullScreen() const - { return false; } -#endif // no wxTopLevelWindowNative - -#if wxUSE_MENUS || wxUSE_TOOLBAR - // show help text (typically in the statusbar); show is false - // if you are hiding the help, true otherwise - virtual void DoGiveHelp(const wxString& text, bool show); -#endif - -protected: - // the frame main menu/status/tool bars - // ------------------------------------ - - // this (non virtual!) function should be called from dtor to delete the - // main menubar, statusbar and toolbar (if any) - void DeleteAllBars(); - - // test whether this window makes part of the frame - virtual bool IsOneOfBars(const wxWindow *win) const; - -#if wxUSE_MENUS - // override to update menu bar position when the frame size changes - virtual void PositionMenuBar() { } - - // override to do something special when the menu bar is being removed - // from the frame - virtual void DetachMenuBar(); - - // override to do something special when the menu bar is attached to the - // frame - virtual void AttachMenuBar(wxMenuBar *menubar); - - wxMenuBar *m_frameMenuBar; -#endif // wxUSE_MENUS - -#if wxUSE_STATUSBAR && (wxUSE_MENUS || wxUSE_TOOLBAR) - // the saved status bar text overwritten by DoGiveHelp() - wxString m_oldStatusText; -#endif - -#if wxUSE_STATUSBAR - // override to update status bar position (or anything else) when - // something changes - virtual void PositionStatusBar() { } - - // show the help string for this menu item in the given status bar: the - // status bar pointer can be NULL; return true if help was shown - bool ShowMenuHelp(wxStatusBar *statbar, int helpid); - - wxStatusBar *m_frameStatusBar; -#endif // wxUSE_STATUSBAR - - - int m_statusBarPane; - -#if wxUSE_TOOLBAR - // override to update status bar position (or anything else) when - // something changes - virtual void PositionToolBar() { } - - wxToolBar *m_frameToolBar; -#endif // wxUSE_TOOLBAR - -#if wxUSE_MENUS && wxUSE_STATUSBAR - DECLARE_EVENT_TABLE() -#endif // wxUSE_MENUS && wxUSE_STATUSBAR - - DECLARE_NO_COPY_CLASS(wxFrameBase) -}; - -// include the real class declaration -#if defined(__WXUNIVERSAL__) // && !defined(__WXMICROWIN__) - #include "wx/univ/frame.h" -#else // !__WXUNIVERSAL__ - #if defined(__WXPALMOS__) - #include "wx/palmos/frame.h" - #elif defined(__WXMSW__) - #include "wx/msw/frame.h" - #elif defined(__WXGTK20__) - #include "wx/gtk/frame.h" - #elif defined(__WXGTK__) - #include "wx/gtk1/frame.h" - #elif defined(__WXMOTIF__) - #include "wx/motif/frame.h" - #elif defined(__WXMAC__) - #include "wx/mac/frame.h" - #elif defined(__WXCOCOA__) - #include "wx/cocoa/frame.h" - #elif defined(__WXPM__) - #include "wx/os2/frame.h" - #endif -#endif - -#endif - // _WX_FRAME_H_BASE_ diff --git a/wxWidgets/include/wx/fs_arc.h b/wxWidgets/include/wx/fs_arc.h deleted file mode 100644 index c66f14b207..0000000000 --- a/wxWidgets/include/wx/fs_arc.h +++ /dev/null @@ -1,56 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/fs_arc.h -// Purpose: Archive file system -// Author: Vaclav Slavik, Mike Wetherell -// Copyright: (c) 1999 Vaclav Slavik, (c) 2006 Mike Wetherell -// CVS-ID: $Id: fs_arc.h 42713 2006-10-30 11:56:12Z ABX $ -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_FS_ARC_H_ -#define _WX_FS_ARC_H_ - -#include "wx/defs.h" - -#if wxUSE_FS_ARCHIVE - -#include "wx/filesys.h" -#include "wx/hashmap.h" - -WX_DECLARE_STRING_HASH_MAP(int, wxArchiveFilenameHashMap); - -//--------------------------------------------------------------------------- -// wxArchiveFSHandler -//--------------------------------------------------------------------------- - -class WXDLLIMPEXP_BASE wxArchiveFSHandler : public wxFileSystemHandler -{ -public: - wxArchiveFSHandler(); - virtual bool CanOpen(const wxString& location); - virtual wxFSFile* OpenFile(wxFileSystem& fs, const wxString& location); - virtual wxString FindFirst(const wxString& spec, int flags = 0); - virtual wxString FindNext(); - void Cleanup(); - virtual ~wxArchiveFSHandler(); - -private: - class wxArchiveFSCache *m_cache; - wxFileSystem m_fs; - - // these vars are used by FindFirst/Next: - class wxArchiveFSCacheData *m_Archive; - struct wxArchiveFSEntry *m_FindEntry; - wxString m_Pattern, m_BaseDir, m_ZipFile; - bool m_AllowDirs, m_AllowFiles; - wxArchiveFilenameHashMap *m_DirsFound; - - wxString DoFind(); - - DECLARE_NO_COPY_CLASS(wxArchiveFSHandler) - DECLARE_DYNAMIC_CLASS(wxArchiveFSHandler) -}; - -#endif // wxUSE_FS_ARCHIVE - -#endif // _WX_FS_ARC_H_ diff --git a/wxWidgets/include/wx/fs_filter.h b/wxWidgets/include/wx/fs_filter.h deleted file mode 100644 index f4e7e13870..0000000000 --- a/wxWidgets/include/wx/fs_filter.h +++ /dev/null @@ -1,41 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/fs_filter.h -// Purpose: Filter file system handler -// Author: Mike Wetherell -// Copyright: (c) 2006 Mike Wetherell -// CVS-ID: $Id: fs_filter.h 42713 2006-10-30 11:56:12Z ABX $ -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_FS_FILTER_H_ -#define _WX_FS_FILTER_H_ - -#include "wx/defs.h" - -#if wxUSE_FILESYSTEM - -#include "wx/filesys.h" - -//--------------------------------------------------------------------------- -// wxFilterFSHandler -//--------------------------------------------------------------------------- - -class WXDLLIMPEXP_BASE wxFilterFSHandler : public wxFileSystemHandler -{ -public: - wxFilterFSHandler() : wxFileSystemHandler() { } - virtual ~wxFilterFSHandler() { } - - virtual bool CanOpen(const wxString& location); - virtual wxFSFile* OpenFile(wxFileSystem& fs, const wxString& location); - - virtual wxString FindFirst(const wxString& spec, int flags = 0); - virtual wxString FindNext(); - -private: - DECLARE_NO_COPY_CLASS(wxFilterFSHandler) -}; - -#endif // wxUSE_FILESYSTEM - -#endif // _WX_FS_FILTER_H_ diff --git a/wxWidgets/include/wx/fs_inet.h b/wxWidgets/include/wx/fs_inet.h deleted file mode 100644 index 3e29572b05..0000000000 --- a/wxWidgets/include/wx/fs_inet.h +++ /dev/null @@ -1,33 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: fs_inet.h -// Purpose: HTTP and FTP file system -// Author: Vaclav Slavik -// Copyright: (c) 1999 Vaclav Slavik -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_FS_INET_H_ -#define _WX_FS_INET_H_ - -#include "wx/defs.h" - -#if wxUSE_FILESYSTEM && wxUSE_FS_INET && wxUSE_STREAMS && wxUSE_SOCKETS - -#include "wx/filesys.h" - -// ---------------------------------------------------------------------------- -// wxInternetFSHandler -// ---------------------------------------------------------------------------- - -class WXDLLIMPEXP_NET wxInternetFSHandler : public wxFileSystemHandler -{ - public: - virtual bool CanOpen(const wxString& location); - virtual wxFSFile* OpenFile(wxFileSystem& fs, const wxString& location); -}; - -#endif - // wxUSE_FILESYSTEM && wxUSE_FS_INET && wxUSE_STREAMS && wxUSE_SOCKETS - -#endif // _WX_FS_INET_H_ - diff --git a/wxWidgets/include/wx/fs_mem.h b/wxWidgets/include/wx/fs_mem.h deleted file mode 100644 index 5c93134854..0000000000 --- a/wxWidgets/include/wx/fs_mem.h +++ /dev/null @@ -1,127 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: fs_mem.h -// Purpose: in-memory file system -// Author: Vaclav Slavik -// Copyright: (c) 2000 Vaclav Slavik -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_FS_MEM_H_ -#define _WX_FS_MEM_H_ - -#include "wx/defs.h" - -#if wxUSE_FILESYSTEM - -#include "wx/filesys.h" - -#if wxUSE_GUI - class WXDLLIMPEXP_FWD_CORE wxBitmap; - class WXDLLIMPEXP_FWD_CORE wxImage; -#endif // wxUSE_GUI - -// ---------------------------------------------------------------------------- -// wxMemoryFSHandlerBase -// ---------------------------------------------------------------------------- - -class WXDLLIMPEXP_BASE wxMemoryFSHandlerBase : public wxFileSystemHandler -{ -public: - wxMemoryFSHandlerBase(); - virtual ~wxMemoryFSHandlerBase(); - - // Add file to list of files stored in memory. Stored data (bitmap, text or - // raw data) will be copied into private memory stream and available under - // name "memory:" + filename - static void AddFile(const wxString& filename, const wxString& textdata); - static void AddFile(const wxString& filename, const void *binarydata, size_t size); -#if wxABI_VERSION >= 20805 - static void AddFileWithMimeType(const wxString& filename, - const wxString& textdata, - const wxString& mimetype); - static void AddFileWithMimeType(const wxString& filename, - const void *binarydata, size_t size, - const wxString& mimetype); -#endif // wxABI_VERSION >= 20805 - - // Remove file from memory FS and free occupied memory - static void RemoveFile(const wxString& filename); - - virtual bool CanOpen(const wxString& location); - virtual wxFSFile* OpenFile(wxFileSystem& fs, const wxString& location); - virtual wxString FindFirst(const wxString& spec, int flags = 0); - virtual wxString FindNext(); - -protected: - static bool CheckHash(const wxString& filename); - static wxHashTable *m_Hash; -}; - -// ---------------------------------------------------------------------------- -// wxMemoryFSHandler -// ---------------------------------------------------------------------------- - -#if wxUSE_GUI - -// add GUI-only operations to the base class -class WXDLLIMPEXP_CORE wxMemoryFSHandler : public wxMemoryFSHandlerBase -{ -public: - // bring the base class versions into the scope, otherwise they would be - // inaccessible in wxMemoryFSHandler - // (unfortunately "using" can't be used as gcc 2.95 doesn't have it...) - static void AddFile(const wxString& filename, const wxString& textdata) - { - wxMemoryFSHandlerBase::AddFile(filename, textdata); - } - - static void AddFile(const wxString& filename, - const void *binarydata, - size_t size) - { - wxMemoryFSHandlerBase::AddFile(filename, binarydata, size); - } -#if wxABI_VERSION >= 20805 - static void AddFileWithMimeType(const wxString& filename, - const wxString& textdata, - const wxString& mimetype) - { - wxMemoryFSHandlerBase::AddFileWithMimeType(filename, - textdata, - mimetype); - } - static void AddFileWithMimeType(const wxString& filename, - const void *binarydata, size_t size, - const wxString& mimetype) - { - wxMemoryFSHandlerBase::AddFileWithMimeType(filename, - binarydata, size, - mimetype); - } -#endif // wxABI_VERSION >= 20805 - -#if wxUSE_IMAGE - static void AddFile(const wxString& filename, - const wxImage& image, - long type); - - static void AddFile(const wxString& filename, - const wxBitmap& bitmap, - long type); -#endif // wxUSE_IMAGE - -}; - -#else // !wxUSE_GUI - -// just the same thing as the base class in wxBase -class WXDLLIMPEXP_BASE wxMemoryFSHandler : public wxMemoryFSHandlerBase -{ -}; - -#endif // wxUSE_GUI/!wxUSE_GUI - -#endif // wxUSE_FILESYSTEM - -#endif // _WX_FS_MEM_H_ - diff --git a/wxWidgets/include/wx/fs_zip.h b/wxWidgets/include/wx/fs_zip.h deleted file mode 100644 index 8d39e9fc4d..0000000000 --- a/wxWidgets/include/wx/fs_zip.h +++ /dev/null @@ -1,23 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/fs_zip.h -// Purpose: wxZipFSHandler typedef for compatibility -// Author: Mike Wetherell -// Copyright: (c) 2006 Mike Wetherell -// CVS-ID: $Id: fs_zip.h 42713 2006-10-30 11:56:12Z ABX $ -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_FS_ZIP_H_ -#define _WX_FS_ZIP_H_ - -#include "wx/defs.h" - -#if wxUSE_FS_ZIP - -#include "wx/fs_arc.h" - -typedef wxArchiveFSHandler wxZipFSHandler; - -#endif // wxUSE_FS_ZIP - -#endif // _WX_FS_ZIP_H_ diff --git a/wxWidgets/include/wx/gauge.h b/wxWidgets/include/wx/gauge.h deleted file mode 100644 index a8accc082a..0000000000 --- a/wxWidgets/include/wx/gauge.h +++ /dev/null @@ -1,126 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: wx/gauge.h -// Purpose: wxGauge interface -// Author: Vadim Zeitlin -// Modified by: -// Created: 20.02.01 -// RCS-ID: $Id: gauge.h 41089 2006-09-09 13:36:54Z RR $ -// Copyright: (c) 1996-2001 wxWidgets team -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_GAUGE_H_BASE_ -#define _WX_GAUGE_H_BASE_ - -#include "wx/defs.h" - -#if wxUSE_GAUGE - -#include "wx/control.h" - -// ---------------------------------------------------------------------------- -// wxGauge style flags -// ---------------------------------------------------------------------------- - -#define wxGA_HORIZONTAL wxHORIZONTAL -#define wxGA_VERTICAL wxVERTICAL - -// Win32 only, is default (and only) on some other platforms -#define wxGA_SMOOTH 0x0020 - -#if WXWIN_COMPATIBILITY_2_6 - // obsolete style - #define wxGA_PROGRESSBAR 0 -#endif // WXWIN_COMPATIBILITY_2_6 - -// GTK and Mac always have native implementation of the indeterminate mode -// wxMSW has native implementation only if comctl32.dll >= 6.00 -#if !defined(__WXGTK20__) && !defined(__WXMAC__) && !defined(__WXCOCOA__) - #define wxGAUGE_EMULATE_INDETERMINATE_MODE 1 -#else - #define wxGAUGE_EMULATE_INDETERMINATE_MODE 0 -#endif - -extern WXDLLEXPORT_DATA(const wxChar) wxGaugeNameStr[]; - -// ---------------------------------------------------------------------------- -// wxGauge: a progress bar -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxGaugeBase : public wxControl -{ -public: - wxGaugeBase() { m_rangeMax = m_gaugePos = 0; } - virtual ~wxGaugeBase(); - - 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); - - // determinate mode API - - // set/get the control range - virtual void SetRange(int range); - virtual int GetRange() const; - - virtual void SetValue(int pos); - virtual int GetValue() const; - - // indeterminate mode API - virtual void Pulse(); - - // simple accessors - bool IsVertical() const { return HasFlag(wxGA_VERTICAL); } - - // appearance params (not implemented for most ports) - virtual void SetShadowWidth(int w); - virtual int GetShadowWidth() const; - - virtual void SetBezelFace(int w); - virtual int GetBezelFace() const; - - // overriden base class virtuals - virtual bool AcceptsFocus() const { return false; } - -protected: - // the max position - int m_rangeMax; - - // the current position - int m_gaugePos; - -#if wxGAUGE_EMULATE_INDETERMINATE_MODE - int m_nDirection; // can be wxRIGHT or wxLEFT -#endif - - DECLARE_NO_COPY_CLASS(wxGaugeBase) -}; - -#if defined(__WXUNIVERSAL__) - #include "wx/univ/gauge.h" -#elif defined(__WXMSW__) - #include "wx/msw/gauge95.h" - #define wxGauge wxGauge95 -#elif defined(__WXMOTIF__) - #include "wx/motif/gauge.h" -#elif defined(__WXGTK20__) - #include "wx/gtk/gauge.h" -#elif defined(__WXGTK__) - #include "wx/gtk1/gauge.h" -#elif defined(__WXMAC__) - #include "wx/mac/gauge.h" -#elif defined(__WXCOCOA__) - #include "wx/cocoa/gauge.h" -#elif defined(__WXPM__) - #include "wx/os2/gauge.h" -#endif - -#endif // wxUSE_GAUGE - -#endif - // _WX_GAUGE_H_BASE_ diff --git a/wxWidgets/include/wx/gbsizer.h b/wxWidgets/include/wx/gbsizer.h deleted file mode 100644 index 9ea8b9e91e..0000000000 --- a/wxWidgets/include/wx/gbsizer.h +++ /dev/null @@ -1,303 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: gbsizer.h -// Purpose: wxGridBagSizer: A sizer that can lay out items in a grid, -// with items at specified cells, and with the option of row -// and/or column spanning -// -// Author: Robin Dunn -// Created: 03-Nov-2003 -// RCS-ID: $Id: gbsizer.h 53135 2008-04-12 02:31:04Z VZ $ -// Copyright: (c) Robin Dunn -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef __WXGBSIZER_H__ -#define __WXGBSIZER_H__ - -#include "wx/sizer.h" - - -//--------------------------------------------------------------------------- -// Classes to represent a position in the grid and a size of an item in the -// grid, IOW, the number of rows and columns it occupies. I chose to use these -// instead of wxPoint and wxSize because they are (x,y) and usually pixel -// oriented while grids and tables are usually thought of as (row,col) so some -// confusion would definitely result in using wxPoint... -// -// NOTE: This should probably be refactored to a common RowCol data type which -// is used for this and also for wxGridCellCoords. -//--------------------------------------------------------------------------- - -class WXDLLEXPORT wxGBPosition -{ -public: - wxGBPosition() : m_row(0), m_col(0) {} - wxGBPosition(int row, int col) : m_row(row), m_col(col) {} - - // default copy ctor and assignment operator are okay. - - int GetRow() const { return m_row; } - int GetCol() const { return m_col; } - void SetRow(int row) { m_row = row; } - void SetCol(int col) { m_col = col; } - - bool operator==(const wxGBPosition& p) const { return m_row == p.m_row && m_col == p.m_col; } - bool operator!=(const wxGBPosition& p) const { return !(*this == p); } - -private: - int m_row; - int m_col; -}; - - -class WXDLLEXPORT wxGBSpan -{ -public: - wxGBSpan() : m_rowspan(1), m_colspan(1) {} - wxGBSpan(int rowspan, int colspan) : m_rowspan(rowspan), m_colspan(colspan) {} - - // default copy ctor and assignment operator are okay. - - int GetRowspan() const { return m_rowspan; } - int GetColspan() const { return m_colspan; } - void SetRowspan(int rowspan) { m_rowspan = rowspan; } - void SetColspan(int colspan) { m_colspan = colspan; } - - bool operator==(const wxGBSpan& o) const { return m_rowspan == o.m_rowspan && m_colspan == o.m_colspan; } - bool operator!=(const wxGBSpan& o) const { return !(*this == o); } - -private: - int m_rowspan; - int m_colspan; -}; - - -extern WXDLLEXPORT_DATA(const wxGBSpan) wxDefaultSpan; - - -//--------------------------------------------------------------------------- -// wxGBSizerItem -//--------------------------------------------------------------------------- - -class WXDLLIMPEXP_FWD_CORE wxGridBagSizer; - - -class WXDLLEXPORT wxGBSizerItem : public wxSizerItem -{ -public: - // spacer - wxGBSizerItem( int width, - int height, - const wxGBPosition& pos, - const wxGBSpan& span, - int flag, - int border, - wxObject* userData); - - // window - wxGBSizerItem( wxWindow *window, - const wxGBPosition& pos, - const wxGBSpan& span, - int flag, - int border, - wxObject* userData ); - - // subsizer - wxGBSizerItem( wxSizer *sizer, - const wxGBPosition& pos, - const wxGBSpan& span, - int flag, - int border, - wxObject* userData ); - - // default ctor - wxGBSizerItem(); - - - // Get the grid position of the item - wxGBPosition GetPos() const { return m_pos; } - void GetPos(int& row, int& col) const; - - // Get the row and column spanning of the item - wxGBSpan GetSpan() const { return m_span; } - void GetSpan(int& rowspan, int& colspan) const; - - // If the item is already a member of a sizer then first ensure that there - // is no other item that would intersect with this one at the new - // position, then set the new position. Returns true if the change is - // successful and after the next Layout the item will be moved. - bool SetPos( const wxGBPosition& pos ); - - // If the item is already a member of a sizer then first ensure that there - // is no other item that would intersect with this one with its new - // spanning size, then set the new spanning. Returns true if the change - // is successful and after the next Layout the item will be resized. - bool SetSpan( const wxGBSpan& span ); - - // Returns true if this item and the other item instersect - bool Intersects(const wxGBSizerItem& other); - - // Returns true if the given pos/span would intersect with this item. - bool Intersects(const wxGBPosition& pos, const wxGBSpan& span); - - // Get the row and column of the endpoint of this item - void GetEndPos(int& row, int& col); - - - wxGridBagSizer* GetGBSizer() const { return m_gbsizer; } - void SetGBSizer(wxGridBagSizer* sizer) { m_gbsizer = sizer; } - - -protected: - wxGBPosition m_pos; - wxGBSpan m_span; - wxGridBagSizer* m_gbsizer; // so SetPos/SetSpan can check for intersects - - -private: - DECLARE_DYNAMIC_CLASS(wxGBSizerItem) - DECLARE_NO_COPY_CLASS(wxGBSizerItem) -}; - - -//--------------------------------------------------------------------------- -// wxGridBagSizer -//--------------------------------------------------------------------------- - - -class WXDLLEXPORT wxGridBagSizer : public wxFlexGridSizer -{ -public: - wxGridBagSizer(int vgap = 0, int hgap = 0 ); - - // The Add methods return true if the item was successfully placed at the - // given position, false if something was already there. - wxSizerItem* Add( wxWindow *window, - const wxGBPosition& pos, - const wxGBSpan& span = wxDefaultSpan, - int flag = 0, - int border = 0, - wxObject* userData = NULL ); - wxSizerItem* Add( wxSizer *sizer, - const wxGBPosition& pos, - const wxGBSpan& span = wxDefaultSpan, - int flag = 0, - int border = 0, - wxObject* userData = NULL ); - wxSizerItem* Add( int width, - int height, - const wxGBPosition& pos, - const wxGBSpan& span = wxDefaultSpan, - int flag = 0, - int border = 0, - wxObject* userData = NULL ); - wxSizerItem* Add( wxGBSizerItem *item ); - - - // Get/Set the size used for cells in the grid with no item. - wxSize GetEmptyCellSize() const { return m_emptyCellSize; } - void SetEmptyCellSize(const wxSize& sz) { m_emptyCellSize = sz; } - - // Get the size of the specified cell, including hgap and vgap. Only - // valid after a Layout. - wxSize GetCellSize(int row, int col) const; - - // Get the grid position of the specified item (non-recursive) - wxGBPosition GetItemPosition(wxWindow *window); - wxGBPosition GetItemPosition(wxSizer *sizer); - wxGBPosition GetItemPosition(size_t index); - - // Set the grid position of the specified item. Returns true on success. - // If the move is not allowed (because an item is already there) then - // false is returned. (non-recursive) - bool SetItemPosition(wxWindow *window, const wxGBPosition& pos); - bool SetItemPosition(wxSizer *sizer, const wxGBPosition& pos); - bool SetItemPosition(size_t index, const wxGBPosition& pos); - - // Get the row/col spanning of the specified item (non-recursive) - wxGBSpan GetItemSpan(wxWindow *window); - wxGBSpan GetItemSpan(wxSizer *sizer); - wxGBSpan GetItemSpan(size_t index); - - // Set the row/col spanning of the specified item. Returns true on - // success. If the move is not allowed (because an item is already there) - // then false is returned. (non-recursive) - bool SetItemSpan(wxWindow *window, const wxGBSpan& span); - bool SetItemSpan(wxSizer *sizer, const wxGBSpan& span); - bool SetItemSpan(size_t index, const wxGBSpan& span); - - - // Find the sizer item for the given window or subsizer, returns NULL if - // not found. (non-recursive) - wxGBSizerItem* FindItem(wxWindow* window); - wxGBSizerItem* FindItem(wxSizer* sizer); - - - // Return the sizer item for the given grid cell, or NULL if there is no - // item at that position. (non-recursive) - wxGBSizerItem* FindItemAtPosition(const wxGBPosition& pos); - - - // Return the sizer item located at the point given in pt, or NULL if - // there is no item at that point. The (x,y) coordinates in pt correspond - // to the client coordinates of the window using the sizer for - // layout. (non-recursive) - wxGBSizerItem* FindItemAtPoint(const wxPoint& pt); - - - // Return the sizer item that has a matching user data (it only compares - // pointer values) or NULL if not found. (non-recursive) - wxGBSizerItem* FindItemWithData(const wxObject* userData); - - - // These are what make the sizer do size calculations and layout - virtual void RecalcSizes(); - virtual wxSize CalcMin(); - - - // Look at all items and see if any intersect (or would overlap) the given - // item. Returns true if so, false if there would be no overlap. If an - // excludeItem is given then it will not be checked for intersection, for - // example it may be the item we are checking the position of. - bool CheckForIntersection(wxGBSizerItem* item, wxGBSizerItem* excludeItem = NULL); - bool CheckForIntersection(const wxGBPosition& pos, const wxGBSpan& span, wxGBSizerItem* excludeItem = NULL); - - - // The Add base class virtuals should not be used with this class, but - // we'll try to make them automatically select a location for the item - // anyway. - virtual wxSizerItem* Add( wxWindow *window, int proportion = 0, int flag = 0, int border = 0, wxObject* userData = NULL ); - virtual wxSizerItem* Add( wxSizer *sizer, int proportion = 0, int flag = 0, int border = 0, wxObject* userData = NULL ); - virtual wxSizerItem* Add( int width, int height, int proportion = 0, int flag = 0, int border = 0, wxObject* userData = NULL ); - - // The Insert and Prepend base class virtuals that are not appropriate for - // this class and should not be used. Their implementation in this class - // simply fails. - virtual wxSizerItem* Add( wxSizerItem *item ); - virtual wxSizerItem* Insert( size_t index, wxWindow *window, int proportion = 0, int flag = 0, int border = 0, wxObject* userData = NULL ); - virtual wxSizerItem* Insert( size_t index, wxSizer *sizer, int proportion = 0, int flag = 0, int border = 0, wxObject* userData = NULL ); - virtual wxSizerItem* Insert( size_t index, int width, int height, int proportion = 0, int flag = 0, int border = 0, wxObject* userData = NULL ); - virtual wxSizerItem* Insert( size_t index, wxSizerItem *item ); - virtual wxSizerItem* Prepend( wxWindow *window, int proportion = 0, int flag = 0, int border = 0, wxObject* userData = NULL ); - virtual wxSizerItem* Prepend( wxSizer *sizer, int proportion = 0, int flag = 0, int border = 0, wxObject* userData = NULL ); - virtual wxSizerItem* Prepend( int width, int height, int proportion = 0, int flag = 0, int border = 0, wxObject* userData = NULL ); - virtual wxSizerItem* Prepend( wxSizerItem *item ); - - -protected: - wxGBPosition FindEmptyCell(); -#if wxABI_VERSION >= 20808 - void AdjustForOverflow(); -#endif - - wxSize m_emptyCellSize; - - -private: - - DECLARE_CLASS(wxGridBagSizer) - DECLARE_NO_COPY_CLASS(wxGridBagSizer) -}; - -//--------------------------------------------------------------------------- -#endif diff --git a/wxWidgets/include/wx/gdicmn.h b/wxWidgets/include/wx/gdicmn.h deleted file mode 100644 index 3ec1f6ac63..0000000000 --- a/wxWidgets/include/wx/gdicmn.h +++ /dev/null @@ -1,755 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/gdicmn.h -// Purpose: Common GDI classes, types and declarations -// Author: Julian Smart -// Modified by: -// Created: 01/02/97 -// RCS-ID: $Id: gdicmn.h 49563 2007-10-31 20:46:21Z VZ $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_GDICMNH__ -#define _WX_GDICMNH__ - -// --------------------------------------------------------------------------- -// headers -// --------------------------------------------------------------------------- - -#include "wx/defs.h" -#include "wx/list.h" -#include "wx/string.h" -#include "wx/fontenc.h" -#include "wx/hashmap.h" -#include "wx/math.h" - -// --------------------------------------------------------------------------- -// forward declarations -// --------------------------------------------------------------------------- - -class WXDLLIMPEXP_FWD_CORE wxBitmap; -class WXDLLIMPEXP_FWD_CORE wxBrush; -class WXDLLIMPEXP_FWD_CORE wxColour; -class WXDLLIMPEXP_FWD_CORE wxCursor; -class WXDLLIMPEXP_FWD_CORE wxFont; -class WXDLLIMPEXP_FWD_CORE wxIcon; -class WXDLLIMPEXP_FWD_CORE wxPalette; -class WXDLLIMPEXP_FWD_CORE wxPen; -class WXDLLIMPEXP_FWD_CORE wxRegion; -class WXDLLIMPEXP_FWD_BASE wxString; - -// --------------------------------------------------------------------------- -// constants -// --------------------------------------------------------------------------- - -// Bitmap flags -enum wxBitmapType -{ - wxBITMAP_TYPE_INVALID, // should be == 0 for compatibility! - wxBITMAP_TYPE_BMP, - wxBITMAP_TYPE_BMP_RESOURCE, - wxBITMAP_TYPE_RESOURCE = wxBITMAP_TYPE_BMP_RESOURCE, - wxBITMAP_TYPE_ICO, - wxBITMAP_TYPE_ICO_RESOURCE, - wxBITMAP_TYPE_CUR, - wxBITMAP_TYPE_CUR_RESOURCE, - wxBITMAP_TYPE_XBM, - wxBITMAP_TYPE_XBM_DATA, - wxBITMAP_TYPE_XPM, - wxBITMAP_TYPE_XPM_DATA, - wxBITMAP_TYPE_TIF, - wxBITMAP_TYPE_TIF_RESOURCE, - wxBITMAP_TYPE_GIF, - wxBITMAP_TYPE_GIF_RESOURCE, - wxBITMAP_TYPE_PNG, - wxBITMAP_TYPE_PNG_RESOURCE, - wxBITMAP_TYPE_JPEG, - wxBITMAP_TYPE_JPEG_RESOURCE, - wxBITMAP_TYPE_PNM, - wxBITMAP_TYPE_PNM_RESOURCE, - wxBITMAP_TYPE_PCX, - wxBITMAP_TYPE_PCX_RESOURCE, - wxBITMAP_TYPE_PICT, - wxBITMAP_TYPE_PICT_RESOURCE, - wxBITMAP_TYPE_ICON, - wxBITMAP_TYPE_ICON_RESOURCE, - wxBITMAP_TYPE_ANI, - wxBITMAP_TYPE_IFF, - wxBITMAP_TYPE_TGA, - wxBITMAP_TYPE_MACCURSOR, - wxBITMAP_TYPE_MACCURSOR_RESOURCE, - wxBITMAP_TYPE_ANY = 50 -}; - -// Standard cursors -enum wxStockCursor -{ - wxCURSOR_NONE, // should be 0 - wxCURSOR_ARROW, - wxCURSOR_RIGHT_ARROW, - wxCURSOR_BULLSEYE, - wxCURSOR_CHAR, - wxCURSOR_CROSS, - wxCURSOR_HAND, - wxCURSOR_IBEAM, - wxCURSOR_LEFT_BUTTON, - wxCURSOR_MAGNIFIER, - wxCURSOR_MIDDLE_BUTTON, - wxCURSOR_NO_ENTRY, - wxCURSOR_PAINT_BRUSH, - wxCURSOR_PENCIL, - wxCURSOR_POINT_LEFT, - wxCURSOR_POINT_RIGHT, - wxCURSOR_QUESTION_ARROW, - wxCURSOR_RIGHT_BUTTON, - wxCURSOR_SIZENESW, - wxCURSOR_SIZENS, - wxCURSOR_SIZENWSE, - wxCURSOR_SIZEWE, - wxCURSOR_SIZING, - wxCURSOR_SPRAYCAN, - wxCURSOR_WAIT, - wxCURSOR_WATCH, - wxCURSOR_BLANK, -#ifdef __WXGTK__ - wxCURSOR_DEFAULT, // standard X11 cursor -#endif -#ifdef __WXMAC__ - wxCURSOR_COPY_ARROW , // MacOS Theme Plus arrow -#endif -#ifdef __X__ - // Not yet implemented for Windows - wxCURSOR_CROSS_REVERSE, - wxCURSOR_DOUBLE_ARROW, - wxCURSOR_BASED_ARROW_UP, - wxCURSOR_BASED_ARROW_DOWN, -#endif // X11 - - wxCURSOR_ARROWWAIT, - - wxCURSOR_MAX -}; - -#ifndef __WXGTK__ - #define wxCURSOR_DEFAULT wxCURSOR_ARROW -#endif - -// --------------------------------------------------------------------------- -// macros -// --------------------------------------------------------------------------- - -/* Useful macro for creating icons portably, for example: - - wxIcon *icon = new wxICON(mondrian); - - expands into: - - wxIcon *icon = new wxIcon("mondrian"); // On wxMSW - wxIcon *icon = new wxIcon(mondrian_xpm); // On wxGTK - */ - -#ifdef __WXMSW__ - // Load from a resource - #define wxICON(X) wxIcon(wxT(#X)) -#elif defined(__WXPM__) - // Load from a resource - #define wxICON(X) wxIcon(wxT(#X)) -#elif defined(__WXMGL__) - // Initialize from an included XPM - #define wxICON(X) wxIcon( (const char**) X##_xpm ) -#elif defined(__WXDFB__) - // Initialize from an included XPM - #define wxICON(X) wxIcon( (const char**) X##_xpm ) -#elif defined(__WXGTK__) - // Initialize from an included XPM - #define wxICON(X) wxIcon( (const char**) X##_xpm ) -#elif defined(__WXMAC__) - // Initialize from an included XPM - #define wxICON(X) wxIcon( (const char**) X##_xpm ) -#elif defined(__WXMOTIF__) - // Initialize from an included XPM - #define wxICON(X) wxIcon( X##_xpm ) -#elif defined(__WXX11__) - // Initialize from an included XPM - #define wxICON(X) wxIcon( X##_xpm ) -#else - // This will usually mean something on any platform - #define wxICON(X) wxIcon(wxT(#X)) -#endif // platform - -/* Another macro: this one is for portable creation of bitmaps. We assume that - under Unix bitmaps live in XPMs and under Windows they're in ressources. - */ - -#if defined(__WXMSW__) || defined(__WXPM__) - #define wxBITMAP(name) wxBitmap(wxT(#name), wxBITMAP_TYPE_RESOURCE) -#elif defined(__WXGTK__) || \ - defined(__WXMOTIF__) || \ - defined(__WXX11__) || \ - defined(__WXMAC__) || \ - defined(__WXMGL__) || \ - defined(__WXDFB__) || \ - defined(__WXCOCOA__) - // Initialize from an included XPM - #define wxBITMAP(name) wxBitmap( (const char**) name##_xpm ) -#else // other platforms - #define wxBITMAP(name) wxBitmap(name##_xpm, wxBITMAP_TYPE_XPM) -#endif // platform - -// =========================================================================== -// classes -// =========================================================================== - -// --------------------------------------------------------------------------- -// wxSize -// --------------------------------------------------------------------------- - -class WXDLLEXPORT wxSize -{ -public: - // members are public for compatibility, don't use them directly. - int x, y; - - // constructors - wxSize() : x(0), y(0) { } - wxSize(int xx, int yy) : x(xx), y(yy) { } - - // no copy ctor or assignment operator - the defaults are ok - - bool operator==(const wxSize& sz) const { return x == sz.x && y == sz.y; } - bool operator!=(const wxSize& sz) const { return x != sz.x || y != sz.y; } - - wxSize operator+(const wxSize& sz) const { return wxSize(x + sz.x, y + sz.y); } - wxSize operator-(const wxSize& sz) const { return wxSize(x - sz.x, y - sz.y); } - wxSize operator/(int i) const { return wxSize(x / i, y / i); } - wxSize operator*(int i) const { return wxSize(x * i, y * i); } - - wxSize& operator+=(const wxSize& sz) { x += sz.x; y += sz.y; return *this; } - wxSize& operator-=(const wxSize& sz) { x -= sz.x; y -= sz.y; return *this; } - wxSize& operator/=(const int i) { x /= i; y /= i; return *this; } - wxSize& operator*=(const int i) { x *= i; y *= i; return *this; } - - void IncTo(const wxSize& sz) - { if ( sz.x > x ) x = sz.x; if ( sz.y > y ) y = sz.y; } - void DecTo(const wxSize& sz) - { if ( sz.x < x ) x = sz.x; if ( sz.y < y ) y = sz.y; } - - void IncBy(int dx, int dy) { x += dx; y += dy; } - void IncBy(const wxSize& sz) { IncBy(sz.x, sz.y); } - void IncBy(int d) { IncBy(d, d); } - - void DecBy(int dx, int dy) { IncBy(-dx, -dy); } - void DecBy(const wxSize& sz) { DecBy(sz.x, sz.y); } - void DecBy(int d) { DecBy(d, d); } - - - wxSize& Scale(float xscale, float yscale) - { x = (int)(x*xscale); y = (int)(y*yscale); return *this; } - - // accessors - void Set(int xx, int yy) { x = xx; y = yy; } - void SetWidth(int w) { x = w; } - void SetHeight(int h) { y = h; } - - int GetWidth() const { return x; } - int GetHeight() const { return y; } - - bool IsFullySpecified() const { return x != wxDefaultCoord && y != wxDefaultCoord; } - - // combine this size with the other one replacing the default (i.e. equal - // to wxDefaultCoord) components of this object with those of the other - void SetDefaults(const wxSize& size) - { - if ( x == wxDefaultCoord ) - x = size.x; - if ( y == wxDefaultCoord ) - y = size.y; - } - - // compatibility - int GetX() const { return x; } - int GetY() const { return y; } -}; - -// --------------------------------------------------------------------------- -// Point classes: with real or integer coordinates -// --------------------------------------------------------------------------- - -class WXDLLEXPORT wxRealPoint -{ -public: - double x; - double y; - - wxRealPoint() : x(0.0), y(0.0) { } - wxRealPoint(double xx, double yy) : x(xx), y(yy) { } - - wxRealPoint operator+(const wxRealPoint& pt) const { return wxRealPoint(x + pt.x, y + pt.y); } - wxRealPoint operator-(const wxRealPoint& pt) const { return wxRealPoint(x - pt.x, y - pt.y); } - - bool operator==(const wxRealPoint& pt) const - { - return wxIsSameDouble(x, pt.x) && wxIsSameDouble(y, pt.y); - } - bool operator!=(const wxRealPoint& pt) const { return !(*this == pt); } -}; - - -class WXDLLEXPORT wxPoint -{ -public: - int x, y; - - wxPoint() : x(0), y(0) { } - wxPoint(int xx, int yy) : x(xx), y(yy) { } - - // no copy ctor or assignment operator - the defaults are ok - - // comparison - bool operator==(const wxPoint& p) const { return x == p.x && y == p.y; } - bool operator!=(const wxPoint& p) const { return !(*this == p); } - - // arithmetic operations (component wise) - wxPoint operator+(const wxPoint& p) const { return wxPoint(x + p.x, y + p.y); } - wxPoint operator-(const wxPoint& p) const { return wxPoint(x - p.x, y - p.y); } - - wxPoint& operator+=(const wxPoint& p) { x += p.x; y += p.y; return *this; } - wxPoint& operator-=(const wxPoint& p) { x -= p.x; y -= p.y; return *this; } - - wxPoint& operator+=(const wxSize& s) { x += s.GetWidth(); y += s.GetHeight(); return *this; } - wxPoint& operator-=(const wxSize& s) { x -= s.GetWidth(); y -= s.GetHeight(); return *this; } - - wxPoint operator+(const wxSize& s) const { return wxPoint(x + s.GetWidth(), y + s.GetHeight()); } - wxPoint operator-(const wxSize& s) const { return wxPoint(x - s.GetWidth(), y - s.GetHeight()); } - - wxPoint operator-() const { return wxPoint(-x, -y); } -}; - -// --------------------------------------------------------------------------- -// wxRect -// --------------------------------------------------------------------------- - -class WXDLLEXPORT wxRect -{ -public: - wxRect() - : x(0), y(0), width(0), height(0) - { } - wxRect(int xx, int yy, int ww, int hh) - : x(xx), y(yy), width(ww), height(hh) - { } - wxRect(const wxPoint& topLeft, const wxPoint& bottomRight); - wxRect(const wxPoint& pt, const wxSize& size) - : x(pt.x), y(pt.y), width(size.x), height(size.y) - { } - wxRect(const wxSize& size) - : x(0), y(0), width(size.x), height(size.y) - { } - - // default copy ctor and assignment operators ok - - int GetX() const { return x; } - void SetX(int xx) { x = xx; } - - int GetY() const { return y; } - void SetY(int yy) { y = yy; } - - int GetWidth() const { return width; } - void SetWidth(int w) { width = w; } - - int GetHeight() const { return height; } - void SetHeight(int h) { height = h; } - - wxPoint GetPosition() const { return wxPoint(x, y); } - void SetPosition( const wxPoint &p ) { x = p.x; y = p.y; } - - wxSize GetSize() const { return wxSize(width, height); } - void SetSize( const wxSize &s ) { width = s.GetWidth(); height = s.GetHeight(); } - - bool IsEmpty() const { return (width <= 0) || (height <= 0); } - - int GetLeft() const { return x; } - int GetTop() const { return y; } - int GetBottom() const { return y + height - 1; } - int GetRight() const { return x + width - 1; } - - void SetLeft(int left) { x = left; } - void SetRight(int right) { width = right - x + 1; } - void SetTop(int top) { y = top; } - void SetBottom(int bottom) { height = bottom - y + 1; } - - wxPoint GetTopLeft() const { return GetPosition(); } - wxPoint GetLeftTop() const { return GetTopLeft(); } - void SetTopLeft(const wxPoint &p) { SetPosition(p); } - void SetLeftTop(const wxPoint &p) { SetTopLeft(p); } - - wxPoint GetBottomRight() const { return wxPoint(GetRight(), GetBottom()); } - wxPoint GetRightBottom() const { return GetBottomRight(); } - void SetBottomRight(const wxPoint &p) { SetRight(p.x); SetBottom(p.y); } - void SetRightBottom(const wxPoint &p) { SetBottomRight(p); } - - wxPoint GetTopRight() const { return wxPoint(GetRight(), GetTop()); } - wxPoint GetRightTop() const { return GetTopRight(); } - void SetTopRight(const wxPoint &p) { SetRight(p.x); SetTop(p.y); } - void SetRightTop(const wxPoint &p) { SetTopLeft(p); } - - wxPoint GetBottomLeft() const { return wxPoint(GetLeft(), GetBottom()); } - wxPoint GetLeftBottom() const { return GetBottomLeft(); } - void SetBottomLeft(const wxPoint &p) { SetLeft(p.x); SetBottom(p.y); } - void SetLeftBottom(const wxPoint &p) { SetBottomLeft(p); } - - // operations with rect - wxRect& Inflate(wxCoord dx, wxCoord dy); - wxRect& Inflate(const wxSize& d) { return Inflate(d.x, d.y); } - wxRect& Inflate(wxCoord d) { return Inflate(d, d); } - wxRect Inflate(wxCoord dx, wxCoord dy) const - { - wxRect r = *this; - r.Inflate(dx, dy); - return r; - } - - wxRect& Deflate(wxCoord dx, wxCoord dy) { return Inflate(-dx, -dy); } - wxRect& Deflate(const wxSize& d) { return Inflate(-d.x, -d.y); } - wxRect& Deflate(wxCoord d) { return Inflate(-d); } - wxRect Deflate(wxCoord dx, wxCoord dy) const - { - wxRect r = *this; - r.Deflate(dx, dy); - return r; - } - - void Offset(wxCoord dx, wxCoord dy) { x += dx; y += dy; } - void Offset(const wxPoint& pt) { Offset(pt.x, pt.y); } - - wxRect& Intersect(const wxRect& rect); - wxRect Intersect(const wxRect& rect) const - { - wxRect r = *this; - r.Intersect(rect); - return r; - } - - wxRect& Union(const wxRect& rect); - wxRect Union(const wxRect& rect) const - { - wxRect r = *this; - r.Union(rect); - return r; - } - - // compare rectangles - bool operator==(const wxRect& rect) const; - bool operator!=(const wxRect& rect) const { return !(*this == rect); } - - // return true if the point is (not strcitly) inside the rect - bool Contains(int x, int y) const; - bool Contains(const wxPoint& pt) const { return Contains(pt.x, pt.y); } - // return true if the rectangle is (not strcitly) inside the rect - bool Contains(const wxRect& rect) const; - -#if WXWIN_COMPATIBILITY_2_6 - // use Contains() instead - wxDEPRECATED( bool Inside(int x, int y) const ); - wxDEPRECATED( bool Inside(const wxPoint& pt) const ); - wxDEPRECATED( bool Inside(const wxRect& rect) const ); -#endif // WXWIN_COMPATIBILITY_2_6 - - // return true if the rectangles have a non empty intersection - bool Intersects(const wxRect& rect) const; - - - // these are like Union() but don't ignore empty rectangles - wxRect operator+(const wxRect& rect) const; - wxRect& operator+=(const wxRect& rect) - { - *this = *this + rect; - return *this; - } - - - // centre this rectangle in the given (usually, but not necessarily, - // larger) one - wxRect CentreIn(const wxRect& r, int dir = wxBOTH) const - { - return wxRect(dir & wxHORIZONTAL ? r.x + (r.width - width)/2 : x, - dir & wxVERTICAL ? r.y + (r.height - height)/2 : y, - width, height); - } - - wxRect CenterIn(const wxRect& r, int dir = wxBOTH) const - { - return CentreIn(r, dir); - } - -public: - int x, y, width, height; -}; - -#if WXWIN_COMPATIBILITY_2_6 -inline bool wxRect::Inside(int cx, int cy) const { return Contains(cx, cy); } -inline bool wxRect::Inside(const wxPoint& pt) const { return Contains(pt); } -inline bool wxRect::Inside(const wxRect& rect) const { return Contains(rect); } -#endif // WXWIN_COMPATIBILITY_2_6 - - -// --------------------------------------------------------------------------- -// Management of pens, brushes and fonts -// --------------------------------------------------------------------------- - -typedef wxInt8 wxDash; - -class WXDLLIMPEXP_CORE wxGDIObjListBase { -public: - wxGDIObjListBase(); - ~wxGDIObjListBase(); - -protected: - wxList list; -}; - -class WXDLLIMPEXP_CORE wxPenList: public wxGDIObjListBase -{ -public: - wxPen *FindOrCreatePen(const wxColour& colour, int width, int style); -#if WXWIN_COMPATIBILITY_2_6 - wxDEPRECATED( void AddPen(wxPen*) ); - wxDEPRECATED( void RemovePen(wxPen*) ); -#endif -}; - -class WXDLLIMPEXP_CORE wxBrushList: public wxGDIObjListBase -{ -public: - wxBrush *FindOrCreateBrush(const wxColour& colour, int style = wxSOLID); -#if WXWIN_COMPATIBILITY_2_6 - wxDEPRECATED( void AddBrush(wxBrush*) ); - wxDEPRECATED( void RemoveBrush(wxBrush*) ); -#endif -}; - -class WXDLLIMPEXP_CORE wxFontList: public wxGDIObjListBase -{ -public: - wxFont *FindOrCreateFont(int pointSize, int family, int style, int weight, - bool underline = false, - const wxString& face = wxEmptyString, - wxFontEncoding encoding = wxFONTENCODING_DEFAULT); -#if WXWIN_COMPATIBILITY_2_6 - wxDEPRECATED( void AddFont(wxFont*) ); - wxDEPRECATED( void RemoveFont(wxFont*) ); -#endif -}; - -WX_DECLARE_STRING_HASH_MAP(wxColour*, wxStringToColourHashMap); - -class WXDLLEXPORT wxColourDatabase -{ -public: - wxColourDatabase(); - ~wxColourDatabase(); - - // find colour by name or name for the given colour - wxColour Find(const wxString& name) const; - wxString FindName(const wxColour& colour) const; - - // add a new colour to the database - void AddColour(const wxString& name, const wxColour& colour); - -#if WXWIN_COMPATIBILITY_2_6 - // deprecated, use Find() instead - wxDEPRECATED( wxColour *FindColour(const wxString& name) ); -#endif // WXWIN_COMPATIBILITY_2_6 - - -#ifdef __WXPM__ - // PM keeps its own type of colour table - long* m_palTable; - size_t m_nSize; -#endif - -private: - // load the database with the built in colour values when called for the - // first time, do nothing after this - void Initialize(); - - wxStringToColourHashMap *m_map; -}; - -class WXDLLEXPORT wxResourceCache: public wxList -{ -public: - wxResourceCache() { } -#if !wxUSE_STL - wxResourceCache(const unsigned int keyType) : wxList(keyType) { } -#endif - virtual ~wxResourceCache(); -}; - -// --------------------------------------------------------------------------- -// global variables -// --------------------------------------------------------------------------- - -// Lists of GDI objects -extern WXDLLEXPORT_DATA(wxPenList*) wxThePenList; -extern WXDLLEXPORT_DATA(wxBrushList*) wxTheBrushList; -extern WXDLLEXPORT_DATA(wxFontList*) wxTheFontList; - -/* Stock objects - - wxStockGDI creates the stock GDI objects on demand. Pointers to the - created objects are stored in the ms_stockObject array, which is indexed - by the Item enum values. Platorm-specific fonts can be created by - implementing a derived class with an override for the GetFont function. - wxStockGDI operates as a singleton, accessed through the ms_instance - pointer. By default this pointer is set to an instance of wxStockGDI. - A derived class must arrange to set this pointer to an instance of itself. -*/ -class WXDLLIMPEXP_CORE wxStockGDI -{ -public: - enum Item { - BRUSH_BLACK, - BRUSH_BLUE, - BRUSH_CYAN, - BRUSH_GREEN, - BRUSH_GREY, - BRUSH_LIGHTGREY, - BRUSH_MEDIUMGREY, - BRUSH_RED, - BRUSH_TRANSPARENT, - BRUSH_WHITE, - COLOUR_BLACK, - COLOUR_BLUE, - COLOUR_CYAN, - COLOUR_GREEN, - COLOUR_LIGHTGREY, - COLOUR_RED, - COLOUR_WHITE, - CURSOR_CROSS, - CURSOR_HOURGLASS, - CURSOR_STANDARD, - FONT_ITALIC, - FONT_NORMAL, - FONT_SMALL, - FONT_SWISS, - PEN_BLACK, - PEN_BLACKDASHED, - PEN_CYAN, - PEN_GREEN, - PEN_GREY, - PEN_LIGHTGREY, - PEN_MEDIUMGREY, - PEN_RED, - PEN_TRANSPARENT, - PEN_WHITE, - ITEMCOUNT - }; - - wxStockGDI(); - virtual ~wxStockGDI(); - static void DeleteAll(); - - static wxStockGDI& instance() { return *ms_instance; } - - static const wxBrush* GetBrush(Item item); - static const wxColour* GetColour(Item item); - static const wxCursor* GetCursor(Item item); - // Can be overridden by platform-specific derived classes - virtual const wxFont* GetFont(Item item); - static const wxPen* GetPen(Item item); - -protected: - static wxStockGDI* ms_instance; - - static wxObject* ms_stockObject[ITEMCOUNT]; - - DECLARE_NO_COPY_CLASS(wxStockGDI) -}; - -#define wxITALIC_FONT wxStockGDI::instance().GetFont(wxStockGDI::FONT_ITALIC) -#define wxNORMAL_FONT wxStockGDI::instance().GetFont(wxStockGDI::FONT_NORMAL) -#define wxSMALL_FONT wxStockGDI::instance().GetFont(wxStockGDI::FONT_SMALL) -#define wxSWISS_FONT wxStockGDI::instance().GetFont(wxStockGDI::FONT_SWISS) - -#define wxBLACK_DASHED_PEN wxStockGDI::GetPen(wxStockGDI::PEN_BLACKDASHED) -#define wxBLACK_PEN wxStockGDI::GetPen(wxStockGDI::PEN_BLACK) -#define wxCYAN_PEN wxStockGDI::GetPen(wxStockGDI::PEN_CYAN) -#define wxGREEN_PEN wxStockGDI::GetPen(wxStockGDI::PEN_GREEN) -#define wxGREY_PEN wxStockGDI::GetPen(wxStockGDI::PEN_GREY) -#define wxLIGHT_GREY_PEN wxStockGDI::GetPen(wxStockGDI::PEN_LIGHTGREY) -#define wxMEDIUM_GREY_PEN wxStockGDI::GetPen(wxStockGDI::PEN_MEDIUMGREY) -#define wxRED_PEN wxStockGDI::GetPen(wxStockGDI::PEN_RED) -#define wxTRANSPARENT_PEN wxStockGDI::GetPen(wxStockGDI::PEN_TRANSPARENT) -#define wxWHITE_PEN wxStockGDI::GetPen(wxStockGDI::PEN_WHITE) - -#define wxBLACK_BRUSH wxStockGDI::GetBrush(wxStockGDI::BRUSH_BLACK) -#define wxBLUE_BRUSH wxStockGDI::GetBrush(wxStockGDI::BRUSH_BLUE) -#define wxCYAN_BRUSH wxStockGDI::GetBrush(wxStockGDI::BRUSH_CYAN) -#define wxGREEN_BRUSH wxStockGDI::GetBrush(wxStockGDI::BRUSH_GREEN) -#define wxGREY_BRUSH wxStockGDI::GetBrush(wxStockGDI::BRUSH_GREY) -#define wxLIGHT_GREY_BRUSH wxStockGDI::GetBrush(wxStockGDI::BRUSH_LIGHTGREY) -#define wxMEDIUM_GREY_BRUSH wxStockGDI::GetBrush(wxStockGDI::BRUSH_MEDIUMGREY) -#define wxRED_BRUSH wxStockGDI::GetBrush(wxStockGDI::BRUSH_RED) -#define wxTRANSPARENT_BRUSH wxStockGDI::GetBrush(wxStockGDI::BRUSH_TRANSPARENT) -#define wxWHITE_BRUSH wxStockGDI::GetBrush(wxStockGDI::BRUSH_WHITE) - -#define wxBLACK wxStockGDI::GetColour(wxStockGDI::COLOUR_BLACK) -#define wxBLUE wxStockGDI::GetColour(wxStockGDI::COLOUR_BLUE) -#define wxCYAN wxStockGDI::GetColour(wxStockGDI::COLOUR_CYAN) -#define wxGREEN wxStockGDI::GetColour(wxStockGDI::COLOUR_GREEN) -#define wxLIGHT_GREY wxStockGDI::GetColour(wxStockGDI::COLOUR_LIGHTGREY) -#define wxRED wxStockGDI::GetColour(wxStockGDI::COLOUR_RED) -#define wxWHITE wxStockGDI::GetColour(wxStockGDI::COLOUR_WHITE) - -#define wxCROSS_CURSOR wxStockGDI::GetCursor(wxStockGDI::CURSOR_CROSS) -#define wxHOURGLASS_CURSOR wxStockGDI::GetCursor(wxStockGDI::CURSOR_HOURGLASS) -#define wxSTANDARD_CURSOR wxStockGDI::GetCursor(wxStockGDI::CURSOR_STANDARD) - -// 'Null' objects -extern WXDLLEXPORT_DATA(wxBitmap) wxNullBitmap; -extern WXDLLEXPORT_DATA(wxIcon) wxNullIcon; -extern WXDLLEXPORT_DATA(wxCursor) wxNullCursor; -extern WXDLLEXPORT_DATA(wxPen) wxNullPen; -extern WXDLLEXPORT_DATA(wxBrush) wxNullBrush; -extern WXDLLEXPORT_DATA(wxPalette) wxNullPalette; -extern WXDLLEXPORT_DATA(wxFont) wxNullFont; -extern WXDLLEXPORT_DATA(wxColour) wxNullColour; - -extern WXDLLEXPORT_DATA(wxColourDatabase*) wxTheColourDatabase; - -extern WXDLLEXPORT_DATA(const wxChar) wxPanelNameStr[]; - -extern WXDLLEXPORT_DATA(const wxSize) wxDefaultSize; -extern WXDLLEXPORT_DATA(const wxPoint) wxDefaultPosition; - -// --------------------------------------------------------------------------- -// global functions -// --------------------------------------------------------------------------- - -// resource management -extern void WXDLLEXPORT wxInitializeStockLists(); -extern void WXDLLEXPORT wxDeleteStockLists(); - -// is the display colour (or monochrome)? -extern bool WXDLLEXPORT wxColourDisplay(); - -// Returns depth of screen -extern int WXDLLEXPORT wxDisplayDepth(); -#define wxGetDisplayDepth wxDisplayDepth - -// get the display size -extern void WXDLLEXPORT wxDisplaySize(int *width, int *height); -extern wxSize WXDLLEXPORT wxGetDisplaySize(); -extern void WXDLLEXPORT wxDisplaySizeMM(int *width, int *height); -extern wxSize WXDLLEXPORT wxGetDisplaySizeMM(); - -// Get position and size of the display workarea -extern void WXDLLEXPORT wxClientDisplayRect(int *x, int *y, int *width, int *height); -extern wxRect WXDLLEXPORT wxGetClientDisplayRect(); - -// set global cursor -extern void WXDLLEXPORT wxSetCursor(const wxCursor& cursor); - -#endif - // _WX_GDICMNH__ diff --git a/wxWidgets/include/wx/gdiobj.h b/wxWidgets/include/wx/gdiobj.h deleted file mode 100644 index 55e722bf61..0000000000 --- a/wxWidgets/include/wx/gdiobj.h +++ /dev/null @@ -1,51 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/gdiobj.h -// Purpose: wxGDIObject base header -// Author: Julian Smart -// Modified by: -// Created: -// Copyright: (c) Julian Smart -// RCS-ID: $Id: gdiobj.h 42211 2006-10-21 17:19:11Z SN $ -// Licence: wxWindows Licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_GDIOBJ_H_BASE_ -#define _WX_GDIOBJ_H_BASE_ - -#include "wx/object.h" - -// ---------------------------------------------------------------------------- -// wxGDIRefData is the base class for wxXXXData structures which contain the -// real data for the GDI object and are shared among all wxWin objects sharing -// the same native GDI object -// ---------------------------------------------------------------------------- - -class WXDLLIMPEXP_CORE wxGDIRefData: public wxObjectRefData { }; - -// ---------------------------------------------------------------------------- -// wxGDIObject -// ---------------------------------------------------------------------------- - -class WXDLLIMPEXP_CORE wxGDIObject: public wxObject -{ -public: - bool IsNull() const { return m_refData == NULL; } - -#if defined(__WXMSW__) || defined(__WXPM__) || defined(__WXPALMOS__) - // Creates the resource - virtual bool RealizeResource() { return false; } - - // Frees the resource - virtual bool FreeResource(bool WXUNUSED(force) = false) { return false; } - - virtual bool IsFree() const { return false; } - - // Returns handle. - virtual WXHANDLE GetResourceHandle() const { return 0; } -#endif // defined(__WXMSW__) || defined(__WXPM__) - - DECLARE_DYNAMIC_CLASS(wxGDIObject) -}; - -#endif - // _WX_GDIOBJ_H_BASE_ diff --git a/wxWidgets/include/wx/generic/aboutdlgg.h b/wxWidgets/include/wx/generic/aboutdlgg.h deleted file mode 100644 index ce524a5c91..0000000000 --- a/wxWidgets/include/wx/generic/aboutdlgg.h +++ /dev/null @@ -1,87 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: wx/generic/aboutdlgg.h -// Purpose: generic wxAboutBox() implementation -// Author: Vadim Zeitlin -// Created: 2006-10-07 -// RCS-ID: $Id: aboutdlgg.h 49804 2007-11-10 01:09:42Z VZ $ -// Copyright: (c) 2006 Vadim Zeitlin -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_GENERIC_ABOUTDLGG_H_ -#define _WX_GENERIC_ABOUTDLGG_H_ - -#include "wx/defs.h" - -#if wxUSE_ABOUTDLG - -#include "wx/dialog.h" - -class WXDLLIMPEXP_FWD_ADV wxAboutDialogInfo; -class WXDLLIMPEXP_FWD_CORE wxSizer; -class WXDLLIMPEXP_FWD_CORE wxSizerFlags; - -// ---------------------------------------------------------------------------- -// wxGenericAboutDialog: generic "About" dialog implementation -// ---------------------------------------------------------------------------- - -class WXDLLIMPEXP_ADV wxGenericAboutDialog : public wxDialog -{ -public: - // constructors and Create() method - // -------------------------------- - - // default ctor, you must use Create() to really initialize the dialog - wxGenericAboutDialog() { Init(); } - - // ctor which fully initializes the object - wxGenericAboutDialog(const wxAboutDialogInfo& info) - { - Init(); - - (void)Create(info); - } - - // this method must be called if and only if the default ctor was used - bool Create(const wxAboutDialogInfo& info); - -protected: - // this virtual method may be overridden to add some more controls to the - // dialog - // - // notice that for this to work you must call Create() from the derived - // class ctor and not use the base class ctor directly as otherwise the - // virtual function of the derived class wouldn't be called - virtual void DoAddCustomControls() { } - - // add arbitrary control to the text sizer contents with the specified - // flags - void AddControl(wxWindow *win, const wxSizerFlags& flags); - - // add arbitrary control to the text sizer contents and center it - void AddControl(wxWindow *win); - - // add the text, if it's not empty, to the text sizer contents - void AddText(const wxString& text); - -#if wxUSE_COLLPANE - // add a wxCollapsiblePane containing the given text - void AddCollapsiblePane(const wxString& title, const wxString& text); -#endif // wxUSE_COLLPANE - -private: - // common part of all ctors - void Init() { m_sizerText = NULL; } - - - wxSizer *m_sizerText; -}; - -// unlike wxAboutBox which can show either the native or generic about dialog, -// this function always shows the generic one -WXDLLIMPEXP_ADV void wxGenericAboutBox(const wxAboutDialogInfo& info); - -#endif // wxUSE_ABOUTDLG - -#endif // _WX_GENERIC_ABOUTDLGG_H_ - diff --git a/wxWidgets/include/wx/generic/accel.h b/wxWidgets/include/wx/generic/accel.h deleted file mode 100644 index c22e08643e..0000000000 --- a/wxWidgets/include/wx/generic/accel.h +++ /dev/null @@ -1,50 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/generic/accel.h -// Purpose: wxAcceleratorTable class -// Author: Robert Roebling -// RCS-ID: $Id: accel.h 42752 2006-10-30 19:26:48Z VZ $ -// Copyright: (c) Robert Roebling -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_GENERIC_ACCEL_H_ -#define _WX_GENERIC_ACCEL_H_ - -class WXDLLEXPORT wxKeyEvent; - -// ---------------------------------------------------------------------------- -// wxAcceleratorTable -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxAcceleratorTable : public wxObject -{ -public: - wxAcceleratorTable(); - wxAcceleratorTable(int n, const wxAcceleratorEntry entries[]); - virtual ~wxAcceleratorTable(); - - bool Ok() const { return IsOk(); } - bool IsOk() const; - - void Add(const wxAcceleratorEntry& entry); - void Remove(const wxAcceleratorEntry& entry); - - // implementation - // -------------- - - wxMenuItem *GetMenuItem(const wxKeyEvent& event) const; - int GetCommand(const wxKeyEvent& event) const; - - const wxAcceleratorEntry *GetEntry(const wxKeyEvent& event) const; - -protected: - // ref counting code - virtual wxObjectRefData *CreateRefData() const; - virtual wxObjectRefData *CloneRefData(const wxObjectRefData *data) const; - -private: - DECLARE_DYNAMIC_CLASS(wxAcceleratorTable) -}; - -#endif // _WX_GENERIC_ACCEL_H_ - diff --git a/wxWidgets/include/wx/generic/animate.h b/wxWidgets/include/wx/generic/animate.h deleted file mode 100644 index 28cb4b8bbf..0000000000 --- a/wxWidgets/include/wx/generic/animate.h +++ /dev/null @@ -1,178 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/generic/animate.h -// Purpose: wxAnimation and wxAnimationCtrl -// Author: Julian Smart and Guillermo Rodriguez Garcia -// Modified by: Francesco Montorsi -// Created: 13/8/99 -// RCS-ID: $Id: animate.h 58350 2009-01-24 10:00:38Z FM $ -// Copyright: (c) Julian Smart and Guillermo Rodriguez Garcia -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_GENERIC_ANIMATEH__ -#define _WX_GENERIC_ANIMATEH__ - -#include "wx/bitmap.h" - -// ---------------------------------------------------------------------------- -// wxAnimation -// ---------------------------------------------------------------------------- - -WX_DECLARE_LIST_WITH_DECL(wxAnimationDecoder, wxAnimationDecoderList, class WXDLLIMPEXP_ADV); - -class WXDLLIMPEXP_ADV wxAnimation : public wxAnimationBase -{ -public: -#if wxABI_VERSION >= 20810 - wxAnimation() {} - wxAnimation(const wxString &name, wxAnimationType type = wxANIMATION_TYPE_ANY) - { LoadFile(name, type); } -#endif - virtual bool IsOk() const - { return m_refData != NULL; } - - virtual unsigned int GetFrameCount() const; - virtual int GetDelay(unsigned int i) const; - virtual wxImage GetFrame(unsigned int i) const; - virtual wxSize GetSize() const; - - virtual bool LoadFile(const wxString& filename, - wxAnimationType type = wxANIMATION_TYPE_ANY); - virtual bool Load(wxInputStream& stream, - wxAnimationType type = wxANIMATION_TYPE_ANY); - - // extended interface used by the generic implementation of wxAnimationCtrl - wxPoint GetFramePosition(unsigned int frame) const; - wxSize GetFrameSize(unsigned int frame) const; - wxAnimationDisposal GetDisposalMethod(unsigned int frame) const; - wxColour GetTransparentColour(unsigned int frame) const; - wxColour GetBackgroundColour() const; - -protected: - static wxAnimationDecoderList sm_handlers; - -public: - static inline wxAnimationDecoderList& GetHandlers() { return sm_handlers; } - static void AddHandler(wxAnimationDecoder *handler); - static void InsertHandler(wxAnimationDecoder *handler); - static const wxAnimationDecoder *FindHandler( wxAnimationType animType ); - - static void CleanUpHandlers(); - static void InitStandardHandlers(); - - DECLARE_DYNAMIC_CLASS(wxAnimation) -}; - - -// ---------------------------------------------------------------------------- -// wxAnimationCtrl -// ---------------------------------------------------------------------------- - -class WXDLLIMPEXP_ADV wxAnimationCtrl: public wxAnimationCtrlBase -{ -public: - wxAnimationCtrl() { Init(); } - wxAnimationCtrl(wxWindow *parent, - wxWindowID id, - const wxAnimation& anim = wxNullAnimation, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = wxAC_DEFAULT_STYLE, - const wxString& name = wxAnimationCtrlNameStr) - { - Init(); - - Create(parent, id, anim, pos, size, style, name); - } - - void Init(); - - bool Create(wxWindow *parent, wxWindowID id, - const wxAnimation& anim = wxNullAnimation, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = wxAC_DEFAULT_STYLE, - const wxString& name = wxAnimationCtrlNameStr); - - ~wxAnimationCtrl(); - -public: - virtual bool LoadFile(const wxString& filename, wxAnimationType type = wxANIMATION_TYPE_ANY); - - virtual void Stop(); - virtual bool Play() - { return Play(true /* looped */); } - virtual bool IsPlaying() const - { return m_isPlaying; } - - void SetAnimation(const wxAnimation &animation); - wxAnimation GetAnimation() const - { return m_animation; } - - virtual void SetInactiveBitmap(const wxBitmap &bmp); - - // override base class method - virtual bool SetBackgroundColour(const wxColour& col); - -public: // event handlers - - void OnPaint(wxPaintEvent& event); - void OnTimer(wxTimerEvent& event); - void OnSize(wxSizeEvent& event); - -public: // extended API specific to this implementation of wxAnimateCtrl - - // Specify whether the animation's background colour is to be shown (the default), - // or whether the window background should show through - void SetUseWindowBackgroundColour(bool useWinBackground = true) - { m_useWinBackgroundColour = useWinBackground; } - bool IsUsingWindowBackgroundColour() const - { return m_useWinBackgroundColour; } - - // This overload of Play() lets you specify if the animation must loop or not - bool Play(bool looped); - - // Draw the current frame of the animation into given DC. - // This is fast as current frame is always cached. - void DrawCurrentFrame(wxDC& dc); - - // Returns a wxBitmap with the current frame drawn in it - wxBitmap& GetBackingStore() - { return m_backingStore; } - -protected: // internal utilities - - // resize this control to fit m_animation - void FitToAnimation(); - - // Draw the background; use this when e.g. previous frame had wxANIM_TOBACKGROUND disposal. - void DisposeToBackground(); - void DisposeToBackground(wxDC& dc); - void DisposeToBackground(wxDC& dc, const wxPoint &pos, const wxSize &sz); - - void IncrementalUpdateBackingStore(); - bool RebuildBackingStoreUpToFrame(unsigned int); - void DrawFrame(wxDC &dc, unsigned int); - - virtual void DisplayStaticImage(); - virtual wxSize DoGetBestSize() const; - -protected: - unsigned int m_currentFrame; // Current frame - bool m_looped; // Looped, or not - wxTimer m_timer; // The timer - wxAnimation m_animation; // The animation - - bool m_isPlaying; // Is the animation playing? - bool m_useWinBackgroundColour; // Use animation bg colour or window bg colour? - - wxBitmap m_backingStore; // The frames are drawn here and then blitted - // on the screen - -private: - typedef wxAnimationCtrlBase base_type; - DECLARE_DYNAMIC_CLASS(wxAnimationCtrl) - DECLARE_EVENT_TABLE() -}; - -#endif // _WX_GENERIC_ANIMATEH__ diff --git a/wxWidgets/include/wx/generic/bmpcbox.h b/wxWidgets/include/wx/generic/bmpcbox.h deleted file mode 100644 index e91e0afdd5..0000000000 --- a/wxWidgets/include/wx/generic/bmpcbox.h +++ /dev/null @@ -1,170 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/generic/bmpcbox.h -// Purpose: wxBitmapComboBox -// Author: Jaakko Salli -// Modified by: -// Created: Aug-30-2006 -// RCS-ID: $Id: bmpcbox.h 42046 2006-10-16 09:30:01Z ABX $ -// Copyright: (c) Jaakko Salli -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_GENERIC_BMPCBOX_H_ -#define _WX_GENERIC_BMPCBOX_H_ - - -#define wxGENERIC_BITMAPCOMBOBOX 1 - -#include "wx/odcombo.h" - -// ---------------------------------------------------------------------------- -// wxBitmapComboBox: a wxComboBox that allows images to be shown -// in front of string items. -// ---------------------------------------------------------------------------- - -class WXDLLIMPEXP_ADV wxBitmapComboBox : public wxOwnerDrawnComboBox, - public wxBitmapComboBoxBase -{ -public: - - // ctors and such - wxBitmapComboBox() : wxOwnerDrawnComboBox(), wxBitmapComboBoxBase() - { - Init(); - } - - wxBitmapComboBox(wxWindow *parent, - wxWindowID id = wxID_ANY, - 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 = wxBitmapComboBoxNameStr) - : wxOwnerDrawnComboBox(), - wxBitmapComboBoxBase() - { - Init(); - - (void)Create(parent, id, value, pos, size, n, - choices, style, validator, name); - } - - wxBitmapComboBox(wxWindow *parent, - wxWindowID id, - const wxString& value, - const wxPoint& pos, - const wxSize& size, - const wxArrayString& choices, - long style, - const wxValidator& validator = wxDefaultValidator, - const wxString& name = wxBitmapComboBoxNameStr); - - bool Create(wxWindow *parent, - wxWindowID id, - const wxString& value, - const wxPoint& pos, - const wxSize& size, - int n, - const wxString choices[], - long style = 0, - const wxValidator& validator = wxDefaultValidator, - const wxString& name = wxBitmapComboBoxNameStr); - - 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 = wxBitmapComboBoxNameStr); - - virtual ~wxBitmapComboBox(); - - // Adds item with image to the end of the combo box. - int Append(const wxString& item, const wxBitmap& bitmap = wxNullBitmap) - { return DoAppendWithImage(item, bitmap); } - - int Append(const wxString& item, const wxBitmap& bitmap, void *clientData) - { int n = DoAppendWithImage(item, bitmap); SetClientData(n, clientData); return n; } - int Append(const wxString& item, const wxBitmap& bitmap, wxClientData *clientData) - { int n = DoAppendWithImage(item, bitmap); SetClientObject(n, clientData); return n; } - - // Returns size of image used in list. - virtual wxSize GetBitmapSize() const - { - return m_usedImgSize; - } - - // Returns the image of the item with the given index. - virtual wxBitmap GetItemBitmap(unsigned int n) const; - - // Inserts item with image into the list before pos. Not valid for wxCB_SORT or wxCB_SORT - // styles, use Append instead. - int Insert(const wxString& item, const wxBitmap& bitmap, unsigned int pos) - { return DoInsertWithImage(item, bitmap, pos); } - - int Insert(const wxString& item, const wxBitmap& bitmap, - unsigned int pos, void *clientData); - int Insert(const wxString& item, const wxBitmap& bitmap, - unsigned int pos, wxClientData *clientData); - - // Sets the image for the given item. - virtual void SetItemBitmap(unsigned int n, const wxBitmap& bitmap); - - virtual void Clear(); - virtual void Delete(unsigned int n); - -protected: - - virtual void OnDrawBackground(wxDC& dc, const wxRect& rect, int item, int flags) const; - virtual void OnDrawItem(wxDC& dc, const wxRect& rect, int item, int flags) const; - virtual wxCoord OnMeasureItem(size_t item) const; - virtual wxCoord OnMeasureItemWidth(size_t item) const; - - virtual int DoAppendWithImage(const wxString& item, const wxBitmap& bitmap); - virtual int DoInsertWithImage(const wxString& item, const wxBitmap& bitmap, - unsigned int pos); - - virtual int DoAppend(const wxString& item); - virtual int DoInsert(const wxString& item, unsigned int pos); - - virtual bool SetFont(const wxFont& font); - - virtual wxSize DoGetBestSize() const; - - // Event handlers - void OnSize(wxSizeEvent& event); - - // Recalculates amount of empty space needed in front of - // text in control itself. - void DetermineIndent(); - - bool OnAddBitmap(const wxBitmap& bitmap); - - // Adds image to position - called in Append/Insert before - // string is added. - bool DoInsertBitmap(const wxBitmap& image, unsigned int pos); - - - wxArrayPtrVoid m_bitmaps; // Images associated with items - wxSize m_usedImgSize; // Size of bitmaps - -private: - int m_imgAreaWidth; // Width and height of area next to text field - int m_fontHeight; - bool m_inResize; - - void Init(); - void PostCreate(); - - DECLARE_EVENT_TABLE() - - DECLARE_DYNAMIC_CLASS(wxBitmapComboBox) -}; - -#endif // _WX_GENERIC_BMPCBOX_H_ diff --git a/wxWidgets/include/wx/generic/busyinfo.h b/wxWidgets/include/wx/generic/busyinfo.h deleted file mode 100644 index c29a0f96d5..0000000000 --- a/wxWidgets/include/wx/generic/busyinfo.h +++ /dev/null @@ -1,42 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/generic/busyinfo.h -// Purpose: Information window (when app is busy) -// Author: Vaclav Slavik -// Copyright: (c) 1999 Vaclav Slavik -// RCS-ID: $Id: busyinfo.h 49804 2007-11-10 01:09:42Z VZ $ -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef __BUSYINFO_H__ -#define __BUSYINFO_H__ - -#include "wx/defs.h" - -#if wxUSE_BUSYINFO - -class WXDLLIMPEXP_FWD_CORE wxFrame; -class WXDLLIMPEXP_FWD_CORE wxWindow; - -//-------------------------------------------------------------------------------- -// wxBusyInfo -// Displays progress information -// Can be used in exactly same way as wxBusyCursor -//-------------------------------------------------------------------------------- - -class WXDLLEXPORT wxBusyInfo : public wxObject -{ -public: - wxBusyInfo(const wxString& message, wxWindow *parent = NULL); - - virtual ~wxBusyInfo(); - -private: - wxFrame *m_InfoFrame; - - DECLARE_NO_COPY_CLASS(wxBusyInfo) -}; - - -#endif // wxUSE_BUSYINFO - -#endif // __BUSYINFO_H__ diff --git a/wxWidgets/include/wx/generic/buttonbar.h b/wxWidgets/include/wx/generic/buttonbar.h deleted file mode 100644 index 6fa2c702a0..0000000000 --- a/wxWidgets/include/wx/generic/buttonbar.h +++ /dev/null @@ -1,123 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: wx/generic/buttonbar.h -// Purpose: wxButtonToolBar declaration -// Author: Julian Smart, after Robert Roebling, Vadim Zeitlin, SciTech -// Modified by: -// Created: 2006-04-13 -// Id: $Id: buttonbar.h 38714 2006-04-14 15:49:57Z JS $ -// Copyright: (c) Julian Smart, Robert Roebling, Vadim Zeitlin, -// SciTech Software, Inc. -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_BUTTONBAR_H_ -#define _WX_BUTTONBAR_H_ - -#include "wx/bmpbuttn.h" -#include "wx/toolbar.h" - -class WXDLLEXPORT wxButtonToolBarTool; - -// ---------------------------------------------------------------------------- -// wxButtonToolBar -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxButtonToolBar : public wxToolBarBase -{ -public: - // construction/destruction - wxButtonToolBar() { Init(); } - wxButtonToolBar(wxWindow *parent, - wxWindowID id, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = 0, - const wxString& name = wxToolBarNameStr) - { - Init(); - - Create(parent, id, pos, size, style, name); - } - - bool Create( wxWindow *parent, - wxWindowID id, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = 0, - const wxString& name = wxToolBarNameStr ); - - virtual ~wxButtonToolBar(); - - virtual bool Realize(); - - virtual void SetToolShortHelp(int id, const wxString& helpString); - virtual wxToolBarToolBase *FindToolForPosition(wxCoord x, wxCoord y) const; - -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); - - virtual wxSize DoGetBestClientSize() const; - - // calculate layout - void DoLayout(); - - // get the bounding rect for the given tool - wxRect GetToolRect(wxToolBarToolBase *tool) const; - - // get the rect limits depending on the orientation: top/bottom for a - // vertical toolbar, left/right for a horizontal one - void GetRectLimits(const wxRect& rect, wxCoord *start, wxCoord *end) const; - - // receives button commands - void OnCommand(wxCommandEvent& event); - - // paints a border - void OnPaint(wxPaintEvent& event); - - // detects mouse clicks outside buttons - void OnLeftUp(wxMouseEvent& event); - -private: - // have we calculated the positions of our tools? - bool m_needsLayout; - - // the width of a separator - wxCoord m_widthSeparator; - - // the total size of all toolbar elements - wxCoord m_maxWidth, - m_maxHeight; - - // the height of a label - int m_labelHeight; - - // the space above the label - int m_labelMargin; - -private: - DECLARE_DYNAMIC_CLASS(wxButtonToolBar) - DECLARE_EVENT_TABLE() -}; - -#endif - // _WX_BUTTONBAR_H_ - diff --git a/wxWidgets/include/wx/generic/calctrl.h b/wxWidgets/include/wx/generic/calctrl.h deleted file mode 100644 index ebb43cf733..0000000000 --- a/wxWidgets/include/wx/generic/calctrl.h +++ /dev/null @@ -1,324 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: generic/calctrl.h -// Purpose: generic implementation of date-picker control -// Author: Vadim Zeitlin -// Modified by: -// Created: 29.12.99 -// RCS-ID: $Id: calctrl.h 61872 2009-09-09 22:37:05Z VZ $ -// Copyright: (c) 1999 Vadim Zeitlin -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_GENERIC_CALCTRL_H -#define _WX_GENERIC_CALCTRL_H - -#include "wx/control.h" // the base class -#include "wx/dcclient.h" // for wxPaintDC - -class WXDLLIMPEXP_FWD_CORE wxComboBox; -class WXDLLIMPEXP_FWD_CORE wxStaticText; -class WXDLLIMPEXP_FWD_CORE wxSpinCtrl; - -#define wxCalendarNameStr wxT("CalendarCtrl") - -// ---------------------------------------------------------------------------- -// wxCalendarCtrl: a control allowing the user to pick a date interactively -// ---------------------------------------------------------------------------- - -class WXDLLIMPEXP_ADV wxCalendarCtrl : public wxControl -{ -public: - // construction - wxCalendarCtrl() { Init(); } - wxCalendarCtrl(wxWindow *parent, - wxWindowID id, - const wxDateTime& date = wxDefaultDateTime, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = wxCAL_SHOW_HOLIDAYS | wxWANTS_CHARS, - const wxString& name = wxCalendarNameStr); - - bool Create(wxWindow *parent, - wxWindowID id, - const wxDateTime& date = wxDefaultDateTime, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = wxCAL_SHOW_HOLIDAYS | wxWANTS_CHARS, - const wxString& name = wxCalendarNameStr); - - virtual ~wxCalendarCtrl(); - - virtual bool Destroy(); - - // set/get the current date - // ------------------------ - - bool SetDate(const wxDateTime& date); // we need to be able to control if the event should be sent in SetDateAndNotify(...) - const wxDateTime& GetDate() const { return m_date; } - - // set/get the range in which selection can occur - // --------------------------------------------- - - bool SetLowerDateLimit(const wxDateTime& date = wxDefaultDateTime); - const wxDateTime& GetLowerDateLimit() const { return m_lowdate; } - bool SetUpperDateLimit(const wxDateTime& date = wxDefaultDateTime); - const wxDateTime& GetUpperDateLimit() const { return m_highdate; } - - bool SetDateRange(const wxDateTime& lowerdate = wxDefaultDateTime, const wxDateTime& upperdate = wxDefaultDateTime); - - // calendar mode - // ------------- - - // some calendar styles can't be changed after the control creation by - // just using SetWindowStyle() and Refresh() and the functions below - // should be used instead for them - - // corresponds to wxCAL_NO_YEAR_CHANGE bit - void EnableYearChange(bool enable = true); - - // corresponds to wxCAL_NO_MONTH_CHANGE bit - void EnableMonthChange(bool enable = true); - - // corresponds to wxCAL_SHOW_HOLIDAYS bit - void EnableHolidayDisplay(bool display = true); - - // customization - // ------------- - - // header colours are used for painting the weekdays at the top - void SetHeaderColours(const wxColour& colFg, const wxColour& colBg) - { - m_colHeaderFg = colFg; - m_colHeaderBg = colBg; - } - - const wxColour& GetHeaderColourFg() const { return m_colHeaderFg; } - const wxColour& GetHeaderColourBg() const { return m_colHeaderBg; } - - // highlight colour is used for the currently selected date - void SetHighlightColours(const wxColour& colFg, const wxColour& colBg) - { - m_colHighlightFg = colFg; - m_colHighlightBg = colBg; - } - - const wxColour& GetHighlightColourFg() const { return m_colHighlightFg; } - const wxColour& GetHighlightColourBg() const { return m_colHighlightBg; } - - // holiday colour is used for the holidays (if style & wxCAL_SHOW_HOLIDAYS) - void SetHolidayColours(const wxColour& colFg, const wxColour& colBg) - { - m_colHolidayFg = colFg; - m_colHolidayBg = colBg; - } - - const wxColour& GetHolidayColourFg() const { return m_colHolidayFg; } - const wxColour& GetHolidayColourBg() const { return m_colHolidayBg; } - - // an item without custom attributes is drawn with the default colours and - // font and without border, setting custom attributes allows to modify this - // - // the day parameter should be in 1..31 range, for days 29, 30, 31 the - // corresponding attribute is just unused if there is no such day in the - // current month - - wxCalendarDateAttr *GetAttr(size_t day) const - { - wxCHECK_MSG( day > 0 && day < 32, NULL, wxT("invalid day") ); - - return m_attrs[day - 1]; - } - - void SetAttr(size_t day, wxCalendarDateAttr *attr) - { - wxCHECK_RET( day > 0 && day < 32, wxT("invalid day") ); - - delete m_attrs[day - 1]; - m_attrs[day - 1] = attr; - } - - void SetHoliday(size_t day); - - void ResetAttr(size_t day) { SetAttr(day, (wxCalendarDateAttr *)NULL); } - - // returns one of wxCAL_HITTEST_XXX constants and fills either date or wd - // with the corresponding value (none for NOWHERE, the date for DAY and wd - // for HEADER) - wxCalendarHitTestResult HitTest(const wxPoint& pos, - wxDateTime *date = NULL, - wxDateTime::WeekDay *wd = NULL); - - // implementation only from now on - // ------------------------------- - - // forward these functions to all subcontrols - virtual bool Enable(bool enable = true); - virtual bool Show(bool show = true); - - virtual void SetWindowStyleFlag(long style); - - virtual wxVisualAttributes GetDefaultAttributes() const - { return GetClassDefaultAttributes(GetWindowVariant()); } - - static wxVisualAttributes - GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL); - - void OnSysColourChanged(wxSysColourChangedEvent& event); - -protected: - // override some base class virtuals - virtual wxSize DoGetBestSize() const; - virtual void DoGetPosition(int *x, int *y) const; - virtual void DoGetSize(int *width, int *height) const; - virtual void DoSetSize(int x, int y, int width, int height, int sizeFlags); - virtual void DoMoveWindow(int x, int y, int width, int height); - -private: - // common part of all ctors - void Init(); - - // startup colours and reinitialization after colour changes in system - void InitColours(); - - // event handlers - void OnPaint(wxPaintEvent& event); - void OnClick(wxMouseEvent& event); - void OnDClick(wxMouseEvent& event); - void OnChar(wxKeyEvent& event); - void OnMonthChange(wxCommandEvent& event); - void OnYearChange(wxCommandEvent& event); - void OnYearTextChange(wxCommandEvent& event); - - // (re)calc m_widthCol and m_heightRow - void RecalcGeometry(); - - // set the date and send the notification - void SetDateAndNotify(const wxDateTime& date); - - // get the week (row, in range 1..6) for the given date - size_t GetWeek(const wxDateTime& date) const; - - // get the date from which we start drawing days - wxDateTime GetStartDate() const; - - // is this date shown? - bool IsDateShown(const wxDateTime& date) const; - - // is this date in the given range? - bool IsDateInRange(const wxDateTime& date) const; - - // range helpers - bool ChangeYear(wxDateTime* target) const; - bool ChangeMonth(wxDateTime* target) const; - - // redraw the given date - void RefreshDate(const wxDateTime& date); - - // change the date inside the same month/year - void ChangeDay(const wxDateTime& date); - - // set the attributes for the holidays if needed - void SetHolidayAttrs(); - - // reset all holidays - void ResetHolidayAttrs(); - - // generate the given calendar event(s) - void GenerateEvent(wxEventType type) - { - wxCalendarEvent event(this, type); - (void)GetEventHandler()->ProcessEvent(event); - } - - void GenerateEvents(wxEventType type1, wxEventType type2) - { - GenerateEvent(type1); - GenerateEvent(type2); - } - - // do we allow changing the month/year? - bool AllowMonthChange() const - { - return (GetWindowStyle() & wxCAL_NO_MONTH_CHANGE) - != wxCAL_NO_MONTH_CHANGE; - } - bool AllowYearChange() const - { - return !(GetWindowStyle() & wxCAL_NO_YEAR_CHANGE); - } - - // show the correct controls - void ShowCurrentControls(); - - // create the month combo and year spin controls - void CreateMonthComboBox(); - void CreateYearSpinCtrl(); - -public: - // get the currently shown control for month/year - wxControl *GetMonthControl() const; - wxControl *GetYearControl() const; - -private: - // OnPaint helper-methods - - // Highlight the [fromdate : todate] range using pen and brush - void HighlightRange(wxPaintDC* dc, const wxDateTime& fromdate, const wxDateTime& todate, const wxPen* pen, const wxBrush* brush); - - // Get the "coordinates" for the date relative to the month currently displayed. - // using (day, week): upper left coord is (1, 1), lower right coord is (7, 6) - // if the date isn't visible (-1, -1) is put in (day, week) and false is returned - bool GetDateCoord(const wxDateTime& date, int *day, int *week) const; - - // Set the flag for SetDate(): otherwise it would overwrite the year - // typed in by the user - void SetUserChangedYear() { m_userChangedYear = true; } - - // the subcontrols - wxStaticText *m_staticMonth; - wxComboBox *m_comboMonth; - - wxStaticText *m_staticYear; - wxSpinCtrl *m_spinYear; - - // the current selection - wxDateTime m_date; - - // the date-range - wxDateTime m_lowdate; - wxDateTime m_highdate; - - // default attributes - wxColour m_colHighlightFg, - m_colHighlightBg, - m_colHolidayFg, - m_colHolidayBg, - m_colHeaderFg, - m_colHeaderBg, - m_colBackground, - m_colSorrounding; - - // the attributes for each of the month days - wxCalendarDateAttr *m_attrs[31]; - - // the width and height of one column/row in the calendar - wxCoord m_widthCol, - m_heightRow, - m_rowOffset; - - wxRect m_leftArrowRect, - m_rightArrowRect; - - // the week day names - wxString m_weekdays[7]; - - // true if SetDate() is being called as the result of changing the year in - // the year control - bool m_userChangedYear; - - DECLARE_DYNAMIC_CLASS(wxCalendarCtrl) - DECLARE_EVENT_TABLE() - DECLARE_NO_COPY_CLASS(wxCalendarCtrl) -}; - -#endif // _WX_GENERIC_CALCTRL_H diff --git a/wxWidgets/include/wx/generic/caret.h b/wxWidgets/include/wx/generic/caret.h deleted file mode 100644 index 5b8de00ed8..0000000000 --- a/wxWidgets/include/wx/generic/caret.h +++ /dev/null @@ -1,95 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: generic/caret.h -// Purpose: generic wxCaret class -// Author: Vadim Zeitlin (original code by Robert Roebling) -// Modified by: -// Created: 25.05.99 -// RCS-ID: $Id: caret.h 42397 2006-10-25 12:12:56Z VS $ -// Copyright: (c) wxWidgets team -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_CARET_H_ -#define _WX_CARET_H_ - -#include "wx/timer.h" -#include "wx/dc.h" -#include "wx/overlay.h" - -#ifdef wxHAS_NATIVE_OVERLAY - #define wxHAS_CARET_USING_OVERLAYS -#endif - -class WXDLLIMPEXP_CORE wxCaret; - -class WXDLLEXPORT wxCaretTimer : public wxTimer -{ -public: - wxCaretTimer(wxCaret *caret); - virtual void Notify(); - -private: - wxCaret *m_caret; -}; - -class WXDLLIMPEXP_CORE wxCaret : public wxCaretBase -{ -public: - // ctors - // ----- - // default - use Create() - wxCaret() : m_timer(this) { InitGeneric(); } - // creates a block caret associated with the given window - wxCaret(wxWindowBase *window, int width, int height) - : wxCaretBase(window, width, height), m_timer(this) { InitGeneric(); } - wxCaret(wxWindowBase *window, const wxSize& size) - : wxCaretBase(window, size), m_timer(this) { InitGeneric(); } - - virtual ~wxCaret(); - - // implementation - // -------------- - - // called by wxWindow (not using the event tables) - virtual void OnSetFocus(); - virtual void OnKillFocus(); - - // called by wxCaretTimer - void OnTimer(); - -protected: - virtual void DoShow(); - virtual void DoHide(); - virtual void DoMove(); - virtual void DoSize(); - - // blink the caret once - void Blink(); - - // refresh the caret - void Refresh(); - - // draw the caret on the given DC - void DoDraw(wxDC *dc); - -private: - // GTK specific initialization - void InitGeneric(); - -#ifdef wxHAS_CARET_USING_OVERLAYS - // the overlay for displaying the caret - wxOverlay m_overlay; -#else - // the bitmap holding the part of window hidden by the caret when it was - // at (m_xOld, m_yOld) - wxBitmap m_bmpUnderCaret; - int m_xOld, - m_yOld; -#endif - - wxCaretTimer m_timer; - bool m_blinkedOut, // true => caret hidden right now - m_hasFocus; // true => our window has focus -}; - -#endif // _WX_CARET_H_ diff --git a/wxWidgets/include/wx/generic/choicdgg.h b/wxWidgets/include/wx/generic/choicdgg.h deleted file mode 100644 index 79bc395d35..0000000000 --- a/wxWidgets/include/wx/generic/choicdgg.h +++ /dev/null @@ -1,320 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/generic/choicdgg.h -// Purpose: Generic choice dialogs -// Author: Julian Smart -// Modified by: 03.11.00: VZ to add wxArrayString and multiple sel functions -// Created: 01/02/97 -// RCS-ID: $Id: choicdgg.h 49563 2007-10-31 20:46:21Z VZ $ -// Copyright: (c) wxWidgets team -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_GENERIC_CHOICDGG_H_ -#define _WX_GENERIC_CHOICDGG_H_ - -#include "wx/dynarray.h" -#include "wx/dialog.h" - -class WXDLLIMPEXP_FWD_CORE wxListBoxBase; - -// ---------------------------------------------------------------------------- -// some (ugly...) constants -// ---------------------------------------------------------------------------- - -#define wxCHOICE_HEIGHT 150 -#define wxCHOICE_WIDTH 200 - -#ifdef __WXWINCE__ -#define wxCHOICEDLG_STYLE \ - (wxDEFAULT_DIALOG_STYLE | wxOK | wxCANCEL | wxCENTRE) -#else -#define wxCHOICEDLG_STYLE \ - (wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER | wxOK | wxCANCEL | wxCENTRE) -#endif - -// ---------------------------------------------------------------------------- -// wxAnyChoiceDialog: a base class for dialogs containing a listbox -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxAnyChoiceDialog : public wxDialog -{ -public: - wxAnyChoiceDialog() { } - - wxAnyChoiceDialog(wxWindow *parent, - const wxString& message, - const wxString& caption, - int n, const wxString *choices, - long styleDlg = wxCHOICEDLG_STYLE, - const wxPoint& pos = wxDefaultPosition, - long styleLbox = wxLB_ALWAYS_SB) - { - (void)Create(parent, message, caption, n, choices, - styleDlg, pos, styleLbox); - } - wxAnyChoiceDialog(wxWindow *parent, - const wxString& message, - const wxString& caption, - const wxArrayString& choices, - long styleDlg = wxCHOICEDLG_STYLE, - const wxPoint& pos = wxDefaultPosition, - long styleLbox = wxLB_ALWAYS_SB) - { - (void)Create(parent, message, caption, choices, - styleDlg, pos, styleLbox); - } - - bool Create(wxWindow *parent, - const wxString& message, - const wxString& caption, - int n, const wxString *choices, - long styleDlg = wxCHOICEDLG_STYLE, - const wxPoint& pos = wxDefaultPosition, - long styleLbox = wxLB_ALWAYS_SB); - bool Create(wxWindow *parent, - const wxString& message, - const wxString& caption, - const wxArrayString& choices, - long styleDlg = wxCHOICEDLG_STYLE, - const wxPoint& pos = wxDefaultPosition, - long styleLbox = wxLB_ALWAYS_SB); - -protected: - wxListBoxBase *m_listbox; - - virtual wxListBoxBase *CreateList(int n, - const wxString *choices, - long styleLbox); - - DECLARE_NO_COPY_CLASS(wxAnyChoiceDialog) -}; - -// ---------------------------------------------------------------------------- -// wxSingleChoiceDialog: a dialog with single selection listbox -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxSingleChoiceDialog : public wxAnyChoiceDialog -{ -public: - wxSingleChoiceDialog() - { - m_selection = -1; - } - - wxSingleChoiceDialog(wxWindow *parent, - const wxString& message, - const wxString& caption, - int n, - const wxString *choices, - char **clientData = (char **)NULL, - long style = wxCHOICEDLG_STYLE, - const wxPoint& pos = wxDefaultPosition); - wxSingleChoiceDialog(wxWindow *parent, - const wxString& message, - const wxString& caption, - const wxArrayString& choices, - char **clientData = (char **)NULL, - long style = wxCHOICEDLG_STYLE, - const wxPoint& pos = wxDefaultPosition); - - bool Create(wxWindow *parent, - const wxString& message, - const wxString& caption, - int n, - const wxString *choices, - char **clientData = (char **)NULL, - long style = wxCHOICEDLG_STYLE, - const wxPoint& pos = wxDefaultPosition); - bool Create(wxWindow *parent, - const wxString& message, - const wxString& caption, - const wxArrayString& choices, - char **clientData = (char **)NULL, - long style = wxCHOICEDLG_STYLE, - const wxPoint& pos = wxDefaultPosition); - - void SetSelection(int sel); - int GetSelection() const { return m_selection; } - wxString GetStringSelection() const { return m_stringSelection; } - - // obsolete function (NB: no need to make it return wxChar, it's untyped) - char *GetSelectionClientData() const { return (char *)m_clientData; } - - // implementation from now on - void OnOK(wxCommandEvent& event); -#ifndef __SMARTPHONE__ - void OnListBoxDClick(wxCommandEvent& event); -#endif -#ifdef __WXWINCE__ - void OnJoystickButtonDown(wxJoystickEvent& event); -#endif - -protected: - int m_selection; - wxString m_stringSelection; - - void DoChoice(); - -private: - DECLARE_DYNAMIC_CLASS_NO_COPY(wxSingleChoiceDialog) - DECLARE_EVENT_TABLE() -}; - -// ---------------------------------------------------------------------------- -// wxMultiChoiceDialog: a dialog with multi selection listbox -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxMultiChoiceDialog : public wxAnyChoiceDialog -{ -public: - wxMultiChoiceDialog() { } - - wxMultiChoiceDialog(wxWindow *parent, - const wxString& message, - const wxString& caption, - int n, - const wxString *choices, - long style = wxCHOICEDLG_STYLE, - const wxPoint& pos = wxDefaultPosition) - { - (void)Create(parent, message, caption, n, choices, style, pos); - } - wxMultiChoiceDialog(wxWindow *parent, - const wxString& message, - const wxString& caption, - const wxArrayString& choices, - long style = wxCHOICEDLG_STYLE, - const wxPoint& pos = wxDefaultPosition) - { - (void)Create(parent, message, caption, choices, style, pos); - } - - bool Create(wxWindow *parent, - const wxString& message, - const wxString& caption, - int n, - const wxString *choices, - long style = wxCHOICEDLG_STYLE, - const wxPoint& pos = wxDefaultPosition); - bool Create(wxWindow *parent, - const wxString& message, - const wxString& caption, - const wxArrayString& choices, - long style = wxCHOICEDLG_STYLE, - const wxPoint& pos = wxDefaultPosition); - - void SetSelections(const wxArrayInt& selections); - wxArrayInt GetSelections() const { return m_selections; } - - // implementation from now on - virtual bool TransferDataFromWindow(); - -protected: -#if wxUSE_CHECKLISTBOX - virtual wxListBoxBase *CreateList(int n, - const wxString *choices, - long styleLbox); -#endif // wxUSE_CHECKLISTBOX - - wxArrayInt m_selections; - -private: - DECLARE_DYNAMIC_CLASS_NO_COPY(wxMultiChoiceDialog) -}; - -// ---------------------------------------------------------------------------- -// wrapper functions which can be used to get selection(s) from the user -// ---------------------------------------------------------------------------- - -// get the user selection as a string -WXDLLEXPORT wxString wxGetSingleChoice(const wxString& message, - const wxString& caption, - const wxArrayString& choices, - wxWindow *parent = NULL, - int x = wxDefaultCoord, - int y = wxDefaultCoord, - bool centre = true, - int width = wxCHOICE_WIDTH, - int height = wxCHOICE_HEIGHT); - -WXDLLEXPORT wxString wxGetSingleChoice(const wxString& message, - const wxString& caption, - int n, const wxString *choices, - wxWindow *parent = NULL, - int x = wxDefaultCoord, - int y = wxDefaultCoord, - bool centre = true, - int width = wxCHOICE_WIDTH, - int height = wxCHOICE_HEIGHT); - -// Same as above but gets position in list of strings, instead of string, -// or -1 if no selection -WXDLLEXPORT int wxGetSingleChoiceIndex(const wxString& message, - const wxString& caption, - const wxArrayString& choices, - wxWindow *parent = NULL, - int x = wxDefaultCoord, - int y = wxDefaultCoord, - bool centre = true, - int width = wxCHOICE_WIDTH, - int height = wxCHOICE_HEIGHT); - -WXDLLEXPORT int wxGetSingleChoiceIndex(const wxString& message, - const wxString& caption, - int n, const wxString *choices, - wxWindow *parent = NULL, - int x = wxDefaultCoord, - int y = wxDefaultCoord, - bool centre = true, - int width = wxCHOICE_WIDTH, - int height = wxCHOICE_HEIGHT); - -// Return client data instead or NULL if cancelled -WXDLLEXPORT void* wxGetSingleChoiceData(const wxString& message, - const wxString& caption, - const wxArrayString& choices, - void **client_data, - wxWindow *parent = NULL, - int x = wxDefaultCoord, - int y = wxDefaultCoord, - bool centre = true, - int width = wxCHOICE_WIDTH, - int height = wxCHOICE_HEIGHT); - -WXDLLEXPORT void* wxGetSingleChoiceData(const wxString& message, - const wxString& caption, - int n, const wxString *choices, - void **client_data, - wxWindow *parent = NULL, - int x = wxDefaultCoord, - int y = wxDefaultCoord, - bool centre = true, - int width = wxCHOICE_WIDTH, - int height = wxCHOICE_HEIGHT); - -// fill the array with the indices of the chosen items, it will be empty -// if no items were selected or Cancel was pressed - return the number of -// selections -WXDLLEXPORT size_t wxGetMultipleChoices(wxArrayInt& selections, - const wxString& message, - const wxString& caption, - int n, const wxString *choices, - wxWindow *parent = NULL, - int x = wxDefaultCoord, - int y = wxDefaultCoord, - bool centre = true, - int width = wxCHOICE_WIDTH, - int height = wxCHOICE_HEIGHT); - -WXDLLEXPORT size_t wxGetMultipleChoices(wxArrayInt& selections, - const wxString& message, - const wxString& caption, - const wxArrayString& choices, - wxWindow *parent = NULL, - int x = wxDefaultCoord, - int y = wxDefaultCoord, - bool centre = true, - int width = wxCHOICE_WIDTH, - int height = wxCHOICE_HEIGHT); - -#endif // _WX_GENERIC_CHOICDGG_H_ diff --git a/wxWidgets/include/wx/generic/clrpickerg.h b/wxWidgets/include/wx/generic/clrpickerg.h deleted file mode 100644 index a67f1181f3..0000000000 --- a/wxWidgets/include/wx/generic/clrpickerg.h +++ /dev/null @@ -1,98 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/generic/clrpickerg.h -// Purpose: wxGenericColourButton header -// Author: Francesco Montorsi (based on Vadim Zeitlin's code) -// Modified by: -// Created: 14/4/2006 -// Copyright: (c) Vadim Zeitlin, Francesco Montorsi -// RCS-ID: $Id: clrpickerg.h 58967 2009-02-17 13:31:28Z SC $ -// Licence: wxWindows Licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_CLRPICKER_H_ -#define _WX_CLRPICKER_H_ - -#include "wx/button.h" -#include "wx/cmndata.h" - -//----------------------------------------------------------------------------- -// wxGenericColourButton: a button which brings up a wxColourDialog -//----------------------------------------------------------------------------- - -// show the colour in HTML form (#AABBCC) as colour button label -#define wxCLRBTN_SHOW_LABEL 100 - -// the default style -#define wxCLRBTN_DEFAULT_STYLE (wxCLRBTN_SHOW_LABEL) - -#ifndef wxCLRBTN_USES_BMP_BUTTON - #define wxCLRBTN_USES_BMP_BUTTON 0 -#endif - -#if wxCLRBTN_USES_BMP_BUTTON - #include "wx/bmpbutton.h" - #define wxCLRBTN_BASE_CLASS wxBitmapButton -#else - #define wxCLRBTN_BASE_CLASS wxButton -#endif - -class WXDLLIMPEXP_CORE wxGenericColourButton : public wxCLRBTN_BASE_CLASS, - public wxColourPickerWidgetBase -{ -public: - wxGenericColourButton() {} - wxGenericColourButton(wxWindow *parent, - wxWindowID id, - const wxColour& col = *wxBLACK, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = wxCLRBTN_DEFAULT_STYLE, - const wxValidator& validator = wxDefaultValidator, - const wxString& name = wxColourPickerWidgetNameStr) - { - Create(parent, id, col, pos, size, style, validator, name); - } - - virtual ~wxGenericColourButton() {} - - -public: // API extensions specific for wxGenericColourButton - - // user can override this to init colour data in a different way - virtual void InitColourData(); - - // returns the colour data shown in wxColourDialog - wxColourData *GetColourData() { return &ms_data; } - - -public: - - bool Create(wxWindow *parent, - wxWindowID id, - const wxColour& col = *wxBLACK, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = wxCLRBTN_DEFAULT_STYLE, - const wxValidator& validator = wxDefaultValidator, - const wxString& name = wxColourPickerWidgetNameStr); - - void OnButtonClick(wxCommandEvent &); - - -protected: - - wxSize DoGetBestSize() const; - - void UpdateColour(); - - // the colour data shown in wxColourPickerCtrlGeneric - // controls. This member is static so that all colour pickers - // in the program share the same set of custom colours. - static wxColourData ms_data; - -private: - DECLARE_DYNAMIC_CLASS(wxGenericColourButton) -}; - - -#endif // _WX_CLRPICKER_H_ diff --git a/wxWidgets/include/wx/generic/collpaneg.h b/wxWidgets/include/wx/generic/collpaneg.h deleted file mode 100644 index 412c679803..0000000000 --- a/wxWidgets/include/wx/generic/collpaneg.h +++ /dev/null @@ -1,105 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/generic/collpaneg.h -// Purpose: wxGenericCollapsiblePane -// Author: Francesco Montorsi -// Modified by: -// Created: 8/10/2006 -// RCS-ID: $Id: collpaneg.h 49804 2007-11-10 01:09:42Z VZ $ -// Copyright: (c) Francesco Montorsi -// Licence: wxWindows Licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_COLLAPSABLE_PANE_H_GENERIC_ -#define _WX_COLLAPSABLE_PANE_H_GENERIC_ - -// forward declared -class WXDLLIMPEXP_FWD_CORE wxButton; -class WXDLLIMPEXP_FWD_CORE wxStaticLine; - -// class name -extern WXDLLIMPEXP_DATA_CORE(const wxChar) wxCollapsiblePaneNameStr[]; - -// ---------------------------------------------------------------------------- -// wxGenericCollapsiblePane -// ---------------------------------------------------------------------------- - -class WXDLLIMPEXP_CORE wxGenericCollapsiblePane : public wxCollapsiblePaneBase -{ -public: - wxGenericCollapsiblePane() { Init(); } - - wxGenericCollapsiblePane(wxWindow *parent, - wxWindowID winid, - const wxString& label, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = wxCP_DEFAULT_STYLE, - const wxValidator& val = wxDefaultValidator, - const wxString& name = wxCollapsiblePaneNameStr) - { - Init(); - - Create(parent, winid, label, pos, size, style, val, name); - } - - void Init() - { - m_pButton = NULL; - m_pPane = NULL; - m_pStaticLine = NULL; - m_sz = NULL; - } - - ~wxGenericCollapsiblePane(); - - bool Create(wxWindow *parent, - wxWindowID winid, - const wxString& label, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = wxCP_DEFAULT_STYLE, - const wxValidator& val = wxDefaultValidator, - const wxString& name = wxCollapsiblePaneNameStr); - - // public wxCollapsiblePane API - virtual void Collapse(bool collapse = true); - virtual void SetLabel(const wxString &label); - - virtual bool IsCollapsed() const - { return m_pPane==NULL || !m_pPane->IsShown(); } - virtual wxWindow *GetPane() const - { return m_pPane; } - virtual wxString GetLabel() const - { return m_strLabel; } - - virtual bool Layout(); - - // implementation only, don't use - void OnStateChange(const wxSize& sizeNew); - -protected: - // overridden methods - virtual wxSize DoGetBestSize() const; - - wxString GetBtnLabel() const; - int GetBorder() const; - - // child controls - wxButton *m_pButton; - wxStaticLine *m_pStaticLine; - wxWindow *m_pPane; - wxSizer *m_sz; - - // the button label without ">>" or "<<" - wxString m_strLabel; - -private: - // event handlers - void OnButton(wxCommandEvent &ev); - void OnSize(wxSizeEvent &ev); - - DECLARE_DYNAMIC_CLASS(wxGenericCollapsiblePane) - DECLARE_EVENT_TABLE() -}; - -#endif // _WX_COLLAPSABLE_PANE_H_GENERIC_ diff --git a/wxWidgets/include/wx/generic/colour.h b/wxWidgets/include/wx/generic/colour.h deleted file mode 100644 index 826e2c363c..0000000000 --- a/wxWidgets/include/wx/generic/colour.h +++ /dev/null @@ -1,75 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/generic/colour.h -// Purpose: wxColour class -// Author: Julian Smart -// Modified by: -// Created: 01/02/97 -// RCS-ID: $Id: colour.h 41751 2006-10-08 21:56:55Z VZ $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_GENERIC_COLOUR_H_ -#define _WX_GENERIC_COLOUR_H_ - -#include "wx/object.h" - -// Colour -class WXDLLEXPORT wxColour: public wxColourBase -{ -public: - // constructors - // ------------ - - // default - wxColour(); - DEFINE_STD_WXCOLOUR_CONSTRUCTORS - - // copy ctors and assignment operators - wxColour(const wxColour& col); - wxColour& operator=(const wxColour& col); - - // dtor - virtual ~wxColour(); - - // accessors - bool Ok() const { return IsOk(); } - bool IsOk() 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; } - unsigned char Alpha() const { return m_alpha; } - - // comparison - bool operator==(const wxColour& colour) const - { - return (m_red == colour.m_red && - m_green == colour.m_green && - m_blue == colour.m_blue && - m_alpha == colour.m_alpha && - m_isInit == colour.m_isInit); - } - - bool operator!=(const wxColour& colour) const { return !(*this == colour); } - -protected: - - // Helper function - void Init(); - - virtual void - InitRGBA(unsigned char r, unsigned char g, unsigned char b, unsigned char a); - -private: - bool m_isInit; - unsigned char m_red; - unsigned char m_blue; - unsigned char m_green; - unsigned char m_alpha; - -private: - DECLARE_DYNAMIC_CLASS(wxColour) -}; - -#endif // _WX_GENERIC_COLOUR_H_ diff --git a/wxWidgets/include/wx/generic/colrdlgg.h b/wxWidgets/include/wx/generic/colrdlgg.h deleted file mode 100644 index 77a3d6e3d9..0000000000 --- a/wxWidgets/include/wx/generic/colrdlgg.h +++ /dev/null @@ -1,120 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/generic/colrdlgg.h -// Purpose: wxGenericColourDialog -// Author: Julian Smart -// Modified by: -// Created: 01/02/97 -// RCS-ID: $Id: colrdlgg.h 37164 2006-01-26 17:20:50Z ABX $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef __COLORDLGH_G__ -#define __COLORDLGH_G__ - -#include "wx/defs.h" -#include "wx/gdicmn.h" -#include "wx/dialog.h" -#include "wx/cmndata.h" - -#define wxID_ADD_CUSTOM 3000 - -#if wxUSE_SLIDER - - #define wxID_RED_SLIDER 3001 - #define wxID_GREEN_SLIDER 3002 - #define wxID_BLUE_SLIDER 3003 - - class WXDLLEXPORT wxSlider; - -#endif // wxUSE_SLIDER - -class WXDLLEXPORT wxGenericColourDialog : public wxDialog -{ -public: - wxGenericColourDialog(); - wxGenericColourDialog(wxWindow *parent, - wxColourData *data = (wxColourData *) NULL); - virtual ~wxGenericColourDialog(); - - bool Create(wxWindow *parent, wxColourData *data = (wxColourData *) NULL); - - wxColourData &GetColourData() { return colourData; } - - virtual int ShowModal(); - - // Internal functions - void OnMouseEvent(wxMouseEvent& event); - void OnPaint(wxPaintEvent& event); - - virtual void CalculateMeasurements(); - virtual void CreateWidgets(); - virtual void InitializeColours(); - - virtual void PaintBasicColours(wxDC& dc); - virtual void PaintCustomColours(wxDC& dc); - virtual void PaintCustomColour(wxDC& dc); - virtual void PaintHighlight(wxDC& dc, bool draw); - - virtual void OnBasicColourClick(int which); - virtual void OnCustomColourClick(int which); - - void OnAddCustom(wxCommandEvent& event); - -#if wxUSE_SLIDER - void OnRedSlider(wxCommandEvent& event); - void OnGreenSlider(wxCommandEvent& event); - void OnBlueSlider(wxCommandEvent& event); -#endif // wxUSE_SLIDER - - void OnCloseWindow(wxCloseEvent& event); - -protected: - wxColourData colourData; - wxWindow *dialogParent; - - // Area reserved for grids of colours - wxRect standardColoursRect; - wxRect customColoursRect; - wxRect singleCustomColourRect; - - // Size of each colour rectangle - wxPoint smallRectangleSize; - - // For single customizable colour - wxPoint customRectangleSize; - - // Grid spacing (between rectangles) - int gridSpacing; - - // Section spacing (between left and right halves of dialog box) - int sectionSpacing; - - // 48 'standard' colours - wxColour standardColours[48]; - - // 16 'custom' colours - wxColour customColours[16]; - - // Which colour is selected? An index into one of the two areas. - int colourSelection; - int whichKind; // 1 for standard colours, 2 for custom colours, - -#if wxUSE_SLIDER - wxSlider *redSlider; - wxSlider *greenSlider; - wxSlider *blueSlider; -#endif // wxUSE_SLIDER - - int buttonY; - - int okButtonX; - int customButtonX; - - // static bool colourDialogCancelled; - - DECLARE_EVENT_TABLE() - DECLARE_DYNAMIC_CLASS(wxGenericColourDialog) -}; - -#endif diff --git a/wxWidgets/include/wx/generic/combo.h b/wxWidgets/include/wx/generic/combo.h deleted file mode 100644 index f5dff02b2c..0000000000 --- a/wxWidgets/include/wx/generic/combo.h +++ /dev/null @@ -1,140 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/generic/combo.h -// Purpose: Generic wxComboCtrl -// Author: Jaakko Salli -// Modified by: -// Created: Apr-30-2006 -// RCS-ID: $Id: combo.h 61872 2009-09-09 22:37:05Z VZ $ -// Copyright: (c) Jaakko Salli -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_GENERIC_COMBOCTRL_H_ -#define _WX_GENERIC_COMBOCTRL_H_ - -#if wxUSE_COMBOCTRL - -// Only define generic if native doesn't have all the features -#if !defined(wxCOMBOCONTROL_FULLY_FEATURED) - -// ---------------------------------------------------------------------------- -// Generic wxComboCtrl -// ---------------------------------------------------------------------------- - -#if defined(__WXUNIVERSAL__) - -// all actions of single line text controls are supported - -// popup/dismiss the choice window -#define wxACTION_COMBOBOX_POPUP wxT("popup") -#define wxACTION_COMBOBOX_DISMISS wxT("dismiss") - -#endif - -extern WXDLLIMPEXP_DATA_CORE(const wxChar) wxComboBoxNameStr[]; - -class WXDLLEXPORT wxGenericComboCtrl : public wxComboCtrlBase -{ -public: - // ctors and such - wxGenericComboCtrl() : wxComboCtrlBase() { Init(); } - - wxGenericComboCtrl(wxWindow *parent, - wxWindowID id = wxID_ANY, - const wxString& value = wxEmptyString, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = 0, - const wxValidator& validator = wxDefaultValidator, - const wxString& name = wxComboBoxNameStr) - : wxComboCtrlBase() - { - Init(); - - (void)Create(parent, id, value, pos, size, style, validator, name); - } - - bool Create(wxWindow *parent, - wxWindowID id = wxID_ANY, - const wxString& value = wxEmptyString, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = 0, - const wxValidator& validator = wxDefaultValidator, - const wxString& name = wxComboBoxNameStr); - - virtual ~wxGenericComboCtrl(); - - void SetCustomPaintWidth( int width ); - - virtual bool IsKeyPopupToggle(const wxKeyEvent& event) const; - - static int GetFeatures() { return wxComboCtrlFeatures::All; } - -#if defined(__WXUNIVERSAL__) - // we have our own input handler and our own actions - virtual bool PerformAction(const wxControlAction& action, - long numArg = 0l, - const wxString& strArg = wxEmptyString); -#endif - -protected: - - // Mandatory virtuals - virtual void OnResize(); - - // Event handlers - void OnPaintEvent( wxPaintEvent& event ); - void OnMouseEvent( wxMouseEvent& event ); - -private: - void Init(); - - DECLARE_EVENT_TABLE() - - DECLARE_DYNAMIC_CLASS(wxGenericComboCtrl) -}; - - -#ifndef _WX_COMBOCONTROL_H_ - -// If native wxComboCtrl was not defined, then prepare a simple -// front-end so that wxRTTI works as expected. - -class WXDLLEXPORT wxComboCtrl : public wxGenericComboCtrl -{ -public: - wxComboCtrl() : wxGenericComboCtrl() {} - - wxComboCtrl(wxWindow *parent, - wxWindowID id = wxID_ANY, - const wxString& value = wxEmptyString, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = 0, - const wxValidator& validator = wxDefaultValidator, - const wxString& name = wxComboBoxNameStr) - : wxGenericComboCtrl() - { - (void)Create(parent, id, value, pos, size, style, validator, name); - } - - virtual ~wxComboCtrl() {} - -protected: - -private: - DECLARE_DYNAMIC_CLASS(wxComboCtrl) -}; - -#endif // _WX_COMBOCONTROL_H_ - -#else - -#define wxGenericComboCtrl wxComboCtrl - -#endif // !defined(wxCOMBOCONTROL_FULLY_FEATURED) - -#endif // wxUSE_COMBOCTRL -#endif - // _WX_GENERIC_COMBOCTRL_H_ diff --git a/wxWidgets/include/wx/generic/dataview.h b/wxWidgets/include/wx/generic/dataview.h deleted file mode 100644 index e6222abc68..0000000000 --- a/wxWidgets/include/wx/generic/dataview.h +++ /dev/null @@ -1,311 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/generic/dataview.h -// Purpose: wxDataViewCtrl generic implementation header -// Author: Robert Roebling -// Id: $Id: dataview.h 53135 2008-04-12 02:31:04Z VZ $ -// Copyright: (c) 1998 Robert Roebling -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef __GENERICDATAVIEWCTRLH__ -#define __GENERICDATAVIEWCTRLH__ - -#include "wx/defs.h" -#include "wx/object.h" -#include "wx/list.h" -#include "wx/control.h" -#include "wx/scrolwin.h" -#include "wx/icon.h" - -// --------------------------------------------------------- -// classes -// --------------------------------------------------------- - -class WXDLLIMPEXP_FWD_ADV wxDataViewCtrl; -class WXDLLIMPEXP_FWD_ADV wxDataViewMainWindow; -class WXDLLIMPEXP_FWD_ADV wxDataViewHeaderWindow; - -// --------------------------------------------------------- -// wxDataViewRenderer -// --------------------------------------------------------- - -class WXDLLIMPEXP_ADV wxDataViewRenderer: public wxDataViewRendererBase -{ -public: - wxDataViewRenderer( const wxString &varianttype, wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT ); - virtual ~wxDataViewRenderer(); - - virtual bool Render( wxRect cell, wxDC *dc, int state ) = 0; - virtual wxSize GetSize() = 0; - - virtual bool Activate( wxRect WXUNUSED(cell), - wxDataViewListModel *WXUNUSED(model), - unsigned int WXUNUSED(col), - unsigned int WXUNUSED(row) ) - { return false; } - - virtual bool LeftClick( wxPoint WXUNUSED(cursor), - wxRect WXUNUSED(cell), - wxDataViewListModel *WXUNUSED(model), - unsigned int WXUNUSED(col), - unsigned int WXUNUSED(row) ) - { return false; } - virtual bool RightClick( wxPoint WXUNUSED(cursor), - wxRect WXUNUSED(cell), - wxDataViewListModel *WXUNUSED(model), - unsigned int WXUNUSED(col), - unsigned int WXUNUSED(row) ) - { return false; } - virtual bool StartDrag( wxPoint WXUNUSED(cursor), - wxRect WXUNUSED(cell), - wxDataViewListModel *WXUNUSED(model), - unsigned int WXUNUSED(col), - unsigned int WXUNUSED(row) ) - { return false; } - - // Create DC on request - virtual wxDC *GetDC(); - -private: - wxDC *m_dc; - -protected: - DECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewRenderer) -}; - -// --------------------------------------------------------- -// wxDataViewCustomRenderer -// --------------------------------------------------------- - -class WXDLLIMPEXP_ADV wxDataViewCustomRenderer: public wxDataViewRenderer -{ -public: - wxDataViewCustomRenderer( const wxString &varianttype = wxT("string"), - wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT ); - -protected: - DECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewCustomRenderer) -}; - -// --------------------------------------------------------- -// wxDataViewTextRenderer -// --------------------------------------------------------- - -class WXDLLIMPEXP_ADV wxDataViewTextRenderer: public wxDataViewCustomRenderer -{ -public: - wxDataViewTextRenderer( const wxString &varianttype = wxT("string"), - wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT ); - - bool SetValue( const wxVariant &value ); - bool GetValue( wxVariant &value ); - - bool Render( wxRect cell, wxDC *dc, int state ); - wxSize GetSize(); - -private: - wxString m_text; - -protected: - DECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewTextRenderer) -}; - -// --------------------------------------------------------- -// wxDataViewBitmapRenderer -// --------------------------------------------------------- - -class WXDLLIMPEXP_ADV wxDataViewBitmapRenderer: public wxDataViewCustomRenderer -{ -public: - wxDataViewBitmapRenderer( const wxString &varianttype = wxT("wxBitmap"), - wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT ); - - bool SetValue( const wxVariant &value ); - bool GetValue( wxVariant &value ); - - bool Render( wxRect cell, wxDC *dc, int state ); - wxSize GetSize(); - -private: - wxIcon m_icon; - wxBitmap m_bitmap; - -protected: - DECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewBitmapRenderer) -}; - -// --------------------------------------------------------- -// wxDataViewToggleRenderer -// --------------------------------------------------------- - -class WXDLLIMPEXP_ADV wxDataViewToggleRenderer: public wxDataViewCustomRenderer -{ -public: - wxDataViewToggleRenderer( const wxString &varianttype = wxT("bool"), - wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT ); - - bool SetValue( const wxVariant &value ); - bool GetValue( wxVariant &value ); - - bool Render( wxRect cell, wxDC *dc, int state ); - bool Activate( wxRect cell, wxDataViewListModel *model, unsigned int col, unsigned int row ); - wxSize GetSize(); - -private: - bool m_toggle; - -protected: - DECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewToggleRenderer) -}; - -// --------------------------------------------------------- -// wxDataViewProgressRenderer -// --------------------------------------------------------- - -class WXDLLIMPEXP_ADV wxDataViewProgressRenderer: public wxDataViewCustomRenderer -{ -public: - wxDataViewProgressRenderer( const wxString &label = wxEmptyString, - const wxString &varianttype = wxT("long"), - wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT ); - virtual ~wxDataViewProgressRenderer(); - - bool SetValue( const wxVariant &value ); - - virtual bool Render( wxRect cell, wxDC *dc, int state ); - virtual wxSize GetSize(); - -private: - wxString m_label; - int m_value; - -protected: - DECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewProgressRenderer) -}; - -// --------------------------------------------------------- -// wxDataViewDateRenderer -// --------------------------------------------------------- - -class WXDLLIMPEXP_ADV wxDataViewDateRenderer: public wxDataViewCustomRenderer -{ -public: - wxDataViewDateRenderer( const wxString &varianttype = wxT("datetime"), - wxDataViewCellMode mode = wxDATAVIEW_CELL_ACTIVATABLE ); - - bool SetValue( const wxVariant &value ); - - virtual bool Render( wxRect cell, wxDC *dc, int state ); - virtual wxSize GetSize(); - virtual bool Activate( wxRect cell, - wxDataViewListModel *model, unsigned int col, unsigned int row ); - -private: - wxDateTime m_date; - -protected: - DECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewDateRenderer) -}; - -// --------------------------------------------------------- -// wxDataViewColumn -// --------------------------------------------------------- - -class WXDLLIMPEXP_ADV wxDataViewColumn: public wxDataViewColumnBase -{ -public: - wxDataViewColumn( const wxString &title, wxDataViewRenderer *renderer, unsigned int model_column, - int width = 80, int flags = wxDATAVIEW_COL_RESIZABLE ); - wxDataViewColumn( const wxBitmap &bitmap, wxDataViewRenderer *renderer, unsigned int model_column, - int width = 80, int flags = wxDATAVIEW_COL_RESIZABLE ); - virtual ~wxDataViewColumn(); - - virtual void SetTitle( const wxString &title ); - virtual void SetBitmap( const wxBitmap &bitmap ); - - virtual void SetAlignment( wxAlignment align ); - - virtual void SetSortable( bool sortable ); - virtual bool GetSortable(); - virtual void SetSortOrder( bool ascending ); - virtual bool IsSortOrderAscending(); - - virtual int GetWidth(); - -private: - int m_width; - int m_fixedWidth; - -protected: - DECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewColumn) -}; - -// --------------------------------------------------------- -// wxDataViewCtrl -// --------------------------------------------------------- - -class WXDLLIMPEXP_ADV wxDataViewCtrl: public wxDataViewCtrlBase, - public wxScrollHelperNative -{ -public: - wxDataViewCtrl() : wxScrollHelperNative(this) - { - Init(); - } - - wxDataViewCtrl( wxWindow *parent, wxWindowID id, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, long style = 0, - const wxValidator& validator = wxDefaultValidator ) - : wxScrollHelperNative(this) - { - Create(parent, id, pos, size, style, validator ); - } - - virtual ~wxDataViewCtrl(); - - void Init(); - - bool Create(wxWindow *parent, wxWindowID id, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, long style = 0, - const wxValidator& validator = wxDefaultValidator ); - - virtual bool AssociateModel( wxDataViewListModel *model ); - virtual bool AppendColumn( wxDataViewColumn *col ); - - virtual void SetSelection( int row ); // -1 for unselect - virtual void SetSelectionRange( unsigned int from, unsigned int to ); - virtual void SetSelections( const wxArrayInt& aSelections); - virtual void Unselect( unsigned int row ); - - virtual bool IsSelected( unsigned int row ) const; - virtual int GetSelection() const; - virtual int GetSelections(wxArrayInt& aSelections) const; - -private: - friend class wxDataViewMainWindow; - friend class wxDataViewHeaderWindow; - wxDataViewListModelNotifier *m_notifier; - wxDataViewMainWindow *m_clientArea; - wxDataViewHeaderWindow *m_headerArea; - -private: - void OnSize( wxSizeEvent &event ); - - // we need to return a special WM_GETDLGCODE value to process just the - // arrows but let the other navigation characters through -#ifdef __WXMSW__ - virtual WXLRESULT MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam); -#endif // __WXMSW__ - - WX_FORWARD_TO_SCROLL_HELPER() - -private: - DECLARE_DYNAMIC_CLASS(wxDataViewCtrl) - DECLARE_NO_COPY_CLASS(wxDataViewCtrl) - DECLARE_EVENT_TABLE() -}; - - -#endif // __GENERICDATAVIEWCTRLH__ diff --git a/wxWidgets/include/wx/generic/datectrl.h b/wxWidgets/include/wx/generic/datectrl.h deleted file mode 100644 index bb3f01efcc..0000000000 --- a/wxWidgets/include/wx/generic/datectrl.h +++ /dev/null @@ -1,91 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: generic/datectrl.h -// Purpose: generic wxDatePickerCtrl implementation -// Author: Andreas Pflug -// Modified by: -// Created: 2005-01-19 -// RCS-ID: $Id: datectrl.h 42539 2006-10-27 18:02:21Z RR $ -// Copyright: (c) 2005 Andreas Pflug -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_GENERIC_DATECTRL_H_ -#define _WX_GENERIC_DATECTRL_H_ - -class WXDLLIMPEXP_ADV wxCalendarDateAttr; -class WXDLLIMPEXP_ADV wxCalendarCtrl; -class WXDLLIMPEXP_ADV wxCalendarEvent; -class WXDLLIMPEXP_ADV wxComboCtrl; -class WXDLLIMPEXP_ADV wxCalendarComboPopup; - -class WXDLLIMPEXP_ADV wxDatePickerCtrlGeneric : public wxDatePickerCtrlBase -{ -public: - // creating the control - wxDatePickerCtrlGeneric() { Init(); } - virtual ~wxDatePickerCtrlGeneric(); - wxDatePickerCtrlGeneric(wxWindow *parent, - wxWindowID id, - const wxDateTime& date = wxDefaultDateTime, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = wxDP_DEFAULT | wxDP_SHOWCENTURY, - const wxValidator& validator = wxDefaultValidator, - const wxString& name = wxDatePickerCtrlNameStr) - { - Init(); - - (void)Create(parent, id, date, pos, size, style, validator, name); - } - - bool Create(wxWindow *parent, - wxWindowID id, - const wxDateTime& date = wxDefaultDateTime, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = wxDP_DEFAULT | wxDP_SHOWCENTURY, - const wxValidator& validator = wxDefaultValidator, - const wxString& name = wxDatePickerCtrlNameStr); - - // wxDatePickerCtrl methods - void SetValue(const wxDateTime& date); - wxDateTime GetValue() const; - - bool GetRange(wxDateTime *dt1, wxDateTime *dt2) const; - void SetRange(const wxDateTime &dt1, const wxDateTime &dt2); - - bool SetDateRange(const wxDateTime& lowerdate = wxDefaultDateTime, - const wxDateTime& upperdate = wxDefaultDateTime); - - // extra methods available only in this (generic) implementation - bool SetFormat(const wxChar *fmt); - wxCalendarCtrl *GetCalendar() const { return m_cal; } - - - // implementation only from now on - // ------------------------------- - - // overridden base class methods - virtual bool Destroy(); - -protected: - virtual wxSize DoGetBestSize() const; - -private: - void Init(); - - void OnText(wxCommandEvent &event); - void OnSize(wxSizeEvent& event); - void OnFocus(wxFocusEvent& event); - - wxCalendarCtrl *m_cal; - wxComboCtrl* m_combo; - wxCalendarComboPopup* m_popup; - - - DECLARE_EVENT_TABLE() - DECLARE_NO_COPY_CLASS(wxDatePickerCtrlGeneric) -}; - -#endif // _WX_GENERIC_DATECTRL_H_ - diff --git a/wxWidgets/include/wx/generic/dcpsg.h b/wxWidgets/include/wx/generic/dcpsg.h deleted file mode 100644 index 5477bb961d..0000000000 --- a/wxWidgets/include/wx/generic/dcpsg.h +++ /dev/null @@ -1,154 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/generic/dcps.h -// Purpose: wxPostScriptDC class -// Author: Julian Smart and others -// Modified by: -// RCS-ID: $Id: dcpsg.h 41751 2006-10-08 21:56:55Z VZ $ -// Copyright: (c) Julian Smart and Robert Roebling -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_DCPSG_H_ -#define _WX_DCPSG_H_ - -#include "wx/defs.h" - -#if wxUSE_PRINTING_ARCHITECTURE - -#if wxUSE_POSTSCRIPT - -#include "wx/dc.h" -#include "wx/dialog.h" -#include "wx/module.h" -#include "wx/cmndata.h" - -extern WXDLLIMPEXP_DATA_CORE(int) wxPageNumber; - -//----------------------------------------------------------------------------- -// classes -//----------------------------------------------------------------------------- - -class wxPostScriptDC; - -//----------------------------------------------------------------------------- -// wxPostScriptDC -//----------------------------------------------------------------------------- - -class WXDLLEXPORT wxPostScriptDC: public wxDC -{ -public: - wxPostScriptDC(); - - // Recommended constructor - wxPostScriptDC(const wxPrintData& printData); - - // Recommended destructor :-) - virtual ~wxPostScriptDC(); - - virtual bool Ok() const { return IsOk(); } - virtual bool IsOk() const; - - bool CanDrawBitmap() const { return true; } - - void Clear(); - void SetFont( const wxFont& font ); - void SetPen( const wxPen& pen ); - void SetBrush( const wxBrush& brush ); - void SetLogicalFunction( int function ); - void SetBackground( const wxBrush& brush ); - - void DestroyClippingRegion(); - - bool StartDoc(const wxString& message); - void EndDoc(); - void StartPage(); - void EndPage(); - - wxCoord GetCharHeight() const; - wxCoord GetCharWidth() const; - bool CanGetTextExtent() const { return true; } - - // Resolution in pixels per logical inch - wxSize GetPPI() const; - - void SetAxisOrientation( bool xLeftRight, bool yBottomUp ); - void SetDeviceOrigin( wxCoord x, wxCoord y ); - - void SetBackgroundMode(int WXUNUSED(mode)) { } - void SetPalette(const wxPalette& WXUNUSED(palette)) { } - - wxPrintData& GetPrintData() { return m_printData; } - void SetPrintData(const wxPrintData& data) { m_printData = data; } - - virtual int GetDepth() const { return 24; } - - static void SetResolution(int ppi); - static int GetResolution(); - - void PsPrintf( const wxChar* fmt, ... ); - void PsPrint( const char* psdata ); - void PsPrint( int ch ); - -#if wxUSE_UNICODE - void PsPrint( const wxChar* psdata ) { PsPrint( wxConvUTF8.cWX2MB( psdata ) ); } -#endif - -private: - static float ms_PSScaleFactor; - -protected: - bool DoFloodFill(wxCoord x1, wxCoord y1, const wxColour &col, int style = wxFLOOD_SURFACE); - bool DoGetPixel(wxCoord x1, wxCoord y1, wxColour *col) const; - void DoDrawLine(wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2); - void DoCrossHair(wxCoord x, wxCoord y) ; - void DoDrawArc(wxCoord x1,wxCoord y1,wxCoord x2,wxCoord y2,wxCoord xc,wxCoord yc); - void DoDrawEllipticArc(wxCoord x,wxCoord y,wxCoord w,wxCoord h,double sa,double ea); - void DoDrawPoint(wxCoord x, wxCoord y); - void DoDrawLines(int n, wxPoint points[], wxCoord xoffset = 0, wxCoord yoffset = 0); - void DoDrawPolygon(int n, wxPoint points[], wxCoord xoffset = 0, wxCoord yoffset = 0, int fillStyle = wxODDEVEN_RULE); - void DoDrawPolyPolygon(int n, int count[], wxPoint points[], wxCoord xoffset = 0, wxCoord yoffset = 0, int fillStyle = wxODDEVEN_RULE); - void DoDrawRectangle(wxCoord x, wxCoord y, wxCoord width, wxCoord height); - void DoDrawRoundedRectangle(wxCoord x, wxCoord y, wxCoord width, wxCoord height, double radius = 20); - void DoDrawEllipse(wxCoord x, wxCoord y, wxCoord width, wxCoord height); -#if wxUSE_SPLINES - void DoDrawSpline(wxList *points); -#endif // wxUSE_SPLINES - bool DoBlit(wxCoord xdest, wxCoord ydest, wxCoord width, wxCoord height, - wxDC *source, wxCoord xsrc, wxCoord ysrc, int rop = wxCOPY, bool useMask = false, - wxCoord xsrcMask = wxDefaultCoord, wxCoord ysrcMask = wxDefaultCoord); - void DoDrawIcon(const wxIcon& icon, wxCoord x, wxCoord y); - void DoDrawBitmap(const wxBitmap& bitmap, wxCoord x, wxCoord y, bool useMask = false); - void DoDrawText(const wxString& text, wxCoord x, wxCoord y); - void DoDrawRotatedText(const wxString& text, wxCoord x, wxCoord y, double angle); - void DoSetClippingRegion(wxCoord x, wxCoord y, wxCoord width, wxCoord height); - void DoSetClippingRegionAsRegion( const wxRegion &WXUNUSED(clip)) { } - void DoGetTextExtent(const wxString& string, wxCoord *x, wxCoord *y, - wxCoord *descent = NULL, - wxCoord *externalLeading = NULL, - wxFont *theFont = NULL) const; - void DoGetSize(int* width, int* height) const; - void DoGetSizeMM(int *width, int *height) const; - - FILE* m_pstream; // PostScript output stream - wxString m_title; - unsigned char m_currentRed; - unsigned char m_currentGreen; - unsigned char m_currentBlue; - int m_pageNumber; - bool m_clipping; - double m_underlinePosition; - double m_underlineThickness; - wxPrintData m_printData; - -private: - DECLARE_DYNAMIC_CLASS(wxPostScriptDC) -}; - -#endif - // wxUSE_POSTSCRIPT - -#endif - // wxUSE_PRINTING_ARCHITECTURE - -#endif - // _WX_DCPSG_H_ diff --git a/wxWidgets/include/wx/generic/dirctrlg.h b/wxWidgets/include/wx/generic/dirctrlg.h deleted file mode 100644 index 190850ce9f..0000000000 --- a/wxWidgets/include/wx/generic/dirctrlg.h +++ /dev/null @@ -1,295 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: dirctrlg.h -// Purpose: wxGenericDirCtrl class -// Builds on wxDirCtrl class written by Robert Roebling for the -// wxFile application, modified by Harm van der Heijden. -// Further modified for Windows. -// Author: Robert Roebling, Harm van der Heijden, Julian Smart et al -// Modified by: -// Created: 21/3/2000 -// RCS-ID: $Id: dirctrlg.h 53135 2008-04-12 02:31:04Z VZ $ -// Copyright: (c) Robert Roebling, Harm van der Heijden, Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_DIRCTRL_H_ -#define _WX_DIRCTRL_H_ - -#if wxUSE_DIRDLG || wxUSE_FILEDLG - #include "wx/imaglist.h" -#endif - -#if wxUSE_DIRDLG - -#include "wx/treectrl.h" -#include "wx/dialog.h" -#include "wx/dirdlg.h" -#include "wx/choice.h" - -//----------------------------------------------------------------------------- -// classes -//----------------------------------------------------------------------------- - -class WXDLLIMPEXP_FWD_CORE wxTextCtrl; -class WXDLLIMPEXP_FWD_CORE wxImageList; -class WXDLLIMPEXP_FWD_BASE wxHashTable; - -//----------------------------------------------------------------------------- -// Extra styles for wxGenericDirCtrl -//----------------------------------------------------------------------------- - -enum -{ - // Only allow directory viewing/selection, no files - wxDIRCTRL_DIR_ONLY = 0x0010, - // When setting the default path, select the first file in the directory - wxDIRCTRL_SELECT_FIRST = 0x0020, - // Show the filter list - wxDIRCTRL_SHOW_FILTERS = 0x0040, - // Use 3D borders on internal controls - wxDIRCTRL_3D_INTERNAL = 0x0080, - // Editable labels - wxDIRCTRL_EDIT_LABELS = 0x0100 -}; - -//----------------------------------------------------------------------------- -// wxDirItemData -//----------------------------------------------------------------------------- - -class WXDLLEXPORT wxDirItemData : public wxTreeItemData -{ -public: - wxDirItemData(const wxString& path, const wxString& name, bool isDir); - virtual ~wxDirItemData(){} - void SetNewDirName(const wxString& path); - - bool HasSubDirs() const; - bool HasFiles(const wxString& spec = wxEmptyString) const; - - wxString m_path, m_name; - bool m_isHidden; - bool m_isExpanded; - bool m_isDir; -}; - -//----------------------------------------------------------------------------- -// wxDirCtrl -//----------------------------------------------------------------------------- - -class WXDLLIMPEXP_FWD_CORE wxDirFilterListCtrl; - -class WXDLLEXPORT wxGenericDirCtrl: public wxControl -{ -public: - wxGenericDirCtrl(); - wxGenericDirCtrl(wxWindow *parent, const wxWindowID id = wxID_ANY, - const wxString &dir = wxDirDialogDefaultFolderStr, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = wxDIRCTRL_3D_INTERNAL|wxSUNKEN_BORDER, - const wxString& filter = wxEmptyString, - int defaultFilter = 0, - const wxString& name = wxTreeCtrlNameStr ) - { - Init(); - Create(parent, id, dir, pos, size, style, filter, defaultFilter, name); - } - - bool Create(wxWindow *parent, const wxWindowID id = wxID_ANY, - const wxString &dir = wxDirDialogDefaultFolderStr, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = wxDIRCTRL_3D_INTERNAL|wxSUNKEN_BORDER, - const wxString& filter = wxEmptyString, - int defaultFilter = 0, - const wxString& name = wxTreeCtrlNameStr ); - - virtual void Init(); - - virtual ~wxGenericDirCtrl(); - - void OnExpandItem(wxTreeEvent &event ); - void OnCollapseItem(wxTreeEvent &event ); - void OnBeginEditItem(wxTreeEvent &event ); - void OnEndEditItem(wxTreeEvent &event ); - void OnSize(wxSizeEvent &event ); - - // Try to expand as much of the given path as possible. - virtual bool ExpandPath(const wxString& path); - // collapse the path - virtual bool CollapsePath(const wxString& path); - - // Accessors - - virtual inline wxString GetDefaultPath() const { return m_defaultPath; } - virtual void SetDefaultPath(const wxString& path) { m_defaultPath = path; } - - // Get dir or filename - virtual wxString GetPath() const; - - // Get selected filename path only (else empty string). - // I.e. don't count a directory as a selection - virtual wxString GetFilePath() const; - virtual void SetPath(const wxString& path); - - virtual void ShowHidden( bool show ); - virtual bool GetShowHidden() { return m_showHidden; } - - virtual wxString GetFilter() const { return m_filter; } - virtual void SetFilter(const wxString& filter); - - virtual int GetFilterIndex() const { return m_currentFilter; } - virtual void SetFilterIndex(int n); - - virtual wxTreeItemId GetRootId() { return m_rootId; } - - virtual wxTreeCtrl* GetTreeCtrl() const { return m_treeCtrl; } - virtual wxDirFilterListCtrl* GetFilterListCtrl() const { return m_filterListCtrl; } - - // Helper - virtual void SetupSections(); - -#if WXWIN_COMPATIBILITY_2_4 - // Parse the filter into an array of filters and an array of descriptions - virtual int ParseFilter(const wxString& filterStr, wxArrayString& filters, wxArrayString& descriptions); -#endif // WXWIN_COMPATIBILITY_2_4 - - // Find the child that matches the first part of 'path'. - // E.g. if a child path is "/usr" and 'path' is "/usr/include" - // then the child for /usr is returned. - // If the path string has been used (we're at the leaf), done is set to true - virtual wxTreeItemId FindChild(wxTreeItemId parentId, const wxString& path, bool& done); - - // Resize the components of the control - virtual void DoResize(); - - // Collapse & expand the tree, thus re-creating it from scratch: - virtual void ReCreateTree(); - - // Collapse the entire tree - virtual void CollapseTree(); - -protected: - virtual void ExpandRoot(); - virtual void ExpandDir(wxTreeItemId parentId); - virtual void CollapseDir(wxTreeItemId parentId); - virtual const wxTreeItemId AddSection(const wxString& path, const wxString& name, int imageId = 0); - virtual wxTreeItemId AppendItem (const wxTreeItemId & parent, - const wxString & text, - int image = -1, int selectedImage = -1, - wxTreeItemData * data = NULL); - //void FindChildFiles(wxTreeItemId id, int dirFlags, wxArrayString& filenames); - virtual wxTreeCtrl* CreateTreeCtrl(wxWindow *parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long treeStyle); - - // Extract description and actual filter from overall filter string - bool ExtractWildcard(const wxString& filterStr, int n, wxString& filter, wxString& description); - -private: - bool m_showHidden; - wxTreeItemId m_rootId; - wxString m_defaultPath; // Starting path - long m_styleEx; // Extended style - wxString m_filter; // Wildcards in same format as per wxFileDialog - int m_currentFilter; // The current filter index - wxString m_currentFilterStr; // Current filter string - wxTreeCtrl* m_treeCtrl; - wxDirFilterListCtrl* m_filterListCtrl; - -private: - DECLARE_EVENT_TABLE() - DECLARE_DYNAMIC_CLASS(wxGenericDirCtrl) - DECLARE_NO_COPY_CLASS(wxGenericDirCtrl) -}; - -//----------------------------------------------------------------------------- -// wxDirFilterListCtrl -//----------------------------------------------------------------------------- - -class WXDLLEXPORT wxDirFilterListCtrl: public wxChoice -{ -public: - wxDirFilterListCtrl() { Init(); } - wxDirFilterListCtrl(wxGenericDirCtrl* parent, const wxWindowID id = wxID_ANY, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = 0) - { - Init(); - Create(parent, id, pos, size, style); - } - - bool Create(wxGenericDirCtrl* parent, const wxWindowID id = wxID_ANY, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = 0); - - void Init(); - - virtual ~wxDirFilterListCtrl() {} - - //// Operations - void FillFilterList(const wxString& filter, int defaultFilter); - - //// Events - void OnSelFilter(wxCommandEvent& event); - -protected: - wxGenericDirCtrl* m_dirCtrl; - - DECLARE_EVENT_TABLE() - DECLARE_CLASS(wxDirFilterListCtrl) - DECLARE_NO_COPY_CLASS(wxDirFilterListCtrl) -}; - -#if !defined(__WXMSW__) && !defined(__WXMAC__) && !defined(__WXPM__) - #define wxDirCtrl wxGenericDirCtrl -#endif - -// Symbols for accessing individual controls -#define wxID_TREECTRL 7000 -#define wxID_FILTERLISTCTRL 7001 - -#endif // wxUSE_DIRDLG - -//------------------------------------------------------------------------- -// wxFileIconsTable - use wxTheFileIconsTable which is created as necessary -//------------------------------------------------------------------------- - -#if wxUSE_DIRDLG || wxUSE_FILEDLG - -class WXDLLEXPORT wxFileIconsTable -{ -public: - wxFileIconsTable(); - ~wxFileIconsTable(); - - enum iconId_Type - { - folder, - folder_open, - computer, - drive, - cdrom, - floppy, - removeable, - file, - executable - }; - - int GetIconID(const wxString& extension, const wxString& mime = wxEmptyString); - wxImageList *GetSmallImageList(); - -protected: - void Create(); // create on first use - - wxImageList *m_smallImageList; - wxHashTable *m_HashTable; -}; - -// The global fileicons table -extern WXDLLEXPORT_DATA(wxFileIconsTable *) wxTheFileIconsTable; - -#endif // wxUSE_DIRDLG || wxUSE_FILEDLG - -#endif - // _WX_DIRCTRLG_H_ diff --git a/wxWidgets/include/wx/generic/dirdlgg.h b/wxWidgets/include/wx/generic/dirdlgg.h deleted file mode 100644 index 73b61b5297..0000000000 --- a/wxWidgets/include/wx/generic/dirdlgg.h +++ /dev/null @@ -1,89 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/generic/dirdlgg.h -// Purpose: wxGenericDirCtrl class -// Builds on wxDirCtrl class written by Robert Roebling for the -// wxFile application, modified by Harm van der Heijden. -// Further modified for Windows. -// Author: Robert Roebling, Harm van der Heijden, Julian Smart et al -// Modified by: -// Created: 21/3/2000 -// RCS-ID: $Id: dirdlgg.h 39402 2006-05-28 23:32:12Z VZ $ -// Copyright: (c) Robert Roebling, Harm van der Heijden, Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_DIRDLGG_H_ -#define _WX_DIRDLGG_H_ - -class WXDLLEXPORT wxGenericDirCtrl; -class WXDLLEXPORT wxTextCtrl; -class WXDLLEXPORT wxTreeEvent; - -// we may be included directly as well as from wx/dirdlg.h (FIXME) -extern WXDLLEXPORT_DATA(const wxChar) wxDirDialogNameStr[]; -extern WXDLLEXPORT_DATA(const wxChar) wxDirSelectorPromptStr[]; - -#ifndef wxDD_DEFAULT_STYLE -#ifdef __WXWINCE__ - #define wxDD_DEFAULT_STYLE wxDEFAULT_DIALOG_STYLE -#else - #define wxDD_DEFAULT_STYLE (wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER) -#endif -#endif - -#include "wx/dialog.h" - -//----------------------------------------------------------------------------- -// wxGenericDirDialog -//----------------------------------------------------------------------------- - -class WXDLLEXPORT wxGenericDirDialog : public wxDirDialogBase -{ -public: - wxGenericDirDialog() : wxDirDialogBase() { } - - wxGenericDirDialog(wxWindow* parent, - const wxString& title = wxDirSelectorPromptStr, - const wxString& defaultPath = wxEmptyString, - long style = wxDD_DEFAULT_STYLE, - const wxPoint& pos = wxDefaultPosition, - const wxSize& sz = wxDefaultSize,//Size(450, 550), - const wxString& name = wxDirDialogNameStr); - - bool Create(wxWindow* parent, - const wxString& title = wxDirSelectorPromptStr, - const wxString& defaultPath = wxEmptyString, - long style = wxDD_DEFAULT_STYLE, - const wxPoint& pos = wxDefaultPosition, - const wxSize& sz = wxDefaultSize,//Size(450, 550), - const wxString& name = wxDirDialogNameStr); - - //// Accessors - void SetPath(const wxString& path); - wxString GetPath() const; - - //// Overrides - virtual int ShowModal(); - virtual void EndModal(int retCode); - - // this one is specific to wxGenericDirDialog - wxTextCtrl* GetInputCtrl() const { return m_input; } - -protected: - //// Event handlers - void OnCloseWindow(wxCloseEvent& event); - void OnOK(wxCommandEvent& event); - void OnTreeSelected(wxTreeEvent &event); - void OnTreeKeyDown(wxTreeEvent &event); - void OnNew(wxCommandEvent& event); - void OnGoHome(wxCommandEvent& event); - void OnShowHidden(wxCommandEvent& event); - - wxGenericDirCtrl* m_dirCtrl; - wxTextCtrl* m_input; - - DECLARE_EVENT_TABLE() - DECLARE_DYNAMIC_CLASS(wxGenericDirDialog) -}; - -#endif // _WX_DIRDLGG_H_ diff --git a/wxWidgets/include/wx/generic/dragimgg.h b/wxWidgets/include/wx/generic/dragimgg.h deleted file mode 100644 index f5cdd447f4..0000000000 --- a/wxWidgets/include/wx/generic/dragimgg.h +++ /dev/null @@ -1,271 +0,0 @@ -////////////////////////////////////////////////////////////////////////////// -// Name: wx/generic/dragimgg.h -// Purpose: wxDragImage class: a kind of a cursor, that can cope -// with more sophisticated images -// Author: Julian Smart -// Modified by: -// Created: 29/2/2000 -// RCS-ID: $Id: dragimgg.h 42397 2006-10-25 12:12:56Z VS $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_DRAGIMGG_H_ -#define _WX_DRAGIMGG_H_ - -#include "wx/bitmap.h" -#include "wx/icon.h" -#include "wx/cursor.h" -#include "wx/treectrl.h" -#include "wx/listctrl.h" -#include "wx/log.h" -#include "wx/overlay.h" - -/* - To use this class, create a wxDragImage when you start dragging, for example: - - void MyTreeCtrl::OnBeginDrag(wxTreeEvent& event) - { -#ifdef __WXMSW__ - ::UpdateWindow((HWND) GetHWND()); // We need to implement this in wxWidgets -#endif - - CaptureMouse(); - - m_dragImage = new wxDragImage(* this, itemId); - m_dragImage->BeginDrag(wxPoint(0, 0), this); - m_dragImage->Move(pt, this); - m_dragImage->Show(this); - ... - } - - In your OnMouseMove function, hide the image, do any display updating required, - then move and show the image again: - - void MyTreeCtrl::OnMouseMove(wxMouseEvent& event) - { - if (m_dragMode == MY_TREE_DRAG_NONE) - { - event.Skip(); - return; - } - - // Prevent screen corruption by hiding the image - if (m_dragImage) - m_dragImage->Hide(this); - - // Do some updating of the window, such as highlighting the drop target - ... - -#ifdef __WXMSW__ - if (updateWindow) - ::UpdateWindow((HWND) GetHWND()); -#endif - - // Move and show the image again - m_dragImage->Move(event.GetPosition(), this); - m_dragImage->Show(this); - } - - Eventually we end the drag and delete the drag image. - - void MyTreeCtrl::OnLeftUp(wxMouseEvent& event) - { - ... - - // End the drag and delete the drag image - if (m_dragImage) - { - m_dragImage->EndDrag(this); - delete m_dragImage; - m_dragImage = NULL; - } - ReleaseMouse(); - } -*/ - -/* - * wxGenericDragImage - */ - -class WXDLLEXPORT wxGenericDragImage: public wxObject -{ -public: - - // Ctors & dtor - //////////////////////////////////////////////////////////////////////////// - - wxGenericDragImage(const wxCursor& cursor = wxNullCursor) - { - Init(); - Create(cursor); - } - - wxGenericDragImage(const wxBitmap& image, const wxCursor& cursor = wxNullCursor) - { - Init(); - - Create(image, cursor); - } - - wxGenericDragImage(const wxIcon& image, const wxCursor& cursor = wxNullCursor) - { - Init(); - - Create(image, cursor); - } - - wxGenericDragImage(const wxString& str, const wxCursor& cursor = wxNullCursor) - { - Init(); - - Create(str, cursor); - } - -#if WXWIN_COMPATIBILITY_2_6 - // don't use in new code, use versions without hot spot parameter - wxDEPRECATED( wxGenericDragImage(const wxCursor& cursor, const wxPoint& cursorHotspot) ); - wxDEPRECATED( wxGenericDragImage(const wxBitmap& image, const wxCursor& cursor, const wxPoint& cursorHotspot) ); - wxDEPRECATED( wxGenericDragImage(const wxIcon& image, const wxCursor& cursor, const wxPoint& cursorHotspot) ); - wxDEPRECATED( wxGenericDragImage(const wxString& str, const wxCursor& cursor, const wxPoint& cursorHotspot) ); - wxDEPRECATED( bool Create(const wxCursor& cursor, const wxPoint& cursorHotspot) ); - wxDEPRECATED( bool Create(const wxBitmap& image, const wxCursor& cursor, const wxPoint& cursorHotspot) ); - wxDEPRECATED( bool Create(const wxIcon& image, const wxCursor& cursor, const wxPoint& cursorHotspot) ); - wxDEPRECATED( bool Create(const wxString& str, const wxCursor& cursor, const wxPoint& cursorHotspot) ); -#endif // WXWIN_COMPATIBILITY_2_6 - -#if wxUSE_TREECTRL - wxGenericDragImage(const wxTreeCtrl& treeCtrl, wxTreeItemId& id) - { - Init(); - - Create(treeCtrl, id); - } -#endif - -#if wxUSE_LISTCTRL - wxGenericDragImage(const wxListCtrl& listCtrl, long id) - { - Init(); - - Create(listCtrl, id); - } -#endif - - virtual ~wxGenericDragImage(); - - // Attributes - //////////////////////////////////////////////////////////////////////////// - - // For efficiency, tell wxGenericDragImage to use a bitmap that's already - // created (e.g. from last drag) - void SetBackingBitmap(wxBitmap* bitmap) { -#ifndef wxHAS_NATIVE_OVERLAY - m_pBackingBitmap = bitmap; -#endif - } - - // Operations - //////////////////////////////////////////////////////////////////////////// - - // Create a drag image with a virtual image (need to override DoDrawImage, GetImageRect) - bool Create(const wxCursor& cursor = wxNullCursor); - - // Create a drag image from a bitmap and optional cursor - bool Create(const wxBitmap& image, const wxCursor& cursor = wxNullCursor); - - // Create a drag image from an icon and optional cursor - bool Create(const wxIcon& image, const wxCursor& cursor = wxNullCursor); - - // Create a drag image from a string and optional cursor - bool Create(const wxString& str, const wxCursor& cursor = wxNullCursor); - -#if wxUSE_TREECTRL - // Create a drag image for the given tree control item - bool Create(const wxTreeCtrl& treeCtrl, wxTreeItemId& id); -#endif - -#if wxUSE_LISTCTRL - // Create a drag image for the given list control item - bool Create(const wxListCtrl& listCtrl, long id); -#endif - - // Begin drag. hotspot is the location of the drag position relative to the upper-left - // corner of the image. - bool BeginDrag(const wxPoint& hotspot, wxWindow* window, bool fullScreen = false, wxRect* rect = (wxRect*) NULL); - - // Begin drag. hotspot is the location of the drag position relative to the upper-left - // corner of the image. This is full screen only. fullScreenRect gives the - // position of the window on the screen, to restrict the drag to. - bool BeginDrag(const wxPoint& hotspot, wxWindow* window, wxWindow* fullScreenRect); - - // End drag - bool EndDrag(); - - // Move the image: call from OnMouseMove. Pt is in window client coordinates if window - // is non-NULL, or in screen coordinates if NULL. - bool Move(const wxPoint& pt); - - // Show the image - bool Show(); - - // Hide the image - bool Hide(); - - // Implementation - //////////////////////////////////////////////////////////////////////////// - - void Init(); - - // Override this if you are using a virtual image (drawing your own image) - virtual wxRect GetImageRect(const wxPoint& pos) const; - - // Override this if you are using a virtual image (drawing your own image) - virtual bool DoDrawImage(wxDC& dc, const wxPoint& pos) const; - - // Override this if you wish to draw the window contents to the backing bitmap - // yourself. This can be desirable if you wish to avoid flicker by not having to - // redraw the window itself before dragging in order to be graphic-minus-dragged-objects. - // Instead, paint the drag image's backing bitmap to be correct, and leave the window - // to be updated only when dragging the objects away (thus giving a smoother appearance). - virtual bool UpdateBackingFromWindow(wxDC& windowDC, wxMemoryDC& destDC, - const wxRect& sourceRect, const wxRect& destRect) const; - - // Erase and redraw simultaneously if possible - virtual bool RedrawImage(const wxPoint& oldPos, const wxPoint& newPos, bool eraseOld, bool drawNew); - -protected: - wxBitmap m_bitmap; - wxIcon m_icon; - wxCursor m_cursor; - wxCursor m_oldCursor; -// wxPoint m_hotspot; - wxPoint m_offset; // The hostpot value passed to BeginDrag - wxPoint m_position; - bool m_isDirty; - bool m_isShown; - wxWindow* m_window; - wxDC* m_windowDC; - -#ifdef wxHAS_NATIVE_OVERLAY - wxOverlay m_overlay; - wxDCOverlay* m_dcOverlay; -#else - // Stores the window contents while we're dragging the image around - wxBitmap m_backingBitmap; - wxBitmap* m_pBackingBitmap; // Pointer to existing backing bitmap - // (pass to wxGenericDragImage as an efficiency measure) - // A temporary bitmap for repairing/redrawing - wxBitmap m_repairBitmap; -#endif // !wxHAS_NATIVE_OVERLAY - - wxRect m_boundingRect; - bool m_fullScreen; - -private: - DECLARE_DYNAMIC_CLASS(wxGenericDragImage) - DECLARE_NO_COPY_CLASS(wxGenericDragImage) -}; - -#endif - // _WX_DRAGIMGG_H_ diff --git a/wxWidgets/include/wx/generic/fdrepdlg.h b/wxWidgets/include/wx/generic/fdrepdlg.h deleted file mode 100644 index c287322134..0000000000 --- a/wxWidgets/include/wx/generic/fdrepdlg.h +++ /dev/null @@ -1,71 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/msw/fdrepdlg.h -// Purpose: wxGenericFindReplaceDialog class -// Author: Markus Greither -// Modified by: -// Created: 25/05/2001 -// RCS-ID: -// Copyright: (c) wxWidgets team -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_GENERIC_FDREPDLG_H_ -#define _WX_GENERIC_FDREPDLG_H_ - -class WXDLLEXPORT wxCheckBox; -class WXDLLEXPORT wxRadioBox; -class WXDLLEXPORT wxTextCtrl; - -// ---------------------------------------------------------------------------- -// wxGenericFindReplaceDialog: dialog for searching / replacing text -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxGenericFindReplaceDialog : public wxFindReplaceDialogBase -{ -public: - wxGenericFindReplaceDialog() { Init(); } - - wxGenericFindReplaceDialog(wxWindow *parent, - wxFindReplaceData *data, - const wxString& title, - int style = 0) - { - Init(); - - (void)Create(parent, data, title, style); - } - - bool Create(wxWindow *parent, - wxFindReplaceData *data, - const wxString& title, - int style = 0); - -protected: - void Init(); - - void SendEvent(const wxEventType& evtType); - - void OnFind(wxCommandEvent& event); - void OnReplace(wxCommandEvent& event); - void OnReplaceAll(wxCommandEvent& event); - void OnCancel(wxCommandEvent& event); - - void OnUpdateFindUI(wxUpdateUIEvent& event); - - void OnCloseWindow(wxCloseEvent& event); - - wxCheckBox *m_chkCase, - *m_chkWord; - - wxRadioBox *m_radioDir; - - wxTextCtrl *m_textFind, - *m_textRepl; - -private: - DECLARE_DYNAMIC_CLASS(wxGenericFindReplaceDialog) - - DECLARE_EVENT_TABLE() -}; - -#endif // _WX_GENERIC_FDREPDLG_H_ diff --git a/wxWidgets/include/wx/generic/filedlgg.h b/wxWidgets/include/wx/generic/filedlgg.h deleted file mode 100644 index 70da48c382..0000000000 --- a/wxWidgets/include/wx/generic/filedlgg.h +++ /dev/null @@ -1,307 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/generic/filedlgg.h -// Purpose: wxGenericFileDialog -// Author: Robert Roebling -// Modified by: -// Created: 8/17/99 -// Copyright: (c) Robert Roebling -// RCS-ID: $Id: filedlgg.h 39631 2006-06-08 10:05:42Z RR $ -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_FILEDLGG_H_ -#define _WX_FILEDLGG_H_ - -#include "wx/listctrl.h" -#include "wx/datetime.h" -#include "wx/filefn.h" -#include "wx/filedlg.h" - -//----------------------------------------------------------------------------- -// classes -//----------------------------------------------------------------------------- - -class WXDLLEXPORT wxBitmapButton; -class WXDLLEXPORT wxCheckBox; -class WXDLLEXPORT wxChoice; -class WXDLLEXPORT wxFileData; -class WXDLLEXPORT wxFileCtrl; -class WXDLLEXPORT wxGenericFileDialog; -class WXDLLEXPORT wxListEvent; -class WXDLLEXPORT wxListItem; -class WXDLLEXPORT wxStaticText; -class WXDLLEXPORT wxTextCtrl; - -//------------------------------------------------------------------------- -// wxGenericFileDialog -//------------------------------------------------------------------------- - -class WXDLLEXPORT wxGenericFileDialog: public wxFileDialogBase -{ -public: - wxGenericFileDialog() : wxFileDialogBase() { Init(); } - - wxGenericFileDialog(wxWindow *parent, - const wxString& message = wxFileSelectorPromptStr, - const wxString& defaultDir = wxEmptyString, - const wxString& defaultFile = wxEmptyString, - const wxString& wildCard = wxFileSelectorDefaultWildcardStr, - long style = wxFD_DEFAULT_STYLE, - const wxPoint& pos = wxDefaultPosition, - const wxSize& sz = wxDefaultSize, - const wxString& name = wxFileDialogNameStr, - bool bypassGenericImpl = false ); - - bool Create( wxWindow *parent, - const wxString& message = wxFileSelectorPromptStr, - const wxString& defaultDir = wxEmptyString, - const wxString& defaultFile = wxEmptyString, - const wxString& wildCard = wxFileSelectorDefaultWildcardStr, - long style = wxFD_DEFAULT_STYLE, - const wxPoint& pos = wxDefaultPosition, - const wxSize& sz = wxDefaultSize, - const wxString& name = wxFileDialogNameStr, - bool bypassGenericImpl = false ); - - virtual ~wxGenericFileDialog(); - - virtual void SetMessage(const wxString& message) { SetTitle(message); } - virtual void SetPath(const wxString& path); - virtual void SetFilterIndex(int filterIndex); - virtual void SetWildcard(const wxString& wildCard); - - // for multiple file selection - virtual void GetPaths(wxArrayString& paths) const; - virtual void GetFilenames(wxArrayString& files) const; - - // implementation only from now on - // ------------------------------- - - virtual int ShowModal(); - virtual bool Show( bool show = true ); - - void OnSelected( wxListEvent &event ); - void OnActivated( wxListEvent &event ); - void OnList( wxCommandEvent &event ); - void OnReport( wxCommandEvent &event ); - void OnUp( wxCommandEvent &event ); - void OnHome( wxCommandEvent &event ); - void OnListOk( wxCommandEvent &event ); - void OnNew( wxCommandEvent &event ); - void OnChoiceFilter( wxCommandEvent &event ); - void OnTextEnter( wxCommandEvent &event ); - void OnTextChange( wxCommandEvent &event ); - void OnCheck( wxCommandEvent &event ); - - virtual void HandleAction( const wxString &fn ); - - virtual void UpdateControls(); - -private: - // Don't use this implementation at all :-) - bool m_bypassGenericImpl; - -protected: - // use the filter with the given index - void DoSetFilterIndex(int filterindex); - - wxString m_filterExtension; - wxChoice *m_choice; - wxTextCtrl *m_text; - wxFileCtrl *m_list; - wxCheckBox *m_check; - wxStaticText *m_static; - wxBitmapButton *m_upDirButton; - wxBitmapButton *m_newDirButton; - -private: - void Init(); - DECLARE_DYNAMIC_CLASS(wxGenericFileDialog) - DECLARE_EVENT_TABLE() - - // these variables are preserved between wxGenericFileDialog calls - static long ms_lastViewStyle; // list or report? - static bool ms_lastShowHidden; // did we show hidden files? -}; - -#ifdef wxUSE_GENERIC_FILEDIALOG - -class WXDLLEXPORT wxFileDialog: public wxGenericFileDialog -{ -public: - wxFileDialog() {} - - 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) - :wxGenericFileDialog(parent, message, defaultDir, defaultFile, wildCard, style, pos) - { - } - -private: - DECLARE_DYNAMIC_CLASS(wxFileDialog) -}; - -#endif // wxUSE_GENERIC_FILEDIALOG - -//----------------------------------------------------------------------------- -// wxFileData - a class to hold the file info for the wxFileCtrl -//----------------------------------------------------------------------------- - -class WXDLLEXPORT wxFileData -{ -public: - enum fileType - { - is_file = 0x0000, - is_dir = 0x0001, - is_link = 0x0002, - is_exe = 0x0004, - is_drive = 0x0008 - }; - - wxFileData() { Init(); } - // Full copy constructor - wxFileData( const wxFileData& fileData ) { Copy(fileData); } - // Create a filedata from this information - wxFileData( const wxString &filePath, const wxString &fileName, - fileType type, int image_id ); - - // make a full copy of the other wxFileData - void Copy( const wxFileData &other ); - - // (re)read the extra data about the file from the system - void ReadData(); - - // get the name of the file, dir, drive - wxString GetFileName() const { return m_fileName; } - // get the full path + name of the file, dir, path - wxString GetFilePath() const { return m_filePath; } - // Set the path + name and name of the item - void SetNewName( const wxString &filePath, const wxString &fileName ); - - // Get the size of the file in bytes - wxFileOffset GetSize() const { return m_size; } - // Get the type of file, either file extension or , , - wxString GetFileType() const; - // get the last modification time - wxDateTime GetDateTime() const { return m_dateTime; } - // Get the time as a formatted string - wxString GetModificationTime() const; - // in UNIX get rwx for file, in MSW get attributes ARHS - wxString GetPermissions() const { return m_permissions; } - // Get the id of the image used in a wxImageList - int GetImageId() const { return m_image; } - - bool IsFile() const { return !IsDir() && !IsLink() && !IsDrive(); } - bool IsDir() const { return (m_type & is_dir ) != 0; } - bool IsLink() const { return (m_type & is_link ) != 0; } - bool IsExe() const { return (m_type & is_exe ) != 0; } - bool IsDrive() const { return (m_type & is_drive) != 0; } - - // Get/Set the type of file, file/dir/drive/link - int GetType() const { return m_type; } - - // the wxFileCtrl fields in report view - enum fileListFieldType - { - FileList_Name, - FileList_Size, - FileList_Type, - FileList_Time, -#if defined(__UNIX__) || defined(__WIN32__) - FileList_Perm, -#endif // defined(__UNIX__) || defined(__WIN32__) - FileList_Max - }; - - // Get the entry for report view of wxFileCtrl - wxString GetEntry( fileListFieldType num ) const; - - // Get a string representation of the file info - wxString GetHint() const; - // initialize a wxListItem attributes - void MakeItem( wxListItem &item ); - - // operators - wxFileData& operator = (const wxFileData& fd) { Copy(fd); return *this; } - -protected: - wxString m_fileName; - wxString m_filePath; - wxFileOffset m_size; - wxDateTime m_dateTime; - wxString m_permissions; - int m_type; - int m_image; - -private: - void Init(); -}; - -//----------------------------------------------------------------------------- -// wxFileCtrl -//----------------------------------------------------------------------------- - -class WXDLLEXPORT wxFileCtrl : public wxListCtrl -{ -public: - wxFileCtrl(); - wxFileCtrl( wxWindow *win, - wxWindowID id, - const wxString &wild, - bool showHidden, - const wxPoint &pos = wxDefaultPosition, - const wxSize &size = wxDefaultSize, - long style = wxLC_LIST, - const wxValidator &validator = wxDefaultValidator, - const wxString &name = wxT("filelist") ); - virtual ~wxFileCtrl(); - - virtual void ChangeToListMode(); - virtual void ChangeToReportMode(); - virtual void ChangeToSmallIconMode(); - virtual void ShowHidden( bool show = true ); - bool GetShowHidden() const { return m_showHidden; } - - virtual long Add( wxFileData *fd, wxListItem &item ); - virtual void UpdateItem(const wxListItem &item); - virtual void UpdateFiles(); - virtual void MakeDir(); - virtual void GoToParentDir(); - virtual void GoToHomeDir(); - virtual void GoToDir( const wxString &dir ); - virtual void SetWild( const wxString &wild ); - wxString GetWild() const { return m_wild; } - wxString GetDir() const { return m_dirName; } - - void OnListDeleteItem( wxListEvent &event ); - void OnListDeleteAllItems( wxListEvent &event ); - void OnListEndLabelEdit( wxListEvent &event ); - void OnListColClick( wxListEvent &event ); - - virtual void SortItems(wxFileData::fileListFieldType field, bool foward); - bool GetSortDirection() const { return m_sort_foward; } - wxFileData::fileListFieldType GetSortField() const { return m_sort_field; } - -protected: - void FreeItemData(wxListItem& item); - void FreeAllItemsData(); - - wxString m_dirName; - bool m_showHidden; - wxString m_wild; - - bool m_sort_foward; - wxFileData::fileListFieldType m_sort_field; - -private: - DECLARE_DYNAMIC_CLASS(wxFileCtrl) - DECLARE_EVENT_TABLE() -}; - -#endif // _WX_FILEDLGG_H_ diff --git a/wxWidgets/include/wx/generic/filepickerg.h b/wxWidgets/include/wx/generic/filepickerg.h deleted file mode 100644 index 502587bea6..0000000000 --- a/wxWidgets/include/wx/generic/filepickerg.h +++ /dev/null @@ -1,213 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/generic/filepickerg.h -// Purpose: wxGenericFileDirButton, wxGenericFileButton, wxGenericDirButton -// Author: Francesco Montorsi -// Modified by: -// Created: 14/4/2006 -// Copyright: (c) Francesco Montorsi -// RCS-ID: $Id: filepickerg.h 40100 2006-07-15 15:13:04Z VS $ -// Licence: wxWindows Licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_FILEDIRPICKER_H_ -#define _WX_FILEDIRPICKER_H_ - -#include "wx/button.h" -#include "wx/filedlg.h" -#include "wx/dirdlg.h" - - -extern WXDLLEXPORT_DATA(const wxEventType) wxEVT_COMMAND_DIRPICKER_CHANGED; -extern WXDLLEXPORT_DATA(const wxEventType) wxEVT_COMMAND_FILEPICKER_CHANGED; - - -//----------------------------------------------------------------------------- -// wxGenericFileDirButton: a button which brings up a wx{File|Dir}Dialog -//----------------------------------------------------------------------------- - -class WXDLLIMPEXP_CORE wxGenericFileDirButton : public wxButton, - public wxFileDirPickerWidgetBase -{ -public: - wxGenericFileDirButton() { } - wxGenericFileDirButton(wxWindow *parent, - wxWindowID id, - const wxString& label = wxFilePickerWidgetLabel, - const wxString& path = wxEmptyString, - const wxString &message = wxFileSelectorPromptStr, - const wxString &wildcard = wxFileSelectorDefaultWildcardStr, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = 0, - const wxValidator& validator = wxDefaultValidator, - const wxString& name = wxFilePickerWidgetNameStr) - { - Create(parent, id, label, path, message, wildcard, - pos, size, style, validator, name); - } - - virtual ~wxGenericFileDirButton() {} - - virtual wxControl *AsControl() { return this; } - -public: // overrideable - - virtual wxDialog *CreateDialog() = 0; - - virtual wxWindow *GetDialogParent() - { return GetParent(); } - - virtual wxEventType GetEventType() const = 0; - -public: - - bool Create(wxWindow *parent, wxWindowID id, - const wxString& label = wxFilePickerWidgetLabel, - const wxString& path = wxEmptyString, - const wxString &message = wxFileSelectorPromptStr, - const wxString &wildcard = wxFileSelectorDefaultWildcardStr, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = 0, - const wxValidator& validator = wxDefaultValidator, - const wxString& name = wxFilePickerWidgetNameStr); - - // event handler for the click - void OnButtonClick(wxCommandEvent &); - -protected: - wxString m_message, m_wildcard; -}; - - -//----------------------------------------------------------------------------- -// wxGenericFileButton: a button which brings up a wxFileDialog -//----------------------------------------------------------------------------- - -#define wxFILEBTN_DEFAULT_STYLE (wxFLP_OPEN) - -class WXDLLIMPEXP_CORE wxGenericFileButton : public wxGenericFileDirButton -{ -public: - wxGenericFileButton() {} - wxGenericFileButton(wxWindow *parent, - wxWindowID id, - const wxString& label = wxFilePickerWidgetLabel, - const wxString& path = wxEmptyString, - const wxString &message = wxFileSelectorPromptStr, - const wxString &wildcard = wxFileSelectorDefaultWildcardStr, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = wxFILEBTN_DEFAULT_STYLE, - const wxValidator& validator = wxDefaultValidator, - const wxString& name = wxFilePickerWidgetNameStr) - { - Create(parent, id, label, path, message, wildcard, - pos, size, style, validator, name); - } - -public: // overrideable - - virtual long GetDialogStyle() const - { - long filedlgstyle = 0; - - if (this->HasFlag(wxFLP_OPEN)) - filedlgstyle |= wxFD_OPEN; - if (this->HasFlag(wxFLP_SAVE)) - filedlgstyle |= wxFD_SAVE; - if (this->HasFlag(wxFLP_OVERWRITE_PROMPT)) - filedlgstyle |= wxFD_OVERWRITE_PROMPT; - if (this->HasFlag(wxFLP_FILE_MUST_EXIST)) - filedlgstyle |= wxFD_FILE_MUST_EXIST; - if (this->HasFlag(wxFLP_CHANGE_DIR)) - filedlgstyle |= wxFD_CHANGE_DIR; - - return filedlgstyle; - } - - virtual wxDialog *CreateDialog() - { - wxFileDialog *p = new wxFileDialog(GetDialogParent(), m_message, - wxEmptyString, wxEmptyString, - m_wildcard, GetDialogStyle()); - - // this sets both the default folder and the default file of the dialog - p->SetPath(m_path); - return p; - } - - wxEventType GetEventType() const - { return wxEVT_COMMAND_FILEPICKER_CHANGED; } - -protected: - void UpdateDialogPath(wxDialog *p) - { wxStaticCast(p, wxFileDialog)->SetPath(m_path); } - void UpdatePathFromDialog(wxDialog *p) - { m_path = wxStaticCast(p, wxFileDialog)->GetPath(); } - -private: - DECLARE_DYNAMIC_CLASS(wxGenericFileButton) -}; - - -//----------------------------------------------------------------------------- -// wxGenericDirButton: a button which brings up a wxDirDialog -//----------------------------------------------------------------------------- - -#define wxDIRBTN_DEFAULT_STYLE 0 - -class WXDLLIMPEXP_CORE wxGenericDirButton : public wxGenericFileDirButton -{ -public: - wxGenericDirButton() {} - wxGenericDirButton(wxWindow *parent, - wxWindowID id, - const wxString& label = wxDirPickerWidgetLabel, - const wxString& path = wxEmptyString, - const wxString &message = wxDirSelectorPromptStr, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = wxDIRBTN_DEFAULT_STYLE, - const wxValidator& validator = wxDefaultValidator, - const wxString& name = wxDirPickerWidgetNameStr) - { - Create(parent, id, label, path, message, wxEmptyString, - pos, size, style, validator, name); - } - -public: // overrideable - - virtual long GetDialogStyle() const - { - long dirdlgstyle = wxDD_DEFAULT_STYLE; - - if (this->HasFlag(wxDIRP_DIR_MUST_EXIST)) - dirdlgstyle |= wxDD_DIR_MUST_EXIST; - if (this->HasFlag(wxDIRP_CHANGE_DIR)) - dirdlgstyle |= wxDD_CHANGE_DIR; - - return dirdlgstyle; - } - - virtual wxDialog *CreateDialog() - { - return new wxDirDialog(GetDialogParent(), m_message, m_path, - GetDialogStyle()); - } - - wxEventType GetEventType() const - { return wxEVT_COMMAND_DIRPICKER_CHANGED; } - -protected: - void UpdateDialogPath(wxDialog *p) - { wxStaticCast(p, wxDirDialog)->SetPath(m_path); } - void UpdatePathFromDialog(wxDialog *p) - { m_path = wxStaticCast(p, wxDirDialog)->GetPath(); } - -private: - DECLARE_DYNAMIC_CLASS(wxGenericDirButton) -}; - - -#endif // _WX_FILEDIRPICKER_H_ diff --git a/wxWidgets/include/wx/generic/fontdlgg.h b/wxWidgets/include/wx/generic/fontdlgg.h deleted file mode 100644 index 6a4b80b291..0000000000 --- a/wxWidgets/include/wx/generic/fontdlgg.h +++ /dev/null @@ -1,120 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/generic/fontdlgg.h -// Purpose: wxGenericFontDialog -// Author: Julian Smart -// Modified by: -// Created: 01/02/97 -// RCS-ID: $Id: fontdlgg.h 39286 2006-05-23 11:16:47Z JS $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_GENERIC_FONTDLGG_H -#define _WX_GENERIC_FONTDLGG_H - -#include "wx/defs.h" -#include "wx/gdicmn.h" -#include "wx/font.h" -#include "wx/dialog.h" -#include "wx/cmndata.h" - -#ifdef __WXWINCE__ -#define USE_SPINCTRL_FOR_POINT_SIZE 1 -class WXDLLEXPORT wxSpinEvent; -#else -#define USE_SPINCTRL_FOR_POINT_SIZE 0 -#endif - -/* - * FONT DIALOG - */ - -class WXDLLEXPORT wxChoice; -class WXDLLEXPORT wxText; -class WXDLLEXPORT wxCheckBox; -class WXDLLEXPORT wxFontPreviewer; - -enum -{ - wxID_FONT_UNDERLINE = 3000, - wxID_FONT_STYLE, - wxID_FONT_WEIGHT, - wxID_FONT_FAMILY, - wxID_FONT_COLOUR, - wxID_FONT_SIZE -}; - -class WXDLLEXPORT wxGenericFontDialog : public wxFontDialogBase -{ -public: - wxGenericFontDialog() { Init(); } - wxGenericFontDialog(wxWindow *parent) - : wxFontDialogBase(parent) { Init(); } - wxGenericFontDialog(wxWindow *parent, const wxFontData& data) - : wxFontDialogBase(parent, data) { Init(); } - virtual ~wxGenericFontDialog(); - - virtual int ShowModal(); - -#if WXWIN_COMPATIBILITY_2_6 - // deprecated, for backwards compatibility only - wxDEPRECATED( wxGenericFontDialog(wxWindow *parent, const wxFontData *data) ); -#endif // WXWIN_COMPATIBILITY_2_6 - - // Internal functions - void OnCloseWindow(wxCloseEvent& event); - - virtual void CreateWidgets(); - virtual void InitializeFont(); - - void OnChangeFont(wxCommandEvent& event); - -#if USE_SPINCTRL_FOR_POINT_SIZE - void OnChangeSize(wxSpinEvent& event); -#endif - -protected: - - virtual bool DoCreate(wxWindow *parent); - -private: - - // common part of all ctors - void Init(); - - void DoChangeFont(); - - wxFont m_dialogFont; - - wxChoice *m_familyChoice; - wxChoice *m_styleChoice; - wxChoice *m_weightChoice; - wxChoice *m_colourChoice; - wxCheckBox *m_underLineCheckBox; - -#if !USE_SPINCTRL_FOR_POINT_SIZE - wxChoice *m_pointSizeChoice; -#endif - - wxFontPreviewer *m_previewer; - bool m_useEvents; - - // static bool fontDialogCancelled; - DECLARE_EVENT_TABLE() - DECLARE_DYNAMIC_CLASS(wxGenericFontDialog) -}; - -WXDLLEXPORT const wxChar *wxFontFamilyIntToString(int family); -WXDLLEXPORT const wxChar *wxFontWeightIntToString(int weight); -WXDLLEXPORT const wxChar *wxFontStyleIntToString(int style); -WXDLLEXPORT int wxFontFamilyStringToInt(wxChar *family); -WXDLLEXPORT int wxFontWeightStringToInt(wxChar *weight); -WXDLLEXPORT int wxFontStyleStringToInt(wxChar *style); - -#if WXWIN_COMPATIBILITY_2_6 - // deprecated, for backwards compatibility only -inline wxGenericFontDialog::wxGenericFontDialog(wxWindow *parent, const wxFontData *data) - :wxFontDialogBase(parent) { Init(); InitFontData(data); Create(parent); } -#endif // WXWIN_COMPATIBILITY_2_6 - -#endif // _WX_GENERIC_FONTDLGG_H diff --git a/wxWidgets/include/wx/generic/fontpickerg.h b/wxWidgets/include/wx/generic/fontpickerg.h deleted file mode 100644 index ead7645139..0000000000 --- a/wxWidgets/include/wx/generic/fontpickerg.h +++ /dev/null @@ -1,82 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/generic/fontpickerg.h -// Purpose: wxGenericFontButton header -// Author: Francesco Montorsi -// Modified by: -// Created: 14/4/2006 -// Copyright: (c) Francesco Montorsi -// RCS-ID: $Id: fontpickerg.h 42999 2006-11-03 21:54:13Z VZ $ -// Licence: wxWindows Licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_FONTPICKER_H_ -#define _WX_FONTPICKER_H_ - -#include "wx/button.h" -#include "wx/cmndata.h" - -//----------------------------------------------------------------------------- -// wxGenericFontButton: a button which brings up a wxColourDialog -//----------------------------------------------------------------------------- - -#define wxFONTBTN_DEFAULT_STYLE \ - (wxFNTP_FONTDESC_AS_LABEL | wxFNTP_USEFONT_FOR_LABEL) - -class WXDLLIMPEXP_CORE wxGenericFontButton : public wxButton, - public wxFontPickerWidgetBase -{ -public: - wxGenericFontButton() {} - wxGenericFontButton(wxWindow *parent, - wxWindowID id, - const wxFont &initial = wxNullFont, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = wxFONTBTN_DEFAULT_STYLE, - const wxValidator& validator = wxDefaultValidator, - const wxString& name = wxFontPickerWidgetNameStr) - { - Create(parent, id, initial, pos, size, style, validator, name); - } - - virtual ~wxGenericFontButton() {} - - -public: // API extensions specific for wxGenericFontButton - - // user can override this to init font data in a different way - virtual void InitFontData(); - - // returns the font data shown in wxColourDialog - wxFontData *GetFontData() { return &ms_data; } - - -public: - - bool Create(wxWindow *parent, - wxWindowID id, - const wxFont &initial = *wxNORMAL_FONT, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = wxFONTBTN_DEFAULT_STYLE, - const wxValidator& validator = wxDefaultValidator, - const wxString& name = wxFontPickerWidgetNameStr); - - void OnButtonClick(wxCommandEvent &); - - -protected: - - void UpdateFont(); - - // the colour data shown in wxColourPickerCtrlGeneric - // controls. This member is static so that all colour pickers - // in the program share the same set of custom colours. - static wxFontData ms_data; - -private: - DECLARE_DYNAMIC_CLASS(wxGenericFontButton) -}; - - -#endif // _WX_FONTPICKER_H_ diff --git a/wxWidgets/include/wx/generic/grid.h b/wxWidgets/include/wx/generic/grid.h deleted file mode 100644 index de68d6f1cf..0000000000 --- a/wxWidgets/include/wx/generic/grid.h +++ /dev/null @@ -1,2307 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/generic/grid.h -// Purpose: wxGrid and related classes -// Author: Michael Bedward (based on code by Julian Smart, Robin Dunn) -// Modified by: Santiago Palacios -// Created: 1/08/1999 -// RCS-ID: $Id: grid.h 66942 2011-02-17 12:30:56Z JS $ -// Copyright: (c) Michael Bedward -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_GENERIC_GRID_H_ -#define _WX_GENERIC_GRID_H_ - -#include "wx/defs.h" - -#if wxUSE_GRID - -#include "wx/scrolwin.h" - -// ---------------------------------------------------------------------------- -// constants -// ---------------------------------------------------------------------------- - -extern WXDLLIMPEXP_DATA_ADV(const wxChar) wxGridNameStr[]; - -// Default parameters for wxGrid -// -#define WXGRID_DEFAULT_NUMBER_ROWS 10 -#define WXGRID_DEFAULT_NUMBER_COLS 10 -#if defined(__WXMSW__) || defined(__WXGTK20__) -#define WXGRID_DEFAULT_ROW_HEIGHT 25 -#else -#define WXGRID_DEFAULT_ROW_HEIGHT 30 -#endif // __WXMSW__ -#define WXGRID_DEFAULT_COL_WIDTH 80 -#define WXGRID_DEFAULT_COL_LABEL_HEIGHT 32 -#define WXGRID_DEFAULT_ROW_LABEL_WIDTH 82 -#define WXGRID_LABEL_EDGE_ZONE 2 -#define WXGRID_MIN_ROW_HEIGHT 15 -#define WXGRID_MIN_COL_WIDTH 15 -#define WXGRID_DEFAULT_SCROLLBAR_WIDTH 16 - -// type names for grid table values -#define wxGRID_VALUE_STRING wxT("string") -#define wxGRID_VALUE_BOOL wxT("bool") -#define wxGRID_VALUE_NUMBER wxT("long") -#define wxGRID_VALUE_FLOAT wxT("double") -#define wxGRID_VALUE_CHOICE wxT("choice") - -#define wxGRID_VALUE_TEXT wxGRID_VALUE_STRING -#define wxGRID_VALUE_LONG wxGRID_VALUE_NUMBER - -#if wxABI_VERSION >= 20808 - // magic constant which tells (to some functions) to automatically - // calculate the appropriate size - #define wxGRID_AUTOSIZE (-1) -#endif // wxABI_VERSION >= 20808 - -// ---------------------------------------------------------------------------- -// forward declarations -// ---------------------------------------------------------------------------- - -class WXDLLIMPEXP_FWD_ADV wxGrid; -class WXDLLIMPEXP_FWD_ADV wxGridCellAttr; -class WXDLLIMPEXP_FWD_ADV wxGridCellAttrProviderData; -class WXDLLIMPEXP_FWD_ADV wxGridColLabelWindow; -class WXDLLIMPEXP_FWD_ADV wxGridCornerLabelWindow; -class WXDLLIMPEXP_FWD_ADV wxGridRowLabelWindow; -class WXDLLIMPEXP_FWD_ADV wxGridWindow; -class WXDLLIMPEXP_FWD_ADV wxGridTypeRegistry; -class WXDLLIMPEXP_FWD_ADV wxGridSelection; - -class WXDLLIMPEXP_FWD_CORE wxCheckBox; -class WXDLLIMPEXP_FWD_CORE wxComboBox; -class WXDLLIMPEXP_FWD_CORE wxTextCtrl; -#if wxUSE_SPINCTRL -class WXDLLIMPEXP_FWD_CORE wxSpinCtrl; -#endif - -// ---------------------------------------------------------------------------- -// macros -// ---------------------------------------------------------------------------- - -#define wxSafeIncRef(p) if ( p ) (p)->IncRef() -#define wxSafeDecRef(p) if ( p ) (p)->DecRef() - -// ---------------------------------------------------------------------------- -// wxGridCellWorker: common base class for wxGridCellRenderer and -// wxGridCellEditor -// -// NB: this is more an implementation convenience than a design issue, so this -// class is not documented and is not public at all -// ---------------------------------------------------------------------------- - -class WXDLLIMPEXP_ADV wxGridCellWorker : public wxClientDataContainer -{ -public: - wxGridCellWorker() { m_nRef = 1; } - - // this class is ref counted: it is created with ref count of 1, so - // calling DecRef() once will delete it. Calling IncRef() allows to lock - // it until the matching DecRef() is called - void IncRef() { m_nRef++; } - void DecRef() { if ( --m_nRef == 0 ) delete this; } - - // interpret renderer parameters: arbitrary string whose interpretatin is - // left to the derived classes - virtual void SetParameters(const wxString& params); - -protected: - // virtual dtor for any base class - private because only DecRef() can - // delete us - virtual ~wxGridCellWorker(); - -private: - size_t m_nRef; - - // suppress the stupid gcc warning about the class having private dtor and - // no friends - friend class wxGridCellWorkerDummyFriend; -}; - -// ---------------------------------------------------------------------------- -// wxGridCellRenderer: this class is responsible for actually drawing the cell -// in the grid. You may pass it to the wxGridCellAttr (below) to change the -// format of one given cell or to wxGrid::SetDefaultRenderer() to change the -// view of all cells. This is an ABC, you will normally use one of the -// predefined derived classes or derive your own class from it. -// ---------------------------------------------------------------------------- - -class WXDLLIMPEXP_ADV wxGridCellRenderer : public wxGridCellWorker -{ -public: - // draw the given cell on the provided DC inside the given rectangle - // using the style specified by the attribute and the default or selected - // state corresponding to the isSelected value. - // - // this pure virtual function has a default implementation which will - // prepare the DC using the given attribute: it will draw the rectangle - // with the bg colour from attr and set the text colour and font - virtual void Draw(wxGrid& grid, - wxGridCellAttr& attr, - wxDC& dc, - const wxRect& rect, - int row, int col, - bool isSelected) = 0; - - // get the preferred size of the cell for its contents - virtual wxSize GetBestSize(wxGrid& grid, - wxGridCellAttr& attr, - wxDC& dc, - int row, int col) = 0; - - // create a new object which is the copy of this one - virtual wxGridCellRenderer *Clone() const = 0; -}; - -// the default renderer for the cells containing string data -class WXDLLIMPEXP_ADV wxGridCellStringRenderer : public wxGridCellRenderer -{ -public: - // draw the string - virtual void Draw(wxGrid& grid, - wxGridCellAttr& attr, - wxDC& dc, - const wxRect& rect, - int row, int col, - bool isSelected); - - // return the string extent - virtual wxSize GetBestSize(wxGrid& grid, - wxGridCellAttr& attr, - wxDC& dc, - int row, int col); - - virtual wxGridCellRenderer *Clone() const - { return new wxGridCellStringRenderer; } - -protected: - // set the text colours before drawing - void SetTextColoursAndFont(const wxGrid& grid, - const wxGridCellAttr& attr, - wxDC& dc, - bool isSelected); - - // calc the string extent for given string/font - wxSize DoGetBestSize(const wxGridCellAttr& attr, - wxDC& dc, - const wxString& text); -}; - -// the default renderer for the cells containing numeric (long) data -class WXDLLIMPEXP_ADV wxGridCellNumberRenderer : public wxGridCellStringRenderer -{ -public: - // draw the string right aligned - virtual void Draw(wxGrid& grid, - wxGridCellAttr& attr, - wxDC& dc, - const wxRect& rect, - int row, int col, - bool isSelected); - - virtual wxSize GetBestSize(wxGrid& grid, - wxGridCellAttr& attr, - wxDC& dc, - int row, int col); - - virtual wxGridCellRenderer *Clone() const - { return new wxGridCellNumberRenderer; } - -protected: - wxString GetString(const wxGrid& grid, int row, int col); -}; - -class WXDLLIMPEXP_ADV wxGridCellFloatRenderer : public wxGridCellStringRenderer -{ -public: - wxGridCellFloatRenderer(int width = -1, int precision = -1); - - // get/change formatting parameters - int GetWidth() const { return m_width; } - void SetWidth(int width) { m_width = width; m_format.clear(); } - int GetPrecision() const { return m_precision; } - void SetPrecision(int precision) { m_precision = precision; m_format.clear(); } - - // draw the string right aligned with given width/precision - virtual void Draw(wxGrid& grid, - wxGridCellAttr& attr, - wxDC& dc, - const wxRect& rect, - int row, int col, - bool isSelected); - - virtual wxSize GetBestSize(wxGrid& grid, - wxGridCellAttr& attr, - wxDC& dc, - int row, int col); - - // parameters string format is "width[,precision]" - virtual void SetParameters(const wxString& params); - - virtual wxGridCellRenderer *Clone() const; - -protected: - wxString GetString(const wxGrid& grid, int row, int col); - -private: - // formatting parameters - int m_width, - m_precision; - - wxString m_format; -}; - -// renderer for boolean fields -class WXDLLIMPEXP_ADV wxGridCellBoolRenderer : public wxGridCellRenderer -{ -public: - // draw a check mark or nothing - virtual void Draw(wxGrid& grid, - wxGridCellAttr& attr, - wxDC& dc, - const wxRect& rect, - int row, int col, - bool isSelected); - - // return the checkmark size - virtual wxSize GetBestSize(wxGrid& grid, - wxGridCellAttr& attr, - wxDC& dc, - int row, int col); - - virtual wxGridCellRenderer *Clone() const - { return new wxGridCellBoolRenderer; } - -private: - static wxSize ms_sizeCheckMark; -}; - -// ---------------------------------------------------------------------------- -// wxGridCellEditor: This class is responsible for providing and manipulating -// the in-place edit controls for the grid. Instances of wxGridCellEditor -// (actually, instances of derived classes since it is an ABC) can be -// associated with the cell attributes for individual cells, rows, columns, or -// even for the entire grid. -// ---------------------------------------------------------------------------- - -class WXDLLIMPEXP_ADV wxGridCellEditor : public wxGridCellWorker -{ -public: - wxGridCellEditor(); - - bool IsCreated() { return m_control != NULL; } - wxControl* GetControl() { return m_control; } - void SetControl(wxControl* control) { m_control = control; } - - wxGridCellAttr* GetCellAttr() { return m_attr; } - void SetCellAttr(wxGridCellAttr* attr) { m_attr = attr; } - - // Creates the actual edit control - virtual void Create(wxWindow* parent, - wxWindowID id, - wxEvtHandler* evtHandler) = 0; - - // Size and position the edit control - virtual void SetSize(const wxRect& rect); - - // Show or hide the edit control, use the specified attributes to set - // colours/fonts for it - virtual void Show(bool show, wxGridCellAttr *attr = (wxGridCellAttr *)NULL); - - // Draws the part of the cell not occupied by the control: the base class - // version just fills it with background colour from the attribute - virtual void PaintBackground(const wxRect& rectCell, wxGridCellAttr *attr); - - // Fetch the value from the table and prepare the edit control - // to begin editing. Set the focus to the edit control. - virtual void BeginEdit(int row, int col, wxGrid* grid) = 0; - - // Complete the editing of the current cell. Returns true if the value has - // changed. If necessary, the control may be destroyed. - virtual bool EndEdit(int row, int col, wxGrid* grid) = 0; - - // Reset the value in the control back to its starting value - virtual void Reset() = 0; - - // return true to allow the given key to start editing: the base class - // version only checks that the event has no modifiers. The derived - // classes are supposed to do "if ( base::IsAcceptedKey() && ... )" in - // their IsAcceptedKey() implementation, although, of course, it is not a - // mandatory requirment. - // - // NB: if the key is F2 (special), editing will always start and this - // method will not be called at all (but StartingKey() will) - virtual bool IsAcceptedKey(wxKeyEvent& event); - - // If the editor is enabled by pressing keys on the grid, this will be - // called to let the editor do something about that first key if desired - virtual void StartingKey(wxKeyEvent& event); - - // if the editor is enabled by clicking on the cell, this method will be - // called - virtual void StartingClick(); - - // Some types of controls on some platforms may need some help - // with the Return key. - virtual void HandleReturn(wxKeyEvent& event); - - // Final cleanup - virtual void Destroy(); - - // create a new object which is the copy of this one - virtual wxGridCellEditor *Clone() const = 0; - - // added GetValue so we can get the value which is in the control - virtual wxString GetValue() const = 0; - -protected: - // the dtor is private because only DecRef() can delete us - virtual ~wxGridCellEditor(); - - // the control we show on screen - wxControl* m_control; - - // a temporary pointer to the attribute being edited - wxGridCellAttr* m_attr; - - // if we change the colours/font of the control from the default ones, we - // must restore the default later and we save them here between calls to - // Show(true) and Show(false) - wxColour m_colFgOld, - m_colBgOld; - wxFont m_fontOld; - - // suppress the stupid gcc warning about the class having private dtor and - // no friends - friend class wxGridCellEditorDummyFriend; - - DECLARE_NO_COPY_CLASS(wxGridCellEditor) -}; - -#if wxUSE_TEXTCTRL - -// the editor for string/text data -class WXDLLIMPEXP_ADV wxGridCellTextEditor : public wxGridCellEditor -{ -public: - wxGridCellTextEditor(); - - virtual void Create(wxWindow* parent, - wxWindowID id, - wxEvtHandler* evtHandler); - virtual void SetSize(const wxRect& rect); - - virtual void PaintBackground(const wxRect& rectCell, wxGridCellAttr *attr); - - virtual bool IsAcceptedKey(wxKeyEvent& event); - virtual void BeginEdit(int row, int col, wxGrid* grid); - virtual bool EndEdit(int row, int col, wxGrid* grid); - - virtual void Reset(); - virtual void StartingKey(wxKeyEvent& event); - virtual void HandleReturn(wxKeyEvent& event); - - // parameters string format is "max_width" - virtual void SetParameters(const wxString& params); - - virtual wxGridCellEditor *Clone() const - { return new wxGridCellTextEditor; } - - // added GetValue so we can get the value which is in the control - virtual wxString GetValue() const; - -protected: - wxTextCtrl *Text() const { return (wxTextCtrl *)m_control; } - - // parts of our virtual functions reused by the derived classes - void DoBeginEdit(const wxString& startValue); - void DoReset(const wxString& startValue); - -private: - size_t m_maxChars; // max number of chars allowed - wxString m_startValue; - - DECLARE_NO_COPY_CLASS(wxGridCellTextEditor) -}; - -// the editor for numeric (long) data -class WXDLLIMPEXP_ADV wxGridCellNumberEditor : public wxGridCellTextEditor -{ -public: - // allows to specify the range - if min == max == -1, no range checking is - // done - wxGridCellNumberEditor(int min = -1, int max = -1); - - virtual void Create(wxWindow* parent, - wxWindowID id, - wxEvtHandler* evtHandler); - - virtual bool IsAcceptedKey(wxKeyEvent& event); - virtual void BeginEdit(int row, int col, wxGrid* grid); - virtual bool EndEdit(int row, int col, wxGrid* grid); - - virtual void Reset(); - virtual void StartingKey(wxKeyEvent& event); - - // parameters string format is "min,max" - virtual void SetParameters(const wxString& params); - - virtual wxGridCellEditor *Clone() const - { return new wxGridCellNumberEditor(m_min, m_max); } - - // added GetValue so we can get the value which is in the control - virtual wxString GetValue() const; - -protected: -#if wxUSE_SPINCTRL - wxSpinCtrl *Spin() const { return (wxSpinCtrl *)m_control; } -#endif - - // if HasRange(), we use wxSpinCtrl - otherwise wxTextCtrl - bool HasRange() const - { -#if wxUSE_SPINCTRL - return m_min != m_max; -#else - return false; -#endif - } - - // string representation of m_valueOld - wxString GetString() const - { return wxString::Format(wxT("%ld"), m_valueOld); } - -private: - int m_min, - m_max; - - long m_valueOld; - - DECLARE_NO_COPY_CLASS(wxGridCellNumberEditor) -}; - -// the editor for floating point numbers (double) data -class WXDLLIMPEXP_ADV wxGridCellFloatEditor : public wxGridCellTextEditor -{ -public: - wxGridCellFloatEditor(int width = -1, int precision = -1); - - virtual void Create(wxWindow* parent, - wxWindowID id, - wxEvtHandler* evtHandler); - - virtual bool IsAcceptedKey(wxKeyEvent& event); - virtual void BeginEdit(int row, int col, wxGrid* grid); - virtual bool EndEdit(int row, int col, wxGrid* grid); - - virtual void Reset(); - virtual void StartingKey(wxKeyEvent& event); - - virtual wxGridCellEditor *Clone() const - { return new wxGridCellFloatEditor(m_width, m_precision); } - - // parameters string format is "width,precision" - virtual void SetParameters(const wxString& params); - -protected: - // string representation of m_valueOld - wxString GetString() const; - -private: - int m_width, - m_precision; - double m_valueOld; - - DECLARE_NO_COPY_CLASS(wxGridCellFloatEditor) -}; - -#endif // wxUSE_TEXTCTRL - -#if wxUSE_CHECKBOX - -// the editor for boolean data -class WXDLLIMPEXP_ADV wxGridCellBoolEditor : public wxGridCellEditor -{ -public: - wxGridCellBoolEditor() { } - - virtual void Create(wxWindow* parent, - wxWindowID id, - wxEvtHandler* evtHandler); - - virtual void SetSize(const wxRect& rect); - virtual void Show(bool show, wxGridCellAttr *attr = NULL); - - virtual bool IsAcceptedKey(wxKeyEvent& event); - virtual void BeginEdit(int row, int col, wxGrid* grid); - virtual bool EndEdit(int row, int col, wxGrid* grid); - - virtual void Reset(); - virtual void StartingClick(); - virtual void StartingKey(wxKeyEvent& event); - - virtual wxGridCellEditor *Clone() const - { return new wxGridCellBoolEditor; } - - // added GetValue so we can get the value which is in the control, see - // also UseStringValues() - virtual wxString GetValue() const; - - // set the string values returned by GetValue() for the true and false - // states, respectively - static void UseStringValues(const wxString& valueTrue = wxT("1"), - const wxString& valueFalse = wxEmptyString); - - // return true if the given string is equal to the string representation of - // true value which we currently use - static bool IsTrueValue(const wxString& value); - -protected: - wxCheckBox *CBox() const { return (wxCheckBox *)m_control; } - -private: - bool m_startValue; - - static wxString ms_stringValues[2]; - - DECLARE_NO_COPY_CLASS(wxGridCellBoolEditor) -}; - -#endif // wxUSE_CHECKBOX - -#if wxUSE_COMBOBOX - -// the editor for string data allowing to choose from the list of strings -class WXDLLIMPEXP_ADV wxGridCellChoiceEditor : public wxGridCellEditor -{ -public: - // if !allowOthers, user can't type a string not in choices array - wxGridCellChoiceEditor(size_t count = 0, - const wxString choices[] = NULL, - bool allowOthers = false); - wxGridCellChoiceEditor(const wxArrayString& choices, - bool allowOthers = false); - - virtual void Create(wxWindow* parent, - wxWindowID id, - wxEvtHandler* evtHandler); - - virtual void PaintBackground(const wxRect& rectCell, wxGridCellAttr *attr); - - virtual void BeginEdit(int row, int col, wxGrid* grid); - virtual bool EndEdit(int row, int col, wxGrid* grid); - - virtual void Reset(); - - // parameters string format is "item1[,item2[...,itemN]]" - virtual void SetParameters(const wxString& params); - - virtual wxGridCellEditor *Clone() const; - - // added GetValue so we can get the value which is in the control - virtual wxString GetValue() const; - -protected: - wxComboBox *Combo() const { return (wxComboBox *)m_control; } - -// DJC - (MAPTEK) you at least need access to m_choices if you -// wish to override this class -protected: - wxString m_startValue; - wxArrayString m_choices; - bool m_allowOthers; - - DECLARE_NO_COPY_CLASS(wxGridCellChoiceEditor) -}; - -#endif // wxUSE_COMBOBOX - -// ---------------------------------------------------------------------------- -// wxGridCellAttr: this class can be used to alter the cells appearance in -// the grid by changing their colour/font/... from default. An object of this -// class may be returned by wxGridTable::GetAttr(). -// ---------------------------------------------------------------------------- - -class WXDLLIMPEXP_ADV wxGridCellAttr : public wxClientDataContainer -{ -public: - enum wxAttrKind - { - Any, - Default, - Cell, - Row, - Col, - Merged - }; - - // ctors - wxGridCellAttr(wxGridCellAttr *attrDefault = NULL) - { - Init(attrDefault); - - // MB: args used to be 0,0 here but wxALIGN_LEFT is 0 - SetAlignment(-1, -1); - } - - // VZ: considering the number of members wxGridCellAttr has now, this ctor - // seems to be pretty useless... may be we should just remove it? - wxGridCellAttr(const wxColour& colText, - const wxColour& colBack, - const wxFont& font, - int hAlign, - int vAlign) - : m_colText(colText), m_colBack(colBack), m_font(font) - { - Init(); - SetAlignment(hAlign, vAlign); - } - - // creates a new copy of this object - wxGridCellAttr *Clone() const; - void MergeWith(wxGridCellAttr *mergefrom); - - // this class is ref counted: it is created with ref count of 1, so - // calling DecRef() once will delete it. Calling IncRef() allows to lock - // it until the matching DecRef() is called - void IncRef() { m_nRef++; } - void DecRef() { if ( --m_nRef == 0 ) delete this; } - - // setters - void SetTextColour(const wxColour& colText) { m_colText = colText; } - void SetBackgroundColour(const wxColour& colBack) { m_colBack = colBack; } - void SetFont(const wxFont& font) { m_font = font; } - void SetAlignment(int hAlign, int vAlign) - { - m_hAlign = hAlign; - m_vAlign = vAlign; - } - void SetSize(int num_rows, int num_cols); - void SetOverflow(bool allow = true) - { m_overflow = allow ? Overflow : SingleCell; } - void SetReadOnly(bool isReadOnly = true) - { m_isReadOnly = isReadOnly ? ReadOnly : ReadWrite; } - - // takes ownership of the pointer - void SetRenderer(wxGridCellRenderer *renderer) - { wxSafeDecRef(m_renderer); m_renderer = renderer; } - void SetEditor(wxGridCellEditor* editor) - { wxSafeDecRef(m_editor); m_editor = editor; } - - void SetKind(wxAttrKind kind) { m_attrkind = kind; } - - // accessors - bool HasTextColour() const { return m_colText.Ok(); } - bool HasBackgroundColour() const { return m_colBack.Ok(); } - bool HasFont() const { return m_font.Ok(); } - bool HasAlignment() const { return (m_hAlign != -1 || m_vAlign != -1); } - bool HasRenderer() const { return m_renderer != NULL; } - bool HasEditor() const { return m_editor != NULL; } - bool HasReadWriteMode() const { return m_isReadOnly != Unset; } - bool HasOverflowMode() const { return m_overflow != UnsetOverflow; } - bool HasSize() const { return m_sizeRows != 1 || m_sizeCols != 1; } - - const wxColour& GetTextColour() const; - const wxColour& GetBackgroundColour() const; - const wxFont& GetFont() const; - void GetAlignment(int *hAlign, int *vAlign) const; - void GetSize(int *num_rows, int *num_cols) const; - bool GetOverflow() const - { return m_overflow != SingleCell; } - wxGridCellRenderer *GetRenderer(wxGrid* grid, int row, int col) const; - wxGridCellEditor *GetEditor(wxGrid* grid, int row, int col) const; - - bool IsReadOnly() const { return m_isReadOnly == wxGridCellAttr::ReadOnly; } - - wxAttrKind GetKind() { return m_attrkind; } - - void SetDefAttr(wxGridCellAttr* defAttr) { m_defGridAttr = defAttr; } - -protected: - // the dtor is private because only DecRef() can delete us - virtual ~wxGridCellAttr() - { - wxSafeDecRef(m_renderer); - wxSafeDecRef(m_editor); - } - -private: - enum wxAttrReadMode - { - Unset = -1, - ReadWrite, - ReadOnly - }; - - enum wxAttrOverflowMode - { - UnsetOverflow = -1, - Overflow, - SingleCell - }; - - // the common part of all ctors - void Init(wxGridCellAttr *attrDefault = NULL); - - - // the ref count - when it goes to 0, we die - size_t m_nRef; - - wxColour m_colText, - m_colBack; - wxFont m_font; - int m_hAlign, - m_vAlign; - int m_sizeRows, - m_sizeCols; - - wxAttrOverflowMode m_overflow; - - wxGridCellRenderer* m_renderer; - wxGridCellEditor* m_editor; - wxGridCellAttr* m_defGridAttr; - - wxAttrReadMode m_isReadOnly; - - wxAttrKind m_attrkind; - - // use Clone() instead - DECLARE_NO_COPY_CLASS(wxGridCellAttr) - - // suppress the stupid gcc warning about the class having private dtor and - // no friends - friend class wxGridCellAttrDummyFriend; -}; - -// ---------------------------------------------------------------------------- -// wxGridCellAttrProvider: class used by wxGridTableBase to retrieve/store the -// cell attributes. -// ---------------------------------------------------------------------------- - -// implementation note: we separate it from wxGridTableBase because we wish to -// avoid deriving a new table class if possible, and sometimes it will be -// enough to just derive another wxGridCellAttrProvider instead -// -// the default implementation is reasonably efficient for the generic case, -// but you might still wish to implement your own for some specific situations -// if you have performance problems with the stock one -class WXDLLIMPEXP_ADV wxGridCellAttrProvider : public wxClientDataContainer -{ -public: - wxGridCellAttrProvider(); - virtual ~wxGridCellAttrProvider(); - - // DecRef() must be called on the returned pointer - virtual wxGridCellAttr *GetAttr(int row, int col, - wxGridCellAttr::wxAttrKind kind ) const; - - // all these functions take ownership of the pointer, don't call DecRef() - // on it - virtual void SetAttr(wxGridCellAttr *attr, int row, int col); - virtual void SetRowAttr(wxGridCellAttr *attr, int row); - virtual void SetColAttr(wxGridCellAttr *attr, int col); - - // these functions must be called whenever some rows/cols are deleted - // because the internal data must be updated then - void UpdateAttrRows( size_t pos, int numRows ); - void UpdateAttrCols( size_t pos, int numCols ); - -private: - void InitData(); - - wxGridCellAttrProviderData *m_data; - - DECLARE_NO_COPY_CLASS(wxGridCellAttrProvider) -}; - -////////////////////////////////////////////////////////////////////// -// -// Grid table classes -// -////////////////////////////////////////////////////////////////////// - - -class WXDLLIMPEXP_ADV wxGridTableBase : public wxObject, public wxClientDataContainer -{ -public: - wxGridTableBase(); - virtual ~wxGridTableBase(); - - // You must override these functions in a derived table class - // - virtual int GetNumberRows() = 0; - virtual int GetNumberCols() = 0; - virtual bool IsEmptyCell( int row, int col ) = 0; - virtual wxString GetValue( int row, int col ) = 0; - virtual void SetValue( int row, int col, const wxString& value ) = 0; - - // Data type determination and value access - virtual wxString GetTypeName( int row, int col ); - virtual bool CanGetValueAs( int row, int col, const wxString& typeName ); - virtual bool CanSetValueAs( int row, int col, const wxString& typeName ); - - virtual long GetValueAsLong( int row, int col ); - virtual double GetValueAsDouble( int row, int col ); - virtual bool GetValueAsBool( int row, int col ); - - virtual void SetValueAsLong( int row, int col, long value ); - virtual void SetValueAsDouble( int row, int col, double value ); - virtual void SetValueAsBool( int row, int col, bool value ); - - // For user defined types - virtual void* GetValueAsCustom( int row, int col, const wxString& typeName ); - virtual void SetValueAsCustom( int row, int col, const wxString& typeName, void* value ); - - - // Overriding these is optional - // - virtual void SetView( wxGrid *grid ) { m_view = grid; } - virtual wxGrid * GetView() const { return m_view; } - - virtual void Clear() {} - virtual bool InsertRows( size_t pos = 0, size_t numRows = 1 ); - virtual bool AppendRows( size_t numRows = 1 ); - virtual bool DeleteRows( size_t pos = 0, size_t numRows = 1 ); - virtual bool InsertCols( size_t pos = 0, size_t numCols = 1 ); - virtual bool AppendCols( size_t numCols = 1 ); - virtual bool DeleteCols( size_t pos = 0, size_t numCols = 1 ); - - virtual wxString GetRowLabelValue( int row ); - virtual wxString GetColLabelValue( int col ); - virtual void SetRowLabelValue( int WXUNUSED(row), const wxString& ) {} - virtual void SetColLabelValue( int WXUNUSED(col), const wxString& ) {} - - // Attribute handling - // - - // give us the attr provider to use - we take ownership of the pointer - void SetAttrProvider(wxGridCellAttrProvider *attrProvider); - - // get the currently used attr provider (may be NULL) - wxGridCellAttrProvider *GetAttrProvider() const { return m_attrProvider; } - - // Does this table allow attributes? Default implementation creates - // a wxGridCellAttrProvider if necessary. - virtual bool CanHaveAttributes(); - - // by default forwarded to wxGridCellAttrProvider if any. May be - // overridden to handle attributes directly in the table. - virtual wxGridCellAttr *GetAttr( int row, int col, - wxGridCellAttr::wxAttrKind kind ); - - - // these functions take ownership of the pointer - virtual void SetAttr(wxGridCellAttr* attr, int row, int col); - virtual void SetRowAttr(wxGridCellAttr *attr, int row); - virtual void SetColAttr(wxGridCellAttr *attr, int col); - -private: - wxGrid * m_view; - wxGridCellAttrProvider *m_attrProvider; - - DECLARE_ABSTRACT_CLASS(wxGridTableBase) - DECLARE_NO_COPY_CLASS(wxGridTableBase) -}; - - -// ---------------------------------------------------------------------------- -// wxGridTableMessage -// ---------------------------------------------------------------------------- - -// IDs for messages sent from grid table to view -// -enum wxGridTableRequest -{ - wxGRIDTABLE_REQUEST_VIEW_GET_VALUES = 2000, - wxGRIDTABLE_REQUEST_VIEW_SEND_VALUES, - wxGRIDTABLE_NOTIFY_ROWS_INSERTED, - wxGRIDTABLE_NOTIFY_ROWS_APPENDED, - wxGRIDTABLE_NOTIFY_ROWS_DELETED, - wxGRIDTABLE_NOTIFY_COLS_INSERTED, - wxGRIDTABLE_NOTIFY_COLS_APPENDED, - wxGRIDTABLE_NOTIFY_COLS_DELETED -}; - -class WXDLLIMPEXP_ADV wxGridTableMessage -{ -public: - wxGridTableMessage(); - wxGridTableMessage( wxGridTableBase *table, int id, - int comInt1 = -1, - int comInt2 = -1 ); - - void SetTableObject( wxGridTableBase *table ) { m_table = table; } - wxGridTableBase * GetTableObject() const { return m_table; } - void SetId( int id ) { m_id = id; } - int GetId() { return m_id; } - void SetCommandInt( int comInt1 ) { m_comInt1 = comInt1; } - int GetCommandInt() { return m_comInt1; } - void SetCommandInt2( int comInt2 ) { m_comInt2 = comInt2; } - int GetCommandInt2() { return m_comInt2; } - -private: - wxGridTableBase *m_table; - int m_id; - int m_comInt1; - int m_comInt2; - - DECLARE_NO_COPY_CLASS(wxGridTableMessage) -}; - - - -// ------ wxGridStringArray -// A 2-dimensional array of strings for data values -// - -WX_DECLARE_OBJARRAY_WITH_DECL(wxArrayString, wxGridStringArray, - class WXDLLIMPEXP_ADV); - - - -// ------ wxGridStringTable -// -// Simplest type of data table for a grid for small tables of strings -// that are stored in memory -// - -class WXDLLIMPEXP_ADV wxGridStringTable : public wxGridTableBase -{ -public: - wxGridStringTable(); - wxGridStringTable( int numRows, int numCols ); - virtual ~wxGridStringTable(); - - // these are pure virtual in wxGridTableBase - // - int GetNumberRows(); - int GetNumberCols(); - wxString GetValue( int row, int col ); - void SetValue( int row, int col, const wxString& s ); - bool IsEmptyCell( int row, int col ); - - // overridden functions from wxGridTableBase - // - void Clear(); - bool InsertRows( size_t pos = 0, size_t numRows = 1 ); - bool AppendRows( size_t numRows = 1 ); - bool DeleteRows( size_t pos = 0, size_t numRows = 1 ); - bool InsertCols( size_t pos = 0, size_t numCols = 1 ); - bool AppendCols( size_t numCols = 1 ); - bool DeleteCols( size_t pos = 0, size_t numCols = 1 ); - - void SetRowLabelValue( int row, const wxString& ); - void SetColLabelValue( int col, const wxString& ); - wxString GetRowLabelValue( int row ); - wxString GetColLabelValue( int col ); - -private: - wxGridStringArray m_data; - - // These only get used if you set your own labels, otherwise the - // GetRow/ColLabelValue functions return wxGridTableBase defaults - // - wxArrayString m_rowLabels; - wxArrayString m_colLabels; - - DECLARE_DYNAMIC_CLASS_NO_COPY( wxGridStringTable ) -}; - - - -// ============================================================================ -// Grid view classes -// ============================================================================ - -// ---------------------------------------------------------------------------- -// wxGridCellCoords: location of a cell in the grid -// ---------------------------------------------------------------------------- - -class WXDLLIMPEXP_ADV wxGridCellCoords -{ -public: - wxGridCellCoords() { m_row = m_col = -1; } - wxGridCellCoords( int r, int c ) { m_row = r; m_col = c; } - - // default copy ctor is ok - - int GetRow() const { return m_row; } - void SetRow( int n ) { m_row = n; } - int GetCol() const { return m_col; } - void SetCol( int n ) { m_col = n; } - void Set( int row, int col ) { m_row = row; m_col = col; } - - wxGridCellCoords& operator=( const wxGridCellCoords& other ) - { - if ( &other != this ) - { - m_row=other.m_row; - m_col=other.m_col; - } - return *this; - } - - bool operator==( const wxGridCellCoords& other ) const - { - return (m_row == other.m_row && m_col == other.m_col); - } - - bool operator!=( const wxGridCellCoords& other ) const - { - return (m_row != other.m_row || m_col != other.m_col); - } - - bool operator!() const - { - return (m_row == -1 && m_col == -1 ); - } - -private: - int m_row; - int m_col; -}; - - -// For comparisons... -// -extern WXDLLIMPEXP_ADV wxGridCellCoords wxGridNoCellCoords; -extern WXDLLIMPEXP_ADV wxRect wxGridNoCellRect; - -// An array of cell coords... -// -WX_DECLARE_OBJARRAY_WITH_DECL(wxGridCellCoords, wxGridCellCoordsArray, - class WXDLLIMPEXP_ADV); - -// ---------------------------------------------------------------------------- -// wxGrid -// ---------------------------------------------------------------------------- - -class WXDLLIMPEXP_ADV wxGrid : public wxScrolledWindow -{ -public: - wxGrid() ; - - wxGrid( wxWindow *parent, - wxWindowID id, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = wxWANTS_CHARS, - const wxString& name = wxGridNameStr ); - - bool Create( wxWindow *parent, - wxWindowID id, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = wxWANTS_CHARS, - const wxString& name = wxGridNameStr ); - - virtual ~wxGrid(); - - enum wxGridSelectionModes {wxGridSelectCells, - wxGridSelectRows, - wxGridSelectColumns}; - - bool CreateGrid( int numRows, int numCols, - wxGrid::wxGridSelectionModes selmode = - wxGrid::wxGridSelectCells ); - - void SetSelectionMode(wxGrid::wxGridSelectionModes selmode); - wxGrid::wxGridSelectionModes GetSelectionMode() const; - - // ------ grid dimensions - // - int GetNumberRows() { return m_numRows; } - int GetNumberCols() { return m_numCols; } - - - // ------ display update functions - // - wxArrayInt CalcRowLabelsExposed( const wxRegion& reg ); - - wxArrayInt CalcColLabelsExposed( const wxRegion& reg ); - wxGridCellCoordsArray CalcCellsExposed( const wxRegion& reg ); - - - // ------ event handlers - // - void ProcessRowLabelMouseEvent( wxMouseEvent& event ); - void ProcessColLabelMouseEvent( wxMouseEvent& event ); - void ProcessCornerLabelMouseEvent( wxMouseEvent& event ); - void ProcessGridCellMouseEvent( wxMouseEvent& event ); - bool ProcessTableMessage( wxGridTableMessage& ); - - void DoEndDragResizeRow(); - void DoEndDragResizeCol(); - void DoEndDragMoveCol(); - - wxGridTableBase * GetTable() const { return m_table; } - bool SetTable( wxGridTableBase *table, bool takeOwnership = false, - wxGrid::wxGridSelectionModes selmode = - wxGrid::wxGridSelectCells ); - - void ClearGrid(); - bool InsertRows( int pos = 0, int numRows = 1, bool updateLabels = true ); - bool AppendRows( int numRows = 1, bool updateLabels = true ); - bool DeleteRows( int pos = 0, int numRows = 1, bool updateLabels = true ); - bool InsertCols( int pos = 0, int numCols = 1, bool updateLabels = true ); - bool AppendCols( int numCols = 1, bool updateLabels = true ); - bool DeleteCols( int pos = 0, int numCols = 1, bool updateLabels = true ); - - void DrawGridCellArea( wxDC& dc , const wxGridCellCoordsArray& cells ); - void DrawGridSpace( wxDC& dc ); - void DrawCellBorder( wxDC& dc, const wxGridCellCoords& ); - void DrawAllGridLines( wxDC& dc, const wxRegion & reg ); - void DrawCell( wxDC& dc, const wxGridCellCoords& ); - void DrawHighlight(wxDC& dc, const wxGridCellCoordsArray& cells); - - // this function is called when the current cell highlight must be redrawn - // and may be overridden by the user - virtual void DrawCellHighlight( wxDC& dc, const wxGridCellAttr *attr ); - - virtual void DrawRowLabels( wxDC& dc, const wxArrayInt& rows ); - virtual void DrawRowLabel( wxDC& dc, int row ); - - virtual void DrawColLabels( wxDC& dc, const wxArrayInt& cols ); - virtual void DrawColLabel( wxDC& dc, int col ); - - - // ------ Cell text drawing functions - // - void DrawTextRectangle( wxDC& dc, const wxString&, const wxRect&, - int horizontalAlignment = wxALIGN_LEFT, - int verticalAlignment = wxALIGN_TOP, - int textOrientation = wxHORIZONTAL ); - - void DrawTextRectangle( wxDC& dc, const wxArrayString& lines, const wxRect&, - int horizontalAlignment = wxALIGN_LEFT, - int verticalAlignment = wxALIGN_TOP, - int textOrientation = wxHORIZONTAL ); - - - // Split a string containing newline chararcters into an array of - // strings and return the number of lines - // - void StringToLines( const wxString& value, wxArrayString& lines ); - - void GetTextBoxSize( const wxDC& dc, - const wxArrayString& lines, - long *width, long *height ); - - - // ------ - // Code that does a lot of grid modification can be enclosed - // between BeginBatch() and EndBatch() calls to avoid screen - // flicker - // - void BeginBatch() { m_batchCount++; } - void EndBatch(); - - int GetBatchCount() { return m_batchCount; } - - virtual void Refresh(bool eraseb = true, - const wxRect* rect = (const wxRect *) NULL); - - // Use this, rather than wxWindow::Refresh(), to force an - // immediate repainting of the grid. Has no effect if you are - // already inside a BeginBatch / EndBatch block. - // - // This function is necessary because wxGrid has a minimal OnPaint() - // handler to reduce screen flicker. - // - void ForceRefresh(); - - - // ------ edit control functions - // - bool IsEditable() const { return m_editable; } - void EnableEditing( bool edit ); - - void EnableCellEditControl( bool enable = true ); - void DisableCellEditControl() { EnableCellEditControl(false); } - bool CanEnableCellControl() const; - bool IsCellEditControlEnabled() const; - bool IsCellEditControlShown() const; - - bool IsCurrentCellReadOnly() const; - - void ShowCellEditControl(); - void HideCellEditControl(); - void SaveEditControlValue(); - - - // ------ grid location functions - // Note that all of these functions work with the logical coordinates of - // grid cells and labels so you will need to convert from device - // coordinates for mouse events etc. - // - void XYToCell( int x, int y, wxGridCellCoords& ); - int YToRow( int y ); - int XToCol( int x, bool clipToMinMax = false ); - - int YToEdgeOfRow( int y ); - int XToEdgeOfCol( int x ); - - wxRect CellToRect( int row, int col ); - wxRect CellToRect( const wxGridCellCoords& coords ) - { return CellToRect( coords.GetRow(), coords.GetCol() ); } - - int GetGridCursorRow() { return m_currentCellCoords.GetRow(); } - int GetGridCursorCol() { return m_currentCellCoords.GetCol(); } - - // check to see if a cell is either wholly visible (the default arg) or - // at least partially visible in the grid window - // - bool IsVisible( int row, int col, bool wholeCellVisible = true ); - bool IsVisible( const wxGridCellCoords& coords, bool wholeCellVisible = true ) - { return IsVisible( coords.GetRow(), coords.GetCol(), wholeCellVisible ); } - void MakeCellVisible( int row, int col ); - void MakeCellVisible( const wxGridCellCoords& coords ) - { MakeCellVisible( coords.GetRow(), coords.GetCol() ); } - - - // ------ grid cursor movement functions - // - void SetGridCursor( int row, int col ) - { SetCurrentCell( wxGridCellCoords(row, col) ); } - - bool MoveCursorUp( bool expandSelection ); - bool MoveCursorDown( bool expandSelection ); - bool MoveCursorLeft( bool expandSelection ); - bool MoveCursorRight( bool expandSelection ); - bool MovePageDown(); - bool MovePageUp(); - bool MoveCursorUpBlock( bool expandSelection ); - bool MoveCursorDownBlock( bool expandSelection ); - bool MoveCursorLeftBlock( bool expandSelection ); - bool MoveCursorRightBlock( bool expandSelection ); - - - // ------ label and gridline formatting - // - int GetDefaultRowLabelSize() { return WXGRID_DEFAULT_ROW_LABEL_WIDTH; } - int GetRowLabelSize() { return m_rowLabelWidth; } - int GetDefaultColLabelSize() { return WXGRID_DEFAULT_COL_LABEL_HEIGHT; } - int GetColLabelSize() { return m_colLabelHeight; } - wxColour GetLabelBackgroundColour() { return m_labelBackgroundColour; } - wxColour GetLabelTextColour() { return m_labelTextColour; } - wxFont GetLabelFont() { return m_labelFont; } - void GetRowLabelAlignment( int *horiz, int *vert ); - void GetColLabelAlignment( int *horiz, int *vert ); - int GetColLabelTextOrientation(); - wxString GetRowLabelValue( int row ); - wxString GetColLabelValue( int col ); - wxColour GetGridLineColour() { return m_gridLineColour; } - - // these methods may be overridden to customize individual grid lines - // appearance - virtual wxPen GetDefaultGridLinePen(); - virtual wxPen GetRowGridLinePen(int row); - virtual wxPen GetColGridLinePen(int col); - wxColour GetCellHighlightColour() { return m_cellHighlightColour; } - int GetCellHighlightPenWidth() { return m_cellHighlightPenWidth; } - int GetCellHighlightROPenWidth() { return m_cellHighlightROPenWidth; } - - void SetRowLabelSize( int width ); - void SetColLabelSize( int height ); - void SetLabelBackgroundColour( const wxColour& ); - void SetLabelTextColour( const wxColour& ); - void SetLabelFont( const wxFont& ); - void SetRowLabelAlignment( int horiz, int vert ); - void SetColLabelAlignment( int horiz, int vert ); - void SetColLabelTextOrientation( int textOrientation ); - void SetRowLabelValue( int row, const wxString& ); - void SetColLabelValue( int col, const wxString& ); - void SetGridLineColour( const wxColour& ); - void SetCellHighlightColour( const wxColour& ); - void SetCellHighlightPenWidth(int width); - void SetCellHighlightROPenWidth(int width); - - void EnableDragRowSize( bool enable = true ); - void DisableDragRowSize() { EnableDragRowSize( false ); } - bool CanDragRowSize() { return m_canDragRowSize; } - void EnableDragColSize( bool enable = true ); - void DisableDragColSize() { EnableDragColSize( false ); } - bool CanDragColSize() { return m_canDragColSize; } - void EnableDragColMove( bool enable = true ); - void DisableDragColMove() { EnableDragColMove( false ); } - bool CanDragColMove() { return m_canDragColMove; } - void EnableDragGridSize(bool enable = true); - void DisableDragGridSize() { EnableDragGridSize(false); } - bool CanDragGridSize() { return m_canDragGridSize; } - - void EnableDragCell( bool enable = true ); - void DisableDragCell() { EnableDragCell( false ); } - bool CanDragCell() { return m_canDragCell; } - - // this sets the specified attribute for this cell or in this row/col - void SetAttr(int row, int col, wxGridCellAttr *attr); - void SetRowAttr(int row, wxGridCellAttr *attr); - void SetColAttr(int col, wxGridCellAttr *attr); - - // returns the attribute we may modify in place: a new one if this cell - // doesn't have any yet or the existing one if it does - // - // DecRef() must be called on the returned pointer, as usual - wxGridCellAttr *GetOrCreateCellAttr(int row, int col) const; - - - // shortcuts for setting the column parameters - - // set the format for the data in the column: default is string - void SetColFormatBool(int col); - void SetColFormatNumber(int col); - void SetColFormatFloat(int col, int width = -1, int precision = -1); - void SetColFormatCustom(int col, const wxString& typeName); - - void EnableGridLines( bool enable = true ); - bool GridLinesEnabled() { return m_gridLinesEnabled; } - - // ------ row and col formatting - // - int GetDefaultRowSize(); - int GetRowSize( int row ); - int GetDefaultColSize(); - int GetColSize( int col ); - wxColour GetDefaultCellBackgroundColour(); - wxColour GetCellBackgroundColour( int row, int col ); - wxColour GetDefaultCellTextColour(); - wxColour GetCellTextColour( int row, int col ); - wxFont GetDefaultCellFont(); - wxFont GetCellFont( int row, int col ); - void GetDefaultCellAlignment( int *horiz, int *vert ); - void GetCellAlignment( int row, int col, int *horiz, int *vert ); - bool GetDefaultCellOverflow(); - bool GetCellOverflow( int row, int col ); - void GetCellSize( int row, int col, int *num_rows, int *num_cols ); - - void SetDefaultRowSize( int height, bool resizeExistingRows = false ); - void SetRowSize( int row, int height ); - void SetDefaultColSize( int width, bool resizeExistingCols = false ); - - void SetColSize( int col, int width ); - - //Column positions - int GetColAt( int colPos ) const - { - if ( m_colAt.IsEmpty() ) - return colPos; - else - return m_colAt[colPos]; - } - - void SetColPos( int colID, int newPos ); - - int GetColPos( int colID ) const - { - if ( m_colAt.IsEmpty() ) - return colID; - else - { - for ( int i = 0; i < m_numCols; i++ ) - { - if ( m_colAt[i] == colID ) - return i; - } - } - - return -1; - } - - // automatically size the column or row to fit to its contents, if - // setAsMin is true, this optimal width will also be set as minimal width - // for this column - void AutoSizeColumn( int col, bool setAsMin = true ) - { AutoSizeColOrRow(col, setAsMin, true); } - void AutoSizeRow( int row, bool setAsMin = true ) - { AutoSizeColOrRow(row, setAsMin, false); } - - // auto size all columns (very ineffective for big grids!) - void AutoSizeColumns( bool setAsMin = true ) - { (void)SetOrCalcColumnSizes(false, setAsMin); } - - void AutoSizeRows( bool setAsMin = true ) - { (void)SetOrCalcRowSizes(false, setAsMin); } - - // auto size the grid, that is make the columns/rows of the "right" size - // and also set the grid size to just fit its contents - void AutoSize(); - - // autosize row height depending on label text - void AutoSizeRowLabelSize( int row ); - - // autosize column width depending on label text - void AutoSizeColLabelSize( int col ); - - // column won't be resized to be lesser width - this must be called during - // the grid creation because it won't resize the column if it's already - // narrower than the minimal width - void SetColMinimalWidth( int col, int width ); - void SetRowMinimalHeight( int row, int width ); - - /* These members can be used to query and modify the minimal - * acceptable size of grid rows and columns. Call this function in - * your code which creates the grid if you want to display cells - * with a size smaller than the default acceptable minimum size. - * Like the members SetColMinimalWidth and SetRowMinimalWidth, - * the existing rows or columns will not be checked/resized. - */ - void SetColMinimalAcceptableWidth( int width ); - void SetRowMinimalAcceptableHeight( int width ); - int GetColMinimalAcceptableWidth() const; - int GetRowMinimalAcceptableHeight() const; - - void SetDefaultCellBackgroundColour( const wxColour& ); - void SetCellBackgroundColour( int row, int col, const wxColour& ); - void SetDefaultCellTextColour( const wxColour& ); - - void SetCellTextColour( int row, int col, const wxColour& ); - void SetDefaultCellFont( const wxFont& ); - void SetCellFont( int row, int col, const wxFont& ); - void SetDefaultCellAlignment( int horiz, int vert ); - void SetCellAlignment( int row, int col, int horiz, int vert ); - void SetDefaultCellOverflow( bool allow ); - void SetCellOverflow( int row, int col, bool allow ); - void SetCellSize( int row, int col, int num_rows, int num_cols ); - - // takes ownership of the pointer - void SetDefaultRenderer(wxGridCellRenderer *renderer); - void SetCellRenderer(int row, int col, wxGridCellRenderer *renderer); - wxGridCellRenderer *GetDefaultRenderer() const; - wxGridCellRenderer* GetCellRenderer(int row, int col); - - // takes ownership of the pointer - void SetDefaultEditor(wxGridCellEditor *editor); - void SetCellEditor(int row, int col, wxGridCellEditor *editor); - wxGridCellEditor *GetDefaultEditor() const; - wxGridCellEditor* GetCellEditor(int row, int col); - - - - // ------ cell value accessors - // - wxString GetCellValue( int row, int col ) - { - if ( m_table ) - { - return m_table->GetValue( row, col ); - } - else - { - return wxEmptyString; - } - } - - wxString GetCellValue( const wxGridCellCoords& coords ) - { return GetCellValue( coords.GetRow(), coords.GetCol() ); } - - void SetCellValue( int row, int col, const wxString& s ); - void SetCellValue( const wxGridCellCoords& coords, const wxString& s ) - { SetCellValue( coords.GetRow(), coords.GetCol(), s ); } - - // returns true if the cell can't be edited - bool IsReadOnly(int row, int col) const; - - // make the cell editable/readonly - void SetReadOnly(int row, int col, bool isReadOnly = true); - - // ------ select blocks of cells - // - void SelectRow( int row, bool addToSelected = false ); - void SelectCol( int col, bool addToSelected = false ); - - void SelectBlock( int topRow, int leftCol, int bottomRow, int rightCol, - bool addToSelected = false ); - - void SelectBlock( const wxGridCellCoords& topLeft, - const wxGridCellCoords& bottomRight, - bool addToSelected = false ) - { SelectBlock( topLeft.GetRow(), topLeft.GetCol(), - bottomRight.GetRow(), bottomRight.GetCol(), - addToSelected ); } - - void SelectAll(); - - bool IsSelection(); - - // ------ deselect blocks or cells - // - void DeselectRow( int row ); - void DeselectCol( int col ); - void DeselectCell( int row, int col ); - - void ClearSelection(); - - bool IsInSelection( int row, int col ) const; - - bool IsInSelection( const wxGridCellCoords& coords ) const - { return IsInSelection( coords.GetRow(), coords.GetCol() ); } - - wxGridCellCoordsArray GetSelectedCells() const; - wxGridCellCoordsArray GetSelectionBlockTopLeft() const; - wxGridCellCoordsArray GetSelectionBlockBottomRight() const; - wxArrayInt GetSelectedRows() const; - wxArrayInt GetSelectedCols() const; - - // This function returns the rectangle that encloses the block of cells - // limited by TopLeft and BottomRight cell in device coords and clipped - // to the client size of the grid window. - // - wxRect BlockToDeviceRect( const wxGridCellCoords & topLeft, - const wxGridCellCoords & bottomRight ); - - // Access or update the selection fore/back colours - wxColour GetSelectionBackground() const - { return m_selectionBackground; } - wxColour GetSelectionForeground() const - { return m_selectionForeground; } - - void SetSelectionBackground(const wxColour& c) { m_selectionBackground = c; } - void SetSelectionForeground(const wxColour& c) { m_selectionForeground = c; } - - - // Methods for a registry for mapping data types to Renderers/Editors - void RegisterDataType(const wxString& typeName, - wxGridCellRenderer* renderer, - wxGridCellEditor* editor); - // DJC MAPTEK - virtual wxGridCellEditor* GetDefaultEditorForCell(int row, int col) const; - wxGridCellEditor* GetDefaultEditorForCell(const wxGridCellCoords& c) const - { return GetDefaultEditorForCell(c.GetRow(), c.GetCol()); } - virtual wxGridCellRenderer* GetDefaultRendererForCell(int row, int col) const; - virtual wxGridCellEditor* GetDefaultEditorForType(const wxString& typeName) const; - virtual wxGridCellRenderer* GetDefaultRendererForType(const wxString& typeName) const; - - // grid may occupy more space than needed for its rows/columns, this - // function allows to set how big this extra space is - void SetMargins(int extraWidth, int extraHeight) - { - m_extraWidth = extraWidth; - m_extraHeight = extraHeight; - - CalcDimensions(); - } - - // Accessors for component windows - wxWindow* GetGridWindow() { return (wxWindow*)m_gridWin; } - wxWindow* GetGridRowLabelWindow() { return (wxWindow*)m_rowLabelWin; } - wxWindow* GetGridColLabelWindow() { return (wxWindow*)m_colLabelWin; } - wxWindow* GetGridCornerLabelWindow() { return (wxWindow*)m_cornerLabelWin; } - - // Allow adjustment of scroll increment. The default is (15, 15). - void SetScrollLineX(int x) { m_scrollLineX = x; } - void SetScrollLineY(int y) { m_scrollLineY = y; } - int GetScrollLineX() const { return m_scrollLineX; } - int GetScrollLineY() const { return m_scrollLineY; } - - // Implementation - int GetScrollX(int x) const - { - return (x + GetScrollLineX() - 1) / GetScrollLineX(); - } - - int GetScrollY(int y) const - { - return (y + GetScrollLineY() - 1) / GetScrollLineY(); - } - - - // override some base class functions - virtual bool Enable(bool enable = true); - - - // ------ For compatibility with previous wxGrid only... - // - // ************************************************ - // ** Don't use these in new code because they ** - // ** are liable to disappear in a future ** - // ** revision ** - // ************************************************ - // - - wxGrid( wxWindow *parent, - int x, int y, int w = wxDefaultCoord, int h = wxDefaultCoord, - long style = wxWANTS_CHARS, - const wxString& name = wxPanelNameStr ) - : wxScrolledWindow( parent, wxID_ANY, wxPoint(x,y), wxSize(w,h), - (style|wxWANTS_CHARS), name ) - { - Create(); - } - - void SetCellValue( const wxString& val, int row, int col ) - { SetCellValue( row, col, val ); } - - void UpdateDimensions() - { CalcDimensions(); } - - int GetRows() { return GetNumberRows(); } - int GetCols() { return GetNumberCols(); } - int GetCursorRow() { return GetGridCursorRow(); } - int GetCursorColumn() { return GetGridCursorCol(); } - - int GetScrollPosX() { return 0; } - int GetScrollPosY() { return 0; } - - void SetScrollX( int WXUNUSED(x) ) { } - void SetScrollY( int WXUNUSED(y) ) { } - - void SetColumnWidth( int col, int width ) - { SetColSize( col, width ); } - - int GetColumnWidth( int col ) - { return GetColSize( col ); } - - void SetRowHeight( int row, int height ) - { SetRowSize( row, height ); } - - // GetRowHeight() is below - - int GetViewHeight() // returned num whole rows visible - { return 0; } - - int GetViewWidth() // returned num whole cols visible - { return 0; } - - void SetLabelSize( int orientation, int sz ) - { - if ( orientation == wxHORIZONTAL ) - SetColLabelSize( sz ); - else - SetRowLabelSize( sz ); - } - - int GetLabelSize( int orientation ) - { - if ( orientation == wxHORIZONTAL ) - return GetColLabelSize(); - else - return GetRowLabelSize(); - } - - void SetLabelAlignment( int orientation, int align ) - { - if ( orientation == wxHORIZONTAL ) - SetColLabelAlignment( align, -1 ); - else - SetRowLabelAlignment( align, -1 ); - } - - int GetLabelAlignment( int orientation, int WXUNUSED(align) ) - { - int h, v; - if ( orientation == wxHORIZONTAL ) - { - GetColLabelAlignment( &h, &v ); - return h; - } - else - { - GetRowLabelAlignment( &h, &v ); - return h; - } - } - - void SetLabelValue( int orientation, const wxString& val, int pos ) - { - if ( orientation == wxHORIZONTAL ) - SetColLabelValue( pos, val ); - else - SetRowLabelValue( pos, val ); - } - - wxString GetLabelValue( int orientation, int pos) - { - if ( orientation == wxHORIZONTAL ) - return GetColLabelValue( pos ); - else - return GetRowLabelValue( pos ); - } - - wxFont GetCellTextFont() const - { return m_defaultCellAttr->GetFont(); } - - wxFont GetCellTextFont(int WXUNUSED(row), int WXUNUSED(col)) const - { return m_defaultCellAttr->GetFont(); } - - void SetCellTextFont(const wxFont& fnt) - { SetDefaultCellFont( fnt ); } - - void SetCellTextFont(const wxFont& fnt, int row, int col) - { SetCellFont( row, col, fnt ); } - - void SetCellTextColour(const wxColour& val, int row, int col) - { SetCellTextColour( row, col, val ); } - - void SetCellTextColour(const wxColour& col) - { SetDefaultCellTextColour( col ); } - - void SetCellBackgroundColour(const wxColour& col) - { SetDefaultCellBackgroundColour( col ); } - - void SetCellBackgroundColour(const wxColour& colour, int row, int col) - { SetCellBackgroundColour( row, col, colour ); } - - bool GetEditable() { return IsEditable(); } - void SetEditable( bool edit = true ) { EnableEditing( edit ); } - bool GetEditInPlace() { return IsCellEditControlEnabled(); } - - void SetEditInPlace(bool WXUNUSED(edit) = true) { } - - void SetCellAlignment( int align, int row, int col) - { SetCellAlignment(row, col, align, wxALIGN_CENTER); } - void SetCellAlignment( int WXUNUSED(align) ) {} - void SetCellBitmap(wxBitmap *WXUNUSED(bitmap), int WXUNUSED(row), int WXUNUSED(col)) - { } - void SetDividerPen(const wxPen& WXUNUSED(pen)) { } - wxPen& GetDividerPen() const; - void OnActivate(bool WXUNUSED(active)) {} - - // ******** End of compatibility functions ********** - - - - // ------ control IDs - enum { wxGRID_CELLCTRL = 2000, - wxGRID_TOPCTRL }; - - // ------ control types - enum { wxGRID_TEXTCTRL = 2100, - wxGRID_CHECKBOX, - wxGRID_CHOICE, - wxGRID_COMBOBOX }; - - // overridden wxWindow methods - virtual void Fit(); - -#if wxABI_VERSION >= 20812 - // implementation only - void CancelMouseCapture(); -#endif - -protected: - virtual wxSize DoGetBestSize() const; - - bool m_created; - - wxGridWindow *m_gridWin; - wxGridRowLabelWindow *m_rowLabelWin; - wxGridColLabelWindow *m_colLabelWin; - wxGridCornerLabelWindow *m_cornerLabelWin; - - wxGridTableBase *m_table; - bool m_ownTable; - - int m_numRows; - int m_numCols; - - wxGridCellCoords m_currentCellCoords; - - wxGridCellCoords m_selectingTopLeft; - wxGridCellCoords m_selectingBottomRight; - wxGridCellCoords m_selectingKeyboard; - wxGridSelection *m_selection; - wxColour m_selectionBackground; - wxColour m_selectionForeground; - - // NB: *never* access m_row/col arrays directly because they are created - // on demand, *always* use accessor functions instead! - - // init the m_rowHeights/Bottoms arrays with default values - void InitRowHeights(); - - int m_defaultRowHeight; - int m_minAcceptableRowHeight; - wxArrayInt m_rowHeights; - wxArrayInt m_rowBottoms; - - // init the m_colWidths/Rights arrays - void InitColWidths(); - - int m_defaultColWidth; - int m_minAcceptableColWidth; - wxArrayInt m_colWidths; - wxArrayInt m_colRights; - - // get the col/row coords - int GetColWidth(int col) const; - int GetColLeft(int col) const; - int GetColRight(int col) const; - - // this function must be public for compatibility... -public: - int GetRowHeight(int row) const; -protected: - - int GetRowTop(int row) const; - int GetRowBottom(int row) const; - - int m_rowLabelWidth; - int m_colLabelHeight; - - // the size of the margin left to the right and bottom of the cell area - int m_extraWidth, - m_extraHeight; - - wxColour m_labelBackgroundColour; - wxColour m_labelTextColour; - wxFont m_labelFont; - - int m_rowLabelHorizAlign; - int m_rowLabelVertAlign; - int m_colLabelHorizAlign; - int m_colLabelVertAlign; - int m_colLabelTextOrientation; - - bool m_defaultRowLabelValues; - bool m_defaultColLabelValues; - - wxColour m_gridLineColour; - bool m_gridLinesEnabled; - wxColour m_cellHighlightColour; - int m_cellHighlightPenWidth; - int m_cellHighlightROPenWidth; - - - // common part of AutoSizeColumn/Row() and GetBestSize() - int SetOrCalcColumnSizes(bool calcOnly, bool setAsMin = true); - int SetOrCalcRowSizes(bool calcOnly, bool setAsMin = true); - - // common part of AutoSizeColumn/Row() - void AutoSizeColOrRow(int n, bool setAsMin, bool column /* or row? */); - - // if a column has a minimal width, it will be the value for it in this - // hash table - wxLongToLongHashMap m_colMinWidths, - m_rowMinHeights; - - // get the minimal width of the given column/row - int GetColMinimalWidth(int col) const; - int GetRowMinimalHeight(int col) const; - - // do we have some place to store attributes in? - bool CanHaveAttributes(); - - // cell attribute cache (currently we only cache 1, may be will do - // more/better later) - struct CachedAttr - { - int row, col; - wxGridCellAttr *attr; - } m_attrCache; - - // invalidates the attribute cache - void ClearAttrCache(); - - // adds an attribute to cache - void CacheAttr(int row, int col, wxGridCellAttr *attr) const; - - // looks for an attr in cache, returns true if found - bool LookupAttr(int row, int col, wxGridCellAttr **attr) const; - - // looks for the attr in cache, if not found asks the table and caches the - // result - wxGridCellAttr *GetCellAttr(int row, int col) const; - wxGridCellAttr *GetCellAttr(const wxGridCellCoords& coords ) - { return GetCellAttr( coords.GetRow(), coords.GetCol() ); } - - // the default cell attr object for cells that don't have their own - wxGridCellAttr* m_defaultCellAttr; - - - bool m_inOnKeyDown; - int m_batchCount; - - - wxGridTypeRegistry* m_typeRegistry; - - enum CursorMode - { - WXGRID_CURSOR_SELECT_CELL, - WXGRID_CURSOR_RESIZE_ROW, - WXGRID_CURSOR_RESIZE_COL, - WXGRID_CURSOR_SELECT_ROW, - WXGRID_CURSOR_SELECT_COL, - WXGRID_CURSOR_MOVE_COL - }; - - // this method not only sets m_cursorMode but also sets the correct cursor - // for the given mode and, if captureMouse is not false releases the mouse - // if it was captured and captures it if it must be captured - // - // for this to work, you should always use it and not set m_cursorMode - // directly! - void ChangeCursorMode(CursorMode mode, - wxWindow *win = (wxWindow *)NULL, - bool captureMouse = true); - - wxWindow *m_winCapture; // the window which captured the mouse - CursorMode m_cursorMode; - - //Column positions - wxArrayInt m_colAt; - int m_moveToCol; - - bool m_canDragRowSize; - bool m_canDragColSize; - bool m_canDragColMove; - bool m_canDragGridSize; - bool m_canDragCell; - int m_dragLastPos; - int m_dragRowOrCol; - bool m_isDragging; - wxPoint m_startDragPos; - - bool m_waitForSlowClick; - - wxGridCellCoords m_selectionStart; - - wxCursor m_rowResizeCursor; - wxCursor m_colResizeCursor; - - bool m_editable; // applies to whole grid - bool m_cellEditCtrlEnabled; // is in-place edit currently shown? - - int m_scrollLineX; // X scroll increment - int m_scrollLineY; // Y scroll increment - - void Create(); - void Init(); - void CalcDimensions(); - void CalcWindowSizes(); - bool Redimension( wxGridTableMessage& ); - - - int SendEvent( const wxEventType, int row, int col, wxMouseEvent& ); - int SendEvent( const wxEventType, int row, int col ); - int SendEvent( const wxEventType type) - { - return SendEvent(type, - m_currentCellCoords.GetRow(), - m_currentCellCoords.GetCol()); - } - - void OnPaint( wxPaintEvent& ); - void OnSize( wxSizeEvent& ); - void OnKeyDown( wxKeyEvent& ); - void OnKeyUp( wxKeyEvent& ); - void OnChar( wxKeyEvent& ); - void OnEraseBackground( wxEraseEvent& ); - - - void SetCurrentCell( const wxGridCellCoords& coords ); - void SetCurrentCell( int row, int col ) - { SetCurrentCell( wxGridCellCoords(row, col) ); } - - void HighlightBlock( int topRow, int leftCol, int bottomRow, int rightCol ); - - void HighlightBlock( const wxGridCellCoords& topLeft, - const wxGridCellCoords& bottomRight ) - { HighlightBlock( topLeft.GetRow(), topLeft.GetCol(), - bottomRight.GetRow(), bottomRight.GetCol() ); } - - // ------ functions to get/send data (see also public functions) - // - bool GetModelValues(); - bool SetModelValues(); - -private: - // Calculate the minimum acceptable size for labels area - wxCoord CalcColOrRowLabelAreaMinSize(bool column /* or row? */); - - friend class WXDLLIMPEXP_FWD_ADV wxGridSelection; - - DECLARE_DYNAMIC_CLASS( wxGrid ) - DECLARE_EVENT_TABLE() - DECLARE_NO_COPY_CLASS(wxGrid) -}; - - -// ---------------------------------------------------------------------------- -// Grid event class and event types -// ---------------------------------------------------------------------------- - -class WXDLLIMPEXP_ADV wxGridEvent : public wxNotifyEvent -{ -public: - wxGridEvent() - : wxNotifyEvent(), m_row(-1), m_col(-1), m_x(-1), m_y(-1), - m_selecting(0), m_control(0), m_meta(0), m_shift(0), m_alt(0) - { - } - - wxGridEvent(int id, wxEventType type, wxObject* obj, - int row=-1, int col=-1, int x=-1, int y=-1, bool sel = true, - bool control = false, bool shift = false, bool alt = false, bool meta = false); - - virtual int GetRow() { return m_row; } - virtual int GetCol() { return m_col; } - wxPoint GetPosition() { return wxPoint( m_x, m_y ); } - bool Selecting() { return m_selecting; } - bool ControlDown() { return m_control; } - bool MetaDown() { return m_meta; } - bool ShiftDown() { return m_shift; } - bool AltDown() { return m_alt; } - bool CmdDown() - { -#if defined(__WXMAC__) || defined(__WXCOCOA__) - return MetaDown(); -#else - return ControlDown(); -#endif - } - - virtual wxEvent *Clone() const { return new wxGridEvent(*this); } - -protected: - int m_row; - int m_col; - int m_x; - int m_y; - bool m_selecting; - bool m_control; - bool m_meta; - bool m_shift; - bool m_alt; - - DECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxGridEvent) -}; - -class WXDLLIMPEXP_ADV wxGridSizeEvent : public wxNotifyEvent -{ -public: - wxGridSizeEvent() - : wxNotifyEvent(), m_rowOrCol(-1), m_x(-1), m_y(-1), - m_control(0), m_meta(0), m_shift(0), m_alt(0) - { - } - - wxGridSizeEvent(int id, wxEventType type, wxObject* obj, - int rowOrCol=-1, int x=-1, int y=-1, - bool control = false, bool shift = false, bool alt = false, bool meta = false); - - int GetRowOrCol() { return m_rowOrCol; } - wxPoint GetPosition() { return wxPoint( m_x, m_y ); } - bool ControlDown() { return m_control; } - bool MetaDown() { return m_meta; } - bool ShiftDown() { return m_shift; } - bool AltDown() { return m_alt; } - bool CmdDown() - { -#if defined(__WXMAC__) || defined(__WXCOCOA__) - return MetaDown(); -#else - return ControlDown(); -#endif - } - - virtual wxEvent *Clone() const { return new wxGridSizeEvent(*this); } - -protected: - int m_rowOrCol; - int m_x; - int m_y; - bool m_control; - bool m_meta; - bool m_shift; - bool m_alt; - - DECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxGridSizeEvent) -}; - - -class WXDLLIMPEXP_ADV wxGridRangeSelectEvent : public wxNotifyEvent -{ -public: - wxGridRangeSelectEvent() - : wxNotifyEvent() - { - m_topLeft = wxGridNoCellCoords; - m_bottomRight = wxGridNoCellCoords; - m_selecting = false; - m_control = false; - m_meta = false; - m_shift = false; - m_alt = false; - } - - wxGridRangeSelectEvent(int id, wxEventType type, wxObject* obj, - const wxGridCellCoords& topLeft, - const wxGridCellCoords& bottomRight, - bool sel = true, - bool control = false, bool shift = false, - bool alt = false, bool meta = false); - - wxGridCellCoords GetTopLeftCoords() { return m_topLeft; } - wxGridCellCoords GetBottomRightCoords() { return m_bottomRight; } - int GetTopRow() { return m_topLeft.GetRow(); } - int GetBottomRow() { return m_bottomRight.GetRow(); } - int GetLeftCol() { return m_topLeft.GetCol(); } - int GetRightCol() { return m_bottomRight.GetCol(); } - bool Selecting() { return m_selecting; } - bool ControlDown() { return m_control; } - bool MetaDown() { return m_meta; } - bool ShiftDown() { return m_shift; } - bool AltDown() { return m_alt; } - bool CmdDown() - { -#if defined(__WXMAC__) || defined(__WXCOCOA__) - return MetaDown(); -#else - return ControlDown(); -#endif - } - - virtual wxEvent *Clone() const { return new wxGridRangeSelectEvent(*this); } - -protected: - wxGridCellCoords m_topLeft; - wxGridCellCoords m_bottomRight; - bool m_selecting; - bool m_control; - bool m_meta; - bool m_shift; - bool m_alt; - - DECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxGridRangeSelectEvent) -}; - - -class WXDLLIMPEXP_ADV wxGridEditorCreatedEvent : public wxCommandEvent { -public: - wxGridEditorCreatedEvent() - : wxCommandEvent() - { - m_row = 0; - m_col = 0; - m_ctrl = NULL; - } - - wxGridEditorCreatedEvent(int id, wxEventType type, wxObject* obj, - int row, int col, wxControl* ctrl); - - int GetRow() { return m_row; } - int GetCol() { return m_col; } - wxControl* GetControl() { return m_ctrl; } - void SetRow(int row) { m_row = row; } - void SetCol(int col) { m_col = col; } - void SetControl(wxControl* ctrl) { m_ctrl = ctrl; } - - virtual wxEvent *Clone() const { return new wxGridEditorCreatedEvent(*this); } - -private: - int m_row; - int m_col; - wxControl* m_ctrl; - - DECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxGridEditorCreatedEvent) -}; - - -BEGIN_DECLARE_EVENT_TYPES() - DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_ADV, wxEVT_GRID_CELL_LEFT_CLICK, 1580) - DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_ADV, wxEVT_GRID_CELL_RIGHT_CLICK, 1581) - DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_ADV, wxEVT_GRID_CELL_LEFT_DCLICK, 1582) - DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_ADV, wxEVT_GRID_CELL_RIGHT_DCLICK, 1583) - DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_ADV, wxEVT_GRID_LABEL_LEFT_CLICK, 1584) - DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_ADV, wxEVT_GRID_LABEL_RIGHT_CLICK, 1585) - DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_ADV, wxEVT_GRID_LABEL_LEFT_DCLICK, 1586) - DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_ADV, wxEVT_GRID_LABEL_RIGHT_DCLICK, 1587) - DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_ADV, wxEVT_GRID_ROW_SIZE, 1588) - DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_ADV, wxEVT_GRID_COL_SIZE, 1589) - DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_ADV, wxEVT_GRID_RANGE_SELECT, 1590) - DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_ADV, wxEVT_GRID_CELL_CHANGE, 1591) - DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_ADV, wxEVT_GRID_SELECT_CELL, 1592) - DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_ADV, wxEVT_GRID_EDITOR_SHOWN, 1593) - DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_ADV, wxEVT_GRID_EDITOR_HIDDEN, 1594) - DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_ADV, wxEVT_GRID_EDITOR_CREATED, 1595) - DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_ADV, wxEVT_GRID_CELL_BEGIN_DRAG, 1596) - DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_ADV, wxEVT_GRID_COL_MOVE, 1597) -END_DECLARE_EVENT_TYPES() - - -typedef void (wxEvtHandler::*wxGridEventFunction)(wxGridEvent&); -typedef void (wxEvtHandler::*wxGridSizeEventFunction)(wxGridSizeEvent&); -typedef void (wxEvtHandler::*wxGridRangeSelectEventFunction)(wxGridRangeSelectEvent&); -typedef void (wxEvtHandler::*wxGridEditorCreatedEventFunction)(wxGridEditorCreatedEvent&); - -#define wxGridEventHandler(func) \ - (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxGridEventFunction, &func) - -#define wxGridSizeEventHandler(func) \ - (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxGridSizeEventFunction, &func) - -#define wxGridRangeSelectEventHandler(func) \ - (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxGridRangeSelectEventFunction, &func) - -#define wxGridEditorCreatedEventHandler(func) \ - (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxGridEditorCreatedEventFunction, &func) - -#define wx__DECLARE_GRIDEVT(evt, id, fn) \ - wx__DECLARE_EVT1(wxEVT_GRID_ ## evt, id, wxGridEventHandler(fn)) - -#define wx__DECLARE_GRIDSIZEEVT(evt, id, fn) \ - wx__DECLARE_EVT1(wxEVT_GRID_ ## evt, id, wxGridSizeEventHandler(fn)) - -#define wx__DECLARE_GRIDRANGESELEVT(evt, id, fn) \ - wx__DECLARE_EVT1(wxEVT_GRID_ ## evt, id, wxGridRangeSelectEventHandler(fn)) - -#define wx__DECLARE_GRIDEDITOREVT(evt, id, fn) \ - wx__DECLARE_EVT1(wxEVT_GRID_ ## evt, id, wxGridEditorCreatedEventHandler(fn)) - -#define EVT_GRID_CMD_CELL_LEFT_CLICK(id, fn) wx__DECLARE_GRIDEVT(CELL_LEFT_CLICK, id, fn) -#define EVT_GRID_CMD_CELL_RIGHT_CLICK(id, fn) wx__DECLARE_GRIDEVT(CELL_RIGHT_CLICK, id, fn) -#define EVT_GRID_CMD_CELL_LEFT_DCLICK(id, fn) wx__DECLARE_GRIDEVT(CELL_LEFT_DCLICK, id, fn) -#define EVT_GRID_CMD_CELL_RIGHT_DCLICK(id, fn) wx__DECLARE_GRIDEVT(CELL_RIGHT_DCLICK, id, fn) -#define EVT_GRID_CMD_LABEL_LEFT_CLICK(id, fn) wx__DECLARE_GRIDEVT(LABEL_LEFT_CLICK, id, fn) -#define EVT_GRID_CMD_LABEL_RIGHT_CLICK(id, fn) wx__DECLARE_GRIDEVT(LABEL_RIGHT_CLICK, id, fn) -#define EVT_GRID_CMD_LABEL_LEFT_DCLICK(id, fn) wx__DECLARE_GRIDEVT(LABEL_LEFT_DCLICK, id, fn) -#define EVT_GRID_CMD_LABEL_RIGHT_DCLICK(id, fn) wx__DECLARE_GRIDEVT(LABEL_RIGHT_DCLICK, id, fn) -#define EVT_GRID_CMD_ROW_SIZE(id, fn) wx__DECLARE_GRIDSIZEEVT(ROW_SIZE, id, fn) -#define EVT_GRID_CMD_COL_SIZE(id, fn) wx__DECLARE_GRIDSIZEEVT(COL_SIZE, id, fn) -#define EVT_GRID_CMD_COL_MOVE(id, fn) wx__DECLARE_GRIDEVT(COL_MOVE, id, fn) -#define EVT_GRID_CMD_RANGE_SELECT(id, fn) wx__DECLARE_GRIDRANGESELEVT(RANGE_SELECT, id, fn) -#define EVT_GRID_CMD_CELL_CHANGE(id, fn) wx__DECLARE_GRIDEVT(CELL_CHANGE, id, fn) -#define EVT_GRID_CMD_SELECT_CELL(id, fn) wx__DECLARE_GRIDEVT(SELECT_CELL, id, fn) -#define EVT_GRID_CMD_EDITOR_SHOWN(id, fn) wx__DECLARE_GRIDEVT(EDITOR_SHOWN, id, fn) -#define EVT_GRID_CMD_EDITOR_HIDDEN(id, fn) wx__DECLARE_GRIDEVT(EDITOR_HIDDEN, id, fn) -#define EVT_GRID_CMD_EDITOR_CREATED(id, fn) wx__DECLARE_GRIDEDITOREVT(EDITOR_CREATED, id, fn) -#define EVT_GRID_CMD_CELL_BEGIN_DRAG(id, fn) wx__DECLARE_GRIDEVT(CELL_BEGIN_DRAG, id, fn) - -// same as above but for any id (exists mainly for backwards compatibility but -// then it's also true that you rarely have multiple grid in the same window) -#define EVT_GRID_CELL_LEFT_CLICK(fn) EVT_GRID_CMD_CELL_LEFT_CLICK(wxID_ANY, fn) -#define EVT_GRID_CELL_RIGHT_CLICK(fn) EVT_GRID_CMD_CELL_RIGHT_CLICK(wxID_ANY, fn) -#define EVT_GRID_CELL_LEFT_DCLICK(fn) EVT_GRID_CMD_CELL_LEFT_DCLICK(wxID_ANY, fn) -#define EVT_GRID_CELL_RIGHT_DCLICK(fn) EVT_GRID_CMD_CELL_RIGHT_DCLICK(wxID_ANY, fn) -#define EVT_GRID_LABEL_LEFT_CLICK(fn) EVT_GRID_CMD_LABEL_LEFT_CLICK(wxID_ANY, fn) -#define EVT_GRID_LABEL_RIGHT_CLICK(fn) EVT_GRID_CMD_LABEL_RIGHT_CLICK(wxID_ANY, fn) -#define EVT_GRID_LABEL_LEFT_DCLICK(fn) EVT_GRID_CMD_LABEL_LEFT_DCLICK(wxID_ANY, fn) -#define EVT_GRID_LABEL_RIGHT_DCLICK(fn) EVT_GRID_CMD_LABEL_RIGHT_DCLICK(wxID_ANY, fn) -#define EVT_GRID_ROW_SIZE(fn) EVT_GRID_CMD_ROW_SIZE(wxID_ANY, fn) -#define EVT_GRID_COL_SIZE(fn) EVT_GRID_CMD_COL_SIZE(wxID_ANY, fn) -#define EVT_GRID_COL_MOVE(fn) EVT_GRID_CMD_COL_MOVE(wxID_ANY, fn) -#define EVT_GRID_RANGE_SELECT(fn) EVT_GRID_CMD_RANGE_SELECT(wxID_ANY, fn) -#define EVT_GRID_CELL_CHANGE(fn) EVT_GRID_CMD_CELL_CHANGE(wxID_ANY, fn) -#define EVT_GRID_SELECT_CELL(fn) EVT_GRID_CMD_SELECT_CELL(wxID_ANY, fn) -#define EVT_GRID_EDITOR_SHOWN(fn) EVT_GRID_CMD_EDITOR_SHOWN(wxID_ANY, fn) -#define EVT_GRID_EDITOR_HIDDEN(fn) EVT_GRID_CMD_EDITOR_HIDDEN(wxID_ANY, fn) -#define EVT_GRID_EDITOR_CREATED(fn) EVT_GRID_CMD_EDITOR_CREATED(wxID_ANY, fn) -#define EVT_GRID_CELL_BEGIN_DRAG(fn) EVT_GRID_CMD_CELL_BEGIN_DRAG(wxID_ANY, fn) - -#if 0 // TODO: implement these ? others ? - -extern const int wxEVT_GRID_CREATE_CELL; -extern const int wxEVT_GRID_CHANGE_LABELS; -extern const int wxEVT_GRID_CHANGE_SEL_LABEL; - -#define EVT_GRID_CREATE_CELL(fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_GRID_CREATE_CELL, wxID_ANY, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxGridEventFunction, &fn ), NULL ), -#define EVT_GRID_CHANGE_LABELS(fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_GRID_CHANGE_LABELS, wxID_ANY, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxGridEventFunction, &fn ), NULL ), -#define EVT_GRID_CHANGE_SEL_LABEL(fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_GRID_CHANGE_SEL_LABEL, wxID_ANY, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxGridEventFunction, &fn ), NULL ), - -#endif - -#endif // wxUSE_GRID -#endif // _WX_GENERIC_GRID_H_ diff --git a/wxWidgets/include/wx/generic/gridctrl.h b/wxWidgets/include/wx/generic/gridctrl.h deleted file mode 100644 index d59a38e7cf..0000000000 --- a/wxWidgets/include/wx/generic/gridctrl.h +++ /dev/null @@ -1,158 +0,0 @@ -/////////////////////////////////////////////////////////////////////////// -// Name: generic/gridctrl.h -// Purpose: wxGrid controls -// Author: Paul Gammans, Roger Gammans -// Modified by: -// Created: 11/04/2001 -// RCS-ID: $Id: gridctrl.h 61872 2009-09-09 22:37:05Z VZ $ -// Copyright: (c) The Computer Surgery (paul@compsurg.co.uk) -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_GENERIC_GRIDCTRL_H_ -#define _WX_GENERIC_GRIDCTRL_H_ - -#include "wx/grid.h" - -#if wxUSE_GRID - -#define wxGRID_VALUE_CHOICEINT wxT("choiceint") -#define wxGRID_VALUE_DATETIME wxT("datetime") - -#if wxUSE_DATETIME - -#include "wx/datetime.h" - -// the default renderer for the cells containing Time and dates.. -class WXDLLIMPEXP_ADV wxGridCellDateTimeRenderer : public wxGridCellStringRenderer -{ -public: - wxGridCellDateTimeRenderer(const wxString& outformat = wxDefaultDateTimeFormat, - const wxString& informat = wxDefaultDateTimeFormat); - - // draw the string right aligned - virtual void Draw(wxGrid& grid, - wxGridCellAttr& attr, - wxDC& dc, - const wxRect& rect, - int row, int col, - bool isSelected); - - virtual wxSize GetBestSize(wxGrid& grid, - wxGridCellAttr& attr, - wxDC& dc, - int row, int col); - - virtual wxGridCellRenderer *Clone() const; - - // parameters string format is "width[,precision]" - virtual void SetParameters(const wxString& params); - -protected: - wxString GetString(const wxGrid& grid, int row, int col); - - wxString m_iformat; - wxString m_oformat; - wxDateTime m_dateDef; - wxDateTime::TimeZone m_tz; -}; - -#endif // wxUSE_DATETIME - -// the default renderer for the cells containing Time and dates.. -class WXDLLIMPEXP_ADV wxGridCellEnumRenderer : public wxGridCellStringRenderer -{ -public: - wxGridCellEnumRenderer( const wxString& choices = wxEmptyString ); - - // draw the string right aligned - virtual void Draw(wxGrid& grid, - wxGridCellAttr& attr, - wxDC& dc, - const wxRect& rect, - int row, int col, - bool isSelected); - - virtual wxSize GetBestSize(wxGrid& grid, - wxGridCellAttr& attr, - wxDC& dc, - int row, int col); - - virtual wxGridCellRenderer *Clone() const; - - // parameters string format is "item1[,item2[...,itemN]]" - virtual void SetParameters(const wxString& params); - -protected: - wxString GetString(const wxGrid& grid, int row, int col); - - wxArrayString m_choices; -}; - - -#if wxUSE_COMBOBOX - -class WXDLLIMPEXP_ADV wxGridCellEnumEditor : public wxGridCellChoiceEditor -{ -public: - wxGridCellEnumEditor( const wxString& choices = wxEmptyString ); - virtual ~wxGridCellEnumEditor() {} - - virtual wxGridCellEditor* Clone() const; - - virtual bool EndEdit(int row, int col, wxGrid* grid); - virtual void BeginEdit(int row, int col, wxGrid* grid); - -private: - long int m_startint; - - DECLARE_NO_COPY_CLASS(wxGridCellEnumEditor) -}; - -#endif // wxUSE_COMBOBOX - -class WXDLLIMPEXP_ADV wxGridCellAutoWrapStringEditor : public wxGridCellTextEditor -{ -public: - wxGridCellAutoWrapStringEditor() : wxGridCellTextEditor() { } - virtual void Create(wxWindow* parent, - wxWindowID id, - wxEvtHandler* evtHandler); - - virtual wxGridCellEditor *Clone() const - { return new wxGridCellAutoWrapStringEditor; } - - DECLARE_NO_COPY_CLASS(wxGridCellAutoWrapStringEditor) -}; - -class WXDLLIMPEXP_ADV wxGridCellAutoWrapStringRenderer : public wxGridCellStringRenderer -{ -public: - wxGridCellAutoWrapStringRenderer() : wxGridCellStringRenderer() { } - - virtual void Draw(wxGrid& grid, - wxGridCellAttr& attr, - wxDC& dc, - const wxRect& rect, - int row, int col, - bool isSelected); - - virtual wxSize GetBestSize(wxGrid& grid, - wxGridCellAttr& attr, - wxDC& dc, - int row, int col); - - virtual wxGridCellRenderer *Clone() const - { return new wxGridCellAutoWrapStringRenderer; } - -private: - wxArrayString GetTextLines( wxGrid& grid, - wxDC& dc, - const wxGridCellAttr& attr, - const wxRect& rect, - int row, int col); - -}; - -#endif // wxUSE_GRID -#endif // _WX_GENERIC_GRIDCTRL_H_ diff --git a/wxWidgets/include/wx/generic/gridsel.h b/wxWidgets/include/wx/generic/gridsel.h deleted file mode 100644 index fff21a3684..0000000000 --- a/wxWidgets/include/wx/generic/gridsel.h +++ /dev/null @@ -1,88 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/generic/gridsel.h -// Purpose: wxGridSelection -// Author: Stefan Neis -// Modified by: -// Created: 20/02/2000 -// RCS-ID: $$ -// Copyright: (c) Stefan Neis -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_GENERIC_GRIDSEL_H_ -#define _WX_GENERIC_GRIDSEL_H_ - -#include "wx/defs.h" - -#if wxUSE_GRID - -#include "wx/grid.h" - -class WXDLLIMPEXP_ADV wxGridSelection -{ -public: - wxGridSelection( wxGrid * grid, wxGrid::wxGridSelectionModes sel = - wxGrid::wxGridSelectCells ); - bool IsSelection(); - bool IsInSelection ( int row, int col ); - void SetSelectionMode(wxGrid::wxGridSelectionModes selmode); - wxGrid::wxGridSelectionModes GetSelectionMode() { return m_selectionMode; } - void SelectRow( int row, - bool ControlDown = false, bool ShiftDown = false, - bool AltDown = false, bool MetaDown = false ); - void SelectCol( int col, - bool ControlDown = false, bool ShiftDown = false, - bool AltDown = false, bool MetaDown = false ); - void SelectBlock( int topRow, int leftCol, - int bottomRow, int rightCol, - bool ControlDown = false, bool ShiftDown = false, - bool AltDown = false, bool MetaDown = false, - bool sendEvent = true ); - void SelectCell( int row, int col, - bool ControlDown = false, bool ShiftDown = false, - bool AltDown = false, bool MetaDown = false, - bool sendEvent = true ); - void ToggleCellSelection( int row, int col, - bool ControlDown = false, - bool ShiftDown = false, - bool AltDown = false, bool MetaDown = false ); - void ClearSelection(); - - void UpdateRows( size_t pos, int numRows ); - void UpdateCols( size_t pos, int numCols ); - -private: - int BlockContain( int topRow1, int leftCol1, - int bottomRow1, int rightCol1, - int topRow2, int leftCol2, - int bottomRow2, int rightCol2 ); - // returns 1, if Block1 contains Block2, - // -1, if Block2 contains Block1, - // 0, otherwise - - int BlockContainsCell( int topRow, int leftCol, - int bottomRow, int rightCol, - int row, int col ) - // returns 1, if Block contains Cell, - // 0, otherwise - { - return ( topRow <= row && row <= bottomRow && - leftCol <= col && col <= rightCol ); - } - - wxGridCellCoordsArray m_cellSelection; - wxGridCellCoordsArray m_blockSelectionTopLeft; - wxGridCellCoordsArray m_blockSelectionBottomRight; - wxArrayInt m_rowSelection; - wxArrayInt m_colSelection; - - wxGrid *m_grid; - wxGrid::wxGridSelectionModes m_selectionMode; - - friend class WXDLLIMPEXP_FWD_ADV wxGrid; - - DECLARE_NO_COPY_CLASS(wxGridSelection) -}; - -#endif // wxUSE_GRID -#endif // _WX_GENERIC_GRIDSEL_H_ diff --git a/wxWidgets/include/wx/generic/helpext.h b/wxWidgets/include/wx/generic/helpext.h deleted file mode 100644 index 62d5c67482..0000000000 --- a/wxWidgets/include/wx/generic/helpext.h +++ /dev/null @@ -1,166 +0,0 @@ -/*-*- c++ -*-******************************************************** - * helpext.h - an external help controller for wxWidgets * - * * - * (C) 1998 by Karsten Ballueder (Ballueder@usa.net) * - * License: wxWindows licence * - * * - * $Id: helpext.h 50711 2007-12-15 02:57:58Z VZ $ - *******************************************************************/ - -#ifndef __WX_HELPEXT_H_ -#define __WX_HELPEXT_H_ - -#if wxUSE_HELP - -#include "wx/helpbase.h" - -/** - This class implements help via an external browser. - It requires the name of a directory containing the documentation - and a file mapping numerical Section numbers to relative URLS. - - The map file contains two or three fields per line: - numeric_id relative_URL [; comment/documentation] - - The numeric_id is the id used to look up the entry in - DisplaySection()/DisplayBlock(). The relative_URL is a filename of - an html file, relative to the help directory. The optional - comment/documentation field (after a ';') is used for keyword - searches, so some meaningful text here does not hurt. - If the documentation itself contains a ';', only the part before - that will be displayed in the listbox, but all of it used for search. - - Lines starting with ';' will be ignored. -*/ - -class WXDLLIMPEXP_ADV wxExtHelpController : public wxHelpControllerBase -{ -public: - wxExtHelpController(wxWindow* parentWindow = NULL); - virtual ~wxExtHelpController(); - - /** Tell it which browser to use. - The Netscape support will check whether Netscape is already - running (by looking at the .netscape/lock file in the user's - home directory) and tell it to load the page into the existing - window. - @param browsername The command to call a browser/html viewer. - @param isNetscape Set this to true if the browser is some variant of Netscape. - */ - void SetBrowser(const wxString& browsername = wxEmptyString, - bool isNetscape = false); - - // Set viewer: new name for SetBrowser - virtual void SetViewer(const wxString& viewer = wxEmptyString, - long flags = wxHELP_NETSCAPE); - - /** This must be called to tell the controller where to find the - documentation. - If a locale is set, look in file/localename, i.e. - If passed "/usr/local/myapp/help" and the current wxLocale is - set to be "de", then look in "/usr/local/myapp/help/de/" - first and fall back to "/usr/local/myapp/help" if that - doesn't exist. - - @param file - NOT a filename, but a directory name. - @return true on success - */ - virtual bool Initialize(const wxString& dir, int WXUNUSED(server)) - { return Initialize(dir); } - - /** This must be called to tell the controller where to find the - documentation. - If a locale is set, look in file/localename, i.e. - If passed "/usr/local/myapp/help" and the current wxLocale is - set to be "de", then look in "/usr/local/myapp/help/de/" - first and fall back to "/usr/local/myapp/help" if that - doesn't exist. - @param dir - directory name where to fine the help files - @return true on success - */ - virtual bool Initialize(const wxString& dir); - - /** If file is "", reloads file given in Initialize. - @file Name of help directory. - @return true on success - */ - virtual bool LoadFile(const wxString& file = wxEmptyString); - - /** Display list of all help entries. - @return true on success - */ - virtual bool DisplayContents(void); - /** Display help for id sectionNo. - @return true on success - */ - virtual bool DisplaySection(int sectionNo); - /** Display help for id sectionNo -- identical with DisplaySection(). - @return true on success - */ - virtual bool DisplaySection(const wxString& section); - /** Display help for URL (using DisplayHelp) or keyword (using KeywordSearch) - @return true on success - */ - virtual bool DisplayBlock(long blockNo); - /** Search comment/documentation fields in map file and present a - list to chose from. - @key k string to search for, empty string will list all entries - @return true on success - */ - virtual bool KeywordSearch(const wxString& k, - wxHelpSearchMode mode = wxHELP_SEARCH_ALL); - - /// does nothing - virtual bool Quit(void); - /// does nothing - virtual void OnQuit(void); - - /// Call the browser using a relative URL. - virtual bool DisplayHelp(const wxString &) ; - - /// Allows one to override the default settings for the help frame. - virtual void SetFrameParameters(const wxString& WXUNUSED(title), - const wxSize& WXUNUSED(size), - const wxPoint& WXUNUSED(pos) = wxDefaultPosition, - bool WXUNUSED(newFrameEachTime) = false) - { - // does nothing by default - } - /// Obtains the latest settings used by the help frame and the help - /// frame. - virtual wxFrame *GetFrameParameters(wxSize *WXUNUSED(size) = NULL, - wxPoint *WXUNUSED(pos) = NULL, - bool *WXUNUSED(newFrameEachTime) = NULL) - { - return (wxFrame*) NULL;// does nothing by default - } - -protected: - /// Filename of currently active map file. - wxString m_helpDir; - /// How many entries do we have in the map file? - int m_NumOfEntries; - /// A list containing all id,url,documentation triples. - wxList *m_MapList; - -private: - // parse a single line of the map file (called by LoadFile()) - // - // return true if the line was valid or false otherwise - bool ParseMapFileLine(const wxString& line); - - /// Deletes the list and all objects. - void DeleteList(void); - - - /// How to call the html viewer. - wxString m_BrowserName; - /// Is the viewer a variant of netscape? - bool m_BrowserIsNetscape; - - DECLARE_CLASS(wxExtHelpController) -}; - -#endif // wxUSE_HELP - -#endif // __WX_HELPEXT_H_ diff --git a/wxWidgets/include/wx/generic/icon.h b/wxWidgets/include/wx/generic/icon.h deleted file mode 100644 index de7d23834a..0000000000 --- a/wxWidgets/include/wx/generic/icon.h +++ /dev/null @@ -1,56 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/generic/icon.h -// Purpose: wxIcon implementation for ports where it's same as wxBitmap -// Author: Julian Smart -// Modified by: -// Created: 17/09/98 -// RCS-ID: $Id: icon.h 42752 2006-10-30 19:26:48Z VZ $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_GENERIC_ICON_H_ -#define _WX_GENERIC_ICON_H_ - -#include "wx/bitmap.h" - -//----------------------------------------------------------------------------- -// wxIcon -//----------------------------------------------------------------------------- - -#ifndef wxICON_DEFAULT_BITMAP_TYPE -#define wxICON_DEFAULT_BITMAP_TYPE wxBITMAP_TYPE_XPM -#endif - -class WXDLLIMPEXP_CORE wxIcon: public wxBitmap -{ -public: - wxIcon(); - - wxIcon( const char **bits, int width=-1, int height=-1 ); - wxIcon( char **bits, int width=-1, int height=-1 ); - - // For compatibility with wxMSW where desired size is sometimes required to - // distinguish between multiple icons in a resource. - wxIcon( const wxString& filename, - wxBitmapType type = wxICON_DEFAULT_BITMAP_TYPE, - int WXUNUSED(desiredWidth)=-1, int WXUNUSED(desiredHeight)=-1 ) : - wxBitmap(filename, type) - { - } - - wxIcon(const wxIconLocation& loc) - : wxBitmap(loc.GetFileName(), wxBITMAP_TYPE_ANY) - { - } - - // 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); - -private: - DECLARE_DYNAMIC_CLASS(wxIcon) -}; - -#endif // _WX_GENERIC_ICON_H_ diff --git a/wxWidgets/include/wx/generic/imaglist.h b/wxWidgets/include/wx/generic/imaglist.h deleted file mode 100644 index 92db6dc872..0000000000 --- a/wxWidgets/include/wx/generic/imaglist.h +++ /dev/null @@ -1,82 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/generic/imaglist.h -// Purpose: -// Author: Robert Roebling -// Created: 01/02/97 -// Id: -// Copyright: (c) 1998 Robert Roebling and Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef __IMAGELISTH_G__ -#define __IMAGELISTH_G__ - -#include "wx/defs.h" -#include "wx/list.h" -#include "wx/icon.h" - -class WXDLLEXPORT wxDC; -class WXDLLEXPORT wxBitmap; -class WXDLLEXPORT wxColour; - - -class WXDLLEXPORT wxGenericImageList: public wxObject -{ -public: - wxGenericImageList() { m_width = m_height = 0; } - wxGenericImageList( int width, int height, bool mask = true, int initialCount = 1 ); - virtual ~wxGenericImageList(); - bool Create( int width, int height, bool mask = true, int initialCount = 1 ); - bool Create(); - - virtual int GetImageCount() const; - virtual bool GetSize( int index, int &width, int &height ) const; - - int Add( const wxBitmap& bitmap ); - int Add( const wxBitmap& bitmap, const wxBitmap& mask ); - int Add( const wxBitmap& bitmap, const wxColour& maskColour ); - wxBitmap GetBitmap(int index) const; - wxIcon GetIcon(int index) const; - bool Replace( int index, const wxBitmap &bitmap ); - bool Replace( int index, const wxBitmap &bitmap, const wxBitmap& mask ); - bool Remove( int index ); - bool RemoveAll(); - - virtual bool Draw(int index, wxDC& dc, int x, int y, - int flags = wxIMAGELIST_DRAW_NORMAL, - bool solidBackground = false); - - // Internal use only - const wxBitmap *GetBitmapPtr(int index) const; -private: - wxList m_images; - - int m_width; - int m_height; - - DECLARE_DYNAMIC_CLASS(wxGenericImageList) -}; - -#ifndef wxHAS_NATIVE_IMAGELIST - -/* - * wxImageList has to be a real class or we have problems with - * the run-time information. - */ - -class WXDLLEXPORT wxImageList: public wxGenericImageList -{ - DECLARE_DYNAMIC_CLASS(wxImageList) - -public: - wxImageList() {} - - wxImageList( int width, int height, bool mask = true, int initialCount = 1 ) - : wxGenericImageList(width, height, mask, initialCount) - { - } -}; -#endif // !wxHAS_NATIVE_IMAGELIST - -#endif // __IMAGELISTH_G__ - diff --git a/wxWidgets/include/wx/generic/laywin.h b/wxWidgets/include/wx/generic/laywin.h deleted file mode 100644 index ffb1f1a8d1..0000000000 --- a/wxWidgets/include/wx/generic/laywin.h +++ /dev/null @@ -1,222 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: laywin.h -// Purpose: Implements a simple layout algorithm, plus -// wxSashLayoutWindow which is an example of a window with -// layout-awareness (via event handlers). This is suited to -// IDE-style window layout. -// Author: Julian Smart -// Modified by: -// Created: 04/01/98 -// RCS-ID: $Id: laywin.h 49563 2007-10-31 20:46:21Z VZ $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_LAYWIN_H_G_ -#define _WX_LAYWIN_H_G_ - -#if wxUSE_SASH - #include "wx/sashwin.h" -#endif // wxUSE_SASH - -#include "wx/event.h" - -BEGIN_DECLARE_EVENT_TYPES() - DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_ADV, wxEVT_QUERY_LAYOUT_INFO, 1500) - DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_ADV, wxEVT_CALCULATE_LAYOUT, 1501) -END_DECLARE_EVENT_TYPES() - -enum wxLayoutOrientation -{ - wxLAYOUT_HORIZONTAL, - wxLAYOUT_VERTICAL -}; - -enum wxLayoutAlignment -{ - wxLAYOUT_NONE, - wxLAYOUT_TOP, - wxLAYOUT_LEFT, - wxLAYOUT_RIGHT, - wxLAYOUT_BOTTOM -}; - -// Not sure this is necessary -// Tell window which dimension we're sizing on -#define wxLAYOUT_LENGTH_Y 0x0008 -#define wxLAYOUT_LENGTH_X 0x0000 - -// Use most recently used length -#define wxLAYOUT_MRU_LENGTH 0x0010 - -// Only a query, so don't actually move it. -#define wxLAYOUT_QUERY 0x0100 - -/* - * This event is used to get information about window alignment, - * orientation and size. - */ - -class WXDLLIMPEXP_ADV wxQueryLayoutInfoEvent: public wxEvent -{ -public: - wxQueryLayoutInfoEvent(wxWindowID id = 0) - { - SetEventType(wxEVT_QUERY_LAYOUT_INFO); - m_requestedLength = 0; - m_flags = 0; - m_id = id; - m_alignment = wxLAYOUT_TOP; - m_orientation = wxLAYOUT_HORIZONTAL; - } - - // Read by the app - void SetRequestedLength(int length) { m_requestedLength = length; } - int GetRequestedLength() const { return m_requestedLength; } - - void SetFlags(int flags) { m_flags = flags; } - int GetFlags() const { return m_flags; } - - // Set by the app - void SetSize(const wxSize& size) { m_size = size; } - wxSize GetSize() const { return m_size; } - - void SetOrientation(wxLayoutOrientation orient) { m_orientation = orient; } - wxLayoutOrientation GetOrientation() const { return m_orientation; } - - void SetAlignment(wxLayoutAlignment align) { m_alignment = align; } - wxLayoutAlignment GetAlignment() const { return m_alignment; } - - virtual wxEvent *Clone() const { return new wxQueryLayoutInfoEvent(*this); } - -protected: - int m_flags; - int m_requestedLength; - wxSize m_size; - wxLayoutOrientation m_orientation; - wxLayoutAlignment m_alignment; - -private: - DECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxQueryLayoutInfoEvent) -}; - -typedef void (wxEvtHandler::*wxQueryLayoutInfoEventFunction)(wxQueryLayoutInfoEvent&); - -#define EVT_QUERY_LAYOUT_INFO(func) \ - DECLARE_EVENT_TABLE_ENTRY( wxEVT_QUERY_LAYOUT_INFO, wxID_ANY, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxQueryLayoutInfoEventFunction, & func ), NULL ), - -/* - * This event is used to take a bite out of the available client area. - */ - -class WXDLLIMPEXP_ADV wxCalculateLayoutEvent: public wxEvent -{ -public: - wxCalculateLayoutEvent(wxWindowID id = 0) - { - SetEventType(wxEVT_CALCULATE_LAYOUT); - m_flags = 0; - m_id = id; - } - - // Read by the app - void SetFlags(int flags) { m_flags = flags; } - int GetFlags() const { return m_flags; } - - // Set by the app - void SetRect(const wxRect& rect) { m_rect = rect; } - wxRect GetRect() const { return m_rect; } - - virtual wxEvent *Clone() const { return new wxCalculateLayoutEvent(*this); } - -protected: - int m_flags; - wxRect m_rect; - -private: - DECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxCalculateLayoutEvent) -}; - -typedef void (wxEvtHandler::*wxCalculateLayoutEventFunction)(wxCalculateLayoutEvent&); - -#define EVT_CALCULATE_LAYOUT(func) \ - DECLARE_EVENT_TABLE_ENTRY( wxEVT_CALCULATE_LAYOUT, wxID_ANY, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxCalculateLayoutEventFunction, & func ), NULL ), - -#if wxUSE_SASH - -// This is window that can remember alignment/orientation, does its own layout, -// and can provide sashes too. Useful for implementing docked windows with sashes in -// an IDE-style interface. -class WXDLLIMPEXP_ADV wxSashLayoutWindow: public wxSashWindow -{ -public: - wxSashLayoutWindow() - { - Init(); - } - - wxSashLayoutWindow(wxWindow *parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, long style = wxSW_3D|wxCLIP_CHILDREN, const wxString& name = wxT("layoutWindow")) - { - Create(parent, id, pos, size, style, name); - } - - bool Create(wxWindow *parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, long style = wxSW_3D|wxCLIP_CHILDREN, const wxString& name = wxT("layoutWindow")); - -// Accessors - inline wxLayoutAlignment GetAlignment() const { return m_alignment; } - inline wxLayoutOrientation GetOrientation() const { return m_orientation; } - - inline void SetAlignment(wxLayoutAlignment align) { m_alignment = align; } - inline void SetOrientation(wxLayoutOrientation orient) { m_orientation = orient; } - - // Give the window default dimensions - inline void SetDefaultSize(const wxSize& size) { m_defaultSize = size; } - -// Event handlers - // Called by layout algorithm to allow window to take a bit out of the - // client rectangle, and size itself if not in wxLAYOUT_QUERY mode. - void OnCalculateLayout(wxCalculateLayoutEvent& event); - - // Called by layout algorithm to retrieve information about the window. - void OnQueryLayoutInfo(wxQueryLayoutInfoEvent& event); - -private: - void Init(); - - wxLayoutAlignment m_alignment; - wxLayoutOrientation m_orientation; - wxSize m_defaultSize; - -private: - DECLARE_DYNAMIC_CLASS_NO_COPY(wxSashLayoutWindow) - DECLARE_EVENT_TABLE() -}; - -#endif // wxUSE_SASH - -class WXDLLIMPEXP_FWD_CORE wxMDIParentFrame; -class WXDLLIMPEXP_FWD_CORE wxFrame; - -// This class implements the layout algorithm -class WXDLLIMPEXP_ADV wxLayoutAlgorithm: public wxObject -{ -public: - wxLayoutAlgorithm() {} - -#if wxUSE_MDI_ARCHITECTURE - // The MDI client window is sized to whatever's left over. - bool LayoutMDIFrame(wxMDIParentFrame* frame, wxRect* rect = (wxRect*) NULL); -#endif // wxUSE_MDI_ARCHITECTURE - - // mainWindow is sized to whatever's left over. This function for backward - // compatibility; use LayoutWindow. - bool LayoutFrame(wxFrame* frame, wxWindow* mainWindow = (wxWindow*) NULL); - - // mainWindow is sized to whatever's left over. - bool LayoutWindow(wxWindow* frame, wxWindow* mainWindow = (wxWindow*) NULL); -}; - -#endif - // _WX_LAYWIN_H_G_ diff --git a/wxWidgets/include/wx/generic/listctrl.h b/wxWidgets/include/wx/generic/listctrl.h deleted file mode 100644 index 187a0c2608..0000000000 --- a/wxWidgets/include/wx/generic/listctrl.h +++ /dev/null @@ -1,280 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/generic/listctrl.h -// Purpose: Generic list control -// Author: Robert Roebling -// Created: 01/02/97 -// RCS-ID: $Id: listctrl.h 62158 2009-09-26 17:47:23Z JS $ -// Copyright: (c) 1998 Robert Roebling and Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_GENERIC_LISTCTRL_H_ -#define _WX_GENERIC_LISTCTRL_H_ - -#include "wx/textctrl.h" - -class WXDLLIMPEXP_CORE wxImageList; - -#if wxUSE_DRAG_AND_DROP -class WXDLLEXPORT wxDropTarget; -#endif - -// ---------------------------------------------------------------------------- -// constants -// ---------------------------------------------------------------------------- - - -//----------------------------------------------------------------------------- -// internal classes -//----------------------------------------------------------------------------- - -class WXDLLEXPORT wxListHeaderWindow; -class WXDLLEXPORT wxListMainWindow; - -//----------------------------------------------------------------------------- -// wxListCtrl -//----------------------------------------------------------------------------- - -class WXDLLEXPORT wxGenericListCtrl: public wxControl -{ -public: - - wxGenericListCtrl(); - wxGenericListCtrl( wxWindow *parent, - wxWindowID winid = wxID_ANY, - const wxPoint &pos = wxDefaultPosition, - const wxSize &size = wxDefaultSize, - long style = wxLC_ICON, - const wxValidator& validator = wxDefaultValidator, - const wxString &name = wxListCtrlNameStr) - { - Create(parent, winid, pos, size, style, validator, name); - } - virtual ~wxGenericListCtrl(); - - bool Create( wxWindow *parent, - wxWindowID winid = wxID_ANY, - const wxPoint &pos = wxDefaultPosition, - const wxSize &size = wxDefaultSize, - long style = wxLC_ICON, - const wxValidator& validator = wxDefaultValidator, - const wxString &name = wxListCtrlNameStr); - - bool GetColumn( int col, wxListItem& item ) const; - bool SetColumn( int col, wxListItem& item ); - int GetColumnWidth( int col ) const; - bool SetColumnWidth( int col, int width); - int GetCountPerPage() const; // not the same in wxGLC as in Windows, I think - wxRect GetViewRect() const; - - bool GetItem( wxListItem& info ) const; - bool SetItem( wxListItem& info ) ; - long SetItem( long index, int col, const wxString& label, int imageId = -1 ); - int GetItemState( long item, long stateMask ) const; - bool SetItemState( long item, long state, long stateMask); - bool SetItemImage( long item, int image, int selImage = -1 ); - bool SetItemColumnImage( long item, long column, int image ); - wxString GetItemText( long item ) const; - void SetItemText( long item, const wxString& str ); - wxUIntPtr GetItemData( long item ) const; -#if wxABI_VERSION >= 20804 - bool SetItemPtrData(long item, wxUIntPtr data); -#endif // wxABI 2.8.4+ - bool SetItemData(long item, long data); - bool GetItemRect( long item, wxRect& rect, int code = wxLIST_RECT_BOUNDS ) const; - bool GetItemPosition( long item, wxPoint& pos ) const; - bool SetItemPosition( long item, const wxPoint& pos ); // not supported in wxGLC - int GetItemCount() const; - int GetColumnCount() const; - void SetItemSpacing( int spacing, bool isSmall = false ); - wxSize GetItemSpacing() const; - void SetItemTextColour( long item, const wxColour& col); - wxColour GetItemTextColour( long item ) const; - void SetItemBackgroundColour( long item, const wxColour &col); - wxColour GetItemBackgroundColour( long item ) const; - void SetItemFont( long item, const wxFont &f); - wxFont GetItemFont( long item ) const; - int GetSelectedItemCount() const; - wxColour GetTextColour() const; - void SetTextColour(const wxColour& col); - long GetTopItem() const; - - void SetSingleStyle( long style, bool add = true ) ; - void SetWindowStyleFlag( long style ); - void RecreateWindow() {} - long GetNextItem( long item, int geometry = wxLIST_NEXT_ALL, int state = wxLIST_STATE_DONTCARE ) const; - wxImageList *GetImageList( int which ) const; - void SetImageList( wxImageList *imageList, int which ); - void AssignImageList( wxImageList *imageList, int which ); - bool Arrange( int flag = wxLIST_ALIGN_DEFAULT ); // always wxLIST_ALIGN_LEFT in wxGLC - - void ClearAll(); - bool DeleteItem( long item ); - bool DeleteAllItems(); - bool DeleteAllColumns(); - bool DeleteColumn( int col ); - - void SetItemCount(long count); - - wxTextCtrl *EditLabel(long item, - wxClassInfo* textControlClass = CLASSINFO(wxTextCtrl)); - wxTextCtrl* GetEditControl() const; - void Edit( long item ) { EditLabel(item); } - - bool EnsureVisible( long item ); - long FindItem( long start, const wxString& str, bool partial = false ); - long FindItem( long start, wxUIntPtr data ); - long FindItem( long start, const wxPoint& pt, int direction ); // not supported in wxGLC - long HitTest( const wxPoint& point, int& flags, long *pSubItem = NULL ) const; - long InsertItem(wxListItem& info); - long InsertItem( long index, const wxString& label ); - long InsertItem( long index, int imageIndex ); - long InsertItem( long index, const wxString& label, int imageIndex ); - long InsertColumn( long col, wxListItem& info ); - long InsertColumn( long col, const wxString& heading, - int format = wxLIST_FORMAT_LEFT, int width = -1 ); - bool ScrollList( int dx, int dy ); - bool SortItems( wxListCtrlCompare fn, long data ); - bool Update( long item ); - virtual void Update(); - - // are we in report mode? - bool InReportView() const { return HasFlag(wxLC_REPORT); } - - // are we in virtual report mode? - bool IsVirtual() const { return HasFlag(wxLC_VIRTUAL); } - - // do we have a header window? - bool HasHeader() const - { return InReportView() && !HasFlag(wxLC_NO_HEADER); } - - // refresh items selectively (only useful for virtual list controls) - void RefreshItem(long item); - void RefreshItems(long itemFrom, long itemTo); - -#if WXWIN_COMPATIBILITY_2_6 - // obsolete, don't use - wxDEPRECATED( int GetItemSpacing( bool isSmall ) const ); -#endif // WXWIN_COMPATIBILITY_2_6 - - virtual wxVisualAttributes GetDefaultAttributes() const - { - return GetClassDefaultAttributes(GetWindowVariant()); - } - - static wxVisualAttributes - GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL); - - // implementation only from now on - // ------------------------------- - - void OnInternalIdle( ); - void OnSize( wxSizeEvent &event ); - - // We have to hand down a few functions - virtual void Refresh(bool eraseBackground = true, - const wxRect *rect = NULL); - - virtual void Freeze(); - virtual void Thaw(); - - virtual bool SetBackgroundColour( const wxColour &colour ); - virtual bool SetForegroundColour( const wxColour &colour ); - virtual wxColour GetBackgroundColour() const; - virtual wxColour GetForegroundColour() const; - virtual bool SetFont( const wxFont &font ); - virtual bool SetCursor( const wxCursor &cursor ); - - virtual int GetScrollPos(int orient) const; - virtual void SetScrollPos(int orient, int pos, bool refresh = true); - -#if wxUSE_DRAG_AND_DROP - virtual void SetDropTarget( wxDropTarget *dropTarget ); - virtual wxDropTarget *GetDropTarget() const; -#endif - - virtual bool ShouldInheritColours() const { return false; } - virtual void SetFocus(); - - // implementation - // -------------- - - wxImageList *m_imageListNormal; - wxImageList *m_imageListSmall; - wxImageList *m_imageListState; // what's that ? - bool m_ownsImageListNormal, - m_ownsImageListSmall, - m_ownsImageListState; - wxListHeaderWindow *m_headerWin; - wxListMainWindow *m_mainWin; - wxCoord m_headerHeight; - -protected: - virtual bool DoPopupMenu( wxMenu *menu, int x, int y ); - - // take into account the coordinates difference between the container - // window and the list control window itself here - virtual void DoClientToScreen( int *x, int *y ) const; - virtual void DoScreenToClient( int *x, int *y ) const; - - virtual wxSize DoGetBestSize() const; - - // return the text for the given column of the given item - virtual wxString OnGetItemText(long item, long column) const; - - // return the icon for the given item. In report view, OnGetItemImage will - // only be called for the first column. See OnGetItemColumnImage for - // details. - virtual int OnGetItemImage(long item) const; - - // return the icon for the given item and column. - virtual int OnGetItemColumnImage(long item, long column) const; - - // return the attribute for the item (may return NULL if none) - virtual wxListItemAttr *OnGetItemAttr(long item) const; - - // it calls our OnGetXXX() functions - friend class WXDLLEXPORT wxListMainWindow; - -private: - // create the header window - void CreateHeaderWindow(); - - // calculate and set height of the header - void CalculateAndSetHeaderHeight(); - - // reposition the header and the main window in the report view depending - // on whether it should be shown or not - void ResizeReportView(bool showHeader); - - DECLARE_EVENT_TABLE() - DECLARE_DYNAMIC_CLASS(wxGenericListCtrl) -}; - -#if (!defined(__WXMSW__) || defined(__WXUNIVERSAL__)) && (!defined(__WXMAC__) || defined(__WXUNIVERSAL__)) -/* - * wxListCtrl has to be a real class or we have problems with - * the run-time information. - */ - -class WXDLLEXPORT wxListCtrl: public wxGenericListCtrl -{ - DECLARE_DYNAMIC_CLASS(wxListCtrl) - -public: - wxListCtrl() {} - - wxListCtrl(wxWindow *parent, wxWindowID winid = wxID_ANY, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = wxLC_ICON, - const wxValidator &validator = wxDefaultValidator, - const wxString &name = wxListCtrlNameStr) - : wxGenericListCtrl(parent, winid, pos, size, style, validator, name) - { - } - -}; -#endif // !__WXMSW__ || __WXUNIVERSAL__ - -#endif // _WX_GENERIC_LISTCTRL_H_ diff --git a/wxWidgets/include/wx/generic/logg.h b/wxWidgets/include/wx/generic/logg.h deleted file mode 100644 index 855c0c2f34..0000000000 --- a/wxWidgets/include/wx/generic/logg.h +++ /dev/null @@ -1,129 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/generic/logg.h -// Purpose: Assorted wxLogXXX functions, and wxLog (sink for logs) -// Author: Vadim Zeitlin -// Modified by: -// Created: 29/01/98 -// RCS-ID: $Id: logg.h 41020 2006-09-05 20:47:48Z VZ $ -// Copyright: (c) 1998 Vadim Zeitlin -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_LOGG_H_ -#define _WX_LOGG_H_ - -#if wxUSE_GUI - -// ---------------------------------------------------------------------------- -// the following log targets are only compiled in if the we're compiling the -// GUI part (andnot just the base one) of the library, they're implemented in -// src/generic/logg.cpp *and not src/common/log.cpp unlike all the rest) -// ---------------------------------------------------------------------------- - -#if wxUSE_TEXTCTRL - -// log everything to a text window (GUI only of course) -class WXDLLEXPORT wxLogTextCtrl : public wxLog -{ -public: - wxLogTextCtrl(wxTextCtrl *pTextCtrl); - -protected: - // implement sink function - virtual void DoLogString(const wxChar *szString, time_t t); - -private: - // the control we use - wxTextCtrl *m_pTextCtrl; - - DECLARE_NO_COPY_CLASS(wxLogTextCtrl) -}; - -#endif // wxUSE_TEXTCTRL - -// ---------------------------------------------------------------------------- -// GUI log target, the default one for wxWidgets programs -// ---------------------------------------------------------------------------- - -#if wxUSE_LOGGUI - -class WXDLLEXPORT wxLogGui : public wxLog -{ -public: - // ctor - wxLogGui(); - - // show all messages that were logged since the last Flush() - virtual void Flush(); - -protected: - virtual void DoLog(wxLogLevel level, const wxChar *szString, time_t t); - - // empty everything - void Clear(); - - wxArrayString m_aMessages; // the log message texts - wxArrayInt m_aSeverity; // one of wxLOG_XXX values - wxArrayLong m_aTimes; // the time of each message - bool m_bErrors, // do we have any errors? - m_bWarnings, // any warnings? - m_bHasMessages; // any messages at all? - -}; - -#endif // wxUSE_LOGGUI - -// ---------------------------------------------------------------------------- -// (background) log window: this class forwards all log messages to the log -// target which was active when it was instantiated, but also collects them -// to the log window. This window has it's own menu which allows the user to -// close it, clear the log contents or save it to the file. -// ---------------------------------------------------------------------------- - -#if wxUSE_LOGWINDOW - -class WXDLLEXPORT wxLogWindow : public wxLogPassThrough -{ -public: - wxLogWindow(wxWindow *pParent, // the parent frame (can be NULL) - const wxChar *szTitle, // the title of the frame - bool bShow = true, // show window immediately? - bool bPassToOld = true); // pass messages to the old target? - - virtual ~wxLogWindow(); - - // window operations - // show/hide the log window - void Show(bool bShow = true); - // retrieve the pointer to the frame - wxFrame *GetFrame() const; - - // overridables - // called immediately after the log frame creation allowing for - // any extra initializations - virtual void OnFrameCreate(wxFrame *frame); - // called if the user closes the window interactively, will not be - // called if it is destroyed for another reason (such as when program - // exits) - return true from here to allow the frame to close, false - // to prevent this from happening - virtual bool OnFrameClose(wxFrame *frame); - // called right before the log frame is going to be deleted: will - // always be called unlike OnFrameClose() - virtual void OnFrameDelete(wxFrame *frame); - -protected: - virtual void DoLog(wxLogLevel level, const wxChar *szString, time_t t); - virtual void DoLogString(const wxChar *szString, time_t t); - -private: - wxLogFrame *m_pLogFrame; // the log frame - - DECLARE_NO_COPY_CLASS(wxLogWindow) -}; - -#endif // wxUSE_LOGWINDOW - -#endif // wxUSE_GUI - -#endif // _WX_LOGG_H_ - diff --git a/wxWidgets/include/wx/generic/mask.h b/wxWidgets/include/wx/generic/mask.h deleted file mode 100644 index 41c85e3c42..0000000000 --- a/wxWidgets/include/wx/generic/mask.h +++ /dev/null @@ -1,54 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: wx/generic/mask.h -// Purpose: generic implementation of wxMask -// Author: Vadim Zeitlin -// Created: 2006-09-28 -// RCS-ID: $Id: mask.h 41495 2006-09-28 23:02:39Z VZ $ -// Copyright: (c) 2006 Vadim Zeitlin -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_GENERIC_MASKG_H_ -#define _WX_GENERIC_MASKG_H_ - -// ---------------------------------------------------------------------------- -// generic wxMask implementation -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxMask : public wxMaskBase -{ -public: - wxMask() { } - wxMask(const wxBitmap& bitmap, const wxColour& colour) - { - InitFromColour(bitmap, colour); - } - -#if wxUSE_PALETTE - wxMask(const wxBitmap& bitmap, int paletteIndex) - { - Create(bitmap, paletteIndex); - } -#endif // wxUSE_PALETTE - - wxMask(const wxBitmap& bitmap) - { - InitFromMonoBitmap(bitmap); - } - - // implementation-only from now on - wxBitmap GetBitmap() const { return m_bitmap; } - -private: - // implement wxMaskBase pure virtuals - virtual void FreeData(); - virtual bool InitFromColour(const wxBitmap& bitmap, const wxColour& colour); - virtual bool InitFromMonoBitmap(const wxBitmap& bitmap); - - wxBitmap m_bitmap; - - DECLARE_DYNAMIC_CLASS(wxMask) -}; - -#endif // _WX_GENERIC_MASKG_H_ - diff --git a/wxWidgets/include/wx/generic/mdig.h b/wxWidgets/include/wx/generic/mdig.h deleted file mode 100644 index 99d9243995..0000000000 --- a/wxWidgets/include/wx/generic/mdig.h +++ /dev/null @@ -1,335 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/generic/mdig.h -// Purpose: Generic MDI (Multiple Document Interface) classes -// Author: Hans Van Leemputten -// Modified by: -// Created: 29/07/2002 -// RCS-ID: $Id: mdig.h 41223 2006-09-14 17:36:18Z PC $ -// Copyright: (c) Hans Van Leemputten -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_MDIG_H_ -#define _WX_MDIG_H_ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -#include "wx/frame.h" -#include "wx/panel.h" -#include "wx/notebook.h" - -extern WXDLLEXPORT_DATA(const wxChar) wxStatusLineNameStr[]; - - -//----------------------------------------------------------------------------- -// classes -//----------------------------------------------------------------------------- - -class WXDLLEXPORT wxGenericMDIParentFrame; -class WXDLLEXPORT wxGenericMDIClientWindow; -class WXDLLEXPORT wxGenericMDIChildFrame; - -//----------------------------------------------------------------------------- -// wxGenericMDIParentFrame -//----------------------------------------------------------------------------- - -class WXDLLEXPORT wxGenericMDIParentFrame: public wxFrame -{ -public: - wxGenericMDIParentFrame(); - wxGenericMDIParentFrame(wxWindow *parent, - wxWindowID winid, - const wxString& title, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = wxDEFAULT_FRAME_STYLE | wxVSCROLL | wxHSCROLL, - const wxString& name = wxFrameNameStr); - - virtual ~wxGenericMDIParentFrame(); - bool Create( wxWindow *parent, - wxWindowID winid, - const wxString& title, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = wxDEFAULT_FRAME_STYLE | wxVSCROLL | wxHSCROLL, - const wxString& name = wxFrameNameStr ); - -#if wxUSE_MENUS - wxMenu* GetWindowMenu() const { return m_pWindowMenu; }; - void SetWindowMenu(wxMenu* pMenu); - - virtual void SetMenuBar(wxMenuBar *pMenuBar); -#endif // wxUSE_MENUS - - void SetChildMenuBar(wxGenericMDIChildFrame *pChild); - - virtual bool ProcessEvent(wxEvent& event); - - wxGenericMDIChildFrame *GetActiveChild() const; - inline void SetActiveChild(wxGenericMDIChildFrame* pChildFrame); - - wxGenericMDIClientWindow *GetClientWindow() const; - virtual wxGenericMDIClientWindow *OnCreateClient(); - - virtual void Cascade() { /* Has no effect */ } - virtual void Tile(wxOrientation WXUNUSED(orient) = wxHORIZONTAL) { } - virtual void ArrangeIcons() { /* Has no effect */ } - virtual void ActivateNext(); - virtual void ActivatePrevious(); - -protected: - wxGenericMDIClientWindow *m_pClientWindow; - wxGenericMDIChildFrame *m_pActiveChild; -#if wxUSE_MENUS - wxMenu *m_pWindowMenu; - wxMenuBar *m_pMyMenuBar; -#endif // wxUSE_MENUS - -protected: - void Init(); - -#if wxUSE_MENUS - void RemoveWindowMenu(wxMenuBar *pMenuBar); - void AddWindowMenu(wxMenuBar *pMenuBar); - - void DoHandleMenu(wxCommandEvent &event); -#endif // wxUSE_MENUS - - virtual void DoGetClientSize(int *width, int *height) const; - -private: - DECLARE_EVENT_TABLE() - DECLARE_DYNAMIC_CLASS(wxGenericMDIParentFrame) -}; - -//----------------------------------------------------------------------------- -// wxGenericMDIChildFrame -//----------------------------------------------------------------------------- - -class WXDLLEXPORT wxGenericMDIChildFrame: public wxPanel -{ -public: - wxGenericMDIChildFrame(); - wxGenericMDIChildFrame( wxGenericMDIParentFrame *parent, - wxWindowID winid, - const wxString& title, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = wxDEFAULT_FRAME_STYLE, - const wxString& name = wxFrameNameStr ); - - virtual ~wxGenericMDIChildFrame(); - bool Create( wxGenericMDIParentFrame *parent, - wxWindowID winid, - const wxString& title, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = wxDEFAULT_FRAME_STYLE, - const wxString& name = wxFrameNameStr ); - -#if wxUSE_MENUS - virtual void SetMenuBar( wxMenuBar *menu_bar ); - virtual wxMenuBar *GetMenuBar() const; -#endif // wxUSE_MENUS - - virtual void SetTitle(const wxString& title); - virtual wxString GetTitle() const; - - virtual void Activate(); - -#if wxUSE_STATUSBAR - // no status bars - virtual wxStatusBar* CreateStatusBar( int WXUNUSED(number) = 1, - long WXUNUSED(style) = 1, - wxWindowID WXUNUSED(winid) = 1, - const wxString& WXUNUSED(name) = wxEmptyString) - { return (wxStatusBar*)NULL; } - - virtual wxStatusBar *GetStatusBar() const { return (wxStatusBar*)NULL; } - virtual void SetStatusText( const wxString &WXUNUSED(text), int WXUNUSED(number)=0 ) {} - virtual void SetStatusWidths( int WXUNUSED(n), const int WXUNUSED(widths_field)[] ) {} -#endif - - // no size hints - virtual void DoSetSizeHints( int WXUNUSED(minW), - int WXUNUSED(minH), - int WXUNUSED(maxW) = wxDefaultCoord, - int WXUNUSED(maxH) = wxDefaultCoord, - int WXUNUSED(incW) = wxDefaultCoord, - int WXUNUSED(incH) = wxDefaultCoord) {} - -#if wxUSE_TOOLBAR - // no toolbar bars - virtual wxToolBar* CreateToolBar( long WXUNUSED(style), - wxWindowID WXUNUSED(winid), - const wxString& WXUNUSED(name) ) - { return (wxToolBar*)NULL; } - virtual wxToolBar *GetToolBar() const { return (wxToolBar*)NULL; } -#endif - - // no icon - void SetIcon( const wxIcon& WXUNUSED(icon) ) { } - void SetIcons( const wxIconBundle& WXUNUSED(icons) ) { } - - // no maximize etc - virtual void Maximize( bool WXUNUSED(maximize) = true) { /* Has no effect */ } - virtual void Restore() { /* Has no effect */ } - virtual void Iconize(bool WXUNUSED(iconize) = true) { /* Has no effect */ } - virtual bool IsMaximized() const { return true; } - virtual bool IsIconized() const { return false; } - virtual bool ShowFullScreen(bool WXUNUSED(show), long WXUNUSED(style)) { return false; } - virtual bool IsFullScreen() const { return false; } - - virtual bool IsTopLevel() const { return false; } - - void OnMenuHighlight(wxMenuEvent& event); - void OnActivate(wxActivateEvent& event); - - // The next 2 are copied from top level... - void OnCloseWindow(wxCloseEvent& event); - void OnSize(wxSizeEvent& event); - - void SetMDIParentFrame(wxGenericMDIParentFrame* parentFrame); - wxGenericMDIParentFrame* GetMDIParentFrame() const; - -protected: - wxGenericMDIParentFrame *m_pMDIParentFrame; - wxRect m_MDIRect; - wxString m_Title; - -#if wxUSE_MENUS - wxMenuBar *m_pMenuBar; -#endif // wxUSE_MENUS - -protected: - void Init(); - - virtual void DoMoveWindow(int x, int y, int width, int height); - - // This function needs to be called when a size change is confirmed, - // we needed this function to prevent any body from the outside - // changing the panel... it messes the UI layout when we would allow it. - void ApplyMDIChildFrameRect(); - -private: - DECLARE_DYNAMIC_CLASS(wxGenericMDIChildFrame) - DECLARE_EVENT_TABLE() - - friend class wxGenericMDIClientWindow; -}; - -//----------------------------------------------------------------------------- -// wxGenericMDIClientWindow -//----------------------------------------------------------------------------- - -class WXDLLEXPORT wxGenericMDIClientWindow: public wxNotebook -{ -public: - wxGenericMDIClientWindow(); - wxGenericMDIClientWindow( wxGenericMDIParentFrame *parent, long style = 0 ); - virtual ~wxGenericMDIClientWindow(); - virtual bool CreateClient( wxGenericMDIParentFrame *parent, long style = wxVSCROLL | wxHSCROLL ); - - virtual int SetSelection(size_t nPage); - -protected: - void PageChanged(int OldSelection, int newSelection); - - void OnPageChanged(wxNotebookEvent& event); - void OnSize(wxSizeEvent& event); - -private: - DECLARE_DYNAMIC_CLASS(wxGenericMDIClientWindow) - DECLARE_EVENT_TABLE() -}; - - -/* - * Define normal wxMDI classes based on wxGenericMDI - */ - -#ifndef wxUSE_GENERIC_MDI_AS_NATIVE -#if defined(__WXUNIVERSAL__) || defined(__WXPM__) || defined(__WXCOCOA__) -#define wxUSE_GENERIC_MDI_AS_NATIVE 1 -#else -#define wxUSE_GENERIC_MDI_AS_NATIVE 0 -#endif -#endif // wxUSE_GENERIC_MDI_AS_NATIVE - -#if wxUSE_GENERIC_MDI_AS_NATIVE - -class wxMDIChildFrame ; - -//----------------------------------------------------------------------------- -// wxMDIParentFrame -//----------------------------------------------------------------------------- - -class WXDLLEXPORT wxMDIParentFrame: public wxGenericMDIParentFrame -{ -public: - wxMDIParentFrame() {} - wxMDIParentFrame(wxWindow *parent, - wxWindowID winid, - const wxString& title, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = wxDEFAULT_FRAME_STYLE | wxVSCROLL | wxHSCROLL, - const wxString& name = wxFrameNameStr) - :wxGenericMDIParentFrame(parent, winid, title, pos, size, style, name) - { - } - - wxMDIChildFrame * GetActiveChild() const ; - - -private: - DECLARE_DYNAMIC_CLASS(wxMDIParentFrame) -}; - -//----------------------------------------------------------------------------- -// wxMDIChildFrame -//----------------------------------------------------------------------------- - -class WXDLLEXPORT wxMDIChildFrame: public wxGenericMDIChildFrame -{ -public: - wxMDIChildFrame() {} - - wxMDIChildFrame( wxGenericMDIParentFrame *parent, - wxWindowID winid, - const wxString& title, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = wxDEFAULT_FRAME_STYLE, - const wxString& name = wxFrameNameStr ) - :wxGenericMDIChildFrame(parent, winid, title, pos, size, style, name) - { - } -private: - DECLARE_DYNAMIC_CLASS(wxMDIChildFrame) -}; - -//----------------------------------------------------------------------------- -// wxMDIClientWindow -//----------------------------------------------------------------------------- - -class WXDLLEXPORT wxMDIClientWindow: public wxGenericMDIClientWindow -{ -public: - wxMDIClientWindow() {} - - wxMDIClientWindow( wxGenericMDIParentFrame *parent, long style = 0 ) - :wxGenericMDIClientWindow(parent, style) - { - } - -private: - DECLARE_DYNAMIC_CLASS(wxMDIClientWindow) -}; - -#endif - -#endif - // _WX_MDIG_H_ diff --git a/wxWidgets/include/wx/generic/msgdlgg.h b/wxWidgets/include/wx/generic/msgdlgg.h deleted file mode 100644 index 46c5d599e7..0000000000 --- a/wxWidgets/include/wx/generic/msgdlgg.h +++ /dev/null @@ -1,44 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/generic/msgdlgg.h -// Purpose: Generic wxMessageDialog -// Author: Julian Smart -// Modified by: -// Created: 01/02/97 -// RCS-ID: $Id: msgdlgg.h 49765 2007-11-09 18:32:38Z DE $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef __MSGDLGH_G__ -#define __MSGDLGH_G__ - -#include "wx/defs.h" -#include "wx/dialog.h" - -// type is an 'or' (|) of wxOK, wxCANCEL, wxYES_NO -// Returns wxYES/NO/OK/CANCEL - -extern WXDLLEXPORT_DATA(const wxChar) wxMessageBoxCaptionStr[]; - -class WXDLLEXPORT wxGenericMessageDialog: public wxDialog, public wxMessageDialogBase -{ -DECLARE_DYNAMIC_CLASS(wxGenericMessageDialog) - -public: - wxGenericMessageDialog(wxWindow *parent, const wxString& message, - const wxString& caption = wxMessageBoxCaptionStr, - long style = wxOK|wxCENTRE, const wxPoint& pos = wxDefaultPosition); - - void OnYes(wxCommandEvent& event); - void OnNo(wxCommandEvent& event); - void OnCancel(wxCommandEvent& event); - -private: - DECLARE_EVENT_TABLE() -}; - -#if (!defined( __WXMSW__ ) && !defined( __WXMAC__) && !defined(__WXPM__) && !defined(__WXCOCOA__)) || defined(__WXUNIVERSAL__) -#define wxMessageDialog wxGenericMessageDialog -#endif - -#endif // __MSGDLGH_G__ diff --git a/wxWidgets/include/wx/generic/notebook.h b/wxWidgets/include/wx/generic/notebook.h deleted file mode 100644 index 2b9e109e27..0000000000 --- a/wxWidgets/include/wx/generic/notebook.h +++ /dev/null @@ -1,160 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: notebook.h -// Purpose: wxNotebook class (a.k.a. property sheet, tabbed dialog) -// Author: Julian Smart -// Modified by: -// RCS-ID: $Id: notebook.h 41738 2006-10-08 17:37:23Z VZ $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_NOTEBOOK_H_ -#define _WX_NOTEBOOK_H_ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- -#include "wx/event.h" -#include "wx/control.h" - -// ---------------------------------------------------------------------------- -// types -// ---------------------------------------------------------------------------- - -// fwd declarations -class WXDLLEXPORT wxImageList; -class WXDLLEXPORT wxWindow; -class WXDLLEXPORT wxTabView; - -// ---------------------------------------------------------------------------- -// wxNotebook -// ---------------------------------------------------------------------------- - -class WXDLLIMPEXP_CORE 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 = wxNotebookNameStr); - // Create() function - bool Create(wxWindow *parent, - wxWindowID id, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = 0, - const wxString& name = wxNotebookNameStr); - // dtor - virtual ~wxNotebook(); - - // accessors - // --------- - // Find the position of the wxNotebookPage, -1 if not found. - int FindPagePosition(wxNotebookPage* page) const; - - // 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); - // cycle thru the tabs - // void AdvanceSelection(bool bForward = true); - // get the currently selected page - int GetSelection() const { return m_nSelection; } - - // changes selected page without sending events - int ChangeSelection(size_t nPage); - - // set/get the title of a page - bool SetPageText(size_t nPage, const wxString& strText); - wxString GetPageText(size_t nPage) const; - - // get the number of rows for a control with wxNB_MULTILINE style (not all - // versions support it - they will always return 1 then) - virtual int GetRowCount() 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) - void SetPageSize(const wxSize& size); - // set the padding between tabs (in pixels) - void SetPadding(const wxSize& padding); - - // Sets the size of the tabs (assumes all tabs are the same size) - void SetTabSize(const wxSize& sz); - - // operations - // ---------- - // remove one page from the notebook, and delete the page. - bool DeletePage(size_t nPage); - bool DeletePage(wxNotebookPage* page); - // remove one page from the notebook, without deleting the page. - bool RemovePage(size_t nPage); - bool RemovePage(wxNotebookPage* page); - virtual wxWindow* DoRemovePage(size_t nPage); - - // 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); - - // callbacks - // --------- - void OnSize(wxSizeEvent& event); - void OnInternalIdle(); - void OnSelChange(wxNotebookEvent& event); - void OnSetFocus(wxFocusEvent& event); - void OnNavigationKey(wxNavigationKeyEvent& event); - - // base class virtuals - // ------------------- - virtual void Command(wxCommandEvent& event); - virtual void SetConstraintSizes(bool recurse = true); - virtual bool DoPhase(int nPhase); - - virtual wxSize CalcSizeFromPage(const wxSize& sizePage) const; - - // Implementation - - // wxNotebook on Motif uses a generic wxTabView to implement itself. - wxTabView *GetTabView() const { return m_tabView; } - void SetTabView(wxTabView *v) { m_tabView = v; } - - void OnMouseEvent(wxMouseEvent& event); - void OnPaint(wxPaintEvent& event); - - virtual wxRect GetAvailableClientSize(); - - // Implementation: calculate the layout of the view rect - // and resize the children if required - bool RefreshLayout(bool force = true); - -protected: - // common part of all ctors - void Init(); - - // helper functions - void ChangePage(int nOldSel, int nSel); // change pages - - int m_nSelection; // the current selection (-1 if none) - - wxTabView* m_tabView; - - DECLARE_DYNAMIC_CLASS(wxNotebook) - DECLARE_EVENT_TABLE() -}; - -#endif // _WX_NOTEBOOK_H_ diff --git a/wxWidgets/include/wx/generic/numdlgg.h b/wxWidgets/include/wx/generic/numdlgg.h deleted file mode 100644 index 06c0d2f017..0000000000 --- a/wxWidgets/include/wx/generic/numdlgg.h +++ /dev/null @@ -1,79 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/generic/numdlgg.h -// Purpose: wxNumberEntryDialog class -// Author: John Labenski -// Modified by: -// Created: 07.02.04 (extracted from textdlgg.cpp) -// RCS-ID: $Id: numdlgg.h 49563 2007-10-31 20:46:21Z VZ $ -// Copyright: (c) wxWidgets team -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef __NUMDLGH_G__ -#define __NUMDLGH_G__ - -#include "wx/defs.h" - -#if wxUSE_NUMBERDLG - -#include "wx/dialog.h" - -#if wxUSE_SPINCTRL - class WXDLLIMPEXP_FWD_CORE wxSpinCtrl; -#else - class WXDLLIMPEXP_FWD_CORE wxTextCtrl; -#endif // wxUSE_SPINCTRL - -// ---------------------------------------------------------------------------- -// wxNumberEntryDialog: a dialog with spin control, [ok] and [cancel] buttons -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxNumberEntryDialog : public wxDialog -{ -public: - wxNumberEntryDialog(wxWindow *parent, - const wxString& message, - const wxString& prompt, - const wxString& caption, - long value, long min, long max, - const wxPoint& pos = wxDefaultPosition); - - long GetValue() const { return m_value; } - - // implementation only - void OnOK(wxCommandEvent& event); - void OnCancel(wxCommandEvent& event); - -protected: - -#if wxUSE_SPINCTRL - wxSpinCtrl *m_spinctrl; -#else - wxTextCtrl *m_spinctrl; -#endif // wxUSE_SPINCTRL - - long m_value, m_min, m_max; - -private: - DECLARE_EVENT_TABLE() - DECLARE_DYNAMIC_CLASS(wxNumberEntryDialog) - DECLARE_NO_COPY_CLASS(wxNumberEntryDialog) -}; - -// ---------------------------------------------------------------------------- -// function to get a number from user -// ---------------------------------------------------------------------------- - -long WXDLLEXPORT -wxGetNumberFromUser(const wxString& message, - const wxString& prompt, - const wxString& caption, - long value = 0, - long min = 0, - long max = 100, - wxWindow *parent = (wxWindow *)NULL, - const wxPoint& pos = wxDefaultPosition); - -#endif // wxUSE_NUMBERDLG - -#endif // __NUMDLGH_G__ diff --git a/wxWidgets/include/wx/generic/paletteg.h b/wxWidgets/include/wx/generic/paletteg.h deleted file mode 100644 index 52fa95bc13..0000000000 --- a/wxWidgets/include/wx/generic/paletteg.h +++ /dev/null @@ -1,49 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/generic/paletteg.h -// Purpose: -// Author: Robert Roebling -// Created: 01/02/97 -// RCS-ID: $Id: paletteg.h 42752 2006-10-30 19:26:48Z VZ $ -// Copyright: (c) 1998 Robert Roebling and Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - - -#ifndef __WX_PALETTEG_H__ -#define __WX_PALETTEG_H__ - -#include "wx/defs.h" -#include "wx/object.h" -#include "wx/gdiobj.h" -#include "wx/gdicmn.h" - -//----------------------------------------------------------------------------- -// classes -//----------------------------------------------------------------------------- - -class WXDLLIMPEXP_CORE wxPalette; - -//----------------------------------------------------------------------------- -// wxPalette -//----------------------------------------------------------------------------- - -class WXDLLIMPEXP_CORE wxPalette: public wxPaletteBase -{ -public: - wxPalette(); - wxPalette( int n, const unsigned char *red, const unsigned char *green, const unsigned char *blue ); - virtual ~wxPalette(); - virtual bool Ok() const { return IsOk(); } - virtual bool IsOk() const; - - bool Create( int n, const unsigned char *red, const unsigned char *green, const unsigned char *blue); - int GetPixel( unsigned char red, unsigned char green, unsigned char blue ) const; - bool GetRGB( int pixel, unsigned char *red, unsigned char *green, unsigned char *blue ) const; - - virtual int GetColoursCount() const; - -private: - DECLARE_DYNAMIC_CLASS(wxPalette) -}; - -#endif // __WX_PALETTEG_H__ diff --git a/wxWidgets/include/wx/generic/panelg.h b/wxWidgets/include/wx/generic/panelg.h deleted file mode 100644 index f211a995cc..0000000000 --- a/wxWidgets/include/wx/generic/panelg.h +++ /dev/null @@ -1,95 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/generic/panelg.h -// Purpose: wxPanel: a container for child controls -// Author: Julian Smart -// Modified by: -// Created: 01/02/97 -// RCS-ID: $Id: panelg.h 49563 2007-10-31 20:46:21Z VZ $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_GENERIC_PANEL_H_ -#define _WX_GENERIC_PANEL_H_ - -// ---------------------------------------------------------------------------- -// headers and forward declarations -// ---------------------------------------------------------------------------- - -#include "wx/window.h" -#include "wx/containr.h" - -class WXDLLIMPEXP_FWD_CORE wxControlContainer; - -extern WXDLLEXPORT_DATA(const wxChar) wxPanelNameStr[]; - -// ---------------------------------------------------------------------------- -// wxPanel contains other controls and implements TAB traversal between them -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxPanel : public wxWindow -{ -public: - wxPanel() { Init(); } - - // Old-style constructor (no default values for coordinates to avoid - // ambiguity with the new one) - wxPanel(wxWindow *parent, - int x, int y, int width, int height, - long style = wxTAB_TRAVERSAL | wxNO_BORDER, - const wxString& name = wxPanelNameStr) - { - Init(); - - Create(parent, wxID_ANY, wxPoint(x, y), wxSize(width, height), style, name); - } - - // Constructor - wxPanel(wxWindow *parent, - wxWindowID winid = wxID_ANY, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = wxTAB_TRAVERSAL | wxNO_BORDER, - const wxString& name = wxPanelNameStr) - { - Init(); - - Create(parent, winid, pos, size, style, name); - } - - // Pseudo ctor - bool Create(wxWindow *parent, - wxWindowID winid = wxID_ANY, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = wxTAB_TRAVERSAL | wxNO_BORDER, - const wxString& name = wxPanelNameStr); - - virtual ~wxPanel(); - - // implementation from now on - // -------------------------- - - // calls layout for layout constraints and sizers - void OnSize(wxSizeEvent& event); - - virtual void InitDialog(); - -#ifdef __WXUNIVERSAL__ - virtual bool IsCanvasWindow() const { return true; } -#endif - - - WX_DECLARE_CONTROL_CONTAINER(); - -protected: - // common part of all ctors - void Init(); - -private: - DECLARE_DYNAMIC_CLASS_NO_COPY(wxPanel) - DECLARE_EVENT_TABLE() -}; - -#endif - // _WX_GENERIC_PANEL_H_ diff --git a/wxWidgets/include/wx/generic/printps.h b/wxWidgets/include/wx/generic/printps.h deleted file mode 100644 index 107a2a29be..0000000000 --- a/wxWidgets/include/wx/generic/printps.h +++ /dev/null @@ -1,68 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: printps.h -// Purpose: wxPostScriptPrinter, wxPostScriptPrintPreview -// wxGenericPageSetupDialog -// Author: Julian Smart -// Modified by: -// Created: 01/02/97 -// RCS-ID: $Id: printps.h 35650 2005-09-23 12:56:45Z MR $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef __PRINTPSH__ -#define __PRINTPSH__ - -#include "wx/prntbase.h" - -#if wxUSE_PRINTING_ARCHITECTURE && wxUSE_POSTSCRIPT - -// ---------------------------------------------------------------------------- -// Represents the printer: manages printing a wxPrintout object -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxPostScriptPrinter : public wxPrinterBase -{ -public: - wxPostScriptPrinter(wxPrintDialogData *data = (wxPrintDialogData *) NULL); - virtual ~wxPostScriptPrinter(); - - virtual bool Print(wxWindow *parent, wxPrintout *printout, bool prompt = true); - virtual wxDC* PrintDialog(wxWindow *parent); - virtual bool Setup(wxWindow *parent); - -private: - DECLARE_DYNAMIC_CLASS(wxPostScriptPrinter) -}; - -// ---------------------------------------------------------------------------- -// wxPrintPreview: programmer creates an object of this class to preview a -// wxPrintout. -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxPostScriptPrintPreview : public wxPrintPreviewBase -{ -public: - wxPostScriptPrintPreview(wxPrintout *printout, - wxPrintout *printoutForPrinting = (wxPrintout *) NULL, - wxPrintDialogData *data = (wxPrintDialogData *) NULL); - wxPostScriptPrintPreview(wxPrintout *printout, - wxPrintout *printoutForPrinting, - wxPrintData *data); - - virtual ~wxPostScriptPrintPreview(); - - virtual bool Print(bool interactive); - virtual void DetermineScaling(); - -private: - void Init(wxPrintout *printout, wxPrintout *printoutForPrinting); - -private: - DECLARE_CLASS(wxPostScriptPrintPreview) -}; - -#endif - -#endif -// __PRINTPSH__ diff --git a/wxWidgets/include/wx/generic/prntdlgg.h b/wxWidgets/include/wx/generic/prntdlgg.h deleted file mode 100644 index 2215e1066e..0000000000 --- a/wxWidgets/include/wx/generic/prntdlgg.h +++ /dev/null @@ -1,256 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: prntdlgg.h -// Purpose: wxGenericPrintDialog, wxGenericPrintSetupDialog, -// wxGenericPageSetupDialog -// Author: Julian Smart -// Modified by: -// Created: 01/02/97 -// RCS-ID: $Id: prntdlgg.h 49804 2007-11-10 01:09:42Z VZ $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef __PRINTDLGH_G_ -#define __PRINTDLGH_G_ - -#include "wx/defs.h" - -#if wxUSE_PRINTING_ARCHITECTURE - -#include "wx/dialog.h" -#include "wx/cmndata.h" -#include "wx/prntbase.h" -#include "wx/printdlg.h" -#include "wx/listctrl.h" - -#if wxUSE_POSTSCRIPT - #include "wx/dcps.h" -#endif - -class WXDLLIMPEXP_FWD_CORE wxTextCtrl; -class WXDLLIMPEXP_FWD_CORE wxButton; -class WXDLLIMPEXP_FWD_CORE wxCheckBox; -class WXDLLIMPEXP_FWD_CORE wxComboBox; -class WXDLLIMPEXP_FWD_CORE wxStaticText; -class WXDLLIMPEXP_FWD_CORE wxRadioBox; -class WXDLLIMPEXP_FWD_CORE wxPageSetupData; - -// ---------------------------------------------------------------------------- -// constants -// ---------------------------------------------------------------------------- - -// This is not clear why all these enums start with 10 or 30 but do not change it -// without good reason to avoid some subtle backwards compatibility breakage - -enum -{ - wxPRINTID_STATIC = 10, - wxPRINTID_RANGE, - wxPRINTID_FROM, - wxPRINTID_TO, - wxPRINTID_COPIES, - wxPRINTID_PRINTTOFILE, - wxPRINTID_SETUP -}; - -enum -{ - wxPRINTID_LEFTMARGIN = 30, - wxPRINTID_RIGHTMARGIN, - wxPRINTID_TOPMARGIN, - wxPRINTID_BOTTOMMARGIN -}; - -enum -{ - wxPRINTID_PRINTCOLOUR = 10, - wxPRINTID_ORIENTATION, - wxPRINTID_COMMAND, - wxPRINTID_OPTIONS, - wxPRINTID_PAPERSIZE, - wxPRINTID_PRINTER -}; - -#if wxUSE_POSTSCRIPT - -//---------------------------------------------------------------------------- -// wxPostScriptNativeData -//---------------------------------------------------------------------------- - -class WXDLLEXPORT wxPostScriptPrintNativeData: public wxPrintNativeDataBase -{ -public: - wxPostScriptPrintNativeData(); - virtual ~wxPostScriptPrintNativeData(); - - virtual bool TransferTo( wxPrintData &data ); - virtual bool TransferFrom( const wxPrintData &data ); - - virtual bool Ok() const { return IsOk(); } - virtual bool IsOk() const { return true; } - - const wxString& GetPrinterCommand() const { return m_printerCommand; } - const wxString& GetPrinterOptions() const { return m_printerOptions; } - const wxString& GetPreviewCommand() const { return m_previewCommand; } - const wxString& GetFontMetricPath() const { return m_afmPath; } - double GetPrinterScaleX() const { return m_printerScaleX; } - double GetPrinterScaleY() const { return m_printerScaleY; } - long GetPrinterTranslateX() const { return m_printerTranslateX; } - long GetPrinterTranslateY() const { return m_printerTranslateY; } - - void SetPrinterCommand(const wxString& command) { m_printerCommand = command; } - void SetPrinterOptions(const wxString& options) { m_printerOptions = options; } - void SetPreviewCommand(const wxString& command) { m_previewCommand = command; } - void SetFontMetricPath(const wxString& path) { m_afmPath = path; } - void SetPrinterScaleX(double x) { m_printerScaleX = x; } - void SetPrinterScaleY(double y) { m_printerScaleY = y; } - void SetPrinterScaling(double x, double y) { m_printerScaleX = x; m_printerScaleY = y; } - void SetPrinterTranslateX(long x) { m_printerTranslateX = x; } - void SetPrinterTranslateY(long y) { m_printerTranslateY = y; } - void SetPrinterTranslation(long x, long y) { m_printerTranslateX = x; m_printerTranslateY = y; } - -#if wxUSE_STREAMS - wxOutputStream *GetOutputStream() { return m_outputStream; } - void SetOutputStream( wxOutputStream *output ) { m_outputStream = output; } -#endif - -private: - wxString m_printerCommand; - wxString m_previewCommand; - wxString m_printerOptions; - wxString m_afmPath; - double m_printerScaleX; - double m_printerScaleY; - long m_printerTranslateX; - long m_printerTranslateY; -#if wxUSE_STREAMS - wxOutputStream *m_outputStream; -#endif - -private: - DECLARE_DYNAMIC_CLASS(wxPostScriptPrintNativeData) -}; - -// ---------------------------------------------------------------------------- -// Simulated Print and Print Setup dialogs for non-Windows platforms (and -// Windows using PostScript print/preview) -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxGenericPrintDialog : public wxPrintDialogBase -{ -public: - wxGenericPrintDialog(wxWindow *parent, - wxPrintDialogData* data = (wxPrintDialogData*)NULL); - wxGenericPrintDialog(wxWindow *parent, wxPrintData* data); - - virtual ~wxGenericPrintDialog(); - - void OnSetup(wxCommandEvent& event); - void OnRange(wxCommandEvent& event); - void OnOK(wxCommandEvent& event); - - virtual bool TransferDataFromWindow(); - virtual bool TransferDataToWindow(); - - virtual int ShowModal(); - - wxPrintData& GetPrintData() - { return m_printDialogData.GetPrintData(); } - - wxPrintDialogData& GetPrintDialogData() { return m_printDialogData; } - wxDC *GetPrintDC(); - -public: -// wxStaticText* m_printerMessage; - wxButton* m_setupButton; -// wxButton* m_helpButton; - wxRadioBox* m_rangeRadioBox; - wxTextCtrl* m_fromText; - wxTextCtrl* m_toText; - wxTextCtrl* m_noCopiesText; - wxCheckBox* m_printToFileCheckBox; -// wxCheckBox* m_collateCopiesCheckBox; - - wxPrintDialogData m_printDialogData; - -protected: - void Init(wxWindow *parent); - -private: - DECLARE_EVENT_TABLE() - DECLARE_DYNAMIC_CLASS(wxGenericPrintDialog) -}; - -class WXDLLEXPORT wxGenericPrintSetupDialog : public wxDialog -{ -public: - // There are no configuration options for the dialog, so we - // just pass the wxPrintData object (no wxPrintSetupDialogData class needed) - wxGenericPrintSetupDialog(wxWindow *parent, wxPrintData* data); - virtual ~wxGenericPrintSetupDialog(); - - void Init(wxPrintData* data); - - void OnPrinter(wxListEvent& event); - - virtual bool TransferDataFromWindow(); - virtual bool TransferDataToWindow(); - - virtual wxComboBox *CreatePaperTypeChoice(); - -public: - wxListCtrl* m_printerListCtrl; - wxRadioBox* m_orientationRadioBox; - wxTextCtrl* m_printerCommandText; - wxTextCtrl* m_printerOptionsText; - wxCheckBox* m_colourCheckBox; - wxComboBox* m_paperTypeChoice; - - wxPrintData m_printData; - wxPrintData& GetPrintData() { return m_printData; } - - // After pressing OK, write data here. - wxPrintData* m_targetData; - -private: - DECLARE_EVENT_TABLE() - DECLARE_CLASS(wxGenericPrintSetupDialog) -}; -#endif - // wxUSE_POSTSCRIPT - -class WXDLLEXPORT wxGenericPageSetupDialog : public wxPageSetupDialogBase -{ -public: - wxGenericPageSetupDialog(wxWindow *parent = NULL, - wxPageSetupDialogData* data = NULL); - virtual ~wxGenericPageSetupDialog(); - - virtual bool TransferDataFromWindow(); - virtual bool TransferDataToWindow(); - - virtual wxPageSetupDialogData& GetPageSetupDialogData(); - - void OnPrinter(wxCommandEvent& event); - wxComboBox *CreatePaperTypeChoice(int* x, int* y); - -public: - wxButton* m_printerButton; - wxRadioBox* m_orientationRadioBox; - wxTextCtrl* m_marginLeftText; - wxTextCtrl* m_marginTopText; - wxTextCtrl* m_marginRightText; - wxTextCtrl* m_marginBottomText; - wxComboBox* m_paperTypeChoice; - - wxPageSetupDialogData m_pageData; - -private: - DECLARE_EVENT_TABLE() - DECLARE_DYNAMIC_CLASS_NO_COPY(wxGenericPageSetupDialog) -}; - -#endif - -#endif -// __PRINTDLGH_G_ diff --git a/wxWidgets/include/wx/generic/progdlgg.h b/wxWidgets/include/wx/generic/progdlgg.h deleted file mode 100644 index 02210b3cad..0000000000 --- a/wxWidgets/include/wx/generic/progdlgg.h +++ /dev/null @@ -1,172 +0,0 @@ -//////////////////////////////////////////////////// -// Name: progdlgg.h -// Purpose: wxProgressDialog class -// Author: Karsten Ballueder -// Modified by: -// Created: 09.05.1999 -// RCS-ID: $Id: progdlgg.h 50711 2007-12-15 02:57:58Z VZ $ -// Copyright: (c) Karsten Ballueder -// Licence: wxWindows licence -//////////////////////////////////////////////////// - -#ifndef __PROGDLGH_G__ -#define __PROGDLGH_G__ - -#include "wx/defs.h" -#include "wx/progdlg.h" - -#if wxUSE_PROGRESSDLG - -#include "wx/dialog.h" - -class WXDLLIMPEXP_FWD_CORE wxButton; -class WXDLLIMPEXP_FWD_CORE wxGauge; -class WXDLLIMPEXP_FWD_CORE wxStaticText; - -/* Progress dialog which shows a moving progress bar. - Taken from the Mahogany project.*/ - -class WXDLLEXPORT wxProgressDialog : public wxDialog -{ -DECLARE_DYNAMIC_CLASS(wxProgressDialog) -public: - /* Creates and displays dialog, disables event handling for other - frames or parent frame to avoid recursion problems. - @param title title for window - @param message message to display in window - @param maximum value for status bar, if <= 0, no bar is shown - @param parent window or NULL - @param style is the bit mask of wxPD_XXX constants from wx/defs.h - */ - wxProgressDialog(const wxString &title, wxString const &message, - int maximum = 100, - wxWindow *parent = NULL, - int style = wxPD_APP_MODAL | wxPD_AUTO_HIDE); - /* Destructor. - Re-enables event handling for other windows. - */ - virtual ~wxProgressDialog(); - - /* Update the status bar to the new value. - @param value new value - @param newmsg if used, new message to display - @returns true if ABORT button has not been pressed - */ - virtual bool Update(int value, const wxString& newmsg = wxEmptyString, bool *skip = NULL); - - /* Switches the dialog to use a gauge in indeterminate mode and calls - wxGauge::Pulse() to show to the user a bit of progress */ - virtual bool Pulse(const wxString& newmsg = wxEmptyString, bool *skip = NULL); - - // Must provide overload to avoid hiding it (and warnings about it) - virtual void Update() { wxDialog::Update(); } - - /* Can be called to continue after the cancel button has been pressed, but - the program decided to continue the operation (e.g., user didn't - confirm it) - */ - void Resume(); - - virtual bool Show( bool show = true ); - -protected: - // callback for optional abort button - void OnCancel(wxCommandEvent& event); - - // callback for optional skip button - void OnSkip(wxCommandEvent& event); - - // callback to disable "hard" window closing - void OnClose(wxCloseEvent& event); - - // must be called to reenable the other windows temporarily disabled while - // the dialog was shown - void ReenableOtherWindows(); - -private: - // create the label with given text and another one to show the time nearby - // as the next windows in the sizer, returns the created control - wxStaticText *CreateLabel(const wxString& text, wxSizer *sizer); - - // updates the label message - void UpdateMessage(const wxString &newmsg); - - // common part of Update() and Pulse(), returns true if not cancelled - bool DoAfterUpdate(bool *skip); - - // shortcuts for enabling buttons - void EnableClose(); - void EnableSkip(bool enable=true); - void EnableAbort(bool enable=true); - inline void DisableSkip() { EnableSkip(false); } - inline void DisableAbort() { EnableAbort(false); } - - // the status bar - wxGauge *m_gauge; - // the message displayed - wxStaticText *m_msg; - // displayed elapsed, estimated, remaining time - class wxStaticText *m_elapsed, - *m_estimated, - *m_remaining; - // time when the dialog was created - unsigned long m_timeStart; - // time when the dialog was closed or cancelled - unsigned long m_timeStop; - // time between the moment the dialog was closed/cancelled and resume - unsigned long m_break; - - // parent top level window (may be NULL) - wxWindow *m_parentTop; - - // continue processing or not (return value for Update()) - enum - { - Uncancelable = -1, // dialog can't be canceled - Canceled, // can be cancelled and, in fact, was - Continue, // can be cancelled but wasn't - Finished // finished, waiting to be removed from screen - } m_state; - - // skip some portion - bool m_skip; - -#if !defined(__SMARTPHONE__) - // the abort and skip buttons (or NULL if none) - wxButton *m_btnAbort; - wxButton *m_btnSkip; -#endif - - // the maximum value - int m_maximum; - - // saves the time when elapsed time was updated so there is only one - // update per second - unsigned long m_last_timeupdate; - // tells how often a change of the estimated time has to be confirmed - // before it is actually displayed - this reduces the frequence of updates - // of estimated and remaining time - const int m_delay; - // counts the confirmations - int m_ctdelay; - unsigned long m_display_estimated; - - bool m_hasAbortButton, - m_hasSkipButton; - -#if defined(__WXMSW__ ) || defined(__WXPM__) - // the factor we use to always keep the value in 16 bit range as the native - // control only supports ranges from 0 to 65,535 - size_t m_factor; -#endif // __WXMSW__ - - // for wxPD_APP_MODAL case - class WXDLLIMPEXP_FWD_CORE wxWindowDisabler *m_winDisabler; - - DECLARE_EVENT_TABLE() - DECLARE_NO_COPY_CLASS(wxProgressDialog) -}; - -#endif // wxUSE_PROGRESSDLG - -#endif // __PROGDLGH_G__ diff --git a/wxWidgets/include/wx/generic/propdlg.h b/wxWidgets/include/wx/generic/propdlg.h deleted file mode 100644 index 8c21991164..0000000000 --- a/wxWidgets/include/wx/generic/propdlg.h +++ /dev/null @@ -1,163 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/generic/propdlg.h -// Purpose: wxPropertySheetDialog -// Author: Julian Smart -// Modified by: -// Created: 2005-03-12 -// RCS-ID: $Id: propdlg.h 49804 2007-11-10 01:09:42Z VZ $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_PROPDLG_H_ -#define _WX_PROPDLG_H_ - -#include "wx/defs.h" - -#if wxUSE_BOOKCTRL - -#include "wx/dialog.h" - -class WXDLLIMPEXP_FWD_CORE wxBookCtrlBase; - -//----------------------------------------------------------------------------- -// wxPropertySheetDialog -// A platform-independent properties dialog. -// -// * on PocketPC, a flat-look 'property sheet' notebook will be used, with -// no OK/Cancel/Help buttons -// * on other platforms, a normal notebook will be used, with standard buttons -// -// To use this class, call Create from your derived class. -// Then create pages and add to the book control. Finally call CreateButtons and -// LayoutDialog. -// -// For example: -// -// MyPropertySheetDialog::Create(...) -// { -// wxPropertySheetDialog::Create(...); -// -// // Add page -// wxPanel* panel = new wxPanel(GetBookCtrl(), ...); -// GetBookCtrl()->AddPage(panel, wxT("General")); -// -// CreateButtons(); -// LayoutDialog(); -// } -// -// Override CreateBookCtrl and AddBookCtrl to create and add a different -// kind of book control. -//----------------------------------------------------------------------------- - -// Use the platform default -#define wxPROPSHEET_DEFAULT 0x0001 - -// Use a notebook -#define wxPROPSHEET_NOTEBOOK 0x0002 - -// Use a toolbook -#define wxPROPSHEET_TOOLBOOK 0x0004 - -// Use a choicebook -#define wxPROPSHEET_CHOICEBOOK 0x0008 - -// Use a listbook -#define wxPROPSHEET_LISTBOOK 0x0010 - -// Use a wxButtonToolBar toolbook -#define wxPROPSHEET_BUTTONTOOLBOOK 0x0020 - -// Use a treebook -#define wxPROPSHEET_TREEBOOK 0x0040 - -// Shrink dialog to fit current page -#define wxPROPSHEET_SHRINKTOFIT 0x0100 - -class WXDLLIMPEXP_ADV wxPropertySheetDialog : public wxDialog -{ -public: - wxPropertySheetDialog() : wxDialog() { Init(); } - - wxPropertySheetDialog(wxWindow* parent, wxWindowID id, - const wxString& title, - const wxPoint& pos = wxDefaultPosition, - const wxSize& sz = wxDefaultSize, - long style = wxDEFAULT_DIALOG_STYLE, - const wxString& name = wxDialogNameStr) - { - Init(); - Create(parent, id, title, pos, sz, style, name); - } - - bool Create(wxWindow* parent, wxWindowID id, - const wxString& title, - const wxPoint& pos = wxDefaultPosition, - const wxSize& sz = wxDefaultSize, - long style = wxDEFAULT_DIALOG_STYLE, - const wxString& name = wxDialogNameStr); - -//// Accessors - - // Set and get the notebook - void SetBookCtrl(wxBookCtrlBase* book) { m_bookCtrl = book; } - wxBookCtrlBase* GetBookCtrl() const { return m_bookCtrl; } - - // Set and get the inner sizer - void SetInnerSize(wxSizer* sizer) { m_innerSizer = sizer; } - wxSizer* GetInnerSizer() const { return m_innerSizer ; } - - // Set and get the book style - void SetSheetStyle(long sheetStyle) { m_sheetStyle = sheetStyle; } - long GetSheetStyle() const { return m_sheetStyle ; } - - // Set and get the border around the whole dialog - void SetSheetOuterBorder(int border) { m_sheetOuterBorder = border; } - int GetSheetOuterBorder() const { return m_sheetOuterBorder ; } - - // Set and get the border around the book control only - void SetSheetInnerBorder(int border) { m_sheetInnerBorder = border; } - int GetSheetInnerBorder() const { return m_sheetInnerBorder ; } - -/// Operations - - // Creates the buttons (none on PocketPC) - virtual void CreateButtons(int flags = wxOK|wxCANCEL); - - // Lay out the dialog, to be called after pages have been created - virtual void LayoutDialog(int centreFlags = wxBOTH); - -/// Implementation - - // Creates the book control. If you want to use a different kind of - // control, override. - virtual wxBookCtrlBase* CreateBookCtrl(); - - // Adds the book control to the inner sizer. - virtual void AddBookCtrl(wxSizer* sizer); - - // Set the focus - void OnActivate(wxActivateEvent& event); - - // Resize dialog if necessary - void OnIdle(wxIdleEvent& event); - -private: - void Init(); - -protected: - wxBookCtrlBase* m_bookCtrl; - wxSizer* m_innerSizer; // sizer for extra space - long m_sheetStyle; - int m_sheetOuterBorder; - int m_sheetInnerBorder; - int m_selectedPage; - - DECLARE_DYNAMIC_CLASS(wxPropertySheetDialog) - DECLARE_EVENT_TABLE() -}; - -#endif // wxUSE_BOOKCTRL - -#endif // _WX_PROPDLG_H_ - diff --git a/wxWidgets/include/wx/generic/region.h b/wxWidgets/include/wx/generic/region.h deleted file mode 100644 index 1a27f289f5..0000000000 --- a/wxWidgets/include/wx/generic/region.h +++ /dev/null @@ -1,79 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/generic/region.h -// Purpose: generic wxRegion class -// Author: David Elliott -// Modified by: -// Created: 2004/04/12 -// RCS-ID: $Id: region.h 41429 2006-09-25 11:47:23Z VZ $ -// Copyright: (c) 2004 David Elliott -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_GENERIC_REGION_H__ -#define _WX_GENERIC_REGION_H__ - -class WXDLLEXPORT wxRegionGeneric : public wxRegionBase -{ -public: - wxRegionGeneric(wxCoord x, wxCoord y, wxCoord w, wxCoord h); - wxRegionGeneric(const wxPoint& topLeft, const wxPoint& bottomRight); - wxRegionGeneric(const wxRect& rect); - wxRegionGeneric(); - virtual ~wxRegionGeneric(); - - // wxRegionBase pure virtuals - virtual void Clear(); - virtual bool IsEmpty() const; - -protected: - virtual wxObjectRefData *CreateRefData() const; - virtual wxObjectRefData *CloneRefData(const wxObjectRefData *data) const; - - // wxRegionBase pure virtuals - virtual bool DoIsEqual(const wxRegion& region) const; - virtual bool DoGetBox(wxCoord& x, wxCoord& y, wxCoord& w, wxCoord& h) const; - virtual wxRegionContain DoContainsPoint(wxCoord x, wxCoord y) const; - virtual wxRegionContain DoContainsRect(const wxRect& rect) const; - - virtual bool DoOffset(wxCoord x, wxCoord y); - virtual bool DoUnionWithRect(const wxRect& rect); - virtual bool DoUnionWithRegion(const wxRegion& region); - virtual bool DoIntersect(const wxRegion& region); - virtual bool DoSubtract(const wxRegion& region); - virtual bool DoXor(const wxRegion& region); - - friend class WXDLLEXPORT wxRegionIteratorGeneric; -}; - -class WXDLLEXPORT wxRegionIteratorGeneric : public wxObject -{ -public: - wxRegionIteratorGeneric(); - wxRegionIteratorGeneric(const wxRegionGeneric& region); - wxRegionIteratorGeneric(const wxRegionIteratorGeneric& iterator); - virtual ~wxRegionIteratorGeneric(); - - wxRegionIteratorGeneric& operator=(const wxRegionIteratorGeneric& iterator); - - void Reset() { m_current = 0; } - void Reset(const wxRegionGeneric& region); - - operator bool () const { return HaveRects(); } - bool HaveRects() const; - - wxRegionIteratorGeneric& operator++(); - wxRegionIteratorGeneric 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; -private: - long m_current; - wxRegionGeneric m_region; -}; - -#endif // _WX_GENERIC_REGION_H__ diff --git a/wxWidgets/include/wx/generic/sashwin.h b/wxWidgets/include/wx/generic/sashwin.h deleted file mode 100644 index 457a4a7292..0000000000 --- a/wxWidgets/include/wx/generic/sashwin.h +++ /dev/null @@ -1,261 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: sashwin.h -// Purpose: wxSashWindow implementation. A sash window has an optional -// sash on each edge, allowing it to be dragged. An event -// is generated when the sash is released. -// Author: Julian Smart -// Modified by: -// Created: 01/02/97 -// RCS-ID: $Id: sashwin.h 41020 2006-09-05 20:47:48Z VZ $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_SASHWIN_H_G_ -#define _WX_SASHWIN_H_G_ - -#if wxUSE_SASH - -#include "wx/defs.h" -#include "wx/window.h" -#include "wx/string.h" - -#define wxSASH_DRAG_NONE 0 -#define wxSASH_DRAG_DRAGGING 1 -#define wxSASH_DRAG_LEFT_DOWN 2 - -enum wxSashEdgePosition { - wxSASH_TOP = 0, - wxSASH_RIGHT, - wxSASH_BOTTOM, - wxSASH_LEFT, - wxSASH_NONE = 100 -}; - -/* - * wxSashEdge represents one of the four edges of a window. - */ - -class WXDLLIMPEXP_ADV wxSashEdge -{ -public: - wxSashEdge() - { m_show = false; -#if WXWIN_COMPATIBILITY_2_6 - m_border = false; -#endif - m_margin = 0; } - - bool m_show; // Is the sash showing? -#if WXWIN_COMPATIBILITY_2_6 - bool m_border; // Do we draw a border? -#endif - int m_margin; // The margin size -}; - -/* - * wxSashWindow flags - */ - -#define wxSW_NOBORDER 0x0000 -//#define wxSW_3D 0x0010 -#define wxSW_BORDER 0x0020 -#define wxSW_3DSASH 0x0040 -#define wxSW_3DBORDER 0x0080 -#define wxSW_3D (wxSW_3DSASH | wxSW_3DBORDER) - -/* - * wxSashWindow allows any of its edges to have a sash which can be dragged - * to resize the window. The actual content window will be created as a child - * of wxSashWindow. - */ - -class WXDLLIMPEXP_ADV wxSashWindow: public wxWindow -{ -public: - // Default constructor - wxSashWindow() - { - Init(); - } - - // Normal constructor - wxSashWindow(wxWindow *parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, long style = wxSW_3D|wxCLIP_CHILDREN, const wxString& name = wxT("sashWindow")) - { - Init(); - Create(parent, id, pos, size, style, name); - } - - virtual ~wxSashWindow(); - - bool Create(wxWindow *parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, long style = wxSW_3D|wxCLIP_CHILDREN, const wxString& name = wxT("sashWindow")); - - // Set whether there's a sash in this position - void SetSashVisible(wxSashEdgePosition edge, bool sash); - - // Get whether there's a sash in this position - bool GetSashVisible(wxSashEdgePosition edge) const { return m_sashes[edge].m_show; } - -#if WXWIN_COMPATIBILITY_2_6 - // Set whether there's a border in this position - // This value is unused in wxSashWindow. - void SetSashBorder(wxSashEdgePosition edge, bool border) { m_sashes[edge].m_border = border; } - - // Get whether there's a border in this position - // This value is unused in wxSashWindow. - bool HasBorder(wxSashEdgePosition edge) const { return m_sashes[edge].m_border; } -#endif - - // Get border size - int GetEdgeMargin(wxSashEdgePosition edge) const { return m_sashes[edge].m_margin; } - - // Sets the default sash border size - void SetDefaultBorderSize(int width) { m_borderSize = width; } - - // Gets the default sash border size - int GetDefaultBorderSize() const { return m_borderSize; } - - // Sets the addition border size between child and sash window - void SetExtraBorderSize(int width) { m_extraBorderSize = width; } - - // Gets the addition border size between child and sash window - int GetExtraBorderSize() const { return m_extraBorderSize; } - - virtual void SetMinimumSizeX(int min) { m_minimumPaneSizeX = min; } - virtual void SetMinimumSizeY(int min) { m_minimumPaneSizeY = min; } - virtual int GetMinimumSizeX() const { return m_minimumPaneSizeX; } - virtual int GetMinimumSizeY() const { return m_minimumPaneSizeY; } - - virtual void SetMaximumSizeX(int max) { m_maximumPaneSizeX = max; } - virtual void SetMaximumSizeY(int max) { m_maximumPaneSizeY = max; } - virtual int GetMaximumSizeX() const { return m_maximumPaneSizeX; } - virtual int GetMaximumSizeY() const { return m_maximumPaneSizeY; } - -//////////////////////////////////////////////////////////////////////////// -// Implementation - - // Paints the border and sash - void OnPaint(wxPaintEvent& event); - - // Handles mouse events - void OnMouseEvent(wxMouseEvent& ev); - - // Adjusts the panes - void OnSize(wxSizeEvent& event); - -#if defined(__WXMSW__) || defined(__WXMAC__) - // Handle cursor correctly - void OnSetCursor(wxSetCursorEvent& event); -#endif // wxMSW - - // Draws borders - void DrawBorders(wxDC& dc); - - // Draws the sashes - void DrawSash(wxSashEdgePosition edge, wxDC& dc); - - // Draws the sashes - void DrawSashes(wxDC& dc); - - // Draws the sash tracker (for whilst moving the sash) - void DrawSashTracker(wxSashEdgePosition edge, int x, int y); - - // Tests for x, y over sash - wxSashEdgePosition SashHitTest(int x, int y, int tolerance = 2); - - // Resizes subwindows - void SizeWindows(); - - // Initialize colours - void InitColours(); - -private: - void Init(); - - wxSashEdge m_sashes[4]; - int m_dragMode; - wxSashEdgePosition m_draggingEdge; - int m_oldX; - int m_oldY; - int m_borderSize; - int m_extraBorderSize; - int m_firstX; - int m_firstY; - int m_minimumPaneSizeX; - int m_minimumPaneSizeY; - int m_maximumPaneSizeX; - int m_maximumPaneSizeY; - wxCursor* m_sashCursorWE; - wxCursor* m_sashCursorNS; - wxColour m_lightShadowColour; - wxColour m_mediumShadowColour; - wxColour m_darkShadowColour; - wxColour m_hilightColour; - wxColour m_faceColour; - bool m_mouseCaptured; - wxCursor* m_currentCursor; - -private: - DECLARE_DYNAMIC_CLASS(wxSashWindow) - DECLARE_EVENT_TABLE() - DECLARE_NO_COPY_CLASS(wxSashWindow) -}; - -BEGIN_DECLARE_EVENT_TYPES() - DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_ADV, - wxEVT_SASH_DRAGGED, wxEVT_FIRST + 1200) -END_DECLARE_EVENT_TYPES() - -enum wxSashDragStatus -{ - wxSASH_STATUS_OK, - wxSASH_STATUS_OUT_OF_RANGE -}; - -class WXDLLIMPEXP_ADV wxSashEvent: public wxCommandEvent -{ -public: - wxSashEvent(int id = 0, wxSashEdgePosition edge = wxSASH_NONE) - { - m_eventType = (wxEventType) wxEVT_SASH_DRAGGED; - m_id = id; - m_edge = edge; - } - - void SetEdge(wxSashEdgePosition edge) { m_edge = edge; } - wxSashEdgePosition GetEdge() const { return m_edge; } - - //// The rectangle formed by the drag operation - void SetDragRect(const wxRect& rect) { m_dragRect = rect; } - wxRect GetDragRect() const { return m_dragRect; } - - //// Whether the drag caused the rectangle to be reversed (e.g. - //// dragging the top below the bottom) - void SetDragStatus(wxSashDragStatus status) { m_dragStatus = status; } - wxSashDragStatus GetDragStatus() const { return m_dragStatus; } - -private: - wxSashEdgePosition m_edge; - wxRect m_dragRect; - wxSashDragStatus m_dragStatus; - -private: - DECLARE_DYNAMIC_CLASS_NO_COPY(wxSashEvent) -}; - -typedef void (wxEvtHandler::*wxSashEventFunction)(wxSashEvent&); - -#define wxSashEventHandler(func) \ - (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxSashEventFunction, &func) - -#define EVT_SASH_DRAGGED(id, fn) \ - wx__DECLARE_EVT1(wxEVT_SASH_DRAGGED, id, wxSashEventHandler(fn)) -#define EVT_SASH_DRAGGED_RANGE(id1, id2, fn) \ - wx__DECLARE_EVT2(wxEVT_SASH_DRAGGED, id1, id2, wxSashEventHandler(fn)) - -#endif // wxUSE_SASH - -#endif - // _WX_SASHWIN_H_G_ diff --git a/wxWidgets/include/wx/generic/scrolwin.h b/wxWidgets/include/wx/generic/scrolwin.h deleted file mode 100644 index 1677315fc8..0000000000 --- a/wxWidgets/include/wx/generic/scrolwin.h +++ /dev/null @@ -1,27 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/generic/scrolwin.h -// Purpose: wxGenericScrolledWindow class -// Author: Julian Smart -// Modified by: -// Created: 01/02/97 -// RCS-ID: $Id: scrolwin.h 35875 2005-10-10 18:24:27Z VZ $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_GENERIC_SCROLLWIN_H_ -#define _WX_GENERIC_SCROLLWIN_H_ - -// ---------------------------------------------------------------------------- -// headers and constants -// ---------------------------------------------------------------------------- - -#include "wx/window.h" -#include "wx/panel.h" - -// ---------------------------------------------------------------------------- -// wxGenericScrolledWindow -// ---------------------------------------------------------------------------- - -#endif // _WX_GENERIC_SCROLLWIN_H_ - diff --git a/wxWidgets/include/wx/generic/spinctlg.h b/wxWidgets/include/wx/generic/spinctlg.h deleted file mode 100644 index 7267b18573..0000000000 --- a/wxWidgets/include/wx/generic/spinctlg.h +++ /dev/null @@ -1,183 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/generic/spinctlg.h -// Purpose: generic wxSpinCtrl class -// Author: Vadim Zeitlin -// Modified by: -// Created: 28.10.99 -// RCS-ID: $Id: spinctlg.h 61872 2009-09-09 22:37:05Z VZ $ -// Copyright: (c) Vadim Zeitlin -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_GENERIC_SPINCTRL_H_ -#define _WX_GENERIC_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 - -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 = wxID_ANY, - 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 = wxT("wxSpinCtrl")) - { - Init(); - Create(parent, id, value, pos, size, style, min, max, initial, name); - } - - bool Create(wxWindow *parent, - wxWindowID id = wxID_ANY, - 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 = wxT("wxSpinCtrl")); - - virtual ~wxSpinCtrl(); - - // operations - void SetValue(int val); - void SetValue(const wxString& text); - void SetRange(int min, int max); - void SetSelection(long from, long to); - - // 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); - virtual bool Reparent(wxWindow *newParent); - - // 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 = wxID_ANY, - 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 = wxT("wxSpinCtrl")) - { - Create(parent, id, value, pos, size, style, min, max, initial, name); - } - - bool Create(wxWindow *parent, - wxWindowID id = wxID_ANY, - 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 = wxT("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_GENERIC_SPINCTRL_H_ - diff --git a/wxWidgets/include/wx/generic/splash.h b/wxWidgets/include/wx/generic/splash.h deleted file mode 100644 index ff49d630d5..0000000000 --- a/wxWidgets/include/wx/generic/splash.h +++ /dev/null @@ -1,92 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: splash.h -// Purpose: Splash screen class -// Author: Julian Smart -// Modified by: -// Created: 28/6/2000 -// RCS-ID: $Id: splash.h 53135 2008-04-12 02:31:04Z VZ $ -// Copyright: (c) Julian Smart -// Licence: wxWindows Licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_SPLASH_H_ -#define _WX_SPLASH_H_ - -#include "wx/bitmap.h" -#include "wx/timer.h" -#include "wx/frame.h" - - -/* - * A window for displaying a splash screen - */ - -#define wxSPLASH_CENTRE_ON_PARENT 0x01 -#define wxSPLASH_CENTRE_ON_SCREEN 0x02 -#define wxSPLASH_NO_CENTRE 0x00 -#define wxSPLASH_TIMEOUT 0x04 -#define wxSPLASH_NO_TIMEOUT 0x00 - -class WXDLLIMPEXP_FWD_ADV wxSplashScreenWindow; - -/* - * wxSplashScreen - */ - -class WXDLLIMPEXP_ADV wxSplashScreen: public wxFrame -{ -public: - // for RTTI macros only - wxSplashScreen() {} - wxSplashScreen(const wxBitmap& bitmap, long splashStyle, int milliseconds, - wxWindow* parent, wxWindowID id, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = wxSIMPLE_BORDER|wxFRAME_NO_TASKBAR|wxSTAY_ON_TOP); - virtual ~wxSplashScreen(); - - void OnCloseWindow(wxCloseEvent& event); - void OnNotify(wxTimerEvent& event); - - long GetSplashStyle() const { return m_splashStyle; } - wxSplashScreenWindow* GetSplashWindow() const { return m_window; } - int GetTimeout() const { return m_milliseconds; } - -protected: - wxSplashScreenWindow* m_window; - long m_splashStyle; - int m_milliseconds; - wxTimer m_timer; - - DECLARE_DYNAMIC_CLASS(wxSplashScreen) - DECLARE_EVENT_TABLE() - DECLARE_NO_COPY_CLASS(wxSplashScreen) -}; - -/* - * wxSplashScreenWindow - */ - -class WXDLLIMPEXP_ADV wxSplashScreenWindow: public wxWindow -{ -public: - wxSplashScreenWindow(const wxBitmap& bitmap, wxWindow* parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxNO_BORDER); - - void OnPaint(wxPaintEvent& event); - void OnEraseBackground(wxEraseEvent& event); - void OnMouseEvent(wxMouseEvent& event); - void OnChar(wxKeyEvent& event); - - void SetBitmap(const wxBitmap& bitmap) { m_bitmap = bitmap; } - wxBitmap& GetBitmap() { return m_bitmap; } - -protected: - wxBitmap m_bitmap; - - DECLARE_EVENT_TABLE() - DECLARE_NO_COPY_CLASS(wxSplashScreenWindow) -}; - - -#endif - // _WX_SPLASH_H_ diff --git a/wxWidgets/include/wx/generic/splitter.h b/wxWidgets/include/wx/generic/splitter.h deleted file mode 100644 index b8695fa518..0000000000 --- a/wxWidgets/include/wx/generic/splitter.h +++ /dev/null @@ -1,406 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/splitter.h -// Purpose: wxSplitterWindow class -// Author: Julian Smart -// Modified by: -// Created: 01/02/97 -// RCS-ID: $Id: splitter.h 61872 2009-09-09 22:37:05Z VZ $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_GENERIC_SPLITTER_H_ -#define _WX_GENERIC_SPLITTER_H_ - -#include "wx/window.h" // base class declaration -#include "wx/containr.h" // wxControlContainer - -class WXDLLIMPEXP_FWD_CORE wxSplitterEvent; - -// --------------------------------------------------------------------------- -// splitter constants -// --------------------------------------------------------------------------- - -enum wxSplitMode -{ - wxSPLIT_HORIZONTAL = 1, - wxSPLIT_VERTICAL -}; - -enum -{ - wxSPLIT_DRAG_NONE, - wxSPLIT_DRAG_DRAGGING, - wxSPLIT_DRAG_LEFT_DOWN -}; - -// --------------------------------------------------------------------------- -// wxSplitterWindow maintains one or two panes, with -// an optional vertical or horizontal split which -// can be used with the mouse or programmatically. -// --------------------------------------------------------------------------- - -// TODO: -// 1) Perhaps make the borders sensitive to dragging in order to create a split. -// The MFC splitter window manages scrollbars as well so is able to -// put sash buttons on the scrollbars, but we probably don't want to go down -// this path. -// 2) for wxWidgets 2.0, we must find a way to set the WS_CLIPCHILDREN style -// to prevent flickering. (WS_CLIPCHILDREN doesn't work in all cases so can't be -// standard). - -class WXDLLEXPORT wxSplitterWindow: public wxWindow -{ -public: - -//////////////////////////////////////////////////////////////////////////// -// Public API - - // Default constructor - wxSplitterWindow() - { - Init(); - } - - // Normal constructor - wxSplitterWindow(wxWindow *parent, wxWindowID id = wxID_ANY, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = wxSP_3D, - const wxString& name = wxT("splitter")) - { - Init(); - Create(parent, id, pos, size, style, name); - } - - virtual ~wxSplitterWindow(); - - bool Create(wxWindow *parent, wxWindowID id = wxID_ANY, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = wxSP_3D, - const wxString& name = wxT("splitter")); - - // Gets the only or left/top pane - wxWindow *GetWindow1() const { return m_windowOne; } - - // Gets the right/bottom pane - wxWindow *GetWindow2() const { return m_windowTwo; } - - // Sets the split mode - void SetSplitMode(int mode) - { - wxASSERT_MSG( mode == wxSPLIT_VERTICAL || mode == wxSPLIT_HORIZONTAL, - wxT("invalid split mode") ); - - m_splitMode = (wxSplitMode)mode; - } - - // Gets the split mode - wxSplitMode GetSplitMode() const { return m_splitMode; } - - // Initialize with one window - void Initialize(wxWindow *window); - - // Associates the given window with window 2, drawing the appropriate sash - // and changing the split mode. - // Does nothing and returns false if the window is already split. - // A sashPosition of 0 means choose a default sash position, - // negative sashPosition specifies the size of right/lower pane as it's - // absolute value rather than the size of left/upper pane. - virtual bool SplitVertically(wxWindow *window1, - wxWindow *window2, - int sashPosition = 0) - { return DoSplit(wxSPLIT_VERTICAL, window1, window2, sashPosition); } - virtual bool SplitHorizontally(wxWindow *window1, - wxWindow *window2, - int sashPosition = 0) - { return DoSplit(wxSPLIT_HORIZONTAL, window1, window2, sashPosition); } - - // Removes the specified (or second) window from the view - // Doesn't actually delete the window. - bool Unsplit(wxWindow *toRemove = (wxWindow *) NULL); - - // Replaces one of the windows with another one (neither old nor new - // parameter should be NULL) - bool ReplaceWindow(wxWindow *winOld, wxWindow *winNew); - - // Make sure the child window sizes are updated. This is useful - // for reducing flicker by updating the sizes before a - // window is shown, if you know the overall size is correct. - void UpdateSize(); - - // Is the window split? - bool IsSplit() const { return (m_windowTwo != NULL); } - - // Sets the sash size - void SetSashSize(int width) { m_sashSize = width; } - - // Sets the border size - void SetBorderSize(int WXUNUSED(width)) { } - - // Gets the sash size - int GetSashSize() const; - - // Gets the border size - int GetBorderSize() const; - - // Set the sash position - void SetSashPosition(int position, bool redraw = true); - - // Gets the sash position - int GetSashPosition() const { return m_sashPosition; } - - // Set the sash gravity - void SetSashGravity(double gravity); - - // Gets the sash gravity - double GetSashGravity() const { return m_sashGravity; } - - // If this is zero, we can remove panes by dragging the sash. - void SetMinimumPaneSize(int min); - int GetMinimumPaneSize() const { return m_minimumPaneSize; } - - // NB: the OnXXX() functions below are for backwards compatibility only, - // don't use them in new code but handle the events instead! - - // called when the sash position is about to change, may return a new value - // for the sash or -1 to prevent the change from happening at all - virtual int OnSashPositionChanging(int newSashPosition); - - // Called when the sash position is about to be changed, return - // false from here to prevent the change from taking place. - // Repositions sash to minimum position if pane would be too small. - // newSashPosition here is always positive or zero. - virtual bool OnSashPositionChange(int newSashPosition); - - // If the sash is moved to an extreme position, a subwindow - // is removed from the splitter window, and the app is - // notified. The app should delete or hide the window. - virtual void OnUnsplit(wxWindow *removed); - - // Called when the sash is double-clicked. - // The default behaviour is to remove the sash if the - // minimum pane size is zero. - virtual void OnDoubleClickSash(int x, int y); - -//////////////////////////////////////////////////////////////////////////// -// Implementation - - // Paints the border and sash - void OnPaint(wxPaintEvent& event); - - // Handles mouse events - void OnMouseEvent(wxMouseEvent& ev); - - // Adjusts the panes - void OnSize(wxSizeEvent& event); - - // In live mode, resize child windows in idle time - void OnInternalIdle(); - - // Draws the sash - virtual void DrawSash(wxDC& dc); - - // Draws the sash tracker (for whilst moving the sash) - virtual void DrawSashTracker(int x, int y); - - // Tests for x, y over sash - virtual bool SashHitTest(int x, int y, int tolerance = 5); - - // Resizes subwindows - virtual void SizeWindows(); - - void SetNeedUpdating(bool needUpdating) { m_needUpdating = needUpdating; } - bool GetNeedUpdating() const { return m_needUpdating ; } - -#ifdef __WXMAC__ - virtual bool MacClipGrandChildren() const { return true ; } -#endif - -protected: - // event handlers -#if defined(__WXMSW__) || defined(__WXMAC__) - void OnSetCursor(wxSetCursorEvent& event); -#endif // wxMSW - - // send the given event, return false if the event was processed and vetoed - // by the user code - bool DoSendEvent(wxSplitterEvent& event); - - // common part of all ctors - void Init(); - - // common part of SplitVertically() and SplitHorizontally() - bool DoSplit(wxSplitMode mode, - wxWindow *window1, wxWindow *window2, - int sashPosition); - - // adjusts sash position with respect to min. pane and window sizes - int AdjustSashPosition(int sashPos) const; - - // get either width or height depending on the split mode - int GetWindowSize() const; - - // convert the user specified sash position which may be > 0 (as is), < 0 - // (specifying the size of the right pane) or 0 (use default) to the real - // position to be passed to DoSetSashPosition() - int ConvertSashPosition(int sashPos) const; - - // set the real sash position, sashPos here must be positive - // - // returns true if the sash position has been changed, false otherwise - bool DoSetSashPosition(int sashPos); - - // set the sash position and send an event about it having been changed - void SetSashPositionAndNotify(int sashPos); - - // callbacks executed when we detect that the mouse has entered or left - // the sash - virtual void OnEnterSash(); - virtual void OnLeaveSash(); - - // set the cursor appropriate for the current split mode - void SetResizeCursor(); - - // redraw the splitter if its "hotness" changed if necessary - void RedrawIfHotSensitive(bool isHot); - - // return the best size of the splitter equal to best sizes of its - // subwindows - virtual wxSize DoGetBestSize() const; - - - wxSplitMode m_splitMode; - wxWindow* m_windowOne; - wxWindow* m_windowTwo; - int m_dragMode; - int m_oldX; - int m_oldY; - int m_sashPosition; // Number of pixels from left or top - double m_sashGravity; - int m_sashSize; - wxSize m_lastSize; - int m_requestedSashPosition; - int m_sashPositionCurrent; // while dragging - int m_firstX; - int m_firstY; - int m_minimumPaneSize; - wxCursor m_sashCursorWE; - wxCursor m_sashCursorNS; - wxPen *m_sashTrackerPen; - - // when in live mode, set this to true to resize children in idle - bool m_needUpdating:1; - bool m_permitUnsplitAlways:1; - bool m_isHot:1; - bool m_checkRequestedSashPosition:1; - -private: - WX_DECLARE_CONTROL_CONTAINER(); - - DECLARE_DYNAMIC_CLASS(wxSplitterWindow) - DECLARE_EVENT_TABLE() - DECLARE_NO_COPY_CLASS(wxSplitterWindow) -}; - -// ---------------------------------------------------------------------------- -// event class and macros -// ---------------------------------------------------------------------------- - -// we reuse the same class for all splitter event types because this is the -// usual wxWin convention, but the three event types have different kind of -// data associated with them, so the accessors can be only used if the real -// event type matches with the one for which the accessors make sense -class WXDLLEXPORT wxSplitterEvent : public wxNotifyEvent -{ -public: - wxSplitterEvent(wxEventType type = wxEVT_NULL, - wxSplitterWindow *splitter = (wxSplitterWindow *)NULL) - : wxNotifyEvent(type) - { - SetEventObject(splitter); - if (splitter) m_id = splitter->GetId(); - } - - // SASH_POS_CHANGED methods - - // setting the sash position to -1 prevents the change from taking place at - // all - void SetSashPosition(int pos) - { - wxASSERT( GetEventType() == wxEVT_COMMAND_SPLITTER_SASH_POS_CHANGED - || GetEventType() == wxEVT_COMMAND_SPLITTER_SASH_POS_CHANGING); - - m_data.pos = pos; - } - - int GetSashPosition() const - { - wxASSERT( GetEventType() == wxEVT_COMMAND_SPLITTER_SASH_POS_CHANGED - || GetEventType() == wxEVT_COMMAND_SPLITTER_SASH_POS_CHANGING); - - return m_data.pos; - } - - // UNSPLIT event methods - wxWindow *GetWindowBeingRemoved() const - { - wxASSERT( GetEventType() == wxEVT_COMMAND_SPLITTER_UNSPLIT ); - - return m_data.win; - } - - // DCLICK event methods - int GetX() const - { - wxASSERT( GetEventType() == wxEVT_COMMAND_SPLITTER_DOUBLECLICKED ); - - return m_data.pt.x; - } - - int GetY() const - { - wxASSERT( GetEventType() == wxEVT_COMMAND_SPLITTER_DOUBLECLICKED ); - - return m_data.pt.y; - } - -private: - friend class WXDLLIMPEXP_FWD_CORE wxSplitterWindow; - - // data for the different types of event - union - { - int pos; // position for SASH_POS_CHANGED event - wxWindow *win; // window being removed for UNSPLIT event - struct - { - int x, y; - } pt; // position of double click for DCLICK event - } m_data; - - DECLARE_DYNAMIC_CLASS_NO_COPY(wxSplitterEvent) -}; - -typedef void (wxEvtHandler::*wxSplitterEventFunction)(wxSplitterEvent&); - -#define wxSplitterEventHandler(func) \ - (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxSplitterEventFunction, &func) - -#define wx__DECLARE_SPLITTEREVT(evt, id, fn) \ - wx__DECLARE_EVT1(wxEVT_COMMAND_SPLITTER_ ## evt, id, wxSplitterEventHandler(fn)) - -#define EVT_SPLITTER_SASH_POS_CHANGED(id, fn) \ - wx__DECLARE_SPLITTEREVT(SASH_POS_CHANGED, id, fn) - -#define EVT_SPLITTER_SASH_POS_CHANGING(id, fn) \ - wx__DECLARE_SPLITTEREVT(SASH_POS_CHANGING, id, fn) - -#define EVT_SPLITTER_DCLICK(id, fn) \ - wx__DECLARE_SPLITTEREVT(DOUBLECLICKED, id, fn) - -#define EVT_SPLITTER_UNSPLIT(id, fn) \ - wx__DECLARE_SPLITTEREVT(UNSPLIT, id, fn) - -#endif // _WX_GENERIC_SPLITTER_H_ diff --git a/wxWidgets/include/wx/generic/srchctlg.h b/wxWidgets/include/wx/generic/srchctlg.h deleted file mode 100644 index d28856c568..0000000000 --- a/wxWidgets/include/wx/generic/srchctlg.h +++ /dev/null @@ -1,275 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/generic/srchctlg.h -// Purpose: generic wxSearchCtrl class -// Author: Vince Harron -// Created: 2006-02-19 -// RCS-ID: $Id: srchctlg.h 53135 2008-04-12 02:31:04Z VZ $ -// Copyright: Vince Harron -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_GENERIC_SEARCHCTRL_H_ -#define _WX_GENERIC_SEARCHCTRL_H_ - -#if wxUSE_SEARCHCTRL - -#include "wx/bitmap.h" - -class WXDLLIMPEXP_FWD_CORE wxSearchButton; -class WXDLLIMPEXP_FWD_CORE wxSearchTextCtrl; - -// ---------------------------------------------------------------------------- -// wxSearchCtrl is a combination of wxTextCtrl and wxSearchButton -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxSearchCtrl : public wxSearchCtrlBase -{ -public: - // creation - // -------- - - wxSearchCtrl(); - wxSearchCtrl(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 = wxSearchCtrlNameStr); - - virtual ~wxSearchCtrl(); - - 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 = wxSearchCtrlNameStr); - -#if wxUSE_MENUS - // get/set search button menu - // -------------------------- - virtual void SetMenu( wxMenu* menu ); - virtual wxMenu* GetMenu(); -#endif // wxUSE_MENUS - - // get/set search options - // ---------------------- - virtual void ShowSearchButton( bool show ); - virtual bool IsSearchButtonVisible() const; - - virtual void ShowCancelButton( bool show ); - virtual bool IsCancelButtonVisible() const; - -#if wxABI_VERSION >= 20802 - // TODO: In 2.9 these should probably be virtual, and declared in the base class... - void SetDescriptiveText(const wxString& text); - wxString GetDescriptiveText() const; -#endif - - // accessors - // --------- - - virtual wxString GetValue() const; - virtual void SetValue(const wxString& value); - - virtual wxString GetRange(long from, long to) const; - - virtual int GetLineLength(long lineNo) const; - virtual wxString GetLineText(long lineNo) const; - virtual int GetNumberOfLines() const; - - virtual bool IsModified() const; - virtual bool IsEditable() const; - - // more readable flag testing methods - virtual bool IsSingleLine() const; - virtual bool IsMultiLine() const; - - // If the return values from and to are the same, there is no selection. - virtual void GetSelection(long* from, long* to) const; - - virtual wxString GetStringSelection() const; - - // operations - // ---------- - - // editing - virtual void Clear(); - virtual void Replace(long from, long to, const wxString& value); - virtual void Remove(long from, long to); - - // load/save the controls contents from/to the file - virtual bool LoadFile(const wxString& file); - virtual bool SaveFile(const wxString& file = wxEmptyString); - - // 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 WXUNUSED(len)); - - // 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); - - // insert the character which would have resulted from this key event, - // return true if anything has been inserted - virtual bool EmulateKeyPress(const wxKeyEvent& event); - - // 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 GetStyle(long position, wxTextAttr& style); - virtual bool SetDefaultStyle(const wxTextAttr& style); - virtual const wxTextAttr& GetDefaultStyle() const; - - // 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); - - // find the character at position given in pixels - // - // NB: pt is in device coords (not adjusted for the client area origin nor - // scrolling) - virtual wxTextCtrlHitTestResult HitTest(const wxPoint& pt, long *pos) const; - virtual wxTextCtrlHitTestResult HitTest(const wxPoint& pt, - wxTextCoord *col, - wxTextCoord *row) const; - - // 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 wxTextPos GetLastPosition() const; - - virtual void SetSelection(long from, long to); - virtual void SelectAll(); - virtual void SetEditable(bool editable); - -#if 0 - - // override streambuf method -#if wxHAS_TEXT_WINDOW_STREAM - int overflow(int i); -#endif // wxHAS_TEXT_WINDOW_STREAM - - // stream-like insertion operators: these are always available, whether we - // were, or not, compiled with streambuf support - wxTextCtrl& operator<<(const wxString& s); - wxTextCtrl& operator<<(int i); - wxTextCtrl& operator<<(long i); - wxTextCtrl& operator<<(float f); - wxTextCtrl& operator<<(double d); - wxTextCtrl& operator<<(const wxChar c); -#endif - - // do the window-specific processing after processing the update event - virtual void DoUpdateWindowUI(wxUpdateUIEvent& event); - - virtual bool ShouldInheritColours() const; - - // wxWindow overrides - virtual bool SetFont(const wxFont& font); - - // search control generic only - void SetSearchBitmap( const wxBitmap& bitmap ); - void SetCancelBitmap( const wxBitmap& bitmap ); -#if wxUSE_MENUS - void SetSearchMenuBitmap( const wxBitmap& bitmap ); -#endif // wxUSE_MENUS - -protected: - virtual void DoSetValue(const wxString& value, int flags = 0); - - // override the base class virtuals involved into geometry calculations - virtual wxSize DoGetBestSize() const; - virtual void DoMoveWindow(int x, int y, int width, int height); - virtual void LayoutControls(int x, int y, int width, int height); - - virtual void RecalcBitmaps(); - - void Init(); - - virtual wxBitmap RenderSearchBitmap( int x, int y, bool renderDrop ); - virtual wxBitmap RenderCancelBitmap( int x, int y ); - - virtual void OnSearchButton( wxCommandEvent& event ); - - void OnSetFocus( wxFocusEvent& event ); - void OnSize( wxSizeEvent& event ); - - bool HasMenu() const - { -#if wxUSE_MENUS - return m_menu != NULL; -#else // !wxUSE_MENUS - return false; -#endif // wxUSE_MENUS/!wxUSE_MENUS - } - -private: - friend class wxSearchButton; - -#if wxUSE_MENUS - void PopupSearchMenu(); -#endif // wxUSE_MENUS - - // the subcontrols - wxSearchTextCtrl *m_text; - wxSearchButton *m_searchButton; - wxSearchButton *m_cancelButton; -#if wxUSE_MENUS - wxMenu *m_menu; -#endif // wxUSE_MENUS - - bool m_searchButtonVisible; - bool m_cancelButtonVisible; - - bool m_searchBitmapUser; - bool m_cancelBitmapUser; -#if wxUSE_MENUS - bool m_searchMenuBitmapUser; -#endif // wxUSE_MENUS - - wxBitmap m_searchBitmap; - wxBitmap m_cancelBitmap; -#if wxUSE_MENUS - wxBitmap m_searchMenuBitmap; -#endif // wxUSE_MENUS - -private: - DECLARE_DYNAMIC_CLASS(wxSearchCtrl) - - DECLARE_EVENT_TABLE() -}; - -#endif // wxUSE_SEARCHCTRL - -#endif // _WX_GENERIC_SEARCHCTRL_H_ - diff --git a/wxWidgets/include/wx/generic/statline.h b/wxWidgets/include/wx/generic/statline.h deleted file mode 100644 index 114ec35929..0000000000 --- a/wxWidgets/include/wx/generic/statline.h +++ /dev/null @@ -1,62 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: generic/statline.h -// Purpose: a generic wxStaticLine class -// Author: Vadim Zeitlin -// Created: 28.06.99 -// Version: $Id: statline.h 43874 2006-12-09 14:52:59Z VZ $ -// Copyright: (c) 1998 Vadim Zeitlin -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_GENERIC_STATLINE_H_ -#define _WX_GENERIC_STATLINE_H_ - -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 = wxID_ANY, - const wxPoint &pos = wxDefaultPosition, - const wxSize &size = wxDefaultSize, - long style = wxLI_HORIZONTAL, - const wxString &name = wxStaticLineNameStr ) - { - Create(parent, id, pos, size, style, name); - } - - virtual ~wxStaticLine(); - - bool Create( wxWindow *parent, - wxWindowID id = wxID_ANY, - const wxPoint &pos = wxDefaultPosition, - const wxSize &size = wxDefaultSize, - long style = wxLI_HORIZONTAL, - const wxString &name = wxStaticLineNameStr ); - - // it's necessary to override this wxWindow function because we - // will want to return the main widget for m_statbox - // - WXWidget GetMainWidget() const; - - // override wxWindow methods to make things work - virtual void DoSetSize(int x, int y, int width, int height, - int sizeFlags = wxSIZE_AUTO); - virtual void DoMoveWindow(int x, int y, int width, int height); -protected: - // we implement the static line using a static box - wxStaticBox *m_statbox; -}; - -#endif // _WX_GENERIC_STATLINE_H_ - diff --git a/wxWidgets/include/wx/generic/statusbr.h b/wxWidgets/include/wx/generic/statusbr.h deleted file mode 100644 index 4852acde57..0000000000 --- a/wxWidgets/include/wx/generic/statusbr.h +++ /dev/null @@ -1,107 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/generic/statusbr.h -// Purpose: wxStatusBarGeneric class -// Author: Julian Smart -// Modified by: VZ at 05.02.00 to derive from wxStatusBarBase -// Created: 01/02/97 -// RCS-ID: $Id: statusbr.h 41200 2006-09-13 19:10:31Z ABX $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_GENERIC_STATUSBR_H_ -#define _WX_GENERIC_STATUSBR_H_ - -#include "wx/defs.h" - -#if wxUSE_STATUSBAR - -#include "wx/pen.h" -#include "wx/arrstr.h" - -class WXDLLEXPORT wxStatusBarGeneric : public wxStatusBarBase -{ -public: - wxStatusBarGeneric() { Init(); } - wxStatusBarGeneric(wxWindow *parent, - wxWindowID winid = wxID_ANY, - long style = wxST_SIZEGRIP, - const wxString& name = wxStatusBarNameStr) - { - Init(); - - Create(parent, winid, style, name); - } - - virtual ~wxStatusBarGeneric(); - - bool Create(wxWindow *parent, wxWindowID winid = wxID_ANY, - long style = wxST_SIZEGRIP, - const wxString& name = wxStatusBarNameStr); - - // Create status line - virtual void SetFieldsCount(int number = 1, - const int *widths = (const int *) NULL); - - // Set status line text - virtual void SetStatusText(const wxString& text, int number = 0); - virtual wxString GetStatusText(int number = 0) const; - - // Set status line widths - virtual void SetStatusWidths(int n, const int widths_field[]); - - // Get the position and size of the field's internal bounding rectangle - virtual bool GetFieldRect(int i, wxRect& rect) const; - - // sets the minimal vertical size of the status bar - virtual void SetMinHeight(int height); - - virtual int GetBorderX() const { return m_borderX; } - virtual int GetBorderY() const { return m_borderY; } - - //////////////////////////////////////////////////////////////////////// - // Implementation - - virtual void DrawFieldText(wxDC& dc, int i); - virtual void DrawField(wxDC& dc, int i); - - void SetBorderX(int x); - void SetBorderY(int y); - - void OnPaint(wxPaintEvent& event); - - void OnLeftDown(wxMouseEvent& event); - void OnRightDown(wxMouseEvent& event); - - virtual void InitColours(); - - // Responds to colour changes - void OnSysColourChanged(wxSysColourChangedEvent& event); - -protected: - // common part of all ctors - void Init(); - - wxArrayString m_statusStrings; - - // the last known width of the client rect (used to rebuild cache) - int m_lastClientWidth; - // the widths of the status bar panes in pixels - wxArrayInt m_widthsAbs; - - int m_borderX; - int m_borderY; - wxPen m_mediumShadowPen; - wxPen m_hilightPen; - - virtual wxSize DoGetBestSize() const; - -private: - DECLARE_EVENT_TABLE() - DECLARE_DYNAMIC_CLASS_NO_COPY(wxStatusBarGeneric) -}; - -#endif // wxUSE_STATUSBAR - -#endif - // _WX_GENERIC_STATUSBR_H_ diff --git a/wxWidgets/include/wx/generic/tabg.h b/wxWidgets/include/wx/generic/tabg.h deleted file mode 100644 index bdac54166a..0000000000 --- a/wxWidgets/include/wx/generic/tabg.h +++ /dev/null @@ -1,363 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: tabg.h -// Purpose: Generic tabbed dialogs -// Author: Julian Smart -// Modified by: -// Created: 01/02/97 -// RCS-ID: $Id: tabg.h 41020 2006-09-05 20:47:48Z VZ $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef __TABGH_G__ -#define __TABGH_G__ - -#define WXTAB_VERSION 1.1 - -#include "wx/hashmap.h" -#include "wx/string.h" -#include "wx/dialog.h" -#include "wx/panel.h" -#include "wx/list.h" - -class WXDLLEXPORT wxTabView; - -/* - * A wxTabControl is the internal and visual representation - * of the tab. - */ - -class WXDLLEXPORT wxTabControl: public wxObject -{ -DECLARE_DYNAMIC_CLASS(wxTabControl) -public: - wxTabControl(wxTabView *v = (wxTabView *) NULL); - virtual ~wxTabControl(void); - - virtual void OnDraw(wxDC& dc, bool lastInRow); - void SetLabel(const wxString& str) { m_controlLabel = str; } - wxString GetLabel(void) const { return m_controlLabel; } - - void SetFont(const wxFont& f) { m_labelFont = f; } - wxFont *GetFont(void) const { return (wxFont*) & m_labelFont; } - - void SetSelected(bool sel) { m_isSelected = sel; } - bool IsSelected(void) const { return m_isSelected; } - - void SetPosition(int x, int y) { m_offsetX = x; m_offsetY = y; } - void SetSize(int x, int y) { m_width = x; m_height = y; } - - void SetRowPosition(int r) { m_rowPosition = r; } - int GetRowPosition() const { return m_rowPosition; } - void SetColPosition(int c) { m_colPosition = c; } - int GetColPosition() const { return m_colPosition; } - - int GetX(void) const { return m_offsetX; } - int GetY(void) const { return m_offsetY; } - int GetWidth(void) const { return m_width; } - int GetHeight(void) const { return m_height; } - - int GetId(void) const { return m_id; } - void SetId(int i) { m_id = i; } - - virtual bool HitTest(int x, int y) const ; - -protected: - wxTabView* m_view; - wxString m_controlLabel; - bool m_isSelected; - wxFont m_labelFont; - int m_offsetX; // Offsets from top-left of tab view area (the area below the tabs) - int m_offsetY; - int m_width; - int m_height; - int m_id; - int m_rowPosition; // Position in row from 0 - int m_colPosition; // Position in col from 0 -}; - -/* - * Each wxTabLayer is a list of tabs. E.g. there - * are 3 layers in the MS Word Options dialog. - */ - -class WXDLLEXPORT wxTabLayer: public wxList -{ -}; - -/* - * The wxTabView controls and draws the tabbed object - */ - -WX_DECLARE_LIST(wxTabLayer, wxTabLayerList); - -#define wxTAB_STYLE_DRAW_BOX 1 // Draws 3D boxes round tab layers -#define wxTAB_STYLE_COLOUR_INTERIOR 2 // Colours interior of tabs, otherwise draws outline - -class WXDLLEXPORT wxTabView: public wxObject -{ -DECLARE_DYNAMIC_CLASS(wxTabView) -public: - wxTabView(long style = wxTAB_STYLE_DRAW_BOX | wxTAB_STYLE_COLOUR_INTERIOR); - virtual ~wxTabView(); - - inline int GetNumberOfLayers() const { return m_layers.GetCount(); } -#if WXWIN_COMPATIBILITY_2_4 - inline wxList& GetLayers() { return *(wxList *)&m_layers; } -#else - inline wxTabLayerList& GetLayers() { return m_layers; } -#endif - - inline void SetWindow(wxWindow* wnd) { m_window = wnd; } - inline wxWindow* GetWindow(void) const { return m_window; } - - // Automatically positions tabs - wxTabControl *AddTab(int id, const wxString& label, wxTabControl *existingTab = (wxTabControl *) NULL); - - // Remove the tab without deleting the window - bool RemoveTab(int id); - - void ClearTabs(bool deleteTabs = true); - - bool SetTabText(int id, const wxString& label); - wxString GetTabText(int id) const; - - // Layout tabs (optional, e.g. if resizing window) - void LayoutTabs(); - - // Draw all tabs - virtual void Draw(wxDC& dc); - - // Process mouse event, return false if we didn't process it - virtual bool OnEvent(wxMouseEvent& event); - - // Called when a tab is activated - virtual void OnTabActivate(int activateId, int deactivateId); - // Allows vetoing - virtual bool OnTabPreActivate(int WXUNUSED(activateId), int WXUNUSED(deactivateId) ) { return true; }; - - // Allows use of application-supplied wxTabControl classes. - virtual wxTabControl *OnCreateTabControl(void) { return new wxTabControl(this); } - - void SetHighlightColour(const wxColour& col); - void SetShadowColour(const wxColour& col); - void SetBackgroundColour(const wxColour& col); - inline void SetTextColour(const wxColour& col) { m_textColour = col; } - - inline wxColour GetHighlightColour(void) const { return m_highlightColour; } - inline wxColour GetShadowColour(void) const { return m_shadowColour; } - inline wxColour GetBackgroundColour(void) const { return m_backgroundColour; } - inline wxColour GetTextColour(void) const { return m_textColour; } - inline const wxPen *GetHighlightPen(void) const { return m_highlightPen; } - inline const wxPen *GetShadowPen(void) const { return m_shadowPen; } - inline const wxPen *GetBackgroundPen(void) const { return m_backgroundPen; } - inline const wxBrush *GetBackgroundBrush(void) const { return m_backgroundBrush; } - - inline void SetViewRect(const wxRect& rect) { m_tabViewRect = rect; } - inline wxRect GetViewRect(void) const { return m_tabViewRect; } - - // Calculate tab width to fit to view, and optionally adjust the view - // to fit the tabs exactly. - int CalculateTabWidth(int noTabs, bool adjustView = false); - - inline void SetTabStyle(long style) { m_tabStyle = style; } - inline long GetTabStyle(void) const { return m_tabStyle; } - - inline void SetTabSize(int w, int h) { m_tabWidth = w; m_tabHeight = h; } - inline int GetTabWidth(void) const { return m_tabWidth; } - inline int GetTabHeight(void) const { return m_tabHeight; } - inline void SetTabSelectionHeight(int h) { m_tabSelectionHeight = h; } - inline int GetTabSelectionHeight(void) const { return m_tabSelectionHeight; } - - // Returns the total height of the tabs component -- this may be several - // times the height of a tab, if there are several tab layers (rows). - int GetTotalTabHeight(); - - inline int GetTopMargin(void) const { return m_topMargin; } - inline void SetTopMargin(int margin) { m_topMargin = margin; } - - void SetTabSelection(int sel, bool activateTool = true); - inline int GetTabSelection() const { return m_tabSelection; } - - // Find tab control for id - wxTabControl *FindTabControlForId(int id) const ; - - // Find tab control for layer, position (starting from zero) - wxTabControl *FindTabControlForPosition(int layer, int position) const ; - - inline int GetHorizontalTabOffset() const { return m_tabHorizontalOffset; } - inline int GetHorizontalTabSpacing() const { return m_tabHorizontalSpacing; } - inline void SetHorizontalTabOffset(int sp) { m_tabHorizontalOffset = sp; } - inline void SetHorizontalTabSpacing(int sp) { m_tabHorizontalSpacing = sp; } - - inline void SetVerticalTabTextSpacing(int s) { m_tabVerticalTextSpacing = s; } - inline int GetVerticalTabTextSpacing() const { return m_tabVerticalTextSpacing; } - - inline wxFont *GetTabFont() const { return (wxFont*) & m_tabFont; } - inline void SetTabFont(const wxFont& f) { m_tabFont = f; } - - inline wxFont *GetSelectedTabFont() const { return (wxFont*) & m_tabSelectedFont; } - inline void SetSelectedTabFont(const wxFont& f) { m_tabSelectedFont = f; } - // Find the node and the column at which this control is positioned. - wxList::compatibility_iterator FindTabNodeAndColumn(wxTabControl *control, int *col) const ; - - // Do the necessary to change to this tab - virtual bool ChangeTab(wxTabControl *control); - - // Move the selected tab to the bottom layer, if necessary, - // without calling app activation code - bool MoveSelectionTab(wxTabControl *control); - - inline int GetNumberOfTabs() const { return m_noTabs; } - -protected: - // List of layers, from front to back. - wxTabLayerList m_layers; - - // Selected tab - int m_tabSelection; - - // Usual tab height - int m_tabHeight; - - // The height of the selected tab - int m_tabSelectionHeight; - - // Usual tab width - int m_tabWidth; - - // Space between tabs - int m_tabHorizontalSpacing; - - // Space between top of normal tab and text - int m_tabVerticalTextSpacing; - - // Horizontal offset of each tab row above the first - int m_tabHorizontalOffset; - - // The distance between the bottom of the first tab row - // and the top of the client area (i.e. the margin) - int m_topMargin; - - // The position and size of the view above which the tabs are placed. - // I.e., the internal client area of the sheet. - wxRect m_tabViewRect; - - // Bitlist of styles - long m_tabStyle; - - // Colours - wxColour m_highlightColour; - wxColour m_shadowColour; - wxColour m_backgroundColour; - wxColour m_textColour; - - // Pen and brush cache - const wxPen* m_highlightPen; - const wxPen* m_shadowPen; - const wxPen* m_backgroundPen; - const wxBrush* m_backgroundBrush; - - wxFont m_tabFont; - wxFont m_tabSelectedFont; - - int m_noTabs; - - wxWindow* m_window; -}; - -/* - * A dialog box class that is tab-friendly - */ - -class WXDLLEXPORT wxTabbedDialog : public wxDialog -{ - DECLARE_DYNAMIC_CLASS(wxTabbedDialog) - -public: - wxTabbedDialog(wxWindow *parent, - wxWindowID id, - const wxString& title, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long windowStyle = wxDEFAULT_DIALOG_STYLE, - const wxString& name = wxDialogNameStr); - virtual ~wxTabbedDialog(); - - wxTabView *GetTabView() const { return m_tabView; } - void SetTabView(wxTabView *v) { m_tabView = v; } - - void OnCloseWindow(wxCloseEvent& event); - void OnMouseEvent(wxMouseEvent& event); - void OnPaint(wxPaintEvent& event); - -protected: - wxTabView* m_tabView; - -private: - DECLARE_EVENT_TABLE() -}; - -/* - * A panel class that is tab-friendly - */ - -class WXDLLEXPORT wxTabbedPanel : public wxPanel -{ - DECLARE_DYNAMIC_CLASS(wxTabbedPanel) - -public: - wxTabbedPanel(wxWindow *parent, - wxWindowID id, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long windowStyle = 0, - const wxString& name = wxPanelNameStr); - virtual ~wxTabbedPanel(); - - wxTabView *GetTabView() const { return m_tabView; } - void SetTabView(wxTabView *v) { m_tabView = v; } - - void OnMouseEvent(wxMouseEvent& event); - void OnPaint(wxPaintEvent& event); - -protected: - wxTabView* m_tabView; - -private: - DECLARE_EVENT_TABLE() -}; - -WX_DECLARE_HASH_MAP(int, wxWindow*, wxIntegerHash, wxIntegerEqual, - wxIntToWindowHashMap); - -class WXDLLEXPORT wxPanelTabView : public wxTabView -{ - DECLARE_DYNAMIC_CLASS(wxPanelTabView) - -public: - wxPanelTabView(wxPanel *pan, long style = wxTAB_STYLE_DRAW_BOX | wxTAB_STYLE_COLOUR_INTERIOR); - virtual ~wxPanelTabView(void); - - // Called when a tab is activated - virtual void OnTabActivate(int activateId, int deactivateId); - - // Specific to this class - void AddTabWindow(int id, wxWindow *window); - wxWindow *GetTabWindow(int id) const ; - void ClearWindows(bool deleteWindows = true); - wxWindow *GetCurrentWindow() const { return m_currentWindow; } - - void ShowWindowForTab(int id); - // wxList& GetWindows() const { return (wxList&) m_tabWindows; } - -protected: - // List of panels, one for each tab. Indexed - // by tab ID. - wxIntToWindowHashMap m_tabWindows; - wxWindow* m_currentWindow; - wxPanel* m_panel; -}; - -#endif - diff --git a/wxWidgets/include/wx/generic/textdlgg.h b/wxWidgets/include/wx/generic/textdlgg.h deleted file mode 100644 index f7809e58dd..0000000000 --- a/wxWidgets/include/wx/generic/textdlgg.h +++ /dev/null @@ -1,113 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: textdlgg.h -// Purpose: wxTextEntryDialog class -// Author: Julian Smart -// Modified by: -// Created: 01/02/97 -// RCS-ID: $Id: textdlgg.h 49563 2007-10-31 20:46:21Z VZ $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef __TEXTDLGH_G__ -#define __TEXTDLGH_G__ - -#include "wx/defs.h" - -#if wxUSE_TEXTDLG - -#include "wx/dialog.h" - -#if wxUSE_VALIDATORS -#include "wx/valtext.h" -#endif - -class WXDLLIMPEXP_FWD_CORE wxTextCtrl; - -extern WXDLLEXPORT_DATA(const wxChar) wxGetTextFromUserPromptStr[]; -extern WXDLLEXPORT_DATA(const wxChar) wxGetPasswordFromUserPromptStr[]; - -#define wxTextEntryDialogStyle (wxOK | wxCANCEL | wxCENTRE | wxWS_EX_VALIDATE_RECURSIVELY) - -// ---------------------------------------------------------------------------- -// wxTextEntryDialog: a dialog with text control, [ok] and [cancel] buttons -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxTextEntryDialog : public wxDialog -{ -public: - wxTextEntryDialog(wxWindow *parent, - const wxString& message, - const wxString& caption = wxGetTextFromUserPromptStr, - const wxString& value = wxEmptyString, - long style = wxTextEntryDialogStyle, - const wxPoint& pos = wxDefaultPosition); - - void SetValue(const wxString& val); - wxString GetValue() const { return m_value; } - -#if wxUSE_VALIDATORS - void SetTextValidator( const wxTextValidator& validator ); - void SetTextValidator( long style = wxFILTER_NONE ); - wxTextValidator* GetTextValidator() { return (wxTextValidator*)m_textctrl->GetValidator(); } -#endif - // wxUSE_VALIDATORS - - // implementation only - void OnOK(wxCommandEvent& event); - -protected: - wxTextCtrl *m_textctrl; - wxString m_value; - long m_dialogStyle; - -private: - DECLARE_EVENT_TABLE() - DECLARE_DYNAMIC_CLASS(wxTextEntryDialog) - DECLARE_NO_COPY_CLASS(wxTextEntryDialog) -}; - -// ---------------------------------------------------------------------------- -// wxPasswordEntryDialog: dialog with password control, [ok] and [cancel] -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxPasswordEntryDialog : public wxTextEntryDialog -{ -public: - wxPasswordEntryDialog(wxWindow *parent, - const wxString& message, - const wxString& caption = wxGetPasswordFromUserPromptStr, - const wxString& value = wxEmptyString, - long style = wxTextEntryDialogStyle, - const wxPoint& pos = wxDefaultPosition); -private: - DECLARE_DYNAMIC_CLASS(wxPasswordEntryDialog) - DECLARE_NO_COPY_CLASS(wxPasswordEntryDialog) -}; - -// ---------------------------------------------------------------------------- -// function to get a string from user -// ---------------------------------------------------------------------------- - -wxString WXDLLEXPORT -wxGetTextFromUser(const wxString& message, - const wxString& caption = wxGetTextFromUserPromptStr, - const wxString& default_value = wxEmptyString, - wxWindow *parent = (wxWindow *) NULL, - wxCoord x = wxDefaultCoord, - wxCoord y = wxDefaultCoord, - bool centre = true); - -wxString WXDLLEXPORT -wxGetPasswordFromUser(const wxString& message, - const wxString& caption = wxGetPasswordFromUserPromptStr, - const wxString& default_value = wxEmptyString, - wxWindow *parent = (wxWindow *) NULL, - wxCoord x = wxDefaultCoord, - wxCoord y = wxDefaultCoord, - bool centre = true); - -#endif - // wxUSE_TEXTDLG -#endif - // __TEXTDLGH_G__ diff --git a/wxWidgets/include/wx/generic/timer.h b/wxWidgets/include/wx/generic/timer.h deleted file mode 100644 index 0f52c1b4a1..0000000000 --- a/wxWidgets/include/wx/generic/timer.h +++ /dev/null @@ -1,45 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: timer.h -// Purpose: Generic implementation of wxTimer class -// Author: Vaclav Slavik -// Id: $Id: timer.h 41020 2006-09-05 20:47:48Z VZ $ -// Copyright: (c) Vaclav Slavik -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - - -#ifndef __WX_TIMER_H__ -#define __WX_TIMER_H__ - -//----------------------------------------------------------------------------- -// wxTimer -//----------------------------------------------------------------------------- - -class wxTimerDesc; - -class WXDLLEXPORT wxTimer : public wxTimerBase -{ -public: - wxTimer() { Init(); } - wxTimer(wxEvtHandler *owner, int timerid = -1) : wxTimerBase(owner, timerid) - { Init(); } - virtual ~wxTimer(); - - virtual bool Start(int millisecs = -1, bool oneShot = false); - virtual void Stop(); - - virtual bool IsRunning() const; - - // implementation - static void NotifyTimers(); - -protected: - void Init(); - -private: - wxTimerDesc *m_desc; - - DECLARE_ABSTRACT_CLASS(wxTimer) -}; - -#endif // __WX_TIMER_H__ diff --git a/wxWidgets/include/wx/generic/treectlg.h b/wxWidgets/include/wx/generic/treectlg.h deleted file mode 100644 index a555716f63..0000000000 --- a/wxWidgets/include/wx/generic/treectlg.h +++ /dev/null @@ -1,383 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/generic/treectlg.h -// Purpose: wxTreeCtrl class -// Author: Robert Roebling -// Modified by: -// Created: 01/02/97 -// RCS-ID: $Id: treectlg.h 49804 2007-11-10 01:09:42Z VZ $ -// Copyright: (c) 1997,1998 Robert Roebling -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _GENERIC_TREECTRL_H_ -#define _GENERIC_TREECTRL_H_ - -#if wxUSE_TREECTRL - -#include "wx/scrolwin.h" -#include "wx/pen.h" - -// ----------------------------------------------------------------------------- -// forward declaration -// ----------------------------------------------------------------------------- - -class WXDLLIMPEXP_FWD_CORE wxGenericTreeItem; - -class WXDLLIMPEXP_FWD_CORE wxTreeItemData; - -class WXDLLIMPEXP_FWD_CORE wxTreeRenameTimer; -class WXDLLIMPEXP_FWD_CORE wxTreeFindTimer; -class WXDLLIMPEXP_FWD_CORE wxTreeTextCtrl; -class WXDLLIMPEXP_FWD_CORE wxTextCtrl; - -// ----------------------------------------------------------------------------- -// wxGenericTreeCtrl - the tree control -// ----------------------------------------------------------------------------- - -class WXDLLEXPORT wxGenericTreeCtrl : public wxTreeCtrlBase, - public wxScrollHelper -{ -public: - // creation - // -------- - - wxGenericTreeCtrl() : wxTreeCtrlBase(), wxScrollHelper(this) { Init(); } - - wxGenericTreeCtrl(wxWindow *parent, wxWindowID id = wxID_ANY, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = wxTR_DEFAULT_STYLE, - const wxValidator &validator = wxDefaultValidator, - const wxString& name = wxTreeCtrlNameStr) - : wxTreeCtrlBase(), - wxScrollHelper(this) - { - Init(); - Create(parent, id, pos, size, style, validator, name); - } - - virtual ~wxGenericTreeCtrl(); - - bool Create(wxWindow *parent, wxWindowID id = wxID_ANY, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = wxTR_DEFAULT_STYLE, - const wxValidator &validator = wxDefaultValidator, - const wxString& name = wxTreeCtrlNameStr); - - - // implement base class pure virtuals - // ---------------------------------- - - virtual unsigned int GetCount() const; - - virtual unsigned int GetIndent() const { return m_indent; } - virtual void SetIndent(unsigned int indent); - - - virtual void SetImageList(wxImageList *imageList); - virtual void SetStateImageList(wxImageList *imageList); - - virtual wxString GetItemText(const wxTreeItemId& item) const; - virtual int GetItemImage(const wxTreeItemId& item, - wxTreeItemIcon which = wxTreeItemIcon_Normal) const; - virtual wxTreeItemData *GetItemData(const wxTreeItemId& item) const; - virtual wxColour GetItemTextColour(const wxTreeItemId& item) const; - virtual wxColour GetItemBackgroundColour(const wxTreeItemId& item) const; - virtual wxFont GetItemFont(const wxTreeItemId& item) const; - - virtual void SetItemText(const wxTreeItemId& item, const wxString& text); - virtual void SetItemImage(const wxTreeItemId& item, - int image, - wxTreeItemIcon which = wxTreeItemIcon_Normal); - virtual void SetItemData(const wxTreeItemId& item, wxTreeItemData *data); - - virtual void SetItemHasChildren(const wxTreeItemId& item, bool has = true); - virtual void SetItemBold(const wxTreeItemId& item, bool bold = true); - virtual void SetItemDropHighlight(const wxTreeItemId& item, bool highlight = true); - virtual void SetItemTextColour(const wxTreeItemId& item, const wxColour& col); - virtual void SetItemBackgroundColour(const wxTreeItemId& item, const wxColour& col); - virtual void SetItemFont(const wxTreeItemId& item, const wxFont& font); - - virtual bool IsVisible(const wxTreeItemId& item) const; - virtual bool ItemHasChildren(const wxTreeItemId& item) const; - virtual bool IsExpanded(const wxTreeItemId& item) const; - virtual bool IsSelected(const wxTreeItemId& item) const; - virtual bool IsBold(const wxTreeItemId& item) const; - - virtual size_t GetChildrenCount(const wxTreeItemId& item, - bool recursively = true) const; - - // navigation - // ---------- - - virtual wxTreeItemId GetRootItem() const { return m_anchor; } - virtual wxTreeItemId GetSelection() const { return m_current; } - virtual size_t GetSelections(wxArrayTreeItemIds&) const; - - virtual wxTreeItemId GetItemParent(const wxTreeItemId& item) const; - virtual wxTreeItemId GetFirstChild(const wxTreeItemId& item, - wxTreeItemIdValue& cookie) const; - virtual wxTreeItemId GetNextChild(const wxTreeItemId& item, - wxTreeItemIdValue& cookie) const; - virtual wxTreeItemId GetLastChild(const wxTreeItemId& item) const; - virtual wxTreeItemId GetNextSibling(const wxTreeItemId& item) const; - virtual wxTreeItemId GetPrevSibling(const wxTreeItemId& item) const; - - virtual wxTreeItemId GetFirstVisibleItem() const; - virtual wxTreeItemId GetNextVisible(const wxTreeItemId& item) const; - virtual wxTreeItemId GetPrevVisible(const wxTreeItemId& item) const; - - - // operations - // ---------- - - virtual wxTreeItemId AddRoot(const wxString& text, - int image = -1, int selectedImage = -1, - wxTreeItemData *data = NULL); - - virtual void Delete(const wxTreeItemId& item); - virtual void DeleteChildren(const wxTreeItemId& item); - virtual void DeleteAllItems(); - - virtual void Expand(const wxTreeItemId& item); - virtual void Collapse(const wxTreeItemId& item); - virtual void CollapseAndReset(const wxTreeItemId& item); - virtual void Toggle(const wxTreeItemId& item); - - virtual void Unselect(); - virtual void UnselectAll(); - virtual void SelectItem(const wxTreeItemId& item, bool select = true); - - virtual void EnsureVisible(const wxTreeItemId& item); - virtual void ScrollTo(const wxTreeItemId& item); - - virtual wxTextCtrl *EditLabel(const wxTreeItemId& item, - wxClassInfo* textCtrlClass = CLASSINFO(wxTextCtrl)); - virtual wxTextCtrl *GetEditControl() const; - virtual void EndEditLabel(const wxTreeItemId& item, - bool discardChanges = false); - - virtual void SortChildren(const wxTreeItemId& item); - - // items geometry - // -------------- - - virtual bool GetBoundingRect(const wxTreeItemId& item, - wxRect& rect, - bool textOnly = false) const; - - - // this version specific methods - // ----------------------------- - - wxImageList *GetButtonsImageList() const { return m_imageListButtons; } - void SetButtonsImageList(wxImageList *imageList); - void AssignButtonsImageList(wxImageList *imageList); - - void SetDropEffectAboveItem( bool above = false ) { m_dropEffectAboveItem = above; } - bool GetDropEffectAboveItem() const { return m_dropEffectAboveItem; } - - wxTreeItemId GetNext(const wxTreeItemId& item) const; - -#if WXWIN_COMPATIBILITY_2_6 - // use EditLabel() instead - void Edit( const wxTreeItemId& item ) { EditLabel(item); } -#endif // WXWIN_COMPATIBILITY_2_6 - -#if WXWIN_COMPATIBILITY_2_4 - // deprecated functions: use Set/GetItemImage directly - wxDEPRECATED( int GetItemSelectedImage(const wxTreeItemId& item) const ); - wxDEPRECATED( void SetItemSelectedImage(const wxTreeItemId& item, int image) ); - - // use the versions taking wxTreeItemIdValue cookies (note that - // GetNextChild() is not inside wxDEPRECATED on purpose, as otherwise we - // get twice as many warnings without any added benefit: it is always used - // with GetFirstChild() anyhow) - wxDEPRECATED( wxTreeItemId GetFirstChild(const wxTreeItemId& item, - long& cookie) const ); - wxTreeItemId GetNextChild(const wxTreeItemId& item, - long& cookie) const; -#endif // WXWIN_COMPATIBILITY_2_4 - - // implementation only from now on - - // overridden base class virtuals - virtual bool SetBackgroundColour(const wxColour& colour); - virtual bool SetForegroundColour(const wxColour& colour); - - virtual void Freeze(); - virtual void Thaw(); - virtual void Refresh(bool eraseBackground = true, const wxRect *rect = NULL); - - virtual bool SetFont( const wxFont &font ); - virtual void SetWindowStyle(const long styles); - - // callbacks - void OnPaint( wxPaintEvent &event ); - void OnSetFocus( wxFocusEvent &event ); - void OnKillFocus( wxFocusEvent &event ); - void OnChar( wxKeyEvent &event ); - void OnMouse( wxMouseEvent &event ); - void OnGetToolTip( wxTreeEvent &event ); - void OnSize( wxSizeEvent &event ); - void OnInternalIdle( ); - - virtual wxVisualAttributes GetDefaultAttributes() const - { - return GetClassDefaultAttributes(GetWindowVariant()); - } - - static wxVisualAttributes - GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL); - - // implementation helpers - void AdjustMyScrollbars(); - - WX_FORWARD_TO_SCROLL_HELPER() - -protected: - friend class wxGenericTreeItem; - friend class wxTreeRenameTimer; - friend class wxTreeFindTimer; - friend class wxTreeTextCtrl; - - wxFont m_normalFont; - wxFont m_boldFont; - - wxGenericTreeItem *m_anchor; - wxGenericTreeItem *m_current, - *m_key_current, - // A hint to select a parent item after deleting a child - *m_select_me; - unsigned short m_indent; - int m_lineHeight; - wxPen m_dottedPen; - wxBrush *m_hilightBrush, - *m_hilightUnfocusedBrush; - bool m_hasFocus; - bool m_dirty; - bool m_ownsImageListButtons; - bool m_isDragging; // true between BEGIN/END drag events - bool m_lastOnSame; // last click on the same item as prev - wxImageList *m_imageListButtons; - - int m_freezeCount; - int m_dragCount; - wxPoint m_dragStart; - wxGenericTreeItem *m_dropTarget; - wxCursor m_oldCursor; // cursor is changed while dragging - wxGenericTreeItem *m_oldSelection; - wxGenericTreeItem *m_underMouse; // for visual effects - wxTreeTextCtrl *m_textCtrl; - - wxTimer *m_renameTimer; - - // incremental search data - wxString m_findPrefix; - wxTimer *m_findTimer; - - bool m_dropEffectAboveItem; - - // the common part of all ctors - void Init(); - - // misc helpers - void SendDeleteEvent(wxGenericTreeItem *itemBeingDeleted); - - void DrawBorder(const wxTreeItemId& item); - void DrawLine(const wxTreeItemId& item, bool below); - void DrawDropEffect(wxGenericTreeItem *item); - - void DoSelectItem(const wxTreeItemId& id, - bool unselect_others = true, - bool extended_select = false); - - virtual wxTreeItemId DoInsertItem(const wxTreeItemId& parent, - size_t previous, - const wxString& text, - int image, - int selectedImage, - wxTreeItemData *data); - virtual wxTreeItemId DoInsertAfter(const wxTreeItemId& parent, - const wxTreeItemId& idPrevious, - const wxString& text, - int image = -1, int selImage = -1, - wxTreeItemData *data = NULL); - virtual wxTreeItemId DoTreeHitTest(const wxPoint& point, int& flags) const; - - // called by wxTextTreeCtrl when it marks itself for deletion - void ResetTextControl(); - - // find the first item starting with the given prefix after the given item - wxTreeItemId FindItem(const wxTreeItemId& id, const wxString& prefix) const; - - bool HasButtons() const { return HasFlag(wxTR_HAS_BUTTONS); } - - void CalculateLineHeight(); - int GetLineHeight(wxGenericTreeItem *item) const; - void PaintLevel( wxGenericTreeItem *item, wxDC& dc, int level, int &y ); - void PaintItem( wxGenericTreeItem *item, wxDC& dc); - - void CalculateLevel( wxGenericTreeItem *item, wxDC &dc, int level, int &y ); - void CalculatePositions(); - void CalculateSize( wxGenericTreeItem *item, wxDC &dc ); - - void RefreshSubtree( wxGenericTreeItem *item ); - void RefreshLine( wxGenericTreeItem *item ); - - // redraw all selected items - void RefreshSelected(); - - // RefreshSelected() recursive helper - void RefreshSelectedUnder(wxGenericTreeItem *item); - - void OnRenameTimer(); - bool OnRenameAccept(wxGenericTreeItem *item, const wxString& value); - void OnRenameCancelled(wxGenericTreeItem *item); - - void FillArray(wxGenericTreeItem*, wxArrayTreeItemIds&) const; - void SelectItemRange( wxGenericTreeItem *item1, wxGenericTreeItem *item2 ); - bool TagAllChildrenUntilLast(wxGenericTreeItem *crt_item, wxGenericTreeItem *last_item, bool select); - bool TagNextChildren(wxGenericTreeItem *crt_item, wxGenericTreeItem *last_item, bool select); - void UnselectAllChildren( wxGenericTreeItem *item ); - void ChildrenClosing(wxGenericTreeItem* item); - - void DoDirtyProcessing(); - - virtual wxSize DoGetBestSize() const; - -private: - DECLARE_EVENT_TABLE() - DECLARE_DYNAMIC_CLASS(wxGenericTreeCtrl) - DECLARE_NO_COPY_CLASS(wxGenericTreeCtrl) -}; - -#if !defined(__WXMSW__) || defined(__WXUNIVERSAL__) -/* - * wxTreeCtrl has to be a real class or we have problems with - * the run-time information. - */ - -class WXDLLEXPORT wxTreeCtrl: public wxGenericTreeCtrl -{ - DECLARE_DYNAMIC_CLASS(wxTreeCtrl) - -public: - wxTreeCtrl() {} - - wxTreeCtrl(wxWindow *parent, wxWindowID id = wxID_ANY, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = wxTR_DEFAULT_STYLE, - const wxValidator &validator = wxDefaultValidator, - const wxString& name = wxTreeCtrlNameStr) - : wxGenericTreeCtrl(parent, id, pos, size, style, validator, name) - { - } -}; -#endif // !__WXMSW__ || __WXUNIVERSAL__ - -#endif // wxUSE_TREECTRL - -#endif // _GENERIC_TREECTRL_H_ diff --git a/wxWidgets/include/wx/generic/wizard.h b/wxWidgets/include/wx/generic/wizard.h deleted file mode 100644 index 5d4d9bd60c..0000000000 --- a/wxWidgets/include/wx/generic/wizard.h +++ /dev/null @@ -1,142 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: wx/generic/wizard.h -// Purpose: declaration of generic wxWizard class -// Author: Vadim Zeitlin -// Modified by: Robert Vazan (sizers) -// Created: 28.09.99 -// RCS-ID: $Id: wizard.h 49563 2007-10-31 20:46:21Z VZ $ -// Copyright: (c) 1999 Vadim Zeitlin -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_GENERIC_WIZARD_H_ -#define _WX_GENERIC_WIZARD_H_ - -// ---------------------------------------------------------------------------- -// wxWizard -// ---------------------------------------------------------------------------- - -class WXDLLIMPEXP_FWD_CORE wxButton; -class WXDLLIMPEXP_FWD_CORE wxStaticBitmap; -class WXDLLIMPEXP_FWD_ADV wxWizardEvent; -class WXDLLIMPEXP_FWD_CORE wxBoxSizer; -class WXDLLIMPEXP_FWD_ADV wxWizardSizer; - -class WXDLLIMPEXP_ADV wxWizard : public wxWizardBase -{ -public: - // ctor - wxWizard() { Init(); } - wxWizard(wxWindow *parent, - int id = wxID_ANY, - const wxString& title = wxEmptyString, - const wxBitmap& bitmap = wxNullBitmap, - const wxPoint& pos = wxDefaultPosition, - long style = wxDEFAULT_DIALOG_STYLE) - { - Init(); - Create(parent, id, title, bitmap, pos, style); - } - bool Create(wxWindow *parent, - int id = wxID_ANY, - const wxString& title = wxEmptyString, - const wxBitmap& bitmap = wxNullBitmap, - const wxPoint& pos = wxDefaultPosition, - long style = wxDEFAULT_DIALOG_STYLE); - void Init(); - -#if wxABI_VERSION >= 20804 - virtual ~wxWizard(); -#endif - - // implement base class pure virtuals - virtual bool RunWizard(wxWizardPage *firstPage); - virtual wxWizardPage *GetCurrentPage() const; - virtual void SetPageSize(const wxSize& size); - virtual wxSize GetPageSize() const; - virtual void FitToPage(const wxWizardPage *firstPage); - virtual wxSizer *GetPageAreaSizer() const; - virtual void SetBorder(int border); - - /// set/get bitmap -#if wxABI_VERSION >= 20805 - const wxBitmap& GetBitmap() const { return m_bitmap; } - void SetBitmap(const wxBitmap& bitmap); -#endif - - // implementation only from now on - // ------------------------------- - - // is the wizard running? - bool IsRunning() const { return m_page != NULL; } - - // show the prev/next page, but call TransferDataFromWindow on the current - // page first and return false without changing the page if - // TransferDataFromWindow() returns false - otherwise, returns true - bool ShowPage(wxWizardPage *page, bool goingForward = true); - - // do fill the dialog with controls - // this is app-overridable to, for example, set help and tooltip text - virtual void DoCreateControls(); - -protected: - // for compatibility only, doesn't do anything any more - void FinishLayout() { } - -private: - // was the dialog really created? - bool WasCreated() const { return m_btnPrev != NULL; } - - // event handlers - void OnCancel(wxCommandEvent& event); - void OnBackOrNext(wxCommandEvent& event); - void OnHelp(wxCommandEvent& event); - - void OnWizEvent(wxWizardEvent& event); - - void AddBitmapRow(wxBoxSizer *mainColumn); - void AddStaticLine(wxBoxSizer *mainColumn); - void AddBackNextPair(wxBoxSizer *buttonRow); - void AddButtonRow(wxBoxSizer *mainColumn); - - // the page size requested by user - wxSize m_sizePage; - - // the dialog position from the ctor - wxPoint m_posWizard; - - // wizard state - wxWizardPage *m_page; // the current page or NULL - wxBitmap m_bitmap; // the default bitmap to show - - // wizard controls - wxButton *m_btnPrev, // the "" or "Finish" button - wxStaticBitmap *m_statbmp; // the control for the bitmap - - // Border around page area sizer requested using SetBorder() - int m_border; - - // Whether RunWizard() was called - bool m_started; - - // Whether was modal (modeless has to be destroyed on finish or cancel) - bool m_wasModal; - - // True if pages are laid out using the sizer - bool m_usingSizer; - - // Page area sizer will be inserted here with padding - wxBoxSizer *m_sizerBmpAndPage; - - // Actual position and size of pages - wxWizardSizer *m_sizerPage; - - friend class wxWizardSizer; - - DECLARE_DYNAMIC_CLASS(wxWizard) - DECLARE_EVENT_TABLE() - DECLARE_NO_COPY_CLASS(wxWizard) -}; - -#endif // _WX_GENERIC_WIZARD_H_ diff --git a/wxWidgets/include/wx/geometry.h b/wxWidgets/include/wx/geometry.h deleted file mode 100644 index 385f36e98b..0000000000 --- a/wxWidgets/include/wx/geometry.h +++ /dev/null @@ -1,814 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/geometry.h -// Purpose: Common Geometry Classes -// Author: Stefan Csomor -// Modified by: -// Created: 08/05/99 -// RCS-ID: $Id: geometry.h 53135 2008-04-12 02:31:04Z VZ $ -// Copyright: (c) 1999 Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_GEOMETRY_H_ -#define _WX_GEOMETRY_H_ - -#include "wx/defs.h" - -#if wxUSE_GEOMETRY - -#include "wx/utils.h" -#include "wx/gdicmn.h" -#include "wx/math.h" - -class WXDLLIMPEXP_FWD_BASE wxDataInputStream; -class WXDLLIMPEXP_FWD_BASE wxDataOutputStream; - -// clipping from Cohen-Sutherland - -enum wxOutCode -{ - wxInside = 0x00 , - wxOutLeft = 0x01 , - wxOutRight = 0x02 , - wxOutTop = 0x08 , - wxOutBottom = 0x04 -}; - -class WXDLLEXPORT wxPoint2DInt -{ -public : - inline wxPoint2DInt(); - inline wxPoint2DInt( wxInt32 x , wxInt32 y ); - inline wxPoint2DInt( const wxPoint2DInt &pt ); - inline wxPoint2DInt( const wxPoint &pt ); - - // noops for this class, just return the coords - inline void GetFloor( wxInt32 *x , wxInt32 *y ) const; - inline void GetRounded( wxInt32 *x , wxInt32 *y ) const; - - inline wxDouble GetVectorLength() const; - wxDouble GetVectorAngle() const; - inline void SetVectorLength( wxDouble length ); - void SetVectorAngle( wxDouble degrees ); - void SetPolarCoordinates( wxInt32 angle , wxInt32 length ); - // set the vector length to 1.0, preserving the angle - inline void Normalize(); - - inline wxDouble GetDistance( const wxPoint2DInt &pt ) const; - inline wxDouble GetDistanceSquare( const wxPoint2DInt &pt ) const; - inline wxInt32 GetDotProduct( const wxPoint2DInt &vec ) const; - inline wxInt32 GetCrossProduct( const wxPoint2DInt &vec ) const; - - // the reflection of this point - inline wxPoint2DInt operator-(); - - inline wxPoint2DInt& operator=(const wxPoint2DInt& pt); - inline wxPoint2DInt& operator+=(const wxPoint2DInt& pt); - inline wxPoint2DInt& operator-=(const wxPoint2DInt& pt); - inline wxPoint2DInt& operator*=(const wxPoint2DInt& pt); - inline wxPoint2DInt& operator*=(wxDouble n); - inline wxPoint2DInt& operator*=(wxInt32 n); - inline wxPoint2DInt& operator/=(const wxPoint2DInt& pt); - inline wxPoint2DInt& operator/=(wxDouble n); - inline wxPoint2DInt& operator/=(wxInt32 n); - inline operator wxPoint() const; - inline bool operator==(const wxPoint2DInt& pt) const; - inline bool operator!=(const wxPoint2DInt& pt) const; - -#if wxUSE_STREAMS - void WriteTo( wxDataOutputStream &stream ) const; - void ReadFrom( wxDataInputStream &stream ); -#endif // wxUSE_STREAMS - - wxInt32 m_x; - wxInt32 m_y; -}; - -inline wxPoint2DInt operator+(const wxPoint2DInt& pt1 , const wxPoint2DInt& pt2); -inline wxPoint2DInt operator-(const wxPoint2DInt& pt1 , const wxPoint2DInt& pt2); -inline wxPoint2DInt operator*(const wxPoint2DInt& pt1 , const wxPoint2DInt& pt2); -inline wxPoint2DInt operator*(wxInt32 n , const wxPoint2DInt& pt); -inline wxPoint2DInt operator*(wxInt32 n , const wxPoint2DInt& pt); -inline wxPoint2DInt operator*(const wxPoint2DInt& pt , wxInt32 n); -inline wxPoint2DInt operator*(const wxPoint2DInt& pt , wxInt32 n); -inline wxPoint2DInt operator/(const wxPoint2DInt& pt1 , const wxPoint2DInt& pt2); -inline wxPoint2DInt operator/(const wxPoint2DInt& pt , wxInt32 n); -inline wxPoint2DInt operator/(const wxPoint2DInt& pt , wxInt32 n); - -inline wxPoint2DInt::wxPoint2DInt() -{ - m_x = 0; - m_y = 0; -} - -inline wxPoint2DInt::wxPoint2DInt( wxInt32 x , wxInt32 y ) -{ - m_x = x; - m_y = y; -} - -inline wxPoint2DInt::wxPoint2DInt( const wxPoint2DInt &pt ) -{ - m_x = pt.m_x; - m_y = pt.m_y; -} - -inline wxPoint2DInt::wxPoint2DInt( const wxPoint &pt ) -{ - m_x = pt.x; - m_y = pt.y; -} - -inline void wxPoint2DInt::GetFloor( wxInt32 *x , wxInt32 *y ) const -{ - if ( x ) - *x = m_x; - if ( y ) - *y = m_y; -} - -inline void wxPoint2DInt::GetRounded( wxInt32 *x , wxInt32 *y ) const -{ - GetFloor(x, y); -} - -inline wxDouble wxPoint2DInt::GetVectorLength() const -{ - // cast needed MIPSpro compiler under SGI - return sqrt( (double)(m_x)*(m_x) + (m_y)*(m_y) ); -} - -inline void wxPoint2DInt::SetVectorLength( wxDouble length ) -{ - wxDouble before = GetVectorLength(); - m_x = (wxInt32)(m_x * length / before); - m_y = (wxInt32)(m_y * length / before); -} - -inline void wxPoint2DInt::Normalize() -{ - SetVectorLength( 1 ); -} - -inline wxDouble wxPoint2DInt::GetDistance( const wxPoint2DInt &pt ) const -{ - return sqrt( GetDistanceSquare( pt ) ); -} - -inline wxDouble wxPoint2DInt::GetDistanceSquare( const wxPoint2DInt &pt ) const -{ - return ( (wxDouble)(pt.m_x-m_x)*(pt.m_x-m_x) + (wxDouble)(pt.m_y-m_y)*(pt.m_y-m_y) ); -} - -inline wxInt32 wxPoint2DInt::GetDotProduct( const wxPoint2DInt &vec ) const -{ - return ( m_x * vec.m_x + m_y * vec.m_y ); -} - -inline wxInt32 wxPoint2DInt::GetCrossProduct( const wxPoint2DInt &vec ) const -{ - return ( m_x * vec.m_y - vec.m_x * m_y ); -} - -inline wxPoint2DInt::operator wxPoint() const -{ - return wxPoint( m_x, m_y); -} - -inline wxPoint2DInt wxPoint2DInt::operator-() -{ - return wxPoint2DInt( -m_x, -m_y); -} - -inline wxPoint2DInt& wxPoint2DInt::operator=(const wxPoint2DInt& pt) -{ - m_x = pt.m_x; - m_y = pt.m_y; - return *this; -} - -inline wxPoint2DInt& wxPoint2DInt::operator+=(const wxPoint2DInt& pt) -{ - m_x = m_x + pt.m_x; - m_y = m_y + pt.m_y; - return *this; -} - -inline wxPoint2DInt& wxPoint2DInt::operator-=(const wxPoint2DInt& pt) -{ - m_x = m_x - pt.m_x; - m_y = m_y - pt.m_y; - return *this; -} - -inline wxPoint2DInt& wxPoint2DInt::operator*=(const wxPoint2DInt& pt) -{ - m_x = m_x + pt.m_x; - m_y = m_y + pt.m_y; - return *this; -} - -inline wxPoint2DInt& wxPoint2DInt::operator/=(const wxPoint2DInt& pt) -{ - m_x = m_x - pt.m_x; - m_y = m_y - pt.m_y; - return *this; -} - -inline bool wxPoint2DInt::operator==(const wxPoint2DInt& pt) const -{ - return m_x == pt.m_x && m_y == pt.m_y; -} - -inline bool wxPoint2DInt::operator!=(const wxPoint2DInt& pt) const -{ - return m_x != pt.m_x || m_y != pt.m_y; -} - -inline wxPoint2DInt operator+(const wxPoint2DInt& pt1 , const wxPoint2DInt& pt2) -{ - return wxPoint2DInt( pt1.m_x + pt2.m_x , pt1.m_y + pt2.m_y ); -} - -inline wxPoint2DInt operator-(const wxPoint2DInt& pt1 , const wxPoint2DInt& pt2) -{ - return wxPoint2DInt( pt1.m_x - pt2.m_x , pt1.m_y - pt2.m_y ); -} - - -inline wxPoint2DInt operator*(const wxPoint2DInt& pt1 , const wxPoint2DInt& pt2) -{ - return wxPoint2DInt( pt1.m_x * pt2.m_x , pt1.m_y * pt2.m_y ); -} - -inline wxPoint2DInt operator*(wxInt32 n , const wxPoint2DInt& pt) -{ - return wxPoint2DInt( pt.m_x * n , pt.m_y * n ); -} - -inline wxPoint2DInt operator*(wxDouble n , const wxPoint2DInt& pt) -{ - return wxPoint2DInt( (int) (pt.m_x * n) , (int) (pt.m_y * n) ); -} - -inline wxPoint2DInt operator*(const wxPoint2DInt& pt , wxInt32 n) -{ - return wxPoint2DInt( pt.m_x * n , pt.m_y * n ); -} - -inline wxPoint2DInt operator*(const wxPoint2DInt& pt , wxDouble n) -{ - return wxPoint2DInt( (int) (pt.m_x * n) , (int) (pt.m_y * n) ); -} - -inline wxPoint2DInt operator/(const wxPoint2DInt& pt1 , const wxPoint2DInt& pt2) -{ - return wxPoint2DInt( pt1.m_x / pt2.m_x , pt1.m_y / pt2.m_y ); -} - -inline wxPoint2DInt operator/(const wxPoint2DInt& pt , wxInt32 n) -{ - return wxPoint2DInt( pt.m_x / n , pt.m_y / n ); -} - -inline wxPoint2DInt operator/(const wxPoint2DInt& pt , wxDouble n) -{ - return wxPoint2DInt( (int) (pt.m_x / n) , (int) (pt.m_y / n) ); -} - -// wxPoint2Ds represent a point or a vector in a 2d coordinate system - -class WXDLLEXPORT wxPoint2DDouble -{ -public : - inline wxPoint2DDouble(); - inline wxPoint2DDouble( wxDouble x , wxDouble y ); - inline wxPoint2DDouble( const wxPoint2DDouble &pt ); - wxPoint2DDouble( const wxPoint2DInt &pt ) - { m_x = (wxDouble) pt.m_x ; m_y = (wxDouble) pt.m_y ; } - wxPoint2DDouble( const wxPoint &pt ) - { m_x = (wxDouble) pt.x ; m_y = (wxDouble) pt.y ; } - - // two different conversions to integers, floor and rounding - inline void GetFloor( wxInt32 *x , wxInt32 *y ) const; - inline void GetRounded( wxInt32 *x , wxInt32 *y ) const; - - inline wxDouble GetVectorLength() const; - wxDouble GetVectorAngle() const ; - void SetVectorLength( wxDouble length ); - void SetVectorAngle( wxDouble degrees ); - void SetPolarCoordinates( wxDouble angle , wxDouble length ); - // set the vector length to 1.0, preserving the angle - void Normalize(); - - inline wxDouble GetDistance( const wxPoint2DDouble &pt ) const; - inline wxDouble GetDistanceSquare( const wxPoint2DDouble &pt ) const; - inline wxDouble GetDotProduct( const wxPoint2DDouble &vec ) const; - inline wxDouble GetCrossProduct( const wxPoint2DDouble &vec ) const; - - // the reflection of this point - inline wxPoint2DDouble operator-(); - - inline wxPoint2DDouble& operator=(const wxPoint2DDouble& pt); - inline wxPoint2DDouble& operator+=(const wxPoint2DDouble& pt); - inline wxPoint2DDouble& operator-=(const wxPoint2DDouble& pt); - inline wxPoint2DDouble& operator*=(const wxPoint2DDouble& pt); - inline wxPoint2DDouble& operator*=(wxDouble n); - inline wxPoint2DDouble& operator*=(wxInt32 n); - inline wxPoint2DDouble& operator/=(const wxPoint2DDouble& pt); - inline wxPoint2DDouble& operator/=(wxDouble n); - inline wxPoint2DDouble& operator/=(wxInt32 n); - - inline bool operator==(const wxPoint2DDouble& pt) const; - inline bool operator!=(const wxPoint2DDouble& pt) const; - - wxDouble m_x; - wxDouble m_y; -}; - -inline wxPoint2DDouble operator+(const wxPoint2DDouble& pt1 , const wxPoint2DDouble& pt2); -inline wxPoint2DDouble operator-(const wxPoint2DDouble& pt1 , const wxPoint2DDouble& pt2); -inline wxPoint2DDouble operator*(const wxPoint2DDouble& pt1 , const wxPoint2DDouble& pt2); -inline wxPoint2DDouble operator*(wxDouble n , const wxPoint2DDouble& pt); -inline wxPoint2DDouble operator*(wxInt32 n , const wxPoint2DDouble& pt); -inline wxPoint2DDouble operator*(const wxPoint2DDouble& pt , wxDouble n); -inline wxPoint2DDouble operator*(const wxPoint2DDouble& pt , wxInt32 n); -inline wxPoint2DDouble operator/(const wxPoint2DDouble& pt1 , const wxPoint2DDouble& pt2); -inline wxPoint2DDouble operator/(const wxPoint2DDouble& pt , wxDouble n); -inline wxPoint2DDouble operator/(const wxPoint2DDouble& pt , wxInt32 n); - -inline wxPoint2DDouble::wxPoint2DDouble() -{ - m_x = 0.0; - m_y = 0.0; -} - -inline wxPoint2DDouble::wxPoint2DDouble( wxDouble x , wxDouble y ) -{ - m_x = x; - m_y = y; -} - -inline wxPoint2DDouble::wxPoint2DDouble( const wxPoint2DDouble &pt ) -{ - m_x = pt.m_x; - m_y = pt.m_y; -} - -inline void wxPoint2DDouble::GetFloor( wxInt32 *x , wxInt32 *y ) const -{ - *x = (wxInt32) floor( m_x ); - *y = (wxInt32) floor( m_y ); -} - -inline void wxPoint2DDouble::GetRounded( wxInt32 *x , wxInt32 *y ) const -{ - *x = (wxInt32) floor( m_x + 0.5 ); - *y = (wxInt32) floor( m_y + 0.5); -} - -inline wxDouble wxPoint2DDouble::GetVectorLength() const -{ - return sqrt( (m_x)*(m_x) + (m_y)*(m_y) ) ; -} - -inline void wxPoint2DDouble::SetVectorLength( wxDouble length ) -{ - wxDouble before = GetVectorLength() ; - m_x = (m_x * length / before) ; - m_y = (m_y * length / before) ; -} - -inline void wxPoint2DDouble::Normalize() -{ - SetVectorLength( 1 ); -} - -inline wxDouble wxPoint2DDouble::GetDistance( const wxPoint2DDouble &pt ) const -{ - return sqrt( GetDistanceSquare( pt ) ); -} - -inline wxDouble wxPoint2DDouble::GetDistanceSquare( const wxPoint2DDouble &pt ) const -{ - return ( (pt.m_x-m_x)*(pt.m_x-m_x) + (pt.m_y-m_y)*(pt.m_y-m_y) ); -} - -inline wxDouble wxPoint2DDouble::GetDotProduct( const wxPoint2DDouble &vec ) const -{ - return ( m_x * vec.m_x + m_y * vec.m_y ); -} - -inline wxDouble wxPoint2DDouble::GetCrossProduct( const wxPoint2DDouble &vec ) const -{ - return ( m_x * vec.m_y - vec.m_x * m_y ); -} - -inline wxPoint2DDouble wxPoint2DDouble::operator-() -{ - return wxPoint2DDouble( -m_x, -m_y); -} - -inline wxPoint2DDouble& wxPoint2DDouble::operator=(const wxPoint2DDouble& pt) -{ - m_x = pt.m_x; - m_y = pt.m_y; - return *this; -} - -inline wxPoint2DDouble& wxPoint2DDouble::operator+=(const wxPoint2DDouble& pt) -{ - m_x = m_x + pt.m_x; - m_y = m_y + pt.m_y; - return *this; -} - -inline wxPoint2DDouble& wxPoint2DDouble::operator-=(const wxPoint2DDouble& pt) -{ - m_x = m_x - pt.m_x; - m_y = m_y - pt.m_y; - return *this; -} - -inline wxPoint2DDouble& wxPoint2DDouble::operator*=(const wxPoint2DDouble& pt) -{ - m_x = m_x * pt.m_x; - m_y = m_y * pt.m_y; - return *this; -} - -inline wxPoint2DDouble& wxPoint2DDouble::operator/=(const wxPoint2DDouble& pt) -{ - m_x = m_x / pt.m_x; - m_y = m_y / pt.m_y; - return *this; -} - -inline bool wxPoint2DDouble::operator==(const wxPoint2DDouble& pt) const -{ - return wxIsSameDouble(m_x, pt.m_x) && wxIsSameDouble(m_y, pt.m_y); -} - -inline bool wxPoint2DDouble::operator!=(const wxPoint2DDouble& pt) const -{ - return !(*this == pt); -} - -inline wxPoint2DDouble operator+(const wxPoint2DDouble& pt1 , const wxPoint2DDouble& pt2) -{ - return wxPoint2DDouble( pt1.m_x + pt2.m_x , pt1.m_y + pt2.m_y ); -} - -inline wxPoint2DDouble operator-(const wxPoint2DDouble& pt1 , const wxPoint2DDouble& pt2) -{ - return wxPoint2DDouble( pt1.m_x - pt2.m_x , pt1.m_y - pt2.m_y ); -} - - -inline wxPoint2DDouble operator*(const wxPoint2DDouble& pt1 , const wxPoint2DDouble& pt2) -{ - return wxPoint2DDouble( pt1.m_x * pt2.m_x , pt1.m_y * pt2.m_y ); -} - -inline wxPoint2DDouble operator*(wxDouble n , const wxPoint2DDouble& pt) -{ - return wxPoint2DDouble( pt.m_x * n , pt.m_y * n ); -} - -inline wxPoint2DDouble operator*(wxInt32 n , const wxPoint2DDouble& pt) -{ - return wxPoint2DDouble( pt.m_x * n , pt.m_y * n ); -} - -inline wxPoint2DDouble operator*(const wxPoint2DDouble& pt , wxDouble n) -{ - return wxPoint2DDouble( pt.m_x * n , pt.m_y * n ); -} - -inline wxPoint2DDouble operator*(const wxPoint2DDouble& pt , wxInt32 n) -{ - return wxPoint2DDouble( pt.m_x * n , pt.m_y * n ); -} - -inline wxPoint2DDouble operator/(const wxPoint2DDouble& pt1 , const wxPoint2DDouble& pt2) -{ - return wxPoint2DDouble( pt1.m_x / pt2.m_x , pt1.m_y / pt2.m_y ); -} - -inline wxPoint2DDouble operator/(const wxPoint2DDouble& pt , wxDouble n) -{ - return wxPoint2DDouble( pt.m_x / n , pt.m_y / n ); -} - -inline wxPoint2DDouble operator/(const wxPoint2DDouble& pt , wxInt32 n) -{ - return wxPoint2DDouble( pt.m_x / n , pt.m_y / n ); -} - -// wxRect2Ds are a axis-aligned rectangles, each side of the rect is parallel to the x- or m_y- axis. The rectangle is either defined by the -// top left and bottom right corner, or by the top left corner and size. A point is contained within the rectangle if -// left <= x < right and top <= m_y < bottom , thus it is a half open interval. - -class WXDLLEXPORT wxRect2DDouble -{ -public: - wxRect2DDouble() - { m_x = m_y = m_width = m_height = 0; } - wxRect2DDouble(wxDouble x, wxDouble y, wxDouble w, wxDouble h) - { m_x = x; m_y = y; m_width = w; m_height = h; } -/* - wxRect2DDouble(const wxPoint2DDouble& topLeft, const wxPoint2DDouble& bottomRight); - wxRect2DDouble(const wxPoint2DDouble& pos, const wxSize& size); - wxRect2DDouble(const wxRect2DDouble& rect); -*/ - // single attribute accessors - - inline wxPoint2DDouble GetPosition() - { return wxPoint2DDouble(m_x, m_y); } - inline wxSize GetSize() - { return wxSize((int) m_width, (int) m_height); } - - // for the edge and corner accessors there are two setters conterparts, the Set.. functions keep the other corners at their - // position whenever sensible, the Move.. functions keep the size of the rect and move the other corners apropriately - - inline wxDouble GetLeft() const { return m_x; } - inline void SetLeft( wxDouble n ) { m_width += m_x - n; m_x = n; } - inline void MoveLeftTo( wxDouble n ) { m_x = n; } - inline wxDouble GetTop() const { return m_y; } - inline void SetTop( wxDouble n ) { m_height += m_y - n; m_y = n; } - inline void MoveTopTo( wxDouble n ) { m_y = n; } - inline wxDouble GetBottom() const { return m_y + m_height; } - inline void SetBottom( wxDouble n ) { m_height += n - (m_y+m_height);} - inline void MoveBottomTo( wxDouble n ) { m_y = n - m_height; } - inline wxDouble GetRight() const { return m_x + m_width; } - inline void SetRight( wxDouble n ) { m_width += n - (m_x+m_width) ; } - inline void MoveRightTo( wxDouble n ) { m_x = n - m_width; } - - inline wxPoint2DDouble GetLeftTop() const - { return wxPoint2DDouble( m_x , m_y ); } - inline void SetLeftTop( const wxPoint2DDouble &pt ) - { m_width += m_x - pt.m_x; m_height += m_y - pt.m_y; m_x = pt.m_x; m_y = pt.m_y; } - inline void MoveLeftTopTo( const wxPoint2DDouble &pt ) - { m_x = pt.m_x; m_y = pt.m_y; } - inline wxPoint2DDouble GetLeftBottom() const - { return wxPoint2DDouble( m_x , m_y + m_height ); } - inline void SetLeftBottom( const wxPoint2DDouble &pt ) - { m_width += m_x - pt.m_x; m_height += pt.m_y - (m_y+m_height) ; m_x = pt.m_x; } - inline void MoveLeftBottomTo( const wxPoint2DDouble &pt ) - { m_x = pt.m_x; m_y = pt.m_y - m_height; } - inline wxPoint2DDouble GetRightTop() const - { return wxPoint2DDouble( m_x+m_width , m_y ); } - inline void SetRightTop( const wxPoint2DDouble &pt ) - { m_width += pt.m_x - ( m_x + m_width ); m_height += m_y - pt.m_y; m_y = pt.m_y; } - inline void MoveRightTopTo( const wxPoint2DDouble &pt ) - { m_x = pt.m_x - m_width; m_y = pt.m_y; } - inline wxPoint2DDouble GetRightBottom() const - { return wxPoint2DDouble( m_x+m_width , m_y + m_height ); } - inline void SetRightBottom( const wxPoint2DDouble &pt ) - { m_width += pt.m_x - ( m_x + m_width ); m_height += pt.m_y - (m_y+m_height);} - inline void MoveRightBottomTo( const wxPoint2DDouble &pt ) - { m_x = pt.m_x - m_width; m_y = pt.m_y - m_height; } - inline wxPoint2DDouble GetCentre() const - { return wxPoint2DDouble( m_x+m_width/2 , m_y+m_height/2 ); } - inline void SetCentre( const wxPoint2DDouble &pt ) - { MoveCentreTo( pt ); } // since this is impossible without moving... - inline void MoveCentreTo( const wxPoint2DDouble &pt ) - { m_x += pt.m_x - (m_x+m_width/2) , m_y += pt.m_y -(m_y+m_height/2); } - inline wxOutCode GetOutCode( const wxPoint2DDouble &pt ) const - { return (wxOutCode) (( ( pt.m_x < m_x ) ? wxOutLeft : 0 ) + - ( ( pt.m_x > m_x + m_width ) ? wxOutRight : 0 ) + - ( ( pt.m_y < m_y ) ? wxOutTop : 0 ) + - ( ( pt.m_y > m_y + m_height ) ? wxOutBottom : 0 )); } - inline wxOutCode GetOutcode(const wxPoint2DDouble &pt) const - { return GetOutCode(pt) ; } - inline bool Contains( const wxPoint2DDouble &pt ) const - { return GetOutCode( pt ) == wxInside; } - inline bool Contains( const wxRect2DDouble &rect ) const - { return ( ( ( m_x <= rect.m_x ) && ( rect.m_x + rect.m_width <= m_x + m_width ) ) && - ( ( m_y <= rect.m_y ) && ( rect.m_y + rect.m_height <= m_y + m_height ) ) ); } - inline bool IsEmpty() const - { return m_width <= 0 || m_height <= 0; } - inline bool HaveEqualSize( const wxRect2DDouble &rect ) const - { return wxIsSameDouble(rect.m_width, m_width) && wxIsSameDouble(rect.m_height, m_height); } - - inline void Inset( wxDouble x , wxDouble y ) - { m_x += x; m_y += y; m_width -= 2 * x; m_height -= 2 * y; } - inline void Inset( wxDouble left , wxDouble top ,wxDouble right , wxDouble bottom ) - { m_x += left; m_y += top; m_width -= left + right; m_height -= top + bottom;} - inline void Offset( const wxPoint2DDouble &pt ) - { m_x += pt.m_x; m_y += pt.m_y; } - - void ConstrainTo( const wxRect2DDouble &rect ); - - inline wxPoint2DDouble Interpolate( wxInt32 widthfactor , wxInt32 heightfactor ) - { return wxPoint2DDouble( m_x + m_width * widthfactor , m_y + m_height * heightfactor ); } - - static void Intersect( const wxRect2DDouble &src1 , const wxRect2DDouble &src2 , wxRect2DDouble *dest ); - inline void Intersect( const wxRect2DDouble &otherRect ) - { Intersect( *this , otherRect , this ); } - inline wxRect2DDouble CreateIntersection( const wxRect2DDouble &otherRect ) const - { wxRect2DDouble result; Intersect( *this , otherRect , &result); return result; } - bool Intersects( const wxRect2DDouble &rect ) const; - - static void Union( const wxRect2DDouble &src1 , const wxRect2DDouble &src2 , wxRect2DDouble *dest ); - void Union( const wxRect2DDouble &otherRect ) - { Union( *this , otherRect , this ); } - void Union( const wxPoint2DDouble &pt ); - inline wxRect2DDouble CreateUnion( const wxRect2DDouble &otherRect ) const - { wxRect2DDouble result; Union( *this , otherRect , &result); return result; } - - inline void Scale( wxDouble f ) - { m_x *= f; m_y *= f; m_width *= f; m_height *= f;} - inline void Scale( wxInt32 num , wxInt32 denum ) - { m_x *= ((wxDouble)num)/((wxDouble)denum); m_y *= ((wxDouble)num)/((wxDouble)denum); - m_width *= ((wxDouble)num)/((wxDouble)denum); m_height *= ((wxDouble)num)/((wxDouble)denum);} - - wxRect2DDouble& operator = (const wxRect2DDouble& rect); - inline bool operator == (const wxRect2DDouble& rect) const - { return wxIsSameDouble(m_x, rect.m_x) && wxIsSameDouble(m_y, rect.m_y) && HaveEqualSize(rect); } - inline bool operator != (const wxRect2DDouble& rect) const - { return !(*this == rect); } - - wxDouble m_x; - wxDouble m_y; - wxDouble m_width; - wxDouble m_height; -}; - - -// wxRect2Ds are a axis-aligned rectangles, each side of the rect is parallel to the x- or m_y- axis. The rectangle is either defined by the -// top left and bottom right corner, or by the top left corner and size. A point is contained within the rectangle if -// left <= x < right and top <= m_y < bottom , thus it is a half open interval. - -class WXDLLEXPORT wxRect2DInt -{ -public: - wxRect2DInt() { m_x = m_y = m_width = m_height = 0; } - wxRect2DInt( const wxRect& r ) { m_x = r.x ; m_y = r.y ; m_width = r.width ; m_height = r.height ; } - wxRect2DInt(wxInt32 x, wxInt32 y, wxInt32 w, wxInt32 h) { m_x = x; m_y = y; m_width = w; m_height = h; } - wxRect2DInt(const wxPoint2DInt& topLeft, const wxPoint2DInt& bottomRight); - inline wxRect2DInt(const wxPoint2DInt& pos, const wxSize& size); - inline wxRect2DInt(const wxRect2DInt& rect); - - // single attribute accessors - - inline wxPoint2DInt GetPosition() { return wxPoint2DInt(m_x, m_y); } - inline wxSize GetSize() { return wxSize(m_width, m_height); } - - // for the edge and corner accessors there are two setters conterparts, the Set.. functions keep the other corners at their - // position whenever sensible, the Move.. functions keep the size of the rect and move the other corners apropriately - - inline wxInt32 GetLeft() const { return m_x; } - inline void SetLeft( wxInt32 n ) { m_width += m_x - n; m_x = n; } - inline void MoveLeftTo( wxInt32 n ) { m_x = n; } - inline wxInt32 GetTop() const { return m_y; } - inline void SetTop( wxInt32 n ) { m_height += m_y - n; m_y = n; } - inline void MoveTopTo( wxInt32 n ) { m_y = n; } - inline wxInt32 GetBottom() const { return m_y + m_height; } - inline void SetBottom( wxInt32 n ) { m_height += n - (m_y+m_height);} - inline void MoveBottomTo( wxInt32 n ) { m_y = n - m_height; } - inline wxInt32 GetRight() const { return m_x + m_width; } - inline void SetRight( wxInt32 n ) { m_width += n - (m_x+m_width) ; } - inline void MoveRightTo( wxInt32 n ) { m_x = n - m_width; } - - inline wxPoint2DInt GetLeftTop() const { return wxPoint2DInt( m_x , m_y ); } - inline void SetLeftTop( const wxPoint2DInt &pt ) { m_width += m_x - pt.m_x; m_height += m_y - pt.m_y; m_x = pt.m_x; m_y = pt.m_y; } - inline void MoveLeftTopTo( const wxPoint2DInt &pt ) { m_x = pt.m_x; m_y = pt.m_y; } - inline wxPoint2DInt GetLeftBottom() const { return wxPoint2DInt( m_x , m_y + m_height ); } - inline void SetLeftBottom( const wxPoint2DInt &pt ) { m_width += m_x - pt.m_x; m_height += pt.m_y - (m_y+m_height) ; m_x = pt.m_x; } - inline void MoveLeftBottomTo( const wxPoint2DInt &pt ) { m_x = pt.m_x; m_y = pt.m_y - m_height; } - inline wxPoint2DInt GetRightTop() const { return wxPoint2DInt( m_x+m_width , m_y ); } - inline void SetRightTop( const wxPoint2DInt &pt ) { m_width += pt.m_x - ( m_x + m_width ); m_height += m_y - pt.m_y; m_y = pt.m_y; } - inline void MoveRightTopTo( const wxPoint2DInt &pt ) { m_x = pt.m_x - m_width; m_y = pt.m_y; } - inline wxPoint2DInt GetRightBottom() const { return wxPoint2DInt( m_x+m_width , m_y + m_height ); } - inline void SetRightBottom( const wxPoint2DInt &pt ) { m_width += pt.m_x - ( m_x + m_width ); m_height += pt.m_y - (m_y+m_height);} - inline void MoveRightBottomTo( const wxPoint2DInt &pt ) { m_x = pt.m_x - m_width; m_y = pt.m_y - m_height; } - inline wxPoint2DInt GetCentre() const { return wxPoint2DInt( m_x+m_width/2 , m_y+m_height/2 ); } - inline void SetCentre( const wxPoint2DInt &pt ) { MoveCentreTo( pt ); } // since this is impossible without moving... - inline void MoveCentreTo( const wxPoint2DInt &pt ) { m_x += pt.m_x - (m_x+m_width/2) , m_y += pt.m_y -(m_y+m_height/2); } - inline wxOutCode GetOutCode( const wxPoint2DInt &pt ) const - { return (wxOutCode) (( ( pt.m_x < m_x ) ? wxOutLeft : 0 ) + - ( ( pt.m_x >= m_x + m_width ) ? wxOutRight : 0 ) + - ( ( pt.m_y < m_y ) ? wxOutTop : 0 ) + - ( ( pt.m_y >= m_y + m_height ) ? wxOutBottom : 0 )); } - inline wxOutCode GetOutcode( const wxPoint2DInt &pt ) const - { return GetOutCode( pt ) ; } - inline bool Contains( const wxPoint2DInt &pt ) const - { return GetOutCode( pt ) == wxInside; } - inline bool Contains( const wxRect2DInt &rect ) const - { return ( ( ( m_x <= rect.m_x ) && ( rect.m_x + rect.m_width <= m_x + m_width ) ) && - ( ( m_y <= rect.m_y ) && ( rect.m_y + rect.m_height <= m_y + m_height ) ) ); } - inline bool IsEmpty() const - { return ( m_width <= 0 || m_height <= 0 ); } - inline bool HaveEqualSize( const wxRect2DInt &rect ) const - { return ( rect.m_width == m_width && rect.m_height == m_height ); } - - inline void Inset( wxInt32 x , wxInt32 y ) { m_x += x; m_y += y; m_width -= 2 * x; m_height -= 2 * y; } - inline void Inset( wxInt32 left , wxInt32 top ,wxInt32 right , wxInt32 bottom ) - { m_x += left; m_y += top; m_width -= left + right; m_height -= top + bottom;} - inline void Offset( const wxPoint2DInt &pt ) { m_x += pt.m_x; m_y += pt.m_y; } - void ConstrainTo( const wxRect2DInt &rect ); - inline wxPoint2DInt Interpolate( wxInt32 widthfactor , wxInt32 heightfactor ) { return wxPoint2DInt( m_x + m_width * widthfactor , m_y + m_height * heightfactor ); } - - static void Intersect( const wxRect2DInt &src1 , const wxRect2DInt &src2 , wxRect2DInt *dest ); - inline void Intersect( const wxRect2DInt &otherRect ) { Intersect( *this , otherRect , this ); } - inline wxRect2DInt CreateIntersection( const wxRect2DInt &otherRect ) const { wxRect2DInt result; Intersect( *this , otherRect , &result); return result; } - bool Intersects( const wxRect2DInt &rect ) const; - - static void Union( const wxRect2DInt &src1 , const wxRect2DInt &src2 , wxRect2DInt *dest ); - void Union( const wxRect2DInt &otherRect ) { Union( *this , otherRect , this ); } - void Union( const wxPoint2DInt &pt ); - inline wxRect2DInt CreateUnion( const wxRect2DInt &otherRect ) const { wxRect2DInt result; Union( *this , otherRect , &result); return result; } - - inline void Scale( wxInt32 f ) { m_x *= f; m_y *= f; m_width *= f; m_height *= f;} - inline void Scale( wxInt32 num , wxInt32 denum ) - { m_x *= ((wxInt32)num)/((wxInt32)denum); m_y *= ((wxInt32)num)/((wxInt32)denum); - m_width *= ((wxInt32)num)/((wxInt32)denum); m_height *= ((wxInt32)num)/((wxInt32)denum);} - - wxRect2DInt& operator = (const wxRect2DInt& rect); - bool operator == (const wxRect2DInt& rect) const; - bool operator != (const wxRect2DInt& rect) const; - -#if wxUSE_STREAMS - void WriteTo( wxDataOutputStream &stream ) const; - void ReadFrom( wxDataInputStream &stream ); -#endif // wxUSE_STREAMS - - wxInt32 m_x; - wxInt32 m_y; - wxInt32 m_width; - wxInt32 m_height; -}; - -inline wxRect2DInt::wxRect2DInt( const wxRect2DInt &r ) -{ - m_x = r.m_x; - m_y = r.m_y; - m_width = r.m_width; - m_height = r.m_height; -} - -inline wxRect2DInt::wxRect2DInt( const wxPoint2DInt &a , const wxPoint2DInt &b) -{ - m_x = wxMin( a.m_x , b.m_x ); - m_y = wxMin( a.m_y , b.m_y ); - m_width = abs( a.m_x - b.m_x ); - m_height = abs( a.m_y - b.m_y ); -} - -inline wxRect2DInt::wxRect2DInt( const wxPoint2DInt& pos, const wxSize& size) -{ - m_x = pos.m_x; - m_y = pos.m_y; - m_width = size.x; - m_height = size.y; -} - -inline bool wxRect2DInt::operator == (const wxRect2DInt& rect) const -{ - return (m_x==rect.m_x && m_y==rect.m_y && - m_width==rect.m_width && m_height==rect.m_height); -} - -inline bool wxRect2DInt::operator != (const wxRect2DInt& rect) const -{ - return !(*this == rect); -} - -class wxTransform2D -{ -public : - virtual ~wxTransform2D() { } - virtual void Transform( wxPoint2DInt* pt )const = 0; - virtual void Transform( wxRect2DInt* r ) const; - virtual wxPoint2DInt Transform( const wxPoint2DInt &pt ) const; - virtual wxRect2DInt Transform( const wxRect2DInt &r ) const ; - - virtual void InverseTransform( wxPoint2DInt* pt ) const = 0; - virtual void InverseTransform( wxRect2DInt* r ) const ; - virtual wxPoint2DInt InverseTransform( const wxPoint2DInt &pt ) const ; - virtual wxRect2DInt InverseTransform( const wxRect2DInt &r ) const ; -}; - -inline void wxTransform2D::Transform( wxRect2DInt* r ) const - { wxPoint2DInt a = r->GetLeftTop() , b = r->GetRightBottom(); Transform( &a ); Transform( &b ); *r = wxRect2DInt( a , b ); } - -inline wxPoint2DInt wxTransform2D::Transform( const wxPoint2DInt &pt ) const - { wxPoint2DInt res = pt; Transform( &res ); return res; } - -inline wxRect2DInt wxTransform2D::Transform( const wxRect2DInt &r ) const - { wxRect2DInt res = r; Transform( &res ); return res; } - -inline void wxTransform2D::InverseTransform( wxRect2DInt* r ) const - { wxPoint2DInt a = r->GetLeftTop() , b = r->GetRightBottom(); InverseTransform( &a ); InverseTransform( &b ); *r = wxRect2DInt( a , b ); } - -inline wxPoint2DInt wxTransform2D::InverseTransform( const wxPoint2DInt &pt ) const - { wxPoint2DInt res = pt; InverseTransform( &res ); return res; } - -inline wxRect2DInt wxTransform2D::InverseTransform( const wxRect2DInt &r ) const - { wxRect2DInt res = r; InverseTransform( &res ); return res; } - - -#endif // wxUSE_GEOMETRY - -#endif // _WX_GEOMETRY_H_ diff --git a/wxWidgets/include/wx/gifdecod.h b/wxWidgets/include/wx/gifdecod.h deleted file mode 100644 index 7760d4759d..0000000000 --- a/wxWidgets/include/wx/gifdecod.h +++ /dev/null @@ -1,110 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/gifdecod.h -// Purpose: wxGIFDecoder, GIF reader for wxImage and wxAnimation -// Author: Guillermo Rodriguez Garcia -// Version: 3.02 -// CVS-ID: $Id: gifdecod.h 45563 2007-04-21 18:17:50Z VZ $ -// Copyright: (c) 1999 Guillermo Rodriguez Garcia -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_GIFDECOD_H_ -#define _WX_GIFDECOD_H_ - -#include "wx/defs.h" - -#if wxUSE_STREAMS && wxUSE_GIF - -#include "wx/stream.h" -#include "wx/image.h" -#include "wx/animdecod.h" -#include "wx/dynarray.h" - -// internal utility used to store a frame in 8bit-per-pixel format -class GIFImage; - - -// -------------------------------------------------------------------------- -// Constants -// -------------------------------------------------------------------------- - -// Error codes: -// Note that the error code wxGIF_TRUNCATED means that the image itself -// is most probably OK, but the decoder didn't reach the end of the data -// stream; this means that if it was not reading directly from file, -// the stream will not be correctly positioned. -// -enum wxGIFErrorCode -{ - wxGIF_OK = 0, // everything was OK - wxGIF_INVFORMAT, // error in GIF header - wxGIF_MEMERR, // error allocating memory - wxGIF_TRUNCATED // file appears to be truncated -}; - -// -------------------------------------------------------------------------- -// wxGIFDecoder class -// -------------------------------------------------------------------------- - -class WXDLLEXPORT wxGIFDecoder : public wxAnimationDecoder -{ -public: - // constructor, destructor, etc. - wxGIFDecoder(); - ~wxGIFDecoder(); - - // get data of current frame - unsigned char* GetData(unsigned int frame) const; - unsigned char* GetPalette(unsigned int frame) const; - unsigned int GetNcolours(unsigned int frame) const; - int GetTransparentColourIndex(unsigned int frame) const; - wxColour GetTransparentColour(unsigned int frame) const; - - virtual wxSize GetFrameSize(unsigned int frame) const; - virtual wxPoint GetFramePosition(unsigned int frame) const; - virtual wxAnimationDisposal GetDisposalMethod(unsigned int frame) const; - virtual long GetDelay(unsigned int frame) const; - - // GIFs can contain both static images and animations - bool IsAnimation() const - { return m_nFrames > 1; } - - // load function which returns more info than just Load(): - wxGIFErrorCode LoadGIF( wxInputStream& stream ); - - // free all internal frames - void Destroy(); - - // implementation of wxAnimationDecoder's pure virtuals - virtual bool CanRead( wxInputStream& stream ) const; - virtual bool Load( wxInputStream& stream ) - { return LoadGIF(stream) == wxGIF_OK; } - - bool ConvertToImage(unsigned int frame, wxImage *image) const; - - wxAnimationDecoder *Clone() const - { return new wxGIFDecoder; } - wxAnimationType GetType() const - { return wxANIMATION_TYPE_GIF; } - -private: - // array of all frames - wxArrayPtrVoid m_frames; - - // decoder state vars - int m_restbits; // remaining valid bits - unsigned int m_restbyte; // remaining bytes in this block - unsigned int m_lastbyte; // last byte read - unsigned char m_buffer[256]; // buffer for reading - unsigned char *m_bufp; // pointer to next byte in buffer - - int getcode(wxInputStream& stream, int bits, int abfin); - wxGIFErrorCode dgif(wxInputStream& stream, - GIFImage *img, int interl, int bits); - - DECLARE_NO_COPY_CLASS(wxGIFDecoder) -}; - -#endif // wxUSE_STREAM && wxUSE_GIF - -#endif // _WX_GIFDECOD_H_ diff --git a/wxWidgets/include/wx/glcanvas.h b/wxWidgets/include/wx/glcanvas.h deleted file mode 100644 index 44d3f8490e..0000000000 --- a/wxWidgets/include/wx/glcanvas.h +++ /dev/null @@ -1,86 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/glcanvas.h -// Purpose: wxGLCanvas base header -// Author: Julian Smart -// Modified by: -// Created: -// Copyright: (c) Julian Smart -// RCS-ID: $Id: glcanvas.h 61872 2009-09-09 22:37:05Z VZ $ -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_GLCANVAS_H_BASE_ -#define _WX_GLCANVAS_H_BASE_ - -#include "wx/defs.h" - -#if wxUSE_GLCANVAS - -//--------------------------------------------------------------------------- -// Constants for attriblist -//--------------------------------------------------------------------------- - -// The generic GL implementation doesn't support most of these options, -// such as stereo, auxiliary buffers, alpha channel, and accum buffer. -// Other implementations may actually support them. - -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 alpha 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 alpha buffer with most bits (> MIN_ACCUM_ALPHA bits) */ -}; - -#define wxGLCanvasName wxT("GLCanvas") - -#if defined(__WXMSW__) -#include "wx/msw/glcanvas.h" -#elif defined(__WXMOTIF__) -#include "wx/x11/glcanvas.h" -#elif defined(__WXGTK20__) -#include "wx/gtk/glcanvas.h" -#elif defined(__WXGTK__) -#include "wx/gtk1/glcanvas.h" -#elif defined(__WXX11__) -#include "wx/x11/glcanvas.h" -#elif defined(__WXMAC__) -#include "wx/mac/glcanvas.h" -#elif defined(__WXCOCOA__) -#include "wx/cocoa/glcanvas.h" -#else -#error "wxGLCanvas not supported in this wxWidgets port" -#endif - -#include "wx/app.h" -class WXDLLIMPEXP_GL wxGLApp : public wxApp -{ -public: - wxGLApp() : wxApp() { } - virtual ~wxGLApp(); - - // use this in the constructor of the user-derived wxGLApp class to - // determine if an OpenGL rendering context with these attributes - // is available - returns true if so, false if not. - bool InitGLVisual(int *attribList); - -private: - DECLARE_DYNAMIC_CLASS(wxGLApp) -}; - -#endif - // wxUSE_GLCANVAS -#endif - // _WX_GLCANVAS_H_BASE_ diff --git a/wxWidgets/include/wx/graphics.h b/wxWidgets/include/wx/graphics.h deleted file mode 100644 index e8b53ed2d6..0000000000 --- a/wxWidgets/include/wx/graphics.h +++ /dev/null @@ -1,735 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/graphics.h -// Purpose: graphics context header -// Author: Stefan Csomor -// Modified by: -// Created: -// Copyright: (c) Stefan Csomor -// RCS-ID: $Id: graphics.h 60190 2009-04-16 00:57:35Z KO $ -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_GRAPHICS_H_ -#define _WX_GRAPHICS_H_ - -#include "wx/defs.h" - -#if wxUSE_GRAPHICS_CONTEXT - -#include "wx/geometry.h" -#include "wx/dynarray.h" - -class WXDLLIMPEXP_CORE wxWindowDC; -class WXDLLIMPEXP_CORE wxMemoryDC; -class WXDLLIMPEXP_CORE wxGraphicsContext; -class WXDLLIMPEXP_CORE wxGraphicsPath; -class WXDLLIMPEXP_CORE wxGraphicsMatrix; -class WXDLLIMPEXP_CORE wxGraphicsFigure; -class WXDLLIMPEXP_CORE wxGraphicsRenderer; -class WXDLLIMPEXP_CORE wxGraphicsPen; -class WXDLLIMPEXP_CORE wxGraphicsBrush; -class WXDLLIMPEXP_CORE wxGraphicsFont; -class WXDLLIMPEXP_CORE wxGraphicsBitmap; - -/* - * notes about the graphics context apis - * - * angles : are measured in radians, 0.0 being in direction of positiv x axis, PI/2 being - * in direction of positive y axis. - */ - -// Base class of all objects used for drawing in the new graphics API, the always point back to their -// originating rendering engine, there is no dynamic unloading of a renderer currently allowed, -// these references are not counted - -// -// The data used by objects like graphics pens etc is ref counted, in order to avoid unnecessary expensive -// duplication. Any operation on a shared instance that results in a modified state, uncouples this -// instance from the other instances that were shared - using copy on write semantics -// - -class WXDLLIMPEXP_CORE wxGraphicsObjectRefData : public wxObjectRefData -{ -public : - wxGraphicsObjectRefData( wxGraphicsRenderer* renderer ); - wxGraphicsObjectRefData( const wxGraphicsObjectRefData* data ); - wxGraphicsRenderer* GetRenderer() const ; - virtual wxGraphicsObjectRefData* Clone() const ; - -protected : - wxGraphicsRenderer* m_renderer; -} ; - -class WXDLLIMPEXP_CORE wxGraphicsObject : public wxObject -{ -public : - wxGraphicsObject() ; -#if wxABI_VERSION >= 20810 - wxGraphicsObject( const wxGraphicsObject& other) : wxObject( other ) {} - wxGraphicsObject& operator= (const wxGraphicsObject & other) { Ref(other); return *this;} -#endif - wxGraphicsObject( wxGraphicsRenderer* renderer ) ; - virtual ~wxGraphicsObject() ; - - bool IsNull() const ; - - // returns the renderer that was used to create this instance, or NULL if it has not been initialized yet - wxGraphicsRenderer* GetRenderer() const ; - wxGraphicsObjectRefData* GetGraphicsData() const ; -protected : - virtual wxObjectRefData* CreateRefData() const; - virtual wxObjectRefData* CloneRefData(const wxObjectRefData* data) const; - - DECLARE_DYNAMIC_CLASS(wxGraphicsObject) -} ; - -class WXDLLIMPEXP_CORE wxGraphicsPen : public wxGraphicsObject -{ -public : - wxGraphicsPen() {} -#if wxABI_VERSION >= 20810 - wxGraphicsPen( const wxGraphicsPen& other) : wxGraphicsObject( other ) {} - wxGraphicsPen& operator= (const wxGraphicsPen & other) { Ref(other); return *this;} -#endif - virtual ~wxGraphicsPen() {} -private : - DECLARE_DYNAMIC_CLASS(wxGraphicsPen) -} ; - -extern WXDLLEXPORT_DATA(wxGraphicsPen) wxNullGraphicsPen; - -class WXDLLIMPEXP_CORE wxGraphicsBrush : public wxGraphicsObject -{ -public : - wxGraphicsBrush() {} -#if wxABI_VERSION >= 20810 - wxGraphicsBrush( const wxGraphicsBrush& other) : wxGraphicsObject( other ) {} - wxGraphicsBrush& operator= (const wxGraphicsBrush & other) { Ref(other); return *this;} -#endif - virtual ~wxGraphicsBrush() {} -private : - DECLARE_DYNAMIC_CLASS(wxGraphicsBrush) -} ; - -extern WXDLLEXPORT_DATA(wxGraphicsBrush) wxNullGraphicsBrush; - -class WXDLLIMPEXP_CORE wxGraphicsFont : public wxGraphicsObject -{ -public : - wxGraphicsFont() {} -#if wxABI_VERSION >= 20810 - wxGraphicsFont( const wxGraphicsFont& other) : wxGraphicsObject( other ) {} - wxGraphicsFont& operator= (const wxGraphicsFont & other) { Ref(other); return *this;} -#endif - virtual ~wxGraphicsFont() {} -private : - DECLARE_DYNAMIC_CLASS(wxGraphicsFont) -} ; - -extern WXDLLEXPORT_DATA(wxGraphicsFont) wxNullGraphicsFont; - -class WXDLLIMPEXP_CORE wxGraphicsBitmap : public wxGraphicsObject -{ -public : - wxGraphicsBitmap() {} -#if wxABI_VERSION >= 20810 - wxGraphicsBitmap( const wxGraphicsBitmap& other) : wxGraphicsObject( other ) {} - wxGraphicsBitmap& operator= (const wxGraphicsBitmap & other) { Ref(other); return *this;} -#endif - virtual ~wxGraphicsBitmap() {} -private : - DECLARE_DYNAMIC_CLASS(wxGraphicsBitmap) -} ; - -extern WXDLLEXPORT_DATA(wxGraphicsBitmap) wxNullGraphicsBitmap; - -class WXDLLIMPEXP_CORE wxGraphicsMatrixData : public wxGraphicsObjectRefData -{ -public : - wxGraphicsMatrixData( wxGraphicsRenderer* renderer) : - wxGraphicsObjectRefData(renderer) {} - - virtual ~wxGraphicsMatrixData() {} - - // concatenates the matrix - virtual void Concat( const wxGraphicsMatrixData *t ) = 0; - - // sets the matrix to the respective values - virtual void Set(wxDouble a=1.0, wxDouble b=0.0, wxDouble c=0.0, wxDouble d=1.0, - wxDouble tx=0.0, wxDouble ty=0.0) = 0; - - // gets the component valuess of the matrix - virtual void Get(wxDouble* a=NULL, wxDouble* b=NULL, wxDouble* c=NULL, - wxDouble* d=NULL, wxDouble* tx=NULL, wxDouble* ty=NULL) const = 0; - - // makes this the inverse matrix - virtual void Invert() = 0; - - // returns true if the elements of the transformation matrix are equal ? - virtual bool IsEqual( const wxGraphicsMatrixData* t) const = 0; - - // return true if this is the identity matrix - virtual bool IsIdentity() const = 0; - - // - // transformation - // - - // add the translation to this matrix - virtual void Translate( wxDouble dx , wxDouble dy ) = 0; - - // add the scale to this matrix - virtual void Scale( wxDouble xScale , wxDouble yScale ) = 0; - - // add the rotation to this matrix (radians) - virtual void Rotate( wxDouble angle ) = 0; - - // - // apply the transforms - // - - // applies that matrix to the point - virtual void TransformPoint( wxDouble *x, wxDouble *y ) const = 0; - - // applies the matrix except for translations - virtual void TransformDistance( wxDouble *dx, wxDouble *dy ) const =0; - - // returns the native representation - virtual void * GetNativeMatrix() const = 0; -} ; - -class WXDLLIMPEXP_CORE wxGraphicsMatrix : public wxGraphicsObject -{ -public : - wxGraphicsMatrix() {} -#if wxABI_VERSION >= 20810 - wxGraphicsMatrix( const wxGraphicsMatrix& other) : wxGraphicsObject( other ) {} - wxGraphicsMatrix& operator= (const wxGraphicsMatrix & other) { Ref(other); return *this;} -#endif - - virtual ~wxGraphicsMatrix() {} - - // concatenates the matrix - virtual void Concat( const wxGraphicsMatrix *t ); - void Concat( const wxGraphicsMatrix &t ) { Concat( &t ); } - - // sets the matrix to the respective values - virtual void Set(wxDouble a=1.0, wxDouble b=0.0, wxDouble c=0.0, wxDouble d=1.0, - wxDouble tx=0.0, wxDouble ty=0.0); - - // gets the component valuess of the matrix - virtual void Get(wxDouble* a=NULL, wxDouble* b=NULL, wxDouble* c=NULL, - wxDouble* d=NULL, wxDouble* tx=NULL, wxDouble* ty=NULL) const; - - // makes this the inverse matrix - virtual void Invert(); - - // returns true if the elements of the transformation matrix are equal ? - virtual bool IsEqual( const wxGraphicsMatrix* t) const; - bool IsEqual( const wxGraphicsMatrix& t) const { return IsEqual( &t ); } - - // return true if this is the identity matrix - virtual bool IsIdentity() const; - - // - // transformation - // - - // add the translation to this matrix - virtual void Translate( wxDouble dx , wxDouble dy ); - - // add the scale to this matrix - virtual void Scale( wxDouble xScale , wxDouble yScale ); - - // add the rotation to this matrix (radians) - virtual void Rotate( wxDouble angle ); - - // - // apply the transforms - // - - // applies that matrix to the point - virtual void TransformPoint( wxDouble *x, wxDouble *y ) const; - - // applies the matrix except for translations - virtual void TransformDistance( wxDouble *dx, wxDouble *dy ) const; - - // returns the native representation - virtual void * GetNativeMatrix() const; - - const wxGraphicsMatrixData* GetMatrixData() const - { return (const wxGraphicsMatrixData*) GetRefData(); } - wxGraphicsMatrixData* GetMatrixData() - { return (wxGraphicsMatrixData*) GetRefData(); } - -private : - DECLARE_DYNAMIC_CLASS(wxGraphicsMatrix) -} ; - -extern WXDLLEXPORT_DATA(wxGraphicsMatrix) wxNullGraphicsMatrix; - -class WXDLLIMPEXP_CORE wxGraphicsPathData : public wxGraphicsObjectRefData -{ -public : - wxGraphicsPathData(wxGraphicsRenderer* renderer) : wxGraphicsObjectRefData(renderer) {} - virtual ~wxGraphicsPathData() {} - - // - // These are the path primitives from which everything else can be constructed - // - - // begins a new subpath at (x,y) - virtual void MoveToPoint( wxDouble x, wxDouble y ) = 0; - - // adds a straight line from the current point to (x,y) - virtual void AddLineToPoint( wxDouble x, wxDouble y ) = 0; - - // adds a cubic Bezier curve from the current point, using two control points and an end point - virtual void AddCurveToPoint( wxDouble cx1, wxDouble cy1, wxDouble cx2, wxDouble cy2, wxDouble x, wxDouble y ) = 0; - - // adds another path - virtual void AddPath( const wxGraphicsPathData* path ) =0; - - // closes the current sub-path - virtual void CloseSubpath() = 0; - - // gets the last point of the current path, (0,0) if not yet set - virtual void GetCurrentPoint( wxDouble* x, wxDouble* y) const = 0; - - // adds an arc of a circle centering at (x,y) with radius (r) from startAngle to endAngle - virtual void AddArc( wxDouble x, wxDouble y, wxDouble r, wxDouble startAngle, wxDouble endAngle, bool clockwise ) = 0; - - // - // These are convenience functions which - if not available natively will be assembled - // using the primitives from above - // - - // adds a quadratic Bezier curve from the current point, using a control point and an end point - virtual void AddQuadCurveToPoint( wxDouble cx, wxDouble cy, wxDouble x, wxDouble y ); - - // appends a rectangle as a new closed subpath - virtual void AddRectangle( wxDouble x, wxDouble y, wxDouble w, wxDouble h ); - - // appends an ellipsis as a new closed subpath fitting the passed rectangle - virtual void AddCircle( wxDouble x, wxDouble y, wxDouble r ); - - // appends a an arc to two tangents connecting (current) to (x1,y1) and (x1,y1) to (x2,y2), also a straight line from (current) to (x1,y1) - virtual void AddArcToPoint( wxDouble x1, wxDouble y1 , wxDouble x2, wxDouble y2, wxDouble r ) ; - - // appends an ellipse - virtual void AddEllipse( wxDouble x, wxDouble y, wxDouble w, wxDouble h); - - // appends a rounded rectangle - virtual void AddRoundedRectangle( wxDouble x, wxDouble y, wxDouble w, wxDouble h, wxDouble radius); - - // returns the native path - virtual void * GetNativePath() const = 0; - - // give the native path returned by GetNativePath() back (there might be some deallocations necessary) - virtual void UnGetNativePath(void *p) const= 0; - - // transforms each point of this path by the matrix - virtual void Transform( const wxGraphicsMatrixData* matrix ) =0; - - // gets the bounding box enclosing all points (possibly including control points) - virtual void GetBox(wxDouble *x, wxDouble *y, wxDouble *w, wxDouble *h) const=0; - - virtual bool Contains( wxDouble x, wxDouble y, int fillStyle = wxODDEVEN_RULE) const=0; -}; - -class WXDLLIMPEXP_CORE wxGraphicsPath : public wxGraphicsObject -{ -public : - wxGraphicsPath() {} -#if wxABI_VERSION >= 20810 - wxGraphicsPath( const wxGraphicsPath& other) : wxGraphicsObject( other ) {} - wxGraphicsPath& operator= (const wxGraphicsPath & other) { Ref(other); return *this;} -#endif - virtual ~wxGraphicsPath() {} - - // - // These are the path primitives from which everything else can be constructed - // - - // begins a new subpath at (x,y) - virtual void MoveToPoint( wxDouble x, wxDouble y ); - void MoveToPoint( const wxPoint2DDouble& p); - - // adds a straight line from the current point to (x,y) - virtual void AddLineToPoint( wxDouble x, wxDouble y ); - void AddLineToPoint( const wxPoint2DDouble& p); - - // adds a cubic Bezier curve from the current point, using two control points and an end point - virtual void AddCurveToPoint( wxDouble cx1, wxDouble cy1, wxDouble cx2, wxDouble cy2, wxDouble x, wxDouble y ) ; - void AddCurveToPoint( const wxPoint2DDouble& c1, const wxPoint2DDouble& c2, const wxPoint2DDouble& e); - - // adds another path - virtual void AddPath( const wxGraphicsPath& path ); - - // closes the current sub-path - virtual void CloseSubpath() ; - - // gets the last point of the current path, (0,0) if not yet set - virtual void GetCurrentPoint( wxDouble* x, wxDouble* y) const; - wxPoint2DDouble GetCurrentPoint() const; - - // adds an arc of a circle centering at (x,y) with radius (r) from startAngle to endAngle - virtual void AddArc( wxDouble x, wxDouble y, wxDouble r, wxDouble startAngle, wxDouble endAngle, bool clockwise ) ; - void AddArc( const wxPoint2DDouble& c, wxDouble r, wxDouble startAngle, wxDouble endAngle, bool clockwise); - - // - // These are convenience functions which - if not available natively will be assembled - // using the primitives from above - // - - // adds a quadratic Bezier curve from the current point, using a control point and an end point - virtual void AddQuadCurveToPoint( wxDouble cx, wxDouble cy, wxDouble x, wxDouble y ); - - // appends a rectangle as a new closed subpath - virtual void AddRectangle( wxDouble x, wxDouble y, wxDouble w, wxDouble h ); - - // appends an ellipsis as a new closed subpath fitting the passed rectangle - virtual void AddCircle( wxDouble x, wxDouble y, wxDouble r ); - - // appends a an arc to two tangents connecting (current) to (x1,y1) and (x1,y1) to (x2,y2), also a straight line from (current) to (x1,y1) - virtual void AddArcToPoint( wxDouble x1, wxDouble y1 , wxDouble x2, wxDouble y2, wxDouble r ) ; - - // appends an ellipse - virtual void AddEllipse( wxDouble x, wxDouble y, wxDouble w, wxDouble h); - - // appends a rounded rectangle - virtual void AddRoundedRectangle( wxDouble x, wxDouble y, wxDouble w, wxDouble h, wxDouble radius); - - // returns the native path - virtual void * GetNativePath() const; - - // give the native path returned by GetNativePath() back (there might be some deallocations necessary) - virtual void UnGetNativePath(void *p)const; - - // transforms each point of this path by the matrix - virtual void Transform( const wxGraphicsMatrix& matrix ); - - // gets the bounding box enclosing all points (possibly including control points) - virtual void GetBox(wxDouble *x, wxDouble *y, wxDouble *w, wxDouble *h)const; - wxRect2DDouble GetBox()const; - - virtual bool Contains( wxDouble x, wxDouble y, int fillStyle = wxODDEVEN_RULE)const; - bool Contains( const wxPoint2DDouble& c, int fillStyle = wxODDEVEN_RULE)const; - - const wxGraphicsPathData* GetPathData() const - { return (const wxGraphicsPathData*) GetRefData(); } - wxGraphicsPathData* GetPathData() - { return (wxGraphicsPathData*) GetRefData(); } - -private : - DECLARE_DYNAMIC_CLASS(wxGraphicsPath) -} ; - -extern WXDLLEXPORT_DATA(wxGraphicsPath) wxNullGraphicsPath; - - -class WXDLLIMPEXP_CORE wxGraphicsContext : public wxGraphicsObject -{ -public: - wxGraphicsContext(wxGraphicsRenderer* renderer); - - virtual ~wxGraphicsContext(); - - static wxGraphicsContext* Create( const wxWindowDC& dc) ; - -#ifdef __WXMSW__ - static wxGraphicsContext * Create( const wxMemoryDC& dc) ; -#endif - - static wxGraphicsContext* CreateFromNative( void * context ) ; - - static wxGraphicsContext* CreateFromNativeWindow( void * window ) ; - - static wxGraphicsContext* Create( wxWindow* window ) ; - - // create a context that can be used for measuring texts only, no drawing allowed - static wxGraphicsContext * Create(); - - wxGraphicsPath CreatePath() const; - - virtual wxGraphicsPen CreatePen(const wxPen& pen) const; - - virtual wxGraphicsBrush CreateBrush(const wxBrush& brush ) const; - - // sets the brush to a linear gradient, starting at (x1,y1) with color c1 to (x2,y2) with color c2 - virtual wxGraphicsBrush CreateLinearGradientBrush( wxDouble x1, wxDouble y1, wxDouble x2, wxDouble y2, - const wxColour&c1, const wxColour&c2) const; - - // sets the brush to a radial gradient originating at (xo,yc) with color oColor and ends on a circle around (xc,yc) - // with radius r and color cColor - virtual wxGraphicsBrush CreateRadialGradientBrush( wxDouble xo, wxDouble yo, wxDouble xc, wxDouble yc, wxDouble radius, - const wxColour &oColor, const wxColour &cColor) const; - - // sets the font - virtual wxGraphicsFont CreateFont( const wxFont &font , const wxColour &col = *wxBLACK ) const; - -#if wxABI_VERSION >= 20809 - wxGraphicsBitmap CreateBitmap( const wxBitmap &bitmap ) const; -#endif - - //virtual wxGraphicsBitmap CreateSubBitmap( const wxGraphicsBitmap &bitmap, wxDouble x, wxDouble y, wxDouble w, wxDouble h ) const; - - // create a 'native' matrix corresponding to these values - virtual wxGraphicsMatrix CreateMatrix( wxDouble a=1.0, wxDouble b=0.0, wxDouble c=0.0, wxDouble d=1.0, - wxDouble tx=0.0, wxDouble ty=0.0) const; - - // push the current state of the context, ie the transformation matrix on a stack - virtual void PushState() = 0; - - // pops a stored state from the stack - virtual void PopState() = 0; - - // clips drawings to the region intersected with the current clipping region - virtual void Clip( const wxRegion ®ion ) = 0; - - // clips drawings to the rect intersected with the current clipping region - virtual void Clip( wxDouble x, wxDouble y, wxDouble w, wxDouble h ) = 0; - - // resets the clipping to original extent - virtual void ResetClip() = 0 ; - - // returns the native context - virtual void * GetNativeContext() = 0; - - // returns the current logical function - virtual int GetLogicalFunction() const { return m_logicalFunction; } - - // sets the current logical function, returns true if it supported - virtual bool SetLogicalFunction(int function) ; - - // - // transformation : changes the current transformation matrix CTM of the context - // - - // translate - virtual void Translate( wxDouble dx , wxDouble dy ) = 0; - - // scale - virtual void Scale( wxDouble xScale , wxDouble yScale ) = 0; - - // rotate (radians) - virtual void Rotate( wxDouble angle ) = 0; - - // concatenates this transform with the current transform of this context - virtual void ConcatTransform( const wxGraphicsMatrix& matrix ) = 0; - - // sets the transform of this context - virtual void SetTransform( const wxGraphicsMatrix& matrix ) = 0; - - // gets the matrix of this context - virtual wxGraphicsMatrix GetTransform() const = 0; - // - // setting the paint - // - - // sets the pen - virtual void SetPen( const wxGraphicsPen& pen ); - - void SetPen( const wxPen& pen ); - - // sets the brush for filling - virtual void SetBrush( const wxGraphicsBrush& brush ); - - void SetBrush( const wxBrush& brush ); - - // sets the font - virtual void SetFont( const wxGraphicsFont& font ); - - void SetFont( const wxFont& font, const wxColour& colour ); - - - // strokes along a path with the current pen - virtual void StrokePath( const wxGraphicsPath& path ) = 0; - - // fills a path with the current brush - virtual void FillPath( const wxGraphicsPath& path, int fillStyle = wxODDEVEN_RULE ) = 0; - - // draws a path by first filling and then stroking - virtual void DrawPath( const wxGraphicsPath& path, int fillStyle = wxODDEVEN_RULE ); - - // - // text - // - - virtual void DrawText( const wxString &str, wxDouble x, wxDouble y ) = 0; - - virtual void DrawText( const wxString &str, wxDouble x, wxDouble y, wxDouble angle ); - - virtual void DrawText( const wxString &str, wxDouble x, wxDouble y, const wxGraphicsBrush& backgroundBrush ) ; - - virtual void DrawText( const wxString &str, wxDouble x, wxDouble y, wxDouble angle, const wxGraphicsBrush& backgroundBrush ); - - virtual void GetTextExtent( const wxString &text, wxDouble *width, wxDouble *height, - wxDouble *descent, wxDouble *externalLeading ) const = 0; - - virtual void GetPartialTextExtents(const wxString& text, wxArrayDouble& widths) const = 0; - - // - // image support - // -#if wxABI_VERSION >= 20809 - void DrawGraphicsBitmap( const wxGraphicsBitmap &bmp, wxDouble x, wxDouble y, wxDouble w, wxDouble h ); -#endif - - virtual void DrawBitmap( const wxBitmap &bmp, wxDouble x, wxDouble y, wxDouble w, wxDouble h ) = 0; - - virtual void DrawIcon( const wxIcon &icon, wxDouble x, wxDouble y, wxDouble w, wxDouble h ) = 0; - - // - // convenience methods - // - - // strokes a single line - virtual void StrokeLine( wxDouble x1, wxDouble y1, wxDouble x2, wxDouble y2); - - // stroke lines connecting each of the points - virtual void StrokeLines( size_t n, const wxPoint2DDouble *points); - - // stroke disconnected lines from begin to end points - virtual void StrokeLines( size_t n, const wxPoint2DDouble *beginPoints, const wxPoint2DDouble *endPoints); - - // draws a polygon - virtual void DrawLines( size_t n, const wxPoint2DDouble *points, int fillStyle = wxODDEVEN_RULE ); - - // draws a polygon - virtual void DrawRectangle( wxDouble x, wxDouble y, wxDouble w, wxDouble h); - - // draws an ellipse - virtual void DrawEllipse( wxDouble x, wxDouble y, wxDouble w, wxDouble h); - - // draws a rounded rectangle - virtual void DrawRoundedRectangle( wxDouble x, wxDouble y, wxDouble w, wxDouble h, wxDouble radius); - - // wrappers using wxPoint2DDouble TODO - - // helper to determine if a 0.5 offset should be applied for the drawing operation - virtual bool ShouldOffset() const { return false; } - -protected : - - wxGraphicsPen m_pen; - wxGraphicsBrush m_brush; - wxGraphicsFont m_font; - int m_logicalFunction; - -private : - DECLARE_NO_COPY_CLASS(wxGraphicsContext) - DECLARE_ABSTRACT_CLASS(wxGraphicsContext) -}; - -#if 0 - -// -// A graphics figure allows to cache path, pen etc creations, also will be a basis for layering/grouping elements -// - -class WXDLLIMPEXP_CORE wxGraphicsFigure : public wxGraphicsObject -{ -public : - wxGraphicsFigure(wxGraphicsRenderer* renderer) ; -#if wxABI_VERSION >= 20810 - wxGraphicsFigure( const wxGraphicsFigure& other) : wxGraphicsObject( other ) {} - wxGraphicsFigure& operator= (const wxGraphicsFigure & other) { Ref(other); return *this;} -#endif - - virtual ~wxGraphicsFigure() ; - - void SetPath( wxGraphicsMatrix* matrix ); - - void SetMatrix( wxGraphicsPath* path); - - // draws this object on the context - virtual void Draw( wxGraphicsContext* cg ); - - // returns the path of this object - wxGraphicsPath* GetPath() { return m_path; } - - // returns the transformation matrix of this object, may be null if there is no transformation necessary - wxGraphicsMatrix* GetMatrix() { return m_matrix; } - -private : - wxGraphicsMatrix* m_matrix; - wxGraphicsPath* m_path; - - DECLARE_DYNAMIC_CLASS(wxGraphicsFigure) -} ; - -#endif - -// -// The graphics renderer is the instance corresponding to the rendering engine used, eg there is ONE core graphics renderer -// instance on OSX. This instance is pointed back to by all objects created by it. Therefore you can create eg additional -// paths at any point from a given matrix etc. -// - -class WXDLLIMPEXP_CORE wxGraphicsRenderer : public wxObject -{ -public : - wxGraphicsRenderer() {} - - virtual ~wxGraphicsRenderer() {} - - static wxGraphicsRenderer* GetDefaultRenderer(); - -#if wxABI_VERSION >= 20811 - static wxGraphicsRenderer* GetCairoRenderer(); -#endif - // Context - - virtual wxGraphicsContext * CreateContext( const wxWindowDC& dc) = 0 ; -#ifdef __WXMSW__ - virtual wxGraphicsContext * CreateContext( const wxMemoryDC& dc) = 0 ; -#endif - virtual wxGraphicsContext * CreateContextFromNativeContext( void * context ) = 0; - - virtual wxGraphicsContext * CreateContextFromNativeWindow( void * window ) = 0; - - virtual wxGraphicsContext * CreateContext( wxWindow* window ) = 0; - - // create a context that can be used for measuring texts only, no drawing allowed - virtual wxGraphicsContext * CreateMeasuringContext() = 0; - - // Path - - virtual wxGraphicsPath CreatePath() = 0; - - // Matrix - - virtual wxGraphicsMatrix CreateMatrix( wxDouble a=1.0, wxDouble b=0.0, wxDouble c=0.0, wxDouble d=1.0, - wxDouble tx=0.0, wxDouble ty=0.0) = 0; - - // Paints - - virtual wxGraphicsPen CreatePen(const wxPen& pen) = 0 ; - - virtual wxGraphicsBrush CreateBrush(const wxBrush& brush ) = 0 ; - - // sets the brush to a linear gradient, starting at (x1,y1) with color c1 to (x2,y2) with color c2 - virtual wxGraphicsBrush CreateLinearGradientBrush( wxDouble x1, wxDouble y1, wxDouble x2, wxDouble y2, - const wxColour&c1, const wxColour&c2) = 0; - - // sets the brush to a radial gradient originating at (xo,yc) with color oColor and ends on a circle around (xc,yc) - // with radius r and color cColor - virtual wxGraphicsBrush CreateRadialGradientBrush( wxDouble xo, wxDouble yo, wxDouble xc, wxDouble yc, wxDouble radius, - const wxColour &oColor, const wxColour &cColor) = 0; - - // sets the font - virtual wxGraphicsFont CreateFont( const wxFont &font , const wxColour &col = *wxBLACK ) = 0; - -#if wxABI_VERSION >= 20809 - wxGraphicsBitmap CreateBitmap( const wxBitmap &bmp ); -#endif - -private : - DECLARE_NO_COPY_CLASS(wxGraphicsRenderer) - DECLARE_ABSTRACT_CLASS(wxGraphicsRenderer) -} ; - -#endif - -#endif // _WX_GRAPHICS_H_ diff --git a/wxWidgets/include/wx/grid.h b/wxWidgets/include/wx/grid.h deleted file mode 100644 index 6c50126291..0000000000 --- a/wxWidgets/include/wx/grid.h +++ /dev/null @@ -1,18 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/grid.h -// Purpose: wxGrid base header -// Author: Julian Smart -// Modified by: -// Created: -// Copyright: (c) Julian Smart -// RCS-ID: $Id: grid.h 33948 2005-05-04 18:57:50Z JS $ -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_GRID_H_BASE_ -#define _WX_GRID_H_BASE_ - -#include "wx/generic/grid.h" - -#endif - // _WX_GRID_H_BASE_ diff --git a/wxWidgets/include/wx/gsocket.h b/wxWidgets/include/wx/gsocket.h deleted file mode 100644 index 83d8ee49b6..0000000000 --- a/wxWidgets/include/wx/gsocket.h +++ /dev/null @@ -1,184 +0,0 @@ -/* ------------------------------------------------------------------------- - * Project: GSocket (Generic Socket) - * Name: gsocket.h - * Author: Guilhem Lavaux - * Guillermo Rodriguez Garcia (maintainer) - * Copyright: (c) Guilhem Lavaux - * Licence: wxWindows Licence - * Purpose: GSocket include file (system independent) - * CVSID: $Id: gsocket.h 33948 2005-05-04 18:57:50Z JS $ - * ------------------------------------------------------------------------- - */ - -#ifndef __GSOCKET_H -#define __GSOCKET_H - -#ifndef __GSOCKET_STANDALONE__ -#include "wx/defs.h" - -#include "wx/dlimpexp.h" /* for WXDLLIMPEXP_NET */ - -#endif - -#if wxUSE_SOCKETS || defined(__GSOCKET_STANDALONE__) - -#include - -/* - Including sys/types.h under cygwin results in the warnings about "fd_set - having been defined in sys/types.h" when winsock.h is included later and - doesn't seem to be necessary anyhow. It's not needed under Mac neither. - */ -#if !defined(__WXMAC__) && !defined(__CYGWIN__) && !defined(__WXWINCE__) -#include -#endif - -#ifdef __WXWINCE__ -#include -#endif - -class GSocket; - -#ifdef __cplusplus -extern "C" { -#endif - -typedef struct _GAddress GAddress; - -typedef enum { - GSOCK_NOFAMILY = 0, - GSOCK_INET, - GSOCK_INET6, - GSOCK_UNIX -} GAddressType; - -typedef enum { - GSOCK_STREAMED, - GSOCK_UNSTREAMED -} GSocketStream; - -typedef enum { - GSOCK_NOERROR = 0, - GSOCK_INVOP, - GSOCK_IOERR, - GSOCK_INVADDR, - GSOCK_INVSOCK, - GSOCK_NOHOST, - GSOCK_INVPORT, - GSOCK_WOULDBLOCK, - GSOCK_TIMEDOUT, - GSOCK_MEMERR, - GSOCK_OPTERR -} GSocketError; - -/* See below for an explanation on how events work. - */ -typedef enum { - GSOCK_INPUT = 0, - GSOCK_OUTPUT = 1, - GSOCK_CONNECTION = 2, - GSOCK_LOST = 3, - GSOCK_MAX_EVENT = 4 -} GSocketEvent; - -enum { - GSOCK_INPUT_FLAG = 1 << GSOCK_INPUT, - GSOCK_OUTPUT_FLAG = 1 << GSOCK_OUTPUT, - GSOCK_CONNECTION_FLAG = 1 << GSOCK_CONNECTION, - GSOCK_LOST_FLAG = 1 << GSOCK_LOST -}; - -typedef int GSocketEventFlags; - -typedef void (*GSocketCallback)(GSocket *socket, GSocketEvent event, - char *cdata); - - -/* Functions tables for internal use by GSocket code: */ - -/* Actually this is a misnomer now, but reusing this name means I don't - have to ifdef app traits or common socket code */ -class GSocketGUIFunctionsTable -{ -public: - // needed since this class declares virtual members - virtual ~GSocketGUIFunctionsTable() { } - virtual bool OnInit() = 0; - virtual void OnExit() = 0; - virtual bool CanUseEventLoop() = 0; - virtual bool Init_Socket(GSocket *socket) = 0; - virtual void Destroy_Socket(GSocket *socket) = 0; -#ifndef __WINDOWS__ - virtual void Install_Callback(GSocket *socket, GSocketEvent event) = 0; - virtual void Uninstall_Callback(GSocket *socket, GSocketEvent event) = 0; -#endif - virtual void Enable_Events(GSocket *socket) = 0; - virtual void Disable_Events(GSocket *socket) = 0; -}; - - -/* Global initializers */ - -/* Sets GUI functions callbacks. Must be called *before* GSocket_Init - if the app uses async sockets. */ -void GSocket_SetGUIFunctions(GSocketGUIFunctionsTable *guifunc); - -/* GSocket_Init() must be called at the beginning */ -int GSocket_Init(void); - -/* GSocket_Cleanup() must be called at the end */ -void GSocket_Cleanup(void); - - -/* Constructors / Destructors */ - -GSocket *GSocket_new(void); - - -/* GAddress */ - -GAddress *GAddress_new(void); -GAddress *GAddress_copy(GAddress *address); -void GAddress_destroy(GAddress *address); - -void GAddress_SetFamily(GAddress *address, GAddressType type); -GAddressType GAddress_GetFamily(GAddress *address); - -/* The use of any of the next functions will set the address family to - * the specific one. For example if you use GAddress_INET_SetHostName, - * address family will be implicitly set to AF_INET. - */ - -GSocketError GAddress_INET_SetHostName(GAddress *address, const char *hostname); -GSocketError GAddress_INET_SetAnyAddress(GAddress *address); -GSocketError GAddress_INET_SetHostAddress(GAddress *address, - unsigned long hostaddr); -GSocketError GAddress_INET_SetPortName(GAddress *address, const char *port, - const char *protocol); -GSocketError GAddress_INET_SetPort(GAddress *address, unsigned short port); - -GSocketError GAddress_INET_GetHostName(GAddress *address, char *hostname, - size_t sbuf); -unsigned long GAddress_INET_GetHostAddress(GAddress *address); -unsigned short GAddress_INET_GetPort(GAddress *address); - -/* TODO: Define specific parts (INET6, UNIX) */ - -GSocketError GAddress_UNIX_SetPath(GAddress *address, const char *path); -GSocketError GAddress_UNIX_GetPath(GAddress *address, char *path, size_t sbuf); - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -# if defined(__WINDOWS__) -# include "wx/msw/gsockmsw.h" -# elif defined(__WXMAC__) && !defined(__DARWIN__) -# include "wx/mac/gsockmac.h" -# else -# include "wx/unix/gsockunx.h" -# endif - -#endif /* wxUSE_SOCKETS || defined(__GSOCKET_STANDALONE__) */ - -#endif /* __GSOCKET_H */ diff --git a/wxWidgets/include/wx/hash.h b/wxWidgets/include/wx/hash.h deleted file mode 100644 index 69cc9ad53e..0000000000 --- a/wxWidgets/include/wx/hash.h +++ /dev/null @@ -1,630 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/hash.h -// Purpose: wxHashTable class -// Author: Julian Smart -// Modified by: VZ at 25.02.00: type safe hashes with WX_DECLARE_HASH() -// Created: 01/02/97 -// RCS-ID: $Id: hash.h 53135 2008-04-12 02:31:04Z VZ $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_HASH_H__ -#define _WX_HASH_H__ - -#include "wx/defs.h" - -#if !wxUSE_STL && WXWIN_COMPATIBILITY_2_4 - #define wxUSE_OLD_HASH_TABLE 1 -#else - #define wxUSE_OLD_HASH_TABLE 0 -#endif - -#if !wxUSE_STL - #include "wx/object.h" -#else - class WXDLLIMPEXP_BASE wxObject; -#endif -#if wxUSE_OLD_HASH_TABLE - #include "wx/list.h" -#endif -#if WXWIN_COMPATIBILITY_2_4 - #include "wx/dynarray.h" -#endif - -// the default size of the hash -#define wxHASH_SIZE_DEFAULT (1000) - -/* - * A hash table is an array of user-definable size with lists - * of data items hanging off the array positions. Usually there'll - * be a hit, so no search is required; otherwise we'll have to run down - * the list to find the desired item. -*/ - -// ---------------------------------------------------------------------------- -// this is the base class for object hashes: hash tables which contain -// pointers to objects -// ---------------------------------------------------------------------------- - -#if wxUSE_OLD_HASH_TABLE - -class WXDLLIMPEXP_BASE wxHashTableBase : public wxObject -{ -public: - wxHashTableBase(); - - void Create(wxKeyType keyType = wxKEY_INTEGER, - size_t size = wxHASH_SIZE_DEFAULT); - void Destroy(); - - size_t GetSize() const { return m_hashSize; } - size_t GetCount() const { return m_count; } - - void DeleteContents(bool flag); - -protected: - // find the node for (key, value) - wxNodeBase *GetNode(long key, long value) const; - - // the array of lists in which we store the values for given key hash - wxListBase **m_hashTable; - - // the size of m_lists array - size_t m_hashSize; - - // the type of indexing we use - wxKeyType m_keyType; - - // the total number of elements in the hash - size_t m_count; - - // should we delete our data? - bool m_deleteContents; - -private: - // no copy ctor/assignment operator (yet) - DECLARE_NO_COPY_CLASS(wxHashTableBase) -}; - -#else // if !wxUSE_OLD_HASH_TABLE - -#if !defined(wxENUM_KEY_TYPE_DEFINED) -#define wxENUM_KEY_TYPE_DEFINED - -enum wxKeyType -{ - wxKEY_NONE, - wxKEY_INTEGER, - wxKEY_STRING -}; - -#endif - -union wxHashKeyValue -{ - long integer; - wxChar *string; -}; - -// for some compilers (AIX xlC), defining it as friend inside the class is not -// enough, so provide a real forward declaration -class WXDLLIMPEXP_FWD_BASE wxHashTableBase; - -class WXDLLIMPEXP_BASE wxHashTableBase_Node -{ - friend class WXDLLIMPEXP_FWD_BASE wxHashTableBase; - typedef class WXDLLIMPEXP_FWD_BASE wxHashTableBase_Node _Node; -public: - wxHashTableBase_Node( long key, void* value, - wxHashTableBase* table ); - wxHashTableBase_Node( const wxChar* key, void* value, - wxHashTableBase* table ); - ~wxHashTableBase_Node(); - - long GetKeyInteger() const { return m_key.integer; } - const wxChar* GetKeyString() const { return m_key.string; } - - void* GetData() const { return m_value; } - void SetData( void* data ) { m_value = data; } - -protected: - _Node* GetNext() const { return m_next; } - -protected: - // next node in the chain - wxHashTableBase_Node* m_next; - - // key - wxHashKeyValue m_key; - - // value - void* m_value; - - // pointer to the hash containing the node, used to remove the - // node from the hash when the user deletes the node iterating - // through it - // TODO: move it to wxHashTable_Node (only wxHashTable supports - // iteration) - wxHashTableBase* m_hashPtr; -}; - -class WXDLLIMPEXP_BASE wxHashTableBase -#if !wxUSE_STL - : public wxObject -#endif -{ - friend class WXDLLIMPEXP_FWD_BASE wxHashTableBase_Node; -public: - typedef wxHashTableBase_Node Node; - - wxHashTableBase(); - virtual ~wxHashTableBase() { } - - void Create( wxKeyType keyType = wxKEY_INTEGER, - size_t size = wxHASH_SIZE_DEFAULT ); - void Clear(); - void Destroy(); - - size_t GetSize() const { return m_size; } - size_t GetCount() const { return m_count; } - - void DeleteContents( bool flag ) { m_deleteContents = flag; } - - static long MakeKey(const wxChar *string); - -protected: - void DoPut( long key, long hash, void* data ); - void DoPut( const wxChar* key, long hash, void* data ); - void* DoGet( long key, long hash ) const; - void* DoGet( const wxChar* key, long hash ) const; - void* DoDelete( long key, long hash ); - void* DoDelete( const wxChar* key, long hash ); - -private: - // Remove the node from the hash, *only called from - // ~wxHashTable*_Node destructor - void DoRemoveNode( wxHashTableBase_Node* node ); - - // destroys data contained in the node if appropriate: - // deletes the key if it is a string and destrys - // the value if m_deleteContents is true - void DoDestroyNode( wxHashTableBase_Node* node ); - - // inserts a node in the table (at the end of the chain) - void DoInsertNode( size_t bucket, wxHashTableBase_Node* node ); - - // removes a node from the table (fiven a pointer to the previous - // but does not delete it (only deletes its contents) - void DoUnlinkNode( size_t bucket, wxHashTableBase_Node* node, - wxHashTableBase_Node* prev ); - - // unconditionally deletes node value (invoking the - // correct destructor) - virtual void DoDeleteContents( wxHashTableBase_Node* node ) = 0; - -protected: - // number of buckets - size_t m_size; - - // number of nodes (key/value pairs) - size_t m_count; - - // table - Node** m_table; - - // key typ (INTEGER/STRING) - wxKeyType m_keyType; - - // delete contents when hash is cleared - bool m_deleteContents; - -private: - DECLARE_NO_COPY_CLASS(wxHashTableBase) -}; - -#endif // wxUSE_OLD_HASH_TABLE - -#if !wxUSE_STL - -#if WXWIN_COMPATIBILITY_2_4 - -// ---------------------------------------------------------------------------- -// a hash table which stores longs -// ---------------------------------------------------------------------------- - -class WXDLLIMPEXP_BASE wxHashTableLong : public wxObject -{ -public: - wxHashTableLong(size_t size = wxHASH_SIZE_DEFAULT) - { Init(size); } - virtual ~wxHashTableLong(); - - void Create(size_t size = wxHASH_SIZE_DEFAULT); - void Destroy(); - - size_t GetSize() const { return m_hashSize; } - size_t GetCount() const { return m_count; } - - void Put(long key, long value); - long Get(long key) const; - long Delete(long key); - -protected: - void Init(size_t size); - -private: - wxArrayLong **m_values, - **m_keys; - - // the size of array above - size_t m_hashSize; - - // the total number of elements in the hash - size_t m_count; - - // not implemented yet - DECLARE_NO_COPY_CLASS(wxHashTableLong) -}; - -// ---------------------------------------------------------------------------- -// wxStringHashTable: a hash table which indexes strings with longs -// ---------------------------------------------------------------------------- - -class WXDLLIMPEXP_BASE wxStringHashTable : public wxObject -{ -public: - wxStringHashTable(size_t sizeTable = wxHASH_SIZE_DEFAULT); - virtual ~wxStringHashTable(); - - // add a string associated with this key to the table - void Put(long key, const wxString& value); - - // get the string from the key: if not found, an empty string is returned - // and the wasFound is set to false if not NULL - wxString Get(long key, bool *wasFound = NULL) const; - - // remove the item, returning true if the item was found and deleted - bool Delete(long key) const; - - // clean up - void Destroy(); - -private: - wxArrayLong **m_keys; - wxArrayString **m_values; - - // the size of array above - size_t m_hashSize; - - DECLARE_NO_COPY_CLASS(wxStringHashTable) -}; - -#endif // WXWIN_COMPATIBILITY_2_4 - -#endif // !wxUSE_STL - -// ---------------------------------------------------------------------------- -// for compatibility only -// ---------------------------------------------------------------------------- - -#if !wxUSE_OLD_HASH_TABLE - -class WXDLLIMPEXP_BASE wxHashTable_Node : public wxHashTableBase_Node -{ - friend class WXDLLIMPEXP_FWD_BASE wxHashTable; -public: - wxHashTable_Node( long key, void* value, - wxHashTableBase* table ) - : wxHashTableBase_Node( key, value, table ) { } - wxHashTable_Node( const wxChar* key, void* value, - wxHashTableBase* table ) - : wxHashTableBase_Node( key, value, table ) { } - - wxObject* GetData() const - { return (wxObject*)wxHashTableBase_Node::GetData(); } - void SetData( wxObject* data ) - { wxHashTableBase_Node::SetData( data ); } - - wxHashTable_Node* GetNext() const - { return (wxHashTable_Node*)wxHashTableBase_Node::GetNext(); } -}; - -// should inherit protectedly, but it is public for compatibility in -// order to publicly inherit from wxObject -class WXDLLIMPEXP_BASE wxHashTable : public wxHashTableBase -{ - typedef wxHashTableBase hash; -public: - typedef wxHashTable_Node Node; - typedef wxHashTable_Node* compatibility_iterator; -public: - wxHashTable( wxKeyType keyType = wxKEY_INTEGER, - size_t size = wxHASH_SIZE_DEFAULT ) - : wxHashTableBase() { Create( keyType, size ); BeginFind(); } - wxHashTable( const wxHashTable& table ); - - virtual ~wxHashTable() { Destroy(); } - - const wxHashTable& operator=( const wxHashTable& ); - - // key and value are the same - void Put(long value, wxObject *object) - { DoPut( value, value, object ); } - void Put(long lhash, long value, wxObject *object) - { DoPut( value, lhash, object ); } - void Put(const wxChar *value, wxObject *object) - { DoPut( value, MakeKey( value ), object ); } - void Put(long lhash, const wxChar *value, wxObject *object) - { DoPut( value, lhash, object ); } - - // key and value are the same - wxObject *Get(long value) const - { return (wxObject*)DoGet( value, value ); } - wxObject *Get(long lhash, long value) const - { return (wxObject*)DoGet( value, lhash ); } - wxObject *Get(const wxChar *value) const - { return (wxObject*)DoGet( value, MakeKey( value ) ); } - wxObject *Get(long lhash, const wxChar *value) const - { return (wxObject*)DoGet( value, lhash ); } - - // Deletes entry and returns data if found - wxObject *Delete(long key) - { return (wxObject*)DoDelete( key, key ); } - wxObject *Delete(long lhash, long key) - { return (wxObject*)DoDelete( key, lhash ); } - wxObject *Delete(const wxChar *key) - { return (wxObject*)DoDelete( key, MakeKey( key ) ); } - wxObject *Delete(long lhash, const wxChar *key) - { return (wxObject*)DoDelete( key, lhash ); } - - // Construct your own integer key from a string, e.g. in case - // you need to combine it with something - long MakeKey(const wxChar *string) const - { return wxHashTableBase::MakeKey(string); } - - // Way of iterating through whole hash table (e.g. to delete everything) - // Not necessary, of course, if you're only storing pointers to - // objects maintained separately - void BeginFind() { m_curr = NULL; m_currBucket = 0; } - Node* Next(); - - void Clear() { wxHashTableBase::Clear(); } - - size_t GetCount() const { return wxHashTableBase::GetCount(); } -protected: - // copy helper - void DoCopy( const wxHashTable& copy ); - - // searches the next node starting from bucket bucketStart and sets - // m_curr to it and m_currBucket to its bucket - void GetNextNode( size_t bucketStart ); -private: - virtual void DoDeleteContents( wxHashTableBase_Node* node ); - - // current node - Node* m_curr; - - // bucket the current node belongs to - size_t m_currBucket; -}; - -#else // if wxUSE_OLD_HASH_TABLE - -class WXDLLIMPEXP_BASE wxHashTable : public wxObject -{ -public: - typedef wxNode Node; - typedef wxNode* compatibility_iterator; - - int n; - int current_position; - wxNode *current_node; - - unsigned int key_type; - wxList **hash_table; - - wxHashTable(int the_key_type = wxKEY_INTEGER, - int size = wxHASH_SIZE_DEFAULT); - virtual ~wxHashTable(); - - // copy ctor and assignment operator - wxHashTable(const wxHashTable& table) : wxObject() - { DoCopy(table); } - wxHashTable& operator=(const wxHashTable& table) - { Clear(); DoCopy(table); return *this; } - - void DoCopy(const wxHashTable& table); - - void Destroy(); - - bool Create(int the_key_type = wxKEY_INTEGER, - int size = wxHASH_SIZE_DEFAULT); - - // Note that there are 2 forms of Put, Get. - // With a key and a value, the *value* will be checked - // when a collision is detected. Otherwise, if there are - // 2 items with a different value but the same key, - // we'll retrieve the WRONG ONE. So where possible, - // supply the required value along with the key. - // In fact, the value-only versions make a key, and still store - // the value. The use of an explicit key might be required - // e.g. when combining several values into one key. - // When doing that, it's highly likely we'll get a collision, - // e.g. 1 + 2 = 3, 2 + 1 = 3. - - // key and value are NOT necessarily the same - void Put(long key, long value, wxObject *object); - void Put(long key, const wxChar *value, wxObject *object); - - // key and value are the same - void Put(long value, wxObject *object); - void Put(const wxChar *value, wxObject *object); - - // key and value not the same - wxObject *Get(long key, long value) const; - wxObject *Get(long key, const wxChar *value) const; - - // key and value are the same - wxObject *Get(long value) const; - wxObject *Get(const wxChar *value) const; - - // Deletes entry and returns data if found - wxObject *Delete(long key); - wxObject *Delete(const wxChar *key); - - wxObject *Delete(long key, int value); - wxObject *Delete(long key, const wxChar *value); - - // Construct your own integer key from a string, e.g. in case - // you need to combine it with something - long MakeKey(const wxChar *string) const; - - // Way of iterating through whole hash table (e.g. to delete everything) - // Not necessary, of course, if you're only storing pointers to - // objects maintained separately - - void BeginFind(); - Node* Next(); - - void DeleteContents(bool flag); - void Clear(); - - // Returns number of nodes - size_t GetCount() const { return m_count; } - -private: - size_t m_count; // number of elements in the hashtable - bool m_deleteContents; - - DECLARE_DYNAMIC_CLASS(wxHashTable) -}; - -#endif // wxUSE_OLD_HASH_TABLE - -#if !wxUSE_OLD_HASH_TABLE - -// defines a new type safe hash table which stores the elements of type eltype -// in lists of class listclass -#define _WX_DECLARE_HASH(eltype, dummy, hashclass, classexp) \ - classexp hashclass : public wxHashTableBase \ - { \ - public: \ - hashclass(wxKeyType keyType = wxKEY_INTEGER, \ - size_t size = wxHASH_SIZE_DEFAULT) \ - : wxHashTableBase() { Create(keyType, size); } \ - \ - virtual ~hashclass() { Destroy(); } \ - \ - void Put(long key, eltype *data) { DoPut(key, key, (void*)data); } \ - void Put(long lhash, long key, eltype *data) \ - { DoPut(key, lhash, (void*)data); } \ - eltype *Get(long key) const { return (eltype*)DoGet(key, key); } \ - eltype *Get(long lhash, long key) const \ - { return (eltype*)DoGet(key, lhash); } \ - eltype *Delete(long key) { return (eltype*)DoDelete(key, key); } \ - eltype *Delete(long lhash, long key) \ - { return (eltype*)DoDelete(key, lhash); } \ - private: \ - virtual void DoDeleteContents( wxHashTableBase_Node* node ) \ - { delete (eltype*)node->GetData(); } \ - \ - DECLARE_NO_COPY_CLASS(hashclass) \ - } - -#else // if wxUSE_OLD_HASH_TABLE - -#define _WX_DECLARE_HASH(eltype, listclass, hashclass, classexp) \ - classexp hashclass : public wxHashTableBase \ - { \ - public: \ - hashclass(wxKeyType keyType = wxKEY_INTEGER, \ - size_t size = wxHASH_SIZE_DEFAULT) \ - { Create(keyType, size); } \ - \ - virtual ~hashclass() { Destroy(); } \ - \ - void Put(long key, long val, eltype *data) { DoPut(key, val, data); } \ - void Put(long key, eltype *data) { DoPut(key, key, data); } \ - \ - eltype *Get(long key, long value) const \ - { \ - wxNodeBase *node = GetNode(key, value); \ - return node ? ((listclass::Node *)node)->GetData() : (eltype *)0; \ - } \ - eltype *Get(long key) const { return Get(key, key); } \ - \ - eltype *Delete(long key, long value) \ - { \ - eltype *data; \ - \ - wxNodeBase *node = GetNode(key, value); \ - if ( node ) \ - { \ - data = ((listclass::Node *)node)->GetData(); \ - \ - delete node; \ - m_count--; \ - } \ - else \ - { \ - data = (eltype *)0; \ - } \ - \ - return data; \ - } \ - eltype *Delete(long key) { return Delete(key, key); } \ - \ - protected: \ - void DoPut(long key, long value, eltype *data) \ - { \ - size_t slot = (size_t)abs((int)(key % (long)m_hashSize)); \ - \ - if ( !m_hashTable[slot] ) \ - { \ - m_hashTable[slot] = new listclass(m_keyType); \ - if ( m_deleteContents ) \ - m_hashTable[slot]->DeleteContents(true); \ - } \ - \ - ((listclass *)m_hashTable[slot])->Append(value, data); \ - m_count++; \ - } \ - \ - DECLARE_NO_COPY_CLASS(hashclass) \ - } - -#endif // wxUSE_OLD_HASH_TABLE - -// this macro is to be used in the user code -#define WX_DECLARE_HASH(el, list, hash) \ - _WX_DECLARE_HASH(el, list, hash, class) - -// and this one does exactly the same thing but should be used inside the -// library -#define WX_DECLARE_EXPORTED_HASH(el, list, hash) \ - _WX_DECLARE_HASH(el, list, hash, class WXDLLEXPORT) - -#define WX_DECLARE_USER_EXPORTED_HASH(el, list, hash, usergoo) \ - _WX_DECLARE_HASH(el, list, hash, class usergoo) - -// delete all hash elements -// -// NB: the class declaration of the hash elements must be visible from the -// place where you use this macro, otherwise the proper destructor may not -// be called (a decent compiler should give a warning about it, but don't -// count on it)! -#define WX_CLEAR_HASH_TABLE(hash) \ - { \ - (hash).BeginFind(); \ - wxHashTable::compatibility_iterator it = (hash).Next(); \ - while( it ) \ - { \ - delete it->GetData(); \ - it = (hash).Next(); \ - } \ - (hash).Clear(); \ - } - -#endif - // _WX_HASH_H__ diff --git a/wxWidgets/include/wx/hashmap.h b/wxWidgets/include/wx/hashmap.h deleted file mode 100644 index 425315dc0a..0000000000 --- a/wxWidgets/include/wx/hashmap.h +++ /dev/null @@ -1,739 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/hashmap.h -// Purpose: wxHashMap class -// Author: Mattia Barbon -// Modified by: -// Created: 29/01/2002 -// RCS-ID: $Id: hashmap.h 57388 2008-12-17 09:34:48Z VZ $ -// Copyright: (c) Mattia Barbon -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_HASHMAP_H_ -#define _WX_HASHMAP_H_ - -#include "wx/string.h" - -// In wxUSE_STL build we prefer to use the standard hash map class but it can -// be either in non-standard hash_map header (old g++ and some other STL -// implementations) or in C++0x standard unordered_map which can in turn be -// available either in std::tr1 or std namespace itself -// -// To summarize: if std::unordered_map is available use it, otherwise use tr1 -// and finally fall back to non-standard hash_map - -#if (defined(HAVE_EXT_HASH_MAP) || defined(HAVE_HASH_MAP)) \ - && (defined(HAVE_GNU_CXX_HASH_MAP) || defined(HAVE_STD_HASH_MAP)) - #define HAVE_STL_HASH_MAP -#endif - -#if wxUSE_STL && \ - (defined(HAVE_STD_UNORDERED_MAP) || defined(HAVE_TR1_UNORDERED_MAP)) - -#if defined(HAVE_STD_UNORDERED_MAP) - #include - #define WX_HASH_MAP_NAMESPACE std -#elif defined(HAVE_TR1_UNORDERED_MAP) - #include - #define WX_HASH_MAP_NAMESPACE std::tr1 -#endif - -#define _WX_DECLARE_HASH_MAP( KEY_T, VALUE_T, HASH_T, KEY_EQ_T, CLASSNAME, CLASSEXP ) \ - typedef WX_HASH_MAP_NAMESPACE::unordered_map< KEY_T, VALUE_T, HASH_T, KEY_EQ_T > CLASSNAME - -#elif wxUSE_STL && defined(HAVE_STL_HASH_MAP) - -#if defined(HAVE_EXT_HASH_MAP) - #include -#elif defined(HAVE_HASH_MAP) - #include -#endif - -#if defined(HAVE_GNU_CXX_HASH_MAP) - #define WX_HASH_MAP_NAMESPACE __gnu_cxx -#elif defined(HAVE_STD_HASH_MAP) - #define WX_HASH_MAP_NAMESPACE std -#endif - -#define _WX_DECLARE_HASH_MAP( KEY_T, VALUE_T, HASH_T, KEY_EQ_T, CLASSNAME, CLASSEXP ) \ - typedef WX_HASH_MAP_NAMESPACE::hash_map< KEY_T, VALUE_T, HASH_T, KEY_EQ_T > CLASSNAME - -#else // !wxUSE_STL || no std::{hash,unordered}_map class available - -#define wxNEEDS_WX_HASH_MAP - -#ifdef __WXWINCE__ -typedef int ptrdiff_t; -#else -#include // for ptrdiff_t -#endif - -// private -struct WXDLLIMPEXP_BASE _wxHashTable_NodeBase -{ - _wxHashTable_NodeBase() : m_nxt(0) {} - - _wxHashTable_NodeBase* m_nxt; - -// Cannot do this: -// DECLARE_NO_COPY_CLASS(_wxHashTable_NodeBase) -// without rewriting the macros, which require a public copy constructor. -}; - -// private -class WXDLLIMPEXP_BASE _wxHashTableBase2 -{ -public: - typedef void (*NodeDtor)(_wxHashTable_NodeBase*); - typedef unsigned long (*BucketFromNode)(_wxHashTableBase2*,_wxHashTable_NodeBase*); - typedef _wxHashTable_NodeBase* (*ProcessNode)(_wxHashTable_NodeBase*); -protected: - static _wxHashTable_NodeBase* DummyProcessNode(_wxHashTable_NodeBase* node); - static void DeleteNodes( size_t buckets, _wxHashTable_NodeBase** table, - NodeDtor dtor ); - static _wxHashTable_NodeBase* GetFirstNode( size_t buckets, - _wxHashTable_NodeBase** table ) - { - for( size_t i = 0; i < buckets; ++i ) - if( table[i] ) - return table[i]; - return 0; - } - - // as static const unsigned prime_count = 31 but works with all compilers - enum { prime_count = 31 }; - static const unsigned long ms_primes[prime_count]; - - // returns the first prime in ms_primes greater than n - static unsigned long GetNextPrime( unsigned long n ); - - // returns the first prime in ms_primes smaller than n - // ( or ms_primes[0] if n is very small ) - static unsigned long GetPreviousPrime( unsigned long n ); - - static void CopyHashTable( _wxHashTable_NodeBase** srcTable, - size_t srcBuckets, _wxHashTableBase2* dst, - _wxHashTable_NodeBase** dstTable, - BucketFromNode func, ProcessNode proc ); - - static void** AllocTable( size_t sz ) - { - return (void **)calloc(sz, sizeof(void*)); - } - static void FreeTable(void *table) - { - free(table); - } -}; - -#define _WX_DECLARE_HASHTABLE( VALUE_T, KEY_T, HASH_T, KEY_EX_T, KEY_EQ_T, CLASSNAME, CLASSEXP, SHOULD_GROW, SHOULD_SHRINK ) \ -CLASSEXP CLASSNAME : protected _wxHashTableBase2 \ -{ \ -public: \ - typedef KEY_T key_type; \ - typedef VALUE_T value_type; \ - typedef HASH_T hasher; \ - typedef KEY_EQ_T key_equal; \ - \ - typedef size_t size_type; \ - typedef ptrdiff_t difference_type; \ - typedef value_type* pointer; \ - typedef const value_type* const_pointer; \ - typedef value_type& reference; \ - typedef const value_type& const_reference; \ - /* should these be protected? */ \ - typedef const KEY_T const_key_type; \ - typedef const VALUE_T const_mapped_type; \ -public: \ - struct Node; \ - typedef KEY_EX_T key_extractor; \ - typedef CLASSNAME Self; \ -protected: \ - Node** m_table; \ - size_t m_tableBuckets; \ - size_t m_items; \ - hasher m_hasher; \ - key_equal m_equals; \ - key_extractor m_getKey; \ -public: \ - struct Node:public _wxHashTable_NodeBase \ - { \ - public: \ - Node( const value_type& value ) \ - : m_value( value ) {} \ - Node* m_next() { return (Node*)this->m_nxt; } \ - \ - value_type m_value; \ - }; \ - \ - CLASSEXP Iterator; \ - friend CLASSEXP Iterator; \ -protected: \ - static void DeleteNode( _wxHashTable_NodeBase* node ) \ - { \ - delete (Node*)node; \ - } \ -public: \ - /* */ \ - /* forward iterator */ \ - /* */ \ - CLASSEXP Iterator \ - { \ - public: \ - Node* m_node; \ - Self* m_ht; \ - \ - Iterator() : m_node(0), m_ht(0) {} \ - Iterator( Node* node, const Self* ht ) \ - : m_node(node), m_ht((Self*)ht) {} \ - bool operator ==( const Iterator& it ) const \ - { return m_node == it.m_node; } \ - bool operator !=( const Iterator& it ) const \ - { return m_node != it.m_node; } \ - protected: \ - Node* GetNextNode() \ - { \ - size_type bucket = GetBucketForNode(m_ht,m_node); \ - for( size_type i = bucket + 1; i < m_ht->m_tableBuckets; ++i ) \ - { \ - if( m_ht->m_table[i] ) \ - return m_ht->m_table[i]; \ - } \ - return 0; \ - } \ - \ - void PlusPlus() \ - { \ - Node* next = m_node->m_next(); \ - m_node = next ? next : GetNextNode(); \ - } \ - }; \ - \ -public: \ - CLASSEXP iterator : public Iterator \ - { \ - public: \ - iterator() : Iterator() {} \ - iterator( Node* node, Self* ht ) : Iterator( node, ht ) {} \ - iterator& operator++() { PlusPlus(); return *this; } \ - iterator operator++(int) { iterator it=*this;PlusPlus();return it; } \ - reference operator *() const { return m_node->m_value; } \ - pointer operator ->() const { return &(m_node->m_value); } \ - }; \ - \ - CLASSEXP const_iterator : public Iterator \ - { \ - public: \ - const_iterator() : Iterator() {} \ - const_iterator(iterator i) : Iterator(i) {} \ - const_iterator( Node* node, const Self* ht ) \ - : Iterator( node, (Self*)ht ) {} \ - const_iterator& operator++() { PlusPlus();return *this; } \ - const_iterator operator++(int) { const_iterator it=*this;PlusPlus();return it; } \ - const_reference operator *() const { return m_node->m_value; } \ - const_pointer operator ->() const { return &(m_node->m_value); } \ - }; \ - \ - CLASSNAME( size_type sz = 10, const hasher& hfun = hasher(), \ - const key_equal& k_eq = key_equal(), \ - const key_extractor& k_ex = key_extractor() ) \ - : m_tableBuckets( GetNextPrime( (unsigned long) sz ) ), \ - m_items( 0 ), \ - m_hasher( hfun ), \ - m_equals( k_eq ), \ - m_getKey( k_ex ) \ - { \ - m_table = (Node**)AllocTable( m_tableBuckets ); \ - } \ - \ - CLASSNAME( const Self& ht ) \ - : m_table( 0 ), \ - m_tableBuckets( 0 ), \ - m_items( ht.m_items ), \ - m_hasher( ht.m_hasher ), \ - m_equals( ht.m_equals ), \ - m_getKey( ht.m_getKey ) \ - { \ - HashCopy( ht ); \ - } \ - \ - const Self& operator=( const Self& ht ) \ - { \ - clear(); \ - m_hasher = ht.m_hasher; \ - m_equals = ht.m_equals; \ - m_getKey = ht.m_getKey; \ - m_items = ht.m_items; \ - HashCopy( ht ); \ - return *this; \ - } \ - \ - ~CLASSNAME() \ - { \ - clear(); \ - \ - FreeTable(m_table); \ - } \ - \ - hasher hash_funct() { return m_hasher; } \ - key_equal key_eq() { return m_equals; } \ - \ - /* removes all elements from the hash table, but does not */ \ - /* shrink it ( perhaps it should ) */ \ - void clear() \ - { \ - DeleteNodes( m_tableBuckets, (_wxHashTable_NodeBase**)m_table, \ - DeleteNode ); \ - m_items = 0; \ - } \ - \ - size_type size() const { return m_items; } \ - size_type max_size() const { return size_type(-1); } \ - bool empty() const { return size() == 0; } \ - \ - const_iterator end() const { return const_iterator( 0, this ); } \ - iterator end() { return iterator( 0, this ); } \ - const_iterator begin() const \ - { return const_iterator( (Node*)GetFirstNode( m_tableBuckets, (_wxHashTable_NodeBase**)m_table ), this ); } \ - iterator begin() \ - { return iterator( (Node*)GetFirstNode( m_tableBuckets, (_wxHashTable_NodeBase**)m_table ), this ); } \ - \ - size_type erase( const const_key_type& key ) \ - { \ - Node** node = GetNodePtr( key ); \ - \ - if( !node ) \ - return 0; \ - \ - --m_items; \ - Node* temp = (*node)->m_next(); \ - delete *node; \ - (*node) = temp; \ - if( SHOULD_SHRINK( m_tableBuckets, m_items ) ) \ - ResizeTable( GetPreviousPrime( (unsigned long) m_tableBuckets ) - 1 ); \ - return 1; \ - } \ - \ -protected: \ - static size_type GetBucketForNode( Self* ht, Node* node ) \ - { \ - return ht->m_hasher( ht->m_getKey( node->m_value ) ) \ - % ht->m_tableBuckets; \ - } \ - static Node* CopyNode( Node* node ) { return new Node( *node ); } \ - \ - Node* GetOrCreateNode( const value_type& value, bool& created ) \ - { \ - const const_key_type& key = m_getKey( value ); \ - size_t bucket = m_hasher( key ) % m_tableBuckets; \ - Node* node = m_table[bucket]; \ - \ - while( node ) \ - { \ - if( m_equals( m_getKey( node->m_value ), key ) ) \ - { \ - created = false; \ - return node; \ - } \ - node = node->m_next(); \ - } \ - created = true; \ - return CreateNode( value, bucket); \ - }\ - Node * CreateNode( const value_type& value, size_t bucket ) \ - {\ - Node* node = new Node( value ); \ - node->m_nxt = m_table[bucket]; \ - m_table[bucket] = node; \ - \ - /* must be after the node is inserted */ \ - ++m_items; \ - if( SHOULD_GROW( m_tableBuckets, m_items ) ) \ - ResizeTable( m_tableBuckets ); \ - \ - return node; \ - } \ - void CreateNode( const value_type& value ) \ - {\ - CreateNode(value, m_hasher( m_getKey(value) ) % m_tableBuckets ); \ - }\ - \ - /* returns NULL if not found */ \ - Node** GetNodePtr( const const_key_type& key ) const \ - { \ - size_t bucket = m_hasher( key ) % m_tableBuckets; \ - Node** node = &m_table[bucket]; \ - \ - while( *node ) \ - { \ - if( m_equals( m_getKey( (*node)->m_value ), key ) ) \ - return node; \ - /* Tell the compiler to not do any strict-aliasing assumptions with a void cast? Can we make such a runtime guarantee? */ \ - node = (Node**)&(*node)->m_nxt; \ - } \ - \ - return NULL; \ - } \ - \ - /* returns NULL if not found */ \ - /* expressing it in terms of GetNodePtr is 5-8% slower :-( */ \ - Node* GetNode( const const_key_type& key ) const \ - { \ - size_t bucket = m_hasher( key ) % m_tableBuckets; \ - Node* node = m_table[bucket]; \ - \ - while( node ) \ - { \ - if( m_equals( m_getKey( node->m_value ), key ) ) \ - return node; \ - node = node->m_next(); \ - } \ - \ - return 0; \ - } \ - \ - void ResizeTable( size_t newSize ) \ - { \ - newSize = GetNextPrime( (unsigned long)newSize ); \ - Node** srcTable = m_table; \ - size_t srcBuckets = m_tableBuckets; \ - m_table = (Node**)AllocTable( newSize ); \ - m_tableBuckets = newSize; \ - \ - CopyHashTable( (_wxHashTable_NodeBase**)srcTable, srcBuckets, \ - this, (_wxHashTable_NodeBase**)m_table, \ - (BucketFromNode)GetBucketForNode,\ - (ProcessNode)&DummyProcessNode ); \ - FreeTable(srcTable); \ - } \ - \ - /* this must be called _after_ m_table has been cleaned */ \ - void HashCopy( const Self& ht ) \ - { \ - ResizeTable( ht.size() ); \ - CopyHashTable( (_wxHashTable_NodeBase**)ht.m_table, ht.m_tableBuckets,\ - (_wxHashTableBase2*)this, \ - (_wxHashTable_NodeBase**)m_table, \ - (BucketFromNode)GetBucketForNode, \ - (ProcessNode)CopyNode ); \ - } \ -}; - -// defines an STL-like pair class CLASSNAME storing two fields: first of type -// KEY_T and second of type VALUE_T -#define _WX_DECLARE_PAIR( KEY_T, VALUE_T, CLASSNAME, CLASSEXP ) \ -CLASSEXP CLASSNAME \ -{ \ -public: \ - typedef KEY_T t1; \ - typedef VALUE_T t2; \ - typedef const KEY_T const_t1; \ - typedef const VALUE_T const_t2; \ - \ - CLASSNAME( const const_t1& f, const const_t2& s ):first(t1(f)),second(t2(s)) {} \ - \ - t1 first; \ - t2 second; \ -}; - -// defines the class CLASSNAME returning the key part (of type KEY_T) from a -// pair of type PAIR_T -#define _WX_DECLARE_HASH_MAP_KEY_EX( KEY_T, PAIR_T, CLASSNAME, CLASSEXP ) \ -CLASSEXP CLASSNAME \ -{ \ - typedef KEY_T key_type; \ - typedef PAIR_T pair_type; \ - typedef const key_type const_key_type; \ - typedef const pair_type const_pair_type; \ - typedef const_key_type& const_key_reference; \ - typedef const_pair_type& const_pair_reference; \ -public: \ - CLASSNAME() { } \ - const_key_reference operator()( const_pair_reference pair ) const { return pair.first; }\ - \ - /* the dummy assignment operator is needed to suppress compiler */ \ - /* warnings from hash table class' operator=(): gcc complains about */ \ - /* "statement with no effect" without it */ \ - CLASSNAME& operator=(const CLASSNAME&) { return *this; } \ -}; - -// grow/shrink predicates -inline bool never_grow( size_t, size_t ) { return false; } -inline bool never_shrink( size_t, size_t ) { return false; } -inline bool grow_lf70( size_t buckets, size_t items ) -{ - return float(items)/float(buckets) >= 0.85; -} - -#endif // various hash map implementations - -// ---------------------------------------------------------------------------- -// hashing and comparison functors -// ---------------------------------------------------------------------------- - -// NB: implementation detail: all of these classes must have dummy assignment -// operators to suppress warnings about "statement with no effect" from gcc -// in the hash table class assignment operator (where they're assigned) - -#ifndef wxNEEDS_WX_HASH_MAP - -// integer types -class WXDLLIMPEXP_BASE wxIntegerHash -{ - WX_HASH_MAP_NAMESPACE::hash longHash; - WX_HASH_MAP_NAMESPACE::hash ulongHash; - WX_HASH_MAP_NAMESPACE::hash intHash; - WX_HASH_MAP_NAMESPACE::hash uintHash; - WX_HASH_MAP_NAMESPACE::hash shortHash; - WX_HASH_MAP_NAMESPACE::hash ushortHash; - -#if defined wxLongLong_t && !defined wxLongLongIsLong - // hash ought to work but doesn't on some compilers - #if (!defined SIZEOF_LONG_LONG && SIZEOF_LONG == 4) \ - || (defined SIZEOF_LONG_LONG && SIZEOF_LONG_LONG == SIZEOF_LONG * 2) - size_t longlongHash( wxLongLong_t x ) const - { - return longHash( wx_truncate_cast(long, x) ) ^ - longHash( wx_truncate_cast(long, x >> (sizeof(long) * 8)) ); - } - #elif defined SIZEOF_LONG_LONG && SIZEOF_LONG_LONG == SIZEOF_LONG - WX_HASH_MAP_NAMESPACE::hash longlongHash; - #else - WX_HASH_MAP_NAMESPACE::hash longlongHash; - #endif -#endif - -public: - wxIntegerHash() { } - size_t operator()( long x ) const { return longHash( x ); } - size_t operator()( unsigned long x ) const { return ulongHash( x ); } - size_t operator()( int x ) const { return intHash( x ); } - size_t operator()( unsigned int x ) const { return uintHash( x ); } - size_t operator()( short x ) const { return shortHash( x ); } - size_t operator()( unsigned short x ) const { return ushortHash( x ); } -#if defined wxLongLong_t && !defined wxLongLongIsLong - size_t operator()( wxLongLong_t x ) const { return longlongHash(x); } - size_t operator()( wxULongLong_t x ) const { return longlongHash(x); } -#endif - - wxIntegerHash& operator=(const wxIntegerHash&) { return *this; } -}; - -#else // wxNEEDS_WX_HASH_MAP - -// integer types -class WXDLLIMPEXP_BASE wxIntegerHash -{ -public: - wxIntegerHash() { } - unsigned long operator()( long x ) const { return (unsigned long)x; } - unsigned long operator()( unsigned long x ) const { return x; } - unsigned long operator()( int x ) const { return (unsigned long)x; } - unsigned long operator()( unsigned int x ) const { return x; } - unsigned long operator()( short x ) const { return (unsigned long)x; } - unsigned long operator()( unsigned short x ) const { return x; } -#if defined wxLongLong_t && !defined wxLongLongIsLong - wxULongLong_t operator()( wxLongLong_t x ) const { return wx_static_cast(wxULongLong_t, x); } - wxULongLong_t operator()( wxULongLong_t x ) const { return x; } -#endif - - wxIntegerHash& operator=(const wxIntegerHash&) { return *this; } -}; - -#endif // !wxNEEDS_WX_HASH_MAP/wxNEEDS_WX_HASH_MAP - -class WXDLLIMPEXP_BASE wxIntegerEqual -{ -public: - wxIntegerEqual() { } - bool operator()( long a, long b ) const { return a == b; } - bool operator()( unsigned long a, unsigned long b ) const { return a == b; } - bool operator()( int a, int b ) const { return a == b; } - bool operator()( unsigned int a, unsigned int b ) const { return a == b; } - bool operator()( short a, short b ) const { return a == b; } - bool operator()( unsigned short a, unsigned short b ) const { return a == b; } -#if defined wxLongLong_t && !defined wxLongLongIsLong - bool operator()( wxLongLong_t a, wxLongLong_t b ) const { return a == b; } - bool operator()( wxULongLong_t a, wxULongLong_t b ) const { return a == b; } -#endif - - wxIntegerEqual& operator=(const wxIntegerEqual&) { return *this; } -}; - -// pointers -class WXDLLIMPEXP_BASE wxPointerHash -{ -public: - wxPointerHash() { } - -#ifdef wxNEEDS_WX_HASH_MAP - wxUIntPtr operator()( const void* k ) const { return wxPtrToUInt(k); } -#else - wxUIntPtr operator()( const void* k ) const { return wxPtrToUInt(k); } -#endif - - wxPointerHash& operator=(const wxPointerHash&) { return *this; } -}; - -class WXDLLIMPEXP_BASE wxPointerEqual -{ -public: - wxPointerEqual() { } - bool operator()( const void* a, const void* b ) const { return a == b; } - - wxPointerEqual& operator=(const wxPointerEqual&) { return *this; } -}; - -// wxString, char*, wxChar* -class WXDLLIMPEXP_BASE wxStringHash -{ -public: - wxStringHash() {} - unsigned long operator()( const wxString& x ) const - { return wxCharStringHash( x.c_str() ); } - unsigned long operator()( const wxChar* x ) const - { return wxCharStringHash( x ); } - static unsigned long wxCharStringHash( const wxChar* ); -#if wxUSE_UNICODE - unsigned long operator()( const char* x ) const - { return charStringHash( x ); } - static unsigned long charStringHash( const char* ); -#endif // wxUSE_UNICODE - - wxStringHash& operator=(const wxStringHash&) { return *this; } -}; - -class WXDLLIMPEXP_BASE wxStringEqual -{ -public: - wxStringEqual() {} - bool operator()( const wxString& a, const wxString& b ) const - { return a == b; } - bool operator()( const wxChar* a, const wxChar* b ) const - { return wxStrcmp( a, b ) == 0; } -#if wxUSE_UNICODE - bool operator()( const char* a, const char* b ) const - { return strcmp( a, b ) == 0; } -#endif // wxUSE_UNICODE - - wxStringEqual& operator=(const wxStringEqual&) { return *this; } -}; - -#ifdef wxNEEDS_WX_HASH_MAP - -#define _WX_DECLARE_HASH_MAP( KEY_T, VALUE_T, HASH_T, KEY_EQ_T, CLASSNAME, CLASSEXP ) \ -_WX_DECLARE_PAIR( KEY_T, VALUE_T, CLASSNAME##_wxImplementation_Pair, CLASSEXP ) \ -_WX_DECLARE_HASH_MAP_KEY_EX( KEY_T, CLASSNAME##_wxImplementation_Pair, CLASSNAME##_wxImplementation_KeyEx, CLASSEXP ) \ -_WX_DECLARE_HASHTABLE( CLASSNAME##_wxImplementation_Pair, KEY_T, HASH_T, CLASSNAME##_wxImplementation_KeyEx, KEY_EQ_T, CLASSNAME##_wxImplementation_HashTable, CLASSEXP, grow_lf70, never_shrink ) \ -CLASSEXP CLASSNAME:public CLASSNAME##_wxImplementation_HashTable \ -{ \ -public: \ - typedef VALUE_T mapped_type; \ - _WX_DECLARE_PAIR( iterator, bool, Insert_Result, CLASSEXP ) \ - \ - wxEXPLICIT CLASSNAME( size_type hint = 100, hasher hf = hasher(), \ - key_equal eq = key_equal() ) \ - : CLASSNAME##_wxImplementation_HashTable( hint, hf, eq, \ - CLASSNAME##_wxImplementation_KeyEx() ) {} \ - \ - mapped_type& operator[]( const const_key_type& key ) \ - { \ - bool created; \ - return GetOrCreateNode( \ - CLASSNAME##_wxImplementation_Pair( key, mapped_type() ), \ - created)->m_value.second; \ - } \ - \ - const_iterator find( const const_key_type& key ) const \ - { \ - return const_iterator( GetNode( key ), this ); \ - } \ - \ - iterator find( const const_key_type& key ) \ - { \ - return iterator( GetNode( key ), this ); \ - } \ - \ - Insert_Result insert( const value_type& v ) \ - { \ - bool created; \ - Node *node = GetOrCreateNode( \ - CLASSNAME##_wxImplementation_Pair( v.first, v.second ), \ - created); \ - return Insert_Result(iterator(node, this), created); \ - } \ - \ - size_type erase( const key_type& k ) \ - { return CLASSNAME##_wxImplementation_HashTable::erase( k ); } \ - void erase( const iterator& it ) { erase( it->first ); } \ - void erase( const const_iterator& it ) { erase( it->first ); } \ - \ - /* count() == 0 | 1 */ \ - size_type count( const const_key_type& key ) \ - { \ - /* explicit cast needed to suppress CodeWarrior warnings */ \ - return (size_type)(GetNode( key ) ? 1 : 0); \ - } \ -} - -#endif // wxNEEDS_WX_HASH_MAP - -// these macros are to be used in the user code -#define WX_DECLARE_HASH_MAP( KEY_T, VALUE_T, HASH_T, KEY_EQ_T, CLASSNAME) \ - _WX_DECLARE_HASH_MAP( KEY_T, VALUE_T, HASH_T, KEY_EQ_T, CLASSNAME, class ) - -#define WX_DECLARE_STRING_HASH_MAP( VALUE_T, CLASSNAME ) \ - _WX_DECLARE_HASH_MAP( wxString, VALUE_T, wxStringHash, wxStringEqual, \ - CLASSNAME, class ) - -#define WX_DECLARE_VOIDPTR_HASH_MAP( VALUE_T, CLASSNAME ) \ - _WX_DECLARE_HASH_MAP( void*, VALUE_T, wxPointerHash, wxPointerEqual, \ - CLASSNAME, class ) - -// and these do exactly the same thing but should be used inside the -// library -#define WX_DECLARE_HASH_MAP_WITH_DECL( KEY_T, VALUE_T, HASH_T, KEY_EQ_T, CLASSNAME, DECL) \ - _WX_DECLARE_HASH_MAP( KEY_T, VALUE_T, HASH_T, KEY_EQ_T, CLASSNAME, DECL ) - -#define WX_DECLARE_EXPORTED_HASH_MAP( KEY_T, VALUE_T, HASH_T, KEY_EQ_T, CLASSNAME) \ - WX_DECLARE_HASH_MAP_WITH_DECL( KEY_T, VALUE_T, HASH_T, KEY_EQ_T, \ - CLASSNAME, class WXDLLEXPORT ) - -#define WX_DECLARE_STRING_HASH_MAP_WITH_DECL( VALUE_T, CLASSNAME, DECL ) \ - _WX_DECLARE_HASH_MAP( wxString, VALUE_T, wxStringHash, wxStringEqual, \ - CLASSNAME, DECL ) - -#define WX_DECLARE_EXPORTED_STRING_HASH_MAP( VALUE_T, CLASSNAME ) \ - WX_DECLARE_STRING_HASH_MAP_WITH_DECL( VALUE_T, CLASSNAME, \ - class WXDLLEXPORT ) - -#define WX_DECLARE_VOIDPTR_HASH_MAP_WITH_DECL( VALUE_T, CLASSNAME, DECL ) \ - _WX_DECLARE_HASH_MAP( void*, VALUE_T, wxPointerHash, wxPointerEqual, \ - CLASSNAME, DECL ) - -#define WX_DECLARE_EXPORTED_VOIDPTR_HASH_MAP( VALUE_T, CLASSNAME ) \ - WX_DECLARE_VOIDPTR_HASH_MAP_WITH_DECL( VALUE_T, CLASSNAME, \ - class WXDLLEXPORT ) - -// delete all hash elements -// -// NB: the class declaration of the hash elements must be visible from the -// place where you use this macro, otherwise the proper destructor may not -// be called (a decent compiler should give a warning about it, but don't -// count on it)! -#define WX_CLEAR_HASH_MAP(type, hashmap) \ - { \ - type::iterator it, en; \ - for( it = (hashmap).begin(), en = (hashmap).end(); it != en; ++it ) \ - delete it->second; \ - (hashmap).clear(); \ - } - -//--------------------------------------------------------------------------- -// Declarations of common hashmap classes - -WX_DECLARE_HASH_MAP_WITH_DECL( long, long, wxIntegerHash, wxIntegerEqual, - wxLongToLongHashMap, class WXDLLIMPEXP_BASE ); - - -#endif // _WX_HASHMAP_H_ diff --git a/wxWidgets/include/wx/hashset.h b/wxWidgets/include/wx/hashset.h deleted file mode 100644 index ed161cbf2d..0000000000 --- a/wxWidgets/include/wx/hashset.h +++ /dev/null @@ -1,135 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/hashset.h -// Purpose: wxHashSet class -// Author: Mattia Barbon -// Modified by: -// Created: 11/08/2003 -// RCS-ID: $Id: hashset.h 55215 2008-08-23 18:54:04Z VZ $ -// Copyright: (c) Mattia Barbon -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_HASHSET_H_ -#define _WX_HASHSET_H_ - -#include "wx/hashmap.h" - -// see comment in wx/hashmap.h which also applies to different standard hash -// set classes - -#if wxUSE_STL && \ - (defined(HAVE_STD_UNORDERED_SET) || defined(HAVE_TR1_UNORDERED_SET)) - -#if defined(HAVE_STD_UNORDERED_SET) - #include - #define _WX_DECLARE_HASH_SET( KEY_T, HASH_T, KEY_EQ_T, CLASSNAME, CLASSEXP )\ - typedef std::unordered_set< KEY_T, HASH_T, KEY_EQ_T > CLASSNAME -#elif defined(HAVE_TR1_UNORDERED_SET) - #include - #define _WX_DECLARE_HASH_SET( KEY_T, HASH_T, KEY_EQ_T, CLASSNAME, CLASSEXP )\ - typedef std::tr1::unordered_set< KEY_T, HASH_T, KEY_EQ_T > CLASSNAME -#else -#error Update this code: unordered_set is available, but I do not know where. -#endif - -#elif wxUSE_STL && defined(HAVE_STL_HASH_MAP) - -#if defined(HAVE_EXT_HASH_MAP) - #include -#elif defined(HAVE_HASH_MAP) - #include -#endif - -#define _WX_DECLARE_HASH_SET( KEY_T, HASH_T, KEY_EQ_T, CLASSNAME, CLASSEXP )\ - typedef WX_HASH_MAP_NAMESPACE::hash_set< KEY_T, HASH_T, KEY_EQ_T > CLASSNAME - -#else // !wxUSE_STL || !defined(HAVE_STL_HASH_MAP) - -// this is a complex way of defining an easily inlineable identity function... -#define _WX_DECLARE_HASH_SET_KEY_EX( KEY_T, CLASSNAME, CLASSEXP ) \ -CLASSEXP CLASSNAME \ -{ \ - typedef KEY_T key_type; \ - typedef const key_type const_key_type; \ - typedef const_key_type& const_key_reference; \ -public: \ - CLASSNAME() { } \ - const_key_reference operator()( const_key_reference key ) const \ - { return key; } \ - \ - /* the dummy assignment operator is needed to suppress compiler */ \ - /* warnings from hash table class' operator=(): gcc complains about */ \ - /* "statement with no effect" without it */ \ - CLASSNAME& operator=(const CLASSNAME&) { return *this; } \ -}; - -#define _WX_DECLARE_HASH_SET( KEY_T, HASH_T, KEY_EQ_T, CLASSNAME, CLASSEXP )\ -_WX_DECLARE_HASH_SET_KEY_EX( KEY_T, CLASSNAME##_wxImplementation_KeyEx, CLASSEXP ) \ -_WX_DECLARE_HASHTABLE( KEY_T, KEY_T, HASH_T, CLASSNAME##_wxImplementation_KeyEx, KEY_EQ_T, CLASSNAME##_wxImplementation_HashTable, CLASSEXP, grow_lf70, never_shrink ) \ -CLASSEXP CLASSNAME:public CLASSNAME##_wxImplementation_HashTable \ -{ \ -public: \ - _WX_DECLARE_PAIR( iterator, bool, Insert_Result, CLASSEXP ) \ - \ - wxEXPLICIT CLASSNAME( size_type hint = 100, hasher hf = hasher(), \ - key_equal eq = key_equal() ) \ - : CLASSNAME##_wxImplementation_HashTable( hint, hf, eq, \ - CLASSNAME##_wxImplementation_KeyEx() ) {} \ - \ - Insert_Result insert( const key_type& key ) \ - { \ - bool created; \ - Node *node = GetOrCreateNode( key, created ); \ - return Insert_Result( iterator( node, this ), created ); \ - } \ - \ - const_iterator find( const const_key_type& key ) const \ - { \ - return const_iterator( GetNode( key ), this ); \ - } \ - \ - iterator find( const const_key_type& key ) \ - { \ - return iterator( GetNode( key ), this ); \ - } \ - \ - size_type erase( const key_type& k ) \ - { return CLASSNAME##_wxImplementation_HashTable::erase( k ); } \ - void erase( const iterator& it ) { erase( *it ); } \ - void erase( const const_iterator& it ) { erase( *it ); } \ - \ - /* count() == 0 | 1 */ \ - size_type count( const const_key_type& key ) \ - { return GetNode( key ) ? 1 : 0; } \ -} - -#endif // !wxUSE_STL || !defined(HAVE_STL_HASH_MAP) - -// these macros are to be used in the user code -#define WX_DECLARE_HASH_SET( KEY_T, HASH_T, KEY_EQ_T, CLASSNAME) \ - _WX_DECLARE_HASH_SET( KEY_T, HASH_T, KEY_EQ_T, CLASSNAME, class ) - -// and these do exactly the same thing but should be used inside the -// library -#define WX_DECLARE_HASH_SET_WITH_DECL( KEY_T, HASH_T, KEY_EQ_T, CLASSNAME, DECL) \ - _WX_DECLARE_HASH_SET( KEY_T, HASH_T, KEY_EQ_T, CLASSNAME, DECL ) - -#define WX_DECLARE_EXPORTED_HASH_SET( KEY_T, HASH_T, KEY_EQ_T, CLASSNAME) \ - WX_DECLARE_HASH_SET_WITH_DECL( KEY_T, HASH_T, KEY_EQ_T, \ - CLASSNAME, class WXDLLEXPORT ) - -// delete all hash elements -// -// NB: the class declaration of the hash elements must be visible from the -// place where you use this macro, otherwise the proper destructor may not -// be called (a decent compiler should give a warning about it, but don't -// count on it)! -#define WX_CLEAR_HASH_SET(type, hashset) \ - { \ - type::iterator it, en; \ - for( it = (hashset).begin(), en = (hashset).end(); it != en; ++it ) \ - delete *it; \ - (hashset).clear(); \ - } - -#endif // _WX_HASHSET_H_ diff --git a/wxWidgets/include/wx/help.h b/wxWidgets/include/wx/help.h deleted file mode 100644 index f233307982..0000000000 --- a/wxWidgets/include/wx/help.h +++ /dev/null @@ -1,48 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: help.h -// Purpose: wxHelpController base header -// Author: wxWidgets Team -// Modified by: -// Created: -// Copyright: (c) Julian Smart -// RCS-ID: $Id: help.h 33948 2005-05-04 18:57:50Z JS $ -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_HELP_H_BASE_ -#define _WX_HELP_H_BASE_ - -#include "wx/defs.h" - -#if wxUSE_HELP - -#include "wx/helpbase.h" - -#ifdef __WXWINCE__ - #include "wx/msw/wince/helpwce.h" - - #define wxHelpController wxWinceHelpController -#elif defined(__WXPALMOS__) - #include "wx/palmos/help.h" - - #define wxHelpController wxPalmHelpController -#elif defined(__WXMSW__) - #include "wx/msw/helpchm.h" - - #define wxHelpController wxCHMHelpController -#else // !MSW - -#if wxUSE_WXHTML_HELP - #include "wx/html/helpctrl.h" - #define wxHelpController wxHtmlHelpController -#else - #include "wx/generic/helpext.h" - #define wxHelpController wxExtHelpController -#endif - -#endif // MSW/!MSW - -#endif // wxUSE_HELP - -#endif - // _WX_HELP_H_BASE_ diff --git a/wxWidgets/include/wx/helpbase.h b/wxWidgets/include/wx/helpbase.h deleted file mode 100644 index cc77ef1028..0000000000 --- a/wxWidgets/include/wx/helpbase.h +++ /dev/null @@ -1,106 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: helpbase.h -// Purpose: Help system base classes -// Author: Julian Smart -// Modified by: -// Created: 04/01/98 -// RCS-ID: $Id: helpbase.h 45498 2007-04-16 13:03:05Z VZ $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_HELPBASEH__ -#define _WX_HELPBASEH__ - -#include "wx/defs.h" - -#if wxUSE_HELP - -#include "wx/object.h" -#include "wx/string.h" -#include "wx/gdicmn.h" -#include "wx/frame.h" - -// Flags for SetViewer -#define wxHELP_NETSCAPE 1 - -// Search modes: -enum wxHelpSearchMode -{ - wxHELP_SEARCH_INDEX, - wxHELP_SEARCH_ALL -}; - -// Defines the API for help controllers -class WXDLLEXPORT wxHelpControllerBase: public wxObject -{ -public: - inline wxHelpControllerBase(wxWindow* parentWindow = NULL) { m_parentWindow = parentWindow; } - inline ~wxHelpControllerBase() {} - - // Must call this to set the filename and server name. - // server is only required when implementing TCP/IP-based - // help controllers. - virtual bool Initialize(const wxString& WXUNUSED(file), int WXUNUSED(server) ) { return false; } - virtual bool Initialize(const wxString& WXUNUSED(file)) { return false; } - - // Set viewer: only relevant to some kinds of controller - virtual void SetViewer(const wxString& WXUNUSED(viewer), long WXUNUSED(flags) = 0) {} - - // If file is "", reloads file given in Initialize - virtual bool LoadFile(const wxString& file = wxEmptyString) = 0; - - // Displays the contents - virtual bool DisplayContents(void) = 0; - - // Display the given section - virtual bool DisplaySection(int sectionNo) = 0; - - // Display the section using a context id - virtual bool DisplayContextPopup(int WXUNUSED(contextId)) { return false; } - - // Display the text in a popup, if possible - virtual bool DisplayTextPopup(const wxString& WXUNUSED(text), const wxPoint& WXUNUSED(pos)) { return false; } - - // By default, uses KeywordSection to display a topic. Implementations - // may override this for more specific behaviour. - virtual bool DisplaySection(const wxString& section) { return KeywordSearch(section); } - virtual bool DisplayBlock(long blockNo) = 0; - virtual bool KeywordSearch(const wxString& k, - wxHelpSearchMode mode = wxHELP_SEARCH_ALL) = 0; - /// Allows one to override the default settings for the help frame. - virtual void SetFrameParameters(const wxString& WXUNUSED(title), - const wxSize& WXUNUSED(size), - const wxPoint& WXUNUSED(pos) = wxDefaultPosition, - bool WXUNUSED(newFrameEachTime) = false) - { - // does nothing by default - } - /// Obtains the latest settings used by the help frame and the help - /// frame. - virtual wxFrame *GetFrameParameters(wxSize *WXUNUSED(size) = NULL, - wxPoint *WXUNUSED(pos) = NULL, - bool *WXUNUSED(newFrameEachTime) = NULL) - { - return (wxFrame*) NULL; // does nothing by default - } - - virtual bool Quit() = 0; - virtual void OnQuit() {} - - /// Set the window that can optionally be used for the help window's parent. - virtual void SetParentWindow(wxWindow* win) { m_parentWindow = win; } - - /// Get the window that can optionally be used for the help window's parent. - virtual wxWindow* GetParentWindow() const { return m_parentWindow; } - -protected: - wxWindow* m_parentWindow; -private: - DECLARE_CLASS(wxHelpControllerBase) -}; - -#endif // wxUSE_HELP - -#endif -// _WX_HELPBASEH__ diff --git a/wxWidgets/include/wx/helphtml.h b/wxWidgets/include/wx/helphtml.h deleted file mode 100644 index 4ed3d98948..0000000000 --- a/wxWidgets/include/wx/helphtml.h +++ /dev/null @@ -1,20 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: helphtml.h -// Purpose: Includes wx/html/helpctrl.h, for wxHtmlHelpController. -// Author: Julian Smart -// Modified by: -// Created: 2003-05-24 -// RCS-ID: $Id: helphtml.h 27408 2004-05-23 20:53:33Z JS $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef __WX_HELPHTML_H_ -#define __WX_HELPHTML_H_ - -#if wxUSE_WXHTML_HELP -#include "wx/html/helpctrl.h" -#endif - -#endif // __WX_HELPHTML_H_ - diff --git a/wxWidgets/include/wx/helpwin.h b/wxWidgets/include/wx/helpwin.h deleted file mode 100644 index b15b245ec0..0000000000 --- a/wxWidgets/include/wx/helpwin.h +++ /dev/null @@ -1,22 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: helpwin.h -// Purpose: Includes Windows or OS/2 help -// Author: Julian Smart -// Modified by: -// Created: -// RCS-ID: $Id: helpwin.h 33948 2005-05-04 18:57:50Z JS $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_HELPWIN_H_BASE_ -#define _WX_HELPWIN_H_BASE_ - -#if defined(__WXMSW__) -#include "wx/msw/helpwin.h" -#elif defined(__WXPM__) -#include "wx/os2/helpwin.h" -#endif - -#endif - // _WX_HELPWIN_H_BASE_ diff --git a/wxWidgets/include/wx/html/forcelnk.h b/wxWidgets/include/wx/html/forcelnk.h deleted file mode 100644 index f54ad839d5..0000000000 --- a/wxWidgets/include/wx/html/forcelnk.h +++ /dev/null @@ -1,62 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: forcelnk.h -// Purpose: see bellow -// Author: Vaclav Slavik -// RCS-ID: $Id: forcelnk.h 35686 2005-09-25 18:46:14Z VZ $ -// Copyright: (c) Vaclav Slavik -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -/* - -DESCRPITON: - -mod_*.cpp files contain handlers for tags. These files are modules - they contain -one wxTagModule class and it's OnInit() method is called from wxApp's init method. -The module is called even if you only link it into the executable, so everything -seems wonderful. - -The problem is that we have these modules in LIBRARY and mod_*.cpp files contain -no method nor class which is known out of the module. So the linker won't -link these .o/.obj files into executable because it detected that it is not used -by the program. - -To workaround this I introduced set of macros FORCE_LINK_ME and FORCE_LINK. These -macros are generic and are not limited to mod_*.cpp files. You may find them quite -useful somewhere else... - -How to use them: -let's suppose you want to always link file foo.cpp and that you have module -always.cpp that is certainly always linked (e.g. the one with main() function -or htmlwin.cpp in wxHtml library). - -Place FORCE_LINK_ME(foo) somewhere in foo.cpp and FORCE_LINK(foo) somewhere -in always.cpp -See mod_*.cpp and htmlwin.cpp for example :-) - -*/ - - -#ifndef _WX_FORCELNK_H_ -#define _WX_FORCELNK_H_ - -#include "wx/link.h" - -// compatibility defines -#define FORCE_LINK wxFORCE_LINK_MODULE -#define FORCE_LINK_ME wxFORCE_LINK_THIS_MODULE - -#define FORCE_WXHTML_MODULES() \ - FORCE_LINK(m_layout) \ - FORCE_LINK(m_fonts) \ - FORCE_LINK(m_image) \ - FORCE_LINK(m_list) \ - FORCE_LINK(m_dflist) \ - FORCE_LINK(m_pre) \ - FORCE_LINK(m_hline) \ - FORCE_LINK(m_links) \ - FORCE_LINK(m_tables) \ - FORCE_LINK(m_style) - - -#endif // _WX_FORCELNK_H_ diff --git a/wxWidgets/include/wx/html/helpctrl.h b/wxWidgets/include/wx/html/helpctrl.h deleted file mode 100644 index bf0bd05740..0000000000 --- a/wxWidgets/include/wx/html/helpctrl.h +++ /dev/null @@ -1,153 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: helpctrl.h -// Purpose: wxHtmlHelpController -// Notes: Based on htmlhelp.cpp, implementing a monolithic -// HTML Help controller class, by Vaclav Slavik -// Author: Harm van der Heijden and Vaclav Slavik -// RCS-ID: $Id: helpctrl.h 49563 2007-10-31 20:46:21Z VZ $ -// Copyright: (c) Harm van der Heijden and Vaclav Slavik -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_HELPCTRL_H_ -#define _WX_HELPCTRL_H_ - -#include "wx/defs.h" - -#if wxUSE_WXHTML_HELP - -#include "wx/helpbase.h" -#include "wx/html/helpfrm.h" - -#define wxID_HTML_HELPFRAME (wxID_HIGHEST + 1) - -// This style indicates that the window is -// embedded in the application and must not be -// destroyed by the help controller. -#define wxHF_EMBEDDED 0x00008000 - -// Create a dialog for the help window. -#define wxHF_DIALOG 0x00010000 - -// Create a frame for the help window. -#define wxHF_FRAME 0x00020000 - -// Make the dialog modal when displaying help. -#define wxHF_MODAL 0x00040000 - -class WXDLLIMPEXP_FWD_HTML wxHtmlHelpDialog; -class WXDLLIMPEXP_FWD_HTML wxHtmlHelpWindow; -class WXDLLIMPEXP_FWD_HTML wxHtmlHelpFrame; -class WXDLLIMPEXP_FWD_HTML wxHtmlHelpDialog; - -class WXDLLIMPEXP_HTML wxHtmlHelpController : public wxHelpControllerBase // wxEvtHandler -{ - DECLARE_DYNAMIC_CLASS(wxHtmlHelpController) - -public: - wxHtmlHelpController(int style = wxHF_DEFAULT_STYLE, wxWindow* parentWindow = NULL); - virtual ~wxHtmlHelpController(); - - void SetTitleFormat(const wxString& format); - void SetTempDir(const wxString& path) { m_helpData.SetTempDir(path); } - bool AddBook(const wxString& book_url, bool show_wait_msg = false); - bool AddBook(const wxFileName& book_file, bool show_wait_msg = false); - - bool Display(const wxString& x); - bool Display(int id); - bool DisplayContents(); - bool DisplayIndex(); - bool KeywordSearch(const wxString& keyword, - wxHelpSearchMode mode = wxHELP_SEARCH_ALL); - - wxHtmlHelpWindow* GetHelpWindow() { return m_helpWindow; } - void SetHelpWindow(wxHtmlHelpWindow* helpWindow); - - wxHtmlHelpFrame* GetFrame() { return m_helpFrame; } - wxHtmlHelpDialog* GetDialog() { return m_helpDialog; } - - void UseConfig(wxConfigBase *config, const wxString& rootpath = wxEmptyString); - - // Assigns config object to the Ctrl. This config is then - // used in subsequent calls to Read/WriteCustomization of both help - // Ctrl and it's wxHtmlWindow - virtual void ReadCustomization(wxConfigBase *cfg, const wxString& path = wxEmptyString); - virtual void WriteCustomization(wxConfigBase *cfg, const wxString& path = wxEmptyString); - - //// Backward compatibility with wxHelpController API - - virtual bool Initialize(const wxString& file, int WXUNUSED(server) ) { return Initialize(file); } - virtual bool Initialize(const wxString& file); - virtual void SetViewer(const wxString& WXUNUSED(viewer), long WXUNUSED(flags) = 0) {} - virtual bool LoadFile(const wxString& file = wxT("")); - virtual bool DisplaySection(int sectionNo); - virtual bool DisplaySection(const wxString& section) { return Display(section); } - virtual bool DisplayBlock(long blockNo) { return DisplaySection(blockNo); } - virtual bool DisplayTextPopup(const wxString& text, const wxPoint& pos); - - virtual void SetFrameParameters(const wxString& title, - const wxSize& size, - const wxPoint& pos = wxDefaultPosition, - bool newFrameEachTime = false); - /// Obtains the latest settings used by the help frame and the help - /// frame. - virtual wxFrame *GetFrameParameters(wxSize *size = NULL, - wxPoint *pos = NULL, - bool *newFrameEachTime = NULL); - - // Get direct access to help data: - wxHtmlHelpData *GetHelpData() { return &m_helpData; } - - virtual bool Quit() ; - virtual void OnQuit() {} - - void OnCloseFrame(wxCloseEvent& evt); - - // Make the help controller's frame 'modal' if - // needed - void MakeModalIfNeeded(); - - // Find the top-most parent window - wxWindow* FindTopLevelWindow(); - -protected: - virtual wxWindow* CreateHelpWindow(); - virtual wxHtmlHelpFrame* CreateHelpFrame(wxHtmlHelpData *data); - virtual wxHtmlHelpDialog* CreateHelpDialog(wxHtmlHelpData *data); - virtual void DestroyHelpWindow(); - - wxHtmlHelpData m_helpData; - wxHtmlHelpWindow* m_helpWindow; - wxConfigBase * m_Config; - wxString m_ConfigRoot; - wxString m_titleFormat; - int m_FrameStyle; - wxHtmlHelpFrame* m_helpFrame; - wxHtmlHelpDialog* m_helpDialog; - - DECLARE_NO_COPY_CLASS(wxHtmlHelpController) -}; - -/* - * wxHtmlModalHelp - * A convenience class particularly for use on wxMac, - * where you can only show modal dialogs from a modal - * dialog. - * - * Use like this: - * - * wxHtmlModalHelp help(parent, filename, topic); - * - * If topic is empty, the help contents is displayed. - */ - -class WXDLLIMPEXP_HTML wxHtmlModalHelp -{ -public: - wxHtmlModalHelp(wxWindow* parent, const wxString& helpFile, const wxString& topic = wxEmptyString, - int style = wxHF_DEFAULT_STYLE | wxHF_DIALOG | wxHF_MODAL); -}; - -#endif // wxUSE_WXHTML_HELP - -#endif // _WX_HELPCTRL_H_ diff --git a/wxWidgets/include/wx/html/helpdata.h b/wxWidgets/include/wx/html/helpdata.h deleted file mode 100644 index fcd54d7801..0000000000 --- a/wxWidgets/include/wx/html/helpdata.h +++ /dev/null @@ -1,266 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: helpdata.h -// Purpose: wxHtmlHelpData -// Notes: Based on htmlhelp.cpp, implementing a monolithic -// HTML Help controller class, by Vaclav Slavik -// Author: Harm van der Heijden and Vaclav Slavik -// RCS-ID: $Id: helpdata.h 53135 2008-04-12 02:31:04Z VZ $ -// Copyright: (c) Harm van der Heijden and Vaclav Slavik -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_HELPDATA_H_ -#define _WX_HELPDATA_H_ - -#include "wx/defs.h" - -#if wxUSE_HTML - -#include "wx/object.h" -#include "wx/string.h" -#include "wx/filesys.h" -#include "wx/dynarray.h" -#include "wx/font.h" - -class WXDLLIMPEXP_FWD_HTML wxHtmlHelpData; - -//-------------------------------------------------------------------------------- -// helper classes & structs -//-------------------------------------------------------------------------------- - -class WXDLLIMPEXP_HTML wxHtmlBookRecord -{ -public: - wxHtmlBookRecord(const wxString& bookfile, const wxString& basepath, - const wxString& title, const wxString& start) - { - m_BookFile = bookfile; - m_BasePath = basepath; - m_Title = title; - m_Start = start; - // for debugging, give the contents index obvious default values - m_ContentsStart = m_ContentsEnd = -1; - } - wxString GetBookFile() const { return m_BookFile; } - wxString GetTitle() const { return m_Title; } - wxString GetStart() const { return m_Start; } - wxString GetBasePath() const { return m_BasePath; } - /* SetContentsRange: store in the bookrecord where in the index/contents lists the - * book's records are stored. This to facilitate searching in a specific book. - * This code will have to be revised when loading/removing books becomes dynamic. - * (as opposed to appending only) - * Note that storing index range is pointless, because the index is alphab. sorted. */ - void SetContentsRange(int start, int end) { m_ContentsStart = start; m_ContentsEnd = end; } - int GetContentsStart() const { return m_ContentsStart; } - int GetContentsEnd() const { return m_ContentsEnd; } - - void SetTitle(const wxString& title) { m_Title = title; } - void SetBasePath(const wxString& path) { m_BasePath = path; } - void SetStart(const wxString& start) { m_Start = start; } - - // returns full filename of page (which is part of the book), - // i.e. with book's basePath prepended. If page is already absolute - // path, basePath is _not_ prepended. - wxString GetFullPath(const wxString &page) const; - -protected: - wxString m_BookFile; - wxString m_BasePath; - wxString m_Title; - wxString m_Start; - int m_ContentsStart; - int m_ContentsEnd; -}; - - -WX_DECLARE_USER_EXPORTED_OBJARRAY(wxHtmlBookRecord, wxHtmlBookRecArray, - WXDLLIMPEXP_HTML); - -struct WXDLLIMPEXP_HTML wxHtmlHelpDataItem -{ - wxHtmlHelpDataItem() : level(0), parent(NULL), id(wxID_ANY), book(NULL) {} - - int level; - wxHtmlHelpDataItem *parent; - int id; - wxString name; - wxString page; - wxHtmlBookRecord *book; - - // returns full filename of m_Page, i.e. with book's basePath prepended - wxString GetFullPath() const { return book->GetFullPath(page); } - - // returns item indented with spaces if it has level>1: - wxString GetIndentedName() const; -}; - -WX_DECLARE_USER_EXPORTED_OBJARRAY(wxHtmlHelpDataItem, wxHtmlHelpDataItems, - WXDLLIMPEXP_HTML); - -#if WXWIN_COMPATIBILITY_2_4 -// old interface to contents and index: -struct wxHtmlContentsItem -{ - wxHtmlContentsItem(); - wxHtmlContentsItem(const wxHtmlHelpDataItem& d); - wxHtmlContentsItem& operator=(const wxHtmlContentsItem& d); - ~wxHtmlContentsItem(); - - int m_Level; - int m_ID; - wxChar *m_Name; - wxChar *m_Page; - wxHtmlBookRecord *m_Book; - - // returns full filename of m_Page, i.e. with book's basePath prepended - wxString GetFullPath() const { return m_Book->GetFullPath(m_Page); } - -private: - bool m_autofree; -}; -#endif - - -//------------------------------------------------------------------------------ -// wxHtmlSearchEngine -// This class takes input streams and scans them for occurence -// of keyword(s) -//------------------------------------------------------------------------------ - -class WXDLLIMPEXP_HTML wxHtmlSearchEngine : public wxObject -{ -public: - wxHtmlSearchEngine() : wxObject() {} - virtual ~wxHtmlSearchEngine() {} - - // Sets the keyword we will be searching for - virtual void LookFor(const wxString& keyword, bool case_sensitive, bool whole_words_only); - - // Scans the stream for the keyword. - // Returns true if the stream contains keyword, fALSE otherwise - virtual bool Scan(const wxFSFile& file); - -private: - wxString m_Keyword; - bool m_CaseSensitive; - bool m_WholeWords; - - DECLARE_NO_COPY_CLASS(wxHtmlSearchEngine) -}; - - -// State information of a search action. I'd have preferred to make this a -// nested class inside wxHtmlHelpData, but that's against coding standards :-( -// Never construct this class yourself, obtain a copy from -// wxHtmlHelpData::PrepareKeywordSearch(const wxString& key) -class WXDLLIMPEXP_HTML wxHtmlSearchStatus -{ -public: - // constructor; supply wxHtmlHelpData ptr, the keyword and (optionally) the - // title of the book to search. By default, all books are searched. - wxHtmlSearchStatus(wxHtmlHelpData* base, const wxString& keyword, - bool case_sensitive, bool whole_words_only, - const wxString& book = wxEmptyString); - bool Search(); // do the next iteration - bool IsActive() { return m_Active; } - int GetCurIndex() { return m_CurIndex; } - int GetMaxIndex() { return m_MaxIndex; } - const wxString& GetName() { return m_Name; } - - const wxHtmlHelpDataItem *GetCurItem() const { return m_CurItem; } -#if WXWIN_COMPATIBILITY_2_4 - wxDEPRECATED( wxHtmlContentsItem* GetContentsItem() ); -#endif - -private: - wxHtmlHelpData* m_Data; - wxHtmlSearchEngine m_Engine; - wxString m_Keyword, m_Name; - wxString m_LastPage; - wxHtmlHelpDataItem* m_CurItem; - bool m_Active; // search is not finished - int m_CurIndex; // where we are now - int m_MaxIndex; // number of files we search - // For progress bar: 100*curindex/maxindex = % complete - - DECLARE_NO_COPY_CLASS(wxHtmlSearchStatus) -}; - -class WXDLLIMPEXP_HTML wxHtmlHelpData : public wxObject -{ - DECLARE_DYNAMIC_CLASS(wxHtmlHelpData) - friend class wxHtmlSearchStatus; - -public: - wxHtmlHelpData(); - virtual ~wxHtmlHelpData(); - - // Sets directory where temporary files are stored. - // These temp files are index & contents file in binary (much faster to read) - // form. These files are NOT deleted on program's exit. - void SetTempDir(const wxString& path); - - // Adds new book. 'book' is location of .htb file (stands for "html book"). - // See documentation for details on its format. - // Returns success. - bool AddBook(const wxString& book); - bool AddBookParam(const wxFSFile& bookfile, - wxFontEncoding encoding, - const wxString& title, const wxString& contfile, - const wxString& indexfile = wxEmptyString, - const wxString& deftopic = wxEmptyString, - const wxString& path = wxEmptyString); - - // Some accessing stuff: - - // returns URL of page on basis of (file)name - wxString FindPageByName(const wxString& page); - // returns URL of page on basis of MS id - wxString FindPageById(int id); - - const wxHtmlBookRecArray& GetBookRecArray() const { return m_bookRecords; } - - const wxHtmlHelpDataItems& GetContentsArray() const { return m_contents; } - const wxHtmlHelpDataItems& GetIndexArray() const { return m_index; } - -#if WXWIN_COMPATIBILITY_2_4 - // deprecated interface, new interface is arrays-based (see above) - wxDEPRECATED( wxHtmlContentsItem* GetContents() ); - wxDEPRECATED( int GetContentsCnt() ); - wxDEPRECATED( wxHtmlContentsItem* GetIndex() ); - wxDEPRECATED( int GetIndexCnt() ); -#endif - -protected: - wxString m_tempPath; - - // each book has one record in this array: - wxHtmlBookRecArray m_bookRecords; - - wxHtmlHelpDataItems m_contents; // list of all available books and pages - wxHtmlHelpDataItems m_index; // list of index itesm - -#if WXWIN_COMPATIBILITY_2_4 - // deprecated data structures, set only if GetContents(), GetIndex() - // called - wxHtmlContentsItem* m_cacheContents; - wxHtmlContentsItem* m_cacheIndex; -private: - void CleanCompatibilityData(); -#endif - -protected: - // Imports .hhp files (MS HTML Help Workshop) - bool LoadMSProject(wxHtmlBookRecord *book, wxFileSystem& fsys, - const wxString& indexfile, const wxString& contentsfile); - // Reads binary book - bool LoadCachedBook(wxHtmlBookRecord *book, wxInputStream *f); - // Writes binary book - bool SaveCachedBook(wxHtmlBookRecord *book, wxOutputStream *f); - - DECLARE_NO_COPY_CLASS(wxHtmlHelpData) -}; - -#endif - -#endif diff --git a/wxWidgets/include/wx/html/helpdlg.h b/wxWidgets/include/wx/html/helpdlg.h deleted file mode 100644 index 9f10c6a4d7..0000000000 --- a/wxWidgets/include/wx/html/helpdlg.h +++ /dev/null @@ -1,90 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/html/helpdlg.h -// Purpose: wxHtmlHelpDialog -// Notes: Based on htmlhelp.cpp, implementing a monolithic -// HTML Help controller class, by Vaclav Slavik -// Author: Harm van der Heijden, Vaclav Slavik, Julian Smart -// RCS-ID: $Id: helpdlg.h 49804 2007-11-10 01:09:42Z VZ $ -// Copyright: (c) Harm van der Heijden, Vaclav Slavik, Julian Smart -// Licence: wxWidgets licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_HELPDLG_H_ -#define _WX_HELPDLG_H_ - -#include "wx/defs.h" - -#if wxUSE_WXHTML_HELP - -#include "wx/html/helpdata.h" -#include "wx/window.h" -#include "wx/dialog.h" -#include "wx/frame.h" -#include "wx/config.h" -#include "wx/splitter.h" -#include "wx/notebook.h" -#include "wx/listbox.h" -#include "wx/choice.h" -#include "wx/combobox.h" -#include "wx/checkbox.h" -#include "wx/stattext.h" -#include "wx/html/htmlwin.h" -#include "wx/html/helpwnd.h" -#include "wx/html/htmprint.h" - -class WXDLLIMPEXP_FWD_HTML wxHtmlHelpController; -class WXDLLIMPEXP_FWD_HTML wxHtmlHelpWindow; - -class WXDLLIMPEXP_HTML wxHtmlHelpDialog : public wxDialog -{ - DECLARE_DYNAMIC_CLASS(wxHtmlHelpDialog) - -public: - wxHtmlHelpDialog(wxHtmlHelpData* data = NULL) { Init(data); } - wxHtmlHelpDialog(wxWindow* parent, wxWindowID wxWindowID, - const wxString& title = wxEmptyString, - int style = wxHF_DEFAULT_STYLE, wxHtmlHelpData* data = NULL); - virtual ~wxHtmlHelpDialog(); - - bool Create(wxWindow* parent, wxWindowID id, const wxString& title = wxEmptyString, - int style = wxHF_DEFAULT_STYLE); - - /// Returns the data associated with this dialog. - wxHtmlHelpData* GetData() { return m_Data; } - - /// Returns the controller that created this dialog. - wxHtmlHelpController* GetController() const { return m_helpController; } - - /// Sets the controller associated with this dialog. - void SetController(wxHtmlHelpController* controller) { m_helpController = controller; } - - /// Returns the help window. - wxHtmlHelpWindow* GetHelpWindow() const { return m_HtmlHelpWin; } - - // Sets format of title of the frame. Must contain exactly one "%s" - // (for title of displayed HTML page) - void SetTitleFormat(const wxString& format); - - // Override to add custom buttons to the toolbar - virtual void AddToolbarButtons(wxToolBar* WXUNUSED(toolBar), int WXUNUSED(style)) {} - -protected: - void Init(wxHtmlHelpData* data = NULL); - - void OnCloseWindow(wxCloseEvent& event); - -protected: - // Temporary pointer to pass to window - wxHtmlHelpData* m_Data; - wxString m_TitleFormat; // title of the help frame - wxHtmlHelpWindow *m_HtmlHelpWin; - wxHtmlHelpController* m_helpController; - - DECLARE_EVENT_TABLE() - DECLARE_NO_COPY_CLASS(wxHtmlHelpDialog) -}; - -#endif - // wxUSE_WXHTML_HELP - -#endif diff --git a/wxWidgets/include/wx/html/helpfrm.h b/wxWidgets/include/wx/html/helpfrm.h deleted file mode 100644 index 3a9b3e12b9..0000000000 --- a/wxWidgets/include/wx/html/helpfrm.h +++ /dev/null @@ -1,147 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: helpfrm.h -// Purpose: wxHtmlHelpFrame -// Notes: Based on htmlhelp.cpp, implementing a monolithic -// HTML Help controller class, by Vaclav Slavik -// Author: Harm van der Heijden and Vaclav Slavik -// RCS-ID: $Id: helpfrm.h 50202 2007-11-23 21:29:29Z VZ $ -// Copyright: (c) Harm van der Heijden and Vaclav Slavik -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_HELPFRM_H_ -#define _WX_HELPFRM_H_ - -#include "wx/defs.h" - -#if wxUSE_WXHTML_HELP - -#include "wx/helpbase.h" -#include "wx/html/helpdata.h" -#include "wx/window.h" -#include "wx/frame.h" -#include "wx/config.h" -#include "wx/splitter.h" -#include "wx/notebook.h" -#include "wx/listbox.h" -#include "wx/choice.h" -#include "wx/combobox.h" -#include "wx/checkbox.h" -#include "wx/stattext.h" -#include "wx/html/htmlwin.h" -#include "wx/html/helpwnd.h" -#include "wx/html/htmprint.h" - -class WXDLLIMPEXP_FWD_CORE wxButton; -class WXDLLIMPEXP_FWD_CORE wxTextCtrl; -class WXDLLIMPEXP_FWD_CORE wxTreeEvent; -class WXDLLIMPEXP_FWD_CORE wxTreeCtrl; - - -// style flags for the Help Frame -#define wxHF_TOOLBAR 0x0001 -#define wxHF_CONTENTS 0x0002 -#define wxHF_INDEX 0x0004 -#define wxHF_SEARCH 0x0008 -#define wxHF_BOOKMARKS 0x0010 -#define wxHF_OPEN_FILES 0x0020 -#define wxHF_PRINT 0x0040 -#define wxHF_FLAT_TOOLBAR 0x0080 -#define wxHF_MERGE_BOOKS 0x0100 -#define wxHF_ICONS_BOOK 0x0200 -#define wxHF_ICONS_BOOK_CHAPTER 0x0400 -#define wxHF_ICONS_FOLDER 0x0000 // this is 0 since it is default -#define wxHF_DEFAULT_STYLE (wxHF_TOOLBAR | wxHF_CONTENTS | \ - wxHF_INDEX | wxHF_SEARCH | \ - wxHF_BOOKMARKS | wxHF_PRINT) -//compatibility: -#define wxHF_OPENFILES wxHF_OPEN_FILES -#define wxHF_FLATTOOLBAR wxHF_FLAT_TOOLBAR -#define wxHF_DEFAULTSTYLE wxHF_DEFAULT_STYLE - -struct wxHtmlHelpMergedIndexItem; -class wxHtmlHelpMergedIndex; - -class WXDLLIMPEXP_FWD_CORE wxHelpControllerBase; -class WXDLLIMPEXP_FWD_HTML wxHtmlHelpController; -class WXDLLIMPEXP_FWD_HTML wxHtmlHelpWindow; - -class WXDLLIMPEXP_HTML wxHtmlHelpFrame : public wxFrame -{ - DECLARE_DYNAMIC_CLASS(wxHtmlHelpFrame) - -public: - wxHtmlHelpFrame(wxHtmlHelpData* data = NULL) { Init(data); } - wxHtmlHelpFrame(wxWindow* parent, wxWindowID wxWindowID, - const wxString& title = wxEmptyString, - int style = wxHF_DEFAULT_STYLE, wxHtmlHelpData* data = NULL, - wxConfigBase *config=NULL, const wxString& rootpath = wxEmptyString); - bool Create(wxWindow* parent, wxWindowID id, const wxString& title = wxEmptyString, - int style = wxHF_DEFAULT_STYLE, - wxConfigBase *config=NULL, const wxString& rootpath = wxEmptyString); - virtual ~wxHtmlHelpFrame(); - - /// Returns the data associated with the window. - wxHtmlHelpData* GetData() { return m_Data; } - - /// Returns the help controller associated with the window. - wxHtmlHelpController* GetController() const { return m_helpController; } - - /// Sets the help controller associated with the window. - void SetController(wxHtmlHelpController* controller) { m_helpController = controller; } - - /// Returns the help window. - wxHtmlHelpWindow* GetHelpWindow() const { return m_HtmlHelpWin; } - - // Sets format of title of the frame. Must contain exactly one "%s" - // (for title of displayed HTML page) - void SetTitleFormat(const wxString& format); - - // For compatibility - void UseConfig(wxConfigBase *config, const wxString& rootpath = wxEmptyString); - - // Make the help controller's frame 'modal' if - // needed - void AddGrabIfNeeded(); - - // Override to add custom buttons to the toolbar - virtual void AddToolbarButtons(wxToolBar* WXUNUSED(toolBar), int WXUNUSED(style)) {} - - // we don't want to prevent the app from closing just because a help window - // remains opened - virtual bool ShouldPreventAppExit() const { return false; } - -protected: - void Init(wxHtmlHelpData* data = NULL); - - void OnCloseWindow(wxCloseEvent& event); - void OnActivate(wxActivateEvent& event); - -#ifdef __WXMAC__ - void OnClose(wxCommandEvent& event); - void OnAbout(wxCommandEvent& event); -#endif - - // Images: - enum { - IMG_Book = 0, - IMG_Folder, - IMG_Page - }; - -protected: - wxHtmlHelpData* m_Data; - bool m_DataCreated; // m_Data created by frame, or supplied? - wxString m_TitleFormat; // title of the help frame - wxHtmlHelpWindow *m_HtmlHelpWin; - wxHtmlHelpController* m_helpController; - -private: - - DECLARE_EVENT_TABLE() - DECLARE_NO_COPY_CLASS(wxHtmlHelpFrame) -}; - -#endif // wxUSE_WXHTML_HELP - -#endif diff --git a/wxWidgets/include/wx/html/helpwnd.h b/wxWidgets/include/wx/html/helpwnd.h deleted file mode 100644 index e0541092c0..0000000000 --- a/wxWidgets/include/wx/html/helpwnd.h +++ /dev/null @@ -1,300 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/html/helpwnd.h -// Purpose: wxHtmlHelpWindow -// Notes: Based on htmlhelp.cpp, implementing a monolithic -// HTML Help controller class, by Vaclav Slavik -// Author: Harm van der Heijden and Vaclav Slavik -// RCS-ID: $Id: helpwnd.h 49563 2007-10-31 20:46:21Z VZ $ -// Copyright: (c) Harm van der Heijden and Vaclav Slavik -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_HELPWND_H_ -#define _WX_HELPWND_H_ - -#include "wx/defs.h" - -#if wxUSE_WXHTML_HELP - -#include "wx/helpbase.h" -#include "wx/html/helpdata.h" -#include "wx/window.h" -#include "wx/frame.h" -#include "wx/config.h" -#include "wx/splitter.h" -#include "wx/notebook.h" -#include "wx/listbox.h" -#include "wx/choice.h" -#include "wx/combobox.h" -#include "wx/checkbox.h" -#include "wx/stattext.h" -#include "wx/html/htmlwin.h" -#include "wx/html/htmprint.h" - -class WXDLLIMPEXP_FWD_CORE wxButton; -class WXDLLIMPEXP_FWD_CORE wxTextCtrl; -class WXDLLIMPEXP_FWD_CORE wxTreeEvent; -class WXDLLIMPEXP_FWD_CORE wxTreeCtrl; - -// style flags for the Help Frame -#define wxHF_TOOLBAR 0x0001 -#define wxHF_CONTENTS 0x0002 -#define wxHF_INDEX 0x0004 -#define wxHF_SEARCH 0x0008 -#define wxHF_BOOKMARKS 0x0010 -#define wxHF_OPEN_FILES 0x0020 -#define wxHF_PRINT 0x0040 -#define wxHF_FLAT_TOOLBAR 0x0080 -#define wxHF_MERGE_BOOKS 0x0100 -#define wxHF_ICONS_BOOK 0x0200 -#define wxHF_ICONS_BOOK_CHAPTER 0x0400 -#define wxHF_ICONS_FOLDER 0x0000 // this is 0 since it is default -#define wxHF_DEFAULT_STYLE (wxHF_TOOLBAR | wxHF_CONTENTS | \ - wxHF_INDEX | wxHF_SEARCH | \ - wxHF_BOOKMARKS | wxHF_PRINT) -//compatibility: -#define wxHF_OPENFILES wxHF_OPEN_FILES -#define wxHF_FLATTOOLBAR wxHF_FLAT_TOOLBAR -#define wxHF_DEFAULTSTYLE wxHF_DEFAULT_STYLE - -struct wxHtmlHelpFrameCfg -{ - int x, y, w, h; - long sashpos; - bool navig_on; -}; - -struct wxHtmlHelpMergedIndexItem; -class wxHtmlHelpMergedIndex; - -class WXDLLIMPEXP_FWD_CORE wxHelpControllerBase; -class WXDLLIMPEXP_FWD_HTML wxHtmlHelpController; - -/*! - * Help window - */ - -class WXDLLIMPEXP_HTML wxHtmlHelpWindow : public wxWindow -{ - DECLARE_DYNAMIC_CLASS(wxHtmlHelpWindow) - -public: - wxHtmlHelpWindow(wxHtmlHelpData* data = NULL) { Init(data); } - wxHtmlHelpWindow(wxWindow* parent, wxWindowID wxWindowID, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - int style = wxTAB_TRAVERSAL|wxNO_BORDER, - int helpStyle = wxHF_DEFAULT_STYLE, - wxHtmlHelpData* data = NULL); - bool Create(wxWindow* parent, wxWindowID id, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - int style = wxTAB_TRAVERSAL|wxNO_BORDER, - int helpStyle = wxHF_DEFAULT_STYLE); - virtual ~wxHtmlHelpWindow(); - - wxHtmlHelpData* GetData() { return m_Data; } - wxHtmlHelpController* GetController() const { return m_helpController; } - void SetController(wxHtmlHelpController* controller); - - // Displays page x. If not found it will offect the user a choice of - // searching books. - // Looking for the page runs in these steps: - // 1. try to locate file named x (if x is for example "doc/howto.htm") - // 2. try to open starting page of book x - // 3. try to find x in contents (if x is for example "How To ...") - // 4. try to find x in index (if x is for example "How To ...") - bool Display(const wxString& x); - - // Alternative version that works with numeric ID. - // (uses extension to MS format, , see docs) - bool Display(const int id); - - // Displays help window and focuses contents. - bool DisplayContents(); - - // Displays help window and focuses index. - bool DisplayIndex(); - - // Searches for keyword. Returns true and display page if found, return - // false otherwise - // Syntax of keyword is Altavista-like: - // * words are separated by spaces - // (but "\"hello world\"" is only one world "hello world") - // * word may be pretended by + or - - // (+ : page must contain the word ; - : page can't contain the word) - // * if there is no + or - before the word, + is default - bool KeywordSearch(const wxString& keyword, - wxHelpSearchMode mode = wxHELP_SEARCH_ALL); - - void UseConfig(wxConfigBase *config, const wxString& rootpath = wxEmptyString) - { - m_Config = config; - m_ConfigRoot = rootpath; - ReadCustomization(config, rootpath); - } - - // Saves custom settings into cfg config. it will use the path 'path' - // if given, otherwise it will save info into currently selected path. - // saved values : things set by SetFonts, SetBorders. - void ReadCustomization(wxConfigBase *cfg, const wxString& path = wxEmptyString); - void WriteCustomization(wxConfigBase *cfg, const wxString& path = wxEmptyString); - - // call this to let wxHtmlHelpWindow know page changed - void NotifyPageChanged(); - - // Refreshes Contents and Index tabs - void RefreshLists(); - - // Gets the HTML window - wxHtmlWindow* GetHtmlWindow() const { return m_HtmlWin; } - - // Gets the splitter window - wxSplitterWindow* GetSplitterWindow() const { return m_Splitter; } - - // Gets the toolbar - wxToolBar* GetToolBar() const { return m_toolBar; } - - // Gets the configuration data - wxHtmlHelpFrameCfg& GetCfgData() { return m_Cfg; } - - // Gets the tree control - wxTreeCtrl *GetTreeCtrl() const { return m_ContentsBox; } - -protected: - void Init(wxHtmlHelpData* data = NULL); - - // Adds items to m_Contents tree control - void CreateContents(); - - // Adds items to m_IndexList - void CreateIndex(); - - // Add books to search choice panel - void CreateSearch(); - - // Updates "merged index" structure that combines indexes of all books - // into better searchable structure - void UpdateMergedIndex(); - - // Add custom buttons to toolbar - virtual void AddToolbarButtons(wxToolBar *toolBar, int style); - - // Displays options dialog (fonts etc.) - virtual void OptionsDialog(); - - void OnToolbar(wxCommandEvent& event); - void OnContentsSel(wxTreeEvent& event); - void OnIndexSel(wxCommandEvent& event); - void OnIndexFind(wxCommandEvent& event); - void OnIndexAll(wxCommandEvent& event); - void OnSearchSel(wxCommandEvent& event); - void OnSearch(wxCommandEvent& event); - void OnBookmarksSel(wxCommandEvent& event); - void OnSize(wxSizeEvent& event); - - // Images: - enum { - IMG_Book = 0, - IMG_Folder, - IMG_Page - }; - -protected: - wxHtmlHelpData* m_Data; - bool m_DataCreated; // m_Data created by frame, or supplied? - wxString m_TitleFormat; // title of the help frame - // below are various pointers to GUI components - wxHtmlWindow *m_HtmlWin; - wxSplitterWindow *m_Splitter; - wxPanel *m_NavigPan; - wxNotebook *m_NavigNotebook; - wxTreeCtrl *m_ContentsBox; - wxTextCtrl *m_IndexText; - wxButton *m_IndexButton; - wxButton *m_IndexButtonAll; - wxListBox *m_IndexList; - wxTextCtrl *m_SearchText; - wxButton *m_SearchButton; - wxListBox *m_SearchList; - wxChoice *m_SearchChoice; - wxStaticText *m_IndexCountInfo; - wxCheckBox *m_SearchCaseSensitive; - wxCheckBox *m_SearchWholeWords; - wxToolBar* m_toolBar; - - wxComboBox *m_Bookmarks; - wxArrayString m_BookmarksNames, m_BookmarksPages; - - wxHtmlHelpFrameCfg m_Cfg; - - wxConfigBase *m_Config; - wxString m_ConfigRoot; - - // pagenumbers of controls in notebook (usually 0,1,2) - int m_ContentsPage; - int m_IndexPage; - int m_SearchPage; - - // lists of available fonts (used in options dialog) - wxArrayString *m_NormalFonts, *m_FixedFonts; - int m_FontSize; // 0,1,2 = small,medium,big - wxString m_NormalFace, m_FixedFace; - - bool m_UpdateContents; - -#if wxUSE_PRINTING_ARCHITECTURE - wxHtmlEasyPrinting *m_Printer; -#endif - wxHashTable *m_PagesHash; - wxHtmlHelpController* m_helpController; - - int m_hfStyle; - -private: - void DoIndexFind(); - void DoIndexAll(); - void DisplayIndexItem(const wxHtmlHelpMergedIndexItem *it); - wxHtmlHelpMergedIndex *m_mergedIndex; - - DECLARE_EVENT_TABLE() - DECLARE_NO_COPY_CLASS(wxHtmlHelpWindow) -}; - -/*! - * Command IDs - */ - -enum -{ - //wxID_HTML_HELPFRAME = wxID_HIGHEST + 1, - wxID_HTML_PANEL = wxID_HIGHEST + 2, - wxID_HTML_BACK, - wxID_HTML_FORWARD, - wxID_HTML_UPNODE, - wxID_HTML_UP, - wxID_HTML_DOWN, - wxID_HTML_PRINT, - wxID_HTML_OPENFILE, - wxID_HTML_OPTIONS, - wxID_HTML_BOOKMARKSLIST, - wxID_HTML_BOOKMARKSADD, - wxID_HTML_BOOKMARKSREMOVE, - wxID_HTML_TREECTRL, - wxID_HTML_INDEXPAGE, - wxID_HTML_INDEXLIST, - wxID_HTML_INDEXTEXT, - wxID_HTML_INDEXBUTTON, - wxID_HTML_INDEXBUTTONALL, - wxID_HTML_NOTEBOOK, - wxID_HTML_SEARCHPAGE, - wxID_HTML_SEARCHTEXT, - wxID_HTML_SEARCHLIST, - wxID_HTML_SEARCHBUTTON, - wxID_HTML_SEARCHCHOICE, - wxID_HTML_COUNTINFO -}; - -#endif // wxUSE_WXHTML_HELP - -#endif diff --git a/wxWidgets/include/wx/html/htmlcell.h b/wxWidgets/include/wx/html/htmlcell.h deleted file mode 100644 index adb194dcc4..0000000000 --- a/wxWidgets/include/wx/html/htmlcell.h +++ /dev/null @@ -1,673 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: htmlcell.h -// Purpose: wxHtmlCell class is used by wxHtmlWindow/wxHtmlWinParser -// as a basic visual element of HTML page -// Author: Vaclav Slavik -// RCS-ID: $Id: htmlcell.h 53135 2008-04-12 02:31:04Z VZ $ -// Copyright: (c) 1999-2003 Vaclav Slavik -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_HTMLCELL_H_ -#define _WX_HTMLCELL_H_ - -#include "wx/defs.h" - -#if wxUSE_HTML - -#include "wx/html/htmltag.h" -#include "wx/html/htmldefs.h" -#include "wx/window.h" - - -class WXDLLIMPEXP_FWD_HTML wxHtmlWindowInterface; -class WXDLLIMPEXP_FWD_HTML wxHtmlLinkInfo; -class WXDLLIMPEXP_FWD_HTML wxHtmlCell; -class WXDLLIMPEXP_FWD_HTML wxHtmlContainerCell; - - -// wxHtmlSelection is data holder with information about text selection. -// Selection is defined by two positions (beginning and end of the selection) -// and two leaf(!) cells at these positions. -class WXDLLIMPEXP_HTML wxHtmlSelection -{ -public: - wxHtmlSelection() - : m_fromPos(wxDefaultPosition), m_toPos(wxDefaultPosition), - m_fromPrivPos(wxDefaultPosition), m_toPrivPos(wxDefaultPosition), - m_fromCell(NULL), m_toCell(NULL) {} - - void Set(const wxPoint& fromPos, const wxHtmlCell *fromCell, - const wxPoint& toPos, const wxHtmlCell *toCell); - void Set(const wxHtmlCell *fromCell, const wxHtmlCell *toCell); - - const wxHtmlCell *GetFromCell() const { return m_fromCell; } - const wxHtmlCell *GetToCell() const { return m_toCell; } - - // these values are in absolute coordinates: - const wxPoint& GetFromPos() const { return m_fromPos; } - const wxPoint& GetToPos() const { return m_toPos; } - - // these are From/ToCell's private data - const wxPoint& GetFromPrivPos() const { return m_fromPrivPos; } - const wxPoint& GetToPrivPos() const { return m_toPrivPos; } - void SetFromPrivPos(const wxPoint& pos) { m_fromPrivPos = pos; } - void SetToPrivPos(const wxPoint& pos) { m_toPrivPos = pos; } - void ClearPrivPos() { m_toPrivPos = m_fromPrivPos = wxDefaultPosition; } - - bool IsEmpty() const - { return m_fromPos == wxDefaultPosition && - m_toPos == wxDefaultPosition; } - -private: - wxPoint m_fromPos, m_toPos; - wxPoint m_fromPrivPos, m_toPrivPos; - const wxHtmlCell *m_fromCell, *m_toCell; -}; - - - -enum wxHtmlSelectionState -{ - wxHTML_SEL_OUT, // currently rendered cell is outside the selection - wxHTML_SEL_IN, // ... is inside selection - wxHTML_SEL_CHANGING // ... is the cell on which selection state changes -}; - -// Selection state is passed to wxHtmlCell::Draw so that it can render itself -// differently e.g. when inside text selection or outside it. -class WXDLLIMPEXP_HTML wxHtmlRenderingState -{ -public: - wxHtmlRenderingState() : m_selState(wxHTML_SEL_OUT) {} - - void SetSelectionState(wxHtmlSelectionState s) { m_selState = s; } - wxHtmlSelectionState GetSelectionState() const { return m_selState; } - - void SetFgColour(const wxColour& c) { m_fgColour = c; } - const wxColour& GetFgColour() const { return m_fgColour; } - void SetBgColour(const wxColour& c) { m_bgColour = c; } - const wxColour& GetBgColour() const { return m_bgColour; } - -private: - wxHtmlSelectionState m_selState; - wxColour m_fgColour, m_bgColour; -}; - - -// HTML rendering customization. This class is used when rendering wxHtmlCells -// as a callback: -class WXDLLIMPEXP_HTML wxHtmlRenderingStyle -{ -public: - virtual ~wxHtmlRenderingStyle() {} - virtual wxColour GetSelectedTextColour(const wxColour& clr) = 0; - virtual wxColour GetSelectedTextBgColour(const wxColour& clr) = 0; -}; - -// Standard style: -class WXDLLIMPEXP_HTML wxDefaultHtmlRenderingStyle : public wxHtmlRenderingStyle -{ -public: - virtual wxColour GetSelectedTextColour(const wxColour& clr); - virtual wxColour GetSelectedTextBgColour(const wxColour& clr); -}; - - -// Information given to cells when drawing them. Contains rendering state, -// selection information and rendering style object that can be used to -// customize the output. -class WXDLLIMPEXP_HTML wxHtmlRenderingInfo -{ -public: - wxHtmlRenderingInfo() : m_selection(NULL), m_style(NULL) {} - - void SetSelection(wxHtmlSelection *s) { m_selection = s; } - wxHtmlSelection *GetSelection() const { return m_selection; } - - void SetStyle(wxHtmlRenderingStyle *style) { m_style = style; } - wxHtmlRenderingStyle& GetStyle() { return *m_style; } - - wxHtmlRenderingState& GetState() { return m_state; } - -protected: - wxHtmlSelection *m_selection; - wxHtmlRenderingStyle *m_style; - wxHtmlRenderingState m_state; -}; - - -// Flags for wxHtmlCell::FindCellByPos -enum -{ - wxHTML_FIND_EXACT = 1, - wxHTML_FIND_NEAREST_BEFORE = 2, - wxHTML_FIND_NEAREST_AFTER = 4 -}; - - -// Superscript/subscript/normal script mode of a cell -enum wxHtmlScriptMode -{ - wxHTML_SCRIPT_NORMAL, - wxHTML_SCRIPT_SUB, - wxHTML_SCRIPT_SUP -}; - - -// --------------------------------------------------------------------------- -// wxHtmlCell -// Internal data structure. It represents fragments of parsed -// HTML page - a word, picture, table, horizontal line and so -// on. It is used by wxHtmlWindow to represent HTML page in -// memory. -// --------------------------------------------------------------------------- - - -class WXDLLIMPEXP_HTML wxHtmlCell : public wxObject -{ -public: - wxHtmlCell(); - virtual ~wxHtmlCell(); - - void SetParent(wxHtmlContainerCell *p) {m_Parent = p;} - wxHtmlContainerCell *GetParent() const {return m_Parent;} - - int GetPosX() const {return m_PosX;} - int GetPosY() const {return m_PosY;} - int GetWidth() const {return m_Width;} - - // Returns the maximum possible length of the cell. - // Call Layout at least once before using GetMaxTotalWidth() - virtual int GetMaxTotalWidth() const { return m_Width; } - - int GetHeight() const {return m_Height;} - int GetDescent() const {return m_Descent;} - - void SetScriptMode(wxHtmlScriptMode mode, long previousBase); - wxHtmlScriptMode GetScriptMode() const { return m_ScriptMode; } - long GetScriptBaseline() { return m_ScriptBaseline; } - - // Formatting cells are not visible on the screen, they only alter - // renderer's state. - bool IsFormattingCell() const { return m_Width == 0 && m_Height == 0; } - - const wxString& GetId() const { return m_id; } - void SetId(const wxString& id) { m_id = id; } - - // returns the link associated with this cell. The position is position - // within the cell so it varies from 0 to m_Width, from 0 to m_Height - virtual wxHtmlLinkInfo* GetLink(int WXUNUSED(x) = 0, - int WXUNUSED(y) = 0) const - { return m_Link; } - - // Returns cursor to be used when mouse is over the cell: - virtual wxCursor GetMouseCursor(wxHtmlWindowInterface *window) const; - -#if WXWIN_COMPATIBILITY_2_6 - // this was replaced by GetMouseCursor, don't use in new code! - virtual wxCursor GetCursor() const; -#endif - - // return next cell among parent's cells - wxHtmlCell *GetNext() const {return m_Next;} - // returns first child cell (if there are any, i.e. if this is container): - virtual wxHtmlCell* GetFirstChild() const { return NULL; } - - // members writing methods - virtual void SetPos(int x, int y) {m_PosX = x, m_PosY = y;} - void SetLink(const wxHtmlLinkInfo& link); - void SetNext(wxHtmlCell *cell) {m_Next = cell;} - - // 1. adjust cell's width according to the fact that maximal possible width - // is w. (this has sense when working with horizontal lines, tables - // etc.) - // 2. prepare layout (=fill-in m_PosX, m_PosY (and sometime m_Height) - // members) = place items to fit window, according to the width w - virtual void Layout(int w); - - // renders the cell - virtual void Draw(wxDC& WXUNUSED(dc), - int WXUNUSED(x), int WXUNUSED(y), - int WXUNUSED(view_y1), int WXUNUSED(view_y2), - wxHtmlRenderingInfo& WXUNUSED(info)) {} - - // proceed drawing actions in case the cell is not visible (scrolled out of - // screen). This is needed to change fonts, colors and so on. - virtual void DrawInvisible(wxDC& WXUNUSED(dc), - int WXUNUSED(x), int WXUNUSED(y), - wxHtmlRenderingInfo& WXUNUSED(info)) {} - - // This method returns pointer to the FIRST cell for that - // the condition - // is true. It first checks if the condition is true for this - // cell and then calls m_Next->Find(). (Note: it checks - // all subcells if the cell is container) - // Condition is unique condition identifier (see htmldefs.h) - // (user-defined condition IDs should start from 10000) - // and param is optional parameter - // Example : m_Cell->Find(wxHTML_COND_ISANCHOR, "news"); - // returns pointer to anchor news - virtual const wxHtmlCell* Find(int condition, const void* param) const; - - - // This function is called when mouse button is clicked over the cell. - // Returns true if a link is clicked, false otherwise. - // - // 'window' is pointer to wxHtmlWindowInterface of the window which - // generated the event. - // HINT: if this handling is not enough for you you should use - // wxHtmlWidgetCell - virtual bool ProcessMouseClick(wxHtmlWindowInterface *window, - const wxPoint& pos, - const wxMouseEvent& event); - -#if WXWIN_COMPATIBILITY_2_6 - // this was replaced by ProcessMouseClick, don't use in new code! - virtual void OnMouseClick(wxWindow *window, - int x, int y, const wxMouseEvent& event); -#endif - - // This method used to adjust pagebreak position. The parameter is variable - // that contains y-coordinate of page break (= horizontal line that should - // not be crossed by words, images etc.). If this cell cannot be divided - // into two pieces (each one on another page) then it moves the pagebreak - // few pixels up. - // - // Returned value : true if pagebreak was modified, false otherwise - // Usage : while (container->AdjustPagebreak(&p)) {} - virtual bool AdjustPagebreak(int *pagebreak, - wxArrayInt& known_pagebreaks) const; - - // Sets cell's behaviour on pagebreaks (see AdjustPagebreak). Default - // is true - the cell can be split on two pages - void SetCanLiveOnPagebreak(bool can) { m_CanLiveOnPagebreak = can; } - - // Can the line be broken before this cell? - virtual bool IsLinebreakAllowed() const - { return !IsFormattingCell(); } - - // Returns true for simple == terminal cells, i.e. not composite ones. - // This if for internal usage only and may disappear in future versions! - virtual bool IsTerminalCell() const { return true; } - - // Find a cell inside this cell positioned at the given coordinates - // (relative to this's positions). Returns NULL if no such cell exists. - // The flag can be used to specify whether to look for terminal or - // nonterminal cells or both. In either case, returned cell is deepest - // cell in cells tree that contains [x,y]. - virtual wxHtmlCell *FindCellByPos(wxCoord x, wxCoord y, - unsigned flags = wxHTML_FIND_EXACT) const; - - // Returns absolute position of the cell on HTML canvas. - // If rootCell is provided, then it's considered to be the root of the - // hierarchy and the returned value is relative to it. - wxPoint GetAbsPos(wxHtmlCell *rootCell = NULL) const; - - // Returns root cell of the hierarchy (i.e. grand-grand-...-parent that - // doesn't have a parent itself) - wxHtmlCell *GetRootCell() const; - - // Returns first (last) terminal cell inside this cell. It may return NULL, - // but it is rare -- only if there are no terminals in the tree. - virtual wxHtmlCell *GetFirstTerminal() const - { return wxConstCast(this, wxHtmlCell); } - virtual wxHtmlCell *GetLastTerminal() const - { return wxConstCast(this, wxHtmlCell); } - - // Returns cell's depth, i.e. how far under the root cell it is - // (if it is the root, depth is 0) - unsigned GetDepth() const; - - // Returns true if the cell appears before 'cell' in natural order of - // cells (= as they are read). If cell A is (grand)parent of cell B, - // then both A.IsBefore(B) and B.IsBefore(A) always return true. - bool IsBefore(wxHtmlCell *cell) const; - - // Converts the cell into text representation. If sel != NULL then - // only part of the cell inside the selection is converted. - virtual wxString ConvertToText(wxHtmlSelection *WXUNUSED(sel)) const - { return wxEmptyString; } - -protected: - // pointer to the next cell - wxHtmlCell *m_Next; - // pointer to parent cell - wxHtmlContainerCell *m_Parent; - - // dimensions of fragment (m_Descent is used to position text & images) - long m_Width, m_Height, m_Descent; - // position where the fragment is drawn: - long m_PosX, m_PosY; - - // superscript/subscript/normal: - wxHtmlScriptMode m_ScriptMode; - long m_ScriptBaseline; - - // destination address if this fragment is hypertext link, NULL otherwise - wxHtmlLinkInfo *m_Link; - // true if this cell can be placed on pagebreak, false otherwise - bool m_CanLiveOnPagebreak; - // unique identifier of the cell, generated from "id" property of tags - wxString m_id; - - DECLARE_ABSTRACT_CLASS(wxHtmlCell) - DECLARE_NO_COPY_CLASS(wxHtmlCell) -}; - - - - -// ---------------------------------------------------------------------------- -// Inherited cells: -// ---------------------------------------------------------------------------- - - -// ---------------------------------------------------------------------------- -// wxHtmlWordCell -// Single word in input stream. -// ---------------------------------------------------------------------------- - -class WXDLLIMPEXP_HTML wxHtmlWordCell : public wxHtmlCell -{ -public: - wxHtmlWordCell(const wxString& word, const wxDC& dc); - void Draw(wxDC& dc, int x, int y, int view_y1, int view_y2, - wxHtmlRenderingInfo& info); - virtual wxCursor GetMouseCursor(wxHtmlWindowInterface *window) const; - wxString ConvertToText(wxHtmlSelection *sel) const; - bool IsLinebreakAllowed() const { return m_allowLinebreak; } - - void SetPreviousWord(wxHtmlWordCell *cell); - -protected: - void SetSelectionPrivPos(const wxDC& dc, wxHtmlSelection *s) const; - void Split(const wxDC& dc, - const wxPoint& selFrom, const wxPoint& selTo, - unsigned& pos1, unsigned& pos2) const; - - wxString m_Word; - bool m_allowLinebreak; - - DECLARE_ABSTRACT_CLASS(wxHtmlWordCell) - DECLARE_NO_COPY_CLASS(wxHtmlWordCell) -}; - - - - - -// Container contains other cells, thus forming tree structure of rendering -// elements. Basic code of layout algorithm is contained in this class. -class WXDLLIMPEXP_HTML wxHtmlContainerCell : public wxHtmlCell -{ -public: - wxHtmlContainerCell(wxHtmlContainerCell *parent); - virtual ~wxHtmlContainerCell(); - - virtual void Layout(int w); - virtual void Draw(wxDC& dc, int x, int y, int view_y1, int view_y2, - wxHtmlRenderingInfo& info); - virtual void DrawInvisible(wxDC& dc, int x, int y, - wxHtmlRenderingInfo& info); -/* virtual bool AdjustPagebreak(int *pagebreak, int *known_pagebreaks = NULL, int number_of_pages = 0) const;*/ - virtual bool AdjustPagebreak(int *pagebreak, wxArrayInt& known_pagebreaks) const; - - // insert cell at the end of m_Cells list - void InsertCell(wxHtmlCell *cell); - - // sets horizontal/vertical alignment - void SetAlignHor(int al) {m_AlignHor = al; m_LastLayout = -1;} - int GetAlignHor() const {return m_AlignHor;} - void SetAlignVer(int al) {m_AlignVer = al; m_LastLayout = -1;} - int GetAlignVer() const {return m_AlignVer;} - - // sets left-border indentation. units is one of wxHTML_UNITS_* constants - // what is combination of wxHTML_INDENT_* - void SetIndent(int i, int what, int units = wxHTML_UNITS_PIXELS); - // returns the indentation. ind is one of wxHTML_INDENT_* constants - int GetIndent(int ind) const; - // returns type of value returned by GetIndent(ind) - int GetIndentUnits(int ind) const; - - // sets alignment info based on given tag's params - void SetAlign(const wxHtmlTag& tag); - // sets floating width adjustment - // (examples : 32 percent of parent container, - // -15 pixels percent (this means 100 % - 15 pixels) - void SetWidthFloat(int w, int units) {m_WidthFloat = w; m_WidthFloatUnits = units; m_LastLayout = -1;} - void SetWidthFloat(const wxHtmlTag& tag, double pixel_scale = 1.0); - // sets minimal height of this container. - void SetMinHeight(int h, int align = wxHTML_ALIGN_TOP) {m_MinHeight = h; m_MinHeightAlign = align; m_LastLayout = -1;} - - void SetBackgroundColour(const wxColour& clr) {m_UseBkColour = true; m_BkColour = clr;} - // returns background colour (of wxNullColour if none set), so that widgets can - // adapt to it: - wxColour GetBackgroundColour(); - void SetBorder(const wxColour& clr1, const wxColour& clr2) {m_UseBorder = true; m_BorderColour1 = clr1, m_BorderColour2 = clr2;} - virtual wxHtmlLinkInfo* GetLink(int x = 0, int y = 0) const; - virtual const wxHtmlCell* Find(int condition, const void* param) const; - -#if WXWIN_COMPATIBILITY_2_6 - // this was replaced by ProcessMouseClick, don't use in new code! - virtual void OnMouseClick(wxWindow *window, - int x, int y, const wxMouseEvent& event); -#endif - virtual bool ProcessMouseClick(wxHtmlWindowInterface *window, - const wxPoint& pos, - const wxMouseEvent& event); - - virtual wxHtmlCell* GetFirstChild() const { return m_Cells; } -#if WXWIN_COMPATIBILITY_2_4 - wxDEPRECATED( wxHtmlCell* GetFirstCell() const ); -#endif - // returns last child cell: - wxHtmlCell* GetLastChild() const { return m_LastCell; } - - // see comment in wxHtmlCell about this method - virtual bool IsTerminalCell() const { return false; } - - virtual wxHtmlCell *FindCellByPos(wxCoord x, wxCoord y, - unsigned flags = wxHTML_FIND_EXACT) const; - - virtual wxHtmlCell *GetFirstTerminal() const; - virtual wxHtmlCell *GetLastTerminal() const; - - - // Removes indentation on top or bottom of the container (i.e. above or - // below first/last terminal cell). For internal use only. - virtual void RemoveExtraSpacing(bool top, bool bottom); - - // Returns the maximum possible length of the container. - // Call Layout at least once before using GetMaxTotalWidth() - virtual int GetMaxTotalWidth() const { return m_MaxTotalWidth; } - -protected: - void UpdateRenderingStatePre(wxHtmlRenderingInfo& info, - wxHtmlCell *cell) const; - void UpdateRenderingStatePost(wxHtmlRenderingInfo& info, - wxHtmlCell *cell) const; - -protected: - int m_IndentLeft, m_IndentRight, m_IndentTop, m_IndentBottom; - // indentation of subcells. There is always m_Indent pixels - // big space between given border of the container and the subcells - // it m_Indent < 0 it is in PERCENTS, otherwise it is in pixels - int m_MinHeight, m_MinHeightAlign; - // minimal height. - wxHtmlCell *m_Cells, *m_LastCell; - // internal cells, m_Cells points to the first of them, m_LastCell to the last one. - // (LastCell is needed only to speed-up InsertCell) - int m_AlignHor, m_AlignVer; - // alignment horizontal and vertical (left, center, right) - int m_WidthFloat, m_WidthFloatUnits; - // width float is used in adjustWidth - bool m_UseBkColour; - wxColour m_BkColour; - // background color of this container - bool m_UseBorder; - wxColour m_BorderColour1, m_BorderColour2; - // borders color of this container - int m_LastLayout; - // if != -1 then call to Layout may be no-op - // if previous call to Layout has same argument - int m_MaxTotalWidth; - // Maximum possible length if ignoring line wrap - - - DECLARE_ABSTRACT_CLASS(wxHtmlContainerCell) - DECLARE_NO_COPY_CLASS(wxHtmlContainerCell) -}; - -#if WXWIN_COMPATIBILITY_2_4 -inline wxHtmlCell* wxHtmlContainerCell::GetFirstCell() const - { return GetFirstChild(); } -#endif - - - - -// --------------------------------------------------------------------------- -// wxHtmlColourCell -// Color changer. -// --------------------------------------------------------------------------- - -class WXDLLIMPEXP_HTML wxHtmlColourCell : public wxHtmlCell -{ -public: - wxHtmlColourCell(const wxColour& clr, int flags = wxHTML_CLR_FOREGROUND) : wxHtmlCell() {m_Colour = clr; m_Flags = flags;} - virtual void Draw(wxDC& dc, int x, int y, int view_y1, int view_y2, - wxHtmlRenderingInfo& info); - virtual void DrawInvisible(wxDC& dc, int x, int y, - wxHtmlRenderingInfo& info); - -protected: - wxColour m_Colour; - unsigned m_Flags; - - DECLARE_ABSTRACT_CLASS(wxHtmlColourCell) - DECLARE_NO_COPY_CLASS(wxHtmlColourCell) -}; - - - - -//-------------------------------------------------------------------------------- -// wxHtmlFontCell -// Sets actual font used for text rendering -//-------------------------------------------------------------------------------- - -class WXDLLIMPEXP_HTML wxHtmlFontCell : public wxHtmlCell -{ -public: - wxHtmlFontCell(wxFont *font) : wxHtmlCell() { m_Font = (*font); } - virtual void Draw(wxDC& dc, int x, int y, int view_y1, int view_y2, - wxHtmlRenderingInfo& info); - virtual void DrawInvisible(wxDC& dc, int x, int y, - wxHtmlRenderingInfo& info); - -protected: - wxFont m_Font; - - DECLARE_ABSTRACT_CLASS(wxHtmlFontCell) - DECLARE_NO_COPY_CLASS(wxHtmlFontCell) -}; - - - - - - -//-------------------------------------------------------------------------------- -// wxHtmlwidgetCell -// This cell is connected with wxWindow object -// You can use it to insert windows into HTML page -// (buttons, input boxes etc.) -//-------------------------------------------------------------------------------- - -class WXDLLIMPEXP_HTML wxHtmlWidgetCell : public wxHtmlCell -{ -public: - // !!! wnd must have correct parent! - // if w != 0 then the m_Wnd has 'floating' width - it adjust - // it's width according to parent container's width - // (w is percent of parent's width) - wxHtmlWidgetCell(wxWindow *wnd, int w = 0); - virtual ~wxHtmlWidgetCell() { m_Wnd->Destroy(); } - virtual void Draw(wxDC& dc, int x, int y, int view_y1, int view_y2, - wxHtmlRenderingInfo& info); - virtual void DrawInvisible(wxDC& dc, int x, int y, - wxHtmlRenderingInfo& info); - virtual void Layout(int w); - -protected: - wxWindow* m_Wnd; - int m_WidthFloat; - // width float is used in adjustWidth (it is in percents) - - DECLARE_ABSTRACT_CLASS(wxHtmlWidgetCell) - DECLARE_NO_COPY_CLASS(wxHtmlWidgetCell) -}; - - - -//-------------------------------------------------------------------------------- -// wxHtmlLinkInfo -// Internal data structure. It represents hypertext link -//-------------------------------------------------------------------------------- - -class WXDLLIMPEXP_HTML wxHtmlLinkInfo : public wxObject -{ -public: - wxHtmlLinkInfo() : wxObject() - { m_Href = m_Target = wxEmptyString; m_Event = NULL, m_Cell = NULL; } - wxHtmlLinkInfo(const wxString& href, const wxString& target = wxEmptyString) : wxObject() - { m_Href = href; m_Target = target; m_Event = NULL, m_Cell = NULL; } - wxHtmlLinkInfo(const wxHtmlLinkInfo& l) : wxObject() - { m_Href = l.m_Href, m_Target = l.m_Target, m_Event = l.m_Event; - m_Cell = l.m_Cell; } - wxHtmlLinkInfo& operator=(const wxHtmlLinkInfo& l) - { m_Href = l.m_Href, m_Target = l.m_Target, m_Event = l.m_Event; - m_Cell = l.m_Cell; return *this; } - - void SetEvent(const wxMouseEvent *e) { m_Event = e; } - void SetHtmlCell(const wxHtmlCell *e) { m_Cell = e; } - - wxString GetHref() const { return m_Href; } - wxString GetTarget() const { return m_Target; } - const wxMouseEvent* GetEvent() const { return m_Event; } - const wxHtmlCell* GetHtmlCell() const { return m_Cell; } - -private: - wxString m_Href, m_Target; - const wxMouseEvent *m_Event; - const wxHtmlCell *m_Cell; -}; - - - -// ---------------------------------------------------------------------------- -// wxHtmlTerminalCellsInterator -// ---------------------------------------------------------------------------- - -class WXDLLIMPEXP_HTML wxHtmlTerminalCellsInterator -{ -public: - wxHtmlTerminalCellsInterator(const wxHtmlCell *from, const wxHtmlCell *to) - : m_to(to), m_pos(from) {} - - operator bool() const { return m_pos != NULL; } - const wxHtmlCell* operator++(); - const wxHtmlCell* operator->() const { return m_pos; } - const wxHtmlCell* operator*() const { return m_pos; } - -private: - const wxHtmlCell *m_to, *m_pos; -}; - - - -#endif // wxUSE_HTML - -#endif // _WX_HTMLCELL_H_ - diff --git a/wxWidgets/include/wx/html/htmldefs.h b/wxWidgets/include/wx/html/htmldefs.h deleted file mode 100644 index d000e616f4..0000000000 --- a/wxWidgets/include/wx/html/htmldefs.h +++ /dev/null @@ -1,104 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: htmldefs.h -// Purpose: constants for wxhtml library -// Author: Vaclav Slavik -// RCS-ID: $Id: htmldefs.h 40823 2006-08-25 16:52:58Z VZ $ -// Copyright: (c) 1999 Vaclav Slavik -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - - -#ifndef _WX_HTMLDEFS_H_ -#define _WX_HTMLDEFS_H_ - -#include "wx/defs.h" - -#if wxUSE_HTML - -//-------------------------------------------------------------------------------- -// ALIGNMENTS -// Describes alignment of text etc. in containers -//-------------------------------------------------------------------------------- - -#define wxHTML_ALIGN_LEFT 0x0000 -#define wxHTML_ALIGN_RIGHT 0x0002 -#define wxHTML_ALIGN_JUSTIFY 0x0010 - -#define wxHTML_ALIGN_TOP 0x0004 -#define wxHTML_ALIGN_BOTTOM 0x0008 - -#define wxHTML_ALIGN_CENTER 0x0001 - - - -//-------------------------------------------------------------------------------- -// COLOR MODES -// Used by wxHtmlColourCell to determine clr of what is changing -//-------------------------------------------------------------------------------- - -#define wxHTML_CLR_FOREGROUND 0x0001 -#define wxHTML_CLR_BACKGROUND 0x0002 - - - -//-------------------------------------------------------------------------------- -// UNITS -// Used to specify units -//-------------------------------------------------------------------------------- - -#define wxHTML_UNITS_PIXELS 0x0001 -#define wxHTML_UNITS_PERCENT 0x0002 - - - -//-------------------------------------------------------------------------------- -// INDENTS -// Used to specify indetation relatives -//-------------------------------------------------------------------------------- - -#define wxHTML_INDENT_LEFT 0x0010 -#define wxHTML_INDENT_RIGHT 0x0020 -#define wxHTML_INDENT_TOP 0x0040 -#define wxHTML_INDENT_BOTTOM 0x0080 - -#define wxHTML_INDENT_HORIZONTAL (wxHTML_INDENT_LEFT | wxHTML_INDENT_RIGHT) -#define wxHTML_INDENT_VERTICAL (wxHTML_INDENT_TOP | wxHTML_INDENT_BOTTOM) -#define wxHTML_INDENT_ALL (wxHTML_INDENT_VERTICAL | wxHTML_INDENT_HORIZONTAL) - - - - -//-------------------------------------------------------------------------------- -// FIND CONDITIONS -// Identifiers of wxHtmlCell's Find() conditions -//-------------------------------------------------------------------------------- - -#define wxHTML_COND_ISANCHOR 1 - // Finds the anchor of 'param' name (pointer to wxString). - -#define wxHTML_COND_ISIMAGEMAP 2 - // Finds imagemap of 'param' name (pointer to wxString). - // (used exclusively by m_image.cpp) - -#define wxHTML_COND_USER 10000 - // User-defined conditions should start from this number - - -//-------------------------------------------------------------------------------- -// INTERNALS -// wxHTML internal constants -//-------------------------------------------------------------------------------- - - /* size of one scroll step of wxHtmlWindow in pixels */ -#define wxHTML_SCROLL_STEP 16 - - /* size of temporary buffer used during parsing */ -#define wxHTML_BUFLEN 1024 - - /* maximum number of pages printable via html printing */ -#define wxHTML_PRINT_MAX_PAGES 999 - -#endif // wxUSE_HTML - -#endif // _WX_HTMLDEFS_H_ - diff --git a/wxWidgets/include/wx/html/htmlfilt.h b/wxWidgets/include/wx/html/htmlfilt.h deleted file mode 100644 index 38b5ab3444..0000000000 --- a/wxWidgets/include/wx/html/htmlfilt.h +++ /dev/null @@ -1,82 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: htmlfilt.h -// Purpose: filters -// Author: Vaclav Slavik -// RCS-ID: $Id: htmlfilt.h 35650 2005-09-23 12:56:45Z MR $ -// Copyright: (c) 1999 Vaclav Slavik -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_HTMLFILT_H_ -#define _WX_HTMLFILT_H_ - -#include "wx/defs.h" - -#if wxUSE_HTML - -#include "wx/filesys.h" - - -//-------------------------------------------------------------------------------- -// wxHtmlFilter -// This class is input filter. It can "translate" files -// in non-HTML format to HTML format -// interface to access certain -// kinds of files (HTPP, FTP, local, tar.gz etc..) -//-------------------------------------------------------------------------------- - -class WXDLLIMPEXP_HTML wxHtmlFilter : public wxObject -{ - DECLARE_ABSTRACT_CLASS(wxHtmlFilter) - -public: - wxHtmlFilter() : wxObject() {} - virtual ~wxHtmlFilter() {} - - // returns true if this filter is able to open&read given file - virtual bool CanRead(const wxFSFile& file) const = 0; - - // Reads given file and returns HTML document. - // Returns empty string if opening failed - virtual wxString ReadFile(const wxFSFile& file) const = 0; -}; - - - -//-------------------------------------------------------------------------------- -// wxHtmlFilterPlainText -// This filter is used as default filter if no other can -// be used (= uknown type of file). It is used by -// wxHtmlWindow itself. -//-------------------------------------------------------------------------------- - - -class WXDLLIMPEXP_HTML wxHtmlFilterPlainText : public wxHtmlFilter -{ - DECLARE_DYNAMIC_CLASS(wxHtmlFilterPlainText) - -public: - virtual bool CanRead(const wxFSFile& file) const; - virtual wxString ReadFile(const wxFSFile& file) const; -}; - -//-------------------------------------------------------------------------------- -// wxHtmlFilterHTML -// filter for text/html -//-------------------------------------------------------------------------------- - -class wxHtmlFilterHTML : public wxHtmlFilter -{ - DECLARE_DYNAMIC_CLASS(wxHtmlFilterHTML) - - public: - virtual bool CanRead(const wxFSFile& file) const; - virtual wxString ReadFile(const wxFSFile& file) const; -}; - - - -#endif // wxUSE_HTML - -#endif // _WX_HTMLFILT_H_ - diff --git a/wxWidgets/include/wx/html/htmlpars.h b/wxWidgets/include/wx/html/htmlpars.h deleted file mode 100644 index b1080863bb..0000000000 --- a/wxWidgets/include/wx/html/htmlpars.h +++ /dev/null @@ -1,283 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: htmlpars.h -// Purpose: wxHtmlParser class (generic parser) -// Author: Vaclav Slavik -// RCS-ID: $Id: htmlpars.h 49563 2007-10-31 20:46:21Z VZ $ -// Copyright: (c) 1999 Vaclav Slavik -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_HTMLPARS_H_ -#define _WX_HTMLPARS_H_ - -#include "wx/defs.h" -#if wxUSE_HTML - -#include "wx/html/htmltag.h" -#include "wx/filesys.h" -#include "wx/hash.h" -#include "wx/fontenc.h" - -class WXDLLIMPEXP_FWD_BASE wxMBConv; -class WXDLLIMPEXP_FWD_HTML wxHtmlParser; -class WXDLLIMPEXP_FWD_HTML wxHtmlTagHandler; -class WXDLLIMPEXP_FWD_HTML wxHtmlEntitiesParser; - -class wxHtmlTextPieces; -class wxHtmlParserState; - - -enum wxHtmlURLType -{ - wxHTML_URL_PAGE, - wxHTML_URL_IMAGE, - wxHTML_URL_OTHER -}; - -// This class handles generic parsing of HTML document : it scans -// the document and divides it into blocks of tags (where one block -// consists of starting and ending tag and of text between these -// 2 tags. -class WXDLLIMPEXP_HTML wxHtmlParser : public wxObject -{ - DECLARE_ABSTRACT_CLASS(wxHtmlParser) - -public: - wxHtmlParser(); - virtual ~wxHtmlParser(); - - // Sets the class which will be used for opening files - void SetFS(wxFileSystem *fs) { m_FS = fs; } - - wxFileSystem* GetFS() const { return m_FS; } - - // Opens file if the parser is allowed to open given URL (may be forbidden - // for security reasons) - virtual wxFSFile *OpenURL(wxHtmlURLType type, const wxString& url) const; - - // You can simply call this method when you need parsed output. - // This method does these things: - // 1. call InitParser(source); - // 2. call DoParsing(); - // 3. call GetProduct(); (its return value is then returned) - // 4. call DoneParser(); - wxObject* Parse(const wxString& source); - - // Sets the source. This must be called before running Parse() method. - virtual void InitParser(const wxString& source); - // This must be called after Parse(). - virtual void DoneParser(); - - // May be called during parsing to immediately return from Parse(). - virtual void StopParsing() { m_stopParsing = true; } - - // Parses the m_Source from begin_pos to end_pos-1. - // (in noparams version it parses whole m_Source) - void DoParsing(int begin_pos, int end_pos); - void DoParsing(); - - // Returns pointer to the tag at parser's current position - wxHtmlTag *GetCurrentTag() const { return m_CurTag; } - - // Returns product of parsing - // Returned value is result of parsing of the part. The type of this result - // depends on internal representation in derived parser - // (see wxHtmlWinParser for details). - virtual wxObject* GetProduct() = 0; - - // adds handler to the list & hash table of handlers. - virtual void AddTagHandler(wxHtmlTagHandler *handler); - - // Forces the handler to handle additional tags (not returned by GetSupportedTags). - // The handler should already be in use by this parser. - // Example: you want to parse following pseudo-html structure: - // - // - // - // - // This last it has different meaning, we don't want it to be parsed by myitems handler! - // handler can handle only 'myitems' (e.g. its GetSupportedTags returns "MYITEMS") - // you can call PushTagHandler(handler, "IT") when you find - // and call PopTagHandler() when you find - void PushTagHandler(wxHtmlTagHandler *handler, const wxString& tags); - - // Restores state before last call to PushTagHandler - void PopTagHandler(); - - wxString* GetSource() {return &m_Source;} - void SetSource(const wxString& src); - - // Sets HTML source and remembers current parser's state so that it can - // later be restored. This is useful for on-line modifications of - // HTML source (for example,
 handler replaces spaces with  
-    // and newlines with 
) - virtual void SetSourceAndSaveState(const wxString& src); - // Restores parser's state from stack or returns false if the stack is - // empty - virtual bool RestoreState(); - - // Returns HTML source inside the element (i.e. between the starting - // and ending tag) - wxString GetInnerSource(const wxHtmlTag& tag); - - // Parses HTML string 'markup' and extracts charset info from tag - // if present. Returns empty string if the tag is missing. - // For wxHTML's internal use. - static wxString ExtractCharsetInformation(const wxString& markup); - - // Returns entity parser object, used to substitute HTML &entities; - wxHtmlEntitiesParser *GetEntitiesParser() const { return m_entitiesParser; } - -protected: - // DOM structure - void CreateDOMTree(); - void DestroyDOMTree(); - void CreateDOMSubTree(wxHtmlTag *cur, - int begin_pos, int end_pos, - wxHtmlTagsCache *cache); - - // Adds text to the output. - // This is called from Parse() and must be overriden in derived classes. - // txt is not guaranteed to be only one word. It is largest continuous part of text - // (= not broken by tags) - // NOTE : using char* because of speed improvements - virtual void AddText(const wxChar* txt) = 0; - - // Adds tag and proceeds it. Parse() may (and usually is) called from this method. - // This is called from Parse() and may be overriden. - // Default behavior is that it looks for proper handler in m_Handlers. The tag is - // ignored if no hander is found. - // Derived class is *responsible* for filling in m_Handlers table. - virtual void AddTag(const wxHtmlTag& tag); - -protected: - // DOM tree: - wxHtmlTag *m_CurTag; - wxHtmlTag *m_Tags; - wxHtmlTextPieces *m_TextPieces; - size_t m_CurTextPiece; - - wxString m_Source; - - wxHtmlParserState *m_SavedStates; - - // handlers that handle particular tags. The table is accessed by - // key = tag's name. - // This attribute MUST be filled by derived class otherwise it would - // be empty and no tags would be recognized - // (see wxHtmlWinParser for details about filling it) - // m_HandlersHash is for random access based on knowledge of tag name (BR, P, etc.) - // it may (and often does) contain more references to one object - // m_HandlersList is list of all handlers and it is guaranteed to contain - // only one reference to each handler instance. - wxList m_HandlersList; - wxHashTable m_HandlersHash; - - DECLARE_NO_COPY_CLASS(wxHtmlParser) - - // class for opening files (file system) - wxFileSystem *m_FS; - // handlers stack used by PushTagHandler and PopTagHandler - wxList *m_HandlersStack; - - // entity parse - wxHtmlEntitiesParser *m_entitiesParser; - - // flag indicating that the parser should stop - bool m_stopParsing; -}; - - - -// This class (and derived classes) cooperates with wxHtmlParser. -// Each recognized tag is passed to handler which is capable -// of handling it. Each tag is handled in 3 steps: -// 1. Handler will modifies state of parser -// (using its public methods) -// 2. Parser parses source between starting and ending tag -// 3. Handler restores original state of the parser -class WXDLLIMPEXP_HTML wxHtmlTagHandler : public wxObject -{ - DECLARE_ABSTRACT_CLASS(wxHtmlTagHandler) - -public: - wxHtmlTagHandler() : wxObject () { m_Parser = NULL; } - - // Sets the parser. - // NOTE : each _instance_ of handler is guaranteed to be called - // only by one parser. This means you don't have to care about - // reentrancy. - virtual void SetParser(wxHtmlParser *parser) - { m_Parser = parser; } - - // Returns list of supported tags. The list is in uppercase and - // tags are delimited by ','. - // Example : "I,B,FONT,P" - // is capable of handling italic, bold, font and paragraph tags - virtual wxString GetSupportedTags() = 0; - - // This is hadling core method. It does all the Steps 1-3. - // To process step 2, you can call ParseInner() - // returned value : true if it called ParseInner(), - // false etherwise - virtual bool HandleTag(const wxHtmlTag& tag) = 0; - -protected: - // parses input between beginning and ending tag. - // m_Parser must be set. - void ParseInner(const wxHtmlTag& tag) - { m_Parser->DoParsing(tag.GetBeginPos(), tag.GetEndPos1()); } - - // Parses given source as if it was tag's inner code (see - // wxHtmlParser::GetInnerSource). Unlike ParseInner(), this method lets - // you specify the source code to parse. This is useful when you need to - // modify the inner text before parsing. - void ParseInnerSource(const wxString& source); - - wxHtmlParser *m_Parser; - - DECLARE_NO_COPY_CLASS(wxHtmlTagHandler) -}; - - -// This class is used to parse HTML entities in strings. It can handle -// both named entities and &#xxxx entries where xxxx is Unicode code. -class WXDLLIMPEXP_HTML wxHtmlEntitiesParser : public wxObject -{ - DECLARE_DYNAMIC_CLASS(wxHtmlEntitiesParser) - -public: - wxHtmlEntitiesParser(); - virtual ~wxHtmlEntitiesParser(); - - // Sets encoding of output string. - // Has no effect if wxUSE_WCHAR_T==0 or wxUSE_UNICODE==1 - void SetEncoding(wxFontEncoding encoding); - - // Parses entities in input and replaces them with respective characters - // (with respect to output encoding) - wxString Parse(const wxString& input); - - // Returns character for given entity or 0 if the enity is unknown - wxChar GetEntityChar(const wxString& entity); - - // Returns character that represents given Unicode code -#if wxUSE_UNICODE - wxChar GetCharForCode(unsigned code) { return (wxChar)code; } -#else - wxChar GetCharForCode(unsigned code); -#endif - -protected: -#if wxUSE_WCHAR_T && !wxUSE_UNICODE - wxMBConv *m_conv; - wxFontEncoding m_encoding; -#endif - - DECLARE_NO_COPY_CLASS(wxHtmlEntitiesParser) -}; - - -#endif - -#endif // _WX_HTMLPARS_H_ diff --git a/wxWidgets/include/wx/html/htmlproc.h b/wxWidgets/include/wx/html/htmlproc.h deleted file mode 100644 index eda556b49d..0000000000 --- a/wxWidgets/include/wx/html/htmlproc.h +++ /dev/null @@ -1,58 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: htmlprep.h -// Purpose: HTML processor -// Author: Vaclav Slavik -// RCS-ID: $Id: htmlproc.h 35650 2005-09-23 12:56:45Z MR $ -// Copyright: (c) 2001 Vaclav Slavik -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_HTMLPREP_H_ -#define _WX_HTMLPREP_H_ - -#include "wx/defs.h" - -#if wxUSE_HTML - -#include "wx/string.h" - -// Priority of preprocessor in the chain. The higher, the earlier it is used -enum -{ - wxHTML_PRIORITY_DONTCARE = 128, // if the order doesn't matter, use this - // priority - wxHTML_PRIORITY_SYSTEM = 256 // >=256 is only for wxHTML's internals -}; - -// Classes derived from this class serve as simple text processors for -// wxHtmlWindow. wxHtmlWindow runs HTML markup through all registered -// processors before displaying it, thus allowing for on-the-fly -// modifications of the markup. - -class WXDLLIMPEXP_HTML wxHtmlProcessor : public wxObject -{ - DECLARE_ABSTRACT_CLASS(wxHtmlProcessor) - -public: - wxHtmlProcessor() : wxObject(), m_enabled(true) {} - virtual ~wxHtmlProcessor() {} - - // Process input text and return processed result - virtual wxString Process(const wxString& text) const = 0; - - // Return priority value of this processor. The higher, the sooner - // is the processor applied to the text. - virtual int GetPriority() const { return wxHTML_PRIORITY_DONTCARE; } - - // Enable/disable the processor. wxHtmlWindow won't use a disabled - // processor even if it is in its processors queue. - virtual void Enable(bool enable = true) { m_enabled = enable; } - bool IsEnabled() const { return m_enabled; } - -protected: - bool m_enabled; -}; - -#endif // wxUSE_HTML - -#endif // _WX_HTMLPROC_H_ diff --git a/wxWidgets/include/wx/html/htmltag.h b/wxWidgets/include/wx/html/htmltag.h deleted file mode 100644 index 6596111922..0000000000 --- a/wxWidgets/include/wx/html/htmltag.h +++ /dev/null @@ -1,148 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: htmltag.h -// Purpose: wxHtmlTag class (represents single tag) -// Author: Vaclav Slavik -// RCS-ID: $Id: htmltag.h 49563 2007-10-31 20:46:21Z VZ $ -// Copyright: (c) 1999 Vaclav Slavik -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_HTMLTAG_H_ -#define _WX_HTMLTAG_H_ - -#include "wx/defs.h" - -#if wxUSE_HTML - -#include "wx/object.h" -#include "wx/arrstr.h" - -class WXDLLIMPEXP_FWD_CORE wxColour; -class WXDLLIMPEXP_FWD_HTML wxHtmlEntitiesParser; - -//----------------------------------------------------------------------------- -// wxHtmlTagsCache -// - internal wxHTML class, do not use! -//----------------------------------------------------------------------------- - -struct wxHtmlCacheItem; - -class WXDLLIMPEXP_HTML wxHtmlTagsCache : public wxObject -{ - DECLARE_DYNAMIC_CLASS(wxHtmlTagsCache) - -private: - wxHtmlCacheItem *m_Cache; - int m_CacheSize; - int m_CachePos; - -public: - wxHtmlTagsCache() : wxObject() {m_CacheSize = 0; m_Cache = NULL;} - wxHtmlTagsCache(const wxString& source); - virtual ~wxHtmlTagsCache() {free(m_Cache);} - - // Finds parameters for tag starting at at and fills the variables - void QueryTag(int at, int* end1, int* end2); - - DECLARE_NO_COPY_CLASS(wxHtmlTagsCache) -}; - - -//-------------------------------------------------------------------------------- -// wxHtmlTag -// This represents single tag. It is used as internal structure -// by wxHtmlParser. -//-------------------------------------------------------------------------------- - -class WXDLLIMPEXP_HTML wxHtmlTag : public wxObject -{ - DECLARE_CLASS(wxHtmlTag) - -protected: - // constructs wxHtmlTag object based on HTML tag. - // The tag begins (with '<' character) at position pos in source - // end_pos is position where parsing ends (usually end of document) - wxHtmlTag(wxHtmlTag *parent, - const wxString& source, int pos, int end_pos, - wxHtmlTagsCache *cache, - wxHtmlEntitiesParser *entParser); - friend class wxHtmlParser; -public: - virtual ~wxHtmlTag(); - - wxHtmlTag *GetParent() const {return m_Parent;} - wxHtmlTag *GetFirstSibling() const; - wxHtmlTag *GetLastSibling() const; - wxHtmlTag *GetChildren() const { return m_FirstChild; } - wxHtmlTag *GetPreviousSibling() const { return m_Prev; } - wxHtmlTag *GetNextSibling() const {return m_Next; } - // Return next tag, as if tree had been flattened - wxHtmlTag *GetNextTag() const; - - // Returns tag's name in uppercase. - inline wxString GetName() const {return m_Name;} - - // Returns true if the tag has given parameter. Parameter - // should always be in uppercase. - // Example : HasParam("SRC") returns true - bool HasParam(const wxString& par) const; - - // Returns value of the param. Value is in uppercase unless it is - // enclosed with " - // Example :

GetParam("ALIGN") returns (RIGHT) - //

GetParam("SRC") returns (WhaT.jpg) - // (or ("WhaT.jpg") if with_commas == true) - wxString GetParam(const wxString& par, bool with_commas = false) const; - - // Convenience functions: - bool GetParamAsColour(const wxString& par, wxColour *clr) const; - bool GetParamAsInt(const wxString& par, int *clr) const; - - // Scans param like scanf() functions family does. - // Example : ScanParam("COLOR", "\"#%X\"", &clr); - // This is always with with_commas=false - // Returns number of scanned values - // (like sscanf() does) - // NOTE: unlike scanf family, this function only accepts - // *one* parameter ! - int ScanParam(const wxString& par, const wxChar *format, void *param) const; - - // Returns string containing all params. - wxString GetAllParams() const; - - // return true if this there is matching ending tag - inline bool HasEnding() const {return m_End1 >= 0;} - - // returns beginning position of _internal_ block of text - // See explanation (returned value is marked with *): - // bla bla bla * bla bla intenal text bla bla - inline int GetBeginPos() const {return m_Begin;} - // returns ending position of _internal_ block of text. - // bla bla bla bla bla intenal text* bla bla - inline int GetEndPos1() const {return m_End1;} - // returns end position 2 : - // bla bla bla bla bla internal text* bla bla - inline int GetEndPos2() const {return m_End2;} - -private: - wxString m_Name; - int m_Begin, m_End1, m_End2; - wxArrayString m_ParamNames, m_ParamValues; - - // DOM tree relations: - wxHtmlTag *m_Next; - wxHtmlTag *m_Prev; - wxHtmlTag *m_FirstChild, *m_LastChild; - wxHtmlTag *m_Parent; - - DECLARE_NO_COPY_CLASS(wxHtmlTag) -}; - - - - - -#endif - -#endif // _WX_HTMLTAG_H_ - diff --git a/wxWidgets/include/wx/html/htmlwin.h b/wxWidgets/include/wx/html/htmlwin.h deleted file mode 100644 index 847fe72370..0000000000 --- a/wxWidgets/include/wx/html/htmlwin.h +++ /dev/null @@ -1,651 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: htmlwin.h -// Purpose: wxHtmlWindow class for parsing & displaying HTML -// Author: Vaclav Slavik -// RCS-ID: $Id: htmlwin.h 53135 2008-04-12 02:31:04Z VZ $ -// Copyright: (c) 1999 Vaclav Slavik -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_HTMLWIN_H_ -#define _WX_HTMLWIN_H_ - -#include "wx/defs.h" -#if wxUSE_HTML - -#include "wx/window.h" -#include "wx/scrolwin.h" -#include "wx/config.h" -#include "wx/stopwatch.h" -#include "wx/html/winpars.h" -#include "wx/html/htmlcell.h" -#include "wx/filesys.h" -#include "wx/html/htmlfilt.h" -#include "wx/filename.h" -#include "wx/bitmap.h" - -class wxHtmlProcessor; -class wxHtmlWinModule; -class wxHtmlHistoryArray; -class wxHtmlProcessorList; -class WXDLLIMPEXP_FWD_HTML wxHtmlWinAutoScrollTimer; -class WXDLLIMPEXP_FWD_HTML wxHtmlCellEvent; -class WXDLLIMPEXP_FWD_HTML wxHtmlLinkEvent; - - -// wxHtmlWindow flags: -#define wxHW_SCROLLBAR_NEVER 0x0002 -#define wxHW_SCROLLBAR_AUTO 0x0004 -#define wxHW_NO_SELECTION 0x0008 - -#define wxHW_DEFAULT_STYLE wxHW_SCROLLBAR_AUTO - -/// Enum for wxHtmlWindow::OnOpeningURL and wxHtmlWindowInterface::OnOpeningURL -enum wxHtmlOpeningStatus -{ - /// Open the requested URL - wxHTML_OPEN, - /// Do not open the URL - wxHTML_BLOCK, - /// Redirect to another URL (returned from OnOpeningURL) - wxHTML_REDIRECT -}; - -/** - Abstract interface to a HTML rendering window (such as wxHtmlWindow or - wxHtmlListBox) that is passed to wxHtmlWinParser. It encapsulates all - communication from the parser to the window. - */ -class WXDLLIMPEXP_HTML wxHtmlWindowInterface -{ -public: - /// Ctor - wxHtmlWindowInterface() {} - virtual ~wxHtmlWindowInterface() {} - - /** - Called by the parser to set window's title to given text. - */ - virtual void SetHTMLWindowTitle(const wxString& title) = 0; - - /** - Called when a link is clicked. - - @param link information about the clicked link - */ - virtual void OnHTMLLinkClicked(const wxHtmlLinkInfo& link) = 0; - - /** - Called when the parser needs to open another URL (e.g. an image). - - @param type Type of the URL request (e.g. image) - @param url URL the parser wants to open - @param redirect If the return value is wxHTML_REDIRECT, then the - URL to redirect to will be stored in this variable - (the pointer must never be NULL) - - @return indicator of how to treat the request - */ - virtual wxHtmlOpeningStatus OnHTMLOpeningURL(wxHtmlURLType type, - const wxString& url, - wxString *redirect) const = 0; - - /** - Converts coordinates @a pos relative to given @a cell to - physical coordinates in the window. - */ - virtual wxPoint HTMLCoordsToWindow(wxHtmlCell *cell, - const wxPoint& pos) const = 0; - - /// Returns the window used for rendering (may be NULL). - virtual wxWindow* GetHTMLWindow() = 0; - - /// Returns background colour to use by default. - virtual wxColour GetHTMLBackgroundColour() const = 0; - - /// Sets window's background to colour @a clr. - virtual void SetHTMLBackgroundColour(const wxColour& clr) = 0; - - /// Sets window's background to given bitmap. - virtual void SetHTMLBackgroundImage(const wxBitmap& bmpBg) = 0; - - /// Sets status bar text. - virtual void SetHTMLStatusText(const wxString& text) = 0; - - /// Type of mouse cursor - enum HTMLCursor - { - /// Standard mouse cursor (typically an arrow) - HTMLCursor_Default, - /// Cursor shown over links - HTMLCursor_Link, - /// Cursor shown over selectable text - HTMLCursor_Text - }; - - /** - Returns mouse cursor of given @a type. - */ - virtual wxCursor GetHTMLCursor(HTMLCursor type) const = 0; -}; - -/** - Helper class that implements part of mouse handling for wxHtmlWindow and - wxHtmlListBox. Cursor changes and clicking on links are handled, text - selection is not. - */ -class WXDLLIMPEXP_HTML wxHtmlWindowMouseHelper -{ -protected: - /** - Ctor. - - @param iface Interface to the owner window. - */ - wxHtmlWindowMouseHelper(wxHtmlWindowInterface *iface); - - /** - Virtual dtor. - - It is not really needed in this case but at leats it prevents gcc from - complaining about its absence. - */ - virtual ~wxHtmlWindowMouseHelper() { } - - /// Returns true if the mouse moved since the last call to HandleIdle - bool DidMouseMove() const { return m_tmpMouseMoved; } - - /// Call this from EVT_MOTION event handler - void HandleMouseMoved(); - - /** - Call this from EVT_LEFT_UP handler (or, alternatively, EVT_LEFT_DOWN). - - @param rootCell HTML cell inside which the click occured. This doesn't - have to be the leaf cell, it can be e.g. toplevel - container, but the mouse must be inside the container's - area, otherwise the event would be ignored. - @param pos Mouse position in coordinates relative to @a cell - @param event The event that triggered the call - */ - bool HandleMouseClick(wxHtmlCell *rootCell, - const wxPoint& pos, const wxMouseEvent& event); - - /** - Call this from OnInternalIdle of the HTML displaying window. Handles - mouse movements and must be used together with HandleMouseMoved. - - @param rootCell HTML cell inside which the click occured. This doesn't - have to be the leaf cell, it can be e.g. toplevel - container, but the mouse must be inside the container's - area, otherwise the event would be ignored. - @param pos Current mouse position in coordinates relative to - @a cell - */ - void HandleIdle(wxHtmlCell *rootCell, const wxPoint& pos); - - /** - Called by HandleIdle when the mouse hovers over a cell. Default - behaviour is to do nothing. - - @param cell the cell the mouse is over - @param x, y coordinates of mouse relative to the cell - */ - virtual void OnCellMouseHover(wxHtmlCell *cell, wxCoord x, wxCoord y); - - /** - Called by HandleMouseClick when the user clicks on a cell. - Default behavior is to call wxHtmlWindowInterface::OnLinkClicked() - if this cell corresponds to a hypertext link. - - @param cell the cell the mouse is over - @param x, y coordinates of mouse relative to the cell - @param event The event that triggered the call - - - @return true if a link was clicked, false otherwise. - */ - virtual bool OnCellClicked(wxHtmlCell *cell, - wxCoord x, wxCoord y, - const wxMouseEvent& event); - -protected: - // this flag indicates if the mouse moved (used by HandleIdle) - bool m_tmpMouseMoved; - // contains last link name - wxHtmlLinkInfo *m_tmpLastLink; - // contains the last (terminal) cell which contained the mouse - wxHtmlCell *m_tmpLastCell; - -private: - wxHtmlWindowInterface *m_interface; -}; - -// ---------------------------------------------------------------------------- -// wxHtmlWindow -// (This is probably the only class you will directly use.) -// Purpose of this class is to display HTML page (either local -// file or downloaded via HTTP protocol) in a window. Width of -// window is constant - given in constructor - virtual height -// is changed dynamicly depending on page size. Once the -// window is created you can set it's content by calling -// SetPage(text) or LoadPage(filename). -// ---------------------------------------------------------------------------- - -class WXDLLIMPEXP_HTML wxHtmlWindow : public wxScrolledWindow, - public wxHtmlWindowInterface, - public wxHtmlWindowMouseHelper -{ - DECLARE_DYNAMIC_CLASS(wxHtmlWindow) - friend class wxHtmlWinModule; - -public: - wxHtmlWindow() : wxHtmlWindowMouseHelper(this) { Init(); } - wxHtmlWindow(wxWindow *parent, wxWindowID id = wxID_ANY, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = wxHW_DEFAULT_STYLE, - const wxString& name = wxT("htmlWindow")) - : wxHtmlWindowMouseHelper(this) - { - Init(); - Create(parent, id, pos, size, style, name); - } - virtual ~wxHtmlWindow(); - - bool Create(wxWindow *parent, wxWindowID id = wxID_ANY, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = wxHW_SCROLLBAR_AUTO, - const wxString& name = wxT("htmlWindow")); - - // Set HTML page and display it. !! source is HTML document itself, - // it is NOT address/filename of HTML document. If you want to - // specify document location, use LoadPage() istead - // Return value : false if an error occurred, true otherwise - virtual bool SetPage(const wxString& source); - - // Append to current page - bool AppendToPage(const wxString& source); - - // Load HTML page from given location. Location can be either - // a) /usr/wxGTK2/docs/html/wx.htm - // b) http://www.somewhere.uk/document.htm - // c) ftp://ftp.somesite.cz/pub/something.htm - // In case there is no prefix (http:,ftp:), the method - // will try to find it itself (1. local file, then http or ftp) - // After the page is loaded, the method calls SetPage() to display it. - // Note : you can also use path relative to previously loaded page - // Return value : same as SetPage - virtual bool LoadPage(const wxString& location); - - // Loads HTML page from file - bool LoadFile(const wxFileName& filename); - - // Returns full location of opened page - wxString GetOpenedPage() const {return m_OpenedPage;} - // Returns anchor within opened page - wxString GetOpenedAnchor() const {return m_OpenedAnchor;} - // Returns of opened page or empty string otherwise - wxString GetOpenedPageTitle() const {return m_OpenedPageTitle;} - - // Sets frame in which page title will be displayed. Format is format of - // frame title, e.g. "HtmlHelp : %s". It must contain exactly one %s - void SetRelatedFrame(wxFrame* frame, const wxString& format); - wxFrame* GetRelatedFrame() const {return m_RelatedFrame;} - -#if wxUSE_STATUSBAR - // After(!) calling SetRelatedFrame, this sets statusbar slot where messages - // will be displayed. Default is -1 = no messages. - void SetRelatedStatusBar(int bar); -#endif // wxUSE_STATUSBAR - - // Sets fonts to be used when displaying HTML page. - void SetFonts(const wxString& normal_face, const wxString& fixed_face, - const int *sizes = NULL); - - // Sets font sizes to be relative to the given size or the system - // default size; use either specified or default font - void SetStandardFonts(int size = -1, - const wxString& normal_face = wxEmptyString, - const wxString& fixed_face = wxEmptyString); - - // Sets space between text and window borders. - void SetBorders(int b) {m_Borders = b;} - - // Sets the bitmap to use for background (currnetly it will be tiled, - // when/if we have CSS support we could add other possibilities...) - void SetBackgroundImage(const wxBitmap& bmpBg) { m_bmpBg = bmpBg; } - - // Saves custom settings into cfg config. it will use the path 'path' - // if given, otherwise it will save info into currently selected path. - // saved values : things set by SetFonts, SetBorders. - virtual void ReadCustomization(wxConfigBase *cfg, wxString path = wxEmptyString); - // ... - virtual void WriteCustomization(wxConfigBase *cfg, wxString path = wxEmptyString); - - // Goes to previous/next page (in browsing history) - // Returns true if successful, false otherwise - bool HistoryBack(); - bool HistoryForward(); - bool HistoryCanBack(); - bool HistoryCanForward(); - // Resets history - void HistoryClear(); - - // Returns pointer to conteiners/cells structure. - // It should be used ONLY when printing - wxHtmlContainerCell* GetInternalRepresentation() const {return m_Cell;} - - // Adds input filter - static void AddFilter(wxHtmlFilter *filter); - - // Returns a pointer to the parser. - wxHtmlWinParser *GetParser() const { return m_Parser; } - - // Adds HTML processor to this instance of wxHtmlWindow: - void AddProcessor(wxHtmlProcessor *processor); - // Adds HTML processor to wxHtmlWindow class as whole: - static void AddGlobalProcessor(wxHtmlProcessor *processor); - - - // -- Callbacks -- - - // Sets the title of the window - // (depending on the information passed to SetRelatedFrame() method) - virtual void OnSetTitle(const wxString& title); - - // Called when user clicked on hypertext link. Default behavior is to - // call LoadPage(loc) - virtual void OnLinkClicked(const wxHtmlLinkInfo& link); - - // Called when wxHtmlWindow wants to fetch data from an URL (e.g. when - // loading a page or loading an image). The data are downloaded if and only if - // OnOpeningURL returns true. If OnOpeningURL returns wxHTML_REDIRECT, - // it must set *redirect to the new URL - virtual wxHtmlOpeningStatus OnOpeningURL(wxHtmlURLType WXUNUSED(type), - const wxString& WXUNUSED(url), - wxString *WXUNUSED(redirect)) const - { return wxHTML_OPEN; } - -#if wxUSE_CLIPBOARD - // Helper functions to select parts of page: - void SelectWord(const wxPoint& pos); - void SelectLine(const wxPoint& pos); - void SelectAll(); - - // Convert selection to text: - wxString SelectionToText() { return DoSelectionToText(m_selection); } - - // Converts current page to text: - wxString ToText(); -#endif // wxUSE_CLIPBOARD - - virtual void OnInternalIdle(); - - /// Returns standard HTML cursor as used by wxHtmlWindow - static wxCursor GetDefaultHTMLCursor(HTMLCursor type); - -protected: - void Init(); - - // Scrolls to anchor of this name. (Anchor is #news - // or #features etc. it is part of address sometimes: - // http://www.ms.mff.cuni.cz/~vsla8348/wxhtml/index.html#news) - // Return value : true if anchor exists, false otherwise - bool ScrollToAnchor(const wxString& anchor); - - // Prepares layout (= fill m_PosX, m_PosY for fragments) based on - // actual size of window. This method also setup scrollbars - void CreateLayout(); - - void OnEraseBackground(wxEraseEvent& event); - void OnPaint(wxPaintEvent& event); - void OnSize(wxSizeEvent& event); - void OnMouseMove(wxMouseEvent& event); - void OnMouseDown(wxMouseEvent& event); - void OnMouseUp(wxMouseEvent& event); -#if wxUSE_CLIPBOARD - void OnKeyUp(wxKeyEvent& event); - void OnDoubleClick(wxMouseEvent& event); - void OnCopy(wxCommandEvent& event); - void OnClipboardEvent(wxClipboardTextEvent& event); - void OnMouseEnter(wxMouseEvent& event); - void OnMouseLeave(wxMouseEvent& event); - void OnMouseCaptureLost(wxMouseCaptureLostEvent& event); -#endif // wxUSE_CLIPBOARD - - // Returns new filter (will be stored into m_DefaultFilter variable) - virtual wxHtmlFilter *GetDefaultFilter() {return new wxHtmlFilterPlainText;} - - // cleans static variables - static void CleanUpStatics(); - - // Returns true if text selection is enabled (wxClipboard must be available - // and wxHW_NO_SELECTION not used) - bool IsSelectionEnabled() const; - - enum ClipboardType - { - Primary, - Secondary - }; - - // Copies selection to clipboard if the clipboard support is available - // - // returns true if anything was copied to clipboard, false otherwise - bool CopySelection(ClipboardType t = Secondary); - -#if wxUSE_CLIPBOARD - // Automatic scrolling during selection: - void StopAutoScrolling(); -#endif // wxUSE_CLIPBOARD - - wxString DoSelectionToText(wxHtmlSelection *sel); - -public: - // wxHtmlWindowInterface methods: - virtual void SetHTMLWindowTitle(const wxString& title); - virtual void OnHTMLLinkClicked(const wxHtmlLinkInfo& link); - virtual wxHtmlOpeningStatus OnHTMLOpeningURL(wxHtmlURLType type, - const wxString& url, - wxString *redirect) const; - virtual wxPoint HTMLCoordsToWindow(wxHtmlCell *cell, - const wxPoint& pos) const; - virtual wxWindow* GetHTMLWindow(); - virtual wxColour GetHTMLBackgroundColour() const; - virtual void SetHTMLBackgroundColour(const wxColour& clr); - virtual void SetHTMLBackgroundImage(const wxBitmap& bmpBg); - virtual void SetHTMLStatusText(const wxString& text); - virtual wxCursor GetHTMLCursor(HTMLCursor type) const; - - // implementation of SetPage() - bool DoSetPage(const wxString& source); - -protected: - // This is pointer to the first cell in parsed data. (Note: the first cell - // is usually top one = all other cells are sub-cells of this one) - wxHtmlContainerCell *m_Cell; - // parser which is used to parse HTML input. - // Each wxHtmlWindow has it's own parser because sharing one global - // parser would be problematic (because of reentrancy) - wxHtmlWinParser *m_Parser; - // contains name of actualy opened page or empty string if no page opened - wxString m_OpenedPage; - // contains name of current anchor within m_OpenedPage - wxString m_OpenedAnchor; - // contains title of actualy opened page or empty string if no <TITLE> tag - wxString m_OpenedPageTitle; - // class for opening files (file system) - wxFileSystem* m_FS; - - wxFrame *m_RelatedFrame; - wxString m_TitleFormat; -#if wxUSE_STATUSBAR - // frame in which page title should be displayed & number of it's statusbar - // reserved for usage with this html window - int m_RelatedStatusBar; -#endif // wxUSE_STATUSBAR - - // borders (free space between text and window borders) - // defaults to 10 pixels. - int m_Borders; - - // current text selection or NULL - wxHtmlSelection *m_selection; - - // true if the user is dragging mouse to select text - bool m_makingSelection; - -#if wxUSE_CLIPBOARD - // time of the last doubleclick event, used to detect tripleclicks - // (tripleclicks are used to select whole line): - wxMilliClock_t m_lastDoubleClick; - - // helper class to automatically scroll the window if the user is selecting - // text and the mouse leaves wxHtmlWindow: - wxHtmlWinAutoScrollTimer *m_timerAutoScroll; -#endif // wxUSE_CLIPBOARD - -private: - // window content for double buffered rendering: - wxBitmap *m_backBuffer; - - // background image, may be invalid - wxBitmap m_bmpBg; - - // variables used when user is selecting text - wxPoint m_tmpSelFromPos; - wxHtmlCell *m_tmpSelFromCell; - - // if >0 contents of the window is not redrawn - // (in order to avoid ugly blinking) - int m_tmpCanDrawLocks; - - // list of HTML filters - static wxList m_Filters; - // this filter is used when no filter is able to read some file - static wxHtmlFilter *m_DefaultFilter; - - // html processors array: - wxHtmlProcessorList *m_Processors; - static wxHtmlProcessorList *m_GlobalProcessors; - - // browser history - wxHtmlHistoryArray *m_History; - int m_HistoryPos; - // if this FLAG is false, items are not added to history - bool m_HistoryOn; - - // a flag set if we need to erase background in OnPaint() (otherwise this - // is supposed to have been done in OnEraseBackground()) - bool m_eraseBgInOnPaint; - - // standard mouse cursors - static wxCursor *ms_cursorLink; - static wxCursor *ms_cursorText; - - DECLARE_EVENT_TABLE() - DECLARE_NO_COPY_CLASS(wxHtmlWindow) -}; - - - - -BEGIN_DECLARE_EVENT_TYPES() - DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_HTML, - wxEVT_COMMAND_HTML_CELL_CLICKED, 1000) - DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_HTML, - wxEVT_COMMAND_HTML_CELL_HOVER, 1001) - DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_HTML, - wxEVT_COMMAND_HTML_LINK_CLICKED, 1002) -END_DECLARE_EVENT_TYPES() - - -/*! - * Html cell window event - */ - -class WXDLLIMPEXP_HTML wxHtmlCellEvent : public wxCommandEvent -{ -public: - wxHtmlCellEvent() {} - wxHtmlCellEvent(wxEventType commandType, int id, - wxHtmlCell *cell, const wxPoint &pt, - const wxMouseEvent &ev) - : wxCommandEvent(commandType, id) - { - m_cell = cell; - m_pt = pt; - m_mouseEvent = ev; - m_bLinkWasClicked = false; - } - - wxHtmlCell* GetCell() const { return m_cell; } - wxPoint GetPoint() const { return m_pt; } - wxMouseEvent GetMouseEvent() const { return m_mouseEvent; } - - void SetLinkClicked(bool linkclicked) { m_bLinkWasClicked=linkclicked; } - bool GetLinkClicked() const { return m_bLinkWasClicked; } - - // default copy ctor, assignment operator and dtor are ok - virtual wxEvent *Clone() const { return new wxHtmlCellEvent(*this); } - -private: - wxHtmlCell *m_cell; - wxMouseEvent m_mouseEvent; - wxPoint m_pt; - - bool m_bLinkWasClicked; - - DECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxHtmlCellEvent) -}; - - - -/*! - * Html link event - */ - -class WXDLLIMPEXP_HTML wxHtmlLinkEvent : public wxCommandEvent -{ -public: - wxHtmlLinkEvent() {} - wxHtmlLinkEvent(int id, const wxHtmlLinkInfo &linkinfo) - : wxCommandEvent(wxEVT_COMMAND_HTML_LINK_CLICKED, id) - { - m_linkInfo = linkinfo; - } - - const wxHtmlLinkInfo &GetLinkInfo() const { return m_linkInfo; } - - // default copy ctor, assignment operator and dtor are ok - virtual wxEvent *Clone() const { return new wxHtmlLinkEvent(*this); } - -private: - wxHtmlLinkInfo m_linkInfo; - - DECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxHtmlLinkEvent) -}; - - -typedef void (wxEvtHandler::*wxHtmlCellEventFunction)(wxHtmlCellEvent&); -typedef void (wxEvtHandler::*wxHtmlLinkEventFunction)(wxHtmlLinkEvent&); - -#define wxHtmlCellEventHandler(func) \ - (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxHtmlCellEventFunction, &func) -#define wxHtmlLinkEventHandler(func) \ - (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxHtmlLinkEventFunction, &func) - -#define EVT_HTML_CELL_CLICKED(id, fn) \ - wx__DECLARE_EVT1(wxEVT_COMMAND_HTML_CELL_CLICKED, id, wxHtmlCellEventHandler(fn)) -#define EVT_HTML_CELL_HOVER(id, fn) \ - wx__DECLARE_EVT1(wxEVT_COMMAND_HTML_CELL_HOVER, id, wxHtmlCellEventHandler(fn)) -#define EVT_HTML_LINK_CLICKED(id, fn) \ - wx__DECLARE_EVT1(wxEVT_COMMAND_HTML_LINK_CLICKED, id, wxHtmlLinkEventHandler(fn)) - - -#endif // wxUSE_HTML - -#endif // _WX_HTMLWIN_H_ - diff --git a/wxWidgets/include/wx/html/htmprint.h b/wxWidgets/include/wx/html/htmprint.h deleted file mode 100644 index 485d38af7a..0000000000 --- a/wxWidgets/include/wx/html/htmprint.h +++ /dev/null @@ -1,305 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: htmprint.h -// Purpose: html printing classes -// Author: Vaclav Slavik -// Created: 25/09/99 -// RCS-ID: $Id: htmprint.h 62758 2009-12-01 20:21:46Z BP $ -// Copyright: (c) Vaclav Slavik -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_HTMPRINT_H_ -#define _WX_HTMPRINT_H_ - -#include "wx/defs.h" - -#if wxUSE_HTML & wxUSE_PRINTING_ARCHITECTURE - -#include "wx/html/htmlcell.h" -#include "wx/html/winpars.h" -#include "wx/html/htmlfilt.h" - -#include "wx/print.h" -#include "wx/printdlg.h" - -#include <limits.h> // INT_MAX - -//-------------------------------------------------------------------------------- -// wxHtmlDCRenderer -// This class is capable of rendering HTML into specified -// portion of DC -//-------------------------------------------------------------------------------- - -class WXDLLIMPEXP_HTML wxHtmlDCRenderer : public wxObject -{ -public: - wxHtmlDCRenderer(); - virtual ~wxHtmlDCRenderer(); - - // Following 3 methods *must* be called before any call to Render: - - // Assign DC to this render - void SetDC(wxDC *dc, double pixel_scale = 1.0); - - // Sets size of output rectangle, in pixels. Note that you *can't* change - // width of the rectangle between calls to Render! (You can freely change height.) - void SetSize(int width, int height); - - // Sets the text to be displayed. - // Basepath is base directory (html string would be stored there if it was in - // file). It is used to determine path for loading images, for example. - // isdir is false if basepath is filename, true if it is directory name - // (see wxFileSystem for detailed explanation) - void SetHtmlText(const wxString& html, const wxString& basepath = wxEmptyString, bool isdir = true); - - // Sets fonts to be used when displaying HTML page. (if size null then default sizes used). - void SetFonts(const wxString& normal_face, const wxString& fixed_face, const int *sizes = NULL); - - // Sets font sizes to be relative to the given size or the system - // default size; use either specified or default font - void SetStandardFonts(int size = -1, - const wxString& normal_face = wxEmptyString, - const wxString& fixed_face = wxEmptyString); - - // [x,y] is position of upper-left corner of printing rectangle (see SetSize) - // from is y-coordinate of the very first visible cell - // to is y-coordinate of the next following page break, if any - // Returned value is y coordinate of first cell than didn't fit onto page. - // Use this value as 'from' in next call to Render in order to print multiple pages - // document - // If dont_render is TRUE then nothing is rendered into DC and it only counts - // pixels and return y coord of the next page - // - // known_pagebreaks and number_of_pages are used only when counting pages; - // otherwise, their default values should be used. Their purpose is to - // support pagebreaks using a subset of CSS2's <DIV>. The <DIV> handler - // needs to know what pagebreaks have already been set so that it doesn't - // set the same pagebreak twice. - // - // CAUTION! Render() changes DC's user scale and does NOT restore it! - int Render(int x, int y, wxArrayInt& known_pagebreaks, int from = 0, - int dont_render = FALSE, int to = INT_MAX); - - // returns total height of the html document - // (compare Render's return value with this) - int GetTotalHeight(); - -private: - wxDC *m_DC; - wxHtmlWinParser *m_Parser; - wxFileSystem *m_FS; - wxHtmlContainerCell *m_Cells; - int m_MaxWidth, m_Width, m_Height; - - DECLARE_NO_COPY_CLASS(wxHtmlDCRenderer) -}; - - - - - -enum { - wxPAGE_ODD, - wxPAGE_EVEN, - wxPAGE_ALL -}; - - - -//-------------------------------------------------------------------------------- -// wxHtmlPrintout -// This class is derived from standard wxWidgets printout class -// and is used to print HTML documents. -//-------------------------------------------------------------------------------- - - -class WXDLLIMPEXP_HTML wxHtmlPrintout : public wxPrintout -{ -public: - wxHtmlPrintout(const wxString& title = wxT("Printout")); - virtual ~wxHtmlPrintout(); - - void SetHtmlText(const wxString& html, const wxString &basepath = wxEmptyString, bool isdir = true); - // prepares the class for printing this html document. - // Must be called before using the class, in fact just after constructor - // - // basepath is base directory (html string would be stored there if it was in - // file). It is used to determine path for loading images, for example. - // isdir is false if basepath is filename, true if it is directory name - // (see wxFileSystem for detailed explanation) - - void SetHtmlFile(const wxString &htmlfile); - // same as SetHtmlText except that it takes regular file as the parameter - - void SetHeader(const wxString& header, int pg = wxPAGE_ALL); - void SetFooter(const wxString& footer, int pg = wxPAGE_ALL); - // sets header/footer for the document. The argument is interpreted as HTML document. - // You can use macros in it: - // @PAGENUM@ is replaced by page number - // @PAGESCNT@ is replaced by total number of pages - // - // pg is one of wxPAGE_ODD, wxPAGE_EVEN and wx_PAGE_ALL constants. - // You can set different header/footer for odd and even pages - - // Sets fonts to be used when displaying HTML page. (if size null then default sizes used). - void SetFonts(const wxString& normal_face, const wxString& fixed_face, const int *sizes = NULL); - - // Sets font sizes to be relative to the given size or the system - // default size; use either specified or default font - void SetStandardFonts(int size = -1, - const wxString& normal_face = wxEmptyString, - const wxString& fixed_face = wxEmptyString); - - void SetMargins(float top = 25.2, float bottom = 25.2, float left = 25.2, float right = 25.2, - float spaces = 5); - // sets margins in milimeters. Defaults to 1 inch for margins and 0.5cm for space - // between text and header and/or footer - - // wxPrintout stuff: - bool OnPrintPage(int page); - bool HasPage(int page); - void GetPageInfo(int *minPage, int *maxPage, int *selPageFrom, int *selPageTo); - bool OnBeginDocument(int startPage, int endPage); - void OnPreparePrinting(); - - // Adds input filter - static void AddFilter(wxHtmlFilter *filter); - - // Cleanup - static void CleanUpStatics(); - -private: - - void RenderPage(wxDC *dc, int page); - // renders one page into dc - wxString TranslateHeader(const wxString& instr, int page); - // substitute @PAGENUM@ and @PAGESCNT@ by real values - void CountPages(); - // counts pages and fills m_NumPages and m_PageBreaks - - -private: - int m_NumPages; - //int m_PageBreaks[wxHTML_PRINT_MAX_PAGES]; - wxArrayInt m_PageBreaks; - - wxString m_Document, m_BasePath; - bool m_BasePathIsDir; - wxString m_Headers[2], m_Footers[2]; - - int m_HeaderHeight, m_FooterHeight; - wxHtmlDCRenderer *m_Renderer, *m_RendererHdr; - float m_MarginTop, m_MarginBottom, m_MarginLeft, m_MarginRight, m_MarginSpace; - - // list of HTML filters - static wxList m_Filters; - - DECLARE_NO_COPY_CLASS(wxHtmlPrintout) -}; - - - - - -//-------------------------------------------------------------------------------- -// wxHtmlEasyPrinting -// This class provides very simple interface to printing -// architecture. It allows you to print HTML documents only -// with very few commands. -// -// Note : do not create this class on stack only. -// You should create an instance on app startup and -// use this instance for all printing. Why? The class -// stores page&printer settings in it. -//-------------------------------------------------------------------------------- - -class WXDLLIMPEXP_HTML wxHtmlEasyPrinting : public wxObject -{ -public: - wxHtmlEasyPrinting(const wxString& name = wxT("Printing"), wxWindow *parentWindow = NULL); - virtual ~wxHtmlEasyPrinting(); - - bool PreviewFile(const wxString &htmlfile); - bool PreviewText(const wxString &htmltext, const wxString& basepath = wxEmptyString); - // Preview file / html-text for printing - // (and offers printing) - // basepath is base directory for opening subsequent files (e.g. from <img> tag) - - bool PrintFile(const wxString &htmlfile); - bool PrintText(const wxString &htmltext, const wxString& basepath = wxEmptyString); - // Print file / html-text w/o preview - - void PageSetup(); - // pop up printer or page setup dialog - - void SetHeader(const wxString& header, int pg = wxPAGE_ALL); - void SetFooter(const wxString& footer, int pg = wxPAGE_ALL); - // sets header/footer for the document. The argument is interpreted as HTML document. - // You can use macros in it: - // @PAGENUM@ is replaced by page number - // @PAGESCNT@ is replaced by total number of pages - // - // pg is one of wxPAGE_ODD, wxPAGE_EVEN and wx_PAGE_ALL constants. - // You can set different header/footer for odd and even pages - - void SetFonts(const wxString& normal_face, const wxString& fixed_face, const int *sizes = 0); - // Sets fonts to be used when displaying HTML page. (if size null then default sizes used) - - // Sets font sizes to be relative to the given size or the system - // default size; use either specified or default font - void SetStandardFonts(int size = -1, - const wxString& normal_face = wxEmptyString, - const wxString& fixed_face = wxEmptyString); - - wxPrintData *GetPrintData(); - wxPageSetupDialogData *GetPageSetupData() {return m_PageSetupData;} - // return page setting data objects. - // (You can set their parameters.) - -#if wxABI_VERSION >= 20805 - wxWindow* GetParentWindow() const { return m_ParentWindow; } - // get the parent window - void SetParentWindow(wxWindow* window) { m_ParentWindow = window; } - // set the parent window -#endif - -#if wxABI_VERSION >= 20811 - const wxString& GetName() const { return m_Name; } - // get the printout name - void SetName(const wxString& name) { m_Name = name; } - // set the printout name -#endif - -protected: - virtual wxHtmlPrintout *CreatePrintout(); - virtual bool DoPreview(wxHtmlPrintout *printout1, wxHtmlPrintout *printout2); - virtual bool DoPrint(wxHtmlPrintout *printout); - -private: - wxPrintData *m_PrintData; - wxPageSetupDialogData *m_PageSetupData; - wxString m_Name; - int m_FontsSizesArr[7]; - int *m_FontsSizes; - wxString m_FontFaceFixed, m_FontFaceNormal; - - enum FontMode - { - FontMode_Explicit, - FontMode_Standard - }; - FontMode m_fontMode; - - wxString m_Headers[2], m_Footers[2]; - wxWindow *m_ParentWindow; - - DECLARE_NO_COPY_CLASS(wxHtmlEasyPrinting) -}; - - - - -#endif // wxUSE_HTML & wxUSE_PRINTING_ARCHITECTURE - -#endif // _WX_HTMPRINT_H_ - diff --git a/wxWidgets/include/wx/html/m_templ.h b/wxWidgets/include/wx/html/m_templ.h deleted file mode 100644 index d75346c65c..0000000000 --- a/wxWidgets/include/wx/html/m_templ.h +++ /dev/null @@ -1,84 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: m_templ.h -// Purpose: Modules template file -// Author: Vaclav Slavik -// RCS-ID: $Id: m_templ.h 30098 2004-10-26 10:32:38Z VS $ -// Copyright: (c) Vaclav Slavik -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -/* - -DESCRIPTION: -This is set of macros for easier writing of tag handlers. How to use it? -See mod_fonts.cpp for example... - -Attention! This is quite strange C++ bastard. Before using it, -I STRONGLY recommend reading and understanding these macros!! - -*/ - - -#ifndef _WX_M_TEMPL_H_ -#define _WX_M_TEMPL_H_ - -#include "wx/defs.h" - -#if wxUSE_HTML - -#include "wx/html/winpars.h" - -#define TAG_HANDLER_BEGIN(name,tags) \ - class wxHTML_Handler_##name : public wxHtmlWinTagHandler \ - { \ - public: \ - wxString GetSupportedTags() {return wxT(tags);} - - - -#define TAG_HANDLER_VARS \ - private: - -#define TAG_HANDLER_CONSTR(name) \ - public: \ - wxHTML_Handler_##name () : wxHtmlWinTagHandler() - - -#define TAG_HANDLER_PROC(varib) \ - public: \ - bool HandleTag(const wxHtmlTag& varib) - - - -#define TAG_HANDLER_END(name) \ - }; - - - - -#define TAGS_MODULE_BEGIN(name) \ - class wxHTML_Module##name : public wxHtmlTagsModule \ - { \ - DECLARE_DYNAMIC_CLASS(wxHTML_Module##name ) \ - public: \ - void FillHandlersTable(wxHtmlWinParser *parser) \ - { - - - - -#define TAGS_MODULE_ADD(handler) \ - parser->AddTagHandler(new wxHTML_Handler_##handler); - - - - -#define TAGS_MODULE_END(name) \ - } \ - }; \ - IMPLEMENT_DYNAMIC_CLASS(wxHTML_Module##name , wxHtmlTagsModule) - - - -#endif -#endif diff --git a/wxWidgets/include/wx/html/webkit.h b/wxWidgets/include/wx/html/webkit.h deleted file mode 100644 index 16bd4fdf0e..0000000000 --- a/wxWidgets/include/wx/html/webkit.h +++ /dev/null @@ -1,231 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/html/webkit.h -// Purpose: wxWebKitCtrl - embeddable web kit control -// Author: Jethro Grassie / Kevin Ollivier -// Modified by: -// Created: 2004-4-16 -// RCS-ID: $Id: webkit.h 53798 2008-05-28 06:12:34Z RD $ -// Copyright: (c) Jethro Grassie / Kevin Ollivier -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_WEBKIT_H -#define _WX_WEBKIT_H - -#if wxUSE_WEBKIT - -#if !defined(__WXMAC__) && !defined(__WXCOCOA__) -#error "wxWebKitCtrl not implemented for this platform" -#endif - -#include "wx/control.h" - -// ---------------------------------------------------------------------------- -// Web Kit Control -// ---------------------------------------------------------------------------- - -class wxWebKitCtrl : public wxControl -{ -public: - DECLARE_DYNAMIC_CLASS(wxWebKitCtrl) - - wxWebKitCtrl() {}; - wxWebKitCtrl(wxWindow *parent, - wxWindowID winID, - const wxString& strURL, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, long style = 0, - const wxValidator& validator = wxDefaultValidator, - const wxString& name = wxT("webkitctrl")) - { - Create(parent, winID, strURL, pos, size, style, validator, name); - }; - bool Create(wxWindow *parent, - wxWindowID winID, - const wxString& strURL, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, long style = 0, - const wxValidator& validator = wxDefaultValidator, - const wxString& name = wxT("webkitctrl")); - virtual ~wxWebKitCtrl(); - - void LoadURL(const wxString &url); - - bool CanGoBack(); - bool CanGoForward(); - bool GoBack(); - bool GoForward(); - void Reload(); - void Stop(); - bool CanGetPageSource(); - wxString GetPageSource(); - void SetPageSource(const wxString& source, const wxString& baseUrl = wxEmptyString); - wxString GetPageURL(){ return m_currentURL; } - void SetPageTitle(const wxString& title) { m_pageTitle = title; } - wxString GetPageTitle(){ return m_pageTitle; } - - // since these worked in 2.6, add wrappers - void SetTitle(const wxString& title) { SetPageTitle(title); } - wxString GetTitle() { return GetPageTitle(); } - - wxString GetSelection(); - - bool CanIncreaseTextSize(); - void IncreaseTextSize(); - bool CanDecreaseTextSize(); - void DecreaseTextSize(); - - void Print(bool showPrompt=FALSE); - - void MakeEditable(bool enable=TRUE); - bool IsEditable(); - - wxString RunScript(const wxString& javascript); - - void SetScrollPos(int pos); - int GetScrollPos(); - - //we need to resize the webview when the control size changes - void OnSize(wxSizeEvent &event); - void OnMove(wxMoveEvent &event); - void OnMouseEvents(wxMouseEvent &event); -protected: - DECLARE_EVENT_TABLE() - void MacVisibilityChanged(); - -private: - wxWindow *m_parent; - wxWindowID m_windowID; - wxString m_currentURL; - wxString m_pageTitle; - - struct objc_object *m_webView; - - // we may use this later to setup our own mouse events, - // so leave it in for now. - void* m_webKitCtrlEventHandler; - //It should be WebView*, but WebView is an Objective-C class - //TODO: look into using DECLARE_WXCOCOA_OBJC_CLASS rather than this. -}; - -// ---------------------------------------------------------------------------- -// Web Kit Events -// ---------------------------------------------------------------------------- - -enum { - wxWEBKIT_STATE_START = 1, - wxWEBKIT_STATE_NEGOTIATING = 2, - wxWEBKIT_STATE_REDIRECTING = 4, - wxWEBKIT_STATE_TRANSFERRING = 8, - wxWEBKIT_STATE_STOP = 16, - wxWEBKIT_STATE_FAILED = 32 -}; - -enum { - wxWEBKIT_NAV_LINK_CLICKED = 1, - wxWEBKIT_NAV_BACK_NEXT = 2, - wxWEBKIT_NAV_FORM_SUBMITTED = 4, - wxWEBKIT_NAV_RELOAD = 8, - wxWEBKIT_NAV_FORM_RESUBMITTED = 16, - wxWEBKIT_NAV_OTHER = 32 - -}; - - - -class wxWebKitBeforeLoadEvent : public wxCommandEvent -{ - DECLARE_DYNAMIC_CLASS( wxWebKitBeforeLoadEvent ) - -public: - bool IsCancelled() { return m_cancelled; } - void Cancel(bool cancel = true) { m_cancelled = cancel; } - wxString GetURL() { return m_url; } - void SetURL(const wxString& url) { m_url = url; } - void SetNavigationType(int navType) { m_navType = navType; } - int GetNavigationType() { return m_navType; } - - wxWebKitBeforeLoadEvent( wxWindow* win = (wxWindow*) NULL ); - wxEvent *Clone(void) const { return new wxWebKitBeforeLoadEvent(*this); } - -protected: - bool m_cancelled; - wxString m_url; - int m_navType; -}; - -class wxWebKitStateChangedEvent : public wxCommandEvent -{ - DECLARE_DYNAMIC_CLASS( wxWebKitStateChangedEvent ) - -public: - int GetState() { return m_state; } - void SetState(const int state) { m_state = state; } - wxString GetURL() { return m_url; } - void SetURL(const wxString& url) { m_url = url; } - - wxWebKitStateChangedEvent( wxWindow* win = (wxWindow*) NULL ); - wxEvent *Clone(void) const { return new wxWebKitStateChangedEvent(*this); } - -protected: - int m_state; - wxString m_url; -}; - - -#if wxABI_VERSION >= 20808 -class wxWebKitNewWindowEvent : public wxCommandEvent -{ - DECLARE_DYNAMIC_CLASS( wxWebViewNewWindowEvent ) -public: - wxString GetURL() const { return m_url; } - void SetURL(const wxString& url) { m_url = url; } - wxString GetTargetName() const { return m_targetName; } - void SetTargetName(const wxString& name) { m_targetName = name; } - - wxWebKitNewWindowEvent( wxWindow* win = (wxWindow*)(NULL)); - wxEvent *Clone(void) const { return new wxWebKitNewWindowEvent(*this); } - -private: - wxString m_url; - wxString m_targetName; -}; -#endif - -typedef void (wxEvtHandler::*wxWebKitStateChangedEventFunction)(wxWebKitStateChangedEvent&); -typedef void (wxEvtHandler::*wxWebKitBeforeLoadEventFunction)(wxWebKitBeforeLoadEvent&); -typedef void (wxEvtHandler::*wxWebKitNewWindowEventFunction)(wxWebKitNewWindowEvent&); - -BEGIN_DECLARE_EVENT_TYPES() - DECLARE_LOCAL_EVENT_TYPE(wxEVT_WEBKIT_BEFORE_LOAD, wxID_ANY) - DECLARE_LOCAL_EVENT_TYPE(wxEVT_WEBKIT_STATE_CHANGED, wxID_ANY) - DECLARE_LOCAL_EVENT_TYPE(wxEVT_WEBKIT_NEW_WINDOW, wxID_ANY) -END_DECLARE_EVENT_TYPES() - -#define EVT_WEBKIT_STATE_CHANGED(func) \ - DECLARE_EVENT_TABLE_ENTRY( wxEVT_WEBKIT_STATE_CHANGED, \ - wxID_ANY, \ - wxID_ANY, \ - (wxObjectEventFunction) \ - (wxWebKitStateChangedEventFunction) & func, \ - (wxObject *) NULL ), - -#define EVT_WEBKIT_BEFORE_LOAD(func) \ - DECLARE_EVENT_TABLE_ENTRY( wxEVT_WEBKIT_BEFORE_LOAD, \ - wxID_ANY, \ - wxID_ANY, \ - (wxObjectEventFunction) \ - (wxWebKitBeforeLoadEventFunction) & func, \ - (wxObject *) NULL ), - -#define EVT_WEBKIT_NEW_WINDOW(func) \ - DECLARE_EVENT_TABLE_ENTRY( wxEVT_WEBKIT_NEW_WINDOW, \ - wxID_ANY, \ - wxID_ANY, \ - (wxObjectEventFunction) \ - (wxWebKitNewWindowEventFunction) & func, \ - (wxObject *) NULL ), -#endif // wxUSE_WEBKIT - -#endif - // _WX_WEBKIT_H_ diff --git a/wxWidgets/include/wx/html/winpars.h b/wxWidgets/include/wx/html/winpars.h deleted file mode 100644 index 00ff54c40e..0000000000 --- a/wxWidgets/include/wx/html/winpars.h +++ /dev/null @@ -1,292 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: winpars.h -// Purpose: wxHtmlWinParser class (parser to be used with wxHtmlWindow) -// Author: Vaclav Slavik -// RCS-ID: $Id: winpars.h 59260 2009-03-02 10:43:00Z VS $ -// Copyright: (c) 1999 Vaclav Slavik -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_WINPARS_H_ -#define _WX_WINPARS_H_ - -#include "wx/defs.h" -#if wxUSE_HTML - -#include "wx/module.h" -#include "wx/font.h" -#include "wx/html/htmlpars.h" -#include "wx/html/htmlcell.h" -#include "wx/encconv.h" - -class WXDLLIMPEXP_FWD_HTML wxHtmlWindow; -class WXDLLIMPEXP_FWD_HTML wxHtmlWindowInterface; -class WXDLLIMPEXP_FWD_HTML wxHtmlWinParser; -class WXDLLIMPEXP_FWD_HTML wxHtmlWinTagHandler; -class WXDLLIMPEXP_FWD_HTML wxHtmlTagsModule; -struct wxHtmlWinParser_TextParsingState; - - -//-------------------------------------------------------------------------------- -// wxHtmlWinParser -// This class is derived from wxHtmlParser and its mail goal -// is to parse HTML input so that it can be displayed in -// wxHtmlWindow. It uses special wxHtmlWinTagHandler. -//-------------------------------------------------------------------------------- - -class WXDLLIMPEXP_HTML wxHtmlWinParser : public wxHtmlParser -{ - DECLARE_ABSTRACT_CLASS(wxHtmlWinParser) - friend class wxHtmlWindow; - -public: - wxHtmlWinParser(wxHtmlWindowInterface *wndIface = NULL); - - virtual ~wxHtmlWinParser(); - - virtual void InitParser(const wxString& source); - virtual void DoneParser(); - virtual wxObject* GetProduct(); - - virtual wxFSFile *OpenURL(wxHtmlURLType type, const wxString& url) const; - - // Set's the DC used for parsing. If SetDC() is not called, - // parsing won't proceed - virtual void SetDC(wxDC *dc, double pixel_scale = 1.0) - { m_DC = dc; m_PixelScale = pixel_scale; } - - wxDC *GetDC() {return m_DC;} - double GetPixelScale() {return m_PixelScale;} - int GetCharHeight() const {return m_CharHeight;} - int GetCharWidth() const {return m_CharWidth;} - - // NOTE : these functions do _not_ return _actual_ - // height/width. They return h/w of default font - // for this DC. If you want actual values, call - // GetDC()->GetChar...() - - // returns interface to the rendering window - wxHtmlWindowInterface *GetWindowInterface() {return m_windowInterface;} -#if WXWIN_COMPATIBILITY_2_6 - // deprecated, use GetWindowInterface()->GetHTMLWindow() instead - wxDEPRECATED( wxHtmlWindow *GetWindow() ); -#endif - - // Sets fonts to be used when displaying HTML page. (if size null then default sizes used). - void SetFonts(const wxString& normal_face, const wxString& fixed_face, const int *sizes = NULL); - - // Sets font sizes to be relative to the given size or the system - // default size; use either specified or default font - void SetStandardFonts(int size = -1, - const wxString& normal_face = wxEmptyString, - const wxString& fixed_face = wxEmptyString); - - // Adds tags module. see wxHtmlTagsModule for details. - static void AddModule(wxHtmlTagsModule *module); - - static void RemoveModule(wxHtmlTagsModule *module); - - // parsing-related methods. These methods are called by tag handlers: - - // Returns pointer to actual container. Common use in tag handler is : - // m_WParser->GetContainer()->InsertCell(new ...); - wxHtmlContainerCell *GetContainer() const {return m_Container;} - - // opens new container. This container is sub-container of opened - // container. Sets GetContainer to newly created container - // and returns it. - wxHtmlContainerCell *OpenContainer(); - - // works like OpenContainer except that new container is not created - // but c is used. You can use this to directly set actual container - wxHtmlContainerCell *SetContainer(wxHtmlContainerCell *c); - - // closes the container and sets actual Container to upper-level - // container - wxHtmlContainerCell *CloseContainer(); - - int GetFontSize() const {return m_FontSize;} - void SetFontSize(int s); - int GetFontBold() const {return m_FontBold;} - void SetFontBold(int x) {m_FontBold = x;} - int GetFontItalic() const {return m_FontItalic;} - void SetFontItalic(int x) {m_FontItalic = x;} - int GetFontUnderlined() const {return m_FontUnderlined;} - void SetFontUnderlined(int x) {m_FontUnderlined = x;} - int GetFontFixed() const {return m_FontFixed;} - void SetFontFixed(int x) {m_FontFixed = x;} - wxString GetFontFace() const {return GetFontFixed() ? m_FontFaceFixed : m_FontFaceNormal;} - void SetFontFace(const wxString& face); - - int GetAlign() const {return m_Align;} - void SetAlign(int a) {m_Align = a;} - - wxHtmlScriptMode GetScriptMode() const { return m_ScriptMode; } - void SetScriptMode(wxHtmlScriptMode mode) { m_ScriptMode = mode; } - long GetScriptBaseline() const { return m_ScriptBaseline; } - void SetScriptBaseline(long base) { m_ScriptBaseline = base; } - - const wxColour& GetLinkColor() const { return m_LinkColor; } - void SetLinkColor(const wxColour& clr) { m_LinkColor = clr; } - const wxColour& GetActualColor() const { return m_ActualColor; } - void SetActualColor(const wxColour& clr) { m_ActualColor = clr ;} - const wxHtmlLinkInfo& GetLink() const { return m_Link; } - void SetLink(const wxHtmlLinkInfo& link); - - // applies current parser state (link, sub/supscript, ...) to given cell - void ApplyStateToCell(wxHtmlCell *cell); - -#if !wxUSE_UNICODE - void SetInputEncoding(wxFontEncoding enc); - wxFontEncoding GetInputEncoding() const { return m_InputEnc; } - wxFontEncoding GetOutputEncoding() const { return m_OutputEnc; } - wxEncodingConverter *GetEncodingConverter() const { return m_EncConv; } -#endif - - // creates font depending on m_Font* members. - virtual wxFont* CreateCurrentFont(); - -#if wxABI_VERSION >= 20808 - enum WhitespaceMode - { - Whitespace_Normal, // normal mode, collapse whitespace - Whitespace_Pre // inside <pre>, keep whitespace as-is - }; - - // change the current whitespace handling mode - void SetWhitespaceMode(WhitespaceMode mode); - WhitespaceMode GetWhitespaceMode() const; -#endif // wxABI_VERSION >= 20808 - -protected: - virtual void AddText(const wxChar* txt); - -private: - void FlushWordBuf(wxChar *temp, int& templen, wxChar nbsp); - void AddWord(wxHtmlWordCell *c); - void AddWord(const wxString& word); - void AddPreBlock(const wxString& text); - - bool m_tmpLastWasSpace; - wxChar *m_tmpStrBuf; - size_t m_tmpStrBufSize; - // temporary variables used by AddText - wxHtmlWindowInterface *m_windowInterface; - // window we're parsing for - double m_PixelScale; - wxDC *m_DC; - // Device Context we're parsing for - static wxList m_Modules; - // list of tags modules (see wxHtmlTagsModule for details) - // This list is used to initialize m_Handlers member. - - wxHtmlContainerCell *m_Container; - // current container. See Open/CloseContainer for details. - - int m_FontBold, m_FontItalic, m_FontUnderlined, m_FontFixed; // this is not true,false but 1,0, we need it for indexing - int m_FontSize; /* -2 to +4, 0 is default */ - wxColour m_LinkColor; - wxColour m_ActualColor; - // basic font parameters. - wxHtmlLinkInfo m_Link; - // actual hypertext link or empty string - bool m_UseLink; - // true if m_Link is not empty - long m_CharHeight, m_CharWidth; - // average height of normal-sized text - int m_Align; - // actual alignment - wxHtmlScriptMode m_ScriptMode; - // current script mode (sub/sup/normal) - long m_ScriptBaseline; - // current sub/supscript base - - wxFont* m_FontsTable[2][2][2][2][7]; - wxString m_FontsFacesTable[2][2][2][2][7]; -#if !wxUSE_UNICODE - wxFontEncoding m_FontsEncTable[2][2][2][2][7]; -#endif - // table of loaded fonts. 1st four indexes are 0 or 1, depending on on/off - // state of these flags (from left to right): - // [bold][italic][underlined][fixed_size] - // last index is font size : from 0 to 6 (remapped from html sizes 1 to 7) - // Note : this table covers all possible combinations of fonts, but not - // all of them are used, so many items in table are usually NULL. - int m_FontsSizes[7]; - wxString m_FontFaceFixed, m_FontFaceNormal; - // html font sizes and faces of fixed and proportional fonts - -#if !wxUSE_UNICODE - wxFontEncoding m_InputEnc, m_OutputEnc; - // I/O font encodings - wxEncodingConverter *m_EncConv; -#endif - - // NB: this pointer replaces m_lastWordCell pointer in wx<=2.8.7; this - // way, wxHtmlWinParser remains ABI compatible with older versions - // despite addition of two fields in wxHtmlWinParser_TextParsingState - wxHtmlWinParser_TextParsingState *m_textParsingState; - - DECLARE_NO_COPY_CLASS(wxHtmlWinParser) -}; - - - - - - -//----------------------------------------------------------------------------- -// wxHtmlWinTagHandler -// This is basicly wxHtmlTagHandler except -// it is extended with protected member m_Parser pointing to -// the wxHtmlWinParser object -//----------------------------------------------------------------------------- - -class WXDLLIMPEXP_HTML wxHtmlWinTagHandler : public wxHtmlTagHandler -{ - DECLARE_ABSTRACT_CLASS(wxHtmlWinTagHandler) - -public: - wxHtmlWinTagHandler() : wxHtmlTagHandler() {} - - virtual void SetParser(wxHtmlParser *parser) {wxHtmlTagHandler::SetParser(parser); m_WParser = (wxHtmlWinParser*) parser;} - -protected: - wxHtmlWinParser *m_WParser; // same as m_Parser, but overcasted - - DECLARE_NO_COPY_CLASS(wxHtmlWinTagHandler) -}; - - - - - - -//---------------------------------------------------------------------------- -// wxHtmlTagsModule -// This is basic of dynamic tag handlers binding. -// The class provides methods for filling parser's handlers -// hash table. -// (See documentation for details) -//---------------------------------------------------------------------------- - -class WXDLLIMPEXP_HTML wxHtmlTagsModule : public wxModule -{ - DECLARE_DYNAMIC_CLASS(wxHtmlTagsModule) - -public: - wxHtmlTagsModule() : wxModule() {} - - virtual bool OnInit(); - virtual void OnExit(); - - // This is called by wxHtmlWinParser. - // The method must simply call parser->AddTagHandler(new - // <handler_class_name>); for each handler - virtual void FillHandlersTable(wxHtmlWinParser * WXUNUSED(parser)) { } -}; - - -#endif - -#endif // _WX_WINPARS_H_ diff --git a/wxWidgets/include/wx/htmllbox.h b/wxWidgets/include/wx/htmllbox.h deleted file mode 100644 index 533b79171b..0000000000 --- a/wxWidgets/include/wx/htmllbox.h +++ /dev/null @@ -1,325 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: wx/htmllbox.h -// Purpose: wxHtmlListBox is a listbox whose items are wxHtmlCells -// Author: Vadim Zeitlin -// Modified by: -// Created: 31.05.03 -// RCS-ID: $Id: htmllbox.h 49804 2007-11-10 01:09:42Z VZ $ -// Copyright: (c) 2003 Vadim Zeitlin <vadim@wxwidgets.org> -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_HTMLLBOX_H_ -#define _WX_HTMLLBOX_H_ - -#include "wx/vlbox.h" // base class -#include "wx/html/htmlwin.h" -#include "wx/ctrlsub.h" - -#if wxUSE_FILESYSTEM - #include "wx/filesys.h" -#endif // wxUSE_FILESYSTEM - -class WXDLLIMPEXP_FWD_HTML wxHtmlCell; -class WXDLLIMPEXP_FWD_HTML wxHtmlWinParser; -class WXDLLIMPEXP_FWD_HTML wxHtmlListBoxCache; -class WXDLLIMPEXP_FWD_HTML wxHtmlListBoxStyle; - -extern WXDLLIMPEXP_DATA_HTML(const wxChar) wxHtmlListBoxNameStr[]; -extern WXDLLIMPEXP_DATA_HTML(const wxChar) wxSimpleHtmlListBoxNameStr[]; - -// ---------------------------------------------------------------------------- -// wxHtmlListBox -// ---------------------------------------------------------------------------- - -class WXDLLIMPEXP_HTML wxHtmlListBox : public wxVListBox, - public wxHtmlWindowInterface, - public wxHtmlWindowMouseHelper -{ - DECLARE_ABSTRACT_CLASS(wxHtmlListBox) -public: - // constructors and such - // --------------------- - - // default constructor, you must call Create() later - wxHtmlListBox(); - - // normal constructor which calls Create() internally - wxHtmlListBox(wxWindow *parent, - wxWindowID id = wxID_ANY, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = 0, - const wxString& name = wxHtmlListBoxNameStr); - - // really creates the control and sets the initial number of items in it - // (which may be changed later with SetItemCount()) - // - // the only special style which may be specified here is wxLB_MULTIPLE - // - // returns true on success or false if the control couldn't be created - bool Create(wxWindow *parent, - wxWindowID id = wxID_ANY, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = 0, - const wxString& name = wxHtmlListBoxNameStr); - - // destructor cleans up whatever resources we use - virtual ~wxHtmlListBox(); - - // override some base class virtuals - virtual void RefreshLine(size_t line); - virtual void RefreshLines(size_t from, size_t to); - virtual void RefreshAll(); - virtual void SetItemCount(size_t count); - -#if wxUSE_FILESYSTEM - // retrieve the file system used by the wxHtmlWinParser: if you use - // relative paths in your HTML, you should use its ChangePathTo() method - wxFileSystem& GetFileSystem() { return m_filesystem; } - const wxFileSystem& GetFileSystem() const { return m_filesystem; } -#endif // wxUSE_FILESYSTEM - - virtual void OnInternalIdle(); - -protected: - // this method must be implemented in the derived class and should return - // the body (i.e. without <html>) of the HTML for the given item - virtual wxString OnGetItem(size_t n) const = 0; - - // this function may be overridden to decorate HTML returned by OnGetItem() - virtual wxString OnGetItemMarkup(size_t n) const; - - - // this method allows to customize the selection appearance: it may be used - // to specify the colour of the text which normally has the given colour - // colFg when it is inside the selection - // - // by default, the original colour is not used at all and all text has the - // same (default for this system) colour inside selection - virtual wxColour GetSelectedTextColour(const wxColour& colFg) const; - - // this is the same as GetSelectedTextColour() but allows to customize the - // background colour -- this is even more rarely used as you can change it - // globally using SetSelectionBackground() - virtual wxColour GetSelectedTextBgColour(const wxColour& colBg) const; - - - // we implement both of these functions in terms of OnGetItem(), they are - // not supposed to be overridden by our descendants - virtual void OnDrawItem(wxDC& dc, const wxRect& rect, size_t n) const; - virtual wxCoord OnMeasureItem(size_t n) const; - - // This method may be overriden to handle clicking on a link in - // the listbox. By default, clicking links is ignored. - virtual void OnLinkClicked(size_t n, const wxHtmlLinkInfo& link); - - // event handlers - void OnSize(wxSizeEvent& event); - void OnMouseMove(wxMouseEvent& event); - void OnLeftDown(wxMouseEvent& event); - - - // common part of all ctors - void Init(); - - // ensure that the given item is cached - void CacheItem(size_t n) const; - -private: - // wxHtmlWindowInterface methods: - virtual void SetHTMLWindowTitle(const wxString& title); - virtual void OnHTMLLinkClicked(const wxHtmlLinkInfo& link); - virtual wxHtmlOpeningStatus OnHTMLOpeningURL(wxHtmlURLType type, - const wxString& url, - wxString *redirect) const; - virtual wxPoint HTMLCoordsToWindow(wxHtmlCell *cell, - const wxPoint& pos) const; - virtual wxWindow* GetHTMLWindow(); - virtual wxColour GetHTMLBackgroundColour() const; - virtual void SetHTMLBackgroundColour(const wxColour& clr); - virtual void SetHTMLBackgroundImage(const wxBitmap& bmpBg); - virtual void SetHTMLStatusText(const wxString& text); - virtual wxCursor GetHTMLCursor(HTMLCursor type) const; - - // returns index of item that contains given HTML cell - size_t GetItemForCell(const wxHtmlCell *cell) const; - - // return physical coordinates of root wxHtmlCell of n-th item - wxPoint GetRootCellCoords(size_t n) const; - - // Converts physical coordinates stored in @a pos into coordinates - // relative to the root cell of the item under mouse cursor, if any. If no - // cell is found under the cursor, returns false. Otherwise stores the new - // coordinates back into @a pos and pointer to the cell under cursor into - // @a cell and returns true. - bool PhysicalCoordsToCell(wxPoint& pos, wxHtmlCell*& cell) const; - - // The opposite of PhysicalCoordsToCell: converts coordinates relative to - // given cell to physical coordinates in the window - wxPoint CellCoordsToPhysical(const wxPoint& pos, wxHtmlCell *cell) const; - -private: - // this class caches the pre-parsed HTML to speed up display - wxHtmlListBoxCache *m_cache; - - // HTML parser we use - wxHtmlWinParser *m_htmlParser; - -#if wxUSE_FILESYSTEM - // file system used by m_htmlParser - wxFileSystem m_filesystem; -#endif // wxUSE_FILESYSTEM - - // rendering style for the parser which allows us to customize our colours - wxHtmlListBoxStyle *m_htmlRendStyle; - - - // it calls our GetSelectedTextColour() and GetSelectedTextBgColour() - friend class wxHtmlListBoxStyle; - friend class wxHtmlListBoxWinInterface; - - - DECLARE_EVENT_TABLE() - DECLARE_NO_COPY_CLASS(wxHtmlListBox) -}; - - -// ---------------------------------------------------------------------------- -// wxSimpleHtmlListBox -// ---------------------------------------------------------------------------- - -#define wxHLB_DEFAULT_STYLE wxBORDER_SUNKEN -#define wxHLB_MULTIPLE wxLB_MULTIPLE - -class WXDLLIMPEXP_HTML wxSimpleHtmlListBox : public wxHtmlListBox, - public wxItemContainer -{ -public: - // wxListbox-compatible constructors - // --------------------------------- - - wxSimpleHtmlListBox() { } - - wxSimpleHtmlListBox(wxWindow *parent, - wxWindowID id, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - int n = 0, const wxString choices[] = NULL, - long style = wxHLB_DEFAULT_STYLE, - const wxValidator& validator = wxDefaultValidator, - const wxString& name = wxSimpleHtmlListBoxNameStr) - { - Create(parent, id, pos, size, n, choices, style, validator, name); - } - - wxSimpleHtmlListBox(wxWindow *parent, - wxWindowID id, - const wxPoint& pos, - const wxSize& size, - const wxArrayString& choices, - long style = wxHLB_DEFAULT_STYLE, - const wxValidator& validator = wxDefaultValidator, - const wxString& name = wxSimpleHtmlListBoxNameStr) - { - 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 = wxHLB_DEFAULT_STYLE, - const wxValidator& validator = wxDefaultValidator, - const wxString& name = wxSimpleHtmlListBoxNameStr); - bool Create(wxWindow *parent, wxWindowID id, - const wxPoint& pos, - const wxSize& size, - const wxArrayString& choices, - long style = wxHLB_DEFAULT_STYLE, - const wxValidator& validator = wxDefaultValidator, - const wxString& name = wxSimpleHtmlListBoxNameStr); - - virtual ~wxSimpleHtmlListBox(); - - // these must be overloaded otherwise the compiler will complain - // about wxItemContainerImmutable::[G|S]etSelection being pure virtuals... - void SetSelection(int n) - { wxVListBox::SetSelection(n); } - int GetSelection() const - { return wxVListBox::GetSelection(); } - - // see ctrlsub.h for more info about this: - wxCONTROL_ITEMCONTAINER_CLIENTDATAOBJECT_RECAST - - - // accessing strings - // ----------------- - - virtual unsigned int GetCount() const - { return m_items.GetCount(); } - - virtual wxString GetString(unsigned int n) const; - - // override default unoptimized wxItemContainer::GetStrings() function - wxArrayString GetStrings() const - { return m_items; } - - virtual void SetString(unsigned int n, const wxString& s); - - virtual void Clear(); - virtual void Delete(unsigned int n); - - // override default unoptimized wxItemContainer::Append() function - void Append(const wxArrayString& strings); - - // since we override one Append() overload, we need to overload all others too - int Append(const wxString& item) - { return wxItemContainer::Append(item); } - int Append(const wxString& item, void *clientData) - { return wxItemContainer::Append(item, clientData); } - int Append(const wxString& item, wxClientData *clientData) - { return wxItemContainer::Append(item, clientData); } - - -protected: - - virtual int DoAppend(const wxString& item); - virtual int DoInsert(const wxString& item, unsigned int pos); - - virtual void DoSetItemClientData(unsigned int n, void *clientData) - { m_HTMLclientData[n] = clientData; } - - virtual void *DoGetItemClientData(unsigned int n) const - { return m_HTMLclientData[n]; } - virtual void DoSetItemClientObject(unsigned int n, wxClientData *clientData) - { m_HTMLclientData[n] = (void *)clientData; } - virtual wxClientData *DoGetItemClientObject(unsigned int n) const - { return (wxClientData *)m_HTMLclientData[n]; } - - // calls wxHtmlListBox::SetItemCount() and RefreshAll() - void UpdateCount(); - - // overload these functions just to change their visibility: users of - // wxSimpleHtmlListBox shouldn't be allowed to call them directly! - virtual void SetItemCount(size_t count) - { wxHtmlListBox::SetItemCount(count); } - virtual void SetLineCount(size_t count) - { wxHtmlListBox::SetLineCount(count); } - - virtual wxString OnGetItem(size_t n) const - { return m_items[n]; } - - wxArrayString m_items; - wxArrayPtrVoid m_HTMLclientData; - - // Note: For the benefit of old compilers (like gcc-2.8) this should - // not be named m_clientdata as that clashes with the name of an - // anonymous struct member in wxEvtHandler, which we derive from. - - DECLARE_NO_COPY_CLASS(wxSimpleHtmlListBox) -}; - -#endif // _WX_HTMLLBOX_H_ - diff --git a/wxWidgets/include/wx/hyperlink.h b/wxWidgets/include/wx/hyperlink.h deleted file mode 100644 index 8618466b8a..0000000000 --- a/wxWidgets/include/wx/hyperlink.h +++ /dev/null @@ -1,231 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/hyperlink.h -// Purpose: Hyperlink control -// Author: David Norris <danorris@gmail.com>, Otto Wyss -// Modified by: Ryan Norton, Francesco Montorsi -// Created: 04/02/2005 -// RCS-ID: $Id: hyperlink.h 42409 2006-10-25 20:23:06Z RD $ -// Copyright: (c) 2005 David Norris -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_HYPERLINK_H__ -#define _WX_HYPERLINK_H__ - -#include "wx/defs.h" - -#if wxUSE_HYPERLINKCTRL - -#include "wx/control.h" - -// ---------------------------------------------------------------------------- -// constants -// ---------------------------------------------------------------------------- - -#define wxHL_CONTEXTMENU 0x0001 -#define wxHL_ALIGN_LEFT 0x0002 -#define wxHL_ALIGN_RIGHT 0x0004 -#define wxHL_ALIGN_CENTRE 0x0008 -#define wxHL_DEFAULT_STYLE (wxHL_CONTEXTMENU|wxNO_BORDER|wxHL_ALIGN_CENTRE) - -extern WXDLLIMPEXP_DATA_ADV(const wxChar) wxHyperlinkCtrlNameStr[]; - - -// ---------------------------------------------------------------------------- -// wxHyperlinkCtrl -// ---------------------------------------------------------------------------- - -// A static text control that emulates a hyperlink. The link is displayed -// in an appropriate text style, derived from the control's normal font. -// When the mouse rolls over the link, the cursor changes to a hand and the -// link's color changes to the active color. -// -// Clicking on the link does not launch a web browser; instead, a -// HyperlinkEvent is fired. The event propagates upward until it is caught, -// just like a wxCommandEvent. -// -// Use the EVT_HYPERLINK() to catch link events. -class WXDLLIMPEXP_ADV wxHyperlinkCtrl : public wxControl -{ -public: - // Default constructor (for two-step construction). - wxHyperlinkCtrl() { } - - // Constructor. - wxHyperlinkCtrl(wxWindow *parent, - wxWindowID id, - const wxString& label, const wxString& url, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = wxHL_DEFAULT_STYLE, - const wxString& name = wxHyperlinkCtrlNameStr) - { - (void)Create(parent, id, label, url, pos, size, style, name); - } - - // Creation function (for two-step construction). - bool Create(wxWindow *parent, - wxWindowID id, - const wxString& label, const wxString& url, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = wxHL_DEFAULT_STYLE, - const wxString& name = wxHyperlinkCtrlNameStr); - - - // get/set - wxColour GetHoverColour() const { return m_hoverColour; } - void SetHoverColour(const wxColour &colour) { m_hoverColour = colour; } - - wxColour GetNormalColour() const { return m_normalColour; } - void SetNormalColour(const wxColour &colour); - - wxColour GetVisitedColour() const { return m_visitedColour; } - void SetVisitedColour(const wxColour &colour); - - wxString GetURL() const { return m_url; } - void SetURL (const wxString &url) { m_url=url; } - - void SetVisited(bool visited = true) { m_visited=visited; } - bool GetVisited() const { return m_visited; } - - // NOTE: also wxWindow::Set/GetLabel, wxWindow::Set/GetBackgroundColour, - // wxWindow::Get/SetFont, wxWindow::Get/SetCursor are important ! - - -protected: - // event handlers - - // Renders the hyperlink. - void OnPaint(wxPaintEvent& event); - - // Returns the wxRect of the label of this hyperlink. - // This is different from the clientsize's rectangle when - // clientsize != bestsize and this rectangle is influenced - // by the alignment of the label (wxHL_ALIGN_*). - wxRect GetLabelRect() const; - - // If the click originates inside the bounding box of the label, - // a flag is set so that an event will be fired when the left - // button is released. - void OnLeftDown(wxMouseEvent& event); - - // If the click both originated and finished inside the bounding box - // of the label, a HyperlinkEvent is fired. - void OnLeftUp(wxMouseEvent& event); - void OnRightUp(wxMouseEvent& event); - - // Changes the cursor to a hand, if the mouse is inside the label's - // bounding box. - void OnMotion(wxMouseEvent& event); - - // Changes the cursor back to the default, if necessary. - void OnLeaveWindow(wxMouseEvent& event); - - // handles "Copy URL" menuitem - void OnPopUpCopy(wxCommandEvent& event); - - // Refreshes the control to update label's position if necessary - void OnSize(wxSizeEvent& event); - - - // overridden base class virtuals - - // Returns the best size for the window, which is the size needed - // to display the text label. - virtual wxSize DoGetBestSize() const; - - // creates a context menu with "Copy URL" menuitem - virtual void DoContextMenu(const wxPoint &); - -private: - // URL associated with the link. This is transmitted inside - // the HyperlinkEvent fired when the user clicks on the label. - wxString m_url; - - // Foreground colours for various link types. - // NOTE: wxWindow::m_backgroundColour is used for background, - // wxWindow::m_foregroundColour is used to render non-visited links - wxColour m_hoverColour; - wxColour m_normalColour; - wxColour m_visitedColour; - - // True if the mouse cursor is inside the label's bounding box. - bool m_rollover; - - // True if the link has been clicked before. - bool m_visited; - - // True if a click is in progress (left button down) and the click - // originated inside the label's bounding box. - bool m_clicking; - -private: - DECLARE_DYNAMIC_CLASS(wxHyperlinkCtrl) - DECLARE_EVENT_TABLE() -}; - - -// ---------------------------------------------------------------------------- -// wxHyperlinkEvent -// ---------------------------------------------------------------------------- - -// Declare an event identifier. -BEGIN_DECLARE_EVENT_TYPES() - DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_ADV, wxEVT_COMMAND_HYPERLINK, 3700) -END_DECLARE_EVENT_TYPES() - -// -// An event fired when the user clicks on the label in a hyperlink control. -// See HyperlinkControl for details. -// -class WXDLLIMPEXP_ADV wxHyperlinkEvent : public wxCommandEvent -{ -public: - wxHyperlinkEvent() {} - wxHyperlinkEvent(wxObject *generator, wxWindowID id, const wxString& url) - : wxCommandEvent(wxEVT_COMMAND_HYPERLINK, id), - m_url(url) - { - SetEventObject(generator); - } - - // Returns the URL associated with the hyperlink control - // that the user clicked on. - wxString GetURL() const { return m_url; } - void SetURL(const wxString &url) { m_url=url; } - - // default copy ctor, assignment operator and dtor are ok - virtual wxEvent *Clone() const { return new wxHyperlinkEvent(*this); } - -private: - - // URL associated with the hyperlink control that the used clicked on. - wxString m_url; - - DECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxHyperlinkEvent) -}; - - -// ---------------------------------------------------------------------------- -// event types and macros -// ---------------------------------------------------------------------------- - -typedef void (wxEvtHandler::*wxHyperlinkEventFunction)(wxHyperlinkEvent&); - -#define wxHyperlinkEventHandler(func) \ - (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxHyperlinkEventFunction, &func) - -#define EVT_HYPERLINK(id, fn) \ - wx__DECLARE_EVT1(wxEVT_COMMAND_HYPERLINK, id, wxHyperlinkEventHandler(fn)) - -#ifdef _WX_DEFINE_DATE_EVENTS_ - DEFINE_EVENT_TYPE(wxEVT_COMMAND_HYPERLINK) - - IMPLEMENT_DYNAMIC_CLASS(wxHyperlinkEvent, wxCommandEvent) -#endif - - -#endif // wxUSE_HYPERLINKCTRL - -#endif // _WX_HYPERLINK_H__ diff --git a/wxWidgets/include/wx/icon.h b/wxWidgets/include/wx/icon.h deleted file mode 100644 index fac90f555b..0000000000 --- a/wxWidgets/include/wx/icon.h +++ /dev/null @@ -1,53 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/icon.h -// Purpose: wxIcon base header -// Author: Julian Smart -// Modified by: -// Created: -// Copyright: (c) Julian Smart -// RCS-ID: $Id: icon.h 41538 2006-09-30 20:45:15Z RR $ -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_ICON_H_BASE_ -#define _WX_ICON_H_BASE_ - -#include "wx/iconloc.h" - -#if defined(__WXPALMOS__) - #include "wx/generic/icon.h" -#elif defined(__WXMSW__) - #include "wx/msw/icon.h" -#elif defined(__WXMOTIF__) - #include "wx/motif/icon.h" -#elif defined(__WXGTK20__) - #include "wx/generic/icon.h" -#elif defined(__WXGTK__) - #include "wx/generic/icon.h" -#elif defined(__WXX11__) - #include "wx/generic/icon.h" -#elif defined(__WXMGL__) - #define wxICON_DEFAULT_BITMAP_TYPE wxBITMAP_TYPE_ICO_RESOURCE - #include "wx/generic/icon.h" -#elif defined(__WXDFB__) - #include "wx/generic/icon.h" -#elif defined(__WXMAC__) - #include "wx/mac/icon.h" -#elif defined(__WXCOCOA__) - #include "wx/cocoa/icon.h" -#elif defined(__WXPM__) - #include "wx/os2/icon.h" -#endif - -//----------------------------------------------------------------------------- -// wxVariant support -//----------------------------------------------------------------------------- - -#if wxUSE_VARIANT -#include "wx/variant.h" -DECLARE_VARIANT_OBJECT_EXPORTED(wxIcon,WXDLLEXPORT) -#endif - - -#endif - // _WX_ICON_H_BASE_ diff --git a/wxWidgets/include/wx/iconbndl.h b/wxWidgets/include/wx/iconbndl.h deleted file mode 100644 index 0ee8e9afe1..0000000000 --- a/wxWidgets/include/wx/iconbndl.h +++ /dev/null @@ -1,69 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: wx/iconbndl.h -// Purpose: wxIconBundle -// Author: Mattia barbon -// Modified by: -// Created: 23.03.02 -// RCS-ID: $Id: iconbndl.h 49563 2007-10-31 20:46:21Z VZ $ -// Copyright: (c) Mattia Barbon -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_ICONBNDL_H_ -#define _WX_ICONBNDL_H_ - -#include "wx/dynarray.h" -// for wxSize -#include "wx/gdicmn.h" - -class WXDLLIMPEXP_FWD_CORE wxIcon; -class WXDLLIMPEXP_FWD_BASE wxString; - -WX_DECLARE_EXPORTED_OBJARRAY( wxIcon, wxIconArray ); - -// this class can't load bitmaps of type wxBITMAP_TYPE_ICO_RESOURCE, -// if you need them, you have to load them manually and call -// wxIconCollection::AddIcon -class WXDLLEXPORT wxIconBundle -{ -public: - // default constructor - wxIconBundle() : m_icons() {} - // initializes the bundle with the icon(s) found in the file - wxIconBundle( const wxString& file, long type ) : m_icons() - { AddIcon( file, type ); } - // initializes the bundle with a single icon - wxIconBundle( const wxIcon& icon ) : m_icons() - { AddIcon( icon ); } - - const wxIconBundle& operator =( const wxIconBundle& ic ); - wxIconBundle( const wxIconBundle& ic ) : m_icons() - { *this = ic; } - - ~wxIconBundle() { DeleteIcons(); } - - // adds all the icons contained in the file to the collection, - // if the collection already contains icons with the same - // width and height, they are replaced - void AddIcon( const wxString& file, long type ); - // adds the icon to the collection, if the collection already - // contains an icon with the same width and height, it is - // replaced - void AddIcon( const wxIcon& icon ); - - // returns the icon with the given size; if no such icon exists, - // returns the icon with size wxSYS_ICON_[XY]; if no such icon exists, - // returns the first icon in the bundle - const wxIcon& GetIcon( const wxSize& size ) const; - // equivalent to GetIcon( wxSize( size, size ) ) - const wxIcon& GetIcon( wxCoord size = wxDefaultCoord ) const - { return GetIcon( wxSize( size, size ) ); } -private: - // delete all icons - void DeleteIcons(); -public: - wxIconArray m_icons; -}; - -#endif - // _WX_ICONBNDL_H_ diff --git a/wxWidgets/include/wx/iconloc.h b/wxWidgets/include/wx/iconloc.h deleted file mode 100644 index 41abc8fa7a..0000000000 --- a/wxWidgets/include/wx/iconloc.h +++ /dev/null @@ -1,81 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: wx/iconloc.h -// Purpose: declaration of wxIconLocation class -// Author: Vadim Zeitlin -// Modified by: -// Created: 21.06.2003 -// RCS-ID: $Id: iconloc.h 27408 2004-05-23 20:53:33Z JS $ -// Copyright: (c) 2003 Vadim Zeitlin <vadim@wxwidgets.org> -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_ICONLOC_H_ -#define _WX_ICONLOC_H_ - -#include "wx/string.h" - -// ---------------------------------------------------------------------------- -// wxIconLocation: describes the location of an icon -// ---------------------------------------------------------------------------- - -class WXDLLIMPEXP_BASE wxIconLocationBase -{ -public: - // ctor takes the name of the file where the icon is - wxEXPLICIT wxIconLocationBase(const wxString& filename = wxEmptyString) - : m_filename(filename) { } - - // default copy ctor, assignment operator and dtor are ok - - - // returns true if this object is valid/initialized - bool IsOk() const { return !m_filename.empty(); } - - // set/get the icon file name - void SetFileName(const wxString& filename) { m_filename = filename; } - const wxString& GetFileName() const { return m_filename; } - -private: - wxString m_filename; -}; - -// under MSW the same file may contain several icons so we also store the -// index of the icon -#if defined(__WXMSW__) - -class WXDLLIMPEXP_BASE wxIconLocation : public wxIconLocationBase -{ -public: - // ctor takes the name of the file where the icon is and the icons index in - // the file - wxEXPLICIT wxIconLocation(const wxString& file = wxEmptyString, int num = 0); - - // set/get the icon index - void SetIndex(int num) { m_index = num; } - int GetIndex() const { return m_index; } - -private: - int m_index; -}; - -inline -wxIconLocation::wxIconLocation(const wxString& file, int num) - : wxIconLocationBase(file) -{ - SetIndex(num); -} - -#else // !MSW - -// must be a class because we forward declare it as class -class WXDLLIMPEXP_BASE wxIconLocation : public wxIconLocationBase -{ -public: - wxEXPLICIT wxIconLocation(const wxString& filename = wxEmptyString) - : wxIconLocationBase(filename) { } -}; - -#endif // platform - -#endif // _WX_ICONLOC_H_ - diff --git a/wxWidgets/include/wx/imagbmp.h b/wxWidgets/include/wx/imagbmp.h deleted file mode 100644 index 6ad454e027..0000000000 --- a/wxWidgets/include/wx/imagbmp.h +++ /dev/null @@ -1,165 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/imagbmp.h -// Purpose: wxImage BMP, ICO, CUR and ANI handlers -// Author: Robert Roebling, Chris Elliott -// RCS-ID: $Id: imagbmp.h 61872 2009-09-09 22:37:05Z VZ $ -// Copyright: (c) Robert Roebling, Chris Elliott -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_IMAGBMP_H_ -#define _WX_IMAGBMP_H_ - -#include "wx/image.h" - -// defines for saving the BMP file in different formats, Bits Per Pixel -// USE: wximage.SetOption( wxIMAGE_OPTION_BMP_FORMAT, wxBMP_xBPP ); -#define wxIMAGE_OPTION_BMP_FORMAT wxString(wxT("wxBMP_FORMAT")) - -// These two options are filled in upon reading CUR file and can (should) be -// specified when saving a CUR file - they define the hotspot of the cursor: -#define wxIMAGE_OPTION_CUR_HOTSPOT_X wxT("HotSpotX") -#define wxIMAGE_OPTION_CUR_HOTSPOT_Y wxT("HotSpotY") - -#if WXWIN_COMPATIBILITY_2_4 - // Do not use these macros, they are deprecated - #define wxBMP_FORMAT wxIMAGE_OPTION_BMP_FORMAT - #define wxCUR_HOTSPOT_X wxIMAGE_OPTION_CUR_HOTSPOT_X - #define wxCUR_HOTSPOT_Y wxIMAGE_OPTION_CUR_HOTSPOT_Y -#endif - - -enum -{ - wxBMP_24BPP = 24, // default, do not need to set - //wxBMP_16BPP = 16, // wxQuantize can only do 236 colors? - wxBMP_8BPP = 8, // 8bpp, quantized colors - wxBMP_8BPP_GREY = 9, // 8bpp, rgb averaged to greys - wxBMP_8BPP_GRAY = wxBMP_8BPP_GREY, - wxBMP_8BPP_RED = 10, // 8bpp, red used as greyscale - wxBMP_8BPP_PALETTE = 11, // 8bpp, use the wxImage's palette - wxBMP_4BPP = 4, // 4bpp, quantized colors - wxBMP_1BPP = 1, // 1bpp, quantized "colors" - wxBMP_1BPP_BW = 2 // 1bpp, black & white from red -}; - -// ---------------------------------------------------------------------------- -// wxBMPHandler -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxBMPHandler : public wxImageHandler -{ -public: - wxBMPHandler() - { - m_name = wxT("Windows bitmap file"); - m_extension = wxT("bmp"); - m_type = wxBITMAP_TYPE_BMP; - m_mime = wxT("image/x-bmp"); - } - -#if wxUSE_STREAMS - virtual bool SaveFile( wxImage *image, wxOutputStream& stream, bool verbose=true ); - virtual bool LoadFile( wxImage *image, wxInputStream& stream, bool verbose=true, int index=-1 ); - -protected: - virtual bool DoCanRead( wxInputStream& stream ); - bool SaveDib(wxImage *image, wxOutputStream& stream, bool verbose, - bool IsBmp, bool IsMask); - bool DoLoadDib(wxImage *image, int width, int height, int bpp, int ncolors, - int comp, wxFileOffset bmpOffset, wxInputStream& stream, - bool verbose, bool IsBmp, bool hasPalette); - bool LoadDib(wxImage *image, wxInputStream& stream, bool verbose, bool IsBmp); -#endif // wxUSE_STREAMS - -private: - DECLARE_DYNAMIC_CLASS(wxBMPHandler) -}; - -#if wxUSE_ICO_CUR -// ---------------------------------------------------------------------------- -// wxICOHandler -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxICOHandler : public wxBMPHandler -{ -public: - wxICOHandler() - { - m_name = wxT("Windows icon file"); - m_extension = wxT("ico"); - m_type = wxBITMAP_TYPE_ICO; - m_mime = wxT("image/x-ico"); - } - -#if wxUSE_STREAMS - virtual bool SaveFile( wxImage *image, wxOutputStream& stream, bool verbose=true ); - virtual bool LoadFile( wxImage *image, wxInputStream& stream, bool verbose=true, int index=-1 ); - virtual bool DoLoadFile( wxImage *image, wxInputStream& stream, bool verbose, int index ); - virtual int GetImageCount( wxInputStream& stream ); -protected: - virtual bool DoCanRead( wxInputStream& stream ); -#endif // wxUSE_STREAMS - -private: - DECLARE_DYNAMIC_CLASS(wxICOHandler) -}; - - -// ---------------------------------------------------------------------------- -// wxCURHandler -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxCURHandler : public wxICOHandler -{ -public: - wxCURHandler() - { - m_name = wxT("Windows cursor file"); - m_extension = wxT("cur"); - m_type = wxBITMAP_TYPE_CUR; - m_mime = wxT("image/x-cur"); - } - - // VS: This handler's meat is implemented inside wxICOHandler (the two - // formats are almost identical), but we hide this fact at - // the API level, since it is a mere implementation detail. - -protected: -#if wxUSE_STREAMS - virtual bool DoCanRead( wxInputStream& stream ); -#endif // wxUSE_STREAMS - -private: - DECLARE_DYNAMIC_CLASS(wxCURHandler) -}; -// ---------------------------------------------------------------------------- -// wxANIHandler -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxANIHandler : public wxCURHandler -{ -public: - wxANIHandler() - { - m_name = wxT("Windows animated cursor file"); - m_extension = wxT("ani"); - m_type = wxBITMAP_TYPE_ANI; - m_mime = wxT("image/x-ani"); - } - - -#if wxUSE_STREAMS - virtual bool SaveFile( wxImage *WXUNUSED(image), wxOutputStream& WXUNUSED(stream), bool WXUNUSED(verbose=true) ){return false ;} - virtual bool LoadFile( wxImage *image, wxInputStream& stream, bool verbose=true, int index=-1 ); - virtual int GetImageCount( wxInputStream& stream ); -protected: - virtual bool DoCanRead( wxInputStream& stream ); -#endif // wxUSE_STREAMS - -private: - DECLARE_DYNAMIC_CLASS(wxANIHandler) -}; - -#endif // wxUSE_ICO_CUR -#endif // _WX_IMAGBMP_H_ diff --git a/wxWidgets/include/wx/image.h b/wxWidgets/include/wx/image.h deleted file mode 100644 index fb23d8e97f..0000000000 --- a/wxWidgets/include/wx/image.h +++ /dev/null @@ -1,454 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/image.h -// Purpose: wxImage class -// Author: Robert Roebling -// RCS-ID: $Id: image.h 61872 2009-09-09 22:37:05Z VZ $ -// Copyright: (c) Robert Roebling -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_IMAGE_H_ -#define _WX_IMAGE_H_ - -#include "wx/defs.h" - -#if wxUSE_IMAGE - -#include "wx/object.h" -#include "wx/string.h" -#include "wx/gdicmn.h" -#include "wx/hashmap.h" - -#if wxUSE_STREAMS -# include "wx/stream.h" -#endif - -// on some systems (Unixware 7.x) index is defined as a macro in the headers -// which breaks the compilation below -#undef index - -#define wxIMAGE_OPTION_QUALITY wxString(wxT("quality")) -#define wxIMAGE_OPTION_FILENAME wxString(wxT("FileName")) - -#define wxIMAGE_OPTION_RESOLUTION wxString(wxT("Resolution")) -#define wxIMAGE_OPTION_RESOLUTIONX wxString(wxT("ResolutionX")) -#define wxIMAGE_OPTION_RESOLUTIONY wxString(wxT("ResolutionY")) - -#define wxIMAGE_OPTION_RESOLUTIONUNIT wxString(wxT("ResolutionUnit")) - -// constants used with wxIMAGE_OPTION_RESOLUTIONUNIT -enum -{ - wxIMAGE_RESOLUTION_INCHES = 1, - wxIMAGE_RESOLUTION_CM = 2 -}; - -// Constants for wxImage::Scale() for determining the level of quality -enum -{ - wxIMAGE_QUALITY_NORMAL = 0, - wxIMAGE_QUALITY_HIGH = 1 -}; - -// alpha channel values: fully transparent, default threshold separating -// transparent pixels from opaque for a few functions dealing with alpha and -// fully opaque -const unsigned char wxIMAGE_ALPHA_TRANSPARENT = 0; -const unsigned char wxIMAGE_ALPHA_THRESHOLD = 0x80; -const unsigned char wxIMAGE_ALPHA_OPAQUE = 0xff; - -//----------------------------------------------------------------------------- -// classes -//----------------------------------------------------------------------------- - -class WXDLLIMPEXP_FWD_CORE wxImageHandler; -class WXDLLIMPEXP_FWD_CORE wxImage; -class WXDLLIMPEXP_FWD_CORE wxPalette; - -//----------------------------------------------------------------------------- -// wxVariant support -//----------------------------------------------------------------------------- - -#if wxUSE_VARIANT -#include "wx/variant.h" -DECLARE_VARIANT_OBJECT_EXPORTED(wxImage,WXDLLEXPORT) -#endif - -//----------------------------------------------------------------------------- -// wxImageHandler -//----------------------------------------------------------------------------- - -class WXDLLEXPORT wxImageHandler: public wxObject -{ -public: - wxImageHandler() - : m_name(wxEmptyString), m_extension(wxEmptyString), m_mime(), m_type(0) - { } - -#if wxUSE_STREAMS - virtual bool LoadFile( wxImage *image, wxInputStream& stream, bool verbose=true, int index=-1 ); - virtual bool SaveFile( wxImage *image, wxOutputStream& stream, bool verbose=true ); - - virtual int GetImageCount( wxInputStream& stream ); - - bool CanRead( wxInputStream& stream ) { return CallDoCanRead(stream); } - bool CanRead( const wxString& name ); -#endif // wxUSE_STREAMS - - void SetName(const wxString& name) { m_name = name; } - void SetExtension(const wxString& ext) { m_extension = ext; } - void SetType(long type) { m_type = type; } - void SetMimeType(const wxString& type) { m_mime = type; } - const wxString& GetName() const { return m_name; } - const wxString& GetExtension() const { return m_extension; } - long GetType() const { return m_type; } - const wxString& GetMimeType() const { return m_mime; } - -protected: -#if wxUSE_STREAMS - virtual bool DoCanRead( wxInputStream& stream ) = 0; - - // save the stream position, call DoCanRead() and restore the position - bool CallDoCanRead(wxInputStream& stream); -#endif // wxUSE_STREAMS - - wxString m_name; - wxString m_extension; - wxString m_mime; - long m_type; - -private: - DECLARE_CLASS(wxImageHandler) -}; - -//----------------------------------------------------------------------------- -// wxImageHistogram -//----------------------------------------------------------------------------- - -class WXDLLEXPORT wxImageHistogramEntry -{ -public: - wxImageHistogramEntry() { index = value = 0; } - unsigned long index; - unsigned long value; -}; - -WX_DECLARE_EXPORTED_HASH_MAP(unsigned long, wxImageHistogramEntry, - wxIntegerHash, wxIntegerEqual, - wxImageHistogramBase); - -class WXDLLEXPORT wxImageHistogram : public wxImageHistogramBase -{ -public: - wxImageHistogram() : wxImageHistogramBase(256) { } - - // get the key in the histogram for the given RGB values - static unsigned long MakeKey(unsigned char r, - unsigned char g, - unsigned char b) - { - return (r << 16) | (g << 8) | b; - } - - // find first colour that is not used in the image and has higher - // RGB values than RGB(startR, startG, startB) - // - // returns true and puts this colour in r, g, b (each of which may be NULL) - // on success or returns false if there are no more free colours - bool FindFirstUnusedColour(unsigned char *r, - unsigned char *g, - unsigned char *b, - unsigned char startR = 1, - unsigned char startG = 0, - unsigned char startB = 0 ) const; -}; - -//----------------------------------------------------------------------------- -// wxImage -//----------------------------------------------------------------------------- - -class WXDLLEXPORT wxImage: public wxObject -{ -public: - // red, green and blue are 8 bit unsigned integers in the range of 0..255 - // We use the identifier RGBValue instead of RGB, since RGB is #defined - class RGBValue - { - public: - RGBValue(unsigned char r=0, unsigned char g=0, unsigned char b=0) - : red(r), green(g), blue(b) {} - unsigned char red; - unsigned char green; - unsigned char blue; - }; - - // hue, saturation and value are doubles in the range 0.0..1.0 - class HSVValue - { - public: - HSVValue(double h=0.0, double s=0.0, double v=0.0) - : hue(h), saturation(s), value(v) {} - double hue; - double saturation; - double value; - }; - - wxImage(){} - wxImage( int width, int height, bool clear = true ); - wxImage( int width, int height, unsigned char* data, bool static_data = false ); - wxImage( int width, int height, unsigned char* data, unsigned char* alpha, bool static_data = false ); - wxImage( const wxString& name, long type = wxBITMAP_TYPE_ANY, int index = -1 ); - wxImage( const wxString& name, const wxString& mimetype, int index = -1 ); - wxImage( const char* const* xpmData ); - -#if wxUSE_STREAMS - wxImage( wxInputStream& stream, long type = wxBITMAP_TYPE_ANY, int index = -1 ); - wxImage( wxInputStream& stream, const wxString& mimetype, int index = -1 ); -#endif // wxUSE_STREAMS - - bool Create( int width, int height, bool clear = true ); - bool Create( int width, int height, unsigned char* data, bool static_data = false ); - bool Create( int width, int height, unsigned char* data, unsigned char* alpha, bool static_data = false ); - bool Create( const char* const* xpmData ); -#ifdef __BORLANDC__ - // needed for Borland 5.5 - wxImage( char** xpmData ) { Create(wx_const_cast(const char* const*, xpmData)); } - bool Create( char** xpmData ) { return Create(wx_const_cast(const char* const*, xpmData)); } -#endif - void Destroy(); - - // creates an identical copy of the image (the = operator - // just raises the ref count) - wxImage Copy() const; - - // return the new image with size width*height - wxImage GetSubImage( const wxRect& rect) const; - - // Paste the image or part of this image into an image of the given size at the pos - // any newly exposed areas will be filled with the rgb colour - // by default if r = g = b = -1 then fill with this image's mask colour or find and - // set a suitable mask colour - wxImage Size( const wxSize& size, const wxPoint& pos, - int r = -1, int g = -1, int b = -1 ) const; - - // pastes image into this instance and takes care of - // the mask colour and out of bounds problems - void Paste( const wxImage &image, int x, int y ); - - // return the new image with size width*height - wxImage Scale( int width, int height, int quality = wxIMAGE_QUALITY_NORMAL ) const; - - // box averager and bicubic filters for up/down sampling - wxImage ResampleBox(int width, int height) const; - wxImage ResampleBicubic(int width, int height) const; - - // blur the image according to the specified pixel radius - wxImage Blur(int radius); - wxImage BlurHorizontal(int radius); - wxImage BlurVertical(int radius); - - wxImage ShrinkBy( int xFactor , int yFactor ) const ; - - // rescales the image in place - wxImage& Rescale( int width, int height, int quality = wxIMAGE_QUALITY_NORMAL ) { return *this = Scale(width, height, quality); } - - // resizes the image in place - wxImage& Resize( const wxSize& size, const wxPoint& pos, - int r = -1, int g = -1, int b = -1 ) { return *this = Size(size, pos, r, g, b); } - - // Rotates the image about the given point, 'angle' radians. - // Returns the rotated image, leaving this image intact. - wxImage Rotate(double angle, const wxPoint & centre_of_rotation, - bool interpolating = true, wxPoint * offset_after_rotation = (wxPoint*) NULL) const; - - wxImage Rotate90( bool clockwise = true ) const; - wxImage Mirror( bool horizontally = true ) const; - - // replace one colour with another - void Replace( unsigned char r1, unsigned char g1, unsigned char b1, - unsigned char r2, unsigned char g2, unsigned char b2 ); - - // Convert to greyscale image. Uses the luminance component (Y) of the image. - // The luma value (YUV) is calculated using (R * lr) + (G * lg) + (B * lb), defaults to ITU-T BT.601 - wxImage ConvertToGreyscale( double lr = 0.299, double lg = 0.587, double lb = 0.114 ) const; - - // convert to monochrome image (<r,g,b> will be replaced by white, - // everything else by black) - wxImage ConvertToMono( unsigned char r, unsigned char g, unsigned char b ) const; - - // these routines are slow but safe - void SetRGB( int x, int y, unsigned char r, unsigned char g, unsigned char b ); - void SetRGB( const wxRect& rect, unsigned char r, unsigned char g, unsigned char b ); - unsigned char GetRed( int x, int y ) const; - unsigned char GetGreen( int x, int y ) const; - unsigned char GetBlue( int x, int y ) const; - - void SetAlpha(int x, int y, unsigned char alpha); - unsigned char GetAlpha(int x, int y) const; - - // find first colour that is not used in the image and has higher - // RGB values than <startR,startG,startB> - bool FindFirstUnusedColour( unsigned char *r, unsigned char *g, unsigned char *b, - unsigned char startR = 1, unsigned char startG = 0, - unsigned char startB = 0 ) const; - // Set image's mask to the area of 'mask' that has <r,g,b> colour - bool SetMaskFromImage(const wxImage & mask, - unsigned char mr, unsigned char mg, unsigned char mb); - - // converts image's alpha channel to mask, if it has any, does nothing - // otherwise: - bool ConvertAlphaToMask(unsigned char threshold = wxIMAGE_ALPHA_THRESHOLD); - - // This method converts an image where the original alpha - // information is only available as a shades of a colour - // (actually shades of grey) typically when you draw anti- - // aliased text into a bitmap. The DC drawinf routines - // draw grey values on the black background although they - // actually mean to draw white with differnt alpha values. - // This method reverses it, assuming a black (!) background - // and white text (actually only the red channel is read). - // The method will then fill up the whole image with the - // colour given. - bool ConvertColourToAlpha( unsigned char r, unsigned char g, unsigned char b ); - - static bool CanRead( const wxString& name ); - static int GetImageCount( const wxString& name, long type = wxBITMAP_TYPE_ANY ); - virtual bool LoadFile( const wxString& name, long type = wxBITMAP_TYPE_ANY, int index = -1 ); - virtual bool LoadFile( const wxString& name, const wxString& mimetype, int index = -1 ); - -#if wxUSE_STREAMS - static bool CanRead( wxInputStream& stream ); - static int GetImageCount( wxInputStream& stream, long type = wxBITMAP_TYPE_ANY ); - virtual bool LoadFile( wxInputStream& stream, long type = wxBITMAP_TYPE_ANY, int index = -1 ); - virtual bool LoadFile( wxInputStream& stream, const wxString& mimetype, int index = -1 ); -#endif - - virtual bool SaveFile( const wxString& name ) const; - virtual bool SaveFile( const wxString& name, int type ) const; - virtual bool SaveFile( const wxString& name, const wxString& mimetype ) const; - -#if wxUSE_STREAMS - virtual bool SaveFile( wxOutputStream& stream, int type ) const; - virtual bool SaveFile( wxOutputStream& stream, const wxString& mimetype ) const; -#endif - - bool Ok() const { return IsOk(); } - bool IsOk() const; - int GetWidth() const; - int GetHeight() const; - - // these functions provide fastest access to wxImage data but should be - // used carefully as no checks are done - unsigned char *GetData() const; - void SetData( unsigned char *data, bool static_data=false ); - void SetData( unsigned char *data, int new_width, int new_height, bool static_data=false ); - - unsigned char *GetAlpha() const; // may return NULL! - bool HasAlpha() const { return GetAlpha() != NULL; } - void SetAlpha(unsigned char *alpha = NULL, bool static_data=false); - void InitAlpha(); - - // return true if this pixel is masked or has alpha less than specified - // threshold - bool IsTransparent(int x, int y, - unsigned char threshold = wxIMAGE_ALPHA_THRESHOLD) const; - - // Mask functions - void SetMaskColour( unsigned char r, unsigned char g, unsigned char b ); - // Get the current mask colour or find a suitable colour - // returns true if using current mask colour - bool GetOrFindMaskColour( unsigned char *r, unsigned char *g, unsigned char *b ) const; - unsigned char GetMaskRed() const; - unsigned char GetMaskGreen() const; - unsigned char GetMaskBlue() const; - void SetMask( bool mask = true ); - bool HasMask() const; - -#if wxUSE_PALETTE - // Palette functions - bool HasPalette() const; - const wxPalette& GetPalette() const; - void SetPalette(const wxPalette& palette); -#endif // wxUSE_PALETTE - - // Option functions (arbitrary name/value mapping) - void SetOption(const wxString& name, const wxString& value); - void SetOption(const wxString& name, int value); - wxString GetOption(const wxString& name) const; - int GetOptionInt(const wxString& name) const; - bool HasOption(const wxString& name) const; - - unsigned long CountColours( unsigned long stopafter = (unsigned long) -1 ) const; - - // Computes the histogram of the image and fills a hash table, indexed - // with integer keys built as 0xRRGGBB, containing wxImageHistogramEntry - // objects. Each of them contains an 'index' (useful to build a palette - // with the image colours) and a 'value', which is the number of pixels - // in the image with that colour. - // Returned value: # of entries in the histogram - unsigned long ComputeHistogram( wxImageHistogram &h ) const; - - // Rotates the hue of each pixel of the image. angle is a double in the range - // -1.0..1.0 where -1.0 is -360 degrees and 1.0 is 360 degrees - void RotateHue(double angle); - - static wxList& GetHandlers() { return sm_handlers; } - static void AddHandler( wxImageHandler *handler ); - static void InsertHandler( wxImageHandler *handler ); - static bool RemoveHandler( const wxString& name ); - static wxImageHandler *FindHandler( const wxString& name ); - static wxImageHandler *FindHandler( const wxString& extension, long imageType ); - static wxImageHandler *FindHandler( long imageType ); - static wxImageHandler *FindHandlerMime( const wxString& mimetype ); - - static wxString GetImageExtWildcard(); - - static void CleanUpHandlers(); - static void InitStandardHandlers(); - - static HSVValue RGBtoHSV(const RGBValue& rgb); - static RGBValue HSVtoRGB(const HSVValue& hsv); - - -protected: - static wxList sm_handlers; - - // return the index of the point with the given coordinates or -1 if the - // image is invalid of the coordinates are out of range - // - // note that index must be multiplied by 3 when using it with RGB array - long XYToIndex(int x, int y) const; - - virtual wxObjectRefData* CreateRefData() const; - virtual wxObjectRefData* CloneRefData(const wxObjectRefData* data) const; - -private: - friend class WXDLLIMPEXP_FWD_CORE wxImageHandler; - - DECLARE_DYNAMIC_CLASS(wxImage) -}; - - -extern void WXDLLEXPORT wxInitAllImageHandlers(); - -extern WXDLLEXPORT_DATA(wxImage) wxNullImage; - -//----------------------------------------------------------------------------- -// wxImage handlers -//----------------------------------------------------------------------------- - -#include "wx/imagbmp.h" -#include "wx/imagpng.h" -#include "wx/imaggif.h" -#include "wx/imagpcx.h" -#include "wx/imagjpeg.h" -#include "wx/imagtga.h" -#include "wx/imagtiff.h" -#include "wx/imagpnm.h" -#include "wx/imagxpm.h" -#include "wx/imagiff.h" - -#endif // wxUSE_IMAGE - -#endif - // _WX_IMAGE_H_ diff --git a/wxWidgets/include/wx/imaggif.h b/wxWidgets/include/wx/imaggif.h deleted file mode 100644 index 3a3e44db03..0000000000 --- a/wxWidgets/include/wx/imaggif.h +++ /dev/null @@ -1,48 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: imaggif.h -// Purpose: wxImage GIF handler -// Author: Vaclav Slavik & Guillermo Rodriguez Garcia -// RCS-ID: $Id: imaggif.h 37393 2006-02-08 21:47:09Z VZ $ -// Copyright: (c) Guillermo Rodriguez Garcia -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_IMAGGIF_H_ -#define _WX_IMAGGIF_H_ - -#include "wx/image.h" - - -//----------------------------------------------------------------------------- -// wxGIFHandler -//----------------------------------------------------------------------------- - -#if wxUSE_GIF - -class WXDLLEXPORT wxGIFHandler : public wxImageHandler -{ -public: - inline wxGIFHandler() - { - m_name = wxT("GIF file"); - m_extension = wxT("gif"); - m_type = wxBITMAP_TYPE_GIF; - m_mime = wxT("image/gif"); - } - -#if wxUSE_STREAMS - virtual bool LoadFile( wxImage *image, wxInputStream& stream, bool verbose=true, int index=-1 ); - virtual bool SaveFile( wxImage *image, wxOutputStream& stream, bool verbose=true ); -protected: - virtual bool DoCanRead( wxInputStream& stream ); -#endif - -private: - DECLARE_DYNAMIC_CLASS(wxGIFHandler) -}; -#endif - - -#endif - // _WX_IMAGGIF_H_ - diff --git a/wxWidgets/include/wx/imagiff.h b/wxWidgets/include/wx/imagiff.h deleted file mode 100644 index d7920c2c04..0000000000 --- a/wxWidgets/include/wx/imagiff.h +++ /dev/null @@ -1,44 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: imagiff.h -// Purpose: wxImage handler for Amiga IFF images -// Author: Steffen Gutmann -// RCS-ID: $Id: imagiff.h 35650 2005-09-23 12:56:45Z MR $ -// Copyright: (c) Steffen Gutmann, 2002 -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_IMAGE_IFF_H_ -#define _WX_IMAGE_IFF_H_ - -#include "wx/image.h" - -//----------------------------------------------------------------------------- -// wxIFFHandler -//----------------------------------------------------------------------------- - -#if wxUSE_IMAGE && wxUSE_IFF - -class WXDLLEXPORT wxIFFHandler : public wxImageHandler -{ -public: - wxIFFHandler() - { - m_name = wxT("IFF file"); - m_extension = wxT("iff"); - m_type = wxBITMAP_TYPE_IFF; - m_mime = wxT("image/x-iff"); - } - -#if wxUSE_STREAMS - virtual bool LoadFile(wxImage *image, wxInputStream& stream, bool verbose=true, int index=-1); - virtual bool SaveFile(wxImage *image, wxOutputStream& stream, bool verbose=true); - virtual bool DoCanRead(wxInputStream& stream); -#endif - -private: - DECLARE_DYNAMIC_CLASS(wxIFFHandler) -}; - -#endif // wxUSE_IMAGE && wxUSE_IFF - -#endif // _WX_IMAGE_IFF_H_ diff --git a/wxWidgets/include/wx/imagjpeg.h b/wxWidgets/include/wx/imagjpeg.h deleted file mode 100644 index 06880683ce..0000000000 --- a/wxWidgets/include/wx/imagjpeg.h +++ /dev/null @@ -1,48 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: imagjpeg.h -// Purpose: wxImage JPEG handler -// Author: Vaclav Slavik -// RCS-ID: $Id: imagjpeg.h 37393 2006-02-08 21:47:09Z VZ $ -// Copyright: (c) Vaclav Slavik -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_IMAGJPEG_H_ -#define _WX_IMAGJPEG_H_ - -#include "wx/defs.h" - -//----------------------------------------------------------------------------- -// wxJPEGHandler -//----------------------------------------------------------------------------- - -#if wxUSE_LIBJPEG - -#include "wx/image.h" - -class WXDLLEXPORT wxJPEGHandler: public wxImageHandler -{ -public: - inline wxJPEGHandler() - { - m_name = wxT("JPEG file"); - m_extension = wxT("jpg"); - m_type = wxBITMAP_TYPE_JPEG; - m_mime = wxT("image/jpeg"); - } - -#if wxUSE_STREAMS - virtual bool LoadFile( wxImage *image, wxInputStream& stream, bool verbose=true, int index=-1 ); - virtual bool SaveFile( wxImage *image, wxOutputStream& stream, bool verbose=true ); -protected: - virtual bool DoCanRead( wxInputStream& stream ); -#endif - -private: - DECLARE_DYNAMIC_CLASS(wxJPEGHandler) -}; - -#endif // wxUSE_LIBJPEG - -#endif // _WX_IMAGJPEG_H_ - diff --git a/wxWidgets/include/wx/imaglist.h b/wxWidgets/include/wx/imaglist.h deleted file mode 100644 index 7c3c24ea36..0000000000 --- a/wxWidgets/include/wx/imaglist.h +++ /dev/null @@ -1,55 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/imaglist.h -// Purpose: wxImageList base header -// Author: Julian Smart -// Modified by: -// Created: -// Copyright: (c) Julian Smart -// RCS-ID: $Id: imaglist.h 41288 2006-09-18 23:06:35Z VZ $ -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_IMAGLIST_H_BASE_ -#define _WX_IMAGLIST_H_BASE_ - -/* - * 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. - * - * Image lists can also create and draw images used for drag and drop functionality. - * This is not yet implemented in wxImageList. We need to discuss a generic API - * for doing drag and drop and see whether it ties in with the Win95 view of it. - * See below for candidate functions and an explanation of how they might be - * used. - */ - -// 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) -}; - -// Flags for Draw -#define wxIMAGELIST_DRAW_NORMAL 0x0001 -#define wxIMAGELIST_DRAW_TRANSPARENT 0x0002 -#define wxIMAGELIST_DRAW_SELECTED 0x0004 -#define wxIMAGELIST_DRAW_FOCUSED 0x0008 - -#if defined(__WXMSW__) || defined(__WXMAC_CARBON__) - #define wxHAS_NATIVE_IMAGELIST -#endif - -#if !defined(wxHAS_NATIVE_IMAGELIST) - #include "wx/generic/imaglist.h" -#elif defined(__WXMSW__) - #include "wx/msw/imaglist.h" -#elif defined(__WXMAC_CARBON__) - #include "wx/mac/imaglist.h" -#endif - -#endif // _WX_IMAGLIST_H_BASE_ diff --git a/wxWidgets/include/wx/imagpcx.h b/wxWidgets/include/wx/imagpcx.h deleted file mode 100644 index c35fe0973f..0000000000 --- a/wxWidgets/include/wx/imagpcx.h +++ /dev/null @@ -1,47 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: imagpcx.h -// Purpose: wxImage PCX handler -// Author: Guillermo Rodriguez Garcia <guille@iies.es> -// RCS-ID: $Id: imagpcx.h 37393 2006-02-08 21:47:09Z VZ $ -// Copyright: (c) 1999 Guillermo Rodriguez Garcia -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_IMAGPCX_H_ -#define _WX_IMAGPCX_H_ - -#include "wx/image.h" - - -//----------------------------------------------------------------------------- -// wxPCXHandler -//----------------------------------------------------------------------------- - -#if wxUSE_PCX -class WXDLLEXPORT wxPCXHandler : public wxImageHandler -{ -public: - inline wxPCXHandler() - { - m_name = wxT("PCX file"); - m_extension = wxT("pcx"); - m_type = wxBITMAP_TYPE_PCX; - m_mime = wxT("image/pcx"); - } - -#if wxUSE_STREAMS - virtual bool LoadFile( wxImage *image, wxInputStream& stream, bool verbose=true, int index=-1 ); - virtual bool SaveFile( wxImage *image, wxOutputStream& stream, bool verbose=true ); -protected: - virtual bool DoCanRead( wxInputStream& stream ); -#endif // wxUSE_STREAMS - -private: - DECLARE_DYNAMIC_CLASS(wxPCXHandler) -}; -#endif // wxUSE_PCX - - -#endif - // _WX_IMAGPCX_H_ - diff --git a/wxWidgets/include/wx/imagpng.h b/wxWidgets/include/wx/imagpng.h deleted file mode 100644 index 5252e3aa0a..0000000000 --- a/wxWidgets/include/wx/imagpng.h +++ /dev/null @@ -1,60 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: imagpng.h -// Purpose: wxImage PNG handler -// Author: Robert Roebling -// RCS-ID: $Id: imagpng.h 37393 2006-02-08 21:47:09Z VZ $ -// Copyright: (c) Robert Roebling -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_IMAGPNG_H_ -#define _WX_IMAGPNG_H_ - -#include "wx/defs.h" - -//----------------------------------------------------------------------------- -// wxPNGHandler -//----------------------------------------------------------------------------- - -#if wxUSE_LIBPNG - -#include "wx/image.h" - -#define wxIMAGE_OPTION_PNG_FORMAT wxT("PngFormat") -#define wxIMAGE_OPTION_PNG_BITDEPTH wxT("PngBitDepth") - -enum -{ - wxPNG_TYPE_COLOUR = 0, - wxPNG_TYPE_GREY = 2, - wxPNG_TYPE_GREY_RED = 3 -}; - -class WXDLLEXPORT wxPNGHandler: public wxImageHandler -{ -public: - inline wxPNGHandler() - { - m_name = wxT("PNG file"); - m_extension = wxT("png"); - m_type = wxBITMAP_TYPE_PNG; - m_mime = wxT("image/png"); - } - -#if wxUSE_STREAMS - virtual bool LoadFile( wxImage *image, wxInputStream& stream, bool verbose=true, int index=-1 ); - virtual bool SaveFile( wxImage *image, wxOutputStream& stream, bool verbose=true ); -protected: - virtual bool DoCanRead( wxInputStream& stream ); -#endif - -private: - DECLARE_DYNAMIC_CLASS(wxPNGHandler) -}; - -#endif - // wxUSE_LIBPNG - -#endif - // _WX_IMAGPNG_H_ - diff --git a/wxWidgets/include/wx/imagpnm.h b/wxWidgets/include/wx/imagpnm.h deleted file mode 100644 index e6f5a50aec..0000000000 --- a/wxWidgets/include/wx/imagpnm.h +++ /dev/null @@ -1,46 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: imagpnm.h -// Purpose: wxImage PNM handler -// Author: Sylvain Bougnoux -// RCS-ID: $Id: imagpnm.h 37393 2006-02-08 21:47:09Z VZ $ -// Copyright: (c) Sylvain Bougnoux -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_IMAGPNM_H_ -#define _WX_IMAGPNM_H_ - -#include "wx/image.h" - -//----------------------------------------------------------------------------- -// wxPNMHandler -//----------------------------------------------------------------------------- - -#if wxUSE_PNM -class WXDLLEXPORT wxPNMHandler : public wxImageHandler -{ -public: - inline wxPNMHandler() - { - m_name = wxT("PNM file"); - m_extension = wxT("pnm"); - m_type = wxBITMAP_TYPE_PNM; - m_mime = wxT("image/pnm"); - } - -#if wxUSE_STREAMS - virtual bool LoadFile( wxImage *image, wxInputStream& stream, bool verbose=true, int index=-1 ); - virtual bool SaveFile( wxImage *image, wxOutputStream& stream, bool verbose=true ); -protected: - virtual bool DoCanRead( wxInputStream& stream ); -#endif - -private: - DECLARE_DYNAMIC_CLASS(wxPNMHandler) -}; -#endif - - -#endif - // _WX_IMAGPNM_H_ - diff --git a/wxWidgets/include/wx/imagtga.h b/wxWidgets/include/wx/imagtga.h deleted file mode 100644 index 3eec26e0c0..0000000000 --- a/wxWidgets/include/wx/imagtga.h +++ /dev/null @@ -1,46 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/imagtga.h -// Purpose: wxImage TGA handler -// Author: Seth Jackson -// RCS-ID: $Id: imagtga.h 43843 2006-12-07 05:44:44Z PC $ -// Copyright: (c) 2005 Seth Jackson -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_IMAGTGA_H_ -#define _WX_IMAGTGA_H_ - -#include "wx/image.h" - -//----------------------------------------------------------------------------- -// wxTGAHandler -//----------------------------------------------------------------------------- - -#if wxUSE_TGA - -class WXDLLEXPORT wxTGAHandler : public wxImageHandler -{ -public: - wxTGAHandler() - { - m_name = wxT("TGA file"); - m_extension = wxT("tga"); - m_type = wxBITMAP_TYPE_TGA; - m_mime = wxT("image/tga"); - } - -#if wxUSE_STREAMS - virtual bool LoadFile(wxImage* image, wxInputStream& stream, - bool verbose = true, int index = -1); - virtual bool SaveFile(wxImage* image, wxOutputStream& stream, - bool verbose = true); -protected: - virtual bool DoCanRead(wxInputStream& stream); -#endif // wxUSE_STREAMS - - DECLARE_DYNAMIC_CLASS(wxTGAHandler) -}; - -#endif // wxUSE_TGA - -#endif // _WX_IMAGTGA_H_ diff --git a/wxWidgets/include/wx/imagtiff.h b/wxWidgets/include/wx/imagtiff.h deleted file mode 100644 index 2716cf5e82..0000000000 --- a/wxWidgets/include/wx/imagtiff.h +++ /dev/null @@ -1,49 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: imagtiff.h -// Purpose: wxImage TIFF handler -// Author: Robert Roebling -// RCS-ID: $Id: imagtiff.h 61872 2009-09-09 22:37:05Z VZ $ -// Copyright: (c) Robert Roebling -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_IMAGTIFF_H_ -#define _WX_IMAGTIFF_H_ - -#include "wx/defs.h" - -//----------------------------------------------------------------------------- -// wxTIFFHandler -//----------------------------------------------------------------------------- - -#if wxUSE_LIBTIFF - -#include "wx/image.h" - -// defines for wxImage::SetOption -#define wxIMAGE_OPTION_BITSPERSAMPLE wxString(wxT("BitsPerSample")) -#define wxIMAGE_OPTION_SAMPLESPERPIXEL wxString(wxT("SamplesPerPixel")) -#define wxIMAGE_OPTION_COMPRESSION wxString(wxT("Compression")) -#define wxIMAGE_OPTION_IMAGEDESCRIPTOR wxString(wxT("ImageDescriptor")) - -class WXDLLEXPORT wxTIFFHandler: public wxImageHandler -{ -public: - wxTIFFHandler(); - -#if wxUSE_STREAMS - virtual bool LoadFile( wxImage *image, wxInputStream& stream, bool verbose=true, int index=-1 ); - virtual bool SaveFile( wxImage *image, wxOutputStream& stream, bool verbose=true ); - virtual int GetImageCount( wxInputStream& stream ); -protected: - virtual bool DoCanRead( wxInputStream& stream ); -#endif - -private: - DECLARE_DYNAMIC_CLASS(wxTIFFHandler) -}; - -#endif // wxUSE_LIBTIFF - -#endif // _WX_IMAGTIFF_H_ - diff --git a/wxWidgets/include/wx/imagxpm.h b/wxWidgets/include/wx/imagxpm.h deleted file mode 100644 index 6982e77afc..0000000000 --- a/wxWidgets/include/wx/imagxpm.h +++ /dev/null @@ -1,45 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: imaggif.h -// Purpose: wxImage XPM handler -// Author: Vaclav Slavik -// RCS-ID: $Id: imagxpm.h 37393 2006-02-08 21:47:09Z VZ $ -// Copyright: (c) 2001 Vaclav Slavik -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_IMAGXPM_H_ -#define _WX_IMAGXPM_H_ - -#include "wx/image.h" - - -//----------------------------------------------------------------------------- -// wxXPMHandler -//----------------------------------------------------------------------------- - -class WXDLLEXPORT wxXPMHandler : public wxImageHandler -{ -public: - inline wxXPMHandler() - { - m_name = wxT("XPM file"); - m_extension = wxT("xpm"); - m_type = wxBITMAP_TYPE_XPM; - m_mime = wxT("image/xpm"); - } - -#if wxUSE_STREAMS - virtual bool LoadFile( wxImage *image, wxInputStream& stream, bool verbose=true, int index=-1 ); - virtual bool SaveFile( wxImage *image, wxOutputStream& stream, bool verbose=true ); -protected: - virtual bool DoCanRead( wxInputStream& stream ); -#endif - -private: - DECLARE_DYNAMIC_CLASS(wxXPMHandler) -}; - - -#endif - // _WX_IMAGXPM_H_ - diff --git a/wxWidgets/include/wx/init.h b/wxWidgets/include/wx/init.h deleted file mode 100644 index fe4d827cd5..0000000000 --- a/wxWidgets/include/wx/init.h +++ /dev/null @@ -1,105 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: wx/init.h -// Purpose: wxWidgets initialization and finalization functions -// Author: Vadim Zeitlin -// Modified by: -// Created: 29.06.2003 -// RCS-ID: $Id: init.h 61558 2009-07-30 10:14:36Z VS $ -// Copyright: (c) 2003 Vadim Zeitlin <vadim@wxwidgets.org> -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_INIT_H_ -#define _WX_INIT_H_ - -#include "wx/defs.h" -#include "wx/wxchar.h" - -// ---------------------------------------------------------------------------- -// wxEntry helper functions which allow to have more fine grained control -// ---------------------------------------------------------------------------- - -// do common initialization, return true if ok (in this case wxEntryCleanup -// must be called later), otherwise the program can't use wxWidgets at all -// -// this function also creates wxTheApp as a side effect, if IMPLEMENT_APP -// hadn't been used a dummy default application object is created -// -// note that the parameters may be modified, this is why we pass them by -// reference! -extern bool WXDLLIMPEXP_BASE wxEntryStart(int& argc, wxChar **argv); - -// free the resources allocated by the library in wxEntryStart() and shut it -// down (wxEntryStart() may be called again afterwards if necessary) -extern void WXDLLIMPEXP_BASE wxEntryCleanup(); - - -// ---------------------------------------------------------------------------- -// wxEntry: this function initializes the library, runs the main event loop -// and cleans it up -// ---------------------------------------------------------------------------- - -// note that other, platform-specific, overloads of wxEntry may exist as well -// but this one always exists under all platforms -// -// returns the program exit code -extern int WXDLLIMPEXP_BASE wxEntry(int& argc, wxChar **argv); - -// we overload wxEntry[Start]() to take "char **" pointers too -#if wxUSE_UNICODE - -extern bool WXDLLIMPEXP_BASE wxEntryStart(int& argc, char **argv); -extern int WXDLLIMPEXP_BASE wxEntry(int& argc, char **argv); - -#endif// wxUSE_UNICODE - -// ---------------------------------------------------------------------------- -// Using the library without (explicit) application object: you may avoid using -// DECLARE_APP and IMPLEMENT_APP macros and call the functions below instead at -// the program startup and termination -// ---------------------------------------------------------------------------- - -// initialize the library (may be called as many times as needed, but each -// call to wxInitialize() must be matched by wxUninitialize()) -extern bool WXDLLIMPEXP_BASE wxInitialize(int argc = 0, wxChar **argv = NULL); -#if wxUSE_UNICODE && wxABI_VERSION >= 20811 -extern bool WXDLLIMPEXP_BASE wxInitialize(int argc, char **argv); -#endif - -// clean up -- the library can't be used any more after the last call to -// wxUninitialize() -extern void WXDLLIMPEXP_BASE wxUninitialize(); - -// create an object of this class on stack to initialize/cleanup the library -// automatically -class WXDLLIMPEXP_BASE wxInitializer -{ -public: - // initialize the library - wxInitializer(int argc = 0, wxChar **argv = NULL) - { - m_ok = wxInitialize(argc, argv); - } - -#if wxUSE_UNICODE && wxABI_VERSION >= 20811 - wxInitializer(int argc, char **argv) - { - m_ok = wxInitialize(argc, argv); - } -#endif // wxUSE_UNICODE - - // has the initialization been successful? (explicit test) - bool IsOk() const { return m_ok; } - - // has the initialization been successful? (implicit test) - operator bool() const { return m_ok; } - - // dtor only does clean up if we initialized the library properly - ~wxInitializer() { if ( m_ok ) wxUninitialize(); } - -private: - bool m_ok; -}; - -#endif // _WX_INIT_H_ - diff --git a/wxWidgets/include/wx/intl.h b/wxWidgets/include/wx/intl.h deleted file mode 100644 index d84d383389..0000000000 --- a/wxWidgets/include/wx/intl.h +++ /dev/null @@ -1,632 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/intl.h -// Purpose: Internationalization and localisation for wxWidgets -// Author: Vadim Zeitlin -// Modified by: Michael N. Filippov <michael@idisys.iae.nsk.su> -// (2003/09/30 - plural forms support) -// Created: 29/01/98 -// RCS-ID: $Id: intl.h 61872 2009-09-09 22:37:05Z VZ $ -// Copyright: (c) 1998 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr> -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// WARNING: Parts of this file are generated. See misc/languages/README for -// details. - -#ifndef _WX_INTL_H_ -#define _WX_INTL_H_ - -#include "wx/defs.h" -#include "wx/string.h" - -// Make wxLayoutDirection enum available without need for wxUSE_INTL so wxWindow, wxApp -// and other classes are not distrubed by wxUSE_INTL - -enum wxLayoutDirection -{ - wxLayout_Default, - wxLayout_LeftToRight, - wxLayout_RightToLeft -}; - -#if wxUSE_INTL - -#include "wx/fontenc.h" - -// ============================================================================ -// global decls -// ============================================================================ - -// ---------------------------------------------------------------------------- -// macros -// ---------------------------------------------------------------------------- - -// gettext() style macros (notice that xgettext should be invoked with -// --keyword="_" --keyword="wxPLURAL:1,2" options -// to extract the strings from the sources) -#ifndef WXINTL_NO_GETTEXT_MACRO - #define _(s) wxGetTranslation(wxT(s)) - #define wxPLURAL(sing, plur, n) wxGetTranslation(wxT(sing), wxT(plur), n) -#endif - -// another one which just marks the strings for extraction, but doesn't -// perform the translation (use -kwxTRANSLATE with xgettext!) -#define wxTRANSLATE(str) wxT(str) - -// ---------------------------------------------------------------------------- -// forward decls -// ---------------------------------------------------------------------------- - -class WXDLLIMPEXP_FWD_BASE wxLocale; -class WXDLLIMPEXP_FWD_BASE wxLanguageInfoArray; -class wxMsgCatalog; - -// ============================================================================ -// locale support -// ============================================================================ - -// ---------------------------------------------------------------------------- -// wxLanguage: defines all supported languages -// ---------------------------------------------------------------------------- - -// --- --- --- generated code begins here --- --- --- - -// This enum is generated by misc/languages/genlang.py -// When making changes, please put them into misc/languages/langtabl.txt -enum wxLanguage -{ - // user's default/preffered language as got from OS: - wxLANGUAGE_DEFAULT, - // unknown language, if wxLocale::GetSystemLanguage fails: - wxLANGUAGE_UNKNOWN, - - wxLANGUAGE_ABKHAZIAN, - wxLANGUAGE_AFAR, - wxLANGUAGE_AFRIKAANS, - wxLANGUAGE_ALBANIAN, - wxLANGUAGE_AMHARIC, - wxLANGUAGE_ARABIC, - wxLANGUAGE_ARABIC_ALGERIA, - wxLANGUAGE_ARABIC_BAHRAIN, - wxLANGUAGE_ARABIC_EGYPT, - wxLANGUAGE_ARABIC_IRAQ, - wxLANGUAGE_ARABIC_JORDAN, - wxLANGUAGE_ARABIC_KUWAIT, - wxLANGUAGE_ARABIC_LEBANON, - wxLANGUAGE_ARABIC_LIBYA, - wxLANGUAGE_ARABIC_MOROCCO, - wxLANGUAGE_ARABIC_OMAN, - wxLANGUAGE_ARABIC_QATAR, - wxLANGUAGE_ARABIC_SAUDI_ARABIA, - wxLANGUAGE_ARABIC_SUDAN, - wxLANGUAGE_ARABIC_SYRIA, - wxLANGUAGE_ARABIC_TUNISIA, - wxLANGUAGE_ARABIC_UAE, - wxLANGUAGE_ARABIC_YEMEN, - wxLANGUAGE_ARMENIAN, - wxLANGUAGE_ASSAMESE, - wxLANGUAGE_AYMARA, - wxLANGUAGE_AZERI, - wxLANGUAGE_AZERI_CYRILLIC, - wxLANGUAGE_AZERI_LATIN, - wxLANGUAGE_BASHKIR, - wxLANGUAGE_BASQUE, - wxLANGUAGE_BELARUSIAN, - wxLANGUAGE_BENGALI, - wxLANGUAGE_BHUTANI, - wxLANGUAGE_BIHARI, - wxLANGUAGE_BISLAMA, - wxLANGUAGE_BRETON, - wxLANGUAGE_BULGARIAN, - wxLANGUAGE_BURMESE, - wxLANGUAGE_CAMBODIAN, - wxLANGUAGE_CATALAN, - wxLANGUAGE_CHINESE, - wxLANGUAGE_CHINESE_SIMPLIFIED, - wxLANGUAGE_CHINESE_TRADITIONAL, - wxLANGUAGE_CHINESE_HONGKONG, - wxLANGUAGE_CHINESE_MACAU, - wxLANGUAGE_CHINESE_SINGAPORE, - wxLANGUAGE_CHINESE_TAIWAN, - wxLANGUAGE_CORSICAN, - wxLANGUAGE_CROATIAN, - wxLANGUAGE_CZECH, - wxLANGUAGE_DANISH, - wxLANGUAGE_DUTCH, - wxLANGUAGE_DUTCH_BELGIAN, - wxLANGUAGE_ENGLISH, - wxLANGUAGE_ENGLISH_UK, - wxLANGUAGE_ENGLISH_US, - wxLANGUAGE_ENGLISH_AUSTRALIA, - wxLANGUAGE_ENGLISH_BELIZE, - wxLANGUAGE_ENGLISH_BOTSWANA, - wxLANGUAGE_ENGLISH_CANADA, - wxLANGUAGE_ENGLISH_CARIBBEAN, - wxLANGUAGE_ENGLISH_DENMARK, - wxLANGUAGE_ENGLISH_EIRE, - wxLANGUAGE_ENGLISH_JAMAICA, - wxLANGUAGE_ENGLISH_NEW_ZEALAND, - wxLANGUAGE_ENGLISH_PHILIPPINES, - wxLANGUAGE_ENGLISH_SOUTH_AFRICA, - wxLANGUAGE_ENGLISH_TRINIDAD, - wxLANGUAGE_ENGLISH_ZIMBABWE, - wxLANGUAGE_ESPERANTO, - wxLANGUAGE_ESTONIAN, - wxLANGUAGE_FAEROESE, - wxLANGUAGE_FARSI, - wxLANGUAGE_FIJI, - wxLANGUAGE_FINNISH, - wxLANGUAGE_FRENCH, - wxLANGUAGE_FRENCH_BELGIAN, - wxLANGUAGE_FRENCH_CANADIAN, - wxLANGUAGE_FRENCH_LUXEMBOURG, - wxLANGUAGE_FRENCH_MONACO, - wxLANGUAGE_FRENCH_SWISS, - wxLANGUAGE_FRISIAN, - wxLANGUAGE_GALICIAN, - wxLANGUAGE_GEORGIAN, - wxLANGUAGE_GERMAN, - wxLANGUAGE_GERMAN_AUSTRIAN, - wxLANGUAGE_GERMAN_BELGIUM, - wxLANGUAGE_GERMAN_LIECHTENSTEIN, - wxLANGUAGE_GERMAN_LUXEMBOURG, - wxLANGUAGE_GERMAN_SWISS, - wxLANGUAGE_GREEK, - wxLANGUAGE_GREENLANDIC, - wxLANGUAGE_GUARANI, - wxLANGUAGE_GUJARATI, - wxLANGUAGE_HAUSA, - wxLANGUAGE_HEBREW, - wxLANGUAGE_HINDI, - wxLANGUAGE_HUNGARIAN, - wxLANGUAGE_ICELANDIC, - wxLANGUAGE_INDONESIAN, - wxLANGUAGE_INTERLINGUA, - wxLANGUAGE_INTERLINGUE, - wxLANGUAGE_INUKTITUT, - wxLANGUAGE_INUPIAK, - wxLANGUAGE_IRISH, - wxLANGUAGE_ITALIAN, - wxLANGUAGE_ITALIAN_SWISS, - wxLANGUAGE_JAPANESE, - wxLANGUAGE_JAVANESE, - wxLANGUAGE_KANNADA, - wxLANGUAGE_KASHMIRI, - wxLANGUAGE_KASHMIRI_INDIA, - wxLANGUAGE_KAZAKH, - wxLANGUAGE_KERNEWEK, - wxLANGUAGE_KINYARWANDA, - wxLANGUAGE_KIRGHIZ, - wxLANGUAGE_KIRUNDI, - wxLANGUAGE_KONKANI, - wxLANGUAGE_KOREAN, - wxLANGUAGE_KURDISH, - wxLANGUAGE_LAOTHIAN, - wxLANGUAGE_LATIN, - wxLANGUAGE_LATVIAN, - wxLANGUAGE_LINGALA, - wxLANGUAGE_LITHUANIAN, - wxLANGUAGE_MACEDONIAN, - wxLANGUAGE_MALAGASY, - wxLANGUAGE_MALAY, - wxLANGUAGE_MALAYALAM, - wxLANGUAGE_MALAY_BRUNEI_DARUSSALAM, - wxLANGUAGE_MALAY_MALAYSIA, - wxLANGUAGE_MALTESE, - wxLANGUAGE_MANIPURI, - wxLANGUAGE_MAORI, - wxLANGUAGE_MARATHI, - wxLANGUAGE_MOLDAVIAN, - wxLANGUAGE_MONGOLIAN, - wxLANGUAGE_NAURU, - wxLANGUAGE_NEPALI, - wxLANGUAGE_NEPALI_INDIA, - wxLANGUAGE_NORWEGIAN_BOKMAL, - wxLANGUAGE_NORWEGIAN_NYNORSK, - wxLANGUAGE_OCCITAN, - wxLANGUAGE_ORIYA, - wxLANGUAGE_OROMO, - wxLANGUAGE_PASHTO, - wxLANGUAGE_POLISH, - wxLANGUAGE_PORTUGUESE, - wxLANGUAGE_PORTUGUESE_BRAZILIAN, - wxLANGUAGE_PUNJABI, - wxLANGUAGE_QUECHUA, - wxLANGUAGE_RHAETO_ROMANCE, - wxLANGUAGE_ROMANIAN, - wxLANGUAGE_RUSSIAN, - wxLANGUAGE_RUSSIAN_UKRAINE, - wxLANGUAGE_SAMOAN, - wxLANGUAGE_SANGHO, - wxLANGUAGE_SANSKRIT, - wxLANGUAGE_SCOTS_GAELIC, - wxLANGUAGE_SERBIAN, - wxLANGUAGE_SERBIAN_CYRILLIC, - wxLANGUAGE_SERBIAN_LATIN, - wxLANGUAGE_SERBO_CROATIAN, - wxLANGUAGE_SESOTHO, - wxLANGUAGE_SETSWANA, - wxLANGUAGE_SHONA, - wxLANGUAGE_SINDHI, - wxLANGUAGE_SINHALESE, - wxLANGUAGE_SISWATI, - wxLANGUAGE_SLOVAK, - wxLANGUAGE_SLOVENIAN, - wxLANGUAGE_SOMALI, - wxLANGUAGE_SPANISH, - wxLANGUAGE_SPANISH_ARGENTINA, - wxLANGUAGE_SPANISH_BOLIVIA, - wxLANGUAGE_SPANISH_CHILE, - wxLANGUAGE_SPANISH_COLOMBIA, - wxLANGUAGE_SPANISH_COSTA_RICA, - wxLANGUAGE_SPANISH_DOMINICAN_REPUBLIC, - wxLANGUAGE_SPANISH_ECUADOR, - wxLANGUAGE_SPANISH_EL_SALVADOR, - wxLANGUAGE_SPANISH_GUATEMALA, - wxLANGUAGE_SPANISH_HONDURAS, - wxLANGUAGE_SPANISH_MEXICAN, - wxLANGUAGE_SPANISH_MODERN, - wxLANGUAGE_SPANISH_NICARAGUA, - wxLANGUAGE_SPANISH_PANAMA, - wxLANGUAGE_SPANISH_PARAGUAY, - wxLANGUAGE_SPANISH_PERU, - wxLANGUAGE_SPANISH_PUERTO_RICO, - wxLANGUAGE_SPANISH_URUGUAY, - wxLANGUAGE_SPANISH_US, - wxLANGUAGE_SPANISH_VENEZUELA, - wxLANGUAGE_SUNDANESE, - wxLANGUAGE_SWAHILI, - wxLANGUAGE_SWEDISH, - wxLANGUAGE_SWEDISH_FINLAND, - wxLANGUAGE_TAGALOG, - wxLANGUAGE_TAJIK, - wxLANGUAGE_TAMIL, - wxLANGUAGE_TATAR, - wxLANGUAGE_TELUGU, - wxLANGUAGE_THAI, - wxLANGUAGE_TIBETAN, - wxLANGUAGE_TIGRINYA, - wxLANGUAGE_TONGA, - wxLANGUAGE_TSONGA, - wxLANGUAGE_TURKISH, - wxLANGUAGE_TURKMEN, - wxLANGUAGE_TWI, - wxLANGUAGE_UIGHUR, - wxLANGUAGE_UKRAINIAN, - wxLANGUAGE_URDU, - wxLANGUAGE_URDU_INDIA, - wxLANGUAGE_URDU_PAKISTAN, - wxLANGUAGE_UZBEK, - wxLANGUAGE_UZBEK_CYRILLIC, - wxLANGUAGE_UZBEK_LATIN, - wxLANGUAGE_VIETNAMESE, - wxLANGUAGE_VOLAPUK, - wxLANGUAGE_WELSH, - wxLANGUAGE_WOLOF, - wxLANGUAGE_XHOSA, - wxLANGUAGE_YIDDISH, - wxLANGUAGE_YORUBA, - wxLANGUAGE_ZHUANG, - wxLANGUAGE_ZULU, - - // for custom, user-defined languages: - wxLANGUAGE_USER_DEFINED - - -#if wxABI_VERSION >= 20808 - // For binary compatibility, we can't put new items in their normal - // position in the enum, because it would change other values. We have to - // put it somewhere well outside normal range -- the particular value used - // is arbitrary: - , wxLANGUAGE_VALENCIAN = 0x1fffffff, - wxLANGUAGE_SAMI -#endif -}; - -// --- --- --- generated code ends here --- --- --- - -// ---------------------------------------------------------------------------- -// wxLanguageInfo: encapsulates wxLanguage to OS native lang.desc. -// translation information -// ---------------------------------------------------------------------------- - -struct WXDLLIMPEXP_BASE wxLanguageInfo -{ - int Language; // wxLanguage id - wxString CanonicalName; // Canonical name, e.g. fr_FR -#ifdef __WIN32__ - wxUint32 WinLang, // Win32 language identifiers - WinSublang; -#endif // __WIN32__ - wxString Description; // human-readable name of the language - wxLayoutDirection LayoutDirection; -}; - -// ---------------------------------------------------------------------------- -// wxLocaleCategory: the category of locale settings -// ---------------------------------------------------------------------------- - -enum wxLocaleCategory -{ - // (any) numbers - wxLOCALE_CAT_NUMBER, - - // date/time - wxLOCALE_CAT_DATE, - - // monetary value - wxLOCALE_CAT_MONEY, - - wxLOCALE_CAT_MAX -}; - -// ---------------------------------------------------------------------------- -// wxLocaleInfo: the items understood by wxLocale::GetInfo() -// ---------------------------------------------------------------------------- - -enum wxLocaleInfo -{ - // the thounsands separator - wxLOCALE_THOUSANDS_SEP, - - // the character used as decimal point - wxLOCALE_DECIMAL_POINT - -}; - -// ---------------------------------------------------------------------------- -// wxLocale: encapsulates all language dependent settings, including current -// message catalogs, date, time and currency formats (TODO) &c -// ---------------------------------------------------------------------------- - -enum wxLocaleInitFlags -{ - wxLOCALE_LOAD_DEFAULT = 0x0001, // load wxwin.mo? - wxLOCALE_CONV_ENCODING = 0x0002 // convert encoding on the fly? -}; - -class WXDLLIMPEXP_BASE wxLocale -{ -public: - // ctor & dtor - // ----------- - - // call Init() if you use this ctor - wxLocale() { DoCommonInit(); } - - // the ctor has a side effect of changing current locale - wxLocale(const wxChar *szName, // name (for messages) - const wxChar *szShort = (const wxChar *) NULL, // dir prefix (for msg files) - const wxChar *szLocale = (const wxChar *) NULL, // locale (for setlocale) - bool bLoadDefault = true, // preload wxstd.mo? - bool bConvertEncoding = false) // convert Win<->Unix if necessary? - { - DoCommonInit(); - - Init(szName, szShort, szLocale, bLoadDefault, bConvertEncoding); - } - - wxLocale(int language, // wxLanguage id or custom language - int flags = wxLOCALE_LOAD_DEFAULT | wxLOCALE_CONV_ENCODING) - { - DoCommonInit(); - - Init(language, flags); - } - - // the same as a function (returns true on success) - bool Init(const wxChar *szName, - const wxChar *szShort = (const wxChar *) NULL, - const wxChar *szLocale = (const wxChar *) NULL, - bool bLoadDefault = true, - bool bConvertEncoding = false); - - // same as second ctor (returns true on success) - bool Init(int language = wxLANGUAGE_DEFAULT, - int flags = wxLOCALE_LOAD_DEFAULT | wxLOCALE_CONV_ENCODING); - - // restores old locale - virtual ~wxLocale(); - - // Try to get user's (or OS's) preferred language setting. - // Return wxLANGUAGE_UNKNOWN if language-guessing algorithm failed - static int GetSystemLanguage(); - - // get the encoding used by default for text on this system, returns - // wxFONTENCODING_SYSTEM if it couldn't be determined - static wxFontEncoding GetSystemEncoding(); - - // get the string describing the system encoding, return empty string if - // couldn't be determined - static wxString GetSystemEncodingName(); - - // get the values of the given locale-dependent datum: the current locale - // is used, the US default value is returned if everything else fails - static wxString GetInfo(wxLocaleInfo index, wxLocaleCategory cat); - - // return true if the locale was set successfully - bool IsOk() const { return m_pszOldLocale != NULL; } - - // returns locale name - const wxChar *GetLocale() const { return m_strLocale; } - - // return current locale wxLanguage value - int GetLanguage() const { return m_language; } - - // return locale name to be passed to setlocale() - wxString GetSysName() const; - - // return 'canonical' name, i.e. in the form of xx[_YY], where xx is - // language code according to ISO 639 and YY is country name - // as specified by ISO 3166. - wxString GetCanonicalName() const { return m_strShort; } - - // add a prefix to the catalog lookup path: the message catalog files will be - // looked up under prefix/<lang>/LC_MESSAGES, prefix/LC_MESSAGES and prefix - // (in this order). - // - // This only applies to subsequent invocations of AddCatalog()! - static void AddCatalogLookupPathPrefix(const wxString& prefix); - - // add a catalog: it's searched for in standard places (current directory - // first, system one after), but the you may prepend additional directories to - // the search path with AddCatalogLookupPathPrefix(). - // - // The loaded catalog will be used for message lookup by GetString(). - // - // Returns 'true' if it was successfully loaded - bool AddCatalog(const wxChar *szDomain); - bool AddCatalog(const wxChar *szDomain, - wxLanguage msgIdLanguage, const wxChar *msgIdCharset); - - // check if the given locale is provided by OS and C run time - static bool IsAvailable(int lang); - - // check if the given catalog is loaded - bool IsLoaded(const wxChar *szDomain) const; - - // Retrieve the language info struct for the given language - // - // Returns NULL if no info found, pointer must *not* be deleted by caller - static const wxLanguageInfo *GetLanguageInfo(int lang); - - // Returns language name in English or empty string if the language - // is not in database - static wxString GetLanguageName(int lang); - - // Find the language for the given locale string which may be either a - // canonical ISO 2 letter language code ("xx"), a language code followed by - // the country code ("xx_XX") or a Windows full language name ("Xxxxx...") - // - // Returns NULL if no info found, pointer must *not* be deleted by caller - static const wxLanguageInfo *FindLanguageInfo(const wxString& locale); - - // Add custom language to the list of known languages. - // Notes: 1) wxLanguageInfo contains platform-specific data - // 2) must be called before Init to have effect - static void AddLanguage(const wxLanguageInfo& info); - - // retrieve the translation for a string in all loaded domains unless - // the szDomain parameter is specified (and then only this domain is - // searched) - // n - additional parameter for PluralFormsParser - // - // return original string if translation is not available - // (in this case an error message is generated the first time - // a string is not found; use wxLogNull to suppress it) - // - // domains are searched in the last to first order, i.e. catalogs - // added later override those added before. - virtual const wxChar *GetString(const wxChar *szOrigString, - const wxChar *szDomain = NULL) const; - // plural form version of the same: - virtual const wxChar *GetString(const wxChar *szOrigString, - const wxChar *szOrigString2, - size_t n, - const wxChar *szDomain = NULL) const; - - // Returns the current short name for the locale - const wxString& GetName() const { return m_strShort; } - - // return the contents of .po file header - wxString GetHeaderValue( const wxChar* szHeader, - const wxChar* szDomain = NULL ) const; - - // These two methods are for internal use only. First one creates - // ms_languagesDB if it doesn't already exist, second one destroys - // it. - static void CreateLanguagesDB(); - static void DestroyLanguagesDB(); - -private: - // find catalog by name in a linked list, return NULL if !found - wxMsgCatalog *FindCatalog(const wxChar *szDomain) const; - - // copy default table of languages from global static array to - // m_langugagesInfo, called by InitLanguagesDB - static void InitLanguagesDB(); - - // initialize the member fields to default values - void DoCommonInit(); - - wxString m_strLocale, // this locale name - m_strShort; // short name for the locale - int m_language; // this locale wxLanguage value - - const wxChar *m_pszOldLocale; // previous locale from setlocale() - wxLocale *m_pOldLocale; // previous wxLocale - - wxMsgCatalog *m_pMsgCat; // pointer to linked list of catalogs - - bool m_bConvertEncoding; - - bool m_initialized; - - static wxLanguageInfoArray *ms_languagesDB; - - DECLARE_NO_COPY_CLASS(wxLocale) -}; - -// ---------------------------------------------------------------------------- -// global functions -// ---------------------------------------------------------------------------- - -// get the current locale object (note that it may be NULL!) -extern WXDLLIMPEXP_BASE wxLocale* wxGetLocale(); - -// get the translation of the string in the current locale -inline const wxChar * -wxGetTranslation(const wxChar *sz, const wxChar* domain = NULL) -{ - wxLocale *pLoc = wxGetLocale(); - if (pLoc) - return pLoc->GetString(sz, domain); - else - return sz; -} - -inline const wxChar * -wxGetTranslation(const wxChar *sz1, const wxChar *sz2, - size_t n, - const wxChar *domain = NULL) -{ - wxLocale *pLoc = wxGetLocale(); - if (pLoc) - return pLoc->GetString(sz1, sz2, n, domain); - else - return n == 1 ? sz1 : sz2; -} - -#else // !wxUSE_INTL - -// the macros should still be defined - otherwise compilation would fail - -#if !defined(WXINTL_NO_GETTEXT_MACRO) - #if !defined(_) - #define _(s) (wxT(s)) - #endif - #define wxPLURAL(sing, plur, n) ((n) == 1 ? wxT(sing) : wxT(plur)) -#endif - -#define wxTRANSLATE(str) wxT(str) - -inline const wxChar * -wxGetTranslation(const wxChar *sz, const wxChar * WXUNUSED(domain) = NULL) -{ - return sz; -} - -#endif // wxUSE_INTL/!wxUSE_INTL - -// define this one just in case it occurs somewhere (instead of preferred -// wxTRANSLATE) too -#if !defined(WXINTL_NO_GETTEXT_MACRO) - #if !defined(gettext_noop) - #define gettext_noop(str) wxT(str) - #endif - #if !defined(N_) - #define N_(s) wxT(s) - #endif -#endif - -#endif // _WX_INTL_H_ diff --git a/wxWidgets/include/wx/iosfwrap.h b/wxWidgets/include/wx/iosfwrap.h deleted file mode 100644 index a4df4bfb9b..0000000000 --- a/wxWidgets/include/wx/iosfwrap.h +++ /dev/null @@ -1,26 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: wx/iosfwrap.h -// Purpose: includes the correct stream-related forward declarations -// Author: Jan van Dijk <jan@etpmod.phys.tue.nl> -// Modified by: -// Created: 18.12.2002 -// RCS-ID: $Id: iosfwrap.h 33555 2005-04-12 21:06:03Z ABX $ -// Copyright: wxWidgets team -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#if wxUSE_STD_IOSTREAM - -#if wxUSE_IOSTREAMH - // There is no pre-ANSI iosfwd header so we include the full declarations. -# include <iostream.h> -#else -# include <iosfwd> -#endif - -#ifdef __WXMSW__ -# include "wx/msw/winundef.h" -#endif - -#endif // wxUSE_STD_IOSTREAM - diff --git a/wxWidgets/include/wx/ioswrap.h b/wxWidgets/include/wx/ioswrap.h deleted file mode 100644 index 0c94219f8b..0000000000 --- a/wxWidgets/include/wx/ioswrap.h +++ /dev/null @@ -1,26 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: wx/ioswrap.h -// Purpose: includes the correct iostream headers for current compiler -// Author: Vadim Zeitlin -// Modified by: -// Created: 03.02.99 -// RCS-ID: $Id: ioswrap.h 33555 2005-04-12 21:06:03Z ABX $ -// Copyright: (c) 1998 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr> -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#if wxUSE_STD_IOSTREAM - -#if wxUSE_IOSTREAMH -# include <iostream.h> -#else -# include <iostream> -#endif - -#ifdef __WXMSW__ -# include "wx/msw/winundef.h" -#endif - -#endif - // wxUSE_STD_IOSTREAM - diff --git a/wxWidgets/include/wx/ipc.h b/wxWidgets/include/wx/ipc.h deleted file mode 100644 index 34d056dde4..0000000000 --- a/wxWidgets/include/wx/ipc.h +++ /dev/null @@ -1,45 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: wx/ipc.h -// Purpose: wrapper around different wxIPC classes implementations -// Author: Vadim Zeitlin -// Modified by: -// Created: 15.04.02 -// RCS-ID: $Id: ipc.h 35698 2005-09-25 20:49:40Z MW $ -// Copyright: (c) 2002 Vadim Zeitlin -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_IPC_H_ -#define _WX_IPC_H_ - -// Set wxUSE_DDE_FOR_IPC to 1 to use DDE for IPC under Windows. If it is set to -// 0, or if the platform is not Windows, use TCP/IP for IPC implementation - -#if !defined(wxUSE_DDE_FOR_IPC) - #ifdef __WXMSW__ - #define wxUSE_DDE_FOR_IPC 1 - #else - #define wxUSE_DDE_FOR_IPC 0 - #endif -#endif // !defined(wxUSE_DDE_FOR_IPC) - -#if !defined(__WINDOWS__) - #undef wxUSE_DDE_FOR_IPC - #define wxUSE_DDE_FOR_IPC 0 -#endif - -#if wxUSE_DDE_FOR_IPC - #define wxConnection wxDDEConnection - #define wxServer wxDDEServer - #define wxClient wxDDEClient - - #include "wx/dde.h" -#else // !wxUSE_DDE_FOR_IPC - #define wxConnection wxTCPConnection - #define wxServer wxTCPServer - #define wxClient wxTCPClient - - #include "wx/sckipc.h" -#endif // wxUSE_DDE_FOR_IPC/!wxUSE_DDE_FOR_IPC - -#endif // _WX_IPC_H_ diff --git a/wxWidgets/include/wx/ipcbase.h b/wxWidgets/include/wx/ipcbase.h deleted file mode 100644 index e12f52dfe7..0000000000 --- a/wxWidgets/include/wx/ipcbase.h +++ /dev/null @@ -1,163 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: ipcbase.h -// Purpose: Base classes for IPC -// Author: Julian Smart -// Modified by: -// Created: 4/1/98 -// RCS-ID: $Id: ipcbase.h 53135 2008-04-12 02:31:04Z VZ $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_IPCBASEH__ -#define _WX_IPCBASEH__ - -#include "wx/defs.h" -#include "wx/object.h" -#include "wx/string.h" - -enum wxIPCFormat -{ - wxIPC_INVALID = 0, - wxIPC_TEXT = 1, /* CF_TEXT */ - wxIPC_BITMAP = 2, /* CF_BITMAP */ - wxIPC_METAFILE = 3, /* CF_METAFILEPICT */ - wxIPC_SYLK = 4, - wxIPC_DIF = 5, - wxIPC_TIFF = 6, - wxIPC_OEMTEXT = 7, /* CF_OEMTEXT */ - wxIPC_DIB = 8, /* CF_DIB */ - wxIPC_PALETTE = 9, - wxIPC_PENDATA = 10, - wxIPC_RIFF = 11, - wxIPC_WAVE = 12, - wxIPC_UNICODETEXT = 13, - wxIPC_ENHMETAFILE = 14, - wxIPC_FILENAME = 15, /* CF_HDROP */ - wxIPC_LOCALE = 16, - wxIPC_PRIVATE = 20 -}; - -class WXDLLIMPEXP_FWD_BASE wxServerBase; -class WXDLLIMPEXP_FWD_BASE wxClientBase; - -class WXDLLIMPEXP_BASE wxConnectionBase: public wxObject -{ - DECLARE_CLASS(wxConnectionBase) - -public: - wxConnectionBase(wxChar *buffer, int size); // use external buffer - wxConnectionBase(); // use internal, adaptive buffer - wxConnectionBase(const wxConnectionBase& copy); - virtual ~wxConnectionBase(void); - - void SetConnected( bool c ) { m_connected = c; } - bool GetConnected() { return m_connected; } - - // Calls that CLIENT can make - virtual bool Execute(const wxChar *data, int size = -1, wxIPCFormat format = wxIPC_TEXT ) = 0; - virtual bool Execute(const wxString& str) { return Execute(str, -1, wxIPC_TEXT); } - virtual wxChar *Request(const wxString& item, int *size = (int *) NULL, wxIPCFormat format = wxIPC_TEXT) = 0; - virtual bool Poke(const wxString& item, wxChar *data, int size = -1, wxIPCFormat format = wxIPC_TEXT) = 0; - virtual bool StartAdvise(const wxString& item) = 0; - virtual bool StopAdvise(const wxString& item) = 0; - - // Calls that SERVER can make - virtual bool Advise(const wxString& item, wxChar *data, int size = -1, wxIPCFormat format = wxIPC_TEXT) = 0; - - // Calls that both can make - virtual bool Disconnect(void) = 0; - - // Callbacks to SERVER - override at will - virtual bool OnExecute ( const wxString& WXUNUSED(topic), - wxChar *WXUNUSED(data), - int WXUNUSED(size), - wxIPCFormat WXUNUSED(format) ) - { return false; } - - virtual wxChar *OnRequest ( const wxString& WXUNUSED(topic), - const wxString& WXUNUSED(item), - int *WXUNUSED(size), - wxIPCFormat WXUNUSED(format) ) - { return (wxChar *) NULL; } - - virtual bool OnPoke ( const wxString& WXUNUSED(topic), - const wxString& WXUNUSED(item), - wxChar *WXUNUSED(data), - int WXUNUSED(size), - wxIPCFormat WXUNUSED(format) ) - { return false; } - - virtual bool OnStartAdvise ( const wxString& WXUNUSED(topic), - const wxString& WXUNUSED(item) ) - { return false; } - - virtual bool OnStopAdvise ( const wxString& WXUNUSED(topic), - const wxString& WXUNUSED(item) ) - { return false; } - - // Callbacks to CLIENT - override at will - virtual bool OnAdvise ( const wxString& WXUNUSED(topic), - const wxString& WXUNUSED(item), - wxChar *WXUNUSED(data), - int WXUNUSED(size), - wxIPCFormat WXUNUSED(format) ) - { return false; } - - // Callbacks to BOTH - override at will - // Default behaviour is to delete connection and return true - virtual bool OnDisconnect(void) = 0; - - // return a buffer at least this size, reallocating buffer if needed - // returns NULL if using an inadequate user buffer - it can't be resized - wxChar * GetBufferAtLeast( size_t bytes ); - -protected: - bool m_connected; -private: - wxChar * m_buffer; - size_t m_buffersize; - bool m_deletebufferwhendone; - - // can't use DECLARE_NO_COPY_CLASS(wxConnectionBase) because we already - // have copy ctor but still forbid the default assignment operator - wxConnectionBase& operator=(const wxConnectionBase&); -}; - - -class WXDLLIMPEXP_BASE wxServerBase: public wxObject -{ - DECLARE_CLASS(wxServerBase) - -public: - inline wxServerBase(void) {} - inline ~wxServerBase(void) {} - - // Returns false on error (e.g. port number is already in use) - virtual bool Create(const wxString& serverName) = 0; - - // Callbacks to SERVER - override at will - virtual wxConnectionBase *OnAcceptConnection(const wxString& topic) = 0; -}; - -class WXDLLIMPEXP_BASE wxClientBase: public wxObject -{ - DECLARE_CLASS(wxClientBase) - -public: - inline wxClientBase(void) {} - inline ~wxClientBase(void) {} - - virtual bool ValidHost(const wxString& host) = 0; - - // Call this to make a connection. Returns NULL if cannot. - virtual wxConnectionBase *MakeConnection(const wxString& host, - const wxString& server, - const wxString& topic) = 0; - - // Callbacks to CLIENT - override at will - virtual wxConnectionBase *OnMakeConnection(void) = 0; -}; - -#endif - // _WX_IPCBASEH__ diff --git a/wxWidgets/include/wx/isql.h b/wxWidgets/include/wx/isql.h deleted file mode 100644 index cec4920b39..0000000000 --- a/wxWidgets/include/wx/isql.h +++ /dev/null @@ -1,248 +0,0 @@ -/* - * isql.h - * - * $Id: isql.h 35518 2005-09-16 11:22:35Z JS $ - * - * iODBC defines - * - * The iODBC driver manager. - * - * Copyright (C) 1995 by Ke Jin <kejin@empress.com> - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ -#ifndef _ISQL_H -#define _ISQL_H - -#if defined(WIN32) -#define SQL_API __stdcall - -#ifndef FAR -#define FAR -#endif - -#elif defined(__OS2__) -#define SQL_API _Optlink - -#ifndef FAR -#define FAR -#define EXPORT -#define CALLBACK -#endif - -#else -#define FAR -#define EXPORT -#define CALLBACK -#define SQL_API EXPORT CALLBACK - -#ifndef __EMX__ -typedef void *HWND; -#endif -#endif - -typedef void *SQLHWND; - -typedef unsigned char UCHAR; -typedef long int SDWORD; -typedef short int SWORD; -typedef unsigned long int UDWORD; -typedef unsigned short int UWORD; -typedef long SQLINTEGER; -typedef UDWORD SQLUINTEGER; - -typedef void FAR *PTR; -typedef void FAR *HENV; -typedef void FAR *HDBC; -typedef void FAR *HSTMT; - -typedef signed short RETCODE; -#define SQLRETURN RETCODE - - -#define ODBCVER 0x0250 - -#define SQL_MAX_MESSAGE_LENGTH 512 -#define SQL_MAX_DSN_LENGTH 32 - -/* - * Function return codes - */ -#define SQL_INVALID_HANDLE (-2) -#define SQL_ERROR (-1) -#define SQL_SUCCESS 0 -#define SQL_SUCCESS_WITH_INFO 1 -#define SQL_NO_DATA_FOUND 100 - -/* - * Standard SQL datatypes, using ANSI type numbering - */ -#define SQL_CHAR 1 -#define SQL_NUMERIC 2 -#define SQL_DECIMAL 3 -#define SQL_INTEGER 4 -#define SQL_SMALLINT 5 -#define SQL_FLOAT 6 -#define SQL_REAL 7 -#define SQL_DOUBLE 8 -#define SQL_VARCHAR 12 - -#define SQL_TYPE_MIN SQL_CHAR -#define SQL_TYPE_NULL 0 -#define SQL_TYPE_MAX SQL_VARCHAR - -/* - * C datatype to SQL datatype mapping - */ -#define SQL_C_CHAR SQL_CHAR -#define SQL_C_LONG SQL_INTEGER -#define SQL_C_SHORT SQL_SMALLINT -#define SQL_C_FLOAT SQL_REAL -#define SQL_C_DOUBLE SQL_DOUBLE -#define SQL_C_DEFAULT 99 - -/* - * NULL status constants. - */ -#define SQL_NO_NULLS 0 -#define SQL_NULLABLE 1 -#define SQL_NULLABLE_UNKNOWN 2 - -/* - * Special length values - */ -#define SQL_NULL_DATA (-1) -#define SQL_DATA_AT_EXEC (-2) -#define SQL_NTS (-3) - -/* - * SQLFreeStmt - */ -#define SQL_CLOSE 0 -#define SQL_DROP 1 -#define SQL_UNBIND 2 -#define SQL_RESET_PARAMS 3 - -/* - * SQLTransact - */ -#define SQL_COMMIT 0 -#define SQL_ROLLBACK 1 - -/* - * SQLColAttributes - */ -#define SQL_COLUMN_COUNT 0 -#define SQL_COLUMN_NAME 1 -#define SQL_COLUMN_TYPE 2 -#define SQL_COLUMN_LENGTH 3 -#define SQL_COLUMN_PRECISION 4 -#define SQL_COLUMN_SCALE 5 -#define SQL_COLUMN_DISPLAY_SIZE 6 -#define SQL_COLUMN_NULLABLE 7 -#define SQL_COLUMN_UNSIGNED 8 -#define SQL_COLUMN_MONEY 9 -#define SQL_COLUMN_UPDATABLE 10 -#define SQL_COLUMN_AUTO_INCREMENT 11 -#define SQL_COLUMN_CASE_SENSITIVE 12 -#define SQL_COLUMN_SEARCHABLE 13 -#define SQL_COLUMN_TYPE_NAME 14 -#define SQL_COLUMN_TABLE_NAME 15 -#define SQL_COLUMN_OWNER_NAME 16 -#define SQL_COLUMN_QUALIFIER_NAME 17 -#define SQL_COLUMN_LABEL 18 - -#define SQL_COLATT_OPT_MAX SQL_COLUMN_LABEL -#define SQL_COLATT_OPT_MIN SQL_COLUMN_COUNT -#define SQL_COLUMN_DRIVER_START 1000 - -/* - * SQLColAttributes : SQL_COLUMN_UPDATABLE - */ -#define SQL_ATTR_READONLY 0 -#define SQL_ATTR_WRITE 1 -#define SQL_ATTR_READWRITE_UNKNOWN 2 - -/* - * SQLColAttributes : SQL_COLUMN_SEARCHABLE - */ -#define SQL_UNSEARCHABLE 0 -#define SQL_LIKE_ONLY 1 -#define SQL_ALL_EXCEPT_LIKE 2 -#define SQL_SEARCHABLE 3 - -/* - * NULL Handles - */ -#define SQL_NULL_HENV 0 -#define SQL_NULL_HDBC 0 -#define SQL_NULL_HSTMT 0 - - -/* - * Function Prototypes - */ -#ifdef __cplusplus -extern "C" -{ -#endif - - RETCODE SQL_API SQLAllocConnect (HENV henv, HDBC FAR * phdbc); - RETCODE SQL_API SQLAllocEnv (HENV FAR * phenv); - RETCODE SQL_API SQLAllocStmt (HDBC hdbc, HSTMT FAR * phstmt); - RETCODE SQL_API SQLBindCol (HSTMT hstmt, UWORD icol, SWORD fCType, - PTR rgbValue, SDWORD cbValueMax, SDWORD FAR * pcbValue); - RETCODE SQL_API SQLCancel (HSTMT hstmt); - RETCODE SQL_API SQLColAttributes (HSTMT hstmt, UWORD icol, UWORD fDescType, - PTR rgbDesc, SWORD cbDescMax, SWORD FAR * pcbDesc, SDWORD FAR * pfDesc); - RETCODE SQL_API SQLConnect (HDBC hdbc, UCHAR FAR * szDSN, SWORD cbDSN, - UCHAR FAR * szUID, SWORD cbUID, UCHAR FAR * szAuthStr, SWORD cbAuthStr); - RETCODE SQL_API SQLDescribeCol (HSTMT hstmt, UWORD icol, - UCHAR FAR * szColName, SWORD cbColNameMax, SWORD FAR * pcbColName, - SWORD FAR * pfSqlType, UDWORD FAR * pcbColDef, SWORD FAR * pibScale, - SWORD FAR * pfNullable); - RETCODE SQL_API SQLDisconnect (HDBC hdbc); - RETCODE SQL_API SQLError (HENV henv, HDBC hdbc, HSTMT hstmt, - UCHAR FAR * szSqlState, SDWORD FAR * pfNativeError, UCHAR FAR * szErrorMsg, - SWORD cbErrorMsgMax, SWORD FAR * pcbErrorMsg); - RETCODE SQL_API SQLExecDirect (HSTMT hstmt, UCHAR FAR * szSqlStr, - SDWORD cbSqlStr); - RETCODE SQL_API SQLExecute (HSTMT hstmt); - RETCODE SQL_API SQLFetch (HSTMT hstmt); - RETCODE SQL_API SQLFreeConnect (HDBC hdbc); - RETCODE SQL_API SQLFreeEnv (HENV henv); - RETCODE SQL_API SQLFreeStmt (HSTMT hstmt, UWORD fOption); - RETCODE SQL_API SQLGetCursorName (HSTMT hstmt, UCHAR FAR * szCursor, - SWORD cbCursorMax, SWORD FAR * pcbCursor); - RETCODE SQL_API SQLNumResultCols (HSTMT hstmt, SWORD FAR * pccol); - RETCODE SQL_API SQLPrepare (HSTMT hstmt, UCHAR FAR * szSqlStr, - SDWORD cbSqlStr); - RETCODE SQL_API SQLRowCount (HSTMT hstmt, SDWORD FAR * pcrow); - RETCODE SQL_API SQLSetCursorName (HSTMT hstmt, UCHAR FAR * szCursor, - SWORD cbCursor); - RETCODE SQL_API SQLTransact (HENV henv, HDBC hdbc, UWORD fType); - -/* - * Deprecated ODBC 1.0 function - Use SQLBindParameter - */ - RETCODE SQL_API SQLSetParam (HSTMT hstmt, UWORD ipar, SWORD fCType, - SWORD fSqlType, UDWORD cbColDef, SWORD ibScale, PTR rgbValue, - SDWORD FAR * pcbValue); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/wxWidgets/include/wx/isqlext.h b/wxWidgets/include/wx/isqlext.h deleted file mode 100644 index 1b2a833acc..0000000000 --- a/wxWidgets/include/wx/isqlext.h +++ /dev/null @@ -1,1178 +0,0 @@ -/* - * - * isqlext.h - * - * $Id: isqlext.h 30070 2004-10-22 19:11:07Z KH $ - * - * iODBC defines (ext) - * - * The iODBC driver manager. - * - * Copyright (C) 1995 by Ke Jin <kejin@empress.com> - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ -#ifndef _ISQLEXT_H -#define _ISQLEXT_H - -#include "wx/isql.h" - -/* - * Generic constants - */ -#define SQL_MAX_OPTION_STRING_LENGTH 256 - -/* - * Additional return codes - */ -#define SQL_STILL_EXECUTING 2 -#define SQL_NEED_DATA 99 - -/* - * SQL extended datatypes - */ -#define SQL_DATE 9 -#define SQL_TIME 10 -#define SQL_TIMESTAMP 11 -#define SQL_LONGVARCHAR (-1) -#define SQL_BINARY (-2) -#define SQL_VARBINARY (-3) -#define SQL_LONGVARBINARY (-4) -#define SQL_BIGINT (-5) -#define SQL_TINYINT (-6) -#define SQL_BIT (-7) - -#define SQL_INTERVAL_YEAR (-80) -#define SQL_INTERVAL_MONTH (-81) -#define SQL_INTERVAL_YEAR_TO_MONTH (-82) -#define SQL_INTERVAL_DAY (-83) -#define SQL_INTERVAL_HOUR (-84) -#define SQL_INTERVAL_MINUTE (-85) -#define SQL_INTERVAL_SECOND (-86) -#define SQL_INTERVAL_DAY_TO_HOUR (-87) -#define SQL_INTERVAL_DAY_TO_MINUTE (-88) -#define SQL_INTERVAL_DAY_TO_SECOND (-89) -#define SQL_INTERVAL_HOUR_TO_MINUTE (-90) -#define SQL_INTERVAL_HOUR_TO_SECOND (-91) -#define SQL_INTERVAL_MINUTE_TO_SECOND (-92) -#define SQL_UNICODE (-95) - -#define SQL_TYPE_DRIVER_START SQL_INTERVAL_YEAR -#define SQL_TYPE_DRIVER_END SQL_UNICODE - -#define SQL_SIGNED_OFFSET (-20) -#define SQL_UNSIGNED_OFFSET (-22) - -/* - * C datatype to SQL datatype mapping - */ -#define SQL_C_DATE SQL_DATE -#define SQL_C_TIME SQL_TIME -#define SQL_C_TIMESTAMP SQL_TIMESTAMP -#define SQL_C_BINARY SQL_BINARY -#define SQL_C_BIT SQL_BIT -#define SQL_C_TINYINT SQL_TINYINT -#define SQL_C_SLONG SQL_C_LONG+SQL_SIGNED_OFFSET -#define SQL_C_SSHORT SQL_C_SHORT+SQL_SIGNED_OFFSET -#define SQL_C_STINYINT SQL_TINYINT+SQL_SIGNED_OFFSET -#define SQL_C_ULONG SQL_C_LONG+SQL_UNSIGNED_OFFSET -#define SQL_C_USHORT SQL_C_SHORT+SQL_UNSIGNED_OFFSET -#define SQL_C_UTINYINT SQL_TINYINT+SQL_UNSIGNED_OFFSET -#define SQL_C_BOOKMARK SQL_C_ULONG - -/* - * Extended data types override sql.h defined - */ -#undef SQL_TYPE_MIN -#define SQL_TYPE_MIN SQL_BIT -#define SQL_ALL_TYPES 0 - -/* - * SQL portable types for C - DATE, TIME, TIMESTAMP - */ -typedef struct _DATE_STRUCT - { - SWORD year; - UWORD month; - UWORD day; - } -DATE_STRUCT; - -typedef struct _TIME_STRUCT - { - UWORD hour; - UWORD minute; - UWORD second; - } -TIME_STRUCT; - -typedef struct _TIMESTAMP_STRUCT - { - SWORD year; - UWORD month; - UWORD day; - UWORD hour; - UWORD minute; - UWORD second; - UDWORD fraction; - } -TIMESTAMP_STRUCT; - -typedef unsigned long int BOOKMARK; - -/* - * ---------------------------------------------------------------------- - * Level 1 Functions - * ---------------------------------------------------------------------- - */ - -/* - * SQLDriverConnect - */ -#define SQL_DRIVER_NOPROMPT 0 -#define SQL_DRIVER_COMPLETE 1 -#define SQL_DRIVER_PROMPT 2 -#define SQL_DRIVER_COMPLETE_REQUIRED 3 - -/* - * SQLGetData - */ -#define SQL_NO_TOTAL (-4) - -/* - * SQLBindParameter - */ -#define SQL_DEFAULT_PARAM (-5) -#define SQL_IGNORE (-6) -#define SQL_LEN_DATA_AT_EXEC_OFFSET (-100) -#define SQL_LEN_DATA_AT_EXEC(length) (-length+SQL_LEN_DATA_AT_EXEC_OFFSET) - -/* - * SQLGetFunctions - */ -#define SQL_API_SQLALLOCCONNECT 1 /* Core Functions */ -#define SQL_API_SQLALLOCENV 2 -#define SQL_API_SQLALLOCSTMT 3 -#define SQL_API_SQLBINDCOL 4 -#define SQL_API_SQLCANCEL 5 -#define SQL_API_SQLCOLATTRIBUTES 6 -#define SQL_API_SQLCONNECT 7 -#define SQL_API_SQLDESCRIBECOL 8 -#define SQL_API_SQLDISCONNECT 9 -#define SQL_API_SQLERROR 10 -#define SQL_API_SQLEXECDIRECT 11 -#define SQL_API_SQLEXECUTE 12 -#define SQL_API_SQLFETCH 13 -#define SQL_API_SQLFREECONNECT 14 -#define SQL_API_SQLFREEENV 15 -#define SQL_API_SQLFREESTMT 16 -#define SQL_API_SQLGETCURSORNAME 17 -#define SQL_API_SQLNUMRESULTCOLS 18 -#define SQL_API_SQLPREPARE 19 -#define SQL_API_SQLROWCOUNT 20 -#define SQL_API_SQLSETCURSORNAME 21 -#define SQL_API_SQLSETPARAM 22 -#define SQL_API_SQLTRANSACT 23 - -#define SQL_NUM_FUNCTIONS 23 - -#define SQL_EXT_API_START 40 - -#define SQL_API_SQLCOLUMNS 40 /* Level 1 Functions */ -#define SQL_API_SQLDRIVERCONNECT 41 -#define SQL_API_SQLGETCONNECTOPTION 42 -#define SQL_API_SQLGETDATA 43 -#define SQL_API_SQLGETFUNCTIONS 44 -#define SQL_API_SQLGETINFO 45 -#define SQL_API_SQLGETSTMTOPTION 46 -#define SQL_API_SQLGETTYPEINFO 47 -#define SQL_API_SQLPARAMDATA 48 -#define SQL_API_SQLPUTDATA 49 -#define SQL_API_SQLSETCONNECTOPTION 50 -#define SQL_API_SQLSETSTMTOPTION 51 -#define SQL_API_SQLSPECIALCOLUMNS 52 -#define SQL_API_SQLSTATISTICS 53 -#define SQL_API_SQLTABLES 54 - -#define SQL_API_SQLBROWSECONNECT 55 /* Level 2 Functions */ -#define SQL_API_SQLCOLUMNPRIVILEGES 56 -#define SQL_API_SQLDATASOURCES 57 -#define SQL_API_SQLDESCRIBEPARAM 58 -#define SQL_API_SQLEXTENDEDFETCH 59 -#define SQL_API_SQLFOREIGNKEYS 60 -#define SQL_API_SQLMORERESULTS 61 -#define SQL_API_SQLNATIVESQL 62 -#define SQL_API_SQLNUMPARAMS 63 -#define SQL_API_SQLPARAMOPTIONS 64 -#define SQL_API_SQLPRIMARYKEYS 65 -#define SQL_API_SQLPROCEDURECOLUMNS 66 -#define SQL_API_SQLPROCEDURES 67 -#define SQL_API_SQLSETPOS 68 -#define SQL_API_SQLSETSCROLLOPTIONS 69 -#define SQL_API_SQLTABLEPRIVILEGES 70 - -#define SQL_API_SQLDRIVERS 71 -#define SQL_API_SQLBINDPARAMETER 72 -#define SQL_EXT_API_LAST SQL_API_SQLBINDPARAMETER - -#define SQL_API_ALL_FUNCTIONS 0 - -#define SQL_NUM_EXTENSIONS (SQL_EXT_API_LAST-SQL_EXT_API_START+1) - -/* - * SQLGetInfo - */ -#define SQL_INFO_FIRST 0 -#define SQL_ACTIVE_CONNECTIONS 0 -#define SQL_ACTIVE_STATEMENTS 1 -#define SQL_DATA_SOURCE_NAME 2 -#define SQL_DRIVER_HDBC 3 -#define SQL_DRIVER_HENV 4 -#define SQL_DRIVER_HSTMT 5 -#define SQL_DRIVER_NAME 6 -#define SQL_DRIVER_VER 7 -#define SQL_FETCH_DIRECTION 8 -#define SQL_ODBC_API_CONFORMANCE 9 -#define SQL_ODBC_VER 10 -#define SQL_ROW_UPDATES 11 -#define SQL_ODBC_SAG_CLI_CONFORMANCE 12 -#define SQL_SERVER_NAME 13 -#define SQL_SEARCH_PATTERN_ESCAPE 14 -#define SQL_ODBC_SQL_CONFORMANCE 15 -#define SQL_DBMS_NAME 17 -#define SQL_DBMS_VER 18 -#define SQL_ACCESSIBLE_TABLES 19 -#define SQL_ACCESSIBLE_PROCEDURES 20 -#define SQL_PROCEDURES 21 -#define SQL_CONCAT_NULL_BEHAVIOR 22 -#define SQL_CURSOR_COMMIT_BEHAVIOR 23 -#define SQL_CURSOR_ROLLBACK_BEHAVIOR 24 -#define SQL_DATA_SOURCE_READ_ONLY 25 -#define SQL_DEFAULT_TXN_ISOLATION 26 -#define SQL_EXPRESSIONS_IN_ORDERBY 27 -#define SQL_IDENTIFIER_CASE 28 -#define SQL_IDENTIFIER_QUOTE_CHAR 29 -#define SQL_MAX_COLUMN_NAME_LEN 30 -#define SQL_MAX_CURSOR_NAME_LEN 31 -#define SQL_MAX_OWNER_NAME_LEN 32 -#define SQL_MAX_PROCEDURE_NAME_LEN 33 -#define SQL_MAX_QUALIFIER_NAME_LEN 34 -#define SQL_MAX_TABLE_NAME_LEN 35 -#define SQL_MULT_RESULT_SETS 36 -#define SQL_MULTIPLE_ACTIVE_TXN 37 -#define SQL_OUTER_JOINS 38 -#define SQL_OWNER_TERM 39 -#define SQL_PROCEDURE_TERM 40 -#define SQL_QUALIFIER_NAME_SEPARATOR 41 -#define SQL_QUALIFIER_TERM 42 -#define SQL_SCROLL_CONCURRENCY 43 -#define SQL_SCROLL_OPTIONS 44 -#define SQL_TABLE_TERM 45 -#define SQL_TXN_CAPABLE 46 -#define SQL_USER_NAME 47 -#define SQL_CONVERT_FUNCTIONS 48 -#define SQL_NUMERIC_FUNCTIONS 49 -#define SQL_STRING_FUNCTIONS 50 -#define SQL_SYSTEM_FUNCTIONS 51 -#define SQL_TIMEDATE_FUNCTIONS 52 -#define SQL_CONVERT_BIGINT 53 -#define SQL_CONVERT_BINARY 54 -#define SQL_CONVERT_BIT 55 -#define SQL_CONVERT_CHAR 56 -#define SQL_CONVERT_DATE 57 -#define SQL_CONVERT_DECIMAL 58 -#define SQL_CONVERT_DOUBLE 59 -#define SQL_CONVERT_FLOAT 60 -#define SQL_CONVERT_INTEGER 61 -#define SQL_CONVERT_LONGVARCHAR 62 -#define SQL_CONVERT_NUMERIC 63 -#define SQL_CONVERT_REAL 64 -#define SQL_CONVERT_SMALLINT 65 -#define SQL_CONVERT_TIME 66 -#define SQL_CONVERT_TIMESTAMP 67 -#define SQL_CONVERT_TINYINT 68 -#define SQL_CONVERT_VARBINARY 69 -#define SQL_CONVERT_VARCHAR 70 -#define SQL_CONVERT_LONGVARBINARY 71 -#define SQL_TXN_ISOLATION_OPTION 72 -#define SQL_ODBC_SQL_OPT_IEF 73 - -/* - * ODBC SDK 1.0 Additions - */ -#define SQL_CORRELATION_NAME 74 -#define SQL_NON_NULLABLE_COLUMNS 75 - -/* - * ODBC SDK 2.0 Additions - */ -#define SQL_DRIVER_HLIB 76 -#define SQL_DRIVER_ODBC_VER 77 -#define SQL_LOCK_TYPES 78 -#define SQL_POS_OPERATIONS 79 -#define SQL_POSITIONED_STATEMENTS 80 -#define SQL_GETDATA_EXTENSIONS 81 -#define SQL_BOOKMARK_PERSISTENCE 82 -#define SQL_STATIC_SENSITIVITY 83 -#define SQL_FILE_USAGE 84 -#define SQL_NULL_COLLATION 85 -#define SQL_ALTER_TABLE 86 -#define SQL_COLUMN_ALIAS 87 -#define SQL_GROUP_BY 88 -#define SQL_KEYWORDS 89 -#define SQL_ORDER_BY_COLUMNS_IN_SELECT 90 -#define SQL_OWNER_USAGE 91 -#define SQL_QUALIFIER_USAGE 92 -#define SQL_QUOTED_IDENTIFIER_CASE 93 -#define SQL_SPECIAL_CHARACTERS 94 -#define SQL_SUBQUERIES 95 -#define SQL_UNION 96 -#define SQL_MAX_COLUMNS_IN_GROUP_BY 97 -#define SQL_MAX_COLUMNS_IN_INDEX 98 -#define SQL_MAX_COLUMNS_IN_ORDER_BY 99 -#define SQL_MAX_COLUMNS_IN_SELECT 100 -#define SQL_MAX_COLUMNS_IN_TABLE 101 -#define SQL_MAX_INDEX_SIZE 102 -#define SQL_MAX_ROW_SIZE_INCLUDES_LONG 103 -#define SQL_MAX_ROW_SIZE 104 -#define SQL_MAX_STATEMENT_LEN 105 -#define SQL_MAX_TABLES_IN_SELECT 106 -#define SQL_MAX_USER_NAME_LEN 107 -#define SQL_MAX_CHAR_LITERAL_LEN 108 -#define SQL_TIMEDATE_ADD_INTERVALS 109 -#define SQL_TIMEDATE_DIFF_INTERVALS 110 -#define SQL_NEED_LONG_DATA_LEN 111 -#define SQL_MAX_BINARY_LITERAL_LEN 112 -#define SQL_LIKE_ESCAPE_CLAUSE 113 -#define SQL_QUALIFIER_LOCATION 114 - -/* - * ODBC SDK 2.01 Additions - */ -#define SQL_OJ_CAPABILITIES 65003 /* Temp value until ODBC 3.0 */ - -#define SQL_INFO_LAST SQL_QUALIFIER_LOCATION -#define SQL_INFO_DRIVER_START 1000 - - -/* - * SQL_CONVERT_* bitmask values - */ -#define SQL_CVT_CHAR 0x00000001L -#define SQL_CVT_NUMERIC 0x00000002L -#define SQL_CVT_DECIMAL 0x00000004L -#define SQL_CVT_INTEGER 0x00000008L -#define SQL_CVT_SMALLINT 0x00000010L -#define SQL_CVT_FLOAT 0x00000020L -#define SQL_CVT_REAL 0x00000040L -#define SQL_CVT_DOUBLE 0x00000080L -#define SQL_CVT_VARCHAR 0x00000100L -#define SQL_CVT_LONGVARCHAR 0x00000200L -#define SQL_CVT_BINARY 0x00000400L -#define SQL_CVT_VARBINARY 0x00000800L -#define SQL_CVT_BIT 0x00001000L -#define SQL_CVT_TINYINT 0x00002000L -#define SQL_CVT_BIGINT 0x00004000L -#define SQL_CVT_DATE 0x00008000L -#define SQL_CVT_TIME 0x00010000L -#define SQL_CVT_TIMESTAMP 0x00020000L -#define SQL_CVT_LONGVARBINARY 0x00040000L - -/* - * SQL_CONVERT_FUNCTIONS - */ -#define SQL_FN_CVT_CONVERT 0x00000001L - -/* - * SQL_STRING_FUNCTIONS - */ -#define SQL_FN_STR_CONCAT 0x00000001L -#define SQL_FN_STR_INSERT 0x00000002L -#define SQL_FN_STR_LEFT 0x00000004L -#define SQL_FN_STR_LTRIM 0x00000008L -#define SQL_FN_STR_LENGTH 0x00000010L -#define SQL_FN_STR_LOCATE 0x00000020L -#define SQL_FN_STR_LCASE 0x00000040L -#define SQL_FN_STR_REPEAT 0x00000080L -#define SQL_FN_STR_REPLACE 0x00000100L -#define SQL_FN_STR_RIGHT 0x00000200L -#define SQL_FN_STR_RTRIM 0x00000400L -#define SQL_FN_STR_SUBSTRING 0x00000800L -#define SQL_FN_STR_UCASE 0x00001000L -#define SQL_FN_STR_ASCII 0x00002000L -#define SQL_FN_STR_CHAR 0x00004000L -#define SQL_FN_STR_DIFFERENCE 0x00008000L -#define SQL_FN_STR_LOCATE_2 0x00010000L -#define SQL_FN_STR_SOUNDEX 0x00020000L -#define SQL_FN_STR_SPACE 0x00040000L - -/* - * SQL_NUMERIC_FUNCTIONS - */ -#define SQL_FN_NUM_ABS 0x00000001L -#define SQL_FN_NUM_ACOS 0x00000002L -#define SQL_FN_NUM_ASIN 0x00000004L -#define SQL_FN_NUM_ATAN 0x00000008L -#define SQL_FN_NUM_ATAN2 0x00000010L -#define SQL_FN_NUM_CEILING 0x00000020L -#define SQL_FN_NUM_COS 0x00000040L -#define SQL_FN_NUM_COT 0x00000080L -#define SQL_FN_NUM_EXP 0x00000100L -#define SQL_FN_NUM_FLOOR 0x00000200L -#define SQL_FN_NUM_LOG 0x00000400L -#define SQL_FN_NUM_MOD 0x00000800L -#define SQL_FN_NUM_SIGN 0x00001000L -#define SQL_FN_NUM_SIN 0x00002000L -#define SQL_FN_NUM_SQRT 0x00004000L -#define SQL_FN_NUM_TAN 0x00008000L -#define SQL_FN_NUM_PI 0x00010000L -#define SQL_FN_NUM_RAND 0x00020000L -#define SQL_FN_NUM_DEGREES 0x00040000L -#define SQL_FN_NUM_LOG10 0x00080000L -#define SQL_FN_NUM_POWER 0x00100000L -#define SQL_FN_NUM_RADIANS 0x00200000L -#define SQL_FN_NUM_ROUND 0x00400000L -#define SQL_FN_NUM_TRUNCATE 0x00800000L - -/* - * SQL_TIMEDATE_FUNCTIONS - */ -#define SQL_FN_TD_NOW 0x00000001L -#define SQL_FN_TD_CURDATE 0x00000002L -#define SQL_FN_TD_DAYOFMONTH 0x00000004L -#define SQL_FN_TD_DAYOFWEEK 0x00000008L -#define SQL_FN_TD_DAYOFYEAR 0x00000010L -#define SQL_FN_TD_MONTH 0x00000020L -#define SQL_FN_TD_QUARTER 0x00000040L -#define SQL_FN_TD_WEEK 0x00000080L -#define SQL_FN_TD_YEAR 0x00000100L -#define SQL_FN_TD_CURTIME 0x00000200L -#define SQL_FN_TD_HOUR 0x00000400L -#define SQL_FN_TD_MINUTE 0x00000800L -#define SQL_FN_TD_SECOND 0x00001000L -#define SQL_FN_TD_TIMESTAMPADD 0x00002000L -#define SQL_FN_TD_TIMESTAMPDIFF 0x00004000L -#define SQL_FN_TD_DAYNAME 0x00008000L -#define SQL_FN_TD_MONTHNAME 0x00010000L - -/* - * SQL_SYSTEM_FUNCTIONS - */ -#define SQL_FN_SYS_USERNAME 0x00000001L -#define SQL_FN_SYS_DBNAME 0x00000002L -#define SQL_FN_SYS_IFNULL 0x00000004L - -/* - * SQL_TIMEDATE_ADD_INTERVALS - * SQL_TIMEDATE_DIFF_INTERVALS - */ -#define SQL_FN_TSI_FRAC_SECOND 0x00000001L -#define SQL_FN_TSI_SECOND 0x00000002L -#define SQL_FN_TSI_MINUTE 0x00000004L -#define SQL_FN_TSI_HOUR 0x00000008L -#define SQL_FN_TSI_DAY 0x00000010L -#define SQL_FN_TSI_WEEK 0x00000020L -#define SQL_FN_TSI_MONTH 0x00000040L -#define SQL_FN_TSI_QUARTER 0x00000080L -#define SQL_FN_TSI_YEAR 0x00000100L - -/* - * SQL_ODBC_API_CONFORMANCE - */ -#define SQL_OAC_NONE 0x0000 -#define SQL_OAC_LEVEL1 0x0001 -#define SQL_OAC_LEVEL2 0x0002 - -/* - * SQL_ODBC_SAG_CLI_CONFORMANCE - */ -#define SQL_OSCC_NOT_COMPLIANT 0x0000 -#define SQL_OSCC_COMPLIANT 0x0001 - -/* - * SQL_ODBC_SQL_CONFORMANCE - */ -#define SQL_OSC_MINIMUM 0x0000 -#define SQL_OSC_CORE 0x0001 -#define SQL_OSC_EXTENDED 0x0002 - -/* - * SQL_CONCAT_NULL_BEHAVIOR - */ -#define SQL_CB_NULL 0x0000 -#define SQL_CB_NON_NULL 0x0001 - -/* - * SQL_CURSOR_COMMIT_BEHAVIOR - * SQL_CURSOR_ROLLBACK_BEHAVIOR - */ -#define SQL_CB_DELETE 0x0000 -#define SQL_CB_CLOSE 0x0001 -#define SQL_CB_PRESERVE 0x0002 - -/* - * SQL_IDENTIFIER_CASE - */ -#define SQL_IC_UPPER 0x0001 -#define SQL_IC_LOWER 0x0002 -#define SQL_IC_SENSITIVE 0x0003 -#define SQL_IC_MIXED 0x0004 - -/* - * SQL_TXN_CAPABLE - */ -#define SQL_TC_NONE 0x0000 -#define SQL_TC_DML 0x0001 -#define SQL_TC_ALL 0x0002 -#define SQL_TC_DDL_COMMIT 0x0003 -#define SQL_TC_DDL_IGNORE 0x0004 - -/* - * SQL_SCROLL_OPTIONS - */ -#define SQL_SO_FORWARD_ONLY 0x00000001L -#define SQL_SO_KEYSET_DRIVEN 0x00000002L -#define SQL_SO_DYNAMIC 0x00000004L -#define SQL_SO_MIXED 0x00000008L -#define SQL_SO_STATIC 0x00000010L - -/* - * SQL_SCROLL_CONCURRENCY - */ -#define SQL_SCCO_READ_ONLY 0x00000001L -#define SQL_SCCO_LOCK 0x00000002L -#define SQL_SCCO_OPT_ROWVER 0x00000004L -#define SQL_SCCO_OPT_VALUES 0x00000008L - -/* - * SQL_FETCH_DIRECTION - */ -#define SQL_FD_FETCH_NEXT 0x00000001L -#define SQL_FD_FETCH_FIRST 0x00000002L -#define SQL_FD_FETCH_LAST 0x00000004L -#define SQL_FD_FETCH_PRIOR 0x00000008L -#define SQL_FD_FETCH_ABSOLUTE 0x00000010L -#define SQL_FD_FETCH_RELATIVE 0x00000020L -#define SQL_FD_FETCH_RESUME 0x00000040L -#define SQL_FD_FETCH_BOOKMARK 0x00000080L - -/* - * SQL_TXN_ISOLATION_OPTION - */ -#define SQL_TXN_READ_UNCOMMITTED 0x00000001L -#define SQL_TXN_READ_COMMITTED 0x00000002L -#define SQL_TXN_REPEATABLE_READ 0x00000004L -#define SQL_TXN_SERIALIZABLE 0x00000008L -#define SQL_TXN_VERSIONING 0x00000010L - -/* - * SQL_CORRELATION_NAME - */ -#define SQL_CN_NONE 0x0000 -#define SQL_CN_DIFFERENT 0x0001 -#define SQL_CN_ANY 0x0002 - -/* - * SQL_NON_NULLABLE_COLUMNS - */ -#define SQL_NNC_NULL 0x0000 -#define SQL_NNC_NON_NULL 0x0001 - -/* - * SQL_NULL_COLLATION - */ -#define SQL_NC_HIGH 0x0000 -#define SQL_NC_LOW 0x0001 -#define SQL_NC_START 0x0002 -#define SQL_NC_END 0x0004 - -/* - * SQL_FILE_USAGE - */ -#define SQL_FILE_NOT_SUPPORTED 0x0000 -#define SQL_FILE_TABLE 0x0001 -#define SQL_FILE_QUALIFIER 0x0002 - -/* - * SQL_GETDATA_EXTENSIONS - */ -#define SQL_GD_ANY_COLUMN 0x00000001L -#define SQL_GD_ANY_ORDER 0x00000002L -#define SQL_GD_BLOCK 0x00000004L -#define SQL_GD_BOUND 0x00000008L - -/* - * SQL_ALTER_TABLE - */ -#define SQL_AT_ADD_COLUMN 0x00000001L -#define SQL_AT_DROP_COLUMN 0x00000002L - -/* - * SQL_POSITIONED_STATEMENTS - */ -#define SQL_PS_POSITIONED_DELETE 0x00000001L -#define SQL_PS_POSITIONED_UPDATE 0x00000002L -#define SQL_PS_SELECT_FOR_UPDATE 0x00000004L - -/* - * SQL_GROUP_BY - */ -#define SQL_GB_NOT_SUPPORTED 0x0000 -#define SQL_GB_GROUP_BY_EQUALS_SELECT 0x0001 -#define SQL_GB_GROUP_BY_CONTAINS_SELECT 0x0002 -#define SQL_GB_NO_RELATION 0x0003 - -/* - * SQL_OWNER_USAGE - */ -#define SQL_OU_DML_STATEMENTS 0x00000001L -#define SQL_OU_PROCEDURE_INVOCATION 0x00000002L -#define SQL_OU_TABLE_DEFINITION 0x00000004L -#define SQL_OU_INDEX_DEFINITION 0x00000008L -#define SQL_OU_PRIVILEGE_DEFINITION 0x00000010L - -/* - * SQL_QUALIFIER_USAGE - */ -#define SQL_QU_DML_STATEMENTS 0x00000001L -#define SQL_QU_PROCEDURE_INVOCATION 0x00000002L -#define SQL_QU_TABLE_DEFINITION 0x00000004L -#define SQL_QU_INDEX_DEFINITION 0x00000008L -#define SQL_QU_PRIVILEGE_DEFINITION 0x00000010L - -/* - * SQL_SUBQUERIES - */ -#define SQL_SQ_COMPARISON 0x00000001L -#define SQL_SQ_EXISTS 0x00000002L -#define SQL_SQ_IN 0x00000004L -#define SQL_SQ_QUANTIFIED 0x00000008L -#define SQL_SQ_CORRELATED_SUBQUERIES 0x00000010L - -/* - * SQL_UNION - */ -#define SQL_U_UNION 0x00000001L -#define SQL_U_UNION_ALL 0x00000002L - -/* - * SQL_BOOKMARK_PERSISTENCE - */ -#define SQL_BP_CLOSE 0x00000001L -#define SQL_BP_DELETE 0x00000002L -#define SQL_BP_DROP 0x00000004L -#define SQL_BP_TRANSACTION 0x00000008L -#define SQL_BP_UPDATE 0x00000010L -#define SQL_BP_OTHER_HSTMT 0x00000020L -#define SQL_BP_SCROLL 0x00000040L - -/* - * SQL_STATIC_SENSITIVITY - */ -#define SQL_SS_ADDITIONS 0x00000001L -#define SQL_SS_DELETIONS 0x00000002L -#define SQL_SS_UPDATES 0x00000004L - -/* - * SQL_LOCK_TYPES - */ -#define SQL_LCK_NO_CHANGE 0x00000001L -#define SQL_LCK_EXCLUSIVE 0x00000002L -#define SQL_LCK_UNLOCK 0x00000004L - -/* - * SQL_POS_OPERATIONS - */ -#define SQL_POS_POSITION 0x00000001L -#define SQL_POS_REFRESH 0x00000002L -#define SQL_POS_UPDATE 0x00000004L -#define SQL_POS_DELETE 0x00000008L -#define SQL_POS_ADD 0x00000010L - -/* - * SQL_QUALIFIER_LOCATION - */ -#define SQL_QL_START 0x0001L -#define SQL_QL_END 0x0002L - -/* - * SQL_OJ_CAPABILITIES - */ -#define SQL_OJ_LEFT 0x00000001L -#define SQL_OJ_RIGHT 0x00000002L -#define SQL_OJ_FULL 0x00000004L -#define SQL_OJ_NESTED 0x00000008L -#define SQL_OJ_NOT_ORDERED 0x00000010L -#define SQL_OJ_INNER 0x00000020L -#define SQL_OJ_ALL_COMPARISON_OPS 0x00000040L - -/* - * SQLGetStmtOption/SQLSetStmtOption - */ -#define SQL_QUERY_TIMEOUT 0 -#define SQL_MAX_ROWS 1 -#define SQL_NOSCAN 2 -#define SQL_MAX_LENGTH 3 -#define SQL_ASYNC_ENABLE 4 -#define SQL_BIND_TYPE 5 -#define SQL_CURSOR_TYPE 6 -#define SQL_CONCURRENCY 7 -#define SQL_KEYSET_SIZE 8 -#define SQL_ROWSET_SIZE 9 -#define SQL_SIMULATE_CURSOR 10 -#define SQL_RETRIEVE_DATA 11 -#define SQL_USE_BOOKMARKS 12 -#define SQL_GET_BOOKMARK 13 -#define SQL_ROW_NUMBER 14 - -#define SQL_STMT_OPT_MIN SQL_QUERY_TIMEOUT -#define SQL_STMT_OPT_MAX SQL_ROW_NUMBER - - -/* - * SQL_QUERY_TIMEOUT - */ -#define SQL_QUERY_TIMEOUT_DEFAULT 0UL - -/* - * SQL_MAX_ROWS - */ -#define SQL_MAX_ROWS_DEFAULT 0UL - -/* - * SQL_NOSCAN - */ -#define SQL_NOSCAN_OFF 0UL /* 1.0 FALSE */ -#define SQL_NOSCAN_ON 1UL /* 1.0 TRUE */ -#define SQL_NOSCAN_DEFAULT SQL_NOSCAN_OFF - -/* - * SQL_MAX_LENGTH - */ -#define SQL_MAX_LENGTH_DEFAULT 0UL - -/* - * SQL_ASYNC_ENABLE - */ -#define SQL_ASYNC_ENABLE_OFF 0UL -#define SQL_ASYNC_ENABLE_ON 1UL -#define SQL_ASYNC_ENABLE_DEFAULT SQL_ASYNC_ENABLE_OFF - -/* - * SQL_BIND_TYPE - */ -#define SQL_BIND_BY_COLUMN 0UL -#define SQL_BIND_TYPE_DEFAULT SQL_BIND_BY_COLUMN - -/* - * SQL_CONCURRENCY - */ -#define SQL_CONCUR_READ_ONLY 1 -#define SQL_CONCUR_LOCK 2 -#define SQL_CONCUR_ROWVER 3 -#define SQL_CONCUR_VALUES 4 -#define SQL_CONCUR_DEFAULT SQL_CONCUR_READ_ONLY - -/* - * SQL_CURSOR_TYPE - */ -#define SQL_CURSOR_FORWARD_ONLY 0UL -#define SQL_CURSOR_KEYSET_DRIVEN 1UL -#define SQL_CURSOR_DYNAMIC 2UL -#define SQL_CURSOR_STATIC 3UL -#define SQL_CURSOR_TYPE_DEFAULT SQL_CURSOR_FORWARD_ONLY - -/* - * SQL_ROWSET_SIZE - */ -#define SQL_ROWSET_SIZE_DEFAULT 1UL - -/* - * SQL_KEYSET_SIZE - */ -#define SQL_KEYSET_SIZE_DEFAULT 0UL - -/* - * SQL_SIMULATE_CURSOR - */ -#define SQL_SC_NON_UNIQUE 0UL -#define SQL_SC_TRY_UNIQUE 1UL -#define SQL_SC_UNIQUE 2UL - -/* - * SQL_RETRIEVE_DATA - */ -#define SQL_RD_OFF 0UL -#define SQL_RD_ON 1UL -#define SQL_RD_DEFAULT SQL_RD_ON - -/* - * SQL_USE_BOOKMARKS - */ -#define SQL_UB_OFF 0UL -#define SQL_UB_ON 1UL -#define SQL_UB_DEFAULT SQL_UB_OFF - -/* - * SQLSetConnectOption/SQLGetConnectOption - */ -#define SQL_ACCESS_MODE 101 -#define SQL_AUTOCOMMIT 102 -#define SQL_LOGIN_TIMEOUT 103 -#define SQL_OPT_TRACE 104 -#define SQL_OPT_TRACEFILE 105 -#define SQL_TRANSLATE_DLL 106 -#define SQL_TRANSLATE_OPTION 107 -#define SQL_TXN_ISOLATION 108 -#define SQL_CURRENT_QUALIFIER 109 -#define SQL_ODBC_CURSORS 110 -#define SQL_QUIET_MODE 111 -#define SQL_PACKET_SIZE 112 - -#define SQL_CONN_OPT_MIN SQL_ACCESS_MODE -#define SQL_CONN_OPT_MAX SQL_PACKET_SIZE -#define SQL_CONNECT_OPT_DRVR_START 1000 - - -/* - * SQL_ACCESS_MODE - */ -#define SQL_MODE_READ_WRITE 0UL -#define SQL_MODE_READ_ONLY 1UL -#define SQL_MODE_DEFAULT SQL_MODE_READ_WRITE - -/* - * SQL_AUTOCOMMIT - */ -#define SQL_AUTOCOMMIT_OFF 0UL -#define SQL_AUTOCOMMIT_ON 1UL -#define SQL_AUTOCOMMIT_DEFAULT SQL_AUTOCOMMIT_ON - -/* - * SQL_LOGIN_TIMEOUT - */ -#define SQL_LOGIN_TIMEOUT_DEFAULT 15UL - -/* - * SQL_OPT_TRACE - */ -#define SQL_OPT_TRACE_OFF 0UL -#define SQL_OPT_TRACE_ON 1UL -#define SQL_OPT_TRACE_DEFAULT SQL_OPT_TRACE_OFF -#define SQL_OPT_TRACE_FILE_DEFAULT "odbc.log" - -/* - * SQL_ODBC_CURSORS - */ -#define SQL_CUR_USE_IF_NEEDED 0UL -#define SQL_CUR_USE_ODBC 1UL -#define SQL_CUR_USE_DRIVER 2UL -#define SQL_CUR_DEFAULT SQL_CUR_USE_DRIVER - -/* - * SQLSpecialColumns - Column types and scopes - */ -#define SQL_BEST_ROWID 1 -#define SQL_ROWVER 2 - -#define SQL_SCOPE_CURROW 0 -#define SQL_SCOPE_TRANSACTION 1 -#define SQL_SCOPE_SESSION 2 - -/* - * SQLSetPos - */ -#define SQL_ENTIRE_ROWSET 0 - -/* - * SQLSetPos - */ -#define SQL_POSITION 0 -#define SQL_REFRESH 1 -#define SQL_UPDATE 2 -#define SQL_DELETE 3 -#define SQL_ADD 4 - -/* - * SQLSetPos - */ -#define SQL_LOCK_NO_CHANGE 0 -#define SQL_LOCK_EXCLUSIVE 1 -#define SQL_LOCK_UNLOCK 2 - -/* - * SQLSetPos - */ -#define SQL_POSITION_TO(hstmt,irow) \ - SQLSetPos(hstmt,irow,SQL_POSITION,SQL_LOCK_NO_CHANGE) -#define SQL_LOCK_RECORD(hstmt,irow,fLock) \ - SQLSetPos(hstmt,irow,SQL_POSITION,fLock) -#define SQL_REFRESH_RECORD(hstmt,irow,fLock) \ - SQLSetPos(hstmt,irow,SQL_REFRESH,fLock) -#define SQL_UPDATE_RECORD(hstmt,irow) \ - SQLSetPos(hstmt,irow,SQL_UPDATE,SQL_LOCK_NO_CHANGE) -#define SQL_DELETE_RECORD(hstmt,irow) \ - SQLSetPos(hstmt,irow,SQL_DELETE,SQL_LOCK_NO_CHANGE) -#define SQL_ADD_RECORD(hstmt,irow) \ - SQLSetPos(hstmt,irow,SQL_ADD,SQL_LOCK_NO_CHANGE) - -/* - * All the ODBC keywords - */ -#define SQL_ODBC_KEYWORDS \ -"ABSOLUTE,ACTION,ADA,ADD,ALL,ALLOCATE,ALTER,AND,ANY,ARE,AS,"\ -"ASC,ASSERTION,AT,AUTHORIZATION,AVG,"\ -"BEGIN,BETWEEN,BIT,BIT_LENGTH,BOTH,BY,CASCADE,CASCADED,CASE,CAST,CATALOG,"\ -"CHAR,CHAR_LENGTH,CHARACTER,CHARACTER_LENGTH,CHECK,CLOSE,COALESCE,"\ -"COBOL,COLLATE,COLLATION,COLUMN,COMMIT,CONNECT,CONNECTION,CONSTRAINT,"\ -"CONSTRAINTS,CONTINUE,CONVERT,CORRESPONDING,COUNT,CREATE,CROSS,CURRENT,"\ -"CURRENT_DATE,CURRENT_TIME,CURRENT_TIMESTAMP,CURRENT_USER,CURSOR,"\ -"DATE,DAY,DEALLOCATE,DEC,DECIMAL,DECLARE,DEFAULT,DEFERRABLE,"\ -"DEFERRED,DELETE,DESC,DESCRIBE,DESCRIPTOR,DIAGNOSTICS,DISCONNECT,"\ -"DISTINCT,DOMAIN,DOUBLE,DROP,"\ -"ELSE,END,END-EXEC,ESCAPE,EXCEPT,EXCEPTION,EXEC,EXECUTE,"\ -"EXISTS,EXTERNAL,EXTRACT,"\ -"FALSE,FETCH,FIRST,FLOAT,FOR,FOREIGN,FORTRAN,FOUND,FROM,FULL,"\ -"GET,GLOBAL,GO,GOTO,GRANT,GROUP,HAVING,HOUR,"\ -"IDENTITY,IMMEDIATE,IN,INCLUDE,INDEX,INDICATOR,INITIALLY,INNER,"\ -"INPUT,INSENSITIVE,INSERT,INTEGER,INTERSECT,INTERVAL,INTO,IS,ISOLATION,"\ -"JOIN,KEY,LANGUAGE,LAST,LEADING,LEFT,LEVEL,LIKE,LOCAL,LOWER,"\ -"MATCH,MAX,MIN,MINUTE,MODULE,MONTH,MUMPS,"\ -"NAMES,NATIONAL,NATURAL,NCHAR,NEXT,NO,NONE,NOT,NULL,NULLIF,NUMERIC,"\ -"OCTET_LENGTH,OF,ON,ONLY,OPEN,OPTION,OR,ORDER,OUTER,OUTPUT,OVERLAPS,"\ -"PAD,PARTIAL,PASCAL,PLI,POSITION,PRECISION,PREPARE,PRESERVE,"\ -"PRIMARY,PRIOR,PRIVILEGES,PROCEDURE,PUBLIC,"\ -"REFERENCES,RELATIVE,RESTRICT,REVOKE,RIGHT,ROLLBACK,ROWS,"\ -"SCHEMA,SCROLL,SECOND,SECTION,SELECT,SEQUENCE,SESSION,SESSION_USER,SET,SIZE,"\ -"SMALLINT,SOME,SPACE,SQL,SQLCA,SQLCODE,SQLERROR,SQLSTATE,SQLWARNING,"\ -"SUBSTRING,SUM,SYSTEM_USER,"\ -"TABLE,TEMPORARY,THEN,TIME,TIMESTAMP,TIMEZONE_HOUR,TIMEZONE_MINUTE,"\ -"TO,TRAILING,TRANSACTION,TRANSLATE,TRANSLATION,TRIM,TRUE,"\ -"UNION,UNIQUE,UNKNOWN,UPDATE,UPPER,USAGE,USER,USING,"\ -"VALUE,,VARCHAR,VARYING,VIEW,WHEN,WHENEVER,WHERE,WITH,WORK,YEAR" - -/* - * ---------------------------------------------------------------------- - * Level 2 Functions - * ---------------------------------------------------------------------- - */ - -/* - * SQLExtendedFetch - fFetchType - */ -#define SQL_FETCH_NEXT 1 -#define SQL_FETCH_FIRST 2 -#define SQL_FETCH_LAST 3 -#define SQL_FETCH_PRIOR 4 -#define SQL_FETCH_ABSOLUTE 5 -#define SQL_FETCH_RELATIVE 6 -#define SQL_FETCH_BOOKMARK 8 - -/* - * SQLExtendedFetch - rgfRowStatus - */ -#define SQL_ROW_SUCCESS 0 -#define SQL_ROW_DELETED 1 -#define SQL_ROW_UPDATED 2 -#define SQL_ROW_NOROW 3 -#define SQL_ROW_ADDED 4 -#define SQL_ROW_ERROR 5 - -/* - * SQLForeignKeys - UPDATE_RULE/DELETE_RULE - */ -#define SQL_CASCADE 0 -#define SQL_RESTRICT 1 -#define SQL_SET_NULL 2 - -/* - * SQLBindParameter - fParamType - * SQLProcedureColumns - COLUMN_TYPE - */ -#define SQL_PARAM_TYPE_UNKNOWN 0 -#define SQL_PARAM_INPUT 1 -#define SQL_PARAM_INPUT_OUTPUT 2 -#define SQL_RESULT_COL 3 -#define SQL_PARAM_OUTPUT 4 -#define SQL_RETURN_VALUE 5 - -/* - * SQLSetParam to SQLBindParameter conversion - */ -#define SQL_PARAM_TYPE_DEFAULT SQL_PARAM_INPUT_OUTPUT -#define SQL_SETPARAM_VALUE_MAX (-1L) - -/* - * SQLStatistics - fUnique - */ -#define SQL_INDEX_UNIQUE 0 -#define SQL_INDEX_ALL 1 - -/* - * SQLStatistics - fAccuracy - */ -#define SQL_QUICK 0 -#define SQL_ENSURE 1 - -/* - * SQLStatistics - TYPE - */ -#define SQL_TABLE_STAT 0 -#define SQL_INDEX_CLUSTERED 1 -#define SQL_INDEX_HASHED 2 -#define SQL_INDEX_OTHER 3 - -/* - * SQLProcedures - PROCEDURE_TYPE - */ -#define SQL_PT_UNKNOWN 0 -#define SQL_PT_PROCEDURE 1 -#define SQL_PT_FUNCTION 2 - -/* - * SQLSpecialColumns - PSEUDO_COLUMN - */ -#define SQL_PC_UNKNOWN 0 -#define SQL_PC_NOT_PSEUDO 1 -#define SQL_PC_PSEUDO 2 - -/* - * Deprecated defines from prior versions of ODBC - */ -#define SQL_DATABASE_NAME 16 -#define SQL_FD_FETCH_PREV SQL_FD_FETCH_PRIOR -#define SQL_FETCH_PREV SQL_FETCH_PRIOR -#define SQL_CONCUR_TIMESTAMP SQL_CONCUR_ROWVER -#define SQL_SCCO_OPT_TIMESTAMP SQL_SCCO_OPT_ROWVER -#define SQL_CC_DELETE SQL_CB_DELETE -#define SQL_CR_DELETE SQL_CB_DELETE -#define SQL_CC_CLOSE SQL_CB_CLOSE -#define SQL_CR_CLOSE SQL_CB_CLOSE -#define SQL_CC_PRESERVE SQL_CB_PRESERVE -#define SQL_CR_PRESERVE SQL_CB_PRESERVE -#define SQL_FETCH_RESUME 7 -#define SQL_SCROLL_FORWARD_ONLY 0L -#define SQL_SCROLL_KEYSET_DRIVEN (-1L) -#define SQL_SCROLL_DYNAMIC (-2L) -#define SQL_SCROLL_STATIC (-3L) -#define SQL_PC_NON_PSEUDO SQL_PC_NOT_PSEUDO - -#ifdef __cplusplus -extern "C" { -#endif -/* - * Level 1 function prototypes - */ -RETCODE SQL_API SQLColumns (HSTMT hstmt, UCHAR FAR * szTableQualifier, - SWORD cbTableQualifier, UCHAR FAR * szTableOwner, SWORD cbTableOwner, - UCHAR FAR * szTableName, SWORD cbTableName, UCHAR FAR * szColumnName, - SWORD cbColumnName); -/* glt - Changed HWND to SQLHWND to match MSW header typing */ -RETCODE SQL_API SQLDriverConnect (HDBC hdbc, SQLHWND hwnd, - UCHAR FAR * szConnStrIn, SWORD cbConnStrIn, UCHAR FAR * szConnStrOut, - SWORD cbConnStrOutMax, SWORD FAR * pcbConnStrOut, UWORD fDriverCompletion); -RETCODE SQL_API SQLGetConnectOption (HDBC hdbc, UWORD fOption, PTR pvParam); -RETCODE SQL_API SQLGetData (HSTMT hstmt, UWORD icol, SWORD fCType, - PTR rgbValue, SDWORD cbValueMax, SDWORD FAR * pcbValue); -RETCODE SQL_API SQLGetFunctions (HDBC hdbc, UWORD fFunction, - UWORD FAR * pfExists); -RETCODE SQL_API SQLGetInfo (HDBC hdbc, UWORD fInfoType, PTR rgbInfoValue, - SWORD cbInfoValueMax, SWORD FAR * pcbInfoValue); -RETCODE SQL_API SQLGetStmtOption (HSTMT hstmt, UWORD fOption, PTR pvParam); -RETCODE SQL_API SQLGetTypeInfo (HSTMT hstmt, SWORD fSqlType); -RETCODE SQL_API SQLParamData (HSTMT hstmt, PTR FAR * prgbValue); -RETCODE SQL_API SQLPutData (HSTMT hstmt, PTR rgbValue, SDWORD cbValue); -RETCODE SQL_API SQLSetConnectOption (HDBC hdbc, UWORD fOption, UDWORD vParam); -RETCODE SQL_API SQLSetStmtOption (HSTMT hstmt, UWORD fOption, UDWORD vParam); -RETCODE SQL_API SQLSpecialColumns (HSTMT hstmt, UWORD fColType, - UCHAR FAR * szTableQualifier, SWORD cbTableQualifier, - UCHAR FAR * szTableOwner, SWORD cbTableOwner, UCHAR FAR * szTableName, - SWORD cbTableName, UWORD fScope, UWORD fNullable); -RETCODE SQL_API SQLStatistics (HSTMT hstmt, UCHAR FAR * szTableQualifier, - SWORD cbTableQualifier, UCHAR FAR * szTableOwner, SWORD cbTableOwner, - UCHAR FAR * szTableName, SWORD cbTableName, UWORD fUnique, UWORD fAccuracy); -RETCODE SQL_API SQLTables (HSTMT hstmt, UCHAR FAR * szTableQualifier, - SWORD cbTableQualifier, UCHAR FAR * szTableOwner, SWORD cbTableOwner, - UCHAR FAR * szTableName, SWORD cbTableName, UCHAR FAR * szTableType, - SWORD cbTableType); - -/* - * Level 2 function prototypes - */ -RETCODE SQL_API SQLBrowseConnect (HDBC hdbc, - UCHAR FAR * szConnStrIn, SWORD cbConnStrIn, UCHAR FAR * szConnStrOut, - SWORD cbConnStrOutMax, SWORD FAR * pcbConnStrOut); -RETCODE SQL_API SQLColumnPrivileges (HSTMT hstmt, - UCHAR FAR * szTableQualifier, SWORD cbTableQualifier, - UCHAR FAR * szTableOwner, SWORD cbTableOwner, UCHAR FAR * szTableName, - SWORD cbTableName, UCHAR FAR * szColumnName, SWORD cbColumnName); -RETCODE SQL_API SQLDataSources (HENV henv, UWORD fDirection, - UCHAR FAR * szDSN, SWORD cbDSNMax, SWORD FAR * pcbDSN, - UCHAR FAR * szDescription, SWORD cbDescriptionMax, - SWORD FAR * pcbDescription); -RETCODE SQL_API SQLDescribeParam (HSTMT hstmt, UWORD ipar, - SWORD FAR * pfSqlType, UDWORD FAR * pcbColDef, SWORD FAR * pibScale, - SWORD FAR * pfNullable); -RETCODE SQL_API SQLExtendedFetch (HSTMT hstmt, UWORD fFetchType, SDWORD irow, - UDWORD FAR * pcrow, UWORD FAR * rgfRowStatus); -RETCODE SQL_API SQLForeignKeys (HSTMT hstmt, UCHAR FAR * szPkTableQualifier, - SWORD cbPkTableQualifier, UCHAR FAR * szPkTableOwner, SWORD cbPkTableOwner, - UCHAR FAR * szPkTableName, SWORD cbPkTableName, - UCHAR FAR * szFkTableQualifier, SWORD cbFkTableQualifier, - UCHAR FAR * szFkTableOwner, SWORD cbFkTableOwner, UCHAR FAR * szFkTableName, - SWORD cbFkTableName); -RETCODE SQL_API SQLMoreResults (HSTMT hstmt); -RETCODE SQL_API SQLNativeSql (HDBC hdbc, UCHAR FAR * szSqlStrIn, - SDWORD cbSqlStrIn, UCHAR FAR * szSqlStr, SDWORD cbSqlStrMax, - SDWORD FAR * pcbSqlStr); -RETCODE SQL_API SQLNumParams (HSTMT hstmt, SWORD FAR * pcpar); -RETCODE SQL_API SQLParamOptions (HSTMT hstmt, UDWORD crow, UDWORD FAR * pirow); -RETCODE SQL_API SQLPrimaryKeys (HSTMT hstmt, UCHAR FAR * szTableQualifier, - SWORD cbTableQualifier, UCHAR FAR * szTableOwner, SWORD cbTableOwner, - UCHAR FAR * szTableName, SWORD cbTableName); -RETCODE SQL_API SQLProcedureColumns (HSTMT hstmt, UCHAR FAR * szProcQualifier, - SWORD cbProcQualifier, UCHAR FAR * szProcOwner, SWORD cbProcOwner, - UCHAR FAR * szProcName, SWORD cbProcName, UCHAR FAR * szColumnName, - SWORD cbColumnName); -RETCODE SQL_API SQLProcedures (HSTMT hstmt, UCHAR FAR * szProcQualifier, - SWORD cbProcQualifier, UCHAR FAR * szProcOwner, SWORD cbProcOwner, - UCHAR FAR * szProcName, SWORD cbProcName); -RETCODE SQL_API SQLSetPos (HSTMT hstmt, UWORD irow, UWORD fOption, UWORD fLock); -RETCODE SQL_API SQLTablePrivileges (HSTMT hstmt, UCHAR FAR * szTableQualifier, - SWORD cbTableQualifier, UCHAR FAR * szTableOwner, SWORD cbTableOwner, - UCHAR FAR * szTableName, SWORD cbTableName); - -/* - * SDK 2.0 Additional function prototypes - */ -RETCODE SQL_API SQLDrivers (HENV henv, UWORD fDirection, - UCHAR FAR * szDriverDesc, SWORD cbDriverDescMax, SWORD FAR * pcbDriverDesc, - UCHAR FAR * szDriverAttributes, SWORD cbDrvrAttrMax, - SWORD FAR * pcbDrvrAttr); -RETCODE SQL_API SQLBindParameter (HSTMT hstmt, UWORD ipar, SWORD fParamType, - SWORD fCType, SWORD fSqlType, UDWORD cbColDef, SWORD ibScale, PTR rgbValue, - SDWORD cbValueMax, SDWORD FAR * pcbValue); - -/* - * Deprecated - use SQLSetStmtOptions - */ -RETCODE SQL_API SQLSetScrollOptions (HSTMT hstmt, UWORD fConcurrency, - SDWORD crowKeyset, UWORD crowRowset); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/wxWidgets/include/wx/joystick.h b/wxWidgets/include/wx/joystick.h deleted file mode 100644 index 388ab2e9a6..0000000000 --- a/wxWidgets/include/wx/joystick.h +++ /dev/null @@ -1,38 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: joystick.h -// Purpose: wxJoystick base header -// Author: wxWidgets Team -// Modified by: -// Created: -// Copyright: (c) wxWidgets Team -// RCS-ID: $Id: joystick.h 32852 2005-03-16 16:18:31Z ABX $ -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_JOYSTICK_H_BASE_ -#define _WX_JOYSTICK_H_BASE_ - -#include "wx/defs.h" - -#if wxUSE_JOYSTICK - -#if defined(__WXMSW__) -#include "wx/msw/joystick.h" -#elif defined(__WXMOTIF__) -#include "wx/unix/joystick.h" -#elif defined(__WXGTK__) -#include "wx/unix/joystick.h" -#elif defined(__WXX11__) -#include "wx/unix/joystick.h" -#elif defined(__DARWIN__) -#include "wx/mac/corefoundation/joystick.h" -#elif defined(__WXMAC__) -#include "wx/mac/joystick.h" -#elif defined(__WXPM__) -#include "wx/os2/joystick.h" -#endif - -#endif // wxUSE_JOYSTICK - -#endif - // _WX_JOYSTICK_H_BASE_ diff --git a/wxWidgets/include/wx/layout.h b/wxWidgets/include/wx/layout.h deleted file mode 100644 index 06dc60934c..0000000000 --- a/wxWidgets/include/wx/layout.h +++ /dev/null @@ -1,191 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/layout.h -// Purpose: OBSOLETE layout constraint classes, use sizers instead -// Author: Julian Smart -// Modified by: -// Created: 29/01/98 -// RCS-ID: $Id: layout.h 49563 2007-10-31 20:46:21Z VZ $ -// Copyright: (c) 1998 Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_LAYOUT_H_ -#define _WX_LAYOUT_H_ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -#include "wx/object.h" - -// X stupidly defines these in X.h -#ifdef Above - #undef Above -#endif -#ifdef Below - #undef Below -#endif - -#if wxUSE_CONSTRAINTS - -// ---------------------------------------------------------------------------- -// forward declrations -// ---------------------------------------------------------------------------- - -class WXDLLIMPEXP_FWD_CORE wxWindowBase; -class WXDLLIMPEXP_FWD_CORE wxLayoutConstraints; - -// ---------------------------------------------------------------------------- -// constants -// ---------------------------------------------------------------------------- - -#define wxLAYOUT_DEFAULT_MARGIN 0 - -enum wxEdge -{ - wxLeft, wxTop, wxRight, wxBottom, wxWidth, wxHeight, - wxCentre, wxCenter = wxCentre, wxCentreX, wxCentreY -}; - -enum wxRelationship -{ - wxUnconstrained = 0, - wxAsIs, - wxPercentOf, - wxAbove, - wxBelow, - wxLeftOf, - wxRightOf, - wxSameAs, - wxAbsolute -}; - -// ---------------------------------------------------------------------------- -// wxIndividualLayoutConstraint: a constraint on window position -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxIndividualLayoutConstraint : public wxObject -{ -public: - wxIndividualLayoutConstraint(); - - // note that default copy ctor and assignment operators are ok - - virtual ~wxIndividualLayoutConstraint(){} - - void Set(wxRelationship rel, wxWindowBase *otherW, wxEdge otherE, int val = 0, int marg = wxLAYOUT_DEFAULT_MARGIN); - - // - // Sibling relationships - // - void LeftOf(wxWindowBase *sibling, int marg = wxLAYOUT_DEFAULT_MARGIN); - void RightOf(wxWindowBase *sibling, int marg = wxLAYOUT_DEFAULT_MARGIN); - void Above(wxWindowBase *sibling, int marg = wxLAYOUT_DEFAULT_MARGIN); - void Below(wxWindowBase *sibling, int marg = wxLAYOUT_DEFAULT_MARGIN); - - // - // 'Same edge' alignment - // - void SameAs(wxWindowBase *otherW, wxEdge edge, int marg = wxLAYOUT_DEFAULT_MARGIN); - - // The edge is a percentage of the other window's edge - void PercentOf(wxWindowBase *otherW, wxEdge wh, int per); - - // - // Edge has absolute value - // - void Absolute(int val); - - // - // Dimension is unconstrained - // - void Unconstrained() { relationship = wxUnconstrained; } - - // - // Dimension is 'as is' (use current size settings) - // - void AsIs() { relationship = wxAsIs; } - - // - // Accessors - // - wxWindowBase *GetOtherWindow() { return otherWin; } - wxEdge GetMyEdge() const { return myEdge; } - void SetEdge(wxEdge which) { myEdge = which; } - void SetValue(int v) { value = v; } - int GetMargin() { return margin; } - void SetMargin(int m) { margin = m; } - int GetValue() const { return value; } - int GetPercent() const { return percent; } - int GetOtherEdge() const { return otherEdge; } - bool GetDone() const { return done; } - void SetDone(bool d) { done = d; } - wxRelationship GetRelationship() { return relationship; } - void SetRelationship(wxRelationship r) { relationship = r; } - - // Reset constraint if it mentions otherWin - bool ResetIfWin(wxWindowBase *otherW); - - // Try to satisfy constraint - bool SatisfyConstraint(wxLayoutConstraints *constraints, wxWindowBase *win); - - // Get the value of this edge or dimension, or if this - // is not determinable, -1. - int GetEdge(wxEdge which, wxWindowBase *thisWin, wxWindowBase *other) const; - -protected: - // To be allowed to modify the internal variables - friend class wxIndividualLayoutConstraint_Serialize; - - // 'This' window is the parent or sibling of otherWin - wxWindowBase *otherWin; - - wxEdge myEdge; - wxRelationship relationship; - int margin; - int value; - int percent; - wxEdge otherEdge; - bool done; - - DECLARE_DYNAMIC_CLASS(wxIndividualLayoutConstraint) -}; - -// ---------------------------------------------------------------------------- -// wxLayoutConstraints: the complete set of constraints for a window -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxLayoutConstraints : public wxObject -{ -public: - // Edge constraints - wxIndividualLayoutConstraint left; - wxIndividualLayoutConstraint top; - wxIndividualLayoutConstraint right; - wxIndividualLayoutConstraint bottom; - // Size constraints - wxIndividualLayoutConstraint width; - wxIndividualLayoutConstraint height; - // Centre constraints - wxIndividualLayoutConstraint centreX; - wxIndividualLayoutConstraint centreY; - - wxLayoutConstraints(); - - // note that default copy ctor and assignment operators are ok - - virtual ~wxLayoutConstraints(){} - - bool SatisfyConstraints(wxWindowBase *win, int *noChanges); - bool AreSatisfied() const - { - return left.GetDone() && top.GetDone() && - width.GetDone() && height.GetDone(); - } - - DECLARE_DYNAMIC_CLASS(wxLayoutConstraints) -}; - -#endif // wxUSE_CONSTRAINTS - -#endif // _WX_LAYOUT_H_ diff --git a/wxWidgets/include/wx/laywin.h b/wxWidgets/include/wx/laywin.h deleted file mode 100644 index c27d1e7dbe..0000000000 --- a/wxWidgets/include/wx/laywin.h +++ /dev/null @@ -1,18 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/laywin.h -// Purpose: wxSashLayoutWindow base header -// Author: Julian Smart -// Modified by: -// Created: -// Copyright: (c) Julian Smart -// RCS-ID: $Id: laywin.h 33948 2005-05-04 18:57:50Z JS $ -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_LAYWIN_H_BASE_ -#define _WX_LAYWIN_H_BASE_ - -#include "wx/generic/laywin.h" - -#endif - // _WX_LAYWIN_H_BASE_ diff --git a/wxWidgets/include/wx/link.h b/wxWidgets/include/wx/link.h deleted file mode 100644 index 394f2422ea..0000000000 --- a/wxWidgets/include/wx/link.h +++ /dev/null @@ -1,32 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/link.h -// Purpose: macros to force linking modules which might otherwise be -// discarded by the linker -// Author: Vaclav Slavik -// RCS-ID: $Id: link.h 35722 2005-09-26 12:29:25Z VZ $ -// Copyright: (c) Vaclav Slavik -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_LINK_H_ -#define _WX_LINK_H_ - -// This must be part of the module you want to force: -#define wxFORCE_LINK_THIS_MODULE(module_name) \ - extern void _wx_link_dummy_func_##module_name (); \ - void _wx_link_dummy_func_##module_name () { } - - -// And this must be somewhere where it certainly will be linked: -#define wxFORCE_LINK_MODULE(module_name) \ - extern void _wx_link_dummy_func_##module_name (); \ - static struct wxForceLink##module_name \ - { \ - wxForceLink##module_name() \ - { \ - _wx_link_dummy_func_##module_name (); \ - } \ - } _wx_link_dummy_var_##module_name; - - -#endif // _WX_LINK_H_ diff --git a/wxWidgets/include/wx/list.h b/wxWidgets/include/wx/list.h deleted file mode 100644 index 1f02cc3dce..0000000000 --- a/wxWidgets/include/wx/list.h +++ /dev/null @@ -1,1308 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/list.h -// Purpose: wxList, wxStringList classes -// Author: Julian Smart -// Modified by: VZ at 16/11/98: WX_DECLARE_LIST() and typesafe lists added -// Created: 29/01/98 -// RCS-ID: $Id: list.h 61872 2009-09-09 22:37:05Z VZ $ -// Copyright: (c) 1998 Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -/* - All this is quite ugly but serves two purposes: - 1. Be almost 100% compatible with old, untyped, wxList class - 2. Ensure compile-time type checking for the linked lists - - The idea is to have one base class (wxListBase) working with "void *" data, - but to hide these untyped functions - i.e. make them protected, so they - can only be used from derived classes which have inline member functions - working with right types. This achieves the 2nd goal. As for the first one, - we provide a special derivation of wxListBase called wxList which looks just - like the old class. -*/ - -#ifndef _WX_LISTH__ -#define _WX_LISTH__ - -// ----------------------------------------------------------------------------- -// headers -// ----------------------------------------------------------------------------- - -#include "wx/defs.h" -#include "wx/object.h" -#include "wx/string.h" - -#if wxUSE_STL - #include "wx/beforestd.h" - #include <algorithm> - #include <iterator> - #include <list> - #include "wx/afterstd.h" -#endif - -// ---------------------------------------------------------------------------- -// types -// ---------------------------------------------------------------------------- - -// type of compare function for list sort operation (as in 'qsort'): it should -// return a negative value, 0 or positive value if the first element is less -// than, equal or greater than the second - -extern "C" -{ -typedef int (* LINKAGEMODE wxSortCompareFunction)(const void *elem1, const void *elem2); -} - -class WXDLLIMPEXP_FWD_BASE wxObjectListNode; -typedef wxObjectListNode wxNode; - -// -typedef int (* LINKAGEMODE wxListIterateFunction)(void *current); - -// ---------------------------------------------------------------------------- -// constants -// ---------------------------------------------------------------------------- - -#if !defined(wxENUM_KEY_TYPE_DEFINED) -#define wxENUM_KEY_TYPE_DEFINED - -enum wxKeyType -{ - wxKEY_NONE, - wxKEY_INTEGER, - wxKEY_STRING -}; - -#endif - -#if wxUSE_STL - -#define wxLIST_COMPATIBILITY - -#define WX_DECLARE_LIST_3(elT, dummy1, liT, dummy2, decl) \ - WX_DECLARE_LIST_WITH_DECL(elT, liT, decl) -#define WX_DECLARE_LIST_PTR_3(elT, dummy1, liT, dummy2, decl) \ - WX_DECLARE_LIST_3(elT, dummy1, liT, dummy2, decl) - -#define WX_DECLARE_LIST_2(elT, liT, dummy, decl) \ - WX_DECLARE_LIST_WITH_DECL(elT, liT, decl) -#define WX_DECLARE_LIST_PTR_2(elT, liT, dummy, decl) \ - WX_DECLARE_LIST_2(elT, liT, dummy, decl) \ - -#define WX_DECLARE_LIST_WITH_DECL(elT, liT, decl) \ - WX_DECLARE_LIST_XO(elT*, liT, decl) - -#if !defined( __VISUALC__ ) - -template<class T> -class WXDLLIMPEXP_BASE wxList_SortFunction -{ -public: - wxList_SortFunction(wxSortCompareFunction f) : m_f(f) { } - bool operator()(const T& i1, const T& i2) - { return m_f((T*)&i1, (T*)&i2) < 0; } -private: - wxSortCompareFunction m_f; -}; - -#define WX_LIST_SORTFUNCTION( elT, f ) wxList_SortFunction<elT>(f) -#define VC6_WORKAROUND(elT, liT, decl) - -#else // if defined( __VISUALC__ ) - -#define WX_LIST_SORTFUNCTION( elT, f ) std::greater<elT>( f ) -#define VC6_WORKAROUND(elT, liT, decl) \ - decl liT; \ - \ - /* Workaround for broken VC6 STL incorrectly requires a std::greater<> */ \ - /* to be passed into std::list::sort() */ \ - template <> \ - struct std::greater<elT> \ - { \ - private: \ - wxSortCompareFunction m_CompFunc; \ - public: \ - greater( wxSortCompareFunction compfunc = NULL ) \ - : m_CompFunc( compfunc ) {} \ - bool operator()(const elT X, const elT Y) const \ - { \ - return m_CompFunc ? \ - ( m_CompFunc( X, Y ) < 0 ) : \ - ( X > Y ); \ - } \ - }; - -#endif // defined( __VISUALC__ ) - -/* - Note 1: the outer helper class _WX_LIST_HELPER_##liT below is a workaround - for mingw 3.2.3 compiler bug that prevents a static function of liT class - from being exported into dll. A minimal code snippet reproducing the bug: - - struct WXDLLEXPORT Foo - { - static void Bar(); - struct SomeInnerClass - { - friend class Foo; // comment this out to make it link - }; - ~Foo() - { - Bar(); - } - }; - - The program does not link under mingw_gcc 3.2.3 producing undefined - reference to Foo::Bar() function - - - Note 2: the EmptyList is needed to allow having a NULL pointer-like - invalid iterator. We used to use just an uninitialized iterator object - instead but this fails with some debug/checked versions of STL, notably the - glibc version activated with _GLIBCXX_DEBUG, so we need to have a separate - invalid iterator. - */ - -// the real wxList-class declaration -#define WX_DECLARE_LIST_XO(elT, liT, decl) \ - decl _WX_LIST_HELPER_##liT \ - { \ - typedef elT _WX_LIST_ITEM_TYPE_##liT; \ - public: \ - static void DeleteFunction( _WX_LIST_ITEM_TYPE_##liT X ); \ - }; \ - \ - VC6_WORKAROUND(elT, liT, decl) \ - decl liT : public std::list<elT> \ - { \ - private: \ - typedef std::list<elT> BaseListType; \ - static BaseListType EmptyList; \ - \ - bool m_destroy; \ - \ - public: \ - decl compatibility_iterator \ - { \ - private: \ - /* Workaround for broken VC6 nested class name resolution */ \ - typedef std::list<elT>::iterator iterator; \ - friend class liT; \ - \ - iterator m_iter; \ - liT * m_list; \ - \ - public: \ - compatibility_iterator() \ - : m_iter(EmptyList.end()), m_list( NULL ) {} \ - compatibility_iterator( liT* li, iterator i ) \ - : m_iter( i ), m_list( li ) {} \ - compatibility_iterator( const liT* li, iterator i ) \ - : m_iter( i ), m_list( const_cast< liT* >( li ) ) {} \ - \ - compatibility_iterator* operator->() { return this; } \ - const compatibility_iterator* operator->() const { return this; } \ - \ - bool operator==(const compatibility_iterator& i) const \ - { \ - wxASSERT_MSG( m_list && i.m_list, \ - wxT("comparing invalid iterators is illegal") ); \ - return (m_list == i.m_list) && (m_iter == i.m_iter); \ - } \ - bool operator!=(const compatibility_iterator& i) const \ - { return !( operator==( i ) ); } \ - operator bool() const \ - { return m_list ? m_iter != m_list->end() : false; } \ - bool operator !() const \ - { return !( operator bool() ); } \ - \ - elT GetData() const \ - { return *m_iter; } \ - void SetData( elT e ) \ - { *m_iter = e; } \ - \ - compatibility_iterator GetNext() const \ - { \ - iterator i = m_iter; \ - return compatibility_iterator( m_list, ++i ); \ - } \ - compatibility_iterator GetPrevious() const \ - { \ - if ( m_iter == m_list->begin() ) \ - return compatibility_iterator(); \ - \ - iterator i = m_iter; \ - return compatibility_iterator( m_list, --i ); \ - } \ - int IndexOf() const \ - { \ - return *this ? std::distance( m_list->begin(), m_iter ) \ - : wxNOT_FOUND; \ - } \ - }; \ - public: \ - liT() : m_destroy( false ) {} \ - \ - compatibility_iterator Find( const elT e ) const \ - { \ - liT* _this = const_cast< liT* >( this ); \ - return compatibility_iterator( _this, \ - std::find( _this->begin(), _this->end(), e ) ); \ - } \ - \ - bool IsEmpty() const \ - { return empty(); } \ - size_t GetCount() const \ - { return size(); } \ - int Number() const \ - { return static_cast< int >( GetCount() ); } \ - \ - compatibility_iterator Item( size_t idx ) const \ - { \ - iterator i = const_cast< liT* >(this)->begin(); \ - std::advance( i, idx ); \ - return compatibility_iterator( this, i ); \ - } \ - elT operator[](size_t idx) const \ - { \ - return Item(idx).GetData(); \ - } \ - \ - compatibility_iterator GetFirst() const \ - { \ - return compatibility_iterator( this, \ - const_cast< liT* >(this)->begin() ); \ - } \ - compatibility_iterator GetLast() const \ - { \ - iterator i = const_cast< liT* >(this)->end(); \ - return compatibility_iterator( this, !empty() ? --i : i ); \ - } \ - compatibility_iterator Member( elT e ) const \ - { return Find( e ); } \ - compatibility_iterator Nth( int n ) const \ - { return Item( n ); } \ - int IndexOf( elT e ) const \ - { return Find( e ).IndexOf(); } \ - \ - compatibility_iterator Append( elT e ) \ - { \ - push_back( e ); \ - return GetLast(); \ - } \ - compatibility_iterator Insert( elT e ) \ - { \ - push_front( e ); \ - return compatibility_iterator( this, begin() ); \ - } \ - compatibility_iterator Insert(const compatibility_iterator &i, elT e) \ - { \ - return compatibility_iterator( this, insert( i.m_iter, e ) ); \ - } \ - compatibility_iterator Insert( size_t idx, elT e ) \ - { \ - return compatibility_iterator( this, \ - insert( Item( idx ).m_iter, e ) ); \ - } \ - \ - void DeleteContents( bool destroy ) \ - { m_destroy = destroy; } \ - bool GetDeleteContents() const \ - { return m_destroy; } \ - void Erase( const compatibility_iterator& i ) \ - { \ - if ( m_destroy ) \ - _WX_LIST_HELPER_##liT::DeleteFunction( i->GetData() ); \ - erase( i.m_iter ); \ - } \ - bool DeleteNode( const compatibility_iterator& i ) \ - { \ - if( i ) \ - { \ - Erase( i ); \ - return true; \ - } \ - return false; \ - } \ - bool DeleteObject( elT e ) \ - { \ - return DeleteNode( Find( e ) ); \ - } \ - void Clear() \ - { \ - if ( m_destroy ) \ - std::for_each( begin(), end(), \ - _WX_LIST_HELPER_##liT::DeleteFunction ); \ - clear(); \ - } \ - /* Workaround for broken VC6 std::list::sort() see above */ \ - void Sort( wxSortCompareFunction compfunc ) \ - { sort( WX_LIST_SORTFUNCTION( elT, compfunc ) ); } \ - ~liT() { Clear(); } \ - \ - /* It needs access to our EmptyList */ \ - friend decl compatibility_iterator; \ - } - -#define WX_DECLARE_LIST(elementtype, listname) \ - WX_DECLARE_LIST_WITH_DECL(elementtype, listname, class) -#define WX_DECLARE_LIST_PTR(elementtype, listname) \ - WX_DECLARE_LIST(elementtype, listname) - -#define WX_DECLARE_EXPORTED_LIST(elementtype, listname) \ - WX_DECLARE_LIST_WITH_DECL(elementtype, listname, class WXDLLEXPORT) -#define WX_DECLARE_EXPORTED_LIST_PTR(elementtype, listname) \ - WX_DECLARE_EXPORTED_LIST(elementtype, listname) - -#define WX_DECLARE_USER_EXPORTED_LIST(elementtype, listname, usergoo) \ - WX_DECLARE_LIST_WITH_DECL(elementtype, listname, class usergoo) -#define WX_DECLARE_USER_EXPORTED_LIST_PTR(elementtype, listname, usergoo) \ - WX_DECLARE_USER_EXPORTED_LIST(elementtype, listname, usergoo) - -// this macro must be inserted in your program after -// #include "wx/listimpl.cpp" -#define WX_DEFINE_LIST(name) "don't forget to include listimpl.cpp!" - -#define WX_DEFINE_EXPORTED_LIST(name) WX_DEFINE_LIST(name) -#define WX_DEFINE_USER_EXPORTED_LIST(name) WX_DEFINE_LIST(name) - -#else // if !wxUSE_STL - -// due to circular header dependencies this function has to be declared here -// (normally it's found in utils.h which includes itself list.h...) -#if WXWIN_COMPATIBILITY_2_4 -extern WXDLLIMPEXP_BASE wxChar* copystring(const wxChar *s); -#endif - -// undef it to get rid of old, deprecated functions -#define wxLIST_COMPATIBILITY - -// ----------------------------------------------------------------------------- -// key stuff: a list may be optionally keyed on integer or string key -// ----------------------------------------------------------------------------- - -union wxListKeyValue -{ - long integer; - wxChar *string; -}; - -// a struct which may contain both types of keys -// -// implementation note: on one hand, this class allows to have only one function -// for any keyed operation instead of 2 almost equivalent. OTOH, it's needed to -// resolve ambiguity which we would otherwise have with wxStringList::Find() and -// wxList::Find(const char *). -class WXDLLIMPEXP_BASE wxListKey -{ -public: - // implicit ctors - wxListKey() : m_keyType(wxKEY_NONE) - { } - wxListKey(long i) : m_keyType(wxKEY_INTEGER) - { m_key.integer = i; } - wxListKey(const wxChar *s) : m_keyType(wxKEY_STRING) - { m_key.string = wxStrdup(s); } - wxListKey(const wxString& s) : m_keyType(wxKEY_STRING) - { m_key.string = wxStrdup(s.c_str()); } - - // accessors - wxKeyType GetKeyType() const { return m_keyType; } - const wxChar *GetString() const - { wxASSERT( m_keyType == wxKEY_STRING ); return m_key.string; } - long GetNumber() const - { wxASSERT( m_keyType == wxKEY_INTEGER ); return m_key.integer; } - - // comparison - // Note: implementation moved to list.cpp to prevent BC++ inline - // expansion warning. - bool operator==(wxListKeyValue value) const ; - - // dtor - ~wxListKey() - { - if ( m_keyType == wxKEY_STRING ) - free(m_key.string); - } - -private: - wxKeyType m_keyType; - wxListKeyValue m_key; -}; - -// ----------------------------------------------------------------------------- -// wxNodeBase class is a (base for) node in a double linked list -// ----------------------------------------------------------------------------- - -extern WXDLLIMPEXP_DATA_BASE(wxListKey) wxDefaultListKey; - -class WXDLLIMPEXP_FWD_BASE wxListBase; - -class WXDLLIMPEXP_BASE wxNodeBase -{ -friend class wxListBase; -public: - // ctor - wxNodeBase(wxListBase *list = (wxListBase *)NULL, - wxNodeBase *previous = (wxNodeBase *)NULL, - wxNodeBase *next = (wxNodeBase *)NULL, - void *data = NULL, - const wxListKey& key = wxDefaultListKey); - - virtual ~wxNodeBase(); - - // FIXME no check is done that the list is really keyed on strings - const wxChar *GetKeyString() const { return m_key.string; } - long GetKeyInteger() const { return m_key.integer; } - - // Necessary for some existing code - void SetKeyString(wxChar* s) { m_key.string = s; } - void SetKeyInteger(long i) { m_key.integer = i; } - -#ifdef wxLIST_COMPATIBILITY - // compatibility methods, use Get* instead. - wxDEPRECATED( wxNode *Next() const ); - wxDEPRECATED( wxNode *Previous() const ); - wxDEPRECATED( wxObject *Data() const ); -#endif // wxLIST_COMPATIBILITY - -protected: - // all these are going to be "overloaded" in the derived classes - wxNodeBase *GetNext() const { return m_next; } - wxNodeBase *GetPrevious() const { return m_previous; } - - void *GetData() const { return m_data; } - void SetData(void *data) { m_data = data; } - - // get 0-based index of this node within the list or wxNOT_FOUND - int IndexOf() const; - - virtual void DeleteData() { } -public: - // for wxList::iterator - void** GetDataPtr() const { return &(((wxNodeBase*)this)->m_data); } -private: - // optional key stuff - wxListKeyValue m_key; - - void *m_data; // user data - wxNodeBase *m_next, // next and previous nodes in the list - *m_previous; - - wxListBase *m_list; // list we belong to - - DECLARE_NO_COPY_CLASS(wxNodeBase) -}; - -// ----------------------------------------------------------------------------- -// a double-linked list class -// ----------------------------------------------------------------------------- - -class WXDLLIMPEXP_FWD_BASE wxList; - -class WXDLLIMPEXP_BASE wxListBase : public wxObject -{ -friend class WXDLLIMPEXP_FWD_BASE wxNodeBase; // should be able to call DetachNode() -friend class wxHashTableBase; // should be able to call untyped Find() - -public: - // default ctor & dtor - wxListBase(wxKeyType keyType = wxKEY_NONE) - { Init(keyType); } - virtual ~wxListBase(); - - // accessors - // count of items in the list - size_t GetCount() const { return m_count; } - - // return true if this list is empty - bool IsEmpty() const { return m_count == 0; } - - // operations - - // delete all nodes - void Clear(); - - // instruct it to destroy user data when deleting nodes - void DeleteContents(bool destroy) { m_destroy = destroy; } - - // query if to delete - bool GetDeleteContents() const - { return m_destroy; } - - // get the keytype - wxKeyType GetKeyType() const - { return m_keyType; } - - // set the keytype (required by the serial code) - void SetKeyType(wxKeyType keyType) - { wxASSERT( m_count==0 ); m_keyType = keyType; } - -#ifdef wxLIST_COMPATIBILITY - // compatibility methods from old wxList - wxDEPRECATED( int Number() const ); // use GetCount instead. - wxDEPRECATED( wxNode *First() const ); // use GetFirst - wxDEPRECATED( wxNode *Last() const ); // use GetLast - wxDEPRECATED( wxNode *Nth(size_t n) const ); // use Item - - // kludge for typesafe list migration in core classes. - wxDEPRECATED( operator wxList&() const ); -#endif // wxLIST_COMPATIBILITY - -protected: - - // all methods here are "overloaded" in derived classes to provide compile - // time type checking - - // create a node for the list of this type - virtual wxNodeBase *CreateNode(wxNodeBase *prev, wxNodeBase *next, - void *data, - const wxListKey& key = wxDefaultListKey) = 0; - -// Can't access these from derived classes otherwise (bug in Salford C++?) -#ifdef __SALFORDC__ -public: -#endif - - // ctors - // from an array - wxListBase(size_t count, void *elements[]); - // from a sequence of objects - wxListBase(void *object, ... /* terminate with NULL */); - -protected: - void Assign(const wxListBase& list) - { Clear(); DoCopy(list); } - - // get list head/tail - wxNodeBase *GetFirst() const { return m_nodeFirst; } - wxNodeBase *GetLast() const { return m_nodeLast; } - - // by (0-based) index - wxNodeBase *Item(size_t index) const; - - // get the list item's data - void *operator[](size_t n) const - { - wxNodeBase *node = Item(n); - - return node ? node->GetData() : (wxNodeBase *)NULL; - } - - // operations - // append to end of list - wxNodeBase *Prepend(void *object) - { return (wxNodeBase *)wxListBase::Insert(object); } - // append to beginning of list - wxNodeBase *Append(void *object); - // insert a new item at the beginning of the list - wxNodeBase *Insert(void *object) { return Insert( (wxNodeBase*)NULL, object); } - // insert a new item at the given position - wxNodeBase *Insert(size_t pos, void *object) - { return pos == GetCount() ? Append(object) - : Insert(Item(pos), object); } - // insert before given node or at front of list if prev == NULL - wxNodeBase *Insert(wxNodeBase *prev, void *object); - - // keyed append - wxNodeBase *Append(long key, void *object); - wxNodeBase *Append(const wxChar *key, void *object); - - // removes node from the list but doesn't delete it (returns pointer - // to the node or NULL if it wasn't found in the list) - wxNodeBase *DetachNode(wxNodeBase *node); - // delete element from list, returns false if node not found - bool DeleteNode(wxNodeBase *node); - // finds object pointer and deletes node (and object if DeleteContents - // is on), returns false if object not found - bool DeleteObject(void *object); - - // search (all return NULL if item not found) - // by data - wxNodeBase *Find(const void *object) const; - - // by key - wxNodeBase *Find(const wxListKey& key) const; - - // get 0-based index of object or wxNOT_FOUND - int IndexOf( void *object ) const; - - // this function allows the sorting of arbitrary lists by giving - // a function to compare two list elements. The list is sorted in place. - void Sort(const wxSortCompareFunction compfunc); - - // functions for iterating over the list - void *FirstThat(wxListIterateFunction func); - void ForEach(wxListIterateFunction func); - void *LastThat(wxListIterateFunction func); - - // for STL interface, "last" points to one after the last node - // of the controlled sequence (NULL for the end of the list) - void Reverse(); - void DeleteNodes(wxNodeBase* first, wxNodeBase* last); -private: - - // common part of all ctors - void Init(wxKeyType keyType = wxKEY_NONE); - - // helpers - // common part of copy ctor and assignment operator - void DoCopy(const wxListBase& list); - // common part of all Append()s - wxNodeBase *AppendCommon(wxNodeBase *node); - // free node's data and node itself - void DoDeleteNode(wxNodeBase *node); - - size_t m_count; // number of elements in the list - bool m_destroy; // destroy user data when deleting list items? - wxNodeBase *m_nodeFirst, // pointers to the head and tail of the list - *m_nodeLast; - - wxKeyType m_keyType; // type of our keys (may be wxKEY_NONE) -}; - -// ----------------------------------------------------------------------------- -// macros for definition of "template" list type -// ----------------------------------------------------------------------------- - -// and now some heavy magic... - -// declare a list type named 'name' and containing elements of type 'T *' -// (as a by product of macro expansion you also get wx##name##Node -// wxNode-derived type) -// -// implementation details: -// 1. We define _WX_LIST_ITEM_TYPE_##name typedef to save in it the item type -// for the list of given type - this allows us to pass only the list name -// to WX_DEFINE_LIST() even if it needs both the name and the type -// -// 2. We redefine all non-type-safe wxList functions with type-safe versions -// which don't take any space (everything is inline), but bring compile -// time error checking. -// -// 3. The macro which is usually used (WX_DECLARE_LIST) is defined in terms of -// a more generic WX_DECLARE_LIST_2 macro which, in turn, uses the most -// generic WX_DECLARE_LIST_3 one. The last macro adds a sometimes -// interesting capability to store polymorphic objects in the list and is -// particularly useful with, for example, "wxWindow *" list where the -// wxWindowBase pointers are put into the list, but wxWindow pointers are -// retrieved from it. -// -// 4. final hack is that WX_DECLARE_LIST_3 is defined in terms of -// WX_DECLARE_LIST_4 to allow defining classes without operator->() as -// it results in compiler warnings when this operator doesn't make sense -// (i.e. stored elements are not pointers) - -// common part of WX_DECLARE_LIST_3 and WX_DECLARE_LIST_PTR_3 -#define WX_DECLARE_LIST_4(T, Tbase, name, nodetype, classexp, ptrop) \ - typedef int (*wxSortFuncFor_##name)(const T **, const T **); \ - \ - classexp nodetype : public wxNodeBase \ - { \ - public: \ - nodetype(wxListBase *list = (wxListBase *)NULL, \ - nodetype *previous = (nodetype *)NULL, \ - nodetype *next = (nodetype *)NULL, \ - T *data = (T *)NULL, \ - const wxListKey& key = wxDefaultListKey) \ - : wxNodeBase(list, previous, next, data, key) { } \ - \ - nodetype *GetNext() const \ - { return (nodetype *)wxNodeBase::GetNext(); } \ - nodetype *GetPrevious() const \ - { return (nodetype *)wxNodeBase::GetPrevious(); } \ - \ - T *GetData() const \ - { return (T *)wxNodeBase::GetData(); } \ - void SetData(T *data) \ - { wxNodeBase::SetData(data); } \ - \ - protected: \ - virtual void DeleteData(); \ - \ - DECLARE_NO_COPY_CLASS(nodetype) \ - }; \ - \ - classexp name : public wxListBase \ - { \ - public: \ - typedef nodetype Node; \ - classexp compatibility_iterator \ - { \ - public: \ - compatibility_iterator(Node *ptr = NULL) : m_ptr(ptr) { } \ - \ - Node *operator->() const { return m_ptr; } \ - operator Node *() const { return m_ptr; } \ - \ - private: \ - Node *m_ptr; \ - }; \ - \ - name(wxKeyType keyType = wxKEY_NONE) : wxListBase(keyType) \ - { } \ - name(const name& list) : wxListBase(list.GetKeyType()) \ - { Assign(list); } \ - name(size_t count, T *elements[]) \ - : wxListBase(count, (void **)elements) { } \ - \ - name& operator=(const name& list) \ - { Assign(list); return *this; } \ - \ - nodetype *GetFirst() const \ - { return (nodetype *)wxListBase::GetFirst(); } \ - nodetype *GetLast() const \ - { return (nodetype *)wxListBase::GetLast(); } \ - \ - nodetype *Item(size_t index) const \ - { return (nodetype *)wxListBase::Item(index); } \ - \ - T *operator[](size_t index) const \ - { \ - nodetype *node = Item(index); \ - return node ? (T*)(node->GetData()) : (T*)NULL; \ - } \ - \ - nodetype *Append(Tbase *object) \ - { return (nodetype *)wxListBase::Append(object); } \ - nodetype *Insert(Tbase *object) \ - { return (nodetype *)Insert((nodetype*)NULL, object); } \ - nodetype *Insert(size_t pos, Tbase *object) \ - { return (nodetype *)wxListBase::Insert(pos, object); } \ - nodetype *Insert(nodetype *prev, Tbase *object) \ - { return (nodetype *)wxListBase::Insert(prev, object); } \ - \ - nodetype *Append(long key, void *object) \ - { return (nodetype *)wxListBase::Append(key, object); } \ - nodetype *Append(const wxChar *key, void *object) \ - { return (nodetype *)wxListBase::Append(key, object); } \ - \ - nodetype *DetachNode(nodetype *node) \ - { return (nodetype *)wxListBase::DetachNode(node); } \ - bool DeleteNode(nodetype *node) \ - { return wxListBase::DeleteNode(node); } \ - bool DeleteObject(Tbase *object) \ - { return wxListBase::DeleteObject(object); } \ - void Erase(nodetype *it) \ - { DeleteNode(it); } \ - \ - nodetype *Find(const Tbase *object) const \ - { return (nodetype *)wxListBase::Find(object); } \ - \ - virtual nodetype *Find(const wxListKey& key) const \ - { return (nodetype *)wxListBase::Find(key); } \ - \ - int IndexOf(Tbase *object) const \ - { return wxListBase::IndexOf(object); } \ - \ - void Sort(wxSortCompareFunction func) \ - { wxListBase::Sort(func); } \ - void Sort(wxSortFuncFor_##name func) \ - { Sort((wxSortCompareFunction)func); } \ - \ - protected: \ - virtual wxNodeBase *CreateNode(wxNodeBase *prev, wxNodeBase *next, \ - void *data, \ - const wxListKey& key = wxDefaultListKey) \ - { \ - return new nodetype(this, \ - (nodetype *)prev, (nodetype *)next, \ - (T *)data, key); \ - } \ - /* STL interface */ \ - public: \ - typedef size_t size_type; \ - typedef int difference_type; \ - typedef T* value_type; \ - typedef Tbase* base_value_type; \ - typedef value_type& reference; \ - typedef const value_type& const_reference; \ - typedef base_value_type& base_reference; \ - typedef const base_value_type& const_base_reference; \ - \ - classexp iterator \ - { \ - typedef name list; \ - public: \ - typedef nodetype Node; \ - typedef iterator itor; \ - typedef T* value_type; \ - typedef value_type* ptr_type; \ - typedef value_type& reference; \ - \ - Node* m_node; \ - Node* m_init; \ - public: \ - typedef reference reference_type; \ - typedef ptr_type pointer_type; \ - \ - iterator(Node* node, Node* init) : m_node(node), m_init(init) {}\ - iterator() : m_node(NULL), m_init(NULL) { } \ - reference_type operator*() const \ - { return *(pointer_type)m_node->GetDataPtr(); } \ - ptrop \ - itor& operator++() { m_node = m_node->GetNext(); return *this; }\ - const itor operator++(int) \ - { itor tmp = *this; m_node = m_node->GetNext(); return tmp; }\ - itor& operator--() \ - { \ - m_node = m_node ? m_node->GetPrevious() : m_init; \ - return *this; \ - } \ - const itor operator--(int) \ - { \ - itor tmp = *this; \ - m_node = m_node ? m_node->GetPrevious() : m_init; \ - return tmp; \ - } \ - bool operator!=(const itor& it) const \ - { return it.m_node != m_node; } \ - bool operator==(const itor& it) const \ - { return it.m_node == m_node; } \ - }; \ - classexp const_iterator \ - { \ - typedef name list; \ - public: \ - typedef nodetype Node; \ - typedef T* value_type; \ - typedef const value_type& const_reference; \ - typedef const_iterator itor; \ - typedef value_type* ptr_type; \ - \ - Node* m_node; \ - Node* m_init; \ - public: \ - typedef const_reference reference_type; \ - typedef const ptr_type pointer_type; \ - \ - const_iterator(Node* node, Node* init) \ - : m_node(node), m_init(init) { } \ - const_iterator() : m_node(NULL), m_init(NULL) { } \ - const_iterator(const iterator& it) \ - : m_node(it.m_node), m_init(it.m_init) { } \ - reference_type operator*() const \ - { return *(pointer_type)m_node->GetDataPtr(); } \ - ptrop \ - itor& operator++() { m_node = m_node->GetNext(); return *this; }\ - const itor operator++(int) \ - { itor tmp = *this; m_node = m_node->GetNext(); return tmp; }\ - itor& operator--() \ - { \ - m_node = m_node ? m_node->GetPrevious() : m_init; \ - return *this; \ - } \ - const itor operator--(int) \ - { \ - itor tmp = *this; \ - m_node = m_node ? m_node->GetPrevious() : m_init; \ - return tmp; \ - } \ - bool operator!=(const itor& it) const \ - { return it.m_node != m_node; } \ - bool operator==(const itor& it) const \ - { return it.m_node == m_node; } \ - }; \ - classexp reverse_iterator \ - { \ - typedef name list; \ - public: \ - typedef nodetype Node; \ - typedef T* value_type; \ - typedef reverse_iterator itor; \ - typedef value_type* ptr_type; \ - typedef value_type& reference; \ - \ - Node* m_node; \ - Node* m_init; \ - public: \ - typedef reference reference_type; \ - typedef ptr_type pointer_type; \ - \ - reverse_iterator(Node* node, Node* init) \ - : m_node(node), m_init(init) { } \ - reverse_iterator() : m_node(NULL), m_init(NULL) { } \ - reference_type operator*() const \ - { return *(pointer_type)m_node->GetDataPtr(); } \ - ptrop \ - itor& operator++() \ - { m_node = m_node->GetPrevious(); return *this; } \ - const itor operator++(int) \ - { itor tmp = *this; m_node = m_node->GetPrevious(); return tmp; }\ - itor& operator--() \ - { m_node = m_node ? m_node->GetNext() : m_init; return *this; } \ - const itor operator--(int) \ - { \ - itor tmp = *this; \ - m_node = m_node ? m_node->GetNext() : m_init; \ - return tmp; \ - } \ - bool operator!=(const itor& it) const \ - { return it.m_node != m_node; } \ - bool operator==(const itor& it) const \ - { return it.m_node == m_node; } \ - }; \ - classexp const_reverse_iterator \ - { \ - typedef name list; \ - public: \ - typedef nodetype Node; \ - typedef T* value_type; \ - typedef const_reverse_iterator itor; \ - typedef value_type* ptr_type; \ - typedef const value_type& const_reference; \ - \ - Node* m_node; \ - Node* m_init; \ - public: \ - typedef const_reference reference_type; \ - typedef const ptr_type pointer_type; \ - \ - const_reverse_iterator(Node* node, Node* init) \ - : m_node(node), m_init(init) { } \ - const_reverse_iterator() : m_node(NULL), m_init(NULL) { } \ - const_reverse_iterator(const reverse_iterator& it) \ - : m_node(it.m_node), m_init(it.m_init) { } \ - reference_type operator*() const \ - { return *(pointer_type)m_node->GetDataPtr(); } \ - ptrop \ - itor& operator++() \ - { m_node = m_node->GetPrevious(); return *this; } \ - const itor operator++(int) \ - { itor tmp = *this; m_node = m_node->GetPrevious(); return tmp; }\ - itor& operator--() \ - { m_node = m_node ? m_node->GetNext() : m_init; return *this;}\ - const itor operator--(int) \ - { \ - itor tmp = *this; \ - m_node = m_node ? m_node->GetNext() : m_init; \ - return tmp; \ - } \ - bool operator!=(const itor& it) const \ - { return it.m_node != m_node; } \ - bool operator==(const itor& it) const \ - { return it.m_node == m_node; } \ - }; \ - \ - wxEXPLICIT name(size_type n, const_reference v = value_type()) \ - { assign(n, v); } \ - name(const const_iterator& first, const const_iterator& last) \ - { assign(first, last); } \ - iterator begin() { return iterator(GetFirst(), GetLast()); } \ - const_iterator begin() const \ - { return const_iterator(GetFirst(), GetLast()); } \ - iterator end() { return iterator(NULL, GetLast()); } \ - const_iterator end() const { return const_iterator(NULL, GetLast()); }\ - reverse_iterator rbegin() \ - { return reverse_iterator(GetLast(), GetFirst()); } \ - const_reverse_iterator rbegin() const \ - { return const_reverse_iterator(GetLast(), GetFirst()); } \ - reverse_iterator rend() { return reverse_iterator(NULL, GetFirst()); }\ - const_reverse_iterator rend() const \ - { return const_reverse_iterator(NULL, GetFirst()); } \ - void resize(size_type n, value_type v = value_type()) \ - { \ - while (n < size()) \ - pop_back(); \ - while (n > size()) \ - push_back(v); \ - } \ - size_type size() const { return GetCount(); } \ - size_type max_size() const { return INT_MAX; } \ - bool empty() const { return IsEmpty(); } \ - reference front() { return *begin(); } \ - const_reference front() const { return *begin(); } \ - reference back() { iterator tmp = end(); return *--tmp; } \ - const_reference back() const { const_iterator tmp = end(); return *--tmp; }\ - void push_front(const_reference v = value_type()) \ - { Insert(GetFirst(), (const_base_reference)v); } \ - void pop_front() { DeleteNode(GetFirst()); } \ - void push_back(const_reference v = value_type()) \ - { Append((const_base_reference)v); } \ - void pop_back() { DeleteNode(GetLast()); } \ - void assign(const_iterator first, const const_iterator& last) \ - { \ - clear(); \ - for(; first != last; ++first) \ - Append((const_base_reference)*first); \ - } \ - void assign(size_type n, const_reference v = value_type()) \ - { \ - clear(); \ - for(size_type i = 0; i < n; ++i) \ - Append((const_base_reference)v); \ - } \ - iterator insert(const iterator& it, const_reference v = value_type())\ - { \ - if ( it == end() ) \ - Append((const_base_reference)v); \ - else \ - Insert(it.m_node, (const_base_reference)v); \ - iterator itprev(it); \ - return itprev--; \ - } \ - void insert(const iterator& it, size_type n, const_reference v = value_type())\ - { \ - for(size_type i = 0; i < n; ++i) \ - insert(it, v); \ - } \ - void insert(const iterator& it, const_iterator first, const const_iterator& last)\ - { \ - for(; first != last; ++first) \ - insert(it, *first); \ - } \ - iterator erase(const iterator& it) \ - { \ - iterator next = iterator(it.m_node->GetNext(), GetLast()); \ - DeleteNode(it.m_node); return next; \ - } \ - iterator erase(const iterator& first, const iterator& last) \ - { \ - iterator next = last; \ - if ( next != end() ) \ - ++next; \ - DeleteNodes(first.m_node, last.m_node); \ - return next; \ - } \ - void clear() { Clear(); } \ - void splice(const iterator& it, name& l, const iterator& first, const iterator& last)\ - { insert(it, first, last); l.erase(first, last); } \ - void splice(const iterator& it, name& l) \ - { splice(it, l, l.begin(), l.end() ); } \ - void splice(const iterator& it, name& l, const iterator& first) \ - { \ - if ( it != first ) \ - { \ - insert(it, *first); \ - l.erase(first); \ - } \ - } \ - void remove(const_reference v) \ - { DeleteObject((const_base_reference)v); } \ - void reverse() \ - { Reverse(); } \ - /* void swap(name& l) \ - { \ - { size_t t = m_count; m_count = l.m_count; l.m_count = t; } \ - { bool t = m_destroy; m_destroy = l.m_destroy; l.m_destroy = t; }\ - { wxNodeBase* t = m_nodeFirst; m_nodeFirst = l.m_nodeFirst; l.m_nodeFirst = t; }\ - { wxNodeBase* t = m_nodeLast; m_nodeLast = l.m_nodeLast; l.m_nodeLast = t; }\ - { wxKeyType t = m_keyType; m_keyType = l.m_keyType; l.m_keyType = t; }\ - } */ \ - } - -#define WX_LIST_PTROP \ - pointer_type operator->() const \ - { return (pointer_type)m_node->GetDataPtr(); } -#define WX_LIST_PTROP_NONE - -#define WX_DECLARE_LIST_3(T, Tbase, name, nodetype, classexp) \ - WX_DECLARE_LIST_4(T, Tbase, name, nodetype, classexp, WX_LIST_PTROP_NONE) -#define WX_DECLARE_LIST_PTR_3(T, Tbase, name, nodetype, classexp) \ - WX_DECLARE_LIST_4(T, Tbase, name, nodetype, classexp, WX_LIST_PTROP) - -#define WX_DECLARE_LIST_2(elementtype, listname, nodename, classexp) \ - WX_DECLARE_LIST_3(elementtype, elementtype, listname, nodename, classexp) -#define WX_DECLARE_LIST_PTR_2(elementtype, listname, nodename, classexp) \ - WX_DECLARE_LIST_PTR_3(elementtype, elementtype, listname, nodename, classexp) - -#define WX_DECLARE_LIST(elementtype, listname) \ - typedef elementtype _WX_LIST_ITEM_TYPE_##listname; \ - WX_DECLARE_LIST_2(elementtype, listname, wx##listname##Node, class) -#define WX_DECLARE_LIST_PTR(elementtype, listname) \ - typedef elementtype _WX_LIST_ITEM_TYPE_##listname; \ - WX_DECLARE_LIST_PTR_2(elementtype, listname, wx##listname##Node, class) - -#define WX_DECLARE_LIST_WITH_DECL(elementtype, listname, decl) \ - typedef elementtype _WX_LIST_ITEM_TYPE_##listname; \ - WX_DECLARE_LIST_2(elementtype, listname, wx##listname##Node, decl) - -#define WX_DECLARE_EXPORTED_LIST(elementtype, listname) \ - WX_DECLARE_LIST_WITH_DECL(elementtype, listname, class WXDLLEXPORT) - -#define WX_DECLARE_EXPORTED_LIST_PTR(elementtype, listname) \ - typedef elementtype _WX_LIST_ITEM_TYPE_##listname; \ - WX_DECLARE_LIST_PTR_2(elementtype, listname, wx##listname##Node, class WXDLLEXPORT) - -#define WX_DECLARE_USER_EXPORTED_LIST(elementtype, listname, usergoo) \ - typedef elementtype _WX_LIST_ITEM_TYPE_##listname; \ - WX_DECLARE_LIST_2(elementtype, listname, wx##listname##Node, class usergoo) -#define WX_DECLARE_USER_EXPORTED_LIST_PTR(elementtype, listname, usergoo) \ - typedef elementtype _WX_LIST_ITEM_TYPE_##listname; \ - WX_DECLARE_LIST_PTR_2(elementtype, listname, wx##listname##Node, class usergoo) - -// this macro must be inserted in your program after -// #include "wx/listimpl.cpp" -#define WX_DEFINE_LIST(name) "don't forget to include listimpl.cpp!" - -#define WX_DEFINE_EXPORTED_LIST(name) WX_DEFINE_LIST(name) -#define WX_DEFINE_USER_EXPORTED_LIST(name) WX_DEFINE_LIST(name) - -#endif // !wxUSE_STL - -// ============================================================================ -// now we can define classes 100% compatible with the old ones -// ============================================================================ - -// ---------------------------------------------------------------------------- -// commonly used list classes -// ---------------------------------------------------------------------------- - -#if defined(wxLIST_COMPATIBILITY) - -// inline compatibility functions - -#if !wxUSE_STL - -// ---------------------------------------------------------------------------- -// wxNodeBase deprecated methods -// ---------------------------------------------------------------------------- - -inline wxNode *wxNodeBase::Next() const { return (wxNode *)GetNext(); } -inline wxNode *wxNodeBase::Previous() const { return (wxNode *)GetPrevious(); } -inline wxObject *wxNodeBase::Data() const { return (wxObject *)GetData(); } - -// ---------------------------------------------------------------------------- -// wxListBase deprecated methods -// ---------------------------------------------------------------------------- - -inline int wxListBase::Number() const { return (int)GetCount(); } -inline wxNode *wxListBase::First() const { return (wxNode *)GetFirst(); } -inline wxNode *wxListBase::Last() const { return (wxNode *)GetLast(); } -inline wxNode *wxListBase::Nth(size_t n) const { return (wxNode *)Item(n); } -inline wxListBase::operator wxList&() const { return *(wxList*)this; } - -#endif - -// define this to make a lot of noise about use of the old wxList classes. -//#define wxWARN_COMPAT_LIST_USE - -// ---------------------------------------------------------------------------- -// wxList compatibility class: in fact, it's a list of wxObjects -// ---------------------------------------------------------------------------- - -WX_DECLARE_LIST_2(wxObject, wxObjectList, wxObjectListNode, - class WXDLLIMPEXP_BASE); - -class WXDLLIMPEXP_BASE wxList : public wxObjectList -{ -public: -#if defined(wxWARN_COMPAT_LIST_USE) && !wxUSE_STL - wxList() { }; - wxDEPRECATED( wxList(int key_type) ); -#elif !wxUSE_STL - wxList(int key_type = wxKEY_NONE); -#endif - - // this destructor is required for Darwin - ~wxList() { } - -#if !wxUSE_STL - wxList& operator=(const wxList& list) - { (void) wxListBase::operator=(list); return *this; } - - // compatibility methods - void Sort(wxSortCompareFunction compfunc) { wxListBase::Sort(compfunc); } -#endif - -#if wxUSE_STL -#else - wxNode *Member(wxObject *object) const { return (wxNode *)Find(object); } -#endif - -private: -#if !wxUSE_STL - DECLARE_DYNAMIC_CLASS(wxList) -#endif -}; - -#if !wxUSE_STL - -// ----------------------------------------------------------------------------- -// wxStringList class for compatibility with the old code -// ----------------------------------------------------------------------------- -WX_DECLARE_LIST_2(wxChar, wxStringListBase, wxStringListNode, class WXDLLIMPEXP_BASE); - -class WXDLLIMPEXP_BASE wxStringList : public wxStringListBase -{ -public: - // ctors and such - // default -#ifdef wxWARN_COMPAT_LIST_USE - wxStringList(); - wxDEPRECATED( wxStringList(const wxChar *first ...) ); -#else - wxStringList(); - wxStringList(const wxChar *first ...); -#endif - - // copying the string list: the strings are copied, too (extremely - // inefficient!) - wxStringList(const wxStringList& other) : wxStringListBase() { DeleteContents(true); DoCopy(other); } - wxStringList& operator=(const wxStringList& other) - { Clear(); DoCopy(other); return *this; } - - // operations - // makes a copy of the string - wxNode *Add(const wxChar *s); - - // Append to beginning of list - wxNode *Prepend(const wxChar *s); - - bool Delete(const wxChar *s); - - wxChar **ListToArray(bool new_copies = false) const; - bool Member(const wxChar *s) const; - - // alphabetic sort - void Sort(); - -private: - void DoCopy(const wxStringList&); // common part of copy ctor and operator= - - DECLARE_DYNAMIC_CLASS(wxStringList) -}; - -#else // if wxUSE_STL - -WX_DECLARE_LIST_XO(wxString, wxStringListBase, class WXDLLIMPEXP_BASE); - -class WXDLLIMPEXP_BASE wxStringList : public wxStringListBase -{ -public: - compatibility_iterator Append(wxChar* s) - { wxString tmp = s; delete[] s; return wxStringListBase::Append(tmp); } - compatibility_iterator Insert(wxChar* s) - { wxString tmp = s; delete[] s; return wxStringListBase::Insert(tmp); } - compatibility_iterator Insert(size_t pos, wxChar* s) - { - wxString tmp = s; - delete[] s; - return wxStringListBase::Insert(pos, tmp); - } - compatibility_iterator Add(const wxChar* s) - { push_back(s); return GetLast(); } - compatibility_iterator Prepend(const wxChar* s) - { push_front(s); return GetFirst(); } -}; - -#endif // wxUSE_STL - -#endif // wxLIST_COMPATIBILITY - -// delete all list elements -// -// NB: the class declaration of the list elements must be visible from the -// place where you use this macro, otherwise the proper destructor may not -// be called (a decent compiler should give a warning about it, but don't -// count on it)! -#define WX_CLEAR_LIST(type, list) \ - { \ - type::iterator it, en; \ - for( it = (list).begin(), en = (list).end(); it != en; ++it ) \ - delete *it; \ - (list).clear(); \ - } - -#endif // _WX_LISTH__ diff --git a/wxWidgets/include/wx/listbase.h b/wxWidgets/include/wx/listbase.h deleted file mode 100644 index 4685ebbbee..0000000000 --- a/wxWidgets/include/wx/listbase.h +++ /dev/null @@ -1,491 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: wx/listbase.h -// Purpose: wxListCtrl class -// Author: Vadim Zeitlin -// Modified by: -// Created: 04.12.99 -// RCS-ID: $Id: listbase.h 46313 2007-06-03 22:38:28Z VZ $ -// Copyright: (c) wxWidgets team -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_LISTBASE_H_BASE_ -#define _WX_LISTBASE_H_BASE_ - -#include "wx/colour.h" -#include "wx/font.h" -#include "wx/gdicmn.h" -#include "wx/event.h" - -// ---------------------------------------------------------------------------- -// types -// ---------------------------------------------------------------------------- - -// type of compare function for wxListCtrl sort operation -typedef int (wxCALLBACK *wxListCtrlCompare)(long item1, long item2, long sortData); - -// ---------------------------------------------------------------------------- -// wxListCtrl constants -// ---------------------------------------------------------------------------- - -// style flags -#define wxLC_VRULES 0x0001 -#define wxLC_HRULES 0x0002 - -#define wxLC_ICON 0x0004 -#define wxLC_SMALL_ICON 0x0008 -#define wxLC_LIST 0x0010 -#define wxLC_REPORT 0x0020 - -#define wxLC_ALIGN_TOP 0x0040 -#define wxLC_ALIGN_LEFT 0x0080 -#define wxLC_AUTOARRANGE 0x0100 -#define wxLC_VIRTUAL 0x0200 -#define wxLC_EDIT_LABELS 0x0400 -#define wxLC_NO_HEADER 0x0800 -#define wxLC_NO_SORT_HEADER 0x1000 -#define wxLC_SINGLE_SEL 0x2000 -#define wxLC_SORT_ASCENDING 0x4000 -#define wxLC_SORT_DESCENDING 0x8000 - -#define wxLC_MASK_TYPE (wxLC_ICON | wxLC_SMALL_ICON | wxLC_LIST | wxLC_REPORT) -#define wxLC_MASK_ALIGN (wxLC_ALIGN_TOP | wxLC_ALIGN_LEFT) -#define wxLC_MASK_SORT (wxLC_SORT_ASCENDING | wxLC_SORT_DESCENDING) - -// for compatibility only -#define wxLC_USER_TEXT wxLC_VIRTUAL - -// Omitted because -// (a) too much detail -// (b) not enough style flags -// (c) not implemented anyhow in the generic version -// -// #define wxLC_NO_SCROLL -// #define wxLC_NO_LABEL_WRAP -// #define wxLC_OWNERDRAW_FIXED -// #define wxLC_SHOW_SEL_ALWAYS - -// 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 // MSW only -#define wxLIST_STATE_FOCUSED 0x0002 -#define wxLIST_STATE_SELECTED 0x0004 -#define wxLIST_STATE_CUT 0x0008 // MSW only -#define wxLIST_STATE_DISABLED 0x0010 // OS2 only -#define wxLIST_STATE_FILTERED 0x0020 // OS2 only -#define wxLIST_STATE_INUSE 0x0040 // OS2 only -#define wxLIST_STATE_PICKED 0x0080 // OS2 only -#define wxLIST_STATE_SOURCE 0x0100 // OS2 only - -// 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) - -// GetSubItemRect constants -#define wxLIST_GETSUBITEMRECT_WHOLEITEM -1l - -// Flags for GetNextItem (MSW only except wxLIST_NEXT_ALL) -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 (MSW only except wxLIST_ALIGN_LEFT) -enum -{ - wxLIST_ALIGN_DEFAULT, - wxLIST_ALIGN_LEFT, - wxLIST_ALIGN_TOP, - wxLIST_ALIGN_SNAP_TO_GRID -}; - -// Column format (MSW only except wxLIST_FORMAT_LEFT) -enum wxListColumnFormat -{ - 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 // partly supported by generic version -}; - -// Flag values for GetItemRect -enum -{ - wxLIST_RECT_BOUNDS, - wxLIST_RECT_ICON, - wxLIST_RECT_LABEL -}; - -// Flag values for FindItem (MSW only) -enum -{ - wxLIST_FIND_UP, - wxLIST_FIND_DOWN, - wxLIST_FIND_LEFT, - wxLIST_FIND_RIGHT -}; - -// ---------------------------------------------------------------------------- -// wxListItemAttr: a structure containing the visual attributes of an item -// ---------------------------------------------------------------------------- - -// TODO: this should be renamed to wxItemAttr or something general like this -// and used as base class for wxTextAttr which duplicates this class -// entirely currently -class WXDLLEXPORT wxListItemAttr -{ -public: - // ctors - wxListItemAttr() { } - wxListItemAttr(const wxColour& colText, - const wxColour& colBack, - const wxFont& font) - : m_colText(colText), m_colBack(colBack), m_font(font) - { - } - - // default copy ctor, assignment operator and dtor are ok - - - // setters - void SetTextColour(const wxColour& colText) { m_colText = colText; } - void SetBackgroundColour(const wxColour& colBack) { m_colBack = colBack; } - void SetFont(const wxFont& font) { m_font = font; } - - // accessors - bool HasTextColour() const { return m_colText.Ok(); } - bool HasBackgroundColour() const { return m_colBack.Ok(); } - bool HasFont() const { return m_font.Ok(); } - - const wxColour& GetTextColour() const { return m_colText; } - const wxColour& GetBackgroundColour() const { return m_colBack; } - const wxFont& GetFont() const { return m_font; } - - - // this is almost like assignment operator except it doesn't overwrite the - // fields unset in the source attribute - void AssignFrom(const wxListItemAttr& source) - { - if ( source.HasTextColour() ) - SetTextColour(source.GetTextColour()); - if ( source.HasBackgroundColour() ) - SetBackgroundColour(source.GetBackgroundColour()); - if ( source.HasFont() ) - SetFont(source.GetFont()); - } - -private: - wxColour m_colText, - m_colBack; - wxFont m_font; -}; - -// ---------------------------------------------------------------------------- -// wxListItem: the item or column info, used to exchange data with wxListCtrl -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxListItem : public wxObject -{ -public: - wxListItem() { Init(); m_attr = NULL; } - wxListItem(const wxListItem& item) - : wxObject(), - m_mask(item.m_mask), - m_itemId(item.m_itemId), - m_col(item.m_col), - m_state(item.m_state), - m_stateMask(item.m_stateMask), - m_text(item.m_text), - m_image(item.m_image), - m_data(item.m_data), - m_format(item.m_format), - m_width(item.m_width), - m_attr(NULL) - { - // copy list item attributes - if ( item.HasAttributes() ) - m_attr = new wxListItemAttr(*item.GetAttributes()); - } - virtual ~wxListItem() { delete m_attr; } - - // resetting - void Clear() { Init(); m_text.clear(); ClearAttributes(); } - void ClearAttributes() { if ( m_attr ) { delete m_attr; m_attr = NULL; } } - - // setters - void SetMask(long mask) - { m_mask = mask; } - void SetId(long id) - { m_itemId = id; } - void SetColumn(int col) - { m_col = col; } - void SetState(long state) - { m_mask |= wxLIST_MASK_STATE; m_state = state; m_stateMask |= state; } - void SetStateMask(long stateMask) - { m_stateMask = stateMask; } - void SetText(const wxString& text) - { m_mask |= wxLIST_MASK_TEXT; m_text = text; } - void SetImage(int image) - { m_mask |= wxLIST_MASK_IMAGE; m_image = image; } - void SetData(long data) - { m_mask |= wxLIST_MASK_DATA; m_data = data; } - void SetData(void *data) - { m_mask |= wxLIST_MASK_DATA; m_data = wxPtrToUInt(data); } - - void SetWidth(int width) - { m_mask |= wxLIST_MASK_WIDTH; m_width = width; } - void SetAlign(wxListColumnFormat align) - { m_mask |= wxLIST_MASK_FORMAT; m_format = align; } - - void SetTextColour(const wxColour& colText) - { Attributes().SetTextColour(colText); } - void SetBackgroundColour(const wxColour& colBack) - { Attributes().SetBackgroundColour(colBack); } - void SetFont(const wxFont& font) - { Attributes().SetFont(font); } - - // accessors - long GetMask() const { return m_mask; } - long GetId() const { return m_itemId; } - int GetColumn() const { return m_col; } - long GetState() const { return m_state & m_stateMask; } - const wxString& GetText() const { return m_text; } - int GetImage() const { return m_image; } - wxUIntPtr GetData() const { return m_data; } - - int GetWidth() const { return m_width; } - wxListColumnFormat GetAlign() const { return (wxListColumnFormat)m_format; } - - wxListItemAttr *GetAttributes() const { return m_attr; } - bool HasAttributes() const { return m_attr != NULL; } - - wxColour GetTextColour() const - { return HasAttributes() ? m_attr->GetTextColour() : wxNullColour; } - wxColour GetBackgroundColour() const - { return HasAttributes() ? m_attr->GetBackgroundColour() - : wxNullColour; } - wxFont GetFont() const - { return HasAttributes() ? m_attr->GetFont() : wxNullFont; } - - // this conversion is necessary to make old code using GetItem() to - // compile - operator long() const { return m_itemId; } - - // these members are public for compatibility - - 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 - wxUIntPtr m_data; // App-defined data - - // For columns only - int m_format; // left, right, centre - int m_width; // width of column - -#ifdef __WXPM__ - int m_miniImage; // handle to the mini image for OS/2 -#endif - -protected: - // creates m_attr if we don't have it yet - wxListItemAttr& Attributes() - { - if ( !m_attr ) - m_attr = new wxListItemAttr; - - return *m_attr; - } - - void Init() - { - m_mask = 0; - m_itemId = 0; - m_col = 0; - m_state = 0; - m_stateMask = 0; - m_image = -1; - m_data = 0; - - m_format = wxLIST_FORMAT_CENTRE; - m_width = 0; - } - - wxListItemAttr *m_attr; // optional pointer to the items style - -private: - // VZ: this is strange, we have a copy ctor but not operator=(), why? - wxListItem& operator=(const wxListItem& item); - - DECLARE_DYNAMIC_CLASS(wxListItem) -}; - -// ---------------------------------------------------------------------------- -// wxListEvent - the event class for the wxListCtrl notifications -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxListEvent : public wxNotifyEvent -{ -public: - wxListEvent(wxEventType commandType = wxEVT_NULL, int winid = 0) - : wxNotifyEvent(commandType, winid) - , m_code(0) - , m_oldItemIndex(0) - , m_itemIndex(0) - , m_col(0) - , m_pointDrag() - , m_item() - , m_editCancelled(false) - { } - - wxListEvent(const wxListEvent& event) - : wxNotifyEvent(event) - , m_code(event.m_code) - , m_oldItemIndex(event.m_oldItemIndex) - , m_itemIndex(event.m_itemIndex) - , m_col(event.m_col) - , m_pointDrag(event.m_pointDrag) - , m_item(event.m_item) - , m_editCancelled(event.m_editCancelled) - { } - - int GetKeyCode() const { return m_code; } - long GetIndex() const { return m_itemIndex; } - int GetColumn() const { return m_col; } - wxPoint GetPoint() const { return m_pointDrag; } - const wxString& GetLabel() const { return m_item.m_text; } - const wxString& GetText() const { return m_item.m_text; } - int GetImage() const { return m_item.m_image; } - long GetData() const { return wx_static_cast(long, m_item.m_data); } - long GetMask() const { return m_item.m_mask; } - const wxListItem& GetItem() const { return m_item; } - - // for wxEVT_COMMAND_LIST_CACHE_HINT only - long GetCacheFrom() const { return m_oldItemIndex; } - long GetCacheTo() const { return m_itemIndex; } - - // was label editing canceled? (for wxEVT_COMMAND_LIST_END_LABEL_EDIT only) - bool IsEditCancelled() const { return m_editCancelled; } - void SetEditCanceled(bool editCancelled) { m_editCancelled = editCancelled; } - - virtual wxEvent *Clone() const { return new wxListEvent(*this); } - -//protected: -- not for backwards compatibility - int m_code; - long m_oldItemIndex; // only for wxEVT_COMMAND_LIST_CACHE_HINT - long m_itemIndex; - int m_col; - wxPoint m_pointDrag; - - wxListItem m_item; - -protected: - bool m_editCancelled; - -private: - DECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxListEvent) -}; - -// ---------------------------------------------------------------------------- -// wxListCtrl event macros -// ---------------------------------------------------------------------------- - -BEGIN_DECLARE_EVENT_TYPES() - DECLARE_EVENT_TYPE(wxEVT_COMMAND_LIST_BEGIN_DRAG, 700) - DECLARE_EVENT_TYPE(wxEVT_COMMAND_LIST_BEGIN_RDRAG, 701) - DECLARE_EVENT_TYPE(wxEVT_COMMAND_LIST_BEGIN_LABEL_EDIT, 702) - DECLARE_EVENT_TYPE(wxEVT_COMMAND_LIST_END_LABEL_EDIT, 703) - DECLARE_EVENT_TYPE(wxEVT_COMMAND_LIST_DELETE_ITEM, 704) - DECLARE_EVENT_TYPE(wxEVT_COMMAND_LIST_DELETE_ALL_ITEMS, 705) -#if WXWIN_COMPATIBILITY_2_4 - DECLARE_EVENT_TYPE(wxEVT_COMMAND_LIST_GET_INFO, 706) - DECLARE_EVENT_TYPE(wxEVT_COMMAND_LIST_SET_INFO, 707) -#endif - DECLARE_EVENT_TYPE(wxEVT_COMMAND_LIST_ITEM_SELECTED, 708) - DECLARE_EVENT_TYPE(wxEVT_COMMAND_LIST_ITEM_DESELECTED, 709) - DECLARE_EVENT_TYPE(wxEVT_COMMAND_LIST_KEY_DOWN, 710) - DECLARE_EVENT_TYPE(wxEVT_COMMAND_LIST_INSERT_ITEM, 711) - DECLARE_EVENT_TYPE(wxEVT_COMMAND_LIST_COL_CLICK, 712) - DECLARE_EVENT_TYPE(wxEVT_COMMAND_LIST_ITEM_RIGHT_CLICK, 713) - DECLARE_EVENT_TYPE(wxEVT_COMMAND_LIST_ITEM_MIDDLE_CLICK, 714) - DECLARE_EVENT_TYPE(wxEVT_COMMAND_LIST_ITEM_ACTIVATED, 715) - DECLARE_EVENT_TYPE(wxEVT_COMMAND_LIST_CACHE_HINT, 716) - DECLARE_EVENT_TYPE(wxEVT_COMMAND_LIST_COL_RIGHT_CLICK, 717) - DECLARE_EVENT_TYPE(wxEVT_COMMAND_LIST_COL_BEGIN_DRAG, 718) - DECLARE_EVENT_TYPE(wxEVT_COMMAND_LIST_COL_DRAGGING, 719) - DECLARE_EVENT_TYPE(wxEVT_COMMAND_LIST_COL_END_DRAG, 720) - DECLARE_EVENT_TYPE(wxEVT_COMMAND_LIST_ITEM_FOCUSED, 721) -END_DECLARE_EVENT_TYPES() - -typedef void (wxEvtHandler::*wxListEventFunction)(wxListEvent&); - -#define wxListEventHandler(func) \ - (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxListEventFunction, &func) - -#define wx__DECLARE_LISTEVT(evt, id, fn) \ - wx__DECLARE_EVT1(wxEVT_COMMAND_LIST_ ## evt, id, wxListEventHandler(fn)) - -#define EVT_LIST_BEGIN_DRAG(id, fn) wx__DECLARE_LISTEVT(BEGIN_DRAG, id, fn) -#define EVT_LIST_BEGIN_RDRAG(id, fn) wx__DECLARE_LISTEVT(BEGIN_RDRAG, id, fn) -#define EVT_LIST_BEGIN_LABEL_EDIT(id, fn) wx__DECLARE_LISTEVT(BEGIN_LABEL_EDIT, id, fn) -#define EVT_LIST_END_LABEL_EDIT(id, fn) wx__DECLARE_LISTEVT(END_LABEL_EDIT, id, fn) -#define EVT_LIST_DELETE_ITEM(id, fn) wx__DECLARE_LISTEVT(DELETE_ITEM, id, fn) -#define EVT_LIST_DELETE_ALL_ITEMS(id, fn) wx__DECLARE_LISTEVT(DELETE_ALL_ITEMS, id, fn) -#define EVT_LIST_KEY_DOWN(id, fn) wx__DECLARE_LISTEVT(KEY_DOWN, id, fn) -#define EVT_LIST_INSERT_ITEM(id, fn) wx__DECLARE_LISTEVT(INSERT_ITEM, id, fn) - -#define EVT_LIST_COL_CLICK(id, fn) wx__DECLARE_LISTEVT(COL_CLICK, id, fn) -#define EVT_LIST_COL_RIGHT_CLICK(id, fn) wx__DECLARE_LISTEVT(COL_RIGHT_CLICK, id, fn) -#define EVT_LIST_COL_BEGIN_DRAG(id, fn) wx__DECLARE_LISTEVT(COL_BEGIN_DRAG, id, fn) -#define EVT_LIST_COL_DRAGGING(id, fn) wx__DECLARE_LISTEVT(COL_DRAGGING, id, fn) -#define EVT_LIST_COL_END_DRAG(id, fn) wx__DECLARE_LISTEVT(COL_END_DRAG, id, fn) - -#define EVT_LIST_ITEM_SELECTED(id, fn) wx__DECLARE_LISTEVT(ITEM_SELECTED, id, fn) -#define EVT_LIST_ITEM_DESELECTED(id, fn) wx__DECLARE_LISTEVT(ITEM_DESELECTED, id, fn) -#define EVT_LIST_ITEM_RIGHT_CLICK(id, fn) wx__DECLARE_LISTEVT(ITEM_RIGHT_CLICK, id, fn) -#define EVT_LIST_ITEM_MIDDLE_CLICK(id, fn) wx__DECLARE_LISTEVT(ITEM_MIDDLE_CLICK, id, fn) -#define EVT_LIST_ITEM_ACTIVATED(id, fn) wx__DECLARE_LISTEVT(ITEM_ACTIVATED, id, fn) -#define EVT_LIST_ITEM_FOCUSED(id, fn) wx__DECLARE_LISTEVT(ITEM_FOCUSED, id, fn) - -#define EVT_LIST_CACHE_HINT(id, fn) wx__DECLARE_LISTEVT(CACHE_HINT, id, fn) - - -#if WXWIN_COMPATIBILITY_2_4 -#define EVT_LIST_GET_INFO(id, fn) wx__DECLARE_LISTEVT(GET_INFO, id, fn) -#define EVT_LIST_SET_INFO(id, fn) wx__DECLARE_LISTEVT(SET_INFO, id, fn) -#endif - -#endif - // _WX_LISTCTRL_H_BASE_ diff --git a/wxWidgets/include/wx/listbook.h b/wxWidgets/include/wx/listbook.h deleted file mode 100644 index fe8484ee62..0000000000 --- a/wxWidgets/include/wx/listbook.h +++ /dev/null @@ -1,152 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: wx/listbook.h -// Purpose: wxListbook: wxListCtrl and wxNotebook combination -// Author: Vadim Zeitlin -// Modified by: -// Created: 19.08.03 -// RCS-ID: $Id: listbook.h 49563 2007-10-31 20:46:21Z VZ $ -// Copyright: (c) 2003 Vadim Zeitlin <vadim@wxwidgets.org> -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_LISTBOOK_H_ -#define _WX_LISTBOOK_H_ - -#include "wx/defs.h" - -#if wxUSE_LISTBOOK - -#include "wx/bookctrl.h" - -class WXDLLIMPEXP_FWD_CORE wxListView; -class WXDLLIMPEXP_FWD_CORE wxListEvent; - -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_COMMAND_LISTBOOK_PAGE_CHANGED; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_COMMAND_LISTBOOK_PAGE_CHANGING; - -// wxListbook flags -#define wxLB_DEFAULT wxBK_DEFAULT -#define wxLB_TOP wxBK_TOP -#define wxLB_BOTTOM wxBK_BOTTOM -#define wxLB_LEFT wxBK_LEFT -#define wxLB_RIGHT wxBK_RIGHT -#define wxLB_ALIGN_MASK wxBK_ALIGN_MASK - -// ---------------------------------------------------------------------------- -// wxListbook -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxListbook : public wxBookCtrlBase -{ -public: - wxListbook() - { - Init(); - } - - wxListbook(wxWindow *parent, - wxWindowID id, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = 0, - const wxString& name = wxEmptyString) - { - Init(); - - (void)Create(parent, id, pos, size, style, name); - } - - // quasi ctor - bool Create(wxWindow *parent, - wxWindowID id, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = 0, - const wxString& name = wxEmptyString); - - - // overridden base class methods - virtual int GetSelection() const; - virtual bool SetPageText(size_t n, const wxString& strText); - virtual wxString GetPageText(size_t n) const; - virtual int GetPageImage(size_t n) const; - virtual bool SetPageImage(size_t n, int imageId); - virtual wxSize CalcSizeFromPage(const wxSize& sizePage) const; - virtual bool InsertPage(size_t n, - wxWindow *page, - const wxString& text, - bool bSelect = false, - int imageId = -1); - virtual int SetSelection(size_t n) { return DoSetSelection(n, SetSelection_SendEvent); } - virtual int ChangeSelection(size_t n) { return DoSetSelection(n); } - virtual int HitTest(const wxPoint& pt, long *flags = NULL) const; - virtual void SetImageList(wxImageList *imageList); - - virtual bool DeleteAllPages(); - - wxListView* GetListView() const { return (wxListView*)m_bookctrl; } - -protected: - virtual wxWindow *DoRemovePage(size_t page); - - // get the size which the list control should have - virtual wxSize GetControllerSize() const; - - void UpdateSelectedPage(size_t newsel); - - wxBookCtrlBaseEvent* CreatePageChangingEvent() const; - void MakeChangedEvent(wxBookCtrlBaseEvent &event); - - // event handlers - void OnListSelected(wxListEvent& event); - void OnSize(wxSizeEvent& event); - - // the currently selected page or wxNOT_FOUND if none - int m_selection; - -private: - // common part of all constructors - void Init(); - - DECLARE_EVENT_TABLE() - DECLARE_DYNAMIC_CLASS_NO_COPY(wxListbook) -}; - -// ---------------------------------------------------------------------------- -// listbook event class and related stuff -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxListbookEvent : public wxBookCtrlBaseEvent -{ -public: - wxListbookEvent(wxEventType commandType = wxEVT_NULL, int id = 0, - int nSel = wxNOT_FOUND, int nOldSel = wxNOT_FOUND) - : wxBookCtrlBaseEvent(commandType, id, nSel, nOldSel) - { - } - - wxListbookEvent(const wxListbookEvent& event) - : wxBookCtrlBaseEvent(event) - { - } - - virtual wxEvent *Clone() const { return new wxListbookEvent(*this); } - -private: - DECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxListbookEvent) -}; - -typedef void (wxEvtHandler::*wxListbookEventFunction)(wxListbookEvent&); - -#define wxListbookEventHandler(func) \ - (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxListbookEventFunction, &func) - -#define EVT_LISTBOOK_PAGE_CHANGED(winid, fn) \ - wx__DECLARE_EVT1(wxEVT_COMMAND_LISTBOOK_PAGE_CHANGED, winid, wxListbookEventHandler(fn)) - -#define EVT_LISTBOOK_PAGE_CHANGING(winid, fn) \ - wx__DECLARE_EVT1(wxEVT_COMMAND_LISTBOOK_PAGE_CHANGING, winid, wxListbookEventHandler(fn)) - -#endif // wxUSE_LISTBOOK - -#endif // _WX_LISTBOOK_H_ diff --git a/wxWidgets/include/wx/listbox.h b/wxWidgets/include/wx/listbox.h deleted file mode 100644 index c6a669d5c1..0000000000 --- a/wxWidgets/include/wx/listbox.h +++ /dev/null @@ -1,166 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: wx/listbox.h -// Purpose: wxListBox class interface -// Author: Vadim Zeitlin -// Modified by: -// Created: 22.10.99 -// RCS-ID: $Id: listbox.h 49563 2007-10-31 20:46:21Z VZ $ -// Copyright: (c) wxWidgets team -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_LISTBOX_H_BASE_ -#define _WX_LISTBOX_H_BASE_ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -#include "wx/defs.h" - -#if wxUSE_LISTBOX - -#include "wx/ctrlsub.h" // base class - -// forward declarations are enough here -class WXDLLIMPEXP_FWD_BASE wxArrayInt; -class WXDLLIMPEXP_FWD_BASE wxArrayString; - -// ---------------------------------------------------------------------------- -// global data -// ---------------------------------------------------------------------------- - -extern WXDLLEXPORT_DATA(const wxChar) wxListBoxNameStr[]; - -// ---------------------------------------------------------------------------- -// wxListBox interface is defined by the class wxListBoxBase -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxListBoxBase : public wxControlWithItems -{ -public: - wxListBoxBase() { } - virtual ~wxListBoxBase(); - - // all generic methods are in wxControlWithItems, except for the following - // ones which are not yet implemented by wxChoice/wxComboBox - void Insert(const wxString& item, unsigned int pos) - { /* return*/ wxControlWithItems::Insert(item,pos); } - void Insert(const wxString& item, unsigned int pos, void *clientData) - { /* return*/ wxControlWithItems::Insert(item,pos,clientData); } - void Insert(const wxString& item, unsigned int pos, wxClientData *clientData) - { /* return*/ wxControlWithItems::Insert(item,pos,clientData); } - - void InsertItems(unsigned int nItems, const wxString *items, unsigned int pos); - void InsertItems(const wxArrayString& items, unsigned int pos) - { DoInsertItems(items, pos); } - - void Set(int n, const wxString* items, void **clientData = NULL); - void Set(const wxArrayString& items, void **clientData = NULL) - { DoSetItems(items, clientData); } - - // multiple selection logic - virtual bool IsSelected(int n) const = 0; - virtual void SetSelection(int n) { DoSetSelection(n, true); } - void SetSelection(int n, bool select) { DoSetSelection(n, select); } - void Deselect(int n) { DoSetSelection(n, false); } - void DeselectAll(int itemToLeaveSelected = -1); - - virtual bool SetStringSelection(const wxString& s, bool select); - virtual bool SetStringSelection(const wxString& s) - { - return SetStringSelection(s, true); - } - - // works for single as well as multiple selection listboxes (unlike - // GetSelection which only works for listboxes with single selection) - virtual int GetSelections(wxArrayInt& aSelections) const = 0; - - // set the specified item at the first visible item or scroll to max - // range. - void SetFirstItem(int n) { DoSetFirstItem(n); } - void SetFirstItem(const wxString& s); - - // ensures that the given item is visible scrolling the listbox if - // necessary - virtual void EnsureVisible(int n); - - // a combination of Append() and EnsureVisible(): appends the item to the - // listbox and ensures that it is visible i.e. not scrolled out of view - void AppendAndEnsureVisible(const wxString& s); - - // return true if the listbox allows multiple selection - bool HasMultipleSelection() const - { - return (m_windowStyle & wxLB_MULTIPLE) || - (m_windowStyle & wxLB_EXTENDED); - } - - // return true if this listbox is sorted - bool IsSorted() const { return (m_windowStyle & wxLB_SORT) != 0; } - - // emulate selecting or deselecting the item event.GetInt() (depending on - // event.GetExtraLong()) - void Command(wxCommandEvent& event); - - // returns the item number at a point or wxNOT_FOUND - int HitTest(const wxPoint& point) const { return DoListHitTest(point); } - -#if WXWIN_COMPATIBILITY_2_6 - // compatibility - these functions are deprecated, use the new ones - // instead - wxDEPRECATED( bool Selected(int n) const ); -#endif // WXWIN_COMPATIBILITY_2_6 - -protected: - // NB: due to wxGTK implementation details, DoInsert() is implemented - // using DoInsertItems() and not the other way round - virtual int DoInsert(const wxString& item, unsigned int pos) - { InsertItems(1, &item, pos); return pos; } - - // to be implemented in derived classes - virtual void DoInsertItems(const wxArrayString& items, unsigned int pos) = 0; - virtual void DoSetItems(const wxArrayString& items, void **clientData) = 0; - - virtual void DoSetFirstItem(int n) = 0; - - virtual void DoSetSelection(int n, bool select) = 0; - - // there is already wxWindow::DoHitTest() so call this one differently - virtual int DoListHitTest(const wxPoint& WXUNUSED(point)) const - { return wxNOT_FOUND; } - - - DECLARE_NO_COPY_CLASS(wxListBoxBase) -}; - -#if WXWIN_COMPATIBILITY_2_6 - inline bool wxListBoxBase::Selected(int n) const { return IsSelected(n); } -#endif // WXWIN_COMPATIBILITY_2_6 - -// ---------------------------------------------------------------------------- -// include the platform-specific class declaration -// ---------------------------------------------------------------------------- - -#if defined(__WXUNIVERSAL__) - #include "wx/univ/listbox.h" -#elif defined(__WXMSW__) - #include "wx/msw/listbox.h" -#elif defined(__WXMOTIF__) - #include "wx/motif/listbox.h" -#elif defined(__WXGTK20__) - #include "wx/gtk/listbox.h" -#elif defined(__WXGTK__) - #include "wx/gtk1/listbox.h" -#elif defined(__WXMAC__) - #include "wx/mac/listbox.h" -#elif defined(__WXPM__) - #include "wx/os2/listbox.h" -#elif defined(__WXCOCOA__) - #include "wx/cocoa/listbox.h" -#endif - -#endif // wxUSE_LISTBOX - -#endif - // _WX_LISTBOX_H_BASE_ diff --git a/wxWidgets/include/wx/listctrl.h b/wxWidgets/include/wx/listctrl.h deleted file mode 100644 index 96b6fa7b1c..0000000000 --- a/wxWidgets/include/wx/listctrl.h +++ /dev/null @@ -1,110 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: wx/listctrl.h -// Purpose: wxListCtrl class -// Author: Vadim Zeitlin -// Modified by: -// Created: 04.12.99 -// RCS-ID: $Id: listctrl.h 46432 2007-06-13 03:46:20Z SC $ -// Copyright: (c) wxWidgets team -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_LISTCTRL_H_BASE_ -#define _WX_LISTCTRL_H_BASE_ - -#include "wx/defs.h" // headers should include this before first wxUSE_XXX check - -#if wxUSE_LISTCTRL - -#include "wx/listbase.h" - -// ---------------------------------------------------------------------------- -// constants -// ---------------------------------------------------------------------------- - -extern WXDLLEXPORT_DATA(const wxChar) wxListCtrlNameStr[]; - -// ---------------------------------------------------------------------------- -// include the wxListCtrl class declaration -// ---------------------------------------------------------------------------- - -#if defined(__WIN32__) && !defined(__WXUNIVERSAL__) - #include "wx/msw/listctrl.h" -#elif defined(__WXMAC__) && !defined(__WXUNIVERSAL__) - #include "wx/mac/carbon/listctrl.h" -#else - #include "wx/generic/listctrl.h" -#endif - -// ---------------------------------------------------------------------------- -// wxListView: a class which provides a better API for list control -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxListView : public wxListCtrl -{ -public: - wxListView() { } - wxListView( wxWindow *parent, - wxWindowID winid = wxID_ANY, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = wxLC_REPORT, - const wxValidator& validator = wxDefaultValidator, - const wxString &name = wxListCtrlNameStr) - { - Create(parent, winid, pos, size, style, validator, name); - } - - // focus/selection stuff - // --------------------- - - // [de]select an item - void Select(long n, bool on = true) - { - SetItemState(n, on ? wxLIST_STATE_SELECTED : 0, wxLIST_STATE_SELECTED); - } - - // focus and show the given item - void Focus(long index) - { - SetItemState(index, wxLIST_STATE_FOCUSED, wxLIST_STATE_FOCUSED); - EnsureVisible(index); - } - - // get the currently focused item or -1 if none - long GetFocusedItem() const - { - return GetNextItem(-1, wxLIST_NEXT_ALL, wxLIST_STATE_FOCUSED); - } - - // get first and subsequent selected items, return -1 when no more - long GetNextSelected(long item) const - { return GetNextItem(item, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED); } - long GetFirstSelected() const - { return GetNextSelected(-1); } - - // return true if the item is selected - bool IsSelected(long index) const - { return GetItemState(index, wxLIST_STATE_SELECTED) != 0; } - - // columns - // ------- - - void SetColumnImage(int col, int image) - { - wxListItem item; - item.SetMask(wxLIST_MASK_IMAGE); - item.SetImage(image); - SetColumn(col, item); - } - - void ClearColumnImage(int col) { SetColumnImage(col, -1); } - -private: - DECLARE_DYNAMIC_CLASS_NO_COPY(wxListView) -}; - -#endif // wxUSE_LISTCTRL - -#endif - // _WX_LISTCTRL_H_BASE_ diff --git a/wxWidgets/include/wx/listimpl.cpp b/wxWidgets/include/wx/listimpl.cpp deleted file mode 100644 index d43cfe99ad..0000000000 --- a/wxWidgets/include/wx/listimpl.cpp +++ /dev/null @@ -1,39 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: listimpl.cpp -// Purpose: second-part of macro based implementation of template lists -// Author: Vadim Zeitlin -// Modified by: -// Created: 16/11/98 -// RCS-ID: $Id: listimpl.cpp 38893 2006-04-24 17:59:10Z VZ $ -// Copyright: (c) 1998 Vadim Zeitlin -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#if wxUSE_STL - -#undef WX_DEFINE_LIST -#define WX_DEFINE_LIST(name) \ - void _WX_LIST_HELPER_##name::DeleteFunction( _WX_LIST_ITEM_TYPE_##name X )\ - { \ - delete X; \ - } \ - name::BaseListType name::EmptyList; - -#else // !wxUSE_STL - - #define _DEFINE_LIST(T, name) \ - void wx##name##Node::DeleteData() \ - { \ - delete (T *)GetData(); \ - } - - // redefine the macro so that now it will generate the class implementation - // old value would provoke a compile-time error if this file is not included - #undef WX_DEFINE_LIST - #define WX_DEFINE_LIST(name) _DEFINE_LIST(_WX_LIST_ITEM_TYPE_##name, name) - - // don't pollute preprocessor's name space - //#undef _DEFINE_LIST - -#endif // wxUSE_STL/!wxUSE_STL - diff --git a/wxWidgets/include/wx/log.h b/wxWidgets/include/wx/log.h deleted file mode 100644 index 288e8e5525..0000000000 --- a/wxWidgets/include/wx/log.h +++ /dev/null @@ -1,653 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/log.h -// Purpose: Assorted wxLogXXX functions, and wxLog (sink for logs) -// Author: Vadim Zeitlin -// Modified by: -// Created: 29/01/98 -// RCS-ID: $Id: log.h 50993 2008-01-02 21:18:15Z VZ $ -// Copyright: (c) 1998 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr> -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_LOG_H_ -#define _WX_LOG_H_ - -#include "wx/defs.h" - -// ---------------------------------------------------------------------------- -// common constants for use in wxUSE_LOG/!wxUSE_LOG -// ---------------------------------------------------------------------------- - -// the trace masks have been superceded by symbolic trace constants, they're -// for compatibility only andwill be removed soon - do NOT use them - -// meaning of different bits of the trace mask (which allows selectively -// enable/disable some trace messages) -#define wxTraceMemAlloc 0x0001 // trace memory allocation (new/delete) -#define wxTraceMessages 0x0002 // trace window messages/X callbacks -#define wxTraceResAlloc 0x0004 // trace GDI resource allocation -#define wxTraceRefCount 0x0008 // trace various ref counting operations - -#ifdef __WXMSW__ - #define wxTraceOleCalls 0x0100 // OLE interface calls -#endif - -// ---------------------------------------------------------------------------- -// types -// ---------------------------------------------------------------------------- - -// NB: these types are needed even if wxUSE_LOG == 0 -typedef unsigned long wxTraceMask; -typedef unsigned long wxLogLevel; - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -#include "wx/string.h" - -#if wxUSE_LOG - -#include "wx/arrstr.h" - -#ifndef __WXWINCE__ - #include <time.h> // for time_t -#endif - -#include "wx/dynarray.h" - -#ifndef wxUSE_LOG_DEBUG -# ifdef __WXDEBUG__ -# define wxUSE_LOG_DEBUG 1 -# else // !__WXDEBUG__ -# define wxUSE_LOG_DEBUG 0 -# endif -#endif - -// ---------------------------------------------------------------------------- -// forward declarations -// ---------------------------------------------------------------------------- - -#if wxUSE_GUI - class WXDLLIMPEXP_FWD_CORE wxTextCtrl; - class WXDLLIMPEXP_FWD_CORE wxLogFrame; - class WXDLLIMPEXP_FWD_CORE wxFrame; - class WXDLLIMPEXP_FWD_CORE wxWindow; -#endif // wxUSE_GUI - -// ---------------------------------------------------------------------------- -// constants -// ---------------------------------------------------------------------------- - -// different standard log levels (you may also define your own) -enum -{ - wxLOG_FatalError, // program can't continue, abort immediately - wxLOG_Error, // a serious error, user must be informed about it - wxLOG_Warning, // user is normally informed about it but may be ignored - wxLOG_Message, // normal message (i.e. normal output of a non GUI app) - wxLOG_Status, // informational: might go to the status line of GUI app - wxLOG_Info, // informational message (a.k.a. 'Verbose') - wxLOG_Debug, // never shown to the user, disabled in release mode - wxLOG_Trace, // trace messages are also only enabled in debug mode - wxLOG_Progress, // used for progress indicator (not yet) - wxLOG_User = 100, // user defined levels start here - wxLOG_Max = 10000 -}; - -// symbolic trace masks - wxLogTrace("foo", "some trace message...") will be -// discarded unless the string "foo" has been added to the list of allowed -// ones with AddTraceMask() - -#define wxTRACE_MemAlloc wxT("memalloc") // trace memory allocation (new/delete) -#define wxTRACE_Messages wxT("messages") // trace window messages/X callbacks -#define wxTRACE_ResAlloc wxT("resalloc") // trace GDI resource allocation -#define wxTRACE_RefCount wxT("refcount") // trace various ref counting operations - -#ifdef __WXMSW__ - #define wxTRACE_OleCalls wxT("ole") // OLE interface calls -#endif - -#include "wx/iosfwrap.h" - -// ---------------------------------------------------------------------------- -// derive from this class to redirect (or suppress, or ...) log messages -// normally, only a single instance of this class exists but it's not enforced -// ---------------------------------------------------------------------------- - -class WXDLLIMPEXP_BASE wxLog -{ -public: - // ctor - wxLog(){} - - // these functions allow to completely disable all log messages - - // is logging disabled now? - static bool IsEnabled() { return ms_doLog; } - - // change the flag state, return the previous one - static bool EnableLogging(bool doIt = true) - { bool doLogOld = ms_doLog; ms_doLog = doIt; return doLogOld; } - - // static sink function - see DoLog() for function to overload in the - // derived classes - static void OnLog(wxLogLevel level, const wxChar *szString, time_t t); - - // message buffering - - // flush shows all messages if they're not logged immediately (FILE - // and iostream logs don't need it, but wxGuiLog does to avoid showing - // 17 modal dialogs one after another) - virtual void Flush(); - - // flush the active target if any - static void FlushActive() - { - if ( !ms_suspendCount ) - { - wxLog *log = GetActiveTarget(); - if ( log ) - log->Flush(); - } - } - - // only one sink is active at each moment - // get current log target, will call wxApp::CreateLogTarget() to - // create one if none exists - static wxLog *GetActiveTarget(); - - // change log target, pLogger may be NULL - static wxLog *SetActiveTarget(wxLog *pLogger); - - // suspend the message flushing of the main target until the next call - // to Resume() - this is mainly for internal use (to prevent wxYield() - // from flashing the messages) - static void Suspend() { ms_suspendCount++; } - - // must be called for each Suspend()! - static void Resume() { ms_suspendCount--; } - - // functions controlling the default wxLog behaviour - // verbose mode is activated by standard command-line '-verbose' - // option - static void SetVerbose(bool bVerbose = true) { ms_bVerbose = bVerbose; } - - // Set log level. Log messages with level > logLevel will not be logged. - static void SetLogLevel(wxLogLevel logLevel) { ms_logLevel = logLevel; } - -#if wxABI_VERSION >= 20805 /* 2.8.5+ only */ - // should GetActiveTarget() try to create a new log object if the - // current is NULL? - static void DontCreateOnDemand(); -#endif - - // Make GetActiveTarget() create a new log object again. - static void DoCreateOnDemand(); - - // log the count of repeating messages instead of logging the messages - // multiple times - static void SetRepetitionCounting(bool bRepetCounting = true) - { ms_bRepetCounting = bRepetCounting; } - - // gets duplicate counting status - static bool GetRepetitionCounting() { return ms_bRepetCounting; } - - // trace mask (see wxTraceXXX constants for details) - static void SetTraceMask(wxTraceMask ulMask) { ms_ulTraceMask = ulMask; } - - // add string trace mask - static void AddTraceMask(const wxString& str) - { ms_aTraceMasks.push_back(str); } - - // add string trace mask - static void RemoveTraceMask(const wxString& str); - - // remove all string trace masks - static void ClearTraceMasks(); - - // get string trace masks - static const wxArrayString &GetTraceMasks() { return ms_aTraceMasks; } - - // sets the timestamp string: this is used as strftime() format string - // for the log targets which add time stamps to the messages - set it - // to NULL to disable time stamping completely. - static void SetTimestamp(const wxChar *ts) { ms_timestamp = ts; } - - - // accessors - - // gets the verbose status - static bool GetVerbose() { return ms_bVerbose; } - - // get trace mask - static wxTraceMask GetTraceMask() { return ms_ulTraceMask; } - - // is this trace mask in the list? - static bool IsAllowedTraceMask(const wxChar *mask); - - // return the current loglevel limit - static wxLogLevel GetLogLevel() { return ms_logLevel; } - - // get the current timestamp format string (may be NULL) - static const wxChar *GetTimestamp() { return ms_timestamp; } - - - // helpers - - // put the time stamp into the string if ms_timestamp != NULL (don't - // change it otherwise) - static void TimeStamp(wxString *str); - - // make dtor virtual for all derived classes - virtual ~wxLog(); - - - // this method exists for backwards compatibility only, don't use - bool HasPendingMessages() const { return true; } - -#if WXWIN_COMPATIBILITY_2_6 - // this function doesn't do anything any more, don't call it - wxDEPRECATED( static wxChar *SetLogBuffer(wxChar *buf, size_t size = 0) ); -#endif - -protected: - // the logging functions that can be overriden - - // default DoLog() prepends the time stamp and a prefix corresponding - // to the message to szString and then passes it to DoLogString() - virtual void DoLog(wxLogLevel level, const wxChar *szString, time_t t); - - // default DoLogString does nothing but is not pure virtual because if - // you override DoLog() you might not need it at all - virtual void DoLogString(const wxChar *szString, time_t t); - - // log a line containing the number of times the previous message was - // repeated and returns this number (which can be 0) - static unsigned DoLogNumberOfRepeats(); - -private: - // static variables - // ---------------- - - // traditional behaviour or counting repetitions - static bool ms_bRepetCounting; - static wxString ms_prevString; // previous message that was logged - // how many times the previous message was logged - static unsigned ms_prevCounter; - static time_t ms_prevTimeStamp;// timestamp of the previous message - static wxLogLevel ms_prevLevel; // level of the previous message - - static wxLog *ms_pLogger; // currently active log sink - static bool ms_doLog; // false => all logging disabled - static bool ms_bAutoCreate; // create new log targets on demand? - static bool ms_bVerbose; // false => ignore LogInfo messages - - static wxLogLevel ms_logLevel; // limit logging to levels <= ms_logLevel - - static size_t ms_suspendCount; // if positive, logs are not flushed - - // format string for strftime(), if NULL, time stamping log messages is - // disabled - static const wxChar *ms_timestamp; - - static wxTraceMask ms_ulTraceMask; // controls wxLogTrace behaviour - static wxArrayString ms_aTraceMasks; // more powerful filter for wxLogTrace - - - // this is the replacement of DoLogNumberOfRepeats() (which has to be kept - // to avoid breaking ABI in this version) - unsigned LogLastRepeatIfNeeded(); - - // implementation of the function above which supposes that the caller had - // already locked gs_prevCS - unsigned LogLastRepeatIfNeededUnlocked(); -}; - -// ---------------------------------------------------------------------------- -// "trivial" derivations of wxLog -// ---------------------------------------------------------------------------- - -// log everything to a buffer -class WXDLLIMPEXP_BASE wxLogBuffer : public wxLog -{ -public: - wxLogBuffer() { } - - // get the string contents with all messages logged - const wxString& GetBuffer() const { return m_str; } - - // show the buffer contents to the user in the best possible way (this uses - // wxMessageOutputMessageBox) and clear it - virtual void Flush(); - -protected: - virtual void DoLog(wxLogLevel level, const wxChar *szString, time_t t); - virtual void DoLogString(const wxChar *szString, time_t t); - -private: - wxString m_str; - - DECLARE_NO_COPY_CLASS(wxLogBuffer) -}; - - -// log everything to a "FILE *", stderr by default -class WXDLLIMPEXP_BASE wxLogStderr : public wxLog -{ -public: - // redirect log output to a FILE - wxLogStderr(FILE *fp = (FILE *) NULL); - -protected: - // implement sink function - virtual void DoLogString(const wxChar *szString, time_t t); - - FILE *m_fp; - - DECLARE_NO_COPY_CLASS(wxLogStderr) -}; - -#if wxUSE_STD_IOSTREAM - -// log everything to an "ostream", cerr by default -class WXDLLIMPEXP_BASE wxLogStream : public wxLog -{ -public: - // redirect log output to an ostream - wxLogStream(wxSTD ostream *ostr = (wxSTD ostream *) NULL); - -protected: - // implement sink function - virtual void DoLogString(const wxChar *szString, time_t t); - - // using ptr here to avoid including <iostream.h> from this file - wxSTD ostream *m_ostr; -}; - -#endif // wxUSE_STD_IOSTREAM - -// ---------------------------------------------------------------------------- -// /dev/null log target: suppress logging until this object goes out of scope -// ---------------------------------------------------------------------------- - -// example of usage: -/* - void Foo() - { - wxFile file; - - // wxFile.Open() normally complains if file can't be opened, we don't - // want it - wxLogNull logNo; - - if ( !file.Open("bar") ) - ... process error ourselves ... - - // ~wxLogNull called, old log sink restored - } - */ -class WXDLLIMPEXP_BASE wxLogNull -{ -public: - wxLogNull() : m_flagOld(wxLog::EnableLogging(false)) { } - ~wxLogNull() { (void)wxLog::EnableLogging(m_flagOld); } - -private: - bool m_flagOld; // the previous value of the wxLog::ms_doLog -}; - -// ---------------------------------------------------------------------------- -// chaining log target: installs itself as a log target and passes all -// messages to the real log target given to it in the ctor but also forwards -// them to the previously active one -// -// note that you don't have to call SetActiveTarget() with this class, it -// does it itself in its ctor -// ---------------------------------------------------------------------------- - -class WXDLLIMPEXP_BASE wxLogChain : public wxLog -{ -public: - wxLogChain(wxLog *logger); - virtual ~wxLogChain(); - - // change the new log target - void SetLog(wxLog *logger); - - // this can be used to temporarily disable (and then reenable) passing - // messages to the old logger (by default we do pass them) - void PassMessages(bool bDoPass) { m_bPassMessages = bDoPass; } - - // are we passing the messages to the previous log target? - bool IsPassingMessages() const { return m_bPassMessages; } - - // return the previous log target (may be NULL) - wxLog *GetOldLog() const { return m_logOld; } - - // override base class version to flush the old logger as well - virtual void Flush(); - - // call to avoid destroying the old log target -#if wxABI_VERSION >= 20805 /* 2.8.5+ only */ - void DetachOldLog() { m_logOld = NULL; } -#endif - -protected: - // pass the chain to the old logger if needed - virtual void DoLog(wxLogLevel level, const wxChar *szString, time_t t); - -private: - // the current log target - wxLog *m_logNew; - - // the previous log target - wxLog *m_logOld; - - // do we pass the messages to the old logger? - bool m_bPassMessages; - - DECLARE_NO_COPY_CLASS(wxLogChain) -}; - -// a chain log target which uses itself as the new logger -class WXDLLIMPEXP_BASE wxLogPassThrough : public wxLogChain -{ -public: - wxLogPassThrough(); - -private: - DECLARE_NO_COPY_CLASS(wxLogPassThrough) -}; - -#if wxUSE_GUI - // include GUI log targets: - #include "wx/generic/logg.h" -#endif // wxUSE_GUI - -// ============================================================================ -// global functions -// ============================================================================ - -// ---------------------------------------------------------------------------- -// Log functions should be used by application instead of stdio, iostream &c -// for log messages for easy redirection -// ---------------------------------------------------------------------------- - -// ---------------------------------------------------------------------------- -// get error code/error message from system in a portable way -// ---------------------------------------------------------------------------- - -// return the last system error code -WXDLLIMPEXP_BASE unsigned long wxSysErrorCode(); - -// return the error message for given (or last if 0) error code -WXDLLIMPEXP_BASE const wxChar* wxSysErrorMsg(unsigned long nErrCode = 0); - -// ---------------------------------------------------------------------------- -// define wxLog<level> -// ---------------------------------------------------------------------------- - -#define DECLARE_LOG_FUNCTION(level) \ -extern void WXDLLIMPEXP_BASE wxVLog##level(const wxChar *szFormat, \ - va_list argptr); \ -extern void WXDLLIMPEXP_BASE wxLog##level(const wxChar *szFormat, \ - ...) ATTRIBUTE_PRINTF_1 -#define DECLARE_LOG_FUNCTION2_EXP(level, argclass, arg, expdecl) \ -extern void expdecl wxVLog##level(argclass arg, \ - const wxChar *szFormat, \ - va_list argptr); \ -extern void expdecl wxLog##level(argclass arg, \ - const wxChar *szFormat, \ - ...) ATTRIBUTE_PRINTF_2 -#else // !wxUSE_LOG - -// log functions do nothing at all -#define DECLARE_LOG_FUNCTION(level) \ -inline void wxVLog##level(const wxChar *WXUNUSED(szFormat), \ - va_list WXUNUSED(argptr)) { } \ -inline void wxLog##level(const wxChar *WXUNUSED(szFormat), \ - ...) { } -#define DECLARE_LOG_FUNCTION2_EXP(level, argclass, arg, expdecl) \ -inline void wxVLog##level(argclass WXUNUSED(arg), \ - const wxChar *WXUNUSED(szFormat), \ - va_list WXUNUSED(argptr)) {} \ -inline void wxLog##level(argclass WXUNUSED(arg), \ - const wxChar *WXUNUSED(szFormat), \ - ...) { } - -// Empty Class to fake wxLogNull -class WXDLLIMPEXP_BASE wxLogNull -{ -public: - wxLogNull() { } -}; - -// Dummy macros to replace some functions. -#define wxSysErrorCode() (unsigned long)0 -#define wxSysErrorMsg( X ) (const wxChar*)NULL - -// Fake symbolic trace masks... for those that are used frequently -#define wxTRACE_OleCalls wxEmptyString // OLE interface calls - -#endif // wxUSE_LOG/!wxUSE_LOG - -#define DECLARE_LOG_FUNCTION2(level, argclass, arg) \ - DECLARE_LOG_FUNCTION2_EXP(level, argclass, arg, WXDLLIMPEXP_BASE) - - -// a generic function for all levels (level is passes as parameter) -DECLARE_LOG_FUNCTION2(Generic, wxLogLevel, level); - -// one function per each level -DECLARE_LOG_FUNCTION(FatalError); -DECLARE_LOG_FUNCTION(Error); -DECLARE_LOG_FUNCTION(Warning); -DECLARE_LOG_FUNCTION(Message); -DECLARE_LOG_FUNCTION(Info); -DECLARE_LOG_FUNCTION(Verbose); - -// this function sends the log message to the status line of the top level -// application frame, if any -DECLARE_LOG_FUNCTION(Status); - -#if wxUSE_GUI - // this one is the same as previous except that it allows to explicitly - class WXDLLIMPEXP_FWD_CORE wxFrame; - // specify the frame to which the output should go - DECLARE_LOG_FUNCTION2_EXP(Status, wxFrame *, pFrame, WXDLLIMPEXP_CORE); -#endif // wxUSE_GUI - -// additional one: as wxLogError, but also logs last system call error code -// and the corresponding error message if available -DECLARE_LOG_FUNCTION(SysError); - -// and another one which also takes the error code (for those broken APIs -// that don't set the errno (like registry APIs in Win32)) -DECLARE_LOG_FUNCTION2(SysError, long, lErrCode); - -// debug functions do nothing in release mode -#if wxUSE_LOG && wxUSE_LOG_DEBUG - DECLARE_LOG_FUNCTION(Debug); - - // there is no more unconditional LogTrace: it is not different from - // LogDebug and it creates overload ambiguities - //DECLARE_LOG_FUNCTION(Trace); - - // this version only logs the message if the mask had been added to the - // list of masks with AddTraceMask() - DECLARE_LOG_FUNCTION2(Trace, const wxChar *, mask); - - // and this one does nothing if all of level bits are not set in - // wxLog::GetActive()->GetTraceMask() -- it's deprecated in favour of - // string identifiers - DECLARE_LOG_FUNCTION2(Trace, wxTraceMask, mask); -#else //!debug || !wxUSE_LOG - // these functions do nothing in release builds, but don't define them as - // nothing as it could result in different code structure in debug and - // release and this could result in trouble when these macros are used - // inside if/else - // - // note that making wxVLogDebug/Trace() themselves (empty inline) functions - // is a bad idea as some compilers are stupid enough to not inline even - // empty functions if their parameters are complicated enough, but by - // defining them as an empty inline function we ensure that even dumbest - // compilers optimise them away - inline void wxLogNop() { } - - #define wxVLogDebug(fmt, valist) wxLogNop() - #define wxVLogTrace(mask, fmt, valist) wxLogNop() - - #ifdef HAVE_VARIADIC_MACROS - // unlike the inline functions below, this completely removes the - // wxLogXXX calls from the object file: - #define wxLogDebug(fmt, ...) wxLogNop() - #define wxLogTrace(mask, fmt, ...) wxLogNop() - #else // !HAVE_VARIADIC_MACROS - // note that leaving out "fmt" in the vararg functions provokes a warning - // from SGI CC: "the last argument of the varargs function is unnamed" - inline void wxLogDebug(const wxChar *fmt, ...) { wxUnusedVar(fmt); } - inline void wxLogTrace(wxTraceMask, const wxChar *fmt, ...) { wxUnusedVar(fmt); } - inline void wxLogTrace(const wxChar *, const wxChar *fmt, ...) { wxUnusedVar(fmt); } - #endif // HAVE_VARIADIC_MACROS/!HAVE_VARIADIC_MACROS -#endif // debug/!debug - -// wxLogFatalError helper: show the (fatal) error to the user in a safe way, -// i.e. without using wxMessageBox() for example because it could crash -void WXDLLIMPEXP_BASE -wxSafeShowMessage(const wxString& title, const wxString& text); - -// ---------------------------------------------------------------------------- -// debug only logging functions: use them with API name and error code -// ---------------------------------------------------------------------------- - -#ifdef __WXDEBUG__ - // make life easier for people using VC++ IDE: clicking on the message - // will take us immediately to the place of the failed API -#ifdef __VISUALC__ - #define wxLogApiError(api, rc) \ - wxLogDebug(wxT("%s(%d): '%s' failed with error 0x%08lx (%s)."), \ - __TFILE__, __LINE__, api, \ - (long)rc, wxSysErrorMsg(rc)) -#else // !VC++ - #define wxLogApiError(api, rc) \ - wxLogDebug(wxT("In file %s at line %d: '%s' failed with ") \ - wxT("error 0x%08lx (%s)."), \ - __TFILE__, __LINE__, api, \ - (long)rc, wxSysErrorMsg(rc)) -#endif // VC++/!VC++ - - #define wxLogLastError(api) wxLogApiError(api, wxSysErrorCode()) - -#else //!debug - #define wxLogApiError(api, err) wxLogNop() - #define wxLogLastError(api) wxLogNop() -#endif //debug/!debug - -// wxCocoa has additiional trace masks -#if defined(__WXCOCOA__) -#include "wx/cocoa/log.h" -#endif - -#endif // _WX_LOG_H_ - diff --git a/wxWidgets/include/wx/longlong.h b/wxWidgets/include/wx/longlong.h deleted file mode 100644 index 36c62071f7..0000000000 --- a/wxWidgets/include/wx/longlong.h +++ /dev/null @@ -1,1080 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/longlong.h -// Purpose: declaration of wxLongLong class - best implementation of a 64 -// bit integer for the current platform. -// Author: Jeffrey C. Ollie <jeff@ollie.clive.ia.us>, Vadim Zeitlin -// Modified by: -// Created: 10.02.99 -// RCS-ID: $Id: longlong.h 61872 2009-09-09 22:37:05Z VZ $ -// Copyright: (c) 1998 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr> -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_LONGLONG_H -#define _WX_LONGLONG_H - -#include "wx/defs.h" - -#if wxUSE_LONGLONG - -#include "wx/string.h" - -#include <limits.h> // for LONG_MAX - -// define this to compile wxLongLongWx in "test" mode: the results of all -// calculations will be compared with the real results taken from -// wxLongLongNative -- this is extremely useful to find the bugs in -// wxLongLongWx class! - -// #define wxLONGLONG_TEST_MODE - -#ifdef wxLONGLONG_TEST_MODE - #define wxUSE_LONGLONG_WX 1 - #define wxUSE_LONGLONG_NATIVE 1 -#endif // wxLONGLONG_TEST_MODE - -// ---------------------------------------------------------------------------- -// decide upon which class we will use -// ---------------------------------------------------------------------------- - -#ifndef wxLongLong_t - // both warning and pragma warning are not portable, but at least an - // unknown pragma should never be an error -- except that, actually, some - // broken compilers don't like it, so we have to disable it in this case - // <sigh> - #ifdef __GNUC__ - #warning "Your compiler does not appear to support 64 bit "\ - "integers, using emulation class instead.\n" \ - "Please report your compiler version to " \ - "wx-dev@lists.wxwidgets.org!" - #elif !(defined(__WATCOMC__) || defined(__VISAGECPP__)) - #pragma warning "Your compiler does not appear to support 64 bit "\ - "integers, using emulation class instead.\n" \ - "Please report your compiler version to " \ - "wx-dev@lists.wxwidgets.org!" - #endif - - #define wxUSE_LONGLONG_WX 1 -#endif // compiler - -// the user may predefine wxUSE_LONGLONG_NATIVE and/or wxUSE_LONGLONG_NATIVE -// to disable automatic testing (useful for the test program which defines -// both classes) but by default we only use one class -#if (defined(wxUSE_LONGLONG_WX) && wxUSE_LONGLONG_WX) || !defined(wxLongLong_t) - // don't use both classes unless wxUSE_LONGLONG_NATIVE was explicitly set: - // this is useful in test programs and only there - #ifndef wxUSE_LONGLONG_NATIVE - #define wxUSE_LONGLONG_NATIVE 0 - #endif - - class WXDLLIMPEXP_BASE wxLongLongWx; - class WXDLLIMPEXP_BASE wxULongLongWx; -#if defined(__VISUALC__) && !defined(__WIN32__) - #define wxLongLong wxLongLongWx - #define wxULongLong wxULongLongWx -#else - typedef wxLongLongWx wxLongLong; - typedef wxULongLongWx wxULongLong; -#endif - -#else - // if nothing is defined, use native implementation by default, of course - #ifndef wxUSE_LONGLONG_NATIVE - #define wxUSE_LONGLONG_NATIVE 1 - #endif -#endif - -#ifndef wxUSE_LONGLONG_WX - #define wxUSE_LONGLONG_WX 0 - class WXDLLIMPEXP_FWD_BASE wxLongLongNative; - class WXDLLIMPEXP_FWD_BASE wxULongLongNative; - typedef wxLongLongNative wxLongLong; - typedef wxULongLongNative wxULongLong; -#endif - -// NB: if both wxUSE_LONGLONG_WX and NATIVE are defined, the user code should -// typedef wxLongLong as it wants, we don't do it - -// ---------------------------------------------------------------------------- -// choose the appropriate class -// ---------------------------------------------------------------------------- - -// we use iostream for wxLongLong output -#include "wx/iosfwrap.h" - -#if wxUSE_LONGLONG_NATIVE - -class WXDLLIMPEXP_BASE wxLongLongNative -{ -public: - // ctors - // default ctor initializes to 0 - wxLongLongNative() : m_ll(0) { } - // from long long - wxLongLongNative(wxLongLong_t ll) : m_ll(ll) { } - // from 2 longs - wxLongLongNative(wxInt32 hi, wxUint32 lo) - { - // cast to wxLongLong_t first to avoid precision loss! - m_ll = ((wxLongLong_t) hi) << 32; - m_ll |= (wxLongLong_t) lo; - } -#if wxUSE_LONGLONG_WX - wxLongLongNative(wxLongLongWx ll); -#endif - - // default copy ctor is ok - - // no dtor - - // assignment operators - // from native 64 bit integer -#ifndef wxLongLongIsLong - wxLongLongNative& operator=(wxLongLong_t ll) - { m_ll = ll; return *this; } - wxLongLongNative& operator=(wxULongLong_t ll) - { m_ll = ll; return *this; } -#endif // !wxLongLongNative - wxLongLongNative& operator=(const wxULongLongNative &ll); - wxLongLongNative& operator=(int l) - { m_ll = l; return *this; } - wxLongLongNative& operator=(long l) - { m_ll = l; return *this; } - wxLongLongNative& operator=(unsigned int l) - { m_ll = l; return *this; } - wxLongLongNative& operator=(unsigned long l) - { m_ll = l; return *this; } -#if wxUSE_LONGLONG_WX - wxLongLongNative& operator=(wxLongLongWx ll); - wxLongLongNative& operator=(const class wxULongLongWx &ll); -#endif - - - // from double: this one has an explicit name because otherwise we - // would have ambiguity with "ll = int" and also because we don't want - // to have implicit conversions between doubles and wxLongLongs - wxLongLongNative& Assign(double d) - { m_ll = (wxLongLong_t)d; return *this; } - - // assignment operators from wxLongLongNative is ok - - // accessors - // get high part - wxInt32 GetHi() const - { return wx_truncate_cast(wxInt32, m_ll >> 32); } - // get low part - wxUint32 GetLo() const - { return wx_truncate_cast(wxUint32, m_ll); } - - // get absolute value - wxLongLongNative Abs() const { return wxLongLongNative(*this).Abs(); } - wxLongLongNative& Abs() { if ( m_ll < 0 ) m_ll = -m_ll; return *this; } - - // convert to native long long - wxLongLong_t GetValue() const { return m_ll; } - - // convert to long with range checking in debug mode (only!) - long ToLong() const - { - wxASSERT_MSG( (m_ll >= LONG_MIN) && (m_ll <= LONG_MAX), - wxT("wxLongLong to long conversion loss of precision") ); - - return wx_truncate_cast(long, m_ll); - } - - // convert to double - double ToDouble() const { return wx_truncate_cast(double, m_ll); } - - // don't provide implicit conversion to wxLongLong_t or we will have an - // ambiguity for all arithmetic operations - //operator wxLongLong_t() const { return m_ll; } - - // operations - // addition - wxLongLongNative operator+(const wxLongLongNative& ll) const - { return wxLongLongNative(m_ll + ll.m_ll); } - wxLongLongNative& operator+=(const wxLongLongNative& ll) - { m_ll += ll.m_ll; return *this; } - - wxLongLongNative operator+(const wxLongLong_t ll) const - { return wxLongLongNative(m_ll + ll); } - wxLongLongNative& operator+=(const wxLongLong_t ll) - { m_ll += ll; return *this; } - - // pre increment - wxLongLongNative& operator++() - { m_ll++; return *this; } - - // post increment - wxLongLongNative operator++(int) - { wxLongLongNative value(*this); m_ll++; return value; } - - // negation operator - wxLongLongNative operator-() const - { return wxLongLongNative(-m_ll); } - wxLongLongNative& Negate() { m_ll = -m_ll; return *this; } - - // subtraction - wxLongLongNative operator-(const wxLongLongNative& ll) const - { return wxLongLongNative(m_ll - ll.m_ll); } - wxLongLongNative& operator-=(const wxLongLongNative& ll) - { m_ll -= ll.m_ll; return *this; } - - wxLongLongNative operator-(const wxLongLong_t ll) const - { return wxLongLongNative(m_ll - ll); } - wxLongLongNative& operator-=(const wxLongLong_t ll) - { m_ll -= ll; return *this; } - - // pre decrement - wxLongLongNative& operator--() - { m_ll--; return *this; } - - // post decrement - wxLongLongNative operator--(int) - { wxLongLongNative value(*this); m_ll--; return value; } - - // shifts - // left shift - wxLongLongNative operator<<(int shift) const - { return wxLongLongNative(m_ll << shift); } - wxLongLongNative& operator<<=(int shift) - { m_ll <<= shift; return *this; } - - // right shift - wxLongLongNative operator>>(int shift) const - { return wxLongLongNative(m_ll >> shift); } - wxLongLongNative& operator>>=(int shift) - { m_ll >>= shift; return *this; } - - // bitwise operators - wxLongLongNative operator&(const wxLongLongNative& ll) const - { return wxLongLongNative(m_ll & ll.m_ll); } - wxLongLongNative& operator&=(const wxLongLongNative& ll) - { m_ll &= ll.m_ll; return *this; } - - wxLongLongNative operator|(const wxLongLongNative& ll) const - { return wxLongLongNative(m_ll | ll.m_ll); } - wxLongLongNative& operator|=(const wxLongLongNative& ll) - { m_ll |= ll.m_ll; return *this; } - - wxLongLongNative operator^(const wxLongLongNative& ll) const - { return wxLongLongNative(m_ll ^ ll.m_ll); } - wxLongLongNative& operator^=(const wxLongLongNative& ll) - { m_ll ^= ll.m_ll; return *this; } - - // multiplication/division - wxLongLongNative operator*(const wxLongLongNative& ll) const - { return wxLongLongNative(m_ll * ll.m_ll); } - wxLongLongNative operator*(long l) const - { return wxLongLongNative(m_ll * l); } - wxLongLongNative& operator*=(const wxLongLongNative& ll) - { m_ll *= ll.m_ll; return *this; } - wxLongLongNative& operator*=(long l) - { m_ll *= l; return *this; } - - wxLongLongNative operator/(const wxLongLongNative& ll) const - { return wxLongLongNative(m_ll / ll.m_ll); } - wxLongLongNative operator/(long l) const - { return wxLongLongNative(m_ll / l); } - wxLongLongNative& operator/=(const wxLongLongNative& ll) - { m_ll /= ll.m_ll; return *this; } - wxLongLongNative& operator/=(long l) - { m_ll /= l; return *this; } - - wxLongLongNative operator%(const wxLongLongNative& ll) const - { return wxLongLongNative(m_ll % ll.m_ll); } - wxLongLongNative operator%(long l) const - { return wxLongLongNative(m_ll % l); } - - // comparison - bool operator==(const wxLongLongNative& ll) const - { return m_ll == ll.m_ll; } - bool operator==(long l) const - { return m_ll == l; } - bool operator!=(const wxLongLongNative& ll) const - { return m_ll != ll.m_ll; } - bool operator!=(long l) const - { return m_ll != l; } - bool operator<(const wxLongLongNative& ll) const - { return m_ll < ll.m_ll; } - bool operator<(long l) const - { return m_ll < l; } - bool operator>(const wxLongLongNative& ll) const - { return m_ll > ll.m_ll; } - bool operator>(long l) const - { return m_ll > l; } - bool operator<=(const wxLongLongNative& ll) const - { return m_ll <= ll.m_ll; } - bool operator<=(long l) const - { return m_ll <= l; } - bool operator>=(const wxLongLongNative& ll) const - { return m_ll >= ll.m_ll; } - bool operator>=(long l) const - { return m_ll >= l; } - - // miscellaneous - - // return the string representation of this number - wxString ToString() const; - - // conversion to byte array: returns a pointer to static buffer! - void *asArray() const; - -#if wxUSE_STD_IOSTREAM - // input/output - friend WXDLLIMPEXP_BASE - wxSTD ostream& operator<<(wxSTD ostream&, const wxLongLongNative&); -#endif - - friend WXDLLIMPEXP_BASE - wxString& operator<<(wxString&, const wxLongLongNative&); - -#if wxUSE_STREAMS - friend WXDLLIMPEXP_BASE - class wxTextOutputStream& operator<<(class wxTextOutputStream&, const wxLongLongNative&); - friend WXDLLIMPEXP_BASE - class wxTextInputStream& operator>>(class wxTextInputStream&, wxLongLongNative&); -#endif - -private: - wxLongLong_t m_ll; -}; - - -class WXDLLIMPEXP_BASE wxULongLongNative -{ -public: - // ctors - // default ctor initializes to 0 - wxULongLongNative() : m_ll(0) { } - // from long long - wxULongLongNative(wxULongLong_t ll) : m_ll(ll) { } - // from 2 longs - wxULongLongNative(wxUint32 hi, wxUint32 lo) : m_ll(0) - { - // cast to wxLongLong_t first to avoid precision loss! - m_ll = ((wxULongLong_t) hi) << 32; - m_ll |= (wxULongLong_t) lo; - } - -#if wxUSE_LONGLONG_WX - wxULongLongNative(const class wxULongLongWx &ll); -#endif - - // default copy ctor is ok - - // no dtor - - // assignment operators - // from native 64 bit integer -#ifndef wxLongLongIsLong - wxULongLongNative& operator=(wxULongLong_t ll) - { m_ll = ll; return *this; } - wxULongLongNative& operator=(wxLongLong_t ll) - { m_ll = ll; return *this; } -#endif // !wxLongLongNative - wxULongLongNative& operator=(int l) - { m_ll = l; return *this; } - wxULongLongNative& operator=(long l) - { m_ll = l; return *this; } - wxULongLongNative& operator=(unsigned int l) - { m_ll = l; return *this; } - wxULongLongNative& operator=(unsigned long l) - { m_ll = l; return *this; } - wxULongLongNative& operator=(const wxLongLongNative &ll) - { m_ll = ll.GetValue(); return *this; } -#if wxUSE_LONGLONG_WX - wxULongLongNative& operator=(wxLongLongWx ll); - wxULongLongNative& operator=(const class wxULongLongWx &ll); -#endif - - // assignment operators from wxULongLongNative is ok - - // accessors - // get high part - wxUint32 GetHi() const - { return wx_truncate_cast(wxUint32, m_ll >> 32); } - // get low part - wxUint32 GetLo() const - { return wx_truncate_cast(wxUint32, m_ll); } - - // convert to native ulong long - wxULongLong_t GetValue() const { return m_ll; } - - // convert to ulong with range checking in debug mode (only!) - unsigned long ToULong() const - { - wxASSERT_MSG( m_ll <= LONG_MAX, - wxT("wxULongLong to long conversion loss of precision") ); - - return wx_truncate_cast(unsigned long, m_ll); - } - - // convert to double -#ifdef _MSC_VER - double ToDouble() const { return wx_truncate_cast(double, (__int64) m_ll); } -#else - double ToDouble() const { return wx_truncate_cast(double, m_ll); } -#endif - - // operations - // addition - wxULongLongNative operator+(const wxULongLongNative& ll) const - { return wxULongLongNative(m_ll + ll.m_ll); } - wxULongLongNative& operator+=(const wxULongLongNative& ll) - { m_ll += ll.m_ll; return *this; } - - wxULongLongNative operator+(const wxULongLong_t ll) const - { return wxULongLongNative(m_ll + ll); } - wxULongLongNative& operator+=(const wxULongLong_t ll) - { m_ll += ll; return *this; } - - // pre increment - wxULongLongNative& operator++() - { m_ll++; return *this; } - - // post increment - wxULongLongNative operator++(int) - { wxULongLongNative value(*this); m_ll++; return value; } - - // subtraction - wxULongLongNative operator-(const wxULongLongNative& ll) const - { return wxULongLongNative(m_ll - ll.m_ll); } - wxULongLongNative& operator-=(const wxULongLongNative& ll) - { m_ll -= ll.m_ll; return *this; } - - wxULongLongNative operator-(const wxULongLong_t ll) const - { return wxULongLongNative(m_ll - ll); } - wxULongLongNative& operator-=(const wxULongLong_t ll) - { m_ll -= ll; return *this; } - - // pre decrement - wxULongLongNative& operator--() - { m_ll--; return *this; } - - // post decrement - wxULongLongNative operator--(int) - { wxULongLongNative value(*this); m_ll--; return value; } - - // shifts - // left shift - wxULongLongNative operator<<(int shift) const - { return wxULongLongNative(m_ll << shift); } - wxULongLongNative& operator<<=(int shift) - { m_ll <<= shift; return *this; } - - // right shift - wxULongLongNative operator>>(int shift) const - { return wxULongLongNative(m_ll >> shift); } - wxULongLongNative& operator>>=(int shift) - { m_ll >>= shift; return *this; } - - // bitwise operators - wxULongLongNative operator&(const wxULongLongNative& ll) const - { return wxULongLongNative(m_ll & ll.m_ll); } - wxULongLongNative& operator&=(const wxULongLongNative& ll) - { m_ll &= ll.m_ll; return *this; } - - wxULongLongNative operator|(const wxULongLongNative& ll) const - { return wxULongLongNative(m_ll | ll.m_ll); } - wxULongLongNative& operator|=(const wxULongLongNative& ll) - { m_ll |= ll.m_ll; return *this; } - - wxULongLongNative operator^(const wxULongLongNative& ll) const - { return wxULongLongNative(m_ll ^ ll.m_ll); } - wxULongLongNative& operator^=(const wxULongLongNative& ll) - { m_ll ^= ll.m_ll; return *this; } - - // multiplication/division - wxULongLongNative operator*(const wxULongLongNative& ll) const - { return wxULongLongNative(m_ll * ll.m_ll); } - wxULongLongNative operator*(unsigned long l) const - { return wxULongLongNative(m_ll * l); } - wxULongLongNative& operator*=(const wxULongLongNative& ll) - { m_ll *= ll.m_ll; return *this; } - wxULongLongNative& operator*=(unsigned long l) - { m_ll *= l; return *this; } - - wxULongLongNative operator/(const wxULongLongNative& ll) const - { return wxULongLongNative(m_ll / ll.m_ll); } - wxULongLongNative operator/(unsigned long l) const - { return wxULongLongNative(m_ll / l); } - wxULongLongNative& operator/=(const wxULongLongNative& ll) - { m_ll /= ll.m_ll; return *this; } - wxULongLongNative& operator/=(unsigned long l) - { m_ll /= l; return *this; } - - wxULongLongNative operator%(const wxULongLongNative& ll) const - { return wxULongLongNative(m_ll % ll.m_ll); } - wxULongLongNative operator%(unsigned long l) const - { return wxULongLongNative(m_ll % l); } - - // comparison - bool operator==(const wxULongLongNative& ll) const - { return m_ll == ll.m_ll; } - bool operator==(unsigned long l) const - { return m_ll == l; } - bool operator!=(const wxULongLongNative& ll) const - { return m_ll != ll.m_ll; } - bool operator!=(unsigned long l) const - { return m_ll != l; } - bool operator<(const wxULongLongNative& ll) const - { return m_ll < ll.m_ll; } - bool operator<(unsigned long l) const - { return m_ll < l; } - bool operator>(const wxULongLongNative& ll) const - { return m_ll > ll.m_ll; } - bool operator>(unsigned long l) const - { return m_ll > l; } - bool operator<=(const wxULongLongNative& ll) const - { return m_ll <= ll.m_ll; } - bool operator<=(unsigned long l) const - { return m_ll <= l; } - bool operator>=(const wxULongLongNative& ll) const - { return m_ll >= ll.m_ll; } - bool operator>=(unsigned long l) const - { return m_ll >= l; } - - // miscellaneous - - // return the string representation of this number - wxString ToString() const; - - // conversion to byte array: returns a pointer to static buffer! - void *asArray() const; - -#if wxUSE_STD_IOSTREAM - // input/output - friend WXDLLIMPEXP_BASE - wxSTD ostream& operator<<(wxSTD ostream&, const wxULongLongNative&); -#endif - - friend WXDLLIMPEXP_BASE - wxString& operator<<(wxString&, const wxULongLongNative&); - -#if wxUSE_STREAMS - friend WXDLLIMPEXP_BASE - class wxTextOutputStream& operator<<(class wxTextOutputStream&, const wxULongLongNative&); - friend WXDLLIMPEXP_BASE - class wxTextInputStream& operator>>(class wxTextInputStream&, wxULongLongNative&); -#endif - -private: - wxULongLong_t m_ll; -}; - -inline -wxLongLongNative& wxLongLongNative::operator=(const wxULongLongNative &ll) -{ - m_ll = ll.GetValue(); - return *this; -} - -#endif // wxUSE_LONGLONG_NATIVE - -#if wxUSE_LONGLONG_WX - -class WXDLLIMPEXP_BASE wxLongLongWx -{ -public: - // ctors - // default ctor initializes to 0 - wxLongLongWx() - { - m_lo = m_hi = 0; - -#ifdef wxLONGLONG_TEST_MODE - m_ll = 0; - - Check(); -#endif // wxLONGLONG_TEST_MODE - } - // from long - wxLongLongWx(long l) { *this = l; } - // from 2 longs - wxLongLongWx(long hi, unsigned long lo) - { - m_hi = hi; - m_lo = lo; - -#ifdef wxLONGLONG_TEST_MODE - m_ll = hi; - m_ll <<= 32; - m_ll |= lo; - - Check(); -#endif // wxLONGLONG_TEST_MODE - } - - // default copy ctor is ok in both cases - - // no dtor - - // assignment operators - // from long - wxLongLongWx& operator=(long l) - { - m_lo = l; - m_hi = (l < 0 ? -1l : 0l); - -#ifdef wxLONGLONG_TEST_MODE - m_ll = l; - - Check(); -#endif // wxLONGLONG_TEST_MODE - - return *this; - } - // from int - wxLongLongWx& operator=(int l) - { - return operator=((long)l); - } - - wxLongLongWx& operator=(unsigned long l) - { - m_lo = l; - m_hi = 0; - -#ifdef wxLONGLONG_TEST_MODE - m_ll = l; - - Check(); -#endif // wxLONGLONG_TEST_MODE - - return *this; - } - - wxLongLongWx& operator=(unsigned int l) - { - return operator=((unsigned long)l); - } - - wxLongLongWx& operator=(const class wxULongLongWx &ll); - - // from double - wxLongLongWx& Assign(double d); - // can't have assignment operator from 2 longs - - // accessors - // get high part - long GetHi() const { return m_hi; } - // get low part - unsigned long GetLo() const { return m_lo; } - - // get absolute value - wxLongLongWx Abs() const { return wxLongLongWx(*this).Abs(); } - wxLongLongWx& Abs() - { - if ( m_hi < 0 ) - m_hi = -m_hi; - -#ifdef wxLONGLONG_TEST_MODE - if ( m_ll < 0 ) - m_ll = -m_ll; - - Check(); -#endif // wxLONGLONG_TEST_MODE - - return *this; - } - - // convert to long with range checking in debug mode (only!) - long ToLong() const - { - wxASSERT_MSG( (m_hi == 0l) || (m_hi == -1l), - wxT("wxLongLong to long conversion loss of precision") ); - - return (long)m_lo; - } - - // convert to double - double ToDouble() const; - - // operations - // addition - wxLongLongWx operator+(const wxLongLongWx& ll) const; - wxLongLongWx& operator+=(const wxLongLongWx& ll); - wxLongLongWx operator+(long l) const; - wxLongLongWx& operator+=(long l); - - // pre increment operator - wxLongLongWx& operator++(); - - // post increment operator - wxLongLongWx& operator++(int) { return ++(*this); } - - // negation operator - wxLongLongWx operator-() const; - wxLongLongWx& Negate(); - - // subraction - wxLongLongWx operator-(const wxLongLongWx& ll) const; - wxLongLongWx& operator-=(const wxLongLongWx& ll); - - // pre decrement operator - wxLongLongWx& operator--(); - - // post decrement operator - wxLongLongWx& operator--(int) { return --(*this); } - - // shifts - // left shift - wxLongLongWx operator<<(int shift) const; - wxLongLongWx& operator<<=(int shift); - - // right shift - wxLongLongWx operator>>(int shift) const; - wxLongLongWx& operator>>=(int shift); - - // bitwise operators - wxLongLongWx operator&(const wxLongLongWx& ll) const; - wxLongLongWx& operator&=(const wxLongLongWx& ll); - wxLongLongWx operator|(const wxLongLongWx& ll) const; - wxLongLongWx& operator|=(const wxLongLongWx& ll); - wxLongLongWx operator^(const wxLongLongWx& ll) const; - wxLongLongWx& operator^=(const wxLongLongWx& ll); - wxLongLongWx operator~() const; - - // comparison - bool operator==(const wxLongLongWx& ll) const - { return m_lo == ll.m_lo && m_hi == ll.m_hi; } -#if wxUSE_LONGLONG_NATIVE - bool operator==(const wxLongLongNative& ll) const - { return m_lo == ll.GetLo() && m_hi == ll.GetHi(); } -#endif - bool operator!=(const wxLongLongWx& ll) const - { return !(*this == ll); } - bool operator<(const wxLongLongWx& ll) const; - bool operator>(const wxLongLongWx& ll) const; - bool operator<=(const wxLongLongWx& ll) const - { return *this < ll || *this == ll; } - bool operator>=(const wxLongLongWx& ll) const - { return *this > ll || *this == ll; } - - bool operator<(long l) const { return *this < wxLongLongWx(l); } - bool operator>(long l) const { return *this > wxLongLongWx(l); } - bool operator==(long l) const - { - return l >= 0 ? (m_hi == 0 && m_lo == (unsigned long)l) - : (m_hi == -1 && m_lo == (unsigned long)l); - } - - bool operator<=(long l) const { return *this < l || *this == l; } - bool operator>=(long l) const { return *this > l || *this == l; } - - // multiplication - wxLongLongWx operator*(const wxLongLongWx& ll) const; - wxLongLongWx& operator*=(const wxLongLongWx& ll); - - // division - wxLongLongWx operator/(const wxLongLongWx& ll) const; - wxLongLongWx& operator/=(const wxLongLongWx& ll); - - wxLongLongWx operator%(const wxLongLongWx& ll) const; - - void Divide(const wxLongLongWx& divisor, - wxLongLongWx& quotient, - wxLongLongWx& remainder) const; - - // input/output - - // return the string representation of this number - wxString ToString() const; - - void *asArray() const; - -#if wxUSE_STD_IOSTREAM - friend WXDLLIMPEXP_BASE - wxSTD ostream& operator<<(wxSTD ostream&, const wxLongLongWx&); -#endif // wxUSE_STD_IOSTREAM - - friend WXDLLIMPEXP_BASE - wxString& operator<<(wxString&, const wxLongLongWx&); - -#if wxUSE_STREAMS - friend WXDLLIMPEXP_BASE - class wxTextOutputStream& operator<<(class wxTextOutputStream&, const wxLongLongWx&); - friend WXDLLIMPEXP_BASE - class wxTextInputStream& operator>>(class wxTextInputStream&, wxLongLongWx&); -#endif - -private: - // long is at least 32 bits, so represent our 64bit number as 2 longs - - long m_hi; // signed bit is in the high part - unsigned long m_lo; - -#ifdef wxLONGLONG_TEST_MODE - void Check() - { - wxASSERT( (m_ll >> 32) == m_hi && (unsigned long)m_ll == m_lo ); - } - - wxLongLong_t m_ll; -#endif // wxLONGLONG_TEST_MODE -}; - - -class WXDLLIMPEXP_BASE wxULongLongWx -{ -public: - // ctors - // default ctor initializes to 0 - wxULongLongWx() - { - m_lo = m_hi = 0; - -#ifdef wxLONGLONG_TEST_MODE - m_ll = 0; - - Check(); -#endif // wxLONGLONG_TEST_MODE - } - // from ulong - wxULongLongWx(unsigned long l) { *this = l; } - // from 2 ulongs - wxULongLongWx(unsigned long hi, unsigned long lo) - { - m_hi = hi; - m_lo = lo; - -#ifdef wxLONGLONG_TEST_MODE - m_ll = hi; - m_ll <<= 32; - m_ll |= lo; - - Check(); -#endif // wxLONGLONG_TEST_MODE - } - - // from signed to unsigned - wxULongLongWx(wxLongLongWx ll) - { - wxASSERT(ll.GetHi() >= 0); - m_hi = (unsigned long)ll.GetHi(); - m_lo = ll.GetLo(); - } - - // default copy ctor is ok in both cases - - // no dtor - - // assignment operators - // from long - wxULongLongWx& operator=(unsigned long l) - { - m_lo = l; - m_hi = 0; - -#ifdef wxLONGLONG_TEST_MODE - m_ll = l; - - Check(); -#endif // wxLONGLONG_TEST_MODE - - return *this; - } - wxULongLongWx& operator=(long l) - { - m_lo = l; - m_hi = (unsigned long) ((l<0) ? -1l : 0); - -#ifdef wxLONGLONG_TEST_MODE - m_ll = (wxULongLong_t) (wxLongLong_t) l; - - Check(); -#endif // wxLONGLONG_TEST_MODE - - return *this; - } - wxULongLongWx& operator=(const class wxLongLongWx &ll) { - // Should we use an assert like it was before in the constructor? - // wxASSERT(ll.GetHi() >= 0); - m_hi = (unsigned long)ll.GetHi(); - m_lo = ll.GetLo(); - return *this; - } - - // can't have assignment operator from 2 longs - - // accessors - // get high part - unsigned long GetHi() const { return m_hi; } - // get low part - unsigned long GetLo() const { return m_lo; } - - // convert to long with range checking in debug mode (only!) - unsigned long ToULong() const - { - wxASSERT_MSG( m_hi == 0ul, - wxT("wxULongLong to long conversion loss of precision") ); - - return (unsigned long)m_lo; - } - - // convert to double - double ToDouble() const; - - // operations - // addition - wxULongLongWx operator+(const wxULongLongWx& ll) const; - wxULongLongWx& operator+=(const wxULongLongWx& ll); - wxULongLongWx operator+(unsigned long l) const; - wxULongLongWx& operator+=(unsigned long l); - - // pre increment operator - wxULongLongWx& operator++(); - - // post increment operator - wxULongLongWx& operator++(int) { return ++(*this); } - - // subtraction - wxLongLongWx operator-(const wxULongLongWx& ll) const; - wxULongLongWx& operator-=(const wxULongLongWx& ll); - - // pre decrement operator - wxULongLongWx& operator--(); - - // post decrement operator - wxULongLongWx& operator--(int) { return --(*this); } - - // shifts - // left shift - wxULongLongWx operator<<(int shift) const; - wxULongLongWx& operator<<=(int shift); - - // right shift - wxULongLongWx operator>>(int shift) const; - wxULongLongWx& operator>>=(int shift); - - // bitwise operators - wxULongLongWx operator&(const wxULongLongWx& ll) const; - wxULongLongWx& operator&=(const wxULongLongWx& ll); - wxULongLongWx operator|(const wxULongLongWx& ll) const; - wxULongLongWx& operator|=(const wxULongLongWx& ll); - wxULongLongWx operator^(const wxULongLongWx& ll) const; - wxULongLongWx& operator^=(const wxULongLongWx& ll); - wxULongLongWx operator~() const; - - // comparison - bool operator==(const wxULongLongWx& ll) const - { return m_lo == ll.m_lo && m_hi == ll.m_hi; } - bool operator!=(const wxULongLongWx& ll) const - { return !(*this == ll); } - bool operator<(const wxULongLongWx& ll) const; - bool operator>(const wxULongLongWx& ll) const; - bool operator<=(const wxULongLongWx& ll) const - { return *this < ll || *this == ll; } - bool operator>=(const wxULongLongWx& ll) const - { return *this > ll || *this == ll; } - - bool operator<(unsigned long l) const { return *this < wxULongLongWx(l); } - bool operator>(unsigned long l) const { return *this > wxULongLongWx(l); } - bool operator==(unsigned long l) const - { - return (m_hi == 0 && m_lo == (unsigned long)l); - } - - bool operator<=(unsigned long l) const { return *this < l || *this == l; } - bool operator>=(unsigned long l) const { return *this > l || *this == l; } - - // multiplication - wxULongLongWx operator*(const wxULongLongWx& ll) const; - wxULongLongWx& operator*=(const wxULongLongWx& ll); - - // division - wxULongLongWx operator/(const wxULongLongWx& ll) const; - wxULongLongWx& operator/=(const wxULongLongWx& ll); - - wxULongLongWx operator%(const wxULongLongWx& ll) const; - - void Divide(const wxULongLongWx& divisor, - wxULongLongWx& quotient, - wxULongLongWx& remainder) const; - - // input/output - - // return the string representation of this number - wxString ToString() const; - - void *asArray() const; - -#if wxUSE_STD_IOSTREAM - friend WXDLLIMPEXP_BASE - wxSTD ostream& operator<<(wxSTD ostream&, const wxULongLongWx&); -#endif // wxUSE_STD_IOSTREAM - - friend WXDLLIMPEXP_BASE - wxString& operator<<(wxString&, const wxULongLongWx&); - -#if wxUSE_STREAMS - friend WXDLLIMPEXP_BASE - class wxTextOutputStream& operator<<(class wxTextOutputStream&, const wxULongLongWx&); - friend WXDLLIMPEXP_BASE - class wxTextInputStream& operator>>(class wxTextInputStream&, wxULongLongWx&); -#endif - -private: - // long is at least 32 bits, so represent our 64bit number as 2 longs - - unsigned long m_hi; - unsigned long m_lo; - -#ifdef wxLONGLONG_TEST_MODE - void Check() - { - wxASSERT( (m_ll >> 32) == m_hi && (unsigned long)m_ll == m_lo ); - } - - wxULongLong_t m_ll; -#endif // wxLONGLONG_TEST_MODE -}; - -#endif // wxUSE_LONGLONG_WX - -// ---------------------------------------------------------------------------- -// binary operators -// ---------------------------------------------------------------------------- - -inline bool operator<(long l, const wxLongLong& ll) { return ll > l; } -inline bool operator>(long l, const wxLongLong& ll) { return ll < l; } -inline bool operator<=(long l, const wxLongLong& ll) { return ll >= l; } -inline bool operator>=(long l, const wxLongLong& ll) { return ll <= l; } -inline bool operator==(long l, const wxLongLong& ll) { return ll == l; } -inline bool operator!=(long l, const wxLongLong& ll) { return ll != l; } - -inline wxLongLong operator+(long l, const wxLongLong& ll) { return ll + l; } -inline wxLongLong operator-(long l, const wxLongLong& ll) -{ - return wxLongLong(l) - ll; -} - -inline bool operator<(unsigned long l, const wxULongLong& ull) { return ull > l; } -inline bool operator>(unsigned long l, const wxULongLong& ull) { return ull < l; } -inline bool operator<=(unsigned long l, const wxULongLong& ull) { return ull >= l; } -inline bool operator>=(unsigned long l, const wxULongLong& ull) { return ull <= l; } -inline bool operator==(unsigned long l, const wxULongLong& ull) { return ull == l; } -inline bool operator!=(unsigned long l, const wxULongLong& ull) { return ull != l; } - -inline wxULongLong operator+(unsigned long l, const wxULongLong& ull) { return ull + l; } - -inline wxLongLong operator-(unsigned long l, const wxULongLong& ull) -{ - wxULongLong ret = wxULongLong(l) - ull; - return wxLongLong((long)ret.GetHi(),ret.GetLo()); -} - -#if wxUSE_LONGLONG_NATIVE && wxUSE_STREAMS - -WXDLLIMPEXP_BASE class wxTextOutputStream &operator<<(class wxTextOutputStream &stream, wxULongLong_t value); -WXDLLIMPEXP_BASE class wxTextOutputStream &operator<<(class wxTextOutputStream &stream, wxLongLong_t value); - -WXDLLIMPEXP_BASE class wxTextInputStream &operator>>(class wxTextInputStream &stream, wxULongLong_t &value); -WXDLLIMPEXP_BASE class wxTextInputStream &operator>>(class wxTextInputStream &stream, wxLongLong_t &value); - -#endif - -#endif // wxUSE_LONGLONG - -#endif // _WX_LONGLONG_H diff --git a/wxWidgets/include/wx/math.h b/wxWidgets/include/wx/math.h deleted file mode 100644 index 068147c66d..0000000000 --- a/wxWidgets/include/wx/math.h +++ /dev/null @@ -1,140 +0,0 @@ -/** -* Name: wx/math.h -* Purpose: Declarations/definitions of common math functions -* Author: John Labenski and others -* Modified by: -* Created: 02/02/03 -* RCS-ID: $Id: math.h 62541 2009-11-03 14:10:46Z VZ $ -* Copyright: (c) John Labenski -* Licence: wxWindows licence -*/ - -/* THIS IS A C FILE, DON'T USE C++ FEATURES (IN PARTICULAR COMMENTS) IN IT */ - -#ifndef _WX_MATH_H_ -#define _WX_MATH_H_ - -#include "wx/defs.h" - -#include <math.h> - -#ifndef M_PI - #define M_PI 3.1415926535897932384626433832795 -#endif - -/* Scaling factors for various unit conversions */ -#ifndef METRIC_CONVERSION_CONSTANT - #define METRIC_CONVERSION_CONSTANT 0.0393700787 -#endif - -#ifndef mm2inches - #define mm2inches (METRIC_CONVERSION_CONSTANT) -#endif - -#ifndef inches2mm - #define inches2mm (1/(mm2inches)) -#endif - -#ifndef mm2twips - #define mm2twips (METRIC_CONVERSION_CONSTANT*1440) -#endif - -#ifndef twips2mm - #define twips2mm (1/(mm2twips)) -#endif - -#ifndef mm2pt - #define mm2pt (METRIC_CONVERSION_CONSTANT*72) -#endif - -#ifndef pt2mm - #define pt2mm (1/(mm2pt)) -#endif - - -/* unknown __VISAGECC__, __SYMANTECCC__ */ - -#if defined(__VISUALC__) || defined(__BORLANDC__) || defined(__WATCOMC__) - #include <float.h> - #define wxFinite(x) _finite(x) -#elif defined(__GNUG__)||defined(__GNUWIN32__)||defined(__DJGPP__)|| \ - defined(__SGI_CC__)||defined(__SUNCC__)||defined(__XLC__)|| \ - defined(__HPUX__)||defined(__MWERKS__) - #define wxFinite(x) finite(x) -#else - #define wxFinite(x) ((x) == (x)) -#endif - - -#if defined(__VISUALC__)||defined(__BORLAND__) - #define wxIsNaN(x) _isnan(x) -#elif defined(__GNUG__)||defined(__GNUWIN32__)||defined(__DJGPP__)|| \ - defined(__SGI_CC__)||defined(__SUNCC__)||defined(__XLC__)|| \ - defined(__HPUX__)||defined(__MWERKS__) - #define wxIsNaN(x) isnan(x) -#else - #define wxIsNaN(x) ((x) != (x)) -#endif - -#ifdef __cplusplus - - #ifdef __INTELC__ - - inline bool wxIsSameDouble(double x, double y) - { - // VZ: this warning, given for operators==() and !=() is not wrong, as == - // shouldn't be used with doubles, but we get too many of them and - // removing these operators is probably not a good idea - // - // Maybe we should alway compare doubles up to some "epsilon" precision - #pragma warning(push) - - // floating-point equality and inequality comparisons are unreliable - #pragma warning(disable: 1572) - - return x == y; - - #pragma warning(pop) - } - - #else /* !__INTELC__ */ - - inline bool wxIsSameDouble(double x, double y) { return x == y; } - - #endif /* __INTELC__/!__INTELC__ */ - - inline bool wxIsNullDouble(double x) { return wxIsSameDouble(x, 0.); } - - inline int wxRound(double x) - { - #if defined(HAVE_ROUND) - return int(round(x)); - #else - return (int)(x < 0 ? x - 0.5 : x + 0.5); - #endif - } -#endif /* __cplusplus */ - - -#if defined(__WXMSW__) && !defined(__WXWINCE__) - #define wxMulDivInt32( a , b , c ) ::MulDiv( a , b , c ) -#elif defined( __WXMAC__ ) - #define wxMulDivInt32( a , b , c ) ( (wxInt32) ( ( (wxInt64)(a) * (wxInt64)(b) ) / (wxInt64)(c) ) ) -#else - #define wxMulDivInt32( a , b , c ) ((wxInt32)((a)*(((wxDouble)b)/((wxDouble)c)))) -#endif - -#if wxUSE_APPLE_IEEE -#ifdef __cplusplus - extern "C" { -#endif - /* functions from common/extended.c */ - WXDLLEXPORT wxFloat64 ConvertFromIeeeExtended(const wxInt8 *bytes); - WXDLLEXPORT void ConvertToIeeeExtended(wxFloat64 num, wxInt8 *bytes); -#ifdef __cplusplus - } -#endif -#endif /* wxUSE_APPLE_IEEE */ - - -#endif /* _WX_MATH_H_ */ diff --git a/wxWidgets/include/wx/matrix.h b/wxWidgets/include/wx/matrix.h deleted file mode 100644 index 67812cd2e2..0000000000 --- a/wxWidgets/include/wx/matrix.h +++ /dev/null @@ -1,235 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/matrix.h -// Purpose: wxTransformMatrix class. NOT YET USED -// Author: Chris Breeze, Julian Smart -// Modified by: Klaas Holwerda -// Created: 01/02/97 -// RCS-ID: $Id: matrix.h 45498 2007-04-16 13:03:05Z VZ $ -// Copyright: (c) Julian Smart, Chris Breeze -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_MATRIXH__ -#define _WX_MATRIXH__ - -//! headerfiles="matrix.h wx/object.h" -#include "wx/object.h" -#include "wx/math.h" - -//! codefiles="matrix.cpp" - -// A simple 3x3 matrix. This may be replaced by a more general matrix -// class some day. -// -// Note: this is intended to be used in wxDC at some point to replace -// the current system of scaling/translation. It is not yet used. - -//:definition -// A 3x3 matrix to do 2D transformations. -// It can be used to map data to window coordinates, -// and also for manipulating your own data. -// For example drawing a picture (composed of several primitives) -// at a certain coordinate and angle within another parent picture. -// At all times m_isIdentity is set if the matrix itself is an Identity matrix. -// It is used where possible to optimize calculations. -class WXDLLEXPORT wxTransformMatrix: public wxObject -{ -public: - wxTransformMatrix(void); - wxTransformMatrix(const wxTransformMatrix& mat); - - //get the value in the matrix at col,row - //rows are horizontal (second index of m_matrix member) - //columns are vertical (first index of m_matrix member) - double GetValue(int col, int row) const; - - //set the value in the matrix at col,row - //rows are horizontal (second index of m_matrix member) - //columns are vertical (first index of m_matrix member) - void SetValue(int col, int row, double value); - - void operator = (const wxTransformMatrix& mat); - bool operator == (const wxTransformMatrix& mat) const; - bool operator != (const wxTransformMatrix& mat) const; - - //multiply every element by t - wxTransformMatrix& operator*=(const double& t); - //divide every element by t - wxTransformMatrix& operator/=(const double& t); - //add matrix m to this t - wxTransformMatrix& operator+=(const wxTransformMatrix& m); - //subtract matrix m from this - wxTransformMatrix& operator-=(const wxTransformMatrix& m); - //multiply matrix m with this - wxTransformMatrix& operator*=(const wxTransformMatrix& m); - - // constant operators - - //multiply every element by t and return result - wxTransformMatrix operator*(const double& t) const; - //divide this matrix by t and return result - wxTransformMatrix operator/(const double& t) const; - //add matrix m to this and return result - wxTransformMatrix operator+(const wxTransformMatrix& m) const; - //subtract matrix m from this and return result - wxTransformMatrix operator-(const wxTransformMatrix& m) const; - //multiply this by matrix m and return result - wxTransformMatrix operator*(const wxTransformMatrix& m) const; - wxTransformMatrix operator-() const; - - //rows are horizontal (second index of m_matrix member) - //columns are vertical (first index of m_matrix member) - double& operator()(int col, int row); - - //rows are horizontal (second index of m_matrix member) - //columns are vertical (first index of m_matrix member) - double operator()(int col, int row) const; - - // Invert matrix - bool Invert(void); - - // Make into identity matrix - bool Identity(void); - - // Is the matrix the identity matrix? - // Only returns a flag, which is set whenever an operation - // is done. - inline bool IsIdentity(void) const { return m_isIdentity; } - - // This does an actual check. - inline bool IsIdentity1(void) const ; - - //Scale by scale (isotropic scaling i.e. the same in x and y): - //!ex: - //!code: | scale 0 0 | - //!code: matrix' = | 0 scale 0 | x matrix - //!code: | 0 0 scale | - bool Scale(double scale); - - //Scale with center point and x/y scale - // - //!ex: - //!code: | xs 0 xc(1-xs) | - //!code: matrix' = | 0 ys yc(1-ys) | x matrix - //!code: | 0 0 1 | - wxTransformMatrix& Scale(const double &xs, const double &ys,const double &xc, const double &yc); - - // mirror a matrix in x, y - //!ex: - //!code: | -1 0 0 | - //!code: matrix' = | 0 -1 0 | x matrix - //!code: | 0 0 1 | - wxTransformMatrix& Mirror(bool x=true, bool y=false); - // Translate by dx, dy: - //!ex: - //!code: | 1 0 dx | - //!code: matrix' = | 0 1 dy | x matrix - //!code: | 0 0 1 | - bool Translate(double x, double y); - - // Rotate clockwise by the given number of degrees: - //!ex: - //!code: | cos sin 0 | - //!code: matrix' = | -sin cos 0 | x matrix - //!code: | 0 0 1 | - bool Rotate(double angle); - - //Rotate counter clockwise with point of rotation - // - //!ex: - //!code: | cos(r) -sin(r) x(1-cos(r))+y(sin(r)| - //!code: matrix' = | sin(r) cos(r) y(1-cos(r))-x(sin(r)| x matrix - //!code: | 0 0 1 | - wxTransformMatrix& Rotate(const double &r, const double &x, const double &y); - - // Transform X value from logical to device - inline double TransformX(double x) const; - - // Transform Y value from logical to device - inline double TransformY(double y) const; - - // Transform a point from logical to device coordinates - bool TransformPoint(double x, double y, double& tx, double& ty) const; - - // Transform a point from device to logical coordinates. - // Example of use: - // wxTransformMatrix mat = dc.GetTransformation(); - // mat.Invert(); - // mat.InverseTransformPoint(x, y, x1, y1); - // OR (shorthand:) - // dc.LogicalToDevice(x, y, x1, y1); - // The latter is slightly less efficient if we're doing several - // conversions, since the matrix is inverted several times. - // N.B. 'this' matrix is the inverse at this point - bool InverseTransformPoint(double x, double y, double& tx, double& ty) const; - - double Get_scaleX(); - double Get_scaleY(); - double GetRotation(); - void SetRotation(double rotation); - - -public: - double m_matrix[3][3]; - bool m_isIdentity; -}; - - -/* -Chris Breeze reported, that -some functions of wxTransformMatrix cannot work because it is not -known if he matrix has been inverted. Be careful when using it. -*/ - -// Transform X value from logical to device -// warning: this function can only be used for this purpose -// because no rotation is involved when mapping logical to device coordinates -// mirror and scaling for x and y will be part of the matrix -// if you have a matrix that is rotated, eg a shape containing a matrix to place -// it in the logical coordinate system, use TransformPoint -inline double wxTransformMatrix::TransformX(double x) const -{ - //normally like this, but since no rotation is involved (only mirror and scale) - //we can do without Y -> m_matrix[1]{0] is -sin(rotation angle) and therefore zero - //(x * m_matrix[0][0] + y * m_matrix[1][0] + m_matrix[2][0])) - return (m_isIdentity ? x : (x * m_matrix[0][0] + m_matrix[2][0])); -} - -// Transform Y value from logical to device -// warning: this function can only be used for this purpose -// because no rotation is involved when mapping logical to device coordinates -// mirror and scaling for x and y will be part of the matrix -// if you have a matrix that is rotated, eg a shape containing a matrix to place -// it in the logical coordinate system, use TransformPoint -inline double wxTransformMatrix::TransformY(double y) const -{ - //normally like this, but since no rotation is involved (only mirror and scale) - //we can do without X -> m_matrix[0]{1] is sin(rotation angle) and therefore zero - //(x * m_matrix[0][1] + y * m_matrix[1][1] + m_matrix[2][1])) - return (m_isIdentity ? y : (y * m_matrix[1][1] + m_matrix[2][1])); -} - - -// Is the matrix the identity matrix? -// Each operation checks whether the result is still the identity matrix and sets a flag. -inline bool wxTransformMatrix::IsIdentity1(void) const -{ - return - ( wxIsSameDouble(m_matrix[0][0], 1.0) && - wxIsSameDouble(m_matrix[1][1], 1.0) && - wxIsSameDouble(m_matrix[2][2], 1.0) && - wxIsSameDouble(m_matrix[1][0], 0.0) && - wxIsSameDouble(m_matrix[2][0], 0.0) && - wxIsSameDouble(m_matrix[0][1], 0.0) && - wxIsSameDouble(m_matrix[2][1], 0.0) && - wxIsSameDouble(m_matrix[0][2], 0.0) && - wxIsSameDouble(m_matrix[1][2], 0.0) ); -} - -// Calculates the determinant of a 2 x 2 matrix -inline double wxCalculateDet(double a11, double a21, double a12, double a22) -{ - return a11 * a22 - a12 * a21; -} - -#endif // _WX_MATRIXH__ diff --git a/wxWidgets/include/wx/mdi.h b/wxWidgets/include/wx/mdi.h deleted file mode 100644 index f18b54a967..0000000000 --- a/wxWidgets/include/wx/mdi.h +++ /dev/null @@ -1,40 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/mdi.h -// Purpose: wxMDI base header -// Author: Julian Smart -// Modified by: -// Created: -// Copyright: (c) Julian Smart -// RCS-ID: $Id: mdi.h 37066 2006-01-23 03:27:34Z MR $ -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_MDI_H_BASE_ -#define _WX_MDI_H_BASE_ - -#include "wx/defs.h" - -#if wxUSE_MDI - -#if defined(__WXUNIVERSAL__) - #include "wx/generic/mdig.h" -#elif defined(__WXMSW__) - #include "wx/msw/mdi.h" -#elif defined(__WXMOTIF__) - #include "wx/motif/mdi.h" -#elif defined(__WXGTK20__) - #include "wx/gtk/mdi.h" -#elif defined(__WXGTK__) - #include "wx/gtk1/mdi.h" -#elif defined(__WXMAC__) - #include "wx/mac/mdi.h" -#elif defined(__WXCOCOA__) - #include "wx/cocoa/mdi.h" -#elif defined(__WXPM__) - #include "wx/generic/mdig.h" -#endif - -#endif // wxUSE_MDI - -#endif - // _WX_MDI_H_BASE_ diff --git a/wxWidgets/include/wx/mediactrl.h b/wxWidgets/include/wx/mediactrl.h deleted file mode 100644 index c47557b03a..0000000000 --- a/wxWidgets/include/wx/mediactrl.h +++ /dev/null @@ -1,422 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: wx/mediactrl.h -// Purpose: wxMediaCtrl class -// Author: Ryan Norton <wxprojects@comcast.net> -// Modified by: -// Created: 11/07/04 -// RCS-ID: $Id: mediactrl.h 41020 2006-09-05 20:47:48Z VZ $ -// Copyright: (c) Ryan Norton -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// Definitions -// ============================================================================ - -// ---------------------------------------------------------------------------- -// Header guard -// ---------------------------------------------------------------------------- -#ifndef _WX_MEDIACTRL_H_ -#define _WX_MEDIACTRL_H_ - -// ---------------------------------------------------------------------------- -// Pre-compiled header stuff -// ---------------------------------------------------------------------------- - -#include "wx/defs.h" - -// ---------------------------------------------------------------------------- -// Compilation guard -// ---------------------------------------------------------------------------- - -#if wxUSE_MEDIACTRL - -// ---------------------------------------------------------------------------- -// Includes -// ---------------------------------------------------------------------------- - -#include "wx/control.h" -#include "wx/uri.h" - -// ============================================================================ -// Declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// -// Enumerations -// -// ---------------------------------------------------------------------------- - -enum wxMediaState -{ - wxMEDIASTATE_STOPPED, - wxMEDIASTATE_PAUSED, - wxMEDIASTATE_PLAYING -}; - -enum wxMediaCtrlPlayerControls -{ - wxMEDIACTRLPLAYERCONTROLS_NONE = 0, - //Step controls like fastfoward, step one frame etc. - wxMEDIACTRLPLAYERCONTROLS_STEP = 1 << 0, - //Volume controls like the speaker icon, volume slider, etc. - wxMEDIACTRLPLAYERCONTROLS_VOLUME = 1 << 1, - wxMEDIACTRLPLAYERCONTROLS_DEFAULT = - wxMEDIACTRLPLAYERCONTROLS_STEP | - wxMEDIACTRLPLAYERCONTROLS_VOLUME -}; - -#define wxMEDIABACKEND_DIRECTSHOW wxT("wxAMMediaBackend") -#define wxMEDIABACKEND_MCI wxT("wxMCIMediaBackend") -#define wxMEDIABACKEND_QUICKTIME wxT("wxQTMediaBackend") -#define wxMEDIABACKEND_GSTREAMER wxT("wxGStreamerMediaBackend") -#define wxMEDIABACKEND_REALPLAYER wxT("wxRealPlayerMediaBackend") -#define wxMEDIABACKEND_WMP10 wxT("wxWMP10MediaBackend") - -// ---------------------------------------------------------------------------- -// -// wxMediaEvent -// -// ---------------------------------------------------------------------------- - -class WXDLLIMPEXP_MEDIA wxMediaEvent : public wxNotifyEvent -{ -public: - // ------------------------------------------------------------------------ - // wxMediaEvent Constructor - // - // Normal constructor, much the same as wxNotifyEvent - // ------------------------------------------------------------------------ - wxMediaEvent(wxEventType commandType = wxEVT_NULL, int winid = 0) - : wxNotifyEvent(commandType, winid) - { } - - // ------------------------------------------------------------------------ - // wxMediaEvent Copy Constructor - // - // Normal copy constructor, much the same as wxNotifyEvent - // ------------------------------------------------------------------------ - wxMediaEvent(const wxMediaEvent &clone) - : wxNotifyEvent(clone) - { } - - // ------------------------------------------------------------------------ - // wxMediaEvent::Clone - // - // Allocates a copy of this object. - // Required for wxEvtHandler::AddPendingEvent - // ------------------------------------------------------------------------ - virtual wxEvent *Clone() const - { return new wxMediaEvent(*this); } - - - // Put this class on wxWidget's RTTI table - DECLARE_DYNAMIC_CLASS(wxMediaEvent) -}; - -// ---------------------------------------------------------------------------- -// -// wxMediaCtrl -// -// ---------------------------------------------------------------------------- - -class WXDLLIMPEXP_MEDIA wxMediaCtrl : public wxControl -{ -public: - wxMediaCtrl() : m_imp(NULL), m_bLoaded(false) - { } - - wxMediaCtrl(wxWindow* parent, wxWindowID winid, - const wxString& fileName = wxEmptyString, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = 0, - const wxString& szBackend = wxEmptyString, - const wxValidator& validator = wxDefaultValidator, - const wxString& name = wxT("mediaCtrl")) - : m_imp(NULL), m_bLoaded(false) - { Create(parent, winid, fileName, pos, size, style, - szBackend, validator, name); } - - wxMediaCtrl(wxWindow* parent, wxWindowID winid, - const wxURI& location, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = 0, - const wxString& szBackend = wxEmptyString, - const wxValidator& validator = wxDefaultValidator, - const wxString& name = wxT("mediaCtrl")) - : m_imp(NULL), m_bLoaded(false) - { Create(parent, winid, location, pos, size, style, - szBackend, validator, name); } - - virtual ~wxMediaCtrl(); - - bool Create(wxWindow* parent, wxWindowID winid, - const wxString& fileName = wxEmptyString, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = 0, - const wxString& szBackend = wxEmptyString, - const wxValidator& validator = wxDefaultValidator, - const wxString& name = wxT("mediaCtrl")); - - bool Create(wxWindow* parent, wxWindowID winid, - const wxURI& location, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = 0, - const wxString& szBackend = wxEmptyString, - const wxValidator& validator = wxDefaultValidator, - const wxString& name = wxT("mediaCtrl")); - - bool DoCreate(wxClassInfo* instance, - wxWindow* parent, wxWindowID winid, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = 0, - const wxValidator& validator = wxDefaultValidator, - const wxString& name = wxT("mediaCtrl")); - - bool Play(); - bool Pause(); - bool Stop(); - - bool Load(const wxString& fileName); - - wxMediaState GetState(); - - wxFileOffset Seek(wxFileOffset where, wxSeekMode mode = wxFromStart); - wxFileOffset Tell(); //FIXME: This should be const - wxFileOffset Length(); //FIXME: This should be const - -#if wxABI_VERSION >= 20601 /* 2.6.1+ only */ - double GetPlaybackRate(); //All but MCI & GStreamer - bool SetPlaybackRate(double dRate); //All but MCI & GStreamer -#endif - -#if wxABI_VERSION >= 20602 /* 2.6.2+ only */ - bool Load(const wxURI& location); - bool Load(const wxURI& location, const wxURI& proxy); - - wxFileOffset GetDownloadProgress(); // DirectShow only - wxFileOffset GetDownloadTotal(); // DirectShow only - - double GetVolume(); - bool SetVolume(double dVolume); - - bool ShowPlayerControls( - wxMediaCtrlPlayerControls flags = wxMEDIACTRLPLAYERCONTROLS_DEFAULT); - - //helpers for the wxPython people - bool LoadURI(const wxString& fileName) - { return Load(wxURI(fileName)); } - bool LoadURIWithProxy(const wxString& fileName, const wxString& proxy) - { return Load(wxURI(fileName), wxURI(proxy)); } -#endif - -protected: - static wxClassInfo* NextBackend(); - - void OnMediaFinished(wxMediaEvent& evt); - virtual void DoMoveWindow(int x, int y, int w, int h); - wxSize DoGetBestSize() const; - - //FIXME: This is nasty... find a better way to work around - //inheritance issues -#if defined(__WXMAC__) - virtual void MacVisibilityChanged(); -#endif -#if defined(__WXMAC__) || defined(__WXCOCOA__) - friend class wxQTMediaBackend; -#endif - class wxMediaBackend* m_imp; - bool m_bLoaded; - - DECLARE_DYNAMIC_CLASS(wxMediaCtrl) -}; - -// ---------------------------------------------------------------------------- -// -// wxMediaBackend -// -// Derive from this and use standard wxWidgets RTTI -// (DECLARE_DYNAMIC_CLASS and IMPLEMENT_CLASS) to make a backend -// for wxMediaCtrl. Backends are searched alphabetically - -// the one with the earliest letter is tried first. -// -// Note that this is currently not API or ABI compatable - -// so statically link or make the client compile on-site. -// -// ---------------------------------------------------------------------------- - -class WXDLLIMPEXP_MEDIA wxMediaBackend : public wxObject -{ -public: - wxMediaBackend() - { } - - virtual ~wxMediaBackend(); - - virtual bool CreateControl(wxControl* WXUNUSED(ctrl), - wxWindow* WXUNUSED(parent), - wxWindowID WXUNUSED(winid), - const wxPoint& WXUNUSED(pos), - const wxSize& WXUNUSED(size), - long WXUNUSED(style), - const wxValidator& WXUNUSED(validator), - const wxString& WXUNUSED(name)) - { return false; } - - virtual bool Play() - { return false; } - virtual bool Pause() - { return false; } - virtual bool Stop() - { return false; } - - virtual bool Load(const wxString& WXUNUSED(fileName)) - { return false; } - virtual bool Load(const wxURI& WXUNUSED(location)) - { return false; } - - virtual bool SetPosition(wxLongLong WXUNUSED(where)) - { return 0; } - virtual wxLongLong GetPosition() - { return 0; } - virtual wxLongLong GetDuration() - { return 0; } - - virtual void Move(int WXUNUSED(x), int WXUNUSED(y), - int WXUNUSED(w), int WXUNUSED(h)) - { } - virtual wxSize GetVideoSize() const - { return wxSize(0,0); } - - virtual double GetPlaybackRate() - { return 0.0; } - virtual bool SetPlaybackRate(double WXUNUSED(dRate)) - { return false; } - - virtual wxMediaState GetState() - { return wxMEDIASTATE_STOPPED; } - - virtual double GetVolume() - { return 0.0; } - virtual bool SetVolume(double WXUNUSED(dVolume)) - { return false; } - - virtual bool Load(const wxURI& WXUNUSED(location), - const wxURI& WXUNUSED(proxy)) - { return false; } - - virtual bool ShowPlayerControls( - wxMediaCtrlPlayerControls WXUNUSED(flags)) - { return false; } - virtual bool IsInterfaceShown() - { return false; } - - virtual wxLongLong GetDownloadProgress() - { return 0; } - virtual wxLongLong GetDownloadTotal() - { return 0; } - - virtual void MacVisibilityChanged() - { } - virtual void RESERVED9() {} - - DECLARE_DYNAMIC_CLASS(wxMediaBackend) -}; - - -//Event ID to give to our events -#define wxMEDIA_FINISHED_ID 13000 -#define wxMEDIA_STOP_ID 13001 - -//Define our event types - we need to call DEFINE_EVENT_TYPE(EVT) later -DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_MEDIA, wxEVT_MEDIA_FINISHED, wxMEDIA_FINISHED_ID) -DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_MEDIA, wxEVT_MEDIA_STOP, wxMEDIA_STOP_ID) - -//Function type(s) our events need -typedef void (wxEvtHandler::*wxMediaEventFunction)(wxMediaEvent&); - -#define wxMediaEventHandler(func) \ - (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxMediaEventFunction, &func) - -//Macro for usage with message maps -#define EVT_MEDIA_FINISHED(winid, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_MEDIA_FINISHED, winid, wxID_ANY, wxMediaEventHandler(fn), (wxObject *) NULL ), -#define EVT_MEDIA_STOP(winid, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_MEDIA_STOP, winid, wxID_ANY, wxMediaEventHandler(fn), (wxObject *) NULL ), - -#if wxABI_VERSION >= 20602 /* 2.6.2+ only */ -# define wxMEDIA_LOADED_ID 13002 - DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_MEDIA, wxEVT_MEDIA_LOADED, wxMEDIA_LOADED_ID) -# define EVT_MEDIA_LOADED(winid, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_MEDIA_LOADED, winid, wxID_ANY, wxMediaEventHandler(fn), (wxObject *) NULL ), -#endif - -#if wxABI_VERSION >= 20603 /* 2.6.3+ only */ -# define wxMEDIA_STATECHANGED_ID 13003 -# define wxMEDIA_PLAY_ID 13004 -# define wxMEDIA_PAUSE_ID 13005 - DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_MEDIA, wxEVT_MEDIA_STATECHANGED, wxMEDIA_STATECHANGED_ID) - DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_MEDIA, wxEVT_MEDIA_PLAY, wxMEDIA_PLAY_ID) - DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_MEDIA, wxEVT_MEDIA_PAUSE, wxMEDIA_PAUSE_ID) -# define EVT_MEDIA_STATECHANGED(winid, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_MEDIA_STATECHANGED, winid, wxID_ANY, wxMediaEventHandler(fn), (wxObject *) NULL ), -# define EVT_MEDIA_PLAY(winid, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_MEDIA_PLAY, winid, wxID_ANY, wxMediaEventHandler(fn), (wxObject *) NULL ), -# define EVT_MEDIA_PAUSE(winid, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_MEDIA_PAUSE, winid, wxID_ANY, wxMediaEventHandler(fn), (wxObject *) NULL ), -#endif - -// ---------------------------------------------------------------------------- -// common backend base class used by many other backends -// ---------------------------------------------------------------------------- - -class WXDLLIMPEXP_MEDIA wxMediaBackendCommonBase : public wxMediaBackend -{ -public: - // add a pending wxMediaEvent of the given type - void QueueEvent(wxEventType evtType); - - // notify that the movie playback is finished - void QueueFinishEvent() - { -#if wxABI_VERSION >= 20603 /* 2.6.3+ only */ - QueueEvent(wxEVT_MEDIA_STATECHANGED); -#endif - QueueEvent(wxEVT_MEDIA_FINISHED); - } - - // send the stop event and return true if it hasn't been vetoed - bool SendStopEvent(); - - // Queue pause event - void QueuePlayEvent(); - - // Queue pause event - void QueuePauseEvent(); - - // Queue stop event (no veto) - void QueueStopEvent(); - -protected: - // call this when the movie size has changed but not because it has just - // been loaded (in this case, call NotifyMovieLoaded() below) - void NotifyMovieSizeChanged(); - - // call this when the movie is fully loaded - void NotifyMovieLoaded(); - - - wxMediaCtrl *m_ctrl; // parent control -}; - -// ---------------------------------------------------------------------------- -// End compilation gaurd -// ---------------------------------------------------------------------------- -#endif // wxUSE_MEDIACTRL - -// ---------------------------------------------------------------------------- -// End header guard and header itself -// ---------------------------------------------------------------------------- -#endif // _WX_MEDIACTRL_H_ - - diff --git a/wxWidgets/include/wx/memconf.h b/wxWidgets/include/wx/memconf.h deleted file mode 100644 index eec82a43ae..0000000000 --- a/wxWidgets/include/wx/memconf.h +++ /dev/null @@ -1,54 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: wx/memconf.h -// Purpose: wxMemoryConfig class: a wxConfigBase implementation which only -// stores the settings in memory (thus they are lost when the -// program terminates) -// Author: Vadim Zeitlin -// Modified by: -// Created: 22.01.00 -// RCS-ID: $Id: memconf.h 35650 2005-09-23 12:56:45Z MR $ -// Copyright: (c) 2000 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr> -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -/* - * NB: I don't see how this class may possibly be useful to the application - * program (as the settings are lost on program termination), but it is - * handy to have it inside wxWidgets. So for now let's say that this class - * is private and should only be used by wxWidgets itself - this might - * change in the future. - */ - -#ifndef _WX_MEMCONF_H_ -#define _WX_MEMCONF_H_ - -#if wxUSE_CONFIG - -#include "wx/fileconf.h" // the base class - -// ---------------------------------------------------------------------------- -// wxMemoryConfig: a config class which stores settings in non-persistent way -// ---------------------------------------------------------------------------- - -// notice that we inherit from wxFileConfig which already stores its data in -// memory and just disable file reading/writing - this is probably not optimal -// and might be changed in future as well (this class will always deriev from -// wxConfigBase though) -class wxMemoryConfig : public wxFileConfig -{ -public: - // default (and only) ctor - wxMemoryConfig() : wxFileConfig(wxEmptyString, // default app name - wxEmptyString, // default vendor name - wxEmptyString, // no local config file - wxEmptyString, // no system config file - 0) // don't use any files - { - } - - DECLARE_NO_COPY_CLASS(wxMemoryConfig) -}; - -#endif // wxUSE_CONFIG - -#endif // _WX_MEMCONF_H_ diff --git a/wxWidgets/include/wx/memory.h b/wxWidgets/include/wx/memory.h deleted file mode 100644 index adb8ed2ba4..0000000000 --- a/wxWidgets/include/wx/memory.h +++ /dev/null @@ -1,373 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/memory.h -// Purpose: Memory operations -// Author: Arthur Seaton, Julian Smart -// Modified by: -// Created: 29/01/98 -// RCS-ID: $Id: memory.h 39634 2006-06-08 12:51:01Z ABX $ -// Copyright: (c) 1998 Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_MEMORYH__ -#define _WX_MEMORYH__ - -#include "wx/defs.h" -#include "wx/string.h" -#include "wx/msgout.h" - -/* - The macro which will be expanded to include the file and line number - info, or to be a straight call to the new operator. -*/ - -#if (defined(__WXDEBUG__) && wxUSE_MEMORY_TRACING) || wxUSE_DEBUG_CONTEXT - -#include <stddef.h> - -#ifdef __WXDEBUG__ - -WXDLLIMPEXP_BASE void * wxDebugAlloc(size_t size, wxChar * fileName, int lineNum, bool isObject, bool isVect = false); -WXDLLIMPEXP_BASE void wxDebugFree(void * buf, bool isVect = false); - -//********************************************************************************** -/* - The global operator new used for everything apart from getting - dynamic storage within this function itself. -*/ - -// We'll only do malloc and free for the moment: leave the interesting -// stuff for the wxObject versions. - - -#if wxUSE_GLOBAL_MEMORY_OPERATORS - -// Undefine temporarily (new is #defined in object.h) because we want to -// declare some new operators. -#ifdef new - #undef new -#endif - -#if defined(__SUNCC__) - #define wxUSE_ARRAY_MEMORY_OPERATORS 0 -#elif !( defined (__VISUALC__) && (__VISUALC__ <= 1020) ) || defined( __MWERKS__) - #define wxUSE_ARRAY_MEMORY_OPERATORS 1 -#elif defined (__SGI_CC_) - // only supported by -n32 compilers - #ifndef __EDG_ABI_COMPATIBILITY_VERSION - #define wxUSE_ARRAY_MEMORY_OPERATORS 0 - #endif -#elif !( defined (__VISUALC__) && (__VISUALC__ <= 1020) ) || defined( __MWERKS__) - #define wxUSE_ARRAY_MEMORY_OPERATORS 1 -#else - // ::operator new[] is a recent C++ feature, so assume it's not supported - #define wxUSE_ARRAY_MEMORY_OPERATORS 0 -#endif - -// devik 2000-8-29: All new/delete ops are now inline because they can't -// be marked as dllexport/dllimport. It then leads to weird bugs when -// used on MSW as DLL -#if defined(__WXMSW__) && (defined(WXUSINGDLL) || defined(WXMAKINGDLL_BASE)) -inline void * operator new (size_t size, wxChar * fileName, int lineNum) -{ - return wxDebugAlloc(size, fileName, lineNum, false, false); -} - -inline void * operator new (size_t size) -{ - return wxDebugAlloc(size, NULL, 0, false); -} - -inline void operator delete (void * buf) -{ - wxDebugFree(buf, false); -} - -#if wxUSE_ARRAY_MEMORY_OPERATORS -inline void * operator new[] (size_t size) -{ - return wxDebugAlloc(size, NULL, 0, false, true); -} - -inline void * operator new[] (size_t size, wxChar * fileName, int lineNum) -{ - return wxDebugAlloc(size, fileName, lineNum, false, true); -} - -inline void operator delete[] (void * buf) -{ - wxDebugFree(buf, true); -} -#endif // wxUSE_ARRAY_MEMORY_OPERATORS - -#else - -void * operator new (size_t size, wxChar * fileName, int lineNum); - -void * operator new (size_t size); - -void operator delete (void * buf); - -#if wxUSE_ARRAY_MEMORY_OPERATORS -void * operator new[] (size_t size); - -void * operator new[] (size_t size, wxChar * fileName, int lineNum); - -void operator delete[] (void * buf); -#endif // wxUSE_ARRAY_MEMORY_OPERATORS -#endif // defined(__WXMSW__) && (defined(WXUSINGDLL) || defined(WXMAKINGDLL_BASE)) - -// VC++ 6.0 and MWERKS -#if ( defined(__VISUALC__) && (__VISUALC__ >= 1200) ) || defined(__MWERKS__) -inline void operator delete(void* pData, wxChar* /* fileName */, int /* lineNum */) -{ - wxDebugFree(pData, false); -} -inline void operator delete[](void* pData, wxChar* /* fileName */, int /* lineNum */) -{ - wxDebugFree(pData, true); -} -#endif // __VISUALC__>=1200 -#endif // wxUSE_GLOBAL_MEMORY_OPERATORS -#endif // __WXDEBUG__ - -//********************************************************************************** - -typedef unsigned int wxMarkerType; - -/* - Define the struct which will be placed at the start of all dynamically - allocated memory. -*/ - -class WXDLLIMPEXP_BASE wxMemStruct { - -friend class WXDLLIMPEXP_BASE wxDebugContext; // access to the m_next pointer for list traversal. - -public: -public: - int AssertList (); - - size_t RequestSize () { return m_reqSize; } - wxMarkerType Marker () { return m_firstMarker; } - - // When an object is deleted we set the id slot to a specific value. - inline void SetDeleted (); - inline int IsDeleted (); - - int Append (); - int Unlink (); - - // Used to determine if the object is really a wxMemStruct. - // Not a foolproof test by any means, but better than none I hope! - int AssertIt (); - - // Do all validation on a node. - int ValidateNode (); - - // Check the integrity of a node and of the list, node by node. - int CheckBlock (); - int CheckAllPrevious (); - - // Print a single node. - void PrintNode (); - - // Called when the memory linking functions get an error. - void ErrorMsg (const char *); - void ErrorMsg (); - - inline void *GetActualData(void) const { return m_actualData; } - - void Dump(void); - -public: - // Check for underwriting. There are 2 of these checks. This one - // inside the struct and another right after the struct. - wxMarkerType m_firstMarker; - - // File name and line number are from cpp. - wxChar* m_fileName; - int m_lineNum; - - // The amount of memory requested by the caller. - size_t m_reqSize; - - // Used to try to verify that we really are dealing with an object - // of the required class. Can be 1 of 2 values these indicating a valid - // wxMemStruct object, or a deleted wxMemStruct object. - wxMarkerType m_id; - - wxMemStruct * m_prev; - wxMemStruct * m_next; - - void * m_actualData; - bool m_isObject; -}; - - -typedef void (wxMemStruct::*PmSFV) (); - - -/* - Debugging class. This will only have a single instance, but it's - a reasonable way to keep everything together and to make this - available for change if needed by someone else. - A lot of this stuff would be better off within the wxMemStruct class, but - it's stuff which we need to access at times when there is no wxMemStruct - object so we use this class instead. Think of it as a collection of - globals which have to do with the wxMemStruct class. -*/ - -class WXDLLIMPEXP_BASE wxDebugContext { - -protected: - // Used to set alignment for markers. - static size_t CalcAlignment (); - - // Returns the amount of padding needed after something of the given - // size. This is so that when we cast pointers backwards and forwards - // the pointer value will be valid for a wxMarkerType. - static size_t GetPadding (const size_t size) ; - - // Traverse the list. - static void TraverseList (PmSFV, wxMemStruct *from = NULL); - - static int debugLevel; - static bool debugOn; - - static int m_balign; // byte alignment - static int m_balignmask; // mask for performing byte alignment -public: - // Set a checkpoint to dump only the memory from - // a given point - static wxMemStruct *checkPoint; - - wxDebugContext(void); - ~wxDebugContext(void); - - static int GetLevel(void) { return debugLevel; } - static void SetLevel(int level) { debugLevel = level; } - - static bool GetDebugMode(void) { return debugOn; } - static void SetDebugMode(bool flag) { debugOn = flag; } - - static void SetCheckpoint(bool all = false); - static wxMemStruct *GetCheckpoint(void) { return checkPoint; } - - // Calculated from the request size and any padding needed - // before the final marker. - static size_t PaddedSize (const size_t reqSize); - - // Calc the total amount of space we need from the system - // to satisfy a caller request. This includes all padding. - static size_t TotSize (const size_t reqSize); - - // Return valid pointers to offsets within the allocated memory. - static char * StructPos (const char * buf); - static char * MidMarkerPos (const char * buf); - static char * CallerMemPos (const char * buf); - static char * EndMarkerPos (const char * buf, const size_t size); - - // Given a pointer to the start of the caller requested area - // return a pointer to the start of the entire alloc\'d buffer. - static char * StartPos (const char * caller); - - // Access to the list. - static wxMemStruct * GetHead () { return m_head; } - static wxMemStruct * GetTail () { return m_tail; } - - // Set the list sentinals. - static wxMemStruct * SetHead (wxMemStruct * st) { return (m_head = st); } - static wxMemStruct * SetTail (wxMemStruct * st) { return (m_tail = st); } - - // If this is set then every new operation checks the validity - // of the all previous nodes in the list. - static bool GetCheckPrevious () { return m_checkPrevious; } - static void SetCheckPrevious (bool value) { m_checkPrevious = value; } - - // Checks all nodes, or all nodes if checkAll is true - static int Check(bool checkAll = false); - - // Print out the list of wxMemStruct nodes. - static bool PrintList(void); - - // Dump objects - static bool Dump(void); - - // Print statistics - static bool PrintStatistics(bool detailed = true); - - // Print out the classes in the application. - static bool PrintClasses(void); - - // Count the number of non-wxDebugContext-related objects - // that are outstanding - static int CountObjectsLeft(bool sinceCheckpoint = false); - - // This function is used to output the dump - static void OutputDumpLine(const wxChar *szFormat, ...); - -private: - // Store these here to allow access to the list without - // needing to have a wxMemStruct object. - static wxMemStruct* m_head; - static wxMemStruct* m_tail; - - // Set to false if we're not checking all previous nodes when - // we do a new. Set to true when we are. - static bool m_checkPrevious; -}; - -// Final cleanup (e.g. deleting the log object and doing memory leak checking) -// will be delayed until all wxDebugContextDumpDelayCounter objects have been -// destructed. Adding one wxDebugContextDumpDelayCounter per file will delay -// memory leak checking until after destructing all global objects. -class WXDLLIMPEXP_BASE wxDebugContextDumpDelayCounter -{ -public: - wxDebugContextDumpDelayCounter() { - sm_count++; - } - - ~wxDebugContextDumpDelayCounter() { - sm_count--; - if(!sm_count) DoDump(); - } -private: - void DoDump(); - static int sm_count; -}; - -// make leak dump after all globals have been destructed -static wxDebugContextDumpDelayCounter wxDebugContextDumpDelayCounter_File; -#define WXDEBUG_DUMPDELAYCOUNTER \ - static wxDebugContextDumpDelayCounter wxDebugContextDumpDelayCounter_Extra; - -// Output a debug message, in a system dependent fashion. -void WXDLLIMPEXP_BASE wxTrace(const wxChar *fmt ...) ATTRIBUTE_PRINTF_1; -void WXDLLIMPEXP_BASE wxTraceLevel(int level, const wxChar *fmt ...) ATTRIBUTE_PRINTF_2; - -#define WXTRACE wxTrace -#define WXTRACELEVEL wxTraceLevel - -#else // (defined(__WXDEBUG__) && wxUSE_MEMORY_TRACING) || wxUSE_DEBUG_CONTEXT - -#define WXDEBUG_DUMPDELAYCOUNTER - -// Borland C++ Builder 6 seems to have troubles with inline functions (see bug -// 819700) -#if 0 - inline void wxTrace(const wxChar *WXUNUSED(fmt)) {} - inline void wxTraceLevel(int WXUNUSED(level), const wxChar *WXUNUSED(fmt)) {} -#else - #define wxTrace(fmt) - #define wxTraceLevel(l, fmt) -#endif - -#define WXTRACE true ? (void)0 : wxTrace -#define WXTRACELEVEL true ? (void)0 : wxTraceLevel - -#endif // (defined(__WXDEBUG__) && wxUSE_MEMORY_TRACING) || wxUSE_DEBUG_CONTEXT - -#endif - // _WX_MEMORYH__ diff --git a/wxWidgets/include/wx/memtext.h b/wxWidgets/include/wx/memtext.h deleted file mode 100644 index a093f40b04..0000000000 --- a/wxWidgets/include/wx/memtext.h +++ /dev/null @@ -1,54 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: wx/memtext.h -// Purpose: wxMemoryText allows to use wxTextBuffer without a file -// Created: 14.11.01 -// Author: Morten Hanssen -// Copyright: (c) 2001 Morten Hanssen -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_MEMTEXT_H -#define _WX_MEMTEXT_H - -#include "wx/defs.h" - -// there is no separate setting for wxMemoryText, it's smallish anyhow -#if wxUSE_TEXTBUFFER - -// ---------------------------------------------------------------------------- -// wxMemoryText -// ---------------------------------------------------------------------------- - -class WXDLLIMPEXP_BASE wxMemoryText : public wxTextBuffer -{ -public: - // Constructors. - wxMemoryText() { } - wxMemoryText(const wxString& name) : wxTextBuffer(name) { } - -protected: - virtual bool OnExists() const - { return false; } - - virtual bool OnOpen(const wxString & WXUNUSED(strBufferName), - wxTextBufferOpenMode WXUNUSED(OpenMode)) - { return true; } - - virtual bool OnClose() - { return true; } - - virtual bool OnRead(const wxMBConv& WXUNUSED(conv)) - { return true; } - - virtual bool OnWrite(wxTextFileType WXUNUSED(typeNew), - const wxMBConv& WXUNUSED(conv) = wxConvUTF8) - { return true; } - -private: - DECLARE_NO_COPY_CLASS(wxMemoryText) -}; - -#endif // wxUSE_TEXTBUFFER - -#endif // _WX_MEMTEXT_H - diff --git a/wxWidgets/include/wx/menu.h b/wxWidgets/include/wx/menu.h deleted file mode 100644 index 23e47a0b35..0000000000 --- a/wxWidgets/include/wx/menu.h +++ /dev/null @@ -1,555 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: wx/menu.h -// Purpose: wxMenu and wxMenuBar classes -// Author: Vadim Zeitlin -// Modified by: -// Created: 26.10.99 -// RCS-ID: $Id: menu.h 49563 2007-10-31 20:46:21Z VZ $ -// Copyright: (c) wxWidgets team -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_MENU_H_BASE_ -#define _WX_MENU_H_BASE_ - -#include "wx/defs.h" - -#if wxUSE_MENUS - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -#include "wx/list.h" // for "template" list classes -#include "wx/window.h" // base class for wxMenuBar - -// also include this one to ensure compatibility with old code which only -// included wx/menu.h -#include "wx/menuitem.h" - -class WXDLLIMPEXP_FWD_CORE wxMenu; -class WXDLLIMPEXP_FWD_CORE wxMenuBarBase; -class WXDLLIMPEXP_FWD_CORE wxMenuBar; -class WXDLLIMPEXP_FWD_CORE wxMenuItem; - -// pseudo template list classes -WX_DECLARE_EXPORTED_LIST(wxMenu, wxMenuList); -WX_DECLARE_EXPORTED_LIST(wxMenuItem, wxMenuItemList); - -// ---------------------------------------------------------------------------- -// wxMenu -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxMenuBase : public wxEvtHandler -{ -public: - // create a menu - static wxMenu *New(const wxString& title = wxEmptyString, long style = 0); - - // ctors - wxMenuBase(const wxString& title, long style = 0) : m_title(title) - { Init(style); } - wxMenuBase(long style = 0) - { Init(style); } - - // dtor deletes all the menu items we own - virtual ~wxMenuBase(); - - // menu construction - // ----------------- - - // append any kind of item (normal/check/radio/separator) - wxMenuItem* Append(int itemid, - const wxString& text = wxEmptyString, - const wxString& help = wxEmptyString, - wxItemKind kind = wxITEM_NORMAL) - { - return DoAppend(wxMenuItem::New((wxMenu *)this, itemid, text, help, kind)); - } - - // append a separator to the menu - wxMenuItem* AppendSeparator() { return Append(wxID_SEPARATOR, wxEmptyString); } - - // append a check item - wxMenuItem* AppendCheckItem(int itemid, - const wxString& text, - const wxString& help = wxEmptyString) - { - return Append(itemid, text, help, wxITEM_CHECK); - } - - // append a radio item - wxMenuItem* AppendRadioItem(int itemid, - const wxString& text, - const wxString& help = wxEmptyString) - { - return Append(itemid, text, help, wxITEM_RADIO); - } - - // append a submenu - wxMenuItem* AppendSubMenu(wxMenu *submenu, - const wxString& text, - const wxString& help = wxEmptyString) - { - return DoAppend(wxMenuItem::New((wxMenu *)this, wxID_ANY, text, help, - wxITEM_NORMAL, submenu)); - } - - // the most generic form of Append() - append anything - wxMenuItem* Append(wxMenuItem *item) { return DoAppend(item); } - - // insert a break in the menu (only works when appending the items, not - // inserting them) - virtual void Break() { } - - // insert an item before given position - wxMenuItem* Insert(size_t pos, wxMenuItem *item); - - // insert an item before given position - wxMenuItem* Insert(size_t pos, - int itemid, - const wxString& text = wxEmptyString, - const wxString& help = wxEmptyString, - wxItemKind kind = wxITEM_NORMAL) - { - return Insert(pos, wxMenuItem::New((wxMenu *)this, itemid, text, help, kind)); - } - - // insert a separator - wxMenuItem* InsertSeparator(size_t pos) - { - return Insert(pos, wxMenuItem::New((wxMenu *)this, wxID_SEPARATOR)); - } - - // insert a check item - wxMenuItem* InsertCheckItem(size_t pos, - int itemid, - const wxString& text, - const wxString& help = wxEmptyString) - { - return Insert(pos, itemid, text, help, wxITEM_CHECK); - } - - // insert a radio item - wxMenuItem* InsertRadioItem(size_t pos, - int itemid, - const wxString& text, - const wxString& help = wxEmptyString) - { - return Insert(pos, itemid, text, help, wxITEM_RADIO); - } - - // insert a submenu - wxMenuItem* Insert(size_t pos, - int itemid, - const wxString& text, - wxMenu *submenu, - const wxString& help = wxEmptyString) - { - return Insert(pos, wxMenuItem::New((wxMenu *)this, itemid, text, help, - wxITEM_NORMAL, submenu)); - } - - // prepend an item to the menu - wxMenuItem* Prepend(wxMenuItem *item) - { - return Insert(0u, item); - } - - // prepend any item to the menu - wxMenuItem* Prepend(int itemid, - const wxString& text = wxEmptyString, - const wxString& help = wxEmptyString, - wxItemKind kind = wxITEM_NORMAL) - { - return Insert(0u, itemid, text, help, kind); - } - - // prepend a separator - wxMenuItem* PrependSeparator() - { - return InsertSeparator(0u); - } - - // prepend a check item - wxMenuItem* PrependCheckItem(int itemid, - const wxString& text, - const wxString& help = wxEmptyString) - { - return InsertCheckItem(0u, itemid, text, help); - } - - // prepend a radio item - wxMenuItem* PrependRadioItem(int itemid, - const wxString& text, - const wxString& help = wxEmptyString) - { - return InsertRadioItem(0u, itemid, text, help); - } - - // prepend a submenu - wxMenuItem* Prepend(int itemid, - const wxString& text, - wxMenu *submenu, - const wxString& help = wxEmptyString) - { - return Insert(0u, itemid, text, submenu, help); - } - - // detach an item from the menu, but don't delete it so that it can be - // added back later (but if it's not, the caller is responsible for - // deleting it!) - wxMenuItem *Remove(int itemid) { return Remove(FindChildItem(itemid)); } - wxMenuItem *Remove(wxMenuItem *item); - - // delete an item from the menu (submenus are not destroyed by this - // function, see Destroy) - bool Delete(int itemid) { return Delete(FindChildItem(itemid)); } - bool Delete(wxMenuItem *item); - - // delete the item from menu and destroy it (if it's a submenu) - bool Destroy(int itemid) { return Destroy(FindChildItem(itemid)); } - bool Destroy(wxMenuItem *item); - - // menu items access - // ----------------- - - // get the items - size_t GetMenuItemCount() const { return m_items.GetCount(); } - - const wxMenuItemList& GetMenuItems() const { return m_items; } - wxMenuItemList& GetMenuItems() { return m_items; } - - // search - virtual int FindItem(const wxString& item) const; - wxMenuItem* FindItem(int itemid, wxMenu **menu = NULL) const; - - // find by position - wxMenuItem* FindItemByPosition(size_t position) const; - - // get/set items attributes - void Enable(int itemid, bool enable); - bool IsEnabled(int itemid) const; - - void Check(int itemid, bool check); - bool IsChecked(int itemid) const; - - void SetLabel(int itemid, const wxString& label); - wxString GetLabel(int itemid) const; - - virtual void SetHelpString(int itemid, const wxString& helpString); - virtual wxString GetHelpString(int itemid) const; - - // misc accessors - // -------------- - - // the title - virtual void SetTitle(const wxString& title) { m_title = title; } - const wxString GetTitle() const { return m_title; } - - // event handler - void SetEventHandler(wxEvtHandler *handler) { m_eventHandler = handler; } - wxEvtHandler *GetEventHandler() const { return m_eventHandler; } - - // invoking window - void SetInvokingWindow(wxWindow *win) { m_invokingWindow = win; } - wxWindow *GetInvokingWindow() const { return m_invokingWindow; } - - // style - long GetStyle() const { return m_style; } - - // implementation helpers - // ---------------------- - - // Updates the UI for a menu and all submenus recursively. source is the - // object that has the update event handlers defined for it. If NULL, the - // menu or associated window will be used. - void UpdateUI(wxEvtHandler* source = (wxEvtHandler*)NULL); - - // get the menu bar this menu is attached to (may be NULL, always NULL for - // popup menus). Traverse up the menu hierarchy to find it. - wxMenuBar *GetMenuBar() const; - - // called when the menu is attached/detached to/from a menu bar - virtual void Attach(wxMenuBarBase *menubar); - virtual void Detach(); - - // is the menu attached to a menu bar (or is it a popup one)? - bool IsAttached() const { return GetMenuBar() != NULL; } - - // set/get the parent of this menu - void SetParent(wxMenu *parent) { m_menuParent = parent; } - wxMenu *GetParent() const { return m_menuParent; } - - // implementation only from now on - // ------------------------------- - - // unlike FindItem(), this function doesn't recurse but only looks through - // our direct children and also may return the index of the found child if - // pos != NULL - wxMenuItem *FindChildItem(int itemid, size_t *pos = NULL) const; - - // called to generate a wxCommandEvent, return true if it was processed, - // false otherwise - // - // the checked parameter may have boolean value or -1 for uncheckable items - bool SendEvent(int itemid, int checked = -1); - - // compatibility: these functions are deprecated, use the new ones instead - // ----------------------------------------------------------------------- - - // use the versions taking wxItem_XXX now instead, they're more readable - // and allow adding the radio items as well - void Append(int itemid, - const wxString& text, - const wxString& help, - bool isCheckable) - { - Append(itemid, text, help, isCheckable ? wxITEM_CHECK : wxITEM_NORMAL); - } - - // use more readable and not requiring unused itemid AppendSubMenu() instead - wxMenuItem* Append(int itemid, - const wxString& text, - wxMenu *submenu, - const wxString& help = wxEmptyString) - { - return DoAppend(wxMenuItem::New((wxMenu *)this, itemid, text, help, - wxITEM_NORMAL, submenu)); - } - - void Insert(size_t pos, - int itemid, - const wxString& text, - const wxString& help, - bool isCheckable) - { - Insert(pos, itemid, text, help, isCheckable ? wxITEM_CHECK : wxITEM_NORMAL); - } - - void Prepend(int itemid, - const wxString& text, - const wxString& help, - bool isCheckable) - { - Insert(0u, itemid, text, help, isCheckable); - } - - static void LockAccels(bool locked) - { - ms_locked = locked; - } - -protected: - // virtuals to override in derived classes - // --------------------------------------- - - virtual wxMenuItem* DoAppend(wxMenuItem *item); - virtual wxMenuItem* DoInsert(size_t pos, wxMenuItem *item); - - virtual wxMenuItem *DoRemove(wxMenuItem *item); - virtual bool DoDelete(wxMenuItem *item); - virtual bool DoDestroy(wxMenuItem *item); - - // helpers - // ------- - - // common part of all ctors - void Init(long style); - - // associate the submenu with this menu - void AddSubMenu(wxMenu *submenu); - - wxMenuBar *m_menuBar; // menubar we belong to or NULL - wxMenu *m_menuParent; // parent menu or NULL - - wxString m_title; // the menu title or label - wxMenuItemList m_items; // the list of menu items - - wxWindow *m_invokingWindow; // for popup menus - - long m_style; // combination of wxMENU_XXX flags - - wxEvtHandler *m_eventHandler; // a pluggable in event handler - - static bool ms_locked; - - DECLARE_NO_COPY_CLASS(wxMenuBase) - -public: - -#if wxABI_VERSION >= 20805 - // Returns the stripped label - wxString GetLabelText(int itemid) const { return wxMenuItem::GetLabelFromText(GetLabel(itemid)); } -#endif - -}; - -// ---------------------------------------------------------------------------- -// wxMenuBar -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxMenuBarBase : public wxWindow -{ -public: - // default ctor - wxMenuBarBase(); - - // dtor will delete all menus we own - virtual ~wxMenuBarBase(); - - // menu bar construction - // --------------------- - - // append a menu to the end of menubar, return true if ok - virtual bool Append(wxMenu *menu, const wxString& title); - - // insert a menu before the given position into the menubar, return true - // if inserted ok - virtual bool Insert(size_t pos, wxMenu *menu, const wxString& title); - - // menu bar items access - // --------------------- - - // get the number of menus in the menu bar - size_t GetMenuCount() const { return m_menus.GetCount(); } - - // get the menu at given position - wxMenu *GetMenu(size_t pos) const; - - // replace the menu at given position with another one, returns the - // previous menu (which should be deleted by the caller) - virtual wxMenu *Replace(size_t pos, wxMenu *menu, const wxString& title); - - // delete the menu at given position from the menu bar, return the pointer - // to the menu (which should be deleted by the caller) - virtual wxMenu *Remove(size_t pos); - - // enable or disable a submenu - virtual void EnableTop(size_t pos, bool enable) = 0; - - // is the menu enabled? - virtual bool IsEnabledTop(size_t WXUNUSED(pos)) const { return true; } - - // get or change the label of the menu at given position - virtual void SetLabelTop(size_t pos, const wxString& label) = 0; - virtual wxString GetLabelTop(size_t pos) const = 0; - - // item search - // ----------- - - // by menu and item names, returns wxNOT_FOUND if not found or id of the - // found item - virtual int FindMenuItem(const wxString& menu, const wxString& item) const; - - // find item by id (in any menu), returns NULL if not found - // - // if menu is !NULL, it will be filled with wxMenu this item belongs to - virtual wxMenuItem* FindItem(int itemid, wxMenu **menu = NULL) const; - - // find menu by its caption, return wxNOT_FOUND on failure - int FindMenu(const wxString& title) const; - - // item access - // ----------- - - // all these functions just use FindItem() and then call an appropriate - // method on it - // - // NB: under MSW, these methods can only be used after the menubar had - // been attached to the frame - - void Enable(int itemid, bool enable); - void Check(int itemid, bool check); - bool IsChecked(int itemid) const; - bool IsEnabled(int itemid) const; - virtual bool IsEnabled() const { return wxWindow::IsEnabled(); } - - void SetLabel(int itemid, const wxString &label); - wxString GetLabel(int itemid) const; - - void SetHelpString(int itemid, const wxString& helpString); - wxString GetHelpString(int itemid) const; - - // implementation helpers - - // get the frame we are attached to (may return NULL) - wxFrame *GetFrame() const { return m_menuBarFrame; } - - // returns true if we're attached to a frame - bool IsAttached() const { return GetFrame() != NULL; } - - // associate the menubar with the frame - virtual void Attach(wxFrame *frame); - - // called before deleting the menubar normally - virtual void Detach(); - - // need to override these ones to avoid virtual function hiding - virtual bool Enable(bool enable = true) { return wxWindow::Enable(enable); } - virtual void SetLabel(const wxString& s) { wxWindow::SetLabel(s); } - virtual wxString GetLabel() const { return wxWindow::GetLabel(); } - - // don't want menu bars to accept the focus by tabbing to them - virtual bool AcceptsFocusFromKeyboard() const { return false; } - - // update all menu item states in all menus - virtual void UpdateMenus(); - -protected: - // the list of all our menus - wxMenuList m_menus; - - // the frame we are attached to (may be NULL) - wxFrame *m_menuBarFrame; - - DECLARE_NO_COPY_CLASS(wxMenuBarBase) - -public: - -#if wxABI_VERSION >= 20805 - // Replacement for SetLabelTop - void SetMenuLabel(size_t pos, const wxString& label) { SetLabelTop(pos, label); } - - // Gets the original label at the top-level of the menubar - // Implemented per port, since we can't have virtual functions in the stable branch. - // wxString GetMenuLabel(size_t pos) const; - - // Get the text only, from the label at the top-level of the menubar - wxString GetMenuLabelText(size_t pos) const; -#endif - -}; - -// ---------------------------------------------------------------------------- -// include the real class declaration -// ---------------------------------------------------------------------------- - -#ifdef wxUSE_BASE_CLASSES_ONLY - #define wxMenuItem wxMenuItemBase -#else // !wxUSE_BASE_CLASSES_ONLY -#if defined(__WXUNIVERSAL__) - #include "wx/univ/menu.h" -#elif defined(__WXPALMOS__) - #include "wx/palmos/menu.h" -#elif defined(__WXMSW__) - #include "wx/msw/menu.h" -#elif defined(__WXMOTIF__) - #include "wx/motif/menu.h" -#elif defined(__WXGTK20__) - #include "wx/gtk/menu.h" -#elif defined(__WXGTK__) - #include "wx/gtk1/menu.h" -#elif defined(__WXMAC__) - #include "wx/mac/menu.h" -#elif defined(__WXCOCOA__) - #include "wx/cocoa/menu.h" -#elif defined(__WXPM__) - #include "wx/os2/menu.h" -#endif -#endif // wxUSE_BASE_CLASSES_ONLY/!wxUSE_BASE_CLASSES_ONLY - -#endif // wxUSE_MENUS - -#endif - // _WX_MENU_H_BASE_ diff --git a/wxWidgets/include/wx/menuitem.h b/wxWidgets/include/wx/menuitem.h deleted file mode 100644 index ac26948bae..0000000000 --- a/wxWidgets/include/wx/menuitem.h +++ /dev/null @@ -1,203 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: wx/menuitem.h -// Purpose: wxMenuItem class -// Author: Vadim Zeitlin -// Modified by: -// Created: 25.10.99 -// RCS-ID: $Id: menuitem.h 49563 2007-10-31 20:46:21Z VZ $ -// Copyright: (c) 1999 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr> -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_MENUITEM_H_BASE_ -#define _WX_MENUITEM_H_BASE_ - -#include "wx/defs.h" - -#if wxUSE_MENUS - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -#include "wx/object.h" // base class - -// ---------------------------------------------------------------------------- -// forward declarations -// ---------------------------------------------------------------------------- - -class WXDLLIMPEXP_FWD_CORE wxAcceleratorEntry; -class WXDLLIMPEXP_FWD_CORE wxMenuItem; -class WXDLLIMPEXP_FWD_CORE wxMenu; - -// ---------------------------------------------------------------------------- -// wxMenuItem is an item in the menu which may be either a normal item, a sub -// menu or a separator -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxMenuItemBase : public wxObject -{ -public: - // creation - static wxMenuItem *New(wxMenu *parentMenu = (wxMenu *)NULL, - int itemid = wxID_SEPARATOR, - const wxString& text = wxEmptyString, - const wxString& help = wxEmptyString, - wxItemKind kind = wxITEM_NORMAL, - wxMenu *subMenu = (wxMenu *)NULL); - - // destruction: wxMenuItem will delete its submenu - virtual ~wxMenuItemBase(); - - // the menu we're in - wxMenu *GetMenu() const { return m_parentMenu; } - void SetMenu(wxMenu* menu) { m_parentMenu = menu; } - - // get/set id - void SetId(int itemid) { m_id = itemid; } - int GetId() const { return m_id; } - bool IsSeparator() const { return m_id == wxID_SEPARATOR; } - - // the item's text (or name) - // - // NB: the item's text includes the accelerators and mnemonics info (if - // any), i.e. it may contain '&' or '_' or "\t..." and thus is - // different from the item's label which only contains the text shown - // in the menu - virtual void SetText(const wxString& str); - - wxString GetLabel() const { return GetLabelFromText(m_text); } - const wxString& GetText() const { return m_text; } - - // get the label from text (implemented in platform-specific code) - static wxString GetLabelFromText(const wxString& text); - - // what kind of menu item we are - wxItemKind GetKind() const { return m_kind; } - void SetKind(wxItemKind kind) { m_kind = kind; } - - virtual void SetCheckable(bool checkable) { m_kind = checkable ? wxITEM_CHECK : wxITEM_NORMAL; } - bool IsCheckable() const - { return m_kind == wxITEM_CHECK || m_kind == wxITEM_RADIO; } - - bool IsSubMenu() const { return m_subMenu != NULL; } - void SetSubMenu(wxMenu *menu) { m_subMenu = menu; } - wxMenu *GetSubMenu() const { return m_subMenu; } - - // state - virtual void Enable(bool enable = true) { m_isEnabled = enable; } - virtual bool IsEnabled() const { return m_isEnabled; } - - virtual void Check(bool check = true) { m_isChecked = check; } - virtual bool IsChecked() const { return m_isChecked; } - void Toggle() { Check(!m_isChecked); } - - // help string (displayed in the status bar by default) - void SetHelp(const wxString& str); - const wxString& GetHelp() const { return m_help; } - -#if wxUSE_ACCEL - // extract the accelerator from the given menu string, return NULL if none - // found - static wxAcceleratorEntry *GetAccelFromString(const wxString& label); - - // get our accelerator or NULL (caller must delete the pointer) - virtual wxAcceleratorEntry *GetAccel() const; - - // set the accel for this item - this may also be done indirectly with - // SetText() - virtual void SetAccel(wxAcceleratorEntry *accel); -#endif // wxUSE_ACCEL - - // compatibility only, use new functions in the new code - void SetName(const wxString& str) { SetText(str); } - const wxString& GetName() const { return GetText(); } - - static wxMenuItem *New(wxMenu *parentMenu, - int itemid, - const wxString& text, - const wxString& help, - bool isCheckable, - wxMenu *subMenu = (wxMenu *)NULL) - { - return New(parentMenu, itemid, text, help, - isCheckable ? wxITEM_CHECK : wxITEM_NORMAL, subMenu); - } - -protected: - int m_id; // numeric id of the item >= 0 or wxID_ANY or wxID_SEPARATOR - wxMenu *m_parentMenu, // the menu we belong to - *m_subMenu; // our sub menu or NULL - wxString m_text, // label of the item - m_help; // the help string for the item - wxItemKind m_kind; // separator/normal/check/radio item? - bool m_isChecked; // is checked? - bool m_isEnabled; // is enabled? - - // this ctor is for the derived classes only, we're never created directly - wxMenuItemBase(wxMenu *parentMenu = (wxMenu *)NULL, - int itemid = wxID_SEPARATOR, - const wxString& text = wxEmptyString, - const wxString& help = wxEmptyString, - wxItemKind kind = wxITEM_NORMAL, - wxMenu *subMenu = (wxMenu *)NULL); - -private: - // and, if we have one ctor, compiler won't generate a default copy one, so - // declare them ourselves - but don't implement as they shouldn't be used - wxMenuItemBase(const wxMenuItemBase& item); - wxMenuItemBase& operator=(const wxMenuItemBase& item); - -public: - -#if wxABI_VERSION >= 20805 - // Sets the label. This function replaces SetText. - void SetItemLabel(const wxString& str) { SetText(str); } - - // return the item label including any mnemonics and accelerators. - // This used to be called GetText. - // We can't implement this in the base class (no new virtuals in stable branch) - // wxString GetItemLabel() const; - - // return just the text of the item label, without any mnemonics - // This used to be called GetLabel. - wxString GetItemLabelText() const { return GetLabelText(m_text); } - - // return just the text part of the given label. In 2.9 and up, this is implemented in - // platform-specific code, but is now implemented in terms of GetLabelFromText. - static wxString GetLabelText(const wxString& label); -#endif -}; - -// ---------------------------------------------------------------------------- -// include the real class declaration -// ---------------------------------------------------------------------------- - -#ifdef wxUSE_BASE_CLASSES_ONLY - #define wxMenuItem wxMenuItemBase -#else // !wxUSE_BASE_CLASSES_ONLY -#if defined(__WXUNIVERSAL__) - #include "wx/univ/menuitem.h" -#elif defined(__WXPALMOS__) - #include "wx/palmos/menuitem.h" -#elif defined(__WXMSW__) - #include "wx/msw/menuitem.h" -#elif defined(__WXMOTIF__) - #include "wx/motif/menuitem.h" -#elif defined(__WXGTK20__) - #include "wx/gtk/menuitem.h" -#elif defined(__WXGTK__) - #include "wx/gtk1/menuitem.h" -#elif defined(__WXMAC__) - #include "wx/mac/menuitem.h" -#elif defined(__WXCOCOA__) - #include "wx/cocoa/menuitem.h" -#elif defined(__WXPM__) - #include "wx/os2/menuitem.h" -#endif -#endif // wxUSE_BASE_CLASSES_ONLY/!wxUSE_BASE_CLASSES_ONLY - -#endif // wxUSE_MENUS - -#endif - // _WX_MENUITEM_H_BASE_ diff --git a/wxWidgets/include/wx/metafile.h b/wxWidgets/include/wx/metafile.h deleted file mode 100644 index 50b8365241..0000000000 --- a/wxWidgets/include/wx/metafile.h +++ /dev/null @@ -1,62 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: wx/metafile.h -// Purpose: wxMetaFile class declaration -// Author: wxWidgets team -// Modified by: -// Created: 13.01.00 -// RCS-ID: $Id: metafile.h 39841 2006-06-26 14:37:34Z VZ $ -// Copyright: (c) wxWidgets team -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_METAFILE_H_BASE_ -#define _WX_METAFILE_H_BASE_ - -#include "wx/defs.h" - -#if wxUSE_METAFILE - -// provide synonyms for all metafile classes -#define wxMetaFile wxMetafile -#define wxMetaFileDC wxMetafileDC -#define wxMetaFileDataObject wxMetafileDataObject - -#define wxMakeMetaFilePlaceable wxMakeMetafilePlaceable - -#if defined(__WXMSW__) - #if wxUSE_ENH_METAFILE - #if defined(__WXPALMOS__) - #include "wx/palmos/enhmeta.h" - #else - #include "wx/msw/enhmeta.h" - #endif - - #if wxUSE_WIN_METAFILES_ALWAYS - // use normal metafiles as well - #include "wx/msw/metafile.h" - #else // also map all metafile classes to enh metafile - typedef wxEnhMetaFile wxMetafile; - typedef wxEnhMetaFileDC wxMetafileDC; - #if wxUSE_DRAG_AND_DROP - typedef wxEnhMetaFileDataObject wxMetafileDataObject; - #endif - - // this flag will be set if wxMetafile class is wxEnhMetaFile - #define wxMETAFILE_IS_ENH - #endif // wxUSE_WIN_METAFILES_ALWAYS - #else // !wxUSE_ENH_METAFILE - #if defined(__WXPALMOS__) - #include "wx/palmos/metafile.h" - #else - #include "wx/msw/metafile.h" - #endif - #endif -#elif defined(__WXPM__) - #include "wx/os2/metafile.h" -#elif defined(__WXMAC__) - #include "wx/mac/metafile.h" -#endif - -#endif // wxUSE_METAFILE - -#endif // _WX_METAFILE_H_BASE_ diff --git a/wxWidgets/include/wx/mimetype.h b/wxWidgets/include/wx/mimetype.h deleted file mode 100644 index 9a7711fed4..0000000000 --- a/wxWidgets/include/wx/mimetype.h +++ /dev/null @@ -1,453 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/mimetype.h -// Purpose: classes and functions to manage MIME types -// Author: Vadim Zeitlin -// Modified by: -// Chris Elliott (biol75@york.ac.uk) 5 Dec 00: write support for Win32 -// Created: 23.09.98 -// RCS-ID: $Id: mimetype.h 61872 2009-09-09 22:37:05Z VZ $ -// Copyright: (c) 1998 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr> -// Licence: wxWindows licence (part of wxExtra library) -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_MIMETYPE_H_ -#define _WX_MIMETYPE_H_ - -// ---------------------------------------------------------------------------- -// headers and such -// ---------------------------------------------------------------------------- - -#include "wx/defs.h" - -#if wxUSE_MIMETYPE - -// the things we really need -#include "wx/string.h" -#include "wx/dynarray.h" -#include "wx/arrstr.h" - -// fwd decls -class WXDLLIMPEXP_FWD_BASE wxIconLocation; -class WXDLLIMPEXP_FWD_BASE wxFileTypeImpl; -class WXDLLIMPEXP_FWD_BASE wxMimeTypesManagerImpl; - -// these constants define the MIME informations source under UNIX and are used -// by wxMimeTypesManager::Initialize() -enum wxMailcapStyle -{ - wxMAILCAP_STANDARD = 1, - wxMAILCAP_NETSCAPE = 2, - wxMAILCAP_KDE = 4, - wxMAILCAP_GNOME = 8, - - wxMAILCAP_ALL = 15 -}; - -/* - TODO: would it be more convenient to have this class? - -class WXDLLIMPEXP_BASE wxMimeType : public wxString -{ -public: - // all string ctors here - - wxString GetType() const { return BeforeFirst(wxT('/')); } - wxString GetSubType() const { return AfterFirst(wxT('/')); } - - void SetSubType(const wxString& subtype) - { - *this = GetType() + wxT('/') + subtype; - } - - bool Matches(const wxMimeType& wildcard) - { - // implement using wxMimeTypesManager::IsOfType() - } -}; - -*/ - -// wxMimeTypeCommands stores the verbs defined for the given MIME type with -// their values -class WXDLLIMPEXP_BASE wxMimeTypeCommands -{ -public: - wxMimeTypeCommands() {} - - wxMimeTypeCommands(const wxArrayString& verbs, - const wxArrayString& commands) - : m_verbs(verbs), - m_commands(commands) - { - } - - // add a new verb with the command or replace the old value - void AddOrReplaceVerb(const wxString& verb, const wxString& cmd); - void Add(const wxString& s) - { - m_verbs.Add(s.BeforeFirst(wxT('='))); - m_commands.Add(s.AfterFirst(wxT('='))); - } - - // access the commands - size_t GetCount() const { return m_verbs.GetCount(); } - const wxString& GetVerb(size_t n) const { return m_verbs[n]; } - const wxString& GetCmd(size_t n) const { return m_commands[n]; } - - bool HasVerb(const wxString& verb) const - { return m_verbs.Index(verb) != wxNOT_FOUND; } - - // returns empty string and wxNOT_FOUND in idx if no such verb - wxString GetCommandForVerb(const wxString& verb, size_t *idx = NULL) const; - - // get a "verb=command" string - wxString GetVerbCmd(size_t n) const; - -private: - wxArrayString m_verbs; - wxArrayString m_commands; -}; - -// ---------------------------------------------------------------------------- -// wxFileTypeInfo: static container of information accessed via wxFileType. -// -// This class is used with wxMimeTypesManager::AddFallbacks() and Associate() -// ---------------------------------------------------------------------------- - -class WXDLLIMPEXP_BASE wxFileTypeInfo -{ -public: - // ctors - // a normal item - wxFileTypeInfo(const wxChar *mimeType, - const wxChar *openCmd, - const wxChar *printCmd, - const wxChar *desc, - // the other parameters form a NULL terminated list of - // extensions - ...); - - // the array elements correspond to the parameters of the ctor above in - // the same order - wxFileTypeInfo(const wxArrayString& sArray); - - // invalid item - use this to terminate the array passed to - // wxMimeTypesManager::AddFallbacks - wxFileTypeInfo() { } - - // test if this object can be used - bool IsValid() const { return !m_mimeType.empty(); } - - // setters - // set the icon info - void SetIcon(const wxString& iconFile, int iconIndex = 0) - { - m_iconFile = iconFile; - m_iconIndex = iconIndex; - } - // set the short desc - void SetShortDesc(const wxString& shortDesc) { m_shortDesc = shortDesc; } - - // accessors - // get the MIME type - const wxString& GetMimeType() const { return m_mimeType; } - // get the open command - const wxString& GetOpenCommand() const { return m_openCmd; } - // get the print command - const wxString& GetPrintCommand() const { return m_printCmd; } - // get the short description (only used under Win32 so far) - const wxString& GetShortDesc() const { return m_shortDesc; } - // get the long, user visible description - const wxString& GetDescription() const { return m_desc; } - // get the array of all extensions - const wxArrayString& GetExtensions() const { return m_exts; } - size_t GetExtensionsCount() const {return m_exts.GetCount(); } - // get the icon info - const wxString& GetIconFile() const { return m_iconFile; } - int GetIconIndex() const { return m_iconIndex; } - -private: - wxString m_mimeType, // the MIME type in "type/subtype" form - m_openCmd, // command to use for opening the file (%s allowed) - m_printCmd, // command to use for printing the file (%s allowed) - m_shortDesc, // a short string used in the registry - m_desc; // a free form description of this file type - - // icon stuff - wxString m_iconFile; // the file containing the icon - int m_iconIndex; // icon index in this file - - wxArrayString m_exts; // the extensions which are mapped on this filetype - - -#if 0 // TODO - // the additional (except "open" and "print") command names and values - wxArrayString m_commandNames, - m_commandValues; -#endif // 0 -}; - -WX_DECLARE_USER_EXPORTED_OBJARRAY(wxFileTypeInfo, wxArrayFileTypeInfo, - WXDLLIMPEXP_BASE); - -// ---------------------------------------------------------------------------- -// wxFileType: gives access to all information about the files of given type. -// -// This class holds information about a given "file type". File type is the -// same as MIME type under Unix, but under Windows it corresponds more to an -// extension than to MIME type (in fact, several extensions may correspond to a -// file type). This object may be created in many different ways and depending -// on how it was created some fields may be unknown so the return value of all -// the accessors *must* be checked! -// ---------------------------------------------------------------------------- - -class WXDLLIMPEXP_BASE wxFileType -{ -friend class WXDLLIMPEXP_FWD_BASE wxMimeTypesManagerImpl; // it has access to m_impl - -public: - // An object of this class must be passed to Get{Open|Print}Command. The - // default implementation is trivial and doesn't know anything at all about - // parameters, only filename and MIME type are used (so it's probably ok for - // Windows where %{param} is not used anyhow) - class MessageParameters - { - public: - // ctors - MessageParameters() { } - MessageParameters(const wxString& filename, - const wxString& mimetype = wxEmptyString) - : m_filename(filename), m_mimetype(mimetype) { } - - // accessors (called by GetOpenCommand) - // filename - const wxString& GetFileName() const { return m_filename; } - // mime type - const wxString& GetMimeType() const { return m_mimetype; } - - // override this function in derived class - virtual wxString GetParamValue(const wxString& WXUNUSED(name)) const - { return wxEmptyString; } - - // virtual dtor as in any base class - virtual ~MessageParameters() { } - - protected: - wxString m_filename, m_mimetype; - }; - - // ctor from static data - wxFileType(const wxFileTypeInfo& ftInfo); - - // accessors: all of them return true if the corresponding information - // could be retrieved/found, false otherwise (and in this case all [out] - // parameters are unchanged) - // return the MIME type for this file type - bool GetMimeType(wxString *mimeType) const; - bool GetMimeTypes(wxArrayString& mimeTypes) const; - // fill passed in array with all extensions associated with this file - // type - bool GetExtensions(wxArrayString& extensions); - // get the icon corresponding to this file type and of the given size - bool GetIcon(wxIconLocation *iconloc) const; - bool GetIcon(wxIconLocation *iconloc, - const MessageParameters& params) const; - // get a brief file type description ("*.txt" => "text document") - bool GetDescription(wxString *desc) const; - - // get the command to be used to open/print the given file. - // get the command to execute the file of given type - bool GetOpenCommand(wxString *openCmd, - const MessageParameters& params) const; - // a simpler to use version of GetOpenCommand() -- it only takes the - // filename and returns an empty string on failure - wxString GetOpenCommand(const wxString& filename) const; - // get the command to print the file of given type - bool GetPrintCommand(wxString *printCmd, - const MessageParameters& params) const; - - - // return the number of commands defined for this file type, 0 if none - size_t GetAllCommands(wxArrayString *verbs, wxArrayString *commands, - const wxFileType::MessageParameters& params) const; - - // 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& cmd = wxEmptyString, int index = 0); - - - // remove the association for this filetype from the system MIME database: - // notice that it will only work if the association is defined in the user - // file/registry part, we will never modify the system-wide settings - bool Unassociate(); - - // operations - // expand a string in the format of GetOpenCommand (which may contain - // '%s' and '%t' format specificators for the file name and mime type - // and %{param} constructions). - static wxString ExpandCommand(const wxString& command, - const MessageParameters& params); - - // dtor (not virtual, shouldn't be derived from) - ~wxFileType(); - -private: - // default ctor is private because the user code never creates us - wxFileType(); - - // no copy ctor/assignment operator - wxFileType(const wxFileType&); - wxFileType& operator=(const wxFileType&); - - // the static container of wxFileType data: if it's not NULL, it means that - // this object is used as fallback only - const wxFileTypeInfo *m_info; - - // the object which implements the real stuff like reading and writing - // to/from system MIME database - wxFileTypeImpl *m_impl; -}; - -//---------------------------------------------------------------------------- -// wxMimeTypesManagerFactory -//---------------------------------------------------------------------------- - -class WXDLLIMPEXP_BASE wxMimeTypesManagerFactory -{ -public: - wxMimeTypesManagerFactory() {} - virtual ~wxMimeTypesManagerFactory() {} - - virtual wxMimeTypesManagerImpl *CreateMimeTypesManagerImpl(); - - static void Set( wxMimeTypesManagerFactory *factory ); - static wxMimeTypesManagerFactory *Get(); - -private: - static wxMimeTypesManagerFactory *m_factory; -}; - -// ---------------------------------------------------------------------------- -// wxMimeTypesManager: interface to system MIME database. -// -// This class accesses the information about all known MIME types and allows -// the application to retrieve information (including how to handle data of -// given type) about them. -// ---------------------------------------------------------------------------- - -class WXDLLIMPEXP_BASE wxMimeTypesManager -{ -public: - // static helper functions - // ----------------------- - - // check if the given MIME type is the same as the other one: the - // second argument may contain wildcards ('*'), but not the first. If - // the types are equal or if the mimeType matches wildcard the function - // returns true, otherwise it returns false - static bool IsOfType(const wxString& mimeType, const wxString& wildcard); - - // ctor - wxMimeTypesManager(); - - // NB: the following 2 functions are for Unix only and don't do anything - // elsewhere - - // loads data from standard files according to the mailcap styles - // specified: this is a bitwise OR of wxMailcapStyle values - // - // use the extraDir parameter if you want to look for files in another - // directory - void Initialize(int mailcapStyle = wxMAILCAP_ALL, - const wxString& extraDir = wxEmptyString); - - // and this function clears all the data from the manager - void ClearData(); - - // Database lookup: all functions return a pointer to wxFileType object - // whose methods may be used to query it for the information you're - // interested in. If the return value is !NULL, caller is responsible for - // deleting it. - // get file type from file extension - wxFileType *GetFileTypeFromExtension(const wxString& ext); - // get file type from MIME type (in format <category>/<format>) - wxFileType *GetFileTypeFromMimeType(const wxString& mimeType); - - // other operations: return true if there were no errors or false if there - // were some unrecognized entries (the good entries are always read anyhow) - // - // FIXME: These ought to be private ?? - - // read in additional file (the standard ones are read automatically) - // in mailcap format (see mimetype.cpp for description) - // - // 'fallback' parameter may be set to true to avoid overriding the - // settings from other, previously parsed, files by this one: normally, - // the files read most recently would override the older files, but with - // fallback == true this won't happen - - bool ReadMailcap(const wxString& filename, bool fallback = false); - // read in additional file in mime.types format - bool ReadMimeTypes(const wxString& filename); - - // enumerate all known MIME types - // - // returns the number of retrieved file types - size_t EnumAllFileTypes(wxArrayString& mimetypes); - - // these functions can be used to provide default values for some of the - // MIME types inside the program itself (you may also use - // ReadMailcap(filenameWithDefaultTypes, true /* use as fallback */) to - // achieve the same goal, but this requires having this info in a file). - // - // The filetypes array should be terminated by either NULL entry or an - // invalid wxFileTypeInfo (i.e. the one created with default ctor) - void AddFallbacks(const wxFileTypeInfo *filetypes); - void AddFallback(const wxFileTypeInfo& ft) { m_fallbacks.Add(ft); } - - // create or remove associations - - // create a new association using the fields of wxFileTypeInfo (at least - // the MIME type and the extension should be set) - // if the other fields are empty, the existing values should be left alone - wxFileType *Associate(const wxFileTypeInfo& ftInfo); - - // undo Associate() - bool Unassociate(wxFileType *ft) ; - - // dtor (not virtual, shouldn't be derived from) - ~wxMimeTypesManager(); - -private: - // no copy ctor/assignment operator - wxMimeTypesManager(const wxMimeTypesManager&); - wxMimeTypesManager& operator=(const wxMimeTypesManager&); - - // the fallback info which is used if the information is not found in the - // real system database - wxArrayFileTypeInfo m_fallbacks; - - // the object working with the system MIME database - wxMimeTypesManagerImpl *m_impl; - - // if m_impl is NULL, create one - void EnsureImpl(); - - friend class wxMimeTypeCmnModule; -}; - - -// ---------------------------------------------------------------------------- -// global variables -// ---------------------------------------------------------------------------- - -// the default mime manager for wxWidgets programs -extern WXDLLIMPEXP_DATA_BASE(wxMimeTypesManager *) wxTheMimeTypesManager; - -#endif // wxUSE_MIMETYPE - -#endif - //_WX_MIMETYPE_H_ diff --git a/wxWidgets/include/wx/minifram.h b/wxWidgets/include/wx/minifram.h deleted file mode 100644 index b05574a65b..0000000000 --- a/wxWidgets/include/wx/minifram.h +++ /dev/null @@ -1,43 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/minifram.h -// Purpose: wxMiniFrame base header -// Author: Julian Smart -// Modified by: -// Created: -// Copyright: (c) Julian Smart -// RCS-ID: $Id: minifram.h 49299 2007-10-21 18:07:29Z PC $ -// Licence: wxWindows Licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_MINIFRAM_H_BASE_ -#define _WX_MINIFRAM_H_BASE_ - -#include "wx/defs.h" - -#if wxUSE_MINIFRAME - -#if defined(__WXPALMOS__) -#include "wx/palmos/minifram.h" -#elif defined(__WXMSW__) -#include "wx/msw/minifram.h" -#elif defined(__WXMOTIF__) -#include "wx/motif/minifram.h" -#elif defined(__WXGTK20__) -#include "wx/gtk/minifram.h" -#elif defined(__WXGTK__) -#include "wx/gtk1/minifram.h" -#elif defined(__WXX11__) -#include "wx/x11/minifram.h" -#elif defined(__WXMAC__) -#include "wx/mac/minifram.h" -#elif defined(__WXPM__) -#include "wx/os2/minifram.h" -#else -// TODO: it seems that wxMiniFrame could be just defined here generically -// instead of having all the above port-specific headers -#include "wx/frame.h" -typedef wxFrame wxMiniFrame; -#endif - -#endif // wxUSE_MINIFRAME -#endif // _WX_MINIFRAM_H_BASE_ diff --git a/wxWidgets/include/wx/module.h b/wxWidgets/include/wx/module.h deleted file mode 100644 index b461c52749..0000000000 --- a/wxWidgets/include/wx/module.h +++ /dev/null @@ -1,103 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/module.h -// Purpose: Modules handling -// Author: Wolfram Gloger/adapted by Guilhem Lavaux -// Modified by: -// Created: 04/11/98 -// RCS-ID: $Id: module.h 61872 2009-09-09 22:37:05Z VZ $ -// Copyright: (c) Wolfram Gloger and Guilhem Lavaux -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_MODULE_H_ -#define _WX_MODULE_H_ - -#include "wx/object.h" -#include "wx/list.h" -#include "wx/dynarray.h" - -// declare a linked list of modules -class WXDLLIMPEXP_FWD_BASE wxModule; -WX_DECLARE_USER_EXPORTED_LIST(wxModule, wxModuleList, WXDLLIMPEXP_BASE); - -// and an array of class info objects -WX_DEFINE_USER_EXPORTED_ARRAY_PTR(wxClassInfo *, wxArrayClassInfo, - class WXDLLIMPEXP_BASE); - - -// declaring a class derived from wxModule will automatically create an -// instance of this class on program startup, call its OnInit() method and call -// OnExit() on program termination (but only if OnInit() succeeded) -class WXDLLIMPEXP_BASE wxModule : public wxObject -{ -public: - wxModule() {} - virtual ~wxModule() {} - - // if module init routine returns false the application - // will fail to startup - - bool Init() { return OnInit(); } - void Exit() { OnExit(); } - - // Override both of these - - // called on program startup - - virtual bool OnInit() = 0; - - // called just before program termination, but only if OnInit() - // succeeded - - virtual void OnExit() = 0; - - static void RegisterModule(wxModule *module); - static void RegisterModules(); - static bool InitializeModules(); - static void CleanUpModules() { DoCleanUpModules(m_modules); } - - // used by wxObjectLoader when unloading shared libs's - - static void UnregisterModule(wxModule *module); - -protected: - static wxModuleList m_modules; - - // the function to call from constructor of a deriving class add module - // dependency which will be initialized before the module and unloaded - // after that - void AddDependency(wxClassInfo *dep) - { - wxCHECK_RET( dep, wxT("NULL module dependency") ); - - m_dependencies.Add(dep); - } - -private: - // initialize module and Append it to initializedModules list recursively - // calling itself to satisfy module dependencies if needed - static bool - DoInitializeModule(wxModule *module, wxModuleList &initializedModules); - - // cleanup the modules in the specified list (which may not contain all - // modules if we're called during initialization because not all modules - // could be initialized) and also empty m_modules itself - static void DoCleanUpModules(const wxModuleList& modules); - - - // module dependencies: contains - wxArrayClassInfo m_dependencies; - - // used internally while initiliazing/cleaning up modules - enum - { - State_Registered, // module registered but not initialized yet - State_Initializing, // we're initializing this module but not done yet - State_Initialized // module initialized successfully - } m_state; - - - DECLARE_CLASS(wxModule) -}; - -#endif // _WX_MODULE_H_ diff --git a/wxWidgets/include/wx/msgdlg.h b/wxWidgets/include/wx/msgdlg.h deleted file mode 100644 index 53cc69215c..0000000000 --- a/wxWidgets/include/wx/msgdlg.h +++ /dev/null @@ -1,79 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/msgdlgg.h -// Purpose: common header and base class for wxMessageDialog -// Author: Julian Smart -// Modified by: -// Created: -// RCS-ID: $Id: msgdlg.h 61872 2009-09-09 22:37:05Z VZ $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_MSGDLG_H_BASE_ -#define _WX_MSGDLG_H_BASE_ - -#include "wx/defs.h" - -#if wxUSE_MSGDLG - -class WXDLLEXPORT wxMessageDialogBase -{ -protected: - // common validation of wxMessageDialog style - void SetMessageDialogStyle(long style) - { - wxASSERT_MSG( ((style & wxYES_NO) == wxYES_NO) || ((style & wxYES_NO) == 0), - wxT("wxYES and wxNO may only be used together in wxMessageDialog") ); - - wxASSERT_MSG( (style & wxID_OK) != wxID_OK, - wxT("wxMessageBox: Did you mean wxOK (and not wxID_OK)?") ); - - m_dialogStyle = style; - } - inline long GetMessageDialogStyle() const - { - return m_dialogStyle; - } - -private: - long m_dialogStyle; -}; - -#if defined(__WX_COMPILING_MSGDLGG_CPP__) -#include "wx/generic/msgdlgg.h" -#elif defined(__WXUNIVERSAL__) || defined(__WXGPE__) -#include "wx/generic/msgdlgg.h" -#elif defined(__WXPALMOS__) -#include "wx/palmos/msgdlg.h" -#elif defined(__WXMSW__) -#include "wx/msw/msgdlg.h" -#elif defined(__WXMOTIF__) -#include "wx/motif/msgdlg.h" -#elif defined(__WXGTK20__) -#include "wx/gtk/msgdlg.h" -#elif defined(__WXGTK__) -#include "wx/generic/msgdlgg.h" -#elif defined(__WXGTK__) -#include "wx/generic/msgdlgg.h" -#elif defined(__WXMAC__) -#include "wx/mac/msgdlg.h" -#elif defined(__WXCOCOA__) -#include "wx/cocoa/msgdlg.h" -#elif defined(__WXPM__) -#include "wx/os2/msgdlg.h" -#endif - -// ---------------------------------------------------------------------------- -// wxMessageBox: the simplest way to use wxMessageDialog -// ---------------------------------------------------------------------------- - -int WXDLLEXPORT wxMessageBox(const wxString& message, - const wxString& caption = wxMessageBoxCaptionStr, - long style = wxOK | wxCENTRE, - wxWindow *parent = NULL, - int x = wxDefaultCoord, int y = wxDefaultCoord); - -#endif // wxUSE_MSGDLG - -#endif - // _WX_MSGDLG_H_BASE_ diff --git a/wxWidgets/include/wx/msgout.h b/wxWidgets/include/wx/msgout.h deleted file mode 100644 index 6130849c10..0000000000 --- a/wxWidgets/include/wx/msgout.h +++ /dev/null @@ -1,113 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: wx/msgout.h -// Purpose: wxMessageOutput class. Shows a message to the user -// Author: Mattia Barbon -// Modified by: -// Created: 17.07.02 -// RCS-ID: $Id: msgout.h 35690 2005-09-25 20:23:30Z VZ $ -// Copyright: (c) Mattia Barbon -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_MSGOUT_H_ -#define _WX_MSGOUT_H_ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -#include "wx/defs.h" -#include "wx/wxchar.h" - -// ---------------------------------------------------------------------------- -// wxMessageOutput is a class abstracting formatted output target, i.e. -// something you can printf() to -// ---------------------------------------------------------------------------- - -class WXDLLIMPEXP_BASE wxMessageOutput -{ -public: - virtual ~wxMessageOutput() { } - - // show a message to the user - virtual void Printf(const wxChar* format, ...) ATTRIBUTE_PRINTF_2 = 0; - - // gets the current wxMessageOutput object (may be NULL during - // initialization or shutdown) - static wxMessageOutput* Get(); - - // sets the global wxMessageOutput instance; returns the previous one - static wxMessageOutput* Set(wxMessageOutput* msgout); - -private: - static wxMessageOutput* ms_msgOut; -}; - -// ---------------------------------------------------------------------------- -// implementation showing the message to the user in "best" possible way: uses -// native message box if available (currently only under Windows) and stderr -// otherwise; unlike wxMessageOutputMessageBox this class is always safe to use -// ---------------------------------------------------------------------------- - -class WXDLLIMPEXP_BASE wxMessageOutputBest : public wxMessageOutput -{ -public: - wxMessageOutputBest() { } - - virtual void Printf(const wxChar* format, ...) ATTRIBUTE_PRINTF_2; -}; - -// ---------------------------------------------------------------------------- -// implementation which sends output to stderr -// ---------------------------------------------------------------------------- - -class WXDLLIMPEXP_BASE wxMessageOutputStderr : public wxMessageOutput -{ -public: - wxMessageOutputStderr() { } - - virtual void Printf(const wxChar* format, ...) ATTRIBUTE_PRINTF_2; -}; - -// ---------------------------------------------------------------------------- -// implementation which shows output in a message box -// ---------------------------------------------------------------------------- - -#if wxUSE_GUI - -class WXDLLIMPEXP_CORE wxMessageOutputMessageBox : public wxMessageOutput -{ -public: - wxMessageOutputMessageBox() { } - - virtual void Printf(const wxChar* format, ...) ATTRIBUTE_PRINTF_2; -}; - -#endif // wxUSE_GUI - -// ---------------------------------------------------------------------------- -// implementation using the native way of outputting debug messages -// ---------------------------------------------------------------------------- - -class WXDLLIMPEXP_BASE wxMessageOutputDebug : public wxMessageOutput -{ -public: - wxMessageOutputDebug() { } - - virtual void Printf(const wxChar* format, ...) ATTRIBUTE_PRINTF_2; -}; - -// ---------------------------------------------------------------------------- -// implementation using wxLog (mainly for backwards compatibility) -// ---------------------------------------------------------------------------- - -class WXDLLIMPEXP_BASE wxMessageOutputLog : public wxMessageOutput -{ -public: - wxMessageOutputLog() { } - - virtual void Printf(const wxChar* format, ...) ATTRIBUTE_PRINTF_2; -}; - -#endif - // _WX_MSGOUT_H_ diff --git a/wxWidgets/include/wx/mstream.h b/wxWidgets/include/wx/mstream.h deleted file mode 100644 index 19329a963c..0000000000 --- a/wxWidgets/include/wx/mstream.h +++ /dev/null @@ -1,92 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/mstream.h -// Purpose: Memory stream classes -// Author: Guilhem Lavaux -// Modified by: -// Created: 11/07/98 -// RCS-ID: $Id: mstream.h 53135 2008-04-12 02:31:04Z VZ $ -// Copyright: (c) Guilhem Lavaux -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_WXMMSTREAM_H__ -#define _WX_WXMMSTREAM_H__ - -#include "wx/defs.h" - -#if wxUSE_STREAMS - -#include "wx/stream.h" - -class WXDLLIMPEXP_FWD_BASE wxMemoryOutputStream; - -class WXDLLIMPEXP_BASE wxMemoryInputStream : public wxInputStream -{ -public: - wxMemoryInputStream(const void *data, size_t length); - wxMemoryInputStream(const wxMemoryOutputStream& stream); - virtual ~wxMemoryInputStream(); - virtual wxFileOffset GetLength() const { return m_length; } - virtual bool IsSeekable() const { return true; } - - char Peek(); - - wxStreamBuffer *GetInputStreamBuffer() const { return m_i_streambuf; } - -#if WXWIN_COMPATIBILITY_2_6 - // deprecated, compatibility only - wxDEPRECATED( wxStreamBuffer *InputStreamBuffer() const ); -#endif // WXWIN_COMPATIBILITY_2_6 - -protected: - wxStreamBuffer *m_i_streambuf; - - size_t OnSysRead(void *buffer, size_t nbytes); - wxFileOffset OnSysSeek(wxFileOffset pos, wxSeekMode mode); - wxFileOffset OnSysTell() const; - -private: - size_t m_length; - - DECLARE_NO_COPY_CLASS(wxMemoryInputStream) -}; - -class WXDLLIMPEXP_BASE wxMemoryOutputStream : public wxOutputStream -{ -public: - // if data is !NULL it must be allocated with malloc() - wxMemoryOutputStream(void *data = NULL, size_t length = 0); - virtual ~wxMemoryOutputStream(); - virtual wxFileOffset GetLength() const { return m_o_streambuf->GetLastAccess(); } - virtual bool IsSeekable() const { return true; } - - size_t CopyTo(void *buffer, size_t len) const; - - wxStreamBuffer *GetOutputStreamBuffer() const { return m_o_streambuf; } - -#if WXWIN_COMPATIBILITY_2_6 - // deprecated, compatibility only - wxDEPRECATED( wxStreamBuffer *OutputStreamBuffer() const ); -#endif // WXWIN_COMPATIBILITY_2_6 - -protected: - wxStreamBuffer *m_o_streambuf; - -protected: - size_t OnSysWrite(const void *buffer, size_t nbytes); - wxFileOffset OnSysSeek(wxFileOffset pos, wxSeekMode mode); - wxFileOffset OnSysTell() const; - - DECLARE_NO_COPY_CLASS(wxMemoryOutputStream) -}; - -#if WXWIN_COMPATIBILITY_2_6 - inline wxStreamBuffer *wxMemoryInputStream::InputStreamBuffer() const { return m_i_streambuf; } - inline wxStreamBuffer *wxMemoryOutputStream::OutputStreamBuffer() const { return m_o_streambuf; } -#endif // WXWIN_COMPATIBILITY_2_6 - -#endif - // wxUSE_STREAMS - -#endif - // _WX_WXMMSTREAM_H__ diff --git a/wxWidgets/include/wx/msw/accel.h b/wxWidgets/include/wx/msw/accel.h deleted file mode 100644 index 284a6f136f..0000000000 --- a/wxWidgets/include/wx/msw/accel.h +++ /dev/null @@ -1,46 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/msw/accel.h -// Purpose: wxAcceleratorTable class -// Author: Julian Smart -// Modified by: -// Created: 31/7/98 -// RCS-ID: $Id: accel.h 53135 2008-04-12 02:31:04Z VZ $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_ACCEL_H_ -#define _WX_ACCEL_H_ - -class WXDLLIMPEXP_FWD_CORE wxWindow; - -// ---------------------------------------------------------------------------- -// the accel table has all accelerators for a given window or menu -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxAcceleratorTable : public wxObject -{ -public: - // default ctor - wxAcceleratorTable() { } - - // load from .rc resource (Windows specific) - wxAcceleratorTable(const wxString& resource); - - // initialize from array - wxAcceleratorTable(int n, const wxAcceleratorEntry entries[]); - - bool Ok() const { return IsOk(); } - bool IsOk() const; - void SetHACCEL(WXHACCEL hAccel); - WXHACCEL GetHACCEL() const; - - // translate the accelerator, return true if done - bool Translate(wxWindow *window, WXMSG *msg) const; - -private: - DECLARE_DYNAMIC_CLASS(wxAcceleratorTable) -}; - -#endif - // _WX_ACCEL_H_ diff --git a/wxWidgets/include/wx/msw/amd64.manifest b/wxWidgets/include/wx/msw/amd64.manifest deleted file mode 100644 index 60db9e3150..0000000000 --- a/wxWidgets/include/wx/msw/amd64.manifest +++ /dev/null @@ -1,22 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="yes"?> -<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"> -<assemblyIdentity - version="0.64.1.0" - processorArchitecture="amd64" - name="Controls" - type="win32" -/> -<description>wxWindows application</description> -<dependency> - <dependentAssembly> - <assemblyIdentity - type="win32" - name="Microsoft.Windows.Common-Controls" - version="6.0.0.0" - processorArchitecture="amd64" - publicKeyToken="6595b64144ccf1df" - language="*" - /> - </dependentAssembly> -</dependency> -</assembly> diff --git a/wxWidgets/include/wx/msw/app.h b/wxWidgets/include/wx/msw/app.h deleted file mode 100644 index 196600e58a..0000000000 --- a/wxWidgets/include/wx/msw/app.h +++ /dev/null @@ -1,147 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: app.h -// Purpose: wxApp class -// Author: Julian Smart -// Modified by: -// Created: 01/02/97 -// RCS-ID: $Id: app.h 53157 2008-04-13 12:17:37Z VS $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_APP_H_ -#define _WX_APP_H_ - -#include "wx/event.h" -#include "wx/icon.h" - -class WXDLLIMPEXP_FWD_CORE wxFrame; -class WXDLLIMPEXP_FWD_CORE wxWindow; -class WXDLLIMPEXP_FWD_CORE wxApp; -class WXDLLIMPEXP_FWD_CORE wxKeyEvent; -class WXDLLIMPEXP_FWD_BASE wxLog; - -// Represents the application. Derive OnInit and declare -// a new App object to start application -class WXDLLEXPORT wxApp : public wxAppBase -{ - DECLARE_DYNAMIC_CLASS(wxApp) - -public: - wxApp(); - virtual ~wxApp(); - - // override base class (pure) virtuals - virtual bool Initialize(int& argc, wxChar **argv); - virtual void CleanUp(); - - virtual bool Yield(bool onlyIfNeeded = false); - virtual void WakeUpIdle(); - - virtual void SetPrintMode(int mode) { m_printMode = mode; } - virtual int GetPrintMode() const { return m_printMode; } - - // implementation only - void OnIdle(wxIdleEvent& event); - void OnEndSession(wxCloseEvent& event); - void OnQueryEndSession(wxCloseEvent& event); - -#if wxUSE_EXCEPTIONS - virtual bool OnExceptionInMainLoop(); -#endif // wxUSE_EXCEPTIONS - - // deprecated functions, use wxEventLoop directly instead -#if WXWIN_COMPATIBILITY_2_4 - wxDEPRECATED( void DoMessage(WXMSG *pMsg) ); - wxDEPRECATED( bool DoMessage() ); - wxDEPRECATED( bool ProcessMessage(WXMSG* pMsg) ); -#endif // WXWIN_COMPATIBILITY_2_4 - -protected: - int m_printMode; // wxPRINT_WINDOWS, wxPRINT_POSTSCRIPT - -public: - // Implementation - static bool RegisterWindowClasses(); - static bool UnregisterWindowClasses(); - -#if wxUSE_RICHEDIT - // initialize the richedit DLL of (at least) given version, return true if - // ok (Win95 has version 1, Win98/NT4 has 1 and 2, W2K has 3) - static bool InitRichEdit(int version = 2); -#endif // wxUSE_RICHEDIT - - // returns 400, 470, 471 for comctl32.dll 4.00, 4.70, 4.71 or 0 if it - // wasn't found at all - static int GetComCtl32Version(); - - // the SW_XXX value to be used for the frames opened by the application - // (currently seems unused which is a bug -- TODO) - static int m_nCmdShow; - -protected: - DECLARE_EVENT_TABLE() - DECLARE_NO_COPY_CLASS(wxApp) -}; - -// ---------------------------------------------------------------------------- -// MSW-specific wxEntry() overload and IMPLEMENT_WXWIN_MAIN definition -// ---------------------------------------------------------------------------- - -// we need HINSTANCE declaration to define WinMain() -#include "wx/msw/wrapwin.h" - -#ifndef SW_SHOWNORMAL - #define SW_SHOWNORMAL 1 -#endif - -// WinMain() is always ANSI, even in Unicode build, under normal Windows -// but is always Unicode under CE -#ifdef __WXWINCE__ - typedef wchar_t *wxCmdLineArgType; -#else - typedef char *wxCmdLineArgType; -#endif - -extern int WXDLLEXPORT -wxEntry(HINSTANCE hInstance, - HINSTANCE hPrevInstance = NULL, - wxCmdLineArgType pCmdLine = NULL, - int nCmdShow = SW_SHOWNORMAL); - -#if defined(__BORLANDC__) && wxUSE_UNICODE - // Borland C++ has the following nonstandard behaviour: when the -WU - // command line flag is used, the linker expects to find wWinMain instead - // of WinMain. This flag causes the compiler to define _UNICODE and - // UNICODE symbols and there's no way to detect its use, so we have to - // define both WinMain and wWinMain so that IMPLEMENT_WXWIN_MAIN works - // for both code compiled with and without -WU. - // See http://sourceforge.net/tracker/?func=detail&atid=309863&aid=1935997&group_id=9863 - // for more details. - #define IMPLEMENT_WXWIN_MAIN_BORLAND_NONSTANDARD \ - extern "C" int WINAPI wWinMain(HINSTANCE hInstance, \ - HINSTANCE hPrevInstance, \ - wchar_t * WXUNUSED(lpCmdLine), \ - int nCmdShow) \ - { \ - /* NB: wxEntry expects lpCmdLine argument to be char*, not */ \ - /* wchar_t*, but fortunately it's not used anywhere */ \ - /* and we can simply pass NULL in: */ \ - return wxEntry(hInstance, hPrevInstance, NULL, nCmdShow); \ - } -#else - #define IMPLEMENT_WXWIN_MAIN_BORLAND_NONSTANDARD -#endif // defined(__BORLANDC__) && wxUSE_UNICODE - -#define IMPLEMENT_WXWIN_MAIN \ - extern "C" int WINAPI WinMain(HINSTANCE hInstance, \ - HINSTANCE hPrevInstance, \ - wxCmdLineArgType lpCmdLine, \ - int nCmdShow) \ - { \ - return wxEntry(hInstance, hPrevInstance, lpCmdLine, nCmdShow); \ - } \ - IMPLEMENT_WXWIN_MAIN_BORLAND_NONSTANDARD - -#endif // _WX_APP_H_ - diff --git a/wxWidgets/include/wx/msw/apptbase.h b/wxWidgets/include/wx/msw/apptbase.h deleted file mode 100644 index 855f759e10..0000000000 --- a/wxWidgets/include/wx/msw/apptbase.h +++ /dev/null @@ -1,46 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: wx/msw/apptbase.h -// Purpose: declaration of wxAppTraits for MSW -// Author: Vadim Zeitlin -// Modified by: -// Created: 22.06.2003 -// RCS-ID: $Id: apptbase.h 40599 2006-08-13 21:00:32Z VZ $ -// Copyright: (c) 2003 Vadim Zeitlin <vadim@wxwidgets.org> -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_MSW_APPTBASE_H_ -#define _WX_MSW_APPTBASE_H_ - -// ---------------------------------------------------------------------------- -// wxAppTraits: the MSW version adds extra hooks needed by MSW-only code -// ---------------------------------------------------------------------------- - -class WXDLLIMPEXP_BASE wxAppTraits : public wxAppTraitsBase -{ -public: - // wxExecute() support methods - // --------------------------- - - // called before starting to wait for the child termination, may return - // some opaque data which will be passed later to AfterChildWaitLoop() - virtual void *BeforeChildWaitLoop() = 0; - - // process pending Windows messages, even in console app - virtual void AlwaysYield() = 0; - - // called after starting to wait for the child termination, the parameter - // is the return value of BeforeChildWaitLoop() - virtual void AfterChildWaitLoop(void *data) = 0; - - - // wxThread helpers - // ---------------- - - // process a message while waiting for a(nother) thread, should return - // false if and only if we have to exit the application - virtual bool DoMessageFromThreadWait() = 0; -}; - -#endif // _WX_MSW_APPTBASE_H_ - diff --git a/wxWidgets/include/wx/msw/apptrait.h b/wxWidgets/include/wx/msw/apptrait.h deleted file mode 100644 index 1e5971144b..0000000000 --- a/wxWidgets/include/wx/msw/apptrait.h +++ /dev/null @@ -1,45 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: wx/msw/apptrait.h -// Purpose: class implementing wxAppTraits for MSW -// Author: Vadim Zeitlin -// Modified by: -// Created: 21.06.2003 -// RCS-ID: $Id: apptrait.h 40599 2006-08-13 21:00:32Z VZ $ -// Copyright: (c) 2003 Vadim Zeitlin <vadim@wxwidgets.org> -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_MSW_APPTRAIT_H_ -#define _WX_MSW_APPTRAIT_H_ - -// ---------------------------------------------------------------------------- -// wxGUI/ConsoleAppTraits: must derive from wxAppTraits, not wxAppTraitsBase -// ---------------------------------------------------------------------------- - -class WXDLLIMPEXP_BASE wxConsoleAppTraits : public wxConsoleAppTraitsBase -{ -public: - virtual void *BeforeChildWaitLoop(); - virtual void AlwaysYield(); - virtual void AfterChildWaitLoop(void *data); - - virtual bool DoMessageFromThreadWait(); -}; - -#if wxUSE_GUI - -class WXDLLIMPEXP_CORE wxGUIAppTraits : public wxGUIAppTraitsBase -{ -public: - virtual void *BeforeChildWaitLoop(); - virtual void AlwaysYield(); - virtual void AfterChildWaitLoop(void *data); - - virtual bool DoMessageFromThreadWait(); - virtual wxPortId GetToolkitVersion(int *majVer, int *minVer) const; -}; - -#endif // wxUSE_GUI - -#endif // _WX_MSW_APPTRAIT_H_ - diff --git a/wxWidgets/include/wx/msw/bitmap.h b/wxWidgets/include/wx/msw/bitmap.h deleted file mode 100644 index 819878129f..0000000000 --- a/wxWidgets/include/wx/msw/bitmap.h +++ /dev/null @@ -1,282 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/msw/bitmap.h -// Purpose: wxBitmap class -// Author: Julian Smart -// Modified by: -// Created: 01/02/97 -// RCS-ID: $Id: bitmap.h 49563 2007-10-31 20:46:21Z VZ $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_BITMAP_H_ -#define _WX_BITMAP_H_ - -#include "wx/msw/gdiimage.h" -#include "wx/palette.h" - -class WXDLLIMPEXP_FWD_CORE wxBitmap; -class WXDLLIMPEXP_FWD_CORE wxBitmapHandler; -class WXDLLIMPEXP_FWD_CORE wxBitmapRefData; -class WXDLLIMPEXP_FWD_CORE wxControl; -class WXDLLIMPEXP_FWD_CORE wxCursor; -class WXDLLIMPEXP_FWD_CORE wxDC; -#if wxUSE_WXDIB -class WXDLLIMPEXP_FWD_CORE wxDIB; -#endif -class WXDLLIMPEXP_FWD_CORE wxIcon; -class WXDLLIMPEXP_FWD_CORE wxImage; -class WXDLLIMPEXP_FWD_CORE wxMask; -class WXDLLIMPEXP_FWD_CORE wxPalette; -class WXDLLIMPEXP_FWD_CORE wxPixelDataBase; - -// ---------------------------------------------------------------------------- -// wxBitmap: a mono or colour bitmap -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxBitmap : public wxGDIImage -{ -public: - // default ctor creates an invalid bitmap, you must Create() it later - wxBitmap() { } - - // Initialize with raw data - wxBitmap(const char bits[], int width, int height, int depth = 1); - - // Initialize with XPM data - wxBitmap(const char* const* data); -#ifdef wxNEEDS_CHARPP - wxBitmap(char** data) - { - *this = wxBitmap(wx_const_cast(const char* const*, data)); - } -#endif - - // Load a file or resource - wxBitmap(const wxString& name, wxBitmapType type = wxBITMAP_TYPE_BMP_RESOURCE); - - // New constructor for generalised creation from data - wxBitmap(const void* data, long type, int width, int height, int depth = 1); - - // Create a new, uninitialized bitmap of the given size and depth (if it - // is omitted, will create a bitmap compatible with the display) - // - // NB: this ctor will create a DIB for 24 and 32bpp bitmaps, use ctor - // taking a DC argument if you want to force using DDB in this case - wxBitmap(int width, int height, int depth = -1); - - // Create a bitmap compatible with the given DC - wxBitmap(int width, int height, const wxDC& dc); - -#if wxUSE_IMAGE - // Convert from wxImage - wxBitmap(const wxImage& image, int depth = -1) - { (void)CreateFromImage(image, depth); } - - // Create a DDB compatible with the given DC from wxImage - wxBitmap(const wxImage& image, const wxDC& dc) - { (void)CreateFromImage(image, dc); } -#endif // wxUSE_IMAGE - - // we must have this, otherwise icons are silently copied into bitmaps using - // the copy ctor but the resulting bitmap is invalid! - wxBitmap(const wxIcon& icon) { CopyFromIcon(icon); } - - wxBitmap& operator=(const wxIcon& icon) - { - (void)CopyFromIcon(icon); - - return *this; - } - - wxBitmap& operator=(const wxCursor& cursor) - { - (void)CopyFromCursor(cursor); - - return *this; - } - - virtual ~wxBitmap(); - -#if wxUSE_IMAGE - wxImage ConvertToImage() const; -#endif // wxUSE_IMAGE - - // get the given part of bitmap - wxBitmap GetSubBitmap( const wxRect& rect ) const; - - // NB: This should not be called from user code. It is for wx internal - // use only. - wxBitmap GetSubBitmapOfHDC( const wxRect& rect, WXHDC hdc ) const; - - // copies the contents and mask of the given (colour) icon to the bitmap - bool CopyFromIcon(const wxIcon& icon); - - // copies the contents and mask of the given cursor to the bitmap - bool CopyFromCursor(const wxCursor& cursor); - -#if wxUSE_WXDIB - // copies from a device independent bitmap - bool CopyFromDIB(const wxDIB& dib); -#endif - - virtual bool Create(int width, int height, int depth = -1); - virtual bool Create(int width, int height, const wxDC& dc); - virtual bool Create(const void* data, long type, int width, int height, int depth = 1); - virtual bool LoadFile(const wxString& name, long type = wxBITMAP_TYPE_BMP_RESOURCE); - virtual bool SaveFile(const wxString& name, int type, const wxPalette *cmap = NULL); - - wxBitmapRefData *GetBitmapData() const - { return (wxBitmapRefData *)m_refData; } - - // raw bitmap access support functions - void *GetRawData(wxPixelDataBase& data, int bpp); - void UngetRawData(wxPixelDataBase& data); - -#if wxUSE_PALETTE - wxPalette* GetPalette() const; - void SetPalette(const wxPalette& palette); -#endif // wxUSE_PALETTE - - wxMask *GetMask() const; - wxBitmap GetMaskBitmap() const; - void SetMask(wxMask *mask); - - // these functions are internal and shouldn't be used, they risk to - // disappear in the future - bool HasAlpha() const; - void UseAlpha(); - -#if WXWIN_COMPATIBILITY_2_4 - // these functions do nothing and are only there for backwards - // compatibility - wxDEPRECATED( int GetQuality() const ); - wxDEPRECATED( void SetQuality(int quality) ); -#endif // WXWIN_COMPATIBILITY_2_4 - - // implementation only from now on - // ------------------------------- - -public: - void SetHBITMAP(WXHBITMAP bmp) { SetHandle((WXHANDLE)bmp); } - WXHBITMAP GetHBITMAP() const { return (WXHBITMAP)GetHandle(); } - -#ifdef __WXDEBUG__ - void SetSelectedInto(wxDC *dc); - wxDC *GetSelectedInto() const; -#endif // __WXDEBUG__ - -protected: - virtual wxGDIImageRefData *CreateData() const; - virtual wxObjectRefData *CloneRefData(const wxObjectRefData *data) const; - - // creates an uninitialized bitmap, called from Create()s above - bool DoCreate(int w, int h, int depth, WXHDC hdc); - -#if wxUSE_IMAGE - // creates the bitmap from wxImage, supposed to be called from ctor - bool CreateFromImage(const wxImage& image, int depth); - - // creates a DDB from wxImage, supposed to be called from ctor - bool CreateFromImage(const wxImage& image, const wxDC& dc); - - // common part of the 2 methods above (hdc may be 0) - bool CreateFromImage(const wxImage& image, int depth, WXHDC hdc); -#endif // wxUSE_IMAGE - -private: - // common part of CopyFromIcon/CopyFromCursor for Win32 - bool CopyFromIconOrCursor(const wxGDIImage& icon); - - - DECLARE_DYNAMIC_CLASS(wxBitmap) -}; - -// ---------------------------------------------------------------------------- -// wxMask: a mono bitmap used for drawing bitmaps transparently. -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxMask : public wxObject -{ -public: - wxMask(); - - // Copy constructor - wxMask(const wxMask &mask); - - // 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); - - // construct a mask from the givne bitmap handle - wxMask(WXHBITMAP hbmp) { m_maskBitmap = hbmp; } - - virtual ~wxMask(); - - bool Create(const wxBitmap& bitmap, const wxColour& colour); - bool Create(const wxBitmap& bitmap, int paletteIndex); - bool Create(const wxBitmap& bitmap); - - // Implementation - WXHBITMAP GetMaskBitmap() const { return m_maskBitmap; } - void SetMaskBitmap(WXHBITMAP bmp) { m_maskBitmap = bmp; } - -protected: - WXHBITMAP m_maskBitmap; - - DECLARE_DYNAMIC_CLASS(wxMask) -}; - -// ---------------------------------------------------------------------------- -// wxBitmapHandler is a class which knows how to load/save bitmaps to/from file -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxBitmapHandler : public wxGDIImageHandler -{ -public: - wxBitmapHandler() { } - wxBitmapHandler(const wxString& name, const wxString& ext, long type) - : wxGDIImageHandler(name, ext, type) - { - } - - // keep wxBitmapHandler derived from wxGDIImageHandler compatible with the - // old class which worked only with bitmaps - virtual bool Create(wxBitmap *bitmap, - const 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(wxBitmap *bitmap, - const wxString& name, - int type, - const wxPalette *palette = NULL); - - virtual bool Create(wxGDIImage *image, - const void* data, - long flags, - int width, int height, int depth = 1); - virtual bool Load(wxGDIImage *image, - const wxString& name, - long flags, - int desiredWidth, int desiredHeight); - virtual bool Save(wxGDIImage *image, - const wxString& name, - int type); - -private: - DECLARE_DYNAMIC_CLASS(wxBitmapHandler) -}; - -#endif - // _WX_BITMAP_H_ diff --git a/wxWidgets/include/wx/msw/blank.cur b/wxWidgets/include/wx/msw/blank.cur deleted file mode 100644 index 048f06b4aefde54e0ff825ccb5a5db4d7001d513..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 326 zcmZQzU}9ioP*7k10|Q0|1~DK@1BexX*a3(cfe;L!6oi8y|NsAw;0zE8=!O9W0CiJ? AlK=n! diff --git a/wxWidgets/include/wx/msw/bmpbuttn.h b/wxWidgets/include/wx/msw/bmpbuttn.h deleted file mode 100644 index e45e1c0c80..0000000000 --- a/wxWidgets/include/wx/msw/bmpbuttn.h +++ /dev/null @@ -1,73 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/msw/bmpbuttn.h -// Purpose: wxBitmapButton class -// Author: Julian Smart -// Modified by: -// Created: 01/02/97 -// RCS-ID: $Id: bmpbuttn.h 36078 2005-11-03 19:38:20Z VZ $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_BMPBUTTN_H_ -#define _WX_BMPBUTTN_H_ - -#include "wx/button.h" -#include "wx/bitmap.h" -#include "wx/brush.h" - -class WXDLLEXPORT wxBitmapButton : public wxBitmapButtonBase -{ -public: - wxBitmapButton() { } - - 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); - - // Implementation - virtual bool SetBackgroundColour(const wxColour& colour); - virtual void SetDefault(); - 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: - // reimplement some base class virtuals - virtual wxSize DoGetBestSize() const; - virtual void OnSetBitmap(); - - // invalidate m_brushDisabled when system colours change - void OnSysColourChanged(wxSysColourChangedEvent& event); - - // change the currently bitmap if we have a hover one - void OnMouseEnterOrLeave(wxMouseEvent& event); - - - // the brush we use to draw disabled buttons - wxBrush m_brushDisabled; - - - DECLARE_EVENT_TABLE() - DECLARE_DYNAMIC_CLASS_NO_COPY(wxBitmapButton) -}; - -#endif // _WX_BMPBUTTN_H_ diff --git a/wxWidgets/include/wx/msw/brush.h b/wxWidgets/include/wx/msw/brush.h deleted file mode 100644 index b2224f7c54..0000000000 --- a/wxWidgets/include/wx/msw/brush.h +++ /dev/null @@ -1,60 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/msw/brush.h -// Purpose: wxBrush class -// Author: Julian Smart -// Modified by: -// Created: 01/02/97 -// RCS-ID: $Id: brush.h 53135 2008-04-12 02:31:04Z VZ $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_BRUSH_H_ -#define _WX_BRUSH_H_ - -#include "wx/gdicmn.h" -#include "wx/gdiobj.h" -#include "wx/bitmap.h" - -class WXDLLIMPEXP_FWD_CORE wxBrush; - -// ---------------------------------------------------------------------------- -// wxBrush -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxBrush : public wxBrushBase -{ -public: - wxBrush(); - wxBrush(const wxColour& col, int style = wxSOLID); - wxBrush(const wxBitmap& stipple); - virtual ~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); - - bool operator==(const wxBrush& brush) const; - bool operator!=(const wxBrush& brush) const { return !(*this == brush); } - - wxColour GetColour() const; - virtual int GetStyle() const; - wxBitmap *GetStipple() const; - - bool Ok() const { return IsOk(); } - bool IsOk() const { return m_refData != NULL; } - - // return the HBRUSH for this brush - virtual WXHANDLE GetResourceHandle() const; - -protected: - virtual wxObjectRefData *CreateRefData() const; - virtual wxObjectRefData *CloneRefData(const wxObjectRefData *data) const; - -private: - DECLARE_DYNAMIC_CLASS(wxBrush) -}; - -#endif - // _WX_BRUSH_H_ diff --git a/wxWidgets/include/wx/msw/bullseye.cur b/wxWidgets/include/wx/msw/bullseye.cur deleted file mode 100644 index 42a1b9cd76e891045bd82f16adba7688e0e249ee..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 326 zcmZQzU}9ioP*7lC;0HnjMg|5k1_lNVAO;FCH~=vt5P|`ef^ZPz|Ns9HoB?71-GB*x z*#G~3fc^jf_QU`G$$$9&ufpd4pXcZ5f876O|8xIuF#cTkcmC&^+WDU=Y#}s|50e9_ T1E~k;1L+5u12zw2E*by;%s^|x diff --git a/wxWidgets/include/wx/msw/button.h b/wxWidgets/include/wx/msw/button.h deleted file mode 100644 index 3f7c7d2c42..0000000000 --- a/wxWidgets/include/wx/msw/button.h +++ /dev/null @@ -1,82 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/msw/button.h -// Purpose: wxButton class -// Author: Julian Smart -// Modified by: -// Created: 01/02/97 -// RCS-ID: $Id: button.h 37393 2006-02-08 21:47:09Z VZ $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_BUTTON_H_ -#define _WX_BUTTON_H_ - -// ---------------------------------------------------------------------------- -// Pushbutton -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxButton : public wxButtonBase -{ -public: - wxButton() { } - wxButton(wxWindow *parent, - wxWindowID id, - const wxString& label = wxEmptyString, - 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 = wxEmptyString, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = 0, - const wxValidator& validator = wxDefaultValidator, - const wxString& name = wxButtonNameStr); - - virtual ~wxButton(); - - virtual void SetDefault(); - - // implementation from now on - virtual void Command(wxCommandEvent& event); - virtual WXLRESULT MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam); - virtual bool MSWCommand(WXUINT param, WXWORD id); - - // coloured buttons support - virtual bool SetBackgroundColour(const wxColour &colour); - virtual bool SetForegroundColour(const wxColour &colour); - - virtual bool MSWOnDraw(WXDRAWITEMSTRUCT *item); - virtual WXDWORD MSWGetStyle(long style, WXDWORD *exstyle) const; - -private: - void MakeOwnerDrawn(); - -protected: - // send a notification event, return true if processed - bool SendClickEvent(); - - // default button handling - void SetTmpDefault(); - void UnsetTmpDefault(); - - // set or unset BS_DEFPUSHBUTTON style - static void SetDefaultStyle(wxButton *btn, bool on); - - // usually overridden base class virtuals - virtual wxSize DoGetBestSize() const; - -private: - DECLARE_DYNAMIC_CLASS_NO_COPY(wxButton) -}; - -#endif - // _WX_BUTTON_H_ diff --git a/wxWidgets/include/wx/msw/caret.h b/wxWidgets/include/wx/msw/caret.h deleted file mode 100644 index b1af3f8873..0000000000 --- a/wxWidgets/include/wx/msw/caret.h +++ /dev/null @@ -1,64 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: msw/caret.h -// Purpose: wxCaret class - the MSW implementation of wxCaret -// Author: Vadim Zeitlin -// Modified by: -// Created: 23.05.99 -// RCS-ID: $Id: caret.h 35650 2005-09-23 12:56:45Z MR $ -// Copyright: (c) wxWidgets team -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_CARET_H_ -#define _WX_CARET_H_ - -class WXDLLEXPORT wxCaret : public wxCaretBase -{ -public: - wxCaret() { Init(); } - // create the caret of given (in pixels) width and height and associate - // with the given window - wxCaret(wxWindow *window, int width, int height) - { - Init(); - - (void)Create(window, width, height); - } - // same as above - wxCaret(wxWindowBase *window, const wxSize& size) - { - Init(); - - (void)Create(window, size); - } - - // process wxWindow notifications - virtual void OnSetFocus(); - virtual void OnKillFocus(); - -protected: - void Init() - { - wxCaretBase::Init(); - - m_hasCaret = false; - } - - // override base class virtuals - virtual void DoMove(); - virtual void DoShow(); - virtual void DoHide(); - virtual void DoSize(); - - // helper function which creates the system caret - bool MSWCreateCaret(); - -private: - bool m_hasCaret; - - DECLARE_NO_COPY_CLASS(wxCaret) -}; - -#endif // _WX_CARET_H_ - - diff --git a/wxWidgets/include/wx/msw/cdrom.ico b/wxWidgets/include/wx/msw/cdrom.ico deleted file mode 100644 index f3fa3a9576113e57e439f732b4638e2433ee920b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1718 zcmb8vKWN)P7>D6s`UiPRvnETsD0GeYgpQ6UFNt?g1w#mUaPU%1i6<L8WDFfj2YK=m zoXupgp+hE3Aw#iiB?t*b77JQ>eI+HOlo;BR?@qdV{OSCiENMm0w6><KyniWea<=v` z@ODM&F!nYbqrRc8s6Z>dWA5qVNPOftc}L5sMx&8NHzUPgKFf=Z22-PsXH*{>m4-&P zYoxUHZlu<QR6CW*4XId>H^WcxeS8<+z*n(*)Lr~GehY8o*YU(14DcO%9bdxRSpB5p zg%@6URW!p-@O^w2-@sS#dotR^Z{xS{Hhvu+<EMBJKgJL7F5boW@GX1|U&a^l25;~N zZ}0|h@IN_jI4(F&IT{?5%*XgC-ouaaLwp+DMfcDxbPZib7l}W^Pw;(w7vI2F@q74P z{5F0IZ{yeT#2pOq9ef>M!rM!-Bbga~g74$I_y)de%j}WOU9!1NHn+&8O*Yr@F@B2o z@MHWC@8Vs258uMq@MU}vZ}0|h@CI-2hV`&rH*D7h+jYuzHQ267MT+rLyoVp-hj<si z<nhrAKf(9$U3>#y#V>h$i0f&9@8IkB65hryOOR(~_zAv`@8Zd{sq({~PLO9}{1oru z$M_+h<Sa>$XLz2e9crCgqT1AD3A(?(m+$+!zP{Gg)s-$UFLi!?F4uK+c6O#-uczbV zW3^f>9UL5}R;y`$e_!QtSvxyBDi({{+}za0#)ei`R~3IZ`t<Q5|6_;$3-?X`O58u| zXw#*bwE4RvNfKry%8EiC_E`K-`DB>SMxl~9#ZQ}g5G0Y5%w~%qijpX}3&J#dkbL9& z)-7?fn<djU+}yX4>@vK~q7&pc8wl?#%LGv{pXVUF^(`wh(eLX!e{L~v=2jjruzV{E zVS+sVot3XSpJqjibbk7H31TVv+Oj-2jQm+gyeGdtr&_!N>Hn;c<MAu$$Lqh}voDB* z&)TON=ix@YUztu@hm-U@```QYA^XXPgvm=YEu6kOYPZ|z@QGO*Ia0xxMU(y{?T_f2 wNukO7N%Jty`=i2w>q3)=Y(UoYb+te6$WsdKwv#<N4{J`>o!5WOQ$n780jea4V*mgE diff --git a/wxWidgets/include/wx/msw/checkbox.h b/wxWidgets/include/wx/msw/checkbox.h deleted file mode 100644 index 21d9963c64..0000000000 --- a/wxWidgets/include/wx/msw/checkbox.h +++ /dev/null @@ -1,86 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/msw/checkbox.h -// Purpose: wxCheckBox class -// Author: Julian Smart -// Modified by: -// Created: 01/02/97 -// RCS-ID: $Id: checkbox.h 37393 2006-02-08 21:47:09Z VZ $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_CHECKBOX_H_ -#define _WX_CHECKBOX_H_ - -// 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 value); - virtual bool GetValue() const; - - // override some base class virtuals - virtual bool MSWCommand(WXUINT param, WXWORD id); - virtual void Command(wxCommandEvent& event); - virtual bool SetForegroundColour(const wxColour& colour); - virtual bool MSWOnDraw(WXDRAWITEMSTRUCT *item); - -protected: - virtual wxSize DoGetBestSize() const; - - virtual void DoSet3StateValue(wxCheckBoxState value); - virtual wxCheckBoxState DoGet3StateValue() const; - - // make the checkbox owner drawn or reset it to normal style - void MakeOwnerDrawn(bool ownerDrawn); - - // return true if this checkbox is owner drawn - bool IsOwnerDrawn() const; - -private: - // common part of all ctors - void Init(); - - // event handlers used by owner-drawn checkbox - void OnMouseEnterOrLeave(wxMouseEvent& event); - void OnMouseLeft(wxMouseEvent& event); - void OnFocus(wxFocusEvent& event); - - - // current state of the checkbox - wxCheckBoxState m_state; - - // true if the checkbox is currently pressed - bool m_isPressed; - - // true if mouse is currently over the control - bool m_isHot; - - - DECLARE_DYNAMIC_CLASS_NO_COPY(wxCheckBox) -}; - -#endif - // _WX_CHECKBOX_H_ diff --git a/wxWidgets/include/wx/msw/checklst.h b/wxWidgets/include/wx/msw/checklst.h deleted file mode 100644 index 609936c167..0000000000 --- a/wxWidgets/include/wx/msw/checklst.h +++ /dev/null @@ -1,96 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: wx/msw/checklst.h -// Purpose: wxCheckListBox class - a listbox with checkable items -// Author: Vadim Zeitlin -// Modified by: -// Created: 16.11.97 -// RCS-ID: $Id: checklst.h 49563 2007-10-31 20:46:21Z VZ $ -// Copyright: (c) 1998 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr> -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifndef __CHECKLST__H_ -#define __CHECKLST__H_ - -#if !wxUSE_OWNER_DRAWN - #error "wxCheckListBox class requires owner-drawn functionality." -#endif - -class WXDLLIMPEXP_FWD_CORE wxOwnerDrawn; -class WXDLLIMPEXP_FWD_CORE wxCheckListBoxItem; // fwd decl, defined in checklst.cpp - -class WXDLLEXPORT wxCheckListBox : public wxCheckListBoxBase -{ -public: - // ctors - wxCheckListBox(); - 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); - 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); - - 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); - - // override base class virtuals - virtual void Delete(unsigned int n); - - virtual bool SetFont( const wxFont &font ); - - // items may be checked - virtual bool IsChecked(unsigned int uiIndex) const; - virtual void Check(unsigned int uiIndex, bool bCheck = true); - - // return the index of the item at this position or wxNOT_FOUND - int HitTest(const wxPoint& pt) const { return DoHitTestItem(pt.x, pt.y); } - int HitTest(wxCoord x, wxCoord y) const { return DoHitTestItem(x, y); } - - // accessors - size_t GetItemHeight() const { return m_nItemHeight; } - - // we create our items ourselves and they have non-standard size, - // so we need to override these functions - virtual wxOwnerDrawn *CreateLboxItem(size_t n); - virtual bool MSWOnMeasure(WXMEASUREITEMSTRUCT *item); - -protected: - // this can't be called DoHitTest() because wxWindow already has this method - int DoHitTestItem(wxCoord x, wxCoord y) const; - - // pressing space or clicking the check box toggles the item - void OnKeyDown(wxKeyEvent& event); - void OnLeftClick(wxMouseEvent& event); - - wxSize DoGetBestSize() const; - -private: - size_t m_nItemHeight; // height of checklistbox items (the same for all) - - DECLARE_EVENT_TABLE() - DECLARE_DYNAMIC_CLASS_NO_COPY(wxCheckListBox) -}; - -#endif //_CHECKLST_H diff --git a/wxWidgets/include/wx/msw/child.ico b/wxWidgets/include/wx/msw/child.ico deleted file mode 100644 index 435cca2471cd31bb825ff1e6eb180c1939a9eb4a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1078 zcmc&zF%p6>5L_S)<BakHsT`j{k%#dFTYh10!*eX@E#mG)fdQix<B`41-d%Dj4j@C0 zx~|9$_Z&C@sH&*X8L%&aGh;Q;5UTrbEx?7gjYQ8a`o1SC5o{p@?FfDf$!%<9C%cSY zRyw@$yPND<CUsck)7qNtro8jClxBMuX8DEIT`?cum(<oYI;;2182PF7zIpvZj~8vQ z;S8({1qZ{>1H}g<-VtX@^EF=Zz9{mlQwW;#il~Wy%sJ<goq>ax^Jn}JGe|Bw=NmFB ge8aqPJmI~ud$Eb6)2}9ELOWr8V4xU|6W(XUPqgg+2mk;8 diff --git a/wxWidgets/include/wx/msw/chkconf.h b/wxWidgets/include/wx/msw/chkconf.h deleted file mode 100644 index ab3db00401..0000000000 --- a/wxWidgets/include/wx/msw/chkconf.h +++ /dev/null @@ -1,387 +0,0 @@ -/* - * Name: wx/msw/chkconf.h - * Purpose: Compiler-specific configuration checking - * Author: Julian Smart - * Modified by: - * Created: 01/02/97 - * RCS-ID: $Id: chkconf.h 44436 2007-02-10 02:06:54Z RD $ - * Copyright: (c) Julian Smart - * Licence: wxWindows licence - */ - -/* THIS IS A C FILE, DON'T USE C++ FEATURES (IN PARTICULAR COMMENTS) IN IT */ - -#ifndef _WX_MSW_CHKCONF_H_ -#define _WX_MSW_CHKCONF_H_ - -/* ensure that MSW-specific settings are defined */ -#ifndef wxUSE_DC_CACHEING -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxUSE_DC_CACHEING must be defined" -# else -# define wxUSE_DC_CACHEING 1 -# endif -#endif /* wxUSE_DC_CACHEING */ - - -/* - * disable the settings which don't work for some compilers - */ - -/* - * If using PostScript-in-MSW in Univ, must enable PostScript - */ -#if defined(__WXUNIVERSAL__) && wxUSE_POSTSCRIPT_ARCHITECTURE_IN_MSW && !wxUSE_POSTSCRIPT -# undef wxUSE_POSTSCRIPT -# define wxUSE_POSTSCRIPT 1 -#endif - -#ifndef wxUSE_NORLANDER_HEADERS -# if ( wxCHECK_WATCOM_VERSION(1,0) || defined(__WINE__) ) || \ - ((defined(__MINGW32__) || defined(__CYGWIN__)) && ((__GNUC__>2) ||((__GNUC__==2) && (__GNUC_MINOR__>=95)))) -# define wxUSE_NORLANDER_HEADERS 1 -# else -# define wxUSE_NORLANDER_HEADERS 0 -# endif -#endif - -/* - * We don't want to give an error if wxUSE_UNICODE_MSLU is enabled but - * wxUSE_UNICODE is not as this would make it impossible to simply set the - * former in wx/setup.h as then the library wouldn't compile in non-Unicode - * configurations, so instead simply unset it silently when it doesn't make - * sense. - */ -#if wxUSE_UNICODE_MSLU && !wxUSE_UNICODE -# undef wxUSE_UNICODE_MSLU -# define wxUSE_UNICODE_MSLU 0 -#endif - -/* - * Don't use MSLU if compiling with Wine - */ - -#if wxUSE_UNICODE_MSLU && defined(__WINE__) -# undef wxUSE_UNICODE_MSLU -# define wxUSE_UNICODE_MSLU 0 -#endif - -/* - * All of the settings below require SEH support (__try/__catch) and can't work - * without it. - */ -#if !defined(_MSC_VER) && \ - (!defined(__BORLANDC__) || __BORLANDC__ < 0x0550) -# undef wxUSE_ON_FATAL_EXCEPTION -# define wxUSE_ON_FATAL_EXCEPTION 0 - -# undef wxUSE_CRASHREPORT -# define wxUSE_CRASHREPORT 0 - -# undef wxUSE_STACKWALKER -# define wxUSE_STACKWALKER 0 -#endif /* compiler doesn't support SEH */ - -/* wxUSE_DEBUG_NEW_ALWAYS doesn't work with CodeWarrior */ -#if defined(__MWERKS__) -# undef wxUSE_DEBUG_NEW_ALWAYS -# define wxUSE_DEBUG_NEW_ALWAYS 0 -#endif - -#if defined(__GNUWIN32__) - /* These don't work as expected for mingw32 and cygwin32 */ -# undef wxUSE_MEMORY_TRACING -# define wxUSE_MEMORY_TRACING 0 - -# undef wxUSE_GLOBAL_MEMORY_OPERATORS -# define wxUSE_GLOBAL_MEMORY_OPERATORS 0 - -# undef wxUSE_DEBUG_NEW_ALWAYS -# define wxUSE_DEBUG_NEW_ALWAYS 0 - -/* some Cygwin versions don't have wcslen */ -# if defined(__CYGWIN__) || defined(__CYGWIN32__) -# if ! ((__GNUC__>2) ||((__GNUC__==2) && (__GNUC_MINOR__>=95))) -# undef wxUSE_WCHAR_T -# define wxUSE_WCHAR_T 0 -# endif -#endif - -#endif /* __GNUWIN32__ */ - -/* wxUSE_MFC is not defined when using configure as it doesn't make sense for - gcc or mingw32 anyhow */ -#ifndef wxUSE_MFC - #define wxUSE_MFC 0 -#endif /* !defined(wxUSE_MFC) */ - -/* MFC duplicates these operators */ -#if wxUSE_MFC -# undef wxUSE_GLOBAL_MEMORY_OPERATORS -# define wxUSE_GLOBAL_MEMORY_OPERATORS 0 - -# undef wxUSE_DEBUG_NEW_ALWAYS -# define wxUSE_DEBUG_NEW_ALWAYS 0 -#endif /* wxUSE_MFC */ - -#if (defined(__GNUWIN32__) && !wxUSE_NORLANDER_HEADERS) - /* GnuWin32 doesn't have appropriate headers for e.g. IUnknown. */ -# undef wxUSE_DRAG_AND_DROP -# define wxUSE_DRAG_AND_DROP 0 -#endif - -#if !wxUSE_OWNER_DRAWN && !defined(__WXUNIVERSAL__) -# undef wxUSE_CHECKLISTBOX -# define wxUSE_CHECKLISTBOX 0 -#endif - -#if wxUSE_SPINCTRL -# if !wxUSE_SPINBTN -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxSpinCtrl requires wxSpinButton on MSW" -# else -# undef wxUSE_SPINBTN -# define wxUSE_SPINBTN 1 -# endif -# endif -#endif - -/* - Win64-specific checks. - */ -#ifdef __WIN64__ -# if wxUSE_STACKWALKER - /* this is not currently supported under Win64, volunteers needed to - make it work */ -# undef wxUSE_STACKWALKER -# define wxUSE_STACKWALKER 0 - -# undef wxUSE_CRASHREPORT -# define wxUSE_CRASHREPORT 0 -# endif -#endif /* __WIN64__ */ - - -/* - Compiler-specific checks. - */ -#if defined(__BORLANDC__) && (__BORLANDC__ < 0x500) - /* BC++ 4.0 can't compile JPEG library */ -# undef wxUSE_LIBJPEG -# define wxUSE_LIBJPEG 0 -#endif - -/* wxUSE_DEBUG_NEW_ALWAYS = 1 not compatible with BC++ in DLL mode */ -#if defined(__BORLANDC__) && (defined(WXMAKINGDLL) || defined(WXUSINGDLL)) -# undef wxUSE_DEBUG_NEW_ALWAYS -# define wxUSE_DEBUG_NEW_ALWAYS 0 -#endif - -/* DMC++ doesn't have definitions for date picker control, so use generic control - */ -#ifdef __DMC__ -# if wxUSE_DATEPICKCTRL -# undef wxUSE_DATEPICKCTRL_GENERIC -# undef wxUSE_DATEPICKCTRL -# endif -# define wxUSE_DATEPICKCTRL 0 -# define wxUSE_DATEPICKCTRL_GENERIC 1 -#endif - - -/* check that MSW-specific options are defined too */ -#ifndef wxUSE_ACTIVEX -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxUSE_ACTIVEX must be defined." -# else -# define wxUSE_ACTIVEX 0 -# endif -#endif /* !defined(wxUSE_ACTIVEX) */ - -#ifndef wxUSE_DIALUP_MANAGER -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxUSE_DIALUP_MANAGER must be defined." -# else -# define wxUSE_DIALUP_MANAGER 0 -# endif -#endif /* !defined(wxUSE_DIALUP_MANAGER) */ - -#ifndef wxUSE_MS_HTML_HELP -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxUSE_MS_HTML_HELP must be defined." -# else -# define wxUSE_MS_HTML_HELP 0 -# endif -#endif /* !defined(wxUSE_MS_HTML_HELP) */ - -#ifndef wxUSE_OLE -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxUSE_OLE must be defined." -# else -# define wxUSE_OLE 0 -# endif -#endif /* !defined(wxUSE_OLE) */ - -#ifndef wxUSE_OLE_AUTOMATION -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxUSE_OLE_AUTOMATION must be defined." -# else -# define wxUSE_OLE_AUTOMATION 0 -# endif -#endif /* !defined(wxUSE_OLE_AUTOMATION) */ - -#ifndef wxUSE_UNICODE_MSLU -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxUSE_UNICODE_MSLU must be defined." -# else -# define wxUSE_UNICODE_MSLU 0 -# endif -#endif /* wxUSE_UNICODE_MSLU */ - -#ifndef wxUSE_UXTHEME -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxUSE_UXTHEME must be defined." -# else -# define wxUSE_UXTHEME 0 -# endif -#endif /* wxUSE_UXTHEME */ - -#ifndef wxUSE_UXTHEME_AUTO -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxUSE_UXTHEME_AUTO must be defined." -# else -# define wxUSE_UXTHEME_AUTO 0 -# endif -#endif /* wxUSE_UXTHEME_AUTO */ - - -/* - un/redefine the options which we can't compile (after checking that they're - defined - */ -#ifdef __WINE__ - /* apparently it doesn't compile under Wine, remove it/when it does */ - #if wxUSE_ACTIVEX - #undef wxUSE_ACTIVEX - #define wxUSE_ACTIVEX 0 - #endif // wxUSE_ACTIVEX -#endif // __WINE__ - - -/* check settings consistency for MSW-specific ones */ -#if !wxUSE_VARIANT -# if wxUSE_ACTIVEX -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxActiveXContainer requires wxVariant" -# else -# undef wxUSE_ACTIVEX -# define wxUSE_ACTIVEX 0 -# endif -# endif - -# if wxUSE_OLE_AUTOMATION -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxAutomationObject requires wxVariant" -# else -# undef wxUSE_OLE_AUTOMATION -# define wxUSE_OLE_AUTOMATION 0 -# endif -# endif -#endif /* !wxUSE_VARIANT */ - -#if !wxUSE_DYNAMIC_LOADER -# if wxUSE_MS_HTML_HELP -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxUSE_MS_HTML_HELP requires wxUSE_DYNAMIC_LOADER." -# else -# undef wxUSE_MS_HTML_HELP -# define wxUSE_MS_HTML_HELP 0 -# endif -# endif -# if wxUSE_DIALUP_MANAGER -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxUSE_DIALUP_MANAGER requires wxUSE_DYNAMIC_LOADER." -# else -# undef wxUSE_DIALUP_MANAGER -# define wxUSE_DIALUP_MANAGER 0 -# endif -# endif -#endif /* !wxUSE_DYNAMIC_LOADER */ - -#if !wxUSE_DYNLIB_CLASS -# if wxUSE_UXTHEME -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxUSE_UXTHEME requires wxUSE_DYNLIB_CLASS" -# else -# undef wxUSE_UXTHEME -# define wxUSE_UXTHEME 0 -# endif -# endif -# if wxUSE_MEDIACTRL -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxUSE_MEDIACTRL requires wxUSE_DYNLIB_CLASS" -# else -# undef wxUSE_MEDIACTRL -# define wxUSE_MEDIACTRL 0 -# endif -# endif -# if wxUSE_INKEDIT -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxUSE_INKEDIT requires wxUSE_DYNLIB_CLASS" -# else -# undef wxUSE_INKEDIT -# define wxUSE_INKEDIT 0 -# endif -# endif -#endif /* !wxUSE_DYNLIB_CLASS */ - -#if !wxUSE_OLE -# if wxUSE_ACTIVEX -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxActiveXContainer requires wxUSE_OLE" -# else -# undef wxUSE_ACTIVEX -# define wxUSE_ACTIVEX 0 -# endif -# endif - -# if wxUSE_DATAOBJ -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxUSE_DATAOBJ requires wxUSE_OLE" -# else -# undef wxUSE_DATAOBJ -# define wxUSE_DATAOBJ 0 -# endif -# endif - -# if wxUSE_OLE_AUTOMATION -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxAutomationObject requires wxUSE_OLE" -# else -# undef wxUSE_OLE_AUTOMATION -# define wxUSE_OLE_AUTOMATION 0 -# endif -# endif -#endif /* !wxUSE_OLE */ - -#if !wxUSE_ACTIVEX -# if wxUSE_MEDIACTRL -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxMediaCtl requires wxActiveXContainer" -# else -# undef wxUSE_MEDIACTRL -# define wxUSE_MEDIACTRL 0 -# endif -# endif -#endif /* !wxUSE_ACTIVEX */ - -#if defined(_MSC_VER) && _MSC_VER <= 1200 && wxUSE_GRAPHICS_CONTEXT -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxGraphicsContext needs MSVC 7 or newer" -# else -# undef wxUSE_GRAPHICS_CONTEXT -# define wxUSE_GRAPHICS_CONTEXT 0 -# endif -#endif - -#endif /* _WX_MSW_CHKCONF_H_ */ diff --git a/wxWidgets/include/wx/msw/choice.h b/wxWidgets/include/wx/msw/choice.h deleted file mode 100644 index c62037f879..0000000000 --- a/wxWidgets/include/wx/msw/choice.h +++ /dev/null @@ -1,135 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/msw/choice.h -// Purpose: wxChoice class -// Author: Julian Smart -// Modified by: Vadim Zeitlin to derive from wxChoiceBase -// Created: 01/02/97 -// RCS-ID: $Id: choice.h 51616 2008-02-09 15:22:15Z VZ $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_CHOICE_H_ -#define _WX_CHOICE_H_ - -// ---------------------------------------------------------------------------- -// Choice item -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxChoice : public wxChoiceBase -{ -public: - // ctors - wxChoice() { Init(); } - 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) - { - Init(); - 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) - { - 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 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); - - virtual void SetLabel(const wxString& label); - - virtual void Delete(unsigned int n); - virtual void Clear(); - - virtual unsigned int GetCount() const; - virtual int GetSelection() const; - virtual int GetCurrentSelection() const; - virtual void SetSelection(int n); - - virtual int FindString(const wxString& s, bool bCase = false) const; - virtual wxString GetString(unsigned int n) const; - virtual void SetString(unsigned int n, const wxString& s); - - // MSW only - virtual bool MSWCommand(WXUINT param, WXWORD id); - WXLRESULT MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam); - virtual WXHBRUSH MSWControlColor(WXHDC hDC, WXHWND hWnd); - virtual bool MSWShouldPreProcessMessage(WXMSG *pMsg); - virtual WXDWORD MSWGetStyle(long style, WXDWORD *exstyle) const; - -protected: - // common part of all ctors - void Init() { m_lastAcceptedSelection = wxID_NONE; } - - virtual int DoAppend(const wxString& item); - virtual int DoInsert(const wxString& item, unsigned int pos); - virtual void DoMoveWindow(int x, int y, int width, int height); - virtual void DoSetItemClientData(unsigned int n, void* clientData); - virtual void* DoGetItemClientData(unsigned int n) const; - virtual void DoSetItemClientObject(unsigned int n, wxClientData* clientData); - virtual wxClientData* DoGetItemClientObject(unsigned int n) const; - - // MSW implementation - virtual wxSize DoGetBestSize() const; - virtual void DoGetSize(int *w, int *h) const; - virtual void DoSetSize(int x, int y, - int width, int height, - int sizeFlags = wxSIZE_AUTO); - - // update the height of the drop down list to fit the number of items we - // have (without changing the visible height) - void UpdateVisibleHeight(); - - // create and initialize the control - bool CreateAndInit(wxWindow *parent, wxWindowID id, - const wxPoint& pos, - const wxSize& size, - int n, const wxString choices[], - long style, - const wxValidator& validator, - const wxString& name); - - // free all memory we have (used by Clear() and dtor) - void Free(); - - - // last "completed" selection, i.e. not the transient one while the user is - // browsing the popup list: this is only used when != wxID_NONE which is - // the case while the drop down is opened - int m_lastAcceptedSelection; - - - DECLARE_DYNAMIC_CLASS_NO_COPY(wxChoice) -}; - -#endif // _WX_CHOICE_H_ diff --git a/wxWidgets/include/wx/msw/clipbrd.h b/wxWidgets/include/wx/msw/clipbrd.h deleted file mode 100644 index 85f8902172..0000000000 --- a/wxWidgets/include/wx/msw/clipbrd.h +++ /dev/null @@ -1,98 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/msw/clipbrd.h -// Purpose: wxClipboad class and clipboard functions for MSW -// Author: Julian Smart -// Modified by: -// Created: 01/02/97 -// RCS-ID: $Id: clipbrd.h 49563 2007-10-31 20:46:21Z VZ $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_CLIPBRD_H_ -#define _WX_CLIPBRD_H_ - -#if wxUSE_CLIPBOARD - -#include "wx/list.h" -#include "wx/module.h" -#include "wx/dataobj.h" // for wxDataFormat - -// These functions superceded by wxClipboard, but retained in order to -// implement wxClipboard, and for compatibility. - -// open/close the clipboard -WXDLLEXPORT bool wxOpenClipboard(); -WXDLLEXPORT bool wxIsClipboardOpened(); -#define wxClipboardOpen wxIsClipboardOpened -WXDLLEXPORT bool wxCloseClipboard(); - -// get/set data -WXDLLEXPORT bool wxEmptyClipboard(); -WXDLLEXPORT bool wxSetClipboardData(wxDataFormat dataFormat, - const void *data, - int width = 0, int height = 0); -WXDLLEXPORT void* wxGetClipboardData(wxDataFormat dataFormat, - long *len = NULL); - -// clipboard formats -WXDLLEXPORT bool wxIsClipboardFormatAvailable(wxDataFormat dataFormat); -WXDLLEXPORT wxDataFormat wxEnumClipboardFormats(wxDataFormat dataFormat); -WXDLLEXPORT int wxRegisterClipboardFormat(wxChar *formatName); -WXDLLEXPORT bool wxGetClipboardFormatName(wxDataFormat dataFormat, - wxChar *formatName, - int maxCount); - -//----------------------------------------------------------------------------- -// wxClipboard -//----------------------------------------------------------------------------- - -class WXDLLIMPEXP_FWD_CORE wxDataObject; -class WXDLLEXPORT wxClipboard : public wxClipboardBase -{ - DECLARE_DYNAMIC_CLASS(wxClipboard) - -public: - wxClipboard(); - virtual ~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: - IDataObject *m_lastDataObject; - bool m_isOpened; -}; - -#endif // wxUSE_CLIPBOARD -#endif - // _WX_CLIPBRD_H_ diff --git a/wxWidgets/include/wx/msw/colordlg.h b/wxWidgets/include/wx/msw/colordlg.h deleted file mode 100644 index 7d9764393f..0000000000 --- a/wxWidgets/include/wx/msw/colordlg.h +++ /dev/null @@ -1,56 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/msw/colordlg.h -// Purpose: wxColourDialog class -// Author: Julian Smart -// Modified by: -// Created: 01/02/97 -// RCS-ID: $Id: colordlg.h 37393 2006-02-08 21:47:09Z VZ $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_COLORDLG_H_ -#define _WX_COLORDLG_H_ - -#include "wx/defs.h" -#include "wx/dialog.h" -#include "wx/cmndata.h" - -// ---------------------------------------------------------------------------- -// wxColourDialog: dialog for choosing a colours -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxColourDialog : public wxDialog -{ -public: - wxColourDialog(); - wxColourDialog(wxWindow *parent, wxColourData *data = NULL); - - bool Create(wxWindow *parent, wxColourData *data = NULL); - - wxColourData& GetColourData() { return m_colourData; } - - // override some base class virtuals - virtual void SetTitle(const wxString& title); - virtual wxString GetTitle() const; - - virtual int ShowModal(); - -protected: - 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); - - wxColourData m_colourData; - wxString m_title; - - wxPoint m_pos; - - DECLARE_DYNAMIC_CLASS_NO_COPY(wxColourDialog) -}; - -#endif - // _WX_COLORDLG_H_ diff --git a/wxWidgets/include/wx/msw/colour.h b/wxWidgets/include/wx/msw/colour.h deleted file mode 100644 index 9d7c31d477..0000000000 --- a/wxWidgets/include/wx/msw/colour.h +++ /dev/null @@ -1,88 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/msw/colour.h -// Purpose: wxColour class -// Author: Julian Smart -// Modified by: -// Created: 01/02/97 -// RCS-ID: $Id: colour.h 51769 2008-02-13 22:36:43Z VZ $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_COLOUR_H_ -#define _WX_COLOUR_H_ - -#include "wx/object.h" - -// ---------------------------------------------------------------------------- -// Colour -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxColour : public wxColourBase -{ -public: - // constructors - // ------------ - - wxColour() { Init(); } - wxColour( ChannelType red, ChannelType green, ChannelType blue, - ChannelType alpha = wxALPHA_OPAQUE ) - { Set(red, green, blue, alpha); } - wxColour( unsigned long colRGB ) { Set(colRGB); } - wxColour(const wxString& colourName) { Init(); Set(colourName); } - wxColour(const wxChar *colourName) { Init(); Set(colourName); } - - - // dtor - virtual ~wxColour(); - - - // accessors - // --------- - - bool Ok() const { return IsOk(); } - bool IsOk() 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; } - unsigned char Alpha() const { return m_alpha ; } - - // 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 - && m_alpha == colour.m_alpha; - } - - bool operator != (const wxColour& colour) const { return !(*this == colour); } - - WXCOLORREF GetPixel() const { return m_pixel; } - - -public: - WXCOLORREF m_pixel; - -protected: - // Helper function - void Init(); - - virtual void - InitRGBA(unsigned char r, unsigned char g, unsigned char b, unsigned char a); - -private: - bool m_isInit; - unsigned char m_red; - unsigned char m_blue; - unsigned char m_green; - unsigned char m_alpha; - -private: - DECLARE_DYNAMIC_CLASS(wxColour) -}; - -#endif - // _WX_COLOUR_H_ diff --git a/wxWidgets/include/wx/msw/colours.bmp b/wxWidgets/include/wx/msw/colours.bmp deleted file mode 100644 index 7d391ad144a486bc3b54dc00e0f19624cf4fc6b3..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 122 zcmZ?rtzv+HG9aY^#4JF}2*w~5gb!w55Dg3rK*Z3{0HJ^+kjZf1zyTl)lK2ls4FCUw QSU?PfAR!>ZQP02t000FRaR2}S diff --git a/wxWidgets/include/wx/msw/combo.h b/wxWidgets/include/wx/msw/combo.h deleted file mode 100644 index ffb72c85d8..0000000000 --- a/wxWidgets/include/wx/msw/combo.h +++ /dev/null @@ -1,111 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/msw/combo.h -// Purpose: wxComboCtrl class -// Author: Jaakko Salli -// Modified by: -// Created: Apr-30-2006 -// RCS-ID: $Id: combo.h 43881 2006-12-09 19:48:21Z PC $ -// Copyright: (c) Jaakko Salli -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_COMBOCONTROL_H_ -#define _WX_COMBOCONTROL_H_ - -// NB: Definition of _WX_COMBOCONTROL_H_ is used in wx/generic/combo.h to -// determine whether there is native wxComboCtrl, so make sure you -// use it in all native wxComboCtrls. - -#if wxUSE_COMBOCTRL - -#if !defined(__WXWINCE__) && wxUSE_TIMER - #include "wx/timer.h" - #define wxUSE_COMBOCTRL_POPUP_ANIMATION 1 -#else - #define wxUSE_COMBOCTRL_POPUP_ANIMATION 0 -#endif - - -// ---------------------------------------------------------------------------- -// Native wxComboCtrl -// ---------------------------------------------------------------------------- - -// Define this only if native implementation includes all features -#define wxCOMBOCONTROL_FULLY_FEATURED - -extern WXDLLIMPEXP_DATA_CORE(const wxChar) wxComboBoxNameStr[]; - -class WXDLLEXPORT wxComboCtrl : public wxComboCtrlBase -{ -public: - // ctors and such - wxComboCtrl() : wxComboCtrlBase() { Init(); } - - wxComboCtrl(wxWindow *parent, - wxWindowID id = wxID_ANY, - const wxString& value = wxEmptyString, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = 0, - const wxValidator& validator = wxDefaultValidator, - const wxString& name = wxComboBoxNameStr) - : wxComboCtrlBase() - { - Init(); - - (void)Create(parent, id, value, pos, size, style, validator, name); - } - - bool Create(wxWindow *parent, - wxWindowID id = wxID_ANY, - const wxString& value = wxEmptyString, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = 0, - const wxValidator& validator = wxDefaultValidator, - const wxString& name = wxComboBoxNameStr); - - virtual ~wxComboCtrl(); - - virtual void PrepareBackground( wxDC& dc, const wxRect& rect, int flags ) const; - virtual bool IsKeyPopupToggle(const wxKeyEvent& event) const; - - static int GetFeatures() { return wxComboCtrlFeatures::All; } - -#if wxUSE_COMBOCTRL_POPUP_ANIMATION - void OnTimerEvent( wxTimerEvent& event ); -protected: - virtual bool AnimateShow( const wxRect& rect, int flags ); -#endif - -protected: - - // customization - virtual void OnResize(); - virtual wxCoord GetNativeTextIndent() const; - virtual void OnThemeChange(); - - // event handlers - void OnPaintEvent( wxPaintEvent& event ); - void OnMouseEvent( wxMouseEvent& event ); - -private: - void Init(); - -#if wxUSE_COMBOCTRL_POPUP_ANIMATION - // Popup animation related - wxLongLong m_animStart; - wxTimer m_animTimer; - wxRect m_animRect; - int m_animFlags; -#endif - - DECLARE_EVENT_TABLE() - - DECLARE_DYNAMIC_CLASS(wxComboCtrl) -}; - - -#endif // wxUSE_COMBOCTRL -#endif - // _WX_COMBOCONTROL_H_ diff --git a/wxWidgets/include/wx/msw/combobox.h b/wxWidgets/include/wx/msw/combobox.h deleted file mode 100644 index 4ac642da4f..0000000000 --- a/wxWidgets/include/wx/msw/combobox.h +++ /dev/null @@ -1,138 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/msw/combobox.h -// Purpose: wxComboBox class -// Author: Julian Smart -// Modified by: -// Created: 01/02/97 -// RCS-ID: $Id: combobox.h 45818 2007-05-05 13:15:47Z RR $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_COMBOBOX_H_ -#define _WX_COMBOBOX_H_ - -#include "wx/choice.h" - -#if wxUSE_COMBOBOX - -// ---------------------------------------------------------------------------- -// Combobox control -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxComboBox: public wxChoice -{ -public: - wxComboBox() { } - - 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); - } - 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: see wxChoice - - // 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 bool CanCopy() const; - virtual bool CanCut() const; - virtual bool CanPaste() const; - virtual void SetInsertionPoint(long pos); - virtual void SetInsertionPointEnd(); - virtual long GetInsertionPoint() const; - virtual wxTextPos GetLastPosition() const; - virtual void Replace(long from, long to, const wxString& value); - virtual void Remove(long from, long to); - virtual void SetSelection(int n) { wxChoice::SetSelection(n); } - virtual void SetSelection(long from, long to); - virtual int GetSelection() const { return wxChoice::GetSelection(); } - virtual void GetSelection(long* from, long* to) const; - virtual void SetEditable(bool editable); - - virtual void Undo(); - virtual void Redo(); - virtual bool CanUndo() const; - virtual bool CanRedo() const; - virtual void SelectAll(); - virtual bool IsEditable() const; - virtual bool HasSelection() const; - - // implementation only from now on - virtual bool MSWCommand(WXUINT param, WXWORD id); - bool MSWProcessEditMsg(WXUINT msg, WXWPARAM wParam, WXLPARAM lParam); - virtual WXLRESULT MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam); - bool MSWShouldPreProcessMessage(WXMSG *pMsg); - - WXHWND GetEditHWND() const; - - // Standard event handling - void OnCut(wxCommandEvent& event); - void OnCopy(wxCommandEvent& event); - void OnPaste(wxCommandEvent& event); - void OnUndo(wxCommandEvent& event); - void OnRedo(wxCommandEvent& event); - void OnDelete(wxCommandEvent& event); - void OnSelectAll(wxCommandEvent& event); - - void OnUpdateCut(wxUpdateUIEvent& event); - void OnUpdateCopy(wxUpdateUIEvent& event); - void OnUpdatePaste(wxUpdateUIEvent& event); - void OnUpdateUndo(wxUpdateUIEvent& event); - void OnUpdateRedo(wxUpdateUIEvent& event); - void OnUpdateDelete(wxUpdateUIEvent& event); - void OnUpdateSelectAll(wxUpdateUIEvent& event); - - virtual WXDWORD MSWGetStyle(long style, WXDWORD *exstyle) const; - -private: - DECLARE_DYNAMIC_CLASS_NO_COPY(wxComboBox) - DECLARE_EVENT_TABLE() -}; - -#endif // wxUSE_COMBOBOX -#endif - // _WX_COMBOBOX_H_ diff --git a/wxWidgets/include/wx/msw/computer.ico b/wxWidgets/include/wx/msw/computer.ico deleted file mode 100644 index f36237bdb92781b9004fc709694d47d3e10bf6cf..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1718 zcma*nJ!m397{>7@_d!e((wgd;m9*L$t~6FQ#@^~c2nRw8R^maDO2Hy!NO4@TRyM(O zl0xB%R9gkB^`b#8u%y}IAanm&O-w?Byz9*RuD_XC-~EtQ^g$aNisIX6DZ#gm`GKt! zsll-=dyMvlwxSrl^p)S<j+(?rwc2b)&sX(&J@tk?1;2mE3yeCxQNuGT^^G!JBgZw8 zZLOhHy^xA0QnoCma`Hy_0ltlI;>-8~Hc#8Zr}0U=gOB5xx6{El@Fjc(?_l*n!wWCG z@XBd~AK=^gCcca>;PW!t!Kd*_yn~P91H6y-@O^w2@8Vs23tz<-@mYKdZ}0|h@CI-2 z2LHe|WV>KHVJoxcA|K#=yoc}OyLdahi*BK-=ps6cPBH%oKft%~O?(+&z~}Kh_%uF= zckppM^L9G;2EK&P;GHGak<17`z_;;Dd>LPGWb#yVhiay&W|C?;R5Okb@IKzd_wil4 zi+AxYd=+2BXYnb#!5h568@$0A&WFo2<Z@kbxlXuTWiD4PCk1#P@8SFSF5bm2xqURk z5Abb#6JN#`@JntV=JnLUH}EBV2JhgP705Fq`~cs^H}O>36!>Fr7sxXK-p70RKE8{m zI7<rT8SZCVgI1ztXbx>zf$s0`H6D+3eSNK~t1DezUh4e(T(0Zt^z>A%R!fJ6hpJYq z+S}Vxu~^jZ?yj=gthTqel}e?QNF=nmxvBN_bp`*7ex9B29M^bWSl2#EtRL;@?Wq{s zy^g!T&*M(h=`^%)JDE&Y!>Pv8`XWL`Ps69&rV1B+YV*}-c+^GtIQ(Pd=H@1h{5a%1 z2;ZMP%YDCIU*tBc??2@>-QWN5IDVF`tv%+P>Et$A(5^pTtRKy9k1fKMphg-s-jBVH z?{9YO%lGW3XyRVfztz>|3)SXpvgeR}&%XCM#g1nYt3+`SJBs31M^RoAKUXRT-|e1| o$jI5-8o%0yvpk&r9#$$de-MqEkDvdI7j@!T&(`Xl^|E9C18@tCRsaA1 diff --git a/wxWidgets/include/wx/msw/control.h b/wxWidgets/include/wx/msw/control.h deleted file mode 100644 index 8818448669..0000000000 --- a/wxWidgets/include/wx/msw/control.h +++ /dev/null @@ -1,141 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/msw/control.h -// Purpose: wxControl class -// Author: Julian Smart -// Modified by: -// Created: 01/02/97 -// RCS-ID: $Id: control.h 45498 2007-04-16 13:03:05Z VZ $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_CONTROL_H_ -#define _WX_CONTROL_H_ - -#include "wx/dynarray.h" - -// General item class -class WXDLLEXPORT wxControl : public wxControlBase -{ -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 - // -------------------------- - - virtual wxVisualAttributes GetDefaultAttributes() const - { - return GetClassDefaultAttributes(GetWindowVariant()); - } - - static wxVisualAttributes - GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL); - - // Calls the callback and appropriate event handlers - bool ProcessCommand(wxCommandEvent& event); - - // MSW-specific - virtual bool MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result); - - // For ownerdraw items - virtual bool MSWOnDraw(WXDRAWITEMSTRUCT *WXUNUSED(item)) { return false; } - virtual bool MSWOnMeasure(WXMEASUREITEMSTRUCT *WXUNUSED(item)) { return false; } - - const wxArrayLong& GetSubcontrols() const { return m_subControls; } - - // default handling of WM_CTLCOLORxxx: this is public so that wxWindow - // could call it - virtual WXHBRUSH MSWControlColor(WXHDC pDC, WXHWND hWnd); - - // default style for the control include WS_TABSTOP if it AcceptsFocus() - virtual WXDWORD MSWGetStyle(long style, WXDWORD *exstyle) const; - -protected: - // choose the default border for this window - virtual wxBorder GetDefaultBorder() const; - - // return default best size (doesn't really make any sense, override this) - virtual wxSize DoGetBestSize() const; - - // This is a helper for all wxControls made with UPDOWN native control. - // In wxMSW it was only wxSpinCtrl derived from wxSpinButton but in - // WinCE of Smartphones this happens also for native wxTextCtrl, - // wxChoice and others. - virtual wxSize GetBestSpinnerSize(const bool is_vertical) const; - - // create the control of the given Windows class: this is typically called - // from Create() method of the derived class passing its label, pos and - // size parameter (style parameter is not needed because m_windowStyle is - // supposed to had been already set and so is used instead when this - // function is called) - bool MSWCreateControl(const wxChar *classname, - const wxString& label, - const wxPoint& pos, - const wxSize& size); - - // NB: the method below is deprecated now, with MSWGetStyle() the method - // above should be used instead! Once all the controls are updated to - // implement MSWGetStyle() this version will disappear. - // - // create the control of the given class with the given style (combination - // of WS_XXX flags, i.e. Windows style, not wxWidgets one), returns - // false if creation failed - // - // All parameters except classname and style are optional, if the - // size/position are not given, they should be set later with SetSize() - // and, label (the title of the window), of course, is left empty. The - // extended style is determined from the style and the app 3D settings - // automatically if it's not specified explicitly. - bool MSWCreateControl(const wxChar *classname, - WXDWORD style, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - const wxString& label = wxEmptyString, - WXDWORD exstyle = (WXDWORD)-1); - - // call this from the derived class MSWControlColor() if you want to show - // the control greyed out (and opaque) - WXHBRUSH MSWControlColorDisabled(WXHDC pDC); - - // common part of the 3 functions above: pass wxNullColour to use the - // appropriate background colour (meaning ours or our parents) or a fixed - // one - virtual WXHBRUSH DoMSWControlColor(WXHDC pDC, wxColour colBg, WXHWND hWnd); - - // this is a helper for the derived class GetClassDefaultAttributes() - // implementation: it returns the right colours for the classes which - // contain something else (e.g. wxListBox, wxTextCtrl, ...) instead of - // being simple controls (such as wxButton, wxCheckBox, ...) - static wxVisualAttributes - GetCompositeControlsDefaultAttributes(wxWindowVariant variant); - - // for controls like radiobuttons which are really composite this array - // holds the ids (not HWNDs!) of the sub controls - wxArrayLong m_subControls; - -private: - DECLARE_DYNAMIC_CLASS_NO_COPY(wxControl) -}; - -#endif // _WX_CONTROL_H_ diff --git a/wxWidgets/include/wx/msw/crashrpt.h b/wxWidgets/include/wx/msw/crashrpt.h deleted file mode 100644 index 81091b301f..0000000000 --- a/wxWidgets/include/wx/msw/crashrpt.h +++ /dev/null @@ -1,120 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: wx/msw/crashrpt.h -// Purpose: helpers for the structured exception handling (SEH) under Win32 -// Author: Vadim Zeitlin -// Modified by: -// Created: 13.07.2003 -// RCS-ID: $Id: crashrpt.h 34436 2005-05-31 09:20:43Z JS $ -// Copyright: (c) 2003 Vadim Zeitlin <vadim@wxwidgets.org> -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_MSW_CRASHRPT_H_ -#define _WX_MSW_CRASHRPT_H_ - -#include "wx/defs.h" - -#if wxUSE_CRASHREPORT - -struct _EXCEPTION_POINTERS; - -// ---------------------------------------------------------------------------- -// crash report generation flags -// ---------------------------------------------------------------------------- - -enum -{ - // we always report where the crash occurred - wxCRASH_REPORT_LOCATION = 0, - - // if this flag is given, the call stack is dumped - // - // this results in dump/crash report as small as possible, this is the - // default flag - wxCRASH_REPORT_STACK = 1, - - // if this flag is given, the values of the local variables are dumped - // - // note that with the current implementation it requires dumping the full - // process address space and so this will result in huge dump file and will - // take some time to generate - // - // it's probably not a good idea to use this by default, start with default - // mini dump and ask your users to set WX_CRASH_FLAGS environment variable - // to 2 or 4 if you need more information in the dump - wxCRASH_REPORT_LOCALS = 2, - - // if this flag is given, the values of all global variables are dumped - // - // this creates a much larger mini dump than just wxCRASH_REPORT_STACK but - // still much smaller than wxCRASH_REPORT_LOCALS one - wxCRASH_REPORT_GLOBALS = 4, - - // default is to create the smallest possible crash report - wxCRASH_REPORT_DEFAULT = wxCRASH_REPORT_LOCATION | wxCRASH_REPORT_STACK -}; - -// ---------------------------------------------------------------------------- -// wxCrashContext: information about the crash context -// ---------------------------------------------------------------------------- - -struct WXDLLIMPEXP_BASE wxCrashContext -{ - // initialize this object with the given information or from the current - // global exception info which is only valid inside wxApp::OnFatalException - wxCrashContext(_EXCEPTION_POINTERS *ep = NULL); - - // get the name for this exception code - wxString GetExceptionString() const; - - - // exception code - size_t code; - - // exception address - void *addr; - - // machine-specific registers vaues - struct - { -#ifdef __INTEL__ - wxInt32 eax, ebx, ecx, edx, esi, edi, - ebp, esp, eip, - cs, ds, es, fs, gs, ss, - flags; -#endif // __INTEL__ - } regs; -}; - -// ---------------------------------------------------------------------------- -// wxCrashReport: this class is used to create crash reports -// ---------------------------------------------------------------------------- - -struct WXDLLIMPEXP_BASE wxCrashReport -{ - // set the name of the file to which the report is written, it is - // constructed from the .exe name by default - static void SetFileName(const wxChar *filename); - - // return the current file name - static const wxChar *GetFileName(); - - // write the exception report to the file, return true if it could be done - // or false otherwise - // - // if ep pointer is NULL, the global exception info which is valid only - // inside wxApp::OnFatalException() is used - static bool Generate(int flags = wxCRASH_REPORT_DEFAULT, - _EXCEPTION_POINTERS *ep = NULL); - - - // generate a crash report from outside of wxApp::OnFatalException(), this - // can be used to take "snapshots" of the program in wxApp::OnAssert() for - // example - static bool GenerateNow(int flags = wxCRASH_REPORT_DEFAULT); -}; - -#endif // wxUSE_CRASHREPORT - -#endif // _WX_MSW_CRASHRPT_H_ - diff --git a/wxWidgets/include/wx/msw/cross.cur b/wxWidgets/include/wx/msw/cross.cur deleted file mode 100644 index 5b8f4632f9574aa0a22ca0e6838c414918cd4822..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 326 zcmZQzU}9ioP*7lC;AaqEFkob05My9q&;Vkf5Q75{GXfzPKq&|ZLH_^$AHf+Q7SIi- W;2)4nB>up_AWy7XusT$mz&rrdPk^rg diff --git a/wxWidgets/include/wx/msw/csquery.bmp b/wxWidgets/include/wx/msw/csquery.bmp deleted file mode 100644 index 4e7bcdc30b27a8a0e6bb783100bc1487d21d5f0f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 206 zcmZ?rJ;wk6Wk5;;h<SjR8;BVhSb!u0Lj({j>p`#pkPX5hASfuvAR!^aprD|@U|?Xt z5EvN9kdTnTkeQjuP*G9A(9qDpFmd8Uh6M{2Fsxj;l3~M!4Gaek902Qm_wLlXckdV& w-n~oUL#1Kj1-uaPgUt89>Rubjfan&U3v3{I1Cs#<h<+)+5C@jOwHBlv0Fit`c>n+a diff --git a/wxWidgets/include/wx/msw/cursor.h b/wxWidgets/include/wx/msw/cursor.h deleted file mode 100644 index 81758202cd..0000000000 --- a/wxWidgets/include/wx/msw/cursor.h +++ /dev/null @@ -1,47 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/msw/cursor.h -// Purpose: wxCursor class -// Author: Julian Smart -// Modified by: -// Created: 01/02/97 -// RCS-ID: $Id: cursor.h 49804 2007-11-10 01:09:42Z VZ $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_CURSOR_H_ -#define _WX_CURSOR_H_ - -#include "wx/msw/gdiimage.h" - -class WXDLLIMPEXP_FWD_CORE wxImage; - -// Cursor -class WXDLLEXPORT wxCursor : public wxGDIImage -{ -public: - // constructors - wxCursor(); - wxCursor(const wxImage& image); - wxCursor(const char bits[], int width, int height, - int hotSpotX = -1, int hotSpotY = -1, - const char maskBits[] = NULL); - wxCursor(const wxString& name, - long flags = wxBITMAP_TYPE_CUR_RESOURCE, - int hotSpotX = 0, int hotSpotY = 0); - wxCursor(int idCursor); - virtual ~wxCursor(); - - // implementation only - void SetHCURSOR(WXHCURSOR cursor) { SetHandle((WXHANDLE)cursor); } - WXHCURSOR GetHCURSOR() const { return (WXHCURSOR)GetHandle(); } - -protected: - virtual wxGDIImageRefData *CreateData() const; - -private: - DECLARE_DYNAMIC_CLASS(wxCursor) -}; - -#endif - // _WX_CURSOR_H_ diff --git a/wxWidgets/include/wx/msw/datectrl.h b/wxWidgets/include/wx/msw/datectrl.h deleted file mode 100644 index 18e17365d9..0000000000 --- a/wxWidgets/include/wx/msw/datectrl.h +++ /dev/null @@ -1,70 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: wx/msw/datectrl.h -// Purpose: wxDatePickerCtrl for Windows -// Author: Vadim Zeitlin -// Modified by: -// Created: 2005-01-09 -// RCS-ID: $Id: datectrl.h 42207 2006-10-21 16:29:33Z VZ $ -// Copyright: (c) 2005 Vadim Zeitlin <vadim@wxwindows.org> -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_MSW_DATECTRL_H_ -#define _WX_MSW_DATECTRL_H_ - -// ---------------------------------------------------------------------------- -// wxDatePickerCtrl -// ---------------------------------------------------------------------------- - -class WXDLLIMPEXP_ADV wxDatePickerCtrl : public wxDatePickerCtrlBase -{ -public: - // ctors - wxDatePickerCtrl() { } - - wxDatePickerCtrl(wxWindow *parent, - wxWindowID id, - const wxDateTime& dt = wxDefaultDateTime, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = wxDP_DEFAULT | wxDP_SHOWCENTURY, - const wxValidator& validator = wxDefaultValidator, - const wxString& name = wxDatePickerCtrlNameStr) - { - Create(parent, id, dt, pos, size, style, validator, name); - } - - bool Create(wxWindow *parent, - wxWindowID id, - const wxDateTime& dt = wxDefaultDateTime, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = wxDP_DEFAULT | wxDP_SHOWCENTURY, - const wxValidator& validator = wxDefaultValidator, - const wxString& name = wxDatePickerCtrlNameStr); - - // set/get the date - virtual void SetValue(const wxDateTime& dt); - virtual wxDateTime GetValue() const; - - // set/get the allowed valid range for the dates, if either/both of them - // are invalid, there is no corresponding limit and if neither is set - // GetRange() returns false - virtual void SetRange(const wxDateTime& dt1, const wxDateTime& dt2); - virtual bool GetRange(wxDateTime *dt1, wxDateTime *dt2) const; - - virtual WXDWORD MSWGetStyle(long style, WXDWORD *exstyle) const; - - virtual bool MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result); - -protected: - virtual wxSize DoGetBestSize() const; - - // the date currently shown by the control, may be invalid - wxDateTime m_date; - - - DECLARE_DYNAMIC_CLASS_NO_COPY(wxDatePickerCtrl) -}; - -#endif // _WX_MSW_DATECTRL_H_ diff --git a/wxWidgets/include/wx/msw/dc.h b/wxWidgets/include/wx/msw/dc.h deleted file mode 100644 index 85736af1ac..0000000000 --- a/wxWidgets/include/wx/msw/dc.h +++ /dev/null @@ -1,345 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/msw/dc.h -// Purpose: wxDC class -// Author: Julian Smart -// Modified by: -// Created: 01/02/97 -// RCS-ID: $Id: dc.h 42612 2006-10-29 10:46:49Z SC $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_MSW_DC_H_ -#define _WX_MSW_DC_H_ - -#include "wx/defs.h" - -// --------------------------------------------------------------------------- -// macros -// --------------------------------------------------------------------------- - -#if wxUSE_DC_CACHEING -/* - * Cached blitting, maintaining a cache - * of bitmaps required for transparent blitting - * instead of constant creation/deletion - */ - -class wxDCCacheEntry: public wxObject -{ -public: - wxDCCacheEntry(WXHBITMAP hBitmap, int w, int h, int depth); - wxDCCacheEntry(WXHDC hDC, int depth); - virtual ~wxDCCacheEntry(); - - WXHBITMAP m_bitmap; - WXHDC m_dc; - int m_width; - int m_height; - int m_depth; -}; -#endif - -// this is an ABC: use one of the derived classes to create a DC associated -// with a window, screen, printer and so on -class WXDLLEXPORT wxDC : public wxDCBase -{ -public: - wxDC(WXHDC hDC) { Init(); m_hDC = hDC; } - virtual ~wxDC(); - - // implement base class pure virtuals - // ---------------------------------- - - virtual void Clear(); - - virtual bool StartDoc(const wxString& message); - virtual void EndDoc(); - - virtual void StartPage(); - virtual void EndPage(); - - 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); -#if wxUSE_PALETTE - virtual void SetPalette(const wxPalette& palette); -#endif // wxUSE_PALETTE - - virtual void DestroyClippingRegion(); - - virtual wxCoord GetCharHeight() const; - virtual wxCoord GetCharWidth() 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 SetSystemScale(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); - - // implementation from now on - // -------------------------- - - virtual void SetRop(WXHDC cdc); - virtual void SelectOldObjects(WXHDC dc); - - wxWindow *GetWindow() const { return m_canvas; } - void SetWindow(wxWindow *win) - { - m_canvas = win; - -#if wxUSE_PALETTE - // if we have palettes use the correct one for this window - InitializePalette(); -#endif // wxUSE_PALETTE - } - - WXHDC GetHDC() const { return m_hDC; } - void SetHDC(WXHDC dc, bool bOwnsDC = false) - { - m_hDC = dc; - m_bOwnsDC = bOwnsDC; - - // we might have a pre existing clipping region, make sure that we - // return it if asked -- but avoid calling ::GetClipBox() right now as - // it could be unnecessary wasteful - m_clipping = true; - m_clipX1 = - m_clipX2 = 0; - } - - const wxBitmap& GetSelectedBitmap() const { return m_selectedBitmap; } - wxBitmap& GetSelectedBitmap() { return m_selectedBitmap; } - - // update the internal clip box variables - void UpdateClipBox(); - -#if wxUSE_DC_CACHEING - static wxDCCacheEntry* FindBitmapInCache(WXHDC hDC, int w, int h); - static wxDCCacheEntry* FindDCInCache(wxDCCacheEntry* notThis, WXHDC hDC); - - static void AddToBitmapCache(wxDCCacheEntry* entry); - static void AddToDCCache(wxDCCacheEntry* entry); - static void ClearCache(); -#endif - - // RTL related functions - // --------------------- - - // get or change the layout direction (LTR or RTL) for this dc, - // wxLayout_Default is returned if layout direction is not supported - virtual wxLayoutDirection GetLayoutDirection() const; - virtual void SetLayoutDirection(wxLayoutDirection dir); - -protected: - void Init() - { - m_canvas = NULL; - m_bOwnsDC = false; - m_hDC = NULL; - - m_oldBitmap = NULL; - m_oldPen = NULL; - m_oldBrush = NULL; - m_oldFont = NULL; - -#if wxUSE_PALETTE - m_oldPalette = NULL; -#endif // wxUSE_PALETTE - } - - // create an uninitialized DC: this should be only used by the derived - // classes - wxDC() { Init(); } - - 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 DoFloodFill(wxCoord x, wxCoord y, const wxColour& col, - int style = wxFLOOD_SURFACE); - - virtual void DoGradientFillLinear(const wxRect& rect, - const wxColour& initialColour, - const wxColour& destColour, - wxDirection nDirection = wxEAST); - - 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 DoDrawCheckMark(wxCoord x, wxCoord y, - wxCoord width, wxCoord height); - 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); - -#if wxUSE_SPLINES - virtual void DoDrawSpline(wxList *points); -#endif - - 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 = wxDefaultCoord, wxCoord ysrcMask = wxDefaultCoord); - - // 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 DoGetClippingBox(wxCoord *x, wxCoord *y, - wxCoord *w, wxCoord *h) const; - - 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); - virtual void DoDrawPolyPolygon(int n, int count[], wxPoint points[], - wxCoord xoffset, wxCoord yoffset, - int fillStyle = wxODDEVEN_RULE); - virtual wxBitmap DoGetAsBitmap(const wxRect *subrect) const - { return subrect == NULL ? GetSelectedBitmap() : GetSelectedBitmap().GetSubBitmap(*subrect); } - - -#if wxUSE_PALETTE - // MSW specific, select a logical palette into the HDC - // (tell windows to translate pixel from other palettes to our custom one - // and vice versa) - // Realize tells it to also reset the system palette to this one. - void DoSelectPalette(bool realize = false); - - // Find out what palette our parent window has, then select it into the dc - void InitializePalette(); -#endif // wxUSE_PALETTE - - // common part of DoDrawText() and DoDrawRotatedText() - void DrawAnyText(const wxString& text, wxCoord x, wxCoord y); - - // common part of DoSetClippingRegion() and DoSetClippingRegionAsRegion() - void SetClippingHrgn(WXHRGN hrgn); - - // implementation of DoGetSize() for wxScreen/PrinterDC: this simply - // returns the size of the entire device this DC is associated with - // - // notice that we intentionally put it in a separate function instead of - // DoGetSize() itself because we want it to remain pure virtual both - // because each derived class should take care to define it as needed (this - // implementation is not at all always appropriate) and because we want - // wxDC to be an ABC to prevent it from being created directly - void GetDeviceSize(int *width, int *height) const; - - - // MSW-specific member variables - // ----------------------------- - - // the window associated with this DC (may be NULL) - wxWindow *m_canvas; - - wxBitmap m_selectedBitmap; - - // TRUE => DeleteDC() in dtor, FALSE => only ReleaseDC() it - bool m_bOwnsDC:1; - - // our HDC - WXHDC m_hDC; - - // Store all old GDI objects when do a SelectObject, so we can select them - // back in (this unselecting user's objects) so we can safely delete the - // DC. - WXHBITMAP m_oldBitmap; - WXHPEN m_oldPen; - WXHBRUSH m_oldBrush; - WXHFONT m_oldFont; - -#if wxUSE_PALETTE - WXHPALETTE m_oldPalette; -#endif // wxUSE_PALETTE - -#if wxUSE_DC_CACHEING - static wxList sm_bitmapCache; - static wxList sm_dcCache; -#endif - - DECLARE_DYNAMIC_CLASS(wxDC) - DECLARE_NO_COPY_CLASS(wxDC) -}; - -// ---------------------------------------------------------------------------- -// wxDCTemp: a wxDC which doesn't free the given HDC (used by wxWidgets -// only/mainly) -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxDCTemp : public wxDC -{ -public: - // construct a temporary DC with the specified HDC and size (it should be - // specified whenever we know it for this HDC) - wxDCTemp(WXHDC hdc, const wxSize& size = wxDefaultSize) - : wxDC(hdc), - m_size(size) - { - } - - virtual ~wxDCTemp() - { - // prevent base class dtor from freeing it - SetHDC((WXHDC)NULL); - } - -protected: - virtual void DoGetSize(int *w, int *h) const - { - wxASSERT_MSG( m_size.IsFullySpecified(), - _T("size of this DC hadn't been set and is unknown") ); - - if ( w ) - *w = m_size.x; - if ( h ) - *h = m_size.y; - } - -private: - // size of this DC must be explicitly set by SetSize() as we have no way to - // find it ourselves - const wxSize m_size; - - DECLARE_NO_COPY_CLASS(wxDCTemp) -}; - -#endif // _WX_MSW_DC_H_ - diff --git a/wxWidgets/include/wx/msw/dcclient.h b/wxWidgets/include/wx/msw/dcclient.h deleted file mode 100644 index 19d7402808..0000000000 --- a/wxWidgets/include/wx/msw/dcclient.h +++ /dev/null @@ -1,118 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: dcclient.h -// Purpose: wxClientDC class -// Author: Julian Smart -// Modified by: -// Created: 01/02/97 -// RCS-ID: $Id: dcclient.h 53135 2008-04-12 02:31:04Z VZ $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_DCCLIENT_H_ -#define _WX_DCCLIENT_H_ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -#include "wx/dc.h" -#include "wx/dynarray.h" - -// ---------------------------------------------------------------------------- -// array types -// ---------------------------------------------------------------------------- - -// this one if used by wxPaintDC only -struct WXDLLIMPEXP_FWD_CORE wxPaintDCInfo; - -WX_DECLARE_EXPORTED_OBJARRAY(wxPaintDCInfo, wxArrayDCInfo); - -// ---------------------------------------------------------------------------- -// DC classes -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxWindowDC : public wxDC -{ -public: - // default ctor - wxWindowDC(); - - // Create a DC corresponding to the whole window - wxWindowDC(wxWindow *win); - -protected: - // initialize the newly created DC - void InitDC(); - - // override some base class virtuals - virtual void DoGetSize(int *width, int *height) const; - -private: - DECLARE_DYNAMIC_CLASS_NO_COPY(wxWindowDC) -}; - -class WXDLLEXPORT wxClientDC : public wxWindowDC -{ -public: - // default ctor - wxClientDC(); - - // Create a DC corresponding to the client area of the window - wxClientDC(wxWindow *win); - - virtual ~wxClientDC(); - -protected: - void InitDC(); - - // override some base class virtuals - virtual void DoGetSize(int *width, int *height) const; - -private: - DECLARE_DYNAMIC_CLASS_NO_COPY(wxClientDC) -}; - -class WXDLLEXPORT wxPaintDC : public wxClientDC -{ -public: - wxPaintDC(); - - // Create a DC corresponding for painting the window in OnPaint() - wxPaintDC(wxWindow *win); - - virtual ~wxPaintDC(); - - // find the entry for this DC in the cache (keyed by the window) - static WXHDC FindDCInCache(wxWindow* win); - -protected: - static wxArrayDCInfo ms_cache; - - // find the entry for this DC in the cache (keyed by the window) - wxPaintDCInfo *FindInCache(size_t *index = NULL) const; - -private: - DECLARE_DYNAMIC_CLASS_NO_COPY(wxPaintDC) -}; - -/* - * wxPaintDCEx - * This class is used when an application sends an HDC with the WM_PAINT - * message. It is used in HandlePaint and need not be used by an application. - */ - -class WXDLLEXPORT wxPaintDCEx : public wxPaintDC -{ -public: - wxPaintDCEx(wxWindow *canvas, WXHDC dc); - virtual ~wxPaintDCEx(); -private: - int saveState; - - DECLARE_CLASS(wxPaintDCEx) - DECLARE_NO_COPY_CLASS(wxPaintDCEx) -}; - -#endif - // _WX_DCCLIENT_H_ diff --git a/wxWidgets/include/wx/msw/dcmemory.h b/wxWidgets/include/wx/msw/dcmemory.h deleted file mode 100644 index 7cb91de0f0..0000000000 --- a/wxWidgets/include/wx/msw/dcmemory.h +++ /dev/null @@ -1,45 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/msw/dcmemory.h -// Purpose: wxMemoryDC class -// Author: Julian Smart -// Modified by: -// Created: 01/02/97 -// RCS-ID: $Id: dcmemory.h 48236 2007-08-20 23:43:32Z KO $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_DCMEMORY_H_ -#define _WX_DCMEMORY_H_ - -#include "wx/dcclient.h" - -class WXDLLEXPORT wxMemoryDC : public wxDC, public wxMemoryDCBase -{ -public: - wxMemoryDC() { CreateCompatible(NULL); Init(); } - wxMemoryDC(wxBitmap& bitmap) { CreateCompatible(NULL); Init(); SelectObject(bitmap); } - wxMemoryDC(wxDC *dc); // Create compatible DC - - -protected: - // override some base class virtuals - virtual void DoDrawRectangle(wxCoord x, wxCoord y, wxCoord width, wxCoord height); - virtual void DoGetSize(int* width, int* height) const; - virtual void DoSelect(const wxBitmap& bitmap); - - virtual wxBitmap DoGetAsBitmap(const wxRect* subrect) const - { return subrect == NULL ? GetSelectedBitmap() : GetSelectedBitmap().GetSubBitmapOfHDC(*subrect, GetHDC() );} - - // create DC compatible with the given one or screen if dc == NULL - bool CreateCompatible(wxDC *dc); - - // initialize the newly created DC - void Init(); - -private: - DECLARE_DYNAMIC_CLASS_NO_COPY(wxMemoryDC) -}; - -#endif - // _WX_DCMEMORY_H_ diff --git a/wxWidgets/include/wx/msw/dcprint.h b/wxWidgets/include/wx/msw/dcprint.h deleted file mode 100644 index 040a26383a..0000000000 --- a/wxWidgets/include/wx/msw/dcprint.h +++ /dev/null @@ -1,70 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/msw/dcprint.h -// Purpose: wxPrinterDC class -// Author: Julian Smart -// Modified by: -// Created: 01/02/97 -// RCS-ID: $Id: dcprint.h 42522 2006-10-27 13:07:40Z JS $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_MSW_DCPRINT_H_ -#define _WX_MSW_DCPRINT_H_ - -#if wxUSE_PRINTING_ARCHITECTURE - -#include "wx/dc.h" -#include "wx/cmndata.h" - -class WXDLLEXPORT wxPrinterDC : public wxDC -{ -public: - // Create a printer DC (obsolete function: use wxPrintData version now) - wxPrinterDC(const wxString& driver, const wxString& device, const wxString& output, bool interactive = true, int orientation = wxPORTRAIT); - - // Create from print data - wxPrinterDC(const wxPrintData& data); - - wxPrinterDC(WXHDC theDC); - - // override some base class virtuals - virtual bool StartDoc(const wxString& message); - virtual void EndDoc(); - virtual void StartPage(); - virtual void EndPage(); - - wxRect GetPaperRect(); - -protected: - virtual void DoDrawBitmap(const wxBitmap &bmp, wxCoord x, wxCoord y, - bool useMask = false); - 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 = wxDefaultCoord, wxCoord ysrcMask = wxDefaultCoord); - virtual void DoGetSize(int *w, int *h) const - { - GetDeviceSize(w, h); - } - - - // init the dc - void Init(); - - wxPrintData m_printData; - -private: - DECLARE_DYNAMIC_CLASS_NO_COPY(wxPrinterDC) -}; - -// Gets an HDC for the default printer configuration -// WXHDC WXDLLEXPORT wxGetPrinterDC(int orientation); - -// Gets an HDC for the specified printer configuration -WXHDC WXDLLEXPORT wxGetPrinterDC(const wxPrintData& data); - -#endif // wxUSE_PRINTING_ARCHITECTURE - -#endif // _WX_MSW_DCPRINT_H_ - diff --git a/wxWidgets/include/wx/msw/dcscreen.h b/wxWidgets/include/wx/msw/dcscreen.h deleted file mode 100644 index 4a72f92c06..0000000000 --- a/wxWidgets/include/wx/msw/dcscreen.h +++ /dev/null @@ -1,40 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/msw/dcscreen.h -// Purpose: wxScreenDC class -// Author: Julian Smart -// Modified by: -// Created: 01/02/97 -// RCS-ID: $Id: dcscreen.h 36565 2005-12-25 12:52:53Z VZ $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_MSW_DCSCREEN_H_ -#define _WX_MSW_DCSCREEN_H_ - -#include "wx/dc.h" - -class WXDLLEXPORT wxScreenDC : public wxDC -{ -public: - // Create a DC representing the whole screen - wxScreenDC(); - - // Compatibility with X's requirements for drawing on top of all windows: - // they don't do anything under MSW - static bool StartDrawingOnTop(wxWindow* WXUNUSED(window)) { return true; } - static bool StartDrawingOnTop(wxRect* WXUNUSED(rect) = NULL) { return true; } - static bool EndDrawingOnTop() { return true; } - -protected: - virtual void DoGetSize(int *w, int *h) const - { - GetDeviceSize(w, h); - } - -private: - DECLARE_DYNAMIC_CLASS_NO_COPY(wxScreenDC) -}; - -#endif // _WX_MSW_DCSCREEN_H_ - diff --git a/wxWidgets/include/wx/msw/dde.h b/wxWidgets/include/wx/msw/dde.h deleted file mode 100644 index 3be1625c79..0000000000 --- a/wxWidgets/include/wx/msw/dde.h +++ /dev/null @@ -1,144 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: dde.h -// Purpose: DDE class -// Author: Julian Smart -// Modified by: -// Created: 01/02/97 -// RCS-ID: $Id: dde.h 53135 2008-04-12 02:31:04Z VZ $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_DDE_H_ -#define _WX_DDE_H_ - -#include "wx/ipcbase.h" - -/* - * Mini-DDE implementation - - Most transactions involve a topic name and an item name (choose these - as befits your application). - - A client can: - - - ask the server to execute commands (data) associated with a topic - - request data from server by topic and item - - poke data into the server - - ask the server to start an advice loop on topic/item - - ask the server to stop an advice loop - - A server can: - - - respond to execute, request, poke and advice start/stop - - send advise data to client - - Note that this limits the server in the ways it can send data to the - client, i.e. it can't send unsolicited information. - * - */ - -class WXDLLIMPEXP_FWD_BASE wxDDEServer; -class WXDLLIMPEXP_FWD_BASE wxDDEClient; - -class WXDLLIMPEXP_BASE wxDDEConnection: public wxConnectionBase -{ - DECLARE_DYNAMIC_CLASS(wxDDEConnection) -public: - wxDDEConnection(wxChar *buffer, int size); // use external buffer - wxDDEConnection(); // use internal buffer - virtual ~wxDDEConnection(void); - - // Calls that CLIENT can make - virtual bool Execute(const wxChar *data, int size = -1, wxIPCFormat format = wxIPC_TEXT); - virtual bool Execute(const wxString& str) { return Execute(str, -1, wxIPC_TEXT); } - virtual wxChar *Request(const wxString& item, int *size = NULL, wxIPCFormat format = wxIPC_TEXT); - virtual bool Poke(const wxString& item, wxChar *data, int size = -1, wxIPCFormat format = wxIPC_TEXT); - virtual bool StartAdvise(const wxString& item); - virtual bool StopAdvise(const wxString& item); - - // Calls that SERVER can make - virtual bool Advise(const wxString& item, wxChar *data, int size = -1, wxIPCFormat format = wxIPC_TEXT); - - // Calls that both can make - virtual bool Disconnect(void); - - // Default behaviour is to delete connection and return true - virtual bool OnDisconnect(void); - - public: - wxString m_topicName; - wxDDEServer* m_server; - wxDDEClient* m_client; - - WXHCONV m_hConv; - wxChar* m_sendingData; - int m_dataSize; - wxIPCFormat m_dataType; - - DECLARE_NO_COPY_CLASS(wxDDEConnection) -}; - -class WXDLLIMPEXP_BASE wxDDEServer: public wxServerBase -{ - DECLARE_DYNAMIC_CLASS(wxDDEServer) - public: - - wxDDEServer(void); - virtual ~wxDDEServer(void); - bool Create(const wxString& server_name); // Returns false if can't create server (e.g. port - // number is already in use) - virtual wxConnectionBase *OnAcceptConnection(const wxString& topic); - - //////////////////////////////////////////////////////////// - // Implementation - - // Find/delete wxDDEConnection corresponding to the HCONV - wxDDEConnection *FindConnection(WXHCONV conv); - bool DeleteConnection(WXHCONV conv); - inline wxString& GetServiceName(void) const { return (wxString&) m_serviceName; } - inline wxDDEConnectionList& GetConnections(void) const - { - return (wxDDEConnectionList&) m_connections; - } - -protected: - int m_lastError; - wxString m_serviceName; - wxDDEConnectionList m_connections; -}; - -class WXDLLIMPEXP_BASE wxDDEClient: public wxClientBase -{ - DECLARE_DYNAMIC_CLASS(wxDDEClient) - public: - wxDDEClient(void); - virtual ~wxDDEClient(void); - bool ValidHost(const wxString& host); - virtual wxConnectionBase *MakeConnection(const wxString& host, const wxString& server, const wxString& topic); - // Call this to make a connection. - // Returns NULL if cannot. - virtual wxConnectionBase *OnMakeConnection(void); // Tailor this to return own connection. - - //////////////////////////////////////////////////////////// - // Implementation - - // Find/delete wxDDEConnection corresponding to the HCONV - wxDDEConnection *FindConnection(WXHCONV conv); - bool DeleteConnection(WXHCONV conv); - - inline wxDDEConnectionList& GetConnections(void) const - { - return (wxDDEConnectionList&) m_connections; - } - -protected: - int m_lastError; - wxDDEConnectionList m_connections; -}; - -void WXDLLIMPEXP_BASE wxDDEInitialize(); -void WXDLLIMPEXP_BASE wxDDECleanUp(); - -#endif - // _WX_DDE_H_ diff --git a/wxWidgets/include/wx/msw/debughlp.h b/wxWidgets/include/wx/msw/debughlp.h deleted file mode 100644 index 0728c44f21..0000000000 --- a/wxWidgets/include/wx/msw/debughlp.h +++ /dev/null @@ -1,228 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: wx/msw/wrapdbgh.h -// Purpose: wraps dbghelp.h standard file -// Author: Vadim Zeitlin -// Modified by: -// Created: 2005-01-08 (extracted from msw/crashrpt.cpp) -// RCS-ID: $Id: debughlp.h 31443 2005-01-18 10:10:23Z ABX $ -// Copyright: (c) 2003-2005 Vadim Zeitlin <vadim@wxwindows.org> -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_MSW_DEBUGHLPH_H_ -#define _WX_MSW_DEBUGHLPH_H_ - -#include "wx/dynlib.h" - -#include "wx/msw/wrapwin.h" -#ifndef __WXWINCE__ -#include <imagehlp.h> -#endif // __WXWINCE__ -#include "wx/msw/private.h" - -// we need to determine whether we have the declarations for the function in -// debughlp.dll version 5.81 (at least) and we check for DBHLPAPI to test this -// -// reasons: -// - VC6 version of imagehlp.h doesn't define it -// - VC7 one does -// - testing for compiler version doesn't work as you can install and use -// the new SDK headers with VC6 -// -// in any case, the user may override by defining wxUSE_DBGHELP himself -#ifndef wxUSE_DBGHELP - #ifdef DBHLPAPI - #define wxUSE_DBGHELP 1 - #else - #define wxUSE_DBGHELP 0 - #endif -#endif - -#if wxUSE_DBGHELP - -// ---------------------------------------------------------------------------- -// wxDbgHelpDLL: dynamically load dbghelp.dll functions -// ---------------------------------------------------------------------------- - -// wrapper for some functions from dbghelp.dll -// -// MT note: this class is not MT safe and should be only used from a single -// thread at a time (this is so because dbghelp.dll is not MT-safe -// itself anyhow) -class wxDbgHelpDLL -{ -public: - // some useful constants not present in debughlp.h (stolen from DIA SDK) - enum BasicType - { - BASICTYPE_NOTYPE = 0, - BASICTYPE_VOID = 1, - BASICTYPE_CHAR = 2, - BASICTYPE_WCHAR = 3, - BASICTYPE_INT = 6, - BASICTYPE_UINT = 7, - BASICTYPE_FLOAT = 8, - BASICTYPE_BCD = 9, - BASICTYPE_BOOL = 10, - BASICTYPE_LONG = 13, - BASICTYPE_ULONG = 14, - BASICTYPE_CURRENCY = 25, - BASICTYPE_DATE = 26, - BASICTYPE_VARIANT = 27, - BASICTYPE_COMPLEX = 28, - BASICTYPE_BIT = 29, - BASICTYPE_BSTR = 30, - BASICTYPE_HRESULT = 31, - BASICTYPE_MAX - }; - - enum SymbolTag - { - SYMBOL_TAG_NULL, - SYMBOL_TAG_EXE, - SYMBOL_TAG_COMPILAND, - SYMBOL_TAG_COMPILAND_DETAILS, - SYMBOL_TAG_COMPILAND_ENV, - SYMBOL_TAG_FUNCTION, - SYMBOL_TAG_BLOCK, - SYMBOL_TAG_DATA, - SYMBOL_TAG_ANNOTATION, - SYMBOL_TAG_LABEL, - SYMBOL_TAG_PUBLIC_SYMBOL, - SYMBOL_TAG_UDT, - SYMBOL_TAG_ENUM, - SYMBOL_TAG_FUNCTION_TYPE, - SYMBOL_TAG_POINTER_TYPE, - SYMBOL_TAG_ARRAY_TYPE, - SYMBOL_TAG_BASE_TYPE, - SYMBOL_TAG_TYPEDEF, - SYMBOL_TAG_BASE_CLASS, - SYMBOL_TAG_FRIEND, - SYMBOL_TAG_FUNCTION_ARG_TYPE, - SYMBOL_TAG_FUNC_DEBUG_START, - SYMBOL_TAG_FUNC_DEBUG_END, - SYMBOL_TAG_USING_NAMESPACE, - SYMBOL_TAG_VTABLE_SHAPE, - SYMBOL_TAG_VTABLE, - SYMBOL_TAG_CUSTOM, - SYMBOL_TAG_THUNK, - SYMBOL_TAG_CUSTOM_TYPE, - SYMBOL_TAG_MANAGED_TYPE, - SYMBOL_TAG_DIMENSION, - SYMBOL_TAG_MAX - }; - - enum DataKind - { - DATA_UNKNOWN, - DATA_LOCAL, - DATA_STATIC_LOCAL, - DATA_PARAM, - DATA_OBJECT_PTR, // "this" pointer - DATA_FILE_STATIC, - DATA_GLOBAL, - DATA_MEMBER, - DATA_STATIC_MEMBER, - DATA_CONSTANT, - DATA_MAX - }; - - enum UdtKind - { - UDT_STRUCT, - UDT_CLASS, - UDT_UNION, - UDT_MAX - }; - - - // function types - typedef DWORD (WINAPI *SymGetOptions_t)(); - typedef DWORD (WINAPI *SymSetOptions_t)(DWORD); - typedef BOOL (WINAPI *SymInitialize_t)(HANDLE, LPSTR, BOOL); - typedef BOOL (WINAPI *StackWalk_t)(DWORD, HANDLE, HANDLE, LPSTACKFRAME, - LPVOID, PREAD_PROCESS_MEMORY_ROUTINE, - PFUNCTION_TABLE_ACCESS_ROUTINE, - PGET_MODULE_BASE_ROUTINE, - PTRANSLATE_ADDRESS_ROUTINE); - typedef BOOL (WINAPI *SymFromAddr_t)(HANDLE, DWORD64, PDWORD64, PSYMBOL_INFO); - typedef LPVOID (WINAPI *SymFunctionTableAccess_t)(HANDLE, DWORD); - typedef DWORD (WINAPI *SymGetModuleBase_t)(HANDLE, DWORD); - typedef BOOL (WINAPI *SymGetLineFromAddr_t)(HANDLE, DWORD, - PDWORD, PIMAGEHLP_LINE); - typedef BOOL (WINAPI *SymSetContext_t)(HANDLE, PIMAGEHLP_STACK_FRAME, - PIMAGEHLP_CONTEXT); - typedef BOOL (WINAPI *SymEnumSymbols_t)(HANDLE, ULONG64, PCSTR, - PSYM_ENUMERATESYMBOLS_CALLBACK, PVOID); - typedef BOOL (WINAPI *SymGetTypeInfo_t)(HANDLE, DWORD64, ULONG, - IMAGEHLP_SYMBOL_TYPE_INFO, PVOID); - typedef BOOL (WINAPI *SymCleanup_t)(HANDLE); - typedef BOOL (WINAPI *EnumerateLoadedModules_t)(HANDLE, PENUMLOADED_MODULES_CALLBACK, PVOID); - typedef BOOL (WINAPI *MiniDumpWriteDump_t)(HANDLE, DWORD, HANDLE, - MINIDUMP_TYPE, - CONST PMINIDUMP_EXCEPTION_INFORMATION, - CONST PMINIDUMP_USER_STREAM_INFORMATION, - CONST PMINIDUMP_CALLBACK_INFORMATION); - - #define wxDO_FOR_ALL_SYM_FUNCS(what) \ - what(SymGetOptions); \ - what(SymSetOptions); \ - what(SymInitialize); \ - what(StackWalk); \ - what(SymFromAddr); \ - what(SymFunctionTableAccess); \ - what(SymGetModuleBase); \ - what(SymGetLineFromAddr); \ - what(SymSetContext); \ - what(SymEnumSymbols); \ - what(SymGetTypeInfo); \ - what(SymCleanup); \ - what(EnumerateLoadedModules); \ - what(MiniDumpWriteDump) - - #define wxDECLARE_SYM_FUNCTION(func) static func ## _t func - - wxDO_FOR_ALL_SYM_FUNCS(wxDECLARE_SYM_FUNCTION); - - #undef wxDECLARE_SYM_FUNCTION - - // load all functions from DLL, return true if ok - static bool Init(); - - // return the string with the error message explaining why Init() failed - static const wxString& GetErrorMessage(); - - // log error returned by the given function to debug output - static void LogError(const wxChar *func); - - // return textual representation of the value of given symbol - static wxString DumpSymbol(PSYMBOL_INFO pSymInfo, void *pVariable); - - // return the name of the symbol with given type index - static wxString GetSymbolName(PSYMBOL_INFO pSymInfo); - -private: - // dereference the given symbol, i.e. return symbol which is not a - // pointer/reference any more - // - // if ppData != NULL, dereference the pointer as many times as we - // dereferenced the symbol - // - // return the tag of the dereferenced symbol - static SymbolTag DereferenceSymbol(PSYMBOL_INFO pSymInfo, void **ppData); - - static wxString DumpField(PSYMBOL_INFO pSymInfo, - void *pVariable, - unsigned level); - - static wxString DumpBaseType(BasicType bt, DWORD64 length, void *pVariable); - - static wxString DumpUDT(PSYMBOL_INFO pSymInfo, - void *pVariable, - unsigned level = 0); -}; - -#endif // wxUSE_DBGHELP - -#endif // _WX_MSW_DEBUGHLPH_H_ - diff --git a/wxWidgets/include/wx/msw/dialog.h b/wxWidgets/include/wx/msw/dialog.h deleted file mode 100644 index 79a1240666..0000000000 --- a/wxWidgets/include/wx/msw/dialog.h +++ /dev/null @@ -1,140 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/msw/dialog.h -// Purpose: wxDialog class -// Author: Julian Smart -// Modified by: -// Created: 01/02/97 -// RCS-ID: $Id: dialog.h 53135 2008-04-12 02:31:04Z VZ $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_DIALOG_H_ -#define _WX_DIALOG_H_ - -#include "wx/panel.h" - -extern WXDLLEXPORT_DATA(const wxChar) wxDialogNameStr[]; - -class WXDLLIMPEXP_FWD_CORE wxDialogModalData; - -#if wxUSE_TOOLBAR && (defined(__SMARTPHONE__) || defined(__POCKETPC__)) -class WXDLLIMPEXP_FWD_CORE wxToolBar; -extern WXDLLEXPORT_DATA(const wxChar) wxToolBarNameStr[]; -#endif - -// Dialog boxes -class WXDLLEXPORT wxDialog : public wxDialogBase -{ -public: - wxDialog() { Init(); } - - // full ctor - 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) - { - 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_DIALOG_STYLE, - const wxString& name = wxDialogNameStr); - - virtual ~wxDialog(); - - // return true if we're showing the dialog modally - virtual bool IsModal() const { return m_modalData != NULL; } - - // show the dialog modally and return the value passed to EndModal() - virtual int ShowModal(); - - // may be called to terminate the dialog with the given return code - virtual void EndModal(int retCode); - - - // we treat dialog toolbars specially under Windows CE -#if wxUSE_TOOLBAR && defined(__POCKETPC__) - // create main toolbar by calling OnCreateToolBar() - virtual wxToolBar* CreateToolBar(long style = -1, - wxWindowID winid = wxID_ANY, - const wxString& name = wxToolBarNameStr); - // return a new toolbar - virtual wxToolBar *OnCreateToolBar(long style, - wxWindowID winid, - const wxString& name ); - - // get the main toolbar - wxToolBar *GetToolBar() const { return m_dialogToolBar; } -#endif // wxUSE_TOOLBAR && __POCKETPC__ - - - // implementation only from now on - // ------------------------------- - - // override some base class virtuals - virtual bool Show(bool show = true); - - virtual void Raise(); - -#ifdef __POCKETPC__ - // Responds to the OK button in a PocketPC titlebar. This - // can be overridden, or you can change the id used for - // sending the event with SetAffirmativeId. Returns false - // if the event was not processed. - virtual bool DoOK(); -#endif - - // Windows callbacks - WXLRESULT MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lParam); - -#if WXWIN_COMPATIBILITY_2_6 - // use the other ctor - wxDEPRECATED( wxDialog(wxWindow *parent, - const wxString& title, bool modal, - int x = wxDefaultCoord, int y = wxDefaultCoord, int width = 500, int height = 500, - long style = wxDEFAULT_DIALOG_STYLE, - const wxString& name = wxDialogNameStr) ); - - // just call Show() or ShowModal() - wxDEPRECATED( void SetModal(bool flag) ); - - // use IsModal() - wxDEPRECATED( bool IsModalShowing() const ); -#endif // WXWIN_COMPATIBILITY_2_6 - -protected: - // find the window to use as parent for this dialog if none has been - // specified explicitly by the user - // - // may return NULL - wxWindow *FindSuitableParent() const; - - // common part of all ctors - void Init(); - -private: - wxWindow* m_oldFocus; - bool m_endModalCalled; // allow for closing within InitDialog - -#if wxUSE_TOOLBAR && defined(__POCKETPC__) - wxToolBar* m_dialogToolBar; -#endif - - // this pointer is non-NULL only while the modal event loop is running - wxDialogModalData *m_modalData; - - DECLARE_DYNAMIC_CLASS(wxDialog) - DECLARE_NO_COPY_CLASS(wxDialog) -}; - -#endif - // _WX_DIALOG_H_ diff --git a/wxWidgets/include/wx/msw/dib.h b/wxWidgets/include/wx/msw/dib.h deleted file mode 100644 index c1eb28c0dd..0000000000 --- a/wxWidgets/include/wx/msw/dib.h +++ /dev/null @@ -1,255 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/msw/dib.h -// Purpose: wxDIB class representing Win32 device independent bitmaps -// Author: Vadim Zeitlin -// Modified by: -// Created: 03.03.03 (replaces the old file with the same name) -// RCS-ID: $Id: dib.h 49804 2007-11-10 01:09:42Z VZ $ -// Copyright: (c) 1997-2003 wxWidgets team -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_MSW_DIB_H_ -#define _WX_MSW_DIB_H_ - -class WXDLLIMPEXP_FWD_CORE wxBitmap; -class WXDLLIMPEXP_FWD_CORE wxPalette; - -#include "wx/msw/private.h" - -#if wxUSE_WXDIB - -// ---------------------------------------------------------------------------- -// wxDIB: represents a DIB section -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxDIB -{ -public: - // ctors and such - // -------------- - - // create an uninitialized DIB with the given width, height and depth (only - // 24 and 32 bpp DIBs are currently supported) - // - // after using this ctor, GetData() and GetHandle() may be used if IsOk() - // returns true - wxDIB(int width, int height, int depth) - { Init(); (void)Create(width, height, depth); } - - // create a DIB from the DDB - wxDIB(const wxBitmap& bmp) - { Init(); (void)Create(bmp); } - - // create a DIB from the Windows DDB - wxDIB(HBITMAP hbmp) - { Init(); (void)Create(hbmp); } - - // load a DIB from file (any depth is supoprted here unlike above) - // - // as above, use IsOk() to see if the bitmap was loaded successfully - wxDIB(const wxString& filename) - { Init(); (void)Load(filename); } - - // same as the corresponding ctors but with return value - bool Create(int width, int height, int depth); - bool Create(const wxBitmap& bmp); - bool Create(HBITMAP hbmp); - bool Load(const wxString& filename); - - // dtor is not virtual, this class is not meant to be used polymorphically - ~wxDIB(); - - - // operations - // ---------- - -#ifndef __WXWINCE__ - // create a bitmap compatible with the given HDC (or screen by default) and - // return its handle, the caller is responsible for freeing it (using - // DeleteObject()) - HBITMAP CreateDDB(HDC hdc = 0) const; -#endif // !__WXWINCE__ - - // get the handle from the DIB and reset it, i.e. this object won't destroy - // the DIB after this (but the caller should do it) - HBITMAP Detach() { HBITMAP hbmp = m_handle; m_handle = 0; return hbmp; } - -#if wxUSE_PALETTE - // create a palette for this DIB (always a trivial/default one for 24bpp) - wxPalette *CreatePalette() const; -#endif // wxUSE_PALETTE - - // save the DIB as a .BMP file to the file with the given name - bool Save(const wxString& filename); - - - // accessors - // --------- - - // return true if DIB was successfully created, false otherwise - bool IsOk() const { return m_handle != 0; } - - // get the bitmap size - wxSize GetSize() const { DoGetObject(); return wxSize(m_width, m_height); } - int GetWidth() const { DoGetObject(); return m_width; } - int GetHeight() const { DoGetObject(); return m_height; } - - // get the number of bits per pixel, or depth - int GetDepth() const { DoGetObject(); return m_depth; } - - // get the DIB handle - HBITMAP GetHandle() const { return m_handle; } - - // get raw pointer to bitmap bits, you should know what you do if you - // decide to use it - unsigned char *GetData() const - { DoGetObject(); return (unsigned char *)m_data; } - - - // HBITMAP conversion - // ------------------ - - // these functions are only used by wxWidgets internally right now, please - // don't use them directly if possible as they're subject to change - -#ifndef __WXWINCE__ - // creates a DDB compatible with the given (or screen) DC from either - // a plain DIB or a DIB section (in which case the last parameter must be - // non NULL) - static HBITMAP ConvertToBitmap(const BITMAPINFO *pbi, - HDC hdc = 0, - void *bits = NULL); - - // create a plain DIB (not a DIB section) from a DDB, the caller is - // responsable for freeing it using ::GlobalFree() - static HGLOBAL ConvertFromBitmap(HBITMAP hbmp); - - // creates a DIB from the given DDB or calculates the space needed by it: - // if pbi is NULL, only the space is calculated, otherwise pbi is supposed - // to point at BITMAPINFO of the correct size which is filled by this - // function (this overload is needed for wxBitmapDataObject code in - // src/msw/ole/dataobj.cpp) - static size_t ConvertFromBitmap(BITMAPINFO *pbi, HBITMAP hbmp); -#endif // __WXWINCE__ - - - // wxImage conversion - // ------------------ - -#if wxUSE_IMAGE - // create a DIB from the given image, the DIB will be either 24 or 32 (if - // the image has alpha channel) bpp - wxDIB(const wxImage& image) { Init(); (void)Create(image); } - - // same as the above ctor but with the return code - bool Create(const wxImage& image); - - // create wxImage having the same data as this DIB - wxImage ConvertToImage() const; -#endif // wxUSE_IMAGE - - - // helper functions - // ---------------- - - // return the size of one line in a DIB with given width and depth: the - // point here is that as the scan lines need to be DWORD aligned so we may - // need to add some padding - static unsigned long GetLineSize(int width, int depth) - { - return ((width*depth + 31) & ~31) >> 3; - } - -private: - // common part of all ctors - void Init(); - - // free resources - void Free(); - - // initialize the contents from the provided DDB (Create() must have been - // already called) - bool CopyFromDDB(HBITMAP hbmp); - - - // the DIB section handle, 0 if invalid - HBITMAP m_handle; - - // NB: we could store only m_handle and not any of the other fields as - // we may always retrieve them from it using ::GetObject(), but we - // decide to still store them for efficiency concerns -- however if we - // don't have them from the very beginning (e.g. DIB constructed from a - // bitmap), we only retrieve them when necessary and so these fields - // should *never* be accessed directly, even from inside wxDIB code - - // function which must be called before accessing any members and which - // gets their values from m_handle, if not done yet - void DoGetObject() const; - - // pointer to DIB bits, may be NULL - void *m_data; - - // size and depth of the image - int m_width, - m_height, - m_depth; - - // in some cases we could be using a handle which we didn't create and in - // this case we shouldn't free it neither -- this flag tell us if this is - // the case - bool m_ownsHandle; - - // if true, we have alpha, if false we don't (note that we can still have - // m_depth == 32 but the last component is then simply padding and not - // alpha) - bool m_hasAlpha; - - - // DIBs can't be copied - wxDIB(const wxDIB&); - wxDIB& operator=(const wxDIB&); -}; - -// ---------------------------------------------------------------------------- -// inline functions implementation -// ---------------------------------------------------------------------------- - -inline -void wxDIB::Init() -{ - m_handle = 0; - m_ownsHandle = true; - m_hasAlpha = false; - - m_data = NULL; - - m_width = - m_height = - m_depth = 0; -} - -inline -void wxDIB::Free() -{ - if ( m_handle && m_ownsHandle ) - { - if ( !::DeleteObject(m_handle) ) - { - wxLogLastError(wxT("DeleteObject(hDIB)")); - } - - Init(); - } -} - -inline wxDIB::~wxDIB() -{ - Free(); -} - -#endif - // wxUSE_WXDIB - -#endif // _WX_MSW_DIB_H_ - diff --git a/wxWidgets/include/wx/msw/dirdlg.h b/wxWidgets/include/wx/msw/dirdlg.h deleted file mode 100644 index 9a9708e1ed..0000000000 --- a/wxWidgets/include/wx/msw/dirdlg.h +++ /dev/null @@ -1,35 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/msw/dirdlg.h -// Purpose: wxDirDialog class -// Author: Julian Smart -// Modified by: -// Created: 01/02/97 -// RCS-ID: $Id: dirdlg.h 38956 2006-04-30 09:44:29Z RR $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_DIRDLG_H_ -#define _WX_DIRDLG_H_ - -class WXDLLEXPORT wxDirDialog : public wxDirDialogBase -{ -public: - wxDirDialog(wxWindow *parent, - const wxString& message = wxDirSelectorPromptStr, - const wxString& defaultPath = wxEmptyString, - long style = wxDD_DEFAULT_STYLE, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - const wxString& name = wxDirDialogNameStr); - - void SetPath(const wxString& path); - - virtual int ShowModal(); - -private: - DECLARE_DYNAMIC_CLASS_NO_COPY(wxDirDialog) -}; - -#endif - // _WX_DIRDLG_H_ diff --git a/wxWidgets/include/wx/msw/dragimag.h b/wxWidgets/include/wx/msw/dragimag.h deleted file mode 100644 index d7763d6c13..0000000000 --- a/wxWidgets/include/wx/msw/dragimag.h +++ /dev/null @@ -1,274 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/msw/dragimag.h -// Purpose: wxDragImage class: a kind of a cursor, that can cope -// with more sophisticated images -// Author: Julian Smart -// Modified by: -// Created: 08/04/99 -// RCS-ID: $Id: dragimag.h 45845 2007-05-05 19:00:35Z PC $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_DRAGIMAG_H_ -#define _WX_DRAGIMAG_H_ - -#if wxUSE_DRAGIMAGE - -#include "wx/bitmap.h" -#include "wx/icon.h" -#include "wx/cursor.h" -#include "wx/treectrl.h" -#include "wx/listctrl.h" - -// If 1, use a simple wxCursor instead of ImageList_SetDragCursorImage -#define wxUSE_SIMPLER_DRAGIMAGE 0 - -/* - To use this class, create a wxDragImage when you start dragging, for example: - - void MyTreeCtrl::OnBeginDrag(wxTreeEvent& event) - { -#ifdef __WXMSW__ - ::UpdateWindow((HWND) GetHWND()); // We need to implement this in wxWidgets -#endif - - CaptureMouse(); - - m_dragImage = new wxDragImage(* this, itemId); - m_dragImage->BeginDrag(wxPoint(0, 0), this); - m_dragImage->Move(pt, this); - m_dragImage->Show(this); - ... - } - - In your OnMouseMove function, hide the image, do any display updating required, - then move and show the image again: - - void MyTreeCtrl::OnMouseMove(wxMouseEvent& event) - { - if (m_dragMode == MY_TREE_DRAG_NONE) - { - event.Skip(); - return; - } - - // Prevent screen corruption by hiding the image - if (m_dragImage) - m_dragImage->Hide(this); - - // Do some updating of the window, such as highlighting the drop target - ... - -#ifdef __WXMSW__ - if (updateWindow) - ::UpdateWindow((HWND) GetHWND()); -#endif - - // Move and show the image again - m_dragImage->Move(event.GetPosition(), this); - m_dragImage->Show(this); - } - - Eventually we end the drag and delete the drag image. - - void MyTreeCtrl::OnLeftUp(wxMouseEvent& event) - { - ... - - // End the drag and delete the drag image - if (m_dragImage) - { - m_dragImage->EndDrag(this); - delete m_dragImage; - m_dragImage = NULL; - } - ReleaseMouse(); - } -*/ - -/* - Notes for Unix version: - Can we simply use cursors instead, creating a cursor dynamically, setting it into the window - in BeginDrag, and restoring the old cursor in EndDrag? - For a really bog-standard implementation, we could simply use a normal dragging cursor - and ignore the image. -*/ - -/* - * wxDragImage - */ - -class WXDLLEXPORT wxDragImage: public wxObject -{ -public: - - // Ctors & dtor - //////////////////////////////////////////////////////////////////////////// - - wxDragImage(); - wxDragImage(const wxBitmap& image, const wxCursor& cursor = wxNullCursor) - { - Init(); - - Create(image, cursor); - } - - // Deprecated form of the above - wxDragImage(const wxBitmap& image, const wxCursor& cursor, const wxPoint& cursorHotspot) - { - Init(); - - Create(image, cursor, cursorHotspot); - } - - wxDragImage(const wxIcon& image, const wxCursor& cursor = wxNullCursor) - { - Init(); - - Create(image, cursor); - } - - // Deprecated form of the above - wxDragImage(const wxIcon& image, const wxCursor& cursor, const wxPoint& cursorHotspot) - { - Init(); - - Create(image, cursor, cursorHotspot); - } - - wxDragImage(const wxString& str, const wxCursor& cursor = wxNullCursor) - { - Init(); - - Create(str, cursor); - } - - // Deprecated form of the above - wxDragImage(const wxString& str, const wxCursor& cursor, const wxPoint& cursorHotspot) - { - Init(); - - Create(str, cursor, cursorHotspot); - } - -#if wxUSE_TREECTRL - wxDragImage(const wxTreeCtrl& treeCtrl, wxTreeItemId& id) - { - Init(); - - Create(treeCtrl, id); - } -#endif - -#if wxUSE_LISTCTRL - wxDragImage(const wxListCtrl& listCtrl, long id) - { - Init(); - - Create(listCtrl, id); - } -#endif - - virtual ~wxDragImage(); - - // Attributes - //////////////////////////////////////////////////////////////////////////// - - // Operations - //////////////////////////////////////////////////////////////////////////// - - // Create a drag image from a bitmap and optional cursor - bool Create(const wxBitmap& image, const wxCursor& cursor = wxNullCursor); - bool Create(const wxBitmap& image, const wxCursor& cursor, const wxPoint& WXUNUSED(cursorHotspot)) - { - wxLogDebug(wxT("wxDragImage::Create: use of a cursor hotspot is now deprecated. Please omit this argument.")); - return Create(image, cursor); - } - - // Create a drag image from an icon and optional cursor - bool Create(const wxIcon& image, const wxCursor& cursor = wxNullCursor); - bool Create(const wxIcon& image, const wxCursor& cursor, const wxPoint& WXUNUSED(cursorHotspot)) - { - wxLogDebug(wxT("wxDragImage::Create: use of a cursor hotspot is now deprecated. Please omit this argument.")); - return Create(image, cursor); - } - - // Create a drag image from a string and optional cursor - bool Create(const wxString& str, const wxCursor& cursor = wxNullCursor); - bool Create(const wxString& str, const wxCursor& cursor, const wxPoint& WXUNUSED(cursorHotspot)) - { - wxLogDebug(wxT("wxDragImage::Create: use of a cursor hotspot is now deprecated. Please omit this argument.")); - return Create(str, cursor); - } - -#if wxUSE_TREECTRL - // Create a drag image for the given tree control item - bool Create(const wxTreeCtrl& treeCtrl, wxTreeItemId& id); -#endif - -#if wxUSE_LISTCTRL - // Create a drag image for the given list control item - bool Create(const wxListCtrl& listCtrl, long id); -#endif - - // Begin drag. hotspot is the location of the drag position relative to the upper-left - // corner of the image. - bool BeginDrag(const wxPoint& hotspot, wxWindow* window, bool fullScreen = false, wxRect* rect = (wxRect*) NULL); - - // Begin drag. hotspot is the location of the drag position relative to the upper-left - // corner of the image. This is full screen only. fullScreenRect gives the - // position of the window on the screen, to restrict the drag to. - bool BeginDrag(const wxPoint& hotspot, wxWindow* window, wxWindow* fullScreenRect); - - // End drag - bool EndDrag(); - - // Move the image: call from OnMouseMove. Pt is in window client coordinates if window - // is non-NULL, or in screen coordinates if NULL. - bool Move(const wxPoint& pt); - - // Show the image - bool Show(); - - // Hide the image - bool Hide(); - - // Implementation - //////////////////////////////////////////////////////////////////////////// - - // Initialize variables - void Init(); - - // Returns the native image list handle - WXHIMAGELIST GetHIMAGELIST() const { return m_hImageList; } - -#if !wxUSE_SIMPLER_DRAGIMAGE - // Returns the native image list handle for the cursor - WXHIMAGELIST GetCursorHIMAGELIST() const { return m_hCursorImageList; } -#endif - -protected: - WXHIMAGELIST m_hImageList; - -#if wxUSE_SIMPLER_DRAGIMAGE - wxCursor m_oldCursor; -#else - WXHIMAGELIST m_hCursorImageList; -#endif - - wxCursor m_cursor; -// wxPoint m_cursorHotspot; // Obsolete - wxPoint m_position; - wxWindow* m_window; - wxRect m_boundingRect; - bool m_fullScreen; - -private: - DECLARE_DYNAMIC_CLASS(wxDragImage) - DECLARE_NO_COPY_CLASS(wxDragImage) -}; - -#endif // wxUSE_DRAGIMAGE -#endif - // _WX_DRAGIMAG_H_ diff --git a/wxWidgets/include/wx/msw/drive.ico b/wxWidgets/include/wx/msw/drive.ico deleted file mode 100644 index cac90115fef141fb49d4c7dc4a4e6d31d4796e5c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1718 zcma*nF=*RZ9LMordM(M6W=*DB6tc#9!i|n6FNt?g1w$4OHeRABF*I1<A!F!pbdV=6 z!P!g(8*T_4G=&UBvOOp^n7|Q1q5pnmyVpyIp-=w5r@#F1ll*^@q!qo<#)f9?!#io4 zy^Y0zofWCUv7Pi7@h7pOHG1hUzI(m75+Awle4uAn-ELRi`>v+{d{!_uwL?=QFqL|y zY{%sICZ*B5mulBi@j}X#rA%Hygzw{9cn@F37qExK0e%m^i+Avwc;;=l@eO<lpT#>^ zeJAk33opF#itv4W3-95}_yYb=rUU#Qei!fHH}O+^h!5~Rd<XC2eS8yN!x!;6d<JiL z!yDf4hBy3owtKc~whOj0TYl!J_z)l9d-x7Mo!v(_(KU1tokM4sKf?F%Exd;>;|ush z`~iLszl(S9n|S7JxA6^p37^F~OR6JTgzw{9cn@F37aZ9k)jXh@dsK6mYC2SN6F<d= z_yFI-ckn*m$2ajcd=a0+XYhtMyx|RRc;k9lu6vg2n&rA+xyme8J}*u2AwIzO@EyF5 zUvm2>!uRnlyoWF23-~3s5Az0U;~V%AK8tto%L)`&gzw{9cn?pdt-v39y+DCY@gY9I z_wXG&#aU9Iz__1@22moighMPV(BtEyMx&AL?(TGZd#jt98(m#p$@hI-US6u%Z0hv% zRJB@7$H&Ji7K=JMI#Mo|)BgUxGMS9Fx3{&mwWam-bxpsS{{Hld=h)?W;k@ai#QA3f zeR?UDb}!oGWg85};jcEC3<i^*Y46|gS<dm7zn+XaNi^i2jfU)5Jht;u97V%nG)#u) zHrCi4ER5nfq9Y}b$wx!-Nt$bQ^<m*HNiTLB4j$t1B#AA4n&pZHgTXM0qEx3XI;WAx z^K=}?isSg<<2-%dzfyu{z~!BpM)!|-d|BmQCc^i#a=v)azMcKH`)r2)CoYqbvnI2F zp557d_IKB*zG!FFw49dAM|Uw=^7DJoo+_0SOT06$a#F1(YYF@2xr|ShbgY~`om45P kSFP8*I%CSY7%!=N>A058r2pFQ*2!JesY{L0_`0am4;UG$8vp<R diff --git a/wxWidgets/include/wx/msw/enhmeta.h b/wxWidgets/include/wx/msw/enhmeta.h deleted file mode 100644 index 0c3d358041..0000000000 --- a/wxWidgets/include/wx/msw/enhmeta.h +++ /dev/null @@ -1,196 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: wx/msw/enhmeta.h -// Purpose: wxEnhMetaFile class for Win32 -// Author: Vadim Zeitlin -// Modified by: -// Created: 13.01.00 -// RCS-ID: $Id: enhmeta.h 60850 2009-06-01 10:16:13Z JS $ -// Copyright: (c) 2000 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr> -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_MSW_ENHMETA_H_ -#define _WX_MSW_ENHMETA_H_ - -#include "wx/dc.h" - -#if wxUSE_DRAG_AND_DROP - #include "wx/dataobj.h" -#endif - -// Change this to 1 if you set wxUSE_HIGH_QUALITY_PREVIEW_IN_WXMSW to 1 in prntbase.cpp -#define wxUSE_ENH_METAFILE_FROM_DC 0 - -// ---------------------------------------------------------------------------- -// wxEnhMetaFile: encapsulation of Win32 HENHMETAFILE -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxEnhMetaFile : public wxObject -{ -public: - wxEnhMetaFile(const wxString& file = wxEmptyString) : m_filename(file) - { Init(); } - wxEnhMetaFile(const wxEnhMetaFile& metafile) : wxObject() - { Init(); Assign(metafile); } - wxEnhMetaFile& operator=(const wxEnhMetaFile& metafile) - { Free(); Assign(metafile); return *this; } - - virtual ~wxEnhMetaFile() - { Free(); } - - // display the picture stored in the metafile on the given DC - bool Play(wxDC *dc, wxRect *rectBound = (wxRect *)NULL); - - // accessors - bool Ok() const { return IsOk(); } - bool IsOk() const { return m_hMF != 0; } - - wxSize GetSize() const; - int GetWidth() const { return GetSize().x; } - int GetHeight() const { return GetSize().y; } - - const wxString& GetFileName() const { return m_filename; } - - // copy the metafile to the clipboard: the width and height parameters are - // for backwards compatibility (with wxMetaFile) only, they are ignored by - // this method - bool SetClipboard(int width = 0, int height = 0); - - // implementation - WXHANDLE GetHENHMETAFILE() const { return m_hMF; } - void SetHENHMETAFILE(WXHANDLE hMF) { Free(); m_hMF = hMF; } - -protected: - void Init(); - void Free(); - void Assign(const wxEnhMetaFile& mf); - -private: - wxString m_filename; - WXHANDLE m_hMF; - - DECLARE_DYNAMIC_CLASS(wxEnhMetaFile) -}; - -// ---------------------------------------------------------------------------- -// wxEnhMetaFileDC: allows to create a wxEnhMetaFile -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxEnhMetaFileDC : public wxDC -{ -public: - // the ctor parameters specify the filename (empty for memory metafiles), - // the metafile picture size and the optional description/comment - wxEnhMetaFileDC(const wxString& filename = wxEmptyString, - int width = 0, int height = 0, - const wxString& description = wxEmptyString); - -#if wxUSE_ENH_METAFILE_FROM_DC - // as above, but takes reference DC as first argument to take resolution, - // size, font metrics etc. from - wxEnhMetaFileDC(const wxDC& referenceDC, - const wxString& filename = wxEmptyString, - int width = 0, int height = 0, - const wxString& description = wxEmptyString); -#endif - - virtual ~wxEnhMetaFileDC(); - - // obtain a pointer to the new metafile (caller should delete it) - wxEnhMetaFile *Close(); - -protected: - virtual void DoGetSize(int *width, int *height) const; - -private: - // size passed to ctor and returned by DoGetSize() - int m_width, - m_height; - - DECLARE_DYNAMIC_CLASS_NO_COPY(wxEnhMetaFileDC) -}; - -#if wxUSE_DRAG_AND_DROP - -// ---------------------------------------------------------------------------- -// wxEnhMetaFileDataObject is a specialization of wxDataObject for enh metafile -// ---------------------------------------------------------------------------- - -// notice that we want to support both CF_METAFILEPICT and CF_ENHMETAFILE and -// so we derive from wxDataObject and not from wxDataObjectSimple -class WXDLLEXPORT wxEnhMetaFileDataObject : public wxDataObject -{ -public: - // ctors - wxEnhMetaFileDataObject() { } - wxEnhMetaFileDataObject(const wxEnhMetaFile& 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 wxEnhMetaFile& metafile) - { m_metafile = metafile; } - virtual wxEnhMetaFile GetMetafile() const - { return m_metafile; } - - // implement base class pure virtuals - virtual wxDataFormat GetPreferredFormat(Direction dir) const; - virtual size_t GetFormatCount(Direction dir) const; - virtual void GetAllFormats(wxDataFormat *formats, Direction dir) const; - virtual size_t GetDataSize(const wxDataFormat& format) const; - virtual bool GetDataHere(const wxDataFormat& format, void *buf) const; - virtual bool SetData(const wxDataFormat& format, size_t len, - const void *buf); - -protected: - wxEnhMetaFile m_metafile; - - DECLARE_NO_COPY_CLASS(wxEnhMetaFileDataObject) -}; - - -// ---------------------------------------------------------------------------- -// wxEnhMetaFileSimpleDataObject does derive from wxDataObjectSimple which -// makes it more convenient to use (it can be used with wxDataObjectComposite) -// at the price of not supoprting any more CF_METAFILEPICT but only -// CF_ENHMETAFILE -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxEnhMetaFileSimpleDataObject : public wxDataObjectSimple -{ -public: - // ctors - wxEnhMetaFileSimpleDataObject() : wxDataObjectSimple(wxDF_ENHMETAFILE) { } - wxEnhMetaFileSimpleDataObject(const wxEnhMetaFile& metafile) - : wxDataObjectSimple(wxDF_ENHMETAFILE), 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 SetEnhMetafile(const wxEnhMetaFile& metafile) - { m_metafile = metafile; } - virtual wxEnhMetaFile GetEnhMetafile() 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: - wxEnhMetaFile m_metafile; - - DECLARE_NO_COPY_CLASS(wxEnhMetaFileSimpleDataObject) -}; - -#endif // wxUSE_DRAG_AND_DROP - -#endif // _WX_MSW_ENHMETA_H_ diff --git a/wxWidgets/include/wx/msw/evtloop.h b/wxWidgets/include/wx/msw/evtloop.h deleted file mode 100644 index ee4e7be6ca..0000000000 --- a/wxWidgets/include/wx/msw/evtloop.h +++ /dev/null @@ -1,69 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: wx/msw/evtloop.h -// Purpose: wxEventLoop class for MSW -// Author: Vadim Zeitlin -// Modified by: -// Created: 2004-07-31 -// RCS-ID: $Id: evtloop.h 36881 2006-01-15 10:13:40Z ABX $ -// Copyright: (c) 2003-2004 Vadim Zeitlin <vadim@wxwindows.org> -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_MSW_EVTLOOP_H_ -#define _WX_MSW_EVTLOOP_H_ - -#include "wx/window.h" - -// ---------------------------------------------------------------------------- -// wxEventLoop -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxEventLoop : public wxEventLoopManual -{ -public: - wxEventLoop(); - - // implement base class pure virtuals - virtual bool Pending() const; - virtual bool Dispatch(); - - // MSW-specific methods - // -------------------- - - // preprocess a message, return true if processed (i.e. no further - // dispatching required) - virtual bool PreProcessMessage(WXMSG *msg); - - // process a single message - virtual void ProcessMessage(WXMSG *msg); - - // set the critical window: this is the window such that all the events - // except those to this window (and its children) stop to be processed - // (typical examples: assert or crash report dialog) - // - // calling this function with NULL argument restores the normal event - // handling - static void SetCriticalWindow(wxWindowMSW *win) { ms_winCritical = win; } - - // return true if there is no critical window or if this window is [a child - // of] the critical one - static bool AllowProcessing(wxWindowMSW *win) - { - return !ms_winCritical || IsChildOfCriticalWindow(win); - } - -protected: - // override/implement base class virtuals - virtual void WakeUp(); - virtual void OnNextIteration(); - - // check if the given window is a child of ms_winCritical (which must be - // non NULL) - static bool IsChildOfCriticalWindow(wxWindowMSW *win); - - - // critical window or NULL - static wxWindowMSW *ms_winCritical; -}; - -#endif // _WX_MSW_EVTLOOP_H_ diff --git a/wxWidgets/include/wx/msw/fdrepdlg.h b/wxWidgets/include/wx/msw/fdrepdlg.h deleted file mode 100644 index f7874715e4..0000000000 --- a/wxWidgets/include/wx/msw/fdrepdlg.h +++ /dev/null @@ -1,62 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/msw/fdrepdlg.h -// Purpose: wxFindReplaceDialog class -// Author: Markus Greither -// Modified by: 31.07.01: VZ: integrated into wxWidgets -// Created: 23/03/2001 -// RCS-ID: -// Copyright: (c) Markus Greither -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_MSW_FDREPDLG_H_ -#define _WX_MSW_FDREPDLG_H_ - -// ---------------------------------------------------------------------------- -// wxFindReplaceDialog: dialog for searching / replacing text -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxFindReplaceDialog : public wxFindReplaceDialogBase -{ -public: - // ctors and such - wxFindReplaceDialog() { Init(); } - wxFindReplaceDialog(wxWindow *parent, - wxFindReplaceData *data, - const wxString &title, - int style = 0); - - bool Create(wxWindow *parent, - wxFindReplaceData *data, - const wxString &title, - int style = 0); - - virtual ~wxFindReplaceDialog(); - - // implementation only from now on - - wxFindReplaceDialogImpl *GetImpl() const { return m_impl; } - - // override some base class virtuals - virtual bool Show(bool show = true); - virtual void SetTitle( const wxString& title); - virtual wxString GetTitle() const; - -protected: - 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); - - void Init(); - - wxString m_title; - - wxFindReplaceDialogImpl *m_impl; - - DECLARE_DYNAMIC_CLASS(wxFindReplaceDialog) - DECLARE_NO_COPY_CLASS(wxFindReplaceDialog) -}; - -#endif // _WX_MSW_FDREPDLG_H_ diff --git a/wxWidgets/include/wx/msw/file1.ico b/wxWidgets/include/wx/msw/file1.ico deleted file mode 100644 index f0a80d32b447e303cff3b0c302f4a8e176bf5e4a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1718 zcmbW%KTO*|6vy!&{iD_kWreAWBUZ9QJBCbIAbX}tkytE&$<inTMXi)b85j{m)xnvv zps-mCiPV9~6UyXN49Q}#xKbsq-!rBvlt>k4?k>;o<4bsFTUyXFEiEZ)A6`lYJ}u=Z zRu`l;=T_}G`dj*fUNcJX$vxhh5`StoZzo1RDhxw~<50=>Z;BG5er(i^jOs(9(!j_K zjAVOvEH%!g+L2WDq+&(U1V6&}@EyE|uVT08oA`D78s5b(<5{=g$G7oyd<pMjbwkGs zFTC)oXo4T%d-x9C!&mWJGTOwi<Ja&mei@(OV|;`k;s^KuAK<(A2EK+b<BNEMH+X|L zc!M|i8;&u@8OITa$5F|Af{*bLeuy97?dk!#i*BH6=rX#<`V;&J-@|wC9=?j-!f)c& z@oRV&zl>+yejne)*YPF1JEuC5nczqG9=?P3@Ksl4i)wCC&2_4|Mm1fkxr|TnF+Rc% z@dJE-5Aa=l17E|J@kPAB8@$0AyullO58E|nyUy6IBeu(9yDAka!N>RrKg1940e;Ty zqX~Y5@8LUm4`0R4xqVnSQXk*O*YPF1i=S7Z$V~7fd=KBjQ)yG>AA7t&kxB3|KEe<2 z13bl<Q=rIjKhxXvI=w`9>GKM7eSNK~t1DezUh3lFLg(k_Iz2sA5Cl3tK32Ee)xp7m z8jXf_c6L;&)wI36t#Y}njg1Wzi$xU*1+A>CXmN2-$uFa?Cnr3|O`aFN*FH*oe>O4N zpJMFrPfP!5Hkr0?w#9LJ8~b@{<#C>EwWjy;yLp^l+iLCZKDgfblaFoIxr^`CcV>6r zpJg3CkF)&#G@ahYyEMm1jd8N|XIbd%6UO#>V#jg(eSbd-HJhc=>Fo2D^oPyb5`@p6 z&|h)Qn}_e&7j{X7+4$Jd<Q>a-_9UAa`Ix<D|9hYIZ2KgAv{nDfY-2k=7W;YL&gA#* j$9s9~A0B4TH#VQ{`6)k&ReetDkjC_+I^{JA-$}m#KFMzm diff --git a/wxWidgets/include/wx/msw/filedlg.h b/wxWidgets/include/wx/msw/filedlg.h deleted file mode 100644 index 8ca031b7e7..0000000000 --- a/wxWidgets/include/wx/msw/filedlg.h +++ /dev/null @@ -1,55 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/msw/filedlg.h -// Purpose: wxFileDialog class -// Author: Julian Smart -// Modified by: -// Created: 01/02/97 -// RCS-ID: $Id: filedlg.h 39402 2006-05-28 23:32:12Z VZ $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_FILEDLG_H_ -#define _WX_FILEDLG_H_ - -//------------------------------------------------------------------------- -// wxFileDialog -//------------------------------------------------------------------------- - -class WXDLLEXPORT wxFileDialog: public wxFileDialogBase -{ -public: - wxFileDialog(wxWindow *parent, - const wxString& message = wxFileSelectorPromptStr, - const wxString& defaultDir = wxEmptyString, - const wxString& defaultFile = wxEmptyString, - const wxString& wildCard = wxFileSelectorDefaultWildcardStr, - long style = wxFD_DEFAULT_STYLE, - const wxPoint& pos = wxDefaultPosition, - const wxSize& sz = wxDefaultSize, - const wxString& name = wxFileDialogNameStr); - - virtual void SetPath(const wxString& path); - virtual void GetPaths(wxArrayString& paths) const; - virtual void GetFilenames(wxArrayString& files) const; - - virtual int ShowModal(); - -protected: - -#if !(defined(__SMARTPHONE__) && defined(__WXWINCE__)) - virtual void DoMoveWindow(int x, int y, int width, int height); - virtual void DoGetSize( int *width, int *height ) const; - virtual void DoGetPosition( int *x, int *y ) const; -#endif // !(__SMARTPHONE__ && __WXWINCE__) - -private: - wxArrayString m_fileNames; - bool m_bMovedWindow; - - DECLARE_DYNAMIC_CLASS(wxFileDialog) - DECLARE_NO_COPY_CLASS(wxFileDialog) -}; - -#endif // _WX_FILEDLG_H_ - diff --git a/wxWidgets/include/wx/msw/floppy.ico b/wxWidgets/include/wx/msw/floppy.ico deleted file mode 100644 index 4453a7512cbcbfb063a86b41ffce5257471aa523..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1718 zcma*oKTH~77{~FStxcVbD^6XGxWbNcZ~zurke#V1iOV(Gvh;?=8u@bxgQMxtbT}p! zgBx*xq=VB<hM|GPnHYyAO?>-(53Y)p*ynie<+=OZd)#wyNK1O5wKXxW=<O>hDN(Oc zFKc5-YO-y^ZX@52*4fx%-_zkqyySV)fi-W{>-E$d_B8qNUE##2Gcsz1MwPx%wrk`B zMzYx&O4W0zd?MvtDP2%F#t-mqypMPBC2Wz*;WPLY-oYpE%-iYUoA?Soi+8ZPBk{ru zFT4sG;|KUQ-p9N6622&-96p0j;T?PeKf#aiA-<3A;sbnuZ{e%>GCq$_;|<>64c_1l z-r(<8hAihSCoC>YA@URa2p{76_%7bg9-v$3D!Po$qtnbk#t-mqypMPBC43Q|!)Nd* zyn|2RnYYuyH}MsG7Vj+Rj%3F80ltm*@h-mP$Q0>jj&5e?W{Pe)bTfgU;79ln-^X|H z0Y1RD@Kt;npU0>125;~NZ}0|h_&nUMA-C(C+jYY2a=BfFf;7R8@FBjB@8Sdeg0GLp z_yN9+_wg>igkSLWVct+3d=p>6XYmexQG-G=#t-mqypN~Tro@Fk-JsA+@FRSP@8i38 znzNumq2c>XHpvQ^B^`26gKlnabbWoTtE($rUS8_r;zDO<X9|Kqr>CcCwOTqnJXEz> z)!yEo%H^_lcXyS~=e4=HsdPH6WHPDs^>wYTu4?kz=-bz?{Ej_-FPzu@lsJDhu(lt? z*wy2x%|%_c{l<PHj{O?-!=RoI)!s2}9C!}+D{RSznyJ?j2eo>1@_*}t==l5n@dPt} z{Baub@yD~%-Pd&+=DwbSxNaOzqrrT(1s)&carSst{(Sj-&Oc|DqYLUq>!()U>_pz| ze2i?e&)NUIPe;@6{2lwo_x$OldGYoyvwG!roA@AY-|m?ATMx!hW?I|*c6&T>;H|BH c9UVnuTr>0Mt*B4@k=Q?zx%B8!@AdQf2hA97{Qv*} diff --git a/wxWidgets/include/wx/msw/folder1.ico b/wxWidgets/include/wx/msw/folder1.ico deleted file mode 100644 index 2994019d4cd76b48037c61fd65f87f4b9e587e58..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1718 zcmb8wF-+S)6vpw7HdQ+z)-ZK(#G33u89F3cnk8h<R4EdRw@j%jF(#4+M#NBcaHcFM zY!O2ubzt&@GQ~8l5QBw~7%K7l_k~hKu}aT8JJ0_4&VFYbX-zM*u_4z!ypjt1+PK@X zwI=o1x0UWA-V$qi!&<6v?CI8%_*1X9+OX!QCX<OK^NEtLUlb*#(ZbY^Or5EzIyQNs zNofRgse3H7_occol^Tj-{0u+D5AZ&|g>4cwd>LQFd-yz_en%sGAK$@O@g7#U1YUUI zg;zr{euf|72Y4Uf!Z&5A;mi0U-oxkd34Vc(@KgL4AL2uNfbZhl_&UCXH@x8uZ+OES z{+4CVa?G;N;<GfIPw)$TgrDNa__X&B9iY4DHoA^3(SMAe;fMGE-p9A_O?(Ys#uxD( zK98s0(Fotickorbmr)(bV*Ct0#1HU3zU9f9RI^4k%T%*SH9e}C$0zs&KEhA&V|<7Y z@d3VzZ{zFu65jBJH@x8uZ(I-4HD|hxnXY}N%V)Y84JpAd@DYBBALB!O#^a+HKf@34 z1H6xK;WHi|`i(Tg_wgNk74PA*3KUt4pW%o20iH@*iyM2oK#?W*1wO)0@nby2$tX}{ zJkLa*=nz%HBeDu~b#<lXa;dYkGo7BE>g41^M@L5r!%znY2MU5fdwYB8cDvf$-Br8Y z*3Qn3>h-#|x3^U)l~gDcw7I#d_4RcnKTV$x4|$J!yf2KKzDkVmHmuW2v2^vXcKNV@ zFE1``Zhm}!z5I55e(Cc2bd~=}V|V;FK93hJzdM(7m9M%=(^c+zcBwg^4zx<2&L3YN z+Fi)qjk&|wH@T_<pT3vRkB^k?ldIq3?`+NuG|3#U#~>VJPTYnyKizlsx$~5J=UOGl s<k8r^Pg^B-owonT@6WeudQAJPaAl(Zbn{nB>(t}_$8+OhjnZ>}0a(R=M*si- diff --git a/wxWidgets/include/wx/msw/folder2.ico b/wxWidgets/include/wx/msw/folder2.ico deleted file mode 100644 index 9a595b9feaa798bf30f5320782522fafee14ab86..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1718 zcmbW%KS/{~FSHN{Tis#BK}SF=YP9Fi=}60>J21YELZ3KZ;cC4mf%;!rwVrYsV- z;E+HEr<=s-&c@;&I3$ol!KdH5B>pLeLZ9=w_uhLy_g;M7yOS35Mk^~y;^SLsouifM ziH!xR!MTn29QmGH&^z|hHe;_xUE)vm`lMmcp?bZZdKW!K-@nO^Or5~g@J*GzDcdzU zo=I`GE~MItR6daMRViJNAL0l2Hol3k;!D^fnZsxBn|KGmif7(V2j9R~@L9Zr)dPta zUU=bEP>3Jk+xRBFiZ9`dGUf0Y{3hPPui_(ofcNozd>8NGJ$wsa!<X@Sd>U_f!yDf4 zhBy2J+XdSR+W}jZt&sQ#AK-m_AK%5tvwP?kx`r;J^XN45hxh@$jc?+s_!7Q|&*3xp zO}v9&#WQcGgKyv~_$=O;Qys}d`~cs^H}O?`$&nSQW{zrRsOBcsbg1SkKEelhAK%A! z@gCm8x9~N58K1|e@rF0N;SFzi<M*&!7cAEa%XPqVRave=L5lDJ-pBXxUA%{%^Y|#l z5Abb#6JN!b@N*s?=JnOVH}DmF7VqHa709;`Kft%~O+1yh693ri1@bMz2Y4Uf$9M4* zXHJ29<9Q|<WQEL<4mqzt_xJZ24u?8FKiApWnNCknb$om*&+~M6c&JvZrTzVV)oL~E z?d_>tE^BvpSNVKiTU%R7r_)+rU)S2&nwFQB75z4SJv!n&uJgWd-}qJH{z=0={wWsk z{t@oov$&PM{JOp#kAGebhd(YaZzT8jsT*>_bstB=Fi84W6HGVmU%OA;;PS>D-z8JU zqk-8S{TIP>PvLUEr`~ux>tDOmn2vLP7RkV@^GZ9Z0|SfGjK7hyeC}uCw2PE&DXHJz z-`P}hMeq4_FOKVcV>!W^Bn^8Glke>Ru2X6!j%}q_Of%Y15=woDV}~~G+jeR+0jbgC pf=6#Qy?(?GlTys}TFmMcxAmoIQj2<=)ax;)W1n!Jr!|VN`2*!3fW80# diff --git a/wxWidgets/include/wx/msw/font.h b/wxWidgets/include/wx/msw/font.h deleted file mode 100644 index fb4fab0fe9..0000000000 --- a/wxWidgets/include/wx/msw/font.h +++ /dev/null @@ -1,148 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/msw/font.h -// Purpose: wxFont class -// Author: Julian Smart -// Modified by: -// Created: 01/02/97 -// RCS-ID: $Id: font.h 39411 2006-05-29 00:03:36Z VZ $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_FONT_H_ -#define _WX_FONT_H_ - -#include "wx/gdicmn.h" - -// ---------------------------------------------------------------------------- -// wxFont -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxFont : public wxFontBase -{ -public: - // ctors and such - wxFont() { } - - wxFont(int size, - int family, - int style, - int weight, - bool underlined = false, - const wxString& face = wxEmptyString, - wxFontEncoding encoding = wxFONTENCODING_DEFAULT) - { - (void)Create(size, family, style, weight, underlined, face, encoding); - } - - wxFont(const wxSize& pixelSize, - int family, - int style, - int weight, - bool underlined = false, - const wxString& face = wxEmptyString, - wxFontEncoding encoding = wxFONTENCODING_DEFAULT) - { - (void)Create(pixelSize, family, style, weight, - underlined, face, encoding); - } - - wxFont(const wxNativeFontInfo& info, WXHFONT hFont = 0) - { - Create(info, hFont); - } - - 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) - { - return DoCreate(size, wxDefaultSize, false, family, style, - weight, underlined, face, encoding); - } - - bool Create(const wxSize& pixelSize, - int family, - int style, - int weight, - bool underlined = false, - const wxString& face = wxEmptyString, - wxFontEncoding encoding = wxFONTENCODING_DEFAULT) - { - return DoCreate(-1, pixelSize, true, family, style, - weight, underlined, face, encoding); - } - - bool Create(const wxNativeFontInfo& info, WXHFONT hFont = 0); - - virtual ~wxFont(); - - // wxFontBase overridden functions - virtual wxString GetNativeFontInfoDesc() const; - virtual wxString GetNativeFontInfoUserDesc() const; - - // implement base class pure virtuals - virtual int GetPointSize() const; - virtual wxSize GetPixelSize() const; - virtual bool IsUsingSizeInPixels() 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 SetPixelSize(const wxSize& pixelSize); - virtual void SetFamily(int family); - virtual void SetStyle(int style); - virtual void SetWeight(int weight); - virtual bool SetFaceName(const wxString& faceName); - virtual void SetUnderlined(bool underlined); - virtual void SetEncoding(wxFontEncoding encoding); - - virtual bool IsFixedWidth() const; - - // implementation only from now on - // ------------------------------- - - virtual bool IsFree() const; - virtual bool RealizeResource(); - virtual WXHANDLE GetResourceHandle() const; - virtual bool FreeResource(bool force = false); - - // for consistency with other wxMSW classes - WXHFONT GetHFONT() const; - - /* - virtual bool UseResource(); - virtual bool ReleaseResource(); - */ - -protected: - // real font creation function, used in all cases - bool DoCreate(int size, - const wxSize& pixelSize, - bool sizeUsingPixels, - int family, - int style, - int weight, - bool underlined = false, - const wxString& face = wxEmptyString, - wxFontEncoding encoding = wxFONTENCODING_DEFAULT); - - virtual void DoSetNativeFontInfo(const wxNativeFontInfo& info); - - void Unshare(); - -private: - DECLARE_DYNAMIC_CLASS(wxFont) -}; - -#endif // _WX_FONT_H_ diff --git a/wxWidgets/include/wx/msw/fontdlg.h b/wxWidgets/include/wx/msw/fontdlg.h deleted file mode 100644 index 5892d2e60e..0000000000 --- a/wxWidgets/include/wx/msw/fontdlg.h +++ /dev/null @@ -1,46 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/msw/fontdlg.h -// Purpose: wxFontDialog class -// Author: Julian Smart -// Modified by: -// Created: 01/02/97 -// RCS-ID: $Id: fontdlg.h 38448 2006-03-30 14:04:17Z ABX $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_MSW_FONTDLG_H_ -#define _WX_MSW_FONTDLG_H_ - -// ---------------------------------------------------------------------------- -// wxFontDialog -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxFontDialog : public wxFontDialogBase -{ -public: - wxFontDialog() : wxFontDialogBase() { /* must be Create()d later */ } - wxFontDialog(wxWindow *parent) - : wxFontDialogBase(parent) { Create(parent); } - wxFontDialog(wxWindow *parent, const wxFontData& data) - : wxFontDialogBase(parent, data) { Create(parent, data); } - - virtual int ShowModal(); - -#if WXWIN_COMPATIBILITY_2_6 - // deprecated interface, don't use - wxDEPRECATED( wxFontDialog(wxWindow *parent, const wxFontData *data) ); -#endif // WXWIN_COMPATIBILITY_2_6 - -protected: - DECLARE_DYNAMIC_CLASS_NO_COPY(wxFontDialog) -}; - -#if WXWIN_COMPATIBILITY_2_6 - // deprecated interface, don't use -inline wxFontDialog::wxFontDialog(wxWindow *parent, const wxFontData *data) - : wxFontDialogBase(parent) { InitFontData(data); Create(parent); } -#endif // WXWIN_COMPATIBILITY_2_6 - -#endif - // _WX_MSW_FONTDLG_H_ diff --git a/wxWidgets/include/wx/msw/fontenum.h b/wxWidgets/include/wx/msw/fontenum.h deleted file mode 100644 index c43ae2cac1..0000000000 --- a/wxWidgets/include/wx/msw/fontenum.h +++ /dev/null @@ -1,40 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/msw/fontenum.h -// Purpose: wxFontEnumerator class for Windows -// Author: Julian Smart -// Modified by: -// Created: 04/01/98 -// RCS-ID: $Id: fontenum.h 39461 2006-05-29 21:12:51Z ABX $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_FONTENUM_MSW_H_ -#define _WX_FONTENUM_MSW_H_ - -/* - * wxFontEnumerator: for gathering font information - */ - -class wxFontEnumerator: public wxObject -{ -DECLARE_CLASS(wxFontEnumerator) -public: - wxFontEnumerator() {} - - // Enumerate the fonts. - bool Enumerate(); - - // Stop enumeration if false is returned. - // By default, the enumerator stores the facenames in a list for - // retrieval via GetFacenames(). - virtual bool OnFont(const wxFont& font); - - // Return the list of facenames. - wxStringList& GetFacenames() { return (wxStringList&) m_faceNames; } -protected: - wxStringList m_faceNames; -}; - -#endif - // _WX_FONTENUM_MSW_H_ diff --git a/wxWidgets/include/wx/msw/frame.h b/wxWidgets/include/wx/msw/frame.h deleted file mode 100644 index 6139e5a297..0000000000 --- a/wxWidgets/include/wx/msw/frame.h +++ /dev/null @@ -1,172 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/msw/frame.h -// Purpose: wxFrame class -// Author: Julian Smart -// Modified by: -// Created: 01/02/97 -// RCS-ID: $Id: frame.h 45498 2007-04-16 13:03:05Z VZ $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_FRAME_H_ -#define _WX_FRAME_H_ - -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(); - - // implement base class pure virtuals - virtual bool ShowFullScreen(bool show, long style = wxFULLSCREEN_ALL); - virtual void Raise(); - - // implementation only from now on - // ------------------------------- - - // event handlers - void OnSysColourChanged(wxSysColourChangedEvent& event); - - // Toolbar -#if wxUSE_TOOLBAR - virtual wxToolBar* CreateToolBar(long style = -1, - wxWindowID id = wxID_ANY, - const wxString& name = wxToolBarNameStr); -#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); - - // Hint to tell framework which status bar to use: the default is to use - // native one for the platforms which support it (Win32), the generic one - // otherwise - - // TODO: should this go into a wxFrameworkSettings class perhaps? - static void UseNativeStatusBar(bool useNative) - { m_useNativeStatusBar = useNative; } - static bool UsesNativeStatusBar() - { return m_useNativeStatusBar; } -#endif // wxUSE_STATUSBAR - -#if wxUSE_MENUS - WXHMENU GetWinMenu() const { return m_hMenu; } -#endif // wxUSE_MENUS - - // event handlers - bool HandlePaint(); - bool HandleSize(int x, int y, WXUINT flag); - bool HandleCommand(WXWORD id, WXWORD cmd, WXHWND control); - bool HandleMenuSelect(WXWORD nItem, WXWORD nFlags, WXHMENU hMenu); - bool HandleMenuLoop(const wxEventType& evtType, WXWORD isPopup); - - // tooltip management -#if wxUSE_TOOLTIPS - WXHWND GetToolTipCtrl() const { return m_hwndToolTip; } - void SetToolTipCtrl(WXHWND hwndTT) { m_hwndToolTip = hwndTT; } -#endif // tooltips - - // a MSW only function which sends a size event to the window using its - // current size - this has an effect of refreshing the window layout - virtual void SendSizeEvent(); - - virtual wxPoint GetClientAreaOrigin() const; - - // override base class version to add menu bar accel processing - virtual bool MSWTranslateMessage(WXMSG *msg) - { - return MSWDoTranslateMessage(this, msg); - } - - // window proc for the frames - virtual WXLRESULT MSWWindowProc(WXUINT message, - WXWPARAM wParam, - WXLPARAM lParam); - -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); - -#if wxUSE_MENUS_NATIVE - // perform MSW-specific action when menubar is changed - virtual void AttachMenuBar(wxMenuBar *menubar); - - // a plug in for MDI frame classes which need to do something special when - // the menubar is set - virtual void InternalSetMenuBar(); -#endif // wxUSE_MENUS_NATIVE - - // propagate our state change to all child frames - void IconizeChildFrames(bool bIconize); - - // the real implementation of MSWTranslateMessage(), also used by - // wxMDIChildFrame - bool MSWDoTranslateMessage(wxFrame *frame, WXMSG *msg); - - // handle WM_INITMENUPOPUP message to generate wxEVT_MENU_OPEN - bool HandleInitMenuPopup(WXHMENU hMenu); - - virtual bool IsMDIChild() const { return false; } - - // get default (wxWidgets) icon for the frame - virtual WXHICON GetDefaultIcon() const; - -#if wxUSE_TOOLBAR - virtual void PositionToolBar(); -#endif // wxUSE_TOOLBAR - -#if wxUSE_STATUSBAR - virtual void PositionStatusBar(); - - static bool m_useNativeStatusBar; -#endif // wxUSE_STATUSBAR - -#if wxUSE_MENUS - // frame menu, NULL if none - WXHMENU m_hMenu; -#endif // wxUSE_MENUS - -private: -#if wxUSE_TOOLTIPS - WXHWND m_hwndToolTip; -#endif // tooltips - - // used by IconizeChildFrames(), see comments there - bool m_wasMinimized; - - DECLARE_EVENT_TABLE() - DECLARE_DYNAMIC_CLASS_NO_COPY(wxFrame) -}; - -#endif - // _WX_FRAME_H_ diff --git a/wxWidgets/include/wx/msw/gauge95.h b/wxWidgets/include/wx/msw/gauge95.h deleted file mode 100644 index c6c74df206..0000000000 --- a/wxWidgets/include/wx/msw/gauge95.h +++ /dev/null @@ -1,70 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: gauge95.h -// Purpose: wxGauge95 class -// Author: Julian Smart -// Modified by: -// Created: 01/02/97 -// RCS-ID: $Id: gauge95.h 43881 2006-12-09 19:48:21Z PC $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _GAUGE95_H_ -#define _GAUGE95_H_ - -#if wxUSE_GAUGE - -extern WXDLLEXPORT_DATA(const wxChar) wxGaugeNameStr[]; - -// Group box -class WXDLLEXPORT wxGauge95 : public wxGaugeBase -{ -public: - wxGauge95() { } - - wxGauge95(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)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); - - // set gauge range/value - virtual void SetRange(int range); - virtual void SetValue(int pos); - - // overriden base class virtuals - virtual bool SetForegroundColour(const wxColour& col); - virtual bool SetBackgroundColour(const wxColour& col); - - - void SetIndeterminateMode(); - void SetDeterminateMode(); - void Pulse(); - - WXDWORD MSWGetStyle(long style, WXDWORD *exstyle) const; - -protected: - virtual wxSize DoGetBestSize() const; - - DECLARE_DYNAMIC_CLASS_NO_COPY(wxGauge95) -}; - -#endif // wxUSE_GAUGE - -#endif - // _GAUGEMSW_H_ diff --git a/wxWidgets/include/wx/msw/gccpriv.h b/wxWidgets/include/wx/msw/gccpriv.h deleted file mode 100644 index db4c72a84d..0000000000 --- a/wxWidgets/include/wx/msw/gccpriv.h +++ /dev/null @@ -1,127 +0,0 @@ -/* - Name: wx/msw/gccpriv.h - Purpose: MinGW/Cygwin definitions - Author: Vadim Zeitlin - Modified by: - Created: - RCS-ID: $Id: gccpriv.h 36155 2005-11-10 16:16:05Z ABX $ - Copyright: (c) Vadim Zeitlin - Licence: wxWindows Licence -*/ - -/* THIS IS A C FILE, DON'T USE C++ FEATURES (IN PARTICULAR COMMENTS) IN IT */ - -#ifndef _WX_MSW_GCCPRIV_H_ -#define _WX_MSW_GCCPRIV_H_ - -#if defined(__MINGW32__) && !defined(__GNUWIN32__) - #define __GNUWIN32__ -#endif - -#if defined(__MINGW32__) && ( ( __GNUC__ > 2 ) || ( ( __GNUC__ == 2 ) && ( __GNUC_MINOR__ >= 95 ) ) ) - #include <_mingw.h> -#endif - -#if defined( __MINGW32__ ) && !defined(__WINE__) && !defined( HAVE_W32API_H ) - #if __MINGW32_MAJOR_VERSION >= 1 - #define HAVE_W32API_H - #endif -#elif defined( __CYGWIN__ ) && !defined( HAVE_W32API_H ) - #if ( __GNUC__ > 2 ) - #define HAVE_W32API_H - #endif -#endif - -#if wxCHECK_WATCOM_VERSION(1,0) - #define HAVE_W32API_H -#endif - -/* check for MinGW/Cygwin w32api version ( releases >= 0.5, only ) */ -#if defined( HAVE_W32API_H ) -#include <w32api.h> -#endif - -/* Watcom can't handle defined(xxx) here: */ -#if defined(__W32API_MAJOR_VERSION) && defined(__W32API_MINOR_VERSION) - #define wxCHECK_W32API_VERSION( major, minor ) \ - ( ( ( __W32API_MAJOR_VERSION > (major) ) \ - || ( __W32API_MAJOR_VERSION == (major) && __W32API_MINOR_VERSION >= (minor) ) ) ) -#else - #define wxCHECK_W32API_VERSION( major, minor ) (0) -#endif - -/* Cygwin / Mingw32 with gcc >= 2.95 use new windows headers which - are more ms-like (header author is Anders Norlander, hence the name) */ -#if (defined(__MINGW32__) || defined(__CYGWIN__) || defined(__WINE__)) && ((__GNUC__>2) || ((__GNUC__==2) && (__GNUC_MINOR__>=95))) - #ifndef wxUSE_NORLANDER_HEADERS - #define wxUSE_NORLANDER_HEADERS 1 - #endif -#else - #ifndef wxUSE_NORLANDER_HEADERS - #define wxUSE_NORLANDER_HEADERS 0 - #endif -#endif - -/* "old" GNUWIN32 is the one without Norlander's headers: it lacks the - standard Win32 headers and we define the used stuff ourselves for it - in wx/msw/gnuwin32/extra.h */ -#if defined(__GNUC__) && !wxUSE_NORLANDER_HEADERS - #define __GNUWIN32_OLD__ -#endif - -/* Cygwin 1.0 */ -#if defined(__CYGWIN__) && ((__GNUC__==2) && (__GNUC_MINOR__==9)) - #define __CYGWIN10__ -#endif - -/* Check for Mingw runtime version: */ -#if defined(__MINGW32_MAJOR_VERSION) && defined(__MINGW32_MINOR_VERSION) - #define wxCHECK_MINGW32_VERSION( major, minor ) \ - ( ( ( __MINGW32_MAJOR_VERSION > (major) ) \ - || ( __MINGW32_MAJOR_VERSION == (major) && __MINGW32_MINOR_VERSION >= (minor) ) ) ) -#else - #define wxCHECK_MINGW32_VERSION( major, minor ) (0) -#endif - -/* Mingw runtime 1.0-20010604 has some missing _tXXXX functions, - so let's define them ourselves: */ -#if defined(__GNUWIN32__) && wxCHECK_W32API_VERSION( 1, 0 ) \ - && !wxCHECK_W32API_VERSION( 1, 1 ) - #ifndef _tsetlocale - #if wxUSE_UNICODE - #define _tsetlocale _wsetlocale - #else - #define _tsetlocale setlocale - #endif - #endif - #ifndef _tgetenv - #if wxUSE_UNICODE - #define _tgetenv _wgetenv - #else - #define _tgetenv getenv - #endif - #endif - #ifndef _tfopen - #if wxUSE_UNICODE - #define _tfopen _wfopen - #else - #define _tfopen fopen - #endif - #endif -#endif - -/* current (= before mingw-runtime 3.3) mingw32 headers forget to - define _puttchar, this will probably be fixed in the next versions but - for now do it ourselves - */ -#if defined( __MINGW32__ ) && \ - !wxCHECK_MINGW32_VERSION(3,3) && !defined( _puttchar ) - #ifdef wxUSE_UNICODE - #define _puttchar putwchar - #else - #define _puttchar puttchar - #endif -#endif - -#endif - /* _WX_MSW_GCCPRIV_H_ */ diff --git a/wxWidgets/include/wx/msw/gdiimage.h b/wxWidgets/include/wx/msw/gdiimage.h deleted file mode 100644 index 87582e104c..0000000000 --- a/wxWidgets/include/wx/msw/gdiimage.h +++ /dev/null @@ -1,189 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: include/wx/msw/gdiimage.h -// Purpose: wxGDIImage class: base class for wxBitmap, wxIcon, wxCursor -// under MSW -// Author: Vadim Zeitlin -// Modified by: -// Created: 20.11.99 -// RCS-ID: $Id: gdiimage.h 53135 2008-04-12 02:31:04Z VZ $ -// Copyright: (c) 1999 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr> -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -// NB: this is a private header, it is not intended to be directly included by -// user code (but may be included from other, public, wxWin headers - -#ifndef _WX_MSW_GDIIMAGE_H_ -#define _WX_MSW_GDIIMAGE_H_ - -#include "wx/gdiobj.h" // base class -#include "wx/gdicmn.h" // wxBITMAP_TYPE_INVALID -#include "wx/list.h" - -class WXDLLIMPEXP_FWD_CORE wxGDIImageRefData; -class WXDLLIMPEXP_FWD_CORE wxGDIImageHandler; -class WXDLLIMPEXP_FWD_CORE wxGDIImage; - -WX_DECLARE_EXPORTED_LIST(wxGDIImageHandler, wxGDIImageHandlerList); - -// ---------------------------------------------------------------------------- -// wxGDIImageRefData: common data fields for all derived classes -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxGDIImageRefData : public wxGDIRefData -{ -public: - wxGDIImageRefData() - { - m_width = m_height = m_depth = 0; - - m_handle = 0; - } - - wxGDIImageRefData(const wxGDIImageRefData& data) : wxGDIRefData(data) - { - m_width = data.m_width; - m_height = data.m_height; - m_depth = data.m_depth; - - // can't copy handles like this, derived class copy ctor must do it! - m_handle = NULL; - } - - // accessors - bool IsOk() const { return m_handle != 0; } - - void SetSize(int w, int h) { m_width = w; m_height = h; } - - // free the ressources we allocated - virtual void Free() = 0; - - // for compatibility, the member fields are public - - // the size of the image - int m_width, m_height; - - // the depth of the image - int m_depth; - - // the handle to it - union - { - WXHANDLE m_handle; // for untyped access - WXHBITMAP m_hBitmap; - WXHICON m_hIcon; - WXHCURSOR m_hCursor; - }; -}; - -// ---------------------------------------------------------------------------- -// wxGDIImageHandler: a class which knows how to load/save wxGDIImages. -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxGDIImageHandler : public wxObject -{ -public: - // ctor - wxGDIImageHandler() { m_type = wxBITMAP_TYPE_INVALID; } - wxGDIImageHandler(const wxString& name, - const wxString& ext, - long type) - : m_name(name), m_extension(ext) - { - m_type = type; - } - - // accessors - void SetName(const wxString& name) { m_name = name; } - void SetExtension(const wxString& ext) { m_extension = ext; } - void SetType(long type) { m_type = type; } - - const wxString& GetName() const { return m_name; } - const wxString& GetExtension() const { return m_extension; } - long GetType() const { return m_type; } - - // real handler operations: to implement in derived classes - virtual bool Create(wxGDIImage *image, - const void* data, - long flags, - int width, int height, int depth = 1) = 0; - virtual bool Load(wxGDIImage *image, - const wxString& name, - long flags, - int desiredWidth, int desiredHeight) = 0; - virtual bool Save(wxGDIImage *image, - const wxString& name, - int type) = 0; - -protected: - wxString m_name; - wxString m_extension; - long m_type; -}; - -// ---------------------------------------------------------------------------- -// wxGDIImage: this class supports GDI image handlers which may be registered -// dynamically and will be used for loading/saving the images in the specified -// format. It also falls back to wxImage if no appropriate image is found. -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxGDIImage : public wxGDIObject -{ -public: - // handlers list interface - static wxGDIImageHandlerList& GetHandlers() { return ms_handlers; } - - static void AddHandler(wxGDIImageHandler *handler); - static void InsertHandler(wxGDIImageHandler *handler); - static bool RemoveHandler(const wxString& name); - - static wxGDIImageHandler *FindHandler(const wxString& name); - static wxGDIImageHandler *FindHandler(const wxString& extension, long type); - static wxGDIImageHandler *FindHandler(long type); - - static void InitStandardHandlers(); - static void CleanUpHandlers(); - - // access to the ref data casted to the right type - wxGDIImageRefData *GetGDIImageData() const - { return (wxGDIImageRefData *)m_refData; } - - // accessors - WXHANDLE GetHandle() const - { return IsNull() ? 0 : GetGDIImageData()->m_handle; } - void SetHandle(WXHANDLE handle) - { AllocExclusive(); GetGDIImageData()->m_handle = handle; } - - bool Ok() const { return IsOk(); } - bool IsOk() const { return GetHandle() != 0; } - - int GetWidth() const { return IsNull() ? 0 : GetGDIImageData()->m_width; } - int GetHeight() const { return IsNull() ? 0 : GetGDIImageData()->m_height; } - int GetDepth() const { return IsNull() ? 0 : GetGDIImageData()->m_depth; } - - void SetWidth(int w) { AllocExclusive(); GetGDIImageData()->m_width = w; } - void SetHeight(int h) { AllocExclusive(); GetGDIImageData()->m_height = h; } - void SetDepth(int d) { AllocExclusive(); GetGDIImageData()->m_depth = d; } - - void SetSize(int w, int h) - { - AllocExclusive(); - GetGDIImageData()->SetSize(w, h); - } - void SetSize(const wxSize& size) { SetSize(size.x, size.y); } - - // forward some of base class virtuals to wxGDIImageRefData - bool FreeResource(bool force = false); - virtual WXHANDLE GetResourceHandle() const; - -protected: - // create the data for the derived class here - virtual wxGDIImageRefData *CreateData() const = 0; - - // implement the wxObject method in terms of our, more specific, one - virtual wxObjectRefData *CreateRefData() const { return CreateData(); } - - static wxGDIImageHandlerList ms_handlers; -}; - -#endif // _WX_MSW_GDIIMAGE_H_ diff --git a/wxWidgets/include/wx/msw/genrcdefs.h b/wxWidgets/include/wx/msw/genrcdefs.h deleted file mode 100644 index 3608ccb7cc..0000000000 --- a/wxWidgets/include/wx/msw/genrcdefs.h +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Name: wx/msw/genrcdefs.h - * Purpose: Emit preprocessor symbols into rcdefs.h for resource compiler - * Author: Mike Wetherell - * RCS-ID: $Id: genrcdefs.h 36133 2005-11-08 22:49:46Z MW $ - * Copyright: (c) 2005 Mike Wetherell - * Licence: wxWindows licence - */ - -#define EMIT(line) line - -EMIT(#ifndef _WX_RCDEFS_H) -EMIT(#define _WX_RCDEFS_H) - -#ifdef _MSC_FULL_VER -EMIT(#define WX_MSC_FULL_VER _MSC_FULL_VER) -#endif - -#ifdef _M_AMD64 -EMIT(#define WX_CPU_AMD64) -#endif - -#ifdef _M_ARM -EMIT(#define WX_CPU_ARM) -#endif - -#ifdef _M_IA64 -EMIT(#define WX_CPU_IA64) -#endif - -#if defined _M_IX86 || defined _X86_ -EMIT(#define WX_CPU_X86) -#endif - -#ifdef _M_PPC -EMIT(#define WX_CPU_PPC) -#endif - -#ifdef _M_SH -EMIT(#define WX_CPU_SH) -#endif - -EMIT(#endif) diff --git a/wxWidgets/include/wx/msw/glcanvas.h b/wxWidgets/include/wx/msw/glcanvas.h deleted file mode 100644 index 1204fd4057..0000000000 --- a/wxWidgets/include/wx/msw/glcanvas.h +++ /dev/null @@ -1,128 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/msw/glcanvas.h -// Purpose: wxGLCanvas, for using OpenGL with wxWidgets under Windows -// Author: Julian Smart -// Modified by: -// Created: 04/01/98 -// RCS-ID: $Id: glcanvas.h 53135 2008-04-12 02:31:04Z VZ $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_GLCANVAS_H_ -#define _WX_GLCANVAS_H_ - -#include "wx/palette.h" -#include "wx/scrolwin.h" - -#include "wx/msw/wrapwin.h" - -#include <GL/gl.h> - -class WXDLLIMPEXP_FWD_GL wxGLCanvas; /* forward reference */ - -class WXDLLIMPEXP_GL wxGLContext: public wxObject -{ -public: - wxGLContext(wxGLCanvas *win, const wxGLContext* other=NULL /* for sharing display lists */ ); - virtual ~wxGLContext(); - - void SetCurrent(const wxGLCanvas& win) const; - inline HGLRC GetGLRC() const { return m_glContext; } - -protected: - HGLRC m_glContext; - -private: - DECLARE_CLASS(wxGLContext) -}; - -class WXDLLIMPEXP_GL wxGLCanvas: public wxWindow -{ -public: - // This ctor is identical to the next, except for the fact that it - // doesn't create an implicit wxGLContext. - // The attribList parameter has been moved to avoid overload clashes. - wxGLCanvas(wxWindow *parent, wxWindowID id = wxID_ANY, - int* attribList = 0, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, long style = 0, - const wxString& name = wxGLCanvasName, - const wxPalette& palette = wxNullPalette); - - wxGLCanvas(wxWindow *parent, wxWindowID id = wxID_ANY, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, long style = 0, - const wxString& name = wxGLCanvasName, int *attribList = 0, - const wxPalette& palette = wxNullPalette); - - wxGLCanvas(wxWindow *parent, - const wxGLContext *shared, - wxWindowID id = wxID_ANY, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = 0, - const wxString& name = wxGLCanvasName, - int *attribList = (int *) NULL, - const wxPalette& palette = wxNullPalette); - - wxGLCanvas(wxWindow *parent, - const wxGLCanvas *shared, - wxWindowID id = wxID_ANY, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = 0, - const wxString& name = wxGLCanvasName, - int *attribList = 0, - const wxPalette& palette = wxNullPalette); - - virtual ~wxGLCanvas(); - - // Replaces wxWindow::Create functionality, since - // we need to use a different window class - bool Create(wxWindow *parent, wxWindowID id, - const wxPoint& pos, const wxSize& size, - long style, const wxString& name); - - void SetCurrent(const wxGLContext& RC) const; - void SetCurrent(); - -#ifdef __WXUNIVERSAL__ - virtual bool SetCurrent(bool doit) { return wxWindow::SetCurrent(doit); }; -#endif - - void SetColour(const wxChar *colour); - - void SwapBuffers(); - - void OnSize(wxSizeEvent& event); - - void OnQueryNewPalette(wxQueryNewPaletteEvent& event); - - void OnPaletteChanged(wxPaletteChangedEvent& event); - - inline wxGLContext* GetContext() const { return m_glContext; } - - inline WXHDC GetHDC() const { return m_hDC; } - - void SetupPixelFormat(int *attribList = (int *) NULL); - - void SetupPalette(const wxPalette& palette); - - wxPalette CreateDefaultPalette(); - - inline wxPalette* GetPalette() const { return (wxPalette *) &m_palette; } - -protected: - wxGLContext* m_glContext; // this is typedef-ed ptr, in fact - wxPalette m_palette; - WXHDC m_hDC; - -private: - DECLARE_EVENT_TABLE() - DECLARE_CLASS(wxGLCanvas) -}; - -#endif - // _WX_GLCANVAS_H_ - diff --git a/wxWidgets/include/wx/msw/gsockmsw.h b/wxWidgets/include/wx/msw/gsockmsw.h deleted file mode 100644 index 6b5149ebbc..0000000000 --- a/wxWidgets/include/wx/msw/gsockmsw.h +++ /dev/null @@ -1,145 +0,0 @@ -/* ------------------------------------------------------------------------- - * Project: GSocket (Generic Socket) for WX - * Name: gsockmsw.h - * Copyright: (c) Guilhem Lavaux - * Licence: wxWindows Licence - * Purpose: GSocket MSW header - * CVSID: $Id: gsockmsw.h 33948 2005-05-04 18:57:50Z JS $ - * ------------------------------------------------------------------------- - */ - -#ifndef __GSOCK_MSW_H -#define __GSOCK_MSW_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 - -#include "wx/msw/wrapwin.h" - -#if defined(__CYGWIN__) - //CYGWIN gives annoying warning about runtime stuff if we don't do this -# define USE_SYS_TYPES_FD_SET -# include <sys/types.h> -#endif - -#if defined(__WXWINCE__) || defined(__CYGWIN__) -#include <winsock.h> -#endif - -class GSocketGUIFunctionsTableConcrete: public GSocketGUIFunctionsTable -{ -public: - virtual bool OnInit(); - virtual void OnExit(); - virtual bool CanUseEventLoop(); - virtual bool Init_Socket(GSocket *socket); - virtual void Destroy_Socket(GSocket *socket); - virtual void Enable_Events(GSocket *socket); - virtual void Disable_Events(GSocket *socket); -}; - -/* Definition of GSocket */ -class GSocket -{ -public: - GSocket(); - ~GSocket(); - bool IsOk() { return m_ok; } - void Close(); - void Shutdown(); - GSocketError SetLocal(GAddress *address); - GSocketError SetPeer(GAddress *address); - GAddress *GetLocal(); - GAddress *GetPeer(); - GSocketError SetServer(); - GSocket *WaitConnection(); - bool SetReusable(); - GSocketError Connect(GSocketStream stream); - GSocketError SetNonOriented(); - int Read(char *buffer, int size); - int Write(const char *buffer, int size); - GSocketEventFlags Select(GSocketEventFlags flags); - void SetNonBlocking(bool non_block); - void SetTimeout(unsigned long millis); - GSocketError WXDLLIMPEXP_NET GetError(); - void SetCallback(GSocketEventFlags flags, - GSocketCallback callback, char *cdata); - void UnsetCallback(GSocketEventFlags flags); - GSocketError GetSockOpt(int level, int optname, - void *optval, int *optlen); - GSocketError SetSockOpt(int level, int optname, - const void *optval, int optlen); -protected: - GSocketError Input_Timeout(); - GSocketError Output_Timeout(); - GSocketError Connect_Timeout(); - int Recv_Stream(char *buffer, int size); - int Recv_Dgram(char *buffer, int size); - int Send_Stream(const char *buffer, int size); - int Send_Dgram(const char *buffer, int size); - bool m_ok; - -/* TODO: Make these protected */ -public: - SOCKET m_fd; - GAddress *m_local; - GAddress *m_peer; - GSocketError m_error; - - /* Attributes */ - bool m_non_blocking; - bool m_server; - bool m_stream; - bool m_establishing; - bool m_reusable; - struct timeval m_timeout; - - /* Callbacks */ - GSocketEventFlags m_detected; - GSocketCallback m_cbacks[GSOCK_MAX_EVENT]; - char *m_data[GSOCK_MAX_EVENT]; - int m_msgnumber; -}; - -#ifdef __cplusplus -extern "C" { -#endif - -/* Definition of GAddress */ -struct _GAddress -{ - struct sockaddr *m_addr; - size_t m_len; - - GAddressType m_family; - int m_realfamily; - - GSocketError m_error; -}; - - -/* GAddress */ - -GSocketError _GAddress_translate_from(GAddress *address, - struct sockaddr *addr, int len); -GSocketError _GAddress_translate_to (GAddress *address, - struct sockaddr **addr, int *len); -GSocketError _GAddress_Init_INET(GAddress *address); -GSocketError _GAddress_Init_UNIX(GAddress *address); - -#ifdef __cplusplus -} -#endif - -#endif /* wxUSE_SOCKETS || defined(__GSOCKET_STANDALONE__) */ - -#endif /* __GSOCK_MSW_H */ diff --git a/wxWidgets/include/wx/msw/hand.cur b/wxWidgets/include/wx/msw/hand.cur deleted file mode 100644 index e5a1fe7c2f5dd90249a5d60c1efe667188abd494..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 326 zcmaLRp$@_@5XSMZASMtvLNdW55|1d4f<*8R-J><x!^}(|5rpI4ZlpDE&98UYrk6@9 zIdz@1k#us>j(h}1y1=n=ENO1aZf2$VR{kOR=PZ!3mt>Vdo%m$JT{@$^;ksa8i~S#5 j@rM$zG3%2xKdU)=t1#-UC)Xl<<Xzn2fB?o1Ka6G{)sc5s diff --git a/wxWidgets/include/wx/msw/helpbest.h b/wxWidgets/include/wx/msw/helpbest.h deleted file mode 100644 index 551fe8bbed..0000000000 --- a/wxWidgets/include/wx/msw/helpbest.h +++ /dev/null @@ -1,129 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/msw/helpbest.h -// Purpose: Tries to load MS HTML Help, falls back to wxHTML upon failure -// Author: Mattia Barbon -// Modified by: -// Created: 02/04/2001 -// RCS-ID: $Id: helpbest.h 39440 2006-05-29 14:51:42Z VZ $ -// Copyright: (c) Mattia Barbon -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_HELPBEST_H_ -#define _WX_HELPBEST_H_ - -#if wxUSE_HELP && wxUSE_MS_HTML_HELP \ - && wxUSE_WXHTML_HELP && !defined(__WXUNIVERSAL__) - -#include "wx/helpbase.h" -#include "wx/html/helpfrm.h" // for wxHF_DEFAULT_STYLE - -class WXDLLIMPEXP_HTML wxBestHelpController: public wxHelpControllerBase -{ -public: - wxBestHelpController(wxWindow* parentWindow = NULL, - int style = wxHF_DEFAULT_STYLE) - : wxHelpControllerBase(parentWindow), - m_helpControllerType(wxUseNone), - m_helpController(NULL), - m_style(style) - { - } - - virtual ~wxBestHelpController() { delete m_helpController; } - - // Must call this to set the filename - virtual bool Initialize(const wxString& file); - virtual bool Initialize(const wxString& file, int WXUNUSED(server) ) { return Initialize( file ); } - - // If file is "", reloads file given in Initialize - virtual bool LoadFile(const wxString& file = wxEmptyString) - { - return m_helpController->LoadFile( GetValidFilename( file ) ); - } - - virtual bool DisplayContents() - { - return m_helpController->DisplayContents(); - } - - virtual bool DisplaySection(int sectionNo) - { - return m_helpController->DisplaySection( sectionNo ); - } - - virtual bool DisplaySection(const wxString& section) - { - return m_helpController->DisplaySection( section ); - } - - virtual bool DisplayBlock(long blockNo) - { - return m_helpController->DisplayBlock( blockNo ); - } - - virtual bool DisplayContextPopup(int contextId) - { - return m_helpController->DisplayContextPopup( contextId ); - } - - virtual bool DisplayTextPopup(const wxString& text, const wxPoint& pos) - { - return m_helpController->DisplayTextPopup( text, pos ); - } - - virtual bool KeywordSearch(const wxString& k, - wxHelpSearchMode mode = wxHELP_SEARCH_ALL) - { - return m_helpController->KeywordSearch( k, mode ); - } - - virtual bool Quit() - { - return m_helpController->Quit(); - } - - // Allows one to override the default settings for the help frame. - virtual void SetFrameParameters(const wxString& title, - const wxSize& size, - const wxPoint& pos = wxDefaultPosition, - bool newFrameEachTime = false) - { - m_helpController->SetFrameParameters( title, size, pos, - newFrameEachTime ); - } - - // Obtains the latest settings used by the help frame and the help frame. - virtual wxFrame *GetFrameParameters(wxSize *size = NULL, - wxPoint *pos = NULL, - bool *newFrameEachTime = NULL) - { - return m_helpController->GetFrameParameters( size, pos, - newFrameEachTime ); - } - - /// Set the window that can optionally be used for the help window's parent. - virtual void SetParentWindow(wxWindow* win) { m_helpController->SetParentWindow(win); } - - /// Get the window that can optionally be used for the help window's parent. - virtual wxWindow* GetParentWindow() const { return m_helpController->GetParentWindow(); } - -protected: - // Append/change extension if necessary. - wxString GetValidFilename(const wxString& file) const; - -protected: - enum HelpControllerType { wxUseNone, wxUseHtmlHelp, wxUseChmHelp }; - - HelpControllerType m_helpControllerType; - wxHelpControllerBase* m_helpController; - int m_style; - - DECLARE_DYNAMIC_CLASS(wxBestHelpController) - DECLARE_NO_COPY_CLASS(wxBestHelpController) -}; - -#endif // wxUSE_HELP && wxUSE_MS_HTML_HELP && wxUSE_WXHTML_HELP - -#endif - // _WX_HELPBEST_H_ diff --git a/wxWidgets/include/wx/msw/helpchm.h b/wxWidgets/include/wx/msw/helpchm.h deleted file mode 100644 index c057232c54..0000000000 --- a/wxWidgets/include/wx/msw/helpchm.h +++ /dev/null @@ -1,60 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: helpchm.h -// Purpose: Help system: MS HTML Help implementation -// Author: Julian Smart -// Modified by: -// Created: 16/04/2000 -// RCS-ID: $Id: helpchm.h 39725 2006-06-14 17:46:51Z VZ $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_HELPCHM_H_ -#define _WX_HELPCHM_H_ - -#if wxUSE_MS_HTML_HELP - -#include "wx/helpbase.h" - -class WXDLLEXPORT wxCHMHelpController : public wxHelpControllerBase -{ -public: - wxCHMHelpController(wxWindow* parentWindow = NULL): wxHelpControllerBase(parentWindow) { } - - // Must call this to set the filename - virtual bool Initialize(const wxString& file); - virtual bool Initialize(const wxString& file, int WXUNUSED(server) ) { return Initialize( file ); } - - // If file is "", reloads file given in Initialize - virtual bool LoadFile(const wxString& file = wxEmptyString); - virtual bool DisplayContents(); - virtual bool DisplaySection(int sectionNo); - virtual bool DisplaySection(const wxString& section); - virtual bool DisplayBlock(long blockNo); - virtual bool DisplayContextPopup(int contextId); - virtual bool DisplayTextPopup(const wxString& text, const wxPoint& pos); - virtual bool KeywordSearch(const wxString& k, - wxHelpSearchMode mode = wxHELP_SEARCH_ALL); - virtual bool Quit(); - - wxString GetHelpFile() const { return m_helpFile; } - - // helper of DisplayTextPopup(), also used in wxSimpleHelpProvider::ShowHelp - static bool ShowContextHelpPopup(const wxString& text, - const wxPoint& pos, - wxWindow *window); - -protected: - // Append extension if necessary. - wxString GetValidFilename(const wxString& file) const; - -protected: - wxString m_helpFile; - - DECLARE_CLASS(wxCHMHelpController) -}; - -#endif // wxUSE_MS_HTML_HELP - -#endif -// _WX_HELPCHM_H_ diff --git a/wxWidgets/include/wx/msw/helpwin.h b/wxWidgets/include/wx/msw/helpwin.h deleted file mode 100644 index 7c363fbd96..0000000000 --- a/wxWidgets/include/wx/msw/helpwin.h +++ /dev/null @@ -1,56 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: helpwin.h -// Purpose: Help system: WinHelp implementation -// Author: Julian Smart -// Modified by: -// Created: 04/01/98 -// RCS-ID: $Id: helpwin.h 41020 2006-09-05 20:47:48Z VZ $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_HELPWIN_H_ -#define _WX_HELPWIN_H_ - -#include "wx/wx.h" - -#if wxUSE_HELP - -#include "wx/helpbase.h" - -class WXDLLEXPORT wxWinHelpController: public wxHelpControllerBase -{ - DECLARE_CLASS(wxWinHelpController) - -public: - wxWinHelpController(wxWindow* parentWindow = NULL): wxHelpControllerBase(parentWindow) {} - virtual ~wxWinHelpController() {} - - // Must call this to set the filename - virtual bool Initialize(const wxString& file); - virtual bool Initialize(const wxString& file, int WXUNUSED(server) ) { return Initialize( file ); } - - // If file is "", reloads file given in Initialize - virtual bool LoadFile(const wxString& file = wxEmptyString); - virtual bool DisplayContents(); - virtual bool DisplaySection(int sectionNo); - virtual bool DisplaySection(const wxString& section) { return KeywordSearch(section); } - virtual bool DisplayBlock(long blockNo); - virtual bool DisplayContextPopup(int contextId); - virtual bool KeywordSearch(const wxString& k, - wxHelpSearchMode mode = wxHELP_SEARCH_ALL); - virtual bool Quit(); - - inline wxString GetHelpFile() const { return m_helpFile; } - -protected: - // Append extension if necessary. - wxString GetValidFilename(const wxString& file) const; - -private: - wxString m_helpFile; -}; - -#endif // wxUSE_HELP -#endif -// _WX_HELPWIN_H_ diff --git a/wxWidgets/include/wx/msw/htmlhelp.h b/wxWidgets/include/wx/msw/htmlhelp.h deleted file mode 100644 index 1bd4065ba4..0000000000 --- a/wxWidgets/include/wx/msw/htmlhelp.h +++ /dev/null @@ -1,465 +0,0 @@ -/* - * wx/msw/htmlhelp.h - * Copyright 2004 Jacek Caban - * - * Originally written for the Wine project, and issued under - * the wxWindows License by kind permission of the author. - * - * License: wxWindows License - */ - -#ifndef __HTMLHELP_H__ -#define __HTMLHELP_H__ - -#define HH_DISPLAY_TOPIC 0x00 -#define HH_HELP_FINDER 0x00 -#define HH_DISPLAY_TOC 0x01 -#define HH_DISPLAY_INDEX 0x02 -#define HH_DISPLAY_SEARCH 0x03 -#define HH_SET_WIN_TYPE 0x04 -#define HH_GET_WIN_TYPE 0x05 -#define HH_GET_WIN_HANDLE 0x06 -#define HH_ENUM_INFO_TYPE 0x07 -#define HH_SET_INFO_TYPE 0x08 -#define HH_SYNC 0x09 -#define HH_RESERVED1 0x0A -#define HH_RESERVED2 0x0B -#define HH_RESERVED3 0x0C -#define HH_KEYWORD_LOOKUP 0x0D -#define HH_DISPLAY_TEXT_POPUP 0x0E -#define HH_HELP_CONTEXT 0x0F -#define HH_TP_HELP_CONTEXTMENU 0x10 -#define HH_TP_HELP_WM_HELP 0x11 -#define HH_CLOSE_ALL 0x12 -#define HH_ALINK_LOOKUP 0x13 -#define HH_GET_LAST_ERROR 0x14 -#define HH_ENUM_CATEGORY 0x15 -#define HH_ENUM_CATEGORY_IT 0x16 -#define HH_RESET_IT_FILTER 0x17 -#define HH_SET_INCLUSIVE_FILTER 0x18 -#define HH_SET_EXCLUSIVE_FILTER 0x19 -#define HH_INITIALIZE 0x1C -#define HH_UNINITIALIZE 0x1D -#define HH_PRETRANSLATEMESSAGE 0xFD -#define HH_SET_GLOBAL_PROPERTY 0xFC - -#define HHWIN_PROP_TAB_AUTOHIDESHOW 0x00000001 -#define HHWIN_PROP_ONTOP 0x00000002 -#define HHWIN_PROP_NOTITLEBAR 0x00000004 -#define HHWIN_PROP_NODEF_STYLES 0x00000008 -#define HHWIN_PROP_NODEF_EXSTYLES 0x00000010 -#define HHWIN_PROP_TRI_PANE 0x00000020 -#define HHWIN_PROP_NOTB_TEXT 0x00000040 -#define HHWIN_PROP_POST_QUIT 0x00000080 -#define HHWIN_PROP_AUTO_SYNC 0x00000100 -#define HHWIN_PROP_TRACKING 0x00000200 -#define HHWIN_PROP_TAB_SEARCH 0x00000400 -#define HHWIN_PROP_TAB_HISTORY 0x00000800 -#define HHWIN_PROP_TAB_FAVORITES 0x00001000 -#define HHWIN_PROP_CHANGE_TITLE 0x00002000 -#define HHWIN_PROP_NAV_ONLY_WIN 0x00004000 -#define HHWIN_PROP_NO_TOOLBAR 0x00008000 -#define HHWIN_PROP_MENU 0x00010000 -#define HHWIN_PROP_TAB_ADVSEARCH 0x00020000 -#define HHWIN_PROP_USER_POS 0x00040000 -#define HHWIN_PROP_TAB_CUSTOM1 0x00080000 -#define HHWIN_PROP_TAB_CUSTOM2 0x00100000 -#define HHWIN_PROP_TAB_CUSTOM3 0x00200000 -#define HHWIN_PROP_TAB_CUSTOM4 0x00400000 -#define HHWIN_PROP_TAB_CUSTOM5 0x00800000 -#define HHWIN_PROP_TAB_CUSTOM6 0x01000000 -#define HHWIN_PROP_TAB_CUSTOM7 0x02000000 -#define HHWIN_PROP_TAB_CUSTOM8 0x04000000 -#define HHWIN_PROP_TAB_CUSTOM9 0x08000000 -#define HHWIN_TB_MARGIN 0x10000000 - -#define HHWIN_PARAM_PROPERTIES 0x00000002 -#define HHWIN_PARAM_STYLES 0x00000004 -#define HHWIN_PARAM_EXSTYLES 0x00000008 -#define HHWIN_PARAM_RECT 0x00000010 -#define HHWIN_PARAM_NAV_WIDTH 0x00000020 -#define HHWIN_PARAM_SHOWSTATE 0x00000040 -#define HHWIN_PARAM_INFOTYPES 0x00000080 -#define HHWIN_PARAM_TB_FLAGS 0x00000100 -#define HHWIN_PARAM_EXPANSION 0x00000200 -#define HHWIN_PARAM_TABPOS 0x00000400 -#define HHWIN_PARAM_TABORDER 0x00000800 -#define HHWIN_PARAM_HISTORY_COUNT 0x00001000 -#define HHWIN_PARAM_CUR_TAB 0x00002000 - -#define HHWIN_BUTTON_EXPAND 0x00000002 -#define HHWIN_BUTTON_BACK 0x00000004 -#define HHWIN_BUTTON_FORWARD 0x00000008 -#define HHWIN_BUTTON_STOP 0x00000010 -#define HHWIN_BUTTON_REFRESH 0x00000020 -#define HHWIN_BUTTON_HOME 0x00000040 -#define HHWIN_BUTTON_BROWSE_FWD 0x00000080 -#define HHWIN_BUTTON_BROWSE_BCK 0x00000100 -#define HHWIN_BUTTON_NOTES 0x00000200 -#define HHWIN_BUTTON_CONTENTS 0x00000400 -#define HHWIN_BUTTON_SYNC 0x00000800 -#define HHWIN_BUTTON_OPTIONS 0x00001000 -#define HHWIN_BUTTON_PRINT 0x00002000 -#define HHWIN_BUTTON_INDEX 0x00004000 -#define HHWIN_BUTTON_SEARCH 0x00008000 -#define HHWIN_BUTTON_HISTORY 0x00010000 -#define HHWIN_BUTTON_FAVORITES 0x00020000 -#define HHWIN_BUTTON_JUMP1 0x00040000 -#define HHWIN_BUTTON_JUMP2 0x00080000 -#define HHWIN_BUTTON_ZOOM 0x00100000 -#define HHWIN_BUTTON_TOC_NEXT 0x00200000 -#define HHWIN_BUTTON_TOC_PREV 0x00400000 - -#define HHWIN_DEF_BUTTONS \ - (HHWIN_BUTTON_EXPAND | HHWIN_BUTTON_BACK | HHWIN_BUTTON_OPTIONS | HHWIN_BUTTON_PRINT) - -#define IDTB_EXPAND 200 -#define IDTB_CONTRACT 201 -#define IDTB_STOP 202 -#define IDTB_REFRESH 203 -#define IDTB_BACK 204 -#define IDTB_HOME 205 -#define IDTB_SYNC 206 -#define IDTB_PRINT 207 -#define IDTB_OPTIONS 208 -#define IDTB_FORWARD 209 -#define IDTB_NOTES 210 -#define IDTB_BROWSE_FWD 211 -#define IDTB_BROWSE_BACK 212 -#define IDTB_CONTENTS 213 -#define IDTB_INDEX 214 -#define IDTB_SEARCH 215 -#define IDTB_HISTORY 216 -#define IDTB_FAVORITES 217 -#define IDTB_JUMP1 218 -#define IDTB_JUMP2 219 -#define IDTB_CUSTOMIZE 221 -#define IDTB_ZOOM 222 -#define IDTB_TOC_NEXT 223 -#define IDTB_TOC_PREV 224 - -#define HHN_FIRST (0U-860U) -#define HHN_LAST (0U-879U) -#define HHN_NAVCOMPLETE HHN_FIRST -#define HHN_TRACK (HHN_FIRST-1) -#define HHN_WINDOW_CREATE (HHN_FIRST-2) - - -#ifdef __cplusplus -extern "C" { -#endif - -typedef struct tagHH_NOTIFY { - NMHDR hdr; - PCSTR pszurl; -} HH_NOTIFY; - -typedef struct tagHH_POPUPA { - int cbStruct; - HINSTANCE hinst; - UINT idString; - LPCSTR pszText; - POINT pt; - COLORREF clrForeground; - COLORREF clrBackground; - RECT rcMargins; - LPCSTR pszFont; -} HH_POPUPA; - -typedef struct tagHH_POPUPW { - int cbStruct; - HINSTANCE hinst; - UINT idString; - LPCWSTR pszText; - POINT pt; - COLORREF clrForeground; - COLORREF clrBackground; - RECT rcMargins; - LPCWSTR pszFont; -} HH_POPUPW; - -#ifdef _UNICODE -typedef HH_POPUPW HH_POPUP; -#else -typedef HH_POPUPA HH_POPUP; -#endif - -typedef struct tagHH_ALINKA { - int cbStruct; - BOOL fReserved; - LPCSTR pszKeywords; - LPCSTR pszUrl; - LPCSTR pszMsgText; - LPCSTR pszMsgTitle; - LPCSTR pszWindow; - BOOL fIndexOnFail; -} HH_ALINKA; - -typedef struct tagHH_ALINKW { - int cbStruct; - BOOL fReserved; - LPCWSTR pszKeywords; - LPCWSTR pszUrl; - LPCWSTR pszMsgText; - LPCWSTR pszMsgTitle; - LPCWSTR pszWindow; - BOOL fIndexOnFail; -} HH_ALINKW; - -#ifdef _UNICODE -typedef HH_ALINKW HH_ALINK; -typedef HH_ALINKW HH_AKLINK; -#else -typedef HH_ALINKA HH_ALINK; -typedef HH_ALINKA HH_AKLINK; -#endif - -enum { - HHWIN_NAVTYPE_TOC, - HHWIN_NAVTYPE_INDEX, - HHWIN_NAVTYPE_SEARCH, - HHWIN_NAVTYPE_FAVORITES, - HHWIN_NAVTYPE_HISTORY, - HHWIN_NAVTYPE_AUTHOR, - HHWIN_NAVTYPE_CUSTOM_FIRST = 11 -}; - -enum { - IT_INCLUSIVE, - IT_EXCLUSIVE, - IT_HIDDEN -}; - -typedef struct tagHH_ENUM_IT { - int cbStruct; - int iType; - LPCSTR pszCatName; - LPCSTR pszITName; - LPCSTR pszITDescription; -} HH_ENUM_IT, *PHH_ENUM_IT; - -typedef struct tagHH_ENUM_CAT { - int cbStruct; - LPCSTR pszCatName; - LPCSTR pszCatDescription; -} HH_ENUM_CAT, *PHH_ENUM_CAT; - -typedef struct tagHH_SET_INFOTYPE { - int cbStruct; - LPCSTR pszCatName; - LPCSTR pszInfoTypeName; -} HH_SET_INFOTYPE; - -typedef DWORD HH_INFOTYPE, *PHH_INFOTYPE; - -enum { - HHWIN_NAVTAB_TOP, - HHWIN_NAVTAB_LEFT, - HHWIN_NAVTAB_BOTTOM -}; - -#define HH_MAX_TABS 19 - -enum { - HH_TAB_CONTENTS, - HH_TAB_INDEX, - HH_TAB_SEARCH, - HH_TAB_FAVORITES, - HH_TAB_HISTORY, - HH_TAB_AUTHOR, - HH_TAB_CUSTOM_FIRST = 11, - HH_TAB_CUSTOM_LAST = HH_MAX_TABS -}; - -#define HH_MAX_TABS_CUSTOM (HH_TAB_CUSTOM_LAST-HH_TAB_CUSTOM_FIRST+1) -#define HH_FTS_DEFAULT_PROXIMITY -1 - -typedef struct tagHH_FTS_QUERYA { - int cbStruct; - BOOL fUniCodeStrings; - LPCSTR pszSearchQuery; - LONG iProximity; - BOOL fStemmedSearch; - BOOL fTitleOnly; - BOOL fExecute; - LPCSTR pszWindow; -} HH_FTS_QUERYA; - -typedef struct tagHH_FTS_QUERYW { - int cbStruct; - BOOL fUniCodeStrings; - LPCWSTR pszSearchQuery; - LONG iProximity; - BOOL fStemmedSearch; - BOOL fTitleOnly; - BOOL fExecute; - LPCWSTR pszWindow; -} HH_FTS_QUERYW; - -#ifdef _UNICODE -typedef HH_FTS_QUERYW HH_FTS_QUERY; -#else -typedef HH_FTS_QUERYA HH_FTS_QUERY; -#endif - -typedef struct tagHH_WINTYPEA { - int cbStruct; - BOOL fUniCodeStrings; - LPCSTR pszType; - DWORD fsValidMembers; - DWORD fsWinProperties; - LPCSTR pszCaption; - DWORD dwStyles; - DWORD dwExStyles; - RECT rcWindowPos; - int nShowState; - HWND hwndHelp; - HWND hwndCaller; - PHH_INFOTYPE paInfoTypes; - HWND hwndToolBar; - HWND hwndNavigation; - HWND hwndHTML; - int iNavWidth; - RECT rcHTML; - LPCSTR pszToc; - LPCSTR pszIndex; - LPCSTR pszFile; - LPCSTR pszHome; - DWORD fsToolBarFlags; - BOOL fNotExpanded; - int curNavType; - int tabpos; - int idNotify; - BYTE tabOrder[HH_MAX_TABS+1]; - int cHistory; - LPCSTR pszJump1; - LPCSTR pszJump2; - LPCSTR pszUrlJump1; - LPCSTR pszUrlJump2; - RECT rcMinSize; - int cbInfoTypes; - LPCSTR pszCustomTabs; -} HH_WINTYPEA, *PHH_WINTYPEA; - -typedef struct tagHH_WINTYPEW { - int cbStruct; - BOOL fUniCodeStrings; - LPCWSTR pszType; - DWORD fsValidMembers; - DWORD fsWinProperties; - LPCWSTR pszCaption; - DWORD dwStyles; - DWORD dwExStyles; - RECT rcWindowPos; - int nShowState; - HWND hwndHelp; - HWND hwndCaller; - PHH_INFOTYPE paInfoTypes; - HWND hwndToolBar; - HWND hwndNavigation; - HWND hwndHTML; - int iNavWidth; - RECT rcHTML; - LPCWSTR pszToc; - LPCWSTR pszIndex; - LPCWSTR pszFile; - LPCWSTR pszHome; - DWORD fsToolBarFlags; - BOOL fNotExpanded; - int curNavType; - int tabpos; - int idNotify; - BYTE tabOrder[HH_MAX_TABS+1]; - int cHistory; - LPCWSTR pszJump1; - LPCWSTR pszJump2; - LPCWSTR pszUrlJump1; - LPCWSTR pszUrlJump2; - RECT rcMinSize; - int cbInfoTypes; - LPCWSTR pszCustomTabs; -} HH_WINTYPEW, *PHH_WINTYPEW; - -#ifdef _UNICODE -typedef HH_WINTYPEW HH_WINTYPE; -#else -typedef HH_WINTYPEA HH_WINTYPE; -#endif - -enum { - HHACT_TAB_CONTENTS, - HHACT_TAB_INDEX, - HHACT_TAB_SEARCH, - HHACT_TAB_HISTORY, - HHACT_TAB_FAVORITES, - HHACT_EXPAND, - HHACT_CONTRACT, - HHACT_BACK, - HHACT_FORWARD, - HHACT_STOP, - HHACT_REFRESH, - HHACT_HOME, - HHACT_SYNC, - HHACT_OPTIONS, - HHACT_PRINT, - HHACT_HIGHLIGHT, - HHACT_CUSTOMIZE, - HHACT_JUMP1, - HHACT_JUMP2, - HHACT_ZOOM, - HHACT_TOC_NEXT, - HHACT_TOC_PREV, - HHACT_NOTES, - HHACT_LAST_ENUM -}; - -typedef struct tagHH_NTRACKA { - NMHDR hdr; - PCSTR pszCurUrl; - int idAction; - PHH_WINTYPEA phhWinType; -} HH_NTRACKA; - -typedef struct tagHH_NTRACKW { - NMHDR hdr; - PCSTR pszCurUrl; - int idAction; - PHH_WINTYPEW phhWinType; -} HH_NTRACKW; - -#ifdef _UNICODE -typedef HH_NTRACKW HH_NTRACK; -#else -typedef HH_NTRACKA HH_NTRACK; -#endif - -HWND WINAPI HtmlHelpA(HWND,LPCSTR,UINT,DWORD); -HWND WINAPI HtmlHelpA(HWND,LPCSTR,UINT,DWORD); -#define HtmlHelp WINELIB_NAME_AW(HtmlHelp) - -#define ATOM_HTMLHELP_API_ANSI (LPTSTR)14 -#define ATOM_HTMLHELP_API_UNICODE (LPTSTR)15 - -typedef enum tagHH_GPROPID { - HH_GPROPID_SINGLETHREAD = 1, - HH_GPROPID_TOOLBAR_MARGIN = 2, - HH_GPROPID_UI_LANGUAGE = 3, - HH_GPROPID_CURRENT_SUBSET = 4, - HH_GPROPID_CONTENT_LANGUAGE = 5 -} HH_GPROPID; - -#ifdef __WIDL_OAIDL_H - -typedef struct tagHH_GLOBAL_PROPERTY -{ - HH_GPROPID id; - VARIANT var; -} HH_GLOBAL_PROPERTY ; - -#endif /* __WIDL_OAIDL_H */ - -#ifdef __cplusplus -} -#endif - -#endif /* __HTMLHELP_H__ */ diff --git a/wxWidgets/include/wx/msw/ia64.manifest b/wxWidgets/include/wx/msw/ia64.manifest deleted file mode 100644 index 242ea4b624..0000000000 --- a/wxWidgets/include/wx/msw/ia64.manifest +++ /dev/null @@ -1,22 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="yes"?> -<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"> -<assemblyIdentity - version="0.64.1.0" - processorArchitecture="IA64" - name="Controls" - type="win32" -/> -<description>wxWindows application</description> -<dependency> - <dependentAssembly> - <assemblyIdentity - type="win32" - name="Microsoft.Windows.Common-Controls" - version="6.0.0.0" - processorArchitecture="IA64" - publicKeyToken="6595b64144ccf1df" - language="*" - /> - </dependentAssembly> -</dependency> -</assembly> diff --git a/wxWidgets/include/wx/msw/icon.h b/wxWidgets/include/wx/msw/icon.h deleted file mode 100644 index c9b822cd17..0000000000 --- a/wxWidgets/include/wx/msw/icon.h +++ /dev/null @@ -1,95 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/msw/icon.h -// Purpose: wxIcon class -// Author: Julian Smart -// Modified by: -// Created: 01/02/97 -// RCS-ID: $Id: icon.h 42752 2006-10-30 19:26:48Z VZ $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_ICON_H_ -#define _WX_ICON_H_ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -#include "wx/msw/gdiimage.h" - -// --------------------------------------------------------------------------- -// icon data -// --------------------------------------------------------------------------- - -// notice that although wxIconRefData inherits from wxBitmapRefData, it is not -// a valid wxBitmapRefData -class WXDLLEXPORT wxIconRefData : public wxGDIImageRefData -{ -public: - wxIconRefData() { } - virtual ~wxIconRefData() { Free(); } - - virtual void Free(); -}; - -// --------------------------------------------------------------------------- -// Icon -// --------------------------------------------------------------------------- - -class WXDLLEXPORT wxIcon : public wxGDIImage -{ -public: - // ctors - // default - wxIcon() { } - - // from raw data - wxIcon(const char bits[], int width, int height); - - // from XPM data - wxIcon(const char **data) { CreateIconFromXpm(data); } - - wxIcon(char **data) { CreateIconFromXpm((const char **)data); } - - // from resource/file - wxIcon(const wxString& name, - long type = wxBITMAP_TYPE_ICO_RESOURCE, - int desiredWidth = -1, int desiredHeight = -1); - - wxIcon(const wxIconLocation& loc); - - virtual ~wxIcon(); - - virtual bool LoadFile(const wxString& name, - long type = wxBITMAP_TYPE_ICO_RESOURCE, - int desiredWidth = -1, int desiredHeight = -1); - - // implementation only from now on - wxIconRefData *GetIconData() const { return (wxIconRefData *)m_refData; } - - void SetHICON(WXHICON icon) { SetHandle((WXHANDLE)icon); } - WXHICON GetHICON() const { return (WXHICON)GetHandle(); } - - // 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); - -protected: - virtual wxGDIImageRefData *CreateData() const - { - return new wxIconRefData; - } - - virtual wxObjectRefData *CloneRefData(const wxObjectRefData *data) const; - - // create from XPM data - void CreateIconFromXpm(const char **data); - -private: - DECLARE_DYNAMIC_CLASS(wxIcon) -}; - -#endif - // _WX_ICON_H_ diff --git a/wxWidgets/include/wx/msw/imaglist.h b/wxWidgets/include/wx/msw/imaglist.h deleted file mode 100644 index 9b72aaaa8d..0000000000 --- a/wxWidgets/include/wx/msw/imaglist.h +++ /dev/null @@ -1,206 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/msw/imaglist.h -// Purpose: wxImageList class -// Author: Julian Smart -// Modified by: -// Created: 01/02/97 -// RCS-ID: $Id: imaglist.h 41271 2006-09-18 04:41:09Z KO $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_IMAGLIST_H_ -#define _WX_IMAGLIST_H_ - -#include "wx/bitmap.h" - -// 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 -{ -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. - wxImageList(int width, int height, bool mask = true, int initialCount = 1) - { - Create(width, height, mask, initialCount); - } - virtual ~wxImageList(); - - - // Attributes - //////////////////////////////////////////////////////////////////////////// - - // Returns the number of images in the image list. - int GetImageCount() const; - - // Returns the size (same for all images) of the images in the list - 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); - - // Get a bitmap - wxBitmap GetBitmap(int index) const; - - // Get an icon - wxIcon GetIcon(int index) const; - - // TODO: miscellaneous functionality -/* - wxIcon *MakeIcon(int index); - bool SetOverlayImage(int index, int overlayMask); - -*/ - - // TODO: Drag-and-drop related functionality. - -#if 0 - // Creates a new drag image by combining the given image (typically a mouse cursor image) - // with the current drag image. - bool SetDragCursorImage(int index, const wxPoint& hotSpot); - - // If successful, returns a pointer to the temporary image list that is used for dragging; - // otherwise, NULL. - // dragPos: receives the current drag position. - // hotSpot: receives the offset of the drag image relative to the drag position. - static wxImageList *GetDragImageList(wxPoint& dragPos, wxPoint& hotSpot); - - // Call this function to begin dragging an image. This function creates a temporary image list - // that is used for dragging. The image combines the specified image and its mask with the - // current cursor. In response to subsequent mouse move messages, you can move the drag image - // by using the DragMove member function. To end the drag operation, you can use the EndDrag - // member function. - bool BeginDrag(int index, const wxPoint& hotSpot); - - // Ends a drag operation. - bool EndDrag(); - - // Call this function to move the image that is being dragged during a drag-and-drop operation. - // This function is typically called in response to a mouse move message. To begin a drag - // operation, use the BeginDrag member function. - static bool DragMove(const wxPoint& point); - - // During a drag operation, locks updates to the window specified by lockWindow and displays - // the drag image at the position specified by point. - // The coordinates are relative to the window's upper left corner, so you must compensate - // for the widths of window elements, such as the border, title bar, and menu bar, when - // specifying the coordinates. - // If lockWindow is NULL, this function draws the image in the display context associated - // with the desktop window, and coordinates are relative to the upper left corner of the screen. - // This function locks all other updates to the given window during the drag operation. - // If you need to do any drawing during a drag operation, such as highlighting the target - // of a drag-and-drop operation, you can temporarily hide the dragged image by using the - // wxImageList::DragLeave function. - - // lockWindow: pointer to the window that owns the drag image. - // point: position at which to display the drag image. Coordinates are relative to the - // upper left corner of the window (not the client area). - - static bool DragEnter( wxWindow *lockWindow, const wxPoint& point ); - - // Unlocks the window specified by pWndLock and hides the drag image, allowing the - // window to be updated. - static bool DragLeave( wxWindow *lockWindow ); - - /* Here's roughly how you'd use these functions if implemented in this Win95-like way: - - 1) Starting to drag: - - wxImageList *dragImageList = new wxImageList(16, 16, true); - dragImageList->Add(myDragImage); // Provide an image to combine with the current cursor - dragImageList->BeginDrag(0, wxPoint(0, 0)); - wxShowCursor(false); // wxShowCursor not yet implemented in wxWin - myWindow->CaptureMouse(); - - 2) Dragging: - - // Called within mouse move event. Could also use dragImageList instead of assuming - // these are static functions. - // These two functions could possibly be combined into one, since DragEnter is - // a bit obscure. - wxImageList::DragMove(wxPoint(x, y)); // x, y are current cursor position - wxImageList::DragEnter(NULL, wxPoint(x, y)); // NULL assumes dragging across whole screen - - 3) Finishing dragging: - - dragImageList->EndDrag(); - myWindow->ReleaseMouse(); - wxShowCursor(true); -*/ - -#endif - - // Implementation - //////////////////////////////////////////////////////////////////////////// - - // Returns the native image list handle - WXHIMAGELIST GetHIMAGELIST() const { return m_hImageList; } - -protected: - WXHIMAGELIST m_hImageList; - - DECLARE_DYNAMIC_CLASS(wxImageList) -}; - -#endif - // _WX_IMAGLIST_H_ diff --git a/wxWidgets/include/wx/msw/iniconf.h b/wxWidgets/include/wx/msw/iniconf.h deleted file mode 100644 index 61b9d0c8d3..0000000000 --- a/wxWidgets/include/wx/msw/iniconf.h +++ /dev/null @@ -1,101 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: include/wx/msw/iniconf.h -// Purpose: INI-file based wxConfigBase implementation -// Author: Vadim Zeitlin -// Modified by: -// Created: 27.07.98 -// RCS-ID: $Id: iniconf.h 62185 2009-09-28 10:02:42Z JS $ -// Copyright: (c) 1998 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr> -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _INICONF_H -#define _INICONF_H - -#include "wx/defs.h" - -#if wxUSE_CONFIG - -// ---------------------------------------------------------------------------- -// wxIniConfig is a wxConfig implementation which uses MS Windows INI files to -// store the data. Because INI files don't really support arbitrary nesting of -// groups, we do the following: -// (1) in win.ini file we store all entries in the [vendor] section and -// the value group1/group2/key is mapped to the value group1_group2_key -// in this section, i.e. all path separators are replaced with underscore -// (2) in appname.ini file we map group1/group2/group3/key to the entry -// group2_group3_key in [group1] -// -// Of course, it might lead to indesirable results if '_' is also used in key -// names (i.e. group/key is the same as group_key) and also GetPath() result -// may be not what you would expect it to be. -// -// Another limitation: the keys and section names are never case-sensitive -// which might differ from wxFileConfig it it was compiled with -// wxCONFIG_CASE_SENSITIVE option. -// ---------------------------------------------------------------------------- - -// for this class, "local" file is the file appname.ini and the global file -// is the [vendor] subsection of win.ini (default for "vendor" is to be the -// same as appname). The file name (strAppName parameter) may, in fact, -// contain the full path to the file. If it doesn't, the file is searched for -// in the Windows directory. -class WXDLLEXPORT wxIniConfig : public wxConfigBase -{ -public: - // ctor & dtor - // if strAppName doesn't contain the extension and is not an absolute path, - // ".ini" is appended to it. if strVendor is empty, it's taken to be the - // same as strAppName. - wxIniConfig(const wxString& strAppName = wxEmptyString, const wxString& strVendor = wxEmptyString, - const wxString& localFilename = wxEmptyString, const wxString& globalFilename = wxEmptyString, long style = wxCONFIG_USE_LOCAL_FILE); - virtual ~wxIniConfig(); - - // implement inherited pure virtual functions - virtual void SetPath(const wxString& strPath); - virtual const wxString& GetPath() const; - - virtual bool GetFirstGroup(wxString& str, long& lIndex) const; - virtual bool GetNextGroup (wxString& str, long& lIndex) const; - virtual bool GetFirstEntry(wxString& str, long& lIndex) const; - virtual bool GetNextEntry (wxString& str, long& lIndex) const; - - virtual size_t GetNumberOfEntries(bool bRecursive = false) const; - virtual size_t GetNumberOfGroups(bool bRecursive = false) const; - - virtual bool HasGroup(const wxString& strName) const; - virtual bool HasEntry(const wxString& strName) const; - - // return true if the current group is empty - bool IsEmpty() const; - - virtual bool Flush(bool bCurrentOnly = false); - - virtual bool RenameEntry(const wxString& oldName, const wxString& newName); - virtual bool RenameGroup(const wxString& oldName, const wxString& newName); - - virtual bool DeleteEntry(const wxString& Key, bool bGroupIfEmptyAlso = true); - virtual bool DeleteGroup(const wxString& szKey); - virtual bool DeleteAll(); - -protected: - // read/write - bool DoReadString(const wxString& key, wxString *pStr) const; - bool DoReadLong(const wxString& key, long *plResult) const; - - bool DoWriteString(const wxString& key, const wxString& szValue); - bool DoWriteLong(const wxString& key, long lValue); - -private: - // helpers - wxString GetPrivateKeyName(const wxString& szKey) const; - wxString GetKeyName(const wxString& szKey) const; - - wxString m_strLocalFilename; // name of the private INI file - wxString m_strGroup, // current group in appname.ini file - m_strPath; // the rest of the path (no trailing '_'!) -}; - -#endif // wxUSE_CONFIG - -#endif // _INICONF_H diff --git a/wxWidgets/include/wx/msw/joystick.h b/wxWidgets/include/wx/msw/joystick.h deleted file mode 100644 index 1b24d22dff..0000000000 --- a/wxWidgets/include/wx/msw/joystick.h +++ /dev/null @@ -1,90 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: joystick.h -// Purpose: wxJoystick class -// Author: Julian Smart -// Modified by: -// Created: 01/02/97 -// RCS-ID: $Id: joystick.h 35650 2005-09-23 12:56:45Z MR $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_JOYSTICK_H_ -#define _WX_JOYSTICK_H_ - -#include "wx/event.h" - -class WXDLLIMPEXP_ADV wxJoystick: public wxObject -{ - DECLARE_DYNAMIC_CLASS(wxJoystick) - public: - /* - * Public interface - */ - - wxJoystick(int joystick = wxJOYSTICK1); - - // Attributes - //////////////////////////////////////////////////////////////////////////// - - wxPoint GetPosition(void) const; - int GetZPosition(void) const; - int GetButtonState(void) const; - int GetPOVPosition(void) const; - int GetPOVCTSPosition(void) const; - int GetRudderPosition(void) const; - int GetUPosition(void) const; - int GetVPosition(void) const; - int GetMovementThreshold(void) const; - void SetMovementThreshold(int threshold) ; - - // Capabilities - //////////////////////////////////////////////////////////////////////////// - - static int GetNumberJoysticks(void); - - bool IsOk(void) const; // Checks that the joystick is functioning - int GetManufacturerId(void) const ; - int GetProductId(void) const ; - wxString GetProductName(void) const ; - int GetXMin(void) const; - int GetYMin(void) const; - int GetZMin(void) const; - int GetXMax(void) const; - int GetYMax(void) const; - int GetZMax(void) const; - int GetNumberButtons(void) const; - int GetNumberAxes(void) const; - int GetMaxButtons(void) const; - int GetMaxAxes(void) const; - int GetPollingMin(void) const; - int GetPollingMax(void) const; - int GetRudderMin(void) const; - int GetRudderMax(void) const; - int GetUMin(void) const; - int GetUMax(void) const; - int GetVMin(void) const; - int GetVMax(void) const; - - bool HasRudder(void) const; - bool HasZ(void) const; - bool HasU(void) const; - bool HasV(void) const; - bool HasPOV(void) const; - bool HasPOV4Dir(void) const; - bool HasPOVCTS(void) 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(void); - -protected: - int m_joystick; -}; - -#endif - // _WX_JOYSTICK_H_ diff --git a/wxWidgets/include/wx/msw/libraries.h b/wxWidgets/include/wx/msw/libraries.h deleted file mode 100644 index 09ff8996d9..0000000000 --- a/wxWidgets/include/wx/msw/libraries.h +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Name: wx/msw/libraries.h - * Purpose: Pragmas for linking libs conditionally - * Author: Michael Wetherell - * Modified by: - * RCS-ID: $Id: libraries.h 37045 2006-01-21 22:50:46Z MW $ - * Copyright: (c) 2005 Michael Wetherell - * Licence: wxWindows licence - */ - -#ifndef _WX_MSW_LIBRARIES_H_ -#define _WX_MSW_LIBRARIES_H_ - -/* - * Notes: - * - * In general the preferred place to add libs is in the bakefiles. This file - * can be used where libs must be added conditionally, for those compilers that - * support a way to do that. - */ - -/* VC++ 5 didn't include oleacc.lib, though it came with the PSDK */ -#if defined __VISUALC__ && (wxUSE_ACCESSIBILITY || __VISUALC__ >= 1200) -#pragma comment(lib, "oleacc") -#endif - -#endif /* _WX_MSW_LIBRARIES_H_ */ diff --git a/wxWidgets/include/wx/msw/listbox.h b/wxWidgets/include/wx/msw/listbox.h deleted file mode 100644 index 7addbaee0f..0000000000 --- a/wxWidgets/include/wx/msw/listbox.h +++ /dev/null @@ -1,183 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/msw/listbox.h -// Purpose: wxListBox class -// Author: Julian Smart -// Modified by: -// Created: 01/02/97 -// RCS-ID: $Id: listbox.h 66941 2011-02-17 11:01:22Z JS $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_LISTBOX_H_ -#define _WX_LISTBOX_H_ - -#if wxUSE_LISTBOX - -// Fixing spurious selection events breaks binary compatibility, so this is normally 0. -// See ticket #12143 -#define wxUSE_LISTBOX_SELECTION_FIX 0 - -// ---------------------------------------------------------------------------- -// simple types -// ---------------------------------------------------------------------------- - -#if wxUSE_OWNER_DRAWN - class WXDLLIMPEXP_FWD_CORE wxOwnerDrawn; - - // define the array of list box items - #include "wx/dynarray.h" - - WX_DEFINE_EXPORTED_ARRAY_PTR(wxOwnerDrawn *, wxListBoxItemsArray); -#endif // wxUSE_OWNER_DRAWN - -// forward decl for GetSelections() -class WXDLLIMPEXP_FWD_BASE wxArrayInt; - -// ---------------------------------------------------------------------------- -// 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(); - - // implement base class pure virtuals - virtual void Clear(); - virtual void Delete(unsigned int n); - - virtual unsigned int GetCount() const; - virtual wxString GetString(unsigned int n) const; - virtual void SetString(unsigned int n, const wxString& s); - virtual int FindString(const wxString& s, bool bCase = false) const; - - virtual bool IsSelected(int n) const; - virtual int GetSelection() const; - virtual int GetSelections(wxArrayInt& aSelections) const; - - // wxCheckListBox support -#if wxUSE_OWNER_DRAWN - bool MSWOnMeasure(WXMEASUREITEMSTRUCT *item); - bool MSWOnDraw(WXDRAWITEMSTRUCT *item); - - // plug-in for derived classes - virtual wxOwnerDrawn *CreateLboxItem(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-specific code to update the horizontal extent of the listbox, if - // necessary. If s is non-empty, the horizontal extent is increased to the - // length of this string if it's currently too short, otherwise the maximum - // extent of all strings is used. In any case calls InvalidateBestSize() - virtual void SetHorizontalExtent(const wxString& s = wxEmptyString); - - // Windows callbacks - bool MSWCommand(WXUINT param, WXWORD id); - WXDWORD MSWGetStyle(long style, WXDWORD *exstyle) const; - - // under XP when using "transition effect for menus and tooltips" if we - // return true for WM_PRINTCLIENT here then it causes noticable slowdown - virtual bool MSWShouldPropagatePrintChild() - { - return false; - } - - virtual wxVisualAttributes GetDefaultAttributes() const - { - return GetClassDefaultAttributes(GetWindowVariant()); - } - - static wxVisualAttributes - GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL) - { - return GetCompositeControlsDefaultAttributes(variant); - } - -#if wxUSE_LISTBOX_SELECTION_FIX - virtual WXLRESULT MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam); -#endif - -protected: - virtual void DoSetSelection(int n, bool select); - virtual int DoAppend(const wxString& item); - virtual void DoInsertItems(const wxArrayString& items, unsigned int pos); - virtual void DoSetItems(const wxArrayString& items, void **clientData); - virtual void DoSetFirstItem(int n); - virtual void DoSetItemClientData(unsigned int n, void* clientData); - virtual void* DoGetItemClientData(unsigned int n) const; - virtual void DoSetItemClientObject(unsigned int n, wxClientData* clientData); - virtual wxClientData* DoGetItemClientObject(unsigned int n) const; - virtual int DoListHitTest(const wxPoint& point) const; - - // free memory (common part of Clear() and dtor) - void Free(); - - unsigned int m_noItems; - int m_selected; - - virtual wxSize DoGetBestSize() const; - -#if wxUSE_OWNER_DRAWN - // control items - wxListBoxItemsArray m_aItems; -#endif - -#if wxUSE_LISTBOX_SELECTION_FIX - // flag set to true when we get a keyboard event and reset to false when we - // get a mouse one: this is used to find the correct item for the selection - // event - bool m_selectedByKeyboard; -#endif - -private: - DECLARE_DYNAMIC_CLASS_NO_COPY(wxListBox) -}; - -#endif // wxUSE_LISTBOX - -#endif - // _WX_LISTBOX_H_ diff --git a/wxWidgets/include/wx/msw/listctrl.h b/wxWidgets/include/wx/msw/listctrl.h deleted file mode 100644 index e6fd884a8f..0000000000 --- a/wxWidgets/include/wx/msw/listctrl.h +++ /dev/null @@ -1,449 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/msw/listctrl.h -// Purpose: wxListCtrl class -// Author: Julian Smart -// Modified by: Agron Selimaj -// Created: 01/02/97 -// RCS-ID: $Id: listctrl.h 54419 2008-06-29 01:35:24Z VZ $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_LISTCTRL_H_ -#define _WX_LISTCTRL_H_ - -#include "wx/textctrl.h" - -class WXDLLIMPEXP_FWD_CORE wxImageList; - -/* - 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 wxWidgets 2.0 event system, or using virtual - functions in wxWidgets 1.66. - - See the sample wxListCtrl app for API usage. - - TODO: - - addition of further convenience functions - to avoid use of wxListItem in some functions - - state/overlay images: probably not needed. - - in Win95, you can be called back to supply other information - besides text, such as state information. This saves no memory - and is probably superfluous to requirements. - - testing of whole API, extending current sample. - - - */ - -class WXDLLEXPORT wxListCtrl: public wxControl -{ -public: - /* - * Public interface - */ - - wxListCtrl() { Init(); } - - wxListCtrl(wxWindow *parent, - wxWindowID id = wxID_ANY, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = wxLC_ICON, - const wxValidator& validator = wxDefaultValidator, - const wxString& name = wxListCtrlNameStr) - { - Init(); - - Create(parent, id, pos, size, style, validator, name); - } - - virtual ~wxListCtrl(); - - bool Create(wxWindow *parent, - wxWindowID id = wxID_ANY, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = wxLC_ICON, - const wxValidator& validator = wxDefaultValidator, - const wxString& name = wxListCtrlNameStr); - - - // Attributes - //////////////////////////////////////////////////////////////////////////// - - // Set the control colours - bool SetForegroundColour(const wxColour& col); - bool SetBackgroundColour(const wxColour& col); - - // Gets information about this column - bool GetColumn(int col, wxListItem& item) const; - - // Sets information about this column - bool SetColumn(int col, const 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; - - // return the total area occupied by all the items (icon/small icon only) - wxRect GetViewRect() 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 = -1) ; - bool SetItemColumnImage(long item, long column, int image); - - // Gets the item text - wxString GetItemText(long item) const ; - - // Sets the item text - void SetItemText(long item, const wxString& str) ; - - // Gets the item data - wxUIntPtr GetItemData(long item) const ; - - // Sets the item data -#if wxABI_VERSION >= 20804 - bool SetItemPtrData(long item, wxUIntPtr data); -#endif // wxABI 2.8.4+ - bool SetItemData(long item, long data); - - // Gets the item rectangle - bool GetItemRect(long item, wxRect& rect, int code = wxLIST_RECT_BOUNDS) const ; - - // Gets the subitem rectangle in report mode - bool GetSubItemRect(long item, long subItem, 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 { return m_colCount; } - - // get the horizontal and vertical components of the item spacing - wxSize GetItemSpacing() const; - - // Foreground colour of an item. - void SetItemTextColour( long item, const wxColour& col); - wxColour GetItemTextColour( long item ) const; - - // Background colour of an item. - void SetItemBackgroundColour( long item, const wxColour &col); - wxColour GetItemBackgroundColour( long item ) const; - - // Font of an item. - void SetItemFont( long item, const wxFont &f); - wxFont GetItemFont( long item ) 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 ; - - // 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) ; - void AssignImageList(wxImageList *imageList, int which) ; - - // are we in report mode? - bool InReportView() const { return HasFlag(wxLC_REPORT); } - - // are we in virtual report mode? - bool IsVirtual() const { return HasFlag(wxLC_VIRTUAL); } - - // refresh items selectively (only useful for virtual list controls) - void RefreshItem(long item); - void RefreshItems(long itemFrom, long itemTo); - - // 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, wxUIntPtr 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) - // Request the subitem number as well at the given coordinate. - long HitTest(const wxPoint& point, int& flags, long* ptrSubItem = NULL) const; - - // Inserts an item, returning the index of the new item if successful, - // -1 otherwise. - long InsertItem(const 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, const wxListItem& info); - - long InsertColumn(long col, - const wxString& heading, - int format = wxLIST_FORMAT_LEFT, - int width = -1); - - // set the number of items in a virtual list control - void SetItemCount(long count); - - // 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); - - // IMPLEMENTATION - virtual bool MSWCommand(WXUINT param, WXWORD id); - virtual bool MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result); - virtual bool MSWShouldPreProcessMessage(WXMSG* msg); - - // bring the control in sync with current m_windowStyle value - void UpdateStyle(); - - // Event handlers - //////////////////////////////////////////////////////////////////////////// - // Necessary for drawing hrules and vrules, if specified - void OnPaint(wxPaintEvent& event); - - - virtual bool ShouldInheritColours() const { return false; } - - virtual wxVisualAttributes GetDefaultAttributes() const - { - return GetClassDefaultAttributes(GetWindowVariant()); - } - - static wxVisualAttributes - GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL); - - -#if WXWIN_COMPATIBILITY_2_6 - // obsolete stuff, for compatibility only -- don't use - wxDEPRECATED( int GetItemSpacing(bool isSmall) const); -#endif // WXWIN_COMPATIBILITY_2_6 - - // convert our styles to Windows - virtual WXDWORD MSWGetStyle(long style, WXDWORD *exstyle) const; - - // special Windows message handling - virtual WXLRESULT MSWWindowProc(WXUINT nMsg, - WXWPARAM wParam, - WXLPARAM lParam); - -protected: - // common part of all ctors - void Init(); - - // free memory taken by all internal data - void FreeAllInternalData(); - - // get the item attribute, either by quering it for virtual control, or by - // returning the one previously set using setter methods for a normal one - wxListItemAttr *DoGetItemAttr(long item) const; - - - 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) - bool m_ownsImageListNormal, - m_ownsImageListSmall, - m_ownsImageListState; - - int m_colCount; // Windows doesn't have GetColumnCount so must - // keep track of inserted/deleted columns - long m_count; // Keep track of item count to save calls to - // ListView_GetItemCount - bool m_ignoreChangeMessages; - - // true if we have any internal data (user data & attributes) - bool m_AnyInternalData; - - // true if we have any items with custom attributes - bool m_hasAnyAttr; - - // these functions are only used for virtual list view controls, i.e. the - // ones with wxLC_VIRTUAL style - - // return the text for the given column of the given item - virtual wxString OnGetItemText(long item, long column) const; - - // return the icon for the given item. In report view, OnGetItemImage will - // only be called for the first column. See OnGetItemColumnImage for - // details. - virtual int OnGetItemImage(long item) const; - - // return the icon for the given item and column. - virtual int OnGetItemColumnImage(long item, long column) const; - - // return the attribute for the item (may return NULL if none) - virtual wxListItemAttr *OnGetItemAttr(long item) const; - -private: - // process NM_CUSTOMDRAW notification message - WXLPARAM OnCustomDraw(WXLPARAM lParam); - - // set the extended styles for the control (used by Create() and - // UpdateStyle()), only should be called if InReportView() - void MSWSetExListStyles(); - - // initialize the (already created) m_textCtrl with the associated HWND - void InitEditControl(WXHWND hWnd); - - // destroy m_textCtrl if it's currently valid and reset it to NULL - void DeleteEditControl(); - - DECLARE_DYNAMIC_CLASS(wxListCtrl) - DECLARE_EVENT_TABLE() - DECLARE_NO_COPY_CLASS(wxListCtrl) -}; - -#endif // _WX_LISTCTRL_H_ diff --git a/wxWidgets/include/wx/msw/magnif1.cur b/wxWidgets/include/wx/msw/magnif1.cur deleted file mode 100644 index 15d1a77a49a5053ba171d0c7fdf9937f131814e3..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 326 zcmaKmJr06E5QX1@ku@O^8(TM4mfipg?*)mChcNLb8c)C#=xo7?g7AC`8XDqEzMY+) zeX~FS1LuGhERF`)0yqejkO?Cn>>I{pI!R8+>@6&Sg|K1+U@uPMBJl*~?XZk9Z7+~$ zhg0-qGyd!OIU7LlBvAwU!yoH%vK6(cH1`x|5t03xeY|6fl#SZ2jx76}<vr)^kq%s= RG5Xxsec#VDja0)yf*$}<c&GpX diff --git a/wxWidgets/include/wx/msw/mdi.h b/wxWidgets/include/wx/msw/mdi.h deleted file mode 100644 index 69ee0fd58d..0000000000 --- a/wxWidgets/include/wx/msw/mdi.h +++ /dev/null @@ -1,238 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/msw/mdi.h -// Purpose: MDI (Multiple Document Interface) classes -// Author: Julian Smart -// Modified by: -// Created: 01/02/97 -// RCS-ID: $Id: mdi.h 53135 2008-04-12 02:31:04Z VZ $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_MDI_H_ -#define _WX_MDI_H_ - -#include "wx/frame.h" - -extern WXDLLEXPORT_DATA(const wxChar) wxStatusLineNameStr[]; - -class WXDLLIMPEXP_FWD_CORE wxMDIClientWindow; -class WXDLLIMPEXP_FWD_CORE wxMDIChildFrame; - -// --------------------------------------------------------------------------- -// wxMDIParentFrame -// --------------------------------------------------------------------------- - -class WXDLLEXPORT wxMDIParentFrame : public wxFrame -{ -public: - wxMDIParentFrame(); - wxMDIParentFrame(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) - { - Create(parent, id, title, pos, size, style, name); - } - - virtual ~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); - - // accessors - // --------- - - // Get the active MDI child window (Windows only) - wxMDIChildFrame *GetActiveChild() const; - - // Get the client window - wxMDIClientWindow *GetClientWindow() const { return m_clientWindow; } - - // Create the client window class (don't Create the window, - // just return a new class) - virtual wxMDIClientWindow *OnCreateClient(void); - - // MDI windows menu - wxMenu* GetWindowMenu() const { return m_windowMenu; } - void SetWindowMenu(wxMenu* menu) ; - virtual void DoMenuUpdates(wxMenu* menu = NULL); - - // MDI operations - // -------------- - virtual void Cascade(); - virtual void Tile(wxOrientation orient = wxHORIZONTAL); - virtual void ArrangeIcons(); - virtual void ActivateNext(); - virtual void ActivatePrevious(); - - // handlers - // -------- - - // Responds to colour changes - void OnSysColourChanged(wxSysColourChangedEvent& event); - - void OnSize(wxSizeEvent& event); - void OnIconized(wxIconizeEvent& event); - - bool HandleActivate(int state, bool minimized, WXHWND activate); - bool HandleCommand(WXWORD id, WXWORD cmd, WXHWND control); - - // override window proc for MDI-specific message processing - virtual WXLRESULT MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam); - - virtual WXLRESULT MSWDefWindowProc(WXUINT, WXWPARAM, WXLPARAM); - virtual bool MSWTranslateMessage(WXMSG* msg); - -protected: -#if wxUSE_MENUS_NATIVE - virtual void InternalSetMenuBar(); -#endif // wxUSE_MENUS_NATIVE - - virtual WXHICON GetDefaultIcon() const; - - // set the size of the MDI client window to match the frame size - void UpdateClientSize(); - - - wxMDIClientWindow * m_clientWindow; - wxMDIChildFrame * m_currentChild; - wxMenu* m_windowMenu; - - // true if MDI Frame is intercepting commands, not child - bool m_parentFrameActive; - -private: - friend class WXDLLIMPEXP_FWD_CORE wxMDIChildFrame; - - DECLARE_EVENT_TABLE() - DECLARE_DYNAMIC_CLASS(wxMDIParentFrame) - DECLARE_NO_COPY_CLASS(wxMDIParentFrame) -}; - -// --------------------------------------------------------------------------- -// wxMDIChildFrame -// --------------------------------------------------------------------------- - -class WXDLLEXPORT wxMDIChildFrame : public wxFrame -{ -public: - wxMDIChildFrame() { Init(); } - 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); - } - - virtual ~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); - - virtual bool IsTopLevel() const { return false; } - - // MDI operations - virtual void Maximize(bool maximize = true); - virtual void Restore(); - virtual void Activate(); - - // Implementation only from now on - // ------------------------------- - - // Handlers - bool HandleMDIActivate(long bActivate, WXHWND, WXHWND); - bool HandleWindowPosChanging(void *lpPos); - bool HandleCommand(WXWORD id, WXWORD cmd, WXHWND control); - bool HandleGetMinMaxInfo(void *mmInfo); - - virtual WXLRESULT MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lParam); - virtual WXLRESULT MSWDefWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lParam); - virtual bool MSWTranslateMessage(WXMSG *msg); - - virtual void MSWDestroyWindow(); - - bool ResetWindowStyle(void *vrect); - - void OnIdle(wxIdleEvent& event); - - virtual bool Show(bool show = true); - -protected: - virtual void DoGetScreenPosition(int *x, int *y) const; - virtual void DoGetPosition(int *x, int *y) const; - virtual void DoSetClientSize(int width, int height); - virtual void InternalSetMenuBar(); - virtual bool IsMDIChild() const { return true; } - virtual void DetachMenuBar(); - - virtual WXHICON GetDefaultIcon() const; - - // common part of all ctors - void Init(); - -private: - bool m_needsInitialShow; // Show must be called in idle time after Creation - bool m_needsResize; // flag which tells us to artificially resize the frame - - DECLARE_EVENT_TABLE() - DECLARE_DYNAMIC_CLASS_NO_COPY(wxMDIChildFrame) -}; - -// --------------------------------------------------------------------------- -// wxMDIClientWindow -// --------------------------------------------------------------------------- - -class WXDLLEXPORT wxMDIClientWindow : public wxWindow -{ -public: - wxMDIClientWindow() { Init(); } - wxMDIClientWindow(wxMDIParentFrame *parent, long style = 0) - { - Init(); - - CreateClient(parent, style); - } - - // Note: this is virtual, to allow overridden behaviour. - virtual bool CreateClient(wxMDIParentFrame *parent, - long style = wxVSCROLL | wxHSCROLL); - - // Explicitly call default scroll behaviour - void OnScroll(wxScrollEvent& event); - -protected: - virtual void DoSetSize(int x, int y, - int width, int height, - int sizeFlags = wxSIZE_AUTO); - - void Init() { m_scrollX = m_scrollY = 0; } - - int m_scrollX, m_scrollY; - -private: - DECLARE_EVENT_TABLE() - DECLARE_DYNAMIC_CLASS_NO_COPY(wxMDIClientWindow) -}; - -#endif - // _WX_MDI_H_ diff --git a/wxWidgets/include/wx/msw/mdi.ico b/wxWidgets/include/wx/msw/mdi.ico deleted file mode 100644 index 435cca2471cd31bb825ff1e6eb180c1939a9eb4a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1078 zcmc&zF%p6>5L_S)<BakHsT`j{k%#dFTYh10!*eX@E#mG)fdQix<B`41-d%Dj4j@C0 zx~|9$_Z&C@sH&*X8L%&aGh;Q;5UTrbEx?7gjYQ8a`o1SC5o{p@?FfDf$!%<9C%cSY zRyw@$yPND<CUsck)7qNtro8jClxBMuX8DEIT`?cum(<oYI;;2182PF7zIpvZj~8vQ z;S8({1qZ{>1H}g<-VtX@^EF=Zz9{mlQwW;#il~Wy%sJ<goq>ax^Jn}JGe|Bw=NmFB ge8aqPJmI~ud$Eb6)2}9ELOWr8V4xU|6W(XUPqgg+2mk;8 diff --git a/wxWidgets/include/wx/msw/menu.h b/wxWidgets/include/wx/msw/menu.h deleted file mode 100644 index 87c25ef725..0000000000 --- a/wxWidgets/include/wx/msw/menu.h +++ /dev/null @@ -1,241 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/msw/menu.h -// Purpose: wxMenu, wxMenuBar classes -// Author: Julian Smart -// Modified by: Vadim Zeitlin (wxMenuItem is now in separate file) -// Created: 01/02/97 -// RCS-ID: $Id: menu.h 49563 2007-10-31 20:46:21Z VZ $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_MENU_H_ -#define _WX_MENU_H_ - -#if wxUSE_ACCEL - #include "wx/accel.h" - #include "wx/dynarray.h" - - WX_DEFINE_EXPORTED_ARRAY_PTR(wxAcceleratorEntry *, wxAcceleratorArray); -#endif // wxUSE_ACCEL - -class WXDLLIMPEXP_FWD_CORE wxFrame; - -#if defined(__WXWINCE__) && wxUSE_TOOLBAR -class WXDLLIMPEXP_FWD_CORE wxToolBar; -#endif - - -// Not using a combined wxToolBar/wxMenuBar? then use -// a commandbar in WinCE .NET to implement the -// menubar, since there is no ::SetMenu function. -#if defined(__WXWINCE__) -# if ((_WIN32_WCE >= 400) && !defined(__POCKETPC__) && !defined(__SMARTPHONE__)) || \ - defined(__HANDHELDPC__) -# define WINCE_WITH_COMMANDBAR -# else -# define WINCE_WITHOUT_COMMANDBAR -# endif -#endif - - -#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(); - - virtual void Break(); - - virtual void SetTitle(const wxString& title); - - // implementation only from now on - // ------------------------------- - - virtual void Attach(wxMenuBarBase *menubar); - - bool MSWCommand(WXUINT param, WXWORD id); - - // semi-private accessors - // get the window which contains this menu - wxWindow *GetWindow() const; - // get the menu handle - WXHMENU GetHMenu() const { return m_hMenu; } - -#if wxUSE_ACCEL - // called by wxMenuBar to build its accel table from the accels of all menus - bool HasAccels() const { return !m_accels.IsEmpty(); } - size_t GetAccelCount() const { return m_accels.GetCount(); } - size_t CopyAccels(wxAcceleratorEntry *accels) const; - - // called by wxMenuItem when its accels changes - void UpdateAccel(wxMenuItem *item); - - // helper used by wxMenu itself (returns the index in m_accels) - int FindAccel(int id) const; -#endif // wxUSE_ACCEL - -protected: - virtual wxMenuItem* DoAppend(wxMenuItem *item); - virtual wxMenuItem* DoInsert(size_t pos, wxMenuItem *item); - virtual wxMenuItem* DoRemove(wxMenuItem *item); - -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; - -#if wxUSE_ACCEL - // the accelerators for our menu items - wxAcceleratorArray m_accels; -#endif // wxUSE_ACCEL - - DECLARE_DYNAMIC_CLASS_NO_COPY(wxMenu) -}; - -// ---------------------------------------------------------------------------- -// Menu Bar (a la Windows) -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxMenuInfo : public wxObject -{ -public : - wxMenuInfo() { m_menu = NULL; } - virtual ~wxMenuInfo() { } - - void Create( wxMenu *menu , const wxString &title ) - { m_menu = menu; m_title = title; } - wxMenu* GetMenu() const { return m_menu; } - wxString GetTitle() const { return m_title; } -private : - wxMenu *m_menu; - wxString m_title; - - DECLARE_DYNAMIC_CLASS(wxMenuInfo) -}; - -WX_DECLARE_EXPORTED_LIST(wxMenuInfo, wxMenuInfoList ); - -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(size_t n, wxMenu *menus[], const wxString titles[], long style = 0); - virtual ~wxMenuBar(); - - // menubar construction - bool Append( wxMenuInfo *info ) { return Append( info->GetMenu() , info->GetTitle() ); } - const wxMenuInfoList& GetMenuInfos() const; - - 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 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(); - virtual void Detach(); - virtual void Attach(wxFrame *frame); - -#if defined(__WXWINCE__) && wxUSE_TOOLBAR - // Under WinCE, a menubar is owned by the frame's toolbar - void SetToolBar(wxToolBar* toolBar) { m_toolBar = toolBar; } - wxToolBar* GetToolBar() const { return m_toolBar; } -#endif - -#ifdef WINCE_WITH_COMMANDBAR - WXHWND GetCommandBar() const { return m_commandBar; } - bool AddAdornments(long style); -#endif - -#if wxUSE_ACCEL - // get the accel table for all the menus - const wxAcceleratorTable& GetAccelTable() const { return m_accelTable; } - - // update the accel table (must be called after adding/deleting a menu) - void RebuildAccelTable(); -#endif // wxUSE_ACCEL - - // get the menu handle - WXHMENU GetHMenu() const { return m_hMenu; } - - // if the menubar is modified, the display is not updated automatically, - // call this function to update it (m_menuBarFrame should be !NULL) - void Refresh(); - - // To avoid compile warning - void Refresh( bool eraseBackground, - const wxRect *rect = (const wxRect *) NULL ) { wxWindow::Refresh(eraseBackground, rect); } - -protected: - // common part of all ctors - void Init(); - - wxArrayString m_titles; - wxMenuInfoList m_menuInfos; - - WXHMENU m_hMenu; - - // Return the MSW position for a wxMenu which is sometimes different from - // the wxWidgets position. - int MSWPositionForWxMenu(wxMenu *menu, int wxpos); -#if wxUSE_ACCEL - // the accelerator table for all accelerators in all our menus - wxAcceleratorTable m_accelTable; -#endif // wxUSE_ACCEL - -#if defined(__WXWINCE__) && wxUSE_TOOLBAR - wxToolBar* m_toolBar; -#endif - -#ifdef WINCE_WITH_COMMANDBAR - WXHWND m_commandBar; - bool m_adornmentsAdded; -#endif - -private: - DECLARE_DYNAMIC_CLASS_NO_COPY(wxMenuBar) - -public: - -#if wxABI_VERSION >= 20805 - // Gets the original label at the top-level of the menubar - wxString GetMenuLabel(size_t pos) const; -#endif -}; - -#endif // _WX_MENU_H_ diff --git a/wxWidgets/include/wx/msw/menuitem.h b/wxWidgets/include/wx/msw/menuitem.h deleted file mode 100644 index 1e49604cb6..0000000000 --- a/wxWidgets/include/wx/msw/menuitem.h +++ /dev/null @@ -1,100 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: menuitem.h -// Purpose: wxMenuItem class -// Author: Vadim Zeitlin -// Modified by: -// Created: 11.11.97 -// RCS-ID: $Id: menuitem.h 48053 2007-08-13 17:07:01Z JS $ -// Copyright: (c) 1998 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr> -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _MENUITEM_H -#define _MENUITEM_H - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -#if wxUSE_OWNER_DRAWN - #include "wx/ownerdrw.h" // base class -#endif - -// ---------------------------------------------------------------------------- -// wxMenuItem: an item in the menu, optionally implements owner-drawn behaviour -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxMenuItem : public wxMenuItemBase -#if wxUSE_OWNER_DRAWN - , public wxOwnerDrawn -#endif -{ -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 SetCheckable(bool checkable); - - virtual void Enable(bool bDoEnable = true); - virtual void Check(bool bDoCheck = true); - virtual bool IsChecked() const; - - // unfortunately needed to resolve ambiguity between - // wxMenuItemBase::IsCheckable() and wxOwnerDrawn::IsCheckable() - bool IsCheckable() const { return wxMenuItemBase::IsCheckable(); } - - // the id for a popup menu is really its menu handle (as required by - // ::AppendMenu() API), so this function will return either the id or the - // menu handle depending on what we're - int GetRealId() const; - - // mark item as belonging to the given radio group - void SetAsRadioGroupStart(); - void SetRadioGroupStart(int start); - void SetRadioGroupEnd(int end); - - // compatibility only, don't use in new code - wxMenuItem(wxMenu *parentMenu, - int id, - const wxString& text, - const wxString& help, - bool isCheckable, - wxMenu *subMenu = (wxMenu *)NULL); - -private: - // common part of all ctors - void Init(); - - // 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; - - DECLARE_DYNAMIC_CLASS_NO_COPY(wxMenuItem) - -public: - -#if wxABI_VERSION >= 20805 - // return the item label including any mnemonics and accelerators. - // This used to be called GetText. - wxString GetItemLabel() const { return GetText(); } -#endif -}; - -#endif //_MENUITEM_H diff --git a/wxWidgets/include/wx/msw/metafile.h b/wxWidgets/include/wx/msw/metafile.h deleted file mode 100644 index 04effbb6d8..0000000000 --- a/wxWidgets/include/wx/msw/metafile.h +++ /dev/null @@ -1,171 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/msw/metafile.h -// Purpose: wxMetaFile, wxMetaFileDC and wxMetaFileDataObject classes -// Author: Julian Smart -// Modified by: VZ 07.01.00: implemented wxMetaFileDataObject -// Created: 01/02/97 -// RCS-ID: $Id: metafile.h 46103 2007-05-18 15:14:44Z VZ $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_METAFIILE_H_ -#define _WX_METAFIILE_H_ - -#include "wx/dc.h" -#include "wx/gdiobj.h" - -#if wxUSE_DRAG_AND_DROP - #include "wx/dataobj.h" -#endif - -// ---------------------------------------------------------------------------- -// Metafile and metafile device context classes -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxMetafile; - -class WXDLLEXPORT wxMetafileRefData: public wxGDIRefData -{ - friend class WXDLLEXPORT wxMetafile; -public: - wxMetafileRefData(); - virtual ~wxMetafileRefData(); - -public: - WXHANDLE m_metafile; - int m_windowsMappingMode; - int m_width, m_height; -}; - -#define M_METAFILEDATA ((wxMetafileRefData *)m_refData) - -class WXDLLEXPORT wxMetafile: public wxGDIObject -{ -public: - wxMetafile(const wxString& file = wxEmptyString); - virtual ~wxMetafile(); - - // 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); - bool Ok() const { return IsOk(); } - bool IsOk() const { return (M_METAFILEDATA && (M_METAFILEDATA->m_metafile != 0)); }; - - // set/get the size of metafile for clipboard operations - wxSize GetSize() const { return wxSize(GetWidth(), GetHeight()); } - int GetWidth() const { return M_METAFILEDATA->m_width; } - int GetHeight() const { return M_METAFILEDATA->m_height; } - - void SetWidth(int width) { M_METAFILEDATA->m_width = width; } - void SetHeight(int height) { M_METAFILEDATA->m_height = height; } - - // Implementation - WXHANDLE GetHMETAFILE() const { return M_METAFILEDATA->m_metafile; } - void SetHMETAFILE(WXHANDLE mf) ; - int GetWindowsMappingMode() const { return M_METAFILEDATA->m_windowsMappingMode; } - void SetWindowsMappingMode(int mm); - -private: - DECLARE_DYNAMIC_CLASS(wxMetafile) -}; - -class WXDLLEXPORT wxMetafileDC: public wxDC -{ -public: - // Don't supply origin and extent - // Supply them to wxMakeMetaFilePlaceable instead. - wxMetafileDC(const wxString& file = wxEmptyString); - - // Supply origin and extent (recommended). - // Then don't need to supply them to wxMakeMetaFilePlaceable. - wxMetafileDC(const wxString& file, int xext, int yext, int xorg, int yorg); - - virtual ~wxMetafileDC(); - - // Should be called at end of drawing - virtual wxMetafile *Close(); - virtual void SetMapMode(int mode); - -#if wxABI_VERSION >= 20805 - virtual void DoGetTextExtent(const wxString& string, - wxCoord *x, wxCoord *y, - wxCoord *descent = NULL, - wxCoord *externalLeading = NULL, - const wxFont *theFont = NULL) const; -#endif // wx ABI 2.8.5+ - - // this method shouldn't have been defined here (DoGetTextExtent() is the - // correct one) but keep it to avoid breaking binary backwards - // compatibility - virtual void GetTextExtent(const wxString& string, long *x, long *y, - long *descent = NULL, long *externalLeading = NULL, - wxFont *theFont = NULL, bool use16bit = false) const; - - // Implementation - wxMetafile *GetMetaFile() const { return m_metaFile; } - void SetMetaFile(wxMetafile *mf) { m_metaFile = mf; } - int GetWindowsMappingMode() const { return m_windowsMappingMode; } - void SetWindowsMappingMode(int mm) { m_windowsMappingMode = mm; } - -protected: - virtual void DoGetSize(int *width, int *height) const; - - int m_windowsMappingMode; - wxMetafile* m_metaFile; - -private: - DECLARE_DYNAMIC_CLASS(wxMetafileDC) -}; - -/* - * 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 -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_DRAG_AND_DROP - -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); - -protected: - wxMetafile m_metafile; -}; - -#endif // wxUSE_DRAG_AND_DROP - -#endif - // _WX_METAFIILE_H_ - diff --git a/wxWidgets/include/wx/msw/microwin.h b/wxWidgets/include/wx/msw/microwin.h deleted file mode 100644 index 934302d0c6..0000000000 --- a/wxWidgets/include/wx/msw/microwin.h +++ /dev/null @@ -1,235 +0,0 @@ -/* -///////////////////////////////////////////////////////////////////////////// -// Name: microwin.h -// Purpose: Extra implementation for MicroWindows -// Author: Julian Smart -// Created: 2001-05-31 -// RCS-ID: $Id: microwin.h 35650 2005-09-23 12:56:45Z MR $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// -*/ - -#ifndef _WX_MICROWIN_H_ -#define _WX_MICROWIN_H_ - -/* Implemented by microwin.cpp */ - -#ifdef __cplusplus -extern "C" { -#endif - -BOOL SetCursorPos(int x, int y); - -HCURSOR SetCursor(HCURSOR hCursor); - -/* Implemented with wrong number of args by MicroWindows */ -/* so we need to use a different name */ -int GetScrollPosWX (HWND hWnd, int iSBar); - -BOOL ScrollWindow(HWND, int xAmount, int yAmount, - CONST RECT* lpRect, CONST RECT* lpClipRect); - -HWND WindowFromPoint(POINT pt); -SHORT GetKeyState(int nVirtKey); -HWND SetParent(HWND hWndChild, HWND hWndNewParent); -VOID DragAcceptFiles(HWND, BOOL); -BOOL IsDialogMessage(HWND hWnd, MSG* msg); -DWORD GetMessagePos(VOID); -BOOL IsIconic(HWND hWnd); -int SetMapMode(HDC hDC, int mode); -int GetMapMode(HDC hDC); -HCURSOR LoadCursor(HINSTANCE hInst, int cursor); -DWORD GetModuleFileName(HINSTANCE hInst, LPSTR name, DWORD sz); -VOID DestroyIcon(HICON hIcon); -COLORREF GetTextColor(HDC hdc); -COLORREF GetBkColor(HDC hdc); -HPALETTE SelectPalette(HDC hdc, HPALETTE hPalette, BOOL b); -BOOL IntersectClipRect(HDC hdc, int x, int y, - int w, int h); -BOOL GetClipBox(HDC hdc, RECT* rect); -BOOL DrawIconEx(HDC hdc, int x, int y, HICON hIcon, int w, int h, UINT istepIfAniCur, HBRUSH hbrFlickerFreeDraw, UINT diFlags); -BOOL SetViewportExtEx(HDC hdc, int x, int y, LPSIZE lpSize); -BOOL SetViewportOrgEx(HDC hdc, int x, int y, LPPOINT lpPoint); -BOOL SetWindowExtEx(HDC hdc, int x, int y, LPSIZE lpSize); -BOOL SetWindowOrgEx(HDC hdc, int x, int y, LPPOINT lpSize); -BOOL ExtFloodFill(HDC hdc, int x, int y, COLORREF col, UINT flags); -int SetPolyFillMode(HDC hdc, int mode); -BOOL RoundRect(HDC hdc, int left, int top, int right, int bottom, int r1, int r2); -BOOL MaskBlt(HDC hdc, int x, int y, int w, int h, - HDC hDCSource, int xSrc, int ySrc, HBITMAP hBitmapMask, int xMask, int yMask, DWORD rop); -UINT RealizePalette(HDC hDC); -BOOL SetBrushOrgEx(HDC hdc, int xOrigin, int yOrigin, LPPOINT lpPoint); -int GetObject(HGDIOBJ hObj, int sz, LPVOID logObj); - -/* For some reason these aren't defined in the headers */ -BOOL EnableScrollBar (HWND hWnd, int iSBar, BOOL bEnable) ; -BOOL GetScrollPos (HWND hWnd, int iSBar, int* pPos); -BOOL GetScrollRange (HWND hWnd, int iSBar, int* pMinPos, int* pMaxPos); -BOOL SetScrollPos (HWND hWnd, int iSBar, int iNewPos); -BOOL SetScrollRange (HWND hWnd, int iSBar, int iMinPos, int iMaxPos); -BOOL SetScrollInfo (HWND hWnd, int iSBar, - LPCSCROLLINFO lpsi, BOOL fRedraw); -BOOL GetScrollInfo(HWND hWnd, int iSBar, LPSCROLLINFO lpsi); -BOOL ShowScrollBar (HWND hWnd, int iSBar, BOOL bShow); -HBITMAP WINAPI -CreateBitmap( int width, int height, int nPlanes, int bPP, LPCVOID lpData); - -#ifdef __cplusplus -} -#endif - -/* - * Key State Masks for Mouse Messages - */ -#ifndef MK_LBUTTON -#define MK_LBUTTON 0x0001 -#define MK_RBUTTON 0x0002 -#define MK_SHIFT 0x0004 -#define MK_CONTROL 0x0008 -#define MK_MBUTTON 0x0010 -#endif - -/* - * DrawIcon flags - */ - -#ifndef DI_MASK -#define DI_MASK 0x0001 -#define DI_IMAGE 0x0002 -#define DI_NORMAL 0x0003 -#define DI_COMPAT 0x0004 -#define DI_DEFAULTSIZE 0x0008 -#endif - -/* TODO: May have to fake these message */ -#ifndef WM_INITDIALOG -#define WM_INITDIALOG 0x0110 -#endif -#ifndef WM_QUERYENDSESSION -#define WM_QUERYENDSESSION 0x0011 -#endif -#ifndef WM_ENDSESSION -#define WM_ENDSESSION 0x0016 -#endif -#ifndef WM_SETCURSOR -#define WM_SETCURSOR 0x0020 -#endif -#ifndef WM_GETMINMAXINFO -#define WM_GETMINMAXINFO 0x0024 -typedef struct tagMINMAXINFO { - POINT ptReserved; - POINT ptMaxSize; - POINT ptMaxPosition; - POINT ptMinTrackSize; - POINT ptMaxTrackSize; -} MINMAXINFO, *PMINMAXINFO, *LPMINMAXINFO; - -#endif -#ifndef WM_SYSCOMMAND -#define WM_SYSCOMMAND 0x0112 -#endif -#ifndef WM_SYSCOLORCHANGE -#define WM_SYSCOLORCHANGE 0x0015 -#endif -#ifndef WM_QUERYNEWPALETTE -#define WM_QUERYNEWPALETTE 0x030F -#endif -#ifndef WM_PALETTEISCHANGING -#define WM_PALETTEISCHANGING 0x0310 -#endif -#ifndef WM_PALETTECHANGED -#define WM_PALETTECHANGED 0x0311 -#endif -#ifndef WM_NOTIFY -#define WM_NOTIFY 0x004E -#endif -#ifndef WM_DROPFILES -#define WM_DROPFILES 0x0233 -#endif - -#ifndef PALETTERGB -#define PALETTERGB RGB -#endif - -#ifndef MM_TEXT -#define MM_TEXT 1 -#define MM_LOMETRIC 2 -#define MM_HIMETRIC 3 -#define MM_LOENGLISH 4 -#define MM_HIENGLISH 5 -#define MM_TWIPS 6 -#define MM_ISOTROPIC 7 -#define MM_ANISOTROPIC 8 -#endif - -#ifndef SC_MAXIMIZE -#define SC_MINIMIZE 0xF020 -#define SC_MAXIMIZE 0xF030 -#endif - -// TODO: all of them -#ifndef IDC_ARROW -#define IDC_ARROW 1 -#endif - -/* - * Standard Cursor IDs - */ -#ifndef MAKEINTRESOURCE -#define MAKEINTRESOURCE(r) r -#endif - -#ifndef IDC_ARROW -#define IDC_ARROW MAKEINTRESOURCE(32512) -#define IDC_IBEAM MAKEINTRESOURCE(32513) -#define IDC_WAIT MAKEINTRESOURCE(32514) -#define IDC_CROSS MAKEINTRESOURCE(32515) -#define IDC_UPARROW MAKEINTRESOURCE(32516) -#define IDC_SIZE MAKEINTRESOURCE(32640) /* OBSOLETE: use IDC_SIZEALL */ -#define IDC_ICON MAKEINTRESOURCE(32641) /* OBSOLETE: use IDC_ARROW */ -#define IDC_SIZENWSE MAKEINTRESOURCE(32642) -#define IDC_SIZENESW MAKEINTRESOURCE(32643) -#define IDC_SIZEWE MAKEINTRESOURCE(32644) -#define IDC_SIZENS MAKEINTRESOURCE(32645) -#define IDC_SIZEALL MAKEINTRESOURCE(32646) -#define IDC_NO MAKEINTRESOURCE(32648) /* not in win3.1 */ -#if(WINVER >= 0x0500) -#define IDC_HAND MAKEINTRESOURCE(32649) -#endif /* WINVER >= 0x0500 */ -#define IDC_APPSTARTING MAKEINTRESOURCE(32650) /* not in win3.1 */ -#if(WINVER >= 0x0400) -#define IDC_HELP MAKEINTRESOURCE(32651) -#endif /* WINVER >= 0x0400 */ -#endif - -/* ExtFloodFill style flags */ -#define FLOODFILLBORDER 0 -#define FLOODFILLSURFACE 1 - -/* PolyFill() Modes */ -#define ALTERNATE 1 -#define WINDING 2 -#define POLYFILL_LAST 2 - -/* Quaternary raster codes */ -#define MAKEROP4(fore,back) (DWORD)((((back) << 8) & 0xFF000000) | (fore)) - -/* Device Parameters for GetDeviceCaps() */ -#define DRIVERVERSION 0 /* Device driver version */ -#define TECHNOLOGY 2 /* Device classification */ -#define HORZSIZE 4 /* Horizontal size in millimeters */ -#define VERTSIZE 6 /* Vertical size in millimeters */ - -/* Ternary raster operations */ -/* Now defined by MicroWindows */ -#if 0 -#define DSTINVERT (DWORD)0x00550009 /* dest = (NOT dest) */ -#define WHITENESS (DWORD)0x00FF0062 /* dest = WHITE */ -#define SRCERASE (DWORD)0x00440328 /* dest = source AND (NOT dest ) */ -#define MERGEPAINT (DWORD)0x00BB0226 /* dest = (NOT source) OR dest */ -#define SRCPAINT (DWORD)0x00EE0086 /* dest = source OR dest */ -#define NOTSRCCOPY (DWORD)0x00330008 /* dest = (NOT source) */ -#endif - -#endif /* _WX_MICROWIN_H_ */ diff --git a/wxWidgets/include/wx/msw/mimetype.h b/wxWidgets/include/wx/msw/mimetype.h deleted file mode 100644 index 0b5107ac69..0000000000 --- a/wxWidgets/include/wx/msw/mimetype.h +++ /dev/null @@ -1,122 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/msw/mimetype.h -// Purpose: classes and functions to manage MIME types -// Author: Vadim Zeitlin -// Modified by: -// Created: 23.09.98 -// RCS-ID: $Id: mimetype.h 35650 2005-09-23 12:56:45Z MR $ -// Copyright: (c) 1998 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr> -// Licence: wxWindows licence (part of wxExtra library) -///////////////////////////////////////////////////////////////////////////// - -#ifndef _MIMETYPE_IMPL_H -#define _MIMETYPE_IMPL_H - -#include "wx/defs.h" - -#if wxUSE_MIMETYPE - -#include "wx/mimetype.h" - -// ---------------------------------------------------------------------------- -// wxFileTypeImpl is the MSW version of wxFileType, this is a private class -// and is never used directly by the application -// ---------------------------------------------------------------------------- - -class WXDLLIMPEXP_BASE wxFileTypeImpl -{ -public: - // ctor - wxFileTypeImpl() { } - - // one of these Init() function must be called (ctor can't take any - // arguments because it's common) - - // initialize us with our file type name and extension - in this case - // we will read all other data from the registry - void Init(const wxString& strFileType, const wxString& 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& params) const; - bool GetPrintCommand(wxString *printCmd, - const wxFileType::MessageParameters& params) const; - - size_t GetAllCommands(wxArrayString * verbs, wxArrayString * commands, - const wxFileType::MessageParameters& params) const; - - bool Unassociate(); - - // 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& cmd = wxEmptyString, int index = 0); - - // this is called by Associate - bool SetDescription (const wxString& desc); - -private: - // helper function: reads the command corresponding to the specified verb - // from the registry (returns an empty string if not found) - wxString GetCommand(const wxChar *verb) const; - - // get the registry path for the given verb - wxString GetVerbPath(const wxString& verb) const; - - // check that the registry key for our extension exists, create it if it - // doesn't, return false if this failed - bool EnsureExtKeyExists(); - - wxString m_strFileType, // may be empty - m_ext; - - // these methods are not publicly accessible (as wxMimeTypesManager - // doesn't know about them), and should only be called by Unassociate - - bool RemoveOpenCommand(); - bool RemoveCommand(const wxString& verb); - bool RemoveMimeType(); - bool RemoveDefaultIcon(); - bool RemoveDescription(); -}; - -class WXDLLIMPEXP_BASE wxMimeTypesManagerImpl -{ -public: - // nothing to do here, we don't load any data but just go and fetch it from - // the registry when asked for - wxMimeTypesManagerImpl() { } - - // 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 Windows - bool ReadMailcap(const wxString& WXUNUSED(filename), bool WXUNUSED(fallback) = true) - { return true; } - bool ReadMimeTypes(const wxString& WXUNUSED(filename)) - { return true; } - - // create a new filetype association - wxFileType *Associate(const wxFileTypeInfo& ftInfo); - - // create a new filetype with the given name and extension - wxFileType *CreateFileType(const wxString& filetype, const wxString& ext); -}; - -#endif // wxUSE_MIMETYPE - -#endif - //_MIMETYPE_IMPL_H - diff --git a/wxWidgets/include/wx/msw/minifram.h b/wxWidgets/include/wx/msw/minifram.h deleted file mode 100644 index 63dc24f1bd..0000000000 --- a/wxWidgets/include/wx/msw/minifram.h +++ /dev/null @@ -1,52 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/msw/minifram.h -// Purpose: wxMiniFrame class -// Author: Julian Smart -// Modified by: -// Created: 01/02/97 -// RCS-ID: $Id: minifram.h 35650 2005-09-23 12:56:45Z MR $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_MINIFRAM_H_ -#define _WX_MINIFRAM_H_ - -#include "wx/frame.h" - -class WXDLLEXPORT wxMiniFrame : public wxFrame -{ -public: - wxMiniFrame() { } - - bool Create(wxWindow *parent, - wxWindowID id, - const wxString& title, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = wxCAPTION | wxCLIP_CHILDREN | wxRESIZE_BORDER, - const wxString& name = wxFrameNameStr) - { - return wxFrame::Create(parent, id, title, pos, size, - style | - wxFRAME_TOOL_WINDOW | - (parent ? wxFRAME_FLOAT_ON_PARENT : 0), name); - } - - wxMiniFrame(wxWindow *parent, - wxWindowID id, - const wxString& title, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = wxCAPTION | wxCLIP_CHILDREN | wxRESIZE_BORDER, - const wxString& name = wxFrameNameStr) - { - Create(parent, id, title, pos, size, style, name); - } - -protected: - DECLARE_DYNAMIC_CLASS_NO_COPY(wxMiniFrame) -}; - -#endif - // _WX_MINIFRAM_H_ diff --git a/wxWidgets/include/wx/msw/missing.h b/wxWidgets/include/wx/msw/missing.h deleted file mode 100644 index 871cbfafd0..0000000000 --- a/wxWidgets/include/wx/msw/missing.h +++ /dev/null @@ -1,495 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/msw/missing.h -// Purpose: Declarations for parts of the Win32 SDK that are missing in -// the versions that come with some compilers -// Created: 2002/04/23 -// RCS-ID: $Id: missing.h 48436 2007-08-28 19:26:16Z JS $ -// Copyright: (c) 2002 Mattia Barbon -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_MISSING_H_ -#define _WX_MISSING_H_ - -/* - * The following are required for VC++ 6. - */ - -// Needed by cursor.cpp -#ifndef IDC_HAND - #define IDC_HAND MAKEINTRESOURCE(32649) -#endif - -// Needed by strconv.cpp -#ifndef WC_NO_BEST_FIT_CHARS - #define WC_NO_BEST_FIT_CHARS 0x400 -#endif - -#ifndef WM_CONTEXTMENU - #define WM_CONTEXTMENU 0x007B -#endif - -// Needed by toplevel.cpp -#ifndef WM_UPDATEUISTATE - #define WM_UPDATEUISTATE 0x0128 -#endif - -#ifndef WM_CHANGEUISTATE - #define WM_CHANGEUISTATE 0x0127 -#endif - -#ifndef WM_PRINTCLIENT - #define WM_PRINTCLIENT 0x318 -#endif - -// Needed by toplevel.cpp -#ifndef UIS_SET - #define UIS_SET 1 - #define UIS_CLEAR 2 - #define UIS_INITIALIZE 3 -#endif - -#ifndef UISF_HIDEFOCUS - #define UISF_HIDEFOCUS 1 -#endif - -#ifndef UISF_HIDEACCEL - #define UISF_HIDEACCEL 2 -#endif - -#ifndef OFN_EXPLORER - #define OFN_EXPLORER 0x00080000 -#endif - -#ifndef OFN_ENABLESIZING - #define OFN_ENABLESIZING 0x00800000 -#endif - -// Needed by window.cpp -#if wxUSE_MOUSEWHEEL - #ifndef WM_MOUSEWHEEL - #define WM_MOUSEWHEEL 0x020A - #endif - #ifndef WHEEL_DELTA - #define WHEEL_DELTA 120 - #endif - #ifndef SPI_GETWHEELSCROLLLINES - #define SPI_GETWHEELSCROLLLINES 104 - #endif -#endif // wxUSE_MOUSEWHEEL - -// Needed by window.cpp -#ifndef VK_OEM_1 - #define VK_OEM_1 0xBA - #define VK_OEM_2 0xBF - #define VK_OEM_3 0xC0 - #define VK_OEM_4 0xDB - #define VK_OEM_5 0xDC - #define VK_OEM_6 0xDD - #define VK_OEM_7 0xDE -#endif - -#ifndef VK_OEM_COMMA - #define VK_OEM_PLUS 0xBB - #define VK_OEM_COMMA 0xBC - #define VK_OEM_MINUS 0xBD - #define VK_OEM_PERIOD 0xBE -#endif - -#ifndef SM_TABLETPC - #define SM_TABLETPC 86 -#endif - -#ifndef INKEDIT_CLASS -# define INKEDIT_CLASSW L"INKEDIT" -# ifdef UNICODE -# define INKEDIT_CLASS INKEDIT_CLASSW -# else -# define INKEDIT_CLASS "INKEDIT" -# endif -#endif - -#ifndef EM_SETINKINSERTMODE -# define EM_SETINKINSERTMODE (WM_USER + 0x0204) -#endif - -#ifndef EM_SETUSEMOUSEFORINPUT -#define EM_SETUSEMOUSEFORINPUT (WM_USER + 0x224) -#endif - -#ifndef TPM_RECURSE -#define TPM_RECURSE 1 -#endif - - -#ifndef WS_EX_LAYOUTRTL -#define WS_EX_LAYOUTRTL 0x00400000 -#endif - -#ifndef WS_EX_COMPOSITED -#define WS_EX_COMPOSITED 0x02000000L -#endif - -#ifndef WS_EX_LAYERED -#define WS_EX_LAYERED 0x00080000 -#endif - -#ifndef LWA_ALPHA -#define LWA_ALPHA 2 -#endif - -#if defined __VISUALC__ && __VISUALC__ <= 1200 && !defined MIIM_BITMAP -#define MIIM_STRING 0x00000040 -#define MIIM_BITMAP 0x00000080 -#define MIIM_FTYPE 0x00000100 -#define HBMMENU_CALLBACK ((HBITMAP) -1) -typedef struct tagMENUINFO -{ - DWORD cbSize; - DWORD fMask; - DWORD dwStyle; - UINT cyMax; - HBRUSH hbrBack; - DWORD dwContextHelpID; - DWORD dwMenuData; -} MENUINFO, FAR *LPMENUINFO; -struct wxMENUITEMINFO_ -{ - UINT cbSize; - UINT fMask; - UINT fType; - UINT fState; - UINT wID; - HMENU hSubMenu; - HBITMAP hbmpChecked; - HBITMAP hbmpUnchecked; - DWORD dwItemData; - LPTSTR dwTypeData; - UINT cch; - HBITMAP hbmpItem; -}; -#else -#define wxMENUITEMINFO_ MENUITEMINFO -#endif - -/* - * The following are required for VC++ 5 when the PSDK is not available. - */ - -#if defined __VISUALC__ && __VISUALC__ <= 1100 - -#ifndef VER_NT_WORKSTATION - -typedef struct _OSVERSIONINFOEXA { - DWORD dwOSVersionInfoSize; - DWORD dwMajorVersion; - DWORD dwMinorVersion; - DWORD dwBuildNumber; - DWORD dwPlatformId; - CHAR szCSDVersion[128]; - WORD wServicePackMajor; - WORD wServicePackMinor; - WORD wSuiteMask; - BYTE wProductType; - BYTE wReserved; -} OSVERSIONINFOEXA, *POSVERSIONINFOEXA, *LPOSVERSIONINFOEXA; -typedef struct _OSVERSIONINFOEXW { - DWORD dwOSVersionInfoSize; - DWORD dwMajorVersion; - DWORD dwMinorVersion; - DWORD dwBuildNumber; - DWORD dwPlatformId; - WCHAR szCSDVersion[128]; - WORD wServicePackMajor; - WORD wServicePackMinor; - WORD wSuiteMask; - BYTE wProductType; - BYTE wReserved; -} OSVERSIONINFOEXW, *POSVERSIONINFOEXW, *LPOSVERSIONINFOEXW; - -#ifdef UNICODE -typedef OSVERSIONINFOW OSVERSIONINFO,*POSVERSIONINFO,*LPOSVERSIONINFO; -typedef OSVERSIONINFOEXW OSVERSIONINFOEX,*POSVERSIONINFOEX,*LPOSVERSIONINFOEX; -#else -typedef OSVERSIONINFOA OSVERSIONINFO,*POSVERSIONINFO,*LPOSVERSIONINFO; -typedef OSVERSIONINFOEXA OSVERSIONINFOEX,*POSVERSIONINFOEX,*LPOSVERSIONINFOEX; -#endif - -#endif // defined VER_NT_WORKSTATION - -#ifndef CP_SYMBOL - #define CP_SYMBOL 42 -#endif - -// NMLVCUSTOMDRAW originally didn't have the iSubItem member. It was added -// with IE4, as was IPN_FIRST which is used as a test :-(. -// -#ifndef IPN_FIRST - -typedef struct wxtagNMLVCUSTOMDRAW_ { - NMCUSTOMDRAW nmcd; - COLORREF clrText; - COLORREF clrTextBk; - int iSubItem; -} wxNMLVCUSTOMDRAW_, *wxLPNMLVCUSTOMDRAW_; - -#define NMLVCUSTOMDRAW wxNMLVCUSTOMDRAW_ -#define LPNMLVCUSTOMDRAW wxLPNMLVCUSTOMDRAW_ - -#endif // defined IPN_FIRST - -#endif // defined __VISUALC__ && __VISUALC__ <= 1100 - -// ---------------------------------------------------------------------------- -// ListView common control -// Needed by listctrl.cpp -// ---------------------------------------------------------------------------- - -#ifndef LVS_EX_FULLROWSELECT - #define LVS_EX_FULLROWSELECT 0x00000020 -#endif - -#ifndef LVS_EX_LABELTIP - #define LVS_EX_LABELTIP 0x00004000 -#endif - -#ifndef LVS_EX_SUBITEMIMAGES - #define LVS_EX_SUBITEMIMAGES 0x00000002 -#endif - -#ifndef HDN_GETDISPINFOW - #define HDN_GETDISPINFOW (HDN_FIRST-29) -#endif - - /* - * In addition to the above, the following are required for several compilers. - */ - -#if !defined(CCS_VERT) -#define CCS_VERT 0x00000080L -#endif - -#if !defined(CCS_RIGHT) -#define CCS_RIGHT (CCS_VERT|CCS_BOTTOM) -#endif - -#if !defined(TB_SETDISABLEDIMAGELIST) - #define TB_SETDISABLEDIMAGELIST (WM_USER + 54) -#endif // !defined(TB_SETDISABLEDIMAGELIST) - -#ifndef CFM_BACKCOLOR - #define CFM_BACKCOLOR 0x04000000 -#endif - -#ifndef HANGUL_CHARSET - #define HANGUL_CHARSET 129 -#endif - -#ifndef CCM_SETUNICODEFORMAT - #define CCM_SETUNICODEFORMAT 8197 -#endif - -// ---------------------------------------------------------------------------- -// Tree control -// ---------------------------------------------------------------------------- - -#ifndef TV_FIRST - #define TV_FIRST 0x1100 -#endif - -#ifndef TVS_FULLROWSELECT - #define TVS_FULLROWSELECT 0x1000 -#endif - -#ifndef TVM_SETBKCOLOR - #define TVM_SETBKCOLOR (TV_FIRST + 29) - #define TVM_SETTEXTCOLOR (TV_FIRST + 30) -#endif - - /* - * The following are required for BC++ 5.5 (none at present.) - */ - - /* - * The following are specifically required for Digital Mars C++ - */ - -#ifdef __DMC__ - -typedef struct _OSVERSIONINFOEX { - DWORD dwOSVersionInfoSize; - DWORD dwMajorVersion; - DWORD dwMinorVersion; - DWORD dwBuildNumber; - DWORD dwPlatformId; - TCHAR szCSDVersion[ 128 ]; - WORD wServicePackMajor; - WORD wServicePackMinor; - WORD wSuiteMask; - BYTE wProductType; - BYTE wReserved; -} OSVERSIONINFOEX; - -#ifndef _TrackMouseEvent - #define _TrackMouseEvent TrackMouseEvent -#endif - -#ifndef LVM_SETEXTENDEDLISTVIEWSTYLE - #define LVM_SETEXTENDEDLISTVIEWSTYLE (0x1000 + 54) -#endif - -#ifndef LVM_GETSUBITEMRECT - #define LVM_GETSUBITEMRECT (0x1000 + 56) -#endif - -#ifndef LVCF_IMAGE - #define LVCF_IMAGE 0x0010 -#endif - -#ifndef Header_GetItemRect - #define Header_GetItemRect(w,i,r) \ - (BOOL)SendMessage((w),HDM_GETITEMRECT,(WPARAM)(i),(LPARAM)(r)) -#endif - -#ifndef HDM_GETITEMRECT - #define HDM_GETITEMRECT (HDM_FIRST+7) -#endif - -#ifndef ListView_GetHeader - #define ListView_GetHeader(w) (HWND)SendMessage((w),LVM_GETHEADER,0,0) -#endif - -#ifndef ListView_GetSubItemRect - #define ListView_GetSubItemRect(w, i, s, c, p) (HWND)SendMessage(w,LVM_GETSUBITEMRECT,i, ((p) ? ((((LPRECT)(p))->top = s), (((LPRECT)(p))->left = c), (LPARAM)(p)) : (LPARAM)(LPRECT)NULL)) -#endif - -#ifndef LVM_GETHEADER - #define LVM_GETHEADER (LVM_FIRST+31) -#endif - -#ifndef LVSICF_NOSCROLL - #define LVSICF_NOINVALIDATEALL 0x0001 - #define LVSICF_NOSCROLL 0x0002 -#endif - -#ifndef CP_SYMBOL - #define CP_SYMBOL 42 -#endif - -// ---------------------------------------------------------------------------- -// wxDisplay -// ---------------------------------------------------------------------------- - -// The windows headers with Digital Mars lack some typedefs. -// typedef them as my_XXX and then #define to rename to XXX in case -// a newer version of Digital Mars fixes the headers -// (or up to date PSDK is in use with older version) -// also we use any required definition (MONITOR_DEFAULTTONULL) to recognize -// whether whole missing block needs to be included - -#ifndef MONITOR_DEFAULTTONULL - - #define HMONITOR_DECLARED - DECLARE_HANDLE(HMONITOR); - typedef BOOL(CALLBACK* my_MONITORENUMPROC)(HMONITOR,HDC,LPRECT,LPARAM); - #define MONITORENUMPROC my_MONITORENUMPROC - typedef struct my_tagMONITORINFO { - DWORD cbSize; - RECT rcMonitor; - RECT rcWork; - DWORD dwFlags; - } my_MONITORINFO,*my_LPMONITORINFO; - #define MONITORINFO my_MONITORINFO - #define LPMONITORINFO my_LPMONITORINFO - - typedef struct my_MONITORINFOEX : public my_tagMONITORINFO - { - TCHAR szDevice[CCHDEVICENAME]; - } my_MONITORINFOEX, *my_LPMONITORINFOEX; - #define MONITORINFOEX my_MONITORINFOEX - #define LPMONITORINFOEX my_LPMONITORINFOEX - - #ifndef MONITOR_DEFAULTTONULL - #define MONITOR_DEFAULTTONULL 0 - #endif // MONITOR_DEFAULTTONULL - - #ifndef MONITORINFOF_PRIMARY - #define MONITORINFOF_PRIMARY 1 - #endif // MONITORINFOF_PRIMARY - - #ifndef DDENUM_ATTACHEDSECONDARYDEVICES - #define DDENUM_ATTACHEDSECONDARYDEVICES 1 - #endif - -#endif // MONITOR_DEFAULTTONULL - -// ---------------------------------------------------------------------------- -// Tree control -// ---------------------------------------------------------------------------- - -#ifndef TVIS_FOCUSED - #define TVIS_FOCUSED 0x0001 -#endif - -#ifndef TVS_CHECKBOXES - #define TVS_CHECKBOXES 0x0100 -#endif - -#ifndef TVITEM - #define TVITEM TV_ITEM -#endif - -#endif - // DMC++ - - /* - * The following are specifically required for OpenWatcom C++ (none at present) - */ - -#if defined(__WATCOMC__) -#endif - - /* - * The following are specifically required for MinGW (none at present) - */ - -#if defined (__MINGW32__) - -#if !wxCHECK_W32API_VERSION(3,1) - -#include <windows.h> -#include "wx/msw/winundef.h" - -typedef struct -{ - RECT rgrc[3]; - WINDOWPOS *lppos; -} NCCALCSIZE_PARAMS, *LPNCCALCSIZE_PARAMS; - -#endif - -#endif - - /* - * In addition to the declarations for VC++, the following are required for WinCE - */ - -#ifdef __WXWINCE__ - #include "wx/msw/wince/missing.h" -#endif - - /* - * The following are specifically required for Wine - */ - -#ifdef __WINE__ - #ifndef ENUM_CURRENT_SETTINGS - #define ENUM_CURRENT_SETTINGS ((DWORD)-1) - #endif - #ifndef BROADCAST_QUERY_DENY - #define BROADCAST_QUERY_DENY 1112363332 - #endif -#endif // defined __WINE__ - -#endif - // _WX_MISSING_H_ diff --git a/wxWidgets/include/wx/msw/msgdlg.h b/wxWidgets/include/wx/msw/msgdlg.h deleted file mode 100644 index 8d43b38078..0000000000 --- a/wxWidgets/include/wx/msw/msgdlg.h +++ /dev/null @@ -1,42 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/msw/msgdlg.h -// Purpose: wxMessageDialog class -// Author: Julian Smart -// Modified by: -// Created: 01/02/97 -// RCS-ID: $Id: msgdlg.h 37164 2006-01-26 17:20:50Z ABX $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_MSGBOXDLG_H_ -#define _WX_MSGBOXDLG_H_ - -#include "wx/defs.h" -#include "wx/dialog.h" - -/* - * Message box dialog - */ - -extern WXDLLEXPORT_DATA(const wxChar) wxMessageBoxCaptionStr[]; - -class WXDLLEXPORT wxMessageDialog: public wxDialog, public wxMessageDialogBase -{ -DECLARE_DYNAMIC_CLASS(wxMessageDialog) -protected: - wxString m_caption; - wxString m_message; - wxWindow * m_parent; -public: - wxMessageDialog(wxWindow *parent, const wxString& message, const wxString& caption = wxMessageBoxCaptionStr, - long style = wxOK|wxCENTRE, const wxPoint& pos = wxDefaultPosition); - - int ShowModal(void); - - DECLARE_NO_COPY_CLASS(wxMessageDialog) -}; - - -#endif - // _WX_MSGBOXDLG_H_ diff --git a/wxWidgets/include/wx/msw/mslu.h b/wxWidgets/include/wx/msw/mslu.h deleted file mode 100644 index eccf13a26d..0000000000 --- a/wxWidgets/include/wx/msw/mslu.h +++ /dev/null @@ -1,23 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/msw/mslu.h -// Purpose: MSLU-related declarations -// Author: Vaclav Slavik -// Modified by: Vadim Zeitlin to move out various functions to other files -// to fix header inter-dependencies -// Created: 2002/02/17 -// RCS-ID: $Id: mslu.h 42462 2006-10-26 19:06:51Z VZ $ -// Copyright: (c) 2002 Vaclav Slavik -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_MSLU_H_ -#define _WX_MSLU_H_ - -#include "wx/defs.h" - -// Returns true if we are running under Unicode emulation in Win9x environment. -// Workaround hacks take effect only if this condition is met -// (NB: this function is needed even if !wxUSE_UNICODE_MSLU) -WXDLLIMPEXP_BASE bool wxUsingUnicowsDll(); - -#endif // _WX_MSLU_H_ diff --git a/wxWidgets/include/wx/msw/msvcrt.h b/wxWidgets/include/wx/msw/msvcrt.h deleted file mode 100644 index 913965de7f..0000000000 --- a/wxWidgets/include/wx/msw/msvcrt.h +++ /dev/null @@ -1,69 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/msw/msvcrt.h -// Purpose: macros to use some non-standard features of MS Visual C++ -// C run-time library -// Author: Vadim Zeitlin -// Modified by: -// Created: 31.01.1999 -// RCS-ID: $Id: msvcrt.h 42363 2006-10-24 23:19:12Z VZ $ -// Copyright: (c) Vadim Zeitlin -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// the goal of this file is to define wxCrtSetDbgFlag() macro which may be -// used like this: -// wxCrtSetDbgFlag(_CRTDBG_LEAK_CHECK_DF); -// to turn on memory leak checks for programs compiled with Microsoft Visual -// C++ (5.0+). The macro will expand to nothing under other compilers. - -#ifndef _MSW_MSVCRT_H_ -#define _MSW_MSVCRT_H_ - -// use debug CRT functions for memory leak detections in VC++ 5.0+ in debug -// builds -#undef wxUSE_VC_CRTDBG -#if defined(__WXDEBUG__) && defined(__VISUALC__) && (__VISUALC__ >= 1000) \ - && !defined(UNDER_CE) - // it doesn't combine well with wxWin own memory debugging methods - #if !wxUSE_GLOBAL_MEMORY_OPERATORS && !wxUSE_MEMORY_TRACING && !defined(__NO_VC_CRTDBG__) - #define wxUSE_VC_CRTDBG - #endif -#endif - -#ifdef wxUSE_VC_CRTDBG - // VC++ uses this macro as debug/release mode indicator - #ifndef _DEBUG - #define _DEBUG - #endif - - // Need to undef new if including crtdbg.h which may redefine new itself - #ifdef new - #undef new - #endif - - #include <stdlib.h> - #ifndef _CRTBLD - // Need when builded with pure MS SDK - #define _CRTBLD - #endif - - #include <crtdbg.h> - - #undef WXDEBUG_NEW - #define WXDEBUG_NEW new(_NORMAL_BLOCK, __FILE__, __LINE__) - - // this define works around a bug with inline declarations of new, see - // - // http://support.microsoft.com/support/kb/articles/Q140/8/58.asp - // - // for the details - #define new WXDEBUG_NEW - - #define wxCrtSetDbgFlag(flag) \ - _CrtSetDbgFlag(_CrtSetDbgFlag(_CRTDBG_REPORT_FLAG) | (flag)) -#else // !using VC CRT - #define wxCrtSetDbgFlag(flag) -#endif // wxUSE_VC_CRTDBG - -#endif // _MSW_MSVCRT_H_ - diff --git a/wxWidgets/include/wx/msw/notebook.h b/wxWidgets/include/wx/msw/notebook.h deleted file mode 100644 index 810bd8ae23..0000000000 --- a/wxWidgets/include/wx/msw/notebook.h +++ /dev/null @@ -1,254 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/msw/notebook.h -// Purpose: MSW/GTK compatible notebook (a.k.a. property sheet) -// Author: Robert Roebling -// Modified by: Vadim Zeitlin for Windows version -// RCS-ID: $Id: notebook.h 41797 2006-10-09 12:10:01Z VZ $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _NOTEBOOK_H -#define _NOTEBOOK_H - -#if wxUSE_NOTEBOOK - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -#include "wx/control.h" - -// ---------------------------------------------------------------------------- -// wxNotebook -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxNotebookPageInfo : public wxObject -{ -public : - wxNotebookPageInfo() { m_page = NULL; m_imageId = -1; m_selected = false; } - virtual ~wxNotebookPageInfo() { } - - void Create(wxNotebookPage *page, - const wxString& text, - bool selected, - int imageId) - { - m_page = page; - m_text = text; - m_selected = selected; - m_imageId = imageId; - } - - wxNotebookPage* GetPage() const { return m_page; } - wxString GetText() const { return m_text; } - bool GetSelected() const { return m_selected; } - int GetImageId() const { return m_imageId; } - -private: - wxNotebookPage *m_page; - wxString m_text; - bool m_selected; - int m_imageId; - - DECLARE_DYNAMIC_CLASS(wxNotebookPageInfo) -}; - - -WX_DECLARE_EXPORTED_LIST(wxNotebookPageInfo, wxNotebookPageInfoList ); - -class WXDLLEXPORT 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 = wxNotebookNameStr); - // Create() function - bool Create(wxWindow *parent, - wxWindowID id, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = 0, - const wxString& name = wxNotebookNameStr); - virtual ~wxNotebook(); - - // accessors - // --------- - // get number of pages in the dialog - virtual size_t GetPageCount() const; - - // 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; } - - // changes selected page without sending events - int ChangeSelection(size_t nPage); - - // set/get the title of a page - bool SetPageText(size_t nPage, const wxString& strText); - wxString GetPageText(size_t nPage) const; - - // image list stuff: each page may have an image associated with it. All - // the images belong to an image list, so you have to - // 1) create an image list - // 2) associate it with the notebook - // 3) set for each page it's image - // associate image list with a control - void SetImageList(wxImageList* imageList); - - // sets/returns item's image index in the current image list - int GetPageImage(size_t nPage) const; - bool SetPageImage(size_t nPage, int nImage); - - // currently it's always 1 because wxGTK doesn't support multi-row - // tab controls - int GetRowCount() const; - - // control the appearance of the notebook pages - // set the size (the same for all pages) - void SetPageSize(const wxSize& size); - // set the padding between tabs (in pixels) - void SetPadding(const wxSize& padding); - - // operations - // ---------- - // remove all pages - bool DeleteAllPages(); - - // inserts a new page to the notebook (it will be deleted ny the notebook, - // don't delete it yourself). If bSelect, this page becomes active. - bool InsertPage(size_t nPage, - wxNotebookPage *pPage, - const wxString& strText, - bool bSelect = false, - int imageId = -1); - - void AddPageInfo( wxNotebookPageInfo* info ) { AddPage( info->GetPage() , info->GetText() , info->GetSelected() , info->GetImageId() ); } - const wxNotebookPageInfoList& GetPageInfos() const; - - // Windows-only at present. Also, you must use the wxNB_FIXEDWIDTH - // style. - void SetTabSize(const wxSize& sz); - - // hit test - virtual int HitTest(const wxPoint& pt, long *flags = NULL) const; - - // calculate the size of the notebook from the size of its page - virtual wxSize CalcSizeFromPage(const wxSize& sizePage) const; - - // callbacks - // --------- - void OnSize(wxSizeEvent& event); - void OnSelChange(wxNotebookEvent& event); - void OnNavigationKey(wxNavigationKeyEvent& event); - - // base class virtuals - // ------------------- - - virtual bool MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result); - virtual bool MSWOnScroll(int orientation, WXWORD nSBCode, - WXWORD pos, WXHWND control); - -#if wxUSE_CONSTRAINTS - virtual void SetConstraintSizes(bool recurse = true); - virtual bool DoPhase(int nPhase); -#endif // wxUSE_CONSTRAINTS - - // Attempts to get colour for UX theme page background - wxColour GetThemeBackgroundColour() const; - - // implementation only - // ------------------- - -#if wxUSE_UXTHEME - virtual bool SetBackgroundColour(const wxColour& colour) - { - if ( !wxNotebookBase::SetBackgroundColour(colour) ) - return false; - - UpdateBgBrush(); - - return true; - } - - // return the themed brush for painting our children - virtual WXHBRUSH MSWGetBgBrushForChild(WXHDC hDC, WXHWND hWnd); - - // draw child background - virtual bool MSWPrintChild(WXHDC hDC, wxWindow *win); -#endif // wxUSE_UXTHEME - - // translate wxWin styles to the Windows ones - virtual WXDWORD MSWGetStyle(long flags, WXDWORD *exstyle = NULL) const; - -protected: - // common part of all ctors - void Init(); - - // hides the currently shown page and shows the given one (if not -1) and - // updates m_nSelection accordingly - void UpdateSelection(int selNew); - - // remove one page from the notebook, without deleting - virtual wxNotebookPage *DoRemovePage(size_t nPage); - - // get the page rectangle for the current notebook size - // - // returns empty rectangle if an error occurs, do test for it - wxRect GetPageSize() const; - - // set the size of the given page to fit in the notebook - void AdjustPageSize(wxNotebookPage *page); - -#if wxUSE_UXTHEME - // gets the bitmap of notebook background and returns a brush from it - WXHBRUSH QueryBgBitmap(); - - // creates the brush to be used for drawing the tab control background - void UpdateBgBrush(); - - // common part of QueryBgBitmap() and MSWPrintChild() - // - // if child == NULL, draw background for the entire notebook itself - bool DoDrawBackground(WXHDC hDC, wxWindow *child = NULL); -#endif // wxUSE_UXTHEME - - // these function are only used for reducing flicker on notebook resize and - // we don't need to do this for WinCE -#ifndef __WXWINCE__ - void OnEraseBackground(wxEraseEvent& event); - void OnPaint(wxPaintEvent& event); - - // true if we have already subclassed our updown control - bool m_hasSubclassedUpdown; -#endif // __WXWINCE__ - - // the current selection (-1 if none) - int m_nSelection; - - wxNotebookPageInfoList m_pageInfos; - -#if wxUSE_UXTHEME - // background brush used to paint the tab control - WXHBRUSH m_hbrBackground; -#endif // wxUSE_UXTHEME - - - DECLARE_DYNAMIC_CLASS_NO_COPY(wxNotebook) - DECLARE_EVENT_TABLE() -}; - -#endif // wxUSE_NOTEBOOK - -#endif // _NOTEBOOK_H diff --git a/wxWidgets/include/wx/msw/ole/access.h b/wxWidgets/include/wx/msw/ole/access.h deleted file mode 100644 index 45e684a1a8..0000000000 --- a/wxWidgets/include/wx/msw/ole/access.h +++ /dev/null @@ -1,68 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: ole/access.h -// Purpose: declaration of the wxAccessible class -// Author: Julian Smart -// Modified by: -// Created: 2003-02-12 -// RCS-ID: $Id: access.h 35650 2005-09-23 12:56:45Z MR $ -// Copyright: (c) 2003 Julian Smart -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_ACCESS_H_ -#define _WX_ACCESS_H_ - -#if wxUSE_ACCESSIBILITY - -// ---------------------------------------------------------------------------- -// forward declarations -// ---------------------------------------------------------------------------- - -class wxIAccessible; -class WXDLLEXPORT wxWindow; - -// ---------------------------------------------------------------------------- -// macros -// ---------------------------------------------------------------------------- - -// ---------------------------------------------------------------------------- -// wxAccessible implements accessibility behaviour. -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxAccessible : public wxAccessibleBase -{ -public: - wxAccessible(wxWindow *win = NULL); - virtual ~wxAccessible(); - -// Overridables - -// Accessors - - // Returns the wxIAccessible pointer - wxIAccessible* GetIAccessible() { return m_pIAccessible; } - - // Returns the IAccessible standard interface pointer - void* GetIAccessibleStd() ; - -// Operations - - // Sends an event when something changes in an accessible object. - static void NotifyEvent(int eventType, wxWindow* window, wxAccObject objectType, - int objectId); - -protected: - void Init(); - -private: - wxIAccessible * m_pIAccessible; // the pointer to COM interface - void* m_pIAccessibleStd; // the pointer to the standard COM interface, - // for default processing - - DECLARE_NO_COPY_CLASS(wxAccessible) -}; - -#endif //wxUSE_ACCESSIBILITY - -#endif //_WX_ACCESS_H_ - diff --git a/wxWidgets/include/wx/msw/ole/activex.h b/wxWidgets/include/wx/msw/ole/activex.h deleted file mode 100644 index 96fddfe0ff..0000000000 --- a/wxWidgets/include/wx/msw/ole/activex.h +++ /dev/null @@ -1,221 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: wx/msw/ole/activex.h -// Purpose: wxActiveXContainer class -// Author: Ryan Norton <wxprojects@comcast.net> -// Modified by: -// Created: 8/18/05 -// RCS-ID: $Id: activex.h 41793 2006-10-09 09:32:08Z ABX $ -// Copyright: (c) Ryan Norton -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// Definitions -// ============================================================================ - -#ifndef _WX_MSW_OLE_ACTIVEXCONTAINER_H_ -#define _WX_MSW_OLE_ACTIVEXCONTAINER_H_ - -#if wxUSE_ACTIVEX - -//--------------------------------------------------------------------------- -// wx includes -//--------------------------------------------------------------------------- - -#include "wx/msw/ole/oleutils.h" // wxBasicString &c -#include "wx/msw/ole/uuid.h" -#include "wx/window.h" -#include "wx/variant.h" - -//--------------------------------------------------------------------------- -// MSW COM includes -//--------------------------------------------------------------------------- -#include <oleidl.h> -#include <olectl.h> - -#if !defined(__WXWINCE__) || defined(__WINCE_STANDARDSDK__) -#include <exdisp.h> -#endif - -#include <docobj.h> - -#ifndef STDMETHOD - #define STDMETHOD(funcname) virtual HRESULT wxSTDCALL funcname -#endif - -// -// These defines are from another ole header - but its not in the -// latest sdk. Also the ifndef DISPID_READYSTATE is here because at -// least on my machine with the latest sdk olectl.h defines these 3 -// -#ifndef DISPID_READYSTATE - #define DISPID_READYSTATE (-525) - #define DISPID_READYSTATECHANGE (-609) - #define DISPID_AMBIENT_TRANSFERPRIORITY (-728) -#endif - -#define DISPID_AMBIENT_OFFLINEIFNOTCONNECTED (-5501) -#define DISPID_AMBIENT_SILENT (-5502) - -#ifndef DISPID_AMBIENT_CODEPAGE - #define DISPID_AMBIENT_CODEPAGE (-725) - #define DISPID_AMBIENT_CHARSET (-727) -#endif - - -//--------------------------------------------------------------------------- -// -// wxActiveXContainer -// -//--------------------------------------------------------------------------- - -#define WX_DECLARE_AUTOOLE(wxAutoOleInterface, I) \ -class wxAutoOleInterface \ -{ \ - protected: \ - I *m_interface; \ -\ - public: \ - explicit wxAutoOleInterface(I *pInterface = NULL) : m_interface(pInterface) {} \ - wxAutoOleInterface(REFIID riid, IUnknown *pUnk) : m_interface(NULL) \ - { QueryInterface(riid, pUnk); } \ - wxAutoOleInterface(REFIID riid, IDispatch *pDispatch) : m_interface(NULL) \ - { QueryInterface(riid, pDispatch); } \ - wxAutoOleInterface(REFCLSID clsid, REFIID riid) : m_interface(NULL)\ - { CreateInstance(clsid, riid); }\ - wxAutoOleInterface(const wxAutoOleInterface& ti) : m_interface(NULL)\ - { operator = (ti); }\ -\ - wxAutoOleInterface& operator = (const wxAutoOleInterface& ti)\ - {\ - if (ti.m_interface)\ - ti.m_interface->AddRef();\ - Free();\ - m_interface = ti.m_interface;\ - return *this;\ - }\ -\ - wxAutoOleInterface& operator = (I *&ti)\ - {\ - Free();\ - m_interface = ti;\ - return *this;\ - }\ -\ - ~wxAutoOleInterface() { Free(); }\ -\ - inline void Free()\ - {\ - if (m_interface)\ - m_interface->Release();\ - m_interface = NULL;\ - }\ -\ - HRESULT QueryInterface(REFIID riid, IUnknown *pUnk)\ - {\ - Free();\ - wxASSERT(pUnk != NULL);\ - return pUnk->QueryInterface(riid, (void **) &m_interface);\ - }\ -\ - HRESULT CreateInstance(REFCLSID clsid, REFIID riid)\ - {\ - Free();\ - return CoCreateInstance(clsid, NULL, CLSCTX_ALL, riid, (void **) &m_interface);\ - }\ -\ - inline operator I *() const {return m_interface;}\ - inline I* operator ->() {return m_interface;}\ - inline I** GetRef() {return &m_interface;}\ - inline bool Ok() const { return IsOk(); }\ - inline bool IsOk() const {return m_interface != NULL;}\ -}; - -WX_DECLARE_AUTOOLE(wxAutoIDispatch, IDispatch) -WX_DECLARE_AUTOOLE(wxAutoIOleClientSite, IOleClientSite) -WX_DECLARE_AUTOOLE(wxAutoIUnknown, IUnknown) -WX_DECLARE_AUTOOLE(wxAutoIOleObject, IOleObject) -WX_DECLARE_AUTOOLE(wxAutoIOleInPlaceObject, IOleInPlaceObject) -WX_DECLARE_AUTOOLE(wxAutoIOleInPlaceActiveObject, IOleInPlaceActiveObject) -WX_DECLARE_AUTOOLE(wxAutoIOleDocumentView, IOleDocumentView) -WX_DECLARE_AUTOOLE(wxAutoIViewObject, IViewObject) - -class wxActiveXContainer : public wxWindow -{ -public: - wxActiveXContainer(wxWindow * parent, REFIID iid, IUnknown* pUnk); - virtual ~wxActiveXContainer(); - - void OnSize(wxSizeEvent&); - void OnPaint(wxPaintEvent&); - void OnSetFocus(wxFocusEvent&); - void OnKillFocus(wxFocusEvent&); - -protected: - friend class FrameSite; - friend class wxActiveXEvents; - - wxAutoIDispatch m_Dispatch; - wxAutoIOleClientSite m_clientSite; - wxAutoIUnknown m_ActiveX; - wxAutoIOleObject m_oleObject; - wxAutoIOleInPlaceObject m_oleInPlaceObject; - wxAutoIOleInPlaceActiveObject m_oleInPlaceActiveObject; - wxAutoIOleDocumentView m_docView; - wxAutoIViewObject m_viewObject; - HWND m_oleObjectHWND; - bool m_bAmbientUserMode; - DWORD m_docAdviseCookie; - wxWindow* m_realparent; - - void CreateActiveX(REFIID, IUnknown*); -}; - - -// Events -class wxActiveXEvent : public wxCommandEvent -{ -private: - friend class wxActiveXEvents; - wxVariant m_params; - DISPID m_dispid; - -public: - virtual wxEvent *Clone() const - { return new wxActiveXEvent(*this); } - - size_t ParamCount() const - { return m_params.GetCount(); } - - wxString ParamType(size_t idx) const - { - wxASSERT(idx < m_params.GetCount()); - return m_params[idx].GetType(); - } - - wxString ParamName(size_t idx) const - { - wxASSERT(idx < m_params.GetCount()); - return m_params[idx].GetName(); - } - - wxVariant& operator[] (size_t idx) - { - wxASSERT(idx < ParamCount()); - return m_params[idx]; - } - - DISPID GetDispatchId() const - { return m_dispid; } -}; - -#define wxACTIVEX_ID 14001 -DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_MEDIA, wxEVT_ACTIVEX, wxACTIVEX_ID) -typedef void (wxEvtHandler::*wxActiveXEventFunction)(wxActiveXEvent&); -#define EVT_ACTIVEX(id, fn) DECLARE_EVENT_TABLE_ENTRY(wxEVT_ACTIVEX, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxActiveXEventFunction) & fn, (wxObject *) NULL ), -#define wxActiveXEventHandler(func) \ - (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxActiveXEventFunction, &func) - -#endif // wxUSE_ACTIVEX - -#endif // _WX_MSW_OLE_ACTIVEXCONTAINER_H_ diff --git a/wxWidgets/include/wx/msw/ole/automtn.h b/wxWidgets/include/wx/msw/ole/automtn.h deleted file mode 100644 index 51a7fd811a..0000000000 --- a/wxWidgets/include/wx/msw/ole/automtn.h +++ /dev/null @@ -1,101 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: automtn.h -// Purpose: OLE automation utilities -// Author: Julian Smart -// Modified by: -// Created: 11/6/98 -// RCS-ID: $Id: automtn.h 45498 2007-04-16 13:03:05Z VZ $ -// Copyright: (c) 1998, Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_AUTOMTN_H_ -#define _WX_AUTOMTN_H_ - -#include "wx/defs.h" - -#if wxUSE_OLE_AUTOMATION - -#include "wx/object.h" -#include "wx/variant.h" - -typedef void WXIDISPATCH; -typedef unsigned short* WXBSTR; - -#ifdef GetObject -#undef GetObject -#endif - -/* - * wxAutomationObject - * Wraps up an IDispatch pointer and invocation; does variant conversion. - */ - -class WXDLLEXPORT wxAutomationObject: public wxObject -{ -public: - wxAutomationObject(WXIDISPATCH* dispatchPtr = NULL); - virtual ~wxAutomationObject(); - - // Set/get dispatch pointer - inline void SetDispatchPtr(WXIDISPATCH* dispatchPtr) { m_dispatchPtr = dispatchPtr; } - inline WXIDISPATCH* GetDispatchPtr() const { return m_dispatchPtr; } - - // Get a dispatch pointer from the current object associated - // with a class id, such as "Excel.Application" - bool GetInstance(const wxString& classId) const; - - // Get a dispatch pointer from a new instance of the the class - bool CreateInstance(const wxString& classId) const; - - // Low-level invocation function. Pass either an array of variants, - // or an array of pointers to variants. - bool Invoke(const wxString& member, int action, - wxVariant& retValue, int noArgs, wxVariant args[], const wxVariant* ptrArgs[] = 0) const; - - // Invoke a member function - wxVariant CallMethod(const wxString& method, int noArgs, wxVariant args[]); - wxVariant CallMethodArray(const wxString& method, int noArgs, const wxVariant **args); - - // Convenience function - wxVariant CallMethod(const wxString& method, - const wxVariant& arg1 = wxNullVariant, const wxVariant& arg2 = wxNullVariant, - const wxVariant& arg3 = wxNullVariant, const wxVariant& arg4 = wxNullVariant, - const wxVariant& arg5 = wxNullVariant, const wxVariant& arg6 = wxNullVariant); - - // Get/Put property - wxVariant GetProperty(const wxString& property, int noArgs = 0, wxVariant args[] = (wxVariant*) NULL) const; - wxVariant GetPropertyArray(const wxString& property, int noArgs, const wxVariant **args) const; - wxVariant GetProperty(const wxString& property, - const wxVariant& arg1, const wxVariant& arg2 = wxNullVariant, - const wxVariant& arg3 = wxNullVariant, const wxVariant& arg4 = wxNullVariant, - const wxVariant& arg5 = wxNullVariant, const wxVariant& arg6 = wxNullVariant); - - bool PutPropertyArray(const wxString& property, int noArgs, const wxVariant **args); - bool PutProperty(const wxString& property, int noArgs, wxVariant args[]) ; - bool PutProperty(const wxString& property, - const wxVariant& arg1, const wxVariant& arg2 = wxNullVariant, - const wxVariant& arg3 = wxNullVariant, const wxVariant& arg4 = wxNullVariant, - const wxVariant& arg5 = wxNullVariant, const wxVariant& arg6 = wxNullVariant); - - // Uses DISPATCH_PROPERTYGET - // and returns a dispatch pointer. The calling code should call Release - // on the pointer, though this could be implicit by constructing an wxAutomationObject - // with it and letting the destructor call Release. - WXIDISPATCH* GetDispatchProperty(const wxString& property, int noArgs, wxVariant args[]) const; - WXIDISPATCH* GetDispatchProperty(const wxString& property, int noArgs, const wxVariant **args) const; - - // A way of initialising another wxAutomationObject with a dispatch object, - // without having to deal with nasty IDispatch pointers. - bool GetObject(wxAutomationObject& obj, const wxString& property, int noArgs = 0, wxVariant args[] = (wxVariant*) NULL) const; - bool GetObject(wxAutomationObject& obj, const wxString& property, int noArgs, const wxVariant **args) const; - -public: - WXIDISPATCH* m_dispatchPtr; - - DECLARE_NO_COPY_CLASS(wxAutomationObject) -}; - -#endif // wxUSE_OLE_AUTOMATION - -#endif // _WX_AUTOMTN_H_ diff --git a/wxWidgets/include/wx/msw/ole/dataform.h b/wxWidgets/include/wx/msw/ole/dataform.h deleted file mode 100644 index 733b1b967c..0000000000 --- a/wxWidgets/include/wx/msw/ole/dataform.h +++ /dev/null @@ -1,68 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: msw/ole/dataform.h -// Purpose: declaration of the wxDataFormat class -// Author: Vadim Zeitlin -// Modified by: -// Created: 19.10.99 (extracted from msw/ole/dataobj.h) -// RCS-ID: $Id: dataform.h 28812 2004-08-16 12:45:46Z ABX $ -// Copyright: (c) 1998 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr> -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_MSW_OLE_DATAFORM_H -#define _WX_MSW_OLE_DATAFORM_H - -// ---------------------------------------------------------------------------- -// wxDataFormat identifies the single format of data -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxDataFormat -{ -public: - // the clipboard formats under Win32 are WORD's - typedef unsigned short NativeFormat; - - wxDataFormat(NativeFormat format = wxDF_INVALID) { m_format = format; } - wxDataFormat(const wxChar *format) { SetId(format); } - - wxDataFormat& operator=(NativeFormat format) - { m_format = format; return *this; } - wxDataFormat& operator=(const wxDataFormat& format) - { m_format = format.m_format; return *this; } - - // default copy ctor/assignment operators ok - - // comparison (must have both versions) - bool operator==(wxDataFormatId format) const - { return m_format == (NativeFormat)format; } - bool operator!=(wxDataFormatId format) const - { return m_format != (NativeFormat)format; } - bool operator==(const wxDataFormat& format) const - { return m_format == format.m_format; } - bool operator!=(const wxDataFormat& format) const - { return m_format != format.m_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; } - - // this works with standard as well as custom ids - void SetType(NativeFormat format) { m_format = format; } - NativeFormat GetType() const { return m_format; } - - // string ids are used for custom types - this SetId() must be used for - // application-specific formats - wxString GetId() const; - void SetId(const wxChar *format); - - // returns true if the format is one of those defined in wxDataFormatId - bool IsStandard() const { return m_format > 0 && m_format < wxDF_PRIVATE; } - -private: - NativeFormat m_format; -}; - -#endif // _WX_MSW_OLE_DATAFORM_H - diff --git a/wxWidgets/include/wx/msw/ole/dataobj.h b/wxWidgets/include/wx/msw/ole/dataobj.h deleted file mode 100644 index ec2acdabbd..0000000000 --- a/wxWidgets/include/wx/msw/ole/dataobj.h +++ /dev/null @@ -1,79 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: msw/ole/dataobj.h -// Purpose: declaration of the wxDataObject class -// Author: Vadim Zeitlin -// Modified by: -// Created: 10.05.98 -// RCS-ID: $Id: dataobj.h 37406 2006-02-09 03:45:14Z VZ $ -// Copyright: (c) 1998 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr> -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_MSW_OLE_DATAOBJ_H -#define _WX_MSW_OLE_DATAOBJ_H - -// ---------------------------------------------------------------------------- -// forward declarations -// ---------------------------------------------------------------------------- - -struct IDataObject; - -// ---------------------------------------------------------------------------- -// wxDataObject is a "smart" and polymorphic piece of data. -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxDataObject : public wxDataObjectBase -{ -public: - // ctor & dtor - wxDataObject(); - virtual ~wxDataObject(); - - // retrieve IDataObject interface (for other OLE related classes) - IDataObject *GetInterface() const { return m_pIDataObject; } - - // tell the object that it should be now owned by IDataObject - i.e. when - // it is deleted, it should delete us as well - void SetAutoDelete(); - - // return true if we support this format in "Get" direction - bool IsSupportedFormat(const wxDataFormat& format) const - { return wxDataObjectBase::IsSupported(format, Get); } - - // if this method returns false, this wxDataObject will be copied to - // the clipboard with its size prepended to it, which is compatible with - // older wx versions - // - // if returns true, then this wxDataObject will be copied to the clipboard - // without any additional information and ::HeapSize() function will be used - // to get the size of that data - virtual bool NeedsVerbatimData(const wxDataFormat& WXUNUSED(format)) const - { - // return false from here only for compatibility with earlier wx versions - return true; - } - - // function to return symbolic name of clipboard format (for debug messages) -#ifdef __WXDEBUG__ - static const wxChar *GetFormatName(wxDataFormat format); - - #define wxGetFormatName(format) wxDataObject::GetFormatName(format) -#else // !Debug - #define wxGetFormatName(format) _T("") -#endif // Debug/!Debug - // they need to be accessed from wxIDataObject, so made them public, - // or wxIDataObject friend -public: - virtual const void* GetSizeFromBuffer( const void* buffer, size_t* size, - const wxDataFormat& format ); - virtual void* SetSizeInBuffer( void* buffer, size_t size, - const wxDataFormat& format ); - virtual size_t GetBufferOffset( const wxDataFormat& format ); - -private: - IDataObject *m_pIDataObject; // pointer to the COM interface - - DECLARE_NO_COPY_CLASS(wxDataObject) -}; - -#endif //_WX_MSW_OLE_DATAOBJ_H diff --git a/wxWidgets/include/wx/msw/ole/dataobj2.h b/wxWidgets/include/wx/msw/ole/dataobj2.h deleted file mode 100644 index 89c2b21414..0000000000 --- a/wxWidgets/include/wx/msw/ole/dataobj2.h +++ /dev/null @@ -1,146 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: wx/msw/ole/dataobj2.h -// Purpose: second part of platform specific wxDataObject header - -// declarations of predefined wxDataObjectSimple-derived classes -// Author: Vadim Zeitlin -// Modified by: -// Created: 21.10.99 -// RCS-ID: $Id: dataobj2.h 40772 2006-08-23 13:38:45Z VZ $ -// Copyright: (c) 1999 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr> -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_MSW_OLE_DATAOBJ2_H -#define _WX_MSW_OLE_DATAOBJ2_H - -// ---------------------------------------------------------------------------- -// wxBitmapDataObject is a specialization of wxDataObject for bitmap data -// -// NB: in fact, under MSW we support CF_DIB (and not CF_BITMAP) clipboard -// format and we also provide wxBitmapDataObject2 for CF_BITMAP (which is -// rarely used). This is ugly, but I haven't found a solution for it yet. -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxBitmapDataObject : public wxBitmapDataObjectBase -{ -public: - // ctors - wxBitmapDataObject(const wxBitmap& bitmap = wxNullBitmap) - : wxBitmapDataObjectBase(bitmap) - { - SetFormat(wxDF_DIB); - - m_data = NULL; - } - - // 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); } - -private: - // the DIB data - void /* BITMAPINFO */ *m_data; - - DECLARE_NO_COPY_CLASS(wxBitmapDataObject) -}; - -// ---------------------------------------------------------------------------- -// wxBitmapDataObject2 - a data object for CF_BITMAP -// -// FIXME did I already mention it was ugly? -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxBitmapDataObject2 : public wxBitmapDataObjectBase -{ -public: - // ctors - wxBitmapDataObject2(const wxBitmap& bitmap = wxNullBitmap) - : wxBitmapDataObjectBase(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); - - 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); } - -private: - DECLARE_NO_COPY_CLASS(wxBitmapDataObject2) -}; - -// ---------------------------------------------------------------------------- -// wxFileDataObject - data object for CF_HDROP -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxFileDataObject : public wxFileDataObjectBase -{ -public: - wxFileDataObject() { } - - // implement base class pure virtuals - virtual bool SetData(size_t len, const void *buf); - virtual size_t GetDataSize() const; - virtual bool GetDataHere(void *pData) const; - virtual void AddFile(const wxString& file); - - 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); } - -private: - DECLARE_NO_COPY_CLASS(wxFileDataObject) -}; - -// ---------------------------------------------------------------------------- -// wxURLDataObject: data object for URLs -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxURLDataObject : public wxDataObjectComposite -{ -public: - // initialize with URL in ctor or use SetURL later - wxURLDataObject(const wxString& url = wxEmptyString); - - // return the URL as string - wxString GetURL() const; - - // Set a string as the URL in the data object - void SetURL(const wxString& url); - - // override to set m_textFormat - virtual bool SetData(const wxDataFormat& format, - size_t len, - const void *buf); - -private: - // last data object we got data in - wxDataObjectSimple *m_dataObjectLast; - - DECLARE_NO_COPY_CLASS(wxURLDataObject) -}; - -#endif // _WX_MSW_OLE_DATAOBJ2_H diff --git a/wxWidgets/include/wx/msw/ole/dropsrc.h b/wxWidgets/include/wx/msw/ole/dropsrc.h deleted file mode 100644 index f04eaba41c..0000000000 --- a/wxWidgets/include/wx/msw/ole/dropsrc.h +++ /dev/null @@ -1,79 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: ole/dropsrc.h -// Purpose: declaration of the wxDropSource class -// Author: Vadim Zeitlin -// Modified by: -// Created: 06.03.98 -// RCS-ID: $Id: dropsrc.h 49563 2007-10-31 20:46:21Z VZ $ -// Copyright: (c) 1998 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr> -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_OLEDROPSRC_H -#define _WX_OLEDROPSRC_H - -#if wxUSE_DRAG_AND_DROP - -// ---------------------------------------------------------------------------- -// forward declarations -// ---------------------------------------------------------------------------- - -class wxIDropSource; -class WXDLLIMPEXP_FWD_CORE wxDataObject; -class WXDLLIMPEXP_FWD_CORE wxWindow; - -// ---------------------------------------------------------------------------- -// macros -// ---------------------------------------------------------------------------- - -// this macro may be used instead for wxDropSource ctor arguments: it will use -// the cursor 'name' from the resources under MSW, but will expand to -// something else under GTK. If you don't use it, you will have to use #ifdef -// in the application code. -#define wxDROP_ICON(name) wxCursor(_T(#name)) - -// ---------------------------------------------------------------------------- -// wxDropSource is used to start the drag-&-drop operation on associated -// wxDataObject object. It's responsible for giving UI feedback while dragging. -// ---------------------------------------------------------------------------- - -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 = NULL, - const wxCursor &cursorCopy = wxNullCursor, - const wxCursor &cursorMove = wxNullCursor, - const wxCursor &cursorStop = wxNullCursor); - wxDropSource(wxDataObject& data, - wxWindow *win = NULL, - const wxCursor &cursorCopy = wxNullCursor, - const wxCursor &cursorMove = wxNullCursor, - const wxCursor &cursorStop = wxNullCursor); - - virtual ~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); - - // overridable: you may give some custom UI feedback during d&d operation - // in this function (it's called on each mouse move, so it shouldn't be - // too slow). Just return false if you want default feedback. - virtual bool GiveFeedback(wxDragResult effect); - -protected: - void Init(); - -private: - wxIDropSource *m_pIDropSource; // the pointer to COM interface - - DECLARE_NO_COPY_CLASS(wxDropSource) -}; - -#endif //wxUSE_DRAG_AND_DROP - -#endif //_WX_OLEDROPSRC_H diff --git a/wxWidgets/include/wx/msw/ole/droptgt.h b/wxWidgets/include/wx/msw/ole/droptgt.h deleted file mode 100644 index f96729d696..0000000000 --- a/wxWidgets/include/wx/msw/ole/droptgt.h +++ /dev/null @@ -1,72 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: ole/droptgt.h -// Purpose: declaration of the wxDropTarget class -// Author: Vadim Zeitlin -// Modified by: -// Created: 06.03.98 -// RCS-ID: $Id: droptgt.h 35650 2005-09-23 12:56:45Z MR $ -// Copyright: (c) 1998 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr> -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_OLEDROPTGT_H -#define _WX_OLEDROPTGT_H - -#if wxUSE_DRAG_AND_DROP - -// ---------------------------------------------------------------------------- -// forward declarations -// ---------------------------------------------------------------------------- - -class wxIDropTarget; -struct IDataObject; - -// ---------------------------------------------------------------------------- -// An instance of the class wxDropTarget may be associated with any wxWindow -// derived object via SetDropTarget() function. If this is done, the virtual -// methods of wxDropTarget are called when something is dropped on the window. -// -// Note that wxDropTarget is an abstract base class (ABC) and you should derive -// your own class from it implementing pure virtual function in order to use it -// (all of them, including protected ones which are called by the class itself) -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxDropTarget : public wxDropTargetBase -{ -public: - // ctor & dtor - wxDropTarget(wxDataObject *dataObject = NULL); - virtual ~wxDropTarget(); - - // normally called by wxWindow on window creation/destruction, but might be - // called `manually' as well. Register() returns true on success. - bool Register(WXHWND hwnd); - void Revoke(WXHWND hwnd); - - // provide default implementation for base class pure virtuals - virtual bool OnDrop(wxCoord x, wxCoord y); - virtual bool GetData(); - - // implementation only from now on - // ------------------------------- - - // do we accept this kind of data? - bool IsAcceptedData(IDataObject *pIDataSource) const; - - // give us the data source from IDropTarget::Drop() - this is later used by - // GetData() when it's called from inside OnData() - void SetDataSource(IDataObject *pIDataSource); - -private: - // helper used by IsAcceptedData() and GetData() - wxDataFormat GetSupportedFormat(IDataObject *pIDataSource) const; - - wxIDropTarget *m_pIDropTarget; // the pointer to our COM interface - IDataObject *m_pIDataSource; // the pointer to the source data object - - DECLARE_NO_COPY_CLASS(wxDropTarget) -}; - -#endif //wxUSE_DRAG_AND_DROP - -#endif //_WX_OLEDROPTGT_H diff --git a/wxWidgets/include/wx/msw/ole/oleutils.h b/wxWidgets/include/wx/msw/ole/oleutils.h deleted file mode 100644 index 94de2657b4..0000000000 --- a/wxWidgets/include/wx/msw/ole/oleutils.h +++ /dev/null @@ -1,256 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: oleutils.h -// Purpose: OLE helper routines, OLE debugging support &c -// Author: Vadim Zeitlin -// Modified by: -// Created: 19.02.1998 -// RCS-ID: $Id: oleutils.h 49804 2007-11-10 01:09:42Z VZ $ -// Copyright: (c) 1998 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr> -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_OLEUTILS_H -#define _WX_OLEUTILS_H - -#include "wx/defs.h" - -#if wxUSE_OLE - -// ole2.h includes windows.h, so include wrapwin.h first -#include "wx/msw/wrapwin.h" -// get IUnknown, REFIID &c -#include <ole2.h> -#include "wx/intl.h" -#include "wx/log.h" - -// ============================================================================ -// General purpose functions and macros -// ============================================================================ - -// ---------------------------------------------------------------------------- -// initialize/cleanup OLE -// ---------------------------------------------------------------------------- - -// call OleInitialize() or CoInitialize[Ex]() depending on the platform -// -// return true if ok, false otherwise -inline bool wxOleInitialize() -{ - // we need to initialize OLE library -#ifdef __WXWINCE__ - if ( FAILED(::CoInitializeEx(NULL, COINIT_MULTITHREADED)) ) -#else - if ( FAILED(::OleInitialize(NULL)) ) -#endif - { - wxLogError(_("Cannot initialize OLE")); - - return false; - } - - return true; -} - -inline void wxOleUninitialize() -{ -#ifdef __WXWINCE__ - ::CoUninitialize(); -#else - ::OleUninitialize(); -#endif -} - -// ---------------------------------------------------------------------------- -// misc helper functions/macros -// ---------------------------------------------------------------------------- - -// release the interface pointer (if !NULL) -inline void ReleaseInterface(IUnknown *pIUnk) -{ - if ( pIUnk != NULL ) - pIUnk->Release(); -} - -// release the interface pointer (if !NULL) and make it NULL -#define RELEASE_AND_NULL(p) if ( (p) != NULL ) { p->Release(); p = NULL; }; - -// return true if the iid is in the array -extern bool IsIidFromList(REFIID riid, const IID *aIids[], size_t nCount); - -// ============================================================================ -// IUnknown implementation helpers -// ============================================================================ - -/* - The most dumb implementation of IUnknown methods. We don't support - aggregation nor containment, but for 99% of cases this simple - implementation is quite enough. - - Usage is trivial: here is all you should have - 1) DECLARE_IUNKNOWN_METHODS in your (IUnknown derived!) class declaration - 2) BEGIN/END_IID_TABLE with ADD_IID in between for all interfaces you - support (at least all for which you intent to return 'this' from QI, - i.e. you should derive from IFoo if you have ADD_IID(Foo)) somewhere else - 3) IMPLEMENT_IUNKNOWN_METHODS somewhere also - - These macros are quite simple: AddRef and Release are trivial and QI does - lookup in a static member array of IIDs and returns 'this' if it founds - the requested interface in it or E_NOINTERFACE if not. - */ - -/* - wxAutoULong: this class is used for automatically initalising m_cRef to 0 -*/ -class wxAutoULong -{ -public: - wxAutoULong(ULONG value = 0) : m_Value(value) { } - - operator ULONG&() { return m_Value; } - ULONG& operator=(ULONG value) { m_Value = value; return m_Value; } - - wxAutoULong& operator++() { ++m_Value; return *this; } - const wxAutoULong operator++( int ) { wxAutoULong temp = *this; ++m_Value; return temp; } - - wxAutoULong& operator--() { --m_Value; return *this; } - const wxAutoULong operator--( int ) { wxAutoULong temp = *this; --m_Value; return temp; } - -private: - ULONG m_Value; -}; - -// declare the methods and the member variable containing reference count -// you must also define the ms_aIids array somewhere with BEGIN_IID_TABLE -// and friends (see below) - -#define DECLARE_IUNKNOWN_METHODS \ - public: \ - STDMETHODIMP QueryInterface(REFIID, void **); \ - STDMETHODIMP_(ULONG) AddRef(); \ - STDMETHODIMP_(ULONG) Release(); \ - private: \ - static const IID *ms_aIids[]; \ - wxAutoULong m_cRef - -// macros for declaring supported interfaces -// NB: you should write ADD_INTERFACE(Foo) and not ADD_INTERFACE(IID_IFoo)! -#define BEGIN_IID_TABLE(cname) const IID *cname::ms_aIids[] = { -#define ADD_IID(iid) &IID_I##iid, -#define END_IID_TABLE } - -// implementation is as straightforward as possible -// Parameter: classname - the name of the class -#define IMPLEMENT_IUNKNOWN_METHODS(classname) \ - STDMETHODIMP classname::QueryInterface(REFIID riid, void **ppv) \ - { \ - wxLogQueryInterface(_T(#classname), riid); \ - \ - if ( IsIidFromList(riid, ms_aIids, WXSIZEOF(ms_aIids)) ) { \ - *ppv = this; \ - AddRef(); \ - \ - return S_OK; \ - } \ - else { \ - *ppv = NULL; \ - \ - return (HRESULT) E_NOINTERFACE; \ - } \ - } \ - \ - STDMETHODIMP_(ULONG) classname::AddRef() \ - { \ - wxLogAddRef(_T(#classname), m_cRef); \ - \ - return ++m_cRef; \ - } \ - \ - STDMETHODIMP_(ULONG) classname::Release() \ - { \ - wxLogRelease(_T(#classname), m_cRef); \ - \ - if ( --m_cRef == wxAutoULong(0) ) { \ - delete this; \ - return 0; \ - } \ - else \ - return m_cRef; \ - } - -// ============================================================================ -// Debugging support -// ============================================================================ - -// VZ: I don't know it's not done for compilers other than VC++ but I leave it -// as is. Please note, though, that tracing OLE interface calls may be -// incredibly useful when debugging OLE programs. -#if defined(__WXDEBUG__) && ( ( defined(__VISUALC__) && (__VISUALC__ >= 1000) ) || defined(__MWERKS__) ) -// ---------------------------------------------------------------------------- -// All OLE specific log functions have DebugTrace level (as LogTrace) -// ---------------------------------------------------------------------------- - -// tries to translate riid into a symbolic name, if possible -void wxLogQueryInterface(const wxChar *szInterface, REFIID riid); - -// these functions print out the new value of reference counter -void wxLogAddRef (const wxChar *szInterface, ULONG cRef); -void wxLogRelease(const wxChar *szInterface, ULONG cRef); - -#else //!__WXDEBUG__ - #define wxLogQueryInterface(szInterface, riid) - #define wxLogAddRef(szInterface, cRef) - #define wxLogRelease(szInterface, cRef) -#endif //__WXDEBUG__ - -// wrapper around BSTR type (by Vadim Zeitlin) - -class WXDLLEXPORT wxBasicString -{ -public: - // ctors & dtor - wxBasicString(const char *sz); - wxBasicString(const wxString& str); - ~wxBasicString(); - - void Init(const char* sz); - - // accessors - // just get the string - operator BSTR() const { return m_wzBuf; } - // retrieve a copy of our string - caller must SysFreeString() it later! - BSTR Get() const { return SysAllocString(m_wzBuf); } - -private: - // @@@ not implemented (but should be) - wxBasicString(const wxBasicString&); - wxBasicString& operator=(const wxBasicString&); - - OLECHAR *m_wzBuf; // actual string -}; - -#if wxUSE_VARIANT -// Convert variants -class WXDLLIMPEXP_FWD_BASE wxVariant; - -WXDLLEXPORT bool wxConvertVariantToOle(const wxVariant& variant, VARIANTARG& oleVariant); -WXDLLEXPORT bool wxConvertOleToVariant(const VARIANTARG& oleVariant, wxVariant& variant); -#endif // wxUSE_VARIANT - -// Convert string to Unicode -WXDLLEXPORT BSTR wxConvertStringToOle(const wxString& str); - -// Convert string from BSTR to wxString -WXDLLEXPORT wxString wxConvertStringFromOle(BSTR bStr); - -#else // !wxUSE_OLE - -// ---------------------------------------------------------------------------- -// stub functions to avoid #if wxUSE_OLE in the main code -// ---------------------------------------------------------------------------- - -inline bool wxOleInitialize() { return false; } -inline void wxOleUninitialize() { } - -#endif // wxUSE_OLE/!wxUSE_OLE - -#endif //_WX_OLEUTILS_H diff --git a/wxWidgets/include/wx/msw/ole/uuid.h b/wxWidgets/include/wx/msw/ole/uuid.h deleted file mode 100644 index 6a266d71b5..0000000000 --- a/wxWidgets/include/wx/msw/ole/uuid.h +++ /dev/null @@ -1,92 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: ole/uuid.h -// Purpose: encapsulates an UUID with some added helper functions -// Author: Vadim Zeitlin -// Modified by: -// Created: 11.07.97 -// RCS-ID: $Id: uuid.h 55113 2008-08-18 11:30:10Z VZ $ -// Copyright: (c) 1998 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr> -// Licence: wxWindows licence -// -// Notes: you should link your project with RPCRT4.LIB! -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_OLEUUID_H -#define _WX_OLEUUID_H - -#include "wx/wxchar.h" -// ------------------------------------------------------------------ -// UUID (Universally Unique IDentifier) definition -// ------------------------------------------------------------------ - -// ----- taken from RPC.H -#ifndef UUID_DEFINED // in some cases RPC.H will be already - #ifdef __WIN32__ // included, so avoid redefinition - typedef struct - { - unsigned long Data1; - unsigned short Data2; - unsigned short Data3; - unsigned char Data4[8]; - } UUID; // UUID = GUID = CLSID = LIBID = IID - #endif // WIN32 -#endif // UUID_DEFINED - -#ifndef GUID_DEFINED - typedef UUID GUID; - #define UUID_DEFINED // prevent redefinition -#endif // GUID_DEFINED - -typedef unsigned char uchar; - -// ------------------------------------------------------------------ -// a class to store UUID and it's string representation -// ------------------------------------------------------------------ - -// uses RPC functions to create/convert Universally Unique Identifiers -class WXDLLEXPORT Uuid -{ -private: - UUID m_uuid; - wxUChar *m_pszUuid; // this string is alloc'd and freed by RPC - wxChar *m_pszCForm; // this string is allocated in Set/Create - - void UuidToCForm(); - - // function used to set initial state by all ctors - void Init() { m_pszUuid = NULL; m_pszCForm = NULL; } - -public: - // ctors & dtor - Uuid() { Init(); } - Uuid(const wxChar *pc) { Init(); Set(pc); } - Uuid(const UUID &uuid) { Init(); Set(uuid); } - ~Uuid(); - - // copy ctor and assignment operator needed for this class - Uuid(const Uuid& uuid); - Uuid& operator=(const Uuid& uuid); - - // create a brand new UUID - void Create(); - - // set value of UUID - bool Set(const wxChar *pc); // from a string, returns true if ok - void Set(const UUID& uuid); // from another UUID (never fails) - -#if wxABI_VERSION >= 20809 - // comparison operators - bool operator==(const Uuid& uuid) const; - bool operator!=(const Uuid& uuid) const; -#endif // wxABI_VERSION >= 2.8.9 - - // accessors - operator const UUID*() const { return &m_uuid; } - operator const wxChar*() const { return (wxChar *)(m_pszUuid); } - - // return string representation of the UUID in the C form - // (as in DEFINE_GUID macro) - const wxChar *CForm() const { return m_pszCForm; } -}; - -#endif //_WX_OLEUUID_H diff --git a/wxWidgets/include/wx/msw/palette.h b/wxWidgets/include/wx/msw/palette.h deleted file mode 100644 index 25aad71a5c..0000000000 --- a/wxWidgets/include/wx/msw/palette.h +++ /dev/null @@ -1,58 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/msw/palette.h -// Purpose: wxPalette class -// Author: Julian Smart -// Modified by: -// Created: 01/02/97 -// RCS-ID: $Id: palette.h 53135 2008-04-12 02:31:04Z VZ $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_PALETTE_H_ -#define _WX_PALETTE_H_ - -#include "wx/gdiobj.h" - -class WXDLLIMPEXP_FWD_CORE wxPalette; - -class WXDLLEXPORT wxPaletteRefData: public wxGDIRefData -{ - friend class WXDLLIMPEXP_FWD_CORE wxPalette; -public: - wxPaletteRefData(void); - virtual ~wxPaletteRefData(void); -protected: - WXHPALETTE m_hPalette; -}; - -#define M_PALETTEDATA ((wxPaletteRefData *)m_refData) - -class WXDLLEXPORT wxPalette: public wxPaletteBase -{ -public: - wxPalette(); - wxPalette(int n, const unsigned char *red, const unsigned char *green, const unsigned char *blue); - virtual ~wxPalette(void); - bool Create(int n, const unsigned char *red, const unsigned char *green, const unsigned char *blue); - - int GetPixel(unsigned char red, unsigned char green, unsigned char blue) const; - bool GetRGB(int pixel, unsigned char *red, unsigned char *green, unsigned char *blue) const; - - virtual int GetColoursCount() const; - - virtual bool Ok() const { return IsOk(); } - virtual bool IsOk(void) const { return (m_refData != NULL) ; } - - virtual bool FreeResource(bool force = false); - - // implemetation - inline WXHPALETTE GetHPALETTE(void) const { return (M_PALETTEDATA ? M_PALETTEDATA->m_hPalette : 0); } - void SetHPALETTE(WXHPALETTE pal); - -private: - DECLARE_DYNAMIC_CLASS(wxPalette) -}; - -#endif - // _WX_PALETTE_H_ diff --git a/wxWidgets/include/wx/msw/pbrush.cur b/wxWidgets/include/wx/msw/pbrush.cur deleted file mode 100644 index 299016a315125c9f080c2dadf022e67a66a9d61d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 326 zcmaKmu?>JQ3<S?G038JtB_$h#Az&Ud8iOH>4MaqWl#kANzpTX2AdDk)49o&OFc}uH z7-HwqcfHMDRrPOjx2=$~pOEl5_rZ|ppOpAa%H3CFJCp+7tWFfwqg6daoog@O&ypMb Cq;k*z diff --git a/wxWidgets/include/wx/msw/pen.h b/wxWidgets/include/wx/msw/pen.h deleted file mode 100644 index e5da34b8c9..0000000000 --- a/wxWidgets/include/wx/msw/pen.h +++ /dev/null @@ -1,132 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/msw/pen.h -// Purpose: wxPen class -// Author: Julian Smart -// Modified by: Vadim Zeitlin: fixed operator=(), ==(), !=() -// Created: 01/02/97 -// RCS-ID: $Id: pen.h 53135 2008-04-12 02:31:04Z VZ $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_PEN_H_ -#define _WX_PEN_H_ - -#include "wx/gdiobj.h" -#include "wx/bitmap.h" -#include "wx/colour.h" - -typedef WXDWORD wxMSWDash; - -class WXDLLIMPEXP_FWD_CORE wxPen; - -// VZ: this class should be made private -class WXDLLEXPORT wxPenRefData : public wxGDIRefData -{ -public: - wxPenRefData(); - wxPenRefData(const wxPenRefData& data); - virtual ~wxPenRefData(); - - bool operator==(const wxPenRefData& data) const - { - // we intentionally don't compare m_hPen fields here - return m_style == data.m_style && - m_width == data.m_width && - m_join == data.m_join && - m_cap == data.m_cap && - m_colour == data.m_colour && - (m_style != wxSTIPPLE || m_stipple.IsSameAs(data.m_stipple)) && - (m_style != wxUSER_DASH || - (m_nbDash == data.m_nbDash && - memcmp(m_dash, data.m_dash, m_nbDash*sizeof(wxDash)) == 0)); - } - -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; - WXHPEN m_hPen; - -private: - friend class WXDLLIMPEXP_FWD_CORE wxPen; - - // Cannot use - // DECLARE_NO_COPY_CLASS(wxPenRefData) - // because copy constructor is explicitly declared above; - // but no copy assignment operator is defined, so declare - // it private to prevent the compiler from defining it: - wxPenRefData& operator=(const wxPenRefData&); -}; - -#define M_PENDATA ((wxPenRefData *)m_refData) -#define wxPENDATA(x) ((wxPenRefData *)(x).m_refData) - -// ---------------------------------------------------------------------------- -// Pen -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxPen : public wxGDIObject -{ -public: - wxPen(); - wxPen(const wxColour& col, int width = 1, int style = wxSOLID); - wxPen(const wxBitmap& stipple, int width); - virtual ~wxPen(); - - bool operator==(const wxPen& pen) const - { - const wxPenRefData *penData = (wxPenRefData *)pen.m_refData; - - // an invalid pen is only equal to another invalid pen - return m_refData ? penData && *M_PENDATA == *penData : !penData; - } - - bool operator!=(const wxPen& pen) const { return !(*this == pen); } - - virtual bool Ok() const { return IsOk(); } - virtual bool IsOk() 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); - - wxColour& GetColour() const { return (M_PENDATA ? M_PENDATA->m_colour : wxNullColour); } - int GetWidth() const { return (M_PENDATA ? M_PENDATA->m_width : 0); } - int GetStyle() const { return (M_PENDATA ? M_PENDATA->m_style : 0); } - int GetJoin() const { return (M_PENDATA ? M_PENDATA->m_join : 0); } - int GetCap() const { return (M_PENDATA ? M_PENDATA->m_cap : 0); } - int GetDashes(wxDash **ptr) const - { - *ptr = (M_PENDATA ? (wxDash*)M_PENDATA->m_dash : (wxDash*) NULL); - return (M_PENDATA ? M_PENDATA->m_nbDash : 0); - } - wxDash* GetDash() const { return (M_PENDATA ? (wxDash*)M_PENDATA->m_dash : (wxDash*)NULL); } - inline int GetDashCount() const { return (M_PENDATA ? M_PENDATA->m_nbDash : 0); } - - inline wxBitmap *GetStipple() const { return (M_PENDATA ? (& M_PENDATA->m_stipple) : (wxBitmap*) NULL); } - - // Internal - bool RealizeResource(); - bool FreeResource(bool force = false); - WXHANDLE GetResourceHandle() const; - bool IsFree() const; - void Unshare(); - -private: - DECLARE_DYNAMIC_CLASS(wxPen) -}; - -#endif // _WX_PEN_H_ diff --git a/wxWidgets/include/wx/msw/pencil.cur b/wxWidgets/include/wx/msw/pencil.cur deleted file mode 100644 index afa760257c49635e1e1485d8935f6d897d069098..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 326 zcmb8pF%E(-6vpwdkN^uYA;y6PMn?yBIF7ea;@~wr3P<1w9>LMU@cECJu;{>Rey@G) zYg#E%P+f~$=n$lxq&?VDhrsy6cbbbO+g^&5tBn3FO5{k+Qrz+8jbg+R4SqHZ9L&KV fR>zea7xWl#KiQAgepdEtV^68=7=IgRbPM|pAJ%+) diff --git a/wxWidgets/include/wx/msw/pntleft.cur b/wxWidgets/include/wx/msw/pntleft.cur deleted file mode 100644 index e7192aab6da74893eab5c7df99cee017f6e6764e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 326 zcma)$yA8rX5JcZWZ~;PgM9Ps7x&u>+Q$i}h5)HWoBnqGgIv{k!c;GCV%-+?T{b;os zSP@7G>y|3O4mcXGIGN!5#aQw%sibL`?@AgfuJ6QN9S3tZ7qd}UOHELpi1UyBFYIAS cyj18Rikls;)sB37b2n|S@k4y7U-B~F3}KpfZvX%Q diff --git a/wxWidgets/include/wx/msw/pntright.cur b/wxWidgets/include/wx/msw/pntright.cur deleted file mode 100644 index 565447b03ce6794a2b117749ed87d17ce104b4f8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 326 zcmaiuF$%(9428egQltoOj<%ztNAPAk2yTv^NAUt4;Xgvb#X)>NwWT=y315<zgb<hz zv@I;DSqChDm2r!W3H#Uj^b=#0G>S|$^?XJ}Ie$^>VfN-^j^;)sJ<CQrNSRCjWB-t~ dgEy|~bm`EU579Gd3il&HaZhZeCVO*Ocmu`Yd9VNg diff --git a/wxWidgets/include/wx/msw/popupwin.h b/wxWidgets/include/wx/msw/popupwin.h deleted file mode 100644 index 646cb5ca33..0000000000 --- a/wxWidgets/include/wx/msw/popupwin.h +++ /dev/null @@ -1,45 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: wx/msw/popupwin.h -// Purpose: wxPopupWindow class for wxMSW -// Author: Vadim Zeitlin -// Modified by: -// Created: 06.01.01 -// RCS-ID: $Id: popupwin.h 37393 2006-02-08 21:47:09Z VZ $ -// Copyright: (c) 2001 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr> -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_MSW_POPUPWIN_H_ -#define _WX_MSW_POPUPWIN_H_ - -// ---------------------------------------------------------------------------- -// wxPopupWindow -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxPopupWindow : public wxPopupWindowBase -{ -public: - wxPopupWindow() { } - - wxPopupWindow(wxWindow *parent, int flags = wxBORDER_NONE) - { (void)Create(parent, flags); } - - bool Create(wxWindow *parent, int flags = wxBORDER_NONE); - - virtual bool Show(bool show = true); - - // return the style to be used for the popup windows - virtual WXDWORD MSWGetStyle(long flags, WXDWORD *exstyle) const; - - // get the HWND to be used as parent of this window with CreateWindow() - virtual WXHWND MSWGetParent() const; - -protected: - // popups handle the position like wxTopLevelWindow, not wxWindow - virtual void DoGetPosition(int *x, int *y) const; - - DECLARE_DYNAMIC_CLASS_NO_COPY(wxPopupWindow) -}; - -#endif // _WX_MSW_POPUPWIN_H_ - diff --git a/wxWidgets/include/wx/msw/printdlg.h b/wxWidgets/include/wx/msw/printdlg.h deleted file mode 100644 index 581a9d7c17..0000000000 --- a/wxWidgets/include/wx/msw/printdlg.h +++ /dev/null @@ -1,124 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: printdlg.h -// Purpose: wxPrintDialog, wxPageSetupDialog classes -// Author: Julian Smart -// Modified by: -// Created: 01/02/97 -// RCS-ID: $Id: printdlg.h 49804 2007-11-10 01:09:42Z VZ $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_PRINTDLG_H_ -#define _WX_PRINTDLG_H_ - -#if wxUSE_PRINTING_ARCHITECTURE - -#include "wx/dialog.h" -#include "wx/cmndata.h" -#include "wx/prntbase.h" -#include "wx/printdlg.h" - -class WXDLLIMPEXP_FWD_CORE wxDC; - -//---------------------------------------------------------------------------- -// wxWindowsPrintNativeData -//---------------------------------------------------------------------------- - -class WXDLLEXPORT wxWindowsPrintNativeData: public wxPrintNativeDataBase -{ -public: - wxWindowsPrintNativeData(); - virtual ~wxWindowsPrintNativeData(); - - virtual bool TransferTo( wxPrintData &data ); - virtual bool TransferFrom( const wxPrintData &data ); - - virtual bool Ok() const { return IsOk(); } - virtual bool IsOk() const; - - void* GetDevMode() const { return m_devMode; } - void SetDevMode(void* data) { m_devMode = data; } - void* GetDevNames() const { return m_devNames; } - void SetDevNames(void* data) { m_devNames = data; } - -private: - void* m_devMode; - void* m_devNames; - - short m_customWindowsPaperId; - -private: - DECLARE_DYNAMIC_CLASS(wxWindowsPrintNativeData) -}; - -// --------------------------------------------------------------------------- -// wxWindowsPrintDialog: the MSW dialog for printing -// --------------------------------------------------------------------------- - -class WXDLLEXPORT wxWindowsPrintDialog : public wxPrintDialogBase -{ -public: - wxWindowsPrintDialog(wxWindow *parent, wxPrintDialogData* data = NULL); - wxWindowsPrintDialog(wxWindow *parent, wxPrintData* data); - virtual ~wxWindowsPrintDialog(); - - 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; - wxPrinterDC* m_printerDC; - bool m_destroyDC; - wxWindow* m_dialogParent; - -private: - bool ConvertToNative( wxPrintDialogData &data ); - bool ConvertFromNative( wxPrintDialogData &data ); - - // holds MSW handle - void* m_printDlg; - -private: - DECLARE_NO_COPY_CLASS(wxWindowsPrintDialog) - DECLARE_CLASS(wxWindowsPrintDialog) -}; - -// --------------------------------------------------------------------------- -// wxWindowsPageSetupDialog: the MSW page setup dialog -// --------------------------------------------------------------------------- - -class WXDLLEXPORT wxWindowsPageSetupDialog: public wxPageSetupDialogBase -{ -public: - wxWindowsPageSetupDialog(); - wxWindowsPageSetupDialog(wxWindow *parent, wxPageSetupDialogData *data = NULL); - virtual ~wxWindowsPageSetupDialog(); - - bool Create(wxWindow *parent, wxPageSetupDialogData *data = NULL); - virtual int ShowModal(); - bool ConvertToNative( wxPageSetupDialogData &data ); - bool ConvertFromNative( wxPageSetupDialogData &data ); - - virtual wxPageSetupData& GetPageSetupDialogData() { return m_pageSetupData; } - -private: - wxPageSetupDialogData m_pageSetupData; - wxWindow* m_dialogParent; - - // holds MSW handle - void* m_pageDlg; - -private: - DECLARE_DYNAMIC_CLASS_NO_COPY(wxWindowsPageSetupDialog) -}; - -#endif // wxUSE_PRINTING_ARCHITECTURE - -#endif - // _WX_PRINTDLG_H_ diff --git a/wxWidgets/include/wx/msw/printwin.h b/wxWidgets/include/wx/msw/printwin.h deleted file mode 100644 index 8179f1b011..0000000000 --- a/wxWidgets/include/wx/msw/printwin.h +++ /dev/null @@ -1,66 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: printwin.h -// Purpose: wxWindowsPrinter, wxWindowsPrintPreview classes -// Author: Julian Smart -// Modified by: -// Created: 01/02/97 -// RCS-ID: $Id: printwin.h 42522 2006-10-27 13:07:40Z JS $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_PRINTWIN_H_ -#define _WX_PRINTWIN_H_ - -#include "wx/prntbase.h" - -// --------------------------------------------------------------------------- -// Represents the printer: manages printing a wxPrintout object -// --------------------------------------------------------------------------- - -class WXDLLEXPORT wxWindowsPrinter : public wxPrinterBase -{ - DECLARE_DYNAMIC_CLASS(wxWindowsPrinter) - -public: - wxWindowsPrinter(wxPrintDialogData *data = NULL); - virtual ~wxWindowsPrinter(); - - virtual bool Print(wxWindow *parent, - wxPrintout *printout, - bool prompt = true); - - virtual wxDC *PrintDialog(wxWindow *parent); - virtual bool Setup(wxWindow *parent); - -private: - WXFARPROC m_lpAbortProc; - - DECLARE_NO_COPY_CLASS(wxWindowsPrinter) -}; - -// --------------------------------------------------------------------------- -// wxPrintPreview: programmer creates an object of this class to preview a -// wxPrintout. -// --------------------------------------------------------------------------- - -class WXDLLEXPORT wxWindowsPrintPreview : public wxPrintPreviewBase -{ -public: - wxWindowsPrintPreview(wxPrintout *printout, - wxPrintout *printoutForPrinting = NULL, - wxPrintDialogData *data = NULL); - wxWindowsPrintPreview(wxPrintout *printout, - wxPrintout *printoutForPrinting, - wxPrintData *data); - virtual ~wxWindowsPrintPreview(); - - virtual bool Print(bool interactive); - virtual void DetermineScaling(); - -private: - DECLARE_DYNAMIC_CLASS_NO_COPY(wxWindowsPrintPreview) -}; - -#endif -// _WX_PRINTWIN_H_ diff --git a/wxWidgets/include/wx/msw/private.h b/wxWidgets/include/wx/msw/private.h deleted file mode 100644 index 2bbcef2d1d..0000000000 --- a/wxWidgets/include/wx/msw/private.h +++ /dev/null @@ -1,953 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/msw/private.h -// Purpose: Private declarations: as this header is only included by -// wxWidgets itself, it may contain identifiers which don't start -// with "wx". -// Author: Julian Smart -// Modified by: -// Created: 01/02/97 -// RCS-ID: $Id: private.h 62189 2009-09-28 16:02:08Z JS $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_PRIVATE_H_ -#define _WX_PRIVATE_H_ - -#include "wx/msw/wrapwin.h" - -#ifdef __WXMICROWIN__ - // Extra prototypes and symbols not defined by MicroWindows - #include "wx/msw/microwin.h" -#endif - -#include "wx/log.h" - -class WXDLLIMPEXP_FWD_CORE wxFont; -class WXDLLIMPEXP_FWD_CORE wxWindow; -class WXDLLIMPEXP_FWD_CORE wxWindowBase; - -// --------------------------------------------------------------------------- -// private constants -// --------------------------------------------------------------------------- - -// 260 was taken from windef.h -#ifndef MAX_PATH - #define MAX_PATH 260 -#endif - -// --------------------------------------------------------------------------- -// standard icons from the resources -// --------------------------------------------------------------------------- - -#if wxUSE_GUI - -extern WXDLLEXPORT_DATA(HICON) wxSTD_FRAME_ICON; -extern WXDLLEXPORT_DATA(HICON) wxSTD_MDIPARENTFRAME_ICON; -extern WXDLLEXPORT_DATA(HICON) wxSTD_MDICHILDFRAME_ICON; -extern WXDLLEXPORT_DATA(HICON) wxDEFAULT_FRAME_ICON; -extern WXDLLEXPORT_DATA(HICON) wxDEFAULT_MDIPARENTFRAME_ICON; -extern WXDLLEXPORT_DATA(HICON) wxDEFAULT_MDICHILDFRAME_ICON; -extern WXDLLEXPORT_DATA(HFONT) wxSTATUS_LINE_FONT; - -#endif // wxUSE_GUI - -// --------------------------------------------------------------------------- -// global data -// --------------------------------------------------------------------------- - -extern WXDLLIMPEXP_DATA_BASE(HINSTANCE) wxhInstance; - -// --------------------------------------------------------------------------- -// define things missing from some compilers' headers -// --------------------------------------------------------------------------- - -#if defined(__WXWINCE__) || (defined(__GNUWIN32__) && !wxUSE_NORLANDER_HEADERS) -#ifndef ZeroMemory - inline void ZeroMemory(void *buf, size_t len) { memset(buf, 0, len); } -#endif -#endif // old mingw32 - -// this defines a CASTWNDPROC macro which casts a pointer to the type of a -// window proc -#if defined(STRICT) || defined(__GNUC__) - typedef WNDPROC WndProcCast; -#else - typedef FARPROC WndProcCast; -#endif - - -#define CASTWNDPROC (WndProcCast) - - - -// --------------------------------------------------------------------------- -// some stuff for old Windows versions (FIXME: what does it do here??) -// --------------------------------------------------------------------------- - -#if !defined(APIENTRY) // NT defines APIENTRY, 3.x not - #define APIENTRY FAR PASCAL -#endif - -#ifdef __WIN32__ - #define _EXPORT -#else - #define _EXPORT _export -#endif - -#ifndef __WIN32__ - typedef signed short int SHORT; -#endif - -#if !defined(__WIN32__) // 3.x uses FARPROC for dialogs -#ifndef STRICT - #define DLGPROC FARPROC -#endif -#endif - -/* - * Decide what window classes we're going to use - * for this combination of CTl3D/FAFA settings - */ - -#define STATIC_CLASS wxT("STATIC") -#define STATIC_FLAGS (SS_LEFT|WS_CHILD|WS_VISIBLE) -#define CHECK_CLASS wxT("BUTTON") -#define CHECK_FLAGS (BS_AUTOCHECKBOX|WS_TABSTOP|WS_CHILD) -#define CHECK_IS_FAFA FALSE -#define RADIO_CLASS wxT("BUTTON") -#define RADIO_FLAGS (BS_AUTORADIOBUTTON|WS_CHILD|WS_VISIBLE) -#define RADIO_SIZE 20 -#define RADIO_IS_FAFA FALSE -#define PURE_WINDOWS -#define GROUP_CLASS wxT("BUTTON") -#define GROUP_FLAGS (BS_GROUPBOX|WS_CHILD|WS_VISIBLE) - -/* -#define BITCHECK_FLAGS (FB_BITMAP|FC_BUTTONDRAW|FC_DEFAULT|WS_VISIBLE) -#define BITRADIO_FLAGS (FC_BUTTONDRAW|FB_BITMAP|FC_RADIO|WS_CHILD|WS_VISIBLE) -*/ - -// --------------------------------------------------------------------------- -// misc macros -// --------------------------------------------------------------------------- - -#define MEANING_CHARACTER '0' -#define DEFAULT_ITEM_WIDTH 100 -#define DEFAULT_ITEM_HEIGHT 80 - -// Scale font to get edit control height -//#define EDIT_HEIGHT_FROM_CHAR_HEIGHT(cy) (3*(cy)/2) -#define EDIT_HEIGHT_FROM_CHAR_HEIGHT(cy) (cy+8) - -// Generic subclass proc, for panel item moving/sizing and intercept -// EDIT control VK_RETURN messages -extern LONG APIENTRY _EXPORT - wxSubclassedGenericControlProc(WXHWND hWnd, WXUINT message, WXWPARAM wParam, WXLPARAM lParam); - -// --------------------------------------------------------------------------- -// useful macros and functions -// --------------------------------------------------------------------------- - -// a wrapper macro for ZeroMemory() -#if defined(__WIN32__) && !defined(__WXMICROWIN__) -#define wxZeroMemory(obj) ::ZeroMemory(&obj, sizeof(obj)) -#else -#define wxZeroMemory(obj) memset((void*) & obj, 0, sizeof(obj)) -#endif - -// This one is a macro so that it can be tested with #ifdef, it will be -// undefined if it cannot be implemented for a given compiler. -// Vc++, bcc, dmc, ow, mingw, codewarrior (and rsxnt) have _get_osfhandle. -// Cygwin has get_osfhandle. Others are currently unknown, e.g. Salford, -// Intel, Visual Age. -#if defined(__WXWINCE__) - #define wxGetOSFHandle(fd) ((HANDLE)fd) - #define wxOpenOSFHandle(h, flags) ((int)wxPtrToUInt(h)) -#elif defined(__CYGWIN__) - #define wxGetOSFHandle(fd) ((HANDLE)get_osfhandle(fd)) -#elif defined(__VISUALC__) \ - || defined(__BORLANDC__) \ - || defined(__DMC__) \ - || defined(__WATCOMC__) \ - || defined(__MINGW32__) \ - || (defined(__MWERKS__) && defined(__MSL__)) - #define wxGetOSFHandle(fd) ((HANDLE)_get_osfhandle(fd)) - #define wxOpenOSFHandle(h, flags) (_open_osfhandle(wxPtrToUInt(h), flags)) - #define wx_fdopen _fdopen -#endif - -// close the handle in the class dtor -class AutoHANDLE -{ -public: - wxEXPLICIT AutoHANDLE(HANDLE handle) : m_handle(handle) { } - - bool IsOk() const { return m_handle != INVALID_HANDLE_VALUE; } - operator HANDLE() const { return m_handle; } - - ~AutoHANDLE() { if ( IsOk() ) ::CloseHandle(m_handle); } - -protected: - HANDLE m_handle; -}; - -// a template to make initializing Windows styructs less painful: it zeroes all -// the struct fields and also sets cbSize member to the correct value (and so -// can be only used with structures which have this member...) -template <class T> -struct WinStruct : public T -{ - WinStruct() - { - ::ZeroMemory(this, sizeof(T)); - - // explicit qualification is required here for this to be valid C++ - this->cbSize = sizeof(T); - } -}; - - -#if wxUSE_GUI - -#include "wx/gdicmn.h" -#include "wx/colour.h" - -// make conversion from wxColour and COLORREF a bit less painful -inline COLORREF wxColourToRGB(const wxColour& c) -{ - return RGB(c.Red(), c.Green(), c.Blue()); -} - -inline COLORREF wxColourToPalRGB(const wxColour& c) -{ - return PALETTERGB(c.Red(), c.Green(), c.Blue()); -} - -inline wxColour wxRGBToColour(COLORREF rgb) -{ - return wxColour(GetRValue(rgb), GetGValue(rgb), GetBValue(rgb)); -} - -inline void wxRGBToColour(wxColour& c, COLORREF rgb) -{ - c.Set(GetRValue(rgb), GetGValue(rgb), GetBValue(rgb)); -} - -// get the standard colour map for some standard colours - see comment in this -// function to understand why is it needed and when should it be used -// -// it returns a wxCOLORMAP (can't use COLORMAP itself here as comctl32.dll -// might be not included/available) array of size wxSTD_COLOUR_MAX -// -// NB: if you change these colours, update wxBITMAP_STD_COLOURS in the -// resources as well: it must have the same number of pixels! -enum wxSTD_COLOUR -{ - wxSTD_COL_BTNTEXT, - wxSTD_COL_BTNSHADOW, - wxSTD_COL_BTNFACE, - wxSTD_COL_BTNHIGHLIGHT, - wxSTD_COL_MAX -}; - -struct WXDLLEXPORT wxCOLORMAP -{ - COLORREF from, to; -}; - -// this function is implemented in src/msw/window.cpp -extern wxCOLORMAP *wxGetStdColourMap(); - -// create a wxRect from Windows RECT -inline wxRect wxRectFromRECT(const RECT& rc) -{ - return wxRect(rc.left, rc.top, rc.right - rc.left, rc.bottom - rc.top); -} - -// copy Windows RECT to our wxRect -inline void wxCopyRECTToRect(const RECT& rc, wxRect& rect) -{ - rect = wxRectFromRECT(rc); -} - -// and vice versa -inline void wxCopyRectToRECT(const wxRect& rect, RECT& rc) -{ - // note that we don't use wxRect::GetRight() as it is one of compared to - // wxRectFromRECT() above - rc.top = rect.y; - rc.left = rect.x; - rc.right = rect.x + rect.width; - rc.bottom = rect.y + rect.height; -} - -// translations between HIMETRIC units (which OLE likes) and pixels (which are -// liked by all the others) - implemented in msw/utilsexc.cpp -extern void HIMETRICToPixel(LONG *x, LONG *y); -extern void PixelToHIMETRIC(LONG *x, LONG *y); - -// Windows convention of the mask is opposed to the wxWidgets one, so we need -// to invert the mask each time we pass one/get one to/from Windows -extern HBITMAP wxInvertMask(HBITMAP hbmpMask, int w = 0, int h = 0); - -// Creates an icon or cursor depending from a bitmap -// -// The bitmap must be valid and it should have a mask. If it doesn't, a default -// mask is created using light grey as the transparent colour. -extern HICON wxBitmapToHICON(const wxBitmap& bmp); - -// Same requirments as above apply and the bitmap must also have the correct -// size. -extern -HCURSOR wxBitmapToHCURSOR(const wxBitmap& bmp, int hotSpotX, int hotSpotY); - -// get (x, y) from DWORD - notice that HI/LOWORD can *not* be used because they -// will fail on system with multiple monitors where the coords may be negative -// -// these macros are standard now (Win98) but some older headers don't have them -#ifndef GET_X_LPARAM - #define GET_X_LPARAM(lp) ((int)(short)LOWORD(lp)) - #define GET_Y_LPARAM(lp) ((int)(short)HIWORD(lp)) -#endif // GET_X_LPARAM - -// get the current state of SHIFT/CTRL keys -inline bool wxIsShiftDown() -{ -// return (::GetKeyState(VK_SHIFT) & 0x100) != 0; - // Returns different negative values on WinME and WinNT, - // so simply test for negative value. - return ::GetKeyState(VK_SHIFT) < 0; -} - -inline bool wxIsCtrlDown() -{ -// return (::GetKeyState(VK_CONTROL) & 0x100) != 0; - // Returns different negative values on WinME and WinNT, - // so simply test for negative value. - return ::GetKeyState(VK_CONTROL) < 0; -} - -// wrapper around GetWindowRect() and GetClientRect() APIs doing error checking -// for Win32 -inline RECT wxGetWindowRect(HWND hwnd) -{ - RECT rect; - - if ( !::GetWindowRect(hwnd, &rect) ) - wxLogLastError(_T("GetWindowRect")); - - return rect; -} - -inline RECT wxGetClientRect(HWND hwnd) -{ - RECT rect; - - if ( !::GetClientRect(hwnd, &rect) ) - wxLogLastError(_T("GetClientRect")); - - return rect; -} - -// --------------------------------------------------------------------------- -// small helper classes -// --------------------------------------------------------------------------- - -// create an instance of this class and use it as the HDC for screen, will -// automatically release the DC going out of scope -class ScreenHDC -{ -public: - ScreenHDC() { m_hdc = ::GetDC(NULL); } - ~ScreenHDC() { ::ReleaseDC(NULL, m_hdc); } - - operator HDC() const { return m_hdc; } - -private: - HDC m_hdc; - - DECLARE_NO_COPY_CLASS(ScreenHDC) -}; - -// the same as ScreenHDC but for window DCs -class WindowHDC -{ -public: - WindowHDC(HWND hwnd) { m_hdc = ::GetDC(m_hwnd = hwnd); } - ~WindowHDC() { ::ReleaseDC(m_hwnd, m_hdc); } - - operator HDC() const { return m_hdc; } - -private: - HWND m_hwnd; - HDC m_hdc; - - DECLARE_NO_COPY_CLASS(WindowHDC) -}; - -// the same as ScreenHDC but for memory DCs: creates the HDC compatible with -// the given one (screen by default) in ctor and destroys it in dtor -class MemoryHDC -{ -public: - MemoryHDC(HDC hdc = 0) { m_hdc = ::CreateCompatibleDC(hdc); } - ~MemoryHDC() { ::DeleteDC(m_hdc); } - - operator HDC() const { return m_hdc; } - -private: - HDC m_hdc; - - DECLARE_NO_COPY_CLASS(MemoryHDC) -}; - -// a class which selects a GDI object into a DC in its ctor and deselects in -// dtor -class SelectInHDC -{ -private: - void DoInit(HGDIOBJ hgdiobj) { m_hgdiobj = ::SelectObject(m_hdc, hgdiobj); } - -public: - SelectInHDC() : m_hdc(NULL) { } - SelectInHDC(HDC hdc, HGDIOBJ hgdiobj) : m_hdc(hdc) { DoInit(hgdiobj); } - - void Init(HDC hdc, HGDIOBJ hgdiobj) - { - wxASSERT_MSG( !m_hdc, _T("initializing twice?") ); - - m_hdc = hdc; - - DoInit(hgdiobj); - } - - ~SelectInHDC() { if ( m_hdc ) ::SelectObject(m_hdc, m_hgdiobj); } - - // return true if the object was successfully selected - operator bool() const { return m_hgdiobj != 0; } - -private: - HDC m_hdc; - HGDIOBJ m_hgdiobj; - - DECLARE_NO_COPY_CLASS(SelectInHDC) -}; - -// a class which cleans up any GDI object -class AutoGDIObject -{ -protected: - AutoGDIObject() { m_gdiobj = NULL; } - AutoGDIObject(HGDIOBJ gdiobj) : m_gdiobj(gdiobj) { } - ~AutoGDIObject() { if ( m_gdiobj ) ::DeleteObject(m_gdiobj); } - - void InitGdiobj(HGDIOBJ gdiobj) - { - wxASSERT_MSG( !m_gdiobj, _T("initializing twice?") ); - - m_gdiobj = gdiobj; - } - - HGDIOBJ GetObject() const { return m_gdiobj; } - -private: - HGDIOBJ m_gdiobj; -}; - -// TODO: all this asks for using a AutoHandler<T, CreateFunc> template... - -// a class for temporary brushes -class AutoHBRUSH : private AutoGDIObject -{ -public: - AutoHBRUSH(COLORREF col) - : AutoGDIObject(::CreateSolidBrush(col)) { } - - operator HBRUSH() const { return (HBRUSH)GetObject(); } -}; - -// a class for temporary fonts -class AutoHFONT : private AutoGDIObject -{ -private: -public: - AutoHFONT() - : AutoGDIObject() { } - - AutoHFONT(const LOGFONT& lf) - : AutoGDIObject(::CreateFontIndirect(&lf)) { } - - void Init(const LOGFONT& lf) { InitGdiobj(::CreateFontIndirect(&lf)); } - - operator HFONT() const { return (HFONT)GetObject(); } -}; - -// a class for temporary pens -class AutoHPEN : private AutoGDIObject -{ -public: - AutoHPEN(COLORREF col) - : AutoGDIObject(::CreatePen(PS_SOLID, 0, col)) { } - - operator HPEN() const { return (HPEN)GetObject(); } -}; - -// classes for temporary bitmaps -class AutoHBITMAP : private AutoGDIObject -{ -public: - AutoHBITMAP(HBITMAP hbmp) : AutoGDIObject(hbmp) { } - - operator HBITMAP() const { return (HBITMAP)GetObject(); } -}; - -class CompatibleBitmap : public AutoHBITMAP -{ -public: - CompatibleBitmap(HDC hdc, int w, int h) - : AutoHBITMAP(::CreateCompatibleBitmap(hdc, w, h)) - { - } -}; - -class MonoBitmap : public AutoHBITMAP -{ -public: - MonoBitmap(int w, int h) - : AutoHBITMAP(::CreateBitmap(w, h, 1, 1, 0)) - { - } -}; - -// class automatically destroys the region object -class AutoHRGN : private AutoGDIObject -{ -public: - AutoHRGN(HRGN hrgn) : AutoGDIObject(hrgn) { } - - operator HRGN() const { return (HRGN)GetObject(); } -}; - -// class sets the specified clipping region during its life time -class HDCClipper -{ -public: - HDCClipper(HDC hdc, HRGN hrgn) - : m_hdc(hdc) - { - if ( !::SelectClipRgn(hdc, hrgn) ) - wxLogLastError(_T("SelectClipRgn")); - } - - ~HDCClipper() - { - ::SelectClipRgn(m_hdc, NULL); - } - -private: - HDC m_hdc; - - DECLARE_NO_COPY_CLASS(HDCClipper) -}; - -// set the given map mode for the life time of this object -// -// NB: SetMapMode() is not supported by CE so we also define a helper macro -// to avoid using it there -#ifdef __WXWINCE__ - #define wxCHANGE_HDC_MAP_MODE(hdc, mm) -#else // !__WXWINCE__ - class HDCMapModeChanger - { - public: - HDCMapModeChanger(HDC hdc, int mm) - : m_hdc(hdc) - { - m_modeOld = ::SetMapMode(hdc, mm); - if ( !m_modeOld ) - wxLogLastError(_T("SelectClipRgn")); - } - - ~HDCMapModeChanger() - { - if ( m_modeOld ) - ::SetMapMode(m_hdc, m_modeOld); - } - - private: - HDC m_hdc; - int m_modeOld; - - DECLARE_NO_COPY_CLASS(HDCMapModeChanger) - }; - - #define wxCHANGE_HDC_MAP_MODE(hdc, mm) \ - HDCMapModeChanger wxMAKE_UNIQUE_NAME(wxHDCMapModeChanger)(hdc, mm) -#endif // __WXWINCE__/!__WXWINCE__ - -// smart buffeer using GlobalAlloc/GlobalFree() -class GlobalPtr -{ -public: - // allocates a block of given size - GlobalPtr(size_t size, unsigned flags = GMEM_MOVEABLE) - { - m_hGlobal = ::GlobalAlloc(flags, size); - if ( !m_hGlobal ) - wxLogLastError(_T("GlobalAlloc")); - } - - ~GlobalPtr() - { - if ( m_hGlobal && ::GlobalFree(m_hGlobal) ) - wxLogLastError(_T("GlobalFree")); - } - - // implicit conversion - operator HGLOBAL() const { return m_hGlobal; } - -private: - HGLOBAL m_hGlobal; - - DECLARE_NO_COPY_CLASS(GlobalPtr) -}; - -// when working with global pointers (which is unfortunately still necessary -// sometimes, e.g. for clipboard) it is important to unlock them exactly as -// many times as we lock them which just asks for using a "smart lock" class -class GlobalPtrLock -{ -public: - GlobalPtrLock(HGLOBAL hGlobal) : m_hGlobal(hGlobal) - { - m_ptr = GlobalLock(hGlobal); - if ( !m_ptr ) - wxLogLastError(_T("GlobalLock")); - } - - ~GlobalPtrLock() - { - if ( !GlobalUnlock(m_hGlobal) ) - { -#ifdef __WXDEBUG__ - // this might happen simply because the block became unlocked - DWORD dwLastError = ::GetLastError(); - if ( dwLastError != NO_ERROR ) - { - wxLogApiError(_T("GlobalUnlock"), dwLastError); - } -#endif // __WXDEBUG__ - } - } - - operator void *() const { return m_ptr; } - -private: - HGLOBAL m_hGlobal; - void *m_ptr; - - DECLARE_NO_COPY_CLASS(GlobalPtrLock) -}; - -// register the class when it is first needed and unregister it in dtor -class ClassRegistrar -{ -public: - // ctor doesn't register the class, call Initialize() for this - ClassRegistrar() { m_registered = -1; } - - // return true if the class is already registered - bool IsInitialized() const { return m_registered != -1; } - - // return true if the class had been already registered - bool IsRegistered() const { return m_registered == 1; } - - // try to register the class if not done yet, return true on success - bool Register(const WNDCLASS& wc) - { - // we should only be called if we hadn't been initialized yet - wxASSERT_MSG( m_registered == -1, - _T("calling ClassRegistrar::Register() twice?") ); - - m_registered = ::RegisterClass(&wc) ? 1 : 0; - if ( !IsRegistered() ) - { - wxLogLastError(_T("RegisterClassEx()")); - } - else - { - m_clsname = wc.lpszClassName; - } - - return m_registered == 1; - } - - // get the name of the registered class (returns empty string if not - // registered) - const wxString& GetName() const { return m_clsname; } - - // unregister the class if it had been registered - ~ClassRegistrar() - { - if ( IsRegistered() ) - { - if ( !::UnregisterClass(m_clsname, wxhInstance) ) - { - wxLogLastError(_T("UnregisterClass")); - } - } - } - -private: - // initial value is -1 which means that we hadn't tried registering the - // class yet, it becomes true or false (1 or 0) when Initialize() is called - int m_registered; - - // the name of the class, only non empty if it had been registered - wxString m_clsname; -}; - -// --------------------------------------------------------------------------- -// macros to make casting between WXFOO and FOO a bit easier: the GetFoo() -// returns Foo cast to the Windows type for oruselves, while GetFooOf() takes -// an argument which should be a pointer or reference to the object of the -// corresponding class (this depends on the macro) -// --------------------------------------------------------------------------- - -#define GetHwnd() ((HWND)GetHWND()) -#define GetHwndOf(win) ((HWND)((win)->GetHWND())) -// old name -#define GetWinHwnd GetHwndOf - -#define GetHdc() ((HDC)GetHDC()) -#define GetHdcOf(dc) ((HDC)(dc).GetHDC()) - -#define GetHbitmap() ((HBITMAP)GetHBITMAP()) -#define GetHbitmapOf(bmp) ((HBITMAP)(bmp).GetHBITMAP()) - -#define GetHicon() ((HICON)GetHICON()) -#define GetHiconOf(icon) ((HICON)(icon).GetHICON()) - -#define GetHaccel() ((HACCEL)GetHACCEL()) -#define GetHaccelOf(table) ((HACCEL)((table).GetHACCEL())) - -#define GetHbrush() ((HBRUSH)GetResourceHandle()) -#define GetHbrushOf(brush) ((HBRUSH)(brush).GetResourceHandle()) - -#define GetHmenu() ((HMENU)GetHMenu()) -#define GetHmenuOf(menu) ((HMENU)menu->GetHMenu()) - -#define GetHcursor() ((HCURSOR)GetHCURSOR()) -#define GetHcursorOf(cursor) ((HCURSOR)(cursor).GetHCURSOR()) - -#define GetHfont() ((HFONT)GetHFONT()) -#define GetHfontOf(font) ((HFONT)(font).GetHFONT()) - -#define GetHimagelist() ((HIMAGELIST)GetHIMAGELIST()) -#define GetHimagelistOf(imgl) ((HIMAGELIST)imgl->GetHIMAGELIST()) - -#define GetHpalette() ((HPALETTE)GetHPALETTE()) -#define GetHpaletteOf(pal) ((HPALETTE)(pal).GetHPALETTE()) - -#define GetHpen() ((HPEN)GetResourceHandle()) -#define GetHpenOf(pen) ((HPEN)(pen).GetResourceHandle()) - -#define GetHrgn() ((HRGN)GetHRGN()) -#define GetHrgnOf(rgn) ((HRGN)(rgn).GetHRGN()) - -#endif // wxUSE_GUI - -// --------------------------------------------------------------------------- -// global functions -// --------------------------------------------------------------------------- - -extern "C" -{ - WXDLLIMPEXP_BASE HINSTANCE wxGetInstance(); -} - -WXDLLIMPEXP_BASE void wxSetInstance(HINSTANCE hInst); - -// return the full path of the given module -inline wxString wxGetFullModuleName(HMODULE hmod) -{ - wxString fullname; - if ( !::GetModuleFileName - ( - hmod, - wxStringBuffer(fullname, MAX_PATH), - MAX_PATH - ) ) - { - wxLogLastError(_T("GetModuleFileName")); - } - - return fullname; -} - -// return the full path of the program file -inline wxString wxGetFullModuleName() -{ - return wxGetFullModuleName((HMODULE)wxGetInstance()); -} - -// return the run-time version of the OS in a format similar to -// WINVER/_WIN32_WINNT compile-time macros: -// -// 0x0300 Windows NT 3.51 -// 0x0400 Windows 95, NT4 -// 0x0410 Windows 98 -// 0x0500 Windows ME, 2000 -// 0x0501 Windows XP -// 0x0502 Windows 2003 -// 0x0600 Longhorn -// -// for the other Windows versions 0 is currently returned -enum wxWinVersion -{ - wxWinVersion_Unknown = 0, - - wxWinVersion_3 = 0x0300, - wxWinVersion_NT3 = wxWinVersion_3, - - wxWinVersion_4 = 0x0400, - wxWinVersion_95 = wxWinVersion_4, - wxWinVersion_NT4 = wxWinVersion_4, - wxWinVersion_98 = 0x0410, - - wxWinVersion_5 = 0x0500, - wxWinVersion_ME = wxWinVersion_5, - wxWinVersion_NT5 = wxWinVersion_5, - wxWinVersion_2000 = wxWinVersion_5, - wxWinVersion_XP = 0x0501, - wxWinVersion_2003 = 0x0502, - - wxWinVersion_6 = 0x0600, - wxWinVersion_NT6 = 0x0600 -}; - -WXDLLIMPEXP_BASE wxWinVersion wxGetWinVersion(); - -#if wxUSE_GUI - -// cursor stuff -extern HCURSOR wxGetCurrentBusyCursor(); // from msw/utils.cpp -extern const wxCursor *wxGetGlobalCursor(); // from msw/cursor.cpp - -WXDLLEXPORT void wxGetCharSize(WXHWND wnd, int *x, int *y, const wxFont& the_font); -WXDLLEXPORT void wxFillLogFont(LOGFONT *logFont, const wxFont *font); -WXDLLEXPORT wxFont wxCreateFontFromLogFont(const LOGFONT *logFont); -WXDLLEXPORT wxFontEncoding wxGetFontEncFromCharSet(int charset); - -WXDLLEXPORT void wxSliderEvent(WXHWND control, WXWORD wParam, WXWORD pos); -WXDLLEXPORT void wxScrollBarEvent(WXHWND hbar, WXWORD wParam, WXWORD pos); - -// Find maximum size of window/rectangle -extern WXDLLEXPORT void wxFindMaxSize(WXHWND hwnd, RECT *rect); - -// Safely get the window text (i.e. without using fixed size buffer) -extern WXDLLEXPORT wxString wxGetWindowText(WXHWND hWnd); - -// get the window class name -extern WXDLLEXPORT wxString wxGetWindowClass(WXHWND hWnd); - -// get the window id (should be unsigned, hence this is not wxWindowID which -// is, for mainly historical reasons, signed) -extern WXDLLEXPORT WXWORD wxGetWindowId(WXHWND hWnd); - -// check if hWnd's WNDPROC is wndProc. Return true if yes, false if they are -// different -extern WXDLLEXPORT bool wxCheckWindowWndProc(WXHWND hWnd, WXFARPROC wndProc); - -// Does this window style specify any border? -inline bool wxStyleHasBorder(long style) -{ - return (style & (wxSIMPLE_BORDER | wxRAISED_BORDER | - wxSUNKEN_BORDER | wxDOUBLE_BORDER)) != 0; -} - -// ---------------------------------------------------------------------------- -// functions mapping HWND to wxWindow -// ---------------------------------------------------------------------------- - -// this function simply checks whether the given hWnd corresponds to a wxWindow -// and returns either that window if it does or NULL otherwise -extern WXDLLEXPORT wxWindow* wxFindWinFromHandle(WXHWND hWnd); - -// find the window for HWND which is part of some wxWindow, i.e. unlike -// wxFindWinFromHandle() above it will also work for "sub controls" of a -// wxWindow. -// -// returns the wxWindow corresponding to the given HWND or NULL. -extern WXDLLEXPORT wxWindow *wxGetWindowFromHWND(WXHWND hwnd); - -// Get the size of an icon -extern WXDLLEXPORT wxSize wxGetHiconSize(HICON hicon); - -// Lines are drawn differently for WinCE and regular WIN32 -WXDLLEXPORT void wxDrawLine(HDC hdc, int x1, int y1, int x2, int y2); - -// fill the client rect of the given window on the provided dc using this brush -inline void wxFillRect(HWND hwnd, HDC hdc, HBRUSH hbr) -{ - RECT rc; - ::GetClientRect(hwnd, &rc); - ::FillRect(hdc, &rc, hbr); -} - -// ---------------------------------------------------------------------------- -// 32/64 bit helpers -// ---------------------------------------------------------------------------- - -#ifdef __WIN64__ - -inline void *wxGetWindowProc(HWND hwnd) -{ - return (void *)::GetWindowLongPtr(hwnd, GWLP_WNDPROC); -} - -inline void *wxGetWindowUserData(HWND hwnd) -{ - return (void *)::GetWindowLongPtr(hwnd, GWLP_USERDATA); -} - -inline WNDPROC wxSetWindowProc(HWND hwnd, WNDPROC func) -{ - return (WNDPROC)::SetWindowLongPtr(hwnd, GWLP_WNDPROC, (LONG_PTR)func); -} - -inline void *wxSetWindowUserData(HWND hwnd, void *data) -{ - return (void *)::SetWindowLongPtr(hwnd, GWLP_USERDATA, (LONG_PTR)data); -} - -#else // __WIN32__ - -// note that the casts to LONG_PTR here are required even on 32-bit machines -// for the 64-bit warning mode of later versions of MSVC (C4311/4312) -inline WNDPROC wxGetWindowProc(HWND hwnd) -{ - return (WNDPROC)(LONG_PTR)::GetWindowLong(hwnd, GWL_WNDPROC); -} - -inline void *wxGetWindowUserData(HWND hwnd) -{ - return (void *)(LONG_PTR)::GetWindowLong(hwnd, GWL_USERDATA); -} - -inline WNDPROC wxSetWindowProc(HWND hwnd, WNDPROC func) -{ - return (WNDPROC)(LONG_PTR)::SetWindowLong(hwnd, GWL_WNDPROC, (LONG_PTR)func); -} - -inline void *wxSetWindowUserData(HWND hwnd, void *data) -{ - return (void *)(LONG_PTR)::SetWindowLong(hwnd, GWL_USERDATA, (LONG_PTR)data); -} - -#endif // __WIN64__/__WIN32__ - -#endif // wxUSE_GUI - -#endif // _WX_PRIVATE_H_ diff --git a/wxWidgets/include/wx/msw/question.ico b/wxWidgets/include/wx/msw/question.ico deleted file mode 100644 index b34c3b81d1c02316cef9e735736f51954132495d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2238 zcmcK4KTH~77{~FSX%jl>)<hRw&UBSs?TAb)%I3f*iUS*qOm>5W!O=K0O>;~v1~=jW zNe8E!jDvy1t``|<QsUF^dmMlK16#Q~cX+?g`@VP29ZCyqYinZvNk2bHpCx^vIHj+Y zJMTW_kI~_sU73*6<?`^rp08@PT58?36#n|5AT%|)rb=MSw@s<0$@5KeRlAc)S5odw zN*ASMMnMnX!PoIsd=a0;?ovDWP5cJl!!P5Rx6!~?@OgX+?_u>!;e{7ocxBYXckp$5 z6<@?>@w+nZ;5YFbcn`mf5Aj`mfN$fQcpvZMYxojAhfm{^c*7gs@P;?M;h)*=*sj>l z*othK$cOkYKESu}O}v}kN7v9LbPk<HCz-#8@8IkBD!z!%;&<^o_)Yu<-or2BnYYov zSMYg!3h&M6j$}Q22Vcim@kM;rlkL*Y9lE(mH#g{}M>m)8A-;<b@NIk(@8f-Z4PV0N z@M(M!Z+OES-tdMuu7}5U$K$%<ah>tFiaf4NMhfv=e1LD`n|L2T<MmMw-@(`MReTYj z#m{(sm^V-ZU%}_`DZGcD)u6z7_zu2~uj1*nWx28U8x&ZG@8Sb|8{fp!oEZ%YjQ5$U zP<bjvdDN^1Jw86_;o(8Ix3{{vxzY9YwJt9&<@>(Q&(Bq>)pUA#s#2+>LZP5sE~mY{ zJ*CrWZEbBSnM`VZeO)UnD_UG!RQT8Q{o;b(ahcx>>$;y3>qiIn?o!O{{==s~f6o5= zJTX5{%+C`xH&58yoOn*&ck!&e-yg;<e|v*2jYdb~-w47uC3h3NoMIBX3y8&}$)ln9 z!^0?#*BF6OY=yxf&ZCQruW}qu=aajb#G|pp<EYKkd7&^dqc%+CtiL}7aXuB>;b3t5 z0&oY@`Tp@VNJQ5^o!dSujAt0;FD5Xz#L@fLe>lAO!63eec=&icYaf^$Ovb-zZ=R)( zj*ds`Cr0u37V^x1VG=%5@fhs${P<V#CI-B?OP>E^^7z~2{o&i2G&(`xKCi;zdT#%R z`b~AHZxm}jQv)ib${&n>?KY53o}}$iTD_N+T2y&h365@hS4*z=+tn(y-D2E5<3laj MliXZOW~~$Z2iSjmhyVZp diff --git a/wxWidgets/include/wx/msw/radiobox.h b/wxWidgets/include/wx/msw/radiobox.h deleted file mode 100644 index 303876a464..0000000000 --- a/wxWidgets/include/wx/msw/radiobox.h +++ /dev/null @@ -1,175 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/msw/radiobox.h -// Purpose: wxRadioBox class -// Author: Julian Smart -// Modified by: -// Created: 01/02/97 -// RCS-ID: $Id: radiobox.h 53135 2008-04-12 02:31:04Z VZ $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_RADIOBOX_H_ -#define _WX_RADIOBOX_H_ - -#include "wx/statbox.h" - -class WXDLLIMPEXP_FWD_CORE wxSubwindows; - -// ---------------------------------------------------------------------------- -// wxRadioBox -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxRadioBox : public wxStaticBox, public wxRadioBoxBase -{ -public: - wxRadioBox() { Init(); } - - 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) - { - Init(); - - (void)Create(parent, id, title, pos, size, n, choices, majorDim, - style, val, name); - } - - 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) - { - Init(); - - (void)Create(parent, id, title, pos, size, choices, majorDim, - style, val, name); - } - - virtual ~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); - - // implement the radiobox interface - virtual void SetSelection(int n); - virtual int GetSelection() const { return m_selectedButton; } - virtual unsigned int GetCount() const; - virtual wxString GetString(unsigned int n) const; - virtual void SetString(unsigned int n, const wxString& label); - virtual bool Enable(unsigned int n, bool enable = true); - virtual bool Show(unsigned int n, bool show = true); - virtual bool IsItemEnabled(unsigned int n) const; - virtual bool IsItemShown(unsigned int n) const; - virtual int GetItemFromPoint(const wxPoint& pt) const; - - // override some base class methods - virtual bool Show(bool show = true); - virtual bool Enable(bool enable = true); - virtual void SetFocus(); - virtual bool SetFont(const wxFont& font); - virtual bool ContainsHWND(WXHWND hWnd) const; -#if wxUSE_TOOLTIPS - virtual bool HasToolTips() const; -#endif // wxUSE_TOOLTIPS -#if wxUSE_HELP - // override virtual function with a platform-independent implementation - virtual wxString GetHelpTextAtPoint(const wxPoint & pt, wxHelpEvent::Origin origin) const - { - return wxRadioBoxBase::DoGetHelpTextAtPoint( this, pt, origin ); - } -#endif // wxUSE_HELP - - virtual bool Reparent(wxWindowBase *newParent); - - // we inherit a version always returning false from wxStaticBox, override - // it to behave normally - virtual bool AcceptsFocus() const { return wxControl::AcceptsFocus(); } - - void SetLabelFont(const wxFont& WXUNUSED(font)) {} - void SetButtonFont(const wxFont& font) { SetFont(font); } - - // implementation only from now on - // ------------------------------- - - virtual bool MSWCommand(WXUINT param, WXWORD id); - void Command(wxCommandEvent& event); - - void SendNotificationEvent(); - -protected: - // common part of all ctors - void Init(); - - // subclass one radio button - void SubclassRadioButton(WXHWND hWndBtn); - - // get the max size of radio buttons - wxSize GetMaxButtonSize() const; - - // get the total size occupied by the radio box buttons - wxSize GetTotalButtonSize(const wxSize& sizeBtn) const; - - virtual void DoSetSize(int x, int y, - int width, int height, - int sizeFlags = wxSIZE_AUTO); - virtual wxSize DoGetBestSize() const; - -#if wxUSE_TOOLTIPS - virtual void DoSetItemToolTip(unsigned int n, wxToolTip * tooltip); -#endif - -#ifndef __WXWINCE__ - virtual WXHRGN MSWGetRegionWithoutChildren(); -#endif // __WXWINCE__ - - - // the buttons we contain - wxSubwindows *m_radioButtons; - - // array of widths and heights of the buttons, may be wxDefaultCoord if the - // corresponding quantity should be computed - int *m_radioWidth; - int *m_radioHeight; - - // currently selected button or wxNOT_FOUND if none - int m_selectedButton; - -private: - DECLARE_DYNAMIC_CLASS(wxRadioBox) - DECLARE_NO_COPY_CLASS(wxRadioBox) -}; - -#endif - // _WX_RADIOBOX_H_ diff --git a/wxWidgets/include/wx/msw/radiobut.h b/wxWidgets/include/wx/msw/radiobut.h deleted file mode 100644 index 4a6e86e450..0000000000 --- a/wxWidgets/include/wx/msw/radiobut.h +++ /dev/null @@ -1,70 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: radiobut.h -// Purpose: wxRadioButton class -// Author: Julian Smart -// Modified by: -// Created: 01/02/97 -// RCS-ID: $Id: radiobut.h 41144 2006-09-10 23:08:13Z VZ $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_RADIOBUT_H_ -#define _WX_RADIOBUT_H_ - -class WXDLLEXPORT wxRadioButton: public wxControl -{ -public: - // ctors and creation functions - wxRadioButton() { Init(); } - - 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) - { - Init(); - - 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); - - // implement the radio button interface - virtual void SetValue(bool value); - virtual bool GetValue() const; - - // implementation only from now on - virtual bool MSWCommand(WXUINT param, WXWORD id); - virtual void Command(wxCommandEvent& event); - virtual bool HasTransparentBackground() { return true; } - - virtual WXDWORD MSWGetStyle(long style, WXDWORD *exstyle) const; - -protected: - virtual wxSize DoGetBestSize() const; - -private: - // common part of all ctors - void Init(); - - // we need to store the state internally as the result of GetValue() - // sometimes gets out of sync in WM_COMMAND handler - bool m_isChecked; - - DECLARE_DYNAMIC_CLASS_NO_COPY(wxRadioButton) -}; - -#endif - // _WX_RADIOBUT_H_ diff --git a/wxWidgets/include/wx/msw/rcdefs.h b/wxWidgets/include/wx/msw/rcdefs.h deleted file mode 100644 index 7d963d966a..0000000000 --- a/wxWidgets/include/wx/msw/rcdefs.h +++ /dev/null @@ -1,15 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: wx/msw/rcdefs.h -// Purpose: Fallback for the generated rcdefs.h under the lib directory -// Author: Mike Wetherell -// RCS-ID: $Id: rcdefs.h 36133 2005-11-08 22:49:46Z MW $ -// Copyright: (c) 2005 Mike Wetherell -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_RCDEFS_H -#define _WX_RCDEFS_H - -#define WX_CPU_X86 - -#endif diff --git a/wxWidgets/include/wx/msw/regconf.h b/wxWidgets/include/wx/msw/regconf.h deleted file mode 100644 index 98efd67a9d..0000000000 --- a/wxWidgets/include/wx/msw/regconf.h +++ /dev/null @@ -1,116 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: msw/regconf.h -// Purpose: Registry based implementation of wxConfigBase -// Author: Vadim Zeitlin -// Modified by: -// Created: 27.04.98 -// RCS-ID: $Id: regconf.h 62185 2009-09-28 10:02:42Z JS $ -// Copyright: (c) 1998 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr> -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _REGCONF_H -#define _REGCONF_H - -#include "wx/defs.h" - -#if wxUSE_CONFIG - -#ifndef _REGISTRY_H - #include "wx/msw/registry.h" -#endif - -#include "wx/object.h" -#include "wx/confbase.h" - -// ---------------------------------------------------------------------------- -// wxRegConfig -// ---------------------------------------------------------------------------- - -class WXDLLIMPEXP_BASE wxRegConfig : public wxConfigBase -{ -public: - // ctor & dtor - // will store data in HKLM\appName and HKCU\appName - wxRegConfig(const wxString& appName = wxEmptyString, - const wxString& vendorName = wxEmptyString, - const wxString& localFilename = wxEmptyString, - const wxString& globalFilename = wxEmptyString, - long style = wxCONFIG_USE_GLOBAL_FILE); - - // dtor will save unsaved data - virtual ~wxRegConfig(){} - - // implement inherited pure virtual functions - // ------------------------------------------ - - // path management - virtual void SetPath(const wxString& strPath); - virtual const wxString& GetPath() const { return m_strPath; } - - // entry/subgroup info - // enumerate all of them - virtual bool GetFirstGroup(wxString& str, long& lIndex) const; - virtual bool GetNextGroup (wxString& str, long& lIndex) const; - virtual bool GetFirstEntry(wxString& str, long& lIndex) const; - virtual bool GetNextEntry (wxString& str, long& lIndex) const; - - // tests for existence - virtual bool HasGroup(const wxString& strName) const; - virtual bool HasEntry(const wxString& strName) const; - virtual EntryType GetEntryType(const wxString& name) const; - - // get number of entries/subgroups in the current group, with or without - // it's subgroups - virtual size_t GetNumberOfEntries(bool bRecursive = false) const; - virtual size_t GetNumberOfGroups(bool bRecursive = false) const; - - virtual bool Flush(bool WXUNUSED(bCurrentOnly) = false) { return true; } - - // rename - virtual bool RenameEntry(const wxString& oldName, const wxString& newName); - virtual bool RenameGroup(const wxString& oldName, const wxString& newName); - - // delete - virtual bool DeleteEntry(const wxString& key, bool bGroupIfEmptyAlso = true); - virtual bool DeleteGroup(const wxString& key); - virtual bool DeleteAll(); - -protected: - // opens the local key creating it if necessary and returns it - wxRegKey& LocalKey() const // must be const to be callable from const funcs - { - wxRegConfig* self = wxConstCast(this, wxRegConfig); - - if ( !m_keyLocal.IsOpened() ) - { - // create on demand - self->m_keyLocal.Create(); - } - - return self->m_keyLocal; - } - - // implement read/write methods - virtual bool DoReadString(const wxString& key, wxString *pStr) const; - virtual bool DoReadLong(const wxString& key, long *plResult) const; - - virtual bool DoWriteString(const wxString& key, const wxString& szValue); - virtual bool DoWriteLong(const wxString& key, long lValue); - -private: - // no copy ctor/assignment operator - wxRegConfig(const wxRegConfig&); - wxRegConfig& operator=(const wxRegConfig&); - - // these keys are opened during all lifetime of wxRegConfig object - wxRegKey m_keyLocalRoot, m_keyLocal, - m_keyGlobalRoot, m_keyGlobal; - - // current path (not '/' terminated) - wxString m_strPath; -}; - -#endif // wxUSE_CONFIG - -#endif // _REGCONF_H diff --git a/wxWidgets/include/wx/msw/region.h b/wxWidgets/include/wx/msw/region.h deleted file mode 100644 index f519ae744f..0000000000 --- a/wxWidgets/include/wx/msw/region.h +++ /dev/null @@ -1,104 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/msw/region.h -// Purpose: wxRegion class -// Author: Julian Smart -// Modified by: -// Created: 01/02/97 -// RCS-ID: $Id: region.h 59602 2009-03-18 10:07:58Z VZ $ -// Copyright: (c) 1997-2002 wxWidgets team -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_MSW_REGION_H_ -#define _WX_MSW_REGION_H_ - -class WXDLLEXPORT wxRegion : public wxRegionWithCombine -{ -public: - wxRegion(); - wxRegion(wxCoord x, wxCoord y, wxCoord w, wxCoord h); - wxRegion(const wxPoint& topLeft, const wxPoint& bottomRight); - wxRegion(const wxRect& rect); - wxRegion(WXHRGN hRegion); // Hangs on to this region - wxRegion(size_t n, const wxPoint *points, int fillStyle = wxODDEVEN_RULE ); -#if wxUSE_IMAGE - wxRegion( const wxBitmap& bmp) - { - Union(bmp); - } - wxRegion( const wxBitmap& bmp, - const wxColour& transColour, int tolerance = 0) - { - Union(bmp, transColour, tolerance); - } -#endif // wxUSE_IMAGE - - virtual ~wxRegion(); - - // wxRegionBase methods - virtual void Clear(); - virtual bool IsEmpty() const; - - // Get internal region handle - WXHRGN GetHRGN() const; - -protected: - virtual wxObjectRefData *CreateRefData() const; - virtual wxObjectRefData *CloneRefData(const wxObjectRefData *data) const; - - virtual bool DoIsEqual(const wxRegion& region) const; - virtual bool DoGetBox(wxCoord& x, wxCoord& y, wxCoord& w, wxCoord& h) const; - virtual wxRegionContain DoContainsPoint(wxCoord x, wxCoord y) const; - virtual wxRegionContain DoContainsRect(const wxRect& rect) const; - - virtual bool DoOffset(wxCoord x, wxCoord y); - virtual bool DoCombine(const wxRegion& region, wxRegionOp op); - - friend class WXDLLIMPEXP_FWD_CORE wxRegionIterator; - - DECLARE_DYNAMIC_CLASS(wxRegion) -}; - -class WXDLLEXPORT wxRegionIterator : public wxObject -{ -public: - wxRegionIterator() { Init(); } - wxRegionIterator(const wxRegion& region); - wxRegionIterator(const wxRegionIterator& ri) : wxObject(ri) { Init(); *this = ri; } - - wxRegionIterator& operator=(const wxRegionIterator& ri); - - virtual ~wxRegionIterator(); - - void Reset() { m_current = 0; } - void Reset(const wxRegion& region); - - bool HaveRects() const { return (m_current < m_numRects); } - - operator bool () const { return HaveRects(); } - - wxRegionIterator& operator++(); - wxRegionIterator operator++(int); - - wxCoord GetX() const; - wxCoord GetY() const; - wxCoord GetW() const; - wxCoord GetWidth() const { return GetW(); } - wxCoord GetH() const; - wxCoord GetHeight() const { return GetH(); } - - wxRect GetRect() const { return wxRect(GetX(), GetY(), GetW(), GetH()); } - -private: - // common part of all ctors - void Init(); - - long m_current; - long m_numRects; - wxRegion m_region; - wxRect* m_rects; - - DECLARE_DYNAMIC_CLASS(wxRegionIterator) -}; - -#endif // _WX_MSW_REGION_H_ diff --git a/wxWidgets/include/wx/msw/registry.h b/wxWidgets/include/wx/msw/registry.h deleted file mode 100644 index 27783e9ce6..0000000000 --- a/wxWidgets/include/wx/msw/registry.h +++ /dev/null @@ -1,247 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: wx/msw/registry.h -// Purpose: Registry classes and functions -// Author: Vadim Zeitlin -// Modified by: -// Created: 03.04.1998 -// RCS-ID: $Id: registry.h 49563 2007-10-31 20:46:21Z VZ $ -// Copyright: (c) 1998 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr> -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_MSW_REGISTRY_H_ -#define _WX_MSW_REGISTRY_H_ - -class WXDLLIMPEXP_FWD_BASE wxOutputStream; - -// ---------------------------------------------------------------------------- -// class wxRegKey encapsulates window HKEY handle -// ---------------------------------------------------------------------------- - -class WXDLLIMPEXP_BASE wxRegKey -{ -public: - // NB: do _not_ change the values of elements in these enumerations! - - // registry value types (with comments from winnt.h) - enum ValueType - { - Type_None, // No value type - Type_String, // Unicode nul terminated string - Type_Expand_String, // Unicode nul terminated string - // (with environment variable references) - Type_Binary, // Free form binary - Type_Dword, // 32-bit number - Type_Dword_little_endian // 32-bit number - = Type_Dword, // (same as Type_DWORD) - Type_Dword_big_endian, // 32-bit number - Type_Link, // Symbolic Link (unicode) - Type_Multi_String, // Multiple Unicode strings - Type_Resource_list, // Resource list in the resource map - Type_Full_resource_descriptor, // Resource list in the hardware description - Type_Resource_requirements_list // ??? - }; - - // predefined registry keys - enum StdKey - { - HKCR, // classes root - HKCU, // current user - HKLM, // local machine - HKUSR, // users - HKPD, // performance data (WinNT/2K only) - HKCC, // current config - HKDD, // dynamic data (Win95/98 only) - HKMAX - }; - - // access mode for the key - enum AccessMode - { - Read, // read-only - Write // read and write - }; - - // information about standard (predefined) registry keys - // number of standard keys - static const size_t nStdKeys; - // get the name of a standard key - static const wxChar *GetStdKeyName(size_t key); - // get the short name of a standard key - static const wxChar *GetStdKeyShortName(size_t key); - // get StdKey from root HKEY - static StdKey GetStdKeyFromHkey(WXHKEY hkey); - - // extacts the std key prefix from the string (return value) and - // leaves only the part after it (i.e. modifies the string passed!) - static StdKey ExtractKeyName(wxString& str); - - // ctors - // root key is set to HKCR (the only root key under Win16) - wxRegKey(); - // strKey is the full name of the key (i.e. starting with HKEY_xxx...) - wxRegKey(const wxString& strKey); - // strKey is the name of key under (standard key) keyParent - wxRegKey(StdKey keyParent, const wxString& strKey); - // strKey is the name of key under (previously created) keyParent - wxRegKey(const wxRegKey& keyParent, const wxString& strKey); - // dtor closes the key - ~wxRegKey(); - - // change key (closes the previously opened key if any) - // the name is absolute, i.e. should start with HKEY_xxx - void SetName(const wxString& strKey); - // the name is relative to the parent key - void SetName(StdKey keyParent, const wxString& strKey); - // the name is relative to the parent key - void SetName(const wxRegKey& keyParent, const wxString& strKey); - // hKey should be opened and will be closed in wxRegKey dtor - void SetHkey(WXHKEY hKey); - - // get infomation about the key - // get the (full) key name. Abbreviate std root keys if bShortPrefix. - wxString GetName(bool bShortPrefix = true) const; - // return true if the key exists - bool Exists() const; - // get the info about key (any number of these pointers may be NULL) - bool GetKeyInfo(size_t *pnSubKeys, // number of subkeys - size_t *pnMaxKeyLen, // max len of subkey name - size_t *pnValues, // number of values - size_t *pnMaxValueLen) const; - // return true if the key is opened - bool IsOpened() const { return m_hKey != 0; } - // for "if ( !key ) wxLogError(...)" kind of expressions - operator bool() const { return m_dwLastError == 0; } - - // operations on the key itself - // explicitly open the key (will be automatically done by all functions - // which need the key to be opened if the key is not opened yet) - bool Open(AccessMode mode = Write); - // create the key: will fail if the key already exists and !bOkIfExists - bool Create(bool bOkIfExists = true); - // rename a value from old name to new one - bool RenameValue(const wxChar *szValueOld, const wxChar *szValueNew); - // rename the key - bool Rename(const wxChar *szNewName); - // copy value to another key possibly changing its name (by default it will - // remain the same) - bool CopyValue(const wxChar *szValue, wxRegKey& keyDst, - const wxChar *szNewName = NULL); - // copy the entire contents of the key recursively to another location - bool Copy(const wxChar *szNewName); - // same as Copy() but using a key and not the name - bool Copy(wxRegKey& keyDst); - // close the key (will be automatically done in dtor) - bool Close(); - - // deleting keys/values - // deletes this key and all of it's subkeys/values - bool DeleteSelf(); - // deletes the subkey with all of it's subkeys/values recursively - bool DeleteKey(const wxChar *szKey); - // deletes the named value (may be NULL to remove the default value) - bool DeleteValue(const wxChar *szValue); - - // access to values and subkeys - // get value type - ValueType GetValueType(const wxChar *szValue) const; - // returns true if the value contains a number (else it's some string) - bool IsNumericValue(const wxChar *szValue) const; - - // assignment operators set the default value of the key - wxRegKey& operator=(const wxString& strValue) - { SetValue(NULL, strValue); return *this; } - wxRegKey& operator=(long lValue) - { SetValue(NULL, lValue); return *this; } - - // query the default value of the key: implicitly or explicitly - wxString QueryDefaultValue() const; - operator wxString() const { return QueryDefaultValue(); } - - // named values - - // set the string value - bool SetValue(const wxChar *szValue, const wxString& strValue); - // retrieve the string value - bool QueryValue(const wxChar *szValue, wxString& strValue) const - { return QueryValue(szValue, strValue, false); } - // retrieve raw string value - bool QueryRawValue(const wxChar *szValue, wxString& strValue) const - { return QueryValue(szValue, strValue, true); } - // retrieve either raw or expanded string value - bool QueryValue(const wxChar *szValue, wxString& strValue, bool raw) const; - - // set the numeric value - bool SetValue(const wxChar *szValue, long lValue); - // return the numeric value - bool QueryValue(const wxChar *szValue, long *plValue) const; - // set the binary value - bool SetValue(const wxChar *szValue, const wxMemoryBuffer& buf); - // return the binary value - bool QueryValue(const wxChar *szValue, wxMemoryBuffer& buf) const; - - // query existence of a key/value - // return true if value exists - bool HasValue(const wxChar *szKey) const; - // return true if given subkey exists - bool HasSubKey(const wxChar *szKey) const; - // return true if any subkeys exist - bool HasSubkeys() const; - // return true if any values exist - bool HasValues() const; - // return true if the key is empty (nothing under this key) - bool IsEmpty() const { return !HasSubkeys() && !HasValues(); } - - // enumerate values and subkeys - bool GetFirstValue(wxString& strValueName, long& lIndex); - bool GetNextValue (wxString& strValueName, long& lIndex) const; - - bool GetFirstKey (wxString& strKeyName , long& lIndex); - bool GetNextKey (wxString& strKeyName , long& lIndex) const; - - // export the contents of this key and all its subkeys to the given file - // (which won't be overwritten, it's an error if it already exists) - // - // note that we export the key in REGEDIT4 format, not RegSaveKey() binary - // format nor newer REGEDIT5 one - bool Export(const wxString& filename) const; - - // same as above but write to the given (opened) stream - bool Export(wxOutputStream& ostr) const; - - - // for wxRegConfig usage only: preallocate some memory for the name - void ReserveMemoryForName(size_t bytes) { m_strKey.reserve(bytes); } - -private: - // common part of all ctors - void Init() - { - m_hKey = (WXHKEY) NULL; - m_dwLastError = 0; - } - - // recursive helper for Export() - bool DoExport(wxOutputStream& ostr) const; - - // export a single value - bool DoExportValue(wxOutputStream& ostr, const wxString& name) const; - - // return the text representation (in REGEDIT4 format) of the value with the - // given name - wxString FormatValue(const wxString& name) const; - - - WXHKEY m_hKey, // our handle - m_hRootKey; // handle of the top key (i.e. StdKey) - wxString m_strKey; // key name (relative to m_hRootKey) - - AccessMode m_mode; // valid only if key is opened - long m_dwLastError; // last error (0 if none) - - - DECLARE_NO_COPY_CLASS(wxRegKey) -}; - -#endif // _WX_MSW_REGISTRY_H_ - diff --git a/wxWidgets/include/wx/msw/removble.ico b/wxWidgets/include/wx/msw/removble.ico deleted file mode 100644 index f218a894c2f9603c5c5ea7d685e946df83d3f947..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1718 zcmbu<J!l$X9LMor`a&|LS<TetB&+U*j_Tx+xI2`B5DEv4xWp-S^1vZu=ukSGlS?q0 zWKigk>89XNylTzSfMm%~$kXq0=FK!xN}tRBdG2|hkI!BH&)rE&dZx8C#pT^gDaqN| z&A`Tz)L?AGjuEekC9P0PZ<u?!)Fl2?tIZl}PSx#p)g5#-{rW}0)Tli)Y6M2*o>8`A z<oHIi(HuzCW2tl?<y|RVP!Qt#_!i#7yZ9n@i^$<K_!Qp3C-AJ>ZsQyHGCqrUu(~Gj z!V53F3JURkd<*a4U3?M0C8HcZgHPcdd;&kk5AgxMhwtEhypM0<tN0Q=k5A(b-rx=1 z;0@m3uQ>)B#~cS7E=M8uQ~VGg;CuKE-mdPWo9HUKgwCVWtRLe0_!i#7yZ9o03!lSh z@F~25PvBX%-NrZYWqcOzEXa;zLVO?J!h3iZUvy-)$YzdgX2@oWY&v8!fuG`s_yFI- zckn*m$2aj+d<mb&r||}F@CI-225-0@wrjw49kX2rY?sS+6$;W6Kg0+49=?P3@e3Xw zh4?<ch4=6-zKCD&_^@uEHok!`<Fj}NzbHY03Gsb=3-95{v?=nBJ)NMyOz}f}fbZcu zc#^XqL4o0UCK^PU$Px~*C_$H(ml}`9Iy*bl>FKFXPEK@mbR^&Rb$EEFX0xgN{e4xd zRqgETs8lLxdwW~?d|sQIn@XqCN+y$9Utibi>Z+!{j6Q$*#Cu%hec`(HRpR<_Lv3%x z*y?X(GFLPi-4|w}$>`@zxwx2opg$aj;rG#Ky!^xdFq%YjWfDD{zdDbi@PWUIB1Ln3 z&GpYC?l!t#-**4#GjMbLc-n$T{o6aTzn<lRPv63C<802(cc0JV+p-kLtH<Bj7j{W? z<NB$p#$t@KCvii~Y5bl2*L_;vjm!I4vs>A%Q{L`X_RN(Xs#I*hUjOLL`t{p(W!A6F X+Dc8H^%dQ<E4I%~-L-a^|IgEJ{MMJc diff --git a/wxWidgets/include/wx/msw/rightarr.cur b/wxWidgets/include/wx/msw/rightarr.cur deleted file mode 100644 index c54c3ac4b09fa88728c865d94ae7665a35103f42..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 326 zcma*hu?@mN429u$0nw&IbV*4`OO=em2yBpymQgYS14Q@uO%6p!6!Gah+ozLdsZvtg zN*5h<OVU}=6+Ed&;(Vf{wb^dlTeGVg89MPZ%y{65J32Ha$J}pUQy=hu33k{SoxOy{ Z&Y`v)PJ=xb6Ip{ZB0KsSFD%ITjW>!mc-a5| diff --git a/wxWidgets/include/wx/msw/roller.cur b/wxWidgets/include/wx/msw/roller.cur deleted file mode 100644 index 118c37fa439da2836f547914c866d3ad0c003d64..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 326 zcma)$I}*Y$3`C#F4C%<w&?Y4%Hy}47H^WEa2q{x!ysRB(paXeU(#rZQ90&{poawm* zxByqfB}OCo6{}$*A1|qr(edSh8JY#!6}kky|L>Z3C?dI`TF$@uUN14)|3YajPI_8K rFQraeTWM*eIcyiAFHcrrC03IaWo0{Xest~R1*yP9Dew9N9?13vQju`7 diff --git a/wxWidgets/include/wx/msw/scrolbar.h b/wxWidgets/include/wx/msw/scrolbar.h deleted file mode 100644 index 051e1049d8..0000000000 --- a/wxWidgets/include/wx/msw/scrolbar.h +++ /dev/null @@ -1,72 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: scrollbar.h -// Purpose: wxScrollBar class -// Author: Julian Smart -// Modified by: -// Created: 01/02/97 -// RCS-ID: $Id: scrolbar.h 41020 2006-09-05 20:47:48Z VZ $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_SCROLBAR_H_ -#define _WX_SCROLBAR_H_ - -// Scrollbar item -class WXDLLEXPORT wxScrollBar: public wxScrollBarBase -{ -public: - wxScrollBar() { m_pageSize = 0; m_viewSize = 0; m_objectSize = 0; } - virtual ~wxScrollBar(); - - 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 ; - int GetThumbSize() const { return m_pageSize; } - int GetPageSize() const { return m_viewSize; } - int GetRange() const { return m_objectSize; } - - virtual void SetThumbPosition(int viewStart); - virtual void SetScrollbar(int position, int thumbSize, int range, int pageSize, - bool refresh = true); - - // needed for RTTI - void SetThumbSize( int s ) { SetScrollbar( GetThumbPosition() , s , GetRange() , GetPageSize() , true ) ; } - void SetPageSize( int s ) { SetScrollbar( GetThumbPosition() , GetThumbSize() , GetRange() , s , true ) ; } - void SetRange( int s ) { SetScrollbar( GetThumbPosition() , GetThumbSize() , s , GetPageSize() , true ) ; } - - void Command(wxCommandEvent& event); - virtual bool MSWOnScroll(int orientation, WXWORD wParam, - WXWORD pos, WXHWND control); - - // override wxControl version to not use solid background here - virtual WXHBRUSH MSWControlColor(WXHDC pDC, WXHWND hWnd); - - virtual WXDWORD MSWGetStyle(long style, WXDWORD *exstyle) const; - -protected: - virtual wxSize DoGetBestSize() const; - - int m_pageSize; - int m_viewSize; - int m_objectSize; - - DECLARE_DYNAMIC_CLASS_NO_COPY(wxScrollBar) -}; - -#endif - // _WX_SCROLBAR_H_ diff --git a/wxWidgets/include/wx/msw/seh.h b/wxWidgets/include/wx/msw/seh.h deleted file mode 100644 index 418df910e0..0000000000 --- a/wxWidgets/include/wx/msw/seh.h +++ /dev/null @@ -1,74 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: wx/msw/seh.h -// Purpose: declarations for SEH (structured exceptions handling) support -// Author: Vadim Zeitlin -// Created: 2006-04-26 -// RCS-ID: $Id: seh.h 44451 2007-02-11 02:17:28Z VZ $ -// Copyright: (c) 2006 Vadim Zeitlin <vadim@wxwindows.org> -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_MSW_SEH_H_ -#define _WX_MSW_SEH_H_ - -#if wxUSE_ON_FATAL_EXCEPTION - - // the exception handler which should be called from the exception filter - // - // it calsl wxApp::OnFatalException() if possible - extern unsigned long wxGlobalSEHandler(EXCEPTION_POINTERS *pExcPtrs); - - // helper macro for wxSEH_HANDLE -#if defined(__BORLANDC__) || (defined(__VISUALC__) && (__VISUALC__ <= 1200)) - // some compilers don't understand that this code is unreachable and warn - // about no value being returned from the function without it, so calm them - // down - #define wxSEH_DUMMY_RETURN(rc) return rc; -#else - #define wxSEH_DUMMY_RETURN(rc) -#endif - - // macros which allow to avoid many #if wxUSE_ON_FATAL_EXCEPTION in the code - // which uses them - #define wxSEH_TRY __try - #define wxSEH_IGNORE __except ( EXCEPTION_EXECUTE_HANDLER ) { } - #define wxSEH_HANDLE(rc) \ - __except ( wxGlobalSEHandler(GetExceptionInformation()) ) \ - { \ - /* use the same exit code as abort() */ \ - ::ExitProcess(3); \ - \ - wxSEH_DUMMY_RETURN(rc) \ - } - -#else // wxUSE_ON_FATAL_EXCEPTION - #define wxSEH_TRY - #define wxSEH_IGNORE - #define wxSEH_HANDLE(rc) -#endif // wxUSE_ON_FATAL_EXCEPTION - -#if wxUSE_ON_FATAL_EXCEPTION && defined(__VISUALC__) && !defined(__WXWINCE__) - #include <eh.h> - - // C++ exception to structured exceptions translator: we need it in order - // to prevent VC++ from "helpfully" translating structured exceptions (such - // as division by 0 or access violation) to C++ pseudo-exceptions - extern void wxSETranslator(unsigned int code, EXCEPTION_POINTERS *ep); - - // up to VC 7.1 this warning ("calling _set_se_translator() requires /EHa") - // is harmless and it's easier to suppress it than use different makefiles - // for VC5 and 6 (which don't support /EHa at all) and VC7 (which does - // accept it but it seems to change nothing for it anyhow) - #if __VISUALC__ <= 1310 - #pragma warning(disable: 4535) - #endif - - // note that the SE translator must be called wxSETranslator! - #define DisableAutomaticSETranslator() _set_se_translator(wxSETranslator) -#else // !__VISUALC__ - // the other compilers do nothing as stupid by default so nothing to do for - // them - #define DisableAutomaticSETranslator() -#endif // __VISUALC__/!__VISUALC__ - -#endif // _WX_MSW_SEH_H_ diff --git a/wxWidgets/include/wx/msw/setup.h b/wxWidgets/include/wx/msw/setup.h deleted file mode 100644 index 997f8580bf..0000000000 --- a/wxWidgets/include/wx/msw/setup.h +++ /dev/null @@ -1,1361 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/msw/setup.h -// Purpose: Configuration for the library -// Author: Julian Smart -// Modified by: -// Created: 01/02/97 -// RCS-ID: $Id: setup0.h 60190 2009-04-16 00:57:35Z KO $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_SETUP_H_ -#define _WX_SETUP_H_ - -/* --- start common options --- */ -// ---------------------------------------------------------------------------- -// 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.4 API: set it to 1 to -// enable it but please consider updating your code instead. -// -// Default is 0 -// -// Recommended setting: 0 (please update your code) -#define WXWIN_COMPATIBILITY_2_4 0 - -// This setting determines the compatibility with 2.6 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_6 1 - -// MSW-only: Set to 0 for accurate dialog units, else 1 for old behaviour when -// default system font is used for wxWindow::GetCharWidth/Height() instead of -// the current font. -// -// Default is 0 -// -// Recommended setting: 0 -#define wxDIALOG_UNIT_COMPATIBILITY 0 - -// ---------------------------------------------------------------------------- -// 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 wxWidgets 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 the normal memory operators. -// -// Default is 0 -// -// Recommended setting: 0 -#define wxUSE_DEBUG_CONTEXT 0 - -// 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 0 -// -// Recommended setting: 1 if you are not using a memory debugging tool, else 0 -#define wxUSE_MEMORY_TRACING 0 - -// 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 / CodeWarrior -// -// 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. -#define wxUSE_ON_FATAL_EXCEPTION 1 - -// Set this to 1 to be able to generate a human-readable (unlike -// machine-readable minidump created by wxCrashReport::Generate()) stack back -// trace when your program crashes using wxStackWalker -// -// Default is 1 if supported by the compiler. -// -// Recommended setting: 1, set to 0 if your programs never crash -#define wxUSE_STACKWALKER 1 - -// Set this to 1 to compile in wxDebugReport class which allows you to create -// and optionally upload to your web site a debug report consisting of back -// trace of the crash (if wxUSE_STACKWALKER == 1) and other information. -// -// Default is 1 if supported by the compiler. -// -// Recommended setting: 1, it is compiled into a separate library so there -// is no overhead if you don't use it -#define wxUSE_DEBUGREPORT 1 - -// ---------------------------------------------------------------------------- -// Unicode support -// ---------------------------------------------------------------------------- - -// Set wxUSE_UNICODE to 1 to compile wxWidgets 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/XP -// (Windows 9x doesn't support it and the programs compiled in Unicode mode -// will not run under 9x -- but see wxUSE_UNICODE_MSLU below). -// -// Default is 0 -// -// Recommended setting: 0 (unless you only plan to use Windows NT/2000/XP) -#ifndef wxUSE_UNICODE - #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. -// -// Note that like wxUSE_THREADS this option is automatically set to 0 if -// wxNO_EXCEPTIONS is defined. -// -// 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 - -// Set wxUSE_EXTENDED_RTTI to 1 to use extended RTTI -// -// Default is 0 -// -// Recommended setting: 0 (this is still work in progress...) -#define wxUSE_EXTENDED_RTTI 0 - -// Set wxUSE_STL to 1 to derive wxList(Foo) and wxArray(Foo) from -// std::list<Foo*> and std::vector<Foo*>, with a compatibility interface, -// and for wxHashMap to be implemented with templates. -// -// Default is 0 -// -// Recommended setting: YMMV -#define wxUSE_STL 0 - -// 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 -#define wxUSE_LOGWINDOW 1 - -// Recommended setting: 1 -#define wxUSE_LOGGUI 1 - -// Recommended setting: 1 -#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. -// -// Notice that if wxNO_THREADS is defined, wxUSE_THREADS is automatically reset -// to 0 in wx/chkconf.h, so, for example, if you set USE_THREADS to 0 in -// build/msw/config.* file this value will have no effect. -// -// Default is 1 -// -// Recommended setting: 0 unless you do plan to develop MT applications -#define wxUSE_THREADS 1 - -// If enabled, compiles wxWidgets streams classes -// -// wx stream classes are used for image IO, process IO redirection, network -// protocols implementation and much more and so disabling this results in a -// lot of other functionality being lost. -// -// Default is 1 -// -// Recommended setting: 1 as setting it to 0 disables many other things -#define wxUSE_STREAMS 1 - -// Use standard C++ streams if 1 instead of wx streams in some places. If -// disabled (default), wx streams are used everywhere and wxWidgets doesn't -// depend on the standard streams library. -// -// Notice that enabling this does not replace wx streams with std streams -// everywhere, in a lot of places wx streams are used no matter what. -// -// Default is 0 -// -// Recommended setting: 1 if you use the standard streams anyhow and so -// dependency on the standard streams library is not a -// problem -#define wxUSE_STD_IOSTREAM 0 - -// Enable conversion to standard C++ string if 1. -// -// Default is 1 for most compilers. -// -// Currently the Digital Mars and Watcom compilers come without standard C++ -// library headers by default, wxUSE_STD_STRING can be set to 1 if you do have -// them (e.g. from STLPort). -// -// VC++ 5.0 does include standard C++ library header, however they produce -// many warnings that can't be turned off when compiled at warning level 4. -#if defined(__DMC__) || defined(__WATCOMC__) \ - || (defined(_MSC_VER) && _MSC_VER < 1200) - #define wxUSE_STD_STRING 0 -#else - #define wxUSE_STD_STRING 1 -#endif - -// Support for positional parameters (e.g. %1$d, %2$s ...) in wxVsnprintf. -// Note that if the system's implementation does not support positional -// parameters, setting this to 1 forces the use of the wxWidgets implementation -// of wxVsnprintf. The standard vsnprintf() supports positional parameters on -// many Unix systems but usually doesn't under Windows. -// -// Positional parameters are very useful when translating a program since using -// them in formatting strings allow translators to correctly reorder the -// translated sentences. -// -// Default is 1 -// -// Recommended setting: 1 if you want to support multiple languages -#define wxUSE_PRINTF_POS_PARAMS 1 - -// ---------------------------------------------------------------------------- -// 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 wxFSVolume class providing access to the configured/active mount points -// -// Default is 1 -// -// Recommended setting: 1 (but may be safely disabled if you don't use it) -#define wxUSE_FSVOLUME 1 - -// Use wxStandardPaths class which allows to retrieve some standard locations -// in the file system -// -// Default is 1 -// -// Recommended setting: 1 (may be disabled to save space, but not much) -#define wxUSE_STDPATHS 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, don't use for now -#define wxUSE_DYNAMIC_LOADER 1 - -// 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 archive filesystem (requires wxUSE_FILESYSTEM) -#define wxUSE_FS_ARCHIVE 1 - -// Set to 1 to enable virtual Internet filesystem (requires wxUSE_FILESYSTEM) -#define wxUSE_FS_INET 1 - -// wxArchive classes for accessing archives such as zip and tar -#define wxUSE_ARCHIVE_STREAMS 1 - -// Set to 1 to compile wxZipInput/OutputStream classes. -#define wxUSE_ZIPSTREAM 1 - -// Set to 1 to compile wxTarInput/OutputStream classes. -#define wxUSE_TARSTREAM 1 - -// Set to 1 to compile wxZlibInput/OutputStream classes. Also required by -// wxUSE_LIBPNG -#define wxUSE_ZLIB 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 wxWidgets 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 - -// Define this to use native platform url and protocol support. -// Currently valid only for MS-Windows. -// Note: if you set this to 1, you can open ftp/http/gopher sites -// and obtain a valid input stream for these sites -// even when you set wxUSE_PROTOCOL_FTP/HTTP to 0. -// Doing so reduces the code size. -// -// This code is experimental and subject to change. -#define wxUSE_URL_NATIVE 0 - -// Support for wxVariant class used in several places throughout the library, -// notably in wxDataViewCtrl API. -// -// Default is 1. -// -// Recommended setting: 1 unless you want to reduce the library size as much as -// possible in which case setting this to 0 can gain up to 100KB. -#define wxUSE_VARIANT 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 - -// Use wxMediaCtrl -// -// Default is 1. -// -// Recommended setting: 1 -#define wxUSE_MEDIACTRL 1 - -// Use GStreamer for Unix (req a lot of dependancies) -// -// Default is 0 -// -// Recommended setting: 1 (wxMediaCtrl won't work by default without it) -#define wxUSE_GSTREAMER 0 - -// Use wxWidget's XRC XML-based resource system. Recommended. -// -// Default is 1 -// -// Recommended setting: 1 (requires wxUSE_XML) -#define wxUSE_XRC 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 the same as wxUSE_XRC, i.e. 1 by default. -// -// Recommended setting: 1 (required by XRC) -#define wxUSE_XML wxUSE_XRC - -// Use wxWidget's AUI docking system -// -// Default is 1 -// -// Recommended setting: 1 -#define wxUSE_AUI 1 - - -// Enable the new wxGraphicsPath and wxGraphicsContext classes for an advanced -// 2D drawing API. (Still somewhat experimental) -// -// Please note that on Windows you will need to link with gdiplus.lib (use -// USE_GDIPLUS=1 for makefile builds) and distribute gdiplus.dll with your -// application if you want it to be runnable on pre-XP systems. -// -// Default is 0 -// -// Recommended setting: 1 -#ifndef wxUSE_GRAPHICS_CONTEXT -#define wxUSE_GRAPHICS_CONTEXT 0 -#endif - -// Enable the new wxCairoContext classes for an advanced -// 2D drawing API. (Still somewhat experimental) -// -// Please note that you will need to link with Cairo for this to work. -// -// Default is 0 -// -// Recommended setting: 1 -#ifndef wxUSE_CAIRO -#define wxUSE_CAIRO 0 -#endif - -// ---------------------------------------------------------------------------- -// 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 -// -// Default is 1 -// -// Recommended setting: 1 (may be set to 0 if you don't wxUSE_TIPWINDOW) -#define wxUSE_POPUPWIN 1 - -// wxTipWindow allows to implement the custom tooltips, it is used by the -// context help classes. Requires wxUSE_POPUPWIN. -// -// Default is 1 -// -// Recommended setting: 1 (may be set to 0) -#define wxUSE_TIPWINDOW 1 - -// Each of the settings below corresponds to one wxWidgets 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_ANIMATIONCTRL 1 // wxAnimationCtrl -#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_COLLPANE 1 // wxCollapsiblePane -#define wxUSE_COLOURPICKERCTRL 1 // wxColourPickerCtrl -#define wxUSE_COMBOBOX 1 // wxComboBox -#define wxUSE_DATAVIEWCTRL 1 // wxDataViewCtrl -#define wxUSE_DATEPICKCTRL 1 // wxDatePickerCtrl -#define wxUSE_DIRPICKERCTRL 1 // wxDirPickerCtrl -#define wxUSE_FILEPICKERCTRL 1 // wxFilePickerCtrl -#define wxUSE_FONTPICKERCTRL 1 // wxFontPickerCtrl -#define wxUSE_GAUGE 1 // wxGauge -#define wxUSE_HYPERLINKCTRL 1 // wxHyperlinkCtrl -#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_SEARCHCTRL 1 // wxSearchCtrl -#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 for the platforms where native status bar is supported. -// -// 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 - -// wxNotebook is a control with several "tabs" located on one of its sides. It -// may be used to 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 - -// wxChoicebook control is similar to wxNotebook but uses wxChoice instead of -// the tabs -// -// Default is 1. -// -// Recommended setting: 1 -#define wxUSE_CHOICEBOOK 1 - -// wxTreebook control is similar to wxNotebook but uses wxTreeCtrl instead of -// the tabs -// -// Default is 1. -// -// Recommended setting: 1 -#define wxUSE_TREEBOOK 1 - -// wxToolbook control is similar to wxNotebook but uses wxToolBar instead of -// tabs -// -// Default is 1. -// -// Recommended setting: 1 -#define wxUSE_TOOLBOOK 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, set to 0 to cut down compilation time and binaries size if you -// don't use it. -// -// Recommended setting: 1 -// -#define wxUSE_GRID 1 - -// wxMiniFrame class: a frame with narrow title bar -// -// Default is 1. -// -// Recommended setting: 1 (it doesn't cost almost anything) -#define wxUSE_MINIFRAME 1 - -// wxComboCtrl and related classes: combobox with custom popup window and -// not necessarily a listbox. -// -// Default is 1. -// -// Recommended setting: 1 but can be safely set to 0 except for wxUniv where it -// it used by wxComboBox -#define wxUSE_COMBOCTRL 1 - -// wxOwnerDrawnComboBox is a custom combobox allowing to paint the combobox -// items. -// -// Default is 1. -// -// Recommended setting: 1 but can be safely set to 0, except where it is -// needed as a base class for generic wxBitmapComboBox. -#define wxUSE_ODCOMBOBOX 1 - -// wxBitmapComboBox is a combobox that can have images in front of text items. -// -// Default is 1. -// -// Recommended setting: 1 but can be safely set to 0 -#define wxUSE_BITMAPCOMBOBOX 1 - -// ---------------------------------------------------------------------------- -// Miscellaneous GUI stuff -// ---------------------------------------------------------------------------- - -// wxAcceleratorTable/Entry classes and support for them in wxMenu(Bar) -#define wxUSE_ACCEL 1 - -// Hotkey support (currently Windows only) -#define wxUSE_HOTKEY 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 -// their geometries as well as finding the display on which the given point or -// window lies. -// -// Default is 1. -// -// Recommended setting: 1 if you need it, can be safely set to 0 otherwise -#define wxUSE_DISPLAY 1 - -// 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 - -// ---------------------------------------------------------------------------- -// 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 - -// Compile in wxAboutBox() function showing the standard "About" dialog. -// -// Default is 1 -// -// Recommended setting: 1 but can be set to 0 to save some space if you don't -// use this function -#define wxUSE_ABOUTDLG 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 MDI support. -// -// Requires wxUSE_NOTEBOOK under platforms other than MSW. -// -// Default is 1. -// -// Recommended setting: 1, can be safely set to 0. -#define wxUSE_MDI 1 - -// Set to 0 to disable document/view architecture -#define wxUSE_DOC_VIEW_ARCHITECTURE 1 - -// Set to 0 to disable MDI document/view architecture -// -// Requires wxUSE_MDI && wxUSE_DOC_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 - -// Setting wxUSE_GLCANVAS to 1 enables OpenGL support. You need to have OpenGL -// headers and libraries to be able to compile the library with wxUSE_GLCANVAS -// set to 1. Note that for some compilers (notably Microsoft Visual C++) you -// will need to manually add opengl32.lib and glu32.lib to the list of -// libraries linked with your program if you use OpenGL. -// -// Default is 0. -// -// Recommended setting: 1 if you intend to use OpenGL, 0 otherwise -#define wxUSE_GLCANVAS 1 - -// wxRichTextCtrl allows editing of styled text. -// -// Default is 1. -// -// Recommended setting: 1, set to 0 if you want compile a -// smaller library. -#define wxUSE_RICHTEXT 1 - -// ---------------------------------------------------------------------------- -// 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 - -// Use wxAccessible for enhanced and customisable accessibility. -// Depends on wxUSE_OLE. -// -// Default is 0. -// -// Recommended setting (at present): 0 -#define wxUSE_ACCESSIBILITY 0 - -// ---------------------------------------------------------------------------- -// miscellaneous settings -// ---------------------------------------------------------------------------- - -// wxSingleInstanceChecker class allows to verify at startup if another program -// instance is running. -// -// 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 1 - // 0 for no interprocess comms -#define wxUSE_HELP 1 - // 0 for no help facility - -// Should we use MS HTML help for wxHelpController? If disabled, neither -// wxCHMHelpController nor wxBestHelpController are available. -// -// Default is 1 under MSW, 0 is always used for the other platforms. -// -// Recommended setting: 1, only set to 0 if you have trouble compiling -// wxCHMHelpController (could be a problem with really ancient compilers) -#define wxUSE_MS_HTML_HELP 1 - - -// Use wxHTML-based help controller? -#define wxUSE_WXHTML_HELP 1 - -#define wxUSE_RESOURCES 0 - // 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 1 - -// ---------------------------------------------------------------------------- -// 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 compatibility 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 <iostream> and <iostream.h> but you can't mix -// them. Set to 1 for <iostream.h>, 0 for <iostream>. Note that VC++ 7.1 -// and later doesn't support wxUSE_IOSTREAMH == 1 and so <iostream> will be -// used anyhow. -// -// Default is 1. -// -// Recommended setting: whatever your compiler likes more -#define wxUSE_IOSTREAMH 1 - -// ---------------------------------------------------------------------------- -// 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 TGA format support (loading only) -#define wxUSE_TGA 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 (Amiga format) -#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 - -// ---------------------------------------------------------------------------- -// wxUniversal-only options -// ---------------------------------------------------------------------------- - -// Set to 1 to enable compilation of all themes, this is the default -#define wxUSE_ALL_THEMES 1 - -// Set to 1 to enable the compilation of individual theme if wxUSE_ALL_THEMES -// is unset, if it is set these options are not used; notice that metal theme -// uses Win32 one -#define wxUSE_THEME_GTK 0 -#define wxUSE_THEME_METAL 0 -#define wxUSE_THEME_MONO 0 -#define wxUSE_THEME_WIN32 0 - - -/* --- end common options --- */ - -// ---------------------------------------------------------------------------- -// Windows-only settings -// ---------------------------------------------------------------------------- - -// Set wxUSE_UNICODE_MSLU to 1 if you're compiling wxWidgets in Unicode mode -// and want to run your programs under Windows 9x and not only NT/2000/XP. -// This setting enables use of unicows.dll from MSLU (MS Layer for Unicode, see -// http://www.microsoft.com/globaldev/handson/dev/mslu_announce.mspx). Note -// that you will have to modify the makefiles to include unicows.lib import -// library as the first library (see installation instructions in install.txt -// to learn how to do it when building the library or samples). -// -// If your compiler doesn't have unicows.lib, you can get a version of it at -// http://libunicows.sourceforge.net -// -// Default is 0 -// -// Recommended setting: 0 (1 if you want to deploy Unicode apps on 9x systems) -#ifndef wxUSE_UNICODE_MSLU - #define wxUSE_UNICODE_MSLU 0 -#endif - -// Set this to 1 if you want to use wxWidgets and MFC in the same program. This -// will override some other settings (see below) -// -// Default is 0. -// -// Recommended setting: 0 unless you really have to use MFC -#define wxUSE_MFC 0 - -// Set this to 1 for generic OLE support: this is required for drag-and-drop, -// clipboard, OLE Automation. Only set it to 0 if your compiler is very old and -// can't compile/doesn't have the OLE headers. -// -// Default is 1. -// -// Recommended setting: 1 -#define wxUSE_OLE 1 - -// Set this to 1 to enable wxAutomationObject class. -// -// Default is 1. -// -// Recommended setting: 1 if you need to control other applications via OLE -// Automation, can be safely set to 0 otherwise -#define wxUSE_OLE_AUTOMATION 1 - -// Set this to 1 to enable wxActiveXContainer class allowing to embed OLE -// controls in wx. -// -// Default is 1. -// -// Recommended setting: 1, required by wxMediaCtrl -#define wxUSE_ACTIVEX 1 - -// wxDC cacheing implementation -#define wxUSE_DC_CACHEING 1 - -// Set this to 1 to enable the use of DIB's for wxBitmap to support -// bitmaps > 16MB on Win95/98/Me. Set to 0 to use DDB's only. -#define wxUSE_DIB_FOR_BITMAP 0 - -// Set this to 1 to enable wxDIB class used internally for manipulating -// wxBitmao data. -// -// Default is 1, set it to 0 only if you don't use wxImage neither -// -// Recommended setting: 1 (without it conversion to/from wxImage won't work) -#define wxUSE_WXDIB 1 - -// Set to 0 to disable PostScript print/preview architecture code under Windows -// (just use Windows printing). -#define wxUSE_POSTSCRIPT_ARCHITECTURE_IN_MSW 1 - -// Set this to 1 to use RICHEDIT controls for wxTextCtrl with style wxTE_RICH -// which allows to put more than ~32Kb of text in it even under Win9x (NT -// doesn't have such limitation). -// -// Default is 1 for compilers which support it -// -// Recommended setting: 1, only set it to 0 if your compiler doesn't have -// or can't compile <richedit.h> -#define wxUSE_RICHEDIT 1 - -// Set this to 1 to use extra features of richedit v2 and later controls -// -// Default is 1 for compilers which support it -// -// Recommended setting: 1 -#define wxUSE_RICHEDIT2 1 - -// Set this to 1 to enable support for the owner-drawn menu and listboxes. This -// is required by wxUSE_CHECKLISTBOX. -// -// Default is 1. -// -// Recommended setting: 1, set to 0 for a small library size reduction -#define wxUSE_OWNER_DRAWN 1 - -// Set to 1 to compile MS Windows XP theme engine support -#define wxUSE_UXTHEME 1 - -// Set to 1 to auto-adapt to MS Windows XP themes where possible -// (notably, wxNotebook pages) -#define wxUSE_UXTHEME_AUTO 1 - -// Set to 1 to use InkEdit control (Tablet PC), if available -#define wxUSE_INKEDIT 0 - -// ---------------------------------------------------------------------------- -// Generic versions of native controls -// ---------------------------------------------------------------------------- - -// Set this to 1 to be able to use wxDatePickerCtrlGeneric in addition to the -// native wxDatePickerCtrl -// -// Default is 0. -// -// Recommended setting: 0, this is mainly used for testing -#define wxUSE_DATEPICKCTRL_GENERIC 0 - -// ---------------------------------------------------------------------------- -// Crash debugging helpers -// ---------------------------------------------------------------------------- - -// Set this to 1 to be able to use wxCrashReport::Generate() to create mini -// dumps of your program when it crashes (or at any other moment) -// -// Default is 1 if supported by the compiler (VC++ and recent BC++ only). -// -// Recommended setting: 1, set to 0 if your programs never crash -#define wxUSE_CRASHREPORT 1 - -// ---------------------------------------------------------------------------- -// obsolete settings -// ---------------------------------------------------------------------------- - -// NB: all settings in this section are obsolete and should not be used/changed -// at all, they will disappear - -// Define 1 to use bitmap messages. -#define wxUSE_BITMAP_MESSAGE 1 - -#endif // _WX_SETUP_H_ - diff --git a/wxWidgets/include/wx/msw/setup0.h b/wxWidgets/include/wx/msw/setup0.h deleted file mode 100644 index 997f8580bf..0000000000 --- a/wxWidgets/include/wx/msw/setup0.h +++ /dev/null @@ -1,1361 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/msw/setup.h -// Purpose: Configuration for the library -// Author: Julian Smart -// Modified by: -// Created: 01/02/97 -// RCS-ID: $Id: setup0.h 60190 2009-04-16 00:57:35Z KO $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_SETUP_H_ -#define _WX_SETUP_H_ - -/* --- start common options --- */ -// ---------------------------------------------------------------------------- -// 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.4 API: set it to 1 to -// enable it but please consider updating your code instead. -// -// Default is 0 -// -// Recommended setting: 0 (please update your code) -#define WXWIN_COMPATIBILITY_2_4 0 - -// This setting determines the compatibility with 2.6 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_6 1 - -// MSW-only: Set to 0 for accurate dialog units, else 1 for old behaviour when -// default system font is used for wxWindow::GetCharWidth/Height() instead of -// the current font. -// -// Default is 0 -// -// Recommended setting: 0 -#define wxDIALOG_UNIT_COMPATIBILITY 0 - -// ---------------------------------------------------------------------------- -// 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 wxWidgets 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 the normal memory operators. -// -// Default is 0 -// -// Recommended setting: 0 -#define wxUSE_DEBUG_CONTEXT 0 - -// 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 0 -// -// Recommended setting: 1 if you are not using a memory debugging tool, else 0 -#define wxUSE_MEMORY_TRACING 0 - -// 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 / CodeWarrior -// -// 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. -#define wxUSE_ON_FATAL_EXCEPTION 1 - -// Set this to 1 to be able to generate a human-readable (unlike -// machine-readable minidump created by wxCrashReport::Generate()) stack back -// trace when your program crashes using wxStackWalker -// -// Default is 1 if supported by the compiler. -// -// Recommended setting: 1, set to 0 if your programs never crash -#define wxUSE_STACKWALKER 1 - -// Set this to 1 to compile in wxDebugReport class which allows you to create -// and optionally upload to your web site a debug report consisting of back -// trace of the crash (if wxUSE_STACKWALKER == 1) and other information. -// -// Default is 1 if supported by the compiler. -// -// Recommended setting: 1, it is compiled into a separate library so there -// is no overhead if you don't use it -#define wxUSE_DEBUGREPORT 1 - -// ---------------------------------------------------------------------------- -// Unicode support -// ---------------------------------------------------------------------------- - -// Set wxUSE_UNICODE to 1 to compile wxWidgets 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/XP -// (Windows 9x doesn't support it and the programs compiled in Unicode mode -// will not run under 9x -- but see wxUSE_UNICODE_MSLU below). -// -// Default is 0 -// -// Recommended setting: 0 (unless you only plan to use Windows NT/2000/XP) -#ifndef wxUSE_UNICODE - #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. -// -// Note that like wxUSE_THREADS this option is automatically set to 0 if -// wxNO_EXCEPTIONS is defined. -// -// 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 - -// Set wxUSE_EXTENDED_RTTI to 1 to use extended RTTI -// -// Default is 0 -// -// Recommended setting: 0 (this is still work in progress...) -#define wxUSE_EXTENDED_RTTI 0 - -// Set wxUSE_STL to 1 to derive wxList(Foo) and wxArray(Foo) from -// std::list<Foo*> and std::vector<Foo*>, with a compatibility interface, -// and for wxHashMap to be implemented with templates. -// -// Default is 0 -// -// Recommended setting: YMMV -#define wxUSE_STL 0 - -// 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 -#define wxUSE_LOGWINDOW 1 - -// Recommended setting: 1 -#define wxUSE_LOGGUI 1 - -// Recommended setting: 1 -#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. -// -// Notice that if wxNO_THREADS is defined, wxUSE_THREADS is automatically reset -// to 0 in wx/chkconf.h, so, for example, if you set USE_THREADS to 0 in -// build/msw/config.* file this value will have no effect. -// -// Default is 1 -// -// Recommended setting: 0 unless you do plan to develop MT applications -#define wxUSE_THREADS 1 - -// If enabled, compiles wxWidgets streams classes -// -// wx stream classes are used for image IO, process IO redirection, network -// protocols implementation and much more and so disabling this results in a -// lot of other functionality being lost. -// -// Default is 1 -// -// Recommended setting: 1 as setting it to 0 disables many other things -#define wxUSE_STREAMS 1 - -// Use standard C++ streams if 1 instead of wx streams in some places. If -// disabled (default), wx streams are used everywhere and wxWidgets doesn't -// depend on the standard streams library. -// -// Notice that enabling this does not replace wx streams with std streams -// everywhere, in a lot of places wx streams are used no matter what. -// -// Default is 0 -// -// Recommended setting: 1 if you use the standard streams anyhow and so -// dependency on the standard streams library is not a -// problem -#define wxUSE_STD_IOSTREAM 0 - -// Enable conversion to standard C++ string if 1. -// -// Default is 1 for most compilers. -// -// Currently the Digital Mars and Watcom compilers come without standard C++ -// library headers by default, wxUSE_STD_STRING can be set to 1 if you do have -// them (e.g. from STLPort). -// -// VC++ 5.0 does include standard C++ library header, however they produce -// many warnings that can't be turned off when compiled at warning level 4. -#if defined(__DMC__) || defined(__WATCOMC__) \ - || (defined(_MSC_VER) && _MSC_VER < 1200) - #define wxUSE_STD_STRING 0 -#else - #define wxUSE_STD_STRING 1 -#endif - -// Support for positional parameters (e.g. %1$d, %2$s ...) in wxVsnprintf. -// Note that if the system's implementation does not support positional -// parameters, setting this to 1 forces the use of the wxWidgets implementation -// of wxVsnprintf. The standard vsnprintf() supports positional parameters on -// many Unix systems but usually doesn't under Windows. -// -// Positional parameters are very useful when translating a program since using -// them in formatting strings allow translators to correctly reorder the -// translated sentences. -// -// Default is 1 -// -// Recommended setting: 1 if you want to support multiple languages -#define wxUSE_PRINTF_POS_PARAMS 1 - -// ---------------------------------------------------------------------------- -// 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 wxFSVolume class providing access to the configured/active mount points -// -// Default is 1 -// -// Recommended setting: 1 (but may be safely disabled if you don't use it) -#define wxUSE_FSVOLUME 1 - -// Use wxStandardPaths class which allows to retrieve some standard locations -// in the file system -// -// Default is 1 -// -// Recommended setting: 1 (may be disabled to save space, but not much) -#define wxUSE_STDPATHS 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, don't use for now -#define wxUSE_DYNAMIC_LOADER 1 - -// 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 archive filesystem (requires wxUSE_FILESYSTEM) -#define wxUSE_FS_ARCHIVE 1 - -// Set to 1 to enable virtual Internet filesystem (requires wxUSE_FILESYSTEM) -#define wxUSE_FS_INET 1 - -// wxArchive classes for accessing archives such as zip and tar -#define wxUSE_ARCHIVE_STREAMS 1 - -// Set to 1 to compile wxZipInput/OutputStream classes. -#define wxUSE_ZIPSTREAM 1 - -// Set to 1 to compile wxTarInput/OutputStream classes. -#define wxUSE_TARSTREAM 1 - -// Set to 1 to compile wxZlibInput/OutputStream classes. Also required by -// wxUSE_LIBPNG -#define wxUSE_ZLIB 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 wxWidgets 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 - -// Define this to use native platform url and protocol support. -// Currently valid only for MS-Windows. -// Note: if you set this to 1, you can open ftp/http/gopher sites -// and obtain a valid input stream for these sites -// even when you set wxUSE_PROTOCOL_FTP/HTTP to 0. -// Doing so reduces the code size. -// -// This code is experimental and subject to change. -#define wxUSE_URL_NATIVE 0 - -// Support for wxVariant class used in several places throughout the library, -// notably in wxDataViewCtrl API. -// -// Default is 1. -// -// Recommended setting: 1 unless you want to reduce the library size as much as -// possible in which case setting this to 0 can gain up to 100KB. -#define wxUSE_VARIANT 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 - -// Use wxMediaCtrl -// -// Default is 1. -// -// Recommended setting: 1 -#define wxUSE_MEDIACTRL 1 - -// Use GStreamer for Unix (req a lot of dependancies) -// -// Default is 0 -// -// Recommended setting: 1 (wxMediaCtrl won't work by default without it) -#define wxUSE_GSTREAMER 0 - -// Use wxWidget's XRC XML-based resource system. Recommended. -// -// Default is 1 -// -// Recommended setting: 1 (requires wxUSE_XML) -#define wxUSE_XRC 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 the same as wxUSE_XRC, i.e. 1 by default. -// -// Recommended setting: 1 (required by XRC) -#define wxUSE_XML wxUSE_XRC - -// Use wxWidget's AUI docking system -// -// Default is 1 -// -// Recommended setting: 1 -#define wxUSE_AUI 1 - - -// Enable the new wxGraphicsPath and wxGraphicsContext classes for an advanced -// 2D drawing API. (Still somewhat experimental) -// -// Please note that on Windows you will need to link with gdiplus.lib (use -// USE_GDIPLUS=1 for makefile builds) and distribute gdiplus.dll with your -// application if you want it to be runnable on pre-XP systems. -// -// Default is 0 -// -// Recommended setting: 1 -#ifndef wxUSE_GRAPHICS_CONTEXT -#define wxUSE_GRAPHICS_CONTEXT 0 -#endif - -// Enable the new wxCairoContext classes for an advanced -// 2D drawing API. (Still somewhat experimental) -// -// Please note that you will need to link with Cairo for this to work. -// -// Default is 0 -// -// Recommended setting: 1 -#ifndef wxUSE_CAIRO -#define wxUSE_CAIRO 0 -#endif - -// ---------------------------------------------------------------------------- -// 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 -// -// Default is 1 -// -// Recommended setting: 1 (may be set to 0 if you don't wxUSE_TIPWINDOW) -#define wxUSE_POPUPWIN 1 - -// wxTipWindow allows to implement the custom tooltips, it is used by the -// context help classes. Requires wxUSE_POPUPWIN. -// -// Default is 1 -// -// Recommended setting: 1 (may be set to 0) -#define wxUSE_TIPWINDOW 1 - -// Each of the settings below corresponds to one wxWidgets 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_ANIMATIONCTRL 1 // wxAnimationCtrl -#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_COLLPANE 1 // wxCollapsiblePane -#define wxUSE_COLOURPICKERCTRL 1 // wxColourPickerCtrl -#define wxUSE_COMBOBOX 1 // wxComboBox -#define wxUSE_DATAVIEWCTRL 1 // wxDataViewCtrl -#define wxUSE_DATEPICKCTRL 1 // wxDatePickerCtrl -#define wxUSE_DIRPICKERCTRL 1 // wxDirPickerCtrl -#define wxUSE_FILEPICKERCTRL 1 // wxFilePickerCtrl -#define wxUSE_FONTPICKERCTRL 1 // wxFontPickerCtrl -#define wxUSE_GAUGE 1 // wxGauge -#define wxUSE_HYPERLINKCTRL 1 // wxHyperlinkCtrl -#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_SEARCHCTRL 1 // wxSearchCtrl -#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 for the platforms where native status bar is supported. -// -// 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 - -// wxNotebook is a control with several "tabs" located on one of its sides. It -// may be used to 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 - -// wxChoicebook control is similar to wxNotebook but uses wxChoice instead of -// the tabs -// -// Default is 1. -// -// Recommended setting: 1 -#define wxUSE_CHOICEBOOK 1 - -// wxTreebook control is similar to wxNotebook but uses wxTreeCtrl instead of -// the tabs -// -// Default is 1. -// -// Recommended setting: 1 -#define wxUSE_TREEBOOK 1 - -// wxToolbook control is similar to wxNotebook but uses wxToolBar instead of -// tabs -// -// Default is 1. -// -// Recommended setting: 1 -#define wxUSE_TOOLBOOK 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, set to 0 to cut down compilation time and binaries size if you -// don't use it. -// -// Recommended setting: 1 -// -#define wxUSE_GRID 1 - -// wxMiniFrame class: a frame with narrow title bar -// -// Default is 1. -// -// Recommended setting: 1 (it doesn't cost almost anything) -#define wxUSE_MINIFRAME 1 - -// wxComboCtrl and related classes: combobox with custom popup window and -// not necessarily a listbox. -// -// Default is 1. -// -// Recommended setting: 1 but can be safely set to 0 except for wxUniv where it -// it used by wxComboBox -#define wxUSE_COMBOCTRL 1 - -// wxOwnerDrawnComboBox is a custom combobox allowing to paint the combobox -// items. -// -// Default is 1. -// -// Recommended setting: 1 but can be safely set to 0, except where it is -// needed as a base class for generic wxBitmapComboBox. -#define wxUSE_ODCOMBOBOX 1 - -// wxBitmapComboBox is a combobox that can have images in front of text items. -// -// Default is 1. -// -// Recommended setting: 1 but can be safely set to 0 -#define wxUSE_BITMAPCOMBOBOX 1 - -// ---------------------------------------------------------------------------- -// Miscellaneous GUI stuff -// ---------------------------------------------------------------------------- - -// wxAcceleratorTable/Entry classes and support for them in wxMenu(Bar) -#define wxUSE_ACCEL 1 - -// Hotkey support (currently Windows only) -#define wxUSE_HOTKEY 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 -// their geometries as well as finding the display on which the given point or -// window lies. -// -// Default is 1. -// -// Recommended setting: 1 if you need it, can be safely set to 0 otherwise -#define wxUSE_DISPLAY 1 - -// 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 - -// ---------------------------------------------------------------------------- -// 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 - -// Compile in wxAboutBox() function showing the standard "About" dialog. -// -// Default is 1 -// -// Recommended setting: 1 but can be set to 0 to save some space if you don't -// use this function -#define wxUSE_ABOUTDLG 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 MDI support. -// -// Requires wxUSE_NOTEBOOK under platforms other than MSW. -// -// Default is 1. -// -// Recommended setting: 1, can be safely set to 0. -#define wxUSE_MDI 1 - -// Set to 0 to disable document/view architecture -#define wxUSE_DOC_VIEW_ARCHITECTURE 1 - -// Set to 0 to disable MDI document/view architecture -// -// Requires wxUSE_MDI && wxUSE_DOC_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 - -// Setting wxUSE_GLCANVAS to 1 enables OpenGL support. You need to have OpenGL -// headers and libraries to be able to compile the library with wxUSE_GLCANVAS -// set to 1. Note that for some compilers (notably Microsoft Visual C++) you -// will need to manually add opengl32.lib and glu32.lib to the list of -// libraries linked with your program if you use OpenGL. -// -// Default is 0. -// -// Recommended setting: 1 if you intend to use OpenGL, 0 otherwise -#define wxUSE_GLCANVAS 1 - -// wxRichTextCtrl allows editing of styled text. -// -// Default is 1. -// -// Recommended setting: 1, set to 0 if you want compile a -// smaller library. -#define wxUSE_RICHTEXT 1 - -// ---------------------------------------------------------------------------- -// 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 - -// Use wxAccessible for enhanced and customisable accessibility. -// Depends on wxUSE_OLE. -// -// Default is 0. -// -// Recommended setting (at present): 0 -#define wxUSE_ACCESSIBILITY 0 - -// ---------------------------------------------------------------------------- -// miscellaneous settings -// ---------------------------------------------------------------------------- - -// wxSingleInstanceChecker class allows to verify at startup if another program -// instance is running. -// -// 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 1 - // 0 for no interprocess comms -#define wxUSE_HELP 1 - // 0 for no help facility - -// Should we use MS HTML help for wxHelpController? If disabled, neither -// wxCHMHelpController nor wxBestHelpController are available. -// -// Default is 1 under MSW, 0 is always used for the other platforms. -// -// Recommended setting: 1, only set to 0 if you have trouble compiling -// wxCHMHelpController (could be a problem with really ancient compilers) -#define wxUSE_MS_HTML_HELP 1 - - -// Use wxHTML-based help controller? -#define wxUSE_WXHTML_HELP 1 - -#define wxUSE_RESOURCES 0 - // 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 1 - -// ---------------------------------------------------------------------------- -// 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 compatibility 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 <iostream> and <iostream.h> but you can't mix -// them. Set to 1 for <iostream.h>, 0 for <iostream>. Note that VC++ 7.1 -// and later doesn't support wxUSE_IOSTREAMH == 1 and so <iostream> will be -// used anyhow. -// -// Default is 1. -// -// Recommended setting: whatever your compiler likes more -#define wxUSE_IOSTREAMH 1 - -// ---------------------------------------------------------------------------- -// 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 TGA format support (loading only) -#define wxUSE_TGA 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 (Amiga format) -#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 - -// ---------------------------------------------------------------------------- -// wxUniversal-only options -// ---------------------------------------------------------------------------- - -// Set to 1 to enable compilation of all themes, this is the default -#define wxUSE_ALL_THEMES 1 - -// Set to 1 to enable the compilation of individual theme if wxUSE_ALL_THEMES -// is unset, if it is set these options are not used; notice that metal theme -// uses Win32 one -#define wxUSE_THEME_GTK 0 -#define wxUSE_THEME_METAL 0 -#define wxUSE_THEME_MONO 0 -#define wxUSE_THEME_WIN32 0 - - -/* --- end common options --- */ - -// ---------------------------------------------------------------------------- -// Windows-only settings -// ---------------------------------------------------------------------------- - -// Set wxUSE_UNICODE_MSLU to 1 if you're compiling wxWidgets in Unicode mode -// and want to run your programs under Windows 9x and not only NT/2000/XP. -// This setting enables use of unicows.dll from MSLU (MS Layer for Unicode, see -// http://www.microsoft.com/globaldev/handson/dev/mslu_announce.mspx). Note -// that you will have to modify the makefiles to include unicows.lib import -// library as the first library (see installation instructions in install.txt -// to learn how to do it when building the library or samples). -// -// If your compiler doesn't have unicows.lib, you can get a version of it at -// http://libunicows.sourceforge.net -// -// Default is 0 -// -// Recommended setting: 0 (1 if you want to deploy Unicode apps on 9x systems) -#ifndef wxUSE_UNICODE_MSLU - #define wxUSE_UNICODE_MSLU 0 -#endif - -// Set this to 1 if you want to use wxWidgets and MFC in the same program. This -// will override some other settings (see below) -// -// Default is 0. -// -// Recommended setting: 0 unless you really have to use MFC -#define wxUSE_MFC 0 - -// Set this to 1 for generic OLE support: this is required for drag-and-drop, -// clipboard, OLE Automation. Only set it to 0 if your compiler is very old and -// can't compile/doesn't have the OLE headers. -// -// Default is 1. -// -// Recommended setting: 1 -#define wxUSE_OLE 1 - -// Set this to 1 to enable wxAutomationObject class. -// -// Default is 1. -// -// Recommended setting: 1 if you need to control other applications via OLE -// Automation, can be safely set to 0 otherwise -#define wxUSE_OLE_AUTOMATION 1 - -// Set this to 1 to enable wxActiveXContainer class allowing to embed OLE -// controls in wx. -// -// Default is 1. -// -// Recommended setting: 1, required by wxMediaCtrl -#define wxUSE_ACTIVEX 1 - -// wxDC cacheing implementation -#define wxUSE_DC_CACHEING 1 - -// Set this to 1 to enable the use of DIB's for wxBitmap to support -// bitmaps > 16MB on Win95/98/Me. Set to 0 to use DDB's only. -#define wxUSE_DIB_FOR_BITMAP 0 - -// Set this to 1 to enable wxDIB class used internally for manipulating -// wxBitmao data. -// -// Default is 1, set it to 0 only if you don't use wxImage neither -// -// Recommended setting: 1 (without it conversion to/from wxImage won't work) -#define wxUSE_WXDIB 1 - -// Set to 0 to disable PostScript print/preview architecture code under Windows -// (just use Windows printing). -#define wxUSE_POSTSCRIPT_ARCHITECTURE_IN_MSW 1 - -// Set this to 1 to use RICHEDIT controls for wxTextCtrl with style wxTE_RICH -// which allows to put more than ~32Kb of text in it even under Win9x (NT -// doesn't have such limitation). -// -// Default is 1 for compilers which support it -// -// Recommended setting: 1, only set it to 0 if your compiler doesn't have -// or can't compile <richedit.h> -#define wxUSE_RICHEDIT 1 - -// Set this to 1 to use extra features of richedit v2 and later controls -// -// Default is 1 for compilers which support it -// -// Recommended setting: 1 -#define wxUSE_RICHEDIT2 1 - -// Set this to 1 to enable support for the owner-drawn menu and listboxes. This -// is required by wxUSE_CHECKLISTBOX. -// -// Default is 1. -// -// Recommended setting: 1, set to 0 for a small library size reduction -#define wxUSE_OWNER_DRAWN 1 - -// Set to 1 to compile MS Windows XP theme engine support -#define wxUSE_UXTHEME 1 - -// Set to 1 to auto-adapt to MS Windows XP themes where possible -// (notably, wxNotebook pages) -#define wxUSE_UXTHEME_AUTO 1 - -// Set to 1 to use InkEdit control (Tablet PC), if available -#define wxUSE_INKEDIT 0 - -// ---------------------------------------------------------------------------- -// Generic versions of native controls -// ---------------------------------------------------------------------------- - -// Set this to 1 to be able to use wxDatePickerCtrlGeneric in addition to the -// native wxDatePickerCtrl -// -// Default is 0. -// -// Recommended setting: 0, this is mainly used for testing -#define wxUSE_DATEPICKCTRL_GENERIC 0 - -// ---------------------------------------------------------------------------- -// Crash debugging helpers -// ---------------------------------------------------------------------------- - -// Set this to 1 to be able to use wxCrashReport::Generate() to create mini -// dumps of your program when it crashes (or at any other moment) -// -// Default is 1 if supported by the compiler (VC++ and recent BC++ only). -// -// Recommended setting: 1, set to 0 if your programs never crash -#define wxUSE_CRASHREPORT 1 - -// ---------------------------------------------------------------------------- -// obsolete settings -// ---------------------------------------------------------------------------- - -// NB: all settings in this section are obsolete and should not be used/changed -// at all, they will disappear - -// Define 1 to use bitmap messages. -#define wxUSE_BITMAP_MESSAGE 1 - -#endif // _WX_SETUP_H_ - diff --git a/wxWidgets/include/wx/msw/setup_microwin.h b/wxWidgets/include/wx/msw/setup_microwin.h deleted file mode 100644 index eff9b63cfe..0000000000 --- a/wxWidgets/include/wx/msw/setup_microwin.h +++ /dev/null @@ -1,1179 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/msw/setup.h -// Purpose: Configuration for the library -// Author: Julian Smart -// Modified by: -// Created: 01/02/97 -// RCS-ID: $Id: setup_microwin.h 40766 2006-08-23 09:54:29Z VS $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_SETUP_H_ -#define _WX_SETUP_H_ - -// ---------------------------------------------------------------------------- -// global settings -// ---------------------------------------------------------------------------- - -//#define WXWIN_OS_DESCRIPTION wxT("MicroWindows") - -// 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.4 API: set it to 1 to -// enable it but please consider updating your code instead. -// -// Default is 0 -// -// Recommended setting: 0 (please update your code) -#define WXWIN_COMPATIBILITY_2_4 0 - -// This setting determines the compatibility with 2.6 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_6 1 - -// 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 wxWidgets 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 -#define wxUSE_DEBUG_CONTEXT 1 - -// 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 0 - -// In debug mode, cause new and delete to be redefined globally. -// If this causes problems (e.g. link errors), set this to 0. -// 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_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 1 -// -// Recommended setting: 1 but see comment in the beginning of this section -#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 wxWidgets 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 - -// Set wxUSE_UNICODE_MSLU to 1 if you want to compile wxWidgets in Unicode mode -// and be able to run compiled apps under Windows 9x as well as NT/2000/XP. This -// setting enables use of unicows.dll from MSLU (MS Layer for Unicode, see -// http://www.microsoft.com/globaldev/Articles/mslu_announce.asp). Note that you -// will have to modify the makefiles to include unicows.lib import library as the first -// library. -// -// Default is 0 -// -// Recommended setting: 0 -#define wxUSE_UNICODE_MSLU 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 0 - -// ---------------------------------------------------------------------------- -// global features -// ---------------------------------------------------------------------------- - -// 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 - -// 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 - -// Recommended setting: 1 -#define wxUSE_LOGWINDOW 1 - -// Recommended setting: 1 -#define wxUSE_LOGGUI 1 - -// Recommended setting: 1 -#define wxUSE_LOG_DIALOG 0 - -// 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 0 - -// If enabled (1), compiles wxWidgets streams classes -#define wxUSE_STREAMS 1 - -// Use standard C++ streams if 1. If 0, use wxWin streams implementation. -#define wxUSE_STD_IOSTREAM 0 - -// 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 0 - -// 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_DYNLIB_CLASS. -// -// Default is 1. -// -// Recommended setting: 1 -#define wxUSE_DIALUP_MANAGER 0 - -// Compile in wxLibrary class 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_DYNAMIC_LOADER 0 - -#define wxUSE_DYNLIB_CLASS 0 - -// Set to 1 to use socket classes -#define wxUSE_SOCKETS 0 - -// Set to 1 to enable virtual file systems (required by wxHTML) -#define wxUSE_FILESYSTEM 0 - -// Set to 1 to enable virtual ZIP filesystem (requires wxUSE_FILESYSTEM) -#define wxUSE_FS_ZIP 0 - -// Set to 1 to enable virtual Internet filesystem (requires wxUSE_FILESYSTEM) -#define wxUSE_FS_INET 0 - -// Set to 1 to compile wxZipInput/OutputStream classes. -#define wxUSE_ZIPSTREAM 0 - -// Set to 1 to compile wxZlibInput/OutputStream classes. Also required by -// wxUSE_LIBPNG. -#define wxUSE_ZLIB 0 - -// 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 wxWidgets 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 0 - -// wxSystemOptions class -#define wxUSE_SYSTEM_OPTIONS 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 - -// wxSound class -#define wxUSE_SOUND 0 - -// Use wxMediaCtrl -// -// Default is 1. -// -// Recommended setting: 1 -#define wxUSE_MEDIACTRL 1 - -// Use QuickTime -// -// Default is 0 -// -// Recommended setting: 1 if you have the QT SDK installed and you need it, else 0 -#define wxUSE_QUICKTIME 0 - -// Use DirectShow -// -// Default is 0 -// -// Recommended setting: 1 if the DirectX 7 SDK is installed (highly recommended), else 0 -#define wxUSE_DIRECTSHOW 1 - -// Use wxWidget's XRC XML-based resource system. Recommended. -// -// Default is 1 -// -// Recommended setting: 1 (requires wxUSE_XML) -#define wxUSE_XRC 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 (required by XRC) -#if wxUSE_XRC -# define wxUSE_XML 1 -#else -# define wxUSE_XML 0 -#endif - -// ---------------------------------------------------------------------------- -// 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 not used currently by wxMSW -// -// Default is 0 -// -// Recommended setting: 0 -#define wxUSE_POPUPWIN 1 - -// wxTipWindow allows to implement the custom tooltips, it is used by the -// context help classes. Requires wxUSE_POPUPWIN. -// -// Default is 1 -// -// Recommended setting: 1 (may be set to 0) -#define wxUSE_TIPWINDOW 1 - -// Each of the settings below corresponds to one wxWidgets 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 0 // 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 0 // 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 0 // 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 0 - -// 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 0 -#define wxUSE_TOOLBAR_NATIVE 0 - -// 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 - -// 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 -// -#define wxUSE_GRID 0 - -// 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 0 - -// 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 - -// 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 0 - -// wxValidator class and related methods -#define wxUSE_VALIDATORS 0 - -// 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 0 - -// 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 0 - -// wxDirDlg class for getting a directory name from user -#define wxUSE_DIRDLG 0 - -// 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 0 - -// Use find/replace dialogs. -// -// Default is 1 -// -// Recommended setting: 1 (but may be safely set to 0) -#define wxUSE_FINDREPLDLG 0 - -// Use font picker dialog -// -// Default is 1 -// -// Recommended setting: 1 (used in the library itself) -#define wxUSE_FONTDLG 0 - -// 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 0 - -// support for startup tips (wxShowTip &c) -#define wxUSE_STARTUP_TIPS 0 - -// text entry dialog and wxGetTextFromUser function -#define wxUSE_TEXTDLG 0 - -// number entry dialog -#define wxUSE_NUMBERDLG 0 - -// splash screen class -#define wxUSE_SPLASH 0 - -// wizards -#define wxUSE_WIZARDDLG 0 - -// ---------------------------------------------------------------------------- -// 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 0 -#define wxUSE_ENH_METAFILE 0 -#define wxUSE_WIN_METAFILES_ALWAYS 0 - -// ---------------------------------------------------------------------------- -// Big GUI components -// ---------------------------------------------------------------------------- - -// Set to 0 to disable document/view architecture -#define wxUSE_DOC_VIEW_ARCHITECTURE 0 - -// Set to 0 to disable MDI document/view architecture -#define wxUSE_MDI_ARCHITECTURE 0 - -// Set to 0 to disable print/preview architecture code -#define wxUSE_PRINTING_ARCHITECTURE 0 - -// 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 0 - -// OpenGL canvas -#define wxUSE_GLCANVAS 0 - -// wxTreeLayout class -#define wxUSE_TREELAYOUT 0 - -// ---------------------------------------------------------------------------- -// Data transfer -// ---------------------------------------------------------------------------- - -// Use wxClipboard class for clipboard copy/paste. -// -// Default is 1. -// -// Recommended setting: 1 -#define wxUSE_CLIPBOARD 0 - -// Use wxDataObject and related classes. Needed for clipboard and OLE drag and -// drop -// -// Default is 1. -// -// Recommended setting: 1 -#define wxUSE_DATAOBJ 0 - -// 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 0 - -// ---------------------------------------------------------------------------- -// 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 0 - -#define wxUSE_DRAGIMAGE 0 - -#define wxUSE_IPC 0 - // 0 for no interprocess comms -#define wxUSE_HELP 0 - // 0 for no help facility -#define wxUSE_MS_HTML_HELP 0 - // 0 for no MS HTML Help - -// Use wxHTML-based help controller? -#define wxUSE_WXHTML_HELP 0 - -#define wxUSE_RESOURCES 0 - // 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_XPM_IN_MSW 1 - // 0 for no XPM support in wxBitmap. - // Default is 1, as XPM is now fully - // supported this makes easier the issue - // of portable icons and bitmaps. - -#define wxUSE_IMAGE_LOADING_IN_MSW 0 - // Use dynamic DIB loading/saving code in utils/dib under MSW. -#define wxUSE_RESOURCE_LOADING_IN_MSW 0 - // Use dynamic icon/cursor loading/saving code - // under MSW. -#define wxUSE_WX_RESOURCES 0 - // Use .wxr resource mechanism (requires PrologIO library) - -#define wxUSE_MOUSEWHEEL 0 - // 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 compatibility 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 <iostream> and <iostream.h> but you can't mix -// them. Set to 1 for <iostream.h>, 0 for <iostream> -// -// Default is 1. -// -// Recommended setting: whatever your compiler likes more -#define wxUSE_IOSTREAMH 1 - -// ---------------------------------------------------------------------------- -// 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 0 - -// Set to 1 for JPEG format support (requires libjpeg) -#define wxUSE_LIBJPEG 0 - -// Set to 1 for TIFF format support (requires libtiff) -#define wxUSE_LIBTIFF 0 - -// Set to 1 for GIF format support -#define wxUSE_GIF 0 - -// Set to 1 for PNM format support -#define wxUSE_PNM 0 - -// Set to 1 for PCX format support -#define wxUSE_PCX 0 - -// 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 - -// ---------------------------------------------------------------------------- -// Windows-only settings -// ---------------------------------------------------------------------------- - -// Set this to 1 if you want to use wxWidgets and MFC in the same program. This -// will override some other settings (see below) -// -// Default is 0. -// -// Recommended setting: 0 unless you really have to use MFC -#define wxUSE_MFC 0 - -// Set this to 1 for generic OLE support: this is required for drag-and-drop, -// clipboard, OLE Automation. Only set it to 0 if your compiler is very old and -// can't compile/doesn't have the OLE headers. -// -// Default is 1. -// -// Recommended setting: 1 -#define wxUSE_OLE 0 - -// Set this to 1 to use Microsoft CTL3D library for "3D-look" under Win16 or NT -// 3.x. This setting is ignored under Win9x and NT 4.0+. -// -// Default is 0 for (most) Win32 (systems), 1 for Win16 -// -// Recommended setting: same as default -#if defined(__WIN95__) -#define wxUSE_CTL3D 0 -#else -#define wxUSE_CTL3D 1 -#endif - -// Set to 0 to disable PostScript print/preview architecture code under Windows -// (just use Windows printing). -#define wxUSE_POSTSCRIPT_ARCHITECTURE_IN_MSW 0 - -// Set this to 1 to use RICHEDIT controls for wxTextCtrl with style wxTE_RICH -// which allows to put more than ~32Kb of text in it even under Win9x (NT -// doesn't have such limitation). -// -// Default is 1 for compilers which support it -// -// Recommended setting: 1, only set it to 0 if your compiler doesn't have -// or can't compile <richedit.h> -#if defined(__WIN95__) && !defined(__WINE__) && !defined(__GNUWIN32_OLD__) -#define wxUSE_RICHEDIT 1 - -// TODO: This should be ifdef'ed for any compilers that don't support -// RichEdit 2.0 but do have RichEdit 1.0... -#define wxUSE_RICHEDIT2 1 - -#else -#define wxUSE_RICHEDIT 0 -#define wxUSE_RICHEDIT2 0 -#endif - -// Set this to 1 to enable support for the owner-drawn menu and listboxes. This -// is required by wxUSE_CHECKLISTBOX. -// -// Default is 1. -// -// Recommended setting: 1, set to 0 for a small library size reduction -#define wxUSE_OWNER_DRAWN 0 - -// ---------------------------------------------------------------------------- -// obsolete settings -// ---------------------------------------------------------------------------- - -// NB: all settings in this section are obsolete and should not be used/changed -// at all, they will disappear - -// Define 1 to use bitmap messages. -#define wxUSE_BITMAP_MESSAGE 1 - -// If 1, enables provision of run-time type information. -// NOW MANDATORY: don't change. -#define wxUSE_DYNAMIC_CLASSES 1 - -// ---------------------------------------------------------------------------- -// disable the settings which don't work for some compilers -// ---------------------------------------------------------------------------- - -#ifndef wxUSE_NORLANDER_HEADERS -#if (defined(__MINGW32__) || defined(__CYGWIN__)) && ((__GNUC__>2) ||((__GNUC__==2) && (__GNUC_MINOR__>=95))) -# define wxUSE_NORLANDER_HEADERS 1 -#else -# define wxUSE_NORLANDER_HEADERS 0 -#endif -#endif - -#if defined(__GNUWIN32__) -// These don't work as expected for mingw32 and cygwin32 -#undef wxUSE_MEMORY_TRACING -#define wxUSE_MEMORY_TRACING 0 - -#undef wxUSE_GLOBAL_MEMORY_OPERATORS -#define wxUSE_GLOBAL_MEMORY_OPERATORS 0 - -#undef wxUSE_DEBUG_NEW_ALWAYS -#define wxUSE_DEBUG_NEW_ALWAYS 0 - -// Cygwin betas don't have wcslen -#if defined(__CYGWIN__) || defined(__CYGWIN32__) -# if ! ((__GNUC__>2) ||((__GNUC__==2) && (__GNUC_MINOR__>=95))) -# undef wxUSE_WCHAR_T -# define wxUSE_WCHAR_T 0 -# endif -#endif - -#endif // __GNUWIN32__ - -// MFC duplicates these operators -#if wxUSE_MFC -#undef wxUSE_GLOBAL_MEMORY_OPERATORS -#define wxUSE_GLOBAL_MEMORY_OPERATORS 0 - -#undef wxUSE_DEBUG_NEW_ALWAYS -#define wxUSE_DEBUG_NEW_ALWAYS 0 -#endif // wxUSE_MFC - -#if (!defined(WIN32) && !defined(__WIN32__)) || (defined(__GNUWIN32__) && !wxUSE_NORLANDER_HEADERS) -// Can't use OLE drag and drop in Windows 3.1 because we don't know how -// to implement UUIDs -// GnuWin32 doesn't have appropriate headers for e.g. IUnknown. -#undef wxUSE_DRAG_AND_DROP -#define wxUSE_DRAG_AND_DROP 0 -#endif - -// Only WIN32 supports wxStatusBar95 -#if !defined(__WIN32__) && wxUSE_NATIVE_STATUSBAR -#undef wxUSE_NATIVE_STATUSBAR -#define wxUSE_NATIVE_STATUSBAR 0 -#endif - -#if !wxUSE_OWNER_DRAWN -#undef wxUSE_CHECKLISTBOX -#define wxUSE_CHECKLISTBOX 0 -#endif - -// Salford C++ doesn't like some of the memory operator definitions -#ifdef __SALFORDC__ -#undef wxUSE_MEMORY_TRACING -#define wxUSE_MEMORY_TRACING 0 - -#undef wxUSE_GLOBAL_MEMORY_OPERATORS -#define wxUSE_GLOBAL_MEMORY_OPERATORS 0 - -#undef wxUSE_DEBUG_NEW_ALWAYS -#define wxUSE_DEBUG_NEW_ALWAYS 0 - -#undef wxUSE_THREADS -#define wxUSE_THREADS 0 - -#undef wxUSE_OWNER_DRAWN -#define wxUSE_OWNER_DRAWN 0 -#endif // __SALFORDC__ - -// BC++/Win16 can't cope with the amount of data in resource.cpp -#if defined(__WIN16__) && defined(__BORLANDC__) -#undef wxUSE_WX_RESOURCES -#define wxUSE_WX_RESOURCES 0 - -#undef wxUSE_ODBC -#define wxUSE_ODBC 0 - -#undef wxUSE_NEW_GRID -#define wxUSE_NEW_GRID 0 -#endif - -#if defined(__BORLANDC__) && (__BORLANDC__ < 0x500) -// BC++ 4.0 can't compile JPEG library -#undef wxUSE_LIBJPEG -#define wxUSE_LIBJPEG 0 -#endif - -// wxUSE_DEBUG_NEW_ALWAYS = 1 not compatible with BC++ in DLL mode -#if defined(__BORLANDC__) && (defined(WXMAKINGDLL) || defined(WXUSINGDLL)) -#undef wxUSE_DEBUG_NEW_ALWAYS -#define wxUSE_DEBUG_NEW_ALWAYS 0 -#endif - -#if defined(__WXMSW__) && defined(__WATCOMC__) -/* -#undef wxUSE_GLCANVAS -#define wxUSE_GLCANVAS 0 -*/ - -#undef wxUSE_WCHAR_T -#define wxUSE_WCHAR_T 0 -#endif - -#if defined(__WXMSW__) && !defined(__WIN32__) - -#undef wxUSE_SOCKETS -#define wxUSE_SOCKETS 0 - -#undef wxUSE_THREADS -#define wxUSE_THREADS 0 - -#undef wxUSE_TOOLTIPS -#define wxUSE_TOOLTIPS 0 - -#undef wxUSE_SPINCTRL -#define wxUSE_SPINCTRL 0 - -#undef wxUSE_SPINBTN -#define wxUSE_SPINBTN 0 - -#undef wxUSE_LIBPNG -#define wxUSE_LIBPNG 0 - -#undef wxUSE_LIBJPEG -#define wxUSE_LIBJPEG 0 - -#undef wxUSE_LIBTIFF -#define wxUSE_LIBTIFF 0 - -#undef wxUSE_GIF -#define wxUSE_GIF 0 - -#undef wxUSE_PNM -#define wxUSE_PNM 0 - -#undef wxUSE_PCX -#define wxUSE_PCX 0 - -#undef wxUSE_GLCANVAS -#define wxUSE_GLCANVAS 0 - -#undef wxUSE_MS_HTML_HELP -#define wxUSE_MS_HTML_HELP 0 - -#undef wxUSE_WCHAR_T -#define wxUSE_WCHAR_T 0 - -#endif // Win16 - -// ---------------------------------------------------------------------------- -// undef the things which don't make sense for wxBase build -// ---------------------------------------------------------------------------- - -#if !wxUSE_GUI - -#undef wxUSE_HTML -#define wxUSE_HTML 0 - -#endif // !wxUSE_GUI - -// ---------------------------------------------------------------------------- -// check the settings consistency: do it here to abort compilation immediately -// and not almost in the very end when the relevant file fails to compile and -// you need to modify setup.h and rebuild everything -// ---------------------------------------------------------------------------- - -#if wxUSE_DATETIME && !wxUSE_LONGLONG - #error wxDateTime requires wxLongLong -#endif - -#if wxUSE_TEXTFILE && !wxUSE_FILE - #error You cannot compile wxTextFile without wxFile -#endif - -#if wxUSE_FILESYSTEM && !wxUSE_STREAMS - #error You cannot compile virtual file systems without wxUSE_STREAMS -#endif - -#if wxUSE_HTML && !wxUSE_FILESYSTEM - #error You cannot compile wxHTML without virtual file systems -#endif - -// add more tests here... - -#endif - // _WX_SETUP_H_ diff --git a/wxWidgets/include/wx/msw/slider95.h b/wxWidgets/include/wx/msw/slider95.h deleted file mode 100644 index 55415c789b..0000000000 --- a/wxWidgets/include/wx/msw/slider95.h +++ /dev/null @@ -1,137 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/msw/slider95.h -// Purpose: wxSlider class, using the Win95 (and later) trackbar control -// Author: Julian Smart -// Modified by: -// Created: 01/02/97 -// RCS-ID: $Id: slider95.h 53135 2008-04-12 02:31:04Z VZ $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_SLIDER95_H_ -#define _WX_SLIDER95_H_ - -class WXDLLIMPEXP_FWD_CORE wxSubwindows; - -// Slider -class WXDLLEXPORT wxSlider : public wxSliderBase -{ -public: - wxSlider() { Init(); } - - 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) - { - Init(); - - (void)Create(parent, id, value, minValue, maxValue, - pos, size, style, validator, name); - } - - 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 ~wxSlider(); - - // slider methods - virtual int GetValue() const; - virtual void SetValue(int); - - void SetRange(int minValue, int maxValue); - - int GetMin() const { return m_rangeMin; } - int GetMax() const { return m_rangeMax; } - - // Win32-specific slider methods - void SetTickFreq(int n, int pos); - 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); - - // implementation only from now on - WXHWND GetStaticMin() const; - WXHWND GetStaticMax() const; - WXHWND GetEditValue() const; - virtual bool ContainsHWND(WXHWND hWnd) const; - - // we should let background show through the slider (and its labels) - virtual bool HasTransparentBackground() { return true; } - - - void Command(wxCommandEvent& event); - virtual bool MSWOnScroll(int orientation, WXWORD wParam, - WXWORD pos, WXHWND control); - - virtual bool Show(bool show = true); - virtual bool Enable(bool show = true); - virtual bool SetFont(const wxFont& font); - - virtual WXDWORD MSWGetStyle(long flags, WXDWORD *exstyle = NULL) const; - -protected: - // common part of all ctors - void Init(); - - // format an integer value as string - static wxString Format(int n) { return wxString::Format(_T("%d"), n); } - - // get the boundig box for the slider and possible labels - wxRect GetBoundingBox() const; - - // get the height and, if the pointer is not NULL, width of our labels - int GetLabelsSize(int *width = NULL) const; - - - // overridden base class virtuals - virtual void DoGetPosition(int *x, int *y) const; - virtual void DoGetSize(int *width, int *height) const; - virtual void DoMoveWindow(int x, int y, int width, int height); - virtual wxSize DoGetBestSize() const; - - virtual wxBorder GetDefaultBorder() const { return wxBORDER_NONE; } - - - // the labels windows, if any - wxSubwindows *m_labels; - - int m_rangeMin; - int m_rangeMax; - int m_pageSize; - int m_lineSize; - int m_tickFreq; - - // flag needed to detect whether we're getting THUMBRELEASE event because - // of dragging the thumb or scrolling the mouse wheel - bool m_isDragging; - - DECLARE_DYNAMIC_CLASS_NO_COPY(wxSlider) -}; - -#endif // _WX_SLIDER95_H_ - diff --git a/wxWidgets/include/wx/msw/sound.h b/wxWidgets/include/wx/msw/sound.h deleted file mode 100644 index f1f52c9a2f..0000000000 --- a/wxWidgets/include/wx/msw/sound.h +++ /dev/null @@ -1,52 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/msw/sound.h -// Purpose: wxSound class -// Author: Julian Smart -// Modified by: -// Created: 01/02/97 -// RCS-ID: $Id: sound.h 35650 2005-09-23 12:56:45Z MR $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_SOUND_H_ -#define _WX_SOUND_H_ - -#if wxUSE_SOUND - -class WXDLLIMPEXP_ADV wxSound : public wxSoundBase -{ -public: - wxSound(); - wxSound(const wxString& fileName, bool isResource = false); - wxSound(int size, const wxByte* data); - virtual ~wxSound(); - - // Create from resource or file - bool Create(const wxString& fileName, bool isResource = false); - - // Create from data - bool Create(int size, const wxByte* data); - - bool IsOk() const { return m_data != NULL; } - - static void Stop(); - -protected: - void Init() { m_data = NULL; } - bool CheckCreatedOk(); - void Free(); - - virtual bool DoPlay(unsigned flags) const; - -private: - // data of this object - class wxSoundData *m_data; - - DECLARE_NO_COPY_CLASS(wxSound) -}; - -#endif // wxUSE_SOUND - -#endif // _WX_SOUND_H_ - diff --git a/wxWidgets/include/wx/msw/spinbutt.h b/wxWidgets/include/wx/msw/spinbutt.h deleted file mode 100644 index cf0bf62ccb..0000000000 --- a/wxWidgets/include/wx/msw/spinbutt.h +++ /dev/null @@ -1,72 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/univ/spinbutt.h -// Purpose: wxSpinButton class -// Author: Julian Smart -// Modified by: -// Created: 01/02/97 -// RCS-ID: $Id: spinbutt.h 41316 2006-09-20 14:15:14Z RR $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_SPINBUTT_H_ -#define _WX_SPINBUTT_H_ - -#include "wx/control.h" -#include "wx/event.h" - -#if wxUSE_SPINBTN - -class WXDLLEXPORT wxSpinButton : public wxSpinButtonBase -{ -public: - // construction - wxSpinButton() { } - - wxSpinButton(wxWindow *parent, - wxWindowID id = wxID_ANY, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = wxSP_VERTICAL | wxSP_ARROW_KEYS, - const wxString& name = wxSPIN_BUTTON_NAME) - { - Create(parent, id, pos, size, style, name); - } - - virtual ~wxSpinButton(); - - bool Create(wxWindow *parent, - wxWindowID id = wxID_ANY, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = wxSP_VERTICAL | wxSP_ARROW_KEYS, - const wxString& name = wxSPIN_BUTTON_NAME); - - - // accessors - virtual int GetValue() const; - virtual void SetValue(int val); - virtual void SetRange(int minVal, int maxVal); - - // implementation - virtual bool MSWCommand(WXUINT param, WXWORD id); - virtual bool MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result); - virtual bool MSWOnScroll(int orientation, WXWORD wParam, - WXWORD pos, WXHWND control); - - // a wxSpinButton can't do anything useful with focus, only wxSpinCtrl can - virtual bool AcceptsFocus() const { return false; } - -protected: - virtual wxSize DoGetBestSize() const; - - // ensure that the control displays a value in the current range - virtual void NormalizeValue(); - -private: - DECLARE_DYNAMIC_CLASS_NO_COPY(wxSpinButton) -}; - -#endif // wxUSE_SPINBTN - -#endif // _WX_SPINBUTT_H_ diff --git a/wxWidgets/include/wx/msw/spinctrl.h b/wxWidgets/include/wx/msw/spinctrl.h deleted file mode 100644 index 04e0cb4622..0000000000 --- a/wxWidgets/include/wx/msw/spinctrl.h +++ /dev/null @@ -1,142 +0,0 @@ -//////////////////////////////////////////////////////////////////////////// -// Name: msw/spinctrl.h -// Purpose: wxSpinCtrl class declaration for Win32 -// Author: Vadim Zeitlin -// Modified by: -// Created: 22.07.99 -// RCS-ID: $Id: spinctrl.h 53135 2008-04-12 02:31:04Z VZ $ -// Copyright: (c) Vadim Zeitlin -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_MSW_SPINCTRL_H_ -#define _WX_MSW_SPINCTRL_H_ - -#include "wx/spinbutt.h" // the base class - -#if wxUSE_SPINCTRL - -#include "wx/dynarray.h" - -class WXDLLIMPEXP_FWD_CORE wxSpinCtrl; -WX_DEFINE_EXPORTED_ARRAY_PTR(wxSpinCtrl *, wxArraySpins); - -// ---------------------------------------------------------------------------- -// Under Win32, wxSpinCtrl is a wxSpinButton with a buddy (as MSDN docs call -// it) text window whose contents is automatically updated when the spin -// control is clicked. -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxSpinCtrl : public wxSpinButton -{ -public: - wxSpinCtrl() { } - - wxSpinCtrl(wxWindow *parent, - wxWindowID id = wxID_ANY, - 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 = wxID_ANY, - 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")); - - // a wxTextCtrl-like method (but we can't have GetValue returning wxString - // because the base class already has one returning int!) - void SetValue(const wxString& text); - - // another wxTextCtrl-like method - void SetSelection(long from, long to); - - // implementation only from now on - // ------------------------------- - - virtual ~wxSpinCtrl(); - - virtual void SetValue(int val); - virtual int GetValue() const; - virtual bool SetFont(const wxFont &font); - virtual void SetFocus(); - - virtual bool Enable(bool enable = true); - virtual bool Show(bool show = true); - - virtual bool Reparent(wxWindowBase *newParent); - - // wxSpinButton doesn't accept focus, but we do - virtual bool AcceptsFocus() const { return wxWindow::AcceptsFocus(); } - - // for internal use only - - // get the subclassed window proc of the buddy text - WXFARPROC GetBuddyWndProc() const { return m_wndProcBuddy; } - - // return the spinctrl object whose buddy is the given window or NULL - static wxSpinCtrl *GetSpinForTextCtrl(WXHWND hwndBuddy); - - // process a WM_COMMAND generated by the buddy text control - bool ProcessTextCommand(WXWORD cmd, WXWORD id); - -protected: - virtual void DoGetPosition(int *x, int *y) const; - virtual void DoMoveWindow(int x, int y, int width, int height); - virtual wxSize DoGetBestSize() const; - virtual void DoGetSize(int *width, int *height) const; -#if wxABI_VERSION >= 20808 - virtual void DoGetClientSize(int *x, int *y) const; -#endif - -#if wxUSE_TOOLTIPS - virtual void DoSetToolTip( wxToolTip *tip ); -#endif // wxUSE_TOOLTIPS - - // the handler for wxSpinButton events - void OnSpinChange(wxSpinEvent& event); - - // handle processing of special keys - void OnChar(wxKeyEvent& event); - void OnSetFocus(wxFocusEvent& event); - void OnKillFocus(wxFocusEvent& event); - - // generate spin control update event with the given value - void SendSpinUpdate(int value); - - // called to ensure that the value is in the correct range - virtual void NormalizeValue(); - - - // the value of the control before the latest change (which might not have - // changed anything in fact -- this is why we need this field) - int m_oldValue; - - // the data for the "buddy" text ctrl - WXHWND m_hwndBuddy; - WXFARPROC m_wndProcBuddy; - - // all existing wxSpinCtrls - this allows to find the one corresponding to - // the given buddy window in GetSpinForTextCtrl() - static wxArraySpins ms_allSpins; - -private: - DECLARE_DYNAMIC_CLASS(wxSpinCtrl) - DECLARE_EVENT_TABLE() - DECLARE_NO_COPY_CLASS(wxSpinCtrl) -}; - -#endif // wxUSE_SPINCTRL - -#endif // _WX_MSW_SPINCTRL_H_ - - diff --git a/wxWidgets/include/wx/msw/stackwalk.h b/wxWidgets/include/wx/msw/stackwalk.h deleted file mode 100644 index 1109a53dfe..0000000000 --- a/wxWidgets/include/wx/msw/stackwalk.h +++ /dev/null @@ -1,103 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: wx/msw/stackwalk.h -// Purpose: wxStackWalker for MSW -// Author: Vadim Zeitlin -// Modified by: -// Created: 2005-01-08 -// RCS-ID: $Id: stackwalk.h 43346 2006-11-12 14:33:03Z RR $ -// Copyright: (c) 2005 Vadim Zeitlin <vadim@wxwindows.org> -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_MSW_STACKWALK_H_ -#define _WX_MSW_STACKWALK_H_ - -#include "wx/arrstr.h" - -// these structs are declared in windows headers -struct _CONTEXT; -struct _EXCEPTION_POINTERS; - -// and these in dbghelp.h -struct _SYMBOL_INFO; - -// ---------------------------------------------------------------------------- -// wxStackFrame -// ---------------------------------------------------------------------------- - -class WXDLLIMPEXP_BASE wxStackFrame : public wxStackFrameBase -{ -private: - wxStackFrame *ConstCast() const - { return wx_const_cast(wxStackFrame *, this); } - - size_t DoGetParamCount() const { return m_paramTypes.GetCount(); } - -public: - wxStackFrame(size_t level, void *address, size_t addrFrame) - : wxStackFrameBase(level, address) - { - m_hasName = - m_hasLocation = false; - - m_addrFrame = addrFrame; - } - - virtual size_t GetParamCount() const - { - ConstCast()->OnGetParam(); - return DoGetParamCount(); - } - - virtual bool - GetParam(size_t n, wxString *type, wxString *name, wxString *value) const; - - // callback used by OnGetParam(), don't call directly - void OnParam(_SYMBOL_INFO *pSymInfo); - -protected: - virtual void OnGetName(); - virtual void OnGetLocation(); - - void OnGetParam(); - - - // helper for debug API: it wants to have addresses as DWORDs - size_t GetSymAddr() const - { - return wx_reinterpret_cast(size_t, m_address); - } - -private: - bool m_hasName, - m_hasLocation; - - size_t m_addrFrame; - - wxArrayString m_paramTypes, - m_paramNames, - m_paramValues; -}; - -// ---------------------------------------------------------------------------- -// wxStackWalker -// ---------------------------------------------------------------------------- - -class WXDLLIMPEXP_BASE wxStackWalker : public wxStackWalkerBase -{ -public: - // we don't use ctor argument, it is for compatibility with Unix version - // only - wxStackWalker(const char * WXUNUSED(argv0) = NULL) { } - - virtual void Walk(size_t skip = 1, size_t maxDepth = 200); - virtual void WalkFromException(); - - - // enumerate stack frames from the given context - void WalkFrom(const _CONTEXT *ctx, size_t skip = 1); - void WalkFrom(const _EXCEPTION_POINTERS *ep, size_t skip = 1); -}; - -#endif // _WX_MSW_STACKWALK_H_ - diff --git a/wxWidgets/include/wx/msw/statbmp.h b/wxWidgets/include/wx/msw/statbmp.h deleted file mode 100644 index 914721053e..0000000000 --- a/wxWidgets/include/wx/msw/statbmp.h +++ /dev/null @@ -1,90 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/msw/statbmp.h -// Purpose: wxStaticBitmap class for wxMSW -// Author: Julian Smart -// Modified by: -// Created: 01/02/97 -// RCS-ID: $Id: statbmp.h 51824 2008-02-16 01:59:21Z SN $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_STATBMP_H_ -#define _WX_STATBMP_H_ - -#include "wx/control.h" -#include "wx/icon.h" -#include "wx/bitmap.h" - -extern WXDLLEXPORT_DATA(const wxChar) wxStaticBitmapNameStr[]; - -// a control showing an icon or a bitmap -class WXDLLEXPORT wxStaticBitmap : public wxStaticBitmapBase -{ -public: - wxStaticBitmap() { Init(); } - - wxStaticBitmap(wxWindow *parent, - wxWindowID id, - const wxGDIImage& label, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = 0, - const wxString& name = wxStaticBitmapNameStr) - { - Init(); - - Create(parent, id, label, pos, size, style, name); - } - - bool Create(wxWindow *parent, - wxWindowID id, - const wxGDIImage& label, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = 0, - const wxString& name = wxStaticBitmapNameStr); - - virtual ~wxStaticBitmap() { Free(); } - - virtual void SetIcon(const wxIcon& icon) { SetImage(&icon); } - virtual void SetBitmap(const wxBitmap& bitmap) { SetImage(&bitmap); } - virtual wxBitmap GetBitmap() const; - virtual wxIcon GetIcon() const; - - virtual WXDWORD MSWGetStyle(long style, WXDWORD *exstyle) const; - -protected: - virtual wxBorder GetDefaultBorder() const; - virtual wxSize DoGetBestSize() const; - - // ctor/dtor helpers - void Init() { m_isIcon = true; m_image = NULL; m_currentHandle = 0; } - void Free(); - - // true if icon/bitmap is valid - bool ImageIsOk() const; - - void SetImage(const wxGDIImage* image); - void SetImageNoCopy( wxGDIImage* image ); - -#if wxABI_VERSION >= 20808 - // draw the bitmap ourselves here if the OS can't do it correctly (if it - // can we leave it to it) - void DoPaintManually(wxPaintEvent& event); -#endif - - // we can have either an icon or a bitmap - bool m_isIcon; - wxGDIImage *m_image; - - // handle used in last call to STM_SETIMAGE - WXHANDLE m_currentHandle; - -private: - DECLARE_DYNAMIC_CLASS(wxStaticBitmap) - DECLARE_NO_COPY_CLASS(wxStaticBitmap) -}; - -#endif - // _WX_STATBMP_H_ diff --git a/wxWidgets/include/wx/msw/statbox.h b/wxWidgets/include/wx/msw/statbox.h deleted file mode 100644 index 35c7d33003..0000000000 --- a/wxWidgets/include/wx/msw/statbox.h +++ /dev/null @@ -1,73 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/msw/statbox.h -// Purpose: wxStaticBox class -// Author: Julian Smart -// Modified by: -// Created: 01/02/97 -// RCS-ID: $Id: statbox.h 37393 2006-02-08 21:47:09Z VZ $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_MSW_STATBOX_H_ -#define _WX_MSW_STATBOX_H_ - -// Group box -class WXDLLEXPORT wxStaticBox : public wxStaticBoxBase -{ -public: - wxStaticBox() { } - - 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); - - /// Implementation only - virtual void GetBordersForSizer(int *borderTop, int *borderOther) const; - - virtual WXDWORD MSWGetStyle(long style, WXDWORD *exstyle) const; - -protected: - virtual wxSize DoGetBestSize() const; - - // choose the default border for this window - virtual wxBorder GetDefaultBorder() const; - -#ifndef __WXWINCE__ -public: - virtual WXLRESULT MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam); - -protected: - // return the region with all the windows inside this static box excluded - virtual WXHRGN MSWGetRegionWithoutChildren(); - - // remove the parts which are painted by static box itself from the given - // region which is embedded in a rectangle (0, 0)-(w, h) - virtual void MSWGetRegionWithoutSelf(WXHRGN hrgn, int w, int h); - - // paint the given rectangle with our background brush/colour - virtual void PaintBackground(wxDC& dc, const struct tagRECT& rc); - // paint the foreground of the static box - virtual void PaintForeground(wxDC& dc, const struct tagRECT& rc); - - void OnPaint(wxPaintEvent& event); -#endif // !__WXWINCE__ - - DECLARE_DYNAMIC_CLASS_NO_COPY(wxStaticBox) -}; - -#endif // _WX_MSW_STATBOX_H_ - diff --git a/wxWidgets/include/wx/msw/statbr95.h b/wxWidgets/include/wx/msw/statbr95.h deleted file mode 100644 index 1e3155ad03..0000000000 --- a/wxWidgets/include/wx/msw/statbr95.h +++ /dev/null @@ -1,76 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: msw/statbr95.h -// Purpose: native implementation of wxStatusBar -// Author: Vadim Zeitlin -// Modified by: -// Created: 04.04.98 -// RCS-ID: $Id: statbr95.h 41035 2006-09-06 17:36:22Z PC $ -// Copyright: (c) 1998 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr> -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _STATBR95_H -#define _STATBR95_H - -#if wxUSE_NATIVE_STATUSBAR - -class WXDLLEXPORT wxStatusBar95 : public wxStatusBarBase -{ -public: - // ctors and such - wxStatusBar95(); - wxStatusBar95(wxWindow *parent, - wxWindowID id = wxID_ANY, - long style = wxST_SIZEGRIP, - const wxString& name = wxStatusBarNameStr) - { - (void)Create(parent, id, style, name); - } - - bool Create(wxWindow *parent, - wxWindowID id = wxID_ANY, - long style = wxST_SIZEGRIP, - const wxString& name = wxStatusBarNameStr); - - virtual ~wxStatusBar95(); - - // a status line can have several (<256) fields numbered from 0 - virtual void SetFieldsCount(int number = 1, const int *widths = NULL); - - // each field of status line has it's own text - virtual void SetStatusText(const wxString& text, int number = 0); - virtual wxString GetStatusText(int number = 0) const; - - // set status line fields' widths - virtual void SetStatusWidths(int n, const int widths_field[]); - - // set status line fields' styles - virtual void SetStatusStyles(int n, const int styles[]); - - // sets the minimal vertical size of the status bar - virtual void SetMinHeight(int height); - - // get the position and size of the field's internal bounding rectangle - virtual bool GetFieldRect(int i, wxRect& rect) const; - - // get the border size - virtual int GetBorderX() const; - virtual int GetBorderY() const; - - virtual WXLRESULT MSWWindowProc(WXUINT nMsg, - WXWPARAM wParam, - WXLPARAM lParam); -protected: - void CopyFieldsWidth(const int widths[]); - void SetFieldsWidth(); - - // override base class virtual - void DoMoveWindow(int x, int y, int width, int height); - -private: - DECLARE_DYNAMIC_CLASS_NO_COPY(wxStatusBar95) -}; - -#endif // wxUSE_NATIVE_STATUSBAR - -#endif diff --git a/wxWidgets/include/wx/msw/statline.h b/wxWidgets/include/wx/msw/statline.h deleted file mode 100644 index cdbd933a5f..0000000000 --- a/wxWidgets/include/wx/msw/statline.h +++ /dev/null @@ -1,52 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: msw/statline.h -// Purpose: MSW version of wxStaticLine class -// Author: Vadim Zeitlin -// Created: 28.06.99 -// Version: $Id: statline.h 43874 2006-12-09 14:52:59Z VZ $ -// Copyright: (c) 1998 Vadim Zeitlin -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_MSW_STATLINE_H_ -#define _WX_MSW_STATLINE_H_ - -// ---------------------------------------------------------------------------- -// wxStaticLine -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxStaticLine : public wxStaticLineBase -{ -public: - // constructors and pseudo-constructors - wxStaticLine() { } - - wxStaticLine( wxWindow *parent, - wxWindowID id = wxID_ANY, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = wxLI_HORIZONTAL, - const wxString &name = wxStaticLineNameStr ) - { - Create(parent, id, pos, size, style, name); - } - - bool Create( wxWindow *parent, - wxWindowID id = wxID_ANY, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = wxLI_HORIZONTAL, - const wxString &name = wxStaticLineNameStr ); - - // overriden base class virtuals - virtual bool AcceptsFocus() const { return false; } - - // usually overridden base class virtuals - virtual WXDWORD MSWGetStyle(long style, WXDWORD *exstyle) const; - - DECLARE_DYNAMIC_CLASS_NO_COPY(wxStaticLine) -}; - -#endif // _WX_MSW_STATLINE_H_ - - diff --git a/wxWidgets/include/wx/msw/stattext.h b/wxWidgets/include/wx/msw/stattext.h deleted file mode 100644 index e3e16595a0..0000000000 --- a/wxWidgets/include/wx/msw/stattext.h +++ /dev/null @@ -1,56 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/msw/stattext.h -// Purpose: wxStaticText class -// Author: Julian Smart -// Modified by: -// Created: 01/02/97 -// RCS-ID: $Id: stattext.h 37393 2006-02-08 21:47:09Z VZ $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_STATTEXT_H_ -#define _WX_STATTEXT_H_ - -class WXDLLEXPORT wxStaticText : public wxStaticTextBase -{ -public: - wxStaticText() { } - - 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); - - // override some methods to resize the window properly - virtual void SetLabel(const wxString& label); - virtual bool SetFont( const wxFont &font ); - - virtual WXDWORD MSWGetStyle(long flags, WXDWORD *exstyle = NULL) const; - -protected: - // implement/override some base class virtuals - virtual wxBorder GetDefaultBorder() const; - virtual void DoSetSize(int x, int y, int w, int h, - int sizeFlags = wxSIZE_AUTO); - virtual wxSize DoGetBestSize() const; - - DECLARE_DYNAMIC_CLASS_NO_COPY(wxStaticText) -}; - -#endif - // _WX_STATTEXT_H_ diff --git a/wxWidgets/include/wx/msw/std.ico b/wxWidgets/include/wx/msw/std.ico deleted file mode 100644 index 435cca2471cd31bb825ff1e6eb180c1939a9eb4a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1078 zcmc&zF%p6>5L_S)<BakHsT`j{k%#dFTYh10!*eX@E#mG)fdQix<B`41-d%Dj4j@C0 zx~|9$_Z&C@sH&*X8L%&aGh;Q;5UTrbEx?7gjYQ8a`o1SC5o{p@?FfDf$!%<9C%cSY zRyw@$yPND<CUsck)7qNtro8jClxBMuX8DEIT`?cum(<oYI;;2182PF7zIpvZj~8vQ z;S8({1qZ{>1H}g<-VtX@^EF=Zz9{mlQwW;#il~Wy%sJ<goq>ax^Jn}JGe|Bw=NmFB ge8aqPJmI~ud$Eb6)2}9ELOWr8V4xU|6W(XUPqgg+2mk;8 diff --git a/wxWidgets/include/wx/msw/stdpaths.h b/wxWidgets/include/wx/msw/stdpaths.h deleted file mode 100644 index 34cc778bb6..0000000000 --- a/wxWidgets/include/wx/msw/stdpaths.h +++ /dev/null @@ -1,53 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: wx/msw/stdpaths.h -// Purpose: wxStandardPaths for Win32 -// Author: Vadim Zeitlin -// Modified by: -// Created: 2004-10-19 -// RCS-ID: $Id: stdpaths.h 43340 2006-11-12 12:58:10Z RR $ -// Copyright: (c) 2004 Vadim Zeitlin <vadim@wxwindows.org> -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_MSW_STDPATHS_H_ -#define _WX_MSW_STDPATHS_H_ - -// ---------------------------------------------------------------------------- -// wxStandardPaths -// ---------------------------------------------------------------------------- - -class WXDLLIMPEXP_BASE wxStandardPaths : public wxStandardPathsBase -{ -public: - // implement base class pure virtuals - virtual wxString GetExecutablePath() const; - virtual wxString GetConfigDir() const; - virtual wxString GetUserConfigDir() const; - virtual wxString GetDataDir() const; - virtual wxString GetUserDataDir() const; - virtual wxString GetUserLocalDataDir() const; - virtual wxString GetPluginsDir() const; - virtual wxString GetDocumentsDir() const; - -protected: - // get the path corresponding to the given standard CSIDL_XXX constant - static wxString DoGetDirectory(int csidl); - - // return the directory of the application itself - static wxString GetAppDir(); -}; - -// ---------------------------------------------------------------------------- -// wxStandardPathsWin16: this class is for internal use only -// ---------------------------------------------------------------------------- - -// override config file locations to be compatible with the values used by -// wxFileConfig (dating from Win16 days which explains the class name) -class WXDLLIMPEXP_BASE wxStandardPathsWin16 : public wxStandardPaths -{ -public: - virtual wxString GetConfigDir() const; - virtual wxString GetUserConfigDir() const; -}; - -#endif // _WX_MSW_STDPATHS_H_ diff --git a/wxWidgets/include/wx/msw/subwin.h b/wxWidgets/include/wx/msw/subwin.h deleted file mode 100644 index 709004ac90..0000000000 --- a/wxWidgets/include/wx/msw/subwin.h +++ /dev/null @@ -1,195 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: wx/msw/subwin.h -// Purpose: helper for implementing the controls with subwindows -// Author: Vadim Zeitlin -// Modified by: -// Created: 2004-12-11 -// RCS-ID: $Id: subwin.h 30981 2004-12-13 01:02:32Z VZ $ -// Copyright: (c) 2004 Vadim Zeitlin <vadim@wxwindows.org> -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_MSW_SUBWIN_H_ -#define _WX_MSW_SUBWIN_H_ - -#include "wx/msw/private.h" - -// ---------------------------------------------------------------------------- -// wxSubwindows contains all HWNDs making part of a single wx control -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxSubwindows -{ -public: - // the number of subwindows can be specified either as parameter to ctor or - // later in Create() - wxSubwindows(size_t n = 0) { Init(); if ( n ) Create(n); } - - // allocate enough space for the given number of windows - void Create(size_t n) - { - wxASSERT_MSG( !m_hwnds, _T("Create() called twice?") ); - - m_count = n; - m_hwnds = (HWND *)calloc(n, sizeof(HWND)); - } - - // non-virtual dtor, this class is not supposed to be used polymorphically - ~wxSubwindows() - { - for ( size_t n = 0; n < m_count; n++ ) - { - ::DestroyWindow(m_hwnds[n]); - } - - free(m_hwnds); - } - - // get the number of subwindows - size_t GetCount() const { return m_count; } - - // access a given window - HWND& Get(size_t n) - { - wxASSERT_MSG( n < m_count, _T("subwindow index out of range") ); - - return m_hwnds[n]; - } - - HWND& operator[](size_t n) { return Get(n); } - HWND operator[](size_t n) const - { - return wx_const_cast(wxSubwindows *, this)->Get(n); - } - - // check if we have this window - bool HasWindow(HWND hwnd) - { - for ( size_t n = 0; n < m_count; n++ ) - { - if ( m_hwnds[n] == hwnd ) - return true; - } - - return false; - } - - - // methods which are forwarded to all subwindows - // --------------------------------------------- - - // show/hide everything - void Show(bool show) - { - int sw = show ? SW_SHOW : SW_HIDE; - for ( size_t n = 0; n < m_count; n++ ) - { - ::ShowWindow(m_hwnds[n], sw); - } - } - - // enable/disable everything - void Enable(bool enable) - { - for ( size_t n = 0; n < m_count; n++ ) - { - ::EnableWindow(m_hwnds[n], enable); - } - } - - // set font for all windows - void SetFont(const wxFont& font) - { - HFONT hfont = GetHfontOf(font); - wxCHECK_RET( hfont, _T("invalid font") ); - - for ( size_t n = 0; n < m_count; n++ ) - { - ::SendMessage(m_hwnds[n], WM_SETFONT, (WPARAM)hfont, 0); - - // otherwise the window might not be redrawn correctly - ::InvalidateRect(m_hwnds[n], NULL, FALSE /* don't erase bg */); - } - } - - // find the bounding box for all windows - wxRect GetBoundingBox() const - { - wxRect r; - for ( size_t n = 0; n < m_count; n++ ) - { - RECT rc; - ::GetWindowRect(m_hwnds[n], &rc); - - r.Union(wxRectFromRECT(rc)); - } - - return r; - } - -private: - void Init() - { - m_count = 0; - m_hwnds = NULL; - } - - // number of elements in m_hwnds array - size_t m_count; - - // the HWNDs we contain - HWND *m_hwnds; - - - DECLARE_NO_COPY_CLASS(wxSubwindows) -}; - -// convenient macro to forward a few methods which are usually propagated to -// subwindows to a wxSubwindows object -// -// parameters should be: -// - cname the name of the class implementing these methods -// - base the name of its base class -// - subwins the name of the member variable of type wxSubwindows * -#define WX_FORWARD_STD_METHODS_TO_SUBWINDOWS(cname, base, subwins) \ - bool cname::ContainsHWND(WXHWND hWnd) const \ - { \ - return subwins && subwins->HasWindow((HWND)hWnd); \ - } \ - \ - bool cname::Show(bool show) \ - { \ - if ( !base::Show(show) ) \ - return false; \ - \ - if ( subwins ) \ - subwins->Show(show); \ - \ - return true; \ - } \ - \ - bool cname::Enable(bool enable) \ - { \ - if ( !base::Enable(enable) ) \ - return false; \ - \ - if ( subwins ) \ - subwins->Enable(enable); \ - \ - return true; \ - } \ - \ - bool cname::SetFont(const wxFont& font) \ - { \ - if ( !base::SetFont(font) ) \ - return false; \ - \ - if ( subwins ) \ - subwins->SetFont(font); \ - \ - return true; \ - } - - -#endif // _WX_MSW_SUBWIN_H_ - diff --git a/wxWidgets/include/wx/msw/tabctrl.h b/wxWidgets/include/wx/msw/tabctrl.h deleted file mode 100644 index 20f4f46954..0000000000 --- a/wxWidgets/include/wx/msw/tabctrl.h +++ /dev/null @@ -1,160 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: tabctrl.h -// Purpose: wxTabCtrl class -// Author: Julian Smart -// Modified by: -// Created: 01/02/97 -// RCS-ID: $Id: tabctrl.h 41020 2006-09-05 20:47:48Z VZ $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_TABCTRL_H_ -#define _WX_TABCTRL_H_ - -class WXDLLIMPEXP_CORE wxImageList; - -// extern WXDLLEXPORT_DATA(const wxChar) wxToolBarNameStr[]; - -/* - * 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); - } - virtual ~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); - - // Implementation - - virtual bool MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result); - - // Responds to colour changes - void OnSysColourChanged(wxSysColourChangedEvent& event); - -protected: - wxImageList* m_imageList; - -DECLARE_EVENT_TABLE() - DECLARE_NO_COPY_CLASS(wxTabCtrl) -}; - -class WXDLLEXPORT wxTabEvent : public wxNotifyEvent -{ -public: - wxTabEvent(wxEventType commandType = wxEVT_NULL, int id = 0, - int nSel = -1, int nOldSel = -1) - : wxNotifyEvent(commandType, id) - { - m_nSel = nSel; - m_nOldSel = nOldSel; - } - - // accessors - // the currently selected page (-1 if none) - int GetSelection() const { return m_nSel; } - void SetSelection(int nSel) { m_nSel = nSel; } - // the page that was selected before the change (-1 if none) - int GetOldSelection() const { return m_nOldSel; } - void SetOldSelection(int nOldSel) { m_nOldSel = nOldSel; } - -private: - int m_nSel, // currently selected page - m_nOldSel; // previously selected page - - DECLARE_DYNAMIC_CLASS_NO_COPY(wxTabEvent) -}; - -typedef void (wxEvtHandler::*wxTabEventFunction)(wxTabEvent&); - -#define EVT_TAB_SEL_CHANGED(id, fn) DECLARE_EVENT_TABLE_ENTRY(wxEVT_COMMAND_TAB_SEL_CHANGED, \ - id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxTabEventFunction, & fn ), NULL), -#define EVT_TAB_SEL_CHANGING(id, fn) DECLARE_EVENT_TABLE_ENTRY(wxEVT_COMMAND_TAB_SEL_CHANGING, \ - id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxTabEventFunction, & fn ), NULL), - -#endif - // _WX_TABCTRL_H_ diff --git a/wxWidgets/include/wx/msw/taskbar.h b/wxWidgets/include/wx/msw/taskbar.h deleted file mode 100644 index c29c5c9159..0000000000 --- a/wxWidgets/include/wx/msw/taskbar.h +++ /dev/null @@ -1,82 +0,0 @@ -///////////////////////////////////////////////////////////////////////// -// File: wx/msw/taskbar.h -// Purpose: Defines wxTaskBarIcon class for manipulating icons on the -// Windows task bar. -// Author: Julian Smart -// Modified by: Vaclav Slavik -// Created: 24/3/98 -// RCS-ID: $Id: taskbar.h 53135 2008-04-12 02:31:04Z VZ $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////// - -#ifndef _TASKBAR_H_ -#define _TASKBAR_H_ - -#include "wx/icon.h" - -// private helper class: -class WXDLLIMPEXP_FWD_ADV wxTaskBarIconWindow; - -class WXDLLIMPEXP_ADV wxTaskBarIcon: public wxTaskBarIconBase -{ - DECLARE_DYNAMIC_CLASS_NO_COPY(wxTaskBarIcon) -public: - wxTaskBarIcon(); - virtual ~wxTaskBarIcon(); - -// Accessors - inline bool IsOk() const { return true; } - inline bool IsIconInstalled() const { return m_iconAdded; } - -// Operations - bool SetIcon(const wxIcon& icon, const wxString& tooltip = wxEmptyString); - bool RemoveIcon(void); - bool PopupMenu(wxMenu *menu); //, int x, int y); - -#if WXWIN_COMPATIBILITY_2_4 - wxDEPRECATED( bool IsOK() const ); - -// Overridables - virtual void OnMouseMove(wxEvent&); - virtual void OnLButtonDown(wxEvent&); - virtual void OnLButtonUp(wxEvent&); - virtual void OnRButtonDown(wxEvent&); - virtual void OnRButtonUp(wxEvent&); - virtual void OnLButtonDClick(wxEvent&); - virtual void OnRButtonDClick(wxEvent&); -#endif - -// Implementation -protected: - friend class wxTaskBarIconWindow; - long WindowProc(unsigned int msg, unsigned int wParam, long lParam); - void RegisterWindowMessages(); - -// Data members -protected: - wxTaskBarIconWindow *m_win; - bool m_iconAdded; - wxIcon m_icon; - wxString m_strTooltip; - -#if WXWIN_COMPATIBILITY_2_4 - // non-virtual default event handlers to forward events to the virtuals - void _OnMouseMove(wxTaskBarIconEvent&); - void _OnLButtonDown(wxTaskBarIconEvent&); - void _OnLButtonUp(wxTaskBarIconEvent&); - void _OnRButtonDown(wxTaskBarIconEvent&); - void _OnRButtonUp(wxTaskBarIconEvent&); - void _OnLButtonDClick(wxTaskBarIconEvent&); - void _OnRButtonDClick(wxTaskBarIconEvent&); - - DECLARE_EVENT_TABLE() -#endif -}; - -#if WXWIN_COMPATIBILITY_2_4 -inline bool wxTaskBarIcon::IsOK() const { return IsOk(); } -#endif - -#endif - // _TASKBAR_H_ diff --git a/wxWidgets/include/wx/msw/tbar95.h b/wxWidgets/include/wx/msw/tbar95.h deleted file mode 100644 index 4b1d4b66de..0000000000 --- a/wxWidgets/include/wx/msw/tbar95.h +++ /dev/null @@ -1,156 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/msw/tbar95.h -// Purpose: wxToolBar (Windows 95 toolbar) class -// Author: Julian Smart -// Modified by: -// Created: 01/02/97 -// RCS-ID: $Id: tbar95.h 58446 2009-01-26 23:32:16Z VS $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_MSW_TBAR95_H_ -#define _WX_MSW_TBAR95_H_ - -#if wxUSE_TOOLBAR - -#include "wx/dynarray.h" -#include "wx/imaglist.h" - -class WXDLLEXPORT wxToolBar : public wxToolBarBase -{ -public: - // ctors and dtor - wxToolBar() { Init(); } - - 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); - } - - bool Create(wxWindow *parent, - wxWindowID id, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = wxNO_BORDER | wxTB_HORIZONTAL, - const wxString& name = wxToolBarNameStr); - - virtual ~wxToolBar(); - - // 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); - -#if wxABI_VERSION >= 20802 - // TODO: In 2.9 these should probably be virtual, and declared in the base class... - void SetToolNormalBitmap(int id, const wxBitmap& bitmap); - void SetToolDisabledBitmap(int id, const wxBitmap& bitmap); -#endif - - // implementation only from now on - // ------------------------------- - - virtual void SetWindowStyleFlag(long style); - - virtual bool MSWCommand(WXUINT param, WXWORD id); - virtual bool MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result); - - void OnMouseEvent(wxMouseEvent& event); - void OnSysColourChanged(wxSysColourChangedEvent& event); - void OnEraseBackground(wxEraseEvent& event); - - void SetFocus() {} - - static WXHBITMAP MapBitmap(WXHBITMAP bitmap, int width, int height); - - // override WndProc mainly to process WM_SIZE - virtual WXLRESULT MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam); - - virtual WXDWORD MSWGetStyle(long style, WXDWORD *exstyle) const; - -protected: - // common part of all ctors - void Init(); - - // create the native toolbar control - bool MSWCreateToolbar(const wxPoint& pos, const wxSize& size); - - // recreate the control completely - void Recreate(); - - // 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); - - // return the appropriate size and flags for the toolbar control - virtual wxSize DoGetBestSize() const; - - // handlers for various events - bool HandleSize(WXWPARAM wParam, WXLPARAM lParam); - bool HandlePaint(WXWPARAM wParam, WXLPARAM lParam); - void HandleMouseMove(WXWPARAM wParam, WXLPARAM lParam); - - // should be called whenever the toolbar size changes - void UpdateSize(); - - // create m_disabledImgList (but doesn't fill it), set it to NULL if it is - // unneeded - void CreateDisabledImageList(); - - // get the Windows toolbar style of this control - long GetMSWToolbarStyle() const; - - - // the big bitmap containing all bitmaps of the toolbar buttons - WXHBITMAP m_hBitmap; - - // the image list with disabled images, may be NULL if we use - // system-provided versions of them - wxImageList *m_disabledImgList; - - // the total number of toolbar elements - size_t m_nButtons; - - // the tool the cursor is in - wxToolBarToolBase *m_pInTool; - -private: - // makes sure tool bitmap size is sufficient for all tools - void AdjustToolBitmapSize(); - - DECLARE_EVENT_TABLE() - DECLARE_DYNAMIC_CLASS(wxToolBar) - DECLARE_NO_COPY_CLASS(wxToolBar) -}; - -#endif // wxUSE_TOOLBAR - -#endif // _WX_MSW_TBAR95_H_ - diff --git a/wxWidgets/include/wx/msw/textctrl.h b/wxWidgets/include/wx/msw/textctrl.h deleted file mode 100644 index 2ffea75d32..0000000000 --- a/wxWidgets/include/wx/msw/textctrl.h +++ /dev/null @@ -1,291 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/msw/textctrl.h -// Purpose: wxTextCtrl class -// Author: Julian Smart -// Modified by: -// Created: 01/02/97 -// RCS-ID: $Id: textctrl.h 52547 2008-03-15 12:33:04Z VS $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_TEXTCTRL_H_ -#define _WX_TEXTCTRL_H_ - -class WXDLLEXPORT wxTextCtrl : public wxTextCtrlBase -{ -public: - // creation - // -------- - - wxTextCtrl() { Init(); } - 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); - } - virtual ~wxTextCtrl(); - - 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); - - // implement base class pure virtuals - // ---------------------------------- - - virtual wxString GetValue() const; - virtual bool IsEmpty() const; - - virtual wxString GetRange(long from, long to) const; - - virtual int GetLineLength(long lineNo) const; - virtual wxString GetLineText(long lineNo) const; - virtual int GetNumberOfLines() const; - - virtual bool IsModified() const; - virtual bool IsEditable() const; - - 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 control's contents from the file - virtual bool DoLoadFile(const wxString& file, int fileType); - - // clears the dirty flag - virtual void MarkDirty(); - virtual void DiscardEdits(); - - virtual void SetMaxLength(unsigned long len); - - // 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); - -#ifdef __WIN32__ - virtual bool EmulateKeyPress(const wxKeyEvent& event); -#endif // __WIN32__ - -#if wxUSE_RICHEDIT - // apply text attribute to the range of text (only works with richedit - // controls) - virtual bool SetStyle(long start, long end, const wxTextAttr& style); - virtual bool SetDefaultStyle(const wxTextAttr& style); - virtual bool GetStyle(long position, wxTextAttr& style); -#endif // wxUSE_RICHEDIT - - // 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); - virtual wxTextCtrlHitTestResult HitTest(const wxPoint& pt, long *pos) const; - virtual wxTextCtrlHitTestResult HitTest(const wxPoint& pt, - wxTextCoord *col, - wxTextCoord *row) const - { - return wxTextCtrlBase::HitTest(pt, col, row); - } - - // 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 wxTextPos GetLastPosition() const; - - virtual void SetSelection(long from, long to); - virtual void SetEditable(bool editable); - - // Caret handling (Windows only) - - bool ShowNativeCaret(bool show = true); - bool HideNativeCaret() { return ShowNativeCaret(false); } - - // Implementation from now on - // -------------------------- - - virtual void SetWindowStyleFlag(long style); - - virtual void Command(wxCommandEvent& event); - virtual bool MSWCommand(WXUINT param, WXWORD id); - virtual WXHBRUSH MSWControlColor(WXHDC hDC, WXHWND hWnd); - -#if wxUSE_RICHEDIT - virtual bool MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result); - - int GetRichVersion() const { return m_verRichEdit; } - bool IsRich() const { return m_verRichEdit != 0; } - - // rich edit controls are not compatible with normal ones and wem ust set - // the colours for them otherwise - virtual bool SetBackgroundColour(const wxColour& colour); - virtual bool SetForegroundColour(const wxColour& colour); -#else - bool IsRich() const { return false; } -#endif // wxUSE_RICHEDIT - -#if wxUSE_INKEDIT && wxUSE_RICHEDIT - bool IsInkEdit() const { return m_isInkEdit != 0; } -#else - bool IsInkEdit() const { return false; } -#endif - - virtual void AdoptAttributesFromHWND(); - - 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 OnDelete(wxCommandEvent& event); - void OnSelectAll(wxCommandEvent& event); - - void OnUpdateCut(wxUpdateUIEvent& event); - void OnUpdateCopy(wxUpdateUIEvent& event); - void OnUpdatePaste(wxUpdateUIEvent& event); - void OnUpdateUndo(wxUpdateUIEvent& event); - void OnUpdateRedo(wxUpdateUIEvent& event); - void OnUpdateDelete(wxUpdateUIEvent& event); - void OnUpdateSelectAll(wxUpdateUIEvent& event); - - // Show a context menu for Rich Edit controls (the standard - // EDIT control has one already) - void OnContextMenu(wxContextMenuEvent& event); - - // be sure the caret remains invisible if the user - // called HideNativeCaret() before - void OnSetFocus(wxFocusEvent& event); - - // intercept WM_GETDLGCODE - virtual WXLRESULT MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam); - - virtual bool MSWShouldPreProcessMessage(WXMSG* pMsg); - virtual WXDWORD MSWGetStyle(long style, WXDWORD *exstyle) const; - virtual wxVisualAttributes GetDefaultAttributes() const; - -protected: - // common part of all ctors - void Init(); - - // creates the control of appropriate class (plain or rich edit) with the - // styles corresponding to m_windowStyle - // - // this is used by ctor/Create() and when we need to recreate the control - // later - bool MSWCreateText(const wxString& value, - const wxPoint& pos, - const wxSize& size); - - virtual void DoSetValue(const wxString &value, int flags = 0); - - // return true if this control has a user-set limit on amount of text (i.e. - // the limit is due to a previous call to SetMaxLength() and not built in) - bool HasSpaceLimit(unsigned int *len) const; - - // call this to increase the size limit (will do nothing if the current - // limit is big enough) - // - // returns true if we increased the limit to allow entering more text, - // false if we hit the limit set by SetMaxLength() and so didn't change it - bool AdjustSpaceLimit(); - -#if wxUSE_RICHEDIT && (!wxUSE_UNICODE || wxUSE_UNICODE_MSLU) - // replace the selection or the entire control contents with the given text - // in the specified encoding - bool StreamIn(const wxString& value, wxFontEncoding encoding, bool selOnly); - - // get the contents of the control out as text in the given encoding - wxString StreamOut(wxFontEncoding encoding, bool selOnly = false) const; -#endif // wxUSE_RICHEDIT - - // replace the contents of the selection or of the entire control with the - // given text - void DoWriteText(const wxString& text, - int flags = SetValue_SendEvent | SetValue_SelectionOnly); - - // set the selection possibly without scrolling the caret into view - void DoSetSelection(long from, long to, bool scrollCaret = true); - - // return true if there is a non empty selection in the control - bool HasSelection() const; - - // get the length of the line containing the character at the given - // position - long GetLengthOfLineContainingPos(long pos) const; - - // send TEXT_UPDATED event, return true if it was handled, false otherwise - bool SendUpdateEvent(); - - virtual wxSize DoGetBestSize() const; - -#if wxUSE_RICHEDIT - // we're using RICHEDIT (and not simple EDIT) control if this field is not - // 0, it also gives the version of the RICHEDIT control being used (1, 2 or - // 3 so far) - int m_verRichEdit; -#endif // wxUSE_RICHEDIT - - // number of EN_UPDATE events sent by Windows when we change the controls - // text ourselves: we want this to be exactly 1 - int m_updatesCount; - -private: - void OnKeyDown(wxKeyEvent& event); - - DECLARE_EVENT_TABLE() - DECLARE_DYNAMIC_CLASS_NO_COPY(wxTextCtrl) - - wxMenu* m_privateContextMenu; - - bool m_isNativeCaretShown; - -#if wxUSE_INKEDIT && wxUSE_RICHEDIT - int m_isInkEdit; -#endif - -}; - -#endif - // _WX_TEXTCTRL_H_ diff --git a/wxWidgets/include/wx/msw/tglbtn.h b/wxWidgets/include/wx/msw/tglbtn.h deleted file mode 100644 index 0c5d1c46dc..0000000000 --- a/wxWidgets/include/wx/msw/tglbtn.h +++ /dev/null @@ -1,60 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/msw/tglbtn.h -// Purpose: Declaration of the wxToggleButton class, which implements a -// toggle button under wxMSW. -// Author: John Norris, minor changes by Axel Schlueter -// Modified by: -// Created: 08.02.01 -// RCS-ID: $Id: tglbtn.h 37393 2006-02-08 21:47:09Z VZ $ -// Copyright: (c) 2000 Johnny C. Norris II -// License: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_TOGGLEBUTTON_H_ -#define _WX_TOGGLEBUTTON_H_ - -extern WXDLLEXPORT_DATA(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 bool MSWCommand(WXUINT param, WXWORD id); - virtual void Command(wxCommandEvent& event); - virtual WXDWORD MSWGetStyle(long flags, WXDWORD *exstyle = NULL) const; - -protected: - virtual wxSize DoGetBestSize() const; - virtual wxBorder GetDefaultBorder() const; - -private: - DECLARE_DYNAMIC_CLASS_NO_COPY(wxToggleButton) -}; - -#endif // _WX_TOGGLEBUTTON_H_ - diff --git a/wxWidgets/include/wx/msw/timer.h b/wxWidgets/include/wx/msw/timer.h deleted file mode 100644 index 449543300a..0000000000 --- a/wxWidgets/include/wx/msw/timer.h +++ /dev/null @@ -1,40 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: timer.h -// Purpose: wxTimer class -// Author: Julian Smart -// Modified by: -// Created: 01/02/97 -// RCS-ID: $Id: timer.h 41020 2006-09-05 20:47:48Z VZ $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_TIMER_H_ -#define _WX_TIMER_H_ - -class WXDLLEXPORT wxTimer : public wxTimerBase -{ -friend void wxProcessTimer(wxTimer& timer); - -public: - wxTimer() { Init(); } - wxTimer(wxEvtHandler *owner, int id = wxID_ANY) : wxTimerBase(owner, id) - { Init(); } - virtual ~wxTimer(); - - virtual bool Start(int milliseconds = -1, bool oneShot = false); - virtual void Stop(); - - virtual bool IsRunning() const { return m_id != 0; } - -protected: - void Init(); - - unsigned long m_id; - -private: - DECLARE_DYNAMIC_CLASS_NO_COPY(wxTimer) -}; - -#endif - // _WX_TIMERH_ diff --git a/wxWidgets/include/wx/msw/tooltip.h b/wxWidgets/include/wx/msw/tooltip.h deleted file mode 100644 index 5da413c7bd..0000000000 --- a/wxWidgets/include/wx/msw/tooltip.h +++ /dev/null @@ -1,71 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: wx/msw/tooltip.h -// Purpose: wxToolTip class - tooltip control -// Author: Vadim Zeitlin -// Modified by: -// Created: 31.01.99 -// RCS-ID: $Id: tooltip.h 49563 2007-10-31 20:46:21Z VZ $ -// Copyright: (c) 1999 Robert Roebling, Vadim Zeitlin -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_MSW_TOOLTIP_H_ -#define _WX_MSW_TOOLTIP_H_ - -#include "wx/object.h" - -class WXDLLIMPEXP_FWD_CORE wxWindow; - -class WXDLLEXPORT 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); - - // implementation only from now on - // ------------------------------- - - // should be called in responde to WM_MOUSEMOVE - static void RelayEvent(WXMSG *msg); - - // add a window to the tooltip control - void Add(WXHWND hwnd); - - // remove any tooltip from the window - static void Remove(WXHWND hwnd); - -private: - // the one and only one tooltip control we use - never access it directly - // but use GetToolTipCtrl() which will create it when needed - static WXHWND ms_hwndTT; - - // create the tooltip ctrl if it doesn't exist yet and return its HWND - static WXHWND GetToolTipCtrl(); - - // remove this tooltip from the tooltip control - void Remove(); - - wxString m_text; // tooltip text - wxWindow *m_window; // window we're associated with - - DECLARE_ABSTRACT_CLASS(wxToolTip) - DECLARE_NO_COPY_CLASS(wxToolTip) -}; - -#endif // _WX_MSW_TOOLTIP_H_ diff --git a/wxWidgets/include/wx/msw/toplevel.h b/wxWidgets/include/wx/msw/toplevel.h deleted file mode 100644 index dd86f41df3..0000000000 --- a/wxWidgets/include/wx/msw/toplevel.h +++ /dev/null @@ -1,197 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: wx/msw/toplevel.h -// Purpose: wxTopLevelWindowMSW is the MSW implementation of wxTLW -// Author: Vadim Zeitlin -// Modified by: -// Created: 20.09.01 -// RCS-ID: $Id: toplevel.h 50999 2008-01-03 01:13:44Z VZ $ -// Copyright: (c) 2001 SciTech Software, Inc. (www.scitechsoft.com) -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_MSW_TOPLEVEL_H_ -#define _WX_MSW_TOPLEVEL_H_ - -// ---------------------------------------------------------------------------- -// wxTopLevelWindowMSW -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxTopLevelWindowMSW : public wxTopLevelWindowBase -{ -public: - // constructors and such - wxTopLevelWindowMSW() { Init(); } - - wxTopLevelWindowMSW(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 ~wxTopLevelWindowMSW(); - - // implement base class pure virtuals - virtual void SetTitle( const wxString& title); - virtual wxString GetTitle() const; - 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 ); - virtual void Restore(); - - virtual void SetLayoutDirection(wxLayoutDirection dir); - -#ifndef __WXWINCE__ - virtual bool SetShape(const wxRegion& region); -#endif // __WXWINCE__ - virtual void RequestUserAttention(int flags = wxUSER_ATTENTION_INFO); - - virtual bool Show(bool show = true); - - virtual bool ShowFullScreen(bool show, long style = wxFULLSCREEN_ALL); - virtual bool IsFullScreen() const { return m_fsIsShowing; } - - // wxMSW only: EnableCloseButton(false) may be used to remove the "Close" - // button from the title bar - virtual bool EnableCloseButton(bool enable = true); - - // Set window transparency if the platform supports it - virtual bool SetTransparent(wxByte alpha); - virtual bool CanSetTransparent(); - - - // implementation from now on - // -------------------------- - - // event handlers - void OnActivate(wxActivateEvent& event); - - // called by wxWindow whenever it gets focus - void SetLastFocus(wxWindow *win) { m_winLastFocused = win; } - wxWindow *GetLastFocus() const { return m_winLastFocused; } - -#if defined(__SMARTPHONE__) && defined(__WXWINCE__) - virtual void SetLeftMenu(int id = wxID_ANY, const wxString& label = wxEmptyString, wxMenu *subMenu = NULL); - virtual void SetRightMenu(int id = wxID_ANY, const wxString& label = wxEmptyString, wxMenu *subMenu = NULL); - bool HandleCommand(WXWORD id, WXWORD cmd, WXHWND control); - virtual bool MSWShouldPreProcessMessage(WXMSG* pMsg); -#endif // __SMARTPHONE__ && __WXWINCE__ - -#if defined(__SMARTPHONE__) || defined(__POCKETPC__) - // Soft Input Panel (SIP) change notification - virtual bool HandleSettingChange(WXWPARAM wParam, WXLPARAM lParam); -#endif - - // translate wxWidgets flags to Windows ones - virtual WXDWORD MSWGetStyle(long flags, WXDWORD *exstyle) const; - - // choose the right parent to use with CreateWindow() - virtual WXHWND MSWGetParent() const; - - // window proc for the frames - WXLRESULT MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lParam); - -protected: - // common part of all ctors - void Init(); - - // create a new frame, return false if it couldn't be created - bool CreateFrame(const wxString& title, - const wxPoint& pos, - const wxSize& size); - - // create a new dialog using the given dialog template from resources, - // return false if it couldn't be created - bool CreateDialog(const void *dlgTemplate, - const wxString& title, - const wxPoint& pos, - const wxSize& size); - - // common part of Iconize(), Maximize() and Restore() - void DoShowWindow(int nShowCmd); - - // is the window 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; - - // Data to save/restore when calling ShowFullScreen - long m_fsStyle; // Passed to ShowFullScreen - wxRect m_fsOldSize; - long m_fsOldWindowStyle; - bool m_fsIsMaximized; - bool m_fsIsShowing; - - // the last focused child: we restore focus to it on activation - wxWindow *m_winLastFocused; - -#if defined(__SMARTPHONE__) && defined(__WXWINCE__) - class ButtonMenu - { - public: - ButtonMenu(); - ~ButtonMenu(); - - void SetButton(int id = wxID_ANY, - const wxString& label = wxEmptyString, - wxMenu *subMenu = NULL); - - bool IsAssigned() const {return m_assigned;} - bool IsMenu() const {return m_menu!=NULL;} - - int GetId() const {return m_id;} - wxMenu* GetMenu() const {return m_menu;} - wxString GetLabel() {return m_label;} - - static wxMenu *DuplicateMenu(wxMenu *menu); - - protected: - int m_id; - wxString m_label; - wxMenu *m_menu; - bool m_assigned; - }; - - ButtonMenu m_LeftButton; - ButtonMenu m_RightButton; - HWND m_MenuBarHWND; - - void ReloadButton(ButtonMenu& button, UINT menuID); - void ReloadAllButtons(); -#endif // __SMARTPHONE__ && __WXWINCE__ - -private: - // helper of SetIcons(): calls gets the icon with the size specified by the - // given system metrics (SM_C{X|Y}[SM]ICON) from the bundle and sets it - // using WM_SETICON with the specified wParam (ICOM_SMALL or ICON_BIG) - void DoSelectAndSetIcon(const wxIconBundle& icons, int smX, int smY, int i); - - -#if defined(__SMARTPHONE__) || defined(__POCKETPC__) - void* m_activateInfo; -#endif - - DECLARE_EVENT_TABLE() - DECLARE_NO_COPY_CLASS(wxTopLevelWindowMSW) -}; - -#endif // _WX_MSW_TOPLEVEL_H_ diff --git a/wxWidgets/include/wx/msw/treectrl.h b/wxWidgets/include/wx/msw/treectrl.h deleted file mode 100644 index f3bf13b5e5..0000000000 --- a/wxWidgets/include/wx/msw/treectrl.h +++ /dev/null @@ -1,315 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/msw/treectrl.h -// Purpose: wxTreeCtrl class -// Author: Julian Smart -// Modified by: Vadim Zeitlin to be less MSW-specific on 10/10/98 -// Created: 01/02/97 -// RCS-ID: $Id: treectrl.h 49563 2007-10-31 20:46:21Z VZ $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_MSW_TREECTRL_H_ -#define _WX_MSW_TREECTRL_H_ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -#if wxUSE_TREECTRL - -#include "wx/textctrl.h" -#include "wx/dynarray.h" -#include "wx/treebase.h" -#include "wx/hashmap.h" - -#ifdef __GNUWIN32__ - // Cygwin windows.h defines these identifiers - #undef GetFirstChild - #undef GetNextSibling -#endif // Cygwin - -// fwd decl -class WXDLLIMPEXP_FWD_CORE wxImageList; -class WXDLLIMPEXP_FWD_CORE wxDragImage; -struct WXDLLIMPEXP_FWD_CORE wxTreeViewItem; - -#if WXWIN_COMPATIBILITY_2_6 - // NB: all the following flags are for compatbility only and will be removed in the - // next versions - // flags for deprecated InsertItem() variant (their values are the same as of - // TVI_FIRST and TVI_LAST) - #define wxTREE_INSERT_FIRST 0xFFFF0001 - #define wxTREE_INSERT_LAST 0xFFFF0002 -#endif - -// hash storing attributes for our items -WX_DECLARE_EXPORTED_VOIDPTR_HASH_MAP(wxTreeItemAttr *, wxMapTreeAttr); - -// ---------------------------------------------------------------------------- -// wxTreeCtrl -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxTreeCtrl : public wxTreeCtrlBase -{ -public: - // creation - // -------- - wxTreeCtrl() { Init(); } - - wxTreeCtrl(wxWindow *parent, wxWindowID id = wxID_ANY, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = wxTR_HAS_BUTTONS | wxTR_LINES_AT_ROOT, - const wxValidator& validator = wxDefaultValidator, - const wxString& name = wxTreeCtrlNameStr) - { - Create(parent, id, pos, size, style, validator, name); - } - - virtual ~wxTreeCtrl(); - - bool Create(wxWindow *parent, wxWindowID id = wxID_ANY, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = wxTR_HAS_BUTTONS | wxTR_LINES_AT_ROOT, - const wxValidator& validator = wxDefaultValidator, - const wxString& name = wxTreeCtrlNameStr); - - // implement base class pure virtuals - // ---------------------------------- - - virtual unsigned int GetCount() const; - - virtual unsigned int GetIndent() const; - virtual void SetIndent(unsigned int indent); - - virtual void SetImageList(wxImageList *imageList); - virtual void SetStateImageList(wxImageList *imageList); - - virtual wxString GetItemText(const wxTreeItemId& item) const; - virtual int GetItemImage(const wxTreeItemId& item, - wxTreeItemIcon which = wxTreeItemIcon_Normal) const; - virtual wxTreeItemData *GetItemData(const wxTreeItemId& item) const; - virtual wxColour GetItemTextColour(const wxTreeItemId& item) const; - virtual wxColour GetItemBackgroundColour(const wxTreeItemId& item) const; - virtual wxFont GetItemFont(const wxTreeItemId& item) const; - - virtual void SetItemText(const wxTreeItemId& item, const wxString& text); - virtual void SetItemImage(const wxTreeItemId& item, int image, - wxTreeItemIcon which = wxTreeItemIcon_Normal); - virtual void SetItemData(const wxTreeItemId& item, wxTreeItemData *data); - virtual void SetItemHasChildren(const wxTreeItemId& item, bool has = true); - virtual void SetItemBold(const wxTreeItemId& item, bool bold = true); - virtual void SetItemDropHighlight(const wxTreeItemId& item, - bool highlight = true); - virtual void SetItemTextColour(const wxTreeItemId& item, - const wxColour& col); - virtual void SetItemBackgroundColour(const wxTreeItemId& item, - const wxColour& col); - virtual void SetItemFont(const wxTreeItemId& item, const wxFont& font); - - // item status inquiries - // --------------------- - - virtual bool IsVisible(const wxTreeItemId& item) const; - virtual bool ItemHasChildren(const wxTreeItemId& item) const; - virtual bool IsExpanded(const wxTreeItemId& item) const; - virtual bool IsSelected(const wxTreeItemId& item) const; - virtual bool IsBold(const wxTreeItemId& item) const; - - virtual size_t GetChildrenCount(const wxTreeItemId& item, - bool recursively = true) const; - - // navigation - // ---------- - - virtual wxTreeItemId GetRootItem() const; - virtual wxTreeItemId GetSelection() const; - virtual size_t GetSelections(wxArrayTreeItemIds& selections) const; - - virtual wxTreeItemId GetItemParent(const wxTreeItemId& item) const; - virtual wxTreeItemId GetFirstChild(const wxTreeItemId& item, - wxTreeItemIdValue& cookie) const; - virtual wxTreeItemId GetNextChild(const wxTreeItemId& item, - wxTreeItemIdValue& cookie) const; - virtual wxTreeItemId GetLastChild(const wxTreeItemId& item) const; - - virtual wxTreeItemId GetNextSibling(const wxTreeItemId& item) const; - virtual wxTreeItemId GetPrevSibling(const wxTreeItemId& item) const; - - virtual wxTreeItemId GetFirstVisibleItem() const; - virtual wxTreeItemId GetNextVisible(const wxTreeItemId& item) const; - virtual wxTreeItemId GetPrevVisible(const wxTreeItemId& item) const; - - // operations - // ---------- - - virtual wxTreeItemId AddRoot(const wxString& text, - int image = -1, int selectedImage = -1, - wxTreeItemData *data = NULL); - - virtual void Delete(const wxTreeItemId& item); - virtual void DeleteChildren(const wxTreeItemId& item); - virtual void DeleteAllItems(); - - virtual void Expand(const wxTreeItemId& item); - virtual void Collapse(const wxTreeItemId& item); - virtual void CollapseAndReset(const wxTreeItemId& item); - virtual void Toggle(const wxTreeItemId& item); - - virtual void Unselect(); - virtual void UnselectAll(); - virtual void SelectItem(const wxTreeItemId& item, bool select = true); - - virtual void EnsureVisible(const wxTreeItemId& item); - virtual void ScrollTo(const wxTreeItemId& item); - - virtual wxTextCtrl *EditLabel(const wxTreeItemId& item, - wxClassInfo* textCtrlClass = CLASSINFO(wxTextCtrl)); - virtual wxTextCtrl *GetEditControl() const; - virtual void EndEditLabel(const wxTreeItemId& WXUNUSED(item), - bool discardChanges = false) - { - DoEndEditLabel(discardChanges); - } - - virtual void SortChildren(const wxTreeItemId& item); - - virtual bool GetBoundingRect(const wxTreeItemId& item, - wxRect& rect, - bool textOnly = false) const; - - // deprecated - // ---------- - -#if WXWIN_COMPATIBILITY_2_4 - // these methods are deprecated and will be removed in future versions of - // wxWidgets, they're here for compatibility only, don't use them in new - // code (the comments indicate why these methods are now useless and how to - // replace them) - - // use Expand, Collapse, CollapseAndReset or Toggle - wxDEPRECATED( void ExpandItem(const wxTreeItemId& item, int action) ); - - // use Set/GetImageList and Set/GetStateImageList - // Use base class GetImageList() - wxDEPRECATED( void SetImageList(wxImageList *imageList, int) ); - - // use Set/GetItemImage directly - wxDEPRECATED( int GetItemSelectedImage(const wxTreeItemId& item) const ); - wxDEPRECATED( void SetItemSelectedImage(const wxTreeItemId& item, int image) ); - - // use the versions taking wxTreeItemIdValue cookies - wxDEPRECATED( wxTreeItemId GetFirstChild(const wxTreeItemId& item, - long& cookie) const ); - wxDEPRECATED( wxTreeItemId GetNextChild(const wxTreeItemId& item, - long& cookie) const ); -#endif // WXWIN_COMPATIBILITY_2_4 - - - // implementation - // -------------- - - virtual wxVisualAttributes GetDefaultAttributes() const - { - return GetClassDefaultAttributes(GetWindowVariant()); - } - - static wxVisualAttributes - GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL); - - - virtual WXLRESULT MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam); - virtual WXLRESULT MSWDefWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam); - virtual bool MSWCommand(WXUINT param, WXWORD id); - virtual bool MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result); - virtual bool MSWShouldPreProcessMessage(WXMSG* msg); - - // override some base class virtuals - virtual bool SetBackgroundColour(const wxColour &colour); - virtual bool SetForegroundColour(const wxColour &colour); - - // get/set the check state for the item (only for wxTR_MULTIPLE) - bool IsItemChecked(const wxTreeItemId& item) const; - void SetItemCheck(const wxTreeItemId& item, bool check = true); - - // set/get the item state.image (state == -1 means cycle to the next one) - void SetState(const wxTreeItemId& node, int state); - int GetState(const wxTreeItemId& node); - -protected: - // SetImageList helper - void SetAnyImageList(wxImageList *imageList, int which); - - // refresh a single item - void RefreshItem(const wxTreeItemId& item); - - // end edit label - void DoEndEditLabel(bool discardChanges = false); - - virtual wxTreeItemId DoInsertItem(const wxTreeItemId& parent, - size_t pos, - const wxString& text, - int image, int selectedImage, - wxTreeItemData *data); - virtual wxTreeItemId DoInsertAfter(const wxTreeItemId& parent, - const wxTreeItemId& idPrevious, - const wxString& text, - int image = -1, int selImage = -1, - wxTreeItemData *data = NULL); - virtual wxTreeItemId DoTreeHitTest(const wxPoint& point, int& flags) const; - - // obtain the user data for the lParam member of TV_ITEM - class wxTreeItemParam *GetItemParam(const wxTreeItemId& item) const; - - - // data used only while editing the item label: - wxTextCtrl *m_textCtrl; // text control in which it is edited - wxTreeItemId m_idEdited; // the item being edited - -private: - // the common part of all ctors - void Init(); - - // helper functions - bool DoGetItem(wxTreeViewItem *tvItem) const; - void DoSetItem(wxTreeViewItem *tvItem); - - void DoExpand(const wxTreeItemId& item, int flag); - - void DeleteTextCtrl(); - - // return true if the item is the hidden root one (i.e. it's the root item - // and the tree has wxTR_HIDE_ROOT style) - bool IsHiddenRoot(const wxTreeItemId& item) const; - - - // the hash storing the items attributes (indexed by item ids) - wxMapTreeAttr m_attrs; - - // true if the hash above is not empty - bool m_hasAnyAttr; - -#if wxUSE_DRAGIMAGE - // used for dragging - wxDragImage *m_dragImage; -#endif - - // Virtual root item, if wxTR_HIDE_ROOT is set. - void* m_pVirtualRoot; - - // the starting item for selection with Shift - wxTreeItemId m_htSelStart, m_htClickedItem; - wxPoint m_ptClick; - - friend class wxTreeItemIndirectData; - friend class wxTreeSortHelper; - - DECLARE_DYNAMIC_CLASS(wxTreeCtrl) - DECLARE_NO_COPY_CLASS(wxTreeCtrl) -}; - -#endif // wxUSE_TREECTRL - -#endif // _WX_MSW_TREECTRL_H_ diff --git a/wxWidgets/include/wx/msw/uxtheme.h b/wxWidgets/include/wx/msw/uxtheme.h deleted file mode 100644 index ba64a87b50..0000000000 --- a/wxWidgets/include/wx/msw/uxtheme.h +++ /dev/null @@ -1,230 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: include/wx/msw/uxtheme.h -// Purpose: wxUxThemeEngine class: support for XP themes -// Author: John Platts, Vadim Zeitlin -// Modified by: -// Created: 2003 -// RCS-ID: $Id: uxtheme.h 42725 2006-10-30 15:37:42Z VZ $ -// Copyright: (c) 2003 John Platts, Vadim Zeitlin -// License: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_UXTHEME_H_ -#define _WX_UXTHEME_H_ - -#include "wx/defs.h" - -#include "wx/msw/private.h" // we use GetHwndOf() -#include "wx/msw/uxthemep.h" - -typedef HTHEME (__stdcall *PFNWXUOPENTHEMEDATA)(HWND, const wchar_t *); -typedef HRESULT (__stdcall *PFNWXUCLOSETHEMEDATA)(HTHEME); -typedef HRESULT (__stdcall *PFNWXUDRAWTHEMEBACKGROUND)(HTHEME, HDC, int, int, const RECT *, const RECT *); -typedef HRESULT (__stdcall *PFNWXUDRAWTHEMETEXT)(HTHEME, HDC, int, int, const wchar_t *, int, DWORD, DWORD, const RECT *); -typedef HRESULT (__stdcall *PFNWXUGETTHEMEBACKGROUNDCONTENTRECT)(HTHEME, HDC, int, int, const RECT *, RECT *); -typedef HRESULT (__stdcall *PFNWXUGETTHEMEBACKGROUNDEXTENT)(HTHEME, HDC, int, int, const RECT *, RECT *); -typedef HRESULT (__stdcall *PFNWXUGETTHEMEPARTSIZE)(HTHEME, HDC, int, int, const RECT *, /* enum */ THEMESIZE, SIZE *); -typedef HRESULT (__stdcall *PFNWXUGETTHEMETEXTEXTENT)(HTHEME, HDC, int, int, const wchar_t *, int, DWORD, const RECT *, RECT *); -typedef HRESULT (__stdcall *PFNWXUGETTHEMETEXTMETRICS)(HTHEME, HDC, int, int, TEXTMETRIC*); -typedef HRESULT (__stdcall *PFNWXUGETTHEMEBACKGROUNDREGION)(HTHEME, HDC, int, int, const RECT *, HRGN *); -typedef HRESULT (__stdcall *PFNWXUHITTESTTHEMEBACKGROUND)(HTHEME, HDC, int, int, DWORD, const RECT *, HRGN, POINT, unsigned short *); -typedef HRESULT (__stdcall *PFNWXUDRAWTHEMEEDGE)(HTHEME, HDC, int, int, const RECT *, unsigned int, unsigned int, RECT *); -typedef HRESULT (__stdcall *PFNWXUDRAWTHEMEICON)(HTHEME, HDC, int, int, const RECT *, HIMAGELIST, int); -typedef BOOL (__stdcall *PFNWXUISTHEMEPARTDEFINED)(HTHEME, int, int); -typedef BOOL (__stdcall *PFNWXUISTHEMEBACKGROUNDPARTIALLYTRANSPARENT)(HTHEME, int, int); -typedef HRESULT (__stdcall *PFNWXUGETTHEMECOLOR)(HTHEME, int, int, int, COLORREF*); -typedef HRESULT (__stdcall *PFNWXUGETTHEMEMETRIC)(HTHEME, HDC, int, int, int, int *); -typedef HRESULT (__stdcall *PFNWXUGETTHEMESTRING)(HTHEME, int, int, int, wchar_t *, int); -typedef HRESULT (__stdcall *PFNWXUGETTHEMEBOOL)(HTHEME, int, int, int, BOOL *); -typedef HRESULT (__stdcall *PFNWXUGETTHEMEINT)(HTHEME, int, int, int, int *); -typedef HRESULT (__stdcall *PFNWXUGETTHEMEENUMVALUE)(HTHEME, int, int, int, int *); -typedef HRESULT (__stdcall *PFNWXUGETTHEMEPOSITION)(HTHEME, int, int, int, POINT *); -typedef HRESULT (__stdcall *PFNWXUGETTHEMEFONT)(HTHEME, HDC, int, int, int, LOGFONT *); -typedef HRESULT (__stdcall *PFNWXUGETTHEMERECT)(HTHEME, int, int, int, RECT *); -typedef HRESULT (__stdcall *PFNWXUGETTHEMEMARGINS)(HTHEME, HDC, int, int, int, RECT *, MARGINS *); -typedef HRESULT (__stdcall *PFNWXUGETTHEMEINTLIST)(HTHEME, int, int, int, INTLIST*); -typedef HRESULT (__stdcall *PFNWXUGETTHEMEPROPERTYORIGIN)(HTHEME, int, int, int, /* enum */ PROPERTYORIGIN *); -typedef HRESULT (__stdcall *PFNWXUSETWINDOWTHEME)(HWND, const wchar_t*, const wchar_t *); -typedef HRESULT (__stdcall *PFNWXUGETTHEMEFILENAME)(HTHEME, int, int, int, wchar_t *, int); -typedef COLORREF(__stdcall *PFNWXUGETTHEMESYSCOLOR)(HTHEME, int); -typedef HBRUSH (__stdcall *PFNWXUGETTHEMESYSCOLORBRUSH)(HTHEME, int); -typedef BOOL (__stdcall *PFNWXUGETTHEMESYSBOOL)(HTHEME, int); -typedef int (__stdcall *PFNWXUGETTHEMESYSSIZE)(HTHEME, int); -typedef HRESULT (__stdcall *PFNWXUGETTHEMESYSFONT)(HTHEME, int, LOGFONT *); -typedef HRESULT (__stdcall *PFNWXUGETTHEMESYSSTRING)(HTHEME, int, wchar_t *, int); -typedef HRESULT (__stdcall *PFNWXUGETTHEMESYSINT)(HTHEME, int, int *); -typedef BOOL (__stdcall *PFNWXUISTHEMEACTIVE)(); -typedef BOOL (__stdcall *PFNWXUISAPPTHEMED)(); -typedef HTHEME (__stdcall *PFNWXUGETWINDOWTHEME)(HWND); -typedef HRESULT (__stdcall *PFNWXUENABLETHEMEDIALOGTEXTURE)(HWND, DWORD); -typedef BOOL (__stdcall *PFNWXUISTHEMEDIALOGTEXTUREENABLED)(HWND); -typedef DWORD (__stdcall *PFNWXUGETTHEMEAPPPROPERTIES)(); -typedef void (__stdcall *PFNWXUSETTHEMEAPPPROPERTIES)(DWORD); -typedef HRESULT (__stdcall *PFNWXUGETCURRENTTHEMENAME)(wchar_t *, int, wchar_t *, int, wchar_t *, int); -typedef HRESULT (__stdcall *PFNWXUGETTHEMEDOCUMENTATIONPROPERTY)(const wchar_t *, const wchar_t *, wchar_t *, int); -typedef HRESULT (__stdcall *PFNWXUDRAWTHEMEPARENTBACKGROUND)(HWND, HDC, RECT *); -typedef HRESULT (__stdcall *PFNWXUENABLETHEMING)(BOOL); - -// ---------------------------------------------------------------------------- -// wxUxThemeEngine: provides all theme functions from uxtheme.dll -// ---------------------------------------------------------------------------- - -// we always define this class, even if wxUSE_UXTHEME == 0, but we just make it -// empty in this case -- this allows to use it elsewhere without any #ifdefs -#if wxUSE_UXTHEME - #include "wx/dynlib.h" - - #define wxUX_THEME_DECLARE(type, func) type func; -#else - #define wxUX_THEME_DECLARE(type, func) type func(...) { return 0; } -#endif - -class WXDLLEXPORT wxUxThemeEngine -{ -public: - // get the theme engine or NULL if themes are not available - static wxUxThemeEngine *Get(); - - // get the theme enging or NULL if themes are not available or not used for - // this application - static wxUxThemeEngine *GetIfActive(); - - // all uxtheme.dll functions - wxUX_THEME_DECLARE(PFNWXUOPENTHEMEDATA, OpenThemeData) - wxUX_THEME_DECLARE(PFNWXUCLOSETHEMEDATA, CloseThemeData) - wxUX_THEME_DECLARE(PFNWXUDRAWTHEMEBACKGROUND, DrawThemeBackground) - wxUX_THEME_DECLARE(PFNWXUDRAWTHEMETEXT, DrawThemeText) - wxUX_THEME_DECLARE(PFNWXUGETTHEMEBACKGROUNDCONTENTRECT, GetThemeBackgroundContentRect) - wxUX_THEME_DECLARE(PFNWXUGETTHEMEBACKGROUNDEXTENT, GetThemeBackgroundExtent) - wxUX_THEME_DECLARE(PFNWXUGETTHEMEPARTSIZE, GetThemePartSize) - wxUX_THEME_DECLARE(PFNWXUGETTHEMETEXTEXTENT, GetThemeTextExtent) - wxUX_THEME_DECLARE(PFNWXUGETTHEMETEXTMETRICS, GetThemeTextMetrics) - wxUX_THEME_DECLARE(PFNWXUGETTHEMEBACKGROUNDREGION, GetThemeBackgroundRegion) - wxUX_THEME_DECLARE(PFNWXUHITTESTTHEMEBACKGROUND, HitTestThemeBackground) - wxUX_THEME_DECLARE(PFNWXUDRAWTHEMEEDGE, DrawThemeEdge) - wxUX_THEME_DECLARE(PFNWXUDRAWTHEMEICON, DrawThemeIcon) - wxUX_THEME_DECLARE(PFNWXUISTHEMEPARTDEFINED, IsThemePartDefined) - wxUX_THEME_DECLARE(PFNWXUISTHEMEBACKGROUNDPARTIALLYTRANSPARENT, IsThemeBackgroundPartiallyTransparent) - wxUX_THEME_DECLARE(PFNWXUGETTHEMECOLOR, GetThemeColor) - wxUX_THEME_DECLARE(PFNWXUGETTHEMEMETRIC, GetThemeMetric) - wxUX_THEME_DECLARE(PFNWXUGETTHEMESTRING, GetThemeString) - wxUX_THEME_DECLARE(PFNWXUGETTHEMEBOOL, GetThemeBool) - wxUX_THEME_DECLARE(PFNWXUGETTHEMEINT, GetThemeInt) - wxUX_THEME_DECLARE(PFNWXUGETTHEMEENUMVALUE, GetThemeEnumValue) - wxUX_THEME_DECLARE(PFNWXUGETTHEMEPOSITION, GetThemePosition) - wxUX_THEME_DECLARE(PFNWXUGETTHEMEFONT, GetThemeFont) - wxUX_THEME_DECLARE(PFNWXUGETTHEMERECT, GetThemeRect) - wxUX_THEME_DECLARE(PFNWXUGETTHEMEMARGINS, GetThemeMargins) - wxUX_THEME_DECLARE(PFNWXUGETTHEMEINTLIST, GetThemeIntList) - wxUX_THEME_DECLARE(PFNWXUGETTHEMEPROPERTYORIGIN, GetThemePropertyOrigin) - wxUX_THEME_DECLARE(PFNWXUSETWINDOWTHEME, SetWindowTheme) - wxUX_THEME_DECLARE(PFNWXUGETTHEMEFILENAME, GetThemeFilename) - wxUX_THEME_DECLARE(PFNWXUGETTHEMESYSCOLOR, GetThemeSysColor) - wxUX_THEME_DECLARE(PFNWXUGETTHEMESYSCOLORBRUSH, GetThemeSysColorBrush) - wxUX_THEME_DECLARE(PFNWXUGETTHEMESYSBOOL, GetThemeSysBool) - wxUX_THEME_DECLARE(PFNWXUGETTHEMESYSSIZE, GetThemeSysSize) - wxUX_THEME_DECLARE(PFNWXUGETTHEMESYSFONT, GetThemeSysFont) - wxUX_THEME_DECLARE(PFNWXUGETTHEMESYSSTRING, GetThemeSysString) - wxUX_THEME_DECLARE(PFNWXUGETTHEMESYSINT, GetThemeSysInt) - wxUX_THEME_DECLARE(PFNWXUISTHEMEACTIVE, IsThemeActive) - wxUX_THEME_DECLARE(PFNWXUISAPPTHEMED, IsAppThemed) - wxUX_THEME_DECLARE(PFNWXUGETWINDOWTHEME, GetWindowTheme) - wxUX_THEME_DECLARE(PFNWXUENABLETHEMEDIALOGTEXTURE, EnableThemeDialogTexture) - wxUX_THEME_DECLARE(PFNWXUISTHEMEDIALOGTEXTUREENABLED, IsThemeDialogTextureEnabled) - wxUX_THEME_DECLARE(PFNWXUGETTHEMEAPPPROPERTIES, GetThemeAppProperties) - wxUX_THEME_DECLARE(PFNWXUSETTHEMEAPPPROPERTIES, SetThemeAppProperties) - wxUX_THEME_DECLARE(PFNWXUGETCURRENTTHEMENAME, GetCurrentThemeName) - wxUX_THEME_DECLARE(PFNWXUGETTHEMEDOCUMENTATIONPROPERTY, GetThemeDocumentationProperty) - wxUX_THEME_DECLARE(PFNWXUDRAWTHEMEPARENTBACKGROUND, DrawThemeParentBackground) - wxUX_THEME_DECLARE(PFNWXUENABLETHEMING, EnableTheming) - -private: - // construcor is private as only Get() can create us and is also trivial as - // everything really happens in Initialize() - wxUxThemeEngine() { } - - // destructor is private as only Get() and wxUxThemeModule delete us, it is - // not virtual as we're not supposed to be derived from - ~wxUxThemeEngine() { } - -#if wxUSE_UXTHEME - // initialize the theme engine: load the DLL, resolve the functions - // - // return true if we can be used, false if themes are not available - bool Initialize(); - - - // uxtheme.dll - wxDynamicLibrary m_dllUxTheme; - - - // the one and only theme engine, initially NULL - static wxUxThemeEngine *ms_themeEngine; - - // this is a bool which initially has the value -1 meaning "unknown" - static int ms_isThemeEngineAvailable; - - // it must be able to delete us - friend class wxUxThemeModule; -#endif // wxUSE_UXTHEME - - DECLARE_NO_COPY_CLASS(wxUxThemeEngine) -}; - -#if wxUSE_UXTHEME - -/* static */ inline wxUxThemeEngine *wxUxThemeEngine::GetIfActive() -{ - wxUxThemeEngine *engine = Get(); - return engine && engine->IsAppThemed() && engine->IsThemeActive() - ? engine - : NULL; -} - -#else // !wxUSE_UXTHEME - -/* static */ inline wxUxThemeEngine *wxUxThemeEngine::Get() -{ - return NULL; -} - -/* static */ inline wxUxThemeEngine *wxUxThemeEngine::GetIfActive() -{ - return NULL; -} - -#endif // wxUSE_UXTHEME/!wxUSE_UXTHEME - -// ---------------------------------------------------------------------------- -// wxUxThemeHandle: encapsulates ::Open/CloseThemeData() -// ---------------------------------------------------------------------------- - -class wxUxThemeHandle -{ -public: - wxUxThemeHandle(const wxWindow *win, const wchar_t *classes) - { - wxUxThemeEngine *engine = wxUxThemeEngine::Get(); - - m_hTheme = engine ? (HTHEME)engine->OpenThemeData(GetHwndOf(win), classes) - : NULL; - } - - operator HTHEME() const { return m_hTheme; } - - ~wxUxThemeHandle() - { - if ( m_hTheme ) - { - wxUxThemeEngine::Get()->CloseThemeData(m_hTheme); - } - } - -private: - HTHEME m_hTheme; - - DECLARE_NO_COPY_CLASS(wxUxThemeHandle) -}; - -#endif // _WX_UXTHEME_H_ - diff --git a/wxWidgets/include/wx/msw/uxthemep.h b/wxWidgets/include/wx/msw/uxthemep.h deleted file mode 100644 index 9dc75c7806..0000000000 --- a/wxWidgets/include/wx/msw/uxthemep.h +++ /dev/null @@ -1,169 +0,0 @@ -/* - * Win32 5.1 theme definitions - * - * Copyright (C) 2003 Kevin Koltzau - * - * Originally written for the Wine project, and issued under - * the wxWindows License by kind permission of the author. - * - * License: wxWindows License - */ - -#ifndef __WINE_UXTHEME_H -#define __WINE_UXTHEME_H - -#include "wx/msw/wrapcctl.h" - -typedef HANDLE HTHEME; - -HRESULT WINAPI CloseThemeData(HTHEME hTheme); -HRESULT WINAPI DrawThemeBackground(HTHEME,HDC,int,int,const RECT*,const RECT*); - -#define DTBG_CLIPRECT 0x00000001 -#define DTBG_DRAWSOLID 0x00000002 -#define DTBG_OMITBORDER 0x00000004 -#define DTBG_OMITCONTENT 0x00000008 -#define DTBG_COMPUTINGREGION 0x00000010 -#define DTBG_MIRRORDC 0x00000020 - -typedef struct _DTBGOPTS { - DWORD dwSize; - DWORD dwFlags; - RECT rcClip; -} DTBGOPTS, *PDTBGOPTS; - -HRESULT WINAPI DrawThemeBackgroundEx(HTHEME,HDC,int,int,const RECT*, - const DTBGOPTS*); -HRESULT WINAPI DrawThemeEdge(HTHEME,HDC,int,int,const RECT*,UINT,UINT, - RECT*); -HRESULT WINAPI DrawThemeIcon(HTHEME,HDC,int,int,const RECT*,HIMAGELIST,int); -HRESULT WINAPI DrawThemeParentBackground(HWND,HDC,RECT*); - -#define DTT_GRAYED 0x1 - -HRESULT WINAPI DrawThemeText(HTHEME,HDC,int,int,LPCWSTR,int,DWORD,DWORD, - const RECT*); - -#define ETDT_DISABLE 0x00000001 -#define ETDT_ENABLE 0x00000002 -#define ETDT_USETABTEXTURE 0x00000004 -#define ETDT_ENABLETAB (ETDT_ENABLE|ETDT_USETABTEXTURE) - -HRESULT WINAPI EnableThemeDialogTexture(HWND,DWORD); -HRESULT WINAPI EnableTheming(BOOL); -HRESULT WINAPI GetCurrentThemeName(LPWSTR,int,LPWSTR,int,LPWSTR,int); - -#define STAP_ALLOW_NONCLIENT (1<<0) -#define STAP_ALLOW_CONTROLS (1<<1) -#define STAP_ALLOW_WEBCONTENT (1<<2) - -DWORD WINAPI GetThemeAppProperties(void); -HRESULT WINAPI GetThemeBackgroundContentRect(HTHEME,HDC,int,int, - const RECT*,RECT*); -HRESULT WINAPI GetThemeBackgroundExtent(HTHEME,HDC,int,int,const RECT*,RECT*); -HRESULT WINAPI GetThemeBackgroundRegion(HTHEME,HDC,int,int,const RECT*,HRGN*); -HRESULT WINAPI GetThemeBool(HTHEME,int,int,int,BOOL*); -HRESULT WINAPI GetThemeColor(HTHEME,int,int,int,COLORREF*); - -#if defined(__GNUC__) -# define SZ_THDOCPROP_DISPLAYNAME (const WCHAR []){ 'D','i','s','p','l','a','y','N','a','m','e',0 } -# define SZ_THDOCPROP_CANONICALNAME (const WCHAR []){ 'T','h','e','m','e','N','a','m','e',0 } -# define SZ_THDOCPROP_TOOLTIP (const WCHAR []){ 'T','o','o','l','T','i','p',0 } -# define SZ_THDOCPROP_AUTHOR (const WCHAR []){ 'a','u','t','h','o','r',0 } -#else /* lif defined(_MSC_VER) */ -# define SZ_THDOCPROP_DISPLAYNAME L"DisplayName" -# define SZ_THDOCPROP_CANONICALNAME L"ThemeName" -# define SZ_THDOCPROP_TOOLTIP L"ToolTip" -# define SZ_THDOCPROP_AUTHOR L"author" -/* -#else -static const WCHAR SZ_THDOCPROP_DISPLAYNAME[] = { 'D','i','s','p','l','a','y','N','a','m','e',0 }; -static const WCHAR SZ_THDOCPROP_CANONICALNAME[] = { 'T','h','e','m','e','N','a','m','e',0 }; -static const WCHAR SZ_THDOCPROP_TOOLTIP[] = { 'T','o','o','l','T','i','p',0 }; -static const WCHAR SZ_THDOCPROP_AUTHOR[] = { 'a','u','t','h','o','r',0 }; -*/ -#endif - -HRESULT WINAPI GetThemeDocumentationProperty(LPCWSTR,LPCWSTR,LPWSTR,int); -HRESULT WINAPI GetThemeEnumValue(HTHEME,int,int,int,int*); -HRESULT WINAPI GetThemeFilename(HTHEME,int,int,int,LPWSTR,int); -HRESULT WINAPI GetThemeFont(HTHEME,HDC,int,int,int,LOGFONTW*); -HRESULT WINAPI GetThemeInt(HTHEME,int,int,int,int*); - -#define MAX_INTLIST_COUNT 10 -typedef struct _INTLIST { - int iValueCount; - int iValues[MAX_INTLIST_COUNT]; -} INTLIST, *PINTLIST; - -HRESULT WINAPI GetThemeIntList(HTHEME,int,int,int,INTLIST*); - -typedef struct _MARGINS { - int cxLeftWidth; - int cxRightWidth; - int cyTopHeight; - int cyBottomHeight; -} MARGINS, *PMARGINS; - -HRESULT WINAPI GetThemeMargins(HTHEME,HDC,int,int,int,RECT*,MARGINS*); -HRESULT WINAPI GetThemeMetric(HTHEME,HDC,int,int,int,int*); - -typedef enum { - TS_MIN, - TS_TRUE, - TS_DRAW -} THEMESIZE; - -HRESULT WINAPI GetThemePartSize(HTHEME,HDC,int,int,RECT*,THEMESIZE,SIZE*); -HRESULT WINAPI GetThemePosition(HTHEME,int,int,int,POINT*); - -typedef enum { - PO_STATE, - PO_PART, - PO_CLASS, - PO_GLOBAL, - PO_NOTFOUND -} PROPERTYORIGIN; - -HRESULT WINAPI GetThemePropertyOrigin(HTHEME,int,int,int,PROPERTYORIGIN*); -HRESULT WINAPI GetThemeRect(HTHEME,int,int,int,RECT*); -HRESULT WINAPI GetThemeString(HTHEME,int,int,int,LPWSTR,int); -BOOL WINAPI GetThemeSysBool(HTHEME,int); -COLORREF WINAPI GetThemeSysColor(HTHEME,int); -HBRUSH WINAPI GetThemeSysColorBrush(HTHEME,int); -HRESULT WINAPI GetThemeSysFont(HTHEME,int,LOGFONTW*); -HRESULT WINAPI GetThemeSysInt(HTHEME,int,int*); -int WINAPI GetThemeSysSize(HTHEME,int); -HRESULT WINAPI GetThemeSysString(HTHEME,int,LPWSTR,int); -HRESULT WINAPI GetThemeTextExtent(HTHEME,HDC,int,int,LPCWSTR,int,DWORD, - const RECT*,RECT*); -HRESULT WINAPI GetThemeTextMetrics(HTHEME,HDC,int,int,TEXTMETRICW*); -HTHEME WINAPI GetWindowTheme(HWND); - -#define HTTB_BACKGROUNDSEG 0x0000 -#define HTTB_FIXEDBORDER 0x0002 -#define HTTB_CAPTION 0x0004 -#define HTTB_RESIZINGBORDER_LEFT 0x0010 -#define HTTB_RESIZINGBORDER_TOP 0x0020 -#define HTTB_RESIZINGBORDER_RIGHT 0x0040 -#define HTTB_RESIZINGBORDER_BOTTOM 0x0080 -#define HTTB_RESIZINGBORDER \ - (HTTB_RESIZINGBORDER_LEFT|HTTB_RESIZINGBORDER_TOP|\ - HTTB_RESIZINGBORDER_RIGHT|HTTB_RESIZINGBORDER_BOTTOM) -#define HTTB_SIZINGTEMPLATE 0x0100 -#define HTTB_SYSTEMSIZINGMARGINS 0x0200 - -HRESULT WINAPI HitTestThemeBackground(HTHEME,HDC,int,int,DWORD,const RECT*, - HRGN,POINT,WORD*); -BOOL WINAPI IsAppThemed(void); -BOOL WINAPI IsThemeActive(void); -BOOL WINAPI IsThemeBackgroundPartiallyTransparent(HTHEME,int,int); -BOOL WINAPI IsThemeDialogTextureEnabled(void); -BOOL WINAPI IsThemePartDefined(HTHEME,int,int); -HTHEME WINAPI OpenThemeData(HWND,LPCWSTR); -void WINAPI SetThemeAppProperties(DWORD); -HRESULT WINAPI SetWindowTheme(HWND,LPCWSTR,LPCWSTR); - - -#endif - diff --git a/wxWidgets/include/wx/msw/wince/checklst.h b/wxWidgets/include/wx/msw/wince/checklst.h deleted file mode 100644 index 76adae99d8..0000000000 --- a/wxWidgets/include/wx/msw/wince/checklst.h +++ /dev/null @@ -1,95 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: wx/msw/wince/checklst.h -// Purpose: wxCheckListBox class - a listbox with checkable items -// Author: Wlodzimierz ABX Skiba -// Modified by: -// Created: 30.10.2005 -// RCS-ID: $Id: checklst.h 38319 2006-03-23 22:05:23Z VZ $ -// Copyright: (c) Wlodzimierz Skiba -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifndef __CHECKLSTCE__H_ -#define __CHECKLSTCE__H_ - -class WXDLLEXPORT wxCheckListBox : public wxCheckListBoxBase -{ -public: - // ctors - wxCheckListBox(); - 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); - 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); - virtual ~wxCheckListBox(); - - 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); - - // override base class virtuals - virtual void Delete(unsigned int n); - - // items may be checked - virtual bool IsChecked(unsigned int uiIndex) const; - virtual void Check(unsigned int uiIndex, bool bCheck = true); - - // public interface derived from wxListBox and lower classes - virtual void Clear(); - virtual unsigned int GetCount() const; - virtual int GetSelection() const; - virtual int GetSelections(wxArrayInt& aSelections) const; - virtual wxString GetString(unsigned int n) const; - virtual bool IsSelected(int n) const; - virtual void SetString(unsigned int n, const wxString& s); - - // Implementation - virtual bool MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result); -protected: - - void OnSize(wxSizeEvent& event); - - // protected interface derived from wxListBox and lower classes - virtual int DoAppend(const wxString& item); - virtual void* DoGetItemClientData(unsigned int n) const; - virtual wxClientData* DoGetItemClientObject(unsigned int n) const; - virtual void DoInsertItems(const wxArrayString& items, unsigned int pos); - virtual void DoSetFirstItem(int n); - virtual void DoSetItemClientData(unsigned int n, void* clientData); - virtual void DoSetItemClientObject(unsigned int n, wxClientData* clientData); - virtual void DoSetItems(const wxArrayString& items, void **clientData); - virtual void DoSetSelection(int n, bool select); - // convert our styles to Windows - virtual WXDWORD MSWGetStyle(long style, WXDWORD *exstyle) const; - -private: - - wxArrayPtrVoid m_itemsClientData; - - DECLARE_EVENT_TABLE() - DECLARE_DYNAMIC_CLASS_NO_COPY(wxCheckListBox) -}; - -#endif //_CHECKLSTCE_H diff --git a/wxWidgets/include/wx/msw/wince/chkconf.h b/wxWidgets/include/wx/msw/wince/chkconf.h deleted file mode 100644 index 12cca184f6..0000000000 --- a/wxWidgets/include/wx/msw/wince/chkconf.h +++ /dev/null @@ -1,100 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: wx/msw/wince/chkconf.h -// Purpose: WinCE-specific configuration options checks -// Author: Vadim Zeitlin -// Modified by: -// Created: 2005-03-07 -// RCS-ID: $Id: chkconf.h 55651 2008-09-16 08:03:55Z VZ $ -// Copyright: (c) 2005 Vadim Zeitlin <vadim@wxwindows.org> -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_MSW_WINCE_CHKCONF_H_ -#define _WX_MSW_WINCE_CHKCONF_H_ - -// Standard SDK lacks a few things, forcefully disable them -#ifdef WCE_PLATFORM_STANDARDSDK - // no shell functions support - #undef wxUSE_STDPATHS - #define wxUSE_STDPATHS 0 -#endif // WCE_PLATFORM_STANDARDSDK - -#if _WIN32_WCE < 400 - // not enough API and lack of ddraw.h - #undef wxUSE_DISPLAY - #define wxUSE_DISPLAY 0 -#endif - -// DDE doesn't exist under WinCE and wxIPC is DDE-based under MSW -#undef wxUSE_IPC -#define wxUSE_IPC 0 - -// no AUI under CE: it's unnecessary and currently doesn't compile -#undef wxUSE_AUI -#define wxUSE_AUI 0 - -// no MDI under CE -#undef wxUSE_MDI -#define wxUSE_MDI 0 -#undef wxUSE_MDI_ARCHITECTURE -#define wxUSE_MDI_ARCHITECTURE 0 - -// metafiles are not supported neither -#undef wxUSE_ENH_METAFILE -#define wxUSE_ENH_METAFILE 0 - -#undef wxUSE_METAFILE -#define wxUSE_METAFILE 0 - -// eVC doesn't support SEH -#undef wxUSE_ON_FATAL_EXCEPTION -#define wxUSE_ON_FATAL_EXCEPTION 0 - -#undef wxUSE_WXHTML_HELP -#define wxUSE_WXHTML_HELP 0 - -// libtiff and regex apparently don't compile with eVC (to check with eVC4?) -// and they're disabled for WinCE in build/bakefiles/{tiff|regex}.bkl so can't -// be enabled here -#undef wxUSE_LIBTIFF -#define wxUSE_LIBTIFF 0 - -#undef wxUSE_REGEX -#define wxUSE_REGEX 0 - -#undef wxUSE_DEBUGREPORT -#define wxUSE_DEBUGREPORT 0 - -// other MSW settings not supported by CE -#undef wxUSE_RICHEDIT -#define wxUSE_RICHEDIT 0 -#undef wxUSE_RICHEDIT2 -#define wxUSE_RICHEDIT2 0 - -#undef wxUSE_UXTHEME -#define wxUSE_UXTHEME 0 -#undef wxUSE_UXTHEME_AUTO -#define wxUSE_UXTHEME_AUTO 0 - -#undef wxUSE_UNICODE_MSLU -#define wxUSE_UNICODE_MSLU 0 - - -// Disable features which don't make sense for MS Smartphones -// (due to pointer device usage, limited controls or dialogs, file system) -#if defined(__SMARTPHONE__) - #undef wxUSE_LISTBOOK - #define wxUSE_LISTBOOK 0 - - #undef wxUSE_NOTEBOOK - #define wxUSE_NOTEBOOK 0 - - #undef wxUSE_STATUSBAR - #define wxUSE_STATUSBAR 0 - - #undef wxUSE_COLOURPICKERCTRL - #define wxUSE_COLOURPICKERCTRL 0 -#endif // __SMARTPHONE__ - -#endif // _WX_MSW_WINCE_CHKCONF_H_ - diff --git a/wxWidgets/include/wx/msw/wince/choicece.h b/wxWidgets/include/wx/msw/wince/choicece.h deleted file mode 100644 index 0d3f738a97..0000000000 --- a/wxWidgets/include/wx/msw/wince/choicece.h +++ /dev/null @@ -1,142 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: wx/msw/wince/choicece.h -// Purpose: wxChoice implementation for smart phones driven by WinCE -// Author: Wlodzimierz ABX Skiba -// Modified by: -// Created: 29.07.2004 -// RCS-ID: $Id: choicece.h 38319 2006-03-23 22:05:23Z VZ $ -// Copyright: (c) Wlodzimierz Skiba -// License: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_CHOICECE_H_BASE_ -#define _WX_CHOICECE_H_BASE_ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -#include "wx/defs.h" - -#if wxUSE_CHOICE - -#include "wx/dynarray.h" - -class WXDLLEXPORT wxChoice; -WX_DEFINE_EXPORTED_ARRAY_PTR(wxChoice *, wxArrayChoiceSpins); - -// ---------------------------------------------------------------------------- -// Choice item -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxChoice : public wxChoiceBase -{ -public: - // ctors - wxChoice() { } - 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, unsigned int pos); - virtual void Delete(unsigned int n); - virtual void Clear() ; - - virtual unsigned int GetCount() const; - virtual int GetSelection() const; - virtual void SetSelection(int n); - - virtual int FindString(const wxString& s, bool bCase = false) const; - virtual wxString GetString(unsigned int n) const; - virtual void SetString(unsigned int n, const wxString& s); - - // get the subclassed window proc of the buddy list of choices - WXFARPROC GetBuddyWndProc() const { return m_wndProcBuddy; } - - // return the choice object whose buddy is the given window or NULL - static wxChoice *GetChoiceForListBox(WXHWND hwndBuddy); - - virtual bool MSWCommand(WXUINT param, WXWORD id); - -protected: - virtual void DoSetItemClientData(unsigned int n, void* clientData); - virtual void* DoGetItemClientData(unsigned int n) const; - virtual void DoSetItemClientObject(unsigned int n, wxClientData* clientData); - virtual wxClientData* DoGetItemClientObject(unsigned int n) const; - - // MSW implementation - virtual void DoGetPosition(int *x, int *y) const; - virtual void DoMoveWindow(int x, int y, int width, int height); - virtual wxSize DoGetBestSize() const; - virtual void DoGetSize(int *width, int *height) const; - - virtual WXDWORD MSWGetStyle(long style, WXDWORD *exstyle) const; - - // create and initialize the control - bool CreateAndInit(wxWindow *parent, wxWindowID id, - const wxPoint& pos, - const wxSize& size, - int n, const wxString choices[], - long style, - const wxValidator& validator, - const wxString& name); - - // free all memory we have (used by Clear() and dtor) - void Free(); - - // the data for the "buddy" list - WXHWND m_hwndBuddy; - WXFARPROC m_wndProcBuddy; - - // all existing wxChoice - this allows to find the one corresponding to - // the given buddy window in GetSpinChoiceCtrl() - static wxArrayChoiceSpins ms_allChoiceSpins; - -private: - DECLARE_DYNAMIC_CLASS_NO_COPY(wxChoice) -}; - -#endif // wxUSE_CHOICE - -#endif // _WX_CHOICECE_H_BASE_ diff --git a/wxWidgets/include/wx/msw/wince/helpwce.h b/wxWidgets/include/wx/msw/wince/helpwce.h deleted file mode 100644 index a1cafb1ac5..0000000000 --- a/wxWidgets/include/wx/msw/wince/helpwce.h +++ /dev/null @@ -1,58 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/msw/wince/helpwce.h -// Purpose: Help system: Windows CE help implementation -// Author: Julian Smart -// Modified by: -// Created: 2003-07-12 -// RCS-ID: $Id: helpwce.h 36026 2005-10-27 21:00:26Z JS $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_HELPWCE_H_ -#define _WX_HELPWCE_H_ - -#if wxUSE_HELP - -#include "wx/helpbase.h" - -class WXDLLEXPORT wxWinceHelpController : public wxHelpControllerBase -{ -public: - wxWinceHelpController(wxWindow* parentWindow = NULL): wxHelpControllerBase(parentWindow) {} - virtual ~wxWinceHelpController() {} - - // Must call this to set the filename - virtual bool Initialize(const wxString& file); - - // If file is "", reloads file given in Initialize - virtual bool LoadFile(const wxString& file = wxEmptyString); - virtual bool DisplayContents(); - virtual bool DisplaySection(int sectionNo); - virtual bool DisplaySection(const wxString& section); - virtual bool DisplayBlock(long blockNo); - virtual bool DisplayContextPopup(int contextId); - virtual bool DisplayTextPopup(const wxString& text, const wxPoint& pos); - virtual bool KeywordSearch(const wxString& k, - wxHelpSearchMode mode = wxHELP_SEARCH_ALL); - virtual bool Quit(); - - wxString GetHelpFile() const { return m_helpFile; } - -protected: - // Append extension if necessary. - wxString GetValidFilename(const wxString& file) const; - - // View topic, or just the HTML file - bool ViewURL(const wxString& topic = wxEmptyString); - -private: - wxString m_helpFile; - - DECLARE_CLASS(wxWinceHelpController) -}; - -#endif // wxUSE_MS_HTML_HELP - -#endif -// _WX_HELPWCE_H_ diff --git a/wxWidgets/include/wx/msw/wince/libraries.h b/wxWidgets/include/wx/msw/wince/libraries.h deleted file mode 100644 index 1c0e836031..0000000000 --- a/wxWidgets/include/wx/msw/wince/libraries.h +++ /dev/null @@ -1,59 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/msw/wince/libraries.h -// Purpose: VC++ pragmas for linking against SDK libs -// Author: Vaclav Slavik -// Modified by: -// Created: 2004-04-11 -// RCS-ID: $Id: libraries.h 38141 2006-03-16 11:03:26Z JS $ -// Copyright: (c) 2004 Vaclav Slavik -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_LIBRARIES_H_ -#define _WX_LIBRARIES_H_ - -// NB: According to Microsoft, it is up to the OEM to decide whether -// some of libraries will be included in the system or not. For example, -// MS' STANDARDSDK does not include cyshell.lib and aygshell.lib, while -// Pocket PC 2003 SDK does. We depend on some symbols that are in these -// libraries in some SDKs and in different libs in others. Fortunately we -// can detect what SDK is used in C++ code, so we take advantage of -// VC++'s #pragma to link against the libraries conditionally, instead of -// including libraries in project files. - -#if defined(__VISUALC__) && defined(__WXWINCE__) - -#if (_WIN32_WCE >= 400) || defined(__POCKETPC__) - // No commdlg.lib in Mobile 5.0 Smartphone -#if !(defined(__SMARTPHONE__) && _WIN32_WCE >= 1200) - #pragma comment(lib,"commdlg.lib") -#endif -#endif - -#if (_WIN32_WCE >= 400) && !defined(wxNO_RTTI) - #pragma comment(lib,"ccrtrtti.lib") -#endif - -#if defined(__WINCE_STANDARDSDK__) - // DoDragDrop: - #pragma comment(lib,"olece400.lib") -#elif defined(__POCKETPC__) - // PocketPC build: - // DoDragDrop: - #pragma comment(lib,"ceshell.lib") - - #pragma comment(lib,"aygshell.lib") -#elif defined(__HANDHELDPC__) - // Handheld PC builds. Maybe WindowsCE.NET 4.X needs another symbol. - #pragma comment(lib,"ceshell.lib") -#elif defined(__SMARTPHONE__) - // Smartphone build: - #pragma comment(lib,"ceshell.lib") - #pragma comment(lib,"aygshell.lib") -#else - #error "Unknown SDK, please fill-in missing pieces" -#endif - -#endif // __VISUALC__ && __WXWINCE__ - -#endif // _WX_LIBRARIES_H_ diff --git a/wxWidgets/include/wx/msw/wince/missing.h b/wxWidgets/include/wx/msw/wince/missing.h deleted file mode 100644 index 0c5ccbec04..0000000000 --- a/wxWidgets/include/wx/msw/wince/missing.h +++ /dev/null @@ -1,140 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wince/missing.h -// Purpose: Missing things in WinCE -// Author: Marco Cavallini -// Modified by: -// Created: 16/11/2002 -// RCS-ID: -// Copyright: (c) KOAN SAS ( www.koansoftware.com ) -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_CE_MISSING_H_ -#define _WX_CE_MISSING_H_ - -#include "wx/msw/private.h" -#include "shellapi.h" - -inline BOOL IsIconic( HWND WXUNUSED(hWnd) ) -{ - // Probably not right... -#if 0 - long style = GetWindowLong(hWnd, GWL_STYLE); - return ((style & WS_MINIMIZE) == 0); -#endif - return FALSE; -} - -#ifdef __POCKETPC__ -#define SM_CXCURSOR 13 -#define SM_CYCURSOR 14 -#endif - -// Missing from eVC 4 for some reason -#ifndef I_IMAGENONE -#define I_IMAGENONE (-2) -#endif - -#ifndef TBSTYLE_NO_DROPDOWN_ARROW -#define TBSTYLE_NO_DROPDOWN_ARROW 0x0080 -#endif - -#ifndef SHCMBM_GETMENU -#define SHCMBM_GETMENU (WM_USER + 402) -#endif - -#ifndef SHCMBM_SETSUBMENU -#define SHCMBM_SETSUBMENU (WM_USER + 400) // wparam == id of button, lParam == hmenu, return is old hmenu -#endif - -#ifndef SHCMBM_GETSUBMENU -#define SHCMBM_GETSUBMENU (WM_USER + 401) // lParam == ID -#endif - -#ifndef LVS_EX_FULLROWSELECT - #define LVS_EX_FULLROWSELECT 0x00000020 -#endif - -#ifndef TVS_FULLROWSELECT - #define TVS_FULLROWSELECT 0x1000 -#endif - -#ifndef TVM_SETBKCOLOR - #define TVM_SETBKCOLOR (TV_FIRST + 29) - #define TVM_SETTEXTCOLOR (TV_FIRST + 30) -#endif - -// Used in msgdlg.cpp, evtloop.cpp -#ifndef MB_TASKMODAL -#define MB_TASKMODAL 0x2000 -#endif - -#ifndef HGDI_ERROR -#define HGDI_ERROR ((HANDLE)(0xFFFFFFFFL)) -#endif - -// some windows styles don't exist in CE SDK, replace them with closest -// equivalents -#ifndef WS_THICKFRAME - #define WS_THICKFRAME WS_BORDER -#endif - -#ifndef WS_MINIMIZE - #define WS_MINIMIZE 0 -#endif - -#ifndef WS_MAXIMIZE - #define WS_MAXIMIZE 0 -#endif - - -// global memory functions don't exist under CE (good riddance, of course, but -// the existing code still uses them in some places, so make it compile) -// -// update: they're defined in eVC 4 inside "#ifdef UNDER_CE" block -#ifndef UNDER_CE - #define GlobalAlloc LocalAlloc - #define GlobalFree LocalFree - #define GlobalSize LocalSize - #define GPTR LPTR - #define GHND LPTR - #define GMEM_MOVEABLE 0 - #define GMEM_SHARE 0 -#endif // !UNDER_CE - -// WinCE RTL doesn't implement bsearch() used in encconv.cpp -extern "C" void * -bsearch(const void *key, const void *base, size_t num, size_t size, - int (wxCMPFUNC_CONV *cmp)(const void *, const void *)); - -#define O_RDONLY 0x0000 /* open for reading only */ -#define O_WRONLY 0x0001 /* open for writing only */ -#define O_RDWR 0x0002 /* open for reading and writing */ -#define O_APPEND 0x0008 /* writes done at eof */ - -#define O_CREAT 0x0100 /* create and open file */ -#define O_TRUNC 0x0200 /* open and truncate */ -#define O_EXCL 0x0400 /* open only if file doesn't already exist */ - -#define O_TEXT 0x4000 /* file mode is text (translated) */ -#define O_BINARY 0x8000 /* file mode is binary (untranslated) */ - -#ifndef SS_SUNKEN - #define SS_SUNKEN 0x00001000L -#endif - -// unsupported flags for WINDOWPOS structure -#ifndef SWP_NOCOPYBITS - #define SWP_NOCOPYBITS 0 -#endif - -#ifndef SWP_NOOWNERZORDER - #define SWP_NOOWNERZORDER 0 -#endif - -#ifndef SWP_NOSENDCHANGING - #define SWP_NOSENDCHANGING 0 -#endif - -#endif // _WX_CE_MISSING_H_ - diff --git a/wxWidgets/include/wx/msw/wince/net.h b/wxWidgets/include/wx/msw/wince/net.h deleted file mode 100644 index dbf04259f9..0000000000 --- a/wxWidgets/include/wx/msw/wince/net.h +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright 1998, Ben Goetter. All rights reserved. -// Also released under wxWindows license - see src/msw/wince/net.cpp - -/* - patch holes in winsock - - WCE 2.0 lacks many of the 'database' winsock routines. - Stub just enough them for ss.dll. - - getprotobynumber - getservbyport - getservbyname - -*/ - -struct servent * WINSOCKAPI getservbyport(int port, const char * proto) ; - -struct servent * WINSOCKAPI getservbyname(const char * name, - const char * proto) ; -struct protoent * WINSOCKAPI getprotobynumber(int proto) ; - diff --git a/wxWidgets/include/wx/msw/wince/resources.h b/wxWidgets/include/wx/msw/wince/resources.h deleted file mode 100644 index df64656b2e..0000000000 --- a/wxWidgets/include/wx/msw/wince/resources.h +++ /dev/null @@ -1,25 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: wx/msw/wince/resources.h -// Purpose: identifiers shared between resource compiler and eVC -// Author: Wlodzimierz ABX Skiba -// Modified by: -// Created: 01.05.2004 -// RCS-ID: $Id: resources.h 27829 2004-06-16 06:17:27Z ABX $ -// Copyright: (c) Wlodzimierz Skiba -// License: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#define IDM_LEFT 40001 -#define IDM_RIGHT 40002 -#define IDM_ITEM 40003 - -#define IDS_EMPTY 40010 - -#define IDR_POPUP_1 40020 -#define IDR_POPUP_2 40021 - -#define IDR_MENUBAR_ONE_BUTTON 40030 -#define IDR_MENUBAR_LEFT_MENU 40031 -#define IDR_MENUBAR_RIGHT_MENU 40032 -#define IDR_MENUBAR_BOTH_MENUS 40033 - diff --git a/wxWidgets/include/wx/msw/wince/setup.h b/wxWidgets/include/wx/msw/wince/setup.h deleted file mode 100644 index 80082ff912..0000000000 --- a/wxWidgets/include/wx/msw/wince/setup.h +++ /dev/null @@ -1,1295 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/msw/wince/setup.h -// Purpose: Configuration for the library -// Author: Julian Smart -// Modified by: -// Created: 01/02/97 -// RCS-ID: $Id: setup.h 51451 2008-01-29 23:11:55Z VZ $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_SETUP_H_ -#define _WX_SETUP_H_ - -/* --- start common options --- */ -// ---------------------------------------------------------------------------- -// 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.4 API: set it to 1 to -// enable it but please consider updating your code instead. -// -// Default is 0 -// -// Recommended setting: 0 (please update your code) -#define WXWIN_COMPATIBILITY_2_4 0 - -// This setting determines the compatibility with 2.6 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_6 1 - -// MSW-only: Set to 0 for accurate dialog units, else 1 for old behaviour when -// default system font is used for wxWindow::GetCharWidth/Height() instead of -// the current font. -// -// Default is 0 -// -// Recommended setting: 0 -#define wxDIALOG_UNIT_COMPATIBILITY 0 - -// ---------------------------------------------------------------------------- -// 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 wxWidgets 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 the normal memory operators. -// -// Default is 0 -// -// Recommended setting: 0 -#define wxUSE_DEBUG_CONTEXT 0 - -// 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 0 -// -// Recommended setting: 1 if you are not using a memory debugging tool, else 0 -#define wxUSE_MEMORY_TRACING 0 - -// 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 / CodeWarrior -// -// 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. -#define wxUSE_ON_FATAL_EXCEPTION 1 - -// Set this to 1 to be able to generate a human-readable (unlike -// machine-readable minidump created by wxCrashReport::Generate()) stack back -// trace when your program crashes using wxStackWalker -// -// Default is 1 if supported by the compiler. -// -// Recommended setting: 1, set to 0 if your programs never crash -#define wxUSE_STACKWALKER 1 - -// Set this to 1 to compile in wxDebugReport class which allows you to create -// and optionally upload to your web site a debug report consisting of back -// trace of the crash (if wxUSE_STACKWALKER == 1) and other information. -// -// Default is 1 if supported by the compiler. -// -// Recommended setting: 1, it is compiled into a separate library so there -// is no overhead if you don't use it -#define wxUSE_DEBUGREPORT 1 - -// ---------------------------------------------------------------------------- -// Unicode support -// ---------------------------------------------------------------------------- - -// Set wxUSE_UNICODE to 1 to compile wxWidgets 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/XP -// (Windows 9x doesn't support it and the programs compiled in Unicode mode -// will not run under 9x -- but see wxUSE_UNICODE_MSLU below). -// -// Default is 0 -// -// Recommended setting: 0 (unless you only plan to use Windows NT/2000/XP) -#ifndef wxUSE_UNICODE - #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. -// -// Note that like wxUSE_THREADS this option is automatically set to 0 if -// wxNO_EXCEPTIONS is defined. -// -// 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 - -// Set wxUSE_EXTENDED_RTTI to 1 to use extended RTTI -// -// Default is 0 -// -// Recommended setting: 0 (this is still work in progress...) -#define wxUSE_EXTENDED_RTTI 0 - -// Set wxUSE_STL to 1 to derive wxList(Foo) and wxArray(Foo) from -// std::list<Foo*> and std::vector<Foo*>, with a compatibility interface, -// and for wxHashMap to be implemented with templates. -// -// Default is 0 -// -// Recommended setting: YMMV -#define wxUSE_STL 0 - -// 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 -#define wxUSE_LOGWINDOW 1 - -// Recommended setting: 1 -#define wxUSE_LOGGUI 1 - -// Recommended setting: 1 -#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. -// -// Notice that if wxNO_THREADS is defined, wxUSE_THREADS is automatically reset -// to 0 in wx/chkconf.h, so, for example, if you set USE_THREADS to 0 in -// build/msw/config.* file this value will have no effect. -// -// Default is 1 -// -// Recommended setting: 0 unless you do plan to develop MT applications -#define wxUSE_THREADS 1 - -// If enabled, compiles wxWidgets streams classes -// -// wx stream classes are used for image IO, process IO redirection, network -// protocols implementation and much more and so disabling this results in a -// lot of other functionality being lost. -// -// Default is 1 -// -// Recommended setting: 1 as setting it to 0 disables many other things -#define wxUSE_STREAMS 1 - -// Use standard C++ streams if 1 instead of wx streams in some places. If -// disabled (default), wx streams are used everywhere and wxWidgets doesn't -// depend on the standard streams library. -// -// Notice that enabling this does not replace wx streams with std streams -// everywhere, in a lot of places wx streams are used no matter what. -// -// Default is 0 -// -// Recommended setting: 1 if you use the standard streams anyhow and so -// dependency on the standard streams library is not a -// problem -#define wxUSE_STD_IOSTREAM 0 - -// Enable conversion to standard C++ string if 1. -// -// Default is 1 for most compilers. -// -// Currently the Digital Mars and Watcom compilers come without standard C++ -// library headers by default, wxUSE_STD_STRING can be set to 1 if you do have -// them (e.g. from STLPort). -// -// VC++ 5.0 does include standard C++ library header, however they produce -// many warnings that can't be turned off when compiled at warning level 4. -#if defined(__DMC__) || defined(__WATCOMC__) \ - || (defined(_MSC_VER) && _MSC_VER < 1200) - #define wxUSE_STD_STRING 0 -#else - #define wxUSE_STD_STRING 1 -#endif - -// Support for positional parameters (e.g. %1$d, %2$s ...) in wxVsnprintf. -// Note that if the system's implementation does not support positional -// parameters, setting this to 1 forces the use of the wxWidgets implementation -// of wxVsnprintf. The standard vsnprintf() supports positional parameters on -// many Unix systems but usually doesn't under Windows. -// -// Positional parameters are very useful when translating a program since using -// them in formatting strings allow translators to correctly reorder the -// translated sentences. -// -// Default is 1 -// -// Recommended setting: 1 if you want to support multiple languages -#define wxUSE_PRINTF_POS_PARAMS 1 - -// ---------------------------------------------------------------------------- -// 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 wxFSVolume class providing access to the configured/active mount points -// -// Default is 1 -// -// Recommended setting: 1 (but may be safely disabled if you don't use it) -#define wxUSE_FSVOLUME 1 - -// Use wxStandardPaths class which allows to retrieve some standard locations -// in the file system -// -// Default is 1 -// -// Recommended setting: 1 (may be disabled to save space, but not much) -#define wxUSE_STDPATHS 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, don't use for now -#define wxUSE_DYNAMIC_LOADER 1 - -// 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 archive filesystem (requires wxUSE_FILESYSTEM) -#define wxUSE_FS_ARCHIVE 1 - -// Set to 1 to enable virtual Internet filesystem (requires wxUSE_FILESYSTEM) -#define wxUSE_FS_INET 1 - -// wxArchive classes for accessing archives such as zip and tar -#define wxUSE_ARCHIVE_STREAMS 1 - -// Set to 1 to compile wxZipInput/OutputStream classes. -#define wxUSE_ZIPSTREAM 1 - -// Set to 1 to compile wxTarInput/OutputStream classes. -#define wxUSE_TARSTREAM 1 - -// Set to 1 to compile wxZlibInput/OutputStream classes. Also required by -// wxUSE_LIBPNG -#define wxUSE_ZLIB 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 wxWidgets 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 - -// Define this to use native platform url and protocol support. -// Currently valid only for MS-Windows. -// Note: if you set this to 1, you can open ftp/http/gopher sites -// and obtain a valid input stream for these sites -// even when you set wxUSE_PROTOCOL_FTP/HTTP to 0. -// Doing so reduces the code size. -// -// This code is experimental and subject to change. -#define wxUSE_URL_NATIVE 0 - -// Support for wxVariant class used in several places throughout the library, -// notably in wxDataViewCtrl API. -// -// Default is 1. -// -// Recommended setting: 1 unless you want to reduce the library size as much as -// possible in which case setting this to 0 can gain up to 100KB. -#define wxUSE_VARIANT 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 - -// Use wxMediaCtrl -// -// Default is 1. -// -// Recommended setting: 1 -#define wxUSE_MEDIACTRL 1 - -// Use GStreamer for Unix (req a lot of dependancies) -// -// Default is 0 -// -// Recommended setting: 1 (wxMediaCtrl won't work by default without it) -#define wxUSE_GSTREAMER 0 - -// Use wxWidget's XRC XML-based resource system. Recommended. -// -// Default is 1 -// -// Recommended setting: 1 (requires wxUSE_XML) -#define wxUSE_XRC 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 the same as wxUSE_XRC, i.e. 1 by default. -// -// Recommended setting: 1 (required by XRC) -#define wxUSE_XML wxUSE_XRC - -// Use wxWidget's AUI docking system -// -// Default is 1 -// -// Recommended setting: 1 -#define wxUSE_AUI 1 - - -// Enable the new wxGraphicsPath and wxGraphicsContext classes for an advanced -// 2D drawing API. (Still somewhat experimental) -// -// Please note that on Windows you will need to link with gdiplus.lib (use -// USE_GDIPLUS=1 for makefile builds) and distribute gdiplus.dll with your -// application if you want it to be runnable on pre-XP systems. -// -// Default is 0 -// -// Recommended setting: 1 -#ifndef wxUSE_GRAPHICS_CONTEXT -#define wxUSE_GRAPHICS_CONTEXT 0 -#endif - -// ---------------------------------------------------------------------------- -// 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 -// -// Default is 1 -// -// Recommended setting: 1 (may be set to 0 if you don't wxUSE_TIPWINDOW) -#define wxUSE_POPUPWIN 1 - -// wxTipWindow allows to implement the custom tooltips, it is used by the -// context help classes. Requires wxUSE_POPUPWIN. -// -// Default is 1 -// -// Recommended setting: 1 (may be set to 0) -#define wxUSE_TIPWINDOW 1 - -// Each of the settings below corresponds to one wxWidgets 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_ANIMATIONCTRL 1 // wxAnimationCtrl -#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_COLLPANE 1 // wxCollapsiblePane -#define wxUSE_COLOURPICKERCTRL 1 // wxColourPickerCtrl -#define wxUSE_COMBOBOX 1 // wxComboBox -#define wxUSE_DATAVIEWCTRL 1 // wxDataViewCtrl -#define wxUSE_DATEPICKCTRL 1 // wxDatePickerCtrl -#define wxUSE_DIRPICKERCTRL 1 // wxDirPickerCtrl -#define wxUSE_FILEPICKERCTRL 1 // wxFilePickerCtrl -#define wxUSE_FONTPICKERCTRL 1 // wxFontPickerCtrl -#define wxUSE_GAUGE 1 // wxGauge -#define wxUSE_HYPERLINKCTRL 1 // wxHyperlinkCtrl -#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_SEARCHCTRL 1 // wxSearchCtrl -#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 for the platforms where native status bar is supported. -// -// 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 - -// wxNotebook is a control with several "tabs" located on one of its sides. It -// may be used to 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 - -// wxChoicebook control is similar to wxNotebook but uses wxChoice instead of -// the tabs -// -// Default is 1. -// -// Recommended setting: 1 -#define wxUSE_CHOICEBOOK 1 - -// wxTreebook control is similar to wxNotebook but uses wxTreeCtrl instead of -// the tabs -// -// Default is 1. -// -// Recommended setting: 1 -#define wxUSE_TREEBOOK 1 - -// wxToolbook control is similar to wxNotebook but uses wxToolBar instead of -// tabs -// -// Default is 1. -// -// Recommended setting: 1 -#define wxUSE_TOOLBOOK 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, set to 0 to cut down compilation time and binaries size if you -// don't use it. -// -// Recommended setting: 1 -// -#define wxUSE_GRID 1 - -// wxMiniFrame class: a frame with narrow title bar -// -// Default is 1. -// -// Recommended setting: 1 (it doesn't cost almost anything) -#define wxUSE_MINIFRAME 1 - -// wxComboCtrl and related classes: combobox with custom popup window and -// not necessarily a listbox. -// -// Default is 1. -// -// Recommended setting: 1 but can be safely set to 0 except for wxUniv where it -// it used by wxComboBox -#define wxUSE_COMBOCTRL 1 - -// wxOwnerDrawnComboBox is a custom combobox allowing to paint the combobox -// items. -// -// Default is 1. -// -// Recommended setting: 1 but can be safely set to 0, except where it is -// needed as a base class for generic wxBitmapComboBox. -#define wxUSE_ODCOMBOBOX 1 - -// wxBitmapComboBox is a combobox that can have images in front of text items. -// -// Default is 1. -// -// Recommended setting: 1 but can be safely set to 0 -#define wxUSE_BITMAPCOMBOBOX 1 - -// ---------------------------------------------------------------------------- -// Miscellaneous GUI stuff -// ---------------------------------------------------------------------------- - -// wxAcceleratorTable/Entry classes and support for them in wxMenu(Bar) -#define wxUSE_ACCEL 1 - -// Hotkey support (currently Windows only) -#define wxUSE_HOTKEY 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 -// their geometries as well as finding the display on which the given point or -// window lies. -// -// Default is 1. -// -// Recommended setting: 1 if you need it, can be safely set to 0 otherwise -#define wxUSE_DISPLAY 1 - -// 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 - -// ---------------------------------------------------------------------------- -// 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 - -// Compile in wxAboutBox() function showing the standard "About" dialog. -// -// Default is 1 -// -// Recommended setting: 1 but can be set to 0 to save some space if you don't -// use this function -#define wxUSE_ABOUTDLG 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 MDI support. -// -// Requires wxUSE_NOTEBOOK under platforms other than MSW. -// -// Default is 1. -// -// Recommended setting: 1, can be safely set to 0. -#define wxUSE_MDI 1 - -// Set to 0 to disable document/view architecture -#define wxUSE_DOC_VIEW_ARCHITECTURE 1 - -// Set to 0 to disable MDI document/view architecture -// -// Requires wxUSE_MDI && wxUSE_DOC_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 - -// Setting wxUSE_GLCANVAS to 1 enables OpenGL support. You need to have OpenGL -// headers and libraries to be able to compile the library with wxUSE_GLCANVAS -// set to 1. Note that for some compilers (notably Microsoft Visual C++) you -// will need to manually add opengl32.lib and glu32.lib to the list of -// libraries linked with your program if you use OpenGL. -// -// Default is 0. -// -// Recommended setting: 1 if you intend to use OpenGL, 0 otherwise -#define wxUSE_GLCANVAS 1 - -// wxRichTextCtrl allows editing of styled text. -// -// Default is 1. -// -// Recommended setting: 1, set to 0 if you want compile a -// smaller library. -#define wxUSE_RICHTEXT 1 - -// ---------------------------------------------------------------------------- -// 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 - -// Use wxAccessible for enhanced and customisable accessibility. -// Depends on wxUSE_OLE. -// -// Default is 0. -// -// Recommended setting (at present): 0 -#define wxUSE_ACCESSIBILITY 0 - -// ---------------------------------------------------------------------------- -// miscellaneous settings -// ---------------------------------------------------------------------------- - -// wxSingleInstanceChecker class allows to verify at startup if another program -// instance is running. -// -// 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 1 - // 0 for no interprocess comms -#define wxUSE_HELP 1 - // 0 for no help facility - -// Should we use MS HTML help for wxHelpController? If disabled, neither -// wxCHMHelpController nor wxBestHelpController are available. -// -// Default is 1 under MSW, 0 is always used for the other platforms. -// -// Recommended setting: 1, only set to 0 if you have trouble compiling -// wxCHMHelpController (could be a problem with really ancient compilers) -#define wxUSE_MS_HTML_HELP 1 - - -// Use wxHTML-based help controller? -#define wxUSE_WXHTML_HELP 1 - -#define wxUSE_RESOURCES 0 - // 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 1 - -// ---------------------------------------------------------------------------- -// 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 compatibility 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 <iostream> and <iostream.h> but you can't mix -// them. Set to 1 for <iostream.h>, 0 for <iostream>. Note that VC++ 7.1 -// and later doesn't support wxUSE_IOSTREAMH == 1 and so <iostream> will be -// used anyhow. -// -// Default is 1. -// -// Recommended setting: whatever your compiler likes more -#define wxUSE_IOSTREAMH 1 - -// ---------------------------------------------------------------------------- -// 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 TGA format support (loading only) -#define wxUSE_TGA 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 (Amiga format) -#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 - -// ---------------------------------------------------------------------------- -// wxUniversal-only options -// ---------------------------------------------------------------------------- - -// Set to 1 to enable compilation of all themes, this is the default -#define wxUSE_ALL_THEMES 1 - -// Set to 1 to enable the compilation of individual theme if wxUSE_ALL_THEMES -// is unset, if it is set these options are not used; notice that metal theme -// uses Win32 one -#define wxUSE_THEME_GTK 0 -#define wxUSE_THEME_METAL 0 -#define wxUSE_THEME_MONO 0 -#define wxUSE_THEME_WIN32 0 - - -/* --- end common options --- */ - -// ---------------------------------------------------------------------------- -// general Windows-specific stuff -// ---------------------------------------------------------------------------- - -// Set this to 1 for generic OLE support: this is required for drag-and-drop, -// clipboard, OLE Automation. Only set it to 0 if your compiler is very old and -// can't compile/doesn't have the OLE headers. -// -// Default is 1. -// -// Recommended setting: 1 -#define wxUSE_OLE 1 - -// Set this to 1 to enable wxDIB (don't change unless you have reason to) -#define wxUSE_WXDIB 1 - -// ---------------------------------------------------------------------------- -// Windows CE specific stuff -// ---------------------------------------------------------------------------- - -// list of things which don't make sense under Windows CE in alphabetical order -// (please keep it!) -// -// NB: stuff which doesn't work at all under CE is forcefully disabled in -// wx/msw/wince/chkconf.h - -// Windows CE doesn't use RAS so wxDialUpManager doesn't work under it -#undef wxUSE_DIALUP_MANAGER -#define wxUSE_DIALUP_MANAGER 0 - -#undef wxUSE_DRAG_AND_DROP -#define wxUSE_DRAG_AND_DROP 0 - -#undef wxUSE_FSVOLUME -#define wxUSE_FSVOLUME 0 - -// MDI is not supported under CE -#undef wxUSE_MDI -#define wxUSE_MDI 0 - -#undef wxUSE_MDI_ARCHITECTURE -#define wxUSE_MDI_ARCHITECTURE 0 - -// there is no difference between frame and mini frame decorations under CE -#undef wxUSE_MINIFRAME -#define wxUSE_MINIFRAME 0 - -// no CHM support under CE -#undef wxUSE_MS_HTML_HELP -#define wxUSE_MS_HTML_HELP 0 - -// ??? -#undef wxUSE_OWNER_DRAWN -#define wxUSE_OWNER_DRAWN 0 - -// there is usually no printer attached to a PDA... -#undef wxUSE_PRINTING_ARCHITECTURE -#define wxUSE_PRINTING_ARCHITECTURE 0 - -// doesn't make much sense in absence of mouse... -#undef wxUSE_TOOLTIPS -#define wxUSE_TOOLTIPS 0 - -// Do use commdlg.h -#undef wxUSE_COMMON_DIALOGS -#define wxUSE_COMMON_DIALOGS 1 - -// don't use wxRichTextCtrl on WinCE yet, it's not ready, plus it's -// probably overkill for a WinCE environment. -#undef wxUSE_RICHTEXT -#define wxUSE_RICHTEXT 0 - -// ---------------------------------------------------------------------------- -// Crash debugging helpers -// ---------------------------------------------------------------------------- - -// Set this to 1 to be able to use wxCrashReport::Generate() to create mini -// dumps of your program when it crashes (or at any other moment) -// -// Default is 1 if supported by the compiler (VC++ and recent BC++ only). -// -// Recommended setting: 1, set to 0 if your programs never crash -#define wxUSE_CRASHREPORT 0 - -// ---------------------------------------------------------------------------- -// obsolete MSW settings, don't change -// ---------------------------------------------------------------------------- - -#define wxUSE_POSTSCRIPT_ARCHITECTURE_IN_MSW 0 - -#endif // _WX_SETUP_H_ diff --git a/wxWidgets/include/wx/msw/wince/smartphone.rc b/wxWidgets/include/wx/msw/wince/smartphone.rc deleted file mode 100644 index 0f13ac6697..0000000000 --- a/wxWidgets/include/wx/msw/wince/smartphone.rc +++ /dev/null @@ -1,67 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: wx/msw/wince/smartphone.h -// Purpose: resources for MS Smartphone build -// Author: Wlodzimierz ABX Skiba -// Modified by: -// Created: 01.05.2004 -// RCS-ID: $Id: smartphone.rc 30036 2004-10-20 15:14:46Z VZ $ -// Copyright: (c) Wlodzimierz Skiba -// License: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#include <aygshell.h> - -#include "wx/msw/wince/resources.h" - -STRINGTABLE -BEGIN - IDS_EMPTY "" -END - -IDR_POPUP_1 MENU -BEGIN - POPUP "" - BEGIN - MENUITEM "M", IDM_ITEM - END -END - -IDR_POPUP_2 MENU -BEGIN - POPUP "" - BEGIN - MENUITEM "M", IDM_ITEM - END - POPUP "" - BEGIN - MENUITEM "M", IDM_ITEM - END -END - -IDR_MENUBAR_ONE_BUTTON RCDATA -BEGIN - 0,2, - I_IMAGENONE, IDM_LEFT, TBSTATE_ENABLED, TBSTYLE_BUTTON | TBSTYLE_AUTOSIZE, IDS_EMPTY, 0, NOMENU, - I_IMAGENONE, IDM_RIGHT, TBSTATE_ENABLED, TBSTYLE_BUTTON | TBSTYLE_AUTOSIZE, IDS_EMPTY, 0, NOMENU, -END - -IDR_MENUBAR_LEFT_MENU RCDATA -BEGIN - IDR_POPUP_1,1, - I_IMAGENONE, IDM_LEFT, TBSTATE_ENABLED, TBSTYLE_DROPDOWN | TBSTYLE_AUTOSIZE, IDS_EMPTY, 0, 0, -END - -IDR_MENUBAR_RIGHT_MENU RCDATA -BEGIN - IDR_POPUP_1,2, - I_IMAGENONE, IDM_LEFT, TBSTATE_ENABLED, TBSTYLE_BUTTON | TBSTYLE_AUTOSIZE, IDS_EMPTY, 0, NOMENU, - I_IMAGENONE, IDM_RIGHT, TBSTATE_ENABLED, TBSTYLE_DROPDOWN | TBSTYLE_AUTOSIZE, IDS_EMPTY, 0, 0, -END - -IDR_MENUBAR_BOTH_MENUS RCDATA -BEGIN - IDR_POPUP_2,2, - I_IMAGENONE, IDM_LEFT, TBSTATE_ENABLED, TBSTYLE_DROPDOWN | TBSTYLE_AUTOSIZE, IDS_EMPTY, 0, 0, - I_IMAGENONE, IDM_RIGHT, TBSTATE_ENABLED, TBSTYLE_DROPDOWN | TBSTYLE_AUTOSIZE, IDS_EMPTY, 0, 1, -END - diff --git a/wxWidgets/include/wx/msw/wince/tbarwce.h b/wxWidgets/include/wx/msw/wince/tbarwce.h deleted file mode 100644 index 5fc0cf7099..0000000000 --- a/wxWidgets/include/wx/msw/wince/tbarwce.h +++ /dev/null @@ -1,168 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/msw/wince/tbarwce.h -// Purpose: Windows CE wxToolBar class -// Author: Julian Smart -// Modified by: -// Created: 2003-07-12 -// RCS-ID: $Id: tbarwce.h 35650 2005-09-23 12:56:45Z MR $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_BARWCE_H_ -#define _WX_BARWCE_H_ - -#if wxUSE_TOOLBAR - -#include "wx/dynarray.h" - -// Smartphones don't have toolbars, so use a dummy class -#ifdef __SMARTPHONE__ - -class WXDLLEXPORT wxToolBar : public wxToolBarBase -{ -public: - // ctors and dtor - wxToolBar() { } - - wxToolBar(wxWindow *parent, - wxWindowID id, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = wxNO_BORDER | wxTB_HORIZONTAL, - const wxString& name = wxToolBarNameStr) - { - Create(parent, id, pos, size, style, name); - } - - 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() { return true; } - -protected: - // 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); - -private: - DECLARE_EVENT_TABLE() - DECLARE_DYNAMIC_CLASS(wxToolBar) - DECLARE_NO_COPY_CLASS(wxToolBar) -}; - -#else - -// For __POCKETPC__ - -#include "wx/msw/tbar95.h" - -class WXDLLEXPORT wxToolMenuBar : public wxToolBar -{ -public: - // ctors and dtor - wxToolMenuBar() { Init(); } - - wxToolMenuBar(wxWindow *parent, - wxWindowID id, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = wxNO_BORDER | wxTB_HORIZONTAL, - const wxString& name = wxToolBarNameStr, - wxMenuBar* menuBar = NULL) - { - Init(); - - Create(parent, id, pos, size, style, name, menuBar); - } - - bool Create(wxWindow *parent, - wxWindowID id, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = wxNO_BORDER | wxTB_HORIZONTAL, - const wxString& name = wxToolBarNameStr, - wxMenuBar* menuBar = NULL); - - virtual ~wxToolMenuBar(); - - // override/implement base class virtuals - virtual bool Realize(); - - // implementation only from now on - // ------------------------------- - - // Override in order to bypass wxToolBar's overridden function - virtual WXLRESULT MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam); - - virtual bool MSWCommand(WXUINT param, WXWORD id); - - // Return HMENU for the menu associated with the commandbar - WXHMENU GetHMenu(); - - // Set the wxMenuBar associated with this commandbar - void SetMenuBar(wxMenuBar* menuBar) { m_menuBar = menuBar; } - - // Returns the wxMenuBar associated with this commandbar - wxMenuBar* GetMenuBar() const { return m_menuBar; } - -protected: - // common part of all ctors - void Init(); - - // create the native toolbar control - bool MSWCreateToolbar(const wxPoint& pos, const wxSize& size, wxMenuBar* menuBar); - - // recreate the control completely - void Recreate(); - - // implement base class pure virtuals - virtual bool DoInsertTool(size_t pos, wxToolBarToolBase *tool); - virtual bool DoDeleteTool(size_t pos, wxToolBarToolBase *tool); - - 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); - - // The menubar associated with this toolbar - wxMenuBar* m_menuBar; - -private: - DECLARE_EVENT_TABLE() - DECLARE_DYNAMIC_CLASS(wxToolMenuBar) - DECLARE_NO_COPY_CLASS(wxToolMenuBar) -}; - -#endif - // __SMARTPHONE__ - -#endif // wxUSE_TOOLBAR - -#endif - // _WX_BARWCE_H_ diff --git a/wxWidgets/include/wx/msw/wince/textctrlce.h b/wxWidgets/include/wx/msw/wince/textctrlce.h deleted file mode 100644 index aec359cf9a..0000000000 --- a/wxWidgets/include/wx/msw/wince/textctrlce.h +++ /dev/null @@ -1,236 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/msw/wince/textctrlce.h -// Purpose: wxTextCtrl implementation for smart phones driven by WinCE -// Author: Wlodzimierz ABX Skiba -// Modified by: -// Created: 30.08.2004 -// RCS-ID: $Id: textctrlce.h 41739 2006-10-08 17:46:12Z VZ $ -// Copyright: (c) Wlodzimierz Skiba -// License: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_TEXTCTRLCE_H_ -#define _WX_TEXTCTRLCE_H_ - -#include "wx/dynarray.h" - -class WXDLLEXPORT wxTextCtrl; -WX_DEFINE_EXPORTED_ARRAY_PTR(wxTextCtrl *, wxArrayTextSpins); - -class WXDLLEXPORT wxTextCtrl : public wxTextCtrlBase -{ -public: - // creation - // -------- - - wxTextCtrl() { Init(); } - 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); - } - virtual ~wxTextCtrl(); - - 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); - - // implement base class pure virtuals - // ---------------------------------- - - virtual wxString GetValue() const; - virtual void SetValue(const wxString& value) { DoSetValue(value, SetValue_SendEvent); } - - virtual void ChangeValue(const wxString &value) { DoSetValue(value); } - - virtual wxString GetRange(long from, long to) const; - - virtual int GetLineLength(long lineNo) const; - virtual wxString GetLineText(long lineNo) const; - virtual int GetNumberOfLines() const; - - virtual bool IsModified() const; - virtual bool IsEditable() const; - - 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); - - // clears the dirty flag - virtual void MarkDirty(); - virtual void DiscardEdits(); - - virtual void SetMaxLength(unsigned long len); - - // 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); - virtual wxTextCtrlHitTestResult HitTest(const wxPoint& pt, long *pos) const; - virtual wxTextCtrlHitTestResult HitTest(const wxPoint& pt, - wxTextCoord *col, - wxTextCoord *row) const - { - return wxTextCtrlBase::HitTest(pt, col, row); - } - - // 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 wxTextPos GetLastPosition() const; - - virtual void SetSelection(long from, long to); - virtual void SetEditable(bool editable); - - // Caret handling (Windows only) - - bool ShowNativeCaret(bool show = true); - bool HideNativeCaret() { return ShowNativeCaret(false); } - - // Implementation from now on - // -------------------------- - - virtual void Command(wxCommandEvent& event); - virtual bool MSWCommand(WXUINT param, WXWORD id); - - virtual void AdoptAttributesFromHWND(); - - 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 OnDelete(wxCommandEvent& event); - void OnSelectAll(wxCommandEvent& event); - - void OnUpdateCut(wxUpdateUIEvent& event); - void OnUpdateCopy(wxUpdateUIEvent& event); - void OnUpdatePaste(wxUpdateUIEvent& event); - void OnUpdateUndo(wxUpdateUIEvent& event); - void OnUpdateRedo(wxUpdateUIEvent& event); - void OnUpdateDelete(wxUpdateUIEvent& event); - void OnUpdateSelectAll(wxUpdateUIEvent& event); - - // Show a context menu for Rich Edit controls (the standard - // EDIT control has one already) - void OnRightClick(wxMouseEvent& event); - - // be sure the caret remains invisible if the user - // called HideNativeCaret() before - void OnSetFocus(wxFocusEvent& event); - - // get the subclassed window proc of the buddy - WXFARPROC GetBuddyWndProc() const { return m_wndProcBuddy; } - - // intercept WM_GETDLGCODE - virtual WXLRESULT MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam); - -protected: - // common part of all ctors - void Init(); - - // call this to increase the size limit (will do nothing if the current - // limit is big enough) - // - // returns true if we increased the limit to allow entering more text, - // false if we hit the limit set by SetMaxLength() and so didn't change it - bool AdjustSpaceLimit(); - - void DoSetValue(const wxString &value, int flags = 0); - - // replace the contents of the selection or of the entire control with the - // given text - void DoWriteText(const wxString& text, int flags = SetValue_SelectionOnly); - - // set the selection possibly without scrolling the caret into view - void DoSetSelection(long from, long to, bool scrollCaret = true); - - // return true if there is a non empty selection in the control - bool HasSelection() const; - - // get the length of the line containing the character at the given - // position - long GetLengthOfLineContainingPos(long pos) const; - - // send TEXT_UPDATED event, return true if it was handled, false otherwise - bool SendUpdateEvent(); - - // override some base class virtuals - virtual void DoMoveWindow(int x, int y, int width, int height); - virtual wxSize DoGetBestSize() const; - - virtual WXDWORD MSWGetStyle(long style, WXDWORD *exstyle) const; - - // if true, SendUpdateEvent() will eat the next event (see comments in the - // code as to why this is needed) - bool m_suppressNextUpdate; - - // all existing wxTextCtrl - this allows to find the one corresponding to - // the given buddy window in GetSpinTextCtrl() - static wxArrayTextSpins ms_allTextSpins; - -protected: - - // the data for the "buddy" list - WXHWND m_hwndBuddy; - WXFARPROC m_wndProcBuddy; - -private: - DECLARE_EVENT_TABLE() - DECLARE_DYNAMIC_CLASS_NO_COPY(wxTextCtrl) - - bool m_isNativeCaretShown; -}; - -#endif // _WX_TEXTCTRLCE_H_ diff --git a/wxWidgets/include/wx/msw/wince/time.h b/wxWidgets/include/wx/msw/wince/time.h deleted file mode 100644 index d711111c89..0000000000 --- a/wxWidgets/include/wx/msw/wince/time.h +++ /dev/null @@ -1,53 +0,0 @@ - -/* - * time.h - * Missing time functions and structures for use under WinCE - */ - -#ifndef _WX_MSW_WINCE_TIME_H_ -#define _WX_MSW_WINCE_TIME_H_ - -#ifndef _TM_DEFINED - -#define _TM_DEFINED - -struct tm { - int tm_sec; /* seconds after the minute - [0,59] */ - int tm_min; /* minutes after the hour - [0,59] */ - int tm_hour; /* hours since midnight - [0,23] */ - int tm_mday; /* day of the month - [1,31] */ - int tm_mon; /* months since January - [0,11] */ - int tm_year; /* years since 1900 */ - int tm_wday; /* days since Sunday - [0,6] */ - int tm_yday; /* days since January 1 - [0,365] */ - int tm_isdst; /* daylight savings time flag */ - }; - -extern "C" -{ - -time_t __cdecl time(time_t *); - -time_t __cdecl mktime(struct tm *); - -// VC8 CRT provides the other functions -#if !defined(__VISUALC__) || (__VISUALC__ < 1400) - -struct tm * __cdecl localtime(const time_t *); - -struct tm * __cdecl gmtime(const time_t *); - -#define _tcsftime wcsftime - -size_t __cdecl wcsftime(wchar_t *, size_t, const wchar_t *, const struct tm *); - -extern long timezone; - -#endif // !VC8 - -} - -#endif // !_TM_DEFINED - -#endif // _WX_MSW_WINCE_TIME_H_ - diff --git a/wxWidgets/include/wx/msw/wince/wince.rc b/wxWidgets/include/wx/msw/wince/wince.rc deleted file mode 100644 index d1f542224f..0000000000 --- a/wxWidgets/include/wx/msw/wince/wince.rc +++ /dev/null @@ -1,26 +0,0 @@ -#include <commctrl.h> - -#ifdef WIN32_PLATFORM_WFSP - #include "wx/msw/wince/smartphone.rc" -#else - -// Dummy menubar/toolbar for WinCE - -5000 RCDATA DISCARDABLE -BEGIN - // Popup menu name - 5000, - // Count of items to put on the menu - 0 -END - -5000 MENU DISCARDABLE -BEGIN - POPUP "Dummy" - BEGIN - MENUITEM "Dummy" 99 - END -END - -#endif - diff --git a/wxWidgets/include/wx/msw/window.h b/wxWidgets/include/wx/msw/window.h deleted file mode 100644 index c75ac55d33..0000000000 --- a/wxWidgets/include/wx/msw/window.h +++ /dev/null @@ -1,601 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/msw/window.h -// Purpose: wxWindowMSW class -// Author: Julian Smart -// Modified by: Vadim Zeitlin on 13.05.99: complete refont of message handling, -// elimination of Default(), ... -// Created: 01/02/97 -// RCS-ID: $Id: window.h 53929 2008-06-02 18:27:16Z RD $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_WINDOW_H_ -#define _WX_WINDOW_H_ - -// --------------------------------------------------------------------------- -// constants -// --------------------------------------------------------------------------- - -#if WXWIN_COMPATIBILITY_2_4 -// they're unused by wxWidgets... -enum -{ - wxKEY_SHIFT = 1, - wxKEY_CTRL = 2 -}; -#endif - -// --------------------------------------------------------------------------- -// wxWindow declaration for MSW -// --------------------------------------------------------------------------- - -class WXDLLEXPORT wxWindowMSW : public wxWindowBase -{ - friend class wxSpinCtrl; - friend class wxSlider; - friend class wxRadioBox; -#if defined __VISUALC__ && __VISUALC__ <= 1200 - friend class wxWindowMSW; -#endif -public: - wxWindowMSW() { Init(); } - - wxWindowMSW(wxWindow *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 ~wxWindowMSW(); - - bool Create(wxWindow *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 SetLabel(const wxString& label); - virtual wxString GetLabel() const; - - virtual void Raise(); - virtual void Lower(); - - virtual bool Show( bool show = true ); - virtual bool Enable( bool enable = true ); - - virtual void SetFocus(); - virtual void SetFocusFromKbd(); - - virtual bool Reparent(wxWindowBase *newParent); - - virtual void WarpPointer(int x, int y); - - virtual void Refresh( bool eraseBackground = true, - const wxRect *rect = (const wxRect *) NULL ); - virtual void Update(); - virtual void Freeze(); - virtual void Thaw(); - virtual bool IsFrozen() const { return m_frozenness > 0; } - - virtual void SetWindowStyleFlag(long style); - virtual void SetExtraStyle(long exStyle); - virtual bool SetCursor( const wxCursor &cursor ); - virtual bool SetFont( const wxFont &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 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 ); - - virtual bool ScrollLines(int lines); - virtual bool ScrollPages(int pages); - - virtual void SetLayoutDirection(wxLayoutDirection dir); - virtual wxLayoutDirection GetLayoutDirection() const; - virtual wxCoord AdjustForLayoutDirection(wxCoord x, - wxCoord width, - wxCoord widthTotal) const; - -#if wxUSE_DRAG_AND_DROP - virtual void SetDropTarget( wxDropTarget *dropTarget ); -#endif // wxUSE_DRAG_AND_DROP - - // Accept files for dragging - virtual void DragAcceptFiles(bool accept); - -#if WXWIN_COMPATIBILITY_2_4 - wxDEPRECATED( bool GetUseCtl3D() const ); - wxDEPRECATED( bool GetTransparentBackground() const ); - wxDEPRECATED( void SetTransparent(bool t = true) ); -#endif // WXWIN_COMPATIBILITY_2_4 - -#ifndef __WXUNIVERSAL__ - // Native resource loading (implemented in src/msw/nativdlg.cpp) - // FIXME: should they really be all virtual? - virtual bool LoadNativeDialog(wxWindow* parent, wxWindowID& id); - virtual bool LoadNativeDialog(wxWindow* parent, const wxString& name); - wxWindow* GetWindowChild1(wxWindowID id); - wxWindow* GetWindowChild(wxWindowID id); -#endif // __WXUNIVERSAL__ - -#if wxUSE_HOTKEY - // install and deinstall a system wide hotkey - virtual bool RegisterHotKey(int hotkeyId, int modifiers, int keycode); - virtual bool UnregisterHotKey(int hotkeyId); -#endif // wxUSE_HOTKEY - -#ifdef __POCKETPC__ - bool IsContextMenuEnabled() const { return m_contextMenuEnabled; } - void EnableContextMenu(bool enable = true) { m_contextMenuEnabled = enable; } -#endif - - // window handle stuff - // ------------------- - - WXHWND GetHWND() const { return m_hWnd; } - void SetHWND(WXHWND hWnd) { m_hWnd = hWnd; } - virtual WXWidget GetHandle() const { return GetHWND(); } - - void AssociateHandle(WXWidget handle); - void DissociateHandle(); - - // does this window have deferred position and/or size? - bool IsSizeDeferred() const; - - - // implementation from now on - // ========================== - - // event handlers - // -------------- - - void OnPaint(wxPaintEvent& event); - void OnEraseBackground(wxEraseEvent& event); -#ifdef __WXWINCE__ - void OnInitDialog(wxInitDialogEvent& event); -#endif - -public: - // Windows subclassing - void SubclassWin(WXHWND hWnd); - void UnsubclassWin(); - - WXFARPROC MSWGetOldWndProc() const { return m_oldWndProc; } - void MSWSetOldWndProc(WXFARPROC proc) { m_oldWndProc = proc; } - - // return true if the window is of a standard (i.e. not wxWidgets') class - // - // to understand why does it work, look at SubclassWin() code and comments - bool IsOfStandardClass() const { return m_oldWndProc != NULL; } - - wxWindow *FindItem(long id) const; - wxWindow *FindItemByHWND(WXHWND hWnd, bool controlOnly = false) const; - - // MSW only: true if this control is part of the main control - virtual bool ContainsHWND(WXHWND WXUNUSED(hWnd)) const { return false; } - -#if wxUSE_TOOLTIPS - // MSW only: true if this window or any of its children have a tooltip - virtual bool HasToolTips() const { return GetToolTip() != NULL; } -#endif // wxUSE_TOOLTIPS - - // translate wxWidgets style flags for this control into the Windows style - // and optional extended style for the corresponding native control - // - // this is the function that should be overridden in the derived classes, - // but you will mostly use MSWGetCreateWindowFlags() below - virtual WXDWORD MSWGetStyle(long flags, WXDWORD *exstyle = NULL) const ; - - // get the MSW window flags corresponding to wxWidgets ones - // - // the functions returns the flags (WS_XXX) directly and puts the ext - // (WS_EX_XXX) flags into the provided pointer if not NULL - WXDWORD MSWGetCreateWindowFlags(WXDWORD *exflags = NULL) const - { return MSWGetStyle(GetWindowStyle(), exflags); } - - // update the real underlying window style flags to correspond to the - // current wxWindow object style (safe to call even if window isn't fully - // created yet) - void MSWUpdateStyle(long flagsOld, long exflagsOld); - -#if wxABI_VERSION >= 20805 - // Helper for getting an appropriate theme style for the application. Unnecessary in - // 2.9 and above. - wxBorder GetThemedBorderStyle() const; -#endif - - // translate wxWidgets coords into Windows ones suitable to be passed to - // ::CreateWindow() - // - // returns true if non default coords are returned, false otherwise - bool MSWGetCreateWindowCoords(const wxPoint& pos, - const wxSize& size, - int& x, int& y, - int& w, int& h) const; - - // get the HWND to be used as parent of this window with CreateWindow() - virtual WXHWND MSWGetParent() const; - - // creates the window of specified Windows class with given style, extended - // style, title and geometry (default values - // - // returns true if the window has been created, false if creation failed - bool MSWCreate(const wxChar *wclass, - const wxChar *title = NULL, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - WXDWORD style = 0, - WXDWORD exendedStyle = 0); - - virtual bool MSWCommand(WXUINT param, WXWORD id); - -#ifndef __WXUNIVERSAL__ - // Create an appropriate wxWindow from a HWND - virtual wxWindow* CreateWindowFromHWND(wxWindow* parent, WXHWND hWnd); - - // Make sure the window style reflects the HWND style (roughly) - virtual void AdoptAttributesFromHWND(); -#endif // __WXUNIVERSAL__ - - // Setup background and foreground colours correctly - virtual void SetupColours(); - - // ------------------------------------------------------------------------ - // helpers for message handlers: these perform the same function as the - // message crackers from <windowsx.h> - they unpack WPARAM and LPARAM into - // the correct parameters - // ------------------------------------------------------------------------ - - void UnpackCommand(WXWPARAM wParam, WXLPARAM lParam, - WXWORD *id, WXHWND *hwnd, WXWORD *cmd); - void UnpackActivate(WXWPARAM wParam, WXLPARAM lParam, - WXWORD *state, WXWORD *minimized, WXHWND *hwnd); - void UnpackScroll(WXWPARAM wParam, WXLPARAM lParam, - WXWORD *code, WXWORD *pos, WXHWND *hwnd); - void UnpackCtlColor(WXWPARAM wParam, WXLPARAM lParam, - WXHDC *hdc, WXHWND *hwnd); - void UnpackMenuSelect(WXWPARAM wParam, WXLPARAM lParam, - WXWORD *item, WXWORD *flags, WXHMENU *hmenu); - - // ------------------------------------------------------------------------ - // internal handlers for MSW messages: all handlers return a boolean value: - // true means that the handler processed the event and false that it didn't - // ------------------------------------------------------------------------ - - // there are several cases where we have virtual functions for Windows - // message processing: this is because these messages often require to be - // processed in a different manner in the derived classes. For all other - // messages, however, we do *not* have corresponding MSWOnXXX() function - // and if the derived class wants to process them, it should override - // MSWWindowProc() directly. - - // scroll event (both horizontal and vertical) - virtual bool MSWOnScroll(int orientation, WXWORD nSBCode, - WXWORD pos, WXHWND control); - - // child control notifications - virtual bool MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result); - - // owner-drawn controls need to process these messages - virtual bool MSWOnDrawItem(int id, WXDRAWITEMSTRUCT *item); - virtual bool MSWOnMeasureItem(int id, WXMEASUREITEMSTRUCT *item); - - // the rest are not virtual - bool HandleCreate(WXLPCREATESTRUCT cs, bool *mayCreate); - bool HandleInitDialog(WXHWND hWndFocus); - bool HandleDestroy(); - - bool HandlePaint(); - bool HandlePrintClient(WXHDC hDC); - bool HandleEraseBkgnd(WXHDC hDC); - - bool HandleMinimize(); - bool HandleMaximize(); - bool HandleSize(int x, int y, WXUINT flag); - bool HandleSizing(wxRect& rect); - bool HandleGetMinMaxInfo(void *mmInfo); - - bool HandleShow(bool show, int status); - bool HandleActivate(int flag, bool minimized, WXHWND activate); - - bool HandleCommand(WXWORD id, WXWORD cmd, WXHWND control); - - bool HandleCtlColor(WXHBRUSH *hBrush, WXHDC hdc, WXHWND hWnd); - - bool HandlePaletteChanged(WXHWND hWndPalChange); - bool HandleQueryNewPalette(); - bool HandleSysColorChange(); - bool HandleDisplayChange(); - bool HandleCaptureChanged(WXHWND gainedCapture); - virtual bool HandleSettingChange(WXWPARAM wParam, WXLPARAM lParam); - - bool HandleQueryEndSession(long logOff, bool *mayEnd); - bool HandleEndSession(bool endSession, long logOff); - - bool HandleSetFocus(WXHWND wnd); - bool HandleKillFocus(WXHWND wnd); - - bool HandleDropFiles(WXWPARAM wParam); - - bool HandleMouseEvent(WXUINT msg, int x, int y, WXUINT flags); - bool HandleMouseMove(int x, int y, WXUINT flags); - bool HandleMouseWheel(WXWPARAM wParam, WXLPARAM lParam); - - bool HandleChar(WXWPARAM wParam, WXLPARAM lParam, bool isASCII = false); - bool HandleKeyDown(WXWPARAM wParam, WXLPARAM lParam); - bool HandleKeyUp(WXWPARAM wParam, WXLPARAM lParam); -#if wxUSE_ACCEL - bool HandleHotKey(WXWPARAM wParam, WXLPARAM lParam); -#endif -#ifdef __WIN32__ - int HandleMenuChar(int chAccel, WXLPARAM lParam); -#endif - // Create and process a clipboard event specified by type. - bool HandleClipboardEvent( WXUINT nMsg ); - - bool HandleQueryDragIcon(WXHICON *hIcon); - - bool HandleSetCursor(WXHWND hWnd, short nHitTest, int mouseMsg); - - bool HandlePower(WXWPARAM wParam, WXLPARAM lParam, bool *vetoed); - - - // Window procedure - virtual WXLRESULT MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam); - - // Calls an appropriate default window procedure - virtual WXLRESULT MSWDefWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam); - - // message processing helpers - - // return false if the message shouldn't be translated/preprocessed but - // dispatched normally - virtual bool MSWShouldPreProcessMessage(WXMSG* pMsg); - - // return true if the message was preprocessed and shouldn't be dispatched - virtual bool MSWProcessMessage(WXMSG* pMsg); - - // return true if the message was translated and shouldn't be dispatched - virtual bool MSWTranslateMessage(WXMSG* pMsg); - - // called when the window is about to be destroyed - virtual void MSWDestroyWindow(); - - - // this function should return the brush to paint the children controls - // background or 0 if this window doesn't impose any particular background - // on its children - // - // the base class version returns a solid brush if we have a non default - // background colour or 0 otherwise - virtual WXHBRUSH MSWGetBgBrushForChild(WXHDC hDC, WXHWND hWnd); - - // return the background brush to use for painting the given window by - // quering the parent windows via their MSWGetBgBrushForChild() recursively - // - // hWndToPaint is normally NULL meaning this window itself, but it can also - // be a child of this window which is used by the static box and could be - // potentially useful for other transparent controls - WXHBRUSH MSWGetBgBrush(WXHDC hDC, WXHWND hWndToPaint = NULL); - - // gives the parent the possibility to draw its children background, e.g. - // this is used by wxNotebook to do it using DrawThemeBackground() - // - // return true if background was drawn, false otherwise - virtual bool MSWPrintChild(WXHDC WXUNUSED(hDC), wxWindow * WXUNUSED(child)) - { - return false; - } - - // some controls (e.g. wxListBox) need to set the return value themselves - // - // return true to let parent handle it if we don't, false otherwise - virtual bool MSWShouldPropagatePrintChild() - { - return true; - } - - - // Responds to colour changes: passes event on to children. - void OnSysColourChanged(wxSysColourChangedEvent& event); - - // initialize various fields of wxMouseEvent (common part of MSWOnMouseXXX) - void InitMouseEvent(wxMouseEvent& event, int x, int y, WXUINT flags); - - // check if mouse is in the window - bool IsMouseInWindow() const; - - // check if a native double-buffering applies for this window - virtual bool IsDoubleBuffered() const; - -#if wxABI_VERSION >= 20808 - void SetDoubleBuffered(bool on); -#endif - - // synthesize a wxEVT_LEAVE_WINDOW event and set m_mouseInWindow to false - void GenerateMouseLeave(); - - // virtual function for implementing internal idle - // behaviour - virtual void OnInternalIdle(); - -protected: - -#if wxUSE_MENUS_NATIVE - virtual bool DoPopupMenu( wxMenu *menu, int x, int y ); -#endif // wxUSE_MENUS_NATIVE - - // the window handle - WXHWND m_hWnd; - - // the old window proc (we subclass all windows) - WXFARPROC m_oldWndProc; - - // additional (MSW specific) flags - bool m_mouseInWindow:1; - bool m_lastKeydownProcessed:1; - - // the size of one page for scrolling - int m_xThumbSize; - int m_yThumbSize; - - // 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(); - - // this simply moves/resizes the given HWND which is supposed to be our - // sibling (this is useful for controls which are composite at MSW level - // and for which DoMoveWindow() is not enough) - // - // returns true if the window move was deferred, false if it was moved - // immediately (no error return) - bool DoMoveSibling(WXHWND hwnd, int x, int y, int width, int height); - - // 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 ); - - // process TTN_NEEDTEXT message properly (i.e. fixing the bugs in - // comctl32.dll in our code -- see the function body for more info) - bool HandleTooltipNotify(WXUINT code, - WXLPARAM lParam, - const wxString& ttip); -#endif // wxUSE_TOOLTIPS - - // the helper functions used by HandleChar/KeyXXX methods - wxKeyEvent CreateKeyEvent(wxEventType evType, int id, - WXLPARAM lParam = 0, WXWPARAM wParam = 0) const; - - - // default OnEraseBackground() implementation, return true if we did erase - // the background, false otherwise (i.e. the system should erase it) - bool DoEraseBackground(WXHDC hDC); - - // generate WM_CHANGEUISTATE if it's needed for the OS we're running under - // - // action should be one of the UIS_XXX constants - // state should be one or more of the UISF_XXX constants - // if action == UIS_INITIALIZE then it doesn't seem to matter what we use - // for state as the system will decide for us what needs to be set - void MSWUpdateUIState(int action, int state = 0); - -private: - // common part of all ctors - void Init(); - - // the (non-virtual) handlers for the events - bool HandleMove(int x, int y); - bool HandleMoving(wxRect& rect); - bool HandleJoystickEvent(WXUINT msg, int x, int y, WXUINT flags); - bool HandleNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result); - - // list of disabled children before last call to our Disable() - wxWindowList *m_childrenDisabled; - - // number of calls to Freeze() minus number of calls to Thaw() - unsigned int m_frozenness; - - // current defer window position operation handle (may be NULL) - WXHANDLE m_hDWP; - -protected: - // When deferred positioning is done these hold the pending changes, and - // are used for the default values if another size/pos changes is done on - // this window before the group of deferred changes is completed. - wxPoint m_pendingPosition; - wxSize m_pendingSize; - -private: -#ifdef __POCKETPC__ - bool m_contextMenuEnabled; -#endif - - DECLARE_DYNAMIC_CLASS(wxWindowMSW) - DECLARE_NO_COPY_CLASS(wxWindowMSW) - DECLARE_EVENT_TABLE() -}; - -// ---------------------------------------------------------------------------- -// inline functions -// ---------------------------------------------------------------------------- - -#if WXWIN_COMPATIBILITY_2_4 - -inline bool wxWindowMSW::GetUseCtl3D() const { return false; } -inline bool wxWindowMSW::GetTransparentBackground() const { return false; } -inline void wxWindowMSW::SetTransparent(bool WXUNUSED(t)) { } - -#endif // WXWIN_COMPATIBILITY_2_4 - -// --------------------------------------------------------------------------- -// global functions -// --------------------------------------------------------------------------- - -// kbd code translation -WXDLLEXPORT int wxCharCodeMSWToWX(int keySym, WXLPARAM lParam = 0); -WXDLLEXPORT WXWORD wxCharCodeWXToMSW(int id, bool *IsVirtual = NULL); - -// window creation helper class: before creating a new HWND, instantiate an -// object of this class on stack - this allows to process the messages sent to -// the window even before CreateWindow() returns -class wxWindowCreationHook -{ -public: - wxWindowCreationHook(wxWindowMSW *winBeingCreated); - ~wxWindowCreationHook(); -}; - -// ---------------------------------------------------------------------------- -// global objects -// ---------------------------------------------------------------------------- - -// notice that this hash must be defined after wxWindow declaration as it -// needs to "see" its dtor and not just forward declaration -#include "wx/hash.h" - -// pseudo-template HWND <-> wxWindow hash table -#if WXWIN_COMPATIBILITY_2_4 -WX_DECLARE_HASH(wxWindow, wxWindowList, wxWinHashTable); -#else -WX_DECLARE_HASH(wxWindowMSW, wxWindowList, wxWinHashTable); -#endif - -extern wxWinHashTable *wxWinHandleHash; - -#endif // _WX_WINDOW_H_ diff --git a/wxWidgets/include/wx/msw/winundef.h b/wxWidgets/include/wx/msw/winundef.h deleted file mode 100644 index 47d59e7c40..0000000000 --- a/wxWidgets/include/wx/msw/winundef.h +++ /dev/null @@ -1,490 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: winundef.h -// Purpose: undefine the common symbols #define'd by <windows.h> -// Author: Vadim Zeitlin -// Modified by: -// Created: 16.05.99 -// RCS-ID: $Id: winundef.h 36044 2005-10-31 19:35:41Z VZ $ -// Copyright: (c) wxWidgets team -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -/* THIS SHOULD NOT BE USED since you might include it once e.g. in window.h, - * then again _AFTER_ you've included windows.h, in which case it won't work - * a 2nd time -- JACS -#ifndef _WX_WINUNDEF_H_ -#define _WX_WINUNDEF_H_ - */ - -// ---------------------------------------------------------------------------- -// windows.h #defines the following identifiers which are also used in wxWin so -// we replace these symbols with the corresponding inline functions and -// undefine the macro. -// -// This looks quite ugly here but allows us to write clear (and correct!) code -// elsewhere because the functions, unlike the macros, respect the scope. -// ---------------------------------------------------------------------------- - -// CreateDialog - -#if defined(CreateDialog) - #undef CreateDialog - - inline HWND CreateDialog(HINSTANCE hInstance, - LPCTSTR pTemplate, - HWND hwndParent, - DLGPROC pDlgProc) - { - #ifdef _UNICODE - return CreateDialogW(hInstance, pTemplate, hwndParent, pDlgProc); - #else - return CreateDialogA(hInstance, pTemplate, hwndParent, pDlgProc); - #endif - } -#endif - -// CreateFont - -#ifdef CreateFont - #undef CreateFont - - inline HFONT CreateFont(int height, - int width, - int escapement, - int orientation, - int weight, - DWORD italic, - DWORD underline, - DWORD strikeout, - DWORD charset, - DWORD outprecision, - DWORD clipprecision, - DWORD quality, - DWORD family, - LPCTSTR facename) - { - #ifdef _UNICODE - return CreateFontW(height, width, escapement, orientation, - weight, italic, underline, strikeout, charset, - outprecision, clipprecision, quality, - family, facename); - #else - return CreateFontA(height, width, escapement, orientation, - weight, italic, underline, strikeout, charset, - outprecision, clipprecision, quality, - family, facename); - #endif - } -#endif // CreateFont - -// CreateWindow - -#if defined(CreateWindow) - #undef CreateWindow - - inline HWND CreateWindow(LPCTSTR lpClassName, - LPCTSTR lpWndClass, - DWORD dwStyle, - int x, int y, int w, int h, - HWND hWndParent, - HMENU hMenu, - HINSTANCE hInstance, - LPVOID lpParam) - { - #ifdef _UNICODE - return CreateWindowW(lpClassName, lpWndClass, dwStyle, x, y, w, h, - hWndParent, hMenu, hInstance, lpParam); - #else - return CreateWindowA(lpClassName, lpWndClass, dwStyle, x, y, w, h, - hWndParent, hMenu, hInstance, lpParam); - #endif - } -#endif - -// LoadMenu - -#ifdef LoadMenu - #undef LoadMenu - - inline HMENU LoadMenu(HINSTANCE instance, LPCTSTR name) - { - #ifdef _UNICODE - return LoadMenuW(instance, name); - #else - return LoadMenuA(instance, name); - #endif - } -#endif - -// FindText - -#ifdef FindText - #undef FindText - - inline HWND APIENTRY FindText(LPFINDREPLACE lpfindreplace) - { - #ifdef UNICODE - return FindTextW(lpfindreplace); - #else - return FindTextA(lpfindreplace); - #endif // !UNICODE - } -#endif - -// GetCharWidth - -#ifdef GetCharWidth - #undef GetCharWidth - inline BOOL GetCharWidth(HDC dc, UINT first, UINT last, LPINT buffer) - { - #ifdef _UNICODE - return GetCharWidthW(dc, first, last, buffer); - #else - return GetCharWidthA(dc, first, last, buffer); - #endif - } -#endif - -// FindWindow - -#ifdef FindWindow - #undef FindWindow - #ifdef _UNICODE - inline HWND FindWindow(LPCWSTR classname, LPCWSTR windowname) - { - return FindWindowW(classname, windowname); - } - #else - inline HWND FindWindow(LPCSTR classname, LPCSTR windowname) - { - return FindWindowA(classname, windowname); - } - #endif -#endif - -// PlaySound - -#ifdef PlaySound - #undef PlaySound - #ifdef _UNICODE - inline BOOL PlaySound(LPCWSTR pszSound, HMODULE hMod, DWORD fdwSound) - { - return PlaySoundW(pszSound, hMod, fdwSound); - } - #else - inline BOOL PlaySound(LPCSTR pszSound, HMODULE hMod, DWORD fdwSound) - { - return PlaySoundA(pszSound, hMod, fdwSound); - } - #endif -#endif - -// GetClassName - -#ifdef GetClassName - #undef GetClassName - #ifdef _UNICODE - inline int GetClassName(HWND h, LPWSTR classname, int maxcount) - { - return GetClassNameW(h, classname, maxcount); - } - #else - inline int GetClassName(HWND h, LPSTR classname, int maxcount) - { - return GetClassNameA(h, classname, maxcount); - } - #endif -#endif - -// GetClassInfo - -#ifdef GetClassInfo - #undef GetClassInfo - #ifdef _UNICODE - inline BOOL GetClassInfo(HINSTANCE h, LPCWSTR name, LPWNDCLASSW winclass) - { - return GetClassInfoW(h, name, winclass); - } - #else - inline BOOL GetClassInfo(HINSTANCE h, LPCSTR name, LPWNDCLASSA winclass) - { - return GetClassInfoA(h, name, winclass); - } - #endif -#endif - -// LoadAccelerators - -#ifdef LoadAccelerators - #undef LoadAccelerators - #ifdef _UNICODE - inline HACCEL LoadAccelerators(HINSTANCE h, LPCWSTR name) - { - return LoadAcceleratorsW(h, name); - } - #else - inline HACCEL LoadAccelerators(HINSTANCE h, LPCSTR name) - { - return LoadAcceleratorsA(h, name); - } - #endif -#endif - -// DrawText - -#ifdef DrawText - #undef DrawText - #ifdef _UNICODE - inline int DrawText(HDC h, LPCWSTR str, int count, LPRECT rect, UINT format) - { - return DrawTextW(h, str, count, rect, format); - } - #else - inline int DrawText(HDC h, LPCSTR str, int count, LPRECT rect, UINT format) - { - return DrawTextA(h, str, count, rect, format); - } - #endif -#endif - - -/* - When this file is included, sometimes the wxCHECK_W32API_VERSION macro - is undefined. With for example CodeWarrior this gives problems with - the following code: - #if 0 && wxCHECK_W32API_VERSION( 0, 5 ) - Because CodeWarrior does macro expansion before test evaluation. - We define wxCHECK_W32API_VERSION here if it's undefined. -*/ -#if !defined(__GNUG__) && !defined(wxCHECK_W32API_VERSION) - #define wxCHECK_W32API_VERSION(maj, min) (0) -#endif - -// StartDoc - -#ifdef StartDoc - #undef StartDoc - #if defined( __GNUG__ ) && !wxCHECK_W32API_VERSION( 0, 5 ) - #define DOCINFOW DOCINFO - #define DOCINFOA DOCINFO - #endif - #ifdef _UNICODE - inline int StartDoc(HDC h, CONST DOCINFOW* info) - { - return StartDocW(h, (DOCINFOW*) info); - } - #else - inline int StartDoc(HDC h, CONST DOCINFOA* info) - { - return StartDocA(h, (DOCINFOA*) info); - } - #endif -#endif - -// GetObject - -#ifdef GetObject - #undef GetObject - inline int GetObject(HGDIOBJ h, int i, LPVOID buffer) - { - #ifdef _UNICODE - return GetObjectW(h, i, buffer); - #else - return GetObjectA(h, i, buffer); - #endif - } -#endif - -// GetMessage - -#ifdef GetMessage - #undef GetMessage - inline int GetMessage(LPMSG lpMsg, HWND hWnd, UINT wMsgFilterMin, UINT wMsgFilterMax) - { - #ifdef _UNICODE - return GetMessageW(lpMsg, hWnd, wMsgFilterMin, wMsgFilterMax); - #else - return GetMessageA(lpMsg, hWnd, wMsgFilterMin, wMsgFilterMax); - #endif - } -#endif - -// LoadIcon -#ifdef LoadIcon - #undef LoadIcon - inline HICON LoadIcon(HINSTANCE hInstance, LPCTSTR lpIconName) - { - #ifdef _UNICODE - return LoadIconW(hInstance, lpIconName); - #else // ANSI - return LoadIconA(hInstance, lpIconName); - #endif // Unicode/ANSI - } -#endif // LoadIcon - -// LoadBitmap -#ifdef LoadBitmap - #undef LoadBitmap - inline HBITMAP LoadBitmap(HINSTANCE hInstance, LPCTSTR lpBitmapName) - { - #ifdef _UNICODE - return LoadBitmapW(hInstance, lpBitmapName); - #else // ANSI - return LoadBitmapA(hInstance, lpBitmapName); - #endif // Unicode/ANSI - } -#endif // LoadBitmap - -// LoadLibrary - -#ifdef LoadLibrary - #undef LoadLibrary - #ifdef _UNICODE - inline HINSTANCE LoadLibrary(LPCWSTR lpLibFileName) - { - return LoadLibraryW(lpLibFileName); - } - #else - inline HINSTANCE LoadLibrary(LPCSTR lpLibFileName) - { - return LoadLibraryA(lpLibFileName); - } - #endif -#endif - -// FindResource -#ifdef FindResource - #undef FindResource - #ifdef _UNICODE - inline HRSRC FindResource(HMODULE hModule, LPCWSTR lpName, LPCWSTR lpType) - { - return FindResourceW(hModule, lpName, lpType); - } - #else - inline HRSRC FindResource(HMODULE hModule, LPCSTR lpName, LPCSTR lpType) - { - return FindResourceA(hModule, lpName, lpType); - } - #endif -#endif - -// IsMaximized - -#ifdef IsMaximized - #undef IsMaximized - inline BOOL IsMaximized(HWND WXUNUSED_IN_WINCE(hwnd)) - { -#ifdef __WXWINCE__ - return FALSE; -#else - return IsZoomed(hwnd); -#endif - } -#endif - -// GetFirstChild - -#ifdef GetFirstChild - #undef GetFirstChild - inline HWND GetFirstChild(HWND WXUNUSED_IN_WINCE(hwnd)) - { -#ifdef __WXWINCE__ - return 0; -#else - return GetTopWindow(hwnd); -#endif - } -#endif - -// GetFirstSibling - -#ifdef GetFirstSibling - #undef GetFirstSibling - inline HWND GetFirstSibling(HWND hwnd) - { - return GetWindow(hwnd,GW_HWNDFIRST); - } -#endif - -// GetLastSibling - -#ifdef GetLastSibling - #undef GetLastSibling - inline HWND GetLastSibling(HWND hwnd) - { - return GetWindow(hwnd,GW_HWNDLAST); - } -#endif - -// GetPrevSibling - -#ifdef GetPrevSibling - #undef GetPrevSibling - inline HWND GetPrevSibling(HWND hwnd) - { - return GetWindow(hwnd,GW_HWNDPREV); - } -#endif - -// GetNextSibling - -#ifdef GetNextSibling - #undef GetNextSibling - inline HWND GetNextSibling(HWND hwnd) - { - return GetWindow(hwnd,GW_HWNDNEXT); - } -#endif - -// For WINE - -#if defined(GetWindowStyle) - #undef GetWindowStyle -#endif - -// For ming and cygwin - -// GetFirstChild -#ifdef GetFirstChild - #undef GetFirstChild - inline HWND GetFirstChild(HWND h) - { - return GetTopWindow(h); - } -#endif - - -// GetNextSibling -#ifdef GetNextSibling - #undef GetNextSibling - inline HWND GetNextSibling(HWND h) - { - return GetWindow(h, GW_HWNDNEXT); - } -#endif - - -#ifdef Yield - #undef Yield -#endif - - -#if defined(__WXWINCE__) && defined(DrawIcon) //#ifdef DrawIcon - #undef DrawIcon - inline BOOL DrawIcon(HDC hdc, int x, int y, HICON hicon) - { - return DrawIconEx(hdc,x,y,hicon,0,0,0,NULL, DI_NORMAL) ; - } -#endif - - -// GetWindowProc -//ifdef GetWindowProc -// #undef GetWindowProc -//endif -//ifdef GetNextChild -// #undef GetNextChild -//endif - -// #endif // _WX_WINUNDEF_H_ - diff --git a/wxWidgets/include/wx/msw/wrapcctl.h b/wxWidgets/include/wx/msw/wrapcctl.h deleted file mode 100644 index ecd206db3d..0000000000 --- a/wxWidgets/include/wx/msw/wrapcctl.h +++ /dev/null @@ -1,62 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: wx/msw/wrapcctl.h -// Purpose: Wrapper for the standard <commctrl.h> header -// Author: Vadim Zeitlin -// Modified by: -// Created: 03.08.2003 -// RCS-ID: $Id: wrapcctl.h 41054 2006-09-07 19:01:45Z ABX $ -// Copyright: (c) 2003 Vadim Zeitlin <vadim@wxwidgets.org> -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_MSW_WRAPCCTL_H_ -#define _WX_MSW_WRAPCCTL_H_ - -// define _WIN32_IE to a high value because we always check for the version -// of installed DLLs at runtime anyway (see wxApp::GetComCtl32Version()) unless -// the user really doesn't want it and had defined it to a (presumably lower) -// value -// -// just for the reference, here is the table showing what the different value -// of _WIN32_IE correspond to: -// -// 0x0200 for comctl32.dll 4.00 shipped with Win95/NT 4.0 -// 0x0300 4.70 IE 3.x -// 0x0400 4.71 IE 4.0 -// 0x0401 4.72 IE 4.01 and Win98 -// 0x0500 5.80 IE 5.x -// 0x0500 5.81 Win2k/ME -// 0x0600 6.00 WinXP - -#ifndef _WIN32_IE - // use maximal set of features by default, we check for them during - // run-time anyhow - #define _WIN32_IE 0x0600 -#endif // !defined(_WIN32_IE) - -#include "wx/msw/wrapwin.h" - -#include <commctrl.h> - -// define things which might be missing from our commctrl.h -#include "wx/msw/missing.h" - -// Set Unicode format for a common control -inline void wxSetCCUnicodeFormat(HWND WXUNUSED_IN_WINCE(hwnd)) -{ -#ifndef __WXWINCE__ - ::SendMessage(hwnd, CCM_SETUNICODEFORMAT, wxUSE_UNICODE, 0); -#else // !__WXWINCE__ - // here it should be already in Unicode anyhow -#endif // __WXWINCE__/!__WXWINCE__ -} - -#if wxUSE_GUI -// Return the default font for the common controls -// -// this is implemented in msw/settings.cpp -class wxFont; -extern wxFont wxGetCCDefaultFont(); -#endif - -#endif // _WX_MSW_WRAPCCTL_H_ diff --git a/wxWidgets/include/wx/msw/wrapcdlg.h b/wxWidgets/include/wx/msw/wrapcdlg.h deleted file mode 100644 index 733e1b5f99..0000000000 --- a/wxWidgets/include/wx/msw/wrapcdlg.h +++ /dev/null @@ -1,28 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: wx/msw/wrapcdlg.h -// Purpose: Wrapper for the standard <commdlg.h> header -// Author: Wlodzimierz ABX Skiba -// Modified by: -// Created: 22.03.2005 -// RCS-ID: $Id: wrapcdlg.h 43151 2006-11-07 09:08:33Z JS $ -// Copyright: (c) 2005 Wlodzimierz Skiba -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_MSW_WRAPCDLG_H_ -#define _WX_MSW_WRAPCDLG_H_ - -#include "wx/defs.h" - -#include "wx/msw/wrapwin.h" -#include "wx/msw/private.h" -#include "wx/msw/missing.h" - -#if wxUSE_COMMON_DIALOGS && !defined(__SMARTPHONE__) && !defined(__WXMICROWIN__) - #include <commdlg.h> -#endif - -#include "wx/msw/winundef.h" - -#endif // _WX_MSW_WRAPCDLG_H_ - diff --git a/wxWidgets/include/wx/msw/wrapshl.h b/wxWidgets/include/wx/msw/wrapshl.h deleted file mode 100644 index 72578af613..0000000000 --- a/wxWidgets/include/wx/msw/wrapshl.h +++ /dev/null @@ -1,90 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: wx/msw/wrapshl.h -// Purpose: wrapper class for stuff from shell32.dll -// Author: Vadim Zeitlin -// Modified by: -// Created: 2004-10-19 -// RCS-ID: $Id: wrapshl.h 40367 2006-07-29 19:19:50Z VZ $ -// Copyright: (c) 2004 Vadim Zeitlin <vadim@wxwindows.org> -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_MSW_WRAPSHL_H_ -#define _WX_MSW_WRAPSHL_H_ - -#ifdef __WXWINCE__ - #include <winreg.h> - #include <objbase.h> - #include <shlguid.h> -#endif - -#include <shlobj.h> - -#include "wx/msw/winundef.h" - -// ---------------------------------------------------------------------------- -// wxItemIdList implements RAII on top of ITEMIDLIST -// ---------------------------------------------------------------------------- - -class wxItemIdList -{ -public: - // ctor takes ownership of the item and will free it - wxItemIdList(LPITEMIDLIST pidl) - { - m_pidl = pidl; - } - - static void Free(LPITEMIDLIST pidl) - { - if ( pidl ) - { - LPMALLOC pMalloc; - SHGetMalloc(&pMalloc); - if ( pMalloc ) - { - pMalloc->Free(pidl); - pMalloc->Release(); - } - else - { - wxLogLastError(wxT("SHGetMalloc")); - } - } - } - - ~wxItemIdList() - { - Free(m_pidl); - } - - // implicit conversion to LPITEMIDLIST - operator LPITEMIDLIST() const { return m_pidl; } - - // get the corresponding path, returns empty string on error - wxString GetPath() const - { - wxString path; - if ( !SHGetPathFromIDList(m_pidl, wxStringBuffer(path, MAX_PATH)) ) - { - wxLogLastError(_T("SHGetPathFromIDList")); - } - - return path; - } - -private: - LPITEMIDLIST m_pidl; - - DECLARE_NO_COPY_CLASS(wxItemIdList) -}; - -// enable autocompleting filenames in the text control with given HWND -// -// this only works on systems with shlwapi.dll 5.0 or later -// -// implemented in src/msw/utilsgui.cpp -extern bool wxEnableFileNameAutoComplete(HWND hwnd); - -#endif // _WX_MSW_WRAPSHL_H_ - diff --git a/wxWidgets/include/wx/msw/wrapwin.h b/wxWidgets/include/wx/msw/wrapwin.h deleted file mode 100644 index 8c3c4cef19..0000000000 --- a/wxWidgets/include/wx/msw/wrapwin.h +++ /dev/null @@ -1,99 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: msw/wrapwin.h -// Purpose: Wrapper around <windows.h>, to be included instead of it -// Author: Vaclav Slavik -// Created: 2003/07/22 -// RCS-ID: $Id: wrapwin.h 53877 2008-05-31 12:43:44Z SN $ -// Copyright: (c) 2003 Vaclav Slavik -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_WRAPWIN_H_ -#define _WX_WRAPWIN_H_ - -#include "wx/platform.h" - -// strict type checking to detect conversion from HFOO to HBAR at compile-time -#ifndef STRICT - #define STRICT 1 -#endif - -// this macro tells windows.h to not define min() and max() as macros: we need -// this as otherwise they conflict with standard C++ functions -#ifndef NOMINMAX - #define NOMINMAX -#endif // NOMINMAX - - -// before including windows.h, define version macros at (currently) maximal -// values because we do all our checks at run-time anyhow -#ifndef WINVER - // the only exception to the above is MSVC 6 which has a time bomb in its - // headers: they warn against using them with WINVER >= 0x0500 as they - // contain only part of the declarations and they're not always correct, so - // don't define WINVER for it at all as this allows everything to work as - // expected both with standard VC6 headers (which define WINVER as 0x0400 - // by default) and headers from a newer SDK (which may define it as 0x0500) - #if !defined(__VISUALC__) || (__VISUALC__ >= 1300) - #define WINVER 0x0600 - #endif -#endif - -#ifndef _WIN32_WINNT - #define _WIN32_WINNT 0x0600 -#endif - -/* Deal with clash with __WINDOWS__ include guard */ -#if defined(__WXWINCE__) && defined(__WINDOWS__) -#undef __WINDOWS__ -#endif - -#include <windows.h> - -#if defined(__WXWINCE__) && !defined(__WINDOWS__) -#define __WINDOWS__ -#endif - -// #undef the macros defined in winsows.h which conflict with code elsewhere -#include "wx/msw/winundef.h" - -// Types DWORD_PTR, ULONG_PTR and so on are used for 64-bit compatability -// in the WINAPI SDK (they are an integral type that is the size of a -// pointer) on MSVC 7 and later. However, they are not available in older -// Platform SDKs, and since they are typedefs and not #defines we simply -// overwrite them if there is a chance that they're not defined -#if (!defined(_MSC_VER) || (_MSC_VER < 1300)) && !defined(__WIN64__) - #define UINT_PTR unsigned int - #define LONG_PTR long - #define ULONG_PTR unsigned long - #define DWORD_PTR unsigned long -#endif // !defined(_MSC_VER) || _MSC_VER < 1300 - -// ---------------------------------------------------------------------------- -// Fix the functions wrongly implemented in unicows.dll -// ---------------------------------------------------------------------------- - -#if wxUSE_UNICODE_MSLU - -#if wxUSE_GUI - -WXDLLEXPORT int wxMSLU_DrawStateW(WXHDC dc, WXHBRUSH br, WXFARPROC outputFunc, - WXLPARAM lData, WXWPARAM wData, - int x, int y, int cx, int cy, - unsigned int flags); -#define DrawStateW(dc, br, func, ld, wd, x, y, cx, cy, flags) \ - wxMSLU_DrawStateW((WXHDC)dc,(WXHBRUSH)br,(WXFARPROC)func, \ - ld, wd, x, y, cx, cy, flags) - -WXDLLEXPORT int wxMSLU_GetOpenFileNameW(void *ofn); -#define GetOpenFileNameW(ofn) wxMSLU_GetOpenFileNameW((void*)ofn) - -WXDLLEXPORT int wxMSLU_GetSaveFileNameW(void *ofn); -#define GetSaveFileNameW(ofn) wxMSLU_GetSaveFileNameW((void*)ofn) - -#endif // wxUSE_GUI - -#endif // wxUSE_UNICODE_MSLU - -#endif // _WX_WRAPWIN_H_ - diff --git a/wxWidgets/include/wx/msw/wx.manifest b/wxWidgets/include/wx/msw/wx.manifest deleted file mode 100644 index ecce6f5c3b..0000000000 --- a/wxWidgets/include/wx/msw/wx.manifest +++ /dev/null @@ -1,22 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="yes"?> -<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"> -<assemblyIdentity - version="0.64.1.0" - processorArchitecture="x86" - name="Controls" - type="win32" -/> -<description>wxWindows application</description> -<dependency> - <dependentAssembly> - <assemblyIdentity - type="win32" - name="Microsoft.Windows.Common-Controls" - version="6.0.0.0" - processorArchitecture="X86" - publicKeyToken="6595b64144ccf1df" - language="*" - /> - </dependentAssembly> -</dependency> -</assembly> diff --git a/wxWidgets/include/wx/msw/wx.rc b/wxWidgets/include/wx/msw/wx.rc deleted file mode 100644 index 60d52dc309..0000000000 --- a/wxWidgets/include/wx/msw/wx.rc +++ /dev/null @@ -1,119 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// File: wx.rc -// Purpose: wxWindows resource definitions. ALWAYS include -// this in your application resource file. -// Author: Julian Smart -// Modified by: -// Created: -// Copyright: (c) Julian Smart -// RCS-ID: $Id: wx.rc 43491 2006-11-18 16:46:59Z VZ $ -// Licence: wxWindows Licence -///////////////////////////////////////////////////////////////////////////// - -#if defined(__MWERKS__) -#include <winresrc.h> -#else -#include <windows.h> -#endif - -#if defined(_WIN32_WCE) - #include "wx/msw/wince/wince.rc" -#endif - -#include "wx/msw/rcdefs.h" - -////////////////////////////////////////////////////////////////////////////// -// -// This is the MDI Window menu -// - -wxWindowMenu MENU DISCARDABLE -BEGIN - POPUP "&Window" - BEGIN - MENUITEM "&Cascade", 4002 - MENUITEM "Tile &Horizontally", 4001 - MENUITEM "Tile &Vertically", 4005 - MENUITEM "", -1 - MENUITEM "&Arrange Icons", 4003 - MENUITEM "&Next", 4004 - END -END - -////////////////////////////////////////////////////////////////////////////// -// -// Standard wxWindows Cursors -// - -WXCURSOR_HAND CURSOR DISCARDABLE "wx/msw/hand.cur" -WXCURSOR_BULLSEYE CURSOR DISCARDABLE "wx/msw/bullseye.cur" -WXCURSOR_PENCIL CURSOR DISCARDABLE "wx/msw/pencil.cur" -WXCURSOR_MAGNIFIER CURSOR DISCARDABLE "wx/msw/magnif1.cur" -WXCURSOR_ROLLER CURSOR DISCARDABLE "wx/msw/roller.cur" -WXCURSOR_PBRUSH CURSOR DISCARDABLE "wx/msw/pbrush.cur" -WXCURSOR_PLEFT CURSOR DISCARDABLE "wx/msw/pntleft.cur" -WXCURSOR_PRIGHT CURSOR DISCARDABLE "wx/msw/pntright.cur" -WXCURSOR_BLANK CURSOR DISCARDABLE "wx/msw/blank.cur" -WXCURSOR_RIGHT_ARROW CURSOR DISCARDABLE "wx/msw/rightarr.cur" -WXCURSOR_CROSS CURSOR DISCARDABLE "wx/msw/cross.cur" - - -////////////////////////////////////////////////////////////////////////////// -// -// Default Icons -// - -// First wx icon in alphabetical order, so it will be used by Explorer if the -// application doesn't have any icons of its own -wxICON_AAA ICON "wx/msw/std.ico" - -//wxDEFAULT_FRAME ICON "wx/msw/std.ico" -//wxDEFAULT_MDIPARENTFRAME ICON "wx/msw/mdi.ico" -//wxDEFAULT_MDICHILDFRAME ICON "wx/msw/child.ico" - -// Standard small icons -wxICON_SMALL_CLOSED_FOLDER ICON "wx/msw/folder1.ico" -wxICON_SMALL_OPEN_FOLDER ICON "wx/msw/folder2.ico" -wxICON_SMALL_FILE ICON "wx/msw/file1.ico" -wxICON_SMALL_COMPUTER ICON "wx/msw/computer.ico" -wxICON_SMALL_DRIVE ICON "wx/msw/drive.ico" -wxICON_SMALL_CDROM ICON "wx/msw/cdrom.ico" -wxICON_SMALL_FLOPPY ICON "wx/msw/floppy.ico" -wxICON_SMALL_REMOVEABLE ICON "wx/msw/removble.ico" - -////////////////////////////////////////////////////////////////////////////// -// -// Bitmaps -// - -// For wxContextHelpButton -csquery BITMAP "wx/msw/csquery.bmp" - -// For obtaining the RGB values of standard colours -wxBITMAP_STD_COLOURS BITMAP "wx/msw/colours.bmp" - -////////////////////////////////////////////////////////////////////////////// -// -// Manifest file for Windows XP -// - -#if !defined(wxUSE_NO_MANIFEST) || (wxUSE_NO_MANIFEST == 0) -#if !defined(WX_MSC_FULL_VER) || WX_MSC_FULL_VER < 140040130 - -// see "about isolated applications" topic in MSDN -#ifdef ISOLATION_AWARE_ENABLED -#define wxMANIFEST_ID 2 -#else -#define wxMANIFEST_ID 1 -#endif - -#if defined(WX_CPU_AMD64) -wxMANIFEST_ID 24 "wx/msw/amd64.manifest" -#elif defined(WX_CPU_IA64) -wxMANIFEST_ID 24 "wx/msw/ia64.manifest" -#elif defined(WX_CPU_X86) -wxMANIFEST_ID 24 "wx/msw/wx.manifest" -#endif - -#endif // !defined(WX_MSC_FULL_VER) || WX_MSC_FULL_VER < 140040130 -#endif // !defined(wxUSE_NO_MANIFEST) || (wxUSE_NO_MANIFEST == 0) diff --git a/wxWidgets/include/wx/notebook.h b/wxWidgets/include/wx/notebook.h deleted file mode 100644 index 40c8ccb96a..0000000000 --- a/wxWidgets/include/wx/notebook.h +++ /dev/null @@ -1,183 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: wx/notebook.h -// Purpose: wxNotebook interface -// Author: Vadim Zeitlin -// Modified by: -// Created: 01.02.01 -// RCS-ID: $Id: notebook.h 42152 2006-10-20 09:16:41Z VZ $ -// Copyright: (c) 1996-2000 Vadim Zeitlin -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_NOTEBOOK_H_BASE_ -#define _WX_NOTEBOOK_H_BASE_ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -#include "wx/defs.h" - -#if wxUSE_NOTEBOOK - -#include "wx/bookctrl.h" - -// ---------------------------------------------------------------------------- -// constants -// ---------------------------------------------------------------------------- - -// wxNotebook hit results, use wxBK_HITTEST so other book controls can share them -// if wxUSE_NOTEBOOK is disabled -enum -{ - wxNB_HITTEST_NOWHERE = wxBK_HITTEST_NOWHERE, - wxNB_HITTEST_ONICON = wxBK_HITTEST_ONICON, - wxNB_HITTEST_ONLABEL = wxBK_HITTEST_ONLABEL, - wxNB_HITTEST_ONITEM = wxBK_HITTEST_ONITEM, - wxNB_HITTEST_ONPAGE = wxBK_HITTEST_ONPAGE -}; - -// wxNotebook flags - -// use common book wxBK_* flags for describing alignment -#define wxNB_DEFAULT wxBK_DEFAULT -#define wxNB_TOP wxBK_TOP -#define wxNB_BOTTOM wxBK_BOTTOM -#define wxNB_LEFT wxBK_LEFT -#define wxNB_RIGHT wxBK_RIGHT - -#define wxNB_FIXEDWIDTH 0x0100 -#define wxNB_MULTILINE 0x0200 -#define wxNB_NOPAGETHEME 0x0400 -#define wxNB_FLAT 0x0800 - - -typedef wxWindow wxNotebookPage; // so far, any window can be a page - -extern WXDLLEXPORT_DATA(const wxChar) wxNotebookNameStr[]; - -#if WXWIN_COMPATIBILITY_2_4 - #define wxNOTEBOOK_NAME wxNotebookNameStr -#endif - -// ---------------------------------------------------------------------------- -// wxNotebookBase: define wxNotebook interface -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxNotebookBase : public wxBookCtrlBase -{ -public: - // ctors - // ----- - - wxNotebookBase() { } - - wxNotebookBase(wxWindow *parent, - wxWindowID winid, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = 0, - const wxString& name = wxNotebookNameStr) ; - - // wxNotebook-specific additions to wxBookCtrlBase interface - // --------------------------------------------------------- - - // get the number of rows for a control with wxNB_MULTILINE style (not all - // versions support it - they will always return 1 then) - virtual int GetRowCount() const { return 1; } - - // set the padding between tabs (in pixels) - virtual void SetPadding(const wxSize& padding) = 0; - - // set the size of the tabs for wxNB_FIXEDWIDTH controls - virtual void SetTabSize(const wxSize& sz) = 0; - - - - // implement some base class functions - virtual wxSize CalcSizeFromPage(const wxSize& sizePage) const; - - // On platforms that support it, get the theme page background colour, else invalid colour - virtual wxColour GetThemeBackgroundColour() const { return wxNullColour; } - - - // send wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING/ED events - - // returns false if the change to nPage is vetoed by the program - bool SendPageChangingEvent(int nPage); - - // sends the event about page change from old to new (or GetSelection() if - // new is -1) - void SendPageChangedEvent(int nPageOld, int nPageNew = -1); - - -protected: - DECLARE_NO_COPY_CLASS(wxNotebookBase) -}; - -// ---------------------------------------------------------------------------- -// notebook event class and related stuff -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxNotebookEvent : public wxBookCtrlBaseEvent -{ -public: - wxNotebookEvent(wxEventType commandType = wxEVT_NULL, int winid = 0, - int nSel = -1, int nOldSel = -1) - : wxBookCtrlBaseEvent(commandType, winid, nSel, nOldSel) - { - } - - wxNotebookEvent(const wxNotebookEvent& event) - : wxBookCtrlBaseEvent(event) - { - } - - virtual wxEvent *Clone() const { return new wxNotebookEvent(*this); } - -private: - DECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxNotebookEvent) -}; - -BEGIN_DECLARE_EVENT_TYPES() - DECLARE_EVENT_TYPE(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED, 802) - DECLARE_EVENT_TYPE(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING, 803) -END_DECLARE_EVENT_TYPES() - -typedef void (wxEvtHandler::*wxNotebookEventFunction)(wxNotebookEvent&); - -#define wxNotebookEventHandler(func) \ - (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxNotebookEventFunction, &func) - -#define EVT_NOTEBOOK_PAGE_CHANGED(winid, fn) \ - wx__DECLARE_EVT1(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED, winid, wxNotebookEventHandler(fn)) - -#define EVT_NOTEBOOK_PAGE_CHANGING(winid, fn) \ - wx__DECLARE_EVT1(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING, winid, wxNotebookEventHandler(fn)) - -// ---------------------------------------------------------------------------- -// wxNotebook class itself -// ---------------------------------------------------------------------------- - -#if defined(__WXUNIVERSAL__) - #include "wx/univ/notebook.h" -#elif defined(__WXMSW__) - #include "wx/msw/notebook.h" -#elif defined(__WXMOTIF__) - #include "wx/generic/notebook.h" -#elif defined(__WXGTK20__) - #include "wx/gtk/notebook.h" -#elif defined(__WXGTK__) - #include "wx/gtk1/notebook.h" -#elif defined(__WXMAC__) - #include "wx/mac/notebook.h" -#elif defined(__WXCOCOA__) - #include "wx/cocoa/notebook.h" -#elif defined(__WXPM__) - #include "wx/os2/notebook.h" -#endif - -#endif // wxUSE_NOTEBOOK - -#endif - // _WX_NOTEBOOK_H_BASE_ diff --git a/wxWidgets/include/wx/numdlg.h b/wxWidgets/include/wx/numdlg.h deleted file mode 100644 index a3a1505fc2..0000000000 --- a/wxWidgets/include/wx/numdlg.h +++ /dev/null @@ -1,23 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/numdlg.h -// Purpose: wxNumberEntryDialog class -// Author: John Labenski -// Modified by: -// Created: 07.02.04 (extracted from wx/textdlg.h) -// RCS-ID: $Id: numdlg.h 37157 2006-01-26 15:33:27Z ABX $ -// Copyright: (c) John Labenski -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_NUMDLGDLG_H_BASE_ -#define _WX_NUMDLGDLG_H_BASE_ - -#include "wx/defs.h" - -#if wxUSE_NUMBERDLG - -#include "wx/generic/numdlgg.h" - -#endif // wxUSE_NUMBERDLG - -#endif // _WX_NUMDLGDLG_H_BASE_ diff --git a/wxWidgets/include/wx/object.h b/wxWidgets/include/wx/object.h deleted file mode 100644 index 38d2e16153..0000000000 --- a/wxWidgets/include/wx/object.h +++ /dev/null @@ -1,569 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/object.h -// Purpose: wxObject class, plus run-time type information macros -// Author: Julian Smart -// Modified by: Ron Lee -// Created: 01/02/97 -// RCS-ID: $Id: object.h 61872 2009-09-09 22:37:05Z VZ $ -// Copyright: (c) 1997 Julian Smart -// (c) 2001 Ron Lee <ron@debian.org> -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_OBJECTH__ -#define _WX_OBJECTH__ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -#include "wx/memory.h" - -class WXDLLIMPEXP_FWD_BASE wxObject; - -#ifndef wxUSE_EXTENDED_RTTI -#define wxUSE_EXTENDED_RTTI 0 -#endif - -#if wxUSE_EXTENDED_RTTI -#include "wx/xti.h" -#else - -// ---------------------------------------------------------------------------- -// conditional compilation -// ---------------------------------------------------------------------------- - -class WXDLLIMPEXP_FWD_BASE wxClassInfo; -class WXDLLIMPEXP_FWD_BASE wxHashTable; -class WXDLLIMPEXP_FWD_BASE wxObjectRefData; - -// ---------------------------------------------------------------------------- -// wxClassInfo -// ---------------------------------------------------------------------------- - -typedef wxObject *(*wxObjectConstructorFn)(void); - -class WXDLLIMPEXP_BASE wxClassInfo -{ -public: - wxClassInfo( const wxChar *className, - const wxClassInfo *baseInfo1, - const wxClassInfo *baseInfo2, - int size, - wxObjectConstructorFn ctor ) - : m_className(className) - , m_objectSize(size) - , m_objectConstructor(ctor) - , m_baseInfo1(baseInfo1) - , m_baseInfo2(baseInfo2) - , m_next(sm_first) - { - sm_first = this; - Register(); - } - - ~wxClassInfo(); - - wxObject *CreateObject() const - { return m_objectConstructor ? (*m_objectConstructor)() : 0; } - bool IsDynamic() const { return (NULL != m_objectConstructor); } - - const wxChar *GetClassName() const { return m_className; } - const wxChar *GetBaseClassName1() const - { return m_baseInfo1 ? m_baseInfo1->GetClassName() : NULL; } - const wxChar *GetBaseClassName2() const - { return m_baseInfo2 ? m_baseInfo2->GetClassName() : NULL; } - const wxClassInfo *GetBaseClass1() const { return m_baseInfo1; } - const wxClassInfo *GetBaseClass2() const { return m_baseInfo2; } - int GetSize() const { return m_objectSize; } - - wxObjectConstructorFn GetConstructor() const - { return m_objectConstructor; } - static const wxClassInfo *GetFirst() { return sm_first; } - const wxClassInfo *GetNext() const { return m_next; } - static wxClassInfo *FindClass(const wxChar *className); - - // Climb upwards through inheritance hierarchy. - // Dual inheritance is catered for. - - bool IsKindOf(const wxClassInfo *info) const - { - return info != 0 && - ( info == this || - ( m_baseInfo1 && m_baseInfo1->IsKindOf(info) ) || - ( m_baseInfo2 && m_baseInfo2->IsKindOf(info) ) ); - } - -#if WXWIN_COMPATIBILITY_2_4 - // Initializes parent pointers and hash table for fast searching. - wxDEPRECATED( static void InitializeClasses() ); - // Cleans up hash table used for fast searching. - wxDEPRECATED( static void CleanUpClasses() ); -#endif - -public: - const wxChar *m_className; - int m_objectSize; - wxObjectConstructorFn m_objectConstructor; - - // Pointers to base wxClassInfos: set in InitializeClasses - - const wxClassInfo *m_baseInfo1; - const wxClassInfo *m_baseInfo2; - - // class info object live in a linked list: - // pointers to its head and the next element in it - - static wxClassInfo *sm_first; - wxClassInfo *m_next; - - // FIXME: this should be private (currently used directly by way too - // many clients) - static wxHashTable *sm_classTable; - -private: - // InitializeClasses() helper - static wxClassInfo *GetBaseByName(const wxChar *name); - - DECLARE_NO_COPY_CLASS(wxClassInfo) - -protected: - // registers the class - void Register(); - void Unregister(); -}; - -WXDLLIMPEXP_BASE wxObject *wxCreateDynamicObject(const wxChar *name); - -#if WXWIN_COMPATIBILITY_2_4 -inline void wxClassInfo::InitializeClasses() {} -inline void wxClassInfo::CleanUpClasses() {} -#endif - -// ---------------------------------------------------------------------------- -// Dynamic class macros -// ---------------------------------------------------------------------------- - -#define DECLARE_ABSTRACT_CLASS(name) \ - public: \ - static wxClassInfo ms_classInfo; \ - virtual wxClassInfo *GetClassInfo() const; - -#define DECLARE_DYNAMIC_CLASS_NO_ASSIGN(name) \ - DECLARE_NO_ASSIGN_CLASS(name) \ - DECLARE_DYNAMIC_CLASS(name) - -#define DECLARE_DYNAMIC_CLASS_NO_COPY(name) \ - DECLARE_NO_COPY_CLASS(name) \ - DECLARE_DYNAMIC_CLASS(name) - -#define DECLARE_DYNAMIC_CLASS(name) \ - DECLARE_ABSTRACT_CLASS(name) \ - static wxObject* wxCreateObject(); - -#define DECLARE_CLASS(name) DECLARE_DYNAMIC_CLASS(name) - - -// common part of the macros below -#define wxIMPLEMENT_CLASS_COMMON(name, basename, baseclsinfo2, func) \ - wxClassInfo name::ms_classInfo(wxT(#name), \ - &basename::ms_classInfo, \ - baseclsinfo2, \ - (int) sizeof(name), \ - (wxObjectConstructorFn) func); \ - \ - wxClassInfo *name::GetClassInfo() const \ - { return &name::ms_classInfo; } - -#define wxIMPLEMENT_CLASS_COMMON1(name, basename, func) \ - wxIMPLEMENT_CLASS_COMMON(name, basename, NULL, func) - -#define wxIMPLEMENT_CLASS_COMMON2(name, basename1, basename2, func) \ - wxIMPLEMENT_CLASS_COMMON(name, basename1, &basename2::ms_classInfo, func) - -// ----------------------------------- -// for concrete classes -// ----------------------------------- - - // Single inheritance with one base class -#define IMPLEMENT_DYNAMIC_CLASS(name, basename) \ - wxIMPLEMENT_CLASS_COMMON1(name, basename, name::wxCreateObject) \ - wxObject* name::wxCreateObject() \ - { return new name; } - - // Multiple inheritance with two base classes -#define IMPLEMENT_DYNAMIC_CLASS2(name, basename1, basename2) \ - wxIMPLEMENT_CLASS_COMMON2(name, basename1, basename2, \ - name::wxCreateObject) \ - wxObject* name::wxCreateObject() \ - { return new name; } - -// ----------------------------------- -// for abstract classes -// ----------------------------------- - - // Single inheritance with one base class - -#define IMPLEMENT_ABSTRACT_CLASS(name, basename) \ - wxIMPLEMENT_CLASS_COMMON1(name, basename, NULL) - - // Multiple inheritance with two base classes - -#define IMPLEMENT_ABSTRACT_CLASS2(name, basename1, basename2) \ - wxIMPLEMENT_CLASS_COMMON2(name, basename1, basename2, NULL) - -#define IMPLEMENT_CLASS IMPLEMENT_ABSTRACT_CLASS -#define IMPLEMENT_CLASS2 IMPLEMENT_ABSTRACT_CLASS2 - -#endif // !wxUSE_EXTENDED_RTTI - - -// ----------------------------------- -// for pluggable classes -// ----------------------------------- - - // NOTE: this should probably be the very first statement - // in the class declaration so wxPluginSentinel is - // the first member initialised and the last destroyed. - -// _DECLARE_DL_SENTINEL(name) wxPluginSentinel m_pluginsentinel; - -#if wxUSE_NESTED_CLASSES - -#define _DECLARE_DL_SENTINEL(name, exportdecl) \ -class exportdecl name##PluginSentinel { \ -private: \ - static const wxString sm_className; \ -public: \ - name##PluginSentinel(); \ - ~name##PluginSentinel(); \ -}; \ -name##PluginSentinel m_pluginsentinel; - -#define _IMPLEMENT_DL_SENTINEL(name) \ - const wxString name::name##PluginSentinel::sm_className(#name); \ - name::name##PluginSentinel::name##PluginSentinel() { \ - wxPluginLibrary *e = (wxPluginLibrary*) wxPluginLibrary::ms_classes.Get(#name); \ - if( e != 0 ) { e->RefObj(); } \ - } \ - name::name##PluginSentinel::~name##PluginSentinel() { \ - wxPluginLibrary *e = (wxPluginLibrary*) wxPluginLibrary::ms_classes.Get(#name); \ - if( e != 0 ) { e->UnrefObj(); } \ - } -#else - -#define _DECLARE_DL_SENTINEL(name) -#define _IMPLEMENT_DL_SENTINEL(name) - -#endif // wxUSE_NESTED_CLASSES - -#define DECLARE_PLUGGABLE_CLASS(name) \ - DECLARE_DYNAMIC_CLASS(name) _DECLARE_DL_SENTINEL(name, WXDLLEXPORT) -#define DECLARE_ABSTRACT_PLUGGABLE_CLASS(name) \ - DECLARE_ABSTRACT_CLASS(name) _DECLARE_DL_SENTINEL(name, WXDLLEXPORT) - -#define DECLARE_USER_EXPORTED_PLUGGABLE_CLASS(name, usergoo) \ - DECLARE_DYNAMIC_CLASS(name) _DECLARE_DL_SENTINEL(name, usergoo) -#define DECLARE_USER_EXPORTED_ABSTRACT_PLUGGABLE_CLASS(name, usergoo) \ - DECLARE_ABSTRACT_CLASS(name) _DECLARE_DL_SENTINEL(name, usergoo) - -#define IMPLEMENT_PLUGGABLE_CLASS(name, basename) \ - IMPLEMENT_DYNAMIC_CLASS(name, basename) _IMPLEMENT_DL_SENTINEL(name) -#define IMPLEMENT_PLUGGABLE_CLASS2(name, basename1, basename2) \ - IMPLEMENT_DYNAMIC_CLASS2(name, basename1, basename2) _IMPLEMENT_DL_SENTINEL(name) -#define IMPLEMENT_ABSTRACT_PLUGGABLE_CLASS(name, basename) \ - IMPLEMENT_ABSTRACT_CLASS(name, basename) _IMPLEMENT_DL_SENTINEL(name) -#define IMPLEMENT_ABSTRACT_PLUGGABLE_CLASS2(name, basename1, basename2) \ - IMPLEMENT_ABSTRACT_CLASS2(name, basename1, basename2) _IMPLEMENT_DL_SENTINEL(name) - -#define IMPLEMENT_USER_EXPORTED_PLUGGABLE_CLASS(name, basename) \ - IMPLEMENT_PLUGGABLE_CLASS(name, basename) -#define IMPLEMENT_USER_EXPORTED_PLUGGABLE_CLASS2(name, basename1, basename2) \ - IMPLEMENT_PLUGGABLE_CLASS2(name, basename1, basename2) -#define IMPLEMENT_USER_EXPORTED_ABSTRACT_PLUGGABLE_CLASS(name, basename) \ - IMPLEMENT_ABSTRACT_PLUGGABLE_CLASS(name, basename) -#define IMPLEMENT_USER_EXPORTED_ABSTRACT_PLUGGABLE_CLASS2(name, basename1, basename2) \ - IMPLEMENT_ABSTRACT_PLUGGABLE_CLASS2(name, basename1, basename2) - -#define CLASSINFO(name) (&name::ms_classInfo) - -#define wxIS_KIND_OF(obj, className) obj->IsKindOf(&className::ms_classInfo) - -// Just seems a bit nicer-looking (pretend it's not a macro) -#define wxIsKindOf(obj, className) obj->IsKindOf(&className::ms_classInfo) - -// this cast does some more checks at compile time as it uses static_cast -// internally -// -// note that it still has different semantics from dynamic_cast<> and so can't -// be replaced by it as long as there are any compilers not supporting it -#define wxDynamicCast(obj, className) \ - ((className *) wxCheckDynamicCast( \ - wx_const_cast(wxObject *, wx_static_cast(const wxObject *, \ - wx_const_cast(className *, wx_static_cast(const className *, obj)))), \ - &className::ms_classInfo)) - -// The 'this' pointer is always true, so use this version -// to cast the this pointer and avoid compiler warnings. -#define wxDynamicCastThis(className) \ - (IsKindOf(&className::ms_classInfo) ? (className *)(this) : (className *)0) - -#ifdef __WXDEBUG__ -inline void* wxCheckCast(void *ptr) -{ - wxASSERT_MSG( ptr, wxT("wxStaticCast() used incorrectly") ); - return ptr; -} -#define wxStaticCast(obj, className) \ - ((className *)wxCheckCast(wxDynamicCast(obj, className))) - -#else // !__WXDEBUG__ -#define wxStaticCast(obj, className) \ - wx_const_cast(className *, wx_static_cast(const className *, obj)) - -#endif // __WXDEBUG__ - -// ---------------------------------------------------------------------------- -// set up memory debugging macros -// ---------------------------------------------------------------------------- - -/* - Which new/delete operator variants do we want? - - _WX_WANT_NEW_SIZET_WXCHAR_INT = void *operator new (size_t size, wxChar *fileName = 0, int lineNum = 0) - _WX_WANT_DELETE_VOID = void operator delete (void * buf) - _WX_WANT_DELETE_VOID_CONSTCHAR_SIZET = void operator delete (void *buf, const char *_fname, size_t _line) - _WX_WANT_DELETE_VOID_WXCHAR_INT = void operator delete(void *buf, wxChar*, int) - _WX_WANT_ARRAY_NEW_SIZET_WXCHAR_INT = void *operator new[] (size_t size, wxChar *fileName , int lineNum = 0) - _WX_WANT_ARRAY_DELETE_VOID = void operator delete[] (void *buf) - _WX_WANT_ARRAY_DELETE_VOID_WXCHAR_INT = void operator delete[] (void* buf, wxChar*, int ) -*/ - -#if defined(__WXDEBUG__) && wxUSE_MEMORY_TRACING - -// All compilers get this one -#define _WX_WANT_NEW_SIZET_WXCHAR_INT - -// Everyone except Visage gets the next one -#ifndef __VISAGECPP__ - #define _WX_WANT_DELETE_VOID -#endif - -// Only visage gets this one under the correct circumstances -#if defined(__VISAGECPP__) && __DEBUG_ALLOC__ - #define _WX_WANT_DELETE_VOID_CONSTCHAR_SIZET -#endif - -// Only VC++ 6 and CodeWarrior get overloaded delete that matches new -#if (defined(__VISUALC__) && (__VISUALC__ >= 1200)) || \ - (defined(__MWERKS__) && (__MWERKS__ >= 0x2400)) - #define _WX_WANT_DELETE_VOID_WXCHAR_INT -#endif - -// Now see who (if anyone) gets the array memory operators -#if wxUSE_ARRAY_MEMORY_OPERATORS - - // Everyone except Visual C++ (cause problems for VC++ - crashes) - #if !defined(__VISUALC__) - #define _WX_WANT_ARRAY_NEW_SIZET_WXCHAR_INT - #endif - - // Everyone except Visual C++ (cause problems for VC++ - crashes) - #if !defined(__VISUALC__) - #define _WX_WANT_ARRAY_DELETE_VOID - #endif - - // Only CodeWarrior 6 or higher - #if defined(__MWERKS__) && (__MWERKS__ >= 0x2400) - #define _WX_WANT_ARRAY_DELETE_VOID_WXCHAR_INT - #endif - -#endif // wxUSE_ARRAY_MEMORY_OPERATORS - -#endif // __WXDEBUG__ && wxUSE_MEMORY_TRACING - -// ---------------------------------------------------------------------------- -// wxObjectRefData: ref counted data meant to be stored in wxObject -// ---------------------------------------------------------------------------- - -class WXDLLIMPEXP_BASE wxObjectRefData -{ - friend class WXDLLIMPEXP_FWD_BASE wxObject; - -public: - wxObjectRefData() : m_count(1) { } - virtual ~wxObjectRefData() { } - - int GetRefCount() const { return m_count; } - -private: - int m_count; -}; - -// ---------------------------------------------------------------------------- -// wxObject: the root class of wxWidgets object hierarchy -// ---------------------------------------------------------------------------- - -class WXDLLIMPEXP_BASE wxObject -{ - DECLARE_ABSTRACT_CLASS(wxObject) - -public: - wxObject() { m_refData = NULL; } - virtual ~wxObject() { UnRef(); } - - wxObject(const wxObject& other) - { - m_refData = other.m_refData; - if (m_refData) - m_refData->m_count++; - } - - wxObject& operator=(const wxObject& other) - { - if ( this != &other ) - { - Ref(other); - } - return *this; - } - - bool IsKindOf(wxClassInfo *info) const; - - - // Turn on the correct set of new and delete operators - -#ifdef _WX_WANT_NEW_SIZET_WXCHAR_INT - void *operator new ( size_t size, const wxChar *fileName = NULL, int lineNum = 0 ); -#endif - -#ifdef _WX_WANT_DELETE_VOID - void operator delete ( void * buf ); -#endif - -#ifdef _WX_WANT_DELETE_VOID_CONSTCHAR_SIZET - void operator delete ( void *buf, const char *_fname, size_t _line ); -#endif - -#ifdef _WX_WANT_DELETE_VOID_WXCHAR_INT - void operator delete ( void *buf, const wxChar*, int ); -#endif - -#ifdef _WX_WANT_ARRAY_NEW_SIZET_WXCHAR_INT - void *operator new[] ( size_t size, const wxChar *fileName = NULL, int lineNum = 0 ); -#endif - -#ifdef _WX_WANT_ARRAY_DELETE_VOID - void operator delete[] ( void *buf ); -#endif - -#ifdef _WX_WANT_ARRAY_DELETE_VOID_WXCHAR_INT - void operator delete[] (void* buf, const wxChar*, int ); -#endif - - // ref counted data handling methods - - // get/set - wxObjectRefData *GetRefData() const { return m_refData; } - void SetRefData(wxObjectRefData *data) { m_refData = data; } - - // make a 'clone' of the object - void Ref(const wxObject& clone); - - // destroy a reference - void UnRef(); - - // Make sure this object has only one reference - void UnShare() { AllocExclusive(); } - - // check if this object references the same data as the other one - bool IsSameAs(const wxObject& o) const { return m_refData == o.m_refData; } - -protected: - // ensure that our data is not shared with anybody else: if we have no - // data, it is created using CreateRefData() below, if we have shared data - // it is copied using CloneRefData(), otherwise nothing is done - void AllocExclusive(); - - // both methods must be implemented if AllocExclusive() is used, not pure - // virtual only because of the backwards compatibility reasons - - // create a new m_refData - virtual wxObjectRefData *CreateRefData() const; - - // create a new m_refData initialized with the given one - virtual wxObjectRefData *CloneRefData(const wxObjectRefData *data) const; - - wxObjectRefData *m_refData; -}; - -inline wxObject *wxCheckDynamicCast(wxObject *obj, wxClassInfo *classInfo) -{ - return obj && obj->GetClassInfo()->IsKindOf(classInfo) ? obj : NULL; -} - -#if wxUSE_EXTENDED_RTTI -class WXDLLIMPEXP_BASE wxDynamicObject : public wxObject -{ - friend class WXDLLIMPEXP_BASE wxDynamicClassInfo ; -public: - // instantiates this object with an instance of its superclass - wxDynamicObject(wxObject* superClassInstance, const wxDynamicClassInfo *info) ; - virtual ~wxDynamicObject(); - - void SetProperty (const wxChar *propertyName, const wxxVariant &value); - wxxVariant GetProperty (const wxChar *propertyName) const ; - - // get the runtime identity of this object - wxClassInfo *GetClassInfo() const - { -#ifdef _MSC_VER - return (wxClassInfo*) m_classInfo; -#else - return wx_const_cast(wxClassInfo *, m_classInfo); -#endif - } - - wxObject* GetSuperClassInstance() const - { - return m_superClassInstance ; - } -private : - // removes an existing runtime-property - void RemoveProperty( const wxChar *propertyName ) ; - - // renames an existing runtime-property - void RenameProperty( const wxChar *oldPropertyName , const wxChar *newPropertyName ) ; - - wxObject *m_superClassInstance ; - const wxDynamicClassInfo *m_classInfo; - struct wxDynamicObjectInternal; - wxDynamicObjectInternal *m_data; -}; -#endif - -// ---------------------------------------------------------------------------- -// more debugging macros -// ---------------------------------------------------------------------------- - -// Redefine new to be the debugging version. This doesn't work with all -// compilers, in which case you need to use WXDEBUG_NEW explicitly if you wish -// to use the debugging version. - -#ifdef __WXDEBUG__ - #define WXDEBUG_NEW new(__TFILE__,__LINE__) - - #if wxUSE_DEBUG_NEW_ALWAYS - #if wxUSE_GLOBAL_MEMORY_OPERATORS - #define new WXDEBUG_NEW - #elif defined(__VISUALC__) - // Including this file redefines new and allows leak reports to - // contain line numbers - #include "wx/msw/msvcrt.h" - #endif - #endif // wxUSE_DEBUG_NEW_ALWAYS -#else // !__WXDEBUG__ - #define WXDEBUG_NEW new -#endif // __WXDEBUG__/!__WXDEBUG__ - -#endif // _WX_OBJECTH__ diff --git a/wxWidgets/include/wx/odcombo.h b/wxWidgets/include/wx/odcombo.h deleted file mode 100644 index 9bfe201303..0000000000 --- a/wxWidgets/include/wx/odcombo.h +++ /dev/null @@ -1,393 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/odcombo.h -// Purpose: wxOwnerDrawnComboBox and wxVListBoxPopup -// Author: Jaakko Salli -// Modified by: -// Created: Apr-30-2006 -// RCS-ID: $Id: odcombo.h 64259 2010-05-09 10:48:37Z JMS $ -// Copyright: (c) Jaakko Salli -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_ODCOMBO_H_ -#define _WX_ODCOMBO_H_ - -#include "wx/defs.h" - -#if wxUSE_ODCOMBOBOX - -#include "wx/combo.h" -#include "wx/ctrlsub.h" -#include "wx/vlbox.h" -#include "wx/timer.h" - - -// -// New window styles for wxOwnerDrawnComboBox -// -enum -{ - // Double-clicking cycles item if wxCB_READONLY is also used. - wxODCB_DCLICK_CYCLES = wxCC_SPECIAL_DCLICK, - - // If used, control itself is not custom paint using callback. - // Even if this is not used, writable combo is never custom paint - // until SetCustomPaintWidth is called - wxODCB_STD_CONTROL_PAINT = 0x1000 -}; - - -// -// Callback flags (see wxOwnerDrawnComboBox::OnDrawItem) -// -enum -{ - // when set, we are painting the selected item in control, - // not in the popup - wxODCB_PAINTING_CONTROL = 0x0001, - - - // when set, we are painting an item which should have - // focus rectangle painted in the background. Text colour - // and clipping region are then appropriately set in - // the default OnDrawBackground implementation. - wxODCB_PAINTING_SELECTED = 0x0002 -}; - - -// ---------------------------------------------------------------------------- -// wxVListBoxComboPopup is a wxVListBox customized to act as a popup control. -// -// Notes: -// wxOwnerDrawnComboBox uses this as its popup. However, it always derives -// from native wxComboCtrl. If you need to use this popup with -// wxGenericComboControl, then remember that vast majority of item manipulation -// functionality is implemented in the wxVListBoxComboPopup class itself. -// -// ---------------------------------------------------------------------------- - - -class WXDLLIMPEXP_ADV wxVListBoxComboPopup : public wxVListBox, - public wxComboPopup -{ - friend class wxOwnerDrawnComboBox; -public: - - // init and dtor - wxVListBoxComboPopup() : wxVListBox(), wxComboPopup() { } - virtual ~wxVListBoxComboPopup(); - - // required virtuals - virtual void Init(); - virtual bool Create(wxWindow* parent); - virtual wxWindow *GetControl() { return this; } - virtual void SetStringValue( const wxString& value ); - virtual wxString GetStringValue() const; - - // more customization - virtual void OnPopup(); - virtual wxSize GetAdjustedSize( int minWidth, int prefHeight, int maxHeight ); - virtual void PaintComboControl( wxDC& dc, const wxRect& rect ); - virtual void OnComboKeyEvent( wxKeyEvent& event ); - virtual void OnComboDoubleClick(); - virtual bool LazyCreate(); - - // Item management - void SetSelection( int item ); - void Insert( const wxString& item, int pos ); - int Append(const wxString& item); - void Clear(); - void Delete( unsigned int item ); - void SetItemClientData(unsigned int n, void* clientData, wxClientDataType clientDataItemsType); - void *GetItemClientData(unsigned int n) const; - void SetString( int item, const wxString& str ); - wxString GetString( int item ) const; - unsigned int GetCount() const; - int FindString(const wxString& s, bool bCase = false) const; - int GetSelection() const; - - //void Populate( int n, const wxString choices[] ); - void Populate( const wxArrayString& choices ); - void ClearClientDatas(); - - // helpers - int GetItemAtPosition( const wxPoint& pos ) { return HitTest(pos); } - wxCoord GetTotalHeight() const { return EstimateTotalHeight(); } - wxCoord GetLineHeight(int line) const { return OnGetLineHeight(line); } - -protected: - - // Called by OnComboDoubleClick and OnComboKeyEvent - bool HandleKey( int keycode, bool saturate, wxChar unicode = 0 ); - - // sends combobox select event from the parent combo control - void SendComboBoxEvent( int selection ); - - // gets value, sends event and dismisses - void DismissWithEvent(); - - // OnMeasureItemWidth will be called on next GetAdjustedSize. - void ItemWidthChanged(unsigned int item) - { - m_widths[item] = -1; - m_widthsDirty = true; - } - - // Callbacks for drawing and measuring items. Override in a derived class for - // owner-drawnness. Font, background and text colour have been prepared according - // to selection, focus and such. - // - // item: item index to be drawn, may be wxNOT_FOUND when painting combo control itself - // and there is no valid selection - // flags: wxODCB_PAINTING_CONTROL is set if painting to combo control instead of list - // NOTE: If wxVListBoxComboPopup is used with wxComboCtrl class not derived from - // wxOwnerDrawnComboBox, this method must be overridden. - virtual void OnDrawItem( wxDC& dc, const wxRect& rect, int item, int flags ) const; - - // This is same as in wxVListBox - virtual wxCoord OnMeasureItem( size_t item ) const; - - // Return item width, or -1 for calculating from text extent (default) - virtual wxCoord OnMeasureItemWidth( size_t item ) const; - - // Draw item and combo control background. Flags are same as with OnDrawItem. - // NB: Can't use name OnDrawBackground because of virtual function hiding warnings. - virtual void OnDrawBg(wxDC& dc, const wxRect& rect, int item, int flags) const; - - // Additional wxVListBox implementation (no need to override in derived classes) - virtual void OnDrawItem(wxDC& dc, const wxRect& rect, size_t n) const; - void OnDrawBackground(wxDC& dc, const wxRect& rect, size_t n) const; - - // filter mouse move events happening outside the list box - // move selection with cursor - void OnMouseMove(wxMouseEvent& event); - void OnMouseWheel(wxMouseEvent& event); - void OnKey(wxKeyEvent& event); - void OnLeftClick(wxMouseEvent& event); - - // Return the widest item width (recalculating it if necessary) - int GetWidestItemWidth() { CalcWidths(); return m_widestWidth; } - - // Return the index of the widest item (recalculating it if necessary) - int GetWidestItem() { CalcWidths(); return m_widestItem; } - - // Stop partial completion (when some other event occurs) - void StopPartialCompletion(); - -#ifdef __WXMSW__ - // Added to work around a SetFocus() log error. Overriding virtual member - // function from the primary base class (in this case, wxVListBox) should - // be ABI compatible. - virtual void SetFocus(); -#endif - - wxArrayString m_strings; - wxArrayPtrVoid m_clientDatas; - - wxFont m_useFont; - - //wxString m_stringValue; // displayed text (may be different than m_strings[m_value]) - int m_value; // selection - int m_itemHover; // on which item the cursor is - int m_itemHeight; // default item height (calculate from font size - // and used in the absence of callback) - wxClientDataType m_clientDataItemsType; - -private: - - // Cached item widths (in pixels). - wxArrayInt m_widths; - - // Width of currently widest item. - int m_widestWidth; - - // Index of currently widest item. - int m_widestItem; - - // Measure some items in next GetAdjustedSize? - bool m_widthsDirty; - - // Find widest item in next GetAdjustedSize? - bool m_findWidest; - - // has the mouse been released on this control? - bool m_clicked; - - // Recalculate widths if they are dirty - void CalcWidths(); - - // Partial completion string - wxString m_partialCompletionString; - -#if wxUSE_TIMER - // Partial completion timer - wxTimer m_partialCompletionTimer; -#endif // wxUSE_TIMER - - DECLARE_EVENT_TABLE() -}; - - -// ---------------------------------------------------------------------------- -// wxOwnerDrawnComboBox: a generic wxComboBox that allows custom paint items -// in addition to many other types of customization already allowed by -// the wxComboCtrl. -// ---------------------------------------------------------------------------- - -class WXDLLIMPEXP_ADV wxOwnerDrawnComboBox : public wxComboCtrl, - public wxItemContainer -{ - //friend class wxComboPopupWindow; - friend class wxVListBoxComboPopup; -public: - - // ctors and such - wxOwnerDrawnComboBox() : wxComboCtrl() { Init(); } - - wxOwnerDrawnComboBox(wxWindow *parent, - wxWindowID id, - const wxString& value, - const wxPoint& pos, - const wxSize& size, - int n, - const wxString choices[], - long style = 0, - const wxValidator& validator = wxDefaultValidator, - const wxString& name = wxComboBoxNameStr) - : wxComboCtrl() - { - Init(); - - (void)Create(parent, id, value, pos, size, n, - choices, 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 = wxComboBoxNameStr); - - wxOwnerDrawnComboBox(wxWindow *parent, - wxWindowID id, - const wxString& value, - const wxPoint& pos, - const wxSize& size, - const wxArrayString& choices, - long style, - const wxValidator& validator = wxDefaultValidator, - const wxString& name = wxComboBoxNameStr); - - bool Create(wxWindow *parent, - wxWindowID id, - const wxString& value, - const wxPoint& pos, - const wxSize& size, - int n, - const wxString choices[], - 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); - - virtual ~wxOwnerDrawnComboBox(); - - // Prevent app from using wxComboPopup - void SetPopupControl(wxVListBoxComboPopup* popup) - { - DoSetPopupControl(popup); - } - - // wxControlWithItems methods - virtual void Clear(); - virtual void Delete(unsigned int n); - virtual unsigned int GetCount() const; - virtual wxString GetString(unsigned int n) const; - virtual void SetString(unsigned int n, const wxString& s); - virtual int FindString(const wxString& s, bool bCase = false) const; - virtual void Select(int n); - virtual int GetSelection() const; - virtual void SetSelection(int n) { Select(n); } - - - // Prevent a method from being hidden - virtual void SetSelection(long from, long to) - { - wxComboCtrl::SetSelection(from,to); - } - - // Return the widest item width (recalculating it if necessary) - virtual int GetWidestItemWidth() { EnsurePopupControl(); return GetVListBoxComboPopup()->GetWidestItemWidth(); } - - // Return the index of the widest item (recalculating it if necessary) - virtual int GetWidestItem() { EnsurePopupControl(); return GetVListBoxComboPopup()->GetWidestItem(); } - - wxCONTROL_ITEMCONTAINER_CLIENTDATAOBJECT_RECAST - -protected: - - // Callback for drawing. Font, background and text colour have been - // prepared according to selection, focus and such. - // item: item index to be drawn, may be wxNOT_FOUND when painting combo control itself - // and there is no valid selection - // flags: wxODCB_PAINTING_CONTROL is set if painting to combo control instead of list - virtual void OnDrawItem( wxDC& dc, const wxRect& rect, int item, int flags ) const; - - // Callback for item height, or -1 for default - virtual wxCoord OnMeasureItem( size_t item ) const; - - // Callback for item width, or -1 for default/undetermined - virtual wxCoord OnMeasureItemWidth( size_t item ) const; - - // Callback for background drawing. Flags are same as with - // OnDrawItem. - virtual void OnDrawBackground( wxDC& dc, const wxRect& rect, int item, int flags ) const; - - // NULL popup can be used to indicate default interface - virtual void DoSetPopupControl(wxComboPopup* popup); - - // clears all allocated client datas - void ClearClientDatas(); - - wxVListBoxComboPopup* GetVListBoxComboPopup() const - { - return (wxVListBoxComboPopup*) m_popupInterface; - } - - virtual int DoAppend(const wxString& item); - virtual int DoInsert(const wxString& item, unsigned int pos); - virtual void DoSetItemClientData(unsigned int n, void* clientData); - virtual void* DoGetItemClientData(unsigned int n) const; - virtual void DoSetItemClientObject(unsigned int n, wxClientData* clientData); - virtual wxClientData* DoGetItemClientObject(unsigned int n) const; - - // temporary storage for the initial choices - //const wxString* m_baseChoices; - //int m_baseChoicesCount; - wxArrayString m_initChs; - -private: - void Init(); - - DECLARE_EVENT_TABLE() - - DECLARE_DYNAMIC_CLASS(wxOwnerDrawnComboBox) -}; - - -#endif // wxUSE_ODCOMBOBOX - -#endif - // _WX_ODCOMBO_H_ diff --git a/wxWidgets/include/wx/overlay.h b/wxWidgets/include/wx/overlay.h deleted file mode 100644 index b8ae18c19b..0000000000 --- a/wxWidgets/include/wx/overlay.h +++ /dev/null @@ -1,97 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/overlay.h -// Purpose: wxOverlay class -// Author: Stefan Csomor -// Modified by: -// Created: 2006-10-20 -// RCS-ID: $Id: overlay.h 53135 2008-04-12 02:31:04Z VZ $ -// Copyright: (c) wxWidgets team -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_OVERLAY_H_ -#define _WX_OVERLAY_H_ - -#include "wx/defs.h" - -#if defined(wxMAC_USE_CORE_GRAPHICS) && wxMAC_USE_CORE_GRAPHICS - #define wxHAS_NATIVE_OVERLAY 1 -#elif defined(__WXDFB__) - #define wxHAS_NATIVE_OVERLAY 1 -#else - // don't define wxHAS_NATIVE_OVERLAY -#endif - -// ---------------------------------------------------------------------------- -// creates an overlay over an existing window, allowing for manipulations like -// rubberbanding etc. This API is not stable yet, not to be used outside wx -// internal code -// ---------------------------------------------------------------------------- - -class WXDLLIMPEXP_FWD_CORE wxOverlayImpl; -class WXDLLIMPEXP_FWD_CORE wxWindowDC; - -class WXDLLEXPORT wxOverlay -{ -public: - wxOverlay(); - ~wxOverlay(); - - // clears the overlay without restoring the former state - // to be done eg when the window content has been changed and repainted - void Reset(); - - // returns (port-specific) implementation of the overlay - wxOverlayImpl *GetImpl() { return m_impl; } - -private: - friend class WXDLLIMPEXP_FWD_CORE wxDCOverlay; - - // returns true if it has been setup - bool IsOk(); - - void Init(wxWindowDC* dc, int x , int y , int width , int height); - - void BeginDrawing(wxWindowDC* dc); - - void EndDrawing(wxWindowDC* dc); - - void Clear(wxWindowDC* dc); - - wxOverlayImpl* m_impl; - - bool m_inDrawing; - - - DECLARE_NO_COPY_CLASS(wxOverlay) -}; - - -class WXDLLEXPORT wxDCOverlay -{ -public: - // connects this overlay to the corresponding drawing dc, if the overlay is - // not initialized yet this call will do so - wxDCOverlay(wxOverlay &overlay, wxWindowDC *dc, int x , int y , int width , int height); - - // convenience wrapper that behaves the same using the entire area of the dc - wxDCOverlay(wxOverlay &overlay, wxWindowDC *dc); - - // removes the connection between the overlay and the dc - virtual ~wxDCOverlay(); - - // clears the layer, restoring the state at the last init - void Clear(); - -private: - void Init(wxWindowDC *dc, int x , int y , int width , int height); - - wxOverlay& m_overlay; - - wxWindowDC* m_dc; - - - DECLARE_NO_COPY_CLASS(wxDCOverlay) -}; - -#endif // _WX_OVERLAY_H_ diff --git a/wxWidgets/include/wx/ownerdrw.h b/wxWidgets/include/wx/ownerdrw.h deleted file mode 100644 index b15be1099b..0000000000 --- a/wxWidgets/include/wx/ownerdrw.h +++ /dev/null @@ -1,184 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: ownerdrw.h -// Purpose: interface for owner-drawn GUI elements -// Author: Vadim Zeitlin -// Modified by: -// Created: 11.11.97 -// RCS-ID: $Id: ownerdrw.h 62511 2009-10-30 14:11:03Z JMS $ -// Copyright: (c) 1998 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr> -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _OWNERDRW_H -#define _OWNERDRW_H - -#include "wx/defs.h" - -#if wxUSE_OWNER_DRAWN - -#include "wx/bitmap.h" -#include "wx/colour.h" -#include "wx/font.h" - -// ---------------------------------------------------------------------------- -// wxOwnerDrawn - a mix-in base class, derive from it to implement owner-drawn -// behaviour -// -// wxOwnerDrawn supports drawing of an item with non standard font, color and -// also supports 3 bitmaps: either a checked/unchecked bitmap for a checkable -// element or one unchangeable bitmap otherwise. -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxOwnerDrawn -{ -public: - // ctor & dtor - wxOwnerDrawn(const wxString& str = wxEmptyString, - bool bCheckable = false, - bool bMenuItem = false); // FIXME kludge for colors - virtual ~wxOwnerDrawn(); - - // fix appearance - void SetFont(const wxFont& font) - { m_font = font; m_bOwnerDrawn = true; } - - wxFont& GetFont() const { return (wxFont &)m_font; } - - void SetTextColour(const wxColour& colText) - { m_colText = colText; m_bOwnerDrawn = true; } - - wxColour& GetTextColour() const { return (wxColour&) m_colText; } - - void SetBackgroundColour(const wxColour& colBack) - { m_colBack = colBack; m_bOwnerDrawn = true; } - - wxColour& GetBackgroundColour() const - { return (wxColour&) m_colBack ; } - - void SetBitmaps(const wxBitmap& bmpChecked, - const wxBitmap& bmpUnchecked = wxNullBitmap) - { m_bmpChecked = bmpChecked; - m_bmpUnchecked = bmpUnchecked; - m_bOwnerDrawn = true; } - - void SetBitmap(const wxBitmap& bmpChecked) - { m_bmpChecked = bmpChecked; - m_bOwnerDrawn = true; } - - void SetDisabledBitmap( const wxBitmap& bmpDisabled ) - { m_bmpDisabled = bmpDisabled; - m_bOwnerDrawn = true; } - - const wxBitmap& GetBitmap(bool bChecked = true) const - { return (bChecked ? m_bmpChecked : m_bmpUnchecked); } - - const wxBitmap& GetDisabledBitmap() const - { return m_bmpDisabled; } - - // the height of the menu checkmark (or bitmap) is determined by the font - // for the current item, but the width should be always the same (for the - // items to be aligned), so by default it's taken to be the same as for - // the last item (and default width for the first one). - // - // NB: default is too small for bitmaps, but ok for checkmarks. - void SetMarginWidth(int nWidth) - { - ms_nLastMarginWidth = m_nMarginWidth = (size_t) nWidth; - if ( ((size_t) nWidth) != ms_nDefaultMarginWidth ) - m_bOwnerDrawn = true; - } - - int GetMarginWidth() const { return (int) m_nMarginWidth; } - static int GetDefaultMarginWidth() { return (int) ms_nDefaultMarginWidth; } - - // accessors - void SetName(const wxString& strName) { m_strName = strName; } - const wxString& GetName() const { return m_strName; } - void SetCheckable(bool checkable) { m_bCheckable = checkable; } - bool IsCheckable() const { return m_bCheckable; } - - // this is for menu items only: accel string is drawn right aligned after the - // menu item if not empty - void SetAccelString(const wxString& strAccel) { m_strAccel = strAccel; } - - // this function might seem strange, but if it returns false it means that - // no non-standard attribute are set, so there is no need for this control - // to be owner-drawn. Moreover, you can force owner-drawn to false if you - // want to change, say, the color for the item but only if it is owner-drawn - // (see wxMenuItem::wxMenuItem for example) - bool IsOwnerDrawn() const { return m_bOwnerDrawn; } - - // switch on/off owner-drawing the item - void SetOwnerDrawn(bool ownerDrawn = true) { m_bOwnerDrawn = ownerDrawn; } - void ResetOwnerDrawn() { m_bOwnerDrawn = false; } - -public: - // constants used in OnDrawItem - // (they have the same values as corresponding Win32 constants) - enum wxODAction - { - wxODDrawAll = 0x0001, // redraw entire control - wxODSelectChanged = 0x0002, // selection changed (see Status.Select) - wxODFocusChanged = 0x0004 // keyboard focus changed (see Status.Focus) - }; - - enum wxODStatus - { - wxODSelected = 0x0001, // control is currently selected - wxODGrayed = 0x0002, // item is to be grayed - wxODDisabled = 0x0004, // item is to be drawn as disabled - wxODChecked = 0x0008, // item is to be checked - wxODHasFocus = 0x0010, // item has the keyboard focus - wxODDefault = 0x0020, // item is the default item - wxODHidePrefix= 0x0100 // hide keyboard cues (w2k and xp only) - }; - - // virtual functions to implement drawing (return true if processed) - virtual bool OnMeasureItem(size_t *pwidth, size_t *pheight); - virtual bool OnDrawItem(wxDC& dc, const wxRect& rc, wxODAction act, wxODStatus stat); - -protected: - // return true if this is a menu item - bool IsMenuItem() const; - - // get the font to use, whether m_font is set or not - wxFont GetFontToUse() const; - - // Same as wxOwnerDrawn::SetMarginWidth() but does not affect - // ms_nLastMarginWidth. Exists solely to work around bug #4068, - // and will not exist in wxWidgets 2.9.0 and later. - void SetOwnMarginWidth(int nWidth) - { - m_nMarginWidth = (size_t) nWidth; - if ( ((size_t) nWidth) != ms_nDefaultMarginWidth ) - m_bOwnerDrawn = true; - } - - - wxString m_strName, // label for a manu item - m_strAccel; // the accel string ("Ctrl-F17") if any - -private: - static size_t ms_nDefaultMarginWidth; // menu check mark width - static size_t ms_nLastMarginWidth; // handy for aligning all items - - bool m_bCheckable, // used only for menu or check listbox items - m_bOwnerDrawn, // true if something is non standard - m_isMenuItem; // true if this is a menu item - - wxFont m_font; // font to use for drawing - wxColour m_colText, // color ----"---"---"---- - m_colBack; // background color - wxBitmap m_bmpChecked, // bitmap to put near the item - m_bmpUnchecked, // (checked is used also for 'uncheckable' items) - m_bmpDisabled; - - size_t m_nHeight, // font height - m_nMinHeight, // minimum height, as determined by user's system settings - m_nMarginWidth; // space occupied by bitmap to the left of the item -}; - -#endif // wxUSE_OWNER_DRAWN - -#endif - // _OWNERDRW_H diff --git a/wxWidgets/include/wx/palette.h b/wxWidgets/include/wx/palette.h deleted file mode 100644 index 4743ce62c3..0000000000 --- a/wxWidgets/include/wx/palette.h +++ /dev/null @@ -1,59 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/palette.h -// Purpose: Common header and base class for wxPalette -// Author: Julian Smart -// Modified by: -// Created: -// RCS-ID: $Id: palette.h 61872 2009-09-09 22:37:05Z VZ $ -// Copyright: (c) Julian Smart -// Licence: wxWindows Licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_PALETTE_H_BASE_ -#define _WX_PALETTE_H_BASE_ - -#include "wx/defs.h" - -#if wxUSE_PALETTE - -#include "wx/object.h" -#include "wx/gdiobj.h" - -// wxPaletteBase -class WXDLLEXPORT wxPaletteBase: public wxGDIObject -{ -public: - virtual ~wxPaletteBase() { } - - virtual bool Ok() const { return IsOk(); } - virtual bool IsOk() const = 0; - virtual int GetColoursCount() const { wxFAIL_MSG( wxT("not implemented") ); return 0; } -}; - -#if defined(__WXPALMOS__) - #include "wx/palmos/palette.h" -#elif defined(__WXMSW__) - #include "wx/msw/palette.h" -#elif defined(__WXMOTIF__) - #include "wx/motif/palette.h" -#elif defined(__WXGTK__) || defined(__WXCOCOA__) - #include "wx/generic/paletteg.h" -#elif defined(__WXX11__) - #include "wx/x11/palette.h" -#elif defined(__WXMGL__) - #include "wx/mgl/palette.h" -#elif defined(__WXMAC__) - #include "wx/mac/palette.h" -#elif defined(__WXPM__) - #include "wx/os2/palette.h" -#endif - -#if WXWIN_COMPATIBILITY_2_4 - #define wxColorMap wxPalette - #define wxColourMap wxPalette -#endif - -#endif // wxUSE_PALETTE - -#endif - // _WX_PALETTE_H_BASE_ diff --git a/wxWidgets/include/wx/panel.h b/wxWidgets/include/wx/panel.h deleted file mode 100644 index 366177d7cb..0000000000 --- a/wxWidgets/include/wx/panel.h +++ /dev/null @@ -1,18 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/panel.h -// Purpose: Base header for wxPanel -// Author: Julian Smart -// Modified by: -// Created: -// RCS-ID: $Id: panel.h 33948 2005-05-04 18:57:50Z JS $ -// Copyright: (c) Julian Smart -// Licence: wxWindows Licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_PANEL_H_BASE_ -#define _WX_PANEL_H_BASE_ - -#include "wx/generic/panelg.h" - -#endif - // _WX_PANELH_BASE_ diff --git a/wxWidgets/include/wx/paper.h b/wxWidgets/include/wx/paper.h deleted file mode 100644 index eb0893dfcb..0000000000 --- a/wxWidgets/include/wx/paper.h +++ /dev/null @@ -1,122 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: paper.h -// Purpose: Paper database types and classes -// Author: Julian Smart -// Modified by: -// Created: 01/02/97 -// RCS-ID: $Id: paper.h 53135 2008-04-12 02:31:04Z VZ $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_PAPERH__ -#define _WX_PAPERH__ - -#include "wx/defs.h" -#include "wx/event.h" -#include "wx/cmndata.h" -#include "wx/intl.h" -#include "wx/hashmap.h" - -/* - * Paper type: see defs.h for wxPaperSize enum. - * A wxPrintPaperType can have an id and a name, or just a name and wxPAPER_NONE, - * so you can add further paper types without needing new ids. - */ - -#ifdef __WXMSW__ -#define WXADDPAPER(paperId, platformId, name, w, h) AddPaperType(paperId, platformId, name, w, h) -#else -#define WXADDPAPER(paperId, platformId, name, w, h) AddPaperType(paperId, 0, name, w, h) -#endif - -class WXDLLEXPORT wxPrintPaperType: public wxObject -{ -public: - wxPrintPaperType(); - - // platformId is a platform-specific id, such as in Windows, DMPAPER_... - wxPrintPaperType(wxPaperSize paperId, int platformId, const wxString& name, int w, int h); - - inline wxString GetName() const { return wxGetTranslation(m_paperName); } - inline wxPaperSize GetId() const { return m_paperId; } - inline int GetPlatformId() const { return m_platformId; } - - // Get width and height in tenths of a millimetre - inline int GetWidth() const { return m_width; } - inline int GetHeight() const { return m_height; } - - // Get size in tenths of a millimetre - inline wxSize GetSize() const { return wxSize(m_width, m_height); } - - // Get size in a millimetres - inline wxSize GetSizeMM() const { return wxSize(m_width/10, m_height/10); } - - // Get width and height in device units (1/72th of an inch) - wxSize GetSizeDeviceUnits() const ; - -public: - wxPaperSize m_paperId; - int m_platformId; - int m_width; // In tenths of a millimetre - int m_height; // In tenths of a millimetre - wxString m_paperName; - -private: - DECLARE_DYNAMIC_CLASS(wxPrintPaperType) -}; - -WX_DECLARE_STRING_HASH_MAP(wxPrintPaperType*, wxStringToPrintPaperTypeHashMap); - -class WXDLLIMPEXP_FWD_CORE wxPrintPaperTypeList; - -class WXDLLEXPORT wxPrintPaperDatabase -{ -public: - wxPrintPaperDatabase(); - ~wxPrintPaperDatabase(); - - void CreateDatabase(); - void ClearDatabase(); - - void AddPaperType(wxPaperSize paperId, const wxString& name, int w, int h); - void AddPaperType(wxPaperSize paperId, int platformId, const wxString& name, int w, int h); - - // Find by name - wxPrintPaperType *FindPaperType(const wxString& name); - - // Find by size id - wxPrintPaperType *FindPaperType(wxPaperSize id); - - // Find by platform id - wxPrintPaperType *FindPaperTypeByPlatformId(int id); - - // Find by size - wxPrintPaperType *FindPaperType(const wxSize& size); - - // Convert name to size id - wxPaperSize ConvertNameToId(const wxString& name); - - // Convert size id to name - wxString ConvertIdToName(wxPaperSize paperId); - - // Get the paper size - wxSize GetSize(wxPaperSize paperId); - - // Get the paper size - wxPaperSize GetSize(const wxSize& size); - - // - wxPrintPaperType* Item(size_t index) const; - size_t GetCount() const; -private: - wxStringToPrintPaperTypeHashMap* m_map; - wxPrintPaperTypeList* m_list; - // DECLARE_DYNAMIC_CLASS(wxPrintPaperDatabase) -}; - -extern WXDLLEXPORT_DATA(wxPrintPaperDatabase*) wxThePrintPaperDatabase; - - -#endif - // _WX_PAPERH__ diff --git a/wxWidgets/include/wx/pen.h b/wxWidgets/include/wx/pen.h deleted file mode 100644 index 080d6c5c55..0000000000 --- a/wxWidgets/include/wx/pen.h +++ /dev/null @@ -1,40 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/pen.h -// Purpose: Base header for wxPen -// Author: Julian Smart -// Modified by: -// Created: -// RCS-ID: $Id: pen.h 40865 2006-08-27 09:42:42Z VS $ -// Copyright: (c) Julian Smart -// Licence: wxWindows Licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_PEN_H_BASE_ -#define _WX_PEN_H_BASE_ - -#include "wx/defs.h" - -#if defined(__WXPALMOS__) -#include "wx/palmos/pen.h" -#elif defined(__WXMSW__) -#include "wx/msw/pen.h" -#elif defined(__WXMOTIF__) || defined(__WXX11__) -#include "wx/x11/pen.h" -#elif defined(__WXGTK20__) -#include "wx/gtk/pen.h" -#elif defined(__WXGTK__) -#include "wx/gtk1/pen.h" -#elif defined(__WXMGL__) -#include "wx/mgl/pen.h" -#elif defined(__WXDFB__) -#include "wx/dfb/pen.h" -#elif defined(__WXMAC__) -#include "wx/mac/pen.h" -#elif defined(__WXCOCOA__) -#include "wx/cocoa/pen.h" -#elif defined(__WXPM__) -#include "wx/os2/pen.h" -#endif - -#endif - // _WX_PEN_H_BASE_ diff --git a/wxWidgets/include/wx/pickerbase.h b/wxWidgets/include/wx/pickerbase.h deleted file mode 100644 index d0f0614c6f..0000000000 --- a/wxWidgets/include/wx/pickerbase.h +++ /dev/null @@ -1,189 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/pickerbase.h -// Purpose: wxPickerBase definition -// Author: Francesco Montorsi (based on Vadim Zeitlin's code) -// Modified by: -// Created: 14/4/2006 -// Copyright: (c) Vadim Zeitlin, Francesco Montorsi -// RCS-ID: $Id: pickerbase.h 49804 2007-11-10 01:09:42Z VZ $ -// Licence: wxWindows Licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_PICKERBASE_H_BASE_ -#define _WX_PICKERBASE_H_BASE_ - -#include "wx/control.h" -#include "wx/sizer.h" -#include "wx/containr.h" - -class WXDLLIMPEXP_FWD_CORE wxTextCtrl; -class WXDLLIMPEXP_FWD_CORE wxToolTip; - -extern WXDLLEXPORT_DATA(const wxChar) wxButtonNameStr[]; - -// ---------------------------------------------------------------------------- -// wxPickerBase is the base class for the picker controls which support -// a wxPB_USE_TEXTCTRL style; i.e. for those pickers which can use an auxiliary -// text control next to the 'real' picker. -// -// The wxTextPickerHelper class manages enabled/disabled state of the text control, -// its sizing and positioning. -// ---------------------------------------------------------------------------- - -#define wxPB_USE_TEXTCTRL 0x0002 - -class WXDLLIMPEXP_CORE wxPickerBase : public wxControl -{ -public: - // ctor: text is the associated text control - wxPickerBase() : m_text(NULL), m_picker(NULL), m_sizer(NULL) - { m_container.SetContainerWindow(this); } - virtual ~wxPickerBase() {} - - - // if present, intercepts wxPB_USE_TEXTCTRL style and creates the text control - // The 3rd argument is the initial wxString to display in the text control - bool CreateBase(wxWindow *parent, - wxWindowID id, - const wxString& text = wxEmptyString, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = 0, - const wxValidator& validator = wxDefaultValidator, - const wxString& name = wxButtonNameStr); - -public: // public API - - // margin between the text control and the picker - void SetInternalMargin(int newmargin) - { GetTextCtrlItem()->SetBorder(newmargin); m_sizer->Layout(); } - int GetInternalMargin() const - { return GetTextCtrlItem()->GetBorder(); } - - // proportion of the text control - void SetTextCtrlProportion(int prop) - { GetTextCtrlItem()->SetProportion(prop); m_sizer->Layout(); } - int GetTextCtrlProportion() const - { return GetTextCtrlItem()->GetProportion(); } - - // proportion of the picker control - void SetPickerCtrlProportion(int prop) - { GetPickerCtrlItem()->SetProportion(prop); m_sizer->Layout(); } - int GetPickerCtrlProportion() const - { return GetPickerCtrlItem()->GetProportion(); } - - bool IsTextCtrlGrowable() const - { return (GetTextCtrlItem()->GetFlag() & wxGROW) != 0; } - void SetTextCtrlGrowable(bool grow = true) - { - int f = GetDefaultTextCtrlFlag(); - if ( grow ) - f |= wxGROW; - else - f &= ~wxGROW; - - GetTextCtrlItem()->SetFlag(f); - } - - bool IsPickerCtrlGrowable() const - { return (GetPickerCtrlItem()->GetFlag() & wxGROW) != 0; } - void SetPickerCtrlGrowable(bool grow = true) - { - int f = GetDefaultPickerCtrlFlag(); - if ( grow ) - f |= wxGROW; - else - f &= ~wxGROW; - - GetPickerCtrlItem()->SetFlag(f); - } - - bool HasTextCtrl() const - { return m_text != NULL; } - wxTextCtrl *GetTextCtrl() - { return m_text; } - wxControl *GetPickerCtrl() - { return m_picker; } - - // methods that derived class must/may override - virtual void UpdatePickerFromTextCtrl() = 0; - virtual void UpdateTextCtrlFromPicker() = 0; - -protected: - // overridden base class methods -#if wxUSE_TOOLTIPS - virtual void DoSetToolTip(wxToolTip *tip); -#endif // wxUSE_TOOLTIPS - - - // event handlers - void OnTextCtrlDelete(wxWindowDestroyEvent &); - void OnTextCtrlUpdate(wxCommandEvent &); - void OnTextCtrlKillFocus(wxFocusEvent &); - - void OnSize(wxSizeEvent &); - - // returns the set of styles for the attached wxTextCtrl - // from given wxPickerBase's styles - virtual long GetTextCtrlStyle(long style) const - { return (style & wxWINDOW_STYLE_MASK); } - - // returns the set of styles for the m_picker - virtual long GetPickerStyle(long style) const - { return (style & wxWINDOW_STYLE_MASK); } - - - wxSizerItem *GetPickerCtrlItem() const - { - if (this->HasTextCtrl()) - return m_sizer->GetItem((size_t)1); - return m_sizer->GetItem((size_t)0); - } - - wxSizerItem *GetTextCtrlItem() const - { - wxASSERT(this->HasTextCtrl()); - return m_sizer->GetItem((size_t)0); - } - - int GetDefaultPickerCtrlFlag() const - { - // on macintosh, without additional borders - // there's not enough space for focus rect - return wxALIGN_CENTER_VERTICAL|wxGROW -#ifdef __WXMAC__ - | wxTOP | wxRIGHT | wxBOTTOM -#endif - ; - } - - int GetDefaultTextCtrlFlag() const - { - // on macintosh, without wxALL there's not enough space for focus rect - return wxALIGN_CENTER_VERTICAL -#ifdef __WXMAC__ - | wxALL -#else - | wxRIGHT -#endif - ; - } - - void PostCreation(); - -protected: - wxTextCtrl *m_text; // can be NULL - wxControl *m_picker; - wxBoxSizer *m_sizer; - -private: - DECLARE_ABSTRACT_CLASS(wxPickerBase) - DECLARE_EVENT_TABLE() - - // This class must be something just like a panel... - WX_DECLARE_CONTROL_CONTAINER(); -}; - - -#endif - // _WX_PICKERBASE_H_BASE_ diff --git a/wxWidgets/include/wx/platform.h b/wxWidgets/include/wx/platform.h deleted file mode 100644 index f13b049ed6..0000000000 --- a/wxWidgets/include/wx/platform.h +++ /dev/null @@ -1,664 +0,0 @@ -/** -* Name: wx/platform.h -* Purpose: define the OS and compiler identification macros -* Author: Vadim Zeitlin -* Modified by: -* Created: 29.10.01 (extracted from wx/defs.h) -* RCS-ID: $Id: platform.h 63300 2010-01-28 21:36:09Z MW $ -* Copyright: (c) 1997-2001 Vadim Zeitlin -* Licence: wxWindows licence -*/ - -/* THIS IS A C FILE, DON'T USE C++ FEATURES (IN PARTICULAR COMMENTS) IN IT */ - -#ifndef _WX_PLATFORM_H_ -#define _WX_PLATFORM_H_ - - -/* - Codewarrior doesn't define any Windows symbols until some headers - are included -*/ -#ifdef __MWERKS__ -# include <stddef.h> -#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__ -# define __WXMAC_CARBON__ -# include <AvailabilityMacros.h> -# ifndef MAC_OS_X_VERSION_10_4 -# define MAC_OS_X_VERSION_10_4 1040 -# endif -# ifndef MAC_OS_X_VERSION_10_5 -# define MAC_OS_X_VERSION_10_5 1050 -# endif -# ifdef __WXMAC_XCODE__ -# include <unistd.h> -# include "wx/mac/carbon/config_xcode.h" -# endif -# else -# if TARGET_CARBON -# define __WXMAC_CARBON__ -# else -# define __WXMAC_CLASSIC__ -# endif -# endif -#endif - -/* - __WXOSX__ is a common define to wxMac (Carbon) and wxCocoa ports under OS X. - */ -#if defined(__WXMAC_OSX__) || defined(__WXCOCOA__) -# define __WXOSX__ -#endif - -/* - first define Windows symbols if they're not defined on the command line: we - can autodetect everything we need if _WIN32 is defined - */ -#if defined(__CYGWIN__) && defined(__WINDOWS__) -# ifndef __WXMSW__ -# define __WXMSW__ -# endif - -# ifndef _WIN32 -# define _WIN32 -# endif - -# ifndef WIN32 -# define WIN32 -# endif -#endif - -#if defined(__PALMOS__) -# if __PALMOS__ == 0x06000000 -# define __WXPALMOS6__ -# endif -# if __PALMOS__ == 0x05000000 -# define __WXPALMOS5__ -# endif -# ifndef __WXPALMOS__ -# define __WXPALMOS__ -# endif -# ifdef __WXMSW__ -# undef __WXMSW__ -# endif -# ifdef __WINDOWS__ -# undef __WINDOWS__ -# endif -# ifdef __WIN32__ -# undef __WIN32__ -# endif -# ifdef WIN32 -# undef WIN32 -# endif -# ifdef _WIN32 -# undef _WIN32 -# endif -#endif - -#if defined(_WIN64) -# ifndef _WIN32 - /* - a lot of code (mistakenly) uses #ifdef _WIN32 to either test for - Windows or to test for !__WIN16__, so we must define _WIN32 for - Win64 as well to ensure that the existing code continues to work. - */ -# define _WIN32 -# endif /* !_WIN32 */ - -# ifndef __WIN64__ -# define __WIN64__ -# endif /* !__WIN64__ */ -#endif /* _WIN64 */ - -#if (defined(_WIN32) || defined(WIN32) || defined(__NT__) || defined(__WXWINCE__)) \ - && !defined(__WXMOTIF__) && !defined(__WXGTK__) && !defined(__WXX11__) -# ifndef __WXMSW__ -# define __WXMSW__ -# endif - -# ifndef __WIN32__ -# define __WIN32__ -# endif -#endif /* Win32 */ - -#if defined(__WXMSW__) || defined(__WIN32__) -# if !defined(__WINDOWS__) -# define __WINDOWS__ -# endif -#endif - -/* detect MS SmartPhone */ -#if defined( WIN32_PLATFORM_WFSP ) -# ifndef __SMARTPHONE__ -# define __SMARTPHONE__ -# endif -# ifndef __WXWINCE__ -# define __WXWINCE__ -# endif -#endif - -/* detect PocketPC */ -#if defined( WIN32_PLATFORM_PSPC ) -# ifndef __POCKETPC__ -# define __POCKETPC__ -# endif -# ifndef __WXWINCE__ -# define __WXWINCE__ -# endif -#endif - -/* detect Standard WinCE SDK */ -#if defined( WCE_PLATFORM_STANDARDSDK ) -# ifndef __WINCE_STANDARDSDK__ -# define __WINCE_STANDARDSDK__ -# endif -# ifndef __WXWINCE__ -# define __WXWINCE__ -# endif -#endif - -#if defined(_WIN32_WCE) && !defined(WIN32_PLATFORM_WFSP) && !defined(WIN32_PLATFORM_PSPC) -# if (_WIN32_WCE >= 400) -# ifndef __WINCE_NET__ -# define __WINCE_NET__ -# endif -# elif (_WIN32_WCE >= 200) -# ifndef __HANDHELDPC__ -# define __HANDHELDPC__ -# endif -# endif -# ifndef __WXWINCE__ -# define __WXWINCE__ -# endif -#endif - -#if defined(__POCKETPC__) || defined(__SMARTPHONE__) || defined(__WXGPE__) -# define __WXHANDHELD__ -#endif - -/* - Include wx/setup.h for the Unix platform defines generated by configure and - the library compilation options - - Note that it must be included before defining hardware symbols below as they - could be already defined by configure - */ -#include "wx/setup.h" - -/* - Hardware platform detection. - - VC++ defines _M_xxx symbols. - */ -#if defined(_M_IX86) || defined(i386) || defined(__i386) || defined(__i386__) - #ifndef __INTEL__ - #define __INTEL__ - #endif -#endif /* x86 */ - -#if defined(_M_IA64) - #ifndef __IA64__ - #define __IA64__ - #endif -#endif /* ia64 */ - -#if defined(_M_MPPC) || defined(__PPC__) || defined(__ppc__) - #ifndef __POWERPC__ - #define __POWERPC__ - #endif -#endif /* alpha */ - -#if defined(_M_ALPHA) || defined(__AXP__) - #ifndef __ALPHA__ - #define __ALPHA__ - #endif -#endif /* alpha */ - - -/* - adjust the Unicode setting: wxUSE_UNICODE should be defined as 0 or 1 - and is used by wxWidgets, _UNICODE and/or UNICODE may be defined or used by - the system headers so bring these settings in sync - */ - -/* set wxUSE_UNICODE to 1 if UNICODE or _UNICODE is defined */ -#if defined(_UNICODE) || defined(UNICODE) -# undef wxUSE_UNICODE -# define wxUSE_UNICODE 1 -#else /* !UNICODE */ -# ifndef wxUSE_UNICODE -# define wxUSE_UNICODE 0 -# endif -#endif /* UNICODE/!UNICODE */ - -/* and vice versa: define UNICODE and _UNICODE if wxUSE_UNICODE is 1 */ -#if wxUSE_UNICODE -# ifndef _UNICODE -# define _UNICODE -# endif -# ifndef UNICODE -# define UNICODE -# endif -#endif /* wxUSE_UNICODE */ - -#if defined( __MWERKS__ ) && !defined(__INTEL__) -/* otherwise MSL headers bring in WIN32 dependant APIs */ -#undef UNICODE -#endif - -/* - Notice that Turbo Explorer (BCC 5.82) is available for free at - http://www.turboexplorer.com/downloads, you can get it if you have trouble - compiling wxWidgets with your current Borland compiler. -*/ -#if defined(__BORLANDC__) && (__BORLANDC__ < 0x540) -# error "wxWidgets requires a newer version of Borland, we recommend upgrading to 5.82 (Turbo Explorer). You may at your own risk remove this line and try building but be prepared to get build errors." -#endif /* __BORLANDC__ */ - -#if defined(__BORLANDC__) && (__BORLANDC__ < 0x582) && (__BORLANDC__ > 0x559) -# ifndef _USE_OLD_RW_STL -# error "wxWidgets is incompatible with default Borland C++ 5.6 STL library, please add -D_USE_OLD_RW_STL to your bcc32.cfg to use RogueWave STL implementation." -# endif -#endif /* __BORLANDC__ */ - -/* - This macro can be used to test the Open Watcom version. -*/ -#ifndef __WATCOMC__ -# define wxWATCOM_VERSION(major,minor) 0 -# define wxCHECK_WATCOM_VERSION(major,minor) 0 -# define wxONLY_WATCOM_EARLIER_THAN(major,minor) 0 -#elif defined(__WATCOMC__) && __WATCOMC__ < 1200 -# error "Only Open Watcom is supported in this release" -#else -# define wxWATCOM_VERSION(major,minor) ( major * 100 + minor * 10 + 1100 ) -# define wxCHECK_WATCOM_VERSION(major,minor) ( __WATCOMC__ >= wxWATCOM_VERSION(major,minor) ) -# define wxONLY_WATCOM_EARLIER_THAN(major,minor) ( __WATCOMC__ < wxWATCOM_VERSION(major,minor) ) -#endif - -/* - check the consistency of the settings in setup.h: note that this must be - done after setting wxUSE_UNICODE correctly as it is used in wx/chkconf.h - */ -#include "wx/chkconf.h" - - -/* - some compilers don't support iostream.h any longer, while some of theme - are not updated with <iostream> yet, so override the users setting here - in such case. - */ -#if defined(_MSC_VER) && (_MSC_VER >= 1310) -# undef wxUSE_IOSTREAMH -# define wxUSE_IOSTREAMH 0 -#elif defined(__DMC__) || defined(__WATCOMC__) -# undef wxUSE_IOSTREAMH -# define wxUSE_IOSTREAMH 1 -#elif defined(__MINGW32__) -# undef wxUSE_IOSTREAMH -# define wxUSE_IOSTREAMH 0 -#endif /* compilers with/without iostream.h */ - -/* - old C++ headers (like <iostream.h>) declare classes in the global namespace - while the new, standard ones (like <iostream>) do it in std:: namespace, - unless it's an old gcc version. - - using this macro allows constuctions like "wxSTD iostream" to work in - either case - */ -#if !wxUSE_IOSTREAMH && (!defined(__GNUC__) || ( __GNUC__ > 2 ) || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95)) -# define wxSTD std:: -#else -# define wxSTD -#endif - -/* - OS: first of all, test for MS-DOS platform. We must do this before testing - for Unix, because DJGPP compiler defines __unix__ under MS-DOS - */ -#if defined(__GO32__) || defined(__DJGPP__) || defined(__DOS__) -# ifndef __DOS__ -# define __DOS__ -# endif - /* size_t is the same as unsigned int for Watcom 11 compiler, */ - /* so define it if it hadn't been done by configure yet */ -# if !defined(wxSIZE_T_IS_UINT) && !defined(wxSIZE_T_IS_ULONG) -# ifdef __WATCOMC__ -# define wxSIZE_T_IS_UINT -# endif -# ifdef __DJGPP__ -# define wxSIZE_T_IS_ULONG -# endif -# endif - -/* - OS: then test for generic Unix defines, then for particular flavours and - finally for Unix-like systems - Mac OS X matches this case (__MACH__), prior Mac OS do not. - */ -#elif defined(__UNIX__) || defined(__unix) || defined(__unix__) || \ - defined(____SVR4____) || defined(__LINUX__) || defined(__sgi) || \ - defined(__hpux) || defined(sun) || defined(__SUN__) || defined(_AIX) || \ - defined(__EMX__) || defined(__VMS) || defined(__BEOS__) || defined(__MACH__) - -# define __UNIX_LIKE__ - - /* Helps SGI compilation, apparently */ -# ifdef __SGI__ -# ifdef __GNUG__ -# define __need_wchar_t -# else /* !gcc */ - /* - Note I use the term __SGI_CC__ for both cc and CC, its not a good - idea to mix gcc and cc/CC, the name mangling is different - */ -# define __SGI_CC__ -# endif /* gcc/!gcc */ - - /* system headers use this symbol and not __cplusplus in some places */ -# ifndef _LANGUAGE_C_PLUS_PLUS -# define _LANGUAGE_C_PLUS_PLUS -# endif -# endif /* SGI */ - -# if defined(sun) || defined(__SUN__) -# ifndef __GNUG__ -# ifndef __SUNCC__ -# define __SUNCC__ -# endif /* Sun CC */ -# endif -# endif /* Sun */ - -# ifdef __EMX__ -# define OS2EMX_PLAIN_CHAR -# endif - - /* define __HPUX__ for HP-UX where standard macro is __hpux */ -# if defined(__hpux) && !defined(__HPUX__) -# define __HPUX__ -# endif /* HP-UX */ - -# if defined(__CYGWIN__) || defined(__WINE__) -# if !defined(wxSIZE_T_IS_UINT) -# define wxSIZE_T_IS_UINT -# endif -# endif - - /* All of these should already be defined by including configure- - generated setup.h but we wish to support Xcode compilation without - requiring the user to define these himself. - */ -# if defined(__APPLE__) && defined(__MACH__) -# ifndef __UNIX__ -# define __UNIX__ 1 -# endif -# ifndef __BSD__ -# define __BSD__ 1 -# endif - /* __DARWIN__ is our own define to mean OS X or pure Darwin */ -# ifndef __DARWIN__ -# define __DARWIN__ 1 -# endif - /* NOTE: TARGET_CARBON is actually a 0/1 and must be 1 for OS X */ -# ifndef TARGET_CARBON -# define TARGET_CARBON 1 -# endif - /* OS X uses unsigned long size_t for both ILP32 and LP64 modes. */ -# if !defined(wxSIZE_T_IS_UINT) && !defined(wxSIZE_T_IS_ULONG) -# define wxSIZE_T_IS_ULONG -# endif -# endif - -/* - OS: Classic Mac OS - */ -#elif defined(applec) || \ - defined(THINK_C) || \ - (defined(__MWERKS__) && !defined(__INTEL__)) - /* MacOS */ -# if !defined(wxSIZE_T_IS_UINT) && !defined(wxSIZE_T_IS_ULONG) -# define wxSIZE_T_IS_ULONG -# endif - -/* - OS: OS/2 - */ -#elif defined(__OS2__) - - /* wxOS2 vs. non wxOS2 ports on OS2 platform */ -# if !defined(__WXMOTIF__) && !defined(__WXGTK__) && !defined(__WXX11__) -# ifndef __WXPM__ -# define __WXPM__ -# endif -# endif - -# if defined(__IBMCPP__) -# define __VISAGEAVER__ __IBMCPP__ -# endif - - /* Place other OS/2 compiler environment defines here */ -# if defined(__VISAGECPP__) - /* VisualAge is the only thing that understands _Optlink */ -# define LINKAGEMODE _Optlink -# endif -# define wxSIZE_T_IS_UINT - -/* - OS: Palm OS - */ -#elif defined(__PALMOS__) -# ifdef __WIN32__ -# error "__WIN32__ should not be defined for PalmOS" -# endif -# ifdef __WINDOWS__ -# error "__WINDOWS__ should not be defined for PalmOS" -# endif -# ifdef __WXMSW__ -# error "__WXMSW__ should not be defined for PalmOS" -# endif - -/* - OS: Otherwise it must be Windows - */ -#else /* Windows */ -# ifndef __WINDOWS__ -# define __WINDOWS__ -# endif /* Windows */ - - /* to be changed for Win64! */ -# ifndef __WIN32__ -# error "__WIN32__ should be defined for Win32 and Win64, Win16 is not supported" -# endif - - /* - define another standard symbol for Microsoft Visual C++: the standard - one (_MSC_VER) is also defined by Metrowerks compiler - */ -# if defined(_MSC_VER) && !defined(__MWERKS__) -# define __VISUALC__ _MSC_VER -# elif defined(__BCPLUSPLUS__) && !defined(__BORLANDC__) -# define __BORLANDC__ -# elif defined(__WATCOMC__) -# elif defined(__SC__) -# define __SYMANTECC__ -# endif /* compiler */ - - /* size_t is the same as unsigned int for all Windows compilers we know, */ - /* so define it if it hadn't been done by configure yet */ -# if !defined(wxSIZE_T_IS_UINT) && !defined(wxSIZE_T_IS_ULONG) && !defined(__WIN64__) -# define wxSIZE_T_IS_UINT -# endif -#endif /* OS */ - -/* - if we're on a Unix system but didn't use configure (so that setup.h didn't - define __UNIX__), do define __UNIX__ now - */ -#if !defined(__UNIX__) && defined(__UNIX_LIKE__) -# define __UNIX__ -#endif /* Unix */ - -#if defined(__WXMOTIF__) || defined(__WXX11__) -# define __X__ -#endif - -#ifdef __SC__ -# ifdef __DMC__ -# define __DIGITALMARS__ -# else -# define __SYMANTEC__ -# endif -#endif - -#ifdef __INTEL_COMPILER -# define __INTELC__ -#endif - -/* - We get "Large Files (ILP32) not supported in strict ANSI mode." #error - from HP-UX standard headers when compiling with g++ without this: - */ -#if defined(__HPUX__) && !defined(__STDC_EXT__) -# define __STDC_EXT__ 1 -#endif - -/* Force linking against required libraries under Windows: */ -#ifdef __WXWINCE__ -# include "wx/msw/wince/libraries.h" -#elif defined __WINDOWS__ -# include "wx/msw/libraries.h" -#endif - -/* - This macro can be used to test the gcc version and can be used like this: - -# if wxCHECK_GCC_VERSION(3, 1) - ... we have gcc 3.1 or later ... -# else - ... no gcc at all or gcc < 3.1 ... -# endif -*/ -#if defined(__GNUC__) && defined(__GNUC_MINOR__) - #define wxCHECK_GCC_VERSION( major, minor ) \ - ( ( __GNUC__ > (major) ) \ - || ( __GNUC__ == (major) && __GNUC_MINOR__ >= (minor) ) ) -#else - #define wxCHECK_GCC_VERSION( major, minor ) 0 -#endif - -#if defined(__BORLANDC__) || (defined(__GNUC__) && __GNUC__ < 3) -#define wxNEEDS_CHARPP -#endif - -/* - This macro can be used to check that the version of mingw32 compiler is - at least maj.min - */ -#if ( defined( __GNUWIN32__ ) || defined( __MINGW32__ ) || \ - ( defined( __CYGWIN__ ) && defined( __WINDOWS__ ) ) || \ - wxCHECK_WATCOM_VERSION(1,0) ) && \ - !defined(__DOS__) && \ - !defined(__WXPM__) && \ - !defined(__WXMOTIF__) && \ - !defined(__WXGTK__) && \ - !defined(__WXX11__) && \ - !defined(__WXPALMOS__) -# include "wx/msw/gccpriv.h" -#else -# undef wxCHECK_W32API_VERSION -# define wxCHECK_W32API_VERSION(maj, min) (0) -# undef wxCHECK_MINGW32_VERSION -# define wxCHECK_MINGW32_VERSION(maj, min) (0) -#endif - -#if defined (__WXMSW__) -# if !wxONLY_WATCOM_EARLIER_THAN(1, 8) -# define wxHAVE_RAW_BITMAP -# endif -#endif -#if defined(__WXGTK20__) || defined(__WXMAC__) -# define wxHAVE_RAW_BITMAP -#endif - -/* - Handle Darwin gcc universal compilation. Don't do this in an Apple- - specific case since no sane compiler should be defining either - __BIG_ENDIAN__ or __LITTLE_ENDIAN__ unless it really is generating - code that will be hosted on a machine with the appropriate endianness. - If a compiler defines neither, assume the user or configure set - WORDS_BIGENDIAN appropriately. - */ -#if defined(__BIG_ENDIAN__) -# undef WORDS_BIGENDIAN -# define WORDS_BIGENDIAN 1 -#elif defined(__LITTLE_ENDIAN__) -# undef WORDS_BIGENDIAN -#elif defined(__WXMAC__) && !defined(WORDS_BIGENDIAN) -/* According to Stefan even ancient Mac compilers defined __BIG_ENDIAN__ */ -# warning "Compiling wxMac with probably wrong endianness" -#endif - -#ifdef __VMS -#define XtDisplay XTDISPLAY -#ifdef __WXMOTIF__ -#define XtParent XTPARENT -#define XtScreen XTSCREEN -#define XtWindow XTWINDOW -#endif -#endif - -/* Choose which method we will use for updating menus - * - in OnIdle, or when we receive a wxEVT_MENU_OPEN event. - * Presently, only Windows and GTK+ support wxEVT_MENU_OPEN. - */ -#ifndef wxUSE_IDLEMENUUPDATES -# if (defined(__WXMSW__) || defined(__WXGTK__)) && !defined(__WXUNIVERSAL__) -# define wxUSE_IDLEMENUUPDATES 0 -# else -# define wxUSE_IDLEMENUUPDATES 1 -# endif -#endif - -/* - * Define symbols that are not yet in - * configure or possibly some setup.h files. - * They will need to be added. - */ - -#ifndef wxUSE_FILECONFIG -# if wxUSE_CONFIG -# define wxUSE_FILECONFIG 1 -# else -# define wxUSE_FILECONFIG 0 -# endif -#endif - -#ifndef wxUSE_HOTKEY -# define wxUSE_HOTKEY 0 -#endif - -#if !defined(wxUSE_WXDIB) && defined(__WXMSW__) -# define wxUSE_WXDIB 1 -#endif - -/* - We need AvailabilityMacros.h for ifdefing out things that don't exist on - OSX 10.2 and lower - FIXME: We need a better way to detect for 10.3 then including a system header -*/ -#ifdef __DARWIN__ - #include <AvailabilityMacros.h> -#endif - -#endif /* _WX_PLATFORM_H_ */ diff --git a/wxWidgets/include/wx/platinfo.h b/wxWidgets/include/wx/platinfo.h deleted file mode 100644 index 7a77acb3e8..0000000000 --- a/wxWidgets/include/wx/platinfo.h +++ /dev/null @@ -1,313 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: wx/platinfo.h -// Purpose: declaration of the wxPlatformInfo class -// Author: Francesco Montorsi -// Modified by: -// Created: 07.07.2006 (based on wxToolkitInfo) -// RCS-ID: $Id: platinfo.h 41807 2006-10-09 15:58:56Z VZ $ -// Copyright: (c) 2006 Francesco Montorsi -// License: wxWindows license -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_PLATINFO_H_ -#define _WX_PLATINFO_H_ - -#include "wx/string.h" - -// ---------------------------------------------------------------------------- -// wxPlatformInfo -// ---------------------------------------------------------------------------- - -// VERY IMPORTANT: when changing these enum values, also change the relative -// string tables in src/common/platinfo.cpp - - -// families & sub-families of operating systems -enum wxOperatingSystemId -{ - wxOS_UNKNOWN = 0, // returned on error - - wxOS_MAC_OS = 1 << 0, // Apple Mac OS 8/9/X with Mac paths - wxOS_MAC_OSX_DARWIN = 1 << 1, // Apple Mac OS X with Unix paths - wxOS_MAC = wxOS_MAC_OS|wxOS_MAC_OSX_DARWIN, - - wxOS_WINDOWS_9X = 1 << 2, // Windows 9x family (95/98/ME) - wxOS_WINDOWS_NT = 1 << 3, // Windows NT family (NT/2000/XP) - wxOS_WINDOWS_MICRO = 1 << 4, // MicroWindows - wxOS_WINDOWS_CE = 1 << 5, // Windows CE (Window Mobile) - wxOS_WINDOWS = wxOS_WINDOWS_9X | - wxOS_WINDOWS_NT | - wxOS_WINDOWS_MICRO | - wxOS_WINDOWS_CE, - - wxOS_UNIX_LINUX = 1 << 6, // Linux - wxOS_UNIX_FREEBSD = 1 << 7, // FreeBSD - wxOS_UNIX_OPENBSD = 1 << 8, // OpenBSD - wxOS_UNIX_NETBSD = 1 << 9, // NetBSD - wxOS_UNIX_SOLARIS = 1 << 10, // SunOS - wxOS_UNIX_AIX = 1 << 11, // AIX - wxOS_UNIX_HPUX = 1 << 12, // HP/UX - wxOS_UNIX = wxOS_UNIX_LINUX | - wxOS_UNIX_FREEBSD | - wxOS_UNIX_OPENBSD | - wxOS_UNIX_NETBSD | - wxOS_UNIX_SOLARIS | - wxOS_UNIX_AIX | - wxOS_UNIX_HPUX, - - // 1<<13 and 1<<14 available for other Unix flavours - - wxOS_DOS = 1 << 15, // Microsoft DOS - wxOS_OS2 = 1 << 16 // OS/2 -}; - -// list of wxWidgets ports - some of them can be used with more than -// a single toolkit. -enum wxPortId -{ - wxPORT_UNKNOWN = 0, // returned on error - - wxPORT_BASE = 1 << 0, // wxBase, no native toolkit used - - wxPORT_MSW = 1 << 1, // wxMSW, native toolkit is Windows API - wxPORT_MOTIF = 1 << 2, // wxMotif, using [Open]Motif or Lesstif - wxPORT_GTK = 1 << 3, // wxGTK, using GTK+ 1.x, 2.x, GPE or Maemo - wxPORT_MGL = 1 << 4, // wxMGL, using wxUniversal - wxPORT_X11 = 1 << 5, // wxX11, using wxUniversal - wxPORT_PM = 1 << 6, // wxOS2, using OS/2 Presentation Manager - wxPORT_OS2 = wxPORT_PM, // wxOS2, using OS/2 Presentation Manager - wxPORT_MAC = 1 << 7, // wxMac, using Carbon or Classic Mac API - wxPORT_COCOA = 1 << 8, // wxCocoa, using Cocoa NextStep/Mac API - wxPORT_WINCE = 1 << 9, // wxWinCE, toolkit is WinCE SDK API - wxPORT_PALMOS = 1 << 10, // wxPalmOS, toolkit is PalmOS API - wxPORT_DFB = 1 << 11 // wxDFB, using wxUniversal -}; - -// architecture of the operating system -// (regardless of the build environment of wxWidgets library - see -// wxIsPlatform64bit documentation for more info) -enum wxArchitecture -{ - wxARCH_INVALID = -1, // returned on error - - wxARCH_32, // 32 bit - wxARCH_64, - - wxARCH_MAX -}; - - -// endian-ness of the machine -enum wxEndianness -{ - wxENDIAN_INVALID = -1, // returned on error - - wxENDIAN_BIG, // 4321 - wxENDIAN_LITTLE, // 1234 - wxENDIAN_PDP, // 3412 - - wxENDIAN_MAX -}; - -// Information about the toolkit that the app is running under and some basic -// platform and architecture info -class WXDLLIMPEXP_BASE wxPlatformInfo -{ -public: - wxPlatformInfo(); - wxPlatformInfo(wxPortId pid, - int tkMajor = -1, int tkMinor = -1, - wxOperatingSystemId id = wxOS_UNKNOWN, - int osMajor = -1, int osMinor = -1, - wxArchitecture arch = wxARCH_INVALID, - wxEndianness endian = wxENDIAN_INVALID, - bool usingUniversal = false); - - // default copy ctor, assignment operator and dtor are ok - - bool operator==(const wxPlatformInfo &t) const; - - bool operator!=(const wxPlatformInfo &t) const - { return !(*this == t); } - - // Gets a wxPlatformInfo already initialized with the values for - // the currently running platform. - static const wxPlatformInfo& Get(); - - - - // string -> enum conversions - // --------------------------------- - - static wxOperatingSystemId GetOperatingSystemId(const wxString &name); - static wxPortId GetPortId(const wxString &portname); - - static wxArchitecture GetArch(const wxString &arch); - static wxEndianness GetEndianness(const wxString &end); - - // enum -> string conversions - // --------------------------------- - - static wxString GetOperatingSystemFamilyName(wxOperatingSystemId os); - static wxString GetOperatingSystemIdName(wxOperatingSystemId os); - static wxString GetPortIdName(wxPortId port, bool usingUniversal); - static wxString GetPortIdShortName(wxPortId port, bool usingUniversal); - - static wxString GetArchName(wxArchitecture arch); - static wxString GetEndiannessName(wxEndianness end); - - // getters - // ----------------- - - int GetOSMajorVersion() const - { return m_osVersionMajor; } - int GetOSMinorVersion() const - { return m_osVersionMinor; } - - // return true if the OS version >= major.minor - bool CheckOSVersion(int major, int minor) const - { - return DoCheckVersion(GetOSMajorVersion(), - GetOSMinorVersion(), - major, - minor); - } - - int GetToolkitMajorVersion() const - { return m_tkVersionMajor; } - int GetToolkitMinorVersion() const - { return m_tkVersionMinor; } - - bool CheckToolkitVersion(int major, int minor) const - { - return DoCheckVersion(GetToolkitMajorVersion(), - GetToolkitMinorVersion(), - major, - minor); - } - - bool IsUsingUniversalWidgets() const - { return m_usingUniversal; } - - wxOperatingSystemId GetOperatingSystemId() const - { return m_os; } - wxPortId GetPortId() const - { return m_port; } - wxArchitecture GetArchitecture() const - { return m_arch; } - wxEndianness GetEndianness() const - { return m_endian; } - - - // string getters - // ----------------- - - wxString GetOperatingSystemFamilyName() const - { return GetOperatingSystemFamilyName(m_os); } - wxString GetOperatingSystemIdName() const - { return GetOperatingSystemIdName(m_os); } - wxString GetPortIdName() const - { return GetPortIdName(m_port, m_usingUniversal); } - wxString GetPortIdShortName() const - { return GetPortIdShortName(m_port, m_usingUniversal); } - wxString GetArchName() const - { return GetArchName(m_arch); } - wxString GetEndiannessName() const - { return GetEndiannessName(m_endian); } - - // setters - // ----------------- - - void SetOSVersion(int major, int minor) - { m_osVersionMajor=major; m_osVersionMinor=minor; } - void SetToolkitVersion(int major, int minor) - { m_tkVersionMajor=major; m_tkVersionMinor=minor; } - - void SetOperatingSystemId(wxOperatingSystemId n) - { m_os = n; } - void SetPortId(wxPortId n) - { m_port = n; } - void SetArchitecture(wxArchitecture n) - { m_arch = n; } - void SetEndianness(wxEndianness n) - { m_endian = n; } - - // miscellaneous - // ----------------- - - bool IsOk() const - { - return m_osVersionMajor != -1 && m_osVersionMinor != -1 && - m_os != wxOS_UNKNOWN && - m_tkVersionMajor != -1 && m_tkVersionMinor != -1 && - m_port != wxPORT_UNKNOWN && - m_arch != wxARCH_INVALID && m_endian != wxENDIAN_INVALID; - } - - -protected: - static bool DoCheckVersion(int majorCur, int minorCur, int major, int minor) - { - return majorCur > major || (majorCur == major && minorCur >= minor); - } - - void InitForCurrentPlatform(); - - - // OS stuff - // ----------------- - - // Version of the OS; valid if m_os != wxOS_UNKNOWN - // (-1 means not initialized yet). - int m_osVersionMajor, - m_osVersionMinor; - - // Operating system ID. - wxOperatingSystemId m_os; - - - // toolkit - // ----------------- - - // Version of the underlying toolkit - // (-1 means not initialized yet; zero means no toolkit). - int m_tkVersionMajor, m_tkVersionMinor; - - // name of the wxWidgets port - wxPortId m_port; - - // is using wxUniversal widgets? - bool m_usingUniversal; - - - // others - // ----------------- - - // architecture of the OS - wxArchitecture m_arch; - - // endianness of the machine - wxEndianness m_endian; -}; - - -#if WXWIN_COMPATIBILITY_2_6 - #define wxUNKNOWN_PLATFORM wxOS_UNKNOWN - #define wxUnix wxOS_UNIX - #define wxWin95 wxOS_WINDOWS_9X - #define wxWIN95 wxOS_WINDOWS_9X - #define wxWINDOWS_NT wxOS_WINDOWS_NT - #define wxMSW wxOS_WINDOWS - #define wxWinCE wxOS_WINDOWS_CE - #define wxWIN32S wxOS_WINDOWS_9X - - #define wxPalmOS wxPORT_PALMOS - #define wxOS2 wxPORT_OS2 - #define wxMGL wxPORT_MGL - #define wxCocoa wxPORT_MAC - #define wxMac wxPORT_MAC - #define wxMotif wxPORT_MOTIF - #define wxGTK wxPORT_GTK -#endif // WXWIN_COMPATIBILITY_2_6 - -#endif // _WX_PLATINFO_H_ diff --git a/wxWidgets/include/wx/popupwin.h b/wxWidgets/include/wx/popupwin.h deleted file mode 100644 index c2f2d984d1..0000000000 --- a/wxWidgets/include/wx/popupwin.h +++ /dev/null @@ -1,192 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: wx/popupwin.h -// Purpose: wxPopupWindow interface declaration -// Author: Vadim Zeitlin -// Modified by: -// Created: 06.01.01 -// RCS-ID: $Id: popupwin.h 53135 2008-04-12 02:31:04Z VZ $ -// Copyright: (c) 2001 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr> -// License: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_POPUPWIN_H_BASE_ -#define _WX_POPUPWIN_H_BASE_ - -#include "wx/defs.h" - -#if wxUSE_POPUPWIN - -#include "wx/window.h" - -// ---------------------------------------------------------------------------- -// wxPopupWindow: a special kind of top level window used for popup menus, -// combobox popups and such. -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxPopupWindowBase : public wxWindow -{ -public: - wxPopupWindowBase() { } - virtual ~wxPopupWindowBase(); - - // create the popup window - // - // style may only contain border flags - bool Create(wxWindow *parent, int style = wxBORDER_NONE); - - // move the popup window to the right position, i.e. such that it is - // entirely visible - // - // the popup is positioned at ptOrigin + size if it opens below and to the - // right (default), at ptOrigin - sizePopup if it opens above and to the - // left &c - // - // the point must be given in screen coordinates! - virtual void Position(const wxPoint& ptOrigin, - const wxSize& size); - - virtual bool IsTopLevel() const { return true; } - - DECLARE_NO_COPY_CLASS(wxPopupWindowBase) -}; - - -// include the real class declaration -#if defined(__WXMSW__) - #include "wx/msw/popupwin.h" -#elif defined(__WXPM__) - #include "wx/os2/popupwin.h" -#elif defined(__WXGTK20__) - #include "wx/gtk/popupwin.h" -#elif defined(__WXGTK__) - #include "wx/gtk1/popupwin.h" -#elif defined(__WXX11__) - #include "wx/x11/popupwin.h" -#elif defined(__WXMOTIF__) - #include "wx/motif/popupwin.h" -#elif defined(__WXMGL__) - #include "wx/mgl/popupwin.h" -#elif defined(__WXMAC__) - #include "wx/mac/popupwin.h" -#else - #error "wxPopupWindow is not supported under this platform." -#endif - -// ---------------------------------------------------------------------------- -// wxPopupTransientWindow: a wxPopupWindow which disappears automatically -// when the user clicks mouse outside it or if it loses focus in any other way -// ---------------------------------------------------------------------------- - -class WXDLLIMPEXP_FWD_CORE wxPopupWindowHandler; -class WXDLLIMPEXP_FWD_CORE wxPopupFocusHandler; - -class WXDLLEXPORT wxPopupTransientWindow : public wxPopupWindow -{ -public: - // ctors - wxPopupTransientWindow() { Init(); } - wxPopupTransientWindow(wxWindow *parent, int style = wxBORDER_NONE); - - virtual ~wxPopupTransientWindow(); - - // popup the window (this will show it too) and keep focus at winFocus - // (or itself if it's NULL), dismiss the popup if we lose focus - virtual void Popup(wxWindow *focus = NULL); - - // hide the window - virtual void Dismiss(); - - // can the window be dismissed now? - // - // VZ: where is this used?? - virtual bool CanDismiss() - { return true; } - - // called when a mouse is pressed while the popup is shown: return true - // from here to prevent its normal processing by the popup (which consists - // in dismissing it if the mouse is cilcked outside it) - virtual bool ProcessLeftDown(wxMouseEvent& event); - - // Overridden to grab the input on some plaforms - virtual bool Show( bool show = true ); - -protected: - // common part of all ctors - void Init(); - - // this is called when the popup is disappeared because of anything - // else but direct call to Dismiss() - virtual void OnDismiss(); - - // dismiss and notify the derived class - void DismissAndNotify(); - - // remove our event handlers - void PopHandlers(); - - // get alerted when child gets deleted from under us - void OnDestroy(wxWindowDestroyEvent& event); - -#if defined( __WXMSW__ ) || defined( __WXMAC__ ) - // check if the mouse needs captured or released - void OnIdle(wxIdleEvent& event); -#endif - - // the child of this popup if any - wxWindow *m_child; - - // the window which has the focus while we're shown - wxWindow *m_focus; - - // these classes may call our DismissAndNotify() - friend class wxPopupWindowHandler; - friend class wxPopupFocusHandler; - - // the handlers we created, may be NULL (if not, must be deleted) - wxPopupWindowHandler *m_handlerPopup; - wxPopupFocusHandler *m_handlerFocus; - - DECLARE_EVENT_TABLE() - DECLARE_DYNAMIC_CLASS(wxPopupTransientWindow) - DECLARE_NO_COPY_CLASS(wxPopupTransientWindow) -}; - -#if wxUSE_COMBOBOX && defined(__WXUNIVERSAL__) - -// ---------------------------------------------------------------------------- -// wxPopupComboWindow: wxPopupTransientWindow used by wxComboBox -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxComboBox; -class WXDLLEXPORT wxComboCtrl; - -class WXDLLEXPORT wxPopupComboWindow : public wxPopupTransientWindow -{ -public: - wxPopupComboWindow() { m_combo = NULL; } - wxPopupComboWindow(wxComboCtrl *parent); - - bool Create(wxComboCtrl *parent); - - // position the window correctly relatively to the combo - void PositionNearCombo(); - -protected: - // notify the combo here - virtual void OnDismiss(); - - // forward the key presses to the combobox - void OnKeyDown(wxKeyEvent& event); - - // the parent combobox - wxComboCtrl *m_combo; - - DECLARE_EVENT_TABLE() - DECLARE_DYNAMIC_CLASS(wxPopupComboWindow) -}; - -#endif // wxUSE_COMBOBOX && defined(__WXUNIVERSAL__) - -#endif // wxUSE_POPUPWIN - -#endif // _WX_POPUPWIN_H_BASE_ diff --git a/wxWidgets/include/wx/power.h b/wxWidgets/include/wx/power.h deleted file mode 100644 index d81677e0b8..0000000000 --- a/wxWidgets/include/wx/power.h +++ /dev/null @@ -1,111 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: wx/power.h -// Purpose: functions and classes for system power management -// Author: Vadim Zeitlin -// Modified by: -// Created: 2006-05-27 -// RCS-ID: $Id: power.h 48811 2007-09-19 23:11:28Z RD $ -// Copyright: (c) 2006 Vadim Zeitlin <vadim@wxwindows.org> -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_POWER_H_ -#define _WX_POWER_H_ - -#include "wx/event.h" - -// ---------------------------------------------------------------------------- -// power management constants -// ---------------------------------------------------------------------------- - -enum wxPowerType -{ - wxPOWER_SOCKET, - wxPOWER_BATTERY, - wxPOWER_UNKNOWN -}; - -enum wxBatteryState -{ - wxBATTERY_NORMAL_STATE, // system is fully usable - wxBATTERY_LOW_STATE, // start to worry - wxBATTERY_CRITICAL_STATE, // save quickly - wxBATTERY_SHUTDOWN_STATE, // too late - wxBATTERY_UNKNOWN_STATE -}; - -// ---------------------------------------------------------------------------- -// wxPowerEvent is generated when the system online status changes -// ---------------------------------------------------------------------------- - -// currently the power events are only available under Windows, to avoid -// compiling in the code for handling them which is never going to be invoked -// under the other platforms, we define wxHAS_POWER_EVENTS symbol if this event -// is available, it should be used to guard all code using wxPowerEvent -#ifdef __WXMSW__ - -#define wxHAS_POWER_EVENTS - -class WXDLLIMPEXP_BASE wxPowerEvent : public wxEvent -{ -public: - wxPowerEvent(wxEventType evtType) : wxEvent(wxID_NONE, evtType) - { - m_veto = false; - } - - // Veto the operation (only makes sense with EVT_POWER_SUSPENDING) - void Veto() { m_veto = true; } - - bool IsVetoed() const { return m_veto; } - - - // default copy ctor, assignment operator and dtor are ok - - virtual wxEvent *Clone() const { return new wxPowerEvent(*this); } - -private: - bool m_veto; - -#if wxABI_VERSION >= 20806 - DECLARE_ABSTRACT_CLASS(wxPowerEvent) -#endif -}; - -BEGIN_DECLARE_EVENT_TYPES() - DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_BASE, wxEVT_POWER_SUSPENDING, 406) - DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_BASE, wxEVT_POWER_SUSPENDED, 407) - DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_BASE, wxEVT_POWER_SUSPEND_CANCEL, 408) - DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_BASE, wxEVT_POWER_RESUME, 444) -END_DECLARE_EVENT_TYPES() - -typedef void (wxEvtHandler::*wxPowerEventFunction)(wxPowerEvent&); - -#define wxPowerEventHandler(func) \ - (wxObjectEventFunction)(wxEventFunction) \ - wxStaticCastEvent(wxPowerEventFunction, &func) - -#define EVT_POWER_SUSPENDING(func) \ - wx__DECLARE_EVT0(wxEVT_POWER_SUSPENDING, wxPowerEventHandler(func)) -#define EVT_POWER_SUSPENDED(func) \ - wx__DECLARE_EVT0(wxEVT_POWER_SUSPENDED, wxPowerEventHandler(func)) -#define EVT_POWER_SUSPEND_CANCEL(func) \ - wx__DECLARE_EVT0(wxEVT_POWER_SUSPEND_CANCEL, wxPowerEventHandler(func)) -#define EVT_POWER_RESUME(func) \ - wx__DECLARE_EVT0(wxEVT_POWER_RESUME, wxPowerEventHandler(func)) - -#else // no support for power events - #undef wxHAS_POWER_EVENTS -#endif // support for power events/no support - -// ---------------------------------------------------------------------------- -// power management functions -// ---------------------------------------------------------------------------- - -// return the current system power state: online or offline -WXDLLIMPEXP_BASE wxPowerType wxGetPowerType(); - -// return approximate battery state -WXDLLIMPEXP_BASE wxBatteryState wxGetBatteryState(); - -#endif // _WX_POWER_H_ diff --git a/wxWidgets/include/wx/print.h b/wxWidgets/include/wx/print.h deleted file mode 100644 index e366ee25ca..0000000000 --- a/wxWidgets/include/wx/print.h +++ /dev/null @@ -1,39 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/print.h -// Purpose: Base header for printer classes -// Author: Julian Smart -// Modified by: -// Created: -// RCS-ID: $Id: print.h 41240 2006-09-15 16:45:48Z PC $ -// Copyright: (c) Julian Smart -// Licence: wxWindows Licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_PRINT_H_BASE_ -#define _WX_PRINT_H_BASE_ - -#include "wx/defs.h" - -#if wxUSE_PRINTING_ARCHITECTURE - -#if defined(__WXMSW__) && !defined(__WXUNIVERSAL__) - -#include "wx/msw/printwin.h" - -#elif defined(__WXMAC__) - -#include "wx/mac/printmac.h" - -#elif defined(__WXPM__) - -#include "wx/os2/printos2.h" - -#else - -#include "wx/generic/printps.h" - -#endif - -#endif // wxUSE_PRINTING_ARCHITECTURE -#endif - // _WX_PRINT_H_BASE_ diff --git a/wxWidgets/include/wx/printdlg.h b/wxWidgets/include/wx/printdlg.h deleted file mode 100644 index 21f57b19da..0000000000 --- a/wxWidgets/include/wx/printdlg.h +++ /dev/null @@ -1,122 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/printdlg.h -// Purpose: Base header and class for print dialogs -// Author: Julian Smart -// Modified by: -// Created: -// RCS-ID: $Id: printdlg.h 41020 2006-09-05 20:47:48Z VZ $ -// Copyright: (c) Julian Smart -// Licence: wxWindows Licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_PRINTDLG_H_BASE_ -#define _WX_PRINTDLG_H_BASE_ - -#include "wx/defs.h" - -#if wxUSE_PRINTING_ARCHITECTURE - -#include "wx/event.h" -#include "wx/dialog.h" -#include "wx/intl.h" -#include "wx/cmndata.h" - - -// --------------------------------------------------------------------------- -// wxPrintDialogBase: interface for the dialog for printing -// --------------------------------------------------------------------------- - -class WXDLLEXPORT wxPrintDialogBase : public wxDialog -{ -public: - wxPrintDialogBase() { } - wxPrintDialogBase(wxWindow *parent, - wxWindowID id = wxID_ANY, - const wxString &title = wxEmptyString, - const wxPoint &pos = wxDefaultPosition, - const wxSize &size = wxDefaultSize, - long style = wxDEFAULT_DIALOG_STYLE); - - virtual wxPrintDialogData& GetPrintDialogData() = 0; - virtual wxPrintData& GetPrintData() = 0; - virtual wxDC *GetPrintDC() = 0; - -private: - DECLARE_ABSTRACT_CLASS(wxPrintDialogBase) - DECLARE_NO_COPY_CLASS(wxPrintDialogBase) -}; - -// --------------------------------------------------------------------------- -// wxPrintDialog: the dialog for printing. -// --------------------------------------------------------------------------- - -class WXDLLEXPORT wxPrintDialog : public wxObject -{ -public: - wxPrintDialog(wxWindow *parent, wxPrintDialogData* data = NULL); - wxPrintDialog(wxWindow *parent, wxPrintData* data); - virtual ~wxPrintDialog(); - - virtual int ShowModal(); - - virtual wxPrintDialogData& GetPrintDialogData(); - virtual wxPrintData& GetPrintData(); - virtual wxDC *GetPrintDC(); - -private: - wxPrintDialogBase *m_pimpl; - -private: - DECLARE_DYNAMIC_CLASS(wxPrintDialog) - DECLARE_NO_COPY_CLASS(wxPrintDialog) -}; - -// --------------------------------------------------------------------------- -// wxPageSetupDialogBase: interface for the page setup dialog -// --------------------------------------------------------------------------- - -class WXDLLEXPORT wxPageSetupDialogBase: public wxDialog -{ -public: - wxPageSetupDialogBase() { } - wxPageSetupDialogBase(wxWindow *parent, - wxWindowID id = wxID_ANY, - const wxString &title = wxEmptyString, - const wxPoint &pos = wxDefaultPosition, - const wxSize &size = wxDefaultSize, - long style = wxDEFAULT_DIALOG_STYLE); - - virtual wxPageSetupDialogData& GetPageSetupDialogData() = 0; - -private: - DECLARE_ABSTRACT_CLASS(wxPageSetupDialogBase) - DECLARE_NO_COPY_CLASS(wxPageSetupDialogBase) -}; - -// --------------------------------------------------------------------------- -// wxPageSetupDialog: the page setup dialog -// --------------------------------------------------------------------------- - -class WXDLLEXPORT wxPageSetupDialog: public wxObject -{ -public: - wxPageSetupDialog(wxWindow *parent, wxPageSetupDialogData *data = NULL); - virtual ~wxPageSetupDialog(); - - int ShowModal(); - wxPageSetupDialogData& GetPageSetupDialogData(); - // old name - wxPageSetupDialogData& GetPageSetupData(); - -private: - wxPageSetupDialogBase *m_pimpl; - -private: - DECLARE_DYNAMIC_CLASS(wxPageSetupDialog) - DECLARE_NO_COPY_CLASS(wxPageSetupDialog) -}; - -#endif - -#endif - // _WX_PRINTDLG_H_BASE_ diff --git a/wxWidgets/include/wx/private/browserhack28.h b/wxWidgets/include/wx/private/browserhack28.h deleted file mode 100644 index 28d6da71bc..0000000000 --- a/wxWidgets/include/wx/private/browserhack28.h +++ /dev/null @@ -1,20 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/private/browserhack28.h -// Purpose: Allows GUI library to override base wxLaunchDefaultBrowser. -// Author: David Elliott -// Modified by: -// Created: 2007-08-19 -// RCS-ID: $Id: browserhack28.h 48184 2007-08-19 19:22:09Z DE $ -// Copyright: (c) David Elliott -// Licence: wxWidgets licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_PRIVATE_BROWSERHACK28_H_ -#define _WX_PRIVATE_BROWSERHACK28_H_ - -typedef bool (*wxLaunchDefaultBrowserImpl_t)(const wxString& url, int flags); - -// Function the GUI library can call to provide a better implementation -WXDLLIMPEXP_BASE void wxSetLaunchDefaultBrowserImpl(wxLaunchDefaultBrowserImpl_t newImpl); - -#endif //ndef _WX_PRIVATE_BROWSERHACK28_H_ diff --git a/wxWidgets/include/wx/private/fileback.h b/wxWidgets/include/wx/private/fileback.h deleted file mode 100644 index f3b72718e2..0000000000 --- a/wxWidgets/include/wx/private/fileback.h +++ /dev/null @@ -1,83 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: include/wx/private/fileback.h -// Purpose: Back an input stream with memory or a file -// Author: Mike Wetherell -// RCS-ID: $Id: fileback.h 61872 2009-09-09 22:37:05Z VZ $ -// Copyright: (c) 2006 Mike Wetherell -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_FILEBACK_H__ -#define _WX_FILEBACK_H__ - -#include "wx/defs.h" - -#if wxUSE_FILESYSTEM - -#include "wx/stream.h" - -// ---------------------------------------------------------------------------- -// Backs an input stream with memory or a file to make it seekable. -// -// One or more wxBackedInputStreams can be used to read it's data. The data is -// reference counted, so stays alive until the last wxBackingFile or -// wxBackedInputStream using it is destroyed. -// ---------------------------------------------------------------------------- - -class WXDLLIMPEXP_BASE wxBackingFile -{ -public: - enum { DefaultBufSize = 16384 }; - - // Takes ownership of stream. If the stream is smaller than bufsize, the - // backing file is never created and the backing is done with memory. - wxBackingFile(wxInputStream *stream, - size_t bufsize = DefaultBufSize, - const wxString& prefix = wxT("wxbf")); - - wxBackingFile() : m_impl(NULL) { } - ~wxBackingFile(); - - wxBackingFile(const wxBackingFile& backer); - wxBackingFile& operator=(const wxBackingFile& backer); - - operator bool() const { return m_impl != NULL; } - -private: - class wxBackingFileImpl *m_impl; - friend class wxBackedInputStream; -}; - -// ---------------------------------------------------------------------------- -// An input stream to read from a wxBackingFile. -// ---------------------------------------------------------------------------- - -class WXDLLIMPEXP_BASE wxBackedInputStream : public wxInputStream -{ -public: - wxBackedInputStream(const wxBackingFile& backer); - - // If the length of the backer's parent stream is unknown then GetLength() - // returns wxInvalidOffset until the parent has been read to the end. - wxFileOffset GetLength() const; - - // Returns the length, reading the parent stream to the end if necessary. - wxFileOffset FindLength() const; - - bool IsSeekable() const { return true; } - -protected: - size_t OnSysRead(void *buffer, size_t size); - wxFileOffset OnSysSeek(wxFileOffset pos, wxSeekMode mode); - wxFileOffset OnSysTell() const; - -private: - wxBackingFile m_backer; - wxFileOffset m_pos; - - DECLARE_NO_COPY_CLASS(wxBackedInputStream) -}; - -#endif // wxUSE_FILESYSTEM - -#endif // _WX_FILEBACK_H__ diff --git a/wxWidgets/include/wx/private/filename.h b/wxWidgets/include/wx/private/filename.h deleted file mode 100644 index e6c754b6e5..0000000000 --- a/wxWidgets/include/wx/private/filename.h +++ /dev/null @@ -1,56 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: include/wx/private/filename.h -// Purpose: Internal declarations for src/common/filename.cpp -// Author: Mike Wetherell -// Modified by: -// Created: 2006-10-22 -// RCS-ID: $Id: filename.h 42277 2006-10-23 13:10:12Z MW $ -// Copyright: (c) 2006 Mike Wetherell -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_PRIVATE_FILENAME_H_ -#define _WX_PRIVATE_FILENAME_H_ - -#include "wx/file.h" -#include "wx/ffile.h" - -// Self deleting temp files aren't supported on all platforms. Therefore -// rather than let these be in the API, they can be used internally to -// implement classes (e.g. wxTempFileStream), that will do the clean up when -// the OS doesn't support it. - -// Same usage as wxFileName::CreateTempFileName() with the extra parameter -// deleteOnClose. *deleteOnClose true on entry requests a file created with a -// delete on close flag, on exit the value of *deleteOnClose indicates whether -// available. - -#if wxUSE_FILE -wxString wxCreateTempFileName(const wxString& prefix, - wxFile *fileTemp, - bool *deleteOnClose = NULL); -#endif - -#if wxUSE_FFILE -wxString wxCreateTempFileName(const wxString& prefix, - wxFFile *fileTemp, - bool *deleteOnClose = NULL); -#endif - -// Returns an open temp file, if possible either an unlinked open file or one -// that will delete on close. Only returns the filename if neither was -// possible, so that the caller can delete the file when done. - -#if wxUSE_FILE -bool wxCreateTempFile(const wxString& prefix, - wxFile *fileTemp, - wxString *name); -#endif - -#if wxUSE_FFILE -bool wxCreateTempFile(const wxString& prefix, - wxFFile *fileTemp, - wxString *name); -#endif - -#endif // _WX_PRIVATE_FILENAME_H_ diff --git a/wxWidgets/include/wx/private/fontmgr.h b/wxWidgets/include/wx/private/fontmgr.h deleted file mode 100644 index 88904a4020..0000000000 --- a/wxWidgets/include/wx/private/fontmgr.h +++ /dev/null @@ -1,255 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/private/fontmgr.h -// Purpose: font management for ports that don't have their own -// Author: Vaclav Slavik -// Created: 2006-11-18 -// RCS-ID: $Id: fontmgr.h 43855 2006-12-07 08:57:44Z PC $ -// Copyright: (c) 2001-2002 SciTech Software, Inc. (www.scitechsoft.com) -// (c) 2006 REA Elektronik GmbH -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_PRIVATE_FONTMGR_H_ -#define _WX_PRIVATE_FONTMGR_H_ - -#include "wx/list.h" -#include "wx/fontutil.h" - -class wxFontsManager; -class wxFontInstance; -class wxFontInstanceList; -class wxFontFace; -class wxFontBundle; -class wxFontBundleHash; -class wxFontMgrFontRefData; - -WX_DECLARE_LIST(wxFontBundle, wxFontBundleList); - -/** - This class represents single font face with set parameters (point size, - antialiasing). - */ -class wxFontInstanceBase -{ -protected: - wxFontInstanceBase(float ptSize, bool aa) : m_ptSize(ptSize), m_aa(aa) {} - virtual ~wxFontInstanceBase() {} - -public: - float GetPointSize() const { return m_ptSize; } - bool IsAntiAliased() const { return m_aa; } - -protected: - float m_ptSize; - bool m_aa; -}; - - -/// This class represents loaded font face (bundle+weight+italics). -class wxFontFaceBase -{ -protected: - /// Ctor. Creates object with reference count = 0, Acquire() must be - /// called after the object is created. - wxFontFaceBase(); - virtual ~wxFontFaceBase(); - -public: - /// Increases reference count of the face - virtual void Acquire(); - - /** - Decreases reference count of the face. Call this when you no longer - use the object returned by wxFontBundle. Note that this doesn't destroy - the object, but only optionally shuts it down, so it's possible to - call Acquire() and Release() more than once. - */ - virtual void Release(); - - /** - Returns instance of the font at given size. - - @param ptSize point size of the font to create; note that this is - a float and not integer, it should be wxFont's point - size multipled by wxDC's scale factor - @param aa should the font be antialiased? - */ - virtual wxFontInstance *GetFontInstance(float ptSize, bool aa); - -protected: - /// Called to create a new instance of the font by GetFontInstance() if - /// it wasn't found it cache. - virtual wxFontInstance *CreateFontInstance(float ptSize, bool aa) = 0; - -protected: - unsigned m_refCnt; - wxFontInstanceList *m_instances; -}; - -/** - This class represents font bundle. Font bundle is set of faces that have - the same name, but differ in weight and italics. - */ -class wxFontBundleBase -{ -public: - wxFontBundleBase(); - virtual ~wxFontBundleBase(); - - /// Returns name of the bundle - virtual wxString GetName() const = 0; - - /// Returns true if the font is fixe-width - virtual bool IsFixed() const = 0; - - /// Type of faces in the bundle - enum FaceType - { - // NB: values of these constants are set so that it's possible to - // make OR-combinations of them and still get valid enum element - FaceType_Regular = 0, - FaceType_Italic = 1, - FaceType_Bold = 2, - FaceType_BoldItalic = FaceType_Italic | FaceType_Bold, - - FaceType_Max - }; - - /// Returns true if the given face is available - bool HasFace(FaceType type) const { return m_faces[type] != NULL; } - - /** - Returns font face object that can be used to render font of given type. - - Note that this method can only be called if HasFace(type) returns true. - - Acquire() was called on the returned object, you must call Release() - when you stop using it. - */ - wxFontFace *GetFace(FaceType type) const; - - /** - Returns font face object that can be used to render given font. - - Acquire() was called on the returned object, you must call Release() - when you stop using it. - */ - wxFontFace *GetFaceForFont(const wxFontMgrFontRefData& font) const; - -protected: - wxFontFace *m_faces[FaceType_Max]; -}; - - -/** - Base class for wxFontsManager class, which manages the list of all - available fonts and their loaded instances. - */ -class wxFontsManagerBase -{ -protected: - wxFontsManagerBase(); - virtual ~wxFontsManagerBase(); - -public: - /// Returns the font manager singleton, creating it if it doesn't exist - static wxFontsManager *Get(); - - /// Called by wxApp to shut down the manager - static void CleanUp(); - - /// Returns list of all available font bundles - const wxFontBundleList& GetBundles() const { return *m_list; } - - /** - Returns object representing font bundle with the given name. - - The returned object is owned by wxFontsManager, you must not delete it. - */ - wxFontBundle *GetBundle(const wxString& name) const; - - /** - Returns object representing font bundle that can be used to render - given font. - - The returned object is owned by wxFontsManager, you must not delete it. - */ - wxFontBundle *GetBundleForFont(const wxFontMgrFontRefData& font) const; - - /// This method must be called by derived - void AddBundle(wxFontBundle *bundle); - - /// Returns default facename for given wxFont family - virtual wxString GetDefaultFacename(wxFontFamily family) const = 0; - -private: - wxFontBundleHash *m_hash; - wxFontBundleList *m_list; - -protected: - static wxFontsManager *ms_instance; -}; - - - -#if defined(__WXMGL__) - #include "wx/mgl/private/fontmgr.h" -#elif defined(__WXDFB__) - #include "wx/dfb/private/fontmgr.h" -#endif - - - -/// wxFontMgrFontRefData implementation using wxFontsManager classes -class wxFontMgrFontRefData : public wxObjectRefData -{ -public: - wxFontMgrFontRefData(int size = wxDEFAULT, - int family = wxDEFAULT, - int style = wxDEFAULT, - int weight = wxDEFAULT, - bool underlined = false, - const wxString& faceName = wxEmptyString, - wxFontEncoding encoding = wxFONTENCODING_DEFAULT); - wxFontMgrFontRefData(const wxFontMgrFontRefData& data); - ~wxFontMgrFontRefData(); - - wxFontBundle *GetFontBundle() const; - wxFontInstance *GetFontInstance(float scale, bool antialiased) const; - - bool IsFixedWidth() const { return GetFontBundle()->IsFixed(); } - - const wxNativeFontInfo *GetNativeFontInfo() const { return &m_info; } - - int GetPointSize() const { return m_info.pointSize; } - wxString GetFaceName() const { return m_info.faceName; } - int GetFamily() const { return m_info.family; } - int GetStyle() const { return m_info.style; } - int GetWeight() const { return m_info.weight; } - bool GetUnderlined() const { return m_info.underlined; } - wxFontEncoding GetEncoding() const { return m_info.encoding; } - - void SetPointSize(int pointSize); - void SetFamily(int family); - void SetStyle(int style); - void SetWeight(int weight); - void SetFaceName(const wxString& faceName); - void SetUnderlined(bool underlined); - void SetEncoding(wxFontEncoding encoding); - - // Unofficial API, don't use - void SetNoAntiAliasing(bool no); - bool GetNoAntiAliasing() const { return m_noAA; } - -private: - void EnsureValidFont(); - - wxNativeFontInfo m_info; - bool m_noAA; - - wxFontFace *m_fontFace; - wxFontBundle *m_fontBundle; - bool m_fontValid; -}; - -#endif // _WX_PRIVATE_FONTMGR_H_ diff --git a/wxWidgets/include/wx/private/overlay.h b/wxWidgets/include/wx/private/overlay.h deleted file mode 100644 index a3f95e201c..0000000000 --- a/wxWidgets/include/wx/private/overlay.h +++ /dev/null @@ -1,72 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/private/overlay.h -// Purpose: wxOverlayImpl declaration -// Author: Stefan Csomor -// Modified by: -// Created: 2006-10-20 -// RCS-ID: $Id: overlay.h 53135 2008-04-12 02:31:04Z VZ $ -// Copyright: (c) wxWidgets team -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_PRIVATE_OVERLAY_H_ -#define _WX_PRIVATE_OVERLAY_H_ - -#include "wx/overlay.h" - -#ifdef wxHAS_NATIVE_OVERLAY - -#if defined(__WXMAC__) - #include "wx/mac/carbon/private/overlay.h" -#elif defined(__WXDFB__) - #include "wx/dfb/private/overlay.h" -#else - #error "unknown native wxOverlay implementation" -#endif - -#else // !wxHAS_NATIVE_OVERLAY - -#include "wx/bitmap.h" - -class WXDLLIMPEXP_FWD_CORE wxWindow; - -// generic implementation of wxOverlay -class wxOverlayImpl -{ -public: - wxOverlayImpl(); - ~wxOverlayImpl(); - - - // clears the overlay without restoring the former state - // to be done eg when the window content has been changed and repainted - void Reset(); - - // returns true if it has been setup - bool IsOk(); - - void Init(wxWindowDC* dc, int x , int y , int width , int height); - - void BeginDrawing(wxWindowDC* dc); - - void EndDrawing(wxWindowDC* dc); - - void Clear(wxWindowDC* dc); - -private: - wxBitmap m_bmpSaved ; - int m_x ; - int m_y ; - int m_width ; - int m_height ; -// this is to enable wxMOTIF and UNIV to compile.... -// currently (10 oct 06) we don't use m_window -// ce - how do we fix this -#if defined(__WXGTK__) || defined(__WXMSW__) - wxWindow* m_window ; -#endif -} ; - -#endif // wxHAS_NATIVE_OVERLAY/!wxHAS_NATIVE_OVERLAY - -#endif // _WX_PRIVATE_OVERLAY_H_ diff --git a/wxWidgets/include/wx/private/socketevtdispatch.h b/wxWidgets/include/wx/private/socketevtdispatch.h deleted file mode 100644 index 553c78231a..0000000000 --- a/wxWidgets/include/wx/private/socketevtdispatch.h +++ /dev/null @@ -1,67 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/private/socketevtdispatch.h -// Purpose: wxSocketEventDispatcher class -// Authors: Angel Vidal -// Modified by: -// Created: August 2006 -// Copyright: (c) Angel Vidal -// RCS-ID: $Id: socketevtdispatch.h 43976 2006-12-14 14:13:57Z VS $ -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_PRIVATE_SOCKETEVTDISPATCH_H_ -#define _WX_PRIVATE_SOCKETEVTDISPATCH_H_ - -#include "wx/defs.h" - -#if wxUSE_SOCKETS - -#include "wx/hash.h" - -// forward declarations -class wxSocketEventDispatcherEntry; -class GSocket; - -enum wxSocketEventDispatcherType -{ - wxSocketEventDispatcherInput, - wxSocketEventDispatcherOutput -}; - -class WXDLLIMPEXP_CORE wxSocketEventDispatcher : public wxHashTable -{ -protected: - wxSocketEventDispatcher() : wxHashTable(wxKEY_INTEGER) {} - -public: - // returns instance of the table - static wxSocketEventDispatcher& Get(); - - virtual ~wxSocketEventDispatcher() - { - WX_CLEAR_HASH_TABLE(*this) - } - - void RegisterCallback(int fd, wxSocketEventDispatcherType socketType, - GSocket* socket); - - void UnregisterCallback(int fd, wxSocketEventDispatcherType socketType); - - void RunLoop(int timeout = 0); - -private: - void AddEvents(fd_set* readset, fd_set* writeset); - - int FillSets(fd_set* readset, fd_set* writeset); - - wxSocketEventDispatcherEntry* FindEntry(int fd); - -private: - static wxSocketEventDispatcher *ms_instance; - - friend class wxSocketEventDispatcherModule; -}; - -#endif // wxUSE_SOCKETS - -#endif // _WX_PRIVATE_SOCKETEVTDISPATCH_H_ diff --git a/wxWidgets/include/wx/prntbase.h b/wxWidgets/include/wx/prntbase.h deleted file mode 100644 index 5264d78624..0000000000 --- a/wxWidgets/include/wx/prntbase.h +++ /dev/null @@ -1,665 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/prntbase.h -// Purpose: Base classes for printing framework -// Author: Julian Smart -// Modified by: -// Created: 01/02/97 -// RCS-ID: $Id: prntbase.h 62502 2009-10-27 16:39:01Z VZ $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_PRNTBASEH__ -#define _WX_PRNTBASEH__ - -#include "wx/defs.h" - -#if wxUSE_PRINTING_ARCHITECTURE - -#include "wx/event.h" -#include "wx/cmndata.h" -#include "wx/panel.h" -#include "wx/scrolwin.h" -#include "wx/dialog.h" -#include "wx/frame.h" - -class WXDLLIMPEXP_FWD_CORE wxDC; -class WXDLLIMPEXP_FWD_CORE wxButton; -class WXDLLIMPEXP_FWD_CORE wxChoice; -class WXDLLIMPEXP_FWD_CORE wxPrintout; -class WXDLLIMPEXP_FWD_CORE wxPrinterBase; -class WXDLLIMPEXP_FWD_CORE wxPrintDialogBase; -class WXDLLIMPEXP_FWD_CORE wxPrintDialog; -class WXDLLIMPEXP_FWD_CORE wxPageSetupDialogBase; -class WXDLLIMPEXP_FWD_CORE wxPageSetupDialog; -class WXDLLIMPEXP_FWD_CORE wxPrintPreviewBase; -class WXDLLIMPEXP_FWD_CORE wxPreviewCanvas; -class WXDLLIMPEXP_FWD_CORE wxPreviewControlBar; -class WXDLLIMPEXP_FWD_CORE wxPreviewFrame; -class WXDLLIMPEXP_FWD_CORE wxPrintFactory; -class WXDLLIMPEXP_FWD_CORE wxPrintNativeDataBase; - -//---------------------------------------------------------------------------- -// error consts -//---------------------------------------------------------------------------- - -enum wxPrinterError -{ - wxPRINTER_NO_ERROR = 0, - wxPRINTER_CANCELLED, - wxPRINTER_ERROR -}; - -//---------------------------------------------------------------------------- -// wxPrintFactory -//---------------------------------------------------------------------------- - -class WXDLLEXPORT wxPrintFactory -{ -public: - wxPrintFactory() {} - virtual ~wxPrintFactory() {} - - virtual wxPrinterBase *CreatePrinter( wxPrintDialogData* data ) = 0; - - virtual wxPrintPreviewBase *CreatePrintPreview( wxPrintout *preview, - wxPrintout *printout = NULL, - wxPrintDialogData *data = NULL ) = 0; - virtual wxPrintPreviewBase *CreatePrintPreview( wxPrintout *preview, - wxPrintout *printout, - wxPrintData *data ) = 0; - - virtual wxPrintDialogBase *CreatePrintDialog( wxWindow *parent, - wxPrintDialogData *data = NULL ) = 0; - virtual wxPrintDialogBase *CreatePrintDialog( wxWindow *parent, - wxPrintData *data ) = 0; - - virtual wxPageSetupDialogBase *CreatePageSetupDialog( wxWindow *parent, - wxPageSetupDialogData * data = NULL ) = 0; - - virtual wxDC* CreatePrinterDC( const wxPrintData& data ) = 0; - - // What to do and what to show in the wxPrintDialog - // a) Use the generic print setup dialog or a native one? - virtual bool HasPrintSetupDialog() = 0; - virtual wxDialog *CreatePrintSetupDialog( wxWindow *parent, wxPrintData *data ) = 0; - // b) Provide the "print to file" option ourselves or via print setup? - virtual bool HasOwnPrintToFile() = 0; - // c) Show current printer - virtual bool HasPrinterLine() = 0; - virtual wxString CreatePrinterLine() = 0; - // d) Show Status line for current printer? - virtual bool HasStatusLine() = 0; - virtual wxString CreateStatusLine() = 0; - - - virtual wxPrintNativeDataBase *CreatePrintNativeData() = 0; - - static void SetPrintFactory( wxPrintFactory *factory ); - static wxPrintFactory *GetFactory(); -private: - static wxPrintFactory *m_factory; -}; - -class WXDLLEXPORT wxNativePrintFactory: public wxPrintFactory -{ -public: - virtual wxPrinterBase *CreatePrinter( wxPrintDialogData *data ); - - virtual wxPrintPreviewBase *CreatePrintPreview( wxPrintout *preview, - wxPrintout *printout = NULL, - wxPrintDialogData *data = NULL ); - virtual wxPrintPreviewBase *CreatePrintPreview( wxPrintout *preview, - wxPrintout *printout, - wxPrintData *data ); - - virtual wxPrintDialogBase *CreatePrintDialog( wxWindow *parent, - wxPrintDialogData *data = NULL ); - virtual wxPrintDialogBase *CreatePrintDialog( wxWindow *parent, - wxPrintData *data ); - - virtual wxPageSetupDialogBase *CreatePageSetupDialog( wxWindow *parent, - wxPageSetupDialogData * data = NULL ); - - virtual wxDC* CreatePrinterDC( const wxPrintData& data ); - - virtual bool HasPrintSetupDialog(); - virtual wxDialog *CreatePrintSetupDialog( wxWindow *parent, wxPrintData *data ); - virtual bool HasOwnPrintToFile(); - virtual bool HasPrinterLine(); - virtual wxString CreatePrinterLine(); - virtual bool HasStatusLine(); - virtual wxString CreateStatusLine(); - - virtual wxPrintNativeDataBase *CreatePrintNativeData(); -}; - -//---------------------------------------------------------------------------- -// wxPrintNativeDataBase -//---------------------------------------------------------------------------- - -class WXDLLEXPORT wxPrintNativeDataBase: public wxObject -{ -public: - wxPrintNativeDataBase(); - virtual ~wxPrintNativeDataBase() {} - - virtual bool TransferTo( wxPrintData &data ) = 0; - virtual bool TransferFrom( const wxPrintData &data ) = 0; - - virtual bool Ok() const { return IsOk(); } - virtual bool IsOk() const = 0; - - int m_ref; - -private: - DECLARE_CLASS(wxPrintNativeDataBase) - DECLARE_NO_COPY_CLASS(wxPrintNativeDataBase) -}; - -//---------------------------------------------------------------------------- -// wxPrinterBase -//---------------------------------------------------------------------------- - -/* - * Represents the printer: manages printing a wxPrintout object - */ - -class WXDLLEXPORT wxPrinterBase: public wxObject -{ -public: - wxPrinterBase(wxPrintDialogData *data = (wxPrintDialogData *) NULL); - virtual ~wxPrinterBase(); - - virtual wxWindow *CreateAbortWindow(wxWindow *parent, wxPrintout *printout); - virtual void ReportError(wxWindow *parent, wxPrintout *printout, const wxString& message); - - virtual wxPrintDialogData& GetPrintDialogData() const; - bool GetAbort() const { return sm_abortIt; } - - static wxPrinterError GetLastError() { return sm_lastError; } - - /////////////////////////////////////////////////////////////////////////// - // OVERRIDES - - virtual bool Setup(wxWindow *parent) = 0; - virtual bool Print(wxWindow *parent, wxPrintout *printout, bool prompt = true) = 0; - virtual wxDC* PrintDialog(wxWindow *parent) = 0; - -protected: - wxPrintDialogData m_printDialogData; - wxPrintout* m_currentPrintout; - - static wxPrinterError sm_lastError; - -public: - static wxWindow* sm_abortWindow; - static bool sm_abortIt; - -private: - DECLARE_CLASS(wxPrinterBase) - DECLARE_NO_COPY_CLASS(wxPrinterBase) -}; - -//---------------------------------------------------------------------------- -// wxPrinter -//---------------------------------------------------------------------------- - -class WXDLLEXPORT wxPrinter: public wxPrinterBase -{ -public: - wxPrinter(wxPrintDialogData *data = (wxPrintDialogData *) NULL); - virtual ~wxPrinter(); - - virtual wxWindow *CreateAbortWindow(wxWindow *parent, wxPrintout *printout); - virtual void ReportError(wxWindow *parent, wxPrintout *printout, const wxString& message); - - virtual bool Setup(wxWindow *parent); - virtual bool Print(wxWindow *parent, wxPrintout *printout, bool prompt = true); - virtual wxDC* PrintDialog(wxWindow *parent); - - virtual wxPrintDialogData& GetPrintDialogData() const; - -protected: - wxPrinterBase *m_pimpl; - -private: - DECLARE_CLASS(wxPrinter) - DECLARE_NO_COPY_CLASS(wxPrinter) -}; - -//---------------------------------------------------------------------------- -// wxPrintout -//---------------------------------------------------------------------------- - -/* - * Represents an object via which a document may be printed. - * The programmer derives from this, overrides (at least) OnPrintPage, - * and passes it to a wxPrinter object for printing, or a wxPrintPreview - * object for previewing. - */ - -class WXDLLEXPORT wxPrintout: public wxObject -{ -public: - wxPrintout(const wxString& title = wxT("Printout")); - virtual ~wxPrintout(); - - virtual bool OnBeginDocument(int startPage, int endPage); - virtual void OnEndDocument(); - virtual void OnBeginPrinting(); - virtual void OnEndPrinting(); - - // Guaranteed to be before any other functions are called - virtual void OnPreparePrinting() { } - - virtual bool HasPage(int page); - virtual bool OnPrintPage(int page) = 0; - virtual void GetPageInfo(int *minPage, int *maxPage, int *pageFrom, int *pageTo); - - virtual wxString GetTitle() const { return m_printoutTitle; } - - wxDC *GetDC() const { return m_printoutDC; } - void SetDC(wxDC *dc) { m_printoutDC = dc; } - - void FitThisSizeToPaper(const wxSize& imageSize); - void FitThisSizeToPage(const wxSize& imageSize); - void FitThisSizeToPageMargins(const wxSize& imageSize, const wxPageSetupDialogData& pageSetupData); - void MapScreenSizeToPaper(); - void MapScreenSizeToPage(); - void MapScreenSizeToPageMargins(const wxPageSetupDialogData& pageSetupData); - void MapScreenSizeToDevice(); - - wxRect GetLogicalPaperRect() const; - wxRect GetLogicalPageRect() const; - wxRect GetLogicalPageMarginsRect(const wxPageSetupDialogData& pageSetupData) const; - - void SetLogicalOrigin(wxCoord x, wxCoord y); - void OffsetLogicalOrigin(wxCoord xoff, wxCoord yoff); - - void SetPageSizePixels(int w, int h) { m_pageWidthPixels = w; m_pageHeightPixels = h; } - void GetPageSizePixels(int *w, int *h) const { *w = m_pageWidthPixels; *h = m_pageHeightPixels; } - void SetPageSizeMM(int w, int h) { m_pageWidthMM = w; m_pageHeightMM = h; } - void GetPageSizeMM(int *w, int *h) const { *w = m_pageWidthMM; *h = m_pageHeightMM; } - - void SetPPIScreen(int x, int y) { m_PPIScreenX = x; m_PPIScreenY = y; } - void GetPPIScreen(int *x, int *y) const { *x = m_PPIScreenX; *y = m_PPIScreenY; } - void SetPPIPrinter(int x, int y) { m_PPIPrinterX = x; m_PPIPrinterY = y; } - void GetPPIPrinter(int *x, int *y) const { *x = m_PPIPrinterX; *y = m_PPIPrinterY; } - - void SetPaperRectPixels(const wxRect& paperRectPixels) { m_paperRectPixels = paperRectPixels; } - wxRect GetPaperRectPixels() const { return m_paperRectPixels; } - - virtual bool IsPreview() const { return m_isPreview; } - - virtual void SetIsPreview(bool p) { m_isPreview = p; } - -private: - wxString m_printoutTitle; - wxDC* m_printoutDC; - - int m_pageWidthPixels; - int m_pageHeightPixels; - - int m_pageWidthMM; - int m_pageHeightMM; - - int m_PPIScreenX; - int m_PPIScreenY; - int m_PPIPrinterX; - int m_PPIPrinterY; - - wxRect m_paperRectPixels; - - bool m_isPreview; - -private: - DECLARE_ABSTRACT_CLASS(wxPrintout) - DECLARE_NO_COPY_CLASS(wxPrintout) -}; - -//---------------------------------------------------------------------------- -// wxPreviewCanvas -//---------------------------------------------------------------------------- - -/* - * Canvas upon which a preview is drawn. - */ - -class WXDLLEXPORT wxPreviewCanvas: public wxScrolledWindow -{ -public: - wxPreviewCanvas(wxPrintPreviewBase *preview, - wxWindow *parent, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = 0, - const wxString& name = wxT("canvas")); - virtual ~wxPreviewCanvas(); - - void OnPaint(wxPaintEvent& event); - void OnChar(wxKeyEvent &event); - // Responds to colour changes - void OnSysColourChanged(wxSysColourChangedEvent& event); - -private: -#if wxUSE_MOUSEWHEEL - void OnMouseWheel(wxMouseEvent& event); -#endif // wxUSE_MOUSEWHEEL - - wxPrintPreviewBase* m_printPreview; - - DECLARE_CLASS(wxPreviewCanvas) - DECLARE_EVENT_TABLE() - DECLARE_NO_COPY_CLASS(wxPreviewCanvas) -}; - -//---------------------------------------------------------------------------- -// wxPreviewFrame -//---------------------------------------------------------------------------- - -/* - * Default frame for showing preview. - */ - -class WXDLLEXPORT wxPreviewFrame: public wxFrame -{ -public: - wxPreviewFrame(wxPrintPreviewBase *preview, - wxWindow *parent, - const wxString& title = wxT("Print Preview"), - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = wxDEFAULT_FRAME_STYLE | wxFRAME_FLOAT_ON_PARENT, - const wxString& name = wxFrameNameStr); - virtual ~wxPreviewFrame(); - - void OnCloseWindow(wxCloseEvent& event); - virtual void Initialize(); - virtual void CreateCanvas(); - virtual void CreateControlBar(); - - inline wxPreviewControlBar* GetControlBar() const { return m_controlBar; } - -protected: - wxPreviewCanvas* m_previewCanvas; - wxPreviewControlBar* m_controlBar; - wxPrintPreviewBase* m_printPreview; - wxWindowDisabler* m_windowDisabler; - -private: - DECLARE_CLASS(wxPreviewFrame) - DECLARE_EVENT_TABLE() - DECLARE_NO_COPY_CLASS(wxPreviewFrame) -}; - -//---------------------------------------------------------------------------- -// wxPreviewControlBar -//---------------------------------------------------------------------------- - -/* - * A panel with buttons for controlling a print preview. - * The programmer may wish to use other means for controlling - * the print preview. - */ - -#define wxPREVIEW_PRINT 1 -#define wxPREVIEW_PREVIOUS 2 -#define wxPREVIEW_NEXT 4 -#define wxPREVIEW_ZOOM 8 -#define wxPREVIEW_FIRST 16 -#define wxPREVIEW_LAST 32 -#define wxPREVIEW_GOTO 64 - -#define wxPREVIEW_DEFAULT (wxPREVIEW_PREVIOUS|wxPREVIEW_NEXT|wxPREVIEW_ZOOM\ - |wxPREVIEW_FIRST|wxPREVIEW_GOTO|wxPREVIEW_LAST) - -// Ids for controls -#define wxID_PREVIEW_CLOSE 1 -#define wxID_PREVIEW_NEXT 2 -#define wxID_PREVIEW_PREVIOUS 3 -#define wxID_PREVIEW_PRINT 4 -#define wxID_PREVIEW_ZOOM 5 -#define wxID_PREVIEW_FIRST 6 -#define wxID_PREVIEW_LAST 7 -#define wxID_PREVIEW_GOTO 8 - -class WXDLLEXPORT wxPreviewControlBar: public wxPanel -{ - DECLARE_CLASS(wxPreviewControlBar) - -public: - wxPreviewControlBar(wxPrintPreviewBase *preview, - long buttons, - wxWindow *parent, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = wxTAB_TRAVERSAL, - const wxString& name = wxT("panel")); - virtual ~wxPreviewControlBar(); - - virtual void CreateButtons(); - virtual void SetZoomControl(int zoom); - virtual int GetZoomControl(); - virtual wxPrintPreviewBase *GetPrintPreview() const - { return m_printPreview; } - - void OnWindowClose(wxCommandEvent& event); - void OnNext(); - void OnPrevious(); - void OnFirst(); - void OnLast(); - void OnGoto(); - void OnPrint(); - void OnPrintButton(wxCommandEvent& WXUNUSED(event)) { OnPrint(); } - void OnNextButton(wxCommandEvent & WXUNUSED(event)) { OnNext(); } - void OnPreviousButton(wxCommandEvent & WXUNUSED(event)) { OnPrevious(); } - void OnFirstButton(wxCommandEvent & WXUNUSED(event)) { OnFirst(); } - void OnLastButton(wxCommandEvent & WXUNUSED(event)) { OnLast(); } - void OnGotoButton(wxCommandEvent & WXUNUSED(event)) { OnGoto(); } - void OnZoom(wxCommandEvent& event); - void OnPaint(wxPaintEvent& event); - -protected: - wxPrintPreviewBase* m_printPreview; - wxButton* m_closeButton; - wxButton* m_nextPageButton; - wxButton* m_previousPageButton; - wxButton* m_printButton; - wxChoice* m_zoomControl; - wxButton* m_firstPageButton; - wxButton* m_lastPageButton; - wxButton* m_gotoPageButton; - long m_buttonFlags; - -private: - DECLARE_EVENT_TABLE() - DECLARE_NO_COPY_CLASS(wxPreviewControlBar) -}; - -//---------------------------------------------------------------------------- -// wxPrintPreviewBase -//---------------------------------------------------------------------------- - -/* - * Programmer creates an object of this class to preview a wxPrintout. - */ - -class WXDLLEXPORT wxPrintPreviewBase: public wxObject -{ -public: - wxPrintPreviewBase(wxPrintout *printout, - wxPrintout *printoutForPrinting = (wxPrintout *) NULL, - wxPrintDialogData *data = (wxPrintDialogData *) NULL); - wxPrintPreviewBase(wxPrintout *printout, - wxPrintout *printoutForPrinting, - wxPrintData *data); - virtual ~wxPrintPreviewBase(); - - virtual bool SetCurrentPage(int pageNum); - virtual int GetCurrentPage() const; - - virtual void SetPrintout(wxPrintout *printout); - virtual wxPrintout *GetPrintout() const; - virtual wxPrintout *GetPrintoutForPrinting() const; - - virtual void SetFrame(wxFrame *frame); - virtual void SetCanvas(wxPreviewCanvas *canvas); - - virtual wxFrame *GetFrame() const; - virtual wxPreviewCanvas *GetCanvas() const; - - // This is a helper routine, used by the next 4 routines. - - virtual void CalcRects(wxPreviewCanvas *canvas, wxRect& printableAreaRect, wxRect& paperRect); - - // The preview canvas should call this from OnPaint - virtual bool PaintPage(wxPreviewCanvas *canvas, wxDC& dc); - - // This draws a blank page onto the preview canvas - virtual bool DrawBlankPage(wxPreviewCanvas *canvas, wxDC& dc); - - // Adjusts the scrollbars for the current scale - virtual void AdjustScrollbars(wxPreviewCanvas *canvas); - - // This is called by wxPrintPreview to render a page into a wxMemoryDC. - virtual bool RenderPage(int pageNum); - - - virtual void SetZoom(int percent); - virtual int GetZoom() const; - - virtual wxPrintDialogData& GetPrintDialogData(); - - virtual int GetMaxPage() const; - virtual int GetMinPage() const; - - virtual bool Ok() const { return IsOk(); } - virtual bool IsOk() const; - virtual void SetOk(bool ok); - - /////////////////////////////////////////////////////////////////////////// - // OVERRIDES - - // If we own a wxPrintout that can be used for printing, this - // will invoke the actual printing procedure. Called - // by the wxPreviewControlBar. - virtual bool Print(bool interactive) = 0; - - // Calculate scaling that needs to be done to get roughly - // the right scaling for the screen pretending to be - // the currently selected printer. - virtual void DetermineScaling() = 0; - -protected: - wxPrintDialogData m_printDialogData; - wxPreviewCanvas* m_previewCanvas; - wxFrame* m_previewFrame; - wxBitmap* m_previewBitmap; - wxPrintout* m_previewPrintout; - wxPrintout* m_printPrintout; - int m_currentPage; - int m_currentZoom; - float m_previewScaleX; - float m_previewScaleY; - int m_topMargin; - int m_leftMargin; - int m_pageWidth; - int m_pageHeight; - int m_minPage; - int m_maxPage; - - bool m_isOk; - bool m_printingPrepared; // Called OnPreparePrinting? - -private: - void Init(wxPrintout *printout, wxPrintout *printoutForPrinting); - - // helpers for RenderPage(): - bool RenderPageIntoDC(wxDC& dc, int pageNum); - bool RenderPageIntoBitmap(wxBitmap& bmp, int pageNum); - - DECLARE_NO_COPY_CLASS(wxPrintPreviewBase) - DECLARE_CLASS(wxPrintPreviewBase) -}; - -//---------------------------------------------------------------------------- -// wxPrintPreview -//---------------------------------------------------------------------------- - -class WXDLLEXPORT wxPrintPreview: public wxPrintPreviewBase -{ -public: - wxPrintPreview(wxPrintout *printout, - wxPrintout *printoutForPrinting = (wxPrintout *) NULL, - wxPrintDialogData *data = (wxPrintDialogData *) NULL); - wxPrintPreview(wxPrintout *printout, - wxPrintout *printoutForPrinting, - wxPrintData *data); - virtual ~wxPrintPreview(); - - virtual bool SetCurrentPage(int pageNum); - virtual int GetCurrentPage() const; - virtual void SetPrintout(wxPrintout *printout); - virtual wxPrintout *GetPrintout() const; - virtual wxPrintout *GetPrintoutForPrinting() const; - virtual void SetFrame(wxFrame *frame); - virtual void SetCanvas(wxPreviewCanvas *canvas); - - virtual wxFrame *GetFrame() const; - virtual wxPreviewCanvas *GetCanvas() const; - virtual bool PaintPage(wxPreviewCanvas *canvas, wxDC& dc); - virtual bool DrawBlankPage(wxPreviewCanvas *canvas, wxDC& dc); - virtual void AdjustScrollbars(wxPreviewCanvas *canvas); - virtual bool RenderPage(int pageNum); - virtual void SetZoom(int percent); - virtual int GetZoom() const; - - virtual bool Print(bool interactive); - virtual void DetermineScaling(); - - virtual wxPrintDialogData& GetPrintDialogData(); - - virtual int GetMaxPage() const; - virtual int GetMinPage() const; - - virtual bool Ok() const { return IsOk(); } - virtual bool IsOk() const; - virtual void SetOk(bool ok); - -private: - wxPrintPreviewBase *m_pimpl; - -private: - DECLARE_CLASS(wxPrintPreview) - DECLARE_NO_COPY_CLASS(wxPrintPreview) -}; - -//---------------------------------------------------------------------------- -// wxPrintAbortDialog -//---------------------------------------------------------------------------- - -class WXDLLEXPORT wxPrintAbortDialog: public wxDialog -{ -public: - wxPrintAbortDialog(wxWindow *parent, - const wxString& title, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = 0, - const wxString& name = wxT("dialog")) - : wxDialog(parent, wxID_ANY, title, pos, size, style, name) - { - } - - void OnCancel(wxCommandEvent& event); - -private: - DECLARE_EVENT_TABLE() - DECLARE_NO_COPY_CLASS(wxPrintAbortDialog) -}; - -#endif // wxUSE_PRINTING_ARCHITECTURE - -#endif - // _WX_PRNTBASEH__ diff --git a/wxWidgets/include/wx/process.h b/wxWidgets/include/wx/process.h deleted file mode 100644 index aaed2703a1..0000000000 --- a/wxWidgets/include/wx/process.h +++ /dev/null @@ -1,172 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/process.h -// Purpose: wxProcess class -// Author: Guilhem Lavaux -// Modified by: Vadim Zeitlin to check error codes, added Detach() method -// Created: 24/06/98 -// RCS-ID: $Id: process.h 42713 2006-10-30 11:56:12Z ABX $ -// Copyright: (c) 1998 Guilhem Lavaux -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_PROCESSH__ -#define _WX_PROCESSH__ - -#include "wx/event.h" - -#if wxUSE_STREAMS - #include "wx/stream.h" -#endif - -#include "wx/utils.h" // for wxSignal - -// the wxProcess creation flags -enum -{ - // no redirection - wxPROCESS_DEFAULT = 0, - - // redirect the IO of the child process - wxPROCESS_REDIRECT = 1 -}; - -// ---------------------------------------------------------------------------- -// A wxProcess object should be passed to wxExecute - than its OnTerminate() -// function will be called when the process terminates. -// ---------------------------------------------------------------------------- - -class WXDLLIMPEXP_BASE wxProcess : public wxEvtHandler -{ -public: - // kill the process with the given PID - static wxKillError Kill(int pid, wxSignal sig = wxSIGTERM, int flags = wxKILL_NOCHILDREN); - - // test if the given process exists - static bool Exists(int pid); - - // this function replaces the standard popen() one: it launches a process - // asynchronously and allows the caller to get the streams connected to its - // std{in|out|err} - // - // on error NULL is returned, in any case the process object will be - // deleted automatically when the process terminates and should *not* be - // deleted by the caller - static wxProcess *Open(const wxString& cmd, int flags = wxEXEC_ASYNC); - - - // ctors - wxProcess(wxEvtHandler *parent = (wxEvtHandler *) NULL, int nId = wxID_ANY) - { Init(parent, nId, wxPROCESS_DEFAULT); } - - wxProcess(int flags) { Init(NULL, wxID_ANY, flags); } - - virtual ~wxProcess(); - - // get the process ID of the process executed by Open() - long GetPid() const { return m_pid; } - - // may be overridden to be notified about process termination - virtual void OnTerminate(int pid, int status); - - // call this before passing the object to wxExecute() to redirect the - // launched process stdin/stdout, then use GetInputStream() and - // GetOutputStream() to get access to them - void Redirect() { m_redirect = true; } - bool IsRedirected() const { return m_redirect; } - - // detach from the parent - should be called by the parent if it's deleted - // before the process it started terminates - void Detach(); - -#if wxUSE_STREAMS - // Pipe handling - wxInputStream *GetInputStream() const { return m_inputStream; } - wxInputStream *GetErrorStream() const { return m_errorStream; } - wxOutputStream *GetOutputStream() const { return m_outputStream; } - - // close the output stream indicating that nothing more will be written - void CloseOutput() { delete m_outputStream; m_outputStream = NULL; } - - // return true if the child process stdout is not closed - bool IsInputOpened() const; - - // return true if any input is available on the child process stdout/err - bool IsInputAvailable() const; - bool IsErrorAvailable() const; - - // implementation only (for wxExecute) - // - // NB: the streams passed here should correspond to the child process - // stdout, stdin and stderr and here the normal naming convention is - // used unlike elsewhere in this class - void SetPipeStreams(wxInputStream *outStream, - wxOutputStream *inStream, - wxInputStream *errStream); -#endif // wxUSE_STREAMS - -protected: - void Init(wxEvtHandler *parent, int id, int flags); - void SetPid(long pid) { m_pid = pid; } - - int m_id; - long m_pid; - -#if wxUSE_STREAMS - // these streams are connected to stdout, stderr and stdin of the child - // process respectively (yes, m_inputStream corresponds to stdout -- very - // confusing but too late to change now) - wxInputStream *m_inputStream, - *m_errorStream; - wxOutputStream *m_outputStream; -#endif // wxUSE_STREAMS - - bool m_redirect; - - DECLARE_DYNAMIC_CLASS(wxProcess) - DECLARE_NO_COPY_CLASS(wxProcess) -}; - -// ---------------------------------------------------------------------------- -// wxProcess events -// ---------------------------------------------------------------------------- - -BEGIN_DECLARE_EVENT_TYPES() - DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_BASE, wxEVT_END_PROCESS, 440) -END_DECLARE_EVENT_TYPES() - -class WXDLLIMPEXP_BASE wxProcessEvent : public wxEvent -{ -public: - wxProcessEvent(int nId = 0, int pid = 0, int exitcode = 0) : wxEvent(nId) - { - m_eventType = wxEVT_END_PROCESS; - m_pid = pid; - m_exitcode = exitcode; - } - - // accessors - // PID of process which terminated - int GetPid() { return m_pid; } - - // the exit code - int GetExitCode() { return m_exitcode; } - - // implement the base class pure virtual - virtual wxEvent *Clone() const { return new wxProcessEvent(*this); } - -public: - int m_pid, - m_exitcode; - - DECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxProcessEvent) -}; - -typedef void (wxEvtHandler::*wxProcessEventFunction)(wxProcessEvent&); - -#define wxProcessEventHandler(func) \ - (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxProcessEventFunction, &func) - -#define EVT_END_PROCESS(id, func) \ - wx__DECLARE_EVT1(wxEVT_END_PROCESS, id, wxProcessEventHandler(func)) - -#endif // _WX_PROCESSH__ diff --git a/wxWidgets/include/wx/progdlg.h b/wxWidgets/include/wx/progdlg.h deleted file mode 100644 index f1692b1308..0000000000 --- a/wxWidgets/include/wx/progdlg.h +++ /dev/null @@ -1,36 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/progdlg.h -// Purpose: Base header for wxProgressDialog -// Author: Julian Smart -// Modified by: -// Created: -// RCS-ID: $Id: progdlg.h 41089 2006-09-09 13:36:54Z RR $ -// Copyright: (c) Julian Smart -// Licence: wxWindows Licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_PROGDLG_H_BASE_ -#define _WX_PROGDLG_H_BASE_ - -#include "wx/defs.h" - -/* - * wxProgressDialog flags - */ -#define wxPD_CAN_ABORT 0x0001 -#define wxPD_APP_MODAL 0x0002 -#define wxPD_AUTO_HIDE 0x0004 -#define wxPD_ELAPSED_TIME 0x0008 -#define wxPD_ESTIMATED_TIME 0x0010 -#define wxPD_SMOOTH 0x0020 -#define wxPD_REMAINING_TIME 0x0040 -#define wxPD_CAN_SKIP 0x0080 - - -#ifdef __WXPALMOS__ - #include "wx/palmos/progdlg.h" -#else - #include "wx/generic/progdlgg.h" -#endif - -#endif // _WX_PROGDLG_H_BASE_ diff --git a/wxWidgets/include/wx/propdlg.h b/wxWidgets/include/wx/propdlg.h deleted file mode 100644 index 4bad68bb32..0000000000 --- a/wxWidgets/include/wx/propdlg.h +++ /dev/null @@ -1,19 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/propdlg.h -// Purpose: wxPropertySheetDialog base header -// Author: Julian Smart -// Modified by: -// Created: -// RCS-ID: $Id: propdlg.h 33948 2005-05-04 18:57:50Z JS $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_PROPDLG_H_BASE_ -#define _WX_PROPDLG_H_BASE_ - -#include "wx/generic/propdlg.h" - -#endif - // _WX_PROPDLG_H_BASE_ - diff --git a/wxWidgets/include/wx/protocol/file.h b/wxWidgets/include/wx/protocol/file.h deleted file mode 100644 index e31d88fb4a..0000000000 --- a/wxWidgets/include/wx/protocol/file.h +++ /dev/null @@ -1,37 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: file.h -// Purpose: File protocol -// Author: Guilhem Lavaux -// Modified by: -// Created: 1997 -// RCS-ID: $Id: file.h 43836 2006-12-06 19:20:40Z VZ $ -// Copyright: (c) 1997, 1998 Guilhem Lavaux -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef __WX_PROTO_FILE_H__ -#define __WX_PROTO_FILE_H__ - -#include "wx/defs.h" - -#if wxUSE_PROTOCOL_FILE - -#include "wx/protocol/protocol.h" - -class WXDLLIMPEXP_NET wxFileProto: public wxProtocol { - DECLARE_DYNAMIC_CLASS_NO_COPY(wxFileProto) - DECLARE_PROTOCOL(wxFileProto) -protected: - wxProtocolError m_error; -public: - wxFileProto(); - virtual ~wxFileProto(); - - wxProtocolError GetError() { return m_error; } - bool Abort() { return TRUE; } - wxInputStream *GetInputStream(const wxString& path); -}; - -#endif // wxUSE_PROTOCOL_FILE - -#endif // __WX_PROTO_FILE_H__ diff --git a/wxWidgets/include/wx/protocol/ftp.h b/wxWidgets/include/wx/protocol/ftp.h deleted file mode 100644 index 787dc496f2..0000000000 --- a/wxWidgets/include/wx/protocol/ftp.h +++ /dev/null @@ -1,182 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: ftp.h -// Purpose: FTP protocol -// Author: Vadim Zeitlin -// Modified by: Mark Johnson, wxWindows@mj10777.de -// 20000917 : RmDir, GetLastResult, GetList -// Created: 07/07/1997 -// RCS-ID: $Id: ftp.h 61872 2009-09-09 22:37:05Z VZ $ -// Copyright: (c) 1997, 1998 Guilhem Lavaux -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef __WX_FTP_H__ -#define __WX_FTP_H__ - -#include "wx/defs.h" - -#if wxUSE_PROTOCOL_FTP - -#include "wx/sckaddr.h" -#include "wx/protocol/protocol.h" -#include "wx/url.h" - -class WXDLLIMPEXP_NET wxFTP : public wxProtocol -{ -public: - enum TransferMode - { - NONE, // not set by user explicitly - ASCII, - BINARY - }; - - wxFTP(); - virtual ~wxFTP(); - - // Connecting and disconnecting - void SetUser(const wxString& user) { m_user = user; } - void SetPassword(const wxString& passwd) { m_passwd = passwd; } - - bool Connect(wxSockAddress& addr, bool wait = true); - bool Connect(const wxString& host); - - // disconnect - virtual bool Close(); - - // Parameters set up - - // set transfer mode now - void SetPassive(bool pasv) { m_bPassive = pasv; } - void SetDefaultTimeout(wxUint32 Value); - bool SetBinary() { return SetTransferMode(BINARY); } - bool SetAscii() { return SetTransferMode(ASCII); } - bool SetTransferMode(TransferMode mode); - - // Generic FTP interface - - // the error code - virtual wxProtocolError GetError() { return m_lastError; } - - // the last FTP server reply - const wxString& GetLastResult() { return m_lastResult; } - - // send any FTP command (should be full FTP command line but without - // trailing "\r\n") and return its return code - char SendCommand(const wxString& command); - - // check that the command returned the given code - bool CheckCommand(const wxString& command, char expectedReturn) - { - return SendCommand(command) == expectedReturn; - } - - // Filesystem commands - bool ChDir(const wxString& dir); - bool MkDir(const wxString& dir); - bool RmDir(const wxString& dir); - wxString Pwd(); - bool Rename(const wxString& src, const wxString& dst); - bool RmFile(const wxString& path); - - // Get the size of a file in the current dir. - // this function tries its best to deliver the size in bytes using BINARY - // (the SIZE command reports different sizes depending on whether - // type is set to ASCII or BINARY) - // returns -1 if file is non-existant or size could not be found - int GetFileSize(const wxString& fileName); - - // Check to see if a file exists in the current dir - bool FileExists(const wxString& fileName); - - // Download methods - bool Abort(); - - virtual wxInputStream *GetInputStream(const wxString& path); - virtual wxOutputStream *GetOutputStream(const wxString& path); - - // Directory listing - - // get the list of full filenames, the format is fixed: one file name per - // line - bool GetFilesList(wxArrayString& files, - const wxString& wildcard = wxEmptyString) - { - return GetList(files, wildcard, false); - } - - // get a directory list in server dependent format - this can be shown - // directly to the user - bool GetDirList(wxArrayString& files, - const wxString& wildcard = wxEmptyString) - { - return GetList(files, wildcard, true); - } - - // equivalent to either GetFilesList() (default) or GetDirList() - bool GetList(wxArrayString& files, - const wxString& wildcard = wxEmptyString, - bool details = false); - -protected: - // this executes a simple ftp command with the given argument and returns - // true if it its return code starts with '2' - bool DoSimpleCommand(const wxChar *command, - const wxString& arg = wxEmptyString); - - // get the server reply, return the first character of the reply code, - // '1'..'5' for normal FTP replies, 0 (*not* '0') if an error occurred - char GetResult(); - - // check that the result is equal to expected value - bool CheckResult(char ch) { return GetResult() == ch; } - - // return the socket to be used, Passive/Active versions are used only by - // GetPort() - wxSocketBase *GetPort(); - wxSocketBase *GetPassivePort(); - wxSocketBase *GetActivePort(); - - // helper for GetPort() - wxString GetPortCmdArgument(const wxIPV4address& Local, const wxIPV4address& New); - - // accept connection from server in active mode, returns the same socket as - // passed in in passive mode - wxSocketBase *AcceptIfActive(wxSocketBase *sock); - - - wxString m_user, - m_passwd; - - wxString m_lastResult; - wxProtocolError m_lastError; - - // true if there is an FTP transfer going on - bool m_streaming; - - // although this should be set to ASCII by default according to STD9, - // we will use BINARY transfer mode by default for backwards compatibility - TransferMode m_currentTransfermode; - - friend class wxInputFTPStream; - friend class wxOutputFTPStream; - - bool m_bPassive; - wxUint32 m_uiDefaultTimeout; - - // following is true when a read or write times out, we then assume - // the connection is dead and abort. we avoid additional delays this way - bool m_bEncounteredError; - - - DECLARE_DYNAMIC_CLASS_NO_COPY(wxFTP) - DECLARE_PROTOCOL(wxFTP) -}; - -// the trace mask used by assorted wxLogTrace() in ftp code, do -// wxLog::AddTraceMask(FTP_TRACE_MASK) to see them in output -#define FTP_TRACE_MASK wxT("ftp") - -#endif // wxUSE_PROTOCOL_FTP - -#endif // __WX_FTP_H__ diff --git a/wxWidgets/include/wx/protocol/http.h b/wxWidgets/include/wx/protocol/http.h deleted file mode 100644 index b52664d322..0000000000 --- a/wxWidgets/include/wx/protocol/http.h +++ /dev/null @@ -1,91 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: http.h -// Purpose: HTTP protocol -// Author: Guilhem Lavaux -// Modified by: Simo Virokannas (authentication, Dec 2005) -// Created: August 1997 -// RCS-ID: $Id: http.h 41020 2006-09-05 20:47:48Z VZ $ -// Copyright: (c) 1997, 1998 Guilhem Lavaux -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// -#ifndef _WX_HTTP_H -#define _WX_HTTP_H - -#include "wx/defs.h" - -#if wxUSE_PROTOCOL_HTTP - -#include "wx/hashmap.h" -#include "wx/protocol/protocol.h" - -WX_DECLARE_STRING_HASH_MAP_WITH_DECL( wxString, wxStringToStringHashMap, - class WXDLLIMPEXP_NET ); - -class WXDLLIMPEXP_NET wxHTTP : public wxProtocol -{ -public: - wxHTTP(); - virtual ~wxHTTP(); - - virtual bool Connect(const wxString& host, unsigned short port); - virtual bool Connect(const wxString& host) { return Connect(host, 0); } - virtual bool Connect(wxSockAddress& addr, bool wait); - bool Abort(); - wxInputStream *GetInputStream(const wxString& path); - inline wxProtocolError GetError() { return m_perr; } - wxString GetContentType(); - - void SetHeader(const wxString& header, const wxString& h_data); - wxString GetHeader(const wxString& header) const; - void SetPostBuffer(const wxString& post_buf); - - void SetProxyMode(bool on); - - int GetResponse() { return m_http_response; } - - virtual void SetUser(const wxString& user) { m_username = user; } - virtual void SetPassword(const wxString& passwd ) { m_password = passwd; } - -protected: - enum wxHTTP_Req - { - wxHTTP_GET, - wxHTTP_POST, - wxHTTP_HEAD - }; - - typedef wxStringToStringHashMap::iterator wxHeaderIterator; - typedef wxStringToStringHashMap::const_iterator wxHeaderConstIterator; - - bool BuildRequest(const wxString& path, wxHTTP_Req req); - void SendHeaders(); - bool ParseHeaders(); - - wxString GenerateAuthString(const wxString& user, const wxString& pass) const; - - // find the header in m_headers - wxHeaderIterator FindHeader(const wxString& header); - wxHeaderConstIterator FindHeader(const wxString& header) const; - - // deletes the header value strings - void ClearHeaders(); - - wxProtocolError m_perr; - wxStringToStringHashMap m_headers; - bool m_read, - m_proxy_mode; - wxSockAddress *m_addr; - wxString m_post_buf; - int m_http_response; - wxString m_username; - wxString m_password; - - DECLARE_DYNAMIC_CLASS(wxHTTP) - DECLARE_PROTOCOL(wxHTTP) - DECLARE_NO_COPY_CLASS(wxHTTP) -}; - -#endif // wxUSE_PROTOCOL_HTTP - -#endif // _WX_HTTP_H - diff --git a/wxWidgets/include/wx/protocol/protocol.h b/wxWidgets/include/wx/protocol/protocol.h deleted file mode 100644 index 5fd35ac0ab..0000000000 --- a/wxWidgets/include/wx/protocol/protocol.h +++ /dev/null @@ -1,131 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/protocol/protocol.h -// Purpose: Protocol base class -// Author: Guilhem Lavaux -// Modified by: -// Created: 10/07/1997 -// RCS-ID: $Id: protocol.h 35650 2005-09-23 12:56:45Z MR $ -// Copyright: (c) 1997, 1998 Guilhem Lavaux -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_PROTOCOL_PROTOCOL_H -#define _WX_PROTOCOL_PROTOCOL_H - -#include "wx/defs.h" - -#if wxUSE_PROTOCOL - -#include "wx/object.h" -#include "wx/string.h" -#include "wx/stream.h" - -#if wxUSE_SOCKETS - #include "wx/socket.h" -#endif - -// ---------------------------------------------------------------------------- -// constants -// ---------------------------------------------------------------------------- - -typedef enum -{ - wxPROTO_NOERR = 0, - wxPROTO_NETERR, - wxPROTO_PROTERR, - wxPROTO_CONNERR, - wxPROTO_INVVAL, - wxPROTO_NOHNDLR, - wxPROTO_NOFILE, - wxPROTO_ABRT, - wxPROTO_RCNCT, - wxPROTO_STREAMING -} wxProtocolError; - -// ---------------------------------------------------------------------------- -// wxProtocol: abstract base class for all protocols -// ---------------------------------------------------------------------------- - -class WXDLLIMPEXP_NET wxProtocol -#if wxUSE_SOCKETS - : public wxSocketClient -#else - : public wxObject -#endif -{ -public: - wxProtocol(); - -#if wxUSE_SOCKETS - bool Reconnect(); - virtual bool Connect( const wxString& WXUNUSED(host) ) { return FALSE; } - virtual bool Connect( wxSockAddress& addr, bool WXUNUSED(wait) = TRUE) { return wxSocketClient::Connect(addr); } - - // read a '\r\n' terminated line from the given socket and put it in - // result (without the terminators) - static wxProtocolError ReadLine(wxSocketBase *socket, wxString& result); - - // read a line from this socket - this one can be overridden in the - // derived classes if different line termination convention is to be used - virtual wxProtocolError ReadLine(wxString& result); -#endif // wxUSE_SOCKETS - - virtual bool Abort() = 0; - virtual wxInputStream *GetInputStream(const wxString& path) = 0; - virtual wxProtocolError GetError() = 0; - virtual wxString GetContentType() { return wxEmptyString; } - virtual void SetUser(const wxString& WXUNUSED(user)) {} - virtual void SetPassword(const wxString& WXUNUSED(passwd) ) {} - -private: - DECLARE_DYNAMIC_CLASS_NO_COPY(wxProtocol) -}; - -#if wxUSE_SOCKETS -wxProtocolError WXDLLIMPEXP_NET GetLine(wxSocketBase *sock, wxString& result); -#endif - -// ---------------------------------------------------------------------------- -// macros for protocol classes -// ---------------------------------------------------------------------------- - -#define DECLARE_PROTOCOL(class) \ -public: \ - static wxProtoInfo g_proto_##class; - -#define IMPLEMENT_PROTOCOL(class, name, serv, host) \ -wxProtoInfo class::g_proto_##class(name, serv, host, CLASSINFO(class)); \ -bool wxProtocolUse##class = TRUE; - -#define USE_PROTOCOL(class) \ - extern bool wxProtocolUse##class ; \ - static struct wxProtocolUserFor##class \ - { \ - wxProtocolUserFor##class() { wxProtocolUse##class = TRUE; } \ - } wxProtocolDoUse##class; - -class WXDLLIMPEXP_NET wxProtoInfo : public wxObject -{ -public: - wxProtoInfo(const wxChar *name, - const wxChar *serv_name, - const bool need_host1, - wxClassInfo *info); - -protected: - wxProtoInfo *next; - wxString m_protoname; - wxString prefix; - wxString m_servname; - wxClassInfo *m_cinfo; - bool m_needhost; - - friend class wxURL; - - DECLARE_DYNAMIC_CLASS(wxProtoInfo) - DECLARE_NO_COPY_CLASS(wxProtoInfo) -}; - -#endif // wxUSE_PROTOCOL - -#endif // _WX_PROTOCOL_PROTOCOL_H diff --git a/wxWidgets/include/wx/ptr_scpd.h b/wxWidgets/include/wx/ptr_scpd.h deleted file mode 100644 index e78d53fb60..0000000000 --- a/wxWidgets/include/wx/ptr_scpd.h +++ /dev/null @@ -1,222 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/ptr_scpd.h -// Purpose: scoped smart pointer class -// Author: Jesse Lovelace <jllovela@eos.ncsu.edu> -// Modified by: -// Created: 06/01/02 -// RCS-ID: $Id: ptr_scpd.h 35688 2005-09-25 19:59:19Z VZ $ -// Copyright: (c) Jesse Lovelace and original Boost authors (see below) -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// This class closely follows the implementation of the boost -// library scoped_ptr and is an adaption for c++ macro's in -// the wxWidgets project. The original authors of the boost -// scoped_ptr are given below with their respective copyrights. - -// (C) Copyright Greg Colvin and Beman Dawes 1998, 1999. -// Copyright (c) 2001, 2002 Peter Dimov -// -// Permission to copy, use, modify, sell and distribute this software -// is granted provided this copyright notice appears in all copies. -// This software is provided "as is" without express or implied -// warranty, and with no claim as to its suitability for any purpose. -// -// See http://www.boost.org/libs/smart_ptr/scoped_ptr.htm for documentation. -// - -#ifndef __WX_SCOPED_POINTER__ -#define __WX_SCOPED_POINTER__ - -#include "wx/defs.h" - -/* - checked deleters are used to make sure that the type being deleted is really - a complete type.: otherwise sizeof() would result in a compile-time error - - do { ... } while ( 0 ) construct is used to have an anonymous scope - (otherwise we could have name clashes between different "complete"s) but - still force a semicolon after the macro -*/ - -#ifdef __WATCOMC__ - #define wxFOR_ONCE(name) for(int name=0; name<1; name++) - #define wxPRE_NO_WARNING_SCOPE(name) wxFOR_ONCE(wxMAKE_UNIQUE_NAME(name)) - #define wxPOST_NO_WARNING_SCOPE(name) -#else - #define wxPRE_NO_WARNING_SCOPE(name) do - #define wxPOST_NO_WARNING_SCOPE(name) while ( wxFalse ) -#endif - -#define wxCHECKED_DELETE(ptr) \ - wxPRE_NO_WARNING_SCOPE(scope_var1) \ - { \ - typedef char complete[sizeof(*ptr)]; \ - delete ptr; \ - } wxPOST_NO_WARNING_SCOPE(scope_var1) - -#define wxCHECKED_DELETE_ARRAY(ptr) \ - wxPRE_NO_WARNING_SCOPE(scope_var2) \ - { \ - typedef char complete[sizeof(*ptr)]; \ - delete [] ptr; \ - } wxPOST_NO_WARNING_SCOPE(scope_var2) - -/* These scoped pointers are *not* assignable and cannot be used - within a container. Look for wxDECLARE_SHARED_PTR for this - functionality. - - In addition, the type being used *must* be complete at the time - that wxDEFINE_SCOPED_* is called or a compiler error will result. - This is because the class checks for the completeness of the type - being used. -*/ - - -#define wxDECLARE_SCOPED_PTR(T, name) \ -class name \ -{ \ -private: \ - T * m_ptr; \ - \ - name(name const &); \ - name & operator=(name const &); \ - \ -public: \ - wxEXPLICIT name(T * ptr = NULL) \ - : m_ptr(ptr) { } \ - \ - ~name(); \ - \ - void reset(T * ptr = NULL) \ - { \ - if (m_ptr != ptr) \ - { \ - delete m_ptr; \ - m_ptr = ptr; \ - } \ - } \ - \ - T *release() \ - { \ - T *ptr = m_ptr; \ - m_ptr = NULL; \ - return ptr; \ - } \ - \ - T & operator*() const \ - { \ - wxASSERT(m_ptr != NULL); \ - return *m_ptr; \ - } \ - \ - T * operator->() const \ - { \ - wxASSERT(m_ptr != NULL); \ - return m_ptr; \ - } \ - \ - T * get() const \ - { \ - return m_ptr; \ - } \ - \ - void swap(name & ot) \ - { \ - T * tmp = ot.m_ptr; \ - ot.m_ptr = m_ptr; \ - m_ptr = tmp; \ - } \ -}; - -#define wxDEFINE_SCOPED_PTR(T, name)\ -name::~name() \ -{ \ - wxCHECKED_DELETE(m_ptr); \ -} - -// this macro can be used for the most common case when you want to declare and -// define the scoped pointer at the same time and want to use the standard -// naming convention: auto pointer to Foo is called FooPtr -#define wxDEFINE_SCOPED_PTR_TYPE(T) \ - wxDECLARE_SCOPED_PTR(T, T ## Ptr) \ - wxDEFINE_SCOPED_PTR(T, T ## Ptr) - -// the same but for arrays instead of simple pointers -#define wxDECLARE_SCOPED_ARRAY(T, name)\ -class name \ -{ \ -private: \ - T * m_ptr; \ - name(name const &); \ - name & operator=(name const &); \ - \ -public: \ - wxEXPLICIT name(T * p = NULL) : m_ptr(p) \ - {} \ - \ - ~name(); \ - void reset(T * p = NULL); \ - \ - T & operator[](long int i) const\ - { \ - wxASSERT(m_ptr != NULL); \ - wxASSERT(i >= 0); \ - return m_ptr[i]; \ - } \ - \ - T * get() const \ - { \ - return m_ptr; \ - } \ - \ - void swap(name & ot) \ - { \ - T * tmp = ot.m_ptr; \ - ot.m_ptr = m_ptr; \ - m_ptr = tmp; \ - } \ -}; - -#define wxDEFINE_SCOPED_ARRAY(T, name) \ -name::~name() \ -{ \ - wxCHECKED_DELETE_ARRAY(m_ptr); \ -} \ -void name::reset(T * p){ \ - if (m_ptr != p) \ - { \ - wxCHECKED_DELETE_ARRAY(m_ptr); \ - m_ptr = p; \ - } \ -} - -// ---------------------------------------------------------------------------- -// "Tied" scoped pointer: same as normal one but also sets the value of -// some other variable to the pointer value -// ---------------------------------------------------------------------------- - -#define wxDEFINE_TIED_SCOPED_PTR_TYPE(T) \ - wxDEFINE_SCOPED_PTR_TYPE(T) \ - class T ## TiedPtr : public T ## Ptr \ - { \ - public: \ - T ## TiedPtr(T **pp, T *p) \ - : T ## Ptr(p), m_pp(pp) \ - { \ - m_pOld = *pp; \ - *pp = p; \ - } \ - \ - ~ T ## TiedPtr() \ - { \ - *m_pp = m_pOld; \ - } \ - \ - private: \ - T **m_pp; \ - T *m_pOld; \ - }; - -#endif // __WX_SCOPED_POINTER__ - diff --git a/wxWidgets/include/wx/quantize.h b/wxWidgets/include/wx/quantize.h deleted file mode 100644 index 159ccaf88e..0000000000 --- a/wxWidgets/include/wx/quantize.h +++ /dev/null @@ -1,76 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/quantize.h -// Purpose: wxQuantizer class -// Author: Julian Smart -// Modified by: -// Created: 22/6/2000 -// RCS-ID: $Id: quantize.h 49804 2007-11-10 01:09:42Z VZ $ -// Copyright: (c) Julian Smart -// Licence: -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_QUANTIZE_H_ -#define _WX_QUANTIZE_H_ - -#include "wx/object.h" - -/* - * From jquant2.c - * - * Copyright (C) 1991-1996, Thomas G. Lane. - * This file is part of the Independent JPEG Group's software. - * For conditions of distribution and use, see the accompanying README file. - */ - -class WXDLLIMPEXP_FWD_CORE wxImage; -class WXDLLIMPEXP_FWD_CORE wxPalette; - -/* - * wxQuantize - * Based on the JPEG quantization code. Reduces the number of colours in a wxImage. - */ - -#define wxQUANTIZE_INCLUDE_WINDOWS_COLOURS 0x01 -#define wxQUANTIZE_RETURN_8BIT_DATA 0x02 -#define wxQUANTIZE_FILL_DESTINATION_IMAGE 0x04 - -class WXDLLEXPORT wxQuantize: public wxObject -{ -public: -DECLARE_DYNAMIC_CLASS(wxQuantize) - -//// Constructor - - wxQuantize() {} - virtual ~wxQuantize() {} - -//// Operations - - // Reduce the colours in the source image and put the result into the - // destination image. Both images may be the same, to overwrite the source image. - // Specify an optional palette pointer to receive the resulting palette. - // This palette may be passed to ConvertImageToBitmap, for example. - // If you pass a palette pointer, you must free the palette yourself. - - static bool Quantize(const wxImage& src, wxImage& dest, wxPalette** pPalette, int desiredNoColours = 236, - unsigned char** eightBitData = 0, int flags = wxQUANTIZE_INCLUDE_WINDOWS_COLOURS|wxQUANTIZE_FILL_DESTINATION_IMAGE|wxQUANTIZE_RETURN_8BIT_DATA); - - // This version sets a palette in the destination image so you don't - // have to manage it yourself. - - static bool Quantize(const wxImage& src, wxImage& dest, int desiredNoColours = 236, - unsigned char** eightBitData = 0, int flags = wxQUANTIZE_INCLUDE_WINDOWS_COLOURS|wxQUANTIZE_FILL_DESTINATION_IMAGE|wxQUANTIZE_RETURN_8BIT_DATA); - -//// Helpers - - // Converts input bitmap(s) into 8bit representation with custom palette - - // in_rows and out_rows are arrays [0..h-1] of pointer to rows - // (in_rows contains w * 3 bytes per row, out_rows w bytes per row) - // fills out_rows with indexes into palette (which is also stored into palette variable) - static void DoQuantize(unsigned w, unsigned h, unsigned char **in_rows, unsigned char **out_rows, unsigned char *palette, int desiredNoColours); - -}; - -#endif - // _WX_QUANTIZE_H_ diff --git a/wxWidgets/include/wx/radiobox.h b/wxWidgets/include/wx/radiobox.h deleted file mode 100644 index 69a09c43ba..0000000000 --- a/wxWidgets/include/wx/radiobox.h +++ /dev/null @@ -1,181 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: wx/radiobox.h -// Purpose: wxRadioBox declaration -// Author: Vadim Zeitlin -// Modified by: -// Created: 10.09.00 -// RCS-ID: $Id: radiobox.h 54930 2008-08-02 19:45:23Z VZ $ -// Copyright: (c) Vadim Zeitlin -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_RADIOBOX_H_BASE_ -#define _WX_RADIOBOX_H_BASE_ - -#if wxUSE_RADIOBOX - -#include "wx/ctrlsub.h" - -#if wxUSE_TOOLTIPS - -#include "wx/dynarray.h" - -class WXDLLIMPEXP_FWD_CORE wxToolTip; - -WX_DEFINE_EXPORTED_ARRAY_PTR(wxToolTip *, wxToolTipArray); - -#endif // wxUSE_TOOLTIPS - -extern WXDLLEXPORT_DATA(const wxChar) wxRadioBoxNameStr[]; - -// ---------------------------------------------------------------------------- -// wxRadioBoxBase is not a normal base class, but rather a mix-in because the -// real wxRadioBox derives from different classes on different platforms: for -// example, it is a wxStaticBox in wxUniv and wxMSW but not in other ports -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxRadioBoxBase : public wxItemContainerImmutable -{ -public: - virtual ~wxRadioBoxBase(); - - // change/query the individual radio button state - virtual bool Enable(unsigned int n, bool enable = true) = 0; - virtual bool Show(unsigned int n, bool show = true) = 0; - virtual bool IsItemEnabled(unsigned int n) const = 0; - virtual bool IsItemShown(unsigned int n) const = 0; - - // return number of columns/rows in this radiobox - unsigned int GetColumnCount() const { return m_numCols; } - unsigned int GetRowCount() const { return m_numRows; } - - // return the next active (i.e. shown and not disabled) item above/below/to - // the left/right of the given one - int GetNextItem(int item, wxDirection dir, long style) const; - -#if wxUSE_TOOLTIPS - // set the tooltip text for a radio item, empty string unsets any tooltip - void SetItemToolTip(unsigned int item, const wxString& text); - - // get the individual items tooltip; returns NULL if none - wxToolTip *GetItemToolTip(unsigned int item) const - { return m_itemsTooltips ? (*m_itemsTooltips)[item] : NULL; } -#endif // wxUSE_TOOLTIPS - -#if wxUSE_HELP - // set helptext for a particular item, pass an empty string to erase it - void SetItemHelpText(unsigned int n, const wxString& helpText); - - // retrieve helptext for a particular item, empty string means no help text - wxString GetItemHelpText(unsigned int n) const; -#else // wxUSE_HELP - // just silently ignore the help text, it's better than requiring using - // conditional compilation in all code using this function - void SetItemHelpText(unsigned int WXUNUSED(n), - const wxString& WXUNUSED(helpText)) - { - } -#endif // wxUSE_HELP - - // returns the radio item at the given position or wxNOT_FOUND if none - // (currently implemented only under MSW and GTK) - virtual int GetItemFromPoint(const wxPoint& WXUNUSED(pt)) const - { - return wxNOT_FOUND; - } - - - // deprecated functions - // -------------------- - -#if WXWIN_COMPATIBILITY_2_4 - wxDEPRECATED( int GetNumberOfRowsOrCols() const ); - wxDEPRECATED( void SetNumberOfRowsOrCols(int n) ); -#endif // WXWIN_COMPATIBILITY_2_4 - -protected: - wxRadioBoxBase() - { - m_numCols = - m_numRows = - m_majorDim = 0; - -#if wxUSE_TOOLTIPS - m_itemsTooltips = NULL; -#endif // wxUSE_TOOLTIPS - } - - // return the number of items in major direction (which depends on whether - // we have wxRA_SPECIFY_COLS or wxRA_SPECIFY_ROWS style) - unsigned int GetMajorDim() const { return m_majorDim; } - - // sets m_majorDim and also updates m_numCols/Rows - // - // the style parameter should be the style of the radiobox itself - void SetMajorDim(unsigned int majorDim, long style); - -#if wxUSE_TOOLTIPS - // called from SetItemToolTip() to really set the tooltip for the specified - // item in the box (or, if tooltip is NULL, to remove any existing one). - // - // NB: this function should really be pure virtual but to avoid breaking - // the build of the ports for which it's not implemented yet we provide - // an empty stub in the base class for now - virtual void DoSetItemToolTip(unsigned int item, wxToolTip *tooltip); - - // returns true if we have any item tooltips - bool HasItemToolTips() const { return m_itemsTooltips != NULL; } -#endif // wxUSE_TOOLTIPS - -#if wxUSE_HELP - // Retrieve help text for an item: this is a helper for the implementation - // of wxWindow::GetHelpTextAtPoint() in the real radiobox class - wxString DoGetHelpTextAtPoint(const wxWindow *derived, - const wxPoint& pt, - wxHelpEvent::Origin origin) const; -#endif // wxUSE_HELP - -private: - // the number of elements in major dimension (i.e. number of columns if - // wxRA_SPECIFY_COLS or the number of rows if wxRA_SPECIFY_ROWS) and also - // the number of rows/columns calculated from it - unsigned int m_majorDim, - m_numCols, - m_numRows; - -#if wxUSE_TOOLTIPS - // array of tooltips for the individual items - // - // this array is initially NULL and initialized on first use - wxToolTipArray *m_itemsTooltips; -#endif - -#if wxUSE_HELP - // help text associated with a particular item or empty string if none - wxArrayString m_itemsHelpTexts; -#endif // wxUSE_HELP -}; - -#if defined(__WXUNIVERSAL__) - #include "wx/univ/radiobox.h" -#elif defined(__WXMSW__) - #include "wx/msw/radiobox.h" -#elif defined(__WXMOTIF__) - #include "wx/motif/radiobox.h" -#elif defined(__WXGTK20__) - #include "wx/gtk/radiobox.h" -#elif defined(__WXGTK__) - #include "wx/gtk1/radiobox.h" -#elif defined(__WXMAC__) - #include "wx/mac/radiobox.h" -#elif defined(__WXCOCOA__) - #include "wx/cocoa/radiobox.h" -#elif defined(__WXPM__) - #include "wx/os2/radiobox.h" -#elif defined(__WXPALMOS__) - #include "wx/palmos/radiobox.h" -#endif - -#endif // wxUSE_RADIOBOX - -#endif // _WX_RADIOBOX_H_BASE_ diff --git a/wxWidgets/include/wx/radiobut.h b/wxWidgets/include/wx/radiobut.h deleted file mode 100644 index 598c44c309..0000000000 --- a/wxWidgets/include/wx/radiobut.h +++ /dev/null @@ -1,61 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: wx/radiobut.h -// Purpose: wxRadioButton declaration -// Author: Vadim Zeitlin -// Modified by: -// Created: 07.09.00 -// RCS-ID: $Id: radiobut.h 37066 2006-01-23 03:27:34Z MR $ -// Copyright: (c) Vadim Zeitlin -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_RADIOBUT_H_BASE_ -#define _WX_RADIOBUT_H_BASE_ - -#include "wx/defs.h" - -#if wxUSE_RADIOBTN - -/* - There is no wxRadioButtonBase class as wxRadioButton interface is the same - as wxCheckBox(Base), but under some platforms wxRadioButton really - derives from wxCheckBox and on the others it doesn't. - - The pseudo-declaration of wxRadioButtonBase would look like this: - - class wxRadioButtonBase : public ... - { - public: - virtual void SetValue(bool value); - virtual bool GetValue() const; - }; - */ - -#include "wx/control.h" - -extern WXDLLEXPORT_DATA(const wxChar) wxRadioButtonNameStr[]; - -#if defined(__WXUNIVERSAL__) - #include "wx/univ/radiobut.h" -#elif defined(__WXMSW__) - #include "wx/msw/radiobut.h" -#elif defined(__WXMOTIF__) - #include "wx/motif/radiobut.h" -#elif defined(__WXGTK20__) - #include "wx/gtk/radiobut.h" -#elif defined(__WXGTK__) - #include "wx/gtk1/radiobut.h" -#elif defined(__WXMAC__) - #include "wx/mac/radiobut.h" -#elif defined(__WXCOCOA__) - #include "wx/cocoa/radiobut.h" -#elif defined(__WXPM__) - #include "wx/os2/radiobut.h" -#elif defined(__WXPALMOS__) - #include "wx/palmos/radiobut.h" -#endif - -#endif // wxUSE_RADIOBTN - -#endif - // _WX_RADIOBUT_H_BASE_ diff --git a/wxWidgets/include/wx/rawbmp.h b/wxWidgets/include/wx/rawbmp.h deleted file mode 100644 index 6360a6de5a..0000000000 --- a/wxWidgets/include/wx/rawbmp.h +++ /dev/null @@ -1,713 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: wx/rawbmp.h -// Purpose: macros for fast, raw bitmap data access -// Author: Eric Kidd, Vadim Zeitlin -// Modified by: -// Created: 10.03.03 -// RCS-ID: $Id: rawbmp.h 41661 2006-10-06 16:34:45Z PC $ -// Copyright: (c) 2002 Vadim Zeitlin <vadim@wxwidgets.org> -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_RAWBMP_H_BASE_ -#define _WX_RAWBMP_H_BASE_ - -#include "wx/image.h" - -// ---------------------------------------------------------------------------- -// Abstract Pixel API -// -// We need to access our raw bitmap data (1) portably and (2) efficiently. -// We do this using a two-dimensional "iteration" interface. Performance -// is extremely important here: these functions will be called hundreds -// of thousands of times in a row, and even small inefficiencies will -// make applications seem slow. -// -// We can't always rely on inline functions, because not all compilers actually -// bother to inline them unless we crank the optimization levels way up. -// Therefore, we also provide macros to wring maximum speed out of compiler -// unconditionally (e.g. even in debug builds). Of course, if the performance -// isn't absolutely crucial for you you shouldn't be using them but the inline -// functions instead. -// ---------------------------------------------------------------------------- - -/* - Usage example: - - typedef wxPixelData<wxBitmap, wxNativePixelFormat> PixelData; - - wxBitmap bmp; - PixelData data(bmp); - if ( !data ) - { - ... raw access to bitmap data unavailable, do something else ... - return; - } - - if ( data.GetWidth() < 20 || data.GetHeight() < 20 ) - { - ... complain: the bitmap it too small ... - return; - } - - PixelData::Iterator p(data); - - // we draw a (10, 10)-(20, 20) rect manually using the given r, g, b - p.Offset(data, 10, 10); - - for ( int y = 0; y < 10; ++y ) - { - PixelData::Iterator rowStart = p; - - for ( int x = 0; x < 10; ++x, ++p ) - { - p.Red() = r; - p.Green() = g; - p.Blue() = b; - } - - p = rowStart; - p.OffsetY(data, 1); - } - */ - -/* - Note: we do not use WXDLLEXPORT with classes in this file because VC++ has - problems with exporting inner class defined inside a specialization of a - template class from a DLL. Besides, as all the methods are inline it's not - really necessary to put them in DLL at all. - */ - -// ---------------------------------------------------------------------------- -// wxPixelFormat -// ---------------------------------------------------------------------------- - -/* - wxPixelFormat is a template class describing the bitmap data format. It - contains the constants describing the format of pixel data, but does not - describe how the entire bitmap is stored (i.e. top-to-bottom, - bottom-to-top, ...). It is also a "traits"-like class, i.e. it only - contains some constants and maybe static methods but nothing more, so it - can be safely used without incurring any overhead as all accesses to it are - done at compile-time. - - Current limitations: we don't support RAGABA and ARAGAB formats supported - by Mac OS X. If there is sufficient interest, these classes could be - extended to deal with them. Neither do we support alpha channel having - different representation from the RGB ones (happens under QNX/Photon I - think), but again this could be achieved with some small extra effort. - - Template parameters are: - - type of a single pixel component - - size of the single pixel in bits - - indices of red, green and blue pixel components inside the pixel - - index of the alpha component or -1 if none - - type which can contain the full pixel value (all channels) - */ - -template <class Channel, - size_t Bpp, int R, int G, int B, int A = -1, - class Pixel = wxUint32> - -struct wxPixelFormat -{ - // iterator over pixels is usually of type "ChannelType *" - typedef Channel ChannelType; - - // the type which may hold the entire pixel value - typedef Pixel PixelType; - - // NB: using static ints initialized inside the class declaration is not - // portable as it doesn't work with VC++ 6, so we must use enums - - // size of one pixel in bits - enum { BitsPerPixel = Bpp }; - - // size of one pixel in ChannelType units (usually bytes) - enum { SizePixel = Bpp / (8 * sizeof(Channel)) }; - - // the channels indices inside the pixel - enum - { - RED = R, - GREEN = G, - BLUE = B, - ALPHA = A - }; - - // true if we have an alpha channel (together with the other channels, this - // doesn't cover the case of wxImage which stores alpha separately) - enum { HasAlpha = A != -1 }; -}; - -// some "predefined" pixel formats -// ------------------------------- - -// wxImage format is common to all platforms -typedef wxPixelFormat<unsigned char, 24, 0, 1, 2> wxImagePixelFormat; - -// the (most common) native bitmap format without alpha support -#if defined(__WXMSW__) - // under MSW the RGB components are reversed, they're in BGR order - typedef wxPixelFormat<unsigned char, 24, 2, 1, 0> wxNativePixelFormat; - - #define wxPIXEL_FORMAT_ALPHA 3 -#elif defined(__WXMAC__) - // under Mac, first component is unused but still present, hence we use - // 32bpp, not 24 - typedef wxPixelFormat<unsigned char, 32, 1, 2, 3> wxNativePixelFormat; - - #define wxPIXEL_FORMAT_ALPHA 0 -#elif defined(__WXCOCOA__) - // Cocoa is standard RGB or RGBA (normally it is RGBA) - typedef wxPixelFormat<unsigned char, 24, 0, 1, 2> wxNativePixelFormat; - - #define wxPIXEL_FORMAT_ALPHA 3 -#elif defined(__WXGTK__) - // Under GTK+ 2.X we use GdkPixbuf, which is standard RGB or RGBA - typedef wxPixelFormat<unsigned char, 24, 0, 1, 2> wxNativePixelFormat; - - #define wxPIXEL_FORMAT_ALPHA 3 -#endif - -// the (most common) native format for bitmaps with alpha channel -#ifdef wxPIXEL_FORMAT_ALPHA - typedef wxPixelFormat<unsigned char, 32, - wxNativePixelFormat::RED, - wxNativePixelFormat::GREEN, - wxNativePixelFormat::BLUE, - wxPIXEL_FORMAT_ALPHA> wxAlphaPixelFormat; -#endif // wxPIXEL_FORMAT_ALPHA - -// we also define the (default/best) pixel format for the given class: this is -// used as default value for the pixel format in wxPixelIterator template -template <class T> struct wxPixelFormatFor; - -#if wxUSE_IMAGE -// wxPixelFormatFor is only defined for wxImage, attempt to use it with other -// classes (wxBitmap...) will result in compile errors which is exactly what we -// want -template <> -struct wxPixelFormatFor<wxImage> -{ - typedef wxImagePixelFormat Format; -}; -#endif //wxUSE_IMAGE - -// ---------------------------------------------------------------------------- -// wxPixelData -// ---------------------------------------------------------------------------- - -/* - wxPixelDataBase is just a helper for wxPixelData: it contains things common - to both wxImage and wxBitmap specializations. - */ -class wxPixelDataBase -{ -public: - // origin of the rectangular region we represent - wxPoint GetOrigin() const { return m_ptOrigin; } - - // width and height of the region we represent - int GetWidth() const { return m_width; } - int GetHeight() const { return m_height; } - - wxSize GetSize() const { return wxSize(m_width, m_height); } - - // the distance between two rows - int GetRowStride() const { return m_stride; } - -// private: -- see comment in the beginning of the file - - // the origin of this image inside the bigger bitmap (usually (0, 0)) - wxPoint m_ptOrigin; - - // the size of the image we address, in pixels - int m_width, - m_height; - - // this parameter is the offset of the start of the (N+1)st row from the - // Nth one and can be different from m_bypp*width in some cases: - // a) the most usual one is to force 32/64 bit alignment of rows - // b) another one is for bottom-to-top images where it's negative - // c) finally, it could conceivably be 0 for the images with all - // lines being identical - int m_stride; - -protected: - // ctor is protected because this class is only meant to be used as the - // base class by wxPixelData - wxPixelDataBase() - { - m_width = - m_height = - m_stride = 0; - } -}; - -/* - wxPixelData represents the entire bitmap data, i.e. unlike - wxPixelFormat (which it uses) it also stores the global bitmap - characteristics such as its size, inter-row separation and so on. - - Because of this it can be used to move the pixel iterators (which don't - have enough information about the bitmap themselves). This may seem a bit - unnatural but must be done in this way to keep the iterator objects as - small as possible for maximum efficiency as otherwise they wouldn't be put - into the CPU registers by the compiler any more. - - Implementation note: we use the standard workaround for lack of partial - template specialization support in VC (both 6 and 7): instead of partly - specializing the class Foo<T, U> for some T we introduce FooOut<T> and - FooIn<U> nested in it, make Foo<T, U> equivalent to FooOut<T>::FooIn<U> and - fully specialize FooOut. - - Also note that this class doesn't have any default definition because we - can't really do anything without knowing the exact image class. We do - provide wxPixelDataBase to make it simpler to write new wxPixelData - specializations. - */ - -// we need to define this skeleton template to mollify VC++ -template <class Image> -struct wxPixelDataOut -{ - template <class PixelFormat> - class wxPixelDataIn - { - public: - class Iterator { }; - }; -}; - -#if wxUSE_IMAGE -// wxPixelData specialization for wxImage: this is the simplest case as we -// don't have to care about different pixel formats here -template <> -struct wxPixelDataOut<wxImage> -{ - // NB: this is a template class even though it doesn't use its template - // parameter because otherwise wxPixelData couldn't compile - template <class dummyPixelFormat> - class wxPixelDataIn : public wxPixelDataBase - { - public: - // the type of the class we're working with - typedef wxImage ImageType; - - // the iterator which should be used for working with data in this - // format - class Iterator - { - public: - // the pixel format we use - typedef wxImagePixelFormat PixelFormat; - - // the type of the pixel components - typedef typename dummyPixelFormat::ChannelType ChannelType; - - // the pixel data we're working with - typedef - wxPixelDataOut<wxImage>::wxPixelDataIn<PixelFormat> PixelData; - - // go back to (0, 0) - void Reset(const PixelData& data) - { - *this = data.GetPixels(); - } - - // creates the iterator pointing to the beginning of data - Iterator(PixelData& data) - { - Reset(data); - } - - // creates the iterator initially pointing to the image origin - Iterator(const wxImage& image) - { - m_pRGB = image.GetData(); - - if ( image.HasAlpha() ) - { - m_pAlpha = image.GetAlpha(); - } - else // alpha is not used at all - { - m_pAlpha = NULL; - } - } - - // true if the iterator is valid - bool IsOk() const { return m_pRGB != NULL; } - - - // navigation - // ---------- - - // advance the iterator to the next pixel, prefix version - Iterator& operator++() - { - m_pRGB += PixelFormat::SizePixel; - if ( m_pAlpha ) - ++m_pAlpha; - - return *this; - } - - // postfix (hence less efficient -- don't use it unless you - // absolutely must) version - Iterator operator++(int) - { - Iterator p(*this); - ++*this; - return p; - } - - // move x pixels to the right and y down - // - // note that the rows don't wrap! - void Offset(const PixelData& data, int x, int y) - { - m_pRGB += data.GetRowStride()*y + PixelFormat::SizePixel*x; - if ( m_pAlpha ) - m_pAlpha += data.GetWidth() + x; - } - - // move x pixels to the right (again, no row wrapping) - void OffsetX(const PixelData& WXUNUSED(data), int x) - { - m_pRGB += PixelFormat::SizePixel*x; - if ( m_pAlpha ) - m_pAlpha += x; - } - - // move y rows to the bottom - void OffsetY(const PixelData& data, int y) - { - m_pRGB += data.GetRowStride()*y; - if ( m_pAlpha ) - m_pAlpha += data.GetWidth(); - } - - // go to the given position - void MoveTo(const PixelData& data, int x, int y) - { - Reset(data); - Offset(data, x, y); - } - - - // data access - // ----------- - - // access to invidividual colour components - ChannelType& Red() { return m_pRGB[PixelFormat::RED]; } - ChannelType& Green() { return m_pRGB[PixelFormat::GREEN]; } - ChannelType& Blue() { return m_pRGB[PixelFormat::BLUE]; } - ChannelType& Alpha() { return *m_pAlpha; } - - // private: -- see comment in the beginning of the file - - // pointer into RGB buffer - unsigned char *m_pRGB; - - // pointer into alpha buffer or NULL if alpha isn't used - unsigned char *m_pAlpha; - }; - - // initializes us with the data of the given image - wxPixelDataIn(ImageType& image) : m_image(image), m_pixels(image) - { - m_width = image.GetWidth(); - m_height = image.GetHeight(); - m_stride = Iterator::SizePixel * m_width; - } - - // initializes us with the given region of the specified image - wxPixelDataIn(ImageType& image, - const wxPoint& pt, - const wxSize& sz) : m_image(image), m_pixels(image) - { - m_stride = Iterator::SizePixel * m_width; - - InitRect(pt, sz); - } - - // initializes us with the given region of the specified image - wxPixelDataIn(ImageType& image, - const wxRect& rect) : m_image(image), m_pixels(image) - { - m_stride = Iterator::SizePixel * m_width; - - InitRect(rect.GetPosition(), rect.GetSize()); - } - - // we evaluate to true only if we could get access to bitmap data - // successfully - operator bool() const { return m_pixels.IsOk(); } - - // get the iterator pointing to the origin - Iterator GetPixels() const { return m_pixels; } - - private: - void InitRect(const wxPoint& pt, const wxSize& sz) - { - m_width = sz.x; - m_height = sz.y; - - m_ptOrigin = pt; - m_pixels.Offset(*this, pt.x, pt.y); - } - - // the image we're working with - ImageType& m_image; - - // the iterator pointing to the image origin - Iterator m_pixels; - }; -}; -#endif //wxUSE_IMAGE - -#if wxUSE_GUI -// wxPixelData specialization for wxBitmap: here things are more interesting as -// we also have to support different pixel formats -template <> -struct wxPixelDataOut<wxBitmap> -{ - template <class Format> - class wxPixelDataIn : public wxPixelDataBase - { - public: - // the type of the class we're working with - typedef wxBitmap ImageType; - - class Iterator - { - public: - // the pixel format we use - typedef Format PixelFormat; - - // the type of the pixel components - typedef typename PixelFormat::ChannelType ChannelType; - - // the pixel data we're working with - typedef wxPixelDataOut<wxBitmap>::wxPixelDataIn<Format> PixelData; - - - // go back to (0, 0) - void Reset(const PixelData& data) - { - *this = data.GetPixels(); - } - - // initializes the iterator to point to the origin of the given - // pixel data - Iterator(PixelData& data) - { - Reset(data); - } - - // initializes the iterator to point to the origin of the given - // bitmap - Iterator(wxBitmap& bmp, PixelData& data) - { - // using cast here is ugly but it should be safe as - // GetRawData() real return type should be consistent with - // BitsPerPixel (which is in turn defined by ChannelType) and - // this is the only thing we can do without making GetRawData() - // a template function which is undesirable - m_ptr = (ChannelType *) - bmp.GetRawData(data, PixelFormat::BitsPerPixel); - } - - // default constructor - Iterator() - { - m_ptr = NULL; - } - - // return true if this iterator is valid - bool IsOk() const { return m_ptr != NULL; } - - - // navigation - // ---------- - - // advance the iterator to the next pixel, prefix version - Iterator& operator++() - { - m_ptr += PixelFormat::SizePixel; - - return *this; - } - - // postfix (hence less efficient -- don't use it unless you - // absolutely must) version - Iterator operator++(int) - { - Iterator p(*this); - ++*this; - return p; - } - - // move x pixels to the right and y down - // - // note that the rows don't wrap! - void Offset(const PixelData& data, int x, int y) - { - m_ptr += data.GetRowStride()*y + PixelFormat::SizePixel*x; - } - - // move x pixels to the right (again, no row wrapping) - void OffsetX(const PixelData& WXUNUSED(data), int x) - { - m_ptr += PixelFormat::SizePixel*x; - } - - // move y rows to the bottom - void OffsetY(const PixelData& data, int y) - { - m_ptr += data.GetRowStride()*y; - } - - // go to the given position - void MoveTo(const PixelData& data, int x, int y) - { - Reset(data); - Offset(data, x, y); - } - - - // data access - // ----------- - - // access to invidividual colour components - ChannelType& Red() { return m_ptr[PixelFormat::RED]; } - ChannelType& Green() { return m_ptr[PixelFormat::GREEN]; } - ChannelType& Blue() { return m_ptr[PixelFormat::BLUE]; } - ChannelType& Alpha() { return m_ptr[PixelFormat::ALPHA]; } - - // address the pixel contents directly - // - // warning: the format is platform dependent - typename PixelFormat::PixelType& Data() - { return *(typename PixelFormat::PixelType *)m_ptr; } - - // private: -- see comment in the beginning of the file - - // for efficiency reasons this class should not have any other - // fields, otherwise it won't be put into a CPU register (as it - // should inside the inner loops) by some compilers, notably gcc - ChannelType *m_ptr; - }; - - // ctor associates this pointer with a bitmap and locks the bitmap for - // raw access, it will be unlocked only by our dtor and so these - // objects should normally be only created on the stack, i.e. have - // limited life-time - wxPixelDataIn(wxBitmap& bmp) : m_bmp(bmp), m_pixels(bmp, *this) - { - } - - wxPixelDataIn(wxBitmap& bmp, const wxRect& rect) - : m_bmp(bmp), m_pixels(bmp, *this) - { - InitRect(rect.GetPosition(), rect.GetSize()); - } - - wxPixelDataIn(wxBitmap& bmp, const wxPoint& pt, const wxSize& sz) - : m_bmp(bmp), m_pixels(bmp, *this) - { - InitRect(pt, sz); - } - - // we evaluate to true only if we could get access to bitmap data - // successfully - operator bool() const { return m_pixels.IsOk(); } - - // get the iterator pointing to the origin - Iterator GetPixels() const { return m_pixels; } - - // dtor unlocks the bitmap - ~wxPixelDataIn() - { - m_bmp.UngetRawData(*this); - } - - // call this to indicate that we should use the alpha channel - void UseAlpha() { m_bmp.UseAlpha(); } - - // private: -- see comment in the beginning of the file - - // the bitmap we're associated with - wxBitmap m_bmp; - - // the iterator pointing to the image origin - Iterator m_pixels; - - private: - void InitRect(const wxPoint& pt, const wxSize& sz) - { - m_pixels.Offset(*this, pt.x, pt.y); - - m_ptOrigin = pt; - m_width = sz.x; - m_height = sz.y; - } - }; -}; -#endif //wxUSE_GUI - -template <class Image, class PixelFormat = wxPixelFormatFor<Image> > -class wxPixelData : - public wxPixelDataOut<Image>::template wxPixelDataIn<PixelFormat> -{ -public: - typedef - typename wxPixelDataOut<Image>::template wxPixelDataIn<PixelFormat> - Base; - - wxPixelData(Image& image) : Base(image) { } - - wxPixelData(Image& i, const wxRect& rect) : Base(i, rect) { } - - wxPixelData(Image& i, const wxPoint& pt, const wxSize& sz) - : Base(i, pt, sz) - { - } -}; - - -// some "predefined" pixel data classes -#if wxUSE_IMAGE -typedef wxPixelData<wxImage> wxImagePixelData; -#endif //wxUSE_IMAGE -#if wxUSE_GUI -typedef wxPixelData<wxBitmap, wxNativePixelFormat> wxNativePixelData; -typedef wxPixelData<wxBitmap, wxAlphaPixelFormat> wxAlphaPixelData; - -#endif //wxUSE_GUI - -// ---------------------------------------------------------------------------- -// wxPixelIterator -// ---------------------------------------------------------------------------- - -/* - wxPixel::Iterator represents something which points to the pixel data and - allows us to iterate over it. In the simplest case of wxBitmap it is, - indeed, just a pointer, but it can be something more complicated and, - moreover, you are free to specialize it for other image classes and bitmap - formats. - - Note that although it would have been much more intuitive to have a real - class here instead of what we have now, this class would need two template - parameters, and this can't be done because we'd need compiler support for - partial template specialization then and neither VC6 nor VC7 provide it. - */ -template < class Image, class PixelFormat = wxPixelFormatFor<Image> > -struct wxPixelIterator : public wxPixelData<Image, PixelFormat>::Iterator -{ -}; - -#endif // _WX_RAWBMP_H_BASE_ - diff --git a/wxWidgets/include/wx/recguard.h b/wxWidgets/include/wx/recguard.h deleted file mode 100644 index 1a54d9191f..0000000000 --- a/wxWidgets/include/wx/recguard.h +++ /dev/null @@ -1,53 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: wx/recguard.h -// Purpose: declaration and implementation of wxRecursionGuard class -// Author: Vadim Zeitlin -// Modified by: -// Created: 14.08.2003 -// RCS-ID: $Id: recguard.h 61872 2009-09-09 22:37:05Z VZ $ -// Copyright: (c) 2003 Vadim Zeitlin <vadim@wxwidgets.org> -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_RECGUARD_H_ -#define _WX_RECGUARD_H_ - -#include "wx/defs.h" - -// ---------------------------------------------------------------------------- -// wxRecursionGuardFlag is used with wxRecursionGuard -// ---------------------------------------------------------------------------- - -typedef int wxRecursionGuardFlag; - -// ---------------------------------------------------------------------------- -// wxRecursionGuard is the simplest way to protect a function from reentrancy -// ---------------------------------------------------------------------------- - -class WXDLLIMPEXP_BASE wxRecursionGuard -{ -public: - wxRecursionGuard(wxRecursionGuardFlag& flag) - : m_flag(flag) - { - m_isInside = flag++ != 0; - } - - ~wxRecursionGuard() - { - wxASSERT_MSG( m_flag > 0, wxT("unbalanced wxRecursionGuards!?") ); - - m_flag--; - } - - bool IsInside() const { return m_isInside; } - -private: - wxRecursionGuardFlag& m_flag; - - // true if the flag had been already set when we were created - bool m_isInside; -}; - -#endif // _WX_RECGUARD_H_ - diff --git a/wxWidgets/include/wx/regex.h b/wxWidgets/include/wx/regex.h deleted file mode 100644 index 0e69b83590..0000000000 --- a/wxWidgets/include/wx/regex.h +++ /dev/null @@ -1,166 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: wx/regex.h -// Purpose: regular expression matching -// Author: Karsten Ballueder -// Modified by: VZ at 13.07.01 (integrated to wxWin) -// Created: 05.02.2000 -// RCS-ID: $Id: regex.h 57779 2009-01-02 17:35:16Z PC $ -// Copyright: (c) 2000 Karsten Ballueder <ballueder@gmx.net> -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_REGEX_H_ -#define _WX_REGEX_H_ - -#include "wx/defs.h" - -#if wxUSE_REGEX - -#include "wx/string.h" - -// ---------------------------------------------------------------------------- -// constants -// ---------------------------------------------------------------------------- - -// flags for regex compilation: these can be used with Compile() -enum -{ - // use extended regex syntax - wxRE_EXTENDED = 0, - - // use advanced RE syntax (built-in regex only) -#ifdef wxHAS_REGEX_ADVANCED - wxRE_ADVANCED = 1, -#endif - - // use basic RE syntax - wxRE_BASIC = 2, - - // ignore case in match - wxRE_ICASE = 4, - - // only check match, don't set back references - wxRE_NOSUB = 8, - - // if not set, treat '\n' as an ordinary character, otherwise it is - // special: it is not matched by '.' and '^' and '$' always match - // after/before it regardless of the setting of wxRE_NOT[BE]OL - wxRE_NEWLINE = 16, - - // default flags - wxRE_DEFAULT = wxRE_EXTENDED -}; - -// flags for regex matching: these can be used with Matches() -// -// these flags are mainly useful when doing several matches in a long string, -// they can be used to prevent erroneous matches for '^' and '$' -enum -{ - // '^' doesn't match at the start of line - wxRE_NOTBOL = 32, - - // '$' doesn't match at the end of line - wxRE_NOTEOL = 64 -}; - -// ---------------------------------------------------------------------------- -// wxRegEx: a regular expression -// ---------------------------------------------------------------------------- - -class WXDLLIMPEXP_FWD_BASE wxRegExImpl; - -class WXDLLIMPEXP_BASE wxRegEx -{ -public: - // default ctor: use Compile() later - wxRegEx() { Init(); } - - // create and compile - wxRegEx(const wxString& expr, int flags = wxRE_DEFAULT) - { - Init(); - (void)Compile(expr, flags); - } - - // return true if this is a valid compiled regular expression - bool IsValid() const { return m_impl != NULL; } - - // compile the string into regular expression, return true if ok or false - // if string has a syntax error - bool Compile(const wxString& pattern, int flags = wxRE_DEFAULT); - - // matches the precompiled regular expression against a string, return - // true if matches and false otherwise - // - // flags may be combination of wxRE_NOTBOL and wxRE_NOTEOL - // len may be the length of text (ignored by most system regex libs) - // - // may only be called after successful call to Compile() - bool Matches(const wxChar *text, int flags = 0) const; - bool Matches(const wxChar *text, int flags, size_t len) const; - bool Matches(const wxString& text, int flags = 0) const - { return Matches(text.c_str(), flags, text.length()); } - - // get the start index and the length of the match of the expression - // (index 0) or a bracketed subexpression (index != 0) - // - // may only be called after successful call to Matches() - // - // return false if no match or on error - bool GetMatch(size_t *start, size_t *len, size_t index = 0) const; - - // return the part of string corresponding to the match, empty string is - // returned if match failed - // - // may only be called after successful call to Matches() - wxString GetMatch(const wxString& text, size_t index = 0) const; - - // return the size of the array of matches, i.e. the number of bracketed - // subexpressions plus one for the expression itself, or 0 on error. - // - // may only be called after successful call to Compile() - size_t GetMatchCount() const; - - // replaces the current regular expression in the string pointed to by - // pattern, with the text in replacement and return number of matches - // replaced (maybe 0 if none found) or -1 on error - // - // the replacement text may contain backreferences (\number) which will be - // replaced with the value of the corresponding subexpression in the - // pattern match - // - // maxMatches may be used to limit the number of replacements made, setting - // it to 1, for example, will only replace first occurence (if any) of the - // pattern in the text while default value of 0 means replace all - int Replace(wxString *text, const wxString& replacement, - size_t maxMatches = 0) const; - - // replace the first occurence - int ReplaceFirst(wxString *text, const wxString& replacement) const - { return Replace(text, replacement, 1); } - - // replace all occurences: this is actually a synonym for Replace() - int ReplaceAll(wxString *text, const wxString& replacement) const - { return Replace(text, replacement, 0); } - - // dtor not virtual, don't derive from this class - ~wxRegEx(); - -private: - // common part of all ctors - void Init(); - - // the real guts of this class - wxRegExImpl *m_impl; - - // as long as the class wxRegExImpl is not ref-counted, - // instances of the handle wxRegEx must not be copied. - wxRegEx(const wxRegEx&); - wxRegEx &operator=(const wxRegEx&); -}; - -#endif // wxUSE_REGEX - -#endif // _WX_REGEX_H_ - diff --git a/wxWidgets/include/wx/region.h b/wxWidgets/include/wx/region.h deleted file mode 100644 index 32c27cce06..0000000000 --- a/wxWidgets/include/wx/region.h +++ /dev/null @@ -1,300 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/region.h -// Purpose: Base header for wxRegion -// Author: Julian Smart -// Modified by: -// Created: -// RCS-ID: $Id: region.h 49563 2007-10-31 20:46:21Z VZ $ -// Copyright: (c) Julian Smart -// Licence: wxWindows Licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_REGION_H_BASE_ -#define _WX_REGION_H_BASE_ - -#include "wx/gdiobj.h" -#include "wx/gdicmn.h" - -class WXDLLIMPEXP_FWD_CORE wxBitmap; -class WXDLLIMPEXP_FWD_CORE wxColour; -class WXDLLIMPEXP_FWD_CORE wxRegion; - -// ---------------------------------------------------------------------------- -// constants -// ---------------------------------------------------------------------------- - -// result of wxRegion::Contains() call -enum wxRegionContain -{ - wxOutRegion = 0, - wxPartRegion = 1, - wxInRegion = 2 -}; - -// these constants are used with wxRegion::Combine() in the ports which have -// this method -enum wxRegionOp -{ - // Creates the intersection of the two combined regions. - wxRGN_AND, - - // Creates a copy of the region - wxRGN_COPY, - - // Combines the parts of first region that are not in the second one - wxRGN_DIFF, - - // Creates the union of two combined regions. - wxRGN_OR, - - // Creates the union of two regions except for any overlapping areas. - wxRGN_XOR -}; - -// ---------------------------------------------------------------------------- -// wxRegionBase defines wxRegion API -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxRegionBase : public wxGDIObject -{ -public: - // ctors - // ----- - - // none are defined here but the following should be available: -#if 0 - wxRegion(); - wxRegion(wxCoord x, wxCoord y, wxCoord w, wxCoord h); - wxRegion(const wxPoint& topLeft, const wxPoint& bottomRight); - wxRegion(const wxRect& rect); - wxRegion(size_t n, const wxPoint *points, int fillStyle = wxODDEVEN_RULE); - wxRegion(const wxBitmap& bmp); - wxRegion(const wxBitmap& bmp, const wxColour& transp, int tolerance = 0); -#endif // 0 - - // operators - // --------- - - bool operator==(const wxRegion& region) const { return IsEqual(region); } - bool operator!=(const wxRegion& region) const { return !(*this == region); } - - - // accessors - // --------- - - bool Ok() const { return IsOk(); } - bool IsOk() const { return m_refData != NULL; } - - // Is region empty? - virtual bool IsEmpty() const = 0; - bool Empty() const { return IsEmpty(); } - - // Is region equal (i.e. covers the same area as another one)? - bool IsEqual(const wxRegion& region) const; - - // Get the bounding box - bool GetBox(wxCoord& x, wxCoord& y, wxCoord& w, wxCoord& h) const - { return DoGetBox(x, y, w, h); } - wxRect GetBox() const - { - wxCoord x, y, w, h; - return DoGetBox(x, y, w, h) ? wxRect(x, y, w, h) : wxRect(); - } - - // Test if the given point or rectangle is inside this region - wxRegionContain Contains(wxCoord x, wxCoord y) const - { return DoContainsPoint(x, y); } - wxRegionContain Contains(const wxPoint& pt) const - { return DoContainsPoint(pt.x, pt.y); } - wxRegionContain Contains(wxCoord x, wxCoord y, wxCoord w, wxCoord h) const - { return DoContainsRect(wxRect(x, y, w, h)); } - wxRegionContain Contains(const wxRect& rect) const - { return DoContainsRect(rect); } - - - // operations - // ---------- - - virtual void Clear() = 0; - - // Move the region - bool Offset(wxCoord x, wxCoord y) - { return DoOffset(x, y); } - bool Offset(const wxPoint& pt) - { return DoOffset(pt.x, pt.y); } - - // Union rectangle or region with this region. - bool Union(wxCoord x, wxCoord y, wxCoord w, wxCoord h) - { return DoUnionWithRect(wxRect(x, y, w, h)); } - bool Union(const wxRect& rect) - { return DoUnionWithRect(rect); } - bool Union(const wxRegion& region) - { return DoUnionWithRegion(region); } - -#if wxUSE_IMAGE - // Use the non-transparent pixels of a wxBitmap for the region to combine - // with this region. First version takes transparency from bitmap's mask, - // second lets the user specify the colour to be treated as transparent - // along with an optional tolerance value. - // NOTE: implemented in common/rgncmn.cpp - bool Union(const wxBitmap& bmp); - bool Union(const wxBitmap& bmp, const wxColour& transp, int tolerance = 0); -#endif // wxUSE_IMAGE - - // Intersect rectangle or region with this one. - bool Intersect(wxCoord x, wxCoord y, wxCoord w, wxCoord h); - bool Intersect(const wxRect& rect); - bool Intersect(const wxRegion& region) - { return DoIntersect(region); } - - // Subtract rectangle or region from this: - // Combines the parts of 'this' that are not part of the second region. - bool Subtract(wxCoord x, wxCoord y, wxCoord w, wxCoord h); - bool Subtract(const wxRect& rect); - bool Subtract(const wxRegion& region) - { return DoSubtract(region); } - - // XOR: the union of two combined regions except for any overlapping areas. - bool Xor(wxCoord x, wxCoord y, wxCoord w, wxCoord h); - bool Xor(const wxRect& rect); - bool Xor(const wxRegion& region) - { return DoXor(region); } - - - // Convert the region to a B&W bitmap with the white pixels being inside - // the region. - wxBitmap ConvertToBitmap() const; - -protected: - virtual bool DoIsEqual(const wxRegion& region) const = 0; - virtual bool DoGetBox(wxCoord& x, wxCoord& y, wxCoord& w, wxCoord& h) const = 0; - virtual wxRegionContain DoContainsPoint(wxCoord x, wxCoord y) const = 0; - virtual wxRegionContain DoContainsRect(const wxRect& rect) const = 0; - - virtual bool DoOffset(wxCoord x, wxCoord y) = 0; - - virtual bool DoUnionWithRect(const wxRect& rect) = 0; - virtual bool DoUnionWithRegion(const wxRegion& region) = 0; - - virtual bool DoIntersect(const wxRegion& region) = 0; - virtual bool DoSubtract(const wxRegion& region) = 0; - virtual bool DoXor(const wxRegion& region) = 0; -}; - -// some ports implement a generic Combine() function while others only -// implement individual wxRegion operations, factor out the common code for the -// ports with Combine() in this class -#if defined(__WXPALMOS__) || \ - defined(__WXMSW__) || \ - defined(__WXMAC__) || \ - defined(__WXPM__) - -#define wxHAS_REGION_COMBINE - -class WXDLLEXPORT wxRegionWithCombine : public wxRegionBase -{ -public: - // these methods are not part of public API as they're not implemented on - // all ports - bool Combine(wxCoord x, wxCoord y, wxCoord w, wxCoord h, wxRegionOp op); - bool Combine(const wxRect& rect, wxRegionOp op); - bool Combine(const wxRegion& region, wxRegionOp op) - { return DoCombine(region, op); } - - -protected: - // the real Combine() method, to be defined in the derived class - virtual bool DoCombine(const wxRegion& region, wxRegionOp op) = 0; - - // implement some wxRegionBase pure virtuals in terms of Combine() - virtual bool DoUnionWithRect(const wxRect& rect); - virtual bool DoUnionWithRegion(const wxRegion& region); - virtual bool DoIntersect(const wxRegion& region); - virtual bool DoSubtract(const wxRegion& region); - virtual bool DoXor(const wxRegion& region); -}; - -#endif // ports with wxRegion::Combine() - -#if defined(__WXPALMOS__) - #include "wx/palmos/region.h" -#elif defined(__WXMSW__) - #include "wx/msw/region.h" -#elif defined(__WXGTK20__) - #include "wx/gtk/region.h" -#elif defined(__WXGTK__) - #include "wx/gtk1/region.h" -#elif defined(__WXMOTIF__) || defined(__WXX11__) - #include "wx/x11/region.h" -#elif defined(__WXMGL__) - #include "wx/mgl/region.h" -#elif defined(__WXDFB__) - #include "wx/dfb/region.h" -#elif defined(__WXMAC__) - #include "wx/mac/region.h" -#elif defined(__WXCOCOA__) - #include "wx/cocoa/region.h" -#elif defined(__WXPM__) - #include "wx/os2/region.h" -#endif - -// ---------------------------------------------------------------------------- -// inline functions implementation -// ---------------------------------------------------------------------------- - -// NB: these functions couldn't be defined in the class declaration as they use -// wxRegion and so can be only defined after including the header declaring -// the real class - -inline bool wxRegionBase::Intersect(const wxRect& rect) -{ - return DoIntersect(wxRegion(rect)); -} - -inline bool wxRegionBase::Subtract(const wxRect& rect) -{ - return DoSubtract(wxRegion(rect)); -} - -inline bool wxRegionBase::Xor(const wxRect& rect) -{ - return DoXor(wxRegion(rect)); -} - -// ...and these functions are here because they call the ones above, and its -// not really proper to call an inline function before its defined inline. - -inline bool wxRegionBase::Intersect(wxCoord x, wxCoord y, wxCoord w, wxCoord h) -{ - return Intersect(wxRect(x, y, w, h)); -} - -inline bool wxRegionBase::Subtract(wxCoord x, wxCoord y, wxCoord w, wxCoord h) -{ - return Subtract(wxRect(x, y, w, h)); -} - -inline bool wxRegionBase::Xor(wxCoord x, wxCoord y, wxCoord w, wxCoord h) -{ - return Xor(wxRect(x, y, w, h)); -} - -#ifdef wxHAS_REGION_COMBINE - -inline bool wxRegionWithCombine::Combine(wxCoord x, - wxCoord y, - wxCoord w, - wxCoord h, - wxRegionOp op) -{ - return DoCombine(wxRegion(x, y, w, h), op); -} - -inline bool wxRegionWithCombine::Combine(const wxRect& rect, wxRegionOp op) -{ - return DoCombine(wxRegion(rect), op); -} - -#endif // wxHAS_REGION_COMBINE - -#endif // _WX_REGION_H_BASE_ diff --git a/wxWidgets/include/wx/renderer.h b/wxWidgets/include/wx/renderer.h deleted file mode 100644 index f7eb8558e4..0000000000 --- a/wxWidgets/include/wx/renderer.h +++ /dev/null @@ -1,436 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: wx/renderer.h -// Purpose: wxRendererNative class declaration -// Author: Vadim Zeitlin -// Modified by: -// Created: 20.07.2003 -// RCS-ID: $Id: renderer.h 53667 2008-05-20 09:28:48Z VS $ -// Copyright: (c) 2003 Vadim Zeitlin <vadim@wxwidgets.org> -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -/* - Renderers are used in wxWidgets for two similar but different things: - (a) wxUniversal uses them to draw everything, i.e. all the control - (b) all the native ports use them to draw generic controls only - - wxUniversal needs more functionality than what is included in the base class - as it needs to draw stuff like scrollbars which are never going to be - generic. So we put the bare minimum needed by the native ports here and the - full wxRenderer class is declared in wx/univ/renderer.h and is only used by - wxUniveral (although note that native ports can load wxRenderer objects from - theme DLLs and use them as wxRendererNative ones, of course). - */ - -#ifndef _WX_RENDERER_H_ -#define _WX_RENDERER_H_ - -class WXDLLIMPEXP_FWD_CORE wxDC; -class WXDLLIMPEXP_FWD_CORE wxWindow; - -#include "wx/gdicmn.h" // for wxPoint -#include "wx/colour.h" -#include "wx/font.h" -#include "wx/bitmap.h" -#include "wx/string.h" - -// some platforms have their own renderers, others use the generic one -#if defined(__WXMSW__) || defined(__WXMAC__) || defined(__WXGTK__) - #define wxHAS_NATIVE_RENDERER -#else - #undef wxHAS_NATIVE_RENDERER -#endif - -// ---------------------------------------------------------------------------- -// constants -// ---------------------------------------------------------------------------- - -// control state flags used in wxRenderer and wxColourScheme -enum -{ - wxCONTROL_DISABLED = 0x00000001, // control is disabled - wxCONTROL_FOCUSED = 0x00000002, // currently has keyboard focus - wxCONTROL_PRESSED = 0x00000004, // (button) is pressed - wxCONTROL_SPECIAL = 0x00000008, // control-specific bit: - wxCONTROL_ISDEFAULT = wxCONTROL_SPECIAL, // only for the buttons - wxCONTROL_ISSUBMENU = wxCONTROL_SPECIAL, // only for the menu items - wxCONTROL_EXPANDED = wxCONTROL_SPECIAL, // only for the tree items - wxCONTROL_SIZEGRIP = wxCONTROL_SPECIAL, // only for the status bar panes - wxCONTROL_CURRENT = 0x00000010, // mouse is currently over the control - wxCONTROL_SELECTED = 0x00000020, // selected item in e.g. listbox - wxCONTROL_CHECKED = 0x00000040, // (check/radio button) is checked - wxCONTROL_CHECKABLE = 0x00000080, // (menu) item can be checked - wxCONTROL_UNDETERMINED = wxCONTROL_CHECKABLE, // (check) undetermined state - - wxCONTROL_FLAGS_MASK = 0x000000ff, - - // this is a pseudo flag not used directly by wxRenderer but rather by some - // controls internally - wxCONTROL_DIRTY = 0x80000000 -}; - -// ---------------------------------------------------------------------------- -// helper structs -// ---------------------------------------------------------------------------- - -// wxSplitterWindow parameters -struct WXDLLEXPORT wxSplitterRenderParams -{ - // the only way to initialize this struct is by using this ctor - wxSplitterRenderParams(wxCoord widthSash_, wxCoord border_, bool isSens_) - : widthSash(widthSash_), border(border_), isHotSensitive(isSens_) - { - } - - // the width of the splitter sash - const wxCoord widthSash; - - // the width of the border of the splitter window - const wxCoord border; - - // true if the splitter changes its appearance when the mouse is over it - const bool isHotSensitive; -}; - - -// extra optional parameters for DrawHeaderButton -struct WXDLLEXPORT wxHeaderButtonParams -{ - wxHeaderButtonParams() - : m_labelAlignment(wxALIGN_LEFT) - { } - - wxColour m_arrowColour; - wxColour m_selectionColour; - wxString m_labelText; - wxFont m_labelFont; - wxColour m_labelColour; - wxBitmap m_labelBitmap; - int m_labelAlignment; -}; - -enum wxHeaderSortIconType { - wxHDR_SORT_ICON_NONE, // Header button has no sort arrow - wxHDR_SORT_ICON_UP, // Header button an an up sort arrow icon - wxHDR_SORT_ICON_DOWN // Header button an a down sort arrow icon -}; - - -// wxRendererNative interface version -struct WXDLLEXPORT wxRendererVersion -{ - wxRendererVersion(int version_, int age_) : version(version_), age(age_) { } - - // default copy ctor, assignment operator and dtor are ok - - // the current version and age of wxRendererNative interface: different - // versions are incompatible (in both ways) while the ages inside the same - // version are upwards compatible, i.e. the version of the renderer must - // match the version of the main program exactly while the age may be - // highergreater or equal to it - // - // NB: don't forget to increment age after adding any new virtual function! - enum - { - Current_Version = 1, - Current_Age = 5 - }; - - - // check if the given version is compatible with the current one - static bool IsCompatible(const wxRendererVersion& ver) - { - return ver.version == Current_Version && ver.age >= Current_Age; - } - - const int version; - const int age; -}; - -// ---------------------------------------------------------------------------- -// wxRendererNative: abstracts drawing methods needed by the native controls -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxRendererNative -{ -public: - // drawing functions - // ----------------- - - // draw the header control button (used by wxListCtrl) Returns optimal - // width for the label contents. - virtual int DrawHeaderButton(wxWindow *win, - wxDC& dc, - const wxRect& rect, - int flags = 0, - wxHeaderSortIconType sortArrow = wxHDR_SORT_ICON_NONE, - wxHeaderButtonParams* params=NULL) = 0; - - - // Draw the contents of a header control button (label, sort arrows, etc.) - // Normally only called by DrawHeaderButton. - virtual int DrawHeaderButtonContents(wxWindow *win, - wxDC& dc, - const wxRect& rect, - int flags = 0, - wxHeaderSortIconType sortArrow = wxHDR_SORT_ICON_NONE, - wxHeaderButtonParams* params=NULL) = 0; - - // Returns the default height of a header button, either a fixed platform - // height if available, or a generic height based on the window's font. - virtual int GetHeaderButtonHeight(wxWindow *win) = 0; - - - // draw the expanded/collapsed icon for a tree control item - virtual void DrawTreeItemButton(wxWindow *win, - wxDC& dc, - const wxRect& rect, - int flags = 0) = 0; - - // draw the border for sash window: this border must be such that the sash - // drawn by DrawSash() blends into it well - virtual void DrawSplitterBorder(wxWindow *win, - wxDC& dc, - const wxRect& rect, - int flags = 0) = 0; - - // draw a (vertical) sash - virtual void DrawSplitterSash(wxWindow *win, - wxDC& dc, - const wxSize& size, - wxCoord position, - wxOrientation orient, - int flags = 0) = 0; - - // draw a combobox dropdown button - // - // flags may use wxCONTROL_PRESSED and wxCONTROL_CURRENT - virtual void DrawComboBoxDropButton(wxWindow *win, - wxDC& dc, - const wxRect& rect, - int flags = 0) = 0; - - // draw a dropdown arrow - // - // flags may use wxCONTROL_PRESSED and wxCONTROL_CURRENT - virtual void DrawDropArrow(wxWindow *win, - wxDC& dc, - const wxRect& rect, - int flags = 0) = 0; - - // draw check button - // - // flags may use wxCONTROL_CHECKED, wxCONTROL_UNDETERMINED and wxCONTROL_CURRENT - virtual void DrawCheckBox(wxWindow *win, - wxDC& dc, - const wxRect& rect, - int flags = 0) = 0; - - // draw blank button - // - // flags may use wxCONTROL_PRESSED, wxCONTROL_CURRENT and wxCONTROL_ISDEFAULT - virtual void DrawPushButton(wxWindow *win, - wxDC& dc, - const wxRect& rect, - int flags = 0) = 0; - - // draw rectangle indicating that an item in e.g. a list control - // has been selected or focused - // - // flags may use - // wxCONTROL_SELECTED (item is selected, e.g. draw background) - // wxCONTROL_CURRENT (item is the current item, e.g. dotted border) - // wxCONTROL_FOCUSED (the whole control has focus, e.g. blue background vs. grey otherwise) - virtual void DrawItemSelectionRect(wxWindow *win, - wxDC& dc, - const wxRect& rect, - int flags = 0) = 0; - - // geometry functions - // ------------------ - - // get the splitter parameters: the x field of the returned point is the - // sash width and the y field is the border width - virtual wxSplitterRenderParams GetSplitterParams(const wxWindow *win) = 0; - - - // pseudo constructors - // ------------------- - - // return the currently used renderer - static wxRendererNative& Get(); - - // return the generic implementation of the renderer - static wxRendererNative& GetGeneric(); - - // return the default (native) implementation for this platform - static wxRendererNative& GetDefault(); - - - // changing the global renderer - // ---------------------------- - -#if wxUSE_DYNLIB_CLASS - // load the renderer from the specified DLL, the returned pointer must be - // deleted by caller if not NULL when it is not used any more - static wxRendererNative *Load(const wxString& name); -#endif // wxUSE_DYNLIB_CLASS - - // set the renderer to use, passing NULL reverts to using the default - // renderer - // - // return the previous renderer used with Set() or NULL if none - static wxRendererNative *Set(wxRendererNative *renderer); - - - // miscellaneous stuff - // ------------------- - - // this function is used for version checking: Load() refuses to load any - // DLLs implementing an older or incompatible version; it should be - // implemented simply by returning wxRendererVersion::Current_XXX values - virtual wxRendererVersion GetVersion() const = 0; - - // virtual dtor for any base class - virtual ~wxRendererNative(); -}; - -// ---------------------------------------------------------------------------- -// wxDelegateRendererNative: allows reuse of renderers code -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxDelegateRendererNative : public wxRendererNative -{ -public: - wxDelegateRendererNative() - : m_rendererNative(GetGeneric()) { } - - wxDelegateRendererNative(wxRendererNative& rendererNative) - : m_rendererNative(rendererNative) { } - - - virtual int DrawHeaderButton(wxWindow *win, - wxDC& dc, - const wxRect& rect, - int flags = 0, - wxHeaderSortIconType sortArrow = wxHDR_SORT_ICON_NONE, - wxHeaderButtonParams* params = NULL) - { return m_rendererNative.DrawHeaderButton(win, dc, rect, flags, sortArrow, params); } - - virtual int DrawHeaderButtonContents(wxWindow *win, - wxDC& dc, - const wxRect& rect, - int flags = 0, - wxHeaderSortIconType sortArrow = wxHDR_SORT_ICON_NONE, - wxHeaderButtonParams* params = NULL) - { return m_rendererNative.DrawHeaderButtonContents(win, dc, rect, flags, sortArrow, params); } - - virtual int GetHeaderButtonHeight(wxWindow *win) - { return m_rendererNative.GetHeaderButtonHeight(win); } - - virtual void DrawTreeItemButton(wxWindow *win, - wxDC& dc, - const wxRect& rect, - int flags = 0) - { m_rendererNative.DrawTreeItemButton(win, dc, rect, flags); } - - virtual void DrawSplitterBorder(wxWindow *win, - wxDC& dc, - const wxRect& rect, - int flags = 0) - { m_rendererNative.DrawSplitterBorder(win, dc, rect, flags); } - - virtual void DrawSplitterSash(wxWindow *win, - wxDC& dc, - const wxSize& size, - wxCoord position, - wxOrientation orient, - int flags = 0) - { m_rendererNative.DrawSplitterSash(win, dc, size, - position, orient, flags); } - - virtual void DrawComboBoxDropButton(wxWindow *win, - wxDC& dc, - const wxRect& rect, - int flags = 0) - { m_rendererNative.DrawComboBoxDropButton(win, dc, rect, flags); } - - virtual void DrawDropArrow(wxWindow *win, - wxDC& dc, - const wxRect& rect, - int flags = 0) - { m_rendererNative.DrawDropArrow(win, dc, rect, flags); } - - virtual void DrawCheckBox(wxWindow *win, - wxDC& dc, - const wxRect& rect, - int flags = 0 ) - { m_rendererNative.DrawCheckBox( win, dc, rect, flags ); } - - virtual void DrawPushButton(wxWindow *win, - wxDC& dc, - const wxRect& rect, - int flags = 0 ) - { m_rendererNative.DrawPushButton( win, dc, rect, flags ); } - - virtual void DrawItemSelectionRect(wxWindow *win, - wxDC& dc, - const wxRect& rect, - int flags = 0 ) - { m_rendererNative.DrawItemSelectionRect( win, dc, rect, flags ); } - - virtual wxSplitterRenderParams GetSplitterParams(const wxWindow *win) - { return m_rendererNative.GetSplitterParams(win); } - - virtual wxRendererVersion GetVersion() const - { return m_rendererNative.GetVersion(); } - -protected: - wxRendererNative& m_rendererNative; - - DECLARE_NO_COPY_CLASS(wxDelegateRendererNative) -}; - -// ---------------------------------------------------------------------------- -// inline functions implementation -// ---------------------------------------------------------------------------- - -#ifndef wxHAS_NATIVE_RENDERER - -// default native renderer is the generic one then -/* static */ inline -wxRendererNative& wxRendererNative::GetDefault() -{ - return GetGeneric(); -} - -#endif // !wxHAS_NATIVE_RENDERER - - -// ---------------------------------------------------------------------------- -// Other renderer functions to be merged in to wxRenderer class in 2.9, but -// they are standalone functions here to protect the ABI. -// ---------------------------------------------------------------------------- - -#if defined(__WXMSW__) || defined(__WXMAC__) || defined(__WXGTK20__) -#if wxABI_VERSION >= 20808 - -// Draw a native wxChoice -void WXDLLEXPORT wxRenderer_DrawChoice(wxWindow* win, wxDC& dc, - const wxRect& rect, int flags=0); - -// Draw a native wxComboBox -void WXDLLEXPORT wxRenderer_DrawComboBox(wxWindow* win, wxDC& dc, - const wxRect& rect, int flags=0); - -// Draw a native wxTextCtrl frame -void WXDLLEXPORT wxRenderer_DrawTextCtrl(wxWindow* win, wxDC& dc, - const wxRect& rect, int flags=0); - -// Draw a native wxRadioButton (just the graphical portion) -void WXDLLEXPORT wxRenderer_DrawRadioButton(wxWindow* win, wxDC& dc, - const wxRect& rect, int flags=0); -#endif // wxABI_VERSION -#endif // (platforms) - -#endif // _WX_RENDERER_H_ diff --git a/wxWidgets/include/wx/richtext/richtextbuffer.h b/wxWidgets/include/wx/richtext/richtextbuffer.h deleted file mode 100644 index 4d1dab37e4..0000000000 --- a/wxWidgets/include/wx/richtext/richtextbuffer.h +++ /dev/null @@ -1,2398 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/richtext/richtextbuffer.h -// Purpose: Buffer for wxRichTextCtrl -// Author: Julian Smart -// Modified by: -// Created: 2005-09-30 -// RCS-ID: $Id: richtextbuffer.h 64777 2010-06-28 21:21:53Z JS $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_RICHTEXTBUFFER_H_ -#define _WX_RICHTEXTBUFFER_H_ - -/* - - Data structures - =============== - - Data is represented by a hierarchy of objects, all derived from - wxRichTextObject. - - The top of the hierarchy is the buffer, a kind of wxRichTextParagraphLayoutBox. - These boxes will allow flexible placement of text boxes on a page, but - for now there is a single box representing the document, and this box is - a wxRichTextParagraphLayoutBox which contains further wxRichTextParagraph - objects, each of which can include text and images. - - Each object maintains a range (start and end position) measured - from the start of the main parent box. - A paragraph object knows its range, and a text fragment knows its range - too. So, a character or image in a page has a position relative to the - start of the document, and a character in an embedded text box has - a position relative to that text box. For now, we will not be dealing with - embedded objects but it's something to bear in mind for later. - - Note that internally, a range (5,5) represents a range of one character. - In the public wx[Rich]TextCtrl API, this would be passed to e.g. SetSelection - as (5,6). A paragraph with one character might have an internal range of (0, 1) - since the end of the paragraph takes up one position. - - Layout - ====== - - When Layout is called on an object, it is given a size which the object - must limit itself to, or one or more flexible directions (vertical - or horizontal). So for example a centered paragraph is given the page - width to play with (minus any margins), but can extend indefinitely - in the vertical direction. The implementation of Layout can then - cache the calculated size and position within the parent. - - */ - -/*! - * Includes - */ - -#include "wx/defs.h" - -#if wxUSE_RICHTEXT - -#include "wx/list.h" -#include "wx/textctrl.h" -#include "wx/bitmap.h" -#include "wx/image.h" -#include "wx/cmdproc.h" -#include "wx/txtstrm.h" - -#if wxUSE_DATAOBJ -#include "wx/dataobj.h" -#endif - -// Setting wxRICHTEXT_USE_OWN_CARET to 1 implements a -// caret reliably without using wxClientDC in case there -// are platform-specific problems with the generic caret. -#if defined(__WXGTK__) || (defined(wxMAC_USE_CORE_GRAPHICS) && wxMAC_USE_CORE_GRAPHICS) -#define wxRICHTEXT_USE_OWN_CARET 1 -#else -#define wxRICHTEXT_USE_OWN_CARET 0 -#endif - -// Switch off for binary compatibility, on for faster drawing -#define wxRICHTEXT_USE_OPTIMIZED_LINE_DRAWING 0 - -/*! - * Special characters - */ - -extern WXDLLIMPEXP_RICHTEXT const wxChar wxRichTextLineBreakChar; - -/*! - * File types - */ - -#define wxRICHTEXT_TYPE_ANY 0 -#define wxRICHTEXT_TYPE_TEXT 1 -#define wxRICHTEXT_TYPE_XML 2 -#define wxRICHTEXT_TYPE_HTML 3 -#define wxRICHTEXT_TYPE_RTF 4 -#define wxRICHTEXT_TYPE_PDF 5 - -/*! - * Forward declarations - */ - -class WXDLLIMPEXP_FWD_RICHTEXT wxRichTextCtrl; -class WXDLLIMPEXP_FWD_RICHTEXT wxRichTextObject; -class WXDLLIMPEXP_FWD_RICHTEXT wxRichTextCacheObject; -class WXDLLIMPEXP_FWD_RICHTEXT wxRichTextObjectList; -class WXDLLIMPEXP_FWD_RICHTEXT wxRichTextLine; -class WXDLLIMPEXP_FWD_RICHTEXT wxRichTextParagraph; -class WXDLLIMPEXP_FWD_RICHTEXT wxRichTextFileHandler; -class WXDLLIMPEXP_FWD_RICHTEXT wxRichTextStyleSheet; -class WXDLLIMPEXP_FWD_RICHTEXT wxTextAttrEx; -class WXDLLIMPEXP_FWD_RICHTEXT wxRichTextListStyleDefinition; -class WXDLLIMPEXP_FWD_RICHTEXT wxRichTextEvent; -class WXDLLIMPEXP_FWD_RICHTEXT wxRichTextRenderer; -class WXDLLIMPEXP_FWD_RICHTEXT wxRichTextBuffer; - -/*! - * Flags determining the available space, passed to Layout - */ - -#define wxRICHTEXT_FIXED_WIDTH 0x01 -#define wxRICHTEXT_FIXED_HEIGHT 0x02 -#define wxRICHTEXT_VARIABLE_WIDTH 0x04 -#define wxRICHTEXT_VARIABLE_HEIGHT 0x08 - -// Only lay out the part of the buffer that lies within -// the rect passed to Layout. -#define wxRICHTEXT_LAYOUT_SPECIFIED_RECT 0x10 - -/*! - * Flags to pass to Draw - */ - -// Ignore paragraph cache optimization, e.g. for printing purposes -// where one line may be drawn higher (on the next page) compared -// with the previous line -#define wxRICHTEXT_DRAW_IGNORE_CACHE 0x01 - -/*! - * Flags returned from hit-testing - */ - -// The point was not on this object -#define wxRICHTEXT_HITTEST_NONE 0x01 -// The point was before the position returned from HitTest -#define wxRICHTEXT_HITTEST_BEFORE 0x02 -// The point was after the position returned from HitTest -#define wxRICHTEXT_HITTEST_AFTER 0x04 -// The point was on the position returned from HitTest -#define wxRICHTEXT_HITTEST_ON 0x08 -// The point was on space outside content -#define wxRICHTEXT_HITTEST_OUTSIDE 0x10 - -/*! - * Flags for GetRangeSize - */ - -#define wxRICHTEXT_FORMATTED 0x01 -#define wxRICHTEXT_UNFORMATTED 0x02 -#define wxRICHTEXT_CACHE_SIZE 0x04 -#define wxRICHTEXT_HEIGHT_ONLY 0x08 - -/*! - * Flags for SetStyle/SetListStyle - */ - -#define wxRICHTEXT_SETSTYLE_NONE 0x00 - -// Specifies that this operation should be undoable -#define wxRICHTEXT_SETSTYLE_WITH_UNDO 0x01 - -// Specifies that the style should not be applied if the -// combined style at this point is already the style in question. -#define wxRICHTEXT_SETSTYLE_OPTIMIZE 0x02 - -// Specifies that the style should only be applied to paragraphs, -// and not the content. This allows content styling to be -// preserved independently from that of e.g. a named paragraph style. -#define wxRICHTEXT_SETSTYLE_PARAGRAPHS_ONLY 0x04 - -// Specifies that the style should only be applied to characters, -// and not the paragraph. This allows content styling to be -// preserved independently from that of e.g. a named paragraph style. -#define wxRICHTEXT_SETSTYLE_CHARACTERS_ONLY 0x08 - -// For SetListStyle only: specifies starting from the given number, otherwise -// deduces number from existing attributes -#define wxRICHTEXT_SETSTYLE_RENUMBER 0x10 - -// For SetListStyle only: specifies the list level for all paragraphs, otherwise -// the current indentation will be used -#define wxRICHTEXT_SETSTYLE_SPECIFY_LEVEL 0x20 - -// Resets the existing style before applying the new style -#define wxRICHTEXT_SETSTYLE_RESET 0x40 - -// Removes the given style instead of applying it -#define wxRICHTEXT_SETSTYLE_REMOVE 0x80 - -/*! - * Flags for text insertion - */ - -#define wxRICHTEXT_INSERT_NONE 0x00 -#define wxRICHTEXT_INSERT_WITH_PREVIOUS_PARAGRAPH_STYLE 0x01 -#define wxRICHTEXT_INSERT_INTERACTIVE 0x02 - -/*! - * Extra formatting flags not in wxTextAttr - */ - -#define wxTEXT_ATTR_PARA_SPACING_AFTER 0x00000800 -#define wxTEXT_ATTR_PARA_SPACING_BEFORE 0x00001000 -#define wxTEXT_ATTR_LINE_SPACING 0x00002000 -#define wxTEXT_ATTR_CHARACTER_STYLE_NAME 0x00004000 -#define wxTEXT_ATTR_PARAGRAPH_STYLE_NAME 0x00008000 -#define wxTEXT_ATTR_LIST_STYLE_NAME 0x00010000 -#define wxTEXT_ATTR_BULLET_STYLE 0x00020000 -#define wxTEXT_ATTR_BULLET_NUMBER 0x00040000 -#define wxTEXT_ATTR_BULLET_TEXT 0x00080000 -#define wxTEXT_ATTR_BULLET_NAME 0x00100000 -#define wxTEXT_ATTR_URL 0x00200000 -#define wxTEXT_ATTR_PAGE_BREAK 0x00400000 -#define wxTEXT_ATTR_EFFECTS 0x00800000 -#define wxTEXT_ATTR_OUTLINE_LEVEL 0x01000000 - -// A special flag telling the buffer to keep the first paragraph style -// as-is, when deleting a paragraph marker. In future we might pass a -// flag to InsertFragment and DeleteRange to indicate the appropriate mode. -#define wxTEXT_ATTR_KEEP_FIRST_PARA_STYLE 0x10000000 - -/*! - * Styles for wxTextAttrEx::SetBulletStyle - */ - -#define wxTEXT_ATTR_BULLET_STYLE_NONE 0x00000000 -#define wxTEXT_ATTR_BULLET_STYLE_ARABIC 0x00000001 -#define wxTEXT_ATTR_BULLET_STYLE_LETTERS_UPPER 0x00000002 -#define wxTEXT_ATTR_BULLET_STYLE_LETTERS_LOWER 0x00000004 -#define wxTEXT_ATTR_BULLET_STYLE_ROMAN_UPPER 0x00000008 -#define wxTEXT_ATTR_BULLET_STYLE_ROMAN_LOWER 0x00000010 -#define wxTEXT_ATTR_BULLET_STYLE_SYMBOL 0x00000020 -#define wxTEXT_ATTR_BULLET_STYLE_BITMAP 0x00000040 -#define wxTEXT_ATTR_BULLET_STYLE_PARENTHESES 0x00000080 -#define wxTEXT_ATTR_BULLET_STYLE_PERIOD 0x00000100 -#define wxTEXT_ATTR_BULLET_STYLE_STANDARD 0x00000200 -#define wxTEXT_ATTR_BULLET_STYLE_RIGHT_PARENTHESIS 0x00000400 -#define wxTEXT_ATTR_BULLET_STYLE_OUTLINE 0x00000800 - -#define wxTEXT_ATTR_BULLET_STYLE_ALIGN_LEFT 0x00000000 -#define wxTEXT_ATTR_BULLET_STYLE_ALIGN_RIGHT 0x00001000 -#define wxTEXT_ATTR_BULLET_STYLE_ALIGN_CENTRE 0x00002000 - -/*! - * Styles for wxTextAttrEx::SetTextEffects - */ - -#define wxTEXT_ATTR_EFFECT_NONE 0x00000000 -#define wxTEXT_ATTR_EFFECT_CAPITALS 0x00000001 -#define wxTEXT_ATTR_EFFECT_SMALL_CAPITALS 0x00000002 -#define wxTEXT_ATTR_EFFECT_STRIKETHROUGH 0x00000004 -#define wxTEXT_ATTR_EFFECT_DOUBLE_STRIKETHROUGH 0x00000008 -#define wxTEXT_ATTR_EFFECT_SHADOW 0x00000010 -#define wxTEXT_ATTR_EFFECT_EMBOSS 0x00000020 -#define wxTEXT_ATTR_EFFECT_OUTLINE 0x00000040 -#define wxTEXT_ATTR_EFFECT_ENGRAVE 0x00000080 -#define wxTEXT_ATTR_EFFECT_SUPERSCRIPT 0x00000100 -#define wxTEXT_ATTR_EFFECT_SUBSCRIPT 0x00000200 - -/*! - * Line spacing values - */ - -#define wxTEXT_ATTR_LINE_SPACING_NORMAL 10 -#define wxTEXT_ATTR_LINE_SPACING_HALF 15 -#define wxTEXT_ATTR_LINE_SPACING_TWICE 20 - -/*! - * Character and paragraph combined styles - */ - -#define wxTEXT_ATTR_CHARACTER (wxTEXT_ATTR_FONT|wxTEXT_ATTR_EFFECTS|wxTEXT_ATTR_BACKGROUND_COLOUR|wxTEXT_ATTR_TEXT_COLOUR|wxTEXT_ATTR_CHARACTER_STYLE_NAME|wxTEXT_ATTR_URL) - -#define wxTEXT_ATTR_PARAGRAPH (wxTEXT_ATTR_ALIGNMENT|wxTEXT_ATTR_LEFT_INDENT|wxTEXT_ATTR_RIGHT_INDENT|wxTEXT_ATTR_TABS|\ - wxTEXT_ATTR_PARA_SPACING_BEFORE|wxTEXT_ATTR_PARA_SPACING_AFTER|wxTEXT_ATTR_LINE_SPACING|\ - wxTEXT_ATTR_BULLET_STYLE|wxTEXT_ATTR_BULLET_NUMBER|wxTEXT_ATTR_BULLET_TEXT|wxTEXT_ATTR_BULLET_NAME|\ - wxTEXT_ATTR_PARAGRAPH_STYLE_NAME|wxTEXT_ATTR_LIST_STYLE_NAME|wxTEXT_ATTR_OUTLINE_LEVEL|wxTEXT_ATTR_PAGE_BREAK) - -#define wxTEXT_ATTR_ALL (wxTEXT_ATTR_CHARACTER|wxTEXT_ATTR_PARAGRAPH) - -/*! - * Default superscript/subscript font multiplication factor - */ - -#define wxSCRIPT_MUL_FACTOR 1.5 - -/*! - * wxRichTextRange class declaration - * This stores beginning and end positions for a range of data. - */ - -class WXDLLIMPEXP_RICHTEXT wxRichTextRange -{ -public: -// Constructors - - wxRichTextRange() { m_start = 0; m_end = 0; } - wxRichTextRange(long start, long end) { m_start = start; m_end = end; } - wxRichTextRange(const wxRichTextRange& range) { m_start = range.m_start; m_end = range.m_end; } - ~wxRichTextRange() {} - - void operator =(const wxRichTextRange& range) { m_start = range.m_start; m_end = range.m_end; } - bool operator ==(const wxRichTextRange& range) const { return (m_start == range.m_start && m_end == range.m_end); } - bool operator !=(const wxRichTextRange& range) const { return (m_start != range.m_start || m_end != range.m_end); } - wxRichTextRange operator -(const wxRichTextRange& range) const { return wxRichTextRange(m_start - range.m_start, m_end - range.m_end); } - wxRichTextRange operator +(const wxRichTextRange& range) const { return wxRichTextRange(m_start + range.m_start, m_end + range.m_end); } - - void SetRange(long start, long end) { m_start = start; m_end = end; } - - void SetStart(long start) { m_start = start; } - long GetStart() const { return m_start; } - - void SetEnd(long end) { m_end = end; } - long GetEnd() const { return m_end; } - - /// Returns true if this range is completely outside 'range' - bool IsOutside(const wxRichTextRange& range) const { return range.m_start > m_end || range.m_end < m_start; } - - /// Returns true if this range is completely within 'range' - bool IsWithin(const wxRichTextRange& range) const { return m_start >= range.m_start && m_end <= range.m_end; } - - /// Returns true if the given position is within this range. Allow - /// for the possibility of an empty range - assume the position - /// is within this empty range. NO, I think we should not match with an empty range. - // bool Contains(long pos) const { return pos >= m_start && (pos <= m_end || GetLength() == 0); } - bool Contains(long pos) const { return pos >= m_start && pos <= m_end ; } - - /// Limit this range to be within 'range' - bool LimitTo(const wxRichTextRange& range) ; - - /// Gets the length of the range - long GetLength() const { return m_end - m_start + 1; } - - /// Swaps the start and end - void Swap() { long tmp = m_start; m_start = m_end; m_end = tmp; } - - /// Convert to internal form: (n, n) is the range of a single character. - wxRichTextRange ToInternal() const { return wxRichTextRange(m_start, m_end-1); } - - /// Convert from internal to public API form: (n, n+1) is the range of a single character. - wxRichTextRange FromInternal() const { return wxRichTextRange(m_start, m_end+1); } - -protected: - long m_start; - long m_end; -}; - -#define wxRICHTEXT_ALL wxRichTextRange(-2, -2) -#define wxRICHTEXT_NONE wxRichTextRange(-1, -1) - -/*! - * wxTextAttrEx is an extended version of wxTextAttr with more paragraph attributes. - */ - -class WXDLLIMPEXP_RICHTEXT wxTextAttrEx: public wxTextAttr -{ -public: - // ctors - wxTextAttrEx(const wxTextAttrEx& attr); - wxTextAttrEx(const wxTextAttr& attr) { Init(); (*this) = attr; } - wxTextAttrEx() { Init(); } - - // Initialise this object - void Init(); - - // Copy - void Copy(const wxTextAttrEx& attr); - - // Assignment from a wxTextAttrEx object - void operator= (const wxTextAttrEx& attr); - - // Assignment from a wxTextAttr object - void operator= (const wxTextAttr& attr); - - // Equality test - bool operator== (const wxTextAttrEx& attr) const; - - // setters - void SetCharacterStyleName(const wxString& name) { m_characterStyleName = name; SetFlags(GetFlags() | wxTEXT_ATTR_CHARACTER_STYLE_NAME); } - void SetParagraphStyleName(const wxString& name) { m_paragraphStyleName = name; SetFlags(GetFlags() | wxTEXT_ATTR_PARAGRAPH_STYLE_NAME); } - void SetListStyleName(const wxString& name) { m_listStyleName = name; SetFlags(GetFlags() | wxTEXT_ATTR_LIST_STYLE_NAME); } - void SetParagraphSpacingAfter(int spacing) { m_paragraphSpacingAfter = spacing; SetFlags(GetFlags() | wxTEXT_ATTR_PARA_SPACING_AFTER); } - void SetParagraphSpacingBefore(int spacing) { m_paragraphSpacingBefore = spacing; SetFlags(GetFlags() | wxTEXT_ATTR_PARA_SPACING_BEFORE); } - void SetLineSpacing(int spacing) { m_lineSpacing = spacing; SetFlags(GetFlags() | wxTEXT_ATTR_LINE_SPACING); } - void SetBulletStyle(int style) { m_bulletStyle = style; SetFlags(GetFlags() | wxTEXT_ATTR_BULLET_STYLE); } - void SetBulletNumber(int n) { m_bulletNumber = n; SetFlags(GetFlags() | wxTEXT_ATTR_BULLET_NUMBER); } - void SetBulletText(const wxString& text) { m_bulletText = text; SetFlags(GetFlags() | wxTEXT_ATTR_BULLET_TEXT); } - void SetBulletName(const wxString& name) { m_bulletName = name; SetFlags(GetFlags() | wxTEXT_ATTR_BULLET_NAME); } - void SetBulletFont(const wxString& bulletFont) { m_bulletFont = bulletFont; } - void SetURL(const wxString& url) { m_urlTarget = url; SetFlags(GetFlags() | wxTEXT_ATTR_URL); } - void SetPageBreak(bool pageBreak = true) { SetFlags(pageBreak ? (GetFlags() | wxTEXT_ATTR_PAGE_BREAK) : (GetFlags() & ~wxTEXT_ATTR_PAGE_BREAK)); } - void SetTextEffects(int effects) { m_textEffects = effects; SetFlags(GetFlags() | wxTEXT_ATTR_EFFECTS); } - void SetTextEffectFlags(int effects) { m_textEffectFlags = effects; } - void SetOutlineLevel(int level) { m_outlineLevel = level; SetFlags(GetFlags() | wxTEXT_ATTR_OUTLINE_LEVEL); } - - const wxString& GetCharacterStyleName() const { return m_characterStyleName; } - const wxString& GetParagraphStyleName() const { return m_paragraphStyleName; } - const wxString& GetListStyleName() const { return m_listStyleName; } - int GetParagraphSpacingAfter() const { return m_paragraphSpacingAfter; } - int GetParagraphSpacingBefore() const { return m_paragraphSpacingBefore; } - int GetLineSpacing() const { return m_lineSpacing; } - int GetBulletStyle() const { return m_bulletStyle; } - int GetBulletNumber() const { return m_bulletNumber; } - const wxString& GetBulletText() const { return m_bulletText; } - const wxString& GetBulletName() const { return m_bulletName; } - const wxString& GetBulletFont() const { return m_bulletFont; } - const wxString& GetURL() const { return m_urlTarget; } - int GetTextEffects() const { return m_textEffects; } - int GetTextEffectFlags() const { return m_textEffectFlags; } - int GetOutlineLevel() const { return m_outlineLevel; } - - bool HasFontWeight() const { return (GetFlags() & wxTEXT_ATTR_FONT_WEIGHT) != 0; } - bool HasFontSize() const { return (GetFlags() & wxTEXT_ATTR_FONT_SIZE) != 0; } - bool HasFontItalic() const { return (GetFlags() & wxTEXT_ATTR_FONT_ITALIC) != 0; } - bool HasFontUnderlined() const { return (GetFlags() & wxTEXT_ATTR_FONT_UNDERLINE) != 0; } - bool HasFontFaceName() const { return (GetFlags() & wxTEXT_ATTR_FONT_FACE) != 0; } - - bool HasParagraphSpacingAfter() const { return HasFlag(wxTEXT_ATTR_PARA_SPACING_AFTER); } - bool HasParagraphSpacingBefore() const { return HasFlag(wxTEXT_ATTR_PARA_SPACING_BEFORE); } - bool HasLineSpacing() const { return HasFlag(wxTEXT_ATTR_LINE_SPACING); } - bool HasCharacterStyleName() const { return HasFlag(wxTEXT_ATTR_CHARACTER_STYLE_NAME) && !m_characterStyleName.IsEmpty(); } - bool HasParagraphStyleName() const { return HasFlag(wxTEXT_ATTR_PARAGRAPH_STYLE_NAME) && !m_paragraphStyleName.IsEmpty(); } - bool HasListStyleName() const { return HasFlag(wxTEXT_ATTR_LIST_STYLE_NAME) || !m_listStyleName.IsEmpty(); } - bool HasBulletStyle() const { return HasFlag(wxTEXT_ATTR_BULLET_STYLE); } - bool HasBulletNumber() const { return HasFlag(wxTEXT_ATTR_BULLET_NUMBER); } - bool HasBulletText() const { return HasFlag(wxTEXT_ATTR_BULLET_TEXT); } - bool HasBulletName() const { return HasFlag(wxTEXT_ATTR_BULLET_NAME); } - bool HasURL() const { return HasFlag(wxTEXT_ATTR_URL); } - bool HasPageBreak() const { return HasFlag(wxTEXT_ATTR_PAGE_BREAK); } - bool HasTextEffects() const { return HasFlag(wxTEXT_ATTR_EFFECTS); } - bool HasTextEffect(int effect) const { return HasFlag(wxTEXT_ATTR_EFFECTS) && ((GetTextEffectFlags() & effect) != 0); } - bool HasOutlineLevel() const { return HasFlag(wxTEXT_ATTR_OUTLINE_LEVEL); } - - // Is this a character style? - bool IsCharacterStyle() const { return (0 != (GetFlags() & wxTEXT_ATTR_CHARACTER)); } - bool IsParagraphStyle() const { return (0 != (GetFlags() & wxTEXT_ATTR_PARAGRAPH)); } - - // returns false if we have any attributes set, true otherwise - bool IsDefault() const - { - return (GetFlags() == 0); - } - - // return the attribute having the valid font and colours: it uses the - // attributes set in attr and falls back first to attrDefault and then to - // the text control font/colours for those attributes which are not set - static wxTextAttrEx CombineEx(const wxTextAttrEx& attr, - const wxTextAttrEx& attrDef, - const wxTextCtrlBase *text); - -private: - // Paragraph styles - int m_paragraphSpacingAfter; - int m_paragraphSpacingBefore; - int m_lineSpacing; - int m_bulletStyle; - int m_bulletNumber; - int m_textEffects; - int m_textEffectFlags; - int m_outlineLevel; - wxString m_bulletText; - wxString m_bulletFont; - wxString m_bulletName; - wxString m_urlTarget; - - // Character style - wxString m_characterStyleName; - - // Paragraph style - wxString m_paragraphStyleName; - - // List style - wxString m_listStyleName; -}; - -/*! - * wxRichTextAttr stores attributes without a wxFont object, so is a much more - * efficient way to query styles. - */ - -class WXDLLIMPEXP_RICHTEXT wxRichTextAttr -{ -public: - // ctors - wxRichTextAttr(const wxTextAttrEx& attr); - wxRichTextAttr(const wxRichTextAttr& attr); - wxRichTextAttr() { Init(); } - wxRichTextAttr(const wxColour& colText, - const wxColour& colBack = wxNullColour, - wxTextAttrAlignment alignment = wxTEXT_ALIGNMENT_DEFAULT); - - // Initialise this object. - void Init(); - - // Copy - void Copy(const wxRichTextAttr& attr); - - // Assignment from a wxRichTextAttr object. - void operator= (const wxRichTextAttr& attr); - - // Assignment from a wxTextAttrEx object. - void operator= (const wxTextAttrEx& attr); - - // Equality test - bool operator== (const wxRichTextAttr& attr) const; - - // Making a wxTextAttrEx object. - operator wxTextAttrEx () const ; - - // Create font from font attributes. - wxFont CreateFont() const; - - // Get attributes from font. - bool GetFontAttributes(const wxFont& font); - - // setters - void SetTextColour(const wxColour& colText) { m_colText = colText; m_flags |= wxTEXT_ATTR_TEXT_COLOUR; } - void SetBackgroundColour(const wxColour& colBack) { m_colBack = colBack; m_flags |= wxTEXT_ATTR_BACKGROUND_COLOUR; } - void SetAlignment(wxTextAttrAlignment alignment) { m_textAlignment = alignment; m_flags |= wxTEXT_ATTR_ALIGNMENT; } - void SetTabs(const wxArrayInt& tabs) { m_tabs = tabs; m_flags |= wxTEXT_ATTR_TABS; } - void SetLeftIndent(int indent, int subIndent = 0) { m_leftIndent = indent; m_leftSubIndent = subIndent; m_flags |= wxTEXT_ATTR_LEFT_INDENT; } - void SetRightIndent(int indent) { m_rightIndent = indent; m_flags |= wxTEXT_ATTR_RIGHT_INDENT; } - - void SetFontSize(int pointSize) { m_fontSize = pointSize; m_flags |= wxTEXT_ATTR_FONT_SIZE; } - void SetFontStyle(int fontStyle) { m_fontStyle = fontStyle; m_flags |= wxTEXT_ATTR_FONT_ITALIC; } - void SetFontWeight(int fontWeight) { m_fontWeight = fontWeight; m_flags |= wxTEXT_ATTR_FONT_WEIGHT; } - void SetFontFaceName(const wxString& faceName) { m_fontFaceName = faceName; m_flags |= wxTEXT_ATTR_FONT_FACE; } - void SetFontUnderlined(bool underlined) { m_fontUnderlined = underlined; m_flags |= wxTEXT_ATTR_FONT_UNDERLINE; } - - void SetFlags(long flags) { m_flags = flags; } - - void SetCharacterStyleName(const wxString& name) { m_characterStyleName = name; m_flags |= wxTEXT_ATTR_CHARACTER_STYLE_NAME; } - void SetParagraphStyleName(const wxString& name) { m_paragraphStyleName = name; m_flags |= wxTEXT_ATTR_PARAGRAPH_STYLE_NAME; } - void SetListStyleName(const wxString& name) { m_listStyleName = name; SetFlags(GetFlags() | wxTEXT_ATTR_LIST_STYLE_NAME); } - void SetParagraphSpacingAfter(int spacing) { m_paragraphSpacingAfter = spacing; m_flags |= wxTEXT_ATTR_PARA_SPACING_AFTER; } - void SetParagraphSpacingBefore(int spacing) { m_paragraphSpacingBefore = spacing; m_flags |= wxTEXT_ATTR_PARA_SPACING_BEFORE; } - void SetLineSpacing(int spacing) { m_lineSpacing = spacing; m_flags |= wxTEXT_ATTR_LINE_SPACING; } - void SetBulletStyle(int style) { m_bulletStyle = style; m_flags |= wxTEXT_ATTR_BULLET_STYLE; } - void SetBulletNumber(int n) { m_bulletNumber = n; m_flags |= wxTEXT_ATTR_BULLET_NUMBER; } - void SetBulletText(const wxString& text) { m_bulletText = text; m_flags |= wxTEXT_ATTR_BULLET_TEXT; } - void SetBulletFont(const wxString& bulletFont) { m_bulletFont = bulletFont; } - void SetBulletName(const wxString& name) { m_bulletName = name; m_flags |= wxTEXT_ATTR_BULLET_NAME; } - void SetURL(const wxString& url) { m_urlTarget = url; m_flags |= wxTEXT_ATTR_URL; } - void SetPageBreak(bool pageBreak = true) { SetFlags(pageBreak ? (GetFlags() | wxTEXT_ATTR_PAGE_BREAK) : (GetFlags() & ~wxTEXT_ATTR_PAGE_BREAK)); } - void SetTextEffects(int effects) { m_textEffects = effects; SetFlags(GetFlags() | wxTEXT_ATTR_EFFECTS); } - void SetTextEffectFlags(int effects) { m_textEffectFlags = effects; } - void SetOutlineLevel(int level) { m_outlineLevel = level; SetFlags(GetFlags() | wxTEXT_ATTR_OUTLINE_LEVEL); } - - const wxColour& GetTextColour() const { return m_colText; } - const wxColour& GetBackgroundColour() const { return m_colBack; } - wxTextAttrAlignment GetAlignment() const { return m_textAlignment; } - const wxArrayInt& GetTabs() const { return m_tabs; } - long GetLeftIndent() const { return m_leftIndent; } - long GetLeftSubIndent() const { return m_leftSubIndent; } - long GetRightIndent() const { return m_rightIndent; } - long GetFlags() const { return m_flags; } - - int GetFontSize() const { return m_fontSize; } - int GetFontStyle() const { return m_fontStyle; } - int GetFontWeight() const { return m_fontWeight; } - bool GetFontUnderlined() const { return m_fontUnderlined; } - const wxString& GetFontFaceName() const { return m_fontFaceName; } - - const wxString& GetCharacterStyleName() const { return m_characterStyleName; } - const wxString& GetParagraphStyleName() const { return m_paragraphStyleName; } - const wxString& GetListStyleName() const { return m_listStyleName; } - int GetParagraphSpacingAfter() const { return m_paragraphSpacingAfter; } - int GetParagraphSpacingBefore() const { return m_paragraphSpacingBefore; } - int GetLineSpacing() const { return m_lineSpacing; } - int GetBulletStyle() const { return m_bulletStyle; } - int GetBulletNumber() const { return m_bulletNumber; } - const wxString& GetBulletText() const { return m_bulletText; } - const wxString& GetBulletFont() const { return m_bulletFont; } - const wxString& GetBulletName() const { return m_bulletName; } - const wxString& GetURL() const { return m_urlTarget; } - int GetTextEffects() const { return m_textEffects; } - int GetTextEffectFlags() const { return m_textEffectFlags; } - int GetOutlineLevel() const { return m_outlineLevel; } - - // accessors - bool HasTextColour() const { return m_colText.Ok() && HasFlag(wxTEXT_ATTR_TEXT_COLOUR) ; } - bool HasBackgroundColour() const { return m_colBack.Ok() && HasFlag(wxTEXT_ATTR_BACKGROUND_COLOUR) ; } - bool HasAlignment() const { return (m_textAlignment != wxTEXT_ALIGNMENT_DEFAULT) && ((m_flags & wxTEXT_ATTR_ALIGNMENT) != 0) ; } - bool HasTabs() const { return (m_flags & wxTEXT_ATTR_TABS) != 0 ; } - bool HasLeftIndent() const { return (m_flags & wxTEXT_ATTR_LEFT_INDENT) != 0 ; } - bool HasRightIndent() const { return (m_flags & wxTEXT_ATTR_RIGHT_INDENT) != 0 ; } - bool HasFontWeight() const { return (m_flags & wxTEXT_ATTR_FONT_WEIGHT) != 0; } - bool HasFontSize() const { return (m_flags & wxTEXT_ATTR_FONT_SIZE) != 0; } - bool HasFontItalic() const { return (m_flags & wxTEXT_ATTR_FONT_ITALIC) != 0; } - bool HasFontUnderlined() const { return (m_flags & wxTEXT_ATTR_FONT_UNDERLINE) != 0; } - bool HasFontFaceName() const { return (m_flags & wxTEXT_ATTR_FONT_FACE) != 0; } - bool HasFont() const { return (m_flags & (wxTEXT_ATTR_FONT)) != 0; } - - bool HasParagraphSpacingAfter() const { return (m_flags & wxTEXT_ATTR_PARA_SPACING_AFTER) != 0; } - bool HasParagraphSpacingBefore() const { return (m_flags & wxTEXT_ATTR_PARA_SPACING_BEFORE) != 0; } - bool HasLineSpacing() const { return (m_flags & wxTEXT_ATTR_LINE_SPACING) != 0; } - bool HasCharacterStyleName() const { return (m_flags & wxTEXT_ATTR_CHARACTER_STYLE_NAME) != 0 && !m_characterStyleName.IsEmpty(); } - bool HasParagraphStyleName() const { return (m_flags & wxTEXT_ATTR_PARAGRAPH_STYLE_NAME) != 0 && !m_paragraphStyleName.IsEmpty(); } - bool HasListStyleName() const { return HasFlag(wxTEXT_ATTR_LIST_STYLE_NAME) || !m_listStyleName.IsEmpty(); } - bool HasBulletStyle() const { return (m_flags & wxTEXT_ATTR_BULLET_STYLE) != 0; } - bool HasBulletNumber() const { return (m_flags & wxTEXT_ATTR_BULLET_NUMBER) != 0; } - bool HasBulletText() const { return (m_flags & wxTEXT_ATTR_BULLET_TEXT) != 0; } - bool HasBulletName() const { return (m_flags & wxTEXT_ATTR_BULLET_NAME) != 0; } - bool HasURL() const { return HasFlag(wxTEXT_ATTR_URL); } - bool HasPageBreak() const { return HasFlag(wxTEXT_ATTR_PAGE_BREAK); } - bool HasTextEffects() const { return HasFlag(wxTEXT_ATTR_EFFECTS); } - bool HasTextEffect(int effect) const { return HasFlag(wxTEXT_ATTR_EFFECTS) && ((GetTextEffectFlags() & effect) != 0); } - bool HasOutlineLevel() const { return HasFlag(wxTEXT_ATTR_OUTLINE_LEVEL); } - - bool HasFlag(long flag) const { return (m_flags & flag) != 0; } - - // Is this a character style? - bool IsCharacterStyle() const { return (0 != (GetFlags() & wxTEXT_ATTR_CHARACTER)); } - bool IsParagraphStyle() const { return (0 != (GetFlags() & wxTEXT_ATTR_PARAGRAPH)); } - - // returns false if we have any attributes set, true otherwise - bool IsDefault() const - { - return GetFlags() == 0; - } - - // Merges the given attributes. Does not affect 'this'. If compareWith - // is non-NULL, then it will be used to mask out those attributes that are the same in style - // and compareWith, for situations where we don't want to explicitly set inherited attributes. - bool Apply(const wxRichTextAttr& style, const wxRichTextAttr* compareWith = NULL); - - // Merges the given attributes and returns the result. Does not affect 'this'. If compareWith - // is non-NULL, then it will be used to mask out those attributes that are the same in style - // and compareWith, for situations where we don't want to explicitly set inherited attributes. - wxRichTextAttr Combine(const wxRichTextAttr& style, const wxRichTextAttr* compareWith = NULL) const; - -private: - long m_flags; - - // Paragraph styles - wxArrayInt m_tabs; // array of int: tab stops in 1/10 mm - int m_leftIndent; // left indent in 1/10 mm - int m_leftSubIndent; // left indent for all but the first - // line in a paragraph relative to the - // first line, in 1/10 mm - int m_rightIndent; // right indent in 1/10 mm - wxTextAttrAlignment m_textAlignment; - - int m_paragraphSpacingAfter; - int m_paragraphSpacingBefore; - int m_lineSpacing; - int m_bulletStyle; - int m_bulletNumber; - int m_textEffects; - int m_textEffectFlags; - int m_outlineLevel; - wxString m_bulletText; - wxString m_bulletFont; - wxString m_bulletName; - wxString m_urlTarget; - - // Character styles - wxColour m_colText, - m_colBack; - int m_fontSize; - int m_fontStyle; - int m_fontWeight; - bool m_fontUnderlined; - wxString m_fontFaceName; - - // Character style - wxString m_characterStyleName; - - // Paragraph style - wxString m_paragraphStyleName; - - // List style - wxString m_listStyleName; -}; - -/*! - * wxRichTextObject class declaration - * This is the base for drawable objects. - */ - -class WXDLLIMPEXP_RICHTEXT wxRichTextObject: public wxObject -{ - DECLARE_CLASS(wxRichTextObject) -public: -// Constructors - - wxRichTextObject(wxRichTextObject* parent = NULL); - virtual ~wxRichTextObject(); - -// Overrideables - - /// Draw the item, within the given range. Some objects may ignore the range (for - /// example paragraphs) while others must obey it (lines, to implement wrapping) - virtual bool Draw(wxDC& dc, const wxRichTextRange& range, const wxRichTextRange& selectionRange, const wxRect& rect, int descent, int style) = 0; - - /// Lay the item out at the specified position with the given size constraint. - /// Layout must set the cached size. - virtual bool Layout(wxDC& dc, const wxRect& rect, int style) = 0; - - /// Hit-testing: returns a flag indicating hit test details, plus - /// information about position - virtual int HitTest(wxDC& WXUNUSED(dc), const wxPoint& WXUNUSED(pt), long& WXUNUSED(textPosition)) { return false; } - - /// Finds the absolute position and row height for the given character position - virtual bool FindPosition(wxDC& WXUNUSED(dc), long WXUNUSED(index), wxPoint& WXUNUSED(pt), int* WXUNUSED(height), bool WXUNUSED(forceLineStart)) { return false; } - - /// Get the best size, i.e. the ideal starting size for this object irrespective - /// of available space. For a short text string, it will be the size that exactly encloses - /// the text. For a longer string, it might use the parent width for example. - virtual wxSize GetBestSize() const { return m_size; } - - /// Get the object size for the given range. Returns false if the range - /// is invalid for this object. - virtual bool GetRangeSize(const wxRichTextRange& range, wxSize& size, int& descent, wxDC& dc, int flags, wxPoint position = wxPoint(0,0)) const = 0; - - /// Do a split, returning an object containing the second part, and setting - /// the first part in 'this'. - virtual wxRichTextObject* DoSplit(long WXUNUSED(pos)) { return NULL; } - - /// Calculate range. By default, guess that the object is 1 unit long. - virtual void CalculateRange(long start, long& end) { end = start ; m_range.SetRange(start, end); } - - /// Delete range - virtual bool DeleteRange(const wxRichTextRange& WXUNUSED(range)) { return false; } - - /// Returns true if the object is empty - virtual bool IsEmpty() const { return false; } - - /// Get any text in this object for the given range - virtual wxString GetTextForRange(const wxRichTextRange& WXUNUSED(range)) const { return wxEmptyString; } - - /// Returns true if this object can merge itself with the given one. - virtual bool CanMerge(wxRichTextObject* WXUNUSED(object)) const { return false; } - - /// Returns true if this object merged itself with the given one. - /// The calling code will then delete the given object. - virtual bool Merge(wxRichTextObject* WXUNUSED(object)) { return false; } - - /// Dump to output stream for debugging - virtual void Dump(wxTextOutputStream& stream); - -// Accessors - - /// Get/set the cached object size as calculated by Layout. - virtual wxSize GetCachedSize() const { return m_size; } - virtual void SetCachedSize(const wxSize& sz) { m_size = sz; } - - /// Get/set the object position - virtual wxPoint GetPosition() const { return m_pos; } - virtual void SetPosition(const wxPoint& pos) { m_pos = pos; } - - /// Get the rectangle enclosing the object - virtual wxRect GetRect() const { return wxRect(GetPosition(), GetCachedSize()); } - - /// Set the range - void SetRange(const wxRichTextRange& range) { m_range = range; } - - /// Get the range - const wxRichTextRange& GetRange() const { return m_range; } - wxRichTextRange& GetRange() { return m_range; } - - /// Get/set dirty flag (whether the object needs Layout to be called) - virtual bool GetDirty() const { return m_dirty; } - virtual void SetDirty(bool dirty) { m_dirty = dirty; } - - /// Is this composite? - virtual bool IsComposite() const { return false; } - - /// Get/set the parent. - virtual wxRichTextObject* GetParent() const { return m_parent; } - virtual void SetParent(wxRichTextObject* parent) { m_parent = parent; } - - /// Set the margin around the object - virtual void SetMargins(int margin); - virtual void SetMargins(int leftMargin, int rightMargin, int topMargin, int bottomMargin); - virtual int GetLeftMargin() const { return m_leftMargin; } - virtual int GetRightMargin() const { return m_rightMargin; } - virtual int GetTopMargin() const { return m_topMargin; } - virtual int GetBottomMargin() const { return m_bottomMargin; } - - /// Set attributes object - void SetAttributes(const wxTextAttrEx& attr) { m_attributes = attr; } - const wxTextAttrEx& GetAttributes() const { return m_attributes; } - wxTextAttrEx& GetAttributes() { return m_attributes; } - - /// Set/get stored descent - void SetDescent(int descent) { m_descent = descent; } - int GetDescent() const { return m_descent; } - - /// Gets the containing buffer - wxRichTextBuffer* GetBuffer() const; - -// Operations - - /// Clone the object - virtual wxRichTextObject* Clone() const { return NULL; } - - /// Copy - void Copy(const wxRichTextObject& obj); - - /// Reference-counting allows us to use the same object in multiple - /// lists (not yet used) - void Reference() { m_refCount ++; } - void Dereference(); - - /// Convert units in tenths of a millimetre to device units - int ConvertTenthsMMToPixels(wxDC& dc, int units); - static int ConvertTenthsMMToPixels(int ppi, int units); - -protected: - wxSize m_size; - wxPoint m_pos; - int m_descent; // Descent for this object (if any) - bool m_dirty; - int m_refCount; - wxRichTextObject* m_parent; - - /// The range of this object (start position to end position) - wxRichTextRange m_range; - - /// Margins - int m_leftMargin; - int m_rightMargin; - int m_topMargin; - int m_bottomMargin; - - /// Attributes - wxTextAttrEx m_attributes; -}; - -WX_DECLARE_LIST_WITH_DECL( wxRichTextObject, wxRichTextObjectList, class WXDLLIMPEXP_RICHTEXT ); - -/*! - * wxRichTextCompositeObject class declaration - * Objects of this class can contain other objects. - */ - -class WXDLLIMPEXP_RICHTEXT wxRichTextCompositeObject: public wxRichTextObject -{ - DECLARE_CLASS(wxRichTextCompositeObject) -public: -// Constructors - - wxRichTextCompositeObject(wxRichTextObject* parent = NULL); - virtual ~wxRichTextCompositeObject(); - -// Overrideables - - /// Hit-testing: returns a flag indicating hit test details, plus - /// information about position - virtual int HitTest(wxDC& dc, const wxPoint& pt, long& textPosition); - - /// Finds the absolute position and row height for the given character position - virtual bool FindPosition(wxDC& dc, long index, wxPoint& pt, int* height, bool forceLineStart); - - /// Calculate range - virtual void CalculateRange(long start, long& end); - - /// Delete range - virtual bool DeleteRange(const wxRichTextRange& range); - - /// Get any text in this object for the given range - virtual wxString GetTextForRange(const wxRichTextRange& range) const; - - /// Dump to output stream for debugging - virtual void Dump(wxTextOutputStream& stream); - -// Accessors - - /// Get the children - wxRichTextObjectList& GetChildren() { return m_children; } - const wxRichTextObjectList& GetChildren() const { return m_children; } - - /// Get the child count - size_t GetChildCount() const ; - - /// Get the nth child - wxRichTextObject* GetChild(size_t n) const ; - - /// Get/set dirty flag - virtual bool GetDirty() const { return m_dirty; } - virtual void SetDirty(bool dirty) { m_dirty = dirty; } - - /// Is this composite? - virtual bool IsComposite() const { return true; } - - /// Returns true if the buffer is empty - virtual bool IsEmpty() const { return GetChildCount() == 0; } - -// Operations - - /// Copy - void Copy(const wxRichTextCompositeObject& obj); - - /// Assignment - void operator= (const wxRichTextCompositeObject& obj) { Copy(obj); } - - /// Append a child, returning the position - size_t AppendChild(wxRichTextObject* child) ; - - /// Insert the child in front of the given object, or at the beginning - bool InsertChild(wxRichTextObject* child, wxRichTextObject* inFrontOf) ; - - /// Delete the child - bool RemoveChild(wxRichTextObject* child, bool deleteChild = false) ; - - /// Delete all children - bool DeleteChildren() ; - - /// Recursively merge all pieces that can be merged. - bool Defragment(); - -protected: - wxRichTextObjectList m_children; -}; - -/*! - * wxRichTextBox class declaration - * This defines a 2D space to lay out objects - */ - -class WXDLLIMPEXP_RICHTEXT wxRichTextBox: public wxRichTextCompositeObject -{ - DECLARE_DYNAMIC_CLASS(wxRichTextBox) -public: -// Constructors - - wxRichTextBox(wxRichTextObject* parent = NULL); - wxRichTextBox(const wxRichTextBox& obj): wxRichTextCompositeObject() { Copy(obj); } - -// Overrideables - - /// Draw the item - virtual bool Draw(wxDC& dc, const wxRichTextRange& range, const wxRichTextRange& selectionRange, const wxRect& rect, int descent, int style); - - /// Lay the item out - virtual bool Layout(wxDC& dc, const wxRect& rect, int style); - - /// Get/set the object size for the given range. Returns false if the range - /// is invalid for this object. - virtual bool GetRangeSize(const wxRichTextRange& range, wxSize& size, int& descent, wxDC& dc, int flags, wxPoint position = wxPoint(0,0)) const; - -// Accessors - -// Operations - - /// Clone - virtual wxRichTextObject* Clone() const { return new wxRichTextBox(*this); } - - /// Copy - void Copy(const wxRichTextBox& obj); - -protected: -}; - -/*! - * wxRichTextParagraphBox class declaration - * This box knows how to lay out paragraphs. - */ - -class WXDLLIMPEXP_RICHTEXT wxRichTextParagraphLayoutBox: public wxRichTextBox -{ - DECLARE_DYNAMIC_CLASS(wxRichTextParagraphLayoutBox) -public: -// Constructors - - wxRichTextParagraphLayoutBox(wxRichTextObject* parent = NULL); - wxRichTextParagraphLayoutBox(const wxRichTextParagraphLayoutBox& obj): wxRichTextBox() { Init(); Copy(obj); } - -// Overrideables - - /// Draw the item - virtual bool Draw(wxDC& dc, const wxRichTextRange& range, const wxRichTextRange& selectionRange, const wxRect& rect, int descent, int style); - - /// Lay the item out - virtual bool Layout(wxDC& dc, const wxRect& rect, int style); - - /// Get/set the object size for the given range. Returns false if the range - /// is invalid for this object. - virtual bool GetRangeSize(const wxRichTextRange& range, wxSize& size, int& descent, wxDC& dc, int flags, wxPoint position = wxPoint(0,0)) const; - - /// Delete range - virtual bool DeleteRange(const wxRichTextRange& range); - - /// Get any text in this object for the given range - virtual wxString GetTextForRange(const wxRichTextRange& range) const; - -// Accessors - - /// Associate a control with the buffer, for operations that for example require refreshing the window. - void SetRichTextCtrl(wxRichTextCtrl* ctrl) { m_ctrl = ctrl; } - - /// Get the associated control. - wxRichTextCtrl* GetRichTextCtrl() const { return m_ctrl; } - - /// Get/set whether the last paragraph is partial or complete - void SetPartialParagraph(bool partialPara) { m_partialParagraph = partialPara; } - bool GetPartialParagraph() const { return m_partialParagraph; } - - /// If this is a buffer, returns the current style sheet. The base layout box - /// class doesn't have an associated style sheet. - virtual wxRichTextStyleSheet* GetStyleSheet() const { return NULL; } - -// Operations - - /// Initialize the object. - void Init(); - - /// Clear all children - virtual void Clear(); - - /// Clear and initialize with one blank paragraph - virtual void Reset(); - - /// Convenience function to add a paragraph of text - virtual wxRichTextRange AddParagraph(const wxString& text, wxTextAttrEx* paraStyle = NULL); - - /// Convenience function to add an image - virtual wxRichTextRange AddImage(const wxImage& image, wxTextAttrEx* paraStyle = NULL); - - /// Adds multiple paragraphs, based on newlines. - virtual wxRichTextRange AddParagraphs(const wxString& text, wxTextAttrEx* paraStyle = NULL); - - /// Get the line at the given position. If caretPosition is true, the position is - /// a caret position, which is normally a smaller number. - virtual wxRichTextLine* GetLineAtPosition(long pos, bool caretPosition = false) const; - - /// Get the line at the given y pixel position, or the last line. - virtual wxRichTextLine* GetLineAtYPosition(int y) const; - - /// Get the paragraph at the given character or caret position - virtual wxRichTextParagraph* GetParagraphAtPosition(long pos, bool caretPosition = false) const; - - /// Get the line size at the given position - virtual wxSize GetLineSizeAtPosition(long pos, bool caretPosition = false) const; - - /// Given a position, get the number of the visible line (potentially many to a paragraph), - /// starting from zero at the start of the buffer. We also have to pass a bool (startOfLine) - /// that indicates whether the caret is being shown at the end of the previous line or at the start - /// of the next, since the caret can be shown at 2 visible positions for the same underlying - /// position. - virtual long GetVisibleLineNumber(long pos, bool caretPosition = false, bool startOfLine = false) const; - - /// Given a line number, get the corresponding wxRichTextLine object. - virtual wxRichTextLine* GetLineForVisibleLineNumber(long lineNumber) const; - - /// Get the leaf object in a paragraph at this position. - /// Given a line number, get the corresponding wxRichTextLine object. - virtual wxRichTextObject* GetLeafObjectAtPosition(long position) const; - - /// Get the paragraph by number - virtual wxRichTextParagraph* GetParagraphAtLine(long paragraphNumber) const; - - /// Get the paragraph for a given line - virtual wxRichTextParagraph* GetParagraphForLine(wxRichTextLine* line) const; - - /// Get the length of the paragraph - virtual int GetParagraphLength(long paragraphNumber) const; - - /// Get the number of paragraphs - virtual int GetParagraphCount() const { return wx_static_cast(int, GetChildCount()); } - - /// Get the number of visible lines - virtual int GetLineCount() const; - - /// Get the text of the paragraph - virtual wxString GetParagraphText(long paragraphNumber) const; - - /// Convert zero-based line column and paragraph number to a position. - virtual long XYToPosition(long x, long y) const; - - /// Convert zero-based position to line column and paragraph number - virtual bool PositionToXY(long pos, long* x, long* y) const; - - /// Set text attributes: character and/or paragraph styles. - virtual bool SetStyle(const wxRichTextRange& range, const wxRichTextAttr& style, int flags = wxRICHTEXT_SETSTYLE_WITH_UNDO); - virtual bool SetStyle(const wxRichTextRange& range, const wxTextAttrEx& style, int flags = wxRICHTEXT_SETSTYLE_WITH_UNDO); - - /// Get the conbined text attributes for this position. - virtual bool GetStyle(long position, wxTextAttrEx& style); - virtual bool GetStyle(long position, wxRichTextAttr& style); - - /// Get the content (uncombined) attributes for this position. - virtual bool GetUncombinedStyle(long position, wxTextAttrEx& style); - virtual bool GetUncombinedStyle(long position, wxRichTextAttr& style); - - /// Implementation helper for GetStyle. If combineStyles is true, combine base, paragraph and - /// context attributes. - virtual bool DoGetStyle(long position, wxTextAttrEx& style, bool combineStyles = true); - - /// Get the combined style for a range - if any attribute is different within the range, - /// that attribute is not present within the flags - virtual bool GetStyleForRange(const wxRichTextRange& range, wxTextAttrEx& style); - - /// Combines 'style' with 'currentStyle' for the purpose of summarising the attributes of a range of - /// content. - bool CollectStyle(wxTextAttrEx& currentStyle, const wxTextAttrEx& style, long& multipleStyleAttributes, int& multipleTextEffectAttributes); - - /// Set list style - virtual bool SetListStyle(const wxRichTextRange& range, wxRichTextListStyleDefinition* def, int flags = wxRICHTEXT_SETSTYLE_WITH_UNDO, int startFrom = 1, int specifiedLevel = -1); - virtual bool SetListStyle(const wxRichTextRange& range, const wxString& defName, int flags = wxRICHTEXT_SETSTYLE_WITH_UNDO, int startFrom = 1, int specifiedLevel = -1); - - /// Clear list for given range - virtual bool ClearListStyle(const wxRichTextRange& range, int flags = wxRICHTEXT_SETSTYLE_WITH_UNDO); - - /// Number/renumber any list elements in the given range. - /// def/defName can be NULL/empty to indicate that the existing list style should be used. - virtual bool NumberList(const wxRichTextRange& range, wxRichTextListStyleDefinition* def = NULL, int flags = wxRICHTEXT_SETSTYLE_WITH_UNDO, int startFrom = 1, int specifiedLevel = -1); - virtual bool NumberList(const wxRichTextRange& range, const wxString& defName, int flags = wxRICHTEXT_SETSTYLE_WITH_UNDO, int startFrom = 1, int specifiedLevel = -1); - - /// Promote the list items within the given range. promoteBy can be a positive or negative number, e.g. 1 or -1 - /// def/defName can be NULL/empty to indicate that the existing list style should be used. - virtual bool PromoteList(int promoteBy, const wxRichTextRange& range, wxRichTextListStyleDefinition* def = NULL, int flags = wxRICHTEXT_SETSTYLE_WITH_UNDO, int specifiedLevel = -1); - virtual bool PromoteList(int promoteBy, const wxRichTextRange& range, const wxString& defName, int flags = wxRICHTEXT_SETSTYLE_WITH_UNDO, int specifiedLevel = -1); - - /// Helper for NumberList and PromoteList, that does renumbering and promotion simultaneously - /// def/defName can be NULL/empty to indicate that the existing list style should be used. - virtual bool DoNumberList(const wxRichTextRange& range, const wxRichTextRange& promotionRange, int promoteBy, wxRichTextListStyleDefinition* def, int flags = wxRICHTEXT_SETSTYLE_WITH_UNDO, int startFrom = 1, int specifiedLevel = -1); - - /// Fills in the attributes for numbering a paragraph after previousParagraph. - virtual bool FindNextParagraphNumber(wxRichTextParagraph* previousParagraph, wxRichTextAttr& attr) const; - - /// Test if this whole range has character attributes of the specified kind. If any - /// of the attributes are different within the range, the test fails. You - /// can use this to implement, for example, bold button updating. style must have - /// flags indicating which attributes are of interest. - virtual bool HasCharacterAttributes(const wxRichTextRange& range, const wxTextAttrEx& style) const; - virtual bool HasCharacterAttributes(const wxRichTextRange& range, const wxRichTextAttr& style) const; - - /// Test if this whole range has paragraph attributes of the specified kind. If any - /// of the attributes are different within the range, the test fails. You - /// can use this to implement, for example, centering button updating. style must have - /// flags indicating which attributes are of interest. - virtual bool HasParagraphAttributes(const wxRichTextRange& range, const wxTextAttrEx& style) const; - virtual bool HasParagraphAttributes(const wxRichTextRange& range, const wxRichTextAttr& style) const; - - /// Clone - virtual wxRichTextObject* Clone() const { return new wxRichTextParagraphLayoutBox(*this); } - - /// Insert fragment into this box at the given position. If partialParagraph is true, - /// it is assumed that the last (or only) paragraph is just a piece of data with no paragraph - /// marker. - virtual bool InsertFragment(long position, wxRichTextParagraphLayoutBox& fragment); - - /// Make a copy of the fragment corresponding to the given range, putting it in 'fragment'. - virtual bool CopyFragment(const wxRichTextRange& range, wxRichTextParagraphLayoutBox& fragment); - - /// Apply the style sheet to the buffer, for example if the styles have changed. - virtual bool ApplyStyleSheet(wxRichTextStyleSheet* styleSheet); - - /// Copy - void Copy(const wxRichTextParagraphLayoutBox& obj); - - /// Assignment - void operator= (const wxRichTextParagraphLayoutBox& obj) { Copy(obj); } - - /// Calculate ranges - virtual void UpdateRanges() { long end; CalculateRange(0, end); } - - /// Get all the text - virtual wxString GetText() const; - - /// Set default style for new content. Setting it to a default attribute - /// makes new content take on the 'basic' style. - virtual bool SetDefaultStyle(const wxTextAttrEx& style); - - /// Get default style - virtual const wxTextAttrEx& GetDefaultStyle() const { return m_defaultAttributes; } - - /// Set basic (overall) style - virtual void SetBasicStyle(const wxTextAttrEx& style) { m_attributes = style; } - virtual void SetBasicStyle(const wxRichTextAttr& style) { m_attributes = style; } - - /// Get basic (overall) style - virtual const wxTextAttrEx& GetBasicStyle() const { return m_attributes; } - - /// Invalidate the buffer. With no argument, invalidates whole buffer. - void Invalidate(const wxRichTextRange& invalidRange = wxRICHTEXT_ALL); - - /// Get invalid range, rounding to entire paragraphs if argument is true. - wxRichTextRange GetInvalidRange(bool wholeParagraphs = false) const; - -protected: - wxRichTextCtrl* m_ctrl; - wxTextAttrEx m_defaultAttributes; - - /// The invalidated range that will need full layout - wxRichTextRange m_invalidRange; - - // Is the last paragraph partial or complete? - bool m_partialParagraph; -}; - -/*! - * wxRichTextLine class declaration - * This object represents a line in a paragraph, and stores - * offsets from the start of the paragraph representing the - * start and end positions of the line. - */ - -class WXDLLIMPEXP_RICHTEXT wxRichTextLine -{ -public: -// Constructors - - wxRichTextLine(wxRichTextParagraph* parent); - wxRichTextLine(const wxRichTextLine& obj) { Init( NULL); Copy(obj); } - virtual ~wxRichTextLine() {} - -// Overrideables - -// Accessors - - /// Set the range - void SetRange(const wxRichTextRange& range) { m_range = range; } - void SetRange(long from, long to) { m_range = wxRichTextRange(from, to); } - - /// Get the parent paragraph - wxRichTextParagraph* GetParent() { return m_parent; } - - /// Get the range - const wxRichTextRange& GetRange() const { return m_range; } - wxRichTextRange& GetRange() { return m_range; } - - /// Get the absolute range - wxRichTextRange GetAbsoluteRange() const; - - /// Get/set the line size as calculated by Layout. - virtual wxSize GetSize() const { return m_size; } - virtual void SetSize(const wxSize& sz) { m_size = sz; } - - /// Get/set the object position relative to the parent - virtual wxPoint GetPosition() const { return m_pos; } - virtual void SetPosition(const wxPoint& pos) { m_pos = pos; } - - /// Get the absolute object position - virtual wxPoint GetAbsolutePosition() const; - - /// Get the rectangle enclosing the line - virtual wxRect GetRect() const { return wxRect(GetAbsolutePosition(), GetSize()); } - - /// Set/get stored descent - void SetDescent(int descent) { m_descent = descent; } - int GetDescent() const { return m_descent; } - -#if wxRICHTEXT_USE_OPTIMIZED_LINE_DRAWING - wxArrayInt& GetObjectSizes() { return m_objectSizes; } - const wxArrayInt& GetObjectSizes() const { return m_objectSizes; } -#endif - -// Operations - - /// Initialisation - void Init(wxRichTextParagraph* parent); - - /// Copy - void Copy(const wxRichTextLine& obj); - - /// Clone - virtual wxRichTextLine* Clone() const { return new wxRichTextLine(*this); } - -protected: - - /// The range of the line (start position to end position) - /// This is relative to the parent paragraph. - wxRichTextRange m_range; - - /// Size and position measured relative to top of paragraph - wxPoint m_pos; - wxSize m_size; - - /// Maximum descent for this line (location of text baseline) - int m_descent; - - // The parent object - wxRichTextParagraph* m_parent; - - // Sizes of the objects within a line so we don't have to get text extents -#if wxRICHTEXT_USE_OPTIMIZED_LINE_DRAWING - wxArrayInt m_objectSizes; -#endif -}; - -WX_DECLARE_LIST_WITH_DECL( wxRichTextLine, wxRichTextLineList , class WXDLLIMPEXP_RICHTEXT ); - -/*! - * wxRichTextParagraph class declaration - * This object represents a single paragraph (or in a straight text editor, a line). - */ - -class WXDLLIMPEXP_RICHTEXT wxRichTextParagraph: public wxRichTextBox -{ - DECLARE_DYNAMIC_CLASS(wxRichTextParagraph) -public: -// Constructors - - wxRichTextParagraph(wxRichTextObject* parent = NULL, wxTextAttrEx* style = NULL); - wxRichTextParagraph(const wxString& text, wxRichTextObject* parent = NULL, wxTextAttrEx* paraStyle = NULL, wxTextAttrEx* charStyle = NULL); - virtual ~wxRichTextParagraph(); - wxRichTextParagraph(const wxRichTextParagraph& obj): wxRichTextBox() { Copy(obj); } - -// Overrideables - - /// Draw the item - virtual bool Draw(wxDC& dc, const wxRichTextRange& range, const wxRichTextRange& selectionRange, const wxRect& rect, int descent, int style); - - /// Lay the item out - virtual bool Layout(wxDC& dc, const wxRect& rect, int style); - - /// Get/set the object size for the given range. Returns false if the range - /// is invalid for this object. - virtual bool GetRangeSize(const wxRichTextRange& range, wxSize& size, int& descent, wxDC& dc, int flags, wxPoint position = wxPoint(0,0)) const; - - /// Finds the absolute position and row height for the given character position - virtual bool FindPosition(wxDC& dc, long index, wxPoint& pt, int* height, bool forceLineStart); - - /// Hit-testing: returns a flag indicating hit test details, plus - /// information about position - virtual int HitTest(wxDC& dc, const wxPoint& pt, long& textPosition); - - /// Calculate range - virtual void CalculateRange(long start, long& end); - -// Accessors - - /// Get the cached lines - wxRichTextLineList& GetLines() { return m_cachedLines; } - -// Operations - - /// Copy - void Copy(const wxRichTextParagraph& obj); - - /// Clone - virtual wxRichTextObject* Clone() const { return new wxRichTextParagraph(*this); } - - /// Clear the cached lines - void ClearLines(); - -// Implementation - - /// Apply paragraph styles such as centering to the wrapped lines - virtual void ApplyParagraphStyle(const wxTextAttrEx& attr, const wxRect& rect); - - /// Insert text at the given position - virtual bool InsertText(long pos, const wxString& text); - - /// Split an object at this position if necessary, and return - /// the previous object, or NULL if inserting at beginning. - virtual wxRichTextObject* SplitAt(long pos, wxRichTextObject** previousObject = NULL); - - /// Move content to a list from this point - virtual void MoveToList(wxRichTextObject* obj, wxList& list); - - /// Add content back from list - virtual void MoveFromList(wxList& list); - - /// Get the plain text searching from the start or end of the range. - /// The resulting string may be shorter than the range given. - bool GetContiguousPlainText(wxString& text, const wxRichTextRange& range, bool fromStart = true); - - /// Find a suitable wrap position. wrapPosition is the last position in the line to the left - /// of the split. - bool FindWrapPosition(const wxRichTextRange& range, wxDC& dc, int availableSpace, long& wrapPosition); - - /// Find the object at the given position - wxRichTextObject* FindObjectAtPosition(long position); - - /// Get the bullet text for this paragraph. - wxString GetBulletText(); - - /// Allocate or reuse a line object - wxRichTextLine* AllocateLine(int pos); - - /// Clear remaining unused line objects, if any - bool ClearUnusedLines(int lineCount); - - /// Get combined attributes of the base style, paragraph style and character style. We use this to dynamically - /// retrieve the actual style. - wxTextAttrEx GetCombinedAttributes(const wxTextAttrEx& contentStyle) const; - - /// Get combined attributes of the base style and paragraph style. - wxTextAttrEx GetCombinedAttributes() const; - - /// Get the first position from pos that has a line break character. - long GetFirstLineBreakPosition(long pos); - - /// Create default tabstop array - static void InitDefaultTabs(); - - /// Clear default tabstop array - static void ClearDefaultTabs(); - - /// Get default tabstop array - static const wxArrayInt& GetDefaultTabs() { return sm_defaultTabs; } - -protected: - /// The lines that make up the wrapped paragraph - wxRichTextLineList m_cachedLines; - - /// Default tabstops - static wxArrayInt sm_defaultTabs; -}; - -/*! - * wxRichTextPlainText class declaration - * This object represents a single piece of text. - */ - -class WXDLLIMPEXP_RICHTEXT wxRichTextPlainText: public wxRichTextObject -{ - DECLARE_DYNAMIC_CLASS(wxRichTextPlainText) -public: -// Constructors - - wxRichTextPlainText(const wxString& text = wxEmptyString, wxRichTextObject* parent = NULL, wxTextAttrEx* style = NULL); - wxRichTextPlainText(const wxRichTextPlainText& obj): wxRichTextObject() { Copy(obj); } - -// Overrideables - - /// Draw the item - virtual bool Draw(wxDC& dc, const wxRichTextRange& range, const wxRichTextRange& selectionRange, const wxRect& rect, int descent, int style); - - /// Lay the item out - virtual bool Layout(wxDC& dc, const wxRect& rect, int style); - - /// Get/set the object size for the given range. Returns false if the range - /// is invalid for this object. - virtual bool GetRangeSize(const wxRichTextRange& range, wxSize& size, int& descent, wxDC& dc, int flags, wxPoint position/* = wxPoint(0,0)*/) const; - - /// Get any text in this object for the given range - virtual wxString GetTextForRange(const wxRichTextRange& range) const; - - /// Do a split, returning an object containing the second part, and setting - /// the first part in 'this'. - virtual wxRichTextObject* DoSplit(long pos); - - /// Calculate range - virtual void CalculateRange(long start, long& end); - - /// Delete range - virtual bool DeleteRange(const wxRichTextRange& range); - - /// Returns true if the object is empty - virtual bool IsEmpty() const { return m_text.empty(); } - - /// Returns true if this object can merge itself with the given one. - virtual bool CanMerge(wxRichTextObject* object) const; - - /// Returns true if this object merged itself with the given one. - /// The calling code will then delete the given object. - virtual bool Merge(wxRichTextObject* object); - - /// Dump to output stream for debugging - virtual void Dump(wxTextOutputStream& stream); - - /// Get the first position from pos that has a line break character. - long GetFirstLineBreakPosition(long pos); - -// Accessors - - /// Get the text - const wxString& GetText() const { return m_text; } - - /// Set the text - void SetText(const wxString& text) { m_text = text; } - -// Operations - - /// Copy - void Copy(const wxRichTextPlainText& obj); - - /// Clone - virtual wxRichTextObject* Clone() const { return new wxRichTextPlainText(*this); } -private: - bool DrawTabbedString(wxDC& dc, const wxTextAttrEx& attr, const wxRect& rect, wxString& str, wxCoord& x, wxCoord& y, bool selected); - -protected: - wxString m_text; -}; - -/*! - * wxRichTextImageBlock stores information about an image, in binary in-memory form - */ - -class WXDLLIMPEXP_FWD_BASE wxDataInputStream; -class WXDLLIMPEXP_FWD_BASE wxDataOutputStream; - -class WXDLLIMPEXP_RICHTEXT wxRichTextImageBlock: public wxObject -{ -public: - wxRichTextImageBlock(); - wxRichTextImageBlock(const wxRichTextImageBlock& block); - virtual ~wxRichTextImageBlock(); - - void Init(); - void Clear(); - - // Load the original image into a memory block. - // If the image is not a JPEG, we must convert it into a JPEG - // to conserve space. - // If it's not a JPEG we can make use of 'image', already scaled, so we don't have to - // load the image a 2nd time. - virtual bool MakeImageBlock(const wxString& filename, int imageType, wxImage& image, bool convertToJPEG = true); - - // Make an image block from the wxImage in the given - // format. - virtual bool MakeImageBlock(wxImage& image, int imageType, int quality = 80); - - // Write to a file - bool Write(const wxString& filename); - - // Write data in hex to a stream - bool WriteHex(wxOutputStream& stream); - - // Read data in hex from a stream - bool ReadHex(wxInputStream& stream, int length, int imageType); - - // Copy from 'block' - void Copy(const wxRichTextImageBlock& block); - - // Load a wxImage from the block - bool Load(wxImage& image); - -//// Operators - void operator=(const wxRichTextImageBlock& block); - -//// Accessors - - unsigned char* GetData() const { return m_data; } - size_t GetDataSize() const { return m_dataSize; } - int GetImageType() const { return m_imageType; } - - void SetData(unsigned char* image) { m_data = image; } - void SetDataSize(size_t size) { m_dataSize = size; } - void SetImageType(int imageType) { m_imageType = imageType; } - - bool Ok() const { return IsOk(); } - bool IsOk() const { return GetData() != NULL; } - - // Gets the extension for the block's type - wxString GetExtension() const; - -/// Implementation - - // Allocate and read from stream as a block of memory - static unsigned char* ReadBlock(wxInputStream& stream, size_t size); - static unsigned char* ReadBlock(const wxString& filename, size_t size); - - // Write memory block to stream - static bool WriteBlock(wxOutputStream& stream, unsigned char* block, size_t size); - - // Write memory block to file - static bool WriteBlock(const wxString& filename, unsigned char* block, size_t size); - -protected: - // Size in bytes of the image stored. - // This is in the raw, original form such as a JPEG file. - unsigned char* m_data; - size_t m_dataSize; - int m_imageType; // wxWin type id -}; - - -/*! - * wxRichTextImage class declaration - * This object represents an image. - */ - -class WXDLLIMPEXP_RICHTEXT wxRichTextImage: public wxRichTextObject -{ - DECLARE_DYNAMIC_CLASS(wxRichTextImage) -public: -// Constructors - - wxRichTextImage(wxRichTextObject* parent = NULL): wxRichTextObject(parent) { } - wxRichTextImage(const wxImage& image, wxRichTextObject* parent = NULL, wxTextAttrEx* charStyle = NULL); - wxRichTextImage(const wxRichTextImageBlock& imageBlock, wxRichTextObject* parent = NULL, wxTextAttrEx* charStyle = NULL); - wxRichTextImage(const wxRichTextImage& obj): wxRichTextObject() { Copy(obj); } - -// Overrideables - - /// Draw the item - virtual bool Draw(wxDC& dc, const wxRichTextRange& range, const wxRichTextRange& selectionRange, const wxRect& rect, int descent, int style); - - /// Lay the item out - virtual bool Layout(wxDC& dc, const wxRect& rect, int style); - - /// Get the object size for the given range. Returns false if the range - /// is invalid for this object. - virtual bool GetRangeSize(const wxRichTextRange& range, wxSize& size, int& descent, wxDC& dc, int flags, wxPoint position = wxPoint(0,0)) const; - - /// Returns true if the object is empty - virtual bool IsEmpty() const { return !m_image.Ok(); } - -// Accessors - - /// Get the image - const wxImage& GetImage() const { return m_image; } - - /// Set the image - void SetImage(const wxImage& image) { m_image = image; } - - /// Get the image block containing the raw data - wxRichTextImageBlock& GetImageBlock() { return m_imageBlock; } - -// Operations - - /// Copy - void Copy(const wxRichTextImage& obj); - - /// Clone - virtual wxRichTextObject* Clone() const { return new wxRichTextImage(*this); } - - /// Load wxImage from the block - virtual bool LoadFromBlock(); - - /// Make block from the wxImage - virtual bool MakeBlock(); - -protected: - // TODO: reduce the multiple representations of data - wxImage m_image; - wxBitmap m_bitmap; - wxRichTextImageBlock m_imageBlock; -}; - - -/*! - * wxRichTextBuffer class declaration - * This is a kind of box, used to represent the whole buffer - */ - -class WXDLLIMPEXP_FWD_RICHTEXT wxRichTextCommand; -class WXDLLIMPEXP_FWD_RICHTEXT wxRichTextAction; - -class WXDLLIMPEXP_RICHTEXT wxRichTextBuffer: public wxRichTextParagraphLayoutBox -{ - DECLARE_DYNAMIC_CLASS(wxRichTextBuffer) -public: -// Constructors - - wxRichTextBuffer() { Init(); } - wxRichTextBuffer(const wxRichTextBuffer& obj): wxRichTextParagraphLayoutBox() { Init(); Copy(obj); } - virtual ~wxRichTextBuffer() ; - -// Accessors - - /// Gets the command processor - wxCommandProcessor* GetCommandProcessor() const { return m_commandProcessor; } - - /// Set style sheet, if any. - void SetStyleSheet(wxRichTextStyleSheet* styleSheet) { m_styleSheet = styleSheet; } - virtual wxRichTextStyleSheet* GetStyleSheet() const { return m_styleSheet; } - - /// Set style sheet and notify of the change - bool SetStyleSheetAndNotify(wxRichTextStyleSheet* sheet); - - /// Push style sheet to top of stack - bool PushStyleSheet(wxRichTextStyleSheet* styleSheet); - - /// Pop style sheet from top of stack - wxRichTextStyleSheet* PopStyleSheet(); - -// Operations - - /// Initialisation - void Init(); - - /// Clears the buffer, adds an empty paragraph, and clears the command processor. - virtual void ResetAndClearCommands(); - - /// Load a file - virtual bool LoadFile(const wxString& filename, int type = wxRICHTEXT_TYPE_ANY); - - /// Save a file - virtual bool SaveFile(const wxString& filename, int type = wxRICHTEXT_TYPE_ANY); - - /// Load from a stream - virtual bool LoadFile(wxInputStream& stream, int type = wxRICHTEXT_TYPE_ANY); - - /// Save to a stream - virtual bool SaveFile(wxOutputStream& stream, int type = wxRICHTEXT_TYPE_ANY); - - /// Set the handler flags, controlling loading and saving - void SetHandlerFlags(int flags) { m_handlerFlags = flags; } - - /// Get the handler flags, controlling loading and saving - int GetHandlerFlags() const { return m_handlerFlags; } - - /// Convenience function to add a paragraph of text - virtual wxRichTextRange AddParagraph(const wxString& text, wxTextAttrEx* paraStyle = NULL) { Modify(); return wxRichTextParagraphLayoutBox::AddParagraph(text, paraStyle); } - - /// Begin collapsing undo/redo commands. Note that this may not work properly - /// if combining commands that delete or insert content, changing ranges for - /// subsequent actions. - virtual bool BeginBatchUndo(const wxString& cmdName); - - /// End collapsing undo/redo commands - virtual bool EndBatchUndo(); - - /// Collapsing commands? - virtual bool BatchingUndo() const { return m_batchedCommandDepth > 0; } - - /// Submit immediately, or delay according to whether collapsing is on - virtual bool SubmitAction(wxRichTextAction* action); - - /// Get collapsed command - virtual wxRichTextCommand* GetBatchedCommand() const { return m_batchedCommand; } - - /// Begin suppressing undo/redo commands. The way undo is suppressed may be implemented - /// differently by each command. If not dealt with by a command implementation, then - /// it will be implemented automatically by not storing the command in the undo history - /// when the action is submitted to the command processor. - virtual bool BeginSuppressUndo(); - - /// End suppressing undo/redo commands. - virtual bool EndSuppressUndo(); - - /// Collapsing commands? - virtual bool SuppressingUndo() const { return m_suppressUndo > 0; } - - /// Copy the range to the clipboard - virtual bool CopyToClipboard(const wxRichTextRange& range); - - /// Paste the clipboard content to the buffer - virtual bool PasteFromClipboard(long position); - - /// Can we paste from the clipboard? - virtual bool CanPasteFromClipboard() const; - - /// Begin using a style - virtual bool BeginStyle(const wxTextAttrEx& style); - - /// End the style - virtual bool EndStyle(); - - /// End all styles - virtual bool EndAllStyles(); - - /// Clear the style stack - virtual void ClearStyleStack(); - - /// Get the size of the style stack, for example to check correct nesting - virtual size_t GetStyleStackSize() const { return m_attributeStack.GetCount(); } - - /// Begin using bold - bool BeginBold(); - - /// End using bold - bool EndBold() { return EndStyle(); } - - /// Begin using italic - bool BeginItalic(); - - /// End using italic - bool EndItalic() { return EndStyle(); } - - /// Begin using underline - bool BeginUnderline(); - - /// End using underline - bool EndUnderline() { return EndStyle(); } - - /// Begin using point size - bool BeginFontSize(int pointSize); - - /// End using point size - bool EndFontSize() { return EndStyle(); } - - /// Begin using this font - bool BeginFont(const wxFont& font); - - /// End using a font - bool EndFont() { return EndStyle(); } - - /// Begin using this colour - bool BeginTextColour(const wxColour& colour); - - /// End using a colour - bool EndTextColour() { return EndStyle(); } - - /// Begin using alignment - bool BeginAlignment(wxTextAttrAlignment alignment); - - /// End alignment - bool EndAlignment() { return EndStyle(); } - - /// Begin left indent - bool BeginLeftIndent(int leftIndent, int leftSubIndent = 0); - - /// End left indent - bool EndLeftIndent() { return EndStyle(); } - - /// Begin right indent - bool BeginRightIndent(int rightIndent); - - /// End right indent - bool EndRightIndent() { return EndStyle(); } - - /// Begin paragraph spacing - bool BeginParagraphSpacing(int before, int after); - - /// End paragraph spacing - bool EndParagraphSpacing() { return EndStyle(); } - - /// Begin line spacing - bool BeginLineSpacing(int lineSpacing); - - /// End line spacing - bool EndLineSpacing() { return EndStyle(); } - - /// Begin numbered bullet - bool BeginNumberedBullet(int bulletNumber, int leftIndent, int leftSubIndent, int bulletStyle = wxTEXT_ATTR_BULLET_STYLE_ARABIC|wxTEXT_ATTR_BULLET_STYLE_PERIOD); - - /// End numbered bullet - bool EndNumberedBullet() { return EndStyle(); } - - /// Begin symbol bullet - bool BeginSymbolBullet(const wxString& symbol, int leftIndent, int leftSubIndent, int bulletStyle = wxTEXT_ATTR_BULLET_STYLE_SYMBOL); - - /// End symbol bullet - bool EndSymbolBullet() { return EndStyle(); } - - /// Begin standard bullet - bool BeginStandardBullet(const wxString& bulletName, int leftIndent, int leftSubIndent, int bulletStyle = wxTEXT_ATTR_BULLET_STYLE_STANDARD); - - /// End standard bullet - bool EndStandardBullet() { return EndStyle(); } - - /// Begin named character style - bool BeginCharacterStyle(const wxString& characterStyle); - - /// End named character style - bool EndCharacterStyle() { return EndStyle(); } - - /// Begin named paragraph style - bool BeginParagraphStyle(const wxString& paragraphStyle); - - /// End named character style - bool EndParagraphStyle() { return EndStyle(); } - - /// Begin named list style - bool BeginListStyle(const wxString& listStyle, int level = 1, int number = 1); - - /// End named character style - bool EndListStyle() { return EndStyle(); } - - /// Begin URL - bool BeginURL(const wxString& url, const wxString& characterStyle = wxEmptyString); - - /// End URL - bool EndURL() { return EndStyle(); } - -// Event handling - - /// Add an event handler - bool AddEventHandler(wxEvtHandler* handler); - - /// Remove an event handler - bool RemoveEventHandler(wxEvtHandler* handler, bool deleteHandler = false); - - /// Clear event handlers - void ClearEventHandlers(); - - /// Send event to event handlers. If sendToAll is true, will send to all event handlers, - /// otherwise will stop at the first successful one. - bool SendEvent(wxEvent& event, bool sendToAll = true); - -// Implementation - - /// Copy - void Copy(const wxRichTextBuffer& obj); - - /// Clone - virtual wxRichTextObject* Clone() const { return new wxRichTextBuffer(*this); } - - /// Submit command to insert paragraphs - bool InsertParagraphsWithUndo(long pos, const wxRichTextParagraphLayoutBox& paragraphs, wxRichTextCtrl* ctrl, int flags = 0); - - /// Submit command to insert the given text - bool InsertTextWithUndo(long pos, const wxString& text, wxRichTextCtrl* ctrl, int flags = 0); - - /// Submit command to insert a newline - bool InsertNewlineWithUndo(long pos, wxRichTextCtrl* ctrl, int flags = 0); - - /// Submit command to insert the given image - bool InsertImageWithUndo(long pos, const wxRichTextImageBlock& imageBlock, wxRichTextCtrl* ctrl, int flags = 0); - - /// Submit command to delete this range - bool DeleteRangeWithUndo(const wxRichTextRange& range, wxRichTextCtrl* ctrl); - - /// Mark modified - void Modify(bool modify = true) { m_modified = modify; } - bool IsModified() const { return m_modified; } - - /// Get the style that is appropriate for a new paragraph at this position. - /// If the previous paragraph has a paragraph style name, look up the next-paragraph - /// style. - wxRichTextAttr GetStyleForNewParagraph(long pos, bool caretPosition = false, bool lookUpNewParaStyle=false) const; - - /// Dumps contents of buffer for debugging purposes - virtual void Dump(); - virtual void Dump(wxTextOutputStream& stream) { wxRichTextParagraphLayoutBox::Dump(stream); } - - /// Returns the file handlers - static wxList& GetHandlers() { return sm_handlers; } - - /// Adds a handler to the end - static void AddHandler(wxRichTextFileHandler *handler); - - /// Inserts a handler at the front - static void InsertHandler(wxRichTextFileHandler *handler); - - /// Removes a handler - static bool RemoveHandler(const wxString& name); - - /// Finds a handler by name - static wxRichTextFileHandler *FindHandler(const wxString& name); - - /// Finds a handler by extension and type - static wxRichTextFileHandler *FindHandler(const wxString& extension, int imageType); - - /// Finds a handler by filename or, if supplied, type - static wxRichTextFileHandler *FindHandlerFilenameOrType(const wxString& filename, int imageType); - - /// Finds a handler by type - static wxRichTextFileHandler *FindHandler(int imageType); - - /// Gets a wildcard incorporating all visible handlers. If 'types' is present, - /// will be filled with the file type corresponding to each filter. This can be - /// used to determine the type to pass to LoadFile given a selected filter. - static wxString GetExtWildcard(bool combine = false, bool save = false, wxArrayInt* types = NULL); - - /// Clean up handlers - static void CleanUpHandlers(); - - /// Initialise the standard handlers - static void InitStandardHandlers(); - - /// Get renderer - static wxRichTextRenderer* GetRenderer() { return sm_renderer; } - - /// Set renderer, deleting old one - static void SetRenderer(wxRichTextRenderer* renderer); - - /// Minimum margin between bullet and paragraph in 10ths of a mm - static int GetBulletRightMargin() { return sm_bulletRightMargin; } - static void SetBulletRightMargin(int margin) { sm_bulletRightMargin = margin; } - - /// Factor to multiply by character height to get a reasonable bullet size - static float GetBulletProportion() { return sm_bulletProportion; } - static void SetBulletProportion(float prop) { sm_bulletProportion = prop; } - - /// Scale factor for calculating dimensions - double GetScale() const { return m_scale; } - void SetScale(double scale) { m_scale = scale; } - -protected: - - /// Command processor - wxCommandProcessor* m_commandProcessor; - - /// Has been modified? - bool m_modified; - - /// Collapsed command stack - int m_batchedCommandDepth; - - /// Name for collapsed command - wxString m_batchedCommandsName; - - /// Current collapsed command accumulating actions - wxRichTextCommand* m_batchedCommand; - - /// Whether to suppress undo - int m_suppressUndo; - - /// Style sheet, if any - wxRichTextStyleSheet* m_styleSheet; - - /// List of event handlers that will be notified of events - wxList m_eventHandlers; - - /// Stack of attributes for convenience functions - wxList m_attributeStack; - - /// Flags to be passed to handlers - int m_handlerFlags; - - /// File handlers - static wxList sm_handlers; - - /// Renderer - static wxRichTextRenderer* sm_renderer; - - /// Minimum margin between bullet and paragraph in 10ths of a mm - static int sm_bulletRightMargin; - - /// Factor to multiply by character height to get a reasonable bullet size - static float sm_bulletProportion; - - /// Scaling factor in use: needed to calculate correct dimensions when printing - double m_scale; -}; - -/*! - * The command identifiers - * - */ - -enum wxRichTextCommandId -{ - wxRICHTEXT_INSERT, - wxRICHTEXT_DELETE, - wxRICHTEXT_CHANGE_STYLE -}; - -/*! - * Command classes for undo/redo - * - */ - -class WXDLLIMPEXP_FWD_RICHTEXT wxRichTextAction; -class WXDLLIMPEXP_RICHTEXT wxRichTextCommand: public wxCommand -{ -public: - // Ctor for one action - wxRichTextCommand(const wxString& name, wxRichTextCommandId id, wxRichTextBuffer* buffer, - wxRichTextCtrl* ctrl, bool ignoreFirstTime = false); - - // Ctor for multiple actions - wxRichTextCommand(const wxString& name); - - virtual ~wxRichTextCommand(); - - bool Do(); - bool Undo(); - - void AddAction(wxRichTextAction* action); - void ClearActions(); - - wxList& GetActions() { return m_actions; } - -protected: - - wxList m_actions; -}; - -/*! - * wxRichTextAction class declaration - * There can be more than one action in a command. - */ - -class WXDLLIMPEXP_RICHTEXT wxRichTextAction: public wxObject -{ -public: - wxRichTextAction(wxRichTextCommand* cmd, const wxString& name, wxRichTextCommandId id, wxRichTextBuffer* buffer, - wxRichTextCtrl* ctrl, bool ignoreFirstTime = false); - - virtual ~wxRichTextAction(); - - bool Do(); - bool Undo(); - - /// Update the control appearance - void UpdateAppearance(long caretPosition, bool sendUpdateEvent = false, - wxArrayInt* optimizationLineCharPositions = NULL, wxArrayInt* optimizationLineYPositions = NULL); - - /// Replace the buffer paragraphs with the given fragment. - void ApplyParagraphs(const wxRichTextParagraphLayoutBox& fragment); - -#if wxABI_VERSION >= 20808 - // Create arrays to be used in refresh optimization - void CalculateRefreshOptimizations(wxArrayInt& optimizationLineCharPositions, wxArrayInt& optimizationLineYPositions); -#endif - - /// Get the fragments - wxRichTextParagraphLayoutBox& GetNewParagraphs() { return m_newParagraphs; } - wxRichTextParagraphLayoutBox& GetOldParagraphs() { return m_oldParagraphs; } - - /// Set/get the position used for e.g. insertion - void SetPosition(long pos) { m_position = pos; } - long GetPosition() const { return m_position; } - - /// Set/get the range for e.g. deletion - void SetRange(const wxRichTextRange& range) { m_range = range; } - const wxRichTextRange& GetRange() const { return m_range; } - - /// Get name - const wxString& GetName() const { return m_name; } - -protected: - // Action name - wxString m_name; - - // Buffer - wxRichTextBuffer* m_buffer; - - // Control - wxRichTextCtrl* m_ctrl; - - // Stores the new paragraphs - wxRichTextParagraphLayoutBox m_newParagraphs; - - // Stores the old paragraphs - wxRichTextParagraphLayoutBox m_oldParagraphs; - - // The affected range - wxRichTextRange m_range; - - // The insertion point for this command - long m_position; - - // Ignore 1st 'Do' operation because we already did it - bool m_ignoreThis; - - // The command identifier - wxRichTextCommandId m_cmdId; -}; - -/*! - * Handler flags - */ - -// Include style sheet when loading and saving -#define wxRICHTEXT_HANDLER_INCLUDE_STYLESHEET 0x0001 - -// Save images to memory file system in HTML handler -#define wxRICHTEXT_HANDLER_SAVE_IMAGES_TO_MEMORY 0x0010 - -// Save images to files in HTML handler -#define wxRICHTEXT_HANDLER_SAVE_IMAGES_TO_FILES 0x0020 - -// Save images as inline base64 data in HTML handler -#define wxRICHTEXT_HANDLER_SAVE_IMAGES_TO_BASE64 0x0040 - -// Don't write header and footer (or BODY), so we can include the fragment -// in a larger document -#define wxRICHTEXT_HANDLER_NO_HEADER_FOOTER 0x0080 - -// Convert the more common face names to names that will work on the current platform -// in a larger document -#define wxRICHTEXT_HANDLER_CONVERT_FACENAMES 0x0100 - -/*! - * wxRichTextFileHandler - * Base class for file handlers - */ - -class WXDLLIMPEXP_RICHTEXT wxRichTextFileHandler: public wxObject -{ - DECLARE_CLASS(wxRichTextFileHandler) -public: - wxRichTextFileHandler(const wxString& name = wxEmptyString, const wxString& ext = wxEmptyString, int type = 0) - : m_name(name), m_extension(ext), m_type(type), m_flags(0), m_visible(true) - { } - -#if wxUSE_STREAMS - bool LoadFile(wxRichTextBuffer *buffer, wxInputStream& stream) - { return DoLoadFile(buffer, stream); } - bool SaveFile(wxRichTextBuffer *buffer, wxOutputStream& stream) - { return DoSaveFile(buffer, stream); } -#endif - - bool LoadFile(wxRichTextBuffer *buffer, const wxString& filename); - bool SaveFile(wxRichTextBuffer *buffer, const wxString& filename); - - /// Can we handle this filename (if using files)? By default, checks the extension. - virtual bool CanHandle(const wxString& filename) const; - - /// Can we save using this handler? - virtual bool CanSave() const { return false; } - - /// Can we load using this handler? - virtual bool CanLoad() const { return false; } - - /// Should this handler be visible to the user? - virtual bool IsVisible() const { return m_visible; } - virtual void SetVisible(bool visible) { m_visible = visible; } - - /// The name of the nandler - void SetName(const wxString& name) { m_name = name; } - wxString GetName() const { return m_name; } - - /// The default extension to recognise - void SetExtension(const wxString& ext) { m_extension = ext; } - wxString GetExtension() const { return m_extension; } - - /// The handler type - void SetType(int type) { m_type = type; } - int GetType() const { return m_type; } - - /// Flags controlling how loading and saving is done - void SetFlags(int flags) { m_flags = flags; } - int GetFlags() const { return m_flags; } - - /// Encoding to use when saving a file. If empty, a suitable encoding is chosen - void SetEncoding(const wxString& encoding) { m_encoding = encoding; } - const wxString& GetEncoding() const { return m_encoding; } - -protected: - -#if wxUSE_STREAMS - virtual bool DoLoadFile(wxRichTextBuffer *buffer, wxInputStream& stream) = 0; - virtual bool DoSaveFile(wxRichTextBuffer *buffer, wxOutputStream& stream) = 0; -#endif - - wxString m_name; - wxString m_encoding; - wxString m_extension; - int m_type; - int m_flags; - bool m_visible; -}; - -/*! - * wxRichTextPlainTextHandler - * Plain text handler - */ - -class WXDLLIMPEXP_RICHTEXT wxRichTextPlainTextHandler: public wxRichTextFileHandler -{ - DECLARE_CLASS(wxRichTextPlainTextHandler) -public: - wxRichTextPlainTextHandler(const wxString& name = wxT("Text"), const wxString& ext = wxT("txt"), int type = wxRICHTEXT_TYPE_TEXT) - : wxRichTextFileHandler(name, ext, type) - { } - - /// Can we save using this handler? - virtual bool CanSave() const { return true; } - - /// Can we load using this handler? - virtual bool CanLoad() const { return true; } - -protected: - -#if wxUSE_STREAMS - virtual bool DoLoadFile(wxRichTextBuffer *buffer, wxInputStream& stream); - virtual bool DoSaveFile(wxRichTextBuffer *buffer, wxOutputStream& stream); -#endif - -}; - -#if wxUSE_DATAOBJ - -/*! - * The data object for a wxRichTextBuffer - */ - -class WXDLLIMPEXP_RICHTEXT wxRichTextBufferDataObject: public wxDataObjectSimple -{ -public: - // ctor doesn't copy the pointer, so it shouldn't go away while this object - // is alive - wxRichTextBufferDataObject(wxRichTextBuffer* richTextBuffer = (wxRichTextBuffer*) NULL); - virtual ~wxRichTextBufferDataObject(); - - // after a call to this function, the buffer is owned by the caller and it - // is responsible for deleting it - wxRichTextBuffer* GetRichTextBuffer(); - - // Returns the id for the new data format - static const wxChar* GetRichTextBufferFormatId() { return ms_richTextBufferFormatId; } - - // base class pure virtuals - - virtual wxDataFormat GetPreferredFormat(Direction dir) const; - virtual size_t GetDataSize() const; - virtual bool GetDataHere(void *pBuf) const; - virtual bool SetData(size_t len, const void *buf); - - // prevent warnings - - virtual size_t GetDataSize(const wxDataFormat&) const { return GetDataSize(); } - virtual bool GetDataHere(const wxDataFormat&, void *buf) const { return GetDataHere(buf); } - virtual bool SetData(const wxDataFormat&, size_t len, const void *buf) { return SetData(len, buf); } - -private: - wxDataFormat m_formatRichTextBuffer; // our custom format - wxRichTextBuffer* m_richTextBuffer; // our data - static const wxChar* ms_richTextBufferFormatId; // our format id -}; - -#endif - -/*! - * wxRichTextRenderer isolates common drawing functionality - */ - -class WXDLLIMPEXP_RICHTEXT wxRichTextRenderer: public wxObject -{ -public: - wxRichTextRenderer() {} - virtual ~wxRichTextRenderer() {} - - /// Draw a standard bullet, as specified by the value of GetBulletName - virtual bool DrawStandardBullet(wxRichTextParagraph* paragraph, wxDC& dc, const wxTextAttrEx& attr, const wxRect& rect) = 0; - - /// Draw a bullet that can be described by text, such as numbered or symbol bullets - virtual bool DrawTextBullet(wxRichTextParagraph* paragraph, wxDC& dc, const wxTextAttrEx& attr, const wxRect& rect, const wxString& text) = 0; - - /// Draw a bitmap bullet, where the bullet bitmap is specified by the value of GetBulletName - virtual bool DrawBitmapBullet(wxRichTextParagraph* paragraph, wxDC& dc, const wxTextAttrEx& attr, const wxRect& rect) = 0; - - /// Enumerate the standard bullet names currently supported - virtual bool EnumerateStandardBulletNames(wxArrayString& bulletNames) = 0; -}; - -/*! - * wxRichTextStdRenderer: standard renderer - */ - -class WXDLLIMPEXP_RICHTEXT wxRichTextStdRenderer: public wxRichTextRenderer -{ -public: - wxRichTextStdRenderer() {} - - /// Draw a standard bullet, as specified by the value of GetBulletName - virtual bool DrawStandardBullet(wxRichTextParagraph* paragraph, wxDC& dc, const wxTextAttrEx& attr, const wxRect& rect); - - /// Draw a bullet that can be described by text, such as numbered or symbol bullets - virtual bool DrawTextBullet(wxRichTextParagraph* paragraph, wxDC& dc, const wxTextAttrEx& attr, const wxRect& rect, const wxString& text); - - /// Draw a bitmap bullet, where the bullet bitmap is specified by the value of GetBulletName - virtual bool DrawBitmapBullet(wxRichTextParagraph* paragraph, wxDC& dc, const wxTextAttrEx& attr, const wxRect& rect); - - /// Enumerate the standard bullet names currently supported - virtual bool EnumerateStandardBulletNames(wxArrayString& bulletNames); -}; - -/*! - * Utilities - * - */ - -inline bool wxRichTextHasStyle(int flags, int style) -{ - return ((flags & style) == style); -} - -/// Compare two attribute objects -WXDLLIMPEXP_RICHTEXT bool wxTextAttrEq(const wxTextAttrEx& attr1, const wxTextAttrEx& attr2); -WXDLLIMPEXP_RICHTEXT bool wxTextAttrEq(const wxTextAttr& attr1, const wxRichTextAttr& attr2); - -/// Compare two attribute objects, but take into account the flags -/// specifying attributes of interest. -WXDLLIMPEXP_RICHTEXT bool wxTextAttrEqPartial(const wxTextAttrEx& attr1, const wxTextAttrEx& attr2, int flags); -WXDLLIMPEXP_RICHTEXT bool wxTextAttrEqPartial(const wxTextAttrEx& attr1, const wxRichTextAttr& attr2, int flags); - -/// Apply one style to another -WXDLLIMPEXP_RICHTEXT bool wxRichTextApplyStyle(wxTextAttrEx& destStyle, const wxTextAttrEx& style); -WXDLLIMPEXP_RICHTEXT bool wxRichTextApplyStyle(wxRichTextAttr& destStyle, const wxTextAttrEx& style); -WXDLLIMPEXP_RICHTEXT bool wxRichTextApplyStyle(wxTextAttrEx& destStyle, const wxRichTextAttr& style, wxRichTextAttr* compareWith = NULL); -WXDLLIMPEXP_RICHTEXT bool wxRichTextApplyStyle(wxRichTextAttr& destStyle, const wxRichTextAttr& style, wxRichTextAttr* compareWith = NULL); - -// Remove attributes -WXDLLIMPEXP_RICHTEXT bool wxRichTextRemoveStyle(wxTextAttrEx& destStyle, const wxRichTextAttr& style); - -/// Combine two bitlists -WXDLLIMPEXP_RICHTEXT bool wxRichTextCombineBitlists(int& valueA, int valueB, int& flagsA, int flagsB); - -/// Compare two bitlists -WXDLLIMPEXP_RICHTEXT bool wxRichTextBitlistsEqPartial(int valueA, int valueB, int flags); - -/// Split into paragraph and character styles -WXDLLIMPEXP_RICHTEXT bool wxRichTextSplitParaCharStyles(const wxTextAttrEx& style, wxTextAttrEx& parStyle, wxTextAttrEx& charStyle); - -/// Compare tabs -WXDLLIMPEXP_RICHTEXT bool wxRichTextTabsEq(const wxArrayInt& tabs1, const wxArrayInt& tabs2); - -/// Set the font without changing the font attributes -WXDLLIMPEXP_RICHTEXT void wxSetFontPreservingStyles(wxTextAttr& attr, const wxFont& font); - -/// Convert a decimal to Roman numerals -WXDLLIMPEXP_RICHTEXT wxString wxRichTextDecimalToRoman(long n); - -WXDLLIMPEXP_RICHTEXT void wxRichTextModuleInit(); - -#endif - // wxUSE_RICHTEXT - -#endif - // _WX_RICHTEXTBUFFER_H_ - diff --git a/wxWidgets/include/wx/richtext/richtextbulletspage.h b/wxWidgets/include/wx/richtext/richtextbulletspage.h deleted file mode 100644 index 0df4eb6b56..0000000000 --- a/wxWidgets/include/wx/richtext/richtextbulletspage.h +++ /dev/null @@ -1,217 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/richtext/richtextbulletspage.h -// Purpose: -// Author: Julian Smart -// Modified by: -// Created: 10/4/2006 10:32:31 AM -// RCS-ID: $Id: richtextbulletspage.h 50950 2007-12-30 16:11:12Z JS $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _RICHTEXTBULLETSPAGE_H_ -#define _RICHTEXTBULLETSPAGE_H_ - -/*! - * Includes - */ - -/*! - * Forward declarations - */ - -////@begin forward declarations -class wxSpinCtrl; -class wxRichTextCtrl; -////@end forward declarations - -/*! - * Control identifiers - */ - -////@begin control identifiers -#define SYMBOL_WXRICHTEXTBULLETSPAGE_STYLE wxRESIZE_BORDER|wxTAB_TRAVERSAL -#define SYMBOL_WXRICHTEXTBULLETSPAGE_TITLE _("wxRichTextBulletsPage") -#define SYMBOL_WXRICHTEXTBULLETSPAGE_IDNAME ID_RICHTEXTBULLETSPAGE -#define SYMBOL_WXRICHTEXTBULLETSPAGE_SIZE wxSize(400, 300) -#define SYMBOL_WXRICHTEXTBULLETSPAGE_POSITION wxDefaultPosition -////@end control identifiers - -/*! - * wxRichTextBulletsPage class declaration - */ - -class WXDLLIMPEXP_RICHTEXT wxRichTextBulletsPage: public wxPanel -{ - DECLARE_DYNAMIC_CLASS( wxRichTextBulletsPage ) - DECLARE_EVENT_TABLE() - -public: - /// Constructors - wxRichTextBulletsPage( ); - wxRichTextBulletsPage( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = SYMBOL_WXRICHTEXTBULLETSPAGE_POSITION, const wxSize& size = SYMBOL_WXRICHTEXTBULLETSPAGE_SIZE, long style = SYMBOL_WXRICHTEXTBULLETSPAGE_STYLE ); - - /// Creation - bool Create( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = SYMBOL_WXRICHTEXTBULLETSPAGE_POSITION, const wxSize& size = SYMBOL_WXRICHTEXTBULLETSPAGE_SIZE, long style = SYMBOL_WXRICHTEXTBULLETSPAGE_STYLE ); - - /// Initialise members - void Init(); - - /// Creates the controls and sizers - void CreateControls(); - - /// Updates the bullets preview - void UpdatePreview(); - - /// Transfer data from/to window - virtual bool TransferDataFromWindow(); - virtual bool TransferDataToWindow(); - - /// Gets the attributes associated with the main formatting dialog - wxTextAttrEx* GetAttributes(); - - /// Update for symbol-related controls - void OnSymbolUpdate( wxUpdateUIEvent& event ); - - /// Update for number-related controls - void OnNumberUpdate( wxUpdateUIEvent& event ); - - /// Update for standard bullet-related controls - void OnStandardBulletUpdate( wxUpdateUIEvent& event ); - -////@begin wxRichTextBulletsPage event handler declarations - - /// wxEVT_COMMAND_LISTBOX_SELECTED event handler for ID_RICHTEXTBULLETSPAGE_STYLELISTBOX - void OnStylelistboxSelected( wxCommandEvent& event ); - - /// wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_RICHTEXTBULLETSPAGE_PERIODCTRL - void OnPeriodctrlClick( wxCommandEvent& event ); - - /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTBULLETSPAGE_PERIODCTRL - void OnPeriodctrlUpdate( wxUpdateUIEvent& event ); - - /// wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_RICHTEXTBULLETSPAGE_PARENTHESESCTRL - void OnParenthesesctrlClick( wxCommandEvent& event ); - - /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTBULLETSPAGE_PARENTHESESCTRL - void OnParenthesesctrlUpdate( wxUpdateUIEvent& event ); - - /// wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_RICHTEXTBULLETSPAGE_RIGHTPARENTHESISCTRL - void OnRightParenthesisCtrlClick( wxCommandEvent& event ); - - /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTBULLETSPAGE_RIGHTPARENTHESISCTRL - void OnRightParenthesisCtrlUpdate( wxUpdateUIEvent& event ); - - /// wxEVT_COMMAND_COMBOBOX_SELECTED event handler for ID_RICHTEXTBULLETSPAGE_BULLETALIGNMENTCTRL - void OnBulletAlignmentCtrlSelected( wxCommandEvent& event ); - - /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTBULLETSPAGE_SYMBOLSTATIC - void OnSymbolstaticUpdate( wxUpdateUIEvent& event ); - - /// wxEVT_COMMAND_COMBOBOX_SELECTED event handler for ID_RICHTEXTBULLETSPAGE_SYMBOLCTRL - void OnSymbolctrlSelected( wxCommandEvent& event ); - - /// wxEVT_COMMAND_TEXT_UPDATED event handler for ID_RICHTEXTBULLETSPAGE_SYMBOLCTRL - void OnSymbolctrlUpdated( wxCommandEvent& event ); - - /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTBULLETSPAGE_SYMBOLCTRL - void OnSymbolctrlUpdate( wxUpdateUIEvent& event ); - - /// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_RICHTEXTBULLETSPAGE_CHOOSE_SYMBOL - void OnChooseSymbolClick( wxCommandEvent& event ); - - /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTBULLETSPAGE_CHOOSE_SYMBOL - void OnChooseSymbolUpdate( wxUpdateUIEvent& event ); - - /// wxEVT_COMMAND_COMBOBOX_SELECTED event handler for ID_RICHTEXTBULLETSPAGE_SYMBOLFONTCTRL - void OnSymbolfontctrlSelected( wxCommandEvent& event ); - - /// wxEVT_COMMAND_TEXT_UPDATED event handler for ID_RICHTEXTBULLETSPAGE_SYMBOLFONTCTRL - void OnSymbolfontctrlUpdated( wxCommandEvent& event ); - - /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTBULLETSPAGE_SYMBOLFONTCTRL - void OnSymbolfontctrlUIUpdate( wxUpdateUIEvent& event ); - - /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTBULLETSPAGE_NAMESTATIC - void OnNamestaticUpdate( wxUpdateUIEvent& event ); - - /// wxEVT_COMMAND_COMBOBOX_SELECTED event handler for ID_RICHTEXTBULLETSPAGE_NAMECTRL - void OnNamectrlSelected( wxCommandEvent& event ); - - /// wxEVT_COMMAND_TEXT_UPDATED event handler for ID_RICHTEXTBULLETSPAGE_NAMECTRL - void OnNamectrlUpdated( wxCommandEvent& event ); - - /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTBULLETSPAGE_NAMECTRL - void OnNamectrlUIUpdate( wxUpdateUIEvent& event ); - - /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTBULLETSPAGE_NUMBERSTATIC - void OnNumberstaticUpdate( wxUpdateUIEvent& event ); - - /// wxEVT_COMMAND_SPINCTRL_UPDATED event handler for ID_RICHTEXTBULLETSPAGE_NUMBERCTRL - void OnNumberctrlUpdated( wxSpinEvent& event ); - - /// wxEVT_SCROLL_LINEUP event handler for ID_RICHTEXTBULLETSPAGE_NUMBERCTRL - void OnNumberctrlUp( wxSpinEvent& event ); - - /// wxEVT_SCROLL_LINEDOWN event handler for ID_RICHTEXTBULLETSPAGE_NUMBERCTRL - void OnNumberctrlDown( wxSpinEvent& event ); - - /// wxEVT_COMMAND_TEXT_UPDATED event handler for ID_RICHTEXTBULLETSPAGE_NUMBERCTRL - void OnNumberctrlTextUpdated( wxCommandEvent& event ); - - /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTBULLETSPAGE_NUMBERCTRL - void OnNumberctrlUpdate( wxUpdateUIEvent& event ); - -////@end wxRichTextBulletsPage event handler declarations - -////@begin wxRichTextBulletsPage member function declarations - - /// Retrieves bitmap resources - wxBitmap GetBitmapResource( const wxString& name ); - - /// Retrieves icon resources - wxIcon GetIconResource( const wxString& name ); -////@end wxRichTextBulletsPage member function declarations - - /// Should we show tooltips? - static bool ShowToolTips(); - -////@begin wxRichTextBulletsPage member variables - wxListBox* m_styleListBox; - wxCheckBox* m_periodCtrl; - wxCheckBox* m_parenthesesCtrl; - wxCheckBox* m_rightParenthesisCtrl; - wxComboBox* m_bulletAlignmentCtrl; - wxComboBox* m_symbolCtrl; - wxComboBox* m_symbolFontCtrl; - wxComboBox* m_bulletNameCtrl; - wxSpinCtrl* m_numberCtrl; - wxRichTextCtrl* m_previewCtrl; - /// Control identifiers - enum { - ID_RICHTEXTBULLETSPAGE = 10300, - ID_RICHTEXTBULLETSPAGE_STYLELISTBOX = 10305, - ID_RICHTEXTBULLETSPAGE_PERIODCTRL = 10313, - ID_RICHTEXTBULLETSPAGE_PARENTHESESCTRL = 10311, - ID_RICHTEXTBULLETSPAGE_RIGHTPARENTHESISCTRL = 10306, - ID_RICHTEXTBULLETSPAGE_BULLETALIGNMENTCTRL = 10315, - ID_RICHTEXTBULLETSPAGE_SYMBOLSTATIC = 10301, - ID_RICHTEXTBULLETSPAGE_SYMBOLCTRL = 10307, - ID_RICHTEXTBULLETSPAGE_CHOOSE_SYMBOL = 10308, - ID_RICHTEXTBULLETSPAGE_SYMBOLFONTCTRL = 10309, - ID_RICHTEXTBULLETSPAGE_NAMESTATIC = 10303, - ID_RICHTEXTBULLETSPAGE_NAMECTRL = 10304, - ID_RICHTEXTBULLETSPAGE_NUMBERSTATIC = 10302, - ID_RICHTEXTBULLETSPAGE_NUMBERCTRL = 10310, - ID_RICHTEXTBULLETSPAGE_PREVIEW_CTRL = 10314 - }; -////@end wxRichTextBulletsPage member variables - - bool m_hasBulletStyle; - bool m_hasBulletNumber; - bool m_hasBulletSymbol; - bool m_dontUpdate; -}; - -#endif - // _RICHTEXTBULLETSPAGE_H_ diff --git a/wxWidgets/include/wx/richtext/richtextctrl.h b/wxWidgets/include/wx/richtext/richtextctrl.h deleted file mode 100644 index a0bed00491..0000000000 --- a/wxWidgets/include/wx/richtext/richtextctrl.h +++ /dev/null @@ -1,984 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/richtext/richtextctrl.h -// Purpose: A rich edit control -// Author: Julian Smart -// Modified by: -// Created: 2005-09-30 -// RCS-ID: $Id: richtextctrl.h 62194 2009-09-29 06:45:04Z JS $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_RICHTEXTCTRL_H_ -#define _WX_RICHTEXTCTRL_H_ - -#include "wx/richtext/richtextbuffer.h" - -#if wxUSE_RICHTEXT - -#include "wx/scrolwin.h" -#include "wx/caret.h" - -#include "wx/textctrl.h" - -#if !defined(__WXGTK__) && !defined(__WXMAC__) -#define wxRICHTEXT_BUFFERED_PAINTING 1 -#else -#define wxRICHTEXT_BUFFERED_PAINTING 0 -#endif - -class WXDLLIMPEXP_FWD_RICHTEXT wxRichTextStyleDefinition; - -/*! - * Styles and flags - */ - -/* Styles - */ - -#define wxRE_READONLY 0x0010 -#define wxRE_MULTILINE 0x0020 -#define wxRE_CENTRE_CARET 0x8000 -#define wxRE_CENTER_CARET wxRE_CENTRE_CARET - -/* Flags - */ - -#define wxRICHTEXT_SHIFT_DOWN 0x01 -#define wxRICHTEXT_CTRL_DOWN 0x02 -#define wxRICHTEXT_ALT_DOWN 0x04 - -/* Defaults - */ - -#define wxRICHTEXT_DEFAULT_OVERALL_SIZE wxSize(-1, -1) -#define wxRICHTEXT_DEFAULT_IMAGE_SIZE wxSize(80, 80) -#define wxRICHTEXT_DEFAULT_SPACING 3 -#define wxRICHTEXT_DEFAULT_MARGIN 3 -#define wxRICHTEXT_DEFAULT_UNFOCUSSED_BACKGROUND wxColour(175, 175, 175) -#define wxRICHTEXT_DEFAULT_FOCUSSED_BACKGROUND wxColour(140, 140, 140) -#define wxRICHTEXT_DEFAULT_UNSELECTED_BACKGROUND wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE) -#define wxRICHTEXT_DEFAULT_TYPE_COLOUR wxColour(0, 0, 200) -#define wxRICHTEXT_DEFAULT_FOCUS_RECT_COLOUR wxColour(100, 80, 80) -#define wxRICHTEXT_DEFAULT_CARET_WIDTH 2 -// Minimum buffer size before delayed layout kicks in -#define wxRICHTEXT_DEFAULT_DELAYED_LAYOUT_THRESHOLD 20000 -// Milliseconds before layout occurs after resize -#define wxRICHTEXT_DEFAULT_LAYOUT_INTERVAL 50 - -/*! - * Forward declarations - */ - -/*! - * wxRichTextItem class declaration - */ - -// Drawing styles/states -#define wxRICHTEXT_SELECTED 0x01 -#define wxRICHTEXT_TAGGED 0x02 -// The control is focussed -#define wxRICHTEXT_FOCUSSED 0x04 -// The item itself has the focus -#define wxRICHTEXT_IS_FOCUS 0x08 - -/*! - * wxRichTextCtrl class declaration - */ - -class WXDLLIMPEXP_RICHTEXT wxRichTextCtrl : public wxTextCtrlBase, - public wxScrollHelper -{ - DECLARE_CLASS( wxRichTextCtrl ) - DECLARE_EVENT_TABLE() - -public: -// Constructors - - wxRichTextCtrl( ); - wxRichTextCtrl( wxWindow* parent, wxWindowID id = -1, const wxString& value = wxEmptyString, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, - long style = wxRE_MULTILINE, const wxValidator& validator = wxDefaultValidator, const wxString& name = wxTextCtrlNameStr); - - virtual ~wxRichTextCtrl( ); - -// Operations - - /// Creation - bool Create( wxWindow* parent, wxWindowID id = -1, const wxString& value = wxEmptyString, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, - long style = wxRE_MULTILINE, const wxValidator& validator = wxDefaultValidator, const wxString& name = wxTextCtrlNameStr ); - - /// Member initialisation - void Init(); - -///// wxTextCtrl compatibility - -// Accessors - - virtual wxString GetValue() const; - - virtual wxString GetRange(long from, long to) const; - - virtual int GetLineLength(long lineNo) const ; - virtual wxString GetLineText(long lineNo) const ; - virtual int GetNumberOfLines() const ; - - virtual bool IsModified() const ; - virtual bool IsEditable() const ; - - // more readable flag testing methods - bool IsSingleLine() const { return !HasFlag(wxRE_MULTILINE); } - bool IsMultiLine() const { return !IsSingleLine(); } - - // If the return values from and to are the same, there is no selection. - virtual void GetSelection(long* from, long* to) const; - - virtual wxString GetStringSelection() const; - - /// Get filename - wxString GetFilename() const { return m_filename; } - - /// Set filename - void SetFilename(const wxString& filename) { m_filename = filename; } - - /// Set the threshold in character positions for doing layout optimization during sizing - void SetDelayedLayoutThreshold(long threshold) { m_delayedLayoutThreshold = threshold; } - - /// Get the threshold in character positions for doing layout optimization during sizing - long GetDelayedLayoutThreshold() const { return m_delayedLayoutThreshold; } - -#if wxABI_VERSION >= 20808 - /// Set text cursor - void SetTextCursor(const wxCursor& cursor ) { m_textCursor = cursor; } - - /// Get text cursor - wxCursor GetTextCursor() const { return m_textCursor; } - - /// Set URL cursor - void SetURLCursor(const wxCursor& cursor ) { m_urlCursor = cursor; } - - /// Get URL cursor - wxCursor GetURLCursor() const { return m_urlCursor; } -#endif - -#if wxABI_VERSION >= 20811 - /// Get/set context menu - wxMenu* GetContextMenu() const { return m_contextMenu; } - void SetContextMenu(wxMenu* menu); -#endif - -// Operations - - // editing - virtual void Clear(); - virtual void Replace(long from, long to, const wxString& value); - virtual void Remove(long from, long to); - - // load/save the controls contents from/to the file - virtual bool DoLoadFile(const wxString& file, int fileType); - virtual bool DoSaveFile(const wxString& file = wxEmptyString, int fileType = wxRICHTEXT_TYPE_ANY); - - /// Set the handler flags, controlling loading and saving - void SetHandlerFlags(int flags) { GetBuffer().SetHandlerFlags(flags); } - - /// Get the handler flags, controlling loading and saving - int GetHandlerFlags() const { return GetBuffer().GetHandlerFlags(); } - - // 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 WXUNUSED(len)) { } - - // 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); - - // 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 SetStyle(long start, long end, const wxTextAttrEx& style); - virtual bool SetStyle(const wxRichTextRange& range, const wxRichTextAttr& style); - virtual bool GetStyle(long position, wxTextAttr& style); - virtual bool GetStyle(long position, wxTextAttrEx& style); - virtual bool GetStyle(long position, wxRichTextAttr& style); - - // get the common set of styles for the range - virtual bool GetStyleForRange(const wxRichTextRange& range, wxRichTextAttr& style); - virtual bool GetStyleForRange(const wxRichTextRange& range, wxTextAttrEx& style); - - // extended style setting operation with flags including: - // wxRICHTEXT_SETSTYLE_WITH_UNDO, wxRICHTEXT_SETSTYLE_OPTIMIZE, wxRICHTEXT_SETSTYLE_PARAGRAPHS_ONLY, wxRICHTEXT_SETSTYLE_CHARACTERS_ONLY - // see richtextbuffer.h for more details. - virtual bool SetStyleEx(long start, long end, const wxTextAttrEx& style, int flags = wxRICHTEXT_SETSTYLE_WITH_UNDO); - virtual bool SetStyleEx(const wxRichTextRange& range, const wxTextAttrEx& style, int flags = wxRICHTEXT_SETSTYLE_WITH_UNDO); - virtual bool SetStyleEx(const wxRichTextRange& range, const wxRichTextAttr& style, int flags = wxRICHTEXT_SETSTYLE_WITH_UNDO); - - /// Get the content (uncombined) attributes for this position. - virtual bool GetUncombinedStyle(long position, wxTextAttr& style); - virtual bool GetUncombinedStyle(long position, wxTextAttrEx& style); - virtual bool GetUncombinedStyle(long position, wxRichTextAttr& style); - - virtual bool SetDefaultStyle(const wxTextAttrEx& style); - virtual bool SetDefaultStyle(const wxTextAttr& style); - - // TODO: change to GetDefaultStyle if we merge wxTextAttr and wxTextAttrEx - virtual const wxTextAttrEx& GetDefaultStyleEx() const; - virtual const wxTextAttr& GetDefaultStyle() const; - - /// Set list style - virtual bool SetListStyle(const wxRichTextRange& range, wxRichTextListStyleDefinition* def, int flags = wxRICHTEXT_SETSTYLE_WITH_UNDO, int startFrom = 1, int specifiedLevel = -1); - virtual bool SetListStyle(const wxRichTextRange& range, const wxString& defName, int flags = wxRICHTEXT_SETSTYLE_WITH_UNDO, int startFrom = 1, int specifiedLevel = -1); - - /// Clear list for given range - virtual bool ClearListStyle(const wxRichTextRange& range, int flags = wxRICHTEXT_SETSTYLE_WITH_UNDO); - - /// Number/renumber any list elements in the given range - /// def/defName can be NULL/empty to indicate that the existing list style should be used. - virtual bool NumberList(const wxRichTextRange& range, wxRichTextListStyleDefinition* def = NULL, int flags = wxRICHTEXT_SETSTYLE_WITH_UNDO, int startFrom = 1, int specifiedLevel = -1); - virtual bool NumberList(const wxRichTextRange& range, const wxString& defName, int flags = wxRICHTEXT_SETSTYLE_WITH_UNDO, int startFrom = 1, int specifiedLevel = -1); - - /// Promote the list items within the given range. promoteBy can be a positive or negative number, e.g. 1 or -1 - /// def/defName can be NULL/empty to indicate that the existing list style should be used. - virtual bool PromoteList(int promoteBy, const wxRichTextRange& range, wxRichTextListStyleDefinition* def = NULL, int flags = wxRICHTEXT_SETSTYLE_WITH_UNDO, int specifiedLevel = -1); - virtual bool PromoteList(int promoteBy, const wxRichTextRange& range, const wxString& defName, int flags = wxRICHTEXT_SETSTYLE_WITH_UNDO, int specifiedLevel = -1); - - /// Deletes the content in the given range - virtual bool Delete(const wxRichTextRange& range); - - // 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); - - // find the character at position given in pixels - // - // NB: pt is in device coords (not adjusted for the client area origin nor - // scrolling) - virtual wxTextCtrlHitTestResult HitTest(const wxPoint& pt, long *pos) const; - virtual wxTextCtrlHitTestResult HitTest(const wxPoint& pt, - wxTextCoord *col, - wxTextCoord *row) const; - - // Clipboard operations - virtual void Copy(); - virtual void Cut(); - virtual void Paste(); - virtual void DeleteSelection(); - - virtual bool CanCopy() const; - virtual bool CanCut() const; - virtual bool CanPaste() const; - virtual bool CanDeleteSelection() 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 wxTextPos GetLastPosition() const; - - virtual void SetSelection(long from, long to); - virtual void SelectAll(); - virtual void SetEditable(bool editable); - - /// Call Freeze to prevent refresh - virtual void Freeze(); - - /// Call Thaw to refresh - virtual void Thaw(); - - /// Call Thaw to refresh - virtual bool IsFrozen() const { return m_freezeCount > 0; } - - virtual bool HasSelection() const; - -///// Functionality specific to wxRichTextCtrl - - /// Write an image at the current insertion point. Supply optional type to use - /// for internal and file storage of the raw data. - virtual bool WriteImage(const wxImage& image, int bitmapType = wxBITMAP_TYPE_PNG); - - /// Write a bitmap at the current insertion point. Supply optional type to use - /// for internal and file storage of the raw data. - virtual bool WriteImage(const wxBitmap& bitmap, int bitmapType = wxBITMAP_TYPE_PNG); - - /// Load an image from file and write at the current insertion point. - virtual bool WriteImage(const wxString& filename, int bitmapType); - - /// Write an image block at the current insertion point. - virtual bool WriteImage(const wxRichTextImageBlock& imageBlock); - - /// Insert a newline (actually paragraph) at the current insertion point. - virtual bool Newline(); - - /// Insert a line break at the current insertion point. - virtual bool LineBreak(); - - /// Set basic (overall) style - virtual void SetBasicStyle(const wxTextAttrEx& style) { GetBuffer().SetBasicStyle(style); } - virtual void SetBasicStyle(const wxRichTextAttr& style) { GetBuffer().SetBasicStyle(style); } - - /// Get basic (overall) style - virtual const wxTextAttrEx& GetBasicStyle() const { return GetBuffer().GetBasicStyle(); } - - /// Begin using a style - virtual bool BeginStyle(const wxTextAttrEx& style) { return GetBuffer().BeginStyle(style); } - - /// End the style - virtual bool EndStyle() { return GetBuffer().EndStyle(); } - - /// End all styles - virtual bool EndAllStyles() { return GetBuffer().EndAllStyles(); } - - /// Begin using bold - bool BeginBold() { return GetBuffer().BeginBold(); } - - /// End using bold - bool EndBold() { return GetBuffer().EndBold(); } - - /// Begin using italic - bool BeginItalic() { return GetBuffer().BeginItalic(); } - - /// End using italic - bool EndItalic() { return GetBuffer().EndItalic(); } - - /// Begin using underline - bool BeginUnderline() { return GetBuffer().BeginUnderline(); } - - /// End using underline - bool EndUnderline() { return GetBuffer().EndUnderline(); } - - /// Begin using point size - bool BeginFontSize(int pointSize) { return GetBuffer().BeginFontSize(pointSize); } - - /// End using point size - bool EndFontSize() { return GetBuffer().EndFontSize(); } - - /// Begin using this font - bool BeginFont(const wxFont& font) { return GetBuffer().BeginFont(font); } - - /// End using a font - bool EndFont() { return GetBuffer().EndFont(); } - - /// Begin using this colour - bool BeginTextColour(const wxColour& colour) { return GetBuffer().BeginTextColour(colour); } - - /// End using a colour - bool EndTextColour() { return GetBuffer().EndTextColour(); } - - /// Begin using alignment - bool BeginAlignment(wxTextAttrAlignment alignment) { return GetBuffer().BeginAlignment(alignment); } - - /// End alignment - bool EndAlignment() { return GetBuffer().EndAlignment(); } - - /// Begin left indent - bool BeginLeftIndent(int leftIndent, int leftSubIndent = 0) { return GetBuffer().BeginLeftIndent(leftIndent, leftSubIndent); } - - /// End left indent - bool EndLeftIndent() { return GetBuffer().EndLeftIndent(); } - - /// Begin right indent - bool BeginRightIndent(int rightIndent) { return GetBuffer().BeginRightIndent(rightIndent); } - - /// End right indent - bool EndRightIndent() { return GetBuffer().EndRightIndent(); } - - /// Begin paragraph spacing - bool BeginParagraphSpacing(int before, int after) { return GetBuffer().BeginParagraphSpacing(before, after); } - - /// End paragraph spacing - bool EndParagraphSpacing() { return GetBuffer().EndParagraphSpacing(); } - - /// Begin line spacing - bool BeginLineSpacing(int lineSpacing) { return GetBuffer().BeginLineSpacing(lineSpacing); } - - /// End line spacing - bool EndLineSpacing() { return GetBuffer().EndLineSpacing(); } - - /// Begin numbered bullet - bool BeginNumberedBullet(int bulletNumber, int leftIndent, int leftSubIndent, int bulletStyle = wxTEXT_ATTR_BULLET_STYLE_ARABIC|wxTEXT_ATTR_BULLET_STYLE_PERIOD) - { return GetBuffer().BeginNumberedBullet(bulletNumber, leftIndent, leftSubIndent, bulletStyle); } - - /// End numbered bullet - bool EndNumberedBullet() { return GetBuffer().EndNumberedBullet(); } - - /// Begin symbol bullet - bool BeginSymbolBullet(const wxString& symbol, int leftIndent, int leftSubIndent, int bulletStyle = wxTEXT_ATTR_BULLET_STYLE_SYMBOL) - { return GetBuffer().BeginSymbolBullet(symbol, leftIndent, leftSubIndent, bulletStyle); } - - /// End symbol bullet - bool EndSymbolBullet() { return GetBuffer().EndSymbolBullet(); } - - /// Begin standard bullet - bool BeginStandardBullet(const wxString& bulletName, int leftIndent, int leftSubIndent, int bulletStyle = wxTEXT_ATTR_BULLET_STYLE_STANDARD) - { return GetBuffer().BeginStandardBullet(bulletName, leftIndent, leftSubIndent, bulletStyle); } - - /// End standard bullet - bool EndStandardBullet() { return GetBuffer().EndStandardBullet(); } - - /// Begin named character style - bool BeginCharacterStyle(const wxString& characterStyle) { return GetBuffer().BeginCharacterStyle(characterStyle); } - - /// End named character style - bool EndCharacterStyle() { return GetBuffer().EndCharacterStyle(); } - - /// Begin named paragraph style - bool BeginParagraphStyle(const wxString& paragraphStyle) { return GetBuffer().BeginParagraphStyle(paragraphStyle); } - - /// End named character style - bool EndParagraphStyle() { return GetBuffer().EndParagraphStyle(); } - - /// Begin named list style - bool BeginListStyle(const wxString& listStyle, int level = 1, int number = 1) { return GetBuffer().BeginListStyle(listStyle, level, number); } - - /// End named character style - bool EndListStyle() { return GetBuffer().EndListStyle(); } - - /// Begin URL - bool BeginURL(const wxString& url, const wxString& characterStyle = wxEmptyString) { return GetBuffer().BeginURL(url, characterStyle); } - - /// End URL - bool EndURL() { return GetBuffer().EndURL(); } - - /// Sets the default style to the style under the cursor - bool SetDefaultStyleToCursorStyle(); - - /// Clear the selection - virtual void SelectNone(); - - /// Select the word at the given character position - virtual bool SelectWord(long position); - - /// Get/set the selection range in character positions. -1, -1 means no selection. - /// The range is in API convention, i.e. a single character selection is denoted - /// by (n, n+1) - wxRichTextRange GetSelectionRange() const; - void SetSelectionRange(const wxRichTextRange& range); - - /// Get/set the selection range in character positions. -1, -1 means no selection. - /// The range is in internal format, i.e. a single character selection is denoted - /// by (n, n) - const wxRichTextRange& GetInternalSelectionRange() const { return m_selectionRange; } - void SetInternalSelectionRange(const wxRichTextRange& range) { m_selectionRange = range; } - - /// Add a new paragraph of text to the end of the buffer - virtual wxRichTextRange AddParagraph(const wxString& text); - - /// Add an image - virtual wxRichTextRange AddImage(const wxImage& image); - - /// Layout the buffer: which we must do before certain operations, such as - /// setting the caret position. - virtual bool LayoutContent(bool onlyVisibleRect = false); - - /// Move the caret to the given character position - virtual bool MoveCaret(long pos, bool showAtLineStart = false); - - /// Move right - virtual bool MoveRight(int noPositions = 1, int flags = 0); - - /// Move left - virtual bool MoveLeft(int noPositions = 1, int flags = 0); - - /// Move up - virtual bool MoveUp(int noLines = 1, int flags = 0); - - /// Move up - virtual bool MoveDown(int noLines = 1, int flags = 0); - - /// Move to the end of the line - virtual bool MoveToLineEnd(int flags = 0); - - /// Move to the start of the line - virtual bool MoveToLineStart(int flags = 0); - - /// Move to the end of the paragraph - virtual bool MoveToParagraphEnd(int flags = 0); - - /// Move to the start of the paragraph - virtual bool MoveToParagraphStart(int flags = 0); - - /// Move to the start of the buffer - virtual bool MoveHome(int flags = 0); - - /// Move to the end of the buffer - virtual bool MoveEnd(int flags = 0); - - /// Move n pages up - virtual bool PageUp(int noPages = 1, int flags = 0); - - /// Move n pages down - virtual bool PageDown(int noPages = 1, int flags = 0); - - /// Move n words left - virtual bool WordLeft(int noPages = 1, int flags = 0); - - /// Move n words right - virtual bool WordRight(int noPages = 1, int flags = 0); - - /// Returns the buffer associated with the control. - wxRichTextBuffer& GetBuffer() { return m_buffer; } - const wxRichTextBuffer& GetBuffer() const { return m_buffer; } - - /// Start batching undo history for commands. - virtual bool BeginBatchUndo(const wxString& cmdName) { return m_buffer.BeginBatchUndo(cmdName); } - - /// End batching undo history for commands. - virtual bool EndBatchUndo() { return m_buffer.EndBatchUndo(); } - - /// Are we batching undo history for commands? - virtual bool BatchingUndo() const { return m_buffer.BatchingUndo(); } - - /// Start suppressing undo history for commands. - virtual bool BeginSuppressUndo() { return m_buffer.BeginSuppressUndo(); } - - /// End suppressing undo history for commands. - virtual bool EndSuppressUndo() { return m_buffer.EndSuppressUndo(); } - - /// Are we suppressing undo history for commands? - virtual bool SuppressingUndo() const { return m_buffer.SuppressingUndo(); } - - /// Test if this whole range has character attributes of the specified kind. If any - /// of the attributes are different within the range, the test fails. You - /// can use this to implement, for example, bold button updating. style must have - /// flags indicating which attributes are of interest. - virtual bool HasCharacterAttributes(const wxRichTextRange& range, const wxTextAttrEx& style) const - { - return GetBuffer().HasCharacterAttributes(range.ToInternal(), style); - } - virtual bool HasCharacterAttributes(const wxRichTextRange& range, const wxRichTextAttr& style) const - { - return GetBuffer().HasCharacterAttributes(range.ToInternal(), style); - } - - /// Test if this whole range has paragraph attributes of the specified kind. If any - /// of the attributes are different within the range, the test fails. You - /// can use this to implement, for example, centering button updating. style must have - /// flags indicating which attributes are of interest. - virtual bool HasParagraphAttributes(const wxRichTextRange& range, const wxTextAttrEx& style) const - { - return GetBuffer().HasParagraphAttributes(range.ToInternal(), style); - } - virtual bool HasParagraphAttributes(const wxRichTextRange& range, const wxRichTextAttr& style) const - { - return GetBuffer().HasParagraphAttributes(range.ToInternal(), style); - } - - /// Is all of the selection bold? - virtual bool IsSelectionBold(); - - /// Is all of the selection italics? - virtual bool IsSelectionItalics(); - - /// Is all of the selection underlined? - virtual bool IsSelectionUnderlined(); - - /// Is all of the selection aligned according to the specified flag? - virtual bool IsSelectionAligned(wxTextAttrAlignment alignment); - - /// Apply bold to the selection - virtual bool ApplyBoldToSelection(); - - /// Apply italic to the selection - virtual bool ApplyItalicToSelection(); - - /// Apply underline to the selection - virtual bool ApplyUnderlineToSelection(); - - /// Apply alignment to the selection - virtual bool ApplyAlignmentToSelection(wxTextAttrAlignment alignment); - - /// Apply a named style to the selection - virtual bool ApplyStyle(wxRichTextStyleDefinition* def); - - /// Set style sheet, if any - void SetStyleSheet(wxRichTextStyleSheet* styleSheet) { GetBuffer().SetStyleSheet(styleSheet); } - wxRichTextStyleSheet* GetStyleSheet() const { return GetBuffer().GetStyleSheet(); } - - /// Push style sheet to top of stack - bool PushStyleSheet(wxRichTextStyleSheet* styleSheet) { return GetBuffer().PushStyleSheet(styleSheet); } - - /// Pop style sheet from top of stack - wxRichTextStyleSheet* PopStyleSheet() { return GetBuffer().PopStyleSheet(); } - - /// Apply the style sheet to the buffer, for example if the styles have changed. - bool ApplyStyleSheet(wxRichTextStyleSheet* styleSheet = NULL); - -// Command handlers - - void Command(wxCommandEvent& event); - void OnDropFiles(wxDropFilesEvent& event); - void OnCaptureLost(wxMouseCaptureLostEvent& event); - - void OnCut(wxCommandEvent& event); - void OnCopy(wxCommandEvent& event); - void OnPaste(wxCommandEvent& event); - void OnUndo(wxCommandEvent& event); - void OnRedo(wxCommandEvent& event); - void OnSelectAll(wxCommandEvent& event); - void OnClear(wxCommandEvent& event); - - void OnUpdateCut(wxUpdateUIEvent& event); - void OnUpdateCopy(wxUpdateUIEvent& event); - void OnUpdatePaste(wxUpdateUIEvent& event); - void OnUpdateUndo(wxUpdateUIEvent& event); - void OnUpdateRedo(wxUpdateUIEvent& event); - void OnUpdateSelectAll(wxUpdateUIEvent& event); - void OnUpdateClear(wxUpdateUIEvent& event); - - // Show a context menu for Rich Edit controls (the standard - // EDIT control has one already) - void OnContextMenu(wxContextMenuEvent& event); - -// Event handlers - - /// Painting - void OnPaint(wxPaintEvent& event); - void OnEraseBackground(wxEraseEvent& event); - - /// Left-click - void OnLeftClick(wxMouseEvent& event); - - /// Left-up - void OnLeftUp(wxMouseEvent& event); - - /// Motion - void OnMoveMouse(wxMouseEvent& event); - - /// Left-double-click - void OnLeftDClick(wxMouseEvent& event); - - /// Middle-click - void OnMiddleClick(wxMouseEvent& event); - - /// Right-click - void OnRightClick(wxMouseEvent& event); - - /// Key press - void OnChar(wxKeyEvent& event); - - /// Sizing - void OnSize(wxSizeEvent& event); - - /// Setting/losing focus - void OnSetFocus(wxFocusEvent& event); - void OnKillFocus(wxFocusEvent& event); - - /// Idle-time processing - void OnIdle(wxIdleEvent& event); - - /// Scrolling - void OnScroll(wxScrollWinEvent& event); - - /// Set font, and also default attributes - virtual bool SetFont(const wxFont& font); - - /// Set up scrollbars, e.g. after a resize - virtual void SetupScrollbars(bool atTop = false); - - /// Keyboard navigation - virtual bool KeyboardNavigate(int keyCode, int flags); - - /// Paint the background - virtual void PaintBackground(wxDC& dc); - -#if wxRICHTEXT_BUFFERED_PAINTING - /// Recreate buffer bitmap if necessary - virtual bool RecreateBuffer(const wxSize& size = wxDefaultSize); -#endif - - /// Set the selection - virtual void DoSetSelection(long from, long to, bool scrollCaret = true); - - /// Write text - virtual void DoWriteText(const wxString& value, int flags = 0); - - /// Should we inherit colours? - virtual bool ShouldInheritColours() const { return false; } - - /// Position the caret - virtual void PositionCaret(); - - /// Extend the selection, returning true if the selection was - /// changed. Selections are in caret positions. - virtual bool ExtendSelection(long oldPosition, long newPosition, int flags); - - /// Scroll into view. This takes a _caret_ position. - virtual bool ScrollIntoView(long position, int keyCode); - - /// The caret position is the character position just before the caret. - /// A value of -1 means the caret is at the start of the buffer. - void SetCaretPosition(long position, bool showAtLineStart = false) ; - long GetCaretPosition() const { return m_caretPosition; } - - /// The adjusted caret position is the character position adjusted to take - /// into account whether we're at the start of a paragraph, in which case - /// style information should be taken from the next position, not current one. - long GetAdjustedCaretPosition(long caretPos) const; - - /// Move caret one visual step forward: this may mean setting a flag - /// and keeping the same position if we're going from the end of one line - /// to the start of the next, which may be the exact same caret position. - void MoveCaretForward(long oldPosition) ; - - /// Move caret one visual step forward: this may mean setting a flag - /// and keeping the same position if we're going from the end of one line - /// to the start of the next, which may be the exact same caret position. - void MoveCaretBack(long oldPosition) ; - - /// Get the caret height and position for the given character position - bool GetCaretPositionForIndex(long position, wxRect& rect); - - /// Gets the line for the visible caret position. If the caret is - /// shown at the very end of the line, it means the next character is actually - /// on the following line. So let's get the line we're expecting to find - /// if this is the case. - wxRichTextLine* GetVisibleLineForCaretPosition(long caretPosition) const; - - /// Gets the command processor - wxCommandProcessor* GetCommandProcessor() const { return GetBuffer().GetCommandProcessor(); } - - /// Delete content if there is a selection, e.g. when pressing a key. - /// Returns the new caret position in newPos, or leaves it if there - /// was no action. - bool DeleteSelectedContent(long* newPos= NULL); - - /// Transform logical to physical - wxPoint GetPhysicalPoint(const wxPoint& ptLogical) const; - - /// Transform physical to logical - wxPoint GetLogicalPoint(const wxPoint& ptPhysical) const; - - /// Finds the caret position for the next word. Direction - /// is 1 (forward) or -1 (backwards). - virtual long FindNextWordPosition(int direction = 1) const; - - /// Is the given position visible on the screen? - bool IsPositionVisible(long pos) const; - - /// Returns the first visible position in the current view - long GetFirstVisiblePosition() const; - - /// Returns the caret position since the default formatting was changed. As - /// soon as this position changes, we no longer reflect the default style - /// in the UI. A value of -2 means that we should only reflect the style of the - /// content under the caret. - long GetCaretPositionForDefaultStyle() const { return m_caretPositionForDefaultStyle; } - - /// Set the caret position for the default style that the user is selecting. - void SetCaretPositionForDefaultStyle(long pos) { m_caretPositionForDefaultStyle = pos; } - - /// Should the UI reflect the default style chosen by the user, rather than the style under - /// the caret? - bool IsDefaultStyleShowing() const { return m_caretPositionForDefaultStyle != -2; } - - /// Convenience function that tells the control to start reflecting the default - /// style, since the user is changing it. - void SetAndShowDefaultStyle(const wxRichTextAttr& attr) - { - SetDefaultStyle(attr); - SetCaretPositionForDefaultStyle(GetCaretPosition()); - } - - /// Get the first visible point in the window - wxPoint GetFirstVisiblePoint() const; - -// Implementation - - /// Font names take a long time to retrieve, so cache them (on demand) - static const wxArrayString& GetAvailableFontNames(); - static void ClearAvailableFontNames(); - - WX_FORWARD_TO_SCROLL_HELPER() - -// Overrides -protected: - - virtual wxSize DoGetBestSize() const ; - - virtual void DoSetValue(const wxString& value, int flags = 0); - - -// Data members -private: - - /// Allows nested Freeze/Thaw - int m_freezeCount; - -#if wxRICHTEXT_BUFFERED_PAINTING - /// Buffer bitmap - wxBitmap m_bufferBitmap; -#endif - - /// Text buffer - wxRichTextBuffer m_buffer; - - wxMenu* m_contextMenu; - - /// Caret position (1 less than the character position, so -1 is the - /// first caret position). - long m_caretPosition; - - /// Caret position when the default formatting has been changed. As - /// soon as this position changes, we no longer reflect the default style - /// in the UI. - long m_caretPositionForDefaultStyle; - - /// Selection range in character positions. -2, -2 means no selection. - wxRichTextRange m_selectionRange; - - /// Anchor so we know how to extend the selection - /// It's a caret position since it's between two characters. - long m_selectionAnchor; - - /// Are we editable? - bool m_editable; - - /// Are we showing the caret position at the start of a line - /// instead of at the end of the previous one? - bool m_caretAtLineStart; - - /// Are we dragging a selection? - bool m_dragging; - - /// Start position for drag - wxPoint m_dragStart; - - /// Do we need full layout in idle? - bool m_fullLayoutRequired; - wxLongLong m_fullLayoutTime; - long m_fullLayoutSavedPosition; - - /// Threshold for doing delayed layout - long m_delayedLayoutThreshold; - - /// Cursors - wxCursor m_textCursor; - wxCursor m_urlCursor; - - static wxArrayString sm_availableFontNames; -}; - -/*! - * wxRichTextEvent - the event class for wxRichTextCtrl notifications - */ - -class WXDLLIMPEXP_RICHTEXT wxRichTextEvent : public wxNotifyEvent -{ -public: - wxRichTextEvent(wxEventType commandType = wxEVT_NULL, int winid = 0) - : wxNotifyEvent(commandType, winid), - m_flags(0), m_position(-1), m_oldStyleSheet(NULL), m_newStyleSheet(NULL), - m_char((wxChar) 0) - { } - - wxRichTextEvent(const wxRichTextEvent& event) - : wxNotifyEvent(event), - m_flags(event.m_flags), m_position(-1), - m_oldStyleSheet(event.m_oldStyleSheet), m_newStyleSheet(event.m_newStyleSheet), - m_char((wxChar) 0) - { } - - long GetPosition() const { return m_position; } - void SetPosition(long pos) { m_position = pos; } - - int GetFlags() const { return m_flags; } - void SetFlags(int flags) { m_flags = flags; } - - wxRichTextStyleSheet* GetOldStyleSheet() const { return m_oldStyleSheet; } - void SetOldStyleSheet(wxRichTextStyleSheet* sheet) { m_oldStyleSheet = sheet; } - - wxRichTextStyleSheet* GetNewStyleSheet() const { return m_newStyleSheet; } - void SetNewStyleSheet(wxRichTextStyleSheet* sheet) { m_newStyleSheet = sheet; } - - const wxRichTextRange& GetRange() const { return m_range; } - void SetRange(const wxRichTextRange& range) { m_range = range; } - - wxChar GetCharacter() const { return m_char; } - void SetCharacter(wxChar ch) { m_char = ch; } - - virtual wxEvent *Clone() const { return new wxRichTextEvent(*this); } - -protected: - int m_flags; - long m_position; - wxRichTextStyleSheet* m_oldStyleSheet; - wxRichTextStyleSheet* m_newStyleSheet; - wxRichTextRange m_range; - wxChar m_char; - -private: - DECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxRichTextEvent) -}; - -/*! - * wxRichTextCtrl event macros - */ - -BEGIN_DECLARE_EVENT_TYPES() - DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_RICHTEXT, wxEVT_COMMAND_RICHTEXT_LEFT_CLICK, 2602) - DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_RICHTEXT, wxEVT_COMMAND_RICHTEXT_RIGHT_CLICK, 2603) - DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_RICHTEXT, wxEVT_COMMAND_RICHTEXT_MIDDLE_CLICK, 2604) - DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_RICHTEXT, wxEVT_COMMAND_RICHTEXT_LEFT_DCLICK, 2605) - DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_RICHTEXT, wxEVT_COMMAND_RICHTEXT_RETURN, 2606) - DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_RICHTEXT, wxEVT_COMMAND_RICHTEXT_CHARACTER, 2607) - DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_RICHTEXT, wxEVT_COMMAND_RICHTEXT_DELETE, 2608) - - DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_RICHTEXT, wxEVT_COMMAND_RICHTEXT_STYLESHEET_CHANGING, 2609) - DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_RICHTEXT, wxEVT_COMMAND_RICHTEXT_STYLESHEET_CHANGED, 2610) - DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_RICHTEXT, wxEVT_COMMAND_RICHTEXT_STYLESHEET_REPLACING, 2611) - DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_RICHTEXT, wxEVT_COMMAND_RICHTEXT_STYLESHEET_REPLACED, 2612) - - DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_RICHTEXT, wxEVT_COMMAND_RICHTEXT_CONTENT_INSERTED, 2613) - DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_RICHTEXT, wxEVT_COMMAND_RICHTEXT_CONTENT_DELETED, 2614) - DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_RICHTEXT, wxEVT_COMMAND_RICHTEXT_STYLE_CHANGED, 2615) - DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_RICHTEXT, wxEVT_COMMAND_RICHTEXT_SELECTION_CHANGED, 2616) - -#if wxABI_VERSION >= 20808 - DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_RICHTEXT, wxEVT_COMMAND_RICHTEXT_BUFFER_RESET, 2617) -#endif -END_DECLARE_EVENT_TYPES() - -typedef void (wxEvtHandler::*wxRichTextEventFunction)(wxRichTextEvent&); - -#define wxRichTextEventHandler(func) \ - (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxRichTextEventFunction, &func) - -#define EVT_RICHTEXT_LEFT_CLICK(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_RICHTEXT_LEFT_CLICK, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxRichTextEventFunction, & fn ), NULL ), -#define EVT_RICHTEXT_RIGHT_CLICK(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_RICHTEXT_RIGHT_CLICK, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxRichTextEventFunction, & fn ), NULL ), -#define EVT_RICHTEXT_MIDDLE_CLICK(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_RICHTEXT_MIDDLE_CLICK, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxRichTextEventFunction, & fn ), NULL ), -#define EVT_RICHTEXT_LEFT_DCLICK(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_RICHTEXT_LEFT_DCLICK, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxRichTextEventFunction, & fn ), NULL ), -#define EVT_RICHTEXT_RETURN(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_RICHTEXT_RETURN, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxRichTextEventFunction, & fn ), NULL ), -#define EVT_RICHTEXT_CHARACTER(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_RICHTEXT_CHARACTER, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxRichTextEventFunction, & fn ), NULL ), -#define EVT_RICHTEXT_DELETE(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_RICHTEXT_DELETE, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxRichTextEventFunction, & fn ), NULL ), - -#define EVT_RICHTEXT_STYLESHEET_CHANGING(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_RICHTEXT_STYLESHEET_CHANGING, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxRichTextEventFunction, & fn ), NULL ), -#define EVT_RICHTEXT_STYLESHEET_CHANGED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_RICHTEXT_STYLESHEET_CHANGED, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxRichTextEventFunction, & fn ), NULL ), -#define EVT_RICHTEXT_STYLESHEET_REPLACING(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_RICHTEXT_STYLESHEET_REPLACING, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxRichTextEventFunction, & fn ), NULL ), -#define EVT_RICHTEXT_STYLESHEET_REPLACED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_RICHTEXT_STYLESHEET_REPLACED, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxRichTextEventFunction, & fn ), NULL ), - -#define EVT_RICHTEXT_CONTENT_INSERTED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_RICHTEXT_CONTENT_INSERTED, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxRichTextEventFunction, & fn ), NULL ), -#define EVT_RICHTEXT_CONTENT_DELETED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_RICHTEXT_CONTENT_DELETED, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxRichTextEventFunction, & fn ), NULL ), -#define EVT_RICHTEXT_STYLE_CHANGED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_RICHTEXT_STYLE_CHANGED, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxRichTextEventFunction, & fn ), NULL ), -#define EVT_RICHTEXT_SELECTION_CHANGED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_RICHTEXT_SELECTION_CHANGED, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxRichTextEventFunction, & fn ), NULL ), -#define EVT_RICHTEXT_BUFFER_RESET(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_RICHTEXT_BUFFER_RESET, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxRichTextEventFunction, & fn ), NULL ), - -#endif - // wxUSE_RICHTEXT - -#endif - // _WX_RICHTEXTCTRL_H_ diff --git a/wxWidgets/include/wx/richtext/richtextfontpage.h b/wxWidgets/include/wx/richtext/richtextfontpage.h deleted file mode 100644 index 39a57278f0..0000000000 --- a/wxWidgets/include/wx/richtext/richtextfontpage.h +++ /dev/null @@ -1,167 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/richtext/richeditfontpage.h -// Purpose: Font page for wxRichTextFormattingDialog -// Author: Julian Smart -// Modified by: -// Created: 2006-10-02 -// RCS-ID: $Id: richtextfontpage.h 60641 2009-05-15 11:22:40Z JS $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _RICHTEXTFONTPAGE_H_ -#define _RICHTEXTFONTPAGE_H_ - -/*! - * Includes - */ - -////@begin includes -////@end includes - -/*! - * Forward declarations - */ - -////@begin forward declarations -class wxRichTextFontListBox; -class wxRichTextColourSwatchCtrl; -class wxRichTextFontPreviewCtrl; -////@end forward declarations - -/*! - * Control identifiers - */ - -////@begin control identifiers -#define SYMBOL_WXRICHTEXTFONTPAGE_STYLE wxRESIZE_BORDER|wxTAB_TRAVERSAL -#define SYMBOL_WXRICHTEXTFONTPAGE_TITLE _("wxRichTextFontPage") -#define SYMBOL_WXRICHTEXTFONTPAGE_IDNAME ID_RICHTEXTFONTPAGE -#define SYMBOL_WXRICHTEXTFONTPAGE_SIZE wxSize(400, 300) -#define SYMBOL_WXRICHTEXTFONTPAGE_POSITION wxDefaultPosition -////@end control identifiers - -/*! - * wxRichTextFontPage class declaration - */ - -class WXDLLIMPEXP_RICHTEXT wxRichTextFontPage: public wxPanel -{ - DECLARE_DYNAMIC_CLASS( wxRichTextFontPage ) - DECLARE_EVENT_TABLE() - -public: - /// Constructors - wxRichTextFontPage( ); - wxRichTextFontPage( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = SYMBOL_WXRICHTEXTFONTPAGE_POSITION, const wxSize& size = SYMBOL_WXRICHTEXTFONTPAGE_SIZE, long style = SYMBOL_WXRICHTEXTFONTPAGE_STYLE ); - - /// Initialise members - void Init(); - - /// Creation - bool Create( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = SYMBOL_WXRICHTEXTFONTPAGE_POSITION, const wxSize& size = SYMBOL_WXRICHTEXTFONTPAGE_SIZE, long style = SYMBOL_WXRICHTEXTFONTPAGE_STYLE ); - - /// Creates the controls and sizers - void CreateControls(); - - /// Transfer data from/to window - virtual bool TransferDataFromWindow(); - virtual bool TransferDataToWindow(); - - /// Updates the font preview - void UpdatePreview(); - - void OnFaceListBoxSelected( wxCommandEvent& event ); - void OnColourClicked( wxCommandEvent& event ); - - /// Gets the attributes associated with the main formatting dialog - wxTextAttrEx* GetAttributes(); - -////@begin wxRichTextFontPage event handler declarations - - /// wxEVT_COMMAND_TEXT_UPDATED event handler for ID_RICHTEXTFONTPAGE_FACETEXTCTRL - void OnFaceTextCtrlUpdated( wxCommandEvent& event ); - - /// wxEVT_COMMAND_TEXT_UPDATED event handler for ID_RICHTEXTFONTPAGE_SIZETEXTCTRL - void OnSizeTextCtrlUpdated( wxCommandEvent& event ); - - /// wxEVT_COMMAND_LISTBOX_SELECTED event handler for ID_RICHTEXTFONTPAGE_SIZELISTBOX - void OnSizeListBoxSelected( wxCommandEvent& event ); - - /// wxEVT_COMMAND_COMBOBOX_SELECTED event handler for ID_RICHTEXTFONTPAGE_STYLECTRL - void OnStyleCtrlSelected( wxCommandEvent& event ); - - /// wxEVT_COMMAND_COMBOBOX_SELECTED event handler for ID_RICHTEXTFONTPAGE_WEIGHTCTRL - void OnWeightCtrlSelected( wxCommandEvent& event ); - - /// wxEVT_COMMAND_COMBOBOX_SELECTED event handler for ID_RICHTEXTFONTPAGE_UNDERLINING_CTRL - void OnUnderliningCtrlSelected( wxCommandEvent& event ); - - /// wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_RICHTEXTFONTPAGE_STRIKETHROUGHCTRL - void OnStrikethroughctrlClick( wxCommandEvent& event ); - - /// wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_RICHTEXTFONTPAGE_CAPSCTRL - void OnCapsctrlClick( wxCommandEvent& event ); - - /// wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_RICHTEXTFONTPAGE_SUPERSCRIPT - void OnRichtextfontpageSuperscriptClick( wxCommandEvent& event ); - - /// wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_RICHTEXTFONTPAGE_SUBSCRIPT - void OnRichtextfontpageSubscriptClick( wxCommandEvent& event ); - -////@end wxRichTextFontPage event handler declarations - -////@begin wxRichTextFontPage member function declarations - - /// Retrieves bitmap resources - wxBitmap GetBitmapResource( const wxString& name ); - - /// Retrieves icon resources - wxIcon GetIconResource( const wxString& name ); -////@end wxRichTextFontPage member function declarations - - /// Should we show tooltips? - static bool ShowToolTips(); - -////@begin wxRichTextFontPage member variables - wxTextCtrl* m_faceTextCtrl; - wxRichTextFontListBox* m_faceListBox; - wxTextCtrl* m_sizeTextCtrl; - wxListBox* m_sizeListBox; - wxComboBox* m_styleCtrl; - wxComboBox* m_weightCtrl; - wxComboBox* m_underliningCtrl; - wxRichTextColourSwatchCtrl* m_colourCtrl; - wxRichTextColourSwatchCtrl* m_bgColourCtrl; - wxCheckBox* m_strikethroughCtrl; - wxCheckBox* m_capitalsCtrl; - wxCheckBox* m_superscriptCtrl; - wxCheckBox* m_subscriptCtrl; - wxRichTextFontPreviewCtrl* m_previewCtrl; - /// Control identifiers - enum { - ID_RICHTEXTFONTPAGE = 10000, - ID_RICHTEXTFONTPAGE_FACETEXTCTRL = 10001, - ID_RICHTEXTFONTPAGE_FACELISTBOX = 10002, - ID_RICHTEXTFONTPAGE_SIZETEXTCTRL = 10005, - ID_RICHTEXTFONTPAGE_SIZELISTBOX = 10006, - ID_RICHTEXTFONTPAGE_STYLECTRL = 10007, - ID_RICHTEXTFONTPAGE_WEIGHTCTRL = 10004, - ID_RICHTEXTFONTPAGE_UNDERLINING_CTRL = 10008, - ID_RICHTEXTFONTPAGE_COLOURCTRL = 10009, - ID_RICHTEXTFONTPAGE_BGCOLOURCTRL = 10014, - ID_RICHTEXTFONTPAGE_STRIKETHROUGHCTRL = 10010, - ID_RICHTEXTFONTPAGE_CAPSCTRL = 10011, - ID_RICHTEXTFONTPAGE_SUPERSCRIPT = 10012, - ID_RICHTEXTFONTPAGE_SUBSCRIPT = 10013, - ID_RICHTEXTFONTPAGE_PREVIEWCTRL = 10003 - }; -////@end wxRichTextFontPage member variables - - bool m_dontUpdate; - bool m_colourPresent; - bool m_bgColourPresent; -}; - -#endif - // _RICHTEXTFONTPAGE_H_ diff --git a/wxWidgets/include/wx/richtext/richtextformatdlg.h b/wxWidgets/include/wx/richtext/richtextformatdlg.h deleted file mode 100644 index e3bbf61453..0000000000 --- a/wxWidgets/include/wx/richtext/richtextformatdlg.h +++ /dev/null @@ -1,327 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/richtext/richtextformatdlg.h -// Purpose: Formatting dialog for wxRichTextCtrl -// Author: Julian Smart -// Modified by: -// Created: 2006-10-01 -// RCS-ID: $Id: richtextformatdlg.h 49946 2007-11-14 14:22:56Z JS $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_RICHTEXTFORMATDLG_H_ -#define _WX_RICHTEXTFORMATDLG_H_ - -/*! - * Includes - */ - -#include "wx/defs.h" - -#if wxUSE_RICHTEXT - -#include "wx/propdlg.h" -#include "wx/bookctrl.h" - -#if wxUSE_HTML -#include "wx/htmllbox.h" -#endif - -#include "wx/richtext/richtextbuffer.h" -#include "wx/richtext/richtextstyles.h" - -class WXDLLIMPEXP_FWD_RICHTEXT wxRichTextFormattingDialog; -class WXDLLIMPEXP_FWD_CORE wxImageList; - -/*! - * Flags determining the pages and buttons to be created in the dialog - */ - -#define wxRICHTEXT_FORMAT_STYLE_EDITOR 0x0001 -#define wxRICHTEXT_FORMAT_FONT 0x0002 -#define wxRICHTEXT_FORMAT_TABS 0x0004 -#define wxRICHTEXT_FORMAT_BULLETS 0x0008 -#define wxRICHTEXT_FORMAT_INDENTS_SPACING 0x0010 -#define wxRICHTEXT_FORMAT_LIST_STYLE 0x0020 - -#define wxRICHTEXT_FORMAT_HELP_BUTTON 0x0100 - -/*! - * Indices for bullet styles in list control - */ - -enum { - wxRICHTEXT_BULLETINDEX_NONE = 0, - wxRICHTEXT_BULLETINDEX_ARABIC, - wxRICHTEXT_BULLETINDEX_UPPER_CASE, - wxRICHTEXT_BULLETINDEX_LOWER_CASE, - wxRICHTEXT_BULLETINDEX_UPPER_CASE_ROMAN, - wxRICHTEXT_BULLETINDEX_LOWER_CASE_ROMAN, - wxRICHTEXT_BULLETINDEX_OUTLINE, - wxRICHTEXT_BULLETINDEX_SYMBOL, - wxRICHTEXT_BULLETINDEX_BITMAP, - wxRICHTEXT_BULLETINDEX_STANDARD -}; - -/*! - * Shorthand for common combinations of pages - */ - -#define wxRICHTEXT_FORMAT_PARAGRAPH (wxRICHTEXT_FORMAT_INDENTS_SPACING | wxRICHTEXT_FORMAT_BULLETS | wxRICHTEXT_FORMAT_TABS | wxRICHTEXT_FORMAT_FONT) -#define wxRICHTEXT_FORMAT_CHARACTER (wxRICHTEXT_FORMAT_FONT) -#define wxRICHTEXT_FORMAT_STYLE (wxRICHTEXT_FORMAT_PARAGRAPH | wxRICHTEXT_FORMAT_STYLE_EDITOR) - -/*! - * Factory for formatting dialog - */ - -class WXDLLIMPEXP_RICHTEXT wxRichTextFormattingDialogFactory: public wxObject -{ -public: - wxRichTextFormattingDialogFactory() {} - virtual ~wxRichTextFormattingDialogFactory() {} - -// Overrideables - - /// Create all pages, under the dialog's book control, also calling AddPage - virtual bool CreatePages(long pages, wxRichTextFormattingDialog* dialog); - - /// Create a page, given a page identifier - virtual wxPanel* CreatePage(int page, wxString& title, wxRichTextFormattingDialog* dialog); - - /// Enumerate all available page identifiers - virtual int GetPageId(int i) const; - - /// Get the number of available page identifiers - virtual int GetPageIdCount() const; - - /// Get the image index for the given page identifier - virtual int GetPageImage(int WXUNUSED(id)) const { return -1; } - - /// Invoke help for the dialog - virtual bool ShowHelp(int WXUNUSED(page), wxRichTextFormattingDialog* WXUNUSED(dialog)) { return false; } - - /// Set the sheet style, called at the start of wxRichTextFormattingDialog::Create - virtual bool SetSheetStyle(wxRichTextFormattingDialog* dialog); - - /// Create the main dialog buttons - virtual bool CreateButtons(wxRichTextFormattingDialog* dialog); -}; - -/*! - * Formatting dialog for a wxRichTextCtrl - */ - -class WXDLLIMPEXP_RICHTEXT wxRichTextFormattingDialog: public wxPropertySheetDialog -{ -DECLARE_CLASS(wxRichTextFormattingDialog) -public: - wxRichTextFormattingDialog() { Init(); } - - wxRichTextFormattingDialog(long flags, wxWindow* parent, const wxString& title = wxGetTranslation(wxT("Formatting")), wxWindowID id = wxID_ANY, - const wxPoint& pos = wxDefaultPosition, const wxSize& sz = wxDefaultSize, - long style = wxDEFAULT_DIALOG_STYLE) - { - Init(); - Create(flags, parent, title, id, pos, sz, style); - } - - ~wxRichTextFormattingDialog(); - - void Init(); - - bool Create(long flags, wxWindow* parent, const wxString& title = wxGetTranslation(wxT("Formatting")), wxWindowID id = wxID_ANY, - const wxPoint& pos = wxDefaultPosition, const wxSize& sz = wxDefaultSize, - long style = wxDEFAULT_DIALOG_STYLE); - - /// Get attributes from the given range - virtual bool GetStyle(wxRichTextCtrl* ctrl, const wxRichTextRange& range); - - /// Set the attributes and optionally update the display - virtual bool SetStyle(const wxTextAttrEx& style, bool update = true); - - /// Set the style definition and optionally update the display - virtual bool SetStyleDefinition(const wxRichTextStyleDefinition& styleDef, wxRichTextStyleSheet* sheet, bool update = true); - - /// Get the style definition, if any - virtual wxRichTextStyleDefinition* GetStyleDefinition() const { return m_styleDefinition; } - - /// Get the style sheet, if any - virtual wxRichTextStyleSheet* GetStyleSheet() const { return m_styleSheet; } - - /// Update the display - virtual bool UpdateDisplay(); - - /// Apply attributes to the given range - virtual bool ApplyStyle(wxRichTextCtrl* ctrl, const wxRichTextRange& range, int flags = wxRICHTEXT_SETSTYLE_WITH_UNDO|wxRICHTEXT_SETSTYLE_OPTIMIZE); - - /// Gets and sets the attributes - const wxTextAttrEx& GetAttributes() const { return m_attributes; } - wxTextAttrEx& GetAttributes() { return m_attributes; } - void SetAttributes(const wxTextAttrEx& attr) { m_attributes = attr; } - - /// Transfers the data and from to the window - virtual bool TransferDataToWindow(); - virtual bool TransferDataFromWindow(); - - /// Apply the styles when a different tab is selected, so the previews are - /// up to date - void OnTabChanged(wxBookCtrlEvent& event); - - /// Respond to help command - void OnHelp(wxCommandEvent& event); - - /// Set/get image list - void SetImageList(wxImageList* imageList) { m_imageList = imageList; } - wxImageList* GetImageList() const { return m_imageList; } - - /// Get/set formatting factory object - static void SetFormattingDialogFactory(wxRichTextFormattingDialogFactory* factory); - static wxRichTextFormattingDialogFactory* GetFormattingDialogFactory() { return ms_FormattingDialogFactory; } - - /// Helper for pages to get the top-level dialog - static wxRichTextFormattingDialog* GetDialog(wxWindow* win); - - /// Helper for pages to get the attributes - static wxTextAttrEx* GetDialogAttributes(wxWindow* win); - - /// Helper for pages to get the style - static wxRichTextStyleDefinition* GetDialogStyleDefinition(wxWindow* win); - - /// Should we show tooltips? - static bool ShowToolTips() { return sm_showToolTips; } - - /// Determines whether tooltips will be shown - static void SetShowToolTips(bool show) { sm_showToolTips = show; } - - /// Map book control page index to our page id - void AddPageId(int id) { m_pageIds.Add(id); } - -protected: - - wxImageList* m_imageList; - wxTextAttrEx m_attributes; - wxRichTextStyleDefinition* m_styleDefinition; - wxRichTextStyleSheet* m_styleSheet; - wxArrayInt m_pageIds; // mapping of book control indexes to page ids - - static wxRichTextFormattingDialogFactory* ms_FormattingDialogFactory; - static bool sm_showToolTips; - -DECLARE_EVENT_TABLE() -}; - -//----------------------------------------------------------------------------- -// helper class - wxRichTextFontPreviewCtrl -//----------------------------------------------------------------------------- - -class WXDLLIMPEXP_RICHTEXT wxRichTextFontPreviewCtrl : public wxWindow -{ -public: - wxRichTextFontPreviewCtrl(wxWindow *parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& sz = wxDefaultSize, long style = 0) - { - if ((style & wxBORDER_MASK) == wxBORDER_DEFAULT) -#ifdef __WXMSW__ - style |= GetThemedBorderStyle(); -#else - style |= wxBORDER_SUNKEN; -#endif - wxWindow::Create(parent, id, pos, sz, style); - - SetBackgroundColour(*wxWHITE); - m_textEffects = 0; - } - - void SetTextEffects(int effects) { m_textEffects = effects; } - int GetTextEffects() const { return m_textEffects; } - -private: - int m_textEffects; - - void OnPaint(wxPaintEvent& event); - DECLARE_EVENT_TABLE() -}; - -/* - * A control for displaying a small preview of a colour or bitmap - */ - -class WXDLLIMPEXP_RICHTEXT wxRichTextColourSwatchCtrl: public wxControl -{ - DECLARE_CLASS(wxRichTextColourSwatchCtrl) -public: - wxRichTextColourSwatchCtrl(wxWindow* parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0); - ~wxRichTextColourSwatchCtrl(); - - void OnMouseEvent(wxMouseEvent& event); - - void SetColour(const wxColour& colour) { m_colour = colour; SetBackgroundColour(m_colour); } - - wxColour& GetColour() { return m_colour; } - - virtual wxSize DoGetBestSize() const { return GetSize(); } - -protected: - wxColour m_colour; - -DECLARE_EVENT_TABLE() -}; - -/*! - * wxRichTextFontListBox class declaration - * A listbox to display fonts. - */ - -class WXDLLIMPEXP_RICHTEXT wxRichTextFontListBox: public wxHtmlListBox -{ - DECLARE_CLASS(wxRichTextFontListBox) - DECLARE_EVENT_TABLE() - -public: - wxRichTextFontListBox() - { - Init(); - } - wxRichTextFontListBox(wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, long style = 0); - virtual ~wxRichTextFontListBox(); - - void Init() - { - } - - bool Create(wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, long style = 0); - - /// Creates a suitable HTML fragment for a font - wxString CreateHTML(const wxString& facename) const; - - /// Get font name for index - wxString GetFaceName(size_t i) const ; - - /// Set selection for string, returning the index. - int SetFaceNameSelection(const wxString& name); - - /// Updates the font list - void UpdateFonts(); - - /// Does this face name exist? - bool HasFaceName(const wxString& faceName) const { return m_faceNames.Index(faceName) != wxNOT_FOUND; } - - /// Returns the array of face names - const wxArrayString& GetFaceNames() const { return m_faceNames; } - -protected: - /// Returns the HTML for this item - virtual wxString OnGetItem(size_t n) const; - -private: - - wxArrayString m_faceNames; -}; - -#endif - // wxUSE_RICHTEXT - -#endif - // _WX_RICHTEXTFORMATDLG_H_ diff --git a/wxWidgets/include/wx/richtext/richtexthtml.h b/wxWidgets/include/wx/richtext/richtexthtml.h deleted file mode 100644 index d56928b17e..0000000000 --- a/wxWidgets/include/wx/richtext/richtexthtml.h +++ /dev/null @@ -1,148 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/richtext/richtexthtml.h -// Purpose: HTML I/O for wxRichTextCtrl -// Author: Julian Smart -// Modified by: -// Created: 2005-09-30 -// RCS-ID: $Id: richtexthtml.h 62033 2009-09-23 11:06:30Z JS $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_RICHTEXTHTML_H_ -#define _WX_RICHTEXTHTML_H_ - -/*! - * Includes - */ - -#include "wx/richtext/richtextbuffer.h" - -// Use CSS styles where applicable, otherwise use non-CSS workarounds -#define wxRICHTEXT_HANDLER_USE_CSS 0x1000 - -/*! - * wxRichTextHTMLHandler - */ - -class WXDLLIMPEXP_RICHTEXT wxRichTextHTMLHandler: public wxRichTextFileHandler -{ - DECLARE_CLASS(wxRichTextHTMLHandler) -public: - wxRichTextHTMLHandler(const wxString& name = wxT("HTML"), const wxString& ext = wxT("html"), int type = wxRICHTEXT_TYPE_HTML); - - /// Can we save using this handler? - virtual bool CanSave() const { return true; } - - /// Can we load using this handler? - virtual bool CanLoad() const { return false; } - - /// Can we handle this filename (if using files)? By default, checks the extension. - virtual bool CanHandle(const wxString& filename) const; - -// Accessors and operations unique to this handler - - /// Set and get the list of image locations generated by the last operation - void SetTemporaryImageLocations(const wxArrayString& locations) { m_imageLocations = locations; } - const wxArrayString& GetTemporaryImageLocations() const { return m_imageLocations; } - - /// Clear the image locations generated by the last operation - void ClearTemporaryImageLocations() { m_imageLocations.Clear(); } - - /// Delete the in-memory or temporary files generated by the last operation - bool DeleteTemporaryImages(); - - /// Delete the in-memory or temporary files generated by the last operation. This is a static - /// function that can be used to delete the saved locations from an earlier operation, - /// for example after the user has viewed the HTML file. - static bool DeleteTemporaryImages(int flags, const wxArrayString& imageLocations); - - /// Reset the file counter, in case, for example, the same names are required each time - static void SetFileCounter(int counter) { sm_fileCounter = counter; } - - /// Set and get the directory for storing temporary files. If empty, the system - /// temporary directory will be used. - void SetTempDir(const wxString& tempDir) { m_tempDir = tempDir; } - const wxString& GetTempDir() const { return m_tempDir; } - - /// Set and get mapping from point size to HTML font size. There should be 7 elements, - /// one for each HTML font size, each element specifying the maximum point size for that - /// HTML font size. E.g. 8, 10, 13, 17, 22, 29, 100 - void SetFontSizeMapping(const wxArrayInt& fontSizeMapping) { m_fontSizeMapping = fontSizeMapping; } - wxArrayInt GetFontSizeMapping() const { return m_fontSizeMapping; } - -protected: - -// Implementation - -#if wxUSE_STREAMS - virtual bool DoLoadFile(wxRichTextBuffer *buffer, wxInputStream& stream); - virtual bool DoSaveFile(wxRichTextBuffer *buffer, wxOutputStream& stream); - - /// Output character formatting - void BeginCharacterFormatting(const wxTextAttrEx& currentStyle, const wxTextAttrEx& thisStyle, const wxTextAttrEx& paraStyle, wxTextOutputStream& stream ); - void EndCharacterFormatting(const wxTextAttrEx& currentStyle, const wxTextAttrEx& thisStyle, const wxTextAttrEx& paraStyle, wxTextOutputStream& stream ); - - /// Output paragraph formatting - void BeginParagraphFormatting(const wxTextAttrEx& currentStyle, const wxTextAttrEx& thisStyle, wxTextOutputStream& stream); - void EndParagraphFormatting(const wxTextAttrEx& currentStyle, const wxTextAttrEx& thisStyle, wxTextOutputStream& stream); - - /// Output font tag - void OutputFont(const wxTextAttrEx& style, wxTextOutputStream& stream); - - /// Closes lists to level (-1 means close all) - void CloseLists(int level, wxTextOutputStream& str); - - /// Writes an image to its base64 equivalent, or to the memory filesystem, or to a file - void WriteImage(wxRichTextImage* image, wxOutputStream& stream); - - /// Converts from pt to size property compatible height - long PtToSize(long size); - - /// Typical base64 encoder - wxChar* b64enc(unsigned char* input, size_t in_len); - - /// Gets the mime type of the given wxBITMAP_TYPE - const wxChar* GetMimeType(int imageType); - - /// Gets the html equivalent of the specified value - wxString GetAlignment(const wxTextAttrEx& thisStyle); - - /// Generates   array for indentations - wxString SymbolicIndent(long indent); - - /// Finds the html equivalent of the specified bullet - int TypeOfList(const wxTextAttrEx& thisStyle, wxString& tag); -#endif - -// Data members - - wxRichTextBuffer* m_buffer; - - /// Indentation values of the table tags - wxArrayInt m_indents; - - /// Stack of list types: 0 = ol, 1 = ul - wxArrayInt m_listTypes; - - /// Is there any opened font tag? - bool m_font; - - /// Are we in a table? - bool m_inTable; - - /// A list of the image files or in-memory images created by the last operation. - wxArrayString m_imageLocations; - - /// A location for the temporary files - wxString m_tempDir; - - /// A mapping from point size to HTML font size - wxArrayInt m_fontSizeMapping; - - /// A counter for generating filenames - static int sm_fileCounter; -}; - -#endif - // _WX_RICHTEXTXML_H_ diff --git a/wxWidgets/include/wx/richtext/richtextindentspage.h b/wxWidgets/include/wx/richtext/richtextindentspage.h deleted file mode 100644 index fad8c30de3..0000000000 --- a/wxWidgets/include/wx/richtext/richtextindentspage.h +++ /dev/null @@ -1,165 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/richtext/richtextindentspage.h -// Purpose: -// Author: Julian Smart -// Modified by: -// Created: 10/3/2006 2:28:21 PM -// RCS-ID: $Id: richtextindentspage.h 43277 2006-11-10 15:48:46Z JS $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _RICHTEXTINDENTSPAGE_H_ -#define _RICHTEXTINDENTSPAGE_H_ - -/*! - * Includes - */ - -////@begin includes -#include "wx/statline.h" -////@end includes - -/*! - * Forward declarations - */ - -////@begin forward declarations -class wxRichTextCtrl; -////@end forward declarations - -/*! - * Control identifiers - */ - -////@begin control identifiers -#define SYMBOL_WXRICHTEXTINDENTSSPACINGPAGE_STYLE wxRESIZE_BORDER|wxTAB_TRAVERSAL -#define SYMBOL_WXRICHTEXTINDENTSSPACINGPAGE_TITLE _("wxRichTextFontPage") -#define SYMBOL_WXRICHTEXTINDENTSSPACINGPAGE_IDNAME ID_RICHTEXTINDENTSSPACINGPAGE -#define SYMBOL_WXRICHTEXTINDENTSSPACINGPAGE_SIZE wxSize(400, 300) -#define SYMBOL_WXRICHTEXTINDENTSSPACINGPAGE_POSITION wxDefaultPosition -////@end control identifiers - -/*! - * wxRichTextIndentsSpacingPage class declaration - */ - -class WXDLLIMPEXP_RICHTEXT wxRichTextIndentsSpacingPage: public wxPanel -{ - DECLARE_DYNAMIC_CLASS( wxRichTextIndentsSpacingPage ) - DECLARE_EVENT_TABLE() - -public: - /// Constructors - wxRichTextIndentsSpacingPage( ); - wxRichTextIndentsSpacingPage( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = SYMBOL_WXRICHTEXTINDENTSSPACINGPAGE_POSITION, const wxSize& size = SYMBOL_WXRICHTEXTINDENTSSPACINGPAGE_SIZE, long style = SYMBOL_WXRICHTEXTINDENTSSPACINGPAGE_STYLE ); - - /// Creation - bool Create( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = SYMBOL_WXRICHTEXTINDENTSSPACINGPAGE_POSITION, const wxSize& size = SYMBOL_WXRICHTEXTINDENTSSPACINGPAGE_SIZE, long style = SYMBOL_WXRICHTEXTINDENTSSPACINGPAGE_STYLE ); - - /// Initialise members - void Init(); - - /// Creates the controls and sizers - void CreateControls(); - - /// Transfer data from/to window - virtual bool TransferDataFromWindow(); - virtual bool TransferDataToWindow(); - - /// Updates the paragraph preview - void UpdatePreview(); - - /// Gets the attributes associated with the main formatting dialog - wxTextAttrEx* GetAttributes(); - -////@begin wxRichTextIndentsSpacingPage event handler declarations - - /// wxEVT_COMMAND_RADIOBUTTON_SELECTED event handler for ID_RICHTEXTINDENTSSPACINGPAGE_ALIGNMENT_LEFT - void OnAlignmentLeftSelected( wxCommandEvent& event ); - - /// wxEVT_COMMAND_RADIOBUTTON_SELECTED event handler for ID_RICHTEXTINDENTSSPACINGPAGE_ALIGNMENT_RIGHT - void OnAlignmentRightSelected( wxCommandEvent& event ); - - /// wxEVT_COMMAND_RADIOBUTTON_SELECTED event handler for ID_RICHTEXTINDENTSSPACINGPAGE_ALIGNMENT_JUSTIFIED - void OnAlignmentJustifiedSelected( wxCommandEvent& event ); - - /// wxEVT_COMMAND_RADIOBUTTON_SELECTED event handler for ID_RICHTEXTINDENTSSPACINGPAGE_ALIGNMENT_CENTRED - void OnAlignmentCentredSelected( wxCommandEvent& event ); - - /// wxEVT_COMMAND_RADIOBUTTON_SELECTED event handler for ID_RICHTEXTINDENTSSPACINGPAGE_ALIGNMENT_INDETERMINATE - void OnAlignmentIndeterminateSelected( wxCommandEvent& event ); - - /// wxEVT_COMMAND_TEXT_UPDATED event handler for ID_RICHTEXTINDENTSSPACINGPAGE_INDENT_LEFT - void OnIndentLeftUpdated( wxCommandEvent& event ); - - /// wxEVT_COMMAND_TEXT_UPDATED event handler for ID_RICHTEXTINDENTSSPACINGPAGE_INDENT_LEFT_FIRST - void OnIndentLeftFirstUpdated( wxCommandEvent& event ); - - /// wxEVT_COMMAND_TEXT_UPDATED event handler for ID_RICHTEXTINDENTSSPACINGPAGE_INDENT_RIGHT - void OnIndentRightUpdated( wxCommandEvent& event ); - - /// wxEVT_COMMAND_COMBOBOX_SELECTED event handler for ID_RICHTEXTINDENTSSPACINGPAGE_OUTLINELEVEL - void OnRichtextOutlinelevelSelected( wxCommandEvent& event ); - - /// wxEVT_COMMAND_TEXT_UPDATED event handler for ID_RICHTEXTINDENTSSPACINGPAGE_SPACING_BEFORE - void OnSpacingBeforeUpdated( wxCommandEvent& event ); - - /// wxEVT_COMMAND_TEXT_UPDATED event handler for ID_RICHTEXTINDENTSSPACINGPAGE_SPACING_AFTER - void OnSpacingAfterUpdated( wxCommandEvent& event ); - - /// wxEVT_COMMAND_COMBOBOX_SELECTED event handler for ID_RICHTEXTINDENTSSPACINGPAGE_SPACING_LINE - void OnSpacingLineSelected( wxCommandEvent& event ); - -////@end wxRichTextIndentsSpacingPage event handler declarations - -////@begin wxRichTextIndentsSpacingPage member function declarations - - /// Retrieves bitmap resources - wxBitmap GetBitmapResource( const wxString& name ); - - /// Retrieves icon resources - wxIcon GetIconResource( const wxString& name ); -////@end wxRichTextIndentsSpacingPage member function declarations - - /// Should we show tooltips? - static bool ShowToolTips(); - -////@begin wxRichTextIndentsSpacingPage member variables - wxRadioButton* m_alignmentLeft; - wxRadioButton* m_alignmentRight; - wxRadioButton* m_alignmentJustified; - wxRadioButton* m_alignmentCentred; - wxRadioButton* m_alignmentIndeterminate; - wxTextCtrl* m_indentLeft; - wxTextCtrl* m_indentLeftFirst; - wxTextCtrl* m_indentRight; - wxComboBox* m_outlineLevelCtrl; - wxTextCtrl* m_spacingBefore; - wxTextCtrl* m_spacingAfter; - wxComboBox* m_spacingLine; - wxRichTextCtrl* m_previewCtrl; - /// Control identifiers - enum { - ID_RICHTEXTINDENTSSPACINGPAGE = 10100, - ID_RICHTEXTINDENTSSPACINGPAGE_ALIGNMENT_LEFT = 10102, - ID_RICHTEXTINDENTSSPACINGPAGE_ALIGNMENT_RIGHT = 10110, - ID_RICHTEXTINDENTSSPACINGPAGE_ALIGNMENT_JUSTIFIED = 10111, - ID_RICHTEXTINDENTSSPACINGPAGE_ALIGNMENT_CENTRED = 10112, - ID_RICHTEXTINDENTSSPACINGPAGE_ALIGNMENT_INDETERMINATE = 10101, - ID_RICHTEXTINDENTSSPACINGPAGE_INDENT_LEFT = 10103, - ID_RICHTEXTINDENTSSPACINGPAGE_INDENT_LEFT_FIRST = 10104, - ID_RICHTEXTINDENTSSPACINGPAGE_INDENT_RIGHT = 10113, - ID_RICHTEXTINDENTSSPACINGPAGE_OUTLINELEVEL = 10105, - ID_RICHTEXTINDENTSSPACINGPAGE_SPACING_BEFORE = 10114, - ID_RICHTEXTINDENTSSPACINGPAGE_SPACING_AFTER = 10116, - ID_RICHTEXTINDENTSSPACINGPAGE_SPACING_LINE = 10115, - ID_RICHTEXTINDENTSSPACINGPAGE_PREVIEW_CTRL = 10109 - }; -////@end wxRichTextIndentsSpacingPage member variables - - bool m_dontUpdate; -}; - -#endif - // _RICHTEXTINDENTSPAGE_H_ diff --git a/wxWidgets/include/wx/richtext/richtextliststylepage.h b/wxWidgets/include/wx/richtext/richtextliststylepage.h deleted file mode 100644 index 324c9fe970..0000000000 --- a/wxWidgets/include/wx/richtext/richtextliststylepage.h +++ /dev/null @@ -1,276 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/richtext/richtextliststylepage.h -// Purpose: -// Author: Julian Smart -// Modified by: -// Created: 10/18/2006 11:36:37 AM -// RCS-ID: $Id: richtextliststylepage.h 42678 2006-10-29 22:01:06Z JS $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _RICHTEXTLISTSTYLEPAGE_H_ -#define _RICHTEXTLISTSTYLEPAGE_H_ - -/*! - * Includes - */ - -////@begin includes -#include "wx/spinctrl.h" -#include "wx/notebook.h" -#include "wx/statline.h" -////@end includes - -/*! - * Control identifiers - */ - -////@begin control identifiers -#define SYMBOL_WXRICHTEXTLISTSTYLEPAGE_STYLE wxRESIZE_BORDER|wxTAB_TRAVERSAL -#define SYMBOL_WXRICHTEXTLISTSTYLEPAGE_TITLE _("wxRichTextListStylePage") -#define SYMBOL_WXRICHTEXTLISTSTYLEPAGE_IDNAME ID_RICHTEXTLISTSTYLEPAGE -#define SYMBOL_WXRICHTEXTLISTSTYLEPAGE_SIZE wxSize(400, 300) -#define SYMBOL_WXRICHTEXTLISTSTYLEPAGE_POSITION wxDefaultPosition -////@end control identifiers - -/*! - * wxRichTextListStylePage class declaration - */ - -class WXDLLIMPEXP_RICHTEXT wxRichTextListStylePage: public wxPanel -{ - DECLARE_DYNAMIC_CLASS( wxRichTextListStylePage ) - DECLARE_EVENT_TABLE() - -public: - /// Constructors - wxRichTextListStylePage( ); - wxRichTextListStylePage( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = SYMBOL_WXRICHTEXTLISTSTYLEPAGE_POSITION, const wxSize& size = SYMBOL_WXRICHTEXTLISTSTYLEPAGE_SIZE, long style = SYMBOL_WXRICHTEXTLISTSTYLEPAGE_STYLE ); - - /// Creation - bool Create( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = SYMBOL_WXRICHTEXTLISTSTYLEPAGE_POSITION, const wxSize& size = SYMBOL_WXRICHTEXTLISTSTYLEPAGE_SIZE, long style = SYMBOL_WXRICHTEXTLISTSTYLEPAGE_STYLE ); - - /// Initialises member variables - void Init(); - - /// Creates the controls and sizers - void CreateControls(); - - /// Updates the bullets preview - void UpdatePreview(); - - /// Transfer data from/to window - virtual bool TransferDataFromWindow(); - virtual bool TransferDataToWindow(); - - /// Get attributes for selected level - wxRichTextAttr* GetAttributesForSelection(); - - /// Update for symbol-related controls - void OnSymbolUpdate( wxUpdateUIEvent& event ); - - /// Update for number-related controls - void OnNumberUpdate( wxUpdateUIEvent& event ); - - /// Update for standard bullet-related controls - void OnStandardBulletUpdate( wxUpdateUIEvent& event ); - - /// Just transfer to the window - void DoTransferDataToWindow(); - - /// Transfer from the window and preview - void TransferAndPreview(); - -////@begin wxRichTextListStylePage event handler declarations - - /// wxEVT_COMMAND_SPINCTRL_UPDATED event handler for ID_RICHTEXTLISTSTYLEPAGE_LEVEL - void OnLevelUpdated( wxSpinEvent& event ); - - /// wxEVT_SCROLL_LINEUP event handler for ID_RICHTEXTLISTSTYLEPAGE_LEVEL - void OnLevelUp( wxSpinEvent& event ); - - /// wxEVT_SCROLL_LINEDOWN event handler for ID_RICHTEXTLISTSTYLEPAGE_LEVEL - void OnLevelDown( wxSpinEvent& event ); - - /// wxEVT_COMMAND_TEXT_UPDATED event handler for ID_RICHTEXTLISTSTYLEPAGE_LEVEL - void OnLevelTextUpdated( wxCommandEvent& event ); - - /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTLISTSTYLEPAGE_LEVEL - void OnLevelUIUpdate( wxUpdateUIEvent& event ); - - /// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_RICHTEXTLISTSTYLEPAGE_CHOOSE_FONT - void OnChooseFontClick( wxCommandEvent& event ); - - /// wxEVT_COMMAND_LISTBOX_SELECTED event handler for ID_RICHTEXTLISTSTYLEPAGE_STYLELISTBOX - void OnStylelistboxSelected( wxCommandEvent& event ); - - /// wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_RICHTEXTLISTSTYLEPAGE_PERIODCTRL - void OnPeriodctrlClick( wxCommandEvent& event ); - - /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTLISTSTYLEPAGE_PERIODCTRL - void OnPeriodctrlUpdate( wxUpdateUIEvent& event ); - - /// wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_RICHTEXTLISTSTYLEPAGE_PARENTHESESCTRL - void OnParenthesesctrlClick( wxCommandEvent& event ); - - /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTLISTSTYLEPAGE_PARENTHESESCTRL - void OnParenthesesctrlUpdate( wxUpdateUIEvent& event ); - - /// wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_RICHTEXTLISTSTYLEPAGE_RIGHTPARENTHESISCTRL - void OnRightParenthesisCtrlClick( wxCommandEvent& event ); - - /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTLISTSTYLEPAGE_RIGHTPARENTHESISCTRL - void OnRightParenthesisCtrlUpdate( wxUpdateUIEvent& event ); - - /// wxEVT_COMMAND_COMBOBOX_SELECTED event handler for ID_RICHTEXTLISTSTYLEPAGE_BULLETALIGNMENTCTRL - void OnBulletAlignmentCtrlSelected( wxCommandEvent& event ); - - /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTLISTSTYLEPAGE_SYMBOLSTATIC - void OnSymbolstaticUpdate( wxUpdateUIEvent& event ); - - /// wxEVT_COMMAND_COMBOBOX_SELECTED event handler for ID_RICHTEXTLISTSTYLEPAGE_SYMBOLCTRL - void OnSymbolctrlSelected( wxCommandEvent& event ); - - /// wxEVT_COMMAND_TEXT_UPDATED event handler for ID_RICHTEXTLISTSTYLEPAGE_SYMBOLCTRL - void OnSymbolctrlUpdated( wxCommandEvent& event ); - - /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTLISTSTYLEPAGE_SYMBOLCTRL - void OnSymbolctrlUIUpdate( wxUpdateUIEvent& event ); - - /// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_RICHTEXTLISTSTYLEPAGE_CHOOSE_SYMBOL - void OnChooseSymbolClick( wxCommandEvent& event ); - - /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTLISTSTYLEPAGE_CHOOSE_SYMBOL - void OnChooseSymbolUpdate( wxUpdateUIEvent& event ); - - /// wxEVT_COMMAND_COMBOBOX_SELECTED event handler for ID_RICHTEXTLISTSTYLEPAGE_SYMBOLFONTCTRL - void OnSymbolfontctrlSelected( wxCommandEvent& event ); - - /// wxEVT_COMMAND_TEXT_UPDATED event handler for ID_RICHTEXTLISTSTYLEPAGE_SYMBOLFONTCTRL - void OnSymbolfontctrlUpdated( wxCommandEvent& event ); - - /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTLISTSTYLEPAGE_SYMBOLFONTCTRL - void OnSymbolfontctrlUIUpdate( wxUpdateUIEvent& event ); - - /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTLISTSTYLEPAGE_NAMESTATIC - void OnNamestaticUpdate( wxUpdateUIEvent& event ); - - /// wxEVT_COMMAND_COMBOBOX_SELECTED event handler for ID_RICHTEXTLISTSTYLEPAGE_NAMECTRL - void OnNamectrlSelected( wxCommandEvent& event ); - - /// wxEVT_COMMAND_TEXT_UPDATED event handler for ID_RICHTEXTLISTSTYLEPAGE_NAMECTRL - void OnNamectrlUpdated( wxCommandEvent& event ); - - /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTLISTSTYLEPAGE_NAMECTRL - void OnNamectrlUIUpdate( wxUpdateUIEvent& event ); - - /// wxEVT_COMMAND_RADIOBUTTON_SELECTED event handler for ID_RICHTEXTLISTSTYLEPAGE_ALIGNLEFT - void OnRichtextliststylepageAlignleftSelected( wxCommandEvent& event ); - - /// wxEVT_COMMAND_RADIOBUTTON_SELECTED event handler for ID_RICHTEXTLISTSTYLEPAGE_ALIGNRIGHT - void OnRichtextliststylepageAlignrightSelected( wxCommandEvent& event ); - - /// wxEVT_COMMAND_RADIOBUTTON_SELECTED event handler for ID_RICHTEXTLISTSTYLEPAGE_JUSTIFIED - void OnRichtextliststylepageJustifiedSelected( wxCommandEvent& event ); - - /// wxEVT_COMMAND_RADIOBUTTON_SELECTED event handler for ID_RICHTEXTLISTSTYLEPAGE_CENTERED - void OnRichtextliststylepageCenteredSelected( wxCommandEvent& event ); - - /// wxEVT_COMMAND_RADIOBUTTON_SELECTED event handler for ID_RICHTEXTLISTSTYLEPAGE_ALIGNINDETERMINATE - void OnRichtextliststylepageAlignindeterminateSelected( wxCommandEvent& event ); - - /// wxEVT_COMMAND_TEXT_UPDATED event handler for ID_RICHTEXTLISTSTYLEPAGE_INDENTLEFT - void OnIndentLeftUpdated( wxCommandEvent& event ); - - /// wxEVT_COMMAND_TEXT_UPDATED event handler for ID_RICHTEXTLISTSTYLEPAGE_INDENTFIRSTLINE - void OnIndentFirstLineUpdated( wxCommandEvent& event ); - - /// wxEVT_COMMAND_TEXT_UPDATED event handler for ID_RICHTEXTLISTSTYLEPAGE_INDENTRIGHT - void OnIndentRightUpdated( wxCommandEvent& event ); - - /// wxEVT_COMMAND_TEXT_UPDATED event handler for ID_RICHTEXTLISTSTYLEPAGE_SPACINGBEFORE - void OnSpacingBeforeUpdated( wxCommandEvent& event ); - - /// wxEVT_COMMAND_TEXT_UPDATED event handler for ID_RICHTEXTLISTSTYLEPAGE_SPACINGAFTER - void OnSpacingAfterUpdated( wxCommandEvent& event ); - - /// wxEVT_COMMAND_COMBOBOX_SELECTED event handler for ID_RICHTEXTLISTSTYLEPAGE_LINESPACING - void OnLineSpacingSelected( wxCommandEvent& event ); - -////@end wxRichTextListStylePage event handler declarations - -////@begin wxRichTextListStylePage member function declarations - - /// Retrieves bitmap resources - wxBitmap GetBitmapResource( const wxString& name ); - - /// Retrieves icon resources - wxIcon GetIconResource( const wxString& name ); -////@end wxRichTextListStylePage member function declarations - - /// Should we show tooltips? - static bool ShowToolTips(); - -////@begin wxRichTextListStylePage member variables - wxSpinCtrl* m_levelCtrl; - wxListBox* m_styleListBox; - wxCheckBox* m_periodCtrl; - wxCheckBox* m_parenthesesCtrl; - wxCheckBox* m_rightParenthesisCtrl; - wxComboBox* m_bulletAlignmentCtrl; - wxComboBox* m_symbolCtrl; - wxComboBox* m_symbolFontCtrl; - wxComboBox* m_bulletNameCtrl; - wxRadioButton* m_alignmentLeft; - wxRadioButton* m_alignmentRight; - wxRadioButton* m_alignmentJustified; - wxRadioButton* m_alignmentCentred; - wxRadioButton* m_alignmentIndeterminate; - wxTextCtrl* m_indentLeft; - wxTextCtrl* m_indentLeftFirst; - wxTextCtrl* m_indentRight; - wxTextCtrl* m_spacingBefore; - wxTextCtrl* m_spacingAfter; - wxComboBox* m_spacingLine; - wxRichTextCtrl* m_previewCtrl; - /// Control identifiers - enum { - ID_RICHTEXTLISTSTYLEPAGE = 10616, - ID_RICHTEXTLISTSTYLEPAGE_LEVEL = 10617, - ID_RICHTEXTLISTSTYLEPAGE_CHOOSE_FONT = 10604, - ID_RICHTEXTLISTSTYLEPAGE_NOTEBOOK = 10618, - ID_RICHTEXTLISTSTYLEPAGE_BULLETS = 10619, - ID_RICHTEXTLISTSTYLEPAGE_STYLELISTBOX = 10620, - ID_RICHTEXTLISTSTYLEPAGE_PERIODCTRL = 10627, - ID_RICHTEXTLISTSTYLEPAGE_PARENTHESESCTRL = 10626, - ID_RICHTEXTLISTSTYLEPAGE_RIGHTPARENTHESISCTRL = 10602, - ID_RICHTEXTLISTSTYLEPAGE_BULLETALIGNMENTCTRL = 10603, - ID_RICHTEXTLISTSTYLEPAGE_SYMBOLSTATIC = 10621, - ID_RICHTEXTLISTSTYLEPAGE_SYMBOLCTRL = 10622, - ID_RICHTEXTLISTSTYLEPAGE_CHOOSE_SYMBOL = 10623, - ID_RICHTEXTLISTSTYLEPAGE_SYMBOLFONTCTRL = 10625, - ID_RICHTEXTLISTSTYLEPAGE_NAMESTATIC = 10600, - ID_RICHTEXTLISTSTYLEPAGE_NAMECTRL = 10601, - ID_RICHTEXTLISTSTYLEPAGE_SPACING = 10628, - ID_RICHTEXTLISTSTYLEPAGE_ALIGNLEFT = 10629, - ID_RICHTEXTLISTSTYLEPAGE_ALIGNRIGHT = 10630, - ID_RICHTEXTLISTSTYLEPAGE_JUSTIFIED = 10631, - ID_RICHTEXTLISTSTYLEPAGE_CENTERED = 10632, - ID_RICHTEXTLISTSTYLEPAGE_ALIGNINDETERMINATE = 10633, - ID_RICHTEXTLISTSTYLEPAGE_INDENTLEFT = 10634, - ID_RICHTEXTLISTSTYLEPAGE_INDENTFIRSTLINE = 10635, - ID_RICHTEXTLISTSTYLEPAGE_INDENTRIGHT = 10636, - ID_RICHTEXTLISTSTYLEPAGE_SPACINGBEFORE = 10637, - ID_RICHTEXTLISTSTYLEPAGE_SPACINGAFTER = 10638, - ID_RICHTEXTLISTSTYLEPAGE_LINESPACING = 10639, - ID_RICHTEXTLISTSTYLEPAGE_RICHTEXTCTRL = 10640 - }; -////@end wxRichTextListStylePage member variables - - bool m_dontUpdate; - int m_currentLevel; -}; - -#endif - // _RICHTEXTLISTSTYLEPAGE_H_ diff --git a/wxWidgets/include/wx/richtext/richtextprint.h b/wxWidgets/include/wx/richtext/richtextprint.h deleted file mode 100644 index c0185bbbc9..0000000000 --- a/wxWidgets/include/wx/richtext/richtextprint.h +++ /dev/null @@ -1,247 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/richtext/richtextprint.h -// Purpose: Rich text printing classes -// Author: Julian Smart -// Created: 2006-10-23 -// RCS-ID: $Id: richtextprint.h 55146 2008-08-21 16:07:54Z JS $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_RICHTEXTPRINT_H_ -#define _WX_RICHTEXTPRINT_H_ - -#include "wx/defs.h" - -#if wxUSE_RICHTEXT & wxUSE_PRINTING_ARCHITECTURE - -#include "wx/richtext/richtextbuffer.h" - -#include "wx/print.h" -#include "wx/printdlg.h" - -#define wxRICHTEXT_PRINT_MAX_PAGES 99999 - -// Header/footer page identifiers -enum wxRichTextOddEvenPage { - wxRICHTEXT_PAGE_ODD, - wxRICHTEXT_PAGE_EVEN, - wxRICHTEXT_PAGE_ALL -}; - -// Header/footer text locations -enum wxRichTextPageLocation { - wxRICHTEXT_PAGE_LEFT, - wxRICHTEXT_PAGE_CENTRE, - wxRICHTEXT_PAGE_RIGHT -}; - -/*! - * Header/footer data - */ - -class WXDLLIMPEXP_RICHTEXT wxRichTextHeaderFooterData: public wxObject -{ -public: - wxRichTextHeaderFooterData() { Init(); } - wxRichTextHeaderFooterData(const wxRichTextHeaderFooterData& data): wxObject() { Copy(data); } - - /// Initialise - void Init() { m_headerMargin = 20; m_footerMargin = 20; m_showOnFirstPage = true; } - - /// Copy - void Copy(const wxRichTextHeaderFooterData& data); - - /// Assignment - void operator= (const wxRichTextHeaderFooterData& data) { Copy(data); } - - /// Set/get header text, e.g. wxRICHTEXT_PAGE_ODD, wxRICHTEXT_PAGE_LEFT - void SetHeaderText(const wxString& text, wxRichTextOddEvenPage page = wxRICHTEXT_PAGE_ALL, wxRichTextPageLocation location = wxRICHTEXT_PAGE_CENTRE); - wxString GetHeaderText(wxRichTextOddEvenPage page = wxRICHTEXT_PAGE_EVEN, wxRichTextPageLocation location = wxRICHTEXT_PAGE_CENTRE) const; - - /// Set/get footer text, e.g. wxRICHTEXT_PAGE_ODD, wxRICHTEXT_PAGE_LEFT - void SetFooterText(const wxString& text, wxRichTextOddEvenPage page = wxRICHTEXT_PAGE_ALL, wxRichTextPageLocation location = wxRICHTEXT_PAGE_CENTRE); - wxString GetFooterText(wxRichTextOddEvenPage page = wxRICHTEXT_PAGE_EVEN, wxRichTextPageLocation location = wxRICHTEXT_PAGE_CENTRE) const; - - /// Set/get text - void SetText(const wxString& text, int headerFooter, wxRichTextOddEvenPage page, wxRichTextPageLocation location); - wxString GetText(int headerFooter, wxRichTextOddEvenPage page, wxRichTextPageLocation location) const; - - /// Set/get margins between text and header or footer, in tenths of a millimeter - void SetMargins(int headerMargin, int footerMargin) { m_headerMargin = headerMargin; m_footerMargin = footerMargin; } - int GetHeaderMargin() const { return m_headerMargin; } - int GetFooterMargin() const { return m_footerMargin; } - - /// Set/get whether to show header or footer on first page - void SetShowOnFirstPage(bool showOnFirstPage) { m_showOnFirstPage = showOnFirstPage; } - bool GetShowOnFirstPage() const { return m_showOnFirstPage; } - - /// Clear all text - void Clear(); - - /// Set/get font - void SetFont(const wxFont& font) { m_font = font; } - const wxFont& GetFont() const { return m_font; } - - /// Set/get colour - void SetTextColour(const wxColour& col) { m_colour = col; } - const wxColour& GetTextColour() const { return m_colour; } - - DECLARE_CLASS(wxRichTextHeaderFooterData) - -private: - - // Strings for left, centre, right, top, bottom, odd, even - wxString m_text[12]; - wxFont m_font; - wxColour m_colour; - int m_headerMargin; - int m_footerMargin; - bool m_showOnFirstPage; -}; - -/*! - * wxRichTextPrintout - */ - -class WXDLLIMPEXP_RICHTEXT wxRichTextPrintout : public wxPrintout -{ -public: - wxRichTextPrintout(const wxString& title = wxT("Printout")); - virtual ~wxRichTextPrintout(); - - /// The buffer to print - void SetRichTextBuffer(wxRichTextBuffer* buffer) { m_richTextBuffer = buffer; } - wxRichTextBuffer* GetRichTextBuffer() const { return m_richTextBuffer; } - - /// Set/get header/footer data - void SetHeaderFooterData(const wxRichTextHeaderFooterData& data) { m_headerFooterData = data; } - const wxRichTextHeaderFooterData& GetHeaderFooterData() const { return m_headerFooterData; } - - /// Sets margins in 10ths of millimetre. Defaults to 1 inch for margins. - void SetMargins(int top = 254, int bottom = 254, int left = 254, int right = 254); - - /// Calculate scaling and rectangles, setting the device context scaling - void CalculateScaling(wxDC* dc, wxRect& textRect, wxRect& headerRect, wxRect& footerRect); - - // wxPrintout virtual functions - virtual bool OnPrintPage(int page); - virtual bool HasPage(int page); - virtual void GetPageInfo(int *minPage, int *maxPage, int *selPageFrom, int *selPageTo); - virtual bool OnBeginDocument(int startPage, int endPage); - virtual void OnPreparePrinting(); - -private: - - /// Renders one page into dc - void RenderPage(wxDC *dc, int page); - - /// Substitute keywords - static bool SubstituteKeywords(wxString& str, const wxString& title, int pageNum, int pageCount); - -private: - - wxRichTextBuffer* m_richTextBuffer; - int m_numPages; - wxArrayInt m_pageBreaksStart; - wxArrayInt m_pageBreaksEnd; - int m_marginLeft, m_marginTop, m_marginRight, m_marginBottom; - - wxRichTextHeaderFooterData m_headerFooterData; - - DECLARE_NO_COPY_CLASS(wxRichTextPrintout) -}; - -/* - *! wxRichTextPrinting - * A simple interface to perform wxRichTextBuffer printing. - */ - -class WXDLLIMPEXP_RICHTEXT wxRichTextPrinting : public wxObject -{ -public: - wxRichTextPrinting(const wxString& name = wxT("Printing"), wxWindow *parentWindow = NULL); - virtual ~wxRichTextPrinting(); - - /// Preview the file or buffer - bool PreviewFile(const wxString& richTextFile); - bool PreviewBuffer(const wxRichTextBuffer& buffer); - - /// Print the file or buffer - bool PrintFile(const wxString& richTextFile); - bool PrintBuffer(const wxRichTextBuffer& buffer); - - /// Shows page setup dialog - void PageSetup(); - - /// Set/get header/footer data - void SetHeaderFooterData(const wxRichTextHeaderFooterData& data) { m_headerFooterData = data; } - const wxRichTextHeaderFooterData& GetHeaderFooterData() const { return m_headerFooterData; } - - /// Set/get header text, e.g. wxRICHTEXT_PAGE_ODD, wxRICHTEXT_PAGE_LEFT - void SetHeaderText(const wxString& text, wxRichTextOddEvenPage page = wxRICHTEXT_PAGE_ALL, wxRichTextPageLocation location = wxRICHTEXT_PAGE_CENTRE); - wxString GetHeaderText(wxRichTextOddEvenPage page = wxRICHTEXT_PAGE_EVEN, wxRichTextPageLocation location = wxRICHTEXT_PAGE_CENTRE) const; - - /// Set/get footer text, e.g. wxRICHTEXT_PAGE_ODD, wxRICHTEXT_PAGE_LEFT - void SetFooterText(const wxString& text, wxRichTextOddEvenPage page = wxRICHTEXT_PAGE_ALL, wxRichTextPageLocation location = wxRICHTEXT_PAGE_CENTRE); - wxString GetFooterText(wxRichTextOddEvenPage page = wxRICHTEXT_PAGE_EVEN, wxRichTextPageLocation location = wxRICHTEXT_PAGE_CENTRE) const; - - /// Show header/footer on first page, or not - void SetShowOnFirstPage(bool show) { m_headerFooterData.SetShowOnFirstPage(show); } - - /// Set the font - void SetHeaderFooterFont(const wxFont& font) { m_headerFooterData.SetFont(font); } - - /// Set the colour - void SetHeaderFooterTextColour(const wxColour& font) { m_headerFooterData.SetTextColour(font); } - - /// Get print and page setup data - wxPrintData *GetPrintData(); - wxPageSetupDialogData *GetPageSetupData() { return m_pageSetupData; } - - /// Set print and page setup data - void SetPrintData(const wxPrintData& printData); - void SetPageSetupData(const wxPageSetupData& pageSetupData); - - /// Set the rich text buffer pointer, deleting the existing object if present - void SetRichTextBufferPreview(wxRichTextBuffer* buf); - wxRichTextBuffer* GetRichTextBufferPreview() const { return m_richTextBufferPreview; } - - void SetRichTextBufferPrinting(wxRichTextBuffer* buf); - wxRichTextBuffer* GetRichTextBufferPrinting() const { return m_richTextBufferPrinting; } - - /// Set/get the parent window - void SetParentWindow(wxWindow* parent) { m_parentWindow = parent; } - wxWindow* GetParentWindow() const { return m_parentWindow; } - - /// Set/get the title - void SetTitle(const wxString& title) { m_title = title; } - const wxString& GetTitle() const { return m_title; } - - /// Set/get the preview rect - void SetPreviewRect(const wxRect& rect) { m_previewRect = rect; } - const wxRect& GetPreviewRect() const { return m_previewRect; } - -protected: - virtual wxRichTextPrintout *CreatePrintout(); - virtual bool DoPreview(wxRichTextPrintout *printout1, wxRichTextPrintout *printout2); - virtual bool DoPrint(wxRichTextPrintout *printout); - -private: - wxPrintData* m_printData; - wxPageSetupDialogData* m_pageSetupData; - - wxRichTextHeaderFooterData m_headerFooterData; - wxString m_title; - wxWindow* m_parentWindow; - wxRichTextBuffer* m_richTextBufferPreview; - wxRichTextBuffer* m_richTextBufferPrinting; - wxRect m_previewRect; - - DECLARE_NO_COPY_CLASS(wxRichTextPrinting) -}; - -#endif // wxUSE_RICHTEXT & wxUSE_PRINTING_ARCHITECTURE - -#endif // _WX_RICHTEXTPRINT_H_ - diff --git a/wxWidgets/include/wx/richtext/richtextstyledlg.h b/wxWidgets/include/wx/richtext/richtextstyledlg.h deleted file mode 100644 index 5b5bcff769..0000000000 --- a/wxWidgets/include/wx/richtext/richtextstyledlg.h +++ /dev/null @@ -1,241 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/richtext/richtextstyledlg.h -// Purpose: -// Author: Julian Smart -// Modified by: -// Created: 10/5/2006 12:05:31 PM -// RCS-ID: $Id: richtextstyledlg.h 52117 2008-02-26 15:04:54Z JS $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _RICHTEXTSTYLEDLG_H_ -#define _RICHTEXTSTYLEDLG_H_ - -/*! - * Includes - */ - -////@begin includes -////@end includes - -#include "wx/richtext/richtextbuffer.h" -#include "wx/richtext/richtextstyles.h" -#include "wx/richtext/richtextctrl.h" - -/*! - * Forward declarations - */ - -////@begin forward declarations -class wxBoxSizer; -class wxRichTextStyleListCtrl; -class wxRichTextCtrl; -////@end forward declarations - -class WXDLLIMPEXP_FWD_CORE wxButton; -class WXDLLIMPEXP_FWD_CORE wxCheckBox; - -/*! - * Control identifiers - */ - -////@begin control identifiers -#define SYMBOL_WXRICHTEXTSTYLEORGANISERDIALOG_STYLE wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER|wxSYSTEM_MENU|wxCLOSE_BOX -#define SYMBOL_WXRICHTEXTSTYLEORGANISERDIALOG_TITLE _("Style Organiser") -#define SYMBOL_WXRICHTEXTSTYLEORGANISERDIALOG_IDNAME ID_RICHTEXTSTYLEORGANISERDIALOG -#define SYMBOL_WXRICHTEXTSTYLEORGANISERDIALOG_SIZE wxSize(400, 300) -#define SYMBOL_WXRICHTEXTSTYLEORGANISERDIALOG_POSITION wxDefaultPosition -////@end control identifiers - -/*! - * Flags for specifying permitted operations - */ - -#define wxRICHTEXT_ORGANISER_DELETE_STYLES 0x0001 -#define wxRICHTEXT_ORGANISER_CREATE_STYLES 0x0002 -#define wxRICHTEXT_ORGANISER_APPLY_STYLES 0x0004 -#define wxRICHTEXT_ORGANISER_EDIT_STYLES 0x0008 -#define wxRICHTEXT_ORGANISER_RENAME_STYLES 0x0010 -#define wxRICHTEXT_ORGANISER_OK_CANCEL 0x0020 -#define wxRICHTEXT_ORGANISER_RENUMBER 0x0040 - -// The permitted style types to show -#define wxRICHTEXT_ORGANISER_SHOW_CHARACTER 0x0100 -#define wxRICHTEXT_ORGANISER_SHOW_PARAGRAPH 0x0200 -#define wxRICHTEXT_ORGANISER_SHOW_LIST 0x0400 -#define wxRICHTEXT_ORGANISER_SHOW_ALL 0x0800 - -// Common combinations -#define wxRICHTEXT_ORGANISER_ORGANISE (wxRICHTEXT_ORGANISER_SHOW_ALL|wxRICHTEXT_ORGANISER_DELETE_STYLES|wxRICHTEXT_ORGANISER_CREATE_STYLES|wxRICHTEXT_ORGANISER_APPLY_STYLES|wxRICHTEXT_ORGANISER_EDIT_STYLES|wxRICHTEXT_ORGANISER_RENAME_STYLES) -#define wxRICHTEXT_ORGANISER_BROWSE (wxRICHTEXT_ORGANISER_SHOW_ALL|wxRICHTEXT_ORGANISER_OK_CANCEL) -#define wxRICHTEXT_ORGANISER_BROWSE_NUMBERING (wxRICHTEXT_ORGANISER_SHOW_LIST|wxRICHTEXT_ORGANISER_OK_CANCEL|wxRICHTEXT_ORGANISER_RENUMBER) - -/*! - * wxRichTextStyleOrganiserDialog class declaration - */ - -class WXDLLIMPEXP_RICHTEXT wxRichTextStyleOrganiserDialog: public wxDialog -{ - DECLARE_DYNAMIC_CLASS( wxRichTextStyleOrganiserDialog ) - DECLARE_EVENT_TABLE() - -public: - /// Constructors - wxRichTextStyleOrganiserDialog( ); - wxRichTextStyleOrganiserDialog( int flags, wxRichTextStyleSheet* sheet, wxRichTextCtrl* ctrl, wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& caption = SYMBOL_WXRICHTEXTSTYLEORGANISERDIALOG_TITLE, const wxPoint& pos = SYMBOL_WXRICHTEXTSTYLEORGANISERDIALOG_POSITION, const wxSize& size = SYMBOL_WXRICHTEXTSTYLEORGANISERDIALOG_SIZE, long style = SYMBOL_WXRICHTEXTSTYLEORGANISERDIALOG_STYLE ); - - /// Creation - bool Create( int flags, wxRichTextStyleSheet* sheet, wxRichTextCtrl* ctrl, wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& caption = SYMBOL_WXRICHTEXTSTYLEORGANISERDIALOG_TITLE, const wxPoint& pos = SYMBOL_WXRICHTEXTSTYLEORGANISERDIALOG_POSITION, const wxSize& size = SYMBOL_WXRICHTEXTSTYLEORGANISERDIALOG_SIZE, long style = SYMBOL_WXRICHTEXTSTYLEORGANISERDIALOG_STYLE ); - - /// Creates the controls and sizers - void CreateControls(); - - /// Initialise member variables - void Init(); - - /// Transfer data from/to window - virtual bool TransferDataFromWindow(); - virtual bool TransferDataToWindow(); - - /// Set/get style sheet - void SetStyleSheet(wxRichTextStyleSheet* sheet) { m_richTextStyleSheet = sheet; } - wxRichTextStyleSheet* GetStyleSheet() const { return m_richTextStyleSheet; } - - /// Set/get control - void SetRichTextCtrl(wxRichTextCtrl* ctrl) { m_richTextCtrl = ctrl; } - wxRichTextCtrl* GetRichTextCtrl() const { return m_richTextCtrl; } - - /// Set/get flags - void SetFlags(int flags) { m_flags = flags; } - int GetFlags() const { return m_flags; } - - /// Show preview for given or selected preview - void ShowPreview(int sel = -1); - - /// Clears the preview - void ClearPreview(); - - /// List selection - void OnListSelection(wxCommandEvent& event); - - /// Get/set restart numbering boolean - bool GetRestartNumbering() const { return m_restartNumbering; } - void SetRestartNumbering(bool restartNumbering) { m_restartNumbering = restartNumbering; } - - /// Get selected style name or definition - wxString GetSelectedStyle() const; - wxRichTextStyleDefinition* GetSelectedStyleDefinition() const; - - /// Apply the style - bool ApplyStyle(wxRichTextCtrl* ctrl = NULL); - - /// Should we show tooltips? - static bool ShowToolTips() { return sm_showToolTips; } - - /// Determines whether tooltips will be shown - static void SetShowToolTips(bool show) { sm_showToolTips = show; } - -////@begin wxRichTextStyleOrganiserDialog event handler declarations - - /// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_RICHTEXTSTYLEORGANISERDIALOG_NEW_CHAR - void OnNewCharClick( wxCommandEvent& event ); - - /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTSTYLEORGANISERDIALOG_NEW_CHAR - void OnNewCharUpdate( wxUpdateUIEvent& event ); - - /// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_RICHTEXTSTYLEORGANISERDIALOG_NEW_PARA - void OnNewParaClick( wxCommandEvent& event ); - - /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTSTYLEORGANISERDIALOG_NEW_PARA - void OnNewParaUpdate( wxUpdateUIEvent& event ); - - /// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_RICHTEXTSTYLEORGANISERDIALOG_NEW_LIST - void OnNewListClick( wxCommandEvent& event ); - - /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTSTYLEORGANISERDIALOG_NEW_LIST - void OnNewListUpdate( wxUpdateUIEvent& event ); - - /// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_RICHTEXTSTYLEORGANISERDIALOG_APPLY - void OnApplyClick( wxCommandEvent& event ); - - /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTSTYLEORGANISERDIALOG_APPLY - void OnApplyUpdate( wxUpdateUIEvent& event ); - - /// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_RICHTEXTSTYLEORGANISERDIALOG_RENAME - void OnRenameClick( wxCommandEvent& event ); - - /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTSTYLEORGANISERDIALOG_RENAME - void OnRenameUpdate( wxUpdateUIEvent& event ); - - /// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_RICHTEXTSTYLEORGANISERDIALOG_EDIT - void OnEditClick( wxCommandEvent& event ); - - /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTSTYLEORGANISERDIALOG_EDIT - void OnEditUpdate( wxUpdateUIEvent& event ); - - /// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_RICHTEXTSTYLEORGANISERDIALOG_DELETE - void OnDeleteClick( wxCommandEvent& event ); - - /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTSTYLEORGANISERDIALOG_DELETE - void OnDeleteUpdate( wxUpdateUIEvent& event ); - -////@end wxRichTextStyleOrganiserDialog event handler declarations - -////@begin wxRichTextStyleOrganiserDialog member function declarations - - /// Retrieves bitmap resources - wxBitmap GetBitmapResource( const wxString& name ); - - /// Retrieves icon resources - wxIcon GetIconResource( const wxString& name ); -////@end wxRichTextStyleOrganiserDialog member function declarations - -////@begin wxRichTextStyleOrganiserDialog member variables - wxBoxSizer* m_innerSizer; - wxBoxSizer* m_buttonSizerParent; - wxRichTextStyleListCtrl* m_stylesListBox; - wxRichTextCtrl* m_previewCtrl; - wxBoxSizer* m_buttonSizer; - wxButton* m_newCharacter; - wxButton* m_newParagraph; - wxButton* m_newList; - wxButton* m_applyStyle; - wxButton* m_renameStyle; - wxButton* m_editStyle; - wxButton* m_deleteStyle; - wxButton* m_closeButton; - wxBoxSizer* m_bottomButtonSizer; - wxCheckBox* m_restartNumberingCtrl; - wxButton* m_okButton; - wxButton* m_cancelButton; - /// Control identifiers - enum { - ID_RICHTEXTSTYLEORGANISERDIALOG = 10500, - ID_RICHTEXTSTYLEORGANISERDIALOG_STYLES = 10501, - ID_RICHTEXTSTYLEORGANISERDIALOG_CURRENT_STYLE = 10510, - ID_RICHTEXTSTYLEORGANISERDIALOG_PREVIEW = 10509, - ID_RICHTEXTSTYLEORGANISERDIALOG_NEW_CHAR = 10504, - ID_RICHTEXTSTYLEORGANISERDIALOG_NEW_PARA = 10505, - ID_RICHTEXTSTYLEORGANISERDIALOG_NEW_LIST = 10508, - ID_RICHTEXTSTYLEORGANISERDIALOG_APPLY = 10503, - ID_RICHTEXTSTYLEORGANISERDIALOG_RENAME = 10502, - ID_RICHTEXTSTYLEORGANISERDIALOG_EDIT = 10506, - ID_RICHTEXTSTYLEORGANISERDIALOG_DELETE = 10507, - ID_RICHTEXTSTYLEORGANISERDIALOG_RESTART_NUMBERING = 10511 - }; -////@end wxRichTextStyleOrganiserDialog member variables - -private: - - wxRichTextCtrl* m_richTextCtrl; - wxRichTextStyleSheet* m_richTextStyleSheet; - - bool m_dontUpdate; - int m_flags; - static bool sm_showToolTips; - bool m_restartNumbering; -}; - -#endif - // _RICHTEXTSTYLEDLG_H_ diff --git a/wxWidgets/include/wx/richtext/richtextstylepage.h b/wxWidgets/include/wx/richtext/richtextstylepage.h deleted file mode 100644 index 73b0184990..0000000000 --- a/wxWidgets/include/wx/richtext/richtextstylepage.h +++ /dev/null @@ -1,91 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/richtext/richtextstylepage.h -// Purpose: -// Author: Julian Smart -// Modified by: -// Created: 10/5/2006 11:34:55 AM -// RCS-ID: $Id: richtextstylepage.h 42678 2006-10-29 22:01:06Z JS $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _RICHTEXTSTYLEPAGE_H_ -#define _RICHTEXTSTYLEPAGE_H_ - -/*! - * Control identifiers - */ - -////@begin control identifiers -#define SYMBOL_WXRICHTEXTSTYLEPAGE_STYLE wxRESIZE_BORDER|wxTAB_TRAVERSAL -#define SYMBOL_WXRICHTEXTSTYLEPAGE_TITLE _("wxRichTextStylePage") -#define SYMBOL_WXRICHTEXTSTYLEPAGE_IDNAME ID_RICHTEXTSTYLEPAGE -#define SYMBOL_WXRICHTEXTSTYLEPAGE_SIZE wxSize(400, 300) -#define SYMBOL_WXRICHTEXTSTYLEPAGE_POSITION wxDefaultPosition -////@end control identifiers - -/*! - * wxRichTextStylePage class declaration - */ - -class wxRichTextStylePage: public wxPanel -{ - DECLARE_DYNAMIC_CLASS( wxRichTextStylePage ) - DECLARE_EVENT_TABLE() - -public: - /// Constructors - wxRichTextStylePage( ); - wxRichTextStylePage( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = SYMBOL_WXRICHTEXTSTYLEPAGE_POSITION, const wxSize& size = SYMBOL_WXRICHTEXTSTYLEPAGE_SIZE, long style = SYMBOL_WXRICHTEXTSTYLEPAGE_STYLE ); - - /// Creation - bool Create( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = SYMBOL_WXRICHTEXTSTYLEPAGE_POSITION, const wxSize& size = SYMBOL_WXRICHTEXTSTYLEPAGE_SIZE, long style = SYMBOL_WXRICHTEXTSTYLEPAGE_STYLE ); - - /// Initialise members - void Init(); - - /// Creates the controls and sizers - void CreateControls(); - - /// Transfer data from/to window - virtual bool TransferDataFromWindow(); - virtual bool TransferDataToWindow(); - - /// Gets the attributes associated with the main formatting dialog - wxTextAttrEx* GetAttributes(); - -////@begin wxRichTextStylePage event handler declarations - - /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTSTYLEPAGE_NEXT_STYLE - void OnNextStyleUpdate( wxUpdateUIEvent& event ); - -////@end wxRichTextStylePage event handler declarations - -////@begin wxRichTextStylePage member function declarations - - /// Retrieves bitmap resources - wxBitmap GetBitmapResource( const wxString& name ); - - /// Retrieves icon resources - wxIcon GetIconResource( const wxString& name ); -////@end wxRichTextStylePage member function declarations - - /// Should we show tooltips? - static bool ShowToolTips(); - -////@begin wxRichTextStylePage member variables - wxTextCtrl* m_styleName; - wxComboBox* m_basedOn; - wxComboBox* m_nextStyle; - /// Control identifiers - enum { - ID_RICHTEXTSTYLEPAGE = 10403, - ID_RICHTEXTSTYLEPAGE_STYLE_NAME = 10404, - ID_RICHTEXTSTYLEPAGE_BASED_ON = 10405, - ID_RICHTEXTSTYLEPAGE_NEXT_STYLE = 10406 - }; -////@end wxRichTextStylePage member variables -}; - -#endif - // _RICHTEXTSTYLEPAGE_H_ diff --git a/wxWidgets/include/wx/richtext/richtextstyles.h b/wxWidgets/include/wx/richtext/richtextstyles.h deleted file mode 100644 index 158e8a585b..0000000000 --- a/wxWidgets/include/wx/richtext/richtextstyles.h +++ /dev/null @@ -1,683 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/richtext/richtextstyles.h -// Purpose: Style management for wxRichTextCtrl -// Author: Julian Smart -// Modified by: -// Created: 2005-09-30 -// RCS-ID: $Id: richtextstyles.h 49804 2007-11-10 01:09:42Z VZ $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_RICHTEXTSTYLES_H_ -#define _WX_RICHTEXTSTYLES_H_ - -/*! - * Includes - */ - -#include "wx/defs.h" - -#if wxUSE_RICHTEXT - -#include "wx/richtext/richtextbuffer.h" - -#if wxUSE_HTML -#include "wx/htmllbox.h" -#endif - -#if wxUSE_COMBOCTRL -#include "wx/combo.h" -#endif - -#include "wx/choice.h" - -/*! - * Forward declarations - */ - -class WXDLLIMPEXP_FWD_RICHTEXT wxRichTextCtrl; -class WXDLLIMPEXP_FWD_RICHTEXT wxRichTextBuffer; - -/*! - * wxRichTextStyleDefinition class declaration - * A base class for paragraph and character styles. - */ - -class WXDLLIMPEXP_RICHTEXT wxRichTextStyleDefinition: public wxObject -{ - DECLARE_CLASS(wxRichTextStyleDefinition) -public: - - /// Copy constructors - wxRichTextStyleDefinition(const wxRichTextStyleDefinition& def) - : wxObject() - { - Init(); - Copy(def); - } - - /// Default constructor - wxRichTextStyleDefinition(const wxString& name = wxEmptyString) { Init(); m_name = name; } - - /// Destructor - virtual ~wxRichTextStyleDefinition() {} - - /// Initialises members - void Init() {} - - /// Copies from def - void Copy(const wxRichTextStyleDefinition& def); - - /// Equality test - bool Eq(const wxRichTextStyleDefinition& def) const; - - /// Assignment operator - void operator =(const wxRichTextStyleDefinition& def) { Copy(def); } - - /// Equality operator - bool operator ==(const wxRichTextStyleDefinition& def) const { return Eq(def); } - - /// Override to clone the object - virtual wxRichTextStyleDefinition* Clone() const = 0; - - /// Sets and gets the name of the style - void SetName(const wxString& name) { m_name = name; } - const wxString& GetName() const { return m_name; } - - /// Sets and gets the style description - void SetDescription(const wxString& descr) { m_description = descr; } - const wxString& GetDescription() const { return m_description; } - - /// Sets and gets the name of the style that this style is based on - void SetBaseStyle(const wxString& name) { m_baseStyle = name; } - const wxString& GetBaseStyle() const { return m_baseStyle; } - - /// Sets and gets the style - void SetStyle(const wxRichTextAttr& style) { m_style = style; } - const wxRichTextAttr& GetStyle() const { return m_style; } - wxRichTextAttr& GetStyle() { return m_style; } - - /// Gets the style combined with the base style - virtual wxRichTextAttr GetStyleMergedWithBase(const wxRichTextStyleSheet* sheet) const; - -protected: - wxString m_name; - wxString m_baseStyle; - wxString m_description; - wxRichTextAttr m_style; -}; - -/*! - * wxRichTextCharacterStyleDefinition class declaration - */ - -class WXDLLIMPEXP_RICHTEXT wxRichTextCharacterStyleDefinition: public wxRichTextStyleDefinition -{ - DECLARE_DYNAMIC_CLASS(wxRichTextCharacterStyleDefinition) -public: - - /// Copy constructor - wxRichTextCharacterStyleDefinition(const wxRichTextCharacterStyleDefinition& def): wxRichTextStyleDefinition(def) {} - - /// Default constructor - wxRichTextCharacterStyleDefinition(const wxString& name = wxEmptyString): - wxRichTextStyleDefinition(name) {} - - /// Destructor - virtual ~wxRichTextCharacterStyleDefinition() {} - - /// Clones the object - virtual wxRichTextStyleDefinition* Clone() const { return new wxRichTextCharacterStyleDefinition(*this); } - -protected: -}; - -/*! - * wxRichTextParagraphStyleDefinition class declaration - */ - -class WXDLLIMPEXP_RICHTEXT wxRichTextParagraphStyleDefinition: public wxRichTextStyleDefinition -{ - DECLARE_DYNAMIC_CLASS(wxRichTextParagraphStyleDefinition) -public: - - /// Copy constructor - wxRichTextParagraphStyleDefinition(const wxRichTextParagraphStyleDefinition& def): wxRichTextStyleDefinition(def) { m_nextStyle = def.m_nextStyle; } - - /// Default constructor - wxRichTextParagraphStyleDefinition(const wxString& name = wxEmptyString): - wxRichTextStyleDefinition(name) {} - - // Destructor - virtual ~wxRichTextParagraphStyleDefinition() {} - - /// Sets and gets the next style - void SetNextStyle(const wxString& name) { m_nextStyle = name; } - const wxString& GetNextStyle() const { return m_nextStyle; } - - /// Copies from def - void Copy(const wxRichTextParagraphStyleDefinition& def); - - /// Assignment operator - void operator =(const wxRichTextParagraphStyleDefinition& def) { Copy(def); } - - /// Equality operator - bool operator ==(const wxRichTextParagraphStyleDefinition& def) const; - - /// Clones the object - virtual wxRichTextStyleDefinition* Clone() const { return new wxRichTextParagraphStyleDefinition(*this); } - -protected: - - /// The next style to use when adding a paragraph after this style. - wxString m_nextStyle; -}; - -/*! - * wxRichTextListStyleDefinition class declaration - */ - -class WXDLLIMPEXP_RICHTEXT wxRichTextListStyleDefinition: public wxRichTextParagraphStyleDefinition -{ - DECLARE_DYNAMIC_CLASS(wxRichTextListStyleDefinition) -public: - - /// Copy constructor - wxRichTextListStyleDefinition(const wxRichTextListStyleDefinition& def): wxRichTextParagraphStyleDefinition(def) { Init(); Copy(def); } - - /// Default constructor - wxRichTextListStyleDefinition(const wxString& name = wxEmptyString): - wxRichTextParagraphStyleDefinition(name) { Init(); } - - /// Destructor - virtual ~wxRichTextListStyleDefinition() {} - - /// Copies from def - void Copy(const wxRichTextListStyleDefinition& def); - - /// Assignment operator - void operator =(const wxRichTextListStyleDefinition& def) { Copy(def); } - - /// Equality operator - bool operator ==(const wxRichTextListStyleDefinition& def) const; - - /// Clones the object - virtual wxRichTextStyleDefinition* Clone() const { return new wxRichTextListStyleDefinition(*this); } - - /// Sets/gets the attributes for the given level - void SetLevelAttributes(int i, const wxRichTextAttr& attr); - wxRichTextAttr* GetLevelAttributes(int i); - const wxRichTextAttr* GetLevelAttributes(int i) const; - - /// Convenience function for setting the major attributes for a list level specification - void SetAttributes(int i, int leftIndent, int leftSubIndent, int bulletStyle, const wxString& bulletSymbol = wxEmptyString); - - /// Finds the level corresponding to the given indentation - int FindLevelForIndent(int indent) const; - - /// Combine the base and list style with a paragraph style, using the given indent (from which - /// an appropriate level is found) - wxRichTextAttr CombineWithParagraphStyle(int indent, const wxRichTextAttr& paraStyle, wxRichTextStyleSheet* styleSheet = NULL); - - /// Combine the base and list style, using the given indent (from which - /// an appropriate level is found) - wxRichTextAttr GetCombinedStyle(int indent, wxRichTextStyleSheet* styleSheet = NULL); - - /// Combine the base and list style, using the given level from which - /// an appropriate level is found) - wxRichTextAttr GetCombinedStyleForLevel(int level, wxRichTextStyleSheet* styleSheet = NULL); - - /// Gets the number of available levels - int GetLevelCount() const { return 10; } - - /// Is this a numbered list? - bool IsNumbered(int i) const; - -protected: - - /// The styles for each level (up to 10) - wxRichTextAttr m_levelStyles[10]; -}; - -/*! - * The style sheet - */ - -class WXDLLIMPEXP_RICHTEXT wxRichTextStyleSheet: public wxObject -{ - DECLARE_CLASS( wxRichTextStyleSheet ) - -public: - /// Constructors - wxRichTextStyleSheet(const wxRichTextStyleSheet& sheet) - : wxObject() - { - Init(); - Copy(sheet); - } - wxRichTextStyleSheet() { Init(); } - virtual ~wxRichTextStyleSheet(); - - /// Initialisation - void Init(); - - /// Copy - void Copy(const wxRichTextStyleSheet& sheet); - - /// Assignment - void operator=(const wxRichTextStyleSheet& sheet) { Copy(sheet); } - - /// Equality - bool operator==(const wxRichTextStyleSheet& sheet) const; - - /// Add a definition to the character style list - bool AddCharacterStyle(wxRichTextCharacterStyleDefinition* def); - - /// Add a definition to the paragraph style list - bool AddParagraphStyle(wxRichTextParagraphStyleDefinition* def); - - /// Add a definition to the list style list - bool AddListStyle(wxRichTextListStyleDefinition* def); - - /// Add a definition to the appropriate style list - bool AddStyle(wxRichTextStyleDefinition* def); - - /// Remove a character style - bool RemoveCharacterStyle(wxRichTextStyleDefinition* def, bool deleteStyle = false) { return RemoveStyle(m_characterStyleDefinitions, def, deleteStyle); } - - /// Remove a paragraph style - bool RemoveParagraphStyle(wxRichTextStyleDefinition* def, bool deleteStyle = false) { return RemoveStyle(m_paragraphStyleDefinitions, def, deleteStyle); } - - /// Remove a list style - bool RemoveListStyle(wxRichTextStyleDefinition* def, bool deleteStyle = false) { return RemoveStyle(m_listStyleDefinitions, def, deleteStyle); } - - /// Remove a style - bool RemoveStyle(wxRichTextStyleDefinition* def, bool deleteStyle = false); - - /// Find a character definition by name - wxRichTextCharacterStyleDefinition* FindCharacterStyle(const wxString& name, bool recurse = true) const { return (wxRichTextCharacterStyleDefinition*) FindStyle(m_characterStyleDefinitions, name, recurse); } - - /// Find a paragraph definition by name - wxRichTextParagraphStyleDefinition* FindParagraphStyle(const wxString& name, bool recurse = true) const { return (wxRichTextParagraphStyleDefinition*) FindStyle(m_paragraphStyleDefinitions, name, recurse); } - - /// Find a list definition by name - wxRichTextListStyleDefinition* FindListStyle(const wxString& name, bool recurse = true) const { return (wxRichTextListStyleDefinition*) FindStyle(m_listStyleDefinitions, name, recurse); } - - /// Find any definition by name - wxRichTextStyleDefinition* FindStyle(const wxString& name, bool recurse = true) const; - - /// Return the number of character styles - size_t GetCharacterStyleCount() const { return m_characterStyleDefinitions.GetCount(); } - - /// Return the number of paragraph styles - size_t GetParagraphStyleCount() const { return m_paragraphStyleDefinitions.GetCount(); } - - /// Return the number of list styles - size_t GetListStyleCount() const { return m_listStyleDefinitions.GetCount(); } - - /// Return the nth character style - wxRichTextCharacterStyleDefinition* GetCharacterStyle(size_t n) const { return (wxRichTextCharacterStyleDefinition*) m_characterStyleDefinitions.Item(n)->GetData(); } - - /// Return the nth paragraph style - wxRichTextParagraphStyleDefinition* GetParagraphStyle(size_t n) const { return (wxRichTextParagraphStyleDefinition*) m_paragraphStyleDefinitions.Item(n)->GetData(); } - - /// Return the nth list style - wxRichTextListStyleDefinition* GetListStyle(size_t n) const { return (wxRichTextListStyleDefinition*) m_listStyleDefinitions.Item(n)->GetData(); } - - /// Delete all styles - void DeleteStyles(); - - /// Insert into list of style sheets - bool InsertSheet(wxRichTextStyleSheet* before); - - /// Append to list of style sheets - bool AppendSheet(wxRichTextStyleSheet* after); - - /// Unlink from the list of style sheets - void Unlink(); - - /// Get/set next sheet - wxRichTextStyleSheet* GetNextSheet() const { return m_nextSheet; } - void SetNextSheet(wxRichTextStyleSheet* sheet) { m_nextSheet = sheet; } - - /// Get/set previous sheet - wxRichTextStyleSheet* GetPreviousSheet() const { return m_previousSheet; } - void SetPreviousSheet(wxRichTextStyleSheet* sheet) { m_previousSheet = sheet; } - - /// Sets and gets the name of the style sheet - void SetName(const wxString& name) { m_name = name; } - const wxString& GetName() const { return m_name; } - - /// Sets and gets the style description - void SetDescription(const wxString& descr) { m_description = descr; } - const wxString& GetDescription() const { return m_description; } - -/// Implementation - - /// Add a definition to one of the style lists - bool AddStyle(wxList& list, wxRichTextStyleDefinition* def); - - /// Remove a style - bool RemoveStyle(wxList& list, wxRichTextStyleDefinition* def, bool deleteStyle); - - /// Find a definition by name - wxRichTextStyleDefinition* FindStyle(const wxList& list, const wxString& name, bool recurse = true) const; - -protected: - - wxString m_description; - wxString m_name; - - wxList m_characterStyleDefinitions; - wxList m_paragraphStyleDefinitions; - wxList m_listStyleDefinitions; - - wxRichTextStyleSheet* m_previousSheet; - wxRichTextStyleSheet* m_nextSheet; -}; - -#if wxUSE_HTML -/*! - * wxRichTextStyleListBox class declaration - * A listbox to display styles. - */ - -class WXDLLIMPEXP_RICHTEXT wxRichTextStyleListBox: public wxHtmlListBox -{ - DECLARE_CLASS(wxRichTextStyleListBox) - DECLARE_EVENT_TABLE() - -public: - /// Which type of style definition is currently showing? - enum wxRichTextStyleType - { - wxRICHTEXT_STYLE_ALL, - wxRICHTEXT_STYLE_PARAGRAPH, - wxRICHTEXT_STYLE_CHARACTER, - wxRICHTEXT_STYLE_LIST - }; - - wxRichTextStyleListBox() - { - Init(); - } - wxRichTextStyleListBox(wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, long style = 0); - virtual ~wxRichTextStyleListBox(); - - void Init() - { - m_styleSheet = NULL; - m_richTextCtrl = NULL; - m_applyOnSelection = false; - m_styleType = wxRICHTEXT_STYLE_PARAGRAPH; - m_autoSetSelection = true; - } - - bool Create(wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, long style = 0); - - /// Creates a suitable HTML fragment for a definition - wxString CreateHTML(wxRichTextStyleDefinition* def) const; - - /// Associates the control with a style sheet - void SetStyleSheet(wxRichTextStyleSheet* styleSheet) { m_styleSheet = styleSheet; } - wxRichTextStyleSheet* GetStyleSheet() const { return m_styleSheet; } - - /// Associates the control with a wxRichTextCtrl - void SetRichTextCtrl(wxRichTextCtrl* ctrl) { m_richTextCtrl = ctrl; } - wxRichTextCtrl* GetRichTextCtrl() const { return m_richTextCtrl; } - - /// Get style for index - wxRichTextStyleDefinition* GetStyle(size_t i) const ; - - /// Get index for style name - int GetIndexForStyle(const wxString& name) const ; - - /// Set selection for string, returning the index. - int SetStyleSelection(const wxString& name); - - /// Updates the list - void UpdateStyles(); - - /// Apply the style - void ApplyStyle(int i); - - /// Left click - void OnLeftDown(wxMouseEvent& event); - - /// Left double-click - void OnLeftDoubleClick(wxMouseEvent& event); - - /// Auto-select from style under caret in idle time - void OnIdle(wxIdleEvent& event); - - /// Convert units in tends of a millimetre to device units - int ConvertTenthsMMToPixels(wxDC& dc, int units) const; - - /// Can we set the selection based on the editor caret position? - /// Need to override this if being used in a combobox popup - virtual bool CanAutoSetSelection() { return m_autoSetSelection; } - virtual void SetAutoSetSelection(bool autoSet) { m_autoSetSelection = autoSet; } - - /// Set whether the style should be applied as soon as the item is selected (the default) - void SetApplyOnSelection(bool applyOnSel) { m_applyOnSelection = applyOnSel; } - bool GetApplyOnSelection() const { return m_applyOnSelection; } - - /// Set the style type to display - void SetStyleType(wxRichTextStyleType styleType) { m_styleType = styleType; UpdateStyles(); } - wxRichTextStyleType GetStyleType() const { return m_styleType; } - - /// Helper for listbox and combo control - static wxString GetStyleToShowInIdleTime(wxRichTextCtrl* ctrl, wxRichTextStyleType styleType); - -protected: - /// Returns the HTML for this item - virtual wxString OnGetItem(size_t n) const; - -private: - - wxRichTextStyleSheet* m_styleSheet; - wxRichTextCtrl* m_richTextCtrl; - bool m_applyOnSelection; // if true, applies style on selection - wxRichTextStyleType m_styleType; // style type to display - bool m_autoSetSelection; - wxArrayString m_styleNames; -}; - -/*! - * wxRichTextStyleListCtrl class declaration - * This is a container for the list control plus a combobox to switch between - * style types. - */ - -#define wxRICHTEXTSTYLELIST_HIDE_TYPE_SELECTOR 0x1000 - -class WXDLLIMPEXP_RICHTEXT wxRichTextStyleListCtrl: public wxControl -{ - DECLARE_CLASS(wxRichTextStyleListCtrl) - DECLARE_EVENT_TABLE() - -public: - - /// Constructors - wxRichTextStyleListCtrl() - { - Init(); - } - - wxRichTextStyleListCtrl(wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, long style = 0); - - /// Constructors - virtual ~wxRichTextStyleListCtrl(); - - /// Member initialisation - void Init() - { - m_styleListBox = NULL; - m_styleChoice = NULL; - m_dontUpdate = false; - } - - /// Creates the windows - bool Create(wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, long style = 0); - - /// Updates the style list box - void UpdateStyles(); - - /// Associates the control with a style sheet - void SetStyleSheet(wxRichTextStyleSheet* styleSheet); - wxRichTextStyleSheet* GetStyleSheet() const; - - /// Associates the control with a wxRichTextCtrl - void SetRichTextCtrl(wxRichTextCtrl* ctrl); - wxRichTextCtrl* GetRichTextCtrl() const; - - /// Set/get the style type to display - void SetStyleType(wxRichTextStyleListBox::wxRichTextStyleType styleType); - wxRichTextStyleListBox::wxRichTextStyleType GetStyleType() const; - - /// Get the choice index for style type - int StyleTypeToIndex(wxRichTextStyleListBox::wxRichTextStyleType styleType); - - /// Get the style type for choice index - wxRichTextStyleListBox::wxRichTextStyleType StyleIndexToType(int i); - - /// Get the listbox - wxRichTextStyleListBox* GetStyleListBox() const { return m_styleListBox; } - - /// Get the choice - wxChoice* GetStyleChoice() const { return m_styleChoice; } - - /// React to style type choice - void OnChooseType(wxCommandEvent& event); - - /// Lay out the controls - void OnSize(wxSizeEvent& event); - -private: - - wxRichTextStyleListBox* m_styleListBox; - wxChoice* m_styleChoice; - bool m_dontUpdate; -}; - -#if wxUSE_COMBOCTRL - -/*! - * Style drop-down for a wxComboCtrl - */ - -class wxRichTextStyleComboPopup : public wxRichTextStyleListBox, public wxComboPopup -{ -public: - virtual void Init() - { - m_itemHere = -1; // hot item in list - m_value = -1; - } - - virtual bool Create( wxWindow* parent ) - { - return wxRichTextStyleListBox::Create(parent, wxID_ANY, - wxPoint(0,0), wxDefaultSize, - wxSIMPLE_BORDER); - } - - virtual wxWindow *GetControl() { return this; } - - virtual void SetStringValue( const wxString& s ); - - virtual wxString GetStringValue() const; - - /// Can we set the selection based on the editor caret position? - // virtual bool CanAutoSetSelection() { return ((m_combo == NULL) || !m_combo->IsPopupShown()); } - virtual bool CanAutoSetSelection() { return false; } - - // - // Popup event handlers - // - - // Mouse hot-tracking - void OnMouseMove(wxMouseEvent& event); - - // On mouse left, set the value and close the popup - void OnMouseClick(wxMouseEvent& WXUNUSED(event)); - -protected: - - int m_itemHere; // hot item in popup - int m_value; - -private: - DECLARE_EVENT_TABLE() -}; - -/*! - * wxRichTextStyleComboCtrl - * A combo for applying styles. - */ - -class WXDLLIMPEXP_RICHTEXT wxRichTextStyleComboCtrl: public wxComboCtrl -{ - DECLARE_CLASS(wxRichTextStyleComboCtrl) - DECLARE_EVENT_TABLE() - -public: - wxRichTextStyleComboCtrl() - { - Init(); - } - - wxRichTextStyleComboCtrl(wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, long style = wxCB_READONLY) - { - Init(); - Create(parent, id, pos, size, style); - } - - virtual ~wxRichTextStyleComboCtrl() {} - - void Init() - { - m_stylePopup = NULL; - } - - bool Create(wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, long style = 0); - - /// Updates the list - void UpdateStyles() { m_stylePopup->UpdateStyles(); } - - /// Associates the control with a style sheet - void SetStyleSheet(wxRichTextStyleSheet* styleSheet) { m_stylePopup->SetStyleSheet(styleSheet); } - wxRichTextStyleSheet* GetStyleSheet() const { return m_stylePopup->GetStyleSheet(); } - - /// Associates the control with a wxRichTextCtrl - void SetRichTextCtrl(wxRichTextCtrl* ctrl) { m_stylePopup->SetRichTextCtrl(ctrl); } - wxRichTextCtrl* GetRichTextCtrl() const { return m_stylePopup->GetRichTextCtrl(); } - - /// Gets the style popup - wxRichTextStyleComboPopup* GetStylePopup() const { return m_stylePopup; } - - /// Auto-select from style under caret in idle time - void OnIdle(wxIdleEvent& event); - -protected: - wxRichTextStyleComboPopup* m_stylePopup; -}; - -#endif - // wxUSE_COMBOCTRL - -#endif - // wxUSE_HTML - -#endif - // wxUSE_RICHTEXT - -#endif - // _WX_RICHTEXTSTYLES_H_ diff --git a/wxWidgets/include/wx/richtext/richtextsymboldlg.h b/wxWidgets/include/wx/richtext/richtextsymboldlg.h deleted file mode 100644 index 47bf7d2bc9..0000000000 --- a/wxWidgets/include/wx/richtext/richtextsymboldlg.h +++ /dev/null @@ -1,370 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/richtext/richtextsymboldlg.h -// Purpose: -// Author: Julian Smart -// Modified by: -// Created: 10/5/2006 3:11:58 PM -// RCS-ID: $Id: richtextsymboldlg.h 58466 2009-01-27 19:19:40Z BP $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _RICHTEXTSYMBOLDLG_H_ -#define _RICHTEXTSYMBOLDLG_H_ - -/*! - * Includes - */ - -#include "wx/dialog.h" -#include "wx/vscroll.h" - -/*! - * Forward declarations - */ - -class WXDLLIMPEXP_FWD_CORE wxStaticText; -class WXDLLIMPEXP_FWD_CORE wxComboBox; -class WXDLLIMPEXP_FWD_CORE wxTextCtrl; - -////@begin forward declarations -class wxSymbolListCtrl; -////@end forward declarations - -// __UNICODE__ is a symbol used by DialogBlocks-generated code. -#ifndef __UNICODE__ -#if wxUSE_UNICODE -#define __UNICODE__ -#endif -#endif - -/*! - * Symbols - */ - -#define SYMBOL_WXSYMBOLPICKERDIALOG_STYLE (wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER|wxCLOSE_BOX) -#define SYMBOL_WXSYMBOLPICKERDIALOG_TITLE wxGetTranslation(wxT("Symbols")) -#define SYMBOL_WXSYMBOLPICKERDIALOG_IDNAME ID_SYMBOLPICKERDIALOG -#define SYMBOL_WXSYMBOLPICKERDIALOG_SIZE wxSize(400, 300) -#define SYMBOL_WXSYMBOLPICKERDIALOG_POSITION wxDefaultPosition - -/*! - * wxSymbolPickerDialog class declaration - */ - -class WXDLLIMPEXP_RICHTEXT wxSymbolPickerDialog: public wxDialog -{ - DECLARE_DYNAMIC_CLASS( wxSymbolPickerDialog ) - DECLARE_EVENT_TABLE() - -public: - /// Constructors - wxSymbolPickerDialog( ); - wxSymbolPickerDialog( const wxString& symbol, const wxString& fontName, const wxString& normalTextFont, - wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& caption = SYMBOL_WXSYMBOLPICKERDIALOG_TITLE, const wxPoint& pos = SYMBOL_WXSYMBOLPICKERDIALOG_POSITION, const wxSize& size = SYMBOL_WXSYMBOLPICKERDIALOG_SIZE, long style = SYMBOL_WXSYMBOLPICKERDIALOG_STYLE ); - - /// Creation - bool Create( const wxString& symbol, const wxString& fontName, const wxString& normalTextFont, - wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& caption = SYMBOL_WXSYMBOLPICKERDIALOG_TITLE, const wxPoint& pos = SYMBOL_WXSYMBOLPICKERDIALOG_POSITION, const wxSize& size = SYMBOL_WXSYMBOLPICKERDIALOG_SIZE, long style = SYMBOL_WXSYMBOLPICKERDIALOG_STYLE ); - - /// Initialises members variables - void Init(); - - /// Creates the controls and sizers - void CreateControls(); - - /// Update the display - void UpdateSymbolDisplay(bool updateSymbolList = true, bool showAtSubset = true); - - /// Respond to symbol selection - void OnSymbolSelected( wxCommandEvent& event ); - - /// Set Unicode mode - void SetUnicodeMode(bool unicodeMode); - - /// Show at the current subset selection - void ShowAtSubset(); - - /// Get the selected symbol character - int GetSymbolChar() const; - - /// Is there a selection? - bool HasSelection() const { return !m_symbol.IsEmpty(); } - - /// Specifying normal text? - bool UseNormalFont() const { return m_fontName.IsEmpty(); } - - /// Should we show tooltips? - static bool ShowToolTips() { return sm_showToolTips; } - - /// Determines whether tooltips will be shown - static void SetShowToolTips(bool show) { sm_showToolTips = show; } - - /// Data transfer - virtual bool TransferDataToWindow(); - -////@begin wxSymbolPickerDialog event handler declarations - - /// wxEVT_COMMAND_COMBOBOX_SELECTED event handler for ID_SYMBOLPICKERDIALOG_FONT - void OnFontCtrlSelected( wxCommandEvent& event ); - -#if defined(__UNICODE__) - /// wxEVT_COMMAND_COMBOBOX_SELECTED event handler for ID_SYMBOLPICKERDIALOG_SUBSET - void OnSubsetSelected( wxCommandEvent& event ); - -#endif -#if defined(__UNICODE__) - /// wxEVT_COMMAND_COMBOBOX_SELECTED event handler for ID_SYMBOLPICKERDIALOG_FROM - void OnFromUnicodeSelected( wxCommandEvent& event ); - -#endif -#if defined(__WXMSW__) || defined(__WXGTK__) || defined(__WXPM__) || defined(__WXMGL__) || defined(__WXMOTIF__) || defined(__WXCOCOA__) || defined(__WXX11__) || defined(__WXPALMOS__) - /// wxEVT_UPDATE_UI event handler for wxID_OK - void OnOkUpdate( wxUpdateUIEvent& event ); - -#endif -#if defined(__WXMAC__) - /// wxEVT_UPDATE_UI event handler for wxID_OK - void OnOkUpdate( wxUpdateUIEvent& event ); - -#endif -////@end wxSymbolPickerDialog event handler declarations - -////@begin wxSymbolPickerDialog member function declarations - - wxString GetFontName() const { return m_fontName ; } - void SetFontName(wxString value) { m_fontName = value ; } - - wxString GetSymbol() const { return m_symbol ; } - void SetSymbol(wxString value) { m_symbol = value ; } - - bool GetFromUnicode() const { return m_fromUnicode ; } - void SetFromUnicode(bool value) { m_fromUnicode = value ; } - - wxString GetNormalTextFontName() const { return m_normalTextFontName ; } - void SetNormalTextFontName(wxString value) { m_normalTextFontName = value ; } - - /// Retrieves bitmap resources - wxBitmap GetBitmapResource( const wxString& name ); - - /// Retrieves icon resources - wxIcon GetIconResource( const wxString& name ); -////@end wxSymbolPickerDialog member function declarations - -////@begin wxSymbolPickerDialog member variables - wxComboBox* m_fontCtrl; -#if defined(__UNICODE__) - wxComboBox* m_subsetCtrl; -#endif - wxSymbolListCtrl* m_symbolsCtrl; - wxStaticText* m_symbolStaticCtrl; - wxTextCtrl* m_characterCodeCtrl; -#if defined(__UNICODE__) - wxComboBox* m_fromUnicodeCtrl; -#endif - wxString m_fontName; - wxString m_symbol; - bool m_fromUnicode; - wxString m_normalTextFontName; - /// Control identifiers - enum { - ID_SYMBOLPICKERDIALOG = 10600, - ID_SYMBOLPICKERDIALOG_FONT = 10602, - ID_SYMBOLPICKERDIALOG_SUBSET = 10605, - ID_SYMBOLPICKERDIALOG_LISTCTRL = 10608, - ID_SYMBOLPICKERDIALOG_CHARACTERCODE = 10601, - ID_SYMBOLPICKERDIALOG_FROM = 10603 - }; -////@end wxSymbolPickerDialog member variables - - bool m_dontUpdate; - static bool sm_showToolTips; -}; - -/*! - * The scrolling symbol list. - */ - -class WXDLLIMPEXP_RICHTEXT wxSymbolListCtrl : public wxVScrolledWindow -{ -public: - // constructors and such - // --------------------- - - // default constructor, you must call Create() later - wxSymbolListCtrl() { Init(); } - - // normal constructor which calls Create() internally - wxSymbolListCtrl(wxWindow *parent, - wxWindowID id = wxID_ANY, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = 0, - const wxString& name = wxPanelNameStr) - { - Init(); - - (void)Create(parent, id, pos, size, style, name); - } - - // really creates the control and sets the initial number of items in it - // (which may be changed later with SetItemCount()) - // - // returns true on success or false if the control couldn't be created - bool Create(wxWindow *parent, - wxWindowID id = wxID_ANY, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = 0, - const wxString& name = wxPanelNameStr); - - // dtor does some internal cleanup - virtual ~wxSymbolListCtrl(); - - - // accessors - // --------- - - // set the current font - virtual bool SetFont(const wxFont& font); - - // set Unicode/ASCII mode - void SetUnicodeMode(bool unicodeMode); - - // get the index of the currently selected item or wxNOT_FOUND if there is no selection - int GetSelection() const; - - // is this item selected? - bool IsSelected(int item) const; - - // is this item the current one? - bool IsCurrentItem(int item) const { return item == m_current; } - - // get the margins around each cell - wxPoint GetMargins() const { return m_ptMargins; } - - // get the background colour of selected cells - const wxColour& GetSelectionBackground() const { return m_colBgSel; } - - // operations - // ---------- - - // set the selection to the specified item, if it is wxNOT_FOUND the - // selection is unset - void SetSelection(int selection); - - // make this item visible - void EnsureVisible(int item); - - // set the margins: horizontal margin is the distance between the window - // border and the item contents while vertical margin is half of the - // distance between items - // - // by default both margins are 0 - void SetMargins(const wxPoint& pt); - void SetMargins(wxCoord x, wxCoord y) { SetMargins(wxPoint(x, y)); } - - // set the cell size - void SetCellSize(const wxSize& sz) { m_cellSize = sz; } - const wxSize& GetCellSize() const { return m_cellSize; } - - // change the background colour of the selected cells - void SetSelectionBackground(const wxColour& col); - - virtual wxVisualAttributes GetDefaultAttributes() const - { - return GetClassDefaultAttributes(GetWindowVariant()); - } - - static wxVisualAttributes - GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL); - - // Get min/max symbol values - int GetMinSymbolValue() const { return m_minSymbolValue; } - int GetMaxSymbolValue() const { return m_maxSymbolValue; } - - // Respond to size change - void OnSize(wxSizeEvent& event); - -protected: - - // draws a line of symbols - virtual void OnDrawItem(wxDC& dc, const wxRect& rect, size_t n) const; - - // gets the line height - virtual wxCoord OnGetLineHeight(size_t line) const; - - // event handlers - void OnPaint(wxPaintEvent& event); - void OnKeyDown(wxKeyEvent& event); - void OnLeftDown(wxMouseEvent& event); - void OnLeftDClick(wxMouseEvent& event); - - // common part of all ctors - void Init(); - - // send the wxEVT_COMMAND_LISTBOX_SELECTED event - void SendSelectedEvent(); - - // change the current item (in single selection listbox it also implicitly - // changes the selection); current may be wxNOT_FOUND in which case there - // will be no current item any more - // - // return true if the current item changed, false otherwise - bool DoSetCurrent(int current); - - // flags for DoHandleItemClick - enum - { - ItemClick_Shift = 1, // item shift-clicked - ItemClick_Ctrl = 2, // ctrl - ItemClick_Kbd = 4 // item selected from keyboard - }; - - // common part of keyboard and mouse handling processing code - void DoHandleItemClick(int item, int flags); - - // calculate line number from symbol value - int SymbolValueToLineNumber(int item); - - // initialise control from current min/max values - void SetupCtrl(bool scrollToSelection = true); - - // hit testing - int HitTest(const wxPoint& pt); - -private: - // the current item or wxNOT_FOUND - int m_current; - - // margins - wxPoint m_ptMargins; - - // the selection bg colour - wxColour m_colBgSel; - - // double buffer - wxBitmap* m_doubleBuffer; - - // cell size - wxSize m_cellSize; - - // minimum and maximum symbol value - int m_minSymbolValue; - - // minimum and maximum symbol value - int m_maxSymbolValue; - - // number of items per line - int m_symbolsPerLine; - - // Unicode/ASCII mode - bool m_unicodeMode; - - DECLARE_EVENT_TABLE() - DECLARE_NO_COPY_CLASS(wxSymbolListCtrl) - DECLARE_ABSTRACT_CLASS(wxSymbolListCtrl) -}; - -#endif - // _RICHTEXTSYMBOLDLG_H_ diff --git a/wxWidgets/include/wx/richtext/richtexttabspage.h b/wxWidgets/include/wx/richtext/richtexttabspage.h deleted file mode 100644 index f067e04c7b..0000000000 --- a/wxWidgets/include/wx/richtext/richtexttabspage.h +++ /dev/null @@ -1,129 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/richtext/richtexttabspage.h -// Purpose: -// Author: Julian Smart -// Modified by: -// Created: 10/4/2006 8:03:20 AM -// RCS-ID: $Id: richtexttabspage.h 42678 2006-10-29 22:01:06Z JS $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _RICHTEXTTABSPAGE_H_ -#define _RICHTEXTTABSPAGE_H_ - -/*! - * Includes - */ - -////@begin includes -////@end includes - -/*! - * Forward declarations - */ - -////@begin forward declarations -////@end forward declarations - -/*! - * Control identifiers - */ - -////@begin control identifiers -#define SYMBOL_WXRICHTEXTTABSPAGE_STYLE wxRESIZE_BORDER|wxTAB_TRAVERSAL -#define SYMBOL_WXRICHTEXTTABSPAGE_TITLE _("wxRichTextFontPage") -#define SYMBOL_WXRICHTEXTTABSPAGE_IDNAME ID_RICHTEXTTABSPAGE -#define SYMBOL_WXRICHTEXTTABSPAGE_SIZE wxSize(400, 300) -#define SYMBOL_WXRICHTEXTTABSPAGE_POSITION wxDefaultPosition -////@end control identifiers - -/*! - * wxRichTextTabsPage class declaration - */ - -class WXDLLIMPEXP_RICHTEXT wxRichTextTabsPage: public wxPanel -{ - DECLARE_DYNAMIC_CLASS( wxRichTextTabsPage ) - DECLARE_EVENT_TABLE() - -public: - /// Constructors - wxRichTextTabsPage( ); - wxRichTextTabsPage( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = SYMBOL_WXRICHTEXTTABSPAGE_POSITION, const wxSize& size = SYMBOL_WXRICHTEXTTABSPAGE_SIZE, long style = SYMBOL_WXRICHTEXTTABSPAGE_STYLE ); - - /// Creation - bool Create( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = SYMBOL_WXRICHTEXTTABSPAGE_POSITION, const wxSize& size = SYMBOL_WXRICHTEXTTABSPAGE_SIZE, long style = SYMBOL_WXRICHTEXTTABSPAGE_STYLE ); - - /// Creates the controls and sizers - void CreateControls(); - - /// Initialise members - void Init(); - - /// Transfer data from/to window - virtual bool TransferDataFromWindow(); - virtual bool TransferDataToWindow(); - - /// Sorts the tab array - virtual void SortTabs(); - - /// Gets the attributes associated with the main formatting dialog - wxTextAttrEx* GetAttributes(); - -////@begin wxRichTextTabsPage event handler declarations - - /// wxEVT_COMMAND_LISTBOX_SELECTED event handler for ID_RICHTEXTTABSPAGE_TABLIST - void OnTablistSelected( wxCommandEvent& event ); - - /// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_RICHTEXTTABSPAGE_NEW_TAB - void OnNewTabClick( wxCommandEvent& event ); - - /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTTABSPAGE_NEW_TAB - void OnNewTabUpdate( wxUpdateUIEvent& event ); - - /// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_RICHTEXTTABSPAGE_DELETE_TAB - void OnDeleteTabClick( wxCommandEvent& event ); - - /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTTABSPAGE_DELETE_TAB - void OnDeleteTabUpdate( wxUpdateUIEvent& event ); - - /// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_RICHTEXTTABSPAGE_DELETE_ALL_TABS - void OnDeleteAllTabsClick( wxCommandEvent& event ); - - /// wxEVT_UPDATE_UI event handler for ID_RICHTEXTTABSPAGE_DELETE_ALL_TABS - void OnDeleteAllTabsUpdate( wxUpdateUIEvent& event ); - -////@end wxRichTextTabsPage event handler declarations - -////@begin wxRichTextTabsPage member function declarations - - /// Retrieves bitmap resources - wxBitmap GetBitmapResource( const wxString& name ); - - /// Retrieves icon resources - wxIcon GetIconResource( const wxString& name ); -////@end wxRichTextTabsPage member function declarations - - /// Should we show tooltips? - static bool ShowToolTips(); - -////@begin wxRichTextTabsPage member variables - wxTextCtrl* m_tabEditCtrl; - wxListBox* m_tabListCtrl; - /// Control identifiers - enum { - ID_RICHTEXTTABSPAGE = 10200, - ID_RICHTEXTTABSPAGE_TABEDIT = 10213, - ID_RICHTEXTTABSPAGE_TABLIST = 10214, - ID_RICHTEXTTABSPAGE_NEW_TAB = 10201, - ID_RICHTEXTTABSPAGE_DELETE_TAB = 10202, - ID_RICHTEXTTABSPAGE_DELETE_ALL_TABS = 10203 - }; -////@end wxRichTextTabsPage member variables - - bool m_tabsPresent; -}; - -#endif - // _RICHTEXTTABSPAGE_H_ diff --git a/wxWidgets/include/wx/richtext/richtextxml.h b/wxWidgets/include/wx/richtext/richtextxml.h deleted file mode 100644 index 0b9ff91bc1..0000000000 --- a/wxWidgets/include/wx/richtext/richtextxml.h +++ /dev/null @@ -1,79 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/richtext/richeditxml.h -// Purpose: XML and HTML I/O for wxRichTextCtrl -// Author: Julian Smart -// Modified by: -// Created: 2005-09-30 -// RCS-ID: $Id: richtextxml.h 53135 2008-04-12 02:31:04Z VZ $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_RICHTEXTXML_H_ -#define _WX_RICHTEXTXML_H_ - -/*! - * Includes - */ - -#include "wx/richtext/richtextbuffer.h" -#include "wx/richtext/richtextstyles.h" - -#if wxUSE_RICHTEXT && wxUSE_XML - -/*! - * wxRichTextXMLHandler - */ - -class WXDLLIMPEXP_FWD_XML wxXmlNode; - -class WXDLLIMPEXP_RICHTEXT wxRichTextXMLHandler: public wxRichTextFileHandler -{ - DECLARE_CLASS(wxRichTextXMLHandler) -public: - wxRichTextXMLHandler(const wxString& name = wxT("XML"), const wxString& ext = wxT("xml"), int type = wxRICHTEXT_TYPE_XML) - : wxRichTextFileHandler(name, ext, type) - { } - -#if wxUSE_STREAMS - /// Recursively export an object - bool ExportXML(wxOutputStream& stream, wxMBConv* convMem, wxMBConv* convFile, wxRichTextObject& obj, int level); - bool ExportStyleDefinition(wxOutputStream& stream, wxMBConv* convMem, wxMBConv* convFile, wxRichTextStyleDefinition* def, int level); - - /// Recursively import an object - bool ImportXML(wxRichTextBuffer* buffer, wxXmlNode* node); - bool ImportStyleDefinition(wxRichTextStyleSheet* sheet, wxXmlNode* node); - - /// Create style parameters - wxString CreateStyle(const wxTextAttrEx& attr, bool isPara = false); - - /// Get style parameters - bool GetStyle(wxTextAttrEx& attr, wxXmlNode* node, bool isPara = false); -#endif - - /// Can we save using this handler? - virtual bool CanSave() const { return true; } - - /// Can we load using this handler? - virtual bool CanLoad() const { return true; } - -// Implementation - - bool HasParam(wxXmlNode* node, const wxString& param); - wxXmlNode *GetParamNode(wxXmlNode* node, const wxString& param); - wxString GetNodeContent(wxXmlNode *node); - wxString GetParamValue(wxXmlNode *node, const wxString& param); - wxString GetText(wxXmlNode *node, const wxString& param = wxEmptyString, bool translate = false); - -protected: -#if wxUSE_STREAMS - virtual bool DoLoadFile(wxRichTextBuffer *buffer, wxInputStream& stream); - virtual bool DoSaveFile(wxRichTextBuffer *buffer, wxOutputStream& stream); -#endif -}; - -#endif - // wxUSE_RICHTEXT && wxUSE_XML - -#endif - // _WX_RICHTEXTXML_H_ diff --git a/wxWidgets/include/wx/sashwin.h b/wxWidgets/include/wx/sashwin.h deleted file mode 100644 index c99a94b4ab..0000000000 --- a/wxWidgets/include/wx/sashwin.h +++ /dev/null @@ -1,18 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/sashwin.h -// Purpose: Base header for wxSashWindow -// Author: Julian Smart -// Modified by: -// Created: -// RCS-ID: $Id: sashwin.h 33948 2005-05-04 18:57:50Z JS $ -// Copyright: (c) Julian Smart -// Licence: wxWindows Licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_SASHWIN_H_BASE_ -#define _WX_SASHWIN_H_BASE_ - -#include "wx/generic/sashwin.h" - -#endif - // _WX_SASHWIN_H_BASE_ diff --git a/wxWidgets/include/wx/sckaddr.h b/wxWidgets/include/wx/sckaddr.h deleted file mode 100644 index 696ee46999..0000000000 --- a/wxWidgets/include/wx/sckaddr.h +++ /dev/null @@ -1,193 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: sckaddr.h -// Purpose: Network address classes -// Author: Guilhem Lavaux -// Modified by: -// Created: 26/04/1997 -// RCS-ID: $Id: sckaddr.h 35665 2005-09-24 21:43:15Z VZ $ -// Copyright: (c) 1997, 1998 Guilhem Lavaux -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_NETWORK_ADDRESS_H -#define _WX_NETWORK_ADDRESS_H - -#include "wx/defs.h" - -#if wxUSE_SOCKETS - -#include "wx/string.h" -#include "wx/gsocket.h" - - -class WXDLLIMPEXP_NET wxSockAddress : public wxObject { - DECLARE_ABSTRACT_CLASS(wxSockAddress) -public: - typedef enum { IPV4=1, IPV6=2, UNIX=3 } Addr; - - wxSockAddress(); - wxSockAddress(const wxSockAddress& other); - virtual ~wxSockAddress(); - - wxSockAddress& operator=(const wxSockAddress& other); - - virtual void Clear(); - virtual int Type() = 0; - - GAddress *GetAddress() const { return m_address; } - void SetAddress(GAddress *address); - - // we need to be able to create copies of the addresses polymorphically (i.e. - // without knowing the exact address class) - virtual wxSockAddress *Clone() const = 0; - -protected: - GAddress *m_address; - -private: - void Init(); -}; - -// Interface to an IP address (either IPV4 or IPV6) -class WXDLLIMPEXP_NET wxIPaddress : public wxSockAddress { - DECLARE_ABSTRACT_CLASS(wxIPaddress) -public: - wxIPaddress(); - wxIPaddress(const wxIPaddress& other); - virtual ~wxIPaddress(); - - virtual bool Hostname(const wxString& name) = 0; - virtual bool Service(const wxString& name) = 0; - virtual bool Service(unsigned short port) = 0; - - virtual bool LocalHost() = 0; - virtual bool IsLocalHost() const = 0; - - virtual bool AnyAddress() = 0; - - virtual wxString IPAddress() const = 0; - - virtual wxString Hostname() const = 0; - virtual unsigned short Service() const = 0; -}; - -class WXDLLIMPEXP_NET wxIPV4address : public wxIPaddress { - DECLARE_DYNAMIC_CLASS(wxIPV4address) -public: - wxIPV4address(); - wxIPV4address(const wxIPV4address& other); - virtual ~wxIPV4address(); - - // IPV4 name formats - // - // hostname - // dot format a.b.c.d - virtual bool Hostname(const wxString& name); - bool Hostname(unsigned long addr); - virtual bool Service(const wxString& name); - virtual bool Service(unsigned short port); - - // localhost (127.0.0.1) - virtual bool LocalHost(); - virtual bool IsLocalHost() const; - - // any (0.0.0.0) - virtual bool AnyAddress(); - - virtual wxString Hostname() const; - wxString OrigHostname() { return m_origHostname; } - virtual unsigned short Service() const; - - // a.b.c.d - virtual wxString IPAddress() const; - - virtual int Type() { return wxSockAddress::IPV4; } - virtual wxSockAddress *Clone() const; - - bool operator==(const wxIPV4address& addr) const; - -private: - wxString m_origHostname; -}; - - -// the IPv6 code probably doesn't work, untested -- set to 1 at your own risk -#ifndef wxUSE_IPV6 - #define wxUSE_IPV6 0 -#endif - -#if wxUSE_IPV6 - -// Experimental Only: -// -// IPV6 has not yet been implemented in socket layer -class WXDLLIMPEXP_NET wxIPV6address : public wxIPaddress { - DECLARE_DYNAMIC_CLASS(wxIPV6address) -private: - struct sockaddr_in6 *m_addr; -public: - wxIPV6address(); - wxIPV6address(const wxIPV6address& other); - virtual ~wxIPV6address(); - - // IPV6 name formats - // - // hostname - // 3ffe:ffff:0100:f101:0210:a4ff:fee3:9566 - // compact (base85) Itu&-ZQ82s>J%s99FJXT - // compressed format ::1 - // ipv4 mapped ::ffff:1.2.3.4 - virtual bool Hostname(const wxString& name); - - bool Hostname(unsigned char addr[16]); - virtual bool Service(const wxString& name); - virtual bool Service(unsigned short port); - - // localhost (0000:0000:0000:0000:0000:0000:0000:0001 (::1)) - virtual bool LocalHost(); - virtual bool IsLocalHost() const; - - // any (0000:0000:0000:0000:0000:0000:0000:0000 (::)) - virtual bool AnyAddress(); - - // 3ffe:ffff:0100:f101:0210:a4ff:fee3:9566 - virtual wxString IPAddress() const; - - virtual wxString Hostname() const; - virtual unsigned short Service() const; - - virtual int Type() { return wxSockAddress::IPV6; } - virtual wxSockAddress *Clone() const { return new wxIPV6address(*this); } -}; - -#endif // wxUSE_IPV6 - -#if defined(__UNIX__) && !defined(__WINE__) && (!defined(__WXMAC__) || defined(__DARWIN__)) && !defined(__WXMSW__) -#include <sys/socket.h> -#ifndef __VMS__ -# include <sys/un.h> -#endif - -class WXDLLIMPEXP_NET wxUNIXaddress : public wxSockAddress { - DECLARE_DYNAMIC_CLASS(wxUNIXaddress) -private: - struct sockaddr_un *m_addr; -public: - wxUNIXaddress(); - wxUNIXaddress(const wxUNIXaddress& other); - virtual ~wxUNIXaddress(); - - void Filename(const wxString& name); - wxString Filename(); - - virtual int Type() { return wxSockAddress::UNIX; } - virtual wxSockAddress *Clone() const { return new wxUNIXaddress(*this); } -}; -#endif - // __UNIX__ - -#endif - // wxUSE_SOCKETS - -#endif - // _WX_NETWORK_ADDRESS_H diff --git a/wxWidgets/include/wx/sckipc.h b/wxWidgets/include/wx/sckipc.h deleted file mode 100644 index 0a24bddbaa..0000000000 --- a/wxWidgets/include/wx/sckipc.h +++ /dev/null @@ -1,150 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: sckipc.h -// Purpose: Interprocess communication implementation (wxSocket version) -// Author: Julian Smart -// Modified by: Guilhem Lavaux (big rewrite) May 1997, 1998 -// Guillermo Rodriguez (updated for wxSocket v2) Jan 2000 -// (callbacks deprecated) Mar 2000 -// Created: 1993 -// RCS-ID: $Id: sckipc.h 53135 2008-04-12 02:31:04Z VZ $ -// Copyright: (c) Julian Smart 1993 -// (c) Guilhem Lavaux 1997, 1998 -// (c) 2000 Guillermo Rodriguez <guille@iies.es> -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_SCKIPC_H -#define _WX_SCKIPC_H - -#include "wx/defs.h" - -#if wxUSE_SOCKETS && wxUSE_IPC - -#include "wx/ipcbase.h" -#include "wx/socket.h" -#include "wx/sckstrm.h" -#include "wx/datstrm.h" - -/* - * Mini-DDE implementation - - Most transactions involve a topic name and an item name (choose these - as befits your application). - - A client can: - - - ask the server to execute commands (data) associated with a topic - - request data from server by topic and item - - poke data into the server - - ask the server to start an advice loop on topic/item - - ask the server to stop an advice loop - - A server can: - - - respond to execute, request, poke and advice start/stop - - send advise data to client - - Note that this limits the server in the ways it can send data to the - client, i.e. it can't send unsolicited information. - * - */ - -class WXDLLIMPEXP_FWD_NET wxTCPServer; -class WXDLLIMPEXP_FWD_NET wxTCPClient; - -class WXDLLIMPEXP_NET wxTCPConnection: public wxConnectionBase -{ - DECLARE_DYNAMIC_CLASS(wxTCPConnection) - -public: - wxTCPConnection(wxChar *buffer, int size); - wxTCPConnection(); - virtual ~wxTCPConnection(); - - // Calls that CLIENT can make - virtual bool Execute(const wxChar *data, int size = -1, wxIPCFormat format = wxIPC_TEXT); - virtual wxChar *Request(const wxString& item, int *size = NULL, wxIPCFormat format = wxIPC_TEXT); - virtual bool Poke(const wxString& item, wxChar *data, int size = -1, wxIPCFormat format = wxIPC_TEXT); - virtual bool StartAdvise(const wxString& item); - virtual bool StopAdvise(const wxString& item); - - // Calls that SERVER can make - virtual bool Advise(const wxString& item, wxChar *data, int size = -1, wxIPCFormat format = wxIPC_TEXT); - - // Calls that both can make - virtual bool Disconnect(void); - - // Callbacks to BOTH - override at will - // Default behaviour is to delete connection and return true - virtual bool OnDisconnect(void) { delete this; return true; } - - // To enable the compressor (NOTE: not implemented!) - void Compress(bool on); - - // unhide the Execute overload from wxConnectionBase - virtual bool Execute(const wxString& str) - { return Execute(str, -1, wxIPC_TEXT); } - -protected: - wxSocketBase *m_sock; - wxSocketStream *m_sockstrm; - wxDataInputStream *m_codeci; - wxDataOutputStream *m_codeco; - wxString m_topic; - - friend class wxTCPServer; - friend class wxTCPClient; - friend class wxTCPEventHandler; - - DECLARE_NO_COPY_CLASS(wxTCPConnection) -}; - -class WXDLLIMPEXP_NET wxTCPServer: public wxServerBase -{ -public: - wxTCPConnection *topLevelConnection; - - wxTCPServer(); - virtual ~wxTCPServer(); - - // Returns false on error (e.g. port number is already in use) - virtual bool Create(const wxString& serverName); - - // Callbacks to SERVER - override at will - virtual wxConnectionBase *OnAcceptConnection(const wxString& topic); - -protected: - wxSocketServer *m_server; - -#ifdef __UNIX_LIKE__ - // the name of the file associated to the Unix domain socket, may be empty - wxString m_filename; -#endif // __UNIX_LIKE__ - - DECLARE_NO_COPY_CLASS(wxTCPServer) - DECLARE_DYNAMIC_CLASS(wxTCPServer) -}; - -class WXDLLIMPEXP_NET wxTCPClient: public wxClientBase -{ -public: - wxTCPClient(); - virtual ~wxTCPClient(); - - virtual bool ValidHost(const wxString& host); - - // Call this to make a connection. Returns NULL if cannot. - virtual wxConnectionBase *MakeConnection(const wxString& host, - const wxString& server, - const wxString& topic); - - // Callbacks to CLIENT - override at will - virtual wxConnectionBase *OnMakeConnection(); - -private: - DECLARE_DYNAMIC_CLASS(wxTCPClient) -}; - -#endif // wxUSE_SOCKETS && wxUSE_IPC - -#endif // _WX_SCKIPC_H diff --git a/wxWidgets/include/wx/sckstrm.h b/wxWidgets/include/wx/sckstrm.h deleted file mode 100644 index 30d09604e6..0000000000 --- a/wxWidgets/include/wx/sckstrm.h +++ /dev/null @@ -1,72 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: sckstrm.h -// Purpose: wxSocket*Stream -// Author: Guilhem Lavaux -// Modified by: -// Created: 17/07/97 -// RCS-ID: $Id: sckstrm.h 41020 2006-09-05 20:47:48Z VZ $ -// Copyright: (c) -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// -#ifndef __SCK_STREAM_H__ -#define __SCK_STREAM_H__ - -#include "wx/stream.h" - -#if wxUSE_SOCKETS && wxUSE_STREAMS - -#include "wx/socket.h" - -class WXDLLIMPEXP_NET wxSocketOutputStream : public wxOutputStream -{ - public: - wxSocketOutputStream(wxSocketBase& s); - virtual ~wxSocketOutputStream(); - - wxFileOffset SeekO( wxFileOffset WXUNUSED(pos), wxSeekMode WXUNUSED(mode) ) - { return -1; } - wxFileOffset TellO() const - { return -1; } - - protected: - wxSocketBase *m_o_socket; - - size_t OnSysWrite(const void *buffer, size_t bufsize); - - DECLARE_NO_COPY_CLASS(wxSocketOutputStream) -}; - -class WXDLLIMPEXP_NET wxSocketInputStream : public wxInputStream -{ - public: - wxSocketInputStream(wxSocketBase& s); - virtual ~wxSocketInputStream(); - - wxFileOffset SeekI( wxFileOffset WXUNUSED(pos), wxSeekMode WXUNUSED(mode) ) - { return -1; } - wxFileOffset TellI() const - { return -1; } - - protected: - wxSocketBase *m_i_socket; - - size_t OnSysRead(void *buffer, size_t bufsize); - - DECLARE_NO_COPY_CLASS(wxSocketInputStream) -}; - -class WXDLLIMPEXP_NET wxSocketStream : public wxSocketInputStream, - public wxSocketOutputStream -{ - public: - wxSocketStream(wxSocketBase& s); - virtual ~wxSocketStream(); - - DECLARE_NO_COPY_CLASS(wxSocketStream) -}; - -#endif - // wxUSE_SOCKETS && wxUSE_STREAMS - -#endif - // __SCK_STREAM_H__ diff --git a/wxWidgets/include/wx/scopeguard.h b/wxWidgets/include/wx/scopeguard.h deleted file mode 100644 index 155a4f5496..0000000000 --- a/wxWidgets/include/wx/scopeguard.h +++ /dev/null @@ -1,373 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: wx/scopeguard.h -// Purpose: declares wxwxScopeGuard and related macros -// Author: Vadim Zeitlin -// Modified by: -// Created: 03.07.2003 -// RCS-ID: $Id: scopeguard.h 44111 2007-01-07 13:28:16Z SN $ -// Copyright: (c) 2003 Vadim Zeitlin <vadim@wxwidgets.org> -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -/* - Acknowledgements: this header is heavily based on (well, almost the exact - copy of) ScopeGuard.h by Andrei Alexandrescu and Petru Marginean published - in December 2000 issue of C/C++ Users Journal. - http://www.cuj.com/documents/cujcexp1812alexandr/ - */ - -#ifndef _WX_SCOPEGUARD_H_ -#define _WX_SCOPEGUARD_H_ - -#include "wx/defs.h" - -#include "wx/except.h" - -// ---------------------------------------------------------------------------- -// helpers -// ---------------------------------------------------------------------------- - -#ifdef __WATCOMC__ - -// WATCOM-FIXME: C++ of Open Watcom 1.3 doesn't like OnScopeExit() created -// through template so it must be workarounded with dedicated inlined macro. -// For compatibility with Watcom compilers wxPrivate::OnScopeExit must be -// replaced with wxPrivateOnScopeExit but in user code (for everyone who -// doesn't care about OW compatibility) wxPrivate::OnScopeExit still works. - -#define wxPrivateOnScopeExit(guard) \ - { \ - if ( !(guard).WasDismissed() ) \ - { \ - wxTRY \ - { \ - (guard).Execute(); \ - } \ - wxCATCH_ALL(;) \ - } \ - } - -#define wxPrivateUse(n) wxUnusedVar(n) - -#else - -#if !defined(__GNUC__) || wxCHECK_GCC_VERSION(2, 95) -// namespace support was first implemented in gcc-2.95, -// so avoid using it for older versions. -namespace wxPrivate -{ -#else -#define wxPrivate -#endif - // in the original implementation this was a member template function of - // ScopeGuardImplBase but gcc 2.8 which is still used for OS/2 doesn't - // support member templates and so we must make it global - template <class ScopeGuardImpl> - void OnScopeExit(ScopeGuardImpl& guard) - { - if ( !guard.WasDismissed() ) - { - // we're called from ScopeGuardImpl dtor and so we must not throw - wxTRY - { - guard.Execute(); - } - wxCATCH_ALL(;) // do nothing, just eat the exception - } - } - - // just to avoid the warning about unused variables - template <class T> - void Use(const T& WXUNUSED(t)) - { - } -#if !defined(__GNUC__) || wxCHECK_GCC_VERSION(2, 95) -} // namespace wxPrivate -#endif - -#define wxPrivateOnScopeExit(n) wxPrivate::OnScopeExit(n) -#define wxPrivateUse(n) wxPrivate::Use(n) - -#endif - -// ============================================================================ -// wxScopeGuard for functions and functors -// ============================================================================ - -// ---------------------------------------------------------------------------- -// wxScopeGuardImplBase: used by wxScopeGuardImpl[0..N] below -// ---------------------------------------------------------------------------- - -class wxScopeGuardImplBase -{ -public: - wxScopeGuardImplBase() : m_wasDismissed(false) { } - - void Dismiss() const { m_wasDismissed = true; } - - // for OnScopeExit() only (we can't make it friend, unfortunately)! - bool WasDismissed() const { return m_wasDismissed; } - -protected: - ~wxScopeGuardImplBase() { } - - wxScopeGuardImplBase(const wxScopeGuardImplBase& other) - : m_wasDismissed(other.m_wasDismissed) - { - other.Dismiss(); - } - - // must be mutable for copy ctor to work - mutable bool m_wasDismissed; - -private: - wxScopeGuardImplBase& operator=(const wxScopeGuardImplBase&); -}; - -// ---------------------------------------------------------------------------- -// wxScopeGuardImpl0: scope guard for actions without parameters -// ---------------------------------------------------------------------------- - -template <class F> -class wxScopeGuardImpl0 : public wxScopeGuardImplBase -{ -public: - static wxScopeGuardImpl0<F> MakeGuard(F fun) - { - return wxScopeGuardImpl0<F>(fun); - } - - ~wxScopeGuardImpl0() { wxPrivateOnScopeExit(*this); } - - void Execute() { m_fun(); } - -protected: - wxScopeGuardImpl0(F fun) : m_fun(fun) { } - - F m_fun; - - wxScopeGuardImpl0& operator=(const wxScopeGuardImpl0&); -}; - -template <class F> -inline wxScopeGuardImpl0<F> wxMakeGuard(F fun) -{ - return wxScopeGuardImpl0<F>::MakeGuard(fun); -} - -// ---------------------------------------------------------------------------- -// wxScopeGuardImpl1: scope guard for actions with 1 parameter -// ---------------------------------------------------------------------------- - -template <class F, class P1> -class wxScopeGuardImpl1 : public wxScopeGuardImplBase -{ -public: - static wxScopeGuardImpl1<F, P1> MakeGuard(F fun, P1 p1) - { - return wxScopeGuardImpl1<F, P1>(fun, p1); - } - - ~wxScopeGuardImpl1() { wxPrivateOnScopeExit(* this); } - - void Execute() { m_fun(m_p1); } - -protected: - wxScopeGuardImpl1(F fun, P1 p1) : m_fun(fun), m_p1(p1) { } - - F m_fun; - const P1 m_p1; - - wxScopeGuardImpl1& operator=(const wxScopeGuardImpl1&); -}; - -template <class F, class P1> -inline wxScopeGuardImpl1<F, P1> wxMakeGuard(F fun, P1 p1) -{ - return wxScopeGuardImpl1<F, P1>::MakeGuard(fun, p1); -} - -// ---------------------------------------------------------------------------- -// wxScopeGuardImpl2: scope guard for actions with 2 parameters -// ---------------------------------------------------------------------------- - -template <class F, class P1, class P2> -class wxScopeGuardImpl2 : public wxScopeGuardImplBase -{ -public: - static wxScopeGuardImpl2<F, P1, P2> MakeGuard(F fun, P1 p1, P2 p2) - { - return wxScopeGuardImpl2<F, P1, P2>(fun, p1, p2); - } - - ~wxScopeGuardImpl2() { wxPrivateOnScopeExit(*this); } - - void Execute() { m_fun(m_p1, m_p2); } - -protected: - wxScopeGuardImpl2(F fun, P1 p1, P2 p2) : m_fun(fun), m_p1(p1), m_p2(p2) { } - - F m_fun; - const P1 m_p1; - const P2 m_p2; - - wxScopeGuardImpl2& operator=(const wxScopeGuardImpl2&); -}; - -template <class F, class P1, class P2> -inline wxScopeGuardImpl2<F, P1, P2> wxMakeGuard(F fun, P1 p1, P2 p2) -{ - return wxScopeGuardImpl2<F, P1, P2>::MakeGuard(fun, p1, p2); -} - -// ============================================================================ -// wxScopeGuards for object methods -// ============================================================================ - -// ---------------------------------------------------------------------------- -// wxObjScopeGuardImpl0 -// ---------------------------------------------------------------------------- - -template <class Obj, class MemFun> -class wxObjScopeGuardImpl0 : public wxScopeGuardImplBase -{ -public: - static wxObjScopeGuardImpl0<Obj, MemFun> - MakeObjGuard(Obj& obj, MemFun memFun) - { - return wxObjScopeGuardImpl0<Obj, MemFun>(obj, memFun); - } - - ~wxObjScopeGuardImpl0() { wxPrivateOnScopeExit(*this); } - - void Execute() { (m_obj.*m_memfun)(); } - -protected: - wxObjScopeGuardImpl0(Obj& obj, MemFun memFun) - : m_obj(obj), m_memfun(memFun) { } - - Obj& m_obj; - MemFun m_memfun; -}; - -template <class Obj, class MemFun> -inline wxObjScopeGuardImpl0<Obj, MemFun> wxMakeObjGuard(Obj& obj, MemFun memFun) -{ - return wxObjScopeGuardImpl0<Obj, MemFun>::MakeObjGuard(obj, memFun); -} - -template <class Obj, class MemFun, class P1> -class wxObjScopeGuardImpl1 : public wxScopeGuardImplBase -{ -public: - static wxObjScopeGuardImpl1<Obj, MemFun, P1> - MakeObjGuard(Obj& obj, MemFun memFun, P1 p1) - { - return wxObjScopeGuardImpl1<Obj, MemFun, P1>(obj, memFun, p1); - } - - ~wxObjScopeGuardImpl1() { wxPrivateOnScopeExit(*this); } - - void Execute() { (m_obj.*m_memfun)(m_p1); } - -protected: - wxObjScopeGuardImpl1(Obj& obj, MemFun memFun, P1 p1) - : m_obj(obj), m_memfun(memFun), m_p1(p1) { } - - Obj& m_obj; - MemFun m_memfun; - const P1 m_p1; -}; - -template <class Obj, class MemFun, class P1> -inline wxObjScopeGuardImpl1<Obj, MemFun, P1> -wxMakeObjGuard(Obj& obj, MemFun memFun, P1 p1) -{ - return wxObjScopeGuardImpl1<Obj, MemFun, P1>::MakeObjGuard(obj, memFun, p1); -} - -template <class Obj, class MemFun, class P1, class P2> -class wxObjScopeGuardImpl2 : public wxScopeGuardImplBase -{ -public: - static wxObjScopeGuardImpl2<Obj, MemFun, P1, P2> - MakeObjGuard(Obj& obj, MemFun memFun, P1 p1, P2 p2) - { - return wxObjScopeGuardImpl2<Obj, MemFun, P1, P2>(obj, memFun, p1, p2); - } - - ~wxObjScopeGuardImpl2() { wxPrivateOnScopeExit(*this); } - - void Execute() { (m_obj.*m_memfun)(m_p1, m_p2); } - -protected: - wxObjScopeGuardImpl2(Obj& obj, MemFun memFun, P1 p1, P2 p2) - : m_obj(obj), m_memfun(memFun), m_p1(p1), m_p2(p2) { } - - Obj& m_obj; - MemFun m_memfun; - const P1 m_p1; - const P2 m_p2; -}; - -template <class Obj, class MemFun, class P1, class P2> -inline wxObjScopeGuardImpl2<Obj, MemFun, P1, P2> -wxMakeObjGuard(Obj& obj, MemFun memFun, P1 p1, P2 p2) -{ - return wxObjScopeGuardImpl2<Obj, MemFun, P1, P2>:: - MakeObjGuard(obj, memFun, p1, p2); -} - -// ============================================================================ -// public stuff -// ============================================================================ - -// wxScopeGuard is just a reference, see the explanation in CUJ article -typedef const wxScopeGuardImplBase& wxScopeGuard; - -// when an unnamed scope guard is needed, the macros below may be used -// -// NB: the original code has a single (and much nicer) ON_BLOCK_EXIT macro -// but this results in compiler warnings about unused variables and I -// didn't find a way to work around this other than by having different -// macros with different names - -#define wxGuardName wxMAKE_UNIQUE_NAME(scopeGuard) - -#define wxON_BLOCK_EXIT0_IMPL(n, f) \ - wxScopeGuard n = wxMakeGuard(f); \ - wxPrivateUse(n) -#define wxON_BLOCK_EXIT0(f) \ - wxON_BLOCK_EXIT0_IMPL(wxGuardName, f) - -#define wxON_BLOCK_EXIT_OBJ0_IMPL(n, o, m) \ - wxScopeGuard n = wxMakeObjGuard(o, m); \ - wxPrivateUse(n) -#define wxON_BLOCK_EXIT_OBJ0(o, m) \ - wxON_BLOCK_EXIT_OBJ0_IMPL(wxGuardName, o, &m) - -#define wxON_BLOCK_EXIT1_IMPL(n, f, p1) \ - wxScopeGuard n = wxMakeGuard(f, p1); \ - wxPrivateUse(n) -#define wxON_BLOCK_EXIT1(f, p1) \ - wxON_BLOCK_EXIT1_IMPL(wxGuardName, f, p1) - -#define wxON_BLOCK_EXIT_OBJ1_IMPL(n, o, m, p1) \ - wxScopeGuard n = wxMakeObjGuard(o, m, p1); \ - wxPrivateUse(n) -#define wxON_BLOCK_EXIT_OBJ1(o, m, p1) \ - wxON_BLOCK_EXIT_OBJ1_IMPL(wxGuardName, o, &m, p1) - -#define wxON_BLOCK_EXIT2_IMPL(n, f, p1, p2) \ - wxScopeGuard n = wxMakeGuard(f, p1, p2); \ - wxPrivateUse(n) -#define wxON_BLOCK_EXIT2(f, p1, p2) \ - wxON_BLOCK_EXIT2_IMPL(wxGuardName, f, p1, p2) - -#define wxON_BLOCK_EXIT_OBJ2_IMPL(n, o, m, p1, p2) \ - wxScopeGuard n = wxMakeObjGuard(o, m, p1, p2); \ - wxPrivateUse(n) -#define wxON_BLOCK_EXIT_OBJ2(o, m, p1, p2) \ - wxON_BLOCK_EXIT_OBJ2_IMPL(wxGuardName, o, &m, p1, p2) - -#endif // _WX_SCOPEGUARD_H_ diff --git a/wxWidgets/include/wx/scrolbar.h b/wxWidgets/include/wx/scrolbar.h deleted file mode 100644 index 1a243b5e0e..0000000000 --- a/wxWidgets/include/wx/scrolbar.h +++ /dev/null @@ -1,80 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: scrolbar.h -// Purpose: wxScrollBar base header -// Author: Julian Smart -// Modified by: -// Created: -// Copyright: (c) Julian Smart -// RCS-ID: $Id: scrolbar.h 37066 2006-01-23 03:27:34Z MR $ -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_SCROLBAR_H_BASE_ -#define _WX_SCROLBAR_H_BASE_ - -#include "wx/defs.h" - -#if wxUSE_SCROLLBAR - -#include "wx/control.h" - -extern WXDLLEXPORT_DATA(const wxChar) wxScrollBarNameStr[]; - -// ---------------------------------------------------------------------------- -// wxScrollBar: a scroll bar control -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxScrollBarBase : public wxControl -{ -public: - wxScrollBarBase() { } - - // scrollbar construction - 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); - - // accessors - virtual int GetThumbPosition() const = 0; - virtual int GetThumbSize() const = 0; - virtual int GetPageSize() const = 0; - virtual int GetRange() const = 0; - - bool IsVertical() const { return (m_windowStyle & wxVERTICAL) != 0; } - - // operations - virtual void SetThumbPosition(int viewStart) = 0; - virtual void SetScrollbar(int position, int thumbSize, - int range, int pageSize, - bool refresh = true) = 0; - -private: - DECLARE_NO_COPY_CLASS(wxScrollBarBase) -}; - -#if defined(__WXUNIVERSAL__) - #include "wx/univ/scrolbar.h" -#elif defined(__WXMSW__) - #include "wx/msw/scrolbar.h" -#elif defined(__WXMOTIF__) - #include "wx/motif/scrolbar.h" -#elif defined(__WXGTK20__) - #include "wx/gtk/scrolbar.h" -#elif defined(__WXGTK__) - #include "wx/gtk1/scrolbar.h" -#elif defined(__WXMAC__) - #include "wx/mac/scrolbar.h" -#elif defined(__WXCOCOA__) - #include "wx/cocoa/scrolbar.h" -#elif defined(__WXPM__) - #include "wx/os2/scrolbar.h" -#endif - -#endif // wxUSE_SCROLLBAR - -#endif - // _WX_SCROLBAR_H_BASE_ diff --git a/wxWidgets/include/wx/scrolwin.h b/wxWidgets/include/wx/scrolwin.h deleted file mode 100644 index 95827f8c78..0000000000 --- a/wxWidgets/include/wx/scrolwin.h +++ /dev/null @@ -1,314 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: include/wx/scrolwin.h -// Purpose: wxScrolledWindow, wxScrolledControl and wxScrollHelper -// Author: Vadim Zeitlin -// Modified by: -// Created: 30.08.00 -// RCS-ID: $Id: scrolwin.h 50864 2007-12-20 18:36:19Z VS $ -// Copyright: (c) 2000 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr> -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_SCROLWIN_H_BASE_ -#define _WX_SCROLWIN_H_BASE_ - -#include "wx/panel.h" - -class WXDLLIMPEXP_FWD_CORE wxScrollHelperEvtHandler; -class WXDLLIMPEXP_FWD_CORE wxTimer; - -// default scrolled window style: scroll in both directions -#define wxScrolledWindowStyle (wxHSCROLL | wxVSCROLL) - -// ---------------------------------------------------------------------------- -// The hierarchy of scrolling classes is a bit complicated because we want to -// put as much functionality as possible in a mix-in class not deriving from -// wxWindow so that other classes could derive from the same base class on all -// platforms irrespectively of whether they are native controls (and hence -// don't use our scrolling) or not. -// -// So we have -// -// wxScrollHelper -// | -// | -// \|/ -// wxWindow wxScrollHelperNative -// | \ / / -// | \ / / -// | _| |_ / -// | wxScrolledWindow / -// | / -// \|/ / -// wxControl / -// \ / -// \ / -// _| |_ -// wxScrolledControl -// -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxScrollHelper -{ -public: - // ctor must be given the associated window - wxScrollHelper(wxWindow *winToScroll); - virtual ~wxScrollHelper(); - - // configure the scrolling - virtual void SetScrollbars(int pixelsPerUnitX, int pixelsPerUnitY, - int noUnitsX, int noUnitsY, - int xPos = 0, int yPos = 0, - bool noRefresh = false ); - - // scroll to the given (in logical coords) position - virtual void Scroll(int x, int y); - - // get/set the page size for this orientation (wxVERTICAL/wxHORIZONTAL) - int GetScrollPageSize(int orient) const; - void SetScrollPageSize(int orient, int pageSize); - - // get the number of lines the window can scroll, - // returns 0 if no scrollbars are there. - int GetScrollLines( int orient ) const; - - // Set the x, y scrolling increments. - void SetScrollRate( int xstep, int ystep ); - - // get the size of one logical unit in physical ones - virtual void GetScrollPixelsPerUnit(int *pixelsPerUnitX, - int *pixelsPerUnitY) const; - - // Enable/disable Windows scrolling in either direction. If true, wxWidgets - // scrolls the canvas and only a bit of the canvas is invalidated; no - // Clear() is necessary. If false, the whole canvas is invalidated and a - // Clear() is necessary. Disable for when the scroll increment is used to - // actually scroll a non-constant distance - virtual void EnableScrolling(bool x_scrolling, bool y_scrolling); - - // Get the view start - virtual void GetViewStart(int *x, int *y) const; - - // Set the scale factor, used in PrepareDC - void SetScale(double xs, double ys) { m_scaleX = xs; m_scaleY = ys; } - double GetScaleX() const { return m_scaleX; } - double GetScaleY() const { return m_scaleY; } - - // translate between scrolled and unscrolled coordinates - void CalcScrolledPosition(int x, int y, int *xx, int *yy) const - { DoCalcScrolledPosition(x, y, xx, yy); } - wxPoint CalcScrolledPosition(const wxPoint& pt) const - { - wxPoint p2; - DoCalcScrolledPosition(pt.x, pt.y, &p2.x, &p2.y); - return p2; - } - - void CalcUnscrolledPosition(int x, int y, int *xx, int *yy) const - { DoCalcUnscrolledPosition(x, y, xx, yy); } - wxPoint CalcUnscrolledPosition(const wxPoint& pt) const - { - wxPoint p2; - DoCalcUnscrolledPosition(pt.x, pt.y, &p2.x, &p2.y); - return p2; - } - - virtual void DoCalcScrolledPosition(int x, int y, int *xx, int *yy) const; - virtual void DoCalcUnscrolledPosition(int x, int y, int *xx, int *yy) const; - - // Adjust the scrollbars - virtual void AdjustScrollbars(void); - - // Calculate scroll increment - virtual int CalcScrollInc(wxScrollWinEvent& event); - - // Normally the wxScrolledWindow will scroll itself, but in some rare - // occasions you might want it to scroll [part of] another window (e.g. a - // child of it in order to scroll only a portion the area between the - // scrollbars (spreadsheet: only cell area will move). - virtual void SetTargetWindow(wxWindow *target); - virtual wxWindow *GetTargetWindow() const; - - void SetTargetRect(const wxRect& rect) { m_rectToScroll = rect; } - wxRect GetTargetRect() const { return m_rectToScroll; } - - // Override this function to draw the graphic (or just process EVT_PAINT) - virtual void OnDraw(wxDC& WXUNUSED(dc)) { } - - // change the DC origin according to the scroll position. - virtual void DoPrepareDC(wxDC& dc); - - // are we generating the autoscroll events? - bool IsAutoScrolling() const { return m_timerAutoScroll != NULL; } - - // stop generating the scroll events when mouse is held outside the window - void StopAutoScrolling(); - - // this method can be overridden in a derived class to forbid sending the - // auto scroll events - note that unlike StopAutoScrolling() it doesn't - // stop the timer, so it will be called repeatedly and will typically - // return different values depending on the current mouse position - // - // the base class version just returns true - virtual bool SendAutoScrollEvents(wxScrollWinEvent& event) const; - - // the methods to be called from the window event handlers - void HandleOnScroll(wxScrollWinEvent& event); - void HandleOnSize(wxSizeEvent& event); - void HandleOnPaint(wxPaintEvent& event); - void HandleOnChar(wxKeyEvent& event); - void HandleOnMouseEnter(wxMouseEvent& event); - void HandleOnMouseLeave(wxMouseEvent& event); -#if wxUSE_MOUSEWHEEL - void HandleOnMouseWheel(wxMouseEvent& event); -#endif // wxUSE_MOUSEWHEEL - -#if wxABI_VERSION >= 20808 - void HandleOnChildFocus(wxChildFocusEvent& event); -#endif - - // FIXME: this is needed for now for wxPlot compilation, should be removed - // once it is fixed! - void OnScroll(wxScrollWinEvent& event) { HandleOnScroll(event); } - -protected: - // get pointer to our scroll rect if we use it or NULL - const wxRect *GetScrollRect() const - { - return m_rectToScroll.width != 0 ? &m_rectToScroll : NULL; - } - - // get the size of the target window - wxSize GetTargetSize() const - { - return m_rectToScroll.width != 0 ? m_rectToScroll.GetSize() - : m_targetWindow->GetClientSize(); - } - - void GetTargetSize(int *w, int *h) const - { - wxSize size = GetTargetSize(); - if ( w ) - *w = size.x; - if ( h ) - *h = size.y; - } - - // implementations of various wxWindow virtual methods which should be - // forwarded to us (this can be done by WX_FORWARD_TO_SCROLL_HELPER()) - bool ScrollLayout(); - void ScrollDoSetVirtualSize(int x, int y); - wxSize ScrollGetBestVirtualSize() const; - wxSize ScrollGetWindowSizeForVirtualSize(const wxSize& size) const; - - // change just the target window (unlike SetWindow which changes m_win as - // well) - void DoSetTargetWindow(wxWindow *target); - - // delete the event handler we installed - void DeleteEvtHandler(); - - - double m_scaleX; - double m_scaleY; - - wxWindow *m_win, - *m_targetWindow; - - wxRect m_rectToScroll; - - wxTimer *m_timerAutoScroll; - - int m_xScrollPixelsPerLine; - int m_yScrollPixelsPerLine; - int m_xScrollPosition; - int m_yScrollPosition; - int m_xScrollLines; - int m_yScrollLines; - int m_xScrollLinesPerPage; - int m_yScrollLinesPerPage; - - bool m_xScrollingEnabled; - bool m_yScrollingEnabled; - -#if wxUSE_MOUSEWHEEL - int m_wheelRotation; -#endif // wxUSE_MOUSEWHEEL - - wxScrollHelperEvtHandler *m_handler; - - DECLARE_NO_COPY_CLASS(wxScrollHelper) -}; - -// this macro can be used in a wxScrollHelper-derived class to forward wxWindow -// methods to corresponding wxScrollHelper methods -#define WX_FORWARD_TO_SCROLL_HELPER() \ -public: \ - virtual void PrepareDC(wxDC& dc) { DoPrepareDC(dc); } \ - virtual bool Layout() { return ScrollLayout(); } \ - virtual void DoSetVirtualSize(int x, int y) \ - { ScrollDoSetVirtualSize(x, y); } \ - virtual wxSize GetBestVirtualSize() const \ - { return ScrollGetBestVirtualSize(); } \ -protected: \ - virtual wxSize GetWindowSizeForVirtualSize(const wxSize& size) const \ - { return ScrollGetWindowSizeForVirtualSize(size); } - -// include the declaration of wxScrollHelperNative if needed -#if defined(__WXGTK20__) && !defined(__WXUNIVERSAL__) - #include "wx/gtk/scrolwin.h" -#elif defined(__WXGTK__) && !defined(__WXUNIVERSAL__) - #include "wx/gtk1/scrolwin.h" -#else - typedef wxScrollHelper wxScrollHelperNative; -#endif - -// ---------------------------------------------------------------------------- -// wxScrolledWindow: a wxWindow which knows how to scroll -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxScrolledWindow : public wxPanel, - public wxScrollHelperNative -{ -public: - wxScrolledWindow() : wxScrollHelperNative(this) { } - wxScrolledWindow(wxWindow *parent, - wxWindowID winid = wxID_ANY, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = wxScrolledWindowStyle, - const wxString& name = wxPanelNameStr) - : wxScrollHelperNative(this) - { - Create(parent, winid, pos, size, style, name); - } - - virtual ~wxScrolledWindow(); - - bool Create(wxWindow *parent, - wxWindowID winid, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = wxScrolledWindowStyle, - const wxString& name = wxPanelNameStr); - - // we need to return a special WM_GETDLGCODE value to process just the - // arrows but let the other navigation characters through -#ifdef __WXMSW__ - virtual WXLRESULT MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam); -#endif // __WXMSW__ - - WX_FORWARD_TO_SCROLL_HELPER() - -protected: - // this is needed for wxEVT_PAINT processing hack described in - // wxScrollHelperEvtHandler::ProcessEvent() - void OnPaint(wxPaintEvent& event); - -private: - DECLARE_DYNAMIC_CLASS_NO_COPY(wxScrolledWindow) - DECLARE_EVENT_TABLE() -}; - -#endif // _WX_SCROLWIN_H_BASE_ - diff --git a/wxWidgets/include/wx/selstore.h b/wxWidgets/include/wx/selstore.h deleted file mode 100644 index 6cb4175dc3..0000000000 --- a/wxWidgets/include/wx/selstore.h +++ /dev/null @@ -1,104 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: wx/selstore.h -// Purpose: wxSelectionStore stores selected items in a control -// Author: Vadim Zeitlin -// Modified by: -// Created: 08.06.03 (extracted from src/generic/listctrl.cpp) -// RCS-ID: $Id: selstore.h 61872 2009-09-09 22:37:05Z VZ $ -// Copyright: (c) 2000-2003 Vadim Zeitlin <vadim@wxwidgets.org> -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_SELSTORE_H_ -#define _WX_SELSTORE_H_ - -#include "wx/dynarray.h" - -// ---------------------------------------------------------------------------- -// wxSelectedIndices is just a sorted array of indices -// ---------------------------------------------------------------------------- - -inline int CMPFUNC_CONV wxSizeTCmpFn(size_t n1, size_t n2) -{ - return (int)(n1 - n2); -} - -WX_DEFINE_SORTED_EXPORTED_ARRAY_CMP_SIZE_T(size_t, - wxSizeTCmpFn, - wxSelectedIndices); - -// ---------------------------------------------------------------------------- -// wxSelectionStore is used to store the selected items in the virtual -// controls, i.e. it is well suited for storing even when the control contains -// a huge (practically infinite) number of items. -// -// Of course, internally it still has to store the selected items somehow (as -// an array currently) but the advantage is that it can handle the selection -// of all items (common operation) efficiently and that it could be made even -// smarter in the future (e.g. store the selections as an array of ranges + -// individual items) without changing its API. -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxSelectionStore -{ -public: - wxSelectionStore() : m_itemsSel(wxSizeTCmpFn) { Init(); } - - // set the total number of items we handle - void SetItemCount(size_t count) { m_count = count; } - - // special case of SetItemCount(0) - void Clear() { m_itemsSel.Clear(); m_count = 0; m_defaultState = false; } - - // must be called when a new item is inserted/added - void OnItemAdd(size_t WXUNUSED(item)) { wxFAIL_MSG( wxT("TODO") ); } - - // must be called when an item is deleted - void OnItemDelete(size_t item); - - // select one item, use SelectRange() insted if possible! - // - // returns true if the items selection really changed - bool SelectItem(size_t item, bool select = true); - - // select the range of items - // - // return true and fill the itemsChanged array with the indices of items - // which have changed state if "few" of them did, otherwise return false - // (meaning that too many items changed state to bother counting them - // individually) - bool SelectRange(size_t itemFrom, size_t itemTo, - bool select = true, - wxArrayInt *itemsChanged = NULL); - - // return true if the given item is selected - bool IsSelected(size_t item) const; - - // return the total number of selected items - size_t GetSelectedCount() const - { - return m_defaultState ? m_count - m_itemsSel.GetCount() - : m_itemsSel.GetCount(); - } - -private: - // (re)init - void Init() { m_defaultState = false; } - - // the total number of items we handle - size_t m_count; - - // the default state: normally, false (i.e. off) but maybe set to true if - // there are more selected items than non selected ones - this allows to - // handle selection of all items efficiently - bool m_defaultState; - - // the array of items whose selection state is different from default - wxSelectedIndices m_itemsSel; - - DECLARE_NO_COPY_CLASS(wxSelectionStore) -}; - - -#endif // _WX_SELSTORE_H_ - diff --git a/wxWidgets/include/wx/settings.h b/wxWidgets/include/wx/settings.h deleted file mode 100644 index 36d1985ae7..0000000000 --- a/wxWidgets/include/wx/settings.h +++ /dev/null @@ -1,214 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/settings.h -// Purpose: wxSystemSettings class -// Author: Julian Smart -// Modified by: -// Created: 01/02/97 -// RCS-ID: $Id: settings.h 67017 2011-02-25 09:37:28Z JS $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_SETTINGS_H_BASE_ -#define _WX_SETTINGS_H_BASE_ - -#include "wx/colour.h" -#include "wx/font.h" - -class WXDLLIMPEXP_FWD_CORE wxWindow; - -// possible values for wxSystemSettings::GetFont() parameter -// -// NB: wxMSW assumes that they have the same values as the parameters of -// Windows GetStockObject() API, don't change the values! -enum wxSystemFont -{ - wxSYS_OEM_FIXED_FONT = 10, - wxSYS_ANSI_FIXED_FONT, - wxSYS_ANSI_VAR_FONT, - wxSYS_SYSTEM_FONT, - wxSYS_DEVICE_DEFAULT_FONT, - wxSYS_DEFAULT_PALETTE, - wxSYS_SYSTEM_FIXED_FONT, - wxSYS_DEFAULT_GUI_FONT, - - // this was just a temporary aberration, do not use it any more - wxSYS_ICONTITLE_FONT = wxSYS_DEFAULT_GUI_FONT -}; - -// possible values for wxSystemSettings::GetColour() parameter -// -// NB: wxMSW assumes that they have the same values as the parameters of -// Windows GetSysColor() API, don't change the values! -enum wxSystemColour -{ - wxSYS_COLOUR_SCROLLBAR, - wxSYS_COLOUR_BACKGROUND, - wxSYS_COLOUR_DESKTOP = wxSYS_COLOUR_BACKGROUND, - wxSYS_COLOUR_ACTIVECAPTION, - wxSYS_COLOUR_INACTIVECAPTION, - wxSYS_COLOUR_MENU, - wxSYS_COLOUR_WINDOW, - wxSYS_COLOUR_WINDOWFRAME, - wxSYS_COLOUR_MENUTEXT, - wxSYS_COLOUR_WINDOWTEXT, - wxSYS_COLOUR_CAPTIONTEXT, - wxSYS_COLOUR_ACTIVEBORDER, - wxSYS_COLOUR_INACTIVEBORDER, - wxSYS_COLOUR_APPWORKSPACE, - wxSYS_COLOUR_HIGHLIGHT, - wxSYS_COLOUR_HIGHLIGHTTEXT, - wxSYS_COLOUR_BTNFACE, - wxSYS_COLOUR_3DFACE = wxSYS_COLOUR_BTNFACE, - wxSYS_COLOUR_BTNSHADOW, - wxSYS_COLOUR_3DSHADOW = wxSYS_COLOUR_BTNSHADOW, - wxSYS_COLOUR_GRAYTEXT, - wxSYS_COLOUR_BTNTEXT, - wxSYS_COLOUR_INACTIVECAPTIONTEXT, - wxSYS_COLOUR_BTNHIGHLIGHT, - wxSYS_COLOUR_BTNHILIGHT = wxSYS_COLOUR_BTNHIGHLIGHT, - wxSYS_COLOUR_3DHIGHLIGHT = wxSYS_COLOUR_BTNHIGHLIGHT, - wxSYS_COLOUR_3DHILIGHT = wxSYS_COLOUR_BTNHIGHLIGHT, - wxSYS_COLOUR_3DDKSHADOW, - wxSYS_COLOUR_3DLIGHT, - wxSYS_COLOUR_INFOTEXT, - wxSYS_COLOUR_INFOBK, - wxSYS_COLOUR_LISTBOX, - wxSYS_COLOUR_HOTLIGHT, - wxSYS_COLOUR_GRADIENTACTIVECAPTION, - wxSYS_COLOUR_GRADIENTINACTIVECAPTION, - wxSYS_COLOUR_MENUHILIGHT, - wxSYS_COLOUR_MENUBAR, - wxSYS_COLOUR_LISTBOXTEXT, - wxSYS_COLOUR_LISTBOXHIGHLIGHTTEXT, - - wxSYS_COLOUR_MAX -}; - -// possible values for wxSystemSettings::GetMetric() index parameter -// -// NB: update the conversion table in msw/settings.cpp if you change the values -// of the elements of this enum -enum wxSystemMetric -{ - wxSYS_MOUSE_BUTTONS = 1, - wxSYS_BORDER_X, - wxSYS_BORDER_Y, - wxSYS_CURSOR_X, - wxSYS_CURSOR_Y, - wxSYS_DCLICK_X, - wxSYS_DCLICK_Y, - wxSYS_DRAG_X, - wxSYS_DRAG_Y, - wxSYS_EDGE_X, - wxSYS_EDGE_Y, - wxSYS_HSCROLL_ARROW_X, - wxSYS_HSCROLL_ARROW_Y, - wxSYS_HTHUMB_X, - wxSYS_ICON_X, - wxSYS_ICON_Y, - wxSYS_ICONSPACING_X, - wxSYS_ICONSPACING_Y, - wxSYS_WINDOWMIN_X, - wxSYS_WINDOWMIN_Y, - wxSYS_SCREEN_X, - wxSYS_SCREEN_Y, - wxSYS_FRAMESIZE_X, - wxSYS_FRAMESIZE_Y, - wxSYS_SMALLICON_X, - wxSYS_SMALLICON_Y, - wxSYS_HSCROLL_Y, - wxSYS_VSCROLL_X, - wxSYS_VSCROLL_ARROW_X, - wxSYS_VSCROLL_ARROW_Y, - wxSYS_VTHUMB_Y, - wxSYS_CAPTION_Y, - wxSYS_MENU_Y, - wxSYS_NETWORK_PRESENT, - wxSYS_PENWINDOWS_PRESENT, - wxSYS_SHOW_SOUNDS, - wxSYS_SWAP_BUTTONS -}; - -// possible values for wxSystemSettings::HasFeature() parameter -enum wxSystemFeature -{ - wxSYS_CAN_DRAW_FRAME_DECORATIONS = 1, - wxSYS_CAN_ICONIZE_FRAME, - wxSYS_TABLET_PRESENT -}; - -// values for different screen designs -enum wxSystemScreenType -{ - wxSYS_SCREEN_NONE = 0, // not yet defined - - wxSYS_SCREEN_TINY, // < - wxSYS_SCREEN_PDA, // >= 320x240 - wxSYS_SCREEN_SMALL, // >= 640x480 - wxSYS_SCREEN_DESKTOP // >= 800x600 -}; - -// ---------------------------------------------------------------------------- -// wxSystemSettingsNative: defines the API for wxSystemSettings class -// ---------------------------------------------------------------------------- - -// this is a namespace rather than a class: it has only non virtual static -// functions -// -// also note that the methods are implemented in the platform-specific source -// files (i.e. this is not a real base class as we can't override its virtual -// functions because it doesn't have any) - -class WXDLLEXPORT wxSystemSettingsNative -{ -public: - // get a standard system colour - static wxColour GetColour(wxSystemColour index); - - // get a standard system font - static wxFont GetFont(wxSystemFont index); - - // get a system-dependent metric - static int GetMetric(wxSystemMetric index, wxWindow * win = NULL); - - // return true if the port has certain feature - static bool HasFeature(wxSystemFeature index); -}; - -// ---------------------------------------------------------------------------- -// include the declaration of the real platform-dependent class -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxSystemSettings : public wxSystemSettingsNative -{ -public: -#ifdef __WXUNIVERSAL__ - // in wxUniversal we want to use the theme standard colours instead of the - // system ones, otherwise wxSystemSettings is just the same as - // wxSystemSettingsNative - static wxColour GetColour(wxSystemColour index); -#endif // __WXUNIVERSAL__ - - // Get system screen design (desktop, pda, ..) used for - // laying out various dialogs. - static wxSystemScreenType GetScreenType(); - - // Override default. - static void SetScreenType( wxSystemScreenType screen ); - - // Value - static wxSystemScreenType ms_screen; - -#if WXWIN_COMPATIBILITY_2_4 - // the backwards compatible versions of wxSystemSettingsNative functions, - // don't use these methods in the new code! - wxDEPRECATED(static wxColour GetSystemColour(int index)); - wxDEPRECATED(static wxFont GetSystemFont(int index)); - wxDEPRECATED(static int GetSystemMetric(int index)); -#endif -}; - -#endif - // _WX_SETTINGS_H_BASE_ - diff --git a/wxWidgets/include/wx/setup.h b/wxWidgets/include/wx/setup.h deleted file mode 100644 index c878616613..0000000000 --- a/wxWidgets/include/wx/setup.h +++ /dev/null @@ -1,1361 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/msw/setup.h -// Purpose: Configuration for the library -// Author: Julian Smart -// Modified by: -// Created: 01/02/97 -// RCS-ID: $Id: setup0.h 60190 2009-04-16 00:57:35Z KO $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_SETUP_H_ -#define _WX_SETUP_H_ - -/* --- start common options --- */ -// ---------------------------------------------------------------------------- -// 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.4 API: set it to 1 to -// enable it but please consider updating your code instead. -// -// Default is 0 -// -// Recommended setting: 0 (please update your code) -#define WXWIN_COMPATIBILITY_2_4 0 - -// This setting determines the compatibility with 2.6 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_6 1 - -// MSW-only: Set to 0 for accurate dialog units, else 1 for old behaviour when -// default system font is used for wxWindow::GetCharWidth/Height() instead of -// the current font. -// -// Default is 0 -// -// Recommended setting: 0 -#define wxDIALOG_UNIT_COMPATIBILITY 0 - -// ---------------------------------------------------------------------------- -// 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 wxWidgets 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 the normal memory operators. -// -// Default is 0 -// -// Recommended setting: 0 -#define wxUSE_DEBUG_CONTEXT 0 - -// 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 0 -// -// Recommended setting: 1 if you are not using a memory debugging tool, else 0 -#define wxUSE_MEMORY_TRACING 0 - -// 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 / CodeWarrior -// -// 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. -#define wxUSE_ON_FATAL_EXCEPTION 1 - -// Set this to 1 to be able to generate a human-readable (unlike -// machine-readable minidump created by wxCrashReport::Generate()) stack back -// trace when your program crashes using wxStackWalker -// -// Default is 1 if supported by the compiler. -// -// Recommended setting: 1, set to 0 if your programs never crash -#define wxUSE_STACKWALKER 1 - -// Set this to 1 to compile in wxDebugReport class which allows you to create -// and optionally upload to your web site a debug report consisting of back -// trace of the crash (if wxUSE_STACKWALKER == 1) and other information. -// -// Default is 1 if supported by the compiler. -// -// Recommended setting: 1, it is compiled into a separate library so there -// is no overhead if you don't use it -#define wxUSE_DEBUGREPORT 1 - -// ---------------------------------------------------------------------------- -// Unicode support -// ---------------------------------------------------------------------------- - -// Set wxUSE_UNICODE to 1 to compile wxWidgets 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/XP -// (Windows 9x doesn't support it and the programs compiled in Unicode mode -// will not run under 9x -- but see wxUSE_UNICODE_MSLU below). -// -// Default is 0 -// -// Recommended setting: 0 (unless you only plan to use Windows NT/2000/XP) -#ifndef wxUSE_UNICODE - #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. -// -// Note that like wxUSE_THREADS this option is automatically set to 0 if -// wxNO_EXCEPTIONS is defined. -// -// 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 - -// Set wxUSE_EXTENDED_RTTI to 1 to use extended RTTI -// -// Default is 0 -// -// Recommended setting: 0 (this is still work in progress...) -#define wxUSE_EXTENDED_RTTI 0 - -// Set wxUSE_STL to 1 to derive wxList(Foo) and wxArray(Foo) from -// std::list<Foo*> and std::vector<Foo*>, with a compatibility interface, -// and for wxHashMap to be implemented with templates. -// -// Default is 0 -// -// Recommended setting: YMMV -#define wxUSE_STL 0 - -// 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 -#define wxUSE_LOGWINDOW 1 - -// Recommended setting: 1 -#define wxUSE_LOGGUI 1 - -// Recommended setting: 1 -#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. -// -// Notice that if wxNO_THREADS is defined, wxUSE_THREADS is automatically reset -// to 0 in wx/chkconf.h, so, for example, if you set USE_THREADS to 0 in -// build/msw/config.* file this value will have no effect. -// -// Default is 1 -// -// Recommended setting: 0 unless you do plan to develop MT applications -#define wxUSE_THREADS 1 - -// If enabled, compiles wxWidgets streams classes -// -// wx stream classes are used for image IO, process IO redirection, network -// protocols implementation and much more and so disabling this results in a -// lot of other functionality being lost. -// -// Default is 1 -// -// Recommended setting: 1 as setting it to 0 disables many other things -#define wxUSE_STREAMS 1 - -// Use standard C++ streams if 1 instead of wx streams in some places. If -// disabled (default), wx streams are used everywhere and wxWidgets doesn't -// depend on the standard streams library. -// -// Notice that enabling this does not replace wx streams with std streams -// everywhere, in a lot of places wx streams are used no matter what. -// -// Default is 0 -// -// Recommended setting: 1 if you use the standard streams anyhow and so -// dependency on the standard streams library is not a -// problem -#define wxUSE_STD_IOSTREAM 0 - -// Enable conversion to standard C++ string if 1. -// -// Default is 1 for most compilers. -// -// Currently the Digital Mars and Watcom compilers come without standard C++ -// library headers by default, wxUSE_STD_STRING can be set to 1 if you do have -// them (e.g. from STLPort). -// -// VC++ 5.0 does include standard C++ library header, however they produce -// many warnings that can't be turned off when compiled at warning level 4. -#if defined(__DMC__) || defined(__WATCOMC__) \ - || (defined(_MSC_VER) && _MSC_VER < 1200) - #define wxUSE_STD_STRING 0 -#else - #define wxUSE_STD_STRING 1 -#endif - -// Support for positional parameters (e.g. %1$d, %2$s ...) in wxVsnprintf. -// Note that if the system's implementation does not support positional -// parameters, setting this to 1 forces the use of the wxWidgets implementation -// of wxVsnprintf. The standard vsnprintf() supports positional parameters on -// many Unix systems but usually doesn't under Windows. -// -// Positional parameters are very useful when translating a program since using -// them in formatting strings allow translators to correctly reorder the -// translated sentences. -// -// Default is 1 -// -// Recommended setting: 1 if you want to support multiple languages -#define wxUSE_PRINTF_POS_PARAMS 1 - -// ---------------------------------------------------------------------------- -// 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 wxFSVolume class providing access to the configured/active mount points -// -// Default is 1 -// -// Recommended setting: 1 (but may be safely disabled if you don't use it) -#define wxUSE_FSVOLUME 1 - -// Use wxStandardPaths class which allows to retrieve some standard locations -// in the file system -// -// Default is 1 -// -// Recommended setting: 1 (may be disabled to save space, but not much) -#define wxUSE_STDPATHS 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 0 - -// 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, don't use for now -#define wxUSE_DYNAMIC_LOADER 1 - -// 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 archive filesystem (requires wxUSE_FILESYSTEM) -#define wxUSE_FS_ARCHIVE 1 - -// Set to 1 to enable virtual Internet filesystem (requires wxUSE_FILESYSTEM) -#define wxUSE_FS_INET 1 - -// wxArchive classes for accessing archives such as zip and tar -#define wxUSE_ARCHIVE_STREAMS 1 - -// Set to 1 to compile wxZipInput/OutputStream classes. -#define wxUSE_ZIPSTREAM 1 - -// Set to 1 to compile wxTarInput/OutputStream classes. -#define wxUSE_TARSTREAM 1 - -// Set to 1 to compile wxZlibInput/OutputStream classes. Also required by -// wxUSE_LIBPNG -#define wxUSE_ZLIB 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 wxWidgets 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 - -// Define this to use native platform url and protocol support. -// Currently valid only for MS-Windows. -// Note: if you set this to 1, you can open ftp/http/gopher sites -// and obtain a valid input stream for these sites -// even when you set wxUSE_PROTOCOL_FTP/HTTP to 0. -// Doing so reduces the code size. -// -// This code is experimental and subject to change. -#define wxUSE_URL_NATIVE 0 - -// Support for wxVariant class used in several places throughout the library, -// notably in wxDataViewCtrl API. -// -// Default is 1. -// -// Recommended setting: 1 unless you want to reduce the library size as much as -// possible in which case setting this to 0 can gain up to 100KB. -#define wxUSE_VARIANT 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 - -// Use wxMediaCtrl -// -// Default is 1. -// -// Recommended setting: 1 -#define wxUSE_MEDIACTRL 1 - -// Use GStreamer for Unix (req a lot of dependancies) -// -// Default is 0 -// -// Recommended setting: 1 (wxMediaCtrl won't work by default without it) -#define wxUSE_GSTREAMER 0 - -// Use wxWidget's XRC XML-based resource system. Recommended. -// -// Default is 1 -// -// Recommended setting: 1 (requires wxUSE_XML) -#define wxUSE_XRC 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 the same as wxUSE_XRC, i.e. 1 by default. -// -// Recommended setting: 1 (required by XRC) -#define wxUSE_XML wxUSE_XRC - -// Use wxWidget's AUI docking system -// -// Default is 1 -// -// Recommended setting: 1 -#define wxUSE_AUI 1 - - -// Enable the new wxGraphicsPath and wxGraphicsContext classes for an advanced -// 2D drawing API. (Still somewhat experimental) -// -// Please note that on Windows you will need to link with gdiplus.lib (use -// USE_GDIPLUS=1 for makefile builds) and distribute gdiplus.dll with your -// application if you want it to be runnable on pre-XP systems. -// -// Default is 0 -// -// Recommended setting: 1 -#ifndef wxUSE_GRAPHICS_CONTEXT -#define wxUSE_GRAPHICS_CONTEXT 0 -#endif - -// Enable the new wxCairoContext classes for an advanced -// 2D drawing API. (Still somewhat experimental) -// -// Please note that you will need to link with Cairo for this to work. -// -// Default is 0 -// -// Recommended setting: 1 -#ifndef wxUSE_CAIRO -#define wxUSE_CAIRO 0 -#endif - -// ---------------------------------------------------------------------------- -// 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 -// -// Default is 1 -// -// Recommended setting: 1 (may be set to 0 if you don't wxUSE_TIPWINDOW) -#define wxUSE_POPUPWIN 1 - -// wxTipWindow allows to implement the custom tooltips, it is used by the -// context help classes. Requires wxUSE_POPUPWIN. -// -// Default is 1 -// -// Recommended setting: 1 (may be set to 0) -#define wxUSE_TIPWINDOW 1 - -// Each of the settings below corresponds to one wxWidgets 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_ANIMATIONCTRL 1 // wxAnimationCtrl -#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_COLLPANE 1 // wxCollapsiblePane -#define wxUSE_COLOURPICKERCTRL 1 // wxColourPickerCtrl -#define wxUSE_COMBOBOX 1 // wxComboBox -#define wxUSE_DATAVIEWCTRL 1 // wxDataViewCtrl -#define wxUSE_DATEPICKCTRL 1 // wxDatePickerCtrl -#define wxUSE_DIRPICKERCTRL 1 // wxDirPickerCtrl -#define wxUSE_FILEPICKERCTRL 1 // wxFilePickerCtrl -#define wxUSE_FONTPICKERCTRL 1 // wxFontPickerCtrl -#define wxUSE_GAUGE 1 // wxGauge -#define wxUSE_HYPERLINKCTRL 1 // wxHyperlinkCtrl -#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_SEARCHCTRL 1 // wxSearchCtrl -#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 for the platforms where native status bar is supported. -// -// 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 - -// wxNotebook is a control with several "tabs" located on one of its sides. It -// may be used to 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 - -// wxChoicebook control is similar to wxNotebook but uses wxChoice instead of -// the tabs -// -// Default is 1. -// -// Recommended setting: 1 -#define wxUSE_CHOICEBOOK 1 - -// wxTreebook control is similar to wxNotebook but uses wxTreeCtrl instead of -// the tabs -// -// Default is 1. -// -// Recommended setting: 1 -#define wxUSE_TREEBOOK 1 - -// wxToolbook control is similar to wxNotebook but uses wxToolBar instead of -// tabs -// -// Default is 1. -// -// Recommended setting: 1 -#define wxUSE_TOOLBOOK 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, set to 0 to cut down compilation time and binaries size if you -// don't use it. -// -// Recommended setting: 1 -// -#define wxUSE_GRID 1 - -// wxMiniFrame class: a frame with narrow title bar -// -// Default is 1. -// -// Recommended setting: 1 (it doesn't cost almost anything) -#define wxUSE_MINIFRAME 1 - -// wxComboCtrl and related classes: combobox with custom popup window and -// not necessarily a listbox. -// -// Default is 1. -// -// Recommended setting: 1 but can be safely set to 0 except for wxUniv where it -// it used by wxComboBox -#define wxUSE_COMBOCTRL 1 - -// wxOwnerDrawnComboBox is a custom combobox allowing to paint the combobox -// items. -// -// Default is 1. -// -// Recommended setting: 1 but can be safely set to 0, except where it is -// needed as a base class for generic wxBitmapComboBox. -#define wxUSE_ODCOMBOBOX 1 - -// wxBitmapComboBox is a combobox that can have images in front of text items. -// -// Default is 1. -// -// Recommended setting: 1 but can be safely set to 0 -#define wxUSE_BITMAPCOMBOBOX 1 - -// ---------------------------------------------------------------------------- -// Miscellaneous GUI stuff -// ---------------------------------------------------------------------------- - -// wxAcceleratorTable/Entry classes and support for them in wxMenu(Bar) -#define wxUSE_ACCEL 1 - -// Hotkey support (currently Windows only) -#define wxUSE_HOTKEY 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 -// their geometries as well as finding the display on which the given point or -// window lies. -// -// Default is 1. -// -// Recommended setting: 1 if you need it, can be safely set to 0 otherwise -#define wxUSE_DISPLAY 1 - -// 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 - -// ---------------------------------------------------------------------------- -// 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 - -// Compile in wxAboutBox() function showing the standard "About" dialog. -// -// Default is 1 -// -// Recommended setting: 1 but can be set to 0 to save some space if you don't -// use this function -#define wxUSE_ABOUTDLG 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 MDI support. -// -// Requires wxUSE_NOTEBOOK under platforms other than MSW. -// -// Default is 1. -// -// Recommended setting: 1, can be safely set to 0. -#define wxUSE_MDI 1 - -// Set to 0 to disable document/view architecture -#define wxUSE_DOC_VIEW_ARCHITECTURE 1 - -// Set to 0 to disable MDI document/view architecture -// -// Requires wxUSE_MDI && wxUSE_DOC_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 - -// Setting wxUSE_GLCANVAS to 1 enables OpenGL support. You need to have OpenGL -// headers and libraries to be able to compile the library with wxUSE_GLCANVAS -// set to 1. Note that for some compilers (notably Microsoft Visual C++) you -// will need to manually add opengl32.lib and glu32.lib to the list of -// libraries linked with your program if you use OpenGL. -// -// Default is 0. -// -// Recommended setting: 1 if you intend to use OpenGL, 0 otherwise -#define wxUSE_GLCANVAS 1 - -// wxRichTextCtrl allows editing of styled text. -// -// Default is 1. -// -// Recommended setting: 1, set to 0 if you want compile a -// smaller library. -#define wxUSE_RICHTEXT 1 - -// ---------------------------------------------------------------------------- -// 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 - -// Use wxAccessible for enhanced and customisable accessibility. -// Depends on wxUSE_OLE. -// -// Default is 0. -// -// Recommended setting (at present): 0 -#define wxUSE_ACCESSIBILITY 0 - -// ---------------------------------------------------------------------------- -// miscellaneous settings -// ---------------------------------------------------------------------------- - -// wxSingleInstanceChecker class allows to verify at startup if another program -// instance is running. -// -// 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 1 - // 0 for no interprocess comms -#define wxUSE_HELP 1 - // 0 for no help facility - -// Should we use MS HTML help for wxHelpController? If disabled, neither -// wxCHMHelpController nor wxBestHelpController are available. -// -// Default is 1 under MSW, 0 is always used for the other platforms. -// -// Recommended setting: 1, only set to 0 if you have trouble compiling -// wxCHMHelpController (could be a problem with really ancient compilers) -#define wxUSE_MS_HTML_HELP 1 - - -// Use wxHTML-based help controller? -#define wxUSE_WXHTML_HELP 1 - -#define wxUSE_RESOURCES 0 - // 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 1 - -// ---------------------------------------------------------------------------- -// 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 compatibility 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 <iostream> and <iostream.h> but you can't mix -// them. Set to 1 for <iostream.h>, 0 for <iostream>. Note that VC++ 7.1 -// and later doesn't support wxUSE_IOSTREAMH == 1 and so <iostream> will be -// used anyhow. -// -// Default is 1. -// -// Recommended setting: whatever your compiler likes more -#define wxUSE_IOSTREAMH 1 - -// ---------------------------------------------------------------------------- -// 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 TGA format support (loading only) -#define wxUSE_TGA 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 (Amiga format) -#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 - -// ---------------------------------------------------------------------------- -// wxUniversal-only options -// ---------------------------------------------------------------------------- - -// Set to 1 to enable compilation of all themes, this is the default -#define wxUSE_ALL_THEMES 1 - -// Set to 1 to enable the compilation of individual theme if wxUSE_ALL_THEMES -// is unset, if it is set these options are not used; notice that metal theme -// uses Win32 one -#define wxUSE_THEME_GTK 0 -#define wxUSE_THEME_METAL 0 -#define wxUSE_THEME_MONO 0 -#define wxUSE_THEME_WIN32 0 - - -/* --- end common options --- */ - -// ---------------------------------------------------------------------------- -// Windows-only settings -// ---------------------------------------------------------------------------- - -// Set wxUSE_UNICODE_MSLU to 1 if you're compiling wxWidgets in Unicode mode -// and want to run your programs under Windows 9x and not only NT/2000/XP. -// This setting enables use of unicows.dll from MSLU (MS Layer for Unicode, see -// http://www.microsoft.com/globaldev/handson/dev/mslu_announce.mspx). Note -// that you will have to modify the makefiles to include unicows.lib import -// library as the first library (see installation instructions in install.txt -// to learn how to do it when building the library or samples). -// -// If your compiler doesn't have unicows.lib, you can get a version of it at -// http://libunicows.sourceforge.net -// -// Default is 0 -// -// Recommended setting: 0 (1 if you want to deploy Unicode apps on 9x systems) -#ifndef wxUSE_UNICODE_MSLU - #define wxUSE_UNICODE_MSLU 0 -#endif - -// Set this to 1 if you want to use wxWidgets and MFC in the same program. This -// will override some other settings (see below) -// -// Default is 0. -// -// Recommended setting: 0 unless you really have to use MFC -#define wxUSE_MFC 0 - -// Set this to 1 for generic OLE support: this is required for drag-and-drop, -// clipboard, OLE Automation. Only set it to 0 if your compiler is very old and -// can't compile/doesn't have the OLE headers. -// -// Default is 1. -// -// Recommended setting: 1 -#define wxUSE_OLE 1 - -// Set this to 1 to enable wxAutomationObject class. -// -// Default is 1. -// -// Recommended setting: 1 if you need to control other applications via OLE -// Automation, can be safely set to 0 otherwise -#define wxUSE_OLE_AUTOMATION 1 - -// Set this to 1 to enable wxActiveXContainer class allowing to embed OLE -// controls in wx. -// -// Default is 1. -// -// Recommended setting: 1, required by wxMediaCtrl -#define wxUSE_ACTIVEX 1 - -// wxDC cacheing implementation -#define wxUSE_DC_CACHEING 1 - -// Set this to 1 to enable the use of DIB's for wxBitmap to support -// bitmaps > 16MB on Win95/98/Me. Set to 0 to use DDB's only. -#define wxUSE_DIB_FOR_BITMAP 0 - -// Set this to 1 to enable wxDIB class used internally for manipulating -// wxBitmao data. -// -// Default is 1, set it to 0 only if you don't use wxImage neither -// -// Recommended setting: 1 (without it conversion to/from wxImage won't work) -#define wxUSE_WXDIB 1 - -// Set to 0 to disable PostScript print/preview architecture code under Windows -// (just use Windows printing). -#define wxUSE_POSTSCRIPT_ARCHITECTURE_IN_MSW 1 - -// Set this to 1 to use RICHEDIT controls for wxTextCtrl with style wxTE_RICH -// which allows to put more than ~32Kb of text in it even under Win9x (NT -// doesn't have such limitation). -// -// Default is 1 for compilers which support it -// -// Recommended setting: 1, only set it to 0 if your compiler doesn't have -// or can't compile <richedit.h> -#define wxUSE_RICHEDIT 1 - -// Set this to 1 to use extra features of richedit v2 and later controls -// -// Default is 1 for compilers which support it -// -// Recommended setting: 1 -#define wxUSE_RICHEDIT2 1 - -// Set this to 1 to enable support for the owner-drawn menu and listboxes. This -// is required by wxUSE_CHECKLISTBOX. -// -// Default is 1. -// -// Recommended setting: 1, set to 0 for a small library size reduction -#define wxUSE_OWNER_DRAWN 1 - -// Set to 1 to compile MS Windows XP theme engine support -#define wxUSE_UXTHEME 1 - -// Set to 1 to auto-adapt to MS Windows XP themes where possible -// (notably, wxNotebook pages) -#define wxUSE_UXTHEME_AUTO 1 - -// Set to 1 to use InkEdit control (Tablet PC), if available -#define wxUSE_INKEDIT 0 - -// ---------------------------------------------------------------------------- -// Generic versions of native controls -// ---------------------------------------------------------------------------- - -// Set this to 1 to be able to use wxDatePickerCtrlGeneric in addition to the -// native wxDatePickerCtrl -// -// Default is 0. -// -// Recommended setting: 0, this is mainly used for testing -#define wxUSE_DATEPICKCTRL_GENERIC 0 - -// ---------------------------------------------------------------------------- -// Crash debugging helpers -// ---------------------------------------------------------------------------- - -// Set this to 1 to be able to use wxCrashReport::Generate() to create mini -// dumps of your program when it crashes (or at any other moment) -// -// Default is 1 if supported by the compiler (VC++ and recent BC++ only). -// -// Recommended setting: 1, set to 0 if your programs never crash -#define wxUSE_CRASHREPORT 1 - -// ---------------------------------------------------------------------------- -// obsolete settings -// ---------------------------------------------------------------------------- - -// NB: all settings in this section are obsolete and should not be used/changed -// at all, they will disappear - -// Define 1 to use bitmap messages. -#define wxUSE_BITMAP_MESSAGE 1 - -#endif // _WX_SETUP_H_ - diff --git a/wxWidgets/include/wx/setup_inc.h b/wxWidgets/include/wx/setup_inc.h deleted file mode 100644 index 45cc4e55d6..0000000000 --- a/wxWidgets/include/wx/setup_inc.h +++ /dev/null @@ -1,1198 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: wx/setup_inc.h -// Purpose: setup.h settings -// Author: Vadim Zeitlin -// Modified by: -// Created: -// RCS-ID: $Id: setup_inc.h 51451 2008-01-29 23:11:55Z VZ $ -// Copyright: (c) Vadim Zeitlin -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -// ---------------------------------------------------------------------------- -// 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.4 API: set it to 1 to -// enable it but please consider updating your code instead. -// -// Default is 0 -// -// Recommended setting: 0 (please update your code) -#define WXWIN_COMPATIBILITY_2_4 0 - -// This setting determines the compatibility with 2.6 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_6 1 - -// MSW-only: Set to 0 for accurate dialog units, else 1 for old behaviour when -// default system font is used for wxWindow::GetCharWidth/Height() instead of -// the current font. -// -// Default is 0 -// -// Recommended setting: 0 -#define wxDIALOG_UNIT_COMPATIBILITY 0 - -// ---------------------------------------------------------------------------- -// 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 wxWidgets 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 the normal memory operators. -// -// Default is 0 -// -// Recommended setting: 0 -#define wxUSE_DEBUG_CONTEXT 0 - -// 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 0 -// -// Recommended setting: 1 if you are not using a memory debugging tool, else 0 -#define wxUSE_MEMORY_TRACING 0 - -// 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 / CodeWarrior -// -// 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. -#define wxUSE_ON_FATAL_EXCEPTION 1 - -// Set this to 1 to be able to generate a human-readable (unlike -// machine-readable minidump created by wxCrashReport::Generate()) stack back -// trace when your program crashes using wxStackWalker -// -// Default is 1 if supported by the compiler. -// -// Recommended setting: 1, set to 0 if your programs never crash -#define wxUSE_STACKWALKER 1 - -// Set this to 1 to compile in wxDebugReport class which allows you to create -// and optionally upload to your web site a debug report consisting of back -// trace of the crash (if wxUSE_STACKWALKER == 1) and other information. -// -// Default is 1 if supported by the compiler. -// -// Recommended setting: 1, it is compiled into a separate library so there -// is no overhead if you don't use it -#define wxUSE_DEBUGREPORT 1 - -// ---------------------------------------------------------------------------- -// Unicode support -// ---------------------------------------------------------------------------- - -// Set wxUSE_UNICODE to 1 to compile wxWidgets 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/XP -// (Windows 9x doesn't support it and the programs compiled in Unicode mode -// will not run under 9x -- but see wxUSE_UNICODE_MSLU below). -// -// Default is 0 -// -// Recommended setting: 0 (unless you only plan to use Windows NT/2000/XP) -#ifndef wxUSE_UNICODE - #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. -// -// Note that like wxUSE_THREADS this option is automatically set to 0 if -// wxNO_EXCEPTIONS is defined. -// -// 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 - -// Set wxUSE_EXTENDED_RTTI to 1 to use extended RTTI -// -// Default is 0 -// -// Recommended setting: 0 (this is still work in progress...) -#define wxUSE_EXTENDED_RTTI 0 - -// Set wxUSE_STL to 1 to derive wxList(Foo) and wxArray(Foo) from -// std::list<Foo*> and std::vector<Foo*>, with a compatibility interface, -// and for wxHashMap to be implemented with templates. -// -// Default is 0 -// -// Recommended setting: YMMV -#define wxUSE_STL 0 - -// 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 -#define wxUSE_LOGWINDOW 1 - -// Recommended setting: 1 -#define wxUSE_LOGGUI 1 - -// Recommended setting: 1 -#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. -// -// Notice that if wxNO_THREADS is defined, wxUSE_THREADS is automatically reset -// to 0 in wx/chkconf.h, so, for example, if you set USE_THREADS to 0 in -// build/msw/config.* file this value will have no effect. -// -// Default is 1 -// -// Recommended setting: 0 unless you do plan to develop MT applications -#define wxUSE_THREADS 1 - -// If enabled, compiles wxWidgets streams classes -// -// wx stream classes are used for image IO, process IO redirection, network -// protocols implementation and much more and so disabling this results in a -// lot of other functionality being lost. -// -// Default is 1 -// -// Recommended setting: 1 as setting it to 0 disables many other things -#define wxUSE_STREAMS 1 - -// Use standard C++ streams if 1 instead of wx streams in some places. If -// disabled (default), wx streams are used everywhere and wxWidgets doesn't -// depend on the standard streams library. -// -// Notice that enabling this does not replace wx streams with std streams -// everywhere, in a lot of places wx streams are used no matter what. -// -// Default is 0 -// -// Recommended setting: 1 if you use the standard streams anyhow and so -// dependency on the standard streams library is not a -// problem -#define wxUSE_STD_IOSTREAM 0 - -// Enable conversion to standard C++ string if 1. -// -// Default is 1 for most compilers. -// -// Currently the Digital Mars and Watcom compilers come without standard C++ -// library headers by default, wxUSE_STD_STRING can be set to 1 if you do have -// them (e.g. from STLPort). -// -// VC++ 5.0 does include standard C++ library header, however they produce -// many warnings that can't be turned off when compiled at warning level 4. -#if defined(__DMC__) || defined(__WATCOMC__) \ - || (defined(_MSC_VER) && _MSC_VER < 1200) - #define wxUSE_STD_STRING 0 -#else - #define wxUSE_STD_STRING 1 -#endif - -// Support for positional parameters (e.g. %1$d, %2$s ...) in wxVsnprintf. -// Note that if the system's implementation does not support positional -// parameters, setting this to 1 forces the use of the wxWidgets implementation -// of wxVsnprintf. The standard vsnprintf() supports positional parameters on -// many Unix systems but usually doesn't under Windows. -// -// Positional parameters are very useful when translating a program since using -// them in formatting strings allow translators to correctly reorder the -// translated sentences. -// -// Default is 1 -// -// Recommended setting: 1 if you want to support multiple languages -#define wxUSE_PRINTF_POS_PARAMS 1 - -// ---------------------------------------------------------------------------- -// 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 wxFSVolume class providing access to the configured/active mount points -// -// Default is 1 -// -// Recommended setting: 1 (but may be safely disabled if you don't use it) -#define wxUSE_FSVOLUME 1 - -// Use wxStandardPaths class which allows to retrieve some standard locations -// in the file system -// -// Default is 1 -// -// Recommended setting: 1 (may be disabled to save space, but not much) -#define wxUSE_STDPATHS 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, don't use for now -#define wxUSE_DYNAMIC_LOADER 1 - -// 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 archive filesystem (requires wxUSE_FILESYSTEM) -#define wxUSE_FS_ARCHIVE 1 - -// Set to 1 to enable virtual Internet filesystem (requires wxUSE_FILESYSTEM) -#define wxUSE_FS_INET 1 - -// wxArchive classes for accessing archives such as zip and tar -#define wxUSE_ARCHIVE_STREAMS 1 - -// Set to 1 to compile wxZipInput/OutputStream classes. -#define wxUSE_ZIPSTREAM 1 - -// Set to 1 to compile wxTarInput/OutputStream classes. -#define wxUSE_TARSTREAM 1 - -// Set to 1 to compile wxZlibInput/OutputStream classes. Also required by -// wxUSE_LIBPNG -#define wxUSE_ZLIB 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 wxWidgets 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 - -// Define this to use native platform url and protocol support. -// Currently valid only for MS-Windows. -// Note: if you set this to 1, you can open ftp/http/gopher sites -// and obtain a valid input stream for these sites -// even when you set wxUSE_PROTOCOL_FTP/HTTP to 0. -// Doing so reduces the code size. -// -// This code is experimental and subject to change. -#define wxUSE_URL_NATIVE 0 - -// Support for wxVariant class used in several places throughout the library, -// notably in wxDataViewCtrl API. -// -// Default is 1. -// -// Recommended setting: 1 unless you want to reduce the library size as much as -// possible in which case setting this to 0 can gain up to 100KB. -#define wxUSE_VARIANT 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 - -// Use wxMediaCtrl -// -// Default is 1. -// -// Recommended setting: 1 -#define wxUSE_MEDIACTRL 1 - -// Use GStreamer for Unix (req a lot of dependancies) -// -// Default is 0 -// -// Recommended setting: 1 (wxMediaCtrl won't work by default without it) -#define wxUSE_GSTREAMER 0 - -// Use wxWidget's XRC XML-based resource system. Recommended. -// -// Default is 1 -// -// Recommended setting: 1 (requires wxUSE_XML) -#define wxUSE_XRC 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 the same as wxUSE_XRC, i.e. 1 by default. -// -// Recommended setting: 1 (required by XRC) -#define wxUSE_XML wxUSE_XRC - -// Use wxWidget's AUI docking system -// -// Default is 1 -// -// Recommended setting: 1 -#define wxUSE_AUI 1 - - -// Enable the new wxGraphicsPath and wxGraphicsContext classes for an advanced -// 2D drawing API. (Still somewhat experimental) -// -// Please note that on Windows you will need to link with gdiplus.lib (use -// USE_GDIPLUS=1 for makefile builds) and distribute gdiplus.dll with your -// application if you want it to be runnable on pre-XP systems. -// -// Default is 0 -// -// Recommended setting: 1 -#ifndef wxUSE_GRAPHICS_CONTEXT -#define wxUSE_GRAPHICS_CONTEXT 0 -#endif - -// ---------------------------------------------------------------------------- -// 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 -// -// Default is 1 -// -// Recommended setting: 1 (may be set to 0 if you don't wxUSE_TIPWINDOW) -#define wxUSE_POPUPWIN 1 - -// wxTipWindow allows to implement the custom tooltips, it is used by the -// context help classes. Requires wxUSE_POPUPWIN. -// -// Default is 1 -// -// Recommended setting: 1 (may be set to 0) -#define wxUSE_TIPWINDOW 1 - -// Each of the settings below corresponds to one wxWidgets 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_ANIMATIONCTRL 1 // wxAnimationCtrl -#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_COLLPANE 1 // wxCollapsiblePane -#define wxUSE_COLOURPICKERCTRL 1 // wxColourPickerCtrl -#define wxUSE_COMBOBOX 1 // wxComboBox -#define wxUSE_DATAVIEWCTRL 1 // wxDataViewCtrl -#define wxUSE_DATEPICKCTRL 1 // wxDatePickerCtrl -#define wxUSE_DIRPICKERCTRL 1 // wxDirPickerCtrl -#define wxUSE_FILEPICKERCTRL 1 // wxFilePickerCtrl -#define wxUSE_FONTPICKERCTRL 1 // wxFontPickerCtrl -#define wxUSE_GAUGE 1 // wxGauge -#define wxUSE_HYPERLINKCTRL 1 // wxHyperlinkCtrl -#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_SEARCHCTRL 1 // wxSearchCtrl -#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 for the platforms where native status bar is supported. -// -// 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 - -// wxNotebook is a control with several "tabs" located on one of its sides. It -// may be used to 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 - -// wxChoicebook control is similar to wxNotebook but uses wxChoice instead of -// the tabs -// -// Default is 1. -// -// Recommended setting: 1 -#define wxUSE_CHOICEBOOK 1 - -// wxTreebook control is similar to wxNotebook but uses wxTreeCtrl instead of -// the tabs -// -// Default is 1. -// -// Recommended setting: 1 -#define wxUSE_TREEBOOK 1 - -// wxToolbook control is similar to wxNotebook but uses wxToolBar instead of -// tabs -// -// Default is 1. -// -// Recommended setting: 1 -#define wxUSE_TOOLBOOK 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, set to 0 to cut down compilation time and binaries size if you -// don't use it. -// -// Recommended setting: 1 -// -#define wxUSE_GRID 1 - -// wxMiniFrame class: a frame with narrow title bar -// -// Default is 1. -// -// Recommended setting: 1 (it doesn't cost almost anything) -#define wxUSE_MINIFRAME 1 - -// wxComboCtrl and related classes: combobox with custom popup window and -// not necessarily a listbox. -// -// Default is 1. -// -// Recommended setting: 1 but can be safely set to 0 except for wxUniv where it -// it used by wxComboBox -#define wxUSE_COMBOCTRL 1 - -// wxOwnerDrawnComboBox is a custom combobox allowing to paint the combobox -// items. -// -// Default is 1. -// -// Recommended setting: 1 but can be safely set to 0, except where it is -// needed as a base class for generic wxBitmapComboBox. -#define wxUSE_ODCOMBOBOX 1 - -// wxBitmapComboBox is a combobox that can have images in front of text items. -// -// Default is 1. -// -// Recommended setting: 1 but can be safely set to 0 -#define wxUSE_BITMAPCOMBOBOX 1 - -// ---------------------------------------------------------------------------- -// Miscellaneous GUI stuff -// ---------------------------------------------------------------------------- - -// wxAcceleratorTable/Entry classes and support for them in wxMenu(Bar) -#define wxUSE_ACCEL 1 - -// Hotkey support (currently Windows only) -#define wxUSE_HOTKEY 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 -// their geometries as well as finding the display on which the given point or -// window lies. -// -// Default is 1. -// -// Recommended setting: 1 if you need it, can be safely set to 0 otherwise -#define wxUSE_DISPLAY 1 - -// 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 - -// ---------------------------------------------------------------------------- -// 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 - -// Compile in wxAboutBox() function showing the standard "About" dialog. -// -// Default is 1 -// -// Recommended setting: 1 but can be set to 0 to save some space if you don't -// use this function -#define wxUSE_ABOUTDLG 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 MDI support. -// -// Requires wxUSE_NOTEBOOK under platforms other than MSW. -// -// Default is 1. -// -// Recommended setting: 1, can be safely set to 0. -#define wxUSE_MDI 1 - -// Set to 0 to disable document/view architecture -#define wxUSE_DOC_VIEW_ARCHITECTURE 1 - -// Set to 0 to disable MDI document/view architecture -// -// Requires wxUSE_MDI && wxUSE_DOC_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 - -// Setting wxUSE_GLCANVAS to 1 enables OpenGL support. You need to have OpenGL -// headers and libraries to be able to compile the library with wxUSE_GLCANVAS -// set to 1. Note that for some compilers (notably Microsoft Visual C++) you -// will need to manually add opengl32.lib and glu32.lib to the list of -// libraries linked with your program if you use OpenGL. -// -// Default is 0. -// -// Recommended setting: 1 if you intend to use OpenGL, 0 otherwise -#define wxUSE_GLCANVAS 0 - -// wxRichTextCtrl allows editing of styled text. -// -// Default is 1. -// -// Recommended setting: 1, set to 0 if you want compile a -// smaller library. -#define wxUSE_RICHTEXT 1 - -// ---------------------------------------------------------------------------- -// 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 - -// Use wxAccessible for enhanced and customisable accessibility. -// Depends on wxUSE_OLE. -// -// Default is 0. -// -// Recommended setting (at present): 0 -#define wxUSE_ACCESSIBILITY 0 - -// ---------------------------------------------------------------------------- -// miscellaneous settings -// ---------------------------------------------------------------------------- - -// wxSingleInstanceChecker class allows to verify at startup if another program -// instance is running. -// -// 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 1 - // 0 for no interprocess comms -#define wxUSE_HELP 1 - // 0 for no help facility - -// Should we use MS HTML help for wxHelpController? If disabled, neither -// wxCHMHelpController nor wxBestHelpController are available. -// -// Default is 1 under MSW, 0 is always used for the other platforms. -// -// Recommended setting: 1, only set to 0 if you have trouble compiling -// wxCHMHelpController (could be a problem with really ancient compilers) -#define wxUSE_MS_HTML_HELP 1 - - -// Use wxHTML-based help controller? -#define wxUSE_WXHTML_HELP 1 - -#define wxUSE_RESOURCES 0 - // 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 1 - -// ---------------------------------------------------------------------------- -// 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 compatibility 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 <iostream> and <iostream.h> but you can't mix -// them. Set to 1 for <iostream.h>, 0 for <iostream>. Note that VC++ 7.1 -// and later doesn't support wxUSE_IOSTREAMH == 1 and so <iostream> will be -// used anyhow. -// -// Default is 1. -// -// Recommended setting: whatever your compiler likes more -#define wxUSE_IOSTREAMH 1 - -// ---------------------------------------------------------------------------- -// 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 TGA format support (loading only) -#define wxUSE_TGA 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 (Amiga format) -#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 - -// ---------------------------------------------------------------------------- -// wxUniversal-only options -// ---------------------------------------------------------------------------- - -// Set to 1 to enable compilation of all themes, this is the default -#define wxUSE_ALL_THEMES 1 - -// Set to 1 to enable the compilation of individual theme if wxUSE_ALL_THEMES -// is unset, if it is set these options are not used; notice that metal theme -// uses Win32 one -#define wxUSE_THEME_GTK 0 -#define wxUSE_THEME_METAL 0 -#define wxUSE_THEME_MONO 0 -#define wxUSE_THEME_WIN32 0 - - diff --git a/wxWidgets/include/wx/setup_redirect.h b/wxWidgets/include/wx/setup_redirect.h deleted file mode 100644 index 87a9c3d85a..0000000000 --- a/wxWidgets/include/wx/setup_redirect.h +++ /dev/null @@ -1,18 +0,0 @@ -/* - * wx/setup.h - * - * This file should not normally be used, except where makefiles - * have not yet been adjusted to take into account of the new scheme - * whereby a setup.h is created under the lib directory. - * - * Copyright: (c) Vadim Zeitlin - * RCS-ID: $Id: setup_redirect.h 33948 2005-05-04 18:57:50Z JS $ - * Licence: wxWindows Licence - */ - -#ifdef __WXMSW__ -#include "wx/msw/setup.h" -#else -#error Please adjust your include path to pick up the wx/setup.h file under lib first. -#endif - diff --git a/wxWidgets/include/wx/sizer.h b/wxWidgets/include/wx/sizer.h deleted file mode 100644 index f1f503677d..0000000000 --- a/wxWidgets/include/wx/sizer.h +++ /dev/null @@ -1,1092 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/sizer.h -// Purpose: provide wxSizer class for layout -// Author: Robert Roebling and Robin Dunn -// Modified by: Ron Lee, Vadim Zeitlin (wxSizerFlags) -// Created: -// RCS-ID: $Id: sizer.h 52331 2008-03-05 15:02:22Z VS $ -// Copyright: (c) Robin Dunn, Robert Roebling -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef __WXSIZER_H__ -#define __WXSIZER_H__ - -#include "wx/defs.h" - -#include "wx/window.h" - -//--------------------------------------------------------------------------- -// classes -//--------------------------------------------------------------------------- - -class WXDLLIMPEXP_FWD_CORE wxButton; -class WXDLLIMPEXP_FWD_CORE wxBoxSizer; -class WXDLLIMPEXP_FWD_CORE wxSizerItem; -class WXDLLIMPEXP_FWD_CORE wxSizer; -class WXDLLIMPEXP_FWD_CORE wxFlexGridSizer; -class WXDLLIMPEXP_FWD_CORE wxGridBagSizer; - -#ifndef wxUSE_BORDER_BY_DEFAULT - #ifdef __SMARTPHONE__ - // no borders by default on limited size screen - #define wxUSE_BORDER_BY_DEFAULT 0 - #else - #define wxUSE_BORDER_BY_DEFAULT 1 - #endif -#endif - -// ---------------------------------------------------------------------------- -// wxSizerFlags: flags used for an item in the sizer -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxSizerFlags -{ -public: - // construct the flags object initialized with the given proportion (0 by - // default) - wxSizerFlags(int proportion = 0) : m_proportion(proportion) - { - m_flags = 0; - m_borderInPixels = 0; - } - - // setters for all sizer flags, they all return the object itself so that - // calls to them can be chained - - wxSizerFlags& Proportion(int proportion) - { - m_proportion = proportion; - return *this; - } - - wxSizerFlags& Align(int alignment) // combination of wxAlignment values - { - m_flags &= ~wxALIGN_MASK; - m_flags |= alignment; - - return *this; - } - - wxSizerFlags& Expand() - { - m_flags |= wxEXPAND; - return *this; - } - - // some shortcuts for Align() - wxSizerFlags& Centre() { return Align(wxCENTRE); } - wxSizerFlags& Center() { return Centre(); } - wxSizerFlags& Left() { return Align(wxALIGN_LEFT); } - wxSizerFlags& Right() { return Align(wxALIGN_RIGHT); } - -#if wxABI_VERSION >= 20802 - wxSizerFlags& Top() { return Align(wxALIGN_TOP); } - wxSizerFlags& Bottom() { return Align(wxALIGN_BOTTOM); } -#endif // wxABI 2.8.2+ - - // default border size used by Border() below - static int GetDefaultBorder() - { -#if wxUSE_BORDER_BY_DEFAULT - // FIXME: default border size shouldn't be hardcoded and at the very - // least they should depend on the current font size - return 5; -#else - return 0; -#endif - } - - - wxSizerFlags& Border(int direction, int borderInPixels) - { - m_flags &= ~wxALL; - m_flags |= direction; - - m_borderInPixels = borderInPixels; - - return *this; - } - - wxSizerFlags& Border(int direction = wxALL) - { -#if wxUSE_BORDER_BY_DEFAULT - return Border(direction, GetDefaultBorder()); -#else - // no borders by default on limited size screen - wxUnusedVar(direction); - - return *this; -#endif - } - - wxSizerFlags& DoubleBorder(int direction = wxALL) - { -#if wxUSE_BORDER_BY_DEFAULT - return Border(direction, 2*GetDefaultBorder()); -#else - wxUnusedVar(direction); - - return *this; -#endif - } - - wxSizerFlags& TripleBorder(int direction = wxALL) - { -#if wxUSE_BORDER_BY_DEFAULT - return Border(direction, 3*GetDefaultBorder()); -#else - wxUnusedVar(direction); - - return *this; -#endif - } - - wxSizerFlags& HorzBorder() - { -#if wxUSE_BORDER_BY_DEFAULT - return Border(wxLEFT | wxRIGHT, GetDefaultBorder()); -#else - return *this; -#endif - } - - wxSizerFlags& DoubleHorzBorder() - { -#if wxUSE_BORDER_BY_DEFAULT - return Border(wxLEFT | wxRIGHT, 2*GetDefaultBorder()); -#else - return *this; -#endif - } - -#if wxABI_VERSION >= 20802 - // setters for the others flags - wxSizerFlags& Shaped() - { - m_flags |= wxSHAPED; - - return *this; - } - - wxSizerFlags& FixedMinSize() - { - m_flags |= wxFIXED_MINSIZE; - - return *this; - } -#endif // wx 2.8.2+ - -#if wxABI_VERSION >= 20808 - // makes the item ignore window's visibility status - wxSizerFlags& ReserveSpaceEvenIfHidden(); -#endif - - // accessors for wxSizer only - int GetProportion() const { return m_proportion; } - int GetFlags() const { return m_flags; } - int GetBorderInPixels() const { return m_borderInPixels; } - -private: - int m_proportion; - int m_flags; - int m_borderInPixels; -}; - - -// ---------------------------------------------------------------------------- -// wxSizerSpacer: used by wxSizerItem to represent a spacer -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxSizerSpacer -{ -public: - wxSizerSpacer(const wxSize& size) : m_size(size), m_isShown(true) { } - - void SetSize(const wxSize& size) { m_size = size; } - const wxSize& GetSize() const { return m_size; } - - void Show(bool show) { m_isShown = show; } - bool IsShown() const { return m_isShown; } - -private: - // the size, in pixel - wxSize m_size; - - // is the spacer currently shown? - bool m_isShown; -}; - -// ---------------------------------------------------------------------------- -// wxSizerItem -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxSizerItem : public wxObject -{ -public: - // window - wxSizerItem( wxWindow *window, - int proportion, - int flag, - int border, - wxObject* userData ); - - // window with flags - wxSizerItem(wxWindow *window, const wxSizerFlags& flags) - { - Init(flags); - - SetWindow(window); - } - - // subsizer - wxSizerItem( wxSizer *sizer, - int proportion, - int flag, - int border, - wxObject* userData ); - - // sizer with flags - wxSizerItem(wxSizer *sizer, const wxSizerFlags& flags) - { - Init(flags); - - SetSizer(sizer); - } - - // spacer - wxSizerItem( int width, - int height, - int proportion, - int flag, - int border, - wxObject* userData); - - // spacer with flags - wxSizerItem(int width, int height, const wxSizerFlags& flags) - { - Init(flags); - - SetSpacer(width, height); - } - - wxSizerItem(); - virtual ~wxSizerItem(); - - virtual void DeleteWindows(); - - // Enable deleting the SizerItem without destroying the contained sizer. - void DetachSizer() { m_sizer = NULL; } - - virtual wxSize GetSize() const; - virtual wxSize CalcMin(); - virtual void SetDimension( const wxPoint& pos, const wxSize& size ); - - wxSize GetMinSize() const - { return m_minSize; } - wxSize GetMinSizeWithBorder() const; - - void SetMinSize(const wxSize& size) - { - if ( IsWindow() ) - m_window->SetMinSize(size); - m_minSize = size; - } - void SetMinSize( int x, int y ) - { SetMinSize(wxSize(x, y)); } - void SetInitSize( int x, int y ) - { SetMinSize(wxSize(x, y)); } - - // if either of dimensions is zero, ratio is assumed to be 1 - // to avoid "divide by zero" errors - void SetRatio(int width, int height) - { m_ratio = (width && height) ? ((float) width / (float) height) : 1; } - void SetRatio(const wxSize& size) - { SetRatio(size.x, size.y); } - void SetRatio(float ratio) - { m_ratio = ratio; } - float GetRatio() const - { return m_ratio; } - - virtual wxRect GetRect() { return m_rect; } - - bool IsWindow() const { return m_kind == Item_Window; } - bool IsSizer() const { return m_kind == Item_Sizer; } - bool IsSpacer() const { return m_kind == Item_Spacer; } - -#if WXWIN_COMPATIBILITY_2_6 - // Deprecated in 2.6, use {G,S}etProportion instead. - wxDEPRECATED( void SetOption( int option ) ); - wxDEPRECATED( int GetOption() const ); -#endif // WXWIN_COMPATIBILITY_2_6 - - void SetProportion( int proportion ) - { m_proportion = proportion; } - int GetProportion() const - { return m_proportion; } - void SetFlag( int flag ) - { m_flag = flag; } - int GetFlag() const - { return m_flag; } - void SetBorder( int border ) - { m_border = border; } - int GetBorder() const - { return m_border; } - - wxWindow *GetWindow() const - { return m_kind == Item_Window ? m_window : NULL; } - wxSizer *GetSizer() const - { return m_kind == Item_Sizer ? m_sizer : NULL; } - wxSize GetSpacer() const; - - // this function behaves obviously for the windows and spacers but for the - // sizers it returns true if any sizer element is shown and only returns - // false if all of them are hidden - bool IsShown() const; - void Show(bool show); - - void SetUserData(wxObject* userData) - { delete m_userData; m_userData = userData; } - wxObject* GetUserData() const - { return m_userData; } - wxPoint GetPosition() const - { return m_pos; } - - - // these functions do not free old sizer/spacer - void SetWindow(wxWindow *window); - void SetSizer(wxSizer *sizer); - void SetSpacer(const wxSize& size); - void SetSpacer(int width, int height) { SetSpacer(wxSize(width, height)); } - -protected: - // common part of several ctors - void Init() { m_userData = NULL; } - - // common part of ctors taking wxSizerFlags - void Init(const wxSizerFlags& flags); - - - // discriminated union: depending on m_kind one of the fields is valid - enum - { - Item_None, - Item_Window, - Item_Sizer, - Item_Spacer, - Item_Max - } m_kind; - union - { - wxWindow *m_window; - wxSizer *m_sizer; - wxSizerSpacer *m_spacer; - }; - - wxPoint m_pos; - wxSize m_minSize; - int m_proportion; - int m_border; - int m_flag; - - // on screen rectangle of this item (not including borders) - wxRect m_rect; - - // Aspect ratio can always be calculated from m_size, - // but this would cause precision loss when the window - // is shrunk. It is safer to preserve the initial value. - float m_ratio; - - wxObject *m_userData; - -private: - // 2.8-only implementation detail for wxRESERVE_SPACE_EVEN_IF_HIDDEN - bool ShouldAccountFor() const; - - DECLARE_CLASS(wxSizerItem) - DECLARE_NO_COPY_CLASS(wxSizerItem) - - friend class wxBoxSizer; - friend class wxFlexGridSizer; - friend class wxGridBagSizer; -}; - -WX_DECLARE_EXPORTED_LIST( wxSizerItem, wxSizerItemList ); - - -//--------------------------------------------------------------------------- -// wxSizer -//--------------------------------------------------------------------------- - -class WXDLLEXPORT wxSizer: public wxObject, public wxClientDataContainer -{ -public: - wxSizer() { m_containingWindow = NULL; } - virtual ~wxSizer(); - - // methods for adding elements to the sizer: there are Add/Insert/Prepend - // overloads for each of window/sizer/spacer/wxSizerItem - wxSizerItem* Add(wxWindow *window, - int proportion = 0, - int flag = 0, - int border = 0, - wxObject* userData = NULL); - wxSizerItem* Add(wxSizer *sizer, - int proportion = 0, - int flag = 0, - int border = 0, - wxObject* userData = NULL); - wxSizerItem* Add(int width, - int height, - int proportion = 0, - int flag = 0, - int border = 0, - wxObject* userData = NULL); - wxSizerItem* Add( wxWindow *window, const wxSizerFlags& flags); - wxSizerItem* Add( wxSizer *sizer, const wxSizerFlags& flags); - wxSizerItem* Add( wxSizerItem *item); - - wxSizerItem* AddSpacer(int size); - wxSizerItem* AddStretchSpacer(int prop = 1); - - wxSizerItem* Insert(size_t index, - wxWindow *window, - int proportion = 0, - int flag = 0, - int border = 0, - wxObject* userData = NULL); - wxSizerItem* Insert(size_t index, - wxSizer *sizer, - int proportion = 0, - int flag = 0, - int border = 0, - wxObject* userData = NULL); - wxSizerItem* Insert(size_t index, - int width, - int height, - int proportion = 0, - int flag = 0, - int border = 0, - wxObject* userData = NULL); - wxSizerItem* Insert(size_t index, - wxWindow *window, - const wxSizerFlags& flags); - wxSizerItem* Insert(size_t index, - wxSizer *sizer, - const wxSizerFlags& flags); - virtual wxSizerItem* Insert( size_t index, wxSizerItem *item); - - wxSizerItem* InsertSpacer(size_t index, int size); - wxSizerItem* InsertStretchSpacer(size_t index, int prop = 1); - - wxSizerItem* Prepend(wxWindow *window, - int proportion = 0, - int flag = 0, - int border = 0, - wxObject* userData = NULL); - wxSizerItem* Prepend(wxSizer *sizer, - int proportion = 0, - int flag = 0, - int border = 0, - wxObject* userData = NULL); - wxSizerItem* Prepend(int width, - int height, - int proportion = 0, - int flag = 0, - int border = 0, - wxObject* userData = NULL); - wxSizerItem* Prepend(wxWindow *window, const wxSizerFlags& flags); - wxSizerItem* Prepend(wxSizer *sizer, const wxSizerFlags& flags); - wxSizerItem* Prepend(wxSizerItem *item); - - wxSizerItem* PrependSpacer(int size); - wxSizerItem* PrependStretchSpacer(int prop = 1); - - // set (or possibly unset if window is NULL) or get the window this sizer - // is used in - void SetContainingWindow(wxWindow *window); - wxWindow *GetContainingWindow() const { return m_containingWindow; } - -#if WXWIN_COMPATIBILITY_2_6 - // Deprecated in 2.6 since historically it does not delete the window, - // use Detach instead. - wxDEPRECATED( virtual bool Remove( wxWindow *window ) ); -#endif // WXWIN_COMPATIBILITY_2_6 - - virtual bool Remove( wxSizer *sizer ); - virtual bool Remove( int index ); - - virtual bool Detach( wxWindow *window ); - virtual bool Detach( wxSizer *sizer ); - virtual bool Detach( int index ); - - virtual bool Replace( wxWindow *oldwin, wxWindow *newwin, bool recursive = false ); - virtual bool Replace( wxSizer *oldsz, wxSizer *newsz, bool recursive = false ); - virtual bool Replace( size_t index, wxSizerItem *newitem ); - - virtual void Clear( bool delete_windows = false ); - virtual void DeleteWindows(); - - void SetMinSize( int width, int height ) - { DoSetMinSize( width, height ); } - void SetMinSize( const wxSize& size ) - { DoSetMinSize( size.x, size.y ); } - - // Searches recursively - bool SetItemMinSize( wxWindow *window, int width, int height ) - { return DoSetItemMinSize( window, width, height ); } - bool SetItemMinSize( wxWindow *window, const wxSize& size ) - { return DoSetItemMinSize( window, size.x, size.y ); } - - // Searches recursively - bool SetItemMinSize( wxSizer *sizer, int width, int height ) - { return DoSetItemMinSize( sizer, width, height ); } - bool SetItemMinSize( wxSizer *sizer, const wxSize& size ) - { return DoSetItemMinSize( sizer, size.x, size.y ); } - - bool SetItemMinSize( size_t index, int width, int height ) - { return DoSetItemMinSize( index, width, height ); } - bool SetItemMinSize( size_t index, const wxSize& size ) - { return DoSetItemMinSize( index, size.x, size.y ); } - - wxSize GetSize() const - { return m_size; } - wxPoint GetPosition() const - { return m_position; } - - // Calculate the minimal size or return m_minSize if bigger. - wxSize GetMinSize(); - - virtual void RecalcSizes() = 0; - virtual wxSize CalcMin() = 0; - - virtual void Layout(); - -#if wxABI_VERSION >= 20808 - wxSize ComputeFittingClientSize(wxWindow *window); - wxSize ComputeFittingWindowSize(wxWindow *window); -#endif - - wxSize Fit( wxWindow *window ); - void FitInside( wxWindow *window ); - void SetSizeHints( wxWindow *window ); - void SetVirtualSizeHints( wxWindow *window ); - - wxSizerItemList& GetChildren() - { return m_children; } - - void SetDimension( int x, int y, int width, int height ); - - wxSizerItem* GetItem( wxWindow *window, bool recursive = false ); - wxSizerItem* GetItem( wxSizer *sizer, bool recursive = false ); - wxSizerItem* GetItem( size_t index ); - - // Manage whether individual scene items are considered - // in the layout calculations or not. - bool Show( wxWindow *window, bool show = true, bool recursive = false ); - bool Show( wxSizer *sizer, bool show = true, bool recursive = false ); - bool Show( size_t index, bool show = true ); - - bool Hide( wxSizer *sizer, bool recursive = false ) - { return Show( sizer, false, recursive ); } - bool Hide( wxWindow *window, bool recursive = false ) - { return Show( window, false, recursive ); } - bool Hide( size_t index ) - { return Show( index, false ); } - - bool IsShown( wxWindow *window ) const; - bool IsShown( wxSizer *sizer ) const; - bool IsShown( size_t index ) const; - - // Recursively call wxWindow::Show () on all sizer items. - virtual void ShowItems (bool show); - - void Show(bool show) { ShowItems(show); } - -protected: - wxSize m_size; - wxSize m_minSize; - wxPoint m_position; - wxSizerItemList m_children; - - // the window this sizer is used in, can be NULL - wxWindow *m_containingWindow; - - wxSize GetMaxWindowSize( wxWindow *window ) const; - wxSize GetMinWindowSize( wxWindow *window ); - wxSize GetMaxClientSize( wxWindow *window ) const; - wxSize GetMinClientSize( wxWindow *window ); - wxSize VirtualFitSize( wxWindow *window ); - - virtual void DoSetMinSize( int width, int height ); - virtual bool DoSetItemMinSize( wxWindow *window, int width, int height ); - virtual bool DoSetItemMinSize( wxSizer *sizer, int width, int height ); - virtual bool DoSetItemMinSize( size_t index, int width, int height ); - -private: - DECLARE_CLASS(wxSizer) -}; - -//--------------------------------------------------------------------------- -// wxGridSizer -//--------------------------------------------------------------------------- - -class WXDLLEXPORT wxGridSizer: public wxSizer -{ -public: - wxGridSizer( int rows, int cols, int vgap, int hgap ); - wxGridSizer( int cols, int vgap = 0, int hgap = 0 ); - - virtual void RecalcSizes(); - virtual wxSize CalcMin(); - - void SetCols( int cols ) { m_cols = cols; } - void SetRows( int rows ) { m_rows = rows; } - void SetVGap( int gap ) { m_vgap = gap; } - void SetHGap( int gap ) { m_hgap = gap; } - int GetCols() const { return m_cols; } - int GetRows() const { return m_rows; } - int GetVGap() const { return m_vgap; } - int GetHGap() const { return m_hgap; } - -protected: - int m_rows; - int m_cols; - int m_vgap; - int m_hgap; - - // return the number of total items and the number of columns and rows - int CalcRowsCols(int& rows, int& cols) const; - - void SetItemBounds( wxSizerItem *item, int x, int y, int w, int h ); - -private: - DECLARE_CLASS(wxGridSizer) -}; - -//--------------------------------------------------------------------------- -// wxFlexGridSizer -//--------------------------------------------------------------------------- - -// the bevaiour for resizing wxFlexGridSizer cells in the "non-flexible" -// direction -enum wxFlexSizerGrowMode -{ - // don't resize the cells in non-flexible direction at all - wxFLEX_GROWMODE_NONE, - - // uniformly resize only the specified ones (default) - wxFLEX_GROWMODE_SPECIFIED, - - // uniformly resize all cells - wxFLEX_GROWMODE_ALL -}; - -class WXDLLEXPORT wxFlexGridSizer: public wxGridSizer -{ -public: - // ctors/dtor - wxFlexGridSizer( int rows, int cols, int vgap, int hgap ); - wxFlexGridSizer( int cols, int vgap = 0, int hgap = 0 ); - virtual ~wxFlexGridSizer(); - - - // set the rows/columns which will grow (the others will remain of the - // constant initial size) - void AddGrowableRow( size_t idx, int proportion = 0 ); - void RemoveGrowableRow( size_t idx ); - void AddGrowableCol( size_t idx, int proportion = 0 ); - void RemoveGrowableCol( size_t idx ); - - - // the sizer cells may grow in both directions, not grow at all or only - // grow in one direction but not the other - - // the direction may be wxVERTICAL, wxHORIZONTAL or wxBOTH (default) - void SetFlexibleDirection(int direction) { m_flexDirection = direction; } - int GetFlexibleDirection() const { return m_flexDirection; } - - // note that the grow mode only applies to the direction which is not - // flexible - void SetNonFlexibleGrowMode(wxFlexSizerGrowMode mode) { m_growMode = mode; } - wxFlexSizerGrowMode GetNonFlexibleGrowMode() const { return m_growMode; } - - // Read-only access to the row heights and col widths arrays - const wxArrayInt& GetRowHeights() const { return m_rowHeights; } - const wxArrayInt& GetColWidths() const { return m_colWidths; } - - // implementation - virtual void RecalcSizes(); - virtual wxSize CalcMin(); - -protected: - void AdjustForFlexDirection(); - void AdjustForGrowables(const wxSize& sz, const wxSize& minsz, - int nrows, int ncols); - - // the heights/widths of all rows/columns - wxArrayInt m_rowHeights, - m_colWidths; - - // indices of the growable columns and rows - wxArrayInt m_growableRows, - m_growableCols; - - // proportion values of the corresponding growable rows and columns - wxArrayInt m_growableRowsProportions, - m_growableColsProportions; - - // parameters describing whether the growable cells should be resized in - // both directions or only one - int m_flexDirection; - wxFlexSizerGrowMode m_growMode; - - // saves CalcMin result to optimize RecalcSizes - wxSize m_calculatedMinSize; - -private: - DECLARE_CLASS(wxFlexGridSizer) - DECLARE_NO_COPY_CLASS(wxFlexGridSizer) -}; - -//--------------------------------------------------------------------------- -// wxBoxSizer -//--------------------------------------------------------------------------- - -class WXDLLEXPORT wxBoxSizer: public wxSizer -{ -public: - wxBoxSizer( int orient ); - - void RecalcSizes(); - wxSize CalcMin(); - - int GetOrientation() const - { return m_orient; } - - void SetOrientation(int orient) - { m_orient = orient; } - -protected: - int m_orient; - int m_stretchable; - int m_minWidth; - int m_minHeight; - int m_fixedWidth; - int m_fixedHeight; - -private: - DECLARE_CLASS(wxBoxSizer) -}; - -//--------------------------------------------------------------------------- -// wxStaticBoxSizer -//--------------------------------------------------------------------------- - -#if wxUSE_STATBOX - -class WXDLLIMPEXP_FWD_CORE wxStaticBox; - -class WXDLLEXPORT wxStaticBoxSizer: public wxBoxSizer -{ -public: - wxStaticBoxSizer(wxStaticBox *box, int orient); - wxStaticBoxSizer(int orient, wxWindow *win, const wxString& label = wxEmptyString); - virtual ~wxStaticBoxSizer(); - - void RecalcSizes(); - wxSize CalcMin(); - - wxStaticBox *GetStaticBox() const - { return m_staticBox; } - - // override to hide/show the static box as well - virtual void ShowItems (bool show); - - virtual bool Detach( wxWindow *window ); - virtual bool Detach( wxSizer *sizer ) { return wxBoxSizer::Detach(sizer); } - virtual bool Detach( int index ) { return wxBoxSizer::Detach(index); } - -protected: - wxStaticBox *m_staticBox; - -private: - DECLARE_CLASS(wxStaticBoxSizer) - DECLARE_NO_COPY_CLASS(wxStaticBoxSizer) -}; - -#endif // wxUSE_STATBOX - -#if wxUSE_BUTTON - -class WXDLLEXPORT wxStdDialogButtonSizer: public wxBoxSizer -{ -public: - // Constructor just creates a new wxBoxSizer, not much else. - // Box sizer orientation is automatically determined here: - // vertical for PDAs, horizontal for everything else? - wxStdDialogButtonSizer(); - - // Checks button ID against system IDs and sets one of the pointers below - // to this button. Does not do any sizer-related things here. - void AddButton(wxButton *button); - - // Use these if no standard ID can/should be used - void SetAffirmativeButton( wxButton *button ); - void SetNegativeButton( wxButton *button ); - void SetCancelButton( wxButton *button ); - - // All platform-specific code here, checks which buttons exist and add - // them to the sizer accordingly. - // Note - one potential hack on Mac we could use here, - // if m_buttonAffirmative is wxID_SAVE then ensure wxID_SAVE - // is set to _("Save") and m_buttonNegative is set to _("Don't Save") - // I wouldn't add any other hacks like that into here, - // but this one I can see being useful. - void Realize(); - - wxButton *GetAffirmativeButton() const { return m_buttonAffirmative; } - wxButton *GetApplyButton() const { return m_buttonApply; } - wxButton *GetNegativeButton() const { return m_buttonNegative; } - wxButton *GetCancelButton() const { return m_buttonCancel; } - wxButton *GetHelpButton() const { return m_buttonHelp; } - -protected: - wxButton *m_buttonAffirmative; // wxID_OK, wxID_YES, wxID_SAVE go here - wxButton *m_buttonApply; - wxButton *m_buttonNegative; // wxID_NO - wxButton *m_buttonCancel; - wxButton *m_buttonHelp; - -private: - DECLARE_CLASS(wxStdDialogButtonSizer) - DECLARE_NO_COPY_CLASS(wxStdDialogButtonSizer) -}; - -#endif // wxUSE_BUTTON - -#if WXWIN_COMPATIBILITY_2_4 -// NB: wxBookCtrlSizer and wxNotebookSizer are deprecated, they -// don't do anything. wxBookCtrlBase::DoGetBestSize does the job now. - -// ---------------------------------------------------------------------------- -// wxBookCtrlSizer -// ---------------------------------------------------------------------------- - -#if wxUSE_BOOKCTRL - -// this sizer works with wxNotebook/wxListbook/... and sizes the control to -// fit its pages -class WXDLLIMPEXP_FWD_CORE wxBookCtrlBase; - -class WXDLLEXPORT wxBookCtrlSizer : public wxSizer -{ -public: -#if WXWIN_COMPATIBILITY_2_6 - wxDEPRECATED( wxBookCtrlSizer(wxBookCtrlBase *bookctrl) ); -#endif // WXWIN_COMPATIBILITY_2_6 - - wxBookCtrlBase *GetControl() const { return m_bookctrl; } - - virtual void RecalcSizes(); - virtual wxSize CalcMin(); - -protected: - // this protected ctor lets us mark the real one above as deprecated - // and still have warning-free build of the library itself: - wxBookCtrlSizer() {} - - wxBookCtrlBase *m_bookctrl; - -private: - DECLARE_CLASS(wxBookCtrlSizer) - DECLARE_NO_COPY_CLASS(wxBookCtrlSizer) -}; - - -#if wxUSE_NOTEBOOK - -// before wxBookCtrlBase we only had wxNotebookSizer, keep it for backwards -// compatibility -class WXDLLIMPEXP_FWD_CORE wxNotebook; - -class WXDLLEXPORT wxNotebookSizer : public wxBookCtrlSizer -{ -public: -#if WXWIN_COMPATIBILITY_2_6 - wxDEPRECATED( wxNotebookSizer(wxNotebook *nb) ); -#endif // WXWIN_COMPATIBILITY_2_6 - - wxNotebook *GetNotebook() const { return (wxNotebook *)m_bookctrl; } - -private: - DECLARE_CLASS(wxNotebookSizer) - DECLARE_NO_COPY_CLASS(wxNotebookSizer) -}; - -#endif // wxUSE_NOTEBOOK - -#endif // wxUSE_BOOKCTRL - -#endif // WXWIN_COMPATIBILITY_2_4 - -// ---------------------------------------------------------------------------- -// inline functions implementation -// ---------------------------------------------------------------------------- - -inline wxSizerItem* -wxSizer::Add( wxSizerItem *item ) -{ - return Insert( m_children.GetCount(), item ); -} - -inline wxSizerItem* -wxSizer::Add( wxWindow *window, int proportion, int flag, int border, wxObject* userData ) -{ - return Add( new wxSizerItem( window, proportion, flag, border, userData ) ); -} - -inline wxSizerItem* -wxSizer::Add( wxSizer *sizer, int proportion, int flag, int border, wxObject* userData ) -{ - return Add( new wxSizerItem( sizer, proportion, flag, border, userData ) ); -} - -inline wxSizerItem* -wxSizer::Add( int width, int height, int proportion, int flag, int border, wxObject* userData ) -{ - return Add( new wxSizerItem( width, height, proportion, flag, border, userData ) ); -} - -inline wxSizerItem* -wxSizer::Add( wxWindow *window, const wxSizerFlags& flags ) -{ - return Add( new wxSizerItem(window, flags) ); -} - -inline wxSizerItem* -wxSizer::Add( wxSizer *sizer, const wxSizerFlags& flags ) -{ - return Add( new wxSizerItem(sizer, flags) ); -} - -inline wxSizerItem* -wxSizer::AddSpacer(int size) -{ - return Add(size, size); -} - -inline wxSizerItem* -wxSizer::AddStretchSpacer(int prop) -{ - return Add(0, 0, prop); -} - -inline wxSizerItem* -wxSizer::Prepend( wxSizerItem *item ) -{ - return Insert( 0, item ); -} - -inline wxSizerItem* -wxSizer::Prepend( wxWindow *window, int proportion, int flag, int border, wxObject* userData ) -{ - return Prepend( new wxSizerItem( window, proportion, flag, border, userData ) ); -} - -inline wxSizerItem* -wxSizer::Prepend( wxSizer *sizer, int proportion, int flag, int border, wxObject* userData ) -{ - return Prepend( new wxSizerItem( sizer, proportion, flag, border, userData ) ); -} - -inline wxSizerItem* -wxSizer::Prepend( int width, int height, int proportion, int flag, int border, wxObject* userData ) -{ - return Prepend( new wxSizerItem( width, height, proportion, flag, border, userData ) ); -} - -inline wxSizerItem* -wxSizer::PrependSpacer(int size) -{ - return Prepend(size, size); -} - -inline wxSizerItem* -wxSizer::PrependStretchSpacer(int prop) -{ - return Prepend(0, 0, prop); -} - -inline wxSizerItem* -wxSizer::Prepend( wxWindow *window, const wxSizerFlags& flags ) -{ - return Prepend( new wxSizerItem(window, flags) ); -} - -inline wxSizerItem* -wxSizer::Prepend( wxSizer *sizer, const wxSizerFlags& flags ) -{ - return Prepend( new wxSizerItem(sizer, flags) ); -} - -inline wxSizerItem* -wxSizer::Insert( size_t index, - wxWindow *window, - int proportion, - int flag, - int border, - wxObject* userData ) -{ - return Insert( index, new wxSizerItem( window, proportion, flag, border, userData ) ); -} - -inline wxSizerItem* -wxSizer::Insert( size_t index, - wxSizer *sizer, - int proportion, - int flag, - int border, - wxObject* userData ) -{ - return Insert( index, new wxSizerItem( sizer, proportion, flag, border, userData ) ); -} - -inline wxSizerItem* -wxSizer::Insert( size_t index, - int width, - int height, - int proportion, - int flag, - int border, - wxObject* userData ) -{ - return Insert( index, new wxSizerItem( width, height, proportion, flag, border, userData ) ); -} - -inline wxSizerItem* -wxSizer::Insert( size_t index, wxWindow *window, const wxSizerFlags& flags ) -{ - return Insert( index, new wxSizerItem(window, flags) ); -} - -inline wxSizerItem* -wxSizer::Insert( size_t index, wxSizer *sizer, const wxSizerFlags& flags ) -{ - return Insert( index, new wxSizerItem(sizer, flags) ); -} - -inline wxSizerItem* -wxSizer::InsertSpacer(size_t index, int size) -{ - return Insert(index, size, size); -} - -inline wxSizerItem* -wxSizer::InsertStretchSpacer(size_t index, int prop) -{ - return Insert(index, 0, 0, prop); -} - - -#endif // __WXSIZER_H__ diff --git a/wxWidgets/include/wx/slider.h b/wxWidgets/include/wx/slider.h deleted file mode 100644 index 195b9f8a3a..0000000000 --- a/wxWidgets/include/wx/slider.h +++ /dev/null @@ -1,151 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: wx/slider.h -// Purpose: wxSlider interface -// Author: Vadim Zeitlin -// Modified by: -// Created: 09.02.01 -// RCS-ID: $Id: slider.h 38717 2006-04-14 17:01:16Z ABX $ -// Copyright: (c) 1996-2001 Vadim Zeitlin -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_SLIDER_H_BASE_ -#define _WX_SLIDER_H_BASE_ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -#include "wx/defs.h" - -#if wxUSE_SLIDER - -#include "wx/control.h" - -// ---------------------------------------------------------------------------- -// wxSlider flags -// ---------------------------------------------------------------------------- - -#define wxSL_HORIZONTAL wxHORIZONTAL /* 0x0004 */ -#define wxSL_VERTICAL wxVERTICAL /* 0x0008 */ - -#define wxSL_TICKS 0x0010 -#define wxSL_AUTOTICKS wxSL_TICKS // we don't support manual ticks -#define wxSL_LABELS 0x0020 -#define wxSL_LEFT 0x0040 -#define wxSL_TOP 0x0080 -#define wxSL_RIGHT 0x0100 -#define wxSL_BOTTOM 0x0200 -#define wxSL_BOTH 0x0400 -#define wxSL_SELRANGE 0x0800 -#define wxSL_INVERSE 0x1000 - -#if WXWIN_COMPATIBILITY_2_6 - // obsolete - #define wxSL_NOTIFY_DRAG 0x0000 -#endif // WXWIN_COMPATIBILITY_2_6 - -extern WXDLLEXPORT_DATA(const wxChar) wxSliderNameStr[]; - -// ---------------------------------------------------------------------------- -// wxSliderBase: define wxSlider interface -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxSliderBase : public wxControl -{ -public: - /* the ctor of the derived class should have the following form: - - 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); - */ - wxSliderBase() { } - - // get/set the current slider value (should be in range) - virtual int GetValue() const = 0; - virtual void SetValue(int value) = 0; - - // retrieve/change the range - virtual void SetRange(int minValue, int maxValue) = 0; - virtual int GetMin() const = 0; - virtual int GetMax() const = 0; - void SetMin( int minValue ) { SetRange( minValue , GetMax() ) ; } - void SetMax( int maxValue ) { SetRange( GetMin() , maxValue ) ; } - - // the line/page size is the increment by which the slider moves when - // cursor arrow key/page up or down are pressed (clicking the mouse is like - // pressing PageUp/Down) and are by default set to 1 and 1/10 of the range - virtual void SetLineSize(int lineSize) = 0; - virtual void SetPageSize(int pageSize) = 0; - virtual int GetLineSize() const = 0; - virtual int GetPageSize() const = 0; - - // these methods get/set the length of the slider pointer in pixels - virtual void SetThumbLength(int lenPixels) = 0; - virtual int GetThumbLength() const = 0; - - // warning: most of subsequent methods are currently only implemented in - // wxMSW under Win95 and are silently ignored on other platforms - - virtual void SetTickFreq(int WXUNUSED(n), int WXUNUSED(pos)) { } - virtual int GetTickFreq() const { return 0; } - virtual void ClearTicks() { } - virtual void SetTick(int WXUNUSED(tickPos)) { } - - virtual void ClearSel() { } - virtual int GetSelEnd() const { return GetMin(); } - virtual int GetSelStart() const { return GetMax(); } - virtual void SetSelection(int WXUNUSED(min), int WXUNUSED(max)) { } - -protected: - - // adjust value according to wxSL_INVERSE style - virtual int ValueInvertOrNot(int value) const - { - if (HasFlag(wxSL_INVERSE)) - return (GetMax() + GetMin()) - value; - else - return value; - } - -private: - DECLARE_NO_COPY_CLASS(wxSliderBase) -}; - -// ---------------------------------------------------------------------------- -// include the real class declaration -// ---------------------------------------------------------------------------- - -#if defined(__WXUNIVERSAL__) - #include "wx/univ/slider.h" -#elif defined(__WXMSW__) - #include "wx/msw/slider95.h" - #if WXWIN_COMPATIBILITY_2_4 - #define wxSlider95 wxSlider - #endif -#elif defined(__WXMOTIF__) - #include "wx/motif/slider.h" -#elif defined(__WXGTK20__) - #include "wx/gtk/slider.h" -#elif defined(__WXGTK__) - #include "wx/gtk1/slider.h" -#elif defined(__WXMAC__) - #include "wx/mac/slider.h" -#elif defined(__WXCOCOA__) - #include "wx/cocoa/slider.h" -#elif defined(__WXPM__) - #include "wx/os2/slider.h" -#elif defined(__WXPALMOS__) - #include "wx/palmos/slider.h" -#endif - -#endif // wxUSE_SLIDER - -#endif - // _WX_SLIDER_H_BASE_ diff --git a/wxWidgets/include/wx/snglinst.h b/wxWidgets/include/wx/snglinst.h deleted file mode 100644 index 1755f8969a..0000000000 --- a/wxWidgets/include/wx/snglinst.h +++ /dev/null @@ -1,65 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: wx/snglinst.h -// Purpose: wxSingleInstanceChecker can be used to restrict the number of -// simultaneously running copies of a program to one -// Author: Vadim Zeitlin -// Modified by: -// Created: 08.06.01 -// RCS-ID: $Id: snglinst.h 49563 2007-10-31 20:46:21Z VZ $ -// Copyright: (c) 2001 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr> -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_SNGLINST_H_ -#define _WX_SNGLINST_H_ - -#if wxUSE_SNGLINST_CHECKER - -// ---------------------------------------------------------------------------- -// wxSingleInstanceChecker -// ---------------------------------------------------------------------------- - -class WXDLLIMPEXP_BASE wxSingleInstanceChecker -{ -public: - // default ctor, use Create() after it - wxSingleInstanceChecker() { Init(); } - - // like Create() but no error checking (dangerous!) - wxSingleInstanceChecker(const wxString& name, - const wxString& path = wxEmptyString) - { - Init(); - Create(name, path); - } - - // name must be given and be as unique as possible, it is used as the mutex - // name under Win32 and the lock file name under Unix - - // wxTheApp->GetAppName() may be a good value for this parameter - // - // path is optional and is ignored under Win32 and used as the directory to - // create the lock file in under Unix (default is wxGetHomeDir()) - // - // returns false if initialization failed, it doesn't mean that another - // instance is running - use IsAnotherRunning() to check it - bool Create(const wxString& name, const wxString& path = wxEmptyString); - - // is another copy of this program already running? - bool IsAnotherRunning() const; - - // dtor is not virtual, this class is not meant to be used polymorphically - ~wxSingleInstanceChecker(); - -private: - // common part of all ctors - void Init() { m_impl = NULL; } - - // the implementation details (platform specific) - class WXDLLIMPEXP_FWD_BASE wxSingleInstanceCheckerImpl *m_impl; - - DECLARE_NO_COPY_CLASS(wxSingleInstanceChecker) -}; - -#endif // wxUSE_SNGLINST_CHECKER - -#endif // _WX_SNGLINST_H_ diff --git a/wxWidgets/include/wx/socket.h b/wxWidgets/include/wx/socket.h deleted file mode 100644 index 07cd4cbaf0..0000000000 --- a/wxWidgets/include/wx/socket.h +++ /dev/null @@ -1,335 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: socket.h -// Purpose: Socket handling classes -// Authors: Guilhem Lavaux, Guillermo Rodriguez Garcia -// Modified by: -// Created: April 1997 -// RCS-ID: $Id: socket.h 45498 2007-04-16 13:03:05Z VZ $ -// Copyright: (c) Guilhem Lavaux -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_SOCKET_H_ -#define _WX_SOCKET_H_ - -#include "wx/defs.h" - -#if wxUSE_SOCKETS - -// --------------------------------------------------------------------------- -// wxSocket headers -// --------------------------------------------------------------------------- - -#include "wx/event.h" -#include "wx/sckaddr.h" -#include "wx/gsocket.h" -#include "wx/list.h" - -// ------------------------------------------------------------------------ -// Types and constants -// ------------------------------------------------------------------------ - -enum wxSocketNotify -{ - wxSOCKET_INPUT = GSOCK_INPUT, - wxSOCKET_OUTPUT = GSOCK_OUTPUT, - wxSOCKET_CONNECTION = GSOCK_CONNECTION, - wxSOCKET_LOST = GSOCK_LOST -}; - -enum -{ - wxSOCKET_INPUT_FLAG = GSOCK_INPUT_FLAG, - wxSOCKET_OUTPUT_FLAG = GSOCK_OUTPUT_FLAG, - wxSOCKET_CONNECTION_FLAG = GSOCK_CONNECTION_FLAG, - wxSOCKET_LOST_FLAG = GSOCK_LOST_FLAG -}; - -typedef GSocketEventFlags wxSocketEventFlags; - -enum wxSocketError -{ - // from GSocket - wxSOCKET_NOERROR = GSOCK_NOERROR, - wxSOCKET_INVOP = GSOCK_INVOP, - wxSOCKET_IOERR = GSOCK_IOERR, - wxSOCKET_INVADDR = GSOCK_INVADDR, - wxSOCKET_INVSOCK = GSOCK_INVSOCK, - wxSOCKET_NOHOST = GSOCK_NOHOST, - wxSOCKET_INVPORT = GSOCK_INVPORT, - wxSOCKET_WOULDBLOCK = GSOCK_WOULDBLOCK, - wxSOCKET_TIMEDOUT = GSOCK_TIMEDOUT, - wxSOCKET_MEMERR = GSOCK_MEMERR, - - // wxSocket-specific (not yet implemented) - wxSOCKET_DUMMY -}; - -enum -{ - wxSOCKET_NONE = 0, - wxSOCKET_NOWAIT = 1, - wxSOCKET_WAITALL = 2, - wxSOCKET_BLOCK = 4, - wxSOCKET_REUSEADDR = 8 -}; - -enum wxSocketType -{ - wxSOCKET_UNINIT, - wxSOCKET_CLIENT, - wxSOCKET_SERVER, - wxSOCKET_BASE, - wxSOCKET_DATAGRAM -}; - -typedef int wxSocketFlags; - - - -// -------------------------------------------------------------------------- -// wxSocketBase -// -------------------------------------------------------------------------- - -class WXDLLIMPEXP_NET wxSocketBase : public wxObject -{ - DECLARE_CLASS(wxSocketBase) - -public: - - // Public interface - // ---------------- - - // ctors and dtors - wxSocketBase(); - wxSocketBase(wxSocketFlags flags, wxSocketType type); - virtual ~wxSocketBase(); - void Init(); - bool Destroy(); - - // state - inline bool Ok() const { return IsOk(); } - inline bool IsOk() const { return (m_socket != NULL); } - inline bool Error() const { return m_error; } - inline bool IsConnected() const { return m_connected; } - inline bool IsData() { return WaitForRead(0, 0); } - inline bool IsDisconnected() const { return !IsConnected(); } - inline wxUint32 LastCount() const { return m_lcount; } - inline wxSocketError LastError() const { return (wxSocketError)m_socket->GetError(); } - void SaveState(); - void RestoreState(); - - // addresses - virtual bool GetLocal(wxSockAddress& addr_man) const; - virtual bool GetPeer(wxSockAddress& addr_man) const; - virtual bool SetLocal(wxIPV4address& local); - - // base IO - virtual bool Close(); - wxSocketBase& Discard(); - wxSocketBase& Peek(void* buffer, wxUint32 nbytes); - wxSocketBase& Read(void* buffer, wxUint32 nbytes); - wxSocketBase& ReadMsg(void *buffer, wxUint32 nbytes); - wxSocketBase& Unread(const void *buffer, wxUint32 nbytes); - wxSocketBase& Write(const void *buffer, wxUint32 nbytes); - wxSocketBase& WriteMsg(const void *buffer, wxUint32 nbytes); - - void InterruptWait() { m_interrupt = true; } - bool Wait(long seconds = -1, long milliseconds = 0); - bool WaitForRead(long seconds = -1, long milliseconds = 0); - bool WaitForWrite(long seconds = -1, long milliseconds = 0); - bool WaitForLost(long seconds = -1, long milliseconds = 0); - - inline wxSocketFlags GetFlags() const { return m_flags; } - void SetFlags(wxSocketFlags flags); - void SetTimeout(long seconds); - - bool GetOption(int level, int optname, void *optval, int *optlen); - bool SetOption(int level, int optname, const void *optval, int optlen); - inline wxUint32 GetLastIOSize() const { return m_lcount; } - - // event handling - void *GetClientData() const { return m_clientData; } - void SetClientData(void *data) { m_clientData = data; } - void SetEventHandler(wxEvtHandler& handler, int id = wxID_ANY); - void SetNotify(wxSocketEventFlags flags); - void Notify(bool notify); - - // initialize/shutdown the sockets (usually called automatically) - static bool IsInitialized(); - static bool Initialize(); - static void Shutdown(); - - - // Implementation from now on - // -------------------------- - - // do not use, should be private (called from GSocket) - void OnRequest(wxSocketNotify notify); - - // do not use, not documented nor supported - inline bool IsNoWait() const { return ((m_flags & wxSOCKET_NOWAIT) != 0); } - inline wxSocketType GetType() const { return m_type; } - -private: - friend class wxSocketClient; - friend class wxSocketServer; - friend class wxDatagramSocket; - - // low level IO - wxUint32 _Read(void* buffer, wxUint32 nbytes); - wxUint32 _Write(const void *buffer, wxUint32 nbytes); - bool _Wait(long seconds, long milliseconds, wxSocketEventFlags flags); - - // pushback buffer - void Pushback(const void *buffer, wxUint32 size); - wxUint32 GetPushback(void *buffer, wxUint32 size, bool peek); - -private: - // socket - GSocket *m_socket; // GSocket - wxSocketType m_type; // wxSocket type - - // state - wxSocketFlags m_flags; // wxSocket flags - bool m_connected; // connected? - bool m_establishing; // establishing connection? - bool m_reading; // busy reading? - bool m_writing; // busy writing? - bool m_error; // did last IO call fail? - wxSocketError m_lasterror; // last error (not cleared on success) - wxUint32 m_lcount; // last IO transaction size - unsigned long m_timeout; // IO timeout value - wxList m_states; // stack of states - bool m_interrupt; // interrupt ongoing wait operations? - bool m_beingDeleted; // marked for delayed deletion? - wxIPV4address m_localAddress; // bind to local address? - - // pushback buffer - void *m_unread; // pushback buffer - wxUint32 m_unrd_size; // pushback buffer size - wxUint32 m_unrd_cur; // pushback pointer (index into buffer) - - // events - int m_id; // socket id - wxEvtHandler *m_handler; // event handler - void *m_clientData; // client data for events - bool m_notify; // notify events to users? - wxSocketEventFlags m_eventmask; // which events to notify? - - // the initialization count, GSocket is initialized if > 0 - static size_t m_countInit; - - DECLARE_NO_COPY_CLASS(wxSocketBase) -}; - - -// -------------------------------------------------------------------------- -// wxSocketServer -// -------------------------------------------------------------------------- - -class WXDLLIMPEXP_NET wxSocketServer : public wxSocketBase -{ - DECLARE_CLASS(wxSocketServer) - -public: - wxSocketServer(const wxSockAddress& addr, wxSocketFlags flags = wxSOCKET_NONE); - - wxSocketBase* Accept(bool wait = true); - bool AcceptWith(wxSocketBase& socket, bool wait = true); - - bool WaitForAccept(long seconds = -1, long milliseconds = 0); - - DECLARE_NO_COPY_CLASS(wxSocketServer) -}; - - -// -------------------------------------------------------------------------- -// wxSocketClient -// -------------------------------------------------------------------------- - -class WXDLLIMPEXP_NET wxSocketClient : public wxSocketBase -{ - DECLARE_CLASS(wxSocketClient) - -public: - wxSocketClient(wxSocketFlags flags = wxSOCKET_NONE); - virtual ~wxSocketClient(); - - virtual bool Connect(wxSockAddress& addr, bool wait = true); - bool Connect(wxSockAddress& addr, wxSockAddress& local, bool wait = true); - - bool WaitOnConnect(long seconds = -1, long milliseconds = 0); - -private: - virtual bool DoConnect(wxSockAddress& addr, wxSockAddress* local, bool wait = true); - - DECLARE_NO_COPY_CLASS(wxSocketClient) -}; - - -// -------------------------------------------------------------------------- -// wxDatagramSocket -// -------------------------------------------------------------------------- - -// WARNING: still in alpha stage - -class WXDLLIMPEXP_NET wxDatagramSocket : public wxSocketBase -{ - DECLARE_CLASS(wxDatagramSocket) - -public: - wxDatagramSocket(const wxSockAddress& addr, wxSocketFlags flags = wxSOCKET_NONE); - - wxDatagramSocket& RecvFrom( wxSockAddress& addr, - void* buf, - wxUint32 nBytes ); - wxDatagramSocket& SendTo( const wxSockAddress& addr, - const void* buf, - wxUint32 nBytes ); - -/* TODO: - bool Connect(wxSockAddress& addr); -*/ - DECLARE_NO_COPY_CLASS(wxDatagramSocket) -}; - - -// -------------------------------------------------------------------------- -// wxSocketEvent -// -------------------------------------------------------------------------- - -class WXDLLIMPEXP_NET wxSocketEvent : public wxEvent -{ -public: - wxSocketEvent(int id = 0) - : wxEvent(id, wxEVT_SOCKET) - { - } - - wxSocketNotify GetSocketEvent() const { return m_event; } - wxSocketBase *GetSocket() const { return (wxSocketBase *) GetEventObject(); } - void *GetClientData() const { return m_clientData; } - - virtual wxEvent *Clone() const { return new wxSocketEvent(*this); } - -public: - wxSocketNotify m_event; - void *m_clientData; - - DECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxSocketEvent) -}; - - -typedef void (wxEvtHandler::*wxSocketEventFunction)(wxSocketEvent&); - -#define wxSocketEventHandler(func) \ - (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxSocketEventFunction, &func) - -#define EVT_SOCKET(id, func) \ - wx__DECLARE_EVT1(wxEVT_SOCKET, id, wxSocketEventHandler(func)) - -#endif // wxUSE_SOCKETS - -#endif // _WX_SOCKET_H_ - diff --git a/wxWidgets/include/wx/sound.h b/wxWidgets/include/wx/sound.h deleted file mode 100644 index 0328bba8c0..0000000000 --- a/wxWidgets/include/wx/sound.h +++ /dev/null @@ -1,98 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/sound.h -// Purpose: wxSoundBase class -// Author: Vaclav Slavik -// Modified by: -// Created: 2004/02/01 -// RCS-ID: $Id: sound.h 61872 2009-09-09 22:37:05Z VZ $ -// Copyright: (c) 2004, Vaclav Slavik -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_SOUND_H_BASE_ -#define _WX_SOUND_H_BASE_ - -#include "wx/defs.h" - -#if wxUSE_SOUND - -#include "wx/object.h" - -// ---------------------------------------------------------------------------- -// wxSoundBase: common wxSound code and interface -// ---------------------------------------------------------------------------- - -// Flags for wxSound::Play - -// NB: We can't use enum because there would be ambiguity between the -// two Play() prototypes when called without explicit parameters -// if WXWIN_COMPATIBILITY_2_4. -// We can't use enum with some compilers either, because they -// keep reporting nonexistent ambiguities between -// Play(unsigned) and static Play(const wxString&, unsigned). -#define wxSOUND_SYNC ((unsigned)0) -#define wxSOUND_ASYNC ((unsigned)1) -#define wxSOUND_LOOP ((unsigned)2) - -// Base class for wxSound implementations -class WXDLLIMPEXP_ADV wxSoundBase : public wxObject -{ -public: - // Play the sound: - bool Play(unsigned flags = wxSOUND_ASYNC) const - { - wxASSERT_MSG( (flags & wxSOUND_LOOP) == 0 || - (flags & wxSOUND_ASYNC) != 0, - wxT("sound can only be looped asynchronously") ); - return DoPlay(flags); - } -#if WXWIN_COMPATIBILITY_2_4 - wxDEPRECATED( bool Play(bool async, bool looped = false) const ); -#endif - - // Plays sound from filename: - static bool Play(const wxString& filename, unsigned flags = wxSOUND_ASYNC); - -protected: - virtual bool DoPlay(unsigned flags) const = 0; -}; - -// ---------------------------------------------------------------------------- -// wxSound class implementation -// ---------------------------------------------------------------------------- - -#if defined(__WXMSW__) - #include "wx/msw/sound.h" -#elif defined(__WXCOCOA__) - #include "wx/cocoa/sound.h" -#elif defined(__WXMAC__) - #include "wx/mac/sound.h" -#elif defined(__WXPM__) - #include "wx/os2/sound.h" -#elif defined(__UNIX__) - #include "wx/unix/sound.h" -#endif - -// ---------------------------------------------------------------------------- -// wxSoundBase methods -// ---------------------------------------------------------------------------- - -inline bool wxSoundBase::Play(const wxString& filename, unsigned flags) -{ - wxSound snd(filename); - return snd.IsOk() ? snd.Play(flags) : false; -} - -#if WXWIN_COMPATIBILITY_2_4 -inline bool wxSoundBase::Play(bool async, bool looped) const -{ - unsigned flags = 0; - if (async) flags |= wxSOUND_ASYNC; - if (looped) flags |= wxSOUND_LOOP | wxSOUND_ASYNC; - return DoPlay(flags); -} -#endif - -#endif // wxUSE_SOUND - -#endif // _WX_SOUND_H_BASE_ diff --git a/wxWidgets/include/wx/spinbutt.h b/wxWidgets/include/wx/spinbutt.h deleted file mode 100644 index 16df8a7452..0000000000 --- a/wxWidgets/include/wx/spinbutt.h +++ /dev/null @@ -1,129 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/spinbutt.h -// Purpose: wxSpinButtonBase class -// Author: Julian Smart, Vadim Zeitlin -// Modified by: -// Created: 23.07.99 -// RCS-ID: $Id: spinbutt.h 61872 2009-09-09 22:37:05Z VZ $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_SPINBUTT_H_BASE_ -#define _WX_SPINBUTT_H_BASE_ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -#include "wx/defs.h" - -#if wxUSE_SPINBTN - -#include "wx/control.h" -#include "wx/event.h" - -#define wxSPIN_BUTTON_NAME wxT("wxSpinButton") - -// ---------------------------------------------------------------------------- -// The wxSpinButton is like a small scrollbar than is often placed next -// to a text control. -// -// Styles: -// 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 wxSpinButtonBase : public wxControl -{ -public: - // ctor initializes the range with the default (0..100) values - wxSpinButtonBase() { m_min = 0; m_max = 100; } - - // accessors - virtual int GetValue() const = 0; - virtual int GetMin() const { return m_min; } - virtual int GetMax() const { return m_max; } - - // operations - virtual void SetValue(int val) = 0; - virtual void SetMin(int minVal) { SetRange ( minVal , m_max ) ; } - virtual void SetMax(int maxVal) { SetRange ( m_min , maxVal ) ; } - virtual void SetRange(int minVal, int maxVal) - { - m_min = minVal; - m_max = maxVal; - } - - // is this spin button vertically oriented? - bool IsVertical() const { return (m_windowStyle & wxSP_VERTICAL) != 0; } - -protected: - // the range value - int m_min; - int m_max; - - DECLARE_NO_COPY_CLASS(wxSpinButtonBase) -}; - -// ---------------------------------------------------------------------------- -// include the declaration of the real class -// ---------------------------------------------------------------------------- - -#if defined(__WXUNIVERSAL__) - #include "wx/univ/spinbutt.h" -#elif defined(__WXMSW__) - #include "wx/msw/spinbutt.h" -#elif defined(__WXMOTIF__) - #include "wx/motif/spinbutt.h" -#elif defined(__WXGTK20__) - #include "wx/gtk/spinbutt.h" -#elif defined(__WXGTK__) - #include "wx/gtk1/spinbutt.h" -#elif defined(__WXMAC__) - #include "wx/mac/spinbutt.h" -#elif defined(__WXCOCOA__) - #include "wx/cocoa/spinbutt.h" -#elif defined(__WXPM__) - #include "wx/os2/spinbutt.h" -#endif - -// ---------------------------------------------------------------------------- -// the wxSpinButton event -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxSpinEvent : public wxNotifyEvent -{ -public: - wxSpinEvent(wxEventType commandType = wxEVT_NULL, int winid = 0) - : wxNotifyEvent(commandType, winid) - { - } - - // get the current value of the control - int GetPosition() const { return m_commandInt; } - void SetPosition(int pos) { m_commandInt = pos; } - -private: - DECLARE_DYNAMIC_CLASS_NO_COPY(wxSpinEvent) -}; - -typedef void (wxEvtHandler::*wxSpinEventFunction)(wxSpinEvent&); - -#define wxSpinEventHandler(func) \ - (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxSpinEventFunction, &func) - -// macros for handling spin events -#define EVT_SPIN_UP(winid, func) \ - wx__DECLARE_EVT1(wxEVT_SCROLL_LINEUP, winid, wxSpinEventHandler(func)) -#define EVT_SPIN_DOWN(winid, func) \ - wx__DECLARE_EVT1(wxEVT_SCROLL_LINEDOWN, winid, wxSpinEventHandler(func)) -#define EVT_SPIN(winid, func) \ - wx__DECLARE_EVT1(wxEVT_SCROLL_THUMBTRACK, winid, wxSpinEventHandler(func)) - -#endif // wxUSE_SPINBTN - -#endif - // _WX_SPINBUTT_H_BASE_ diff --git a/wxWidgets/include/wx/spinctrl.h b/wxWidgets/include/wx/spinctrl.h deleted file mode 100644 index 24e302aa77..0000000000 --- a/wxWidgets/include/wx/spinctrl.h +++ /dev/null @@ -1,83 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: spinctrl.h -// Purpose: wxSpinCtrlBase class -// Author: Vadim Zeitlin -// Modified by: -// Created: 22.07.99 -// RCS-ID: $Id: spinctrl.h 37066 2006-01-23 03:27:34Z MR $ -// Copyright: (c) Vadim Zeitlin -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_SPINCTRL_H_ -#define _WX_SPINCTRL_H_ - -#include "wx/defs.h" - -#if wxUSE_SPINCTRL - -#include "wx/spinbutt.h" // should make wxSpinEvent visible to the app - -// ---------------------------------------------------------------------------- -// a spin ctrl is a text control with a spin button which is usually used to -// prompt the user for a numeric input -// ---------------------------------------------------------------------------- - -/* there is no generic base class for this control because it's imlpemented - very differently under MSW and other platforms - -class WXDLLEXPORT wxSpinCtrlBase : public wxControl -{ -public: - wxSpinCtrlBase() { Init(); } - - // accessors - virtual int GetValue() const = 0; - virtual int GetMin() const { return m_min; } - virtual int GetMax() const { return m_max; } - - // operations - virtual void SetValue(const wxString& value) = 0; - virtual void SetValue(int val) = 0; - virtual void SetRange(int minVal, int maxVal) = 0; - - // as the wxTextCtrl method - virtual void SetSelection(long from, long to) = 0; - -protected: - // initialize m_min/max with the default values - void Init() { m_min = 0; m_max = 100; } - - int m_min; - int m_max; -}; -*/ - -// ---------------------------------------------------------------------------- -// include the platform-dependent class implementation -// ---------------------------------------------------------------------------- - -#if defined(__WXUNIVERSAL__) - #include "wx/generic/spinctlg.h" -#elif defined(__WXMSW__) - #include "wx/msw/spinctrl.h" -#elif defined(__WXPM__) - #include "wx/os2/spinctrl.h" -#elif defined(__WXGTK20__) - #include "wx/gtk/spinctrl.h" -#elif defined(__WXGTK__) - #include "wx/gtk1/spinctrl.h" -#elif defined(__WXMOTIF__) - #include "wx/generic/spinctlg.h" -#elif defined(__WXMAC__) - #include "wx/mac/spinctrl.h" -#elif defined(__WXCOCOA__) - #include "wx/generic/spinctlg.h" -#endif // platform - -#define EVT_SPINCTRL(id, fn) \ - wx__DECLARE_EVT1(wxEVT_COMMAND_SPINCTRL_UPDATED, id, wxSpinEventHandler(fn)) - -#endif // wxUSE_SPINCTRL - -#endif // _WX_SPINCTRL_H_ diff --git a/wxWidgets/include/wx/splash.h b/wxWidgets/include/wx/splash.h deleted file mode 100644 index acd87fc136..0000000000 --- a/wxWidgets/include/wx/splash.h +++ /dev/null @@ -1,18 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/splash.h -// Purpose: Base header for wxSplashScreen -// Author: Julian Smart -// Modified by: -// Created: -// RCS-ID: $Id: splash.h 33948 2005-05-04 18:57:50Z JS $ -// Copyright: (c) Julian Smart -// Licence: wxWindows Licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_SPLASH_H_BASE_ -#define _WX_SPLASH_H_BASE_ - -#include "wx/generic/splash.h" - -#endif - // _WX_SPLASH_H_BASE_ diff --git a/wxWidgets/include/wx/splitter.h b/wxWidgets/include/wx/splitter.h deleted file mode 100644 index 04405264b0..0000000000 --- a/wxWidgets/include/wx/splitter.h +++ /dev/null @@ -1,47 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/splitter.h -// Purpose: Base header for wxSplitterWindow -// Author: Julian Smart -// Modified by: -// Created: -// RCS-ID: $Id: splitter.h 38717 2006-04-14 17:01:16Z ABX $ -// Copyright: (c) Julian Smart -// Licence: wxWindows Licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_SPLITTER_H_BASE_ -#define _WX_SPLITTER_H_BASE_ - -#include "wx/event.h" - -// ---------------------------------------------------------------------------- -// wxSplitterWindow flags -// ---------------------------------------------------------------------------- - -#define wxSP_NOBORDER 0x0000 -#define wxSP_NOSASH 0x0010 -#define wxSP_PERMIT_UNSPLIT 0x0040 -#define wxSP_LIVE_UPDATE 0x0080 -#define wxSP_3DSASH 0x0100 -#define wxSP_3DBORDER 0x0200 -#define wxSP_NO_XP_THEME 0x0400 -#define wxSP_BORDER wxSP_3DBORDER -#define wxSP_3D (wxSP_3DBORDER | wxSP_3DSASH) - -#if WXWIN_COMPATIBILITY_2_6 - // obsolete styles, don't do anything - #define wxSP_SASH_AQUA 0 - #define wxSP_FULLSASH 0 -#endif // WXWIN_COMPATIBILITY_2_6 - -BEGIN_DECLARE_EVENT_TYPES() - DECLARE_EVENT_TYPE(wxEVT_COMMAND_SPLITTER_SASH_POS_CHANGED, 850) - DECLARE_EVENT_TYPE(wxEVT_COMMAND_SPLITTER_SASH_POS_CHANGING, 851) - DECLARE_EVENT_TYPE(wxEVT_COMMAND_SPLITTER_DOUBLECLICKED, 852) - DECLARE_EVENT_TYPE(wxEVT_COMMAND_SPLITTER_UNSPLIT, 853) -END_DECLARE_EVENT_TYPES() - -#include "wx/generic/splitter.h" - -#endif - // _WX_SPLITTER_H_BASE_ diff --git a/wxWidgets/include/wx/srchctrl.h b/wxWidgets/include/wx/srchctrl.h deleted file mode 100644 index 5a56fca912..0000000000 --- a/wxWidgets/include/wx/srchctrl.h +++ /dev/null @@ -1,91 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: srchctrl.h -// Purpose: wxSearchCtrlBase class -// Author: Vince Harron -// Created: 2006-02-18 -// RCS-ID: $Id: srchctrl.h 45828 2007-05-05 14:51:51Z VZ $ -// Copyright: (c) Vince Harron -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_SEARCHCTRL_H_BASE_ -#define _WX_SEARCHCTRL_H_BASE_ - -#include "wx/defs.h" - -#if wxUSE_SEARCHCTRL - -#include "wx/textctrl.h" - -#if !defined(__WXUNIVERSAL__) && defined(__WXMAC__) && defined(__WXMAC_OSX__) \ - && (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_3) - // search control was introduced in Mac OS X 10.3 Panther - #define wxUSE_NATIVE_SEARCH_CONTROL 1 - - #define wxSearchCtrlBaseBaseClass wxTextCtrl -#else - // no native version, use the generic one - #define wxUSE_NATIVE_SEARCH_CONTROL 0 - - #define wxSearchCtrlBaseBaseClass wxTextCtrlBase -#endif - -// ---------------------------------------------------------------------------- -// constants -// ---------------------------------------------------------------------------- - -extern WXDLLEXPORT_DATA(const wxChar) wxSearchCtrlNameStr[]; - -BEGIN_DECLARE_EVENT_TYPES() - DECLARE_EVENT_TYPE(wxEVT_COMMAND_SEARCHCTRL_CANCEL_BTN, 1119) - DECLARE_EVENT_TYPE(wxEVT_COMMAND_SEARCHCTRL_SEARCH_BTN, 1120) -END_DECLARE_EVENT_TYPES() - -// ---------------------------------------------------------------------------- -// a search ctrl is a text control with a search button and a cancel button -// it is based on the MacOSX 10.3 control HISearchFieldCreate -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxSearchCtrlBase : public wxSearchCtrlBaseBaseClass -{ -public: - wxSearchCtrlBase() { } - virtual ~wxSearchCtrlBase() { } - - // search control -#if wxUSE_MENUS - virtual void SetMenu(wxMenu *menu) = 0; - virtual wxMenu *GetMenu() = 0; -#endif // wxUSE_MENUS - - // get/set options - virtual void ShowSearchButton( bool show ) = 0; - virtual bool IsSearchButtonVisible() const = 0; - - virtual void ShowCancelButton( bool show ) = 0; - virtual bool IsCancelButtonVisible() const = 0; -}; - - -// include the platform-dependent class implementation -#if wxUSE_NATIVE_SEARCH_CONTROL - #if defined(__WXMAC__) - #include "wx/mac/srchctrl.h" - #endif -#else - #include "wx/generic/srchctlg.h" -#endif - -// ---------------------------------------------------------------------------- -// macros for handling search events -// ---------------------------------------------------------------------------- - -#define EVT_SEARCHCTRL_CANCEL_BTN(id, fn) \ - wx__DECLARE_EVT1(wxEVT_COMMAND_SEARCHCTRL_CANCEL_BTN, id, wxCommandEventHandler(fn)) - -#define EVT_SEARCHCTRL_SEARCH_BTN(id, fn) \ - wx__DECLARE_EVT1(wxEVT_COMMAND_SEARCHCTRL_SEARCH_BTN, id, wxCommandEventHandler(fn)) - -#endif // wxUSE_SEARCHCTRL - -#endif // _WX_SEARCHCTRL_H_BASE_ diff --git a/wxWidgets/include/wx/sstream.h b/wxWidgets/include/wx/sstream.h deleted file mode 100644 index 7724ab44ee..0000000000 --- a/wxWidgets/include/wx/sstream.h +++ /dev/null @@ -1,103 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: wx/sstream.h -// Purpose: string-based streams -// Author: Vadim Zeitlin -// Modified by: -// Created: 2004-09-19 -// RCS-ID: $Id: sstream.h 45732 2007-05-01 13:52:19Z VZ $ -// Copyright: (c) 2004 Vadim Zeitlin <vadim@wxwindows.org> -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_SSTREAM_H_ -#define _WX_SSTREAM_H_ - -#include "wx/stream.h" - -#if wxUSE_STREAMS - -// ---------------------------------------------------------------------------- -// wxStringInputStream is a stream reading from the given (fixed size) string -// ---------------------------------------------------------------------------- - -class WXDLLIMPEXP_BASE wxStringInputStream : public wxInputStream -{ -public: - // ctor associates the stream with the given string which makes a copy of - // it - wxStringInputStream(const wxString& s); - virtual ~wxStringInputStream(); - - virtual wxFileOffset GetLength() const; - -protected: - virtual wxFileOffset OnSysSeek(wxFileOffset ofs, wxSeekMode mode); - virtual wxFileOffset OnSysTell() const; - virtual size_t OnSysRead(void *buffer, size_t size); - -private: - // the string that was passed in the ctor - wxString m_str; - - // the buffer we're reading from - char* m_buf; - - // length of the buffer we're reading from - size_t m_len; - - // position in the stream in bytes, *not* in chars - size_t m_pos; - - DECLARE_NO_COPY_CLASS(wxStringInputStream) -}; - -// ---------------------------------------------------------------------------- -// wxStringOutputStream writes data to the given string, expanding it as needed -// ---------------------------------------------------------------------------- - -class WXDLLIMPEXP_BASE wxStringOutputStream : public wxOutputStream -{ -public: - // The stream will write data either to the provided string or to an - // internal string which can be retrieved using GetString() - wxStringOutputStream(wxString *pString = NULL) - { - m_str = pString ? pString : &m_strInternal; - m_pos = m_str->length() / sizeof(wxChar); - } - -#if wxABI_VERSION >= 20804 && wxUSE_UNICODE - virtual ~wxStringOutputStream(); -#endif // wx 2.8.4+ - - // get the string containing current output - const wxString& GetString() const { return *m_str; } - -protected: - virtual wxFileOffset OnSysTell() const; - virtual size_t OnSysWrite(const void *buffer, size_t size); - -private: - // internal string, not used if caller provided his own string - wxString m_strInternal; - - // pointer given by the caller or just pointer to m_strInternal - wxString *m_str; - - // position in the stream in bytes, *not* in chars - size_t m_pos; - -#if wxUSE_WCHAR_T - // string encoding converter (UTF8 is the standard) - wxMBConvUTF8 m_conv; -#else - wxMBConv m_conv; -#endif - - DECLARE_NO_COPY_CLASS(wxStringOutputStream) -}; - -#endif // wxUSE_STREAMS - -#endif // _WX_SSTREAM_H_ - diff --git a/wxWidgets/include/wx/stack.h b/wxWidgets/include/wx/stack.h deleted file mode 100644 index 2500a114c6..0000000000 --- a/wxWidgets/include/wx/stack.h +++ /dev/null @@ -1,44 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: wx/stack.h -// Purpose: STL stack clone -// Author: Lindsay Mathieson -// Modified by: -// Created: 30.07.2001 -// Copyright: (c) 2001 Lindsay Mathieson <lindsay@mathieson.org> -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_STACK_H_ -#define _WX_STACK_H_ - -#include "wx/vector.h" - -#define WX_DECLARE_STACK(obj, cls)\ -class cls : public wxVectorBase\ -{\ - WX_DECLARE_VECTORBASE(obj, cls);\ -public:\ - void push(const obj& o)\ - {\ - bool rc = Alloc(size() + 1);\ - wxASSERT(rc);\ - Append(new obj(o));\ - };\ -\ - void pop()\ - {\ - RemoveAt(size() - 1);\ - };\ -\ - obj& top()\ - {\ - return *(obj *) GetItem(size() - 1);\ - };\ - const obj& top() const\ - {\ - return *(obj *) GetItem(size() - 1);\ - };\ -} - -#endif // _WX_STACK_H_ - diff --git a/wxWidgets/include/wx/stackwalk.h b/wxWidgets/include/wx/stackwalk.h deleted file mode 100644 index e0dceae7c6..0000000000 --- a/wxWidgets/include/wx/stackwalk.h +++ /dev/null @@ -1,156 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: wx/wx/stackwalk.h -// Purpose: wxStackWalker and related classes, common part -// Author: Vadim Zeitlin -// Modified by: -// Created: 2005-01-07 -// RCS-ID: $Id: stackwalk.h 43346 2006-11-12 14:33:03Z RR $ -// Copyright: (c) 2004 Vadim Zeitlin <vadim@wxwindows.org> -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_STACKWALK_H_ -#define _WX_STACKWALK_H_ - -#include "wx/defs.h" - -#if wxUSE_STACKWALKER - -class WXDLLIMPEXP_BASE wxStackFrame; - -// ---------------------------------------------------------------------------- -// wxStackFrame: a single stack level -// ---------------------------------------------------------------------------- - -class WXDLLIMPEXP_BASE wxStackFrameBase -{ -private: - // put this inline function here so that it is defined before use - wxStackFrameBase *ConstCast() const - { return wx_const_cast(wxStackFrameBase *, this); } - -public: - wxStackFrameBase(size_t level, void *address = NULL) - { - m_level = level; - - m_line = - m_offset = 0; - - m_address = address; - } - - // get the level of this frame (deepest/innermost one is 0) - size_t GetLevel() const { return m_level; } - - // return the address of this frame - void *GetAddress() const { return m_address; } - - - // return the unmangled (if possible) name of the function containing this - // frame - wxString GetName() const { ConstCast()->OnGetName(); return m_name; } - - // return the instruction pointer offset from the start of the function - size_t GetOffset() const { ConstCast()->OnGetName(); return m_offset; } - - // get the module this function belongs to (not always available) - wxString GetModule() const { ConstCast()->OnGetName(); return m_module; } - - - // return true if we have the filename and line number for this frame - bool HasSourceLocation() const { return !GetFileName().empty(); } - - // return the name of the file containing this frame, empty if - // unavailable (typically because debug info is missing) - wxString GetFileName() const - { ConstCast()->OnGetLocation(); return m_filename; } - - // return the line number of this frame, 0 if unavailable - size_t GetLine() const { ConstCast()->OnGetLocation(); return m_line; } - - - // return the number of parameters of this function (may return 0 if we - // can't retrieve the parameters info even although the function does have - // parameters) - virtual size_t GetParamCount() const { return 0; } - - // get the name, type and value (in text form) of the given parameter - // - // any pointer may be NULL - // - // return true if at least some values could be retrieved - virtual bool GetParam(size_t WXUNUSED(n), - wxString * WXUNUSED(type), - wxString * WXUNUSED(name), - wxString * WXUNUSED(value)) const - { - return false; - } - - - // although this class is not supposed to be used polymorphically, give it - // a virtual dtor to silence compiler warnings - virtual ~wxStackFrameBase() { } - -protected: - // hooks for derived classes to initialize some fields on demand - virtual void OnGetName() { } - virtual void OnGetLocation() { } - - - // fields are protected, not private, so that OnGetXXX() could modify them - // directly - size_t m_level; - - wxString m_name, - m_module, - m_filename; - - size_t m_line; - - void *m_address; - size_t m_offset; -}; - -// ---------------------------------------------------------------------------- -// wxStackWalker: class for enumerating stack frames -// ---------------------------------------------------------------------------- - -class WXDLLIMPEXP_BASE wxStackWalkerBase -{ -public: - // ctor does nothing, use Walk() to walk the stack - wxStackWalkerBase() { } - - // dtor does nothing neither but should be virtual - virtual ~wxStackWalkerBase() { } - - // enumerate stack frames from the current location, skipping the initial - // number of them (this can be useful when Walk() is called from some known - // location and you don't want to see the first few frames anyhow; also - // notice that Walk() frame itself is not included if skip >= 1) - virtual void Walk(size_t skip = 1, size_t maxDepth = 200) = 0; - - // enumerate stack frames from the location of uncaught exception - // - // this version can only be called from wxApp::OnFatalException() - virtual void WalkFromException() = 0; - -protected: - // this function must be overrided to process the given frame - virtual void OnStackFrame(const wxStackFrame& frame) = 0; -}; - -#ifdef __WXMSW__ - #include "wx/msw/stackwalk.h" -#elif defined(__UNIX__) - #include "wx/unix/stackwalk.h" -#else - #error "wxStackWalker is not supported, set wxUSE_STACKWALKER to 0" -#endif - -#endif // wxUSE_STACKWALKER - -#endif // _WX_STACKWALK_H_ - diff --git a/wxWidgets/include/wx/statbmp.h b/wxWidgets/include/wx/statbmp.h deleted file mode 100644 index 35a5dc50c6..0000000000 --- a/wxWidgets/include/wx/statbmp.h +++ /dev/null @@ -1,74 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/statbmp.h -// Purpose: wxStaticBitmap class interface -// Author: Vadim Zeitlin -// Modified by: -// Created: 25.08.00 -// RCS-ID: $Id: statbmp.h 37066 2006-01-23 03:27:34Z MR $ -// Copyright: (c) 2000 Vadim Zeitlin -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_STATBMP_H_BASE_ -#define _WX_STATBMP_H_BASE_ - -#include "wx/defs.h" - -#if wxUSE_STATBMP - -#include "wx/control.h" -#include "wx/bitmap.h" -#include "wx/icon.h" - -extern WXDLLEXPORT_DATA(const wxChar) wxStaticBitmapNameStr[]; - -// a control showing an icon or a bitmap -class WXDLLEXPORT wxStaticBitmapBase : public wxControl -{ -public: - wxStaticBitmapBase() { } - virtual ~wxStaticBitmapBase(); - - // our interface - virtual void SetIcon(const wxIcon& icon) = 0; - virtual void SetBitmap(const wxBitmap& bitmap) = 0; - virtual wxBitmap GetBitmap() const = 0; - virtual wxIcon GetIcon() const /* = 0 -- should be pure virtual */ - { - // stub it out here for now as not all ports implement it (but they - // should) - return wxIcon(); - } - - // overriden base class virtuals - virtual bool AcceptsFocus() const { return false; } - virtual bool HasTransparentBackground() { return true; } - -protected: - virtual wxSize DoGetBestSize() const; - - DECLARE_NO_COPY_CLASS(wxStaticBitmapBase) -}; - -#if defined(__WXUNIVERSAL__) - #include "wx/univ/statbmp.h" -#elif defined(__WXMSW__) - #include "wx/msw/statbmp.h" -#elif defined(__WXMOTIF__) - #include "wx/motif/statbmp.h" -#elif defined(__WXGTK20__) - #include "wx/gtk/statbmp.h" -#elif defined(__WXGTK__) - #include "wx/gtk1/statbmp.h" -#elif defined(__WXMAC__) - #include "wx/mac/statbmp.h" -#elif defined(__WXCOCOA__) - #include "wx/cocoa/statbmp.h" -#elif defined(__WXPM__) - #include "wx/os2/statbmp.h" -#endif - -#endif // wxUSE_STATBMP - -#endif - // _WX_STATBMP_H_BASE_ diff --git a/wxWidgets/include/wx/statbox.h b/wxWidgets/include/wx/statbox.h deleted file mode 100644 index ddeba35263..0000000000 --- a/wxWidgets/include/wx/statbox.h +++ /dev/null @@ -1,74 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: statbox.h -// Purpose: wxStaticBox base header -// Author: Julian Smart -// Modified by: -// Created: -// Copyright: (c) Julian Smart -// RCS-ID: $Id: statbox.h 37066 2006-01-23 03:27:34Z MR $ -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_STATBOX_H_BASE_ -#define _WX_STATBOX_H_BASE_ - -#include "wx/defs.h" - -#if wxUSE_STATBOX - -#include "wx/control.h" - -extern WXDLLEXPORT_DATA(const wxChar) wxStaticBoxNameStr[]; - -// ---------------------------------------------------------------------------- -// wxStaticBox: a grouping box with a label -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxStaticBoxBase : public wxControl -{ -public: - wxStaticBoxBase() { } - - // overriden base class virtuals - virtual bool AcceptsFocus() const { return false; } - virtual bool HasTransparentBackground() { return true; } - - // implementation only: this is used by wxStaticBoxSizer to account for the - // need for extra space taken by the static box - // - // the top border is the margin at the top (where the title is), - // borderOther is the margin on all other sides - virtual void GetBordersForSizer(int *borderTop, int *borderOther) const - { - const int BORDER = 5; // FIXME: hardcoded value - - *borderTop = GetLabel().empty() ? BORDER : GetCharHeight(); - *borderOther = BORDER; - } - -private: - DECLARE_NO_COPY_CLASS(wxStaticBoxBase) -}; - -#if defined(__WXUNIVERSAL__) - #include "wx/univ/statbox.h" -#elif defined(__WXMSW__) - #include "wx/msw/statbox.h" -#elif defined(__WXMOTIF__) - #include "wx/motif/statbox.h" -#elif defined(__WXGTK20__) - #include "wx/gtk/statbox.h" -#elif defined(__WXGTK__) - #include "wx/gtk1/statbox.h" -#elif defined(__WXMAC__) - #include "wx/mac/statbox.h" -#elif defined(__WXCOCOA__) - #include "wx/cocoa/statbox.h" -#elif defined(__WXPM__) - #include "wx/os2/statbox.h" -#endif - -#endif // wxUSE_STATBOX - -#endif - // _WX_STATBOX_H_BASE_ diff --git a/wxWidgets/include/wx/statline.h b/wxWidgets/include/wx/statline.h deleted file mode 100644 index 2156a71b2b..0000000000 --- a/wxWidgets/include/wx/statline.h +++ /dev/null @@ -1,103 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/statline.h -// Purpose: wxStaticLine class interface -// Author: Vadim Zeitlin -// Created: 28.06.99 -// Version: $Id: statline.h 43874 2006-12-09 14:52:59Z VZ $ -// Copyright: (c) 1999 Vadim Zeitlin -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_STATLINE_H_BASE_ -#define _WX_STATLINE_H_BASE_ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -// this defines wxUSE_STATLINE -#include "wx/defs.h" - -#if wxUSE_STATLINE - -// the base class declaration -#include "wx/control.h" - -// ---------------------------------------------------------------------------- -// global variables -// ---------------------------------------------------------------------------- - -// the default name for objects of class wxStaticLine -extern WXDLLEXPORT_DATA(const wxChar) wxStaticLineNameStr[]; - -// ---------------------------------------------------------------------------- -// wxStaticLine - a line in a dialog -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxStaticLineBase : public wxControl -{ -public: - // constructor - wxStaticLineBase() { } - - // is the line vertical? - bool IsVertical() const { return (GetWindowStyle() & wxLI_VERTICAL) != 0; } - - // get the default size for the "lesser" dimension of the static line - static int GetDefaultSize() { return 2; } - - // overriden base class virtuals - virtual bool AcceptsFocus() const { return false; } - -protected: - // set the right size for the right dimension - wxSize AdjustSize(const wxSize& size) const - { - wxSize sizeReal(size); - if ( IsVertical() ) - { - if ( size.x == wxDefaultCoord ) - sizeReal.x = GetDefaultSize(); - } - else - { - if ( size.y == wxDefaultCoord ) - sizeReal.y = GetDefaultSize(); - } - - return sizeReal; - } - - virtual wxSize DoGetBestSize() const - { - return AdjustSize(wxDefaultSize); - } - - DECLARE_NO_COPY_CLASS(wxStaticLineBase) -}; - -// ---------------------------------------------------------------------------- -// now include the actual class declaration -// ---------------------------------------------------------------------------- - -#if defined(__WXUNIVERSAL__) - #include "wx/univ/statline.h" -#elif defined(__WXMSW__) - #include "wx/msw/statline.h" -#elif defined(__WXGTK20__) - #include "wx/gtk/statline.h" -#elif defined(__WXGTK__) - #include "wx/gtk1/statline.h" -#elif defined(__WXPM__) - #include "wx/os2/statline.h" -#elif defined(__WXMAC__) - #include "wx/mac/statline.h" -#elif defined(__WXCOCOA__) - #include "wx/cocoa/statline.h" -#else // use generic implementation for all other platforms - #include "wx/generic/statline.h" -#endif - -#endif // wxUSE_STATLINE - -#endif // _WX_STATLINE_H_BASE_ diff --git a/wxWidgets/include/wx/stattext.h b/wxWidgets/include/wx/stattext.h deleted file mode 100644 index f2ad354258..0000000000 --- a/wxWidgets/include/wx/stattext.h +++ /dev/null @@ -1,69 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: stattext.h -// Purpose: wxStaticText base header -// Author: Julian Smart -// Modified by: -// Created: -// Copyright: (c) Julian Smart -// RCS-ID: $Id: stattext.h 37066 2006-01-23 03:27:34Z MR $ -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_STATTEXT_H_BASE_ -#define _WX_STATTEXT_H_BASE_ - -#include "wx/defs.h" - -#if wxUSE_STATTEXT - -#include "wx/control.h" - -extern WXDLLEXPORT_DATA(const wxChar) wxStaticTextNameStr[]; - -class WXDLLEXPORT wxStaticTextBase : public wxControl -{ -public: - wxStaticTextBase() { } - - // in wxGTK wxStaticText doesn't derive from wxStaticTextBase so we have to - // declare this function directly in gtk header -#if !defined(__WXGTK__) || defined(__WXUNIVERSAL__) - // wrap the text of the control so that no line is longer than the given - // width (if possible: this function won't break words) - // - // NB: implemented in dlgcmn.cpp for now - void Wrap(int width); -#endif // ! native __WXGTK__ - - // overriden base virtuals - virtual bool AcceptsFocus() const { return false; } - virtual bool HasTransparentBackground() { return true; } - -private: - DECLARE_NO_COPY_CLASS(wxStaticTextBase) -}; - -#if defined(__WXUNIVERSAL__) - #include "wx/univ/stattext.h" -#elif defined(__WXMSW__) - #include "wx/msw/stattext.h" -#elif defined(__WXMOTIF__) - #include "wx/motif/stattext.h" -#elif defined(__WXGTK20__) - #include "wx/gtk/stattext.h" -#elif defined(__WXGTK__) - #include "wx/gtk1/stattext.h" -#elif defined(__WXMAC__) - #include "wx/mac/stattext.h" -#elif defined(__WXCOCOA__) - #include "wx/cocoa/stattext.h" -#elif defined(__WXPM__) - #include "wx/os2/stattext.h" -#elif defined(__WXPALMOS__) - #include "wx/palmos/stattext.h" -#endif - -#endif // wxUSE_STATTEXT - -#endif - // _WX_STATTEXT_H_BASE_ diff --git a/wxWidgets/include/wx/statusbr.h b/wxWidgets/include/wx/statusbr.h deleted file mode 100644 index b1ab7d10e8..0000000000 --- a/wxWidgets/include/wx/statusbr.h +++ /dev/null @@ -1,174 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/statusbr.h -// Purpose: wxStatusBar class interface -// Author: Vadim Zeitlin -// Modified by: -// Created: 05.02.00 -// RCS-ID: $Id: statusbr.h 41035 2006-09-06 17:36:22Z PC $ -// Copyright: (c) Vadim Zeitlin -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_STATUSBR_H_BASE_ -#define _WX_STATUSBR_H_BASE_ - -#include "wx/defs.h" - -#if wxUSE_STATUSBAR - -#include "wx/window.h" -#include "wx/list.h" -#include "wx/dynarray.h" - -extern WXDLLIMPEXP_DATA_CORE(const wxChar) wxStatusBarNameStr[]; - -WX_DECLARE_LIST(wxString, wxListString); - -// ---------------------------------------------------------------------------- -// wxStatusBar constants -// ---------------------------------------------------------------------------- - -// style flags for fields -#define wxSB_NORMAL 0x0000 -#define wxSB_FLAT 0x0001 -#define wxSB_RAISED 0x0002 - -// ---------------------------------------------------------------------------- -// wxStatusBar: a window near the bottom of the frame used for status info -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxStatusBarBase : public wxWindow -{ -public: - wxStatusBarBase(); - - virtual ~wxStatusBarBase(); - - // field count - // ----------- - - // set the number of fields and call SetStatusWidths(widths) if widths are - // given - virtual void SetFieldsCount(int number = 1, const int *widths = NULL); - int GetFieldsCount() const { return m_nFields; } - - // field text - // ---------- - - virtual void SetStatusText(const wxString& text, int number = 0) = 0; - virtual wxString GetStatusText(int number = 0) const = 0; - - void PushStatusText(const wxString& text, int number = 0); - void PopStatusText(int number = 0); - - // fields widths - // ------------- - - // set status field widths as absolute numbers: positive widths mean that - // the field has the specified absolute width, negative widths are - // interpreted as the sizer options, i.e. the extra space (total space - // minus the sum of fixed width fields) is divided between the fields with - // negative width according to the abs value of the width (field with width - // -2 grows twice as much as one with width -1 &c) - virtual void SetStatusWidths(int n, const int widths[]); - - // field styles - // ------------ - - // Set the field style. Use either wxSB_NORMAL (default) for a standard 3D - // border around a field, wxSB_FLAT for no border around a field, so that it - // appears flat or wxSB_POPOUT to make the field appear raised. - // Setting field styles only works on wxMSW - virtual void SetStatusStyles(int n, const int styles[]); - - // geometry - // -------- - - // Get the position and size of the field's internal bounding rectangle - virtual bool GetFieldRect(int i, wxRect& rect) const = 0; - - // sets the minimal vertical size of the status bar - virtual void SetMinHeight(int height) = 0; - - // get the dimensions of the horizontal and vertical borders - virtual int GetBorderX() const = 0; - virtual int GetBorderY() const = 0; - - // don't want status bars to accept the focus at all - virtual bool AcceptsFocus() const { return false; } - -protected: - // set the widths array to NULL - void InitWidths(); - - // free the status widths arrays - void FreeWidths(); - - // reset the widths - void ReinitWidths() { FreeWidths(); InitWidths(); } - - // same, for field styles - void InitStyles(); - void FreeStyles(); - void ReinitStyles() { FreeStyles(); InitStyles(); } - - // same, for text stacks - void InitStacks(); - void FreeStacks(); - void ReinitStacks() { FreeStacks(); InitStacks(); } - - // calculate the real field widths for the given total available size - wxArrayInt CalculateAbsWidths(wxCoord widthTotal) const; - - // use these functions to access the stacks of field strings - wxListString *GetStatusStack(int i) const; - wxListString *GetOrCreateStatusStack(int i); - - // the current number of fields - int m_nFields; - - // the widths of the fields in pixels if !NULL, all fields have the same - // width otherwise - int *m_statusWidths; - - // the styles of the fields - int *m_statusStyles; - - // stacks of previous values for PushStatusText/PopStatusText - // this is created on demand, use GetStatusStack/GetOrCreateStatusStack - wxListString **m_statusTextStacks; - - DECLARE_NO_COPY_CLASS(wxStatusBarBase) -}; - -// ---------------------------------------------------------------------------- -// include the actual wxStatusBar class declaration -// ---------------------------------------------------------------------------- - -#if defined(__WXUNIVERSAL__) - #define wxStatusBarUniv wxStatusBar - - #include "wx/univ/statusbr.h" -#elif defined(__WXPALMOS__) - #define wxStatusBarPalm wxStatusBar - - #include "wx/palmos/statusbr.h" -#elif defined(__WIN32__) && wxUSE_NATIVE_STATUSBAR - #define wxStatusBar95 wxStatusBar - - #include "wx/msw/statbr95.h" -#elif defined(__WXMAC__) - #define wxStatusBarMac wxStatusBar - - #include "wx/generic/statusbr.h" - #include "wx/mac/statusbr.h" -#else - #define wxStatusBarGeneric wxStatusBar - - #include "wx/generic/statusbr.h" -#endif - -#endif // wxUSE_STATUSBAR - -#endif - // _WX_STATUSBR_H_BASE_ diff --git a/wxWidgets/include/wx/stdpaths.h b/wxWidgets/include/wx/stdpaths.h deleted file mode 100644 index b9647c8c67..0000000000 --- a/wxWidgets/include/wx/stdpaths.h +++ /dev/null @@ -1,179 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: wx/stdpaths.h -// Purpose: declaration of wxStandardPaths class -// Author: Vadim Zeitlin -// Modified by: -// Created: 2004-10-17 -// RCS-ID: $Id: stdpaths.h 43340 2006-11-12 12:58:10Z RR $ -// Copyright: (c) 2004 Vadim Zeitlin <vadim@wxwindows.org> -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_STDPATHS_H_ -#define _WX_STDPATHS_H_ - -#include "wx/defs.h" - -#if wxUSE_STDPATHS - -#include "wx/string.h" -#include "wx/filefn.h" - -// ---------------------------------------------------------------------------- -// wxStandardPaths returns the standard locations in the file system -// ---------------------------------------------------------------------------- - -class WXDLLIMPEXP_BASE wxStandardPathsBase -{ -public: - // possible resources categorires - enum ResourceCat - { - // no special category - ResourceCat_None, - - // message catalog resources - ResourceCat_Messages, - - // end of enum marker - ResourceCat_Max - }; - - - // return the global standard paths object - static wxStandardPathsBase& Get(); - - // return the path (directory+filename) of the running executable or - // wxEmptyString if it couldn't be determined. - // The path is returned as an absolute path whenever possible. - // Default implementation only try to use wxApp->argv[0]. - virtual wxString GetExecutablePath() const; - - // return the directory with system config files: - // /etc under Unix, c:\Documents and Settings\All Users\Application Data - // under Windows, /Library/Preferences for Mac - virtual wxString GetConfigDir() const = 0; - - // return the directory for the user config files: - // $HOME under Unix, c:\Documents and Settings\username under Windows, - // ~/Library/Preferences under Mac - // - // only use this if you have a single file to put there, otherwise - // GetUserDataDir() is more appropriate - virtual wxString GetUserConfigDir() const = 0; - - // return the location of the applications global, i.e. not user-specific, - // data files - // - // prefix/share/appname under Unix, c:\Program Files\appname under Windows, - // appname.app/Contents/SharedSupport app bundle directory under Mac - virtual wxString GetDataDir() const = 0; - - // return the location for application data files which are host-specific - // - // same as GetDataDir() except under Unix where it is /etc/appname - virtual wxString GetLocalDataDir() const; - - // return the directory for the user-dependent application data files - // - // $HOME/.appname under Unix, - // c:\Documents and Settings\username\Application Data\appname under Windows - // and ~/Library/Application Support/appname under Mac - virtual wxString GetUserDataDir() const = 0; - - // return the directory for user data files which shouldn't be shared with - // the other machines - // - // same as GetUserDataDir() for all platforms except Windows where it is - // the "Local Settings\Application Data\appname" directory - virtual wxString GetUserLocalDataDir() const; - - // return the directory where the loadable modules (plugins) live - // - // prefix/lib/appname under Unix, program directory under Windows and - // Contents/Plugins app bundle subdirectory under Mac - virtual wxString GetPluginsDir() const = 0; - - // get resources directory: resources are auxiliary files used by the - // application and include things like image and sound files - // - // same as GetDataDir() for all platforms except Mac where it returns - // Contents/Resources subdirectory of the app bundle - virtual wxString GetResourcesDir() const { return GetDataDir(); } - - // get localized resources directory containing the resource files of the - // specified category for the given language - // - // in general this is just GetResourcesDir()/lang under Windows and Unix - // and GetResourcesDir()/lang.lproj under Mac but is something quite - // different under Unix for message catalog category (namely the standard - // prefix/share/locale/lang/LC_MESSAGES) - virtual wxString - GetLocalizedResourcesDir(const wxChar *lang, - ResourceCat WXUNUSED(category) - = ResourceCat_None) const - { - return GetResourcesDir() + wxFILE_SEP_PATH + lang; - } - - // return the "Documents" directory for the current user - // - // C:\Documents and Settings\username\Documents under Windows, - // $HOME under Unix and ~/Documents under Mac - virtual wxString GetDocumentsDir() const; - - // return the temporary directory for the current user - virtual wxString GetTempDir() const; - - - // virtual dtor for the base class - virtual ~wxStandardPathsBase(); - -protected: - // append "/appname" suffix if the app name is set (doesn't append the - // slash if dir already ends with a slash or dot) - static wxString AppendAppName(const wxString& dir); -}; - -#if defined(__WXMSW__) - #include "wx/msw/stdpaths.h" -// We want CoreFoundation paths on both CarbonLib and Darwin (for all ports) -#elif defined(__WXMAC__) || defined(__DARWIN__) - #include "wx/mac/corefoundation/stdpaths.h" -#elif defined(__OS2__) - #include "wx/os2/stdpaths.h" -#elif defined(__UNIX__) - #include "wx/unix/stdpaths.h" -#elif defined(__PALMOS__) - #include "wx/palmos/stdpaths.h" -#else - -// ---------------------------------------------------------------------------- -// Minimal generic implementation -// ---------------------------------------------------------------------------- - -class WXDLLIMPEXP_BASE wxStandardPaths : public wxStandardPathsBase -{ -public: - void SetInstallPrefix(const wxString& prefix) { m_prefix = prefix; } - wxString GetInstallPrefix() const { return m_prefix; } - - virtual wxString GetExecutablePath() const { return m_prefix; } - virtual wxString GetConfigDir() const { return m_prefix; } - virtual wxString GetUserConfigDir() const { return m_prefix; } - virtual wxString GetDataDir() const { return m_prefix; } - virtual wxString GetLocalDataDir() const { return m_prefix; } - virtual wxString GetUserDataDir() const { return m_prefix; } - virtual wxString GetPluginsDir() const { return m_prefix; } - virtual wxString GetDocumentsDir() const { return m_prefix; } - -private: - wxString m_prefix; -}; - -#endif - -#endif // wxUSE_STDPATHS - -#endif // _WX_STDPATHS_H_ - diff --git a/wxWidgets/include/wx/stockitem.h b/wxWidgets/include/wx/stockitem.h deleted file mode 100644 index 55695077d6..0000000000 --- a/wxWidgets/include/wx/stockitem.h +++ /dev/null @@ -1,73 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/stockitem.h -// Purpose: stock items helpers (privateh header) -// Author: Vaclav Slavik -// Modified by: -// Created: 2004-08-15 -// RCS-ID: $Id: stockitem.h 42935 2006-11-02 09:51:49Z JS $ -// Copyright: (c) Vaclav Slavik, 2004 -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_STOCKITEM_H_ -#define _WX_STOCKITEM_H_ - -#include "wx/defs.h" -#include "wx/wxchar.h" -#include "wx/string.h" -#include "wx/accel.h" - -// ---------------------------------------------------------------------------- -// Helper functions for stock items handling: -// ---------------------------------------------------------------------------- - -// Returns true if the ID is in the list of recognized stock actions -WXDLLEXPORT bool wxIsStockID(wxWindowID id); - -// Returns true of the label is empty or label of a stock button with -// given ID -WXDLLEXPORT bool wxIsStockLabel(wxWindowID id, const wxString& label); - -enum wxStockLabelQueryFlag -{ - wxSTOCK_NOFLAGS = 0, - - wxSTOCK_WITH_MNEMONIC = 1, - wxSTOCK_WITH_ACCELERATOR = 2 -}; - -// Returns label that should be used for given stock UI element (e.g. "&OK" -// for wxSTOCK_OK); if wxSTOCK_WITH_MNEMONIC is given, the & character -// is included; if wxSTOCK_WITH_ACCELERATOR is given, the stock accelerator -// for given ID is concatenated to the label using \t as separator -WXDLLEXPORT wxString wxGetStockLabel(wxWindowID id, - long flags = wxSTOCK_WITH_MNEMONIC); - -#if wxUSE_ACCEL - - // Returns the accelerator that should be used for given stock UI element - // (e.g. "Ctrl+x" for wxSTOCK_EXIT) - WXDLLEXPORT wxAcceleratorEntry wxGetStockAccelerator(wxWindowID id); - -#endif - -// wxStockHelpStringClient conceptually works like wxArtClient: it gives a hint to -// wxGetStockHelpString() about the context where the help string is to be used -enum wxStockHelpStringClient -{ - wxSTOCK_MENU // help string to use for menu items -}; - -// Returns an help string for the given stock UI element and for the given "context". -WXDLLEXPORT wxString wxGetStockHelpString(wxWindowID id, - wxStockHelpStringClient client = wxSTOCK_MENU); - - -#ifdef __WXGTK20__ - -// Translates stock ID to GTK+'s stock item string indentifier: -WXDLLEXPORT const char *wxGetStockGtkID(wxWindowID id); - -#endif - -#endif // _WX_STOCKITEM_H_ diff --git a/wxWidgets/include/wx/stopwatch.h b/wxWidgets/include/wx/stopwatch.h deleted file mode 100644 index e13b9b7716..0000000000 --- a/wxWidgets/include/wx/stopwatch.h +++ /dev/null @@ -1,102 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/stopwatch.h -// Purpose: wxStopWatch and global time-related functions -// Author: Julian Smart (wxTimer), Sylvain Bougnoux (wxStopWatch) -// Created: 26.06.03 (extracted from wx/timer.h) -// RCS-ID: $Id: stopwatch.h 61872 2009-09-09 22:37:05Z VZ $ -// Copyright: (c) 1998-2003 Julian Smart, Sylvain Bougnoux -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_STOPWATCH_H_ -#define _WX_STOPWATCH_H_ - -#include "wx/defs.h" -#include "wx/longlong.h" - -// ---------------------------------------------------------------------------- -// wxStopWatch: measure time intervals with up to 1ms resolution -// ---------------------------------------------------------------------------- - -#if wxUSE_STOPWATCH - -class WXDLLIMPEXP_BASE wxStopWatch -{ -public: - // ctor starts the stop watch - wxStopWatch() { m_pauseCount = 0; Start(); } - - // start the stop watch at the moment t0 - void Start(long t0 = 0); - - // pause the stop watch - void Pause() - { - if ( m_pauseCount++ == 0 ) - m_pause = GetElapsedTime(); - } - - // resume it - void Resume() - { - wxASSERT_MSG( m_pauseCount > 0, - wxT("Resuming stop watch which is not paused") ); - - if ( --m_pauseCount == 0 ) - Start(m_pause); - } - - // get elapsed time since the last Start() in milliseconds - long Time() const; - -protected: - // returns the elapsed time since t0 - long GetElapsedTime() const; - -private: - // the time of the last Start() - wxLongLong m_t0; - - // the time of the last Pause() (only valid if m_pauseCount > 0) - long m_pause; - - // if > 0, the stop watch is paused, otherwise it is running - int m_pauseCount; -}; - -#endif // wxUSE_STOPWATCH - -#if wxUSE_LONGLONG && WXWIN_COMPATIBILITY_2_6 - - // Starts a global timer - // -- DEPRECATED: use wxStopWatch instead - wxDEPRECATED( void WXDLLIMPEXP_BASE wxStartTimer() ); - - // Gets elapsed milliseconds since last wxStartTimer or wxGetElapsedTime - // -- DEPRECATED: use wxStopWatch instead - wxDEPRECATED( long WXDLLIMPEXP_BASE wxGetElapsedTime(bool resetTimer = true) ); - -#endif // wxUSE_LONGLONG && WXWIN_COMPATIBILITY_2_6 - -// ---------------------------------------------------------------------------- -// global time functions -// ---------------------------------------------------------------------------- - -// Get number of seconds since local time 00:00:00 Jan 1st 1970. -extern long WXDLLIMPEXP_BASE wxGetLocalTime(); - -// Get number of seconds since GMT 00:00:00, Jan 1st 1970. -extern long WXDLLIMPEXP_BASE wxGetUTCTime(); - -#if wxUSE_LONGLONG - typedef wxLongLong wxMilliClock_t; -#else - typedef double wxMilliClock_t; -#endif // wxUSE_LONGLONG - -// Get number of milliseconds since local time 00:00:00 Jan 1st 1970 -extern wxMilliClock_t WXDLLIMPEXP_BASE wxGetLocalTimeMillis(); - -#define wxGetCurrentTime() wxGetLocalTime() - -#endif // _WX_STOPWATCH_H_ diff --git a/wxWidgets/include/wx/strconv.h b/wxWidgets/include/wx/strconv.h deleted file mode 100644 index 1a760cb65c..0000000000 --- a/wxWidgets/include/wx/strconv.h +++ /dev/null @@ -1,553 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: strconv.h -// Purpose: conversion routines for char sets any Unicode -// Author: Ove Kaaven, Robert Roebling, Vadim Zeitlin -// Modified by: -// Created: 29/01/98 -// RCS-ID: $Id: strconv.h 45893 2007-05-08 20:05:16Z VZ $ -// Copyright: (c) 1998 Ove Kaaven, Robert Roebling -// (c) 1998-2006 Vadim Zeitlin -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_STRCONV_H_ -#define _WX_STRCONV_H_ - -#include "wx/defs.h" -#include "wx/wxchar.h" -#include "wx/buffer.h" - -#ifdef __DIGITALMARS__ -#include "typeinfo.h" -#endif - -#if defined(__VISAGECPP__) && __IBMCPP__ >= 400 -# undef __BSEXCPT__ -#endif - -#include <stdlib.h> - -#if wxUSE_WCHAR_T - -// the error value returned by wxMBConv methods -#define wxCONV_FAILED ((size_t)-1) - -// the default value for some length parameters meaning that the string is -// NUL-terminated -#define wxNO_LEN ((size_t)-1) - -// ---------------------------------------------------------------------------- -// wxMBConv (abstract base class for conversions) -// ---------------------------------------------------------------------------- - -// When deriving a new class from wxMBConv you must reimplement ToWChar() and -// FromWChar() methods which are not pure virtual only for historical reasons, -// don't let the fact that the existing classes implement MB2WC/WC2MB() instead -// confuse you. -// -// You also have to implement Clone() to allow copying the conversions -// polymorphically. -// -// And you might need to override GetMBNulLen() as well. -class WXDLLIMPEXP_BASE wxMBConv -{ -public: - // The functions doing actual conversion from/to narrow to/from wide - // character strings. - // - // On success, the return value is the length (i.e. the number of - // characters, not bytes) of the converted string including any trailing - // L'\0' or (possibly multiple) '\0'(s). If the conversion fails or if - // there is not enough space for everything, including the trailing NUL - // character(s), in the output buffer, wxCONV_FAILED is returned. - // - // In the special case when dstLen is 0 (outputBuf may be NULL then) the - // return value is the length of the needed buffer but nothing happens - // otherwise. If srcLen is wxNO_LEN, the entire string, up to and - // including the trailing NUL(s), is converted, otherwise exactly srcLen - // bytes are. - // - // Typical usage: - // - // size_t dstLen = conv.ToWChar(NULL, 0, src); - // if ( dstLen != wxCONV_FAILED ) - // ... handle error ... - // wchar_t *wbuf = new wchar_t[dstLen]; - // conv.ToWChar(wbuf, dstLen, src); - // - virtual size_t ToWChar(wchar_t *dst, size_t dstLen, - const char *src, size_t srcLen = wxNO_LEN) const; - - virtual size_t FromWChar(char *dst, size_t dstLen, - const wchar_t *src, size_t srcLen = wxNO_LEN) const; - - - // Convenience functions for translating NUL-terminated strings: returns - // the buffer containing the converted string or NULL pointer if the - // conversion failed. - const wxWCharBuffer cMB2WC(const char *in) const; - const wxCharBuffer cWC2MB(const wchar_t *in) const; - - // Convenience functions for converting strings which may contain embedded - // NULs and don't have to be NUL-terminated. - // - // inLen is the length of the buffer including trailing NUL if any: if the - // last 4 bytes of the buffer are all NULs, these functions are more - // efficient as they avoid copying the string, but otherwise a copy is made - // internally which could be quite bad for (very) long strings. - // - // outLen receives, if not NULL, the length of the converted string or 0 if - // the conversion failed (returning 0 and not -1 in this case makes it - // difficult to distinguish between failed conversion and empty input but - // this is done for backwards compatibility) - const wxWCharBuffer - cMB2WC(const char *in, size_t inLen, size_t *outLen) const; - const wxCharBuffer - cWC2MB(const wchar_t *in, size_t inLen, size_t *outLen) const; - - // convenience functions for converting MB or WC to/from wxWin default -#if wxUSE_UNICODE - const wxWCharBuffer cMB2WX(const char *psz) const { return cMB2WC(psz); } - const wxCharBuffer cWX2MB(const wchar_t *psz) const { return cWC2MB(psz); } - const wchar_t* cWC2WX(const wchar_t *psz) const { return psz; } - const wchar_t* cWX2WC(const wchar_t *psz) const { return psz; } -#else // ANSI - const char* cMB2WX(const char *psz) const { return psz; } - const char* cWX2MB(const char *psz) const { return psz; } - const wxCharBuffer cWC2WX(const wchar_t *psz) const { return cWC2MB(psz); } - const wxWCharBuffer cWX2WC(const char *psz) const { return cMB2WC(psz); } -#endif // Unicode/ANSI - - // this function is used in the implementation of cMB2WC() to distinguish - // between the following cases: - // - // a) var width encoding with strings terminated by a single NUL - // (usual multibyte encodings): return 1 in this case - // b) fixed width encoding with 2 bytes/char and so terminated by - // 2 NULs (UTF-16/UCS-2 and variants): return 2 in this case - // c) fixed width encoding with 4 bytes/char and so terminated by - // 4 NULs (UTF-32/UCS-4 and variants): return 4 in this case - // - // anything else is not supported currently and -1 should be returned - virtual size_t GetMBNulLen() const { return 1; } - - // return the maximal value currently returned by GetMBNulLen() for any - // encoding - static size_t GetMaxMBNulLen() { return 4 /* for UTF-32 */; } - - - // The old conversion functions. The existing classes currently mostly - // implement these ones but we're in transition to using To/FromWChar() - // instead and any new classes should implement just the new functions. - // For now, however, we provide default implementation of To/FromWChar() in - // this base class in terms of MB2WC/WC2MB() to avoid having to rewrite all - // the conversions at once. - // - // On success, the return value is the length (i.e. the number of - // characters, not bytes) not counting the trailing NUL(s) of the converted - // string. On failure, (size_t)-1 is returned. In the special case when - // outputBuf is NULL the return value is the same one but nothing is - // written to the buffer. - // - // Note that outLen is the length of the output buffer, not the length of - // the input (which is always supposed to be terminated by one or more - // NULs, as appropriate for the encoding)! - virtual size_t MB2WC(wchar_t *out, const char *in, size_t outLen) const; - virtual size_t WC2MB(char *out, const wchar_t *in, size_t outLen) const; - - - // make a heap-allocated copy of this object - virtual wxMBConv *Clone() const = 0; - - // virtual dtor for any base class - virtual ~wxMBConv(); -}; - -// ---------------------------------------------------------------------------- -// wxMBConvLibc uses standard mbstowcs() and wcstombs() functions for -// conversion (hence it depends on the current locale) -// ---------------------------------------------------------------------------- - -class WXDLLIMPEXP_BASE wxMBConvLibc : public wxMBConv -{ -public: - virtual size_t MB2WC(wchar_t *outputBuf, const char *psz, size_t outputSize) const; - virtual size_t WC2MB(char *outputBuf, const wchar_t *psz, size_t outputSize) const; - - virtual wxMBConv *Clone() const { return new wxMBConvLibc; } -}; - -#ifdef __UNIX__ - -// ---------------------------------------------------------------------------- -// wxConvBrokenFileNames is made for Unix in Unicode mode when -// files are accidentally written in an encoding which is not -// the system encoding. Typically, the system encoding will be -// UTF8 but there might be files stored in ISO8859-1 on disk. -// ---------------------------------------------------------------------------- - -class WXDLLIMPEXP_BASE wxConvBrokenFileNames : public wxMBConv -{ -public: - wxConvBrokenFileNames(const wxChar *charset); - wxConvBrokenFileNames(const wxConvBrokenFileNames& conv) - : wxMBConv(), - m_conv(conv.m_conv ? conv.m_conv->Clone() : NULL) - { - } - virtual ~wxConvBrokenFileNames() { delete m_conv; } - - virtual size_t MB2WC(wchar_t *out, const char *in, size_t outLen) const - { - return m_conv->MB2WC(out, in, outLen); - } - - virtual size_t WC2MB(char *out, const wchar_t *in, size_t outLen) const - { - return m_conv->WC2MB(out, in, outLen); - } - - virtual size_t GetMBNulLen() const - { - // cast needed to call a private function - return m_conv->GetMBNulLen(); - } - - virtual wxMBConv *Clone() const { return new wxConvBrokenFileNames(*this); } - -private: - // the conversion object we forward to - wxMBConv *m_conv; - - DECLARE_NO_ASSIGN_CLASS(wxConvBrokenFileNames) -}; - -#endif // __UNIX__ - -// ---------------------------------------------------------------------------- -// wxMBConvUTF7 (for conversion using UTF7 encoding) -// ---------------------------------------------------------------------------- - -class WXDLLIMPEXP_BASE wxMBConvUTF7 : public wxMBConv -{ -public: - virtual size_t MB2WC(wchar_t *outputBuf, const char *psz, size_t outputSize) const; - virtual size_t WC2MB(char *outputBuf, const wchar_t *psz, size_t outputSize) const; - - virtual wxMBConv *Clone() const { return new wxMBConvUTF7; } -}; - -// ---------------------------------------------------------------------------- -// wxMBConvUTF8 (for conversion using UTF8 encoding) -// ---------------------------------------------------------------------------- - -class WXDLLIMPEXP_BASE wxMBConvUTF8 : public wxMBConv -{ -public: - enum - { - MAP_INVALID_UTF8_NOT = 0, - MAP_INVALID_UTF8_TO_PUA = 1, - MAP_INVALID_UTF8_TO_OCTAL = 2 - }; - - wxMBConvUTF8(int options = MAP_INVALID_UTF8_NOT) : m_options(options) { } - virtual size_t MB2WC(wchar_t *outputBuf, const char *psz, size_t outputSize) const; - virtual size_t WC2MB(char *outputBuf, const wchar_t *psz, size_t outputSize) const; - - virtual wxMBConv *Clone() const { return new wxMBConvUTF8(m_options); } - -private: - int m_options; -}; - -// ---------------------------------------------------------------------------- -// wxMBConvUTF16Base: for both LE and BE variants -// ---------------------------------------------------------------------------- - -class WXDLLIMPEXP_BASE wxMBConvUTF16Base : public wxMBConv -{ -public: - enum { BYTES_PER_CHAR = 2 }; - - virtual size_t GetMBNulLen() const { return BYTES_PER_CHAR; } - -protected: - // return the length of the buffer using srcLen if it's not wxNO_LEN and - // computing the length ourselves if it is; also checks that the length is - // even if specified as we need an entire number of UTF-16 characters and - // returns wxNO_LEN which indicates error if it is odd - static size_t GetLength(const char *src, size_t srcLen); -}; - -// ---------------------------------------------------------------------------- -// wxMBConvUTF16LE (for conversion using UTF16 Little Endian encoding) -// ---------------------------------------------------------------------------- - -class WXDLLIMPEXP_BASE wxMBConvUTF16LE : public wxMBConvUTF16Base -{ -public: - virtual size_t ToWChar(wchar_t *dst, size_t dstLen, - const char *src, size_t srcLen = wxNO_LEN) const; - virtual size_t FromWChar(char *dst, size_t dstLen, - const wchar_t *src, size_t srcLen = wxNO_LEN) const; - virtual wxMBConv *Clone() const { return new wxMBConvUTF16LE; } -}; - -// ---------------------------------------------------------------------------- -// wxMBConvUTF16BE (for conversion using UTF16 Big Endian encoding) -// ---------------------------------------------------------------------------- - -class WXDLLIMPEXP_BASE wxMBConvUTF16BE : public wxMBConvUTF16Base -{ -public: - virtual size_t ToWChar(wchar_t *dst, size_t dstLen, - const char *src, size_t srcLen = wxNO_LEN) const; - virtual size_t FromWChar(char *dst, size_t dstLen, - const wchar_t *src, size_t srcLen = wxNO_LEN) const; - virtual wxMBConv *Clone() const { return new wxMBConvUTF16BE; } -}; - -// ---------------------------------------------------------------------------- -// wxMBConvUTF32Base: base class for both LE and BE variants -// ---------------------------------------------------------------------------- - -class WXDLLIMPEXP_BASE wxMBConvUTF32Base : public wxMBConv -{ -public: - enum { BYTES_PER_CHAR = 4 }; - - virtual size_t GetMBNulLen() const { return BYTES_PER_CHAR; } - -protected: - // this is similar to wxMBConvUTF16Base method with the same name except - // that, of course, it verifies that length is divisible by 4 if given and - // not by 2 - static size_t GetLength(const char *src, size_t srcLen); -}; - -// ---------------------------------------------------------------------------- -// wxMBConvUTF32LE (for conversion using UTF32 Little Endian encoding) -// ---------------------------------------------------------------------------- - -class WXDLLIMPEXP_BASE wxMBConvUTF32LE : public wxMBConvUTF32Base -{ -public: - virtual size_t ToWChar(wchar_t *dst, size_t dstLen, - const char *src, size_t srcLen = wxNO_LEN) const; - virtual size_t FromWChar(char *dst, size_t dstLen, - const wchar_t *src, size_t srcLen = wxNO_LEN) const; - virtual wxMBConv *Clone() const { return new wxMBConvUTF32LE; } -}; - -// ---------------------------------------------------------------------------- -// wxMBConvUTF32BE (for conversion using UTF32 Big Endian encoding) -// ---------------------------------------------------------------------------- - -class WXDLLIMPEXP_BASE wxMBConvUTF32BE : public wxMBConvUTF32Base -{ -public: - virtual size_t ToWChar(wchar_t *dst, size_t dstLen, - const char *src, size_t srcLen = wxNO_LEN) const; - virtual size_t FromWChar(char *dst, size_t dstLen, - const wchar_t *src, size_t srcLen = wxNO_LEN) const; - virtual wxMBConv *Clone() const { return new wxMBConvUTF32BE; } -}; - -// ---------------------------------------------------------------------------- -// wxCSConv (for conversion based on loadable char sets) -// ---------------------------------------------------------------------------- - -#include "wx/fontenc.h" - -class WXDLLIMPEXP_BASE wxCSConv : public wxMBConv -{ -public: - // we can be created either from charset name or from an encoding constant - // but we can't have both at once - wxCSConv(const wxChar *charset); - wxCSConv(wxFontEncoding encoding); - - wxCSConv(const wxCSConv& conv); - virtual ~wxCSConv(); - - wxCSConv& operator=(const wxCSConv& conv); - - virtual size_t ToWChar(wchar_t *dst, size_t dstLen, - const char *src, size_t srcLen = wxNO_LEN) const; - virtual size_t FromWChar(char *dst, size_t dstLen, - const wchar_t *src, size_t srcLen = wxNO_LEN) const; - virtual size_t MB2WC(wchar_t *outputBuf, const char *psz, size_t outputSize) const; - virtual size_t WC2MB(char *outputBuf, const wchar_t *psz, size_t outputSize) const; - virtual size_t GetMBNulLen() const; - - virtual wxMBConv *Clone() const { return new wxCSConv(*this); } - - void Clear(); - -#if wxABI_VERSION >= 20802 - // return true if the conversion could be initilized successfully - bool IsOk() const; -#endif // wx 2.8.2+ - -private: - // common part of all ctors - void Init(); - - // creates m_convReal if necessary - void CreateConvIfNeeded() const; - - // do create m_convReal (unconditionally) - wxMBConv *DoCreate() const; - - // set the name (may be only called when m_name == NULL), makes copy of - // charset string - void SetName(const wxChar *charset); - - - // note that we can't use wxString here because of compilation - // dependencies: we're included from wx/string.h - wxChar *m_name; - wxFontEncoding m_encoding; - - // use CreateConvIfNeeded() before accessing m_convReal! - wxMBConv *m_convReal; - bool m_deferred; -}; - - -// ---------------------------------------------------------------------------- -// declare predefined conversion objects -// ---------------------------------------------------------------------------- - -// conversion to be used with all standard functions affected by locale, e.g. -// strtol(), strftime(), ... -extern WXDLLIMPEXP_DATA_BASE(wxMBConv&) wxConvLibc; - -// conversion ISO-8859-1/UTF-7/UTF-8 <-> wchar_t -extern WXDLLIMPEXP_DATA_BASE(wxCSConv&) wxConvISO8859_1; -extern WXDLLIMPEXP_DATA_BASE(wxMBConvUTF7&) wxConvUTF7; -extern WXDLLIMPEXP_DATA_BASE(wxMBConvUTF8&) wxConvUTF8; - -// conversion used for the file names on the systems where they're not Unicode -// (basically anything except Windows) -// -// this is used by all file functions, can be changed by the application -// -// by default UTF-8 under Mac OS X and wxConvLibc elsewhere (but it's not used -// under Windows normally) -extern WXDLLIMPEXP_DATA_BASE(wxMBConv *) wxConvFileName; - -// backwards compatible define -#define wxConvFile (*wxConvFileName) - -// the current conversion object, may be set to any conversion, is used by -// default in a couple of places inside wx (initially same as wxConvLibc) -extern WXDLLIMPEXP_DATA_BASE(wxMBConv *) wxConvCurrent; - -// the conversion corresponding to the current locale -extern WXDLLIMPEXP_DATA_BASE(wxCSConv&) wxConvLocal; - -// the conversion corresponding to the encoding of the standard UI elements -// -// by default this is the same as wxConvLocal but may be changed if the program -// needs to use a fixed encoding -extern WXDLLIMPEXP_DATA_BASE(wxMBConv *) wxConvUI; - -// ---------------------------------------------------------------------------- -// endianness-dependent conversions -// ---------------------------------------------------------------------------- - -#ifdef WORDS_BIGENDIAN - typedef wxMBConvUTF16BE wxMBConvUTF16; - typedef wxMBConvUTF32BE wxMBConvUTF32; -#else - typedef wxMBConvUTF16LE wxMBConvUTF16; - typedef wxMBConvUTF32LE wxMBConvUTF32; -#endif - -// ---------------------------------------------------------------------------- -// filename conversion macros -// ---------------------------------------------------------------------------- - -// filenames are multibyte on Unix and widechar on Windows -#if defined(__UNIX__) || defined(__WXMAC__) - #define wxMBFILES 1 -#else - #define wxMBFILES 0 -#endif - -#if wxMBFILES && wxUSE_UNICODE - #define wxFNCONV(name) wxConvFileName->cWX2MB(name) - #define wxFNSTRINGCAST wxMBSTRINGCAST -#else -#if defined( __WXOSX__ ) && wxMBFILES - #define wxFNCONV(name) wxConvFileName->cWC2MB( wxConvLocal.cWX2WC(name) ) -#else - #define wxFNCONV(name) name -#endif - #define wxFNSTRINGCAST WXSTRINGCAST -#endif - -#else // !wxUSE_WCHAR_T - -// ---------------------------------------------------------------------------- -// stand-ins in absence of wchar_t -// ---------------------------------------------------------------------------- - -class WXDLLIMPEXP_BASE wxMBConv -{ -public: - const char* cMB2WX(const char *psz) const { return psz; } - const char* cWX2MB(const char *psz) const { return psz; } - wxMBConv *Clone() const { return NULL; } -}; - -#define wxConvFile wxConvLocal -#define wxConvUI wxConvCurrent - -typedef wxMBConv wxCSConv; - -extern WXDLLIMPEXP_DATA_BASE(wxMBConv) wxConvLibc, - wxConvLocal, - wxConvISO8859_1, - wxConvUTF8; -extern WXDLLIMPEXP_DATA_BASE(wxMBConv *) wxConvCurrent; - -#define wxFNCONV(name) name -#define wxFNSTRINGCAST WXSTRINGCAST - -#endif // wxUSE_WCHAR_T/!wxUSE_WCHAR_T - -// ---------------------------------------------------------------------------- -// macros for the most common conversions -// ---------------------------------------------------------------------------- - -#if wxUSE_UNICODE - #define wxConvertWX2MB(s) wxConvCurrent->cWX2MB(s) - #define wxConvertMB2WX(s) wxConvCurrent->cMB2WX(s) - -#if wxABI_VERSION >= 20802 - // these functions should be used when the conversions really, really have - // to succeed (usually because we pass their results to a standard C - // function which would crash if we passed NULL to it), so these functions - // always return a valid pointer if their argument is non-NULL - - // this function safety is achieved by trying wxConvLibc first, wxConvUTF8 - // next if it fails and, finally, wxConvISO8859_1 which always succeeds - extern WXDLLIMPEXP_BASE wxWCharBuffer wxSafeConvertMB2WX(const char *s); - - // this function uses wxConvLibc and wxConvUTF8(MAP_INVALID_UTF8_TO_OCTAL) - // if it fails - extern WXDLLIMPEXP_BASE wxCharBuffer wxSafeConvertWX2MB(const wchar_t *ws); -#endif // wxABI 2.8.2+ -#else // ANSI - // no conversions to do - #define wxConvertWX2MB(s) (s) - #define wxConvertMB2WX(s) (s) - #define wxSafeConvertMB2WX(s) (s) - #define wxSafeConvertWX2MB(s) (s) -#endif // Unicode/ANSI - -#endif // _WX_STRCONV_H_ - diff --git a/wxWidgets/include/wx/stream.h b/wxWidgets/include/wx/stream.h deleted file mode 100644 index e61bc70cd8..0000000000 --- a/wxWidgets/include/wx/stream.h +++ /dev/null @@ -1,609 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/stream.h -// Purpose: stream classes -// Author: Guilhem Lavaux, Guillermo Rodriguez Garcia, Vadim Zeitlin -// Modified by: -// Created: 11/07/98 -// RCS-ID: $Id: stream.h 53135 2008-04-12 02:31:04Z VZ $ -// Copyright: (c) Guilhem Lavaux -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_WXSTREAM_H__ -#define _WX_WXSTREAM_H__ - -#include "wx/defs.h" - -#if wxUSE_STREAMS - -#include <stdio.h> -#include "wx/object.h" -#include "wx/string.h" -#include "wx/filefn.h" // for wxFileOffset, wxInvalidOffset and wxSeekMode - -class WXDLLIMPEXP_FWD_BASE wxStreamBase; -class WXDLLIMPEXP_FWD_BASE wxInputStream; -class WXDLLIMPEXP_FWD_BASE wxOutputStream; - -typedef wxInputStream& (*__wxInputManip)(wxInputStream&); -typedef wxOutputStream& (*__wxOutputManip)(wxOutputStream&); - -WXDLLIMPEXP_BASE wxOutputStream& wxEndL(wxOutputStream& o_stream); - -// ---------------------------------------------------------------------------- -// constants -// ---------------------------------------------------------------------------- - -enum wxStreamError -{ - wxSTREAM_NO_ERROR = 0, // stream is in good state - wxSTREAM_EOF, // EOF reached in Read() or similar - wxSTREAM_WRITE_ERROR, // generic write error - wxSTREAM_READ_ERROR // generic read error -}; - -const int wxEOF = -1; - -// ============================================================================ -// base stream classes: wxInputStream and wxOutputStream -// ============================================================================ - -// --------------------------------------------------------------------------- -// wxStreamBase: common (but non virtual!) base for all stream classes -// --------------------------------------------------------------------------- - -class WXDLLIMPEXP_BASE wxStreamBase -{ -public: - wxStreamBase(); - virtual ~wxStreamBase(); - - // error testing - wxStreamError GetLastError() const { return m_lasterror; } - virtual bool IsOk() const { return GetLastError() == wxSTREAM_NO_ERROR; } - bool operator!() const { return !IsOk(); } - - // reset the stream state - void Reset() { m_lasterror = wxSTREAM_NO_ERROR; } - - // this doesn't make sense for all streams, always test its return value - virtual size_t GetSize() const; - virtual wxFileOffset GetLength() const { return wxInvalidOffset; } - - // returns true if the streams supports seeking to arbitrary offsets - virtual bool IsSeekable() const { return false; } - -protected: - virtual wxFileOffset OnSysSeek(wxFileOffset seek, wxSeekMode mode); - virtual wxFileOffset OnSysTell() const; - - size_t m_lastcount; - wxStreamError m_lasterror; - - friend class wxStreamBuffer; - - DECLARE_NO_COPY_CLASS(wxStreamBase) -}; - -// ---------------------------------------------------------------------------- -// wxInputStream: base class for the input streams -// ---------------------------------------------------------------------------- - -class WXDLLIMPEXP_BASE wxInputStream : public wxStreamBase -{ -public: - // ctor and dtor, nothing exciting - wxInputStream(); - virtual ~wxInputStream(); - - - // IO functions - // ------------ - - // return a character from the stream without removing it, i.e. it will - // still be returned by the next call to GetC() - // - // blocks until something appears in the stream if necessary, if nothing - // ever does (i.e. EOF) LastRead() will return 0 (and the return value is - // undefined), otherwise 1 - virtual char Peek(); - - // return one byte from the stream, blocking until it appears if - // necessary - // - // on success returns a value between 0 - 255, or wxEOF on EOF or error. - int GetC(); - - // read at most the given number of bytes from the stream - // - // there are 2 possible situations here: either there is nothing at all in - // the stream right now in which case Read() blocks until something appears - // (use CanRead() to avoid this) or there is already some data available in - // the stream and then Read() doesn't block but returns just the data it - // can read without waiting for more - // - // in any case, if there are not enough bytes in the stream right now, - // LastRead() value will be less than size but greater than 0. If it is 0, - // it means that EOF has been reached. - virtual wxInputStream& Read(void *buffer, size_t size); - - // copy the entire contents of this stream into streamOut, stopping only - // when EOF is reached or an error occurs - wxInputStream& Read(wxOutputStream& streamOut); - - - // status functions - // ---------------- - - // returns the number of bytes read by the last call to Read(), GetC() or - // Peek() - // - // this should be used to discover whether that call succeeded in reading - // all the requested data or not - virtual size_t LastRead() const { return wxStreamBase::m_lastcount; } - - // returns true if some data is available in the stream right now, so that - // calling Read() wouldn't block - virtual bool CanRead() const; - - // is the stream at EOF? - // - // note that this cannot be really implemented for all streams and - // CanRead() is more reliable than Eof() - virtual bool Eof() const; - - - // write back buffer - // ----------------- - - // put back the specified number of bytes into the stream, they will be - // fetched by the next call to the read functions - // - // returns the number of bytes really stuffed back - size_t Ungetch(const void *buffer, size_t size); - - // put back the specified character in the stream - // - // returns true if ok, false on error - bool Ungetch(char c); - - - // position functions - // ------------------ - - // move the stream pointer to the given position (if the stream supports - // it) - // - // returns wxInvalidOffset on error - virtual wxFileOffset SeekI(wxFileOffset pos, wxSeekMode mode = wxFromStart); - - // return the current position of the stream pointer or wxInvalidOffset - virtual wxFileOffset TellI() const; - - - // stream-like operators - // --------------------- - - wxInputStream& operator>>(wxOutputStream& out) { return Read(out); } - wxInputStream& operator>>(__wxInputManip func) { return func(*this); } - -protected: - // do read up to size bytes of data into the provided buffer - // - // this method should return 0 if EOF has been reached or an error occurred - // (m_lasterror should be set accordingly as well) or the number of bytes - // read - virtual size_t OnSysRead(void *buffer, size_t size) = 0; - - // write-back buffer support - // ------------------------- - - // return the pointer to a buffer big enough to hold sizeNeeded bytes - char *AllocSpaceWBack(size_t sizeNeeded); - - // read up to size data from the write back buffer, return the number of - // bytes read - size_t GetWBack(void *buf, size_t size); - - // write back buffer or NULL if none - char *m_wback; - - // the size of the buffer - size_t m_wbacksize; - - // the current position in the buffer - size_t m_wbackcur; - - friend class wxStreamBuffer; - - DECLARE_NO_COPY_CLASS(wxInputStream) -}; - -// ---------------------------------------------------------------------------- -// wxOutputStream: base for the output streams -// ---------------------------------------------------------------------------- - -class WXDLLIMPEXP_BASE wxOutputStream : public wxStreamBase -{ -public: - wxOutputStream(); - virtual ~wxOutputStream(); - - void PutC(char c); - virtual wxOutputStream& Write(const void *buffer, size_t size); - wxOutputStream& Write(wxInputStream& stream_in); - - virtual wxFileOffset SeekO(wxFileOffset pos, wxSeekMode mode = wxFromStart); - virtual wxFileOffset TellO() const; - - virtual size_t LastWrite() const { return wxStreamBase::m_lastcount; } - - virtual void Sync(); - virtual bool Close() { return true; } - - wxOutputStream& operator<<(wxInputStream& out) { return Write(out); } - wxOutputStream& operator<<( __wxOutputManip func) { return func(*this); } - -protected: - // to be implemented in the derived classes (it should have been pure - // virtual) - virtual size_t OnSysWrite(const void *buffer, size_t bufsize); - - friend class wxStreamBuffer; - - DECLARE_NO_COPY_CLASS(wxOutputStream) -}; - -// ============================================================================ -// helper stream classes -// ============================================================================ - -// --------------------------------------------------------------------------- -// A stream for measuring streamed output -// --------------------------------------------------------------------------- - -class WXDLLIMPEXP_BASE wxCountingOutputStream : public wxOutputStream -{ -public: - wxCountingOutputStream(); - - wxFileOffset GetLength() const; - bool Ok() const { return IsOk(); } - bool IsOk() const { return true; } - -protected: - virtual size_t OnSysWrite(const void *buffer, size_t size); - virtual wxFileOffset OnSysSeek(wxFileOffset pos, wxSeekMode mode); - virtual wxFileOffset OnSysTell() const; - - size_t m_currentPos; - - DECLARE_NO_COPY_CLASS(wxCountingOutputStream) -}; - -// --------------------------------------------------------------------------- -// "Filter" streams -// --------------------------------------------------------------------------- - -class WXDLLIMPEXP_BASE wxFilterInputStream : public wxInputStream -{ -public: - wxFilterInputStream(); - wxFilterInputStream(wxInputStream& stream); - wxFilterInputStream(wxInputStream *stream); - virtual ~wxFilterInputStream(); - - char Peek() { return m_parent_i_stream->Peek(); } - - wxFileOffset GetLength() const { return m_parent_i_stream->GetLength(); } - - wxInputStream *GetFilterInputStream() const { return m_parent_i_stream; } - -protected: - wxInputStream *m_parent_i_stream; - bool m_owns; - - DECLARE_NO_COPY_CLASS(wxFilterInputStream) -}; - -class WXDLLIMPEXP_BASE wxFilterOutputStream : public wxOutputStream -{ -public: - wxFilterOutputStream(); - wxFilterOutputStream(wxOutputStream& stream); - wxFilterOutputStream(wxOutputStream *stream); - virtual ~wxFilterOutputStream(); - - wxFileOffset GetLength() const { return m_parent_o_stream->GetLength(); } - - wxOutputStream *GetFilterOutputStream() const { return m_parent_o_stream; } - - bool Close(); - -protected: - wxOutputStream *m_parent_o_stream; - bool m_owns; - - DECLARE_NO_COPY_CLASS(wxFilterOutputStream) -}; - -enum wxStreamProtocolType -{ - wxSTREAM_PROTOCOL, // wxFileSystem protocol (should be only one) - wxSTREAM_MIMETYPE, // MIME types the stream handles - wxSTREAM_ENCODING, // The HTTP Content-Encodings the stream handles - wxSTREAM_FILEEXT // File extensions the stream handles -}; - -void WXDLLIMPEXP_BASE wxUseFilterClasses(); - -class WXDLLIMPEXP_BASE wxFilterClassFactoryBase : public wxObject -{ -public: - virtual ~wxFilterClassFactoryBase() { } - - wxString GetProtocol() const { return wxString(*GetProtocols()); } - wxString PopExtension(const wxString& location) const; - - virtual const wxChar * const *GetProtocols(wxStreamProtocolType type - = wxSTREAM_PROTOCOL) const = 0; - - bool CanHandle(const wxChar *protocol, - wxStreamProtocolType type - = wxSTREAM_PROTOCOL) const; - -protected: - wxString::size_type FindExtension(const wxChar *location) const; - - DECLARE_ABSTRACT_CLASS(wxFilterClassFactoryBase) -}; - -class WXDLLIMPEXP_BASE wxFilterClassFactory : public wxFilterClassFactoryBase -{ -public: - virtual ~wxFilterClassFactory() { } - - virtual wxFilterInputStream *NewStream(wxInputStream& stream) const = 0; - virtual wxFilterOutputStream *NewStream(wxOutputStream& stream) const = 0; - virtual wxFilterInputStream *NewStream(wxInputStream *stream) const = 0; - virtual wxFilterOutputStream *NewStream(wxOutputStream *stream) const = 0; - - static const wxFilterClassFactory *Find(const wxChar *protocol, - wxStreamProtocolType type - = wxSTREAM_PROTOCOL); - - static const wxFilterClassFactory *GetFirst(); - const wxFilterClassFactory *GetNext() const { return m_next; } - - void PushFront() { Remove(); m_next = sm_first; sm_first = this; } - void Remove(); - -protected: - wxFilterClassFactory() : m_next(this) { } - - wxFilterClassFactory& operator=(const wxFilterClassFactory&) - { return *this; } - -private: - static wxFilterClassFactory *sm_first; - wxFilterClassFactory *m_next; - - DECLARE_ABSTRACT_CLASS(wxFilterClassFactory) -}; - -// ============================================================================ -// buffered streams -// ============================================================================ - -// --------------------------------------------------------------------------- -// Stream buffer: this class can be derived from and passed to -// wxBufferedStreams to implement custom buffering -// --------------------------------------------------------------------------- - -class WXDLLIMPEXP_BASE wxStreamBuffer -{ -public: - enum BufMode - { - read, - write, - read_write - }; - - wxStreamBuffer(wxStreamBase& stream, BufMode mode); - wxStreamBuffer(const wxStreamBuffer& buf); - virtual ~wxStreamBuffer(); - - // Filtered IO - virtual size_t Read(void *buffer, size_t size); - size_t Read(wxStreamBuffer *buf); - virtual size_t Write(const void *buffer, size_t size); - size_t Write(wxStreamBuffer *buf); - - virtual char Peek(); - virtual char GetChar(); - virtual void PutChar(char c); - virtual wxFileOffset Tell() const; - virtual wxFileOffset Seek(wxFileOffset pos, wxSeekMode mode); - - // Buffer control - void ResetBuffer(); - - // NB: the buffer must always be allocated with malloc() if takeOwn is - // true as it will be deallocated by free() - void SetBufferIO(void *start, void *end, bool takeOwnership = false); - void SetBufferIO(void *start, size_t len, bool takeOwnership = false); - void SetBufferIO(size_t bufsize); - void *GetBufferStart() const { return m_buffer_start; } - void *GetBufferEnd() const { return m_buffer_end; } - void *GetBufferPos() const { return m_buffer_pos; } - size_t GetBufferSize() const { return m_buffer_size; } - size_t GetIntPosition() const { return m_buffer_pos - m_buffer_start; } - void SetIntPosition(size_t pos) { m_buffer_pos = m_buffer_start + pos; } - size_t GetLastAccess() const { return m_buffer_end - m_buffer_start; } - size_t GetBytesLeft() const { return m_buffer_end - m_buffer_pos; } - - void Fixed(bool fixed) { m_fixed = fixed; } - void Flushable(bool f) { m_flushable = f; } - - bool FlushBuffer(); - bool FillBuffer(); - size_t GetDataLeft(); - - // misc accessors - wxStreamBase *GetStream() const { return m_stream; } - bool HasBuffer() const { return m_buffer_size != 0; } - - bool IsFixed() const { return m_fixed; } - bool IsFlushable() const { return m_flushable; } - - // only for input/output buffers respectively, returns NULL otherwise - wxInputStream *GetInputStream() const; - wxOutputStream *GetOutputStream() const; - -#if WXWIN_COMPATIBILITY_2_6 - // deprecated, for compatibility only - wxDEPRECATED( wxStreamBase *Stream() ); -#endif // WXWIN_COMPATIBILITY_2_6 - - // this constructs a dummy wxStreamBuffer, used by (and exists for) - // wxMemoryStreams only, don't use! - wxStreamBuffer(BufMode mode); - -protected: - void GetFromBuffer(void *buffer, size_t size); - void PutToBuffer(const void *buffer, size_t size); - - // set the last error to the specified value if we didn't have it before - void SetError(wxStreamError err); - - // common part of several ctors - void Init(); - - // init buffer variables to be empty - void InitBuffer(); - - // free the buffer (always safe to call) - void FreeBuffer(); - - // the buffer itself: the pointers to its start and end and the current - // position in the buffer - char *m_buffer_start, - *m_buffer_end, - *m_buffer_pos; - - // the buffer size - // FIXME: isn't it the same as m_buffer_end - m_buffer_start? (VZ) - size_t m_buffer_size; - - // the stream we're associated with - wxStreamBase *m_stream; - - // its mode - BufMode m_mode; - - // flags - bool m_destroybuf, // deallocate buffer? - m_fixed, - m_flushable; - -private: -// Cannot use -// DECLARE_NO_COPY_CLASS(wxStreamBuffer) -// because copy constructor is explicitly declared above; -// but no copy assignment operator is defined, so declare -// it private to prevent the compiler from defining it: - wxStreamBuffer& operator=(const wxStreamBuffer&); -}; - -// --------------------------------------------------------------------------- -// wxBufferedInputStream -// --------------------------------------------------------------------------- - -class WXDLLIMPEXP_BASE wxBufferedInputStream : public wxFilterInputStream -{ -public: - // if a non NULL buffer is given to the stream, it will be deleted by it - wxBufferedInputStream(wxInputStream& stream, - wxStreamBuffer *buffer = NULL); - virtual ~wxBufferedInputStream(); - - char Peek(); - wxInputStream& Read(void *buffer, size_t size); - - // Position functions - wxFileOffset SeekI(wxFileOffset pos, wxSeekMode mode = wxFromStart); - wxFileOffset TellI() const; - bool IsSeekable() const { return m_parent_i_stream->IsSeekable(); } - - // the buffer given to the stream will be deleted by it - void SetInputStreamBuffer(wxStreamBuffer *buffer); - wxStreamBuffer *GetInputStreamBuffer() const { return m_i_streambuf; } - -#if WXWIN_COMPATIBILITY_2_6 - // deprecated, for compatibility only - wxDEPRECATED( wxStreamBuffer *InputStreamBuffer() const ); -#endif // WXWIN_COMPATIBILITY_2_6 - -protected: - virtual size_t OnSysRead(void *buffer, size_t bufsize); - virtual wxFileOffset OnSysSeek(wxFileOffset seek, wxSeekMode mode); - virtual wxFileOffset OnSysTell() const; - - wxStreamBuffer *m_i_streambuf; - - DECLARE_NO_COPY_CLASS(wxBufferedInputStream) -}; - -// ---------------------------------------------------------------------------- -// wxBufferedOutputStream -// ---------------------------------------------------------------------------- - -class WXDLLIMPEXP_BASE wxBufferedOutputStream : public wxFilterOutputStream -{ -public: - // if a non NULL buffer is given to the stream, it will be deleted by it - wxBufferedOutputStream(wxOutputStream& stream, - wxStreamBuffer *buffer = NULL); - virtual ~wxBufferedOutputStream(); - - wxOutputStream& Write(const void *buffer, size_t size); - - // Position functions - wxFileOffset SeekO(wxFileOffset pos, wxSeekMode mode = wxFromStart); - wxFileOffset TellO() const; - bool IsSeekable() const { return m_parent_o_stream->IsSeekable(); } - - void Sync(); - bool Close(); - - wxFileOffset GetLength() const; - - // the buffer given to the stream will be deleted by it - void SetOutputStreamBuffer(wxStreamBuffer *buffer); - wxStreamBuffer *GetOutputStreamBuffer() const { return m_o_streambuf; } - -#if WXWIN_COMPATIBILITY_2_6 - // deprecated, for compatibility only - wxDEPRECATED( wxStreamBuffer *OutputStreamBuffer() const ); -#endif // WXWIN_COMPATIBILITY_2_6 - -protected: - virtual size_t OnSysWrite(const void *buffer, size_t bufsize); - virtual wxFileOffset OnSysSeek(wxFileOffset seek, wxSeekMode mode); - virtual wxFileOffset OnSysTell() const; - - wxStreamBuffer *m_o_streambuf; - - DECLARE_NO_COPY_CLASS(wxBufferedOutputStream) -}; - -#if WXWIN_COMPATIBILITY_2_6 - inline wxStreamBase *wxStreamBuffer::Stream() { return m_stream; } - inline wxStreamBuffer *wxBufferedInputStream::InputStreamBuffer() const { return m_i_streambuf; } - inline wxStreamBuffer *wxBufferedOutputStream::OutputStreamBuffer() const { return m_o_streambuf; } -#endif // WXWIN_COMPATIBILITY_2_6 - -#endif // wxUSE_STREAMS - -#endif // _WX_WXSTREAM_H__ diff --git a/wxWidgets/include/wx/string.h b/wxWidgets/include/wx/string.h deleted file mode 100644 index 534d607d92..0000000000 --- a/wxWidgets/include/wx/string.h +++ /dev/null @@ -1,1653 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: wx/string.h -// Purpose: wxString and wxArrayString classes -// Author: Vadim Zeitlin -// Modified by: -// Created: 29/01/98 -// RCS-ID: $Id: string.h 61872 2009-09-09 22:37:05Z VZ $ -// Copyright: (c) 1998 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr> -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -/* - Efficient string class [more or less] compatible with MFC CString, - wxWidgets version 1 wxString and std::string and some handy functions - missing from string.h. -*/ - -#ifndef _WX_WXSTRINGH__ -#define _WX_WXSTRINGH__ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -#include "wx/defs.h" // everybody should include this - -#if defined(__WXMAC__) || defined(__VISAGECPP__) - #include <ctype.h> -#endif - -#if defined(__VISAGECPP__) && __IBMCPP__ >= 400 - // problem in VACPP V4 with including stdlib.h multiple times - // strconv includes it anyway -# include <stdio.h> -# include <string.h> -# include <stdarg.h> -# include <limits.h> -#else -# include <string.h> -# include <stdio.h> -# include <stdarg.h> -# include <limits.h> -# include <stdlib.h> -#endif - -#ifdef HAVE_STRCASECMP_IN_STRINGS_H - #include <strings.h> // for strcasecmp() -#endif // HAVE_STRCASECMP_IN_STRINGS_H - -#ifdef __WXPALMOS__ - #include <StringMgr.h> -#endif - -#include "wx/wxchar.h" // for wxChar -#include "wx/buffer.h" // for wxCharBuffer -#include "wx/strconv.h" // for wxConvertXXX() macros and wxMBConv classes - -class WXDLLIMPEXP_FWD_BASE wxString; - -// --------------------------------------------------------------------------- -// macros -// --------------------------------------------------------------------------- - -// casts [unfortunately!] needed to call some broken functions which require -// "char *" instead of "const char *" -#define WXSTRINGCAST (wxChar *)(const wxChar *) -#define wxCSTRINGCAST (wxChar *)(const wxChar *) -#define wxMBSTRINGCAST (char *)(const char *) -#define wxWCSTRINGCAST (wchar_t *)(const wchar_t *) - -// implementation only -#define wxASSERT_VALID_INDEX(i) \ - wxASSERT_MSG( (size_t)(i) <= length(), wxT("invalid index in wxString") ) - -// ---------------------------------------------------------------------------- -// constants -// ---------------------------------------------------------------------------- - -#if WXWIN_COMPATIBILITY_2_6 - -// deprecated in favour of wxString::npos, don't use in new code -// -// maximum possible length for a string means "take all string" everywhere -#define wxSTRING_MAXLEN wxStringBase::npos - -#endif // WXWIN_COMPATIBILITY_2_6 - -// ---------------------------------------------------------------------------- -// global data -// ---------------------------------------------------------------------------- - -// global pointer to empty string -extern WXDLLIMPEXP_DATA_BASE(const wxChar*) wxEmptyString; - -// --------------------------------------------------------------------------- -// global functions complementing standard C string library replacements for -// strlen() and portable strcasecmp() -//--------------------------------------------------------------------------- - -// Use wxXXX() functions from wxchar.h instead! These functions are for -// backwards compatibility only. - -// checks whether the passed in pointer is NULL and if the string is empty -inline bool IsEmpty(const char *p) { return (!p || !*p); } - -// safe version of strlen() (returns 0 if passed NULL pointer) -inline size_t Strlen(const char *psz) - { return psz ? strlen(psz) : 0; } - -// portable strcasecmp/_stricmp -inline int Stricmp(const char *psz1, const char *psz2) -{ -#if defined(__VISUALC__) && defined(__WXWINCE__) - register char c1, c2; - do { - c1 = tolower(*psz1++); - c2 = tolower(*psz2++); - } while ( c1 && (c1 == c2) ); - - return c1 - c2; -#elif defined(__VISUALC__) || ( defined(__MWERKS__) && defined(__INTEL__) ) - return _stricmp(psz1, psz2); -#elif defined(__SC__) - return _stricmp(psz1, psz2); -#elif defined(__SALFORDC__) - return stricmp(psz1, psz2); -#elif defined(__BORLANDC__) - return stricmp(psz1, psz2); -#elif defined(__WATCOMC__) - return stricmp(psz1, psz2); -#elif defined(__DJGPP__) - return stricmp(psz1, psz2); -#elif defined(__EMX__) - return stricmp(psz1, psz2); -#elif defined(__WXPM__) - return stricmp(psz1, psz2); -#elif defined(__WXPALMOS__) || \ - defined(HAVE_STRCASECMP_IN_STRING_H) || \ - defined(HAVE_STRCASECMP_IN_STRINGS_H) || \ - defined(__GNUWIN32__) - return strcasecmp(psz1, psz2); -#elif defined(__MWERKS__) && !defined(__INTEL__) - register char c1, c2; - do { - c1 = tolower(*psz1++); - c2 = tolower(*psz2++); - } while ( c1 && (c1 == c2) ); - - return c1 - c2; -#else - // almost all compilers/libraries provide this function (unfortunately under - // different names), that's why we don't implement our own which will surely - // be more efficient than this code (uncomment to use): - /* - register char c1, c2; - do { - c1 = tolower(*psz1++); - c2 = tolower(*psz2++); - } while ( c1 && (c1 == c2) ); - - return c1 - c2; - */ - - #error "Please define string case-insensitive compare for your OS/compiler" -#endif // OS/compiler -} - -// ---------------------------------------------------------------------------- -// deal with STL/non-STL/non-STL-but-wxUSE_STD_STRING -// ---------------------------------------------------------------------------- - -// in both cases we need to define wxStdString -#if wxUSE_STL || wxUSE_STD_STRING - -#include "wx/beforestd.h" -#include <string> -#include "wx/afterstd.h" - -#if wxUSE_UNICODE - #ifdef HAVE_STD_WSTRING - typedef std::wstring wxStdString; - #else - typedef std::basic_string<wxChar> wxStdString; - #endif -#else - typedef std::string wxStdString; -#endif - -#endif // need <string> - -#if wxUSE_STL - - // we don't need an extra ctor from std::string when copy ctor already does - // the work - #undef wxUSE_STD_STRING - #define wxUSE_STD_STRING 0 - - #if (defined(__GNUG__) && (__GNUG__ < 3)) || \ - (defined(_MSC_VER) && (_MSC_VER <= 1200)) - #define wxSTRING_BASE_HASNT_CLEAR - #endif - - typedef wxStdString wxStringBase; -#else // if !wxUSE_STL - -#if !defined(HAVE_STD_STRING_COMPARE) && \ - (!defined(__WX_SETUP_H__) || wxUSE_STL == 0) - #define HAVE_STD_STRING_COMPARE -#endif - -// --------------------------------------------------------------------------- -// string data prepended with some housekeeping info (used by wxString class), -// is never used directly (but had to be put here to allow inlining) -// --------------------------------------------------------------------------- - -struct WXDLLIMPEXP_BASE wxStringData -{ - int nRefs; // reference count - size_t nDataLength, // actual string length - nAllocLength; // allocated memory size - - // mimics declaration 'wxChar data[nAllocLength]' - wxChar* data() const { return (wxChar*)(this + 1); } - - // empty string has a special ref count so it's never deleted - bool IsEmpty() const { return (nRefs == -1); } - bool IsShared() const { return (nRefs > 1); } - - // lock/unlock - void Lock() { if ( !IsEmpty() ) nRefs++; } - - // VC++ will refuse to inline Unlock but profiling shows that it is wrong -#if defined(__VISUALC__) && (__VISUALC__ >= 1200) - __forceinline -#endif - // VC++ free must take place in same DLL as allocation when using non dll - // run-time library (e.g. Multithreaded instead of Multithreaded DLL) -#if defined(__VISUALC__) && defined(_MT) && !defined(_DLL) - void Unlock() { if ( !IsEmpty() && --nRefs == 0) Free(); } - // we must not inline deallocation since allocation is not inlined - void Free(); -#else - void Unlock() { if ( !IsEmpty() && --nRefs == 0) free(this); } -#endif - - // if we had taken control over string memory (GetWriteBuf), it's - // intentionally put in invalid state - void Validate(bool b) { nRefs = (b ? 1 : 0); } - bool IsValid() const { return (nRefs != 0); } -}; - -class WXDLLIMPEXP_BASE wxStringBase -{ -#if !wxUSE_STL -friend class WXDLLIMPEXP_FWD_BASE wxArrayString; -#endif -public : - // an 'invalid' value for string index, moved to this place due to a CW bug - static const size_t npos; -protected: - // points to data preceded by wxStringData structure with ref count info - wxChar *m_pchData; - - // accessor to string data - wxStringData* GetStringData() const { return (wxStringData*)m_pchData - 1; } - - // string (re)initialization functions - // initializes the string to the empty value (must be called only from - // ctors, use Reinit() otherwise) - void Init() { m_pchData = (wxChar *)wxEmptyString; } - // initializes the string with (a part of) C-string - void InitWith(const wxChar *psz, size_t nPos = 0, size_t nLen = npos); - // as Init, but also frees old data - void Reinit() { GetStringData()->Unlock(); Init(); } - - // memory allocation - // allocates memory for string of length nLen - bool AllocBuffer(size_t nLen); - // copies data to another string - bool AllocCopy(wxString&, int, int) const; - // effectively copies data to string - bool AssignCopy(size_t, const wxChar *); - - // append a (sub)string - bool ConcatSelf(size_t nLen, const wxChar *src, size_t nMaxLen); - bool ConcatSelf(size_t nLen, const wxChar *src) - { return ConcatSelf(nLen, src, nLen); } - - // functions called before writing to the string: they copy it if there - // are other references to our data (should be the only owner when writing) - bool CopyBeforeWrite(); - bool AllocBeforeWrite(size_t); - - // compatibility with wxString - bool Alloc(size_t nLen); -public: - // standard types - typedef wxChar value_type; - typedef wxChar char_type; - typedef size_t size_type; - typedef value_type& reference; - typedef const value_type& const_reference; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type *iterator; - typedef const value_type *const_iterator; - -#define wxSTRING_REVERSE_ITERATOR(name, const_or_not) \ - class name \ - { \ - public: \ - typedef wxChar value_type; \ - typedef const_or_not value_type& reference; \ - typedef const_or_not value_type *pointer; \ - typedef const_or_not value_type *iterator_type; \ - \ - name(iterator_type i) : m_cur(i) { } \ - name(const name& ri) : m_cur(ri.m_cur) { } \ - \ - iterator_type base() const { return m_cur; } \ - \ - reference operator*() const { return *(m_cur - 1); } \ - \ - name& operator++() { --m_cur; return *this; } \ - name operator++(int) { name tmp = *this; --m_cur; return tmp; } \ - name& operator--() { ++m_cur; return *this; } \ - name operator--(int) { name tmp = *this; ++m_cur; return tmp; } \ - \ - bool operator==(name ri) const { return m_cur == ri.m_cur; } \ - bool operator!=(name ri) const { return !(*this == ri); } \ - \ - private: \ - iterator_type m_cur; \ - } - - wxSTRING_REVERSE_ITERATOR(const_reverse_iterator, const); - - #define wxSTRING_CONST - wxSTRING_REVERSE_ITERATOR(reverse_iterator, wxSTRING_CONST); - #undef wxSTRING_CONST - - #undef wxSTRING_REVERSE_ITERATOR - - - // constructors and destructor - // ctor for an empty string - wxStringBase() { Init(); } - // copy ctor - wxStringBase(const wxStringBase& stringSrc) - { - wxASSERT_MSG( stringSrc.GetStringData()->IsValid(), - wxT("did you forget to call UngetWriteBuf()?") ); - - if ( stringSrc.empty() ) { - // nothing to do for an empty string - Init(); - } - else { - m_pchData = stringSrc.m_pchData; // share same data - GetStringData()->Lock(); // => one more copy - } - } - // string containing nRepeat copies of ch - wxStringBase(size_type nRepeat, wxChar ch); - // ctor takes first nLength characters from C string - // (default value of npos means take all the string) - wxStringBase(const wxChar *psz) - { InitWith(psz, 0, npos); } - wxStringBase(const wxChar *psz, size_t nLength) - { InitWith(psz, 0, nLength); } - wxStringBase(const wxChar *psz, - const wxMBConv& WXUNUSED(conv), - size_t nLength = npos) - { InitWith(psz, 0, nLength); } - // take nLen chars starting at nPos - wxStringBase(const wxStringBase& str, size_t nPos, size_t nLen) - { - wxASSERT_MSG( str.GetStringData()->IsValid(), - wxT("did you forget to call UngetWriteBuf()?") ); - Init(); - size_t strLen = str.length() - nPos; nLen = strLen < nLen ? strLen : nLen; - InitWith(str.c_str(), nPos, nLen); - } - // take all characters from pStart to pEnd - wxStringBase(const void *pStart, const void *pEnd); - - // dtor is not virtual, this class must not be inherited from! - ~wxStringBase() - { -#if defined(__VISUALC__) && (__VISUALC__ >= 1200) - //RN - according to the above VC++ does indeed inline this, - //even though it spits out two warnings - #pragma warning (disable:4714) -#endif - - GetStringData()->Unlock(); - } - -#if defined(__VISUALC__) && (__VISUALC__ >= 1200) - //re-enable inlining warning - #pragma warning (default:4714) -#endif - // overloaded assignment - // from another wxString - wxStringBase& operator=(const wxStringBase& stringSrc); - // from a character - wxStringBase& operator=(wxChar ch); - // from a C string - wxStringBase& operator=(const wxChar *psz); - - // return the length of the string - size_type length() const { return GetStringData()->nDataLength; } - // return the length of the string - size_type size() const { return length(); } - // return the maximum size of the string - size_type max_size() const { return npos; } - // resize the string, filling the space with c if c != 0 - void resize(size_t nSize, wxChar ch = wxT('\0')); - // delete the contents of the string - void clear() { erase(0, npos); } - // returns true if the string is empty - bool empty() const { return length() == 0; } - // inform string about planned change in size - void reserve(size_t sz) { Alloc(sz); } - size_type capacity() const { return GetStringData()->nAllocLength; } - - // lib.string.access - // return the character at position n - value_type at(size_type n) const - { wxASSERT_VALID_INDEX( n ); return m_pchData[n]; } - // returns the writable character at position n - reference at(size_type n) - { wxASSERT_VALID_INDEX( n ); CopyBeforeWrite(); return m_pchData[n]; } - - // lib.string.modifiers - // append elements str[pos], ..., str[pos+n] - wxStringBase& append(const wxStringBase& str, size_t pos, size_t n) - { - wxASSERT(pos <= str.length()); - ConcatSelf(n, str.c_str() + pos, str.length() - pos); - return *this; - } - // append a string - wxStringBase& append(const wxStringBase& str) - { ConcatSelf(str.length(), str.c_str()); return *this; } - // append first n (or all if n == npos) characters of sz - wxStringBase& append(const wxChar *sz) - { ConcatSelf(wxStrlen(sz), sz); return *this; } - wxStringBase& append(const wxChar *sz, size_t n) - { ConcatSelf(n, sz); return *this; } - // append n copies of ch - wxStringBase& append(size_t n, wxChar ch); - // append from first to last - wxStringBase& append(const_iterator first, const_iterator last) - { ConcatSelf(last - first, first); return *this; } - - // same as `this_string = str' - wxStringBase& assign(const wxStringBase& str) - { return *this = str; } - // same as ` = str[pos..pos + n] - wxStringBase& assign(const wxStringBase& str, size_t pos, size_t n) - { clear(); return append(str, pos, n); } - // same as `= first n (or all if n == npos) characters of sz' - wxStringBase& assign(const wxChar *sz) - { clear(); return append(sz, wxStrlen(sz)); } - wxStringBase& assign(const wxChar *sz, size_t n) - { clear(); return append(sz, n); } - // same as `= n copies of ch' - wxStringBase& assign(size_t n, wxChar ch) - { clear(); return append(n, ch); } - // assign from first to last - wxStringBase& assign(const_iterator first, const_iterator last) - { clear(); return append(first, last); } - - // first valid index position - const_iterator begin() const { return m_pchData; } - iterator begin(); - // position one after the last valid one - const_iterator end() const { return m_pchData + length(); } - iterator end(); - - // first element of the reversed string - const_reverse_iterator rbegin() const { return const_reverse_iterator(end()); } - reverse_iterator rbegin() { return reverse_iterator(end()); } - // one beyond the end of the reversed string - const_reverse_iterator rend() const { return const_reverse_iterator(begin()); } - reverse_iterator rend() { return reverse_iterator(begin()); } - - // insert another string - wxStringBase& insert(size_t nPos, const wxStringBase& str) - { - wxASSERT( str.GetStringData()->IsValid() ); - return insert(nPos, str.c_str(), str.length()); - } - // insert n chars of str starting at nStart (in str) - wxStringBase& insert(size_t nPos, const wxStringBase& str, size_t nStart, size_t n) - { - wxASSERT( str.GetStringData()->IsValid() ); - wxASSERT( nStart < str.length() ); - size_t strLen = str.length() - nStart; - n = strLen < n ? strLen : n; - return insert(nPos, str.c_str() + nStart, n); - } - // insert first n (or all if n == npos) characters of sz - wxStringBase& insert(size_t nPos, const wxChar *sz, size_t n = npos); - // insert n copies of ch - wxStringBase& insert(size_t nPos, size_t n, wxChar ch) - { return insert(nPos, wxStringBase(n, ch)); } - iterator insert(iterator it, wxChar ch) - { size_t idx = it - begin(); insert(idx, 1, ch); return begin() + idx; } - void insert(iterator it, const_iterator first, const_iterator last) - { insert(it - begin(), first, last - first); } - void insert(iterator it, size_type n, wxChar ch) - { insert(it - begin(), n, ch); } - - // delete characters from nStart to nStart + nLen - wxStringBase& erase(size_type pos = 0, size_type n = npos); - iterator erase(iterator first, iterator last) - { - size_t idx = first - begin(); - erase(idx, last - first); - return begin() + idx; - } - iterator erase(iterator first); - - // explicit conversion to C string (use this with printf()!) - const wxChar* c_str() const { return m_pchData; } - const wxChar* data() const { return m_pchData; } - - // replaces the substring of length nLen starting at nStart - wxStringBase& replace(size_t nStart, size_t nLen, const wxChar* sz); - // replaces the substring of length nLen starting at nStart - wxStringBase& replace(size_t nStart, size_t nLen, const wxStringBase& str) - { return replace(nStart, nLen, str.c_str()); } - // replaces the substring with nCount copies of ch - wxStringBase& replace(size_t nStart, size_t nLen, size_t nCount, wxChar ch); - // replaces a substring with another substring - wxStringBase& replace(size_t nStart, size_t nLen, - const wxStringBase& str, size_t nStart2, size_t nLen2); - // replaces the substring with first nCount chars of sz - wxStringBase& replace(size_t nStart, size_t nLen, - const wxChar* sz, size_t nCount); - wxStringBase& replace(iterator first, iterator last, const_pointer s) - { return replace(first - begin(), last - first, s); } - wxStringBase& replace(iterator first, iterator last, const_pointer s, - size_type n) - { return replace(first - begin(), last - first, s, n); } - wxStringBase& replace(iterator first, iterator last, const wxStringBase& s) - { return replace(first - begin(), last - first, s); } - wxStringBase& replace(iterator first, iterator last, size_type n, wxChar c) - { return replace(first - begin(), last - first, n, c); } - wxStringBase& replace(iterator first, iterator last, - const_iterator first1, const_iterator last1) - { return replace(first - begin(), last - first, first1, last1 - first1); } - - // swap two strings - void swap(wxStringBase& str); - - // All find() functions take the nStart argument which specifies the - // position to start the search on, the default value is 0. All functions - // return npos if there were no match. - - // find a substring - size_t find(const wxStringBase& str, size_t nStart = 0) const; - - // find first n characters of sz - size_t find(const wxChar* sz, size_t nStart = 0, size_t n = npos) const; - - // find the first occurence of character ch after nStart - size_t find(wxChar ch, size_t nStart = 0) const; - - // rfind() family is exactly like find() but works right to left - - // as find, but from the end - size_t rfind(const wxStringBase& str, size_t nStart = npos) const; - - // as find, but from the end - size_t rfind(const wxChar* sz, size_t nStart = npos, - size_t n = npos) const; - // as find, but from the end - size_t rfind(wxChar ch, size_t nStart = npos) const; - - // find first/last occurence of any character in the set - - // as strpbrk() but starts at nStart, returns npos if not found - size_t find_first_of(const wxStringBase& str, size_t nStart = 0) const - { return find_first_of(str.c_str(), nStart); } - // same as above - size_t find_first_of(const wxChar* sz, size_t nStart = 0) const; - size_t find_first_of(const wxChar* sz, size_t nStart, size_t n) const; - // same as find(char, size_t) - size_t find_first_of(wxChar c, size_t nStart = 0) const - { return find(c, nStart); } - // find the last (starting from nStart) char from str in this string - size_t find_last_of (const wxStringBase& str, size_t nStart = npos) const - { return find_last_of(str.c_str(), nStart); } - // same as above - size_t find_last_of (const wxChar* sz, size_t nStart = npos) const; - size_t find_last_of(const wxChar* sz, size_t nStart, size_t n) const; - // same as above - size_t find_last_of(wxChar c, size_t nStart = npos) const - { return rfind(c, nStart); } - - // find first/last occurence of any character not in the set - - // as strspn() (starting from nStart), returns npos on failure - size_t find_first_not_of(const wxStringBase& str, size_t nStart = 0) const - { return find_first_not_of(str.c_str(), nStart); } - // same as above - size_t find_first_not_of(const wxChar* sz, size_t nStart = 0) const; - size_t find_first_not_of(const wxChar* sz, size_t nStart, size_t n) const; - // same as above - size_t find_first_not_of(wxChar ch, size_t nStart = 0) const; - // as strcspn() - size_t find_last_not_of(const wxStringBase& str, size_t nStart = npos) const - { return find_last_not_of(str.c_str(), nStart); } - // same as above - size_t find_last_not_of(const wxChar* sz, size_t nStart = npos) const; - size_t find_last_not_of(const wxChar* sz, size_t nStart, size_t n) const; - // same as above - size_t find_last_not_of(wxChar ch, size_t nStart = npos) const; - - // All compare functions return -1, 0 or 1 if the [sub]string is less, - // equal or greater than the compare() argument. - - // comparison with another string - int compare(const wxStringBase& str) const; - // comparison with a substring - int compare(size_t nStart, size_t nLen, const wxStringBase& str) const; - // comparison of 2 substrings - int compare(size_t nStart, size_t nLen, - const wxStringBase& str, size_t nStart2, size_t nLen2) const; - // comparison with a c string - int compare(const wxChar* sz) const; - // substring comparison with first nCount characters of sz - int compare(size_t nStart, size_t nLen, - const wxChar* sz, size_t nCount = npos) const; - - size_type copy(wxChar* s, size_type n, size_type pos = 0); - - // substring extraction - wxStringBase substr(size_t nStart = 0, size_t nLen = npos) const; - - // string += string - wxStringBase& operator+=(const wxStringBase& s) { return append(s); } - // string += C string - wxStringBase& operator+=(const wxChar *psz) { return append(psz); } - // string += char - wxStringBase& operator+=(wxChar ch) { return append(1, ch); } -}; - -#endif // !wxUSE_STL - -// ---------------------------------------------------------------------------- -// wxString: string class trying to be compatible with std::string, MFC -// CString and wxWindows 1.x wxString all at once -// --------------------------------------------------------------------------- - -class WXDLLIMPEXP_BASE wxString : public wxStringBase -{ -#if !wxUSE_STL -friend class WXDLLIMPEXP_FWD_BASE wxArrayString; -#endif - - // NB: special care was taken in arranging the member functions in such order - // that all inline functions can be effectively inlined, verify that all - // performance critical functions are still inlined if you change order! -private: - // if we hadn't made these operators private, it would be possible to - // compile "wxString s; s = 17;" without any warnings as 17 is implicitly - // converted to char in C and we do have operator=(char) - // - // NB: we don't need other versions (short/long and unsigned) as attempt - // to assign another numeric type to wxString will now result in - // ambiguity between operator=(char) and operator=(int) - wxString& operator=(int); - - // these methods are not implemented - there is _no_ conversion from int to - // string, you're doing something wrong if the compiler wants to call it! - // - // try `s << i' or `s.Printf("%d", i)' instead - wxString(int); - -public: - // constructors and destructor - // ctor for an empty string - wxString() : wxStringBase() { } - // copy ctor - wxString(const wxStringBase& stringSrc) : wxStringBase(stringSrc) { } - wxString(const wxString& stringSrc) : wxStringBase(stringSrc) { } - // string containing nRepeat copies of ch - wxString(wxChar ch, size_t nRepeat = 1) - : wxStringBase(nRepeat, ch) { } - wxString(size_t nRepeat, wxChar ch) - : wxStringBase(nRepeat, ch) { } - // ctor takes first nLength characters from C string - // (default value of npos means take all the string) - wxString(const wxChar *psz) - : wxStringBase(psz ? psz : wxT("")) { } - wxString(const wxChar *psz, size_t nLength) - : wxStringBase(psz, nLength) { } - wxString(const wxChar *psz, - const wxMBConv& WXUNUSED(conv), - size_t nLength = npos) - : wxStringBase(psz, nLength == npos ? wxStrlen(psz) : nLength) { } - - // even if we're not built with wxUSE_STL == 1 it is very convenient to allow - // implicit conversions from std::string to wxString as this allows to use - // the same strings in non-GUI and GUI code, however we don't want to - // unconditionally add this ctor as it would make wx lib dependent on - // libstdc++ on some Linux versions which is bad, so instead we ask the - // client code to define this wxUSE_STD_STRING symbol if they need it -#if wxUSE_STD_STRING - wxString(const wxStdString& s) - : wxStringBase(s.c_str()) { } -#endif // wxUSE_STD_STRING - -#if wxUSE_UNICODE - // from multibyte string - wxString(const char *psz, const wxMBConv& conv, size_t nLength = npos); - // from wxWCharBuffer (i.e. return from wxGetString) - wxString(const wxWCharBuffer& psz) : wxStringBase(psz.data()) { } -#else // ANSI - // from C string (for compilers using unsigned char) - wxString(const unsigned char* psz) - : wxStringBase((const char*)psz) { } - // from part of C string (for compilers using unsigned char) - wxString(const unsigned char* psz, size_t nLength) - : wxStringBase((const char*)psz, nLength) { } - -#if wxUSE_WCHAR_T - // from wide (Unicode) string - wxString(const wchar_t *pwz, - const wxMBConv& conv = wxConvLibc, - size_t nLength = npos); -#endif // !wxUSE_WCHAR_T - - // from wxCharBuffer - wxString(const wxCharBuffer& psz) - : wxStringBase(psz) { } -#endif // Unicode/ANSI - - // generic attributes & operations - // as standard strlen() - size_t Len() const { return length(); } - // string contains any characters? - bool IsEmpty() const { return empty(); } - // empty string is "false", so !str will return true - bool operator!() const { return empty(); } - // truncate the string to given length - wxString& Truncate(size_t uiLen); - // empty string contents - void Empty() - { - Truncate(0); - - wxASSERT_MSG( empty(), wxT("string not empty after call to Empty()?") ); - } - // empty the string and free memory - void Clear() - { - wxString tmp(wxEmptyString); - swap(tmp); - } - - // contents test - // Is an ascii value - bool IsAscii() const; - // Is a number - bool IsNumber() const; - // Is a word - bool IsWord() const; - - // data access (all indexes are 0 based) - // read access - wxChar GetChar(size_t n) const - { return at(n); } - // read/write access - wxChar& GetWritableChar(size_t n) - { return at(n); } - // write access - void SetChar(size_t n, wxChar ch) - { at(n) = ch; } - - // get last character - wxChar Last() const - { - wxASSERT_MSG( !empty(), wxT("wxString: index out of bounds") ); - - return at(length() - 1); - } - - // get writable last character - wxChar& Last() - { - wxASSERT_MSG( !empty(), wxT("wxString: index out of bounds") ); - return at(length() - 1); - } - - /* - Note that we we must define all of the overloads below to avoid - ambiguity when using str[0]. Also note that for a conforming compiler we - don't need const version of operatorp[] at all as indexed access to - const string is provided by implicit conversion to "const wxChar *" - below and defining them would only result in ambiguities, but some other - compilers refuse to compile "str[0]" without them. - */ - -#if defined(__BORLANDC__) || defined(__WATCOMC__) || defined(__MWERKS__) - wxChar operator[](int n) const - { return wxStringBase::at(n); } - wxChar operator[](size_type n) const - { return wxStringBase::at(n); } -#ifndef wxSIZE_T_IS_UINT - wxChar operator[](unsigned int n) const - { return wxStringBase::at(n); } -#endif // size_t != unsigned int -#endif // broken compiler - - - // operator versions of GetWriteableChar() - wxChar& operator[](int n) - { return wxStringBase::at(n); } - wxChar& operator[](size_type n) - { return wxStringBase::at(n); } -#ifndef wxSIZE_T_IS_UINT - wxChar& operator[](unsigned int n) - { return wxStringBase::at(n); } -#endif // size_t != unsigned int - - // implicit conversion to C string - operator const wxChar*() const { return c_str(); } - - // identical to c_str(), for wxWin 1.6x compatibility - const wxChar* wx_str() const { return c_str(); } - // identical to c_str(), for MFC compatibility - const wxChar* GetData() const { return c_str(); } - -#if wxABI_VERSION >= 20804 - // conversion to *non-const* multibyte or widestring buffer; modifying - // returned buffer won't affect the string, these methods are only useful - // for passing values to const-incorrect functions - wxWritableCharBuffer char_str(const wxMBConv& conv = wxConvLibc) const - { return mb_str(conv); } -#if wxUSE_WCHAR_T - wxWritableWCharBuffer wchar_str() const { return wc_str(wxConvLibc); } -#endif -#endif // wxABI_VERSION >= 20804 - - // conversion to/from plain (i.e. 7 bit) ASCII: this is useful for - // converting numbers or strings which are certain not to contain special - // chars (typically system functions, X atoms, environment variables etc.) - // - // the behaviour of these functions with the strings containing anything - // else than 7 bit ASCII characters is undefined, use at your own risk. -#if wxUSE_UNICODE - static wxString FromAscii(const char *ascii); // string - static wxString FromAscii(const char ascii); // char - const wxCharBuffer ToAscii() const; -#else // ANSI - static wxString FromAscii(const char *ascii) { return wxString( ascii ); } - static wxString FromAscii(const char ascii) { return wxString( ascii ); } - const char *ToAscii() const { return c_str(); } -#endif // Unicode/!Unicode - -#if wxABI_VERSION >= 20804 - // conversion to/from UTF-8: -#if wxUSE_UNICODE - static wxString FromUTF8(const char *utf8) - { return wxString(utf8, wxConvUTF8); } - static wxString FromUTF8(const char *utf8, size_t len) - { return wxString(utf8, wxConvUTF8, len); } - const wxCharBuffer utf8_str() const { return mb_str(wxConvUTF8); } - const wxCharBuffer ToUTF8() const { return utf8_str(); } -#elif wxUSE_WCHAR_T // ANSI - static wxString FromUTF8(const char *utf8) - { return wxString(wxConvUTF8.cMB2WC(utf8)); } - static wxString FromUTF8(const char *utf8, size_t len) - { - size_t wlen; - wxWCharBuffer buf(wxConvUTF8.cMB2WC(utf8, len == npos ? wxNO_LEN : len, &wlen)); - return wxString(buf.data(), wxConvLibc, wlen); - } - const wxCharBuffer utf8_str() const - { return wxConvUTF8.cWC2MB(wc_str(wxConvLibc)); } - const wxCharBuffer ToUTF8() const { return utf8_str(); } -#endif // Unicode/ANSI -#endif // wxABI_VERSION >= 20804 - -#if wxABI_VERSION >= 20804 - // functions for storing binary data in wxString: -#if wxUSE_UNICODE - static wxString From8BitData(const char *data, size_t len) - { return wxString(data, wxConvISO8859_1, len); } - // version for NUL-terminated data: - static wxString From8BitData(const char *data) - { return wxString(data, wxConvISO8859_1); } - const wxCharBuffer To8BitData() const { return mb_str(wxConvISO8859_1); } -#else // ANSI - static wxString From8BitData(const char *data, size_t len) - { return wxString(data, len); } - // version for NUL-terminated data: - static wxString From8BitData(const char *data) - { return wxString(data); } - const char *To8BitData() const { return c_str(); } -#endif // Unicode/ANSI -#endif // wxABI_VERSION >= 20804 - - // conversions with (possible) format conversions: have to return a - // buffer with temporary data - // - // the functions defined (in either Unicode or ANSI) mode are mb_str() to - // return an ANSI (multibyte) string, wc_str() to return a wide string and - // fn_str() to return a string which should be used with the OS APIs - // accepting the file names. The return value is always the same, but the - // type differs because a function may either return pointer to the buffer - // directly or have to use intermediate buffer for translation. -#if wxUSE_UNICODE - const wxCharBuffer mb_str(const wxMBConv& conv = wxConvLibc) const; - - const wxWX2MBbuf mbc_str() const { return mb_str(*wxConvCurrent); } - - const wxChar* wc_str() const { return c_str(); } - - // for compatibility with !wxUSE_UNICODE version - const wxChar* wc_str(const wxMBConv& WXUNUSED(conv)) const { return c_str(); } - -#if wxMBFILES - const wxCharBuffer fn_str() const { return mb_str(wxConvFile); } -#else // !wxMBFILES - const wxChar* fn_str() const { return c_str(); } -#endif // wxMBFILES/!wxMBFILES -#else // ANSI - const wxChar* mb_str() const { return c_str(); } - - // for compatibility with wxUSE_UNICODE version - const wxChar* mb_str(const wxMBConv& WXUNUSED(conv)) const { return c_str(); } - - const wxWX2MBbuf mbc_str() const { return mb_str(); } - -#if wxUSE_WCHAR_T - const wxWCharBuffer wc_str(const wxMBConv& conv) const; -#endif // wxUSE_WCHAR_T -#ifdef __WXOSX__ - const wxCharBuffer fn_str() const { return wxConvFile.cWC2WX( wc_str( wxConvLocal ) ); } -#else - const wxChar* fn_str() const { return c_str(); } -#endif -#endif // Unicode/ANSI - - // overloaded assignment - // from another wxString - wxString& operator=(const wxStringBase& stringSrc) - { return (wxString&)wxStringBase::operator=(stringSrc); } - // from a character - wxString& operator=(wxChar ch) - { return (wxString&)wxStringBase::operator=(ch); } - // from a C string - STL probably will crash on NULL, - // so we need to compensate in that case -#if wxUSE_STL - wxString& operator=(const wxChar *psz) - { if(psz) wxStringBase::operator=(psz); else Clear(); return *this; } -#else - wxString& operator=(const wxChar *psz) - { return (wxString&)wxStringBase::operator=(psz); } -#endif - -#if wxUSE_UNICODE - // from wxWCharBuffer - wxString& operator=(const wxWCharBuffer& psz) - { (void) operator=((const wchar_t *)psz); return *this; } -#else // ANSI - // from another kind of C string - wxString& operator=(const unsigned char* psz); -#if wxUSE_WCHAR_T - // from a wide string - wxString& operator=(const wchar_t *pwz); -#endif - // from wxCharBuffer - wxString& operator=(const wxCharBuffer& psz) - { (void) operator=((const char *)psz); return *this; } -#endif // Unicode/ANSI - - // string concatenation - // in place concatenation - /* - Concatenate and return the result. Note that the left to right - associativity of << allows to write things like "str << str1 << str2 - << ..." (unlike with +=) - */ - // string += string - wxString& operator<<(const wxString& s) - { -#if !wxUSE_STL - wxASSERT_MSG( s.GetStringData()->IsValid(), - wxT("did you forget to call UngetWriteBuf()?") ); -#endif - - append(s); - return *this; - } - // string += C string - wxString& operator<<(const wxChar *psz) - { append(psz); return *this; } - // string += char - wxString& operator<<(wxChar ch) { append(1, ch); return *this; } - - // string += buffer (i.e. from wxGetString) -#if wxUSE_UNICODE - wxString& operator<<(const wxWCharBuffer& s) - { (void)operator<<((const wchar_t *)s); return *this; } - void operator+=(const wxWCharBuffer& s) - { (void)operator<<((const wchar_t *)s); } -#else // !wxUSE_UNICODE - wxString& operator<<(const wxCharBuffer& s) - { (void)operator<<((const char *)s); return *this; } - void operator+=(const wxCharBuffer& s) - { (void)operator<<((const char *)s); } -#endif // wxUSE_UNICODE/!wxUSE_UNICODE - - // string += C string - wxString& Append(const wxString& s) - { - // test for empty() to share the string if possible - if ( empty() ) - *this = s; - else - append(s); - return *this; - } - wxString& Append(const wxChar* psz) - { append(psz); return *this; } - // append count copies of given character - wxString& Append(wxChar ch, size_t count = 1u) - { append(count, ch); return *this; } - wxString& Append(const wxChar* psz, size_t nLen) - { append(psz, nLen); return *this; } - - // prepend a string, return the string itself - wxString& Prepend(const wxString& str) - { *this = str + *this; return *this; } - - // non-destructive concatenation - // two strings - friend wxString WXDLLIMPEXP_BASE operator+(const wxString& string1, - const wxString& string2); - // string with a single char - friend wxString WXDLLIMPEXP_BASE operator+(const wxString& string, wxChar ch); - // char with a string - friend wxString WXDLLIMPEXP_BASE operator+(wxChar ch, const wxString& string); - // string with C string - friend wxString WXDLLIMPEXP_BASE operator+(const wxString& string, - const wxChar *psz); - // C string with string - friend wxString WXDLLIMPEXP_BASE operator+(const wxChar *psz, - const wxString& string); - - // stream-like functions - // insert an int into string - wxString& operator<<(int i) - { return (*this) << Format(wxT("%d"), i); } - // insert an unsigned int into string - wxString& operator<<(unsigned int ui) - { return (*this) << Format(wxT("%u"), ui); } - // insert a long into string - wxString& operator<<(long l) - { return (*this) << Format(wxT("%ld"), l); } - // insert an unsigned long into string - wxString& operator<<(unsigned long ul) - { return (*this) << Format(wxT("%lu"), ul); } -#if defined wxLongLong_t && !defined wxLongLongIsLong - // insert a long long if they exist and aren't longs - wxString& operator<<(wxLongLong_t ll) - { - const wxChar *fmt = wxT("%") wxLongLongFmtSpec wxT("d"); - return (*this) << Format(fmt, ll); - } - // insert an unsigned long long - wxString& operator<<(wxULongLong_t ull) - { - const wxChar *fmt = wxT("%") wxLongLongFmtSpec wxT("u"); - return (*this) << Format(fmt , ull); - } -#endif - // insert a float into string - wxString& operator<<(float f) - { return (*this) << Format(wxT("%f"), f); } - // insert a double into string - wxString& operator<<(double d) - { return (*this) << Format(wxT("%g"), d); } - - // string comparison - // case-sensitive comparison (returns a value < 0, = 0 or > 0) - int Cmp(const wxChar *psz) const; - int Cmp(const wxString& s) const; - // same as Cmp() but not case-sensitive - int CmpNoCase(const wxChar *psz) const; - int CmpNoCase(const wxString& s) const; - // test for the string equality, either considering case or not - // (if compareWithCase then the case matters) - bool IsSameAs(const wxChar *psz, bool compareWithCase = true) const - { return (compareWithCase ? Cmp(psz) : CmpNoCase(psz)) == 0; } - // comparison with a single character: returns true if equal - bool IsSameAs(wxChar c, bool compareWithCase = true) const - { - return (length() == 1) && (compareWithCase ? GetChar(0u) == c - : wxToupper(GetChar(0u)) == wxToupper(c)); - } - - // simple sub-string extraction - // return substring starting at nFirst of length nCount (or till the end - // if nCount = default value) - wxString Mid(size_t nFirst, size_t nCount = npos) const; - - // operator version of Mid() - wxString operator()(size_t start, size_t len) const - { return Mid(start, len); } - - // check if the string starts with the given prefix and return the rest - // of the string in the provided pointer if it is not NULL; otherwise - // return false - bool StartsWith(const wxChar *prefix, wxString *rest = NULL) const; - // check if the string ends with the given suffix and return the - // beginning of the string before the suffix in the provided pointer if - // it is not NULL; otherwise return false - bool EndsWith(const wxChar *suffix, wxString *rest = NULL) const; - - // get first nCount characters - wxString Left(size_t nCount) const; - // get last nCount characters - wxString Right(size_t nCount) const; - // get all characters before the first occurance of ch - // (returns the whole string if ch not found) - wxString BeforeFirst(wxChar ch) const; - // get all characters before the last occurence of ch - // (returns empty string if ch not found) - wxString BeforeLast(wxChar ch) const; - // get all characters after the first occurence of ch - // (returns empty string if ch not found) - wxString AfterFirst(wxChar ch) const; - // get all characters after the last occurence of ch - // (returns the whole string if ch not found) - wxString AfterLast(wxChar ch) const; - - // for compatibility only, use more explicitly named functions above - wxString Before(wxChar ch) const { return BeforeLast(ch); } - wxString After(wxChar ch) const { return AfterFirst(ch); } - - // case conversion - // convert to upper case in place, return the string itself - wxString& MakeUpper(); - // convert to upper case, return the copy of the string - // Here's something to remember: BC++ doesn't like returns in inlines. - wxString Upper() const ; - // convert to lower case in place, return the string itself - wxString& MakeLower(); - // convert to lower case, return the copy of the string - wxString Lower() const ; - - // trimming/padding whitespace (either side) and truncating - // remove spaces from left or from right (default) side - wxString& Trim(bool bFromRight = true); - // add nCount copies chPad in the beginning or at the end (default) - wxString& Pad(size_t nCount, wxChar chPad = wxT(' '), bool bFromRight = true); - - // searching and replacing - // searching (return starting index, or -1 if not found) - int Find(wxChar ch, bool bFromEnd = false) const; // like strchr/strrchr - // searching (return starting index, or -1 if not found) - int Find(const wxChar *pszSub) const; // like strstr - // replace first (or all of bReplaceAll) occurences of substring with - // another string, returns the number of replacements made - size_t Replace(const wxChar *szOld, - const wxChar *szNew, - bool bReplaceAll = true); - - // check if the string contents matches a mask containing '*' and '?' - bool Matches(const wxChar *szMask) const; - - // conversion to numbers: all functions return true only if the whole - // string is a number and put the value of this number into the pointer - // provided, the base is the numeric base in which the conversion should be - // done and must be comprised between 2 and 36 or be 0 in which case the - // standard C rules apply (leading '0' => octal, "0x" => hex) - // convert to a signed integer - bool ToLong(long *val, int base = 10) const; - // convert to an unsigned integer - bool ToULong(unsigned long *val, int base = 10) const; - // convert to wxLongLong -#if defined(wxLongLong_t) - bool ToLongLong(wxLongLong_t *val, int base = 10) const; - // convert to wxULongLong - bool ToULongLong(wxULongLong_t *val, int base = 10) const; -#endif // wxLongLong_t - // convert to a double - bool ToDouble(double *val) const; - - - - // formatted input/output - // as sprintf(), returns the number of characters written or < 0 on error - // (take 'this' into account in attribute parameter count) - int Printf(const wxChar *pszFormat, ...) ATTRIBUTE_PRINTF_2; - // as vprintf(), returns the number of characters written or < 0 on error - int PrintfV(const wxChar* pszFormat, va_list argptr); - - // returns the string containing the result of Printf() to it - static wxString Format(const wxChar *pszFormat, ...) ATTRIBUTE_PRINTF_1; - // the same as above, but takes a va_list - static wxString FormatV(const wxChar *pszFormat, va_list argptr); - - // raw access to string memory - // ensure that string has space for at least nLen characters - // only works if the data of this string is not shared - bool Alloc(size_t nLen) { reserve(nLen); /*return capacity() >= nLen;*/ return true; } - // minimize the string's memory - // only works if the data of this string is not shared - bool Shrink(); -#if !wxUSE_STL - // get writable buffer of at least nLen bytes. Unget() *must* be called - // a.s.a.p. to put string back in a reasonable state! - wxChar *GetWriteBuf(size_t nLen); - // call this immediately after GetWriteBuf() has been used - void UngetWriteBuf(); - void UngetWriteBuf(size_t nLen); -#endif - - // wxWidgets version 1 compatibility functions - - // use Mid() - wxString SubString(size_t from, size_t to) const - { return Mid(from, (to - from + 1)); } - // values for second parameter of CompareTo function - enum caseCompare {exact, ignoreCase}; - // values for first parameter of Strip function - enum stripType {leading = 0x1, trailing = 0x2, both = 0x3}; - - // use Printf() - // (take 'this' into account in attribute parameter count) - int sprintf(const wxChar *pszFormat, ...) ATTRIBUTE_PRINTF_2; - - // use Cmp() - inline int CompareTo(const wxChar* psz, caseCompare cmp = exact) const - { return cmp == exact ? Cmp(psz) : CmpNoCase(psz); } - - // use Len - size_t Length() const { return length(); } - // Count the number of characters - int Freq(wxChar ch) const; - // use MakeLower - void LowerCase() { MakeLower(); } - // use MakeUpper - void UpperCase() { MakeUpper(); } - // use Trim except that it doesn't change this string - wxString Strip(stripType w = trailing) const; - - // use Find (more general variants not yet supported) - size_t Index(const wxChar* psz) const { return Find(psz); } - size_t Index(wxChar ch) const { return Find(ch); } - // use Truncate - wxString& Remove(size_t pos) { return Truncate(pos); } - wxString& RemoveLast(size_t n = 1) { return Truncate(length() - n); } - - wxString& Remove(size_t nStart, size_t nLen) - { return (wxString&)erase( nStart, nLen ); } - - // use Find() - int First( const wxChar ch ) const { return Find(ch); } - int First( const wxChar* psz ) const { return Find(psz); } - int First( const wxString &str ) const { return Find(str); } - int Last( const wxChar ch ) const { return Find(ch, true); } - bool Contains(const wxString& str) const { return Find(str) != wxNOT_FOUND; } - - // use empty() - bool IsNull() const { return empty(); } - - // std::string compatibility functions - - // take nLen chars starting at nPos - wxString(const wxString& str, size_t nPos, size_t nLen) - : wxStringBase(str, nPos, nLen) { } - // take all characters from pStart to pEnd - wxString(const void *pStart, const void *pEnd) - : wxStringBase((const wxChar*)pStart, (const wxChar*)pEnd) { } -#if wxUSE_STL - wxString(const_iterator first, const_iterator last) - : wxStringBase(first, last) { } -#endif - - // lib.string.modifiers - // append elements str[pos], ..., str[pos+n] - wxString& append(const wxString& str, size_t pos, size_t n) - { return (wxString&)wxStringBase::append(str, pos, n); } - // append a string - wxString& append(const wxString& str) - { return (wxString&)wxStringBase::append(str); } - // append first n (or all if n == npos) characters of sz - wxString& append(const wxChar *sz) - { return (wxString&)wxStringBase::append(sz); } - wxString& append(const wxChar *sz, size_t n) - { return (wxString&)wxStringBase::append(sz, n); } - // append n copies of ch - wxString& append(size_t n, wxChar ch) - { return (wxString&)wxStringBase::append(n, ch); } - // append from first to last - wxString& append(const_iterator first, const_iterator last) - { return (wxString&)wxStringBase::append(first, last); } - - // same as `this_string = str' - wxString& assign(const wxString& str) - { return (wxString&)wxStringBase::assign(str); } - // same as ` = str[pos..pos + n] - wxString& assign(const wxString& str, size_t pos, size_t n) - { return (wxString&)wxStringBase::assign(str, pos, n); } - // same as `= first n (or all if n == npos) characters of sz' - wxString& assign(const wxChar *sz) - { return (wxString&)wxStringBase::assign(sz); } - wxString& assign(const wxChar *sz, size_t n) - { return (wxString&)wxStringBase::assign(sz, n); } - // same as `= n copies of ch' - wxString& assign(size_t n, wxChar ch) - { return (wxString&)wxStringBase::assign(n, ch); } - // assign from first to last - wxString& assign(const_iterator first, const_iterator last) - { return (wxString&)wxStringBase::assign(first, last); } - - // string comparison -#if !defined(HAVE_STD_STRING_COMPARE) - int compare(const wxStringBase& str) const; - // comparison with a substring - int compare(size_t nStart, size_t nLen, const wxStringBase& str) const; - // comparison of 2 substrings - int compare(size_t nStart, size_t nLen, - const wxStringBase& str, size_t nStart2, size_t nLen2) const; - // just like strcmp() - int compare(const wxChar* sz) const; - // substring comparison with first nCount characters of sz - int compare(size_t nStart, size_t nLen, - const wxChar* sz, size_t nCount = npos) const; -#endif // !defined HAVE_STD_STRING_COMPARE - - // insert another string - wxString& insert(size_t nPos, const wxString& str) - { return (wxString&)wxStringBase::insert(nPos, str); } - // insert n chars of str starting at nStart (in str) - wxString& insert(size_t nPos, const wxString& str, size_t nStart, size_t n) - { return (wxString&)wxStringBase::insert(nPos, str, nStart, n); } - // insert first n (or all if n == npos) characters of sz - wxString& insert(size_t nPos, const wxChar *sz) - { return (wxString&)wxStringBase::insert(nPos, sz); } - wxString& insert(size_t nPos, const wxChar *sz, size_t n) - { return (wxString&)wxStringBase::insert(nPos, sz, n); } - // insert n copies of ch - wxString& insert(size_t nPos, size_t n, wxChar ch) - { return (wxString&)wxStringBase::insert(nPos, n, ch); } - iterator insert(iterator it, wxChar ch) - { return wxStringBase::insert(it, ch); } - void insert(iterator it, const_iterator first, const_iterator last) - { wxStringBase::insert(it, first, last); } - void insert(iterator it, size_type n, wxChar ch) - { wxStringBase::insert(it, n, ch); } - - // delete characters from nStart to nStart + nLen - wxString& erase(size_type pos = 0, size_type n = npos) - { return (wxString&)wxStringBase::erase(pos, n); } - iterator erase(iterator first, iterator last) - { return wxStringBase::erase(first, last); } - iterator erase(iterator first) - { return wxStringBase::erase(first); } - -#ifdef wxSTRING_BASE_HASNT_CLEAR - void clear() { erase(); } -#endif - - // replaces the substring of length nLen starting at nStart - wxString& replace(size_t nStart, size_t nLen, const wxChar* sz) - { return (wxString&)wxStringBase::replace(nStart, nLen, sz); } - // replaces the substring of length nLen starting at nStart - wxString& replace(size_t nStart, size_t nLen, const wxString& str) - { return (wxString&)wxStringBase::replace(nStart, nLen, str); } - // replaces the substring with nCount copies of ch - wxString& replace(size_t nStart, size_t nLen, size_t nCount, wxChar ch) - { return (wxString&)wxStringBase::replace(nStart, nLen, nCount, ch); } - // replaces a substring with another substring - wxString& replace(size_t nStart, size_t nLen, - const wxString& str, size_t nStart2, size_t nLen2) - { return (wxString&)wxStringBase::replace(nStart, nLen, str, - nStart2, nLen2); } - // replaces the substring with first nCount chars of sz - wxString& replace(size_t nStart, size_t nLen, - const wxChar* sz, size_t nCount) - { return (wxString&)wxStringBase::replace(nStart, nLen, sz, nCount); } - wxString& replace(iterator first, iterator last, const_pointer s) - { return (wxString&)wxStringBase::replace(first, last, s); } - wxString& replace(iterator first, iterator last, const_pointer s, - size_type n) - { return (wxString&)wxStringBase::replace(first, last, s, n); } - wxString& replace(iterator first, iterator last, const wxString& s) - { return (wxString&)wxStringBase::replace(first, last, s); } - wxString& replace(iterator first, iterator last, size_type n, wxChar c) - { return (wxString&)wxStringBase::replace(first, last, n, c); } - wxString& replace(iterator first, iterator last, - const_iterator first1, const_iterator last1) - { return (wxString&)wxStringBase::replace(first, last, first1, last1); } - - // string += string - wxString& operator+=(const wxString& s) - { return (wxString&)wxStringBase::operator+=(s); } - // string += C string - wxString& operator+=(const wxChar *psz) - { return (wxString&)wxStringBase::operator+=(psz); } - // string += char - wxString& operator+=(wxChar ch) - { return (wxString&)wxStringBase::operator+=(ch); } -}; - -// notice that even though for many compilers the friend declarations above are -// enough, from the point of view of C++ standard we must have the declarations -// here as friend ones are not injected in the enclosing namespace and without -// them the code fails to compile with conforming compilers such as xlC or g++4 -wxString WXDLLIMPEXP_BASE operator+(const wxString& string1, const wxString& string2); -wxString WXDLLIMPEXP_BASE operator+(const wxString& string, wxChar ch); -wxString WXDLLIMPEXP_BASE operator+(wxChar ch, const wxString& string); -wxString WXDLLIMPEXP_BASE operator+(const wxString& string, const wxChar *psz); -wxString WXDLLIMPEXP_BASE operator+(const wxChar *psz, const wxString& string); - - -// define wxArrayString, for compatibility -#if WXWIN_COMPATIBILITY_2_4 && !wxUSE_STL - #include "wx/arrstr.h" -#endif - -#if wxUSE_STL - // return an empty wxString (not very useful with wxUSE_STL == 1) - inline const wxString wxGetEmptyString() { return wxString(); } -#else // !wxUSE_STL - // return an empty wxString (more efficient than wxString() here) - inline const wxString& wxGetEmptyString() - { - return *(wxString *)&wxEmptyString; - } -#endif // wxUSE_STL/!wxUSE_STL - -// ---------------------------------------------------------------------------- -// wxStringBuffer: a tiny class allowing to get a writable pointer into string -// ---------------------------------------------------------------------------- - -#if wxUSE_STL - -class WXDLLIMPEXP_BASE wxStringBuffer -{ -public: - wxStringBuffer(wxString& str, size_t lenWanted = 1024) - : m_str(str), m_buf(lenWanted) - { } - - ~wxStringBuffer() { m_str.assign(m_buf.data(), wxStrlen(m_buf.data())); } - - operator wxChar*() { return m_buf.data(); } - -private: - wxString& m_str; -#if wxUSE_UNICODE - wxWCharBuffer m_buf; -#else - wxCharBuffer m_buf; -#endif - - DECLARE_NO_COPY_CLASS(wxStringBuffer) -}; - -class WXDLLIMPEXP_BASE wxStringBufferLength -{ -public: - wxStringBufferLength(wxString& str, size_t lenWanted = 1024) - : m_str(str), m_buf(lenWanted), m_len(0), m_lenSet(false) - { } - - ~wxStringBufferLength() - { - wxASSERT(m_lenSet); - m_str.assign(m_buf.data(), m_len); - } - - operator wxChar*() { return m_buf.data(); } - void SetLength(size_t length) { m_len = length; m_lenSet = true; } - -private: - wxString& m_str; -#if wxUSE_UNICODE - wxWCharBuffer m_buf; -#else - wxCharBuffer m_buf; -#endif - size_t m_len; - bool m_lenSet; - - DECLARE_NO_COPY_CLASS(wxStringBufferLength) -}; - -#else // if !wxUSE_STL - -class WXDLLIMPEXP_BASE wxStringBuffer -{ -public: - wxStringBuffer(wxString& str, size_t lenWanted = 1024) - : m_str(str), m_buf(NULL) - { m_buf = m_str.GetWriteBuf(lenWanted); } - - ~wxStringBuffer() { m_str.UngetWriteBuf(); } - - operator wxChar*() const { return m_buf; } - -private: - wxString& m_str; - wxChar *m_buf; - - DECLARE_NO_COPY_CLASS(wxStringBuffer) -}; - -class WXDLLIMPEXP_BASE wxStringBufferLength -{ -public: - wxStringBufferLength(wxString& str, size_t lenWanted = 1024) - : m_str(str), m_buf(NULL), m_len(0), m_lenSet(false) - { - m_buf = m_str.GetWriteBuf(lenWanted); - wxASSERT(m_buf != NULL); - } - - ~wxStringBufferLength() - { - wxASSERT(m_lenSet); - m_str.UngetWriteBuf(m_len); - } - - operator wxChar*() const { return m_buf; } - void SetLength(size_t length) { m_len = length; m_lenSet = true; } - -private: - wxString& m_str; - wxChar *m_buf; - size_t m_len; - bool m_lenSet; - - DECLARE_NO_COPY_CLASS(wxStringBufferLength) -}; - -#endif // !wxUSE_STL - -// --------------------------------------------------------------------------- -// wxString comparison functions: operator versions are always case sensitive -// --------------------------------------------------------------------------- - -// note that when wxUSE_STL == 1 the comparison operators taking std::string -// are used and defining them also for wxString would only result in -// compilation ambiguities when comparing std::string and wxString -#if !wxUSE_STL - -inline bool operator==(const wxString& s1, const wxString& s2) - { return (s1.Len() == s2.Len()) && (s1.Cmp(s2) == 0); } -inline bool operator==(const wxString& s1, const wxChar * s2) - { return s1.Cmp(s2) == 0; } -inline bool operator==(const wxChar * s1, const wxString& s2) - { return s2.Cmp(s1) == 0; } -inline bool operator!=(const wxString& s1, const wxString& s2) - { return (s1.Len() != s2.Len()) || (s1.Cmp(s2) != 0); } -inline bool operator!=(const wxString& s1, const wxChar * s2) - { return s1.Cmp(s2) != 0; } -inline bool operator!=(const wxChar * s1, const wxString& s2) - { return s2.Cmp(s1) != 0; } -inline bool operator< (const wxString& s1, const wxString& s2) - { return s1.Cmp(s2) < 0; } -inline bool operator< (const wxString& s1, const wxChar * s2) - { return s1.Cmp(s2) < 0; } -inline bool operator< (const wxChar * s1, const wxString& s2) - { return s2.Cmp(s1) > 0; } -inline bool operator> (const wxString& s1, const wxString& s2) - { return s1.Cmp(s2) > 0; } -inline bool operator> (const wxString& s1, const wxChar * s2) - { return s1.Cmp(s2) > 0; } -inline bool operator> (const wxChar * s1, const wxString& s2) - { return s2.Cmp(s1) < 0; } -inline bool operator<=(const wxString& s1, const wxString& s2) - { return s1.Cmp(s2) <= 0; } -inline bool operator<=(const wxString& s1, const wxChar * s2) - { return s1.Cmp(s2) <= 0; } -inline bool operator<=(const wxChar * s1, const wxString& s2) - { return s2.Cmp(s1) >= 0; } -inline bool operator>=(const wxString& s1, const wxString& s2) - { return s1.Cmp(s2) >= 0; } -inline bool operator>=(const wxString& s1, const wxChar * s2) - { return s1.Cmp(s2) >= 0; } -inline bool operator>=(const wxChar * s1, const wxString& s2) - { return s2.Cmp(s1) <= 0; } - -#if wxUSE_UNICODE -inline bool operator==(const wxString& s1, const wxWCharBuffer& s2) - { return (s1.Cmp((const wchar_t *)s2) == 0); } -inline bool operator==(const wxWCharBuffer& s1, const wxString& s2) - { return (s2.Cmp((const wchar_t *)s1) == 0); } -inline bool operator!=(const wxString& s1, const wxWCharBuffer& s2) - { return (s1.Cmp((const wchar_t *)s2) != 0); } -inline bool operator!=(const wxWCharBuffer& s1, const wxString& s2) - { return (s2.Cmp((const wchar_t *)s1) != 0); } -#else // !wxUSE_UNICODE -inline bool operator==(const wxString& s1, const wxCharBuffer& s2) - { return (s1.Cmp((const char *)s2) == 0); } -inline bool operator==(const wxCharBuffer& s1, const wxString& s2) - { return (s2.Cmp((const char *)s1) == 0); } -inline bool operator!=(const wxString& s1, const wxCharBuffer& s2) - { return (s1.Cmp((const char *)s2) != 0); } -inline bool operator!=(const wxCharBuffer& s1, const wxString& s2) - { return (s2.Cmp((const char *)s1) != 0); } -#endif // wxUSE_UNICODE/!wxUSE_UNICODE - -#if wxUSE_UNICODE -inline wxString operator+(const wxString& string, const wxWCharBuffer& buf) - { return string + (const wchar_t *)buf; } -inline wxString operator+(const wxWCharBuffer& buf, const wxString& string) - { return (const wchar_t *)buf + string; } -#else // !wxUSE_UNICODE -inline wxString operator+(const wxString& string, const wxCharBuffer& buf) - { return string + (const char *)buf; } -inline wxString operator+(const wxCharBuffer& buf, const wxString& string) - { return (const char *)buf + string; } -#endif // wxUSE_UNICODE/!wxUSE_UNICODE - -#endif // !wxUSE_STL - -// comparison with char (those are not defined by std::[w]string and so should -// be always available) -inline bool operator==(wxChar c, const wxString& s) { return s.IsSameAs(c); } -inline bool operator==(const wxString& s, wxChar c) { return s.IsSameAs(c); } -inline bool operator!=(wxChar c, const wxString& s) { return !s.IsSameAs(c); } -inline bool operator!=(const wxString& s, wxChar c) { return !s.IsSameAs(c); } - -// --------------------------------------------------------------------------- -// Implementation only from here until the end of file -// --------------------------------------------------------------------------- - -// don't pollute the library user's name space -#undef wxASSERT_VALID_INDEX - -#if wxUSE_STD_IOSTREAM - -#include "wx/iosfwrap.h" - -WXDLLIMPEXP_BASE wxSTD ostream& operator<<(wxSTD ostream&, const wxString&); - -#endif // wxSTD_STRING_COMPATIBILITY - -#endif // _WX_WXSTRINGH__ diff --git a/wxWidgets/include/wx/sysopt.h b/wxWidgets/include/wx/sysopt.h deleted file mode 100644 index cff3412fff..0000000000 --- a/wxWidgets/include/wx/sysopt.h +++ /dev/null @@ -1,71 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: sysopt.h -// Purpose: wxSystemOptions -// Author: Julian Smart -// Modified by: -// Created: 2001-07-10 -// RCS-ID: $Id: sysopt.h 33004 2005-03-23 20:48:50Z VZ $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_SYSOPT_H_ -#define _WX_SYSOPT_H_ - -#include "wx/object.h" - -// ---------------------------------------------------------------------------- -// Enables an application to influence the wxWidgets implementation -// ---------------------------------------------------------------------------- - -class WXDLLIMPEXP_BASE wxSystemOptions : public wxObject -{ -public: - wxSystemOptions() { } - - // User-customizable hints to wxWidgets or associated libraries - // These could also be used to influence GetSystem... calls, indeed - // to implement SetSystemColour/Font/Metric - -#if wxUSE_SYSTEM_OPTIONS - static void SetOption(const wxString& name, const wxString& value); - static void SetOption(const wxString& name, int value); -#endif // wxUSE_SYSTEM_OPTIONS - static wxString GetOption(const wxString& name); - static int GetOptionInt(const wxString& name); - static bool HasOption(const wxString& name); - - static bool IsFalse(const wxString& name) - { - return HasOption(name) && GetOptionInt(name) == 0; - } -}; - -#if !wxUSE_SYSTEM_OPTIONS - -// define inline stubs for accessors to make it possible to use wxSystemOptions -// in the library itself without checking for wxUSE_SYSTEM_OPTIONS all the time - -/* static */ inline -wxString wxSystemOptions::GetOption(const wxString& WXUNUSED(name)) -{ - return wxEmptyString; -} - -/* static */ inline -int wxSystemOptions::GetOptionInt(const wxString& WXUNUSED(name)) -{ - return 0; -} - -/* static */ inline -bool wxSystemOptions::HasOption(const wxString& WXUNUSED(name)) -{ - return false; -} - -#endif // !wxUSE_SYSTEM_OPTIONS - -#endif - // _WX_SYSOPT_H_ - diff --git a/wxWidgets/include/wx/tab.h b/wxWidgets/include/wx/tab.h deleted file mode 100644 index 01ff4ede4e..0000000000 --- a/wxWidgets/include/wx/tab.h +++ /dev/null @@ -1,22 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/tab.h -// Purpose: Generic tab class base header -// Author: Julian Smart -// Modified by: -// Created: -// Copyright: (c) Julian Smart -// RCS-ID: $Id: tab.h 37400 2006-02-09 00:28:34Z VZ $ -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_TAB_H_BASE_ -#define _WX_TAB_H_BASE_ - -#include "wx/defs.h" - -#if wxUSE_TAB_DIALOG -#include "wx/generic/tabg.h" -#endif - -#endif - // _WX_TAB_H_BASE_ diff --git a/wxWidgets/include/wx/tabctrl.h b/wxWidgets/include/wx/tabctrl.h deleted file mode 100644 index bba2fdbc54..0000000000 --- a/wxWidgets/include/wx/tabctrl.h +++ /dev/null @@ -1,34 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/tabctrl.h -// Purpose: wxTabCtrl base header -// Author: Julian Smart -// Modified by: -// Created: -// Copyright: (c) Julian Smart -// RCS-ID: $Id: tabctrl.h 38943 2006-04-28 10:14:27Z ABX $ -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_TABCTRL_H_BASE_ -#define _WX_TABCTRL_H_BASE_ - -#include "wx/defs.h" - -#if wxUSE_TAB_DIALOG - -BEGIN_DECLARE_EVENT_TYPES() - DECLARE_EVENT_TYPE(wxEVT_COMMAND_TAB_SEL_CHANGED, 800) - DECLARE_EVENT_TYPE(wxEVT_COMMAND_TAB_SEL_CHANGING, 801) -END_DECLARE_EVENT_TYPES() - -#if defined(__WXMSW__) - #include "wx/msw/tabctrl.h" -#elif defined(__WXMAC__) - #include "wx/mac/tabctrl.h" -#elif defined(__WXPM__) - #include "wx/os2/tabctrl.h" -#endif - -#endif // wxUSE_TAB_DIALOG -#endif - // _WX_TABCTRL_H_BASE_ diff --git a/wxWidgets/include/wx/tarstrm.h b/wxWidgets/include/wx/tarstrm.h deleted file mode 100644 index eb76bc340c..0000000000 --- a/wxWidgets/include/wx/tarstrm.h +++ /dev/null @@ -1,352 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/tarstrm.h -// Purpose: Streams for Tar files -// Author: Mike Wetherell -// RCS-ID: $Id: tarstrm.h 43887 2006-12-09 22:28:11Z MW $ -// Copyright: (c) 2004 Mike Wetherell -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_WXTARSTREAM_H__ -#define _WX_WXTARSTREAM_H__ - -#include "wx/defs.h" - -#if wxUSE_TARSTREAM - -#include "wx/archive.h" -#include "wx/hashmap.h" - - -///////////////////////////////////////////////////////////////////////////// -// Constants - -// TypeFlag values -enum { - wxTAR_REGTYPE = '0', // regular file - wxTAR_LNKTYPE = '1', // hard link - wxTAR_SYMTYPE = '2', // symbolic link - wxTAR_CHRTYPE = '3', // character special - wxTAR_BLKTYPE = '4', // block special - wxTAR_DIRTYPE = '5', // directory - wxTAR_FIFOTYPE = '6', // named pipe - wxTAR_CONTTYPE = '7' // contiguous file -}; - -// Archive Formats (use wxTAR_PAX, it's backward compatible) -enum wxTarFormat -{ - wxTAR_USTAR, // POSIX.1-1990 tar format - wxTAR_PAX // POSIX.1-2001 tar format -}; - - -///////////////////////////////////////////////////////////////////////////// -// wxTarNotifier - -class WXDLLIMPEXP_BASE wxTarNotifier -{ -public: - virtual ~wxTarNotifier() { } - - virtual void OnEntryUpdated(class wxTarEntry& entry) = 0; -}; - - -///////////////////////////////////////////////////////////////////////////// -// Tar Entry - hold the meta data for a file in the tar - -class WXDLLIMPEXP_BASE wxTarEntry : public wxArchiveEntry -{ -public: - wxTarEntry(const wxString& name = wxEmptyString, - const wxDateTime& dt = wxDateTime::Now(), - wxFileOffset size = wxInvalidOffset); - virtual ~wxTarEntry(); - - wxTarEntry(const wxTarEntry& entry); - wxTarEntry& operator=(const wxTarEntry& entry); - - // Get accessors - wxString GetName(wxPathFormat format = wxPATH_NATIVE) const; - wxString GetInternalName() const { return m_Name; } - wxPathFormat GetInternalFormat() const { return wxPATH_UNIX; } - int GetMode() const; - int GetUserId() const { return m_UserId; } - int GetGroupId() const { return m_GroupId; } - wxFileOffset GetSize() const { return m_Size; } - wxFileOffset GetOffset() const { return m_Offset; } - wxDateTime GetDateTime() const { return m_ModifyTime; } - wxDateTime GetAccessTime() const { return m_AccessTime; } - wxDateTime GetCreateTime() const { return m_CreateTime; } - int GetTypeFlag() const { return m_TypeFlag; } - wxString GetLinkName() const { return m_LinkName; } - wxString GetUserName() const { return m_UserName; } - wxString GetGroupName() const { return m_GroupName; } - int GetDevMajor() const { return m_DevMajor; } - int GetDevMinor() const { return m_DevMinor; } - - // is accessors - bool IsDir() const; - bool IsReadOnly() const { return !(m_Mode & 0222); } - - // set accessors - void SetName(const wxString& name, wxPathFormat format = wxPATH_NATIVE); - void SetUserId(int id) { m_UserId = id; } - void SetGroupId(int id) { m_GroupId = id; } - void SetMode(int mode); - void SetSize(wxFileOffset size) { m_Size = size; } - void SetDateTime(const wxDateTime& dt) { m_ModifyTime = dt; } - void SetAccessTime(const wxDateTime& dt) { m_AccessTime = dt; } - void SetCreateTime(const wxDateTime& dt) { m_CreateTime = dt; } - void SetTypeFlag(int type) { m_TypeFlag = type; } - void SetLinkName(const wxString& link) { m_LinkName = link; } - void SetUserName(const wxString& user) { m_UserName = user; } - void SetGroupName(const wxString& group) { m_GroupName = group; } - void SetDevMajor(int dev) { m_DevMajor = dev; } - void SetDevMinor(int dev) { m_DevMinor = dev; } - - // set is accessors - void SetIsDir(bool isDir = true); - void SetIsReadOnly(bool isReadOnly = true); - - static wxString GetInternalName(const wxString& name, - wxPathFormat format = wxPATH_NATIVE, - bool *pIsDir = NULL); - - wxTarEntry *Clone() const { return new wxTarEntry(*this); } - - void SetNotifier(wxTarNotifier& WXUNUSED(notifier)) { } - -private: - void SetOffset(wxFileOffset offset) { m_Offset = offset; } - - virtual wxArchiveEntry* DoClone() const { return Clone(); } - - wxString m_Name; - int m_Mode; - bool m_IsModeSet; - int m_UserId; - int m_GroupId; - wxFileOffset m_Size; - wxFileOffset m_Offset; - wxDateTime m_ModifyTime; - wxDateTime m_AccessTime; - wxDateTime m_CreateTime; - int m_TypeFlag; - wxString m_LinkName; - wxString m_UserName; - wxString m_GroupName; - int m_DevMajor; - int m_DevMinor; - - friend class wxTarInputStream; - - DECLARE_DYNAMIC_CLASS(wxTarEntry) -}; - - -///////////////////////////////////////////////////////////////////////////// -// wxTarInputStream - -WX_DECLARE_STRING_HASH_MAP(wxString, wxTarHeaderRecords); - -class WXDLLIMPEXP_BASE wxTarInputStream : public wxArchiveInputStream -{ -public: - typedef wxTarEntry entry_type; - - wxTarInputStream(wxInputStream& stream, wxMBConv& conv = wxConvLocal); - wxTarInputStream(wxInputStream *stream, wxMBConv& conv = wxConvLocal); - virtual ~wxTarInputStream(); - - bool OpenEntry(wxTarEntry& entry); - bool CloseEntry(); - - wxTarEntry *GetNextEntry(); - - wxFileOffset GetLength() const { return m_size; } - bool IsSeekable() const { return m_parent_i_stream->IsSeekable(); } - -protected: - size_t OnSysRead(void *buffer, size_t size); - wxFileOffset OnSysTell() const { return m_pos; } - wxFileOffset OnSysSeek(wxFileOffset seek, wxSeekMode mode); - -private: - void Init(); - - wxArchiveEntry *DoGetNextEntry() { return GetNextEntry(); } - bool OpenEntry(wxArchiveEntry& entry); - bool IsOpened() const { return m_pos != wxInvalidOffset; } - - wxStreamError ReadHeaders(); - bool ReadExtendedHeader(wxTarHeaderRecords*& recs); - - wxString GetExtendedHeader(const wxString& key) const; - wxString GetHeaderPath() const; - wxFileOffset GetHeaderNumber(int id) const; - wxString GetHeaderString(int id) const; - wxDateTime GetHeaderDate(const wxString& key) const; - - wxFileOffset m_pos; // position within the current entry - wxFileOffset m_offset; // offset to the start of the entry's data - wxFileOffset m_size; // size of the current entry's data - - int m_sumType; - int m_tarType; - class wxTarHeaderBlock *m_hdr; - wxTarHeaderRecords *m_HeaderRecs; - wxTarHeaderRecords *m_GlobalHeaderRecs; - - DECLARE_NO_COPY_CLASS(wxTarInputStream) -}; - - -///////////////////////////////////////////////////////////////////////////// -// wxTarOutputStream - -class WXDLLIMPEXP_BASE wxTarOutputStream : public wxArchiveOutputStream -{ -public: - wxTarOutputStream(wxOutputStream& stream, - wxTarFormat format = wxTAR_PAX, - wxMBConv& conv = wxConvLocal); - wxTarOutputStream(wxOutputStream *stream, - wxTarFormat format = wxTAR_PAX, - wxMBConv& conv = wxConvLocal); - virtual ~wxTarOutputStream(); - - bool PutNextEntry(wxTarEntry *entry); - - bool PutNextEntry(const wxString& name, - const wxDateTime& dt = wxDateTime::Now(), - wxFileOffset size = wxInvalidOffset); - - bool PutNextDirEntry(const wxString& name, - const wxDateTime& dt = wxDateTime::Now()); - - bool CopyEntry(wxTarEntry *entry, wxTarInputStream& inputStream); - bool CopyArchiveMetaData(wxTarInputStream& WXUNUSED(s)) { return true; } - - void Sync(); - bool CloseEntry(); - bool Close(); - - bool IsSeekable() const { return m_parent_o_stream->IsSeekable(); } - - void SetBlockingFactor(int factor) { m_BlockingFactor = factor; } - int GetBlockingFactor() const { return m_BlockingFactor; } - -protected: - size_t OnSysWrite(const void *buffer, size_t size); - wxFileOffset OnSysTell() const { return m_pos; } - wxFileOffset OnSysSeek(wxFileOffset pos, wxSeekMode mode); - -private: - void Init(wxTarFormat format); - - bool PutNextEntry(wxArchiveEntry *entry); - bool CopyEntry(wxArchiveEntry *entry, wxArchiveInputStream& stream); - bool CopyArchiveMetaData(wxArchiveInputStream& WXUNUSED(s)) { return true; } - bool IsOpened() const { return m_pos != wxInvalidOffset; } - - bool WriteHeaders(wxTarEntry& entry); - bool ModifyHeader(); - wxString PaxHeaderPath(const wxString& format, const wxString& path); - - void SetExtendedHeader(const wxString& key, const wxString& value); - void SetHeaderPath(const wxString& name); - bool SetHeaderNumber(int id, wxFileOffset n); - void SetHeaderString(int id, const wxString& str); - void SetHeaderDate(const wxString& key, const wxDateTime& datetime); - - wxFileOffset m_pos; // position within the current entry - wxFileOffset m_maxpos; // max pos written - wxFileOffset m_size; // expected entry size - - wxFileOffset m_headpos; // offset within the file to the entry's header - wxFileOffset m_datapos; // offset within the file to the entry's data - - wxFileOffset m_tarstart;// offset within the file to the tar - wxFileOffset m_tarsize; // size of tar so far - - bool m_pax; - int m_BlockingFactor; - wxUint32 m_chksum; - bool m_large; - class wxTarHeaderBlock *m_hdr; - class wxTarHeaderBlock *m_hdr2; - char *m_extendedHdr; - size_t m_extendedSize; - wxString m_badfit; - - DECLARE_NO_COPY_CLASS(wxTarOutputStream) -}; - - -///////////////////////////////////////////////////////////////////////////// -// Iterators - -#if wxUSE_STL || defined WX_TEST_ARCHIVE_ITERATOR -typedef wxArchiveIterator<wxTarInputStream> wxTarIter; -typedef wxArchiveIterator<wxTarInputStream, - std::pair<wxString, wxTarEntry*> > wxTarPairIter; -#endif - - -///////////////////////////////////////////////////////////////////////////// -// wxTarClassFactory - -class WXDLLIMPEXP_BASE wxTarClassFactory : public wxArchiveClassFactory -{ -public: - typedef wxTarEntry entry_type; - typedef wxTarInputStream instream_type; - typedef wxTarOutputStream outstream_type; - typedef wxTarNotifier notifier_type; -#if wxUSE_STL || defined WX_TEST_ARCHIVE_ITERATOR - typedef wxTarIter iter_type; - typedef wxTarPairIter pairiter_type; -#endif - - wxTarClassFactory(); - - wxTarEntry *NewEntry() const - { return new wxTarEntry; } - wxTarInputStream *NewStream(wxInputStream& stream) const - { return new wxTarInputStream(stream, GetConv()); } - wxTarOutputStream *NewStream(wxOutputStream& stream) const - { return new wxTarOutputStream(stream, wxTAR_PAX, GetConv()); } - wxTarInputStream *NewStream(wxInputStream *stream) const - { return new wxTarInputStream(stream, GetConv()); } - wxTarOutputStream *NewStream(wxOutputStream *stream) const - { return new wxTarOutputStream(stream, wxTAR_PAX, GetConv()); } - - wxString GetInternalName(const wxString& name, - wxPathFormat format = wxPATH_NATIVE) const - { return wxTarEntry::GetInternalName(name, format); } - - const wxChar * const *GetProtocols(wxStreamProtocolType type - = wxSTREAM_PROTOCOL) const; - -protected: - wxArchiveEntry *DoNewEntry() const - { return NewEntry(); } - wxArchiveInputStream *DoNewStream(wxInputStream& stream) const - { return NewStream(stream); } - wxArchiveOutputStream *DoNewStream(wxOutputStream& stream) const - { return NewStream(stream); } - wxArchiveInputStream *DoNewStream(wxInputStream *stream) const - { return NewStream(stream); } - wxArchiveOutputStream *DoNewStream(wxOutputStream *stream) const - { return NewStream(stream); } - -private: - DECLARE_DYNAMIC_CLASS(wxTarClassFactory) -}; - - -#endif // wxUSE_TARSTREAM - -#endif // _WX_WXTARSTREAM_H__ diff --git a/wxWidgets/include/wx/taskbar.h b/wxWidgets/include/wx/taskbar.h deleted file mode 100644 index 3a26e78a8f..0000000000 --- a/wxWidgets/include/wx/taskbar.h +++ /dev/null @@ -1,124 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/taskbar.h -// Purpose: wxTaskBarIcon base header and class -// Author: Julian Smart -// Modified by: -// Created: -// Copyright: (c) Julian Smart -// RCS-ID: $Id: taskbar.h 53135 2008-04-12 02:31:04Z VZ $ -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_TASKBAR_H_BASE_ -#define _WX_TASKBAR_H_BASE_ - -#include "wx/defs.h" - -#ifdef wxHAS_TASK_BAR_ICON - -#include "wx/event.h" - -class WXDLLIMPEXP_FWD_ADV wxTaskBarIconEvent; - -// ---------------------------------------------------------------------------- -// wxTaskBarIconBase: define wxTaskBarIcon interface -// ---------------------------------------------------------------------------- - -class WXDLLIMPEXP_ADV wxTaskBarIconBase : public wxEvtHandler -{ -public: - wxTaskBarIconBase() { } - - // Operations: - virtual bool SetIcon(const wxIcon& icon, - const wxString& tooltip = wxEmptyString) = 0; - virtual bool RemoveIcon() = 0; - virtual bool PopupMenu(wxMenu *menu) = 0; - -protected: - // creates menu to be displayed when user clicks on the icon - virtual wxMenu *CreatePopupMenu() { return NULL; } - -private: - // default events handling, calls CreatePopupMenu: - void OnRightButtonDown(wxTaskBarIconEvent& event); - - DECLARE_EVENT_TABLE() - DECLARE_NO_COPY_CLASS(wxTaskBarIconBase) -}; - - -// ---------------------------------------------------------------------------- -// now include the actual class declaration -// ---------------------------------------------------------------------------- - -#if defined(__WXPALMOS__) - #include "wx/palmos/taskbar.h" -#elif defined(__WXMSW__) - #include "wx/msw/taskbar.h" -#elif defined(__WXGTK__) || defined(__WXX11__) || defined(__WXMOTIF__) - #include "wx/unix/taskbarx11.h" -#elif defined (__WXMAC__) && defined(__WXMAC_OSX__) - #include "wx/mac/taskbarosx.h" -#elif defined (__WXCOCOA__) - #include "wx/cocoa/taskbar.h" -#endif - -// ---------------------------------------------------------------------------- -// wxTaskBarIcon events -// ---------------------------------------------------------------------------- - -class WXDLLIMPEXP_ADV wxTaskBarIconEvent : public wxEvent -{ -public: - wxTaskBarIconEvent(wxEventType evtType, wxTaskBarIcon *tbIcon) - : wxEvent(wxID_ANY, evtType) - { - SetEventObject(tbIcon); - } - - virtual wxEvent *Clone() const { return new wxTaskBarIconEvent(*this); } - -private: - DECLARE_NO_ASSIGN_CLASS(wxTaskBarIconEvent) -}; - -typedef void (wxEvtHandler::*wxTaskBarIconEventFunction)(wxTaskBarIconEvent&); - -BEGIN_DECLARE_EVENT_TYPES() - DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_ADV,wxEVT_TASKBAR_MOVE,1550) - DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_ADV,wxEVT_TASKBAR_LEFT_DOWN,1551) - DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_ADV,wxEVT_TASKBAR_LEFT_UP,1552) - DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_ADV,wxEVT_TASKBAR_RIGHT_DOWN,1553) - DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_ADV,wxEVT_TASKBAR_RIGHT_UP,1554) - DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_ADV,wxEVT_TASKBAR_LEFT_DCLICK,1555) - DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_ADV,wxEVT_TASKBAR_RIGHT_DCLICK,1556) -END_DECLARE_EVENT_TYPES() - -#define wxTaskBarIconEventHandler(func) \ - (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxTaskBarIconEventFunction, &func) - -#define wx__DECLARE_TASKBAREVT(evt, fn) \ - wx__DECLARE_EVT0(wxEVT_TASKBAR_ ## evt, wxTaskBarIconEventHandler(fn)) - -#define EVT_TASKBAR_MOVE(fn) wx__DECLARE_TASKBAREVT(MOVE, fn) -#define EVT_TASKBAR_LEFT_DOWN(fn) wx__DECLARE_TASKBAREVT(LEFT_DOWN, fn) -#define EVT_TASKBAR_LEFT_UP(fn) wx__DECLARE_TASKBAREVT(LEFT_UP, fn) -#define EVT_TASKBAR_RIGHT_DOWN(fn) wx__DECLARE_TASKBAREVT(RIGHT_DOWN, fn) -#define EVT_TASKBAR_RIGHT_UP(fn) wx__DECLARE_TASKBAREVT(RIGHT_UP, fn) -#define EVT_TASKBAR_LEFT_DCLICK(fn) wx__DECLARE_TASKBAREVT(LEFT_DCLICK, fn) -#define EVT_TASKBAR_RIGHT_DCLICK(fn) wx__DECLARE_TASKBAREVT(RIGHT_DCLICK, fn) - -// taskbar menu is shown on right button press under all platforms except MSW -// where it's shown on right button release, using this event type and macro -// allows to write code which works correctly on all platforms -#ifdef __WXMSW__ - #define wxEVT_TASKBAR_CLICK wxEVT_TASKBAR_RIGHT_UP -#else - #define wxEVT_TASKBAR_CLICK wxEVT_TASKBAR_RIGHT_DOWN -#endif -#define EVT_TASKBAR_CLICK(fn) wx__DECLARE_TASKBAREVT(CLICK, fn) - -#endif // wxHAS_TASK_BAR_ICON - -#endif // _WX_TASKBAR_H_BASE_ diff --git a/wxWidgets/include/wx/tbarbase.h b/wxWidgets/include/wx/tbarbase.h deleted file mode 100644 index 5d53b5ec9e..0000000000 --- a/wxWidgets/include/wx/tbarbase.h +++ /dev/null @@ -1,607 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/tbarbase.h -// Purpose: Base class for toolbar classes -// Author: Julian Smart -// Modified by: -// Created: 01/02/97 -// RCS-ID: $Id: tbarbase.h 61872 2009-09-09 22:37:05Z VZ $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_TBARBASE_H_ -#define _WX_TBARBASE_H_ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -#include "wx/defs.h" - -#if wxUSE_TOOLBAR - -#include "wx/bitmap.h" -#include "wx/list.h" -#include "wx/control.h" - -class WXDLLIMPEXP_FWD_CORE wxToolBarBase; -class WXDLLIMPEXP_FWD_CORE wxToolBarToolBase; -class WXDLLIMPEXP_FWD_CORE wxImage; - -// ---------------------------------------------------------------------------- -// constants -// ---------------------------------------------------------------------------- - -extern WXDLLEXPORT_DATA(const wxChar) wxToolBarNameStr[]; -extern WXDLLEXPORT_DATA(const wxSize) wxDefaultSize; -extern WXDLLEXPORT_DATA(const wxPoint) wxDefaultPosition; - -enum wxToolBarToolStyle -{ - wxTOOL_STYLE_BUTTON = 1, - wxTOOL_STYLE_SEPARATOR = 2, - wxTOOL_STYLE_CONTROL -}; - -// ---------------------------------------------------------------------------- -// wxToolBarTool is a toolbar element. -// -// It has a unique id (except for the separators which always have id wxID_ANY), the -// style (telling whether it is a normal button, separator or a control), the -// state (toggled or not, enabled or not) and short and long help strings. The -// default implementations use the short help string for the tooltip text which -// is popped up when the mouse pointer enters the tool and the long help string -// for the applications status bar. -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxToolBarToolBase : public wxObject -{ -public: - // ctors & dtor - // ------------ - - wxToolBarToolBase(wxToolBarBase *tbar = (wxToolBarBase *)NULL, - int toolid = wxID_SEPARATOR, - const wxString& label = wxEmptyString, - const wxBitmap& bmpNormal = wxNullBitmap, - const wxBitmap& bmpDisabled = wxNullBitmap, - wxItemKind kind = wxITEM_NORMAL, - wxObject *clientData = (wxObject *) NULL, - const wxString& shortHelpString = wxEmptyString, - const wxString& longHelpString = wxEmptyString) - : m_label(label), - m_shortHelpString(shortHelpString), - m_longHelpString(longHelpString) - { - m_tbar = tbar; - m_id = toolid; - if (m_id == wxID_ANY) - m_id = wxNewId(); - m_clientData = clientData; - - m_bmpNormal = bmpNormal; - m_bmpDisabled = bmpDisabled; - - m_kind = kind; - - m_enabled = true; - m_toggled = false; - - m_toolStyle = toolid == wxID_SEPARATOR ? wxTOOL_STYLE_SEPARATOR - : wxTOOL_STYLE_BUTTON; - } - - wxToolBarToolBase(wxToolBarBase *tbar, wxControl *control) - { - m_tbar = tbar; - m_control = control; - m_id = control->GetId(); - - m_kind = wxITEM_MAX; // invalid value - - m_enabled = true; - m_toggled = false; - - m_toolStyle = wxTOOL_STYLE_CONTROL; - } - - virtual ~wxToolBarToolBase(){} - - // accessors - // --------- - - // general - int GetId() const { return m_id; } - - wxControl *GetControl() const - { - wxASSERT_MSG( IsControl(), wxT("this toolbar tool is not a control") ); - - return m_control; - } - - wxToolBarBase *GetToolBar() const { return m_tbar; } - - // style - bool IsButton() const { return m_toolStyle == wxTOOL_STYLE_BUTTON; } - bool IsControl() const { return m_toolStyle == wxTOOL_STYLE_CONTROL; } - bool IsSeparator() const { return m_toolStyle == wxTOOL_STYLE_SEPARATOR; } - int GetStyle() const { return m_toolStyle; } - wxItemKind GetKind() const - { - wxASSERT_MSG( IsButton(), wxT("only makes sense for buttons") ); - - return m_kind; - } - - // state - bool IsEnabled() const { return m_enabled; } - bool IsToggled() const { return m_toggled; } - bool CanBeToggled() const - { return m_kind == wxITEM_CHECK || m_kind == wxITEM_RADIO; } - - // attributes - const wxBitmap& GetNormalBitmap() const { return m_bmpNormal; } - const wxBitmap& GetDisabledBitmap() const { return m_bmpDisabled; } - - const wxBitmap& GetBitmap() const - { return IsEnabled() ? GetNormalBitmap() : GetDisabledBitmap(); } - - const wxString& GetLabel() const { return m_label; } - - const wxString& GetShortHelp() const { return m_shortHelpString; } - const wxString& GetLongHelp() const { return m_longHelpString; } - - wxObject *GetClientData() const - { - if ( m_toolStyle == wxTOOL_STYLE_CONTROL ) - { - return (wxObject*)m_control->GetClientData(); - } - else - { - return m_clientData; - } - } - - // modifiers: return true if the state really changed - bool Enable(bool enable); - bool Toggle(bool toggle); - bool SetToggle(bool toggle); - bool SetShortHelp(const wxString& help); - bool SetLongHelp(const wxString& help); - - void Toggle() { Toggle(!IsToggled()); } - - void SetNormalBitmap(const wxBitmap& bmp) { m_bmpNormal = bmp; } - void SetDisabledBitmap(const wxBitmap& bmp) { m_bmpDisabled = bmp; } - - virtual void SetLabel(const wxString& label) { m_label = label; } - - void SetClientData(wxObject *clientData) - { - if ( m_toolStyle == wxTOOL_STYLE_CONTROL ) - { - m_control->SetClientData(clientData); - } - else - { - m_clientData = clientData; - } - } - - // add tool to/remove it from a toolbar - virtual void Detach() { m_tbar = (wxToolBarBase *)NULL; } - virtual void Attach(wxToolBarBase *tbar) { m_tbar = tbar; } - -protected: - wxToolBarBase *m_tbar; // the toolbar to which we belong (may be NULL) - - // tool parameters - int m_toolStyle; // see enum wxToolBarToolStyle - int m_id; // the tool id, wxID_SEPARATOR for separator - wxItemKind m_kind; // for normal buttons may be wxITEM_NORMAL/CHECK/RADIO - - // as controls have their own client data, no need to waste memory - union - { - wxObject *m_clientData; - wxControl *m_control; - }; - - // tool state - bool m_toggled; - bool m_enabled; - - // normal and disabled bitmaps for the tool, both can be invalid - wxBitmap m_bmpNormal; - wxBitmap m_bmpDisabled; - - // the button label - wxString m_label; - - // short and long help strings - wxString m_shortHelpString; - wxString m_longHelpString; - - DECLARE_DYNAMIC_CLASS_NO_COPY(wxToolBarToolBase) -}; - -// a list of toolbar tools -WX_DECLARE_EXPORTED_LIST(wxToolBarToolBase, wxToolBarToolsList); - -// ---------------------------------------------------------------------------- -// the base class for all toolbars -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxToolBarBase : public wxControl -{ -public: - wxToolBarBase(); - virtual ~wxToolBarBase(); - - // toolbar construction - // -------------------- - - // the full AddTool() function - // - // If bmpDisabled is wxNullBitmap, a shadowed version of the normal bitmap - // is created and used as the disabled image. - wxToolBarToolBase *AddTool(int toolid, - const wxString& label, - const wxBitmap& bitmap, - const wxBitmap& bmpDisabled, - wxItemKind kind = wxITEM_NORMAL, - const wxString& shortHelp = wxEmptyString, - const wxString& longHelp = wxEmptyString, - wxObject *data = NULL) - { - return DoAddTool(toolid, label, bitmap, bmpDisabled, kind, - shortHelp, longHelp, data); - } - - // the most common AddTool() version - wxToolBarToolBase *AddTool(int toolid, - const wxString& label, - const wxBitmap& bitmap, - const wxString& shortHelp = wxEmptyString, - wxItemKind kind = wxITEM_NORMAL) - { - return AddTool(toolid, label, bitmap, wxNullBitmap, kind, shortHelp); - } - - // add a check tool, i.e. a tool which can be toggled - wxToolBarToolBase *AddCheckTool(int toolid, - const wxString& label, - const wxBitmap& bitmap, - const wxBitmap& bmpDisabled = wxNullBitmap, - const wxString& shortHelp = wxEmptyString, - const wxString& longHelp = wxEmptyString, - wxObject *data = NULL) - { - return AddTool(toolid, label, bitmap, bmpDisabled, wxITEM_CHECK, - shortHelp, longHelp, data); - } - - // add a radio tool, i.e. a tool which can be toggled and releases any - // other toggled radio tools in the same group when it happens - wxToolBarToolBase *AddRadioTool(int toolid, - const wxString& label, - const wxBitmap& bitmap, - const wxBitmap& bmpDisabled = wxNullBitmap, - const wxString& shortHelp = wxEmptyString, - const wxString& longHelp = wxEmptyString, - wxObject *data = NULL) - { - return AddTool(toolid, label, bitmap, bmpDisabled, wxITEM_RADIO, - shortHelp, longHelp, data); - } - - - // insert the new tool at the given position, if pos == GetToolsCount(), it - // is equivalent to AddTool() - virtual wxToolBarToolBase *InsertTool - ( - size_t pos, - int toolid, - const wxString& label, - const wxBitmap& bitmap, - const wxBitmap& bmpDisabled = wxNullBitmap, - wxItemKind kind = wxITEM_NORMAL, - const wxString& shortHelp = wxEmptyString, - const wxString& longHelp = wxEmptyString, - wxObject *clientData = NULL - ); - - virtual wxToolBarToolBase *AddTool (wxToolBarToolBase *tool); - virtual wxToolBarToolBase *InsertTool (size_t pos, wxToolBarToolBase *tool); - - // add an arbitrary control to the toolbar (notice that - // the control will be deleted by the toolbar and that it will also adjust - // its position/size) - // - // NB: the control should have toolbar as its parent - virtual wxToolBarToolBase *AddControl(wxControl *control); - virtual wxToolBarToolBase *InsertControl(size_t pos, wxControl *control); - - // get the control with the given id or return NULL - virtual wxControl *FindControl( int toolid ); - - // add a separator to the toolbar - virtual wxToolBarToolBase *AddSeparator(); - virtual wxToolBarToolBase *InsertSeparator(size_t pos); - - // remove the tool from the toolbar: the caller is responsible for actually - // deleting the pointer - virtual wxToolBarToolBase *RemoveTool(int toolid); - - // delete tool either by index or by position - virtual bool DeleteToolByPos(size_t pos); - virtual bool DeleteTool(int toolid); - - // delete all tools - virtual void ClearTools(); - - // must be called after all buttons have been created to finish toolbar - // initialisation - virtual bool Realize(); - - // tools state - // ----------- - - virtual void EnableTool(int toolid, bool enable); - virtual void ToggleTool(int toolid, bool toggle); - - // Set this to be togglable (or not) - virtual void SetToggle(int toolid, bool toggle); - - // set/get tools client data (not for controls) - virtual wxObject *GetToolClientData(int toolid) const; - virtual void SetToolClientData(int toolid, wxObject *clientData); - - // returns tool pos, or wxNOT_FOUND if tool isn't found - virtual int GetToolPos(int id) const; - - // return true if the tool is toggled - virtual bool GetToolState(int toolid) const; - - virtual bool GetToolEnabled(int toolid) const; - - virtual void SetToolShortHelp(int toolid, const wxString& helpString); - virtual wxString GetToolShortHelp(int toolid) const; - virtual void SetToolLongHelp(int toolid, const wxString& helpString); - virtual wxString GetToolLongHelp(int toolid) const; - - // margins/packing/separation - // -------------------------- - - virtual void SetMargins(int x, int y); - void SetMargins(const wxSize& size) - { SetMargins((int) size.x, (int) size.y); } - virtual void SetToolPacking(int packing) - { m_toolPacking = packing; } - virtual void SetToolSeparation(int separation) - { m_toolSeparation = separation; } - - virtual wxSize GetToolMargins() const { return wxSize(m_xMargin, m_yMargin); } - virtual int GetToolPacking() const { return m_toolPacking; } - virtual int GetToolSeparation() const { return m_toolSeparation; } - - // toolbar geometry - // ---------------- - - // set the number of toolbar rows - virtual void SetRows(int nRows); - - // the toolbar can wrap - limit the number of columns or rows it may take - void SetMaxRowsCols(int rows, int cols) - { m_maxRows = rows; m_maxCols = cols; } - int GetMaxRows() const { return m_maxRows; } - int GetMaxCols() const { return m_maxCols; } - - // get/set the size of the bitmaps used by the toolbar: should be called - // before adding any tools to the toolbar - virtual void SetToolBitmapSize(const wxSize& size) - { m_defaultWidth = size.x; m_defaultHeight = size.y; } - virtual wxSize GetToolBitmapSize() const - { return wxSize(m_defaultWidth, m_defaultHeight); } - - // the button size in some implementations is bigger than the bitmap size: - // get the total button size (by default the same as bitmap size) - virtual wxSize GetToolSize() const - { return GetToolBitmapSize(); } - - // returns a (non separator) tool containing the point (x, y) or NULL if - // there is no tool at this point (corrdinates are client) - virtual wxToolBarToolBase *FindToolForPosition(wxCoord x, - wxCoord y) const = 0; - - // find the tool by id - wxToolBarToolBase *FindById(int toolid) const; - - // return true if this is a vertical toolbar, otherwise false - bool IsVertical() const { return HasFlag(wxTB_LEFT | wxTB_RIGHT); } - - - // the old versions of the various methods kept for compatibility - // don't use in the new code! - // -------------------------------------------------------------- - - wxToolBarToolBase *AddTool(int toolid, - const wxBitmap& bitmap, - const wxBitmap& bmpDisabled, - bool toggle = false, - wxObject *clientData = NULL, - const wxString& shortHelpString = wxEmptyString, - const wxString& longHelpString = wxEmptyString) - { - return AddTool(toolid, wxEmptyString, - bitmap, bmpDisabled, - toggle ? wxITEM_CHECK : wxITEM_NORMAL, - shortHelpString, longHelpString, clientData); - } - - wxToolBarToolBase *AddTool(int toolid, - const wxBitmap& bitmap, - const wxString& shortHelpString = wxEmptyString, - const wxString& longHelpString = wxEmptyString) - { - return AddTool(toolid, wxEmptyString, - bitmap, wxNullBitmap, wxITEM_NORMAL, - shortHelpString, longHelpString, NULL); - } - - wxToolBarToolBase *AddTool(int toolid, - const wxBitmap& bitmap, - const wxBitmap& bmpDisabled, - bool toggle, - wxCoord xPos, - wxCoord yPos = wxDefaultCoord, - wxObject *clientData = NULL, - const wxString& shortHelp = wxEmptyString, - const wxString& longHelp = wxEmptyString) - { - return DoAddTool(toolid, wxEmptyString, bitmap, bmpDisabled, - toggle ? wxITEM_CHECK : wxITEM_NORMAL, - shortHelp, longHelp, clientData, xPos, yPos); - } - - wxToolBarToolBase *InsertTool(size_t pos, - int toolid, - const wxBitmap& bitmap, - const wxBitmap& bmpDisabled = wxNullBitmap, - bool toggle = false, - wxObject *clientData = NULL, - const wxString& shortHelp = wxEmptyString, - const wxString& longHelp = wxEmptyString) - { - return InsertTool(pos, toolid, wxEmptyString, bitmap, bmpDisabled, - toggle ? wxITEM_CHECK : wxITEM_NORMAL, - shortHelp, longHelp, clientData); - } - - // event handlers - // -------------- - - // NB: these functions are deprecated, use EVT_TOOL_XXX() instead! - - // Only allow toggle if returns true. Call when left button up. - virtual bool OnLeftClick(int toolid, bool toggleDown); - - // Call when right button down. - virtual void OnRightClick(int toolid, long x, long y); - - // Called when the mouse cursor enters a tool bitmap. - // Argument is wxID_ANY if mouse is exiting the toolbar. - virtual void OnMouseEnter(int toolid); - - // more deprecated functions - // ------------------------- - - // use GetToolMargins() instead - wxSize GetMargins() const { return GetToolMargins(); } - - // implementation only from now on - // ------------------------------- - - size_t GetToolsCount() const { return m_tools.GetCount(); } - - // Do the toolbar button updates (check for EVT_UPDATE_UI handlers) - virtual void UpdateWindowUI(long flags = wxUPDATE_UI_NONE) ; - - // don't want toolbars to accept the focus - virtual bool AcceptsFocus() const { return false; } - -protected: - // to implement in derived classes - // ------------------------------- - - // create a new toolbar tool and add it to the toolbar, this is typically - // implemented by just calling InsertTool() - virtual wxToolBarToolBase *DoAddTool - ( - int toolid, - const wxString& label, - const wxBitmap& bitmap, - const wxBitmap& bmpDisabled, - wxItemKind kind, - const wxString& shortHelp = wxEmptyString, - const wxString& longHelp = wxEmptyString, - wxObject *clientData = NULL, - wxCoord xPos = wxDefaultCoord, - wxCoord yPos = wxDefaultCoord - ); - - // the tool is not yet inserted into m_tools list when this function is - // called and will only be added to it if this function succeeds - virtual bool DoInsertTool(size_t pos, wxToolBarToolBase *tool) = 0; - - // the tool is still in m_tools list when this function is called, it will - // only be deleted from it if it succeeds - virtual bool DoDeleteTool(size_t pos, wxToolBarToolBase *tool) = 0; - - // called when the tools enabled flag changes - virtual void DoEnableTool(wxToolBarToolBase *tool, bool enable) = 0; - - // called when the tool is toggled - virtual void DoToggleTool(wxToolBarToolBase *tool, bool toggle) = 0; - - // called when the tools "can be toggled" flag changes - virtual void DoSetToggle(wxToolBarToolBase *tool, bool toggle) = 0; - - // the functions to create toolbar tools - virtual wxToolBarToolBase *CreateTool(int toolid, - const wxString& label, - const wxBitmap& bmpNormal, - const wxBitmap& bmpDisabled, - wxItemKind kind, - wxObject *clientData, - const wxString& shortHelp, - const wxString& longHelp) = 0; - - virtual wxToolBarToolBase *CreateTool(wxControl *control) = 0; - - // helper functions - // ---------------- - - // call this from derived class ctor/Create() to ensure that we have either - // wxTB_HORIZONTAL or wxTB_VERTICAL style, there is a lot of existing code - // which randomly checks either one or the other of them and gets confused - // if neither is set (and making one of them 0 is not an option neither as - // then the existing tests would break down) - void FixupStyle(); - - // un-toggle all buttons in the same radio group - void UnToggleRadioGroup(wxToolBarToolBase *tool); - - // the list of all our tools - wxToolBarToolsList m_tools; - - // the offset of the first tool - int m_xMargin; - int m_yMargin; - - // the maximum number of toolbar rows/columns - int m_maxRows; - int m_maxCols; - - // the tool packing and separation - int m_toolPacking, - m_toolSeparation; - - // the size of the toolbar bitmaps - wxCoord m_defaultWidth, m_defaultHeight; - -private: - DECLARE_EVENT_TABLE() - DECLARE_NO_COPY_CLASS(wxToolBarBase) -}; - -// Helper function for creating the image for disabled buttons -bool wxCreateGreyedImage(const wxImage& in, wxImage& out) ; - -#endif // wxUSE_TOOLBAR - -#endif - // _WX_TBARBASE_H_ - diff --git a/wxWidgets/include/wx/textbuf.h b/wxWidgets/include/wx/textbuf.h deleted file mode 100644 index 569b1ac9e9..0000000000 --- a/wxWidgets/include/wx/textbuf.h +++ /dev/null @@ -1,208 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: wx/textbuf.h -// Purpose: class wxTextBuffer to work with text buffers of _small_ size -// (buffer is fully loaded in memory) and which understands CR/LF -// differences between platforms. -// Created: 14.11.01 -// Author: Morten Hanssen, Vadim Zeitlin -// Copyright: (c) 1998-2001 Morten Hanssen, Vadim Zeitlin -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_TEXTBUFFER_H -#define _WX_TEXTBUFFER_H - -#include "wx/defs.h" -#include "wx/arrstr.h" -#include "wx/convauto.h" - -// ---------------------------------------------------------------------------- -// constants -// ---------------------------------------------------------------------------- - -// the line termination type (kept wxTextFileType name for compability) -enum wxTextFileType -{ - wxTextFileType_None, // incomplete (the last line of the file only) - wxTextFileType_Unix, // line is terminated with 'LF' = 0xA = 10 = '\n' - wxTextFileType_Dos, // 'CR' 'LF' - wxTextFileType_Mac, // 'CR' = 0xD = 13 = '\r' - wxTextFileType_Os2 // 'CR' 'LF' -}; - -#include "wx/string.h" - -#if wxUSE_TEXTBUFFER - -#include "wx/dynarray.h" - -// ---------------------------------------------------------------------------- -// wxTextBuffer -// ---------------------------------------------------------------------------- - -WX_DEFINE_USER_EXPORTED_ARRAY_INT(wxTextFileType, - wxArrayLinesType, - class WXDLLIMPEXP_BASE); - -#endif // wxUSE_TEXTBUFFER - -class WXDLLIMPEXP_BASE wxTextBuffer -{ -public: - // constants and static functions - // default type for current platform (determined at compile time) - static const wxTextFileType typeDefault; - - // this function returns a string which is identical to "text" passed in - // except that the line terminator characters are changed to correspond the - // given type. Called with the default argument, the function translates - // the string to the native format (Unix for Unix, DOS for Windows, ...). - static wxString Translate(const wxString& text, - wxTextFileType type = typeDefault); - - // get the buffer termination string - static const wxChar *GetEOL(wxTextFileType type = typeDefault); - - // the static methods of this class are compiled in even when - // !wxUSE_TEXTBUFFER because they are used by the library itself, but the - // rest can be left out -#if wxUSE_TEXTBUFFER - - // buffer operations - // ----------------- - - // buffer exists? - bool Exists() const; - - // create the buffer if it doesn't already exist - bool Create(); - - // same as Create() but with (another) buffer name - bool Create(const wxString& strBufferName); - - // Open() also loads buffer in memory on success - bool Open(const wxMBConv& conv = wxConvAuto()); - - // same as Open() but with (another) buffer name - bool Open(const wxString& strBufferName, const wxMBConv& conv = wxConvAuto()); - - // closes the buffer and frees memory, losing all changes - bool Close(); - - // is buffer currently opened? - bool IsOpened() const { return m_isOpened; } - - // accessors - // --------- - - // get the number of lines in the buffer - size_t GetLineCount() const { return m_aLines.size(); } - - // the returned line may be modified (but don't add CR/LF at the end!) - wxString& GetLine(size_t n) const { return (wxString&)m_aLines[n]; } - wxString& operator[](size_t n) const { return (wxString&)m_aLines[n]; } - - // the current line has meaning only when you're using - // GetFirstLine()/GetNextLine() functions, it doesn't get updated when - // you're using "direct access" i.e. GetLine() - size_t GetCurrentLine() const { return m_nCurLine; } - void GoToLine(size_t n) { m_nCurLine = n; } - bool Eof() const { return m_nCurLine == m_aLines.size(); } - - // these methods allow more "iterator-like" traversal of the list of - // lines, i.e. you may write something like: - // for ( str = GetFirstLine(); !Eof(); str = GetNextLine() ) { ... } - - // NB: const is commented out because not all compilers understand - // 'mutable' keyword yet (m_nCurLine should be mutable) - wxString& GetFirstLine() /* const */ - { return m_aLines.empty() ? ms_eof : m_aLines[m_nCurLine = 0]; } - wxString& GetNextLine() /* const */ - { return ++m_nCurLine == m_aLines.size() ? ms_eof - : m_aLines[m_nCurLine]; } - wxString& GetPrevLine() /* const */ - { wxASSERT(m_nCurLine > 0); return m_aLines[--m_nCurLine]; } - wxString& GetLastLine() /* const */ - { m_nCurLine = m_aLines.size() - 1; return m_aLines.Last(); } - - // get the type of the line (see also GetEOL) - wxTextFileType GetLineType(size_t n) const { return m_aTypes[n]; } - - // guess the type of buffer - wxTextFileType GuessType() const; - - // get the name of the buffer - const wxChar *GetName() const { return m_strBufferName.c_str(); } - - // add/remove lines - // ---------------- - - // add a line to the end - void AddLine(const wxString& str, wxTextFileType type = typeDefault) - { m_aLines.push_back(str); m_aTypes.push_back(type); } - // insert a line before the line number n - void InsertLine(const wxString& str, - size_t n, - wxTextFileType type = typeDefault) - { - m_aLines.insert(m_aLines.begin() + n, str); - m_aTypes.insert(m_aTypes.begin()+n, type); - } - - // delete one line - void RemoveLine(size_t n) - { - m_aLines.erase(m_aLines.begin() + n); - m_aTypes.erase(m_aTypes.begin() + n); - } - - // remove all lines - void Clear() { m_aLines.clear(); m_aTypes.clear(); m_nCurLine = 0; } - - // change the buffer (default argument means "don't change type") - // possibly in another format - bool Write(wxTextFileType typeNew = wxTextFileType_None, - const wxMBConv& conv = wxConvAuto()); - - // dtor - virtual ~wxTextBuffer(); - -protected: - // ctors - // ----- - - // default ctor, use Open(string) - wxTextBuffer() { m_nCurLine = 0; m_isOpened = false; } - - // ctor from filename - wxTextBuffer(const wxString& strBufferName); - - enum wxTextBufferOpenMode { ReadAccess, WriteAccess }; - - // Must implement these in derived classes. - virtual bool OnExists() const = 0; - virtual bool OnOpen(const wxString &strBufferName, - wxTextBufferOpenMode openmode) = 0; - virtual bool OnClose() = 0; - virtual bool OnRead(const wxMBConv& conv) = 0; - virtual bool OnWrite(wxTextFileType typeNew, const wxMBConv& conv) = 0; - - static wxString ms_eof; // dummy string returned at EOF - wxString m_strBufferName; // name of the buffer - -private: - wxArrayLinesType m_aTypes; // type of each line - wxArrayString m_aLines; // lines of file - - size_t m_nCurLine; // number of current line in the buffer - - bool m_isOpened; // was the buffer successfully opened the last time? -#endif // wxUSE_TEXTBUFFER - - // copy ctor/assignment operator not implemented - wxTextBuffer(const wxTextBuffer&); - wxTextBuffer& operator=(const wxTextBuffer&); -}; - -#endif // _WX_TEXTBUFFER_H - diff --git a/wxWidgets/include/wx/textctrl.h b/wxWidgets/include/wx/textctrl.h deleted file mode 100644 index c69c17274b..0000000000 --- a/wxWidgets/include/wx/textctrl.h +++ /dev/null @@ -1,601 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: wx/textctrl.h -// Purpose: wxTextCtrlBase class - the interface of wxTextCtrl -// Author: Vadim Zeitlin -// Modified by: -// Created: 13.07.99 -// RCS-ID: $Id: textctrl.h 53135 2008-04-12 02:31:04Z VZ $ -// Copyright: (c) Vadim Zeitlin -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_TEXTCTRL_H_BASE_ -#define _WX_TEXTCTRL_H_BASE_ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -#include "wx/defs.h" - -#if wxUSE_TEXTCTRL - -#include "wx/control.h" // the base class -#include "wx/dynarray.h" // wxArrayInt -#include "wx/gdicmn.h" // wxPoint - -// Open Watcom 1.3 does allow only ios::rdbuf() while -// we want something with streambuf parameter -// Also, can't use streambuf if making or using a DLL :-( - -#if defined(__WATCOMC__) || \ - defined(__MWERKS__) || \ - (defined(__WINDOWS__) && (defined(WXUSINGDLL) || defined(WXMAKINGDLL))) - #define wxHAS_TEXT_WINDOW_STREAM 0 -#elif wxUSE_STD_IOSTREAM - #include "wx/ioswrap.h" - #define wxHAS_TEXT_WINDOW_STREAM 1 -#else - #define wxHAS_TEXT_WINDOW_STREAM 0 -#endif - -#if WXWIN_COMPATIBILITY_2_4 && !wxHAS_TEXT_WINDOW_STREAM - // define old flag if one could use it somewhere - #define NO_TEXT_WINDOW_STREAM -#endif - -class WXDLLIMPEXP_FWD_CORE wxTextCtrl; -class WXDLLIMPEXP_FWD_CORE wxTextCtrlBase; - -// ---------------------------------------------------------------------------- -// wxTextCtrl types -// ---------------------------------------------------------------------------- - -// wxTextPos is the position in the text -typedef long wxTextPos; - -// wxTextCoord is the line or row number (which should have been unsigned but -// is long for backwards compatibility) -typedef long wxTextCoord; - -// ---------------------------------------------------------------------------- -// constants -// ---------------------------------------------------------------------------- - -extern WXDLLEXPORT_DATA(const wxChar) wxTextCtrlNameStr[]; - -// this is intentionally not enum to avoid warning fixes with -// typecasting from enum type to wxTextCoord -const wxTextCoord wxOutOfRangeTextCoord = -1; -const wxTextCoord wxInvalidTextCoord = -2; - -// ---------------------------------------------------------------------------- -// wxTextCtrl style flags -// ---------------------------------------------------------------------------- - -#define wxTE_NO_VSCROLL 0x0002 -#define wxTE_AUTO_SCROLL 0x0008 - -#define wxTE_READONLY 0x0010 -#define wxTE_MULTILINE 0x0020 -#define wxTE_PROCESS_TAB 0x0040 - -// alignment flags -#define wxTE_LEFT 0x0000 // 0x0000 -#define wxTE_CENTER wxALIGN_CENTER_HORIZONTAL // 0x0100 -#define wxTE_RIGHT wxALIGN_RIGHT // 0x0200 -#define wxTE_CENTRE wxTE_CENTER - -// this style means to use RICHEDIT control and does something only under wxMSW -// and Win32 and is silently ignored under all other platforms -#define wxTE_RICH 0x0080 - -#define wxTE_PROCESS_ENTER 0x0400 -#define wxTE_PASSWORD 0x0800 - -// automatically detect the URLs and generate the events when mouse is -// moved/clicked over an URL -// -// this is for Win32 richedit and wxGTK2 multiline controls only so far -#define wxTE_AUTO_URL 0x1000 - -// by default, the Windows text control doesn't show the selection when it -// doesn't have focus - use this style to force it to always show it -#define wxTE_NOHIDESEL 0x2000 - -// use wxHSCROLL to not wrap text at all, wxTE_CHARWRAP to wrap it at any -// position and wxTE_WORDWRAP to wrap at words boundary -// -// if no wrapping style is given at all, the control wraps at word boundary -#define wxTE_DONTWRAP wxHSCROLL -#define wxTE_CHARWRAP 0x4000 // wrap at any position -#define wxTE_WORDWRAP 0x0001 // wrap only at words boundaries -#define wxTE_BESTWRAP 0x0000 // this is the default - -#if WXWIN_COMPATIBILITY_2_6 - // obsolete synonym - #define wxTE_LINEWRAP wxTE_CHARWRAP -#endif // WXWIN_COMPATIBILITY_2_6 - -// force using RichEdit version 2.0 or 3.0 instead of 1.0 (default) for -// wxTE_RICH controls - can be used together with or instead of wxTE_RICH -#define wxTE_RICH2 0x8000 - -// reuse wxTE_RICH2's value for CAPEDIT control on Windows CE -#if defined(__SMARTPHONE__) || defined(__POCKETPC__) -#define wxTE_CAPITALIZE wxTE_RICH2 -#else -#define wxTE_CAPITALIZE 0 -#endif - -// ---------------------------------------------------------------------------- -// wxTextCtrl file types -// ---------------------------------------------------------------------------- - -#define wxTEXT_TYPE_ANY 0 - -// ---------------------------------------------------------------------------- -// wxTextCtrl::HitTest return values -// ---------------------------------------------------------------------------- - -// the point asked is ... -enum wxTextCtrlHitTestResult -{ - wxTE_HT_UNKNOWN = -2, // this means HitTest() is simply not implemented - wxTE_HT_BEFORE, // either to the left or upper - wxTE_HT_ON_TEXT, // directly on - wxTE_HT_BELOW, // below [the last line] - wxTE_HT_BEYOND // after [the end of line] -}; -// ... the character returned - -// ---------------------------------------------------------------------------- -// Types for wxTextAttr -// ---------------------------------------------------------------------------- - -// Alignment - -enum wxTextAttrAlignment -{ - wxTEXT_ALIGNMENT_DEFAULT, - wxTEXT_ALIGNMENT_LEFT, - wxTEXT_ALIGNMENT_CENTRE, - wxTEXT_ALIGNMENT_CENTER = wxTEXT_ALIGNMENT_CENTRE, - wxTEXT_ALIGNMENT_RIGHT, - wxTEXT_ALIGNMENT_JUSTIFIED -}; - -// Flags to indicate which attributes are being applied - -#define wxTEXT_ATTR_TEXT_COLOUR 0x0001 -#define wxTEXT_ATTR_BACKGROUND_COLOUR 0x0002 -#define wxTEXT_ATTR_FONT_FACE 0x0004 -#define wxTEXT_ATTR_FONT_SIZE 0x0008 -#define wxTEXT_ATTR_FONT_WEIGHT 0x0010 -#define wxTEXT_ATTR_FONT_ITALIC 0x0020 -#define wxTEXT_ATTR_FONT_UNDERLINE 0x0040 -#define wxTEXT_ATTR_FONT \ - ( wxTEXT_ATTR_FONT_FACE | wxTEXT_ATTR_FONT_SIZE | wxTEXT_ATTR_FONT_WEIGHT | \ - wxTEXT_ATTR_FONT_ITALIC | wxTEXT_ATTR_FONT_UNDERLINE ) -#define wxTEXT_ATTR_ALIGNMENT 0x0080 -#define wxTEXT_ATTR_LEFT_INDENT 0x0100 -#define wxTEXT_ATTR_RIGHT_INDENT 0x0200 -#define wxTEXT_ATTR_TABS 0x0400 - -// ---------------------------------------------------------------------------- -// wxTextAttr: a structure containing the visual attributes of a text -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxTextAttr -{ -public: - // ctors - wxTextAttr() { Init(); } - wxTextAttr(const wxColour& colText, - const wxColour& colBack = wxNullColour, - const wxFont& font = wxNullFont, - wxTextAttrAlignment alignment = wxTEXT_ALIGNMENT_DEFAULT); - - // operations - void Init(); - - // merges the attributes of the base and the overlay objects and returns - // the result; the parameter attributes take precedence - // - // WARNING: the order of arguments is the opposite of Combine() - static wxTextAttr Merge(const wxTextAttr& base, const wxTextAttr& overlay) - { - return Combine(overlay, base, NULL); - } - - // merges the attributes of this object and overlay - void Merge(const wxTextAttr& overlay) - { - *this = Merge(*this, overlay); - } - - - // operators - void operator= (const wxTextAttr& attr); - - // setters - void SetTextColour(const wxColour& colText) { m_colText = colText; m_flags |= wxTEXT_ATTR_TEXT_COLOUR; } - void SetBackgroundColour(const wxColour& colBack) { m_colBack = colBack; m_flags |= wxTEXT_ATTR_BACKGROUND_COLOUR; } - void SetFont(const wxFont& font, long flags = wxTEXT_ATTR_FONT) { m_font = font; m_flags |= flags; } - void SetAlignment(wxTextAttrAlignment alignment) { m_textAlignment = alignment; m_flags |= wxTEXT_ATTR_ALIGNMENT; } - void SetTabs(const wxArrayInt& tabs) { m_tabs = tabs; m_flags |= wxTEXT_ATTR_TABS; } - void SetLeftIndent(int indent, int subIndent = 0) { m_leftIndent = indent; m_leftSubIndent = subIndent; m_flags |= wxTEXT_ATTR_LEFT_INDENT; } - void SetRightIndent(int indent) { m_rightIndent = indent; m_flags |= wxTEXT_ATTR_RIGHT_INDENT; } - void SetFlags(long flags) { m_flags = flags; } - - // accessors - bool HasTextColour() const { return m_colText.Ok() && HasFlag(wxTEXT_ATTR_TEXT_COLOUR) ; } - bool HasBackgroundColour() const { return m_colBack.Ok() && HasFlag(wxTEXT_ATTR_BACKGROUND_COLOUR) ; } - bool HasFont() const { return m_font.Ok() && HasFlag(wxTEXT_ATTR_FONT) ; } - bool HasAlignment() const { return (m_textAlignment != wxTEXT_ALIGNMENT_DEFAULT) && ((m_flags & wxTEXT_ATTR_ALIGNMENT) != 0) ; } - bool HasTabs() const { return (m_flags & wxTEXT_ATTR_TABS) != 0 ; } - bool HasLeftIndent() const { return (m_flags & wxTEXT_ATTR_LEFT_INDENT) != 0 ; } - bool HasRightIndent() const { return (m_flags & wxTEXT_ATTR_RIGHT_INDENT) != 0 ; } - bool HasFlag(long flag) const { return (m_flags & flag) != 0; } - - const wxColour& GetTextColour() const { return m_colText; } - const wxColour& GetBackgroundColour() const { return m_colBack; } - const wxFont& GetFont() const { return m_font; } - wxTextAttrAlignment GetAlignment() const { return m_textAlignment; } - const wxArrayInt& GetTabs() const { return m_tabs; } - long GetLeftIndent() const { return m_leftIndent; } - long GetLeftSubIndent() const { return m_leftSubIndent; } - long GetRightIndent() const { return m_rightIndent; } - long GetFlags() const { return m_flags; } - - // returns false if we have any attributes set, true otherwise - bool IsDefault() const - { - return !HasTextColour() && !HasBackgroundColour() && !HasFont() && !HasAlignment() && - !HasTabs() && !HasLeftIndent() && !HasRightIndent() ; - } - - // return the attribute having the valid font and colours: it uses the - // attributes set in attr and falls back first to attrDefault and then to - // the text control font/colours for those attributes which are not set - static wxTextAttr Combine(const wxTextAttr& attr, - const wxTextAttr& attrDef, - const wxTextCtrlBase *text); - -private: - long m_flags; - wxColour m_colText, - m_colBack; - wxFont m_font; - wxTextAttrAlignment m_textAlignment; - wxArrayInt m_tabs; // array of int: tab stops in 1/10 mm - int m_leftIndent; // left indent in 1/10 mm - int m_leftSubIndent; // left indent for all but the first - // line in a paragraph relative to the - // first line, in 1/10 mm - int m_rightIndent; // right indent in 1/10 mm -}; - -// ---------------------------------------------------------------------------- -// wxTextCtrl: a single or multiple line text zone where user can enter and -// edit text -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxTextCtrlBase : public wxControl -#if wxHAS_TEXT_WINDOW_STREAM - , public wxSTD streambuf -#endif - -{ -public: - // creation - // -------- - - wxTextCtrlBase(){} - virtual ~wxTextCtrlBase(){} - - // accessors - // --------- - - virtual wxString GetValue() const = 0; - virtual bool IsEmpty() const { return GetValue().empty(); } - - virtual void SetValue(const wxString& value) - { DoSetValue(value, SetValue_SendEvent); } - virtual void ChangeValue(const wxString& value) - { DoSetValue(value); } - - virtual wxString GetRange(long from, long to) const; - - virtual int GetLineLength(long lineNo) const = 0; - virtual wxString GetLineText(long lineNo) const = 0; - virtual int GetNumberOfLines() const = 0; - - virtual bool IsModified() const = 0; - virtual bool IsEditable() const = 0; - - // more readable flag testing methods - bool IsSingleLine() const { return !HasFlag(wxTE_MULTILINE); } - bool IsMultiLine() const { return !IsSingleLine(); } - - // If the return values from and to are the same, there is no selection. - virtual void GetSelection(long* from, long* to) const = 0; - - virtual wxString GetStringSelection() const; - - // operations - // ---------- - - // editing - virtual void Clear() = 0; - virtual void Replace(long from, long to, const wxString& value) = 0; - virtual void Remove(long from, long to) = 0; - - // load/save the control's contents from/to a file - bool LoadFile(const wxString& file, int fileType = wxTEXT_TYPE_ANY) { return DoLoadFile(file, fileType); } - bool SaveFile(const wxString& file = wxEmptyString, int fileType = wxTEXT_TYPE_ANY); - - // implementation for loading/saving - virtual bool DoLoadFile(const wxString& file, int fileType); - virtual bool DoSaveFile(const wxString& file, int fileType); - - // sets/clears the dirty flag - virtual void MarkDirty() = 0; - virtual void DiscardEdits() = 0; - void SetModified(bool modified) - { - if ( modified ) - MarkDirty(); - else - DiscardEdits(); - } - - // set the max number of characters which may be entered in a single line - // text control - virtual void SetMaxLength(unsigned long WXUNUSED(len)) { } - - // writing text inserts it at the current position, appending always - // inserts it at the end - virtual void WriteText(const wxString& text) = 0; - virtual void AppendText(const wxString& text) = 0; - - // insert the character which would have resulted from this key event, - // return true if anything has been inserted - virtual bool EmulateKeyPress(const wxKeyEvent& event); - - // 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 GetStyle(long position, wxTextAttr& style); - virtual bool SetDefaultStyle(const wxTextAttr& style); - virtual const wxTextAttr& GetDefaultStyle() const; - - // 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 = 0; - virtual bool PositionToXY(long pos, long *x, long *y) const = 0; - - virtual void ShowPosition(long pos) = 0; - - // find the character at position given in pixels - // - // NB: pt is in device coords (not adjusted for the client area origin nor - // scrolling) - virtual wxTextCtrlHitTestResult HitTest(const wxPoint& pt, long *pos) const; - virtual wxTextCtrlHitTestResult HitTest(const wxPoint& pt, - wxTextCoord *col, - wxTextCoord *row) const; - - // Clipboard operations - virtual void Copy() = 0; - virtual void Cut() = 0; - virtual void Paste() = 0; - - virtual bool CanCopy() const; - virtual bool CanCut() const; - virtual bool CanPaste() const; - - // Undo/redo - virtual void Undo() = 0; - virtual void Redo() = 0; - - virtual bool CanUndo() const = 0; - virtual bool CanRedo() const = 0; - - // Insertion point - virtual void SetInsertionPoint(long pos) = 0; - virtual void SetInsertionPointEnd() = 0; - virtual long GetInsertionPoint() const = 0; - virtual wxTextPos GetLastPosition() const = 0; - - virtual void SetSelection(long from, long to) = 0; - virtual void SelectAll(); - virtual void SetEditable(bool editable) = 0; - - // stream-like insertion operators: these are always available, whether we - // were, or not, compiled with streambuf support - wxTextCtrl& operator<<(const wxString& s); - wxTextCtrl& operator<<(int i); - wxTextCtrl& operator<<(long i); - wxTextCtrl& operator<<(float f); - wxTextCtrl& operator<<(double d); - wxTextCtrl& operator<<(const wxChar c); - - // generate the wxEVT_COMMAND_TEXT_UPDATED event, like SetValue() does - void SendTextUpdatedEvent(); - - // do the window-specific processing after processing the update event - virtual void DoUpdateWindowUI(wxUpdateUIEvent& event); - - virtual bool ShouldInheritColours() const { return false; } - -protected: - // override streambuf method -#if wxHAS_TEXT_WINDOW_STREAM - int overflow(int i); -#endif // wxHAS_TEXT_WINDOW_STREAM - - // flags for DoSetValue(): common part of SetValue() and ChangeValue() and - // also used to implement WriteText() in wxMSW - enum - { - SetValue_SendEvent = 1, - SetValue_SelectionOnly = 2 - }; - - virtual void DoSetValue(const wxString& value, int flags = 0) = 0; - - - // the name of the last file loaded with LoadFile() which will be used by - // SaveFile() by default - wxString m_filename; - - // the text style which will be used for any new text added to the control - wxTextAttr m_defaultStyle; - - DECLARE_NO_COPY_CLASS(wxTextCtrlBase) - DECLARE_ABSTRACT_CLASS(wxTextCtrlBase) -}; - -// ---------------------------------------------------------------------------- -// include the platform-dependent class definition -// ---------------------------------------------------------------------------- - -#if defined(__WXX11__) - #include "wx/x11/textctrl.h" -#elif defined(__WXUNIVERSAL__) - #include "wx/univ/textctrl.h" -#elif defined(__SMARTPHONE__) && defined(__WXWINCE__) - #include "wx/msw/wince/textctrlce.h" -#elif defined(__WXMSW__) - #include "wx/msw/textctrl.h" -#elif defined(__WXMOTIF__) - #include "wx/motif/textctrl.h" -#elif defined(__WXGTK20__) - #include "wx/gtk/textctrl.h" -#elif defined(__WXGTK__) - #include "wx/gtk1/textctrl.h" -#elif defined(__WXMAC__) - #include "wx/mac/textctrl.h" -#elif defined(__WXCOCOA__) - #include "wx/cocoa/textctrl.h" -#elif defined(__WXPM__) - #include "wx/os2/textctrl.h" -#endif - -// ---------------------------------------------------------------------------- -// wxTextCtrl events -// ---------------------------------------------------------------------------- - -#if !WXWIN_COMPATIBILITY_EVENT_TYPES - -BEGIN_DECLARE_EVENT_TYPES() - DECLARE_EVENT_TYPE(wxEVT_COMMAND_TEXT_UPDATED, 7) - DECLARE_EVENT_TYPE(wxEVT_COMMAND_TEXT_ENTER, 8) - DECLARE_EVENT_TYPE(wxEVT_COMMAND_TEXT_URL, 13) - DECLARE_EVENT_TYPE(wxEVT_COMMAND_TEXT_MAXLEN, 14) -END_DECLARE_EVENT_TYPES() - -#endif // !WXWIN_COMPATIBILITY_EVENT_TYPES - -class WXDLLEXPORT wxTextUrlEvent : public wxCommandEvent -{ -public: - wxTextUrlEvent(int winid, const wxMouseEvent& evtMouse, - long start, long end) - : wxCommandEvent(wxEVT_COMMAND_TEXT_URL, winid) - , m_evtMouse(evtMouse), m_start(start), m_end(end) - { } - - // get the mouse event which happend over the URL - const wxMouseEvent& GetMouseEvent() const { return m_evtMouse; } - - // get the start of the URL - long GetURLStart() const { return m_start; } - - // get the end of the URL - long GetURLEnd() const { return m_end; } - -protected: - // the corresponding mouse event - wxMouseEvent m_evtMouse; - - // the start and end indices of the URL in the text control - long m_start, - m_end; - -private: - DECLARE_DYNAMIC_CLASS_NO_COPY(wxTextUrlEvent) - -public: - // for wxWin RTTI only, don't use - wxTextUrlEvent() : m_evtMouse(), m_start(0), m_end(0) { } -}; - -typedef void (wxEvtHandler::*wxTextUrlEventFunction)(wxTextUrlEvent&); - -#define wxTextEventHandler(func) wxCommandEventHandler(func) -#define wxTextUrlEventHandler(func) \ - (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxTextUrlEventFunction, &func) - -#define wx__DECLARE_TEXTEVT(evt, id, fn) \ - wx__DECLARE_EVT1(wxEVT_COMMAND_TEXT_ ## evt, id, wxTextEventHandler(fn)) - -#define wx__DECLARE_TEXTURLEVT(evt, id, fn) \ - wx__DECLARE_EVT1(wxEVT_COMMAND_TEXT_ ## evt, id, wxTextUrlEventHandler(fn)) - -#define EVT_TEXT(id, fn) wx__DECLARE_TEXTEVT(UPDATED, id, fn) -#define EVT_TEXT_ENTER(id, fn) wx__DECLARE_TEXTEVT(ENTER, id, fn) -#define EVT_TEXT_URL(id, fn) wx__DECLARE_TEXTURLEVT(URL, id, fn) -#define EVT_TEXT_MAXLEN(id, fn) wx__DECLARE_TEXTEVT(MAXLEN, id, fn) - -#if wxHAS_TEXT_WINDOW_STREAM - -// ---------------------------------------------------------------------------- -// wxStreamToTextRedirector: this class redirects all data sent to the given -// C++ stream to the wxTextCtrl given to its ctor during its lifetime. -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxStreamToTextRedirector -{ -private: - void Init(wxTextCtrl *text) - { - m_sbufOld = m_ostr.rdbuf(); - m_ostr.rdbuf(text); - } - -public: - wxStreamToTextRedirector(wxTextCtrl *text) - : m_ostr(wxSTD cout) - { - Init(text); - } - - wxStreamToTextRedirector(wxTextCtrl *text, wxSTD ostream *ostr) - : m_ostr(*ostr) - { - Init(text); - } - - ~wxStreamToTextRedirector() - { - m_ostr.rdbuf(m_sbufOld); - } - -private: - // the stream we're redirecting - wxSTD ostream& m_ostr; - - // the old streambuf (before we changed it) - wxSTD streambuf *m_sbufOld; -}; - -#endif // wxHAS_TEXT_WINDOW_STREAM - -#endif // wxUSE_TEXTCTRL - -#endif - // _WX_TEXTCTRL_H_BASE_ diff --git a/wxWidgets/include/wx/textdlg.h b/wxWidgets/include/wx/textdlg.h deleted file mode 100644 index 4db4e33fba..0000000000 --- a/wxWidgets/include/wx/textdlg.h +++ /dev/null @@ -1,23 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: textdlg.h -// Purpose: wxTextEntryDialog class -// Author: Julian Smart -// Modified by: -// Created: 01/02/97 -// RCS-ID: $Id: textdlg.h 27408 2004-05-23 20:53:33Z JS $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_TEXTDLG_H_BASE_ -#define _WX_TEXTDLG_H_BASE_ - -#include "wx/generic/textdlgg.h" - -#if WXWIN_COMPATIBILITY_2_4 - // for wxGetNumberFromUser() - #include "wx/numdlg.h" -#endif // WXWIN_COMPATIBILITY_2_4 - -#endif // _WX_TEXTDLG_H_BASE_ - diff --git a/wxWidgets/include/wx/textfile.h b/wxWidgets/include/wx/textfile.h deleted file mode 100644 index bfbed0b969..0000000000 --- a/wxWidgets/include/wx/textfile.h +++ /dev/null @@ -1,62 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: wx/textfile.h -// Purpose: class wxTextFile to work with text files of _small_ size -// (file is fully loaded in memory) and which understands CR/LF -// differences between platforms. -// Author: Vadim Zeitlin -// Modified by: -// Created: 03.04.98 -// RCS-ID: $Id: textfile.h 38570 2006-04-05 14:37:47Z VZ $ -// Copyright: (c) 1998 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr> -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_TEXTFILE_H -#define _WX_TEXTFILE_H - -#include "wx/defs.h" - -#include "wx/textbuf.h" - -#if wxUSE_TEXTFILE - -#include "wx/file.h" - -// ---------------------------------------------------------------------------- -// wxTextFile -// ---------------------------------------------------------------------------- - -class WXDLLIMPEXP_BASE wxTextFile : public wxTextBuffer -{ -public: - // constructors - wxTextFile() { } - wxTextFile(const wxString& strFileName); - -protected: - // implement the base class pure virtuals - virtual bool OnExists() const; - virtual bool OnOpen(const wxString &strBufferName, - wxTextBufferOpenMode OpenMode); - virtual bool OnClose(); - virtual bool OnRead(const wxMBConv& conv); - virtual bool OnWrite(wxTextFileType typeNew, const wxMBConv& conv); - -private: - - wxFile m_file; - - DECLARE_NO_COPY_CLASS(wxTextFile) -}; - -#else // !wxUSE_TEXTFILE - -// old code relies on the static methods of wxTextFile being always available -// and they still are available in wxTextBuffer (even if !wxUSE_TEXTBUFFER), so -// make it possible to use them in a backwards compatible way -typedef wxTextBuffer wxTextFile; - -#endif // wxUSE_TEXTFILE/!wxUSE_TEXTFILE - -#endif // _WX_TEXTFILE_H - diff --git a/wxWidgets/include/wx/tglbtn.h b/wxWidgets/include/wx/tglbtn.h deleted file mode 100644 index ebc83ddcf8..0000000000 --- a/wxWidgets/include/wx/tglbtn.h +++ /dev/null @@ -1,51 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/tglbtn.h -// Purpose: This dummy header includes the proper header file for the -// system we're compiling under. -// Author: John Norris, minor changes by Axel Schlueter -// Modified by: -// Created: 08.02.01 -// RCS-ID: $Id: tglbtn.h 39293 2006-05-23 17:53:50Z JS $ -// Copyright: (c) 2000 Johnny C. Norris II -// License: wxWindows Licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_TOGGLEBUTTON_H_BASE_ -#define _WX_TOGGLEBUTTON_H_BASE_ - -#include "wx/defs.h" - -#if wxUSE_TOGGLEBTN - -#include "wx/event.h" -#include "wx/control.h" // base class - -BEGIN_DECLARE_EVENT_TYPES() - DECLARE_EVENT_TYPE(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, 19) -END_DECLARE_EVENT_TYPES() - -#define EVT_TOGGLEBUTTON(id, fn) \ - wx__DECLARE_EVT1(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, id, wxCommandEventHandler(fn)) - -#if defined(__WXUNIVERSAL__) - #include "wx/univ/tglbtn.h" -#elif defined(__WXMSW__) - #include "wx/msw/tglbtn.h" -#elif defined(__WXGTK20__) - #include "wx/gtk/tglbtn.h" -#elif defined(__WXGTK__) - #include "wx/gtk1/tglbtn.h" -# elif defined(__WXMOTIF__) - #include "wx/motif/tglbtn.h" -#elif defined(__WXMAC__) - #include "wx/mac/tglbtn.h" -#elif defined(__WXPALMOS__) - #include "wx/palmos/tglbtn.h" -#elif defined(__WXPM__) - #include "wx/os2/tglbtn.h" -#endif - -#endif // wxUSE_TOGGLEBTN - -#endif // _WX_TOGGLEBUTTON_H_BASE_ - diff --git a/wxWidgets/include/wx/thread.h b/wxWidgets/include/wx/thread.h deleted file mode 100644 index 795e32c984..0000000000 --- a/wxWidgets/include/wx/thread.h +++ /dev/null @@ -1,764 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/thread.h -// Purpose: Thread API -// Author: Guilhem Lavaux -// Modified by: Vadim Zeitlin (modifications partly inspired by omnithreads -// package from Olivetti & Oracle Research Laboratory) -// Created: 04/13/98 -// RCS-ID: $Id: thread.h 66924 2011-02-16 22:58:53Z JS $ -// Copyright: (c) Guilhem Lavaux -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_THREAD_H_ -#define _WX_THREAD_H_ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -// get the value of wxUSE_THREADS configuration flag -#include "wx/defs.h" - -#if wxUSE_THREADS - -// Windows headers define it -#ifdef Yield - #undef Yield -#endif - -// ---------------------------------------------------------------------------- -// constants -// ---------------------------------------------------------------------------- - -enum wxMutexError -{ - wxMUTEX_NO_ERROR = 0, // operation completed successfully - wxMUTEX_INVALID, // mutex hasn't been initialized - wxMUTEX_DEAD_LOCK, // mutex is already locked by the calling thread - wxMUTEX_BUSY, // mutex is already locked by another thread - wxMUTEX_UNLOCKED, // attempt to unlock a mutex which is not locked - wxMUTEX_MISC_ERROR // any other error -}; - -enum wxCondError -{ - wxCOND_NO_ERROR = 0, - wxCOND_INVALID, - wxCOND_TIMEOUT, // WaitTimeout() has timed out - wxCOND_MISC_ERROR -}; - -enum wxSemaError -{ - wxSEMA_NO_ERROR = 0, - wxSEMA_INVALID, // semaphore hasn't been initialized successfully - wxSEMA_BUSY, // returned by TryWait() if Wait() would block - wxSEMA_TIMEOUT, // returned by WaitTimeout() - wxSEMA_OVERFLOW, // Post() would increase counter past the max - wxSEMA_MISC_ERROR -}; - -enum wxThreadError -{ - wxTHREAD_NO_ERROR = 0, // No error - wxTHREAD_NO_RESOURCE, // No resource left to create a new thread - wxTHREAD_RUNNING, // The thread is already running - wxTHREAD_NOT_RUNNING, // The thread isn't running - wxTHREAD_KILLED, // Thread we waited for had to be killed - wxTHREAD_MISC_ERROR // Some other error -}; - -enum wxThreadKind -{ - wxTHREAD_DETACHED, - wxTHREAD_JOINABLE -}; - -// defines the interval of priority -enum -{ - WXTHREAD_MIN_PRIORITY = 0u, - WXTHREAD_DEFAULT_PRIORITY = 50u, - WXTHREAD_MAX_PRIORITY = 100u -}; - -// There are 2 types of mutexes: normal mutexes and recursive ones. The attempt -// to lock a normal mutex by a thread which already owns it results in -// undefined behaviour (it always works under Windows, it will almost always -// result in a deadlock under Unix). Locking a recursive mutex in such -// situation always succeeds and it must be unlocked as many times as it has -// been locked. -// -// However recursive mutexes have several important drawbacks: first, in the -// POSIX implementation, they're less efficient. Second, and more importantly, -// they CAN NOT BE USED WITH CONDITION VARIABLES under Unix! Using them with -// wxCondition will work under Windows and some Unices (notably Linux) but will -// deadlock under other Unix versions (e.g. Solaris). As it might be difficult -// to ensure that a recursive mutex is not used with wxCondition, it is a good -// idea to avoid using recursive mutexes at all. Also, the last problem with -// them is that some (older) Unix versions don't support this at all -- which -// results in a configure warning when building and a deadlock when using them. -enum wxMutexType -{ - // normal mutex: try to always use this one - wxMUTEX_DEFAULT, - - // recursive mutex: don't use these ones with wxCondition - wxMUTEX_RECURSIVE -}; - -// forward declarations -class WXDLLIMPEXP_FWD_BASE wxThreadHelper; -class WXDLLIMPEXP_FWD_BASE wxConditionInternal; -class WXDLLIMPEXP_FWD_BASE wxMutexInternal; -class WXDLLIMPEXP_FWD_BASE wxSemaphoreInternal; -class WXDLLIMPEXP_FWD_BASE wxThreadInternal; - -// ---------------------------------------------------------------------------- -// A mutex object is a synchronization object whose state is set to signaled -// when it is not owned by any thread, and nonsignaled when it is owned. Its -// name comes from its usefulness in coordinating mutually-exclusive access to -// a shared resource. Only one thread at a time can own a mutex object. -// ---------------------------------------------------------------------------- - -// you should consider wxMutexLocker whenever possible instead of directly -// working with wxMutex class - it is safer -class WXDLLIMPEXP_BASE wxMutex -{ -public: - // constructor & destructor - // ------------------------ - - // create either default (always safe) or recursive mutex - wxMutex(wxMutexType mutexType = wxMUTEX_DEFAULT); - - // destroys the mutex kernel object - ~wxMutex(); - - // test if the mutex has been created successfully - bool IsOk() const; - - // mutex operations - // ---------------- - - // Lock the mutex, blocking on it until it is unlocked by the other thread. - // The result of locking a mutex already locked by the current thread - // depend on the mutex type. - // - // The caller must call Unlock() later if Lock() returned wxMUTEX_NO_ERROR. - wxMutexError Lock(); - - // Try to lock the mutex: if it is currently locked, return immediately - // with an error. Otherwise the caller must call Unlock(). - wxMutexError TryLock(); - - // Unlock the mutex. It is an error to unlock an already unlocked mutex - wxMutexError Unlock(); - -protected: - wxMutexInternal *m_internal; - - friend class wxConditionInternal; - - DECLARE_NO_COPY_CLASS(wxMutex) -}; - -// a helper class which locks the mutex in the ctor and unlocks it in the dtor: -// this ensures that mutex is always unlocked, even if the function returns or -// throws an exception before it reaches the end -class WXDLLIMPEXP_BASE wxMutexLocker -{ -public: - // lock the mutex in the ctor - wxMutexLocker(wxMutex& mutex) - : m_isOk(false), m_mutex(mutex) - { m_isOk = ( m_mutex.Lock() == wxMUTEX_NO_ERROR ); } - - // returns true if mutex was successfully locked in ctor - bool IsOk() const - { return m_isOk; } - - // unlock the mutex in dtor - ~wxMutexLocker() - { if ( IsOk() ) m_mutex.Unlock(); } - -private: - // no assignment operator nor copy ctor - wxMutexLocker(const wxMutexLocker&); - wxMutexLocker& operator=(const wxMutexLocker&); - - bool m_isOk; - wxMutex& m_mutex; -}; - -// ---------------------------------------------------------------------------- -// Critical section: this is the same as mutex but is only visible to the -// threads of the same process. For the platforms which don't have native -// support for critical sections, they're implemented entirely in terms of -// mutexes. -// -// NB: wxCriticalSection object does not allocate any memory in its ctor -// which makes it possible to have static globals of this class -// ---------------------------------------------------------------------------- - -// in order to avoid any overhead under platforms where critical sections are -// just mutexes make all wxCriticalSection class functions inline -#if !defined(__WXMSW__) && !defined(__WXMAC__) - #define wxCRITSECT_IS_MUTEX 1 - - #define wxCRITSECT_INLINE inline -#else // MSW - #define wxCRITSECT_IS_MUTEX 0 - - #define wxCRITSECT_INLINE -#endif // MSW/!MSW - -// you should consider wxCriticalSectionLocker whenever possible instead of -// directly working with wxCriticalSection class - it is safer -class WXDLLIMPEXP_BASE wxCriticalSection -{ -public: - // ctor & dtor - wxCRITSECT_INLINE wxCriticalSection(); - wxCRITSECT_INLINE ~wxCriticalSection(); - - // enter the section (the same as locking a mutex) - wxCRITSECT_INLINE void Enter(); - - // leave the critical section (same as unlocking a mutex) - wxCRITSECT_INLINE void Leave(); - -private: -#if wxCRITSECT_IS_MUTEX - wxMutex m_mutex; -#elif defined(__WXMSW__) - // we can't allocate any memory in the ctor, so use placement new - - // unfortunately, we have to hardcode the sizeof() here because we can't - // include windows.h from this public header and we also have to use the - // union to force the correct (i.e. maximal) alignment - // - // if CRITICAL_SECTION size changes in Windows, you'll get an assert from - // thread.cpp and will need to increase the buffer size - // - // finally, we need this typedef instead of declaring m_buffer directly - // because otherwise the assert mentioned above wouldn't compile with some - // compilers (notably CodeWarrior 8) -#ifdef __WIN64__ - typedef char wxCritSectBuffer[40]; -#else // __WIN32__ - typedef char wxCritSectBuffer[24]; -#endif - union - { - unsigned long m_dummy1; - void *m_dummy2; - - wxCritSectBuffer m_buffer; - }; -#elif defined(__WXMAC__) - void *m_critRegion ; -#endif // Unix&OS2/Win32 - - DECLARE_NO_COPY_CLASS(wxCriticalSection) -}; - -#if wxCRITSECT_IS_MUTEX - // implement wxCriticalSection using mutexes - inline wxCriticalSection::wxCriticalSection() { } - inline wxCriticalSection::~wxCriticalSection() { } - - inline void wxCriticalSection::Enter() { (void)m_mutex.Lock(); } - inline void wxCriticalSection::Leave() { (void)m_mutex.Unlock(); } -#endif // wxCRITSECT_IS_MUTEX - -#undef wxCRITSECT_INLINE -#undef wxCRITSECT_IS_MUTEX - -// wxCriticalSectionLocker is the same to critical sections as wxMutexLocker is -// to mutexes -class WXDLLIMPEXP_BASE wxCriticalSectionLocker -{ -public: - wxCriticalSectionLocker(wxCriticalSection& cs) - : m_critsect(cs) - { - m_critsect.Enter(); - } - - ~wxCriticalSectionLocker() - { - m_critsect.Leave(); - } - -private: - wxCriticalSection& m_critsect; - - DECLARE_NO_COPY_CLASS(wxCriticalSectionLocker) -}; - -// ---------------------------------------------------------------------------- -// wxCondition models a POSIX condition variable which allows one (or more) -// thread(s) to wait until some condition is fulfilled -// ---------------------------------------------------------------------------- - -class WXDLLIMPEXP_BASE wxCondition -{ -public: - // Each wxCondition object is associated with a (single) wxMutex object. - // The mutex object MUST be locked before calling Wait() - wxCondition(wxMutex& mutex); - - // dtor is not virtual, don't use this class polymorphically - ~wxCondition(); - - // return true if the condition has been created successfully - bool IsOk() const; - - // NB: the associated mutex MUST be locked beforehand by the calling thread - // - // it atomically releases the lock on the associated mutex - // and starts waiting to be woken up by a Signal()/Broadcast() - // once its signaled, then it will wait until it can reacquire - // the lock on the associated mutex object, before returning. - wxCondError Wait(); - - // exactly as Wait() except that it may also return if the specified - // timeout elapses even if the condition hasn't been signalled: in this - // case, the return value is false, otherwise (i.e. in case of a normal - // return) it is true - // - // the timeout parameter specifies an interval that needs to be waited for - // in milliseconds - wxCondError WaitTimeout(unsigned long milliseconds); - - // NB: the associated mutex may or may not be locked by the calling thread - // - // this method unblocks one thread if any are blocking on the condition. - // if no thread is blocking in Wait(), then the signal is NOT remembered - // The thread which was blocking on Wait() will then reacquire the lock - // on the associated mutex object before returning - wxCondError Signal(); - - // NB: the associated mutex may or may not be locked by the calling thread - // - // this method unblocks all threads if any are blocking on the condition. - // if no thread is blocking in Wait(), then the signal is NOT remembered - // The threads which were blocking on Wait() will then reacquire the lock - // on the associated mutex object before returning. - wxCondError Broadcast(); - - -#if WXWIN_COMPATIBILITY_2_6 - // deprecated version, don't use - wxDEPRECATED( bool Wait(unsigned long milliseconds) ); -#endif // WXWIN_COMPATIBILITY_2_6 - -private: - wxConditionInternal *m_internal; - - DECLARE_NO_COPY_CLASS(wxCondition) -}; - -#if WXWIN_COMPATIBILITY_2_6 - inline bool wxCondition::Wait(unsigned long milliseconds) - { return WaitTimeout(milliseconds) == wxCOND_NO_ERROR; } -#endif // WXWIN_COMPATIBILITY_2_6 - -// ---------------------------------------------------------------------------- -// wxSemaphore: a counter limiting the number of threads concurrently accessing -// a shared resource -// ---------------------------------------------------------------------------- - -class WXDLLIMPEXP_BASE wxSemaphore -{ -public: - // specifying a maxcount of 0 actually makes wxSemaphore behave as if there - // is no upper limit, if maxcount is 1 the semaphore behaves as a mutex - wxSemaphore( int initialcount = 0, int maxcount = 0 ); - - // dtor is not virtual, don't use this class polymorphically - ~wxSemaphore(); - - // return true if the semaphore has been created successfully - bool IsOk() const; - - // wait indefinitely, until the semaphore count goes beyond 0 - // and then decrement it and return (this method might have been called - // Acquire()) - wxSemaError Wait(); - - // same as Wait(), but does not block, returns wxSEMA_NO_ERROR if - // successful and wxSEMA_BUSY if the count is currently zero - wxSemaError TryWait(); - - // same as Wait(), but as a timeout limit, returns wxSEMA_NO_ERROR if the - // semaphore was acquired and wxSEMA_TIMEOUT if the timeout has elapsed - wxSemaError WaitTimeout(unsigned long milliseconds); - - // increments the semaphore count and signals one of the waiting threads - wxSemaError Post(); - -private: - wxSemaphoreInternal *m_internal; - - DECLARE_NO_COPY_CLASS(wxSemaphore) -}; - -// ---------------------------------------------------------------------------- -// wxThread: class encapsulating a thread of execution -// ---------------------------------------------------------------------------- - -// there are two different kinds of threads: joinable and detached (default) -// ones. Only joinable threads can return a return code and only detached -// threads auto-delete themselves - the user should delete the joinable -// threads manually. - -// NB: in the function descriptions the words "this thread" mean the thread -// created by the wxThread object while "main thread" is the thread created -// during the process initialization (a.k.a. the GUI thread) - -// On VMS thread pointers are 64 bits (also needed for other systems??? -#ifdef __VMS - typedef unsigned long long wxThreadIdType; -#else - typedef unsigned long wxThreadIdType; -#endif - -class WXDLLIMPEXP_BASE wxThread -{ -public: - // the return type for the thread function - typedef void *ExitCode; - - // static functions - // Returns the wxThread object for the calling thread. NULL is returned - // if the caller is the main thread (but it's recommended to use - // IsMain() and only call This() for threads other than the main one - // because NULL is also returned on error). If the thread wasn't - // created with wxThread class, the returned value is undefined. - static wxThread *This(); - - // Returns true if current thread is the main thread. - static bool IsMain(); - - // Release the rest of our time slice letting the other threads run - static void Yield(); - - // Sleep during the specified period of time in milliseconds - // - // NB: at least under MSW worker threads can not call ::wxSleep()! - static void Sleep(unsigned long milliseconds); - - // get the number of system CPUs - useful with SetConcurrency() - // (the "best" value for it is usually number of CPUs + 1) - // - // Returns -1 if unknown, number of CPUs otherwise - static int GetCPUCount(); - - // Get the platform specific thread ID and return as a long. This - // can be used to uniquely identify threads, even if they are not - // wxThreads. This is used by wxPython. - static wxThreadIdType GetCurrentId(); - - // sets the concurrency level: this is, roughly, the number of threads - // the system tries to schedule to run in parallel. 0 means the - // default value (usually acceptable, but may not yield the best - // performance for this process) - // - // Returns true on success, false otherwise (if not implemented, for - // example) - static bool SetConcurrency(size_t level); - - // constructor only creates the C++ thread object and doesn't create (or - // start) the real thread - wxThread(wxThreadKind kind = wxTHREAD_DETACHED); - - // functions that change the thread state: all these can only be called - // from _another_ thread (typically the thread that created this one, e.g. - // the main thread), not from the thread itself - - // create a new thread and optionally set the stack size on - // platforms that support that - call Run() to start it - // (special cased for watcom which won't accept 0 default) - - wxThreadError Create(unsigned int stackSize = 0); - - // starts execution of the thread - from the moment Run() is called - // the execution of wxThread::Entry() may start at any moment, caller - // shouldn't suppose that it starts after (or before) Run() returns. - wxThreadError Run(); - - // stops the thread if it's running and deletes the wxThread object if - // this is a detached thread freeing its memory - otherwise (for - // joinable threads) you still need to delete wxThread object - // yourself. - // - // this function only works if the thread calls TestDestroy() - // periodically - the thread will only be deleted the next time it - // does it! - // - // will fill the rc pointer with the thread exit code if it's !NULL - wxThreadError Delete(ExitCode *rc = (ExitCode *)NULL); - - // waits for a joinable thread to finish and returns its exit code - // - // Returns (ExitCode)-1 on error (for example, if the thread is not - // joinable) - ExitCode Wait(); - - // kills the thread without giving it any chance to clean up - should - // not be used under normal circumstances, use Delete() instead. - // It is a dangerous function that should only be used in the most - // extreme cases! - // - // The wxThread object is deleted by Kill() if the thread is - // detachable, but you still have to delete it manually for joinable - // threads. - wxThreadError Kill(); - - // pause a running thread: as Delete(), this only works if the thread - // calls TestDestroy() regularly - wxThreadError Pause(); - - // resume a paused thread - wxThreadError Resume(); - - // priority - // Sets the priority to "prio": see WXTHREAD_XXX_PRIORITY constants - // - // NB: the priority can only be set before the thread is created - void SetPriority(unsigned int prio); - - // Get the current priority. - unsigned int GetPriority() const; - - // thread status inquiries - // Returns true if the thread is alive: i.e. running or suspended - bool IsAlive() const; - // Returns true if the thread is running (not paused, not killed). - bool IsRunning() const; - // Returns true if the thread is suspended - bool IsPaused() const; - - // is the thread of detached kind? - bool IsDetached() const { return m_isDetached; } - - // Get the thread ID - a platform dependent number which uniquely - // identifies a thread inside a process - wxThreadIdType GetId() const; - - // called when the thread exits - in the context of this thread - // - // NB: this function will not be called if the thread is Kill()ed - virtual void OnExit() { } - - // Returns true if the thread was asked to terminate: this function should - // be called by the thread from time to time, otherwise the main thread - // will be left forever in Delete()! - virtual bool TestDestroy(); - - // dtor is public, but the detached threads should never be deleted - use - // Delete() instead (or leave the thread terminate by itself) - virtual ~wxThread(); - -protected: - // exits from the current thread - can be called only from this thread - void Exit(ExitCode exitcode = 0); - - // entry point for the thread - called by Run() and executes in the context - // of this thread. - virtual void *Entry() = 0; - -private: - // no copy ctor/assignment operator - wxThread(const wxThread&); - wxThread& operator=(const wxThread&); - - friend class wxThreadInternal; - - // the (platform-dependent) thread class implementation - wxThreadInternal *m_internal; - - // protects access to any methods of wxThreadInternal object - wxCriticalSection m_critsect; - - // true if the thread is detached, false if it is joinable - bool m_isDetached; -}; - -// wxThreadHelperThread class -// -------------------------- - -class WXDLLIMPEXP_BASE wxThreadHelperThread : public wxThread -{ -public: - // constructor only creates the C++ thread object and doesn't create (or - // start) the real thread - wxThreadHelperThread(wxThreadHelper& owner) - : wxThread(wxTHREAD_JOINABLE), m_owner(owner) - { } - -protected: - // entry point for the thread -- calls Entry() in owner. - virtual void *Entry(); - -private: - // the owner of the thread - wxThreadHelper& m_owner; - - // no copy ctor/assignment operator - wxThreadHelperThread(const wxThreadHelperThread&); - wxThreadHelperThread& operator=(const wxThreadHelperThread&); -}; - -// ---------------------------------------------------------------------------- -// wxThreadHelper: this class implements the threading logic to run a -// background task in another object (such as a window). It is a mix-in: just -// derive from it to implement a threading background task in your class. -// ---------------------------------------------------------------------------- - -class WXDLLIMPEXP_BASE wxThreadHelper -{ -private: - void KillThread() - { - if ( m_thread ) - { - m_thread->Kill(); - delete m_thread; - } - } - -public: - // constructor only initializes m_thread to NULL - wxThreadHelper() : m_thread(NULL) { } - - // destructor deletes m_thread - virtual ~wxThreadHelper() { KillThread(); } - - // create a new thread (and optionally set the stack size on platforms that - // support/need that), call Run() to start it - wxThreadError Create(unsigned int stackSize = 0) - { - KillThread(); - - m_thread = new wxThreadHelperThread(*this); - - return m_thread->Create(stackSize); - } - - // entry point for the thread - called by Run() and executes in the context - // of this thread. - virtual void *Entry() = 0; - - // returns a pointer to the thread which can be used to call Run() - wxThread *GetThread() const { return m_thread; } - -protected: - wxThread *m_thread; -}; - -// call Entry() in owner, put it down here to avoid circular declarations -inline void *wxThreadHelperThread::Entry() -{ - return m_owner.Entry(); -} - -// ---------------------------------------------------------------------------- -// Automatic initialization -// ---------------------------------------------------------------------------- - -// GUI mutex handling. -void WXDLLIMPEXP_BASE wxMutexGuiEnter(); -void WXDLLIMPEXP_BASE wxMutexGuiLeave(); - -// macros for entering/leaving critical sections which may be used without -// having to take them inside "#if wxUSE_THREADS" -#define wxENTER_CRIT_SECT(cs) (cs).Enter() -#define wxLEAVE_CRIT_SECT(cs) (cs).Leave() -#define wxCRIT_SECT_DECLARE(cs) static wxCriticalSection cs -#define wxCRIT_SECT_DECLARE_MEMBER(cs) wxCriticalSection cs -#define wxCRIT_SECT_LOCKER(name, cs) wxCriticalSectionLocker name(cs) - -// function for checking if we're in the main thread which may be used whether -// wxUSE_THREADS is 0 or 1 -inline bool wxIsMainThread() { return wxThread::IsMain(); } - -#else // !wxUSE_THREADS - -// no thread support -inline void WXDLLIMPEXP_BASE wxMutexGuiEnter() { } -inline void WXDLLIMPEXP_BASE wxMutexGuiLeave() { } - -// macros for entering/leaving critical sections which may be used without -// having to take them inside "#if wxUSE_THREADS" -// (the implementation uses dummy structs to force semicolon after the macro; -// also notice that Watcom doesn't like declaring a struct as a member so we -// need to actually define it in wxCRIT_SECT_DECLARE_MEMBER) -#define wxENTER_CRIT_SECT(cs) do {} while (0) -#define wxLEAVE_CRIT_SECT(cs) do {} while (0) -#define wxCRIT_SECT_DECLARE(cs) struct wxDummyCS##cs -#define wxCRIT_SECT_DECLARE_MEMBER(cs) struct wxDummyCSMember##cs { } -#define wxCRIT_SECT_LOCKER(name, cs) struct wxDummyCSLocker##name - -// if there is only one thread, it is always the main one -inline bool wxIsMainThread() { return true; } - -#endif // wxUSE_THREADS/!wxUSE_THREADS - -// mark part of code as being a critical section: this macro declares a -// critical section with the given name and enters it immediately and leaves -// it at the end of the current scope -// -// example: -// -// int Count() -// { -// static int s_counter = 0; -// -// wxCRITICAL_SECTION(counter); -// -// return ++s_counter; -// } -// -// this function is MT-safe in presence of the threads but there is no -// overhead when the library is compiled without threads -#define wxCRITICAL_SECTION(name) \ - wxCRIT_SECT_DECLARE(s_cs##name); \ - wxCRIT_SECT_LOCKER(cs##name##Locker, s_cs##name) - -// automatically lock GUI mutex in ctor and unlock it in dtor -class WXDLLIMPEXP_BASE wxMutexGuiLocker -{ -public: - wxMutexGuiLocker() { wxMutexGuiEnter(); } - ~wxMutexGuiLocker() { wxMutexGuiLeave(); } -}; - -// ----------------------------------------------------------------------------- -// implementation only until the end of file -// ----------------------------------------------------------------------------- - -#if wxUSE_THREADS - -#if defined(__WXMSW__) || defined(__WXMAC__) || defined(__OS2__) || defined(__EMX__) - // unlock GUI if there are threads waiting for and lock it back when - // there are no more of them - should be called periodically by the main - // thread - extern void WXDLLIMPEXP_BASE wxMutexGuiLeaveOrEnter(); - - // returns true if the main thread has GUI lock - extern bool WXDLLIMPEXP_BASE wxGuiOwnedByMainThread(); - - // wakes up the main thread if it's sleeping inside ::GetMessage() - extern void WXDLLIMPEXP_BASE wxWakeUpMainThread(); - - // return true if the main thread is waiting for some other to terminate: - // wxApp then should block all "dangerous" messages - extern bool WXDLLIMPEXP_BASE wxIsWaitingForThread(); -#endif // MSW, Mac, OS/2 - -#endif // wxUSE_THREADS - -#endif // _WX_THREAD_H_ diff --git a/wxWidgets/include/wx/thrimpl.cpp b/wxWidgets/include/wx/thrimpl.cpp deleted file mode 100644 index c9e77b3c28..0000000000 --- a/wxWidgets/include/wx/thrimpl.cpp +++ /dev/null @@ -1,332 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: include/wx/thrimpl.cpp -// Purpose: common part of wxThread Implementations -// Author: Vadim Zeitlin -// Modified by: -// Created: 04.06.02 (extracted from src/*/thread.cpp files) -// RCS-ID: $Id: thrimpl.cpp 66922 2011-02-16 22:26:57Z JS $ -// Copyright: (c) Vadim Zeitlin (2002) -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// this file is supposed to be included only by the various thread.cpp - -// ---------------------------------------------------------------------------- -// wxMutex -// ---------------------------------------------------------------------------- - -wxMutex::wxMutex(wxMutexType mutexType) -{ - m_internal = new wxMutexInternal(mutexType); - - if ( !m_internal->IsOk() ) - { - delete m_internal; - m_internal = NULL; - } -} - -wxMutex::~wxMutex() -{ - delete m_internal; -} - -bool wxMutex::IsOk() const -{ - return m_internal != NULL; -} - -wxMutexError wxMutex::Lock() -{ - wxCHECK_MSG( m_internal, wxMUTEX_INVALID, - wxT("wxMutex::Lock(): not initialized") ); - - return m_internal->Lock(); -} - -wxMutexError wxMutex::TryLock() -{ - wxCHECK_MSG( m_internal, wxMUTEX_INVALID, - wxT("wxMutex::TryLock(): not initialized") ); - - return m_internal->TryLock(); -} - -wxMutexError wxMutex::Unlock() -{ - wxCHECK_MSG( m_internal, wxMUTEX_INVALID, - wxT("wxMutex::Unlock(): not initialized") ); - - return m_internal->Unlock(); -} - -// -------------------------------------------------------------------------- -// wxConditionInternal -// -------------------------------------------------------------------------- - -// Win32 and OS/2 don't have explicit support for the POSIX condition -// variables and their events/event semaphores have quite different semantics, -// so we reimplement the conditions from scratch using the mutexes and -// semaphores -#if defined(__WXMSW__) || defined(__OS2__) || defined(__EMX__) - -class wxConditionInternal -{ -public: - wxConditionInternal(wxMutex& mutex); - - bool IsOk() const { return m_mutex.IsOk() && m_semaphore.IsOk(); } - - wxCondError Wait(); - wxCondError WaitTimeout(unsigned long milliseconds); - - wxCondError Signal(); - wxCondError Broadcast(); - -private: - // the number of threads currently waiting for this condition - LONG m_numWaiters; - - // the critical section protecting m_numWaiters - wxCriticalSection m_csWaiters; - - wxMutex& m_mutex; - wxSemaphore m_semaphore; - - DECLARE_NO_COPY_CLASS(wxConditionInternal) -}; - -wxConditionInternal::wxConditionInternal(wxMutex& mutex) - : m_mutex(mutex) -{ - // another thread can't access it until we return from ctor, so no need to - // protect access to m_numWaiters here - m_numWaiters = 0; -} - -wxCondError wxConditionInternal::Wait() -{ - // increment the number of waiters - { - wxCriticalSectionLocker lock(m_csWaiters); - m_numWaiters++; - } - - m_mutex.Unlock(); - - // after unlocking the mutex other threads may Signal() us, but it is ok - // now as we had already incremented m_numWaiters so Signal() will post the - // semaphore and decrement m_numWaiters back even if it is called before we - // start to Wait() - const wxSemaError err = m_semaphore.Wait(); - - m_mutex.Lock(); - - if ( err == wxSEMA_NO_ERROR ) - { - // m_numWaiters was decremented by Signal() - return wxCOND_NO_ERROR; - } - - // but in case of an error we need to do it manually - { - wxCriticalSectionLocker lock(m_csWaiters); - m_numWaiters--; - } - - return err == wxSEMA_TIMEOUT ? wxCOND_TIMEOUT : wxCOND_MISC_ERROR; -} - -wxCondError wxConditionInternal::WaitTimeout(unsigned long milliseconds) -{ - { - wxCriticalSectionLocker lock(m_csWaiters); - m_numWaiters++; - } - - m_mutex.Unlock(); - - wxSemaError err = m_semaphore.WaitTimeout(milliseconds); - - m_mutex.Lock(); - - if ( err == wxSEMA_NO_ERROR ) - return wxCOND_NO_ERROR; - - if ( err == wxSEMA_TIMEOUT ) - { - // a potential race condition exists here: it happens when a waiting - // thread times out but doesn't have time to decrement m_numWaiters yet - // before Signal() is called in another thread - // - // to handle this particular case, check the semaphore again after - // acquiring m_csWaiters lock -- this will catch the signals missed - // during this window - wxCriticalSectionLocker lock(m_csWaiters); - - err = m_semaphore.WaitTimeout(0); - if ( err == wxSEMA_NO_ERROR ) - return wxCOND_NO_ERROR; - - // we need to decrement m_numWaiters ourselves as it wasn't done by - // Signal() - m_numWaiters--; - - return err == wxSEMA_TIMEOUT ? wxCOND_TIMEOUT : wxCOND_MISC_ERROR; - } - - // undo m_numWaiters++ above in case of an error - { - wxCriticalSectionLocker lock(m_csWaiters); - m_numWaiters--; - } - - return wxCOND_MISC_ERROR; -} - -wxCondError wxConditionInternal::Signal() -{ - wxCriticalSectionLocker lock(m_csWaiters); - - if ( m_numWaiters > 0 ) - { - // increment the semaphore by 1 - if ( m_semaphore.Post() != wxSEMA_NO_ERROR ) - return wxCOND_MISC_ERROR; - - m_numWaiters--; - } - - return wxCOND_NO_ERROR; -} - -wxCondError wxConditionInternal::Broadcast() -{ - wxCriticalSectionLocker lock(m_csWaiters); - - while ( m_numWaiters > 0 ) - { - if ( m_semaphore.Post() != wxSEMA_NO_ERROR ) - return wxCOND_MISC_ERROR; - - m_numWaiters--; - } - - return wxCOND_NO_ERROR; -} - -#endif // MSW or OS2 - -// ---------------------------------------------------------------------------- -// wxCondition -// ---------------------------------------------------------------------------- - -wxCondition::wxCondition(wxMutex& mutex) -{ - m_internal = new wxConditionInternal(mutex); - - if ( !m_internal->IsOk() ) - { - delete m_internal; - m_internal = NULL; - } -} - -wxCondition::~wxCondition() -{ - delete m_internal; -} - -bool wxCondition::IsOk() const -{ - return m_internal != NULL; -} - -wxCondError wxCondition::Wait() -{ - wxCHECK_MSG( m_internal, wxCOND_INVALID, - wxT("wxCondition::Wait(): not initialized") ); - - return m_internal->Wait(); -} - -wxCondError wxCondition::WaitTimeout(unsigned long milliseconds) -{ - wxCHECK_MSG( m_internal, wxCOND_INVALID, - wxT("wxCondition::Wait(): not initialized") ); - - return m_internal->WaitTimeout(milliseconds); -} - -wxCondError wxCondition::Signal() -{ - wxCHECK_MSG( m_internal, wxCOND_INVALID, - wxT("wxCondition::Signal(): not initialized") ); - - return m_internal->Signal(); -} - -wxCondError wxCondition::Broadcast() -{ - wxCHECK_MSG( m_internal, wxCOND_INVALID, - wxT("wxCondition::Broadcast(): not initialized") ); - - return m_internal->Broadcast(); -} - -// -------------------------------------------------------------------------- -// wxSemaphore -// -------------------------------------------------------------------------- - -wxSemaphore::wxSemaphore(int initialcount, int maxcount) -{ - m_internal = new wxSemaphoreInternal( initialcount, maxcount ); - if ( !m_internal->IsOk() ) - { - delete m_internal; - m_internal = NULL; - } -} - -wxSemaphore::~wxSemaphore() -{ - delete m_internal; -} - -bool wxSemaphore::IsOk() const -{ - return m_internal != NULL; -} - -wxSemaError wxSemaphore::Wait() -{ - wxCHECK_MSG( m_internal, wxSEMA_INVALID, - wxT("wxSemaphore::Wait(): not initialized") ); - - return m_internal->Wait(); -} - -wxSemaError wxSemaphore::TryWait() -{ - wxCHECK_MSG( m_internal, wxSEMA_INVALID, - wxT("wxSemaphore::TryWait(): not initialized") ); - - return m_internal->TryWait(); -} - -wxSemaError wxSemaphore::WaitTimeout(unsigned long milliseconds) -{ - wxCHECK_MSG( m_internal, wxSEMA_INVALID, - wxT("wxSemaphore::WaitTimeout(): not initialized") ); - - return m_internal->WaitTimeout(milliseconds); -} - -wxSemaError wxSemaphore::Post() -{ - wxCHECK_MSG( m_internal, wxSEMA_INVALID, - wxT("wxSemaphore::Post(): not initialized") ); - - return m_internal->Post(); -} - diff --git a/wxWidgets/include/wx/timer.h b/wxWidgets/include/wx/timer.h deleted file mode 100644 index f8b8d1e879..0000000000 --- a/wxWidgets/include/wx/timer.h +++ /dev/null @@ -1,201 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/timer.h -// Purpose: wxTimer, wxStopWatch and global time-related functions -// Author: Julian Smart -// Modified by: Vadim Zeitlin (wxTimerBase) -// Guillermo Rodriguez (global clean up) -// Created: 04/01/98 -// RCS-ID: $Id: timer.h 44244 2007-01-18 17:00:52Z VZ $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_TIMER_H_BASE_ -#define _WX_TIMER_H_BASE_ - -#include "wx/defs.h" - -#if wxUSE_GUI && wxUSE_TIMER - -#include "wx/object.h" -#include "wx/longlong.h" -#include "wx/event.h" -#include "wx/stopwatch.h" // for backwards compatibility -#include "wx/window.h" // only for NewControlId() - - -// more readable flags for Start(): - -// generate notifications periodically until the timer is stopped (default) -#define wxTIMER_CONTINUOUS false - -// only send the notification once and then stop the timer -#define wxTIMER_ONE_SHOT true - -// the interface of wxTimer class -class WXDLLEXPORT wxTimerBase : public wxEvtHandler -{ -public: - // ctors and initializers - // ---------------------- - - // default: if you don't call SetOwner(), your only chance to get timer - // notifications is to override Notify() in the derived class - wxTimerBase() - { Init(); SetOwner(this); } - - // ctor which allows to avoid having to override Notify() in the derived - // class: the owner will get timer notifications which can be handled with - // EVT_TIMER - wxTimerBase(wxEvtHandler *owner, int timerid = wxID_ANY) - { Init(); SetOwner(owner, timerid); } - - // same as ctor above - void SetOwner(wxEvtHandler *owner, int timerid = wxID_ANY) - { - m_owner = owner; - m_idTimer = timerid == wxID_ANY ? wxWindow::NewControlId() : timerid; - } - - wxEvtHandler *GetOwner() const { return m_owner; } - - virtual ~wxTimerBase(); - - // working with the timer - // ---------------------- - - // start the timer: if milliseconds == -1, use the same value as for the - // last Start() - // - // it is now valid to call Start() multiple times: this just restarts the - // timer if it is already running - virtual bool Start(int milliseconds = -1, bool oneShot = false); - - // stop the timer - virtual void Stop() = 0; - - // override this in your wxTimer-derived class if you want to process timer - // messages in it, use non default ctor or SetOwner() otherwise - virtual void Notify(); - - // getting info - // ------------ - - // return true if the timer is running - virtual bool IsRunning() const = 0; - - // return the timer ID - int GetId() const { return m_idTimer; } - - // get the (last) timer interval in milliseconds - int GetInterval() const { return m_milli; } - - // return true if the timer is one shot - bool IsOneShot() const { return m_oneShot; } - -protected: - // common part of all ctors - void Init() - { m_owner = NULL; m_idTimer = wxID_ANY; m_milli = 0; m_oneShot = false; } - - wxEvtHandler *m_owner; - int m_idTimer; - int m_milli; // the timer interval - bool m_oneShot; // true if one shot - - DECLARE_NO_COPY_CLASS(wxTimerBase) -}; - -// ---------------------------------------------------------------------------- -// wxTimer itself -// ---------------------------------------------------------------------------- - -#if defined(__WXMSW__) - #include "wx/msw/timer.h" -#elif defined(__WXMOTIF__) - #include "wx/motif/timer.h" -#elif defined(__WXGTK20__) - #include "wx/gtk/timer.h" -#elif defined(__WXGTK__) - #include "wx/gtk1/timer.h" -#elif defined(__WXX11__) || defined(__WXMGL__) || defined(__WXDFB__) - #include "wx/generic/timer.h" -#elif defined (__WXCOCOA__) - #include "wx/cocoa/timer.h" -#elif defined(__WXMAC__) - #include "wx/mac/timer.h" -#elif defined(__WXPM__) - #include "wx/os2/timer.h" -#endif - -// ---------------------------------------------------------------------------- -// wxTimerRunner: starts the timer in its ctor, stops in the dtor -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxTimerRunner -{ -public: - wxTimerRunner(wxTimer& timer) : m_timer(timer) { } - wxTimerRunner(wxTimer& timer, int milli, bool oneShot = false) - : m_timer(timer) - { - m_timer.Start(milli, oneShot); - } - - void Start(int milli, bool oneShot = false) - { - m_timer.Start(milli, oneShot); - } - - ~wxTimerRunner() - { - if ( m_timer.IsRunning() ) - { - m_timer.Stop(); - } - } - -private: - wxTimer& m_timer; - - DECLARE_NO_COPY_CLASS(wxTimerRunner) -}; - -// ---------------------------------------------------------------------------- -// wxTimerEvent -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxTimerEvent : public wxEvent -{ -public: - wxTimerEvent(int timerid = 0, int interval = 0) : wxEvent(timerid) - { - m_eventType = wxEVT_TIMER; - - m_interval = interval; - } - - // accessors - int GetInterval() const { return m_interval; } - - // implement the base class pure virtual - virtual wxEvent *Clone() const { return new wxTimerEvent(*this); } - -private: - int m_interval; - - DECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxTimerEvent) -}; - -typedef void (wxEvtHandler::*wxTimerEventFunction)(wxTimerEvent&); - -#define wxTimerEventHandler(func) \ - (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxTimerEventFunction, &func) - -#define EVT_TIMER(timerid, func) \ - wx__DECLARE_EVT1(wxEVT_TIMER, timerid, wxTimerEventHandler(func)) - -#endif // wxUSE_GUI && wxUSE_TIMER - -#endif - // _WX_TIMER_H_BASE_ diff --git a/wxWidgets/include/wx/tipdlg.h b/wxWidgets/include/wx/tipdlg.h deleted file mode 100644 index 9a782e5be0..0000000000 --- a/wxWidgets/include/wx/tipdlg.h +++ /dev/null @@ -1,84 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: tipdlg.h -// Purpose: declaration of wxTipDialog -// Author: Vadim Zeitlin -// Modified by: -// Created: 28.06.99 -// RCS-ID: $Id: tipdlg.h 35650 2005-09-23 12:56:45Z MR $ -// Copyright: (c) Vadim Zeitlin -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_TIPDLG_H_ -#define _WX_TIPDLG_H_ - -// ---------------------------------------------------------------------------- -// headers which we must include here -// ---------------------------------------------------------------------------- - -#include "wx/defs.h" - -#if wxUSE_STARTUP_TIPS - -#include "wx/textfile.h" - -// ---------------------------------------------------------------------------- -// wxTipProvider - a class which is used by wxTipDialog to get the text of the -// tips -// ---------------------------------------------------------------------------- - -// the abstract base class: it provides the tips, i.e. implements the GetTip() -// function which returns the new tip each time it's called. To support this, -// wxTipProvider evidently needs some internal state which is the tip "index" -// and which should be saved/restored by the program to not always show one and -// the same tip (of course, you may use random starting position as well...) -class WXDLLIMPEXP_ADV wxTipProvider -{ -public: - wxTipProvider(size_t currentTip) { m_currentTip = currentTip; } - - // get the current tip and update the internal state to return the next tip - // when called for the next time - virtual wxString GetTip() = 0; - - // get the current tip "index" (or whatever allows the tip provider to know - // from where to start the next time) - size_t GetCurrentTip() const { return m_currentTip; } - - // Allows any user-derived class to optionally override this function to - // modify the tip as soon as it is read. If return wxEmptyString, then - // the tip is skipped, and the next one is read. - virtual wxString PreprocessTip(const wxString& tip) { return tip; } - - // virtual dtor for the base class - virtual ~wxTipProvider() { } - -protected: - size_t m_currentTip; -}; - -// a function which returns an implementation of wxTipProvider using the -// specified text file as the source of tips (each line is a tip). -// -// NB: the caller is responsible for deleting the pointer! -WXDLLIMPEXP_ADV wxTipProvider *wxCreateFileTipProvider(const wxString& filename, - size_t currentTip); - -// ---------------------------------------------------------------------------- -// wxTipDialog -// ---------------------------------------------------------------------------- - -// A dialog which shows a "tip" - a short and helpful messages describing to -// the user some program characteristic. Many programs show the tips at -// startup, so the dialog has "Show tips on startup" checkbox which allows to -// the user to disable this (however, it's the program which should show, or -// not, the dialog on startup depending on its value, not this class). -// -// The function returns true if this checkbox is checked, false otherwise. -WXDLLIMPEXP_ADV bool wxShowTip(wxWindow *parent, - wxTipProvider *tipProvider, - bool showAtStartup = true); - -#endif // wxUSE_STARTUP_TIPS - -#endif // _WX_TIPDLG_H_ diff --git a/wxWidgets/include/wx/tipwin.h b/wxWidgets/include/wx/tipwin.h deleted file mode 100644 index 944afb8325..0000000000 --- a/wxWidgets/include/wx/tipwin.h +++ /dev/null @@ -1,98 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: wx/tipwin.h -// Purpose: wxTipWindow is a window like the one typically used for -// showing the tooltips -// Author: Vadim Zeitlin -// Modified by: -// Created: 10.09.00 -// RCS-ID: $Id: tipwin.h 53135 2008-04-12 02:31:04Z VZ $ -// Copyright: (c) 2000 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr> -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_TIPWIN_H_ -#define _WX_TIPWIN_H_ - -#if wxUSE_TIPWINDOW - -#if wxUSE_POPUPWIN - #include "wx/popupwin.h" - - #define wxTipWindowBase wxPopupTransientWindow -#else - #include "wx/frame.h" - - #define wxTipWindowBase wxFrame -#endif -#include "wx/arrstr.h" - -class WXDLLIMPEXP_FWD_CORE wxTipWindowView; - -// ---------------------------------------------------------------------------- -// wxTipWindow -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxTipWindow : public wxTipWindowBase -{ -public: - // the mandatory ctor parameters are: the parent window and the text to - // show - // - // optionally you may also specify the length at which the lines are going - // to be broken in rows (100 pixels by default) - // - // windowPtr and rectBound are just passed to SetTipWindowPtr() and - // SetBoundingRect() - see below - wxTipWindow(wxWindow *parent, - const wxString& text, - wxCoord maxLength = 100, - wxTipWindow** windowPtr = NULL, - wxRect *rectBound = NULL); - - virtual ~wxTipWindow(); - - // If windowPtr is not NULL the given address will be NULLed when the - // window has closed - void SetTipWindowPtr(wxTipWindow** windowPtr) { m_windowPtr = windowPtr; } - - // If rectBound is not NULL, the window will disappear automatically when - // the mouse leave the specified rect: note that rectBound should be in the - // screen coordinates! - void SetBoundingRect(const wxRect& rectBound); - - // Hide and destroy the window - void Close(); - -protected: - // called by wxTipWindowView only - bool CheckMouseInBounds(const wxPoint& pos); - - // event handlers - void OnMouseClick(wxMouseEvent& event); - -#if !wxUSE_POPUPWIN - void OnActivate(wxActivateEvent& event); - void OnKillFocus(wxFocusEvent& event); -#else // wxUSE_POPUPWIN - virtual void OnDismiss(); -#endif // wxUSE_POPUPWIN/!wxUSE_POPUPWIN - -private: - wxArrayString m_textLines; - wxCoord m_heightLine; - - wxTipWindowView *m_view; - - wxTipWindow** m_windowPtr; - wxRect m_rectBound; - - DECLARE_EVENT_TABLE() - - friend class wxTipWindowView; - - DECLARE_NO_COPY_CLASS(wxTipWindow) -}; - -#endif // wxUSE_TIPWINDOW - -#endif // _WX_TIPWIN_H_ diff --git a/wxWidgets/include/wx/tokenzr.h b/wxWidgets/include/wx/tokenzr.h deleted file mode 100644 index 774adf303f..0000000000 --- a/wxWidgets/include/wx/tokenzr.h +++ /dev/null @@ -1,135 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/tokenzr.h -// Purpose: String tokenizer - a C++ replacement for strtok(3) -// Author: Guilhem Lavaux -// Modified by: (or rather rewritten by) Vadim Zeitlin -// Created: 04/22/98 -// RCS-ID: $Id: tokenzr.h 61872 2009-09-09 22:37:05Z VZ $ -// Copyright: (c) Guilhem Lavaux -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_TOKENZRH -#define _WX_TOKENZRH - -#include "wx/object.h" -#include "wx/string.h" -#include "wx/arrstr.h" - -// ---------------------------------------------------------------------------- -// constants -// ---------------------------------------------------------------------------- - -// default: delimiters are usual white space characters -#define wxDEFAULT_DELIMITERS (wxT(" \t\r\n")) - -// wxStringTokenizer mode flags which determine its behaviour -enum wxStringTokenizerMode -{ - wxTOKEN_INVALID = -1, // set by def ctor until SetString() is called - wxTOKEN_DEFAULT, // strtok() for whitespace delims, RET_EMPTY else - wxTOKEN_RET_EMPTY, // return empty token in the middle of the string - wxTOKEN_RET_EMPTY_ALL, // return trailing empty tokens too - wxTOKEN_RET_DELIMS, // return the delim with token (implies RET_EMPTY) - wxTOKEN_STRTOK // behave exactly like strtok(3) -}; - -// ---------------------------------------------------------------------------- -// wxStringTokenizer: replaces infamous strtok() and has some other features -// ---------------------------------------------------------------------------- - -class WXDLLIMPEXP_BASE wxStringTokenizer : public wxObject -{ -public: - // ctors and initializers - // default ctor, call SetString() later - wxStringTokenizer() { m_mode = wxTOKEN_INVALID; } - // ctor which gives us the string - wxStringTokenizer(const wxString& str, - const wxString& delims = wxDEFAULT_DELIMITERS, - wxStringTokenizerMode mode = wxTOKEN_DEFAULT); - - // args are same as for the non default ctor above - void SetString(const wxString& str, - const wxString& delims = wxDEFAULT_DELIMITERS, - wxStringTokenizerMode mode = wxTOKEN_DEFAULT); - - // reinitialize the tokenizer with the same delimiters/mode - void Reinit(const wxString& str); - - // tokens access - // return the number of remaining tokens - size_t CountTokens() const; - // did we reach the end of the string? - bool HasMoreTokens() const; - // get the next token, will return empty string if !HasMoreTokens() - wxString GetNextToken(); - // get the delimiter which terminated the token last retrieved by - // GetNextToken() or NUL if there had been no tokens yet or the last - // one wasn't terminated (but ran to the end of the string) - wxChar GetLastDelimiter() const { return m_lastDelim; } - - // get current tokenizer state - // returns the part of the string which remains to tokenize (*not* the - // initial string) - wxString GetString() const { return m_string.substr(m_pos); } - - // returns the current position (i.e. one index after the last - // returned token or 0 if GetNextToken() has never been called) in the - // original string - size_t GetPosition() const { return m_pos; } - - // misc - // get the current mode - can be different from the one passed to the - // ctor if it was wxTOKEN_DEFAULT - wxStringTokenizerMode GetMode() const { return m_mode; } - // do we return empty tokens? - bool AllowEmpty() const { return m_mode != wxTOKEN_STRTOK; } - - - // backwards compatibility section from now on - // ------------------------------------------- - - // for compatibility only, use GetNextToken() instead - wxString NextToken() { return GetNextToken(); } - - // compatibility only, don't use - void SetString(const wxString& to_tokenize, - const wxString& delims, - bool WXUNUSED(ret_delim)) - { - SetString(to_tokenize, delims, wxTOKEN_RET_DELIMS); - } - - wxStringTokenizer(const wxString& to_tokenize, - const wxString& delims, - bool ret_delim) - { - SetString(to_tokenize, delims, ret_delim); - } - -protected: - bool IsOk() const { return m_mode != wxTOKEN_INVALID; } - - wxString m_string, // the string we tokenize - m_delims; // all possible delimiters - - size_t m_pos; // the current position in m_string - - wxStringTokenizerMode m_mode; // see wxTOKEN_XXX values - - wxChar m_lastDelim; // delimiter after last token or '\0' -}; - -// ---------------------------------------------------------------------------- -// convenience function which returns all tokens at once -// ---------------------------------------------------------------------------- - -// the function takes the same parameters as wxStringTokenizer ctor and returns -// the array containing all tokens -wxArrayString WXDLLIMPEXP_BASE -wxStringTokenize(const wxString& str, - const wxString& delims = wxDEFAULT_DELIMITERS, - wxStringTokenizerMode mode = wxTOKEN_DEFAULT); - -#endif // _WX_TOKENZRH diff --git a/wxWidgets/include/wx/toolbar.h b/wxWidgets/include/wx/toolbar.h deleted file mode 100644 index f70678e7c6..0000000000 --- a/wxWidgets/include/wx/toolbar.h +++ /dev/null @@ -1,93 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/toolbar.h -// Purpose: wxToolBar interface declaration -// Author: Vadim Zeitlin -// Modified by: -// Created: 20.11.99 -// RCS-ID: $Id: toolbar.h 42645 2006-10-29 19:12:52Z VZ $ -// Copyright: (c) Vadim Zeitlin -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_TOOLBAR_H_BASE_ -#define _WX_TOOLBAR_H_BASE_ - -#include "wx/defs.h" - -// ---------------------------------------------------------------------------- -// wxToolBar style flags -// ---------------------------------------------------------------------------- - -enum -{ - // lay out the toolbar horizontally - wxTB_HORIZONTAL = wxHORIZONTAL, // == 0x0004 - wxTB_TOP = wxTB_HORIZONTAL, - - // lay out the toolbar vertically - wxTB_VERTICAL = wxVERTICAL, // == 0x0008 - wxTB_LEFT = wxTB_VERTICAL, - - // show 3D buttons (wxToolBarSimple only) - wxTB_3DBUTTONS = 0x0010, - - // "flat" buttons (Win32/GTK only) - wxTB_FLAT = 0x0020, - - // dockable toolbar (GTK only) - wxTB_DOCKABLE = 0x0040, - - // don't show the icons (they're shown by default) - wxTB_NOICONS = 0x0080, - - // show the text (not shown by default) - wxTB_TEXT = 0x0100, - - // don't show the divider between toolbar and the window (Win32 only) - wxTB_NODIVIDER = 0x0200, - - // no automatic alignment (Win32 only, useless) - wxTB_NOALIGN = 0x0400, - - // show the text and the icons alongside, not vertically stacked (Win32/GTK) - wxTB_HORZ_LAYOUT = 0x0800, - wxTB_HORZ_TEXT = wxTB_HORZ_LAYOUT | wxTB_TEXT, - - // don't show the toolbar short help tooltips - wxTB_NO_TOOLTIPS = 0x1000, - - // lay out toolbar at the bottom of the window - wxTB_BOTTOM = 0x2000, - - // lay out toolbar at the right edge of the window - wxTB_RIGHT = 0x4000 -}; - -#if wxUSE_TOOLBAR - #include "wx/tbarbase.h" // the base class for all toolbars - - #if defined(__WXUNIVERSAL__) - #include "wx/univ/toolbar.h" - #elif defined(__WXPALMOS__) - #include "wx/palmos/toolbar.h" - #elif defined(__WXMSW__) && (!defined(_WIN32_WCE) || (_WIN32_WCE >= 400 && !defined(__POCKETPC__) && !defined(__SMARTPHONE__))) - #include "wx/msw/tbar95.h" - #elif defined(__WXWINCE__) - #include "wx/msw/wince/tbarwce.h" - #elif defined(__WXMOTIF__) - #include "wx/motif/toolbar.h" - #elif defined(__WXGTK20__) - #include "wx/gtk/tbargtk.h" - #elif defined(__WXGTK__) - #include "wx/gtk1/tbargtk.h" - #elif defined(__WXMAC__) - #include "wx/mac/toolbar.h" - #elif defined(__WXCOCOA__) - #include "wx/cocoa/toolbar.h" - #elif defined(__WXPM__) - #include "wx/os2/toolbar.h" - #endif -#endif // wxUSE_TOOLBAR - -#endif - // _WX_TOOLBAR_H_BASE_ diff --git a/wxWidgets/include/wx/toolbook.h b/wxWidgets/include/wx/toolbook.h deleted file mode 100644 index 752793ebf2..0000000000 --- a/wxWidgets/include/wx/toolbook.h +++ /dev/null @@ -1,163 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: wx/toolbook.h -// Purpose: wxToolbook: wxToolBar and wxNotebook combination -// Author: Julian Smart -// Modified by: -// Created: 2006-01-29 -// RCS-ID: $Id: toolbook.h 49804 2007-11-10 01:09:42Z VZ $ -// Copyright: (c) 2006 Julian Smart -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_TOOLBOOK_H_ -#define _WX_TOOLBOOK_H_ - -#include "wx/defs.h" - -#if wxUSE_TOOLBOOK - -#include "wx/bookctrl.h" - -class WXDLLIMPEXP_FWD_CORE wxToolBarBase; -class WXDLLIMPEXP_FWD_CORE wxCommandEvent; - -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_COMMAND_TOOLBOOK_PAGE_CHANGED; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_COMMAND_TOOLBOOK_PAGE_CHANGING; - - -// Use wxButtonToolBar -#define wxBK_BUTTONBAR 0x0100 - -// ---------------------------------------------------------------------------- -// wxToolbook -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxToolbook : public wxBookCtrlBase -{ -public: - wxToolbook() - { - Init(); - } - - wxToolbook(wxWindow *parent, - wxWindowID id, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = 0, - const wxString& name = wxEmptyString) - { - Init(); - - (void)Create(parent, id, pos, size, style, name); - } - - // quasi ctor - bool Create(wxWindow *parent, - wxWindowID id, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = 0, - const wxString& name = wxEmptyString); - - - // implement base class virtuals - virtual int GetSelection() const; - virtual bool SetPageText(size_t n, const wxString& strText); - virtual wxString GetPageText(size_t n) const; - virtual int GetPageImage(size_t n) const; - virtual bool SetPageImage(size_t n, int imageId); - virtual wxSize CalcSizeFromPage(const wxSize& sizePage) const; - virtual bool InsertPage(size_t n, - wxWindow *page, - const wxString& text, - bool bSelect = false, - int imageId = -1); - virtual int SetSelection(size_t n) { return DoSetSelection(n, SetSelection_SendEvent); } - virtual int ChangeSelection(size_t n) { return DoSetSelection(n); } - virtual void SetImageList(wxImageList *imageList); - - virtual bool DeleteAllPages(); - virtual int HitTest(const wxPoint& pt, long *flags = NULL) const; - - - // methods which are not part of base wxBookctrl API - - // get the underlying toolbar - wxToolBarBase* GetToolBar() const { return (wxToolBarBase*)m_bookctrl; } - - // must be called in OnIdle or by application to realize the toolbar and - // select the initial page. - void Realize(); - -protected: - virtual wxWindow *DoRemovePage(size_t page); - - // get the size which the list control should have - virtual wxSize GetControllerSize() const; - - // event handlers - void OnToolSelected(wxCommandEvent& event); - void OnSize(wxSizeEvent& event); - void OnIdle(wxIdleEvent& event); - - void UpdateSelectedPage(size_t newsel); - - wxBookCtrlBaseEvent* CreatePageChangingEvent() const; - void MakeChangedEvent(wxBookCtrlBaseEvent &event); - - // the currently selected page or wxNOT_FOUND if none - int m_selection; - - // whether the toolbar needs to be realized - bool m_needsRealizing; - - // maximum bitmap size - wxSize m_maxBitmapSize; - -private: - // common part of all constructors - void Init(); - - DECLARE_EVENT_TABLE() - DECLARE_DYNAMIC_CLASS_NO_COPY(wxToolbook) -}; - -// ---------------------------------------------------------------------------- -// listbook event class and related stuff -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxToolbookEvent : public wxBookCtrlBaseEvent -{ -public: - wxToolbookEvent(wxEventType commandType = wxEVT_NULL, int id = 0, - int nSel = wxNOT_FOUND, int nOldSel = wxNOT_FOUND) - : wxBookCtrlBaseEvent(commandType, id, nSel, nOldSel) - { - } - - wxToolbookEvent(const wxToolbookEvent& event) - : wxBookCtrlBaseEvent(event) - { - } - - virtual wxEvent *Clone() const { return new wxToolbookEvent(*this); } - -private: - DECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxToolbookEvent) -}; - -typedef void (wxEvtHandler::*wxToolbookEventFunction)(wxToolbookEvent&); - -#define wxToolbookEventHandler(func) \ - (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxToolbookEventFunction, &func) - -#define EVT_TOOLBOOK_PAGE_CHANGED(winid, fn) \ - wx__DECLARE_EVT1(wxEVT_COMMAND_TOOLBOOK_PAGE_CHANGED, winid, wxToolbookEventHandler(fn)) - -#define EVT_TOOLBOOK_PAGE_CHANGING(winid, fn) \ - wx__DECLARE_EVT1(wxEVT_COMMAND_TOOLBOOK_PAGE_CHANGING, winid, wxToolbookEventHandler(fn)) - -#endif // wxUSE_TOOLBOOK - -#endif // _WX_TOOLBOOK_H_ diff --git a/wxWidgets/include/wx/tooltip.h b/wxWidgets/include/wx/tooltip.h deleted file mode 100644 index ac6219bab1..0000000000 --- a/wxWidgets/include/wx/tooltip.h +++ /dev/null @@ -1,39 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: tooltip.h -// Purpose: wxToolTip base header -// Author: Robert Roebling -// Modified by: -// Created: -// Copyright: (c) Robert Roebling -// RCS-ID: $Id: tooltip.h 37066 2006-01-23 03:27:34Z MR $ -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_TOOLTIP_H_BASE_ -#define _WX_TOOLTIP_H_BASE_ - -#include "wx/defs.h" - -#if wxUSE_TOOLTIPS - -#if defined(__WXMSW__) -#include "wx/msw/tooltip.h" -#elif defined(__WXMOTIF__) -// #include "wx/motif/tooltip.h" -#elif defined(__WXGTK20__) -#include "wx/gtk/tooltip.h" -#elif defined(__WXGTK__) -#include "wx/gtk1/tooltip.h" -#elif defined(__WXMAC__) -#include "wx/mac/tooltip.h" -#elif defined(__WXCOCOA__) -#include "wx/cocoa/tooltip.h" -#elif defined(__WXPM__) -#include "wx/os2/tooltip.h" -#endif - -#endif - // wxUSE_TOOLTIPS - -#endif - // _WX_TOOLTIP_H_BASE_ diff --git a/wxWidgets/include/wx/toplevel.h b/wxWidgets/include/wx/toplevel.h deleted file mode 100644 index 3ab0c9e709..0000000000 --- a/wxWidgets/include/wx/toplevel.h +++ /dev/null @@ -1,375 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: wx/toplevel.h -// Purpose: declares wxTopLevelWindow class, the base class for all -// top level windows (such as frames and dialogs) -// Author: Vadim Zeitlin, Vaclav Slavik -// Modified by: -// Created: 06.08.01 -// RCS-ID: $Id: toplevel.h 53135 2008-04-12 02:31:04Z VZ $ -// Copyright: (c) 2001 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr> -// Vaclav Slavik <vaclav@wxwidgets.org> -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_TOPLEVEL_BASE_H_ -#define _WX_TOPLEVEL_BASE_H_ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -#include "wx/window.h" -#include "wx/iconbndl.h" - -// the default names for various classes -extern WXDLLEXPORT_DATA(const wxChar) wxFrameNameStr[]; - -class WXDLLIMPEXP_FWD_CORE wxTopLevelWindowBase; - -// ---------------------------------------------------------------------------- -// constants -// ---------------------------------------------------------------------------- - -// style common to both wxFrame and wxDialog -#define wxSTAY_ON_TOP 0x8000 -#define wxICONIZE 0x4000 -#define wxMINIMIZE wxICONIZE -#define wxMAXIMIZE 0x2000 -#define wxCLOSE_BOX 0x1000 - -#define wxSYSTEM_MENU 0x0800 -#define wxMINIMIZE_BOX 0x0400 -#define wxMAXIMIZE_BOX 0x0200 -#define wxTINY_CAPTION_HORIZ 0x0100 -#define wxTINY_CAPTION_VERT 0x0080 -#define wxRESIZE_BORDER 0x0040 - -#if WXWIN_COMPATIBILITY_2_6 - - // deprecated versions defined for compatibility reasons - #define wxRESIZE_BOX wxMAXIMIZE_BOX - #define wxTHICK_FRAME wxRESIZE_BORDER - - // obsolete styles, unused any more - #define wxDIALOG_MODAL 0 - #define wxDIALOG_MODELESS 0 - #define wxNO_3D 0 - #define wxUSER_COLOURS 0 - -#endif // WXWIN_COMPATIBILITY_2_6 - -// default style -// -// under Windows CE (at least when compiling with eVC 4) we should create -// top level windows without any styles at all for them to appear -// "correctly", i.e. as full screen windows with a "hide" button (same as -// "close" but round instead of squared and just hides the applications -// instead of closing it) in the title bar -#if defined(__WXWINCE__) - #if defined(__SMARTPHONE__) - #define wxDEFAULT_FRAME_STYLE (wxMAXIMIZE) - #elif defined(__WINCE_STANDARDSDK__) - #define wxDEFAULT_FRAME_STYLE (wxMAXIMIZE|wxCLOSE_BOX) - #else - #define wxDEFAULT_FRAME_STYLE (wxNO_BORDER) - #endif -#else // !__WXWINCE__ - #define wxDEFAULT_FRAME_STYLE \ - (wxSYSTEM_MENU | \ - wxRESIZE_BORDER | \ - wxMINIMIZE_BOX | \ - wxMAXIMIZE_BOX | \ - wxCLOSE_BOX | \ - wxCAPTION | \ - wxCLIP_CHILDREN) -#endif - - -// Dialogs are created in a special way -#define wxTOPLEVEL_EX_DIALOG 0x00000008 - -// Styles for ShowFullScreen -// (note that wxTopLevelWindow only handles wxFULLSCREEN_NOBORDER and -// wxFULLSCREEN_NOCAPTION; the rest is handled by wxTopLevelWindow) -enum -{ - wxFULLSCREEN_NOMENUBAR = 0x0001, - wxFULLSCREEN_NOTOOLBAR = 0x0002, - wxFULLSCREEN_NOSTATUSBAR = 0x0004, - wxFULLSCREEN_NOBORDER = 0x0008, - wxFULLSCREEN_NOCAPTION = 0x0010, - - wxFULLSCREEN_ALL = wxFULLSCREEN_NOMENUBAR | wxFULLSCREEN_NOTOOLBAR | - wxFULLSCREEN_NOSTATUSBAR | wxFULLSCREEN_NOBORDER | - wxFULLSCREEN_NOCAPTION -}; - -// Styles for RequestUserAttention -enum -{ - wxUSER_ATTENTION_INFO = 1, - wxUSER_ATTENTION_ERROR = 2 -}; - -// ---------------------------------------------------------------------------- -// wxTopLevelWindow: a top level (as opposed to child) window -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxTopLevelWindowBase : public wxWindow -{ -public: - // construction - wxTopLevelWindowBase(); - virtual ~wxTopLevelWindowBase(); - - // top level wnd state - // -------------------- - - // maximize = true => maximize, otherwise - restore - virtual void Maximize(bool maximize = true) = 0; - - // undo Maximize() or Iconize() - virtual void Restore() = 0; - - // iconize = true => iconize, otherwise - restore - virtual void Iconize(bool iconize = true) = 0; - - // return true if the frame is maximized - virtual bool IsMaximized() const = 0; - - // return true if the frame is always maximized - // due to native guidelines or current policy - virtual bool IsAlwaysMaximized() const; - - // return true if the frame is iconized - virtual bool IsIconized() const = 0; - - // get the frame icon - const wxIcon& GetIcon() const { return m_icons.GetIcon( -1 ); } - - // get the frame icons - const wxIconBundle& GetIcons() const { return m_icons; } - - // set the frame icon - virtual void SetIcon(const wxIcon& icon) { m_icons = wxIconBundle( icon ); } - - // set the frame icons - virtual void SetIcons(const wxIconBundle& icons ) { m_icons = icons; } - - // maximize the window to cover entire screen - virtual bool ShowFullScreen(bool show, long style = wxFULLSCREEN_ALL) = 0; - - // return true if the frame is in fullscreen mode - virtual bool IsFullScreen() const = 0; - - // the title of the top level window: the text which the - // window shows usually at the top of the frame/dialog in dedicated bar - virtual void SetTitle(const wxString& title) = 0; - virtual wxString GetTitle() const = 0; - - // enable/disable close button [x] - virtual bool EnableCloseButton(bool WXUNUSED(enable) ) { return false; } - - // Set the shape of the window to the given region. - // Returns true if the platform supports this feature (and the - // operation is successful.) - virtual bool SetShape(const wxRegion& WXUNUSED(region)) { return false; } - - // Attracts the users attention to this window if the application is - // inactive (should be called when a background event occurs) - virtual void RequestUserAttention(int flags = wxUSER_ATTENTION_INFO); - - // Is this the active frame (highlighted in the taskbar)? - virtual bool IsActive() { return wxGetTopLevelParent(FindFocus()) == this; } - - // this function may be overridden to return false to allow closing the - // application even when this top level window is still open - // - // notice that the window is still closed prior to the application exit and - // so it can still veto it even if it returns false from here - virtual bool ShouldPreventAppExit() const { return true; } - - -#if defined(__SMARTPHONE__) - virtual void SetLeftMenu(int id = wxID_ANY, const wxString& label = wxEmptyString, wxMenu *subMenu = NULL) = 0; - virtual void SetRightMenu(int id = wxID_ANY, const wxString& label = wxEmptyString, wxMenu *subMenu = NULL) = 0; -#endif // __SMARTPHONE__ - - // centre the window on screen: this is just a shortcut - void CentreOnScreen(int dir = wxBOTH) { DoCentre(dir | wxCENTRE_ON_SCREEN); } - void CenterOnScreen(int dir = wxBOTH) { CentreOnScreen(dir); } - - - // default item access: we have a permanent default item which is the one - // set by the user code but we may also have a temporary default item which - // would be chosen if the user pressed "Enter" now but the default action - // reverts to the "permanent" default as soon as this temporary default - // item loses focus - - // used to reset default if pointing to removed child - virtual void RemoveChild(wxWindowBase *child); - - // get the default item, temporary or permanent - wxWindow *GetDefaultItem() const - { return m_winTmpDefault ? m_winTmpDefault : m_winDefault; } - - // set the permanent default item, return the old default - wxWindow *SetDefaultItem(wxWindow *win) - { wxWindow *old = GetDefaultItem(); m_winDefault = win; return old; } - - // return the temporary default item, can be NULL - wxWindow *GetTmpDefaultItem() const { return m_winTmpDefault; } - - // set a temporary default item, SetTmpDefaultItem(NULL) should be called - // soon after a call to SetTmpDefaultItem(window), return the old default - wxWindow *SetTmpDefaultItem(wxWindow *win) - { wxWindow *old = GetDefaultItem(); m_winTmpDefault = win; return old; } - - - // implementation only from now on - // ------------------------------- - - // override some base class virtuals - virtual bool Destroy(); - virtual bool IsTopLevel() const { return true; } - virtual bool IsVisible() const { return IsShown(); } - - // event handlers - void OnCloseWindow(wxCloseEvent& event); - void OnSize(wxSizeEvent& WXUNUSED(event)) { DoLayout(); } - - // Get rect to be used to center top-level children - virtual void GetRectForTopLevelChildren(int *x, int *y, int *w, int *h); - - // this should go away, but for now it's called from docview.cpp, - // so should be there for all platforms - void OnActivate(wxActivateEvent &WXUNUSED(event)) { } - - // do the window-specific processing after processing the update event - virtual void DoUpdateWindowUI(wxUpdateUIEvent& event) ; - - // a different API for SetSizeHints - virtual void SetMinSize(const wxSize& minSize); - virtual void SetMaxSize(const wxSize& maxSize); - - // set size hints for "window manager" - virtual void DoSetSizeHints( int minW, int minH, - int maxW = wxDefaultCoord, int maxH = wxDefaultCoord, - int incW = wxDefaultCoord, int incH = wxDefaultCoord ); - -protected: - // the frame client to screen translation should take account of the - // toolbar which may shift the origin of the client area - virtual void DoClientToScreen(int *x, int *y) const; - virtual void DoScreenToClient(int *x, int *y) const; - - // add support for wxCENTRE_ON_SCREEN - virtual void DoCentre(int dir); - - // no need to do client to screen translation to get our position in screen - // coordinates: this is already the case - virtual void DoGetScreenPosition(int *x, int *y) const - { - DoGetPosition(x, y); - } - - // test whether this window makes part of the frame - // (menubar, toolbar and statusbar are excluded from automatic layout) - virtual bool IsOneOfBars(const wxWindow *WXUNUSED(win)) const - { return false; } - - // check if we should exit the program after deleting this window - bool IsLastBeforeExit() const; - - // send the iconize event, return true if processed - bool SendIconizeEvent(bool iconized = true); - - // do TLW-specific layout: we resize our unique child to fill the entire - // client area - void DoLayout(); - - // Get the default size for the new window if no explicit size given. If - // there are better default sizes then these can be changed, just as long - // as they are not too small for TLWs (and not larger than screen). - static wxSize GetDefaultSize(); - static int WidthDefault(int w) { return w == wxDefaultCoord ? GetDefaultSize().x : w; } - static int HeightDefault(int h) { return h == wxDefaultCoord ? GetDefaultSize().y : h; } - - // the frame icon - wxIconBundle m_icons; - - // a default window (usually a button) or NULL - wxWindow *m_winDefault; - - // a temporary override of m_winDefault, use the latter if NULL - wxWindow *m_winTmpDefault; - - DECLARE_NO_COPY_CLASS(wxTopLevelWindowBase) - DECLARE_EVENT_TABLE() -}; - - -// include the real class declaration -#if defined(__WXPALMOS__) - #include "wx/palmos/toplevel.h" - #define wxTopLevelWindowNative wxTopLevelWindowPalm -#elif defined(__WXMSW__) - #include "wx/msw/toplevel.h" - #define wxTopLevelWindowNative wxTopLevelWindowMSW -#elif defined(__WXGTK20__) - #include "wx/gtk/toplevel.h" - #define wxTopLevelWindowNative wxTopLevelWindowGTK -#elif defined(__WXGTK__) - #include "wx/gtk1/toplevel.h" - #define wxTopLevelWindowNative wxTopLevelWindowGTK -#elif defined(__WXX11__) - #include "wx/x11/toplevel.h" - #define wxTopLevelWindowNative wxTopLevelWindowX11 -#elif defined(__WXMGL__) - #include "wx/mgl/toplevel.h" - #define wxTopLevelWindowNative wxTopLevelWindowMGL -#elif defined(__WXDFB__) - #include "wx/dfb/toplevel.h" - #define wxTopLevelWindowNative wxTopLevelWindowDFB -#elif defined(__WXMAC__) - #include "wx/mac/toplevel.h" - #define wxTopLevelWindowNative wxTopLevelWindowMac -#elif defined(__WXCOCOA__) - #include "wx/cocoa/toplevel.h" - #define wxTopLevelWindowNative wxTopLevelWindowCocoa -#elif defined(__WXPM__) - #include "wx/os2/toplevel.h" - #define wxTopLevelWindowNative wxTopLevelWindowOS2 -#elif defined(__WXMOTIF__) - #include "wx/motif/toplevel.h" - #define wxTopLevelWindowNative wxTopLevelWindowMotif -#endif - -#ifdef __WXUNIVERSAL__ - #include "wx/univ/toplevel.h" -#else // !__WXUNIVERSAL__ - #ifdef wxTopLevelWindowNative - class WXDLLEXPORT wxTopLevelWindow : public wxTopLevelWindowNative - { - public: - // construction - wxTopLevelWindow() { Init(); } - wxTopLevelWindow(wxWindow *parent, - wxWindowID winid, - const wxString& title, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = wxDEFAULT_FRAME_STYLE, - const wxString& name = wxFrameNameStr) - { - Init(); - Create(parent, winid, title, pos, size, style, name); - } - - DECLARE_DYNAMIC_CLASS_NO_COPY(wxTopLevelWindow) - }; - #endif // wxTopLevelWindowNative -#endif // __WXUNIVERSAL__/!__WXUNIVERSAL__ - - -#endif // _WX_TOPLEVEL_BASE_H_ diff --git a/wxWidgets/include/wx/treebase.h b/wxWidgets/include/wx/treebase.h deleted file mode 100644 index 775a4492c6..0000000000 --- a/wxWidgets/include/wx/treebase.h +++ /dev/null @@ -1,426 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/treebase.h -// Purpose: wxTreeCtrl base classes and types -// Author: Julian Smart et al -// Modified by: -// Created: 01/02/97 -// RCS-ID: $Id: treebase.h 53135 2008-04-12 02:31:04Z VZ $ -// Copyright: (c) 1997,1998 Robert Roebling -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_TREEBASE_H_ -#define _WX_TREEBASE_H_ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -#include "wx/defs.h" - -#if wxUSE_TREECTRL - -#include "wx/window.h" // for wxClientData -#include "wx/event.h" -#include "wx/dynarray.h" - -#if WXWIN_COMPATIBILITY_2_6 - -// flags for deprecated `Expand(int action)', will be removed in next versions -enum -{ - wxTREE_EXPAND_EXPAND, - wxTREE_EXPAND_COLLAPSE, - wxTREE_EXPAND_COLLAPSE_RESET, - wxTREE_EXPAND_TOGGLE -}; - -#endif // WXWIN_COMPATIBILITY_2_6 - -// ---------------------------------------------------------------------------- -// wxTreeItemId identifies an element of the tree. In this implementation, it's -// just a trivial wrapper around Win32 HTREEITEM or a pointer to some private -// data structure in the generic version. It's opaque for the application and -// the only method which can be used by user code is IsOk(). -// ---------------------------------------------------------------------------- - -// Using this typedef removes an ambiguity when calling Remove() -typedef void *wxTreeItemIdValue; - -class WXDLLEXPORT wxTreeItemId -{ - friend bool operator==(const wxTreeItemId&, const wxTreeItemId&); -public: - // ctors - // 0 is invalid value for HTREEITEM - wxTreeItemId() { m_pItem = 0; } - - // construct wxTreeItemId from the native item id - wxTreeItemId(void *pItem) { m_pItem = pItem; } - - // default copy ctor/assignment operator are ok for us - - // accessors - // is this a valid tree item? - bool IsOk() const { return m_pItem != 0; } - // return true if this item is not valid - bool operator!() const { return !IsOk(); } - - // operations - // invalidate the item - void Unset() { m_pItem = 0; } - -#if WXWIN_COMPATIBILITY_2_4 - // deprecated: only for compatibility, don't work on 64 bit archs - wxTreeItemId(long item) { m_pItem = wxUIntToPtr(item); } - operator long() const { return (long)wxPtrToUInt(m_pItem); } -#else // !WXWIN_COMPATIBILITY_2_4 - operator bool() const { return IsOk(); } -#endif // WXWIN_COMPATIBILITY_2_4/!WXWIN_COMPATIBILITY_2_4 - - wxTreeItemIdValue m_pItem; -}; - -inline bool operator==(const wxTreeItemId& i1, const wxTreeItemId& i2) -{ - return i1.m_pItem == i2.m_pItem; -} - -inline bool operator!=(const wxTreeItemId& i1, const wxTreeItemId& i2) -{ - return i1.m_pItem != i2.m_pItem; -} - -// ---------------------------------------------------------------------------- -// wxTreeItemData is some (arbitrary) user class associated with some item. The -// main advantage of having this class (compared to old untyped interface) is -// that wxTreeItemData's are destroyed automatically by the tree and, as this -// class has virtual dtor, it means that the memory will be automatically -// freed. OTOH, we don't just use wxObject instead of wxTreeItemData because -// the size of this class is critical: in any real application, each tree leaf -// will have wxTreeItemData associated with it and number of leaves may be -// quite big. -// -// Because the objects of this class are deleted by the tree, they should -// always be allocated on the heap! -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxTreeItemData: public wxClientData -{ -friend class WXDLLIMPEXP_FWD_CORE wxTreeCtrl; -friend class WXDLLIMPEXP_FWD_CORE wxGenericTreeCtrl; -public: - // creation/destruction - // -------------------- - // default ctor - wxTreeItemData() { } - - // default copy ctor/assignment operator are ok - - // accessor: get the item associated with us - const wxTreeItemId& GetId() const { return m_pItem; } - void SetId(const wxTreeItemId& id) { m_pItem = id; } - -protected: - wxTreeItemId m_pItem; -}; - -WX_DEFINE_EXPORTED_ARRAY_PTR(wxTreeItemIdValue, wxArrayTreeItemIdsBase); - -// this is a wrapper around the array class defined above which allow to wok -// with vaue of natural wxTreeItemId type instead of using wxTreeItemIdValue -// and does it without any loss of efficiency -class WXDLLEXPORT wxArrayTreeItemIds : public wxArrayTreeItemIdsBase -{ -public: - void Add(const wxTreeItemId& id) - { wxArrayTreeItemIdsBase::Add(id.m_pItem); } - void Insert(const wxTreeItemId& id, size_t pos) - { wxArrayTreeItemIdsBase::Insert(id.m_pItem, pos); } - wxTreeItemId Item(size_t i) const - { return wxTreeItemId(wxArrayTreeItemIdsBase::Item(i)); } - wxTreeItemId operator[](size_t i) const { return Item(i); } -}; - -// ---------------------------------------------------------------------------- -// constants -// ---------------------------------------------------------------------------- - -// enum for different images associated with a treectrl item -enum wxTreeItemIcon -{ - wxTreeItemIcon_Normal, // not selected, not expanded - wxTreeItemIcon_Selected, // selected, not expanded - wxTreeItemIcon_Expanded, // not selected, expanded - wxTreeItemIcon_SelectedExpanded, // selected, expanded - wxTreeItemIcon_Max -}; - -// ---------------------------------------------------------------------------- -// wxTreeCtrl flags -// ---------------------------------------------------------------------------- - -#define wxTR_NO_BUTTONS 0x0000 // for convenience -#define wxTR_HAS_BUTTONS 0x0001 // draw collapsed/expanded btns -#define wxTR_NO_LINES 0x0004 // don't draw lines at all -#define wxTR_LINES_AT_ROOT 0x0008 // connect top-level nodes -#define wxTR_TWIST_BUTTONS 0x0010 // still used by wxTreeListCtrl - -#define wxTR_SINGLE 0x0000 // for convenience -#define wxTR_MULTIPLE 0x0020 // can select multiple items -#define wxTR_EXTENDED 0x0040 // TODO: allow extended selection -#define wxTR_HAS_VARIABLE_ROW_HEIGHT 0x0080 // what it says - -#define wxTR_EDIT_LABELS 0x0200 // can edit item labels -#define wxTR_ROW_LINES 0x0400 // put border around items -#define wxTR_HIDE_ROOT 0x0800 // don't display root node - -#define wxTR_FULL_ROW_HIGHLIGHT 0x2000 // highlight full horz space - -#ifdef __WXGTK20__ -#define wxTR_DEFAULT_STYLE (wxTR_HAS_BUTTONS | wxTR_NO_LINES) -#else -#define wxTR_DEFAULT_STYLE (wxTR_HAS_BUTTONS | wxTR_LINES_AT_ROOT) -#endif - -#if WXWIN_COMPATIBILITY_2_6 -// deprecated, don't use -#define wxTR_MAC_BUTTONS 0 -#define wxTR_AQUA_BUTTONS 0 -#endif // WXWIN_COMPATIBILITY_2_6 - - -// values for the `flags' parameter of wxTreeCtrl::HitTest() which determine -// where exactly the specified point is situated: - -static const int wxTREE_HITTEST_ABOVE = 0x0001; -static const int wxTREE_HITTEST_BELOW = 0x0002; -static const int wxTREE_HITTEST_NOWHERE = 0x0004; - // on the button associated with an item. -static const int wxTREE_HITTEST_ONITEMBUTTON = 0x0008; - // on the bitmap associated with an item. -static const int wxTREE_HITTEST_ONITEMICON = 0x0010; - // on the indent associated with an item. -static const int wxTREE_HITTEST_ONITEMINDENT = 0x0020; - // on the label (string) associated with an item. -static const int wxTREE_HITTEST_ONITEMLABEL = 0x0040; - // on the right of the label associated with an item. -static const int wxTREE_HITTEST_ONITEMRIGHT = 0x0080; - // on the label (string) associated with an item. -static const int wxTREE_HITTEST_ONITEMSTATEICON = 0x0100; - // on the left of the wxTreeCtrl. -static const int wxTREE_HITTEST_TOLEFT = 0x0200; - // on the right of the wxTreeCtrl. -static const int wxTREE_HITTEST_TORIGHT = 0x0400; - // on the upper part (first half) of the item. -static const int wxTREE_HITTEST_ONITEMUPPERPART = 0x0800; - // on the lower part (second half) of the item. -static const int wxTREE_HITTEST_ONITEMLOWERPART = 0x1000; - - // anywhere on the item -static const int wxTREE_HITTEST_ONITEM = wxTREE_HITTEST_ONITEMICON | - wxTREE_HITTEST_ONITEMLABEL; - -// tree ctrl default name -extern WXDLLEXPORT_DATA(const wxChar) wxTreeCtrlNameStr[]; - -// ---------------------------------------------------------------------------- -// wxTreeItemAttr: a structure containing the visual attributes of an item -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxTreeItemAttr -{ -public: - // ctors - wxTreeItemAttr() { } - wxTreeItemAttr(const wxColour& colText, - const wxColour& colBack, - const wxFont& font) - : m_colText(colText), m_colBack(colBack), m_font(font) { } - - // setters - void SetTextColour(const wxColour& colText) { m_colText = colText; } - void SetBackgroundColour(const wxColour& colBack) { m_colBack = colBack; } - void SetFont(const wxFont& font) { m_font = font; } - - // accessors - bool HasTextColour() const { return m_colText.Ok(); } - bool HasBackgroundColour() const { return m_colBack.Ok(); } - bool HasFont() const { return m_font.Ok(); } - - const wxColour& GetTextColour() const { return m_colText; } - const wxColour& GetBackgroundColour() const { return m_colBack; } - const wxFont& GetFont() const { return m_font; } - -private: - wxColour m_colText, - m_colBack; - wxFont m_font; -}; - -// ---------------------------------------------------------------------------- -// wxTreeEvent is a special class for all events associated with tree controls -// -// NB: note that not all accessors make sense for all events, see the event -// descriptions below -// ---------------------------------------------------------------------------- - -class WXDLLIMPEXP_FWD_CORE wxTreeCtrlBase; - -class WXDLLEXPORT wxTreeEvent : public wxNotifyEvent -{ -public: - wxTreeEvent(wxEventType commandType, - wxTreeCtrlBase *tree, - const wxTreeItemId &item = wxTreeItemId()); - wxTreeEvent(wxEventType commandType = wxEVT_NULL, int id = 0); - wxTreeEvent(const wxTreeEvent& event); - - virtual wxEvent *Clone() const { return new wxTreeEvent(*this); } - - // accessors - // get the item on which the operation was performed or the newly - // selected item for wxEVT_COMMAND_TREE_SEL_CHANGED/ING events - wxTreeItemId GetItem() const { return m_item; } - void SetItem(const wxTreeItemId& item) { m_item = item; } - - // for wxEVT_COMMAND_TREE_SEL_CHANGED/ING events, get the previously - // selected item - wxTreeItemId GetOldItem() const { return m_itemOld; } - void SetOldItem(const wxTreeItemId& item) { m_itemOld = item; } - - // the point where the mouse was when the drag operation started (for - // wxEVT_COMMAND_TREE_BEGIN_(R)DRAG events only) or click position - wxPoint GetPoint() const { return m_pointDrag; } - void SetPoint(const wxPoint& pt) { m_pointDrag = pt; } - - // keyboard data (for wxEVT_COMMAND_TREE_KEY_DOWN only) - const wxKeyEvent& GetKeyEvent() const { return m_evtKey; } - int GetKeyCode() const { return m_evtKey.GetKeyCode(); } - void SetKeyEvent(const wxKeyEvent& evt) { m_evtKey = evt; } - - // label (for EVT_TREE_{BEGIN|END}_LABEL_EDIT only) - const wxString& GetLabel() const { return m_label; } - void SetLabel(const wxString& label) { m_label = label; } - - // edit cancel flag (for EVT_TREE_{BEGIN|END}_LABEL_EDIT only) - bool IsEditCancelled() const { return m_editCancelled; } - void SetEditCanceled(bool editCancelled) { m_editCancelled = editCancelled; } - - // Set the tooltip for the item (for EVT\_TREE\_ITEM\_GETTOOLTIP events) - void SetToolTip(const wxString& toolTip) { m_label = toolTip; } - wxString GetToolTip() { return m_label; } - -private: - // not all of the members are used (or initialized) for all events - wxKeyEvent m_evtKey; - wxTreeItemId m_item, - m_itemOld; - wxPoint m_pointDrag; - wxString m_label; - bool m_editCancelled; - - friend class WXDLLIMPEXP_FWD_CORE wxTreeCtrl; - friend class WXDLLIMPEXP_FWD_CORE wxGenericTreeCtrl; - - DECLARE_DYNAMIC_CLASS(wxTreeEvent) -}; - -typedef void (wxEvtHandler::*wxTreeEventFunction)(wxTreeEvent&); - -// ---------------------------------------------------------------------------- -// tree control events and macros for handling them -// ---------------------------------------------------------------------------- - -BEGIN_DECLARE_EVENT_TYPES() - DECLARE_EVENT_TYPE(wxEVT_COMMAND_TREE_BEGIN_DRAG, 600) - DECLARE_EVENT_TYPE(wxEVT_COMMAND_TREE_BEGIN_RDRAG, 601) - DECLARE_EVENT_TYPE(wxEVT_COMMAND_TREE_BEGIN_LABEL_EDIT, 602) - DECLARE_EVENT_TYPE(wxEVT_COMMAND_TREE_END_LABEL_EDIT, 603) - DECLARE_EVENT_TYPE(wxEVT_COMMAND_TREE_DELETE_ITEM, 604) - DECLARE_EVENT_TYPE(wxEVT_COMMAND_TREE_GET_INFO, 605) - DECLARE_EVENT_TYPE(wxEVT_COMMAND_TREE_SET_INFO, 606) - DECLARE_EVENT_TYPE(wxEVT_COMMAND_TREE_ITEM_EXPANDED, 607) - DECLARE_EVENT_TYPE(wxEVT_COMMAND_TREE_ITEM_EXPANDING, 608) - DECLARE_EVENT_TYPE(wxEVT_COMMAND_TREE_ITEM_COLLAPSED, 609) - DECLARE_EVENT_TYPE(wxEVT_COMMAND_TREE_ITEM_COLLAPSING, 610) - DECLARE_EVENT_TYPE(wxEVT_COMMAND_TREE_SEL_CHANGED, 611) - DECLARE_EVENT_TYPE(wxEVT_COMMAND_TREE_SEL_CHANGING, 612) - DECLARE_EVENT_TYPE(wxEVT_COMMAND_TREE_KEY_DOWN, 613) - DECLARE_EVENT_TYPE(wxEVT_COMMAND_TREE_ITEM_ACTIVATED, 614) - DECLARE_EVENT_TYPE(wxEVT_COMMAND_TREE_ITEM_RIGHT_CLICK, 615) - DECLARE_EVENT_TYPE(wxEVT_COMMAND_TREE_ITEM_MIDDLE_CLICK, 616) - DECLARE_EVENT_TYPE(wxEVT_COMMAND_TREE_END_DRAG, 617) - DECLARE_EVENT_TYPE(wxEVT_COMMAND_TREE_STATE_IMAGE_CLICK, 618) - DECLARE_EVENT_TYPE(wxEVT_COMMAND_TREE_ITEM_GETTOOLTIP, 619) - DECLARE_EVENT_TYPE(wxEVT_COMMAND_TREE_ITEM_MENU, 620) -END_DECLARE_EVENT_TYPES() - -#define wxTreeEventHandler(func) \ - (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxTreeEventFunction, &func) - -#define wx__DECLARE_TREEEVT(evt, id, fn) \ - wx__DECLARE_EVT1(wxEVT_COMMAND_TREE_ ## evt, id, wxTreeEventHandler(fn)) - -// GetItem() returns the item being dragged, GetPoint() the mouse coords -// -// if you call event.Allow(), the drag operation will start and a -// EVT_TREE_END_DRAG event will be sent when the drag is over. -#define EVT_TREE_BEGIN_DRAG(id, fn) wx__DECLARE_TREEEVT(BEGIN_DRAG, id, fn) -#define EVT_TREE_BEGIN_RDRAG(id, fn) wx__DECLARE_TREEEVT(BEGIN_RDRAG, id, fn) - -// GetItem() is the item on which the drop occurred (if any) and GetPoint() the -// current mouse coords -#define EVT_TREE_END_DRAG(id, fn) wx__DECLARE_TREEEVT(END_DRAG, id, fn) - -// GetItem() returns the itme whose label is being edited, GetLabel() returns -// the current item label for BEGIN and the would be new one for END. -// -// Vetoing BEGIN event means that label editing won't happen at all, -// vetoing END means that the new value is discarded and the old one kept -#define EVT_TREE_BEGIN_LABEL_EDIT(id, fn) wx__DECLARE_TREEEVT(BEGIN_LABEL_EDIT, id, fn) -#define EVT_TREE_END_LABEL_EDIT(id, fn) wx__DECLARE_TREEEVT(END_LABEL_EDIT, id, fn) - -// provide/update information about GetItem() item -#define EVT_TREE_GET_INFO(id, fn) wx__DECLARE_TREEEVT(GET_INFO, id, fn) -#define EVT_TREE_SET_INFO(id, fn) wx__DECLARE_TREEEVT(SET_INFO, id, fn) - -// GetItem() is the item being expanded/collapsed, the "ING" versions can use -#define EVT_TREE_ITEM_EXPANDED(id, fn) wx__DECLARE_TREEEVT(ITEM_EXPANDED, id, fn) -#define EVT_TREE_ITEM_EXPANDING(id, fn) wx__DECLARE_TREEEVT(ITEM_EXPANDING, id, fn) -#define EVT_TREE_ITEM_COLLAPSED(id, fn) wx__DECLARE_TREEEVT(ITEM_COLLAPSED, id, fn) -#define EVT_TREE_ITEM_COLLAPSING(id, fn) wx__DECLARE_TREEEVT(ITEM_COLLAPSING, id, fn) - -// GetOldItem() is the item which had the selection previously, GetItem() is -// the item which acquires selection -#define EVT_TREE_SEL_CHANGED(id, fn) wx__DECLARE_TREEEVT(SEL_CHANGED, id, fn) -#define EVT_TREE_SEL_CHANGING(id, fn) wx__DECLARE_TREEEVT(SEL_CHANGING, id, fn) - -// GetKeyCode() returns the key code -// NB: this is the only message for which GetItem() is invalid (you may get the -// item from GetSelection()) -#define EVT_TREE_KEY_DOWN(id, fn) wx__DECLARE_TREEEVT(KEY_DOWN, id, fn) - -// GetItem() returns the item being deleted, the associated data (if any) will -// be deleted just after the return of this event handler (if any) -#define EVT_TREE_DELETE_ITEM(id, fn) wx__DECLARE_TREEEVT(DELETE_ITEM, id, fn) - -// GetItem() returns the item that was activated (double click, enter, space) -#define EVT_TREE_ITEM_ACTIVATED(id, fn) wx__DECLARE_TREEEVT(ITEM_ACTIVATED, id, fn) - -// GetItem() returns the item for which the context menu shall be shown -#define EVT_TREE_ITEM_MENU(id, fn) wx__DECLARE_TREEEVT(ITEM_MENU, id, fn) - -// GetItem() returns the item that was clicked on -#define EVT_TREE_ITEM_RIGHT_CLICK(id, fn) wx__DECLARE_TREEEVT(ITEM_RIGHT_CLICK, id, fn) -#define EVT_TREE_ITEM_MIDDLE_CLICK(id, fn) wx__DECLARE_TREEEVT(ITEM_MIDDLE_CLICK, id, fn) - -// GetItem() returns the item whose state image was clicked on -#define EVT_TREE_STATE_IMAGE_CLICK(id, fn) wx__DECLARE_TREEEVT(STATE_IMAGE_CLICK, id, fn) - -// GetItem() is the item for which the tooltip is being requested -#define EVT_TREE_ITEM_GETTOOLTIP(id, fn) wx__DECLARE_TREEEVT(ITEM_GETTOOLTIP, id, fn) - -#endif // wxUSE_TREECTRL - -#endif // _WX_TREEBASE_H_ diff --git a/wxWidgets/include/wx/treebook.h b/wxWidgets/include/wx/treebook.h deleted file mode 100644 index abc4ca7d22..0000000000 --- a/wxWidgets/include/wx/treebook.h +++ /dev/null @@ -1,283 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: wx/treebook.h -// Purpose: wxTreebook: wxNotebook-like control presenting pages in a tree -// Author: Evgeniy Tarassov, Vadim Zeitlin -// Modified by: -// Created: 2005-09-15 -// RCS-ID: $Id: treebook.h 49804 2007-11-10 01:09:42Z VZ $ -// Copyright: (c) 2005 Vadim Zeitlin <vadim@wxwidgets.org> -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_TREEBOOK_H_ -#define _WX_TREEBOOK_H_ - -#include "wx/defs.h" - -#if wxUSE_TREEBOOK - -#include "wx/bookctrl.h" -#include "wx/treectrl.h" // for wxArrayTreeItemIds -#include "wx/containr.h" - -typedef wxWindow wxTreebookPage; - -class WXDLLIMPEXP_FWD_CORE wxTreeEvent; - -// ---------------------------------------------------------------------------- -// wxTreebook -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxTreebook : public wxBookCtrlBase -{ -public: - // Constructors and such - // --------------------- - - // Default ctor doesn't create the control, use Create() afterwards - wxTreebook() - { - Init(); - } - - // This ctor creates the tree book control - wxTreebook(wxWindow *parent, - wxWindowID id, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = wxBK_DEFAULT, - const wxString& name = wxEmptyString) - { - Init(); - - (void)Create(parent, id, pos, size, style, name); - } - - // Really creates the control - bool Create(wxWindow *parent, - wxWindowID id, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = wxBK_DEFAULT, - const wxString& name = wxEmptyString); - - - // Page insertion operations - // ------------------------- - - // Notice that page pointer may be NULL in which case the next non NULL - // page (usually the first child page of a node) is shown when this page is - // selected - - // Inserts a new page just before the page indicated by page. - // The new page is placed on the same level as page. - virtual bool InsertPage(size_t pos, - wxWindow *page, - const wxString& text, - bool bSelect = false, - int imageId = wxNOT_FOUND); - - // Inserts a new sub-page to the end of children of the page at given pos. - virtual bool InsertSubPage(size_t pos, - wxWindow *page, - const wxString& text, - bool bSelect = false, - int imageId = wxNOT_FOUND); - - // Adds a new page at top level after all other pages. - virtual bool AddPage(wxWindow *page, - const wxString& text, - bool bSelect = false, - int imageId = wxNOT_FOUND); - - // Adds a new child-page to the last top-level page inserted. - // Useful when constructing 1 level tree structure. - virtual bool AddSubPage(wxWindow *page, - const wxString& text, - bool bSelect = false, - int imageId = wxNOT_FOUND); - - // Deletes the page and ALL its children. Could trigger page selection - // change in a case when selected page is removed. In that case its parent - // is selected (or the next page if no parent). - virtual bool DeletePage(size_t pos); - - - // Tree operations - // --------------- - - // Gets the page node state -- node is expanded or collapsed - virtual bool IsNodeExpanded(size_t pos) const; - - // Expands or collapses the page node. Returns the previous state. - // May generate page changing events (if selected page - // is under the collapsed branch, then parent is autoselected). - virtual bool ExpandNode(size_t pos, bool expand = true); - - // shortcut for ExpandNode(pos, false) - bool CollapseNode(size_t pos) { return ExpandNode(pos, false); } - - // get the parent page or wxNOT_FOUND if this is a top level page - int GetPageParent(size_t pos) const; - - // the tree control we use for showing the pages index tree - wxTreeCtrl* GetTreeCtrl() const { return (wxTreeCtrl*)m_bookctrl; } - - - // Standard operations inherited from wxBookCtrlBase - // ------------------------------------------------- - - virtual int GetSelection() const; - virtual bool SetPageText(size_t n, const wxString& strText); - virtual wxString GetPageText(size_t n) const; - virtual int GetPageImage(size_t n) const; - virtual bool SetPageImage(size_t n, int imageId); - virtual wxSize CalcSizeFromPage(const wxSize& sizePage) const; - virtual int SetSelection(size_t n) { return DoSetSelection(n, SetSelection_SendEvent); } - virtual int ChangeSelection(size_t n) { return DoSetSelection(n); } - virtual int HitTest(const wxPoint& pt, long *flags = NULL) const; - virtual void SetImageList(wxImageList *imageList); - virtual void AssignImageList(wxImageList *imageList); - virtual bool DeleteAllPages(); - -protected: - // Implementation of a page removal. See DeletPage for comments. - wxTreebookPage *DoRemovePage(size_t pos); - - // This subclass of wxBookCtrlBase accepts NULL page pointers (empty pages) - virtual bool AllowNullPage() const { return true; } - - // event handlers - void OnTreeSelectionChange(wxTreeEvent& event); - void OnTreeNodeExpandedCollapsed(wxTreeEvent& event); - - // array of page ids and page windows - wxArrayTreeItemIds m_treeIds; - - // the currently selected page or wxNOT_FOUND if none - int m_selection; - - // in the situation when m_selection page is not wxNOT_FOUND but page is - // NULL this is the first (sub)child that has a non-NULL page - int m_actualSelection; - -private: - // common part of all constructors - void Init(); - - // The real implementations of page insertion functions - // ------------------------------------------------------ - // All DoInsert/Add(Sub)Page functions add the page into : - // - the base class - // - the tree control - // - update the index/TreeItemId corespondance array - bool DoInsertPage(size_t pos, - wxWindow *page, - const wxString& text, - bool bSelect = false, - int imageId = wxNOT_FOUND); - bool DoInsertSubPage(size_t pos, - wxWindow *page, - const wxString& text, - bool bSelect = false, - int imageId = wxNOT_FOUND); - bool DoAddSubPage(wxWindow *page, - const wxString& text, - bool bSelect = false, - int imageId = wxNOT_FOUND); - - // Sets selection in the tree control and updates the page being shown. - int DoSetSelection(size_t pos, int flags = 0); - - // Returns currently shown page. In a case when selected the node - // has empty (NULL) page finds first (sub)child with not-empty page. - wxTreebookPage *DoGetCurrentPage() const; - - // Does the selection update. Called from page insertion functions - // to update selection if the selected page was pushed by the newly inserted - void DoUpdateSelection(bool bSelect, int page); - - - // Operations on the internal private members of the class - // ------------------------------------------------------- - // Returns the page TreeItemId for the page. - // Or, if the page index is incorrect, a fake one (fakePage.IsOk() == false) - wxTreeItemId DoInternalGetPage(size_t pos) const; - - // Linear search for a page with the id specified. If no page - // found wxNOT_FOUND is returned. The function is used when we catch an event - // from m_tree (wxTreeCtrl) component. - int DoInternalFindPageById(wxTreeItemId page) const; - - // Updates page and wxTreeItemId correspondance. - void DoInternalAddPage(size_t newPos, wxWindow *page, wxTreeItemId pageId); - - // Removes the page from internal structure. - void DoInternalRemovePage(size_t pos) - { DoInternalRemovePageRange(pos, 0); } - - // Removes the page and all its children designated by subCount - // from internal structures of the control. - void DoInternalRemovePageRange(size_t pos, size_t subCount); - - // Returns internal number of pages which can be different from - // GetPageCount() while performing a page insertion or removal. - size_t DoInternalGetPageCount() const { return m_treeIds.Count(); } - - - DECLARE_EVENT_TABLE() - DECLARE_DYNAMIC_CLASS_NO_COPY(wxTreebook) - WX_DECLARE_CONTROL_CONTAINER(); -}; - - -// ---------------------------------------------------------------------------- -// treebook event class and related stuff -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxTreebookEvent : public wxBookCtrlBaseEvent -{ -public: - wxTreebookEvent(wxEventType commandType = wxEVT_NULL, int id = 0, - int nSel = wxNOT_FOUND, int nOldSel = wxNOT_FOUND) - : wxBookCtrlBaseEvent(commandType, id, nSel, nOldSel) - { - } - - wxTreebookEvent(const wxTreebookEvent& event) - : wxBookCtrlBaseEvent(event) - { - } - - virtual wxEvent *Clone() const { return new wxTreebookEvent(*this); } - -private: - DECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxTreebookEvent) -}; - -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_COMMAND_TREEBOOK_PAGE_CHANGED; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_COMMAND_TREEBOOK_PAGE_CHANGING; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_COMMAND_TREEBOOK_NODE_COLLAPSED; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_COMMAND_TREEBOOK_NODE_EXPANDED; - -typedef void (wxEvtHandler::*wxTreebookEventFunction)(wxTreebookEvent&); - -#define wxTreebookEventHandler(func) \ - (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxTreebookEventFunction, &func) - -#define EVT_TREEBOOK_PAGE_CHANGED(winid, fn) \ - wx__DECLARE_EVT1(wxEVT_COMMAND_TREEBOOK_PAGE_CHANGED, winid, wxTreebookEventHandler(fn)) - -#define EVT_TREEBOOK_PAGE_CHANGING(winid, fn) \ - wx__DECLARE_EVT1(wxEVT_COMMAND_TREEBOOK_PAGE_CHANGING, winid, wxTreebookEventHandler(fn)) - -#define EVT_TREEBOOK_NODE_COLLAPSED(winid, fn) \ - wx__DECLARE_EVT1(wxEVT_COMMAND_TREEBOOK_NODE_COLLAPSED, winid, wxTreebookEventHandler(fn)) - -#define EVT_TREEBOOK_NODE_EXPANDED(winid, fn) \ - wx__DECLARE_EVT1(wxEVT_COMMAND_TREEBOOK_NODE_EXPANDED, winid, wxTreebookEventHandler(fn)) - - -#endif // wxUSE_TREEBOOK - -#endif // _WX_TREEBOOK_H_ diff --git a/wxWidgets/include/wx/treectrl.h b/wxWidgets/include/wx/treectrl.h deleted file mode 100644 index d45855eb43..0000000000 --- a/wxWidgets/include/wx/treectrl.h +++ /dev/null @@ -1,459 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/treectrl.h -// Purpose: wxTreeCtrl base header -// Author: Karsten Ballueder -// Modified by: -// Created: -// Copyright: (c) Karsten Ballueder -// RCS-ID: $Id: treectrl.h 49563 2007-10-31 20:46:21Z VZ $ -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_TREECTRL_H_BASE_ -#define _WX_TREECTRL_H_BASE_ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -#include "wx/defs.h" - -#if wxUSE_TREECTRL - -#include "wx/control.h" -#include "wx/treebase.h" -#include "wx/textctrl.h" // wxTextCtrl::ms_classinfo used through CLASSINFO macro - -class WXDLLIMPEXP_FWD_CORE wxImageList; - -// ---------------------------------------------------------------------------- -// wxTreeCtrlBase -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxTreeCtrlBase : public wxControl -{ -public: - wxTreeCtrlBase() - { - m_imageListNormal = - m_imageListState = NULL; - m_ownsImageListNormal = - m_ownsImageListState = false; - - // arbitrary default - m_spacing = 18; - - // quick DoGetBestSize calculation - m_quickBestSize = true; - } - - virtual ~wxTreeCtrlBase(); - - // accessors - // --------- - - // get the total number of items in the control - virtual unsigned int GetCount() const = 0; - - // indent is the number of pixels the children are indented relative to - // the parents position. SetIndent() also redraws the control - // immediately. - virtual unsigned int GetIndent() const = 0; - virtual void SetIndent(unsigned int indent) = 0; - - // spacing is the number of pixels between the start and the Text - // (has no effect under wxMSW) - unsigned int GetSpacing() const { return m_spacing; } - void SetSpacing(unsigned int spacing) { m_spacing = spacing; } - - // image list: these functions allow to associate an image list with - // the control and retrieve it. Note that the control does _not_ delete - // the associated image list when it's deleted in order to allow image - // lists to be shared between different controls. - // - // The normal image list is for the icons which correspond to the - // normal tree item state (whether it is selected or not). - // Additionally, the application might choose to show a state icon - // which corresponds to an app-defined item state (for example, - // checked/unchecked) which are taken from the state image list. - wxImageList *GetImageList() const { return m_imageListNormal; } - wxImageList *GetStateImageList() const { return m_imageListState; } - - virtual void SetImageList(wxImageList *imageList) = 0; - virtual void SetStateImageList(wxImageList *imageList) = 0; - void AssignImageList(wxImageList *imageList) - { - SetImageList(imageList); - m_ownsImageListNormal = true; - } - void AssignStateImageList(wxImageList *imageList) - { - SetStateImageList(imageList); - m_ownsImageListState = true; - } - - - // Functions to work with tree ctrl items. Unfortunately, they can _not_ be - // member functions of wxTreeItem because they must know the tree the item - // belongs to for Windows implementation and storing the pointer to - // wxTreeCtrl in each wxTreeItem is just too much waste. - - // accessors - // --------- - - // retrieve items label - virtual wxString GetItemText(const wxTreeItemId& item) const = 0; - // get one of the images associated with the item (normal by default) - virtual int GetItemImage(const wxTreeItemId& item, - wxTreeItemIcon which = wxTreeItemIcon_Normal) const = 0; - // get the data associated with the item - virtual wxTreeItemData *GetItemData(const wxTreeItemId& item) const = 0; - - // get the item's text colour - virtual wxColour GetItemTextColour(const wxTreeItemId& item) const = 0; - - // get the item's background colour - virtual wxColour GetItemBackgroundColour(const wxTreeItemId& item) const = 0; - - // get the item's font - virtual wxFont GetItemFont(const wxTreeItemId& item) const = 0; - - // modifiers - // --------- - - // set items label - virtual void SetItemText(const wxTreeItemId& item, const wxString& text) = 0; - // get one of the images associated with the item (normal by default) - virtual void SetItemImage(const wxTreeItemId& item, - int image, - wxTreeItemIcon which = wxTreeItemIcon_Normal) = 0; - // associate some data with the item - virtual void SetItemData(const wxTreeItemId& item, wxTreeItemData *data) = 0; - - // force appearance of [+] button near the item. This is useful to - // allow the user to expand the items which don't have any children now - // - but instead add them only when needed, thus minimizing memory - // usage and loading time. - virtual void SetItemHasChildren(const wxTreeItemId& item, - bool has = true) = 0; - - // the item will be shown in bold - virtual void SetItemBold(const wxTreeItemId& item, bool bold = true) = 0; - - // the item will be shown with a drop highlight - virtual void SetItemDropHighlight(const wxTreeItemId& item, - bool highlight = true) = 0; - - // set the items text colour - virtual void SetItemTextColour(const wxTreeItemId& item, - const wxColour& col) = 0; - - // set the items background colour - virtual void SetItemBackgroundColour(const wxTreeItemId& item, - const wxColour& col) = 0; - - // set the items font (should be of the same height for all items) - virtual void SetItemFont(const wxTreeItemId& item, - const wxFont& font) = 0; - - // item status inquiries - // --------------------- - - // is the item visible (it might be outside the view or not expanded)? - virtual bool IsVisible(const wxTreeItemId& item) const = 0; - // does the item has any children? - virtual bool ItemHasChildren(const wxTreeItemId& item) const = 0; - // same as above - bool HasChildren(const wxTreeItemId& item) const - { return ItemHasChildren(item); } - // is the item expanded (only makes sense if HasChildren())? - virtual bool IsExpanded(const wxTreeItemId& item) const = 0; - // is this item currently selected (the same as has focus)? - virtual bool IsSelected(const wxTreeItemId& item) const = 0; - // is item text in bold font? - virtual bool IsBold(const wxTreeItemId& item) const = 0; -#if wxABI_VERSION >= 20801 - // is the control empty? - bool IsEmpty() const; -#endif // wxABI 2.8.1+ - - - // number of children - // ------------------ - - // if 'recursively' is false, only immediate children count, otherwise - // the returned number is the number of all items in this branch - virtual size_t GetChildrenCount(const wxTreeItemId& item, - bool recursively = true) const = 0; - - // navigation - // ---------- - - // wxTreeItemId.IsOk() will return false if there is no such item - - // get the root tree item - virtual wxTreeItemId GetRootItem() const = 0; - - // get the item currently selected (may return NULL if no selection) - virtual wxTreeItemId GetSelection() const = 0; - - // get the items currently selected, return the number of such item - // - // NB: this operation is expensive and can take a long time for a - // control with a lot of items (~ O(number of items)). - virtual size_t GetSelections(wxArrayTreeItemIds& selections) const = 0; - - // get the parent of this item (may return NULL if root) - virtual wxTreeItemId GetItemParent(const wxTreeItemId& item) const = 0; - - // for this enumeration function you must pass in a "cookie" parameter - // which is opaque for the application but is necessary for the library - // to make these functions reentrant (i.e. allow more than one - // enumeration on one and the same object simultaneously). Of course, - // the "cookie" passed to GetFirstChild() and GetNextChild() should be - // the same! - - // get the first child of this item - virtual wxTreeItemId GetFirstChild(const wxTreeItemId& item, - wxTreeItemIdValue& cookie) const = 0; - // get the next child - virtual wxTreeItemId GetNextChild(const wxTreeItemId& item, - wxTreeItemIdValue& cookie) const = 0; - // get the last child of this item - this method doesn't use cookies - virtual wxTreeItemId GetLastChild(const wxTreeItemId& item) const = 0; - - // get the next sibling of this item - virtual wxTreeItemId GetNextSibling(const wxTreeItemId& item) const = 0; - // get the previous sibling - virtual wxTreeItemId GetPrevSibling(const wxTreeItemId& item) const = 0; - - // get first visible item - virtual wxTreeItemId GetFirstVisibleItem() const = 0; - // get the next visible item: item must be visible itself! - // see IsVisible() and wxTreeCtrl::GetFirstVisibleItem() - virtual wxTreeItemId GetNextVisible(const wxTreeItemId& item) const = 0; - // get the previous visible item: item must be visible itself! - virtual wxTreeItemId GetPrevVisible(const wxTreeItemId& item) const = 0; - - // operations - // ---------- - - // add the root node to the tree - virtual wxTreeItemId AddRoot(const wxString& text, - int image = -1, int selImage = -1, - wxTreeItemData *data = NULL) = 0; - - // insert a new item in as the first child of the parent - wxTreeItemId PrependItem(const wxTreeItemId& parent, - const wxString& text, - int image = -1, int selImage = -1, - wxTreeItemData *data = NULL) - { - return DoInsertItem(parent, 0u, text, image, selImage, data); - } - - // insert a new item after a given one - wxTreeItemId InsertItem(const wxTreeItemId& parent, - const wxTreeItemId& idPrevious, - const wxString& text, - int image = -1, int selImage = -1, - wxTreeItemData *data = NULL) - { - return DoInsertAfter(parent, idPrevious, text, image, selImage, data); - } - - // insert a new item before the one with the given index - wxTreeItemId InsertItem(const wxTreeItemId& parent, - size_t pos, - const wxString& text, - int image = -1, int selImage = -1, - wxTreeItemData *data = NULL) - { - return DoInsertItem(parent, pos, text, image, selImage, data); - } - - // insert a new item in as the last child of the parent - wxTreeItemId AppendItem(const wxTreeItemId& parent, - const wxString& text, - int image = -1, int selImage = -1, - wxTreeItemData *data = NULL) - { - return DoInsertItem(parent, (size_t)-1, text, image, selImage, data); - } - - // delete this item and associated data if any - virtual void Delete(const wxTreeItemId& item) = 0; - // delete all children (but don't delete the item itself) - // NB: this won't send wxEVT_COMMAND_TREE_ITEM_DELETED events - virtual void DeleteChildren(const wxTreeItemId& item) = 0; - // delete all items from the tree - // NB: this won't send wxEVT_COMMAND_TREE_ITEM_DELETED events - virtual void DeleteAllItems() = 0; - - // expand this item - virtual void Expand(const wxTreeItemId& item) = 0; - // expand the item and all its childs and thats childs - void ExpandAllChildren(const wxTreeItemId& item); - // expand all items - void ExpandAll(); - // collapse the item without removing its children - virtual void Collapse(const wxTreeItemId& item) = 0; -#if wxABI_VERSION >= 20801 - // collapse the item and all its childs and thats childs - void CollapseAllChildren(const wxTreeItemId& item); - // collapse all items - void CollapseAll(); -#endif // wxABI 2.8.1+ - // collapse the item and remove all children - virtual void CollapseAndReset(const wxTreeItemId& item) = 0; - // toggles the current state - virtual void Toggle(const wxTreeItemId& item) = 0; - - // remove the selection from currently selected item (if any) - virtual void Unselect() = 0; - // unselect all items (only makes sense for multiple selection control) - virtual void UnselectAll() = 0; - // select this item - virtual void SelectItem(const wxTreeItemId& item, bool select = true) = 0; - // unselect this item - void UnselectItem(const wxTreeItemId& item) { SelectItem(item, false); } - // toggle item selection - void ToggleItemSelection(const wxTreeItemId& item) - { - SelectItem(item, !IsSelected(item)); - } - - // make sure this item is visible (expanding the parent item and/or - // scrolling to this item if necessary) - virtual void EnsureVisible(const wxTreeItemId& item) = 0; - // scroll to this item (but don't expand its parent) - virtual void ScrollTo(const wxTreeItemId& item) = 0; - - // start editing the item label: this (temporarily) replaces the item - // with a one line edit control. The item will be selected if it hadn't - // been before. textCtrlClass parameter allows you to create an edit - // control of arbitrary user-defined class deriving from wxTextCtrl. - virtual wxTextCtrl *EditLabel(const wxTreeItemId& item, - wxClassInfo* textCtrlClass = CLASSINFO(wxTextCtrl)) = 0; - // returns the same pointer as StartEdit() if the item is being edited, - // NULL otherwise (it's assumed that no more than one item may be - // edited simultaneously) - virtual wxTextCtrl *GetEditControl() const = 0; - // end editing and accept or discard the changes to item label - virtual void EndEditLabel(const wxTreeItemId& item, - bool discardChanges = false) = 0; - - // sorting - // ------- - - // this function is called to compare 2 items and should return -1, 0 - // or +1 if the first item is less than, equal to or greater than the - // second one. The base class version performs alphabetic comparaison - // of item labels (GetText) - virtual int OnCompareItems(const wxTreeItemId& item1, - const wxTreeItemId& item2) - { - return wxStrcmp(GetItemText(item1), GetItemText(item2)); - } - - // sort the children of this item using OnCompareItems - // - // NB: this function is not reentrant and not MT-safe (FIXME)! - virtual void SortChildren(const wxTreeItemId& item) = 0; - - // items geometry - // -------------- - - // determine to which item (if any) belongs the given point (the - // coordinates specified are relative to the client area of tree ctrl) - // and, in the second variant, fill the flags parameter with a bitmask - // of wxTREE_HITTEST_xxx constants. - wxTreeItemId HitTest(const wxPoint& point) const - { int dummy; return DoTreeHitTest(point, dummy); } - wxTreeItemId HitTest(const wxPoint& point, int& flags) const - { return DoTreeHitTest(point, flags); } - - // get the bounding rectangle of the item (or of its label only) - virtual bool GetBoundingRect(const wxTreeItemId& item, - wxRect& rect, - bool textOnly = false) const = 0; - - - // implementation - // -------------- - - virtual bool ShouldInheritColours() const { return false; } - - // hint whether to calculate best size quickly or accurately - void SetQuickBestSize(bool q) { m_quickBestSize = q; } - bool GetQuickBestSize() const { return m_quickBestSize; } - -protected: - virtual wxSize DoGetBestSize() const; - - // common part of Append/Prepend/InsertItem() - // - // pos is the position at which to insert the item or (size_t)-1 to append - // it to the end - virtual wxTreeItemId DoInsertItem(const wxTreeItemId& parent, - size_t pos, - const wxString& text, - int image, int selImage, - wxTreeItemData *data) = 0; - - // and this function implements overloaded InsertItem() taking wxTreeItemId - // (it can't be called InsertItem() as we'd have virtual function hiding - // problem in derived classes then) - virtual wxTreeItemId DoInsertAfter(const wxTreeItemId& parent, - const wxTreeItemId& idPrevious, - const wxString& text, - int image = -1, int selImage = -1, - wxTreeItemData *data = NULL) = 0; - - // real HitTest() implementation: again, can't be called just HitTest() - // because it's overloaded and so the non-virtual overload would be hidden - // (and can't be called DoHitTest() because this is already in wxWindow) - virtual wxTreeItemId DoTreeHitTest(const wxPoint& point, - int& flags) const = 0; - - - wxImageList *m_imageListNormal, // images for tree elements - *m_imageListState; // special images for app defined states - bool m_ownsImageListNormal, - m_ownsImageListState; - - // spacing between left border and the text - unsigned int m_spacing; - - // whether full or quick calculation is done in DoGetBestSize - bool m_quickBestSize; - - - DECLARE_NO_COPY_CLASS(wxTreeCtrlBase) -}; - -// ---------------------------------------------------------------------------- -// include the platform-dependent wxTreeCtrl class -// ---------------------------------------------------------------------------- - -#if defined(__WXUNIVERSAL__) - #include "wx/generic/treectlg.h" -#elif defined(__WXPALMOS__) - #include "wx/palmos/treectrl.h" -#elif defined(__WXMSW__) - #include "wx/msw/treectrl.h" -#elif defined(__WXMOTIF__) - #include "wx/generic/treectlg.h" -#elif defined(__WXGTK__) - #include "wx/generic/treectlg.h" -#elif defined(__WXMAC__) - #include "wx/generic/treectlg.h" -#elif defined(__WXCOCOA__) - #include "wx/generic/treectlg.h" -#elif defined(__WXPM__) - #include "wx/generic/treectlg.h" -#endif - -#endif // wxUSE_TREECTRL - -#endif // _WX_TREECTRL_H_BASE_ diff --git a/wxWidgets/include/wx/txtstrm.h b/wxWidgets/include/wx/txtstrm.h deleted file mode 100644 index 969f6ddfa4..0000000000 --- a/wxWidgets/include/wx/txtstrm.h +++ /dev/null @@ -1,160 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/txtstrm.h -// Purpose: Text stream classes -// Author: Guilhem Lavaux -// Modified by: -// Created: 28/06/1998 -// RCS-ID: $Id: txtstrm.h 53135 2008-04-12 02:31:04Z VZ $ -// Copyright: (c) Guilhem Lavaux -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_TXTSTREAM_H_ -#define _WX_TXTSTREAM_H_ - -#include "wx/stream.h" -#include "wx/convauto.h" - -#if wxUSE_STREAMS - -class WXDLLIMPEXP_FWD_BASE wxTextInputStream; -class WXDLLIMPEXP_FWD_BASE wxTextOutputStream; - -typedef wxTextInputStream& (*__wxTextInputManip)(wxTextInputStream&); -typedef wxTextOutputStream& (*__wxTextOutputManip)(wxTextOutputStream&); - -WXDLLIMPEXP_BASE wxTextOutputStream &endl( wxTextOutputStream &stream ); - - -#define wxEOT wxT('\4') // the End-Of-Text control code (used only inside wxTextInputStream) - -// If you're scanning through a file using wxTextInputStream, you should check for EOF _before_ -// reading the next item (word / number), because otherwise the last item may get lost. -// You should however be prepared to receive an empty item (empty string / zero number) at the -// end of file, especially on Windows systems. This is unavoidable because most (but not all) files end -// with whitespace (i.e. usually a newline). -class WXDLLIMPEXP_BASE wxTextInputStream -{ -public: -#if wxUSE_UNICODE - wxTextInputStream(wxInputStream& s, - const wxString &sep=wxT(" \t"), - const wxMBConv& conv = wxConvAuto()); -#else - wxTextInputStream(wxInputStream& s, const wxString &sep=wxT(" \t")); -#endif - ~wxTextInputStream(); - - wxUint32 Read32(int base = 10); // base may be between 2 and 36, inclusive, or the special 0 (= C format) - wxUint16 Read16(int base = 10); - wxUint8 Read8(int base = 10); - wxInt32 Read32S(int base = 10); - wxInt16 Read16S(int base = 10); - wxInt8 Read8S(int base = 10); - double ReadDouble(); - wxString ReadLine(); - wxString ReadWord(); - wxChar GetChar() { wxChar c = NextChar(); return (wxChar)(c != wxEOT ? c : 0); } - - wxString GetStringSeparators() const { return m_separators; } - void SetStringSeparators(const wxString &c) { m_separators = c; } - - // Operators - wxTextInputStream& operator>>(wxString& word); - wxTextInputStream& operator>>(char& c); -#if wxUSE_UNICODE && wxWCHAR_T_IS_REAL_TYPE - wxTextInputStream& operator>>(wchar_t& wc); -#endif // wxUSE_UNICODE - wxTextInputStream& operator>>(wxInt16& i); - wxTextInputStream& operator>>(wxInt32& i); - wxTextInputStream& operator>>(wxUint16& i); - wxTextInputStream& operator>>(wxUint32& i); - wxTextInputStream& operator>>(double& i); - wxTextInputStream& operator>>(float& f); - - wxTextInputStream& operator>>( __wxTextInputManip func) { return func(*this); } - -#if WXWIN_COMPATIBILITY_2_6 - wxDEPRECATED( wxString ReadString() ); // use ReadLine or ReadWord instead -#endif // WXWIN_COMPATIBILITY_2_6 - -protected: - wxInputStream &m_input; - wxString m_separators; - char m_lastBytes[10]; // stores the bytes that were read for the last character - -#if wxUSE_UNICODE - wxMBConv *m_conv; -#endif - - bool EatEOL(const wxChar &c); - void UngetLast(); // should be used instead of wxInputStream::Ungetch() because of Unicode issues - // returns EOT (\4) if there is a stream error, or end of file - wxChar NextChar(); // this should be used instead of GetC() because of Unicode issues - wxChar NextNonSeparators(); - - DECLARE_NO_COPY_CLASS(wxTextInputStream) -}; - -typedef enum -{ - wxEOL_NATIVE, - wxEOL_UNIX, - wxEOL_MAC, - wxEOL_DOS -} wxEOL; - -class WXDLLIMPEXP_BASE wxTextOutputStream -{ -public: -#if wxUSE_UNICODE - wxTextOutputStream(wxOutputStream& s, - wxEOL mode = wxEOL_NATIVE, - const wxMBConv& conv = wxConvAuto()); -#else - wxTextOutputStream(wxOutputStream& s, wxEOL mode = wxEOL_NATIVE); -#endif - virtual ~wxTextOutputStream(); - - void SetMode( wxEOL mode = wxEOL_NATIVE ); - wxEOL GetMode() { return m_mode; } - - void Write32(wxUint32 i); - void Write16(wxUint16 i); - void Write8(wxUint8 i); - virtual void WriteDouble(double d); - virtual void WriteString(const wxString& string); - - wxTextOutputStream& PutChar(wxChar c); - - wxTextOutputStream& operator<<(const wxChar *string); - wxTextOutputStream& operator<<(const wxString& string); - wxTextOutputStream& operator<<(char c); -#if wxUSE_UNICODE && wxWCHAR_T_IS_REAL_TYPE - wxTextOutputStream& operator<<(wchar_t wc); -#endif // wxUSE_UNICODE - wxTextOutputStream& operator<<(wxInt16 c); - wxTextOutputStream& operator<<(wxInt32 c); - wxTextOutputStream& operator<<(wxUint16 c); - wxTextOutputStream& operator<<(wxUint32 c); - wxTextOutputStream& operator<<(double f); - wxTextOutputStream& operator<<(float f); - - wxTextOutputStream& operator<<( __wxTextOutputManip func) { return func(*this); } - -protected: - wxOutputStream &m_output; - wxEOL m_mode; - -#if wxUSE_UNICODE - wxMBConv *m_conv; -#endif - - DECLARE_NO_COPY_CLASS(wxTextOutputStream) -}; - -#endif - // wxUSE_STREAMS - -#endif - // _WX_DATSTREAM_H_ diff --git a/wxWidgets/include/wx/types.h b/wxWidgets/include/wx/types.h deleted file mode 100644 index d9eafa268f..0000000000 --- a/wxWidgets/include/wx/types.h +++ /dev/null @@ -1,93 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: types.h -// Purpose: Type identifiers, used by resource system -// Author: Julian Smart -// Modified by: -// Created: 01/02/97 -// RCS-ID: $Id: types.h 35650 2005-09-23 12:56:45Z MR $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_TYPESH__ -#define _WX_TYPESH__ - -// Types of objects -#define wxTYPE_ANY 0 -#define wxTYPE_OBJECT wxTYPE_ANY -#define wxTYPE_WINDOW 1 -#define wxTYPE_DIALOG_BOX 2 -#define wxTYPE_ITEM 3 -#define wxTYPE_PANEL 4 -#define wxTYPE_CANVAS 5 -#define wxTYPE_TEXT_WINDOW 6 -#define wxTYPE_FRAME 7 - -#define wxTYPE_BUTTON 8 -#define wxTYPE_TEXT 9 -#define wxTYPE_MESSAGE 10 -#define wxTYPE_CHOICE 11 -#define wxTYPE_LIST_BOX 12 -#define wxTYPE_SLIDER 13 -#define wxTYPE_CHECK_BOX 14 -#define wxTYPE_MENU 15 -#define wxTYPE_MENU_BAR 16 -#define wxTYPE_MULTI_TEXT 17 -#define wxTYPE_RADIO_BOX 18 -#define wxTYPE_GROUP_BOX 19 -#define wxTYPE_GAUGE 20 -#define wxTYPE_SCROLL_BAR 21 -#define wxTYPE_VIRT_LIST_BOX 22 -#define wxTYPE_COMBO_BOX 23 -#define wxTYPE_RADIO_BUTTON 24 - -#define wxTYPE_EVENT 25 -#define wxTYPE_DC 26 -#define wxTYPE_DC_CANVAS 27 -#define wxTYPE_DC_POSTSCRIPT 28 -#define wxTYPE_DC_PRINTER 29 -#define wxTYPE_DC_METAFILE 30 -#define wxTYPE_DC_MEMORY 31 -#define wxTYPE_MOUSE_EVENT 32 -#define wxTYPE_KEY_EVENT 33 -#define wxTYPE_COMMAND_EVENT 34 -#define wxTYPE_DC_PANEL 35 - -#define wxTYPE_PEN 40 -#define wxTYPE_BRUSH 41 -#define wxTYPE_FONT 42 -#define wxTYPE_ICON 42 -#define wxTYPE_BITMAP 43 -#define wxTYPE_METAFILE 44 -#define wxTYPE_TIMER 45 -#define wxTYPE_COLOUR 46 -#define wxTYPE_COLOURMAP 47 -#define wxTYPE_CURSOR 48 - -#define wxTYPE_DDE_CLIENT 60 -#define wxTYPE_DDE_SERVER 61 -#define wxTYPE_DDE_CONNECTION 62 - -#define wxTYPE_HELP_INSTANCE 63 - -#define wxTYPE_LIST 70 -#define wxTYPE_STRING_LIST 71 -#define wxTYPE_HASH_TABLE 72 -#define wxTYPE_NODE 73 -#define wxTYPE_APP 74 -#define wxTYPE_DATE 75 - -#define wxTYPE_ENHANCED_DIALOG 80 -#define wxTYPE_TOOLBAR 81 -#define wxTYPE_BUTTONBAR 82 - -#define wxTYPE_DATABASE 90 -#define wxTYPE_QUERY_FIELD 91 -#define wxTYPE_QUERY_COL 92 -#define wxTYPE_RECORDSET 93 - -#define wxTYPE_USER 500 - -#endif - // _WX_TYPESH__ - diff --git a/wxWidgets/include/wx/univ/app.h b/wxWidgets/include/wx/univ/app.h deleted file mode 100644 index 26f14538e3..0000000000 --- a/wxWidgets/include/wx/univ/app.h +++ /dev/null @@ -1,21 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: wx/univ/app.h -// Purpose: wxUniversalApp class extends wxApp for wxUniv port -// Author: Vadim Zeitlin -// Modified by: -// Created: 06.08.00 -// RCS-ID: $Id: app.h 27408 2004-05-23 20:53:33Z JS $ -// Copyright: (c) 2000 SciTech Software, Inc. (www.scitechsoft.com) -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_UNIX_APP_H_ -#define _WX_UNIX_APP_H_ - -class WXDLLEXPORT wxUniversalApp : public wxApp -{ -public: -}; - -#endif // _WX_UNIX_APP_H_ - diff --git a/wxWidgets/include/wx/univ/bmpbuttn.h b/wxWidgets/include/wx/univ/bmpbuttn.h deleted file mode 100644 index 9c380e60ac..0000000000 --- a/wxWidgets/include/wx/univ/bmpbuttn.h +++ /dev/null @@ -1,72 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/univ/bmpbuttn.h -// Purpose: wxBitmapButton class for wxUniversal -// Author: Vadim Zeitlin -// Modified by: -// Created: 25.08.00 -// RCS-ID: $Id: bmpbuttn.h 35650 2005-09-23 12:56:45Z MR $ -// Copyright: (c) Vadim Zeitlin -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_UNIV_BMPBUTTN_H_ -#define _WX_UNIV_BMPBUTTN_H_ - -class WXDLLEXPORT wxBitmapButton : public wxBitmapButtonBase -{ -public: - wxBitmapButton() { } - - wxBitmapButton(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 = 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 = 0, - const wxValidator& validator = wxDefaultValidator, - const wxString& name = wxButtonNameStr); - - virtual void SetMargins(int x, int y) - { - SetImageMargins(x, y); - - wxBitmapButtonBase::SetMargins(x, y); - } - - virtual bool Enable(bool enable = true); - - virtual bool SetCurrent(bool doit = true); - - virtual void Press(); - virtual void Release(); - -protected: - void OnSetFocus(wxFocusEvent& event); - void OnKillFocus(wxFocusEvent& event); - - // called when one of the bitmap is changed by user - virtual void OnSetBitmap(); - - // set bitmap to the given one if it's ok or to m_bmpNormal and return - // true if the bitmap really changed - bool ChangeBitmap(const wxBitmap& bmp); - -private: - DECLARE_EVENT_TABLE() - DECLARE_DYNAMIC_CLASS(wxBitmapButton) -}; - -#endif // _WX_UNIV_BMPBUTTN_H_ - diff --git a/wxWidgets/include/wx/univ/button.h b/wxWidgets/include/wx/univ/button.h deleted file mode 100644 index 62cb45a5aa..0000000000 --- a/wxWidgets/include/wx/univ/button.h +++ /dev/null @@ -1,139 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: wx/univ/button.h -// Purpose: wxButton for wxUniversal -// Author: Vadim Zeitlin -// Modified by: -// Created: 15.08.00 -// RCS-ID: $Id: button.h 61872 2009-09-09 22:37:05Z VZ $ -// Copyright: (c) 2000 SciTech Software, Inc. (www.scitechsoft.com) -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_UNIV_BUTTON_H_ -#define _WX_UNIV_BUTTON_H_ - -class WXDLLEXPORT wxInputHandler; - -#include "wx/bitmap.h" - -// ---------------------------------------------------------------------------- -// the actions supported by this control -// ---------------------------------------------------------------------------- - -#define wxACTION_BUTTON_TOGGLE wxT("toggle") // press/release the button -#define wxACTION_BUTTON_PRESS wxT("press") // press the button -#define wxACTION_BUTTON_RELEASE wxT("release") // release the button -#define wxACTION_BUTTON_CLICK wxT("click") // generate button click event - -// ---------------------------------------------------------------------------- -// wxButton: a push button -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxButton : public wxButtonBase -{ -public: - wxButton() { Init(); } - wxButton(wxWindow *parent, - wxWindowID id, - const wxBitmap& bitmap, - const wxString& label = wxEmptyString, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = 0, - const wxValidator& validator = wxDefaultValidator, - const wxString& name = wxButtonNameStr) - { - Init(); - - Create(parent, id, bitmap, label, pos, size, style, validator, name); - } - - wxButton(wxWindow *parent, - wxWindowID id, - const wxString& label = wxEmptyString, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = 0, - const wxValidator& validator = wxDefaultValidator, - const wxString& name = wxButtonNameStr) - { - Init(); - - Create(parent, id, label, pos, size, style, validator, name); - } - - bool Create(wxWindow *parent, - wxWindowID id, - const wxString& label = wxEmptyString, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = 0, - const wxValidator& validator = wxDefaultValidator, - const wxString& name = wxButtonNameStr) - { - return Create(parent, id, wxNullBitmap, label, - pos, size, style, validator, name); - } - - bool Create(wxWindow *parent, - wxWindowID id, - const wxBitmap& bitmap, - const wxString& label = wxEmptyString, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = 0, - const wxValidator& validator = wxDefaultValidator, - const wxString& name = wxButtonNameStr); - - virtual ~wxButton(); - - virtual void SetImageLabel(const wxBitmap& bitmap); - virtual void SetImageMargins(wxCoord x, wxCoord y); - virtual void SetDefault(); - - virtual bool IsPressed() const { return m_isPressed; } - virtual bool IsDefault() const { return m_isDefault; } - - // wxButton actions - virtual void Toggle(); - virtual void Press(); - virtual void Release(); - virtual void Click(); - - virtual bool PerformAction(const wxControlAction& action, - long numArg = -1, - const wxString& strArg = wxEmptyString); - - virtual bool CanBeHighlighted() const { return true; } - - static wxInputHandler *GetStdInputHandler(wxInputHandler *handlerDef); - virtual wxInputHandler *DoGetStdInputHandler(wxInputHandler *handlerDef) - { - return GetStdInputHandler(handlerDef); - } - - -protected: - virtual wxSize DoGetBestClientSize() const; - - virtual bool DoDrawBackground(wxDC& dc); - virtual void DoDraw(wxControlRenderer *renderer); - - // common part of all ctors - void Init(); - - // current state - bool m_isPressed, - m_isDefault; - - // the (optional) image to show and the margins around it - wxBitmap m_bitmap; - wxCoord m_marginBmpX, - m_marginBmpY; - -private: - DECLARE_DYNAMIC_CLASS(wxButton) -}; - -#endif // _WX_UNIV_BUTTON_H_ - diff --git a/wxWidgets/include/wx/univ/checkbox.h b/wxWidgets/include/wx/univ/checkbox.h deleted file mode 100644 index 52e53ebd52..0000000000 --- a/wxWidgets/include/wx/univ/checkbox.h +++ /dev/null @@ -1,150 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: wx/univ/checkbox.h -// Purpose: wxCheckBox declaration -// Author: Vadim Zeitlin -// Modified by: -// Created: 07.09.00 -// RCS-ID: $Id: checkbox.h 61872 2009-09-09 22:37:05Z VZ $ -// Copyright: (c) 2000 SciTech Software, Inc. (www.scitechsoft.com) -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_UNIV_CHECKBOX_H_ -#define _WX_UNIV_CHECKBOX_H_ - -#include "wx/button.h" // for wxStdButtonInputHandler - -// ---------------------------------------------------------------------------- -// the actions supported by wxCheckBox -// ---------------------------------------------------------------------------- - -#define wxACTION_CHECKBOX_CHECK wxT("check") // SetValue(true) -#define wxACTION_CHECKBOX_CLEAR wxT("clear") // SetValue(false) -#define wxACTION_CHECKBOX_TOGGLE wxT("toggle") // toggle the check state - -// additionally it accepts wxACTION_BUTTON_PRESS and RELEASE - -// ---------------------------------------------------------------------------- -// wxCheckBox -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxCheckBox : public wxCheckBoxBase -{ -public: - // checkbox constants - enum State - { - State_Normal, - State_Pressed, - State_Disabled, - State_Current, - State_Max - }; - - enum Status - { - Status_Checked, - Status_Unchecked, - Status_3rdState, - Status_Max - }; - - // constructors - wxCheckBox() { Init(); } - - 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) - { - Init(); - - 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); - - // implement the checkbox interface - virtual void SetValue(bool value); - virtual bool GetValue() const; - - // set/get the bitmaps to use for the checkbox indicator - void SetBitmap(const wxBitmap& bmp, State state, Status status); - virtual wxBitmap GetBitmap(State state, Status status) const; - - // wxCheckBox actions - void Toggle(); - virtual void Press(); - virtual void Release(); - virtual void ChangeValue(bool value); - - // overridden base class virtuals - virtual bool IsPressed() const { return m_isPressed; } - - virtual bool PerformAction(const wxControlAction& action, - long numArg = -1, - const wxString& strArg = wxEmptyString); - - virtual bool CanBeHighlighted() const { return true; } - virtual wxInputHandler *CreateStdInputHandler(wxInputHandler *handlerDef); - virtual wxInputHandler *DoGetStdInputHandler(wxInputHandler *handlerDef) - { - return CreateStdInputHandler(handlerDef); - } - -protected: - virtual void DoSet3StateValue(wxCheckBoxState WXUNUSED(state)); - virtual wxCheckBoxState DoGet3StateValue() const; - - virtual void DoDraw(wxControlRenderer *renderer); - virtual wxSize DoGetBestClientSize() const; - - // get the size of the bitmap using either the current one or the default - // one (query renderer then) - virtual wxSize GetBitmapSize() const; - - // common part of all ctors - void Init(); - - // send command event notifying about the checkbox state change - virtual void SendEvent(); - - // called when the checkbox becomes checked - radio button hook - virtual void OnCheck(); - - // get the state corresponding to the flags (combination of wxCONTROL_XXX) - wxCheckBox::State GetState(int flags) const; - - // directly access the bitmaps array without trying to find a valid bitmap - // to use as GetBitmap() does - wxBitmap DoGetBitmap(State state, Status status) const - { return m_bitmaps[state][status]; } - - // get the current status - Status GetStatus() const { return m_status; } - -private: - // the current check status - Status m_status; - - // the bitmaps to use for the different states - wxBitmap m_bitmaps[State_Max][Status_Max]; - - // is the checkbox currently pressed? - bool m_isPressed; - - DECLARE_DYNAMIC_CLASS(wxCheckBox) -}; - -#endif // _WX_UNIV_CHECKBOX_H_ diff --git a/wxWidgets/include/wx/univ/checklst.h b/wxWidgets/include/wx/univ/checklst.h deleted file mode 100644 index a7842e37ec..0000000000 --- a/wxWidgets/include/wx/univ/checklst.h +++ /dev/null @@ -1,114 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: wx/univ/checklst.h -// Purpose: wxCheckListBox class for wxUniversal -// Author: Vadim Zeitlin -// Modified by: -// Created: 12.09.00 -// RCS-ID: $Id: checklst.h 61872 2009-09-09 22:37:05Z VZ $ -// Copyright: (c) Vadim Zeitlin -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_UNIV_CHECKLST_H_ -#define _WX_UNIV_CHECKLST_H_ - -// ---------------------------------------------------------------------------- -// actions -// ---------------------------------------------------------------------------- - -#define wxACTION_CHECKLISTBOX_TOGGLE wxT("toggle") - -// ---------------------------------------------------------------------------- -// wxCheckListBox -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxCheckListBox : public wxCheckListBoxBase -{ -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); - - bool Create(wxWindow *parent, - wxWindowID id, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - int nStrings = 0, - const wxString choices[] = (const wxString *) 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); - - // implement check list box methods - virtual bool IsChecked(unsigned int item) const; - virtual void Check(unsigned int item, bool check = true); - - // and input handling - virtual bool PerformAction(const wxControlAction& action, - long numArg = -1l, - const wxString& strArg = wxEmptyString); - - static wxInputHandler *GetStdInputHandler(wxInputHandler *handlerDef); - virtual wxInputHandler *DoGetStdInputHandler(wxInputHandler *handlerDef) - { - return GetStdInputHandler(handlerDef); - } - - // override all methods which add/delete items to update m_checks array as - // well - virtual void Delete(unsigned int n); - -protected: - virtual int DoAppend(const wxString& item); - virtual void DoInsertItems(const wxArrayString& items, unsigned int pos); - virtual void DoSetItems(const wxArrayString& items, void **clientData); - virtual void DoClear(); - - // draw the check items instead of the usual ones - virtual void DoDrawRange(wxControlRenderer *renderer, - int itemFirst, int itemLast); - - // take them also into account for size calculation - virtual wxSize DoGetBestClientSize() const; - - // common part of all ctors - void Init(); - -private: - // the array containing the checked status of the items - wxArrayInt m_checks; - - DECLARE_DYNAMIC_CLASS(wxCheckListBox) -}; - -#endif // _WX_UNIV_CHECKLST_H_ diff --git a/wxWidgets/include/wx/univ/chkconf.h b/wxWidgets/include/wx/univ/chkconf.h deleted file mode 100644 index e88a2cf3ef..0000000000 --- a/wxWidgets/include/wx/univ/chkconf.h +++ /dev/null @@ -1,117 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: wx/univ/chkconf.h -// Purpose: wxUniversal-specific configuration options checks -// Author: Vadim Zeitlin -// Created: 2006-09-28 (extracted from wx/chkconf.h) -// RCS-ID: $Id: chkconf.h 41494 2006-09-28 22:55:28Z VZ $ -// Copyright: (c) 2006 Vadim Zeitlin <vadim@wxwindows.org> -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_UNIV_CHKCONF_H_ -#define _WX_UNIV_CHKCONF_H_ - -#if (wxUSE_COMBOBOX || wxUSE_MENUS) && !wxUSE_POPUPWIN -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxUSE_POPUPWIN must be defined to use comboboxes/menus" -# else -# undef wxUSE_POPUPWIN -# define wxUSE_POPUPWIN 1 -# endif -#endif - -#if wxUSE_COMBOBOX -# if !wxUSE_LISTBOX -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxComboBox requires wxListBox in wxUniversal" -# else -# undef wxUSE_LISTBOX -# define wxUSE_LISTBOX 1 -# endif -# endif -#endif /* wxUSE_COMBOBOX */ - -#if wxUSE_RADIOBTN -# if !wxUSE_CHECKBOX -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxUSE_RADIOBTN requires wxUSE_CHECKBOX in wxUniversal" -# else -# undef wxUSE_CHECKBOX -# define wxUSE_CHECKBOX 1 -# endif -# endif -#endif /* wxUSE_RADIOBTN */ - -#if wxUSE_TEXTCTRL -# if !wxUSE_CARET -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxTextCtrl requires wxCaret in wxUniversal" -# else -# undef wxUSE_CARET -# define wxUSE_CARET 1 -# endif -# endif /* wxUSE_CARET */ - -# if !wxUSE_SCROLLBAR -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxTextCtrl requires wxScrollBar in wxUniversal" -# else -# undef wxUSE_SCROLLBAR -# define wxUSE_SCROLLBAR 1 -# endif -# endif /* wxUSE_SCROLLBAR */ -#endif /* wxUSE_TEXTCTRL */ - - -/* Themes checks */ -#ifndef wxUSE_ALL_THEMES -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxUSE_ALL_THEMES must be defined" -# else -# define wxUSE_ALL_THEMES 1 -# endif -#endif /* wxUSE_ALL_THEMES */ - -#ifndef wxUSE_THEME_GTK -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxUSE_THEME_GTK must be defined" -# else -# define wxUSE_THEME_GTK 1 -# endif -#endif /* wxUSE_THEME_GTK */ - -#ifndef wxUSE_THEME_METAL -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxUSE_THEME_METAL must be defined" -# else -# define wxUSE_THEME_METAL 1 -# endif -#endif /* wxUSE_THEME_METAL */ - -#ifndef wxUSE_THEME_MONO -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxUSE_THEME_MONO must be defined" -# else -# define wxUSE_THEME_MONO 1 -# endif -#endif /* wxUSE_THEME_MONO */ - -#ifndef wxUSE_THEME_WIN32 -# ifdef wxABORT_ON_CONFIG_ERROR -# error "wxUSE_THEME_WIN32 must be defined" -# else -# define wxUSE_THEME_WIN32 1 -# endif -#endif /* wxUSE_THEME_WIN32 */ - -#if !wxUSE_ALL_THEMES && wxUSE_THEME_METAL && !wxUSE_THEME_WIN32 -# ifdef wxABORT_ON_CONFIG_ERROR -# error "Metal theme requires Win32 one" -# else -# undef wxUSE_THEME_WIN32 -# define wxUSE_THEME_WIN32 1 -# endif -#endif /* wxUSE_THEME_METAL && !wxUSE_THEME_WIN32 */ - -#endif /* _WX_UNIV_CHKCONF_H_ */ - diff --git a/wxWidgets/include/wx/univ/choice.h b/wxWidgets/include/wx/univ/choice.h deleted file mode 100644 index 5c254b6bab..0000000000 --- a/wxWidgets/include/wx/univ/choice.h +++ /dev/null @@ -1,64 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: wx/univ/choice.h -// Purpose: the universal choice -// Author: Vadim Zeitlin -// Modified by: -// Created: 30.08.00 -// RCS-ID: $Id: choice.h 35650 2005-09-23 12:56:45Z MR $ -// Copyright: (c) 2000 SciTech Software, Inc. (www.scitechsoft.com) -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_UNIV_CHOICE_H_ -#define _WX_UNIV_CHOICE_H_ - -#include "wx/combobox.h" - -// VS: This is only a *temporary* implementation, real wxChoice should not -// derive from wxComboBox and may have different l&f -class WXDLLEXPORT wxChoice : public wxComboBox -{ -public: - wxChoice() {} - wxChoice(wxWindow *parent, wxWindowID id, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - int n = 0, const wxString choices[] = (const wxString *) 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); - - bool Create(wxWindow *parent, wxWindowID id, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - int n = 0, const wxString choices[] = (wxString *) 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); - -private: - void OnComboBox(wxCommandEvent &event); - - DECLARE_EVENT_TABLE() - DECLARE_DYNAMIC_CLASS(wxChoice) -}; - - -#endif // _WX_UNIV_CHOICE_H_ diff --git a/wxWidgets/include/wx/univ/colschem.h b/wxWidgets/include/wx/univ/colschem.h deleted file mode 100644 index eb92d21773..0000000000 --- a/wxWidgets/include/wx/univ/colschem.h +++ /dev/null @@ -1,103 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: wx/univ/colschem.h -// Purpose: wxColourScheme class provides the colours to use for drawing -// Author: Vadim Zeitlin -// Modified by: -// Created: 19.08.00 -// RCS-ID: $Id: colschem.h 44058 2006-12-24 19:06:39Z VS $ -// Copyright: (c) 2000 SciTech Software, Inc. (www.scitechsoft.com) -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_UNIV_COLSCHEM_H_ -#define _WX_UNIV_COLSCHEM_H_ - -class WXDLLEXPORT wxWindow; - -#include "wx/colour.h" -#include "wx/checkbox.h" - -// ---------------------------------------------------------------------------- -// wxColourScheme -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxColourScheme -{ -public: - // the standard colours - enum StdColour - { - // the background colour for a window - WINDOW, - - // the different background and text colours for the control - CONTROL, - CONTROL_PRESSED, - CONTROL_CURRENT, - - // the label text for the normal and the disabled state - CONTROL_TEXT, - CONTROL_TEXT_DISABLED, - CONTROL_TEXT_DISABLED_SHADOW, - - // the scrollbar background colour for the normal and pressed states - SCROLLBAR, - SCROLLBAR_PRESSED, - - // the background and text colour for the highlighted item - HIGHLIGHT, - HIGHLIGHT_TEXT, - - // these colours are used for drawing the shadows of 3D objects - SHADOW_DARK, - SHADOW_HIGHLIGHT, - SHADOW_IN, - SHADOW_OUT, - - // the titlebar background colours for the normal and focused states - TITLEBAR, - TITLEBAR_ACTIVE, - - // the titlebar text colours - TITLEBAR_TEXT, - TITLEBAR_ACTIVE_TEXT, - - // the default gauge fill colour - GAUGE, - - // desktop background colour (only used by framebuffer ports) - DESKTOP, - - // wxFrame's background colour - FRAME, - - MAX - }; - - // get a standard colour - virtual wxColour Get(StdColour col) const = 0; - - // get the background colour for the given window - virtual wxColour GetBackground(wxWindow *win) const = 0; - - // virtual dtor for any base class - virtual ~wxColourScheme(); -}; - -// some people just can't spell it correctly :-) -typedef wxColourScheme wxColorScheme; - -// ---------------------------------------------------------------------------- -// macros -// ---------------------------------------------------------------------------- - -// retrieve the default colour from the theme or the given scheme -#define wxSCHEME_COLOUR(scheme, what) scheme->Get(wxColorScheme::what) -#define wxTHEME_COLOUR(what) \ - wxSCHEME_COLOUR(wxTheme::Get()->GetColourScheme(), what) - -// get the background colour for the window in the current theme -#define wxTHEME_BG_COLOUR(win) \ - wxTheme::Get()->GetColourScheme()->GetBackground(win) - -#endif // _WX_UNIV_COLSCHEM_H_ diff --git a/wxWidgets/include/wx/univ/combobox.h b/wxWidgets/include/wx/univ/combobox.h deleted file mode 100644 index 381836df4d..0000000000 --- a/wxWidgets/include/wx/univ/combobox.h +++ /dev/null @@ -1,167 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: wx/univ/combobox.h -// Purpose: the universal combobox -// Author: Vadim Zeitlin -// Modified by: -// Created: 30.08.00 -// RCS-ID: $Id: combobox.h 61872 2009-09-09 22:37:05Z VZ $ -// Copyright: (c) 2000 SciTech Software, Inc. (www.scitechsoft.com) -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - - -#ifndef _WX_UNIV_COMBOBOX_H_ -#define _WX_UNIV_COMBOBOX_H_ - -#include "wx/combo.h" - -class WXDLLEXPORT wxListBox; - -// ---------------------------------------------------------------------------- -// NB: some actions supported by this control are in wx/generic/combo.h -// ---------------------------------------------------------------------------- - -// choose the next/prev/specified (by numArg) item -#define wxACTION_COMBOBOX_SELECT_NEXT wxT("next") -#define wxACTION_COMBOBOX_SELECT_PREV wxT("prev") -#define wxACTION_COMBOBOX_SELECT wxT("select") - - -// ---------------------------------------------------------------------------- -// wxComboBox: a combination of text control and a listbox -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxComboBox : public wxComboCtrl, public wxComboBoxBase -{ -public: - // ctors and such - wxComboBox() { Init(); } - - wxComboBox(wxWindow *parent, - wxWindowID id, - const wxString& value = wxEmptyString, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - int n = 0, - const wxString choices[] = (const wxString *) NULL, - long style = 0, - const wxValidator& validator = wxDefaultValidator, - const wxString& name = wxComboBoxNameStr) - { - Init(); - - (void)Create(parent, id, value, pos, size, n, choices, - style, validator, name); - } - 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); - - bool Create(wxWindow *parent, - wxWindowID id, - const wxString& value = wxEmptyString, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - int n = 0, - const wxString choices[] = (const wxString *) 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); - - virtual ~wxComboBox(); - - // the wxUniversal-specific methods - // -------------------------------- - - // implement the combobox interface - - // wxTextCtrl methods - virtual wxString GetValue() const; - virtual void SetValue(const wxString& value); - virtual void Copy(); - virtual void Cut(); - virtual void Paste(); - virtual void SetInsertionPoint(long pos); - virtual void SetInsertionPointEnd(); - virtual long GetInsertionPoint() const; - virtual wxTextPos 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 bool IsEditable() const; - - virtual void Undo(); - virtual void Redo(); - virtual void SelectAll(); - - virtual bool CanCopy() const; - virtual bool CanCut() const; - virtual bool CanPaste() const; - virtual bool CanUndo() const; - virtual bool CanRedo() const; - - // wxControlWithItems methods - virtual void Clear(); - virtual void Delete(unsigned int n); - virtual unsigned int GetCount() const; - virtual wxString GetString(unsigned int n) const; - virtual void SetString(unsigned int n, const wxString& s); - virtual int FindString(const wxString& s, bool bCase = false) const; - virtual void SetSelection(int n); - virtual int GetSelection() const; - - wxCONTROL_ITEMCONTAINER_CLIENTDATAOBJECT_RECAST - - // we have our own input handler and our own actions - // (but wxComboCtrl already handled Popup/Dismiss) - /* - virtual bool PerformAction(const wxControlAction& action, - long numArg = 0l, - const wxString& strArg = wxEmptyString); - */ - - static wxInputHandler *GetStdInputHandler(wxInputHandler *handlerDef); - virtual wxInputHandler *DoGetStdInputHandler(wxInputHandler *handlerDef) - { - return GetStdInputHandler(handlerDef); - } - -protected: - virtual int DoAppend(const wxString& item); - virtual int DoInsert(const wxString& item, unsigned int pos); - virtual void DoSetItemClientData(unsigned int n, void* clientData); - virtual void* DoGetItemClientData(unsigned int n) const; - virtual void DoSetItemClientObject(unsigned int n, wxClientData* clientData); - virtual wxClientData* DoGetItemClientObject(unsigned int n) const; - - // common part of all ctors - void Init(); - - // get the associated listbox - wxListBox *GetLBox() const { return m_lbox; } - -private: - // the popup listbox - wxListBox *m_lbox; - - //DECLARE_EVENT_TABLE() - DECLARE_DYNAMIC_CLASS(wxComboBox) -}; - -#endif // _WX_UNIV_COMBOBOX_H_ diff --git a/wxWidgets/include/wx/univ/control.h b/wxWidgets/include/wx/univ/control.h deleted file mode 100644 index 4bbc2b1d8a..0000000000 --- a/wxWidgets/include/wx/univ/control.h +++ /dev/null @@ -1,102 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/univ/control.h -// Purpose: universal wxControl: adds handling of mnemonics -// Author: Vadim Zeitlin -// Modified by: -// Created: 14.08.00 -// RCS-ID: $Id: control.h 61872 2009-09-09 22:37:05Z VZ $ -// Copyright: (c) 2000 SciTech Software, Inc. (www.scitechsoft.com) -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_UNIV_CONTROL_H_ -#define _WX_UNIV_CONTROL_H_ - -class WXDLLEXPORT wxControlRenderer; -class WXDLLEXPORT wxInputHandler; -class WXDLLEXPORT wxRenderer; - -// we must include it as most/all control classes derive their handlers from -// it -#include "wx/univ/inphand.h" - -#include "wx/univ/inpcons.h" - -// ---------------------------------------------------------------------------- -// wxControlAction: the action is currently just a string which identifies it, -// later it might become an atom (i.e. an opaque handler to string). -// ---------------------------------------------------------------------------- - -typedef wxString wxControlAction; - -// the list of actions which apply to all controls (other actions are defined -// in the controls headers) - -#define wxACTION_NONE wxT("") // no action to perform - -// ---------------------------------------------------------------------------- -// wxControl: the base class for all GUI controls -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxControl : public wxControlBase, public wxInputConsumer -{ -public: - wxControl() { Init(); } - - wxControl(wxWindow *parent, - wxWindowID id, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, long style = 0, - const wxValidator& validator = wxDefaultValidator, - const wxString& name = wxControlNameStr) - { - Init(); - - 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); - - // this function will filter out '&' characters and will put the - // accelerator char (the one immediately after '&') into m_chAccel - virtual void SetLabel(const wxString &label); - virtual wxString GetLabel() const; - - // wxUniversal-specific methods - - // return the accel index in the string or -1 if none and puts the modified - // string intosecond parameter if non NULL - static int FindAccelIndex(const wxString& label, - wxString *labelOnly = NULL); - - // return the index of the accel char in the label or -1 if none - int GetAccelIndex() const { return m_indexAccel; } - - // return the accel char itself or 0 if none - wxChar GetAccelChar() const - { - return m_indexAccel == -1 ? wxT('\0') : m_label[m_indexAccel]; - } - - virtual wxWindow *GetInputWindow() const { return (wxWindow*)this; } - -protected: - // common part of all ctors - void Init(); - -private: - // label and accel info - wxString m_label; - int m_indexAccel; - - DECLARE_DYNAMIC_CLASS(wxControl) - DECLARE_EVENT_TABLE() - WX_DECLARE_INPUT_CONSUMER() -}; - -#endif // _WX_UNIV_CONTROL_H_ diff --git a/wxWidgets/include/wx/univ/dialog.h b/wxWidgets/include/wx/univ/dialog.h deleted file mode 100644 index 9fbf2a7ecb..0000000000 --- a/wxWidgets/include/wx/univ/dialog.h +++ /dev/null @@ -1,88 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: dialog.h -// Purpose: wxDialog class -// Author: Vaclav Slavik -// Created: 2001/09/16 -// RCS-ID: $Id: dialog.h 36891 2006-01-16 14:59:55Z MR $ -// Copyright: (c) 2001 SciTech Software, Inc. (www.scitechsoft.com) -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_UNIV_DIALOG_H_ -#define _WX_UNIV_DIALOG_H_ - -extern WXDLLEXPORT_DATA(const wxChar) wxDialogNameStr[]; -class WXDLLEXPORT wxWindowDisabler; -class WXDLLEXPORT wxEventLoop; - -// Dialog boxes -class WXDLLEXPORT wxDialog : public wxDialogBase -{ -public: - wxDialog() { Init(); } - - // 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) - { - 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_DIALOG_STYLE, - const wxString& name = wxDialogNameStr); - - virtual ~wxDialog(); - - // is the dialog in modal state right now? - 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; - - virtual bool Show(bool show = true); - - // implementation only from now on - // ------------------------------- - - // event handlers - void OnCloseWindow(wxCloseEvent& event); - void OnOK(wxCommandEvent& event); - void OnApply(wxCommandEvent& event); - void OnCancel(wxCommandEvent& event); - -protected: - // common part of all ctors - void Init(); - -private: - // while we are showing a modal dialog we disable the other windows using - // this object - wxWindowDisabler *m_windowDisabler; - - // modal dialog runs its own event loop - wxEventLoop *m_eventLoop; - - // is modal right now? - bool m_isShowingModal; - - DECLARE_DYNAMIC_CLASS(wxDialog) - DECLARE_EVENT_TABLE() -}; - -#endif - // _WX_UNIV_DIALOG_H_ diff --git a/wxWidgets/include/wx/univ/frame.h b/wxWidgets/include/wx/univ/frame.h deleted file mode 100644 index 463930f962..0000000000 --- a/wxWidgets/include/wx/univ/frame.h +++ /dev/null @@ -1,92 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: wx/univ/frame.h -// Purpose: wxFrame class for wxUniversal -// Author: Vadim Zeitlin -// Modified by: -// Created: 19.05.01 -// RCS-ID: $Id: frame.h 42664 2006-10-29 20:39:31Z VZ $ -// Copyright: (c) 2001 SciTech Software, Inc. (www.scitechsoft.com) -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_UNIV_FRAME_H_ -#define _WX_UNIV_FRAME_H_ - -// ---------------------------------------------------------------------------- -// wxFrame -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxFrame : public wxFrameBase -{ -public: - wxFrame() {} - 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) - { - 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 wxPoint GetClientAreaOrigin() const; - virtual bool Enable(bool enable = true); - -#if wxUSE_STATUSBAR - virtual wxStatusBar* CreateStatusBar(int number = 1, - long style = wxST_SIZEGRIP, - wxWindowID id = 0, - const wxString& name = wxStatusLineNameStr); -#endif // wxUSE_STATUSBAR - -#if wxUSE_TOOLBAR - // create main toolbar bycalling OnCreateToolBar() - virtual wxToolBar* CreateToolBar(long style = -1, - wxWindowID id = wxID_ANY, - const wxString& name = wxToolBarNameStr); -#endif // wxUSE_TOOLBAR - - virtual wxSize GetMinSize() const; - - // sends wxSizeEvent to itself (used after attaching xxxBar) - virtual void SendSizeEvent(); - -protected: - void OnSize(wxSizeEvent& event); - void OnSysColourChanged(wxSysColourChangedEvent& event); - - virtual void DoGetClientSize(int *width, int *height) const; - virtual void DoSetClientSize(int width, int height); - -#if wxUSE_MENUS - // override to update menu bar position when the frame size changes - virtual void PositionMenuBar(); - virtual void DetachMenuBar(); - virtual void AttachMenuBar(wxMenuBar *menubar); -#endif // wxUSE_MENUS - -#if wxUSE_STATUSBAR - // override to update statusbar position when the frame size changes - virtual void PositionStatusBar(); -#endif // wxUSE_MENUS - -protected: -#if wxUSE_TOOLBAR - virtual void PositionToolBar(); -#endif // wxUSE_TOOLBAR - - DECLARE_EVENT_TABLE() - DECLARE_DYNAMIC_CLASS(wxFrame) -}; - -#endif // _WX_UNIV_FRAME_H_ diff --git a/wxWidgets/include/wx/univ/gauge.h b/wxWidgets/include/wx/univ/gauge.h deleted file mode 100644 index f7444ef286..0000000000 --- a/wxWidgets/include/wx/univ/gauge.h +++ /dev/null @@ -1,75 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: wx/univ/gauge.h -// Purpose: wxUniversal wxGauge declaration -// Author: Vadim Zeitlin -// Modified by: -// Created: 20.02.01 -// RCS-ID: $Id: gauge.h 35698 2005-09-25 20:49:40Z MW $ -// Copyright: (c) 2001 SciTech Software, Inc. (www.scitechsoft.com) -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_UNIV_GAUGE_H_ -#define _WX_UNIV_GAUGE_H_ - -// ---------------------------------------------------------------------------- -// wxGauge: a progress bar -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxGauge : public wxGaugeBase -{ -public: - wxGauge() { Init(); } - - 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) - { - Init(); - - (void)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); - - // implement base class virtuals - virtual void SetRange(int range); - virtual void SetValue(int pos); - - // wxUniv-specific methods - - // is it a smooth progress bar or a discrete one? - bool IsSmooth() const { return (GetWindowStyle() & wxGA_SMOOTH) != 0; } - - // is it a vertica; progress bar or a horizontal one? - bool IsVertical() const { return (GetWindowStyle() & wxGA_VERTICAL) != 0; } - -protected: - // common part of all ctors - void Init(); - - // return the def border for a progress bar - virtual wxBorder GetDefaultBorder() const; - - // return the default size - virtual wxSize DoGetBestClientSize() const; - - // draw the control - virtual void DoDraw(wxControlRenderer *renderer); - - DECLARE_DYNAMIC_CLASS(wxGauge) -}; - -#endif // _WX_UNIV_GAUGE_H_ diff --git a/wxWidgets/include/wx/univ/inpcons.h b/wxWidgets/include/wx/univ/inpcons.h deleted file mode 100644 index 70126284df..0000000000 --- a/wxWidgets/include/wx/univ/inpcons.h +++ /dev/null @@ -1,153 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/univ/inpcons.h -// Purpose: wxInputConsumer: mix-in class for input handling -// Author: Vadim Zeitlin -// Modified by: -// Created: 14.08.00 -// RCS-ID: $Id: inpcons.h 61872 2009-09-09 22:37:05Z VZ $ -// Copyright: (c) 2000 SciTech Software, Inc. (www.scitechsoft.com) -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_UNIV_INPCONS_H_ -#define _WX_UNIV_INPCONS_H_ - -class WXDLLEXPORT wxInputHandler; -class WXDLLEXPORT wxWindow; - -#include "wx/object.h" -#include "wx/event.h" - -// ---------------------------------------------------------------------------- -// wxControlAction: the action is currently just a string which identifies it, -// later it might become an atom (i.e. an opaque handler to string). -// ---------------------------------------------------------------------------- - -typedef wxString wxControlAction; - -// the list of actions which apply to all controls (other actions are defined -// in the controls headers) - -#define wxACTION_NONE wxT("") // no action to perform - -// ---------------------------------------------------------------------------- -// wxInputConsumer: mix-in class for handling wxControlActions (used by -// wxControl and wxTopLevelWindow). -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxInputConsumer -{ -public: - wxInputConsumer() { m_inputHandler = NULL; } - virtual ~wxInputConsumer() { } - - // get the input handler - wxInputHandler *GetInputHandler() const { return m_inputHandler; } - - // perform a control-dependent action: an action may have an optional - // numeric and another (also optional) string argument whose interpretation - // depends on the action - // - // NB: we might use ellipsis in PerformAction() declaration but this - // wouldn't be more efficient than always passing 2 unused parameters - // but would be more difficult. Another solution would be to have - // several overloaded versions but this will expose the problem of - // virtual function hiding we don't have here. - virtual bool PerformAction(const wxControlAction& action, - long numArg = -1l, - const wxString& strArg = wxEmptyString); - - // get the window to work with (usually the class wxInputConsumer was mixed into) - virtual wxWindow *GetInputWindow() const = 0; - - // this function must be implemented in any classes process input (i.e. not - // static controls) to create the standard input handler for the concrete - // class deriving from this mix-in - // - // the parameter is the default input handler which should receive all - // unprocessed input (i.e. typically handlerDef is passed to - // wxStdInputHandler ctor) or it may be NULL - // - // the returned pointer will not be deleted by caller so it must either - // point to a static object or be deleted on program termination - virtual wxInputHandler *DoGetStdInputHandler(wxInputHandler *handlerDef); - - -protected: - // event handlers - void OnMouse(wxMouseEvent& event); - void OnKeyDown(wxKeyEvent& event); - void OnKeyUp(wxKeyEvent& event); - void OnFocus(wxFocusEvent& event); - void OnActivate(wxActivateEvent& event); - - // create input handler by name, fall back to GetStdInputHandler() if - // the current theme doesn't define any specific handler of this type - void CreateInputHandler(const wxString& inphandler); - -private: - // the input processor (we never delete it) - wxInputHandler *m_inputHandler; -}; - - -// ---------------------------------------------------------------------------- -// macros which must be used by the classes derived from wxInputConsumer mix-in -// ---------------------------------------------------------------------------- - -// declare the methods to be forwarded -#define WX_DECLARE_INPUT_CONSUMER() \ -private: \ - void OnMouse(wxMouseEvent& event); \ - void OnKeyDown(wxKeyEvent& event); \ - void OnKeyUp(wxKeyEvent& event); \ - void OnFocus(wxFocusEvent& event); \ -public: /* because of docview :-( */ \ - void OnActivate(wxActivateEvent& event); \ -private: - -// implement the event table entries for wxControlContainer -#define WX_EVENT_TABLE_INPUT_CONSUMER(classname) \ - EVT_KEY_DOWN(classname::OnKeyDown) \ - EVT_KEY_UP(classname::OnKeyUp) \ - EVT_MOUSE_EVENTS(classname::OnMouse) \ - EVT_SET_FOCUS(classname::OnFocus) \ - EVT_KILL_FOCUS(classname::OnFocus) \ - EVT_ACTIVATE(classname::OnActivate) - -// Forward event handlers to wxInputConsumer -// -// (We can't use them directly, because wxIC has virtual methods, which forces -// the compiler to include (at least) two vtables into wxControl, one for the -// wxWindow-wxControlBase-wxControl branch and one for the wxIC mix-in. -// Consequently, the "this" pointer has different value when in wxControl's -// and wxIC's method, even though the instance stays same. This doesn't matter -// so far as member pointers aren't used, but that's not wxControl's case. -// When we add an event table entry (= use a member pointer) pointing to -// wxIC's OnXXX method, GCC compiles code that executes wxIC::OnXXX with the -// version of "this" that belongs to wxControl, not wxIC! In our particular -// case, the effect is that m_handler is NULL (probably same memory -// area as the_other_vtable's_this->m_refObj) and input handling doesn't work.) -#define WX_FORWARD_TO_INPUT_CONSUMER(classname) \ - void classname::OnMouse(wxMouseEvent& event) \ - { \ - wxInputConsumer::OnMouse(event); \ - } \ - void classname::OnKeyDown(wxKeyEvent& event) \ - { \ - wxInputConsumer::OnKeyDown(event); \ - } \ - void classname::OnKeyUp(wxKeyEvent& event) \ - { \ - wxInputConsumer::OnKeyUp(event); \ - } \ - void classname::OnFocus(wxFocusEvent& event) \ - { \ - wxInputConsumer::OnFocus(event); \ - } \ - void classname::OnActivate(wxActivateEvent& event) \ - { \ - wxInputConsumer::OnActivate(event); \ - } - -#endif // _WX_UNIV_INPCONS_H_ diff --git a/wxWidgets/include/wx/univ/inphand.h b/wxWidgets/include/wx/univ/inphand.h deleted file mode 100644 index a83d102902..0000000000 --- a/wxWidgets/include/wx/univ/inphand.h +++ /dev/null @@ -1,116 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: wx/univ/inphand.h -// Purpose: wxInputHandler class maps the keyboard and mouse events to the -// actions which then are performed by the control -// Author: Vadim Zeitlin -// Modified by: -// Created: 18.08.00 -// RCS-ID: $Id: inphand.h 61872 2009-09-09 22:37:05Z VZ $ -// Copyright: (c) 2000 SciTech Software, Inc. (www.scitechsoft.com) -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_UNIV_INPHAND_H_ -#define _WX_UNIV_INPHAND_H_ - -#include "wx/univ/inpcons.h" // for wxControlAction(s) - -// ---------------------------------------------------------------------------- -// types of the standard input handlers which can be passed to -// wxTheme::GetInputHandler() -// ---------------------------------------------------------------------------- - -#define wxINP_HANDLER_DEFAULT wxT("") -#define wxINP_HANDLER_BUTTON wxT("button") -#define wxINP_HANDLER_CHECKBOX wxT("checkbox") -#define wxINP_HANDLER_CHECKLISTBOX wxT("checklistbox") -#define wxINP_HANDLER_COMBOBOX wxT("combobox") -#define wxINP_HANDLER_LISTBOX wxT("listbox") -#define wxINP_HANDLER_NOTEBOOK wxT("notebook") -#define wxINP_HANDLER_RADIOBTN wxT("radiobtn") -#define wxINP_HANDLER_SCROLLBAR wxT("scrollbar") -#define wxINP_HANDLER_SLIDER wxT("slider") -#define wxINP_HANDLER_SPINBTN wxT("spinbtn") -#define wxINP_HANDLER_STATUSBAR wxT("statusbar") -#define wxINP_HANDLER_TEXTCTRL wxT("textctrl") -#define wxINP_HANDLER_TOOLBAR wxT("toolbar") -#define wxINP_HANDLER_TOPLEVEL wxT("toplevel") - -// ---------------------------------------------------------------------------- -// wxInputHandler: maps the events to the actions -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxInputHandler : public wxObject -{ -public: - // map a keyboard event to one or more actions (pressed == true if the key - // was pressed, false if released), returns true if something was done - virtual bool HandleKey(wxInputConsumer *consumer, - const wxKeyEvent& event, - bool pressed) = 0; - - // map a mouse (click) event to one or more actions - virtual bool HandleMouse(wxInputConsumer *consumer, - const wxMouseEvent& event) = 0; - - // handle mouse movement (or enter/leave) event: it is separated from - // HandleMouse() for convenience as many controls don't care about mouse - // movements at all - virtual bool HandleMouseMove(wxInputConsumer *consumer, - const wxMouseEvent& event); - - // do something with focus set/kill event: this is different from - // HandleMouseMove() as the mouse maybe over the control without it having - // focus - // - // return true to refresh the control, false otherwise - virtual bool HandleFocus(wxInputConsumer *consumer, const wxFocusEvent& event); - - // react to the app getting/losing activation - // - // return true to refresh the control, false otherwise - virtual bool HandleActivation(wxInputConsumer *consumer, bool activated); - - // virtual dtor for any base class - virtual ~wxInputHandler(); -}; - -// ---------------------------------------------------------------------------- -// wxStdInputHandler is just a base class for all other "standard" handlers -// and also provides the way to chain input handlers together -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxStdInputHandler : public wxInputHandler -{ -public: - wxStdInputHandler(wxInputHandler *handler) : m_handler(handler) { } - - virtual bool HandleKey(wxInputConsumer *consumer, - const wxKeyEvent& event, - bool pressed) - { - return m_handler ? m_handler->HandleKey(consumer, event, pressed) - : false; - } - - virtual bool HandleMouse(wxInputConsumer *consumer, - const wxMouseEvent& event) - { - return m_handler ? m_handler->HandleMouse(consumer, event) : false; - } - - virtual bool HandleMouseMove(wxInputConsumer *consumer, const wxMouseEvent& event) - { - return m_handler ? m_handler->HandleMouseMove(consumer, event) : false; - } - - virtual bool HandleFocus(wxInputConsumer *consumer, const wxFocusEvent& event) - { - return m_handler ? m_handler->HandleFocus(consumer, event) : false; - } - -private: - wxInputHandler *m_handler; -}; - -#endif // _WX_UNIV_INPHAND_H_ diff --git a/wxWidgets/include/wx/univ/listbox.h b/wxWidgets/include/wx/univ/listbox.h deleted file mode 100644 index 0007716842..0000000000 --- a/wxWidgets/include/wx/univ/listbox.h +++ /dev/null @@ -1,300 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: wx/univ/listbox.h -// Purpose: the universal listbox -// Author: Vadim Zeitlin -// Modified by: -// Created: 30.08.00 -// RCS-ID: $Id: listbox.h 61872 2009-09-09 22:37:05Z VZ $ -// Copyright: (c) 2000 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr> -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_UNIV_LISTBOX_H_ -#define _WX_UNIV_LISTBOX_H_ - -#include "wx/scrolwin.h" // for wxScrollHelper -#include "wx/dynarray.h" -#include "wx/arrstr.h" - -// ---------------------------------------------------------------------------- -// the actions supported by this control -// ---------------------------------------------------------------------------- - -// change the current item -#define wxACTION_LISTBOX_SETFOCUS wxT("setfocus") // select the item -#define wxACTION_LISTBOX_MOVEDOWN wxT("down") // select item below -#define wxACTION_LISTBOX_MOVEUP wxT("up") // select item above -#define wxACTION_LISTBOX_PAGEDOWN wxT("pagedown") // go page down -#define wxACTION_LISTBOX_PAGEUP wxT("pageup") // go page up -#define wxACTION_LISTBOX_START wxT("start") // go to first item -#define wxACTION_LISTBOX_END wxT("end") // go to last item -#define wxACTION_LISTBOX_FIND wxT("find") // find item by 1st letter - -// do something with the current item -#define wxACTION_LISTBOX_ACTIVATE wxT("activate") // activate (choose) -#define wxACTION_LISTBOX_TOGGLE wxT("toggle") // togglee selected state -#define wxACTION_LISTBOX_SELECT wxT("select") // sel this, unsel others -#define wxACTION_LISTBOX_SELECTADD wxT("selectadd") // add to selection -#define wxACTION_LISTBOX_UNSELECT wxT("unselect") // unselect -#define wxACTION_LISTBOX_ANCHOR wxT("selanchor") // anchor selection - -// do something with the selection globally (not for single selection ones) -#define wxACTION_LISTBOX_SELECTALL wxT("selectall") // select all items -#define wxACTION_LISTBOX_UNSELECTALL wxT("unselectall") // unselect all items -#define wxACTION_LISTBOX_SELTOGGLE wxT("togglesel") // invert the selection -#define wxACTION_LISTBOX_EXTENDSEL wxT("extend") // extend to item - -// ---------------------------------------------------------------------------- -// wxListBox: a list of selectable items -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxListBox : public wxListBoxBase, public wxScrollHelper -{ -public: - // ctors and such - wxListBox() : wxScrollHelper(this) { Init(); } - wxListBox(wxWindow *parent, - wxWindowID id, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - int n = 0, const wxString choices[] = (const wxString *) NULL, - long style = 0, - const wxValidator& validator = wxDefaultValidator, - const wxString& name = wxListBoxNameStr ) - : wxScrollHelper(this) - { - Init(); - - 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 ); - - virtual ~wxListBox(); - - bool Create(wxWindow *parent, - wxWindowID id, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - int n = 0, const wxString choices[] = (const wxString *) 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); - - // implement the listbox interface defined by wxListBoxBase - virtual void Clear(); - virtual void Delete(unsigned int n); - - virtual unsigned int GetCount() const - { return (unsigned int)m_strings->GetCount(); } - virtual wxString GetString(unsigned int n) const - { return m_strings->Item(n); } - virtual void SetString(unsigned int n, const wxString& s); - virtual int FindString(const wxString& s, bool bCase = false) const - { return m_strings->Index(s, bCase); } - - virtual bool IsSelected(int n) const - { return m_selections.Index(n) != wxNOT_FOUND; } - virtual int GetSelection() const; - virtual int GetSelections(wxArrayInt& aSelections) const; - -protected: - virtual void DoSetSelection(int n, bool select); - virtual int DoAppendOnly(const wxString& item); - virtual int DoAppend(const wxString& item); - virtual void DoInsertItems(const wxArrayString& items, unsigned int pos); - virtual void DoSetItems(const wxArrayString& items, void **clientData); - - virtual void DoSetFirstItem(int n); - - virtual void DoSetItemClientData(unsigned int n, void* clientData); - virtual void* DoGetItemClientData(unsigned int n) const; - virtual void DoSetItemClientObject(unsigned int n, wxClientData* clientData); - virtual wxClientData* DoGetItemClientObject(unsigned int n) const; - -public: - // override some more base class methods - virtual bool SetFont(const wxFont& font); - - // the wxUniversal-specific methods - // -------------------------------- - - // the current item is the same as the selected one for wxLB_SINGLE - // listboxes but for the other ones it is just the focused item which may - // be selected or not - int GetCurrentItem() const { return m_current; } - void SetCurrentItem(int n); - - // select the item which is diff items below the current one - void ChangeCurrent(int diff); - - // activate (i.e. send a LISTBOX_DOUBLECLICKED message) the specified or - // current (if -1) item - void Activate(int item = -1); - - // select or unselect the specified or current (if -1) item - void DoSelect(int item = -1, bool sel = true); - - // more readable wrapper - void DoUnselect(int item) { DoSelect(item, false); } - - // select an item and send a notification about it - void SelectAndNotify(int item); - - // ensure that the given item is visible by scrolling it into view - virtual void EnsureVisible(int n); - - // find the first item [strictly] after the current one which starts with - // the given string and make it the current one, return true if the current - // item changed - bool FindItem(const wxString& prefix, bool strictlyAfter = false); - bool FindNextItem(const wxString& prefix) { return FindItem(prefix, true); } - - // extend the selection to span the range from the anchor (see below) to - // the specified or current item - void ExtendSelection(int itemTo = -1); - - // make this item the new selection anchor: extending selection with - // ExtendSelection() will work with it - void AnchorSelection(int itemFrom) { m_selAnchor = itemFrom; } - - // get, calculating it if necessary, the number of items per page, the - // height of each line and the max width of an item - int GetItemsPerPage() const; - wxCoord GetLineHeight() const; - wxCoord GetMaxWidth() const; - - // override the wxControl virtual methods - virtual bool PerformAction(const wxControlAction& action, - long numArg = 0l, - const wxString& strArg = wxEmptyString); - - static wxInputHandler *GetStdInputHandler(wxInputHandler *handlerDef); - virtual wxInputHandler *DoGetStdInputHandler(wxInputHandler *handlerDef) - { - return GetStdInputHandler(handlerDef); - } - - // idle processing - virtual void OnInternalIdle(); - -protected: - // geometry - virtual wxSize DoGetBestClientSize() const; - virtual void DoSetSize(int x, int y, - int width, int height, - int sizeFlags = wxSIZE_AUTO); - - virtual void DoDraw(wxControlRenderer *renderer); - virtual wxBorder GetDefaultBorder() const; - - // common part of all ctors - void Init(); - - // event handlers - void OnSize(wxSizeEvent& event); - - // common part of Clear() and DoSetItems(): clears everything - virtual void DoClear(); - - // refresh the given item(s) or everything - void RefreshItems(int from, int count); - void RefreshItem(int n); - void RefreshFromItemToEnd(int n); - void RefreshAll(); - - // send an event of the given type (using m_current by default) - bool SendEvent(wxEventType type, int item = -1); - - // calculate the number of items per page using our current size - void CalcItemsPerPage(); - - // can/should we have a horz scrollbar? - bool HasHorzScrollbar() const - { return (m_windowStyle & wxLB_HSCROLL) != 0; } - - // redraw the items in the given range only: called from DoDraw() - virtual void DoDrawRange(wxControlRenderer *renderer, - int itemFirst, int itemLast); - - // update the scrollbars and then ensure that the item is visible - void DoEnsureVisible(int n); - - // mark horz scrollbar for updating - void RefreshHorzScrollbar(); - - // update (show/hide/adjust) the scrollbars - void UpdateScrollbars(); - - // refresh the items specified by m_updateCount and m_updateFrom - void UpdateItems(); - - // the array containing all items (it is sorted if the listbox has - // wxLB_SORT style) - wxArrayString* m_strings; - - // this array contains the indices of the selected items (for the single - // selection listboxes only the first element of it is used and contains - // the current selection) - wxArrayInt m_selections; - - // and this one the client data (either void or wxClientData) - wxArrayPtrVoid m_itemsClientData; - - // the current item - int m_current; - -private: - // the range of elements which must be updated: if m_updateCount is 0 no - // update is needed, if it is -1 everything must be updated, otherwise - // m_updateCount items starting from m_updateFrom have to be redrawn - int m_updateFrom, - m_updateCount; - - // the height of one line in the listbox (all lines have the same height) - wxCoord m_lineHeight; - - // the maximal width of a listbox item and the item which has it - wxCoord m_maxWidth; - int m_maxWidthItem; - - // the extents of horz and vert scrollbars - int m_scrollRangeX, - m_scrollRangeY; - - // the number of items per page - size_t m_itemsPerPage; - - // if the number of items has changed we may need to show/hide the - // scrollbar - bool m_updateScrollbarX, m_updateScrollbarY, - m_showScrollbarX, m_showScrollbarY; - - // if the current item has changed, we might need to scroll if it went out - // of the window - bool m_currentChanged; - - // the anchor from which the selection is extended for the listboxes with - // wxLB_EXTENDED style - this is set to the last item which was selected - // by not extending the selection but by choosing it directly - int m_selAnchor; - - DECLARE_EVENT_TABLE() - DECLARE_DYNAMIC_CLASS(wxListBox) -}; - -#endif // _WX_UNIV_LISTBOX_H_ diff --git a/wxWidgets/include/wx/univ/menu.h b/wxWidgets/include/wx/univ/menu.h deleted file mode 100644 index 4b18ec46ba..0000000000 --- a/wxWidgets/include/wx/univ/menu.h +++ /dev/null @@ -1,282 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: wx/univ/menu.h -// Purpose: wxMenu and wxMenuBar classes for wxUniversal -// Author: Vadim Zeitlin -// Modified by: -// Created: 05.05.01 -// RCS-ID: $Id: menu.h 48053 2007-08-13 17:07:01Z JS $ -// Copyright: (c) 2001 SciTech Software, Inc. (www.scitechsoft.com) -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_UNIV_MENU_H_ -#define _WX_UNIV_MENU_H_ - -#if wxUSE_ACCEL - #include "wx/accel.h" -#endif // wxUSE_ACCEL - -#include "wx/dynarray.h" - -// fwd declarations -class WXDLLEXPORT wxMenuInfo; -WX_DECLARE_EXPORTED_OBJARRAY(wxMenuInfo, wxMenuInfoArray); - -class WXDLLEXPORT wxMenuGeometryInfo; -class WXDLLEXPORT wxPopupMenuWindow; -class WXDLLEXPORT wxRenderer; - -// ---------------------------------------------------------------------------- -// wxMenu -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxMenu : public wxMenuBase -{ -public: - // ctors and dtor - wxMenu(const wxString& title, long style = 0) - : wxMenuBase(title, style) { Init(); } - - wxMenu(long style = 0) : wxMenuBase(style) { Init(); } - - virtual ~wxMenu(); - - // called by wxMenuItem when an item of this menu changes - void RefreshItem(wxMenuItem *item); - - // does the menu have any items? - bool IsEmpty() const { return !GetMenuItems().GetFirst(); } - - // show this menu at the given position (in screen coords) and optionally - // select its first item - void Popup(const wxPoint& pos, const wxSize& size, - bool selectFirst = true); - - // dismiss the menu - void Dismiss(); - - // override the base class methods to connect/disconnect event handlers - virtual void Attach(wxMenuBarBase *menubar); - virtual void Detach(); - - // implementation only from here - - // do as if this item were clicked, return true if the resulting event was - // processed, false otherwise - bool ClickItem(wxMenuItem *item); - - // process the key event, return true if done - bool ProcessKeyDown(int key); - -#if wxUSE_ACCEL - // find the item for the given accel and generate an event if found - bool ProcessAccelEvent(const wxKeyEvent& event); -#endif // wxUSE_ACCEL - -protected: - // implement base class virtuals - virtual wxMenuItem* DoAppend(wxMenuItem *item); - virtual wxMenuItem* DoInsert(size_t pos, wxMenuItem *item); - virtual wxMenuItem* DoRemove(wxMenuItem *item); - - // common part of DoAppend and DoInsert - void OnItemAdded(wxMenuItem *item); - - // called by wxPopupMenuWindow when the window is hidden - void OnDismiss(bool dismissParent); - - // return true if the menu is currently shown on screen - bool IsShown() const; - - // get the menu geometry info - const wxMenuGeometryInfo& GetGeometryInfo() const; - - // forget old menu geometry info - void InvalidateGeometryInfo(); - - // return either the menubar or the invoking window, normally never NULL - wxWindow *GetRootWindow() const; - - // get the renderer we use for drawing: either the one of the menu bar or - // the one of the window if we're a popup menu - wxRenderer *GetRenderer() const; - -#if wxUSE_ACCEL - // add/remove accel for the given menu item - void AddAccelFor(wxMenuItem *item); - void RemoveAccelFor(wxMenuItem *item); -#endif // wxUSE_ACCEL - -private: - // common part of all ctors - void Init(); - - // terminate the current radio group, if any - void EndRadioGroup(); - - // the exact menu geometry is defined by a struct derived from this one - // which is opaque and defined by the renderer - wxMenuGeometryInfo *m_geometry; - - // the menu shown on screen or NULL if not currently shown - wxPopupMenuWindow *m_popupMenu; - -#if wxUSE_ACCEL - // the accel table for this menu - wxAcceleratorTable m_accelTable; -#endif // wxUSE_ACCEL - - // the position of the first item in the current radio group or -1 - int m_startRadioGroup; - - // it calls out OnDismiss() - friend class wxPopupMenuWindow; - DECLARE_DYNAMIC_CLASS(wxMenu) -}; - -// ---------------------------------------------------------------------------- -// wxMenuBar -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxMenuBar : public wxMenuBarBase -{ -public: - // ctors and dtor - wxMenuBar(long WXUNUSED(style) = 0) { Init(); } - wxMenuBar(size_t n, wxMenu *menus[], const wxString titles[], long style = 0); - virtual ~wxMenuBar(); - - // implement base class virtuals - 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 void EnableTop(size_t pos, bool enable); - virtual bool IsEnabledTop(size_t pos) const; - - virtual void SetLabelTop(size_t pos, const wxString& label); - virtual wxString GetLabelTop(size_t pos) const; - - virtual void Attach(wxFrame *frame); - virtual void Detach(); - - // get the next item for the givan accel letter (used by wxFrame), return - // -1 if none - // - // if unique is not NULL, filled with true if there is only one item with - // this accel, false if two or more - int FindNextItemForAccel(int idxStart, - int keycode, - bool *unique = NULL) const; - - // called by wxFrame to set focus to or open the given menu - void SelectMenu(size_t pos); - void PopupMenu(size_t pos); - -#if wxUSE_ACCEL - // find the item for the given accel and generate an event if found - bool ProcessAccelEvent(const wxKeyEvent& event); -#endif // wxUSE_ACCEL - - // called by wxMenu when it is dismissed - void OnDismissMenu(bool dismissMenuBar = false); - -protected: - // common part of all ctors - void Init(); - - // event handlers - void OnLeftDown(wxMouseEvent& event); - void OnMouseMove(wxMouseEvent& event); - void OnKeyDown(wxKeyEvent& event); - void OnKillFocus(wxFocusEvent& event); - - // process the mouse move event, return true if we did, false to continue - // processing as usual - // - // the coordinates are client coordinates of menubar, convert if necessary - bool ProcessMouseEvent(const wxPoint& pt); - - // called when the menu bar loses mouse capture - it is not hidden unlike - // menus, but it doesn't have modal status any longer - void OnDismiss(); - - // draw the menubar - virtual void DoDraw(wxControlRenderer *renderer); - - // menubar geometry - virtual wxSize DoGetBestClientSize() const; - - // has the menubar been created already? - bool IsCreated() const { return m_frameLast != NULL; } - - // "fast" version of GetMenuCount() - size_t GetCount() const { return m_menuInfos.GetCount(); } - - // get the (total) width of the specified menu - wxCoord GetItemWidth(size_t pos) const; - - // get the rect of the item - wxRect GetItemRect(size_t pos) const; - - // get the menu from the given point or -1 if none - int GetMenuFromPoint(const wxPoint& pos) const; - - // refresh the given item - void RefreshItem(size_t pos); - - // refresh all items after this one (including it) - void RefreshAllItemsAfter(size_t pos); - - // hide the currently shown menu and show this one - void DoSelectMenu(size_t pos); - - // popup the currently selected menu - void PopupCurrentMenu(bool selectFirst = true); - - // hide the currently selected menu - void DismissMenu(); - - // do we show a menu currently? - bool IsShowingMenu() const { return m_menuShown != 0; } - - // we don't want to have focus except while selecting from menu - void GiveAwayFocus(); - - // Release the mouse capture if we have it - bool ReleaseMouseCapture(); - - // the array containing extra menu info we need - wxMenuInfoArray m_menuInfos; - - // the current item (only used when menubar has focus) - int m_current; - -private: - // the last frame to which we were attached, NULL initially - wxFrame *m_frameLast; - - // the currently shown menu or NULL - wxMenu *m_menuShown; - - // should be showing the menu? this is subtly different from m_menuShown != - // NULL as the menu which should be shown may be disabled in which case we - // don't show it - but will do as soon as the focus shifts to another menu - bool m_shouldShowMenu; - - // it calls out ProcessMouseEvent() - friend class wxPopupMenuWindow; - - DECLARE_EVENT_TABLE() - DECLARE_DYNAMIC_CLASS(wxMenuBar) - -public: - -#if wxABI_VERSION >= 20805 - // Gets the original label at the top-level of the menubar - wxString GetMenuLabel(size_t pos) const; -#endif -}; - -#endif // _WX_UNIV_MENU_H_ diff --git a/wxWidgets/include/wx/univ/menuitem.h b/wxWidgets/include/wx/univ/menuitem.h deleted file mode 100644 index 1b067a6eda..0000000000 --- a/wxWidgets/include/wx/univ/menuitem.h +++ /dev/null @@ -1,135 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: wx/univ/menuitem.h -// Purpose: wxMenuItem class for wxUniversal -// Author: Vadim Zeitlin -// Modified by: -// Created: 05.05.01 -// RCS-ID: $Id: menuitem.h 61872 2009-09-09 22:37:05Z VZ $ -// Copyright: (c) 2001 SciTech Software, Inc. (www.scitechsoft.com) -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_UNIV_MENUITEM_H_ -#define _WX_UNIV_MENUITEM_H_ - -// ---------------------------------------------------------------------------- -// wxMenuItem implements wxMenuItemBase -// ---------------------------------------------------------------------------- - -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 to update the item appearance on screen - virtual void SetText(const wxString& text); - virtual void SetCheckable(bool checkable); - - virtual void Enable(bool enable = true); - virtual void Check(bool check = true); - - // we add some extra functions which are also available under MSW from - // wxOwnerDrawn class - they will be moved to wxMenuItemBase later - // hopefully - void SetBitmaps(const wxBitmap& bmpChecked, - const wxBitmap& bmpUnchecked = wxNullBitmap); - void SetBitmap(const wxBitmap& bmp) { SetBitmaps(bmp); } - const wxBitmap& GetBitmap(bool checked = true) const - { return checked ? m_bmpChecked : m_bmpUnchecked; } - - void SetDisabledBitmap( const wxBitmap& bmpDisabled ) - { m_bmpDisabled = bmpDisabled; } - const wxBitmap& GetDisabledBitmap() const - { return m_bmpDisabled; } - - // mark item as belonging to the given radio group - void SetAsRadioGroupStart(); - void SetRadioGroupStart(int start); - void SetRadioGroupEnd(int end); - - // wxUniv-specific methods for implementation only starting from here - - // get the accel index of our label or -1 if none - int GetAccelIndex() const { return m_indexAccel; } - - // get the accel string (displayed to the right of the label) - const wxString& GetAccelString() const { return m_strAccel; } - - // set/get the y coord and the height of this item: note that it must be - // set first and retrieved later, the item doesn't calculate it itself - void SetGeometry(wxCoord y, wxCoord height) - { - m_posY = y; - m_height = height; - } - - wxCoord GetPosition() const - { - wxASSERT_MSG( m_posY != wxDefaultCoord, wxT("must call SetHeight first!") ); - - return m_posY; - } - - wxCoord GetHeight() const - { - wxASSERT_MSG( m_height != wxDefaultCoord, wxT("must call SetHeight first!") ); - - return m_height; - } - -protected: - // notify the menu about the change in this item - inline void NotifyMenu(); - - // set the accel index and string from text - void UpdateAccelInfo(); - - // the bitmaps (may be invalid, then they're not used) - wxBitmap m_bmpChecked, - m_bmpUnchecked, - m_bmpDisabled; - - // 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; - - // the position of the accelerator in our label, -1 if none - int m_indexAccel; - - // the accel string (i.e. "Ctrl-Q" or "Alt-F1") - wxString m_strAccel; - - // the position and height of the displayed item - wxCoord m_posY, - m_height; - -private: - DECLARE_DYNAMIC_CLASS(wxMenuItem) - -public: - -#if wxABI_VERSION >= 20805 - // return the item label including any mnemonics and accelerators. - // This used to be called GetText. - wxString GetItemLabel() const { return GetText(); } -#endif -}; - -#endif // _WX_UNIV_MENUITEM_H_ - diff --git a/wxWidgets/include/wx/univ/notebook.h b/wxWidgets/include/wx/univ/notebook.h deleted file mode 100644 index 680a41fab1..0000000000 --- a/wxWidgets/include/wx/univ/notebook.h +++ /dev/null @@ -1,257 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: wx/univ/notebook.h -// Purpose: universal version of wxNotebook -// Author: Vadim Zeitlin -// Modified by: -// Created: 01.02.01 -// RCS-ID: $Id: notebook.h 61872 2009-09-09 22:37:05Z VZ $ -// Copyright: (c) 2001 SciTech Software, Inc. (www.scitechsoft.com) -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_UNIV_NOTEBOOK_H_ -#define _WX_UNIV_NOTEBOOK_H_ - -#include "wx/arrstr.h" - -class WXDLLEXPORT wxSpinButton; - -// ---------------------------------------------------------------------------- -// the actions supported by this control -// ---------------------------------------------------------------------------- - -// change the page: to the next/previous/given one -#define wxACTION_NOTEBOOK_NEXT wxT("nexttab") -#define wxACTION_NOTEBOOK_PREV wxT("prevtab") -#define wxACTION_NOTEBOOK_GOTO wxT("gototab") - -// ---------------------------------------------------------------------------- -// wxNotebook -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxNotebook : public wxNotebookBase -{ -public: - // ctors and such - // -------------- - - wxNotebook() { Init(); } - - wxNotebook(wxWindow *parent, - wxWindowID id, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = 0, - const wxString& name = wxNotebookNameStr) - { - Init(); - - (void)Create(parent, id, pos, size, style, name); - } - - // quasi ctor - bool Create(wxWindow *parent, - wxWindowID id, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = 0, - const wxString& name = wxNotebookNameStr); - - // dtor - virtual ~wxNotebook(); - - // implement wxNotebookBase pure virtuals - // -------------------------------------- - - virtual int SetSelection(size_t nPage) { return DoSetSelection(nPage, SetSelection_SendEvent); } - virtual int GetSelection() const { return (int) m_sel; } - - // changes selected page without sending events - int ChangeSelection(size_t nPage) { return DoSetSelection(nPage); } - - virtual bool SetPageText(size_t nPage, const wxString& strText); - virtual wxString GetPageText(size_t nPage) const; - - virtual int GetPageImage(size_t nPage) const; - virtual bool SetPageImage(size_t nPage, int nImage); - - virtual void SetPageSize(const wxSize& size); - virtual void SetPadding(const wxSize& padding); - virtual void SetTabSize(const wxSize& sz); - - virtual wxSize CalcSizeFromPage(const wxSize& sizePage) const; - - virtual bool DeleteAllPages(); - - virtual bool InsertPage(size_t nPage, - wxNotebookPage *pPage, - const wxString& strText, - bool bSelect = false, - int imageId = -1); - - // style tests - // ----------- - - // return true if all tabs have the same width - bool FixedSizeTabs() const { return HasFlag(wxNB_FIXEDWIDTH); } - - // return wxTOP/wxBOTTOM/wxRIGHT/wxLEFT - wxDirection GetTabOrientation() const; - - // return true if the notebook has tabs at the sidesand not at the top (or - // bottom) as usual - bool IsVertical() const; - - // hit testing - // ----------- - - virtual int HitTest(const wxPoint& pt, long *flags = NULL) const; - - // input handling - // -------------- - - virtual bool PerformAction(const wxControlAction& action, - long numArg = 0l, - const wxString& strArg = wxEmptyString); - - static wxInputHandler *GetStdInputHandler(wxInputHandler *handlerDef); - virtual wxInputHandler *DoGetStdInputHandler(wxInputHandler *handlerDef) - { - return GetStdInputHandler(handlerDef); - } - - // refresh the currently selected tab - void RefreshCurrent(); - -protected: - virtual wxNotebookPage *DoRemovePage(size_t nPage); - - // drawing - virtual void DoDraw(wxControlRenderer *renderer); - void DoDrawTab(wxDC& dc, const wxRect& rect, size_t n); - - // resizing - virtual wxSize DoGetBestClientSize() const; - virtual void DoMoveWindow(int x, int y, int width, int height); - virtual void DoSetSize(int x, int y, - int width, int height, - int sizeFlags = wxSIZE_AUTO); - - int DoSetSelection(size_t nPage, int flags = 0); - - // common part of all ctors - void Init(); - - // resize the tab to fit its title (and icon if any) - void ResizeTab(int page); - - // recalculate the geometry of the notebook completely - void Relayout(); - - // is the spin button currently shown? - bool HasSpinBtn() const; - - // calculate last (fully) visible tab: updates m_lastVisible - void CalcLastVisibleTab(); - - // show or hide the spin control for tabs scrolling depending on whether it - // is needed or not - void UpdateSpinBtn(); - - // position the spin button - void PositionSpinBtn(); - - // refresh the given tab only - void RefreshTab(int page, bool forceSelected = false); - - // refresh all tabs - void RefreshAllTabs(); - - // get the tab rect (inefficient, don't use this in a loop) - wxRect GetTabRect(int page) const; - - // get the rectangle containing all tabs - wxRect GetAllTabsRect() const; - - // get the part occupied by the tabs - slightly smaller than - // GetAllTabsRect() because the tabs may be indented from it - wxRect GetTabsPart() const; - - // calculate the tab size (without padding) - wxSize CalcTabSize(int page) const; - - // get the (cached) size of a tab - void GetTabSize(int page, wxCoord *w, wxCoord *h) const; - - // get the (cached) width of the tab - wxCoord GetTabWidth(int page) const - { return FixedSizeTabs() ? m_widthMax : m_widths[page]; } - - // return true if the tab has an associated image - bool HasImage(int page) const - { return m_imageList && m_images[page] != -1; } - - // get the part of the notebook reserved for the pages (slightly larger - // than GetPageRect() as we draw a border and leave marginin between) - wxRect GetPagePart() const; - - // get the page rect in our client coords - wxRect GetPageRect() const; - - // get our client size from the page size - wxSize GetSizeForPage(const wxSize& size) const; - - // scroll the tabs so that the first page shown becomes the given one - void ScrollTo(int page); - - // scroll the tabs so that the first page shown becomes the given one - void ScrollLastTo(int page); - - // the pages titles - wxArrayString m_titles; - - // the current selection - size_t m_sel; - - // the spin button to change the pages - wxSpinButton *m_spinbtn; - - // the offset of the first page shown (may be changed with m_spinbtn) - wxCoord m_offset; - - // the first and last currently visible tabs: the name is not completely - // accurate as m_lastVisible is, in fact, the first tab which is *not* - // visible: so the visible tabs are those with indexes such that - // m_firstVisible <= n < m_lastVisible - size_t m_firstVisible, - m_lastVisible; - - // the last fully visible item, usually just m_lastVisible - 1 but may be - // different from it - size_t m_lastFullyVisible; - - // the height of tabs in a normal notebook or the width of tabs in a - // notebook with tabs on a side - wxCoord m_heightTab; - - // the biggest height (or width) of a notebook tab (used only if - // FixedSizeTabs()) or -1 if not calculated yet - wxCoord m_widthMax; - - // the cached widths (or heights) of tabs - wxArrayInt m_widths; - - // the icon indices - wxArrayInt m_images; - - // the accel indexes for labels - wxArrayInt m_accels; - - // the padding - wxSize m_sizePad; - - DECLARE_DYNAMIC_CLASS(wxNotebook) -}; - -#endif // _WX_UNIV_NOTEBOOK_H_ - diff --git a/wxWidgets/include/wx/univ/radiobox.h b/wxWidgets/include/wx/univ/radiobox.h deleted file mode 100644 index 14ecf969f1..0000000000 --- a/wxWidgets/include/wx/univ/radiobox.h +++ /dev/null @@ -1,151 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: wx/univ/radiobox.h -// Purpose: wxRadioBox declaration -// Author: Vadim Zeitlin -// Modified by: -// Created: 11.09.00 -// RCS-ID: $Id: radiobox.h 38319 2006-03-23 22:05:23Z VZ $ -// Copyright: (c) 2000 SciTech Software, Inc. (www.scitechsoft.com) -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_UNIV_RADIOBOX_H_ -#define _WX_UNIV_RADIOBOX_H_ - -class WXDLLEXPORT wxRadioButton; - -#include "wx/statbox.h" -#include "wx/dynarray.h" - -WX_DEFINE_EXPORTED_ARRAY_PTR(wxRadioButton *, wxArrayRadioButtons); - -// ---------------------------------------------------------------------------- -// wxRadioBox: a box full of radio buttons -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxRadioBox : public wxStaticBox, - public wxRadioBoxBase -{ -public: - // wxRadioBox construction - wxRadioBox() { Init(); } - - 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_SPECIFY_COLS, - const wxValidator& val = wxDefaultValidator, - const wxString& name = wxRadioBoxNameStr) - { - Init(); - - (void)Create(parent, id, title, pos, size, n, choices, - majorDim, style, val, name); - } - wxRadioBox(wxWindow *parent, - wxWindowID id, - const wxString& title, - const wxPoint& pos, - const wxSize& size, - const wxArrayString& choices, - int majorDim = 0, - long style = wxRA_SPECIFY_COLS, - const wxValidator& val = wxDefaultValidator, - const wxString& name = wxRadioBoxNameStr); - - 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_SPECIFY_COLS, - 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_SPECIFY_COLS, - const wxValidator& val = wxDefaultValidator, - const wxString& name = wxRadioBoxNameStr); - - virtual ~wxRadioBox(); - - // implement wxRadioBox interface - virtual void SetSelection(int n); - virtual int GetSelection() const; - - virtual unsigned int GetCount() const - { return (unsigned int)m_buttons.GetCount(); } - - virtual wxString GetString(unsigned int n) const; - virtual void SetString(unsigned int n, const wxString& label); - - virtual bool Enable(unsigned int n, bool enable = true); - virtual bool Show(unsigned int n, bool show = true); - - virtual bool IsItemEnabled(unsigned int n) const; - virtual bool IsItemShown(unsigned int n) const; - - // we also override the wxControl methods to avoid virtual function hiding - virtual bool Enable(bool enable = true); - virtual bool Show(bool show = true); - virtual wxString GetLabel() const; - virtual void SetLabel(const wxString& label); - - // we inherit a version always returning false from wxStaticBox, override - // it to behave normally - virtual bool AcceptsFocus() const { return wxControl::AcceptsFocus(); } - -#if wxUSE_TOOLTIPS - virtual void DoSetToolTip( wxToolTip *tip ); -#endif // wxUSE_TOOLTIPS - - // wxUniversal-only methods - - // another Append() version - void Append(int n, const wxString *choices); - - // implementation only: called by wxRadioHookHandler - void OnRadioButton(wxEvent& event); - bool OnKeyDown(wxKeyEvent& event); - -protected: - // override the base class methods dealing with window positioning/sizing - // as we must move/size the buttons as well - virtual void DoMoveWindow(int x, int y, int width, int height); - virtual wxSize DoGetBestClientSize() const; - - // generate a radiobutton click event for the current item - void SendRadioEvent(); - - // common part of all ctors - void Init(); - - // calculate the max size of all buttons - wxSize GetMaxButtonSize() const; - - // the currently selected radio button or -1 - int m_selection; - - // all radio buttons - wxArrayRadioButtons m_buttons; - - // the event handler which is used to translate radiobutton events into - // radiobox one - wxEvtHandler *m_evtRadioHook; - -private: - DECLARE_DYNAMIC_CLASS(wxRadioBox) -}; - -#endif // _WX_UNIV_RADIOBOX_H_ diff --git a/wxWidgets/include/wx/univ/radiobut.h b/wxWidgets/include/wx/univ/radiobut.h deleted file mode 100644 index bcf4005c97..0000000000 --- a/wxWidgets/include/wx/univ/radiobut.h +++ /dev/null @@ -1,76 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: wx/univ/radiobut.h -// Purpose: wxRadioButton declaration -// Author: Vadim Zeitlin -// Modified by: -// Created: 10.09.00 -// RCS-ID: $Id: radiobut.h 35650 2005-09-23 12:56:45Z MR $ -// Copyright: (c) 2000 SciTech Software, Inc. (www.scitechsoft.com) -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_UNIV_RADIOBUT_H_ -#define _WX_UNIV_RADIOBUT_H_ - -#include "wx/checkbox.h" - -// ---------------------------------------------------------------------------- -// wxRadioButton -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxRadioButton : public wxCheckBox -{ -public: - // constructors - wxRadioButton() { Init(); } - - 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) - { - Init(); - - 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); - - // override some base class methods - virtual void ChangeValue(bool value); - -protected: - // implement our own drawing - virtual void DoDraw(wxControlRenderer *renderer); - - // we use the radio button bitmaps for size calculation - virtual wxSize GetBitmapSize() const; - - // the radio button can only be cleared using this method, not - // ChangeValue() above - and it is protected as it can only be called by - // another radiobutton - void ClearValue(); - - // called when the radio button becomes checked: we clear all the buttons - // in the same group with us here - virtual void OnCheck(); - - // send event about radio button selection - virtual void SendEvent(); - -private: - DECLARE_DYNAMIC_CLASS(wxRadioButton) -}; - -#endif // _WX_UNIV_RADIOBUT_H_ diff --git a/wxWidgets/include/wx/univ/renderer.h b/wxWidgets/include/wx/univ/renderer.h deleted file mode 100644 index ef273309cf..0000000000 --- a/wxWidgets/include/wx/univ/renderer.h +++ /dev/null @@ -1,932 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: wx/univ/renderer.h -// Purpose: wxRenderer class declaration -// Author: Vadim Zeitlin -// Modified by: -// Created: 06.08.00 -// RCS-ID: $Id: renderer.h 43726 2006-11-30 23:44:55Z RD $ -// Copyright: (c) 2000 SciTech Software, Inc. (www.scitechsoft.com) -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_UNIV_RENDERER_H_ -#define _WX_UNIV_RENDERER_H_ - -/* - wxRenderer class is used to draw all wxWidgets controls. This is an ABC and - the look of the application is determined by the concrete derivation of - wxRenderer used in the program. - - It also contains a few static methods which may be used by the concrete - renderers and provide the functionality which is often similar or identical - in all renderers (using inheritance here would be more restrictive as the - given concrete renderer may need an arbitrary subset of the base class - methods). - - Finally note that wxRenderer supersedes wxRendererNative in wxUniv build and - includes the latters functionality (which it may delegate to the generic - implementation of the latter or reimplement itself). - */ - -#include "wx/renderer.h" - -class WXDLLEXPORT wxWindow; -class WXDLLEXPORT wxDC; -class WXDLLEXPORT wxCheckListBox; - -#if wxUSE_LISTBOX - class WXDLLEXPORT wxListBox; -#endif // wxUSE_LISTBOX - -#if wxUSE_MENUS - class WXDLLEXPORT wxMenu; - class WXDLLEXPORT wxMenuGeometryInfo; -#endif // wxUSE_MENUS - -class WXDLLEXPORT wxScrollBar; - -#if wxUSE_TEXTCTRL - class WXDLLEXPORT wxTextCtrl; -#endif - -#if wxUSE_GAUGE - class WXDLLEXPORT wxGauge; -#endif // wxUSE_GAUGE - -#include "wx/string.h" -#include "wx/gdicmn.h" -#include "wx/icon.h" - -// helper class used by wxMenu-related functions -class WXDLLEXPORT wxMenuGeometryInfo -{ -public: - // get the total size of the menu - virtual wxSize GetSize() const = 0; - - virtual ~wxMenuGeometryInfo(); -}; - -// ---------------------------------------------------------------------------- -// wxRenderer: abstract renderers interface -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxRenderer : public wxDelegateRendererNative -{ -public: - // drawing functions - // ----------------- - - // draw the controls background - virtual void DrawBackground(wxDC& dc, - const wxColour& col, - const wxRect& rect, - int flags, - wxWindow *window = NULL) = 0; - - // draw the button surface - virtual void DrawButtonSurface(wxDC& dc, - const wxColour& col, - const wxRect& rect, - int flags) = 0; - - - // draw the focus rectangle around the label contained in the given rect - // - // only wxCONTROL_SELECTED makes sense in flags here - virtual void DrawFocusRect(wxDC& dc, const wxRect& rect, int flags = 0) = 0; - - // draw the label inside the given rectangle with the specified alignment - // and optionally emphasize the character with the given index - virtual void DrawLabel(wxDC& dc, - const wxString& label, - const wxRect& rect, - int flags = 0, - int alignment = wxALIGN_LEFT | wxALIGN_TOP, - int indexAccel = -1, - wxRect *rectBounds = NULL) = 0; - - // same but also draw a bitmap if it is valid - virtual void DrawButtonLabel(wxDC& dc, - const wxString& label, - const wxBitmap& image, - const wxRect& rect, - int flags = 0, - int alignment = wxALIGN_LEFT | wxALIGN_TOP, - int indexAccel = -1, - wxRect *rectBounds = NULL) = 0; - - - // draw the border and optionally return the rectangle containing the - // region inside the border - virtual void DrawBorder(wxDC& dc, - wxBorder border, - const wxRect& rect, - int flags = 0, - wxRect *rectIn = (wxRect *)NULL) = 0; - - // draw text control border (I hate to have a separate method for this but - // it is needed to accommodate GTK+) - virtual void DrawTextBorder(wxDC& dc, - wxBorder border, - const wxRect& rect, - int flags = 0, - wxRect *rectIn = (wxRect *)NULL) = 0; - - // draw push button border and return the rectangle left for the label - virtual void DrawButtonBorder(wxDC& dc, - const wxRect& rect, - int flags = 0, - wxRect *rectIn = (wxRect *)NULL) = 0; - - // draw a horizontal line - virtual void DrawHorizontalLine(wxDC& dc, - wxCoord y, wxCoord x1, wxCoord x2) = 0; - - // draw a vertical line - virtual void DrawVerticalLine(wxDC& dc, - wxCoord x, wxCoord y1, wxCoord y2) = 0; - - // draw a frame with the label (horizontal alignment can be specified) - virtual void DrawFrame(wxDC& dc, - const wxString& label, - const wxRect& rect, - int flags = 0, - int alignment = wxALIGN_LEFT, - int indexAccel = -1) = 0; - - // draw an arrow in the given direction - virtual void DrawArrow(wxDC& dc, - wxDirection dir, - const wxRect& rect, - int flags = 0) = 0; - - // draw a scrollbar arrow (may be the same as arrow but may be not) - virtual void DrawScrollbarArrow(wxDC& dc, - wxDirection dir, - const wxRect& rect, - int flags = 0) = 0; - - // draw the scrollbar thumb - virtual void DrawScrollbarThumb(wxDC& dc, - wxOrientation orient, - const wxRect& rect, - int flags = 0) = 0; - - // draw a (part of) scrollbar shaft - virtual void DrawScrollbarShaft(wxDC& dc, - wxOrientation orient, - const wxRect& rect, - int flags = 0) = 0; - - // draw the rectangle in the corner between two scrollbars - virtual void DrawScrollCorner(wxDC& dc, - const wxRect& rect) = 0; - - // draw an item of a wxListBox - virtual void DrawItem(wxDC& dc, - const wxString& label, - const wxRect& rect, - int flags = 0) = 0; - - // draw an item of a wxCheckListBox - virtual void DrawCheckItem(wxDC& dc, - const wxString& label, - const wxBitmap& bitmap, - const wxRect& rect, - int flags = 0) = 0; - - // draw a checkbutton (bitmap may be invalid to use default one) - virtual void DrawCheckButton(wxDC& dc, - const wxString& label, - const wxBitmap& bitmap, - const wxRect& rect, - int flags = 0, - wxAlignment align = wxALIGN_LEFT, - int indexAccel = -1) = 0; - - // draw a radio button - virtual void DrawRadioButton(wxDC& dc, - const wxString& label, - const wxBitmap& bitmap, - const wxRect& rect, - int flags = 0, - wxAlignment align = wxALIGN_LEFT, - int indexAccel = -1) = 0; - -#if wxUSE_TOOLBAR - // draw a toolbar button (label may be empty, bitmap may be invalid, if - // both conditions are true this function draws a separator) - virtual void DrawToolBarButton(wxDC& dc, - const wxString& label, - const wxBitmap& bitmap, - const wxRect& rect, - int flags = 0, - long style = 0, - int tbarStyle = 0) = 0; -#endif // wxUSE_TOOLBAR - -#if wxUSE_TEXTCTRL - // draw a (part of) line in the text control - virtual void DrawTextLine(wxDC& dc, - const wxString& text, - const wxRect& rect, - int selStart = -1, - int selEnd = -1, - int flags = 0) = 0; - - // draw a line wrap indicator - virtual void DrawLineWrapMark(wxDC& dc, const wxRect& rect) = 0; -#endif // wxUSE_TEXTCTRL - -#if wxUSE_NOTEBOOK - // draw a notebook tab - virtual void DrawTab(wxDC& dc, - const wxRect& rect, - wxDirection dir, - const wxString& label, - const wxBitmap& bitmap = wxNullBitmap, - int flags = 0, - int indexAccel = -1) = 0; -#endif // wxUSE_NOTEBOOK - -#if wxUSE_SLIDER - - // draw the slider shaft - virtual void DrawSliderShaft(wxDC& dc, - const wxRect& rect, - int lenThumb, - wxOrientation orient, - int flags = 0, - long style = 0, - wxRect *rectShaft = NULL) = 0; - - // draw the slider thumb - virtual void DrawSliderThumb(wxDC& dc, - const wxRect& rect, - wxOrientation orient, - int flags = 0, - long style = 0) = 0; - - // draw the slider ticks - virtual void DrawSliderTicks(wxDC& dc, - const wxRect& rect, - int lenThumb, - wxOrientation orient, - int start, - int end, - int step = 1, - int flags = 0, - long style = 0) = 0; -#endif // wxUSE_SLIDER - -#if wxUSE_MENUS - // draw a menu bar item - virtual void DrawMenuBarItem(wxDC& dc, - const wxRect& rect, - const wxString& label, - int flags = 0, - int indexAccel = -1) = 0; - - // draw a menu item (also used for submenus if flags has ISSUBMENU flag) - // - // the geometryInfo is calculated by GetMenuGeometry() function from below - virtual void DrawMenuItem(wxDC& dc, - wxCoord y, - const wxMenuGeometryInfo& geometryInfo, - const wxString& label, - const wxString& accel, - const wxBitmap& bitmap = wxNullBitmap, - int flags = 0, - int indexAccel = -1) = 0; - - // draw a menu bar separator - virtual void DrawMenuSeparator(wxDC& dc, - wxCoord y, - const wxMenuGeometryInfo& geomInfo) = 0; -#endif // wxUSE_MENUS - -#if wxUSE_STATUSBAR - // draw a status bar field: wxCONTROL_ISDEFAULT bit in the flags is - // interpreted specially and means "draw the status bar grip" here - virtual void DrawStatusField(wxDC& dc, - const wxRect& rect, - const wxString& label, - int flags = 0, int style = 0) = 0; -#endif // wxUSE_STATUSBAR - - // draw complete frame/dialog titlebar - virtual void DrawFrameTitleBar(wxDC& dc, - const wxRect& rect, - const wxString& title, - const wxIcon& icon, - int flags, - int specialButton = 0, - int specialButtonFlags = 0) = 0; - - // draw frame borders - virtual void DrawFrameBorder(wxDC& dc, - const wxRect& rect, - int flags) = 0; - - // draw frame titlebar background - virtual void DrawFrameBackground(wxDC& dc, - const wxRect& rect, - int flags) = 0; - - // draw frame title - virtual void DrawFrameTitle(wxDC& dc, - const wxRect& rect, - const wxString& title, - int flags) = 0; - - // draw frame icon - virtual void DrawFrameIcon(wxDC& dc, - const wxRect& rect, - const wxIcon& icon, - int flags) = 0; - - // draw frame buttons - virtual void DrawFrameButton(wxDC& dc, - wxCoord x, wxCoord y, - int button, - int flags = 0) = 0; - - // misc functions - // -------------- - -#if wxUSE_COMBOBOX - // return the bitmaps to use for combobox button - virtual void GetComboBitmaps(wxBitmap *bmpNormal, - wxBitmap *bmpFocus, - wxBitmap *bmpPressed, - wxBitmap *bmpDisabled) = 0; -#endif // wxUSE_COMBOBOX - - // geometry functions - // ------------------ - - // get the dimensions of the border: rect.x/y contain the width/height of - // the left/top side, width/heigh - of the right/bottom one - virtual wxRect GetBorderDimensions(wxBorder border) const = 0; - - // the scrollbars may be drawn either inside the window border or outside - // it - this function is used to decide how to draw them - virtual bool AreScrollbarsInsideBorder() const = 0; - - // adjust the size of the control of the given class: for most controls, - // this just takes into account the border, but for some (buttons, for - // example) it is more complicated - the result being, in any case, that - // the control looks "nice" if it uses the adjusted rectangle - virtual void AdjustSize(wxSize *size, const wxWindow *window) = 0; - -#if wxUSE_SCROLLBAR - // get the size of a scrollbar arrow - virtual wxSize GetScrollbarArrowSize() const = 0; -#endif // wxUSE_SCROLLBAR - - // get the height of a listbox item from the base font height - virtual wxCoord GetListboxItemHeight(wxCoord fontHeight) = 0; - - // get the size of a checkbox/radio button bitmap - virtual wxSize GetCheckBitmapSize() const = 0; - virtual wxSize GetRadioBitmapSize() const = 0; - virtual wxCoord GetCheckItemMargin() const = 0; - -#if wxUSE_TOOLBAR - // get the standard size of a toolbar button and also return the size of - // a toolbar separator in the provided pointer - virtual wxSize GetToolBarButtonSize(wxCoord *separator) const = 0; - - // get the margins between/around the toolbar buttons - virtual wxSize GetToolBarMargin() const = 0; -#endif // wxUSE_TOOLBAR - -#if wxUSE_TEXTCTRL - // convert between text rectangle and client rectangle for text controls: - // the former is typicall smaller to leave margins around text - virtual wxRect GetTextTotalArea(const wxTextCtrl *text, - const wxRect& rectText) const = 0; - - // extra space is for line indicators - virtual wxRect GetTextClientArea(const wxTextCtrl *text, - const wxRect& rectTotal, - wxCoord *extraSpaceBeyond) const = 0; -#endif // wxUSE_TEXTCTRL - -#if wxUSE_NOTEBOOK - // get the overhang of a selected tab - virtual wxSize GetTabIndent() const = 0; - - // get the padding around the text in a tab - virtual wxSize GetTabPadding() const = 0; -#endif // wxUSE_NOTEBOOK - -#if wxUSE_SLIDER - // get the default size of the slider in lesser dimension (i.e. height of a - // horizontal slider or width of a vertical one) - virtual wxCoord GetSliderDim() const = 0; - - // get the length of the slider ticks displayed along side slider - virtual wxCoord GetSliderTickLen() const = 0; - - // get the slider shaft rect from the total slider rect - virtual wxRect GetSliderShaftRect(const wxRect& rect, - int lenThumb, - wxOrientation orient, - long style = 0) const = 0; - - // get the size of the slider thumb for the given total slider rect - virtual wxSize GetSliderThumbSize(const wxRect& rect, - int lenThumb, - wxOrientation orient) const = 0; -#endif // wxUSE_SLIDER - - // get the size of one progress bar step (in horz and vertical directions) - virtual wxSize GetProgressBarStep() const = 0; - -#if wxUSE_MENUS - // get the size of rectangle to use in the menubar for the given text rect - virtual wxSize GetMenuBarItemSize(const wxSize& sizeText) const = 0; - - // get the struct storing all layout info needed to draw all menu items - // (this can't be calculated for each item separately as they should be - // aligned) - // - // the returned pointer must be deleted by the caller - virtual wxMenuGeometryInfo *GetMenuGeometry(wxWindow *win, - const wxMenu& menu) const = 0; -#endif // wxUSE_MENUS - -#if wxUSE_STATUSBAR - // get the borders around the status bar fields (x and y fields of the - // return value) - virtual wxSize GetStatusBarBorders() const = 0; - - // get the border between the status bar fields - virtual wxCoord GetStatusBarBorderBetweenFields() const = 0; - - // get the mergin between a field and its border - virtual wxSize GetStatusBarFieldMargins() const = 0; -#endif // wxUSE_STATUSBAR - - // get client area rectangle of top level window (i.e. subtract - // decorations from given rectangle) - virtual wxRect GetFrameClientArea(const wxRect& rect, int flags) const = 0; - - // get size of whole top level window, given size of its client area size - virtual wxSize GetFrameTotalSize(const wxSize& clientSize, int flags) const = 0; - - // get the minimal size of top level window - virtual wxSize GetFrameMinSize(int flags) const = 0; - - // get titlebar icon size - virtual wxSize GetFrameIconSize() const = 0; - - // returns one of wxHT_TOPLEVEL_XXX constants - virtual int HitTestFrame(const wxRect& rect, - const wxPoint& pt, - int flags = 0) const = 0; - - // virtual dtor for any base class - virtual ~wxRenderer(); -}; - -// ---------------------------------------------------------------------------- -// wxDelegateRenderer: it is impossible to inherit from any of standard -// renderers as their declarations are in private code, but you can use this -// class to override only some of the Draw() functions - all the other ones -// will be left to the original renderer -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxDelegateRenderer : public wxRenderer -{ -public: - wxDelegateRenderer(wxRenderer *renderer) : m_renderer(renderer) { } - - virtual void DrawBackground(wxDC& dc, - const wxColour& col, - const wxRect& rect, - int flags, - wxWindow *window = NULL ) - { m_renderer->DrawBackground(dc, col, rect, flags, window ); } - virtual void DrawButtonSurface(wxDC& dc, - const wxColour& col, - const wxRect& rect, - int flags) - { m_renderer->DrawButtonSurface(dc, col, rect, flags); } - virtual void DrawFocusRect(wxDC& dc, const wxRect& rect, int flags = 0) - { m_renderer->DrawFocusRect(dc, rect, flags); } - virtual void DrawLabel(wxDC& dc, - const wxString& label, - const wxRect& rect, - int flags = 0, - int align = wxALIGN_LEFT | wxALIGN_TOP, - int indexAccel = -1, - wxRect *rectBounds = NULL) - { m_renderer->DrawLabel(dc, label, rect, - flags, align, indexAccel, rectBounds); } - virtual void DrawButtonLabel(wxDC& dc, - const wxString& label, - const wxBitmap& image, - const wxRect& rect, - int flags = 0, - int align = wxALIGN_LEFT | wxALIGN_TOP, - int indexAccel = -1, - wxRect *rectBounds = NULL) - { m_renderer->DrawButtonLabel(dc, label, image, rect, - flags, align, indexAccel, rectBounds); } - virtual void DrawBorder(wxDC& dc, - wxBorder border, - const wxRect& rect, - int flags = 0, - wxRect *rectIn = (wxRect *)NULL) - { m_renderer->DrawBorder(dc, border, rect, flags, rectIn); } - virtual void DrawTextBorder(wxDC& dc, - wxBorder border, - const wxRect& rect, - int flags = 0, - wxRect *rectIn = (wxRect *)NULL) - { m_renderer->DrawTextBorder(dc, border, rect, flags, rectIn); } - virtual void DrawButtonBorder(wxDC& dc, - const wxRect& rect, - int flags = 0, - wxRect *rectIn = (wxRect *)NULL) - { m_renderer->DrawButtonBorder(dc, rect, flags, rectIn); } - virtual void DrawFrame(wxDC& dc, - const wxString& label, - const wxRect& rect, - int flags = 0, - int align = wxALIGN_LEFT, - int indexAccel = -1) - { m_renderer->DrawFrame(dc, label, rect, flags, align, indexAccel); } - virtual void DrawHorizontalLine(wxDC& dc, - wxCoord y, wxCoord x1, wxCoord x2) - { m_renderer->DrawHorizontalLine(dc, y, x1, x2); } - virtual void DrawVerticalLine(wxDC& dc, - wxCoord x, wxCoord y1, wxCoord y2) - { m_renderer->DrawVerticalLine(dc, x, y1, y2); } - virtual void DrawArrow(wxDC& dc, - wxDirection dir, - const wxRect& rect, - int flags = 0) - { m_renderer->DrawArrow(dc, dir, rect, flags); } - virtual void DrawScrollbarArrow(wxDC& dc, - wxDirection dir, - const wxRect& rect, - int flags = 0) - { m_renderer->DrawScrollbarArrow(dc, dir, rect, flags); } - virtual void DrawScrollbarThumb(wxDC& dc, - wxOrientation orient, - const wxRect& rect, - int flags = 0) - { m_renderer->DrawScrollbarThumb(dc, orient, rect, flags); } - virtual void DrawScrollbarShaft(wxDC& dc, - wxOrientation orient, - const wxRect& rect, - int flags = 0) - { m_renderer->DrawScrollbarShaft(dc, orient, rect, flags); } - virtual void DrawScrollCorner(wxDC& dc, - const wxRect& rect) - { m_renderer->DrawScrollCorner(dc, rect); } - virtual void DrawItem(wxDC& dc, - const wxString& label, - const wxRect& rect, - int flags = 0) - { m_renderer->DrawItem(dc, label, rect, flags); } - virtual void DrawCheckItem(wxDC& dc, - const wxString& label, - const wxBitmap& bitmap, - const wxRect& rect, - int flags = 0) - { m_renderer->DrawCheckItem(dc, label, bitmap, rect, flags); } - virtual void DrawCheckButton(wxDC& dc, - const wxString& label, - const wxBitmap& bitmap, - const wxRect& rect, - int flags = 0, - wxAlignment align = wxALIGN_LEFT, - int indexAccel = -1) - { m_renderer->DrawCheckButton(dc, label, bitmap, rect, - flags, align, indexAccel); } - virtual void DrawRadioButton(wxDC& dc, - const wxString& label, - const wxBitmap& bitmap, - const wxRect& rect, - int flags = 0, - wxAlignment align = wxALIGN_LEFT, - int indexAccel = -1) - { m_renderer->DrawRadioButton(dc, label, bitmap, rect, - flags, align, indexAccel); } -#if wxUSE_TOOLBAR - virtual void DrawToolBarButton(wxDC& dc, - const wxString& label, - const wxBitmap& bitmap, - const wxRect& rect, - int flags = 0, - long style = 0, - int tbarStyle = 0) - { m_renderer->DrawToolBarButton(dc, label, bitmap, rect, flags, style, tbarStyle); } -#endif // wxUSE_TOOLBAR - -#if wxUSE_TEXTCTRL - virtual void DrawTextLine(wxDC& dc, - const wxString& text, - const wxRect& rect, - int selStart = -1, - int selEnd = -1, - int flags = 0) - { m_renderer->DrawTextLine(dc, text, rect, selStart, selEnd, flags); } - virtual void DrawLineWrapMark(wxDC& dc, const wxRect& rect) - { m_renderer->DrawLineWrapMark(dc, rect); } -#endif // wxUSE_TEXTCTRL - -#if wxUSE_NOTEBOOK - virtual void DrawTab(wxDC& dc, - const wxRect& rect, - wxDirection dir, - const wxString& label, - const wxBitmap& bitmap = wxNullBitmap, - int flags = 0, - int accel = -1) - { m_renderer->DrawTab(dc, rect, dir, label, bitmap, flags, accel); } -#endif // wxUSE_NOTEBOOK - -#if wxUSE_SLIDER - - virtual void DrawSliderShaft(wxDC& dc, - const wxRect& rect, - int lenThumb, - wxOrientation orient, - int flags = 0, - long style = 0, - wxRect *rectShaft = NULL) - { m_renderer->DrawSliderShaft(dc, rect, lenThumb, orient, flags, style, rectShaft); } - virtual void DrawSliderThumb(wxDC& dc, - const wxRect& rect, - wxOrientation orient, - int flags = 0, - long style = 0) - { m_renderer->DrawSliderThumb(dc, rect, orient, flags, style); } - virtual void DrawSliderTicks(wxDC& dc, - const wxRect& rect, - int lenThumb, - wxOrientation orient, - int start, - int end, - int WXUNUSED(step) = 1, - int flags = 0, - long style = 0) - { m_renderer->DrawSliderTicks(dc, rect, lenThumb, orient, - start, end, start, flags, style); } -#endif // wxUSE_SLIDER - -#if wxUSE_MENUS - virtual void DrawMenuBarItem(wxDC& dc, - const wxRect& rect, - const wxString& label, - int flags = 0, - int indexAccel = -1) - { m_renderer->DrawMenuBarItem(dc, rect, label, flags, indexAccel); } - virtual void DrawMenuItem(wxDC& dc, - wxCoord y, - const wxMenuGeometryInfo& gi, - const wxString& label, - const wxString& accel, - const wxBitmap& bitmap = wxNullBitmap, - int flags = 0, - int indexAccel = -1) - { m_renderer->DrawMenuItem(dc, y, gi, label, accel, - bitmap, flags, indexAccel); } - virtual void DrawMenuSeparator(wxDC& dc, - wxCoord y, - const wxMenuGeometryInfo& geomInfo) - { m_renderer->DrawMenuSeparator(dc, y, geomInfo); } -#endif // wxUSE_MENUS - -#if wxUSE_STATUSBAR - virtual void DrawStatusField(wxDC& dc, - const wxRect& rect, - const wxString& label, - int flags = 0, int style = 0) - { m_renderer->DrawStatusField(dc, rect, label, flags, style); } -#endif // wxUSE_STATUSBAR - - virtual void DrawFrameTitleBar(wxDC& dc, - const wxRect& rect, - const wxString& title, - const wxIcon& icon, - int flags, - int specialButton = 0, - int specialButtonFlag = 0) - { m_renderer->DrawFrameTitleBar(dc, rect, title, icon, flags, - specialButton, specialButtonFlag); } - virtual void DrawFrameBorder(wxDC& dc, - const wxRect& rect, - int flags) - { m_renderer->DrawFrameBorder(dc, rect, flags); } - virtual void DrawFrameBackground(wxDC& dc, - const wxRect& rect, - int flags) - { m_renderer->DrawFrameBackground(dc, rect, flags); } - virtual void DrawFrameTitle(wxDC& dc, - const wxRect& rect, - const wxString& title, - int flags) - { m_renderer->DrawFrameTitle(dc, rect, title, flags); } - virtual void DrawFrameIcon(wxDC& dc, - const wxRect& rect, - const wxIcon& icon, - int flags) - { m_renderer->DrawFrameIcon(dc, rect, icon, flags); } - virtual void DrawFrameButton(wxDC& dc, - wxCoord x, wxCoord y, - int button, - int flags = 0) - { m_renderer->DrawFrameButton(dc, x, y, button, flags); } - -#if wxUSE_COMBOBOX - virtual void GetComboBitmaps(wxBitmap *bmpNormal, - wxBitmap *bmpFocus, - wxBitmap *bmpPressed, - wxBitmap *bmpDisabled) - { m_renderer->GetComboBitmaps(bmpNormal, bmpFocus, - bmpPressed, bmpDisabled); } -#endif // wxUSE_COMBOBOX - - virtual void AdjustSize(wxSize *size, const wxWindow *window) - { m_renderer->AdjustSize(size, window); } - virtual wxRect GetBorderDimensions(wxBorder border) const - { return m_renderer->GetBorderDimensions(border); } - virtual bool AreScrollbarsInsideBorder() const - { return m_renderer->AreScrollbarsInsideBorder(); } - -#if wxUSE_SCROLLBAR - virtual wxSize GetScrollbarArrowSize() const - { return m_renderer->GetScrollbarArrowSize(); } -#endif // wxUSE_SCROLLBAR - - virtual wxCoord GetListboxItemHeight(wxCoord fontHeight) - { return m_renderer->GetListboxItemHeight(fontHeight); } - virtual wxSize GetCheckBitmapSize() const - { return m_renderer->GetCheckBitmapSize(); } - virtual wxSize GetRadioBitmapSize() const - { return m_renderer->GetRadioBitmapSize(); } - virtual wxCoord GetCheckItemMargin() const - { return m_renderer->GetCheckItemMargin(); } - -#if wxUSE_TOOLBAR - virtual wxSize GetToolBarButtonSize(wxCoord *separator) const - { return m_renderer->GetToolBarButtonSize(separator); } - virtual wxSize GetToolBarMargin() const - { return m_renderer->GetToolBarMargin(); } -#endif // wxUSE_TOOLBAR - -#if wxUSE_TEXTCTRL - virtual wxRect GetTextTotalArea(const wxTextCtrl *text, - const wxRect& rect) const - { return m_renderer->GetTextTotalArea(text, rect); } - virtual wxRect GetTextClientArea(const wxTextCtrl *text, - const wxRect& rect, - wxCoord *extraSpaceBeyond) const - { return m_renderer->GetTextClientArea(text, rect, extraSpaceBeyond); } -#endif // wxUSE_TEXTCTRL - -#if wxUSE_NOTEBOOK - virtual wxSize GetTabIndent() const { return m_renderer->GetTabIndent(); } - virtual wxSize GetTabPadding() const { return m_renderer->GetTabPadding(); } -#endif // wxUSE_NOTEBOOK - -#if wxUSE_SLIDER - virtual wxCoord GetSliderDim() const - { return m_renderer->GetSliderDim(); } - virtual wxCoord GetSliderTickLen() const - { return m_renderer->GetSliderTickLen(); } - - virtual wxRect GetSliderShaftRect(const wxRect& rect, - int lenThumb, - wxOrientation orient, - long style = 0) const - { return m_renderer->GetSliderShaftRect(rect, lenThumb, orient, style); } - virtual wxSize GetSliderThumbSize(const wxRect& rect, - int lenThumb, - wxOrientation orient) const - { return m_renderer->GetSliderThumbSize(rect, lenThumb, orient); } -#endif // wxUSE_SLIDER - - virtual wxSize GetProgressBarStep() const - { return m_renderer->GetProgressBarStep(); } - -#if wxUSE_MENUS - virtual wxSize GetMenuBarItemSize(const wxSize& sizeText) const - { return m_renderer->GetMenuBarItemSize(sizeText); } - virtual wxMenuGeometryInfo *GetMenuGeometry(wxWindow *win, - const wxMenu& menu) const - { return m_renderer->GetMenuGeometry(win, menu); } -#endif // wxUSE_MENUS - -#if wxUSE_STATUSBAR - virtual wxSize GetStatusBarBorders() const - { return m_renderer->GetStatusBarBorders(); } - virtual wxCoord GetStatusBarBorderBetweenFields() const - { return m_renderer->GetStatusBarBorderBetweenFields(); } - virtual wxSize GetStatusBarFieldMargins() const - { return m_renderer->GetStatusBarFieldMargins(); } -#endif // wxUSE_STATUSBAR - - virtual wxRect GetFrameClientArea(const wxRect& rect, int flags) const - { return m_renderer->GetFrameClientArea(rect, flags); } - virtual wxSize GetFrameTotalSize(const wxSize& clientSize, int flags) const - { return m_renderer->GetFrameTotalSize(clientSize, flags); } - virtual wxSize GetFrameMinSize(int flags) const - { return m_renderer->GetFrameMinSize(flags); } - virtual wxSize GetFrameIconSize() const - { return m_renderer->GetFrameIconSize(); } - virtual int HitTestFrame(const wxRect& rect, - const wxPoint& pt, - int flags) const - { return m_renderer->HitTestFrame(rect, pt, flags); } - - virtual int DrawHeaderButton(wxWindow *win, - wxDC& dc, - const wxRect& rect, - int flags = 0, - wxHeaderSortIconType sortIcon = wxHDR_SORT_ICON_NONE, - wxHeaderButtonParams* params = NULL) - { return m_renderer->DrawHeaderButton(win, dc, rect, flags, sortIcon, params); } - virtual void DrawTreeItemButton(wxWindow *win, - wxDC& dc, - const wxRect& rect, - int flags = 0) - { m_renderer->DrawTreeItemButton(win, dc, rect, flags); } - -protected: - wxRenderer *m_renderer; -}; - -// ---------------------------------------------------------------------------- -// wxControlRenderer: wraps the wxRenderer functions in a form easy to use from -// OnPaint() -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxControlRenderer -{ -public: - // create a renderer for this dc with this "fundamental" renderer - wxControlRenderer(wxWindow *control, wxDC& dc, wxRenderer *renderer); - - // operations - void DrawLabel(const wxBitmap& bitmap = wxNullBitmap, - wxCoord marginX = 0, wxCoord marginY = 0); -#if wxUSE_LISTBOX - void DrawItems(const wxListBox *listbox, - size_t itemFirst, size_t itemLast); -#endif // wxUSE_LISTBOX -#if wxUSE_CHECKLISTBOX - void DrawCheckItems(const wxCheckListBox *listbox, - size_t itemFirst, size_t itemLast); -#endif // wxUSE_CHECKLISTBOX - void DrawButtonBorder(); - // the line must be either horizontal or vertical - void DrawLine(wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2); - void DrawFrame(); - void DrawBitmap(const wxBitmap& bitmap); - void DrawBackgroundBitmap(); - void DrawScrollbar(const wxScrollBar *scrollbar, int thumbPosOld); -#if wxUSE_GAUGE - void DrawProgressBar(const wxGauge *gauge); -#endif // wxUSE_GAUGE - - // accessors - wxWindow *GetWindow() const { return m_window; } - wxRenderer *GetRenderer() const { return m_renderer; } - - wxDC& GetDC() { return m_dc; } - - const wxRect& GetRect() const { return m_rect; } - wxRect& GetRect() { return m_rect; } - - // static helpers - static void DrawBitmap(wxDC &dc, - const wxBitmap& bitmap, - const wxRect& rect, - int alignment = wxALIGN_CENTRE | - wxALIGN_CENTRE_VERTICAL, - wxStretch stretch = wxSTRETCH_NOT); - -private: - -#if wxUSE_LISTBOX - // common part of DrawItems() and DrawCheckItems() - void DoDrawItems(const wxListBox *listbox, - size_t itemFirst, size_t itemLast, - bool isCheckLbox = false); -#endif // wxUSE_LISTBOX - - wxWindow *m_window; - wxRenderer *m_renderer; - wxDC& m_dc; - wxRect m_rect; -}; - -#endif // _WX_UNIV_RENDERER_H_ diff --git a/wxWidgets/include/wx/univ/scrarrow.h b/wxWidgets/include/wx/univ/scrarrow.h deleted file mode 100644 index affeeff237..0000000000 --- a/wxWidgets/include/wx/univ/scrarrow.h +++ /dev/null @@ -1,112 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: wx/univ/scrarrow.h -// Purpose: wxScrollArrows class -// Author: Vadim Zeitlin -// Modified by: -// Created: 22.01.01 -// RCS-ID: $Id: scrarrow.h 42715 2006-10-30 12:24:13Z VS $ -// Copyright: (c) 2001 SciTech Software, Inc. (www.scitechsoft.com) -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_UNIV_SCRARROW_H_ -#define _WX_UNIV_SCRARROW_H_ - -// ---------------------------------------------------------------------------- -// wxScrollArrows is not a control but just a class containing the common -// functionality of scroll arrows, whether part of scrollbars, spin ctrls or -// anything else. -// -// To customize its behaviour, wxScrollArrows doesn't use any virtual methods -// but instead a callback pointer to a wxControlWithArrows object which is used -// for all control-dependent stuff. Thus, to use wxScrollArrows, you just need -// to derive from the wxControlWithArrows interface and implement its methods. -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxControlWithArrows; -class WXDLLEXPORT wxDC; -class WXDLLEXPORT wxMouseEvent; -class WXDLLEXPORT wxRect; -class WXDLLEXPORT wxRenderer; - -// ---------------------------------------------------------------------------- -// wxScrollArrows: an abstraction of scrollbar arrow -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxScrollArrows -{ -public: - enum Arrow - { - Arrow_None = -1, - Arrow_First, // left or top - Arrow_Second, // right or bottom - Arrow_Max - }; - - // ctor requires a back pointer to wxControlWithArrows - wxScrollArrows(wxControlWithArrows *control); - - // draws the arrow on the given DC in the given rectangle, uses - // wxControlWithArrows::GetArrowState() to get its current state - void DrawArrow(Arrow arrow, wxDC& dc, const wxRect& rect, - bool scrollbarLike = false) const; - - // process a mouse move, enter or leave event, possibly calling - // wxControlWithArrows::SetArrowState() if - // wxControlWithArrows::HitTestArrow() says that the mouse has left/entered - // an arrow - bool HandleMouseMove(const wxMouseEvent& event) const; - - // process a mouse click event - bool HandleMouse(const wxMouseEvent& event) const; - - // dtor - ~wxScrollArrows(); - -private: - // set or clear the wxCONTROL_CURRENT flag for the arrow - void UpdateCurrentFlag(Arrow arrow, Arrow arrowCur) const; - - // the main control - wxControlWithArrows *m_control; - - // the data for the mouse capture - struct wxScrollArrowCaptureData *m_captureData; -}; - -// ---------------------------------------------------------------------------- -// wxControlWithArrows: interface implemented by controls using wxScrollArrows -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxControlWithArrows -{ -public: - virtual ~wxControlWithArrows() {} - - // get the renderer to use for drawing the arrows - virtual wxRenderer *GetRenderer() const = 0; - - // get the controls window (used for mouse capturing) - virtual wxWindow *GetWindow() = 0; - - // get the orientation of the arrows (vertical or horizontal) - virtual bool IsVertical() const = 0; - - // get the state of this arrow as combination of wxCONTROL_XXX flags - virtual int GetArrowState(wxScrollArrows::Arrow arrow) const = 0; - - // set or clear the specified flag in the arrow state: this function is - // responsible for refreshing the control - virtual void SetArrowFlag(wxScrollArrows::Arrow arrow, - int flag, bool set = true) = 0; - - // hit testing: return on which arrow the point is (or Arrow_None) - virtual wxScrollArrows::Arrow HitTestArrow(const wxPoint& pt) const = 0; - - // called when the arrow is pressed, return true to continue scrolling and - // false to stop it - virtual bool OnArrow(wxScrollArrows::Arrow arrow) = 0; -}; - -#endif // _WX_UNIV_SCRARROW_H_ diff --git a/wxWidgets/include/wx/univ/scrolbar.h b/wxWidgets/include/wx/univ/scrolbar.h deleted file mode 100644 index a75dc588f0..0000000000 --- a/wxWidgets/include/wx/univ/scrolbar.h +++ /dev/null @@ -1,283 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: wx/univ/scrolbar.h -// Purpose: wxScrollBar for wxUniversal -// Author: Vadim Zeitlin -// Modified by: -// Created: 20.08.00 -// RCS-ID: $Id: scrolbar.h 61872 2009-09-09 22:37:05Z VZ $ -// Copyright: (c) 2000 SciTech Software, Inc. (www.scitechsoft.com) -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_UNIV_SCROLBAR_H_ -#define _WX_UNIV_SCROLBAR_H_ - -class WXDLLEXPORT wxScrollTimer; - -#include "wx/univ/scrarrow.h" -#include "wx/renderer.h" - -// ---------------------------------------------------------------------------- -// the actions supported by this control -// ---------------------------------------------------------------------------- - -// scroll the bar -#define wxACTION_SCROLL_START wxT("start") // to the beginning -#define wxACTION_SCROLL_END wxT("end") // to the end -#define wxACTION_SCROLL_LINE_UP wxT("lineup") // one line up/left -#define wxACTION_SCROLL_PAGE_UP wxT("pageup") // one page up/left -#define wxACTION_SCROLL_LINE_DOWN wxT("linedown") // one line down/right -#define wxACTION_SCROLL_PAGE_DOWN wxT("pagedown") // one page down/right - -// the scrollbar thumb may be dragged -#define wxACTION_SCROLL_THUMB_DRAG wxT("thumbdrag") -#define wxACTION_SCROLL_THUMB_MOVE wxT("thumbmove") -#define wxACTION_SCROLL_THUMB_RELEASE wxT("thumbrelease") - -// ---------------------------------------------------------------------------- -// wxScrollBar -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxScrollBar : public wxScrollBarBase, - public wxControlWithArrows -{ -public: - // scrollbar elements: they correspond to wxHT_SCROLLBAR_XXX constants but - // start from 0 which allows to use them as array indices - enum Element - { - Element_Arrow_Line_1, - Element_Arrow_Line_2, - Element_Arrow_Page_1, - Element_Arrow_Page_2, - Element_Thumb, - Element_Bar_1, - Element_Bar_2, - Element_Max - }; - - wxScrollBar(); - 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); - - 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); - - virtual ~wxScrollBar(); - - // implement base class pure virtuals - virtual int GetThumbPosition() const; - virtual int GetThumbSize() const; - virtual int GetPageSize() const; - virtual int GetRange() const; - - virtual void SetThumbPosition(int thumbPos); - virtual void SetScrollbar(int position, int thumbSize, - int range, int pageSize, - bool refresh = true); - - // wxScrollBar actions - void ScrollToStart(); - void ScrollToEnd(); - bool ScrollLines(int nLines); - bool ScrollPages(int nPages); - - virtual bool PerformAction(const wxControlAction& action, - long numArg = 0, - const wxString& strArg = wxEmptyString); - - static wxInputHandler *GetStdInputHandler(wxInputHandler *handlerDef); - virtual wxInputHandler *DoGetStdInputHandler(wxInputHandler *handlerDef) - { - return GetStdInputHandler(handlerDef); - } - - // scrollbars around a normal window should not receive the focus - virtual bool AcceptsFocus() const; - - // wxScrollBar sub elements state (combination of wxCONTROL_XXX) - void SetState(Element which, int flags); - int GetState(Element which) const; - - // implement wxControlWithArrows methods - virtual wxRenderer *GetRenderer() const { return m_renderer; } - virtual wxWindow *GetWindow() { return this; } - virtual bool IsVertical() const { return wxScrollBarBase::IsVertical(); } - virtual int GetArrowState(wxScrollArrows::Arrow arrow) const; - virtual void SetArrowFlag(wxScrollArrows::Arrow arrow, int flag, bool set); - virtual bool OnArrow(wxScrollArrows::Arrow arrow); - virtual wxScrollArrows::Arrow HitTestArrow(const wxPoint& pt) const; - - // for wxControlRenderer::DrawScrollbar() only - const wxScrollArrows& GetArrows() const { return m_arrows; } - - // returns one of wxHT_SCROLLBAR_XXX constants - wxHitTest HitTestBar(const wxPoint& pt) const; - - // idle processing - virtual void OnInternalIdle(); - -protected: - virtual wxSize DoGetBestClientSize() const; - virtual void DoDraw(wxControlRenderer *renderer); - virtual wxBorder GetDefaultBorder() const { return wxBORDER_NONE; } - - // forces update of thumb's visual appearence (does nothing if m_dirty=false) - void UpdateThumb(); - - // SetThumbPosition() helper - void DoSetThumb(int thumbPos); - - // common part of all ctors - void Init(); - - // is this scrollbar attached to a window or a standalone control? - bool IsStandalone() const; - - // scrollbar geometry methods: - - // gets the bounding box for a scrollbar element for the given (by default - // - current) thumb position - wxRect GetScrollbarRect(wxScrollBar::Element elem, int thumbPos = -1) const; - - // returns the size of the scrollbar shaft excluding the arrows - wxCoord GetScrollbarSize() const; - - // translate the scrollbar position (in logical units) into physical - // coordinate (in pixels) and the other way round - wxCoord ScrollbarToPixel(int thumbPos = -1); - int PixelToScrollbar(wxCoord coord); - - // return the starting and ending positions, in pixels, of the thumb of a - // scrollbar with the given logical position, thumb size and range and the - // given physical length - static void GetScrollBarThumbSize(wxCoord length, - int thumbPos, - int thumbSize, - int range, - wxCoord *thumbStart, - wxCoord *thumbEnd); - -private: - // total range of the scrollbar in logical units - int m_range; - - // the current and previous (after last refresh - this is used for - // repainting optimisation) size of the thumb in logical units (from 0 to - // m_range) and its position (from 0 to m_range - m_thumbSize) - int m_thumbSize, - m_thumbPos, - m_thumbPosOld; - - // the page size, i.e. the number of lines by which to scroll when page - // up/down action is performed - int m_pageSize; - - // the state of the sub elements - int m_elementsState[Element_Max]; - - // the dirty flag: if set, scrollbar must be updated - bool m_dirty; - - // the object handling the arrows - wxScrollArrows m_arrows; - - friend WXDLLEXPORT class wxControlRenderer; // for geometry methods - friend class wxStdScrollBarInputHandler; // for geometry methods - - DECLARE_EVENT_TABLE() - DECLARE_DYNAMIC_CLASS(wxScrollBar) -}; - -// ---------------------------------------------------------------------------- -// Standard scrollbar input handler which can be used as a base class -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxStdScrollBarInputHandler : public wxStdInputHandler -{ -public: - // constructor takes a renderer (used for scrollbar hit testing) and the - // base handler to which all unhandled events are forwarded - wxStdScrollBarInputHandler(wxRenderer *renderer, - wxInputHandler *inphand); - - virtual bool HandleKey(wxInputConsumer *consumer, - const wxKeyEvent& event, - bool pressed); - virtual bool HandleMouse(wxInputConsumer *consumer, - const wxMouseEvent& event); - virtual bool HandleMouseMove(wxInputConsumer *consumer, const wxMouseEvent& event); - - virtual ~wxStdScrollBarInputHandler(); - - // this method is called by wxScrollBarTimer only and may be overridden - // - // return true to continue scrolling, false to stop the timer - virtual bool OnScrollTimer(wxScrollBar *scrollbar, - const wxControlAction& action); - -protected: - // return true if the mouse button can be used to activate scrollbar, false - // if not (any button under GTK+ unlike left button only which is default) - virtual bool IsAllowedButton(int button) const - { return button == wxMOUSE_BTN_LEFT; } - - // set or clear the specified flag on the scrollbar element corresponding - // to m_htLast - void SetElementState(wxScrollBar *scrollbar, int flag, bool doIt); - - // [un]highlight the scrollbar element corresponding to m_htLast - virtual void Highlight(wxScrollBar *scrollbar, bool doIt) - { SetElementState(scrollbar, wxCONTROL_CURRENT, doIt); } - - // [un]press the scrollbar element corresponding to m_htLast - virtual void Press(wxScrollBar *scrollbar, bool doIt) - { SetElementState(scrollbar, wxCONTROL_PRESSED, doIt); } - - // stop scrolling because we reached the end point - void StopScrolling(wxScrollBar *scrollbar); - - // get the mouse coordinates in the scrollbar direction from the event - wxCoord GetMouseCoord(const wxScrollBar *scrollbar, - const wxMouseEvent& event) const; - - // generate a "thumb move" action for this mouse event - void HandleThumbMove(wxScrollBar *scrollbar, const wxMouseEvent& event); - - - // the window (scrollbar) which has capture or NULL and the flag telling if - // the mouse is inside the element which captured it or not - wxWindow *m_winCapture; - bool m_winHasMouse; - int m_btnCapture; // the mouse button which has captured mouse - - // the position where we started scrolling by page - wxPoint m_ptStartScrolling; - - // one of wxHT_SCROLLBAR_XXX value: where has the mouse been last time? - wxHitTest m_htLast; - - // the renderer (we use it only for hit testing) - wxRenderer *m_renderer; - - // the offset of the top/left of the scrollbar relative to the mouse to - // keep during the thumb drag - int m_ofsMouse; - - // the timer for generating scroll events when the mouse stays pressed on - // a scrollbar - wxScrollTimer *m_timerScroll; -}; - -#endif // _WX_UNIV_SCROLBAR_H_ - diff --git a/wxWidgets/include/wx/univ/scrthumb.h b/wxWidgets/include/wx/univ/scrthumb.h deleted file mode 100644 index 91d2a0c09f..0000000000 --- a/wxWidgets/include/wx/univ/scrthumb.h +++ /dev/null @@ -1,140 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: wx/univ/scrthumb.h -// Purpose: wxScrollThumb class -// Author: Vadim Zeitlin -// Modified by: -// Created: 12.02.01 -// RCS-ID: $Id: scrthumb.h 37168 2006-01-26 19:35:32Z ABX $ -// Copyright: (c) 2001 SciTech Software, Inc. (www.scitechsoft.com) -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_UNIV_SCRTHUMB_H_ -#define _WX_UNIV_SCRTHUMB_H_ - -// ---------------------------------------------------------------------------- -// wxScrollThumb is not a control but just a class containing the common -// functionality of scroll thumb such as used by scrollbars, sliders and maybe -// other (user) controls -// -// This class is similar to wxScrollThumb. -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxControlWithThumb; -class WXDLLEXPORT wxMouseEvent; -class WXDLLEXPORT wxRect; -class WXDLLEXPORT wxScrollTimer; - -#include "wx/timer.h" - -// ---------------------------------------------------------------------------- -// wxScrollThumb: an abstraction of scrollbar thumb -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxScrollThumb -{ -public: - enum Shaft - { - Shaft_None = -1, - Shaft_Above, // or to the left of the thumb - Shaft_Below, // or to the right of the thumb - Shaft_Thumb, // on the thumb - Shaft_Max - }; - - // ctor requires a back pointer to wxControlWithThumb - wxScrollThumb(wxControlWithThumb *control); - - // process a mouse click: will capture the mouse if the button was pressed - // on either the thumb (start dragging it then) or the shaft (start - // scrolling) - bool HandleMouse(const wxMouseEvent& event) const; - - // process a mouse move - bool HandleMouseMove(const wxMouseEvent& event) const; - - // dtor - ~wxScrollThumb(); - -private: - // do we have the mouse capture? - bool HasCapture() const { return m_captureData != NULL; } - - // get the coord of this event in the direction we're interested in (y for - // vertical shaft or x for horizontal ones) - wxCoord GetMouseCoord(const wxMouseEvent& event) const; - - // get the position of the thumb corresponding to the current mouse - // position (can only be called while we're dragging the thumb!) - int GetThumbPos(const wxMouseEvent& event) const; - - // the main control - wxControlWithThumb *m_control; - - // the part of it where the mouse currently is - Shaft m_shaftPart; - - // the data for the mouse capture - struct WXDLLEXPORT wxScrollThumbCaptureData *m_captureData; -}; - -// ---------------------------------------------------------------------------- -// wxControlWithThumb: interface implemented by controls using wxScrollThumb -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxControlWithThumb -{ -public: - virtual ~wxControlWithThumb() {} - - // simple accessors - // ---------------- - - // get the controls window (used for mouse capturing) - virtual wxWindow *GetWindow() = 0; - - // get the orientation of the shaft (vertical or horizontal) - virtual bool IsVertical() const = 0; - - // geometry functions - // ------------------ - - // hit testing: return part of the shaft the point is in (or Shaft_None) - virtual wxScrollThumb::Shaft HitTest(const wxPoint& pt) const = 0; - - // get the current position in pixels of the thumb - virtual wxCoord ThumbPosToPixel() const = 0; - - // transform from pixel offset to the thumb logical position - virtual int PixelToThumbPos(wxCoord x) const = 0; - - // callbacks - // --------- - - // set or clear the specified flag in the arrow state: this function is - // responsible for refreshing the control - virtual void SetShaftPartState(wxScrollThumb::Shaft shaftPart, - int flag, - bool set = true) = 0; - - // called when the user starts dragging the thumb - virtual void OnThumbDragStart(int pos) = 0; - - // called while the user drags the thumb - virtual void OnThumbDrag(int pos) = 0; - - // called when the user stops dragging the thumb - virtual void OnThumbDragEnd(int pos) = 0; - - // called before starting to call OnPageScroll() - gives the control the - // possibility to remember its current state - virtual void OnPageScrollStart() = 0; - - // called while the user keeps the mouse pressed above/below the thumb, - // return true to continue scrollign and false to stop it (e.g. because the - // scrollbar has reached the top/bottom) - virtual bool OnPageScroll(int pageInc) = 0; -}; - -#endif // _WX_UNIV_SCRTHUMB_H_ diff --git a/wxWidgets/include/wx/univ/scrtimer.h b/wxWidgets/include/wx/univ/scrtimer.h deleted file mode 100644 index 36799ac282..0000000000 --- a/wxWidgets/include/wx/univ/scrtimer.h +++ /dev/null @@ -1,51 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: wx/univ/scrtimer.h -// Purpose: wxScrollTimer: small helper class for wxScrollArrow/Thumb -// Author: Vadim Zeitlin -// Modified by: -// Created: 18.02.01 -// RCS-ID: $Id: scrtimer.h 39633 2006-06-08 11:25:30Z ABX $ -// Copyright: (c) 2001 SciTech Software, Inc. (www.scitechsoft.com) -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_UNIV_SCRTIMER_H -#define _WX_UNIV_SCRTIMER_H - -// NB: this class is implemented in scrolbar.cpp - -#include "wx/defs.h" - -#if wxUSE_TIMER - -#include "wx/timer.h" - -// ---------------------------------------------------------------------------- -// wxScrollTimer: the timer used when the arrow or scrollbar shaft is kept -// pressed -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxScrollTimer : public wxTimer -{ -public: - // default ctor - wxScrollTimer(); - - // start generating the events - void StartAutoScroll(); - - // the base class method - virtual void Notify(); - -protected: - // to implement in derived classes: perform the scroll action and return - // true to continue scrolling or false to stop - virtual bool DoNotify() = 0; - - // should we skip the next timer event? - bool m_skipNext; -}; - -#endif // wxUSE_TIMER - -#endif // _WX_UNIV_SCRTIMER_H diff --git a/wxWidgets/include/wx/univ/setup.h b/wxWidgets/include/wx/univ/setup.h deleted file mode 100644 index 39b9cba8d5..0000000000 --- a/wxWidgets/include/wx/univ/setup.h +++ /dev/null @@ -1,1328 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: wx/univ/setup.h -// Purpose: configuration settings for wxUniversal/MSW -// Author: Vadim Zeitlin -// Modified by: -// Created: 14.08.00 -// RCS-ID: $Id: setup0.h 49997 2007-11-16 16:14:49Z CE $ -// Copyright: (c) 2000 SciTech Software, Inc. (www.scitechsoft.com) -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_UNIV_SETUP_H_ -#define _WX_UNIV_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.4 API: set it to 1 to -// enable it -// -// Default is 0. -// -// Recommended setting: 0 (please update your code instead!) -#define WXWIN_COMPATIBILITY_2_4 0 - -// This setting determines the compatibility with 2.6 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_6 1 - -// 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 0 - -// ---------------------------------------------------------------------------- -// 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 wxWidgets 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 the normal memory operators. -// -// Default is 0 -// -// Recommended setting: 0 -#ifdef __MWERKS__ - #define wxUSE_DEBUG_CONTEXT 1 -#else - #define wxUSE_DEBUG_CONTEXT 0 -#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 0 -// -// Recommended setting: 1 if you are not using a memory debugging tool, else 0 -#define wxUSE_MEMORY_TRACING 0 - -// 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 / CodeWarrior -// -// 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 wxWidgets 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/XP (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/XP) -#ifndef wxUSE_UNICODE - #define wxUSE_UNICODE 0 -#endif - -// Set wxUSE_UNICODE_MSLU to 1 if you want to compile wxWidgets in Unicode mode -// and be able to run compiled apps under Windows 9x as well as NT/2000/XP. This -// setting enables use of unicows.dll from MSLU (MS Layer for Unicode, see -// http://www.microsoft.com/globaldev/Articles/mslu_announce.asp). Note that you -// will have to modify the makefiles to include unicows.lib import library as the first -// library (if you use MSVC, you can run the makefile with "nmake MSLU=1 UNICODE=1" -// command). -// -// If your compiler doesn't have unicows.lib, you can get a version of it at -// http://libunicows.sourceforge.net -// -// Default is 0 -// -// Recommended setting: 0 -#define wxUSE_UNICODE_MSLU 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 for win32 else 0 -#if defined(__WIN32__) || defined(__WATCOMC__) - #define wxUSE_WCHAR_T 1 -#else - #define wxUSE_WCHAR_T 0 -#endif - -// ---------------------------------------------------------------------------- -// 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 - -// Set wxUSE_STL to 1 to derive wxList(Foo) and wxArray(Foo) from -// std::list<Foo*> and std::vector<Foo*>, with a compatibility interface, -// and for wxHashMap to be implemented with templates. -// -// Default is 0 -// -// Recommended setting: YMMV -#define wxUSE_STL 0 - -// Set wxUSE_EXTENDED_RTTI to 1 to use extended RTTI -// -// Default is 0 -// -// Recommended setting: 0 -#define wxUSE_EXTENDED_RTTI 0 - -// 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 -#define wxUSE_LOGWINDOW 1 - -// Recommended setting: 1 -#define wxUSE_LOGGUI 1 - -// Recommended setting: 1 -#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 wxWidgets streams classes -#define wxUSE_STREAMS 1 - -// Use standard C++ streams if 1. If 0, use wxWin streams implementation. -#ifdef __MWERKS__ - #define wxUSE_STD_IOSTREAM 1 -#else - #define wxUSE_STD_IOSTREAM 0 -#endif - -// Enable conversion to standard C++ string if 1. -// -// Default is 1 for most compilers. -// -// Currently the Digital Mars and Watcom compilers come without standard C++ -// library headers by default, wxUSE_STD_STRING can be set to 1 if you do have -// them (e.g. from STLPort). -// -// VC++ 5.0 does include standard C++ library header, however they produce -// many warnings that can't be turned off when compiled at warning level 4. -#if defined(__DMC__) || defined(__WATCOMC__) \ - || (defined(_MSC_VER) && _MSC_VER < 1200) - #define wxUSE_STD_STRING 0 -#else - #define wxUSE_STD_STRING 1 -#endif - -// Support for positional parameters (e.g. %1$d, %2$s ...) in wxVsnprintf. -// Note that if the system's implementation does not support positional -// parameters, setting this to 1 forces the use of the wxWidgets implementation -// of wxVsnprintf. The standard vsnprintf() supports positional parameters on -// many Unix systems but usually doesn't under Windows. -// -// Positional parameters are very useful when translating a program since using -// them in formatting strings allow translators to correctly reorder the -// translated sentences. -// -// Default is 1 -// -// Recommended setting: 1 if you want to support multiple languages -#define wxUSE_PRINTF_POS_PARAMS 1 - -// ---------------------------------------------------------------------------- -// 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 wxFSVolume class providing access to the configured/active mount points -// -// Default is 1 -// -// Recommended setting: 1 (but may be safely disabled if you don't use it) -#define wxUSE_FSVOLUME 1 - -// Use wxStandardPaths class which allows to retrieve some standard locations -// in the file system -// -// Default is 1 -// -// Recommended setting: 1 (may be disabled to save space, but not much) -#define wxUSE_STDPATHS 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 - -// wxUSE_TIMEDATE enables compilation of the old wxDate and wxTime classes (not -// the same as wxDateTime!). These classes are obsolete and shouldn't be used -// in new code -// -// Default is 0 -// -// Recommended setting: 0 unless you have legacy code which uses these classes -#define wxUSE_TIMEDATE 0 - -// 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: 0 (universal should not use native) -#if defined(__WIN32__) - #define wxUSE_CONFIG_NATIVE 0 -#else - #define wxUSE_CONFIG_NATIVE 0 -#endif - -// 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 -#if defined(__WIN32__) - #define wxUSE_DIALUP_MANAGER 1 -#else - #define wxUSE_DIALUP_MANAGER 0 -#endif - -// 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 -#if defined(__WIN32__) - #define wxUSE_DYNLIB_CLASS 1 -#else - #define wxUSE_DYNLIB_CLASS 0 -#endif - -// experimental, don't use for now -#if defined(__WIN32__) - #define wxUSE_DYNAMIC_LOADER 1 -#else - #define wxUSE_DYNAMIC_LOADER 0 -#endif - -// 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 archive filesystem (requires wxUSE_FILESYSTEM) -#define wxUSE_FS_ARCHIVE 1 - -// wxArchive classes for accessing archives such as zip and tar -#define wxUSE_ARCHIVE_STREAMS 1 - -// Set to 1 to compile wxZipInput/OutputStream classes. -#define wxUSE_ZIPSTREAM 1 - -// Set to 1 to compile wxTarInput/OutputStream classes. -#define wxUSE_TARSTREAM 1 - -// Set to 1 to compile wxZlibInput/OutputStream classes. Also required by -// wxUSE_LIBPNG -#define wxUSE_ZLIB 1 - -// Set to 1 to enable virtual Internet filesystem (requires wxUSE_FILESYSTEM) -#define wxUSE_FS_INET 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 wxWidgets one. -// -// Default is 1. -// -// Recommended setting: 1 unless you don't like the license terms (unlikely) -#define wxUSE_APPLE_IEEE 1 - -// Joystick support class -#if defined(__WIN32__) - #define wxUSE_JOYSTICK 1 -#else - #define wxUSE_JOYSTICK 1 -#endif - -// 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 wxVariant class used in several places throughout the library, -// notably in wxDataViewCtrl API. -// -// Default is 1. -// -// Recommended setting: 1 unless you want to reduce the library size as much as -// possible in which case setting this to 0 can gain up to 100KB. -#define wxUSE_VARIANT 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 - -// Use wxMediaCtrl -// -// Default is 1. -// -// Recommended setting: 1 -#define wxUSE_MEDIACTRL 1 - -// Use QuickTime -// -// Default is 0 -// -// Recommended setting: 1 if you have the QT SDK installed and you need it, else 0 -#define wxUSE_QUICKTIME 0 - -// Use DirectShow -// -// Default is 0 -// -// Recommended setting: 1 if the DirectX 7 SDK is installed (highly recommended), else 0 -#define wxUSE_DIRECTSHOW 0 - -// Use wxWidget's XRC XML-based resource system. Recommended. -// -// Default is 1 -// -// Recommended setting: 1 (requires wxUSE_XML) -#define wxUSE_XRC 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 (required by XRC) -#if wxUSE_XRC -# define wxUSE_XML 1 -#else -# define wxUSE_XML 0 -#endif - -// Use wxWidget's AUI docking system -// -// Default is 1 -// -// Recommended setting: 1 -#define wxUSE_AUI 1 - - -// Enable the new wxGraphicsPath and wxGraphicsContext classes for an advanced -// 2D drawing API. (Still somewhat experimental) -// -// Please note that on Windows you will need to link with gdiplus.lib (use -// USE_GDIPLUS=1 for makefile builds) and distribute gdiplus.dll with your -// application if you want it to be runnable on pre-XP systems. -// -// Default is 0 -// -// Recommended setting: 1 -#ifndef wxUSE_GRAPHICS_CONTEXT -#define wxUSE_GRAPHICS_CONTEXT 0 -#endif - -// Set to 1 to compile MS Windows XP theme engine support -#define wxUSE_UXTHEME 0 - -// Set to 1 to auto-adapt to MS Windows XP themes where possible -// (notably, wxNotebook pages) -#define wxUSE_UXTHEME_AUTO 0 - -// ---------------------------------------------------------------------------- -// 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 -// -// Default is 1 -// -// Recommended setting: 1 (may be set to 0 if you don't wxUSE_TIPWINDOW) -#define wxUSE_POPUPWIN 1 - -// wxTipWindow allows to implement the custom tooltips, it is used by the -// context help classes. Requires wxUSE_POPUPWIN. -// -// Default is 1 -// -// Recommended setting: 1 (may be set to 0) -#define wxUSE_TIPWINDOW 1 - -// Each of the settings below corresponds to one wxWidgets 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_ANIMATIONCTRL 1 // wxAnimationCtrl -#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 -#define wxUSE_CHOICE 1 // wxChoice -#define wxUSE_COLLPANE 1 // wxCollapsiblePane -#define wxUSE_COLOURPICKERCTRL 1 // wxColourPickerCtrl -#define wxUSE_COMBOBOX 1 // wxComboBox -#define wxUSE_DATAVIEWCTRL 1 // wxDataViewCtrl -#define wxUSE_DATEPICKCTRL 1 // wxDatePickerCtrl -#define wxUSE_DIRPICKERCTRL 1 // wxDirPickerCtrl -#define wxUSE_FILEPICKERCTRL 1 // wxFilePickerCtrl -#define wxUSE_FONTPICKERCTRL 1 // wxFontPickerCtrl -#define wxUSE_GAUGE 1 // wxGauge -#define wxUSE_HYPERLINKCTRL 1 // wxHyperlinkCtrl -#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_SEARCHCTRL 1 // wxSearchCtrl -#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 // wxToggleButton -#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 0. -// -// Recommended setting: 0 -#define wxUSE_NATIVE_STATUSBAR 0 - -// 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 0 for all settings. -// -// Recommended setting: 1 for wxUSE_TOOLBAR and 0 for wxUSE_TOOLBAR_NATIVE. -#define wxUSE_TOOLBAR 1 -#define wxUSE_TOOLBAR_NATIVE 0 - -// 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 - -// wxChoicebook control is similar to wxNotebook but uses wxChoice instead of -// the tabs -// -// Default is 1. -// -// Recommended setting: 1 -#define wxUSE_CHOICEBOOK 1 - -// wxTreebook control is similar to wxNotebook but uses wxTreeCtrl instead of -// the tabs -// -// Default is 1. -// -// Recommended setting: 1 -#define wxUSE_TREEBOOK 1 - -// wxToolbook control is similar to wxNotebook but uses wxToolBar instead of -// tabs -// -// Default is 1. -// -// Recommended setting: 1 -#define wxUSE_TOOLBOOK 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, set to 0 to cut down compilation time and binaries size if you -// don't use it. -// -// Recommended setting: 1 -// -#define wxUSE_GRID 1 - -// wxProperty[Value/Form/List] classes, used by Dialog Editor -#define wxUSE_PROPSHEET 1 - - -// wxMiniFrame class: a frame with narrow title bar -// -// Default is 1. -// -// Recommended setting: 1 (it doesn't cost almost anything) -#define wxUSE_MINIFRAME 1 - - -// wxComboCtrl and related classes: combobox with custom popup window and -// not necessarily a listbox. -// -// Default is 1. -// -// Recommended setting: 1 but can be safely set to 0 except for wxUniv where it -// it used by wxComboBox -#define wxUSE_COMBOCTRL 1 - -// wxOwnerDrawnComboBox is a custom combobox allowing to paint the combobox -// items. -// -// Default is 1. -// -// Recommended setting: 1 but can be safely set to 0, except where it is -// needed as a base class for generic wxBitmapComboBox. -#define wxUSE_ODCOMBOBOX 1 - -// wxBitmapComboBox a combobox that can have images in front of text items. -// -// Default is 1. -// -// Recommended setting: 1 but can be safely set to 0 -#define wxUSE_BITMAPCOMBOBOX 1 - -// ---------------------------------------------------------------------------- -// 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 0 - -// 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 -#ifdef __WIN32__ - #define wxUSE_TOOLTIPS 1 -#else - #define wxUSE_TOOLTIPS 0 -#endif - -// wxValidator class and related methods -#define wxUSE_VALIDATORS 1 - -// wxDC cacheing implementation -#define wxUSE_DC_CACHEING 1 - -// Set this to 1 to enable the use of DIB's for wxBitmap to support -// bitmaps > 16MB on Win95/98/Me. Set to 0 to use DDB's only. -#define wxUSE_DIB_FOR_BITMAP 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) -#if defined(__WIN32__) - #define wxUSE_FILEDLG 1 -#else - #define wxUSE_FILEDLG 1 -#endif - -// 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 - -// Compile in wxAboutBox() function showing the standard "About" dialog. -// -// Default is 1 -// -// Recommended setting: 1 but can be set to 0 to save some space if you don't -// use this function -#define wxUSE_ABOUTDLG 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. -#if defined(__WIN32__) - #define wxUSE_METAFILE 1 - #define wxUSE_ENH_METAFILE 1 - #define wxUSE_WIN_METAFILES_ALWAYS 0 -#else - #define wxUSE_METAFILE 0 - #define wxUSE_ENH_METAFILE 0 - #define wxUSE_WIN_METAFILES_ALWAYS 0 -#endif - -// ---------------------------------------------------------------------------- -// Big GUI components -// ---------------------------------------------------------------------------- - -// Set to 0 to disable MDI support. -// -// Requires wxUSE_NOTEBOOK under platforms other than MSW. -// -// Default is 1. -// -// Recommended setting: 1, can be safely set to 0. -#define wxUSE_MDI 1 - -// Set to 0 to disable document/view architecture -#define wxUSE_DOC_VIEW_ARCHITECTURE 1 - -// Set to 0 to disable MDI document/view architecture -// -// Requires wxUSE_MDI && wxUSE_DOC_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 - -// Setting wxUSE_GLCANVAS to 1 enables OpenGL support. You need to have OpenGL -// headers and libraries to be able to compile the library with wxUSE_GLCANVAS -// set to 1. Note that for some compilers (notably Microsoft Visual C++) you -// will need to manually add opengl32.lib and glu32.lib to the list of -// libraries linked with your program if you use OpenGL. -// -// Default is 0. -// -// Recommended setting: 1 if you intend to use OpenGL, 0 otherwise -#if defined(__WIN32__) - #define wxUSE_GLCANVAS 1 -#else - #define wxUSE_GLCANVAS 0 -#endif - -// wxRichTextCtrl allows editing of styled text. -// -// Default is 1. -// -// Recommended setting: 1, set to 0 if you want compile a -// smaller library. -#define wxUSE_RICHTEXT 1 - -// wxTreeLayout class -#define wxUSE_TREELAYOUT 1 - -// ---------------------------------------------------------------------------- -// 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 for WIN32 -#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 -#if defined(__WIN32__) - #define wxUSE_DRAG_AND_DROP 1 -#else - #define wxUSE_DRAG_AND_DROP 0 -#endif - -// Use wxAccessible for enhanced and customisable accessibility. -// Depends on wxUSE_OLE. -// -// Default is 0. -// -// Recommended setting (at present): 0 -#define wxUSE_ACCESSIBILITY 0 - -// ---------------------------------------------------------------------------- -// 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) -#if defined(__WIN32__) - #define wxUSE_SNGLINST_CHECKER 1 -#else - #define wxUSE_SNGLINST_CHECKER 0 -#endif - -// Drag image -#define wxUSE_DRAGIMAGE 1 - -// Interprocess communication -#define wxUSE_IPC 1 - -// Help -#if defined(__WIN32__) - #define wxUSE_HELP 1 -#else - #define wxUSE_HELP 1 -#endif - -// MS help -#define wxUSE_MS_HTML_HELP 1 - -// Use wxHTML-based help controller -#define wxUSE_WXHTML_HELP 1 - -// Use resources -#define wxUSE_RESOURCES 0 - -// Window layout constraint system -#define wxUSE_CONSTRAINTS 1 - -// Splines -#define wxUSE_SPLINES 1 - -// Include mouse wheel support -#define wxUSE_MOUSEWHEEL 1 - -// ---------------------------------------------------------------------------- -// postscript support settings -// ---------------------------------------------------------------------------- - -// Set to 1 for PostScript device context. -#define wxUSE_POSTSCRIPT 1 - -// Set to 1 to use font metric files in GetTextExtent -#define wxUSE_AFM_FOR_POSTSCRIPT 1 - -// ---------------------------------------------------------------------------- -// database classes -// ---------------------------------------------------------------------------- - -// Define 1 to use ODBC classes -#define wxUSE_ODBC 1 - -// 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 0 - -// Default is 0. Set to 1 to use the deprecated classes, enum types, function, -// member variables. With a setting of 1, full backward compatibility 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 <iostream> and <iostream.h> but you can't mix -// them. Set to 1 for <iostream.h>, 0 for <iostream> -// -// Default is 1. -// -// Recommended setting: whatever your compiler likes more -#ifdef __MWERKS__ - #define wxUSE_IOSTREAMH 1 -#else - #define wxUSE_IOSTREAMH 0 -#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 (Amiga format) -#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 0 - -// Set to 1 to compile in wxPalette class - #define wxUSE_PALETTE 1 - -// ---------------------------------------------------------------------------- -// Windows-only settings -// ---------------------------------------------------------------------------- -#if defined(__WINDOWS__) - -// Set this to 1 if you want to use wxWidgets and MFC in the same program. This -// will override some other settings (see below) -// -// Default is 0. -// -// Recommended setting: 0 unless you really have to use MFC -#define wxUSE_MFC 0 - -// Set this to 1 for generic OLE support: this is required for drag-and-drop, -// clipboard, OLE Automation. Only set it to 0 if your compiler is very old and -// can't compile/doesn't have the OLE headers. -// -// Default is 1. -// -// Recommended setting: 1 for WIN32 - #define wxUSE_OLE 1 - -// Set to 0 to disable PostScript print/preview architecture code under Windows -// (just use Windows printing). -#if defined(__WIN32__) - #define wxUSE_POSTSCRIPT_ARCHITECTURE_IN_MSW 1 -#else - #define wxUSE_POSTSCRIPT_ARCHITECTURE_IN_MSW 0 -#endif - -// Set this to 1 to use RICHEDIT controls for wxTextCtrl with style wxTE_RICH -// which allows to put more than ~32Kb of text in it even under Win9x (NT -// doesn't have such limitation). -// -// Default is 1 for compilers which support it -// -// Recommended setting: 1, only set it to 0 if your compiler doesn't have -// or can't compile <richedit.h> -#if defined(__WIN95__) && !defined(__WINE__) && !defined(__GNUWIN32_OLD__) -// TODO: This should be ifdef'ed for any compilers that don't support -// RichEdit 2.0 but do have RichEdit 1.0... - #define wxUSE_RICHEDIT 0 // currently not supported - #define wxUSE_RICHEDIT2 0 // currently not supported - -#else - #define wxUSE_RICHEDIT 0 - #define wxUSE_RICHEDIT2 0 -#endif - -// Set this to 1 to enable support for the owner-drawn menu and listboxes. -// -// Default is 1. -// -// Recommended setting: 1, set to 0 for a small library size reduction -#define wxUSE_OWNER_DRAWN 0 - -// Set this to 1 to be able to use wxCrashReport::Generate() to create mini -// dumps of your program when it crashes (or at any other moment) -// -// Default is 1 if supported by the compiler (VC++ and recent BC++ only). -// -// Recommended setting: 1, set to 0 if your programs never crash -#define wxUSE_CRASHREPORT 1 - -#endif - -// ---------------------------------------------------------------------------- -// unknown settings -// ---------------------------------------------------------------------------- - -// If 1, enables provision of run-time type information. -// NOW MANDATORY: don't change. -#define wxUSE_DYNAMIC_CLASSES 1 - -//?????? -#if defined(__WIN32__) - #define wxUSE_DDE_FOR_IPC 0 -#else - #define wxUSE_DDE_FOR_IPC 0 -#endif - -#endif // _WX_UNIV_SETUP_H_ diff --git a/wxWidgets/include/wx/univ/setup0.h b/wxWidgets/include/wx/univ/setup0.h deleted file mode 100644 index 39b9cba8d5..0000000000 --- a/wxWidgets/include/wx/univ/setup0.h +++ /dev/null @@ -1,1328 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: wx/univ/setup.h -// Purpose: configuration settings for wxUniversal/MSW -// Author: Vadim Zeitlin -// Modified by: -// Created: 14.08.00 -// RCS-ID: $Id: setup0.h 49997 2007-11-16 16:14:49Z CE $ -// Copyright: (c) 2000 SciTech Software, Inc. (www.scitechsoft.com) -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_UNIV_SETUP_H_ -#define _WX_UNIV_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.4 API: set it to 1 to -// enable it -// -// Default is 0. -// -// Recommended setting: 0 (please update your code instead!) -#define WXWIN_COMPATIBILITY_2_4 0 - -// This setting determines the compatibility with 2.6 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_6 1 - -// 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 0 - -// ---------------------------------------------------------------------------- -// 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 wxWidgets 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 the normal memory operators. -// -// Default is 0 -// -// Recommended setting: 0 -#ifdef __MWERKS__ - #define wxUSE_DEBUG_CONTEXT 1 -#else - #define wxUSE_DEBUG_CONTEXT 0 -#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 0 -// -// Recommended setting: 1 if you are not using a memory debugging tool, else 0 -#define wxUSE_MEMORY_TRACING 0 - -// 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 / CodeWarrior -// -// 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 wxWidgets 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/XP (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/XP) -#ifndef wxUSE_UNICODE - #define wxUSE_UNICODE 0 -#endif - -// Set wxUSE_UNICODE_MSLU to 1 if you want to compile wxWidgets in Unicode mode -// and be able to run compiled apps under Windows 9x as well as NT/2000/XP. This -// setting enables use of unicows.dll from MSLU (MS Layer for Unicode, see -// http://www.microsoft.com/globaldev/Articles/mslu_announce.asp). Note that you -// will have to modify the makefiles to include unicows.lib import library as the first -// library (if you use MSVC, you can run the makefile with "nmake MSLU=1 UNICODE=1" -// command). -// -// If your compiler doesn't have unicows.lib, you can get a version of it at -// http://libunicows.sourceforge.net -// -// Default is 0 -// -// Recommended setting: 0 -#define wxUSE_UNICODE_MSLU 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 for win32 else 0 -#if defined(__WIN32__) || defined(__WATCOMC__) - #define wxUSE_WCHAR_T 1 -#else - #define wxUSE_WCHAR_T 0 -#endif - -// ---------------------------------------------------------------------------- -// 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 - -// Set wxUSE_STL to 1 to derive wxList(Foo) and wxArray(Foo) from -// std::list<Foo*> and std::vector<Foo*>, with a compatibility interface, -// and for wxHashMap to be implemented with templates. -// -// Default is 0 -// -// Recommended setting: YMMV -#define wxUSE_STL 0 - -// Set wxUSE_EXTENDED_RTTI to 1 to use extended RTTI -// -// Default is 0 -// -// Recommended setting: 0 -#define wxUSE_EXTENDED_RTTI 0 - -// 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 -#define wxUSE_LOGWINDOW 1 - -// Recommended setting: 1 -#define wxUSE_LOGGUI 1 - -// Recommended setting: 1 -#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 wxWidgets streams classes -#define wxUSE_STREAMS 1 - -// Use standard C++ streams if 1. If 0, use wxWin streams implementation. -#ifdef __MWERKS__ - #define wxUSE_STD_IOSTREAM 1 -#else - #define wxUSE_STD_IOSTREAM 0 -#endif - -// Enable conversion to standard C++ string if 1. -// -// Default is 1 for most compilers. -// -// Currently the Digital Mars and Watcom compilers come without standard C++ -// library headers by default, wxUSE_STD_STRING can be set to 1 if you do have -// them (e.g. from STLPort). -// -// VC++ 5.0 does include standard C++ library header, however they produce -// many warnings that can't be turned off when compiled at warning level 4. -#if defined(__DMC__) || defined(__WATCOMC__) \ - || (defined(_MSC_VER) && _MSC_VER < 1200) - #define wxUSE_STD_STRING 0 -#else - #define wxUSE_STD_STRING 1 -#endif - -// Support for positional parameters (e.g. %1$d, %2$s ...) in wxVsnprintf. -// Note that if the system's implementation does not support positional -// parameters, setting this to 1 forces the use of the wxWidgets implementation -// of wxVsnprintf. The standard vsnprintf() supports positional parameters on -// many Unix systems but usually doesn't under Windows. -// -// Positional parameters are very useful when translating a program since using -// them in formatting strings allow translators to correctly reorder the -// translated sentences. -// -// Default is 1 -// -// Recommended setting: 1 if you want to support multiple languages -#define wxUSE_PRINTF_POS_PARAMS 1 - -// ---------------------------------------------------------------------------- -// 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 wxFSVolume class providing access to the configured/active mount points -// -// Default is 1 -// -// Recommended setting: 1 (but may be safely disabled if you don't use it) -#define wxUSE_FSVOLUME 1 - -// Use wxStandardPaths class which allows to retrieve some standard locations -// in the file system -// -// Default is 1 -// -// Recommended setting: 1 (may be disabled to save space, but not much) -#define wxUSE_STDPATHS 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 - -// wxUSE_TIMEDATE enables compilation of the old wxDate and wxTime classes (not -// the same as wxDateTime!). These classes are obsolete and shouldn't be used -// in new code -// -// Default is 0 -// -// Recommended setting: 0 unless you have legacy code which uses these classes -#define wxUSE_TIMEDATE 0 - -// 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: 0 (universal should not use native) -#if defined(__WIN32__) - #define wxUSE_CONFIG_NATIVE 0 -#else - #define wxUSE_CONFIG_NATIVE 0 -#endif - -// 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 -#if defined(__WIN32__) - #define wxUSE_DIALUP_MANAGER 1 -#else - #define wxUSE_DIALUP_MANAGER 0 -#endif - -// 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 -#if defined(__WIN32__) - #define wxUSE_DYNLIB_CLASS 1 -#else - #define wxUSE_DYNLIB_CLASS 0 -#endif - -// experimental, don't use for now -#if defined(__WIN32__) - #define wxUSE_DYNAMIC_LOADER 1 -#else - #define wxUSE_DYNAMIC_LOADER 0 -#endif - -// 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 archive filesystem (requires wxUSE_FILESYSTEM) -#define wxUSE_FS_ARCHIVE 1 - -// wxArchive classes for accessing archives such as zip and tar -#define wxUSE_ARCHIVE_STREAMS 1 - -// Set to 1 to compile wxZipInput/OutputStream classes. -#define wxUSE_ZIPSTREAM 1 - -// Set to 1 to compile wxTarInput/OutputStream classes. -#define wxUSE_TARSTREAM 1 - -// Set to 1 to compile wxZlibInput/OutputStream classes. Also required by -// wxUSE_LIBPNG -#define wxUSE_ZLIB 1 - -// Set to 1 to enable virtual Internet filesystem (requires wxUSE_FILESYSTEM) -#define wxUSE_FS_INET 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 wxWidgets one. -// -// Default is 1. -// -// Recommended setting: 1 unless you don't like the license terms (unlikely) -#define wxUSE_APPLE_IEEE 1 - -// Joystick support class -#if defined(__WIN32__) - #define wxUSE_JOYSTICK 1 -#else - #define wxUSE_JOYSTICK 1 -#endif - -// 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 wxVariant class used in several places throughout the library, -// notably in wxDataViewCtrl API. -// -// Default is 1. -// -// Recommended setting: 1 unless you want to reduce the library size as much as -// possible in which case setting this to 0 can gain up to 100KB. -#define wxUSE_VARIANT 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 - -// Use wxMediaCtrl -// -// Default is 1. -// -// Recommended setting: 1 -#define wxUSE_MEDIACTRL 1 - -// Use QuickTime -// -// Default is 0 -// -// Recommended setting: 1 if you have the QT SDK installed and you need it, else 0 -#define wxUSE_QUICKTIME 0 - -// Use DirectShow -// -// Default is 0 -// -// Recommended setting: 1 if the DirectX 7 SDK is installed (highly recommended), else 0 -#define wxUSE_DIRECTSHOW 0 - -// Use wxWidget's XRC XML-based resource system. Recommended. -// -// Default is 1 -// -// Recommended setting: 1 (requires wxUSE_XML) -#define wxUSE_XRC 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 (required by XRC) -#if wxUSE_XRC -# define wxUSE_XML 1 -#else -# define wxUSE_XML 0 -#endif - -// Use wxWidget's AUI docking system -// -// Default is 1 -// -// Recommended setting: 1 -#define wxUSE_AUI 1 - - -// Enable the new wxGraphicsPath and wxGraphicsContext classes for an advanced -// 2D drawing API. (Still somewhat experimental) -// -// Please note that on Windows you will need to link with gdiplus.lib (use -// USE_GDIPLUS=1 for makefile builds) and distribute gdiplus.dll with your -// application if you want it to be runnable on pre-XP systems. -// -// Default is 0 -// -// Recommended setting: 1 -#ifndef wxUSE_GRAPHICS_CONTEXT -#define wxUSE_GRAPHICS_CONTEXT 0 -#endif - -// Set to 1 to compile MS Windows XP theme engine support -#define wxUSE_UXTHEME 0 - -// Set to 1 to auto-adapt to MS Windows XP themes where possible -// (notably, wxNotebook pages) -#define wxUSE_UXTHEME_AUTO 0 - -// ---------------------------------------------------------------------------- -// 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 -// -// Default is 1 -// -// Recommended setting: 1 (may be set to 0 if you don't wxUSE_TIPWINDOW) -#define wxUSE_POPUPWIN 1 - -// wxTipWindow allows to implement the custom tooltips, it is used by the -// context help classes. Requires wxUSE_POPUPWIN. -// -// Default is 1 -// -// Recommended setting: 1 (may be set to 0) -#define wxUSE_TIPWINDOW 1 - -// Each of the settings below corresponds to one wxWidgets 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_ANIMATIONCTRL 1 // wxAnimationCtrl -#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 -#define wxUSE_CHOICE 1 // wxChoice -#define wxUSE_COLLPANE 1 // wxCollapsiblePane -#define wxUSE_COLOURPICKERCTRL 1 // wxColourPickerCtrl -#define wxUSE_COMBOBOX 1 // wxComboBox -#define wxUSE_DATAVIEWCTRL 1 // wxDataViewCtrl -#define wxUSE_DATEPICKCTRL 1 // wxDatePickerCtrl -#define wxUSE_DIRPICKERCTRL 1 // wxDirPickerCtrl -#define wxUSE_FILEPICKERCTRL 1 // wxFilePickerCtrl -#define wxUSE_FONTPICKERCTRL 1 // wxFontPickerCtrl -#define wxUSE_GAUGE 1 // wxGauge -#define wxUSE_HYPERLINKCTRL 1 // wxHyperlinkCtrl -#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_SEARCHCTRL 1 // wxSearchCtrl -#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 // wxToggleButton -#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 0. -// -// Recommended setting: 0 -#define wxUSE_NATIVE_STATUSBAR 0 - -// 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 0 for all settings. -// -// Recommended setting: 1 for wxUSE_TOOLBAR and 0 for wxUSE_TOOLBAR_NATIVE. -#define wxUSE_TOOLBAR 1 -#define wxUSE_TOOLBAR_NATIVE 0 - -// 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 - -// wxChoicebook control is similar to wxNotebook but uses wxChoice instead of -// the tabs -// -// Default is 1. -// -// Recommended setting: 1 -#define wxUSE_CHOICEBOOK 1 - -// wxTreebook control is similar to wxNotebook but uses wxTreeCtrl instead of -// the tabs -// -// Default is 1. -// -// Recommended setting: 1 -#define wxUSE_TREEBOOK 1 - -// wxToolbook control is similar to wxNotebook but uses wxToolBar instead of -// tabs -// -// Default is 1. -// -// Recommended setting: 1 -#define wxUSE_TOOLBOOK 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, set to 0 to cut down compilation time and binaries size if you -// don't use it. -// -// Recommended setting: 1 -// -#define wxUSE_GRID 1 - -// wxProperty[Value/Form/List] classes, used by Dialog Editor -#define wxUSE_PROPSHEET 1 - - -// wxMiniFrame class: a frame with narrow title bar -// -// Default is 1. -// -// Recommended setting: 1 (it doesn't cost almost anything) -#define wxUSE_MINIFRAME 1 - - -// wxComboCtrl and related classes: combobox with custom popup window and -// not necessarily a listbox. -// -// Default is 1. -// -// Recommended setting: 1 but can be safely set to 0 except for wxUniv where it -// it used by wxComboBox -#define wxUSE_COMBOCTRL 1 - -// wxOwnerDrawnComboBox is a custom combobox allowing to paint the combobox -// items. -// -// Default is 1. -// -// Recommended setting: 1 but can be safely set to 0, except where it is -// needed as a base class for generic wxBitmapComboBox. -#define wxUSE_ODCOMBOBOX 1 - -// wxBitmapComboBox a combobox that can have images in front of text items. -// -// Default is 1. -// -// Recommended setting: 1 but can be safely set to 0 -#define wxUSE_BITMAPCOMBOBOX 1 - -// ---------------------------------------------------------------------------- -// 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 0 - -// 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 -#ifdef __WIN32__ - #define wxUSE_TOOLTIPS 1 -#else - #define wxUSE_TOOLTIPS 0 -#endif - -// wxValidator class and related methods -#define wxUSE_VALIDATORS 1 - -// wxDC cacheing implementation -#define wxUSE_DC_CACHEING 1 - -// Set this to 1 to enable the use of DIB's for wxBitmap to support -// bitmaps > 16MB on Win95/98/Me. Set to 0 to use DDB's only. -#define wxUSE_DIB_FOR_BITMAP 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) -#if defined(__WIN32__) - #define wxUSE_FILEDLG 1 -#else - #define wxUSE_FILEDLG 1 -#endif - -// 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 - -// Compile in wxAboutBox() function showing the standard "About" dialog. -// -// Default is 1 -// -// Recommended setting: 1 but can be set to 0 to save some space if you don't -// use this function -#define wxUSE_ABOUTDLG 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. -#if defined(__WIN32__) - #define wxUSE_METAFILE 1 - #define wxUSE_ENH_METAFILE 1 - #define wxUSE_WIN_METAFILES_ALWAYS 0 -#else - #define wxUSE_METAFILE 0 - #define wxUSE_ENH_METAFILE 0 - #define wxUSE_WIN_METAFILES_ALWAYS 0 -#endif - -// ---------------------------------------------------------------------------- -// Big GUI components -// ---------------------------------------------------------------------------- - -// Set to 0 to disable MDI support. -// -// Requires wxUSE_NOTEBOOK under platforms other than MSW. -// -// Default is 1. -// -// Recommended setting: 1, can be safely set to 0. -#define wxUSE_MDI 1 - -// Set to 0 to disable document/view architecture -#define wxUSE_DOC_VIEW_ARCHITECTURE 1 - -// Set to 0 to disable MDI document/view architecture -// -// Requires wxUSE_MDI && wxUSE_DOC_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 - -// Setting wxUSE_GLCANVAS to 1 enables OpenGL support. You need to have OpenGL -// headers and libraries to be able to compile the library with wxUSE_GLCANVAS -// set to 1. Note that for some compilers (notably Microsoft Visual C++) you -// will need to manually add opengl32.lib and glu32.lib to the list of -// libraries linked with your program if you use OpenGL. -// -// Default is 0. -// -// Recommended setting: 1 if you intend to use OpenGL, 0 otherwise -#if defined(__WIN32__) - #define wxUSE_GLCANVAS 1 -#else - #define wxUSE_GLCANVAS 0 -#endif - -// wxRichTextCtrl allows editing of styled text. -// -// Default is 1. -// -// Recommended setting: 1, set to 0 if you want compile a -// smaller library. -#define wxUSE_RICHTEXT 1 - -// wxTreeLayout class -#define wxUSE_TREELAYOUT 1 - -// ---------------------------------------------------------------------------- -// 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 for WIN32 -#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 -#if defined(__WIN32__) - #define wxUSE_DRAG_AND_DROP 1 -#else - #define wxUSE_DRAG_AND_DROP 0 -#endif - -// Use wxAccessible for enhanced and customisable accessibility. -// Depends on wxUSE_OLE. -// -// Default is 0. -// -// Recommended setting (at present): 0 -#define wxUSE_ACCESSIBILITY 0 - -// ---------------------------------------------------------------------------- -// 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) -#if defined(__WIN32__) - #define wxUSE_SNGLINST_CHECKER 1 -#else - #define wxUSE_SNGLINST_CHECKER 0 -#endif - -// Drag image -#define wxUSE_DRAGIMAGE 1 - -// Interprocess communication -#define wxUSE_IPC 1 - -// Help -#if defined(__WIN32__) - #define wxUSE_HELP 1 -#else - #define wxUSE_HELP 1 -#endif - -// MS help -#define wxUSE_MS_HTML_HELP 1 - -// Use wxHTML-based help controller -#define wxUSE_WXHTML_HELP 1 - -// Use resources -#define wxUSE_RESOURCES 0 - -// Window layout constraint system -#define wxUSE_CONSTRAINTS 1 - -// Splines -#define wxUSE_SPLINES 1 - -// Include mouse wheel support -#define wxUSE_MOUSEWHEEL 1 - -// ---------------------------------------------------------------------------- -// postscript support settings -// ---------------------------------------------------------------------------- - -// Set to 1 for PostScript device context. -#define wxUSE_POSTSCRIPT 1 - -// Set to 1 to use font metric files in GetTextExtent -#define wxUSE_AFM_FOR_POSTSCRIPT 1 - -// ---------------------------------------------------------------------------- -// database classes -// ---------------------------------------------------------------------------- - -// Define 1 to use ODBC classes -#define wxUSE_ODBC 1 - -// 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 0 - -// Default is 0. Set to 1 to use the deprecated classes, enum types, function, -// member variables. With a setting of 1, full backward compatibility 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 <iostream> and <iostream.h> but you can't mix -// them. Set to 1 for <iostream.h>, 0 for <iostream> -// -// Default is 1. -// -// Recommended setting: whatever your compiler likes more -#ifdef __MWERKS__ - #define wxUSE_IOSTREAMH 1 -#else - #define wxUSE_IOSTREAMH 0 -#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 (Amiga format) -#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 0 - -// Set to 1 to compile in wxPalette class - #define wxUSE_PALETTE 1 - -// ---------------------------------------------------------------------------- -// Windows-only settings -// ---------------------------------------------------------------------------- -#if defined(__WINDOWS__) - -// Set this to 1 if you want to use wxWidgets and MFC in the same program. This -// will override some other settings (see below) -// -// Default is 0. -// -// Recommended setting: 0 unless you really have to use MFC -#define wxUSE_MFC 0 - -// Set this to 1 for generic OLE support: this is required for drag-and-drop, -// clipboard, OLE Automation. Only set it to 0 if your compiler is very old and -// can't compile/doesn't have the OLE headers. -// -// Default is 1. -// -// Recommended setting: 1 for WIN32 - #define wxUSE_OLE 1 - -// Set to 0 to disable PostScript print/preview architecture code under Windows -// (just use Windows printing). -#if defined(__WIN32__) - #define wxUSE_POSTSCRIPT_ARCHITECTURE_IN_MSW 1 -#else - #define wxUSE_POSTSCRIPT_ARCHITECTURE_IN_MSW 0 -#endif - -// Set this to 1 to use RICHEDIT controls for wxTextCtrl with style wxTE_RICH -// which allows to put more than ~32Kb of text in it even under Win9x (NT -// doesn't have such limitation). -// -// Default is 1 for compilers which support it -// -// Recommended setting: 1, only set it to 0 if your compiler doesn't have -// or can't compile <richedit.h> -#if defined(__WIN95__) && !defined(__WINE__) && !defined(__GNUWIN32_OLD__) -// TODO: This should be ifdef'ed for any compilers that don't support -// RichEdit 2.0 but do have RichEdit 1.0... - #define wxUSE_RICHEDIT 0 // currently not supported - #define wxUSE_RICHEDIT2 0 // currently not supported - -#else - #define wxUSE_RICHEDIT 0 - #define wxUSE_RICHEDIT2 0 -#endif - -// Set this to 1 to enable support for the owner-drawn menu and listboxes. -// -// Default is 1. -// -// Recommended setting: 1, set to 0 for a small library size reduction -#define wxUSE_OWNER_DRAWN 0 - -// Set this to 1 to be able to use wxCrashReport::Generate() to create mini -// dumps of your program when it crashes (or at any other moment) -// -// Default is 1 if supported by the compiler (VC++ and recent BC++ only). -// -// Recommended setting: 1, set to 0 if your programs never crash -#define wxUSE_CRASHREPORT 1 - -#endif - -// ---------------------------------------------------------------------------- -// unknown settings -// ---------------------------------------------------------------------------- - -// If 1, enables provision of run-time type information. -// NOW MANDATORY: don't change. -#define wxUSE_DYNAMIC_CLASSES 1 - -//?????? -#if defined(__WIN32__) - #define wxUSE_DDE_FOR_IPC 0 -#else - #define wxUSE_DDE_FOR_IPC 0 -#endif - -#endif // _WX_UNIV_SETUP_H_ diff --git a/wxWidgets/include/wx/univ/slider.h b/wxWidgets/include/wx/univ/slider.h deleted file mode 100644 index b4ee074731..0000000000 --- a/wxWidgets/include/wx/univ/slider.h +++ /dev/null @@ -1,226 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: wx/univ/slider.h -// Purpose: wxSlider control for wxUniversal -// Author: Vadim Zeitlin -// Modified by: -// Created: 09.02.01 -// RCS-ID: $Id: slider.h 61872 2009-09-09 22:37:05Z VZ $ -// Copyright: (c) 2001 SciTech Software, Inc. (www.scitechsoft.com) -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_UNIV_SLIDER_H_ -#define _WX_UNIV_SLIDER_H_ - -#include "wx/univ/scrthumb.h" - -// ---------------------------------------------------------------------------- -// the actions supported by this control -// ---------------------------------------------------------------------------- - -// our actions are the same as scrollbars - -#define wxACTION_SLIDER_START wxT("start") // to the beginning -#define wxACTION_SLIDER_END wxT("end") // to the end -#define wxACTION_SLIDER_LINE_UP wxT("lineup") // one line up/left -#define wxACTION_SLIDER_PAGE_UP wxT("pageup") // one page up/left -#define wxACTION_SLIDER_LINE_DOWN wxT("linedown") // one line down/right -#define wxACTION_SLIDER_PAGE_DOWN wxT("pagedown") // one page down/right -#define wxACTION_SLIDER_PAGE_CHANGE wxT("pagechange")// change page by numArg - -#define wxACTION_SLIDER_THUMB_DRAG wxT("thumbdrag") -#define wxACTION_SLIDER_THUMB_MOVE wxT("thumbmove") -#define wxACTION_SLIDER_THUMB_RELEASE wxT("thumbrelease") - -// ---------------------------------------------------------------------------- -// wxSlider -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxSlider : public wxSliderBase, - public wxControlWithThumb -{ -public: - // ctors and such - wxSlider(); - - 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); - - 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); - - // implement base class pure virtuals - virtual int GetValue() const; - virtual void SetValue(int value); - - virtual void SetRange(int minValue, int maxValue); - virtual int GetMin() const; - virtual int GetMax() const; - - virtual void SetLineSize(int lineSize); - virtual void SetPageSize(int pageSize); - virtual int GetLineSize() const; - virtual int GetPageSize() const; - - virtual void SetThumbLength(int lenPixels); - virtual int GetThumbLength() const; - - virtual void SetTickFreq(int n, int WXUNUSED(dummy) = 0); - virtual int GetTickFreq() const { return m_tickFreq; } - - // wxUniv-specific methods - // ----------------------- - - // is this a vertical slider? - bool IsVert() const { return (GetWindowStyle() & wxSL_VERTICAL) != 0; } - - // get the slider orientation - wxOrientation GetOrientation() const - { return IsVert() ? wxVERTICAL : wxHORIZONTAL; } - - // do we have labels? - bool HasLabels() const - { return ((GetWindowStyle() & wxSL_LABELS) != 0) && - ((GetWindowStyle() & (wxSL_TOP|wxSL_BOTTOM|wxSL_LEFT|wxSL_RIGHT)) != 0); } - - // do we have ticks? - bool HasTicks() const - { return ((GetWindowStyle() & wxSL_TICKS) != 0) && - ((GetWindowStyle() & (wxSL_TOP|wxSL_BOTTOM|wxSL_LEFT|wxSL_RIGHT|wxSL_BOTH)) != 0); } - - // implement wxControlWithThumb interface - virtual wxWindow *GetWindow() { return this; } - virtual bool IsVertical() const { return IsVert(); } - - virtual wxScrollThumb::Shaft HitTest(const wxPoint& pt) const; - virtual wxCoord ThumbPosToPixel() const; - virtual int PixelToThumbPos(wxCoord x) const; - - virtual void SetShaftPartState(wxScrollThumb::Shaft shaftPart, - int flag, - bool set = true); - - virtual void OnThumbDragStart(int pos); - virtual void OnThumbDrag(int pos); - virtual void OnThumbDragEnd(int pos); - virtual void OnPageScrollStart(); - virtual bool OnPageScroll(int pageInc); - - // for wxStdSliderInputHandler - wxScrollThumb& GetThumb() { return m_thumb; } - - virtual bool PerformAction(const wxControlAction& action, - long numArg = 0, - const wxString& strArg = wxEmptyString); - - static wxInputHandler *GetStdInputHandler(wxInputHandler *handlerDef); - virtual wxInputHandler *DoGetStdInputHandler(wxInputHandler *handlerDef) - { - return GetStdInputHandler(handlerDef); - } - -protected: - enum - { - INVALID_THUMB_VALUE = -0xffff - }; - - // overridden base class virtuals - virtual wxSize DoGetBestClientSize() const; - virtual void DoDraw(wxControlRenderer *renderer); - virtual wxBorder GetDefaultBorder() const { return wxBORDER_NONE; } - - // event handlers - void OnSize(wxSizeEvent& event); - - // common part of all ctors - void Init(); - - // normalize the value to fit in the range - int NormalizeValue(int value) const; - - // change the value by the given increment, return true if really changed - bool ChangeValueBy(int inc); - - // change the value to the given one - bool ChangeValueTo(int value); - - // is the value inside the range? - bool IsInRange(int value) { return (value >= m_min) && (value <= m_max); } - - // format the value for printing as label - virtual wxString FormatValue(int value) const; - - // calculate max label size - wxSize CalcLabelSize() const; - - // calculate m_rectLabel/Slider - void CalcGeometry(); - - // get the thumb size - wxSize GetThumbSize() const; - - // get the shaft rect (uses m_rectSlider which is supposed to be calculated) - wxRect GetShaftRect() const; - - // calc the current thumb position using the shaft rect (if the pointer is - // NULL, we calculate it here too) - void CalcThumbRect(const wxRect *rectShaft, - wxRect *rectThumbOut, - wxRect *rectLabelOut, - int value = INVALID_THUMB_VALUE) const; - - // return the slider rect calculating it if needed - const wxRect& GetSliderRect() const; - - // refresh the current thumb position - void RefreshThumb(); - -private: - // get the default thumb size (without using m_thumbSize) - wxSize GetDefaultThumbSize() const; - - // the object which manages our thumb - wxScrollThumb m_thumb; - - // the slider range and value - int m_min, - m_max, - m_value; - - // the tick frequence (default is 1) - int m_tickFreq; - - // the line and page increments (logical units) - int m_lineSize, - m_pageSize; - - // the size of the thumb (in pixels) - int m_thumbSize; - - // the part of the client area reserved for the label, the ticks and the - // part for the slider itself - wxRect m_rectLabel, - m_rectTicks, - m_rectSlider; - - // the state of the thumb (wxCONTROL_XXX constants sum) - int m_thumbFlags; - - DECLARE_EVENT_TABLE() - DECLARE_DYNAMIC_CLASS(wxSlider) -}; - -#endif // _WX_UNIV_SLIDER_H_ diff --git a/wxWidgets/include/wx/univ/spinbutt.h b/wxWidgets/include/wx/univ/spinbutt.h deleted file mode 100644 index 58e99cf295..0000000000 --- a/wxWidgets/include/wx/univ/spinbutt.h +++ /dev/null @@ -1,122 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: wx/univ/spinbutt.h -// Purpose: universal version of wxSpinButton -// Author: Vadim Zeitlin -// Modified by: -// Created: 21.01.01 -// RCS-ID: $Id: spinbutt.h 61872 2009-09-09 22:37:05Z VZ $ -// Copyright: (c) 2001 SciTech Software, Inc. (www.scitechsoft.com) -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_UNIV_SPINBUTT_H_ -#define _WX_UNIV_SPINBUTT_H_ - -#include "wx/univ/scrarrow.h" - -// ---------------------------------------------------------------------------- -// wxSpinButton -// ---------------------------------------------------------------------------- - -// actions supported by this control -#define wxACTION_SPIN_INC wxT("inc") -#define wxACTION_SPIN_DEC wxT("dec") - -class WXDLLEXPORT wxSpinButton : public wxSpinButtonBase, - public wxControlWithArrows -{ -public: - wxSpinButton(); - wxSpinButton(wxWindow *parent, - wxWindowID id = wxID_ANY, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = wxSP_VERTICAL | wxSP_ARROW_KEYS, - const wxString& name = wxSPIN_BUTTON_NAME); - - bool Create(wxWindow *parent, - wxWindowID id = wxID_ANY, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = wxSP_VERTICAL | wxSP_ARROW_KEYS, - const wxString& name = wxSPIN_BUTTON_NAME); - - // implement wxSpinButtonBase methods - virtual int GetValue() const; - virtual void SetValue(int val); - virtual void SetRange(int minVal, int maxVal); - - // implement wxControlWithArrows methods - virtual wxRenderer *GetRenderer() const { return m_renderer; } - virtual wxWindow *GetWindow() { return this; } - virtual bool IsVertical() const { return wxSpinButtonBase::IsVertical(); } - virtual int GetArrowState(wxScrollArrows::Arrow arrow) const; - virtual void SetArrowFlag(wxScrollArrows::Arrow arrow, int flag, bool set); - virtual bool OnArrow(wxScrollArrows::Arrow arrow); - virtual wxScrollArrows::Arrow HitTestArrow(const wxPoint& pt) const; - - // for wxStdSpinButtonInputHandler - const wxScrollArrows& GetArrows() { return m_arrows; } - - virtual bool PerformAction(const wxControlAction& action, - long numArg = 0, - const wxString& strArg = wxEmptyString); - - static wxInputHandler *GetStdInputHandler(wxInputHandler *handlerDef); - virtual wxInputHandler *DoGetStdInputHandler(wxInputHandler *handlerDef) - { - return GetStdInputHandler(handlerDef); - } - -protected: - virtual wxSize DoGetBestClientSize() const; - virtual void DoDraw(wxControlRenderer *renderer); - virtual wxBorder GetDefaultBorder() const { return wxBORDER_NONE; } - - // the common part of all ctors - void Init(); - - // normalize the value to fit into min..max range - int NormalizeValue(int value) const; - - // change the value by +1/-1 and send the event, return true if value was - // changed - bool ChangeValue(int inc); - - // get the rectangles for our 2 arrows - void CalcArrowRects(wxRect *rect1, wxRect *rect2) const; - - // the current controls value - int m_value; - -private: - // the object which manages our arrows - wxScrollArrows m_arrows; - - // the state (combination of wxCONTROL_XXX flags) of the arrows - int m_arrowsState[wxScrollArrows::Arrow_Max]; - - DECLARE_DYNAMIC_CLASS(wxSpinButton) -}; - -// ---------------------------------------------------------------------------- -// wxStdSpinButtonInputHandler: manages clicks on them (use arrows like -// wxStdScrollBarInputHandler) and processes keyboard events too -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxStdSpinButtonInputHandler : public wxStdInputHandler -{ -public: - wxStdSpinButtonInputHandler(wxInputHandler *inphand); - - virtual bool HandleKey(wxInputConsumer *consumer, - const wxKeyEvent& event, - bool pressed); - virtual bool HandleMouse(wxInputConsumer *consumer, - const wxMouseEvent& event); - virtual bool HandleMouseMove(wxInputConsumer *consumer, - const wxMouseEvent& event); -}; - -#endif // _WX_UNIV_SPINBUTT_H_ - diff --git a/wxWidgets/include/wx/univ/statbmp.h b/wxWidgets/include/wx/univ/statbmp.h deleted file mode 100644 index 05a9b2aedf..0000000000 --- a/wxWidgets/include/wx/univ/statbmp.h +++ /dev/null @@ -1,74 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/univ/statbmp.h -// Purpose: wxStaticBitmap class for wxUniversal -// Author: Vadim Zeitlin -// Modified by: -// Created: 25.08.00 -// RCS-ID: $Id: statbmp.h 37393 2006-02-08 21:47:09Z VZ $ -// Copyright: (c) 2000 SciTech Software, Inc. (www.scitechsoft.com) -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_UNIV_STATBMP_H_ -#define _WX_UNIV_STATBMP_H_ - -#include "wx/bitmap.h" - -// ---------------------------------------------------------------------------- -// wxStaticBitmap -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxStaticBitmap : public wxStaticBitmapBase -{ -public: - wxStaticBitmap() - { - } - - wxStaticBitmap(wxWindow *parent, - const wxBitmap& label, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = 0) - { - Create(parent, wxID_ANY, label, pos, size, style); - } - - 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 SetIcon(const wxIcon& icon); - virtual wxBitmap GetBitmap() const { return m_bitmap; } - - wxIcon GetIcon() const; - - virtual bool HasTransparentBackground() { return true; } - -protected: - virtual void DoDraw(wxControlRenderer *renderer); - -private: - // the bitmap which we show - wxBitmap m_bitmap; - - DECLARE_DYNAMIC_CLASS(wxStaticBitmap) -}; - -#endif // _WX_UNIV_STATBMP_H_ diff --git a/wxWidgets/include/wx/univ/statbox.h b/wxWidgets/include/wx/univ/statbox.h deleted file mode 100644 index f732dc1eb9..0000000000 --- a/wxWidgets/include/wx/univ/statbox.h +++ /dev/null @@ -1,65 +0,0 @@ -////////////////////////////////////////////////////////////////////////////// -// Name: wx/univ/statbox.h -// Purpose: wxStaticBox declaration -// Author: Vadim Zeitlin -// Modified by: -// Created: 15.08.00 -// RCS-ID: $Id: statbox.h 37393 2006-02-08 21:47:09Z VZ $ -// Copyright: (c) 2000 SciTech Software, Inc. (www.scitechsoft.com) -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_UNIV_STATBOX_H_ -#define _WX_UNIV_STATBOX_H_ - -class WXDLLEXPORT wxStaticBox : public wxStaticBoxBase -{ -public: - wxStaticBox() { } - - wxStaticBox(wxWindow *parent, - const wxString& label, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize) - { - Create(parent, wxID_ANY, label, pos, size); - } - - 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); - - // the origin of the static box is inside the border and under the label: - // take account of this - virtual wxPoint GetBoxAreaOrigin() const; - - // returning true from here ensures that we act as a container window for - // our children - virtual bool IsStaticBox() const { return true; } - -protected: - // draw the control - virtual void DoDraw(wxControlRenderer *renderer); - - // get the size of the border - wxRect GetBorderGeometry() const; - -private: - DECLARE_DYNAMIC_CLASS(wxStaticBox) -}; - -#endif // _WX_UNIV_STATBOX_H_ diff --git a/wxWidgets/include/wx/univ/statline.h b/wxWidgets/include/wx/univ/statline.h deleted file mode 100644 index bd49470174..0000000000 --- a/wxWidgets/include/wx/univ/statline.h +++ /dev/null @@ -1,56 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/univ/statline.h -// Purpose: wxStaticLine class for wxUniversal -// Author: Vadim Zeitlin -// Created: 28.06.99 -// Version: $Id: statline.h 43874 2006-12-09 14:52:59Z VZ $ -// Copyright: (c) 1999 Vadim Zeitlin -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_UNIV_STATLINE_H_ -#define _WX_UNIV_STATLINE_H_ - -class WXDLLEXPORT wxStaticLine : public wxStaticLineBase -{ -public: - // constructors and pseudo-constructors - wxStaticLine() { } - - wxStaticLine(wxWindow *parent, - const wxPoint &pos, - wxCoord length, - long style = wxLI_HORIZONTAL) - { - Create(parent, wxID_ANY, pos, - style & wxLI_VERTICAL ? wxSize(wxDefaultCoord, length) - : wxSize(length, wxDefaultCoord), - style); - } - - wxStaticLine(wxWindow *parent, - wxWindowID id = wxID_ANY, - const wxPoint &pos = wxDefaultPosition, - const wxSize &size = wxDefaultSize, - long style = wxLI_HORIZONTAL, - const wxString &name = wxStaticLineNameStr ) - { - Create(parent, id, pos, size, style, name); - } - - bool Create(wxWindow *parent, - wxWindowID id = wxID_ANY, - const wxPoint &pos = wxDefaultPosition, - const wxSize &size = wxDefaultSize, - long style = wxLI_HORIZONTAL, - const wxString &name = wxStaticLineNameStr ); - -protected: - virtual void DoDraw(wxControlRenderer *renderer); - -private: - DECLARE_DYNAMIC_CLASS(wxStaticLine) -}; - -#endif // _WX_UNIV_STATLINE_H_ - diff --git a/wxWidgets/include/wx/univ/stattext.h b/wxWidgets/include/wx/univ/stattext.h deleted file mode 100644 index d5e210d133..0000000000 --- a/wxWidgets/include/wx/univ/stattext.h +++ /dev/null @@ -1,66 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/univ/stattext.h -// Purpose: wxStaticText -// Author: Vadim Zeitlin -// Modified by: -// Created: 14.08.00 -// RCS-ID: $Id: stattext.h 35650 2005-09-23 12:56:45Z MR $ -// Copyright: (c) 2000 SciTech Software, Inc. (www.scitechsoft.com) -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_UNIV_STATTEXT_H_ -#define _WX_UNIV_STATTEXT_H_ - -class WXDLLEXPORT wxStaticText : public wxStaticTextBase -{ -public: - wxStaticText() { } - - // usual ctor - wxStaticText(wxWindow *parent, - const wxString& label, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize) - { - Create(parent, wxID_ANY, label, pos, size, 0, wxStaticTextNameStr); - } - - // full form - 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); - } - - // function ctor - bool Create(wxWindow *parent, - wxWindowID id, - const wxString &label, - const wxPoint &pos = wxDefaultPosition, - const wxSize &size = wxDefaultSize, - long style = 0, - const wxString &name = wxStaticTextNameStr); - - // implementation only from now on - - virtual void SetLabel(const wxString& label); - - virtual bool IsFocused() const { return false; } - -protected: - // calculate the optimal size for the label - virtual wxSize DoGetBestClientSize() const; - - // draw the control - virtual void DoDraw(wxControlRenderer *renderer); - - DECLARE_ABSTRACT_CLASS(wxStaticText) -}; - -#endif // _WX_UNIV_STATTEXT_H_ diff --git a/wxWidgets/include/wx/univ/statusbr.h b/wxWidgets/include/wx/univ/statusbr.h deleted file mode 100644 index eb657b0e43..0000000000 --- a/wxWidgets/include/wx/univ/statusbr.h +++ /dev/null @@ -1,110 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: wx/univ/statusbr.h -// Purpose: wxStatusBarUniv: wxStatusBar for wxUniversal declaration -// Author: Vadim Zeitlin -// Modified by: -// Created: 14.10.01 -// RCS-ID: $Id: statusbr.h 37393 2006-02-08 21:47:09Z VZ $ -// Copyright: (c) 2001 SciTech Software, Inc. (www.scitechsoft.com) -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_UNIV_STATUSBR_H_ -#define _WX_UNIV_STATUSBR_H_ - -#include "wx/univ/inpcons.h" -#include "wx/arrstr.h" - -// ---------------------------------------------------------------------------- -// wxStatusBar: a window near the bottom of the frame used for status info -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxStatusBarUniv : public wxStatusBarBase, - public wxInputConsumer -{ -public: - wxStatusBarUniv() { Init(); } - - wxStatusBarUniv(wxWindow *parent, - wxWindowID id = wxID_ANY, - long style = 0, - const wxString& name = wxPanelNameStr) - { - Init(); - - (void)Create(parent, id, style, name); - } - - bool Create(wxWindow *parent, - wxWindowID id = wxID_ANY, - long style = 0, - const wxString& name = wxPanelNameStr); - - // set field count/widths - virtual void SetFieldsCount(int number = 1, const int *widths = NULL); - virtual void SetStatusWidths(int n, const int widths[]); - - // get/set the text of the given field - virtual void SetStatusText(const wxString& text, int number = 0); - virtual wxString GetStatusText(int number = 0) const; - - // Get the position and size of the field's internal bounding rectangle - virtual bool GetFieldRect(int i, wxRect& rect) const; - - // sets the minimal vertical size of the status bar - virtual void SetMinHeight(int height); - - // get the dimensions of the horizontal and vertical borders - virtual int GetBorderX() const; - virtual int GetBorderY() const; - - // wxInputConsumer pure virtual - virtual wxWindow *GetInputWindow() const - { return wx_const_cast(wxStatusBar*, this); } - -protected: - // recalculate the field widths - void OnSize(wxSizeEvent& event); - - // draw the statusbar - virtual void DoDraw(wxControlRenderer *renderer); - - // tell them about our preferred height - virtual wxSize DoGetBestSize() const; - - // override DoSetSize() to prevent the status bar height from changing - virtual void DoSetSize(int x, int y, - int width, int height, - int sizeFlags = wxSIZE_AUTO); - - // get the (fixed) status bar height - wxCoord GetHeight() const; - - // get the rectangle containing all the fields and the border between them - // - // also updates m_widthsAbs if necessary - wxRect GetTotalFieldRect(wxCoord *borderBetweenFields); - - // get the rect for this field without ani side effects (see code) - wxRect DoGetFieldRect(int n) const; - - // refresh the given field - void RefreshField(int i); - - // common part of all ctors - void Init(); - -private: - // the status fields strings - wxArrayString m_statusText; - - // the absolute status fields widths - wxArrayInt m_widthsAbs; - - DECLARE_DYNAMIC_CLASS(wxStatusBarUniv) - DECLARE_EVENT_TABLE() - WX_DECLARE_INPUT_CONSUMER() -}; - -#endif // _WX_UNIV_STATUSBR_H_ - diff --git a/wxWidgets/include/wx/univ/stdrend.h b/wxWidgets/include/wx/univ/stdrend.h deleted file mode 100644 index 8994b37b83..0000000000 --- a/wxWidgets/include/wx/univ/stdrend.h +++ /dev/null @@ -1,352 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: wx/univ/stdrend.h -// Purpose: wxStdRenderer class declaration -// Author: Vadim Zeitlin -// Created: 2006-09-18 -// RCS-ID: $Id: stdrend.h 42716 2006-10-30 12:33:25Z VS $ -// Copyright: (c) 2006 Vadim Zeitlin <vadim@wxwindows.org> -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_UNIV_STDREND_H_ -#define _WX_UNIV_STDREND_H_ - -#include "wx/univ/renderer.h" -#include "wx/pen.h" - -class WXDLLEXPORT wxColourScheme; - -// ---------------------------------------------------------------------------- -// wxStdRenderer: implements as much of wxRenderer API as possible generically -// ---------------------------------------------------------------------------- - -class wxStdRenderer : public wxRenderer -{ -public: - // the renderer will use the given scheme, whose lifetime must be at least - // as long as of this object itself, to choose the colours for drawing - wxStdRenderer(const wxColourScheme *scheme); - - virtual void DrawBackground(wxDC& dc, - const wxColour& col, - const wxRect& rect, - int flags = 0, - wxWindow *window = NULL); - virtual void DrawButtonSurface(wxDC& dc, - const wxColour& col, - const wxRect& rect, - int flags); - - - virtual void DrawFocusRect(wxDC& dc, const wxRect& rect, int flags = 0); - virtual void DrawLabel(wxDC& dc, - const wxString& label, - const wxRect& rect, - int flags = 0, - int alignment = wxALIGN_LEFT | wxALIGN_TOP, - int indexAccel = -1, - wxRect *rectBounds = NULL); - virtual void DrawButtonLabel(wxDC& dc, - const wxString& label, - const wxBitmap& image, - const wxRect& rect, - int flags = 0, - int alignment = wxALIGN_LEFT | wxALIGN_TOP, - int indexAccel = -1, - wxRect *rectBounds = NULL); - - - virtual void DrawBorder(wxDC& dc, - wxBorder border, - const wxRect& rect, - int flags = 0, - wxRect *rectIn = NULL); - virtual void DrawTextBorder(wxDC& dc, - wxBorder border, - const wxRect& rect, - int flags = 0, - wxRect *rectIn = NULL); - - virtual void DrawHorizontalLine(wxDC& dc, - wxCoord y, wxCoord x1, wxCoord x2); - virtual void DrawVerticalLine(wxDC& dc, - wxCoord x, wxCoord y1, wxCoord y2); - virtual void DrawFrame(wxDC& dc, - const wxString& label, - const wxRect& rect, - int flags = 0, - int alignment = wxALIGN_LEFT, - int indexAccel = -1); - - - virtual void DrawItem(wxDC& dc, - const wxString& label, - const wxRect& rect, - int flags = 0); - virtual void DrawCheckItem(wxDC& dc, - const wxString& label, - const wxBitmap& bitmap, - const wxRect& rect, - int flags = 0); - - virtual void DrawCheckButton(wxDC& dc, - const wxString& label, - const wxBitmap& bitmap, - const wxRect& rect, - int flags = 0, - wxAlignment align = wxALIGN_LEFT, - int indexAccel = -1); - virtual void DrawRadioButton(wxDC& dc, - const wxString& label, - const wxBitmap& bitmap, - const wxRect& rect, - int flags = 0, - wxAlignment align = wxALIGN_LEFT, - int indexAccel = -1); - - virtual void DrawScrollbarArrow(wxDC& dc, - wxDirection dir, - const wxRect& rect, - int flags = 0); - virtual void DrawScrollCorner(wxDC& dc, - const wxRect& rect); - -#if wxUSE_TEXTCTRL - virtual void DrawTextLine(wxDC& dc, - const wxString& text, - const wxRect& rect, - int selStart = -1, - int selEnd = -1, - int flags = 0); - - virtual void DrawLineWrapMark(wxDC& dc, const wxRect& rect); - - virtual wxRect GetTextTotalArea(const wxTextCtrl *text, - const wxRect& rect) const; - virtual wxRect GetTextClientArea(const wxTextCtrl *text, - const wxRect& rect, - wxCoord *extraSpaceBeyond) const; -#endif // wxUSE_TEXTCTRL - - virtual wxRect GetBorderDimensions(wxBorder border) const; - - virtual bool AreScrollbarsInsideBorder() const; - - virtual void AdjustSize(wxSize *size, const wxWindow *window); - - virtual wxCoord GetListboxItemHeight(wxCoord fontHeight); - -#if wxUSE_STATUSBAR - virtual void DrawStatusField(wxDC& dc, - const wxRect& rect, - const wxString& label, - int flags = 0, int style = 0); - - virtual wxSize GetStatusBarBorders() const; - - virtual wxCoord GetStatusBarBorderBetweenFields() const; - - virtual wxSize GetStatusBarFieldMargins() const; -#endif // wxUSE_STATUSBAR - - virtual wxCoord GetCheckItemMargin() const { return 0; } - - - virtual void DrawFrameTitleBar(wxDC& dc, - const wxRect& rect, - const wxString& title, - const wxIcon& icon, - int flags, - int specialButton = 0, - int specialButtonFlag = 0); - virtual void DrawFrameBorder(wxDC& dc, - const wxRect& rect, - int flags); - virtual void DrawFrameBackground(wxDC& dc, - const wxRect& rect, - int flags); - virtual void DrawFrameTitle(wxDC& dc, - const wxRect& rect, - const wxString& title, - int flags); - virtual void DrawFrameIcon(wxDC& dc, - const wxRect& rect, - const wxIcon& icon, - int flags); - virtual void DrawFrameButton(wxDC& dc, - wxCoord x, wxCoord y, - int button, - int flags = 0); - - virtual wxRect GetFrameClientArea(const wxRect& rect, int flags) const; - - virtual wxSize GetFrameTotalSize(const wxSize& clientSize, int flags) const; - - virtual wxSize GetFrameMinSize(int flags) const; - - virtual wxSize GetFrameIconSize() const; - - virtual int HitTestFrame(const wxRect& rect, - const wxPoint& pt, - int flags = 0) const; -protected: - // various constants - enum ArrowDirection - { - Arrow_Left, - Arrow_Right, - Arrow_Up, - Arrow_Down, - Arrow_Max - }; - - enum ArrowStyle - { - Arrow_Normal, - Arrow_Disabled, - Arrow_Pressed, - Arrow_Inverted, - Arrow_InvertedDisabled, - Arrow_StateMax - }; - - enum FrameButtonType - { - FrameButton_Close, - FrameButton_Minimize, - FrameButton_Maximize, - FrameButton_Restore, - FrameButton_Help, - FrameButton_Max - }; - - enum IndicatorType - { - IndicatorType_Check, - IndicatorType_Radio, - IndicatorType_MaxCtrl, - IndicatorType_Menu = IndicatorType_MaxCtrl, - IndicatorType_Max - }; - - enum IndicatorState - { - IndicatorState_Normal, - IndicatorState_Pressed, // this one is for check/radioboxes - IndicatorState_Disabled, - IndicatorState_MaxCtrl, - - // the rest of the states are valid for menu items only - IndicatorState_Selected = IndicatorState_Pressed, - IndicatorState_SelectedDisabled = IndicatorState_MaxCtrl, - IndicatorState_MaxMenu - }; - - enum IndicatorStatus - { - IndicatorStatus_Checked, - IndicatorStatus_Unchecked, - IndicatorStatus_Undetermined, - IndicatorStatus_Max - }; - - // translate the appropriate bits in flags to the above enum elements - static void GetIndicatorsFromFlags(int flags, - IndicatorState& state, - IndicatorStatus& status); - - // translate wxDirection to ArrowDirection - static ArrowDirection GetArrowDirection(wxDirection dir); - - - // fill the rectangle with a brush of given colour (must be valid) - void DrawSolidRect(wxDC& dc, const wxColour& col, const wxRect& rect); - - - // all the functions in this section adjust the rect parameter to - // correspond to the interiour of the drawn area - - // draw complete rectangle - void DrawRect(wxDC& dc, wxRect *rect, const wxPen& pen); - - // draw the rectange using the first pen for the left and top sides - // and the second one for the bottom and right ones - void DrawShadedRect(wxDC& dc, wxRect *rect, - const wxPen& pen1, const wxPen& pen2); - - // border drawing routines, may be overridden in the derived class - virtual void DrawRaisedBorder(wxDC& dc, wxRect *rect); - virtual void DrawSunkenBorder(wxDC& dc, wxRect *rect); - virtual void DrawAntiSunkenBorder(wxDC& dc, wxRect *rect); - virtual void DrawBoxBorder(wxDC& dc, wxRect *rect); - virtual void DrawStaticBorder(wxDC& dc, wxRect *rect); - virtual void DrawExtraBorder(wxDC& dc, wxRect *rect); - - - // draw the frame with non-empty label inside the given rectText - virtual void DrawFrameWithLabel(wxDC& dc, - const wxString& label, - const wxRect& rectFrame, - const wxRect& rectText, - int flags, - int alignment, - int indexAccel); - - // draw the (static box) frame without the part corresponding to rectLabel - void DrawFrameWithoutLabel(wxDC& dc, - const wxRect& rectFrame, - const wxRect& rectLabel); - - - // draw the bitmap for a check item (which is by default the same as check - // box one but may be different) - virtual void DrawCheckItemBitmap(wxDC& dc, - const wxBitmap& bitmap, - const wxRect& rect, - int flags); - - // common routine for drawing check and radio buttons - void DrawCheckOrRadioButton(wxDC& dc, - const wxString& label, - const wxBitmap& bitmap, - const wxRect& rect, - int flags, - wxAlignment align, - int indexAccel); - - // return the check/radio bitmap for the given flags - virtual wxBitmap GetRadioBitmap(int flags) = 0; - virtual wxBitmap GetCheckBitmap(int flags) = 0; - - // return the frame icon bitmap - virtual wxBitmap GetFrameButtonBitmap(FrameButtonType type) = 0; - - // get the width of either normal or resizeable frame border depending on - // whether flags contains wxTOPLEVEL_RESIZEABLE bit - // - // notice that these methods only make sense with standard border drawing - // code which uses the borders of the same width on all sides, this is why - // they are only present here and not in wxRenderer itself - virtual int GetFrameBorderWidth(int flags) const; - -#if wxUSE_TEXTCTRL - // return the width of the border around the text area in the text control - virtual int GetTextBorderWidth(const wxTextCtrl *text) const; -#endif // wxUSE_TEXTCTRL - - // GDI objects we often use - wxPen m_penBlack, - m_penDarkGrey, - m_penLightGrey, - m_penHighlight; - - wxFont m_titlebarFont; - - // the colours we use, they never change currently so we don't have to ever - // update m_penXXX objects above - const wxColourScheme * const m_scheme; - - DECLARE_NO_COPY_CLASS(wxStdRenderer) -}; - -#endif // _WX_UNIV_STDREND_H_ diff --git a/wxWidgets/include/wx/univ/textctrl.h b/wxWidgets/include/wx/univ/textctrl.h deleted file mode 100644 index 4d3dd3ce34..0000000000 --- a/wxWidgets/include/wx/univ/textctrl.h +++ /dev/null @@ -1,534 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/univ/textctrl.h -// Purpose: wxTextCtrl class -// Author: Vadim Zeitlin -// Modified by: -// Created: 15.09.00 -// RCS-ID: $Id: textctrl.h 61872 2009-09-09 22:37:05Z VZ $ -// Copyright: (c) 2000 SciTech Software, Inc. (www.scitechsoft.com) -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_UNIV_TEXTCTRL_H_ -#define _WX_UNIV_TEXTCTRL_H_ - -class WXDLLEXPORT wxCaret; -class WXDLLEXPORT wxTextCtrlCommandProcessor; - -#include "wx/scrolwin.h" // for wxScrollHelper - -#include "wx/univ/inphand.h" - -// ---------------------------------------------------------------------------- -// wxTextCtrl actions -// ---------------------------------------------------------------------------- - -// cursor movement and also selection and delete operations -#define wxACTION_TEXT_GOTO wxT("goto") // to pos in numArg -#define wxACTION_TEXT_FIRST wxT("first") // go to pos 0 -#define wxACTION_TEXT_LAST wxT("last") // go to last pos -#define wxACTION_TEXT_HOME wxT("home") -#define wxACTION_TEXT_END wxT("end") -#define wxACTION_TEXT_LEFT wxT("left") -#define wxACTION_TEXT_RIGHT wxT("right") -#define wxACTION_TEXT_UP wxT("up") -#define wxACTION_TEXT_DOWN wxT("down") -#define wxACTION_TEXT_WORD_LEFT wxT("wordleft") -#define wxACTION_TEXT_WORD_RIGHT wxT("wordright") -#define wxACTION_TEXT_PAGE_UP wxT("pageup") -#define wxACTION_TEXT_PAGE_DOWN wxT("pagedown") - -// clipboard operations -#define wxACTION_TEXT_COPY wxT("copy") -#define wxACTION_TEXT_CUT wxT("cut") -#define wxACTION_TEXT_PASTE wxT("paste") - -// insert text at the cursor position: the text is in strArg of PerformAction -#define wxACTION_TEXT_INSERT wxT("insert") - -// if the action starts with either of these prefixes and the rest of the -// string is one of the movement commands, it means to select/delete text from -// the current cursor position to the new one -#define wxACTION_TEXT_PREFIX_SEL wxT("sel") -#define wxACTION_TEXT_PREFIX_DEL wxT("del") - -// mouse selection -#define wxACTION_TEXT_ANCHOR_SEL wxT("anchorsel") -#define wxACTION_TEXT_EXTEND_SEL wxT("extendsel") -#define wxACTION_TEXT_SEL_WORD wxT("wordsel") -#define wxACTION_TEXT_SEL_LINE wxT("linesel") - -// undo or redo -#define wxACTION_TEXT_UNDO wxT("undo") -#define wxACTION_TEXT_REDO wxT("redo") - -// ---------------------------------------------------------------------------- -// wxTextCtrl -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxTextCtrl : public wxTextCtrlBase, - public wxScrollHelper -{ -public: - // creation - // -------- - - wxTextCtrl() : wxScrollHelper(this) { Init(); } - - 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) - : wxScrollHelper(this) - { - 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); - - virtual ~wxTextCtrl(); - - // implement base class pure virtuals - // ---------------------------------- - - virtual wxString GetValue() const; - - virtual int GetLineLength(wxTextCoord lineNo) const; - virtual wxString GetLineText(wxTextCoord 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(wxTextPos* from, wxTextPos* to) const; - - // operations - // ---------- - - // editing - virtual void Clear(); - virtual void Replace(wxTextPos from, wxTextPos to, const wxString& value); - virtual void Remove(wxTextPos from, wxTextPos to); - - // sets/clears the dirty flag - virtual void MarkDirty(); - virtual void DiscardEdits(); - - // 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 (logical, i.e. unwrapped) column and line. - virtual wxTextPos XYToPosition(wxTextCoord x, wxTextCoord y) const; - virtual bool PositionToXY(wxTextPos pos, - wxTextCoord *x, wxTextCoord *y) const; - - // wxUniv-specific: find a screen position (in client coordinates) of the - // given text position or of the caret - bool PositionToLogicalXY(wxTextPos pos, wxCoord *x, wxCoord *y) const; - bool PositionToDeviceXY(wxTextPos pos, wxCoord *x, wxCoord *y) const; - wxPoint GetCaretPosition() const; - - virtual void ShowPosition(wxTextPos pos); - - // Clipboard operations - virtual void Copy(); - virtual void Cut(); - virtual void Paste(); - - // Undo/redo - virtual void Undo(); - virtual void Redo(); - - virtual bool CanUndo() const; - virtual bool CanRedo() const; - - // Insertion point - virtual void SetInsertionPoint(wxTextPos pos); - virtual void SetInsertionPointEnd(); - virtual wxTextPos GetInsertionPoint() const; - virtual wxTextPos GetLastPosition() const; - - virtual void SetSelection(wxTextPos from, wxTextPos to); - virtual void SetEditable(bool editable); - - // wxUniv-specific methods - // ----------------------- - - // caret stuff - virtual void ShowCaret(bool show = true); - void HideCaret() { ShowCaret(false); } - void CreateCaret(); // for the current font size - - // helpers for cursor movement - wxTextPos GetWordStart() const; - wxTextPos GetWordEnd() const; - - // selection helpers - bool HasSelection() const - { return m_selStart != -1 && m_selEnd > m_selStart; } - void ClearSelection(); - void RemoveSelection(); - wxString GetSelectionText() const; - - virtual wxTextCtrlHitTestResult HitTest(const wxPoint& pt, long *pos) const; - virtual wxTextCtrlHitTestResult HitTest(const wxPoint& pt, - wxTextCoord *col, - wxTextCoord *row) const; - - // find the character at this position in the given line, return value as - // for HitTest() - // - // NB: x is the logical coord (client and unscrolled) - wxTextCtrlHitTestResult HitTestLine(const wxString& line, - wxCoord x, - wxTextCoord *colOut) const; - - // bring the given position into view - void ShowHorzPosition(wxCoord pos); - - // scroll the window horizontally so that the first character shown is in - // position pos - void ScrollText(wxTextCoord col); - - // adjust the DC for horz text control scrolling too - virtual void DoPrepareDC(wxDC& dc); - - // implementation only from now on - // ------------------------------- - - // override this to take into account our scrollbar-less scrolling - virtual void CalcUnscrolledPosition(int x, int y, int *xx, int *yy) const; - virtual void CalcScrolledPosition(int x, int y, int *xx, int *yy) const; - - // perform an action - virtual bool PerformAction(const wxControlAction& action, - long numArg = -1, - const wxString& strArg = wxEmptyString); - - static wxInputHandler *GetStdInputHandler(wxInputHandler *handlerDef); - virtual wxInputHandler *DoGetStdInputHandler(wxInputHandler *handlerDef) - { - return GetStdInputHandler(handlerDef); - } - - // override these methods to handle the caret - virtual bool SetFont(const wxFont &font); - virtual bool Enable(bool enable = true); - - // more readable flag testing methods - bool IsPassword() const { return HasFlag(wxTE_PASSWORD); } - bool WrapLines() const { return m_wrapLines; } - - // only for wxStdTextCtrlInputHandler - void RefreshSelection(); - - // override wxScrollHelper method to prevent (auto)scrolling beyond the end - // of line - virtual bool SendAutoScrollEvents(wxScrollWinEvent& event) const; - - // idle processing - virtual void OnInternalIdle(); - -protected: - // ensure we have correct default border - virtual wxBorder GetDefaultBorder() const { return wxBORDER_SUNKEN; } - - // override base class methods - virtual void DoDrawBorder(wxDC& dc, const wxRect& rect); - virtual void DoDraw(wxControlRenderer *renderer); - - // calc the size from the text extent - virtual wxSize DoGetBestClientSize() const; - - // implements Set/ChangeValue() - virtual void DoSetValue(const wxString& value, int flags = 0); - - // common part of all ctors - void Init(); - - // drawing - // ------- - - // draw the text in the given rectangle - void DoDrawTextInRect(wxDC& dc, const wxRect& rectUpdate); - - // draw the line wrap marks in this rect - void DoDrawLineWrapMarks(wxDC& dc, const wxRect& rectUpdate); - - // line/row geometry calculations - // ------------------------------ - - // get the extent (width) of the text - wxCoord GetTextWidth(const wxString& text) const; - - // get the logical text width (accounting for scrolling) - wxCoord GetTotalWidth() const; - - // get total number of rows (different from number of lines if the lines - // can be wrapped) - wxTextCoord GetRowCount() const; - - // find the number of rows in this line (only if WrapLines()) - wxTextCoord GetRowsPerLine(wxTextCoord line) const; - - // get the starting row of the given line - wxTextCoord GetFirstRowOfLine(wxTextCoord line) const; - - // get the row following this line - wxTextCoord GetRowAfterLine(wxTextCoord line) const; - - // refresh functions - // ----------------- - - // the text area is the part of the window in which the text can be - // displayed, i.e. part of it inside the margins and the real text area is - // the area in which the text *is* currently displayed: for example, in the - // multiline control case the text area can have extra space at the bottom - // which is not tall enough for another line and which is then not included - // into the real text area - wxRect GetRealTextArea() const; - - // refresh the text in the given (in logical coords) rect - void RefreshTextRect(const wxRect& rect, bool textOnly = true); - - // refresh the line wrap marks for the given range of lines (inclusive) - void RefreshLineWrapMarks(wxTextCoord rowFirst, wxTextCoord rowLast); - - // refresh the text in the given range (in logical coords) of this line, if - // width is 0, refresh to the end of line - void RefreshPixelRange(wxTextCoord line, wxCoord start, wxCoord width); - - // refresh the text in the given range (in text coords) in this line - void RefreshColRange(wxTextCoord line, wxTextPos start, size_t count); - - // refresh the text from in the given line range (inclusive) - void RefreshLineRange(wxTextCoord lineFirst, wxTextCoord lineLast); - - // refresh the text in the given range which can span multiple lines - // (this method accepts arguments in any order) - void RefreshTextRange(wxTextPos start, wxTextPos end); - - // get the text to show: either the text itself or the text replaced with - // starts for wxTE_PASSWORD control - wxString GetTextToShow(const wxString& text) const; - - // find the row in this line where the given position (counted from the - // start of line) is - wxTextCoord GetRowInLine(wxTextCoord line, - wxTextCoord col, - wxTextCoord *colRowStart = NULL) const; - - // find the number of characters of a line before it wraps - // (and optionally also the real width of the line) - size_t GetPartOfWrappedLine(const wxChar* text, - wxCoord *widthReal = NULL) const; - - // get the start and end of the selection for this line: if the line is - // outside the selection, both will be -1 and false will be returned - bool GetSelectedPartOfLine(wxTextCoord line, - wxTextPos *start, wxTextPos *end) const; - - // update the text rect: the zone inside our client rect (its coords are - // client coords) which contains the text - void UpdateTextRect(); - - // calculate the last visible position - void UpdateLastVisible(); - - // move caret to the given position unconditionally - // (SetInsertionPoint() does nothing if the position didn't change) - void DoSetInsertionPoint(wxTextPos pos); - - // move caret to the new position without updating the display (for - // internal use only) - void MoveInsertionPoint(wxTextPos pos); - - // set the caret to its initial (default) position - void InitInsertionPoint(); - - // get the width of the longest line in pixels - wxCoord GetMaxWidth() const; - - // force recalculation of the max line width - void RecalcMaxWidth(); - - // update the max width after the given line was modified - void UpdateMaxWidth(wxTextCoord line); - - // hit testing - // ----------- - - // HitTest2() is more efficient than 2 consecutive HitTest()s with the same - // line (i.e. y) and it also returns the offset of the starting position in - // pixels - // - // as the last hack, this function accepts either logical or device (by - // default) coords depending on devCoords flag - wxTextCtrlHitTestResult HitTest2(wxCoord y, - wxCoord x1, - wxCoord x2, - wxTextCoord *row, - wxTextCoord *colStart, - wxTextCoord *colEnd, - wxTextCoord *colRowStart, - bool devCoords = true) const; - - // HitTest() version which takes the logical text coordinates and not the - // device ones - wxTextCtrlHitTestResult HitTestLogical(const wxPoint& pos, - wxTextCoord *col, - wxTextCoord *row) const; - - // get the line and the row in this line corresponding to the given row, - // return true if ok and false if row is out of range - // - // NB: this function can only be called for controls which wrap lines - bool GetLineAndRow(wxTextCoord row, - wxTextCoord *line, - wxTextCoord *rowInLine) const; - - // get the height of one line (the same for all lines) - wxCoord GetLineHeight() const - { - // this one should be already precalculated - wxASSERT_MSG( m_heightLine != -1, wxT("should have line height") ); - - return m_heightLine; - } - - // get the average char width - wxCoord GetAverageWidth() const { return m_widthAvg; } - - // recalc the line height and char width (to call when the font changes) - void RecalcFontMetrics(); - - // vertical scrolling helpers - // -------------------------- - - // all these functions are for multi line controls only - - // get the number of visible lines - size_t GetLinesPerPage() const; - - // return the position above the cursor or INVALID_POS_VALUE - wxTextPos GetPositionAbove(); - - // return the position below the cursor or INVALID_POS_VALUE - wxTextPos GetPositionBelow(); - - // event handlers - // -------------- - void OnChar(wxKeyEvent& event); - void OnSize(wxSizeEvent& event); - - // return the struct containing control-type dependent data - struct wxTextSingleLineData& SData() { return *m_data.sdata; } - struct wxTextMultiLineData& MData() { return *m_data.mdata; } - struct wxTextWrappedData& WData() { return *m_data.wdata; } - const wxTextSingleLineData& SData() const { return *m_data.sdata; } - const wxTextMultiLineData& MData() const { return *m_data.mdata; } - const wxTextWrappedData& WData() const { return *m_data.wdata; } - - // clipboard operations (unlike the versions without Do prefix, they have a - // return code) - bool DoCut(); - bool DoPaste(); - -private: - // all these methods are for multiline text controls only - - // update the scrollbars (only called from OnIdle) - void UpdateScrollbars(); - - // get read only access to the lines of multiline control - inline const wxArrayString& GetLines() const; - inline size_t GetLineCount() const; - - // replace a line (returns true if the number of rows in thel ine changed) - bool ReplaceLine(wxTextCoord line, const wxString& text); - - // remove a line - void RemoveLine(wxTextCoord line); - - // insert a line at this position - void InsertLine(wxTextCoord line, const wxString& text); - - // calculate geometry of this line - void LayoutLine(wxTextCoord line, class wxWrappedLineData& lineData) const; - - // calculate geometry of all lines until the given one - void LayoutLines(wxTextCoord lineLast) const; - - // the initially specified control size - wxSize m_sizeInitial; - - // the global control text - wxString m_value; - - // current position - wxTextPos m_curPos; - wxTextCoord m_curCol, - m_curRow; - - // last position (only used by GetLastPosition()) - wxTextPos m_posLast; - - // selection - wxTextPos m_selAnchor, - m_selStart, - m_selEnd; - - // flags - bool m_isModified:1, - m_isEditable:1, - m_hasCaret:1, - m_wrapLines:1; // can't be changed after creation - - // the rectangle (in client coordinates) to draw text inside - wxRect m_rectText; - - // the height of one line (cached value of GetCharHeight) - wxCoord m_heightLine; - - // and the average char width (cached value of GetCharWidth) - wxCoord m_widthAvg; - - // we have some data which depends on the kind of control (single or multi - // line) - union - { - wxTextSingleLineData *sdata; - wxTextMultiLineData *mdata; - wxTextWrappedData *wdata; - void *data; - } m_data; - - // the object to which we delegate our undo/redo implementation - wxTextCtrlCommandProcessor *m_cmdProcessor; - - DECLARE_EVENT_TABLE() - DECLARE_DYNAMIC_CLASS(wxTextCtrl) - - friend class wxWrappedLineData; -}; - -#endif // _WX_UNIV_TEXTCTRL_H_ - diff --git a/wxWidgets/include/wx/univ/tglbtn.h b/wxWidgets/include/wx/univ/tglbtn.h deleted file mode 100644 index 2024343450..0000000000 --- a/wxWidgets/include/wx/univ/tglbtn.h +++ /dev/null @@ -1,70 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: wx/univ/button.h -// Purpose: wxToggleButton for wxUniversal -// Author: Vadim Zeitlin -// Modified by: David Bjorkevik -// Created: 16.05.06 -// RCS-ID: $Id: tglbtn.h 39320 2006-05-24 17:17:27Z PC $ -// Copyright: (c) 2000 SciTech Software, Inc. (www.scitechsoft.com) -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_UNIV_TGLBTN_H_ -#define _WX_UNIV_TGLBTN_H_ - -#include "wx/button.h" - -extern WXDLLEXPORT_DATA(const wxChar) wxCheckBoxNameStr[]; - -// ---------------------------------------------------------------------------- -// wxToggleButton: a push button -// ---------------------------------------------------------------------------- - -class WXDLLIMPEXP_CORE wxToggleButton: public wxButton -{ -public: - wxToggleButton(); - - wxToggleButton(wxWindow *parent, - wxWindowID id, - const wxBitmap& bitmap, - const wxString& label = wxEmptyString, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = 0, - const wxValidator& validator = wxDefaultValidator, - const wxString& name = wxCheckBoxNameStr); - - wxToggleButton(wxWindow *parent, - wxWindowID id, - const wxString& label = wxEmptyString, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = 0, - const wxValidator& validator = wxDefaultValidator, - const wxString& name = wxCheckBoxNameStr); - - virtual ~wxToggleButton(); - - virtual bool IsPressed() const { return m_isPressed || m_value; } - - // wxToggleButton actions - virtual void Toggle(); - virtual void Click(); - - // Get/set the value - void SetValue(bool state); - bool GetValue() const { return m_value; } - -protected: - // the current value - bool m_value; - -private: - // common part of all ctors - void Init(); - - DECLARE_DYNAMIC_CLASS(wxToggleButton) -}; - -#endif // _WX_UNIV_TGLBTN_H_ diff --git a/wxWidgets/include/wx/univ/theme.h b/wxWidgets/include/wx/univ/theme.h deleted file mode 100644 index 02d74a8f4e..0000000000 --- a/wxWidgets/include/wx/univ/theme.h +++ /dev/null @@ -1,202 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: wx/univ/theme.h -// Purpose: wxTheme class manages all configurable aspects of the -// application including the look (wxRenderer), feel -// (wxInputHandler) and the colours (wxColourScheme) -// Author: Vadim Zeitlin -// Modified by: -// Created: 06.08.00 -// RCS-ID: $Id: theme.h 42455 2006-10-26 15:33:10Z VS $ -// Copyright: (c) 2000 SciTech Software, Inc. (www.scitechsoft.com) -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_UNIV_THEME_H_ -#define _WX_UNIV_THEME_H_ - -#include "wx/string.h" - -// ---------------------------------------------------------------------------- -// wxTheme -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxArtProvider; -class WXDLLEXPORT wxColourScheme; -class WXDLLEXPORT wxInputConsumer; -class WXDLLEXPORT wxInputHandler; -class WXDLLEXPORT wxRenderer; -struct WXDLLEXPORT wxThemeInfo; - -class WXDLLEXPORT wxTheme -{ -public: - // static methods - // -------------- - - // create the default theme - static bool CreateDefault(); - - // create the theme by name (will return NULL if not found) - static wxTheme *Create(const wxString& name); - - // change the current scheme - static wxTheme *Set(wxTheme *theme); - - // get the current theme (never NULL) - static wxTheme *Get() { return ms_theme; } - - // the theme methods - // ----------------- - - // get the renderer implementing all the control-drawing operations in - // this theme - virtual wxRenderer *GetRenderer() = 0; - - // get the art provider to be used together with this theme - virtual wxArtProvider *GetArtProvider() = 0; - - // get the input handler of the given type, forward to the standard one - virtual wxInputHandler *GetInputHandler(const wxString& handlerType, - wxInputConsumer *consumer) = 0; - - // get the colour scheme for the control with this name - virtual wxColourScheme *GetColourScheme() = 0; - - // implementation only from now on - // ------------------------------- - - virtual ~wxTheme(); - -private: - // the list of descriptions of all known themes - static wxThemeInfo *ms_allThemes; - - // the current theme - static wxTheme *ms_theme; - friend struct WXDLLEXPORT wxThemeInfo; -}; - -// ---------------------------------------------------------------------------- -// wxDelegateTheme: it is impossible to inherit from any of standard -// themes as their declarations are in private code, but you can use this -// class to override only some of their functions - all the other ones -// will be left to the original theme -// ---------------------------------------------------------------------------- - -class wxDelegateTheme : public wxTheme -{ -public: - wxDelegateTheme(const wxChar *theme); - virtual ~wxDelegateTheme(); - - virtual wxRenderer *GetRenderer(); - virtual wxArtProvider *GetArtProvider(); - virtual wxInputHandler *GetInputHandler(const wxString& control, - wxInputConsumer *consumer); - virtual wxColourScheme *GetColourScheme(); - -protected: - // gets or creates theme and sets m_theme to point to it, - // returns true on success - bool GetOrCreateTheme(); - - wxString m_themeName; - wxTheme *m_theme; -}; - -// ---------------------------------------------------------------------------- -// dynamic theme creation helpers -// ---------------------------------------------------------------------------- - -struct WXDLLEXPORT wxThemeInfo -{ - typedef wxTheme *(*Constructor)(); - - // theme name and (user readable) description - wxString name, desc; - - // the function to create a theme object - Constructor ctor; - - // next node in the linked list or NULL - wxThemeInfo *next; - - // constructor for the struct itself - wxThemeInfo(Constructor ctor, const wxChar *name, const wxChar *desc); -}; - -// ---------------------------------------------------------------------------- -// macros -// ---------------------------------------------------------------------------- - -// to use a standard theme insert this macro into one of the application files: -// without it, an over optimizing linker may discard the object module -// containing the theme implementation entirely -#define WX_USE_THEME(themename) \ - /* this indirection makes it possible to pass macro as the argument */ \ - WX_USE_THEME_IMPL(themename) - -#define WX_USE_THEME_IMPL(themename) \ - extern WXDLLEXPORT_DATA(bool) wxThemeUse##themename; \ - static struct wxThemeUserFor##themename \ - { \ - wxThemeUserFor##themename() { wxThemeUse##themename = true; } \ - } wxThemeDoUse##themename - -// to declare a new theme, this macro must be used in the class declaration -#define WX_DECLARE_THEME(themename) \ - private: \ - static wxThemeInfo ms_info##themename; \ - public: \ - const wxThemeInfo *GetThemeInfo() const \ - { return &ms_info##themename; } - -// and this one must be inserted in the source file -#define WX_IMPLEMENT_THEME(classname, themename, themedesc) \ - WXDLLEXPORT_DATA(bool) wxThemeUse##themename = true; \ - wxTheme *wxCtorFor##themename() { return new classname; } \ - wxThemeInfo classname::ms_info##themename(wxCtorFor##themename, \ - wxT( #themename ), themedesc) - -// ---------------------------------------------------------------------------- -// determine default theme -// ---------------------------------------------------------------------------- - -#if wxUSE_ALL_THEMES - #undef wxUSE_THEME_WIN32 - #define wxUSE_THEME_WIN32 1 - #undef wxUSE_THEME_GTK - #define wxUSE_THEME_GTK 1 - #undef wxUSE_THEME_MONO - #define wxUSE_THEME_MONO 1 - #undef wxUSE_THEME_METAL - #define wxUSE_THEME_METAL 1 -#endif // wxUSE_ALL_THEMES - -// determine the default theme to use: -#if defined(__WXGTK__) && wxUSE_THEME_GTK - #define wxUNIV_DEFAULT_THEME gtk -#elif defined(__WXDFB__) && wxUSE_THEME_MONO - // use mono theme for DirectFB port because it cannot correctly - // render neither win32 nor gtk themes yet: - #define wxUNIV_DEFAULT_THEME mono -#endif - -// if no theme was picked, get any theme compiled in (sorted by -// quality/completeness of the theme): -#ifndef wxUNIV_DEFAULT_THEME - #if wxUSE_THEME_WIN32 - #define wxUNIV_DEFAULT_THEME win32 - #elif wxUSE_THEME_GTK - #define wxUNIV_DEFAULT_THEME gtk - #elif wxUSE_THEME_MONO - #define wxUNIV_DEFAULT_THEME mono - #endif - // If nothing matches, no themes are compiled and the app must provide - // some theme itself - // (note that wxUSE_THEME_METAL depends on win32 theme, so we don't have to - // try it) - // -#endif // !wxUNIV_DEFAULT_THEME - -#endif // _WX_UNIV_THEME_H_ diff --git a/wxWidgets/include/wx/univ/toolbar.h b/wxWidgets/include/wx/univ/toolbar.h deleted file mode 100644 index 0781141256..0000000000 --- a/wxWidgets/include/wx/univ/toolbar.h +++ /dev/null @@ -1,138 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: wx/univ/toolbar.h -// Purpose: wxToolBar declaration -// Author: Robert Roebling -// Modified by: -// Created: 10.09.00 -// RCS-ID: $Id: toolbar.h 61872 2009-09-09 22:37:05Z VZ $ -// Copyright: (c) Robert Roebling -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_UNIV_TOOLBAR_H_ -#define _WX_UNIV_TOOLBAR_H_ - -#include "wx/button.h" // for wxStdButtonInputHandler - -class WXDLLEXPORT wxToolBarTool; - -// ---------------------------------------------------------------------------- -// the actions supported by this control -// ---------------------------------------------------------------------------- - -#define wxACTION_TOOLBAR_TOGGLE wxACTION_BUTTON_TOGGLE -#define wxACTION_TOOLBAR_PRESS wxACTION_BUTTON_PRESS -#define wxACTION_TOOLBAR_RELEASE wxACTION_BUTTON_RELEASE -#define wxACTION_TOOLBAR_CLICK wxACTION_BUTTON_CLICK -#define wxACTION_TOOLBAR_ENTER wxT("enter") // highlight the tool -#define wxACTION_TOOLBAR_LEAVE wxT("leave") // unhighlight the tool - -// ---------------------------------------------------------------------------- -// wxToolBar -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxToolBar : public wxToolBarBase -{ -public: - // construction/destruction - wxToolBar() { Init(); } - wxToolBar(wxWindow *parent, - wxWindowID id, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = 0, - const wxString& name = wxToolBarNameStr) - { - Init(); - - Create(parent, id, pos, size, style, name); - } - - bool Create( wxWindow *parent, - wxWindowID id, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = 0, - const wxString& name = wxToolBarNameStr ); - - virtual ~wxToolBar(); - - virtual bool Realize(); - - virtual void SetWindowStyleFlag( long style ); - - virtual wxToolBarToolBase *FindToolForPosition(wxCoord x, wxCoord y) const; - - virtual void SetToolShortHelp(int id, const wxString& helpString); - - virtual void SetMargins(int x, int y); - void SetMargins(const wxSize& size) - { SetMargins((int) size.x, (int) size.y); } - - virtual bool PerformAction(const wxControlAction& action, - long numArg = -1, - const wxString& strArg = wxEmptyString); - static wxInputHandler *GetStdInputHandler(wxInputHandler *handlerDef); - virtual wxInputHandler *DoGetStdInputHandler(wxInputHandler *handlerDef) - { - return GetStdInputHandler(handlerDef); - } - -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); - - virtual wxSize DoGetBestClientSize() const; - virtual void DoSetSize(int x, int y, - int width, int height, - int sizeFlags = wxSIZE_AUTO); - virtual void DoDraw(wxControlRenderer *renderer); - - // get the bounding rect for the given tool - wxRect GetToolRect(wxToolBarToolBase *tool) const; - - // redraw the given tool - void RefreshTool(wxToolBarToolBase *tool); - - // (re)calculate the tool positions, should only be called if it is - // necessary to do it, i.e. m_needsLayout == true - void DoLayout(); - - // get the rect limits depending on the orientation: top/bottom for a - // vertical toolbar, left/right for a horizontal one - void GetRectLimits(const wxRect& rect, wxCoord *start, wxCoord *end) const; - -private: - // have we calculated the positions of our tools? - bool m_needsLayout; - - // the width of a separator - wxCoord m_widthSeparator; - - // the total size of all toolbar elements - wxCoord m_maxWidth, - m_maxHeight; - -private: - DECLARE_DYNAMIC_CLASS(wxToolBar) -}; - -#endif // _WX_UNIV_TOOLBAR_H_ diff --git a/wxWidgets/include/wx/univ/toplevel.h b/wxWidgets/include/wx/univ/toplevel.h deleted file mode 100644 index 6857372b9c..0000000000 --- a/wxWidgets/include/wx/univ/toplevel.h +++ /dev/null @@ -1,197 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/toplevel.h -// Purpose: Top level window, abstraction of wxFrame and wxDialog -// Author: Vaclav Slavik -// Id: $Id: toplevel.h 61872 2009-09-09 22:37:05Z VZ $ -// Copyright: (c) 2001-2002 SciTech Software, Inc. (www.scitechsoft.com) -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - - -#ifndef __WX_UNIV_TOPLEVEL_H__ -#define __WX_UNIV_TOPLEVEL_H__ - -#include "wx/univ/inpcons.h" -#include "wx/univ/inphand.h" -#include "wx/icon.h" - -// ---------------------------------------------------------------------------- -// constants -// ---------------------------------------------------------------------------- - -// frame decorations type flags used in wxRenderer and wxColourScheme -enum -{ - wxTOPLEVEL_ACTIVE = 0x00000001, - wxTOPLEVEL_MAXIMIZED = 0x00000002, - wxTOPLEVEL_TITLEBAR = 0x00000004, - wxTOPLEVEL_ICON = 0x00000008, - wxTOPLEVEL_RESIZEABLE = 0x00000010, - wxTOPLEVEL_BORDER = 0x00000020, - wxTOPLEVEL_BUTTON_CLOSE = 0x01000000, - wxTOPLEVEL_BUTTON_MAXIMIZE = 0x02000000, - wxTOPLEVEL_BUTTON_ICONIZE = 0x04000000, - wxTOPLEVEL_BUTTON_RESTORE = 0x08000000, - wxTOPLEVEL_BUTTON_HELP = 0x10000000 -}; - -// frame hit test return values: -enum -{ - wxHT_TOPLEVEL_NOWHERE = 0x00000000, - wxHT_TOPLEVEL_CLIENT_AREA = 0x00000001, - wxHT_TOPLEVEL_ICON = 0x00000002, - wxHT_TOPLEVEL_TITLEBAR = 0x00000004, - - wxHT_TOPLEVEL_BORDER_N = 0x00000010, - wxHT_TOPLEVEL_BORDER_S = 0x00000020, - wxHT_TOPLEVEL_BORDER_E = 0x00000040, - wxHT_TOPLEVEL_BORDER_W = 0x00000080, - wxHT_TOPLEVEL_BORDER_NE = wxHT_TOPLEVEL_BORDER_N | wxHT_TOPLEVEL_BORDER_E, - wxHT_TOPLEVEL_BORDER_SE = wxHT_TOPLEVEL_BORDER_S | wxHT_TOPLEVEL_BORDER_E, - wxHT_TOPLEVEL_BORDER_NW = wxHT_TOPLEVEL_BORDER_N | wxHT_TOPLEVEL_BORDER_W, - wxHT_TOPLEVEL_BORDER_SW = wxHT_TOPLEVEL_BORDER_S | wxHT_TOPLEVEL_BORDER_W, - wxHT_TOPLEVEL_ANY_BORDER = 0x000000F0, - - wxHT_TOPLEVEL_BUTTON_CLOSE = /*0x01000000*/ wxTOPLEVEL_BUTTON_CLOSE, - wxHT_TOPLEVEL_BUTTON_MAXIMIZE = /*0x02000000*/ wxTOPLEVEL_BUTTON_MAXIMIZE, - wxHT_TOPLEVEL_BUTTON_ICONIZE = /*0x04000000*/ wxTOPLEVEL_BUTTON_ICONIZE, - wxHT_TOPLEVEL_BUTTON_RESTORE = /*0x08000000*/ wxTOPLEVEL_BUTTON_RESTORE, - wxHT_TOPLEVEL_BUTTON_HELP = /*0x10000000*/ wxTOPLEVEL_BUTTON_HELP, - wxHT_TOPLEVEL_ANY_BUTTON = 0x1F000000 -}; - -// Flags for interactive frame manipulation functions (only in wxUniversal): -enum -{ - wxINTERACTIVE_MOVE = 0x00000001, - wxINTERACTIVE_RESIZE = 0x00000002, - wxINTERACTIVE_RESIZE_S = 0x00000010, - wxINTERACTIVE_RESIZE_N = 0x00000020, - wxINTERACTIVE_RESIZE_W = 0x00000040, - wxINTERACTIVE_RESIZE_E = 0x00000080, - wxINTERACTIVE_WAIT_FOR_INPUT = 0x10000000 -}; - -// ---------------------------------------------------------------------------- -// the actions supported by this control -// ---------------------------------------------------------------------------- - -#define wxACTION_TOPLEVEL_ACTIVATE wxT("activate") // (de)activate the frame -#define wxACTION_TOPLEVEL_BUTTON_PRESS wxT("pressbtn") // press titlebar btn -#define wxACTION_TOPLEVEL_BUTTON_RELEASE wxT("releasebtn") // press titlebar btn -#define wxACTION_TOPLEVEL_BUTTON_CLICK wxT("clickbtn") // press titlebar btn -#define wxACTION_TOPLEVEL_MOVE wxT("move") // move the frame -#define wxACTION_TOPLEVEL_RESIZE wxT("resize") // resize the frame - -//----------------------------------------------------------------------------- -// wxTopLevelWindow -//----------------------------------------------------------------------------- - -class WXDLLEXPORT wxTopLevelWindow : public wxTopLevelWindowNative, - public wxInputConsumer -{ -public: - // construction - wxTopLevelWindow() { Init(); } - wxTopLevelWindow(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); - - // wxUniv-specific methods: do [not] use native decorations for this (or - // all) window(s) - // - // notice that this has no effect if the system doesn't support any native - // decorations anyhow and that by default native decorations are used - // - // if UseNativeDecorations() is used, it must be called before Create() - static void UseNativeDecorationsByDefault(bool native = true); - void UseNativeDecorations(bool native = true); - bool IsUsingNativeDecorations() const; - - - // implement base class pure virtuals - virtual bool ShowFullScreen(bool show, long style = wxFULLSCREEN_ALL); - virtual wxPoint GetClientAreaOrigin() const; - virtual void SetIcon(const wxIcon& icon) { SetIcons( wxIconBundle( icon ) ); } - virtual void SetIcons(const wxIconBundle& icons); - - // implementation from now on - // -------------------------- - - // tests for frame's part at given point - long HitTest(const wxPoint& pt) const; - - virtual bool PerformAction(const wxControlAction& action, - long numArg = -1, - const wxString& strArg = wxEmptyString); - - static wxInputHandler *GetStdInputHandler(wxInputHandler *handlerDef); - virtual wxInputHandler *DoGetStdInputHandler(wxInputHandler *handlerDef) - { - return GetStdInputHandler(handlerDef); - } - - // move/resize the frame interactively, i.e. let the user do it - virtual void InteractiveMove(int flags = wxINTERACTIVE_MOVE); - - virtual wxSize GetMinSize() const; - - virtual wxWindow *GetInputWindow() const { return wx_const_cast(wxTopLevelWindow*, this); } - -protected: - virtual void DoGetClientSize(int *width, int *height) const; - virtual void DoSetClientSize(int width, int height); - - // handle titlebar button click event - virtual void ClickTitleBarButton(long button); - - // return wxTOPLEVEL_xxx combination based on current state of the frame - long GetDecorationsStyle() const; - - // common part of all ctors - void Init(); - - void RefreshTitleBar(); - void OnNcPaint(wxNcPaintEvent& event); - void OnSystemMenu(wxCommandEvent& event); - - // true if wxTLW should render decorations (aka titlebar) itself - static int ms_drawDecorations; - // true if wxTLW can be iconized - static int ms_canIconize; - - // true if we're using native decorations - bool m_usingNativeDecorations; - // true for currently active frame - bool m_isActive; - // version of icon for titlebar (16x16) - wxIcon m_titlebarIcon; - // saved window style in fullscreen mdoe - long m_fsSavedStyle; - // currently pressed titlebar button - long m_pressedButton; - - DECLARE_DYNAMIC_CLASS(wxTopLevelWindow) - DECLARE_EVENT_TABLE() - WX_DECLARE_INPUT_CONSUMER() -}; - -#endif // __WX_UNIV_TOPLEVEL_H__ diff --git a/wxWidgets/include/wx/univ/window.h b/wxWidgets/include/wx/univ/window.h deleted file mode 100644 index 1485f60334..0000000000 --- a/wxWidgets/include/wx/univ/window.h +++ /dev/null @@ -1,287 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: wx/univ/window.h -// Purpose: wxWindow class which is the base class for all -// wxUniv port controls, it supports the customization of the -// window drawing and input processing. -// Author: Vadim Zeitlin -// Modified by: -// Created: 06.08.00 -// RCS-ID: $Id: window.h 39633 2006-06-08 11:25:30Z ABX $ -// Copyright: (c) 2000 SciTech Software, Inc. (www.scitechsoft.com) -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_UNIV_WINDOW_H_ -#define _WX_UNIV_WINDOW_H_ - -#include "wx/bitmap.h" // for m_bitmapBg - -class WXDLLEXPORT wxControlRenderer; -class WXDLLEXPORT wxEventLoop; - -#if wxUSE_MENUS - class WXDLLEXPORT wxMenu; - class WXDLLEXPORT wxMenuBar; -#endif // wxUSE_MENUS - -class WXDLLEXPORT wxRenderer; - -#if wxUSE_SCROLLBAR - class WXDLLEXPORT wxScrollBar; -#endif // wxUSE_SCROLLBAR - -#ifdef __WXX11__ -#define wxUSE_TWO_WINDOWS 1 -#else -#define wxUSE_TWO_WINDOWS 0 -#endif - -// ---------------------------------------------------------------------------- -// wxWindow -// ---------------------------------------------------------------------------- - -#if defined(__WXMSW__) -#define wxWindowNative wxWindowMSW -#elif defined(__WXGTK__) -#define wxWindowNative wxWindowGTK -#elif defined(__WXMGL__) -#define wxWindowNative wxWindowMGL -#elif defined(__WXX11__) -#define wxWindowNative wxWindowX11 -#elif defined(__WXMAC__) -#define wxWindowNative wxWindowMac -#endif - -class WXDLLEXPORT wxWindow : public wxWindowNative -{ -public: - // ctors and create functions - // --------------------------- - - wxWindow() { Init(); } - - wxWindow(wxWindow *parent, - wxWindowID id, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = 0, - const wxString& name = wxPanelNameStr) - : wxWindowNative(parent, id, pos, size, style | wxCLIP_CHILDREN, name) - { Init(); } - - bool Create(wxWindow *parent, - wxWindowID id, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = 0, - const wxString& name = wxPanelNameStr); - - virtual ~wxWindow(); - - // background pixmap support - // ------------------------- - - virtual void SetBackground(const wxBitmap& bitmap, - int alignment = wxALIGN_CENTRE, - wxStretch stretch = wxSTRETCH_NOT); - - const wxBitmap& GetBackgroundBitmap(int *alignment = NULL, - wxStretch *stretch = NULL) const; - - // scrollbars: we (re)implement it ourselves using our own scrollbars - // instead of the native ones - // ------------------------------------------------------------------ - - virtual void SetScrollbar(int orient, - int pos, - int page, - 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); - - // take into account the borders here - virtual wxPoint GetClientAreaOrigin() const; - - // popup menu support - // ------------------ - - // NB: all menu related functions are implemented in menu.cpp - -#if wxUSE_MENUS - // this is wxUniv-specific private method to be used only by wxMenu - void DismissPopupMenu(); -#endif // wxUSE_MENUS - - // miscellaneous other methods - // --------------------------- - - // get the state information - virtual bool IsFocused() const; - virtual bool IsCurrent() const; - virtual bool IsPressed() const; - virtual bool IsDefault() const; - - // return all state flags at once (combination of wxCONTROL_XXX values) - int GetStateFlags() const; - - // set the "highlighted" flag and return true if it changed - virtual bool SetCurrent(bool doit = true); - -#if wxUSE_SCROLLBAR - // get the scrollbar (may be NULL) for the given orientation - wxScrollBar *GetScrollbar(int orient) const - { - return orient & wxVERTICAL ? m_scrollbarVert : m_scrollbarHorz; - } -#endif // wxUSE_SCROLLBAR - - // methods used by wxColourScheme to choose the colours for this window - // -------------------------------------------------------------------- - - // return true if this is a panel/canvas window which contains other - // controls only - virtual bool IsCanvasWindow() const { return false; } - - // return true if this control can be highlighted when the mouse is over - // it (the theme decides itself whether it is really highlighted or not) - virtual bool CanBeHighlighted() const { return false; } - - // return true if we should use the colours/fonts returned by the - // corresponding GetXXX() methods instead of the default ones - bool UseFgCol() const { return m_hasFgCol; } - bool UseFont() const { return m_hasFont; } - - // return true if this window serves as a container for the other windows - // only and doesn't get any input itself - virtual bool IsStaticBox() const { return false; } - - // returns the (low level) renderer to use for drawing the control by - // querying the current theme - wxRenderer *GetRenderer() const { return m_renderer; } - - // scrolling helper: like ScrollWindow() except that it doesn't refresh the - // uncovered window areas but returns the rectangle to update (don't call - // this with both dx and dy non zero) - wxRect ScrollNoRefresh(int dx, int dy, const wxRect *rect = NULL); - - // after scrollbars are added or removed they must be refreshed by calling - // this function - void RefreshScrollbars(); - - // erase part of the control - virtual void EraseBackground(wxDC& dc, const wxRect& rect); - - // overridden base class methods - // ----------------------------- - - // the rect coordinates are, for us, in client coords, but if no rect is - // specified, the entire window is refreshed - virtual void Refresh(bool eraseBackground = true, - const wxRect *rect = (const wxRect *) NULL); - - // we refresh the window when it is dis/enabled - virtual bool Enable(bool enable = true); - - // should we use the standard control colours or not? - virtual bool ShouldInheritColours() const { return false; } - -protected: - // common part of all ctors - void Init(); - -#if wxUSE_MENUS - virtual bool DoPopupMenu(wxMenu *menu, int x, int y); -#endif // wxUSE_MENUS - - // we deal with the scrollbars in these functions - virtual void DoSetClientSize(int width, int height); - virtual void DoGetClientSize(int *width, int *height) const; - virtual wxHitTest DoHitTest(wxCoord x, wxCoord y) const; - - // event handlers - void OnSize(wxSizeEvent& event); - void OnNcPaint(wxNcPaintEvent& event); - void OnPaint(wxPaintEvent& event); - void OnErase(wxEraseEvent& event); - -#if wxUSE_ACCEL || wxUSE_MENUS - void OnKeyDown(wxKeyEvent& event); -#endif // wxUSE_ACCEL - -#if wxUSE_MENUS - void OnChar(wxKeyEvent& event); - void OnKeyUp(wxKeyEvent& event); -#endif // wxUSE_MENUS - - // draw the control background, return true if done - virtual bool DoDrawBackground(wxDC& dc); - - // draw the controls border - virtual void DoDrawBorder(wxDC& dc, const wxRect& rect); - - // draw the controls contents - virtual void DoDraw(wxControlRenderer *renderer); - - // calculate the best size for the client area of the window: default - // implementation of DoGetBestSize() uses this method and adds the border - // width to the result - virtual wxSize DoGetBestClientSize() const; - virtual wxSize DoGetBestSize() const; - - // adjust the size of the window to take into account its borders - wxSize AdjustSize(const wxSize& size) const; - - // put the scrollbars along the edges of the window - void PositionScrollbars(); - -#if wxUSE_MENUS - // return the menubar of the parent frame or NULL - wxMenuBar *GetParentFrameMenuBar() const; -#endif // wxUSE_MENUS - - // the renderer we use - wxRenderer *m_renderer; - - // background bitmap info - wxBitmap m_bitmapBg; - int m_alignBgBitmap; - wxStretch m_stretchBgBitmap; - - // old size - wxSize m_oldSize; - - // is the mouse currently inside the window? - bool m_isCurrent:1; - -#ifdef __WXMSW__ -public: - // override MSWWindowProc() to process WM_NCHITTEST - WXLRESULT MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lParam); -#endif // __WXMSW__ - -private: - -#if wxUSE_SCROLLBAR - // the window scrollbars - wxScrollBar *m_scrollbarHorz, - *m_scrollbarVert; -#endif // wxUSE_SCROLLBAR - -#if wxUSE_MENUS - // the current modal event loop for the popup menu we show or NULL - static wxEventLoop *ms_evtLoopPopup; - - // the last window over which Alt was pressed (used by OnKeyUp) - static wxWindow *ms_winLastAltPress; -#endif // wxUSE_MENUS - - DECLARE_DYNAMIC_CLASS(wxWindow) - DECLARE_EVENT_TABLE() -}; - -#endif // _WX_UNIV_WINDOW_H_ diff --git a/wxWidgets/include/wx/unix/apptbase.h b/wxWidgets/include/wx/unix/apptbase.h deleted file mode 100644 index 0fd100ea5c..0000000000 --- a/wxWidgets/include/wx/unix/apptbase.h +++ /dev/null @@ -1,54 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: wx/unix/apptbase.h -// Purpose: declaration of wxAppTraits for Unix systems -// Author: Vadim Zeitlin -// Modified by: -// Created: 23.06.2003 -// RCS-ID: $Id: apptbase.h 29409 2004-09-26 16:28:51Z VZ $ -// Copyright: (c) 2003 Vadim Zeitlin <vadim@wxwidgets.org> -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_UNIX_APPTBASE_H_ -#define _WX_UNIX_APPTBASE_H_ - -struct wxExecuteData; -class wxPipe; - -// ---------------------------------------------------------------------------- -// wxAppTraits: the Unix version adds extra hooks needed by Unix code -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxAppTraits : public wxAppTraitsBase -{ -public: - // wxExecute() support methods - // --------------------------- - - // called before starting the child process and creates the pipe used for - // detecting the process termination asynchronously in GUI, does nothing in - // wxBase - // - // if it returns false, we should return from wxExecute() with an error - virtual bool CreateEndProcessPipe(wxExecuteData& execData) = 0; - - // test if the given descriptor is the end of the pipe create by the - // function above - virtual bool IsWriteFDOfEndProcessPipe(wxExecuteData& execData, int fd) = 0; - - // ensure that the write end of the pipe is not closed by wxPipe dtor - virtual void DetachWriteFDOfEndProcessPipe(wxExecuteData& execData) = 0; - - // wait for the process termination, return whatever wxExecute() must - // return - virtual int WaitForChild(wxExecuteData& execData) = 0; - - - // wxThread helpers - // ---------------- - - // TODO -}; - -#endif // _WX_UNIX_APPTBASE_H_ - diff --git a/wxWidgets/include/wx/unix/apptrait.h b/wxWidgets/include/wx/unix/apptrait.h deleted file mode 100644 index 0bb0af469b..0000000000 --- a/wxWidgets/include/wx/unix/apptrait.h +++ /dev/null @@ -1,55 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: wx/unix/apptrait.h -// Purpose: standard implementations of wxAppTraits for Unix -// Author: Vadim Zeitlin -// Modified by: -// Created: 23.06.2003 -// RCS-ID: $Id: apptrait.h 43629 2006-11-24 11:33:53Z RR $ -// Copyright: (c) 2003 Vadim Zeitlin <vadim@wxwidgets.org> -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_UNIX_APPTRAIT_H_ -#define _WX_UNIX_APPTRAIT_H_ - -// ---------------------------------------------------------------------------- -// wxGUI/ConsoleAppTraits: must derive from wxAppTraits, not wxAppTraitsBase -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxConsoleAppTraits : public wxConsoleAppTraitsBase -{ -public: - virtual bool CreateEndProcessPipe(wxExecuteData& execData); - virtual bool IsWriteFDOfEndProcessPipe(wxExecuteData& execData, int fd); - virtual void DetachWriteFDOfEndProcessPipe(wxExecuteData& execData); - virtual int WaitForChild(wxExecuteData& execData); -}; - -#if wxUSE_GUI - -class WXDLLEXPORT wxGUIAppTraits : public wxGUIAppTraitsBase -{ -public: - virtual bool CreateEndProcessPipe(wxExecuteData& execData); - virtual bool IsWriteFDOfEndProcessPipe(wxExecuteData& execData, int fd); - virtual void DetachWriteFDOfEndProcessPipe(wxExecuteData& execData); - virtual int WaitForChild(wxExecuteData& execData); - -#if defined(__WXMAC__) || defined(__WXCOCOA__) - virtual wxStandardPathsBase& GetStandardPaths(); -#endif - virtual wxPortId GetToolkitVersion(int *majVer, int *minVer) const; - -#ifdef __WXGTK__ - virtual wxString GetDesktopEnvironment() const; -#endif - -#if defined(__WXDEBUG__) && defined(__WXGTK20__) - virtual bool ShowAssertDialog(const wxString& msg); -#endif -}; - -#endif // wxUSE_GUI - -#endif // _WX_UNIX_APPTRAIT_H_ - diff --git a/wxWidgets/include/wx/unix/execute.h b/wxWidgets/include/wx/unix/execute.h deleted file mode 100644 index 0f095e86c8..0000000000 --- a/wxWidgets/include/wx/unix/execute.h +++ /dev/null @@ -1,79 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: unix/execute.h -// Purpose: private details of wxExecute() implementation -// Author: Vadim Zeitlin -// Id: $Id: execute.h 35055 2005-08-02 22:58:06Z MW $ -// Copyright: (c) 1998 Robert Roebling, Julian Smart, Vadim Zeitlin -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_UNIX_EXECUTE_H -#define _WX_UNIX_EXECUTE_H - -#include "wx/unix/pipe.h" - -class WXDLLIMPEXP_BASE wxProcess; -class wxStreamTempInputBuffer; - -// if pid > 0, the execution is async and the data is freed in the callback -// executed when the process terminates, if pid < 0, the execution is -// synchronous and the caller (wxExecute) frees the data -struct wxEndProcessData -{ - int pid, // pid of the process - tag; // port dependent value - wxProcess *process; // if !NULL: notified on process termination - int exitcode; // the exit code -}; - -// struct in which information is passed from wxExecute() to wxAppTraits -// methods -struct wxExecuteData -{ - wxExecuteData() - { - flags = - pid = 0; - - process = NULL; - -#if wxUSE_STREAMS - bufOut = - bufErr = NULL; -#endif // wxUSE_STREAMS - } - - // wxExecute() flags - int flags; - - // the pid of the child process - int pid; - - // the associated process object or NULL - wxProcess *process; - - // pipe used for end process detection - wxPipe pipeEndProcDetect; - -#if wxUSE_STREAMS - // the input buffer bufOut is connected to stdout, this is why it is - // called bufOut and not bufIn - wxStreamTempInputBuffer *bufOut, - *bufErr; -#endif // wxUSE_STREAMS -}; - -// this function is called when the process terminates from port specific -// callback function and is common to all ports (src/unix/utilsunx.cpp) -extern WXDLLIMPEXP_BASE void wxHandleProcessTermination(wxEndProcessData *proc_data); - -// this function is called to associate the port-specific callback with the -// child process. The return valus is port-specific. -extern WXDLLIMPEXP_CORE int wxAddProcessCallback(wxEndProcessData *proc_data, int fd); - -#if defined(__DARWIN__) && (defined(__WXMAC__) || defined(__WXCOCOA__)) -// For ports (e.g. DARWIN) which can add callbacks based on the pid -extern int wxAddProcessCallbackForPid(wxEndProcessData *proc_data, int pid); -#endif - -#endif // _WX_UNIX_EXECUTE_H diff --git a/wxWidgets/include/wx/unix/fontutil.h b/wxWidgets/include/wx/unix/fontutil.h deleted file mode 100644 index 498bed1d57..0000000000 --- a/wxWidgets/include/wx/unix/fontutil.h +++ /dev/null @@ -1,37 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/unix/fontutil.h -// Purpose: font-related helper functions for Unix/X11 -// Author: Vadim Zeitlin -// Modified by: -// Created: 05.11.99 -// RCS-ID: $Id: fontutil.h 27408 2004-05-23 20:53:33Z JS $ -// Copyright: (c) wxWidgets team -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_UNIX_FONTUTIL_H_ -#define _WX_UNIX_FONTUTIL_H_ - -#ifdef __X__ - typedef WXFontStructPtr wxNativeFont; -#elif defined(__WXGTK__) - typedef GdkFont *wxNativeFont; -#else - #error "Unsupported toolkit" -#endif - -// returns the handle of the nearest available font or 0 -extern wxNativeFont -wxLoadQueryNearestFont(int pointSize, - int family, - int style, - int weight, - bool underlined, - const wxString &facename, - wxFontEncoding encoding, - wxString* xFontName = (wxString *)NULL); - -// returns the font specified by the given XLFD -extern wxNativeFont wxLoadFont(const wxString& fontSpec); - -#endif // _WX_UNIX_FONTUTIL_H_ diff --git a/wxWidgets/include/wx/unix/gsockunx.h b/wxWidgets/include/wx/unix/gsockunx.h deleted file mode 100644 index 4537f149bc..0000000000 --- a/wxWidgets/include/wx/unix/gsockunx.h +++ /dev/null @@ -1,145 +0,0 @@ -/* ------------------------------------------------------------------------- - * Project: GSocket (Generic Socket) for WX - * Name: gsockunx.h - * Copyright: (c) Guilhem Lavaux - * Licence: wxWindows Licence - * Purpose: GSocket Unix header - * CVSID: $Id: gsockunx.h 33948 2005-05-04 18:57:50Z JS $ - * ------------------------------------------------------------------------- - */ - -#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 - -class GSocketGUIFunctionsTableConcrete: public GSocketGUIFunctionsTable -{ -public: - virtual bool OnInit(); - virtual void OnExit(); - virtual bool CanUseEventLoop(); - virtual bool Init_Socket(GSocket *socket); - virtual void Destroy_Socket(GSocket *socket); - virtual void Install_Callback(GSocket *socket, GSocketEvent event); - virtual void Uninstall_Callback(GSocket *socket, GSocketEvent event); - virtual void Enable_Events(GSocket *socket); - virtual void Disable_Events(GSocket *socket); -}; - -class GSocket -{ -public: - GSocket(); - virtual ~GSocket(); - bool IsOk() { return m_ok; } - void Close(); - void Shutdown(); - GSocketError SetLocal(GAddress *address); - GSocketError SetPeer(GAddress *address); - GAddress *GetLocal(); - GAddress *GetPeer(); - GSocketError SetServer(); - GSocket *WaitConnection(); - bool SetReusable(); - GSocketError Connect(GSocketStream stream); - GSocketError SetNonOriented(); - int Read(char *buffer, int size); - int Write(const char *buffer, int size); - GSocketEventFlags Select(GSocketEventFlags flags); - void SetNonBlocking(bool non_block); - void SetTimeout(unsigned long millisec); - GSocketError WXDLLIMPEXP_NET GetError(); - void SetCallback(GSocketEventFlags flags, - GSocketCallback callback, char *cdata); - void UnsetCallback(GSocketEventFlags flags); - GSocketError GetSockOpt(int level, int optname, void *optval, int *optlen); - GSocketError SetSockOpt(int level, int optname, - const void *optval, int optlen); - virtual void Detected_Read(); - virtual void Detected_Write(); -protected: - void Enable(GSocketEvent event); - void Disable(GSocketEvent event); - GSocketError Input_Timeout(); - GSocketError Output_Timeout(); - int Recv_Stream(char *buffer, int size); - int Recv_Dgram(char *buffer, int size); - int Send_Stream(const char *buffer, int size); - int Send_Dgram(const char *buffer, int size); - bool m_ok; -public: - /* DFE: We can't protect these data member until the GUI code is updated */ - /* protected: */ - int m_fd; - GAddress *m_local; - GAddress *m_peer; - GSocketError m_error; - - bool m_non_blocking; - bool m_server; - bool m_stream; - bool m_establishing; - bool m_reusable; - unsigned long m_timeout; - - /* Callbacks */ - GSocketEventFlags m_detected; - GSocketCallback m_cbacks[GSOCK_MAX_EVENT]; - char *m_data[GSOCK_MAX_EVENT]; - - char *m_gui_dependent; - -}; - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ -/* Definition of GAddress */ -struct _GAddress -{ - struct sockaddr *m_addr; - size_t m_len; - - GAddressType m_family; - int m_realfamily; - - GSocketError m_error; -}; -#ifdef __cplusplus -} -#endif /* __cplusplus */ - - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - - -/* GAddress */ - -GSocketError _GAddress_translate_from(GAddress *address, - struct sockaddr *addr, int len); -GSocketError _GAddress_translate_to (GAddress *address, - struct sockaddr **addr, int *len); -GSocketError _GAddress_Init_INET(GAddress *address); -GSocketError _GAddress_Init_UNIX(GAddress *address); - - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* wxUSE_SOCKETS || defined(__GSOCKET_STANDALONE__) */ - -#endif /* __GSOCK_UNX_H */ diff --git a/wxWidgets/include/wx/unix/joystick.h b/wxWidgets/include/wx/unix/joystick.h deleted file mode 100644 index c01c63c928..0000000000 --- a/wxWidgets/include/wx/unix/joystick.h +++ /dev/null @@ -1,95 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/unix/joystick.h -// Purpose: wxJoystick class -// Author: Guilhem Lavaux -// Modified by: -// Created: 01/02/97 -// RCS-ID: $Id: joystick.h 42077 2006-10-17 14:44:52Z ABX $ -// Copyright: (c) Guilhem Lavaux -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef __JOYSTICKH__ -#define __JOYSTICKH__ - -#include "wx/event.h" -#include "wx/thread.h" - -class WXDLLEXPORT wxJoystickThread; - -class WXDLLEXPORT wxJoystick: public wxObject -{ - DECLARE_DYNAMIC_CLASS(wxJoystick) - public: - /* - * Public interface - */ - - wxJoystick(int joystick = wxJOYSTICK1); - virtual ~wxJoystick(); - - // 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 - static int GetNumberJoysticks() ; - 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_device; - int m_joystick; - wxJoystickThread* m_thread; -}; - -#endif - // __JOYSTICKH__ diff --git a/wxWidgets/include/wx/unix/mimetype.h b/wxWidgets/include/wx/unix/mimetype.h deleted file mode 100644 index bde5ab4784..0000000000 --- a/wxWidgets/include/wx/unix/mimetype.h +++ /dev/null @@ -1,215 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/unix/mimetype.h -// Purpose: classes and functions to manage MIME types -// Author: Vadim Zeitlin -// Modified by: -// Created: 23.09.98 -// RCS-ID: $Id: mimetype.h 43723 2006-11-30 13:24:32Z RR $ -// Copyright: (c) 1998 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr> -// Licence: wxWindows licence (part of wxExtra library) -///////////////////////////////////////////////////////////////////////////// - -#ifndef _MIMETYPE_IMPL_H -#define _MIMETYPE_IMPL_H - -#include "wx/mimetype.h" - -#if wxUSE_MIMETYPE - -class wxMimeTypeCommands; - -WX_DEFINE_ARRAY_PTR(wxMimeTypeCommands *, wxMimeCommandsArray); - -// this is the real wxMimeTypesManager for Unix -class WXDLLEXPORT wxMimeTypesManagerImpl -{ -public: - // ctor and dtor - wxMimeTypesManagerImpl(); - virtual ~wxMimeTypesManagerImpl(); - - // load all data into memory - done when it is needed for the first time - void Initialize(int mailcapStyles = wxMAILCAP_ALL, - const wxString& extraDir = wxEmptyString); - - // and delete the data here - void ClearData(); - - // implement containing class functions - wxFileType *GetFileTypeFromExtension(const wxString& ext); - wxFileType *GetFileTypeFromMimeType(const wxString& mimeType); - - size_t EnumAllFileTypes(wxArrayString& mimetypes); - - bool ReadMailcap(const wxString& filename, bool fallback = FALSE); - bool ReadMimeTypes(const wxString& filename); - - void AddFallback(const wxFileTypeInfo& filetype); - - // add information about the given mimetype - void AddMimeTypeInfo(const wxString& mimetype, - const wxString& extensions, - const wxString& description); - void AddMailcapInfo(const wxString& strType, - const wxString& strOpenCmd, - const wxString& strPrintCmd, - const wxString& strTest, - const wxString& strDesc); - - // add a new record to the user .mailcap/.mime.types files - wxFileType *Associate(const wxFileTypeInfo& ftInfo); - // remove association - bool Unassociate(wxFileType *ft); - - // accessors - // get the string containing space separated extensions for the given - // file type - wxString GetExtension(size_t index) { return m_aExtensions[index]; } - -protected: - void InitIfNeeded(); - - wxArrayString m_aTypes, // MIME types - m_aDescriptions, // descriptions (just some text) - m_aExtensions, // space separated list of extensions - m_aIcons; // Icon filenames - - // verb=command pairs for this file type - wxMimeCommandsArray m_aEntries; - - // are we initialized? - bool m_initialized; - - // keep track of the files we had already loaded (this is a bitwise OR of - // wxMailcapStyle values) - int m_mailcapStylesInited; - - wxString GetCommand(const wxString &verb, size_t nIndex) const; - - // read Gnome files - void LoadGnomeDataFromKeyFile(const wxString& filename, - const wxArrayString& dirs); - void LoadGnomeMimeTypesFromMimeFile(const wxString& filename); - void LoadGnomeMimeFilesFromDir(const wxString& dirbase, - const wxArrayString& dirs); - void GetGnomeMimeInfo(const wxString& sExtraDir); - - // read KDE - void LoadKDELinksForMimeSubtype(const wxString& dirbase, - const wxString& subdir, - const wxString& filename, - const wxArrayString& icondirs); - void LoadKDELinksForMimeType(const wxString& dirbase, - const wxString& subdir, - const wxArrayString& icondirs); - void LoadKDELinkFilesFromDir(const wxString& dirbase, - const wxArrayString& icondirs); - void LoadKDEApp(const wxString& filename); - void LoadKDEAppsFilesFromDir(const wxString& dirname); - void GetKDEMimeInfo(const wxString& sExtraDir); - - // write KDE - bool WriteKDEMimeFile(int index, bool delete_index); - bool CheckKDEDirsExist(const wxString & sOK, const wxString& sTest); - - //read write Netscape and MetaMail formats - void GetMimeInfo (const wxString& sExtraDir); - bool WriteToMailCap (int index, bool delete_index); - bool WriteToMimeTypes (int index, bool delete_index); - bool WriteToNSMimeTypes (int index, bool delete_index); - - // ReadMailcap() helper - bool ProcessOtherMailcapField(struct MailcapLineData& data, - const wxString& curField); - - // functions used to do associations - - virtual int AddToMimeData(const wxString& strType, - const wxString& strIcon, - wxMimeTypeCommands *entry, - const wxArrayString& strExtensions, - const wxString& strDesc, - bool replaceExisting = TRUE); - - virtual bool DoAssociation(const wxString& strType, - const wxString& strIcon, - wxMimeTypeCommands *entry, - const wxArrayString& strExtensions, - const wxString& strDesc); - - virtual bool WriteMimeInfo(int nIndex, bool delete_mime ); - - // give it access to m_aXXX variables - friend class WXDLLEXPORT wxFileTypeImpl; -}; - - - -class WXDLLEXPORT 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); } - - // accessors - bool GetExtensions(wxArrayString& extensions); - bool GetMimeType(wxString *mimeType) const - { *mimeType = m_manager->m_aTypes[m_index[0]]; return TRUE; } - bool GetMimeTypes(wxArrayString& mimeTypes) const; - bool GetIcon(wxIconLocation *iconLoc) const; - - bool GetDescription(wxString *desc) const - { *desc = m_manager->m_aDescriptions[m_index[0]]; return TRUE; } - - bool GetOpenCommand(wxString *openCmd, - const wxFileType::MessageParameters& params) const - { - *openCmd = GetExpandedCommand(wxT("open"), params); - return (! openCmd -> IsEmpty() ); - } - - bool GetPrintCommand(wxString *printCmd, - const wxFileType::MessageParameters& params) const - { - *printCmd = GetExpandedCommand(wxT("print"), params); - return (! printCmd -> IsEmpty() ); - } - - // return the number of commands defined for this file type, 0 if none - 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: - wxString - GetExpandedCommand(const wxString & verb, - const wxFileType::MessageParameters& params) const; - - wxMimeTypesManagerImpl *m_manager; - wxArrayInt m_index; // in the wxMimeTypesManagerImpl arrays -}; - -#endif // wxUSE_MIMETYPE - -#endif // _MIMETYPE_IMPL_H - - diff --git a/wxWidgets/include/wx/unix/pipe.h b/wxWidgets/include/wx/unix/pipe.h deleted file mode 100644 index 84310626e7..0000000000 --- a/wxWidgets/include/wx/unix/pipe.h +++ /dev/null @@ -1,114 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: wx/unix/pipe.h -// Purpose: wxPipe class -// Author: Vadim Zeitlin -// Modified by: -// Created: 24.06.2003 (extracted from src/unix/utilsunx.cpp) -// RCS-ID: $Id: pipe.h 40518 2006-08-08 13:06:05Z VS $ -// Copyright: (c) 2003 Vadim Zeitlin <vadim@wxwidgets.org> -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_UNIX_PIPE_H_ -#define _WX_UNIX_PIPE_H_ - -#include <unistd.h> - -#include "wx/log.h" -#include "wx/intl.h" - -// ---------------------------------------------------------------------------- -// wxPipe: this class encapsulates pipe() system call -// ---------------------------------------------------------------------------- - -class wxPipe -{ -public: - // the symbolic names for the pipe ends - enum Direction - { - Read, - Write - }; - - enum - { - INVALID_FD = -1 - }; - - // default ctor doesn't do anything - wxPipe() { m_fds[Read] = m_fds[Write] = INVALID_FD; } - - // create the pipe, return TRUE if ok, FALSE on error - bool Create() - { - if ( pipe(m_fds) == -1 ) - { - wxLogSysError(_("Pipe creation failed")); - - return FALSE; - } - - return TRUE; - } - - // return TRUE if we were created successfully - bool IsOk() const { return m_fds[Read] != INVALID_FD; } - - // return the descriptor for one of the pipe ends - int operator[](Direction which) const { return m_fds[which]; } - - // detach a descriptor, meaning that the pipe dtor won't close it, and - // return it - int Detach(Direction which) - { - int fd = m_fds[which]; - m_fds[which] = INVALID_FD; - - return fd; - } - - // close the pipe descriptors - void Close() - { - for ( size_t n = 0; n < WXSIZEOF(m_fds); n++ ) - { - if ( m_fds[n] != INVALID_FD ) - { - close(m_fds[n]); - m_fds[n] = INVALID_FD; - } - } - } - - // dtor closes the pipe descriptors - ~wxPipe() { Close(); } - -private: - int m_fds[2]; -}; - -#if wxUSE_STREAMS && wxUSE_FILE - -#include "wx/wfstream.h" - -// ---------------------------------------------------------------------------- -// wxPipeInputStream: stream for reading from a pipe -// ---------------------------------------------------------------------------- - -class wxPipeInputStream : public wxFileInputStream -{ -public: - wxPipeInputStream(int fd) : wxFileInputStream(fd) { } - - // return TRUE if the pipe is still opened - bool IsOpened() const { return !Eof(); } - - // return TRUE if we have anything to read, don't block - virtual bool CanRead() const; -}; - -#endif // wxUSE_STREAMS && wxUSE_FILE - -#endif // _WX_UNIX_PIPE_H_ - diff --git a/wxWidgets/include/wx/unix/private.h b/wxWidgets/include/wx/unix/private.h deleted file mode 100644 index abae99420c..0000000000 --- a/wxWidgets/include/wx/unix/private.h +++ /dev/null @@ -1,47 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: wx/unix/private.h -// Purpose: miscellaneous private things for Unix wx ports -// Author: Vadim Zeitlin -// Created: 2005-09-25 -// RCS-ID: $Id: private.h 35688 2005-09-25 19:59:19Z VZ $ -// Copyright: (c) 2005 Vadim Zeitlin <vadim@wxwindows.org> -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_UNIX_PRIVATE_H_ -#define _WX_UNIX_PRIVATE_H_ - -// standard linux headers produce many warnings when used with icc -#if defined(__INTELC__) && defined(__LINUX__) - inline void wxFD_ZERO(fd_set *fds) - { - #pragma warning(push) - #pragma warning(disable:593) - FD_ZERO(fds); - #pragma warning(pop) - } - - inline void wxFD_SET(int fd, fd_set *fds) - { - #pragma warning(push, 1) - #pragma warning(disable:1469) - FD_SET(fd, fds); - #pragma warning(pop) - } - - inline bool wxFD_ISSET(int fd, fd_set *fds) - { - #pragma warning(push, 1) - #pragma warning(disable:1469) - return FD_ISSET(fd, fds); - #pragma warning(pop) - } -#else // !__INTELC__ - #define wxFD_ZERO(fds) FD_ZERO(fds) - #define wxFD_SET(fd, fds) FD_SET(fd, fds) - #define wxFD_ISSET(fd, fds) FD_ISSET(fd, fds) -#endif // __INTELC__/!__INTELC__ - - -#endif // _WX_UNIX_PRIVATE_H_ - diff --git a/wxWidgets/include/wx/unix/sound.h b/wxWidgets/include/wx/unix/sound.h deleted file mode 100644 index adf71381d1..0000000000 --- a/wxWidgets/include/wx/unix/sound.h +++ /dev/null @@ -1,161 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/unix/sound.h -// Purpose: wxSound class -// Author: Julian Smart, Vaclav Slavik -// Modified by: -// Created: 25/10/98 -// RCS-ID: $Id: sound.h 42115 2006-10-19 13:09:48Z VZ $ -// Copyright: (c) Julian Smart, Vaclav Slavik -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_SOUND_H_ -#define _WX_SOUND_H_ - -#include "wx/defs.h" - -#if wxUSE_SOUND - -#include "wx/object.h" - -// ---------------------------------------------------------------------------- -// wxSound: simple audio playback class -// ---------------------------------------------------------------------------- - -class WXDLLIMPEXP_ADV wxSoundBackend; -class WXDLLIMPEXP_ADV wxSound; -class WXDLLIMPEXP_BASE wxDynamicLibrary; - -/// Sound data, as loaded from .wav file: -class WXDLLIMPEXP_ADV wxSoundData -{ -public: - wxSoundData() : m_refCnt(1) {} - void IncRef(); - void DecRef(); - - // .wav header information: - unsigned m_channels; // num of channels (mono:1, stereo:2) - unsigned m_samplingRate; - unsigned m_bitsPerSample; // if 8, then m_data contains unsigned 8bit - // samples (wxUint8), if 16 then signed 16bit - // (wxInt16) - unsigned m_samples; // length in samples: - - // wave data: - size_t m_dataBytes; - wxUint8 *m_data; // m_dataBytes bytes of data - -private: - ~wxSoundData(); - unsigned m_refCnt; - wxUint8 *m_dataWithHeader; // ditto, but prefixed with .wav header - friend class wxSound; -}; - - -/// Simple sound class: -class WXDLLIMPEXP_ADV wxSound : public wxSoundBase -{ -public: - wxSound(); - wxSound(const wxString& fileName, bool isResource = false); - wxSound(int size, const wxByte* data); - virtual ~wxSound(); - - // Create from resource or file - bool Create(const wxString& fileName, bool isResource = false); - // Create from data - bool Create(int size, const wxByte* data); - - bool IsOk() const { return m_data != NULL; } - - // Stop playing any sound - static void Stop(); - - // Returns true if a sound is being played - static bool IsPlaying(); - - // for internal use - static void UnloadBackend(); - -protected: - bool DoPlay(unsigned flags) const; - - static void EnsureBackend(); - void Free(); - bool LoadWAV(const wxUint8 *data, size_t length, bool copyData); - - static wxSoundBackend *ms_backend; -#if wxUSE_LIBSDL && wxUSE_PLUGINS - // FIXME - temporary, until we have plugins architecture - static wxDynamicLibrary *ms_backendSDL; -#endif - -private: - wxSoundData *m_data; -}; - - -// ---------------------------------------------------------------------------- -// wxSoundBackend: -// ---------------------------------------------------------------------------- - -// This is interface to sound playing implementation. There are multiple -// sound architectures in use on Unix platforms and wxWidgets can use several -// of them for playback, depending on their availability at runtime; hence -// the need for backends. This class is for use by wxWidgets and people writing -// additional backends only, it is _not_ for use by applications! - -// Structure that holds playback status information -struct wxSoundPlaybackStatus -{ - // playback is in progress - bool m_playing; - // main thread called wxSound::Stop() - bool m_stopRequested; -}; - -// Audio backend interface -class WXDLLIMPEXP_ADV wxSoundBackend -{ -public: - virtual ~wxSoundBackend() {} - - // Returns the name of the backend (e.g. "Open Sound System") - virtual wxString GetName() const = 0; - - // Returns priority (higher priority backends are tried first) - virtual int GetPriority() const = 0; - - // Checks if the backend's audio system is available and the backend can - // be used for playback - virtual bool IsAvailable() const = 0; - - // Returns true if the backend is capable of playing sound asynchronously. - // If false, then wxWidgets creates a playback thread and handles async - // playback, otherwise it is left up to the backend (will usually be more - // effective). - virtual bool HasNativeAsyncPlayback() const = 0; - - // Plays the sound. flags are same flags as those passed to wxSound::Play. - // The function should periodically check the value of - // status->m_stopRequested and terminate if it is set to true (it may - // be modified by another thread) - virtual bool Play(wxSoundData *data, unsigned flags, - volatile wxSoundPlaybackStatus *status) = 0; - - // Stops playback (if something is played). - virtual void Stop() = 0; - - // Returns true if the backend is playing anything at the moment. - // (This method is never called for backends that don't support async - // playback.) - virtual bool IsPlaying() const = 0; -}; - - -#endif // wxUSE_SOUND - -#endif // _WX_SOUND_H_ - diff --git a/wxWidgets/include/wx/unix/stackwalk.h b/wxWidgets/include/wx/unix/stackwalk.h deleted file mode 100644 index 15629d091a..0000000000 --- a/wxWidgets/include/wx/unix/stackwalk.h +++ /dev/null @@ -1,97 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: wx/unix/stackwalk.h -// Purpose: declaration of wxStackWalker for Unix -// Author: Vadim Zeitlin -// Modified by: -// Created: 2005-01-19 -// RCS-ID: $Id: stackwalk.h 43346 2006-11-12 14:33:03Z RR $ -// Copyright: (c) 2005 Vadim Zeitlin <vadim@wxwindows.org> -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_UNIX_STACKWALK_H_ -#define _WX_UNIX_STACKWALK_H_ - -// ---------------------------------------------------------------------------- -// wxStackFrame -// ---------------------------------------------------------------------------- - -class WXDLLIMPEXP_BASE wxStackFrame : public wxStackFrameBase -{ - friend class wxStackWalker; - -public: - // arguments are the stack depth of this frame, its address and the return - // value of backtrace_symbols() for it - // - // NB: we don't copy syminfo pointer so it should have lifetime at least as - // long as ours - wxStackFrame(size_t level = 0, void *address = NULL, const char *syminfo = NULL) - : wxStackFrameBase(level, address) - { - m_syminfo = syminfo; - } - -protected: - virtual void OnGetName(); - - // optimized for the 2 step initialization done by wxStackWalker - void Set(const wxString &name, const wxString &filename, const char* syminfo, - size_t level, size_t numLine, void *address) - { - m_level = level; - m_name = name; - m_filename = filename; - m_syminfo = syminfo; - - m_line = numLine; - m_address = address; - } - -private: - const char *m_syminfo; -}; - -// ---------------------------------------------------------------------------- -// wxStackWalker -// ---------------------------------------------------------------------------- - -class WXDLLIMPEXP_BASE wxStackWalker : public wxStackWalkerBase -{ -public: - // we need the full path to the program executable to be able to use - // addr2line, normally we can retrieve it from wxTheApp but if wxTheApp - // doesn't exist or doesn't have the correct value, the path may be given - // explicitly - wxStackWalker(const char *argv0 = NULL) - { - ms_exepath = wxString::FromAscii(argv0); - } - - ~wxStackWalker() - { - FreeStack(); - } - - virtual void Walk(size_t skip = 1, size_t maxDepth = 200); - virtual void WalkFromException() { Walk(2); } - - static const wxString& GetExePath() { return ms_exepath; } - - - // these two may be used to save the stack at some point (fast operation) - // and then process it later (slow operation) - void SaveStack(size_t maxDepth); - void ProcessFrames(size_t skip); - void FreeStack(); - -private: - int InitFrames(wxStackFrame *arr, size_t n, void **addresses, char **syminfo); - - static wxString ms_exepath; - static void *ms_addresses[]; - static char **ms_symbols; - static int m_depth; -}; - -#endif // _WX_UNIX_STACKWALK_H_ diff --git a/wxWidgets/include/wx/unix/stdpaths.h b/wxWidgets/include/wx/unix/stdpaths.h deleted file mode 100644 index 3e7faaf8d5..0000000000 --- a/wxWidgets/include/wx/unix/stdpaths.h +++ /dev/null @@ -1,56 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: wx/unix/stdpaths.h -// Purpose: wxStandardPaths for Unix systems -// Author: Vadim Zeitlin -// Modified by: -// Created: 2004-10-19 -// RCS-ID: $Id: stdpaths.h 43340 2006-11-12 12:58:10Z RR $ -// Copyright: (c) 2004 Vadim Zeitlin <vadim@wxwindows.org> -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_UNIX_STDPATHS_H_ -#define _WX_UNIX_STDPATHS_H_ - -// ---------------------------------------------------------------------------- -// wxStandardPaths -// ---------------------------------------------------------------------------- - -class WXDLLIMPEXP_BASE wxStandardPaths : public wxStandardPathsBase -{ -public: - // tries to determine the installation prefix automatically (Linux only right - // now) and returns /usr/local if it failed - void DetectPrefix(); - - // set the program installation directory which is /usr/local by default - // - // under some systems (currently only Linux) the program directory can be - // determined automatically but for portable programs you should always set - // it explicitly - void SetInstallPrefix(const wxString& prefix); - - // get the program installation prefix - // - // if the prefix had been previously by SetInstallPrefix, returns that - // value, otherwise calls DetectPrefix() - wxString GetInstallPrefix() const; - - - // implement base class pure virtuals - virtual wxString GetExecutablePath() const; - virtual wxString GetConfigDir() const; - virtual wxString GetUserConfigDir() const; - virtual wxString GetDataDir() const; - virtual wxString GetLocalDataDir() const; - virtual wxString GetUserDataDir() const; - virtual wxString GetPluginsDir() const; - virtual wxString GetLocalizedResourcesDir(const wxChar *lang, - ResourceCat category) const; - -private: - wxString m_prefix; -}; - -#endif // _WX_UNIX_STDPATHS_H_ - diff --git a/wxWidgets/include/wx/unix/taskbarx11.h b/wxWidgets/include/wx/unix/taskbarx11.h deleted file mode 100644 index 04ec3ac04d..0000000000 --- a/wxWidgets/include/wx/unix/taskbarx11.h +++ /dev/null @@ -1,46 +0,0 @@ -///////////////////////////////////////////////////////////////////////// -// File: wx/unix/taskbarx11.h -// Purpose: Defines wxTaskBarIcon class for most common X11 desktops -// Author: Vaclav Slavik -// Modified by: -// Created: 04/04/2003 -// RCS-ID: $Id: taskbarx11.h 53563 2008-05-11 22:45:36Z PC $ -// Copyright: (c) Vaclav Slavik, 2003 -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////// - -#ifndef _TASKBAR_H_ -#define _TASKBAR_H_ - -class WXDLLEXPORT wxIcon; -class WXDLLEXPORT wxFrame; -class WXDLLEXPORT wxWindow; - -class WXDLLIMPEXP_ADV wxTaskBarIconArea; - -class WXDLLIMPEXP_ADV wxTaskBarIcon: public wxTaskBarIconBase -{ -public: - wxTaskBarIcon(); - virtual ~wxTaskBarIcon(); - - // Accessors: - bool IsOk() const; - bool IsIconInstalled() const; - - // Operations: - bool SetIcon(const wxIcon& icon, const wxString& tooltip = wxEmptyString); - bool RemoveIcon(); - bool PopupMenu(wxMenu *menu); - -protected: - wxTaskBarIconArea *m_iconWnd; - -private: - void OnDestroy(wxWindowDestroyEvent&); - - DECLARE_DYNAMIC_CLASS(wxTaskBarIcon) -}; - -#endif - // _TASKBAR_H_ diff --git a/wxWidgets/include/wx/unix/utilsx11.h b/wxWidgets/include/wx/unix/utilsx11.h deleted file mode 100644 index cad9f67445..0000000000 --- a/wxWidgets/include/wx/unix/utilsx11.h +++ /dev/null @@ -1,53 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/unix/utilsx11.h -// Purpose: Miscellaneous X11 functions -// Author: Mattia Barbon, Vaclav Slavik -// Modified by: -// Created: 25.03.02 -// RCS-ID: $Id: utilsx11.h 27408 2004-05-23 20:53:33Z JS $ -// Copyright: (c) wxWidgets team -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_UNIX_UTILSX11_H_ -#define _WX_UNIX_UTILSX11_H_ - -#include "wx/defs.h" -#include "wx/gdicmn.h" - -// NB: Content of this header is for wxWidgets' private use! It is not -// part of public API and may be modified or even disappear in the future! - -#if defined(__WXMOTIF__) || defined(__WXGTK__) || defined(__WXX11__) - -#if defined(__WXGTK__) -typedef void WXDisplay; -typedef void* WXWindow; -#endif - -class wxIconBundle; - -void wxSetIconsX11( WXDisplay* display, WXWindow window, - const wxIconBundle& ib ); - - -enum wxX11FullScreenMethod -{ - wxX11_FS_AUTODETECT = 0, - wxX11_FS_WMSPEC, - wxX11_FS_KDE, - wxX11_FS_GENERIC -}; - -wxX11FullScreenMethod wxGetFullScreenMethodX11(WXDisplay* display, - WXWindow rootWindow); - -void wxSetFullScreenStateX11(WXDisplay* display, WXWindow rootWindow, - WXWindow window, bool show, wxRect *origSize, - wxX11FullScreenMethod method); - -#endif - // __WXMOTIF__, __WXGTK__, __WXX11__ - -#endif - // _WX_UNIX_UTILSX11_H_ diff --git a/wxWidgets/include/wx/uri.h b/wxWidgets/include/wx/uri.h deleted file mode 100644 index 23c97e2a1d..0000000000 --- a/wxWidgets/include/wx/uri.h +++ /dev/null @@ -1,151 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: uri.h -// Purpose: wxURI - Class for parsing URIs -// Author: Ryan Norton -// Modified By: -// Created: 07/01/2004 -// RCS-ID: $Id: uri.h 35650 2005-09-23 12:56:45Z MR $ -// Copyright: (c) Ryan Norton -// Licence: wxWindows Licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_URI_H_ -#define _WX_URI_H_ - -#include "wx/defs.h" -#include "wx/object.h" -#include "wx/string.h" - -// Host Type that the server component can be -enum wxURIHostType -{ - wxURI_REGNAME, // Host is a normal register name (www.mysite.com etc.) - wxURI_IPV4ADDRESS, // Host is a version 4 ip address (192.168.1.100) - wxURI_IPV6ADDRESS, // Host is a version 6 ip address [aa:aa:aa:aa::aa:aa]:5050 - wxURI_IPVFUTURE // Host is a future ip address (wxURI is unsure what kind) -}; - -// Component Flags -enum wxURIFieldType -{ - wxURI_SCHEME = 1, - wxURI_USERINFO = 2, - wxURI_SERVER = 4, - wxURI_PORT = 8, - wxURI_PATH = 16, - wxURI_QUERY = 32, - wxURI_FRAGMENT = 64 -}; - -// Miscellaneous other flags -enum wxURIFlags -{ - wxURI_STRICT = 1 -}; - - -// Generic class for parsing URIs. -// -// See RFC 3986 -class WXDLLIMPEXP_BASE wxURI : public wxObject -{ -public: - wxURI(); - wxURI(const wxString& uri); - wxURI(const wxURI& uri); - - virtual ~wxURI(); - - const wxChar* Create(const wxString& uri); - - bool HasScheme() const { return (m_fields & wxURI_SCHEME) == wxURI_SCHEME; } - bool HasUserInfo() const { return (m_fields & wxURI_USERINFO) == wxURI_USERINFO; } - bool HasServer() const { return (m_fields & wxURI_SERVER) == wxURI_SERVER; } - bool HasPort() const { return (m_fields & wxURI_PORT) == wxURI_PORT; } - bool HasPath() const { return (m_fields & wxURI_PATH) == wxURI_PATH; } - bool HasQuery() const { return (m_fields & wxURI_QUERY) == wxURI_QUERY; } - bool HasFragment() const { return (m_fields & wxURI_FRAGMENT) == wxURI_FRAGMENT; } - - const wxString& GetScheme() const { return m_scheme; } - const wxString& GetPath() const { return m_path; } - const wxString& GetQuery() const { return m_query; } - const wxString& GetFragment() const { return m_fragment; } - const wxString& GetPort() const { return m_port; } - const wxString& GetUserInfo() const { return m_userinfo; } - const wxString& GetServer() const { return m_server; } - const wxURIHostType& GetHostType() const { return m_hostType; } - - //Note that the following two get functions are explicitly depreciated by RFC 2396 - wxString GetUser() const; - wxString GetPassword() const; - - wxString BuildURI() const; - wxString BuildUnescapedURI() const; - - void Resolve(const wxURI& base, int flags = wxURI_STRICT); - bool IsReference() const; - - wxURI& operator = (const wxURI& uri); - wxURI& operator = (const wxString& string); - bool operator == (const wxURI& uri) const; - - static wxString Unescape (const wxString& szEscapedURI); - -protected: - wxURI& Assign(const wxURI& uri); - - void Clear(); - - const wxChar* Parse (const wxChar* uri); - const wxChar* ParseAuthority (const wxChar* uri); - const wxChar* ParseScheme (const wxChar* uri); - const wxChar* ParseUserInfo (const wxChar* uri); - const wxChar* ParseServer (const wxChar* uri); - const wxChar* ParsePort (const wxChar* uri); - const wxChar* ParsePath (const wxChar* uri, - bool bReference = false, - bool bNormalize = true); - const wxChar* ParseQuery (const wxChar* uri); - const wxChar* ParseFragment (const wxChar* uri); - - - static bool ParseH16(const wxChar*& uri); - static bool ParseIPv4address(const wxChar*& uri); - static bool ParseIPv6address(const wxChar*& uri); - static bool ParseIPvFuture(const wxChar*& uri); - - static void Normalize(wxChar* uri, bool bIgnoreLeads = false); - static void UpTree(const wxChar* uristart, const wxChar*& uri); - - static wxChar TranslateEscape(const wxChar* s); - static void Escape (wxString& s, const wxChar& c); - static bool IsEscape(const wxChar*& uri); - - static wxChar CharToHex(const wxChar& c); - - static bool IsUnreserved (const wxChar& c); - static bool IsReserved (const wxChar& c); - static bool IsGenDelim (const wxChar& c); - static bool IsSubDelim (const wxChar& c); - static bool IsHex(const wxChar& c); - static bool IsAlpha(const wxChar& c); - static bool IsDigit(const wxChar& c); - - wxString m_scheme; - wxString m_path; - wxString m_query; - wxString m_fragment; - - wxString m_userinfo; - wxString m_server; - wxString m_port; - - wxURIHostType m_hostType; - - size_t m_fields; - - DECLARE_DYNAMIC_CLASS(wxURI) -}; - -#endif // _WX_URI_H_ - diff --git a/wxWidgets/include/wx/url.h b/wxWidgets/include/wx/url.h deleted file mode 100644 index 6ef54f742b..0000000000 --- a/wxWidgets/include/wx/url.h +++ /dev/null @@ -1,129 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: url.h -// Purpose: URL parser -// Author: Guilhem Lavaux -// Modified by: Ryan Norton -// Created: 20/07/1997 -// RCS-ID: $Id: url.h 41263 2006-09-17 10:59:18Z RR $ -// Copyright: (c) 1997, 1998 Guilhem Lavaux -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_URL_H -#define _WX_URL_H - -#include "wx/defs.h" - -#if wxUSE_URL - -#include "wx/uri.h" -#include "wx/protocol/protocol.h" - -#if wxUSE_PROTOCOL_HTTP - #include "wx/protocol/http.h" -#endif - -typedef enum { - wxURL_NOERR = 0, - wxURL_SNTXERR, - wxURL_NOPROTO, - wxURL_NOHOST, - wxURL_NOPATH, - wxURL_CONNERR, - wxURL_PROTOERR -} wxURLError; - -#if wxUSE_URL_NATIVE -class WXDLLIMPEXP_NET wxURL; - -class WXDLLIMPEXP_NET wxURLNativeImp : public wxObject -{ -public: - virtual ~wxURLNativeImp() { } - virtual wxInputStream *GetInputStream(wxURL *owner) = 0; -}; -#endif // wxUSE_URL_NATIVE - -class WXDLLIMPEXP_NET wxURL : public wxURI -{ -public: - wxURL(const wxString& sUrl = wxEmptyString); - wxURL(const wxURI& url); - virtual ~wxURL(); - - wxURL& operator = (const wxString& url); - wxURL& operator = (const wxURI& url); - - wxProtocol& GetProtocol() { return *m_protocol; } - wxURLError GetError() const { return m_error; } - wxString GetURL() const { return m_url; } - - wxURLError SetURL(const wxString &url) - { *this = url; return m_error; } - - bool IsOk() const - { return m_error == wxURL_NOERR; } - - wxInputStream *GetInputStream(); - -#if wxUSE_PROTOCOL_HTTP - static void SetDefaultProxy(const wxString& url_proxy); - void SetProxy(const wxString& url_proxy); -#endif // wxUSE_PROTOCOL_HTTP - -#if WXWIN_COMPATIBILITY_2_4 - //Use the proper wxURI accessors instead - wxDEPRECATED( wxString GetProtocolName() const ); - wxDEPRECATED( wxString GetHostName() const ); - wxDEPRECATED( wxString GetPath() const ); - - //Use wxURI instead - this does not work that well - wxDEPRECATED( static wxString ConvertToValidURI( - const wxString& uri, - const wxChar* delims = wxT(";/?:@&=+$,") - ) ); - - //Use wxURI::Unescape instead - wxDEPRECATED( static wxString ConvertFromURI(const wxString& uri) ); -#endif - -protected: - static wxProtoInfo *ms_protocols; - -#if wxUSE_PROTOCOL_HTTP - static wxHTTP *ms_proxyDefault; - static bool ms_useDefaultProxy; - wxHTTP *m_proxy; -#endif // wxUSE_PROTOCOL_HTTP - -#if wxUSE_URL_NATIVE - friend class wxURLNativeImp; - // pointer to a native URL implementation object - wxURLNativeImp *m_nativeImp; - // Creates on the heap and returns a native - // implementation object for the current platform. - static wxURLNativeImp *CreateNativeImpObject(); -#endif - wxProtoInfo *m_protoinfo; - wxProtocol *m_protocol; - - wxURLError m_error; - wxString m_url; - bool m_useProxy; - - void Init(const wxString&); - bool ParseURL(); - void CleanData(); - bool FetchProtocol(); - - friend class wxProtoInfo; - friend class wxURLModule; - -private: - DECLARE_DYNAMIC_CLASS(wxURL) -}; - -#endif // wxUSE_URL - -#endif // _WX_URL_H - diff --git a/wxWidgets/include/wx/utils.h b/wxWidgets/include/wx/utils.h deleted file mode 100644 index c45dbc7525..0000000000 --- a/wxWidgets/include/wx/utils.h +++ /dev/null @@ -1,747 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/utils.h -// Purpose: Miscellaneous utilities -// Author: Julian Smart -// Modified by: -// Created: 29/01/98 -// RCS-ID: $Id: utils.h 62544 2009-11-03 14:11:30Z VZ $ -// Copyright: (c) 1998 Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_UTILSH__ -#define _WX_UTILSH__ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -#include "wx/object.h" -#include "wx/list.h" -#include "wx/filefn.h" -#if wxUSE_GUI - #include "wx/gdicmn.h" -#endif - -class WXDLLIMPEXP_FWD_BASE wxArrayString; -class WXDLLIMPEXP_FWD_BASE wxArrayInt; - -// need this for wxGetDiskSpace() as we can't, unfortunately, forward declare -// wxLongLong -#include "wx/longlong.h" - -// need for wxOperatingSystemId -#include "wx/platinfo.h" - -#ifdef __WATCOMC__ - #include <direct.h> -#elif defined(__X__) - #include <dirent.h> - #include <unistd.h> -#endif - -#include <stdio.h> - -// ---------------------------------------------------------------------------- -// Forward declaration -// ---------------------------------------------------------------------------- - -class WXDLLIMPEXP_FWD_BASE wxProcess; -class WXDLLIMPEXP_FWD_CORE wxFrame; -class WXDLLIMPEXP_FWD_CORE wxWindow; -class WXDLLIMPEXP_FWD_CORE wxWindowList; - -// ---------------------------------------------------------------------------- -// Macros -// ---------------------------------------------------------------------------- - -#define wxMax(a,b) (((a) > (b)) ? (a) : (b)) -#define wxMin(a,b) (((a) < (b)) ? (a) : (b)) -#define wxClip(a,b,c) (((a) < (b)) ? (b) : (((a) > (c)) ? (c) : (a))) - -// wxGetFreeMemory can return huge amount of memory on 32-bit platforms as well -// so to always use long long for its result type on all platforms which -// support it -#if wxUSE_LONGLONG - typedef wxLongLong wxMemorySize; -#else - typedef long wxMemorySize; -#endif - -// ---------------------------------------------------------------------------- -// String functions (deprecated, use wxString) -// ---------------------------------------------------------------------------- - -// Make a copy of this string using 'new' -#if WXWIN_COMPATIBILITY_2_4 -wxDEPRECATED( WXDLLIMPEXP_BASE wxChar* copystring(const wxChar *s) ); -#endif - -// A shorter way of using strcmp -#define wxStringEq(s1, s2) (s1 && s2 && (wxStrcmp(s1, s2) == 0)) - -// ---------------------------------------------------------------------------- -// Miscellaneous functions -// ---------------------------------------------------------------------------- - -// Sound the bell -#if !defined __EMX__ && \ - (defined __WXMOTIF__ || defined __WXGTK__ || defined __WXX11__) -WXDLLIMPEXP_CORE void wxBell(); -#else -WXDLLIMPEXP_BASE void wxBell(); -#endif - -// Get OS description as a user-readable string -WXDLLIMPEXP_BASE wxString wxGetOsDescription(); - -// Get OS version -WXDLLIMPEXP_BASE wxOperatingSystemId wxGetOsVersion(int *majorVsn = (int *) NULL, - int *minorVsn = (int *) NULL); - -// Get platform endianness -WXDLLIMPEXP_BASE bool wxIsPlatformLittleEndian(); - -// Get platform architecture -WXDLLIMPEXP_BASE bool wxIsPlatform64Bit(); - -// Return a string with the current date/time -WXDLLIMPEXP_BASE wxString wxNow(); - -// Return path where wxWidgets is installed (mostly useful in Unices) -WXDLLIMPEXP_BASE const wxChar *wxGetInstallPrefix(); -// Return path to wxWin data (/usr/share/wx/%{version}) (Unices) -WXDLLIMPEXP_BASE wxString wxGetDataDir(); - -/* - * Class to make it easier to specify platform-dependent values - * - * Examples: - * long val = wxPlatform::If(wxMac, 1).ElseIf(wxGTK, 2).ElseIf(stPDA, 5).Else(3); - * wxString strVal = wxPlatform::If(wxMac, wxT("Mac")).ElseIf(wxMSW, wxT("MSW")).Else(wxT("Other")); - * - * A custom platform symbol: - * - * #define stPDA 100 - * #ifdef __WXWINCE__ - * wxPlatform::AddPlatform(stPDA); - * #endif - * - * long windowStyle = wxCAPTION | (long) wxPlatform::IfNot(stPDA, wxRESIZE_BORDER); - * - */ - -class WXDLLIMPEXP_BASE wxPlatform -{ -public: - wxPlatform() { Init(); } - wxPlatform(const wxPlatform& platform) { Copy(platform); } - void operator = (const wxPlatform& platform) { Copy(platform); } - void Copy(const wxPlatform& platform); - - // Specify an optional default value - wxPlatform(int defValue) { Init(); m_longValue = (long)defValue; } - wxPlatform(long defValue) { Init(); m_longValue = defValue; } - wxPlatform(const wxString& defValue) { Init(); m_stringValue = defValue; } - wxPlatform(double defValue) { Init(); m_doubleValue = defValue; } - - static wxPlatform If(int platform, long value); - static wxPlatform IfNot(int platform, long value); - wxPlatform& ElseIf(int platform, long value); - wxPlatform& ElseIfNot(int platform, long value); - wxPlatform& Else(long value); - - static wxPlatform If(int platform, int value) { return If(platform, (long)value); } - static wxPlatform IfNot(int platform, int value) { return IfNot(platform, (long)value); } - wxPlatform& ElseIf(int platform, int value) { return ElseIf(platform, (long) value); } - wxPlatform& ElseIfNot(int platform, int value) { return ElseIfNot(platform, (long) value); } - wxPlatform& Else(int value) { return Else((long) value); } - - static wxPlatform If(int platform, double value); - static wxPlatform IfNot(int platform, double value); - wxPlatform& ElseIf(int platform, double value); - wxPlatform& ElseIfNot(int platform, double value); - wxPlatform& Else(double value); - - static wxPlatform If(int platform, const wxString& value); - static wxPlatform IfNot(int platform, const wxString& value); - wxPlatform& ElseIf(int platform, const wxString& value); - wxPlatform& ElseIfNot(int platform, const wxString& value); - wxPlatform& Else(const wxString& value); - - long GetInteger() const { return m_longValue; } - const wxString& GetString() const { return m_stringValue; } - double GetDouble() const { return m_doubleValue; } - - operator int() const { return (int) GetInteger(); } - operator long() const { return GetInteger(); } - operator double() const { return GetDouble(); } - operator const wxString() const { return GetString(); } - operator const wxChar*() const { return (const wxChar*) GetString(); } - - static void AddPlatform(int platform); - static bool Is(int platform); - static void ClearPlatforms(); - -private: - - void Init() { m_longValue = 0; m_doubleValue = 0.0; } - - long m_longValue; - double m_doubleValue; - wxString m_stringValue; - static wxArrayInt* sm_customPlatforms; -}; - -/// Function for testing current platform -inline bool wxPlatformIs(int platform) { return wxPlatform::Is(platform); } - -#if wxUSE_GUI - -// Get the state of a key (true if pressed, false if not) -// This is generally most useful getting the state of -// the modifier or toggle keys. -WXDLLEXPORT bool wxGetKeyState(wxKeyCode key); - - -// Don't synthesize KeyUp events holding down a key and producing -// KeyDown events with autorepeat. On by default and always on -// in wxMSW. -WXDLLEXPORT bool wxSetDetectableAutoRepeat( bool flag ); - - -// wxMouseState is used to hold information about button and modifier state -// and is what is returned from wxGetMouseState. -class WXDLLEXPORT wxMouseState -{ -public: - wxMouseState() - : m_x(0), m_y(0), - m_leftDown(false), m_middleDown(false), m_rightDown(false), - m_controlDown(false), m_shiftDown(false), m_altDown(false), - m_metaDown(false) - {} - - wxCoord GetX() { return m_x; } - wxCoord GetY() { return m_y; } - - bool LeftDown() { return m_leftDown; } - bool MiddleDown() { return m_middleDown; } - bool RightDown() { return m_rightDown; } - -#if wxABI_VERSION >= 20811 - bool LeftIsDown() { return m_leftDown; } - bool MiddleIsDown() { return m_middleDown; } - bool RightIsDown() { return m_rightDown; } -#endif // wx >= 2.8.11 - - bool ControlDown() { return m_controlDown; } - bool ShiftDown() { return m_shiftDown; } - bool AltDown() { return m_altDown; } - bool MetaDown() { return m_metaDown; } - bool CmdDown() - { -#if defined(__WXMAC__) || defined(__WXCOCOA__) - return MetaDown(); -#else - return ControlDown(); -#endif - } - - void SetX(wxCoord x) { m_x = x; } - void SetY(wxCoord y) { m_y = y; } - - void SetLeftDown(bool down) { m_leftDown = down; } - void SetMiddleDown(bool down) { m_middleDown = down; } - void SetRightDown(bool down) { m_rightDown = down; } - - void SetControlDown(bool down) { m_controlDown = down; } - void SetShiftDown(bool down) { m_shiftDown = down; } - void SetAltDown(bool down) { m_altDown = down; } - void SetMetaDown(bool down) { m_metaDown = down; } - -private: - wxCoord m_x; - wxCoord m_y; - - bool m_leftDown : 1; - bool m_middleDown : 1; - bool m_rightDown : 1; - - bool m_controlDown : 1; - bool m_shiftDown : 1; - bool m_altDown : 1; - bool m_metaDown : 1; -}; - - -// Returns the current state of the mouse position, buttons and modifers -WXDLLEXPORT wxMouseState wxGetMouseState(); - - -// ---------------------------------------------------------------------------- -// Window ID management -// ---------------------------------------------------------------------------- - -// Generate a unique ID -WXDLLEXPORT long wxNewId(); - -// Ensure subsequent IDs don't clash with this one -WXDLLEXPORT void wxRegisterId(long id); - -// Return the current ID -WXDLLEXPORT long wxGetCurrentId(); - -#endif // wxUSE_GUI - -// ---------------------------------------------------------------------------- -// Various conversions -// ---------------------------------------------------------------------------- - -// these functions are deprecated, use wxString methods instead! -#if WXWIN_COMPATIBILITY_2_4 - -extern WXDLLIMPEXP_DATA_BASE(const wxChar*) wxFloatToStringStr; -extern WXDLLIMPEXP_DATA_BASE(const wxChar*) wxDoubleToStringStr; - -wxDEPRECATED( WXDLLIMPEXP_BASE void StringToFloat(const wxChar *s, float *number) ); -wxDEPRECATED( WXDLLIMPEXP_BASE wxChar* FloatToString(float number, const wxChar *fmt = wxFloatToStringStr) ); -wxDEPRECATED( WXDLLIMPEXP_BASE void StringToDouble(const wxChar *s, double *number) ); -wxDEPRECATED( WXDLLIMPEXP_BASE wxChar* DoubleToString(double number, const wxChar *fmt = wxDoubleToStringStr) ); -wxDEPRECATED( WXDLLIMPEXP_BASE void StringToInt(const wxChar *s, int *number) ); -wxDEPRECATED( WXDLLIMPEXP_BASE void StringToLong(const wxChar *s, long *number) ); -wxDEPRECATED( WXDLLIMPEXP_BASE wxChar* IntToString(int number) ); -wxDEPRECATED( WXDLLIMPEXP_BASE wxChar* LongToString(long number) ); - -#endif // WXWIN_COMPATIBILITY_2_4 - -// Convert 2-digit hex number to decimal -WXDLLIMPEXP_BASE int wxHexToDec(const wxString& buf); - -// Convert decimal integer to 2-character hex string -WXDLLIMPEXP_BASE void wxDecToHex(int dec, wxChar *buf); -WXDLLIMPEXP_BASE wxString wxDecToHex(int dec); - -// ---------------------------------------------------------------------------- -// Process management -// ---------------------------------------------------------------------------- - -// NB: for backwards compatibility reasons the values of wxEXEC_[A]SYNC *must* -// be 0 and 1, don't change! - -enum -{ - // execute the process asynchronously - wxEXEC_ASYNC = 0, - - // execute it synchronously, i.e. wait until it finishes - wxEXEC_SYNC = 1, - - // under Windows, don't hide the child even if it's IO is redirected (this - // is done by default) - wxEXEC_NOHIDE = 2, - - // under Unix, if the process is the group leader then passing wxKILL_CHILDREN to wxKill - // kills all children as well as pid - wxEXEC_MAKE_GROUP_LEADER = 4, - - // by default synchronous execution disables all program windows to avoid - // that the user interacts with the program while the child process is - // running, you can use this flag to prevent this from happening - wxEXEC_NODISABLE = 8 -}; - -// Execute another program. -// -// If flags contain wxEXEC_SYNC, return -1 on failure and the exit code of the -// process if everything was ok. Otherwise (i.e. if wxEXEC_ASYNC), return 0 on -// failure and the PID of the launched process if ok. -WXDLLIMPEXP_BASE long wxExecute(wxChar **argv, int flags = wxEXEC_ASYNC, - wxProcess *process = (wxProcess *) NULL); -WXDLLIMPEXP_BASE long wxExecute(const wxString& command, int flags = wxEXEC_ASYNC, - wxProcess *process = (wxProcess *) NULL); - -// execute the command capturing its output into an array line by line, this is -// always synchronous -WXDLLIMPEXP_BASE long wxExecute(const wxString& command, - wxArrayString& output, - int flags = 0); - -// also capture stderr (also synchronous) -WXDLLIMPEXP_BASE long wxExecute(const wxString& command, - wxArrayString& output, - wxArrayString& error, - int flags = 0); - -#if defined(__WXMSW__) && wxUSE_IPC -// ask a DDE server to execute the DDE request with given parameters -WXDLLIMPEXP_BASE bool wxExecuteDDE(const wxString& ddeServer, - const wxString& ddeTopic, - const wxString& ddeCommand); -#endif // __WXMSW__ && wxUSE_IPC - -enum wxSignal -{ - wxSIGNONE = 0, // verify if the process exists under Unix - wxSIGHUP, - wxSIGINT, - wxSIGQUIT, - wxSIGILL, - wxSIGTRAP, - wxSIGABRT, - wxSIGIOT = wxSIGABRT, // another name - wxSIGEMT, - wxSIGFPE, - wxSIGKILL, - wxSIGBUS, - wxSIGSEGV, - wxSIGSYS, - wxSIGPIPE, - wxSIGALRM, - wxSIGTERM - - // further signals are different in meaning between different Unix systems -}; - -enum wxKillError -{ - wxKILL_OK, // no error - wxKILL_BAD_SIGNAL, // no such signal - wxKILL_ACCESS_DENIED, // permission denied - wxKILL_NO_PROCESS, // no such process - wxKILL_ERROR // another, unspecified error -}; - -enum wxKillFlags -{ - wxKILL_NOCHILDREN = 0, // don't kill children - wxKILL_CHILDREN = 1 // kill children -}; - -enum wxShutdownFlags -{ - wxSHUTDOWN_POWEROFF, // power off the computer - wxSHUTDOWN_REBOOT // shutdown and reboot -}; - -// Shutdown or reboot the PC -WXDLLIMPEXP_BASE bool wxShutdown(wxShutdownFlags wFlags); - -// send the given signal to the process (only NONE and KILL are supported under -// Windows, all others mean TERM), return 0 if ok and -1 on error -// -// return detailed error in rc if not NULL -WXDLLIMPEXP_BASE int wxKill(long pid, - wxSignal sig = wxSIGTERM, - wxKillError *rc = NULL, - int flags = wxKILL_NOCHILDREN); - -// Execute a command in an interactive shell window (always synchronously) -// If no command then just the shell -WXDLLIMPEXP_BASE bool wxShell(const wxString& command = wxEmptyString); - -// As wxShell(), but must give a (non interactive) command and its output will -// be returned in output array -WXDLLIMPEXP_BASE bool wxShell(const wxString& command, wxArrayString& output); - -// Sleep for nSecs seconds -WXDLLIMPEXP_BASE void wxSleep(int nSecs); - -// Sleep for a given amount of milliseconds -WXDLLIMPEXP_BASE void wxMilliSleep(unsigned long milliseconds); - -// Sleep for a given amount of microseconds -WXDLLIMPEXP_BASE void wxMicroSleep(unsigned long microseconds); - -// Sleep for a given amount of milliseconds (old, bad name), use wxMilliSleep -wxDEPRECATED( WXDLLIMPEXP_BASE void wxUsleep(unsigned long milliseconds) ); - -// Get the process id of the current process -WXDLLIMPEXP_BASE unsigned long wxGetProcessId(); - -// Get free memory in bytes, or -1 if cannot determine amount (e.g. on UNIX) -WXDLLIMPEXP_BASE wxMemorySize wxGetFreeMemory(); - -#if wxUSE_ON_FATAL_EXCEPTION - -// should wxApp::OnFatalException() be called? -WXDLLIMPEXP_BASE bool wxHandleFatalExceptions(bool doit = true); - -#endif // wxUSE_ON_FATAL_EXCEPTION - -// flags for wxLaunchDefaultBrowser -enum -{ - wxBROWSER_NEW_WINDOW = 1 -}; - -// Launch url in the user's default internet browser -WXDLLIMPEXP_BASE bool wxLaunchDefaultBrowser(const wxString& url, int flags = 0); - -// ---------------------------------------------------------------------------- -// Environment variables -// ---------------------------------------------------------------------------- - -// returns true if variable exists (value may be NULL if you just want to check -// for this) -WXDLLIMPEXP_BASE bool wxGetEnv(const wxString& var, wxString *value); - -// set the env var name to the given value, return true on success -WXDLLIMPEXP_BASE bool wxSetEnv(const wxString& var, const wxChar *value); - -// remove the env var from environment -inline bool wxUnsetEnv(const wxString& var) { return wxSetEnv(var, NULL); } - -// ---------------------------------------------------------------------------- -// Network and username functions. -// ---------------------------------------------------------------------------- - -// NB: "char *" functions are deprecated, use wxString ones! - -// Get eMail address -WXDLLIMPEXP_BASE bool wxGetEmailAddress(wxChar *buf, int maxSize); -WXDLLIMPEXP_BASE wxString wxGetEmailAddress(); - -// Get hostname. -WXDLLIMPEXP_BASE bool wxGetHostName(wxChar *buf, int maxSize); -WXDLLIMPEXP_BASE wxString wxGetHostName(); - -// Get FQDN -WXDLLIMPEXP_BASE wxString wxGetFullHostName(); -WXDLLIMPEXP_BASE bool wxGetFullHostName(wxChar *buf, int maxSize); - -// Get user ID e.g. jacs (this is known as login name under Unix) -WXDLLIMPEXP_BASE bool wxGetUserId(wxChar *buf, int maxSize); -WXDLLIMPEXP_BASE wxString wxGetUserId(); - -// Get user name e.g. Julian Smart -WXDLLIMPEXP_BASE bool wxGetUserName(wxChar *buf, int maxSize); -WXDLLIMPEXP_BASE wxString wxGetUserName(); - -// Get current Home dir and copy to dest (returns pstr->c_str()) -WXDLLIMPEXP_BASE wxString wxGetHomeDir(); -WXDLLIMPEXP_BASE const wxChar* wxGetHomeDir(wxString *pstr); - -// Get the user's home dir (caller must copy --- volatile) -// returns NULL is no HOME dir is known -#if defined(__UNIX__) && wxUSE_UNICODE && !defined(__WINE__) -WXDLLIMPEXP_BASE const wxMB2WXbuf wxGetUserHome(const wxString& user = wxEmptyString); -#else -WXDLLIMPEXP_BASE wxChar* wxGetUserHome(const wxString& user = wxEmptyString); -#endif - -#if wxUSE_LONGLONG - typedef wxLongLong wxDiskspaceSize_t; -#else - typedef long wxDiskspaceSize_t; -#endif - -// get number of total/free bytes on the disk where path belongs -WXDLLIMPEXP_BASE bool wxGetDiskSpace(const wxString& path, - wxDiskspaceSize_t *pTotal = NULL, - wxDiskspaceSize_t *pFree = NULL); - -#if wxUSE_GUI // GUI only things from now on - -// ---------------------------------------------------------------------------- -// Menu accelerators related things -// ---------------------------------------------------------------------------- - -// flags for wxStripMenuCodes -enum -{ - // strip '&' characters - wxStrip_Mnemonics = 1, - - // strip everything after '\t' - wxStrip_Accel = 2, - - // strip everything (this is the default) - wxStrip_All = wxStrip_Mnemonics | wxStrip_Accel -}; - -// strip mnemonics and/or accelerators from the label -WXDLLEXPORT wxString -wxStripMenuCodes(const wxString& str, int flags = wxStrip_All); - -#if WXWIN_COMPATIBILITY_2_6 -// obsolete and deprecated version, do not use, use the above overload instead -wxDEPRECATED( - WXDLLEXPORT wxChar* wxStripMenuCodes(const wxChar *in, wxChar *out = NULL) -); - -#if wxUSE_ACCEL -class WXDLLIMPEXP_FWD_CORE wxAcceleratorEntry; - -// use wxAcceleratorEntry::Create() or FromString() methods instead -wxDEPRECATED( - WXDLLEXPORT wxAcceleratorEntry *wxGetAccelFromString(const wxString& label) -); -#endif // wxUSE_ACCEL - -#endif // WXWIN_COMPATIBILITY_2_6 - -// ---------------------------------------------------------------------------- -// Window search -// ---------------------------------------------------------------------------- - -// Returns menu item id or wxNOT_FOUND if none. -WXDLLEXPORT int wxFindMenuItemId(wxFrame *frame, const wxString& menuString, const wxString& itemString); - -// Find the wxWindow at the given point. wxGenericFindWindowAtPoint -// is always present but may be less reliable than a native version. -WXDLLEXPORT wxWindow* wxGenericFindWindowAtPoint(const wxPoint& pt); -WXDLLEXPORT wxWindow* wxFindWindowAtPoint(const wxPoint& pt); - -// NB: this function is obsolete, use wxWindow::FindWindowByLabel() instead -// -// Find the window/widget with the given title or label. -// Pass a parent to begin the search from, or NULL to look through -// all windows. -WXDLLEXPORT wxWindow* wxFindWindowByLabel(const wxString& title, wxWindow *parent = (wxWindow *) NULL); - -// NB: this function is obsolete, use wxWindow::FindWindowByName() instead -// -// Find window by name, and if that fails, by label. -WXDLLEXPORT wxWindow* wxFindWindowByName(const wxString& name, wxWindow *parent = (wxWindow *) NULL); - -// ---------------------------------------------------------------------------- -// Message/event queue helpers -// ---------------------------------------------------------------------------- - -// Yield to other apps/messages and disable user input -WXDLLEXPORT bool wxSafeYield(wxWindow *win = NULL, bool onlyIfNeeded = false); - -// Enable or disable input to all top level windows -WXDLLEXPORT void wxEnableTopLevelWindows(bool enable = true); - -// Check whether this window wants to process messages, e.g. Stop button -// in long calculations. -WXDLLEXPORT bool wxCheckForInterrupt(wxWindow *wnd); - -// Consume all events until no more left -WXDLLEXPORT void wxFlushEvents(); - -// a class which disables all windows (except, may be, thegiven one) in its -// ctor and enables them back in its dtor -class WXDLLEXPORT wxWindowDisabler -{ -public: - wxWindowDisabler(wxWindow *winToSkip = (wxWindow *)NULL); - ~wxWindowDisabler(); - -private: - wxWindowList *m_winDisabled; - - DECLARE_NO_COPY_CLASS(wxWindowDisabler) -}; - -// ---------------------------------------------------------------------------- -// Cursors -// ---------------------------------------------------------------------------- - -// Set the cursor to the busy cursor for all windows -WXDLLIMPEXP_CORE void wxBeginBusyCursor(const wxCursor *cursor = wxHOURGLASS_CURSOR); - -// Restore cursor to normal -WXDLLEXPORT void wxEndBusyCursor(); - -// true if we're between the above two calls -WXDLLEXPORT bool wxIsBusy(); - -// Convenience class so we can just create a wxBusyCursor object on the stack -class WXDLLEXPORT wxBusyCursor -{ -public: - wxBusyCursor(const wxCursor* cursor = wxHOURGLASS_CURSOR) - { wxBeginBusyCursor(cursor); } - ~wxBusyCursor() - { wxEndBusyCursor(); } - - // FIXME: These two methods are currently only implemented (and needed?) - // in wxGTK. BusyCursor handling should probably be moved to - // common code since the wxGTK and wxMSW implementations are very - // similar except for wxMSW using HCURSOR directly instead of - // wxCursor.. -- RL. - static const wxCursor &GetStoredCursor(); - static const wxCursor GetBusyCursor(); -}; - - -// ---------------------------------------------------------------------------- -// Reading and writing resources (eg WIN.INI, .Xdefaults) -// ---------------------------------------------------------------------------- - -#if wxUSE_RESOURCES -WXDLLEXPORT bool wxWriteResource(const wxString& section, const wxString& entry, const wxString& value, const wxString& file = wxEmptyString); -WXDLLEXPORT bool wxWriteResource(const wxString& section, const wxString& entry, float value, const wxString& file = wxEmptyString); -WXDLLEXPORT bool wxWriteResource(const wxString& section, const wxString& entry, long value, const wxString& file = wxEmptyString); -WXDLLEXPORT bool wxWriteResource(const wxString& section, const wxString& entry, int value, const wxString& file = wxEmptyString); - -WXDLLEXPORT bool wxGetResource(const wxString& section, const wxString& entry, wxChar **value, const wxString& file = wxEmptyString); -WXDLLEXPORT bool wxGetResource(const wxString& section, const wxString& entry, float *value, const wxString& file = wxEmptyString); -WXDLLEXPORT bool wxGetResource(const wxString& section, const wxString& entry, long *value, const wxString& file = wxEmptyString); -WXDLLEXPORT bool wxGetResource(const wxString& section, const wxString& entry, int *value, const wxString& file = wxEmptyString); -#endif // wxUSE_RESOURCES - -void WXDLLEXPORT wxGetMousePosition( int* x, int* y ); - -// MSW only: get user-defined resource from the .res file. -// Returns NULL or newly-allocated memory, so use delete[] to clean up. -#ifdef __WXMSW__ - extern WXDLLEXPORT const wxChar* wxUserResourceStr; - WXDLLEXPORT wxChar* wxLoadUserResource(const wxString& resourceName, const wxString& resourceType = wxUserResourceStr); -#endif // MSW - -// ---------------------------------------------------------------------------- -// Display and colorss (X only) -// ---------------------------------------------------------------------------- - -#ifdef __WXGTK__ - void *wxGetDisplay(); -#endif - -#ifdef __X__ - WXDLLIMPEXP_CORE WXDisplay *wxGetDisplay(); - WXDLLIMPEXP_CORE bool wxSetDisplay(const wxString& display_name); - WXDLLIMPEXP_CORE wxString wxGetDisplayName(); -#endif // X or GTK+ - -#ifdef __X__ - -#ifdef __VMS__ // Xlib.h for VMS is not (yet) compatible with C++ - // The resulting warnings are switched off here -#pragma message disable nosimpint -#endif -// #include <X11/Xlib.h> -#ifdef __VMS__ -#pragma message enable nosimpint -#endif - -#endif //__X__ - -#endif // wxUSE_GUI - -// ---------------------------------------------------------------------------- -// wxYield(): these functions are obsolete, please use wxApp methods instead! -// ---------------------------------------------------------------------------- - -// avoid redeclaring this function here if it had been already declated by -// wx/app.h, this results in warnings from g++ with -Wredundant-decls -#ifndef wx_YIELD_DECLARED -#define wx_YIELD_DECLARED - -// Yield to other apps/messages -WXDLLIMPEXP_BASE bool wxYield(); - -#endif // wx_YIELD_DECLARED - -// Like wxYield, but fails silently if the yield is recursive. -WXDLLIMPEXP_BASE bool wxYieldIfNeeded(); - -// ---------------------------------------------------------------------------- -// Error message functions used by wxWidgets (deprecated, use wxLog) -// ---------------------------------------------------------------------------- - -#endif - // _WX_UTILSH__ diff --git a/wxWidgets/include/wx/valgen.h b/wxWidgets/include/wx/valgen.h deleted file mode 100644 index 35dd44ff5f..0000000000 --- a/wxWidgets/include/wx/valgen.h +++ /dev/null @@ -1,69 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: valgen.h -// Purpose: wxGenericValidator class -// Author: Kevin Smith -// Modified by: -// Created: Jan 22 1999 -// RCS-ID: -// Copyright: (c) 1999 Julian Smart (assigned from Kevin) -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_VALGENH__ -#define _WX_VALGENH__ - -#include "wx/validate.h" - -#if wxUSE_VALIDATORS - -class WXDLLEXPORT wxGenericValidator: public wxValidator -{ -DECLARE_CLASS(wxGenericValidator) -public: - wxGenericValidator(bool* val); - wxGenericValidator(int* val); - wxGenericValidator(wxString* val); - wxGenericValidator(wxArrayInt* val); - wxGenericValidator(const wxGenericValidator& copyFrom); - - virtual ~wxGenericValidator(){} - - // Make a clone of this validator (or return NULL) - currently necessary - // if you're passing a reference to a validator. - // Another possibility is to always pass a pointer to a new validator - // (so the calling code can use a copy constructor of the relevant class). - virtual wxObject *Clone() const { return new wxGenericValidator(*this); } - bool Copy(const wxGenericValidator& val); - - // Called when the value in the window must be validated. - // This function can pop up an error message. - virtual bool Validate(wxWindow * WXUNUSED(parent)) { return true; } - - // Called to transfer data to the window - virtual bool TransferToWindow(); - - // Called to transfer data to the window - virtual bool TransferFromWindow(); - -protected: - void Initialize(); - - bool* m_pBool; - int* m_pInt; - wxString* m_pString; - wxArrayInt* m_pArrayInt; - -private: -// Cannot use -// DECLARE_NO_COPY_CLASS(wxGenericValidator) -// because copy constructor is explicitly declared above; -// but no copy assignment operator is defined, so declare -// it private to prevent the compiler from defining it: - wxGenericValidator& operator=(const wxGenericValidator&); -}; - -#endif - // wxUSE_VALIDATORS - -#endif - // _WX_VALGENH__ diff --git a/wxWidgets/include/wx/validate.h b/wxWidgets/include/wx/validate.h deleted file mode 100644 index b25649fb3a..0000000000 --- a/wxWidgets/include/wx/validate.h +++ /dev/null @@ -1,98 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/validate.h -// Purpose: wxValidator class -// Author: Julian Smart -// Modified by: -// Created: 29/01/98 -// RCS-ID: $Id: validate.h 53135 2008-04-12 02:31:04Z VZ $ -// Copyright: (c) 1998 Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_VALIDATE_H_ -#define _WX_VALIDATE_H_ - -#include "wx/defs.h" - -#if wxUSE_VALIDATORS - -#include "wx/event.h" - -class WXDLLIMPEXP_FWD_CORE wxWindow; -class WXDLLIMPEXP_FWD_CORE wxWindowBase; - -/* - A validator has up to three purposes: - - 1) To validate the data in the window that's associated - with the validator. - 2) To transfer data to and from the window. - 3) To filter input, using its role as a wxEvtHandler - to intercept e.g. OnChar. - - Note that wxValidator and derived classes use reference counting. -*/ - -class WXDLLEXPORT wxValidator : public wxEvtHandler -{ -public: - wxValidator(); - virtual ~wxValidator(); - - // Make a clone of this validator (or return NULL) - currently necessary - // if you're passing a reference to a validator. - // Another possibility is to always pass a pointer to a new validator - // (so the calling code can use a copy constructor of the relevant class). - virtual wxObject *Clone() const - { return (wxValidator *)NULL; } - bool Copy(const wxValidator& val) - { m_validatorWindow = val.m_validatorWindow; return true; } - - // Called when the value in the window must be validated. - // This function can pop up an error message. - virtual bool Validate(wxWindow *WXUNUSED(parent)) { return false; } - - // Called to transfer data to the window - virtual bool TransferToWindow() { return false; } - - // Called to transfer data from the window - virtual bool TransferFromWindow() { return false; } - - // accessors - wxWindow *GetWindow() const { return (wxWindow *)m_validatorWindow; } - void SetWindow(wxWindowBase *win) { m_validatorWindow = win; } - - // validators beep by default if invalid key is pressed, these functions - // allow to change it - static bool IsSilent() { return ms_isSilent; } - static void SetBellOnError(bool doIt = true) { ms_isSilent = doIt; } - -protected: - wxWindowBase *m_validatorWindow; - -private: - static bool ms_isSilent; - - DECLARE_DYNAMIC_CLASS(wxValidator) - DECLARE_NO_COPY_CLASS(wxValidator) -}; - -extern WXDLLEXPORT_DATA(const wxValidator) wxDefaultValidator; - -#define wxVALIDATOR_PARAM(val) val - -#else // !wxUSE_VALIDATORS - // wxWidgets is compiled without support for wxValidator, but we still - // want to be able to pass wxDefaultValidator to the functions which take - // a wxValidator parameter to avoid using "#if wxUSE_VALIDATORS" - // everywhere - class WXDLLEXPORT wxValidator; - #define wxDefaultValidator (*((wxValidator *)NULL)) - - // this macro allows to avoid warnings about unused parameters when - // wxUSE_VALIDATORS == 0 - #define wxVALIDATOR_PARAM(val) -#endif // wxUSE_VALIDATORS/!wxUSE_VALIDATORS - -#endif // _WX_VALIDATE_H_ - diff --git a/wxWidgets/include/wx/valtext.h b/wxWidgets/include/wx/valtext.h deleted file mode 100644 index f86ae5e66f..0000000000 --- a/wxWidgets/include/wx/valtext.h +++ /dev/null @@ -1,122 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: valtext.h -// Purpose: wxTextValidator class -// Author: Julian Smart -// Modified by: -// Created: 29/01/98 -// RCS-ID: $Id: valtext.h 61872 2009-09-09 22:37:05Z VZ $ -// Copyright: (c) 1998 Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_VALTEXTH__ -#define _WX_VALTEXTH__ - -#include "wx/defs.h" - -#if wxUSE_VALIDATORS && wxUSE_TEXTCTRL - -#include "wx/textctrl.h" -#include "wx/validate.h" - -#define wxFILTER_NONE 0x0000 -#define wxFILTER_ASCII 0x0001 -#define wxFILTER_ALPHA 0x0002 -#define wxFILTER_ALPHANUMERIC 0x0004 -#define wxFILTER_NUMERIC 0x0008 -#define wxFILTER_INCLUDE_LIST 0x0010 -#define wxFILTER_EXCLUDE_LIST 0x0020 -#define wxFILTER_INCLUDE_CHAR_LIST 0x0040 -#define wxFILTER_EXCLUDE_CHAR_LIST 0x0080 - -class WXDLLEXPORT wxTextValidator: public wxValidator -{ -DECLARE_DYNAMIC_CLASS(wxTextValidator) -public: - - wxTextValidator(long style = wxFILTER_NONE, wxString *val = 0); - wxTextValidator(const wxTextValidator& val); - - virtual ~wxTextValidator(){} - - // Make a clone of this validator (or return NULL) - currently necessary - // if you're passing a reference to a validator. - // Another possibility is to always pass a pointer to a new validator - // (so the calling code can use a copy constructor of the relevant class). - virtual wxObject *Clone() const { return new wxTextValidator(*this); } - bool Copy(const wxTextValidator& val); - - // Called when the value in the window must be validated. - // This function can pop up an error message. - virtual bool Validate(wxWindow *parent); - - // Called to transfer data to the window - virtual bool TransferToWindow(); - - // Called to transfer data from the window - virtual bool TransferFromWindow(); - - // ACCESSORS - inline long GetStyle() const { return m_validatorStyle; } - inline void SetStyle(long style) { m_validatorStyle = style; } - -#if WXWIN_COMPATIBILITY_2_4 - wxDEPRECATED( void SetIncludeList(const wxStringList& list) ); - wxDEPRECATED( wxStringList& GetIncludeList() ); - - wxDEPRECATED( void SetExcludeList(const wxStringList& list) ); - wxDEPRECATED( wxStringList& GetExcludeList() ); - - wxDEPRECATED( bool IsInCharIncludeList(const wxString& val) ); - wxDEPRECATED( bool IsNotInCharExcludeList(const wxString& val) ); -#endif - - void SetIncludes(const wxArrayString& includes) { m_includes = includes; } - inline wxArrayString& GetIncludes() { return m_includes; } - - void SetExcludes(const wxArrayString& excludes) { m_excludes = excludes; } - inline wxArrayString& GetExcludes() { return m_excludes; } - - bool IsInCharIncludes(const wxString& val); - bool IsNotInCharExcludes(const wxString& val); - - // Filter keystrokes - void OnChar(wxKeyEvent& event); - - -DECLARE_EVENT_TABLE() - -protected: - long m_validatorStyle; - wxString * m_stringValue; -#if WXWIN_COMPATIBILITY_2_4 - wxStringList m_includeList; - wxStringList m_excludeList; -#endif - wxArrayString m_includes; - wxArrayString m_excludes; - - bool CheckValidator() const - { - wxCHECK_MSG( m_validatorWindow, false, - wxT("No window associated with validator") ); - wxCHECK_MSG( m_validatorWindow->IsKindOf(CLASSINFO(wxTextCtrl)), false, - wxT("wxTextValidator is only for wxTextCtrl's") ); - - return true; - } - -private: -// Cannot use -// DECLARE_NO_COPY_CLASS(wxTextValidator) -// because copy constructor is explicitly declared above; -// but no copy assignment operator is defined, so declare -// it private to prevent the compiler from defining it: - wxTextValidator& operator=(const wxTextValidator&); -}; - -#endif - // wxUSE_VALIDATORS && wxUSE_TEXTCTRL - -#endif - // _WX_VALTEXTH__ diff --git a/wxWidgets/include/wx/variant.h b/wxWidgets/include/wx/variant.h deleted file mode 100644 index 2429150916..0000000000 --- a/wxWidgets/include/wx/variant.h +++ /dev/null @@ -1,423 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/variant.h -// Purpose: wxVariant class, container for any type -// Author: Julian Smart -// Modified by: -// Created: 10/09/98 -// RCS-ID: $Id: variant.h 42997 2006-11-03 21:37:08Z VZ $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_VARIANT_H_ -#define _WX_VARIANT_H_ - -#include "wx/defs.h" - -#if wxUSE_VARIANT - -#include "wx/object.h" -#include "wx/string.h" -#include "wx/arrstr.h" -#include "wx/list.h" -#include "wx/cpp.h" - -#if wxUSE_DATETIME - #include "wx/datetime.h" -#endif // wxUSE_DATETIME - -#if wxUSE_ODBC - #include "wx/db.h" // will #include sqltypes.h -#endif //ODBC - -#include "wx/iosfwrap.h" - -/* - * wxVariantData stores the actual data in a wxVariant object, - * to allow it to store any type of data. - * Derive from this to provide custom data handling. - * - * NB: To prevent addition of extra vtbl pointer to wxVariantData, - * we don't multiple-inherit from wxObjectRefData. Instead, - * we simply replicate the wxObject ref-counting scheme. - * - * NB: When you construct a wxVariantData, it will have refcount - * of one. Refcount will not be further increased when - * it is passed to wxVariant. This simulates old common - * scenario where wxVariant took ownership of wxVariantData - * passed to it. - * If you create wxVariantData for other reasons than passing - * it to wxVariant, technically you are not required to call - * DecRef() before deleting it. - * - * TODO: in order to replace wxPropertyValue, we would need - * to consider adding constructors that take pointers to C++ variables, - * or removing that functionality from the wxProperty library. - * Essentially wxPropertyValue takes on some of the wxValidator functionality - * by storing pointers and not just actual values, allowing update of C++ data - * to be handled automatically. Perhaps there's another way of doing this without - * overloading wxVariant with unnecessary functionality. - */ - -class WXDLLIMPEXP_BASE wxVariantData: public wxObject -{ - friend class wxVariant; -public: - wxVariantData() - : wxObject(), m_count(1) - { } - - // Override these to provide common functionality - virtual bool Eq(wxVariantData& data) const = 0; - -#if wxUSE_STD_IOSTREAM - virtual bool Write(wxSTD ostream& WXUNUSED(str)) const { return false; } -#endif - virtual bool Write(wxString& WXUNUSED(str)) const { return false; } -#if wxUSE_STD_IOSTREAM - virtual bool Read(wxSTD istream& WXUNUSED(str)) { return false; } -#endif - virtual bool Read(wxString& WXUNUSED(str)) { return false; } - // What type is it? Return a string name. - virtual wxString GetType() const = 0; - // If it based on wxObject return the ClassInfo. - virtual wxClassInfo* GetValueClassInfo() { return NULL; } - - void IncRef() { m_count++; } - void DecRef() - { - if ( --m_count == 0 ) - delete this; - } - - int GetRefCount() const { return m_count; } - -protected: - // Protected dtor should make some incompatible code - // break more louder. That is, they should do data->DecRef() - // instead of delete data. - virtual ~wxVariantData() { } - -private: - int m_count; - -private: - DECLARE_ABSTRACT_CLASS(wxVariantData) -}; - -/* - * wxVariant can store any kind of data, but has some basic types - * built in. - */ - -class WXDLLIMPEXP_BASE wxVariant: public wxObject -{ -public: - wxVariant(); - - wxVariant(const wxVariant& variant); - wxVariant(wxVariantData* data, const wxString& name = wxEmptyString); - virtual ~wxVariant(); - - // generic assignment - void operator= (const wxVariant& variant); - - // Assignment using data, e.g. - // myVariant = new wxStringVariantData("hello"); - void operator= (wxVariantData* variantData); - - bool operator== (const wxVariant& variant) const; - bool operator!= (const wxVariant& variant) const; - - // Sets/gets name - inline void SetName(const wxString& name) { m_name = name; } - inline const wxString& GetName() const { return m_name; } - - // Tests whether there is data - bool IsNull() const; - - // For compatibility with wxWidgets <= 2.6, this doesn't increase - // reference count. - wxVariantData* GetData() const { return m_data; } - void SetData(wxVariantData* data) ; - - // make a 'clone' of the object - void Ref(const wxVariant& clone); - - // destroy a reference - void UnRef(); - - // Make NULL (i.e. delete the data) - void MakeNull(); - - // Delete data and name - void Clear(); - - // Returns a string representing the type of the variant, - // e.g. "string", "bool", "stringlist", "list", "double", "long" - wxString GetType() const; - - bool IsType(const wxString& type) const; - bool IsValueKindOf(const wxClassInfo* type) const; - - // write contents to a string (e.g. for debugging) - wxString MakeString() const; - - // double - wxVariant(double val, const wxString& name = wxEmptyString); - bool operator== (double value) const; - bool operator!= (double value) const; - void operator= (double value) ; - inline operator double () const { return GetDouble(); } - inline double GetReal() const { return GetDouble(); } - double GetDouble() const; - - // long - wxVariant(long val, const wxString& name = wxEmptyString); - wxVariant(int val, const wxString& name = wxEmptyString); - wxVariant(short val, const wxString& name = wxEmptyString); - bool operator== (long value) const; - bool operator!= (long value) const; - void operator= (long value) ; - inline operator long () const { return GetLong(); } - inline long GetInteger() const { return GetLong(); } - long GetLong() const; - - // bool -#ifdef HAVE_BOOL - wxVariant(bool val, const wxString& name = wxEmptyString); - bool operator== (bool value) const; - bool operator!= (bool value) const; - void operator= (bool value) ; - inline operator bool () const { return GetBool(); } - bool GetBool() const ; -#endif - - // wxDateTime -#if wxUSE_DATETIME - wxVariant(const wxDateTime& val, const wxString& name = wxEmptyString); -#if wxUSE_ODBC - wxVariant(const DATE_STRUCT* valptr, const wxString& name = wxEmptyString); - wxVariant(const TIME_STRUCT* valptr, const wxString& name = wxEmptyString); - wxVariant(const TIMESTAMP_STRUCT* valptr, const wxString& name = wxEmptyString); -#endif - bool operator== (const wxDateTime& value) const; - bool operator!= (const wxDateTime& value) const; - void operator= (const wxDateTime& value) ; -#if wxUSE_ODBC - void operator= (const DATE_STRUCT* value) ; - void operator= (const TIME_STRUCT* value) ; - void operator= (const TIMESTAMP_STRUCT* value) ; -#endif - inline operator wxDateTime () const { return GetDateTime(); } - wxDateTime GetDateTime() const; -#endif - - // wxString - wxVariant(const wxString& val, const wxString& name = wxEmptyString); - wxVariant(const wxChar* val, const wxString& name = wxEmptyString); // Necessary or VC++ assumes bool! - bool operator== (const wxString& value) const; - bool operator!= (const wxString& value) const; - void operator= (const wxString& value) ; - void operator= (const wxChar* value) ; // Necessary or VC++ assumes bool! - inline operator wxString () const { return MakeString(); } - wxString GetString() const; - - // wxChar - wxVariant(wxChar val, const wxString& name = wxEmptyString); - bool operator== (wxChar value) const; - bool operator!= (wxChar value) const; - void operator= (wxChar value) ; - inline operator wxChar () const { return GetChar(); } - wxChar GetChar() const ; - - // wxArrayString - wxVariant(const wxArrayString& val, const wxString& name = wxEmptyString); - bool operator== (const wxArrayString& value) const; - bool operator!= (const wxArrayString& value) const; - void operator= (const wxArrayString& value); - inline operator wxArrayString () const { return GetArrayString(); } - wxArrayString GetArrayString() const; - - // void* - wxVariant(void* ptr, const wxString& name = wxEmptyString); - bool operator== (void* value) const; - bool operator!= (void* value) const; - void operator= (void* value); - inline operator void* () const { return GetVoidPtr(); } - void* GetVoidPtr() const; - - // wxObject* - wxVariant(wxObject* ptr, const wxString& name = wxEmptyString); - bool operator== (wxObject* value) const; - bool operator!= (wxObject* value) const; - void operator= (wxObject* value); - wxObject* GetWxObjectPtr() const; - - -#if WXWIN_COMPATIBILITY_2_4 - wxDEPRECATED( wxVariant(const wxStringList& val, const wxString& name = wxEmptyString) ); - wxDEPRECATED( bool operator== (const wxStringList& value) const ); - wxDEPRECATED( bool operator!= (const wxStringList& value) const ); - wxDEPRECATED( void operator= (const wxStringList& value) ); - wxDEPRECATED( wxStringList& GetStringList() const ); -#endif - - // ------------------------------ - // list operations - // ------------------------------ - - wxVariant(const wxList& val, const wxString& name = wxEmptyString); // List of variants - bool operator== (const wxList& value) const; - bool operator!= (const wxList& value) const; - void operator= (const wxList& value) ; - // Treat a list variant as an array - wxVariant operator[] (size_t idx) const; - wxVariant& operator[] (size_t idx) ; - wxList& GetList() const ; - - // Return the number of elements in a list - size_t GetCount() const; - - // Make empty list - void NullList(); - - // Append to list - void Append(const wxVariant& value); - - // Insert at front of list - void Insert(const wxVariant& value); - - // Returns true if the variant is a member of the list - bool Member(const wxVariant& value) const; - - // Deletes the nth element of the list - bool Delete(size_t item); - - // Clear list - void ClearList(); - -public: - // Type conversion - bool Convert(long* value) const; - bool Convert(bool* value) const; - bool Convert(double* value) const; - bool Convert(wxString* value) const; - bool Convert(wxChar* value) const; -#if wxUSE_DATETIME - bool Convert(wxDateTime* value) const; -#endif // wxUSE_DATETIME - -// Attributes -protected: - wxVariantData* m_data; - wxString m_name; - -private: - DECLARE_DYNAMIC_CLASS(wxVariant) -}; - -#define DECLARE_VARIANT_OBJECT(classname) \ - DECLARE_VARIANT_OBJECT_EXPORTED(classname, wxEMPTY_PARAMETER_VALUE) - -#define DECLARE_VARIANT_OBJECT_EXPORTED(classname,expdecl) \ -expdecl classname& operator << ( classname &object, const wxVariant &variant ); \ -expdecl wxVariant& operator << ( wxVariant &variant, const classname &object ); - -#define IMPLEMENT_VARIANT_OBJECT(classname) \ - IMPLEMENT_VARIANT_OBJECT_EXPORTED(classname, wxEMPTY_PARAMETER_VALUE) - -#define IMPLEMENT_VARIANT_OBJECT_EXPORTED_NO_EQ(classname,expdecl) \ -class classname##VariantData: public wxVariantData \ -{ \ -public:\ - classname##VariantData() {} \ - classname##VariantData( const classname &value ) { m_value = value; } \ -\ - classname &GetValue() { return m_value; } \ -\ - virtual bool Eq(wxVariantData& data) const; \ -\ - virtual wxString GetType() const; \ - virtual wxClassInfo* GetValueClassInfo(); \ -\ -protected:\ - classname m_value; \ -\ -private: \ - DECLARE_CLASS(classname##VariantData) \ -};\ -\ -IMPLEMENT_CLASS(classname##VariantData, wxVariantData)\ -\ -wxString classname##VariantData::GetType() const\ -{\ - return m_value.GetClassInfo()->GetClassName();\ -}\ -\ -wxClassInfo* classname##VariantData::GetValueClassInfo()\ -{\ - return m_value.GetClassInfo();\ -}\ -\ -expdecl classname& operator << ( classname &value, const wxVariant &variant )\ -{\ - wxASSERT( wxIsKindOf( variant.GetData(), classname##VariantData ) );\ - \ - classname##VariantData *data = (classname##VariantData*) variant.GetData();\ - value = data->GetValue();\ - return value;\ -}\ -\ -expdecl wxVariant& operator << ( wxVariant &variant, const classname &value )\ -{\ - classname##VariantData *data = new classname##VariantData( value );\ - variant.SetData( data );\ - return variant;\ -} - -// implements a wxVariantData-derived class using for the Eq() method the -// operator== which must have been provided by "classname" -#define IMPLEMENT_VARIANT_OBJECT_EXPORTED(classname,expdecl) \ -IMPLEMENT_VARIANT_OBJECT_EXPORTED_NO_EQ(classname,wxEMPTY_PARAMETER_VALUE expdecl) \ -\ -bool classname##VariantData::Eq(wxVariantData& data) const \ -{\ - wxASSERT( wxIsKindOf((&data), classname##VariantData) );\ -\ - classname##VariantData & otherData = (classname##VariantData &) data;\ -\ - return otherData.m_value == m_value;\ -}\ - - -// implements a wxVariantData-derived class using for the Eq() method a shallow -// comparison (through wxObject::IsSameAs function) -#define IMPLEMENT_VARIANT_OBJECT_SHALLOWCMP(classname) \ - IMPLEMENT_VARIANT_OBJECT_EXPORTED_SHALLOWCMP(classname, wxEMPTY_PARAMETER_VALUE) -#define IMPLEMENT_VARIANT_OBJECT_EXPORTED_SHALLOWCMP(classname,expdecl) \ -IMPLEMENT_VARIANT_OBJECT_EXPORTED_NO_EQ(classname,wxEMPTY_PARAMETER_VALUE expdecl) \ -\ -bool classname##VariantData::Eq(wxVariantData& data) const \ -{\ - wxASSERT( wxIsKindOf((&data), classname##VariantData) );\ -\ - classname##VariantData & otherData = (classname##VariantData &) data;\ -\ - return (otherData.m_value.IsSameAs(m_value));\ -}\ - - -// Since we want type safety wxVariant we need to fetch and dynamic_cast -// in a seemingly safe way so the compiler can check, so we define -// a dynamic_cast /wxDynamicCast analogue. - -#define wxGetVariantCast(var,classname) \ - ((classname*)(var.IsValueKindOf(&classname::ms_classInfo) ?\ - var.GetWxObjectPtr() : NULL)); - -extern wxVariant WXDLLIMPEXP_BASE wxNullVariant; - -#endif // wxUSE_VARIANT - -#endif // _WX_VARIANT_H_ diff --git a/wxWidgets/include/wx/vector.h b/wxWidgets/include/wx/vector.h deleted file mode 100644 index c724186490..0000000000 --- a/wxWidgets/include/wx/vector.h +++ /dev/null @@ -1,212 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: wx/vector.h -// Purpose: STL vector clone -// Author: Lindsay Mathieson -// Modified by: -// Created: 30.07.2001 -// Copyright: (c) 2001 Lindsay Mathieson <lindsay@mathieson.org> -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_VECTOR_H_ -#define _WX_VECTOR_H_ - -#include "wx/defs.h" - -class WXDLLIMPEXP_BASE wxVectorBase -{ -public: - typedef size_t size_type; -private: - size_type m_allocsize; - size_type m_size, - m_capacity; - void **m_objects; - -protected: - bool Alloc(size_type sz) - { - // work in multiples of m_allocsize; - sz = (sz / m_allocsize + 1) * m_allocsize; - if (sz <= m_capacity) - return true; - - // try to realloc - void *mem = realloc(m_objects, sizeof(void *) * sz); - if (! mem) - return false; // failed - // success - m_objects = (void **) mem; - m_capacity = sz; - return true; - } - - // untyped destructor of elements - must be overriden - virtual void Free(void *) = 0; - // untyped copy constructor of elements - must be overriden - virtual void *Copy(const void *) const = 0; - - const void *GetItem(size_type idx) const - { - wxASSERT(idx < m_size); - return m_objects[idx]; - } - - void Append(void *obj) - { - wxASSERT(m_size < m_capacity); - m_objects[m_size] = obj; - m_size++; - } - - void RemoveAt(size_type idx) - { - wxASSERT(idx < m_size); - Free(m_objects[idx]); - if (idx < m_size - 1) - memcpy( - m_objects + idx, - m_objects + idx + 1, - ( m_size - idx - 1 ) * sizeof(void*) ); - m_size--; - } - - bool copy(const wxVectorBase& vb) - { - clear(); - if (! Alloc(vb.size())) - return false; - - for (size_type i = 0; i < vb.size(); i++) - { - void *o = vb.Copy(vb.GetItem(i)); - if (! o) - return false; - Append(o); - } - - return true; - } - -public: - wxVectorBase() : m_allocsize(16), m_size(0), m_capacity(0), m_objects(0) {} - virtual ~wxVectorBase() {} // calm down GCC - - void clear() - { - for (size_type i = 0; i < size(); i++) - Free(m_objects[i]); - free(m_objects); - m_objects = 0; - m_size = m_capacity = 0; - } - - void reserve(size_type n) - { - if ( !Alloc(n) ) - { - wxFAIL_MSG( wxT("out of memory in wxVector::reserve()") ); - } - } - - size_type size() const - { - return m_size; - } - - size_type capacity() const - { - return m_capacity; - } - - bool empty() const - { - return size() == 0; - } - - wxVectorBase& operator = (const wxVectorBase& vb) - { - wxCHECK(copy(vb), *this); - return *this; - } -}; - -#define WX_DECLARE_VECTORBASE(obj, cls)\ -protected:\ - virtual void Free(void *o)\ - {\ - delete (obj *) o;\ - }\ - virtual void *Copy(const void *o) const\ - {\ - return new obj(*(obj *) o);\ - }\ -public:\ - cls() {}\ - cls(const cls& c) : wxVectorBase()\ - {\ - wxCHECK2(copy(c), return);\ - }\ - ~cls()\ - {\ - clear();\ - } - -#define _WX_DECLARE_VECTOR(obj, cls, exp)\ -class exp cls : public wxVectorBase\ -{\ - WX_DECLARE_VECTORBASE(obj, cls)\ -public:\ - void push_back(const obj& o)\ - {\ - wxCHECK2(Alloc(size() + 1), return);\ - Append(new obj(o));\ - }\ - void pop_back()\ - {\ - RemoveAt(size() - 1);\ - }\ - const obj& at(size_type idx) const\ - {\ - return *(obj *) GetItem(idx);\ - }\ - obj& at(size_type idx)\ - {\ - return *(obj *) GetItem(idx);\ - }\ - const obj& operator[](size_type idx) const\ - {\ - return at(idx);\ - }\ - obj& operator[](size_type idx)\ - {\ - return at(idx);\ - }\ - const obj& front() const\ - {\ - return at(0);\ - }\ - obj& front()\ - {\ - return at(0);\ - }\ - const obj& back() const\ - {\ - return at(size() - 1);\ - }\ - obj& back()\ - {\ - return at(size() - 1);\ - }\ - size_type erase(size_type idx)\ - {\ - RemoveAt(idx);\ - return idx;\ - }\ -} - -#define WX_DECLARE_VECTOR(obj, cls) \ - _WX_DECLARE_VECTOR(obj, cls, WXDLLEXPORT) - -#endif // _WX_VECTOR_H_ - diff --git a/wxWidgets/include/wx/version.h b/wxWidgets/include/wx/version.h deleted file mode 100644 index 7e14278a9b..0000000000 --- a/wxWidgets/include/wx/version.h +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Name: wx/version.h - * Purpose: wxWidgets version numbers - * Author: Julian Smart - * Modified by: Ryan Norton (Converted to C) - * Created: 29/01/98 - * RCS-ID: $Id: version.h 66910 2011-02-16 20:53:53Z JS $ - * Copyright: (c) 1998 Julian Smart - * Licence: wxWindows licence - */ - -/* THIS IS A C FILE, DON'T USE C++ FEATURES (IN PARTICULAR COMMENTS) IN IT */ - -#ifndef _WX_VERSION_H_ -#define _WX_VERSION_H_ - -#include "wx/cpp.h" /* for wxSTRINGIZE */ - -/* the constants below must be changed with each new version */ -/* ---------------------------------------------------------------------------- */ - -/* - Don't forget to update WX_CURRENT, WX_REVISION and WX_AGE in - build/bakefiles/version.bkl and regenerate the makefiles when you change - this! - */ - -/* NB: this file is parsed by automatic tools so don't change its format! */ -#define wxMAJOR_VERSION 2 -#define wxMINOR_VERSION 8 -#define wxRELEASE_NUMBER 12 -#define wxSUBRELEASE_NUMBER 0 -#define wxVERSION_STRING wxT("wxWidgets 2.8.12") - -/* nothing to update below this line when updating the version */ -/* ---------------------------------------------------------------------------- */ - -/* Users can pre-define wxABI_VERSION to a lower value in their - * makefile/project settings to compile code that will be binary compatible - * with earlier versions of the ABI within the same minor version (between - * minor versions binary compatibility breaks anyway). The default is the - * version of wxWidgets being used. A single number with two decimal digits - * for each component, e.g. 20601 for 2.6.1 */ -#ifndef wxABI_VERSION -#define wxABI_VERSION ( wxMAJOR_VERSION * 10000 + wxMINOR_VERSION * 100 + 99 ) -#endif - -/* helpers for wxVERSION_NUM_XXX */ -#define wxMAKE_VERSION_STRING(x, y, z) \ - wxSTRINGIZE(x) wxSTRINGIZE(y) wxSTRINGIZE(z) -#define wxMAKE_VERSION_DOT_STRING(x, y, z) \ - wxSTRINGIZE(x) "." wxSTRINGIZE(y) "." wxSTRINGIZE(z) - -#define wxMAKE_VERSION_STRING_T(x, y, z) \ - wxSTRINGIZE_T(x) wxSTRINGIZE_T(y) wxSTRINGIZE_T(z) -#define wxMAKE_VERSION_DOT_STRING_T(x, y, z) \ - wxSTRINGIZE_T(x) wxT(".") wxSTRINGIZE_T(y) wxT(".") wxSTRINGIZE_T(z) - -/* these are used by src/msw/version.rc and should always be ASCII, not Unicode */ -#define wxVERSION_NUM_STRING \ - wxMAKE_VERSION_STRING(wxMAJOR_VERSION, wxMINOR_VERSION, wxRELEASE_NUMBER) -#define wxVERSION_NUM_DOT_STRING \ - wxMAKE_VERSION_DOT_STRING(wxMAJOR_VERSION, wxMINOR_VERSION, wxRELEASE_NUMBER) - -/* those are Unicode-friendly */ -#define wxVERSION_NUM_STRING_T \ - wxMAKE_VERSION_STRING_T(wxMAJOR_VERSION, wxMINOR_VERSION, wxRELEASE_NUMBER) -#define wxVERSION_NUM_DOT_STRING_T \ - wxMAKE_VERSION_DOT_STRING_T(wxMAJOR_VERSION, wxMINOR_VERSION, wxRELEASE_NUMBER) - -/* some more defines, not really sure if they're [still] useful */ -#define wxVERSION_NUMBER ( (wxMAJOR_VERSION * 1000) + (wxMINOR_VERSION * 100) + wxRELEASE_NUMBER ) -#define wxBETA_NUMBER 0 -#define wxVERSION_FLOAT ( wxMAJOR_VERSION + (wxMINOR_VERSION/10.0) + (wxRELEASE_NUMBER/100.0) + (wxBETA_NUMBER/10000.0) ) - -/* check if the current version is at least major.minor.release */ -#define wxCHECK_VERSION(major,minor,release) \ - (wxMAJOR_VERSION > (major) || \ - (wxMAJOR_VERSION == (major) && wxMINOR_VERSION > (minor)) || \ - (wxMAJOR_VERSION == (major) && wxMINOR_VERSION == (minor) && wxRELEASE_NUMBER >= (release))) - -/* the same but check the subrelease also */ -#define wxCHECK_VERSION_FULL(major,minor,release,subrel) \ - (wxCHECK_VERSION(major, minor, release) && \ - ((major) != wxMAJOR_VERSION || \ - (minor) != wxMINOR_VERSION || \ - (release) != wxRELEASE_NUMBER || \ - (subrel) <= wxSUBRELEASE_NUMBER)) - -#endif /* _WX_VERSION_H_ */ - diff --git a/wxWidgets/include/wx/vidmode.h b/wxWidgets/include/wx/vidmode.h deleted file mode 100644 index 06e7ed4cfb..0000000000 --- a/wxWidgets/include/wx/vidmode.h +++ /dev/null @@ -1,73 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: wx/vidmode.h -// Purpose: declares wxVideoMode class used by both wxDisplay and wxApp -// Author: Vadim Zeitlin -// Modified by: -// Created: 27.09.2003 (extracted from wx/display.h) -// RCS-ID: $Id: vidmode.h 27408 2004-05-23 20:53:33Z JS $ -// Copyright: (c) 2003 Vadim Zeitlin <vadim@wxwidgets.org> -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_VMODE_H_ -#define _WX_VMODE_H_ - -// ---------------------------------------------------------------------------- -// wxVideoMode: a simple struct containing video mode parameters for a display -// ---------------------------------------------------------------------------- - -struct WXDLLEXPORT wxVideoMode -{ - wxVideoMode(int width = 0, int height = 0, int depth = 0, int freq = 0) - { - w = width; - h = height; - - bpp = depth; - - refresh = freq; - } - - // default copy ctor and assignment operator are ok - - bool operator==(const wxVideoMode& m) const - { - return w == m.w && h == m.h && bpp == m.bpp && refresh == m.refresh; - } - bool operator!=(const wxVideoMode& mode) const - { - return !operator==(mode); - } - - // returns true if this mode matches the other one in the sense that all - // non zero fields of the other mode have the same value in this one - // (except for refresh which is allowed to have a greater value) - bool Matches(const wxVideoMode& other) const - { - return (!other.w || w == other.w) && - (!other.h || h == other.h) && - (!other.bpp || bpp == other.bpp) && - (!other.refresh || refresh >= other.refresh); - } - - // trivial accessors - int GetWidth() const { return w; } - int GetHeight() const { return h; } - int GetDepth() const { return bpp; } - - // returns true if the object has been initialized - bool IsOk() const { return w && h; } - - - // the screen size in pixels (e.g. 640*480), 0 means unspecified - int w, h; - - // bits per pixel (e.g. 32), 1 is monochrome and 0 means unspecified/known - int bpp; - - // refresh frequency in Hz, 0 means unspecified/unknown - int refresh; -}; - -#endif // _WX_VMODE_H_ - diff --git a/wxWidgets/include/wx/vlbox.h b/wxWidgets/include/wx/vlbox.h deleted file mode 100644 index b1324e4806..0000000000 --- a/wxWidgets/include/wx/vlbox.h +++ /dev/null @@ -1,296 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: wx/vlbox.h -// Purpose: wxVListBox is a virtual listbox with lines of variable height -// Author: Vadim Zeitlin -// Modified by: -// Created: 31.05.03 -// RCS-ID: $Id: vlbox.h 61872 2009-09-09 22:37:05Z VZ $ -// Copyright: (c) 2003 Vadim Zeitlin <vadim@wxwidgets.org> -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_VLBOX_H_ -#define _WX_VLBOX_H_ - -#include "wx/vscroll.h" // base class -#include "wx/bitmap.h" - -class WXDLLIMPEXP_FWD_CORE wxSelectionStore; - -#define wxVListBoxNameStr wxT("wxVListBox") - -// ---------------------------------------------------------------------------- -// wxVListBox -// ---------------------------------------------------------------------------- - -/* - This class has two main differences from a regular listbox: it can have an - arbitrarily huge number of items because it doesn't store them itself but - uses OnDrawItem() callback to draw them and its items can have variable - height as determined by OnMeasureItem(). - - It emits the same events as wxListBox and the same event macros may be used - with it. - */ -class WXDLLEXPORT wxVListBox : public wxVScrolledWindow -{ -public: - // constructors and such - // --------------------- - - // default constructor, you must call Create() later - wxVListBox() { Init(); } - - // normal constructor which calls Create() internally - wxVListBox(wxWindow *parent, - wxWindowID id = wxID_ANY, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = 0, - const wxString& name = wxVListBoxNameStr) - { - Init(); - - (void)Create(parent, id, pos, size, style, name); - } - - // really creates the control and sets the initial number of items in it - // (which may be changed later with SetItemCount()) - // - // the only special style which may be specified here is wxLB_MULTIPLE - // - // returns true on success or false if the control couldn't be created - bool Create(wxWindow *parent, - wxWindowID id = wxID_ANY, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = 0, - const wxString& name = wxVListBoxNameStr); - - // dtor does some internal cleanup (deletes m_selStore if any) - virtual ~wxVListBox(); - - - // accessors - // --------- - - // get the number of items in the control - size_t GetItemCount() const { return GetLineCount(); } - - // does this control use multiple selection? - bool HasMultipleSelection() const { return m_selStore != NULL; } - - // get the currently selected item or wxNOT_FOUND if there is no selection - // - // this method is only valid for the single selection listboxes - int GetSelection() const - { - wxASSERT_MSG( !HasMultipleSelection(), - wxT("GetSelection() can't be used with wxLB_MULTIPLE") ); - - return m_current; - } - - // is this item the current one? - bool IsCurrent(size_t item) const { return item == (size_t)m_current; } - #ifdef __WXUNIVERSAL__ - bool IsCurrent() const { return wxVScrolledWindow::IsCurrent(); } - #endif - - // is this item selected? - bool IsSelected(size_t item) const; - - // get the number of the selected items (maybe 0) - // - // this method is valid for both single and multi selection listboxes - size_t GetSelectedCount() const; - - // get the first selected item, returns wxNOT_FOUND if none - // - // cookie is an opaque parameter which should be passed to - // GetNextSelected() later - // - // this method is only valid for the multi selection listboxes - int GetFirstSelected(unsigned long& cookie) const; - - // get next selection item, return wxNOT_FOUND if no more - // - // cookie must be the same parameter that was passed to GetFirstSelected() - // before - // - // this method is only valid for the multi selection listboxes - int GetNextSelected(unsigned long& cookie) const; - - // get the margins around each item - wxPoint GetMargins() const { return m_ptMargins; } - - // get the background colour of selected cells - const wxColour& GetSelectionBackground() const { return m_colBgSel; } - - - // operations - // ---------- - - // set the number of items to be shown in the control - // - // this is just a synonym for wxVScrolledWindow::SetLineCount() - virtual void SetItemCount(size_t count); - - // delete all items from the control - void Clear() { SetItemCount(0); } - - // set the selection to the specified item, if it is wxNOT_FOUND the - // selection is unset - // - // this function is only valid for the single selection listboxes - void SetSelection(int selection); - - // selects or deselects the specified item which must be valid (i.e. not - // equal to wxNOT_FOUND) - // - // return true if the items selection status has changed or false - // otherwise - // - // this function is only valid for the multiple selection listboxes - bool Select(size_t item, bool select = true); - - // selects the items in the specified range whose end points may be given - // in any order - // - // return true if any items selection status has changed, false otherwise - // - // this function is only valid for the single selection listboxes - bool SelectRange(size_t from, size_t to); - - // toggle the selection of the specified item (must be valid) - // - // this function is only valid for the multiple selection listboxes - void Toggle(size_t item) { Select(item, !IsSelected(item)); } - - // select all items in the listbox - // - // the return code indicates if any items were affected by this operation - // (true) or if nothing has changed (false) - bool SelectAll() { return DoSelectAll(true); } - - // unselect all items in the listbox - // - // the return code has the same meaning as for SelectAll() - bool DeselectAll() { return DoSelectAll(false); } - - // set the margins: horizontal margin is the distance between the window - // border and the item contents while vertical margin is half of the - // distance between items - // - // by default both margins are 0 - void SetMargins(const wxPoint& pt); - void SetMargins(wxCoord x, wxCoord y) { SetMargins(wxPoint(x, y)); } - - // change the background colour of the selected cells - void SetSelectionBackground(const wxColour& col); - - - virtual wxVisualAttributes GetDefaultAttributes() const - { - return GetClassDefaultAttributes(GetWindowVariant()); - } - - static wxVisualAttributes - GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL); - -protected: - // the derived class must implement this function to actually draw the item - // with the given index on the provided DC - virtual void OnDrawItem(wxDC& dc, const wxRect& rect, size_t n) const = 0; - - // the derived class must implement this method to return the height of the - // specified item - virtual wxCoord OnMeasureItem(size_t n) const = 0; - - // this method may be used to draw separators between the lines; note that - // the rectangle may be modified, typically to deflate it a bit before - // passing to OnDrawItem() - // - // the base class version doesn't do anything - virtual void OnDrawSeparator(wxDC& dc, wxRect& rect, size_t n) const; - - // this method is used to draw the items background and, maybe, a border - // around it - // - // the base class version implements a reasonable default behaviour which - // consists in drawing the selected item with the standard background - // colour and drawing a border around the item if it is either selected or - // current - virtual void OnDrawBackground(wxDC& dc, const wxRect& rect, size_t n) const; - - // we implement OnGetLineHeight() in terms of OnMeasureItem() because this - // allows us to add borders to the items easily - // - // this function is not supposed to be overridden by the derived classes - virtual wxCoord OnGetLineHeight(size_t line) const; - - - // event handlers - void OnPaint(wxPaintEvent& event); - void OnKeyDown(wxKeyEvent& event); - void OnLeftDown(wxMouseEvent& event); - void OnLeftDClick(wxMouseEvent& event); - - - // common part of all ctors - void Init(); - - // send the wxEVT_COMMAND_LISTBOX_SELECTED event - void SendSelectedEvent(); - - // common implementation of SelectAll() and DeselectAll() - bool DoSelectAll(bool select); - - // change the current item (in single selection listbox it also implicitly - // changes the selection); current may be wxNOT_FOUND in which case there - // will be no current item any more - // - // return true if the current item changed, false otherwise - bool DoSetCurrent(int current); - - // flags for DoHandleItemClick - enum - { - ItemClick_Shift = 1, // item shift-clicked - ItemClick_Ctrl = 2, // ctrl - ItemClick_Kbd = 4 // item selected from keyboard - }; - - // common part of keyboard and mouse handling processing code - void DoHandleItemClick(int item, int flags); - -private: - // the current item or wxNOT_FOUND - // - // if m_selStore == NULL this is also the selected item, otherwise the - // selections are managed by m_selStore - int m_current; - - // the anchor of the selection for the multiselection listboxes: - // shift-clicking an item extends the selection from m_anchor to the item - // clicked, for example - // - // always wxNOT_FOUND for single selection listboxes - int m_anchor; - - // the object managing our selected items if not NULL - wxSelectionStore *m_selStore; - - // margins - wxPoint m_ptMargins; - - // the selection bg colour - wxColour m_colBgSel; - - DECLARE_EVENT_TABLE() - DECLARE_NO_COPY_CLASS(wxVListBox) - DECLARE_ABSTRACT_CLASS(wxVListBox) -}; - -#endif // _WX_VLBOX_H_ - diff --git a/wxWidgets/include/wx/vms_x_fix.h b/wxWidgets/include/wx/vms_x_fix.h deleted file mode 100644 index 7abe930816..0000000000 --- a/wxWidgets/include/wx/vms_x_fix.h +++ /dev/null @@ -1,1213 +0,0 @@ -/*************************************************************************** - * * - * Author : Jouk Jansen (joukj@hrem.stm.tudelft.nl) * - * * - * Last revision : 7 October 2005 * - * * - * Repair definitions of Runtime library functions when compiling with * - * /name=(as_is) on OpenVMS * - * * - ***************************************************************************/ - -#ifndef VMS_X_FIX -#define VMS_X_FIX - -#define decw$_select DECW$_SELECT -#define DtSaverGetWindows DTSAVERGETWINDOWS -#define MrmFetchWidget MRMFETCHWIDGET -#define MrmInitialize MRMINITIALIZE -#define MrmOpenHierarchy MRMOPENHIERARCHY -#define MrmRegisterNames MRMREGISTERNAMES -#define XAddExtension XADDEXTENSION -#define XAddHosts XADDHOSTS -#define XAllocClassHint XALLOCCLASSHINT -#define XAllocColor XALLOCCOLOR -#define XAllocColorCells XALLOCCOLORCELLS -#define XAllocIconSize XALLOCICONSIZE -#define XAllocNamedColor XALLOCNAMEDCOLOR -#define XAllocSizeHints XALLOCSIZEHINTS -#define XAllocStandardColormap XALLOCSTANDARDCOLORMAP -#define XAllocWMHints XALLOCWMHINTS -#define XAllowEvents XALLOWEVENTS -#define XAutoRepeatOff XAUTOREPEATOFF -#define XAutoRepeatOn XAUTOREPEATON -#define XBaseFontNameListOfFontSet XBASEFONTNAMELISTOFFONTSET -#define XBell XBELL -#define XBitmapPad XBITMAPPAD -#define XBlackPixel XBLACKPIXEL -#define XBlackPixelOfScreen XBLACKPIXELOFSCREEN -#define XCellsOfScreen XCELLSOFSCREEN -#define XChangeActivePointerGrab XCHANGEACTIVEPOINTERGRAB -#define XChangeGC XCHANGEGC -#define XChangeKeyboardControl XCHANGEKEYBOARDCONTROL -#define XChangePointerControl XCHANGEPOINTERCONTROL -#define XChangeProperty XCHANGEPROPERTY -#define XChangeWindowAttributes XCHANGEWINDOWATTRIBUTES -#define XCheckIfEvent XCHECKIFEVENT -#define XCheckMaskEvent XCHECKMASKEVENT -#define XCheckTypedEvent XCHECKTYPEDEVENT -#define XCheckTypedWindowEvent XCHECKTYPEDWINDOWEVENT -#define XCheckWindowEvent XCHECKWINDOWEVENT -#define XClearArea XCLEARAREA -#define XClearWindow XCLEARWINDOW -#define XClipBox XCLIPBOX -#define XCloseDisplay XCLOSEDISPLAY -#define XCloseIM XCLOSEIM -#define XConfigureWindow XCONFIGUREWINDOW -#define XConvertSelection XCONVERTSELECTION -#define XCopyArea XCOPYAREA -#define XCopyColormapAndFree XCOPYCOLORMAPANDFREE -#define XCopyGC XCOPYGC -#define XCopyPlane XCOPYPLANE -#define XCreateBitmapFromData XCREATEBITMAPFROMDATA -#define XCreateColormap XCREATECOLORMAP -#define XCreateFontCursor XCREATEFONTCURSOR -#define XCreateFontSet XCREATEFONTSET -#define XCreateGC XCREATEGC -#define XCreateGlyphCursor XCREATEGLYPHCURSOR -#define XCreateIC XCREATEIC -#define XCreateImage XCREATEIMAGE -#define XCreatePixmap XCREATEPIXMAP -#define XCreatePixmapCursor XCREATEPIXMAPCURSOR -#define XCreatePixmapFromBitmapData XCREATEPIXMAPFROMBITMAPDATA -#define XCreateRegion XCREATEREGION -#define XCreateSimpleWindow XCREATESIMPLEWINDOW -#define XCreateWindow XCREATEWINDOW -#define XDefaultColormap XDEFAULTCOLORMAP -#define XDefaultColormapOfScreen XDEFAULTCOLORMAPOFSCREEN -#define XDefaultDepth XDEFAULTDEPTH -#define XDefaultDepthOfScreen XDEFAULTDEPTHOFSCREEN -#define XDefaultGC XDEFAULTGC -#define XDefaultRootWindow XDEFAULTROOTWINDOW -#define XDefaultScreen XDEFAULTSCREEN -#define XDefaultScreenOfDisplay XDEFAULTSCREENOFDISPLAY -#define XDefaultVisual XDEFAULTVISUAL -#define XDefaultVisualOfScreen XDEFAULTVISUALOFSCREEN -#define XDefineCursor XDEFINECURSOR -#define XDeleteContext XDELETECONTEXT -#define XDeleteProperty XDELETEPROPERTY -#define XDestroyIC XDESTROYIC -#define XDestroyRegion XDESTROYREGION -#define XDestroySubwindows XDESTROYSUBWINDOWS -#define XDestroyWindow XDESTROYWINDOW -#define XDisableAccessControl XDISABLEACCESSCONTROL -#define XDisplayCells XDISPLAYCELLS -#define XDisplayHeight XDISPLAYHEIGHT -#define XDisplayKeycodes XDISPLAYKEYCODES -#define XDisplayName XDISPLAYNAME -#define XDisplayOfIM XDISPLAYOFIM -#define XDisplayOfScreen XDISPLAYOFSCREEN -#define XDisplayString XDISPLAYSTRING -#define XDisplayWidth XDISPLAYWIDTH -#define XDoesBackingStore XDOESBACKINGSTORE -#define XDrawArc XDRAWARC -#define XDrawArcs XDRAWARCS -#define XDrawImageString XDRAWIMAGESTRING -#define XDrawImageString16 XDRAWIMAGESTRING16 -#define XDrawLine XDRAWLINE -#define XDrawLines XDRAWLINES -#define XDrawPoint XDRAWPOINT -#define XDrawPoints XDRAWPOINTS -#define XDrawRectangle XDRAWRECTANGLE -#define XDrawRectangles XDRAWRECTANGLES -#define XDrawSegments XDRAWSEGMENTS -#define XDrawString XDRAWSTRING -#define XDrawString16 XDRAWSTRING16 -#define XDrawText XDRAWTEXT -#define XDrawText16 XDRAWTEXT16 -#define XESetCloseDisplay XESETCLOSEDISPLAY -#define XEmptyRegion XEMPTYREGION -#define XEnableAccessControl XENABLEACCESSCONTROL -#define XEqualRegion XEQUALREGION -#define XEventsQueued XEVENTSQUEUED -#define XExtendedMaxRequestSize XEXTENDEDMAXREQUESTSIZE -#define XExtentsOfFontSet XEXTENTSOFFONTSET -#define XFetchBuffer XFETCHBUFFER -#define XFetchBytes XFETCHBYTES -#define XFetchName XFETCHNAME -#define XFillArc XFILLARC -#define XFillArcs XFILLARCS -#define XFillPolygon XFILLPOLYGON -#define XFillRectangle XFILLRECTANGLE -#define XFillRectangles XFILLRECTANGLES -#define XFilterEvent XFILTEREVENT -#define XFindContext XFINDCONTEXT -#define XFlush XFLUSH -#define XFontsOfFontSet XFONTSOFFONTSET -#define XForceScreenSaver XFORCESCREENSAVER -#define XFree XFREE -#define XFreeColormap XFREECOLORMAP -#define XFreeColors XFREECOLORS -#define XFreeCursor XFREECURSOR -#define XFreeDeviceList XFREEDEVICELIST -#define XFreeDeviceState XFREEDEVICESTATE -#define XFreeFont XFREEFONT -#define XFreeFontInfo XFREEFONTINFO -#define XFreeFontNames XFREEFONTNAMES -#define XFreeFontSet XFREEFONTSET -#define XFreeGC XFREEGC -#define XFreeModifiermap XFREEMODIFIERMAP -#define XFreePixmap XFREEPIXMAP -#define XFreeStringList XFREESTRINGLIST -#define XGContextFromGC XGCONTEXTFROMGC -#define XGeometry XGEOMETRY -#define XGetAtomName XGETATOMNAME -#define XGetCommand XGETCOMMAND -#define XGetDefault XGETDEFAULT -#define XGetErrorDatabaseText XGETERRORDATABASETEXT -#define XGetErrorText XGETERRORTEXT -#define XGetExtensionVersion XGETEXTENSIONVERSION -#define XGetFontProperty XGETFONTPROPERTY -#define XGetGCValues XGETGCVALUES -#define XGetGeometry XGETGEOMETRY -#define XGetICValues XGETICVALUES -#define XGetIMValues XGETIMVALUES -#define XGetIconName XGETICONNAME -#define XGetIconSizes XGETICONSIZES -#define XGetImage XGETIMAGE -#define XGetInputFocus XGETINPUTFOCUS -#define XGetKeyboardControl XGETKEYBOARDCONTROL -#define XGetKeyboardMapping XGETKEYBOARDMAPPING -#define XGetModifierMapping XGETMODIFIERMAPPING -#define XGetMotionEvents XGETMOTIONEVENTS -#define XGetNormalHints XGETNORMALHINTS -#define XGetPointerMapping XGETPOINTERMAPPING -#define XGetRGBColormaps XGETRGBCOLORMAPS -#define XGetScreenSaver XGETSCREENSAVER -#define XGetSelectionOwner XGETSELECTIONOWNER -#define XGetStandardColormap XGETSTANDARDCOLORMAP -#define XGetSubImage XGETSUBIMAGE -#define XGetTextProperty XGETTEXTPROPERTY -#define XGetVisualInfo XGETVISUALINFO -#define XGetWMColormapWindows XGETWMCOLORMAPWINDOWS -#define XGetWMHints XGETWMHINTS -#define XGetWMIconName XGETWMICONNAME -#define XGetWMName XGETWMNAME -#define XGetWMNormalHints XGETWMNORMALHINTS -#define XGetWindowAttributes XGETWINDOWATTRIBUTES -#define XGetWindowProperty XGETWINDOWPROPERTY -#define XGrabButton XGRABBUTTON -#define XGrabKeyboard XGRABKEYBOARD -#define XGrabPointer XGRABPOINTER -#define XGrabServer XGRABSERVER -#define XHeightMMOfScreen XHEIGHTMMOFSCREEN -#define XHeightOfScreen XHEIGHTOFSCREEN -#define XIconifyWindow XICONIFYWINDOW -#define XIfEvent XIFEVENT -#define XInitExtension XINITEXTENSION -#define XInitImage XINITIMAGE -#define XInstallColormap XINSTALLCOLORMAP -#define XInternAtom XINTERNATOM -#define XInternAtoms XINTERNATOMS -#define XIntersectRegion XINTERSECTREGION -#define XKeycodeToKeysym XKEYCODETOKEYSYM -#define XKeysymToKeycode XKEYSYMTOKEYCODE -#define XKeysymToString XKEYSYMTOSTRING -#define XKillClient XKILLCLIENT -#define XListDepths XLISTDEPTHS -#define XListFonts XLISTFONTS -#define XListFontsWithInfo XLISTFONTSWITHINFO -#define XListHosts XLISTHOSTS -#define XListInputDevices XLISTINPUTDEVICES -#define XListInstalledColormaps XLISTINSTALLEDCOLORMAPS -#define XListPixmapFormats XLISTPIXMAPFORMATS -#define XListProperties XLISTPROPERTIES -#define XLoadFont XLOADFONT -#define XLoadQueryFont XLOADQUERYFONT -#define XLookupColor XLOOKUPCOLOR -#define XLookupKeysym XLOOKUPKEYSYM -#define XLookupString XLOOKUPSTRING -#define XLowerWindow XLOWERWINDOW -#define XMapRaised XMAPRAISED -#define XMapSubwindows XMAPSUBWINDOWS -#define XMapWindow XMAPWINDOW -#define XMatchVisualInfo XMATCHVISUALINFO -#define XMaxRequestSize XMAXREQUESTSIZE -#define XMissingExtension XMISSINGEXTENSION -#define XMoveResizeWindow XMOVERESIZEWINDOW -#define XMoveWindow XMOVEWINDOW -#define XNextEvent XNEXTEVENT -#define XNextRequest XNEXTREQUEST -#define XNoOp XNOOP -#define XOffsetRegion XOFFSETREGION -#define XOpenDevice XOPENDEVICE -#define XOpenDisplay XOPENDISPLAY -#define XOpenIM XOPENIM -#define XParseColor XPARSECOLOR -#define XParseGeometry XPARSEGEOMETRY -#define XPeekEvent XPEEKEVENT -#define XPeekIfEvent XPEEKIFEVENT -#define XPending XPENDING -#define XPointInRegion XPOINTINREGION -#define XPolygonRegion XPOLYGONREGION -#define XPutBackEvent XPUTBACKEVENT -#define XPutImage XPUTIMAGE -#define XQLength XQLENGTH -#define XQueryBestCursor XQUERYBESTCURSOR -#define XQueryBestStipple XQUERYBESTSTIPPLE -#define XQueryColor XQUERYCOLOR -#define XQueryColors XQUERYCOLORS -#define XQueryDeviceState XQUERYDEVICESTATE -#define XQueryExtension XQUERYEXTENSION -#define XQueryFont XQUERYFONT -#define XQueryKeymap XQUERYKEYMAP -#define XQueryPointer XQUERYPOINTER -#define XQueryTree XQUERYTREE -#define XRaiseWindow XRAISEWINDOW -#define XReadBitmapFile XREADBITMAPFILE -#define XRecolorCursor XRECOLORCURSOR -#define XReconfigureWMWindow XRECONFIGUREWMWINDOW -#define XRectInRegion XRECTINREGION -#define XRefreshKeyboardMapping XREFRESHKEYBOARDMAPPING -#define XRemoveHosts XREMOVEHOSTS -#define XReparentWindow XREPARENTWINDOW -#define XResetScreenSaver XRESETSCREENSAVER -#define XResizeWindow XRESIZEWINDOW -#define XResourceManagerString XRESOURCEMANAGERSTRING -#define XRestackWindows XRESTACKWINDOWS -#define XRotateBuffers XROTATEBUFFERS -#define XRootWindow XROOTWINDOW -#define XRootWindowOfScreen XROOTWINDOWOFSCREEN -#define XSaveContext XSAVECONTEXT -#define XScreenNumberOfScreen XSCREENNUMBEROFSCREEN -#define XScreenOfDisplay XSCREENOFDISPLAY -#define XSelectAsyncEvent XSELECTASYNCEVENT -#define XSelectAsyncInput XSELECTASYNCINPUT -#define XSelectExtensionEvent XSELECTEXTENSIONEVENT -#define XSelectInput XSELECTINPUT -#define XSendEvent XSENDEVENT -#define XServerVendor XSERVERVENDOR -#define XSetArcMode XSETARCMODE -#define XSetBackground XSETBACKGROUND -#define XSetClassHint XSETCLASSHINT -#define XSetClipMask XSETCLIPMASK -#define XSetClipOrigin XSETCLIPORIGIN -#define XSetClipRectangles XSETCLIPRECTANGLES -#define XSetCloseDownMode XSETCLOSEDOWNMODE -#define XSetCommand XSETCOMMAND -#define XSetDashes XSETDASHES -#define XSetErrorHandler XSETERRORHANDLER -#define XSetFillRule XSETFILLRULE -#define XSetFillStyle XSETFILLSTYLE -#define XSetFont XSETFONT -#define XSetForeground XSETFOREGROUND -#define XSetFunction XSETFUNCTION -#define XSetGraphicsExposures XSETGRAPHICSEXPOSURES -#define XSetICFocus XSETICFOCUS -#define XSetICValues XSETICVALUES -#define XSetIOErrorHandler XSETIOERRORHANDLER -#define XSetIconName XSETICONNAME -#define XSetInputFocus XSETINPUTFOCUS -#define XSetLineAttributes XSETLINEATTRIBUTES -#define XSetLocaleModifiers XSETLOCALEMODIFIERS -#define XSetNormalHints XSETNORMALHINTS -#define XSetPlaneMask XSETPLANEMASK -#define XSetRegion XSETREGION -#define XSetRGBColormaps XSETRGBCOLORMAPS -#define XSetScreenSaver XSETSCREENSAVER -#define XSetSelectionOwner XSETSELECTIONOWNER -#define XSetStandardProperties XSETSTANDARDPROPERTIES -#define XSetState XSETSTATE -#define XSetStipple XSETSTIPPLE -#define XSetSubwindowMode XSETSUBWINDOWMODE -#define XSetTSOrigin XSETTSORIGIN -#define XSetTextProperty XSETTEXTPROPERTY -#define XSetTile XSETTILE -#define XSetTransientForHint XSETTRANSIENTFORHINT -#define XSetWMClientMachine XSETWMCLIENTMACHINE -#define XSetWMColormapWindows XSETWMCOLORMAPWINDOWS -#define XSetWMHints XSETWMHINTS -#define XSetWMIconName XSETWMICONNAME -#define XSetWMName XSETWMNAME -#define XSetWMNormalHints XSETWMNORMALHINTS -#define XSetWMProperties XSETWMPROPERTIES -#define XSetWMProtocols XSETWMPROTOCOLS -#define XSetWMSizeHints XSETWMSIZEHINTS -#define XSetWindowBackground XSETWINDOWBACKGROUND -#define XSetWindowBackgroundPixmap XSETWINDOWBACKGROUNDPIXMAP -#define XSetWindowBorder XSETWINDOWBORDER -#define XSetWindowBorderPixmap XSETWINDOWBORDERPIXMAP -#define XSetWindowBorderWidth XSETWINDOWBORDERWIDTH -#define XSetWindowColormap XSETWINDOWCOLORMAP -#define XShapeCombineMask XSHAPECOMBINEMASK -#define XShapeCombineRectangles XSHAPECOMBINERECTANGLES -#define XShapeGetRectangles XSHAPEGETRECTANGLES -#define XShapeQueryExtension XSHAPEQUERYEXTENSION -#define XShmAttach XSHMATTACH -#define XShmCreateImage XSHMCREATEIMAGE -#define XShmCreatePixmap XSHMCREATEPIXMAP -#define XShmDetach XSHMDETACH -#define XShmGetEventBase XSHMGETEVENTBASE -#define XShmPutImage XSHMPUTIMAGE -#define XShmQueryExtension XSHMQUERYEXTENSION -#define XShmQueryVersion XSHMQUERYVERSION -#define XShrinkRegion XSHRINKREGION -#define XStoreBuffer XSTOREBUFFER -#define XStoreBytes XSTOREBYTES -#define XStoreColor XSTORECOLOR -#define XStoreColors XSTORECOLORS -#define XStoreName XSTORENAME -#define XStringListToTextProperty XSTRINGLISTTOTEXTPROPERTY -#define XStringToKeysym XSTRINGTOKEYSYM -#define XSubtractRegion XSUBTRACTREGION -#define XSupportsLocale XSUPPORTSLOCALE -#define XSync XSYNC -#define XSynchronize XSYNCHRONIZE -#define XTextExtents XTEXTEXTENTS -#define XTextExtents16 XTEXTEXTENTS16 -#define XTextPropertyToStringList XTEXTPROPERTYTOSTRINGLIST -#define XTextWidth XTEXTWIDTH -#define XTextWidth16 XTEXTWIDTH16 -#define XTranslateCoordinates XTRANSLATECOORDINATES -#define XUndefineCursor XUNDEFINECURSOR -#define XUngrabButton XUNGRABBUTTON -#define XUngrabKeyboard XUNGRABKEYBOARD -#define XUngrabPointer XUNGRABPOINTER -#define XUngrabServer XUNGRABSERVER -#define XUninstallColormap XUNINSTALLCOLORMAP -#define XUnionRectWithRegion XUNIONRECTWITHREGION -#define XUnionRegion XUNIONREGION -#define XUniqueContext XUNIQUECONTEXT -#define XUnmapWindow XUNMAPWINDOW -#define XUnsetICFocus XUNSETICFOCUS -#define XVaCreateNestedList XVACREATENESTEDLIST -#define XVisualIDFromVisual XVISUALIDFROMVISUAL -#define XWMGeometry XWMGEOMETRY -#define XWarpPointer XWARPPOINTER -#define XWhitePixel XWHITEPIXEL -#define XWhitePixelOfScreen XWHITEPIXELOFSCREEN -#define XWidthMMOfScreen XWIDTHMMOFSCREEN -#define XWidthOfScreen XWIDTHOFSCREEN -#define XWindowEvent XWINDOWEVENT -#define XWithdrawWindow XWITHDRAWWINDOW -#define XXorRegion XXORREGION -#define XcmsQueryColor XCMSQUERYCOLOR -#define XdbeAllocateBackBufferName XDBEALLOCATEBACKBUFFERNAME -#define XdbeFreeVisualInfo XDBEFREEVISUALINFO -#define XdbeGetVisualInfo XDBEGETVISUALINFO -#define XdbeQueryExtension XDBEQUERYEXTENSION -#define XdbeSwapBuffers XDBESWAPBUFFERS -#define XextAddDisplay XEXTADDDISPLAY -#define XextFindDisplay XEXTFINDDISPLAY -#define XextRemoveDisplay XEXTREMOVEDISPLAY -#define XkbSetDetectableAutoRepeat XKBSETDETECTABLEAUTOREPEAT -#define XmActivateProtocol XMACTIVATEPROTOCOL -#define XmAddProtocolCallback XMADDPROTOCOLCALLBACK -#define XmAddProtocols XMADDPROTOCOLS -#define XmChangeColor XMCHANGECOLOR -#define XmClipboardCopy XMCLIPBOARDCOPY -#define XmClipboardCopyByName XMCLIPBOARDCOPYBYNAME -#define XmClipboardEndCopy XMCLIPBOARDENDCOPY -#define XmClipboardEndRetrieve XMCLIPBOARDENDRETRIEVE -#define XmClipboardInquireCount XMCLIPBOARDINQUIRECOUNT -#define XmClipboardInquireFormat XMCLIPBOARDINQUIREFORMAT -#define XmClipboardInquireLength XMCLIPBOARDINQUIRELENGTH -#define XmClipboardLock XMCLIPBOARDLOCK -#define XmClipboardRetrieve XMCLIPBOARDRETRIEVE -#define XmClipboardStartCopy XMCLIPBOARDSTARTCOPY -#define XmClipboardStartRetrieve XMCLIPBOARDSTARTRETRIEVE -#define XmClipboardUnlock XMCLIPBOARDUNLOCK -#define XmCommandError XMCOMMANDERROR -#define XmCommandGetChild XMCOMMANDGETCHILD -#define XmCommandSetValue XMCOMMANDSETVALUE -#define XmCreateArrowButton XMCREATEARROWBUTTON -#define XmCreateArrowButtonGadget XMCREATEARROWBUTTONGADGET -#define XmCreateBulletinBoardDialog XMCREATEBULLETINBOARDDIALOG -#define XmCreateCascadeButton XMCREATECASCADEBUTTON -#define XmCreateCascadeButtonGadget XMCREATECASCADEBUTTONGADGET -#define XmCreateDialogShell XMCREATEDIALOGSHELL -#define XmCreateDragIcon XMCREATEDRAGICON -#define XmCreateDrawingArea XMCREATEDRAWINGAREA -#define XmCreateDrawnButton XMCREATEDRAWNBUTTON -#define XmCreateErrorDialog XMCREATEERRORDIALOG -#define XmCreateFileSelectionBox XMCREATEFILESELECTIONBOX -#define XmCreateFileSelectionDialog XMCREATEFILESELECTIONDIALOG -#define XmCreateForm XMCREATEFORM -#define XmCreateFormDialog XMCREATEFORMDIALOG -#define XmCreateFrame XMCREATEFRAME -#define XmCreateInformationDialog XMCREATEINFORMATIONDIALOG -#define XmCreateLabel XMCREATELABEL -#define XmCreateLabelGadget XMCREATELABELGADGET -#define XmCreateList XMCREATELIST -#define XmCreateMainWindow XMCREATEMAINWINDOW -#define XmCreateMenuBar XMCREATEMENUBAR -#define XmCreateMessageBox XMCREATEMESSAGEBOX -#define XmCreateMessageDialog XMCREATEMESSAGEDIALOG -#define XmCreateOptionMenu XMCREATEOPTIONMENU -#define XmCreatePanedWindow XMCREATEPANEDWINDOW -#define XmCreatePopupMenu XMCREATEPOPUPMENU -#define XmCreatePromptDialog XMCREATEPROMPTDIALOG -#define XmCreatePulldownMenu XMCREATEPULLDOWNMENU -#define XmCreatePushButton XMCREATEPUSHBUTTON -#define XmCreatePushButtonGadget XMCREATEPUSHBUTTONGADGET -#define XmCreateQuestionDialog XMCREATEQUESTIONDIALOG -#define XmCreateRadioBox XMCREATERADIOBOX -#define XmCreateRowColumn XMCREATEROWCOLUMN -#define XmCreateScale XMCREATESCALE -#define XmCreateScrollBar XMCREATESCROLLBAR -#define XmCreateScrolledList XMCREATESCROLLEDLIST -#define XmCreateScrolledText XMCREATESCROLLEDTEXT -#define XmCreateScrolledWindow XMCREATESCROLLEDWINDOW -#define XmCreateSelectionDialog XMCREATESELECTIONDIALOG -#define XmCreateSeparator XMCREATESEPARATOR -#define XmCreateSeparatorGadget XMCREATESEPARATORGADGET -#define XmCreateTemplateDialog XMCREATETEMPLATEDIALOG -#define XmCreateText XMCREATETEXT -#define XmCreateTextField XMCREATETEXTFIELD -#define XmCreateToggleButton XMCREATETOGGLEBUTTON -#define XmCreateToggleButtonGadget XMCREATETOGGLEBUTTONGADGET -#define XmCreateWarningDialog XMCREATEWARNINGDIALOG -#define XmCvtCTToXmString XMCVTCTTOXMSTRING -#define XmDestroyPixmap XMDESTROYPIXMAP -#define XmDragStart XMDRAGSTART -#define XmDropSiteRegister XMDROPSITEREGISTER -#define XmDropSiteUnregister XMDROPSITEUNREGISTER -#define XmDropSiteUpdate XMDROPSITEUPDATE -#define XmDropTransferStart XMDROPTRANSFERSTART -#define XmFileSelectionBoxGetChild XMFILESELECTIONBOXGETCHILD -#define XmFileSelectionDoSearch XMFILESELECTIONDOSEARCH -#define XmFontListAppendEntry XMFONTLISTAPPENDENTRY -#define XmFontListCopy XMFONTLISTCOPY -#define XmFontListCreate XMFONTLISTCREATE -#define XmFontListEntryCreate XMFONTLISTENTRYCREATE -#define XmFontListEntryFree XMFONTLISTENTRYFREE -#define XmFontListEntryGetFont XMFONTLISTENTRYGETFONT -#define XmFontListEntryGetTag XMFONTLISTENTRYGETTAG -#define XmFontListEntryLoad XMFONTLISTENTRYLOAD -#define XmFontListFree XMFONTLISTFREE -#define XmFontListFreeFontContext XMFONTLISTFREEFONTCONTEXT -#define XmFontListGetNextFont XMFONTLISTGETNEXTFONT -#define XmFontListInitFontContext XMFONTLISTINITFONTCONTEXT -#define XmFontListNextEntry XMFONTLISTNEXTENTRY -#define XmGetColors XMGETCOLORS -#define XmGetColorCalculation XMGETCOLORCALCULATION -#define XmGetFocusWidget XMGETFOCUSWIDGET -#define XmGetMenuCursor XMGETMENUCURSOR -#define XmGetPixmap XMGETPIXMAP -#define XmGetPixmapByDepth XMGETPIXMAPBYDEPTH -#define XmGetTearOffControl XMGETTEAROFFCONTROL -#define XmGetXmDisplay XMGETXMDISPLAY -#define XmImMbLookupString XMIMMBLOOKUPSTRING -#define XmImRegister XMIMREGISTER -#define XmImSetFocusValues XMIMSETFOCUSVALUES -#define XmImSetValues XMIMSETVALUES -#define XmImUnregister XMIMUNREGISTER -#define XmImUnsetFocus XMIMUNSETFOCUS -#define XmInstallImage XMINSTALLIMAGE -#define XmInternAtom XMINTERNATOM -#define XmIsMotifWMRunning XMISMOTIFWMRUNNING -#define XmListAddItem XMLISTADDITEM -#define XmListAddItemUnselected XMLISTADDITEMUNSELECTED -#define XmListAddItems XMLISTADDITEMS -#define XmListAddItemsUnselected XMLISTADDITEMSUNSELECTED -#define XmListDeleteAllItems XMLISTDELETEALLITEMS -#define XmListDeleteItem XMLISTDELETEITEM -#define XmListDeleteItemsPos XMLISTDELETEITEMSPOS -#define XmListDeletePos XMLISTDELETEPOS -#define XmListDeselectAllItems XMLISTDESELECTALLITEMS -#define XmListDeselectPos XMLISTDESELECTPOS -#define XmListGetKbdItemPos XMLISTGETKBDITEMPOS -#define XmListGetMatchPos XMLISTGETMATCHPOS -#define XmListGetSelectedPos XMLISTGETSELECTEDPOS -#define XmListItemExists XMLISTITEMEXISTS -#define XmListItemPos XMLISTITEMPOS -#define XmListPosSelected XMLISTPOSSELECTED -#define XmListReplaceItems XMLISTREPLACEITEMS -#define XmListReplaceItemsPos XMLISTREPLACEITEMSPOS -#define XmListSelectItem XMLISTSELECTITEM -#define XmListSelectPos XMLISTSELECTPOS -#define XmListSetBottomPos XMLISTSETBOTTOMPOS -#define XmListSetItem XMLISTSETITEM -#define XmListSetKbdItemPos XMLISTSETKBDITEMPOS -#define XmListSetPos XMLISTSETPOS -#define XmMainWindowSetAreas XMMAINWINDOWSETAREAS -#define XmMenuPosition XMMENUPOSITION -#define XmMessageBoxGetChild XMMESSAGEBOXGETCHILD -#define XmOptionButtonGadget XMOPTIONBUTTONGADGET -#define XmOptionLabelGadget XMOPTIONLABELGADGET -#define XmProcessTraversal XMPROCESSTRAVERSAL -#define XmQmotif XMQMOTIF -#define XmRemoveProtocolCallback XMREMOVEPROTOCOLCALLBACK -#define XmRemoveProtocols XMREMOVEPROTOCOLS -#define XmRemoveTabGroup XMREMOVETABGROUP -#define XmRepTypeGetId XMREPTYPEGETID -#define XmRepTypeGetRecord XMREPTYPEGETRECORD -#define XmRepTypeInstallTearOffModelCon XMREPTYPEINSTALLTEAROFFMODELCON -#define XmRepTypeRegister XMREPTYPEREGISTER -#define XmRepTypeValidValue XMREPTYPEVALIDVALUE -#define XmScrollBarGetValues XMSCROLLBARGETVALUES -#define XmScrollBarSetValues XMSCROLLBARSETVALUES -#define XmScrolledWindowSetAreas XMSCROLLEDWINDOWSETAREAS -#define XmSelectionBoxGetChild XMSELECTIONBOXGETCHILD -#define XmSetColorCalculation XMSETCOLORCALCULATION -#define XmStringByteCompare XMSTRINGBYTECOMPARE -#define XmStringCompare XMSTRINGCOMPARE -#define XmStringConcat XMSTRINGCONCAT -#define XmStringCopy XMSTRINGCOPY -#define XmStringCreate XMSTRINGCREATE -#define XmStringCreateLocalized XMSTRINGCREATELOCALIZED -#define XmStringCreateLtoR XMSTRINGCREATELTOR -#define XmStringCreateSimple XMSTRINGCREATESIMPLE -#define XmStringDraw XMSTRINGDRAW -#define XmStringDrawUnderline XMSTRINGDRAWUNDERLINE -#define XmStringExtent XMSTRINGEXTENT -#define XmStringFree XMSTRINGFREE -#define XmStringFreeContext XMSTRINGFREECONTEXT -#define XmStringGetLtoR XMSTRINGGETLTOR -#define XmStringGetNextComponent XMSTRINGGETNEXTCOMPONENT -#define XmStringGetNextSegment XMSTRINGGETNEXTSEGMENT -#define XmStringInitContext XMSTRINGINITCONTEXT -#define XmStringLength XMSTRINGLENGTH -#define XmStringLtoRCreate XMSTRINGLTORCREATE -#define XmStringNConcat XMSTRINGNCONCAT -#define XmStringSegmentCreate XMSTRINGSEGMENTCREATE -#define XmStringSeparatorCreate XMSTRINGSEPARATORCREATE -#define XmStringWidth XMSTRINGWIDTH -#define XmTextClearSelection XMTEXTCLEARSELECTION -#define XmTextCopy XMTEXTCOPY -#define XmTextCut XMTEXTCUT -#define XmTextFieldClearSelection XMTEXTFIELDCLEARSELECTION -#define XmTextFieldCopy XMTEXTFIELDCOPY -#define XmTextFieldCut XMTEXTFIELDCUT -#define XmTextFieldGetEditable XMTEXTFIELDGETEDITABLE -#define XmTextFieldGetInsertionPosition XMTEXTFIELDGETINSERTIONPOSITION -#define XmTextFieldGetLastPosition XMTEXTFIELDGETLASTPOSITION -#define XmTextFieldGetMaxLength XMTEXTFIELDGETMAXLENGTH -#define XmTextFieldGetSelection XMTEXTFIELDGETSELECTION -#define XmTextFieldGetSelectionPosition XMTEXTFIELDGETSELECTIONPOSITION -#define XmTextFieldGetString XMTEXTFIELDGETSTRING -#define XmTextFieldInsert XMTEXTFIELDINSERT -#define XmTextFieldPaste XMTEXTFIELDPASTE -#define XmTextFieldRemove XMTEXTFIELDREMOVE -#define XmTextFieldReplace XMTEXTFIELDREPLACE -#define XmTextFieldSetAddMode XMTEXTFIELDSETADDMODE -#define XmTextFieldSetHighlight XMTEXTFIELDSETHIGHLIGHT -#define XmTextFieldSetInsertionPosition XMTEXTFIELDSETINSERTIONPOSITION -#define XmTextFieldSetMaxLength XMTEXTFIELDSETMAXLENGTH -#define XmTextFieldSetSelection XMTEXTFIELDSETSELECTION -#define XmTextFieldSetString XMTEXTFIELDSETSTRING -#define XmTextFieldShowPosition XMTEXTFIELDSHOWPOSITION -#define XmTextGetCursorPosition XMTEXTGETCURSORPOSITION -#define XmTextGetEditable XMTEXTGETEDITABLE -#define XmTextGetInsertionPosition XMTEXTGETINSERTIONPOSITION -#define XmTextGetLastPosition XMTEXTGETLASTPOSITION -#define XmTextGetMaxLength XMTEXTGETMAXLENGTH -#define XmTextGetSelection XMTEXTGETSELECTION -#define XmTextGetSelectionPosition XMTEXTGETSELECTIONPOSITION -#define XmTextGetString XMTEXTGETSTRING -#define XmTextInsert XMTEXTINSERT -#define XmTextPaste XMTEXTPASTE -#define XmTextPosToXY XMTEXTPOSTOXY -#define XmTextRemove XMTEXTREMOVE -#define XmTextReplace XMTEXTREPLACE -#define XmTextSetCursorPosition XMTEXTSETCURSORPOSITION -#define XmTextSetEditable XMTEXTSETEDITABLE -#define XmTextSetHighlight XMTEXTSETHIGHLIGHT -#define XmTextSetInsertionPosition XMTEXTSETINSERTIONPOSITION -#define XmTextSetSelection XMTEXTSETSELECTION -#define XmTextSetString XMTEXTSETSTRING -#define XmTextSetTopCharacter XMTEXTSETTOPCHARACTER -#define XmTextShowPosition XMTEXTSHOWPOSITION -#define XmToggleButtonGadgetGetState XMTOGGLEBUTTONGADGETGETSTATE -#define XmToggleButtonGadgetSetState XMTOGGLEBUTTONGADGETSETSTATE -#define XmToggleButtonGetState XMTOGGLEBUTTONGETSTATE -#define XmToggleButtonSetState XMTOGGLEBUTTONSETSTATE -#define XmUninstallImage XMUNINSTALLIMAGE -#define XmUpdateDisplay XMUPDATEDISPLAY -#define XmVaCreateSimpleRadioBox XMVACREATESIMPLERADIOBOX -#define XmbDrawString XMBDRAWSTRING -#define XmbLookupString XMBLOOKUPSTRING -#define XmbResetIC XMBRESETIC -#define XmbSetWMProperties XMBSETWMPROPERTIES -#define XmbTextEscapement XMBTEXTESCAPEMENT -#define XmbTextExtents XMBTEXTEXTENTS -#define XmbTextListToTextProperty XMBTEXTLISTTOTEXTPROPERTY -#define XmbTextPropertyToTextList XMBTEXTPROPERTYTOTEXTLIST -#define XmbufCreateBuffers XMBUFCREATEBUFFERS -#define XmbufDestroyBuffers XMBUFDESTROYBUFFERS -#define XmbufDisplayBuffers XMBUFDISPLAYBUFFERS -#define XmbufQueryExtension XMBUFQUERYEXTENSION -#define Xmemory_free XMEMORY_FREE -#define Xmemory_malloc XMEMORY_MALLOC -#define XmuClientWindow XMUCLIENTWINDOW -#define XmuConvertStandardSelection XMUCONVERTSTANDARDSELECTION -#define XmuCvtStringToBitmap XMUCVTSTRINGTOBITMAP -#define XmuInternAtom XMUINTERNATOM -#define XmuInternStrings XMUINTERNSTRINGS -#define XmuLookupStandardColormap XMULOOKUPSTANDARDCOLORMAP -#define XmuPrintDefaultErrorMessage XMUPRINTDEFAULTERRORMESSAGE -#define XrmCombineDatabase XRMCOMBINEDATABASE -#define XrmCombineFileDatabase XRMCOMBINEFILEDATABASE -#define XrmDestroyDatabase XRMDESTROYDATABASE -#define XrmGetDatabase XRMGETDATABASE -#define XrmGetFileDatabase XRMGETFILEDATABASE -#define XrmGetResource XRMGETRESOURCE -#define XrmGetStringDatabase XRMGETSTRINGDATABASE -#define XrmInitialize XRMINITIALIZE -#define XrmMergeDatabases XRMMERGEDATABASES -#define XrmParseCommand XRMPARSECOMMAND -#define XrmPermStringToQuark XRMPERMSTRINGTOQUARK -#define XrmPutFileDatabase XRMPUTFILEDATABASE -#define XrmPutLineResource XRMPUTLINERESOURCE -#define XrmPutStringResource XRMPUTSTRINGRESOURCE -#define XrmQGetResource XRMQGETRESOURCE -#define XrmQPutStringResource XRMQPUTSTRINGRESOURCE -#define XrmQuarkToString XRMQUARKTOSTRING -#define XrmSetDatabase XRMSETDATABASE -#define XrmStringToBindingQuarkList XRMSTRINGTOBINDINGQUARKLIST -#define XrmStringToQuark XRMSTRINGTOQUARK -#define XtAddCallback XTADDCALLBACK -#define XtAddCallbacks XTADDCALLBACKS -#define XtAddConverter XTADDCONVERTER -#define XtAddEventHandler XTADDEVENTHANDLER -#define XtAddExposureToRegion XTADDEXPOSURETOREGION -#define XtAddGrab XTADDGRAB -#define XtAddRawEventHandler XTADDRAWEVENTHANDLER -#define XtAllocateGC XTALLOCATEGC -#define XtAppAddActions XTAPPADDACTIONS -#define XtAppAddInput XTAPPADDINPUT -#define XtAppAddTimeOut XTAPPADDTIMEOUT -#define XtAppAddWorkProc XTAPPADDWORKPROC -#define XtAppCreateShell XTAPPCREATESHELL -#define XtAppError XTAPPERROR -#define XtAppErrorMsg XTAPPERRORMSG -#define XtAppInitialize XTAPPINITIALIZE -#define XtAppMainLoop XTAPPMAINLOOP -#define XtAppNextEvent XTAPPNEXTEVENT -#define XtAppPeekEvent XTAPPPEEKEVENT -#define XtAppPending XTAPPPENDING -#define XtAppProcessEvent XTAPPPROCESSEVENT -#define XtAppSetErrorHandler XTAPPSETERRORHANDLER -#define XtAppSetFallbackResources XTAPPSETFALLBACKRESOURCES -#define XtAppSetTypeConverter XTAPPSETTYPECONVERTER -#define XtAppSetWarningHandler XTAPPSETWARNINGHANDLER -#define XtAppWarningMsg XTAPPWARNINGMSG -#define XtAppSetWarningMsgHandler XTAPPSETWARNINGMSGHANDLER -#define XtAppWarning XTAPPWARNING -#define XtAugmentTranslations XTAUGMENTTRANSLATIONS -#define XtCallActionProc XTCALLACTIONPROC -#define XtCallCallbackList XTCALLCALLBACKLIST -#define XtCallCallbacks XTCALLCALLBACKS -#define XtCallConverter XTCALLCONVERTER -#define XtCalloc XTCALLOC -#ifndef NOXTDISPLAY -#define XtClass XTCLASS -#endif -#define XtCloseDisplay XTCLOSEDISPLAY -#define XtConfigureWidget XTCONFIGUREWIDGET -#define XtConvert XTCONVERT -#define XtConvertAndStore XTCONVERTANDSTORE -#define XtCreateApplicationContext XTCREATEAPPLICATIONCONTEXT -#define XtCreateManagedWidget XTCREATEMANAGEDWIDGET -#define XtCreatePopupShell XTCREATEPOPUPSHELL -#define XtCreateWidget XTCREATEWIDGET -#define XtCreateWindow XTCREATEWINDOW -#define XtCvtStringToFont XTCVTSTRINGTOFONT -#define XtDatabase XTDATABASE -#define XtDestroyApplicationContext XTDESTROYAPPLICATIONCONTEXT -#define XtDestroyWidget XTDESTROYWIDGET -#define XtDisownSelection XTDISOWNSELECTION -#define XtDispatchEvent XTDISPATCHEVENT -#ifndef NOXTDISPLAY -#define XtDisplay XTDISPLAY -#endif -#define XtDisplayOfObject XTDISPLAYOFOBJECT -#define XtDisplayStringConvWarning XTDISPLAYSTRINGCONVWARNING -#define XtDisplayToApplicationContext XTDISPLAYTOAPPLICATIONCONTEXT -#define XtError XTERROR -#define XtErrorMsg XTERRORMSG -#define XtFree XTFREE -#define XtGetActionKeysym XTGETACTIONKEYSYM -#define XtGetActionList XTGETACTIONLIST -#define XtGetApplicationNameAndClass XTGETAPPLICATIONNAMEANDCLASS -#define XtGetApplicationResources XTGETAPPLICATIONRESOURCES -#define XtGetClassExtension XTGETCLASSEXTENSION -#define XtGetConstraintResourceList XTGETCONSTRAINTRESOURCELIST -#define XtGetGC XTGETGC -#define XtGetMultiClickTime XTGETMULTICLICKTIME -#define XtGetResourceList XTGETRESOURCELIST -#define XtGetSelectionValue XTGETSELECTIONVALUE -#define XtGetSelectionValues XTGETSELECTIONVALUES -#define XtGetSubresources XTGETSUBRESOURCES -#define XtGetValues XTGETVALUES -#define XtGrabButton XTGRABBUTTON -#define XtGrabKeyboard XTGRABKEYBOARD -#define XtGrabPointer XTGRABPOINTER -#define XtHasCallbacks XTHASCALLBACKS -#define XtInitialize XTINITIALIZE -#define XtInitializeWidgetClass XTINITIALIZEWIDGETCLASS -#define XtInsertEventHandler XTINSERTEVENTHANDLER -#define XtInsertRawEventHandler XTINSERTRAWEVENTHANDLER -#define XtInstallAccelerators XTINSTALLACCELERATORS -#define XtIsManaged XTISMANAGED -#define XtIsObject XTISOBJECT -#ifndef NOXTDISPLAY -#define XtIsRealized XTISREALIZED -#endif -#define XtIsSensitive XTISSENSITIVE -#define XtIsSubclass XTISSUBCLASS -#define XtLastTimestampProcessed XTLASTTIMESTAMPPROCESSED -#define XtMainLoop XTMAINLOOP -#define XtMakeGeometryRequest XTMAKEGEOMETRYREQUEST -#define XtMakeResizeRequest XTMAKERESIZEREQUEST -#define XtMalloc XTMALLOC -#define XtManageChild XTMANAGECHILD -#define XtManageChildren XTMANAGECHILDREN -#define XtMergeArgLists XTMERGEARGLISTS -#define XtMoveWidget XTMOVEWIDGET -#define XtName XTNAME -#define XtNameToWidget XTNAMETOWIDGET -#define XtOpenApplication XTOPENAPPLICATION -#define XtOpenDisplay XTOPENDISPLAY -#define XtOverrideTranslations XTOVERRIDETRANSLATIONS -#define XtOwnSelection XTOWNSELECTION -#ifndef NOXTDISPLAY -#define XtParent XTPARENT -#endif -#define XtParseAcceleratorTable XTPARSEACCELERATORTABLE -#define XtParseTranslationTable XTPARSETRANSLATIONTABLE -#define XtPopdown XTPOPDOWN -#define XtPopup XTPOPUP -#define XtPopupSpringLoaded XTPOPUPSPRINGLOADED -#define XtQueryGeometry XTQUERYGEOMETRY -#define XtRealizeWidget XTREALIZEWIDGET -#define XtRealloc XTREALLOC -#define XtRegisterDrawable _XTREGISTERWINDOW -#define XtRegisterGrabAction XTREGISTERGRABACTION -#define XtReleaseGC XTRELEASEGC -#define XtRemoveAllCallbacks XTREMOVEALLCALLBACKS -#define XtRemoveCallback XTREMOVECALLBACK -#define XtRemoveEventHandler XTREMOVEEVENTHANDLER -#define XtRemoveGrab XTREMOVEGRAB -#define XtRemoveInput XTREMOVEINPUT -#define XtRemoveTimeOut XTREMOVETIMEOUT -#define XtRemoveWorkProc XTREMOVEWORKPROC -#define XtResizeWidget XTRESIZEWIDGET -#define XtResolvePathname XTRESOLVEPATHNAME -#ifndef NOXTDISPLAY -#define XtScreen XTSCREEN -#endif -#define XtScreenDatabase XTSCREENDATABASE -#define XtScreenOfObject XTSCREENOFOBJECT -#define XtSessionReturnToken XTSESSIONRETURNTOKEN -#define XtSetErrorHandler XTSETERRORHANDLER -#define XtSetKeyboardFocus XTSETKEYBOARDFOCUS -#define XtSetLanguageProc XTSETLANGUAGEPROC -#define XtSetMappedWhenManaged XTSETMAPPEDWHENMANAGED -#define XtSetSensitive XTSETSENSITIVE -#define XtSetTypeConverter XTSETTYPECONVERTER -#define XtSetValues XTSETVALUES -#define XtShellStrings XTSHELLSTRINGS -#define XtStringConversionWarning XTSTRINGCONVERSIONWARNING -#define XtStrings XTSTRINGS -#define XtToolkitInitialize XTTOOLKITINITIALIZE -#define XtTranslateCoords XTTRANSLATECOORDS -#define XtTranslateKeycode XTTRANSLATEKEYCODE -#define XtUngrabButton XTUNGRABBUTTON -#define XtUngrabKeyboard XTUNGRABKEYBOARD -#define XtUngrabPointer XTUNGRABPOINTER -#define XtUnmanageChild XTUNMANAGECHILD -#define XtUnmanageChildren XTUNMANAGECHILDREN -#define XtUnrealizeWidget XTUNREALIZEWIDGET -#define XtUnregisterDrawable _XTUNREGISTERWINDOW -#define XtVaCreateManagedWidget XTVACREATEMANAGEDWIDGET -#define XtVaCreatePopupShell XTVACREATEPOPUPSHELL -#define XtVaCreateWidget XTVACREATEWIDGET -#define XtVaGetApplicationResources XTVAGETAPPLICATIONRESOURCES -#define XtVaGetValues XTVAGETVALUES -#define XtVaSetValues XTVASETVALUES -#define XtWarning XTWARNING -#define XtWarningMsg XTWARNINGMSG -#define XtWidgetToApplicationContext XTWIDGETTOAPPLICATIONCONTEXT -#ifndef NOXTDISPLAY -#define XtWindow XTWINDOW -#endif -#define XtWindowOfObject XTWINDOWOFOBJECT -#define XtWindowToWidget XTWINDOWTOWIDGET -#define XwcDrawImageString XWCDRAWIMAGESTRING -#define XwcDrawString XWCDRAWSTRING -#define XwcFreeStringList XWCFREESTRINGLIST -#define XwcTextEscapement XWCTEXTESCAPEMENT -#define XwcTextExtents XWCTEXTEXTENTS -#define XwcTextListToTextProperty XWCTEXTLISTTOTEXTPROPERTY -#define XwcLookupString XWCLOOKUPSTRING -#define XwcTextPropertyToTextList XWCTEXTPROPERTYTOTEXTLIST -#define _XAllocTemp _XALLOCTEMP -#define _XDeqAsyncHandler _XDEQASYNCHANDLER -#define _XEatData _XEATDATA -#define _XFlush _XFLUSH -#define _XFreeTemp _XFREETEMP -#define _XGetAsyncReply _XGETASYNCREPLY -#define _XInitImageFuncPtrs _XINITIMAGEFUNCPTRS -#define _XRead _XREAD -#define _XReadPad _XREADPAD -#define _XRegisterFilterByType _XREGISTERFILTERBYTYPE -#define _XReply _XREPLY -#define _XSend _XSEND -#define _XUnregisterFilter _XUNREGISTERFILTER -#define _XVIDtoVisual _XVIDTOVISUAL -#define _XmBottomShadowColorDefault _XMBOTTOMSHADOWCOLORDEFAULT -#define _XmClearBorder _XMCLEARBORDER -#define _XmConfigureObject _XMCONFIGUREOBJECT -#define _XmDestroyParentCallback _XMDESTROYPARENTCALLBACK -#define _XmDrawArrow _XMDRAWARROW -#define _XmDrawShadows _XMDRAWSHADOWS -#define _XmFontListGetDefaultFont _XMFONTLISTGETDEFAULTFONT -#define _XmFromHorizontalPixels _XMFROMHORIZONTALPIXELS -#define _XmFromVerticalPixels _XMFROMVERTICALPIXELS -#define _XmGetClassExtensionPtr _XMGETCLASSEXTENSIONPTR -#define _XmGetDefaultFontList _XMGETDEFAULTFONTLIST -#define _XmGetTextualDragIcon _XMGETTEXTUALDRAGICON -#define _XmGetWidgetExtData _XMGETWIDGETEXTDATA -#define _XmGrabKeyboard _XMGRABKEYBOARD -#define _XmGrabPointer _XMGRABPOINTER -#define _XmInheritClass _XMINHERITCLASS -#define _XmInputForGadget _XMINPUTFORGADGET -#define _XmInputInGadget _XMINPUTINGADGET -#define _XmMakeGeometryRequest _XMMAKEGEOMETRYREQUEST -#define _XmMenuPopDown _XMMENUPOPDOWN -#define _XmMoveObject _XMMOVEOBJECT -#define _XmNavigChangeManaged _XMNAVIGCHANGEMANAGED -#define _XmOSBuildFileList _XMOSBUILDFILELIST -#define _XmOSFileCompare _XMOSFILECOMPARE -#define _XmOSFindPatternPart _XMOSFINDPATTERNPART -#define _XmOSQualifyFileSpec _XMOSQUALIFYFILESPEC -#define _XmPostPopupMenu _XMPOSTPOPUPMENU -#define _XmPrimitiveEnter _XMPRIMITIVEENTER -#define _XmPrimitiveLeave _XMPRIMITIVELEAVE -#define _XmRedisplayGadgets _XMREDISPLAYGADGETS -#define _XmShellIsExclusive _XMSHELLISEXCLUSIVE -#define _XmStringDraw _XMSTRINGDRAW -#define _XmStringGetTextConcat _XMSTRINGGETTEXTCONCAT -#define _XmStrings _XMSTRINGS -#define _XmToHorizontalPixels _XMTOHORIZONTALPIXELS -#define _XmToVerticalPixels _XMTOVERTICALPIXELS -#define _XmTopShadowColorDefault _XMTOPSHADOWCOLORDEFAULT -#define _Xm_fastPtr _XM_FASTPTR -#define _XtCheckSubclassFlag _XTCHECKSUBCLASSFLAG -#define _XtCopyFromArg _XTCOPYFROMARG -#define _XtCountVaList _XTCOUNTVALIST -#define _XtInherit _XTINHERIT -#define _XtInheritTranslations _XTINHERITTRANSLATIONS -#define _XtIsSubclassOf _XTISSUBCLASSOF -#define _XtVaToArgList _XTVATOARGLIST -#define applicationShellWidgetClass APPLICATIONSHELLWIDGETCLASS -#define cli$dcl_parse CLI$DCL_PARSE -#define cli$get_value CLI$GET_VALUE -#define cli$present CLI$PRESENT -#define compositeClassRec COMPOSITECLASSREC -#define compositeWidgetClass COMPOSITEWIDGETCLASS -#define constraintClassRec CONSTRAINTCLASSREC -#define constraintWidgetClass CONSTRAINTWIDGETCLASS -#define coreWidgetClass COREWIDGETCLASS -#define exe$getspi EXE$GETSPI -#define lbr$close LBR$CLOSE -#define lbr$get_header LBR$GET_HEADER -#define lbr$get_index LBR$GET_INDEX -#define lbr$get_record LBR$GET_RECORD -#define lbr$ini_control LBR$INI_CONTROL -#define lbr$lookup_key LBR$LOOKUP_KEY -#define lbr$open LBR$OPEN -#define lbr$output_help LBR$OUTPUT_HELP -#define lib$add_times LIB$ADD_TIMES -#define lib$addx LIB$ADDX -#define lib$create_dir LIB$CREATE_DIR -#define lib$create_vm_zone LIB$CREATE_VM_ZONE -#define lib$cvt_from_internal_time LIB$CVT_FROM_INTERNAL_TIME -#define lib$cvt_htb LIB$CVT_HTB -#define lib$cvt_vectim LIB$CVT_VECTIM -#define lib$day LIB$DAY -#define lib$day_of_week LIB$DAY_OF_WEEK -#define lib$delete_symbol LIB$DELETE_SYMBOL -#define lib$delete_vm_zone LIB$DELETE_VM_ZONE -#define lib$disable_ctrl LIB$DISABLE_CTRL -#define lib$ediv LIB$EDIV -#define lib$emul LIB$EMUL -#define lib$enable_ctrl LIB$ENABLE_CTRL -#define lib$find_vm_zone LIB$FIND_VM_ZONE -#define lib$format_date_time LIB$FORMAT_DATE_TIME -#define lib$free_timer LIB$FREE_TIMER -#define lib$free_vm LIB$FREE_VM -#define lib$get_ef LIB$GET_EF -#define lib$get_foreign LIB$GET_FOREIGN -#define lib$get_input LIB$GET_INPUT -#define lib$get_users_language LIB$GET_USERS_LANGUAGE -#define lib$get_vm LIB$GET_VM -#define lib$get_symbol LIB$GET_SYMBOL -#define lib$getdvi LIB$GETDVI -#define lib$init_date_time_context LIB$INIT_DATE_TIME_CONTEXT -#define lib$init_timer LIB$INIT_TIMER -#define lib$find_file LIB$FIND_FILE -#define lib$find_file_end LIB$FIND_FILE_END -#define lib$find_image_symbol LIB$FIND_IMAGE_SYMBOL -#define lib$mult_delta_time LIB$MULT_DELTA_TIME -#define lib$put_output LIB$PUT_OUTPUT -#define lib$rename_file LIB$RENAME_FILE -#define lib$reset_vm_zone LIB$RESET_VM_ZONE -#define lib$set_symbol LIB$SET_SYMBOL -#define lib$sfree1_dd LIB$SFREE1_DD -#define lib$show_vm LIB$SHOW_VM -#define lib$show_vm_zone LIB$SHOW_VM_ZONE -#define lib$spawn LIB$SPAWN -#define lib$stat_timer LIB$STAT_TIMER -#define lib$subx LIB$SUBX -#define lib$sub_times LIB$SUB_TIMES -#define lib$wait LIB$WAIT -#define mail$send_add_address MAIL$SEND_ADD_ADDRESS -#define mail$send_add_attribute MAIL$SEND_ADD_ATTRIBUTE -#define mail$send_add_bodypart MAIL$SEND_ADD_BODYPART -#define mail$send_begin MAIL$SEND_BEGIN -#define mail$send_end MAIL$SEND_END -#define mail$send_message MAIL$SEND_MESSAGE -#define ncs$convert NCS$CONVERT -#define ncs$get_cf NCS$GET_CF -#define objectClass OBJECTCLASS -#define objectClassRec OBJECTCLASSREC -#define overrideShellClassRec OVERRIDESHELLCLASSREC -#define overrideShellWidgetClass OVERRIDESHELLWIDGETCLASS -#define pthread_attr_create PTHREAD_ATTR_CREATE -#define pthread_attr_delete PTHREAD_ATTR_DELETE -#define pthread_attr_destroy PTHREAD_ATTR_DESTROY -#define pthread_attr_getdetach_np PTHREAD_ATTR_GETDETACH_NP -#define pthread_attr_getguardsize_np PTHREAD_ATTR_GETGUARDSIZE_NP -#define pthread_attr_getinheritsched PTHREAD_ATTR_GETINHERITSCHED -#define pthread_attr_getprio PTHREAD_ATTR_GETPRIO -#define pthread_attr_getsched PTHREAD_ATTR_GETSCHED -#define pthread_attr_getschedparam PTHREAD_ATTR_GETSCHEDPARAM -#define pthread_attr_getschedpolicy PTHREAD_ATTR_GETSCHEDPOLICY -#define pthread_attr_getstacksize PTHREAD_ATTR_GETSTACKSIZE -#define pthread_attr_init PTHREAD_ATTR_INIT -#define pthread_attr_setdetach_np PTHREAD_ATTR_SETDETACH_NP -#define pthread_attr_setdetachstate PTHREAD_ATTR_SETDETACHSTATE -#define pthread_attr_setguardsize_np PTHREAD_ATTR_SETGUARDSIZE_NP -#define pthread_attr_setinheritsched PTHREAD_ATTR_SETINHERITSCHED -#define pthread_attr_setprio PTHREAD_ATTR_SETPRIO -#define pthread_attr_setsched PTHREAD_ATTR_SETSCHED -#define pthread_attr_setschedparam PTHREAD_ATTR_SETSCHEDPARAM -#define pthread_attr_setschedpolicy PTHREAD_ATTR_SETSCHEDPOLICY -#ifndef pthread_attr_setscope -# define pthread_attr_setscope PTHREAD_ATTR_SETSCOPE -#endif -#define pthread_attr_setstacksize PTHREAD_ATTR_SETSTACKSIZE -#define pthread_cancel PTHREAD_CANCEL -#define pthread_cancel_e PTHREAD_CANCEL_E -#define pthread_cond_broadcast PTHREAD_COND_BROADCAST -#define pthread_cond_destroy PTHREAD_COND_DESTROY -#define pthread_cond_init PTHREAD_COND_INIT -#define pthread_cond_sig_preempt_int_np PTHREAD_COND_SIG_PREEMPT_INT_NP -#define pthread_cond_signal PTHREAD_COND_SIGNAL -#define pthread_cond_signal_int_np PTHREAD_COND_SIGNAL_INT_NP -#define pthread_cond_timedwait PTHREAD_COND_TIMEDWAIT -#define pthread_cond_wait PTHREAD_COND_WAIT -#define pthread_condattr_create PTHREAD_CONDATTR_CREATE -#define pthread_condattr_delete PTHREAD_CONDATTR_DELETE -#define pthread_condattr_init PTHREAD_CONDATTR_INIT -#define pthread_create PTHREAD_CREATE -#define pthread_delay_np PTHREAD_DELAY_NP -#define pthread_detach PTHREAD_DETACH -#define pthread_equal PTHREAD_EQUAL -#define pthread_exc_fetch_fp_np PTHREAD_EXC_FETCH_FP_NP -#define pthread_exc_handler_np PTHREAD_EXC_HANDLER_NP -#define pthread_exc_matches_np PTHREAD_EXC_MATCHES_NP -#define pthread_exc_pop_ctx_np PTHREAD_EXC_POP_CTX_NP -#define pthread_exc_push_ctx_np PTHREAD_EXC_PUSH_CTX_NP -#define pthread_exc_raise_np PTHREAD_EXC_RAISE_NP -#define pthread_exc_savecontext_np PTHREAD_EXC_SAVECONTEXT_NP -#define pthread_exit PTHREAD_EXIT -#define pthread_get_expiration_np PTHREAD_GET_EXPIRATION_NP -#define pthread_getprio PTHREAD_GETPRIO -#define pthread_getschedparam PTHREAD_GETSCHEDPARAM -#define pthread_getscheduler PTHREAD_GETSCHEDULER -#define pthread_getspecific PTHREAD_GETSPECIFIC -#define pthread_getunique_np PTHREAD_GETUNIQUE_NP -#define pthread_join PTHREAD_JOIN -#define pthread_join32 PTHREAD_JOIN32 -#define pthread_key_create PTHREAD_KEY_CREATE -#define pthread_key_delete PTHREAD_KEY_DELETE -#define pthread_keycreate PTHREAD_KEYCREATE -#define pthread_kill PTHREAD_KILL -#define pthread_lock_global_np PTHREAD_LOCK_GLOBAL_NP -#define pthread_mutex_destroy PTHREAD_MUTEX_DESTROY -#define pthread_mutex_init PTHREAD_MUTEX_INIT -#define pthread_mutex_lock PTHREAD_MUTEX_LOCK -#define pthread_mutex_trylock PTHREAD_MUTEX_TRYLOCK -#define pthread_mutex_unlock PTHREAD_MUTEX_UNLOCK -#define pthread_mutexattr_create PTHREAD_MUTEXATTR_CREATE -#define pthread_mutexattr_delete PTHREAD_MUTEXATTR_DELETE -#define pthread_mutexattr_destroy PTHREAD_MUTEXATTR_DESTROY -#define pthread_mutexattr_getkind_np PTHREAD_MUTEXATTR_GETKIND_NP -#define pthread_mutexattr_init PTHREAD_MUTEXATTR_INIT -#define pthread_mutexattr_setkind_np PTHREAD_MUTEXATTR_SETKIND_NP -#define pthread_mutexattr_settype_np PTHREAD_MUTEXATTR_SETTYPE_NP -#define pthread_once PTHREAD_ONCE -#define pthread_resume_np PTHREAD_RESUME_NP -#define pthread_self PTHREAD_SELF -#define pthread_setasynccancel PTHREAD_SETASYNCCANCEL -#define pthread_setcancel PTHREAD_SETCANCEL -#define pthread_setcancelstate PTHREAD_SETCANCELSTATE -#define pthread_setcanceltype PTHREAD_SETCANCELTYPE -#define pthread_setprio PTHREAD_SETPRIO -#define pthread_setschedparam PTHREAD_SETSCHEDPARAM -#define pthread_setscheduler PTHREAD_SETSCHEDULER -#define pthread_setspecific PTHREAD_SETSPECIFIC -#define pthread_suspend_np PTHREAD_SUSPEND_NP -#define pthread_testcancel PTHREAD_TESTCANCEL -#define pthread_unlock_global_np PTHREAD_UNLOCK_GLOBAL_NP -#define pthread_yield PTHREAD_YIELD -#define pthread_yield_np PTHREAD_YIELD_NP -#define rectObjClass RECTOBJCLASS -#define rectObjClassRec RECTOBJCLASSREC -#define sessionShellWidgetClass SESSIONSHELLWIDGETCLASS -#define shellWidgetClass SHELLWIDGETCLASS -#define shmat SHMAT -#define shmctl SHMCTL -#define shmdt SHMDT -#define shmget SHMGET -#define smg$create_key_table SMG$CREATE_KEY_TABLE -#define smg$create_virtual_keyboard SMG$CREATE_VIRTUAL_KEYBOARD -#define smg$read_composed_line SMG$READ_COMPOSED_LINE -#define sys$add_ident SYS$ADD_IDENT -#define sys$asctoid SYS$ASCTOID -#define sys$assign SYS$ASSIGN -#define sys$bintim SYS$BINTIM -#define sys$cancel SYS$CANCEL -#define sys$cantim SYS$CANTIM -#define sys$check_access SYS$CHECK_ACCESS -#define sys$close SYS$CLOSE -#define sys$connect SYS$CONNECT -#define sys$create SYS$CREATE -#define sys$create_user_profile SYS$CREATE_USER_PROFILE -#define sys$crembx SYS$CREMBX -#define sys$creprc SYS$CREPRC -#define sys$crmpsc SYS$CRMPSC -#define sys$dassgn SYS$DASSGN -#define sys$dclast SYS$DCLAST -#define sys$dclexh SYS$DCLEXH -#define sys$delprc SYS$DELPRC -#define sys$deq SYS$DEQ -#define sys$dgblsc SYS$DGBLSC -#define sys$display SYS$DISPLAY -#define sys$enq SYS$ENQ -#define sys$enqw SYS$ENQW -#define sys$erase SYS$ERASE -#define sys$fao SYS$FAO -#define sys$faol SYS$FAOL -#define sys$find_held SYS$FIND_HELD -#define sys$finish_rdb SYS$FINISH_RDB -#define sys$flush SYS$FLUSH -#define sys$forcex SYS$FORCEX -#define sys$get SYS$GET -#define sys$get_security SYS$GET_SECURITY -#define sys$getdviw SYS$GETDVIW -#define sys$getjpi SYS$GETJPI -#define sys$getjpiw SYS$GETJPIW -#define sys$getlkiw SYS$GETLKIW -#define sys$getmsg SYS$GETMSG -#define sys$getsyi SYS$GETSYI -#define sys$getsyiw SYS$GETSYIW -#define sys$gettim SYS$GETTIM -#define sys$getuai SYS$GETUAI -#define sys$grantid SYS$GRANTID -#define sys$hash_password SYS$HASH_PASSWORD -#define sys$hiber SYS$HIBER -#define sys$mgblsc SYS$MGBLSC -#define sys$numtim SYS$NUMTIM -#define sys$open SYS$OPEN -#define sys$parse SYS$PARSE -#define sys$parse_acl SYS$PARSE_ACL -#define sys$parse_acl SYS$PARSE_ACL -#define sys$persona_assume SYS$PERSONA_ASSUME -#define sys$persona_create SYS$PERSONA_CREATE -#define sys$persona_delete SYS$PERSONA_DELETE -#define sys$process_scan SYS$PROCESS_SCAN -#define sys$put SYS$PUT -#define sys$qio SYS$QIO -#define sys$qiow SYS$QIOW -#define sys$read SYS$READ -#define sys$resched SYS$RESCHED -#define sys$rewind SYS$REWIND -#define sys$search SYS$SEARCH -#define sys$set_security SYS$SET_SECURITY -#define sys$setast SYS$SETAST -#define sys$setef SYS$SETEF -#define sys$setimr SYS$SETIMR -#define sys$setpri SYS$SETPRI -#define sys$setprn SYS$SETPRN -#define sys$setprv SYS$SETPRV -#define sys$setswm SYS$SETSWM -#define sys$setuai SYS$SETUAI -#define sys$sndopr SYS$SNDOPR -#define sys$synch SYS$SYNCH -#define sys$trnlnm SYS$TRNLNM -#define sys$update SYS$UPDATE -#define sys$wake SYS$WAKE -#define sys$write SYS$WRITE -#define topLevelShellClassRec TOPLEVELSHELLCLASSREC -#define topLevelShellWidgetClass TOPLEVELSHELLWIDGETCLASS -#define transientShellWidgetClass TRANSIENTSHELLWIDGETCLASS -#define vendorShellClassRec VENDORSHELLCLASSREC -#define vendorShellWidgetClass VENDORSHELLWIDGETCLASS -#define widgetClass WIDGETCLASS -#define widgetClassRec WIDGETCLASSREC -#define wmShellClassRec WMSHELLCLASSREC -#define wmShellWidgetClass WMSHELLWIDGETCLASS -#define x$soft_ast_lib_lock X$SOFT_AST_LIB_LOCK -#define x$soft_ast_lock_depth X$SOFT_AST_LOCK_DEPTH -#define x$soft_reenable_asts X$SOFT_REENABLE_ASTS -#define xmArrowButtonWidgetClass XMARROWBUTTONWIDGETCLASS -#define xmBulletinBoardWidgetClass XMBULLETINBOARDWIDGETCLASS -#define xmCascadeButtonClassRec XMCASCADEBUTTONCLASSREC -#define xmCascadeButtonGadgetClass XMCASCADEBUTTONGADGETCLASS -#define xmCascadeButtonWidgetClass XMCASCADEBUTTONWIDGETCLASS -#define xmCommandWidgetClass XMCOMMANDWIDGETCLASS -#define xmDialogShellWidgetClass XMDIALOGSHELLWIDGETCLASS -#define xmDrawingAreaWidgetClass XMDRAWINGAREAWIDGETCLASS -#define xmDrawnButtonWidgetClass XMDRAWNBUTTONWIDGETCLASS -#define xmFileSelectionBoxWidgetClass XMFILESELECTIONBOXWIDGETCLASS -#define xmFormWidgetClass XMFORMWIDGETCLASS -#define xmFrameWidgetClass XMFRAMEWIDGETCLASS -#define xmGadgetClass XMGADGETCLASS -#define xmLabelGadgetClass XMLABELGADGETCLASS -#define xmLabelWidgetClass XMLABELWIDGETCLASS -#define xmListWidgetClass XMLISTWIDGETCLASS -#define xmMainWindowWidgetClass XMMAINWINDOWWIDGETCLASS -#define xmManagerClassRec XMMANAGERCLASSREC -#define xmManagerWidgetClass XMMANAGERWIDGETCLASS -#define xmMenuShellWidgetClass XMMENUSHELLWIDGETCLASS -#define xmMessageBoxWidgetClass XMMESSAGEBOXWIDGETCLASS -#define xmPrimitiveClassRec XMPRIMITIVECLASSREC -#define xmPrimitiveWidgetClass XMPRIMITIVEWIDGETCLASS -#define xmPushButtonClassRec XMPUSHBUTTONCLASSREC -#define xmPushButtonGadgetClass XMPUSHBUTTONGADGETCLASS -#define xmPushButtonWidgetClass XMPUSHBUTTONWIDGETCLASS -#define xmRowColumnWidgetClass XMROWCOLUMNWIDGETCLASS -#define xmSashWidgetClass XMSASHWIDGETCLASS -#define xmScaleWidgetClass XMSCALEWIDGETCLASS -#define xmScrollBarWidgetClass XMSCROLLBARWIDGETCLASS -#define xmScrolledWindowClassRec XMSCROLLEDWINDOWCLASSREC -#define xmScrolledWindowWidgetClass XMSCROLLEDWINDOWWIDGETCLASS -#define xmSeparatorGadgetClass XMSEPARATORGADGETCLASS -#define xmSeparatorWidgetClass XMSEPARATORWIDGETCLASS -#define xmTextFieldWidgetClass XMTEXTFIELDWIDGETCLASS -#define xmTextWidgetClass XMTEXTWIDGETCLASS -#define xmToggleButtonGadgetClass XMTOGGLEBUTTONGADGETCLASS -#define xmToggleButtonWidgetClass XMTOGGLEBUTTONWIDGETCLASS - -#if (__VMS_VER < 80200000) -# define SetReqLen(req,n,badlen) \ - if ((req->length + n) > (unsigned)65535) { \ - n = badlen; \ - req->length += n; \ - } else \ - req->length += n -#endif - -#ifdef __cplusplus -extern "C" { -#endif -extern void XtFree(char*); -#ifdef __cplusplus -} -#endif - -#endif diff --git a/wxWidgets/include/wx/volume.h b/wxWidgets/include/wx/volume.h deleted file mode 100644 index be44075332..0000000000 --- a/wxWidgets/include/wx/volume.h +++ /dev/null @@ -1,146 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/volume.h -// Purpose: wxFSVolume - encapsulates system volume information -// Author: George Policello -// Modified by: -// Created: 28 Jan 02 -// RCS-ID: $Id: volume.h 39399 2006-05-28 23:08:31Z ABX $ -// Copyright: (c) 2002 George Policello -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// ---------------------------------------------------------------------------- -// wxFSVolume represents a volume/drive/mount point in a file system -// ---------------------------------------------------------------------------- - -#ifndef _WX_FSVOLUME_H_ -#define _WX_FSVOLUME_H_ - -#include "wx/defs.h" - -#if wxUSE_FSVOLUME - -#include "wx/arrstr.h" - -// the volume flags -enum -{ - // is the volume mounted? - wxFS_VOL_MOUNTED = 0x0001, - - // is the volume removable (floppy, CD, ...)? - wxFS_VOL_REMOVABLE = 0x0002, - - // read only? (otherwise read write) - wxFS_VOL_READONLY = 0x0004, - - // network resources - wxFS_VOL_REMOTE = 0x0008 -}; - -// the volume types -enum wxFSVolumeKind -{ - wxFS_VOL_FLOPPY, - wxFS_VOL_DISK, - wxFS_VOL_CDROM, - wxFS_VOL_DVDROM, - wxFS_VOL_NETWORK, - wxFS_VOL_OTHER, - wxFS_VOL_MAX -}; - -class WXDLLIMPEXP_BASE wxFSVolumeBase -{ -public: - // return the array containing the names of the volumes - // - // only the volumes with the flags such that - // (flags & flagsSet) == flagsSet && !(flags & flagsUnset) - // are returned (by default, all mounted ones) - static wxArrayString GetVolumes(int flagsSet = wxFS_VOL_MOUNTED, - int flagsUnset = 0); - - // stop execution of GetVolumes() called previously (should be called from - // another thread, of course) - static void CancelSearch(); - - // create the volume object with this name (should be one of those returned - // by GetVolumes()). - wxFSVolumeBase(); - wxFSVolumeBase(const wxString& name); - bool Create(const wxString& name); - - // accessors - // --------- - - // is this a valid volume? - bool IsOk() const; - - // kind of this volume? - wxFSVolumeKind GetKind() const; - - // flags of this volume? - int GetFlags() const; - - // can we write to this volume? - bool IsWritable() const { return !(GetFlags() & wxFS_VOL_READONLY); } - - // get the name of the volume and the name which should be displayed to the - // user - wxString GetName() const { return m_volName; } - wxString GetDisplayName() const { return m_dispName; } - - // TODO: operatios (Mount(), Unmount(), Eject(), ...)? - -protected: - // the internal volume name - wxString m_volName; - - // the volume name as it is displayed to the user - wxString m_dispName; - - // have we been initialized correctly? - bool m_isOk; -}; - -#if wxUSE_GUI - -#include "wx/icon.h" -#include "wx/iconbndl.h" // only for wxIconArray - -enum wxFSIconType -{ - wxFS_VOL_ICO_SMALL = 0, - wxFS_VOL_ICO_LARGE, - wxFS_VOL_ICO_SEL_SMALL, - wxFS_VOL_ICO_SEL_LARGE, - wxFS_VOL_ICO_MAX -}; - -// wxFSVolume adds GetIcon() to wxFSVolumeBase -class WXDLLIMPEXP_CORE wxFSVolume : public wxFSVolumeBase -{ -public: - wxFSVolume() : wxFSVolumeBase() { InitIcons(); } - wxFSVolume(const wxString& name) : wxFSVolumeBase(name) { InitIcons(); } - - wxIcon GetIcon(wxFSIconType type) const; - -private: - void InitIcons(); - - // the different icons for this volume (created on demand) - wxIconArray m_icons; -}; - -#else // !wxUSE_GUI - -// wxFSVolume is the same thing as wxFSVolume in wxBase -typedef wxFSVolumeBase wxFSVolume; - -#endif // wxUSE_GUI/!wxUSE_GUI - -#endif // wxUSE_FSVOLUME - -#endif // _WX_FSVOLUME_H_ diff --git a/wxWidgets/include/wx/vscroll.h b/wxWidgets/include/wx/vscroll.h deleted file mode 100644 index 1d5d4e449e..0000000000 --- a/wxWidgets/include/wx/vscroll.h +++ /dev/null @@ -1,223 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: include/wx/vscroll.h -// Purpose: wxVScrolledWindow: generalization of wxScrolledWindow -// Author: Vadim Zeitlin -// Modified by: -// Created: 30.05.03 -// RCS-ID: $Id: vscroll.h 38917 2006-04-26 00:17:52Z VZ $ -// Copyright: (c) 2003 Vadim Zeitlin <vadim@wxwidgets.org> -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_VSCROLL_H_ -#define _WX_VSCROLL_H_ - -#include "wx/panel.h" // base class - -// ---------------------------------------------------------------------------- -// wxVScrolledWindow -// ---------------------------------------------------------------------------- - -/* - In the name of this class, "V" may stand for "variable" because it can be - used for scrolling lines of variable heights; "virtual" because it is not - necessary to know the heights of all lines in advance -- only those which - are shown on the screen need to be measured; or, even, "vertical" because - this class only supports scrolling in one direction currently (this could - and probably will change in the future however). - - In any case, this is a generalization of the wxScrolledWindow class which - can be only used when all lines have the same height. It lacks some other - wxScrolledWindow features however, notably it currently lacks support for - horizontal scrolling; it can't scroll another window nor only a rectangle - of the window and not its entire client area. - */ -class WXDLLEXPORT wxVScrolledWindow : public wxPanel -{ -public: - // constructors and such - // --------------------- - - // default ctor, you must call Create() later - wxVScrolledWindow() { Init(); } - - // normal ctor, no need to call Create() after this one - // - // note that wxVSCROLL is always automatically added to our style, there is - // no need to specify it explicitly - wxVScrolledWindow(wxWindow *parent, - wxWindowID id = wxID_ANY, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = 0, - const wxString& name = wxPanelNameStr) - { - Init(); - - (void)Create(parent, id, pos, size, style, name); - } - - // same as the previous ctor but returns status code: true if ok - // - // just as with the ctor above, wxVSCROLL style is always used, there is no - // need to specify it - bool Create(wxWindow *parent, - wxWindowID id = wxID_ANY, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = 0, - const wxString& name = wxPanelNameStr) - { - return wxPanel::Create(parent, id, pos, size, style | wxVSCROLL, name); - } - - - // operations - // ---------- - - // set the number of lines the window contains: the derived class must - // provide the heights for all lines with indices up to the one given here - // in its OnGetLineHeight() - void SetLineCount(size_t count); - - // scroll to the specified line: it will become the first visible line in - // the window - // - // return true if we scrolled the window, false if nothing was done - bool ScrollToLine(size_t line); - - // scroll by the specified number of lines/pages - virtual bool ScrollLines(int lines); - virtual bool ScrollPages(int pages); - - // redraw the specified line - virtual void RefreshLine(size_t line); - - // redraw all lines in the specified range (inclusive) - virtual void RefreshLines(size_t from, size_t to); - - // return the item at the specified (in physical coordinates) position or. - - // wxNOT_FOUND if none, i.e. if it is below the last item - int HitTest(wxCoord x, wxCoord y) const; - int HitTest(const wxPoint& pt) const { return HitTest(pt.x, pt.y); } - - // recalculate all our parameters and redisplay all lines - virtual void RefreshAll(); - - - // accessors - // --------- - - // get the number of lines this window contains (previously set by - // SetLineCount()) - size_t GetLineCount() const { return m_lineMax; } - - // get the first currently visible line - size_t GetVisibleBegin() const { return m_lineFirst; } - - // get the first currently visible line - size_t GetVisibleEnd() const { return m_lineFirst + m_nVisible; } - - // is this line currently visible? - bool IsVisible(size_t line) const - { return line >= GetVisibleBegin() && line < GetVisibleEnd(); } - - - // this is the same as GetVisibleBegin(), exists to match - // GetLastVisibleLine() and for backwards compatibility only - size_t GetFirstVisibleLine() const { return m_lineFirst; } - - // get the last currently visible line - // - // this function is unsafe as it returns (size_t)-1 (i.e. a huge positive - // number) if the control is empty, use GetVisibleEnd() instead, this one - // is kept for backwards compatibility - size_t GetLastVisibleLine() const { return GetVisibleEnd() - 1; } - - // layout the children (including the sizer if needed) - virtual bool Layout(); - -protected: - // this function must be overridden in the derived class and it should - // return the height of the given line in pixels - virtual wxCoord OnGetLineHeight(size_t n) const = 0; - - // this function doesn't have to be overridden but it may be useful to do - // it if calculating the lines heights is a relatively expensive operation - // as it gives the user code a possibility to calculate several of them at - // once - // - // OnGetLinesHint() is normally called just before OnGetLineHeight() but you - // shouldn't rely on the latter being called for all lines in the interval - // specified here. It is also possible that OnGetLineHeight() will be - // called for the lines outside of this interval, so this is really just a - // hint, not a promise. - // - // finally note that lineMin is inclusive, while lineMax is exclusive, as - // usual - virtual void OnGetLinesHint(size_t WXUNUSED(lineMin), - size_t WXUNUSED(lineMax)) const { } - - // when the number of lines changes, we try to estimate the total height - // of all lines which is a rather expensive operation in terms of lines - // access, so if the user code may estimate the average height - // better/faster than we do, it should override this function to implement - // its own logic - // - // this function should return the best guess for the total height it may - // make - virtual wxCoord EstimateTotalHeight() const; - - - // the event handlers - void OnSize(wxSizeEvent& event); - void OnScroll(wxScrollWinEvent& event); -#if wxUSE_MOUSEWHEEL - void OnMouseWheel(wxMouseEvent& event); -#endif - - // find the index of the line we need to show at the top of the window such - // that the last (fully or partially) visible line is the given one - size_t FindFirstFromBottom(size_t lineLast, bool fullyVisible = false); - - // get the total height of the lines between lineMin (inclusive) and - // lineMax (exclusive) - wxCoord GetLinesHeight(size_t lineMin, size_t lineMax) const; - - // update the thumb size shown by the scrollbar - void UpdateScrollbar(); - - // remove the scrollbar completely because we don't need it - void RemoveScrollbar(); - -private: - // common part of all ctors - void Init(); - - - // the total number of (logical) lines - size_t m_lineMax; - - // the total (estimated) height - wxCoord m_heightTotal; - - // the first currently visible line - size_t m_lineFirst; - - // the number of currently visible lines (including the last, possibly only - // partly, visible one) - size_t m_nVisible; - - // accumulated mouse wheel rotation -#if wxUSE_MOUSEWHEEL - int m_sumWheelRotation; -#endif - - DECLARE_EVENT_TABLE() - DECLARE_NO_COPY_CLASS(wxVScrolledWindow) - DECLARE_ABSTRACT_CLASS(wxVScrolledWindow) -}; - -#endif // _WX_VSCROLL_H_ - diff --git a/wxWidgets/include/wx/wave.h b/wxWidgets/include/wx/wave.h deleted file mode 100644 index 48414af795..0000000000 --- a/wxWidgets/include/wx/wave.h +++ /dev/null @@ -1,36 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/wave.h -// Purpose: wxSound compatibility header -// Author: Vaclav Slavik -// Modified by: -// Created: 2004/02/01 -// RCS-ID: $Id: wave.h 32852 2005-03-16 16:18:31Z ABX $ -// Copyright: (c) 2004, Vaclav Slavik -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_WAVE_H_BASE_ -#define _WX_WAVE_H_BASE_ - -#include "wx/defs.h" - -#if wxUSE_SOUND - -#if WXWIN_COMPATIBILITY_2_4 -#if defined(__DMC__) || defined(__BORLANDC__) - #pragma message "wx/wave.h header is deprecated, use wx/sound.h and wxSound" -#elif defined(__WATCOMC__) || defined(__VISUALC__) - #pragma message ("wx/wave.h header is deprecated, use wx/sound.h and wxSound") -#else - #warning "wx/wave.h header is deprecated, use wx/sound.h and wxSound" -#endif - #include "wx/sound.h" - // wxSound used to be called wxWave before wxWidgets 2.5.1: - typedef wxSound wxWave; -#else - #error "wx/wave.h is only available in compatibility mode" -#endif - -#endif - -#endif diff --git a/wxWidgets/include/wx/wfstream.h b/wxWidgets/include/wx/wfstream.h deleted file mode 100644 index f691c8179e..0000000000 --- a/wxWidgets/include/wx/wfstream.h +++ /dev/null @@ -1,204 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/wfstream.h -// Purpose: File stream classes -// Author: Guilhem Lavaux -// Modified by: -// Created: 11/07/98 -// RCS-ID: $Id: wfstream.h 61872 2009-09-09 22:37:05Z VZ $ -// Copyright: (c) Guilhem Lavaux -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_WXFSTREAM_H__ -#define _WX_WXFSTREAM_H__ - -#include "wx/defs.h" - -#if wxUSE_STREAMS - -#include "wx/object.h" -#include "wx/string.h" -#include "wx/stream.h" -#include "wx/file.h" -#include "wx/ffile.h" - -#if wxUSE_FILE - -// ---------------------------------------------------------------------------- -// wxFileStream using wxFile -// ---------------------------------------------------------------------------- - -class WXDLLIMPEXP_BASE wxFileInputStream : public wxInputStream -{ -public: - wxFileInputStream(const wxString& ifileName); - wxFileInputStream(wxFile& file); - wxFileInputStream(int fd); - virtual ~wxFileInputStream(); - - wxFileOffset GetLength() const; - - bool Ok() const { return IsOk(); } - virtual bool IsOk() const; - bool IsSeekable() const { return m_file->GetKind() == wxFILE_KIND_DISK; } - -protected: - wxFileInputStream(); - - size_t OnSysRead(void *buffer, size_t size); - wxFileOffset OnSysSeek(wxFileOffset pos, wxSeekMode mode); - wxFileOffset OnSysTell() const; - -protected: - wxFile *m_file; - bool m_file_destroy; - - DECLARE_NO_COPY_CLASS(wxFileInputStream) -}; - -class WXDLLIMPEXP_BASE wxFileOutputStream : public wxOutputStream -{ -public: - wxFileOutputStream(const wxString& fileName); - wxFileOutputStream(wxFile& file); - wxFileOutputStream(int fd); - virtual ~wxFileOutputStream(); - - void Sync(); - bool Close() { return m_file_destroy ? m_file->Close() : true; } - wxFileOffset GetLength() const; - - bool Ok() const { return IsOk(); } - virtual bool IsOk() const; - bool IsSeekable() const { return m_file->GetKind() == wxFILE_KIND_DISK; } - -protected: - wxFileOutputStream(); - - size_t OnSysWrite(const void *buffer, size_t size); - wxFileOffset OnSysSeek(wxFileOffset pos, wxSeekMode mode); - wxFileOffset OnSysTell() const; - -protected: - wxFile *m_file; - bool m_file_destroy; - - DECLARE_NO_COPY_CLASS(wxFileOutputStream) -}; - -class WXDLLIMPEXP_BASE wxTempFileOutputStream : public wxOutputStream -{ -public: - wxTempFileOutputStream(const wxString& fileName); - virtual ~wxTempFileOutputStream(); - - bool Close() { return Commit(); } - virtual bool Commit() { return m_file->Commit(); } - virtual void Discard() { m_file->Discard(); } - - wxFileOffset GetLength() const { return m_file->Length(); } - bool IsSeekable() const { return true; } - -protected: - size_t OnSysWrite(const void *buffer, size_t size); - wxFileOffset OnSysSeek(wxFileOffset pos, wxSeekMode mode) - { return m_file->Seek(pos, mode); } - wxFileOffset OnSysTell() const { return m_file->Tell(); } - -private: - wxTempFile *m_file; - - DECLARE_NO_COPY_CLASS(wxTempFileOutputStream) -}; - -class WXDLLIMPEXP_BASE wxFileStream : public wxFileInputStream, - public wxFileOutputStream -{ -public: - wxFileStream(const wxString& fileName); - -private: - DECLARE_NO_COPY_CLASS(wxFileStream) -}; - -#endif //wxUSE_FILE - -#if wxUSE_FFILE - -// ---------------------------------------------------------------------------- -// wxFFileStream using wxFFile -// ---------------------------------------------------------------------------- - -class WXDLLIMPEXP_BASE wxFFileInputStream : public wxInputStream -{ -public: - wxFFileInputStream(const wxString& fileName, const wxChar *mode = wxT("rb")); - wxFFileInputStream(wxFFile& file); - wxFFileInputStream(FILE *file); - virtual ~wxFFileInputStream(); - - wxFileOffset GetLength() const; - - bool Ok() const { return IsOk(); } - virtual bool IsOk() const; - bool IsSeekable() const { return m_file->GetKind() == wxFILE_KIND_DISK; } - -protected: - wxFFileInputStream(); - - size_t OnSysRead(void *buffer, size_t size); - wxFileOffset OnSysSeek(wxFileOffset pos, wxSeekMode mode); - wxFileOffset OnSysTell() const; - -protected: - wxFFile *m_file; - bool m_file_destroy; - - DECLARE_NO_COPY_CLASS(wxFFileInputStream) -}; - -class WXDLLIMPEXP_BASE wxFFileOutputStream : public wxOutputStream -{ -public: - wxFFileOutputStream(const wxString& fileName, const wxChar *mode = wxT("w+b")); - wxFFileOutputStream(wxFFile& file); - wxFFileOutputStream(FILE *file); - virtual ~wxFFileOutputStream(); - - void Sync(); - bool Close() { return m_file_destroy ? m_file->Close() : true; } - wxFileOffset GetLength() const; - - bool Ok() const { return IsOk(); } - virtual bool IsOk() const ; - bool IsSeekable() const { return m_file->GetKind() == wxFILE_KIND_DISK; } - -protected: - wxFFileOutputStream(); - - size_t OnSysWrite(const void *buffer, size_t size); - wxFileOffset OnSysSeek(wxFileOffset pos, wxSeekMode mode); - wxFileOffset OnSysTell() const; - -protected: - wxFFile *m_file; - bool m_file_destroy; - - DECLARE_NO_COPY_CLASS(wxFFileOutputStream) -}; - -class WXDLLIMPEXP_BASE wxFFileStream : public wxFFileInputStream, - public wxFFileOutputStream -{ -public: - wxFFileStream(const wxString& fileName); - -private: - DECLARE_NO_COPY_CLASS(wxFFileStream) -}; - -#endif //wxUSE_FFILE - -#endif // wxUSE_STREAMS - -#endif // _WX_WXFSTREAM_H__ diff --git a/wxWidgets/include/wx/window.h b/wxWidgets/include/wx/window.h deleted file mode 100644 index 54dc38d890..0000000000 --- a/wxWidgets/include/wx/window.h +++ /dev/null @@ -1,1671 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: wx/window.h -// Purpose: wxWindowBase class - the interface of wxWindow -// Author: Vadim Zeitlin -// Modified by: Ron Lee -// Created: 01/02/97 -// RCS-ID: $Id: window.h 56758 2008-11-13 22:32:21Z VS $ -// Copyright: (c) Vadim Zeitlin -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_WINDOW_H_BASE_ -#define _WX_WINDOW_H_BASE_ - -// ---------------------------------------------------------------------------- -// headers which we must include here -// ---------------------------------------------------------------------------- - -#include "wx/event.h" // the base class - -#include "wx/list.h" // defines wxWindowList - -#include "wx/cursor.h" // we have member variables of these classes -#include "wx/font.h" // so we can't do without them -#include "wx/colour.h" -#include "wx/region.h" -#include "wx/utils.h" -#include "wx/intl.h" - -#include "wx/validate.h" // for wxDefaultValidator (always include it) - -#if wxUSE_PALETTE - #include "wx/palette.h" -#endif // wxUSE_PALETTE - -#if wxUSE_ACCEL - #include "wx/accel.h" -#endif // wxUSE_ACCEL - -#if wxUSE_ACCESSIBILITY -#include "wx/access.h" -#endif - -// when building wxUniv/Foo we don't want the code for native menu use to be -// compiled in - it should only be used when building real wxFoo -#ifdef __WXUNIVERSAL__ - #define wxUSE_MENUS_NATIVE 0 -#else // !__WXUNIVERSAL__ - #define wxUSE_MENUS_NATIVE wxUSE_MENUS -#endif // __WXUNIVERSAL__/!__WXUNIVERSAL__ - -// ---------------------------------------------------------------------------- -// forward declarations -// ---------------------------------------------------------------------------- - -class WXDLLIMPEXP_FWD_CORE wxCaret; -class WXDLLIMPEXP_FWD_CORE wxControl; -class WXDLLIMPEXP_FWD_CORE wxCursor; -class WXDLLIMPEXP_FWD_CORE wxDC; -class WXDLLIMPEXP_FWD_CORE wxDropTarget; -class WXDLLIMPEXP_FWD_CORE wxItemResource; -class WXDLLIMPEXP_FWD_CORE wxLayoutConstraints; -class WXDLLIMPEXP_FWD_CORE wxResourceTable; -class WXDLLIMPEXP_FWD_CORE wxSizer; -class WXDLLIMPEXP_FWD_CORE wxToolTip; -class WXDLLIMPEXP_FWD_CORE wxWindowBase; -class WXDLLIMPEXP_FWD_CORE wxWindow; -class WXDLLIMPEXP_FWD_CORE wxScrollHelper; - -#if wxUSE_ACCESSIBILITY -class WXDLLIMPEXP_FWD_CORE wxAccessible; -#endif - -// ---------------------------------------------------------------------------- -// helper stuff used by wxWindow -// ---------------------------------------------------------------------------- - -// struct containing all the visual attributes of a control -struct WXDLLEXPORT wxVisualAttributes -{ - // the font used for control label/text inside it - wxFont font; - - // the foreground colour - wxColour colFg; - - // the background colour, may be wxNullColour if the controls background - // colour is not solid - wxColour colBg; -}; - -// different window variants, on platforms like eg mac uses different -// rendering sizes -enum wxWindowVariant -{ - wxWINDOW_VARIANT_NORMAL, // Normal size - wxWINDOW_VARIANT_SMALL, // Smaller size (about 25 % smaller than normal) - wxWINDOW_VARIANT_MINI, // Mini size (about 33 % smaller than normal) - wxWINDOW_VARIANT_LARGE, // Large size (about 25 % larger than normal) - wxWINDOW_VARIANT_MAX -}; - -#if wxUSE_SYSTEM_OPTIONS - #define wxWINDOW_DEFAULT_VARIANT wxT("window-default-variant") -#endif - -// ---------------------------------------------------------------------------- -// (pseudo)template list classes -// ---------------------------------------------------------------------------- - -WX_DECLARE_LIST_3(wxWindow, wxWindowBase, wxWindowList, wxWindowListNode, class WXDLLEXPORT); - -// ---------------------------------------------------------------------------- -// global variables -// ---------------------------------------------------------------------------- - -extern WXDLLEXPORT_DATA(wxWindowList) wxTopLevelWindows; -extern WXDLLIMPEXP_DATA_CORE(wxList) wxPendingDelete; - -// ---------------------------------------------------------------------------- -// wxWindowBase is the base class for all GUI controls/widgets, this is the public -// interface of this class. -// -// Event handler: windows have themselves as their event handlers by default, -// but their event handlers could be set to another object entirely. This -// separation can reduce the amount of derivation required, and allow -// alteration of a window's functionality (e.g. by a resource editor that -// temporarily switches event handlers). -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxWindowBase : public wxEvtHandler -{ -public: - // creating the window - // ------------------- - - // default ctor, initializes everything which can be initialized before - // Create() - wxWindowBase() ; - - // pseudo ctor (can't be virtual, called from ctor) - bool CreateBase(wxWindowBase *parent, - wxWindowID winid, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = 0, - const wxValidator& validator = wxDefaultValidator, - const wxString& name = wxPanelNameStr); - - virtual ~wxWindowBase(); - - // deleting the window - // ------------------- - - // ask the window to close itself, return true if the event handler - // honoured our request - bool Close( bool force = false ); - - // the following functions delete the C++ objects (the window itself - // or its children) as well as the GUI windows and normally should - // never be used directly - - // delete window unconditionally (dangerous!), returns true if ok - virtual bool Destroy(); - // delete all children of this window, returns true if ok - bool DestroyChildren(); - - // is the window being deleted? - bool IsBeingDeleted() const { return m_isBeingDeleted; } - - // window attributes - // ----------------- - - // label is just the same as the title (but for, e.g., buttons it - // makes more sense to speak about labels), title access - // is available from wxTLW classes only (frames, dialogs) - virtual void SetLabel(const wxString& label) = 0; - virtual wxString GetLabel() const = 0; - - // the window name is used for ressource setting in X, it is not the - // same as the window title/label - virtual void SetName( const wxString &name ) { m_windowName = name; } - virtual wxString GetName() const { return m_windowName; } - - // sets the window variant, calls internally DoSetVariant if variant - // has changed - void SetWindowVariant(wxWindowVariant variant); - wxWindowVariant GetWindowVariant() const { return m_windowVariant; } - - - // window id uniquely identifies the window among its siblings unless - // it is wxID_ANY which means "don't care" - void SetId( wxWindowID winid ) { m_windowId = winid; } - wxWindowID GetId() const { return m_windowId; } - - // get or change the layout direction (LTR or RTL) for this window, - // wxLayout_Default is returned if layout direction is not supported - virtual wxLayoutDirection GetLayoutDirection() const - { return wxLayout_Default; } - virtual void SetLayoutDirection(wxLayoutDirection WXUNUSED(dir)) - { } - - // mirror coordinates for RTL layout if this window uses it and if the - // mirroring is not done automatically like Win32 - virtual wxCoord AdjustForLayoutDirection(wxCoord x, - wxCoord width, - wxCoord widthTotal) const; - - // generate a control id for the controls which were not given one by - // user - static int NewControlId() { return --ms_lastControlId; } - // get the id of the control following the one with the given - // (autogenerated) id - static int NextControlId(int winid) { return winid - 1; } - // get the id of the control preceding the one with the given - // (autogenerated) id - static int PrevControlId(int winid) { return winid + 1; } - - // moving/resizing - // --------------- - - // set the window size and/or position - void SetSize( int x, int y, int width, int height, - int sizeFlags = wxSIZE_AUTO ) - { DoSetSize(x, y, width, height, sizeFlags); } - - void SetSize( int width, int height ) - { DoSetSize( wxDefaultCoord, wxDefaultCoord, width, height, wxSIZE_USE_EXISTING ); } - - void SetSize( const wxSize& size ) - { SetSize( size.x, size.y); } - - void SetSize(const wxRect& rect, int sizeFlags = wxSIZE_AUTO) - { DoSetSize(rect.x, rect.y, rect.width, rect.height, sizeFlags); } - - void Move(int x, int y, int flags = wxSIZE_USE_EXISTING) - { DoSetSize(x, y, wxDefaultCoord, wxDefaultCoord, flags); } - - void Move(const wxPoint& pt, int flags = wxSIZE_USE_EXISTING) - { Move(pt.x, pt.y, flags); } - - void SetPosition(const wxPoint& pt) { Move(pt); } - - // Z-order - virtual void Raise() = 0; - virtual void Lower() = 0; - - // client size is the size of area available for subwindows - void SetClientSize( int width, int height ) - { DoSetClientSize(width, height); } - - void SetClientSize( const wxSize& size ) - { DoSetClientSize(size.x, size.y); } - - void SetClientSize(const wxRect& rect) - { SetClientSize( rect.width, rect.height ); } - - // get the window position (pointers may be NULL): notice that it is in - // client coordinates for child windows and screen coordinates for the - // top level ones, use GetScreenPosition() if you need screen - // coordinates for all kinds of windows - void GetPosition( int *x, int *y ) const { DoGetPosition(x, y); } - wxPoint GetPosition() const - { - int x, y; - DoGetPosition(&x, &y); - - return wxPoint(x, y); - } - - // get the window position in screen coordinates - void GetScreenPosition(int *x, int *y) const { DoGetScreenPosition(x, y); } - wxPoint GetScreenPosition() const - { - int x, y; - DoGetScreenPosition(&x, &y); - - return wxPoint(x, y); - } - - // get the window size (pointers may be NULL) - void GetSize( int *w, int *h ) const { DoGetSize(w, h); } - wxSize GetSize() const - { - int w, h; - DoGetSize(& w, & h); - return wxSize(w, h); - } - - void GetClientSize( int *w, int *h ) const { DoGetClientSize(w, h); } - wxSize GetClientSize() const - { - int w, h; - DoGetClientSize(&w, &h); - - return wxSize(w, h); - } - - // get the position and size at once - wxRect GetRect() const - { - int x, y, w, h; - GetPosition(&x, &y); - GetSize(&w, &h); - - return wxRect(x, y, w, h); - } - - wxRect GetScreenRect() const - { - int x, y, w, h; - GetScreenPosition(&x, &y); - GetSize(&w, &h); - - return wxRect(x, y, w, h); - } - - // get the origin of the client area of the window relative to the - // window top left corner (the client area may be shifted because of - // the borders, scrollbars, other decorations...) - virtual wxPoint GetClientAreaOrigin() const; - - // get the client rectangle in window (i.e. client) coordinates - wxRect GetClientRect() const - { - return wxRect(GetClientAreaOrigin(), GetClientSize()); - } - -#if wxABI_VERSION >= 20808 - // client<->window size conversion - wxSize ClientToWindowSize(const wxSize& size) const; - wxSize WindowToClientSize(const wxSize& size) const; -#endif - - // get the size best suited for the window (in fact, minimal - // acceptable size using which it will still look "nice" in - // most situations) - wxSize GetBestSize() const - { - if (m_bestSizeCache.IsFullySpecified()) - return m_bestSizeCache; - return DoGetBestSize(); - } - void GetBestSize(int *w, int *h) const - { - wxSize s = GetBestSize(); - if ( w ) - *w = s.x; - if ( h ) - *h = s.y; - } - - void SetScrollHelper( wxScrollHelper *sh ) { m_scrollHelper = sh; } - wxScrollHelper *GetScrollHelper() { return m_scrollHelper; } - - // reset the cached best size value so it will be recalculated the - // next time it is needed. - void InvalidateBestSize(); - void CacheBestSize(const wxSize& size) const - { wxConstCast(this, wxWindowBase)->m_bestSizeCache = size; } - - - // This function will merge the window's best size into the window's - // minimum size, giving priority to the min size components, and - // returns the results. - wxSize GetEffectiveMinSize() const; - wxDEPRECATED( wxSize GetBestFittingSize() const ); // replaced by GetEffectiveMinSize - wxDEPRECATED( wxSize GetAdjustedMinSize() const ); // replaced by GetEffectiveMinSize - - // A 'Smart' SetSize that will fill in default size values with 'best' - // size. Sets the minsize to what was passed in. - void SetInitialSize(const wxSize& size=wxDefaultSize); - wxDEPRECATED( void SetBestFittingSize(const wxSize& size=wxDefaultSize) ); // replaced by SetInitialSize - - - // the generic centre function - centers the window on parent by` - // default or on screen if it doesn't have parent or - // wxCENTER_ON_SCREEN flag is given - void Centre(int dir = wxBOTH) { DoCentre(dir); } - void Center(int dir = wxBOTH) { DoCentre(dir); } - - // centre with respect to the the parent window - void CentreOnParent(int dir = wxBOTH) { DoCentre(dir); } - void CenterOnParent(int dir = wxBOTH) { CentreOnParent(dir); } - - // set window size to wrap around its children - virtual void Fit(); - - // set virtual size to satisfy children - virtual void FitInside(); - - - // SetSizeHints is actually for setting the size hints - // for the wxTLW for a Window Manager - hence the name - - // and it is therefore overridden in wxTLW to do that. - // In wxWindow(Base), it has (unfortunately) been abused - // to mean the same as SetMinSize() and SetMaxSize(). - - virtual void SetSizeHints( int minW, int minH, - int maxW = wxDefaultCoord, int maxH = wxDefaultCoord, - int incW = wxDefaultCoord, int incH = wxDefaultCoord ) - { DoSetSizeHints(minW, minH, maxW, maxH, incW, incH); } - - void SetSizeHints( const wxSize& minSize, - const wxSize& maxSize=wxDefaultSize, - const wxSize& incSize=wxDefaultSize) - { DoSetSizeHints(minSize.x, minSize.y, maxSize.x, maxSize.y, incSize.x, incSize.y); } - - virtual void DoSetSizeHints( int minW, int minH, - int maxW, int maxH, - int incW, int incH ); - - // Methods for setting virtual size hints - // FIXME: What are virtual size hints? - - virtual void SetVirtualSizeHints( int minW, int minH, - int maxW = wxDefaultCoord, int maxH = wxDefaultCoord ); - void SetVirtualSizeHints( const wxSize& minSize, - const wxSize& maxSize=wxDefaultSize) - { - SetVirtualSizeHints(minSize.x, minSize.y, maxSize.x, maxSize.y); - } - - - // Call these to override what GetBestSize() returns. This - // method is only virtual because it is overriden in wxTLW - // as a different API for SetSizeHints(). - virtual void SetMinSize(const wxSize& minSize) { m_minWidth = minSize.x; m_minHeight = minSize.y; } - virtual void SetMaxSize(const wxSize& maxSize) { m_maxWidth = maxSize.x; m_maxHeight = maxSize.y; } - - // Override these methods to impose restrictions on min/max size. - // The easier way is to call SetMinSize() and SetMaxSize() which - // will have the same effect. Doing both is non-sense. - virtual wxSize GetMinSize() const { return wxSize(m_minWidth, m_minHeight); } - virtual wxSize GetMaxSize() const { return wxSize(m_maxWidth, m_maxHeight); } - - // Get the min and max values one by one - int GetMinWidth() const { return GetMinSize().x; } - int GetMinHeight() const { return GetMinSize().y; } - int GetMaxWidth() const { return GetMaxSize().x; } - int GetMaxHeight() const { return GetMaxSize().y; } - - - // Methods for accessing the virtual size of a window. For most - // windows this is just the client area of the window, but for - // some like scrolled windows it is more or less independent of - // the screen window size. You may override the DoXXXVirtual - // methods below for classes where that is is the case. - - void SetVirtualSize( const wxSize &size ) { DoSetVirtualSize( size.x, size.y ); } - void SetVirtualSize( int x, int y ) { DoSetVirtualSize( x, y ); } - - wxSize GetVirtualSize() const { return DoGetVirtualSize(); } - void GetVirtualSize( int *x, int *y ) const - { - wxSize s( DoGetVirtualSize() ); - - if( x ) - *x = s.GetWidth(); - if( y ) - *y = s.GetHeight(); - } - - // Override these methods for windows that have a virtual size - // independent of their client size. eg. the virtual area of a - // wxScrolledWindow. - - virtual void DoSetVirtualSize( int x, int y ); - virtual wxSize DoGetVirtualSize() const; - - // Return the largest of ClientSize and BestSize (as determined - // by a sizer, interior children, or other means) - - virtual wxSize GetBestVirtualSize() const - { - wxSize client( GetClientSize() ); - wxSize best( GetBestSize() ); - - return wxSize( wxMax( client.x, best.x ), wxMax( client.y, best.y ) ); - } - - // return the size of the left/right and top/bottom borders in x and y - // components of the result respectively - virtual wxSize GetWindowBorderSize() const; - - - // window state - // ------------ - - // returns true if window was shown/hidden, false if the nothing was - // done (window was already shown/hidden) - virtual bool Show( bool show = true ); - bool Hide() { return Show(false); } - - // returns true if window was enabled/disabled, false if nothing done - virtual bool Enable( bool enable = true ); - bool Disable() { return Enable(false); } - - virtual bool IsShown() const { return m_isShown; } - virtual bool IsEnabled() const { return m_isEnabled; } - - // returns true if the window is visible, i.e. IsShown() returns true - // if called on it and all its parents up to the first TLW - virtual bool IsShownOnScreen() const; - - // get/set window style (setting style won't update the window and so - // is only useful for internal usage) - virtual void SetWindowStyleFlag( long style ) { m_windowStyle = style; } - virtual long GetWindowStyleFlag() const { return m_windowStyle; } - - // just some (somewhat shorter) synonims - void SetWindowStyle( long style ) { SetWindowStyleFlag(style); } - long GetWindowStyle() const { return GetWindowStyleFlag(); } - - // check if the flag is set - bool HasFlag(int flag) const { return (m_windowStyle & flag) != 0; } - virtual bool IsRetained() const { return HasFlag(wxRETAINED); } - - // turn the flag on if it had been turned off before and vice versa, - // return true if the flag is currently turned on - bool ToggleWindowStyle(int flag); - - // extra style: the less often used style bits which can't be set with - // SetWindowStyleFlag() - virtual void SetExtraStyle(long exStyle) { m_exStyle = exStyle; } - long GetExtraStyle() const { return m_exStyle; } - - // make the window modal (all other windows unresponsive) - virtual void MakeModal(bool modal = true); - - - // (primitive) theming support - // --------------------------- - - virtual void SetThemeEnabled(bool enableTheme) { m_themeEnabled = enableTheme; } - virtual bool GetThemeEnabled() const { return m_themeEnabled; } - - - // focus and keyboard handling - // --------------------------- - - // set focus to this window - virtual void SetFocus() = 0; - - // set focus to this window as the result of a keyboard action - virtual void SetFocusFromKbd() { SetFocus(); } - - // return the window which currently has the focus or NULL - static wxWindow *FindFocus(); - - static wxWindow *DoFindFocus() /* = 0: implement in derived classes */; - - // can this window have focus? - virtual bool AcceptsFocus() const { return IsShown() && IsEnabled(); } - - // can this window be given focus by keyboard navigation? if not, the - // only way to give it focus (provided it accepts it at all) is to - // click it - virtual bool AcceptsFocusFromKeyboard() const { return AcceptsFocus(); } - - // navigates in the specified direction by sending a wxNavigationKeyEvent - virtual bool Navigate(int flags = wxNavigationKeyEvent::IsForward); - - // move this window just before/after the specified one in tab order - // (the other window must be our sibling!) - void MoveBeforeInTabOrder(wxWindow *win) - { DoMoveInTabOrder(win, MoveBefore); } - void MoveAfterInTabOrder(wxWindow *win) - { DoMoveInTabOrder(win, MoveAfter); } - - - // parent/children relations - // ------------------------- - - // get the list of children - const wxWindowList& GetChildren() const { return m_children; } - wxWindowList& GetChildren() { return m_children; } - - // needed just for extended runtime - const wxWindowList& GetWindowChildren() const { return GetChildren() ; } - -#if wxABI_VERSION >= 20808 - // get the window before/after this one in the parents children list, - // returns NULL if this is the first/last window - wxWindow *GetPrevSibling() const { return DoGetSibling(MoveBefore); } - wxWindow *GetNextSibling() const { return DoGetSibling(MoveAfter); } -#endif // wx 2.8.8+ - - // get the parent or the parent of the parent - wxWindow *GetParent() const { return m_parent; } - inline wxWindow *GetGrandParent() const; - - // is this window a top level one? - virtual bool IsTopLevel() const; - - // it doesn't really change parent, use Reparent() instead - void SetParent( wxWindowBase *parent ) { m_parent = (wxWindow *)parent; } - // change the real parent of this window, return true if the parent - // was changed, false otherwise (error or newParent == oldParent) - virtual bool Reparent( wxWindowBase *newParent ); - - // implementation mostly - virtual void AddChild( wxWindowBase *child ); - virtual void RemoveChild( wxWindowBase *child ); - - // looking for windows - // ------------------- - - // find window among the descendants of this one either by id or by - // name (return NULL if not found) - wxWindow *FindWindow(long winid) const; - wxWindow *FindWindow(const wxString& name) const; - - // Find a window among any window (all return NULL if not found) - static wxWindow *FindWindowById( long winid, const wxWindow *parent = NULL ); - static wxWindow *FindWindowByName( const wxString& name, - const wxWindow *parent = NULL ); - static wxWindow *FindWindowByLabel( const wxString& label, - const wxWindow *parent = NULL ); - - // event handler stuff - // ------------------- - - // get the current event handler - wxEvtHandler *GetEventHandler() const { return m_eventHandler; } - - // replace the event handler (allows to completely subclass the - // window) - void SetEventHandler( wxEvtHandler *handler ) { m_eventHandler = handler; } - - // push/pop event handler: allows to chain a custom event handler to - // alreasy existing ones - void PushEventHandler( wxEvtHandler *handler ); - wxEvtHandler *PopEventHandler( bool deleteHandler = false ); - - // find the given handler in the event handler chain and remove (but - // not delete) it from the event handler chain, return true if it was - // found and false otherwise (this also results in an assert failure so - // this function should only be called when the handler is supposed to - // be there) - bool RemoveEventHandler(wxEvtHandler *handler); - - // validators - // ---------- - -#if wxUSE_VALIDATORS - // a window may have an associated validator which is used to control - // user input - virtual void SetValidator( const wxValidator &validator ); - virtual wxValidator *GetValidator() { return m_windowValidator; } -#endif // wxUSE_VALIDATORS - - - // dialog oriented functions - // ------------------------- - - // validate the correctness of input, return true if ok - virtual bool Validate(); - - // transfer data between internal and GUI representations - virtual bool TransferDataToWindow(); - virtual bool TransferDataFromWindow(); - - virtual void InitDialog(); - -#if wxUSE_ACCEL - // accelerators - // ------------ - virtual void SetAcceleratorTable( const wxAcceleratorTable& accel ) - { m_acceleratorTable = accel; } - wxAcceleratorTable *GetAcceleratorTable() - { return &m_acceleratorTable; } - -#endif // wxUSE_ACCEL - -#if wxUSE_HOTKEY - // hot keys (system wide accelerators) - // ----------------------------------- - - virtual bool RegisterHotKey(int hotkeyId, int modifiers, int keycode); - virtual bool UnregisterHotKey(int hotkeyId); -#endif // wxUSE_HOTKEY - - - // dialog units translations - // ------------------------- - - wxPoint ConvertPixelsToDialog( const wxPoint& pt ); - wxPoint ConvertDialogToPixels( const wxPoint& pt ); - wxSize ConvertPixelsToDialog( const wxSize& sz ) - { - wxPoint pt(ConvertPixelsToDialog(wxPoint(sz.x, sz.y))); - - return wxSize(pt.x, pt.y); - } - - wxSize ConvertDialogToPixels( const wxSize& sz ) - { - wxPoint pt(ConvertDialogToPixels(wxPoint(sz.x, sz.y))); - - return wxSize(pt.x, pt.y); - } - - // mouse functions - // --------------- - - // move the mouse to the specified position - virtual void WarpPointer(int x, int y) = 0; - - // start or end mouse capture, these functions maintain the stack of - // windows having captured the mouse and after calling ReleaseMouse() - // the mouse is not released but returns to the window which had had - // captured it previously (if any) - void CaptureMouse(); - void ReleaseMouse(); - - // get the window which currently captures the mouse or NULL - static wxWindow *GetCapture(); - - // does this window have the capture? - virtual bool HasCapture() const - { return (wxWindow *)this == GetCapture(); } - - // painting the window - // ------------------- - - // mark the specified rectangle (or the whole window) as "dirty" so it - // will be repainted - virtual void Refresh( bool eraseBackground = true, - const wxRect *rect = (const wxRect *) NULL ) = 0; - - // a less awkward wrapper for Refresh - void RefreshRect(const wxRect& rect, bool eraseBackground = true) - { - Refresh(eraseBackground, &rect); - } - - // repaint all invalid areas of the window immediately - virtual void Update() { } - - // clear the window background - virtual void ClearBackground(); - - // freeze the window: don't redraw it until it is thawed - virtual void Freeze() { } - - // thaw the window: redraw it after it had been frozen - virtual void Thaw() { } - - // return true if window had been frozen and not unthawed yet - virtual bool IsFrozen() const { return false; } - - // adjust DC for drawing on this window - virtual void PrepareDC( wxDC & WXUNUSED(dc) ) { } - - // return true if the window contents is double buffered by the system - virtual bool IsDoubleBuffered() const { return false; } - - // the update region of the window contains the areas which must be - // repainted by the program - const wxRegion& GetUpdateRegion() const { return m_updateRegion; } - wxRegion& GetUpdateRegion() { return m_updateRegion; } - - // get the update rectangleregion bounding box in client coords - wxRect GetUpdateClientRect() const; - - // these functions verify whether the given point/rectangle belongs to - // (or at least intersects with) the update region - virtual bool DoIsExposed( int x, int y ) const; - virtual bool DoIsExposed( int x, int y, int w, int h ) const; - - bool IsExposed( int x, int y ) const - { return DoIsExposed(x, y); } - bool IsExposed( int x, int y, int w, int h ) const - { return DoIsExposed(x, y, w, h); } - bool IsExposed( const wxPoint& pt ) const - { return DoIsExposed(pt.x, pt.y); } - bool IsExposed( const wxRect& rect ) const - { return DoIsExposed(rect.x, rect.y, rect.width, rect.height); } - - // colours, fonts and cursors - // -------------------------- - - // get the default attributes for the controls of this class: we - // provide a virtual function which can be used to query the default - // attributes of an existing control and a static function which can - // be used even when no existing object of the given class is - // available, but which won't return any styles specific to this - // particular control, of course (e.g. "Ok" button might have - // different -- bold for example -- font) - virtual wxVisualAttributes GetDefaultAttributes() const - { - return GetClassDefaultAttributes(GetWindowVariant()); - } - - static wxVisualAttributes - GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL); - - // set/retrieve the window colours (system defaults are used by - // default): SetXXX() functions return true if colour was changed, - // SetDefaultXXX() reset the "m_inheritXXX" flag after setting the - // value to prevent it from being inherited by our children - virtual bool SetBackgroundColour(const wxColour& colour); - void SetOwnBackgroundColour(const wxColour& colour) - { - if ( SetBackgroundColour(colour) ) - m_inheritBgCol = false; - } - wxColour GetBackgroundColour() const; - bool InheritsBackgroundColour() const - { - return m_inheritBgCol; - } - bool UseBgCol() const - { - return m_hasBgCol; - } - - virtual bool SetForegroundColour(const wxColour& colour); - void SetOwnForegroundColour(const wxColour& colour) - { - if ( SetForegroundColour(colour) ) - m_inheritFgCol = false; - } - wxColour GetForegroundColour() const; - - // Set/get the background style. - // Pass one of wxBG_STYLE_SYSTEM, wxBG_STYLE_COLOUR, wxBG_STYLE_CUSTOM - virtual bool SetBackgroundStyle(wxBackgroundStyle style) { m_backgroundStyle = style; return true; } - virtual wxBackgroundStyle GetBackgroundStyle() const { return m_backgroundStyle; } - - // returns true if the control has "transparent" areas such as a - // wxStaticText and wxCheckBox and the background should be adapted - // from a parent window - virtual bool HasTransparentBackground() { return false; } - - // set/retrieve the font for the window (SetFont() returns true if the - // font really changed) - virtual bool SetFont(const wxFont& font) = 0; - void SetOwnFont(const wxFont& font) - { - if ( SetFont(font) ) - m_inheritFont = false; - } - wxFont GetFont() const; - - // set/retrieve the cursor for this window (SetCursor() returns true - // if the cursor was really changed) - virtual bool SetCursor( const wxCursor &cursor ); - const wxCursor& GetCursor() const { return m_cursor; } - -#if wxUSE_CARET - // associate a caret with the window - void SetCaret(wxCaret *caret); - // get the current caret (may be NULL) - wxCaret *GetCaret() const { return m_caret; } -#endif // wxUSE_CARET - - // get the (average) character size for the current font - virtual int GetCharHeight() const = 0; - virtual int GetCharWidth() const = 0; - - // get the width/height/... of the text using current or specified - // font - 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 = 0; - - // client <-> screen coords - // ------------------------ - - // translate to/from screen/client coordinates (pointers may be NULL) - void ClientToScreen( int *x, int *y ) const - { DoClientToScreen(x, y); } - void ScreenToClient( int *x, int *y ) const - { DoScreenToClient(x, y); } - - // wxPoint interface to do the same thing - wxPoint ClientToScreen(const wxPoint& pt) const - { - int x = pt.x, y = pt.y; - DoClientToScreen(&x, &y); - - return wxPoint(x, y); - } - - wxPoint ScreenToClient(const wxPoint& pt) const - { - int x = pt.x, y = pt.y; - DoScreenToClient(&x, &y); - - return wxPoint(x, y); - } - - // test where the given (in client coords) point lies - wxHitTest HitTest(wxCoord x, wxCoord y) const - { return DoHitTest(x, y); } - - wxHitTest HitTest(const wxPoint& pt) const - { return DoHitTest(pt.x, pt.y); } - - // misc - // ---- - - // get the window border style from the given flags: this is different from - // simply doing flags & wxBORDER_MASK because it uses GetDefaultBorder() to - // translate wxBORDER_DEFAULT to something reasonable - wxBorder GetBorder(long flags) const; - - // get border for the flags of this window - wxBorder GetBorder() const { return GetBorder(GetWindowStyleFlag()); } - - // send wxUpdateUIEvents to this window, and children if recurse is true - virtual void UpdateWindowUI(long flags = wxUPDATE_UI_NONE); - - // do the window-specific processing after processing the update event - virtual void DoUpdateWindowUI(wxUpdateUIEvent& event) ; - -#if wxUSE_MENUS - bool PopupMenu(wxMenu *menu, const wxPoint& pos = wxDefaultPosition) - { return DoPopupMenu(menu, pos.x, pos.y); } - bool PopupMenu(wxMenu *menu, int x, int y) - { return DoPopupMenu(menu, x, y); } -#endif // wxUSE_MENUS - - // override this method to return true for controls having multiple pages - virtual bool HasMultiplePages() const { return false; } - - - // scrollbars - // ---------- - - // does the window have the scrollbar for this orientation? - bool HasScrollbar(int orient) const - { - return (m_windowStyle & - (orient == wxHORIZONTAL ? wxHSCROLL : wxVSCROLL)) != 0; - } - - // configure the window scrollbars - virtual void SetScrollbar( int orient, - int pos, - int thumbvisible, - int range, - bool refresh = true ) = 0; - virtual void SetScrollPos( int orient, int pos, bool refresh = true ) = 0; - virtual int GetScrollPos( int orient ) const = 0; - virtual int GetScrollThumb( int orient ) const = 0; - virtual int GetScrollRange( int orient ) const = 0; - - // scroll window to the specified position - virtual void ScrollWindow( int dx, int dy, - const wxRect* rect = (wxRect *) NULL ) = 0; - - // scrolls window by line/page: note that not all controls support this - // - // return true if the position changed, false otherwise - virtual bool ScrollLines(int WXUNUSED(lines)) { return false; } - virtual bool ScrollPages(int WXUNUSED(pages)) { return false; } - - // convenient wrappers for ScrollLines/Pages - bool LineUp() { return ScrollLines(-1); } - bool LineDown() { return ScrollLines(1); } - bool PageUp() { return ScrollPages(-1); } - bool PageDown() { return ScrollPages(1); } - - // context-sensitive help - // ---------------------- - - // these are the convenience functions wrapping wxHelpProvider methods - -#if wxUSE_HELP - // associate this help text with this window - void SetHelpText(const wxString& text); - // associate this help text with all windows with the same id as this - // one - void SetHelpTextForId(const wxString& text); - // get the help string associated with the given position in this window - // - // notice that pt may be invalid if event origin is keyboard or unknown - // and this method should return the global window help text then - virtual wxString GetHelpTextAtPoint(const wxPoint& pt, - wxHelpEvent::Origin origin) const; - // returns the position-independent help text - wxString GetHelpText() const - { - return GetHelpTextAtPoint(wxDefaultPosition, wxHelpEvent::Origin_Unknown); - } - -#else // !wxUSE_HELP - // silently ignore SetHelpText() calls - void SetHelpText(const wxString& WXUNUSED(text)) { } - void SetHelpTextForId(const wxString& WXUNUSED(text)) { } -#endif // wxUSE_HELP - - // tooltips - // -------- - -#if wxUSE_TOOLTIPS - // the easiest way to set a tooltip for a window is to use this method - void SetToolTip( const wxString &tip ); - // attach a tooltip to the window - void SetToolTip( wxToolTip *tip ) { DoSetToolTip(tip); } -#if wxABI_VERSION >= 20809 - // more readable synonym for SetToolTip(NULL) - void UnsetToolTip() { SetToolTip(NULL); } -#endif // wxABI_VERSION >= 2.8.9 - // get the associated tooltip or NULL if none - wxToolTip* GetToolTip() const { return m_tooltip; } - wxString GetToolTipText() const ; -#else // !wxUSE_TOOLTIPS - // make it much easier to compile apps in an environment - // that doesn't support tooltips, such as PocketPC - void SetToolTip( const wxString & WXUNUSED(tip) ) {} -#if wxABI_VERSION >= 20809 - void UnsetToolTip() { } -#endif // wxABI_VERSION >= 2.8.9 -#endif // wxUSE_TOOLTIPS/!wxUSE_TOOLTIPS - - // drag and drop - // ------------- -#if wxUSE_DRAG_AND_DROP - // set/retrieve the drop target associated with this window (may be - // NULL; it's owned by the window and will be deleted by it) - virtual void SetDropTarget( wxDropTarget *dropTarget ) = 0; - virtual wxDropTarget *GetDropTarget() const { return m_dropTarget; } - -#ifndef __WXMSW__ // MSW version is in msw/window.h -#if wxABI_VERSION >= 20810 - // Accept files for dragging - void DragAcceptFiles(bool accept); -#endif // wxABI_VERSION >= 20810 -#endif // !__WXMSW__ - -#endif // wxUSE_DRAG_AND_DROP - - // constraints and sizers - // ---------------------- -#if wxUSE_CONSTRAINTS - // set the constraints for this window or retrieve them (may be NULL) - void SetConstraints( wxLayoutConstraints *constraints ); - wxLayoutConstraints *GetConstraints() const { return m_constraints; } - - // implementation only - void UnsetConstraints(wxLayoutConstraints *c); - wxWindowList *GetConstraintsInvolvedIn() const - { return m_constraintsInvolvedIn; } - void AddConstraintReference(wxWindowBase *otherWin); - void RemoveConstraintReference(wxWindowBase *otherWin); - void DeleteRelatedConstraints(); - void ResetConstraints(); - - // these methods may be overridden for special layout algorithms - virtual void SetConstraintSizes(bool recurse = true); - virtual bool LayoutPhase1(int *noChanges); - virtual bool LayoutPhase2(int *noChanges); - virtual bool DoPhase(int phase); - - // these methods are virtual but normally won't be overridden - virtual void SetSizeConstraint(int x, int y, int w, int h); - virtual void MoveConstraint(int x, int y); - virtual void GetSizeConstraint(int *w, int *h) const ; - virtual void GetClientSizeConstraint(int *w, int *h) const ; - virtual void GetPositionConstraint(int *x, int *y) const ; - -#endif // wxUSE_CONSTRAINTS - - // when using constraints or sizers, it makes sense to update - // children positions automatically whenever the window is resized - // - this is done if autoLayout is on - void SetAutoLayout( bool autoLayout ) { m_autoLayout = autoLayout; } - bool GetAutoLayout() const { return m_autoLayout; } - - // lay out the window and its children - virtual bool Layout(); - - // sizers - void SetSizer(wxSizer *sizer, bool deleteOld = true ); - void SetSizerAndFit( wxSizer *sizer, bool deleteOld = true ); - - wxSizer *GetSizer() const { return m_windowSizer; } - - // Track if this window is a member of a sizer - void SetContainingSizer(wxSizer* sizer); - wxSizer *GetContainingSizer() const { return m_containingSizer; } - - // accessibility - // ---------------------- -#if wxUSE_ACCESSIBILITY - // Override to create a specific accessible object. - virtual wxAccessible* CreateAccessible(); - - // Sets the accessible object. - void SetAccessible(wxAccessible* accessible) ; - - // Returns the accessible object. - wxAccessible* GetAccessible() { return m_accessible; } - - // Returns the accessible object, creating if necessary. - wxAccessible* GetOrCreateAccessible() ; -#endif - - - // Set window transparency if the platform supports it - virtual bool SetTransparent(wxByte WXUNUSED(alpha)) { return false; } - virtual bool CanSetTransparent() { return false; } - - - // implementation - // -------------- - - // event handlers - void OnSysColourChanged( wxSysColourChangedEvent& event ); - void OnInitDialog( wxInitDialogEvent &event ); - void OnMiddleClick( wxMouseEvent& event ); -#if wxUSE_HELP - void OnHelp(wxHelpEvent& event); -#endif // wxUSE_HELP - - // virtual function for implementing internal idle - // behaviour - virtual void OnInternalIdle() {} - - // call internal idle recursively -// void ProcessInternalIdle() ; - - // get the handle of the window for the underlying window system: this - // is only used for wxWin itself or for user code which wants to call - // platform-specific APIs - virtual WXWidget GetHandle() const = 0; - // associate the window with a new native handle - virtual void AssociateHandle(WXWidget WXUNUSED(handle)) { } - // dissociate the current native handle from the window - virtual void DissociateHandle() { } - -#if wxUSE_PALETTE - // Store the palette used by DCs in wxWindow so that the dcs can share - // a palette. And we can respond to palette messages. - wxPalette GetPalette() const { return m_palette; } - - // When palette is changed tell the DC to set the system palette to the - // new one. - void SetPalette(const wxPalette& pal); - - // return true if we have a specific palette - bool HasCustomPalette() const { return m_hasCustomPalette; } - - // return the first parent window with a custom palette or NULL - wxWindow *GetAncestorWithCustomPalette() const; -#endif // wxUSE_PALETTE - - // inherit the parents visual attributes if they had been explicitly set - // by the user (i.e. we don't inherit default attributes) and if we don't - // have our own explicitly set - virtual void InheritAttributes(); - - // returns false from here if this window doesn't want to inherit the - // parents colours even if InheritAttributes() would normally do it - // - // this just provides a simple way to customize InheritAttributes() - // behaviour in the most common case - virtual bool ShouldInheritColours() const { return false; } - -protected: - // event handling specific to wxWindow - virtual bool TryValidator(wxEvent& event); - virtual bool TryParent(wxEvent& event); - - enum MoveKind - { - MoveBefore, // insert before the given window - MoveAfter // insert after the given window - }; - -#if wxABI_VERSION >= 20808 - // common part of GetPrev/NextSibling() - wxWindow *DoGetSibling(MoveKind order) const; -#endif // wx 2.8.8+ - - // common part of MoveBefore/AfterInTabOrder() - virtual void DoMoveInTabOrder(wxWindow *win, MoveKind move); - -#if wxUSE_CONSTRAINTS - // satisfy the constraints for the windows but don't set the window sizes - void SatisfyConstraints(); -#endif // wxUSE_CONSTRAINTS - - // Send the wxWindowDestroyEvent - void SendDestroyEvent(); - - // returns the main window of composite control; this is the window - // that FindFocus returns if the focus is in one of composite control's - // windows - virtual wxWindow *GetMainWindowOfCompositeControl() - { return (wxWindow*)this; } - - // the window id - a number which uniquely identifies a window among - // its siblings unless it is wxID_ANY - wxWindowID m_windowId; - - // the parent window of this window (or NULL) and the list of the children - // of this window - wxWindow *m_parent; - wxWindowList m_children; - - // the minimal allowed size for the window (no minimal size if variable(s) - // contain(s) wxDefaultCoord) - int m_minWidth, - m_minHeight, - m_maxWidth, - m_maxHeight; - - // event handler for this window: usually is just 'this' but may be - // changed with SetEventHandler() - wxEvtHandler *m_eventHandler; - -#if wxUSE_VALIDATORS - // associated validator or NULL if none - wxValidator *m_windowValidator; -#endif // wxUSE_VALIDATORS - -#if wxUSE_DRAG_AND_DROP - wxDropTarget *m_dropTarget; -#endif // wxUSE_DRAG_AND_DROP - - // visual window attributes - wxCursor m_cursor; - wxFont m_font; // see m_hasFont - wxColour m_backgroundColour, // m_hasBgCol - m_foregroundColour; // m_hasFgCol - -#if wxUSE_CARET - wxCaret *m_caret; -#endif // wxUSE_CARET - - // the region which should be repainted in response to paint event - wxRegion m_updateRegion; - -#if wxUSE_ACCEL - // the accelerator table for the window which translates key strokes into - // command events - wxAcceleratorTable m_acceleratorTable; -#endif // wxUSE_ACCEL - - // the tooltip for this window (may be NULL) -#if wxUSE_TOOLTIPS - wxToolTip *m_tooltip; -#endif // wxUSE_TOOLTIPS - - // constraints and sizers -#if wxUSE_CONSTRAINTS - // the constraints for this window or NULL - wxLayoutConstraints *m_constraints; - - // constraints this window is involved in - wxWindowList *m_constraintsInvolvedIn; -#endif // wxUSE_CONSTRAINTS - - // this window's sizer - wxSizer *m_windowSizer; - - // The sizer this window is a member of, if any - wxSizer *m_containingSizer; - - // Layout() window automatically when its size changes? - bool m_autoLayout:1; - - // window state - bool m_isShown:1; - bool m_isEnabled:1; - bool m_isBeingDeleted:1; - - // was the window colours/font explicitly changed by user? - bool m_hasBgCol:1; - bool m_hasFgCol:1; - bool m_hasFont:1; - - // and should it be inherited by children? - bool m_inheritBgCol:1; - bool m_inheritFgCol:1; - bool m_inheritFont:1; - - // window attributes - long m_windowStyle, - m_exStyle; - wxString m_windowName; - bool m_themeEnabled; - wxBackgroundStyle m_backgroundStyle; -#if wxUSE_PALETTE - wxPalette m_palette; - bool m_hasCustomPalette; -#endif // wxUSE_PALETTE - -#if wxUSE_ACCESSIBILITY - wxAccessible* m_accessible; -#endif - - // Virtual size (scrolling) - wxSize m_virtualSize; - - wxScrollHelper *m_scrollHelper; - - int m_minVirtualWidth; // VirtualSizeHints - int m_minVirtualHeight; - int m_maxVirtualWidth; - int m_maxVirtualHeight; - - wxWindowVariant m_windowVariant ; - - // override this to change the default (i.e. used when no style is - // specified) border for the window class - virtual wxBorder GetDefaultBorder() const; - - // Get the default size for the new window if no explicit size given. TLWs - // have their own default size so this is just for non top-level windows. - static int WidthDefault(int w) { return w == wxDefaultCoord ? 20 : w; } - static int HeightDefault(int h) { return h == wxDefaultCoord ? 20 : h; } - - - // Used to save the results of DoGetBestSize so it doesn't need to be - // recalculated each time the value is needed. - wxSize m_bestSizeCache; - - wxDEPRECATED( void SetBestSize(const wxSize& size) ); // use SetInitialSize - wxDEPRECATED( virtual void SetInitialBestSize(const wxSize& size) ); // use SetInitialSize - - - - // more pure virtual functions - // --------------------------- - - // NB: we must have DoSomething() function when Something() is an overloaded - // method: indeed, we can't just have "virtual Something()" in case when - // the function is overloaded because then we'd have to make virtual all - // the variants (otherwise only the virtual function may be called on a - // pointer to derived class according to C++ rules) which is, in - // general, absolutely not needed. So instead we implement all - // overloaded Something()s in terms of DoSomething() which will be the - // only one to be virtual. - - // coordinates translation - virtual void DoClientToScreen( int *x, int *y ) const = 0; - virtual void DoScreenToClient( int *x, int *y ) const = 0; - - virtual wxHitTest DoHitTest(wxCoord x, wxCoord y) const; - - // capture/release the mouse, used by Capture/ReleaseMouse() - virtual void DoCaptureMouse() = 0; - virtual void DoReleaseMouse() = 0; - - // retrieve the position/size of the window - virtual void DoGetPosition(int *x, int *y) const = 0; - virtual void DoGetScreenPosition(int *x, int *y) const; - virtual void DoGetSize(int *width, int *height) const = 0; - virtual void DoGetClientSize(int *width, int *height) const = 0; - - // get the size which best suits the window: for a control, it would be - // the minimal size which doesn't truncate the control, for a panel - the - // same size as it would have after a call to Fit() - virtual wxSize DoGetBestSize() const; - - // called from DoGetBestSize() to convert best virtual size (returned by - // the window sizer) to the best size for the window itself; this is - // overridden at wxScrolledWindow level to clump down virtual size to real - virtual wxSize GetWindowSizeForVirtualSize(const wxSize& size) const - { - return size; - } - - // this is the virtual function to be overriden in any derived class which - // wants to change how SetSize() or Move() works - it is called by all - // versions of these functions in the base class - virtual void DoSetSize(int x, int y, - int width, int height, - int sizeFlags = wxSIZE_AUTO) = 0; - - // same as DoSetSize() for the client size - virtual void DoSetClientSize(int width, int height) = 0; - - // move the window to the specified location and resize it: this is called - // from both DoSetSize() and DoSetClientSize() and would usually just - // reposition this window except for composite controls which will want to - // arrange themselves inside the given rectangle - // - // Important note: the coordinates passed to this method are in parent's - // *window* coordinates and not parent's client coordinates (as the values - // passed to DoSetSize and returned by DoGetPosition are)! - virtual void DoMoveWindow(int x, int y, int width, int height) = 0; - - // centre the window in the specified direction on parent, note that - // wxCENTRE_ON_SCREEN shouldn't be specified here, it only makes sense for - // TLWs - virtual void DoCentre(int dir); - -#if wxUSE_TOOLTIPS - virtual void DoSetToolTip( wxToolTip *tip ); -#endif // wxUSE_TOOLTIPS - -#if wxUSE_MENUS - virtual bool DoPopupMenu(wxMenu *menu, int x, int y) = 0; -#endif // wxUSE_MENUS - - // Makes an adjustment to the window position to make it relative to the - // parents client area, e.g. if the parent is a frame with a toolbar, its - // (0, 0) is just below the toolbar - virtual void AdjustForParentClientOrigin(int& x, int& y, - int sizeFlags = 0) const; - - // implements the window variants - virtual void DoSetWindowVariant( wxWindowVariant variant ) ; - - // Must be called when mouse capture is lost to send - // wxMouseCaptureLostEvent to windows on capture stack. - static void NotifyCaptureLost(); - -private: - // contains the last id generated by NewControlId - static int ms_lastControlId; - - // the stack of windows which have captured the mouse - static struct WXDLLIMPEXP_FWD_CORE wxWindowNext *ms_winCaptureNext; - // the window that currently has mouse capture - static wxWindow *ms_winCaptureCurrent; - // indicates if execution is inside CaptureMouse/ReleaseMouse - static bool ms_winCaptureChanging; - - DECLARE_ABSTRACT_CLASS(wxWindowBase) - DECLARE_NO_COPY_CLASS(wxWindowBase) - DECLARE_EVENT_TABLE() -}; - - - -// Inlines for some deprecated methods -inline wxSize wxWindowBase::GetBestFittingSize() const -{ - return GetEffectiveMinSize(); -} - -inline void wxWindowBase::SetBestFittingSize(const wxSize& size) -{ - SetInitialSize(size); -} - -inline void wxWindowBase::SetBestSize(const wxSize& size) -{ - SetInitialSize(size); -} - -inline void wxWindowBase::SetInitialBestSize(const wxSize& size) -{ - SetInitialSize(size); -} - - -// ---------------------------------------------------------------------------- -// now include the declaration of wxWindow class -// ---------------------------------------------------------------------------- - -// include the declaration of the platform-specific class -#if defined(__WXPALMOS__) - #ifdef __WXUNIVERSAL__ - #define wxWindowNative wxWindowPalm - #else // !wxUniv - #define wxWindowPalm wxWindow - #endif // wxUniv/!wxUniv - #include "wx/palmos/window.h" -#elif defined(__WXMSW__) - #ifdef __WXUNIVERSAL__ - #define wxWindowNative wxWindowMSW - #else // !wxUniv - #define wxWindowMSW wxWindow - #endif // wxUniv/!wxUniv - #include "wx/msw/window.h" -#elif defined(__WXMOTIF__) - #include "wx/motif/window.h" -#elif defined(__WXGTK20__) - #ifdef __WXUNIVERSAL__ - #define wxWindowNative wxWindowGTK - #else // !wxUniv - #define wxWindowGTK wxWindow - #endif // wxUniv - #include "wx/gtk/window.h" -#elif defined(__WXGTK__) - #ifdef __WXUNIVERSAL__ - #define wxWindowNative wxWindowGTK - #else // !wxUniv - #define wxWindowGTK wxWindow - #endif // wxUniv - #include "wx/gtk1/window.h" -#elif defined(__WXX11__) - #ifdef __WXUNIVERSAL__ - #define wxWindowNative wxWindowX11 - #else // !wxUniv - #define wxWindowX11 wxWindow - #endif // wxUniv - #include "wx/x11/window.h" -#elif defined(__WXMGL__) - #define wxWindowNative wxWindowMGL - #include "wx/mgl/window.h" -#elif defined(__WXDFB__) - #define wxWindowNative wxWindowDFB - #include "wx/dfb/window.h" -#elif defined(__WXMAC__) - #ifdef __WXUNIVERSAL__ - #define wxWindowNative wxWindowMac - #else // !wxUniv - #define wxWindowMac wxWindow - #endif // wxUniv - #include "wx/mac/window.h" -#elif defined(__WXCOCOA__) - #ifdef __WXUNIVERSAL__ - #define wxWindowNative wxWindowCocoa - #else // !wxUniv - #define wxWindowCocoa wxWindow - #endif // wxUniv - #include "wx/cocoa/window.h" -#elif defined(__WXPM__) - #ifdef __WXUNIVERSAL__ - #define wxWindowNative wxWindowOS2 - #else // !wxUniv - #define wxWindowOS2 wxWindow - #endif // wxUniv/!wxUniv - #include "wx/os2/window.h" -#endif - -// for wxUniversal, we now derive the real wxWindow from wxWindow<platform>, -// for the native ports we already have defined it above -#if defined(__WXUNIVERSAL__) - #ifndef wxWindowNative - #error "wxWindowNative must be defined above!" - #endif - - #include "wx/univ/window.h" -#endif // wxUniv - -// ---------------------------------------------------------------------------- -// inline functions which couldn't be declared in the class body because of -// forward dependencies -// ---------------------------------------------------------------------------- - -inline wxWindow *wxWindowBase::GetGrandParent() const -{ - return m_parent ? m_parent->GetParent() : (wxWindow *)NULL; -} - -// ---------------------------------------------------------------------------- -// global functions -// ---------------------------------------------------------------------------- - -// Find the wxWindow at the current mouse position, also returning the mouse -// position. -extern WXDLLEXPORT wxWindow* wxFindWindowAtPointer(wxPoint& pt); - -// Get the current mouse position. -extern WXDLLEXPORT wxPoint wxGetMousePosition(); - -// get the currently active window of this application or NULL -extern WXDLLEXPORT wxWindow *wxGetActiveWindow(); - -// get the (first) top level parent window -WXDLLEXPORT wxWindow* wxGetTopLevelParent(wxWindow *win); - -#if WXWIN_COMPATIBILITY_2_6 - // deprecated (doesn't start with 'wx' prefix), use wxWindow::NewControlId() - wxDEPRECATED( int NewControlId() ); - inline int NewControlId() { return wxWindowBase::NewControlId(); } -#endif // WXWIN_COMPATIBILITY_2_6 - -#if wxUSE_ACCESSIBILITY -// ---------------------------------------------------------------------------- -// accessible object for windows -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxWindowAccessible: public wxAccessible -{ -public: - wxWindowAccessible(wxWindow* win): wxAccessible(win) { if (win) win->SetAccessible(this); } - virtual ~wxWindowAccessible() {} - -// Overridables - - // Can return either a child object, or an integer - // representing the child element, starting from 1. - virtual wxAccStatus HitTest(const wxPoint& pt, int* childId, wxAccessible** childObject); - - // Returns the rectangle for this object (id = 0) or a child element (id > 0). - virtual wxAccStatus GetLocation(wxRect& rect, int elementId); - - // Navigates from fromId to toId/toObject. - virtual wxAccStatus Navigate(wxNavDir navDir, int fromId, - int* toId, wxAccessible** toObject); - - // Gets the name of the specified object. - virtual wxAccStatus GetName(int childId, wxString* name); - - // Gets the number of children. - virtual wxAccStatus GetChildCount(int* childCount); - - // Gets the specified child (starting from 1). - // If *child is NULL and return value is wxACC_OK, - // this means that the child is a simple element and - // not an accessible object. - virtual wxAccStatus GetChild(int childId, wxAccessible** child); - - // Gets the parent, or NULL. - virtual wxAccStatus GetParent(wxAccessible** parent); - - // Performs the default action. childId is 0 (the action for this object) - // or > 0 (the action for a child). - // Return wxACC_NOT_SUPPORTED if there is no default action for this - // window (e.g. an edit control). - virtual wxAccStatus DoDefaultAction(int childId); - - // Gets the default action for this object (0) or > 0 (the action for a child). - // Return wxACC_OK even if there is no action. actionName is the action, or the empty - // string if there is no action. - // The retrieved string describes the action that is performed on an object, - // not what the object does as a result. For example, a toolbar button that prints - // a document has a default action of "Press" rather than "Prints the current document." - virtual wxAccStatus GetDefaultAction(int childId, wxString* actionName); - - // Returns the description for this object or a child. - virtual wxAccStatus GetDescription(int childId, wxString* description); - - // Returns help text for this object or a child, similar to tooltip text. - virtual wxAccStatus GetHelpText(int childId, wxString* helpText); - - // Returns the keyboard shortcut for this object or child. - // Return e.g. ALT+K - virtual wxAccStatus GetKeyboardShortcut(int childId, wxString* shortcut); - - // Returns a role constant. - virtual wxAccStatus GetRole(int childId, wxAccRole* role); - - // Returns a state constant. - virtual wxAccStatus GetState(int childId, long* state); - - // Returns a localized string representing the value for the object - // or child. - virtual wxAccStatus GetValue(int childId, wxString* strValue); - - // Selects the object or child. - virtual wxAccStatus Select(int childId, wxAccSelectionFlags selectFlags); - - // Gets the window with the keyboard focus. - // If childId is 0 and child is NULL, no object in - // this subhierarchy has the focus. - // If this object has the focus, child should be 'this'. - virtual wxAccStatus GetFocus(int* childId, wxAccessible** child); - -#if wxUSE_VARIANT - // Gets a variant representing the selected children - // of this object. - // Acceptable values: - // - a null variant (IsNull() returns true) - // - a list variant (GetType() == wxT("list") - // - an integer representing the selected child element, - // or 0 if this object is selected (GetType() == wxT("long") - // - a "void*" pointer to a wxAccessible child object - virtual wxAccStatus GetSelections(wxVariant* selections); -#endif // wxUSE_VARIANT -}; - -#endif // wxUSE_ACCESSIBILITY - - -#endif // _WX_WINDOW_H_BASE_ diff --git a/wxWidgets/include/wx/wizard.h b/wxWidgets/include/wx/wizard.h deleted file mode 100644 index 2de30b9c1a..0000000000 --- a/wxWidgets/include/wx/wizard.h +++ /dev/null @@ -1,323 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: wizard.h -// Purpose: wxWizard class: a GUI control presenting the user with a -// sequence of dialogs which allows to simply perform some task -// Author: Vadim Zeitlin (partly based on work by Ron Kuris and Kevin B. -// Smith) -// Modified by: Robert Cavanaugh -// Added capability to use .WXR resource files in Wizard pages -// Added wxWIZARD_HELP event -// Robert Vazan (sizers) -// Created: 15.08.99 -// RCS-ID: $Id: wizard.h 63262 2010-01-25 18:47:47Z JS $ -// Copyright: (c) 1999 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr> -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_WIZARD_H_ -#define _WX_WIZARD_H_ - -#include "wx/defs.h" - -#if wxUSE_WIZARDDLG - -// ---------------------------------------------------------------------------- -// headers and other simple declarations -// ---------------------------------------------------------------------------- - -#include "wx/dialog.h" // the base class -#include "wx/panel.h" // ditto -#include "wx/event.h" // wxEVT_XXX constants -#include "wx/bitmap.h" - -// Extended style to specify a help button -#define wxWIZARD_EX_HELPBUTTON 0x00000010 - -// forward declarations -class WXDLLIMPEXP_FWD_ADV wxWizard; - -// ---------------------------------------------------------------------------- -// wxWizardPage is one of the wizards screen: it must know what are the -// following and preceding pages (which may be NULL for the first/last page). -// -// Other than GetNext/Prev() functions, wxWizardPage is just a panel and may be -// used as such (i.e. controls may be placed directly on it &c). -// ---------------------------------------------------------------------------- - -class WXDLLIMPEXP_ADV wxWizardPage : public wxPanel -{ -public: - wxWizardPage() { Init(); } - - // ctor accepts an optional bitmap which will be used for this page instead - // of the default one for this wizard (should be of the same size). Notice - // that no other parameters are needed because the wizard will resize and - // reposition the page anyhow - wxWizardPage(wxWizard *parent, - const wxBitmap& bitmap = wxNullBitmap, - const wxChar* resource = NULL); - - bool Create(wxWizard *parent, - const wxBitmap& bitmap = wxNullBitmap, - const wxChar* resource = NULL); - - // these functions are used by the wizard to show another page when the - // user chooses "Back" or "Next" button - virtual wxWizardPage *GetPrev() const = 0; - virtual wxWizardPage *GetNext() const = 0; - - // default GetBitmap() will just return m_bitmap which is ok in 99% of - // cases - override this method if you want to create the bitmap to be used - // dynamically or to do something even more fancy. It's ok to return - // wxNullBitmap from here - the default one will be used then. - virtual wxBitmap GetBitmap() const { return m_bitmap; } - -#if wxUSE_VALIDATORS - // Override the base functions to allow a validator to be assigned to this page. - virtual bool TransferDataToWindow() - { - return GetValidator() ? GetValidator()->TransferToWindow() - : wxPanel::TransferDataToWindow(); - } - - virtual bool TransferDataFromWindow() - { - return GetValidator() ? GetValidator()->TransferFromWindow() - : wxPanel::TransferDataFromWindow(); - } - - virtual bool Validate() - { - return GetValidator() ? GetValidator()->Validate(this) - : wxPanel::Validate(); - } -#endif // wxUSE_VALIDATORS - -protected: - // common part of ctors: - void Init(); - - wxBitmap m_bitmap; - -private: - DECLARE_DYNAMIC_CLASS_NO_COPY(wxWizardPage) -}; - -// ---------------------------------------------------------------------------- -// wxWizardPageSimple just returns the pointers given to the ctor and is useful -// to create a simple wizard where the order of pages never changes. -// -// OTOH, it is also possible to dynamicly decide which page to return (i.e. -// depending on the user's choices) as the wizard sample shows - in order to do -// this, you must derive from wxWizardPage directly. -// ---------------------------------------------------------------------------- - -class WXDLLIMPEXP_ADV wxWizardPageSimple : public wxWizardPage -{ -public: - wxWizardPageSimple() { Init(); } - - // ctor takes the previous and next pages - wxWizardPageSimple(wxWizard *parent, - wxWizardPage *prev = (wxWizardPage *)NULL, - wxWizardPage *next = (wxWizardPage *)NULL, - const wxBitmap& bitmap = wxNullBitmap, - const wxChar* resource = NULL) - { - Create(parent, prev, next, bitmap, resource); - } - - bool Create(wxWizard *parent = NULL, // let it be default ctor too - wxWizardPage *prev = (wxWizardPage *)NULL, - wxWizardPage *next = (wxWizardPage *)NULL, - const wxBitmap& bitmap = wxNullBitmap, - const wxChar* resource = NULL) - { - m_prev = prev; - m_next = next; - return wxWizardPage::Create(parent, bitmap, resource); - } - - // the pointers may be also set later - but before starting the wizard - void SetPrev(wxWizardPage *prev) { m_prev = prev; } - void SetNext(wxWizardPage *next) { m_next = next; } - - // a convenience function to make the pages follow each other - static void Chain(wxWizardPageSimple *first, wxWizardPageSimple *second) - { - wxCHECK_RET( first && second, - wxT("NULL passed to wxWizardPageSimple::Chain") ); - - first->SetNext(second); - second->SetPrev(first); - } - - // base class pure virtuals - virtual wxWizardPage *GetPrev() const; - virtual wxWizardPage *GetNext() const; - -private: - // common part of ctors: - void Init() - { - m_prev = m_next = NULL; - } - - // pointers are private, the derived classes shouldn't mess with them - - // just derive from wxWizardPage directly to implement different behaviour - wxWizardPage *m_prev, - *m_next; - - DECLARE_DYNAMIC_CLASS_NO_COPY(wxWizardPageSimple) -}; - -// ---------------------------------------------------------------------------- -// wxWizard -// ---------------------------------------------------------------------------- - -class WXDLLIMPEXP_ADV wxWizardBase : public wxDialog -{ -public: - /* - The derived class (i.e. the real wxWizard) has a ctor and Create() - function taking the following arguments: - - wxWizard(wxWindow *parent, - int id = wxID_ANY, - const wxString& title = wxEmptyString, - const wxBitmap& bitmap = wxNullBitmap, - const wxPoint& pos = wxDefaultPosition, - long style = wxDEFAULT_DIALOG_STYLE); - */ - wxWizardBase() { } - - // executes the wizard starting from the given page, returns true if it was - // successfully finished, false if user cancelled it - virtual bool RunWizard(wxWizardPage *firstPage) = 0; - - // get the current page (NULL if RunWizard() isn't running) - virtual wxWizardPage *GetCurrentPage() const = 0; - - // set the min size which should be available for the pages: a - // wizard will take into account the size of the bitmap (if any) - // itself and will never be less than some predefined fixed size - virtual void SetPageSize(const wxSize& size) = 0; - - // get the size available for the page - virtual wxSize GetPageSize() const = 0; - - // set the best size for the wizard, i.e. make it big enough to contain all - // of the pages starting from the given one - // - // this function may be called several times and possible with different - // pages in which case it will only increase the page size if needed (this - // may be useful if not all pages are accessible from the first one by - // default) - virtual void FitToPage(const wxWizardPage *firstPage) = 0; - - // Adding pages to page area sizer enlarges wizard - virtual wxSizer *GetPageAreaSizer() const = 0; - - // Set border around page area. Default is 0 if you add at least one - // page to GetPageAreaSizer and 5 if you don't. - virtual void SetBorder(int border) = 0; - - // the methods below may be overridden by the derived classes to provide - // custom logic for determining the pages order - - virtual bool HasNextPage(wxWizardPage *page) - { return page->GetNext() != NULL; } - - virtual bool HasPrevPage(wxWizardPage *page) - { return page->GetPrev() != NULL; } - - /// Override these functions to stop InitDialog from calling TransferDataToWindow - /// for _all_ pages when the wizard starts. Instead 'ShowPage' will call - /// TransferDataToWindow for the first page only. - bool TransferDataToWindow() { return true; } - bool TransferDataFromWindow() { return true; } - bool Validate() { return true; } - -private: - DECLARE_NO_COPY_CLASS(wxWizardBase) -}; - -// include the real class declaration -#include "wx/generic/wizard.h" - -// ---------------------------------------------------------------------------- -// wxWizardEvent class represents an event generated by the wizard: this event -// is first sent to the page itself and, if not processed there, goes up the -// window hierarchy as usual -// ---------------------------------------------------------------------------- - -class WXDLLIMPEXP_ADV wxWizardEvent : public wxNotifyEvent -{ -public: - wxWizardEvent(wxEventType type = wxEVT_NULL, - int id = wxID_ANY, - bool direction = true, - wxWizardPage* page = NULL); - - // for EVT_WIZARD_PAGE_CHANGING, return true if we're going forward or - // false otherwise and for EVT_WIZARD_PAGE_CHANGED return true if we came - // from the previous page and false if we returned from the next one - // (this function doesn't make sense for CANCEL events) - bool GetDirection() const { return m_direction; } - - wxWizardPage* GetPage() const { return m_page; } - -private: - bool m_direction; - wxWizardPage* m_page; - - DECLARE_DYNAMIC_CLASS(wxWizardEvent) - DECLARE_NO_COPY_CLASS(wxWizardEvent) -}; - -// ---------------------------------------------------------------------------- -// macros for handling wxWizardEvents -// ---------------------------------------------------------------------------- - -BEGIN_DECLARE_EVENT_TYPES() - DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_ADV, wxEVT_WIZARD_PAGE_CHANGED, 900) - DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_ADV, wxEVT_WIZARD_PAGE_CHANGING, 901) - DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_ADV, wxEVT_WIZARD_CANCEL, 902) - DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_ADV, wxEVT_WIZARD_HELP, 903) - DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_ADV, wxEVT_WIZARD_FINISHED, 903) -#if wxABI_VERSION >= 20811 - DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_ADV, wxEVT_WIZARD_PAGE_SHOWN, 904) -#endif -END_DECLARE_EVENT_TYPES() - -typedef void (wxEvtHandler::*wxWizardEventFunction)(wxWizardEvent&); - -#define wxWizardEventHandler(func) \ - (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxWizardEventFunction, &func) - -#define wx__DECLARE_WIZARDEVT(evt, id, fn) \ - wx__DECLARE_EVT1(wxEVT_WIZARD_ ## evt, id, wxWizardEventHandler(fn)) - -// notifies that the page has just been changed (can't be vetoed) -#define EVT_WIZARD_PAGE_CHANGED(id, fn) wx__DECLARE_WIZARDEVT(PAGE_CHANGED, id, fn) - -// the user pressed "<Back" or "Next>" button and the page is going to be -// changed - unless the event handler vetoes the event -#define EVT_WIZARD_PAGE_CHANGING(id, fn) wx__DECLARE_WIZARDEVT(PAGE_CHANGING, id, fn) - -// the user pressed "Cancel" button and the wizard is going to be dismissed - -// unless the event handler vetoes the event -#define EVT_WIZARD_CANCEL(id, fn) wx__DECLARE_WIZARDEVT(CANCEL, id, fn) - -// the user pressed "Finish" button and the wizard is going to be dismissed - -#define EVT_WIZARD_FINISHED(id, fn) wx__DECLARE_WIZARDEVT(FINISHED, id, fn) - -// the user pressed "Help" button -#define EVT_WIZARD_HELP(id, fn) wx__DECLARE_WIZARDEVT(HELP, id, fn) - -// the page was just shown and laid out -#define EVT_WIZARD_PAGE_SHOWN(id, fn) wx__DECLARE_WIZARDEVT(PAGE_SHOWN, id, fn) - -#endif // wxUSE_WIZARDDLG - -#endif // _WX_WIZARD_H_ diff --git a/wxWidgets/include/wx/wupdlock.h b/wxWidgets/include/wx/wupdlock.h deleted file mode 100644 index 61f6a39098..0000000000 --- a/wxWidgets/include/wx/wupdlock.h +++ /dev/null @@ -1,37 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: wx/wupdlock.h -// Purpose: wxWindowUpdateLocker prevents window redrawing -// Author: Vadim Zeitlin -// Created: 2006-03-06 -// RCS-ID: $Id: wupdlock.h 37842 2006-03-07 01:50:21Z VZ $ -// Copyright: (c) 2006 Vadim Zeitlin <vadim@wxwindows.org> -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_WUPDLOCK_H_ -#define _WX_WUPDLOCK_H_ - -#include "wx/window.h" - -// ---------------------------------------------------------------------------- -// wxWindowUpdateLocker prevents updates to the window during its lifetime -// ---------------------------------------------------------------------------- - -class wxWindowUpdateLocker -{ -public: - // create an object preventing updates of the given window (which must have - // a lifetime at least as great as ours) - wxWindowUpdateLocker(wxWindow *win) : m_win(win) { win->Freeze(); } - - // dtor thaws the window to permit updates again - ~wxWindowUpdateLocker() { m_win->Thaw(); } - -private: - wxWindow *m_win; - - DECLARE_NO_COPY_CLASS(wxWindowUpdateLocker) -}; - -#endif // _WX_WUPDLOCK_H_ - diff --git a/wxWidgets/include/wx/wx.h b/wxWidgets/include/wx/wx.h deleted file mode 100644 index 0ad9bcdce9..0000000000 --- a/wxWidgets/include/wx/wx.h +++ /dev/null @@ -1,105 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/wx.h -// Purpose: wxWidgets central header including the most often used ones -// Author: Julian Smart -// Modified by: -// Created: 01/02/97 -// RCS-ID: $Id: wx.h 40943 2006-08-31 19:31:43Z ABX $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_WX_H_ -#define _WX_WX_H_ - -#include "wx/defs.h" -#include "wx/object.h" -#include "wx/dynarray.h" -#include "wx/list.h" -#include "wx/hash.h" -#include "wx/string.h" -#include "wx/hashmap.h" -#include "wx/arrstr.h" -#include "wx/intl.h" -#include "wx/log.h" -#include "wx/event.h" -#include "wx/app.h" -#include "wx/utils.h" -#include "wx/stream.h" -#include "wx/memory.h" -#include "wx/math.h" -#include "wx/stopwatch.h" -#include "wx/module.h" - -#if wxUSE_GUI - -#include "wx/window.h" -#include "wx/containr.h" -#include "wx/panel.h" -#include "wx/toplevel.h" -#include "wx/frame.h" -#include "wx/gdicmn.h" -#include "wx/gdiobj.h" -#include "wx/region.h" -#include "wx/bitmap.h" -#include "wx/image.h" -#include "wx/colour.h" -#include "wx/font.h" -#include "wx/dc.h" -#include "wx/dcclient.h" -#include "wx/dcmemory.h" -#include "wx/dcprint.h" -#include "wx/dcscreen.h" -#include "wx/button.h" -#include "wx/menuitem.h" -#include "wx/menu.h" -#include "wx/pen.h" -#include "wx/brush.h" -#include "wx/palette.h" -#include "wx/icon.h" -#include "wx/cursor.h" -#include "wx/dialog.h" -#include "wx/timer.h" -#include "wx/settings.h" -#include "wx/msgdlg.h" -#include "wx/cmndata.h" -#include "wx/dataobj.h" - -#include "wx/control.h" -#include "wx/ctrlsub.h" -#include "wx/bmpbuttn.h" -#include "wx/checkbox.h" -#include "wx/checklst.h" -#include "wx/choice.h" -#include "wx/scrolbar.h" -#include "wx/stattext.h" -#include "wx/statbmp.h" -#include "wx/statbox.h" -#include "wx/listbox.h" -#include "wx/radiobox.h" -#include "wx/radiobut.h" -#include "wx/textctrl.h" -#include "wx/slider.h" -#include "wx/gauge.h" -#include "wx/scrolwin.h" -#include "wx/dirdlg.h" -#include "wx/toolbar.h" -#include "wx/combobox.h" -#include "wx/layout.h" -#include "wx/sizer.h" -#include "wx/mdi.h" -#include "wx/statusbr.h" -#include "wx/choicdlg.h" -#include "wx/textdlg.h" -#include "wx/filedlg.h" - -// always include, even if !wxUSE_VALIDATORS because we need wxDefaultValidator -#include "wx/validate.h" - -#if wxUSE_VALIDATORS - #include "wx/valtext.h" -#endif // wxUSE_VALIDATORS - -#endif // wxUSE_GUI - -#endif // _WX_WX_H_ diff --git a/wxWidgets/include/wx/wx_cw.h b/wxWidgets/include/wx/wx_cw.h deleted file mode 100644 index b9b214a904..0000000000 --- a/wxWidgets/include/wx/wx_cw.h +++ /dev/null @@ -1,65 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx_cw.h -// Purpose: wxWidgets definitions for CodeWarrior builds -// Author: Stefan Csomor -// Modified by: -// Created: 12/10/98 -// RCS-ID: $Id: wx_cw.h 29319 2004-09-24 14:32:35Z ABX $ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_CW__ -#define _WX_CW__ - -#if __MWERKS__ >= 0x2400 -#pragma old_argmatch on -#endif - -#if __option(profile) -#ifdef __cplusplus - #if __POWERPC__ - #include <wx_PPC++_prof.mch> - #elif __INTEL__ - #include <wx_x86++_prof.mch> - #elif __CFM68K__ - #include <wx_cfm++_prof.mch> - #else - #include <wx_68k++_prof.mch> - #endif -#else - #if __POWERPC__ - #include <wx_PPC_prof.mch> - #elif __INTEL__ - #include <wx_x86_prof.mch> - #elif __CFM68K__ - #include <wx_cfm_prof.mch> - #else - #include <wx_68k_prof.mch> - #endif -#endif -#else -#ifdef __cplusplus - #if __POWERPC__ - #include <wx_PPC++.mch> - #elif __INTEL__ - #include <wx_x86++.mch> - #elif __CFM68K__ - #include <wx_cfm++.mch> - #else - #include <wx_68k++.mch> - #endif -#else - #if __POWERPC__ - #include <wx_PPC.mch> - #elif __INTEL__ - #include <wx_x86.mch> - #elif __CFM68K__ - #include <wx_cfm.mch> - #else - #include <wx_68k.mch> - #endif -#endif -#endif -#endif - // _WX_CW__ diff --git a/wxWidgets/include/wx/wx_cw_cm.h b/wxWidgets/include/wx/wx_cw_cm.h deleted file mode 100644 index c6c64b9e07..0000000000 --- a/wxWidgets/include/wx/wx_cw_cm.h +++ /dev/null @@ -1,88 +0,0 @@ -/* - Name: wx/wx_cw_cm.h - Purpose: wxWidgets definitions for CodeWarrior builds - Author: Stefan Csomor - Modified by: - Created: - RCS-ID: $Id: wx_cw_cm.h 42655 2006-10-29 20:17:29Z VZ $ - Copyright: (c) Stefan Csomor - Licence: wxWindows licence -*/ - -#define MSL_USE_PRECOMPILED_HEADERS 0 -#if __WXDEBUG__ - // mac os assert levels - #define DEBUG 1 - #define DEBUG_INTERNAL 1 -#endif -#if !defined( __MWERKS__ ) - #error "this file is only for builds with Metrowerks CodeWarrior" -#endif - -// defined if the compiler does not want the classname repeated for inlines -// within a class definition -#define WX_COMP_INLINE_NO_CLASS - -#if __MWERKS__ >= 0x2400 && __MWERKS__ < 0x3200 - #pragma old_argmatch on -#endif - -#if (__MWERKS__ < 0x0900) || macintosh || __MACH__ - #define __MAC__ - #define __WXMAC__ -#elif (__MWERKS__ >= 0x0900) && __INTEL__ - #define WIN32 - #define _WINDOWS - #define __WXMSW__ - #define __WINDOWS__ - #define __WIN95__ - #define __WIN32__ - #define STRICT - #define NOMINMAX -#elif __BEOS__ - #include <ansi_prefix.be.h> - #include <Be.h> -#else - #error unknown MW compiler -#endif - -#ifdef __WXMSW__ - #include <ansi_prefix.win32.h> - #include <ansi_parms.h> - #ifdef __MWERKS__ - #if defined( __MSL__ ) && __MSL__ >= 0x5012 && __MSL__ < 0x7000 - #define fileno _fileno - #define fdopen _fdopen - #define tell _tell - #endif - #endif -#elif defined( __WXMAC__) - /* Set to 0 if you don't want to use precompiled MacHeaders */ - #define USE_PRECOMPILED_MAC_HEADERS 0 - #define ACCESSOR_CALLS_ARE_FUNCTIONS 1 - #define OPAQUE_TOOLBOX_STRUCTS 1 - - /* CW8.3+ has mbstate_t */ - #if defined(__MACH__) && __MWERKS__ < 0x3003 - typedef int mbstate_t; - #define _MBSTATE_T - #endif - - /* CW8.3+ has ssize_t */ - #if defined(__MACH__) && __MWERKS__ >= 0x3003 - #define HAVE_SSIZE_T - #endif - - #include <mslconfig> - // for getting the correct expat includes - #define MACOS_CLASSIC - /* - #include <MacTypes.h> - #if UNIVERSAL_INTERFACES_VERSION < 0x0340 - #error "please update to Apple's lastest universal headers from http://developer.apple.com/sdk/" - #endif - */ -#endif - -#define USE_DEFINE - diff --git a/wxWidgets/include/wx/wx_cw_d.h b/wxWidgets/include/wx/wx_cw_d.h deleted file mode 100644 index 6e127a9f6a..0000000000 --- a/wxWidgets/include/wx/wx_cw_d.h +++ /dev/null @@ -1,46 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx_cw_d.h -// Purpose: wxWidgets definitions for CodeWarrior builds (Debug) -// Author: Stefan Csomor -// Modified by: -// Created: 12/10/98 -// RCS-ID: $Id: wx_cw_d.h 29319 2004-09-24 14:32:35Z ABX $ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_CW__ -#define _WX_CW__ - -#if __MWERKS__ >= 0x2400 && __MWERKS__ < 0x3200 -#pragma old_argmatch on -#endif - -#if __option(profile) -#error "profiling is not supported in debug versions" -#else -#ifdef __cplusplus - #if __POWERPC__ - #include <wx_PPC++_d.mch> - #elif __INTEL__ - #include <wx_x86++_d.mch> - #elif __CFM68K__ - #include <wx_cfm++_d.mch> - #else - #include <wx_68k++_d.mch> - #endif -#else - #if __POWERPC__ - #include <wx_PPC_d.mch> - #elif __INTEL__ - #include <wx_x86_d.mch> - #elif __CFM68K__ - #include <wx_cfm_d.mch> - #else - #include <wx_68k_d.mch> - #endif -#endif -#endif - -#endif - // _WX_CW__ diff --git a/wxWidgets/include/wx/wx_cwc.h b/wxWidgets/include/wx/wx_cwc.h deleted file mode 100644 index 7c323bd76d..0000000000 --- a/wxWidgets/include/wx/wx_cwc.h +++ /dev/null @@ -1,49 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx_cw.h -// Purpose: wxWidgets definitions for CodeWarrior builds -// Author: Stefan Csomor -// Modified by: -// Created: 12/10/98 -// RCS-ID: $Id: wx_cwc.h 36967 2006-01-18 14:13:20Z JS $ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_CW__ -#define _WX_CW__ - -#if __MWERKS__ >= 0x2400 && __MWERKS__ < 0x3200 - #pragma old_argmatch on -#endif - -#if __option(profile) -#ifdef __cplusplus - #ifdef __MACH__ - #include "wx_Mach++_prof.mch" - #elif __POWERPC__ - #include "wx_Carbon++_prof.mch" - #endif -#else - #ifdef __MACH__ - #include "wx_Mach_prof.mch" - #elif __POWERPC__ - #include "wx_Carbon_prof.mch" - #endif -#endif -#else -#ifdef __cplusplus - #ifdef __MACH__ - #include "wx_Mach++.mch" - #elif __POWERPC__ - #include "wx_Carbon++.mch" - #endif -#else - #ifdef __MACH__ - #include "wx_Mach.mch" - #elif __POWERPC__ - #include "wx_Carbon.mch" - #endif -#endif -#endif -#endif - // _WX_CW__ diff --git a/wxWidgets/include/wx/wx_cwc_d.h b/wxWidgets/include/wx/wx_cwc_d.h deleted file mode 100644 index dd46cfeac1..0000000000 --- a/wxWidgets/include/wx/wx_cwc_d.h +++ /dev/null @@ -1,38 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx_cw_d.h -// Purpose: wxWidgets definitions for CodeWarrior builds (Debug) -// Author: Stefan Csomor -// Modified by: -// Created: 12/10/98 -// RCS-ID: $Id: wx_cwc_d.h 36967 2006-01-18 14:13:20Z JS $ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_CW__ -#define _WX_CW__ - -#if __MWERKS__ >= 0x2400 && __MWERKS__ < 0x3200 - #pragma old_argmatch on -#endif - -#if __option(profile) -#error "profiling is not supported in debug versions" -#else -#ifdef __cplusplus - #ifdef __MACH__ - #include "wx_Mach++_d.mch" - #elif __POWERPC__ - #include "wx_Carbon++_d.mch" - #endif -#else - #ifdef __MACH__ - #include "wx_Mach_d.mch" - #elif __POWERPC__ - #include "wx_Carbon_d.mch" - #endif -#endif -#endif - -#endif - // _WX_CW__ diff --git a/wxWidgets/include/wx/wx_cwcocoa.h b/wxWidgets/include/wx/wx_cwcocoa.h deleted file mode 100644 index 920fde5409..0000000000 --- a/wxWidgets/include/wx/wx_cwcocoa.h +++ /dev/null @@ -1,66 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: include/wx/wx_cwcocoa.h -// Purpose: Metrowerks Prefix Header File (wxCocoa Release) -// Author: Tommy Tian (tommy.tian@webex.com) -// Modified by: David Elliott -// Created: 10/22/2004 -// RCS-ID: $Id: wx_cwcocoa.h 30235 2004-11-02 06:22:11Z DE $ -// Copyright: (c) Tommy Tian -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_CW_COCOA__ -#define _WX_CW_COCOA__ - -#if __MWERKS__ >= 0x2400 && __MWERKS__ <= 0x3200 -#pragma old_argmatch on -#endif - -#if __option(profile) -#ifdef __cplusplus - #ifdef __OBJC__ - #if __mwlinker__ - #include "wx_cocoaMacOSXmm_prof.mch" - #else - #include "wx_cocoaMach-Omm_prof.mch" - #endif - #else - #if __mwlinker__ - #include "wx_cocoaMacOSX++_prof.mch" - #else - #include "wx_cocoaMach-O++_prof.mch" - #endif - #endif -#else - #if __mwlinker__ - #include "wx_cocoaMacOSX_prof.mch" - #else - #include "wx_cocoaMach-O_prof.mch" - #endif -#endif -#else -#ifdef __cplusplus - #ifdef __OBJC__ - #if __mwlinker__ - #include "wx_cocoaMacOSXmm.mch" - #else - #include "wx_cocoaMach-Omm.mch" - #endif - #else - #if __mwlinker__ - #include "wx_cocoaMacOSX++.mch" - #else - #include "wx_cocoaMach-O++.mch" - #endif - #endif -#else - #if __mwlinker__ - #include "wx_cocoaMacOSX.mch" - #else - #include "wx_cocoaMach-O.mch" - #endif -#endif -#endif - -#endif - // _WX_CW_COCOA__ diff --git a/wxWidgets/include/wx/wx_cwcocoa_cm.h b/wxWidgets/include/wx/wx_cwcocoa_cm.h deleted file mode 100644 index fbe176d4b4..0000000000 --- a/wxWidgets/include/wx/wx_cwcocoa_cm.h +++ /dev/null @@ -1,85 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: include/wx/wx_cwcocoa_cm.h -// Purpose: Metrowerks wxCocoa PCH common definitions -// Author: Tommy Tian (tommy.tian@webex.com) -// Modified by: -// Created: 10/04/2004 -// RCS-ID: $Id: wx_cwcocoa_cm.h 30235 2004-11-02 06:22:11Z DE $ -// Copyright: (c) Tommy Tian -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#define MSL_USE_PRECOMPILED_HEADERS 0 -#if __WXDEBUG__ - // mac os assert levels - #define DEBUG 1 - #define DEBUG_INTERNAL 1 -#endif -#if !defined( __MWERKS__ ) - #error "this file is only for builds with Metrowerks CodeWarrior" -#endif - -#define WX_COMP_INLINE_NO_CLASS // defined if the compiler does not want the classname repeated for inlines within a class definition - -#if __MWERKS__ >= 0x2400 && __MWERKS__ <= 0x3200 -#pragma old_argmatch on -#endif - -#if (__MWERKS__ < 0x0900) || macintosh || __MACH__ - #define __MAC__ - #define __WXCOCOA__ -#elif (__MWERKS__ >= 0x0900) && __INTEL__ - #define WIN32 - #define _WINDOWS - #define __WXMSW__ - #define __WINDOWS__ - #define __WIN95__ - #define __WIN32__ - #define STRICT - #define NOMINMAX -#elif __BEOS__ - #include <ansi_prefix.be.h> - #include <Be.h> -#else - #error unknown MW compiler -#endif - -#ifdef __WXMSW__ - #include <ansi_prefix.win32.h> - #include <ansi_parms.h> - #ifdef __MWERKS__ - #if defined( __MSL__ ) && __MSL__ >= 0x5012 && __MSL__ < 0x7000 - #define fileno _fileno - #define fdopen _fdopen - #define tell _tell - #endif - #endif -#elif defined( __WXMAC__) - #define USE_PRECOMPILED_MAC_HEADERS 0 /*Set to 0 if you don't want to use precompiled MacHeaders*/ - #define ACCESSOR_CALLS_ARE_FUNCTIONS 1 - #define OPAQUE_TOOLBOX_STRUCTS 1 - #ifdef __MACH__ - #include <ansi_prefix.mach.h> - #include <msl_c_version.h> - #include <stdint.h> - #undef WCHAR_MAX - #include <machine/ansi.h> - #else - #include <ansi_prefix.mac.h> - #endif - // for getting the correct expat includes - #define MACOS_CLASSIC - /* - #include <MacTypes.h> - #if UNIVERSAL_INTERFACES_VERSION < 0x0340 - #error "please update to Apple's lastest universal headers from http://developer.apple.com/sdk/" - #endif - */ -#elif defined( __WXCOCOA__) //tommy - #if defined(__OBJC__) - #include "CocoaHeaders.m" - #endif //defined(__OBJC__) -#endif - -#define USE_DEFINE - diff --git a/wxWidgets/include/wx/wx_cwcocoa_d.h b/wxWidgets/include/wx/wx_cwcocoa_d.h deleted file mode 100644 index de2b5b95be..0000000000 --- a/wxWidgets/include/wx/wx_cwcocoa_d.h +++ /dev/null @@ -1,47 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: include/wx/wx_cwcocoa_d.h -// Purpose: Metrowerks Prefix Header File (wxCocoa Debug) -// Author: Tommy Tian (tommy.tian@webex.com) -// Modified by: David Elliott -// Created: 10/04/2004 -// RCS-ID: $Id: wx_cwcocoa_d.h 30235 2004-11-02 06:22:11Z DE $ -// Copyright: (c) Tommy Tian -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - - -#ifndef _WX_CW_COCOA__ -#define _WX_CW_COCOA__ - -#if __MWERKS__ >= 0x2400 && __MWERKS__ <= 0x3200 -#pragma old_argmatch on -#endif - -#if __option(profile) -#error "profiling is not supported in debug versions" -#else -#ifdef __cplusplus - #ifdef __OBJC__ - #if __mwlinker__ - #include "wx_cocoaMacOSXmm_d.mch" - #else - #include "wx_cocoaMach-Omm_d.mch" - #endif - #else - #if __mwlinker__ - #include "wx_cocoaMacOSX++_d.mch" - #else - #include "wx_cocoaMach-O++_d.mch" - #endif - #endif -#else - #if __mwlinker__ - #include "wx_cocoaMacOSX_d.mch" - #else - #include "wx_cocoaMach-O_d.mch" - #endif -#endif -#endif - -#endif - // _WX_CW_COCOA__ diff --git a/wxWidgets/include/wx/wx_cwu_d.h b/wxWidgets/include/wx/wx_cwu_d.h deleted file mode 100644 index 24c384a776..0000000000 --- a/wxWidgets/include/wx/wx_cwu_d.h +++ /dev/null @@ -1,46 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx_cw_d.h -// Purpose: wxWidgets definitions for CodeWarrior builds (Debug) -// Author: Stefan Csomor -// Modified by: -// Created: 12/10/98 -// RCS-ID: $Id: wx_cwu_d.h 29319 2004-09-24 14:32:35Z ABX $ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_CW__ -#define _WX_CW__ - -#if __MWERKS__ >= 0x2400 -#pragma old_argmatch on -#endif - -#if __option(profile) -#error "profiling is not supported in debug versions" -#else -#ifdef __cplusplus - #if __POWERPC__ - #include <wx_PPCu++_d.mch> - #elif __INTEL__ - #include <wx_x86u++_d.mch> - #elif __CFM68K__ - #include <wx_cfmu++_d.mch> - #else - #include <wx_68ku++_d.mch> - #endif -#else - #if __POWERPC__ - #include <wx_PPCu_d.mch> - #elif __INTEL__ - #include <wx_x86u_d.mch> - #elif __CFM68K__ - #include <wx_cfmu_d.mch> - #else - #include <wx_68ku_d.mch> - #endif -#endif -#endif - -#endif - // _WX_CW__ diff --git a/wxWidgets/include/wx/wxchar.h b/wxWidgets/include/wx/wxchar.h deleted file mode 100644 index 0c33d6c969..0000000000 --- a/wxWidgets/include/wx/wxchar.h +++ /dev/null @@ -1,1413 +0,0 @@ -/* - * Name: wx/wxchar.h - * Purpose: Declarations common to wx char/wchar_t usage (wide chars) - * Author: Joel Farley, Ove Kaaven - * Modified by: Vadim Zeitlin, Robert Roebling, Ron Lee - * Created: 1998/06/12 - * RCS-ID: $Id: wxchar.h 66970 2011-02-19 13:54:14Z VZ $ - * Copyright: (c) 1998-2006 wxWidgets dev team - * Licence: wxWindows licence - */ - -/* THIS IS A C FILE, DON'T USE C++ FEATURES (IN PARTICULAR COMMENTS) IN IT */ - -#ifndef _WX_WXCHAR_H_ -#define _WX_WXCHAR_H_ - -/* defs.h indirectly includes this file, so don't include it here */ -#include "wx/platform.h" -#include "wx/dlimpexp.h" - -#include <stdio.h> /* we use FILE below */ - -#if defined(HAVE_STRTOK_R) && defined(__DARWIN__) && defined(_MSL_USING_MW_C_HEADERS) && _MSL_USING_MW_C_HEADERS - char *strtok_r(char *, const char *, char **); -#endif - -/* check whether we have wchar_t and which size it is if we do */ -#if !defined(wxUSE_WCHAR_T) - #if defined(__UNIX__) - #if defined(HAVE_WCSTR_H) || defined(HAVE_WCHAR_H) || defined(__FreeBSD__) || defined(__DARWIN__) - #define wxUSE_WCHAR_T 1 - #else - #define wxUSE_WCHAR_T 0 - #endif - #elif defined(__GNUWIN32__) && !defined(__MINGW32__) - #define wxUSE_WCHAR_T 0 - #elif defined(__WATCOMC__) - #define wxUSE_WCHAR_T 0 - #elif defined(__VISAGECPP__) && (__IBMCPP__ < 400) - #define wxUSE_WCHAR_T 0 - #else - /* add additional compiler checks if this fails */ - #define wxUSE_WCHAR_T 1 - #endif -#endif /* !defined(wxUSE_WCHAR_T) */ - -/* Unicode support requires wchar_t */ -#if wxUSE_UNICODE && !wxUSE_WCHAR_T - #error "wchar_t must be available in Unicode build" -#endif /* Unicode */ - -/* - Standard headers we need here. - - NB: don't include any wxWidgets headers here because almost all of them include - this one! - */ - -/* Required for wxPrintf() etc */ -#include <stdarg.h> - -/* Almost all compiler have strdup(), but not quite all: CodeWarrior under Mac */ -/* and VC++ for Windows CE don't provide it */ -#if defined(__VISUALC__) && __VISUALC__ >= 1400 - #define wxStrdupA _strdup -#elif !(defined(__MWERKS__) && defined(__WXMAC__)) && !defined(__WXWINCE__) - /* use #define, not inline wrapper, as it is tested with #ifndef below */ - #define wxStrdupA strdup -#endif - -/* - non Unix compilers which do have wchar.h (but not tchar.h which is included - below and which includes wchar.h anyhow). - - Actually MinGW has tchar.h, but it does not include wchar.h - */ -#if defined(__MWERKS__) || defined(__VISAGECPP__) || defined(__MINGW32__) || defined(__WATCOMC__) - #ifndef HAVE_WCHAR_H - #define HAVE_WCHAR_H - #endif -#endif -#if defined(__MWERKS__) && !defined(__MACH__) - #ifndef HAVE_WCSLEN - #define HAVE_WCSLEN - #endif -#endif - -#if wxUSE_WCHAR_T - #ifdef HAVE_WCHAR_H - /* the current (as of Nov 2002) version of cygwin has a bug in its */ - /* wchar.h -- there is no extern "C" around the declarations in it and */ - /* this results in linking errors later; also, at least on some */ - /* Cygwin versions, wchar.h requires sys/types.h */ - #ifdef __CYGWIN__ - #include <sys/types.h> - #ifdef __cplusplus - extern "C" { - #endif - #endif /* Cygwin */ - - #include <wchar.h> - - #if defined(__CYGWIN__) && defined(__cplusplus) - } - #endif /* Cygwin and C++ */ - - #elif defined(HAVE_WCSTR_H) - /* old compilers have relevant declarations here */ - #include <wcstr.h> - #elif defined(__FreeBSD__) || defined(__DARWIN__) || defined(__EMX__) - /* include stdlib.h for wchar_t */ - #include <stdlib.h> - #endif /* HAVE_WCHAR_H */ - - #ifdef HAVE_WIDEC_H - #include <widec.h> - #endif -#endif /* wxUSE_WCHAR_T */ - -/* ---------------------------------------------------------------------------- */ -/* define wxHAVE_TCHAR_SUPPORT for the compilers which support the TCHAR type */ -/* mapped to either char or wchar_t depending on the ASCII/Unicode mode and have */ -/* the function mapping _tfoo() -> foo() or wfoo() */ -/* ---------------------------------------------------------------------------- */ - -/* VC++ and BC++ starting with 5.2 have TCHAR support */ -#ifdef __VISUALC__ - #define wxHAVE_TCHAR_SUPPORT -#elif defined(__BORLANDC__) && (__BORLANDC__ >= 0x520) - #define wxHAVE_TCHAR_SUPPORT - #include <ctype.h> - #include <memory.h> -#elif defined(__WATCOMC__) - #define wxHAVE_TCHAR_SUPPORT -#elif defined(__DMC__) - #define wxHAVE_TCHAR_SUPPORT -#elif defined(__WXPALMOS__) - #include <stddef.h> -#elif defined(__MINGW32__) && wxCHECK_W32API_VERSION( 1, 0 ) - #define wxHAVE_TCHAR_SUPPORT - #include <stddef.h> - #include <string.h> - #include <ctype.h> -#elif 0 && defined(__VISAGECPP__) && (__IBMCPP__ >= 400) - /* VZ: the old VisualAge definitions were completely wrong and had no */ - /* chance at all to work in Unicode build anyhow so let's pretend that */ - /* VisualAge does _not_ support TCHAR for the moment (as indicated by */ - /* "0 &&" above) until someone really has time to delve into Unicode */ - /* issues under OS/2 */ - - /* VisualAge 4.0+ supports TCHAR */ - #define wxHAVE_TCHAR_SUPPORT -#endif /* compilers with (good) TCHAR support */ - -#if defined(__MWERKS__) - /* Metrowerks only has wide char support for OS X >= 10.3 */ - #if !defined(__DARWIN__) || \ - (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_3) - #define wxHAVE_MWERKS_UNICODE - #endif - - #ifdef wxHAVE_MWERKS_UNICODE - #define HAVE_WPRINTF 1 - #define HAVE_WCSRTOMBS 1 - #define HAVE_VSWPRINTF 1 - #endif -#endif /* __MWERKS__ */ - -#ifdef wxHAVE_TCHAR_SUPPORT - /* get TCHAR definition if we've got it */ - #include <tchar.h> - - /* we surely do have wchar_t if we have TCHAR */ - #ifndef wxUSE_WCHAR_T - #define wxUSE_WCHAR_T 1 - #endif /* !defined(wxUSE_WCHAR_T) */ - - /* and we also do have wcslen() */ - #ifndef HAVE_WCSLEN - #define HAVE_WCSLEN - #endif -#endif /* wxHAVE_TCHAR_SUPPORT */ - -/* ---------------------------------------------------------------------------- */ -/* define wxChar type */ -/* ---------------------------------------------------------------------------- */ - -/* TODO: define wxCharInt to be equal to either int or wint_t? */ - -#if !wxUSE_UNICODE - typedef char wxChar; - typedef signed char wxSChar; - typedef unsigned char wxUChar; -#else /* Unicode */ - /* VZ: note that VC++ defines _T[SU]CHAR simply as wchar_t and not as */ - /* signed/unsigned version of it which (a) makes sense to me (unlike */ - /* char wchar_t is always unsigned) and (b) was how the previous */ - /* definitions worked so keep it like this */ - - /* Sun's SunPro compiler supports the wchar_t type and wide character */ - /* functions, but does not define __WCHAR_TYPE__. Define it here to */ - /* allow unicode enabled builds. */ - #if defined(__SUNPRO_CC) || defined(__SUNPRO_C) - #define __WCHAR_TYPE__ wxchar_t - #endif - - /* GNU libc has __WCHAR_TYPE__ which requires special treatment, see */ - /* comment below */ - #if !defined(__WCHAR_TYPE__) || \ - (!defined(__GNUC__) || wxCHECK_GCC_VERSION(2, 96)) - /* standard case */ - typedef wchar_t wxChar; - typedef wchar_t wxSChar; - typedef wchar_t wxUChar; - #else /* __WCHAR_TYPE__ and gcc < 2.96 */ - /* VS: wxWidgets used to define wxChar as __WCHAR_TYPE__ here. However, */ - /* this doesn't work with new GCC 3.x compilers because wchar_t is */ - /* C++'s builtin type in the new standard. OTOH, old compilers (GCC */ - /* 2.x) won't accept new definition of wx{S,U}Char, therefore we */ - /* have to define wxChar conditionally depending on detected */ - /* compiler & compiler version. */ - /* with old definition of wxChar. */ - typedef __WCHAR_TYPE__ wxChar; - typedef __WCHAR_TYPE__ wxSChar; - typedef __WCHAR_TYPE__ wxUChar; - #endif /* __WCHAR_TYPE__ */ -#endif /* ASCII/Unicode */ - -/* ---------------------------------------------------------------------------- */ -/* define wxT() and related macros */ -/* ---------------------------------------------------------------------------- */ - -#if wxUSE_UNICODE - /* use wxCONCAT_HELPER so that x could be expanded if it's a macro */ - #define wxT(x) wxCONCAT_HELPER(L, x) -#else /* !Unicode */ - #define wxT(x) x -#endif /* Unicode/!Unicode */ - -/* - This macro is defined for forward compatibility with wxWidgets 3. It should - be used in the places where wxWidgets 2 API requires wxT() (in Unicode - build) but wxWidgets 3 doesn't accept it, e.g. wxCmdLineEntryDesc struct - elements initializers. - */ -#define wxT_2(x) wxT(x) - -/* - We define _T() as a synonym of wxT() for backwards compatibility and also - for the benefit of Windows programmers used to it. But this identifier is a - reserved one and this does create problems in practice, notably with Sun CC - which uses it in the recent versions of its standard headers. So avoid - defining it for this compiler at all, unless it was explicitly requested by - predefining wxNEEDS__T macro before including this header or if we're - building wx itself which does need and compiles fine thanks to the special - workarounds for Sun CC in wx/{before,after}std.h. - */ -#ifndef wxNEEDS__T - #if defined(WXBUILDING) || !(defined (__SUNPRO_C) || defined(__SUNPRO_CC)) - #define wxNEEDS__T - #endif -#endif - -#ifdef wxNEEDS__T - /* BSDs define _T() to be something different in ctype.h, override it */ - #if defined(__FreeBSD__) || defined(__DARWIN__) - #include <ctype.h> - #endif - #undef _T - - #define _T(x) wxT(x) -#endif /* wxNEEDS__T */ - -/* this macro exists only for forward compatibility with wx 3.0 */ -#define wxS(x) wxT(x) - -/* a helper macro allowing to make another macro Unicode-friendly, see below */ -#define wxAPPLY_T(x) wxT(x) - -/* Unicode-friendly __FILE__, __DATE__ and __TIME__ analogs */ -#ifndef __TFILE__ - #define __TFILE__ wxAPPLY_T(__FILE__) -#endif - -#ifndef __TDATE__ - #define __TDATE__ wxAPPLY_T(__DATE__) -#endif - -#ifndef __TTIME__ - #define __TTIME__ wxAPPLY_T(__TIME__) -#endif - -/* - define wxFoo() function for each standard foo() function whose signature - (exceptionally including the return type) includes any mention of char: - wxFoo() is going to be a Unicode-friendly version of foo(), i.e. will have - the same signature but with char replaced by wxChar which allows us to use - it in Unicode build as well - */ - -#ifdef wxHAVE_TCHAR_SUPPORT - #include <ctype.h> - - #if defined(__WATCOMC__) && defined(UNICODE) - #define WXWCHAR_T_CAST(c) (wint_t)(c) - #else - #define WXWCHAR_T_CAST(c) c - #endif - - /* ctype.h functions */ - #define wxIsalnum(c) _istalnum(WXWCHAR_T_CAST(c)) - #define wxIsalpha(c) _istalpha(WXWCHAR_T_CAST(c)) - #define wxIscntrl(c) _istcntrl(WXWCHAR_T_CAST(c)) - #define wxIsdigit(c) _istdigit(WXWCHAR_T_CAST(c)) - #define wxIsgraph(c) _istgraph(WXWCHAR_T_CAST(c)) - #define wxIslower(c) _istlower(WXWCHAR_T_CAST(c)) - #define wxIsprint(c) _istprint(WXWCHAR_T_CAST(c)) - #define wxIspunct(c) _istpunct(WXWCHAR_T_CAST(c)) - #define wxIsspace(c) _istspace(WXWCHAR_T_CAST(c)) - #define wxIsupper(c) _istupper(WXWCHAR_T_CAST(c)) - #define wxIsxdigit(c) _istxdigit(WXWCHAR_T_CAST(c)) - - /* - There is a bug in VC6 C RTL: toxxx() functions dosn't do anything with - signed chars < 0, so "fix" it here. - */ - #define wxTolower(c) _totlower((wxUChar)(c)) - #define wxToupper(c) _totupper((wxUChar)(c)) - - /* locale.h functons */ - #define wxSetlocale _tsetlocale - - /* string.h functions */ - #define wxStrcat _tcscat - #define wxStrchr _tcschr - #define wxStrcmp _tcscmp - #define wxStrcoll _tcscoll - #define wxStrcpy _tcscpy - #define wxStrcspn _tcscspn - #define wxStrdupW _wcsdup /* notice the 'W'! */ - #define wxStrftime _tcsftime - #define wxStricmp _tcsicmp - #define wxStrnicmp _tcsnicmp - #define wxStrlen_ _tcslen /* used in wxStrlen inline function */ - #define wxStrncat _tcsncat - #define wxStrncmp _tcsncmp - #define wxStrncpy _tcsncpy - #define wxStrpbrk _tcspbrk - #define wxStrrchr _tcsrchr - #define wxStrspn _tcsspn - #define wxStrstr _tcsstr - #define wxStrtod _tcstod - #define wxStrtol _tcstol - #define wxStrtoul _tcstoul - #ifdef __VISUALC__ - #if __VISUALC__ >= 1300 && !defined(__WXWINCE__) - #define wxStrtoll _tcstoi64 - #define wxStrtoull _tcstoui64 - #endif /* VC++ 7+ */ - #endif - #define wxStrxfrm _tcsxfrm - - /* stdio.h functions */ - #define wxFgetc _fgettc - #define wxFgetchar _fgettchar - #define wxFgets _fgetts - #if wxUSE_UNICODE_MSLU - WXDLLIMPEXP_BASE FILE * wxMSLU__tfopen(const wxChar *name, const wxChar *mode); - - #define wxFopen wxMSLU__tfopen - #else - #define wxFopen _tfopen - #endif - #define wxFputc _fputtc - #define wxFputchar _fputtchar - #define wxFprintf _ftprintf - #define wxFputs _fputts - #define wxFreopen _tfreopen - #define wxFscanf _ftscanf - #define wxGetc _gettc - #define wxGetchar _gettchar - #define wxGets _getts - #define wxPerror _tperror - #define wxPrintf _tprintf - #define wxPutc(c,f) _puttc(WXWCHAR_T_CAST(c),f) - #define wxPutchar _puttchar - #define wxPuts _putts - #define wxScanf _tscanf - #if defined(__DMC__) - #if wxUSE_UNICODE - /* Digital Mars adds count to _stprintf (C99) so prototype conversion see wxchar.cpp */ - int wxSprintf (wchar_t * __RESTRICT s, const wchar_t * __RESTRICT format, ... ) ; - #else - /* and there is a bug in D Mars tchar.h prior to 8.39.4n, so define as sprintf */ - #define wxSprintf sprintf - #endif - #elif defined(__MINGW32__) && ( defined(_STLPORT_VERSION) && _STLPORT_VERSION >= 0x510 ) - #if wxUSE_UNICODE - /* MinGW with STLPort 5.1 adds count to swprintf (C99) so prototype conversion see wxchar.cpp */ - int wxSprintf (wchar_t*, const wchar_t*, ...); - #else - /* MinGW with STLPort 5.1 has clashing defines for _stprintf so use sprintf */ - #define wxSprintf sprintf - #endif - #else - #define wxSprintf _stprintf - #endif - - #define wxSscanf _stscanf - #define wxTmpnam _ttmpnam - #define wxUngetc _tungetc - #define wxVfprintf _vftprintf - #define wxVprintf _vtprintf - #define wxVsscanf _vstscanf - #define wxVsprintf _vstprintf - - /* special case: these functions are missing under Win9x with Unicows so we */ - /* have to implement them ourselves */ - #if wxUSE_UNICODE_MSLU - WXDLLIMPEXP_BASE int wxMSLU__trename(const wxChar *oldname, const wxChar *newname); - WXDLLIMPEXP_BASE int wxMSLU__tremove(const wxChar *name); - - #define wxRemove wxMSLU__tremove - #define wxRename wxMSLU__trename - #else - #ifdef __WXWINCE__ - /* carefully: wxRemove() must return 0 on success while DeleteFile() - returns 0 on error, so don't just define one as the other */ - int wxRemove(const wxChar *path); - #else - #define wxRemove _tremove - #define wxRename _trename - #endif - #endif - - /* stdlib.h functions */ - #define wxAtoi _ttoi - #define wxAtol _ttol - /* #define wxAtof _tttof -- notice that there is no such thing (why?) */ - /* there are no env vars at all under CE, so no _tgetenv neither */ - #ifdef __WXWINCE__ - /* can't define as inline function as this is a C file... */ - #define wxGetenv(name) ((wxChar *)NULL) - #else - #define wxGetenv _tgetenv - #endif - #define wxSystem _tsystem - - /* time.h functions */ - #define wxAsctime _tasctime - #define wxCtime _tctime - - #define wxMbstowcs mbstowcs - #define wxWcstombs wcstombs -#else /* !TCHAR-aware compilers */ - /* - There are 2 unrelated problems with these functions under Mac: - a) Metrowerks MSL CRT implements them strictly in C99 sense and - doesn't support (very common) extension of allowing to call - mbstowcs(NULL, ...) which makes it pretty useless as you can't - know the size of the needed buffer - b) OS X <= 10.2 declares and even defined these functions but - doesn't really implement them -- they always return an error - - So use our own replacements in both cases. - */ - #if defined(__MWERKS__) && defined(__MSL__) - #define wxNEED_WX_MBSTOWCS - #endif - - #ifdef __DARWIN__ - #if MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_2 - #define wxNEED_WX_MBSTOWCS - #endif - #endif - - #ifdef wxNEED_WX_MBSTOWCS - /* even though they are defined and "implemented", they are bad and just - stubs so we need our own - we need these even in ANSI builds!! */ - WXDLLIMPEXP_BASE size_t wxMbstowcs (wchar_t *, const char *, size_t); - WXDLLIMPEXP_BASE size_t wxWcstombs (char *, const wchar_t *, size_t); - #else - #define wxMbstowcs mbstowcs - #define wxWcstombs wcstombs - #endif - - /* - The system C library on Mac OS X 10.2 and below does not support - unicode: in other words all wide-character functions such as towupper et - al. do simply not exist so we need to provide our own in that context, - except for the wchar_t definition/typedef itself. - - We need to do this for both project builder and CodeWarrior as - the latter uses the system C library in Mach builds for wide character - support, which as mentioned does not exist on 10.2 and below. - */ - #if wxUSE_UNICODE && \ - defined(__DARWIN__) && \ - ( MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_2 ) - /* we need everything! */ - #define wxNEED_WX_STRING_H - #define wxNEED_WX_CTYPE_H - - #define wxFgetchar(c) wxFgetc(c, stdin) - #define wxFputc wxPutc - #define wxFputchar(c) wxPutc(c, stdout) - #define wxGetc wxFgetc - #define wxGetchar(c) wxFgetc(c, stdin) - - #include <stdio.h> - - #define wxNEED_FGETC - #define wxNEED_FGETS - #define wxNEED_GETS - #define wxNEED_UNGETC - - #define wxNEED_FPUTS - #define wxNEED_PUTS - #define wxNEED_PUTC - - int wxFputs(const wxChar *ch, FILE *stream); - int wxPuts(const wxChar *ws); - int wxPutc(wxChar ch, FILE *stream); - - #ifdef __cplusplus - extern "C" { - #endif - WXDLLIMPEXP_BASE size_t wxStrlen_(const wxChar *s); - #ifdef __cplusplus - } - #endif - - #define wxPutchar(wch) wxPutc(wch, stdout) - - #define wxNEED_PRINTF_CONVERSION - #define wxNEED_WX_STDIO_H - #define wxNEED_WX_STDLIB_H - #define wxNEED_WX_TIME_H - - #elif wxUSE_UNICODE - #include <wctype.h> - - /* this is probably glibc-specific */ - #if defined(__WCHAR_TYPE__) && !defined(__MWERKS__) - /* ctype.h functions (wctype.h) */ - #define wxIsalnum iswalnum - #define wxIsalpha iswalpha - #define wxIscntrl iswcntrl - #define wxIsdigit iswdigit - #define wxIsgraph iswgraph - #define wxIslower iswlower - #define wxIsprint iswprint - #define wxIspunct iswpunct - #define wxIsspace iswspace - #define wxIsupper iswupper - #define wxIsxdigit iswxdigit - - #if defined(__GLIBC__) && (__GLIBC__ == 2) && (__GLIBC_MINOR__ == 0) - /* /usr/include/wctype.h incorrectly declares translations */ - /* tables which provokes tons of compile-time warnings -- try */ - /* to correct this */ - #define wxTolower(wc) towctrans((wc), (wctrans_t)__ctype_tolower) - #define wxToupper(wc) towctrans((wc), (wctrans_t)__ctype_toupper) - #else /* !glibc 2.0 */ - #define wxTolower towlower - #define wxToupper towupper - #endif /* gcc/!gcc */ - - /* string.h functions (wchar.h) */ - #define wxStrcat wcscat - #define wxStrchr wcschr - #define wxStrcmp wcscmp - #define wxStrcoll wcscoll - #define wxStrcpy wcscpy - #define wxStrcspn wcscspn - #define wxStrlen_ wxWcslen /* wxStrlen_() is used in wxStrlen() */ - #define wxStrncat wcsncat - #define wxStrncmp wcsncmp - #define wxStrncpy wcsncpy - #define wxStrpbrk wcspbrk - #define wxStrrchr wcsrchr - #define wxStrspn wcsspn - #define wxStrstr wcsstr - #define wxStrtod wcstod - #define wxStrtol wcstol - #define wxStrtoul wcstoul - #ifdef HAVE_WCSTOULL - /* assume that we have wcstoull(), which is also C99, too */ - #define wxStrtoll wcstoll - #define wxStrtoull wcstoull - #endif /* HAVE_WCSTOULL */ - #define wxStrxfrm wcsxfrm - - #define wxFgetc fgetwc - #define wxFgetchar fgetwchar - #define wxFgets fgetws - #define wxFputc fputwc - #define wxFputchar fputwchar - #define wxGetc getwc - #define wxGetchar getwchar - #define wxGets getws - #define wxUngetc ungetwc - - #ifdef HAVE_FPUTWS - #define wxFputs fputws - #else - #define wxNEED_FPUTS - #include <stdio.h> - int wxFputs(const wxChar *ch, FILE *stream); - #endif - - #ifdef HAVE_WPUTC - #define wxPutc wputc - #else - #define wxNEED_PUTC - #include <stdio.h> - int wxPutc(wxChar ch, FILE *stream); - #endif - - #ifdef HAVE_WPUTCHAR - #define wxPutchar wputchar - #else - #define wxPutchar(wch) wxPutc(wch, stdout) - #endif - - #ifdef HAVE_PUTWS - #define wxPuts putws - #else - #define wxNEED_PUTS - int wxPuts(const wxChar *ws); - #endif - - /* we need %s to %ls conversion for printf and scanf etc */ - #define wxNEED_PRINTF_CONVERSION - - /* glibc doesn't have wide char equivalents of the other stuff so */ - /* use our own versions */ - #define wxNEED_WX_STDIO_H - #define wxNEED_WX_STDLIB_H - #define wxNEED_WX_TIME_H - #elif defined(__MWERKS__) && ( defined(__MSL__) || defined(__MACH__) ) - /* ctype.h functions (wctype.h) */ - #define wxIsalnum iswalnum - #define wxIsalpha iswalpha - #define wxIscntrl iswcntrl - #define wxIsdigit iswdigit - #define wxIsgraph iswgraph - #define wxIslower iswlower - #define wxIsprint iswprint - #define wxIspunct iswpunct - #define wxIsspace iswspace - #define wxIsupper iswupper - #define wxIsxdigit iswxdigit - #define wxTolower towlower - #define wxToupper towupper - - /* string.h functions (wchar.h) */ - #define wxStrcat wcscat - #define wxStrchr wcschr - #define wxStrcmp wcscmp - #define wxStrcoll wcscoll - #define wxStrcpy wcscpy - #define wxStrcspn wcscspn - #define wxStrlen_ wxWcslen /* wxStrlen_() is used in wxStrlen() */ - #define wxStrncat wcsncat - #define wxStrncmp wcsncmp - #define wxStrncpy wcsncpy - #define wxStrpbrk wcspbrk - #define wxStrrchr wcsrchr - #define wxStrspn wcsspn - #define wxStrstr wcsstr - #define wxStrtod wcstod - #define wxStrtol wcstol - #define wxStrtoul wcstoul - #define wxStrxfrm wcsxfrm - - #define wxFgetc fgetwc - #define wxFgetchar fgetwchar - #define wxFgets fgetws - #define wxFputc fputwc - #define wxFputchar fputwchar - #define wxGetc getwc - #define wxGetchar getwchar - #define wxGets getws - #define wxUngetc ungetwc - - #define wxNEED_PRINTF_CONVERSION - - #define wxPutc putwc - #define wxPutchar putwchar - #define wxFputs fputws - - /* stdio.h functions */ - - #define wxNEED_WX_STDIO_H - - /* stdlib.h functions */ - #ifdef __MACH__ - #define wxNEED_WX_STDLIB_H - #else - #define wxAtof watof - #define wxAtoi watoi - #define wxAtol watol - #define wxGetenv(a) ((wxChar*)NULL) - #define wxSystem(a) ((int)NULL) - #endif - /* time.h functions */ - #define wxAsctime wasciitime - #define wxCtime wctime - /* #define wxStrftime wcsftime */ - - #define wxNEED_WX_TIME_H - #else /* !metrowerks for apple */ - #error "Please define wide character functions for your environment" - #endif - #else /* ASCII */ - #include <ctype.h> - #include <string.h> - - /* ctype.h functions */ - #define wxIsalnum isalnum - #define wxIsalpha isalpha - #define wxIscntrl iscntrl - #define wxIsdigit isdigit - #define wxIsgraph isgraph - #define wxIslower islower - #define wxIsprint isprint - #define wxIspunct ispunct - #define wxIsspace isspace - #define wxIsupper isupper - #define wxIsxdigit isxdigit - #define wxTolower tolower - #define wxToupper toupper - - /* locale.h functons */ - #define wxSetlocale setlocale - - /* string.h functions */ - #define wxStrcat strcat - #define wxStrchr strchr - #define wxStrcmp strcmp - #define wxStrcoll strcoll - #define wxStrcpy strcpy - #define wxStrcspn strcspn - - /* wxStricmp and wxStrnicmp are defined below */ - #define wxStrlen_ strlen /* used in wxStrlen inline function */ - #define wxStrncat strncat - #define wxStrncmp strncmp - #define wxStrncpy strncpy - #define wxStrpbrk strpbrk - #define wxStrrchr strrchr - #define wxStrspn strspn - #define wxStrstr strstr - #define wxStrtod strtod - #ifdef HAVE_STRTOK_R - #define wxStrtok(str, sep, last) strtok_r(str, sep, last) - #endif - #define wxStrtol strtol - #define wxStrtoul strtoul - #ifdef HAVE_STRTOULL - /* assume that we have wcstoull(), which is also C99, too */ - #define wxStrtoll strtoll - #define wxStrtoull strtoull - #endif /* HAVE_WCSTOULL */ - #define wxStrxfrm strxfrm - - /* stdio.h functions */ - #define wxFopen fopen - #define wxFreopen freopen - #define wxRemove remove - #define wxRename rename - - #define wxPerror perror - #define wxTmpnam tmpnam - - #define wxFgetc fgetc - #define wxFgetchar fgetchar - #define wxFgets fgets - #define wxFputc fputc - #define wxFputs fputs - #define wxFputchar fputchar - #define wxFprintf fprintf - #define wxFscanf fscanf - #define wxGetc getc - #define wxGetchar getchar - #define wxGets gets - #define wxPrintf printf - #define wxPutc putc - #define wxPutchar putchar - #define wxPuts puts - #define wxScanf scanf - #define wxSprintf sprintf - #define wxSscanf sscanf - #define wxUngetc ungetc - #define wxVfprintf vfprintf - #define wxVprintf vprintf - #define wxVsscanf vsscanf - #define wxVsprintf vsprintf - - /* stdlib.h functions */ - #define wxAtof atof - #define wxAtoi atoi - #define wxAtol atol - #define wxGetenv getenv - #define wxSystem system - - /* time.h functions */ - #define wxAsctime asctime - #define wxCtime ctime - #define wxStrftime strftime - #endif /* Unicode/ASCII */ -#endif /* TCHAR-aware compilers/the others */ - -#ifdef wxStrtoll - #define wxHAS_STRTOLL -#endif - -/* - various special cases - */ - -/* define wxStricmp and wxStrnicmp for various compilers */ - -/* note that in Unicode mode we definitely are going to need our own version */ -#if !defined(wxStricmp) && !wxUSE_UNICODE - #if defined(__BORLANDC__) || defined(__WATCOMC__) || \ - defined(__SALFORDC__) || defined(__VISAGECPP__) || \ - defined(__EMX__) || defined(__DJGPP__) - #define wxStricmp stricmp - #define wxStrnicmp strnicmp - #elif defined(__WXPALMOS__) - /* FIXME: There is no equivalent to strnicmp in the Palm OS API. This - * quick hack should do until one can be written. - */ - #define wxStricmp StrCaselessCompare - #define wxStrnicmp strnicmp - #elif defined(__SYMANTEC__) || defined(__VISUALC__) || \ - (defined(__MWERKS__) && defined(__INTEL__)) - #define wxStricmp _stricmp - #define wxStrnicmp _strnicmp - #elif defined(__UNIX__) || defined(__GNUWIN32__) - #define wxStricmp strcasecmp - #define wxStrnicmp strncasecmp - /* #else -- use wxWidgets implementation */ - #endif -#endif /* !defined(wxStricmp) */ - -/* define wxWcslen() which should be always available if wxUSE_WCHAR_T == 1 (as */ -/* it's used in wx/buffer.h -- and also might be used just below by wxStrlen() */ -/* when wxStrlen_() is #define'd as wxWcslen so do it before defining wxStrlen) */ -#if wxUSE_WCHAR_T - #ifdef HAVE_WCSLEN - #define wxWcslen wcslen - #else - WXDLLIMPEXP_BASE size_t wxWcslen(const wchar_t *s); - #endif -#endif /* wxUSE_WCHAR_T */ - -#ifdef __cplusplus -/* checks whether the passed in pointer is NULL and if the string is empty */ -inline bool wxIsEmpty(const wxChar *p) { return !p || !*p; } - -/* safe version of strlen() (returns 0 if passed NULL pointer) */ -inline size_t wxStrlen(const wxChar *psz) { return psz ? wxStrlen_(psz) : 0; } -#endif - -/* - each of strdup() and wcsdup() may or may not be available but we need both - of them anyhow for wx/buffer.h so we define the missing one(s) in - wxchar.cpp and so we should always have both wxStrdupA and wxStrdupW - defined -- if this is somehow not the case in some situations, please - correct that and not the lines here - */ -#if wxUSE_UNICODE - #define wxStrdup wxStrdupW -#else - #define wxStrdup wxStrdupA -#endif - -#ifdef __cplusplus -WXDLLIMPEXP_BASE bool wxOKlibc(); /* for internal use */ -#endif - -/* printf() family saga */ - -/* - For some systems [v]snprintf() exists in the system libraries but not in the - headers, so we need to declare it ourselves to be able to use it. - */ -#if defined(HAVE_VSNPRINTF) && !defined(HAVE_VSNPRINTF_DECL) -#ifdef __cplusplus - extern "C" -#else - extern -#endif - int vsnprintf(char *str, size_t size, const char *format, va_list ap); -#endif /* !HAVE_VSNPRINTF_DECL */ - -#if defined(HAVE_SNPRINTF) && !defined(HAVE_SNPRINTF_DECL) -#ifdef __cplusplus - extern "C" -#else - extern -#endif - WXDLLIMPEXP_BASE int snprintf(char *str, size_t size, const char *format, ...); -#endif /* !HAVE_SNPRINTF_DECL */ - -/* Wrapper for vsnprintf if it's 3rd parameter is non-const. Note: the - * same isn't done for snprintf below, the builtin wxSnprintf_ is used - * instead since it's already a simple wrapper */ -#if defined __cplusplus && defined HAVE_BROKEN_VSNPRINTF_DECL - inline int wx_fixed_vsnprintf(char *str, size_t size, const char *format, va_list ap) - { - return vsnprintf(str, size, (char*)format, ap); - } -#endif - -/* - MinGW MSVCRT has non-standard vswprintf() (for MSVC compatibility - presumably) and normally _vsnwprintf() is used instead (but as - STLPort 5.1 defines standard vswprintf(), don't do this for it) - */ -#if defined(HAVE_VSWPRINTF) && defined(__MINGW32__) && !( defined(_STLPORT_VERSION) && _STLPORT_VERSION >= 0x510 ) - #undef HAVE_VSWPRINTF -#endif - -#if wxUSE_PRINTF_POS_PARAMS - /* - The systems where vsnprintf() supports positional parameters should - define the HAVE_UNIX98_PRINTF symbol. - - On systems which don't (e.g. Windows) we are forced to use - our wxVsnprintf() implementation. - */ - #if defined(HAVE_UNIX98_PRINTF) - #if wxUSE_UNICODE - #ifdef HAVE_VSWPRINTF - #define wxVsnprintf_ vswprintf - #endif - #else /* ASCII */ - #ifdef HAVE_BROKEN_VSNPRINTF_DECL - #define wxVsnprintf_ wx_fixed_vsnprintf - #else - #define wxVsnprintf_ vsnprintf - #endif - #endif - #else /* !HAVE_UNIX98_PRINTF */ - /* - The only compiler with positional parameters support under Windows - is VC++ 8.0 which provides a new xxprintf_p() functions family. - The 2003 PSDK includes a slightly earlier version of VC8 than the - main release and does not have the printf_p functions. - */ - #if defined _MSC_FULL_VER && _MSC_FULL_VER >= 140050727 && !defined __WXWINCE__ - #if wxUSE_UNICODE - #define wxVsnprintf_ _vswprintf_p - #else - #define wxVsnprintf_ _vsprintf_p - #endif - #endif - #endif /* HAVE_UNIX98_PRINTF/!HAVE_UNIX98_PRINTF */ -#else /* !wxUSE_PRINTF_POS_PARAMS */ - /* - We always want to define safe snprintf() function to be used instead of - sprintf(). Some compilers already have it (or rather vsnprintf() which - we really need...), otherwise we implement it using our own printf() - code. - - We define function with a trailing underscore here because the real one - is a wrapper around it as explained below - */ - - /* first deal with TCHAR-aware compilers which have _vsntprintf */ - #ifndef wxVsnprintf_ - #if defined(__VISUALC__) || \ - (defined(__BORLANDC__) && __BORLANDC__ >= 0x540) - #define wxVsnprintf_ _vsntprintf - #define wxSnprintf_ _sntprintf - #endif - #endif - - /* if this didn't work, define it separately for Unicode and ANSI builds */ - #ifndef wxVsnprintf_ - #if wxUSE_UNICODE - #if defined(HAVE__VSNWPRINTF) - #define wxVsnprintf_ _vsnwprintf - #elif defined(HAVE_VSWPRINTF) - #define wxVsnprintf_ vswprintf - #elif defined(__WATCOMC__) - #define wxVsnprintf_ _vsnwprintf - #define wxSnprintf_ _snwprintf - #endif - #else /* ASCII */ - /* - All versions of CodeWarrior supported by wxWidgets apparently - have both snprintf() and vsnprintf() - */ - #if defined(HAVE_SNPRINTF) \ - || defined(__MWERKS__) || defined(__WATCOMC__) - #ifndef HAVE_BROKEN_SNPRINTF_DECL - #define wxSnprintf_ snprintf - #endif - #endif - #if defined(HAVE_VSNPRINTF) \ - || defined(__MWERKS__) || defined(__WATCOMC__) - #ifdef HAVE_BROKEN_VSNPRINTF_DECL - #define wxVsnprintf_ wx_fixed_vsnprintf - #else - #define wxVsnprintf_ vsnprintf - #endif - #endif - #endif /* Unicode/ASCII */ - #endif /* wxVsnprintf_ */ -#endif /* wxUSE_PRINTF_POS_PARAMS/!wxUSE_PRINTF_POS_PARAMS */ - -#ifndef wxSnprintf_ - /* no snprintf(), cook our own */ - WXDLLIMPEXP_BASE int - wxSnprintf_(wxChar *buf, size_t len, const wxChar *format, ...) ATTRIBUTE_PRINTF_3; -#endif -#ifndef wxVsnprintf_ - /* no (suitable) vsnprintf(), cook our own */ - WXDLLIMPEXP_BASE int - wxVsnprintf_(wxChar *buf, size_t len, const wxChar *format, va_list argptr); - - #define wxUSE_WXVSNPRINTF 1 -#else - #define wxUSE_WXVSNPRINTF 0 -#endif - -/* - In Unicode mode we need to have all standard functions such as wprintf() and - so on but not all systems have them so use our own implementations in this - case. - */ -#if wxUSE_UNICODE && !defined(wxHAVE_TCHAR_SUPPORT) && !defined(HAVE_WPRINTF) - #define wxNEED_WPRINTF -#endif - -/* - More Unicode complications: although both ANSI C and C++ define a number of - wide character functions such as wprintf(), not all environments have them. - Worse, those which do have different behaviours: under Windows, %s format - specifier changes its meaning in Unicode build and expects a Unicode string - while under Unix/POSIX it still means an ASCII string even for wprintf() and - %ls has to be used for wide strings. - - We choose to always emulate Windows behaviour as more useful for us so even - if we have wprintf() we still must wrap it in a non trivial wxPrintf(). - -*/ - -#if defined(wxNEED_PRINTF_CONVERSION) || defined(wxNEED_WPRINTF) - /* - we need to implement all wide character printf and scanf functions - either because we don't have them at all or because they don't have the - semantics we need - */ - int wxScanf( const wxChar *format, ... ) ATTRIBUTE_PRINTF_1; - int wxSscanf( const wxChar *str, const wxChar *format, ... ) ATTRIBUTE_PRINTF_2; - int wxFscanf( FILE *stream, const wxChar *format, ... ) ATTRIBUTE_PRINTF_2; - int wxVsscanf( const wxChar *str, const wxChar *format, va_list ap ); - int wxPrintf( const wxChar *format, ... ) ATTRIBUTE_PRINTF_1; - int wxSprintf( wxChar *str, const wxChar *format, ... ) ATTRIBUTE_PRINTF_2; - int wxFprintf( FILE *stream, const wxChar *format, ... ) ATTRIBUTE_PRINTF_2; - int wxVfprintf( FILE *stream, const wxChar *format, va_list ap ); - int wxVprintf( const wxChar *format, va_list ap ); - int wxVsprintf( wxChar *str, const wxChar *format, va_list ap ); -#endif /* wxNEED_PRINTF_CONVERSION */ - -/* these 2 can be simply mapped to the versions with underscore at the end */ -/* if we don't have to do the conversion */ -/* - However, if we don't have any vswprintf() at all we don't need to redefine - anything as our own wxVsnprintf_() already behaves as needed. -*/ -#if defined(wxNEED_PRINTF_CONVERSION) && defined(wxVsnprintf_) - int wxSnprintf( wxChar *str, size_t size, const wxChar *format, ... ) ATTRIBUTE_PRINTF_3; - int wxVsnprintf( wxChar *str, size_t size, const wxChar *format, va_list ap ); -#else - #define wxSnprintf wxSnprintf_ - #define wxVsnprintf wxVsnprintf_ -#endif - -/* - various functions which might not be available in libc and for which we - provide our own replacements in wxchar.cpp - */ - -/* ctype.h functions */ - -/* RN: Used only under OSX <= 10.2 currently */ -#ifdef wxNEED_WX_CTYPE_H - WXDLLIMPEXP_BASE int wxIsalnum(wxChar ch); - WXDLLIMPEXP_BASE int wxIsalpha(wxChar ch); - WXDLLIMPEXP_BASE int wxIscntrl(wxChar ch); - WXDLLIMPEXP_BASE int wxIsdigit(wxChar ch); - WXDLLIMPEXP_BASE int wxIsgraph(wxChar ch); - WXDLLIMPEXP_BASE int wxIslower(wxChar ch); - WXDLLIMPEXP_BASE int wxIsprint(wxChar ch); - WXDLLIMPEXP_BASE int wxIspunct(wxChar ch); - WXDLLIMPEXP_BASE int wxIsspace(wxChar ch); - WXDLLIMPEXP_BASE int wxIsupper(wxChar ch); - WXDLLIMPEXP_BASE int wxIsxdigit(wxChar ch); - WXDLLIMPEXP_BASE int wxTolower(wxChar ch); - WXDLLIMPEXP_BASE int wxToupper(wxChar ch); -#endif /* wxNEED_WX_CTYPE_H */ - -/* under VC++ 6.0 isspace() returns 1 for 8 bit chars which completely breaks */ -/* the file parsing -- this may be true for 5.0 as well, update #ifdef then */ -#if defined(__VISUALC__) && (__VISUALC__ >= 1200) && !wxUSE_UNICODE - #undef wxIsspace - #define wxIsspace(c) ((((unsigned)c) < 128) && isspace(c)) -#endif /* VC++ */ - -/* - a few compilers don't have the (non standard but common) isascii function, - define it ourselves for them - */ -#ifndef isascii - #if defined(__MWERKS__) - #define wxNEED_ISASCII - #elif defined(_WIN32_WCE) - #if _WIN32_WCE <= 211 - #define wxNEED_ISASCII - #endif - #endif -#endif /* isascii */ - -#ifdef wxNEED_ISASCII - inline int isascii(int c) { return (unsigned)c < 0x80; } -#endif - -#ifdef _WIN32_WCE - #if _WIN32_WCE <= 211 - #define isspace(c) ((c) == wxT(' ') || (c) == wxT('\t')) - #endif -#endif /* _WIN32_WCE */ - -/* - we had goofed and defined wxIsctrl() instead of (correct) wxIscntrl() in the - initial versions of this header -- now it is too late to remove it so - although we fixed the function/macro name above, still provide the - backwards-compatible synonym. - */ -#define wxIsctrl wxIscntrl - -/* string.h functions */ -#ifndef strdup - #if defined(__MWERKS__) && !defined(__MACH__) && (__MSL__ < 0x00008000) - #define wxNEED_STRDUP - #elif defined(__WXWINCE__) - #if _WIN32_WCE <= 211 - #define wxNEED_STRDUP - #endif - #endif -#endif /* strdup */ - -#ifdef wxNEED_STRDUP - WXDLLIMPEXP_BASE char *strdup(const char* s); -#endif - -/* RN: Used only under OSX <= 10.2 currently - The __cplusplus ifdefs are messy, but they are required to build - the regex library, since c does not support function overloading -*/ -#ifdef wxNEED_WX_STRING_H -# ifdef __cplusplus - extern "C" { -# endif - WXDLLIMPEXP_BASE wxChar * wxStrcat(wxChar *dest, const wxChar *src); - WXDLLIMPEXP_BASE const wxChar * wxStrchr(const wxChar *s, wxChar c); - WXDLLIMPEXP_BASE int wxStrcmp(const wxChar *s1, const wxChar *s2); - WXDLLIMPEXP_BASE int wxStrcoll(const wxChar *s1, const wxChar *s2); - WXDLLIMPEXP_BASE wxChar * wxStrcpy(wxChar *dest, const wxChar *src); - WXDLLIMPEXP_BASE size_t wxStrcspn(const wxChar *s, const wxChar *reject); - WXDLLIMPEXP_BASE wxChar * wxStrncat(wxChar *dest, const wxChar *src, size_t n); - WXDLLIMPEXP_BASE int wxStrncmp(const wxChar *s1, const wxChar *s2, size_t n); - WXDLLIMPEXP_BASE wxChar * wxStrncpy(wxChar *dest, const wxChar *src, size_t n); - WXDLLIMPEXP_BASE const wxChar * wxStrpbrk(const wxChar *s, const wxChar *accept); - WXDLLIMPEXP_BASE const wxChar * wxStrrchr(const wxChar *s, wxChar c); - WXDLLIMPEXP_BASE size_t wxStrspn(const wxChar *s, const wxChar *accept); - WXDLLIMPEXP_BASE const wxChar * wxStrstr(const wxChar *haystack, const wxChar *needle); -# ifdef __cplusplus - } -# endif - - /* These functions use C++, so we can't c extern them */ - WXDLLIMPEXP_BASE double wxStrtod(const wxChar *nptr, wxChar **endptr); - WXDLLIMPEXP_BASE long int wxStrtol(const wxChar *nptr, wxChar **endptr, int base); - WXDLLIMPEXP_BASE unsigned long int wxStrtoul(const wxChar *nptr, wxChar **endptr, int base); - WXDLLIMPEXP_BASE size_t wxStrxfrm(wxChar *dest, const wxChar *src, size_t n); - - /* inlined versions */ - #ifdef __cplusplus - inline wxChar * wxStrchr(wxChar *s, wxChar c) - { return (wxChar *)wxStrchr((const wxChar *)s, c); } - inline wxChar * wxStrpbrk(wxChar *s, const wxChar *accept) - { return (wxChar *)wxStrpbrk((const wxChar *)s, accept); } - inline wxChar * wxStrrchr(wxChar *s, wxChar c) - { return (wxChar *)wxStrrchr((const wxChar *)s, c); } - inline wxChar *wxStrstr(wxChar *haystack, const wxChar *needle) - { return (wxChar *)wxStrstr((const wxChar *)haystack, needle); } - #endif - -#endif /* wxNEED_WX_STRING_H */ - -#ifndef wxStrdupA -WXDLLIMPEXP_BASE char *wxStrdupA(const char *psz); -#endif - -#ifndef wxStrdupW -WXDLLIMPEXP_BASE wchar_t *wxStrdupW(const wchar_t *pwz); -#endif - -#ifndef wxStricmp -WXDLLIMPEXP_BASE int wxStricmp(const wxChar *psz1, const wxChar *psz2); -#endif - -#ifndef wxStrnicmp -WXDLLIMPEXP_BASE int wxStrnicmp(const wxChar *psz1, const wxChar *psz2, size_t len); -#endif - -#ifndef wxStrtok -WXDLLIMPEXP_BASE wxChar * wxStrtok(wxChar *psz, const wxChar *delim, wxChar **save_ptr); -#endif - -#ifdef __cplusplus -#ifndef wxSetlocale -class WXDLLIMPEXP_BASE wxWCharBuffer; -WXDLLIMPEXP_BASE wxWCharBuffer wxSetlocale(int category, const wxChar *locale); -#endif -#endif - -/* stdio.h functions */ -#ifdef wxNEED_WX_STDIO_H - #include <stdio.h> - WXDLLIMPEXP_BASE FILE * wxFopen(const wxChar *path, const wxChar *mode); - WXDLLIMPEXP_BASE FILE * wxFreopen(const wxChar *path, const wxChar *mode, FILE *stream); - WXDLLIMPEXP_BASE int wxRemove(const wxChar *path); - WXDLLIMPEXP_BASE int wxRename(const wxChar *oldpath, const wxChar *newpath); - - /* *printf() family is handled separately */ -#endif /* wxNEED_WX_STDIO_H */ - - -/* stdlib.h functions */ -#ifndef wxAtof -WXDLLIMPEXP_BASE double wxAtof(const wxChar *psz); -#endif - -/* - mingw32 doesn't provide _tsystem() even though it does provide all the other - stdlib.h functions wrappers so check for it separately: - */ -#if defined(__MINGW32__) && wxUSE_UNICODE && !defined(_tsystem) - #define wxNEED_WXSYSTEM -#endif - -#ifdef wxNEED_WX_STDLIB_H -WXDLLIMPEXP_BASE int wxAtoi(const wxChar *psz); -WXDLLIMPEXP_BASE long wxAtol(const wxChar *psz); -WXDLLIMPEXP_BASE wxChar * wxGetenv(const wxChar *name); -#define wxNEED_WXSYSTEM -#endif - -#ifdef wxNEED_WXSYSTEM -WXDLLIMPEXP_BASE int wxSystem(const wxChar *psz); -#endif - - -/* time.h functions */ -#ifdef wxNEED_WX_TIME_H -#if defined(__MWERKS__) && defined(macintosh) - #include <time.h> -#endif - /*silent gabby compilers*/ - struct tm; - WXDLLIMPEXP_BASE size_t wxStrftime(wxChar *s, size_t max, - const wxChar *fmt, const struct tm *tm); -#endif /* wxNEED_WX_TIME_H */ - -#ifndef wxCtime -#include <time.h> -WXDLLIMPEXP_BASE wxChar *wxCtime(const time_t *timep); -#endif - - -/* missing functions in some WinCE versions */ -#ifdef _WIN32_WCE -#if (_WIN32_WCE < 300) -WXDLLIMPEXP_BASE void *calloc( size_t num, size_t size ); -#endif -#endif /* _WIN32_WCE */ - -/* multibyte to wide char conversion functions and macros */ - -#if wxUSE_WCHAR_T - /* multibyte<->widechar conversion */ - WXDLLIMPEXP_BASE size_t wxMB2WC(wchar_t *buf, const char *psz, size_t n); - WXDLLIMPEXP_BASE size_t wxWC2MB(char *buf, const wchar_t *psz, size_t n); - - #if wxUSE_UNICODE - #define wxMB2WX wxMB2WC - #define wxWX2MB wxWC2MB - #define wxWC2WX wxStrncpy - #define wxWX2WC wxStrncpy - #else - #define wxMB2WX wxStrncpy - #define wxWX2MB wxStrncpy - #define wxWC2WX wxWC2MB - #define wxWX2WC wxMB2WC - #endif -#else /* !wxUSE_UNICODE */ -/* Why is this here? -#error ha */ - /* No wxUSE_WCHAR_T: we have to do something (JACS) */ - #define wxMB2WC wxStrncpy - #define wxWC2MB wxStrncpy - #define wxMB2WX wxStrncpy - #define wxWX2MB wxStrncpy - #define wxWC2WX wxWC2MB - #define wxWX2WC wxMB2WC -#endif - -/* - RN: The following are not normal versions of memcpy et al., rather - these are either char or widechar versions depending on - if unicode is used or not. -*/ - -#ifdef __cplusplus - - // - // RN: We could do the usual tricky compiler detection here, - // and use their variant (such as wmemchr, etc.). The problem - // is that these functions are quite rare, even though they are - // part of the current POSIX standard. In addition, most compilers - // (including even MSC) inline them just like we do right in their - // headers. - // - #include <string.h> - #if wxUSE_UNICODE - //implement our own wmem variants - inline wxChar* wxTmemchr(const wxChar* s, wxChar c, size_t l) - { - for(;l && *s != c;--l, ++s) {} - - if(l) - return (wxChar*)s; - return NULL; - } - - inline int wxTmemcmp(const wxChar* sz1, const wxChar* sz2, size_t len) - { - for(; *sz1 == *sz2 && len; --len, ++sz1, ++sz2) {} - - if(len) - return *sz1 < *sz2 ? -1 : *sz1 > *sz2; - else - return 0; - } - - inline wxChar* wxTmemcpy(wxChar* szOut, const wxChar* szIn, size_t len) - { - return (wxChar*) memcpy(szOut, szIn, len * sizeof(wxChar)); - } - - inline wxChar* wxTmemmove(wxChar* szOut, const wxChar* szIn, size_t len) - { - return (wxChar*) memmove(szOut, szIn, len * sizeof(wxChar)); - } - - inline wxChar* wxTmemset(wxChar* szOut, const wxChar cIn, size_t len) - { - wxChar* szRet = szOut; - - while (len--) - *szOut++ = cIn; - - return szRet; - } - #else /* !wxUSE_UNICODE */ - #if wxABI_VERSION >= 20805 - // for compatibility with earlier versions, these functions take - // "void *" but in the next wx version they will take "char *" so - // don't use them with void pointers (use the standard memxxx() - // with them) - inline char* wxTmemchr(const void* s, int c, size_t len) - { return (char*)memchr(s, c, len); } - inline int wxTmemcmp(const void* sz1, const void* sz2, size_t len) - { return memcmp(sz1, sz2, len); } - inline char* wxTmemcpy(void* szOut, const void* szIn, size_t len) - { return (char*)memcpy(szOut, szIn, len); } - inline char* wxTmemmove(void* szOut, const void* szIn, size_t len) - { return (char*)memmove(szOut, szIn, len); } - inline char* wxTmemset(void* szOut, int c, size_t len) - { return (char*)memset(szOut, c, len); } - #else - # define wxTmemchr memchr - # define wxTmemcmp memcmp - # define wxTmemcpy memcpy - # define wxTmemmove memmove - # define wxTmemset memset - #endif - #endif /* wxUSE_UNICODE/!wxUSE_UNICODE */ - -#endif /*__cplusplus*/ - - -#endif /* _WX_WXCHAR_H_ */ - diff --git a/wxWidgets/include/wx/wxhtml.h b/wxWidgets/include/wx/wxhtml.h deleted file mode 100644 index a401c93ee4..0000000000 --- a/wxWidgets/include/wx/wxhtml.h +++ /dev/null @@ -1,22 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wxhtml.h -// Purpose: wxHTML library for wxWidgets -// Author: Vaclav Slavik -// RCS-ID: $Id: wxhtml.h 35650 2005-09-23 12:56:45Z MR $ -// Copyright: (c) 1999 Vaclav Slavik -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_HTML_H_ -#define _WX_HTML_H_ - -#include "wx/html/htmldefs.h" -#include "wx/html/htmltag.h" -#include "wx/html/htmlcell.h" -#include "wx/html/htmlpars.h" -#include "wx/html/htmlwin.h" -#include "wx/html/winpars.h" -#include "wx/filesys.h" -#include "wx/html/helpctrl.h" - -#endif // __WXHTML_H__ diff --git a/wxWidgets/include/wx/wxprec.h b/wxWidgets/include/wx/wxprec.h deleted file mode 100644 index 8510036655..0000000000 --- a/wxWidgets/include/wx/wxprec.h +++ /dev/null @@ -1,70 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/wxprec.h -// Purpose: Includes the appropriate files for precompiled headers -// Author: Julian Smart -// Modified by: -// Created: 01/02/97 -// RCS-ID: $Id: wxprec.h 39484 2006-05-31 12:18:02Z ABX $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// compiler detection; includes setup.h -#include "wx/defs.h" - -// check if to use precompiled headers: do it for most Windows compilers unless -// explicitly disabled by defining NOPCH -#if defined(__VISUALC__) || \ - defined(__DMC__) || \ - defined(__VISAGECPP__) || \ - defined(__MWERKS__) || \ - defined(__WATCOMC__) || \ - defined(__BORLANDC__) - - - // If user did not request NOCPH and we're not building using configure - // then assume user wants precompiled headers. - #if !defined(NOPCH) && !defined(__WX_SETUP_H__) - #define WX_PRECOMP - #endif -#endif - -// For some reason, this must be defined for common dialogs to work. -#ifdef __WATCOMC__ - #define INCLUDE_COMMDLG_H 1 -#endif - -#ifdef WX_PRECOMP - -// include "wx/wxchar.h" first to ensure that UNICODE macro is correctly set -// _before_ including <windows.h> -#include "wx/wxchar.h" - -// include standard Windows headers -#if defined(__WXMSW__) - #include "wx/msw/wrapwin.h" - #include "wx/msw/wrapcctl.h" - #include "wx/msw/wrapcdlg.h" - #include "wx/msw/private.h" - #include "wx/msw/missing.h" -#endif - -// include all PalmOS headers at once -#ifdef __WXPALMOS__ -# include <PalmOS.h> -#endif - -// include <os2.h> -#ifdef __OS2__ -# include "wx/os2/private.h" -#endif - -// include mgl headers -#ifdef __WXMGL__ -# include "wx/mgl/private.h" -#endif - -// include the most common wx headers -#include "wx/wx.h" - -#endif // WX_PRECOMP diff --git a/wxWidgets/include/wx/wxshlb_cw.h b/wxWidgets/include/wx/wxshlb_cw.h deleted file mode 100644 index 7c2247236e..0000000000 --- a/wxWidgets/include/wx/wxshlb_cw.h +++ /dev/null @@ -1,65 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx_cw.h -// Purpose: wxWidgets definitions for CodeWarrior builds -// Author: Stefan Csomor -// Modified by: -// Created: 12/10/98 -// RCS-ID: $Id: wxshlb_cw.h 33744 2005-04-19 10:06:30Z SC $ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_CW__ -#define _WX_CW__ - -#if __MWERKS__ >= 0x2400 -#pragma old_argmatch on -#endif - -#if __option(profile) -#ifdef __cplusplus - #if __POWERPC__ - #include "wxshlb_PPC++_prof.mch" - #elif __INTEL__ - #include "wxshlb_x86++_prof.mch" - #elif __CFM68K__ - #include "wxshlb_cfm++_prof.mch" - #else - #include "wxshlb_68k++_prof.mch" - #endif -#else - #if __POWERPC__ - #include "wxshlb_PPC_prof.mch" - #elif __INTEL__ - #include "wxshlb_x86_prof.mch" - #elif __CFM68K__ - #include "wxshlb_cfm_prof.mch" - #else - #include "wxshlb_68k_prof.mch" - #endif -#endif -#else -#ifdef __cplusplus - #if __POWERPC__ - #include "wxshlb_PPC++.mch" - #elif __INTEL__ - #include "wxshlb_x86++.mch" - #elif __CFM68K__ - #include "wxshlb_cfm++.mch" - #else - #include "wxshlb_68k++.mch" - #endif -#else - #if __POWERPC__ - #include "wxshlb_PPC.mch" - #elif __INTEL__ - #include "wxshlb_x86.mch" - #elif __CFM68K__ - #include "wxshlb_cfm.mch" - #else - #include "wxshlb_68k.mch" - #endif -#endif -#endif -#endif - // _WX_CW__ diff --git a/wxWidgets/include/wx/wxshlb_cw_d.h b/wxWidgets/include/wx/wxshlb_cw_d.h deleted file mode 100644 index 930cd0b1c3..0000000000 --- a/wxWidgets/include/wx/wxshlb_cw_d.h +++ /dev/null @@ -1,46 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx_cw_d.h -// Purpose: wxWidgets definitions for CodeWarrior builds (Debug) -// Author: Stefan Csomor -// Modified by: -// Created: 12/10/98 -// RCS-ID: $Id: wxshlb_cw_d.h 33744 2005-04-19 10:06:30Z SC $ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_CW__ -#define _WX_CW__ - -#if __MWERKS__ >= 0x2400 -#pragma old_argmatch on -#endif - -#if __option(profile) -#error "profiling is not supported in debug versions" -#else -#ifdef __cplusplus - #if __POWERPC__ - #include "wxshlb_PPC++_d.mch" - #elif __INTEL__ - #include "wxshlb_x86++_d.mch" - #elif __CFM68K__ - #include "wxshlb_cfm++_d.mch" - #else - #include "wxshlb_68k++_d.mch" - #endif -#else - #if __POWERPC__ - #include "wxshlb_PPC_d.mch" - #elif __INTEL__ - #include "wxshlb_x86_d.mch" - #elif __CFM68K__ - #include "wxshlb_cfm_d.mch" - #else - #include "wxshlb_68k_d.mch" - #endif -#endif -#endif - -#endif - // _WX_CW__ diff --git a/wxWidgets/include/wx/wxshlb_cwc.h b/wxWidgets/include/wx/wxshlb_cwc.h deleted file mode 100644 index cebad6bec5..0000000000 --- a/wxWidgets/include/wx/wxshlb_cwc.h +++ /dev/null @@ -1,45 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx_cw.h -// Purpose: wxWidgets definitions for CodeWarrior builds -// Author: Stefan Csomor -// Modified by: -// Created: 12/10/98 -// RCS-ID: $Id: wxshlb_cwc.h 33744 2005-04-19 10:06:30Z SC $ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_CW__ -#define _WX_CW__ - -#if __MWERKS__ >= 0x2400 -#pragma old_argmatch on -#endif - -#if __option(profile) -#ifdef __cplusplus - #if __POWERPC__ - #include "wxshlb_Carbon++_prof.mch" - #endif -#else - #if __POWERPC__ - #include "wxshlb_Carbon_prof.mch" - #endif -#endif -#else -#ifdef __cplusplus - #if __MACH__ - #include "wxshlb_Mach++.mch" - #elif __POWERPC__ - #include "wxshlb_Carbon++.mch" - #endif -#else - #if __MACH__ - #include "wxshlb_Mach.mch" - #elif __POWERPC__ - #include "wxshlb_Carbon.mch" - #endif -#endif -#endif -#endif - // _WX_CW__ diff --git a/wxWidgets/include/wx/wxshlb_cwc_d.h b/wxWidgets/include/wx/wxshlb_cwc_d.h deleted file mode 100644 index ee1094c7b9..0000000000 --- a/wxWidgets/include/wx/wxshlb_cwc_d.h +++ /dev/null @@ -1,38 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx_cw_d.h -// Purpose: wxWidgets definitions for CodeWarrior builds (Debug) -// Author: Stefan Csomor -// Modified by: -// Created: 12/10/98 -// RCS-ID: $Id: wxshlb_cwc_d.h 33744 2005-04-19 10:06:30Z SC $ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_CW__ -#define _WX_CW__ - -#if __MWERKS__ >= 0x2400 -#pragma old_argmatch on -#endif - -#if __option(profile) -#error "profiling is not supported in debug versions" -#else -#ifdef __cplusplus - #ifdef __MACH__ - #include "wxshlb_Mach++_d.mch" - #elif __POWERPC__ - #include "wxshlb_Carbon++_d.mch" - #endif -#else - #ifdef __MACH__ - #include "wxshlb_Mach_d.mch" - #elif __POWERPC__ - #include "wxshlb_Carbon_d.mch" - #endif -#endif -#endif - -#endif - // _WX_CW__ diff --git a/wxWidgets/include/wx/wxshlba_cw.h b/wxWidgets/include/wx/wxshlba_cw.h deleted file mode 100644 index 6769d008c1..0000000000 --- a/wxWidgets/include/wx/wxshlba_cw.h +++ /dev/null @@ -1,65 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx_cw.h -// Purpose: wxWidgets definitions for CodeWarrior builds -// Author: Stefan Csomor -// Modified by: -// Created: 12/10/98 -// RCS-ID: $Id: wxshlba_cw.h 33744 2005-04-19 10:06:30Z SC $ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_CW__ -#define _WX_CW__ - -#if __MWERKS__ >= 0x2400 -#pragma old_argmatch on -#endif - -#if __option(profile) -#ifdef __cplusplus - #if __POWERPC__ - #include "wxshlba_PPC++_prof.mch" - #elif __INTEL__ - #include "wxshlba_x86++_prof.mch" - #elif __CFM68K__ - #include "wxshlba_cfm++_prof.mch" - #else - #include "wxshlba_68k++_prof.mch" - #endif -#else - #if __POWERPC__ - #include "wxshlba_PPC_prof.mch" - #elif __INTEL__ - #include "wxshlba_x86_prof.mch" - #elif __CFM68K__ - #include "wxshlba_cfm_prof.mch" - #else - #include "wxshlba_68k_prof.mch" - #endif -#endif -#else -#ifdef __cplusplus - #if __POWERPC__ - #include "wxshlba_PPC++.mch" - #elif __INTEL__ - #include "wxshlba_x86++.mch" - #elif __CFM68K__ - #include "wxshlba_cfm++.mch" - #else - #include "wxshlba_68k++.mch" - #endif -#else - #if __POWERPC__ - #include "wxshlba_PPC.mch" - #elif __INTEL__ - #include "wxshlba_x86.mch" - #elif __CFM68K__ - #include "wxshlba_cfm.mch" - #else - #include "wxshlba_68k.mch" - #endif -#endif -#endif -#endif - // _WX_CW__ diff --git a/wxWidgets/include/wx/wxshlba_cw_d.h b/wxWidgets/include/wx/wxshlba_cw_d.h deleted file mode 100644 index 5d789dfb9b..0000000000 --- a/wxWidgets/include/wx/wxshlba_cw_d.h +++ /dev/null @@ -1,46 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx_cw_d.h -// Purpose: wxWidgets definitions for CodeWarrior builds (Debug) -// Author: Stefan Csomor -// Modified by: -// Created: 12/10/98 -// RCS-ID: $Id: wxshlba_cw_d.h 33744 2005-04-19 10:06:30Z SC $ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_CW__ -#define _WX_CW__ - -#if __MWERKS__ >= 0x2400 -#pragma old_argmatch on -#endif - -#if __option(profile) -#error "profiling is not supported in debug versions" -#else -#ifdef __cplusplus - #if __POWERPC__ - #include "wxshlba_PPC++_d.mch" - #elif __INTEL__ - #include "wxshlba_x86++_d.mch" - #elif __CFM68K__ - #include "wxshlba_cfm++_d.mch" - #else - #include "wxshlba_68k++_d.mch" - #endif -#else - #if __POWERPC__ - #include "wxshlba_PPC_d.mch" - #elif __INTEL__ - #include "wxshlba_x86_d.mch" - #elif __CFM68K__ - #include "wxshlba_cfm_d.mch" - #else - #include "wxshlba_68k_d.mch" - #endif -#endif -#endif - -#endif - // _WX_CW__ diff --git a/wxWidgets/include/wx/wxshlba_cwc.h b/wxWidgets/include/wx/wxshlba_cwc.h deleted file mode 100644 index 766b628ba1..0000000000 --- a/wxWidgets/include/wx/wxshlba_cwc.h +++ /dev/null @@ -1,45 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx_cw.h -// Purpose: wxWidgets definitions for CodeWarrior builds -// Author: Stefan Csomor -// Modified by: -// Created: 12/10/98 -// RCS-ID: $Id: wxshlba_cwc.h 33744 2005-04-19 10:06:30Z SC $ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_CW__ -#define _WX_CW__ - -#if __MWERKS__ >= 0x2400 -#pragma old_argmatch on -#endif - -#if __option(profile) -#ifdef __cplusplus - #if __POWERPC__ - #include "wxshlba_Carbon++_prof.mch" - #endif -#else - #if __POWERPC__ - #include "wxshlba_Carbon_prof.mch" - #endif -#endif -#else -#ifdef __cplusplus - #ifdef __MACH__ - #include "wxshlba_Mach++.mch" - #elif __POWERPC__ - #include "wxshlba_Carbon++.mch" - #endif -#else - #ifdef __MACH__ - #include "wxshlba_Mach.mch" - #elif __POWERPC__ - #include "wxshlba_Carbon.mch" - #endif -#endif -#endif -#endif - // _WX_CW__ diff --git a/wxWidgets/include/wx/wxshlba_cwc_d.h b/wxWidgets/include/wx/wxshlba_cwc_d.h deleted file mode 100644 index bd58182032..0000000000 --- a/wxWidgets/include/wx/wxshlba_cwc_d.h +++ /dev/null @@ -1,38 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx_cw_d.h -// Purpose: wxWidgets definitions for CodeWarrior builds (Debug) -// Author: Stefan Csomor -// Modified by: -// Created: 12/10/98 -// RCS-ID: $Id: wxshlba_cwc_d.h 33744 2005-04-19 10:06:30Z SC $ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_CW__ -#define _WX_CW__ - -#if __MWERKS__ >= 0x2400 -#pragma old_argmatch on -#endif - -#if __option(profile) -#error "profiling is not supported in debug versions" -#else -#ifdef __cplusplus - #ifdef __MACH__ - #include "wxshlba_Mach++_d.mch" - #elif __POWERPC__ - #include "wxshlba_Carbon++_d.mch" - #endif -#else - #ifdef __MACH__ - #include "wxshlba_Mach_d.mch" - #elif __POWERPC__ - #include "wxshlba_Carbon_d.mch" - #endif -#endif -#endif - -#endif - // _WX_CW__ diff --git a/wxWidgets/include/wx/xml/xml.h b/wxWidgets/include/wx/xml/xml.h deleted file mode 100644 index d96e3ee3e1..0000000000 --- a/wxWidgets/include/wx/xml/xml.h +++ /dev/null @@ -1,272 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: xml.h -// Purpose: wxXmlDocument - XML parser & data holder class -// Author: Vaclav Slavik -// Created: 2000/03/05 -// RCS-ID: $Id: xml.h 59768 2009-03-23 12:35:12Z VZ $ -// Copyright: (c) 2000 Vaclav Slavik -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - - -#ifndef _WX_XML_H_ -#define _WX_XML_H_ - -#include "wx/defs.h" - -#if wxUSE_XML - -#include "wx/string.h" -#include "wx/object.h" -#include "wx/list.h" - -#ifdef WXMAKINGDLL_XML - #define WXDLLIMPEXP_XML WXEXPORT -#elif defined(WXUSINGDLL) - #define WXDLLIMPEXP_XML WXIMPORT -#else // not making nor using DLL - #define WXDLLIMPEXP_XML -#endif - -class WXDLLIMPEXP_FWD_XML wxXmlNode; -class WXDLLIMPEXP_FWD_XML wxXmlProperty; -class WXDLLIMPEXP_FWD_XML wxXmlDocument; -class WXDLLIMPEXP_FWD_XML wxXmlIOHandler; -class WXDLLIMPEXP_FWD_BASE wxInputStream; -class WXDLLIMPEXP_FWD_BASE wxOutputStream; - - -// Represents XML node type. -enum wxXmlNodeType -{ - // note: values are synchronized with xmlElementType from libxml - wxXML_ELEMENT_NODE = 1, - wxXML_ATTRIBUTE_NODE = 2, - wxXML_TEXT_NODE = 3, - wxXML_CDATA_SECTION_NODE = 4, - wxXML_ENTITY_REF_NODE = 5, - wxXML_ENTITY_NODE = 6, - wxXML_PI_NODE = 7, - wxXML_COMMENT_NODE = 8, - wxXML_DOCUMENT_NODE = 9, - wxXML_DOCUMENT_TYPE_NODE = 10, - wxXML_DOCUMENT_FRAG_NODE = 11, - wxXML_NOTATION_NODE = 12, - wxXML_HTML_DOCUMENT_NODE = 13 -}; - - -// Represents node property(ies). -// Example: in <img src="hello.gif" id="3"/> "src" is property with value -// "hello.gif" and "id" is prop. with value "3". - -class WXDLLIMPEXP_XML wxXmlProperty -{ -public: - wxXmlProperty() : m_next(NULL) {} - wxXmlProperty(const wxString& name, const wxString& value, - wxXmlProperty *next = NULL) - : m_name(name), m_value(value), m_next(next) {} - virtual ~wxXmlProperty() {} - - wxString GetName() const { return m_name; } - wxString GetValue() const { return m_value; } - wxXmlProperty *GetNext() const { return m_next; } - - void SetName(const wxString& name) { m_name = name; } - void SetValue(const wxString& value) { m_value = value; } - void SetNext(wxXmlProperty *next) { m_next = next; } - -private: - wxString m_name; - wxString m_value; - wxXmlProperty *m_next; -}; - - - -// Represents node in XML document. Node has name and may have content -// and properties. Most common node types are wxXML_TEXT_NODE (name and props -// are irrelevant) and wxXML_ELEMENT_NODE (e.g. in <title>hi there is -// element with name="title", irrelevant content and one child (wxXML_TEXT_NODE -// with content="hi"). -// -// If wxUSE_UNICODE is 0, all strings are encoded in the encoding given to Load -// (default is UTF-8). - -class WXDLLIMPEXP_XML wxXmlNode -{ -public: - wxXmlNode() : m_properties(NULL), m_parent(NULL), - m_children(NULL), m_next(NULL) {} - wxXmlNode(wxXmlNode *parent, wxXmlNodeType type, - const wxString& name, const wxString& content = wxEmptyString, - wxXmlProperty *props = NULL, wxXmlNode *next = NULL); - virtual ~wxXmlNode(); - - // copy ctor & operator=. Note that this does NOT copy syblings - // and parent pointer, i.e. m_parent and m_next will be NULL - // after using copy ctor and are never unmodified by operator=. - // On the other hand, it DOES copy children and properties. - wxXmlNode(const wxXmlNode& node); - wxXmlNode& operator=(const wxXmlNode& node); - - // user-friendly creation: - wxXmlNode(wxXmlNodeType type, const wxString& name, - const wxString& content = wxEmptyString); - virtual void AddChild(wxXmlNode *child); - virtual bool InsertChild(wxXmlNode *child, wxXmlNode *followingNode); -#if wxABI_VERSION >= 20808 - bool InsertChildAfter(wxXmlNode *child, wxXmlNode *precedingNode); -#endif - virtual bool RemoveChild(wxXmlNode *child); - virtual void AddProperty(const wxString& name, const wxString& value); - virtual bool DeleteProperty(const wxString& name); - - // access methods: - wxXmlNodeType GetType() const { return m_type; } - wxString GetName() const { return m_name; } - wxString GetContent() const { return m_content; } - - bool IsWhitespaceOnly() const; - int GetDepth(wxXmlNode *grandparent = NULL) const; - - // Gets node content from wxXML_ENTITY_NODE - // The problem is, content is represented as - // wxXML_ENTITY_NODE name="tag", content="" - // |-- wxXML_TEXT_NODE or - // wxXML_CDATA_SECTION_NODE name="" content="content" - wxString GetNodeContent() const; - - wxXmlNode *GetParent() const { return m_parent; } - wxXmlNode *GetNext() const { return m_next; } - wxXmlNode *GetChildren() const { return m_children; } - - wxXmlProperty *GetProperties() const { return m_properties; } - bool GetPropVal(const wxString& propName, wxString *value) const; - wxString GetPropVal(const wxString& propName, - const wxString& defaultVal) const; - bool HasProp(const wxString& propName) const; - - void SetType(wxXmlNodeType type) { m_type = type; } - void SetName(const wxString& name) { m_name = name; } - void SetContent(const wxString& con) { m_content = con; } - - void SetParent(wxXmlNode *parent) { m_parent = parent; } - void SetNext(wxXmlNode *next) { m_next = next; } - void SetChildren(wxXmlNode *child) { m_children = child; } - - void SetProperties(wxXmlProperty *prop) { m_properties = prop; } - virtual void AddProperty(wxXmlProperty *prop); - -#if wxABI_VERSION >= 20811 - wxString GetAttribute(const wxString& attrName, - const wxString& defaultVal) const - { - return GetPropVal(attrName, defaultVal); - } - bool GetAttribute(const wxString& attrName, wxString *value) const - { - return GetPropVal(attrName, value); - } - void AddAttribute(const wxString& attrName, const wxString& value) - { - AddProperty(attrName, value); - } - wxXmlProperty* GetAttributes() const - { - return GetProperties(); - } -#endif // wx >= 2.8.11 - -private: - wxXmlNodeType m_type; - wxString m_name; - wxString m_content; - wxXmlProperty *m_properties; - wxXmlNode *m_parent, *m_children, *m_next; - - void DoCopy(const wxXmlNode& node); -}; - - - -// special indentation value for wxXmlDocument::Save -#define wxXML_NO_INDENTATION (-1) - -// flags for wxXmlDocument::Load -enum wxXmlDocumentLoadFlag -{ - wxXMLDOC_NONE = 0, - wxXMLDOC_KEEP_WHITESPACE_NODES = 1 -}; - - -// This class holds XML data/document as parsed by XML parser. - -class WXDLLIMPEXP_XML wxXmlDocument : public wxObject -{ -public: - wxXmlDocument(); - wxXmlDocument(const wxString& filename, - const wxString& encoding = wxT("UTF-8")); - wxXmlDocument(wxInputStream& stream, - const wxString& encoding = wxT("UTF-8")); - virtual ~wxXmlDocument() { wxDELETE(m_root); } - - wxXmlDocument(const wxXmlDocument& doc); - wxXmlDocument& operator=(const wxXmlDocument& doc); - - // Parses .xml file and loads data. Returns TRUE on success, FALSE - // otherwise. - virtual bool Load(const wxString& filename, - const wxString& encoding = wxT("UTF-8"), int flags = wxXMLDOC_NONE); - virtual bool Load(wxInputStream& stream, - const wxString& encoding = wxT("UTF-8"), int flags = wxXMLDOC_NONE); - - // Saves document as .xml file. - virtual bool Save(const wxString& filename, int indentstep = 1) const; - virtual bool Save(wxOutputStream& stream, int indentstep = 1) const; - - bool IsOk() const { return m_root != NULL; } - - // Returns root node of the document. - wxXmlNode *GetRoot() const { return m_root; } - - // Returns version of document (may be empty). - wxString GetVersion() const { return m_version; } - // Returns encoding of document (may be empty). - // Note: this is the encoding original file was saved in, *not* the - // encoding of in-memory representation! - wxString GetFileEncoding() const { return m_fileEncoding; } - - // Write-access methods: - wxXmlNode *DetachRoot() { wxXmlNode *old=m_root; m_root=NULL; return old; } - void SetRoot(wxXmlNode *node) { wxDELETE(m_root); m_root = node; } - void SetVersion(const wxString& version) { m_version = version; } - void SetFileEncoding(const wxString& encoding) { m_fileEncoding = encoding; } - -#if !wxUSE_UNICODE - // Returns encoding of in-memory representation of the document - // (same as passed to Load or ctor, defaults to UTF-8). - // NB: this is meaningless in Unicode build where data are stored as wchar_t* - wxString GetEncoding() const { return m_encoding; } - void SetEncoding(const wxString& enc) { m_encoding = enc; } -#endif - -private: - wxString m_version; - wxString m_fileEncoding; -#if !wxUSE_UNICODE - wxString m_encoding; -#endif - wxXmlNode *m_root; - - void DoCopy(const wxXmlDocument& doc); - - DECLARE_CLASS(wxXmlDocument) -}; - -#endif // wxUSE_XML - -#endif // _WX_XML_H_ diff --git a/wxWidgets/include/wx/xpmdecod.h b/wxWidgets/include/wx/xpmdecod.h deleted file mode 100644 index 9391043684..0000000000 --- a/wxWidgets/include/wx/xpmdecod.h +++ /dev/null @@ -1,47 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/xpmdecod.h -// Purpose: wxXPMDecoder, XPM reader for wxImage and wxBitmap -// Author: Vaclav Slavik -// CVS-ID: $Id: xpmdecod.h 49804 2007-11-10 01:09:42Z VZ $ -// Copyright: (c) 2001 Vaclav Slavik -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_XPMDECOD_H_ -#define _WX_XPMDECOD_H_ - -#include "wx/defs.h" - -#if wxUSE_IMAGE && wxUSE_XPM - -class WXDLLIMPEXP_FWD_CORE wxImage; -class WXDLLIMPEXP_FWD_BASE wxInputStream; - -// -------------------------------------------------------------------------- -// wxXPMDecoder class -// -------------------------------------------------------------------------- - -class WXDLLEXPORT wxXPMDecoder -{ -public: - // constructor, destructor, etc. - wxXPMDecoder() {} - ~wxXPMDecoder() {} - -#if wxUSE_STREAMS - // Is the stream XPM file? - bool CanRead(wxInputStream& stream); - // Read XPM file from the stream, parse it and create image from it - wxImage ReadFile(wxInputStream& stream); -#endif - // Read directly from XPM data (as passed to wxBitmap ctor): - wxImage ReadData(const char* const* xpm_data); -#ifdef __BORLANDC__ - // needed for Borland 5.5 - wxImage ReadData(char** xpm_data) { return ReadData(wx_const_cast(const char* const*, xpm_data)); } -#endif -}; - -#endif // wxUSE_IMAGE && wxUSE_XPM - -#endif // _WX_XPM_H_ diff --git a/wxWidgets/include/wx/xpmhand.h b/wxWidgets/include/wx/xpmhand.h deleted file mode 100644 index 4207f7da80..0000000000 --- a/wxWidgets/include/wx/xpmhand.h +++ /dev/null @@ -1,25 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/xpmhand.h -// Purpose: XPM handler base header -// Author: Julian Smart -// Modified by: -// Created: -// RCS-ID: $Id: xpmhand.h 33948 2005-05-04 18:57:50Z JS $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_XPMHAND_H_BASE_ -#define _WX_XPMHAND_H_BASE_ - -// Only wxMSW and wxPM currently defines a separate XPM handler, since -// mostly Windows and Presentation Manager apps won't need XPMs. -#if defined(__WXMSW__) -#error xpmhand.h is no longer needed since wxImage now handles XPMs. -#endif -#if defined(__WXPM__) -#include "wx/os2/xpmhand.h" -#endif - -#endif - // _WX_XPMHAND_H_BASE_ diff --git a/wxWidgets/include/wx/xrc/xh_all.h b/wxWidgets/include/wx/xrc/xh_all.h deleted file mode 100644 index 9132fbbcb2..0000000000 --- a/wxWidgets/include/wx/xrc/xh_all.h +++ /dev/null @@ -1,74 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/xrc/xh_all.h -// Purpose: includes all xh_*.h files -// Author: Vaclav Slavik -// Created: 2000/03/05 -// RCS-ID: $Id: xh_all.h 48045 2007-08-13 12:05:18Z JS $ -// Copyright: (c) 2000 Vaclav Slavik -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_XH_ALL_H_ -#define _WX_XH_ALL_H_ - - -// Existing handlers: - -#include "wx/xrc/xh_menu.h" -#include "wx/xrc/xh_panel.h" -#include "wx/xrc/xh_dlg.h" -#include "wx/xrc/xh_bttn.h" -#include "wx/xrc/xh_chckb.h" -#include "wx/xrc/xh_tglbtn.h" -#include "wx/xrc/xh_gauge.h" -#include "wx/xrc/xh_html.h" -#include "wx/xrc/xh_spin.h" -#include "wx/xrc/xh_sttxt.h" -#include "wx/xrc/xh_slidr.h" -#include "wx/xrc/xh_radbt.h" -#include "wx/xrc/xh_radbx.h" -#include "wx/xrc/xh_combo.h" -#include "wx/xrc/xh_chckl.h" -#include "wx/xrc/xh_choic.h" -#include "wx/xrc/xh_datectrl.h" -#include "wx/xrc/xh_sizer.h" -#include "wx/xrc/xh_stbmp.h" -#include "wx/xrc/xh_notbk.h" -#include "wx/xrc/xh_odcombo.h" -#include "wx/xrc/xh_listbk.h" -#include "wx/xrc/xh_choicbk.h" -#include "wx/xrc/xh_treebk.h" -#include "wx/xrc/xh_text.h" -#include "wx/xrc/xh_listb.h" -#include "wx/xrc/xh_toolb.h" -#include "wx/xrc/xh_bmpbt.h" -#include "wx/xrc/xh_stbox.h" -#include "wx/xrc/xh_scrol.h" -#include "wx/xrc/xh_tree.h" -#include "wx/xrc/xh_cald.h" -#include "wx/xrc/xh_listc.h" -#include "wx/xrc/xh_stlin.h" -#include "wx/xrc/xh_bmp.h" -#include "wx/xrc/xh_unkwn.h" -#include "wx/xrc/xh_gdctl.h" -#include "wx/xrc/xh_frame.h" -#include "wx/xrc/xh_scwin.h" -#include "wx/xrc/xh_htmllbox.h" -#include "wx/xrc/xh_split.h" -#include "wx/xrc/xh_wizrd.h" -#include "wx/xrc/xh_statbar.h" -#include "wx/xrc/xh_mdi.h" -#include "wx/xrc/xh_grid.h" -#include "wx/xrc/xh_clrpicker.h" -#include "wx/xrc/xh_filepicker.h" -#include "wx/xrc/xh_fontpicker.h" -#include "wx/xrc/xh_dirpicker.h" -#include "wx/xrc/xh_hyperlink.h" -#include "wx/xrc/xh_bmpcbox.h" -#include "wx/xrc/xh_animatctrl.h" -#include "wx/xrc/xh_collpane.h" -#if wxABI_VERSION >= 20805 -#include "wx/xrc/xh_propdlg.h" -#endif - -#endif // _WX_XH_ALL_H_ diff --git a/wxWidgets/include/wx/xrc/xh_animatctrl.h b/wxWidgets/include/wx/xrc/xh_animatctrl.h deleted file mode 100644 index 699a0413ca..0000000000 --- a/wxWidgets/include/wx/xrc/xh_animatctrl.h +++ /dev/null @@ -1,30 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/xrc/xh_animatctrl.h -// Purpose: XML resource handler for wxAnimationCtrl -// Author: Francesco Montorsi -// Created: 2006-10-15 -// RCS-ID: $Id: xh_animatctrl.h 42196 2006-10-21 13:59:25Z RR $ -// Copyright: (c) 2006 Francesco Montorsi -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_XH_ANIMATIONCTRL_H_ -#define _WX_XH_ANIMATIONCTRL_H_ - -#include "wx/xrc/xmlres.h" - -#if wxUSE_XRC && wxUSE_ANIMATIONCTRL - -class WXDLLIMPEXP_XRC wxAnimationCtrlXmlHandler : public wxXmlResourceHandler -{ - DECLARE_DYNAMIC_CLASS(wxAnimationCtrlXmlHandler) - -public: - wxAnimationCtrlXmlHandler(); - virtual wxObject *DoCreateResource(); - virtual bool CanHandle(wxXmlNode *node); -}; - -#endif // wxUSE_XRC && wxUSE_ANIMATIONCTRL - -#endif // _WX_XH_ANIMATIONCTRL_H_ diff --git a/wxWidgets/include/wx/xrc/xh_bmp.h b/wxWidgets/include/wx/xrc/xh_bmp.h deleted file mode 100644 index 40698e0843..0000000000 --- a/wxWidgets/include/wx/xrc/xh_bmp.h +++ /dev/null @@ -1,40 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/xrc/xh_bmp.h -// Purpose: XML resource handler for wxBitmap and wxIcon -// Author: Vaclav Slavik -// Created: 2000/09/00 -// RCS-ID: $Id: xh_bmp.h 41590 2006-10-03 14:53:40Z VZ $ -// Copyright: (c) 2000 Vaclav Slavik -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_XH_BMP_H_ -#define _WX_XH_BMP_H_ - -#include "wx/xrc/xmlres.h" - -#if wxUSE_XRC - -class WXDLLIMPEXP_XRC wxBitmapXmlHandler : public wxXmlResourceHandler -{ - DECLARE_DYNAMIC_CLASS(wxBitmapXmlHandler) - -public: - wxBitmapXmlHandler(); - virtual wxObject *DoCreateResource(); - virtual bool CanHandle(wxXmlNode *node); -}; - -class WXDLLIMPEXP_XRC wxIconXmlHandler : public wxXmlResourceHandler -{ - DECLARE_DYNAMIC_CLASS(wxIconXmlHandler) - -public: - wxIconXmlHandler(); - virtual wxObject *DoCreateResource(); - virtual bool CanHandle(wxXmlNode *node); -}; - -#endif // wxUSE_XRC - -#endif // _WX_XH_BMP_H_ diff --git a/wxWidgets/include/wx/xrc/xh_bmpbt.h b/wxWidgets/include/wx/xrc/xh_bmpbt.h deleted file mode 100644 index 28b763fa73..0000000000 --- a/wxWidgets/include/wx/xrc/xh_bmpbt.h +++ /dev/null @@ -1,30 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/xrc/xh_bmpbt.h -// Purpose: XML resource handler for bitmap buttons -// Author: Brian Gavin -// Created: 2000/03/05 -// RCS-ID: $Id: xh_bmpbt.h 41590 2006-10-03 14:53:40Z VZ $ -// Copyright: (c) 2000 Brian Gavin -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_XH_BMPBT_H_ -#define _WX_XH_BMPBT_H_ - -#include "wx/xrc/xmlres.h" - -#if wxUSE_XRC && wxUSE_BMPBUTTON - -class WXDLLIMPEXP_XRC wxBitmapButtonXmlHandler : public wxXmlResourceHandler -{ - DECLARE_DYNAMIC_CLASS(wxBitmapButtonXmlHandler) - -public: - wxBitmapButtonXmlHandler(); - virtual wxObject *DoCreateResource(); - virtual bool CanHandle(wxXmlNode *node); -}; - -#endif // wxUSE_XRC && wxUSE_BMPBUTTON - -#endif // _WX_XH_BMPBT_H_ diff --git a/wxWidgets/include/wx/xrc/xh_bmpcbox.h b/wxWidgets/include/wx/xrc/xh_bmpcbox.h deleted file mode 100644 index f00d98a353..0000000000 --- a/wxWidgets/include/wx/xrc/xh_bmpcbox.h +++ /dev/null @@ -1,36 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/xrc/xh_bmpcbox.h -// Purpose: XML resource handler for wxBitmapComboBox -// Author: Jaakko Salli -// Created: Sep-10-2006 -// RCS-ID: $Id: xh_bmpcbox.h 53135 2008-04-12 02:31:04Z VZ $ -// Copyright: (c) 2006 Jaakko Salli -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_XH_BMPCBOX_H_ -#define _WX_XH_BMPCBOX_H_ - -#include "wx/xrc/xmlres.h" - -#if wxUSE_XRC && wxUSE_BITMAPCOMBOBOX - -class WXDLLIMPEXP_FWD_ADV wxBitmapComboBox; - -class WXDLLIMPEXP_XRC wxBitmapComboBoxXmlHandler : public wxXmlResourceHandler -{ - DECLARE_DYNAMIC_CLASS(wxBitmapComboBoxXmlHandler) - -public: - wxBitmapComboBoxXmlHandler(); - virtual wxObject *DoCreateResource(); - virtual bool CanHandle(wxXmlNode *node); - -private: - wxBitmapComboBox* m_combobox; - bool m_isInside; -}; - -#endif // wxUSE_XRC && wxUSE_BITMAPCOMBOBOX - -#endif // _WX_XH_BMPCBOX_H_ diff --git a/wxWidgets/include/wx/xrc/xh_bttn.h b/wxWidgets/include/wx/xrc/xh_bttn.h deleted file mode 100644 index aae80baad4..0000000000 --- a/wxWidgets/include/wx/xrc/xh_bttn.h +++ /dev/null @@ -1,30 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/xrc/xh_bttn.h -// Purpose: XML resource handler for buttons -// Author: Vaclav Slavik -// Created: 2000/03/05 -// RCS-ID: $Id: xh_bttn.h 41590 2006-10-03 14:53:40Z VZ $ -// Copyright: (c) 2000 Vaclav Slavik -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_XH_BTTN_H_ -#define _WX_XH_BTTN_H_ - -#include "wx/xrc/xmlres.h" - -#if wxUSE_XRC && wxUSE_BUTTON - -class WXDLLIMPEXP_XRC wxButtonXmlHandler : public wxXmlResourceHandler -{ - DECLARE_DYNAMIC_CLASS(wxButtonXmlHandler) - -public: - wxButtonXmlHandler(); - virtual wxObject *DoCreateResource(); - virtual bool CanHandle(wxXmlNode *node); -}; - -#endif // wxUSE_XRC && wxUSE_BUTTON - -#endif // _WX_XH_BTTN_H_ diff --git a/wxWidgets/include/wx/xrc/xh_cald.h b/wxWidgets/include/wx/xrc/xh_cald.h deleted file mode 100644 index 8d9ad664aa..0000000000 --- a/wxWidgets/include/wx/xrc/xh_cald.h +++ /dev/null @@ -1,30 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/xrc/xh_cald.h -// Purpose: XML resource handler for wxCalendarCtrl -// Author: Brian Gavin -// Created: 2000/09/09 -// RCS-ID: $Id: xh_cald.h 41590 2006-10-03 14:53:40Z VZ $ -// Copyright: (c) 2000 Brian Gavin -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_XH_CALD_H_ -#define _WX_XH_CALD_H_ - -#include "wx/xrc/xmlres.h" - -#if wxUSE_XRC && wxUSE_CALENDARCTRL - -class WXDLLIMPEXP_XRC wxCalendarCtrlXmlHandler : public wxXmlResourceHandler -{ - DECLARE_DYNAMIC_CLASS(wxCalendarCtrlXmlHandler) - -public: - wxCalendarCtrlXmlHandler(); - virtual wxObject *DoCreateResource(); - virtual bool CanHandle(wxXmlNode *node); -}; - -#endif // wxUSE_XRC && wxUSE_CALENDARCTRL - -#endif // _WX_XH_CALD_H_ diff --git a/wxWidgets/include/wx/xrc/xh_chckb.h b/wxWidgets/include/wx/xrc/xh_chckb.h deleted file mode 100644 index c9b8e74a80..0000000000 --- a/wxWidgets/include/wx/xrc/xh_chckb.h +++ /dev/null @@ -1,31 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/xrc/xh_chckb.h -// Purpose: XML resource handler for wxCheckBox -// Author: Bob Mitchell -// Created: 2000/03/21 -// RCS-ID: $Id: xh_chckb.h 41590 2006-10-03 14:53:40Z VZ $ -// Copyright: (c) 2000 Bob Mitchell and Verant Interactive -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_XH_CHCKB_H_ -#define _WX_XH_CHCKB_H_ - -#include "wx/xrc/xmlres.h" - -#if wxUSE_XRC && wxUSE_CHECKBOX - -class WXDLLIMPEXP_XRC wxCheckBoxXmlHandler : public wxXmlResourceHandler -{ - DECLARE_DYNAMIC_CLASS(wxCheckBoxXmlHandler) - -public: - wxCheckBoxXmlHandler(); - virtual wxObject *DoCreateResource(); - virtual bool CanHandle(wxXmlNode *node); -}; - -#endif // wxUSE_XRC && wxUSE_CHECKBOX - -#endif // _WX_XH_CHECKBOX_H_ - diff --git a/wxWidgets/include/wx/xrc/xh_chckl.h b/wxWidgets/include/wx/xrc/xh_chckl.h deleted file mode 100644 index 4969356c8b..0000000000 --- a/wxWidgets/include/wx/xrc/xh_chckl.h +++ /dev/null @@ -1,34 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/xrc/xh_chckl.h -// Purpose: XML resource handler for wxCheckListBox -// Author: Bob Mitchell -// Created: 2000/03/21 -// RCS-ID: $Id: xh_chckl.h 41590 2006-10-03 14:53:40Z VZ $ -// Copyright: (c) 2000 Bob Mitchell and Verant Interactive -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_XH_CHCKL_H_ -#define _WX_XH_CHCKL_H_ - -#include "wx/xrc/xmlres.h" - -#if wxUSE_XRC && wxUSE_CHECKLISTBOX - -class WXDLLIMPEXP_XRC wxCheckListBoxXmlHandler : public wxXmlResourceHandler -{ - DECLARE_DYNAMIC_CLASS(wxCheckListBoxXmlHandler) - -public: - wxCheckListBoxXmlHandler(); - virtual wxObject *DoCreateResource(); - virtual bool CanHandle(wxXmlNode *node); - -private: - bool m_insideBox; - wxArrayString strList; -}; - -#endif // wxUSE_XRC && wxUSE_CHECKLISTBOX - -#endif // _WX_XH_CHECKLIST_H_ diff --git a/wxWidgets/include/wx/xrc/xh_choic.h b/wxWidgets/include/wx/xrc/xh_choic.h deleted file mode 100644 index 770d4de126..0000000000 --- a/wxWidgets/include/wx/xrc/xh_choic.h +++ /dev/null @@ -1,34 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/xrc/xh_choic.h -// Purpose: XML resource handler for wxChoice -// Author: Bob Mitchell -// Created: 2000/03/21 -// RCS-ID: $Id: xh_choic.h 41590 2006-10-03 14:53:40Z VZ $ -// Copyright: (c) 2000 Bob Mitchell and Verant Interactive -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_XH_CHOIC_H_ -#define _WX_XH_CHOIC_H_ - -#include "wx/xrc/xmlres.h" - -#if wxUSE_XRC && wxUSE_CHOICE - -class WXDLLIMPEXP_XRC wxChoiceXmlHandler : public wxXmlResourceHandler -{ - DECLARE_DYNAMIC_CLASS(wxChoiceXmlHandler) - -public: - wxChoiceXmlHandler(); - virtual wxObject *DoCreateResource(); - virtual bool CanHandle(wxXmlNode *node); - -private: - bool m_insideBox; - wxArrayString strList; -}; - -#endif // wxUSE_XRC && wxUSE_CHOICE - -#endif // _WX_XH_CHOIC_H_ diff --git a/wxWidgets/include/wx/xrc/xh_choicbk.h b/wxWidgets/include/wx/xrc/xh_choicbk.h deleted file mode 100644 index 20c5346eb3..0000000000 --- a/wxWidgets/include/wx/xrc/xh_choicbk.h +++ /dev/null @@ -1,34 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/xrc/xh_choicbk.h -// Purpose: XML resource handler for wxChoicebook -// Author: Vaclav Slavik -// Copyright: (c) 2000 Vaclav Slavik -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_XH_CHOICEBK_H_ -#define _WX_XH_CHOICEBK_H_ - -#include "wx/xrc/xmlres.h" - -#if wxUSE_XRC && wxUSE_CHOICEBOOK - -class WXDLLIMPEXP_FWD_CORE wxChoicebook; - -class WXDLLIMPEXP_XRC wxChoicebookXmlHandler : public wxXmlResourceHandler -{ - DECLARE_DYNAMIC_CLASS(wxChoicebookXmlHandler) - -public: - wxChoicebookXmlHandler(); - virtual wxObject *DoCreateResource(); - virtual bool CanHandle(wxXmlNode *node); - -private: - bool m_isInside; - wxChoicebook *m_choicebook; -}; - -#endif // wxUSE_XRC && wxUSE_CHOICEBOOK - -#endif // _WX_XH_CHOICEBK_H_ diff --git a/wxWidgets/include/wx/xrc/xh_clrpicker.h b/wxWidgets/include/wx/xrc/xh_clrpicker.h deleted file mode 100644 index 43ff72f091..0000000000 --- a/wxWidgets/include/wx/xrc/xh_clrpicker.h +++ /dev/null @@ -1,30 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/xrc/xh_clrpicker.h -// Purpose: XML resource handler for wxColourPickerCtrl -// Author: Francesco Montorsi -// Created: 2006-04-17 -// RCS-ID: $Id: xh_clrpicker.h 41590 2006-10-03 14:53:40Z VZ $ -// Copyright: (c) 2006 Francesco Montorsi -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_XH_CLRPICKERCTRL_H_ -#define _WX_XH_CLRPICKERCTRL_H_ - -#include "wx/xrc/xmlres.h" - -#if wxUSE_XRC && wxUSE_COLOURPICKERCTRL - -class WXDLLIMPEXP_XRC wxColourPickerCtrlXmlHandler : public wxXmlResourceHandler -{ - DECLARE_DYNAMIC_CLASS(wxColourPickerCtrlXmlHandler) - -public: - wxColourPickerCtrlXmlHandler(); - virtual wxObject *DoCreateResource(); - virtual bool CanHandle(wxXmlNode *node); -}; - -#endif // wxUSE_XRC && wxUSE_COLOURPICKERCTRL - -#endif // _WX_XH_CLRPICKERCTRL_H_ diff --git a/wxWidgets/include/wx/xrc/xh_collpane.h b/wxWidgets/include/wx/xrc/xh_collpane.h deleted file mode 100644 index 4b758b168b..0000000000 --- a/wxWidgets/include/wx/xrc/xh_collpane.h +++ /dev/null @@ -1,36 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/xrc/xh_collpane.h -// Purpose: XML resource handler for wxCollapsiblePane -// Author: Francesco Montorsi -// Created: 2006-10-27 -// RCS-ID: $Id: xh_collpane.h 52422 2008-03-10 13:55:07Z VZ $ -// Copyright: (c) 2006 Francesco Montorsi -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_XH_COLLPANE_H_ -#define _WX_XH_COLLPANE_H_ - -#include "wx/xrc/xmlres.h" - -#if wxUSE_XRC && wxUSE_COLLPANE - -class WXDLLIMPEXP_FWD_CORE wxCollapsiblePane; - -class WXDLLIMPEXP_XRC wxCollapsiblePaneXmlHandler : public wxXmlResourceHandler -{ -public: - wxCollapsiblePaneXmlHandler(); - virtual wxObject *DoCreateResource(); - virtual bool CanHandle(wxXmlNode *node); - -private: - bool m_isInside; - wxCollapsiblePane *m_collpane; - - DECLARE_DYNAMIC_CLASS(wxCollapsiblePaneXmlHandler) -}; - -#endif // wxUSE_XRC && wxUSE_COLLPANE - -#endif // _WX_XH_COLLPANE_H_ diff --git a/wxWidgets/include/wx/xrc/xh_combo.h b/wxWidgets/include/wx/xrc/xh_combo.h deleted file mode 100644 index d57cc6179c..0000000000 --- a/wxWidgets/include/wx/xrc/xh_combo.h +++ /dev/null @@ -1,34 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/xrc/xh_combo.h -// Purpose: XML resource handler for wxComboBox -// Author: Bob Mitchell -// Created: 2000/03/21 -// RCS-ID: $Id: xh_combo.h 41590 2006-10-03 14:53:40Z VZ $ -// Copyright: (c) 2000 Bob Mitchell and Verant Interactive -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_XH_COMBO_H_ -#define _WX_XH_COMBO_H_ - -#include "wx/xrc/xmlres.h" - -#if wxUSE_XRC && wxUSE_COMBOBOX - -class WXDLLIMPEXP_XRC wxComboBoxXmlHandler : public wxXmlResourceHandler -{ - DECLARE_DYNAMIC_CLASS(wxComboBoxXmlHandler) - -public: - wxComboBoxXmlHandler(); - virtual wxObject *DoCreateResource(); - virtual bool CanHandle(wxXmlNode *node); - -private: - bool m_insideBox; - wxArrayString strList; -}; - -#endif // wxUSE_XRC && wxUSE_COMBOBOX - -#endif // _WX_XH_COMBO_H_ diff --git a/wxWidgets/include/wx/xrc/xh_datectrl.h b/wxWidgets/include/wx/xrc/xh_datectrl.h deleted file mode 100644 index 0fdb0835bd..0000000000 --- a/wxWidgets/include/wx/xrc/xh_datectrl.h +++ /dev/null @@ -1,30 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/xrc/xh_datectrl.h -// Purpose: XML resource handler for wxDatePickerCtrl -// Author: Vaclav Slavik -// Created: 2005-02-07 -// RCS-ID: $Id: xh_datectrl.h 41590 2006-10-03 14:53:40Z VZ $ -// Copyright: (c) 2005 Vaclav Slavik -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_XH_DATECTRL_H_ -#define _WX_XH_DATECTRL_H_ - -#include "wx/xrc/xmlres.h" - -#if wxUSE_XRC && wxUSE_DATEPICKCTRL - -class WXDLLIMPEXP_XRC wxDateCtrlXmlHandler : public wxXmlResourceHandler -{ - DECLARE_DYNAMIC_CLASS(wxDateCtrlXmlHandler) - -public: - wxDateCtrlXmlHandler(); - virtual wxObject *DoCreateResource(); - virtual bool CanHandle(wxXmlNode *node); -}; - -#endif // wxUSE_XRC && wxUSE_DATEPICKCTRL - -#endif // _WX_XH_DATECTRL_H_ diff --git a/wxWidgets/include/wx/xrc/xh_dirpicker.h b/wxWidgets/include/wx/xrc/xh_dirpicker.h deleted file mode 100644 index 24b98f579a..0000000000 --- a/wxWidgets/include/wx/xrc/xh_dirpicker.h +++ /dev/null @@ -1,30 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/xrc/xh_dirpicker.h -// Purpose: XML resource handler for wxDirPickerCtrl -// Author: Francesco Montorsi -// Created: 2006-04-17 -// RCS-ID: $Id: xh_dirpicker.h 41590 2006-10-03 14:53:40Z VZ $ -// Copyright: (c) 2006 Francesco Montorsi -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_XH_DIRPICKERCTRL_H_ -#define _WX_XH_DIRPICKERCTRL_H_ - -#include "wx/xrc/xmlres.h" - -#if wxUSE_XRC && wxUSE_DIRPICKERCTRL - -class WXDLLIMPEXP_XRC wxDirPickerCtrlXmlHandler : public wxXmlResourceHandler -{ - DECLARE_DYNAMIC_CLASS(wxDirPickerCtrlXmlHandler) - -public: - wxDirPickerCtrlXmlHandler(); - virtual wxObject *DoCreateResource(); - virtual bool CanHandle(wxXmlNode *node); -}; - -#endif // wxUSE_XRC && wxUSE_DIRPICKERCTRL - -#endif // _WX_XH_DIRPICKERCTRL_H_ diff --git a/wxWidgets/include/wx/xrc/xh_dlg.h b/wxWidgets/include/wx/xrc/xh_dlg.h deleted file mode 100644 index e12a43956c..0000000000 --- a/wxWidgets/include/wx/xrc/xh_dlg.h +++ /dev/null @@ -1,30 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/xrc/xh_dlg.h -// Purpose: XML resource handler for dialogs -// Author: Vaclav Slavik -// Created: 2000/03/05 -// RCS-ID: $Id: xh_dlg.h 41590 2006-10-03 14:53:40Z VZ $ -// Copyright: (c) 2000 Vaclav Slavik -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_XH_DLG_H_ -#define _WX_XH_DLG_H_ - -#include "wx/xrc/xmlres.h" - -#if wxUSE_XRC - -class WXDLLIMPEXP_XRC wxDialogXmlHandler : public wxXmlResourceHandler -{ - DECLARE_DYNAMIC_CLASS(wxDialogXmlHandler) - -public: - wxDialogXmlHandler(); - virtual wxObject *DoCreateResource(); - virtual bool CanHandle(wxXmlNode *node); -}; - -#endif // wxUSE_XRC - -#endif // _WX_XH_DLG_H_ diff --git a/wxWidgets/include/wx/xrc/xh_filepicker.h b/wxWidgets/include/wx/xrc/xh_filepicker.h deleted file mode 100644 index 0a64ad859f..0000000000 --- a/wxWidgets/include/wx/xrc/xh_filepicker.h +++ /dev/null @@ -1,30 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/xrc/xh_filepicker.h -// Purpose: XML resource handler for wxFilePickerCtrl -// Author: Francesco Montorsi -// Created: 2006-04-17 -// RCS-ID: $Id: xh_filepicker.h 41590 2006-10-03 14:53:40Z VZ $ -// Copyright: (c) 2006 Francesco Montorsi -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_XH_FILEPICKERCTRL_H_ -#define _WX_XH_FILEPICKERCTRL_H_ - -#include "wx/xrc/xmlres.h" - -#if wxUSE_XRC && wxUSE_FILEPICKERCTRL - -class WXDLLIMPEXP_XRC wxFilePickerCtrlXmlHandler : public wxXmlResourceHandler -{ - DECLARE_DYNAMIC_CLASS(wxFilePickerCtrlXmlHandler) - -public: - wxFilePickerCtrlXmlHandler(); - virtual wxObject *DoCreateResource(); - virtual bool CanHandle(wxXmlNode *node); -}; - -#endif // wxUSE_XRC && wxUSE_FILEPICKERCTRL - -#endif // _WX_XH_FILEPICKERCTRL_H_ diff --git a/wxWidgets/include/wx/xrc/xh_fontpicker.h b/wxWidgets/include/wx/xrc/xh_fontpicker.h deleted file mode 100644 index bbc661279a..0000000000 --- a/wxWidgets/include/wx/xrc/xh_fontpicker.h +++ /dev/null @@ -1,30 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/xrc/xh_fontpicker.h -// Purpose: XML resource handler for wxFontPickerCtrl -// Author: Francesco Montorsi -// Created: 2006-04-17 -// RCS-ID: $Id: xh_fontpicker.h 41590 2006-10-03 14:53:40Z VZ $ -// Copyright: (c) 2006 Francesco Montorsi -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_XH_FONTPICKERCTRL_H_ -#define _WX_XH_FONTPICKERCTRL_H_ - -#include "wx/xrc/xmlres.h" - -#if wxUSE_XRC && wxUSE_FONTPICKERCTRL - -class WXDLLIMPEXP_XRC wxFontPickerCtrlXmlHandler : public wxXmlResourceHandler -{ - DECLARE_DYNAMIC_CLASS(wxFontPickerCtrlXmlHandler) - -public: - wxFontPickerCtrlXmlHandler(); - virtual wxObject *DoCreateResource(); - virtual bool CanHandle(wxXmlNode *node); -}; - -#endif // wxUSE_XRC && wxUSE_FONTPICKERCTRL - -#endif // _WX_XH_FONTPICKERCTRL_H_ diff --git a/wxWidgets/include/wx/xrc/xh_frame.h b/wxWidgets/include/wx/xrc/xh_frame.h deleted file mode 100644 index 3bfcbe5b00..0000000000 --- a/wxWidgets/include/wx/xrc/xh_frame.h +++ /dev/null @@ -1,30 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/xrc/xh_frame.h -// Purpose: XML resource handler for wxFrame -// Author: Vaclav Slavik & Aleks. -// Created: 2000/03/05 -// RCS-ID: $Id: xh_frame.h 41590 2006-10-03 14:53:40Z VZ $ -// Copyright: (c) 2000 Vaclav Slavik -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_XH_FRAME_H_ -#define _WX_XH_FRAME_H_ - -#include "wx/xrc/xmlres.h" - -#if wxUSE_XRC - -class WXDLLIMPEXP_XRC wxFrameXmlHandler : public wxXmlResourceHandler -{ - DECLARE_DYNAMIC_CLASS(wxFrameXmlHandler) - -public: - wxFrameXmlHandler(); - virtual wxObject *DoCreateResource(); - virtual bool CanHandle(wxXmlNode *node); -}; - -#endif // wxUSE_XRC - -#endif // _WX_XH_FRAME_H_ diff --git a/wxWidgets/include/wx/xrc/xh_gauge.h b/wxWidgets/include/wx/xrc/xh_gauge.h deleted file mode 100644 index 05ce865205..0000000000 --- a/wxWidgets/include/wx/xrc/xh_gauge.h +++ /dev/null @@ -1,34 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/xrc/xh_gauge.h -// Purpose: XML resource handler for wxGauge -// Author: Bob Mitchell -// Created: 2000/03/21 -// RCS-ID: $Id: xh_gauge.h 41590 2006-10-03 14:53:40Z VZ $ -// Copyright: (c) 2000 Bob Mitchell and Verant Interactive -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_XH_GAUGE_H_ -#define _WX_XH_GAUGE_H_ - -#include "wx/xrc/xmlres.h" - -#if wxUSE_XRC && wxUSE_GAUGE - -class WXDLLIMPEXP_XRC wxGaugeXmlHandler : public wxXmlResourceHandler -{ - DECLARE_DYNAMIC_CLASS(wxGaugeXmlHandler) - enum - { - wxGAUGE_DEFAULT_RANGE = 100 - }; - -public: - wxGaugeXmlHandler(); - virtual wxObject *DoCreateResource(); - virtual bool CanHandle(wxXmlNode *node); -}; - -#endif // wxUSE_XRC && wxUSE_GAUGE - -#endif // _WX_XH_GAUGE_H_ diff --git a/wxWidgets/include/wx/xrc/xh_gdctl.h b/wxWidgets/include/wx/xrc/xh_gdctl.h deleted file mode 100644 index f706ccfb84..0000000000 --- a/wxWidgets/include/wx/xrc/xh_gdctl.h +++ /dev/null @@ -1,30 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/xrc/xh_gdctl.h -// Purpose: XML resource handler for wxGenericDirCtrl -// Author: Markus Greither -// Created: 2002/01/20 -// RCS-ID: $Id: xh_gdctl.h 41590 2006-10-03 14:53:40Z VZ $ -// Copyright: (c) 2002 Markus Greither -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_XH_GDCTL_H_ -#define _WX_XH_GDCTL_H_ - -#include "wx/xrc/xmlres.h" - -#if wxUSE_XRC && wxUSE_DIRDLG - -class WXDLLIMPEXP_XRC wxGenericDirCtrlXmlHandler : public wxXmlResourceHandler -{ - DECLARE_DYNAMIC_CLASS(wxGenericDirCtrlXmlHandler) - -public: - wxGenericDirCtrlXmlHandler(); - virtual wxObject *DoCreateResource(); - virtual bool CanHandle(wxXmlNode *node); -}; - -#endif // wxUSE_XRC && wxUSE_DIRDLG - -#endif // _WX_XH_GDCTL_H_ diff --git a/wxWidgets/include/wx/xrc/xh_grid.h b/wxWidgets/include/wx/xrc/xh_grid.h deleted file mode 100644 index 0cabb4b88e..0000000000 --- a/wxWidgets/include/wx/xrc/xh_grid.h +++ /dev/null @@ -1,31 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/xrc/xh_grid.h -// Purpose: XML resource handler for wxGrid -// Author: Agron Selimaj -// Created: 2005/08/11 -// RCS-ID: $Id: xh_grid.h 41590 2006-10-03 14:53:40Z VZ $ -// Copyright: (c) 2005 Agron Selimaj, Freepour Controls Inc. -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_XH_GRD_H_ -#define _WX_XH_GRD_H_ - -#include "wx/xrc/xmlres.h" - -#if wxUSE_XRC && wxUSE_GRID - -class WXDLLIMPEXP_XRC wxGridXmlHandler : public wxXmlResourceHandler -{ - DECLARE_DYNAMIC_CLASS(wxGridXmlHandler) - -public: - wxGridXmlHandler(); - - virtual wxObject *DoCreateResource(); - virtual bool CanHandle(wxXmlNode *node); -}; - -#endif // wxUSE_XRC && wxUSE_GRID - -#endif // _WX_XH_GRD_H_ diff --git a/wxWidgets/include/wx/xrc/xh_html.h b/wxWidgets/include/wx/xrc/xh_html.h deleted file mode 100644 index 770ea9ad19..0000000000 --- a/wxWidgets/include/wx/xrc/xh_html.h +++ /dev/null @@ -1,30 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/xrc/xh_html.h -// Purpose: XML resource handler for wxHtmlWindow -// Author: Bob Mitchell -// Created: 2000/03/21 -// RCS-ID: $Id: xh_html.h 41590 2006-10-03 14:53:40Z VZ $ -// Copyright: (c) 2000 Bob Mitchell and Verant Interactive -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_XH_HTML_H_ -#define _WX_XH_HTML_H_ - -#include "wx/xrc/xmlres.h" - -#if wxUSE_XRC && wxUSE_HTML - -class WXDLLIMPEXP_XRC wxHtmlWindowXmlHandler : public wxXmlResourceHandler -{ - DECLARE_DYNAMIC_CLASS(wxHtmlWindowXmlHandler) - -public: - wxHtmlWindowXmlHandler(); - virtual wxObject *DoCreateResource(); - virtual bool CanHandle(wxXmlNode *node); -}; - -#endif // wxUSE_XRC && wxUSE_HTML - -#endif // _WX_XH_HTML_H_ diff --git a/wxWidgets/include/wx/xrc/xh_htmllbox.h b/wxWidgets/include/wx/xrc/xh_htmllbox.h deleted file mode 100644 index e5c5ff943a..0000000000 --- a/wxWidgets/include/wx/xrc/xh_htmllbox.h +++ /dev/null @@ -1,34 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/xrc/xh_htmllbox.h -// Purpose: XML resource handler for wxSimpleHtmlListBox -// Author: Francesco Montorsi -// Created: 2006/10/21 -// RCS-ID: $Id: xh_htmllbox.h 42257 2006-10-22 22:09:16Z VZ $ -// Copyright: (c) 2006 Francesco Montorsi -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_XH_SIMPLEHTMLLISTBOX_H_ -#define _WX_XH_SIMPLEHTMLLISTBOX_H_ - -#include "wx/xrc/xmlres.h" - -#if wxUSE_XRC && wxUSE_HTML - -class WXDLLIMPEXP_XRC wxSimpleHtmlListBoxXmlHandler : public wxXmlResourceHandler -{ -public: - wxSimpleHtmlListBoxXmlHandler(); - virtual wxObject *DoCreateResource(); - virtual bool CanHandle(wxXmlNode *node); - -private: - bool m_insideBox; - wxArrayString strList; - - DECLARE_DYNAMIC_CLASS(wxSimpleHtmlListBoxXmlHandler) -}; - -#endif // wxUSE_XRC && wxUSE_HTML - -#endif // _WX_XH_SIMPLEHTMLLISTBOX_H_ diff --git a/wxWidgets/include/wx/xrc/xh_hyperlink.h b/wxWidgets/include/wx/xrc/xh_hyperlink.h deleted file mode 100644 index 573359faf7..0000000000 --- a/wxWidgets/include/wx/xrc/xh_hyperlink.h +++ /dev/null @@ -1,37 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/xrc/xh_hyperlink.h -// Purpose: Hyperlink control (wxAdv) -// Author: David Norris -// Modified by: Ryan Norton, Francesco Montorsi -// Created: 04/02/2005 -// RCS-ID: $Id: xh_hyperlink.h 41590 2006-10-03 14:53:40Z VZ $ -// Copyright: (c) 2005 David Norris -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_XH_HYPERLINKH__ -#define _WX_XH_HYPERLINKH__ - -#include "wx/xrc/xmlres.h" - -#if wxUSE_XRC && wxUSE_HYPERLINKCTRL - -class WXDLLIMPEXP_XRC wxHyperlinkCtrlXmlHandler : public wxXmlResourceHandler -{ - // Register with wxWindows' dynamic class subsystem. - DECLARE_DYNAMIC_CLASS(wxHyperlinkCtrlXmlHandler) - -public: - // Constructor. - wxHyperlinkCtrlXmlHandler(); - - // Creates the control and returns a pointer to it. - virtual wxObject *DoCreateResource(); - - // Returns true if we know how to create a control for the given node. - virtual bool CanHandle(wxXmlNode *node); -}; - -#endif // wxUSE_XRC && wxUSE_HYPERLINKCTRL - -#endif // _WX_XH_HYPERLINKH__ diff --git a/wxWidgets/include/wx/xrc/xh_listb.h b/wxWidgets/include/wx/xrc/xh_listb.h deleted file mode 100644 index 53c135066d..0000000000 --- a/wxWidgets/include/wx/xrc/xh_listb.h +++ /dev/null @@ -1,34 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/xrc/xh_listb.h -// Purpose: XML resource handler for wxListbox -// Author: Bob Mitchell & Vaclav Slavik -// Created: 2000/07/29 -// RCS-ID: $Id: xh_listb.h 41590 2006-10-03 14:53:40Z VZ $ -// Copyright: (c) 2000 Bob Mitchell & Vaclav Slavik -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_XH_LISTB_H_ -#define _WX_XH_LISTB_H_ - -#include "wx/xrc/xmlres.h" - -#if wxUSE_XRC && wxUSE_LISTBOX - -class WXDLLIMPEXP_XRC wxListBoxXmlHandler : public wxXmlResourceHandler -{ - DECLARE_DYNAMIC_CLASS(wxListBoxXmlHandler) - -public: - wxListBoxXmlHandler(); - virtual wxObject *DoCreateResource(); - virtual bool CanHandle(wxXmlNode *node); - -private: - bool m_insideBox; - wxArrayString strList; -}; - -#endif // wxUSE_XRC && wxUSE_LISTBOX - -#endif // _WX_XH_LISTB_H_ diff --git a/wxWidgets/include/wx/xrc/xh_listbk.h b/wxWidgets/include/wx/xrc/xh_listbk.h deleted file mode 100644 index 7aa2e0b2f3..0000000000 --- a/wxWidgets/include/wx/xrc/xh_listbk.h +++ /dev/null @@ -1,34 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/xrc/xh_listbk.h -// Purpose: XML resource handler for wxListbook -// Author: Vaclav Slavik -// Copyright: (c) 2000 Vaclav Slavik -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_XH_LISTBK_H_ -#define _WX_XH_LISTBK_H_ - -#include "wx/xrc/xmlres.h" - -#if wxUSE_XRC && wxUSE_LISTBOOK - -class WXDLLIMPEXP_FWD_CORE wxListbook; - -class WXDLLIMPEXP_XRC wxListbookXmlHandler : public wxXmlResourceHandler -{ - DECLARE_DYNAMIC_CLASS(wxListbookXmlHandler) - -public: - wxListbookXmlHandler(); - virtual wxObject *DoCreateResource(); - virtual bool CanHandle(wxXmlNode *node); - -private: - bool m_isInside; - wxListbook *m_listbook; -}; - -#endif // wxUSE_XRC && wxUSE_LISTBOOK - -#endif // _WX_XH_LISTBK_H_ diff --git a/wxWidgets/include/wx/xrc/xh_listc.h b/wxWidgets/include/wx/xrc/xh_listc.h deleted file mode 100644 index 33b19d9d77..0000000000 --- a/wxWidgets/include/wx/xrc/xh_listc.h +++ /dev/null @@ -1,30 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/xrc/xh_listc.h -// Purpose: XML resource handler for wxListCtrl -// Author: Brian Gavin -// Created: 2000/09/09 -// RCS-ID: $Id: xh_listc.h 41590 2006-10-03 14:53:40Z VZ $ -// Copyright: (c) 2000 Brian Gavin -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_XH_LISTC_H_ -#define _WX_XH_LISTC_H_ - -#include "wx/xrc/xmlres.h" - -#if wxUSE_XRC && wxUSE_LISTCTRL - -class WXDLLIMPEXP_XRC wxListCtrlXmlHandler : public wxXmlResourceHandler -{ - DECLARE_DYNAMIC_CLASS(wxListCtrlXmlHandler) - -public: - wxListCtrlXmlHandler(); - virtual wxObject *DoCreateResource(); - virtual bool CanHandle(wxXmlNode *node); -}; - -#endif // wxUSE_XRC && wxUSE_LISTCTRL - -#endif // _WX_XH_LISTC_H_ diff --git a/wxWidgets/include/wx/xrc/xh_mdi.h b/wxWidgets/include/wx/xrc/xh_mdi.h deleted file mode 100644 index 6cd1fc7e72..0000000000 --- a/wxWidgets/include/wx/xrc/xh_mdi.h +++ /dev/null @@ -1,35 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/xrc/xh_mdi.h -// Purpose: XML resource handler for wxMDI -// Author: David M. Falkinder & Vaclav Slavik -// Created: 14/02/2005 -// RCS-ID: $Id: xh_mdi.h 49804 2007-11-10 01:09:42Z VZ $ -// Copyright: (c) 2005 Vaclav Slavik -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_XH_MDI_H_ -#define _WX_XH_MDI_H_ - -#include "wx/xrc/xmlres.h" - -#if wxUSE_XRC && wxUSE_MDI - -class WXDLLIMPEXP_FWD_CORE wxWindow; - -class WXDLLIMPEXP_XRC wxMdiXmlHandler : public wxXmlResourceHandler -{ - DECLARE_DYNAMIC_CLASS(wxMdiXmlHandler) - -public: - wxMdiXmlHandler(); - virtual wxObject *DoCreateResource(); - virtual bool CanHandle(wxXmlNode *node); - -private: - wxWindow *CreateFrame(); -}; - -#endif // wxUSE_XRC && wxUSE_MDI - -#endif // _WX_XH_MDI_H_ diff --git a/wxWidgets/include/wx/xrc/xh_menu.h b/wxWidgets/include/wx/xrc/xh_menu.h deleted file mode 100644 index 2599478acb..0000000000 --- a/wxWidgets/include/wx/xrc/xh_menu.h +++ /dev/null @@ -1,43 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/xrc/xh_menu.h -// Purpose: XML resource handler for menus/menubars -// Author: Vaclav Slavik -// Created: 2000/03/05 -// RCS-ID: $Id: xh_menu.h 41590 2006-10-03 14:53:40Z VZ $ -// Copyright: (c) 2000 Vaclav Slavik -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_XH_MENU_H_ -#define _WX_XH_MENU_H_ - -#include "wx/xrc/xmlres.h" - -#if wxUSE_XRC && wxUSE_MENUS - -class WXDLLIMPEXP_XRC wxMenuXmlHandler : public wxXmlResourceHandler -{ - DECLARE_DYNAMIC_CLASS(wxMenuXmlHandler) - -public: - wxMenuXmlHandler(); - virtual wxObject *DoCreateResource(); - virtual bool CanHandle(wxXmlNode *node); - -private: - bool m_insideMenu; -}; - -class WXDLLIMPEXP_XRC wxMenuBarXmlHandler : public wxXmlResourceHandler -{ - DECLARE_DYNAMIC_CLASS(wxMenuBarXmlHandler) - -public: - wxMenuBarXmlHandler(); - virtual wxObject *DoCreateResource(); - virtual bool CanHandle(wxXmlNode *node); -}; - -#endif // wxUSE_XRC && wxUSE_MENUS - -#endif // _WX_XH_MENU_H_ diff --git a/wxWidgets/include/wx/xrc/xh_notbk.h b/wxWidgets/include/wx/xrc/xh_notbk.h deleted file mode 100644 index 2f97b4ceb5..0000000000 --- a/wxWidgets/include/wx/xrc/xh_notbk.h +++ /dev/null @@ -1,35 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/xrc/xh_notbk.h -// Purpose: XML resource handler for wxNotebook -// Author: Vaclav Slavik -// RCS-ID: $Id: xh_notbk.h 53135 2008-04-12 02:31:04Z VZ $ -// Copyright: (c) 2000 Vaclav Slavik -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_XH_NOTBK_H_ -#define _WX_XH_NOTBK_H_ - -#include "wx/xrc/xmlres.h" - -#if wxUSE_XRC && wxUSE_NOTEBOOK - -class WXDLLIMPEXP_FWD_CORE wxNotebook; - -class WXDLLIMPEXP_XRC wxNotebookXmlHandler : public wxXmlResourceHandler -{ - DECLARE_DYNAMIC_CLASS(wxNotebookXmlHandler) - -public: - wxNotebookXmlHandler(); - virtual wxObject *DoCreateResource(); - virtual bool CanHandle(wxXmlNode *node); - -private: - bool m_isInside; - wxNotebook *m_notebook; -}; - -#endif // wxUSE_XRC && wxUSE_NOTEBOOK - -#endif // _WX_XH_NOTBK_H_ diff --git a/wxWidgets/include/wx/xrc/xh_odcombo.h b/wxWidgets/include/wx/xrc/xh_odcombo.h deleted file mode 100644 index ffbd021124..0000000000 --- a/wxWidgets/include/wx/xrc/xh_odcombo.h +++ /dev/null @@ -1,35 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/xrc/xh_odcombo.h -// Purpose: XML resource handler for wxOwnerDrawnComboBox -// Author: Alex Bligh - based on wx/xrc/xh_combo.h -// Created: 2006/06/19 -// RCS-ID: $Id: xh_odcombo.h 41590 2006-10-03 14:53:40Z VZ $ -// Copyright: (c) 2006 Alex Bligh -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_XH_ODCOMBO_H_ -#define _WX_XH_ODCOMBO_H_ - -#include "wx/xrc/xmlres.h" - -#if wxUSE_XRC && wxUSE_ODCOMBOBOX - -class WXDLLIMPEXP_XRC wxOwnerDrawnComboBoxXmlHandler : public wxXmlResourceHandler -{ - DECLARE_DYNAMIC_CLASS(wxOwnerDrawnComboBoxXmlHandler) - -public: - wxOwnerDrawnComboBoxXmlHandler(); - virtual wxObject *DoCreateResource(); - virtual bool CanHandle(wxXmlNode *node); - -private: - bool m_insideBox; - wxArrayString strList; -}; - -#endif // wxUSE_XRC && wxUSE_ODCOMBOBOX - -#endif // _WX_XH_ODCOMBO_H_ - diff --git a/wxWidgets/include/wx/xrc/xh_panel.h b/wxWidgets/include/wx/xrc/xh_panel.h deleted file mode 100644 index 600ebf289f..0000000000 --- a/wxWidgets/include/wx/xrc/xh_panel.h +++ /dev/null @@ -1,30 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/xrc/xh_panel.h -// Purpose: XML resource handler for wxPanel -// Author: Vaclav Slavik -// Created: 2000/03/05 -// RCS-ID: $Id: xh_panel.h 41590 2006-10-03 14:53:40Z VZ $ -// Copyright: (c) 2000 Vaclav Slavik -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_XH_PANEL_H_ -#define _WX_XH_PANEL_H_ - -#include "wx/xrc/xmlres.h" - -#if wxUSE_XRC - -class WXDLLIMPEXP_XRC wxPanelXmlHandler : public wxXmlResourceHandler -{ - DECLARE_DYNAMIC_CLASS(wxPanelXmlHandler) - -public: - wxPanelXmlHandler(); - virtual wxObject *DoCreateResource(); - virtual bool CanHandle(wxXmlNode *node); -}; - -#endif // wxUSE_XRC - -#endif // _WX_XH_PANEL_H_ diff --git a/wxWidgets/include/wx/xrc/xh_propdlg.h b/wxWidgets/include/wx/xrc/xh_propdlg.h deleted file mode 100644 index e55f1d3580..0000000000 --- a/wxWidgets/include/wx/xrc/xh_propdlg.h +++ /dev/null @@ -1,38 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/xrc/xh_propdlg.h -// Purpose: XML resource handler for wxPropertySheetDialog -// Author: Sander Berents -// Created: 2007/07/12 -// RCS-ID: $Id: xh_propdlg.h 53135 2008-04-12 02:31:04Z VZ $ -// Copyright: (c) 2007 Sander Berents -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_XH_PROPDLG_H_ -#define _WX_XH_PROPDLG_H_ - -#include "wx/xrc/xmlres.h" - -#if wxUSE_XRC - -#if wxABI_VERSION >= 20805 -class WXDLLIMPEXP_FWD_ADV wxPropertySheetDialog; - -class WXDLLIMPEXP_XRC wxPropertySheetDialogXmlHandler : public wxXmlResourceHandler -{ - DECLARE_DYNAMIC_CLASS(wxPropertySheetDialogXmlHandler) - -public: - wxPropertySheetDialogXmlHandler(); - virtual wxObject *DoCreateResource(); - virtual bool CanHandle(wxXmlNode *node); - -private: - bool m_isInside; - wxPropertySheetDialog *m_dialog; -}; -#endif // wxABI_VERSION >= 20805 - -#endif // wxUSE_XRC - -#endif // _WX_XH_PROPDLG_H_ diff --git a/wxWidgets/include/wx/xrc/xh_radbt.h b/wxWidgets/include/wx/xrc/xh_radbt.h deleted file mode 100644 index da61711f55..0000000000 --- a/wxWidgets/include/wx/xrc/xh_radbt.h +++ /dev/null @@ -1,30 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/xrc/xh_radbt.h -// Purpose: XML resource handler for wxRadioButton -// Author: Bob Mitchell -// Created: 2000/03/21 -// RCS-ID: $Id: xh_radbt.h 41590 2006-10-03 14:53:40Z VZ $ -// Copyright: (c) 2000 Bob Mitchell and Verant Interactive -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_XH_RADBT_H_ -#define _WX_XH_RADBT_H_ - -#include "wx/xrc/xmlres.h" - -#if wxUSE_XRC && wxUSE_RADIOBTN - -class WXDLLIMPEXP_XRC wxRadioButtonXmlHandler : public wxXmlResourceHandler -{ - DECLARE_DYNAMIC_CLASS(wxRadioButtonXmlHandler) - -public: - wxRadioButtonXmlHandler(); - virtual wxObject *DoCreateResource(); - virtual bool CanHandle(wxXmlNode *node); -}; - -#endif // wxUSE_XRC && wxUSE_RADIOBOX - -#endif // _WX_XH_RADBT_H_ diff --git a/wxWidgets/include/wx/xrc/xh_radbx.h b/wxWidgets/include/wx/xrc/xh_radbx.h deleted file mode 100644 index f53e0a6eb1..0000000000 --- a/wxWidgets/include/wx/xrc/xh_radbx.h +++ /dev/null @@ -1,43 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/xrc/xh_radbx.h -// Purpose: XML resource handler for wxRadioBox -// Author: Bob Mitchell -// Created: 2000/03/21 -// RCS-ID: $Id: xh_radbx.h 41590 2006-10-03 14:53:40Z VZ $ -// Copyright: (c) 2000 Bob Mitchell and Verant Interactive -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_XH_RADBX_H_ -#define _WX_XH_RADBX_H_ - -#include "wx/xrc/xmlres.h" - -#if wxUSE_XRC && wxUSE_RADIOBOX - -class WXDLLIMPEXP_XRC wxRadioBoxXmlHandler : public wxXmlResourceHandler -{ - DECLARE_DYNAMIC_CLASS(wxRadioBoxXmlHandler) - -public: - wxRadioBoxXmlHandler(); - virtual wxObject *DoCreateResource(); - virtual bool CanHandle(wxXmlNode *node); - -private: - bool m_insideBox; - - // the items labels - wxArrayString labels; - - // the items tooltips - wxArrayString tooltips; - - // the item help text - wxArrayString helptexts; - wxArrayInt helptextSpecified; -}; - -#endif // wxUSE_XRC && wxUSE_RADIOBOX - -#endif // _WX_XH_RADBX_H_ diff --git a/wxWidgets/include/wx/xrc/xh_richtext.h b/wxWidgets/include/wx/xrc/xh_richtext.h deleted file mode 100644 index 17772eeb99..0000000000 --- a/wxWidgets/include/wx/xrc/xh_richtext.h +++ /dev/null @@ -1,30 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/xrc/xh_text.h -// Purpose: XML resource handler for wxRichTextCtrl -// Author: Julian Smart -// Created: 2006-11-08 -// RCS-ID: $Id: xh_richtext.h 43199 2006-11-08 15:45:11Z JS $ -// Copyright: (c) 2006 Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_XH_RICHTEXT_H_ -#define _WX_XH_RICHTEXT_H_ - -#include "wx/xrc/xmlres.h" - -#if wxUSE_XRC && wxUSE_RICHTEXT - -class WXDLLIMPEXP_XRC wxRichTextCtrlXmlHandler : public wxXmlResourceHandler -{ - DECLARE_DYNAMIC_CLASS(wxRichTextCtrlXmlHandler) - -public: - wxRichTextCtrlXmlHandler(); - virtual wxObject *DoCreateResource(); - virtual bool CanHandle(wxXmlNode *node); -}; - -#endif // wxUSE_XRC && wxUSE_RICHTEXT - -#endif // _WX_XH_RICHTEXT_H_ diff --git a/wxWidgets/include/wx/xrc/xh_scrol.h b/wxWidgets/include/wx/xrc/xh_scrol.h deleted file mode 100644 index 978e82bc5c..0000000000 --- a/wxWidgets/include/wx/xrc/xh_scrol.h +++ /dev/null @@ -1,36 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/xrc/xh_scrol.h -// Purpose: XML resource handler for wxScrollBar -// Author: Brian Gavin -// Created: 2000/09/09 -// RCS-ID: $Id: xh_scrol.h 41590 2006-10-03 14:53:40Z VZ $ -// Copyright: (c) 2000 Brian Gavin -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_XH_SCROL_H_ -#define _WX_XH_SCROL_H_ - -#include "wx/xrc/xmlres.h" - -#if wxUSE_XRC && wxUSE_SCROLLBAR - -class WXDLLIMPEXP_XRC wxScrollBarXmlHandler : public wxXmlResourceHandler -{ - DECLARE_DYNAMIC_CLASS(wxScrollBarXmlHandler) - enum - { - wxSL_DEFAULT_VALUE = 0, - wxSL_DEFAULT_MIN = 0, - wxSL_DEFAULT_MAX = 100 - }; - -public: - wxScrollBarXmlHandler(); - virtual wxObject *DoCreateResource(); - virtual bool CanHandle(wxXmlNode *node); -}; - -#endif // wxUSE_XRC && wxUSE_SCROLLBAR - -#endif // _WX_XH_SCROL_H_ diff --git a/wxWidgets/include/wx/xrc/xh_scwin.h b/wxWidgets/include/wx/xrc/xh_scwin.h deleted file mode 100644 index 9875f4e3e8..0000000000 --- a/wxWidgets/include/wx/xrc/xh_scwin.h +++ /dev/null @@ -1,30 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/xrc/xh_scwin.h -// Purpose: XML resource handler for wxScrolledWindow -// Author: Vaclav Slavik -// Created: 2002/10/18 -// RCS-ID: $Id: xh_scwin.h 41590 2006-10-03 14:53:40Z VZ $ -// Copyright: (c) 2002 Vaclav Slavik -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_XH_SCWIN_H_ -#define _WX_XH_SCWIN_H_ - -#include "wx/xrc/xmlres.h" - -#if wxUSE_XRC - -class WXDLLIMPEXP_XRC wxScrolledWindowXmlHandler : public wxXmlResourceHandler -{ - DECLARE_DYNAMIC_CLASS(wxScrolledWindowXmlHandler) - -public: - wxScrolledWindowXmlHandler(); - virtual wxObject *DoCreateResource(); - virtual bool CanHandle(wxXmlNode *node); -}; - -#endif // wxUSE_XRC - -#endif // _WX_XH_SCWIN_H_ diff --git a/wxWidgets/include/wx/xrc/xh_sizer.h b/wxWidgets/include/wx/xrc/xh_sizer.h deleted file mode 100644 index 15b30ff3d3..0000000000 --- a/wxWidgets/include/wx/xrc/xh_sizer.h +++ /dev/null @@ -1,80 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/xrc/xh_sizer.h -// Purpose: XML resource handler for wxBoxSizer -// Author: Vaclav Slavik -// Created: 2000/04/24 -// RCS-ID: $Id: xh_sizer.h 49804 2007-11-10 01:09:42Z VZ $ -// Copyright: (c) 2000 Vaclav Slavik -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_XH_SIZER_H_ -#define _WX_XH_SIZER_H_ - -#include "wx/xrc/xmlres.h" - -#if wxUSE_XRC - -#include "wx/sizer.h" -#include "wx/gbsizer.h" - -class WXDLLIMPEXP_FWD_CORE wxSizer; - -class WXDLLIMPEXP_XRC wxSizerXmlHandler : public wxXmlResourceHandler -{ - DECLARE_DYNAMIC_CLASS(wxSizerXmlHandler) - -public: - wxSizerXmlHandler(); - virtual wxObject *DoCreateResource(); - virtual bool CanHandle(wxXmlNode *node); - -private: - bool m_isInside; - bool m_isGBS; - - wxSizer *m_parentSizer; - - bool IsSizerNode(wxXmlNode *node); - - wxObject* Handle_sizeritem(); - wxObject* Handle_spacer(); - wxObject* Handle_sizer(); - wxSizer* Handle_wxBoxSizer(); -#if wxUSE_STATBOX - wxSizer* Handle_wxStaticBoxSizer(); -#endif - wxSizer* Handle_wxGridSizer(); - wxSizer* Handle_wxFlexGridSizer(); - wxSizer* Handle_wxGridBagSizer(); - - void SetGrowables(wxFlexGridSizer* fsizer, const wxChar* param, bool rows); - wxGBPosition GetGBPos(const wxString& param); - wxGBSpan GetGBSpan(const wxString& param); - wxSizerItem* MakeSizerItem(); - void SetSizerItemAttributes(wxSizerItem* sitem); - void AddSizerItem(wxSizerItem* sitem); -}; - -#if wxUSE_BUTTON - -class WXDLLIMPEXP_XRC wxStdDialogButtonSizerXmlHandler - : public wxXmlResourceHandler -{ - DECLARE_DYNAMIC_CLASS(wxStdDialogButtonSizerXmlHandler) - -public: - wxStdDialogButtonSizerXmlHandler(); - virtual wxObject *DoCreateResource(); - virtual bool CanHandle(wxXmlNode *node); - -private: - bool m_isInside; - wxStdDialogButtonSizer *m_parentSizer; -}; - -#endif // wxUSE_BUTTON - -#endif // wxUSE_XRC - -#endif // _WX_XH_SIZER_H_ diff --git a/wxWidgets/include/wx/xrc/xh_slidr.h b/wxWidgets/include/wx/xrc/xh_slidr.h deleted file mode 100644 index 8c415941a3..0000000000 --- a/wxWidgets/include/wx/xrc/xh_slidr.h +++ /dev/null @@ -1,36 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/xrc/xh_slidr.h -// Purpose: XML resource handler for wxSlider -// Author: Bob Mitchell -// Created: 2000/03/21 -// RCS-ID: $Id: xh_slidr.h 41590 2006-10-03 14:53:40Z VZ $ -// Copyright: (c) 2000 Bob Mitchell and Verant Interactive -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_XH_SLIDR_H_ -#define _WX_XH_SLIDR_H_ - -#include "wx/xrc/xmlres.h" - -#if wxUSE_XRC && wxUSE_SLIDER - -class WXDLLIMPEXP_XRC wxSliderXmlHandler : public wxXmlResourceHandler -{ - DECLARE_DYNAMIC_CLASS(wxSliderXmlHandler) - enum - { - wxSL_DEFAULT_VALUE = 0, - wxSL_DEFAULT_MIN = 0, - wxSL_DEFAULT_MAX = 100 - }; - -public: - wxSliderXmlHandler(); - virtual wxObject *DoCreateResource(); - virtual bool CanHandle(wxXmlNode *node); -}; - -#endif // wxUSE_XRC && wxUSE_SLIDER - -#endif // _WX_XH_SLIDR_H_ diff --git a/wxWidgets/include/wx/xrc/xh_spin.h b/wxWidgets/include/wx/xrc/xh_spin.h deleted file mode 100644 index d4b315186f..0000000000 --- a/wxWidgets/include/wx/xrc/xh_spin.h +++ /dev/null @@ -1,61 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/xrc/xh_spin.h -// Purpose: XML resource handler for wxSpinButton and wxSpinCtrl -// Author: Bob Mitchell -// Created: 2000/03/21 -// RCS-ID: $Id: xh_spin.h 41590 2006-10-03 14:53:40Z VZ $ -// Copyright: (c) 2000 Bob Mitchell and Verant Interactive -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_XH_SPIN_H_ -#define _WX_XH_SPIN_H_ - -#include "wx/xrc/xmlres.h" - -#if wxUSE_XRC - -#if wxUSE_SPINBTN - -class WXDLLIMPEXP_XRC wxSpinButtonXmlHandler : public wxXmlResourceHandler -{ - DECLARE_DYNAMIC_CLASS(wxSpinButtonXmlHandler) - enum - { - wxSP_DEFAULT_VALUE = 0, - wxSP_DEFAULT_MIN = 0, - wxSP_DEFAULT_MAX = 100 - }; - -public: - wxSpinButtonXmlHandler(); - virtual wxObject *DoCreateResource(); - virtual bool CanHandle(wxXmlNode *node); -}; - -#endif // wxUSE_SPINBTN - - -#if wxUSE_SPINCTRL - -class WXDLLIMPEXP_XRC wxSpinCtrlXmlHandler : public wxXmlResourceHandler -{ - DECLARE_DYNAMIC_CLASS(wxSpinCtrlXmlHandler) - enum - { - wxSP_DEFAULT_VALUE = 0, - wxSP_DEFAULT_MIN = 0, - wxSP_DEFAULT_MAX = 100 - }; - -public: - wxSpinCtrlXmlHandler(); - virtual wxObject *DoCreateResource(); - virtual bool CanHandle(wxXmlNode *node); -}; - -#endif // wxUSE_SPINCTRL - -#endif // wxUSE_XRC - -#endif // _WX_XH_SPIN_H_ diff --git a/wxWidgets/include/wx/xrc/xh_split.h b/wxWidgets/include/wx/xrc/xh_split.h deleted file mode 100644 index c47330e5e3..0000000000 --- a/wxWidgets/include/wx/xrc/xh_split.h +++ /dev/null @@ -1,30 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/xrc/xh_split.h -// Purpose: XRC resource for wxSplitterWindow -// Author: panga@freemail.hu, Vaclav Slavik -// Created: 2003/01/26 -// RCS-ID: $Id: xh_split.h 41590 2006-10-03 14:53:40Z VZ $ -// Copyright: (c) 2003 panga@freemail.hu, Vaclav Slavik -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_XH_SPLIT_H_ -#define _WX_XH_SPLIT_H_ - -#include "wx/xrc/xmlres.h" - -#if wxUSE_XRC && wxUSE_SPLITTER - -class WXDLLIMPEXP_XRC wxSplitterWindowXmlHandler : public wxXmlResourceHandler -{ - DECLARE_DYNAMIC_CLASS(wxSplitterWindowXmlHandler) - -public: - wxSplitterWindowXmlHandler(); - virtual wxObject *DoCreateResource(); - virtual bool CanHandle(wxXmlNode *node); -}; - -#endif // wxUSE_XRC && wxUSE_SPLITTER - -#endif // _WX_XH_SPLIT_H_ diff --git a/wxWidgets/include/wx/xrc/xh_statbar.h b/wxWidgets/include/wx/xrc/xh_statbar.h deleted file mode 100644 index 1a2787b125..0000000000 --- a/wxWidgets/include/wx/xrc/xh_statbar.h +++ /dev/null @@ -1,30 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/xrc/xh_statbar.h -// Purpose: XML resource handler for wxStatusBar -// Author: Brian Ravnsgaard Riis -// Created: 2004/01/21 -// RCS-ID: -// Copyright: (c) 2004 Brian Ravnsgaard Riis -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_XH_STATBAR_H_ -#define _WX_XH_STATBAR_H_ - -#include "wx/xrc/xmlres.h" - -#if wxUSE_XRC && wxUSE_STATUSBAR - -class WXDLLIMPEXP_XRC wxStatusBarXmlHandler : public wxXmlResourceHandler -{ - DECLARE_DYNAMIC_CLASS(wxStatusBarXmlHandler) - -public: - wxStatusBarXmlHandler(); - virtual wxObject *DoCreateResource(); - virtual bool CanHandle(wxXmlNode *node); -}; - -#endif // wxUSE_XRC && wxUSE_STATUSBAR - -#endif // _WX_XH_STATBAR_H_ diff --git a/wxWidgets/include/wx/xrc/xh_stbmp.h b/wxWidgets/include/wx/xrc/xh_stbmp.h deleted file mode 100644 index 0e1497fdff..0000000000 --- a/wxWidgets/include/wx/xrc/xh_stbmp.h +++ /dev/null @@ -1,30 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/xrc/xh_stbmp.h -// Purpose: XML resource handler for wxStaticBitmap -// Author: Vaclav Slavik -// Created: 2000/04/22 -// RCS-ID: $Id: xh_stbmp.h 41590 2006-10-03 14:53:40Z VZ $ -// Copyright: (c) 2000 Vaclav Slavik -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_XH_STBMP_H_ -#define _WX_XH_STBMP_H_ - -#include "wx/xrc/xmlres.h" - -#if wxUSE_XRC && wxUSE_STATBMP - -class WXDLLIMPEXP_XRC wxStaticBitmapXmlHandler : public wxXmlResourceHandler -{ - DECLARE_DYNAMIC_CLASS(wxStaticBitmapXmlHandler) - -public: - wxStaticBitmapXmlHandler(); - virtual wxObject *DoCreateResource(); - virtual bool CanHandle(wxXmlNode *node); -}; - -#endif // wxUSE_XRC && wxUSE_STATBMP - -#endif // _WX_XH_STBMP_H_ diff --git a/wxWidgets/include/wx/xrc/xh_stbox.h b/wxWidgets/include/wx/xrc/xh_stbox.h deleted file mode 100644 index 032f4d5ba1..0000000000 --- a/wxWidgets/include/wx/xrc/xh_stbox.h +++ /dev/null @@ -1,30 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/xrc/xh_stbox.h -// Purpose: XML resource handler for wxStaticBox -// Author: Brian Gavin -// Created: 2000/09/00 -// RCS-ID: $Id: xh_stbox.h 41590 2006-10-03 14:53:40Z VZ $ -// Copyright: (c) 2000 Brian Gavin -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_XH_STBOX_H_ -#define _WX_XH_STBOX_H_ - -#include "wx/xrc/xmlres.h" - -#if wxUSE_XRC && wxUSE_STATBOX - -class WXDLLIMPEXP_XRC wxStaticBoxXmlHandler : public wxXmlResourceHandler -{ - DECLARE_DYNAMIC_CLASS(wxStaticBoxXmlHandler) - -public: - wxStaticBoxXmlHandler(); - virtual wxObject *DoCreateResource(); - virtual bool CanHandle(wxXmlNode *node); -}; - -#endif // wxUSE_XRC && wxUSE_STATBOX - -#endif // _WX_XH_STBOX_H_ diff --git a/wxWidgets/include/wx/xrc/xh_stlin.h b/wxWidgets/include/wx/xrc/xh_stlin.h deleted file mode 100644 index 7eb834bde0..0000000000 --- a/wxWidgets/include/wx/xrc/xh_stlin.h +++ /dev/null @@ -1,30 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/xrc/xh_stlin.h -// Purpose: XML resource handler for wxStaticLine -// Author: Vaclav Slavik -// Created: 2000/09/00 -// RCS-ID: $Id: xh_stlin.h 41590 2006-10-03 14:53:40Z VZ $ -// Copyright: (c) 2000 Vaclav Slavik -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_XH_STLIN_H_ -#define _WX_XH_STLIN_H_ - -#include "wx/xrc/xmlres.h" - -#if wxUSE_XRC && wxUSE_STATLINE - -class WXDLLIMPEXP_XRC wxStaticLineXmlHandler : public wxXmlResourceHandler -{ - DECLARE_DYNAMIC_CLASS(wxStaticLineXmlHandler) - -public: - wxStaticLineXmlHandler(); - virtual wxObject *DoCreateResource(); - virtual bool CanHandle(wxXmlNode *node); -}; - -#endif // wxUSE_XRC && wxUSE_STATLINE - -#endif // _WX_XH_STLIN_H_ diff --git a/wxWidgets/include/wx/xrc/xh_sttxt.h b/wxWidgets/include/wx/xrc/xh_sttxt.h deleted file mode 100644 index cd0247c256..0000000000 --- a/wxWidgets/include/wx/xrc/xh_sttxt.h +++ /dev/null @@ -1,30 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/xrc/xh_sttxt.h -// Purpose: XML resource handler for wxStaticText -// Author: Bob Mitchell -// Created: 2000/03/21 -// RCS-ID: $Id: xh_sttxt.h 41590 2006-10-03 14:53:40Z VZ $ -// Copyright: (c) 2000 Bob Mitchell -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_XH_STTXT_H_ -#define _WX_XH_STTXT_H_ - -#include "wx/xrc/xmlres.h" - -#if wxUSE_XRC && wxUSE_STATTEXT - -class WXDLLIMPEXP_XRC wxStaticTextXmlHandler : public wxXmlResourceHandler -{ - DECLARE_DYNAMIC_CLASS(wxStaticTextXmlHandler) - -public: - wxStaticTextXmlHandler(); - virtual wxObject *DoCreateResource(); - virtual bool CanHandle(wxXmlNode *node); -}; - -#endif // wxUSE_XRC && wxUSE_STATTEXT - -#endif // _WX_XH_STTXT_H_ diff --git a/wxWidgets/include/wx/xrc/xh_text.h b/wxWidgets/include/wx/xrc/xh_text.h deleted file mode 100644 index 8b50a273a5..0000000000 --- a/wxWidgets/include/wx/xrc/xh_text.h +++ /dev/null @@ -1,30 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/xrc/xh_text.h -// Purpose: XML resource handler for wxTextCtrl -// Author: Aleksandras Gluchovas -// Created: 2000/03/21 -// RCS-ID: $Id: xh_text.h 41590 2006-10-03 14:53:40Z VZ $ -// Copyright: (c) 2000 Aleksandras Gluchovas -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_XH_TEXT_H_ -#define _WX_XH_TEXT_H_ - -#include "wx/xrc/xmlres.h" - -#if wxUSE_XRC && wxUSE_TEXTCTRL - -class WXDLLIMPEXP_XRC wxTextCtrlXmlHandler : public wxXmlResourceHandler -{ - DECLARE_DYNAMIC_CLASS(wxTextCtrlXmlHandler) - -public: - wxTextCtrlXmlHandler(); - virtual wxObject *DoCreateResource(); - virtual bool CanHandle(wxXmlNode *node); -}; - -#endif // wxUSE_XRC && wxUSE_TEXTCTRL - -#endif // _WX_XH_TEXT_H_ diff --git a/wxWidgets/include/wx/xrc/xh_tglbtn.h b/wxWidgets/include/wx/xrc/xh_tglbtn.h deleted file mode 100644 index 844ff9b657..0000000000 --- a/wxWidgets/include/wx/xrc/xh_tglbtn.h +++ /dev/null @@ -1,30 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/xrc/xh_tglbtn.h -// Purpose: XML resource handler for wxToggleButton -// Author: Julian Smart -// Created: 2004-08-30 -// RCS-ID: $Id: xh_tglbtn.h 41590 2006-10-03 14:53:40Z VZ $ -// Copyright: (c) 2004 Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_XH_TGLBTN_H_ -#define _WX_XH_TGLBTN_H_ - -#include "wx/xrc/xmlres.h" - -#if wxUSE_XRC && wxUSE_TOGGLEBTN - -class WXDLLIMPEXP_XRC wxToggleButtonXmlHandler : public wxXmlResourceHandler -{ - DECLARE_DYNAMIC_CLASS(wxToggleButtonXmlHandler) - -public: - wxToggleButtonXmlHandler(); - virtual wxObject *DoCreateResource(); - virtual bool CanHandle(wxXmlNode *node); -}; - -#endif // wxUSE_XRC && wxUSE_TOGGLEBTN - -#endif // _WX_XH_TGLBTN_H_ diff --git a/wxWidgets/include/wx/xrc/xh_toolb.h b/wxWidgets/include/wx/xrc/xh_toolb.h deleted file mode 100644 index 3ef690cfad..0000000000 --- a/wxWidgets/include/wx/xrc/xh_toolb.h +++ /dev/null @@ -1,36 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/xrc/xh_toolb.h -// Purpose: XML resource handler for wxToolBar -// Author: Vaclav Slavik -// Created: 2000/08/11 -// RCS-ID: $Id: xh_toolb.h 53135 2008-04-12 02:31:04Z VZ $ -// Copyright: (c) 2000 Vaclav Slavik -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_XH_TOOLB_H_ -#define _WX_XH_TOOLB_H_ - -#include "wx/xrc/xmlres.h" - -#if wxUSE_XRC && wxUSE_TOOLBAR - -class WXDLLIMPEXP_FWD_CORE wxToolBar; - -class WXDLLIMPEXP_XRC wxToolBarXmlHandler : public wxXmlResourceHandler -{ - DECLARE_DYNAMIC_CLASS(wxToolBarXmlHandler) - -public: - wxToolBarXmlHandler(); - virtual wxObject *DoCreateResource(); - virtual bool CanHandle(wxXmlNode *node); - -private: - bool m_isInside; - wxToolBar *m_toolbar; -}; - -#endif // wxUSE_XRC && wxUSE_TOOLBAR - -#endif // _WX_XH_TOOLB_H_ diff --git a/wxWidgets/include/wx/xrc/xh_tree.h b/wxWidgets/include/wx/xrc/xh_tree.h deleted file mode 100644 index 560a5d8e43..0000000000 --- a/wxWidgets/include/wx/xrc/xh_tree.h +++ /dev/null @@ -1,30 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/xrc/xh_tree.h -// Purpose: XML resource handler for wxTreeCtrl -// Author: Brian Gavin -// Created: 2000/09/09 -// RCS-ID: $Id: xh_tree.h 41590 2006-10-03 14:53:40Z VZ $ -// Copyright: (c) 2000 Brian Gavin -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_XH_TREE_H_ -#define _WX_XH_TREE_H_ - -#include "wx/xrc/xmlres.h" - -#if wxUSE_XRC && wxUSE_TREECTRL - -class WXDLLIMPEXP_XRC wxTreeCtrlXmlHandler : public wxXmlResourceHandler -{ - DECLARE_DYNAMIC_CLASS(wxTreeCtrlXmlHandler) - -public: - wxTreeCtrlXmlHandler(); - virtual wxObject *DoCreateResource(); - virtual bool CanHandle(wxXmlNode *node); -}; - -#endif // wxUSE_XRC && wxUSE_TREECTRL - -#endif // _WX_XH_TREE_H_ diff --git a/wxWidgets/include/wx/xrc/xh_treebk.h b/wxWidgets/include/wx/xrc/xh_treebk.h deleted file mode 100644 index 56de553660..0000000000 --- a/wxWidgets/include/wx/xrc/xh_treebk.h +++ /dev/null @@ -1,83 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/xrc/xh_treebk.h -// Purpose: XML resource handler for wxTreebook -// Author: Evgeniy Tarassov -// Created: 2005/09/28 -// Copyright: (c) 2005 TT-Solutions -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_XH_TREEBK_H_ -#define _WX_XH_TREEBK_H_ - -#include "wx/xrc/xmlres.h" - -#if wxUSE_XRC && wxUSE_TREEBOOK - -class WXDLLIMPEXP_FWD_CORE wxTreebook; -#include "wx/dynarray.h" - -WX_DEFINE_USER_EXPORTED_ARRAY_SIZE_T(size_t, wxArrayTbkPageIndexes, - class WXDLLIMPEXP_XRC); - -// --------------------------------------------------------------------- -// wxTreebookXmlHandler class -// --------------------------------------------------------------------- -// Resource xml structure have to be almost the "same" as for wxNotebook -// except the additional (size_t)depth parameter for treebookpage nodes -// which indicates the depth of the page in the tree. -// There is only one logical constraint on this parameter : -// it cannot be greater than the previous page depth plus one -class WXDLLIMPEXP_XRC wxTreebookXmlHandler : public wxXmlResourceHandler -{ - DECLARE_DYNAMIC_CLASS(wxTreebookXmlHandler) - -public: - wxTreebookXmlHandler(); - virtual wxObject *DoCreateResource(); - virtual bool CanHandle(wxXmlNode *node); - -private: - wxTreebook *m_tbk; - wxArrayTbkPageIndexes m_treeContext; - bool m_isInside; -}; - - -// Example: -// ------- -// Label -// \--First -// | \--Second -// \--Third -// -// -// ... -// -// -// -// -// 0 -// -// -// -// -// 1 -// -// -// -// -// 2 -// -// -// -// -// 1 -// -// -// ... -// - -#endif // wxUSE_XRC && wxUSE_TREEBOOK - -#endif // _WX_XH_TREEBK_H_ diff --git a/wxWidgets/include/wx/xrc/xh_unkwn.h b/wxWidgets/include/wx/xrc/xh_unkwn.h deleted file mode 100644 index de75475334..0000000000 --- a/wxWidgets/include/wx/xrc/xh_unkwn.h +++ /dev/null @@ -1,30 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/xrc/xh_unkwn.h -// Purpose: XML resource handler for unkown widget -// Author: Vaclav Slavik -// Created: 2000/03/05 -// RCS-ID: $Id: xh_unkwn.h 41590 2006-10-03 14:53:40Z VZ $ -// Copyright: (c) 2000 Vaclav Slavik -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_XH_UNKWN_H_ -#define _WX_XH_UNKWN_H_ - -#include "wx/xrc/xmlres.h" - -#if wxUSE_XRC - -class WXDLLIMPEXP_XRC wxUnknownWidgetXmlHandler : public wxXmlResourceHandler -{ - DECLARE_DYNAMIC_CLASS(wxUnknownWidgetXmlHandler) - -public: - wxUnknownWidgetXmlHandler(); - virtual wxObject *DoCreateResource(); - virtual bool CanHandle(wxXmlNode *node); -}; - -#endif // wxUSE_XRC - -#endif // _WX_XH_UNKWN_H_ diff --git a/wxWidgets/include/wx/xrc/xh_wizrd.h b/wxWidgets/include/wx/xrc/xh_wizrd.h deleted file mode 100644 index d753150a81..0000000000 --- a/wxWidgets/include/wx/xrc/xh_wizrd.h +++ /dev/null @@ -1,37 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/xrc/xh_wizrd.h -// Purpose: XML resource handler for wxWizard -// Author: Vaclav Slavik -// Created: 2003/03/02 -// RCS-ID: $Id: xh_wizrd.h 53135 2008-04-12 02:31:04Z VZ $ -// Copyright: (c) 2000 Vaclav Slavik -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_XH_WIZRD_H_ -#define _WX_XH_WIZRD_H_ - -#include "wx/xrc/xmlres.h" - -#if wxUSE_XRC && wxUSE_WIZARDDLG - -class WXDLLIMPEXP_FWD_ADV wxWizard; -class WXDLLIMPEXP_FWD_ADV wxWizardPageSimple; - -class WXDLLIMPEXP_XRC wxWizardXmlHandler : public wxXmlResourceHandler -{ - DECLARE_DYNAMIC_CLASS(wxWizardXmlHandler) - -public: - wxWizardXmlHandler(); - virtual wxObject *DoCreateResource(); - virtual bool CanHandle(wxXmlNode *node); - -private: - wxWizard *m_wizard; - wxWizardPageSimple *m_lastSimplePage; -}; - -#endif // wxUSE_XRC && wxUSE_WIZARDDLG - -#endif // _WX_XH_WIZRD_H_ diff --git a/wxWidgets/include/wx/xrc/xmlres.h b/wxWidgets/include/wx/xrc/xmlres.h deleted file mode 100644 index 4c485bc04e..0000000000 --- a/wxWidgets/include/wx/xrc/xmlres.h +++ /dev/null @@ -1,528 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/xrc/xmlres.h -// Purpose: XML resources -// Author: Vaclav Slavik -// Created: 2000/03/05 -// RCS-ID: $Id: xmlres.h 61872 2009-09-09 22:37:05Z VZ $ -// Copyright: (c) 2000 Vaclav Slavik -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_XMLRES_H_ -#define _WX_XMLRES_H_ - -#include "wx/defs.h" - -#if wxUSE_XRC - -#include "wx/string.h" -#include "wx/dynarray.h" -#include "wx/datetime.h" -#include "wx/list.h" -#include "wx/gdicmn.h" -#include "wx/filesys.h" -#include "wx/bitmap.h" -#include "wx/icon.h" -#include "wx/artprov.h" -#include "wx/colour.h" -#include "wx/animate.h" - -#include "wx/xml/xml.h" - -class WXDLLIMPEXP_FWD_CORE wxMenu; -class WXDLLIMPEXP_FWD_CORE wxMenuBar; -class WXDLLIMPEXP_FWD_CORE wxDialog; -class WXDLLIMPEXP_FWD_CORE wxPanel; -class WXDLLIMPEXP_FWD_CORE wxWindow; -class WXDLLIMPEXP_FWD_CORE wxFrame; -class WXDLLIMPEXP_FWD_CORE wxToolBar; - -class WXDLLIMPEXP_FWD_XRC wxXmlResourceHandler; -class WXDLLIMPEXP_FWD_XRC wxXmlSubclassFactory; -class WXDLLIMPEXP_FWD_XRC wxXmlSubclassFactoriesList; -class wxXmlResourceModule; - - -// These macros indicate current version of XML resources (this information is -// encoded in root node of XRC file as "version" property). -// -// Rules for increasing version number: -// - change it only if you made incompatible change to the format. Addition -// of new attribute to control handler is _not_ incompatible change, because -// older versions of the library may ignore it. -// - if you change version number, follow these steps: -// - set major, minor and release numbers to respective version numbers of -// the wxWidgets library (see wx/version.h) -// - reset revision to 0 unless the first three are same as before, -// in which case you should increase revision by one -#define WX_XMLRES_CURRENT_VERSION_MAJOR 2 -#define WX_XMLRES_CURRENT_VERSION_MINOR 5 -#define WX_XMLRES_CURRENT_VERSION_RELEASE 3 -#define WX_XMLRES_CURRENT_VERSION_REVISION 0 -#define WX_XMLRES_CURRENT_VERSION_STRING wxT("2.5.3.0") - -#define WX_XMLRES_CURRENT_VERSION \ - (WX_XMLRES_CURRENT_VERSION_MAJOR * 256*256*256 + \ - WX_XMLRES_CURRENT_VERSION_MINOR * 256*256 + \ - WX_XMLRES_CURRENT_VERSION_RELEASE * 256 + \ - WX_XMLRES_CURRENT_VERSION_REVISION) - -class WXDLLIMPEXP_XRC wxXmlResourceDataRecord -{ -public: - wxXmlResourceDataRecord() : Doc(NULL) { -#if wxUSE_DATETIME - Time = wxDateTime::Now(); -#endif - } - ~wxXmlResourceDataRecord() {delete Doc;} - - wxString File; - wxXmlDocument *Doc; -#if wxUSE_DATETIME - wxDateTime Time; -#endif -}; - - -WX_DECLARE_USER_EXPORTED_OBJARRAY(wxXmlResourceDataRecord, - wxXmlResourceDataRecords, - WXDLLIMPEXP_XRC); - -enum wxXmlResourceFlags -{ - wxXRC_USE_LOCALE = 1, - wxXRC_NO_SUBCLASSING = 2, - wxXRC_NO_RELOADING = 4 -}; - -// This class holds XML resources from one or more .xml files -// (or derived forms, either binary or zipped -- see manual for -// details). -class WXDLLIMPEXP_XRC wxXmlResource : public wxObject -{ -public: - // Constructor. - // Flags: wxXRC_USE_LOCALE - // translatable strings will be translated via _() - // using the given domain if specified - // wxXRC_NO_SUBCLASSING - // subclass property of object nodes will be ignored - // (useful for previews in XRC editors) - // wxXRC_NO_RELOADING - // don't check the modification time of the XRC files and - // reload them if they have changed on disk - wxXmlResource(int flags = wxXRC_USE_LOCALE, - const wxString& domain=wxEmptyString); - - // Constructor. - // Flags: wxXRC_USE_LOCALE - // translatable strings will be translated via _() - // using the given domain if specified - // wxXRC_NO_SUBCLASSING - // subclass property of object nodes will be ignored - // (useful for previews in XRC editors) - wxXmlResource(const wxString& filemask, int flags = wxXRC_USE_LOCALE, - const wxString& domain=wxEmptyString); - - // Destructor. - virtual ~wxXmlResource(); - - // Loads resources from XML files that match given filemask. - // This method understands VFS (see filesys.h). - bool Load(const wxString& filemask); - - // Unload resource from the given XML file (wildcards not allowed) - bool Unload(const wxString& filename); - - // Initialize handlers for all supported controls/windows. This will - // make the executable quite big because it forces linking against - // most of the wxWidgets library. - void InitAllHandlers(); - - // Initialize only a specific handler (or custom handler). Convention says - // that handler name is equal to the control's name plus 'XmlHandler', for - // example wxTextCtrlXmlHandler, wxHtmlWindowXmlHandler. The XML resource - // compiler (xmlres) can create include file that contains initialization - // code for all controls used within the resource. - void AddHandler(wxXmlResourceHandler *handler); - - // Add a new handler at the begining of the handler list - void InsertHandler(wxXmlResourceHandler *handler); - - // Removes all handlers - void ClearHandlers(); - - // Registers subclasses factory for use in XRC. This function is not meant - // for public use, please see the comment above wxXmlSubclassFactory - // definition. - static void AddSubclassFactory(wxXmlSubclassFactory *factory); - - // Loads menu from resource. Returns NULL on failure. - wxMenu *LoadMenu(const wxString& name); - - // Loads menubar from resource. Returns NULL on failure. - wxMenuBar *LoadMenuBar(wxWindow *parent, const wxString& name); - - // Loads menubar from resource. Returns NULL on failure. - wxMenuBar *LoadMenuBar(const wxString& name) { return LoadMenuBar(NULL, name); } - -#if wxUSE_TOOLBAR - // Loads a toolbar. - wxToolBar *LoadToolBar(wxWindow *parent, const wxString& name); -#endif - - // Loads a dialog. dlg points to parent window (if any). - wxDialog *LoadDialog(wxWindow *parent, const wxString& name); - - // Loads a dialog. dlg points to parent window (if any). This form - // is used to finish creation of already existing instance (main reason - // for this is that you may want to use derived class with new event table) - // Example (typical usage): - // MyDialog dlg; - // wxTheXmlResource->LoadDialog(&dlg, mainFrame, "my_dialog"); - // dlg->ShowModal(); - bool LoadDialog(wxDialog *dlg, wxWindow *parent, const wxString& name); - - // Loads a panel. panel points to parent window (if any). - wxPanel *LoadPanel(wxWindow *parent, const wxString& name); - - // Loads a panel. panel points to parent window (if any). This form - // is used to finish creation of already existing instance. - bool LoadPanel(wxPanel *panel, wxWindow *parent, const wxString& name); - - // Loads a frame. - wxFrame *LoadFrame(wxWindow* parent, const wxString& name); - bool LoadFrame(wxFrame* frame, wxWindow *parent, const wxString& name); - - // Load an object from the resource specifying both the resource name and - // the classname. This lets you load nonstandard container windows. - wxObject *LoadObject(wxWindow *parent, const wxString& name, - const wxString& classname); - - // Load an object from the resource specifying both the resource name and - // the classname. This form lets you finish the creation of an existing - // instance. - bool LoadObject(wxObject *instance, wxWindow *parent, const wxString& name, - const wxString& classname); - - // Loads a bitmap resource from a file. - wxBitmap LoadBitmap(const wxString& name); - - // Loads an icon resource from a file. - wxIcon LoadIcon(const wxString& name); - - // Attaches an unknown control to the given panel/window/dialog. - // Unknown controls are used in conjunction with . - bool AttachUnknownControl(const wxString& name, wxWindow *control, - wxWindow *parent = NULL); - - // Returns a numeric ID that is equivalent to the string ID used in an XML - // resource. If an unknown str_id is requested (i.e. other than wxID_XXX - // or integer), a new record is created which associates the given string - // with a number. If value_if_not_found == wxID_NONE, the number is obtained via - // wxWindow::NewControlId(). Otherwise value_if_not_found is used. - // Macro XRCID(name) is provided for convenient use in event tables. - static int GetXRCID(const wxChar *str_id, int value_if_not_found = wxID_NONE); - - // Returns version information (a.b.c.d = d+ 256*c + 256^2*b + 256^3*a). - long GetVersion() const { return m_version; } - - // Compares resources version to argument. Returns -1 if resources version - // is less than the argument, +1 if greater and 0 if they equal. - int CompareVersion(int major, int minor, int release, int revision) const - { return GetVersion() - - (major*256*256*256 + minor*256*256 + release*256 + revision); } - -//// Singleton accessors. - - // Gets the global resources object or creates one if none exists. - static wxXmlResource *Get(); - - // Sets the global resources object and returns a pointer to the previous one (may be NULL). - static wxXmlResource *Set(wxXmlResource *res); - - // Returns flags, which may be a bitlist of wxXRC_USE_LOCALE and wxXRC_NO_SUBCLASSING. - int GetFlags() const { return m_flags; } - // Set flags after construction. - void SetFlags(int flags) { m_flags = flags; } - - // Get/Set the domain to be passed to the translation functions, defaults to NULL. - wxChar* GetDomain() const { return m_domain; } - void SetDomain(const wxChar* domain); - -protected: - // Scans the resources list for unloaded files and loads them. Also reloads - // files that have been modified since last loading. - bool UpdateResources(); - - // Finds a resource (calls UpdateResources) and returns a node containing it. - wxXmlNode *FindResource(const wxString& name, const wxString& classname, bool recursive = false); - - // Helper function: finds a resource (calls UpdateResources) and returns a node containing it. - wxXmlNode *DoFindResource(wxXmlNode *parent, const wxString& name, const wxString& classname, bool recursive); - - // Creates a resource from information in the given node - // (Uses only 'handlerToUse' if != NULL) - wxObject *CreateResFromNode(wxXmlNode *node, wxObject *parent, - wxObject *instance = NULL, - wxXmlResourceHandler *handlerToUse = NULL); - - // Helper of Load() and Unload(): returns the URL corresponding to the - // given file if it's indeed a file, otherwise returns the original string - // unmodified - static wxString ConvertFileNameToURL(const wxString& filename); - - // loading resources from archives is impossible without wxFileSystem -#if wxUSE_FILESYSTEM - // Another helper: detect if the filename is a ZIP or XRS file - static bool IsArchive(const wxString& filename); -#endif // wxUSE_FILESYSTEM - -private: - long m_version; - - int m_flags; - wxList m_handlers; - wxXmlResourceDataRecords m_data; -#if wxUSE_FILESYSTEM - wxFileSystem m_curFileSystem; - wxFileSystem& GetCurFileSystem() { return m_curFileSystem; } -#endif - - // domain to pass to translation functions, if any. - wxChar* m_domain; - - friend class wxXmlResourceHandler; - friend class wxXmlResourceModule; - - static wxXmlSubclassFactoriesList *ms_subclassFactories; - - // singleton instance: - static wxXmlResource *ms_instance; -}; - - -// This macro translates string identifier (as used in XML resource, -// e.g. ...) to integer id that is needed by -// wxWidgets event tables. -// Example: -// BEGIN_EVENT_TABLE(MyFrame, wxFrame) -// EVT_MENU(XRCID("quit"), MyFrame::OnQuit) -// EVT_MENU(XRCID("about"), MyFrame::OnAbout) -// EVT_MENU(XRCID("new"), MyFrame::OnNew) -// EVT_MENU(XRCID("open"), MyFrame::OnOpen) -// END_EVENT_TABLE() - -#define XRCID(str_id) \ - wxXmlResource::GetXRCID(wxT(str_id)) - - -// This macro returns pointer to particular control in dialog -// created using XML resources. You can use it to set/get values from -// controls. -// Example: -// wxDialog dlg; -// wxXmlResource::Get()->LoadDialog(&dlg, mainFrame, "my_dialog"); -// XRCCTRL(dlg, "my_textctrl", wxTextCtrl)->SetValue(wxT("default value")); - -#define XRCCTRL(window, id, type) \ - (wxStaticCast((window).FindWindow(XRCID(id)), type)) - -// wxXmlResourceHandler is an abstract base class for resource handlers -// capable of creating a control from an XML node. - -class WXDLLIMPEXP_XRC wxXmlResourceHandler : public wxObject -{ -DECLARE_ABSTRACT_CLASS(wxXmlResourceHandler) -public: - // Constructor. - wxXmlResourceHandler(); - - // Destructor. - virtual ~wxXmlResourceHandler() {} - - // Creates an object (menu, dialog, control, ...) from an XML node. - // Should check for validity. - // parent is a higher-level object (usually window, dialog or panel) - // that is often necessary to create the resource. - // If instance is non-NULL it should not create a new instance via 'new' but - // should rather use this one, and call its Create method. - wxObject *CreateResource(wxXmlNode *node, wxObject *parent, - wxObject *instance); - - // This one is called from CreateResource after variables - // were filled. - virtual wxObject *DoCreateResource() = 0; - - // Returns true if it understands this node and can create - // a resource from it, false otherwise. - virtual bool CanHandle(wxXmlNode *node) = 0; - - // Sets the parent resource. - void SetParentResource(wxXmlResource *res) { m_resource = res; } - -protected: - wxXmlResource *m_resource; - wxArrayString m_styleNames; - wxArrayInt m_styleValues; - - // Variables (filled by CreateResource) - wxXmlNode *m_node; - wxString m_class; - wxObject *m_parent, *m_instance; - wxWindow *m_parentAsWindow; - - // --- Handy methods: - - // Returns true if the node has a property class equal to classname, - // e.g. . - bool IsOfClass(wxXmlNode *node, const wxString& classname); - - // Gets node content from wxXML_ENTITY_NODE - // The problem is, content is represented as - // wxXML_ENTITY_NODE name="tag", content="" - // |-- wxXML_TEXT_NODE or - // wxXML_CDATA_SECTION_NODE name="" content="content" - wxString GetNodeContent(wxXmlNode *node); - - // Check to see if a parameter exists. - bool HasParam(const wxString& param); - - // Finds the node or returns NULL. - wxXmlNode *GetParamNode(const wxString& param); - - // Finds the parameter value or returns the empty string. - wxString GetParamValue(const wxString& param); - - // Add a style flag (e.g. wxMB_DOCKABLE) to the list of flags - // understood by this handler. - void AddStyle(const wxString& name, int value); - - // Add styles common to all wxWindow-derived classes. - void AddWindowStyles(); - - // Gets style flags from text in form "flag | flag2| flag3 |..." - // Only understands flags added with AddStyle - int GetStyle(const wxString& param = wxT("style"), int defaults = 0); - - // Gets text from param and does some conversions: - // - replaces \n, \r, \t by respective chars (according to C syntax) - // - replaces _ by & and __ by _ (needed for _File => &File because of XML) - // - calls wxGetTranslations (unless disabled in wxXmlResource) - wxString GetText(const wxString& param, bool translate = true); - - // Returns the XRCID. - int GetID(); - - // Returns the resource name. - wxString GetName(); - - // Gets a bool flag (1, t, yes, on, true are true, everything else is false). - bool GetBool(const wxString& param, bool defaultv = false); - - // Gets an integer value from the parameter. - long GetLong(const wxString& param, long defaultv = 0); - - // Gets a float value from the parameter. - float GetFloat(const wxString& param, float defaultv = 0); - - // Gets colour in HTML syntax (#RRGGBB). - wxColour GetColour(const wxString& param, const wxColour& defaultv = wxNullColour); - - // Gets the size (may be in dialog units). - wxSize GetSize(const wxString& param = wxT("size"), - wxWindow *windowToUse = NULL); - - // Gets the position (may be in dialog units). - wxPoint GetPosition(const wxString& param = wxT("pos")); - - // Gets a dimension (may be in dialog units). - wxCoord GetDimension(const wxString& param, wxCoord defaultv = 0, - wxWindow *windowToUse = NULL); - - // Gets a bitmap. - wxBitmap GetBitmap(const wxString& param = wxT("bitmap"), - const wxArtClient& defaultArtClient = wxART_OTHER, - wxSize size = wxDefaultSize); - - // Gets an icon. - wxIcon GetIcon(const wxString& param = wxT("icon"), - const wxArtClient& defaultArtClient = wxART_OTHER, - wxSize size = wxDefaultSize); - -#if wxUSE_ANIMATIONCTRL - // Gets an animation. - wxAnimation GetAnimation(const wxString& param = wxT("animation")); -#endif - - // Gets a font. - wxFont GetFont(const wxString& param = wxT("font")); - - // Sets common window options. - void SetupWindow(wxWindow *wnd); - - // Creates children. - void CreateChildren(wxObject *parent, bool this_hnd_only = false); - - // Helper function. - void CreateChildrenPrivately(wxObject *parent, wxXmlNode *rootnode = NULL); - - // Creates a resource from a node. - wxObject *CreateResFromNode(wxXmlNode *node, - wxObject *parent, wxObject *instance = NULL) - { return m_resource->CreateResFromNode(node, parent, instance); } - - // helper -#if wxUSE_FILESYSTEM - wxFileSystem& GetCurFileSystem() { return m_resource->GetCurFileSystem(); } -#endif -}; - - -// Programmer-friendly macros for writing XRC handlers: - -#define XRC_ADD_STYLE(style) AddStyle(wxT(#style), style) - -#define XRC_MAKE_INSTANCE(variable, classname) \ - classname *variable = NULL; \ - if (m_instance) \ - variable = wxStaticCast(m_instance, classname); \ - if (!variable) \ - variable = new classname; - - -// FIXME -- remove this $%^#$%#$@# as soon as Ron checks his changes in!! -WXDLLIMPEXP_XRC void wxXmlInitResourceModule(); - - -// This class is used to create instances of XRC "object" nodes with "subclass" -// property. It is _not_ supposed to be used by XRC users, you should instead -// register your subclasses via wxWidgets' RTTI mechanism. This class is useful -// only for language bindings developer who need a way to implement subclassing -// in wxWidgets ports that don't support wxRTTI (e.g. wxPython). -class WXDLLIMPEXP_XRC wxXmlSubclassFactory -{ -public: - // Try to create instance of given class and return it, return NULL on - // failure: - virtual wxObject *Create(const wxString& className) = 0; - virtual ~wxXmlSubclassFactory() {} -}; - - -/* ------------------------------------------------------------------------- - Backward compatibility macros. Do *NOT* use, they may disappear in future - versions of the XRC library! - ------------------------------------------------------------------------- */ -#if WXWIN_COMPATIBILITY_2_4 - #define ADD_STYLE XRC_ADD_STYLE - #define wxTheXmlResource wxXmlResource::Get() - #define XMLID XRCID - #define XMLCTRL XRCCTRL - #define GetXMLID GetXRCID -#endif - -#endif // wxUSE_XRC - -#endif // _WX_XMLRES_H_ diff --git a/wxWidgets/include/wx/xti.h b/wxWidgets/include/wx/xti.h deleted file mode 100644 index b35d093ee3..0000000000 --- a/wxWidgets/include/wx/xti.h +++ /dev/null @@ -1,2102 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/xti.h -// Purpose: runtime metadata information (extended class info) -// Author: Stefan Csomor -// Modified by: -// Created: 27/07/03 -// RCS-ID: $Id: xti.h 52488 2008-03-14 14:13:05Z JS $ -// Copyright: (c) 1997 Julian Smart -// (c) 2003 Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_XTIH__ -#define _WX_XTIH__ - -// We want to support properties, event sources and events sinks through -// explicit declarations, using templates and specialization to make the -// effort as painless as possible. -// -// This means we have the following domains : -// -// - Type Information for categorizing built in types as well as custom types -// this includes information about enums, their values and names -// - Type safe value storage : a kind of wxVariant, called right now wxxVariant -// which will be merged with wxVariant -// - Property Information and Property Accessors providing access to a class' -// values and exposed event delegates -// - Information about event handlers -// - extended Class Information for accessing all these - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -#include "wx/defs.h" -#include "wx/memory.h" -#include "wx/flags.h" -#include "wx/string.h" -#include "wx/arrstr.h" -#include "wx/hashmap.h" -#include "wx/log.h" -#include "wx/intl.h" - -#include - -// we will move this later to defs.h - -#if defined(__GNUC__) && !wxCHECK_GCC_VERSION( 3 , 4 ) -# define wxUSE_MEMBER_TEMPLATES 0 -#endif - -#if defined(_MSC_VER) && _MSC_VER <= 1200 -# define wxUSE_MEMBER_TEMPLATES 0 -# define wxUSE_FUNC_TEMPLATE_POINTER 0 -#endif - -#ifndef wxUSE_MEMBER_TEMPLATES -# define wxUSE_MEMBER_TEMPLATES 1 -#endif - -#ifndef wxUSE_FUNC_TEMPLATE_POINTER -# define wxUSE_FUNC_TEMPLATE_POINTER 1 -#endif - -#if wxUSE_MEMBER_TEMPLATES -# define wxTEMPLATED_MEMBER_CALL( method , type ) method() -# define wxTEMPLATED_MEMBER_FIX( type ) -#else -# define wxTEMPLATED_MEMBER_CALL( method , type ) method((type*)NULL) -# define wxTEMPLATED_MEMBER_FIX( type ) type* =NULL -#endif - -#if defined(_MSC_VER) && _MSC_VER <= 1200 -# define wxTEMPLATED_FUNCTION_FIX( type ) , wxTEMPLATED_MEMBER_FIX(type) -# define wxINFUNC_CLASS_TYPE_FIX( type ) typedef type type; -#else -# define wxTEMPLATED_FUNCTION_FIX( type ) -# define wxINFUNC_CLASS_TYPE_FIX( type ) -#endif - -#define EMPTY_MACROVALUE /**/ - -class WXDLLIMPEXP_BASE wxObject; -class WXDLLIMPEXP_BASE wxClassInfo; -class WXDLLIMPEXP_BASE wxDynamicClassInfo; -class WXDLLIMPEXP_BASE wxHashTable; -class WXDLLIMPEXP_BASE wxObjectRefData; -class WXDLLIMPEXP_BASE wxEvent; -class WXDLLIMPEXP_BASE wxEvtHandler; - -typedef void (wxObject::*wxObjectEventFunction)(wxEvent&); - -#if wxUSE_FUNC_TEMPLATE_POINTER -# define wxTO_STRING(type) wxToStringConverter -# define wxTO_STRING_IMP(type) -# define wxFROM_STRING(type) wxFromStringConverter -# define wxFROM_STRING_IMP(type) -#else -# define wxTO_STRING(type) ToString##type -# define wxTO_STRING_IMP(type) inline void ToString##type( const wxxVariant& data , wxString &result ) { wxToStringConverter(data, result); } -# define wxFROM_STRING(type) FromString##type -# define wxFROM_STRING_IMP(type) inline void FromString##type( const wxString& data , wxxVariant &result ) { wxFromStringConverter(data, result); } -#endif - -// ---------------------------------------------------------------------------- -// Enum Support -// -// In the header files there would no change from pure c++ code, in the -// implementation, an enum would have -// to be enumerated eg : -// -// wxBEGIN_ENUM( wxFlavor ) -// wxENUM_MEMBER( Vanilla ) -// wxENUM_MEMBER( Chocolate ) -// wxENUM_MEMBER( Strawberry ) -// wxEND_ENUM( wxFlavor ) -// ---------------------------------------------------------------------------- - -struct WXDLLIMPEXP_BASE wxEnumMemberData -{ - const wxChar* m_name; - int m_value; -}; - -class WXDLLIMPEXP_BASE wxEnumData -{ -public : - wxEnumData( wxEnumMemberData* data ) ; - - // returns true if the member has been found and sets the int value - // pointed to accordingly (if ptr != null ) - // if not found returns false, value left unchanged - bool HasEnumMemberValue( const wxChar *name , int *value = NULL ) const ; - - // returns the value of the member, if not found in debug mode an - // assert is issued, in release 0 is returned - int GetEnumMemberValue(const wxChar *name ) const ; - - // returns the name of the enum member having the passed in value - // returns an emtpy string if not found - const wxChar *GetEnumMemberName(int value) const ; - - // returns the number of members in this enum - int GetEnumCount() const { return m_count ; } - - // returns the value of the nth member - int GetEnumMemberValueByIndex( int n ) const ; - - // returns the value of the nth member - const wxChar *GetEnumMemberNameByIndex( int n ) const ; -private : - wxEnumMemberData *m_members; - int m_count ; -}; - -#define wxBEGIN_ENUM( e ) \ - wxEnumMemberData s_enumDataMembers##e[] = { - -#define wxENUM_MEMBER( v ) { wxT(#v), v } , - -#define wxEND_ENUM( e ) { NULL , 0 } } ; \ - wxEnumData s_enumData##e( s_enumDataMembers##e ) ; \ - wxEnumData *wxGetEnumData(e) { return &s_enumData##e ; } \ - template<> void wxStringReadValue(const wxString& s , e &data ) \ -{ \ - data = (e) s_enumData##e.GetEnumMemberValue(s) ; \ -} \ - template<> void wxStringWriteValue(wxString &s , const e &data ) \ -{ \ - s = s_enumData##e.GetEnumMemberName((int)data) ; \ -} \ - void FromLong##e( long data , wxxVariant& result ) { result = wxxVariant((e)data) ;} \ - void ToLong##e( const wxxVariant& data , long &result ) { result = (long) data.wxTEMPLATED_MEMBER_CALL(Get , e) ;} \ - wxTO_STRING_IMP( e ) \ - wxFROM_STRING_IMP( e ) \ - wxEnumTypeInfo s_typeInfo##e(wxT_ENUM , &s_enumData##e , &wxTO_STRING( e ) , &wxFROM_STRING( e ) , &ToLong##e , &FromLong##e , typeid(e).name() ) ; - -// ---------------------------------------------------------------------------- -// Set Support -// -// in the header : -// -// enum wxFlavor -// { -// Vanilla, -// Chocolate, -// Strawberry, -// }; -// -// typedef wxBitset wxCoupe ; -// -// in the implementation file : -// -// wxBEGIN_ENUM( wxFlavor ) -// wxENUM_MEMBER( Vanilla ) -// wxENUM_MEMBER( Chocolate ) -// wxENUM_MEMBER( Strawberry ) -// wxEND_ENUM( wxFlavor ) -// -// wxIMPLEMENT_SET_STREAMING( wxCoupe , wxFlavor ) -// -// implementation note : no partial specialization for streaming, but a delegation to a -// different class -// -// ---------------------------------------------------------------------------- - -// in order to remove dependancy on string tokenizer -void WXDLLIMPEXP_BASE wxSetStringToArray( const wxString &s , wxArrayString &array ) ; - -template -void wxSetFromString(const wxString &s , wxBitset &data ) -{ - wxEnumData* edata = wxGetEnumData((e) 0) ; - data.reset() ; - - wxArrayString array ; - wxSetStringToArray( s , array ) ; - wxString flag; - for ( int i = 0 ; i < array.Count() ; ++i ) - { - flag = array[i] ; - int ivalue ; - if ( edata->HasEnumMemberValue( flag , &ivalue ) ) - { - data.set( (e) ivalue ) ; - } - } -} - -template -void wxSetToString( wxString &s , const wxBitset &data ) -{ - wxEnumData* edata = wxGetEnumData((e) 0) ; - int count = edata->GetEnumCount() ; - int i ; - s.Clear() ; - for ( i = 0 ; i < count ; i++ ) - { - e value = (e) edata->GetEnumMemberValueByIndex(i) ; - if ( data.test( value ) ) - { - // this could also be done by the templated calls - if ( !s.empty() ) - s +=wxT("|") ; - s += edata->GetEnumMemberNameByIndex(i) ; - } - } -} - -#define wxIMPLEMENT_SET_STREAMING(SetName,e) \ - template<> void wxStringReadValue(const wxString &s , wxBitset &data ) \ -{ \ - wxSetFromString( s , data ) ; \ -} \ - template<> void wxStringWriteValue( wxString &s , const wxBitset &data ) \ -{ \ - wxSetToString( s , data ) ; \ -} \ - void FromLong##SetName( long data , wxxVariant& result ) { result = wxxVariant(SetName((unsigned long)data)) ;} \ - void ToLong##SetName( const wxxVariant& data , long &result ) { result = (long) data.wxTEMPLATED_MEMBER_CALL(Get , SetName).to_ulong() ;} \ - wxTO_STRING_IMP( SetName ) \ - wxFROM_STRING_IMP( SetName ) \ - wxEnumTypeInfo s_typeInfo##SetName(wxT_SET , &s_enumData##e , &wxTO_STRING( SetName ) , &wxFROM_STRING( SetName ) , &ToLong##SetName , &FromLong##SetName, typeid(SetName).name() ) ; \ -} - -template -void wxFlagsFromString(const wxString &s , e &data ) -{ - wxEnumData* edata = wxGetEnumData((e*) 0) ; - data.m_data = 0 ; - - wxArrayString array ; - wxSetStringToArray( s , array ) ; - wxString flag; - for ( size_t i = 0 ; i < array.Count() ; ++i ) - { - flag = array[i] ; - int ivalue ; - if ( edata->HasEnumMemberValue( flag , &ivalue ) ) - { - data.m_data |= ivalue ; - } - } -} - -template -void wxFlagsToString( wxString &s , const e& data ) -{ - wxEnumData* edata = wxGetEnumData((e*) 0) ; - int count = edata->GetEnumCount() ; - int i ; - s.Clear() ; - long dataValue = data.m_data ; - for ( i = 0 ; i < count ; i++ ) - { - int value = edata->GetEnumMemberValueByIndex(i) ; - // make this to allow for multi-bit constants to work - if ( value && ( dataValue & value ) == value ) - { - // clear the flags we just set - dataValue &= ~value ; - // this could also be done by the templated calls - if ( !s.empty() ) - s +=wxT("|") ; - s += edata->GetEnumMemberNameByIndex(i) ; - } - } -} - -#define wxBEGIN_FLAGS( e ) \ - wxEnumMemberData s_enumDataMembers##e[] = { - -#define wxFLAGS_MEMBER( v ) { wxT(#v), v } , - -#define wxEND_FLAGS( e ) { NULL , 0 } } ; \ - wxEnumData s_enumData##e( s_enumDataMembers##e ) ; \ - wxEnumData *wxGetEnumData(e*) { return &s_enumData##e ; } \ - template<> void wxStringReadValue(const wxString &s , e &data ) \ -{ \ - wxFlagsFromString( s , data ) ; \ -} \ - template<> void wxStringWriteValue( wxString &s , const e& data ) \ -{ \ - wxFlagsToString( s , data ) ; \ -} \ - void FromLong##e( long data , wxxVariant& result ) { result = wxxVariant(e(data)) ;} \ - void ToLong##e( const wxxVariant& data , long &result ) { result = (long) data.wxTEMPLATED_MEMBER_CALL(Get , e).m_data ;} \ - wxTO_STRING_IMP( e ) \ - wxFROM_STRING_IMP( e ) \ - wxEnumTypeInfo s_typeInfo##e(wxT_SET , &s_enumData##e , &wxTO_STRING( e ) , &wxFROM_STRING( e ) , &ToLong##e , &FromLong##e, typeid(e).name() ) ; -// ---------------------------------------------------------------------------- -// Type Information -// ---------------------------------------------------------------------------- -// -// -// All data exposed by the RTTI is characterized using the following classes. -// The first characterization is done by wxTypeKind. All enums up to and including -// wxT_CUSTOM represent so called simple types. These cannot be divided any further. -// They can be converted to and from wxStrings, that's all. - - -enum wxTypeKind -{ - wxT_VOID = 0, // unknown type - wxT_BOOL, - wxT_CHAR, - wxT_UCHAR, - wxT_INT, - wxT_UINT, - wxT_LONG, - wxT_ULONG, - wxT_FLOAT, - wxT_DOUBLE, - wxT_STRING, // must be wxString - wxT_SET, // must be wxBitset<> template - wxT_ENUM, - wxT_CUSTOM, // user defined type (e.g. wxPoint) - - wxT_LAST_SIMPLE_TYPE_KIND = wxT_CUSTOM , - - wxT_OBJECT_PTR, // object reference - wxT_OBJECT , // embedded object - wxT_COLLECTION , // collection - - wxT_DELEGATE , // for connecting against an event source - - wxT_LAST_TYPE_KIND = wxT_DELEGATE // sentinel for bad data, asserts, debugging -}; - -class WXDLLIMPEXP_BASE wxxVariant ; -class WXDLLIMPEXP_BASE wxTypeInfo ; - -WX_DECLARE_STRING_HASH_MAP_WITH_DECL( wxTypeInfo* , wxTypeInfoMap , class WXDLLIMPEXP_BASE ) ; - -class WXDLLIMPEXP_BASE wxTypeInfo -{ -public : - typedef void (*converterToString_t)( const wxxVariant& data , wxString &result ) ; - typedef void (*converterFromString_t)( const wxString& data , wxxVariant &result ) ; - - wxTypeInfo(wxTypeKind kind, - converterToString_t to = NULL, converterFromString_t from = NULL, - const wxString &name = wxEmptyString): - m_toString(to), m_fromString(from), m_kind(kind), m_name(name) - { - Register(); - } -#if wxUSE_UNICODE - wxTypeInfo(wxTypeKind kind, - converterToString_t to, converterFromString_t from, - const char *name): - m_toString(to), m_fromString(from), m_kind(kind), m_name(wxString::FromAscii(name)) - { - Register(); - } -#endif - - virtual ~wxTypeInfo() - { - Unregister() ; - } - - // return the kind of this type (wxT_... constants) - wxTypeKind GetKind() const { return m_kind ; } - - // returns the unique name of this type - const wxString& GetTypeName() const { return m_name ; } - - // is this type a delegate type - bool IsDelegateType() const { return m_kind == wxT_DELEGATE ; } - - // is this type a custom type - bool IsCustomType() const { return m_kind == wxT_CUSTOM ; } - - // is this type an object type - bool IsObjectType() const { return m_kind == wxT_OBJECT || m_kind == wxT_OBJECT_PTR ; } - - // can the content of this type be converted to and from strings ? - bool HasStringConverters() const { return m_toString != NULL && m_fromString != NULL ; } - - // convert a wxxVariant holding data of this type into a string - void ConvertToString( const wxxVariant& data , wxString &result ) const - - { if ( m_toString ) (*m_toString)( data , result ) ; else wxLogError( _("String conversions not supported") ) ; } - - // convert a string into a wxxVariant holding the corresponding data in this type - void ConvertFromString( const wxString& data , wxxVariant &result ) const - { if( m_fromString ) (*m_fromString)( data , result ) ; else wxLogError( _("String conversions not supported") ) ; } - -#if wxUSE_UNICODE - static wxTypeInfo *FindType(const char *typeName) { return FindType( wxString::FromAscii(typeName) ) ; } -#endif - static wxTypeInfo *FindType(const wxChar *typeName); - -private : - - void Register(); - void Unregister(); - - converterToString_t m_toString ; - converterFromString_t m_fromString ; - - static wxTypeInfoMap* ms_typeTable ; - - wxTypeKind m_kind; - wxString m_name; -}; - -class WXDLLIMPEXP_BASE wxBuiltInTypeInfo : public wxTypeInfo -{ -public : - wxBuiltInTypeInfo( wxTypeKind kind , converterToString_t to = NULL , converterFromString_t from = NULL , const wxString &name = wxEmptyString ) : - wxTypeInfo( kind , to , from , name ) - { wxASSERT_MSG( GetKind() < wxT_SET , wxT("Illegal Kind for Base Type") ) ; } -#if wxUSE_UNICODE - wxBuiltInTypeInfo( wxTypeKind kind , converterToString_t to , converterFromString_t from , const char *name ) : - wxTypeInfo( kind , to , from , name ) - { wxASSERT_MSG( GetKind() < wxT_SET , wxT("Illegal Kind for Base Type") ) ; } -#endif -} ; - -class WXDLLIMPEXP_BASE wxCustomTypeInfo : public wxTypeInfo -{ -public : - wxCustomTypeInfo( const wxString &name , converterToString_t to , converterFromString_t from ) : - wxTypeInfo( wxT_CUSTOM , to , from , name ) - {} -#if wxUSE_UNICODE - wxCustomTypeInfo( const char *name , converterToString_t to , converterFromString_t from ) : - wxTypeInfo( wxT_CUSTOM , to , from , name ) - {} -#endif -} ; - -class WXDLLIMPEXP_BASE wxEnumTypeInfo : public wxTypeInfo -{ -public : - typedef void (*converterToLong_t)( const wxxVariant& data , long &result ) ; - typedef void (*converterFromLong_t)( long data , wxxVariant &result ) ; - - wxEnumTypeInfo( wxTypeKind kind , wxEnumData* enumInfo , converterToString_t to , converterFromString_t from , - converterToLong_t toLong , converterFromLong_t fromLong , const wxString &name ) : - wxTypeInfo( kind , to , from , name ) , m_toLong( toLong ) , m_fromLong( fromLong ) - { wxASSERT_MSG( kind == wxT_ENUM || kind == wxT_SET , wxT("Illegal Kind for Enum Type")) ; m_enumInfo = enumInfo ;} - -#if wxUSE_UNICODE - wxEnumTypeInfo( wxTypeKind kind , wxEnumData* enumInfo , converterToString_t to , converterFromString_t from , - converterToLong_t toLong , converterFromLong_t fromLong , const char * name ) : - wxTypeInfo( kind , to , from , name ) , m_toLong( toLong ) , m_fromLong( fromLong ) - { wxASSERT_MSG( kind == wxT_ENUM || kind == wxT_SET , wxT("Illegal Kind for Enum Type")) ; m_enumInfo = enumInfo ;} -#endif - const wxEnumData* GetEnumData() const { return m_enumInfo ; } - - // convert a wxxVariant holding data of this type into a long - void ConvertToLong( const wxxVariant& data , long &result ) const - - { if( m_toLong ) (*m_toLong)( data , result ) ; else wxLogError( _("Long Conversions not supported") ) ; } - - // convert a long into a wxxVariant holding the corresponding data in this type - void ConvertFromLong( long data , wxxVariant &result ) const - { if( m_fromLong ) (*m_fromLong)( data , result ) ; else wxLogError( _("Long Conversions not supported") ) ;} - -private : - converterToLong_t m_toLong ; - converterFromLong_t m_fromLong ; - - wxEnumData *m_enumInfo; // Kind == wxT_ENUM or Kind == wxT_SET -} ; - -class WXDLLIMPEXP_BASE wxClassTypeInfo : public wxTypeInfo -{ -public : - wxClassTypeInfo( wxTypeKind kind , wxClassInfo* classInfo , converterToString_t to = NULL , converterFromString_t from = NULL , const wxString &name = wxEmptyString) ; -#if wxUSE_UNICODE - wxClassTypeInfo( wxTypeKind kind , wxClassInfo* classInfo , converterToString_t to , converterFromString_t from , const char *name ) ; -#endif - const wxClassInfo *GetClassInfo() const { return m_classInfo ; } -private : - wxClassInfo *m_classInfo; // Kind == wxT_OBJECT - could be NULL -} ; - -class WXDLLIMPEXP_BASE wxCollectionTypeInfo : public wxTypeInfo -{ -public : - wxCollectionTypeInfo( const wxString &elementName , converterToString_t to , converterFromString_t from , const wxString &name) : - wxTypeInfo( wxT_COLLECTION , to , from , name ) - { m_elementTypeName = elementName ; m_elementType = NULL ;} -#if wxUSE_UNICODE - wxCollectionTypeInfo( const char *elementName , converterToString_t to , converterFromString_t from , const char *name ) : - wxTypeInfo( wxT_COLLECTION , to , from , name ) - { m_elementTypeName = wxString::FromAscii( elementName ) ; m_elementType = NULL ;} -#endif - const wxTypeInfo* GetElementType() const - { - if ( m_elementType == NULL ) - m_elementType = wxTypeInfo::FindType( m_elementTypeName ) ; - return m_elementType ; } -private : - mutable wxTypeInfo * m_elementType ; - wxString m_elementTypeName ; -} ; - -// a delegate is an exposed event source - -class WXDLLIMPEXP_BASE wxDelegateTypeInfo : public wxTypeInfo -{ -public : - wxDelegateTypeInfo( int eventType , wxClassInfo* eventClass , converterToString_t to = NULL , converterFromString_t from = NULL ) ; - wxDelegateTypeInfo( int eventType , int lastEventType, wxClassInfo* eventClass , converterToString_t to = NULL , converterFromString_t from = NULL ) ; - int GetEventType() const { return m_eventType ; } - int GetLastEventType() const { return m_lastEventType ; } - const wxClassInfo* GetEventClass() const { return m_eventClass ; } -private : - const wxClassInfo *m_eventClass; // (extended will merge into classinfo) - int m_eventType ; - int m_lastEventType ; -} ; - -template const wxTypeInfo* wxGetTypeInfo( T * ) { return wxTypeInfo::FindType(typeid(T).name()) ; } - -// this macro is for usage with custom, non-object derived classes and structs, wxPoint is such a custom type - -#if wxUSE_FUNC_TEMPLATE_POINTER -#define wxCUSTOM_TYPE_INFO( e , toString , fromString ) \ - wxCustomTypeInfo s_typeInfo##e(typeid(e).name() , &toString , &fromString) ; -#else -#define wxCUSTOM_TYPE_INFO( e , toString , fromString ) \ - void ToString##e( const wxxVariant& data , wxString &result ) { toString(data, result); } \ - void FromString##e( const wxString& data , wxxVariant &result ) { fromString(data, result); } \ - wxCustomTypeInfo s_typeInfo##e(typeid(e).name() , &ToString##e , &FromString##e) ; -#endif - -#define wxCOLLECTION_TYPE_INFO( element , collection ) \ - wxCollectionTypeInfo s_typeInfo##collection( typeid(element).name() , NULL , NULL , typeid(collection).name() ) ; - -// sometimes a compiler invents specializations that are nowhere called, use this macro to satisfy the refs, currently -// we don't have to play tricks, but if we will have to according to the compiler, we will use that macro for that - -#define wxILLEGAL_TYPE_SPECIALIZATION( a ) - -// ---------------------------------------------------------------------------- -// wxxVariant as typesafe data holder -// ---------------------------------------------------------------------------- - -class WXDLLIMPEXP_BASE wxxVariantData -{ -public: - virtual ~wxxVariantData() {} - - // return a heap allocated duplicate - virtual wxxVariantData* Clone() const = 0 ; - - // returns the type info of the contentc - virtual const wxTypeInfo* GetTypeInfo() const = 0 ; -} ; - -template class wxxVariantDataT : public wxxVariantData -{ -public: - wxxVariantDataT(const T& d) : m_data(d) {} - virtual ~wxxVariantDataT() {} - - // get a ref to the stored data - T & Get() { return m_data; } - - // get a const ref to the stored data - const T & Get() const { return m_data; } - - // set the data - void Set(const T& d) { m_data = d; } - - // return a heap allocated duplicate - virtual wxxVariantData* Clone() const { return new wxxVariantDataT( Get() ) ; } - - // returns the type info of the contentc - virtual const wxTypeInfo* GetTypeInfo() const { return wxGetTypeInfo( (T*) NULL ) ; } - -private: - T m_data; -}; - -class WXDLLIMPEXP_BASE wxxVariant -{ -public : - wxxVariant() { m_data = NULL ; } - wxxVariant( wxxVariantData* data , const wxString& name = wxEmptyString ) : m_data(data) , m_name(name) {} - wxxVariant( const wxxVariant &d ) { if ( d.m_data ) m_data = d.m_data->Clone() ; else m_data = NULL ; m_name = d.m_name ; } - - template wxxVariant( const T& data , const wxString& name = wxEmptyString ) : - m_data(new wxxVariantDataT(data) ), m_name(name) {} - - ~wxxVariant() { delete m_data ; } - - // get a ref to the stored data - template T& Get(wxTEMPLATED_MEMBER_FIX(T)) - { - wxxVariantDataT *dataptr = dynamic_cast*> (m_data) ; - wxASSERT_MSG( dataptr , wxString::Format(wxT("Cast to %s not possible"), typeid(T).name()) ) ; - return dataptr->Get() ; - } - - // get a ref to the stored data - template const T& Get(wxTEMPLATED_MEMBER_FIX(T)) const - { - const wxxVariantDataT *dataptr = dynamic_cast*> (m_data) ; - wxASSERT_MSG( dataptr , wxString::Format(wxT("Cast to %s not possible"), typeid(T).name()) ) ; - return dataptr->Get() ; - } - - bool IsEmpty() const { return m_data == NULL ; } - - template bool HasData(wxTEMPLATED_MEMBER_FIX(T)) const - { - const wxxVariantDataT *dataptr = dynamic_cast*> (m_data) ; - return dataptr != NULL ; - } - - // stores the data - template void Set(const T& data) const - { - delete m_data ; - m_data = new wxxVariantDataT(data) ; - } - - wxxVariant& operator=(const wxxVariant &d) - { - delete m_data; - m_data = d.m_data ? d.m_data->Clone() : NULL ; - m_name = d.m_name ; - return *this ; - } - - // gets the stored data casted to a wxObject* , returning NULL if cast is not possible - wxObject* GetAsObject() ; - - // get the typeinfo of the stored object - const wxTypeInfo* GetTypeInfo() const { return m_data->GetTypeInfo() ; } - - // returns this value as string - wxString GetAsString() const - { - wxString s ; - GetTypeInfo()->ConvertToString( *this , s ) ; - return s ; - } - const wxString& GetName() const { return m_name ; } -private : - wxxVariantData* m_data ; - wxString m_name ; -} ; - -#include "wx/dynarray.h" - -WX_DECLARE_OBJARRAY_WITH_DECL(wxxVariant, wxxVariantArray, class WXDLLIMPEXP_BASE); - -// templated streaming, every type must have their specialization for these methods - -template -void wxStringReadValue( const wxString &s , T &data ); - -template -void wxStringWriteValue( wxString &s , const T &data); - -template -void wxToStringConverter( const wxxVariant &v, wxString &s wxTEMPLATED_FUNCTION_FIX(T)) { wxStringWriteValue( s , v.wxTEMPLATED_MEMBER_CALL(Get , T) ) ; } - -template -void wxFromStringConverter( const wxString &s, wxxVariant &v wxTEMPLATED_FUNCTION_FIX(T)) { T d ; wxStringReadValue( s , d ) ; v = wxxVariant(d) ; } - -// ---------------------------------------------------------------------------- -// Property Support -// -// wxPropertyInfo is used to inquire of the property by name. It doesn't -// provide access to the property, only information about it. If you -// want access, look at wxPropertyAccessor. -// ---------------------------------------------------------------------------- - -class WXDLLIMPEXP_BASE wxSetter -{ -public: - wxSetter( const wxString name ) { m_name = name ; } - virtual ~wxSetter() {} - virtual void Set( wxObject *object, const wxxVariant &variantValue ) const = 0; - const wxString& GetName() const { return m_name ; } -private: - wxString m_name; -}; - -class WXDLLIMPEXP_BASE wxGetter -{ -public: - wxGetter( const wxString name ) { m_name = name ; } - virtual ~wxGetter() {} - virtual void Get( const wxObject *object , wxxVariant& result) const = 0; - const wxString& GetName() const { return m_name ; } -private: - wxString m_name; -}; - -class WXDLLIMPEXP_BASE wxCollectionGetter -{ -public : - wxCollectionGetter( const wxString name ) { m_name = name ; } - virtual ~wxCollectionGetter() {} - virtual void Get( const wxObject *object , wxxVariantArray& result) const = 0; - const wxString& GetName() const { return m_name ; } -private : - wxString m_name ; -} ; - -template void WXDLLIMPEXP_BASE wxCollectionToVariantArray( const coll_t& coll , wxxVariantArray& result ) ; - -class WXDLLIMPEXP_BASE wxAdder -{ -public : - wxAdder( const wxString name ) { m_name = name ; } - virtual ~wxAdder() {} - virtual void Add( wxObject *object, const wxxVariant &variantValue ) const= 0; - const wxString& GetName() const { return m_name ; } -private : - wxString m_name ; -} ; - - -#define wxSETTER( property, Klass, valueType, setterMethod ) \ -class wxSetter##property : public wxSetter \ -{ \ -public: \ - wxINFUNC_CLASS_TYPE_FIX(Klass) \ - wxSetter##property() : wxSetter( wxT(#setterMethod) ) {} \ - virtual ~wxSetter##property() {} \ - void Set( wxObject *object, const wxxVariant &variantValue ) const \ -{ \ - Klass *obj = dynamic_cast(object) ; \ - if ( variantValue.wxTEMPLATED_MEMBER_CALL(HasData, valueType) ) \ - obj->setterMethod(variantValue.wxTEMPLATED_MEMBER_CALL(Get , valueType)) ; \ - else \ - obj->setterMethod(*variantValue.wxTEMPLATED_MEMBER_CALL(Get , valueType*)) ; \ -} \ -} ; - -#define wxGETTER( property, Klass, valueType , gettermethod ) \ -class wxGetter##property : public wxGetter \ -{ \ -public : \ - wxINFUNC_CLASS_TYPE_FIX(Klass) \ - wxGetter##property() : wxGetter( wxT(#gettermethod) ) {} \ - virtual ~wxGetter##property() {} \ - void Get( const wxObject *object , wxxVariant &result) const \ -{ \ - const Klass *obj = dynamic_cast(object) ; \ - result = wxxVariant( obj->gettermethod() ) ; \ -} \ -} ; - -#define wxADDER( property, Klass, valueType , addermethod ) \ -class wxAdder##property : public wxAdder \ -{ \ -public: \ - wxINFUNC_CLASS_TYPE_FIX(Klass) \ - wxAdder##property() : wxAdder( wxT(#addermethod) ) {} \ - virtual ~wxAdder##property() {} \ - void Add( wxObject *object, const wxxVariant &variantValue ) const \ -{ \ - Klass *obj = dynamic_cast(object) ; \ - if ( variantValue.wxTEMPLATED_MEMBER_CALL(HasData, valueType) ) \ - obj->addermethod(variantValue.wxTEMPLATED_MEMBER_CALL(Get , valueType)) ; \ - else \ - obj->addermethod(*variantValue.wxTEMPLATED_MEMBER_CALL(Get , valueType*)) ; \ -} \ -} ; - -#define wxCOLLECTION_GETTER( property, Klass, valueType , gettermethod ) \ -class wxCollectionGetter##property : public wxCollectionGetter \ -{ \ -public : \ - wxINFUNC_CLASS_TYPE_FIX(Klass) \ - wxCollectionGetter##property() : wxCollectionGetter( wxT(#gettermethod) ) {} \ - virtual ~wxCollectionGetter##property() {} \ - void Get( const wxObject *object , wxxVariantArray &result) const \ -{ \ - const Klass *obj = dynamic_cast(object) ; \ - wxCollectionToVariantArray( obj->gettermethod() , result ) ; \ -} \ -} ; - -class WXDLLIMPEXP_BASE wxPropertyAccessor -{ -public : - wxPropertyAccessor( wxSetter *setter , wxGetter *getter , wxAdder *adder , wxCollectionGetter *collectionGetter ) - { m_setter = setter ; m_getter = getter ; m_adder = adder ; m_collectionGetter = collectionGetter ;} - - virtual ~wxPropertyAccessor() {} - - // Setting a simple property (non-collection) - virtual void SetProperty(wxObject *object, const wxxVariant &value) const - { if ( m_setter ) m_setter->Set( object , value ) ; else wxLogError( _("SetProperty called w/o valid setter") ) ;} - - // Getting a simple property (non-collection) - virtual void GetProperty(const wxObject *object, wxxVariant &result) const - { if ( m_getter ) m_getter->Get( object , result ) ; else wxLogError( _("GetProperty called w/o valid getter") ) ;} - - // Adding an element to a collection property - virtual void AddToPropertyCollection(wxObject *object, const wxxVariant &value) const - { if ( m_adder ) m_adder->Add( object , value ) ; else wxLogError( _("AddToPropertyCollection called w/o valid adder") ) ;} - - // Getting a collection property - virtual void GetPropertyCollection( const wxObject *obj, wxxVariantArray &result) const - { if ( m_collectionGetter ) m_collectionGetter->Get( obj , result) ; else wxLogError( _("GetPropertyCollection called w/o valid collection getter") ) ;} - - virtual bool HasSetter() const { return m_setter != NULL ; } - virtual bool HasCollectionGetter() const { return m_collectionGetter != NULL ; } - virtual bool HasGetter() const { return m_getter != NULL ; } - virtual bool HasAdder() const { return m_adder != NULL ; } - - virtual const wxString& GetCollectionGetterName() const - { return m_collectionGetter->GetName() ; } - virtual const wxString& GetGetterName() const - { return m_getter->GetName() ; } - virtual const wxString& GetSetterName() const - { return m_setter->GetName() ; } - virtual const wxString& GetAdderName() const - { return m_adder->GetName() ; } - -protected : - wxSetter *m_setter ; - wxAdder *m_adder ; - wxGetter *m_getter ; - wxCollectionGetter* m_collectionGetter ; -}; - -class WXDLLIMPEXP_BASE wxGenericPropertyAccessor : public wxPropertyAccessor -{ -public : - wxGenericPropertyAccessor( const wxString &propName ) ; - virtual ~wxGenericPropertyAccessor() ; - - void RenameProperty( const wxString& WXUNUSED_UNLESS_DEBUG(oldName), - const wxString& newName ) - { - wxASSERT( oldName == m_propertyName ) ; m_propertyName = newName ; - } - virtual bool HasSetter() const { return true ; } - virtual bool HasGetter() const { return true ; } - virtual bool HasAdder() const { return false ; } - virtual bool HasCollectionGetter() const { return false ; } - - virtual const wxString& GetGetterName() const - { return m_getterName ; } - virtual const wxString& GetSetterName() const - { return m_setterName ; } - - virtual void SetProperty(wxObject *object, const wxxVariant &value) const ; - virtual void GetProperty(const wxObject *object, wxxVariant &value) const ; - - // Adding an element to a collection property - virtual void AddToPropertyCollection(wxObject *WXUNUSED(object), const wxxVariant &WXUNUSED(value)) const - { wxLogError( _("AddToPropertyCollection called on a generic accessor") ) ;} - - // Getting a collection property - virtual void GetPropertyCollection( const wxObject *WXUNUSED(obj), wxxVariantArray &WXUNUSED(result)) const - { wxLogError ( _("GetPropertyCollection called on a generic accessor") ) ;} -private : - struct wxGenericPropertyAccessorInternal ; - wxGenericPropertyAccessorInternal* m_data ; - wxString m_propertyName ; - wxString m_setterName ; - wxString m_getterName ; -} ; - -typedef long wxPropertyInfoFlags ; -enum { - // will be removed in future releases - wxPROP_DEPRECATED = 0x00000001 , - // object graph property, will be streamed with priority (after constructor properties) - wxPROP_OBJECT_GRAPH = 0x00000002 , - // this will only be streamed out and in as enum/set, the internal representation is still a long - wxPROP_ENUM_STORE_LONG = 0x00000004 , - // don't stream out this property, needed eg to avoid streaming out children that are always created by their parents - wxPROP_DONT_STREAM = 0x00000008 , -} ; - -class WXDLLIMPEXP_BASE wxPropertyInfo -{ - friend class WXDLLIMPEXP_BASE wxDynamicClassInfo ; -public : - wxPropertyInfo(wxPropertyInfo* &iter, - wxClassInfo* itsClass, - const wxString& name, - const wxString& typeName, - wxPropertyAccessor *accessor, - wxxVariant dv, - wxPropertyInfoFlags flags = 0, - const wxString& helpString = wxEmptyString, - const wxString& groupString = wxEmptyString) : - m_itsClass(itsClass), - m_name(name), - m_typeInfo(NULL), - m_typeName(typeName) , - m_collectionElementTypeInfo(NULL), - m_accessor(accessor), - m_defaultValue(dv), - m_flags(flags), - m_helpString(helpString), - m_groupString(groupString) - { - Insert(iter); - } - -#if wxUSE_UNICODE - wxPropertyInfo(wxPropertyInfo* &iter, - wxClassInfo* itsClass, - const wxString& name, - const char* typeName, - wxPropertyAccessor *accessor, - wxxVariant dv, - wxPropertyInfoFlags flags = 0, - const wxString& helpString = wxEmptyString, - const wxString& groupString = wxEmptyString) : - m_itsClass(itsClass), - m_name(name), - m_typeInfo(NULL), - m_typeName(wxString::FromAscii(typeName)) , - m_collectionElementTypeInfo(NULL), - m_accessor(accessor), - m_defaultValue(dv), - m_flags(flags), - m_helpString(helpString), - m_groupString(groupString) - { - Insert(iter); - } -#endif - wxPropertyInfo(wxPropertyInfo* &iter, - wxClassInfo* itsClass, - const wxString& name, - wxDelegateTypeInfo* type, - wxPropertyAccessor *accessor, - wxxVariant dv, - wxPropertyInfoFlags flags = 0, - const wxString& helpString = wxEmptyString, - const wxString& groupString = wxEmptyString) : - m_itsClass(itsClass), - m_name(name), - m_typeInfo(type), - m_collectionElementTypeInfo(NULL), - m_accessor(accessor), - m_defaultValue(dv), - m_flags(flags), - m_helpString(helpString), - m_groupString(groupString) - { - Insert(iter); - } - - wxPropertyInfo(wxPropertyInfo* &iter, - wxClassInfo* itsClass, const wxString& name, - const wxString& collectionTypeName, - const wxString& elementTypeName, - wxPropertyAccessor *accessor, - wxPropertyInfoFlags flags = 0, - const wxString& helpString = wxEmptyString, - const wxString& groupString = wxEmptyString) : - m_itsClass(itsClass), - m_name(name), - m_typeInfo(NULL), - m_typeName(collectionTypeName) , - m_collectionElementTypeInfo(NULL), - m_collectionElementTypeName(elementTypeName), - m_accessor(accessor) , - m_flags(flags), - m_helpString(helpString), - m_groupString(groupString) - { - Insert(iter); - } - -#if wxUSE_UNICODE - wxPropertyInfo(wxPropertyInfo* &iter, - wxClassInfo* itsClass, const wxString& name, - const char* collectionTypeName, - const char* elementTypeName, - wxPropertyAccessor *accessor, - wxPropertyInfoFlags flags = 0, - const wxString& helpString = wxEmptyString, - const wxString& groupString = wxEmptyString) : - m_itsClass(itsClass), - m_name(name), - m_typeInfo(NULL), - m_typeName(wxString::FromAscii(collectionTypeName)) , - m_collectionElementTypeInfo(NULL), - m_collectionElementTypeName(wxString::FromAscii(elementTypeName)), - m_accessor(accessor) , - m_flags(flags), - m_helpString(helpString), - m_groupString(groupString) - { - Insert(iter); - } -#endif - ~wxPropertyInfo() ; - - // return the class this property is declared in - const wxClassInfo* GetDeclaringClass() const { return m_itsClass ; } - - // return the name of this property - const wxString& GetName() const { return m_name ; } - - // returns the flags of this property - wxPropertyInfoFlags GetFlags() const { return m_flags ;} - - // returns the short help string of this property - const wxString& GetHelpString() const { return m_helpString ; } - - // returns the group string of this property - const wxString& GetGroupString() const { return m_groupString ; } - - // return the element type info of this property (for collections, otherwise NULL) - const wxTypeInfo * GetCollectionElementTypeInfo() const - { - if ( m_collectionElementTypeInfo == NULL ) - m_collectionElementTypeInfo = wxTypeInfo::FindType(m_collectionElementTypeName) ; - return m_collectionElementTypeInfo ; - } - - // return the type info of this property - const wxTypeInfo * GetTypeInfo() const - { - if ( m_typeInfo == NULL ) - m_typeInfo = wxTypeInfo::FindType(m_typeName) ; - return m_typeInfo ; - } - - // return the accessor for this property - wxPropertyAccessor* GetAccessor() const { return m_accessor ; } - - // returns NULL if this is the last property of this class - wxPropertyInfo* GetNext() const { return m_next ; } - - // returns the default value of this property, its kind may be wxT_VOID if it is not valid - wxxVariant GetDefaultValue() const { return m_defaultValue ; } -private : - void Insert(wxPropertyInfo* &iter) - { - m_next = NULL ; - if ( iter == NULL ) - iter = this ; - else - { - wxPropertyInfo* i = iter ; - while( i->m_next ) - i = i->m_next ; - - i->m_next = this ; - } - } - - wxClassInfo* m_itsClass ; - wxString m_name ; - mutable wxTypeInfo* m_typeInfo ; - wxString m_typeName ; - mutable wxTypeInfo* m_collectionElementTypeInfo ; - wxString m_collectionElementTypeName ; - wxPropertyAccessor* m_accessor ; - wxxVariant m_defaultValue; - wxPropertyInfoFlags m_flags ; - wxString m_helpString ; - wxString m_groupString ; - // string representation of the default value - // to be assigned by the designer to the property - // when the component is dropped on the container. - wxPropertyInfo* m_next ; -}; - -WX_DECLARE_STRING_HASH_MAP_WITH_DECL( wxPropertyInfo* , wxPropertyInfoMap , class WXDLLIMPEXP_BASE ) ; - -#define wxBEGIN_PROPERTIES_TABLE(theClass) \ - wxPropertyInfo *theClass::GetPropertiesStatic() \ -{ \ - typedef theClass class_t; \ - static wxPropertyInfo* first = NULL ; - -#define wxEND_PROPERTIES_TABLE() \ - return first ; } - -#define wxHIDE_PROPERTY( pname ) \ - static wxPropertyInfo _propertyInfo##pname( first , class_t::GetClassInfoStatic() , wxT(#pname) , typeid(void).name() ,NULL , wxxVariant() , wxPROP_DONT_STREAM , wxEmptyString , wxEmptyString ) ; - -#define wxPROPERTY( pname , type , setter , getter , defaultValue , flags , help , group) \ - wxSETTER( pname , class_t , type , setter ) \ - static wxSetter##pname _setter##pname ; \ - wxGETTER( pname , class_t , type , getter ) \ - static wxGetter##pname _getter##pname ; \ - static wxPropertyAccessor _accessor##pname( &_setter##pname , &_getter##pname , NULL , NULL ) ; \ - static wxPropertyInfo _propertyInfo##pname( first , class_t::GetClassInfoStatic() , wxT(#pname) , typeid(type).name() ,&_accessor##pname , wxxVariant(defaultValue) , flags , group , help ) ; - -#define wxPROPERTY_FLAGS( pname , flags , type , setter , getter ,defaultValue , pflags , help , group) \ - wxSETTER( pname , class_t , type , setter ) \ - static wxSetter##pname _setter##pname ; \ - wxGETTER( pname , class_t , type , getter ) \ - static wxGetter##pname _getter##pname ; \ - static wxPropertyAccessor _accessor##pname( &_setter##pname , &_getter##pname , NULL , NULL ) ; \ - static wxPropertyInfo _propertyInfo##pname( first , class_t::GetClassInfoStatic() , wxT(#pname) , typeid(flags).name() ,&_accessor##pname , wxxVariant(defaultValue), wxPROP_ENUM_STORE_LONG | pflags , help , group ) ; - -#define wxREADONLY_PROPERTY( pname , type , getter ,defaultValue , flags , help , group) \ - wxGETTER( pname , class_t , type , getter ) \ - static wxGetter##pname _getter##pname ; \ - static wxPropertyAccessor _accessor##pname( NULL , &_getter##pname , NULL , NULL ) ; \ - static wxPropertyInfo _propertyInfo##pname( first , class_t::GetClassInfoStatic() , wxT(#pname) , typeid(type).name() ,&_accessor##pname , wxxVariant(defaultValue), flags , help , group ) ; - -#define wxREADONLY_PROPERTY_FLAGS( pname , flags , type , getter ,defaultValue , pflags , help , group) \ - wxGETTER( pname , class_t , type , getter ) \ - static wxGetter##pname _getter##pname ; \ - static wxPropertyAccessor _accessor##pname( NULL , &_getter##pname , NULL , NULL ) ; \ - static wxPropertyInfo _propertyInfo##pname( first , class_t::GetClassInfoStatic() , wxT(#pname) , typeid(flags).name() ,&_accessor##pname , wxxVariant(defaultValue), wxPROP_ENUM_STORE_LONG | pflags , help , group ) ; - -#define wxPROPERTY_COLLECTION( pname , colltype , addelemtype , adder , getter , flags , help , group ) \ - wxADDER( pname , class_t , addelemtype , adder ) \ - static wxAdder##pname _adder##pname ; \ - wxCOLLECTION_GETTER( pname , class_t , colltype , getter ) \ - static wxCollectionGetter##pname _collectionGetter##pname ; \ - static wxPropertyAccessor _accessor##pname( NULL , NULL ,&_adder##pname , &_collectionGetter##pname ) ; \ - static wxPropertyInfo _propertyInfo##pname( first , class_t::GetClassInfoStatic() , wxT(#pname) , typeid(colltype).name() ,typeid(addelemtype).name() ,&_accessor##pname , flags , help , group ) ; - -#define wxREADONLY_PROPERTY_COLLECTION( pname , colltype , addelemtype , getter , flags , help , group) \ - wxCOLLECTION_GETTER( pname , class_t , colltype , getter ) \ - static wxCollectionGetter##pname _collectionGetter##pname ; \ - static wxPropertyAccessor _accessor##pname( NULL , NULL , NULL , &_collectionGetter##pname ) ; \ - static wxPropertyInfo _propertyInfo##pname( first ,class_t::GetClassInfoStatic() , wxT(#pname) , typeid(colltype).name() ,typeid(addelemtype).name() ,&_accessor##pname , flags , help , group ) ; - - -#define wxEVENT_PROPERTY( name , eventType , eventClass ) \ - static wxDelegateTypeInfo _typeInfo##name( eventType , CLASSINFO( eventClass ) ) ; \ - static wxPropertyInfo _propertyInfo##name( first ,class_t::GetClassInfoStatic() , wxT(#name) , &_typeInfo##name , NULL , wxxVariant() ) ; \ - -#define wxEVENT_RANGE_PROPERTY( name , eventType , lastEventType , eventClass ) \ - static wxDelegateTypeInfo _typeInfo##name( eventType , lastEventType , CLASSINFO( eventClass ) ) ; \ - static wxPropertyInfo _propertyInfo##name( first , class_t::GetClassInfoStatic() , wxT(#name) , &_typeInfo##name , NULL , wxxVariant() ) ; \ - -// ---------------------------------------------------------------------------- -// Implementation Helper for Simple Properties -// ---------------------------------------------------------------------------- - -#define wxIMPLEMENT_PROPERTY(name, type) \ -private:\ - type m_##name; \ -public: \ - void Set##name( type const & p) { m_##name = p; } \ - type const & Get##name() const { return m_##name; } - -// ---------------------------------------------------------------------------- -// Handler Info -// -// this is describing an event sink -// ---------------------------------------------------------------------------- - -class WXDLLIMPEXP_BASE wxHandlerInfo -{ - friend class WXDLLIMPEXP_BASE wxDynamicClassInfo ; -public : - wxHandlerInfo(wxHandlerInfo* &iter, - wxClassInfo* itsClass, - const wxString& name, - wxObjectEventFunction address, - const wxClassInfo* eventClassInfo) : - m_eventFunction(address), - m_name(name), - m_eventClassInfo(eventClassInfo) , - m_itsClass(itsClass) - { - m_next = NULL ; - if ( iter == NULL ) - iter = this ; - else - { - wxHandlerInfo* i = iter ; - while( i->m_next ) - i = i->m_next ; - - i->m_next = this ; - } - } - - ~wxHandlerInfo() ; - - // return the name of this handler - const wxString& GetName() const { return m_name ; } - - // return the class info of the event - const wxClassInfo *GetEventClassInfo() const { return m_eventClassInfo ; } - - // get the handler function pointer - wxObjectEventFunction GetEventFunction() const { return m_eventFunction ; } - - // returns NULL if this is the last handler of this class - wxHandlerInfo* GetNext() const { return m_next ; } - - // return the class this property is declared in - const wxClassInfo* GetDeclaringClass() const { return m_itsClass ; } - -private : - wxObjectEventFunction m_eventFunction ; - wxString m_name; - const wxClassInfo* m_eventClassInfo ; - wxHandlerInfo* m_next ; - wxClassInfo* m_itsClass ; -}; - -#define wxHANDLER(name,eventClassType) \ - static wxHandlerInfo _handlerInfo##name( first , class_t::GetClassInfoStatic() , wxT(#name) , (wxObjectEventFunction) (wxEventFunction) &name , CLASSINFO( eventClassType ) ) ; - -#define wxBEGIN_HANDLERS_TABLE(theClass) \ - wxHandlerInfo *theClass::GetHandlersStatic() \ -{ \ - typedef theClass class_t; \ - static wxHandlerInfo* first = NULL ; - -#define wxEND_HANDLERS_TABLE() \ - return first ; } - -// ---------------------------------------------------------------------------- -// Constructor Bridges -// -// allow to set up constructors with params during runtime -// ---------------------------------------------------------------------------- - -class WXDLLIMPEXP_BASE wxConstructorBridge -{ -public : - virtual void Create(wxObject * &o, wxxVariant *args) = 0; -}; - -// a direct constructor bridge calls the operator new for this class and -// passes all params to the constructor. needed for classes that cannot be -// instantiated using alloc-create semantics -class WXDLLIMPEXP_BASE wxDirectConstructorBrigde : public wxConstructorBridge -{ -public : - virtual void Create(wxObject * &o, wxxVariant *args) = 0; -} ; - -// Creator Bridges for all Numbers of Params - -// no params - -template -struct wxConstructorBridge_0 : public wxConstructorBridge -{ - void Create(wxObject * &o, wxxVariant *) - { - Class *obj = dynamic_cast(o); - obj->Create(); - } -}; - -struct wxConstructorBridge_Dummy : public wxConstructorBridge -{ - void Create(wxObject *&, wxxVariant *) - { - } -} ; - -#define wxCONSTRUCTOR_0(klass) \ - wxConstructorBridge_0 constructor##klass ; \ - wxConstructorBridge* klass::ms_constructor = &constructor##klass ; \ - const wxChar *klass::ms_constructorProperties[] = { NULL } ; \ - const int klass::ms_constructorPropertiesCount = 0 ; - -#define wxCONSTRUCTOR_DUMMY(klass) \ - wxConstructorBridge_Dummy constructor##klass ; \ - wxConstructorBridge* klass::ms_constructor = &constructor##klass ; \ - const wxChar *klass::ms_constructorProperties[] = { NULL } ; \ - const int klass::ms_constructorPropertiesCount = 0 ; - -// 1 param - -template -struct wxConstructorBridge_1 : public wxConstructorBridge -{ - void Create(wxObject * &o, wxxVariant *args) - { - Class *obj = dynamic_cast(o); - obj->Create( - args[0].wxTEMPLATED_MEMBER_CALL(Get , T0) - ); - } -}; - -#define wxCONSTRUCTOR_1(klass,t0,v0) \ - wxConstructorBridge_1 constructor##klass ; \ - wxConstructorBridge* klass::ms_constructor = &constructor##klass ; \ - const wxChar *klass::ms_constructorProperties[] = { wxT(#v0) } ; \ - const int klass::ms_constructorPropertiesCount = 1 ; - -// 2 params - -template -struct wxConstructorBridge_2 : public wxConstructorBridge -{ - void Create(wxObject * &o, wxxVariant *args) - { - Class *obj = dynamic_cast(o); - obj->Create( - args[0].wxTEMPLATED_MEMBER_CALL(Get , T0) , - args[1].wxTEMPLATED_MEMBER_CALL(Get , T1) - ); - } -}; - -#define wxCONSTRUCTOR_2(klass,t0,v0,t1,v1) \ - wxConstructorBridge_2 constructor##klass ; \ - wxConstructorBridge* klass::ms_constructor = &constructor##klass ; \ - const wxChar *klass::ms_constructorProperties[] = { wxT(#v0) , wxT(#v1) } ; \ - const int klass::ms_constructorPropertiesCount = 2; - -// direct constructor version - -template -struct wxDirectConstructorBridge_2 : public wxDirectConstructorBrigde -{ - void Create(wxObject * &o, wxxVariant *args) - { - o = new Class( - args[0].wxTEMPLATED_MEMBER_CALL(Get , T0) , - args[1].wxTEMPLATED_MEMBER_CALL(Get , T1) - ); - } -}; - -#define wxDIRECT_CONSTRUCTOR_2(klass,t0,v0,t1,v1) \ - wxDirectConstructorBridge_2 constructor##klass ; \ - wxConstructorBridge* klass::ms_constructor = &constructor##klass ; \ - const wxChar *klass::ms_constructorProperties[] = { wxT(#v0) , wxT(#v1) } ; \ - const int klass::ms_constructorPropertiesCount = 2; - - -// 3 params - -template -struct wxConstructorBridge_3 : public wxConstructorBridge -{ - void Create(wxObject * &o, wxxVariant *args) - { - Class *obj = dynamic_cast(o); - obj->Create( - args[0].wxTEMPLATED_MEMBER_CALL(Get , T0) , - args[1].wxTEMPLATED_MEMBER_CALL(Get , T1) , - args[2].wxTEMPLATED_MEMBER_CALL(Get , T2) - ); - } -}; - -#define wxCONSTRUCTOR_3(klass,t0,v0,t1,v1,t2,v2) \ - wxConstructorBridge_3 constructor##klass ; \ - wxConstructorBridge* klass::ms_constructor = &constructor##klass ; \ - const wxChar *klass::ms_constructorProperties[] = { wxT(#v0) , wxT(#v1) , wxT(#v2) } ; \ - const int klass::ms_constructorPropertiesCount = 3 ; - -// direct constructor version - -template -struct wxDirectConstructorBridge_3 : public wxDirectConstructorBrigde -{ - void Create(wxObject * &o, wxxVariant *args) - { - o = new Class( - args[0].wxTEMPLATED_MEMBER_CALL(Get , T0) , - args[1].wxTEMPLATED_MEMBER_CALL(Get , T1) , - args[2].wxTEMPLATED_MEMBER_CALL(Get , T2) - ); - } -}; - -#define wxDIRECT_CONSTRUCTOR_3(klass,t0,v0,t1,v1,t2,v2) \ - wxDirectConstructorBridge_3 constructor##klass ; \ - wxConstructorBridge* klass::ms_constructor = &constructor##klass ; \ - const wxChar *klass::ms_constructorProperties[] = { wxT(#v0) , wxT(#v1) , wxT(#v2) } ; \ - const int klass::ms_constructorPropertiesCount = 3; - -// 4 params - -template -struct wxConstructorBridge_4 : public wxConstructorBridge -{ - void Create(wxObject * &o, wxxVariant *args) - { - Class *obj = dynamic_cast(o); - obj->Create( - args[0].wxTEMPLATED_MEMBER_CALL(Get , T0) , - args[1].wxTEMPLATED_MEMBER_CALL(Get , T1) , - args[2].wxTEMPLATED_MEMBER_CALL(Get , T2) , - args[3].wxTEMPLATED_MEMBER_CALL(Get , T3) - ); - } -}; - -#define wxCONSTRUCTOR_4(klass,t0,v0,t1,v1,t2,v2,t3,v3) \ - wxConstructorBridge_4 constructor##klass ; \ - wxConstructorBridge* klass::ms_constructor = &constructor##klass ; \ - const wxChar *klass::ms_constructorProperties[] = { wxT(#v0) , wxT(#v1) , wxT(#v2) , wxT(#v3) } ; \ - const int klass::ms_constructorPropertiesCount = 4 ; - -// 5 params - -template -struct wxConstructorBridge_5 : public wxConstructorBridge -{ - void Create(wxObject * &o, wxxVariant *args) - { - Class *obj = dynamic_cast(o); - obj->Create( - args[0].wxTEMPLATED_MEMBER_CALL(Get , T0) , - args[1].wxTEMPLATED_MEMBER_CALL(Get , T1) , - args[2].wxTEMPLATED_MEMBER_CALL(Get , T2) , - args[3].wxTEMPLATED_MEMBER_CALL(Get , T3) , - args[4].wxTEMPLATED_MEMBER_CALL(Get , T4) - ); - } -}; - -#define wxCONSTRUCTOR_5(klass,t0,v0,t1,v1,t2,v2,t3,v3,t4,v4) \ - wxConstructorBridge_5 constructor##klass ; \ - wxConstructorBridge* klass::ms_constructor = &constructor##klass ; \ - const wxChar *klass::ms_constructorProperties[] = { wxT(#v0) , wxT(#v1) , wxT(#v2) , wxT(#v3) , wxT(#v4) } ; \ - const int klass::ms_constructorPropertiesCount = 5; - -// 6 params - -template -struct wxConstructorBridge_6 : public wxConstructorBridge -{ - void Create(wxObject * &o, wxxVariant *args) - { - Class *obj = dynamic_cast(o); - obj->Create( - args[0].wxTEMPLATED_MEMBER_CALL(Get , T0) , - args[1].wxTEMPLATED_MEMBER_CALL(Get , T1) , - args[2].wxTEMPLATED_MEMBER_CALL(Get , T2) , - args[3].wxTEMPLATED_MEMBER_CALL(Get , T3) , - args[4].wxTEMPLATED_MEMBER_CALL(Get , T4) , - args[5].wxTEMPLATED_MEMBER_CALL(Get , T5) - ); - } -}; - -#define wxCONSTRUCTOR_6(klass,t0,v0,t1,v1,t2,v2,t3,v3,t4,v4,t5,v5) \ - wxConstructorBridge_6 constructor##klass ; \ - wxConstructorBridge* klass::ms_constructor = &constructor##klass ; \ - const wxChar *klass::ms_constructorProperties[] = { wxT(#v0) , wxT(#v1) , wxT(#v2) , wxT(#v3) , wxT(#v4) , wxT(#v5) } ; \ - const int klass::ms_constructorPropertiesCount = 6; - -// direct constructor version - -template -struct wxDirectConstructorBridge_6 : public wxDirectConstructorBrigde -{ - void Create(wxObject * &o, wxxVariant *args) - { - o = new Class( - args[0].wxTEMPLATED_MEMBER_CALL(Get , T0) , - args[1].wxTEMPLATED_MEMBER_CALL(Get , T1) , - args[2].wxTEMPLATED_MEMBER_CALL(Get , T2) , - args[3].wxTEMPLATED_MEMBER_CALL(Get , T3) , - args[4].wxTEMPLATED_MEMBER_CALL(Get , T4) , - args[5].wxTEMPLATED_MEMBER_CALL(Get , T5) - ); - } -}; - -#define wxDIRECT_CONSTRUCTOR_6(klass,t0,v0,t1,v1,t2,v2,t3,v3,t4,v4,t5,v5) \ - wxDirectConstructorBridge_6 constructor##klass ; \ - wxConstructorBridge* klass::ms_constructor = &constructor##klass ; \ - const wxChar *klass::ms_constructorProperties[] = { wxT(#v0) , wxT(#v1) , wxT(#v2) , wxT(#v3) , wxT(#v4) , wxT(#v5) } ; \ - const int klass::ms_constructorPropertiesCount = 6; - -// 7 params - -template -struct wxConstructorBridge_7 : public wxConstructorBridge -{ - void Create(wxObject * &o, wxxVariant *args) - { - Class *obj = dynamic_cast(o); - obj->Create( - args[0].wxTEMPLATED_MEMBER_CALL(Get , T0) , - args[1].wxTEMPLATED_MEMBER_CALL(Get , T1) , - args[2].wxTEMPLATED_MEMBER_CALL(Get , T2) , - args[3].wxTEMPLATED_MEMBER_CALL(Get , T3) , - args[4].wxTEMPLATED_MEMBER_CALL(Get , T4) , - args[5].wxTEMPLATED_MEMBER_CALL(Get , T5) , - args[6].wxTEMPLATED_MEMBER_CALL(Get , T6) - ); - } -}; - -#define wxCONSTRUCTOR_7(klass,t0,v0,t1,v1,t2,v2,t3,v3,t4,v4,t5,v5,t6,v6) \ - wxConstructorBridge_7 constructor##klass ; \ - wxConstructorBridge* klass::ms_constructor = &constructor##klass ; \ - const wxChar *klass::ms_constructorProperties[] = { wxT(#v0) , wxT(#v1) , wxT(#v2) , wxT(#v3) , wxT(#v4) , wxT(#v5) , wxT(#v6) } ; \ - const int klass::ms_constructorPropertiesCount = 7; - -// 8 params - -template -struct wxConstructorBridge_8 : public wxConstructorBridge -{ - void Create(wxObject * &o, wxxVariant *args) - { - Class *obj = dynamic_cast(o); - obj->Create( - args[0].wxTEMPLATED_MEMBER_CALL(Get , T0) , - args[1].wxTEMPLATED_MEMBER_CALL(Get , T1) , - args[2].wxTEMPLATED_MEMBER_CALL(Get , T2) , - args[3].wxTEMPLATED_MEMBER_CALL(Get , T3) , - args[4].wxTEMPLATED_MEMBER_CALL(Get , T4) , - args[5].wxTEMPLATED_MEMBER_CALL(Get , T5) , - args[6].wxTEMPLATED_MEMBER_CALL(Get , T6) , - args[7].wxTEMPLATED_MEMBER_CALL(Get , T7) - ); - } -}; - -#define wxCONSTRUCTOR_8(klass,t0,v0,t1,v1,t2,v2,t3,v3,t4,v4,t5,v5,t6,v6,t7,v7) \ - wxConstructorBridge_8 constructor##klass ; \ - wxConstructorBridge* klass::ms_constructor = &constructor##klass ; \ - const wxChar *klass::ms_constructorProperties[] = { wxT(#v0) , wxT(#v1) , wxT(#v2) , wxT(#v3) , wxT(#v4) , wxT(#v5) , wxT(#v6) , wxT(#v7) } ; \ - const int klass::ms_constructorPropertiesCount = 8; -// ---------------------------------------------------------------------------- -// wxClassInfo -// ---------------------------------------------------------------------------- - -typedef wxObject *(*wxObjectConstructorFn)(void); -typedef wxObject* (*wxVariantToObjectConverter)( wxxVariant &data ) ; -typedef wxxVariant (*wxObjectToVariantConverter)( wxObject* ) ; - -class WXDLLIMPEXP_BASE wxWriter; -class WXDLLIMPEXP_BASE wxPersister; - -typedef bool (*wxObjectStreamingCallback) ( const wxObject *, wxWriter * , wxPersister * , wxxVariantArray & ) ; - -class WXDLLIMPEXP_BASE wxClassInfo -{ - friend class WXDLLIMPEXP_BASE wxPropertyInfo ; - friend class WXDLLIMPEXP_BASE wxHandlerInfo ; -public: - wxClassInfo(const wxClassInfo **_Parents, - const wxChar *_UnitName, - const wxChar *_ClassName, - int size, - wxObjectConstructorFn ctor , - wxPropertyInfo *_Props , - wxHandlerInfo *_Handlers , - wxConstructorBridge* _Constructor , - const wxChar ** _ConstructorProperties , - const int _ConstructorPropertiesCount , - wxVariantToObjectConverter _PtrConverter1 , - wxVariantToObjectConverter _Converter2 , - wxObjectToVariantConverter _Converter3 , - wxObjectStreamingCallback _streamingCallback = NULL - ) : - - m_className(_ClassName), - m_objectSize(size), - m_objectConstructor(ctor), - m_next(sm_first), - m_firstProperty(_Props), - m_firstHandler(_Handlers), - m_parents(_Parents), - m_unitName(_UnitName), - m_constructor(_Constructor), - m_constructorProperties(_ConstructorProperties), - m_constructorPropertiesCount(_ConstructorPropertiesCount), - m_variantOfPtrToObjectConverter(_PtrConverter1), - m_variantToObjectConverter(_Converter2), - m_objectToVariantConverter(_Converter3), - m_streamingCallback(_streamingCallback) - { - sm_first = this; - Register() ; - } - - wxClassInfo(const wxChar *_UnitName, const wxChar *_ClassName, - const wxClassInfo **_Parents) : - m_className(_ClassName), - m_objectSize(0), - m_objectConstructor(NULL), - m_next(sm_first), - m_firstProperty(NULL), - m_firstHandler(NULL), - m_parents(_Parents), - m_unitName(_UnitName), - m_constructor(NULL), - m_constructorProperties(NULL), - m_constructorPropertiesCount(0), - m_variantOfPtrToObjectConverter(NULL), - m_variantToObjectConverter(NULL), - m_objectToVariantConverter(NULL), - m_streamingCallback(NULL) - { - sm_first = this; - Register() ; - } - - virtual ~wxClassInfo() ; - - // allocates an instance of this class, this object does not have to be initialized or fully constructed - // as this call will be followed by a call to Create - virtual wxObject *AllocateObject() const { return m_objectConstructor ? (*m_objectConstructor)() : 0; } - - // 'old naming' for AllocateObject staying here for backward compatibility - wxObject *CreateObject() const { return AllocateObject() ; } - - // direct construction call for classes that cannot construct instances via alloc/create - wxObject *ConstructObject(int ParamCount, wxxVariant *Params) const - { - if ( ParamCount != m_constructorPropertiesCount ) - { - wxLogError( _("Illegal Parameter Count for ConstructObject Method") ) ; - return NULL ; - } - wxObject *object = NULL ; - m_constructor->Create( object , Params ) ; - return object ; - } - - bool NeedsDirectConstruction() const { return dynamic_cast( m_constructor) != NULL ; } - - const wxChar *GetClassName() const { return m_className; } - const wxChar *GetBaseClassName1() const - { return m_parents[0] ? m_parents[0]->GetClassName() : NULL; } - const wxChar *GetBaseClassName2() const - { return (m_parents[0] && m_parents[1]) ? m_parents[1]->GetClassName() : NULL; } - const wxChar *GetIncludeName() const { return m_unitName ; } - const wxClassInfo **GetParents() const { return m_parents; } - int GetSize() const { return m_objectSize; } - bool IsDynamic() const { return (NULL != m_objectConstructor); } - - wxObjectConstructorFn GetConstructor() const { return m_objectConstructor; } - static const wxClassInfo *GetFirst() { return sm_first; } - const wxClassInfo *GetNext() const { return m_next; } - static wxClassInfo *FindClass(const wxChar *className); - - // Climb upwards through inheritance hierarchy. - // Dual inheritance is catered for. - - bool IsKindOf(const wxClassInfo *info) const - { - if ( info != 0 ) - { - if ( info == this ) - return true ; - - for ( int i = 0 ; m_parents[i] ; ++ i ) - { - if ( m_parents[i]->IsKindOf( info ) ) - return true ; - } - } - return false ; - } - - // if there is a callback registered with that class it will be called - // before this object will be written to disk, it can veto streaming out - // this object by returning false, if this class has not registered a - // callback, the search will go up the inheritance tree if no callback has - // been registered true will be returned by default - bool BeforeWriteObject( const wxObject *obj, wxWriter *streamer , wxPersister *persister , wxxVariantArray &metadata) const ; - - // gets the streaming callback from this class or any superclass - wxObjectStreamingCallback GetStreamingCallback() const ; - -#if WXWIN_COMPATIBILITY_2_4 - // Initializes parent pointers and hash table for fast searching. - wxDEPRECATED( static void InitializeClasses() ); - // Cleans up hash table used for fast searching. - wxDEPRECATED( static void CleanUpClasses() ); -#endif - static void CleanUp(); - - // returns the first property - const wxPropertyInfo* GetFirstProperty() const { return m_firstProperty ; } - - // returns the first handler - const wxHandlerInfo* GetFirstHandler() const { return m_firstHandler ; } - - // Call the Create upon an instance of the class, in the end the object is fully - // initialized - virtual void Create (wxObject *object, int ParamCount, wxxVariant *Params) const - { - if ( ParamCount != m_constructorPropertiesCount ) - { - wxLogError( _("Illegal Parameter Count for Create Method") ) ; - return ; - } - m_constructor->Create( object , Params ) ; - } - - // get number of parameters for constructor - virtual int GetCreateParamCount() const { return m_constructorPropertiesCount; } - - // get n-th constructor parameter - virtual const wxChar* GetCreateParamName(int n) const { return m_constructorProperties[n] ; } - - // Runtime access to objects for simple properties (get/set) by property name, and variant data - virtual void SetProperty (wxObject *object, const wxChar *propertyName, const wxxVariant &value) const ; - virtual wxxVariant GetProperty (wxObject *object, const wxChar *propertyName) const; - - // Runtime access to objects for collection properties by property name - virtual wxxVariantArray GetPropertyCollection(wxObject *object, const wxChar *propertyName) const ; - virtual void AddToPropertyCollection(wxObject *object, const wxChar *propertyName , const wxxVariant& value) const ; - - // we must be able to cast variants to wxObject pointers, templates seem not to be suitable - wxObject* VariantToInstance( wxxVariant &data ) const - { - if ( data.GetTypeInfo()->GetKind() == wxT_OBJECT ) - return m_variantToObjectConverter( data ) ; - else - return m_variantOfPtrToObjectConverter( data ) ; - } - - wxxVariant InstanceToVariant( wxObject *object ) const { return m_objectToVariantConverter( object ) ; } - - // find property by name - virtual const wxPropertyInfo *FindPropertyInfo (const wxChar *PropertyName) const ; - - // find handler by name - virtual const wxHandlerInfo *FindHandlerInfo (const wxChar *PropertyName) const ; - - // find property by name - virtual wxPropertyInfo *FindPropertyInfoInThisClass (const wxChar *PropertyName) const ; - - // find handler by name - virtual wxHandlerInfo *FindHandlerInfoInThisClass (const wxChar *PropertyName) const ; - - // puts all the properties of this class and its superclasses in the map, as long as there is not yet - // an entry with the same name (overriding mechanism) - void GetProperties( wxPropertyInfoMap &map ) const ; -public: - const wxChar *m_className; - int m_objectSize; - wxObjectConstructorFn m_objectConstructor; - - // class info object live in a linked list: - // pointers to its head and the next element in it - - static wxClassInfo *sm_first; - wxClassInfo *m_next; - - // FIXME: this should be private (currently used directly by way too - // many clients) - static wxHashTable *sm_classTable; - -protected : - wxPropertyInfo * m_firstProperty ; - wxHandlerInfo * m_firstHandler ; -private: - const wxClassInfo** m_parents ; - const wxChar* m_unitName; - - wxConstructorBridge* m_constructor ; - const wxChar ** m_constructorProperties ; - const int m_constructorPropertiesCount ; - wxVariantToObjectConverter m_variantOfPtrToObjectConverter ; - wxVariantToObjectConverter m_variantToObjectConverter ; - wxObjectToVariantConverter m_objectToVariantConverter ; - wxObjectStreamingCallback m_streamingCallback ; - const wxPropertyAccessor *FindAccessor (const wxChar *propertyName) const ; - - - // InitializeClasses() helper - static wxClassInfo *GetBaseByName(const wxChar *name) ; - -protected: - // registers the class - void Register(); - void Unregister(); - - DECLARE_NO_COPY_CLASS(wxClassInfo) -}; - - -WXDLLIMPEXP_BASE wxObject *wxCreateDynamicObject(const wxChar *name); - -// ---------------------------------------------------------------------------- -// wxDynamicObject -// ---------------------------------------------------------------------------- -// -// this object leads to having a pure runtime-instantiation - -class WXDLLIMPEXP_BASE wxDynamicClassInfo : public wxClassInfo -{ - friend class WXDLLIMPEXP_BASE wxDynamicObject ; -public : - wxDynamicClassInfo( const wxChar *_UnitName, const wxChar *_ClassName , const wxClassInfo* superClass ) ; - virtual ~wxDynamicClassInfo() ; - - // constructs a wxDynamicObject with an instance - virtual wxObject *AllocateObject() const ; - - // Call the Create method for a class - virtual void Create (wxObject *object, int ParamCount, wxxVariant *Params) const ; - - // get number of parameters for constructor - virtual int GetCreateParamCount() const ; - - // get i-th constructor parameter - virtual const wxChar* GetCreateParamName(int i) const ; - - // Runtime access to objects by property name, and variant data - virtual void SetProperty (wxObject *object, const wxChar *PropertyName, const wxxVariant &Value) const ; - virtual wxxVariant GetProperty (wxObject *object, const wxChar *PropertyName) const ; - - // adds a property to this class at runtime - void AddProperty( const wxChar *propertyName , const wxTypeInfo* typeInfo ) ; - - // removes an existing runtime-property - void RemoveProperty( const wxChar *propertyName ) ; - - // renames an existing runtime-property - void RenameProperty( const wxChar *oldPropertyName , const wxChar *newPropertyName ) ; - - // as a handler to this class at runtime - void AddHandler( const wxChar *handlerName , wxObjectEventFunction address , const wxClassInfo* eventClassInfo ) ; - - // removes an existing runtime-handler - void RemoveHandler( const wxChar *handlerName ) ; - - // renames an existing runtime-handler - void RenameHandler( const wxChar *oldHandlerName , const wxChar *newHandlerName ) ; -private : - struct wxDynamicClassInfoInternal ; - wxDynamicClassInfoInternal* m_data ; -} ; - -// ---------------------------------------------------------------------------- -// Dynamic class macros -// ---------------------------------------------------------------------------- - -#define _DECLARE_DYNAMIC_CLASS(name) \ - public: \ - static wxClassInfo ms_classInfo; \ - static const wxClassInfo* ms_classParents[] ; \ - static wxPropertyInfo* GetPropertiesStatic() ; \ - static wxHandlerInfo* GetHandlersStatic() ; \ - static wxClassInfo *GetClassInfoStatic() \ -{ return &name::ms_classInfo; } \ - virtual wxClassInfo *GetClassInfo() const \ -{ return &name::ms_classInfo; } - -/* -#define _DECLARE_DYNAMIC_CLASS(name) \ - public: \ - static wxClassInfo ms_class##name; \ - static const wxClassInfo* ms_classParents##name[] ; \ - static wxPropertyInfo* GetPropertiesStatic() ; \ - static wxHandlerInfo* GetHandlersStatic() ; \ - static wxClassInfo *GetClassInfoStatic() \ -{ return &name::ms_class##name; } \ - virtual wxClassInfo *GetClassInfo() const \ -{ return &name::ms_class##name; } -*/ -#define DECLARE_DYNAMIC_CLASS(name) \ - static wxConstructorBridge* ms_constructor ; \ - static const wxChar * ms_constructorProperties[] ; \ - static const int ms_constructorPropertiesCount ; \ - _DECLARE_DYNAMIC_CLASS(name) - -#define DECLARE_DYNAMIC_CLASS_NO_ASSIGN(name) \ - DECLARE_NO_ASSIGN_CLASS(name) \ - DECLARE_DYNAMIC_CLASS(name) - -#define DECLARE_DYNAMIC_CLASS_NO_COPY(name) \ - DECLARE_NO_COPY_CLASS(name) \ - DECLARE_DYNAMIC_CLASS(name) - -#define DECLARE_ABSTRACT_CLASS(name) _DECLARE_DYNAMIC_CLASS(name) -#define DECLARE_CLASS(name) DECLARE_DYNAMIC_CLASS(name) - -// ----------------------------------- -// for concrete classes -// ----------------------------------- - -// Single inheritance with one base class - -#define _TYPEINFO_CLASSES(n , toString , fromString ) \ - wxClassTypeInfo s_typeInfo##n(wxT_OBJECT , &n::ms_classInfo , toString , fromString , typeid(n).name()) ; \ - wxClassTypeInfo s_typeInfoPtr##n(wxT_OBJECT_PTR , &n::ms_classInfo , toString , fromString , typeid(n*).name()) ; - -#define _IMPLEMENT_DYNAMIC_CLASS(name, basename, unit , callback) \ - wxObject* wxConstructorFor##name() \ -{ return new name; } \ - const wxClassInfo* name::ms_classParents[] = { &basename::ms_classInfo ,NULL } ; \ - wxObject* wxVariantOfPtrToObjectConverter##name ( wxxVariant &data ) { return data.wxTEMPLATED_MEMBER_CALL(Get , name*) ; } \ - wxxVariant wxObjectToVariantConverter##name ( wxObject *data ) { return wxxVariant( dynamic_cast (data) ) ; } \ - wxClassInfo name::ms_classInfo(name::ms_classParents , wxT(unit) , wxT(#name), \ - (int) sizeof(name), \ - (wxObjectConstructorFn) wxConstructorFor##name , \ - name::GetPropertiesStatic(),name::GetHandlersStatic(),name::ms_constructor , name::ms_constructorProperties , \ - name::ms_constructorPropertiesCount , wxVariantOfPtrToObjectConverter##name , NULL , wxObjectToVariantConverter##name , callback); - -#define _IMPLEMENT_DYNAMIC_CLASS_WITH_COPY(name, basename, unit, callback ) \ - wxObject* wxConstructorFor##name() \ -{ return new name; } \ - const wxClassInfo* name::ms_classParents[] = { &basename::ms_classInfo ,NULL } ; \ - wxObject* wxVariantToObjectConverter##name ( wxxVariant &data ) { return &data.wxTEMPLATED_MEMBER_CALL(Get , name) ; } \ - wxObject* wxVariantOfPtrToObjectConverter##name ( wxxVariant &data ) { return data.wxTEMPLATED_MEMBER_CALL(Get , name*) ; } \ - wxxVariant wxObjectToVariantConverter##name ( wxObject *data ) { return wxxVariant( dynamic_cast (data) ) ; } \ - wxClassInfo name::ms_classInfo(name::ms_classParents , wxT(unit) , wxT(#name), \ - (int) sizeof(name), \ - (wxObjectConstructorFn) wxConstructorFor##name , \ - name::GetPropertiesStatic(),name::GetHandlersStatic(),name::ms_constructor , name::ms_constructorProperties, \ - name::ms_constructorPropertiesCount , wxVariantOfPtrToObjectConverter##name , wxVariantToObjectConverter##name , wxObjectToVariantConverter##name, callback); - -#define IMPLEMENT_DYNAMIC_CLASS_WITH_COPY( name , basename ) \ - _IMPLEMENT_DYNAMIC_CLASS_WITH_COPY( name , basename , "" , NULL ) \ - _TYPEINFO_CLASSES(name, NULL , NULL) \ - const wxPropertyInfo *name::GetPropertiesStatic() { return (wxPropertyInfo*) NULL ; } \ - const wxHandlerInfo *name::GetHandlersStatic() { return (wxHandlerInfo*) NULL ; } \ - wxCONSTRUCTOR_DUMMY( name ) - -#define IMPLEMENT_DYNAMIC_CLASS( name , basename ) \ - _IMPLEMENT_DYNAMIC_CLASS( name , basename , "" , NULL ) \ - _TYPEINFO_CLASSES(name, NULL , NULL) \ - wxPropertyInfo *name::GetPropertiesStatic() { return (wxPropertyInfo*) NULL ; } \ - wxHandlerInfo *name::GetHandlersStatic() { return (wxHandlerInfo*) NULL ; } \ - wxCONSTRUCTOR_DUMMY( name ) - -#define IMPLEMENT_DYNAMIC_CLASS_XTI( name , basename , unit ) \ - _IMPLEMENT_DYNAMIC_CLASS( name , basename , unit , NULL ) \ - _TYPEINFO_CLASSES(name, NULL , NULL) - -#define IMPLEMENT_DYNAMIC_CLASS_XTI_CALLBACK( name , basename , unit , callback ) \ - _IMPLEMENT_DYNAMIC_CLASS( name , basename , unit , &callback ) \ - _TYPEINFO_CLASSES(name, NULL , NULL) - -#define IMPLEMENT_DYNAMIC_CLASS_WITH_COPY_XTI( name , basename , unit ) \ - _IMPLEMENT_DYNAMIC_CLASS_WITH_COPY( name , basename , unit , NULL ) \ - _TYPEINFO_CLASSES(name, NULL , NULL) - -#define IMPLEMENT_DYNAMIC_CLASS_WITH_COPY_AND_STREAMERS_XTI( name , basename , unit , toString , fromString ) \ - _IMPLEMENT_DYNAMIC_CLASS_WITH_COPY( name , basename , unit , NULL ) \ - _TYPEINFO_CLASSES(name, toString , fromString) - -// this is for classes that do not derive from wxobject, there are no creators for these - -#define IMPLEMENT_DYNAMIC_CLASS_NO_WXOBJECT_NO_BASE_XTI( name , unit ) \ - const wxClassInfo* name::ms_classParents[] = { NULL } ; \ - wxClassInfo name::ms_classInfo(name::ms_classParents , wxEmptyString , wxT(#name), \ - (int) sizeof(name), \ - (wxObjectConstructorFn) 0 , \ - name::GetPropertiesStatic(),name::GetHandlersStatic(),0 , 0 , \ - 0 , 0 , 0 ); \ - _TYPEINFO_CLASSES(name, NULL , NULL) - -// this is for subclasses that still do not derive from wxobject - -#define IMPLEMENT_DYNAMIC_CLASS_NO_WXOBJECT_XTI( name , basename, unit ) \ - const wxClassInfo* name::ms_classParents[] = { &basename::ms_classInfo ,NULL } ; \ - wxClassInfo name::ms_classInfo(name::ms_classParents , wxEmptyString , wxT(#name), \ - (int) sizeof(name), \ - (wxObjectConstructorFn) 0 , \ - name::GetPropertiesStatic(),name::GetHandlersStatic(),0 , 0 , \ - 0 , 0 , 0 ); \ - _TYPEINFO_CLASSES(name, NULL , NULL) - - -// Multiple inheritance with two base classes - -#define _IMPLEMENT_DYNAMIC_CLASS2(name, basename, basename2, unit) \ - wxObject* wxConstructorFor##name() \ -{ return new name; } \ - const wxClassInfo* name::ms_classParents[] = { &basename::ms_classInfo ,&basename2::ms_classInfo , NULL } ; \ - wxObject* wxVariantToObjectConverter##name ( wxxVariant &data ) { return data.wxTEMPLATED_MEMBER_CALL(Get , name*) ; } \ - wxxVariant wxObjectToVariantConverter##name ( wxObject *data ) { return wxxVariant( dynamic_cast (data) ) ; } \ - wxClassInfo name::ms_classInfo(name::ms_classParents , wxT(unit) , wxT(#name), \ - (int) sizeof(name), \ - (wxObjectConstructorFn) wxConstructorFor##name , \ - name::GetPropertiesStatic(),name::GetHandlersStatic(),name::ms_constructor , name::ms_constructorProperties , \ - name::ms_constructorPropertiesCount , wxVariantToObjectConverter##name, wxVariantToObjectConverter##name , wxObjectToVariantConverter##name); \ - -#define IMPLEMENT_DYNAMIC_CLASS2( name , basename , basename2) \ - _IMPLEMENT_DYNAMIC_CLASS2( name , basename , basename2 , "") \ - _TYPEINFO_CLASSES(name, NULL , NULL) \ - wxPropertyInfo *name::GetPropertiesStatic() { return (wxPropertyInfo*) NULL ; } \ - wxHandlerInfo *name::GetHandlersStatic() { return (wxHandlerInfo*) NULL ; } \ - wxCONSTRUCTOR_DUMMY( name ) - -#define IMPLEMENT_DYNAMIC_CLASS2_XTI( name , basename , basename2, unit) \ - _IMPLEMENT_DYNAMIC_CLASS2( name , basename , basename2 , unit) \ - _TYPEINFO_CLASSES(name, NULL , NULL) - - -// ----------------------------------- -// for abstract classes -// ----------------------------------- - -// Single inheritance with one base class - -#define _IMPLEMENT_ABSTRACT_CLASS(name, basename) \ - const wxClassInfo* name::ms_classParents[] = { &basename::ms_classInfo ,NULL } ; \ - wxObject* wxVariantToObjectConverter##name ( wxxVariant &data ) { return data.wxTEMPLATED_MEMBER_CALL(Get , name*) ; } \ - wxObject* wxVariantOfPtrToObjectConverter##name ( wxxVariant &data ) { return data.wxTEMPLATED_MEMBER_CALL(Get , name*) ; } \ - wxxVariant wxObjectToVariantConverter##name ( wxObject *data ) { return wxxVariant( dynamic_cast (data) ) ; } \ - wxClassInfo name::ms_classInfo(name::ms_classParents , wxEmptyString , wxT(#name), \ - (int) sizeof(name), \ - (wxObjectConstructorFn) 0 , \ - name::GetPropertiesStatic(),name::GetHandlersStatic(),0 , 0 , \ - 0 , wxVariantOfPtrToObjectConverter##name ,wxVariantToObjectConverter##name , wxObjectToVariantConverter##name); \ - _TYPEINFO_CLASSES(name, NULL , NULL) - -#define IMPLEMENT_ABSTRACT_CLASS( name , basename ) \ - _IMPLEMENT_ABSTRACT_CLASS( name , basename ) \ - wxHandlerInfo *name::GetHandlersStatic() { return (wxHandlerInfo*) NULL ; } \ - wxPropertyInfo *name::GetPropertiesStatic() { return (wxPropertyInfo*) NULL ; } - -// Multiple inheritance with two base classes - -#define IMPLEMENT_ABSTRACT_CLASS2(name, basename1, basename2) \ - wxClassInfo name::ms_classInfo(wxT(#name), wxT(#basename1), \ - wxT(#basename2), (int) sizeof(name), \ - (wxObjectConstructorFn) 0); - -#define IMPLEMENT_CLASS IMPLEMENT_ABSTRACT_CLASS -#define IMPLEMENT_CLASS2 IMPLEMENT_ABSTRACT_CLASS2 - -#define wxBEGIN_EVENT_TABLE( a , b ) BEGIN_EVENT_TABLE( a , b ) -#define wxEND_EVENT_TABLE() END_EVENT_TABLE() - -// -------------------------------------------------------------------------- -// Collection Support -// -------------------------------------------------------------------------- - -template void wxListCollectionToVariantArray( const collection_t& coll , wxxVariantArray &value ) -{ - iter current = coll.GetFirst() ; - while (current) - { - value.Add( new wxxVariant(current->GetData()) ) ; - current = current->GetNext(); - } -} - -template void wxArrayCollectionToVariantArray( const collection_t& coll , wxxVariantArray &value ) -{ - for( size_t i = 0 ; i < coll.GetCount() ; i++ ) - { - value.Add( new wxxVariant(coll[i]) ) ; - } -} - - -#endif // _WX_XTIH__ diff --git a/wxWidgets/include/wx/xtistrm.h b/wxWidgets/include/wx/xtistrm.h deleted file mode 100644 index 6bc902b4d5..0000000000 --- a/wxWidgets/include/wx/xtistrm.h +++ /dev/null @@ -1,429 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/xtistrm.h -// Purpose: streaming runtime metadata information (extended class info) -// Author: Stefan Csomor -// Modified by: -// Created: 27/07/03 -// RCS-ID: $Id: xtistrm.h 41020 2006-09-05 20:47:48Z VZ $ -// Copyright: (c) 2003 Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_XTISTRMH__ -#define _WX_XTISTRMH__ - -#include "wx/wx.h" - -#if wxUSE_EXTENDED_RTTI - -const int wxInvalidObjectID = -2 ; -const int wxNullObjectID = -3 ; - -// Filer contains the interfaces for streaming objects in and out of XML, -// rendering them either to objects in memory, or to code. Note: We -// consider the process of generating code to be one of *depersisting* the -// object from xml, *not* of persisting the object to code from an object -// in memory. This distincation can be confusing, and should be kept -// in mind when looking at the property streamers and callback interfaces -// listed below. - -/* -Main interfaces for streaming out objects. -*/ - -// ---------------------------------------------------------------------------- -// wxPersister -// -// This class will be asked during the streaming-out process about every single -// property or object instance. It can veto streaming out by returning false -// or modify the value before it is streamed-out. -// ---------------------------------------------------------------------------- - -class WXDLLIMPEXP_BASE wxWriter ; -class WXDLLIMPEXP_BASE wxReader ; - -class WXDLLIMPEXP_BASE wxPersister -{ -public : - // will be called before an object is written, may veto by returning false - virtual bool BeforeWriteObject( wxWriter *WXUNUSED(writer) , const wxObject *WXUNUSED(object) , const wxClassInfo *WXUNUSED(classInfo) , wxxVariantArray &WXUNUSED(metadata)) { return true ; } - - // will be called after this object has been written, may be needed for adjusting stacks - virtual void AfterWriteObject( wxWriter *WXUNUSED(writer) , const wxObject *WXUNUSED(object) , const wxClassInfo *WXUNUSED(classInfo) ) {} - - // will be called before a property gets written, may change the value , eg replace a concrete wxSize by wxSize( wxDefaultCoord , wxDefaultCoord ) or veto - // writing that property at all by returning false - virtual bool BeforeWriteProperty( wxWriter *WXUNUSED(writer) , const wxObject *WXUNUSED(object), const wxPropertyInfo *WXUNUSED(propInfo) , wxxVariant &WXUNUSED(value) ) { return true ; } - - // will be called before a property gets written, may change the value , eg replace a concrete wxSize by wxSize( wxDefaultCoord , wxDefaultCoord ) or veto - // writing that property at all by returning false - virtual bool BeforeWriteProperty( wxWriter *WXUNUSED(writer) , const wxObject *WXUNUSED(object), const wxPropertyInfo *WXUNUSED(propInfo) , wxxVariantArray &WXUNUSED(value) ) { return true ; } - - // will be called after a property has been written out, may be needed for adjusting stacks - virtual void AfterWriteProperty( wxWriter *WXUNUSED(writer) , const wxPropertyInfo *WXUNUSED(propInfo) ) {} - - // will be called before this delegate gets written - virtual bool BeforeWriteDelegate( wxWriter *WXUNUSED(writer) , const wxObject *WXUNUSED(object), const wxClassInfo* WXUNUSED(classInfo) , const wxPropertyInfo *WXUNUSED(propInfo) , - const wxObject *&WXUNUSED(eventSink) , const wxHandlerInfo* &WXUNUSED(handlerInfo) ) { return true ; } - - virtual void AfterWriteDelegate( wxWriter *WXUNUSED(writer) , const wxObject *WXUNUSED(object), const wxClassInfo* WXUNUSED(classInfo) , const wxPropertyInfo *WXUNUSED(propInfo) , - const wxObject *&WXUNUSED(eventSink) , const wxHandlerInfo* &WXUNUSED(handlerInfo) ) { } -} ; - -class WXDLLIMPEXP_BASE wxWriter : public wxObject -{ -public : - wxWriter() ; - virtual ~wxWriter() ; - - // with this call you start writing out a new top-level object - void WriteObject(const wxObject *object, const wxClassInfo *classInfo , wxPersister *persister , const wxString &name , wxxVariantArray &WXUNUSED(metadata)) ; - - // - // Managing the object identity table a.k.a context - // - // these methods make sure that no object gets written twice, because sometimes multiple calls to the WriteObject will be - // made without wanting to have duplicate objects written, the object identity table will be reset manually - - virtual void ClearObjectContext() ; - - // gets the object Id for a passed in object in the context - int GetObjectID(const wxObject *obj) ; - - // returns true if this object has already been written in this context - bool IsObjectKnown( const wxObject *obj ) ; - - // - // streaming callbacks - // - // these callbacks really write out the values in the stream format - - // begins writing out a new toplevel entry which has the indicated unique name - virtual void DoBeginWriteTopLevelEntry( const wxString &name ) = 0 ; - - // ends writing out a new toplevel entry which has the indicated unique name - virtual void DoEndWriteTopLevelEntry( const wxString &name ) = 0 ; - - // start of writing an object having the passed in ID - virtual void DoBeginWriteObject(const wxObject *object, const wxClassInfo *classInfo, int objectID , wxxVariantArray &metadata ) = 0 ; - - // end of writing an toplevel object name param is used for unique identification within the container - virtual void DoEndWriteObject(const wxObject *object, const wxClassInfo *classInfo, int objectID ) = 0 ; - - // writes a simple property in the stream format - virtual void DoWriteSimpleType( wxxVariant &value ) = 0 ; - - // start of writing a complex property into the stream ( - virtual void DoBeginWriteProperty( const wxPropertyInfo *propInfo ) = 0 ; - - // end of writing a complex property into the stream - virtual void DoEndWriteProperty( const wxPropertyInfo *propInfo ) = 0; - - virtual void DoBeginWriteElement() = 0 ; - virtual void DoEndWriteElement() = 0 ; - // insert an object reference to an already written object - virtual void DoWriteRepeatedObject( int objectID ) = 0 ; - - // insert a null reference - virtual void DoWriteNullObject() = 0 ; - - // writes a delegate in the stream format - virtual void DoWriteDelegate( const wxObject *object, const wxClassInfo* classInfo , const wxPropertyInfo *propInfo , - const wxObject *eventSink , int sinkObjectID , const wxClassInfo* eventSinkClassInfo , const wxHandlerInfo* handlerIndo ) = 0; -private : - - struct wxWriterInternal ; - wxWriterInternal* m_data ; - - struct wxWriterInternalPropertiesData ; - - void WriteAllProperties( const wxObject * obj , const wxClassInfo* ci , wxPersister *persister, wxWriterInternalPropertiesData * data ) ; - void WriteOneProperty( const wxObject *obj , const wxClassInfo* ci , const wxPropertyInfo* pi , wxPersister *persister , wxWriterInternalPropertiesData *data ) ; - void WriteObject(const wxObject *object, const wxClassInfo *classInfo , wxPersister *persister , bool isEmbedded, wxxVariantArray &metadata ) ; - void FindConnectEntry(const wxEvtHandler * evSource,const wxDelegateTypeInfo* dti, const wxObject* &sink , const wxHandlerInfo *&handler) ; -} ; - - -/* -Streaming callbacks for depersisting XML to code, or running objects -*/ - -class WXDLLIMPEXP_BASE wxDepersister ; - -/* -wxReader handles streaming in a class from a arbitrary format. While walking through -it issues calls out to interfaces to depersist the guts from the underlying storage format. -*/ - -class WXDLLIMPEXP_BASE wxReader : public wxObject -{ -public : - wxReader() ; - virtual ~wxReader() ; - - // the only thing wxReader knows about is the class info by object ID - wxClassInfo *GetObjectClassInfo(int objectID) ; - bool HasObjectClassInfo( int objectID ) ; - void SetObjectClassInfo(int objectID, wxClassInfo* classInfo); - - // Reads the component the reader is pointed at from the underlying format. - // The return value is the root object ID, which can - // then be used to ask the depersister about that object - // if there was a problem you will get back wxInvalidObjectID and the current - // error log will carry the problems encoutered - virtual int ReadObject( const wxString &name , wxDepersister *depersist ) = 0 ; - -private : - struct wxReaderInternal; - wxReaderInternal *m_data; -} ; - -// This abstract class matches the allocate-init/create model of creation of objects. -// At runtime, these will create actual instances, and manipulate them. -// When generating code, these will just create statements of C++ -// code to create the objects. - -class WXDLLIMPEXP_BASE wxDepersister -{ -public : - // allocate the new object on the heap, that object will have the passed in ID - virtual void AllocateObject(int objectID, wxClassInfo *classInfo, wxxVariantArray &metadata) = 0; - - // initialize the already allocated object having the ID objectID with the Create method - // creation parameters which are objects are having their Ids passed in objectIDValues - // having objectId <> wxInvalidObjectID - - virtual void CreateObject(int objectID, - const wxClassInfo *classInfo, - int paramCount, - wxxVariant *VariantValues , - int *objectIDValues , - const wxClassInfo **objectClassInfos , - wxxVariantArray &metadata) = 0; - - // construct the new object on the heap, that object will have the passed in ID (for objects that - // don't support allocate-create type of creation) - // creation parameters which are objects are having their Ids passed in objectIDValues - // having objectId <> wxInvalidObjectID - - virtual void ConstructObject(int objectID, - const wxClassInfo *classInfo, - int paramCount, - wxxVariant *VariantValues , - int *objectIDValues , - const wxClassInfo **objectClassInfos , - wxxVariantArray &metadata) = 0; - - // destroy the heap-allocated object having the ID objectID, this may be used if an object - // is embedded in another object and set via value semantics, so the intermediate - // object can be destroyed after safely - virtual void DestroyObject(int objectID, wxClassInfo *classInfo) = 0; - - // set the corresponding property - virtual void SetProperty(int objectID, - const wxClassInfo *classInfo, - const wxPropertyInfo* propertyInfo , - const wxxVariant &VariantValue) = 0; - - // sets the corresponding property (value is an object) - virtual void SetPropertyAsObject(int objectID, - const wxClassInfo *classInfo, - const wxPropertyInfo* propertyInfo , - int valueObjectId) = 0; - - // adds an element to a property collection - virtual void AddToPropertyCollection( int objectID , - const wxClassInfo *classInfo, - const wxPropertyInfo* propertyInfo , - const wxxVariant &VariantValue) = 0; - - // sets the corresponding property (value is an object) - virtual void AddToPropertyCollectionAsObject(int objectID, - const wxClassInfo *classInfo, - const wxPropertyInfo* propertyInfo , - int valueObjectId) = 0; - - // sets the corresponding event handler - virtual void SetConnect(int EventSourceObjectID, - const wxClassInfo *EventSourceClassInfo, - const wxPropertyInfo *delegateInfo , - const wxClassInfo *EventSinkClassInfo , - const wxHandlerInfo* handlerInfo , - int EventSinkObjectID ) = 0; -}; - -/* -wxRuntimeDepersister implements the callbacks that will depersist -an object into a running memory image, as opposed to writing -C++ initialization code to bring the object to life. -*/ - -class WXDLLIMPEXP_BASE wxRuntimeDepersister : public wxDepersister -{ - struct wxRuntimeDepersisterInternal ; - wxRuntimeDepersisterInternal * m_data ; -public : - wxRuntimeDepersister(); - virtual ~wxRuntimeDepersister(); - - // returns the object having the corresponding ID fully constructed - wxObject *GetObject(int objectID) ; - - // allocate the new object on the heap, that object will have the passed in ID - virtual void AllocateObject(int objectID, wxClassInfo *classInfo , - wxxVariantArray &metadata) ; - - // initialize the already allocated object having the ID objectID with the Create method - // creation parameters which are objects are having their Ids passed in objectIDValues - // having objectId <> wxInvalidObjectID - - virtual void CreateObject(int objectID, - const wxClassInfo *classInfo, - int paramCount, - wxxVariant *VariantValues , - int *objectIDValues, - const wxClassInfo **objectClassInfos , - wxxVariantArray &metadata - ) ; - - // construct the new object on the heap, that object will have the passed in ID (for objects that - // don't support allocate-create type of creation) - // creation parameters which are objects are having their Ids passed in objectIDValues - // having objectId <> wxInvalidObjectID - - virtual void ConstructObject(int objectID, - const wxClassInfo *classInfo, - int paramCount, - wxxVariant *VariantValues , - int *objectIDValues , - const wxClassInfo **objectClassInfos , - wxxVariantArray &metadata) ; - - // destroy the heap-allocated object having the ID objectID, this may be used if an object - // is embedded in another object and set via value semantics, so the intermediate - // object can be destroyed after safely - virtual void DestroyObject(int objectID, wxClassInfo *classInfo) ; - - // set the corresponding property - virtual void SetProperty(int objectID, - const wxClassInfo *classInfo, - const wxPropertyInfo* propertyInfo , - const wxxVariant &variantValue); - - // sets the corresponding property (value is an object) - virtual void SetPropertyAsObject(int objectId, - const wxClassInfo *classInfo, - const wxPropertyInfo* propertyInfo , - int valueObjectId) ; - - // adds an element to a property collection - virtual void AddToPropertyCollection( int objectID , - const wxClassInfo *classInfo, - const wxPropertyInfo* propertyInfo , - const wxxVariant &VariantValue) ; - - // sets the corresponding property (value is an object) - virtual void AddToPropertyCollectionAsObject(int objectID, - const wxClassInfo *classInfo, - const wxPropertyInfo* propertyInfo , - int valueObjectId) ; - - // sets the corresponding event handler - virtual void SetConnect(int eventSourceObjectID, - const wxClassInfo *eventSourceClassInfo, - const wxPropertyInfo *delegateInfo , - const wxClassInfo *eventSinkClassInfo , - const wxHandlerInfo* handlerInfo , - int eventSinkObjectID ) ; -}; - -/* -wxDepersisterCode implements the callbacks that will depersist -an object into a C++ initialization function. this will move to -a utility lib soon -*/ - -class WXDLLIMPEXP_BASE wxTextOutputStream ; - -class WXDLLIMPEXP_BASE wxCodeDepersister : public wxDepersister -{ -private : - struct wxCodeDepersisterInternal ; - wxCodeDepersisterInternal * m_data ; - wxTextOutputStream *m_fp; - wxString ValueAsCode( const wxxVariant ¶m ) ; -public: - wxCodeDepersister(wxTextOutputStream *out); - virtual ~wxCodeDepersister(); - - // allocate the new object on the heap, that object will have the passed in ID - virtual void AllocateObject(int objectID, wxClassInfo *classInfo , - wxxVariantArray &metadata) ; - - // initialize the already allocated object having the ID objectID with the Create method - // creation parameters which are objects are having their Ids passed in objectIDValues - // having objectId <> wxInvalidObjectID - - virtual void CreateObject(int objectID, - const wxClassInfo *classInfo, - int paramCount, - wxxVariant *variantValues , - int *objectIDValues, - const wxClassInfo **objectClassInfos , - wxxVariantArray &metadata - ) ; - - // construct the new object on the heap, that object will have the passed in ID (for objects that - // don't support allocate-create type of creation) - // creation parameters which are objects are having their Ids passed in objectIDValues - // having objectId <> wxInvalidObjectID - - virtual void ConstructObject(int objectID, - const wxClassInfo *classInfo, - int paramCount, - wxxVariant *VariantValues , - int *objectIDValues , - const wxClassInfo **objectClassInfos , - wxxVariantArray &metadata) ; - - // destroy the heap-allocated object having the ID objectID, this may be used if an object - // is embedded in another object and set via value semantics, so the intermediate - // object can be destroyed after safely - virtual void DestroyObject(int objectID, wxClassInfo *classInfo) ; - - // set the corresponding property - virtual void SetProperty(int objectID, - const wxClassInfo *classInfo, - const wxPropertyInfo* propertyInfo , - const wxxVariant &variantValue); - - // sets the corresponding property (value is an object) - virtual void SetPropertyAsObject(int objectId, - const wxClassInfo *classInfo, - const wxPropertyInfo* propertyInfo , - int valueObjectId) ; - - // adds an element to a property collection - virtual void AddToPropertyCollection( int objectID , - const wxClassInfo *classInfo, - const wxPropertyInfo* propertyInfo , - const wxxVariant &VariantValue) ; - - // sets the corresponding property (value is an object) - virtual void AddToPropertyCollectionAsObject(int objectID, - const wxClassInfo *classInfo, - const wxPropertyInfo* propertyInfo , - int valueObjectId) ; - - // sets the corresponding event handler - virtual void SetConnect(int eventSourceObjectID, - const wxClassInfo *eventSourceClassInfo, - const wxPropertyInfo *delegateInfo , - const wxClassInfo *eventSinkClassInfo , - const wxHandlerInfo* handlerInfo , - int eventSinkObjectID ) ; -}; - -#endif // wxUSE_EXTENDED_RTTI - -#endif diff --git a/wxWidgets/include/wx/xtixml.h b/wxWidgets/include/wx/xtixml.h deleted file mode 100644 index 92407dae29..0000000000 --- a/wxWidgets/include/wx/xtixml.h +++ /dev/null @@ -1,106 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/xtixml.h -// Purpose: xml streaming runtime metadata information (extended class info) -// Author: Stefan Csomor -// Modified by: -// Created: 27/07/03 -// RCS-ID: $Id: xtixml.h 41020 2006-09-05 20:47:48Z VZ $ -// Copyright: (c) 2003 Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_XTIXMLH__ -#define _WX_XTIXMLH__ - -#include "wx/wx.h" - -#if wxUSE_EXTENDED_RTTI - -#include "wx/xtistrm.h" - -class WXDLLIMPEXP_XML wxXmlNode ; - -class WXDLLIMPEXP_XML wxXmlWriter : public wxWriter -{ -public : - - wxXmlWriter( wxXmlNode * parent ) ; - virtual ~wxXmlWriter() ; - - // - // streaming callbacks - // - // these callbacks really write out the values in the stream format - // - - // - // streaming callbacks - // - // these callbacks really write out the values in the stream format - - // begins writing out a new toplevel entry which has the indicated unique name - virtual void DoBeginWriteTopLevelEntry( const wxString &name ) ; - - // ends writing out a new toplevel entry which has the indicated unique name - virtual void DoEndWriteTopLevelEntry( const wxString &name ) ; - - // start of writing an object having the passed in ID - virtual void DoBeginWriteObject(const wxObject *object, const wxClassInfo *classInfo, int objectID , wxxVariantArray &metadata ) ; - - // end of writing an toplevel object name param is used for unique identification within the container - virtual void DoEndWriteObject(const wxObject *object, const wxClassInfo *classInfo, int objectID ) ; - - // writes a simple property in the stream format - virtual void DoWriteSimpleType( wxxVariant &value ) ; - - // start of writing a complex property into the stream ( - virtual void DoBeginWriteProperty( const wxPropertyInfo *propInfo ) ; - - // end of writing a complex property into the stream - virtual void DoEndWriteProperty( const wxPropertyInfo *propInfo ) ; - - virtual void DoBeginWriteElement() ; - virtual void DoEndWriteElement() ; - - // insert an object reference to an already written object - virtual void DoWriteRepeatedObject( int objectID ) ; - - // insert a null reference - virtual void DoWriteNullObject() ; - - // writes a delegate in the stream format - virtual void DoWriteDelegate( const wxObject *object, const wxClassInfo* classInfo , const wxPropertyInfo *propInfo , - const wxObject *eventSink , int sinkObjectID , const wxClassInfo* eventSinkClassInfo , const wxHandlerInfo* handlerIndo ) ; -private : - struct wxXmlWriterInternal ; - wxXmlWriterInternal* m_data ; -} ; - -/* -wxXmlReader handles streaming in a class from XML -*/ - -class WXDLLIMPEXP_XML wxXmlReader : public wxReader -{ -public: - wxXmlReader(wxXmlNode *parent) { m_parent = parent ; } - virtual ~wxXmlReader() {} - - // Reads a component from XML. The return value is the root object ID, which can - // then be used to ask the depersister about that object - - virtual int ReadObject( const wxString &name , wxDepersister *depersist ) ; - -private : - int ReadComponent(wxXmlNode *parent, wxDepersister *callbacks); - - // read the content of this node (simple type) and return the corresponding value - wxxVariant ReadValue(wxXmlNode *Node, - const wxTypeInfo *type ); - - wxXmlNode * m_parent ; -}; - -#endif // wxUSE_EXTENDED_RTTI - -#endif diff --git a/wxWidgets/include/wx/zipstrm.h b/wxWidgets/include/wx/zipstrm.h deleted file mode 100644 index 77766a9811..0000000000 --- a/wxWidgets/include/wx/zipstrm.h +++ /dev/null @@ -1,574 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/zipstrm.h -// Purpose: Streams for Zip files -// Author: Mike Wetherell -// RCS-ID: $Id: zipstrm.h 53135 2008-04-12 02:31:04Z VZ $ -// Copyright: (c) Mike Wetherell -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_WXZIPSTREAM_H__ -#define _WX_WXZIPSTREAM_H__ - -#include "wx/defs.h" - -#if wxUSE_ZIPSTREAM - -#include "wx/archive.h" -#include "wx/filename.h" - -// some methods from wxZipInputStream and wxZipOutputStream stream do not get -// exported/imported when compiled with Mingw versions before 3.4.2. So they -// are imported/exported individually as a workaround -#if (defined(__GNUWIN32__) || defined(__MINGW32__)) \ - && (!defined __GNUC__ \ - || !defined __GNUC_MINOR__ \ - || !defined __GNUC_PATCHLEVEL__ \ - || __GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__ < 30402) -#define WXZIPFIX WXDLLIMPEXP_BASE -#else -#define WXZIPFIX -#endif - -///////////////////////////////////////////////////////////////////////////// -// constants - -// Compression Method, only 0 (store) and 8 (deflate) are supported here -// -enum wxZipMethod -{ - wxZIP_METHOD_STORE, - wxZIP_METHOD_SHRINK, - wxZIP_METHOD_REDUCE1, - wxZIP_METHOD_REDUCE2, - wxZIP_METHOD_REDUCE3, - wxZIP_METHOD_REDUCE4, - wxZIP_METHOD_IMPLODE, - wxZIP_METHOD_TOKENIZE, - wxZIP_METHOD_DEFLATE, - wxZIP_METHOD_DEFLATE64, - wxZIP_METHOD_BZIP2 = 12, - wxZIP_METHOD_DEFAULT = 0xffff -}; - -// Originating File-System. -// -// These are Pkware's values. Note that Info-zip disagree on some of them, -// most notably NTFS. -// -enum wxZipSystem -{ - wxZIP_SYSTEM_MSDOS, - wxZIP_SYSTEM_AMIGA, - wxZIP_SYSTEM_OPENVMS, - wxZIP_SYSTEM_UNIX, - wxZIP_SYSTEM_VM_CMS, - wxZIP_SYSTEM_ATARI_ST, - wxZIP_SYSTEM_OS2_HPFS, - wxZIP_SYSTEM_MACINTOSH, - wxZIP_SYSTEM_Z_SYSTEM, - wxZIP_SYSTEM_CPM, - wxZIP_SYSTEM_WINDOWS_NTFS, - wxZIP_SYSTEM_MVS, - wxZIP_SYSTEM_VSE, - wxZIP_SYSTEM_ACORN_RISC, - wxZIP_SYSTEM_VFAT, - wxZIP_SYSTEM_ALTERNATE_MVS, - wxZIP_SYSTEM_BEOS, - wxZIP_SYSTEM_TANDEM, - wxZIP_SYSTEM_OS_400 -}; - -// Dos/Win file attributes -// -enum wxZipAttributes -{ - wxZIP_A_RDONLY = 0x01, - wxZIP_A_HIDDEN = 0x02, - wxZIP_A_SYSTEM = 0x04, - wxZIP_A_SUBDIR = 0x10, - wxZIP_A_ARCH = 0x20, - - wxZIP_A_MASK = 0x37 -}; - -// Values for the flags field in the zip headers -// -enum wxZipFlags -{ - wxZIP_ENCRYPTED = 0x0001, - wxZIP_DEFLATE_NORMAL = 0x0000, // normal compression - wxZIP_DEFLATE_EXTRA = 0x0002, // extra compression - wxZIP_DEFLATE_FAST = 0x0004, // fast compression - wxZIP_DEFLATE_SUPERFAST = 0x0006, // superfast compression - wxZIP_DEFLATE_MASK = 0x0006, - wxZIP_SUMS_FOLLOW = 0x0008, // crc and sizes come after the data - wxZIP_ENHANCED = 0x0010, - wxZIP_PATCH = 0x0020, - wxZIP_STRONG_ENC = 0x0040, - wxZIP_UNUSED = 0x0F80, - wxZIP_RESERVED = 0xF000 -}; - -// Forward decls -// -class WXDLLIMPEXP_FWD_BASE wxZipEntry; -class WXDLLIMPEXP_FWD_BASE wxZipInputStream; - - -///////////////////////////////////////////////////////////////////////////// -// wxZipNotifier - -class WXDLLIMPEXP_BASE wxZipNotifier -{ -public: - virtual ~wxZipNotifier() { } - - virtual void OnEntryUpdated(wxZipEntry& entry) = 0; -}; - - -///////////////////////////////////////////////////////////////////////////// -// Zip Entry - holds the meta data for a file in the zip - -class WXDLLIMPEXP_BASE wxZipEntry : public wxArchiveEntry -{ -public: - wxZipEntry(const wxString& name = wxEmptyString, - const wxDateTime& dt = wxDateTime::Now(), - wxFileOffset size = wxInvalidOffset); - virtual ~wxZipEntry(); - - wxZipEntry(const wxZipEntry& entry); - wxZipEntry& operator=(const wxZipEntry& entry); - - // Get accessors - wxDateTime GetDateTime() const { return m_DateTime; } - wxFileOffset GetSize() const { return m_Size; } - wxFileOffset GetOffset() const { return m_Offset; } - wxString GetInternalName() const { return m_Name; } - int GetMethod() const { return m_Method; } - int GetFlags() const { return m_Flags; } - wxUint32 GetCrc() const { return m_Crc; } - wxFileOffset GetCompressedSize() const { return m_CompressedSize; } - int GetSystemMadeBy() const { return m_SystemMadeBy; } - wxString GetComment() const { return m_Comment; } - wxUint32 GetExternalAttributes() const { return m_ExternalAttributes; } - wxPathFormat GetInternalFormat() const { return wxPATH_UNIX; } - int GetMode() const; - const char *GetLocalExtra() const; - size_t GetLocalExtraLen() const; - const char *GetExtra() const; - size_t GetExtraLen() const; - wxString GetName(wxPathFormat format = wxPATH_NATIVE) const; - - // is accessors - inline bool IsDir() const; - inline bool IsText() const; - inline bool IsReadOnly() const; - inline bool IsMadeByUnix() const; - - // set accessors - void SetDateTime(const wxDateTime& dt) { m_DateTime = dt; } - void SetSize(wxFileOffset size) { m_Size = size; } - void SetMethod(int method) { m_Method = (wxUint16)method; } - void SetComment(const wxString& comment) { m_Comment = comment; } - void SetExternalAttributes(wxUint32 attr ) { m_ExternalAttributes = attr; } - void SetSystemMadeBy(int system); - void SetMode(int mode); - void SetExtra(const char *extra, size_t len); - void SetLocalExtra(const char *extra, size_t len); - - inline void SetName(const wxString& name, - wxPathFormat format = wxPATH_NATIVE); - - static wxString GetInternalName(const wxString& name, - wxPathFormat format = wxPATH_NATIVE, - bool *pIsDir = NULL); - - // set is accessors - void SetIsDir(bool isDir = true); - inline void SetIsReadOnly(bool isReadOnly = true); - inline void SetIsText(bool isText = true); - - wxZipEntry *Clone() const { return ZipClone(); } - - void SetNotifier(wxZipNotifier& notifier); - void UnsetNotifier(); - -protected: - // Internal attributes - enum { TEXT_ATTR = 1 }; - - // protected Get accessors - int GetVersionNeeded() const { return m_VersionNeeded; } - wxFileOffset GetKey() const { return m_Key; } - int GetVersionMadeBy() const { return m_VersionMadeBy; } - int GetDiskStart() const { return m_DiskStart; } - int GetInternalAttributes() const { return m_InternalAttributes; } - - void SetVersionNeeded(int version) { m_VersionNeeded = (wxUint16)version; } - void SetOffset(wxFileOffset offset) { m_Offset = offset; } - void SetFlags(int flags) { m_Flags = (wxUint16)flags; } - void SetVersionMadeBy(int version) { m_VersionMadeBy = (wxUint8)version; } - void SetCrc(wxUint32 crc) { m_Crc = crc; } - void SetCompressedSize(wxFileOffset size) { m_CompressedSize = size; } - void SetKey(wxFileOffset offset) { m_Key = offset; } - void SetDiskStart(int start) { m_DiskStart = (wxUint16)start; } - void SetInternalAttributes(int attr) { m_InternalAttributes = (wxUint16)attr; } - - virtual wxZipEntry *ZipClone() const { return new wxZipEntry(*this); } - - void Notify(); - -private: - wxArchiveEntry* DoClone() const { return ZipClone(); } - - size_t ReadLocal(wxInputStream& stream, wxMBConv& conv); - size_t WriteLocal(wxOutputStream& stream, wxMBConv& conv) const; - - size_t ReadCentral(wxInputStream& stream, wxMBConv& conv); - size_t WriteCentral(wxOutputStream& stream, wxMBConv& conv) const; - - size_t ReadDescriptor(wxInputStream& stream); - size_t WriteDescriptor(wxOutputStream& stream, wxUint32 crc, - wxFileOffset compressedSize, wxFileOffset size); - - wxUint8 m_SystemMadeBy; // one of enum wxZipSystem - wxUint8 m_VersionMadeBy; // major * 10 + minor - - wxUint16 m_VersionNeeded; // ver needed to extract (20 i.e. v2.0) - wxUint16 m_Flags; - wxUint16 m_Method; // compression method (one of wxZipMethod) - wxDateTime m_DateTime; - wxUint32 m_Crc; - wxFileOffset m_CompressedSize; - wxFileOffset m_Size; - wxString m_Name; // in internal format - wxFileOffset m_Key; // the original offset for copied entries - wxFileOffset m_Offset; // file offset of the entry - - wxString m_Comment; - wxUint16 m_DiskStart; // for multidisk archives, not unsupported - wxUint16 m_InternalAttributes; // bit 0 set for text files - wxUint32 m_ExternalAttributes; // system specific depends on SystemMadeBy - - class wxZipMemory *m_Extra; - class wxZipMemory *m_LocalExtra; - - wxZipNotifier *m_zipnotifier; - class wxZipWeakLinks *m_backlink; - - friend class wxZipInputStream; - friend class wxZipOutputStream; - - DECLARE_DYNAMIC_CLASS(wxZipEntry) -}; - - -///////////////////////////////////////////////////////////////////////////// -// wxZipOutputStream - -WX_DECLARE_LIST_WITH_DECL(wxZipEntry, wxZipEntryList_, class WXDLLIMPEXP_BASE); - -class WXDLLIMPEXP_BASE wxZipOutputStream : public wxArchiveOutputStream -{ -public: - wxZipOutputStream(wxOutputStream& stream, - int level = -1, - wxMBConv& conv = wxConvLocal); - wxZipOutputStream(wxOutputStream *stream, - int level = -1, - wxMBConv& conv = wxConvLocal); - virtual WXZIPFIX ~wxZipOutputStream(); - - bool PutNextEntry(wxZipEntry *entry) { return DoCreate(entry); } - - bool WXZIPFIX PutNextEntry(const wxString& name, - const wxDateTime& dt = wxDateTime::Now(), - wxFileOffset size = wxInvalidOffset); - - bool WXZIPFIX PutNextDirEntry(const wxString& name, - const wxDateTime& dt = wxDateTime::Now()); - - bool WXZIPFIX CopyEntry(wxZipEntry *entry, wxZipInputStream& inputStream); - bool WXZIPFIX CopyArchiveMetaData(wxZipInputStream& inputStream); - - void WXZIPFIX Sync(); - bool WXZIPFIX CloseEntry(); - bool WXZIPFIX Close(); - - void SetComment(const wxString& comment) { m_Comment = comment; } - - int GetLevel() const { return m_level; } - void WXZIPFIX SetLevel(int level); - -protected: - virtual size_t WXZIPFIX OnSysWrite(const void *buffer, size_t size); - virtual wxFileOffset OnSysTell() const { return m_entrySize; } - - // this protected interface isn't yet finalised - struct Buffer { const char *m_data; size_t m_size; }; - virtual wxOutputStream* WXZIPFIX OpenCompressor(wxOutputStream& stream, - wxZipEntry& entry, - const Buffer bufs[]); - virtual bool WXZIPFIX CloseCompressor(wxOutputStream *comp); - - bool IsParentSeekable() const - { return m_offsetAdjustment != wxInvalidOffset; } - -private: - void Init(int level); - - bool WXZIPFIX PutNextEntry(wxArchiveEntry *entry); - bool WXZIPFIX CopyEntry(wxArchiveEntry *entry, wxArchiveInputStream& stream); - bool WXZIPFIX CopyArchiveMetaData(wxArchiveInputStream& stream); - - bool IsOpened() const { return m_comp || m_pending; } - - bool DoCreate(wxZipEntry *entry, bool raw = false); - void CreatePendingEntry(const void *buffer, size_t size); - void CreatePendingEntry(); - - class wxStoredOutputStream *m_store; - class wxZlibOutputStream2 *m_deflate; - class wxZipStreamLink *m_backlink; - wxZipEntryList_ m_entries; - char *m_initialData; - size_t m_initialSize; - wxZipEntry *m_pending; - bool m_raw; - wxFileOffset m_headerOffset; - size_t m_headerSize; - wxFileOffset m_entrySize; - wxUint32 m_crcAccumulator; - wxOutputStream *m_comp; - int m_level; - wxFileOffset m_offsetAdjustment; - wxString m_Comment; - - DECLARE_NO_COPY_CLASS(wxZipOutputStream) -}; - - -///////////////////////////////////////////////////////////////////////////// -// wxZipInputStream - -class WXDLLIMPEXP_BASE wxZipInputStream : public wxArchiveInputStream -{ -public: - typedef wxZipEntry entry_type; - - wxZipInputStream(wxInputStream& stream, wxMBConv& conv = wxConvLocal); - wxZipInputStream(wxInputStream *stream, wxMBConv& conv = wxConvLocal); - -#if WXWIN_COMPATIBILITY_2_6 && wxUSE_FFILE - wxZipInputStream(const wxString& archive, const wxString& file) - : wxArchiveInputStream(OpenFile(archive), wxConvLocal) { Init(file); } -#endif - - virtual WXZIPFIX ~wxZipInputStream(); - - bool OpenEntry(wxZipEntry& entry) { return DoOpen(&entry); } - bool WXZIPFIX CloseEntry(); - - wxZipEntry *GetNextEntry(); - - wxString WXZIPFIX GetComment(); - int WXZIPFIX GetTotalEntries(); - - virtual wxFileOffset GetLength() const { return m_entry.GetSize(); } - -protected: - size_t WXZIPFIX OnSysRead(void *buffer, size_t size); - wxFileOffset OnSysTell() const { return m_decomp ? m_decomp->TellI() : 0; } - -#if WXWIN_COMPATIBILITY_2_6 - wxFileOffset WXZIPFIX OnSysSeek(wxFileOffset seek, wxSeekMode mode); -#endif - - // this protected interface isn't yet finalised - virtual wxInputStream* WXZIPFIX OpenDecompressor(wxInputStream& stream); - virtual bool WXZIPFIX CloseDecompressor(wxInputStream *decomp); - -private: - void Init(); - void Init(const wxString& file); -#if WXWIN_COMPATIBILITY_2_6 && wxUSE_FFILE - static wxInputStream *OpenFile(const wxString& archive); -#endif - - wxArchiveEntry *DoGetNextEntry() { return GetNextEntry(); } - - bool WXZIPFIX OpenEntry(wxArchiveEntry& entry); - - wxStreamError ReadLocal(bool readEndRec = false); - wxStreamError ReadCentral(); - - wxUint32 ReadSignature(); - bool FindEndRecord(); - bool LoadEndRecord(); - - bool AtHeader() const { return m_headerSize == 0; } - bool AfterHeader() const { return m_headerSize > 0 && !m_decomp; } - bool IsOpened() const { return m_decomp != NULL; } - - wxZipStreamLink *MakeLink(wxZipOutputStream *out); - - bool DoOpen(wxZipEntry *entry = NULL, bool raw = false); - bool OpenDecompressor(bool raw = false); - - class wxStoredInputStream *m_store; - class wxZlibInputStream2 *m_inflate; - class wxRawInputStream *m_rawin; - wxZipEntry m_entry; - bool m_raw; - size_t m_headerSize; - wxUint32 m_crcAccumulator; - wxInputStream *m_decomp; - bool m_parentSeekable; - class wxZipWeakLinks *m_weaklinks; - class wxZipStreamLink *m_streamlink; - wxFileOffset m_offsetAdjustment; - wxFileOffset m_position; - wxUint32 m_signature; - size_t m_TotalEntries; - wxString m_Comment; - - friend bool wxZipOutputStream::CopyEntry( - wxZipEntry *entry, wxZipInputStream& inputStream); - friend bool wxZipOutputStream::CopyArchiveMetaData( - wxZipInputStream& inputStream); - -#if WXWIN_COMPATIBILITY_2_6 - bool m_allowSeeking; - friend class wxArchiveFSHandler; -#endif - - DECLARE_NO_COPY_CLASS(wxZipInputStream) -}; - - -///////////////////////////////////////////////////////////////////////////// -// Iterators - -#if wxUSE_STL || defined WX_TEST_ARCHIVE_ITERATOR -typedef wxArchiveIterator wxZipIter; -typedef wxArchiveIterator > wxZipPairIter; -#endif - - -///////////////////////////////////////////////////////////////////////////// -// wxZipClassFactory - -class WXDLLIMPEXP_BASE wxZipClassFactory : public wxArchiveClassFactory -{ -public: - typedef wxZipEntry entry_type; - typedef wxZipInputStream instream_type; - typedef wxZipOutputStream outstream_type; - typedef wxZipNotifier notifier_type; -#if wxUSE_STL || defined WX_TEST_ARCHIVE_ITERATOR - typedef wxZipIter iter_type; - typedef wxZipPairIter pairiter_type; -#endif - - wxZipClassFactory(); - - wxZipEntry *NewEntry() const - { return new wxZipEntry; } - wxZipInputStream *NewStream(wxInputStream& stream) const - { return new wxZipInputStream(stream, GetConv()); } - wxZipOutputStream *NewStream(wxOutputStream& stream) const - { return new wxZipOutputStream(stream, -1, GetConv()); } - wxZipInputStream *NewStream(wxInputStream *stream) const - { return new wxZipInputStream(stream, GetConv()); } - wxZipOutputStream *NewStream(wxOutputStream *stream) const - { return new wxZipOutputStream(stream, -1, GetConv()); } - - wxString GetInternalName(const wxString& name, - wxPathFormat format = wxPATH_NATIVE) const - { return wxZipEntry::GetInternalName(name, format); } - - const wxChar * const *GetProtocols(wxStreamProtocolType type - = wxSTREAM_PROTOCOL) const; - -protected: - wxArchiveEntry *DoNewEntry() const - { return NewEntry(); } - wxArchiveInputStream *DoNewStream(wxInputStream& stream) const - { return NewStream(stream); } - wxArchiveOutputStream *DoNewStream(wxOutputStream& stream) const - { return NewStream(stream); } - wxArchiveInputStream *DoNewStream(wxInputStream *stream) const - { return NewStream(stream); } - wxArchiveOutputStream *DoNewStream(wxOutputStream *stream) const - { return NewStream(stream); } - -private: - DECLARE_DYNAMIC_CLASS(wxZipClassFactory) -}; - - -///////////////////////////////////////////////////////////////////////////// -// wxZipEntry inlines - -inline bool wxZipEntry::IsText() const -{ - return (m_InternalAttributes & TEXT_ATTR) != 0; -} - -inline bool wxZipEntry::IsDir() const -{ - return (m_ExternalAttributes & wxZIP_A_SUBDIR) != 0; -} - -inline bool wxZipEntry::IsReadOnly() const -{ - return (m_ExternalAttributes & wxZIP_A_RDONLY) != 0; -} - -inline bool wxZipEntry::IsMadeByUnix() const -{ - const int pattern = - (1 << wxZIP_SYSTEM_OPENVMS) | - (1 << wxZIP_SYSTEM_UNIX) | - (1 << wxZIP_SYSTEM_ATARI_ST) | - (1 << wxZIP_SYSTEM_ACORN_RISC) | - (1 << wxZIP_SYSTEM_BEOS) | (1 << wxZIP_SYSTEM_TANDEM); - - // note: some unix zippers put madeby = dos - return (m_SystemMadeBy == wxZIP_SYSTEM_MSDOS - && (m_ExternalAttributes & ~0xFFFF)) - || ((pattern >> m_SystemMadeBy) & 1); -} - -inline void wxZipEntry::SetIsText(bool isText) -{ - if (isText) - m_InternalAttributes |= TEXT_ATTR; - else - m_InternalAttributes &= ~TEXT_ATTR; -} - -inline void wxZipEntry::SetIsReadOnly(bool isReadOnly) -{ - if (isReadOnly) - SetMode(GetMode() & ~0222); - else - SetMode(GetMode() | 0200); -} - -inline void wxZipEntry::SetName(const wxString& name, - wxPathFormat format /*=wxPATH_NATIVE*/) -{ - bool isDir; - m_Name = GetInternalName(name, format, &isDir); - SetIsDir(isDir); -} - - -#endif // wxUSE_ZIPSTREAM - -#endif // _WX_WXZIPSTREAM_H__ diff --git a/wxWidgets/include/wx/zstream.h b/wxWidgets/include/wx/zstream.h deleted file mode 100644 index 8f70513124..0000000000 --- a/wxWidgets/include/wx/zstream.h +++ /dev/null @@ -1,146 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/zstream.h -// Purpose: Memory stream classes -// Author: Guilhem Lavaux -// Modified by: Mike Wetherell -// Created: 11/07/98 -// RCS-ID: $Id: zstream.h 54688 2008-07-18 08:06:44Z MW $ -// Copyright: (c) Guilhem Lavaux -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// -#ifndef _WX_WXZSTREAM_H__ -#define _WX_WXZSTREAM_H__ - -#include "wx/defs.h" - -#if wxUSE_ZLIB && wxUSE_STREAMS - -#include "wx/stream.h" - -// Compression level -enum { - wxZ_DEFAULT_COMPRESSION = -1, - wxZ_NO_COMPRESSION = 0, - wxZ_BEST_SPEED = 1, - wxZ_BEST_COMPRESSION = 9 -}; - -// Flags -enum { -#if WXWIN_COMPATIBILITY_2_4 - wxZLIB_24COMPATIBLE = 4, // read v2.4.x data without error -#endif - wxZLIB_NO_HEADER = 0, // raw deflate stream, no header or checksum - wxZLIB_ZLIB = 1, // zlib header and checksum - wxZLIB_GZIP = 2, // gzip header and checksum, requires zlib 1.2.1+ - wxZLIB_AUTO = 3 // autodetect header zlib or gzip -}; - -class WXDLLIMPEXP_BASE wxZlibInputStream: public wxFilterInputStream { - public: - wxZlibInputStream(wxInputStream& stream, int flags = wxZLIB_AUTO); - wxZlibInputStream(wxInputStream *stream, int flags = wxZLIB_AUTO); - virtual ~wxZlibInputStream(); - - char Peek() { return wxInputStream::Peek(); } - wxFileOffset GetLength() const { return wxInputStream::GetLength(); } - - static bool CanHandleGZip(); - - protected: - size_t OnSysRead(void *buffer, size_t size); - wxFileOffset OnSysTell() const { return m_pos; } - - private: - void Init(int flags); - - protected: - size_t m_z_size; - unsigned char *m_z_buffer; - struct z_stream_s *m_inflate; - wxFileOffset m_pos; -#if WXWIN_COMPATIBILITY_2_4 - bool m_24compatibilty; -#endif - - DECLARE_NO_COPY_CLASS(wxZlibInputStream) -}; - -class WXDLLIMPEXP_BASE wxZlibOutputStream: public wxFilterOutputStream { - public: - wxZlibOutputStream(wxOutputStream& stream, int level = -1, int flags = wxZLIB_ZLIB); - wxZlibOutputStream(wxOutputStream *stream, int level = -1, int flags = wxZLIB_ZLIB); - virtual ~wxZlibOutputStream() { Close(); } - - void Sync() { DoFlush(false); } - bool Close(); - wxFileOffset GetLength() const { return m_pos; } - - static bool CanHandleGZip(); - - protected: - size_t OnSysWrite(const void *buffer, size_t size); - wxFileOffset OnSysTell() const { return m_pos; } - - virtual void DoFlush(bool final); - - private: - void Init(int level, int flags); - - protected: - size_t m_z_size; - unsigned char *m_z_buffer; - struct z_stream_s *m_deflate; - wxFileOffset m_pos; - - DECLARE_NO_COPY_CLASS(wxZlibOutputStream) -}; - -class WXDLLIMPEXP_BASE wxZlibClassFactory: public wxFilterClassFactory -{ -public: - wxZlibClassFactory(); - - wxFilterInputStream *NewStream(wxInputStream& stream) const - { return new wxZlibInputStream(stream); } - wxFilterOutputStream *NewStream(wxOutputStream& stream) const - { return new wxZlibOutputStream(stream, -1); } - wxFilterInputStream *NewStream(wxInputStream *stream) const - { return new wxZlibInputStream(stream); } - wxFilterOutputStream *NewStream(wxOutputStream *stream) const - { return new wxZlibOutputStream(stream, -1); } - - const wxChar * const *GetProtocols(wxStreamProtocolType type - = wxSTREAM_PROTOCOL) const; - -private: - DECLARE_DYNAMIC_CLASS(wxZlibClassFactory) -}; - -class WXDLLIMPEXP_BASE wxGzipClassFactory: public wxFilterClassFactory -{ -public: - wxGzipClassFactory(); - - wxFilterInputStream *NewStream(wxInputStream& stream) const - { return new wxZlibInputStream(stream); } - wxFilterOutputStream *NewStream(wxOutputStream& stream) const - { return new wxZlibOutputStream(stream, -1, wxZLIB_GZIP); } - wxFilterInputStream *NewStream(wxInputStream *stream) const - { return new wxZlibInputStream(stream); } - wxFilterOutputStream *NewStream(wxOutputStream *stream) const - { return new wxZlibOutputStream(stream, -1, wxZLIB_GZIP); } - - const wxChar * const *GetProtocols(wxStreamProtocolType type - = wxSTREAM_PROTOCOL) const; - -private: - DECLARE_DYNAMIC_CLASS(wxGzipClassFactory) -}; - -#endif - // wxUSE_ZLIB && wxUSE_STREAMS - -#endif - // _WX_WXZSTREAM_H__ - diff --git a/wxWidgets/include/wx_pb.h b/wxWidgets/include/wx_pb.h deleted file mode 100644 index e05c1d43fe..0000000000 --- a/wxWidgets/include/wx_pb.h +++ /dev/null @@ -1,20 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: wx_pb.h -// Purpose: Project Builder precompiled header -// Author: Gilles Depeyrot -// Modified by: -// Created: 22.01.02 -// RCS-ID: $Id: wx_pb.h 27433 2004-05-25 17:31:17Z JS $ -// Copyright: (c) wxWidgets team -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#define HAVE_USLEEP 1 -#define HAVE_FCNTL 1 -#define SIZEOF_INT 4 -#define SIZEOF_WCHAR_T 4 -#define TARGET_CARBON 1 -#define HAVE_WCHAR_H 1 -#define HAVE_WPRINTF 1 -#define HAVE_VSWPRINTF 1 -#define HAVE_STRCASECMP_IN_STRING_H 1 diff --git a/wxWidgets/src/Wxwindll.icc b/wxWidgets/src/Wxwindll.icc deleted file mode 100644 index 21a2eebb0f..0000000000 --- a/wxWidgets/src/Wxwindll.icc +++ /dev/null @@ -1,314 +0,0 @@ -option ProjectOptions = lang(longlong, "yes"), gen(manglelinkagekeywordonlyfuncs, "no"), lang(allowtypedefasclassname, "yes"), - lang(templatedefimpls, "dontparse"), lang(compatmath, "yes"), - lang(nokeyword, "const_cast"), lang(nokeyword, "explicit"), lang(nokeyword, "false"), - lang(nokeyword, "mutable"), lang(nokeyword, "true"), lang(nokeyword, "typename"), - lang(trailingenumcommas, "no"), lang(universalcharacternames, "no"), - link(debug, "yes"), link(linkwithmultithreadlib, "yes"), link(exportAll, "yes"), - link(linkwithsharedlib, "yes"), link(defaultlibs, "yes"), link(extdictionary, "no"), - link(defaultlibsname, "..\\lib\\os2png.lib"), - link(defaultlibsname, "..\\lib\\os2xpm.lib"), - link(defaultlibsname, "..\\lib\\os2jpeg.lib"), - link(defaultlibsname, "..\\lib\\os2zlib.lib"), - link(defaultlibsname, "..\\lib\\os2tiff.lib"), - link(defaultlibsname, "NETAPI32.LIB"), - link(defaultlibsname, "UPM32.LIB"), - link(defaultlibsname, "TCP32DLL.LIB"), - link(defaultlibsname, "SO32DLL.LIB"), - link(defaultlibsname, "TCPIP32.LIB"), - link(defaultlibsname, "..\\..\\LIB\\dummy.obj"), - link(extdictionary, "no"),link(pmtype, "pm"), - define("__VISAGECPP__", ), define("__WXPM__", ), - incl(searchpath, "..\\Include"), incl(searchpath, "..\\src\\jpeg"), - incl(searchpath, "..\\src\\zlib"), incl(searchpath, "..\\src\\tiff"), - incl(searchpath, "..\\src\\xpm"), incl(searchpath, "..\\src\\png"), - macros(redefine, "yes"), - file(genobject, "..\\src\\common\\dbgos240dll\\"), - file(usepch, "No"), debug(maxerrors, 100), info(cmp, "yes"), info(cnd, "yes"), info(cns, "yes"), info(cnv, "yes"), - info(cpy, "yes"), info(dcl, "yes"), info(eff, "yes"), info(enu, "yes"), info(ext, "yes"), info(ini, "yes"), - info(ord, "yes"), info(par, "yes"), info(rea, "yes"), info(trd, "yes"), info(tru, "yes"), info(uni, "yes"), - info(use, "yes") -{ - perform - { - run before '-mkdir ' '..\\src\\common\\dbgos240dll' - run before '-mkdir ' '..\\samples\\minimal\\dbgos240dll' - run before 'copy ' '..\\src\common\\dosyacc.c ' '..\\src\\common\\y_tab.c' - run before 'copy ' '..\\src\common\\doslex.c ' '..\\src\\common\\lex_yy.c' - } - target type("dll") "..\\lib\\Wxwindll.dll" - { - source type(cpp) "COMMON\\APPCMN.CPP" - source type(cpp) "COMMON\\CHOICCMN.CPP" - source type(cpp) "COMMON\\CSHELP.CPP" - source type(cpp) "COMMON\\CLIPCMN.CPP" - source type(cpp) "COMMON\\CMDLINE.CPP" - source type(cpp) "COMMON\\CMNDATA.CPP" - source type(cpp) "COMMON\\CONFIG.CPP" - source type(cpp) "COMMON\\CTRLCMN.CPP" - source type(cpp) "COMMON\\CTRLSUB.CPP" - source type(cpp) "COMMON\\DATETIME.CPP" - source type(cpp) "COMMON\\DATSTRM.CPP" - source type(cpp) "COMMON\\DCBASE.CPP" - source type(cpp) "COMMON\\DLGCMN.CPP" - source type(cpp) "COMMON\\DIRCMN.CPP" - source type(cpp) "COMMON\\DNDCMN.CPP" - source type(cpp) "COMMON\\DOBJCMN.CPP" - source type(cpp) "COMMON\\DOCMDI.CPP" - source type(cpp) "COMMON\\DOCVIEW.CPP" - source type(cpp) "COMMON\\DYNARRAY.CPP" - source type(cpp) "COMMON\\DYNLIB.CPP" - source type(cpp) "COMMON\\EFFECTS.CPP" - source type(cpp) "COMMON\\ENCCONV.CPP" - source type(cpp) "COMMON\\EVENT.CPP" - option report(level, "W") - { - source type("c") "COMMON\\EXTENDED.C" - } - source type(cpp) "COMMON\\FFILE.CPP" - source type(cpp) "COMMON\\FILE.CPP" - source type(cpp) "COMMON\\FILECONF.CPP" - source type(cpp) "COMMON\\FILEFN.CPP" - source type(cpp) "COMMON\\FILENAME.CPP" - source type(cpp) "COMMON\\FILESYS.CPP" - source type(cpp) "COMMON\\FONTCMN.CPP" - source type(cpp) "COMMON\\FONTMAP.CPP" - source type(cpp) "COMMON\\FRAMECMN.CPP" - source type(cpp) "COMMON\\FS_INET.CPP" - source type(cpp) "COMMON\\FS_MEM.CPP" - source type(cpp) "COMMON\\FS_ZIP.CPP" - source type(cpp) "COMMON\\FTP.CPP" - source type(cpp) "COMMON\\GDICMN.CPP" - source type(cpp) "COMMON\\GEOMETRY.CPP" - source type(cpp) "COMMON\\GIFDECOD.CPP" - source type(cpp) "COMMON\\HASH.CPP" - source type(cpp) "COMMON\\HELPBASE.CPP" - source type(cpp) "COMMON\\HTTP.CPP" - source type(cpp) "COMMON\\IMAGALL.CPP" - source type(cpp) "COMMON\\IMAGBMP.CPP" - source type(cpp) "COMMON\\IMAGE.CPP" - source type(cpp) "COMMON\\IMAGGIF.CPP" - source type(cpp) "COMMON\\IMAGJPEG.CPP" - source type(cpp) "COMMON\\IMAGPCX.CPP" - source type(cpp) "COMMON\\IMAGPNG.CPP" - source type(cpp) "COMMON\\IMAGPNM.CPP" - source type(cpp) "COMMON\\IMAGTIFF.CPP" - source type(cpp) "COMMON\\IMAGXPM.CPP" - source type(cpp) "COMMON\\INTL.CPP" - source type(cpp) "COMMON\\IPCBASE.CPP" - source type(cpp) "COMMON\\LAYOUT.CPP" - source type(cpp) "COMMON\\LBOXCMN.CPP" - source type(cpp) "COMMON\\LIST.CPP" - source type(cpp) "COMMON\\LOG.CPP" - source type(cpp) "COMMON\\MATRIX.CPP" - source type(cpp) "COMMON\\MEMORY.CPP" - source type(cpp) "COMMON\\MENUCMN.CPP" - source type(cpp) "COMMON\\MIMECMN.CPP" - source type(cpp) "COMMON\\MODULE.CPP" - source type(cpp) "COMMON\\MSTREAM.CPP" - source type(cpp) "COMMON\\OBJECT.CPP" - source type(cpp) "COMMON\\OBJSTRM.CPP" - source type(cpp) "COMMON\\PAPER.CPP" - source type(cpp) "COMMON\\PRNTBASE.CPP" - source type(cpp) "COMMON\\PROCESS.CPP" - source type(cpp) "COMMON\\PROTOCOL.CPP" - source type(cpp) "COMMON\\RESOURCE.CPP" - source type(cpp) "COMMON\\SCKADDR.CPP" - source type(cpp) "COMMON\\SCKFILE.CPP" - source type(cpp) "COMMON\\SCKIPC.CPP" - source type(cpp) "COMMON\\SCKSTRM.CPP" - source type(cpp) "COMMON\\SERBASE.CPP" - source type(cpp) "COMMON\\SIZER.CPP" - source type(cpp) "COMMON\\SOCKET.CPP" - source type(cpp) "COMMON\\STRCONV.CPP" - source type(cpp) "COMMON\\STREAM.CPP" - source type(cpp) "COMMON\\STRING.CPP" - source type(cpp) "COMMON\\TBARBASE.CPP" - source type(cpp) "COMMON\\TEXTCMN.CPP" - source type(cpp) "COMMON\\TEXTFILE.CPP" - source type(cpp) "COMMON\\TIMERCMN.CPP" - source type(cpp) "COMMON\\TOKENZR.CPP" - source type(cpp) "COMMON\\TREEBASE.CPP" - source type(cpp) "COMMON\\TXTSTRM.CPP" - option report(level, "E") - { - source type("c") "COMMON\\UNZIP.C" - } - source type(cpp) "COMMON\\URL.CPP" - source type(cpp) "COMMON\\UTILSCMN.CPP" - source type(cpp) "COMMON\\VALGEN.CPP" - source type(cpp) "COMMON\\VALIDATE.CPP" - source type(cpp) "COMMON\\VALTEXT.CPP" - source type(cpp) "COMMON\\VARIANT.CPP" - source type(cpp) "COMMON\\WFSTREAM.CPP" - source type(cpp) "COMMON\\WINCMN.CPP" - source type(cpp) "COMMON\\WXCHAR.CPP" - source type(cpp) "COMMON\\WXEXPR.CPP" - option report(level, "E") - { - source type("c") "COMMON\\Y_TAB.C" - } - source type(cpp) "COMMON\\ZIPSTRM.CPP" - source type(cpp) "COMMON\\ZSTREAM.CPP" - source type(cpp) "GENERIC\\BUSYINFO.CPP" - source type(cpp) "GENERIC\\CALCTRL.CPP" - source type(cpp) "GENERIC\\CARET.CPP" - source type(cpp) "GENERIC\\CHOICDGG.CPP" - source type(cpp) "GENERIC\\COLRDLGG.CPP" - source type(cpp) "GENERIC\\DCPSG.CPP" - source type(cpp) "GENERIC\\DIRCTRLG.CPP" - source type(cpp) "GENERIC\\DRAGIMGG.CPP" - source type(cpp) "GENERIC\\FONTDLGG.CPP" - source type(cpp) "GENERIC\\GRID.CPP" - source type(cpp) "GENERIC\\GRIDCTRL.CPP" - source type(cpp) "GENERIC\\GRIDSEL.CPP" - source type(cpp) "GENERIC\\HELPEXT.CPP" - source type(cpp) "GENERIC\\HELPHTML.CPP" - source type(cpp) "GENERIC\\HELPWXHT.CPP" - source type(cpp) "GENERIC\\HELPXLP.CPP" - source type(cpp) "GENERIC\\IMAGLIST.CPP" - source type(cpp) "GENERIC\\LAYWIN.CPP" - source type(cpp) "GENERIC\\LISTCTRL.CPP" - source type(cpp) "GENERIC\\LOGG.CPP" - source type(cpp) "GENERIC\\NUMDLGG.CPP" - source type(cpp) "GENERIC\\PANELG.CPP" - source type(cpp) "GENERIC\\PRINTPS.CPP" - source type(cpp) "GENERIC\\PRNTDLGG.CPP" - source type(cpp) "GENERIC\\PROGDLGG.CPP" - source type(cpp) "GENERIC\\PROP.CPP" - source type(cpp) "GENERIC\\PROPFORM.CPP" - source type(cpp) "GENERIC\\PROPLIST.CPP" - source type(cpp) "GENERIC\\SASHWIN.CPP" - source type(cpp) "GENERIC\\SCROLWIN.CPP" - source type(cpp) "GENERIC\\SPLITTER.CPP" - source type(cpp) "GENERIC\\STATUSBR.CPP" - source type(cpp) "GENERIC\\TABG.CPP" - source type(cpp) "GENERIC\\TBARSMPL.CPP" - source type(cpp) "GENERIC\\TEXTDLGG.CPP" - source type(cpp) "GENERIC\\TIPDLG.CPP" - source type(cpp) "GENERIC\\TIPWIN.CPP" - source type(cpp) "GENERIC\\TREECTLG.CPP" - source type(cpp) "GENERIC\\TREELAY.CPP" - source type(cpp) "GENERIC\\WIZARD.CPP" - source type(cpp) "HTML\\HELPCTRL.CPP" - source type(cpp) "HTML\\HELPDATA.CPP" - source type(cpp) "HTML\\HELPFRM.CPP" - source type(cpp) "HTML\\HTMLCELL.CPP" - source type(cpp) "HTML\\HTMLFILT.CPP" - source type(cpp) "HTML\\HTMLPARS.CPP" - source type(cpp) "HTML\\HTMLTAG.CPP" - source type(cpp) "HTML\\HTMLWIN.CPP" - source type(cpp) "HTML\\HTMPRINT.CPP" - source type(cpp) "HTML\\M_DFLIST.CPP" - source type(cpp) "HTML\\M_FONTS.CPP" - source type(cpp) "HTML\\M_HLINE.CPP" - source type(cpp) "HTML\\M_IMAGE.CPP" - source type(cpp) "HTML\\M_LAYOUT.CPP" - source type(cpp) "HTML\\M_LINKS.CPP" - source type(cpp) "HTML\\M_LIST.CPP" - source type(cpp) "HTML\\M_META.CPP" - source type(cpp) "HTML\\M_PRE.CPP" - source type(cpp) "HTML\\M_TABLES.CPP" - source type(cpp) "HTML\\WINPARS.CPP" - source type(cpp) "OS2\\ACCEL.CPP" - source type(cpp) "OS2\\APP.CPP" - source type(cpp) "OS2\\BITMAP.CPP" - source type(cpp) "OS2\\BMPBUTTN.CPP" - source type(cpp) "OS2\\BRUSH.CPP" - source type(cpp) "OS2\\BUTTON.CPP" - source type(cpp) "OS2\\CHECKBOX.CPP" - source type(cpp) "OS2\\CHECKLST.CPP" - source type(cpp) "OS2\\CHOICE.CPP" - source type(cpp) "OS2\\CLIPBRD.CPP" - source type(cpp) "OS2\\COLOUR.CPP" - source type(cpp) "OS2\\COMBOBOX.CPP" - source type(cpp) "OS2\\CONTROL.CPP" - source type(cpp) "OS2\\CURSOR.CPP" - source type(cpp) "OS2\\DATA.CPP" - source type(cpp) "OS2\\DATAOBJ.CPP" - source type(cpp) "OS2\\DC.CPP" - source type(cpp) "OS2\\DCCLIENT.CPP" - source type(cpp) "OS2\\DCMEMORY.CPP" - source type(cpp) "OS2\\DCPRINT.CPP" - source type(cpp) "OS2\\DCSCREEN.CPP" - source type(cpp) "OS2\\DIALOG.CPP" - source type(cpp) "OS2\\DIR.CPP" - source type(cpp) "OS2\\DIRDLG.CPP" - source type(cpp) "OS2\\DND.CPP" - source type(cpp) "OS2\\DUMMYDLL.CPP" - source type(cpp) "OS2\\FILEDLG.CPP" - source type(cpp) "OS2\\FONT.CPP" - source type(cpp) "OS2\\FONTDLG.CPP" - source type(cpp) "OS2\\FONTENUM.CPP" - source type(cpp) "OS2\\FONTUTIL.CPP" - source type(cpp) "OS2\\FRAME.CPP" - source type(cpp) "OS2\\GAUGE.CPP" - source type(cpp) "OS2\\GDIIMAGE.CPP" - source type(cpp) "OS2\\GDIOBJ.CPP" - option report(level, "E") - { - source "OS2\\GSOCKET.C" - } - option report(level, "E") - { - source "OS2\\GSOCKPM.C" - } - source type(cpp) "OS2\\HELPWIN.CPP" - source type(cpp) "OS2\\ICON.CPP" - source type(cpp) "OS2\\INICONF.CPP" - source type(cpp) "OS2\\JOYSTICK.CPP" - source type(cpp) "OS2\\LISTBOX.CPP" - source type(cpp) "OS2\\MAIN.CPP" - source type(cpp) "OS2\\MDI.CPP" - source type(cpp) "OS2\\MENU.CPP" - source type(cpp) "OS2\\MENUITEM.CPP" - source type(cpp) "OS2\\METAFILE.CPP" - source type(cpp) "OS2\\MIMETYPE.CPP" - source type(cpp) "OS2\\MINIFRAM.CPP" - source type(cpp) "OS2\\MSGDLG.CPP" - source type(cpp) "OS2\\NATIVDLG.CPP" - source type(cpp) "OS2\\NOTEBOOK.CPP" - source type(cpp) "OS2\\OWNERDRW.CPP" - source type(cpp) "OS2\\PALETTE.CPP" - source type(cpp) "OS2\\PEN.CPP" - source type(cpp) "OS2\\PRINT.CPP" - source type(cpp) "OS2\\RADIOBOX.CPP" - source type(cpp) "OS2\\RADIOBUT.CPP" - source type(cpp) "OS2\\REGION.CPP" - source type(cpp) "OS2\\SCROLBAR.CPP" - source type(cpp) "OS2\\SETTINGS.CPP" - source type(cpp) "OS2\\SLIDER.CPP" - source type(cpp) "OS2\\SPINBUTT.CPP" - source type(cpp) "OS2\\SPINCTRL.CPP" - source type(cpp) "OS2\\STATBMP.CPP" - source type(cpp) "OS2\\STATBOX.CPP" - source type(cpp) "OS2\\STATLINE.CPP" - source type(cpp) "OS2\\STATTEXT.CPP" - source type(cpp) "OS2\\TABCTRL.CPP" - source type(cpp) "OS2\\TASKBAR.CPP" - source type(cpp) "OS2\\TEXTCTRL.CPP" - source type(cpp) "OS2\\THREAD.CPP" - source type(cpp) "OS2\\TIMER.CPP" - source type(cpp) "OS2\\TOOLBAR.CPP" - source type(cpp) "OS2\\TOOLTIP.CPP" - source type(cpp) "OS2\\UTILS.CPP" - source type(cpp) "OS2\\UTILSEXC.CPP" - source type(cpp) "OS2\\WAVE.CPP" - source type(cpp) "OS2\\WINDOW.CPP" - source type(cpp) "OS2\\XPMHAND.CPP" - } -// target "..\\samples\\minimal\\dbgos240dll\\Minimal.exe" -// { -// source type(cpp) "..\\SAMPLES\\MINIMAL\\MINIMAL.CPP" -// source type(rc) "..\\SAMPLES\\MINIMAL\\MINIMAL.RC4" -// } - target "..\\samples\\menu\\dbgos240dll\\Menu.exe" - { - source type(cpp) "..\\SAMPLES\\MENU\\MENU.CPP" - source type(rc) "..\\SAMPLES\\MENU\\MENU.RC4" - } -// target "..\\samples\\statbar\\dbgos240dll\\Statbar.exe" -// { -// source type(cpp) "..\\SAMPLES\\STATBAR\\STATBAR.CPP" -// source type(rc) "..\\SAMPLES\\STATBAR\\STATBAR.RC4" -// } -} diff --git a/wxWidgets/src/aui/auibar.cpp b/wxWidgets/src/aui/auibar.cpp deleted file mode 100644 index b0242ba05e..0000000000 --- a/wxWidgets/src/aui/auibar.cpp +++ /dev/null @@ -1,2682 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// - -// Name: src/aui/dockart.cpp -// Purpose: wxaui: wx advanced user interface - docking window manager -// Author: Benjamin I. Williams -// Modified by: -// Created: 2005-05-17 -// RCS-ID: $Id: auibar.cpp 66926 2011-02-16 23:25:21Z JS $ -// Copyright: (C) Copyright 2005-2006, Kirix Corporation, All Rights Reserved -// Licence: wxWindows Library Licence, Version 3.1 -/////////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_AUI - -#include "wx/statline.h" -#include "wx/dcbuffer.h" -#include "wx/sizer.h" -#include "wx/image.h" -#include "wx/settings.h" -#include "wx/menu.h" - -#include "wx/aui/auibar.h" -#include "wx/aui/framemanager.h" - -#ifdef __WXMAC__ -#include "wx/mac/carbon/private.h" -// for themeing support -#include -#endif - -#include "wx/arrimpl.cpp" -WX_DEFINE_OBJARRAY(wxAuiToolBarItemArray) - - -DEFINE_EVENT_TYPE(wxEVT_COMMAND_AUITOOLBAR_TOOL_DROPDOWN) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_AUITOOLBAR_OVERFLOW_CLICK) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_AUITOOLBAR_RIGHT_CLICK) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_AUITOOLBAR_MIDDLE_CLICK) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_AUITOOLBAR_BEGIN_DRAG) - - -IMPLEMENT_CLASS(wxAuiToolBar, wxControl) -IMPLEMENT_DYNAMIC_CLASS(wxAuiToolBarEvent, wxEvent) - - -// missing wxITEM_* items -enum -{ - wxITEM_CONTROL = wxITEM_MAX, - wxITEM_LABEL, - wxITEM_SPACER -}; - -const int BUTTON_DROPDOWN_WIDTH = 10; - - -wxBitmap wxAuiBitmapFromBits(const unsigned char bits[], int w, int h, - const wxColour& color); - -unsigned char wxAuiBlendColour(unsigned char fg, unsigned char bg, double alpha); -wxColor wxAuiStepColour(const wxColor& c, int percent); - -static wxBitmap MakeDisabledBitmap(wxBitmap& bmp) -{ - wxImage image = bmp.ConvertToImage(); - - int mr, mg, mb; - mr = image.GetMaskRed(); - mg = image.GetMaskGreen(); - mb = image.GetMaskBlue(); - - unsigned char* data = image.GetData(); - int width = image.GetWidth(); - int height = image.GetHeight(); - bool has_mask = image.HasMask(); - - for (int y = height-1; y >= 0; --y) - { - for (int x = width-1; x >= 0; --x) - { - data = image.GetData() + (y*(width*3))+(x*3); - unsigned char* r = data; - unsigned char* g = data+1; - unsigned char* b = data+2; - - if (has_mask && *r == mr && *g == mg && *b == mb) - continue; - - *r = wxAuiBlendColour(*r, 255, 0.4); - *g = wxAuiBlendColour(*g, 255, 0.4); - *b = wxAuiBlendColour(*b, 255, 0.4); - } - } - - return wxBitmap(image); -} - -static wxColor GetBaseColor() -{ - -#if defined( __WXMAC__ ) && wxOSX_USE_COCOA_OR_CARBON - wxColor base_colour = wxColour( wxMacCreateCGColorFromHITheme(kThemeBrushToolbarBackground)); -#else - wxColor base_colour = wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE); -#endif - - // the base_colour is too pale to use as our base colour, - // so darken it a bit -- - if ((255-base_colour.Red()) + - (255-base_colour.Green()) + - (255-base_colour.Blue()) < 60) - { - base_colour = wxAuiStepColour(base_colour, 92); - } - - return base_colour; -} - - - -class ToolbarCommandCapture : public wxEvtHandler -{ -public: - - ToolbarCommandCapture() { m_last_id = 0; } - int GetCommandId() const { return m_last_id; } - - bool ProcessEvent(wxEvent& evt) - { - if (evt.GetEventType() == wxEVT_COMMAND_MENU_SELECTED) - { - m_last_id = evt.GetId(); - return true; - } - - if (GetNextHandler()) - return GetNextHandler()->ProcessEvent(evt); - - return false; - } - -private: - int m_last_id; -}; - - - -static const unsigned char - DISABLED_TEXT_GREY_HUE = wxAuiBlendColour(0, 255, 0.4); -const wxColour DISABLED_TEXT_COLOR(DISABLED_TEXT_GREY_HUE, - DISABLED_TEXT_GREY_HUE, - DISABLED_TEXT_GREY_HUE); - -wxAuiDefaultToolBarArt::wxAuiDefaultToolBarArt() -{ - m_base_colour = GetBaseColor(); - - m_flags = 0; - m_text_orientation = wxAUI_TBTOOL_TEXT_BOTTOM; - m_highlight_colour = wxSystemSettings::GetColour(wxSYS_COLOUR_HIGHLIGHT); - - m_separator_size = 7; - m_gripper_size = 7; - m_overflow_size = 16; - - wxColor darker1_colour = wxAuiStepColour(m_base_colour, 85); - wxColor darker2_colour = wxAuiStepColour(m_base_colour, 75); - wxColor darker3_colour = wxAuiStepColour(m_base_colour, 60); - wxColor darker4_colour = wxAuiStepColour(m_base_colour, 50); - wxColor darker5_colour = wxAuiStepColour(m_base_colour, 40); - - m_gripper_pen1 = wxPen(darker5_colour); - m_gripper_pen2 = wxPen(darker3_colour); - m_gripper_pen3 = *wxWHITE_PEN; - - static unsigned char button_dropdown_bits[] = { 0xe0, 0xf1, 0xfb }; - static unsigned char overflow_bits[] = { 0x80, 0xff, 0x80, 0xc1, 0xe3, 0xf7 }; - - m_button_dropdown_bmp = wxAuiBitmapFromBits(button_dropdown_bits, 5, 3, - *wxBLACK); - m_disabled_button_dropdown_bmp = wxAuiBitmapFromBits( - button_dropdown_bits, 5, 3, - wxColor(128,128,128)); - m_overflow_bmp = wxAuiBitmapFromBits(overflow_bits, 7, 6, *wxBLACK); - m_disabled_overflow_bmp = wxAuiBitmapFromBits(overflow_bits, 7, 6, wxColor(128,128,128)); - - m_font = *wxNORMAL_FONT; -} - -wxAuiDefaultToolBarArt::~wxAuiDefaultToolBarArt() -{ - m_font = *wxNORMAL_FONT; -} - - -wxAuiToolBarArt* wxAuiDefaultToolBarArt::Clone() -{ - return static_cast(new wxAuiDefaultToolBarArt); -} - -void wxAuiDefaultToolBarArt::SetFlags(unsigned int flags) -{ - m_flags = flags; -} - -void wxAuiDefaultToolBarArt::SetFont(const wxFont& font) -{ - m_font = font; -} - -void wxAuiDefaultToolBarArt::SetTextOrientation(int orientation) -{ - m_text_orientation = orientation; -} - -void wxAuiDefaultToolBarArt::DrawBackground( - wxDC& dc, - wxWindow* WXUNUSED(wnd), - const wxRect& _rect) -{ - wxRect rect = _rect; - rect.height++; - wxColour start_colour = wxAuiStepColour(m_base_colour, 150); - wxColour end_colour = wxAuiStepColour(m_base_colour, 90); - dc.GradientFillLinear(rect, start_colour, end_colour, wxSOUTH); -} - -void wxAuiDefaultToolBarArt::DrawLabel( - wxDC& dc, - wxWindow* WXUNUSED(wnd), - const wxAuiToolBarItem& item, - const wxRect& rect) -{ - dc.SetFont(m_font); - dc.SetTextForeground(*wxBLACK); - - // we only care about the text height here since the text - // will get cropped based on the width of the item - int text_width = 0, text_height = 0; - dc.GetTextExtent(wxT("ABCDHgj"), &text_width, &text_height); - - // set the clipping region - wxRect clip_rect = rect; - clip_rect.width -= 1; - dc.SetClippingRegion(clip_rect); - - int text_x, text_y; - text_x = rect.x + 1; - text_y = rect.y + (rect.height-text_height)/2; - dc.DrawText(item.GetLabel(), text_x, text_y); - dc.DestroyClippingRegion(); -} - - -void wxAuiDefaultToolBarArt::DrawButton( - wxDC& dc, - wxWindow* WXUNUSED(wnd), - const wxAuiToolBarItem& item, - const wxRect& rect) -{ - int text_width = 0, text_height = 0; - - if (m_flags & wxAUI_TB_TEXT) - { - dc.SetFont(m_font); - - int tx, ty; - - dc.GetTextExtent(wxT("ABCDHgj"), &tx, &text_height); - text_width = 0; - dc.GetTextExtent(item.GetLabel(), &text_width, &ty); - } - - int bmp_x = 0, bmp_y = 0; - int text_x = 0, text_y = 0; - - if (m_text_orientation == wxAUI_TBTOOL_TEXT_BOTTOM) - { - bmp_x = rect.x + - (rect.width/2) - - (item.GetBitmap().GetWidth()/2); - - bmp_y = rect.y + - ((rect.height-text_height)/2) - - (item.GetBitmap().GetHeight()/2); - - text_x = rect.x + (rect.width/2) - (text_width/2) + 1; - text_y = rect.y + rect.height - text_height - 1; - } - else if (m_text_orientation == wxAUI_TBTOOL_TEXT_RIGHT) - { - bmp_x = rect.x + 3; - - bmp_y = rect.y + - (rect.height/2) - - (item.GetBitmap().GetHeight()/2); - - text_x = bmp_x + 3 + item.GetBitmap().GetWidth(); - text_y = rect.y + - (rect.height/2) - - (text_height/2); - } - - - if (!(item.GetState() & wxAUI_BUTTON_STATE_DISABLED)) - { - if (item.GetState() & wxAUI_BUTTON_STATE_PRESSED) - { - dc.SetPen(wxPen(m_highlight_colour)); - dc.SetBrush(wxBrush(wxAuiStepColour(m_highlight_colour, 150))); - dc.DrawRectangle(rect); - } - else if ((item.GetState() & wxAUI_BUTTON_STATE_HOVER) || item.IsSticky()) - { - dc.SetPen(wxPen(m_highlight_colour)); - dc.SetBrush(wxBrush(wxAuiStepColour(m_highlight_colour, 170))); - - // draw an even lighter background for checked item hovers (since - // the hover background is the same color as the check background) - if (item.GetState() & wxAUI_BUTTON_STATE_CHECKED) - dc.SetBrush(wxBrush(wxAuiStepColour(m_highlight_colour, 180))); - - dc.DrawRectangle(rect); - } - else if (item.GetState() & wxAUI_BUTTON_STATE_CHECKED) - { - // it's important to put this code in an else statment after the - // hover, otherwise hovers won't draw properly for checked items - dc.SetPen(wxPen(m_highlight_colour)); - dc.SetBrush(wxBrush(wxAuiStepColour(m_highlight_colour, 170))); - dc.DrawRectangle(rect); - } - } - - wxBitmap bmp; - if (item.GetState() & wxAUI_BUTTON_STATE_DISABLED) - bmp = item.GetDisabledBitmap(); - else - bmp = item.GetBitmap(); - - if (!bmp.IsOk()) - return; - - dc.DrawBitmap(bmp, bmp_x, bmp_y, true); - - // set the item's text color based on if it is disabled - dc.SetTextForeground(*wxBLACK); - if (item.GetState() & wxAUI_BUTTON_STATE_DISABLED) - dc.SetTextForeground(DISABLED_TEXT_COLOR); - - if ( (m_flags & wxAUI_TB_TEXT) && !item.GetLabel().empty() ) - { - dc.DrawText(item.GetLabel(), text_x, text_y); - } -} - - -void wxAuiDefaultToolBarArt::DrawDropDownButton( - wxDC& dc, - wxWindow* WXUNUSED(wnd), - const wxAuiToolBarItem& item, - const wxRect& rect) -{ - int text_width = 0, text_height = 0, text_x = 0, text_y = 0; - int bmp_x = 0, bmp_y = 0, dropbmp_x = 0, dropbmp_y = 0; - - wxRect button_rect = wxRect(rect.x, - rect.y, - rect.width-BUTTON_DROPDOWN_WIDTH, - rect.height); - wxRect dropdown_rect = wxRect(rect.x+rect.width-BUTTON_DROPDOWN_WIDTH-1, - rect.y, - BUTTON_DROPDOWN_WIDTH+1, - rect.height); - - if (m_flags & wxAUI_TB_TEXT) - { - dc.SetFont(m_font); - - int tx, ty; - if (m_flags & wxAUI_TB_TEXT) - { - dc.GetTextExtent(wxT("ABCDHgj"), &tx, &text_height); - text_width = 0; - } - - dc.GetTextExtent(item.GetLabel(), &text_width, &ty); - } - - - - dropbmp_x = dropdown_rect.x + - (dropdown_rect.width/2) - - (m_button_dropdown_bmp.GetWidth()/2); - dropbmp_y = dropdown_rect.y + - (dropdown_rect.height/2) - - (m_button_dropdown_bmp.GetHeight()/2); - - - if (m_text_orientation == wxAUI_TBTOOL_TEXT_BOTTOM) - { - bmp_x = button_rect.x + - (button_rect.width/2) - - (item.GetBitmap().GetWidth()/2); - bmp_y = button_rect.y + - ((button_rect.height-text_height)/2) - - (item.GetBitmap().GetHeight()/2); - - text_x = rect.x + (rect.width/2) - (text_width/2) + 1; - text_y = rect.y + rect.height - text_height - 1; - } - else if (m_text_orientation == wxAUI_TBTOOL_TEXT_RIGHT) - { - bmp_x = rect.x + 3; - - bmp_y = rect.y + - (rect.height/2) - - (item.GetBitmap().GetHeight()/2); - - text_x = bmp_x + 3 + item.GetBitmap().GetWidth(); - text_y = rect.y + - (rect.height/2) - - (text_height/2); - } - - - if (item.GetState() & wxAUI_BUTTON_STATE_PRESSED) - { - dc.SetPen(wxPen(m_highlight_colour)); - dc.SetBrush(wxBrush(wxAuiStepColour(m_highlight_colour, 140))); - dc.DrawRectangle(button_rect); - dc.DrawRectangle(dropdown_rect); - } - else if (item.GetState() & wxAUI_BUTTON_STATE_HOVER || - item.IsSticky()) - { - dc.SetPen(wxPen(m_highlight_colour)); - dc.SetBrush(wxBrush(wxAuiStepColour(m_highlight_colour, 170))); - dc.DrawRectangle(button_rect); - dc.DrawRectangle(dropdown_rect); - } - - wxBitmap bmp; - wxBitmap dropbmp; - if (item.GetState() & wxAUI_BUTTON_STATE_DISABLED) - { - bmp = item.GetDisabledBitmap(); - dropbmp = m_disabled_button_dropdown_bmp; - } - else - { - bmp = item.GetBitmap(); - dropbmp = m_button_dropdown_bmp; - } - - if (!bmp.IsOk()) - return; - - dc.DrawBitmap(bmp, bmp_x, bmp_y, true); - dc.DrawBitmap(dropbmp, dropbmp_x, dropbmp_y, true); - - // set the item's text color based on if it is disabled - dc.SetTextForeground(*wxBLACK); - if (item.GetState() & wxAUI_BUTTON_STATE_DISABLED) - dc.SetTextForeground(DISABLED_TEXT_COLOR); - - if ( (m_flags & wxAUI_TB_TEXT) && !item.GetLabel().empty() ) - { - dc.DrawText(item.GetLabel(), text_x, text_y); - } -} - -void wxAuiDefaultToolBarArt::DrawControlLabel( - wxDC& dc, - wxWindow* WXUNUSED(wnd), - const wxAuiToolBarItem& item, - const wxRect& rect) -{ - if (!(m_flags & wxAUI_TB_TEXT)) - return; - - if (m_text_orientation != wxAUI_TBTOOL_TEXT_BOTTOM) - return; - - int text_x = 0, text_y = 0; - int text_width = 0, text_height = 0; - - dc.SetFont(m_font); - - int tx, ty; - if (m_flags & wxAUI_TB_TEXT) - { - dc.GetTextExtent(wxT("ABCDHgj"), &tx, &text_height); - text_width = 0; - } - - dc.GetTextExtent(item.GetLabel(), &text_width, &ty); - - // don't draw the label if it is wider than the item width - if (text_width > rect.width) - return; - - // set the label's text color - dc.SetTextForeground(*wxBLACK); - - text_x = rect.x + (rect.width/2) - (text_width/2) + 1; - text_y = rect.y + rect.height - text_height - 1; - - if ( (m_flags & wxAUI_TB_TEXT) && !item.GetLabel().empty() ) - { - dc.DrawText(item.GetLabel(), text_x, text_y); - } -} - -wxSize wxAuiDefaultToolBarArt::GetLabelSize( - wxDC& dc, - wxWindow* WXUNUSED(wnd), - const wxAuiToolBarItem& item) -{ - dc.SetFont(m_font); - - // get label's height - int width = 0, height = 0; - dc.GetTextExtent(wxT("ABCDHgj"), &width, &height); - - // get item's width - width = item.GetMinSize().GetWidth(); - - if (width == -1) - { - // no width specified, measure the text ourselves - width = dc.GetTextExtent(item.GetLabel()).GetX(); - } - - return wxSize(width, height); -} - -wxSize wxAuiDefaultToolBarArt::GetToolSize( - wxDC& dc, - wxWindow* WXUNUSED(wnd), - const wxAuiToolBarItem& item) -{ - if (!item.GetBitmap().IsOk() && !(m_flags & wxAUI_TB_TEXT)) - return wxSize(16,16); - - int width = item.GetBitmap().GetWidth(); - int height = item.GetBitmap().GetHeight(); - - if (m_flags & wxAUI_TB_TEXT) - { - dc.SetFont(m_font); - int tx, ty; - - if (m_text_orientation == wxAUI_TBTOOL_TEXT_BOTTOM) - { - dc.GetTextExtent(wxT("ABCDHgj"), &tx, &ty); - height += ty; - - if ( !item.GetLabel().empty() ) - { - dc.GetTextExtent(item.GetLabel(), &tx, &ty); - width = wxMax(width, tx+6); - } - } - else if ( m_text_orientation == wxAUI_TBTOOL_TEXT_RIGHT && - !item.GetLabel().empty() ) - { - width += 3; // space between left border and bitmap - width += 3; // space between bitmap and text - - if ( !item.GetLabel().empty() ) - { - dc.GetTextExtent(item.GetLabel(), &tx, &ty); - width += tx; - height = wxMax(height, ty); - } - } - } - - // if the tool has a dropdown button, add it to the width - if (item.HasDropDown()) - width += (BUTTON_DROPDOWN_WIDTH+4); - - return wxSize(width, height); -} - -void wxAuiDefaultToolBarArt::DrawSeparator( - wxDC& dc, - wxWindow* WXUNUSED(wnd), - const wxRect& _rect) -{ - bool horizontal = true; - if (m_flags & wxAUI_TB_VERTICAL) - horizontal = false; - - wxRect rect = _rect; - - if (horizontal) - { - rect.x += (rect.width/2); - rect.width = 1; - int new_height = (rect.height*3)/4; - rect.y += (rect.height/2) - (new_height/2); - rect.height = new_height; - } - else - { - rect.y += (rect.height/2); - rect.height = 1; - int new_width = (rect.width*3)/4; - rect.x += (rect.width/2) - (new_width/2); - rect.width = new_width; - } - - wxColour start_colour = wxAuiStepColour(m_base_colour, 80); - wxColour end_colour = wxAuiStepColour(m_base_colour, 80); - dc.GradientFillLinear(rect, start_colour, end_colour, horizontal ? wxSOUTH : wxEAST); -} - -void wxAuiDefaultToolBarArt::DrawGripper(wxDC& dc, - wxWindow* WXUNUSED(wnd), - const wxRect& rect) -{ - int i = 0; - while (1) - { - int x, y; - - if (m_flags & wxAUI_TB_VERTICAL) - { - x = rect.x + (i*4) + 5; - y = rect.y + 3; - if (x > rect.GetWidth()-5) - break; - } - else - { - x = rect.x + 3; - y = rect.y + (i*4) + 5; - if (y > rect.GetHeight()-5) - break; - } - - dc.SetPen(m_gripper_pen1); - dc.DrawPoint(x, y); - dc.SetPen(m_gripper_pen2); - dc.DrawPoint(x, y+1); - dc.DrawPoint(x+1, y); - dc.SetPen(m_gripper_pen3); - dc.DrawPoint(x+2, y+1); - dc.DrawPoint(x+2, y+2); - dc.DrawPoint(x+1, y+2); - - i++; - } - -} - -void wxAuiDefaultToolBarArt::DrawOverflowButton(wxDC& dc, - wxWindow* wnd, - const wxRect& rect, - int state) -{ - if (state & wxAUI_BUTTON_STATE_HOVER || - state & wxAUI_BUTTON_STATE_PRESSED) - { - wxRect cli_rect = wnd->GetClientRect(); - wxColor light_gray_bg = wxAuiStepColour(m_highlight_colour, 170); - - if (m_flags & wxAUI_TB_VERTICAL) - { - dc.SetPen(wxPen(m_highlight_colour)); - dc.DrawLine(rect.x, rect.y, rect.x+rect.width, rect.y); - dc.SetPen(wxPen(light_gray_bg)); - dc.SetBrush(wxBrush(light_gray_bg)); - dc.DrawRectangle(rect.x, rect.y+1, rect.width, rect.height); - } - else - { - dc.SetPen(wxPen(m_highlight_colour)); - dc.DrawLine(rect.x, rect.y, rect.x, rect.y+rect.height); - dc.SetPen(wxPen(light_gray_bg)); - dc.SetBrush(wxBrush(light_gray_bg)); - dc.DrawRectangle(rect.x+1, rect.y, rect.width, rect.height); - } - } - - int x = rect.x+1+(rect.width-m_overflow_bmp.GetWidth())/2; - int y = rect.y+1+(rect.height-m_overflow_bmp.GetHeight())/2; - dc.DrawBitmap(m_overflow_bmp, x, y, true); -} - -int wxAuiDefaultToolBarArt::GetElementSize(int element_id) -{ - switch (element_id) - { - case wxAUI_TBART_SEPARATOR_SIZE: return m_separator_size; - case wxAUI_TBART_GRIPPER_SIZE: return m_gripper_size; - case wxAUI_TBART_OVERFLOW_SIZE: return m_overflow_size; - default: return 0; - } -} - -void wxAuiDefaultToolBarArt::SetElementSize(int element_id, int size) -{ - switch (element_id) - { - case wxAUI_TBART_SEPARATOR_SIZE: m_separator_size = size; break; - case wxAUI_TBART_GRIPPER_SIZE: m_gripper_size = size; break; - case wxAUI_TBART_OVERFLOW_SIZE: m_overflow_size = size; break; - } -} - -int wxAuiDefaultToolBarArt::ShowDropDown(wxWindow* wnd, - const wxAuiToolBarItemArray& items) -{ - wxMenu menuPopup; - - size_t items_added = 0; - - size_t i, count = items.GetCount(); - for (i = 0; i < count; ++i) - { - wxAuiToolBarItem& item = items.Item(i); - - if (item.GetKind() == wxITEM_NORMAL) - { - wxString text = item.GetShortHelp(); - if (text.empty()) - text = item.GetLabel(); - - if (text.empty()) - text = wxT(" "); - - wxMenuItem* m = new wxMenuItem(&menuPopup, item.GetId(), text, item.GetShortHelp()); - - m->SetBitmap(item.GetBitmap()); - menuPopup.Append(m); - items_added++; - } - else if (item.GetKind() == wxITEM_SEPARATOR) - { - if (items_added > 0) - menuPopup.AppendSeparator(); - } - } - - // find out where to put the popup menu of window items - wxPoint pt = ::wxGetMousePosition(); - pt = wnd->ScreenToClient(pt); - - // find out the screen coordinate at the bottom of the tab ctrl - wxRect cli_rect = wnd->GetClientRect(); - pt.y = cli_rect.y + cli_rect.height; - - ToolbarCommandCapture* cc = new ToolbarCommandCapture; - wnd->PushEventHandler(cc); - wnd->PopupMenu(&menuPopup, pt); - int command = cc->GetCommandId(); - wnd->PopEventHandler(true); - - return command; -} - - - - -BEGIN_EVENT_TABLE(wxAuiToolBar, wxControl) - EVT_SIZE(wxAuiToolBar::OnSize) - EVT_IDLE(wxAuiToolBar::OnIdle) - EVT_ERASE_BACKGROUND(wxAuiToolBar::OnEraseBackground) - EVT_PAINT(wxAuiToolBar::OnPaint) - EVT_LEFT_DOWN(wxAuiToolBar::OnLeftDown) - EVT_LEFT_DCLICK(wxAuiToolBar::OnLeftDown) - EVT_LEFT_UP(wxAuiToolBar::OnLeftUp) - EVT_RIGHT_DOWN(wxAuiToolBar::OnRightDown) - EVT_RIGHT_DCLICK(wxAuiToolBar::OnRightDown) - EVT_RIGHT_UP(wxAuiToolBar::OnRightUp) - EVT_MIDDLE_DOWN(wxAuiToolBar::OnMiddleDown) - EVT_MIDDLE_DCLICK(wxAuiToolBar::OnMiddleDown) - EVT_MIDDLE_UP(wxAuiToolBar::OnMiddleUp) - EVT_MOTION(wxAuiToolBar::OnMotion) - EVT_LEAVE_WINDOW(wxAuiToolBar::OnLeaveWindow) - EVT_SET_CURSOR(wxAuiToolBar::OnSetCursor) -END_EVENT_TABLE() - - -wxAuiToolBar::wxAuiToolBar(wxWindow* parent, - wxWindowID id, - const wxPoint& position, - const wxSize& size, - long style) - : wxControl(parent, - id, - position, - size, - style | wxBORDER_NONE) -{ - m_sizer = new wxBoxSizer(wxHORIZONTAL); - m_button_width = -1; - m_button_height = -1; - m_sizer_element_count = 0; - m_action_pos = wxPoint(-1,-1); - m_action_item = NULL; - m_tip_item = NULL; - m_art = new wxAuiDefaultToolBarArt; - m_tool_packing = 2; - m_tool_border_padding = 3; - m_tool_text_orientation = wxAUI_TBTOOL_TEXT_BOTTOM; - m_gripper_sizer_item = NULL; - m_overflow_sizer_item = NULL; - m_dragging = false; - m_style = style | wxBORDER_NONE; - m_gripper_visible = (m_style & wxAUI_TB_GRIPPER) ? true : false; - m_overflow_visible = (m_style & wxAUI_TB_OVERFLOW) ? true : false; - m_overflow_state = 0; - SetMargins(5, 5, 2, 2); - SetFont(*wxNORMAL_FONT); - m_art->SetFlags((unsigned int)m_style); - SetExtraStyle(wxWS_EX_PROCESS_IDLE); - if (style & wxAUI_TB_HORZ_LAYOUT) - SetToolTextOrientation(wxAUI_TBTOOL_TEXT_RIGHT); -} - - -wxAuiToolBar::~wxAuiToolBar() -{ - delete m_art; - delete m_sizer; -} - -void wxAuiToolBar::SetWindowStyleFlag(long style) -{ - wxControl::SetWindowStyleFlag(style); - - m_style = style; - - if (m_art) - { - m_art->SetFlags((unsigned int)m_style); - } - - if (m_style & wxAUI_TB_GRIPPER) - m_gripper_visible = true; - else - m_gripper_visible = false; - - - if (m_style & wxAUI_TB_OVERFLOW) - m_overflow_visible = true; - else - m_overflow_visible = false; - - if (style & wxAUI_TB_HORZ_LAYOUT) - SetToolTextOrientation(wxAUI_TBTOOL_TEXT_RIGHT); - else - SetToolTextOrientation(wxAUI_TBTOOL_TEXT_BOTTOM); -} - -long wxAuiToolBar::GetWindowStyleFlag() const -{ - return m_style; -} - -void wxAuiToolBar::SetArtProvider(wxAuiToolBarArt* art) -{ - delete m_art; - - m_art = art; - - if (m_art) - { - m_art->SetFlags((unsigned int)m_style); - m_art->SetTextOrientation(m_tool_text_orientation); - } -} - -wxAuiToolBarArt* wxAuiToolBar::GetArtProvider() const -{ - return m_art; -} - - - - -void wxAuiToolBar::AddTool(int tool_id, - const wxString& label, - const wxBitmap& bitmap, - const wxString& short_help_string, - wxItemKind kind) -{ - AddTool(tool_id, - label, - bitmap, - wxNullBitmap, - kind, - short_help_string, - wxEmptyString, - NULL); -} - - -void wxAuiToolBar::AddTool(int tool_id, - const wxString& label, - const wxBitmap& bitmap, - const wxBitmap& disabled_bitmap, - wxItemKind kind, - const wxString& short_help_string, - const wxString& long_help_string, - wxObject* WXUNUSED(client_data)) -{ - wxAuiToolBarItem item; - item.window = NULL; - item.label = label; - item.bitmap = bitmap; - item.disabled_bitmap = disabled_bitmap; - item.short_help = short_help_string; - item.long_help = long_help_string; - item.active = true; - item.dropdown = false; - item.spacer_pixels = 0; - item.id = tool_id; - item.state = 0; - item.proportion = 0; - item.kind = kind; - item.sizer_item = NULL; - item.min_size = wxDefaultSize; - item.user_data = 0; - item.sticky = false; - - if (item.id == wxID_ANY) - item.id = wxNewId(); - - if (!item.disabled_bitmap.IsOk()) - { - // no disabled bitmap specified, we need to make one - if (item.bitmap.IsOk()) - { - //wxImage img = item.bitmap.ConvertToImage(); - //wxImage grey_version = img.ConvertToGreyscale(); - //item.disabled_bitmap = wxBitmap(grey_version); - item.disabled_bitmap = MakeDisabledBitmap(item.bitmap); - } - } - - m_items.Add(item); -} - -void wxAuiToolBar::AddControl(wxControl* control, - const wxString& label) -{ - wxAuiToolBarItem item; - item.window = (wxWindow*)control; - item.label = label; - item.bitmap = wxNullBitmap; - item.disabled_bitmap = wxNullBitmap; - item.active = true; - item.dropdown = false; - item.spacer_pixels = 0; - item.id = control->GetId(); - item.state = 0; - item.proportion = 0; - item.kind = wxITEM_CONTROL; - item.sizer_item = NULL; - item.min_size = control->GetEffectiveMinSize(); - item.user_data = 0; - item.sticky = false; - - m_items.Add(item); -} - -void wxAuiToolBar::AddLabel(int tool_id, - const wxString& label, - const int width) -{ - wxSize min_size = wxDefaultSize; - if (width != -1) - min_size.x = width; - - wxAuiToolBarItem item; - item.window = NULL; - item.label = label; - item.bitmap = wxNullBitmap; - item.disabled_bitmap = wxNullBitmap; - item.active = true; - item.dropdown = false; - item.spacer_pixels = 0; - item.id = tool_id; - item.state = 0; - item.proportion = 0; - item.kind = wxITEM_LABEL; - item.sizer_item = NULL; - item.min_size = min_size; - item.user_data = 0; - item.sticky = false; - - if (item.id == wxID_ANY) - item.id = wxNewId(); - - m_items.Add(item); -} - -void wxAuiToolBar::AddSeparator() -{ - wxAuiToolBarItem item; - item.window = NULL; - item.label = wxEmptyString; - item.bitmap = wxNullBitmap; - item.disabled_bitmap = wxNullBitmap; - item.active = true; - item.dropdown = false; - item.id = -1; - item.state = 0; - item.proportion = 0; - item.kind = wxITEM_SEPARATOR; - item.sizer_item = NULL; - item.min_size = wxDefaultSize; - item.user_data = 0; - item.sticky = false; - - m_items.Add(item); -} - -void wxAuiToolBar::AddSpacer(int pixels) -{ - wxAuiToolBarItem item; - item.window = NULL; - item.label = wxEmptyString; - item.bitmap = wxNullBitmap; - item.disabled_bitmap = wxNullBitmap; - item.active = true; - item.dropdown = false; - item.spacer_pixels = pixels; - item.id = -1; - item.state = 0; - item.proportion = 0; - item.kind = wxITEM_SPACER; - item.sizer_item = NULL; - item.min_size = wxDefaultSize; - item.user_data = 0; - item.sticky = false; - - m_items.Add(item); -} - -void wxAuiToolBar::AddStretchSpacer(int proportion) -{ - wxAuiToolBarItem item; - item.window = NULL; - item.label = wxEmptyString; - item.bitmap = wxNullBitmap; - item.disabled_bitmap = wxNullBitmap; - item.active = true; - item.dropdown = false; - item.spacer_pixels = 0; - item.id = -1; - item.state = 0; - item.proportion = proportion; - item.kind = wxITEM_SPACER; - item.sizer_item = NULL; - item.min_size = wxDefaultSize; - item.user_data = 0; - item.sticky = false; - - m_items.Add(item); -} - -void wxAuiToolBar::Clear() -{ - m_items.Clear(); - m_sizer_element_count = 0; -} - -bool wxAuiToolBar::DeleteTool(int tool_id) -{ - int idx = GetToolIndex(tool_id); - if (idx >= 0 && idx < (int)m_items.GetCount()) - { - m_items.RemoveAt(idx); - Realize(); - return true; - } - - return false; -} - -bool wxAuiToolBar::DeleteByIndex(int idx) -{ - if (idx >= 0 && idx < (int)m_items.GetCount()) - { - m_items.RemoveAt(idx); - Realize(); - return true; - } - - return false; -} - - -wxControl* wxAuiToolBar::FindControl(int id) -{ - wxWindow* wnd = FindWindow(id); - return (wxControl*)wnd; -} - -wxAuiToolBarItem* wxAuiToolBar::FindTool(int tool_id) const -{ - size_t i, count; - for (i = 0, count = m_items.GetCount(); i < count; ++i) - { - wxAuiToolBarItem& item = m_items.Item(i); - if (item.id == tool_id) - return &item; - } - - return NULL; -} - -wxAuiToolBarItem* wxAuiToolBar::FindToolByPosition(wxCoord x, wxCoord y) const -{ - size_t i, count; - for (i = 0, count = m_items.GetCount(); i < count; ++i) - { - wxAuiToolBarItem& item = m_items.Item(i); - - if (!item.sizer_item) - continue; - - wxRect rect = item.sizer_item->GetRect(); - if (rect.Contains(x,y)) - { - // if the item doesn't fit on the toolbar, return NULL - if (!GetToolFitsByIndex(i)) - return NULL; - - return &item; - } - } - - return NULL; -} - -wxAuiToolBarItem* wxAuiToolBar::FindToolByPositionWithPacking(wxCoord x, wxCoord y) const -{ - size_t i, count; - for (i = 0, count = m_items.GetCount(); i < count; ++i) - { - wxAuiToolBarItem& item = m_items.Item(i); - - if (!item.sizer_item) - continue; - - wxRect rect = item.sizer_item->GetRect(); - - // apply tool packing - if (i+1 < count) - rect.width += m_tool_packing; - - if (rect.Contains(x,y)) - { - // if the item doesn't fit on the toolbar, return NULL - if (!GetToolFitsByIndex(i)) - return NULL; - - return &item; - } - } - - return NULL; -} - -wxAuiToolBarItem* wxAuiToolBar::FindToolByIndex(int idx) const -{ - if (idx < 0) - return NULL; - - if (idx >= (int)m_items.size()) - return NULL; - - return &(m_items[idx]); -} - -void wxAuiToolBar::SetToolBitmapSize(const wxSize& WXUNUSED(size)) -{ - // TODO: wxToolBar compatibility -} - -wxSize wxAuiToolBar::GetToolBitmapSize() const -{ - // TODO: wxToolBar compatibility - return wxSize(16,15); -} - -void wxAuiToolBar::SetToolProportion(int tool_id, int proportion) -{ - wxAuiToolBarItem* item = FindTool(tool_id); - if (!item) - return; - - item->proportion = proportion; -} - -int wxAuiToolBar::GetToolProportion(int tool_id) const -{ - wxAuiToolBarItem* item = FindTool(tool_id); - if (!item) - return 0; - - return item->proportion; -} - -void wxAuiToolBar::SetToolSeparation(int separation) -{ - if (m_art) - m_art->SetElementSize(wxAUI_TBART_SEPARATOR_SIZE, separation); -} - -int wxAuiToolBar::GetToolSeparation() const -{ - if (m_art) - return m_art->GetElementSize(wxAUI_TBART_SEPARATOR_SIZE); - else - return 5; -} - - -void wxAuiToolBar::SetToolDropDown(int tool_id, bool dropdown) -{ - wxAuiToolBarItem* item = FindTool(tool_id); - if (!item) - return; - - item->dropdown = dropdown; -} - -bool wxAuiToolBar::GetToolDropDown(int tool_id) const -{ - wxAuiToolBarItem* item = FindTool(tool_id); - if (!item) - return 0; - - return item->dropdown; -} - -void wxAuiToolBar::SetToolSticky(int tool_id, bool sticky) -{ - // ignore separators - if (tool_id == -1) - return; - - wxAuiToolBarItem* item = FindTool(tool_id); - if (!item) - return; - - if (item->sticky == sticky) - return; - - item->sticky = sticky; - - Refresh(false); - Update(); -} - -bool wxAuiToolBar::GetToolSticky(int tool_id) const -{ - wxAuiToolBarItem* item = FindTool(tool_id); - if (!item) - return 0; - - return item->sticky; -} - - - - -void wxAuiToolBar::SetToolBorderPadding(int padding) -{ - m_tool_border_padding = padding; -} - -int wxAuiToolBar::GetToolBorderPadding() const -{ - return m_tool_border_padding; -} - -void wxAuiToolBar::SetToolTextOrientation(int orientation) -{ - m_tool_text_orientation = orientation; - - if (m_art) - { - m_art->SetTextOrientation(orientation); - } -} - -int wxAuiToolBar::GetToolTextOrientation() const -{ - return m_tool_text_orientation; -} - -void wxAuiToolBar::SetToolPacking(int packing) -{ - m_tool_packing = packing; -} - -int wxAuiToolBar::GetToolPacking() const -{ - return m_tool_packing; -} - - -void wxAuiToolBar::SetOrientation(int WXUNUSED(orientation)) -{ -} - -void wxAuiToolBar::SetMargins(int left, int right, int top, int bottom) -{ - if (left != -1) - m_left_padding = left; - if (right != -1) - m_right_padding = right; - if (top != -1) - m_top_padding = top; - if (bottom != -1) - m_bottom_padding = bottom; -} - -bool wxAuiToolBar::GetGripperVisible() const -{ - return m_gripper_visible; -} - -void wxAuiToolBar::SetGripperVisible(bool visible) -{ - m_gripper_visible = visible; - if (visible) - m_style |= wxAUI_TB_GRIPPER; - else - m_style &= ~wxAUI_TB_GRIPPER; - Realize(); - Refresh(false); -} - - -bool wxAuiToolBar::GetOverflowVisible() const -{ - return m_overflow_visible; -} - -void wxAuiToolBar::SetOverflowVisible(bool visible) -{ - m_overflow_visible = visible; - if (visible) - m_style |= wxAUI_TB_OVERFLOW; - else - m_style &= ~wxAUI_TB_OVERFLOW; - Refresh(false); -} - -bool wxAuiToolBar::SetFont(const wxFont& font) -{ - bool res = wxWindow::SetFont(font); - - if (m_art) - { - m_art->SetFont(font); - } - - return res; -} - - -void wxAuiToolBar::SetHoverItem(wxAuiToolBarItem* pitem) -{ - wxAuiToolBarItem* former_hover = NULL; - - size_t i, count; - for (i = 0, count = m_items.GetCount(); i < count; ++i) - { - wxAuiToolBarItem& item = m_items.Item(i); - if (item.state & wxAUI_BUTTON_STATE_HOVER) - former_hover = &item; - item.state &= ~wxAUI_BUTTON_STATE_HOVER; - } - - if (pitem) - { - pitem->state |= wxAUI_BUTTON_STATE_HOVER; - } - - if (former_hover != pitem) - { - Refresh(false); - Update(); - } -} - -void wxAuiToolBar::SetPressedItem(wxAuiToolBarItem* pitem) -{ - wxAuiToolBarItem* former_item = NULL; - - size_t i, count; - for (i = 0, count = m_items.GetCount(); i < count; ++i) - { - wxAuiToolBarItem& item = m_items.Item(i); - if (item.state & wxAUI_BUTTON_STATE_PRESSED) - former_item = &item; - item.state &= ~wxAUI_BUTTON_STATE_PRESSED; - } - - if (pitem) - { - pitem->state &= ~wxAUI_BUTTON_STATE_HOVER; - pitem->state |= wxAUI_BUTTON_STATE_PRESSED; - } - - if (former_item != pitem) - { - Refresh(false); - Update(); - } -} - -void wxAuiToolBar::RefreshOverflowState() -{ - if (!m_overflow_sizer_item) - { - m_overflow_state = 0; - return; - } - - int overflow_state = 0; - - wxRect overflow_rect = GetOverflowRect(); - - - // find out the mouse's current position - wxPoint pt = ::wxGetMousePosition(); - pt = this->ScreenToClient(pt); - - // find out if the mouse cursor is inside the dropdown rectangle - if (overflow_rect.Contains(pt.x, pt.y)) - { - if (::wxGetMouseState().LeftDown()) - overflow_state = wxAUI_BUTTON_STATE_PRESSED; - else - overflow_state = wxAUI_BUTTON_STATE_HOVER; - } - - if (overflow_state != m_overflow_state) - { - m_overflow_state = overflow_state; - Refresh(false); - Update(); - } - - m_overflow_state = overflow_state; -} - -void wxAuiToolBar::ToggleTool(int tool_id, bool state) -{ - wxAuiToolBarItem* tool = FindTool(tool_id); - - if (tool && (tool->kind == wxITEM_CHECK || tool->kind == wxITEM_RADIO)) - { - if (tool->kind == wxITEM_RADIO) - { - int i, idx, count; - idx = GetToolIndex(tool_id); - count = (int)m_items.GetCount(); - - if (idx >= 0 && idx < count) - { - for (i = idx; i < count; ++i) - { - if (m_items[i].kind != wxITEM_RADIO) - break; - m_items[i].state &= ~wxAUI_BUTTON_STATE_CHECKED; - } - for (i = idx; i > 0; i--) - { - if (m_items[i].kind != wxITEM_RADIO) - break; - m_items[i].state &= ~wxAUI_BUTTON_STATE_CHECKED; - } - } - - tool->state |= wxAUI_BUTTON_STATE_CHECKED; - } - else if (tool->kind == wxITEM_CHECK) - { - if (state == true) - tool->state |= wxAUI_BUTTON_STATE_CHECKED; - else - tool->state &= ~wxAUI_BUTTON_STATE_CHECKED; - } - } -} - -bool wxAuiToolBar::GetToolToggled(int tool_id) const -{ - wxAuiToolBarItem* tool = FindTool(tool_id); - - if (tool) - { - if ( (tool->kind != wxITEM_CHECK) && (tool->kind != wxITEM_RADIO) ) - return false; - - return (tool->state & wxAUI_BUTTON_STATE_CHECKED) ? true : false; - } - - return false; -} - -void wxAuiToolBar::EnableTool(int tool_id, bool state) -{ - wxAuiToolBarItem* tool = FindTool(tool_id); - - if (tool) - { - if (state == true) - tool->state &= ~wxAUI_BUTTON_STATE_DISABLED; - else - tool->state |= wxAUI_BUTTON_STATE_DISABLED; - } -} - -bool wxAuiToolBar::GetToolEnabled(int tool_id) const -{ - wxAuiToolBarItem* tool = FindTool(tool_id); - - if (tool) - return (tool->state & wxAUI_BUTTON_STATE_DISABLED) ? false : true; - - return false; -} - -wxString wxAuiToolBar::GetToolLabel(int tool_id) const -{ - wxAuiToolBarItem* tool = FindTool(tool_id); - wxASSERT_MSG(tool, wxT("can't find tool in toolbar item array")); - if (!tool) - return wxEmptyString; - - return tool->label; -} - -void wxAuiToolBar::SetToolLabel(int tool_id, const wxString& label) -{ - wxAuiToolBarItem* tool = FindTool(tool_id); - if (tool) - { - tool->label = label; - } -} - -wxBitmap wxAuiToolBar::GetToolBitmap(int tool_id) const -{ - wxAuiToolBarItem* tool = FindTool(tool_id); - wxASSERT_MSG(tool, wxT("can't find tool in toolbar item array")); - if (!tool) - return wxNullBitmap; - - return tool->bitmap; -} - -void wxAuiToolBar::SetToolBitmap(int tool_id, const wxBitmap& bitmap) -{ - wxAuiToolBarItem* tool = FindTool(tool_id); - if (tool) - { - tool->bitmap = bitmap; - } -} - -wxString wxAuiToolBar::GetToolShortHelp(int tool_id) const -{ - wxAuiToolBarItem* tool = FindTool(tool_id); - wxASSERT_MSG(tool, wxT("can't find tool in toolbar item array")); - if (!tool) - return wxEmptyString; - - return tool->short_help; -} - -void wxAuiToolBar::SetToolShortHelp(int tool_id, const wxString& help_string) -{ - wxAuiToolBarItem* tool = FindTool(tool_id); - if (tool) - { - tool->short_help = help_string; - } -} - -wxString wxAuiToolBar::GetToolLongHelp(int tool_id) const -{ - wxAuiToolBarItem* tool = FindTool(tool_id); - wxASSERT_MSG(tool, wxT("can't find tool in toolbar item array")); - if (!tool) - return wxEmptyString; - - return tool->long_help; -} - -void wxAuiToolBar::SetToolLongHelp(int tool_id, const wxString& help_string) -{ - wxAuiToolBarItem* tool = FindTool(tool_id); - if (tool) - { - tool->long_help = help_string; - } -} - -void wxAuiToolBar::SetCustomOverflowItems(const wxAuiToolBarItemArray& prepend, - const wxAuiToolBarItemArray& append) -{ - m_custom_overflow_prepend = prepend; - m_custom_overflow_append = append; -} - - -size_t wxAuiToolBar::GetToolCount() const -{ - return m_items.size(); -} - -int wxAuiToolBar::GetToolIndex(int tool_id) const -{ - // this will prevent us from returning the index of the - // first separator in the toolbar since its id is equal to -1 - if (tool_id == -1) - return wxNOT_FOUND; - - size_t i, count = m_items.GetCount(); - for (i = 0; i < count; ++i) - { - wxAuiToolBarItem& item = m_items.Item(i); - if (item.id == tool_id) - return i; - } - - return wxNOT_FOUND; -} - -bool wxAuiToolBar::GetToolFitsByIndex(int tool_idx) const -{ - if (tool_idx < 0 || tool_idx >= (int)m_items.GetCount()) - return false; - - if (!m_items[tool_idx].sizer_item) - return false; - - int cli_w, cli_h; - GetClientSize(&cli_w, &cli_h); - - wxRect rect = m_items[tool_idx].sizer_item->GetRect(); - - if (m_style & wxAUI_TB_VERTICAL) - { - // take the dropdown size into account - if (m_overflow_visible) - cli_h -= m_overflow_sizer_item->GetSize().y; - - if (rect.y+rect.height < cli_h) - return true; - } - else - { - // take the dropdown size into account - if (m_overflow_visible) - cli_w -= m_overflow_sizer_item->GetSize().x; - - if (rect.x+rect.width < cli_w) - return true; - } - - return false; -} - - -bool wxAuiToolBar::GetToolFits(int tool_id) const -{ - return GetToolFitsByIndex(GetToolIndex(tool_id)); -} - -wxRect wxAuiToolBar::GetToolRect(int tool_id) const -{ - wxAuiToolBarItem* tool = FindTool(tool_id); - if (tool && tool->sizer_item) - { - return tool->sizer_item->GetRect(); - } - - return wxRect(); -} - -bool wxAuiToolBar::GetToolBarFits() const -{ - if (m_items.GetCount() == 0) - { - // empty toolbar always 'fits' - return true; - } - - // entire toolbar content fits if the last tool fits - return GetToolFitsByIndex(m_items.GetCount() - 1); -} - -bool wxAuiToolBar::Realize() -{ - wxClientDC dc(this); - if (!dc.IsOk()) - return false; - - bool horizontal = true; - if (m_style & wxAUI_TB_VERTICAL) - horizontal = false; - - - // create the new sizer to add toolbar elements to - wxBoxSizer* sizer = new wxBoxSizer(horizontal ? wxHORIZONTAL : wxVERTICAL); - - // add gripper area - int separator_size = m_art->GetElementSize(wxAUI_TBART_SEPARATOR_SIZE); - int gripper_size = m_art->GetElementSize(wxAUI_TBART_GRIPPER_SIZE); - if (gripper_size > 0 && m_gripper_visible) - { - if (horizontal) - m_gripper_sizer_item = sizer->Add(gripper_size, 1, 0, wxEXPAND); - else - m_gripper_sizer_item = sizer->Add(1, gripper_size, 0, wxEXPAND); - } - else - { - m_gripper_sizer_item = NULL; - } - - // add "left" padding - if (m_left_padding > 0) - { - if (horizontal) - sizer->Add(m_left_padding, 1); - else - sizer->Add(1, m_left_padding); - } - - size_t i, count; - for (i = 0, count = m_items.GetCount(); i < count; ++i) - { - wxAuiToolBarItem& item = m_items.Item(i); - wxSizerItem* sizer_item = NULL; - - switch (item.kind) - { - case wxITEM_LABEL: - { - wxSize size = m_art->GetLabelSize(dc, this, item); - sizer_item = sizer->Add(size.x + (m_tool_border_padding*2), - size.y + (m_tool_border_padding*2), - item.proportion, - wxALIGN_CENTER); - if (i+1 < count) - { - sizer->AddSpacer(m_tool_packing); - } - - break; - } - - case wxITEM_CHECK: - case wxITEM_NORMAL: - case wxITEM_RADIO: - { - wxSize size = m_art->GetToolSize(dc, this, item); - sizer_item = sizer->Add(size.x + (m_tool_border_padding*2), - size.y + (m_tool_border_padding*2), - 0, - wxALIGN_CENTER); - // add tool packing - if (i+1 < count) - { - sizer->AddSpacer(m_tool_packing); - } - - break; - } - - case wxITEM_SEPARATOR: - { - if (horizontal) - sizer_item = sizer->Add(separator_size, 1, 0, wxEXPAND); - else - sizer_item = sizer->Add(1, separator_size, 0, wxEXPAND); - - // add tool packing - if (i+1 < count) - { - sizer->AddSpacer(m_tool_packing); - } - - break; - } - - case wxITEM_SPACER: - if (item.proportion > 0) - sizer_item = sizer->AddStretchSpacer(item.proportion); - else - sizer_item = sizer->Add(item.spacer_pixels, 1); - break; - - case wxITEM_CONTROL: - { - //sizer_item = sizer->Add(item.window, item.proportion, wxEXPAND); - wxSizerItem* ctrl_sizer_item; - - wxBoxSizer* vert_sizer = new wxBoxSizer(wxVERTICAL); - vert_sizer->AddStretchSpacer(1); - ctrl_sizer_item = vert_sizer->Add(item.window, 0, wxEXPAND); - vert_sizer->AddStretchSpacer(1); - if ( (m_style & wxAUI_TB_TEXT) && - m_tool_text_orientation == wxAUI_TBTOOL_TEXT_BOTTOM && - !item.GetLabel().empty() ) - { - wxSize s = GetLabelSize(item.GetLabel()); - vert_sizer->Add(1, s.y); - } - - - sizer_item = sizer->Add(vert_sizer, item.proportion, wxEXPAND); - - wxSize min_size = item.min_size; - - - // proportional items will disappear from the toolbar if - // their min width is not set to something really small - if (item.proportion != 0) - { - min_size.x = 1; - } - - if (min_size.IsFullySpecified()) - { - sizer_item->SetMinSize(min_size); - ctrl_sizer_item->SetMinSize(min_size); - } - - // add tool packing - if (i+1 < count) - { - sizer->AddSpacer(m_tool_packing); - } - } - } - - item.sizer_item = sizer_item; - } - - // add "right" padding - if (m_right_padding > 0) - { - if (horizontal) - sizer->Add(m_right_padding, 1); - else - sizer->Add(1, m_right_padding); - } - - // add drop down area - m_overflow_sizer_item = NULL; - - if (m_style & wxAUI_TB_OVERFLOW) - { - int overflow_size = m_art->GetElementSize(wxAUI_TBART_OVERFLOW_SIZE); - if (overflow_size > 0 && m_overflow_visible) - { - if (horizontal) - m_overflow_sizer_item = sizer->Add(overflow_size, 1, 0, wxEXPAND); - else - m_overflow_sizer_item = sizer->Add(1, overflow_size, 0, wxEXPAND); - } - else - { - m_overflow_sizer_item = NULL; - } - } - - - // the outside sizer helps us apply the "top" and "bottom" padding - wxBoxSizer* outside_sizer = new wxBoxSizer(horizontal ? wxVERTICAL : wxHORIZONTAL); - - // add "top" padding - if (m_top_padding > 0) - { - if (horizontal) - outside_sizer->Add(1, m_top_padding); - else - outside_sizer->Add(m_top_padding, 1); - } - - // add the sizer that contains all of the toolbar elements - outside_sizer->Add(sizer, 1, wxEXPAND); - - // add "bottom" padding - if (m_bottom_padding > 0) - { - if (horizontal) - outside_sizer->Add(1, m_bottom_padding); - else - outside_sizer->Add(m_bottom_padding, 1); - } - - delete m_sizer; // remove old sizer - m_sizer = outside_sizer; - - // calculate the rock-bottom minimum size - for (i = 0, count = m_items.GetCount(); i < count; ++i) - { - wxAuiToolBarItem& item = m_items.Item(i); - if (item.sizer_item && item.proportion > 0 && item.min_size.IsFullySpecified()) - item.sizer_item->SetMinSize(0,0); - } - - m_absolute_min_size = m_sizer->GetMinSize(); - - // reset the min sizes to what they were - for (i = 0, count = m_items.GetCount(); i < count; ++i) - { - wxAuiToolBarItem& item = m_items.Item(i); - if (item.sizer_item && item.proportion > 0 && item.min_size.IsFullySpecified()) - item.sizer_item->SetMinSize(item.min_size); - } - - // set control size - wxSize size = m_sizer->GetMinSize(); - m_minWidth = size.x; - m_minHeight = size.y; - - if ((m_style & wxAUI_TB_NO_AUTORESIZE) == 0) - { - wxSize cur_size = GetClientSize(); - wxSize new_size = GetMinSize(); - if (new_size != cur_size) - { - SetClientSize(new_size); - } - else - { - m_sizer->SetDimension(0, 0, cur_size.x, cur_size.y); - } - } - else - { - wxSize cur_size = GetClientSize(); - m_sizer->SetDimension(0, 0, cur_size.x, cur_size.y); - } - - Refresh(false); - return true; -} - -int wxAuiToolBar::GetOverflowState() const -{ - return m_overflow_state; -} - -wxRect wxAuiToolBar::GetOverflowRect() const -{ - wxRect cli_rect(wxPoint(0,0), GetClientSize()); - wxRect overflow_rect = m_overflow_sizer_item->GetRect(); - int overflow_size = m_art->GetElementSize(wxAUI_TBART_OVERFLOW_SIZE); - - if (m_style & wxAUI_TB_VERTICAL) - { - overflow_rect.y = cli_rect.height - overflow_size; - overflow_rect.x = 0; - overflow_rect.width = cli_rect.width; - overflow_rect.height = overflow_size; - } - else - { - overflow_rect.x = cli_rect.width - overflow_size; - overflow_rect.y = 0; - overflow_rect.width = overflow_size; - overflow_rect.height = cli_rect.height; - } - - return overflow_rect; -} - -wxSize wxAuiToolBar::GetLabelSize(const wxString& label) -{ - wxClientDC dc(this); - - int tx, ty; - int text_width = 0, text_height = 0; - - dc.SetFont(m_font); - - // get the text height - dc.GetTextExtent(wxT("ABCDHgj"), &tx, &text_height); - - // get the text width - dc.GetTextExtent(label, &text_width, &ty); - - return wxSize(text_width, text_height); -} - - -void wxAuiToolBar::DoIdleUpdate() -{ - wxEvtHandler* handler = GetEventHandler(); - - bool need_refresh = false; - - size_t i, count; - for (i = 0, count = m_items.GetCount(); i < count; ++i) - { - wxAuiToolBarItem& item = m_items.Item(i); - - if (item.id == -1) - continue; - - wxUpdateUIEvent evt(item.id); - evt.SetEventObject(this); - - if (handler->ProcessEvent(evt)) - { - if (evt.GetSetEnabled()) - { - bool is_enabled; - if (item.window) - is_enabled = item.window->IsEnabled(); - else - is_enabled = (item.state & wxAUI_BUTTON_STATE_DISABLED) ? false : true; - - bool new_enabled = evt.GetEnabled(); - if (new_enabled != is_enabled) - { - if (item.window) - { - item.window->Enable(new_enabled); - } - else - { - if (new_enabled) - item.state &= ~wxAUI_BUTTON_STATE_DISABLED; - else - item.state |= wxAUI_BUTTON_STATE_DISABLED; - } - need_refresh = true; - } - } - - if (evt.GetSetChecked()) - { - // make sure we aren't checking an item that can't be - if (item.kind != wxITEM_CHECK && item.kind != wxITEM_RADIO) - continue; - - bool is_checked = (item.state & wxAUI_BUTTON_STATE_CHECKED) ? true : false; - bool new_checked = evt.GetChecked(); - - if (new_checked != is_checked) - { - if (new_checked) - item.state |= wxAUI_BUTTON_STATE_CHECKED; - else - item.state &= ~wxAUI_BUTTON_STATE_CHECKED; - - need_refresh = true; - } - } - - } - } - - - if (need_refresh) - { - Refresh(false); - } -} - - -void wxAuiToolBar::OnSize(wxSizeEvent& WXUNUSED(evt)) -{ - int x, y; - GetClientSize(&x, &y); - - if (x > y) - SetOrientation(wxHORIZONTAL); - else - SetOrientation(wxVERTICAL); - - if (((x >= y) && m_absolute_min_size.x > x) || - ((y > x) && m_absolute_min_size.y > y)) - { - // hide all flexible items - size_t i, count; - for (i = 0, count = m_items.GetCount(); i < count; ++i) - { - wxAuiToolBarItem& item = m_items.Item(i); - if (item.sizer_item && item.proportion > 0 && item.sizer_item->IsShown()) - { - item.sizer_item->Show(false); - item.sizer_item->SetProportion(0); - } - } - } - else - { - // show all flexible items - size_t i, count; - for (i = 0, count = m_items.GetCount(); i < count; ++i) - { - wxAuiToolBarItem& item = m_items.Item(i); - if (item.sizer_item && item.proportion > 0 && !item.sizer_item->IsShown()) - { - item.sizer_item->Show(true); - item.sizer_item->SetProportion(item.proportion); - } - } - } - - m_sizer->SetDimension(0, 0, x, y); - - Refresh(false); - Update(); -} - - - -void wxAuiToolBar::DoSetSize(int x, - int y, - int width, - int height, - int sizeFlags) -{ - wxSize parent_size = GetParent()->GetClientSize(); - if (x + width > parent_size.x) - width = wxMax(0, parent_size.x - x); - if (y + height > parent_size.y) - height = wxMax(0, parent_size.y - y); - - wxWindow::DoSetSize(x, y, width, height, sizeFlags); -} - - -void wxAuiToolBar::OnIdle(wxIdleEvent& evt) -{ - DoIdleUpdate(); - evt.Skip(); -} - -void wxAuiToolBar::OnPaint(wxPaintEvent& WXUNUSED(evt)) -{ - wxBufferedPaintDC dc(this); - wxRect cli_rect(wxPoint(0,0), GetClientSize()); - - - bool horizontal = true; - if (m_style & wxAUI_TB_VERTICAL) - horizontal = false; - - - m_art->DrawBackground(dc, this, cli_rect); - - int gripper_size = m_art->GetElementSize(wxAUI_TBART_GRIPPER_SIZE); - int dropdown_size = m_art->GetElementSize(wxAUI_TBART_OVERFLOW_SIZE); - - // paint the gripper - if (gripper_size > 0 && m_gripper_sizer_item) - { - wxRect gripper_rect = m_gripper_sizer_item->GetRect(); - if (horizontal) - gripper_rect.width = gripper_size; - else - gripper_rect.height = gripper_size; - m_art->DrawGripper(dc, this, gripper_rect); - } - - // calculated how far we can draw items - int last_extent; - if (horizontal) - last_extent = cli_rect.width; - else - last_extent = cli_rect.height; - if (m_overflow_visible) - last_extent -= dropdown_size; - - // paint each individual tool - size_t i, count = m_items.GetCount(); - for (i = 0; i < count; ++i) - { - wxAuiToolBarItem& item = m_items.Item(i); - - if (!item.sizer_item) - continue; - - wxRect item_rect = item.sizer_item->GetRect(); - - - if ((horizontal && item_rect.x + item_rect.width >= last_extent) || - (!horizontal && item_rect.y + item_rect.height >= last_extent)) - { - break; - } - - if (item.kind == wxITEM_SEPARATOR) - { - // draw a separator - m_art->DrawSeparator(dc, this, item_rect); - } - else if (item.kind == wxITEM_LABEL) - { - // draw a text label only - m_art->DrawLabel(dc, this, item, item_rect); - } - else if (item.kind == wxITEM_NORMAL) - { - // draw a regular button or dropdown button - if (!item.dropdown) - m_art->DrawButton(dc, this, item, item_rect); - else - m_art->DrawDropDownButton(dc, this, item, item_rect); - } - else if (item.kind == wxITEM_CHECK) - { - // draw a toggle button - m_art->DrawButton(dc, this, item, item_rect); - } - else if (item.kind == wxITEM_RADIO) - { - // draw a toggle button - m_art->DrawButton(dc, this, item, item_rect); - } - else if (item.kind == wxITEM_CONTROL) - { - // draw the control's label - m_art->DrawControlLabel(dc, this, item, item_rect); - } - - // fire a signal to see if the item wants to be custom-rendered - OnCustomRender(dc, item, item_rect); - } - - // paint the overflow button - if (dropdown_size > 0 && m_overflow_sizer_item) - { - wxRect dropdown_rect = GetOverflowRect(); - m_art->DrawOverflowButton(dc, this, dropdown_rect, m_overflow_state); - } -} - -void wxAuiToolBar::OnEraseBackground(wxEraseEvent& WXUNUSED(evt)) -{ - // empty -} - -void wxAuiToolBar::OnLeftDown(wxMouseEvent& evt) -{ - wxRect cli_rect(wxPoint(0,0), GetClientSize()); - - if (m_gripper_sizer_item) - { - wxRect gripper_rect = m_gripper_sizer_item->GetRect(); - if (gripper_rect.Contains(evt.GetX(), evt.GetY())) - { - // find aui manager - wxAuiManager* manager = wxAuiManager::GetManager(this); - if (!manager) - return; - - int x_drag_offset = evt.GetX() - gripper_rect.GetX(); - int y_drag_offset = evt.GetY() - gripper_rect.GetY(); - - // gripper was clicked - manager->StartPaneDrag(this, wxPoint(x_drag_offset, y_drag_offset)); - return; - } - } - - if (m_overflow_sizer_item) - { - wxRect overflow_rect = GetOverflowRect(); - - if (m_art && - m_overflow_visible && - overflow_rect.Contains(evt.m_x, evt.m_y)) - { - wxAuiToolBarEvent e(wxEVT_COMMAND_AUITOOLBAR_OVERFLOW_CLICK, -1); - e.SetEventObject(this); - e.SetToolId(-1); - e.SetClickPoint(wxPoint(evt.GetX(), evt.GetY())); - bool processed = ProcessEvent(e); - - if (processed) - { - DoIdleUpdate(); - } - else - { - size_t i, count; - wxAuiToolBarItemArray overflow_items; - - - // add custom overflow prepend items, if any - count = m_custom_overflow_prepend.GetCount(); - for (i = 0; i < count; ++i) - overflow_items.Add(m_custom_overflow_prepend[i]); - - // only show items that don't fit in the dropdown - count = m_items.GetCount(); - for (i = 0; i < count; ++i) - { - if (!GetToolFitsByIndex(i)) - overflow_items.Add(m_items[i]); - } - - // add custom overflow append items, if any - count = m_custom_overflow_append.GetCount(); - for (i = 0; i < count; ++i) - overflow_items.Add(m_custom_overflow_append[i]); - - int res = m_art->ShowDropDown(this, overflow_items); - m_overflow_state = 0; - Refresh(false); - if (res != -1) - { - wxCommandEvent e(wxEVT_COMMAND_MENU_SELECTED, res); - e.SetEventObject(this); - GetParent()->ProcessEvent(e); - } - } - - return; - } - } - - m_dragging = false; - m_action_pos = wxPoint(evt.GetX(), evt.GetY()); - m_action_item = FindToolByPosition(evt.GetX(), evt.GetY()); - - if (m_action_item) - { - if (m_action_item->state & wxAUI_BUTTON_STATE_DISABLED) - { - m_action_pos = wxPoint(-1,-1); - m_action_item = NULL; - return; - } - - SetPressedItem(m_action_item); - - // fire the tool dropdown event - wxAuiToolBarEvent e(wxEVT_COMMAND_AUITOOLBAR_TOOL_DROPDOWN, m_action_item->id); - e.SetEventObject(this); - e.SetToolId(m_action_item->id); - e.SetDropDownClicked(false); - - int mouse_x = evt.GetX(); - wxRect rect = m_action_item->sizer_item->GetRect(); - - if (m_action_item->dropdown && - mouse_x >= (rect.x+rect.width-BUTTON_DROPDOWN_WIDTH-1) && - mouse_x < (rect.x+rect.width)) - { - e.SetDropDownClicked(true); - } - - e.SetClickPoint(evt.GetPosition()); - e.SetItemRect(rect); - ProcessEvent(e); - DoIdleUpdate(); - } -} - -void wxAuiToolBar::OnLeftUp(wxMouseEvent& evt) -{ - SetPressedItem(NULL); - - wxAuiToolBarItem* hit_item = FindToolByPosition(evt.GetX(), evt.GetY()); - if (hit_item && !(hit_item->state & wxAUI_BUTTON_STATE_DISABLED)) - { - SetHoverItem(hit_item); - } - - - if (m_dragging) - { - // reset drag and drop member variables - m_dragging = false; - m_action_pos = wxPoint(-1,-1); - m_action_item = NULL; - return; - } - else - { - wxAuiToolBarItem* hit_item; - hit_item = FindToolByPosition(evt.GetX(), evt.GetY()); - - if (m_action_item && hit_item == m_action_item) - { - UnsetToolTip(); - - if (hit_item->kind == wxITEM_CHECK || hit_item->kind == wxITEM_RADIO) - { - bool toggle = false; - - if (m_action_item->state & wxAUI_BUTTON_STATE_CHECKED) - toggle = false; - else - toggle = true; - - ToggleTool(m_action_item->id, toggle); - - // repaint immediately - Refresh(false); - Update(); - - wxCommandEvent e(wxEVT_COMMAND_MENU_SELECTED, m_action_item->id); - e.SetEventObject(this); - e.SetInt(toggle); - ProcessEvent(e); - DoIdleUpdate(); - } - else - { - wxCommandEvent e(wxEVT_COMMAND_MENU_SELECTED, m_action_item->id); - e.SetEventObject(this); - ProcessEvent(e); - DoIdleUpdate(); - } - } - } - - // reset drag and drop member variables - m_dragging = false; - m_action_pos = wxPoint(-1,-1); - m_action_item = NULL; -} - -void wxAuiToolBar::OnRightDown(wxMouseEvent& evt) -{ - wxRect cli_rect(wxPoint(0,0), GetClientSize()); - - if (m_gripper_sizer_item) - { - wxRect gripper_rect = m_gripper_sizer_item->GetRect(); - if (gripper_rect.Contains(evt.GetX(), evt.GetY())) - return; - } - - if (m_overflow_sizer_item) - { - int dropdown_size = m_art->GetElementSize(wxAUI_TBART_OVERFLOW_SIZE); - if (dropdown_size > 0 && - evt.m_x > cli_rect.width - dropdown_size && - evt.m_y >= 0 && - evt.m_y < cli_rect.height && - m_art) - { - return; - } - } - - m_action_pos = wxPoint(evt.GetX(), evt.GetY()); - m_action_item = FindToolByPosition(evt.GetX(), evt.GetY()); - - if (m_action_item) - { - if (m_action_item->state & wxAUI_BUTTON_STATE_DISABLED) - { - m_action_pos = wxPoint(-1,-1); - m_action_item = NULL; - return; - } - } -} - -void wxAuiToolBar::OnRightUp(wxMouseEvent& evt) -{ - wxAuiToolBarItem* hit_item; - hit_item = FindToolByPosition(evt.GetX(), evt.GetY()); - - if (m_action_item && hit_item == m_action_item) - { - wxAuiToolBarEvent e(wxEVT_COMMAND_AUITOOLBAR_RIGHT_CLICK, m_action_item->id); - e.SetEventObject(this); - e.SetToolId(m_action_item->id); - e.SetClickPoint(m_action_pos); - ProcessEvent(e); - DoIdleUpdate(); - } - else - { - // right-clicked on the invalid area of the toolbar - wxAuiToolBarEvent e(wxEVT_COMMAND_AUITOOLBAR_RIGHT_CLICK, -1); - e.SetEventObject(this); - e.SetToolId(-1); - e.SetClickPoint(m_action_pos); - ProcessEvent(e); - DoIdleUpdate(); - } - - // reset member variables - m_action_pos = wxPoint(-1,-1); - m_action_item = NULL; -} - -void wxAuiToolBar::OnMiddleDown(wxMouseEvent& evt) -{ - wxRect cli_rect(wxPoint(0,0), GetClientSize()); - - if (m_gripper_sizer_item) - { - wxRect gripper_rect = m_gripper_sizer_item->GetRect(); - if (gripper_rect.Contains(evt.GetX(), evt.GetY())) - return; - } - - if (m_overflow_sizer_item) - { - int dropdown_size = m_art->GetElementSize(wxAUI_TBART_OVERFLOW_SIZE); - if (dropdown_size > 0 && - evt.m_x > cli_rect.width - dropdown_size && - evt.m_y >= 0 && - evt.m_y < cli_rect.height && - m_art) - { - return; - } - } - - m_action_pos = wxPoint(evt.GetX(), evt.GetY()); - m_action_item = FindToolByPosition(evt.GetX(), evt.GetY()); - - if (m_action_item) - { - if (m_action_item->state & wxAUI_BUTTON_STATE_DISABLED) - { - m_action_pos = wxPoint(-1,-1); - m_action_item = NULL; - return; - } - } -} - -void wxAuiToolBar::OnMiddleUp(wxMouseEvent& evt) -{ - wxAuiToolBarItem* hit_item; - hit_item = FindToolByPosition(evt.GetX(), evt.GetY()); - - if (m_action_item && hit_item == m_action_item) - { - if (hit_item->kind == wxITEM_NORMAL) - { - wxAuiToolBarEvent e(wxEVT_COMMAND_AUITOOLBAR_MIDDLE_CLICK, m_action_item->id); - e.SetEventObject(this); - e.SetToolId(m_action_item->id); - e.SetClickPoint(m_action_pos); - ProcessEvent(e); - DoIdleUpdate(); - } - } - - // reset member variables - m_action_pos = wxPoint(-1,-1); - m_action_item = NULL; -} - -void wxAuiToolBar::OnMotion(wxMouseEvent& evt) -{ - // start a drag event - if (!m_dragging && - m_action_item != NULL && - m_action_pos != wxPoint(-1,-1) && - abs(evt.m_x - m_action_pos.x) + abs(evt.m_y - m_action_pos.y) > 5) - { - UnsetToolTip(); - - m_dragging = true; - - wxAuiToolBarEvent e(wxEVT_COMMAND_AUITOOLBAR_BEGIN_DRAG, GetId()); - e.SetEventObject(this); - e.SetToolId(m_action_item->id); - ProcessEvent(e); - DoIdleUpdate(); - return; - } - - wxAuiToolBarItem* hit_item = FindToolByPosition(evt.GetX(), evt.GetY()); - if (hit_item) - { - if (!(hit_item->state & wxAUI_BUTTON_STATE_DISABLED)) - SetHoverItem(hit_item); - else - SetHoverItem(NULL); - } - else - { - // no hit item, remove any hit item - SetHoverItem(hit_item); - } - - // figure out tooltips - wxAuiToolBarItem* packing_hit_item; - packing_hit_item = FindToolByPositionWithPacking(evt.GetX(), evt.GetY()); - if (packing_hit_item) - { - if (packing_hit_item != m_tip_item) - { - m_tip_item = packing_hit_item; - - if ( !packing_hit_item->short_help.empty() ) - SetToolTip(packing_hit_item->short_help); - else - UnsetToolTip(); - } - } - else - { - UnsetToolTip(); - m_tip_item = NULL; - } - - // if we've pressed down an item and we're hovering - // over it, make sure it's state is set to pressed - if (m_action_item) - { - if (m_action_item == hit_item) - SetPressedItem(m_action_item); - else - SetPressedItem(NULL); - } - - // figure out the dropdown button state (are we hovering or pressing it?) - RefreshOverflowState(); -} - -void wxAuiToolBar::OnLeaveWindow(wxMouseEvent& WXUNUSED(evt)) -{ - RefreshOverflowState(); - SetHoverItem(NULL); - SetPressedItem(NULL); - - m_tip_item = NULL; -} - - -void wxAuiToolBar::OnSetCursor(wxSetCursorEvent& evt) -{ - wxCursor cursor = wxNullCursor; - - if (m_gripper_sizer_item) - { - wxRect gripper_rect = m_gripper_sizer_item->GetRect(); - if (gripper_rect.Contains(evt.GetX(), evt.GetY())) - { - cursor = wxCursor(wxCURSOR_SIZING); - } - } - - evt.SetCursor(cursor); -} - - -#endif // wxUSE_AUI - diff --git a/wxWidgets/src/aui/auibook.cpp b/wxWidgets/src/aui/auibook.cpp deleted file mode 100644 index 5ed39058fb..0000000000 --- a/wxWidgets/src/aui/auibook.cpp +++ /dev/null @@ -1,4610 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: src/aui/auibook.cpp -// Purpose: wxaui: wx advanced user interface - notebook -// Author: Benjamin I. Williams -// Modified by: -// Created: 2006-06-28 -// Copyright: (C) Copyright 2006, Kirix Corporation, All Rights Reserved -// Licence: wxWindows Library Licence, Version 3.1 -/////////////////////////////////////////////////////////////////////////////// - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_AUI - -#include "wx/aui/auibook.h" - -#ifndef WX_PRECOMP - #include "wx/settings.h" - #include "wx/image.h" - #include "wx/menu.h" -#endif - -#include "wx/aui/tabmdi.h" -#include "wx/dcbuffer.h" -#include "wx/log.h" - -#ifdef __WXMSW__ -#include "wx/msw/private.h" -#endif - -#ifdef __WXMAC__ -#include "wx/mac/carbon/private.h" -#endif - -#ifdef __WXGTK__ -#include -#include "wx/gtk/win_gtk.h" -#endif - -#include "wx/arrimpl.cpp" -WX_DEFINE_OBJARRAY(wxAuiNotebookPageArray) -WX_DEFINE_OBJARRAY(wxAuiTabContainerButtonArray) - -DEFINE_EVENT_TYPE(wxEVT_COMMAND_AUINOTEBOOK_PAGE_CLOSE) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_AUINOTEBOOK_PAGE_CLOSED) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_AUINOTEBOOK_PAGE_CHANGING) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_AUINOTEBOOK_PAGE_CHANGED) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_AUINOTEBOOK_BUTTON) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_AUINOTEBOOK_BEGIN_DRAG) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_AUINOTEBOOK_END_DRAG) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_AUINOTEBOOK_DRAG_MOTION) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_AUINOTEBOOK_ALLOW_DND) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_AUINOTEBOOK_BG_DCLICK) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_AUINOTEBOOK_DRAG_DONE) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_AUINOTEBOOK_TAB_MIDDLE_UP) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_AUINOTEBOOK_TAB_MIDDLE_DOWN) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_AUINOTEBOOK_TAB_RIGHT_UP) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_AUINOTEBOOK_TAB_RIGHT_DOWN) - - -IMPLEMENT_CLASS(wxAuiNotebook, wxControl) -IMPLEMENT_CLASS(wxAuiTabCtrl, wxControl) -IMPLEMENT_DYNAMIC_CLASS(wxAuiNotebookEvent, wxEvent) - - - - -// these functions live in dockart.cpp -- they'll eventually -// be moved to a new utility cpp file - -wxColor wxAuiStepColour(const wxColor& c, int percent); - -wxBitmap wxAuiBitmapFromBits(const unsigned char bits[], int w, int h, - const wxColour& color); - -wxString wxAuiChopText(wxDC& dc, const wxString& text, int max_size); - -static void DrawButtons(wxDC& dc, - const wxRect& _rect, - const wxBitmap& bmp, - const wxColour& bkcolour, - int button_state) -{ - wxRect rect = _rect; - - if (button_state == wxAUI_BUTTON_STATE_PRESSED) - { - rect.x++; - rect.y++; - } - - if (button_state == wxAUI_BUTTON_STATE_HOVER || - button_state == wxAUI_BUTTON_STATE_PRESSED) - { - dc.SetBrush(wxBrush(wxAuiStepColour(bkcolour, 120))); - dc.SetPen(wxPen(wxAuiStepColour(bkcolour, 75))); - - // draw the background behind the button - dc.DrawRectangle(rect.x, rect.y, 15, 15); - } - - // draw the button itself - dc.DrawBitmap(bmp, rect.x, rect.y, true); -} - -static void IndentPressedBitmap(wxRect* rect, int button_state) -{ - if (button_state == wxAUI_BUTTON_STATE_PRESSED) - { - rect->x++; - rect->y++; - } -} - -static void DrawFocusRect(wxWindow* win, wxDC& dc, const wxRect& rect, int flags) -{ -#ifdef __WXMSW__ - wxUnusedVar(win); - wxUnusedVar(flags); - - RECT rc; - wxCopyRectToRECT(rect, rc); - - ::DrawFocusRect(GetHdcOf(dc), &rc); - -#elif defined(__WXGTK20__) - GdkWindow* gdk_window = dc.GetGDKWindow(); - wxASSERT_MSG( gdk_window, - wxT("cannot draw focus rectangle on wxDC of this type") ); - - GtkStateType state; - //if (flags & wxCONTROL_SELECTED) - // state = GTK_STATE_SELECTED; - //else - state = GTK_STATE_NORMAL; - - gtk_paint_focus( win->m_widget->style, - gdk_window, - state, - NULL, - win->m_wxwindow, - NULL, - dc.LogicalToDeviceX(rect.x), - dc.LogicalToDeviceY(rect.y), - rect.width, - rect.height ); -#elif (defined(__WXMAC__)) - -#if wxMAC_USE_CORE_GRAPHICS - { - CGRect cgrect = CGRectMake( rect.x , rect.y , rect.width, rect.height ) ; - -#if 0 - Rect bounds ; - win->GetPeer()->GetRect( &bounds ) ; - - wxLogDebug(wxT("Focus rect %d, %d, %d, %d"), rect.x, rect.y, rect.width, rect.height); - wxLogDebug(wxT("Peer rect %d, %d, %d, %d"), bounds.left, bounds.top, bounds.right - bounds.left, bounds.bottom - bounds.top); -#endif - - HIThemeFrameDrawInfo info ; - memset( &info, 0 , sizeof(info) ) ; - - info.version = 0 ; - info.kind = 0 ; - info.state = kThemeStateActive; - info.isFocused = true ; - - CGContextRef cgContext = (CGContextRef) win->MacGetCGContextRef() ; - wxASSERT( cgContext ) ; - - HIThemeDrawFocusRect( &cgrect , true , cgContext , kHIThemeOrientationNormal ) ; - } - #else - { - Rect r; - r.left = rect.x; r.top = rect.y; r.right = rect.GetRight(); r.bottom = rect.GetBottom(); - wxTopLevelWindowMac* top = win->MacGetTopLevelWindow(); - if ( top ) - { - wxPoint pt(0, 0) ; - wxMacControl::Convert( &pt , win->GetPeer() , top->GetPeer() ) ; - OffsetRect( &r , pt.x , pt.y ) ; - } - - DrawThemeFocusRect( &r , true ) ; - } -#endif -#else - wxUnusedVar(win); - wxUnusedVar(flags); - - // draw the pixels manually because the "dots" in wxPen with wxDOT style - // may be short traits and not really dots - // - // note that to behave in the same manner as DrawRect(), we must exclude - // the bottom and right borders from the rectangle - wxCoord x1 = rect.GetLeft(), - y1 = rect.GetTop(), - x2 = rect.GetRight(), - y2 = rect.GetBottom(); - - dc.SetPen(*wxBLACK_PEN); - -#ifdef __WXMAC__ - dc.SetLogicalFunction(wxCOPY); -#else - // this seems to be closer than what Windows does than wxINVERT although - // I'm still not sure if it's correct - dc.SetLogicalFunction(wxAND_REVERSE); -#endif - - wxCoord z; - for ( z = x1 + 1; z < x2; z += 2 ) - dc.DrawPoint(z, rect.GetTop()); - - wxCoord shift = z == x2 ? 0 : 1; - for ( z = y1 + shift; z < y2; z += 2 ) - dc.DrawPoint(x2, z); - - shift = z == y2 ? 0 : 1; - for ( z = x2 - shift; z > x1; z -= 2 ) - dc.DrawPoint(z, y2); - - shift = z == x1 ? 0 : 1; - for ( z = y2 - shift; z > y1; z -= 2 ) - dc.DrawPoint(x1, z); - - dc.SetLogicalFunction(wxCOPY); -#endif -} - - -// -- GUI helper classes and functions -- - -class wxAuiCommandCapture : public wxEvtHandler -{ -public: - - wxAuiCommandCapture() { m_last_id = 0; } - int GetCommandId() const { return m_last_id; } - - bool ProcessEvent(wxEvent& evt) - { - if (evt.GetEventType() == wxEVT_COMMAND_MENU_SELECTED) - { - m_last_id = evt.GetId(); - return true; - } - - if (GetNextHandler()) - return GetNextHandler()->ProcessEvent(evt); - - return false; - } - -private: - int m_last_id; -}; - - -// -- bitmaps -- - -#if defined( __WXMAC__ ) - static unsigned char close_bits[]={ - 0xFF, 0xFF, 0xFF, 0xFF, 0x0F, 0xFE, 0x03, 0xF8, 0x01, 0xF0, 0x19, 0xF3, - 0xB8, 0xE3, 0xF0, 0xE1, 0xE0, 0xE0, 0xF0, 0xE1, 0xB8, 0xE3, 0x19, 0xF3, - 0x01, 0xF0, 0x03, 0xF8, 0x0F, 0xFE, 0xFF, 0xFF }; -#elif defined( __WXGTK__) - static unsigned char close_bits[]={ - 0xff, 0xff, 0xff, 0xff, 0x07, 0xf0, 0xfb, 0xef, 0xdb, 0xed, 0x8b, 0xe8, - 0x1b, 0xec, 0x3b, 0xee, 0x1b, 0xec, 0x8b, 0xe8, 0xdb, 0xed, 0xfb, 0xef, - 0x07, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }; -#else - static unsigned char close_bits[]={ - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe7, 0xf3, 0xcf, 0xf9, - 0x9f, 0xfc, 0x3f, 0xfe, 0x3f, 0xfe, 0x9f, 0xfc, 0xcf, 0xf9, 0xe7, 0xf3, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff}; -#endif - -static unsigned char left_bits[] = { - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x7f, 0xfe, 0x3f, 0xfe, - 0x1f, 0xfe, 0x0f, 0xfe, 0x1f, 0xfe, 0x3f, 0xfe, 0x7f, 0xfe, 0xff, 0xfe, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff}; - -static unsigned char right_bits[] = { - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xdf, 0xff, 0x9f, 0xff, 0x1f, 0xff, - 0x1f, 0xfe, 0x1f, 0xfc, 0x1f, 0xfe, 0x1f, 0xff, 0x9f, 0xff, 0xdf, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff}; - -static unsigned char list_bits[] = { - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0x0f, 0xf8, 0xff, 0xff, 0x0f, 0xf8, 0x1f, 0xfc, 0x3f, 0xfe, 0x7f, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff}; - - - - - - -// -- wxAuiDefaultTabArt class implementation -- - -wxAuiDefaultTabArt::wxAuiDefaultTabArt() -{ - m_normal_font = *wxNORMAL_FONT; - m_selected_font = *wxNORMAL_FONT; - m_selected_font.SetWeight(wxBOLD); - m_measuring_font = m_selected_font; - - m_fixed_tab_width = 100; - m_tab_ctrl_height = 0; - -#ifdef __WXMAC__ - wxBrush toolbarbrush; - toolbarbrush.MacSetTheme( kThemeBrushToolbarBackground ); - wxColor base_colour = toolbarbrush.GetColour(); -#else - wxColor base_colour = wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE); -#endif - - // the base_colour is too pale to use as our base colour, - // so darken it a bit -- - if ((255-base_colour.Red()) + - (255-base_colour.Green()) + - (255-base_colour.Blue()) < 60) - { - base_colour = wxAuiStepColour(base_colour, 92); - } - - m_base_colour = base_colour; - wxColor border_colour = wxAuiStepColour(base_colour, 75); - - m_border_pen = wxPen(border_colour); - m_base_colour_pen = wxPen(m_base_colour); - m_base_colour_brush = wxBrush(m_base_colour); - - m_active_close_bmp = wxAuiBitmapFromBits(close_bits, 16, 16, *wxBLACK); - m_disabled_close_bmp = wxAuiBitmapFromBits(close_bits, 16, 16, wxColour(128,128,128)); - - m_active_left_bmp = wxAuiBitmapFromBits(left_bits, 16, 16, *wxBLACK); - m_disabled_left_bmp = wxAuiBitmapFromBits(left_bits, 16, 16, wxColour(128,128,128)); - - m_active_right_bmp = wxAuiBitmapFromBits(right_bits, 16, 16, *wxBLACK); - m_disabled_right_bmp = wxAuiBitmapFromBits(right_bits, 16, 16, wxColour(128,128,128)); - - m_active_windowlist_bmp = wxAuiBitmapFromBits(list_bits, 16, 16, *wxBLACK); - m_disabled_windowlist_bmp = wxAuiBitmapFromBits(list_bits, 16, 16, wxColour(128,128,128)); - - m_flags = 0; -} - -wxAuiDefaultTabArt::~wxAuiDefaultTabArt() -{ -} - -wxAuiTabArt* wxAuiDefaultTabArt::Clone() -{ - wxAuiDefaultTabArt* art = new wxAuiDefaultTabArt; - art->SetNormalFont(m_normal_font); - art->SetSelectedFont(m_selected_font); - art->SetMeasuringFont(m_measuring_font); - - return art; -} - -void wxAuiDefaultTabArt::SetFlags(unsigned int flags) -{ - m_flags = flags; -} - -void wxAuiDefaultTabArt::SetSizingInfo(const wxSize& tab_ctrl_size, - size_t tab_count) -{ - m_fixed_tab_width = 100; - - int tot_width = (int)tab_ctrl_size.x - GetIndentSize() - 4; - - if (m_flags & wxAUI_NB_CLOSE_BUTTON) - tot_width -= m_active_close_bmp.GetWidth(); - if (m_flags & wxAUI_NB_WINDOWLIST_BUTTON) - tot_width -= m_active_windowlist_bmp.GetWidth(); - - if (tab_count > 0) - { - m_fixed_tab_width = tot_width/(int)tab_count; - } - - - if (m_fixed_tab_width < 100) - m_fixed_tab_width = 100; - - if (m_fixed_tab_width > tot_width/2) - m_fixed_tab_width = tot_width/2; - - if (m_fixed_tab_width > 220) - m_fixed_tab_width = 220; - - m_tab_ctrl_height = tab_ctrl_size.y; -} - - -void wxAuiDefaultTabArt::DrawBackground(wxDC& dc, - wxWindow* WXUNUSED(wnd), - const wxRect& rect) -{ - // draw background - wxColor top_color = wxAuiStepColour(m_base_colour, 90); - wxColor bottom_color = wxAuiStepColour(m_base_colour, 170); - wxRect r; - - if (m_flags &wxAUI_NB_BOTTOM) - r = wxRect(rect.x, rect.y, rect.width+2, rect.height); - // TODO: else if (m_flags &wxAUI_NB_LEFT) {} - // TODO: else if (m_flags &wxAUI_NB_RIGHT) {} - else //for wxAUI_NB_TOP - r = wxRect(rect.x, rect.y, rect.width+2, rect.height-3); - dc.GradientFillLinear(r, top_color, bottom_color, wxSOUTH); - - // draw base lines - dc.SetPen(m_border_pen); - int y = rect.GetHeight(); - int w = rect.GetWidth(); - - if (m_flags &wxAUI_NB_BOTTOM) - { - dc.SetBrush(wxBrush(bottom_color)); - dc.DrawRectangle(-1, 0, w+2, 4); - } - // TODO: else if (m_flags &wxAUI_NB_LEFT) {} - // TODO: else if (m_flags &wxAUI_NB_RIGHT) {} - else //for wxAUI_NB_TOP - { - dc.SetBrush(m_base_colour_brush); - dc.DrawRectangle(-1, y-4, w+2, 4); - } -} - - -// DrawTab() draws an individual tab. -// -// dc - output dc -// in_rect - rectangle the tab should be confined to -// caption - tab's caption -// active - whether or not the tab is active -// out_rect - actual output rectangle -// x_extent - the advance x; where the next tab should start - -void wxAuiDefaultTabArt::DrawTab(wxDC& dc, - wxWindow* wnd, - const wxAuiNotebookPage& page, - const wxRect& in_rect, - int close_button_state, - wxRect* out_tab_rect, - wxRect* out_button_rect, - int* x_extent) -{ - wxCoord normal_textx, normal_texty; - wxCoord selected_textx, selected_texty; - wxCoord texty; - - // if the caption is empty, measure some temporary text - wxString caption = page.caption; - if (caption.empty()) - caption = wxT("Xj"); - - dc.SetFont(m_selected_font); - dc.GetTextExtent(caption, &selected_textx, &selected_texty); - - dc.SetFont(m_normal_font); - dc.GetTextExtent(caption, &normal_textx, &normal_texty); - - // figure out the size of the tab - wxSize tab_size = GetTabSize(dc, - wnd, - page.caption, - page.bitmap, - page.active, - close_button_state, - x_extent); - - wxCoord tab_height = m_tab_ctrl_height - 3; - wxCoord tab_width = tab_size.x; - wxCoord tab_x = in_rect.x; - wxCoord tab_y = in_rect.y + in_rect.height - tab_height; - - - caption = page.caption; - - - // select pen, brush and font for the tab to be drawn - - if (page.active) - { - dc.SetFont(m_selected_font); - texty = selected_texty; - } - else - { - dc.SetFont(m_normal_font); - texty = normal_texty; - } - - - // create points that will make the tab outline - - int clip_width = tab_width; - if (tab_x + clip_width > in_rect.x + in_rect.width) - clip_width = (in_rect.x + in_rect.width) - tab_x; - -/* - wxPoint clip_points[6]; - clip_points[0] = wxPoint(tab_x, tab_y+tab_height-3); - clip_points[1] = wxPoint(tab_x, tab_y+2); - clip_points[2] = wxPoint(tab_x+2, tab_y); - clip_points[3] = wxPoint(tab_x+clip_width-1, tab_y); - clip_points[4] = wxPoint(tab_x+clip_width+1, tab_y+2); - clip_points[5] = wxPoint(tab_x+clip_width+1, tab_y+tab_height-3); - - // FIXME: these ports don't provide wxRegion ctor from array of points -#if !defined(__WXDFB__) && !defined(__WXCOCOA__) - // set the clipping region for the tab -- - wxRegion clipping_region(WXSIZEOF(clip_points), clip_points); - dc.SetClippingRegion(clipping_region); -#endif // !wxDFB && !wxCocoa -*/ - // since the above code above doesn't play well with WXDFB or WXCOCOA, - // we'll just use a rectangle for the clipping region for now -- - dc.SetClippingRegion(tab_x, tab_y, clip_width+1, tab_height-3); - - - wxPoint border_points[6]; - if (m_flags &wxAUI_NB_BOTTOM) - { - border_points[0] = wxPoint(tab_x, tab_y); - border_points[1] = wxPoint(tab_x, tab_y+tab_height-6); - border_points[2] = wxPoint(tab_x+2, tab_y+tab_height-4); - border_points[3] = wxPoint(tab_x+tab_width-2, tab_y+tab_height-4); - border_points[4] = wxPoint(tab_x+tab_width, tab_y+tab_height-6); - border_points[5] = wxPoint(tab_x+tab_width, tab_y); - } - else //if (m_flags & wxAUI_NB_TOP) {} - { - border_points[0] = wxPoint(tab_x, tab_y+tab_height-4); - border_points[1] = wxPoint(tab_x, tab_y+2); - border_points[2] = wxPoint(tab_x+2, tab_y); - border_points[3] = wxPoint(tab_x+tab_width-2, tab_y); - border_points[4] = wxPoint(tab_x+tab_width, tab_y+2); - border_points[5] = wxPoint(tab_x+tab_width, tab_y+tab_height-4); - } - // TODO: else if (m_flags &wxAUI_NB_LEFT) {} - // TODO: else if (m_flags &wxAUI_NB_RIGHT) {} - - int drawn_tab_yoff = border_points[1].y; - int drawn_tab_height = border_points[0].y - border_points[1].y; - - - if (page.active) - { - // draw active tab - - // draw base background color - wxRect r(tab_x, tab_y, tab_width, tab_height); - dc.SetPen(m_base_colour_pen); - dc.SetBrush(m_base_colour_brush); - dc.DrawRectangle(r.x+1, r.y+1, r.width-1, r.height-4); - - // this white helps fill out the gradient at the top of the tab - dc.SetPen(*wxWHITE_PEN); - dc.SetBrush(*wxWHITE_BRUSH); - dc.DrawRectangle(r.x+2, r.y+1, r.width-3, r.height-4); - - // these two points help the rounded corners appear more antialiased - dc.SetPen(m_base_colour_pen); - dc.DrawPoint(r.x+2, r.y+1); - dc.DrawPoint(r.x+r.width-2, r.y+1); - - // set rectangle down a bit for gradient drawing - r.SetHeight(r.GetHeight()/2); - r.x += 2; - r.width -= 2; - r.y += r.height; - r.y -= 2; - - // draw gradient background - wxColor top_color = *wxWHITE; - wxColor bottom_color = m_base_colour; - dc.GradientFillLinear(r, bottom_color, top_color, wxNORTH); - } - else - { - // draw inactive tab - - wxRect r(tab_x, tab_y+1, tab_width, tab_height-3); - - // start the gradent up a bit and leave the inside border inset - // by a pixel for a 3D look. Only the top half of the inactive - // tab will have a slight gradient - r.x += 3; - r.y++; - r.width -= 4; - r.height /= 2; - r.height--; - - // -- draw top gradient fill for glossy look - wxColor top_color = m_base_colour; - wxColor bottom_color = wxAuiStepColour(top_color, 160); - dc.GradientFillLinear(r, bottom_color, top_color, wxNORTH); - - r.y += r.height; - r.y--; - - // -- draw bottom fill for glossy look - top_color = m_base_colour; - bottom_color = m_base_colour; - dc.GradientFillLinear(r, top_color, bottom_color, wxSOUTH); - } - - // draw tab outline - dc.SetPen(m_border_pen); - dc.SetBrush(*wxTRANSPARENT_BRUSH); - dc.DrawPolygon(WXSIZEOF(border_points), border_points); - - // there are two horizontal grey lines at the bottom of the tab control, - // this gets rid of the top one of those lines in the tab control - if (page.active) - { - if (m_flags &wxAUI_NB_BOTTOM) - dc.SetPen(wxPen(wxColour(wxAuiStepColour(m_base_colour, 170)))); - // TODO: else if (m_flags &wxAUI_NB_LEFT) {} - // TODO: else if (m_flags &wxAUI_NB_RIGHT) {} - else //for wxAUI_NB_TOP - dc.SetPen(m_base_colour_pen); - dc.DrawLine(border_points[0].x+1, - border_points[0].y, - border_points[5].x, - border_points[5].y); - } - - - int text_offset = tab_x + 8; - int close_button_width = 0; - if (close_button_state != wxAUI_BUTTON_STATE_HIDDEN) - { - close_button_width = m_active_close_bmp.GetWidth(); - } - - - int bitmap_offset = 0; - if (page.bitmap.IsOk()) - { - bitmap_offset = tab_x + 8; - - // draw bitmap - dc.DrawBitmap(page.bitmap, - bitmap_offset, - drawn_tab_yoff + (drawn_tab_height/2) - (page.bitmap.GetHeight()/2), - true); - - text_offset = bitmap_offset + page.bitmap.GetWidth(); - text_offset += 3; // bitmap padding - } - else - { - text_offset = tab_x + 8; - } - - - wxString draw_text = wxAuiChopText(dc, - caption, - tab_width - (text_offset-tab_x) - close_button_width); - - // draw tab text - dc.DrawText(draw_text, - text_offset, - drawn_tab_yoff + (drawn_tab_height)/2 - (texty/2) - 1); - - // draw close button if necessary - if (close_button_state != wxAUI_BUTTON_STATE_HIDDEN) - { - wxBitmap bmp = m_disabled_close_bmp; - - if (close_button_state == wxAUI_BUTTON_STATE_HOVER || - close_button_state == wxAUI_BUTTON_STATE_PRESSED) - { - bmp = m_active_close_bmp; - } - - int offsetY = tab_y-1; - if (m_flags & wxAUI_NB_BOTTOM) - offsetY = 1; - - wxRect rect(tab_x + tab_width - close_button_width - 1, - offsetY + (tab_height/2) - (bmp.GetHeight()/2), - close_button_width, - tab_height); - - IndentPressedBitmap(&rect, close_button_state); - dc.DrawBitmap(bmp, rect.x, rect.y, true); - - *out_button_rect = rect; - } - - *out_tab_rect = wxRect(tab_x, tab_y, tab_width, tab_height); - -#ifndef __WXMAC__ - // draw focus rectangle - if (page.active && (wnd->FindFocus() == wnd)) - { - wxRect focusRectText(text_offset, (drawn_tab_yoff + (drawn_tab_height)/2 - (texty/2) - 1), - selected_textx, selected_texty); - - wxRect focusRect; - wxRect focusRectBitmap; - - if (page.bitmap.IsOk()) - focusRectBitmap = wxRect(bitmap_offset, drawn_tab_yoff + (drawn_tab_height/2) - (page.bitmap.GetHeight()/2), - page.bitmap.GetWidth(), page.bitmap.GetHeight()); - - if (page.bitmap.IsOk() && draw_text.IsEmpty()) - focusRect = focusRectBitmap; - else if (!page.bitmap.IsOk() && !draw_text.IsEmpty()) - focusRect = focusRectText; - else if (page.bitmap.IsOk() && !draw_text.IsEmpty()) - focusRect = focusRectText.Union(focusRectBitmap); - - focusRect.Inflate(2, 2); - - DrawFocusRect(wnd, dc, focusRect, 0); - } -#endif - - dc.DestroyClippingRegion(); -} - -int wxAuiDefaultTabArt::GetIndentSize() -{ - return 5; -} - -wxSize wxAuiDefaultTabArt::GetTabSize(wxDC& dc, - wxWindow* WXUNUSED(wnd), - const wxString& caption, - const wxBitmap& bitmap, - bool WXUNUSED(active), - int close_button_state, - int* x_extent) -{ - wxCoord measured_textx, measured_texty, tmp; - - dc.SetFont(m_measuring_font); - dc.GetTextExtent(caption, &measured_textx, &measured_texty); - - dc.GetTextExtent(wxT("ABCDEFXj"), &tmp, &measured_texty); - - // add padding around the text - wxCoord tab_width = measured_textx; - wxCoord tab_height = measured_texty; - - // if the close button is showing, add space for it - if (close_button_state != wxAUI_BUTTON_STATE_HIDDEN) - tab_width += m_active_close_bmp.GetWidth() + 3; - - // if there's a bitmap, add space for it - if (bitmap.IsOk()) - { - tab_width += bitmap.GetWidth(); - tab_width += 3; // right side bitmap padding - tab_height = wxMax(tab_height, bitmap.GetHeight()); - } - - // add padding - tab_width += 16; - tab_height += 10; - - if (m_flags & wxAUI_NB_TAB_FIXED_WIDTH) - { - tab_width = m_fixed_tab_width; - } - - *x_extent = tab_width; - - return wxSize(tab_width, tab_height); -} - - -void wxAuiDefaultTabArt::DrawButton(wxDC& dc, - wxWindow* WXUNUSED(wnd), - const wxRect& in_rect, - int bitmap_id, - int button_state, - int orientation, - wxRect* out_rect) -{ - wxBitmap bmp; - wxRect rect; - - switch (bitmap_id) - { - case wxAUI_BUTTON_CLOSE: - if (button_state & wxAUI_BUTTON_STATE_DISABLED) - bmp = m_disabled_close_bmp; - else - bmp = m_active_close_bmp; - break; - case wxAUI_BUTTON_LEFT: - if (button_state & wxAUI_BUTTON_STATE_DISABLED) - bmp = m_disabled_left_bmp; - else - bmp = m_active_left_bmp; - break; - case wxAUI_BUTTON_RIGHT: - if (button_state & wxAUI_BUTTON_STATE_DISABLED) - bmp = m_disabled_right_bmp; - else - bmp = m_active_right_bmp; - break; - case wxAUI_BUTTON_WINDOWLIST: - if (button_state & wxAUI_BUTTON_STATE_DISABLED) - bmp = m_disabled_windowlist_bmp; - else - bmp = m_active_windowlist_bmp; - break; - } - - - if (!bmp.IsOk()) - return; - - rect = in_rect; - - if (orientation == wxLEFT) - { - rect.SetX(in_rect.x); - rect.SetY(((in_rect.y + in_rect.height)/2) - (bmp.GetHeight()/2)); - rect.SetWidth(bmp.GetWidth()); - rect.SetHeight(bmp.GetHeight()); - } - else - { - rect = wxRect(in_rect.x + in_rect.width - bmp.GetWidth(), - ((in_rect.y + in_rect.height)/2) - (bmp.GetHeight()/2), - bmp.GetWidth(), bmp.GetHeight()); - } - - IndentPressedBitmap(&rect, button_state); - dc.DrawBitmap(bmp, rect.x, rect.y, true); - - *out_rect = rect; -} - - -int wxAuiDefaultTabArt::ShowDropDown(wxWindow* wnd, - const wxAuiNotebookPageArray& pages, - int active_idx) -{ - wxMenu menuPopup; - - size_t i, count = pages.GetCount(); - for (i = 0; i < count; ++i) - { - const wxAuiNotebookPage& page = pages.Item(i); - wxString caption = page.caption; - - // if there is no caption, make it a space. This will prevent - // an assert in the menu code. - if (caption.IsEmpty()) - caption = wxT(" "); - - menuPopup.AppendCheckItem(1000+i, caption); - } - - if (active_idx != -1) - { - menuPopup.Check(1000+active_idx, true); - } - - // find out where to put the popup menu of window items - wxPoint pt = ::wxGetMousePosition(); - pt = wnd->ScreenToClient(pt); - - // find out the screen coordinate at the bottom of the tab ctrl - wxRect cli_rect = wnd->GetClientRect(); - pt.y = cli_rect.y + cli_rect.height; - - wxAuiCommandCapture* cc = new wxAuiCommandCapture; - wnd->PushEventHandler(cc); - wnd->PopupMenu(&menuPopup, pt); - int command = cc->GetCommandId(); - wnd->PopEventHandler(true); - - if (command >= 1000) - return command-1000; - - return -1; -} - -int wxAuiDefaultTabArt::GetBestTabCtrlSize(wxWindow* wnd, - const wxAuiNotebookPageArray& pages, - const wxSize& required_bmp_size) -{ - wxClientDC dc(wnd); - dc.SetFont(m_measuring_font); - - // sometimes a standard bitmap size needs to be enforced, especially - // if some tabs have bitmaps and others don't. This is important because - // it prevents the tab control from resizing when tabs are added. - wxBitmap measure_bmp; - if (required_bmp_size.IsFullySpecified()) - { - measure_bmp.Create(required_bmp_size.x, - required_bmp_size.y); - } - - - int max_y = 0; - size_t i, page_count = pages.GetCount(); - for (i = 0; i < page_count; ++i) - { - wxAuiNotebookPage& page = pages.Item(i); - - wxBitmap bmp; - if (measure_bmp.IsOk()) - bmp = measure_bmp; - else - bmp = page.bitmap; - - // we don't use the caption text because we don't - // want tab heights to be different in the case - // of a very short piece of text on one tab and a very - // tall piece of text on another tab - int x_ext = 0; - wxSize s = GetTabSize(dc, - wnd, - wxT("ABCDEFGHIj"), - bmp, - true, - wxAUI_BUTTON_STATE_HIDDEN, - &x_ext); - - max_y = wxMax(max_y, s.y); - } - - return max_y+2; -} - -void wxAuiDefaultTabArt::SetNormalFont(const wxFont& font) -{ - m_normal_font = font; -} - -void wxAuiDefaultTabArt::SetSelectedFont(const wxFont& font) -{ - m_selected_font = font; -} - -void wxAuiDefaultTabArt::SetMeasuringFont(const wxFont& font) -{ - m_measuring_font = font; -} - - -// -- wxAuiSimpleTabArt class implementation -- - -wxAuiSimpleTabArt::wxAuiSimpleTabArt() -{ - m_normal_font = *wxNORMAL_FONT; - m_selected_font = *wxNORMAL_FONT; - m_selected_font.SetWeight(wxBOLD); - m_measuring_font = m_selected_font; - - m_flags = 0; - m_fixed_tab_width = 100; - - wxColour base_colour = wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE); - - wxColour background_colour = base_colour; - wxColour normaltab_colour = base_colour; - wxColour selectedtab_colour = *wxWHITE; - - m_bkbrush = wxBrush(background_colour); - m_normal_bkbrush = wxBrush(normaltab_colour); - m_normal_bkpen = wxPen(normaltab_colour); - m_selected_bkbrush = wxBrush(selectedtab_colour); - m_selected_bkpen = wxPen(selectedtab_colour); - - m_active_close_bmp = wxAuiBitmapFromBits(close_bits, 16, 16, *wxBLACK); - m_disabled_close_bmp = wxAuiBitmapFromBits(close_bits, 16, 16, wxColour(128,128,128)); - - m_active_left_bmp = wxAuiBitmapFromBits(left_bits, 16, 16, *wxBLACK); - m_disabled_left_bmp = wxAuiBitmapFromBits(left_bits, 16, 16, wxColour(128,128,128)); - - m_active_right_bmp = wxAuiBitmapFromBits(right_bits, 16, 16, *wxBLACK); - m_disabled_right_bmp = wxAuiBitmapFromBits(right_bits, 16, 16, wxColour(128,128,128)); - - m_active_windowlist_bmp = wxAuiBitmapFromBits(list_bits, 16, 16, *wxBLACK); - m_disabled_windowlist_bmp = wxAuiBitmapFromBits(list_bits, 16, 16, wxColour(128,128,128)); - -} - -wxAuiSimpleTabArt::~wxAuiSimpleTabArt() -{ -} - -wxAuiTabArt* wxAuiSimpleTabArt::Clone() -{ - return wx_static_cast(wxAuiTabArt*, new wxAuiSimpleTabArt); -} - - -void wxAuiSimpleTabArt::SetFlags(unsigned int flags) -{ - m_flags = flags; -} - -void wxAuiSimpleTabArt::SetSizingInfo(const wxSize& tab_ctrl_size, - size_t tab_count) -{ - m_fixed_tab_width = 100; - - int tot_width = (int)tab_ctrl_size.x - GetIndentSize() - 4; - - if (m_flags & wxAUI_NB_CLOSE_BUTTON) - tot_width -= m_active_close_bmp.GetWidth(); - if (m_flags & wxAUI_NB_WINDOWLIST_BUTTON) - tot_width -= m_active_windowlist_bmp.GetWidth(); - - if (tab_count > 0) - { - m_fixed_tab_width = tot_width/(int)tab_count; - } - - - if (m_fixed_tab_width < 100) - m_fixed_tab_width = 100; - - if (m_fixed_tab_width > tot_width/2) - m_fixed_tab_width = tot_width/2; - - if (m_fixed_tab_width > 220) - m_fixed_tab_width = 220; -} - -void wxAuiSimpleTabArt::DrawBackground(wxDC& dc, - wxWindow* WXUNUSED(wnd), - const wxRect& rect) -{ - // draw background - dc.SetBrush(m_bkbrush); - dc.SetPen(*wxTRANSPARENT_PEN); - dc.DrawRectangle(-1, -1, rect.GetWidth()+2, rect.GetHeight()+2); - - // draw base line - dc.SetPen(*wxGREY_PEN); - dc.DrawLine(0, rect.GetHeight()-1, rect.GetWidth(), rect.GetHeight()-1); -} - - -// DrawTab() draws an individual tab. -// -// dc - output dc -// in_rect - rectangle the tab should be confined to -// caption - tab's caption -// active - whether or not the tab is active -// out_rect - actual output rectangle -// x_extent - the advance x; where the next tab should start - -void wxAuiSimpleTabArt::DrawTab(wxDC& dc, - wxWindow* wnd, - const wxAuiNotebookPage& page, - const wxRect& in_rect, - int close_button_state, - wxRect* out_tab_rect, - wxRect* out_button_rect, - int* x_extent) -{ - wxCoord normal_textx, normal_texty; - wxCoord selected_textx, selected_texty; - wxCoord textx, texty; - - // if the caption is empty, measure some temporary text - wxString caption = page.caption; - if (caption.empty()) - caption = wxT("Xj"); - - dc.SetFont(m_selected_font); - dc.GetTextExtent(caption, &selected_textx, &selected_texty); - - dc.SetFont(m_normal_font); - dc.GetTextExtent(caption, &normal_textx, &normal_texty); - - // figure out the size of the tab - wxSize tab_size = GetTabSize(dc, - wnd, - page.caption, - page.bitmap, - page.active, - close_button_state, - x_extent); - - wxCoord tab_height = tab_size.y; - wxCoord tab_width = tab_size.x; - wxCoord tab_x = in_rect.x; - wxCoord tab_y = in_rect.y + in_rect.height - tab_height; - - caption = page.caption; - - // select pen, brush and font for the tab to be drawn - - if (page.active) - { - dc.SetPen(m_selected_bkpen); - dc.SetBrush(m_selected_bkbrush); - dc.SetFont(m_selected_font); - textx = selected_textx; - texty = selected_texty; - } - else - { - dc.SetPen(m_normal_bkpen); - dc.SetBrush(m_normal_bkbrush); - dc.SetFont(m_normal_font); - textx = normal_textx; - texty = normal_texty; - } - - - // -- draw line -- - - wxPoint points[7]; - points[0].x = tab_x; - points[0].y = tab_y + tab_height - 1; - points[1].x = tab_x + tab_height - 3; - points[1].y = tab_y + 2; - points[2].x = tab_x + tab_height + 3; - points[2].y = tab_y; - points[3].x = tab_x + tab_width - 2; - points[3].y = tab_y; - points[4].x = tab_x + tab_width; - points[4].y = tab_y + 2; - points[5].x = tab_x + tab_width; - points[5].y = tab_y + tab_height - 1; - points[6] = points[0]; - - dc.SetClippingRegion(in_rect); - - dc.DrawPolygon(WXSIZEOF(points) - 1, points); - - dc.SetPen(*wxGREY_PEN); - - //dc.DrawLines(active ? WXSIZEOF(points) - 1 : WXSIZEOF(points), points); - dc.DrawLines(WXSIZEOF(points), points); - - - int text_offset; - - int close_button_width = 0; - if (close_button_state != wxAUI_BUTTON_STATE_HIDDEN) - { - close_button_width = m_active_close_bmp.GetWidth(); - text_offset = tab_x + (tab_height/2) + ((tab_width-close_button_width)/2) - (textx/2); - } - else - { - text_offset = tab_x + (tab_height/3) + (tab_width/2) - (textx/2); - } - - // set minimum text offset - if (text_offset < tab_x + tab_height) - text_offset = tab_x + tab_height; - - // chop text if necessary - wxString draw_text = wxAuiChopText(dc, - caption, - tab_width - (text_offset-tab_x) - close_button_width); - - // draw tab text - dc.DrawText(draw_text, - text_offset, - (tab_y + tab_height)/2 - (texty/2) + 1); - - -#ifndef __WXMAC__ - // draw focus rectangle - if (page.active && (wnd->FindFocus() == wnd)) - { - wxRect focusRect(text_offset, ((tab_y + tab_height)/2 - (texty/2) + 1), - selected_textx, selected_texty); - - focusRect.Inflate(2, 2); - - DrawFocusRect(wnd, dc, focusRect, 0); - } -#endif - - // draw close button if necessary - if (close_button_state != wxAUI_BUTTON_STATE_HIDDEN) - { - wxBitmap bmp; - if (page.active) - bmp = m_active_close_bmp; - else - bmp = m_disabled_close_bmp; - - wxRect rect(tab_x + tab_width - close_button_width - 1, - tab_y + (tab_height/2) - (bmp.GetHeight()/2) + 1, - close_button_width, - tab_height - 1); - DrawButtons(dc, rect, bmp, *wxWHITE, close_button_state); - - *out_button_rect = rect; - } - - - *out_tab_rect = wxRect(tab_x, tab_y, tab_width, tab_height); - - dc.DestroyClippingRegion(); -} - -int wxAuiSimpleTabArt::GetIndentSize() -{ - return 0; -} - -wxSize wxAuiSimpleTabArt::GetTabSize(wxDC& dc, - wxWindow* WXUNUSED(wnd), - const wxString& caption, - const wxBitmap& WXUNUSED(bitmap), - bool WXUNUSED(active), - int close_button_state, - int* x_extent) -{ - wxCoord measured_textx, measured_texty; - - dc.SetFont(m_measuring_font); - dc.GetTextExtent(caption, &measured_textx, &measured_texty); - - wxCoord tab_height = measured_texty + 4; - wxCoord tab_width = measured_textx + tab_height + 5; - - if (close_button_state != wxAUI_BUTTON_STATE_HIDDEN) - tab_width += m_active_close_bmp.GetWidth(); - - if (m_flags & wxAUI_NB_TAB_FIXED_WIDTH) - { - tab_width = m_fixed_tab_width; - } - - *x_extent = tab_width - (tab_height/2) - 1; - - return wxSize(tab_width, tab_height); -} - - -void wxAuiSimpleTabArt::DrawButton(wxDC& dc, - wxWindow* WXUNUSED(wnd), - const wxRect& in_rect, - int bitmap_id, - int button_state, - int orientation, - wxRect* out_rect) -{ - wxBitmap bmp; - wxRect rect; - - switch (bitmap_id) - { - case wxAUI_BUTTON_CLOSE: - if (button_state & wxAUI_BUTTON_STATE_DISABLED) - bmp = m_disabled_close_bmp; - else - bmp = m_active_close_bmp; - break; - case wxAUI_BUTTON_LEFT: - if (button_state & wxAUI_BUTTON_STATE_DISABLED) - bmp = m_disabled_left_bmp; - else - bmp = m_active_left_bmp; - break; - case wxAUI_BUTTON_RIGHT: - if (button_state & wxAUI_BUTTON_STATE_DISABLED) - bmp = m_disabled_right_bmp; - else - bmp = m_active_right_bmp; - break; - case wxAUI_BUTTON_WINDOWLIST: - if (button_state & wxAUI_BUTTON_STATE_DISABLED) - bmp = m_disabled_windowlist_bmp; - else - bmp = m_active_windowlist_bmp; - break; - } - - if (!bmp.IsOk()) - return; - - rect = in_rect; - - if (orientation == wxLEFT) - { - rect.SetX(in_rect.x); - rect.SetY(((in_rect.y + in_rect.height)/2) - (bmp.GetHeight()/2)); - rect.SetWidth(bmp.GetWidth()); - rect.SetHeight(bmp.GetHeight()); - } - else - { - rect = wxRect(in_rect.x + in_rect.width - bmp.GetWidth(), - ((in_rect.y + in_rect.height)/2) - (bmp.GetHeight()/2), - bmp.GetWidth(), bmp.GetHeight()); - } - - - DrawButtons(dc, rect, bmp, *wxWHITE, button_state); - - *out_rect = rect; -} - - -int wxAuiSimpleTabArt::ShowDropDown(wxWindow* wnd, - const wxAuiNotebookPageArray& pages, - int active_idx) -{ - wxMenu menuPopup; - - size_t i, count = pages.GetCount(); - for (i = 0; i < count; ++i) - { - const wxAuiNotebookPage& page = pages.Item(i); - menuPopup.AppendCheckItem(1000+i, page.caption); - } - - if (active_idx != -1) - { - menuPopup.Check(1000+active_idx, true); - } - - // find out where to put the popup menu of window - // items. Subtract 100 for now to center the menu - // a bit, until a better mechanism can be implemented - wxPoint pt = ::wxGetMousePosition(); - pt = wnd->ScreenToClient(pt); - if (pt.x < 100) - pt.x = 0; - else - pt.x -= 100; - - // find out the screen coordinate at the bottom of the tab ctrl - wxRect cli_rect = wnd->GetClientRect(); - pt.y = cli_rect.y + cli_rect.height; - - wxAuiCommandCapture* cc = new wxAuiCommandCapture; - wnd->PushEventHandler(cc); - wnd->PopupMenu(&menuPopup, pt); - int command = cc->GetCommandId(); - wnd->PopEventHandler(true); - - if (command >= 1000) - return command-1000; - - return -1; -} - -int wxAuiSimpleTabArt::GetBestTabCtrlSize(wxWindow* wnd, - const wxAuiNotebookPageArray& WXUNUSED(pages), - const wxSize& WXUNUSED(required_bmp_size)) -{ - wxClientDC dc(wnd); - dc.SetFont(m_measuring_font); - int x_ext = 0; - wxSize s = GetTabSize(dc, - wnd, - wxT("ABCDEFGHIj"), - wxNullBitmap, - true, - wxAUI_BUTTON_STATE_HIDDEN, - &x_ext); - return s.y+3; -} - -void wxAuiSimpleTabArt::SetNormalFont(const wxFont& font) -{ - m_normal_font = font; -} - -void wxAuiSimpleTabArt::SetSelectedFont(const wxFont& font) -{ - m_selected_font = font; -} - -void wxAuiSimpleTabArt::SetMeasuringFont(const wxFont& font) -{ - m_measuring_font = font; -} - - - - -// -- wxAuiTabContainer class implementation -- - - -// wxAuiTabContainer is a class which contains information about each -// tab. It also can render an entire tab control to a specified DC. -// It's not a window class itself, because this code will be used by -// the wxFrameMananger, where it is disadvantageous to have separate -// windows for each tab control in the case of "docked tabs" - -// A derived class, wxAuiTabCtrl, is an actual wxWindow-derived window -// which can be used as a tab control in the normal sense. - - -wxAuiTabContainer::wxAuiTabContainer() -{ - m_tab_offset = 0; - m_flags = 0; - m_art = new wxAuiDefaultTabArt; - - AddButton(wxAUI_BUTTON_LEFT, wxLEFT); - AddButton(wxAUI_BUTTON_RIGHT, wxRIGHT); - AddButton(wxAUI_BUTTON_WINDOWLIST, wxRIGHT); - AddButton(wxAUI_BUTTON_CLOSE, wxRIGHT); -} - -wxAuiTabContainer::~wxAuiTabContainer() -{ - delete m_art; -} - -void wxAuiTabContainer::SetArtProvider(wxAuiTabArt* art) -{ - delete m_art; - m_art = art; - - if (m_art) - { - m_art->SetFlags(m_flags); - } -} - -wxAuiTabArt* wxAuiTabContainer::GetArtProvider() const -{ - return m_art; -} - -void wxAuiTabContainer::SetFlags(unsigned int flags) -{ - m_flags = flags; - - // check for new close button settings - RemoveButton(wxAUI_BUTTON_LEFT); - RemoveButton(wxAUI_BUTTON_RIGHT); - RemoveButton(wxAUI_BUTTON_WINDOWLIST); - RemoveButton(wxAUI_BUTTON_CLOSE); - - - if (flags & wxAUI_NB_SCROLL_BUTTONS) - { - AddButton(wxAUI_BUTTON_LEFT, wxLEFT); - AddButton(wxAUI_BUTTON_RIGHT, wxRIGHT); - } - - if (flags & wxAUI_NB_WINDOWLIST_BUTTON) - { - AddButton(wxAUI_BUTTON_WINDOWLIST, wxRIGHT); - } - - if (flags & wxAUI_NB_CLOSE_BUTTON) - { - AddButton(wxAUI_BUTTON_CLOSE, wxRIGHT); - } - - if (m_art) - { - m_art->SetFlags(m_flags); - } -} - -unsigned int wxAuiTabContainer::GetFlags() const -{ - return m_flags; -} - - -void wxAuiTabContainer::SetNormalFont(const wxFont& font) -{ - m_art->SetNormalFont(font); -} - -void wxAuiTabContainer::SetSelectedFont(const wxFont& font) -{ - m_art->SetSelectedFont(font); -} - -void wxAuiTabContainer::SetMeasuringFont(const wxFont& font) -{ - m_art->SetMeasuringFont(font); -} - -void wxAuiTabContainer::SetRect(const wxRect& rect) -{ - m_rect = rect; - - if (m_art) - { - m_art->SetSizingInfo(rect.GetSize(), m_pages.GetCount()); - } -} - -bool wxAuiTabContainer::AddPage(wxWindow* page, - const wxAuiNotebookPage& info) -{ - wxAuiNotebookPage page_info; - page_info = info; - page_info.window = page; - - m_pages.Add(page_info); - - // let the art provider know how many pages we have - if (m_art) - { - m_art->SetSizingInfo(m_rect.GetSize(), m_pages.GetCount()); - } - - return true; -} - -bool wxAuiTabContainer::InsertPage(wxWindow* page, - const wxAuiNotebookPage& info, - size_t idx) -{ - wxAuiNotebookPage page_info; - page_info = info; - page_info.window = page; - - if (idx >= m_pages.GetCount()) - m_pages.Add(page_info); - else - m_pages.Insert(page_info, idx); - - // let the art provider know how many pages we have - if (m_art) - { - m_art->SetSizingInfo(m_rect.GetSize(), m_pages.GetCount()); - } - - return true; -} - -bool wxAuiTabContainer::MovePage(wxWindow* page, - size_t new_idx) -{ - int idx = GetIdxFromWindow(page); - if (idx == -1) - return false; - - // get page entry, make a copy of it - wxAuiNotebookPage p = GetPage(idx); - - // remove old page entry - RemovePage(page); - - // insert page where it should be - InsertPage(page, p, new_idx); - - return true; -} - -bool wxAuiTabContainer::RemovePage(wxWindow* wnd) -{ - size_t i, page_count = m_pages.GetCount(); - for (i = 0; i < page_count; ++i) - { - wxAuiNotebookPage& page = m_pages.Item(i); - if (page.window == wnd) - { - m_pages.RemoveAt(i); - - // let the art provider know how many pages we have - if (m_art) - { - m_art->SetSizingInfo(m_rect.GetSize(), m_pages.GetCount()); - } - - return true; - } - } - - return false; -} - -bool wxAuiTabContainer::SetActivePage(wxWindow* wnd) -{ - bool found = false; - - size_t i, page_count = m_pages.GetCount(); - for (i = 0; i < page_count; ++i) - { - wxAuiNotebookPage& page = m_pages.Item(i); - if (page.window == wnd) - { - page.active = true; - found = true; - } - else - { - page.active = false; - } - } - - return found; -} - -void wxAuiTabContainer::SetNoneActive() -{ - size_t i, page_count = m_pages.GetCount(); - for (i = 0; i < page_count; ++i) - { - wxAuiNotebookPage& page = m_pages.Item(i); - page.active = false; - } -} - -bool wxAuiTabContainer::SetActivePage(size_t page) -{ - if (page >= m_pages.GetCount()) - return false; - - return SetActivePage(m_pages.Item(page).window); -} - -int wxAuiTabContainer::GetActivePage() const -{ - size_t i, page_count = m_pages.GetCount(); - for (i = 0; i < page_count; ++i) - { - wxAuiNotebookPage& page = m_pages.Item(i); - if (page.active) - return i; - } - - return -1; -} - -wxWindow* wxAuiTabContainer::GetWindowFromIdx(size_t idx) const -{ - if (idx >= m_pages.GetCount()) - return NULL; - - return m_pages[idx].window; -} - -int wxAuiTabContainer::GetIdxFromWindow(wxWindow* wnd) const -{ - size_t i, page_count = m_pages.GetCount(); - for (i = 0; i < page_count; ++i) - { - wxAuiNotebookPage& page = m_pages.Item(i); - if (page.window == wnd) - return i; - } - return -1; -} - -wxAuiNotebookPage& wxAuiTabContainer::GetPage(size_t idx) -{ - wxASSERT_MSG(idx < m_pages.GetCount(), wxT("Invalid Page index")); - - return m_pages[idx]; -} - -const wxAuiNotebookPage& wxAuiTabContainer::GetPage(size_t idx) const -{ - wxASSERT_MSG(idx < m_pages.GetCount(), wxT("Invalid Page index")); - - return m_pages[idx]; -} - -wxAuiNotebookPageArray& wxAuiTabContainer::GetPages() -{ - return m_pages; -} - -size_t wxAuiTabContainer::GetPageCount() const -{ - return m_pages.GetCount(); -} - -void wxAuiTabContainer::AddButton(int id, - int location, - const wxBitmap& normal_bitmap, - const wxBitmap& disabled_bitmap) -{ - wxAuiTabContainerButton button; - button.id = id; - button.bitmap = normal_bitmap; - button.dis_bitmap = disabled_bitmap; - button.location = location; - button.cur_state = wxAUI_BUTTON_STATE_NORMAL; - - m_buttons.Add(button); -} - -void wxAuiTabContainer::RemoveButton(int id) -{ - size_t i, button_count = m_buttons.GetCount(); - - for (i = 0; i < button_count; ++i) - { - if (m_buttons.Item(i).id == id) - { - m_buttons.RemoveAt(i); - return; - } - } -} - - - -size_t wxAuiTabContainer::GetTabOffset() const -{ - return m_tab_offset; -} - -void wxAuiTabContainer::SetTabOffset(size_t offset) -{ - m_tab_offset = offset; -} - - - - -// Render() renders the tab catalog to the specified DC -// It is a virtual function and can be overridden to -// provide custom drawing capabilities -void wxAuiTabContainer::Render(wxDC* raw_dc, wxWindow* wnd) -{ - if (!raw_dc || !raw_dc->IsOk()) - return; - - wxMemoryDC dc; - - // use the same layout direction as the window DC uses to ensure that the - // text is rendered correctly - dc.SetLayoutDirection(raw_dc->GetLayoutDirection()); - - wxBitmap bmp; - size_t i; - size_t page_count = m_pages.GetCount(); - size_t button_count = m_buttons.GetCount(); - - // create off-screen bitmap - bmp.Create(m_rect.GetWidth(), m_rect.GetHeight()); - dc.SelectObject(bmp); - - if (!dc.IsOk()) - return; - - // find out if size of tabs is larger than can be - // afforded on screen - int total_width = 0; - int visible_width = 0; - - for (i = 0; i < page_count; ++i) - { - wxAuiNotebookPage& page = m_pages.Item(i); - - // determine if a close button is on this tab - bool close_button = false; - if ((m_flags & wxAUI_NB_CLOSE_ON_ALL_TABS) != 0 || - ((m_flags & wxAUI_NB_CLOSE_ON_ACTIVE_TAB) != 0 && page.active)) - { - close_button = true; - } - - - int x_extent = 0; - wxSize size = m_art->GetTabSize(dc, - wnd, - page.caption, - page.bitmap, - page.active, - close_button ? - wxAUI_BUTTON_STATE_NORMAL : - wxAUI_BUTTON_STATE_HIDDEN, - &x_extent); - - if (i+1 < page_count) - total_width += x_extent; - else - total_width += size.x; - - if (i >= m_tab_offset) - { - if (i+1 < page_count) - visible_width += x_extent; - else - visible_width += size.x; - } - } - - if (total_width > m_rect.GetWidth() || m_tab_offset != 0) - { - // show left/right buttons - for (i = 0; i < button_count; ++i) - { - wxAuiTabContainerButton& button = m_buttons.Item(i); - if (button.id == wxAUI_BUTTON_LEFT || - button.id == wxAUI_BUTTON_RIGHT) - { - button.cur_state &= ~wxAUI_BUTTON_STATE_HIDDEN; - } - } - } - else - { - // hide left/right buttons - for (i = 0; i < button_count; ++i) - { - wxAuiTabContainerButton& button = m_buttons.Item(i); - if (button.id == wxAUI_BUTTON_LEFT || - button.id == wxAUI_BUTTON_RIGHT) - { - button.cur_state |= wxAUI_BUTTON_STATE_HIDDEN; - } - } - } - - // determine whether left button should be enabled - for (i = 0; i < button_count; ++i) - { - wxAuiTabContainerButton& button = m_buttons.Item(i); - if (button.id == wxAUI_BUTTON_LEFT) - { - if (m_tab_offset == 0) - button.cur_state |= wxAUI_BUTTON_STATE_DISABLED; - else - button.cur_state &= ~wxAUI_BUTTON_STATE_DISABLED; - } - if (button.id == wxAUI_BUTTON_RIGHT) - { - if (visible_width < m_rect.GetWidth() - ((int)button_count*16)) - button.cur_state |= wxAUI_BUTTON_STATE_DISABLED; - else - button.cur_state &= ~wxAUI_BUTTON_STATE_DISABLED; - } - } - - - - // draw background - m_art->DrawBackground(dc, wnd, m_rect); - - // draw buttons - int left_buttons_width = 0; - int right_buttons_width = 0; - - int offset = 0; - - // draw the buttons on the right side - offset = m_rect.x + m_rect.width; - for (i = 0; i < button_count; ++i) - { - wxAuiTabContainerButton& button = m_buttons.Item(button_count - i - 1); - - if (button.location != wxRIGHT) - continue; - if (button.cur_state & wxAUI_BUTTON_STATE_HIDDEN) - continue; - - wxRect button_rect = m_rect; - button_rect.SetY(1); - button_rect.SetWidth(offset); - - m_art->DrawButton(dc, - wnd, - button_rect, - button.id, - button.cur_state, - wxRIGHT, - &button.rect); - - offset -= button.rect.GetWidth(); - right_buttons_width += button.rect.GetWidth(); - } - - - - offset = 0; - - // draw the buttons on the left side - - for (i = 0; i < button_count; ++i) - { - wxAuiTabContainerButton& button = m_buttons.Item(button_count - i - 1); - - if (button.location != wxLEFT) - continue; - if (button.cur_state & wxAUI_BUTTON_STATE_HIDDEN) - continue; - - wxRect button_rect(offset, 1, 1000, m_rect.height); - - m_art->DrawButton(dc, - wnd, - button_rect, - button.id, - button.cur_state, - wxLEFT, - &button.rect); - - offset += button.rect.GetWidth(); - left_buttons_width += button.rect.GetWidth(); - } - - offset = left_buttons_width; - - if (offset == 0) - offset += m_art->GetIndentSize(); - - - // prepare the tab-close-button array - // make sure tab button entries which aren't used are marked as hidden - for (i = page_count; i < m_tab_close_buttons.GetCount(); ++i) - m_tab_close_buttons.Item(i).cur_state = wxAUI_BUTTON_STATE_HIDDEN; - - // make sure there are enough tab button entries to accommodate all tabs - while (m_tab_close_buttons.GetCount() < page_count) - { - wxAuiTabContainerButton tempbtn; - tempbtn.id = wxAUI_BUTTON_CLOSE; - tempbtn.location = wxCENTER; - tempbtn.cur_state = wxAUI_BUTTON_STATE_HIDDEN; - m_tab_close_buttons.Add(tempbtn); - } - - - // buttons before the tab offset must be set to hidden - for (i = 0; i < m_tab_offset; ++i) - { - m_tab_close_buttons.Item(i).cur_state = wxAUI_BUTTON_STATE_HIDDEN; - } - - - // draw the tabs - - size_t active = 999; - int active_offset = 0; - wxRect active_rect; - wxRect active_focus_rect; - - int x_extent = 0; - wxRect rect = m_rect; - rect.y = 0; - rect.height = m_rect.height; - - for (i = m_tab_offset; i < page_count; ++i) - { - wxAuiNotebookPage& page = m_pages.Item(i); - wxAuiTabContainerButton& tab_button = m_tab_close_buttons.Item(i); - - // determine if a close button is on this tab - if ((m_flags & wxAUI_NB_CLOSE_ON_ALL_TABS) != 0 || - ((m_flags & wxAUI_NB_CLOSE_ON_ACTIVE_TAB) != 0 && page.active)) - { - if (tab_button.cur_state == wxAUI_BUTTON_STATE_HIDDEN) - { - tab_button.id = wxAUI_BUTTON_CLOSE; - tab_button.cur_state = wxAUI_BUTTON_STATE_NORMAL; - tab_button.location = wxCENTER; - } - } - else - { - tab_button.cur_state = wxAUI_BUTTON_STATE_HIDDEN; - } - - rect.x = offset; - rect.width = m_rect.width - right_buttons_width - offset - 2; - - if (rect.width <= 0) - break; - - m_art->DrawTab(dc, - wnd, - page, - rect, - tab_button.cur_state, - &page.rect, - &tab_button.rect, - &x_extent); - - if (page.active) - { - active = i; - active_offset = offset; - active_rect = rect; - active_focus_rect = rect; - active_focus_rect.width = x_extent; - } - - offset += x_extent; - } - - - // make sure to deactivate buttons which are off the screen to the right - for (++i; i < m_tab_close_buttons.GetCount(); ++i) - { - m_tab_close_buttons.Item(i).cur_state = wxAUI_BUTTON_STATE_HIDDEN; - } - - - // draw the active tab again so it stands in the foreground - if (active >= m_tab_offset && active < m_pages.GetCount()) - { - wxAuiNotebookPage& page = m_pages.Item(active); - - wxAuiTabContainerButton& tab_button = m_tab_close_buttons.Item(active); - - rect.x = active_offset; - m_art->DrawTab(dc, - wnd, - page, - active_rect, - tab_button.cur_state, - &page.rect, - &tab_button.rect, - &x_extent); - } - - - raw_dc->Blit(m_rect.x, m_rect.y, - m_rect.GetWidth(), m_rect.GetHeight(), - &dc, 0, 0); - -#ifdef __WXMAC__ - // On Mac, need to draw the focus rect directly to the window - if (wnd && (wnd->FindFocus() == wnd) && (active >= m_tab_offset && active < m_pages.GetCount())) - { - wxRect focusRect(active_focus_rect); - focusRect.Inflate(-6, -6); - DrawFocusRect(wnd, * raw_dc, focusRect, 0); - } -#endif -} - -// Is the tab visible? -bool wxAuiTabContainer::IsTabVisible(int tabPage, int tabOffset, wxDC* dc, wxWindow* wnd) -{ - if (!dc || !dc->IsOk()) - return false; - - size_t i; - size_t page_count = m_pages.GetCount(); - size_t button_count = m_buttons.GetCount(); - - // Hasn't been rendered yet; assume it's visible - if (m_tab_close_buttons.GetCount() < page_count) - return true; - - // First check if both buttons are disabled - if so, there's no need to - // check further for visibility. - int arrowButtonVisibleCount = 0; - for (i = 0; i < button_count; ++i) - { - wxAuiTabContainerButton& button = m_buttons.Item(i); - if (button.id == wxAUI_BUTTON_LEFT || - button.id == wxAUI_BUTTON_RIGHT) - { - if ((button.cur_state & wxAUI_BUTTON_STATE_HIDDEN) == 0) - arrowButtonVisibleCount ++; - } - } - - // Tab must be visible - if (arrowButtonVisibleCount == 0) - return true; - - // If tab is less than the given offset, it must be invisible by definition - if (tabPage < tabOffset) - return false; - - // draw buttons - int left_buttons_width = 0; - int right_buttons_width = 0; - - int offset = 0; - - // calculate size of the buttons on the right side - offset = m_rect.x + m_rect.width; - for (i = 0; i < button_count; ++i) - { - wxAuiTabContainerButton& button = m_buttons.Item(button_count - i - 1); - - if (button.location != wxRIGHT) - continue; - if (button.cur_state & wxAUI_BUTTON_STATE_HIDDEN) - continue; - - offset -= button.rect.GetWidth(); - right_buttons_width += button.rect.GetWidth(); - } - - offset = 0; - - // calculate size of the buttons on the left side - for (i = 0; i < button_count; ++i) - { - wxAuiTabContainerButton& button = m_buttons.Item(button_count - i - 1); - - if (button.location != wxLEFT) - continue; - if (button.cur_state & wxAUI_BUTTON_STATE_HIDDEN) - continue; - - offset += button.rect.GetWidth(); - left_buttons_width += button.rect.GetWidth(); - } - - offset = left_buttons_width; - - if (offset == 0) - offset += m_art->GetIndentSize(); - - wxRect active_rect; - - wxRect rect = m_rect; - rect.y = 0; - rect.height = m_rect.height; - - // See if the given page is visible at the given tab offset (effectively scroll position) - for (i = tabOffset; i < page_count; ++i) - { - wxAuiNotebookPage& page = m_pages.Item(i); - wxAuiTabContainerButton& tab_button = m_tab_close_buttons.Item(i); - - rect.x = offset; - rect.width = m_rect.width - right_buttons_width - offset - 2; - - if (rect.width <= 0) - return false; // haven't found the tab, and we've run out of space, so return false - - int x_extent = 0; - wxSize size = m_art->GetTabSize(*dc, - wnd, - page.caption, - page.bitmap, - page.active, - tab_button.cur_state, - &x_extent); - - offset += x_extent; - - if (i == (size_t) tabPage) - { - // If not all of the tab is visible, and supposing there's space to display it all, - // we could do better so we return false. - if (((m_rect.width - right_buttons_width - offset - 2) <= 0) && ((m_rect.width - right_buttons_width - left_buttons_width) > x_extent)) - return false; - else - return true; - } - } - - // Shouldn't really get here, but if it does, assume the tab is visible to prevent - // further looping in calling code. - return true; -} - -// Make the tab visible if it wasn't already -void wxAuiTabContainer::MakeTabVisible(int tabPage, wxWindow* win) -{ - wxClientDC dc(win); - if (!IsTabVisible(tabPage, GetTabOffset(), & dc, win)) - { - int i; - for (i = 0; i < (int) m_pages.GetCount(); i++) - { - if (IsTabVisible(tabPage, i, & dc, win)) - { - SetTabOffset(i); - win->Refresh(); - return; - } - } - } -} - -// TabHitTest() tests if a tab was hit, passing the window pointer -// back if that condition was fulfilled. The function returns -// true if a tab was hit, otherwise false -bool wxAuiTabContainer::TabHitTest(int x, int y, wxWindow** hit) const -{ - if (!m_rect.Contains(x,y)) - return false; - - wxAuiTabContainerButton* btn = NULL; - if (ButtonHitTest(x, y, &btn) && !(btn->cur_state & wxAUI_BUTTON_STATE_DISABLED)) - { - if (m_buttons.Index(*btn) != wxNOT_FOUND) - return false; - } - - size_t i, page_count = m_pages.GetCount(); - - for (i = m_tab_offset; i < page_count; ++i) - { - wxAuiNotebookPage& page = m_pages.Item(i); - if (page.rect.Contains(x,y)) - { - if (hit) - *hit = page.window; - return true; - } - } - - return false; -} - -// ButtonHitTest() tests if a button was hit. The function returns -// true if a button was hit, otherwise false -bool wxAuiTabContainer::ButtonHitTest(int x, int y, - wxAuiTabContainerButton** hit) const -{ - if (!m_rect.Contains(x,y)) - return false; - - size_t i, button_count; - - - button_count = m_buttons.GetCount(); - for (i = 0; i < button_count; ++i) - { - wxAuiTabContainerButton& button = m_buttons.Item(i); - if (button.rect.Contains(x,y) && - !(button.cur_state & wxAUI_BUTTON_STATE_HIDDEN )) - { - if (hit) - *hit = &button; - return true; - } - } - - button_count = m_tab_close_buttons.GetCount(); - for (i = 0; i < button_count; ++i) - { - wxAuiTabContainerButton& button = m_tab_close_buttons.Item(i); - if (button.rect.Contains(x,y) && - !(button.cur_state & (wxAUI_BUTTON_STATE_HIDDEN | - wxAUI_BUTTON_STATE_DISABLED))) - { - if (hit) - *hit = &button; - return true; - } - } - - return false; -} - - - -// the utility function ShowWnd() is the same as show, -// except it handles wxAuiMDIChildFrame windows as well, -// as the Show() method on this class is "unplugged" -static void ShowWnd(wxWindow* wnd, bool show) -{ -#if wxUSE_MDI - if (wnd->IsKindOf(CLASSINFO(wxAuiMDIChildFrame))) - { - wxAuiMDIChildFrame* cf = (wxAuiMDIChildFrame*)wnd; - cf->DoShow(show); - } - else -#endif - { - wnd->Show(show); - } -} - - -// DoShowHide() this function shows the active window, then -// hides all of the other windows (in that order) -void wxAuiTabContainer::DoShowHide() -{ - wxAuiNotebookPageArray& pages = GetPages(); - size_t i, page_count = pages.GetCount(); - - // show new active page first - for (i = 0; i < page_count; ++i) - { - wxAuiNotebookPage& page = pages.Item(i); - if (page.active) - { - ShowWnd(page.window, true); - break; - } - } - - // hide all other pages - for (i = 0; i < page_count; ++i) - { - wxAuiNotebookPage& page = pages.Item(i); - if (!page.active) - ShowWnd(page.window, false); - } -} - - - - - - -// -- wxAuiTabCtrl class implementation -- - - - -BEGIN_EVENT_TABLE(wxAuiTabCtrl, wxControl) - EVT_PAINT(wxAuiTabCtrl::OnPaint) - EVT_ERASE_BACKGROUND(wxAuiTabCtrl::OnEraseBackground) - EVT_SIZE(wxAuiTabCtrl::OnSize) - EVT_LEFT_DOWN(wxAuiTabCtrl::OnLeftDown) - EVT_LEFT_DCLICK(wxAuiTabCtrl::OnLeftDClick) - EVT_LEFT_UP(wxAuiTabCtrl::OnLeftUp) - EVT_MIDDLE_DOWN(wxAuiTabCtrl::OnMiddleDown) - EVT_MIDDLE_UP(wxAuiTabCtrl::OnMiddleUp) - EVT_RIGHT_DOWN(wxAuiTabCtrl::OnRightDown) - EVT_RIGHT_UP(wxAuiTabCtrl::OnRightUp) - EVT_MOTION(wxAuiTabCtrl::OnMotion) - EVT_LEAVE_WINDOW(wxAuiTabCtrl::OnLeaveWindow) - EVT_AUINOTEBOOK_BUTTON(wxID_ANY, wxAuiTabCtrl::OnButton) - EVT_SET_FOCUS(wxAuiTabCtrl::OnSetFocus) - EVT_KILL_FOCUS(wxAuiTabCtrl::OnKillFocus) - EVT_CHAR(wxAuiTabCtrl::OnChar) - EVT_MOUSE_CAPTURE_LOST(wxAuiTabCtrl::OnCaptureLost) -END_EVENT_TABLE() - - -wxAuiTabCtrl::wxAuiTabCtrl(wxWindow* parent, - wxWindowID id, - const wxPoint& pos, - const wxSize& size, - long style) : wxControl(parent, id, pos, size, style) -{ - m_click_pt = wxDefaultPosition; - m_is_dragging = false; - m_hover_button = NULL; - m_pressed_button = NULL; -} - -wxAuiTabCtrl::~wxAuiTabCtrl() -{ -} - -void wxAuiTabCtrl::OnPaint(wxPaintEvent&) -{ - wxPaintDC dc(this); - - dc.SetFont(GetFont()); - - if (GetPageCount() > 0) - Render(&dc, this); -} - -void wxAuiTabCtrl::OnEraseBackground(wxEraseEvent& WXUNUSED(evt)) -{ -} - -void wxAuiTabCtrl::OnSize(wxSizeEvent& evt) -{ - wxSize s = evt.GetSize(); - wxRect r(0, 0, s.GetWidth(), s.GetHeight()); - SetRect(r); -} - -void wxAuiTabCtrl::OnLeftDown(wxMouseEvent& evt) -{ - CaptureMouse(); - m_click_pt = wxDefaultPosition; - m_is_dragging = false; - m_click_tab = NULL; - m_pressed_button = NULL; - - - wxWindow* wnd; - if (TabHitTest(evt.m_x, evt.m_y, &wnd)) - { - int new_selection = GetIdxFromWindow(wnd); - - // wxAuiNotebooks always want to receive this event - // even if the tab is already active, because they may - // have multiple tab controls - if (new_selection != GetActivePage() || - GetParent()->IsKindOf(CLASSINFO(wxAuiNotebook))) - { - wxAuiNotebookEvent e(wxEVT_COMMAND_AUINOTEBOOK_PAGE_CHANGING, m_windowId); - e.SetSelection(new_selection); - e.SetOldSelection(GetActivePage()); - e.SetEventObject(this); - GetEventHandler()->ProcessEvent(e); - } - - m_click_pt.x = evt.m_x; - m_click_pt.y = evt.m_y; - m_click_tab = wnd; - } - - if (m_hover_button) - { - m_pressed_button = m_hover_button; - m_pressed_button->cur_state = wxAUI_BUTTON_STATE_PRESSED; - Refresh(); - Update(); - } -} - -void wxAuiTabCtrl::OnCaptureLost(wxMouseCaptureLostEvent& WXUNUSED(event)) -{ -} - -void wxAuiTabCtrl::OnLeftUp(wxMouseEvent& evt) -{ - if (GetCapture() == this) - ReleaseMouse(); - - if (m_is_dragging) - { - m_is_dragging = false; - - wxAuiNotebookEvent evt(wxEVT_COMMAND_AUINOTEBOOK_END_DRAG, m_windowId); - evt.SetSelection(GetIdxFromWindow(m_click_tab)); - evt.SetOldSelection(evt.GetSelection()); - evt.SetEventObject(this); - GetEventHandler()->ProcessEvent(evt); - - return; - } - - if (m_pressed_button) - { - // make sure we're still clicking the button - wxAuiTabContainerButton* button = NULL; - if (!ButtonHitTest(evt.m_x, evt.m_y, &button) || - button->cur_state & wxAUI_BUTTON_STATE_DISABLED) - return; - - if (button != m_pressed_button) - { - m_pressed_button = NULL; - return; - } - - Refresh(); - Update(); - - if (!(m_pressed_button->cur_state & wxAUI_BUTTON_STATE_DISABLED)) - { - wxAuiNotebookEvent evt(wxEVT_COMMAND_AUINOTEBOOK_BUTTON, m_windowId); - evt.SetSelection(GetIdxFromWindow(m_click_tab)); - evt.SetInt(m_pressed_button->id); - evt.SetEventObject(this); - GetEventHandler()->ProcessEvent(evt); - } - - m_pressed_button = NULL; - } - - m_click_pt = wxDefaultPosition; - m_is_dragging = false; - m_click_tab = NULL; -} - -void wxAuiTabCtrl::OnMiddleUp(wxMouseEvent& evt) -{ - wxWindow* wnd = NULL; - if (!TabHitTest(evt.m_x, evt.m_y, &wnd)) - return; - - wxAuiNotebookEvent e(wxEVT_COMMAND_AUINOTEBOOK_TAB_MIDDLE_UP, m_windowId); - e.SetEventObject(this); - e.SetSelection(GetIdxFromWindow(wnd)); - GetEventHandler()->ProcessEvent(e); -} - -void wxAuiTabCtrl::OnMiddleDown(wxMouseEvent& evt) -{ - wxWindow* wnd = NULL; - if (!TabHitTest(evt.m_x, evt.m_y, &wnd)) - return; - - wxAuiNotebookEvent e(wxEVT_COMMAND_AUINOTEBOOK_TAB_MIDDLE_DOWN, m_windowId); - e.SetEventObject(this); - e.SetSelection(GetIdxFromWindow(wnd)); - GetEventHandler()->ProcessEvent(e); -} - -void wxAuiTabCtrl::OnRightUp(wxMouseEvent& evt) -{ - wxWindow* wnd = NULL; - if (!TabHitTest(evt.m_x, evt.m_y, &wnd)) - return; - - wxAuiNotebookEvent e(wxEVT_COMMAND_AUINOTEBOOK_TAB_RIGHT_UP, m_windowId); - e.SetEventObject(this); - e.SetSelection(GetIdxFromWindow(wnd)); - GetEventHandler()->ProcessEvent(e); -} - -void wxAuiTabCtrl::OnRightDown(wxMouseEvent& evt) -{ - wxWindow* wnd = NULL; - if (!TabHitTest(evt.m_x, evt.m_y, &wnd)) - return; - - wxAuiNotebookEvent e(wxEVT_COMMAND_AUINOTEBOOK_TAB_RIGHT_DOWN, m_windowId); - e.SetEventObject(this); - e.SetSelection(GetIdxFromWindow(wnd)); - GetEventHandler()->ProcessEvent(e); -} - -void wxAuiTabCtrl::OnLeftDClick(wxMouseEvent& evt) -{ - wxWindow* wnd; - wxAuiTabContainerButton* button; - if (!TabHitTest(evt.m_x, evt.m_y, &wnd) && !ButtonHitTest(evt.m_x, evt.m_y, &button)) - { - wxAuiNotebookEvent e(wxEVT_COMMAND_AUINOTEBOOK_BG_DCLICK, m_windowId); - e.SetEventObject(this); - GetEventHandler()->ProcessEvent(e); - } -} - -void wxAuiTabCtrl::OnMotion(wxMouseEvent& evt) -{ - wxPoint pos = evt.GetPosition(); - - // check if the mouse is hovering above a button - wxAuiTabContainerButton* button; - if (ButtonHitTest(pos.x, pos.y, &button) && !(button->cur_state & wxAUI_BUTTON_STATE_DISABLED)) - { - if (m_hover_button && button != m_hover_button) - { - m_hover_button->cur_state = wxAUI_BUTTON_STATE_NORMAL; - m_hover_button = NULL; - Refresh(); - Update(); - } - - if (button->cur_state != wxAUI_BUTTON_STATE_HOVER) - { - button->cur_state = wxAUI_BUTTON_STATE_HOVER; - Refresh(); - Update(); - m_hover_button = button; - return; - } - } - else - { - if (m_hover_button) - { - m_hover_button->cur_state = wxAUI_BUTTON_STATE_NORMAL; - m_hover_button = NULL; - Refresh(); - Update(); - } - } - - - if (!evt.LeftIsDown() || m_click_pt == wxDefaultPosition) - return; - - if (m_is_dragging) - { - wxAuiNotebookEvent evt(wxEVT_COMMAND_AUINOTEBOOK_DRAG_MOTION, m_windowId); - evt.SetSelection(GetIdxFromWindow(m_click_tab)); - evt.SetOldSelection(evt.GetSelection()); - evt.SetEventObject(this); - GetEventHandler()->ProcessEvent(evt); - return; - } - - - int drag_x_threshold = wxSystemSettings::GetMetric(wxSYS_DRAG_X); - int drag_y_threshold = wxSystemSettings::GetMetric(wxSYS_DRAG_Y); - - if (abs(pos.x - m_click_pt.x) > drag_x_threshold || - abs(pos.y - m_click_pt.y) > drag_y_threshold) - { - wxAuiNotebookEvent evt(wxEVT_COMMAND_AUINOTEBOOK_BEGIN_DRAG, m_windowId); - evt.SetSelection(GetIdxFromWindow(m_click_tab)); - evt.SetOldSelection(evt.GetSelection()); - evt.SetEventObject(this); - GetEventHandler()->ProcessEvent(evt); - - m_is_dragging = true; - } -} - -void wxAuiTabCtrl::OnLeaveWindow(wxMouseEvent& WXUNUSED(event)) -{ - if (m_hover_button) - { - m_hover_button->cur_state = wxAUI_BUTTON_STATE_NORMAL; - m_hover_button = NULL; - Refresh(); - Update(); - } -} - -void wxAuiTabCtrl::OnButton(wxAuiNotebookEvent& event) -{ - int button = event.GetInt(); - - if (button == wxAUI_BUTTON_LEFT || button == wxAUI_BUTTON_RIGHT) - { - if (button == wxAUI_BUTTON_LEFT) - { - if (GetTabOffset() > 0) - { - SetTabOffset(GetTabOffset()-1); - Refresh(); - Update(); - } - } - else - { - SetTabOffset(GetTabOffset()+1); - Refresh(); - Update(); - } - } - else if (button == wxAUI_BUTTON_WINDOWLIST) - { - int idx = GetArtProvider()->ShowDropDown(this, m_pages, GetActivePage()); - - if (idx != -1) - { - wxAuiNotebookEvent e(wxEVT_COMMAND_AUINOTEBOOK_PAGE_CHANGING, m_windowId); - e.SetSelection(idx); - e.SetOldSelection(GetActivePage()); - e.SetEventObject(this); - GetEventHandler()->ProcessEvent(e); - } - } - else - { - event.Skip(); - } -} - -void wxAuiTabCtrl::OnSetFocus(wxFocusEvent& WXUNUSED(event)) -{ - Refresh(); -} - -void wxAuiTabCtrl::OnKillFocus(wxFocusEvent& WXUNUSED(event)) -{ - Refresh(); -} - -void wxAuiTabCtrl::OnChar(wxKeyEvent& event) -{ - if (GetActivePage() == -1) - { - event.Skip(); - return; - } - - // We can't leave tab processing to the system; on Windows, tabs and keys - // get eaten by the system and not processed properly if we specify both - // wxTAB_TRAVERSAL and wxWANTS_CHARS. And if we specify just wxTAB_TRAVERSAL, - // we don't key arrow key events. - - int key = event.GetKeyCode(); - - if (key == WXK_NUMPAD_PAGEUP) - key = WXK_PAGEUP; - if (key == WXK_NUMPAD_PAGEDOWN) - key = WXK_PAGEDOWN; - if (key == WXK_NUMPAD_HOME) - key = WXK_HOME; - if (key == WXK_NUMPAD_END) - key = WXK_END; - if (key == WXK_NUMPAD_LEFT) - key = WXK_LEFT; - if (key == WXK_NUMPAD_RIGHT) - key = WXK_RIGHT; - - if (key == WXK_TAB || key == WXK_PAGEUP || key == WXK_PAGEDOWN) - { - bool bCtrlDown = event.ControlDown(); - bool bShiftDown = event.ShiftDown(); - - bool bForward = (key == WXK_TAB && !bShiftDown) || (key == WXK_PAGEDOWN); - bool bWindowChange = (key == WXK_PAGEUP) || (key == WXK_PAGEDOWN) || bCtrlDown; - bool bFromTab = (key == WXK_TAB); - - wxAuiNotebook* nb = wxDynamicCast(GetParent(), wxAuiNotebook); - if (!nb) - { - event.Skip(); - return; - } - - wxNavigationKeyEvent keyEvent; - keyEvent.SetDirection(bForward); - keyEvent.SetWindowChange(bWindowChange); - keyEvent.SetFromTab(bFromTab); - keyEvent.SetEventObject(nb); - - if (!nb->GetEventHandler()->ProcessEvent(keyEvent)) - { - // Not processed? Do an explicit tab into the page. - wxWindow* win = GetWindowFromIdx(GetActivePage()); - if (win) - win->SetFocus(); - } - return; - } - - if (m_pages.GetCount() < 2) - { - event.Skip(); - return; - } - - int newPage = -1; - - int forwardKey, backwardKey; - if (GetLayoutDirection() == wxLayout_RightToLeft) - { - forwardKey = WXK_LEFT; - backwardKey = WXK_RIGHT; - } - else - { - forwardKey = WXK_RIGHT; - backwardKey = WXK_LEFT; - } - - if (key == forwardKey) - { - if (m_pages.GetCount() > 1) - { - if (GetActivePage() == -1) - newPage = 0; - else if (GetActivePage() < (int) (m_pages.GetCount() - 1)) - newPage = GetActivePage() + 1; - } - } - else if (key == backwardKey) - { - if (m_pages.GetCount() > 1) - { - if (GetActivePage() == -1) - newPage = (int) (m_pages.GetCount() - 1); - else if (GetActivePage() > 0) - newPage = GetActivePage() - 1; - } - } - else if (key == WXK_HOME) - { - newPage = 0; - } - else if (key == WXK_END) - { - newPage = (int) (m_pages.GetCount() - 1); - } - else - event.Skip(); - - if (newPage != -1) - { - wxAuiNotebookEvent e(wxEVT_COMMAND_AUINOTEBOOK_PAGE_CHANGING, m_windowId); - e.SetSelection(newPage); - e.SetOldSelection(newPage); - e.SetEventObject(this); - this->GetEventHandler()->ProcessEvent(e); - } - else - event.Skip(); -} - -// wxTabFrame is an interesting case. It's important that all child pages -// of the multi-notebook control are all actually children of that control -// (and not grandchildren). wxTabFrame facilitates this. There is one -// instance of wxTabFrame for each tab control inside the multi-notebook. -// It's important to know that wxTabFrame is not a real window, but it merely -// used to capture the dimensions/positioning of the internal tab control and -// it's managed page windows - -class wxTabFrame : public wxWindow -{ -public: - - wxTabFrame() - { - m_tabs = NULL; - m_rect = wxRect(0,0,200,200); - m_tab_ctrl_height = 20; - } - - ~wxTabFrame() - { - wxDELETE(m_tabs); - } - - void SetTabCtrlHeight(int h) - { - m_tab_ctrl_height = h; - } - - void DoSetSize(int x, int y, - int width, int height, - int WXUNUSED(sizeFlags = wxSIZE_AUTO)) - { - m_rect = wxRect(x, y, width, height); - DoSizing(); - } - - void DoGetClientSize(int* x, int* y) const - { - *x = m_rect.width; - *y = m_rect.height; - } - - bool Show( bool WXUNUSED(show = true) ) { return false; } - - void DoSizing() - { - if (!m_tabs) - return; - - if (m_tabs->IsFrozen() || m_tabs->GetParent()->IsFrozen()) - return; - - if (m_tabs->GetFlags() & wxAUI_NB_BOTTOM) - { - m_tab_rect = wxRect (m_rect.x, m_rect.y + m_rect.height - m_tab_ctrl_height, m_rect.width, m_tab_ctrl_height); - m_tabs->SetSize (m_rect.x, m_rect.y + m_rect.height - m_tab_ctrl_height, m_rect.width, m_tab_ctrl_height); - m_tabs->SetRect (wxRect(0, 0, m_rect.width, m_tab_ctrl_height)); - } - else //TODO: if (GetFlags() & wxAUI_NB_TOP) - { - m_tab_rect = wxRect (m_rect.x, m_rect.y, m_rect.width, m_tab_ctrl_height); - m_tabs->SetSize (m_rect.x, m_rect.y, m_rect.width, m_tab_ctrl_height); - m_tabs->SetRect (wxRect(0, 0, m_rect.width, m_tab_ctrl_height)); - } - // TODO: else if (GetFlags() & wxAUI_NB_LEFT){} - // TODO: else if (GetFlags() & wxAUI_NB_RIGHT){} - - m_tabs->Refresh(); - m_tabs->Update(); - - wxAuiNotebookPageArray& pages = m_tabs->GetPages(); - size_t i, page_count = pages.GetCount(); - - for (i = 0; i < page_count; ++i) - { - wxAuiNotebookPage& page = pages.Item(i); - if (m_tabs->GetFlags() & wxAUI_NB_BOTTOM) - { - page.window->SetSize(m_rect.x, m_rect.y, - m_rect.width, m_rect.height - m_tab_ctrl_height); - } - else //TODO: if (GetFlags() & wxAUI_NB_TOP) - { - page.window->SetSize(m_rect.x, m_rect.y + m_tab_ctrl_height, - m_rect.width, m_rect.height - m_tab_ctrl_height); - } - // TODO: else if (GetFlags() & wxAUI_NB_LEFT){} - // TODO: else if (GetFlags() & wxAUI_NB_RIGHT){} - -#if wxUSE_MDI - if (page.window->IsKindOf(CLASSINFO(wxAuiMDIChildFrame))) - { - wxAuiMDIChildFrame* wnd = (wxAuiMDIChildFrame*)page.window; - wnd->ApplyMDIChildFrameRect(); - } -#endif - } - } - - void DoGetSize(int* x, int* y) const - { - if (x) - *x = m_rect.GetWidth(); - if (y) - *y = m_rect.GetHeight(); - } - - void Update() - { - // does nothing - } - -public: - - wxRect m_rect; - wxRect m_tab_rect; - wxAuiTabCtrl* m_tabs; - int m_tab_ctrl_height; -}; - - -const int wxAuiBaseTabCtrlId = 5380; - - -// -- wxAuiNotebook class implementation -- - -BEGIN_EVENT_TABLE(wxAuiNotebook, wxControl) - EVT_SIZE(wxAuiNotebook::OnSize) - EVT_CHILD_FOCUS(wxAuiNotebook::OnChildFocus) - EVT_COMMAND_RANGE(wxAuiBaseTabCtrlId, wxAuiBaseTabCtrlId+500, - wxEVT_COMMAND_AUINOTEBOOK_PAGE_CHANGING, - wxAuiNotebook::OnTabClicked) - EVT_COMMAND_RANGE(wxAuiBaseTabCtrlId, wxAuiBaseTabCtrlId+500, - wxEVT_COMMAND_AUINOTEBOOK_BEGIN_DRAG, - wxAuiNotebook::OnTabBeginDrag) - EVT_COMMAND_RANGE(wxAuiBaseTabCtrlId, wxAuiBaseTabCtrlId+500, - wxEVT_COMMAND_AUINOTEBOOK_END_DRAG, - wxAuiNotebook::OnTabEndDrag) - EVT_COMMAND_RANGE(wxAuiBaseTabCtrlId, wxAuiBaseTabCtrlId+500, - wxEVT_COMMAND_AUINOTEBOOK_DRAG_MOTION, - wxAuiNotebook::OnTabDragMotion) - EVT_COMMAND_RANGE(wxAuiBaseTabCtrlId, wxAuiBaseTabCtrlId+500, - wxEVT_COMMAND_AUINOTEBOOK_BUTTON, - wxAuiNotebook::OnTabButton) - EVT_COMMAND_RANGE(wxAuiBaseTabCtrlId, wxAuiBaseTabCtrlId+500, - wxEVT_COMMAND_AUINOTEBOOK_TAB_MIDDLE_DOWN, - wxAuiNotebook::OnTabMiddleDown) - EVT_COMMAND_RANGE(wxAuiBaseTabCtrlId, wxAuiBaseTabCtrlId+500, - wxEVT_COMMAND_AUINOTEBOOK_TAB_MIDDLE_UP, - wxAuiNotebook::OnTabMiddleUp) - EVT_COMMAND_RANGE(wxAuiBaseTabCtrlId, wxAuiBaseTabCtrlId+500, - wxEVT_COMMAND_AUINOTEBOOK_TAB_RIGHT_DOWN, - wxAuiNotebook::OnTabRightDown) - EVT_COMMAND_RANGE(wxAuiBaseTabCtrlId, wxAuiBaseTabCtrlId+500, - wxEVT_COMMAND_AUINOTEBOOK_TAB_RIGHT_UP, - wxAuiNotebook::OnTabRightUp) - EVT_COMMAND_RANGE(wxAuiBaseTabCtrlId, wxAuiBaseTabCtrlId+500, - wxEVT_COMMAND_AUINOTEBOOK_BG_DCLICK, - wxAuiNotebook::OnTabBgDClick) - EVT_NAVIGATION_KEY(wxAuiNotebook::OnNavigationKey) -END_EVENT_TABLE() - -wxAuiNotebook::wxAuiNotebook() -{ - m_curpage = -1; - m_tab_id_counter = wxAuiBaseTabCtrlId; - m_dummy_wnd = NULL; - m_tab_ctrl_height = 20; - m_requested_bmp_size = wxDefaultSize; - m_requested_tabctrl_height = -1; -} - -wxAuiNotebook::wxAuiNotebook(wxWindow *parent, - wxWindowID id, - const wxPoint& pos, - const wxSize& size, - long style) : wxControl(parent, id, pos, size, style) -{ - m_dummy_wnd = NULL; - m_requested_bmp_size = wxDefaultSize; - m_requested_tabctrl_height = -1; - InitNotebook(style); -} - -bool wxAuiNotebook::Create(wxWindow* parent, - wxWindowID id, - const wxPoint& pos, - const wxSize& size, - long style) -{ - if (!wxControl::Create(parent, id, pos, size, style)) - return false; - - InitNotebook(style); - - return true; -} - -// InitNotebook() contains common initialization -// code called by all constructors -void wxAuiNotebook::InitNotebook(long style) -{ - m_curpage = -1; - m_tab_id_counter = wxAuiBaseTabCtrlId; - m_dummy_wnd = NULL; - m_flags = (unsigned int)style; - m_tab_ctrl_height = 20; - - m_normal_font = *wxNORMAL_FONT; - m_selected_font = *wxNORMAL_FONT; - m_selected_font.SetWeight(wxBOLD); - - SetArtProvider(new wxAuiDefaultTabArt); - - m_dummy_wnd = new wxWindow(this, wxID_ANY, wxPoint(0,0), wxSize(0,0)); - m_dummy_wnd->SetSize(200, 200); - m_dummy_wnd->Show(false); - - m_mgr.SetManagedWindow(this); - m_mgr.SetFlags(wxAUI_MGR_DEFAULT); - m_mgr.SetDockSizeConstraint(1.0, 1.0); // no dock size constraint - - m_mgr.AddPane(m_dummy_wnd, - wxAuiPaneInfo().Name(wxT("dummy")).Bottom().CaptionVisible(false).Show(false)); - - m_mgr.Update(); -} - -wxAuiNotebook::~wxAuiNotebook() -{ - // Indicate we're deleting pages - m_isBeingDeleted = true; - - while ( GetPageCount() > 0 ) - DeletePage(0); - - m_mgr.UnInit(); -} - -void wxAuiNotebook::SetArtProvider(wxAuiTabArt* art) -{ - m_tabs.SetArtProvider(art); - - UpdateTabCtrlHeight(); -} - -// SetTabCtrlHeight() is the highest-level override of the -// tab height. A call to this function effectively enforces a -// specified tab ctrl height, overriding all other considerations, -// such as text or bitmap height. It overrides any call to -// SetUniformBitmapSize(). Specifying a height of -1 reverts -// any previous call and returns to the default behavior - -void wxAuiNotebook::SetTabCtrlHeight(int height) -{ - m_requested_tabctrl_height = height; - - // if window is already initialized, recalculate the tab height - if (m_dummy_wnd) - { - UpdateTabCtrlHeight(); - } -} - - -// SetUniformBitmapSize() ensures that all tabs will have -// the same height, even if some tabs don't have bitmaps -// Passing wxDefaultSize to this function will instruct -// the control to use dynamic tab height-- so when a tab -// with a large bitmap is added, the tab ctrl's height will -// automatically increase to accommodate the bitmap - -void wxAuiNotebook::SetUniformBitmapSize(const wxSize& size) -{ - m_requested_bmp_size = size; - - // if window is already initialized, recalculate the tab height - if (m_dummy_wnd) - { - UpdateTabCtrlHeight(); - } -} - -// UpdateTabCtrlHeight() does the actual tab resizing. It's meant -// to be used interally -void wxAuiNotebook::UpdateTabCtrlHeight() -{ - // get the tab ctrl height we will use - int height = CalculateTabCtrlHeight(); - - // if the tab control height needs to change, update - // all of our tab controls with the new height - if (m_tab_ctrl_height != height) - { - wxAuiTabArt* art = m_tabs.GetArtProvider(); - - m_tab_ctrl_height = height; - - wxAuiPaneInfoArray& all_panes = m_mgr.GetAllPanes(); - size_t i, pane_count = all_panes.GetCount(); - for (i = 0; i < pane_count; ++i) - { - wxAuiPaneInfo& pane = all_panes.Item(i); - if (pane.name == wxT("dummy")) - continue; - wxTabFrame* tab_frame = (wxTabFrame*)pane.window; - wxAuiTabCtrl* tabctrl = tab_frame->m_tabs; - tab_frame->SetTabCtrlHeight(m_tab_ctrl_height); - tabctrl->SetArtProvider(art->Clone()); - tab_frame->DoSizing(); - } - } -} - -void wxAuiNotebook::UpdateHintWindowSize() -{ - wxSize size = CalculateNewSplitSize(); - - // the placeholder hint window should be set to this size - wxAuiPaneInfo& info = m_mgr.GetPane(wxT("dummy")); - if (info.IsOk()) - { - info.MinSize(size); - info.BestSize(size); - m_dummy_wnd->SetSize(size); - } -} - - -// calculates the size of the new split -wxSize wxAuiNotebook::CalculateNewSplitSize() -{ - // count number of tab controls - int tab_ctrl_count = 0; - wxAuiPaneInfoArray& all_panes = m_mgr.GetAllPanes(); - size_t i, pane_count = all_panes.GetCount(); - for (i = 0; i < pane_count; ++i) - { - wxAuiPaneInfo& pane = all_panes.Item(i); - if (pane.name == wxT("dummy")) - continue; - tab_ctrl_count++; - } - - wxSize new_split_size; - - // if there is only one tab control, the first split - // should happen around the middle - if (tab_ctrl_count < 2) - { - new_split_size = GetClientSize(); - new_split_size.x /= 2; - new_split_size.y /= 2; - } - else - { - // this is in place of a more complicated calculation - // that needs to be implemented - new_split_size = wxSize(180,180); - } - - return new_split_size; -} - -int wxAuiNotebook::CalculateTabCtrlHeight() -{ - // if a fixed tab ctrl height is specified, - // just return that instead of calculating a - // tab height - if (m_requested_tabctrl_height != -1) - return m_requested_tabctrl_height; - - // find out new best tab height - wxAuiTabArt* art = m_tabs.GetArtProvider(); - - return art->GetBestTabCtrlSize(this, - m_tabs.GetPages(), - m_requested_bmp_size); -} - - -wxAuiTabArt* wxAuiNotebook::GetArtProvider() const -{ - return m_tabs.GetArtProvider(); -} - -void wxAuiNotebook::SetWindowStyleFlag(long style) -{ - wxControl::SetWindowStyleFlag(style); - - m_flags = (unsigned int)style; - - // if the control is already initialized - if (m_mgr.GetManagedWindow() == (wxWindow*)this) - { - // let all of the tab children know about the new style - - wxAuiPaneInfoArray& all_panes = m_mgr.GetAllPanes(); - size_t i, pane_count = all_panes.GetCount(); - for (i = 0; i < pane_count; ++i) - { - wxAuiPaneInfo& pane = all_panes.Item(i); - if (pane.name == wxT("dummy")) - continue; - wxTabFrame* tabframe = (wxTabFrame*)pane.window; - wxAuiTabCtrl* tabctrl = tabframe->m_tabs; - tabctrl->SetFlags(m_flags); - tabframe->DoSizing(); - tabctrl->Refresh(); - tabctrl->Update(); - } - } -} - - -bool wxAuiNotebook::AddPage(wxWindow* page, - const wxString& caption, - bool select, - const wxBitmap& bitmap) -{ - return InsertPage(GetPageCount(), page, caption, select, bitmap); -} - -bool wxAuiNotebook::InsertPage(size_t page_idx, - wxWindow* page, - const wxString& caption, - bool select, - const wxBitmap& bitmap) -{ - wxASSERT_MSG(page, wxT("page pointer must be non-NULL")); - if (!page) - return false; - - page->Reparent(this); - - wxAuiNotebookPage info; - info.window = page; - info.caption = caption; - info.bitmap = bitmap; - info.active = false; - - // if there are currently no tabs, the first added - // tab must be active - if (m_tabs.GetPageCount() == 0) - info.active = true; - - m_tabs.InsertPage(page, info, page_idx); - - // if that was the first page added, even if - // select is false, it must become the "current page" - // (though no select events will be fired) - if (!select && m_tabs.GetPageCount() == 1) - select = true; - //m_curpage = GetPageIndex(page); - - wxAuiTabCtrl* active_tabctrl = GetActiveTabCtrl(); - if (page_idx >= active_tabctrl->GetPageCount()) - active_tabctrl->AddPage(page, info); - else - active_tabctrl->InsertPage(page, info, page_idx); - - UpdateTabCtrlHeight(); - DoSizing(); - active_tabctrl->DoShowHide(); - - // adjust selected index - if(m_curpage >= (int) page_idx) - m_curpage++; - - if (select) - { - int idx = m_tabs.GetIdxFromWindow(page); - wxASSERT_MSG(idx != -1, wxT("Invalid Page index returned on wxAuiNotebook::InsertPage()")); - - SetSelection(idx); - } - - return true; -} - - -// DeletePage() removes a tab from the multi-notebook, -// and destroys the window as well -bool wxAuiNotebook::DeletePage(size_t page_idx) -{ - if (page_idx >= m_tabs.GetPageCount()) - return false; - - wxWindow* wnd = m_tabs.GetWindowFromIdx(page_idx); - - // hide the window in advance, as this will - // prevent flicker - if ( !IsBeingDeleted() ) - ShowWnd(wnd, false); - - if (!RemovePage(page_idx)) - return false; - - // actually destroy the window now -#if wxUSE_MDI - if (wnd->IsKindOf(CLASSINFO(wxAuiMDIChildFrame))) - { - // delete the child frame with pending delete, as is - // customary with frame windows - if (!wxPendingDelete.Member(wnd)) - wxPendingDelete.Append(wnd); - } - else -#endif - { - wnd->Destroy(); - } - - return true; -} - - - -// RemovePage() removes a tab from the multi-notebook, -// but does not destroy the window -bool wxAuiNotebook::RemovePage(size_t page_idx) -{ - // save active window pointer - wxWindow* active_wnd = NULL; - if (m_curpage >= 0) - active_wnd = m_tabs.GetWindowFromIdx(m_curpage); - - // save pointer of window being deleted - wxWindow* wnd = m_tabs.GetWindowFromIdx(page_idx); - wxWindow* new_active = NULL; - - // make sure we found the page - if (!wnd) - return false; - - // find out which onscreen tab ctrl owns this tab - wxAuiTabCtrl* ctrl; - int ctrl_idx; - if (!FindTab(wnd, &ctrl, &ctrl_idx)) - return false; - - bool is_curpage = (m_curpage == (int)page_idx); - bool is_active_in_split = ctrl->GetPage(ctrl_idx).active; - - - // remove the tab from main catalog - if (!m_tabs.RemovePage(wnd)) - return false; - - // remove the tab from the onscreen tab ctrl - ctrl->RemovePage(wnd); - - if (is_active_in_split) - { - int ctrl_new_page_count = (int)ctrl->GetPageCount(); - - if (ctrl_idx >= ctrl_new_page_count) - ctrl_idx = ctrl_new_page_count-1; - - if (ctrl_idx >= 0 && ctrl_idx < (int)ctrl->GetPageCount()) - { - // set new page as active in the tab split - ctrl->SetActivePage(ctrl_idx); - - // if the page deleted was the current page for the - // entire tab control, then record the window - // pointer of the new active page for activation - if (is_curpage) - { - new_active = ctrl->GetWindowFromIdx(ctrl_idx); - } - } - } - else - { - // we are not deleting the active page, so keep it the same - new_active = active_wnd; - } - - - if (!new_active) - { - // we haven't yet found a new page to active, - // so select the next page from the main tab - // catalogue - - if (page_idx < m_tabs.GetPageCount()) - { - new_active = m_tabs.GetPage(page_idx).window; - } - - if (!new_active && m_tabs.GetPageCount() > 0) - { - new_active = m_tabs.GetPage(0).window; - } - } - - - RemoveEmptyTabFrames(); - - // set new active pane - m_curpage = -1; - if (new_active && !m_isBeingDeleted) - { - SetSelection(m_tabs.GetIdxFromWindow(new_active)); - } - - return true; -} - -// GetPageIndex() returns the index of the page, or -1 if the -// page could not be located in the notebook -int wxAuiNotebook::GetPageIndex(wxWindow* page_wnd) const -{ - return m_tabs.GetIdxFromWindow(page_wnd); -} - - - -// SetPageText() changes the tab caption of the specified page -bool wxAuiNotebook::SetPageText(size_t page_idx, const wxString& text) -{ - if (page_idx >= m_tabs.GetPageCount()) - return false; - - // update our own tab catalog - wxAuiNotebookPage& page_info = m_tabs.GetPage(page_idx); - page_info.caption = text; - - // update what's on screen - wxAuiTabCtrl* ctrl; - int ctrl_idx; - if (FindTab(page_info.window, &ctrl, &ctrl_idx)) - { - wxAuiNotebookPage& info = ctrl->GetPage(ctrl_idx); - info.caption = text; - ctrl->Refresh(); - ctrl->Update(); - } - - return true; -} - -// returns the page caption -wxString wxAuiNotebook::GetPageText(size_t page_idx) const -{ - if (page_idx >= m_tabs.GetPageCount()) - return wxEmptyString; - - // update our own tab catalog - const wxAuiNotebookPage& page_info = m_tabs.GetPage(page_idx); - return page_info.caption; -} - -bool wxAuiNotebook::SetPageBitmap(size_t page_idx, const wxBitmap& bitmap) -{ - if (page_idx >= m_tabs.GetPageCount()) - return false; - - // update our own tab catalog - wxAuiNotebookPage& page_info = m_tabs.GetPage(page_idx); - page_info.bitmap = bitmap; - - // tab height might have changed - UpdateTabCtrlHeight(); - - // update what's on screen - wxAuiTabCtrl* ctrl; - int ctrl_idx; - if (FindTab(page_info.window, &ctrl, &ctrl_idx)) - { - wxAuiNotebookPage& info = ctrl->GetPage(ctrl_idx); - info.bitmap = bitmap; - ctrl->Refresh(); - ctrl->Update(); - } - - return true; -} - -// returns the page bitmap -wxBitmap wxAuiNotebook::GetPageBitmap(size_t page_idx) const -{ - if (page_idx >= m_tabs.GetPageCount()) - return wxBitmap(); - - // update our own tab catalog - const wxAuiNotebookPage& page_info = m_tabs.GetPage(page_idx); - return page_info.bitmap; -} - -// GetSelection() returns the index of the currently active page -int wxAuiNotebook::GetSelection() const -{ - return m_curpage; -} - -// SetSelection() sets the currently active page -size_t wxAuiNotebook::SetSelection(size_t new_page) -{ - wxWindow* wnd = m_tabs.GetWindowFromIdx(new_page); - if (!wnd) - return m_curpage; - - // don't change the page unless necessary; - // however, clicking again on a tab should give it the focus. - if ((int)new_page == m_curpage) - { - wxAuiTabCtrl* ctrl; - int ctrl_idx; - if (FindTab(wnd, &ctrl, &ctrl_idx)) - { - if (FindFocus() != ctrl) - ctrl->SetFocus(); - } - return m_curpage; - } - - wxAuiNotebookEvent evt(wxEVT_COMMAND_AUINOTEBOOK_PAGE_CHANGING, m_windowId); - evt.SetSelection(new_page); - evt.SetOldSelection(m_curpage); - evt.SetEventObject(this); - if (!GetEventHandler()->ProcessEvent(evt) || evt.IsAllowed()) - { - int old_curpage = m_curpage; - m_curpage = new_page; - - // program allows the page change - evt.SetEventType(wxEVT_COMMAND_AUINOTEBOOK_PAGE_CHANGED); - (void)GetEventHandler()->ProcessEvent(evt); - - - wxAuiTabCtrl* ctrl; - int ctrl_idx; - if (FindTab(wnd, &ctrl, &ctrl_idx)) - { - m_tabs.SetActivePage(wnd); - - ctrl->SetActivePage(ctrl_idx); - DoSizing(); - ctrl->DoShowHide(); - - ctrl->MakeTabVisible(ctrl_idx, ctrl); - - // set fonts - wxAuiPaneInfoArray& all_panes = m_mgr.GetAllPanes(); - size_t i, pane_count = all_panes.GetCount(); - for (i = 0; i < pane_count; ++i) - { - wxAuiPaneInfo& pane = all_panes.Item(i); - if (pane.name == wxT("dummy")) - continue; - wxAuiTabCtrl* tabctrl = ((wxTabFrame*)pane.window)->m_tabs; - if (tabctrl != ctrl) - tabctrl->SetSelectedFont(m_normal_font); - else - tabctrl->SetSelectedFont(m_selected_font); - tabctrl->Refresh(); - } - - // Set the focus to the page if we're not currently focused on the tab. - // This is Firefox-like behaviour. - if (wnd->IsShownOnScreen() && FindFocus() != ctrl) - wnd->SetFocus(); - - return old_curpage; - } - } - - return m_curpage; -} - -// GetPageCount() returns the total number of -// pages managed by the multi-notebook -size_t wxAuiNotebook::GetPageCount() const -{ - return m_tabs.GetPageCount(); -} - -// GetPage() returns the wxWindow pointer of the -// specified page -wxWindow* wxAuiNotebook::GetPage(size_t page_idx) const -{ - wxASSERT(page_idx < m_tabs.GetPageCount()); - - return m_tabs.GetWindowFromIdx(page_idx); -} - -// DoSizing() performs all sizing operations in each tab control -void wxAuiNotebook::DoSizing() -{ - wxAuiPaneInfoArray& all_panes = m_mgr.GetAllPanes(); - size_t i, pane_count = all_panes.GetCount(); - for (i = 0; i < pane_count; ++i) - { - if (all_panes.Item(i).name == wxT("dummy")) - continue; - - wxTabFrame* tabframe = (wxTabFrame*)all_panes.Item(i).window; - tabframe->DoSizing(); - } -} - -// GetActiveTabCtrl() returns the active tab control. It is -// called to determine which control gets new windows being added -wxAuiTabCtrl* wxAuiNotebook::GetActiveTabCtrl() -{ - if (m_curpage >= 0 && m_curpage < (int)m_tabs.GetPageCount()) - { - wxAuiTabCtrl* ctrl; - int idx; - - // find the tab ctrl with the current page - if (FindTab(m_tabs.GetPage(m_curpage).window, - &ctrl, &idx)) - { - return ctrl; - } - } - - // no current page, just find the first tab ctrl - wxAuiPaneInfoArray& all_panes = m_mgr.GetAllPanes(); - size_t i, pane_count = all_panes.GetCount(); - for (i = 0; i < pane_count; ++i) - { - if (all_panes.Item(i).name == wxT("dummy")) - continue; - - wxTabFrame* tabframe = (wxTabFrame*)all_panes.Item(i).window; - return tabframe->m_tabs; - } - - // If there is no tabframe at all, create one - wxTabFrame* tabframe = new wxTabFrame; - tabframe->SetTabCtrlHeight(m_tab_ctrl_height); - tabframe->m_tabs = new wxAuiTabCtrl(this, - m_tab_id_counter++, - wxDefaultPosition, - wxDefaultSize, - wxNO_BORDER|wxWANTS_CHARS); - tabframe->m_tabs->SetFlags(m_flags); - tabframe->m_tabs->SetArtProvider(m_tabs.GetArtProvider()->Clone()); - m_mgr.AddPane(tabframe, - wxAuiPaneInfo().Center().CaptionVisible(false)); - - m_mgr.Update(); - - return tabframe->m_tabs; -} - -// FindTab() finds the tab control that currently contains the window as well -// as the index of the window in the tab control. It returns true if the -// window was found, otherwise false. -bool wxAuiNotebook::FindTab(wxWindow* page, wxAuiTabCtrl** ctrl, int* idx) -{ - wxAuiPaneInfoArray& all_panes = m_mgr.GetAllPanes(); - size_t i, pane_count = all_panes.GetCount(); - for (i = 0; i < pane_count; ++i) - { - if (all_panes.Item(i).name == wxT("dummy")) - continue; - - wxTabFrame* tabframe = (wxTabFrame*)all_panes.Item(i).window; - - int page_idx = tabframe->m_tabs->GetIdxFromWindow(page); - if (page_idx != -1) - { - *ctrl = tabframe->m_tabs; - *idx = page_idx; - return true; - } - } - - return false; -} - -void wxAuiNotebook::Split(size_t page, int direction) -{ - wxSize cli_size = GetClientSize(); - - // get the page's window pointer - wxWindow* wnd = GetPage(page); - if (!wnd) - return; - - // notebooks with 1 or less pages can't be split - if (GetPageCount() < 2) - return; - - // find out which tab control the page currently belongs to - wxAuiTabCtrl *src_tabs, *dest_tabs; - int src_idx = -1; - src_tabs = NULL; - if (!FindTab(wnd, &src_tabs, &src_idx)) - return; - if (!src_tabs || src_idx == -1) - return; - - // choose a split size - wxSize split_size; - if (GetPageCount() > 2) - { - split_size = CalculateNewSplitSize(); - } - else - { - // because there are two panes, always split them - // equally - split_size = GetClientSize(); - split_size.x /= 2; - split_size.y /= 2; - } - - - // create a new tab frame - wxTabFrame* new_tabs = new wxTabFrame; - new_tabs->m_rect = wxRect(wxPoint(0,0), split_size); - new_tabs->SetTabCtrlHeight(m_tab_ctrl_height); - new_tabs->m_tabs = new wxAuiTabCtrl(this, - m_tab_id_counter++, - wxDefaultPosition, - wxDefaultSize, - wxNO_BORDER|wxWANTS_CHARS); - new_tabs->m_tabs->SetArtProvider(m_tabs.GetArtProvider()->Clone()); - new_tabs->m_tabs->SetFlags(m_flags); - dest_tabs = new_tabs->m_tabs; - - // create a pane info structure with the information - // about where the pane should be added - wxAuiPaneInfo pane_info = wxAuiPaneInfo().Bottom().CaptionVisible(false); - wxPoint mouse_pt; - - if (direction == wxLEFT) - { - pane_info.Left(); - mouse_pt = wxPoint(0, cli_size.y/2); - } - else if (direction == wxRIGHT) - { - pane_info.Right(); - mouse_pt = wxPoint(cli_size.x, cli_size.y/2); - } - else if (direction == wxTOP) - { - pane_info.Top(); - mouse_pt = wxPoint(cli_size.x/2, 0); - } - else if (direction == wxBOTTOM) - { - pane_info.Bottom(); - mouse_pt = wxPoint(cli_size.x/2, cli_size.y); - } - - m_mgr.AddPane(new_tabs, pane_info, mouse_pt); - m_mgr.Update(); - - // remove the page from the source tabs - wxAuiNotebookPage page_info = src_tabs->GetPage(src_idx); - page_info.active = false; - src_tabs->RemovePage(page_info.window); - if (src_tabs->GetPageCount() > 0) - { - src_tabs->SetActivePage((size_t)0); - src_tabs->DoShowHide(); - src_tabs->Refresh(); - } - - - // add the page to the destination tabs - dest_tabs->InsertPage(page_info.window, page_info, 0); - - if (src_tabs->GetPageCount() == 0) - { - RemoveEmptyTabFrames(); - } - - DoSizing(); - dest_tabs->DoShowHide(); - dest_tabs->Refresh(); - - // force the set selection function reset the selection - m_curpage = -1; - - // set the active page to the one we just split off - SetSelection(m_tabs.GetIdxFromWindow(page_info.window)); - - UpdateHintWindowSize(); -} - - -void wxAuiNotebook::OnSize(wxSizeEvent& evt) -{ - UpdateHintWindowSize(); - - evt.Skip(); -} - -void wxAuiNotebook::OnTabClicked(wxCommandEvent& command_evt) -{ - wxAuiNotebookEvent& evt = (wxAuiNotebookEvent&)command_evt; - - wxAuiTabCtrl* ctrl = (wxAuiTabCtrl*)evt.GetEventObject(); - wxASSERT(ctrl != NULL); - - wxWindow* wnd = ctrl->GetWindowFromIdx(evt.GetSelection()); - wxASSERT(wnd != NULL); - - int idx = m_tabs.GetIdxFromWindow(wnd); - wxASSERT(idx != -1); - - - // since a tab was clicked, let the parent know that we received - // the focus, even if we will assign that focus immediately - // to the child tab in the SetSelection call below - // (the child focus event will also let wxAuiManager, if any, - // know that the notebook control has been activated) - - wxWindow* parent = GetParent(); - if (parent) - { - wxChildFocusEvent eventFocus(this); - parent->GetEventHandler()->ProcessEvent(eventFocus); - } - - - SetSelection(idx); -} - -void wxAuiNotebook::OnTabBgDClick(wxCommandEvent& WXUNUSED(evt)) -{ - // notify owner that the tabbar background has been double-clicked - wxAuiNotebookEvent e(wxEVT_COMMAND_AUINOTEBOOK_BG_DCLICK, m_windowId); - e.SetEventObject(this); - GetEventHandler()->ProcessEvent(e); -} - -void wxAuiNotebook::OnTabBeginDrag(wxCommandEvent&) -{ - m_last_drag_x = 0; -} - -void wxAuiNotebook::OnTabDragMotion(wxCommandEvent& evt) -{ - wxPoint screen_pt = ::wxGetMousePosition(); - wxPoint client_pt = ScreenToClient(screen_pt); - wxPoint zero(0,0); - - wxAuiTabCtrl* src_tabs = (wxAuiTabCtrl*)evt.GetEventObject(); - wxAuiTabCtrl* dest_tabs = GetTabCtrlFromPoint(client_pt); - - if (dest_tabs == src_tabs) - { - if (src_tabs) - { - src_tabs->SetCursor(wxCursor(wxCURSOR_ARROW)); - } - - // always hide the hint for inner-tabctrl drag - m_mgr.HideHint(); - - // if tab moving is not allowed, leave - if (!(m_flags & wxAUI_NB_TAB_MOVE)) - { - return; - } - - wxPoint pt = dest_tabs->ScreenToClient(screen_pt); - wxWindow* dest_location_tab; - - // this is an inner-tab drag/reposition - if (dest_tabs->TabHitTest(pt.x, pt.y, &dest_location_tab)) - { - int src_idx = evt.GetSelection(); - int dest_idx = dest_tabs->GetIdxFromWindow(dest_location_tab); - - // prevent jumpy drag - if ((src_idx == dest_idx) || dest_idx == -1 || - (src_idx > dest_idx && m_last_drag_x <= pt.x) || - (src_idx < dest_idx && m_last_drag_x >= pt.x)) - { - m_last_drag_x = pt.x; - return; - } - - - wxWindow* src_tab = dest_tabs->GetWindowFromIdx(src_idx); - dest_tabs->MovePage(src_tab, dest_idx); - dest_tabs->SetActivePage((size_t)dest_idx); - dest_tabs->DoShowHide(); - dest_tabs->Refresh(); - m_last_drag_x = pt.x; - - } - - return; - } - - - // if external drag is allowed, check if the tab is being dragged - // over a different wxAuiNotebook control - if (m_flags & wxAUI_NB_TAB_EXTERNAL_MOVE) - { - wxWindow* tab_ctrl = ::wxFindWindowAtPoint(screen_pt); - - // if we aren't over any window, stop here - if (!tab_ctrl) - return; - - // make sure we are not over the hint window - if (!tab_ctrl->IsKindOf(CLASSINFO(wxFrame))) - { - while (tab_ctrl) - { - if (tab_ctrl->IsKindOf(CLASSINFO(wxAuiTabCtrl))) - break; - tab_ctrl = tab_ctrl->GetParent(); - } - - if (tab_ctrl) - { - wxAuiNotebook* nb = (wxAuiNotebook*)tab_ctrl->GetParent(); - - if (nb != this) - { - wxRect hint_rect = tab_ctrl->GetClientRect(); - tab_ctrl->ClientToScreen(&hint_rect.x, &hint_rect.y); - m_mgr.ShowHint(hint_rect); - return; - } - } - } - else - { - if (!dest_tabs) - { - // we are either over a hint window, or not over a tab - // window, and there is no where to drag to, so exit - return; - } - } - } - - - // if there are less than two panes, split can't happen, so leave - if (m_tabs.GetPageCount() < 2) - return; - - // if tab moving is not allowed, leave - if (!(m_flags & wxAUI_NB_TAB_SPLIT)) - return; - - - if (src_tabs) - { - src_tabs->SetCursor(wxCursor(wxCURSOR_SIZING)); - } - - - if (dest_tabs) - { - wxRect hint_rect = dest_tabs->GetRect(); - ClientToScreen(&hint_rect.x, &hint_rect.y); - m_mgr.ShowHint(hint_rect); - } - else - { - m_mgr.DrawHintRect(m_dummy_wnd, client_pt, zero); - } -} - - - -void wxAuiNotebook::OnTabEndDrag(wxCommandEvent& command_evt) -{ - wxAuiNotebookEvent& evt = (wxAuiNotebookEvent&)command_evt; - - m_mgr.HideHint(); - - - wxAuiTabCtrl* src_tabs = (wxAuiTabCtrl*)evt.GetEventObject(); - wxAuiTabCtrl* dest_tabs = NULL; - if (src_tabs) - { - // set cursor back to an arrow - src_tabs->SetCursor(wxCursor(wxCURSOR_ARROW)); - } - - // get the mouse position, which will be used to determine the drop point - wxPoint mouse_screen_pt = ::wxGetMousePosition(); - wxPoint mouse_client_pt = ScreenToClient(mouse_screen_pt); - - - - // check for an external move - if (m_flags & wxAUI_NB_TAB_EXTERNAL_MOVE) - { - wxWindow* tab_ctrl = ::wxFindWindowAtPoint(mouse_screen_pt); - - while (tab_ctrl) - { - if (tab_ctrl->IsKindOf(CLASSINFO(wxAuiTabCtrl))) - break; - tab_ctrl = tab_ctrl->GetParent(); - } - - if (tab_ctrl) - { - wxAuiNotebook* nb = (wxAuiNotebook*)tab_ctrl->GetParent(); - - if (nb != this) - { - // find out from the destination control - // if it's ok to drop this tab here - wxAuiNotebookEvent e(wxEVT_COMMAND_AUINOTEBOOK_ALLOW_DND, m_windowId); - e.SetSelection(evt.GetSelection()); - e.SetOldSelection(evt.GetSelection()); - e.SetEventObject(this); - e.SetDragSource(this); - e.Veto(); // dropping must be explicitly approved by control owner - - nb->GetEventHandler()->ProcessEvent(e); - - if (!e.IsAllowed()) - { - // no answer or negative answer - m_mgr.HideHint(); - return; - } - - // drop was allowed - int src_idx = evt.GetSelection(); - wxWindow* src_page = src_tabs->GetWindowFromIdx(src_idx); - - // Check that it's not an impossible parent relationship - wxWindow* p = nb; - while (p && !p->IsTopLevel()) - { - if (p == src_page) - { - return; - } - p = p->GetParent(); - } - - // get main index of the page - int main_idx = m_tabs.GetIdxFromWindow(src_page); - - // make a copy of the page info - wxAuiNotebookPage page_info = m_tabs.GetPage((size_t)main_idx); - - // remove the page from the source notebook - RemovePage(main_idx); - - // reparent the page - src_page->Reparent(nb); - - - // found out the insert idx - wxAuiTabCtrl* dest_tabs = (wxAuiTabCtrl*)tab_ctrl; - wxPoint pt = dest_tabs->ScreenToClient(mouse_screen_pt); - - wxWindow* target = NULL; - int insert_idx = -1; - dest_tabs->TabHitTest(pt.x, pt.y, &target); - if (target) - { - insert_idx = dest_tabs->GetIdxFromWindow(target); - } - - - // add the page to the new notebook - if (insert_idx == -1) - insert_idx = dest_tabs->GetPageCount(); - dest_tabs->InsertPage(page_info.window, page_info, insert_idx); - nb->m_tabs.AddPage(page_info.window, page_info); - - nb->DoSizing(); - dest_tabs->DoShowHide(); - dest_tabs->Refresh(); - - // set the selection in the destination tab control - nb->SetSelection(nb->m_tabs.GetIdxFromWindow(page_info.window)); - - // notify owner that the tab has been dragged - wxAuiNotebookEvent e2(wxEVT_COMMAND_AUINOTEBOOK_DRAG_DONE, m_windowId); - e2.SetSelection(evt.GetSelection()); - e2.SetOldSelection(evt.GetSelection()); - e2.SetEventObject(this); - GetEventHandler()->ProcessEvent(e2); - - return; - } - } - } - - - - - // only perform a tab split if it's allowed - if ((m_flags & wxAUI_NB_TAB_SPLIT) && m_tabs.GetPageCount() >= 2) - { - // If the pointer is in an existing tab frame, do a tab insert - wxWindow* hit_wnd = ::wxFindWindowAtPoint(mouse_screen_pt); - wxTabFrame* tab_frame = (wxTabFrame*)GetTabFrameFromTabCtrl(hit_wnd); - int insert_idx = -1; - if (tab_frame) - { - dest_tabs = tab_frame->m_tabs; - - if (dest_tabs == src_tabs) - return; - - - wxPoint pt = dest_tabs->ScreenToClient(mouse_screen_pt); - wxWindow* target = NULL; - dest_tabs->TabHitTest(pt.x, pt.y, &target); - if (target) - { - insert_idx = dest_tabs->GetIdxFromWindow(target); - } - } - else - { - wxPoint zero(0,0); - wxRect rect = m_mgr.CalculateHintRect(m_dummy_wnd, - mouse_client_pt, - zero); - if (rect.IsEmpty()) - { - // there is no suitable drop location here, exit out - return; - } - - // If there is no tabframe at all, create one - wxTabFrame* new_tabs = new wxTabFrame; - new_tabs->m_rect = wxRect(wxPoint(0,0), CalculateNewSplitSize()); - new_tabs->SetTabCtrlHeight(m_tab_ctrl_height); - new_tabs->m_tabs = new wxAuiTabCtrl(this, - m_tab_id_counter++, - wxDefaultPosition, - wxDefaultSize, - wxNO_BORDER|wxWANTS_CHARS); - new_tabs->m_tabs->SetArtProvider(m_tabs.GetArtProvider()->Clone()); - new_tabs->m_tabs->SetFlags(m_flags); - - m_mgr.AddPane(new_tabs, - wxAuiPaneInfo().Bottom().CaptionVisible(false), - mouse_client_pt); - m_mgr.Update(); - dest_tabs = new_tabs->m_tabs; - } - - - - // remove the page from the source tabs - wxAuiNotebookPage page_info = src_tabs->GetPage(evt.GetSelection()); - page_info.active = false; - src_tabs->RemovePage(page_info.window); - if (src_tabs->GetPageCount() > 0) - { - src_tabs->SetActivePage((size_t)0); - src_tabs->DoShowHide(); - src_tabs->Refresh(); - } - - - - // add the page to the destination tabs - if (insert_idx == -1) - insert_idx = dest_tabs->GetPageCount(); - dest_tabs->InsertPage(page_info.window, page_info, insert_idx); - - if (src_tabs->GetPageCount() == 0) - { - RemoveEmptyTabFrames(); - } - - DoSizing(); - dest_tabs->DoShowHide(); - dest_tabs->Refresh(); - - // force the set selection function reset the selection - m_curpage = -1; - - // set the active page to the one we just split off - SetSelection(m_tabs.GetIdxFromWindow(page_info.window)); - - UpdateHintWindowSize(); - } - - // notify owner that the tab has been dragged - wxAuiNotebookEvent e(wxEVT_COMMAND_AUINOTEBOOK_DRAG_DONE, m_windowId); - e.SetSelection(evt.GetSelection()); - e.SetOldSelection(evt.GetSelection()); - e.SetEventObject(this); - GetEventHandler()->ProcessEvent(e); -} - - - -wxAuiTabCtrl* wxAuiNotebook::GetTabCtrlFromPoint(const wxPoint& pt) -{ - // if we've just removed the last tab from the source - // tab set, the remove the tab control completely - wxAuiPaneInfoArray& all_panes = m_mgr.GetAllPanes(); - size_t i, pane_count = all_panes.GetCount(); - for (i = 0; i < pane_count; ++i) - { - if (all_panes.Item(i).name == wxT("dummy")) - continue; - - wxTabFrame* tabframe = (wxTabFrame*)all_panes.Item(i).window; - if (tabframe->m_tab_rect.Contains(pt)) - return tabframe->m_tabs; - } - - return NULL; -} - -wxWindow* wxAuiNotebook::GetTabFrameFromTabCtrl(wxWindow* tab_ctrl) -{ - // if we've just removed the last tab from the source - // tab set, the remove the tab control completely - wxAuiPaneInfoArray& all_panes = m_mgr.GetAllPanes(); - size_t i, pane_count = all_panes.GetCount(); - for (i = 0; i < pane_count; ++i) - { - if (all_panes.Item(i).name == wxT("dummy")) - continue; - - wxTabFrame* tabframe = (wxTabFrame*)all_panes.Item(i).window; - if (tabframe->m_tabs == tab_ctrl) - { - return tabframe; - } - } - - return NULL; -} - -void wxAuiNotebook::RemoveEmptyTabFrames() -{ - // if we've just removed the last tab from the source - // tab set, the remove the tab control completely - wxAuiPaneInfoArray all_panes = m_mgr.GetAllPanes(); - size_t i, pane_count = all_panes.GetCount(); - for (i = 0; i < pane_count; ++i) - { - if (all_panes.Item(i).name == wxT("dummy")) - continue; - - wxTabFrame* tab_frame = (wxTabFrame*)all_panes.Item(i).window; - if (tab_frame->m_tabs->GetPageCount() == 0) - { - m_mgr.DetachPane(tab_frame); - - // use pending delete because sometimes during - // window closing, refreshs are pending - if (!wxPendingDelete.Member(tab_frame->m_tabs)) - wxPendingDelete.Append(tab_frame->m_tabs); - - tab_frame->m_tabs = NULL; - - delete tab_frame; - } - } - - - // check to see if there is still a center pane; - // if there isn't, make a frame the center pane - wxAuiPaneInfoArray panes = m_mgr.GetAllPanes(); - pane_count = panes.GetCount(); - wxWindow* first_good = NULL; - bool center_found = false; - for (i = 0; i < pane_count; ++i) - { - if (panes.Item(i).name == wxT("dummy")) - continue; - if (panes.Item(i).dock_direction == wxAUI_DOCK_CENTRE) - center_found = true; - if (!first_good) - first_good = panes.Item(i).window; - } - - if (!center_found && first_good) - { - m_mgr.GetPane(first_good).Centre(); - } - - if (!m_isBeingDeleted) - m_mgr.Update(); -} - -void wxAuiNotebook::OnChildFocus(wxChildFocusEvent& evt) -{ - // if we're dragging a tab, don't change the current selection. - // This code prevents a bug that used to happen when the hint window - // was hidden. In the bug, the focus would return to the notebook - // child, which would then enter this handler and call - // SetSelection, which is not desired turn tab dragging. - - wxAuiPaneInfoArray& all_panes = m_mgr.GetAllPanes(); - size_t i, pane_count = all_panes.GetCount(); - for (i = 0; i < pane_count; ++i) - { - wxAuiPaneInfo& pane = all_panes.Item(i); - if (pane.name == wxT("dummy")) - continue; - wxTabFrame* tabframe = (wxTabFrame*)pane.window; - if (tabframe->m_tabs->IsDragging()) - return; - } - - - // change the tab selection to the child - // which was focused - int idx = m_tabs.GetIdxFromWindow(evt.GetWindow()); - if (idx != -1 && idx != m_curpage) - { - SetSelection(idx); - } -} - -void wxAuiNotebook::OnNavigationKey(wxNavigationKeyEvent& event) -{ - if ( event.IsWindowChange() ) { - // change pages - // FIXME: the problem with this is that if we have a split notebook, - // we selection may go all over the place. - AdvanceSelection(event.GetDirection()); - } - else { - // we get this event in 3 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 - // - // or - // - // c) we ourselves (see MSWTranslateMessage) generated the event - // - wxWindow * const parent = GetParent(); - - // the wxObject* casts are required to avoid MinGW GCC 2.95.3 ICE - const bool isFromParent = event.GetEventObject() == (wxObject*) parent; - const bool isFromSelf = event.GetEventObject() == (wxObject*) this; - - if ( isFromParent || isFromSelf ) - { - // no, it doesn't come from child, case (b) or (c): forward to a - // page but only if direction is backwards (TAB) or from ourselves, - if ( GetSelection() != wxNOT_FOUND && - (!event.GetDirection() || isFromSelf) ) - { - // so that the page knows that the event comes from it's parent - // and is being propagated downwards - event.SetEventObject(this); - - wxWindow *page = GetPage(GetSelection()); - if ( !page->GetEventHandler()->ProcessEvent(event) ) - { - page->SetFocus(); - } - //else: page manages focus inside it itself - } - else // otherwise set the focus to the notebook itself - { - SetFocus(); - } - } - else - { - // it comes from our child, case (a), pass to the parent, but only - // if the direction is forwards. Otherwise set the focus to the - // notebook itself. The notebook is always the 'first' control of a - // page. - if ( !event.GetDirection() ) - { - SetFocus(); - } - else if ( parent ) - { - event.SetCurrentFocus(this); - parent->GetEventHandler()->ProcessEvent(event); - } - } - } -} - -void wxAuiNotebook::OnTabButton(wxCommandEvent& command_evt) -{ - wxAuiNotebookEvent& evt = (wxAuiNotebookEvent&)command_evt; - wxAuiTabCtrl* tabs = (wxAuiTabCtrl*)evt.GetEventObject(); - - int button_id = evt.GetInt(); - - if (button_id == wxAUI_BUTTON_CLOSE) - { - int selection = evt.GetSelection(); - - if (selection == -1) - { - // if the close button is to the right, use the active - // page selection to determine which page to close - selection = tabs->GetActivePage(); - } - - if (selection != -1) - { - wxWindow* close_wnd = tabs->GetWindowFromIdx(selection); - - // ask owner if it's ok to close the tab - wxAuiNotebookEvent e(wxEVT_COMMAND_AUINOTEBOOK_PAGE_CLOSE, m_windowId); - const int idx = m_tabs.GetIdxFromWindow(close_wnd); - e.SetSelection(idx); - e.SetOldSelection(evt.GetSelection()); - e.SetEventObject(this); - GetEventHandler()->ProcessEvent(e); - if (!e.IsAllowed()) - return; - - -#if wxUSE_MDI - if (close_wnd->IsKindOf(CLASSINFO(wxAuiMDIChildFrame))) - { - close_wnd->Close(); - } - else -#endif - { - int main_idx = m_tabs.GetIdxFromWindow(close_wnd); - DeletePage(main_idx); - } - - // notify owner that the tab has been closed - wxAuiNotebookEvent e2(wxEVT_COMMAND_AUINOTEBOOK_PAGE_CLOSED, m_windowId); - e2.SetSelection(idx); - e2.SetEventObject(this); - GetEventHandler()->ProcessEvent(e2); - } - } -} - -void wxAuiNotebook::OnTabMiddleDown(wxCommandEvent& evt) -{ - // patch event through to owner - wxAuiTabCtrl* tabs = (wxAuiTabCtrl*)evt.GetEventObject(); - wxWindow* wnd = tabs->GetWindowFromIdx(evt.GetSelection()); - - wxAuiNotebookEvent e(wxEVT_COMMAND_AUINOTEBOOK_TAB_MIDDLE_DOWN, m_windowId); - e.SetSelection(m_tabs.GetIdxFromWindow(wnd)); - e.SetEventObject(this); - GetEventHandler()->ProcessEvent(e); -} - -void wxAuiNotebook::OnTabMiddleUp(wxCommandEvent& evt) -{ - // if the wxAUI_NB_MIDDLE_CLICK_CLOSE is specified, middle - // click should act like a tab close action. However, first - // give the owner an opportunity to handle the middle up event - // for custom action - - wxAuiTabCtrl* tabs = (wxAuiTabCtrl*)evt.GetEventObject(); - wxWindow* wnd = tabs->GetWindowFromIdx(evt.GetSelection()); - - wxAuiNotebookEvent e(wxEVT_COMMAND_AUINOTEBOOK_TAB_MIDDLE_UP, m_windowId); - e.SetSelection(m_tabs.GetIdxFromWindow(wnd)); - e.SetEventObject(this); - if (GetEventHandler()->ProcessEvent(e)) - return; - if (!e.IsAllowed()) - return; - - // check if we are supposed to close on middle-up - if ((m_flags & wxAUI_NB_MIDDLE_CLICK_CLOSE) == 0) - return; - - // simulate the user pressing the close button on the tab - evt.SetInt(wxAUI_BUTTON_CLOSE); - OnTabButton(evt); -} - -void wxAuiNotebook::OnTabRightDown(wxCommandEvent& evt) -{ - // patch event through to owner - wxAuiTabCtrl* tabs = (wxAuiTabCtrl*)evt.GetEventObject(); - wxWindow* wnd = tabs->GetWindowFromIdx(evt.GetSelection()); - - wxAuiNotebookEvent e(wxEVT_COMMAND_AUINOTEBOOK_TAB_RIGHT_DOWN, m_windowId); - e.SetSelection(m_tabs.GetIdxFromWindow(wnd)); - e.SetEventObject(this); - GetEventHandler()->ProcessEvent(e); -} - -void wxAuiNotebook::OnTabRightUp(wxCommandEvent& evt) -{ - // patch event through to owner - wxAuiTabCtrl* tabs = (wxAuiTabCtrl*)evt.GetEventObject(); - wxWindow* wnd = tabs->GetWindowFromIdx(evt.GetSelection()); - - wxAuiNotebookEvent e(wxEVT_COMMAND_AUINOTEBOOK_TAB_RIGHT_UP, m_windowId); - e.SetSelection(m_tabs.GetIdxFromWindow(wnd)); - e.SetEventObject(this); - GetEventHandler()->ProcessEvent(e); -} - - - -// Sets the normal font -void wxAuiNotebook::SetNormalFont(const wxFont& font) -{ - m_normal_font = font; - GetArtProvider()->SetNormalFont(font); -} - -// Sets the selected tab font -void wxAuiNotebook::SetSelectedFont(const wxFont& font) -{ - m_selected_font = font; - GetArtProvider()->SetSelectedFont(font); -} - -// Sets the measuring font -void wxAuiNotebook::SetMeasuringFont(const wxFont& font) -{ - GetArtProvider()->SetMeasuringFont(font); -} - -// Sets the tab font -bool wxAuiNotebook::SetFont(const wxFont& font) -{ - wxControl::SetFont(font); - - wxFont normalFont(font); - wxFont selectedFont(normalFont); - selectedFont.SetWeight(wxBOLD); - - SetNormalFont(normalFont); - SetSelectedFont(selectedFont); - SetMeasuringFont(selectedFont); - - return true; -} - -// Gets the tab control height -int wxAuiNotebook::GetTabCtrlHeight() const -{ - return m_tab_ctrl_height; -} - -// Gets the height of the notebook for a given page height -int wxAuiNotebook::GetHeightForPageHeight(int pageHeight) -{ - UpdateTabCtrlHeight(); - - int tabCtrlHeight = GetTabCtrlHeight(); - int decorHeight = 2; - return tabCtrlHeight + pageHeight + decorHeight; -} - -// Advances the selection, generation page selection events -void wxAuiNotebook::AdvanceSelection(bool forward) -{ - if (GetPageCount() <= 1) - return; - - int currentSelection = GetSelection(); - - if (forward) - { - if (currentSelection == (int) (GetPageCount() - 1)) - return; - else if (currentSelection == -1) - currentSelection = 0; - else - currentSelection ++; - } - else - { - if (currentSelection <= 0) - return; - else - currentSelection --; - } - - SetSelection(currentSelection); -} - -// Shows the window menu -bool wxAuiNotebook::ShowWindowMenu() -{ - wxAuiTabCtrl* tabCtrl = GetActiveTabCtrl(); - - int idx = tabCtrl->GetArtProvider()->ShowDropDown(tabCtrl, tabCtrl->GetPages(), tabCtrl->GetActivePage()); - - if (idx != -1) - { - wxAuiNotebookEvent e(wxEVT_COMMAND_AUINOTEBOOK_PAGE_CHANGING, tabCtrl->GetId()); - e.SetSelection(idx); - e.SetOldSelection(tabCtrl->GetActivePage()); - e.SetEventObject(tabCtrl); - GetEventHandler()->ProcessEvent(e); - - return true; - } - else - return false; -} - -#endif // wxUSE_AUI diff --git a/wxWidgets/src/aui/descrip.mms b/wxWidgets/src/aui/descrip.mms deleted file mode 100644 index 2a34008c4a..0000000000 --- a/wxWidgets/src/aui/descrip.mms +++ /dev/null @@ -1,72 +0,0 @@ -#***************************************************************************** -# * -# Make file for VMS * -# Author : J.Jansen (joukj@hrem.nano.tudelft.nl) * -# Date : 1 September 2006 * -# * -#***************************************************************************** -.first - define wx [--.include.wx] - -.ifdef __WXMOTIF__ -CXX_DEFINE = /nowarn/define=(__WXMOTIF__=1)/name=(as_is,short)\ - /assume=(nostdnew,noglobal_array_new) -CC_DEFINE = /define=(__WXMOTIF__=1)/name=(as_is,short) -.else -.ifdef __WXGTK__ -CXX_DEFINE = /define=(__WXGTK__=1)/float=ieee/name=(as_is,short)/ieee=denorm\ - /nowarn/assume=(nostdnew,noglobal_array_new) -CC_DEFINE = /define=(__WXGTK__=1)/float=ieee/name=(as_is,short)/ieee=denorm -.else -.ifdef __WXGTK2__ -CXX_DEFINE = /define=(__WXGTK__=1,VMS_GTK2)/float=ieee/name=(as_is,short)/ieee=denorm\ - /nowarn/assume=(nostdnew,noglobal_array_new) -CC_DEFINE = /define=(__WXGTK__=1,VMS_GTK2)/float=ieee/name=(as_is,short)/ieee=denorm -.else -.ifdef __WXX11__ -CXX_DEFINE = /nowarn/define=(__WXX11__=1,__WXUNIVERSAL__==1)/float=ieee\ - /name=(as_is,short)/assume=(nostdnew,noglobal_array_new) -CC_DEFINE = /define=(__WXX11__=1,__WXUNIVERSAL__==1)/float=ieee\ - /name=(as_is,short) -.else -CXX_DEFINE = -CC_DEFINE = -.endif -.endif -.endif -.endif - -.suffixes : .cpp - -.cpp.obj : - cxx $(CXXFLAGS)$(CXX_DEFINE) $(MMS$TARGET_NAME).cpp -.c.obj : - cc $(CFLAGS)$(CC_DEFINE) $(MMS$TARGET_NAME).c - -OBJECTS = dockart.obj,floatpane.obj,framemanager.obj,auibook.obj,tabmdi.obj - -SOURCES = dockart.cpp floatpane.cpp framemanager.cpp auibook.cpp tabmdi.cpp - -all : $(SOURCES) - $(MMS)$(MMSQUALIFIERS) $(OBJECTS) -.ifdef __WXMOTIF__ - library [--.lib]libwx_motif.olb $(OBJECTS) -.else -.ifdef __WXGTK__ - library [--.lib]libwx_gtk.olb $(OBJECTS) -.else -.ifdef __WXGTK2__ - library [--.lib]libwx_gtk2.olb $(OBJECTS) -.else -.ifdef __WXX11__ - library [--.lib]libwx_x11_univ.olb $(OBJECTS) -.endif -.endif -.endif -.endif - -dockart.obj : dockart.cpp -floatpane.obj : floatpane.cpp -framemanager.obj : framemanager.cpp -auibook.obj : auibook.cpp -tabmdi.obj : tabmdi.cpp diff --git a/wxWidgets/src/aui/dockart.cpp b/wxWidgets/src/aui/dockart.cpp deleted file mode 100644 index b0989200d8..0000000000 --- a/wxWidgets/src/aui/dockart.cpp +++ /dev/null @@ -1,771 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: src/aui/dockart.cpp -// Purpose: wxaui: wx advanced user interface - docking window manager -// Author: Benjamin I. Williams -// Modified by: -// Created: 2005-05-17 -// RCS-ID: $Id: dockart.cpp 55210 2008-08-23 18:17:49Z VZ $ -// Copyright: (C) Copyright 2005-2006, Kirix Corporation, All Rights Reserved -// Licence: wxWindows Library Licence, Version 3.1 -/////////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_AUI - -#include "wx/aui/framemanager.h" -#include "wx/aui/dockart.h" - -#ifndef WX_PRECOMP - #include "wx/settings.h" - #include "wx/dcclient.h" - #include "wx/image.h" -#endif - -#ifdef __WXMAC__ -#include "wx/mac/private.h" -#include "wx/graphics.h" -#endif - -#ifdef __WXGTK__ -#include -#include "wx/gtk/win_gtk.h" -#include "wx/renderer.h" -#endif - - -// -- wxAuiDefaultDockArt class implementation -- - -// wxAuiDefaultDockArt is an art provider class which does all of the drawing for -// wxAuiManager. This allows the library caller to customize the dock art -// (probably by deriving from this class), or to completely replace all drawing -// with custom dock art (probably by writing a new stand-alone class derived -// from the wxAuiDockArt base class). The active dock art class can be set via -// wxAuiManager::SetDockArt() - - -// wxAuiBlendColour is used by wxAuiStepColour -unsigned char wxAuiBlendColour(unsigned char fg, unsigned char bg, double alpha) -{ - double result = bg + (alpha * (fg - bg)); - if (result < 0.0) - result = 0.0; - if (result > 255) - result = 255; - return (unsigned char)result; -} - -// wxAuiStepColour() it a utility function that simply darkens -// or lightens a color, based on the specified percentage -// ialpha of 0 would be completely black, 100 completely white -// an ialpha of 100 returns the same colour -wxColor wxAuiStepColour(const wxColor& c, int ialpha) -{ - if (ialpha == 100) - return c; - - unsigned char r = c.Red(), - g = c.Green(), - b = c.Blue(); - unsigned char bg; - - // ialpha is 0..200 where 0 is completely black - // and 200 is completely white and 100 is the same - // convert that to normal alpha 0.0 - 1.0 - ialpha = wxMin(ialpha, 200); - ialpha = wxMax(ialpha, 0); - double alpha = ((double)(ialpha - 100.0))/100.0; - - if (ialpha > 100) - { - // blend with white - bg = 255; - alpha = 1.0 - alpha; // 0 = transparent fg; 1 = opaque fg - } - else - { - // blend with black - bg = 0; - alpha += 1.0; // 0 = transparent fg; 1 = opaque fg - } - - r = wxAuiBlendColour(r, bg, alpha); - g = wxAuiBlendColour(g, bg, alpha); - b = wxAuiBlendColour(b, bg, alpha); - - return wxColour(r, g, b); -} - - -wxColor wxAuiLightContrastColour(const wxColour& c) -{ - int amount = 120; - - // if the color is especially dark, then - // make the contrast even lighter - if (c.Red() < 128 && c.Green() < 128 && c.Blue() < 128) - amount = 160; - - return wxAuiStepColour(c, amount); -} - -// wxAuiBitmapFromBits() is a utility function that creates a -// masked bitmap from raw bits (XBM format) -wxBitmap wxAuiBitmapFromBits(const unsigned char bits[], int w, int h, - const wxColour& color) -{ - wxImage img = wxBitmap((const char*)bits, w, h).ConvertToImage(); - img.Replace(0,0,0,123,123,123); - img.Replace(255,255,255,color.Red(),color.Green(),color.Blue()); - img.SetMaskColour(123,123,123); - return wxBitmap(img); -} - - -static void DrawGradientRectangle(wxDC& dc, - const wxRect& rect, - const wxColour& start_color, - const wxColour& end_color, - int direction) -{ - int rd, gd, bd, high = 0; - rd = end_color.Red() - start_color.Red(); - gd = end_color.Green() - start_color.Green(); - bd = end_color.Blue() - start_color.Blue(); - - if (direction == wxAUI_GRADIENT_VERTICAL) - high = rect.GetHeight()-1; - else - high = rect.GetWidth()-1; - - for (int i = 0; i <= high; ++i) - { - int r,g,b; - - - r = start_color.Red() + (high <= 0 ? 0 : (((i*rd*100)/high)/100)); - g = start_color.Green() + (high <= 0 ? 0 : (((i*gd*100)/high)/100)); - b = start_color.Blue() + (high <= 0 ? 0 : (((i*bd*100)/high)/100)); - - wxPen p(wxColor((unsigned char)r, - (unsigned char)g, - (unsigned char)b)); - dc.SetPen(p); - - if (direction == wxAUI_GRADIENT_VERTICAL) - dc.DrawLine(rect.x, rect.y+i, rect.x+rect.width, rect.y+i); - else - dc.DrawLine(rect.x+i, rect.y, rect.x+i, rect.y+rect.height); - } -} - -wxString wxAuiChopText(wxDC& dc, const wxString& text, int max_size) -{ - wxCoord x,y; - - // first check if the text fits with no problems - dc.GetTextExtent(text, &x, &y); - if (x <= max_size) - return text; - - size_t i, len = text.Length(); - size_t last_good_length = 0; - for (i = 0; i < len; ++i) - { - wxString s = text.Left(i); - s += wxT("..."); - - dc.GetTextExtent(s, &x, &y); - if (x > max_size) - break; - - last_good_length = i; - } - - wxString ret = text.Left(last_good_length); - ret += wxT("..."); - return ret; -} - -wxAuiDefaultDockArt::wxAuiDefaultDockArt() -{ -#ifdef __WXMAC__ - wxBrush toolbarbrush; - toolbarbrush.MacSetTheme( kThemeBrushToolbarBackground ); - wxColor base_colour = toolbarbrush.GetColour(); -#else - wxColor base_colour = wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE); -#endif - - // the base_colour is too pale to use as our base colour, - // so darken it a bit -- - if ((255-base_colour.Red()) + - (255-base_colour.Green()) + - (255-base_colour.Blue()) < 60) - { - base_colour = wxAuiStepColour(base_colour, 92); - } - - m_base_colour = base_colour; - wxColor darker1_colour = wxAuiStepColour(base_colour, 85); - wxColor darker2_colour = wxAuiStepColour(base_colour, 75); - wxColor darker3_colour = wxAuiStepColour(base_colour, 60); - wxColor darker4_colour = wxAuiStepColour(base_colour, 50); - wxColor darker5_colour = wxAuiStepColour(base_colour, 40); - - m_active_caption_colour = wxSystemSettings::GetColour(wxSYS_COLOUR_HIGHLIGHT); - m_active_caption_gradient_colour = wxAuiLightContrastColour(wxSystemSettings::GetColour(wxSYS_COLOUR_HIGHLIGHT)); - m_active_caption_text_colour = wxSystemSettings::GetColour(wxSYS_COLOUR_HIGHLIGHTTEXT); - m_inactive_caption_colour = darker1_colour; - m_inactive_caption_gradient_colour = wxAuiStepColour(base_colour, 97); - m_inactive_caption_text_colour = *wxBLACK; - -#ifdef __WXMAC__ - m_sash_brush = toolbarbrush; - m_background_brush = toolbarbrush; - m_gripper_brush = toolbarbrush; -#else - m_sash_brush = wxBrush(base_colour); - m_background_brush = wxBrush(base_colour); - m_gripper_brush = wxBrush(base_colour); -#endif - m_border_pen = wxPen(darker2_colour); - m_gripper_pen1 = wxPen(darker5_colour); - m_gripper_pen2 = wxPen(darker3_colour); - m_gripper_pen3 = *wxWHITE_PEN; - -#ifdef __WXMAC__ - m_caption_font = *wxSMALL_FONT; -#else - m_caption_font = wxFont(8, wxDEFAULT, wxNORMAL, wxNORMAL, FALSE); -#endif - - // some built in bitmaps -#if defined( __WXMAC__ ) - static unsigned char close_bits[]={ - 0xFF, 0xFF, 0xFF, 0xFF, 0x0F, 0xFE, 0x03, 0xF8, 0x01, 0xF0, 0x19, 0xF3, - 0xB8, 0xE3, 0xF0, 0xE1, 0xE0, 0xE0, 0xF0, 0xE1, 0xB8, 0xE3, 0x19, 0xF3, - 0x01, 0xF0, 0x03, 0xF8, 0x0F, 0xFE, 0xFF, 0xFF }; -#elif defined( __WXGTK__) - static unsigned char close_bits[]={ - 0xff, 0xff, 0xff, 0xff, 0x07, 0xf0, 0xfb, 0xef, 0xdb, 0xed, 0x8b, 0xe8, - 0x1b, 0xec, 0x3b, 0xee, 0x1b, 0xec, 0x8b, 0xe8, 0xdb, 0xed, 0xfb, 0xef, - 0x07, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }; -#else - static unsigned char close_bits[]={ - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe7, 0xf3, 0xcf, 0xf9, - 0x9f, 0xfc, 0x3f, 0xfe, 0x3f, 0xfe, 0x9f, 0xfc, 0xcf, 0xf9, 0xe7, 0xf3, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff}; -#endif - - static unsigned char maximize_bits[] = { - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x07, 0xf0, 0xf7, 0xf7, 0x07, 0xf0, - 0xf7, 0xf7, 0xf7, 0xf7, 0xf7, 0xf7, 0xf7, 0xf7, 0xf7, 0xf7, 0x07, 0xf0, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff}; - - static unsigned char restore_bits[]={ - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1f, 0xf0, 0x1f, 0xf0, 0xdf, 0xf7, - 0x07, 0xf4, 0x07, 0xf4, 0xf7, 0xf5, 0xf7, 0xf1, 0xf7, 0xfd, 0xf7, 0xfd, - 0x07, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff}; - - static unsigned char pin_bits[]={ - 0xff,0xff,0xff,0xff,0xff,0xff,0x1f,0xfc,0xdf,0xfc,0xdf,0xfc, - 0xdf,0xfc,0xdf,0xfc,0xdf,0xfc,0x0f,0xf8,0x7f,0xff,0x7f,0xff, - 0x7f,0xff,0xff,0xff,0xff,0xff,0xff,0xff}; - -#ifdef __WXMAC__ - m_inactive_close_bitmap = wxAuiBitmapFromBits(close_bits, 16, 16, *wxWHITE); - m_active_close_bitmap = wxAuiBitmapFromBits(close_bits, 16, 16, *wxWHITE ); -#else - m_inactive_close_bitmap = wxAuiBitmapFromBits(close_bits, 16, 16, m_inactive_caption_text_colour); - m_active_close_bitmap = wxAuiBitmapFromBits(close_bits, 16, 16, m_active_caption_text_colour); -#endif - -#ifdef __WXMAC__ - m_inactive_maximize_bitmap = wxAuiBitmapFromBits(maximize_bits, 16, 16, *wxWHITE); - m_active_maximize_bitmap = wxAuiBitmapFromBits(maximize_bits, 16, 16, *wxWHITE ); -#else - m_inactive_maximize_bitmap = wxAuiBitmapFromBits(maximize_bits, 16, 16, m_inactive_caption_text_colour); - m_active_maximize_bitmap = wxAuiBitmapFromBits(maximize_bits, 16, 16, m_active_caption_text_colour); -#endif - -#ifdef __WXMAC__ - m_inactive_restore_bitmap = wxAuiBitmapFromBits(restore_bits, 16, 16, *wxWHITE); - m_active_restore_bitmap = wxAuiBitmapFromBits(restore_bits, 16, 16, *wxWHITE ); -#else - m_inactive_restore_bitmap = wxAuiBitmapFromBits(restore_bits, 16, 16, m_inactive_caption_text_colour); - m_active_restore_bitmap = wxAuiBitmapFromBits(restore_bits, 16, 16, m_active_caption_text_colour); -#endif - - m_inactive_pin_bitmap = wxAuiBitmapFromBits(pin_bits, 16, 16, m_inactive_caption_text_colour); - m_active_pin_bitmap = wxAuiBitmapFromBits(pin_bits, 16, 16, m_active_caption_text_colour); - - // default metric values -#if defined(__WXMAC__) - SInt32 height; - GetThemeMetric( kThemeMetricSmallPaneSplitterHeight , &height ); - m_sash_size = height; -#elif defined(__WXGTK__) - m_sash_size = wxRendererNative::Get().GetSplitterParams(NULL).widthSash; -#else - m_sash_size = 4; -#endif - m_caption_size = 17; - m_border_size = 1; - m_button_size = 14; - m_gripper_size = 9; - m_gradient_type = wxAUI_GRADIENT_VERTICAL; -} - -int wxAuiDefaultDockArt::GetMetric(int id) -{ - switch (id) - { - case wxAUI_DOCKART_SASH_SIZE: return m_sash_size; - case wxAUI_DOCKART_CAPTION_SIZE: return m_caption_size; - case wxAUI_DOCKART_GRIPPER_SIZE: return m_gripper_size; - case wxAUI_DOCKART_PANE_BORDER_SIZE: return m_border_size; - case wxAUI_DOCKART_PANE_BUTTON_SIZE: return m_button_size; - case wxAUI_DOCKART_GRADIENT_TYPE: return m_gradient_type; - default: wxFAIL_MSG(wxT("Invalid Metric Ordinal")); break; - } - - return 0; -} - -void wxAuiDefaultDockArt::SetMetric(int id, int new_val) -{ - switch (id) - { - case wxAUI_DOCKART_SASH_SIZE: m_sash_size = new_val; break; - case wxAUI_DOCKART_CAPTION_SIZE: m_caption_size = new_val; break; - case wxAUI_DOCKART_GRIPPER_SIZE: m_gripper_size = new_val; break; - case wxAUI_DOCKART_PANE_BORDER_SIZE: m_border_size = new_val; break; - case wxAUI_DOCKART_PANE_BUTTON_SIZE: m_button_size = new_val; break; - case wxAUI_DOCKART_GRADIENT_TYPE: m_gradient_type = new_val; break; - default: wxFAIL_MSG(wxT("Invalid Metric Ordinal")); break; - } -} - -wxColour wxAuiDefaultDockArt::GetColour(int id) -{ - switch (id) - { - case wxAUI_DOCKART_BACKGROUND_COLOUR: return m_background_brush.GetColour(); - case wxAUI_DOCKART_SASH_COLOUR: return m_sash_brush.GetColour(); - case wxAUI_DOCKART_INACTIVE_CAPTION_COLOUR: return m_inactive_caption_colour; - case wxAUI_DOCKART_INACTIVE_CAPTION_GRADIENT_COLOUR: return m_inactive_caption_gradient_colour; - case wxAUI_DOCKART_INACTIVE_CAPTION_TEXT_COLOUR: return m_inactive_caption_text_colour; - case wxAUI_DOCKART_ACTIVE_CAPTION_COLOUR: return m_active_caption_colour; - case wxAUI_DOCKART_ACTIVE_CAPTION_GRADIENT_COLOUR: return m_active_caption_gradient_colour; - case wxAUI_DOCKART_ACTIVE_CAPTION_TEXT_COLOUR: return m_active_caption_text_colour; - case wxAUI_DOCKART_BORDER_COLOUR: return m_border_pen.GetColour(); - case wxAUI_DOCKART_GRIPPER_COLOUR: return m_gripper_brush.GetColour(); - default: wxFAIL_MSG(wxT("Invalid Metric Ordinal")); break; - } - - return wxColour(); -} - -void wxAuiDefaultDockArt::SetColour(int id, const wxColor& colour) -{ - switch (id) - { - case wxAUI_DOCKART_BACKGROUND_COLOUR: m_background_brush.SetColour(colour); break; - case wxAUI_DOCKART_SASH_COLOUR: m_sash_brush.SetColour(colour); break; - case wxAUI_DOCKART_INACTIVE_CAPTION_COLOUR: m_inactive_caption_colour = colour; break; - case wxAUI_DOCKART_INACTIVE_CAPTION_GRADIENT_COLOUR: m_inactive_caption_gradient_colour = colour; break; - case wxAUI_DOCKART_INACTIVE_CAPTION_TEXT_COLOUR: m_inactive_caption_text_colour = colour; break; - case wxAUI_DOCKART_ACTIVE_CAPTION_COLOUR: m_active_caption_colour = colour; break; - case wxAUI_DOCKART_ACTIVE_CAPTION_GRADIENT_COLOUR: m_active_caption_gradient_colour = colour; break; - case wxAUI_DOCKART_ACTIVE_CAPTION_TEXT_COLOUR: m_active_caption_text_colour = colour; break; - case wxAUI_DOCKART_BORDER_COLOUR: m_border_pen.SetColour(colour); break; - case wxAUI_DOCKART_GRIPPER_COLOUR: - m_gripper_brush.SetColour(colour); - m_gripper_pen1.SetColour(wxAuiStepColour(colour, 40)); - m_gripper_pen2.SetColour(wxAuiStepColour(colour, 60)); - break; - default: wxFAIL_MSG(wxT("Invalid Metric Ordinal")); break; - } -} - -void wxAuiDefaultDockArt::SetFont(int id, const wxFont& font) -{ - if (id == wxAUI_DOCKART_CAPTION_FONT) - m_caption_font = font; -} - -wxFont wxAuiDefaultDockArt::GetFont(int id) -{ - if (id == wxAUI_DOCKART_CAPTION_FONT) - return m_caption_font; - return wxNullFont; -} - -void wxAuiDefaultDockArt::DrawSash(wxDC& dc, wxWindow *window, int orientation, const wxRect& rect) -{ -#if defined(__WXMAC__) - HIRect splitterRect = CGRectMake( rect.x , rect.y , rect.width , rect.height ); - CGContextRef cgContext ; -#if wxMAC_USE_CORE_GRAPHICS - cgContext = (CGContextRef) dc.GetGraphicsContext()->GetNativeContext() ; -#else - Rect bounds ; - GetPortBounds( (CGrafPtr) dc.m_macPort , &bounds ) ; - QDBeginCGContext( (CGrafPtr) dc.m_macPort , &cgContext ) ; - CGContextTranslateCTM( cgContext , 0 , bounds.bottom - bounds.top ) ; - CGContextScaleCTM( cgContext , 1 , -1 ) ; - - if ( window ) - { - wxPoint origin = window->GetClientAreaOrigin(); - int x, y; - x = origin.x; - y = origin.y; - window->MacWindowToRootWindow( &x , &y ); - CGContextTranslateCTM( cgContext, x, y); - } -#endif - - HIThemeSplitterDrawInfo drawInfo ; - drawInfo.version = 0 ; - drawInfo.state = kThemeStateActive ; - drawInfo.adornment = kHIThemeSplitterAdornmentNone ; - HIThemeDrawPaneSplitter( &splitterRect , &drawInfo , cgContext , kHIThemeOrientationNormal ) ; - -#if wxMAC_USE_CORE_GRAPHICS -#else - QDEndCGContext( (CGrafPtr) dc.m_macPort , &cgContext ) ; -#endif - -#elif defined(__WXGTK__) - // clear out the rectangle first - dc.SetPen(*wxTRANSPARENT_PEN); - dc.SetBrush(m_sash_brush); - dc.DrawRectangle(rect.x, rect.y, rect.width, rect.height); - - GdkRectangle gdk_rect; - if (orientation == wxVERTICAL ) - { - gdk_rect.x = rect.x; - gdk_rect.y = rect.y; - gdk_rect.width = m_sash_size; - gdk_rect.height = rect.height; - } - else - { - gdk_rect.x = rect.x; - gdk_rect.y = rect.y; - gdk_rect.width = rect.width; - gdk_rect.height = m_sash_size; - } - - if (!window) return; - if (!window->m_wxwindow) return; - if (!GTK_PIZZA(window->m_wxwindow)->bin_window) return; - - gtk_paint_handle - ( - window->m_wxwindow->style, - GTK_PIZZA(window->m_wxwindow)->bin_window, - // flags & wxCONTROL_CURRENT ? GTK_STATE_PRELIGHT : GTK_STATE_NORMAL, - GTK_STATE_NORMAL, - GTK_SHADOW_NONE, - NULL /* no clipping */, - window->m_wxwindow, - "paned", - rect.x, - rect.y, - rect.width, - rect.height, - (orientation == wxVERTICAL) ? GTK_ORIENTATION_VERTICAL : GTK_ORIENTATION_HORIZONTAL - ); - -#else - wxUnusedVar(window); - wxUnusedVar(orientation); - dc.SetPen(*wxTRANSPARENT_PEN); - dc.SetBrush(m_sash_brush); - dc.DrawRectangle(rect.x, rect.y, rect.width, rect.height); -#endif -} - - -void wxAuiDefaultDockArt::DrawBackground(wxDC& dc, wxWindow *WXUNUSED(window), int, const wxRect& rect) -{ - dc.SetPen(*wxTRANSPARENT_PEN); -#ifdef __WXMAC__ - // we have to clear first, otherwise we are drawing a light striped pattern - // over an already darker striped background - dc.SetBrush(*wxWHITE_BRUSH) ; - dc.DrawRectangle(rect.x, rect.y, rect.width, rect.height); -#endif - dc.SetBrush(m_background_brush); - dc.DrawRectangle(rect.x, rect.y, rect.width, rect.height); -} - -void wxAuiDefaultDockArt::DrawBorder(wxDC& dc, wxWindow *WXUNUSED(window), const wxRect& _rect, - wxAuiPaneInfo& pane) -{ - dc.SetPen(m_border_pen); - dc.SetBrush(*wxTRANSPARENT_BRUSH); - - wxRect rect = _rect; - int i, border_width = GetMetric(wxAUI_DOCKART_PANE_BORDER_SIZE); - - if (pane.IsToolbar()) - { - for (i = 0; i < border_width; ++i) - { - dc.SetPen(*wxWHITE_PEN); - dc.DrawLine(rect.x, rect.y, rect.x+rect.width, rect.y); - dc.DrawLine(rect.x, rect.y, rect.x, rect.y+rect.height); - dc.SetPen(m_border_pen); - dc.DrawLine(rect.x, rect.y+rect.height-1, - rect.x+rect.width, rect.y+rect.height-1); - dc.DrawLine(rect.x+rect.width-1, rect.y, - rect.x+rect.width-1, rect.y+rect.height); - rect.Deflate(1); - } - } - else - { - for (i = 0; i < border_width; ++i) - { - dc.DrawRectangle(rect.x, rect.y, rect.width, rect.height); - rect.Deflate(1); - } - } -} - - -void wxAuiDefaultDockArt::DrawCaptionBackground(wxDC& dc, const wxRect& rect, bool active) -{ - if (m_gradient_type == wxAUI_GRADIENT_NONE) - { - if (active) - dc.SetBrush(wxBrush(m_active_caption_colour)); - else - dc.SetBrush(wxBrush(m_inactive_caption_colour)); - - dc.DrawRectangle(rect.x, rect.y, rect.width, rect.height); - } - else - { - if (active) - { - // on mac the gradients are expected to become darker from the top -#ifdef __WXMAC__ - DrawGradientRectangle(dc, rect, - m_active_caption_colour, - m_active_caption_gradient_colour, - m_gradient_type); -#else - // on other platforms, active gradients become lighter at the top - DrawGradientRectangle(dc, rect, - m_active_caption_gradient_colour, - m_active_caption_colour, - m_gradient_type); -#endif - } - else - { -#ifdef __WXMAC__ - // on mac the gradients are expected to become darker from the top - DrawGradientRectangle(dc, rect, - m_inactive_caption_gradient_colour, - m_inactive_caption_colour, - m_gradient_type); -#else - // on other platforms, inactive gradients become lighter at the bottom - DrawGradientRectangle(dc, rect, - m_inactive_caption_colour, - m_inactive_caption_gradient_colour, - m_gradient_type); -#endif - } - } -} - - -void wxAuiDefaultDockArt::DrawCaption(wxDC& dc, wxWindow *WXUNUSED(window), - const wxString& text, - const wxRect& rect, - wxAuiPaneInfo& pane) -{ - dc.SetPen(*wxTRANSPARENT_PEN); - dc.SetFont(m_caption_font); - - DrawCaptionBackground(dc, rect, - (pane.state & wxAuiPaneInfo::optionActive)?true:false); - - if (pane.state & wxAuiPaneInfo::optionActive) - dc.SetTextForeground(m_active_caption_text_colour); - else - dc.SetTextForeground(m_inactive_caption_text_colour); - - - wxCoord w,h; - dc.GetTextExtent(wxT("ABCDEFHXfgkj"), &w, &h); - - wxRect clip_rect = rect; - clip_rect.width -= 3; // text offset - clip_rect.width -= 2; // button padding - if (pane.HasCloseButton()) - clip_rect.width -= m_button_size; - if (pane.HasPinButton()) - clip_rect.width -= m_button_size; - if (pane.HasMaximizeButton()) - clip_rect.width -= m_button_size; - - wxString draw_text = wxAuiChopText(dc, text, clip_rect.width); - - dc.SetClippingRegion(clip_rect); - dc.DrawText(draw_text, rect.x+3, rect.y+(rect.height/2)-(h/2)-1); - dc.DestroyClippingRegion(); -} - -void wxAuiDefaultDockArt::DrawGripper(wxDC& dc, wxWindow *WXUNUSED(window), - const wxRect& rect, - wxAuiPaneInfo& pane) -{ - dc.SetPen(*wxTRANSPARENT_PEN); - dc.SetBrush(m_gripper_brush); - - dc.DrawRectangle(rect.x, rect.y, rect.width,rect.height); - - if (!pane.HasGripperTop()) - { - int y = 5; - while (1) - { - dc.SetPen(m_gripper_pen1); - dc.DrawPoint(rect.x+3, rect.y+y); - dc.SetPen(m_gripper_pen2); - dc.DrawPoint(rect.x+3, rect.y+y+1); - dc.DrawPoint(rect.x+4, rect.y+y); - dc.SetPen(m_gripper_pen3); - dc.DrawPoint(rect.x+5, rect.y+y+1); - dc.DrawPoint(rect.x+5, rect.y+y+2); - dc.DrawPoint(rect.x+4, rect.y+y+2); - - y += 4; - if (y > rect.GetHeight()-5) - break; - } - } - else - { - int x = 5; - while (1) - { - dc.SetPen(m_gripper_pen1); - dc.DrawPoint(rect.x+x, rect.y+3); - dc.SetPen(m_gripper_pen2); - dc.DrawPoint(rect.x+x+1, rect.y+3); - dc.DrawPoint(rect.x+x, rect.y+4); - dc.SetPen(m_gripper_pen3); - dc.DrawPoint(rect.x+x+1, rect.y+5); - dc.DrawPoint(rect.x+x+2, rect.y+5); - dc.DrawPoint(rect.x+x+2, rect.y+4); - - x += 4; - if (x > rect.GetWidth()-5) - break; - } - } -} - -void wxAuiDefaultDockArt::DrawPaneButton(wxDC& dc, wxWindow *WXUNUSED(window), - int button, - int button_state, - const wxRect& _rect, - wxAuiPaneInfo& pane) -{ - wxBitmap bmp; - if (!(&pane)) - return; - switch (button) - { - default: - case wxAUI_BUTTON_CLOSE: - if (pane.state & wxAuiPaneInfo::optionActive) - bmp = m_active_close_bitmap; - else - bmp = m_inactive_close_bitmap; - break; - case wxAUI_BUTTON_PIN: - if (pane.state & wxAuiPaneInfo::optionActive) - bmp = m_active_pin_bitmap; - else - bmp = m_inactive_pin_bitmap; - break; - case wxAUI_BUTTON_MAXIMIZE_RESTORE: - if (pane.IsMaximized()) - { - if (pane.state & wxAuiPaneInfo::optionActive) - bmp = m_active_restore_bitmap; - else - bmp = m_inactive_restore_bitmap; - } - else - { - if (pane.state & wxAuiPaneInfo::optionActive) - bmp = m_active_maximize_bitmap; - else - bmp = m_inactive_maximize_bitmap; - } - break; - } - - - wxRect rect = _rect; - - int old_y = rect.y; - rect.y = rect.y + (rect.height/2) - (bmp.GetHeight()/2); - rect.height = old_y + rect.height - rect.y - 1; - - - if (button_state == wxAUI_BUTTON_STATE_PRESSED) - { - rect.x++; - rect.y++; - } - - if (button_state == wxAUI_BUTTON_STATE_HOVER || - button_state == wxAUI_BUTTON_STATE_PRESSED) - { - if (pane.state & wxAuiPaneInfo::optionActive) - { - dc.SetBrush(wxBrush(wxAuiStepColour(m_active_caption_colour, 120))); - dc.SetPen(wxPen(wxAuiStepColour(m_active_caption_colour, 70))); - } - else - { - dc.SetBrush(wxBrush(wxAuiStepColour(m_inactive_caption_colour, 120))); - dc.SetPen(wxPen(wxAuiStepColour(m_inactive_caption_colour, 70))); - } - - // draw the background behind the button - dc.DrawRectangle(rect.x, rect.y, 15, 15); - } - - - // draw the button itself - dc.DrawBitmap(bmp, rect.x, rect.y, true); -} - - -#endif // wxUSE_AUI diff --git a/wxWidgets/src/aui/floatpane.cpp b/wxWidgets/src/aui/floatpane.cpp deleted file mode 100644 index f8827e2a01..0000000000 --- a/wxWidgets/src/aui/floatpane.cpp +++ /dev/null @@ -1,323 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: src/aui/floatpane.cpp -// Purpose: wxaui: wx advanced user interface - docking window manager -// Author: Benjamin I. Williams -// Modified by: -// Created: 2005-05-17 -// RCS-ID: $Id: floatpane.cpp 54904 2008-08-01 16:07:46Z BIW $ -// Copyright: (C) Copyright 2005-2006, Kirix Corporation, All Rights Reserved -// Licence: wxWindows Library Licence, Version 3.1 -/////////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_AUI - -#include "wx/aui/framemanager.h" -#include "wx/aui/floatpane.h" -#include "wx/aui/dockart.h" - -#ifndef WX_PRECOMP -#endif - -#ifdef __WXMSW__ -#include "wx/msw/private.h" -#endif - -IMPLEMENT_CLASS(wxAuiFloatingFrame, wxAuiFloatingFrameBaseClass) - -wxAuiFloatingFrame::wxAuiFloatingFrame(wxWindow* parent, - wxAuiManager* owner_mgr, - const wxAuiPaneInfo& pane, - wxWindowID id /*= wxID_ANY*/, - long style /*=wxRESIZE_BORDER | wxSYSTEM_MENU | wxCAPTION | - wxFRAME_NO_TASKBAR | wxFRAME_FLOAT_ON_PARENT | - wxCLIP_CHILDREN - */) - : wxAuiFloatingFrameBaseClass(parent, id, wxEmptyString, - pane.floating_pos, pane.floating_size, - style | - (pane.HasCloseButton()?wxCLOSE_BOX:0) | - (pane.HasMaximizeButton()?wxMAXIMIZE_BOX:0) | - (pane.IsFixed()?0:wxRESIZE_BORDER) - ) -{ - m_owner_mgr = owner_mgr; - m_moving = false; - m_mgr.SetManagedWindow(this); - m_solid_drag = true; - - // find out if the system supports solid window drag. - // on non-msw systems, this is assumed to be the case -#ifdef __WXMSW__ - BOOL b = TRUE; - SystemParametersInfo(38 /*SPI_GETDRAGFULLWINDOWS*/, 0, &b, 0); - m_solid_drag = b ? true : false; -#endif - - SetExtraStyle(wxWS_EX_PROCESS_IDLE); -} - -wxAuiFloatingFrame::~wxAuiFloatingFrame() -{ - // if we do not do this, then we can crash... - if(m_owner_mgr && m_owner_mgr->m_action_window == this) - { - m_owner_mgr->m_action_window = NULL; - } - m_mgr.UnInit(); -} - -void wxAuiFloatingFrame::SetPaneWindow(const wxAuiPaneInfo& pane) -{ - m_pane_window = pane.window; - m_pane_window->Reparent(this); - - wxAuiPaneInfo contained_pane = pane; - contained_pane.Dock().Center().Show(). - CaptionVisible(false). - PaneBorder(false). - Layer(0).Row(0).Position(0); - - // Carry over the minimum size - wxSize pane_min_size = pane.window->GetMinSize(); - - // if the frame window's max size is greater than the min size - // then set the max size to the min size as well - wxSize cur_max_size = GetMaxSize(); - if (cur_max_size.IsFullySpecified() && - (cur_max_size.x < pane.min_size.x || - cur_max_size.y < pane.min_size.y) - ) - { - SetMaxSize(pane_min_size); - } - - SetMinSize(pane.window->GetMinSize()); - - m_mgr.AddPane(m_pane_window, contained_pane); - m_mgr.Update(); - - if (pane.min_size.IsFullySpecified()) - { - // because SetSizeHints() calls Fit() too (which sets the window - // size to its minimum allowed), we keep the size before calling - // SetSizeHints() and reset it afterwards... - wxSize tmp = GetSize(); - GetSizer()->SetSizeHints(this); - SetSize(tmp); - } - - SetTitle(pane.caption); - - if (pane.floating_size != wxDefaultSize) - { - SetSize(pane.floating_size); - } - else - { - wxSize size = pane.best_size; - if (size == wxDefaultSize) - size = pane.min_size; - if (size == wxDefaultSize) - size = m_pane_window->GetSize(); - if (pane.HasGripper()) - { - if (pane.HasGripperTop()) - size.y += m_owner_mgr->m_art->GetMetric(wxAUI_DOCKART_GRIPPER_SIZE); - else - size.x += m_owner_mgr->m_art->GetMetric(wxAUI_DOCKART_GRIPPER_SIZE); - } - - SetClientSize(size); - } - - if (pane.IsFixed()) - { - SetWindowStyleFlag(GetWindowStyleFlag() & ~wxRESIZE_BORDER); - } -} - -wxAuiManager* wxAuiFloatingFrame::GetOwnerManager() const -{ - return m_owner_mgr; -} - - -void wxAuiFloatingFrame::OnSize(wxSizeEvent& event) -{ - m_owner_mgr->OnFloatingPaneResized(m_pane_window, event.GetSize()); -} - -void wxAuiFloatingFrame::OnClose(wxCloseEvent& evt) -{ - m_owner_mgr->OnFloatingPaneClosed(m_pane_window, evt); - if (!evt.GetVeto()) { - m_mgr.DetachPane(m_pane_window); - Destroy(); - } -} - -void wxAuiFloatingFrame::OnMoveEvent(wxMoveEvent& event) -{ - if (!m_solid_drag) - { - // systems without solid window dragging need to be - // handled slightly differently, due to the lack of - // the constant stream of EVT_MOVING events - if (!isMouseDown()) - return; - OnMoveStart(); - OnMoving(event.GetRect(), wxNORTH); - m_moving = true; - return; - } - - - wxRect win_rect = GetRect(); - - if (win_rect == m_last_rect) - return; - - // skip the first move event - if (m_last_rect.IsEmpty()) - { - m_last_rect = win_rect; - return; - } - - // skip if moving too fast to avoid massive redraws and - // jumping hint windows - if ((abs(win_rect.x - m_last_rect.x) > 3) || - (abs(win_rect.y - m_last_rect.y) > 3)) - { - m_last3_rect = m_last2_rect; - m_last2_rect = m_last_rect; - m_last_rect = win_rect; - return; - } - - // prevent frame redocking during resize - if (m_last_rect.GetSize() != win_rect.GetSize()) - { - m_last3_rect = m_last2_rect; - m_last2_rect = m_last_rect; - m_last_rect = win_rect; - return; - } - - wxDirection dir = wxALL; - - int horiz_dist = abs(win_rect.x - m_last3_rect.x); - int vert_dist = abs(win_rect.y - m_last3_rect.y); - - if (vert_dist >= horiz_dist) - { - if (win_rect.y < m_last3_rect.y) - dir = wxNORTH; - else - dir = wxSOUTH; - } - else - { - if (win_rect.x < m_last3_rect.x) - dir = wxWEST; - else - dir = wxEAST; - } - - m_last3_rect = m_last2_rect; - m_last2_rect = m_last_rect; - m_last_rect = win_rect; - - if (!isMouseDown()) - return; - - if (!m_moving) - { - OnMoveStart(); - m_moving = true; - } - - if (m_last3_rect.IsEmpty()) - return; - - OnMoving(event.GetRect(), dir); -} - -void wxAuiFloatingFrame::OnIdle(wxIdleEvent& event) -{ - if (m_moving) - { - if (!isMouseDown()) - { - m_moving = false; - OnMoveFinished(); - } - else - { - event.RequestMore(); - } - } -} - -void wxAuiFloatingFrame::OnMoveStart() -{ - // notify the owner manager that the pane has started to move - m_owner_mgr->OnFloatingPaneMoveStart(m_pane_window); -} - -void wxAuiFloatingFrame::OnMoving(const wxRect& WXUNUSED(window_rect), wxDirection dir) -{ - // notify the owner manager that the pane is moving - m_owner_mgr->OnFloatingPaneMoving(m_pane_window, dir); - m_lastDirection = dir; -} - -void wxAuiFloatingFrame::OnMoveFinished() -{ - // notify the owner manager that the pane has finished moving - m_owner_mgr->OnFloatingPaneMoved(m_pane_window, m_lastDirection); -} - -void wxAuiFloatingFrame::OnActivate(wxActivateEvent& event) -{ - if (event.GetActive()) - { - m_owner_mgr->OnFloatingPaneActivated(m_pane_window); - } -} - -// utility function which determines the state of the mouse button -// (independant of having a wxMouseEvent handy) - utimately a better -// mechanism for this should be found (possibly by adding the -// functionality to wxWidgets itself) -bool wxAuiFloatingFrame::isMouseDown() -{ - return wxGetMouseState().LeftDown(); -} - - -BEGIN_EVENT_TABLE(wxAuiFloatingFrame, wxAuiFloatingFrameBaseClass) - EVT_SIZE(wxAuiFloatingFrame::OnSize) - EVT_MOVE(wxAuiFloatingFrame::OnMoveEvent) - EVT_MOVING(wxAuiFloatingFrame::OnMoveEvent) - EVT_CLOSE(wxAuiFloatingFrame::OnClose) - EVT_IDLE(wxAuiFloatingFrame::OnIdle) - EVT_ACTIVATE(wxAuiFloatingFrame::OnActivate) -END_EVENT_TABLE() - - -#endif // wxUSE_AUI diff --git a/wxWidgets/src/aui/framemanager.cpp b/wxWidgets/src/aui/framemanager.cpp deleted file mode 100644 index d3f71f085b..0000000000 --- a/wxWidgets/src/aui/framemanager.cpp +++ /dev/null @@ -1,4683 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: src/aui/framemanager.cpp -// Purpose: wxaui: wx advanced user interface - docking window manager -// Author: Benjamin I. Williams -// Modified by: -// Created: 2005-05-17 -// RCS-ID: $Id: framemanager.cpp 66980 2011-02-20 10:26:32Z TIK $ -// Copyright: (C) Copyright 2005-2006, Kirix Corporation, All Rights Reserved -// Licence: wxWindows Library Licence, Version 3.1 -/////////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_AUI - -#include "wx/aui/framemanager.h" -#include "wx/aui/dockart.h" -#include "wx/aui/floatpane.h" -#include "wx/aui/tabmdi.h" -#include "wx/aui/auibar.h" - -#ifndef WX_PRECOMP - #include "wx/panel.h" - #include "wx/settings.h" - #include "wx/app.h" - #include "wx/dcclient.h" - #include "wx/dcscreen.h" - #include "wx/toolbar.h" - #include "wx/mdi.h" - #include "wx/image.h" - #include "wx/statusbr.h" -#endif - -WX_CHECK_BUILD_OPTIONS("wxAUI") - -#include "wx/arrimpl.cpp" -WX_DECLARE_OBJARRAY(wxRect, wxAuiRectArray); -WX_DEFINE_OBJARRAY(wxAuiRectArray) -WX_DEFINE_OBJARRAY(wxAuiDockUIPartArray) -WX_DEFINE_OBJARRAY(wxAuiDockInfoArray) -WX_DEFINE_OBJARRAY(wxAuiPaneButtonArray) -WX_DEFINE_OBJARRAY(wxAuiPaneInfoArray) - -wxAuiPaneInfo wxAuiNullPaneInfo; -wxAuiDockInfo wxAuiNullDockInfo; -DEFINE_EVENT_TYPE(wxEVT_AUI_PANE_BUTTON) -DEFINE_EVENT_TYPE(wxEVT_AUI_PANE_CLOSE) -DEFINE_EVENT_TYPE(wxEVT_AUI_PANE_MAXIMIZE) -DEFINE_EVENT_TYPE(wxEVT_AUI_PANE_RESTORE) -DEFINE_EVENT_TYPE(wxEVT_AUI_RENDER) -DEFINE_EVENT_TYPE(wxEVT_AUI_FIND_MANAGER) - -#ifdef __WXMAC__ - // a few defines to avoid nameclashes - #define __MAC_OS_X_MEMORY_MANAGER_CLEAN__ 1 - #define __AIFF__ - #include "wx/mac/private.h" -#endif - -#ifdef __WXMSW__ - #include "wx/msw/wrapwin.h" - #include "wx/msw/private.h" -#endif - -IMPLEMENT_DYNAMIC_CLASS(wxAuiManagerEvent, wxEvent) -IMPLEMENT_CLASS(wxAuiManager, wxEvtHandler) - - -const int auiToolBarLayer = 10; - -#ifndef __WXGTK20__ - -class wxPseudoTransparentFrame : public wxFrame -{ -public: - wxPseudoTransparentFrame(wxWindow* parent = NULL, - wxWindowID id = wxID_ANY, - const wxString& title = wxEmptyString, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = wxDEFAULT_FRAME_STYLE, - const wxString &name = wxT("frame")) - : wxFrame(parent, id, title, pos, size, style | wxFRAME_SHAPED, name) - { - SetBackgroundStyle(wxBG_STYLE_CUSTOM); - m_Amount=0; - m_MaxWidth=0; - m_MaxHeight=0; - m_lastWidth=0; - m_lastHeight=0; -#ifdef __WXGTK__ - m_CanSetShape = false; // have to wait for window create event on GTK -#else - m_CanSetShape = true; -#endif - m_Region = wxRegion(0, 0, 0, 0); - SetTransparent(0); - } - - virtual bool SetTransparent(wxByte alpha) - { - if (m_CanSetShape) - { - int w=100; // some defaults - int h=100; - GetClientSize(&w, &h); - - m_MaxWidth = w; - m_MaxHeight = h; - m_Amount = alpha; - m_Region.Clear(); -// m_Region.Union(0, 0, 1, m_MaxWidth); - if (m_Amount) - { - for (int y=0; ywindow, region.GetRegion(), 0, 0); -} - - -class wxPseudoTransparentFrame: public wxFrame -{ -public: - wxPseudoTransparentFrame(wxWindow* parent = NULL, - wxWindowID id = wxID_ANY, - const wxString& title = wxEmptyString, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = wxDEFAULT_FRAME_STYLE, - const wxString &name = wxT("frame")) - { - if (!Create( parent, id, title, pos, size, style, name )) - return; - - m_title = title; - - m_widget = gtk_window_new( GTK_WINDOW_POPUP ); - - g_signal_connect( m_widget, "realize", - G_CALLBACK (gtk_pseudo_window_realized_callback), this ); - - GdkColor col; - col.red = 128 * 256; - col.green = 192 * 256; - col.blue = 255 * 256; - gtk_widget_modify_bg( m_widget, GTK_STATE_NORMAL, &col ); - } - - bool SetTransparent(wxByte alpha) - { - return true; - } - -private: - DECLARE_DYNAMIC_CLASS(wxPseudoTransparentFrame) -}; - -IMPLEMENT_DYNAMIC_CLASS(wxPseudoTransparentFrame, wxFrame) - -#endif - // __WXGTK20__ - - -// -- static utility functions -- - -static wxBitmap wxPaneCreateStippleBitmap() -{ - unsigned char data[] = { 0,0,0,192,192,192, 192,192,192,0,0,0 }; - wxImage img(2,2,data,true); - return wxBitmap(img); -} - -static void DrawResizeHint(wxDC& dc, const wxRect& rect) -{ - wxBitmap stipple = wxPaneCreateStippleBitmap(); - wxBrush brush(stipple); - dc.SetBrush(brush); - -#ifdef __WXMSW__ - PatBlt(GetHdcOf(dc), rect.GetX(), rect.GetY(), rect.GetWidth(), rect.GetHeight(), PATINVERT); -#else - dc.SetPen(*wxTRANSPARENT_PEN); - - dc.SetLogicalFunction(wxXOR); - dc.DrawRectangle(rect); -#endif -} - - - -// CopyDocksAndPanes() - this utility function creates copies of -// the dock and pane info. wxAuiDockInfo's usually contain pointers -// to wxAuiPaneInfo classes, thus this function is necessary to reliably -// reconstruct that relationship in the new dock info and pane info arrays - -static void CopyDocksAndPanes(wxAuiDockInfoArray& dest_docks, - wxAuiPaneInfoArray& dest_panes, - const wxAuiDockInfoArray& src_docks, - const wxAuiPaneInfoArray& src_panes) -{ - dest_docks = src_docks; - dest_panes = src_panes; - int i, j, k, dock_count, pc1, pc2; - for (i = 0, dock_count = dest_docks.GetCount(); i < dock_count; ++i) - { - wxAuiDockInfo& dock = dest_docks.Item(i); - for (j = 0, pc1 = dock.panes.GetCount(); j < pc1; ++j) - for (k = 0, pc2 = src_panes.GetCount(); k < pc2; ++k) - if (dock.panes.Item(j) == &src_panes.Item(k)) - dock.panes.Item(j) = &dest_panes.Item(k); - } -} - -// GetMaxLayer() is an internal function which returns -// the highest layer inside the specified dock -static int GetMaxLayer(const wxAuiDockInfoArray& docks, - int dock_direction) -{ - int i, dock_count, max_layer = 0; - for (i = 0, dock_count = docks.GetCount(); i < dock_count; ++i) - { - wxAuiDockInfo& dock = docks.Item(i); - if (dock.dock_direction == dock_direction && - dock.dock_layer > max_layer && !dock.fixed) - max_layer = dock.dock_layer; - } - return max_layer; -} - - -// GetMaxRow() is an internal function which returns -// the highest layer inside the specified dock -static int GetMaxRow(const wxAuiPaneInfoArray& panes, int direction, int layer) -{ - int i, pane_count, max_row = 0; - for (i = 0, pane_count = panes.GetCount(); i < pane_count; ++i) - { - wxAuiPaneInfo& pane = panes.Item(i); - if (pane.dock_direction == direction && - pane.dock_layer == layer && - pane.dock_row > max_row) - max_row = pane.dock_row; - } - return max_row; -} - - - -// DoInsertDockLayer() is an internal function that inserts a new dock -// layer by incrementing all existing dock layer values by one -static void DoInsertDockLayer(wxAuiPaneInfoArray& panes, - int dock_direction, - int dock_layer) -{ - int i, pane_count; - for (i = 0, pane_count = panes.GetCount(); i < pane_count; ++i) - { - wxAuiPaneInfo& pane = panes.Item(i); - if (!pane.IsFloating() && - pane.dock_direction == dock_direction && - pane.dock_layer >= dock_layer) - pane.dock_layer++; - } -} - -// DoInsertDockLayer() is an internal function that inserts a new dock -// row by incrementing all existing dock row values by one -static void DoInsertDockRow(wxAuiPaneInfoArray& panes, - int dock_direction, - int dock_layer, - int dock_row) -{ - int i, pane_count; - for (i = 0, pane_count = panes.GetCount(); i < pane_count; ++i) - { - wxAuiPaneInfo& pane = panes.Item(i); - if (!pane.IsFloating() && - pane.dock_direction == dock_direction && - pane.dock_layer == dock_layer && - pane.dock_row >= dock_row) - pane.dock_row++; - } -} - -// DoInsertDockLayer() is an internal function that inserts a space for -// another dock pane by incrementing all existing dock row values by one -static void DoInsertPane(wxAuiPaneInfoArray& panes, - int dock_direction, - int dock_layer, - int dock_row, - int dock_pos) -{ - int i, pane_count; - for (i = 0, pane_count = panes.GetCount(); i < pane_count; ++i) - { - wxAuiPaneInfo& pane = panes.Item(i); - if (!pane.IsFloating() && - pane.dock_direction == dock_direction && - pane.dock_layer == dock_layer && - pane.dock_row == dock_row && - pane.dock_pos >= dock_pos) - pane.dock_pos++; - } -} - -// FindDocks() is an internal function that returns a list of docks which meet -// the specified conditions in the parameters and returns a sorted array -// (sorted by layer and then row) -static void FindDocks(wxAuiDockInfoArray& docks, - int dock_direction, - int dock_layer, - int dock_row, - wxAuiDockInfoPtrArray& arr) -{ - int begin_layer = dock_layer; - int end_layer = dock_layer; - int begin_row = dock_row; - int end_row = dock_row; - int dock_count = docks.GetCount(); - int layer, row, i, max_row = 0, max_layer = 0; - - // discover the maximum dock layer and the max row - for (i = 0; i < dock_count; ++i) - { - max_row = wxMax(max_row, docks.Item(i).dock_row); - max_layer = wxMax(max_layer, docks.Item(i).dock_layer); - } - - // if no dock layer was specified, search all dock layers - if (dock_layer == -1) - { - begin_layer = 0; - end_layer = max_layer; - } - - // if no dock row was specified, search all dock row - if (dock_row == -1) - { - begin_row = 0; - end_row = max_row; - } - - arr.Clear(); - - for (layer = begin_layer; layer <= end_layer; ++layer) - for (row = begin_row; row <= end_row; ++row) - for (i = 0; i < dock_count; ++i) - { - wxAuiDockInfo& d = docks.Item(i); - if (dock_direction == -1 || dock_direction == d.dock_direction) - { - if (d.dock_layer == layer && d.dock_row == row) - arr.Add(&d); - } - } -} - -// FindPaneInDock() looks up a specified window pointer inside a dock. -// If found, the corresponding wxAuiPaneInfo pointer is returned, otherwise NULL. -static wxAuiPaneInfo* FindPaneInDock(const wxAuiDockInfo& dock, wxWindow* window) -{ - int i, count = dock.panes.GetCount(); - for (i = 0; i < count; ++i) - { - wxAuiPaneInfo* p = dock.panes.Item(i); - if (p->window == window) - return p; - } - return NULL; -} - -// RemovePaneFromDocks() removes a pane window from all docks -// with a possible exception specified by parameter "ex_cept" -static void RemovePaneFromDocks(wxAuiDockInfoArray& docks, - wxAuiPaneInfo& pane, - wxAuiDockInfo* ex_cept = NULL ) -{ - int i, dock_count; - for (i = 0, dock_count = docks.GetCount(); i < dock_count; ++i) - { - wxAuiDockInfo& d = docks.Item(i); - if (&d == ex_cept) - continue; - wxAuiPaneInfo* pi = FindPaneInDock(d, pane.window); - if (pi) - d.panes.Remove(pi); - } -} - -/* -// This function works fine, and may be used in the future - -// RenumberDockRows() takes a dock and assigns sequential numbers -// to existing rows. Basically it takes out the gaps; so if a -// dock has rows with numbers 0,2,5, they will become 0,1,2 -static void RenumberDockRows(wxAuiDockInfoPtrArray& docks) -{ - int i, dock_count; - for (i = 0, dock_count = docks.GetCount(); i < dock_count; ++i) - { - wxAuiDockInfo& dock = *docks.Item(i); - dock.dock_row = i; - - int j, pane_count; - for (j = 0, pane_count = dock.panes.GetCount(); j < pane_count; ++j) - dock.panes.Item(j)->dock_row = i; - } -} -*/ - - -// SetActivePane() sets the active pane, as well as cycles through -// every other pane and makes sure that all others' active flags -// are turned off -static void SetActivePane(wxAuiPaneInfoArray& panes, wxWindow* active_pane) -{ - int i, pane_count; - for (i = 0, pane_count = panes.GetCount(); i < pane_count; ++i) - { - wxAuiPaneInfo& pane = panes.Item(i); - pane.state &= ~wxAuiPaneInfo::optionActive; - if (pane.window == active_pane) - pane.state |= wxAuiPaneInfo::optionActive; - } -} - - -// this function is used to sort panes by dock position -static int PaneSortFunc(wxAuiPaneInfo** p1, wxAuiPaneInfo** p2) -{ - return ((*p1)->dock_pos < (*p2)->dock_pos) ? -1 : 1; -} - - -// -- wxAuiManager class implementation -- - - -BEGIN_EVENT_TABLE(wxAuiManager, wxEvtHandler) - EVT_AUI_PANE_BUTTON(wxAuiManager::OnPaneButton) - EVT_AUI_RENDER(wxAuiManager::OnRender) - EVT_PAINT(wxAuiManager::OnPaint) - EVT_ERASE_BACKGROUND(wxAuiManager::OnEraseBackground) - EVT_SIZE(wxAuiManager::OnSize) - EVT_SET_CURSOR(wxAuiManager::OnSetCursor) - EVT_LEFT_DOWN(wxAuiManager::OnLeftDown) - EVT_LEFT_UP(wxAuiManager::OnLeftUp) - EVT_MOTION(wxAuiManager::OnMotion) - EVT_LEAVE_WINDOW(wxAuiManager::OnLeaveWindow) - EVT_CHILD_FOCUS(wxAuiManager::OnChildFocus) - EVT_AUI_FIND_MANAGER(wxAuiManager::OnFindManager) - EVT_TIMER(101, wxAuiManager::OnHintFadeTimer) -END_EVENT_TABLE() - - -wxAuiManager::wxAuiManager(wxWindow* managed_wnd, unsigned int flags) -{ - m_action = actionNone; - m_action_window = NULL; - m_last_mouse_move = wxPoint(); - m_hover_button = NULL; - m_art = new wxAuiDefaultDockArt; - m_hint_wnd = NULL; - m_flags = flags; - m_skipping = false; - m_has_maximized = false; - m_frame = NULL; - m_dock_constraint_x = 0.3; - m_dock_constraint_y = 0.3; - m_reserved = NULL; - - if (managed_wnd) - { - SetManagedWindow(managed_wnd); - } -} - -wxAuiManager::~wxAuiManager() -{ - // NOTE: It's possible that the windows have already been destroyed by the - // time this dtor is called, so this loop can result in memory access via - // invalid pointers, resulting in a crash. So it will be disabled while - // waiting for a better solution. -#if 0 - for(size_t i = 0; i < m_panes.size(); i++ ) - { - wxAuiPaneInfo& pinfo = m_panes[i]; - if( pinfo.window && !pinfo.window->GetParent() ) - delete pinfo.window; - } -#endif - - delete m_art; -} - -// creates a floating frame for the windows -wxAuiFloatingFrame* wxAuiManager::CreateFloatingFrame(wxWindow* parent, - const wxAuiPaneInfo& pane_info) -{ - return new wxAuiFloatingFrame(parent, this, pane_info); -} - -// GetPane() looks up a wxAuiPaneInfo structure based -// on the supplied window pointer. Upon failure, GetPane() -// returns an empty wxAuiPaneInfo, a condition which can be checked -// by calling wxAuiPaneInfo::IsOk(). -// -// The pane info's structure may then be modified. Once a pane's -// info is modified, wxAuiManager::Update() must be called to -// realize the changes in the UI. - -wxAuiPaneInfo& wxAuiManager::GetPane(wxWindow* window) -{ - int i, pane_count; - for (i = 0, pane_count = m_panes.GetCount(); i < pane_count; ++i) - { - wxAuiPaneInfo& p = m_panes.Item(i); - if (p.window == window) - return p; - } - return wxAuiNullPaneInfo; -} - -// this version of GetPane() looks up a pane based on a -// 'pane name', see above comment for more info -wxAuiPaneInfo& wxAuiManager::GetPane(const wxString& name) -{ - int i, pane_count; - for (i = 0, pane_count = m_panes.GetCount(); i < pane_count; ++i) - { - wxAuiPaneInfo& p = m_panes.Item(i); - if (p.name == name) - return p; - } - return wxAuiNullPaneInfo; -} - -// GetAllPanes() returns a reference to all the pane info structures -wxAuiPaneInfoArray& wxAuiManager::GetAllPanes() -{ - return m_panes; -} - -// HitTest() is an internal function which determines -// which UI item the specified coordinates are over -// (x,y) specify a position in client coordinates -wxAuiDockUIPart* wxAuiManager::HitTest(int x, int y) -{ - wxAuiDockUIPart* result = NULL; - - int i, part_count; - for (i = 0, part_count = m_uiparts.GetCount(); i < part_count; ++i) - { - wxAuiDockUIPart* item = &m_uiparts.Item(i); - - // we are not interested in typeDock, because this space - // isn't used to draw anything, just for measurements; - // besides, the entire dock area is covered with other - // rectangles, which we are interested in. - if (item->type == wxAuiDockUIPart::typeDock) - continue; - - // if we already have a hit on a more specific item, we are not - // interested in a pane hit. If, however, we don't already have - // a hit, returning a pane hit is necessary for some operations - if ((item->type == wxAuiDockUIPart::typePane || - item->type == wxAuiDockUIPart::typePaneBorder) && result) - continue; - - // if the point is inside the rectangle, we have a hit - if (item->rect.Contains(x,y)) - result = item; - } - - return result; -} - - -// SetFlags() and GetFlags() allow the owner to set various -// options which are global to wxAuiManager -void wxAuiManager::SetFlags(unsigned int flags) -{ - // find out if we have to call UpdateHintWindowConfig() - bool update_hint_wnd = false; - unsigned int hint_mask = wxAUI_MGR_TRANSPARENT_HINT | - wxAUI_MGR_VENETIAN_BLINDS_HINT | - wxAUI_MGR_RECTANGLE_HINT; - if ((flags & hint_mask) != (m_flags & hint_mask)) - update_hint_wnd = true; - - - // set the new flags - m_flags = flags; - - if (update_hint_wnd) - { - UpdateHintWindowConfig(); - } -} - -unsigned int wxAuiManager::GetFlags() const -{ - return m_flags; -} - -// Convenience function -bool wxAuiManager_HasLiveResize(wxAuiManager& manager) -{ - // With Core Graphics on Mac, it's not possible to show sash feedback, - // so we'll always use live update instead. -#if defined(__WXMAC__) && wxMAC_USE_CORE_GRAPHICS - return true; -#else - return (manager.GetFlags() & wxAUI_MGR_LIVE_RESIZE) == wxAUI_MGR_LIVE_RESIZE; -#endif -} - -// don't use these anymore as they are deprecated -// use Set/GetManagedFrame() instead -void wxAuiManager::SetFrame(wxFrame* frame) -{ - SetManagedWindow((wxWindow*)frame); -} - -wxFrame* wxAuiManager::GetFrame() const -{ - return (wxFrame*)m_frame; -} - - -// this function will return the aui manager for a given -// window. The |window| parameter should be any child window -// or grand-child window (and so on) of the frame/window -// managed by wxAuiManager. The |window| parameter does not -// need to be managed by the manager itself. -wxAuiManager* wxAuiManager::GetManager(wxWindow* window) -{ - wxAuiManagerEvent evt(wxEVT_AUI_FIND_MANAGER); - evt.SetManager(NULL); - evt.ResumePropagation(wxEVENT_PROPAGATE_MAX); - if (!window->ProcessEvent(evt)) - return NULL; - - return evt.GetManager(); -} - - -void wxAuiManager::UpdateHintWindowConfig() -{ - // find out if the the system can do transparent frames - bool can_do_transparent = false; - - wxWindow* w = m_frame; - while (w) - { - if (w->IsKindOf(CLASSINFO(wxFrame))) - { - wxFrame* f = wx_static_cast(wxFrame*, w); - can_do_transparent = f->CanSetTransparent(); - break; - } - - w = w->GetParent(); - } - - // if there is an existing hint window, delete it - if (m_hint_wnd) - { - m_hint_wnd->Destroy(); - m_hint_wnd = NULL; - } - - m_hint_fademax = 50; - m_hint_wnd = NULL; - - if ((m_flags & wxAUI_MGR_TRANSPARENT_HINT) && can_do_transparent) - { - // Make a window to use for a transparent hint - #if defined(__WXMSW__) || defined(__WXGTK__) - m_hint_wnd = new wxFrame(m_frame, wxID_ANY, wxEmptyString, - wxDefaultPosition, wxSize(1,1), - wxFRAME_TOOL_WINDOW | - wxFRAME_FLOAT_ON_PARENT | - wxFRAME_NO_TASKBAR | - wxNO_BORDER); - - m_hint_wnd->SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_ACTIVECAPTION)); - #elif defined(__WXMAC__) - // Using a miniframe with float and tool styles keeps the parent - // frame activated and highlighted as such... - m_hint_wnd = new wxMiniFrame(m_frame, wxID_ANY, wxEmptyString, - wxDefaultPosition, wxSize(1,1), - wxFRAME_FLOAT_ON_PARENT - | wxFRAME_TOOL_WINDOW ); - - // Can't set the bg colour of a Frame in wxMac - wxPanel* p = new wxPanel(m_hint_wnd); - - // The default wxSYS_COLOUR_ACTIVECAPTION colour is a light silver - // color that is really hard to see, especially transparent. - // Until a better system color is decided upon we'll just use - // blue. - p->SetBackgroundColour(*wxBLUE); - #endif - - } - else - { - if ((m_flags & wxAUI_MGR_TRANSPARENT_HINT) != 0 || - (m_flags & wxAUI_MGR_VENETIAN_BLINDS_HINT) != 0) - { - // system can't support transparent fade, or the venetian - // blinds effect was explicitly requested - m_hint_wnd = new wxPseudoTransparentFrame(m_frame, - wxID_ANY, - wxEmptyString, - wxDefaultPosition, - wxSize(1,1), - wxFRAME_TOOL_WINDOW | - wxFRAME_FLOAT_ON_PARENT | - wxFRAME_NO_TASKBAR | - wxNO_BORDER); - m_hint_fademax = 128; - } - } -} - - -// SetManagedWindow() is usually called once when the frame -// manager class is being initialized. "frame" specifies -// the frame which should be managed by the frame mananger -void wxAuiManager::SetManagedWindow(wxWindow* wnd) -{ - wxASSERT_MSG(wnd, wxT("specified window must be non-NULL")); - - m_frame = wnd; - m_frame->PushEventHandler(this); - -#if wxUSE_MDI - // if the owner is going to manage an MDI parent frame, - // we need to add the MDI client window as the default - // center pane - - if (m_frame->IsKindOf(CLASSINFO(wxMDIParentFrame))) - { - wxMDIParentFrame* mdi_frame = (wxMDIParentFrame*)m_frame; - wxWindow* client_window = mdi_frame->GetClientWindow(); - - wxASSERT_MSG(client_window, wxT("Client window is NULL!")); - - AddPane(client_window, - wxAuiPaneInfo().Name(wxT("mdiclient")). - CenterPane().PaneBorder(false)); - } - else if (m_frame->IsKindOf(CLASSINFO(wxAuiMDIParentFrame))) - { - wxAuiMDIParentFrame* mdi_frame = (wxAuiMDIParentFrame*)m_frame; - wxAuiMDIClientWindow* client_window = mdi_frame->GetClientWindow(); - wxASSERT_MSG(client_window, wxT("Client window is NULL!")); - - AddPane(client_window, - wxAuiPaneInfo().Name(wxT("mdiclient")). - CenterPane().PaneBorder(false)); - } - -#endif - - UpdateHintWindowConfig(); -} - - -// UnInit() must be called, usually in the destructor -// of the frame class. If it is not called, usually this -// will result in a crash upon program exit -void wxAuiManager::UnInit() -{ - if (m_frame) - { - m_frame->RemoveEventHandler(this); - } -} - -// GetManagedWindow() returns the window pointer being managed -wxWindow* wxAuiManager::GetManagedWindow() const -{ - return m_frame; -} - -wxAuiDockArt* wxAuiManager::GetArtProvider() const -{ - return m_art; -} - -void wxAuiManager::ProcessMgrEvent(wxAuiManagerEvent& event) -{ - // first, give the owner frame a chance to override - if (m_frame) - { - if (m_frame->ProcessEvent(event)) - return; - } - - ProcessEvent(event); -} - -// SetArtProvider() instructs wxAuiManager to use the -// specified art provider for all drawing calls. This allows -// plugable look-and-feel features. The pointer that is -// passed to this method subsequently belongs to wxAuiManager, -// and is deleted in the frame manager destructor -void wxAuiManager::SetArtProvider(wxAuiDockArt* art_provider) -{ - // delete the last art provider, if any - delete m_art; - - // assign the new art provider - m_art = art_provider; -} - - -bool wxAuiManager::AddPane(wxWindow* window, const wxAuiPaneInfo& pane_info) -{ - wxASSERT_MSG(window, wxT("NULL window ptrs are not allowed")); - - // check if the pane has a valid window - if (!window) - return false; - - // check if the window is already managed by us - if (GetPane(pane_info.window).IsOk()) - return false; - - // check if the pane name already exists, this could reveal a - // bug in the library user's application - bool already_exists = false; - if (!pane_info.name.empty() && GetPane(pane_info.name).IsOk()) - { - wxFAIL_MSG(wxT("A pane with that name already exists in the manager!")); - already_exists = true; - } - - // if the new pane is docked then we should undo maximize - if (pane_info.IsDocked()) - RestoreMaximizedPane(); - - m_panes.Add(pane_info); - - wxAuiPaneInfo& pinfo = m_panes.Last(); - - // set the pane window - pinfo.window = window; - - - // if the pane's name identifier is blank, create a random string - if (pinfo.name.empty() || already_exists) - { - pinfo.name.Printf(wxT("%08lx%08x%08x%08lx"), - ((unsigned long)pinfo.window) & 0xffffffff, - (unsigned int)time(NULL), -#ifdef __WXWINCE__ - (unsigned int)GetTickCount(), -#else - (unsigned int)clock(), -#endif - (unsigned long)m_panes.GetCount()); - } - - // set initial proportion (if not already set) - if (pinfo.dock_proportion == 0) - pinfo.dock_proportion = 100000; - - if (pinfo.HasMaximizeButton()) - { - wxAuiPaneButton button; - button.button_id = wxAUI_BUTTON_MAXIMIZE_RESTORE; - pinfo.buttons.Add(button); - } - - if (pinfo.HasPinButton()) - { - wxAuiPaneButton button; - button.button_id = wxAUI_BUTTON_PIN; - pinfo.buttons.Add(button); - } - - if (pinfo.HasCloseButton()) - { - wxAuiPaneButton button; - button.button_id = wxAUI_BUTTON_CLOSE; - pinfo.buttons.Add(button); - } - - if (pinfo.HasGripper()) - { - if (pinfo.window->IsKindOf(CLASSINFO(wxAuiToolBar))) - { - // prevent duplicate gripper -- both wxAuiManager and wxAuiToolBar - // have a gripper control. The toolbar's built-in gripper - // meshes better with the look and feel of the control than ours, - // so turn wxAuiManager's gripper off, and the toolbar's on. - - wxAuiToolBar* tb = wx_static_cast(wxAuiToolBar*, pinfo.window); - pinfo.SetFlag(wxAuiPaneInfo::optionGripper, false); - tb->SetGripperVisible(true); - } - } - - - if (pinfo.best_size == wxDefaultSize && - pinfo.window) - { - pinfo.best_size = pinfo.window->GetClientSize(); - - if (pinfo.window->IsKindOf(CLASSINFO(wxToolBar))) - { - // GetClientSize() doesn't get the best size for - // a toolbar under some newer versions of wxWidgets, - // so use GetBestSize() - pinfo.best_size = pinfo.window->GetBestSize(); - - // for some reason, wxToolBar::GetBestSize() is returning - // a size that is a pixel shy of the correct amount. - // I believe this to be the correct action, until - // wxToolBar::GetBestSize() is fixed. Is this assumption - // correct? - // commented out by JACS 2007-9-08 after having added a pixel in wxMSW's wxToolBar::DoGetBestSize() - // pinfo.best_size.y++; - } - - if (pinfo.min_size != wxDefaultSize) - { - if (pinfo.best_size.x < pinfo.min_size.x) - pinfo.best_size.x = pinfo.min_size.x; - if (pinfo.best_size.y < pinfo.min_size.y) - pinfo.best_size.y = pinfo.min_size.y; - } - } - - - - return true; -} - -bool wxAuiManager::AddPane(wxWindow* window, - int direction, - const wxString& caption) -{ - wxAuiPaneInfo pinfo; - pinfo.Caption(caption); - switch (direction) - { - case wxTOP: pinfo.Top(); break; - case wxBOTTOM: pinfo.Bottom(); break; - case wxLEFT: pinfo.Left(); break; - case wxRIGHT: pinfo.Right(); break; - case wxCENTER: pinfo.CenterPane(); break; - } - return AddPane(window, pinfo); -} - -bool wxAuiManager::AddPane(wxWindow* window, - const wxAuiPaneInfo& pane_info, - const wxPoint& drop_pos) -{ - if (!AddPane(window, pane_info)) - return false; - - wxAuiPaneInfo& pane = GetPane(window); - - DoDrop(m_docks, m_panes, pane, drop_pos, wxPoint(0,0)); - - return true; -} - -bool wxAuiManager::InsertPane(wxWindow* window, const wxAuiPaneInfo& pane_info, - int insert_level) -{ - wxASSERT_MSG(window, wxT("NULL window ptrs are not allowed")); - - // shift the panes around, depending on the insert level - switch (insert_level) - { - case wxAUI_INSERT_PANE: - DoInsertPane(m_panes, - pane_info.dock_direction, - pane_info.dock_layer, - pane_info.dock_row, - pane_info.dock_pos); - break; - case wxAUI_INSERT_ROW: - DoInsertDockRow(m_panes, - pane_info.dock_direction, - pane_info.dock_layer, - pane_info.dock_row); - break; - case wxAUI_INSERT_DOCK: - DoInsertDockLayer(m_panes, - pane_info.dock_direction, - pane_info.dock_layer); - break; - } - - // if the window already exists, we are basically just moving/inserting the - // existing window. If it doesn't exist, we need to add it and insert it - wxAuiPaneInfo& existing_pane = GetPane(window); - if (!existing_pane.IsOk()) - { - return AddPane(window, pane_info); - } - else - { - if (pane_info.IsFloating()) - { - existing_pane.Float(); - if (pane_info.floating_pos != wxDefaultPosition) - existing_pane.FloatingPosition(pane_info.floating_pos); - if (pane_info.floating_size != wxDefaultSize) - existing_pane.FloatingSize(pane_info.floating_size); - } - else - { - // if the new pane is docked then we should undo maximize - RestoreMaximizedPane(); - - existing_pane.Direction(pane_info.dock_direction); - existing_pane.Layer(pane_info.dock_layer); - existing_pane.Row(pane_info.dock_row); - existing_pane.Position(pane_info.dock_pos); - } - } - - return true; -} - - -// DetachPane() removes a pane from the frame manager. This -// method will not destroy the window that is removed. -bool wxAuiManager::DetachPane(wxWindow* window) -{ - wxASSERT_MSG(window, wxT("NULL window ptrs are not allowed")); - - int i, count; - for (i = 0, count = m_panes.GetCount(); i < count; ++i) - { - wxAuiPaneInfo& p = m_panes.Item(i); - if (p.window == window) - { - if (p.frame) - { - // we have a floating frame which is being detached. We need to - // reparent it to m_frame and destroy the floating frame - - // reduce flicker - p.window->SetSize(1,1); - - if (p.frame->IsShown()) - p.frame->Show(false); - - // reparent to m_frame and destroy the pane - if (m_action_window == p.frame) - { - m_action_window = NULL; - } - - p.window->Reparent(m_frame); - p.frame->SetSizer(NULL); - p.frame->Destroy(); - p.frame = NULL; - } - - // make sure there are no references to this pane in our uiparts, - // just in case the caller doesn't call Update() immediately after - // the DetachPane() call. This prevets obscure crashes which would - // happen at window repaint if the caller forgets to call Update() - int pi, part_count; - for (pi = 0, part_count = (int)m_uiparts.GetCount(); pi < part_count; ++pi) - { - wxAuiDockUIPart& part = m_uiparts.Item(pi); - if (part.pane == &p) - { - m_uiparts.RemoveAt(pi); - part_count--; - pi--; - continue; - } - } - - m_panes.RemoveAt(i); - return true; - } - } - return false; -} - -// ClosePane() destroys or hides the pane depending on its flags -void wxAuiManager::ClosePane(wxAuiPaneInfo& pane_info) -{ - // if we were maximized, restore - if (pane_info.IsMaximized()) - { - RestorePane(pane_info); - } - - // first, hide the window - if (pane_info.window && pane_info.window->IsShown()) - { - pane_info.window->Show(false); - } - - // make sure that we are the parent of this window - if (pane_info.window && pane_info.window->GetParent() != m_frame) - { - pane_info.window->Reparent(m_frame); - } - - // if we have a frame, destroy it - if (pane_info.frame) - { - pane_info.frame->Destroy(); - pane_info.frame = NULL; - } - - // now we need to either destroy or hide the pane - if (pane_info.IsDestroyOnClose()) - { - wxWindow * window = pane_info.window; - DetachPane(window); - if (window) - { - window->Destroy(); - } - } - else - { - pane_info.Hide(); - } -} - -void wxAuiManager::MaximizePane(wxAuiPaneInfo& pane_info) -{ - int i, pane_count; - - // un-maximize and hide all other panes - for (i = 0, pane_count = m_panes.GetCount(); i < pane_count; ++i) - { - wxAuiPaneInfo& p = m_panes.Item(i); - if (!p.IsToolbar() && !p.IsFloating()) - { - p.Restore(); - - // save hidden state - p.SetFlag(wxAuiPaneInfo::savedHiddenState, - p.HasFlag(wxAuiPaneInfo::optionHidden)); - - // hide the pane, because only the newly - // maximized pane should show - p.Hide(); - } - } - - // mark ourselves maximized - pane_info.Maximize(); - pane_info.Show(); - m_has_maximized = true; - - // last, show the window - if (pane_info.window && !pane_info.window->IsShown()) - { - pane_info.window->Show(true); - } -} - -void wxAuiManager::RestorePane(wxAuiPaneInfo& pane_info) -{ - int i, pane_count; - - // restore all the panes - for (i = 0, pane_count = m_panes.GetCount(); i < pane_count; ++i) - { - wxAuiPaneInfo& p = m_panes.Item(i); - if (!p.IsToolbar() && !p.IsFloating()) - { - p.SetFlag(wxAuiPaneInfo::optionHidden, - p.HasFlag(wxAuiPaneInfo::savedHiddenState)); - } - } - - // mark ourselves non-maximized - pane_info.Restore(); - m_has_maximized = false; - - // last, show the window - if (pane_info.window && !pane_info.window->IsShown()) - { - pane_info.window->Show(true); - } -} - -void wxAuiManager::RestoreMaximizedPane() -{ - int i, pane_count; - - // restore all the panes - for (i = 0, pane_count = m_panes.GetCount(); i < pane_count; ++i) - { - wxAuiPaneInfo& p = m_panes.Item(i); - if (p.IsMaximized()) - { - RestorePane(p); - break; - } - } -} - -// EscapeDelimiters() changes ";" into "\;" and "|" into "\|" -// in the input string. This is an internal functions which is -// used for saving perspectives -static wxString EscapeDelimiters(const wxString& s) -{ - wxString result; - result.Alloc(s.length()); - const wxChar* ch = s.c_str(); - while (*ch) - { - if (*ch == wxT(';') || *ch == wxT('|')) - result += wxT('\\'); - result += *ch; - ++ch; - } - return result; -} - -wxString wxAuiManager::SavePaneInfo(wxAuiPaneInfo& pane) -{ - wxString result = wxT("name="); - result += EscapeDelimiters(pane.name); - result += wxT(";"); - - result += wxT("caption="); - result += EscapeDelimiters(pane.caption); - result += wxT(";"); - - result += wxString::Format(wxT("state=%u;"), pane.state); - result += wxString::Format(wxT("dir=%d;"), pane.dock_direction); - result += wxString::Format(wxT("layer=%d;"), pane.dock_layer); - result += wxString::Format(wxT("row=%d;"), pane.dock_row); - result += wxString::Format(wxT("pos=%d;"), pane.dock_pos); - result += wxString::Format(wxT("prop=%d;"), pane.dock_proportion); - result += wxString::Format(wxT("bestw=%d;"), pane.best_size.x); - result += wxString::Format(wxT("besth=%d;"), pane.best_size.y); - result += wxString::Format(wxT("minw=%d;"), pane.min_size.x); - result += wxString::Format(wxT("minh=%d;"), pane.min_size.y); - result += wxString::Format(wxT("maxw=%d;"), pane.max_size.x); - result += wxString::Format(wxT("maxh=%d;"), pane.max_size.y); - result += wxString::Format(wxT("floatx=%d;"), pane.floating_pos.x); - result += wxString::Format(wxT("floaty=%d;"), pane.floating_pos.y); - result += wxString::Format(wxT("floatw=%d;"), pane.floating_size.x); - result += wxString::Format(wxT("floath=%d"), pane.floating_size.y); - - return result; -} - -// Load a "pane" with the pane infor settings in pane_part -void wxAuiManager::LoadPaneInfo(wxString pane_part, wxAuiPaneInfo &pane) -{ - // replace escaped characters so we can - // split up the string easily - pane_part.Replace(wxT("\\|"), wxT("\a")); - pane_part.Replace(wxT("\\;"), wxT("\b")); - - while(1) - { - wxString val_part = pane_part.BeforeFirst(wxT(';')); - pane_part = pane_part.AfterFirst(wxT(';')); - wxString val_name = val_part.BeforeFirst(wxT('=')); - wxString value = val_part.AfterFirst(wxT('=')); - val_name.MakeLower(); - val_name.Trim(true); - val_name.Trim(false); - value.Trim(true); - value.Trim(false); - - if (val_name.empty()) - break; - - if (val_name == wxT("name")) - pane.name = value; - else if (val_name == wxT("caption")) - pane.caption = value; - else if (val_name == wxT("state")) - pane.state = (unsigned int)wxAtoi(value.c_str()); - else if (val_name == wxT("dir")) - pane.dock_direction = wxAtoi(value.c_str()); - else if (val_name == wxT("layer")) - pane.dock_layer = wxAtoi(value.c_str()); - else if (val_name == wxT("row")) - pane.dock_row = wxAtoi(value.c_str()); - else if (val_name == wxT("pos")) - pane.dock_pos = wxAtoi(value.c_str()); - else if (val_name == wxT("prop")) - pane.dock_proportion = wxAtoi(value.c_str()); - else if (val_name == wxT("bestw")) - pane.best_size.x = wxAtoi(value.c_str()); - else if (val_name == wxT("besth")) - pane.best_size.y = wxAtoi(value.c_str()); - else if (val_name == wxT("minw")) - pane.min_size.x = wxAtoi(value.c_str()); - else if (val_name == wxT("minh")) - pane.min_size.y = wxAtoi(value.c_str()); - else if (val_name == wxT("maxw")) - pane.max_size.x = wxAtoi(value.c_str()); - else if (val_name == wxT("maxh")) - pane.max_size.y = wxAtoi(value.c_str()); - else if (val_name == wxT("floatx")) - pane.floating_pos.x = wxAtoi(value.c_str()); - else if (val_name == wxT("floaty")) - pane.floating_pos.y = wxAtoi(value.c_str()); - else if (val_name == wxT("floatw")) - pane.floating_size.x = wxAtoi(value.c_str()); - else if (val_name == wxT("floath")) - pane.floating_size.y = wxAtoi(value.c_str()); - else { - wxFAIL_MSG(wxT("Bad Perspective String")); - } - } - - // replace escaped characters so we can - // split up the string easily - pane.name.Replace(wxT("\a"), wxT("|")); - pane.name.Replace(wxT("\b"), wxT(";")); - pane.caption.Replace(wxT("\a"), wxT("|")); - pane.caption.Replace(wxT("\b"), wxT(";")); - pane_part.Replace(wxT("\a"), wxT("|")); - pane_part.Replace(wxT("\b"), wxT(";")); - - return; -} - - -// SavePerspective() saves all pane information as a single string. -// This string may later be fed into LoadPerspective() to restore -// all pane settings. This save and load mechanism allows an -// exact pane configuration to be saved and restored at a later time - -wxString wxAuiManager::SavePerspective() -{ - wxString result; - result.Alloc(500); - result = wxT("layout2|"); - - int pane_i, pane_count = m_panes.GetCount(); - for (pane_i = 0; pane_i < pane_count; ++pane_i) - { - wxAuiPaneInfo& pane = m_panes.Item(pane_i); - result += SavePaneInfo(pane)+wxT("|"); - } - - int dock_i, dock_count = m_docks.GetCount(); - for (dock_i = 0; dock_i < dock_count; ++dock_i) - { - wxAuiDockInfo& dock = m_docks.Item(dock_i); - - result += wxString::Format(wxT("dock_size(%d,%d,%d)=%d|"), - dock.dock_direction, dock.dock_layer, - dock.dock_row, dock.size); - } - - return result; -} - -// LoadPerspective() loads a layout which was saved with SavePerspective() -// If the "update" flag parameter is true, the GUI will immediately be updated - -bool wxAuiManager::LoadPerspective(const wxString& layout, bool update) -{ - wxString input = layout; - wxString part; - - // check layout string version - // 'layout1' = wxAUI 0.9.0 - wxAUI 0.9.2 - // 'layout2' = wxAUI 0.9.2 (wxWidgets 2.8) - part = input.BeforeFirst(wxT('|')); - input = input.AfterFirst(wxT('|')); - part.Trim(true); - part.Trim(false); - if (part != wxT("layout2")) - return false; - - // mark all panes currently managed as docked and hidden - int pane_i, pane_count = m_panes.GetCount(); - for (pane_i = 0; pane_i < pane_count; ++pane_i) - m_panes.Item(pane_i).Dock().Hide(); - - // clear out the dock array; this will be reconstructed - m_docks.Clear(); - - // replace escaped characters so we can - // split up the string easily - input.Replace(wxT("\\|"), wxT("\a")); - input.Replace(wxT("\\;"), wxT("\b")); - - while (1) - { - wxAuiPaneInfo pane; - - wxString pane_part = input.BeforeFirst(wxT('|')); - input = input.AfterFirst(wxT('|')); - pane_part.Trim(true); - - // if the string is empty, we're done parsing - if (pane_part.empty()) - break; - - if (pane_part.Left(9) == wxT("dock_size")) - { - wxString val_name = pane_part.BeforeFirst(wxT('=')); - wxString value = pane_part.AfterFirst(wxT('=')); - - long dir, layer, row, size; - wxString piece = val_name.AfterFirst(wxT('(')); - piece = piece.BeforeLast(wxT(')')); - piece.BeforeFirst(wxT(',')).ToLong(&dir); - piece = piece.AfterFirst(wxT(',')); - piece.BeforeFirst(wxT(',')).ToLong(&layer); - piece.AfterFirst(wxT(',')).ToLong(&row); - value.ToLong(&size); - - wxAuiDockInfo dock; - dock.dock_direction = dir; - dock.dock_layer = layer; - dock.dock_row = row; - dock.size = size; - m_docks.Add(dock); - continue; - } - - // Undo our escaping as LoadPaneInfo needs to take an unescaped - // name so it can be called by external callers - pane_part.Replace(wxT("\a"), wxT("|")); - pane_part.Replace(wxT("\b"), wxT(";")); - - LoadPaneInfo(pane_part, pane); - - wxAuiPaneInfo& p = GetPane(pane.name); - if (!p.IsOk()) - { - // the pane window couldn't be found - // in the existing layout -- skip it - continue; - } - - p.SafeSet(pane); - } - - if (update) - Update(); - - return true; -} - -void wxAuiManager::GetPanePositionsAndSizes(wxAuiDockInfo& dock, - wxArrayInt& positions, - wxArrayInt& sizes) -{ - int caption_size = m_art->GetMetric(wxAUI_DOCKART_CAPTION_SIZE); - int pane_border_size = m_art->GetMetric(wxAUI_DOCKART_PANE_BORDER_SIZE); - int gripper_size = m_art->GetMetric(wxAUI_DOCKART_GRIPPER_SIZE); - - positions.Empty(); - sizes.Empty(); - - int offset, action_pane = -1; - int pane_i, pane_count = dock.panes.GetCount(); - - // find the pane marked as our action pane - for (pane_i = 0; pane_i < pane_count; ++pane_i) - { - wxAuiPaneInfo& pane = *(dock.panes.Item(pane_i)); - - if (pane.state & wxAuiPaneInfo::actionPane) - { - wxASSERT_MSG(action_pane==-1, wxT("Too many fixed action panes")); - action_pane = pane_i; - } - } - - // set up each panes default position, and - // determine the size (width or height, depending - // on the dock's orientation) of each pane - for (pane_i = 0; pane_i < pane_count; ++pane_i) - { - wxAuiPaneInfo& pane = *(dock.panes.Item(pane_i)); - positions.Add(pane.dock_pos); - int size = 0; - - if (pane.HasBorder()) - size += (pane_border_size*2); - - if (dock.IsHorizontal()) - { - if (pane.HasGripper() && !pane.HasGripperTop()) - size += gripper_size; - size += pane.best_size.x; - } - else - { - if (pane.HasGripper() && pane.HasGripperTop()) - size += gripper_size; - - if (pane.HasCaption()) - size += caption_size; - size += pane.best_size.y; - } - - sizes.Add(size); - } - - // if there is no action pane, just return the default - // positions (as specified in pane.pane_pos) - if (action_pane == -1) - return; - - offset = 0; - for (pane_i = action_pane-1; pane_i >= 0; --pane_i) - { - int amount = positions[pane_i+1] - (positions[pane_i] + sizes[pane_i]); - - if (amount >= 0) - offset += amount; - else - positions[pane_i] -= -amount; - - offset += sizes[pane_i]; - } - - // if the dock mode is fixed, make sure none of the panes - // overlap; we will bump panes that overlap - offset = 0; - for (pane_i = action_pane; pane_i < pane_count; ++pane_i) - { - int amount = positions[pane_i] - offset; - if (amount >= 0) - offset += amount; - else - positions[pane_i] += -amount; - - offset += sizes[pane_i]; - } -} - - -void wxAuiManager::LayoutAddPane(wxSizer* cont, - wxAuiDockInfo& dock, - wxAuiPaneInfo& pane, - wxAuiDockUIPartArray& uiparts, - bool spacer_only) -{ - wxAuiDockUIPart part; - wxSizerItem* sizer_item; - - int caption_size = m_art->GetMetric(wxAUI_DOCKART_CAPTION_SIZE); - int gripper_size = m_art->GetMetric(wxAUI_DOCKART_GRIPPER_SIZE); - int pane_border_size = m_art->GetMetric(wxAUI_DOCKART_PANE_BORDER_SIZE); - int pane_button_size = m_art->GetMetric(wxAUI_DOCKART_PANE_BUTTON_SIZE); - - // find out the orientation of the item (orientation for panes - // is the same as the dock's orientation) - int orientation; - if (dock.IsHorizontal()) - orientation = wxHORIZONTAL; - else - orientation = wxVERTICAL; - - // this variable will store the proportion - // value that the pane will receive - int pane_proportion = pane.dock_proportion; - - wxBoxSizer* horz_pane_sizer = new wxBoxSizer(wxHORIZONTAL); - wxBoxSizer* vert_pane_sizer = new wxBoxSizer(wxVERTICAL); - - if (pane.HasGripper()) - { - if (pane.HasGripperTop()) - sizer_item = vert_pane_sizer ->Add(1, gripper_size, 0, wxEXPAND); - else - sizer_item = horz_pane_sizer ->Add(gripper_size, 1, 0, wxEXPAND); - - part.type = wxAuiDockUIPart::typeGripper; - part.dock = &dock; - part.pane = &pane; - part.button = NULL; - part.orientation = orientation; - part.cont_sizer = horz_pane_sizer; - part.sizer_item = sizer_item; - uiparts.Add(part); - } - - if (pane.HasCaption()) - { - // create the caption sizer - wxBoxSizer* caption_sizer = new wxBoxSizer(wxHORIZONTAL); - - sizer_item = caption_sizer->Add(1, caption_size, 1, wxEXPAND); - - part.type = wxAuiDockUIPart::typeCaption; - part.dock = &dock; - part.pane = &pane; - part.button = NULL; - part.orientation = orientation; - part.cont_sizer = vert_pane_sizer; - part.sizer_item = sizer_item; - int caption_part_idx = uiparts.GetCount(); - uiparts.Add(part); - - // add pane buttons to the caption - int i, button_count; - for (i = 0, button_count = pane.buttons.GetCount(); - i < button_count; ++i) - { - wxAuiPaneButton& button = pane.buttons.Item(i); - - sizer_item = caption_sizer->Add(pane_button_size, - caption_size, - 0, wxEXPAND); - - part.type = wxAuiDockUIPart::typePaneButton; - part.dock = &dock; - part.pane = &pane; - part.button = &button; - part.orientation = orientation; - part.cont_sizer = caption_sizer; - part.sizer_item = sizer_item; - uiparts.Add(part); - } - - // if we have buttons, add a little space to the right - // of them to ease visual crowding - if (button_count >= 1) - { - caption_sizer->Add(3,1); - } - - // add the caption sizer - sizer_item = vert_pane_sizer->Add(caption_sizer, 0, wxEXPAND); - - uiparts.Item(caption_part_idx).sizer_item = sizer_item; - } - - // add the pane window itself - if (spacer_only) - { - sizer_item = vert_pane_sizer->Add(1, 1, 1, wxEXPAND); - } - else - { - sizer_item = vert_pane_sizer->Add(pane.window, 1, wxEXPAND); - // Don't do this because it breaks the pane size in floating windows - // BIW: Right now commenting this out is causing problems with - // an mdi client window as the center pane. - vert_pane_sizer->SetItemMinSize(pane.window, 1, 1); - } - - part.type = wxAuiDockUIPart::typePane; - part.dock = &dock; - part.pane = &pane; - part.button = NULL; - part.orientation = orientation; - part.cont_sizer = vert_pane_sizer; - part.sizer_item = sizer_item; - uiparts.Add(part); - - - // determine if the pane should have a minimum size; if the pane is - // non-resizable (fixed) then we must set a minimum size. Alternatively, - // if the pane.min_size is set, we must use that value as well - - wxSize min_size = pane.min_size; - if (pane.IsFixed()) - { - if (min_size == wxDefaultSize) - { - min_size = pane.best_size; - pane_proportion = 0; - } - } - - if (min_size != wxDefaultSize) - { - vert_pane_sizer->SetItemMinSize( - vert_pane_sizer->GetChildren().GetCount()-1, - min_size.x, min_size.y); - } - - - // add the verticle sizer (caption, pane window) to the - // horizontal sizer (gripper, verticle sizer) - horz_pane_sizer->Add(vert_pane_sizer, 1, wxEXPAND); - - // finally, add the pane sizer to the dock sizer - - if (pane.HasBorder()) - { - // allowing space for the pane's border - sizer_item = cont->Add(horz_pane_sizer, pane_proportion, - wxEXPAND | wxALL, pane_border_size); - - part.type = wxAuiDockUIPart::typePaneBorder; - part.dock = &dock; - part.pane = &pane; - part.button = NULL; - part.orientation = orientation; - part.cont_sizer = cont; - part.sizer_item = sizer_item; - uiparts.Add(part); - } - else - { - sizer_item = cont->Add(horz_pane_sizer, pane_proportion, wxEXPAND); - } -} - -void wxAuiManager::LayoutAddDock(wxSizer* cont, - wxAuiDockInfo& dock, - wxAuiDockUIPartArray& uiparts, - bool spacer_only) -{ - wxSizerItem* sizer_item; - wxAuiDockUIPart part; - - int sash_size = m_art->GetMetric(wxAUI_DOCKART_SASH_SIZE); - int orientation = dock.IsHorizontal() ? wxHORIZONTAL : wxVERTICAL; - - // resizable bottom and right docks have a sash before them - if (!m_has_maximized && !dock.fixed && (dock.dock_direction == wxAUI_DOCK_BOTTOM || - dock.dock_direction == wxAUI_DOCK_RIGHT)) - { - sizer_item = cont->Add(sash_size, sash_size, 0, wxEXPAND); - - part.type = wxAuiDockUIPart::typeDockSizer; - part.orientation = orientation; - part.dock = &dock; - part.pane = NULL; - part.button = NULL; - part.cont_sizer = cont; - part.sizer_item = sizer_item; - uiparts.Add(part); - } - - // create the sizer for the dock - wxSizer* dock_sizer = new wxBoxSizer(orientation); - - // add each pane to the dock - bool has_maximized_pane = false; - int pane_i, pane_count = dock.panes.GetCount(); - - if (dock.fixed) - { - wxArrayInt pane_positions, pane_sizes; - - // figure out the real pane positions we will - // use, without modifying the each pane's pane_pos member - GetPanePositionsAndSizes(dock, pane_positions, pane_sizes); - - int offset = 0; - for (pane_i = 0; pane_i < pane_count; ++pane_i) - { - wxAuiPaneInfo& pane = *(dock.panes.Item(pane_i)); - int pane_pos = pane_positions.Item(pane_i); - - if (pane.IsMaximized()) - has_maximized_pane = true; - - - int amount = pane_pos - offset; - if (amount > 0) - { - if (dock.IsVertical()) - sizer_item = dock_sizer->Add(1, amount, 0, wxEXPAND); - else - sizer_item = dock_sizer->Add(amount, 1, 0, wxEXPAND); - - part.type = wxAuiDockUIPart::typeBackground; - part.dock = &dock; - part.pane = NULL; - part.button = NULL; - part.orientation = (orientation==wxHORIZONTAL) ? wxVERTICAL:wxHORIZONTAL; - part.cont_sizer = dock_sizer; - part.sizer_item = sizer_item; - uiparts.Add(part); - - offset += amount; - } - - LayoutAddPane(dock_sizer, dock, pane, uiparts, spacer_only); - - offset += pane_sizes.Item(pane_i); - } - - // at the end add a very small stretchable background area - sizer_item = dock_sizer->Add(0,0, 1, wxEXPAND); - - part.type = wxAuiDockUIPart::typeBackground; - part.dock = &dock; - part.pane = NULL; - part.button = NULL; - part.orientation = orientation; - part.cont_sizer = dock_sizer; - part.sizer_item = sizer_item; - uiparts.Add(part); - } - else - { - for (pane_i = 0; pane_i < pane_count; ++pane_i) - { - wxAuiPaneInfo& pane = *(dock.panes.Item(pane_i)); - - if (pane.IsMaximized()) - has_maximized_pane = true; - - // if this is not the first pane being added, - // we need to add a pane sizer - if (!m_has_maximized && pane_i > 0) - { - sizer_item = dock_sizer->Add(sash_size, sash_size, 0, wxEXPAND); - - part.type = wxAuiDockUIPart::typePaneSizer; - part.dock = &dock; - part.pane = dock.panes.Item(pane_i-1); - part.button = NULL; - part.orientation = (orientation==wxHORIZONTAL) ? wxVERTICAL:wxHORIZONTAL; - part.cont_sizer = dock_sizer; - part.sizer_item = sizer_item; - uiparts.Add(part); - } - - LayoutAddPane(dock_sizer, dock, pane, uiparts, spacer_only); - } - } - - if (dock.dock_direction == wxAUI_DOCK_CENTER || has_maximized_pane) - sizer_item = cont->Add(dock_sizer, 1, wxEXPAND); - else - sizer_item = cont->Add(dock_sizer, 0, wxEXPAND); - - part.type = wxAuiDockUIPart::typeDock; - part.dock = &dock; - part.pane = NULL; - part.button = NULL; - part.orientation = orientation; - part.cont_sizer = cont; - part.sizer_item = sizer_item; - uiparts.Add(part); - - if (dock.IsHorizontal()) - cont->SetItemMinSize(dock_sizer, 0, dock.size); - else - cont->SetItemMinSize(dock_sizer, dock.size, 0); - - // top and left docks have a sash after them - if (!m_has_maximized && - !dock.fixed && - (dock.dock_direction == wxAUI_DOCK_TOP || - dock.dock_direction == wxAUI_DOCK_LEFT)) - { - sizer_item = cont->Add(sash_size, sash_size, 0, wxEXPAND); - - part.type = wxAuiDockUIPart::typeDockSizer; - part.dock = &dock; - part.pane = NULL; - part.button = NULL; - part.orientation = orientation; - part.cont_sizer = cont; - part.sizer_item = sizer_item; - uiparts.Add(part); - } -} - -wxSizer* wxAuiManager::LayoutAll(wxAuiPaneInfoArray& panes, - wxAuiDockInfoArray& docks, - wxAuiDockUIPartArray& uiparts, - bool spacer_only) -{ - wxBoxSizer* container = new wxBoxSizer(wxVERTICAL); - - int pane_border_size = m_art->GetMetric(wxAUI_DOCKART_PANE_BORDER_SIZE); - int caption_size = m_art->GetMetric(wxAUI_DOCKART_CAPTION_SIZE); - wxSize cli_size = m_frame->GetClientSize(); - int i, dock_count, pane_count; - - - // empty all docks out - for (i = 0, dock_count = docks.GetCount(); i < dock_count; ++i) - { - wxAuiDockInfo& dock = docks.Item(i); - - // empty out all panes, as they will be readded below - dock.panes.Empty(); - - if (dock.fixed) - { - // always reset fixed docks' sizes, because - // the contained windows may have been resized - dock.size = 0; - } - } - - - // iterate through all known panes, filing each - // of them into the appropriate dock. If the - // pane does not exist in the dock, add it - for (i = 0, pane_count = panes.GetCount(); i < pane_count; ++i) - { - wxAuiPaneInfo& p = panes.Item(i); - - // find any docks with the same dock direction, dock layer, and - // dock row as the pane we are working on - wxAuiDockInfo* dock; - wxAuiDockInfoPtrArray arr; - FindDocks(docks, p.dock_direction, p.dock_layer, p.dock_row, arr); - - if (arr.GetCount() > 0) - { - // found the right dock - dock = arr.Item(0); - } - else - { - // dock was not found, so we need to create a new one - wxAuiDockInfo d; - d.dock_direction = p.dock_direction; - d.dock_layer = p.dock_layer; - d.dock_row = p.dock_row; - docks.Add(d); - dock = &docks.Last(); - } - - - if (p.IsDocked() && p.IsShown()) - { - // remove the pane from any existing docks except this one - RemovePaneFromDocks(docks, p, dock); - - // pane needs to be added to the dock, - // if it doesn't already exist - if (!FindPaneInDock(*dock, p.window)) - dock->panes.Add(&p); - } - else - { - // remove the pane from any existing docks - RemovePaneFromDocks(docks, p); - } - - } - - // remove any empty docks - for (i = docks.GetCount()-1; i >= 0; --i) - { - if (docks.Item(i).panes.GetCount() == 0) - docks.RemoveAt(i); - } - - // configure the docks further - for (i = 0, dock_count = docks.GetCount(); i < dock_count; ++i) - { - wxAuiDockInfo& dock = docks.Item(i); - int j, dock_pane_count = dock.panes.GetCount(); - - // sort the dock pane array by the pane's - // dock position (dock_pos), in ascending order - dock.panes.Sort(PaneSortFunc); - - // for newly created docks, set up their initial size - if (dock.size == 0) - { - int size = 0; - - for (j = 0; j < dock_pane_count; ++j) - { - wxAuiPaneInfo& pane = *dock.panes.Item(j); - wxSize pane_size = pane.best_size; - if (pane_size == wxDefaultSize) - pane_size = pane.min_size; - if (pane_size == wxDefaultSize) - pane_size = pane.window->GetSize(); - - if (dock.IsHorizontal()) - size = wxMax(pane_size.y, size); - else - size = wxMax(pane_size.x, size); - } - - // add space for the border (two times), but only - // if at least one pane inside the dock has a pane border - for (j = 0; j < dock_pane_count; ++j) - { - if (dock.panes.Item(j)->HasBorder()) - { - size += (pane_border_size*2); - break; - } - } - - // if pane is on the top or bottom, add the caption height, - // but only if at least one pane inside the dock has a caption - if (dock.IsHorizontal()) - { - for (j = 0; j < dock_pane_count; ++j) - { - if (dock.panes.Item(j)->HasCaption()) - { - size += caption_size; - break; - } - } - } - - - // new dock's size may not be more than the dock constraint - // parameter specifies. See SetDockSizeConstraint() - - int max_dock_x_size = (int)(m_dock_constraint_x * ((double)cli_size.x)); - int max_dock_y_size = (int)(m_dock_constraint_y * ((double)cli_size.y)); - - if (dock.IsHorizontal()) - size = wxMin(size, max_dock_y_size); - else - size = wxMin(size, max_dock_x_size); - - // absolute minimum size for a dock is 10 pixels - if (size < 10) - size = 10; - - dock.size = size; - } - - - // determine the dock's minimum size - bool plus_border = false; - bool plus_caption = false; - int dock_min_size = 0; - for (j = 0; j < dock_pane_count; ++j) - { - wxAuiPaneInfo& pane = *dock.panes.Item(j); - if (pane.min_size != wxDefaultSize) - { - if (pane.HasBorder()) - plus_border = true; - if (pane.HasCaption()) - plus_caption = true; - if (dock.IsHorizontal()) - { - if (pane.min_size.y > dock_min_size) - dock_min_size = pane.min_size.y; - } - else - { - if (pane.min_size.x > dock_min_size) - dock_min_size = pane.min_size.x; - } - } - } - - if (plus_border) - dock_min_size += (pane_border_size*2); - if (plus_caption && dock.IsHorizontal()) - dock_min_size += (caption_size); - - dock.min_size = dock_min_size; - - - // if the pane's current size is less than it's - // minimum, increase the dock's size to it's minimum - if (dock.size < dock.min_size) - dock.size = dock.min_size; - - - // determine the dock's mode (fixed or proportional); - // determine whether the dock has only toolbars - bool action_pane_marked = false; - dock.fixed = true; - dock.toolbar = true; - for (j = 0; j < dock_pane_count; ++j) - { - wxAuiPaneInfo& pane = *dock.panes.Item(j); - if (!pane.IsFixed()) - dock.fixed = false; - if (!pane.IsToolbar()) - dock.toolbar = false; - if (pane.HasFlag(wxAuiPaneInfo::optionDockFixed)) - dock.fixed = true; - if (pane.state & wxAuiPaneInfo::actionPane) - action_pane_marked = true; - } - - - // if the dock mode is proportional and not fixed-pixel, - // reassign the dock_pos to the sequential 0, 1, 2, 3; - // e.g. remove gaps like 1, 2, 30, 500 - if (!dock.fixed) - { - for (j = 0; j < dock_pane_count; ++j) - { - wxAuiPaneInfo& pane = *dock.panes.Item(j); - pane.dock_pos = j; - } - } - - // if the dock mode is fixed, and none of the panes - // are being moved right now, make sure the panes - // do not overlap each other. If they do, we will - // adjust the positions of the panes - if (dock.fixed && !action_pane_marked) - { - wxArrayInt pane_positions, pane_sizes; - GetPanePositionsAndSizes(dock, pane_positions, pane_sizes); - - int offset = 0; - for (j = 0; j < dock_pane_count; ++j) - { - wxAuiPaneInfo& pane = *(dock.panes.Item(j)); - pane.dock_pos = pane_positions[j]; - - int amount = pane.dock_pos - offset; - if (amount >= 0) - offset += amount; - else - pane.dock_pos += -amount; - - offset += pane_sizes[j]; - } - } - } - - // discover the maximum dock layer - int max_layer = 0; - for (i = 0; i < dock_count; ++i) - max_layer = wxMax(max_layer, docks.Item(i).dock_layer); - - - // clear out uiparts - uiparts.Empty(); - - // create a bunch of box sizers, - // from the innermost level outwards. - wxSizer* cont = NULL; - wxSizer* middle = NULL; - int layer = 0; - int row, row_count; - - for (layer = 0; layer <= max_layer; ++layer) - { - wxAuiDockInfoPtrArray arr; - - // find any docks in this layer - FindDocks(docks, -1, layer, -1, arr); - - // if there aren't any, skip to the next layer - if (arr.IsEmpty()) - continue; - - wxSizer* old_cont = cont; - - // create a container which will hold this layer's - // docks (top, bottom, left, right) - cont = new wxBoxSizer(wxVERTICAL); - - - // find any top docks in this layer - FindDocks(docks, wxAUI_DOCK_TOP, layer, -1, arr); - if (!arr.IsEmpty()) - { - for (row = 0, row_count = arr.GetCount(); row < row_count; ++row) - LayoutAddDock(cont, *arr.Item(row), uiparts, spacer_only); - } - - - // fill out the middle layer (which consists - // of left docks, content area and right docks) - - middle = new wxBoxSizer(wxHORIZONTAL); - - // find any left docks in this layer - FindDocks(docks, wxAUI_DOCK_LEFT, layer, -1, arr); - if (!arr.IsEmpty()) - { - for (row = 0, row_count = arr.GetCount(); row < row_count; ++row) - LayoutAddDock(middle, *arr.Item(row), uiparts, spacer_only); - } - - // add content dock (or previous layer's sizer - // to the middle - if (!old_cont) - { - // find any center docks - FindDocks(docks, wxAUI_DOCK_CENTER, -1, -1, arr); - if (!arr.IsEmpty()) - { - for (row = 0,row_count = arr.GetCount(); rowAdd(1,1, 1, wxEXPAND); - wxAuiDockUIPart part; - part.type = wxAuiDockUIPart::typeBackground; - part.pane = NULL; - part.dock = NULL; - part.button = NULL; - part.cont_sizer = middle; - part.sizer_item = sizer_item; - uiparts.Add(part); - } - } - else - { - middle->Add(old_cont, 1, wxEXPAND); - } - - // find any right docks in this layer - FindDocks(docks, wxAUI_DOCK_RIGHT, layer, -1, arr); - if (!arr.IsEmpty()) - { - for (row = arr.GetCount()-1; row >= 0; --row) - LayoutAddDock(middle, *arr.Item(row), uiparts, spacer_only); - } - - if (middle->GetChildren().GetCount() > 0) - cont->Add(middle, 1, wxEXPAND); - else - delete middle; - - - - // find any bottom docks in this layer - FindDocks(docks, wxAUI_DOCK_BOTTOM, layer, -1, arr); - if (!arr.IsEmpty()) - { - for (row = arr.GetCount()-1; row >= 0; --row) - LayoutAddDock(cont, *arr.Item(row), uiparts, spacer_only); - } - - } - - if (!cont) - { - // no sizer available, because there are no docks, - // therefore we will create a simple background area - cont = new wxBoxSizer(wxVERTICAL); - wxSizerItem* sizer_item = cont->Add(1,1, 1, wxEXPAND); - wxAuiDockUIPart part; - part.type = wxAuiDockUIPart::typeBackground; - part.pane = NULL; - part.dock = NULL; - part.button = NULL; - part.cont_sizer = middle; - part.sizer_item = sizer_item; - uiparts.Add(part); - } - - container->Add(cont, 1, wxEXPAND); - return container; -} - - -// SetDockSizeConstraint() allows the dock constraints to be set. For example, -// specifying values of 0.5, 0.5 will mean that upon dock creation, a dock may -// not be larger than half of the window's size - -void wxAuiManager::SetDockSizeConstraint(double width_pct, double height_pct) -{ - m_dock_constraint_x = wxMax(0.0, wxMin(1.0, width_pct)); - m_dock_constraint_y = wxMax(0.0, wxMin(1.0, height_pct)); -} - -void wxAuiManager::GetDockSizeConstraint(double* width_pct, double* height_pct) const -{ - if (width_pct) - *width_pct = m_dock_constraint_x; - - if (height_pct) - *height_pct = m_dock_constraint_y; -} - - - -// Update() updates the layout. Whenever changes are made to -// one or more panes, this function should be called. It is the -// external entry point for running the layout engine. - -void wxAuiManager::Update() -{ - m_hover_button = NULL; - m_action_part = NULL; - - wxSizer* sizer; - int i, pane_count = m_panes.GetCount(); - - - // destroy floating panes which have been - // redocked or are becoming non-floating - for (i = 0; i < pane_count; ++i) - { - wxAuiPaneInfo& p = m_panes.Item(i); - - if (!p.IsFloating() && p.frame) - { - // because the pane is no longer in a floating, we need to - // reparent it to m_frame and destroy the floating frame - - // reduce flicker - p.window->SetSize(1,1); - - - // the following block is a workaround for bug #1531361 - // (see wxWidgets sourceforge page). On wxGTK (only), when - // a frame is shown/hidden, a move event unfortunately - // also gets fired. Because we may be dragging around - // a pane, we need to cancel that action here to prevent - // a spurious crash. - if (m_action_window == p.frame) - { - if (wxWindow::GetCapture() == m_frame) - m_frame->ReleaseMouse(); - m_action = actionNone; - m_action_window = NULL; - } - - // hide the frame - if (p.frame->IsShown()) - p.frame->Show(false); - - // reparent to m_frame and destroy the pane - if (m_action_window == p.frame) - { - m_action_window = NULL; - } - - p.window->Reparent(m_frame); - p.frame->SetSizer(NULL); - p.frame->Destroy(); - p.frame = NULL; - } - } - - - // delete old sizer first - m_frame->SetSizer(NULL); - - // create a layout for all of the panes - sizer = LayoutAll(m_panes, m_docks, m_uiparts, false); - - // hide or show panes as necessary, - // and float panes as necessary - for (i = 0; i < pane_count; ++i) - { - wxAuiPaneInfo& p = m_panes.Item(i); - - if (p.IsFloating()) - { - if (p.frame == NULL) - { - // we need to create a frame for this - // pane, which has recently been floated - wxAuiFloatingFrame* frame = CreateFloatingFrame(m_frame, p); - - // on MSW and Mac, if the owner desires transparent dragging, and - // the dragging is happening right now, then the floating - // window should have this style by default - if (m_action == actionDragFloatingPane && - (m_flags & wxAUI_MGR_TRANSPARENT_DRAG)) - frame->SetTransparent(150); - - frame->SetPaneWindow(p); - p.frame = frame; - - if (p.IsShown() && !frame->IsShown()) - frame->Show(); - } - else - { - // frame already exists, make sure it's position - // and size reflect the information in wxAuiPaneInfo - if ((p.frame->GetPosition() != p.floating_pos) || (p.frame->GetSize() != p.floating_size)) - { - p.frame->SetSize(p.floating_pos.x, p.floating_pos.y, - p.floating_size.x, p.floating_size.y, - wxSIZE_USE_EXISTING); - /* - p.frame->SetSize(p.floating_pos.x, p.floating_pos.y, - wxDefaultCoord, wxDefaultCoord, - wxSIZE_USE_EXISTING); - //p.frame->Move(p.floating_pos.x, p.floating_pos.y); - */ - } - - if (p.frame->IsShown() != p.IsShown()) - p.frame->Show(p.IsShown()); - } - } - else - { - if (p.window->IsShown() != p.IsShown()) - p.window->Show(p.IsShown()); - } - - // if "active panes" are no longer allowed, clear - // any optionActive values from the pane states - if ((m_flags & wxAUI_MGR_ALLOW_ACTIVE_PANE) == 0) - { - p.state &= ~wxAuiPaneInfo::optionActive; - } - } - - - // keep track of the old window rectangles so we can - // refresh those windows whose rect has changed - wxAuiRectArray old_pane_rects; - for (i = 0; i < pane_count; ++i) - { - wxRect r; - wxAuiPaneInfo& p = m_panes.Item(i); - - if (p.window && p.IsShown() && p.IsDocked()) - r = p.rect; - - old_pane_rects.Add(r); - } - - - - - // apply the new sizer - m_frame->SetSizer(sizer); - m_frame->SetAutoLayout(false); - DoFrameLayout(); - - - - // now that the frame layout is done, we need to check - // the new pane rectangles against the old rectangles that - // we saved a few lines above here. If the rectangles have - // changed, the corresponding panes must also be updated - for (i = 0; i < pane_count; ++i) - { - wxAuiPaneInfo& p = m_panes.Item(i); - if (p.window && p.window->IsShown() && p.IsDocked()) - { - if (p.rect != old_pane_rects[i]) - { - p.window->Refresh(); - p.window->Update(); - } - } - } - - - Repaint(); - - // set frame's minimum size - -/* - // N.B. More work needs to be done on frame minimum sizes; - // this is some intresting code that imposes the minimum size, - // but we may want to include a more flexible mechanism or - // options for multiple minimum-size modes, e.g. strict or lax - wxSize min_size = sizer->GetMinSize(); - wxSize frame_size = m_frame->GetSize(); - wxSize client_size = m_frame->GetClientSize(); - - wxSize minframe_size(min_size.x+frame_size.x-client_size.x, - min_size.y+frame_size.y-client_size.y ); - - m_frame->SetMinSize(minframe_size); - - if (frame_size.x < minframe_size.x || - frame_size.y < minframe_size.y) - sizer->Fit(m_frame); -*/ -} - - -// DoFrameLayout() is an internal function which invokes wxSizer::Layout -// on the frame's main sizer, then measures all the various UI items -// and updates their internal rectangles. This should always be called -// instead of calling m_frame->Layout() directly - -void wxAuiManager::DoFrameLayout() -{ - m_frame->Layout(); - - int i, part_count; - for (i = 0, part_count = m_uiparts.GetCount(); i < part_count; ++i) - { - wxAuiDockUIPart& part = m_uiparts.Item(i); - - // get the rectangle of the UI part - // originally, this code looked like this: - // part.rect = wxRect(part.sizer_item->GetPosition(), - // part.sizer_item->GetSize()); - // this worked quite well, with one exception: the mdi - // client window had a "deferred" size variable - // that returned the wrong size. It looks like - // a bug in wx, because the former size of the window - // was being returned. So, we will retrieve the part's - // rectangle via other means - - - part.rect = part.sizer_item->GetRect(); - int flag = part.sizer_item->GetFlag(); - int border = part.sizer_item->GetBorder(); - if (flag & wxTOP) - { - part.rect.y -= border; - part.rect.height += border; - } - if (flag & wxLEFT) - { - part.rect.x -= border; - part.rect.width += border; - } - if (flag & wxBOTTOM) - part.rect.height += border; - if (flag & wxRIGHT) - part.rect.width += border; - - - if (part.type == wxAuiDockUIPart::typeDock) - part.dock->rect = part.rect; - if (part.type == wxAuiDockUIPart::typePane) - part.pane->rect = part.rect; - } -} - -// GetPanePart() looks up the pane the pane border UI part (or the regular -// pane part if there is no border). This allows the caller to get the exact -// rectangle of the pane in question, including decorations like -// caption and border (if any). - -wxAuiDockUIPart* wxAuiManager::GetPanePart(wxWindow* wnd) -{ - int i, part_count; - for (i = 0, part_count = m_uiparts.GetCount(); i < part_count; ++i) - { - wxAuiDockUIPart& part = m_uiparts.Item(i); - if (part.type == wxAuiDockUIPart::typePaneBorder && - part.pane && part.pane->window == wnd) - return ∂ - } - for (i = 0, part_count = m_uiparts.GetCount(); i < part_count; ++i) - { - wxAuiDockUIPart& part = m_uiparts.Item(i); - if (part.type == wxAuiDockUIPart::typePane && - part.pane && part.pane->window == wnd) - return ∂ - } - return NULL; -} - - - -// GetDockPixelOffset() is an internal function which returns -// a dock's offset in pixels from the left side of the window -// (for horizontal docks) or from the top of the window (for -// vertical docks). This value is necessary for calculating -// fixel-pane/toolbar offsets when they are dragged. - -int wxAuiManager::GetDockPixelOffset(wxAuiPaneInfo& test) -{ - // the only way to accurately calculate the dock's - // offset is to actually run a theoretical layout - - int i, part_count, dock_count; - wxAuiDockInfoArray docks; - wxAuiPaneInfoArray panes; - wxAuiDockUIPartArray uiparts; - CopyDocksAndPanes(docks, panes, m_docks, m_panes); - panes.Add(test); - - wxSizer* sizer = LayoutAll(panes, docks, uiparts, true); - wxSize client_size = m_frame->GetClientSize(); - sizer->SetDimension(0, 0, client_size.x, client_size.y); - sizer->Layout(); - - for (i = 0, part_count = uiparts.GetCount(); i < part_count; ++i) - { - wxAuiDockUIPart& part = uiparts.Item(i); - part.rect = wxRect(part.sizer_item->GetPosition(), - part.sizer_item->GetSize()); - if (part.type == wxAuiDockUIPart::typeDock) - part.dock->rect = part.rect; - } - - delete sizer; - - for (i = 0, dock_count = docks.GetCount(); i < dock_count; ++i) - { - wxAuiDockInfo& dock = docks.Item(i); - if (test.dock_direction == dock.dock_direction && - test.dock_layer==dock.dock_layer && test.dock_row==dock.dock_row) - { - if (dock.IsVertical()) - return dock.rect.y; - else - return dock.rect.x; - } - } - - return 0; -} - - - -// ProcessDockResult() is a utility function used by DoDrop() - it checks -// if a dock operation is allowed, the new dock position is copied into -// the target info. If the operation was allowed, the function returns true. - -bool wxAuiManager::ProcessDockResult(wxAuiPaneInfo& target, - const wxAuiPaneInfo& new_pos) -{ - bool allowed = false; - switch (new_pos.dock_direction) - { - case wxAUI_DOCK_TOP: allowed = target.IsTopDockable(); break; - case wxAUI_DOCK_BOTTOM: allowed = target.IsBottomDockable(); break; - case wxAUI_DOCK_LEFT: allowed = target.IsLeftDockable(); break; - case wxAUI_DOCK_RIGHT: allowed = target.IsRightDockable(); break; - } - - if (allowed) - target = new_pos; - - return allowed; -} - - -// DoDrop() is an important function. It basically takes a mouse position, -// and determines where the pane's new position would be. If the pane is to be -// dropped, it performs the drop operation using the specified dock and pane -// arrays. By specifying copied dock and pane arrays when calling, a "what-if" -// scenario can be performed, giving precise coordinates for drop hints. -// If, however, wxAuiManager:m_docks and wxAuiManager::m_panes are specified -// as parameters, the changes will be made to the main state arrays - -const int auiInsertRowPixels = 10; -const int auiNewRowPixels = 40; -const int auiLayerInsertPixels = 40; -const int auiLayerInsertOffset = 5; - -bool wxAuiManager::DoDrop(wxAuiDockInfoArray& docks, - wxAuiPaneInfoArray& panes, - wxAuiPaneInfo& target, - const wxPoint& pt, - const wxPoint& offset) -{ - wxSize cli_size = m_frame->GetClientSize(); - - wxAuiPaneInfo drop = target; - - - // The result should always be shown - drop.Show(); - - - // Check to see if the pane has been dragged outside of the window - // (or near to the outside of the window), if so, dock it along the edge - - - int layer_insert_offset = auiLayerInsertOffset; - if (drop.IsToolbar()) - layer_insert_offset = 0; - - - if (pt.x < layer_insert_offset && - pt.x > layer_insert_offset-auiLayerInsertPixels) - { - int new_layer = wxMax(wxMax(GetMaxLayer(docks, wxAUI_DOCK_LEFT), - GetMaxLayer(docks, wxAUI_DOCK_BOTTOM)), - GetMaxLayer(docks, wxAUI_DOCK_TOP)) + 1; - - if (drop.IsToolbar()) - new_layer = auiToolBarLayer; - - drop.Dock().Left(). - Layer(new_layer). - Row(0). - Position(pt.y - GetDockPixelOffset(drop) - offset.y); - return ProcessDockResult(target, drop); - } - else if (pt.y < layer_insert_offset && - pt.y > layer_insert_offset-auiLayerInsertPixels) - { - int new_layer = wxMax(wxMax(GetMaxLayer(docks, wxAUI_DOCK_TOP), - GetMaxLayer(docks, wxAUI_DOCK_LEFT)), - GetMaxLayer(docks, wxAUI_DOCK_RIGHT)) + 1; - - if (drop.IsToolbar()) - new_layer = auiToolBarLayer; - - drop.Dock().Top(). - Layer(new_layer). - Row(0). - Position(pt.x - GetDockPixelOffset(drop) - offset.x); - return ProcessDockResult(target, drop); - } - else if (pt.x >= cli_size.x - layer_insert_offset && - pt.x < cli_size.x - layer_insert_offset + auiLayerInsertPixels) - { - int new_layer = wxMax(wxMax(GetMaxLayer(docks, wxAUI_DOCK_RIGHT), - GetMaxLayer(docks, wxAUI_DOCK_TOP)), - GetMaxLayer(docks, wxAUI_DOCK_BOTTOM)) + 1; - - if (drop.IsToolbar()) - new_layer = auiToolBarLayer; - - drop.Dock().Right(). - Layer(new_layer). - Row(0). - Position(pt.y - GetDockPixelOffset(drop) - offset.y); - return ProcessDockResult(target, drop); - } - else if (pt.y >= cli_size.y - layer_insert_offset && - pt.y < cli_size.y - layer_insert_offset + auiLayerInsertPixels) - { - int new_layer = wxMax( wxMax( GetMaxLayer(docks, wxAUI_DOCK_BOTTOM), - GetMaxLayer(docks, wxAUI_DOCK_LEFT)), - GetMaxLayer(docks, wxAUI_DOCK_RIGHT)) + 1; - - if (drop.IsToolbar()) - new_layer = auiToolBarLayer; - - drop.Dock().Bottom(). - Layer(new_layer). - Row(0). - Position(pt.x - GetDockPixelOffset(drop) - offset.x); - return ProcessDockResult(target, drop); - } - - - wxAuiDockUIPart* part = HitTest(pt.x, pt.y); - - - if (drop.IsToolbar()) - { - if (!part || !part->dock) - return false; - - // calculate the offset from where the dock begins - // to the point where the user dropped the pane - int dock_drop_offset = 0; - if (part->dock->IsHorizontal()) - dock_drop_offset = pt.x - part->dock->rect.x - offset.x; - else - dock_drop_offset = pt.y - part->dock->rect.y - offset.y; - - - // toolbars may only be moved in and to fixed-pane docks, - // otherwise we will try to float the pane. Also, the pane - // should float if being dragged over center pane windows - if (!part->dock->fixed || part->dock->dock_direction == wxAUI_DOCK_CENTER || - pt.x >= cli_size.x || pt.x <= 0 || pt.y >= cli_size.y || pt.y <= 0) - { - if (m_last_rect.IsEmpty() || m_last_rect.Contains(pt.x, pt.y )) - { - m_skipping = true; - } - else - { - if ((m_flags & wxAUI_MGR_ALLOW_FLOATING) && drop.IsFloatable()) - { - drop.Float(); - } - - m_skipping = false; - - return ProcessDockResult(target, drop); - } - - drop.Position(pt.x - GetDockPixelOffset(drop) - offset.x); - - return ProcessDockResult(target, drop); - } - else - { - m_skipping = false; - } - - if (!m_skipping) - { - m_last_rect = part->dock->rect; - m_last_rect.Inflate( 15, 15 ); - } - - drop.Dock(). - Direction(part->dock->dock_direction). - Layer(part->dock->dock_layer). - Row(part->dock->dock_row). - Position(dock_drop_offset); - - if (( - ((pt.y < part->dock->rect.y + 1) && part->dock->IsHorizontal()) || - ((pt.x < part->dock->rect.x + 1) && part->dock->IsVertical()) - ) && part->dock->panes.GetCount() > 1) - { - if ((part->dock->dock_direction == wxAUI_DOCK_TOP) || - (part->dock->dock_direction == wxAUI_DOCK_LEFT)) - { - int row = drop.dock_row; - DoInsertDockRow(panes, part->dock->dock_direction, - part->dock->dock_layer, - part->dock->dock_row); - drop.dock_row = row; - } - else - { - DoInsertDockRow(panes, part->dock->dock_direction, - part->dock->dock_layer, - part->dock->dock_row+1); - drop.dock_row = part->dock->dock_row+1; - } - } - - if (( - ((pt.y > part->dock->rect.y + part->dock->rect.height - 2 ) && part->dock->IsHorizontal()) || - ((pt.x > part->dock->rect.x + part->dock->rect.width - 2 ) && part->dock->IsVertical()) - ) && part->dock->panes.GetCount() > 1) - { - if ((part->dock->dock_direction == wxAUI_DOCK_TOP) || - (part->dock->dock_direction == wxAUI_DOCK_LEFT)) - { - DoInsertDockRow(panes, part->dock->dock_direction, - part->dock->dock_layer, - part->dock->dock_row+1); - drop.dock_row = part->dock->dock_row+1; - } - else - { - int row = drop.dock_row; - DoInsertDockRow(panes, part->dock->dock_direction, - part->dock->dock_layer, - part->dock->dock_row); - drop.dock_row = row; - } - } - - return ProcessDockResult(target, drop); - } - - - - - if (!part) - return false; - - if (part->type == wxAuiDockUIPart::typePaneBorder || - part->type == wxAuiDockUIPart::typeCaption || - part->type == wxAuiDockUIPart::typeGripper || - part->type == wxAuiDockUIPart::typePaneButton || - part->type == wxAuiDockUIPart::typePane || - part->type == wxAuiDockUIPart::typePaneSizer || - part->type == wxAuiDockUIPart::typeDockSizer || - part->type == wxAuiDockUIPart::typeBackground) - { - if (part->type == wxAuiDockUIPart::typeDockSizer) - { - if (part->dock->panes.GetCount() != 1) - return false; - part = GetPanePart(part->dock->panes.Item(0)->window); - if (!part) - return false; - } - - - - // If a normal frame is being dragged over a toolbar, insert it - // along the edge under the toolbar, but over all other panes. - // (this could be done much better, but somehow factoring this - // calculation with the one at the beginning of this function) - if (part->dock && part->dock->toolbar) - { - int layer = 0; - - switch (part->dock->dock_direction) - { - case wxAUI_DOCK_LEFT: - layer = wxMax(wxMax(GetMaxLayer(docks, wxAUI_DOCK_LEFT), - GetMaxLayer(docks, wxAUI_DOCK_BOTTOM)), - GetMaxLayer(docks, wxAUI_DOCK_TOP)); - break; - case wxAUI_DOCK_TOP: - layer = wxMax(wxMax(GetMaxLayer(docks, wxAUI_DOCK_TOP), - GetMaxLayer(docks, wxAUI_DOCK_LEFT)), - GetMaxLayer(docks, wxAUI_DOCK_RIGHT)); - break; - case wxAUI_DOCK_RIGHT: - layer = wxMax(wxMax(GetMaxLayer(docks, wxAUI_DOCK_RIGHT), - GetMaxLayer(docks, wxAUI_DOCK_TOP)), - GetMaxLayer(docks, wxAUI_DOCK_BOTTOM)); - break; - case wxAUI_DOCK_BOTTOM: - layer = wxMax(wxMax(GetMaxLayer(docks, wxAUI_DOCK_BOTTOM), - GetMaxLayer(docks, wxAUI_DOCK_LEFT)), - GetMaxLayer(docks, wxAUI_DOCK_RIGHT)); - break; - } - - DoInsertDockRow(panes, part->dock->dock_direction, - layer, 0); - drop.Dock(). - Direction(part->dock->dock_direction). - Layer(layer).Row(0).Position(0); - return ProcessDockResult(target, drop); - } - - - if (!part->pane) - return false; - - part = GetPanePart(part->pane->window); - if (!part) - return false; - - bool insert_dock_row = false; - int insert_row = part->pane->dock_row; - int insert_dir = part->pane->dock_direction; - int insert_layer = part->pane->dock_layer; - - switch (part->pane->dock_direction) - { - case wxAUI_DOCK_TOP: - if (pt.y >= part->rect.y && - pt.y < part->rect.y+auiInsertRowPixels) - insert_dock_row = true; - break; - case wxAUI_DOCK_BOTTOM: - if (pt.y > part->rect.y+part->rect.height-auiInsertRowPixels && - pt.y <= part->rect.y + part->rect.height) - insert_dock_row = true; - break; - case wxAUI_DOCK_LEFT: - if (pt.x >= part->rect.x && - pt.x < part->rect.x+auiInsertRowPixels) - insert_dock_row = true; - break; - case wxAUI_DOCK_RIGHT: - if (pt.x > part->rect.x+part->rect.width-auiInsertRowPixels && - pt.x <= part->rect.x+part->rect.width) - insert_dock_row = true; - break; - case wxAUI_DOCK_CENTER: - { - // "new row pixels" will be set to the default, but - // must never exceed 20% of the window size - int new_row_pixels_x = auiNewRowPixels; - int new_row_pixels_y = auiNewRowPixels; - - if (new_row_pixels_x > (part->rect.width*20)/100) - new_row_pixels_x = (part->rect.width*20)/100; - - if (new_row_pixels_y > (part->rect.height*20)/100) - new_row_pixels_y = (part->rect.height*20)/100; - - - // determine if the mouse pointer is in a location that - // will cause a new row to be inserted. The hot spot positions - // are along the borders of the center pane - - insert_layer = 0; - insert_dock_row = true; - if (pt.x >= part->rect.x && - pt.x < part->rect.x+new_row_pixels_x) - insert_dir = wxAUI_DOCK_LEFT; - else - if (pt.y >= part->rect.y && - pt.y < part->rect.y+new_row_pixels_y) - insert_dir = wxAUI_DOCK_TOP; - else - if (pt.x >= part->rect.x + part->rect.width-new_row_pixels_x && - pt.x < part->rect.x + part->rect.width) - insert_dir = wxAUI_DOCK_RIGHT; - else - if (pt.y >= part->rect.y+ part->rect.height-new_row_pixels_y && - pt.y < part->rect.y + part->rect.height) - insert_dir = wxAUI_DOCK_BOTTOM; - else - return false; - - insert_row = GetMaxRow(panes, insert_dir, insert_layer) + 1; - } - } - - if (insert_dock_row) - { - DoInsertDockRow(panes, insert_dir, insert_layer, insert_row); - drop.Dock().Direction(insert_dir). - Layer(insert_layer). - Row(insert_row). - Position(0); - return ProcessDockResult(target, drop); - } - - // determine the mouse offset and the pane size, both in the - // direction of the dock itself, and perpendicular to the dock - - int offset, size; - - if (part->orientation == wxVERTICAL) - { - offset = pt.y - part->rect.y; - size = part->rect.GetHeight(); - } - else - { - offset = pt.x - part->rect.x; - size = part->rect.GetWidth(); - } - - int drop_position = part->pane->dock_pos; - - // if we are in the top/left part of the pane, - // insert the pane before the pane being hovered over - if (offset <= size/2) - { - drop_position = part->pane->dock_pos; - DoInsertPane(panes, - part->pane->dock_direction, - part->pane->dock_layer, - part->pane->dock_row, - part->pane->dock_pos); - } - - // if we are in the bottom/right part of the pane, - // insert the pane before the pane being hovered over - if (offset > size/2) - { - drop_position = part->pane->dock_pos+1; - DoInsertPane(panes, - part->pane->dock_direction, - part->pane->dock_layer, - part->pane->dock_row, - part->pane->dock_pos+1); - } - - drop.Dock(). - Direction(part->dock->dock_direction). - Layer(part->dock->dock_layer). - Row(part->dock->dock_row). - Position(drop_position); - return ProcessDockResult(target, drop); - } - - return false; -} - - -void wxAuiManager::OnHintFadeTimer(wxTimerEvent& WXUNUSED(event)) -{ - if (!m_hint_wnd || m_hint_fadeamt >= m_hint_fademax) - { - m_hint_fadetimer.Stop(); - return; - } - - m_hint_fadeamt += 4; - m_hint_wnd->SetTransparent(m_hint_fadeamt); -} - -void wxAuiManager::ShowHint(const wxRect& rect) -{ - if (m_hint_wnd) - { - // if the hint rect is the same as last time, don't do anything - if (m_last_hint == rect) - return; - m_last_hint = rect; - - m_hint_fadeamt = m_hint_fademax; - - if ((m_flags & wxAUI_MGR_HINT_FADE) - && !((m_hint_wnd->IsKindOf(CLASSINFO(wxPseudoTransparentFrame))) && - (m_flags & wxAUI_MGR_NO_VENETIAN_BLINDS_FADE)) - ) - m_hint_fadeamt = 0; - - m_hint_wnd->SetSize(rect); - m_hint_wnd->SetTransparent(m_hint_fadeamt); - - if (!m_hint_wnd->IsShown()) - m_hint_wnd->Show(); - - // if we are dragging a floating pane, set the focus - // back to that floating pane (otherwise it becomes unfocused) - if (m_action == actionDragFloatingPane && m_action_window) - m_action_window->SetFocus(); - - m_hint_wnd->Raise(); - - - if (m_hint_fadeamt != m_hint_fademax) // Only fade if we need to - { - // start fade in timer - m_hint_fadetimer.SetOwner(this, 101); - m_hint_fadetimer.Start(5); - } - } - else // Not using a transparent hint window... - { - if (!(m_flags & wxAUI_MGR_RECTANGLE_HINT)) - return; - - if (m_last_hint != rect) - { - // remove the last hint rectangle - m_last_hint = rect; - m_frame->Refresh(); - m_frame->Update(); - } - - wxScreenDC screendc; - wxRegion clip(1, 1, 10000, 10000); - - // clip all floating windows, so we don't draw over them - int i, pane_count; - for (i = 0, pane_count = m_panes.GetCount(); i < pane_count; ++i) - { - wxAuiPaneInfo& pane = m_panes.Item(i); - - if (pane.IsFloating() && - pane.frame->IsShown()) - { - wxRect rect = pane.frame->GetRect(); -#ifdef __WXGTK__ - // wxGTK returns the client size, not the whole frame size - rect.width += 15; - rect.height += 35; - rect.Inflate(5); -#endif - - clip.Subtract(rect); - } - } - - // As we can only hide the hint by redrawing the managed window, we - // need to clip the region to the managed window too or we get - // nasty redrawn problems. - clip.Intersect(m_frame->GetRect()); - - screendc.SetClippingRegion(clip); - - wxBitmap stipple = wxPaneCreateStippleBitmap(); - wxBrush brush(stipple); - screendc.SetBrush(brush); - screendc.SetPen(*wxTRANSPARENT_PEN); - - screendc.DrawRectangle(rect.x, rect.y, 5, rect.height); - screendc.DrawRectangle(rect.x+5, rect.y, rect.width-10, 5); - screendc.DrawRectangle(rect.x+rect.width-5, rect.y, 5, rect.height); - screendc.DrawRectangle(rect.x+5, rect.y+rect.height-5, rect.width-10, 5); - } -} - -void wxAuiManager::HideHint() -{ - // hides a transparent window hint, if there is one - if (m_hint_wnd) - { - if (m_hint_wnd->IsShown()) - m_hint_wnd->Show(false); - m_hint_wnd->SetTransparent(0); - m_hint_fadetimer.Stop(); - m_last_hint = wxRect(); - return; - } - - // hides a painted hint by redrawing the frame window - if (!m_last_hint.IsEmpty()) - { - m_frame->Refresh(); - m_frame->Update(); - m_last_hint = wxRect(); - } -} - - - -void wxAuiManager::StartPaneDrag(wxWindow* pane_window, - const wxPoint& offset) -{ - wxAuiPaneInfo& pane = GetPane(pane_window); - if (!pane.IsOk()) - return; - - if (pane.IsToolbar()) - { - m_action = actionDragToolbarPane; - } - else - { - m_action = actionDragFloatingPane; - } - - m_action_window = pane_window; - m_action_offset = offset; - m_frame->CaptureMouse(); -} - - -// CalculateHintRect() calculates the drop hint rectangle. The method -// first calls DoDrop() to determine the exact position the pane would -// be at were if dropped. If the pane would indeed become docked at the -// specified drop point, the the rectangle hint will be returned in -// screen coordinates. Otherwise, an empty rectangle is returned. -// |pane_window| is the window pointer of the pane being dragged, |pt| is -// the mouse position, in client coordinates. |offset| describes the offset -// that the mouse is from the upper-left corner of the item being dragged - -wxRect wxAuiManager::CalculateHintRect(wxWindow* pane_window, - const wxPoint& pt, - const wxPoint& offset) -{ - wxRect rect; - - // we need to paint a hint rectangle; to find out the exact hint rectangle, - // we will create a new temporary layout and then measure the resulting - // rectangle; we will create a copy of the docking structures (m_dock) - // so that we don't modify the real thing on screen - - int i, pane_count, part_count; - wxAuiDockInfoArray docks; - wxAuiPaneInfoArray panes; - wxAuiDockUIPartArray uiparts; - wxAuiPaneInfo hint = GetPane(pane_window); - hint.name = wxT("__HINT__"); - hint.PaneBorder(true); - hint.Show(); - - if (!hint.IsOk()) - return rect; - - CopyDocksAndPanes(docks, panes, m_docks, m_panes); - - // remove any pane already there which bears the same window; - // this happens when you are moving a pane around in a dock - for (i = 0, pane_count = panes.GetCount(); i < pane_count; ++i) - { - if (panes.Item(i).window == pane_window) - { - RemovePaneFromDocks(docks, panes.Item(i)); - panes.RemoveAt(i); - break; - } - } - - // find out where the new pane would be - if (!DoDrop(docks, panes, hint, pt, offset)) - { - return rect; - } - - panes.Add(hint); - - wxSizer* sizer = LayoutAll(panes, docks, uiparts, true); - wxSize client_size = m_frame->GetClientSize(); - sizer->SetDimension(0, 0, client_size.x, client_size.y); - sizer->Layout(); - - for (i = 0, part_count = uiparts.GetCount(); - i < part_count; ++i) - { - wxAuiDockUIPart& part = uiparts.Item(i); - - if (part.type == wxAuiDockUIPart::typePaneBorder && - part.pane && part.pane->name == wxT("__HINT__")) - { - rect = wxRect(part.sizer_item->GetPosition(), - part.sizer_item->GetSize()); - break; - } - } - - delete sizer; - - if (rect.IsEmpty()) - { - return rect; - } - - // actually show the hint rectangle on the screen - m_frame->ClientToScreen(&rect.x, &rect.y); - - if ( m_frame->GetLayoutDirection() == wxLayout_RightToLeft ) - { - // Mirror rectangle in RTL mode - rect.x -= rect.GetWidth(); - } - - return rect; -} - -// DrawHintRect() calculates the hint rectangle by calling -// CalculateHintRect(). If there is a rectangle, it shows it -// by calling ShowHint(), otherwise it hides any hint -// rectangle currently shown -void wxAuiManager::DrawHintRect(wxWindow* pane_window, - const wxPoint& pt, - const wxPoint& offset) -{ - wxRect rect = CalculateHintRect(pane_window, pt, offset); - - if (rect.IsEmpty()) - { - HideHint(); - } - else - { - ShowHint(rect); - } -} - -void wxAuiManager::OnFloatingPaneMoveStart(wxWindow* wnd) -{ - // try to find the pane - wxAuiPaneInfo& pane = GetPane(wnd); - wxASSERT_MSG(pane.IsOk(), wxT("Pane window not found")); - - if(!pane.frame) - return; - - if (m_flags & wxAUI_MGR_TRANSPARENT_DRAG) - pane.frame->SetTransparent(150); -} - -void wxAuiManager::OnFloatingPaneMoving(wxWindow* wnd, wxDirection dir) -{ - // try to find the pane - wxAuiPaneInfo& pane = GetPane(wnd); - wxASSERT_MSG(pane.IsOk(), wxT("Pane window not found")); - - if(!pane.frame) - return; - - wxPoint pt = ::wxGetMousePosition(); - -#if 0 - // Adapt pt to direction - if (dir == wxNORTH) - { - // move to pane's upper border - wxPoint pos( 0,0 ); - pos = wnd->ClientToScreen( pos ); - pt.y = pos.y; - // and some more pixels for the title bar - pt.y -= 5; - } else - if (dir == wxWEST) - { - // move to pane's left border - wxPoint pos( 0,0 ); - pos = wnd->ClientToScreen( pos ); - pt.x = pos.x; - } else - if (dir == wxEAST) - { - // move to pane's right border - wxPoint pos( wnd->GetSize().x, 0 ); - pos = wnd->ClientToScreen( pos ); - pt.x = pos.x; - } else - if (dir == wxSOUTH) - { - // move to pane's bottom border - wxPoint pos( 0, wnd->GetSize().y ); - pos = wnd->ClientToScreen( pos ); - pt.y = pos.y; - } -#else - wxUnusedVar(dir); -#endif - - wxPoint client_pt = m_frame->ScreenToClient(pt); - - // calculate the offset from the upper left-hand corner - // of the frame to the mouse pointer - wxPoint frame_pos = pane.frame->GetPosition(); - wxPoint action_offset(pt.x-frame_pos.x, pt.y-frame_pos.y); - - // no hint for toolbar floating windows - if (pane.IsToolbar() && m_action == actionDragFloatingPane) - { - if (m_action == actionDragFloatingPane) - { - wxAuiDockInfoArray docks; - wxAuiPaneInfoArray panes; - wxAuiDockUIPartArray uiparts; - wxAuiPaneInfo hint = pane; - - CopyDocksAndPanes(docks, panes, m_docks, m_panes); - - // find out where the new pane would be - if (!DoDrop(docks, panes, hint, client_pt)) - return; - if (hint.IsFloating()) - return; - - pane = hint; - m_action = actionDragToolbarPane; - m_action_window = pane.window; - - Update(); - } - - return; - } - - - // if a key modifier is pressed while dragging the frame, - // don't dock the window - if (wxGetKeyState(WXK_CONTROL) || wxGetKeyState(WXK_ALT)) - { - HideHint(); - return; - } - - - DrawHintRect(wnd, client_pt, action_offset); - -#ifdef __WXGTK__ - // this cleans up some screen artifacts that are caused on GTK because - // we aren't getting the exact size of the window (see comment - // in DrawHintRect) - //Refresh(); -#endif - - - // reduces flicker - m_frame->Update(); -} - -void wxAuiManager::OnFloatingPaneMoved(wxWindow* wnd, wxDirection dir) -{ - // try to find the pane - wxAuiPaneInfo& pane = GetPane(wnd); - wxASSERT_MSG(pane.IsOk(), wxT("Pane window not found")); - - if(!pane.frame) - return; - - wxPoint pt = ::wxGetMousePosition(); - -#if 0 - // Adapt pt to direction - if (dir == wxNORTH) - { - // move to pane's upper border - wxPoint pos( 0,0 ); - pos = wnd->ClientToScreen( pos ); - pt.y = pos.y; - // and some more pixels for the title bar - pt.y -= 10; - } else - if (dir == wxWEST) - { - // move to pane's left border - wxPoint pos( 0,0 ); - pos = wnd->ClientToScreen( pos ); - pt.x = pos.x; - } else - if (dir == wxEAST) - { - // move to pane's right border - wxPoint pos( wnd->GetSize().x, 0 ); - pos = wnd->ClientToScreen( pos ); - pt.x = pos.x; - } else - if (dir == wxSOUTH) - { - // move to pane's bottom border - wxPoint pos( 0, wnd->GetSize().y ); - pos = wnd->ClientToScreen( pos ); - pt.y = pos.y; - } -#else - wxUnusedVar(dir); -#endif - - wxPoint client_pt = m_frame->ScreenToClient(pt); - - // calculate the offset from the upper left-hand corner - // of the frame to the mouse pointer - wxPoint frame_pos = pane.frame->GetPosition(); - wxPoint action_offset(pt.x-frame_pos.x, pt.y-frame_pos.y); - - // if a key modifier is pressed while dragging the frame, - // don't dock the window - if (!wxGetKeyState(WXK_CONTROL) && !wxGetKeyState(WXK_ALT)) - { - // do the drop calculation - DoDrop(m_docks, m_panes, pane, client_pt, action_offset); - } - - // if the pane is still floating, update it's floating - // position (that we store) - if (pane.IsFloating()) - { - pane.floating_pos = pane.frame->GetPosition(); - - if (m_flags & wxAUI_MGR_TRANSPARENT_DRAG) - pane.frame->SetTransparent(255); - } - else if (m_has_maximized) - { - RestoreMaximizedPane(); - } - - Update(); - - HideHint(); -} - -void wxAuiManager::OnFloatingPaneResized(wxWindow* wnd, const wxSize& size) -{ - // try to find the pane - wxAuiPaneInfo& pane = GetPane(wnd); - wxASSERT_MSG(pane.IsOk(), wxT("Pane window not found")); - - pane.floating_size = size; -} - - -void wxAuiManager::OnFloatingPaneClosed(wxWindow* wnd, wxCloseEvent& evt) -{ - // try to find the pane - wxAuiPaneInfo& pane = GetPane(wnd); - wxASSERT_MSG(pane.IsOk(), wxT("Pane window not found")); - - - // fire pane close event - wxAuiManagerEvent e(wxEVT_AUI_PANE_CLOSE); - e.SetPane(&pane); - e.SetCanVeto(evt.CanVeto()); - ProcessMgrEvent(e); - - if (e.GetVeto()) - { - evt.Veto(); - return; - } - else - { - // close the pane, but check that it - // still exists in our pane array first - // (the event handler above might have removed it) - - wxAuiPaneInfo& check = GetPane(wnd); - if (check.IsOk()) - { - ClosePane(pane); - } - } -} - - - -void wxAuiManager::OnFloatingPaneActivated(wxWindow* wnd) -{ - if ((GetFlags() & wxAUI_MGR_ALLOW_ACTIVE_PANE) && GetPane(wnd).IsOk()) - { - SetActivePane(m_panes, wnd); - Repaint(); - } -} - -// OnRender() draws all of the pane captions, sashes, -// backgrounds, captions, grippers, pane borders and buttons. -// It renders the entire user interface. - -void wxAuiManager::OnRender(wxAuiManagerEvent& evt) -{ - // if the frame is about to be deleted, don't bother - if (!m_frame || wxPendingDelete.Member(m_frame)) - return; - - wxDC* dc = evt.GetDC(); - -#ifdef __WXMAC__ - dc->Clear() ; -#endif - int i, part_count; - for (i = 0, part_count = m_uiparts.GetCount(); - i < part_count; ++i) - { - wxAuiDockUIPart& part = m_uiparts.Item(i); - - // don't draw hidden pane items or items that aren't windows - if (part.sizer_item && ((!part.sizer_item->IsWindow() && !part.sizer_item->IsSpacer() && !part.sizer_item->IsSizer()) || !part.sizer_item->IsShown())) - continue; - - switch (part.type) - { - case wxAuiDockUIPart::typeDockSizer: - case wxAuiDockUIPart::typePaneSizer: - m_art->DrawSash(*dc, m_frame, part.orientation, part.rect); - break; - case wxAuiDockUIPart::typeBackground: - m_art->DrawBackground(*dc, m_frame, part.orientation, part.rect); - break; - case wxAuiDockUIPart::typeCaption: - m_art->DrawCaption(*dc, m_frame, part.pane->caption, part.rect, *part.pane); - break; - case wxAuiDockUIPart::typeGripper: - m_art->DrawGripper(*dc, m_frame, part.rect, *part.pane); - break; - case wxAuiDockUIPart::typePaneBorder: - m_art->DrawBorder(*dc, m_frame, part.rect, *part.pane); - break; - case wxAuiDockUIPart::typePaneButton: - m_art->DrawPaneButton(*dc, m_frame, part.button->button_id, - wxAUI_BUTTON_STATE_NORMAL, part.rect, *part.pane); - break; - } - } -} - - -// Render() fire a render event, which is normally handled by -// wxAuiManager::OnRender(). This allows the render function to -// be overridden via the render event. This can be useful for paintin -// custom graphics in the main window. Default behavior can be -// invoked in the overridden function by calling OnRender() - -void wxAuiManager::Render(wxDC* dc) -{ - wxAuiManagerEvent e(wxEVT_AUI_RENDER); - e.SetManager(this); - e.SetDC(dc); - ProcessMgrEvent(e); -} - -void wxAuiManager::Repaint(wxDC* dc) -{ -#ifdef __WXMAC__ - if ( dc == NULL ) - { - m_frame->Refresh() ; - m_frame->Update() ; - return ; - } -#endif - int w, h; - m_frame->GetClientSize(&w, &h); - - // figure out which dc to use; if one - // has been specified, use it, otherwise - // make a client dc - wxClientDC* client_dc = NULL; - if (!dc) - { - client_dc = new wxClientDC(m_frame); - dc = client_dc; - } - - // if the frame has a toolbar, the client area - // origin will not be (0,0). - wxPoint pt = m_frame->GetClientAreaOrigin(); - if (pt.x != 0 || pt.y != 0) - dc->SetDeviceOrigin(pt.x, pt.y); - - // render all the items - Render(dc); - - // if we created a client_dc, delete it - if (client_dc) - delete client_dc; -} - -void wxAuiManager::OnPaint(wxPaintEvent& WXUNUSED(event)) -{ - wxPaintDC dc(m_frame); - Repaint(&dc); -} - -void wxAuiManager::OnEraseBackground(wxEraseEvent& event) -{ -#ifdef __WXMAC__ - event.Skip() ; -#else - wxUnusedVar(event); -#endif -} - -void wxAuiManager::OnSize(wxSizeEvent& event) -{ - if (m_frame) - { - DoFrameLayout(); - Repaint(); - -#if wxUSE_MDI - if (m_frame->IsKindOf(CLASSINFO(wxMDIParentFrame))) - { - // for MDI parent frames, this event must not - // be "skipped". In other words, the parent frame - // must not be allowed to resize the client window - // after we are finished processing sizing changes - return; - } -#endif - } - event.Skip(); -} - -void wxAuiManager::OnFindManager(wxAuiManagerEvent& evt) -{ - // get the window we are managing, if none, return NULL - wxWindow* window = GetManagedWindow(); - if (!window) - { - evt.SetManager(NULL); - return; - } - - // if we are managing a child frame, get the 'real' manager - if (window->IsKindOf(CLASSINFO(wxAuiFloatingFrame))) - { - wxAuiFloatingFrame* float_frame = wx_static_cast(wxAuiFloatingFrame*, window); - evt.SetManager(float_frame->GetOwnerManager()); - return; - } - - // return pointer to ourself - evt.SetManager(this); -} - -void wxAuiManager::OnSetCursor(wxSetCursorEvent& event) -{ - // determine cursor - wxAuiDockUIPart* part = HitTest(event.GetX(), event.GetY()); - wxCursor cursor = wxNullCursor; - - if (part) - { - if (part->type == wxAuiDockUIPart::typeDockSizer || - part->type == wxAuiDockUIPart::typePaneSizer) - { - // a dock may not be resized if it has a single - // pane which is not resizable - if (part->type == wxAuiDockUIPart::typeDockSizer && part->dock && - part->dock->panes.GetCount() == 1 && - part->dock->panes.Item(0)->IsFixed()) - return; - - // panes that may not be resized do not get a sizing cursor - if (part->pane && part->pane->IsFixed()) - return; - - if (part->orientation == wxVERTICAL) - cursor = wxCursor(wxCURSOR_SIZEWE); - else - cursor = wxCursor(wxCURSOR_SIZENS); - } - else if (part->type == wxAuiDockUIPart::typeGripper) - { - cursor = wxCursor(wxCURSOR_SIZING); - } - } - - event.SetCursor(cursor); -} - - - -void wxAuiManager::UpdateButtonOnScreen(wxAuiDockUIPart* button_ui_part, - const wxMouseEvent& event) -{ - wxAuiDockUIPart* hit_test = HitTest(event.GetX(), event.GetY()); - if (!hit_test || !button_ui_part) - return; - - int state = wxAUI_BUTTON_STATE_NORMAL; - - if (hit_test == button_ui_part) - { - if (event.LeftDown()) - state = wxAUI_BUTTON_STATE_PRESSED; - else - state = wxAUI_BUTTON_STATE_HOVER; - } - else - { - if (event.LeftDown()) - state = wxAUI_BUTTON_STATE_HOVER; - } - - // now repaint the button with hover state - wxClientDC cdc(m_frame); - - // if the frame has a toolbar, the client area - // origin will not be (0,0). - wxPoint pt = m_frame->GetClientAreaOrigin(); - if (pt.x != 0 || pt.y != 0) - cdc.SetDeviceOrigin(pt.x, pt.y); - - if (hit_test->pane) - { - m_art->DrawPaneButton(cdc, m_frame, - button_ui_part->button->button_id, - state, - button_ui_part->rect, - *hit_test->pane); - } -} - -static int gs_CurrentDragItem = -1; - -void wxAuiManager::OnLeftDown(wxMouseEvent& event) -{ - gs_CurrentDragItem = -1; - wxAuiDockUIPart* part = HitTest(event.GetX(), event.GetY()); - if (part) - { - if (part->type == wxAuiDockUIPart::typeDockSizer || - part->type == wxAuiDockUIPart::typePaneSizer) - { - // Removing this restriction so that a centre pane can be resized - //if (part->dock && part->dock->dock_direction == wxAUI_DOCK_CENTER) - // return; - - // a dock may not be resized if it has a single - // pane which is not resizable - if (part->type == wxAuiDockUIPart::typeDockSizer && part->dock && - part->dock->panes.GetCount() == 1 && - part->dock->panes.Item(0)->IsFixed()) - return; - - // panes that may not be resized should be ignored here - if (part->pane && part->pane->IsFixed()) - return; - - m_action = actionResize; - m_action_part = part; - m_action_hintrect = wxRect(); - m_action_start = wxPoint(event.m_x, event.m_y); - m_action_offset = wxPoint(event.m_x - part->rect.x, - event.m_y - part->rect.y); - m_frame->CaptureMouse(); - } - else if (part->type == wxAuiDockUIPart::typePaneButton) - { - m_action = actionClickButton; - m_action_part = part; - m_action_start = wxPoint(event.m_x, event.m_y); - m_frame->CaptureMouse(); - - UpdateButtonOnScreen(part, event); - } - else if (part->type == wxAuiDockUIPart::typeCaption || - part->type == wxAuiDockUIPart::typeGripper) - { - // if we are managing a wxAuiFloatingFrame window, then - // we are an embedded wxAuiManager inside the wxAuiFloatingFrame. - // We want to initiate a toolbar drag in our owner manager - wxWindow* managed_wnd = GetManagedWindow(); - - if (part->pane && - part->pane->window && - managed_wnd && - managed_wnd->IsKindOf(CLASSINFO(wxAuiFloatingFrame))) - { - wxAuiFloatingFrame* floating_frame = (wxAuiFloatingFrame*)managed_wnd; - wxAuiManager* owner_mgr = floating_frame->GetOwnerManager(); - owner_mgr->StartPaneDrag(part->pane->window, - wxPoint(event.m_x - part->rect.x, - event.m_y - part->rect.y)); - return; - } - - if (GetFlags() & wxAUI_MGR_ALLOW_ACTIVE_PANE) - { - // set the caption as active - SetActivePane(m_panes, part->pane->window); - Repaint(); - } - - if (part->dock && part->dock->dock_direction == wxAUI_DOCK_CENTER) - return; - - m_action = actionClickCaption; - m_action_part = part; - m_action_start = wxPoint(event.m_x, event.m_y); - m_action_offset = wxPoint(event.m_x - part->rect.x, - event.m_y - part->rect.y); - m_frame->CaptureMouse(); - } -#ifdef __WXMAC__ - else - { - event.Skip(); - } -#endif - } -#ifdef __WXMAC__ - else - { - event.Skip(); - } -#else - event.Skip(); -#endif -} - -/// Ends a resize action, or for live update, resizes the sash -bool wxAuiManager::DoEndResizeAction(wxMouseEvent& event) -{ - // resize the dock or the pane - if (m_action_part && m_action_part->type==wxAuiDockUIPart::typeDockSizer) - { - // first, we must calculate the maximum size the dock may be - int sash_size = m_art->GetMetric(wxAUI_DOCKART_SASH_SIZE); - - int used_width = 0, used_height = 0; - - wxSize client_size = m_frame->GetClientSize(); - - size_t dock_i, dock_count = m_docks.GetCount(); - for (dock_i = 0; dock_i < dock_count; ++dock_i) - { - wxAuiDockInfo& dock = m_docks.Item(dock_i); - if (dock.dock_direction == wxAUI_DOCK_TOP || - dock.dock_direction == wxAUI_DOCK_BOTTOM) - { - used_height += dock.size; - } - if (dock.dock_direction == wxAUI_DOCK_LEFT || - dock.dock_direction == wxAUI_DOCK_RIGHT) - { - used_width += dock.size; - } - if (dock.resizable) - used_width += sash_size; - } - - - int available_width = client_size.GetWidth() - used_width; - int available_height = client_size.GetHeight() - used_height; - - -#if wxUSE_STATUSBAR - // if there's a status control, the available - // height decreases accordingly - if (m_frame && m_frame->IsKindOf(CLASSINFO(wxFrame))) - { - wxFrame* frame = static_cast(m_frame); - wxStatusBar* status = frame->GetStatusBar(); - if (status) - { - wxSize status_client_size = status->GetClientSize(); - available_height -= status_client_size.GetHeight(); - } - } -#endif - - wxRect& rect = m_action_part->dock->rect; - - wxPoint new_pos(event.m_x - m_action_offset.x, - event.m_y - m_action_offset.y); - int new_size, old_size = m_action_part->dock->size; - - switch (m_action_part->dock->dock_direction) - { - case wxAUI_DOCK_LEFT: - new_size = new_pos.x - rect.x; - if (new_size-old_size > available_width) - new_size = old_size+available_width; - m_action_part->dock->size = new_size; - break; - case wxAUI_DOCK_TOP: - new_size = new_pos.y - rect.y; - if (new_size-old_size > available_height) - new_size = old_size+available_height; - m_action_part->dock->size = new_size; - break; - case wxAUI_DOCK_RIGHT: - new_size = rect.x + rect.width - new_pos.x - - m_action_part->rect.GetWidth(); - if (new_size-old_size > available_width) - new_size = old_size+available_width; - m_action_part->dock->size = new_size; - break; - case wxAUI_DOCK_BOTTOM: - new_size = rect.y + rect.height - - new_pos.y - m_action_part->rect.GetHeight(); - if (new_size-old_size > available_height) - new_size = old_size+available_height; - m_action_part->dock->size = new_size; - break; - } - - Update(); - Repaint(NULL); - } - else if (m_action_part && - m_action_part->type == wxAuiDockUIPart::typePaneSizer) - { - wxAuiDockInfo& dock = *m_action_part->dock; - wxAuiPaneInfo& pane = *m_action_part->pane; - - int total_proportion = 0; - int dock_pixels = 0; - int new_pixsize = 0; - - int caption_size = m_art->GetMetric(wxAUI_DOCKART_CAPTION_SIZE); - int pane_border_size = m_art->GetMetric(wxAUI_DOCKART_PANE_BORDER_SIZE); - int sash_size = m_art->GetMetric(wxAUI_DOCKART_SASH_SIZE); - - wxPoint new_pos(event.m_x - m_action_offset.x, - event.m_y - m_action_offset.y); - - // determine the pane rectangle by getting the pane part - wxAuiDockUIPart* pane_part = GetPanePart(pane.window); - wxASSERT_MSG(pane_part, - wxT("Pane border part not found -- shouldn't happen")); - - // determine the new pixel size that the user wants; - // this will help us recalculate the pane's proportion - if (dock.IsHorizontal()) - new_pixsize = new_pos.x - pane_part->rect.x; - else - new_pixsize = new_pos.y - pane_part->rect.y; - - // determine the size of the dock, based on orientation - if (dock.IsHorizontal()) - dock_pixels = dock.rect.GetWidth(); - else - dock_pixels = dock.rect.GetHeight(); - - // determine the total proportion of all resizable panes, - // and the total size of the dock minus the size of all - // the fixed panes - int i, dock_pane_count = dock.panes.GetCount(); - int pane_position = -1; - for (i = 0; i < dock_pane_count; ++i) - { - wxAuiPaneInfo& p = *dock.panes.Item(i); - if (p.window == pane.window) - pane_position = i; - - // while we're at it, subtract the pane sash - // width from the dock width, because this would - // skew our proportion calculations - if (i > 0) - dock_pixels -= sash_size; - - // also, the whole size (including decorations) of - // all fixed panes must also be subtracted, because they - // are not part of the proportion calculation - if (p.IsFixed()) - { - if (dock.IsHorizontal()) - dock_pixels -= p.best_size.x; - else - dock_pixels -= p.best_size.y; - } - else - { - total_proportion += p.dock_proportion; - } - } - - // new size can never be more than the number of dock pixels - if (new_pixsize > dock_pixels) - new_pixsize = dock_pixels; - - - // find a pane in our dock to 'steal' space from or to 'give' - // space to -- this is essentially what is done when a pane is - // resized; the pane should usually be the first non-fixed pane - // to the right of the action pane - int borrow_pane = -1; - for (i = pane_position+1; i < dock_pane_count; ++i) - { - wxAuiPaneInfo& p = *dock.panes.Item(i); - if (!p.IsFixed()) - { - borrow_pane = i; - break; - } - } - - - // demand that the pane being resized is found in this dock - // (this assert really never should be raised) - wxASSERT_MSG(pane_position != -1, wxT("Pane not found in dock")); - - // prevent division by zero - if (dock_pixels == 0 || total_proportion == 0 || borrow_pane == -1) - { - m_action = actionNone; - return false; - } - - // calculate the new proportion of the pane - int new_proportion = (new_pixsize*total_proportion)/dock_pixels; - - // default minimum size - int min_size = 0; - - // check against the pane's minimum size, if specified. please note - // that this is not enough to ensure that the minimum size will - // not be violated, because the whole frame might later be shrunk, - // causing the size of the pane to violate it's minimum size - if (pane.min_size.IsFullySpecified()) - { - min_size = 0; - - if (pane.HasBorder()) - min_size += (pane_border_size*2); - - // calculate minimum size with decorations (border,caption) - if (pane_part->orientation == wxVERTICAL) - { - min_size += pane.min_size.y; - if (pane.HasCaption()) - min_size += caption_size; - } - else - { - min_size += pane.min_size.x; - } - } - - - // for some reason, an arithmatic error somewhere is causing - // the proportion calculations to always be off by 1 pixel; - // for now we will add the 1 pixel on, but we really should - // determine what's causing this. - min_size++; - - int min_proportion = (min_size*total_proportion)/dock_pixels; - - if (new_proportion < min_proportion) - new_proportion = min_proportion; - - - - int prop_diff = new_proportion - pane.dock_proportion; - - // borrow the space from our neighbor pane to the - // right or bottom (depending on orientation); - // also make sure we don't make the neighbor too small - int prop_borrow = dock.panes.Item(borrow_pane)->dock_proportion; - - if (prop_borrow - prop_diff < 0) - { - // borrowing from other pane would make it too small, - // so cancel the resize operation - prop_borrow = min_proportion; - } - else - { - prop_borrow -= prop_diff; - } - - - dock.panes.Item(borrow_pane)->dock_proportion = prop_borrow; - pane.dock_proportion = new_proportion; - - - // repaint - Update(); - Repaint(NULL); - } - - return true; -} - -void wxAuiManager::OnLeftUp(wxMouseEvent& event) -{ - if (m_action == actionResize) - { - m_frame->ReleaseMouse(); - - // get rid of the hint rectangle - - // On non-CG Mac we use a wxClientDC since when compiling and running on Leopard, - // we can get the dreaded _SetDstBlits32BGRA crash (but not in the AUI sample). - // In CG mode we always use live resize since DrawResizeHint doesn't work. - if (!wxAuiManager_HasLiveResize(*this)) - { - // get rid of the hint rectangle -#if defined(__WXMAC__) && !wxMAC_USE_CORE_GRAPHICS - wxClientDC dc(m_frame); -#else - wxScreenDC dc; -#endif - DrawResizeHint(dc, m_action_hintrect); - } - if (gs_CurrentDragItem != -1 && wxAuiManager_HasLiveResize(*this)) - m_action_part = & (m_uiparts.Item(gs_CurrentDragItem)); - - DoEndResizeAction(event); - - gs_CurrentDragItem = -1; - } - else if (m_action == actionClickButton) - { - m_hover_button = NULL; - m_frame->ReleaseMouse(); - - if (m_action_part) - { - UpdateButtonOnScreen(m_action_part, event); - - // make sure we're still over the item that was originally clicked - if (m_action_part == HitTest(event.GetX(), event.GetY())) - { - // fire button-click event - wxAuiManagerEvent e(wxEVT_AUI_PANE_BUTTON); - e.SetManager(this); - e.SetPane(m_action_part->pane); - e.SetButton(m_action_part->button->button_id); - ProcessMgrEvent(e); - } - } - } - else if (m_action == actionClickCaption) - { - m_frame->ReleaseMouse(); - } - else if (m_action == actionDragFloatingPane) - { - m_frame->ReleaseMouse(); - } - else if (m_action == actionDragToolbarPane) - { - m_frame->ReleaseMouse(); - - wxAuiPaneInfo& pane = GetPane(m_action_window); - wxASSERT_MSG(pane.IsOk(), wxT("Pane window not found")); - - // save the new positions - wxAuiDockInfoPtrArray docks; - FindDocks(m_docks, pane.dock_direction, - pane.dock_layer, pane.dock_row, docks); - if (docks.GetCount() == 1) - { - wxAuiDockInfo& dock = *docks.Item(0); - - wxArrayInt pane_positions, pane_sizes; - GetPanePositionsAndSizes(dock, pane_positions, pane_sizes); - - int i, dock_pane_count = dock.panes.GetCount(); - for (i = 0; i < dock_pane_count; ++i) - dock.panes.Item(i)->dock_pos = pane_positions[i]; - } - - pane.state &= ~wxAuiPaneInfo::actionPane; - Update(); - } - else - { - event.Skip(); - } - - m_action = actionNone; - m_last_mouse_move = wxPoint(); // see comment in OnMotion() -} - - -void wxAuiManager::OnMotion(wxMouseEvent& event) -{ - // sometimes when Update() is called from inside this method, - // a spurious mouse move event is generated; this check will make - // sure that only real mouse moves will get anywhere in this method; - // this appears to be a bug somewhere, and I don't know where the - // mouse move event is being generated. only verified on MSW - - wxPoint mouse_pos = event.GetPosition(); - if (m_last_mouse_move == mouse_pos) - return; - m_last_mouse_move = mouse_pos; - - - if (m_action == actionResize) - { - // It's necessary to reset m_action_part since it destroyed - // by the Update within DoEndResizeAction. - if (gs_CurrentDragItem != -1) - m_action_part = & (m_uiparts.Item(gs_CurrentDragItem)); - else - gs_CurrentDragItem = m_uiparts.Index(* m_action_part); - - if (m_action_part) - { - wxPoint pos = m_action_part->rect.GetPosition(); - if (m_action_part->orientation == wxHORIZONTAL) - pos.y = wxMax(0, event.m_y - m_action_offset.y); - else - pos.x = wxMax(0, event.m_x - m_action_offset.x); - - if (wxAuiManager_HasLiveResize(*this)) - { - - m_frame->ReleaseMouse(); - DoEndResizeAction(event); - m_frame->CaptureMouse(); - } - else - { -#if defined(__WXMAC__) && !wxMAC_USE_CORE_GRAPHICS - wxRect rect(pos, - m_action_part->rect.GetSize()); - - wxClientDC dc(m_frame); -#else - wxRect rect(m_frame->ClientToScreen(pos), - m_action_part->rect.GetSize()); - wxScreenDC dc; -#endif - if (!m_action_hintrect.IsEmpty()) - { - // remove old resize hint - DrawResizeHint(dc, m_action_hintrect); - m_action_hintrect = wxRect(); - } - - // draw new resize hint, if it's inside the managed frame - wxRect frame_screen_rect = m_frame->GetScreenRect(); - if (frame_screen_rect.Contains(rect)) - { - DrawResizeHint(dc, rect); - m_action_hintrect = rect; - } - } - } - } - else if (m_action == actionClickCaption) - { - int drag_x_threshold = wxSystemSettings::GetMetric(wxSYS_DRAG_X); - int drag_y_threshold = wxSystemSettings::GetMetric(wxSYS_DRAG_Y); - - // caption has been clicked. we need to check if the mouse - // is now being dragged. if it is, we need to change the - // mouse action to 'drag' - if (m_action_part && - (abs(event.m_x - m_action_start.x) > drag_x_threshold || - abs(event.m_y - m_action_start.y) > drag_y_threshold)) - { - wxAuiPaneInfo* pane_info = m_action_part->pane; - - if (!pane_info->IsToolbar()) - { - if ((m_flags & wxAUI_MGR_ALLOW_FLOATING) && - pane_info->IsFloatable()) - { - m_action = actionDragFloatingPane; - - // set initial float position - wxPoint pt = m_frame->ClientToScreen(event.GetPosition()); - pane_info->floating_pos = wxPoint(pt.x - m_action_offset.x, - pt.y - m_action_offset.y); - - // float the window - if (pane_info->IsMaximized()) - RestorePane(*pane_info); - pane_info->Float(); - Update(); - - m_action_window = pane_info->frame; - - // action offset is used here to make it feel "natural" to the user - // to drag a docked pane and suddenly have it become a floating frame. - // Sometimes, however, the offset where the user clicked on the docked - // caption is bigger than the width of the floating frame itself, so - // in that case we need to set the action offset to a sensible value - wxSize frame_size = m_action_window->GetSize(); - if (frame_size.x <= m_action_offset.x) - m_action_offset.x = 30; - } - } - else - { - m_action = actionDragToolbarPane; - m_action_window = pane_info->window; - } - } - } - else if (m_action == actionDragFloatingPane) - { - if (m_action_window) - { - wxPoint pt = m_frame->ClientToScreen(event.GetPosition()); - m_action_window->Move(pt.x - m_action_offset.x, - pt.y - m_action_offset.y); - } - } - else if (m_action == actionDragToolbarPane) - { - wxAuiPaneInfo& pane = GetPane(m_action_window); - wxASSERT_MSG(pane.IsOk(), wxT("Pane window not found")); - - pane.state |= wxAuiPaneInfo::actionPane; - - wxPoint pt = event.GetPosition(); - DoDrop(m_docks, m_panes, pane, pt, m_action_offset); - - // if DoDrop() decided to float the pane, set up - // the floating pane's initial position - if (pane.IsFloating()) - { - wxPoint pt = m_frame->ClientToScreen(event.GetPosition()); - pane.floating_pos = wxPoint(pt.x - m_action_offset.x, - pt.y - m_action_offset.y); - } - - // this will do the actiual move operation; - // in the case that the pane has been floated, - // this call will create the floating pane - // and do the reparenting - Update(); - - // if the pane has been floated, change the mouse - // action actionDragFloatingPane so that subsequent - // EVT_MOTION() events will move the floating pane - if (pane.IsFloating()) - { - pane.state &= ~wxAuiPaneInfo::actionPane; - m_action = actionDragFloatingPane; - m_action_window = pane.frame; - } - } - else - { - wxAuiDockUIPart* part = HitTest(event.GetX(), event.GetY()); - if (part && part->type == wxAuiDockUIPart::typePaneButton) - { - if (part != m_hover_button) - { - // make the old button normal - if (m_hover_button) - { - UpdateButtonOnScreen(m_hover_button, event); - Repaint(); - } - - // mouse is over a button, so repaint the - // button in hover mode - UpdateButtonOnScreen(part, event); - m_hover_button = part; - - } - } - else - { - if (m_hover_button) - { - m_hover_button = NULL; - Repaint(); - } - else - { - event.Skip(); - } - } - } -} - -void wxAuiManager::OnLeaveWindow(wxMouseEvent& WXUNUSED(event)) -{ - if (m_hover_button) - { - m_hover_button = NULL; - Repaint(); - } -} - -void wxAuiManager::OnChildFocus(wxChildFocusEvent& event) -{ - // when a child pane has it's focus set, we should change the - // pane's active state to reflect this. (this is only true if - // active panes are allowed by the owner) - if (GetFlags() & wxAUI_MGR_ALLOW_ACTIVE_PANE) - { - wxAuiPaneInfo& pane = GetPane(event.GetWindow()); - if (pane.IsOk() && (pane.state & wxAuiPaneInfo::optionActive) == 0) - { - SetActivePane(m_panes, event.GetWindow()); - m_frame->Refresh(); - } - } - - event.Skip(); -} - - -// OnPaneButton() is an event handler that is called -// when a pane button has been pressed. -void wxAuiManager::OnPaneButton(wxAuiManagerEvent& evt) -{ - wxASSERT_MSG(evt.pane, wxT("Pane Info passed to wxAuiManager::OnPaneButton must be non-null")); - - wxAuiPaneInfo& pane = *(evt.pane); - - if (evt.button == wxAUI_BUTTON_CLOSE) - { - // fire pane close event - wxAuiManagerEvent e(wxEVT_AUI_PANE_CLOSE); - e.SetManager(this); - e.SetPane(evt.pane); - ProcessMgrEvent(e); - - if (!e.GetVeto()) - { - // close the pane, but check that it - // still exists in our pane array first - // (the event handler above might have removed it) - - wxAuiPaneInfo& check = GetPane(pane.window); - if (check.IsOk()) - { - ClosePane(pane); - } - - Update(); - } - } - else if (evt.button == wxAUI_BUTTON_MAXIMIZE_RESTORE && !pane.IsMaximized()) - { - // fire pane close event - wxAuiManagerEvent e(wxEVT_AUI_PANE_MAXIMIZE); - e.SetManager(this); - e.SetPane(evt.pane); - ProcessMgrEvent(e); - - if (!e.GetVeto()) - { - MaximizePane(pane); - Update(); - } - } - else if (evt.button == wxAUI_BUTTON_MAXIMIZE_RESTORE && pane.IsMaximized()) - { - // fire pane close event - wxAuiManagerEvent e(wxEVT_AUI_PANE_RESTORE); - e.SetManager(this); - e.SetPane(evt.pane); - ProcessMgrEvent(e); - - if (!e.GetVeto()) - { - RestorePane(pane); - Update(); - } - } - else if (evt.button == wxAUI_BUTTON_PIN) - { - if ((m_flags & wxAUI_MGR_ALLOW_FLOATING) && - pane.IsFloatable()) - pane.Float(); - Update(); - } -} - -#endif // wxUSE_AUI diff --git a/wxWidgets/src/aui/tabmdi.cpp b/wxWidgets/src/aui/tabmdi.cpp deleted file mode 100644 index 43490948b3..0000000000 --- a/wxWidgets/src/aui/tabmdi.cpp +++ /dev/null @@ -1,837 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/aui/tabmdi.cpp -// Purpose: Generic MDI (Multiple Document Interface) classes -// Author: Hans Van Leemputten -// Modified by: Benjamin I. Williams / Kirix Corporation -// Created: 29/07/2002 -// RCS-ID: $Id: tabmdi.cpp 55206 2008-08-23 16:19:16Z VZ $ -// Copyright: (c) Hans Van Leemputten -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// =========================================================================== -// declarations -// =========================================================================== - -// --------------------------------------------------------------------------- -// headers -// --------------------------------------------------------------------------- - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_AUI -#if wxUSE_MDI - -#include "wx/aui/tabmdi.h" - -#ifndef WX_PRECOMP - #include "wx/panel.h" - #include "wx/menu.h" - #include "wx/intl.h" - #include "wx/log.h" - #include "wx/settings.h" -#endif //WX_PRECOMP - -#include "wx/stockitem.h" - -enum MDI_MENU_ID -{ - wxWINDOWCLOSE = 4001, - wxWINDOWCLOSEALL, - wxWINDOWNEXT, - wxWINDOWPREV -}; - -//----------------------------------------------------------------------------- -// wxAuiMDIParentFrame -//----------------------------------------------------------------------------- - -IMPLEMENT_DYNAMIC_CLASS(wxAuiMDIParentFrame, wxFrame) - -BEGIN_EVENT_TABLE(wxAuiMDIParentFrame, wxFrame) -#if wxUSE_MENUS - EVT_MENU (wxID_ANY, wxAuiMDIParentFrame::DoHandleMenu) -#endif -END_EVENT_TABLE() - -wxAuiMDIParentFrame::wxAuiMDIParentFrame() -{ - Init(); -} - -wxAuiMDIParentFrame::wxAuiMDIParentFrame(wxWindow *parent, - wxWindowID id, - const wxString& title, - const wxPoint& pos, - const wxSize& size, - long style, - const wxString& name) -{ - Init(); - (void)Create(parent, id, title, pos, size, style, name); -} - -wxAuiMDIParentFrame::~wxAuiMDIParentFrame() -{ - // Make sure the client window is destructed before the menu bars are! - wxDELETE(m_pClientWindow); - -#if wxUSE_MENUS - wxDELETE(m_pMyMenuBar); - RemoveWindowMenu(GetMenuBar()); - wxDELETE(m_pWindowMenu); -#endif // wxUSE_MENUS -} - -bool wxAuiMDIParentFrame::Create(wxWindow *parent, - wxWindowID id, - const wxString& title, - const wxPoint& pos, - const wxSize& size, - long style, - const wxString& name) -{ -#if wxUSE_MENUS - // this style can be used to prevent a window from having the standard MDI - // "Window" menu - if (!(style & wxFRAME_NO_WINDOW_MENU)) - { - m_pWindowMenu = new wxMenu; - m_pWindowMenu->Append(wxWINDOWCLOSE, _("Cl&ose")); - m_pWindowMenu->Append(wxWINDOWCLOSEALL, _("Close All")); - m_pWindowMenu->AppendSeparator(); - m_pWindowMenu->Append(wxWINDOWNEXT, _("&Next")); - m_pWindowMenu->Append(wxWINDOWPREV, _("&Previous")); - } -#endif // wxUSE_MENUS - - wxFrame::Create(parent, id, title, pos, size, style, name); - OnCreateClient(); - return true; -} - - -void wxAuiMDIParentFrame::SetArtProvider(wxAuiTabArt* provider) -{ - if (m_pClientWindow) - { - m_pClientWindow->SetArtProvider(provider); - } -} - -wxAuiTabArt* wxAuiMDIParentFrame::GetArtProvider() -{ - if (!m_pClientWindow) - return NULL; - - return m_pClientWindow->GetArtProvider(); -} - -wxAuiNotebook* wxAuiMDIParentFrame::GetNotebook() const -{ - return wx_static_cast(wxAuiNotebook*, m_pClientWindow); -} - - - -#if wxUSE_MENUS -void wxAuiMDIParentFrame::SetWindowMenu(wxMenu* pMenu) -{ - // Replace the window menu from the currently loaded menu bar. - wxMenuBar *pMenuBar = GetMenuBar(); - - if (m_pWindowMenu) - { - RemoveWindowMenu(pMenuBar); - wxDELETE(m_pWindowMenu); - } - - if (pMenu) - { - m_pWindowMenu = pMenu; - AddWindowMenu(pMenuBar); - } -} - -void wxAuiMDIParentFrame::SetMenuBar(wxMenuBar* pMenuBar) -{ - // Remove the Window menu from the old menu bar - RemoveWindowMenu(GetMenuBar()); - - // Add the Window menu to the new menu bar. - AddWindowMenu(pMenuBar); - - wxFrame::SetMenuBar(pMenuBar); - //m_pMyMenuBar = GetMenuBar(); -} -#endif // wxUSE_MENUS - -void wxAuiMDIParentFrame::SetChildMenuBar(wxAuiMDIChildFrame* pChild) -{ -#if wxUSE_MENUS - if (!pChild) - { - // No Child, set Our menu bar back. - if (m_pMyMenuBar) - SetMenuBar(m_pMyMenuBar); - else - SetMenuBar(GetMenuBar()); - - // Make sure we know our menu bar is in use - m_pMyMenuBar = NULL; - } - else - { - if (pChild->GetMenuBar() == NULL) - return; - - // Do we need to save the current bar? - if (m_pMyMenuBar == NULL) - m_pMyMenuBar = GetMenuBar(); - - SetMenuBar(pChild->GetMenuBar()); - } -#endif // wxUSE_MENUS -} - -bool wxAuiMDIParentFrame::ProcessEvent(wxEvent& event) -{ - // stops the same event being processed repeatedly - if (m_pLastEvt == &event) - return false; - m_pLastEvt = &event; - - // let the active child (if any) process the event first. - bool res = false; - if (m_pActiveChild && - event.IsCommandEvent() && - event.GetEventObject() != m_pClientWindow && - !(event.GetEventType() == wxEVT_ACTIVATE || - event.GetEventType() == wxEVT_SET_FOCUS || - event.GetEventType() == wxEVT_KILL_FOCUS || - event.GetEventType() == wxEVT_CHILD_FOCUS || - event.GetEventType() == wxEVT_COMMAND_SET_FOCUS || - event.GetEventType() == wxEVT_COMMAND_KILL_FOCUS ) - ) - { - res = m_pActiveChild->GetEventHandler()->ProcessEvent(event); - } - - if (!res) - { - // if the event was not handled this frame will handle it, - // which is why we need the protection code at the beginning - // of this method - res = wxEvtHandler::ProcessEvent(event); - } - - m_pLastEvt = NULL; - - return res; -} - -wxAuiMDIChildFrame *wxAuiMDIParentFrame::GetActiveChild() const -{ - return m_pActiveChild; -} - -void wxAuiMDIParentFrame::SetActiveChild(wxAuiMDIChildFrame* pChildFrame) -{ - m_pActiveChild = pChildFrame; -} - -wxAuiMDIClientWindow *wxAuiMDIParentFrame::GetClientWindow() const -{ - return m_pClientWindow; -} - -wxAuiMDIClientWindow *wxAuiMDIParentFrame::OnCreateClient() -{ - m_pClientWindow = new wxAuiMDIClientWindow( this ); - return m_pClientWindow; -} - -void wxAuiMDIParentFrame::ActivateNext() -{ - if (m_pClientWindow && m_pClientWindow->GetSelection() != wxNOT_FOUND) - { - size_t active = m_pClientWindow->GetSelection() + 1; - if (active >= m_pClientWindow->GetPageCount()) - active = 0; - - m_pClientWindow->SetSelection(active); - } -} - -void wxAuiMDIParentFrame::ActivatePrevious() -{ - if (m_pClientWindow && m_pClientWindow->GetSelection() != wxNOT_FOUND) - { - int active = m_pClientWindow->GetSelection() - 1; - if (active < 0) - active = m_pClientWindow->GetPageCount() - 1; - - m_pClientWindow->SetSelection(active); - } -} - -void wxAuiMDIParentFrame::Init() -{ - m_pLastEvt = NULL; - m_pClientWindow = NULL; - m_pActiveChild = NULL; -#if wxUSE_MENUS - m_pWindowMenu = NULL; - m_pMyMenuBar = NULL; -#endif // wxUSE_MENUS -} - -#if wxUSE_MENUS -void wxAuiMDIParentFrame::RemoveWindowMenu(wxMenuBar* pMenuBar) -{ - if (pMenuBar && m_pWindowMenu) - { - // Remove old window menu - int pos = pMenuBar->FindMenu(_("&Window")); - if (pos != wxNOT_FOUND) - { - // DBG:: We're going to delete the wrong menu!!! - wxASSERT(m_pWindowMenu == pMenuBar->GetMenu(pos)); - pMenuBar->Remove(pos); - } - } -} - -void wxAuiMDIParentFrame::AddWindowMenu(wxMenuBar *pMenuBar) -{ - if (pMenuBar && m_pWindowMenu) - { - int pos = pMenuBar->FindMenu(wxGetStockLabel(wxID_HELP,wxSTOCK_NOFLAGS)); - if (pos == wxNOT_FOUND) - pMenuBar->Append(m_pWindowMenu, _("&Window")); - else - pMenuBar->Insert(pos, m_pWindowMenu, _("&Window")); - } -} - -void wxAuiMDIParentFrame::DoHandleMenu(wxCommandEvent& event) -{ - switch (event.GetId()) - { - case wxWINDOWCLOSE: - if (m_pActiveChild) - m_pActiveChild->Close(); - break; - case wxWINDOWCLOSEALL: - while (m_pActiveChild) - { - if (!m_pActiveChild->Close()) - { - return; // failure - } - } - break; - case wxWINDOWNEXT: - ActivateNext(); - break; - case wxWINDOWPREV: - ActivatePrevious(); - break; - default: - event.Skip(); - } -} -#endif // wxUSE_MENUS - -void wxAuiMDIParentFrame::DoGetClientSize(int* width, int* height) const -{ - wxFrame::DoGetClientSize(width, height); -} - -void wxAuiMDIParentFrame::Tile(wxOrientation orient) -{ - wxAuiMDIClientWindow* client_window = GetClientWindow(); - wxASSERT_MSG(client_window, wxT("Missing MDI Client Window")); - - int cur_idx = client_window->GetSelection(); - if (cur_idx == -1) - return; - - if (orient == wxVERTICAL) - { - client_window->Split(cur_idx, wxLEFT); - } - else if (orient == wxHORIZONTAL) - { - client_window->Split(cur_idx, wxTOP); - } -} - - -//----------------------------------------------------------------------------- -// wxAuiMDIChildFrame -//----------------------------------------------------------------------------- - -IMPLEMENT_DYNAMIC_CLASS(wxAuiMDIChildFrame, wxPanel) - -BEGIN_EVENT_TABLE(wxAuiMDIChildFrame, wxPanel) - EVT_MENU_HIGHLIGHT_ALL(wxAuiMDIChildFrame::OnMenuHighlight) - EVT_ACTIVATE(wxAuiMDIChildFrame::OnActivate) - EVT_CLOSE(wxAuiMDIChildFrame::OnCloseWindow) -END_EVENT_TABLE() - -wxAuiMDIChildFrame::wxAuiMDIChildFrame() -{ - Init(); -} - -wxAuiMDIChildFrame::wxAuiMDIChildFrame(wxAuiMDIParentFrame *parent, - wxWindowID id, - const wxString& title, - const wxPoint& WXUNUSED(pos), - const wxSize& size, - long style, - const wxString& name) -{ - Init(); - - // There are two ways to create an tabbed mdi child fram without - // making it the active document. Either Show(false) can be called - // before Create() (as is customary on some ports with wxFrame-type - // windows), or wxMINIMIZE can be passed in the style flags. Note that - // wxAuiMDIChildFrame is not really derived from wxFrame, as wxMDIChildFrame - // is, but those are the expected symantics. No style flag is passed - // onto the panel underneath. - if (style & wxMINIMIZE) - m_activate_on_create = false; - - Create(parent, id, title, wxDefaultPosition, size, 0, name); -} - -wxAuiMDIChildFrame::~wxAuiMDIChildFrame() -{ - wxAuiMDIParentFrame* pParentFrame = GetMDIParentFrame(); - if (pParentFrame) - { - if (pParentFrame->GetActiveChild() == this) - { - pParentFrame->SetActiveChild(NULL); - pParentFrame->SetChildMenuBar(NULL); - } - wxAuiMDIClientWindow* pClientWindow = pParentFrame->GetClientWindow(); - wxASSERT(pClientWindow); - int idx = pClientWindow->GetPageIndex(this); - if (idx != wxNOT_FOUND) - { - pClientWindow->RemovePage(idx); - } - } - -#if wxUSE_MENUS - wxDELETE(m_pMenuBar); -#endif // wxUSE_MENUS -} - -bool wxAuiMDIChildFrame::Create(wxAuiMDIParentFrame* parent, - wxWindowID id, - const wxString& title, - const wxPoint& WXUNUSED(pos), - const wxSize& size, - long style, - const wxString& name) -{ - wxAuiMDIClientWindow* pClientWindow = parent->GetClientWindow(); - wxASSERT_MSG((pClientWindow != (wxWindow*) NULL), wxT("Missing MDI client window.")); - - // see comment in constructor - if (style & wxMINIMIZE) - m_activate_on_create = false; - - wxSize cli_size = pClientWindow->GetClientSize(); - - // create the window off-screen to prevent flicker - wxPanel::Create(pClientWindow, - id, - wxPoint(cli_size.x+1, cli_size.y+1), - size, - wxNO_BORDER, name); - - DoShow(false); - - SetMDIParentFrame(parent); - - // this is the currently active child - parent->SetActiveChild(this); - - m_title = title; - - pClientWindow->AddPage(this, title, m_activate_on_create); - pClientWindow->Refresh(); - - return true; -} - -bool wxAuiMDIChildFrame::Destroy() -{ - wxAuiMDIParentFrame* pParentFrame = GetMDIParentFrame(); - wxASSERT_MSG(pParentFrame, wxT("Missing MDI Parent Frame")); - - wxAuiMDIClientWindow* pClientWindow = pParentFrame->GetClientWindow(); - wxASSERT_MSG(pClientWindow, wxT("Missing MDI Client Window")); - - if (pParentFrame->GetActiveChild() == this) - { - // deactivate ourself - wxActivateEvent event(wxEVT_ACTIVATE, false, GetId()); - event.SetEventObject(this); - GetEventHandler()->ProcessEvent(event); - - pParentFrame->SetActiveChild(NULL); - pParentFrame->SetChildMenuBar(NULL); - } - - size_t page_count = pClientWindow->GetPageCount(); - for (size_t pos = 0; pos < page_count; pos++) - { - if (pClientWindow->GetPage(pos) == this) - return pClientWindow->DeletePage(pos); - } - - return false; -} - -#if wxUSE_MENUS -void wxAuiMDIChildFrame::SetMenuBar(wxMenuBar *menu_bar) -{ - wxMenuBar *pOldMenuBar = m_pMenuBar; - m_pMenuBar = menu_bar; - - if (m_pMenuBar) - { - wxAuiMDIParentFrame* pParentFrame = GetMDIParentFrame(); - wxASSERT_MSG(pParentFrame, wxT("Missing MDI Parent Frame")); - - m_pMenuBar->SetParent(pParentFrame); - if (pParentFrame->GetActiveChild() == this) - { - // replace current menu bars - if (pOldMenuBar) - pParentFrame->SetChildMenuBar(NULL); - pParentFrame->SetChildMenuBar(this); - } - } -} - -wxMenuBar *wxAuiMDIChildFrame::GetMenuBar() const -{ - return m_pMenuBar; -} -#endif // wxUSE_MENUS - -void wxAuiMDIChildFrame::SetTitle(const wxString& title) -{ - m_title = title; - - wxAuiMDIParentFrame* pParentFrame = GetMDIParentFrame(); - wxASSERT_MSG(pParentFrame, wxT("Missing MDI Parent Frame")); - - wxAuiMDIClientWindow* pClientWindow = pParentFrame->GetClientWindow(); - if (pClientWindow != NULL) - { - size_t pos; - for (pos = 0; pos < pClientWindow->GetPageCount(); pos++) - { - if (pClientWindow->GetPage(pos) == this) - { - pClientWindow->SetPageText(pos, m_title); - break; - } - } - } -} - -wxString wxAuiMDIChildFrame::GetTitle() const -{ - return m_title; -} - -void wxAuiMDIChildFrame::SetIcons(const wxIconBundle& icons) -{ - // get icon with the system icon size - SetIcon(icons.GetIcon(-1)); - m_icon_bundle = icons; -} - -const wxIconBundle& wxAuiMDIChildFrame::GetIcons() const -{ - return m_icon_bundle; -} - -void wxAuiMDIChildFrame::SetIcon(const wxIcon& icon) -{ - wxAuiMDIParentFrame* pParentFrame = GetMDIParentFrame(); - wxASSERT_MSG(pParentFrame, wxT("Missing MDI Parent Frame")); - - m_icon = icon; - - wxBitmap bmp; - bmp.CopyFromIcon(m_icon); - - wxAuiMDIClientWindow* pClientWindow = pParentFrame->GetClientWindow(); - if (pClientWindow != NULL) - { - int idx = pClientWindow->GetPageIndex(this); - - if (idx != -1) - { - pClientWindow->SetPageBitmap((size_t)idx, bmp); - } - } -} - -const wxIcon& wxAuiMDIChildFrame::GetIcon() const -{ - return m_icon; -} - - -void wxAuiMDIChildFrame::Activate() -{ - wxAuiMDIParentFrame* pParentFrame = GetMDIParentFrame(); - wxASSERT_MSG(pParentFrame, wxT("Missing MDI Parent Frame")); - - wxAuiMDIClientWindow* pClientWindow = pParentFrame->GetClientWindow(); - - if (pClientWindow != NULL) - { - size_t pos; - for (pos = 0; pos < pClientWindow->GetPageCount(); pos++) - { - if (pClientWindow->GetPage(pos) == this) - { - pClientWindow->SetSelection(pos); - break; - } - } - } -} - -void wxAuiMDIChildFrame::OnMenuHighlight(wxMenuEvent& event) -{ -#if wxUSE_STATUSBAR - if (m_pMDIParentFrame) - { - // we don't have any help text for this item, - // but may be the MDI frame does? - m_pMDIParentFrame->OnMenuHighlight(event); - } -#else - wxUnusedVar(event); -#endif // wxUSE_STATUSBAR -} - -void wxAuiMDIChildFrame::OnActivate(wxActivateEvent& WXUNUSED(event)) -{ - // do nothing -} - -void wxAuiMDIChildFrame::OnCloseWindow(wxCloseEvent& WXUNUSED(event)) -{ - Destroy(); -} - -void wxAuiMDIChildFrame::SetMDIParentFrame(wxAuiMDIParentFrame* parentFrame) -{ - m_pMDIParentFrame = parentFrame; -} - -wxAuiMDIParentFrame* wxAuiMDIChildFrame::GetMDIParentFrame() const -{ - return m_pMDIParentFrame; -} - -void wxAuiMDIChildFrame::Init() -{ - m_activate_on_create = true; - m_pMDIParentFrame = NULL; -#if wxUSE_MENUS - m_pMenuBar = NULL; -#endif // wxUSE_MENUS -} - -bool wxAuiMDIChildFrame::Show(bool show) -{ - m_activate_on_create = show; - - // do nothing - return true; -} - -void wxAuiMDIChildFrame::DoShow(bool show) -{ - wxWindow::Show(show); -} - -void wxAuiMDIChildFrame::DoSetSize(int x, int y, int width, int height, int sizeFlags) -{ - m_mdi_newrect = wxRect(x, y, width, height); -#ifdef __WXGTK__ - wxPanel::DoSetSize(x,y,width, height, sizeFlags); -#else - wxUnusedVar(sizeFlags); -#endif -} - -void wxAuiMDIChildFrame::DoMoveWindow(int x, int y, int width, int height) -{ - m_mdi_newrect = wxRect(x, y, width, height); -} - -void wxAuiMDIChildFrame::ApplyMDIChildFrameRect() -{ - if (m_mdi_currect != m_mdi_newrect) - { - wxPanel::DoMoveWindow(m_mdi_newrect.x, m_mdi_newrect.y, - m_mdi_newrect.width, m_mdi_newrect.height); - m_mdi_currect = m_mdi_newrect; - } -} - - -//----------------------------------------------------------------------------- -// wxAuiMDIClientWindow -//----------------------------------------------------------------------------- - -IMPLEMENT_DYNAMIC_CLASS(wxAuiMDIClientWindow, wxAuiNotebook) - -BEGIN_EVENT_TABLE(wxAuiMDIClientWindow, wxAuiNotebook) - EVT_AUINOTEBOOK_PAGE_CHANGED(wxID_ANY, wxAuiMDIClientWindow::OnPageChanged) - EVT_AUINOTEBOOK_PAGE_CLOSE(wxID_ANY, wxAuiMDIClientWindow::OnPageClose) - EVT_SIZE(wxAuiMDIClientWindow::OnSize) -END_EVENT_TABLE() - -wxAuiMDIClientWindow::wxAuiMDIClientWindow() -{ -} - -wxAuiMDIClientWindow::wxAuiMDIClientWindow(wxAuiMDIParentFrame* parent, long style) -{ - CreateClient(parent, style); -} - -wxAuiMDIClientWindow::~wxAuiMDIClientWindow() -{ -} - -bool wxAuiMDIClientWindow::CreateClient(wxAuiMDIParentFrame* parent, long style) -{ - SetWindowStyleFlag(style); - - wxSize caption_icon_size = - wxSize(wxSystemSettings::GetMetric(wxSYS_SMALLICON_X), - wxSystemSettings::GetMetric(wxSYS_SMALLICON_Y)); - SetUniformBitmapSize(caption_icon_size); - - if (!wxAuiNotebook::Create(parent, - wxID_ANY, - wxPoint(0,0), - wxSize(100, 100), - wxAUI_NB_DEFAULT_STYLE | wxNO_BORDER)) - { - return false; - } - - wxColour bkcolour = wxSystemSettings::GetColour(wxSYS_COLOUR_APPWORKSPACE); - SetOwnBackgroundColour(bkcolour); - - m_mgr.GetArtProvider()->SetColour(wxAUI_DOCKART_BACKGROUND_COLOUR, bkcolour); - - return true; -} - -int wxAuiMDIClientWindow::SetSelection(size_t nPage) -{ - return wxAuiNotebook::SetSelection(nPage); -} - -void wxAuiMDIClientWindow::PageChanged(int old_selection, int new_selection) -{ - // don't do anything if the page doesn't actually change - if (old_selection == new_selection) - return; - - /* - // don't do anything if the new page is already active - if (new_selection != -1) - { - wxAuiMDIChildFrame* child = (wxAuiMDIChildFrame*)GetPage(new_selection); - if (child->GetMDIParentFrame()->GetActiveChild() == child) - return; - }*/ - - - // notify old active child that it has been deactivated - if ((old_selection != -1) && (old_selection < (int)GetPageCount())) - { - wxAuiMDIChildFrame* old_child = (wxAuiMDIChildFrame*)GetPage(old_selection); - wxASSERT_MSG(old_child, wxT("wxAuiMDIClientWindow::PageChanged - null page pointer")); - - wxActivateEvent event(wxEVT_ACTIVATE, false, old_child->GetId()); - event.SetEventObject(old_child); - old_child->GetEventHandler()->ProcessEvent(event); - } - - // notify new active child that it has been activated - if (new_selection != -1) - { - wxAuiMDIChildFrame* active_child = (wxAuiMDIChildFrame*)GetPage(new_selection); - wxASSERT_MSG(active_child, wxT("wxAuiMDIClientWindow::PageChanged - null page pointer")); - - wxActivateEvent event(wxEVT_ACTIVATE, true, active_child->GetId()); - event.SetEventObject(active_child); - active_child->GetEventHandler()->ProcessEvent(event); - - if (active_child->GetMDIParentFrame()) - { - active_child->GetMDIParentFrame()->SetActiveChild(active_child); - active_child->GetMDIParentFrame()->SetChildMenuBar(active_child); - } - } - - -} - -void wxAuiMDIClientWindow::OnPageClose(wxAuiNotebookEvent& evt) -{ - wxAuiMDIChildFrame* - wnd = wx_static_cast(wxAuiMDIChildFrame*, GetPage(evt.GetSelection())); - - wnd->Close(); - - // regardless of the result of wnd->Close(), we've - // already taken care of the close operations, so - // suppress further processing - evt.Veto(); -} - -void wxAuiMDIClientWindow::OnPageChanged(wxAuiNotebookEvent& evt) -{ - PageChanged(evt.GetOldSelection(), evt.GetSelection()); -} - -void wxAuiMDIClientWindow::OnSize(wxSizeEvent& evt) -{ - wxAuiNotebook::OnSize(evt); - - for (size_t pos = 0; pos < GetPageCount(); pos++) - ((wxAuiMDIChildFrame *)GetPage(pos))->ApplyMDIChildFrameRect(); -} - -#endif // wxUSE_MDI - -#endif // wxUSE_AUI diff --git a/wxWidgets/src/common/accesscmn.cpp b/wxWidgets/src/common/accesscmn.cpp deleted file mode 100644 index 1684258225..0000000000 --- a/wxWidgets/src/common/accesscmn.cpp +++ /dev/null @@ -1,26 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: common/accesscmn.cpp -// Author: Julian Smart -// Modified by: -// Created: 2003-02-12 -// RCS-ID: $Id: accesscmn.cpp 35650 2005-09-23 12:56:45Z MR $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_ACCESSIBILITY - -#include "wx/access.h" - -#endif - diff --git a/wxWidgets/src/common/anidecod.cpp b/wxWidgets/src/common/anidecod.cpp deleted file mode 100644 index 4a905f8021..0000000000 --- a/wxWidgets/src/common/anidecod.cpp +++ /dev/null @@ -1,345 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/common/anidecod.cpp -// Purpose: wxANIDecoder, ANI reader for wxImage and wxAnimation -// Author: Francesco Montorsi -// RCS-ID: $Id: anidecod.cpp 43898 2006-12-10 14:18:37Z VZ $ -// Copyright: (c) Francesco Montorsi -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_STREAMS && wxUSE_ICO_CUR - -#include "wx/anidecod.h" - -#ifndef WX_PRECOMP - #include "wx/palette.h" -#endif - -#include -#include - -// static -wxCURHandler wxANIDecoder::sm_handler; - -//--------------------------------------------------------------------------- -// wxANIFrameInfo -//--------------------------------------------------------------------------- - -class wxANIFrameInfo -{ -public: - wxANIFrameInfo(unsigned int delay = 0, int idx = -1) - { m_delay=delay; m_imageIndex=idx; } - - unsigned int m_delay; - int m_imageIndex; -}; - -#include "wx/arrimpl.cpp" // this is a magic incantation which must be done! -WX_DEFINE_OBJARRAY(wxImageArray) - -#include "wx/arrimpl.cpp" // this is a magic incantation which must be done! -WX_DEFINE_OBJARRAY(wxANIFrameInfoArray) - - -//--------------------------------------------------------------------------- -// wxANIDecoder -//--------------------------------------------------------------------------- - -wxANIDecoder::wxANIDecoder() -{ -} - -wxANIDecoder::~wxANIDecoder() -{ -} - -bool wxANIDecoder::ConvertToImage(unsigned int frame, wxImage *image) const -{ - unsigned int idx = m_info[frame].m_imageIndex; - *image = m_images[idx]; // copy - return image->IsOk(); -} - - -//--------------------------------------------------------------------------- -// Data accessors -//--------------------------------------------------------------------------- - -wxSize wxANIDecoder::GetFrameSize(unsigned int WXUNUSED(frame)) const -{ - // all frames are of the same size... - return m_szAnimation; -} - -wxPoint wxANIDecoder::GetFramePosition(unsigned int WXUNUSED(frame)) const -{ - // all frames are of the same size... - return wxPoint(0,0); -} - -wxAnimationDisposal wxANIDecoder::GetDisposalMethod(unsigned int WXUNUSED(frame)) const -{ - // this disposal is implicit for all frames inside an ANI file - return wxANIM_TOBACKGROUND; -} - -long wxANIDecoder::GetDelay(unsigned int frame) const -{ - return m_info[frame].m_delay; -} - -wxColour wxANIDecoder::GetTransparentColour(unsigned int frame) const -{ - unsigned int idx = m_info[frame].m_imageIndex; - - if (!m_images[idx].HasMask()) - return wxNullColour; - - return wxColour(m_images[idx].GetMaskRed(), - m_images[idx].GetMaskGreen(), - m_images[idx].GetMaskBlue()); -} - - -//--------------------------------------------------------------------------- -// ANI reading and decoding -//--------------------------------------------------------------------------- - -bool wxANIDecoder::CanRead(wxInputStream& stream) const -{ - wxInt32 FCC1, FCC2; - wxUint32 datalen ; - - wxInt32 riff32; - memcpy( &riff32, "RIFF", 4 ); - wxInt32 list32; - memcpy( &list32, "LIST", 4 ); - wxInt32 ico32; - memcpy( &ico32, "icon", 4 ); - wxInt32 anih32; - memcpy( &anih32, "anih", 4 ); - - stream.SeekI(0); - if ( !stream.Read(&FCC1, 4) ) - return false; - - if ( FCC1 != riff32 ) - return false; - - // we have a riff file: - while ( stream.IsOk() ) - { - if ( FCC1 == anih32 ) - return true; // found the ANIH chunk - this should be an ANI file - - // we always have a data size: - stream.Read(&datalen, 4); - datalen = wxINT32_SWAP_ON_BE(datalen) ; - - // data should be padded to make even number of bytes - if (datalen % 2 == 1) datalen ++ ; - - // now either data or a FCC: - if ( (FCC1 == riff32) || (FCC1 == list32) ) - { - stream.Read(&FCC2, 4); - } - else - { - stream.SeekI(stream.TellI() + datalen); - } - - // try to read next data chunk: - if ( !stream.Read(&FCC1, 4) ) - { - // reading failed -- either EOF or IO error, bail out anyhow - return false; - } - } - - return false; -} - -// the "anih" RIFF chunk -struct wxANIHeader -{ - wxInt32 cbSizeOf; // Num bytes in AniHeader (36 bytes) - wxInt32 cFrames; // Number of unique Icons in this cursor - wxInt32 cSteps; // Number of Blits before the animation cycles - wxInt32 cx; // width of the frames - wxInt32 cy; // height of the frames - wxInt32 cBitCount; // bit depth - wxInt32 cPlanes; // 1 - wxInt32 JifRate; // Default Jiffies (1/60th of a second) if rate chunk not present. - wxInt32 flags; // Animation Flag (see AF_ constants) - - // ANI files are always little endian so we need to swap bytes on big - // endian architectures -#ifdef WORDS_BIGENDIAN - void AdjustEndianness() - { - // this works because all our fields are wxInt32 and they must be - // packed without holes between them (if they're not, they wouldn't map - // to the file header!) - wxInt32 * const start = (wxInt32 *)this; - wxInt32 * const end = start + sizeof(wxANIHeader)/sizeof(wxInt32); - for ( wxInt32 *p = start; p != end; p++ ) - { - *p = wxINT32_SWAP_ALWAYS(*p); - } - } -#else - void AdjustEndianness() { } -#endif -}; - -bool wxANIDecoder::Load( wxInputStream& stream ) -{ - wxInt32 FCC1, FCC2; - wxUint32 datalen; - unsigned int globaldelay=0; - - wxInt32 riff32; - memcpy( &riff32, "RIFF", 4 ); - wxInt32 list32; - memcpy( &list32, "LIST", 4 ); - wxInt32 ico32; - memcpy( &ico32, "icon", 4 ); - wxInt32 anih32; - memcpy( &anih32, "anih", 4 ); - wxInt32 rate32; - memcpy( &rate32, "rate", 4 ); - wxInt32 seq32; - memcpy( &seq32, "seq ", 4 ); - - stream.SeekI(0); - stream.Read(&FCC1, 4); - if ( FCC1 != riff32 ) - return false; - - m_nFrames = 0; - m_szAnimation = wxDefaultSize; - - m_images.Clear(); - m_info.Clear(); - - // we have a riff file: - while ( stream.IsOk() ) - { - // we always have a data size: - stream.Read(&datalen, 4); - datalen = wxINT32_SWAP_ON_BE(datalen); - - //data should be padded to make even number of bytes - if (datalen % 2 == 1) datalen++; - - // now either data or a FCC: - if ( (FCC1 == riff32) || (FCC1 == list32) ) - { - stream.Read(&FCC2, 4); - } - else if ( FCC1 == anih32 ) - { - if ( datalen != sizeof(wxANIHeader) ) - return false; - - if (m_nFrames > 0) - return false; // already parsed an ani header? - - struct wxANIHeader header; - stream.Read(&header, sizeof(wxANIHeader)); - header.AdjustEndianness(); - - // we should have a global frame size - m_szAnimation = wxSize(header.cx, header.cy); - - // save interesting info from the header - m_nFrames = header.cSteps; // NB: not cFrames!! - if ( m_nFrames == 0 ) - return false; - - globaldelay = header.JifRate * 1000 / 60; - - m_images.Alloc(header.cFrames); - m_info.Add(wxANIFrameInfo(), m_nFrames); - } - else if ( FCC1 == rate32 ) - { - // did we already process the anih32 chunk? - if (m_nFrames == 0) - return false; // rate chunks should always be placed after anih chunk - - wxASSERT(m_info.GetCount() == m_nFrames); - for (unsigned int i=0; i -// 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 - #ifdef __WXMSW__ - #include "wx/msw/wrapwin.h" // includes windows.h for MessageBox() - #endif - #include "wx/list.h" - #include "wx/app.h" - #include "wx/intl.h" - #include "wx/log.h" - #include "wx/utils.h" -#endif //WX_PRECOMP - -#include "wx/apptrait.h" -#include "wx/cmdline.h" -#include "wx/confbase.h" -#include "wx/filename.h" -#include "wx/msgout.h" -#include "wx/tokenzr.h" - -#if !defined(__WXMSW__) || defined(__WXMICROWIN__) - #include // for SIGTRAP used by wxTrap() -#endif //Win/Unix - -#if wxUSE_FONTMAP - #include "wx/fontmap.h" -#endif // wxUSE_FONTMAP - -#if defined(__DARWIN__) && defined(_MSL_USING_MW_C_HEADERS) && _MSL_USING_MW_C_HEADERS - // For MacTypes.h for Debugger function - #include -#endif - -#if defined(__WXMAC__) - #ifdef __DARWIN__ - #include - #else - #include "wx/mac/private.h" // includes mac headers - #endif -#endif // __WXMAC__ - -#ifdef __WXDEBUG__ - #if wxUSE_STACKWALKER - #include "wx/stackwalk.h" - #ifdef __WXMSW__ - #include "wx/msw/debughlp.h" - #endif - #endif // wxUSE_STACKWALKER - - #include "wx/recguard.h" -#endif // __WXDEBUG__ - -// wxABI_VERSION can be defined when compiling applications but it should be -// left undefined when compiling the library itself, it is then set to its -// default value in version.h -#if wxABI_VERSION != wxMAJOR_VERSION * 10000 + wxMINOR_VERSION * 100 + 99 -#error "wxABI_VERSION should not be defined when compiling the library" -#endif - -// ---------------------------------------------------------------------------- -// private functions prototypes -// ---------------------------------------------------------------------------- - -#ifdef __WXDEBUG__ - // really just show the assert dialog - static bool DoShowAssertDialog(const wxString& msg); - - // prepare for showing the assert dialog, use the given traits or - // DoShowAssertDialog() as last fallback to really show it - static - void ShowAssertDialog(const wxChar *szFile, - int nLine, - const wxChar *szFunc, - const wxChar *szCond, - const wxChar *szMsg, - wxAppTraits *traits = NULL); - - // turn on the trace masks specified in the env variable WXTRACE - static void LINKAGEMODE SetTraceMasks(); -#endif // __WXDEBUG__ - -// ---------------------------------------------------------------------------- -// global vars -// ---------------------------------------------------------------------------- - -wxAppConsole *wxAppConsole::ms_appInstance = NULL; - -wxAppInitializerFunction wxAppConsole::ms_appInitFn = NULL; - -// ============================================================================ -// wxAppConsole implementation -// ============================================================================ - -// ---------------------------------------------------------------------------- -// ctor/dtor -// ---------------------------------------------------------------------------- - -wxAppConsole::wxAppConsole() -{ - m_traits = NULL; - - ms_appInstance = this; - -#ifdef __WXDEBUG__ - SetTraceMasks(); -#if wxUSE_UNICODE - // In unicode mode the SetTraceMasks call can cause an apptraits to be - // created, but since we are still in the constructor the wrong kind will - // be created for GUI apps. Destroy it so it can be created again later. - delete m_traits; - m_traits = NULL; -#endif -#endif -} - -wxAppConsole::~wxAppConsole() -{ - delete m_traits; -} - -// ---------------------------------------------------------------------------- -// initilization/cleanup -// ---------------------------------------------------------------------------- - -bool wxAppConsole::Initialize(int& argcOrig, wxChar **argvOrig) -{ - // remember the command line arguments - argc = argcOrig; - argv = argvOrig; - -#ifndef __WXPALMOS__ - if ( m_appName.empty() && argv ) - { - // the application name is, by default, the name of its executable file - wxFileName::SplitPath(argv[0], NULL, &m_appName, NULL); - } -#endif - - return true; -} - -void wxAppConsole::CleanUp() -{ -} - -// ---------------------------------------------------------------------------- -// OnXXX() callbacks -// ---------------------------------------------------------------------------- - -bool wxAppConsole::OnInit() -{ -#if wxUSE_CMDLINE_PARSER - wxCmdLineParser parser(argc, argv); - - OnInitCmdLine(parser); - - bool cont; - switch ( parser.Parse(false /* don't show usage */) ) - { - case -1: - cont = OnCmdLineHelp(parser); - break; - - case 0: - cont = OnCmdLineParsed(parser); - break; - - default: - cont = OnCmdLineError(parser); - break; - } - - if ( !cont ) - return false; -#endif // wxUSE_CMDLINE_PARSER - - return true; -} - -int wxAppConsole::OnExit() -{ -#if wxUSE_CONFIG - // delete the config object if any (don't use Get() here, but Set() - // because Get() could create a new config object) - delete wxConfigBase::Set((wxConfigBase *) NULL); -#endif // wxUSE_CONFIG - - return 0; -} - -void wxAppConsole::Exit() -{ - exit(-1); -} - -// ---------------------------------------------------------------------------- -// traits stuff -// ---------------------------------------------------------------------------- - -wxAppTraits *wxAppConsole::CreateTraits() -{ - return new wxConsoleAppTraits; -} - -wxAppTraits *wxAppConsole::GetTraits() -{ - // FIXME-MT: protect this with a CS? - if ( !m_traits ) - { - m_traits = CreateTraits(); - - wxASSERT_MSG( m_traits, _T("wxApp::CreateTraits() failed?") ); - } - - return m_traits; -} - -// we must implement CreateXXX() in wxApp itself for backwards compatibility -#if WXWIN_COMPATIBILITY_2_4 - -#if wxUSE_LOG - -wxLog *wxAppConsole::CreateLogTarget() -{ - wxAppTraits *traits = GetTraits(); - return traits ? traits->CreateLogTarget() : NULL; -} - -#endif // wxUSE_LOG - -wxMessageOutput *wxAppConsole::CreateMessageOutput() -{ - wxAppTraits *traits = GetTraits(); - return traits ? traits->CreateMessageOutput() : NULL; -} - -#endif // WXWIN_COMPATIBILITY_2_4 - -// ---------------------------------------------------------------------------- -// event processing -// ---------------------------------------------------------------------------- - -void wxAppConsole::ProcessPendingEvents() -{ -#if wxUSE_THREADS - if ( !wxPendingEventsLocker ) - return; -#endif - - // ensure that we're the only thread to modify the pending events list - wxENTER_CRIT_SECT( *wxPendingEventsLocker ); - - if ( !wxPendingEvents ) - { - wxLEAVE_CRIT_SECT( *wxPendingEventsLocker ); - return; - } - - // iterate until the list becomes empty - wxList::compatibility_iterator node = wxPendingEvents->GetFirst(); - while (node) - { - wxEvtHandler *handler = (wxEvtHandler *)node->GetData(); - wxPendingEvents->Erase(node); - - // In ProcessPendingEvents(), new handlers might be add - // and we can safely leave the critical section here. - wxLEAVE_CRIT_SECT( *wxPendingEventsLocker ); - - handler->ProcessPendingEvents(); - - wxENTER_CRIT_SECT( *wxPendingEventsLocker ); - - node = wxPendingEvents->GetFirst(); - } - - wxLEAVE_CRIT_SECT( *wxPendingEventsLocker ); -} - -int wxAppConsole::FilterEvent(wxEvent& WXUNUSED(event)) -{ - // process the events normally by default - return -1; -} - -// ---------------------------------------------------------------------------- -// exception handling -// ---------------------------------------------------------------------------- - -#if wxUSE_EXCEPTIONS - -void -wxAppConsole::HandleEvent(wxEvtHandler *handler, - wxEventFunction func, - wxEvent& event) const -{ - // by default, simply call the handler - (handler->*func)(event); -} - -#endif // wxUSE_EXCEPTIONS - -// ---------------------------------------------------------------------------- -// cmd line parsing -// ---------------------------------------------------------------------------- - -#if wxUSE_CMDLINE_PARSER - -#define OPTION_VERBOSE _T("verbose") - -void wxAppConsole::OnInitCmdLine(wxCmdLineParser& parser) -{ - // the standard command line options - static const wxCmdLineEntryDesc cmdLineDesc[] = - { - { - wxCMD_LINE_SWITCH, - _T("h"), - _T("help"), - gettext_noop("show this help message"), - wxCMD_LINE_VAL_NONE, - wxCMD_LINE_OPTION_HELP - }, - -#if wxUSE_LOG - { - wxCMD_LINE_SWITCH, - wxEmptyString, - OPTION_VERBOSE, - gettext_noop("generate verbose log messages"), - wxCMD_LINE_VAL_NONE, - 0x0 - }, -#endif // wxUSE_LOG - - // terminator - { - wxCMD_LINE_NONE, - wxEmptyString, - wxEmptyString, - wxEmptyString, - wxCMD_LINE_VAL_NONE, - 0x0 - } - }; - - parser.SetDesc(cmdLineDesc); -} - -bool wxAppConsole::OnCmdLineParsed(wxCmdLineParser& parser) -{ -#if wxUSE_LOG - if ( parser.Found(OPTION_VERBOSE) ) - { - wxLog::SetVerbose(true); - } -#else - wxUnusedVar(parser); -#endif // wxUSE_LOG - - return true; -} - -bool wxAppConsole::OnCmdLineHelp(wxCmdLineParser& parser) -{ - parser.Usage(); - - return false; -} - -bool wxAppConsole::OnCmdLineError(wxCmdLineParser& parser) -{ - parser.Usage(); - - return false; -} - -#endif // wxUSE_CMDLINE_PARSER - -// ---------------------------------------------------------------------------- -// debugging support -// ---------------------------------------------------------------------------- - -/* static */ -bool wxAppConsole::CheckBuildOptions(const char *optionsSignature, - const char *componentName) -{ -#if 0 // can't use wxLogTrace, not up and running yet - printf("checking build options object '%s' (ptr %p) in '%s'\n", - optionsSignature, optionsSignature, componentName); -#endif - - if ( strcmp(optionsSignature, WX_BUILD_OPTIONS_SIGNATURE) != 0 ) - { - wxString lib = wxString::FromAscii(WX_BUILD_OPTIONS_SIGNATURE); - wxString prog = wxString::FromAscii(optionsSignature); - wxString progName = wxString::FromAscii(componentName); - wxString msg; - - msg.Printf(_T("Mismatch between the program and library build versions detected.\nThe library used %s,\nand %s used %s."), - lib.c_str(), progName.c_str(), prog.c_str()); - - wxLogFatalError(msg.c_str()); - - // normally wxLogFatalError doesn't return - return false; - } -#undef wxCMP - - return true; -} - -#ifdef __WXDEBUG__ - -void wxAppConsole::OnAssertFailure(const wxChar *file, - int line, - const wxChar *func, - const wxChar *cond, - const wxChar *msg) -{ - ShowAssertDialog(file, line, func, cond, msg, GetTraits()); -} - -void wxAppConsole::OnAssert(const wxChar *file, - int line, - const wxChar *cond, - const wxChar *msg) -{ - OnAssertFailure(file, line, NULL, cond, msg); -} - -#endif // __WXDEBUG__ - -#if WXWIN_COMPATIBILITY_2_4 - -bool wxAppConsole::CheckBuildOptions(const wxBuildOptions& buildOptions) -{ - return CheckBuildOptions(buildOptions.m_signature, "your program"); -} - -#endif - -// ============================================================================ -// other classes implementations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// wxConsoleAppTraitsBase -// ---------------------------------------------------------------------------- - -#if wxUSE_LOG - -wxLog *wxConsoleAppTraitsBase::CreateLogTarget() -{ - return new wxLogStderr; -} - -#endif // wxUSE_LOG - -wxMessageOutput *wxConsoleAppTraitsBase::CreateMessageOutput() -{ - return new wxMessageOutputStderr; -} - -#if wxUSE_FONTMAP - -wxFontMapper *wxConsoleAppTraitsBase::CreateFontMapper() -{ - return (wxFontMapper *)new wxFontMapperBase; -} - -#endif // wxUSE_FONTMAP - -wxRendererNative *wxConsoleAppTraitsBase::CreateRenderer() -{ - // console applications don't use renderers - return NULL; -} - -#ifdef __WXDEBUG__ -bool wxConsoleAppTraitsBase::ShowAssertDialog(const wxString& msg) -{ - return wxAppTraitsBase::ShowAssertDialog(msg); -} -#endif - -bool wxConsoleAppTraitsBase::HasStderr() -{ - // console applications always have stderr, even under Mac/Windows - return true; -} - -void wxConsoleAppTraitsBase::ScheduleForDestroy(wxObject *object) -{ - delete object; -} - -void wxConsoleAppTraitsBase::RemoveFromPendingDelete(wxObject * WXUNUSED(object)) -{ - // nothing to do -} - -#if wxUSE_SOCKETS -GSocketGUIFunctionsTable* wxConsoleAppTraitsBase::GetSocketGUIFunctionsTable() -{ - return NULL; -} -#endif - -// ---------------------------------------------------------------------------- -// wxAppTraits -// ---------------------------------------------------------------------------- - -#ifdef __WXDEBUG__ - -bool wxAppTraitsBase::ShowAssertDialog(const wxString& msgOriginal) -{ - wxString msg = msgOriginal; - -#if wxUSE_STACKWALKER -#if !defined(__WXMSW__) - // on Unix stack frame generation may take some time, depending on the - // size of the executable mainly... warn the user that we are working - wxFprintf(stderr, wxT("[Debug] Generating a stack trace... please wait")); - fflush(stderr); -#endif - - const wxString stackTrace = GetAssertStackTrace(); - if ( !stackTrace.empty() ) - msg << _T("\n\nCall stack:\n") << stackTrace; -#endif // wxUSE_STACKWALKER - - return DoShowAssertDialog(msg); -} - -#if wxUSE_STACKWALKER -wxString wxAppTraitsBase::GetAssertStackTrace() -{ - wxString stackTrace; - - class StackDump : public wxStackWalker - { - public: - StackDump() { } - - const wxString& GetStackTrace() const { return m_stackTrace; } - - protected: - virtual void OnStackFrame(const wxStackFrame& frame) - { - m_stackTrace << wxString::Format - ( - _T("[%02d] "), - wx_truncate_cast(int, frame.GetLevel()) - ); - - wxString name = frame.GetName(); - if ( !name.empty() ) - { - m_stackTrace << wxString::Format(_T("%-40s"), name.c_str()); - } - else - { - m_stackTrace << wxString::Format(_T("%p"), frame.GetAddress()); - } - - if ( frame.HasSourceLocation() ) - { - m_stackTrace << _T('\t') - << frame.GetFileName() - << _T(':') - << frame.GetLine(); - } - - m_stackTrace << _T('\n'); - } - - private: - wxString m_stackTrace; - }; - - // don't show more than maxLines or we could get a dialog too tall to be - // shown on screen: 20 should be ok everywhere as even with 15 pixel high - // characters it is still only 300 pixels... - static const int maxLines = 20; - - StackDump dump; - dump.Walk(2, maxLines); // don't show OnAssert() call itself - stackTrace = dump.GetStackTrace(); - - const int count = stackTrace.Freq(wxT('\n')); - for ( int i = 0; i < count - maxLines; i++ ) - stackTrace = stackTrace.BeforeLast(wxT('\n')); - - return stackTrace; -} -#endif // wxUSE_STACKWALKER - - -#endif // __WXDEBUG__ - -// ============================================================================ -// global functions implementation -// ============================================================================ - -void wxExit() -{ - if ( wxTheApp ) - { - wxTheApp->Exit(); - } - else - { - // what else can we do? - exit(-1); - } -} - -void wxWakeUpIdle() -{ - if ( wxTheApp ) - { - wxTheApp->WakeUpIdle(); - } - //else: do nothing, what can we do? -} - -#ifdef __WXDEBUG__ - -// wxASSERT() helper -bool wxAssertIsEqual(int x, int y) -{ - return x == y; -} - -// break into the debugger -void wxTrap() -{ -#if defined(__WXMSW__) && !defined(__WXMICROWIN__) - DebugBreak(); -#elif defined(__WXMAC__) && !defined(__DARWIN__) - #if __powerc - Debugger(); - #else - SysBreak(); - #endif -#elif defined(_MSL_USING_MW_C_HEADERS) && _MSL_USING_MW_C_HEADERS - Debugger(); -#elif defined(__UNIX__) - raise(SIGTRAP); -#else - // TODO -#endif // Win/Unix -} - -// this function is called when an assert fails -void wxOnAssert(const wxChar *szFile, - int nLine, - const char *szFunc, - const wxChar *szCond, - const wxChar *szMsg) -{ - // FIXME MT-unsafe - static int s_bInAssert = 0; - - wxRecursionGuard guard(s_bInAssert); - if ( guard.IsInside() ) - { - // can't use assert here to avoid infinite loops, so just trap - wxTrap(); - - return; - } - - // __FUNCTION__ is always in ASCII, convert it to wide char if needed - const wxString strFunc = wxString::FromAscii(szFunc); - - if ( !wxTheApp ) - { - // by default, show the assert dialog box -- we can't customize this - // behaviour - ShowAssertDialog(szFile, nLine, strFunc, szCond, szMsg); - } - else - { - // let the app process it as it wants - wxTheApp->OnAssertFailure(szFile, nLine, strFunc, szCond, szMsg); - } -} - -#endif // __WXDEBUG__ - -// ============================================================================ -// private functions implementation -// ============================================================================ - -#ifdef __WXDEBUG__ - -static void LINKAGEMODE SetTraceMasks() -{ -#if wxUSE_LOG - wxString mask; - if ( wxGetEnv(wxT("WXTRACE"), &mask) ) - { - wxStringTokenizer tkn(mask, wxT(",;:")); - while ( tkn.HasMoreTokens() ) - wxLog::AddTraceMask(tkn.GetNextToken()); - } -#endif // wxUSE_LOG -} - -bool DoShowAssertDialog(const wxString& msg) -{ - // under MSW we can show the dialog even in the console mode -#if defined(__WXMSW__) && !defined(__WXMICROWIN__) - wxString msgDlg(msg); - - // this message is intentionally not translated -- it is for - // developpers only - msgDlg += wxT("\nDo you want to stop the program?\n") - wxT("You can also choose [Cancel] to suppress ") - wxT("further warnings."); - - switch ( ::MessageBox(NULL, msgDlg, _T("wxWidgets Debug Alert"), - MB_YESNOCANCEL | MB_ICONSTOP ) ) - { - case IDYES: - wxTrap(); - break; - - case IDCANCEL: - // stop the asserts - return true; - - //case IDNO: nothing to do - } -#else // !__WXMSW__ - wxFprintf(stderr, wxT("%s\n"), msg.c_str()); - fflush(stderr); - - // TODO: ask the user to enter "Y" or "N" on the console? - wxTrap(); -#endif // __WXMSW__/!__WXMSW__ - - // continue with the asserts - return false; -} - -// show the assert modal dialog -static -void ShowAssertDialog(const wxChar *szFile, - int nLine, - const wxChar *szFunc, - const wxChar *szCond, - const wxChar *szMsg, - wxAppTraits *traits) -{ - // this variable can be set to true to suppress "assert failure" messages - static bool s_bNoAsserts = false; - - wxString msg; - msg.reserve(2048); - - // make life easier for people using VC++ IDE by using this format: like - // this, clicking on the message will take us immediately to the place of - // the failed assert - msg.Printf(wxT("%s(%d): assert \"%s\" failed"), szFile, nLine, szCond); - - // add the function name, if any - if ( szFunc && *szFunc ) - msg << _T(" in ") << szFunc << _T("()"); - - // and the message itself - if ( szMsg ) - { - msg << _T(": ") << szMsg; - } - else // no message given - { - msg << _T('.'); - } - -#if wxUSE_THREADS - // if we are not in the main thread, output the assert directly and trap - // since dialogs cannot be displayed - if ( !wxThread::IsMain() ) - { - msg += wxT(" [in child thread]"); - -#if defined(__WXMSW__) && !defined(__WXMICROWIN__) - msg << wxT("\r\n"); - OutputDebugString(msg ); -#else - // send to stderr - wxFprintf(stderr, wxT("%s\n"), msg.c_str()); - fflush(stderr); -#endif - // He-e-e-e-elp!! we're asserting in a child thread - wxTrap(); - } - else -#endif // wxUSE_THREADS - - if ( !s_bNoAsserts ) - { - // send it to the normal log destination - wxLogDebug(_T("%s"), msg.c_str()); - - if ( traits ) - { - // delegate showing assert dialog (if possible) to that class - s_bNoAsserts = traits->ShowAssertDialog(msg); - } - else // no traits object - { - // fall back to the function of last resort - s_bNoAsserts = DoShowAssertDialog(msg); - } - } -} - -#endif // __WXDEBUG__ diff --git a/wxWidgets/src/common/appcmn.cpp b/wxWidgets/src/common/appcmn.cpp deleted file mode 100644 index bc1a30c11f..0000000000 --- a/wxWidgets/src/common/appcmn.cpp +++ /dev/null @@ -1,691 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/common/appcmn.cpp -// Purpose: wxAppConsole and wxAppBase methods common to all platforms -// Author: Vadim Zeitlin -// Modified by: -// Created: 18.10.99 -// RCS-ID: $Id: appcmn.cpp 47229 2007-07-08 05:31:32Z PC $ -// Copyright: (c) Vadim Zeitlin -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declarations -// ============================================================================ - -// --------------------------------------------------------------------------- -// headers -// --------------------------------------------------------------------------- - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#if defined(__BORLANDC__) - #pragma hdrstop -#endif - -#ifndef WX_PRECOMP - #include "wx/app.h" - #include "wx/window.h" - #include "wx/bitmap.h" - #include "wx/log.h" - #include "wx/msgdlg.h" - #include "wx/confbase.h" - #include "wx/utils.h" -#endif - -#include "wx/apptrait.h" -#include "wx/cmdline.h" -#include "wx/evtloop.h" -#include "wx/msgout.h" -#include "wx/thread.h" -#include "wx/vidmode.h" -#include "wx/ptr_scpd.h" - -#ifdef __WXDEBUG__ - #if wxUSE_STACKWALKER - #include "wx/stackwalk.h" - #endif // wxUSE_STACKWALKER -#endif // __WXDEBUG__ - -#if defined(__WXMSW__) - #include "wx/msw/private.h" // includes windows.h for LOGFONT -#endif - -#if defined(__WXMAC__) - #include "wx/mac/private.h" -#endif - -#if wxUSE_FONTMAP - #include "wx/fontmap.h" -#endif // wxUSE_FONTMAP - -// DLL options compatibility check: -#include "wx/build.h" -WX_CHECK_BUILD_OPTIONS("wxCore") - -WXDLLIMPEXP_DATA_CORE(wxList) wxPendingDelete; - -// ---------------------------------------------------------------------------- -// wxEventLoopPtr -// ---------------------------------------------------------------------------- - -// this defines wxEventLoopPtr -wxDEFINE_TIED_SCOPED_PTR_TYPE(wxEventLoop) - -// ============================================================================ -// wxAppBase implementation -// ============================================================================ - -// ---------------------------------------------------------------------------- -// initialization -// ---------------------------------------------------------------------------- - -wxAppBase::wxAppBase() -{ - m_topWindow = (wxWindow *)NULL; - - m_useBestVisual = false; - m_forceTrueColour = false; - - m_isActive = true; - - m_mainLoop = NULL; - - // We don't want to exit the app if the user code shows a dialog from its - // OnInit() -- but this is what would happen if we set m_exitOnFrameDelete - // to Yes initially as this dialog would be the last top level window. - // OTOH, if we set it to No initially we'll have to overwrite it with Yes - // when we enter our OnRun() because we do want the default behaviour from - // then on. But this would be a problem if the user code calls - // SetExitOnFrameDelete(false) from OnInit(). - // - // So we use the special "Later" value which is such that - // GetExitOnFrameDelete() returns false for it but which we know we can - // safely (i.e. without losing the effect of the users SetExitOnFrameDelete - // call) overwrite in OnRun() - m_exitOnFrameDelete = Later; -} - -bool wxAppBase::Initialize(int& argcOrig, wxChar **argvOrig) -{ - if ( !wxAppConsole::Initialize(argcOrig, argvOrig) ) - return false; - -#if wxUSE_THREADS - wxPendingEventsLocker = new wxCriticalSection; -#endif - - wxInitializeStockLists(); - - wxBitmap::InitStandardHandlers(); - - return true; -} - -// ---------------------------------------------------------------------------- -// cleanup -// ---------------------------------------------------------------------------- - -wxAppBase::~wxAppBase() -{ - // this destructor is required for Darwin -} - -void wxAppBase::CleanUp() -{ - // clean up all the pending objects - DeletePendingObjects(); - - // and any remaining TLWs (they remove themselves from wxTopLevelWindows - // when destroyed, so iterate until none are left) - while ( !wxTopLevelWindows.empty() ) - { - // do not use Destroy() here as it only puts the TLW in pending list - // but we want to delete them now - delete wxTopLevelWindows.GetFirst()->GetData(); - } - - // undo everything we did in Initialize() above - wxBitmap::CleanUpHandlers(); - - wxStockGDI::DeleteAll(); - - wxDeleteStockLists(); - - delete wxTheColourDatabase; - wxTheColourDatabase = NULL; - - delete wxPendingEvents; - wxPendingEvents = NULL; - -#if wxUSE_THREADS - delete wxPendingEventsLocker; - wxPendingEventsLocker = NULL; - - #if wxUSE_VALIDATORS - // If we don't do the following, we get an apparent memory leak. - ((wxEvtHandler&) wxDefaultValidator).ClearEventLocker(); - #endif // wxUSE_VALIDATORS -#endif // wxUSE_THREADS -} - -// ---------------------------------------------------------------------------- -// various accessors -// ---------------------------------------------------------------------------- - -wxWindow* wxAppBase::GetTopWindow() const -{ - wxWindow* window = m_topWindow; - if (window == NULL && wxTopLevelWindows.GetCount() > 0) - window = wxTopLevelWindows.GetFirst()->GetData(); - return window; -} - -wxVideoMode wxAppBase::GetDisplayMode() const -{ - return wxVideoMode(); -} - -wxLayoutDirection wxAppBase::GetLayoutDirection() const -{ -#if wxUSE_INTL - const wxLocale *const locale = wxGetLocale(); - if ( locale ) - { - const wxLanguageInfo *const - info = wxLocale::GetLanguageInfo(locale->GetLanguage()); - - if ( info ) - return info->LayoutDirection; - } -#endif // wxUSE_INTL - - // we don't know - return wxLayout_Default; -} - -#if wxUSE_CMDLINE_PARSER - -// ---------------------------------------------------------------------------- -// GUI-specific command line options handling -// ---------------------------------------------------------------------------- - -#define OPTION_THEME _T("theme") -#define OPTION_MODE _T("mode") - -void wxAppBase::OnInitCmdLine(wxCmdLineParser& parser) -{ - // first add the standard non GUI options - wxAppConsole::OnInitCmdLine(parser); - - // the standard command line options - static const wxCmdLineEntryDesc cmdLineGUIDesc[] = - { -#ifdef __WXUNIVERSAL__ - { - wxCMD_LINE_OPTION, - wxEmptyString, - OPTION_THEME, - gettext_noop("specify the theme to use"), - wxCMD_LINE_VAL_STRING, - 0x0 - }, -#endif // __WXUNIVERSAL__ - -#if defined(__WXMGL__) - // VS: this is not specific to wxMGL, all fullscreen (framebuffer) ports - // should provide this option. That's why it is in common/appcmn.cpp - // and not mgl/app.cpp - { - wxCMD_LINE_OPTION, - wxEmptyString, - OPTION_MODE, - gettext_noop("specify display mode to use (e.g. 640x480-16)"), - wxCMD_LINE_VAL_STRING, - 0x0 - }, -#endif // __WXMGL__ - - // terminator - { - wxCMD_LINE_NONE, - wxEmptyString, - wxEmptyString, - wxEmptyString, - wxCMD_LINE_VAL_NONE, - 0x0 - } - }; - - parser.SetDesc(cmdLineGUIDesc); -} - -bool wxAppBase::OnCmdLineParsed(wxCmdLineParser& parser) -{ -#ifdef __WXUNIVERSAL__ - wxString themeName; - if ( parser.Found(OPTION_THEME, &themeName) ) - { - wxTheme *theme = wxTheme::Create(themeName); - if ( !theme ) - { - wxLogError(_("Unsupported theme '%s'."), themeName.c_str()); - return false; - } - - // Delete the defaultly created theme and set the new theme. - delete wxTheme::Get(); - wxTheme::Set(theme); - } -#endif // __WXUNIVERSAL__ - -#if defined(__WXMGL__) - wxString modeDesc; - if ( parser.Found(OPTION_MODE, &modeDesc) ) - { - unsigned w, h, bpp; - if ( wxSscanf(modeDesc.c_str(), _T("%ux%u-%u"), &w, &h, &bpp) != 3 ) - { - wxLogError(_("Invalid display mode specification '%s'."), modeDesc.c_str()); - return false; - } - - if ( !SetDisplayMode(wxVideoMode(w, h, bpp)) ) - return false; - } -#endif // __WXMGL__ - - return wxAppConsole::OnCmdLineParsed(parser); -} - -#endif // wxUSE_CMDLINE_PARSER - -// ---------------------------------------------------------------------------- -// main event loop implementation -// ---------------------------------------------------------------------------- - -int wxAppBase::MainLoop() -{ - wxEventLoopTiedPtr mainLoop(&m_mainLoop, new wxEventLoop); - - return m_mainLoop->Run(); -} - -void wxAppBase::ExitMainLoop() -{ - // we should exit from the main event loop, not just any currently active - // (e.g. modal dialog) event loop - if ( m_mainLoop && m_mainLoop->IsRunning() ) - { - m_mainLoop->Exit(0); - } -} - -bool wxAppBase::Pending() -{ - // use the currently active message loop here, not m_mainLoop, because if - // we're showing a modal dialog (with its own event loop) currently the - // main event loop is not running anyhow - wxEventLoop * const loop = wxEventLoop::GetActive(); - - return loop && loop->Pending(); -} - -bool wxAppBase::Dispatch() -{ - // see comment in Pending() - wxEventLoop * const loop = wxEventLoop::GetActive(); - - return loop && loop->Dispatch(); -} - -// ---------------------------------------------------------------------------- -// OnXXX() hooks -// ---------------------------------------------------------------------------- - -bool wxAppBase::OnInitGui() -{ -#ifdef __WXUNIVERSAL__ - if ( !wxTheme::Get() && !wxTheme::CreateDefault() ) - return false; -#endif // __WXUNIVERSAL__ - - return true; -} - -int wxAppBase::OnRun() -{ - // see the comment in ctor: if the initial value hasn't been changed, use - // the default Yes from now on - if ( m_exitOnFrameDelete == Later ) - { - m_exitOnFrameDelete = Yes; - } - //else: it has been changed, assume the user knows what he is doing - - return MainLoop(); -} - -int wxAppBase::OnExit() -{ -#ifdef __WXUNIVERSAL__ - delete wxTheme::Set(NULL); -#endif // __WXUNIVERSAL__ - - return wxAppConsole::OnExit(); -} - -void wxAppBase::Exit() -{ - ExitMainLoop(); -} - -wxAppTraits *wxAppBase::CreateTraits() -{ - return new wxGUIAppTraits; -} - -// ---------------------------------------------------------------------------- -// misc -// ---------------------------------------------------------------------------- - -void wxAppBase::SetActive(bool active, wxWindow * WXUNUSED(lastFocus)) -{ - if ( active == m_isActive ) - return; - - m_isActive = active; - - wxActivateEvent event(wxEVT_ACTIVATE_APP, active); - event.SetEventObject(this); - - (void)ProcessEvent(event); -} - -// ---------------------------------------------------------------------------- -// idle handling -// ---------------------------------------------------------------------------- - -void wxAppBase::DeletePendingObjects() -{ - wxList::compatibility_iterator node = wxPendingDelete.GetFirst(); - while (node) - { - wxObject *obj = node->GetData(); - - // remove it from the list first so that if we get back here somehow - // during the object deletion (e.g. wxYield called from its dtor) we - // wouldn't try to delete it the second time - if ( wxPendingDelete.Member(obj) ) - wxPendingDelete.Erase(node); - - delete obj; - - // Deleting one object may have deleted other pending - // objects, so start from beginning of list again. - node = wxPendingDelete.GetFirst(); - } -} - -// Returns true if more time is needed. -bool wxAppBase::ProcessIdle() -{ - // process pending wx events before sending idle events - ProcessPendingEvents(); - - wxIdleEvent event; - bool needMore = false; - wxWindowList::compatibility_iterator node = wxTopLevelWindows.GetFirst(); - while (node) - { - wxWindow* win = node->GetData(); - if (SendIdleEvents(win, event)) - needMore = true; - node = node->GetNext(); - } - - event.SetEventObject(this); - (void) ProcessEvent(event); - if (event.MoreRequested()) - needMore = true; - - // 'Garbage' collection of windows deleted with Close(). - DeletePendingObjects(); - -#if wxUSE_LOG - // flush the logged messages if any - wxLog::FlushActive(); -#endif - - wxUpdateUIEvent::ResetUpdateTime(); - - return needMore; -} - -// Send idle event to window and all subwindows -bool wxAppBase::SendIdleEvents(wxWindow* win, wxIdleEvent& event) -{ - bool needMore = false; - - win->OnInternalIdle(); - - if (wxIdleEvent::CanSend(win)) - { - event.SetEventObject(win); - win->GetEventHandler()->ProcessEvent(event); - - if (event.MoreRequested()) - needMore = true; - } - wxWindowList::compatibility_iterator node = win->GetChildren().GetFirst(); - while ( node ) - { - wxWindow *child = node->GetData(); - if (SendIdleEvents(child, event)) - needMore = true; - - node = node->GetNext(); - } - - return needMore; -} - -void wxAppBase::OnIdle(wxIdleEvent& WXUNUSED(event)) -{ -} - -// ---------------------------------------------------------------------------- -// exceptions support -// ---------------------------------------------------------------------------- - -#if wxUSE_EXCEPTIONS - -bool wxAppBase::OnExceptionInMainLoop() -{ - throw; - - // some compilers are too stupid to know that we never return after throw -#if defined(__DMC__) || (defined(_MSC_VER) && _MSC_VER < 1200) - return false; -#endif -} - -#endif // wxUSE_EXCEPTIONS - -// ---------------------------------------------------------------------------- -// wxGUIAppTraitsBase -// ---------------------------------------------------------------------------- - -#if wxUSE_LOG - -wxLog *wxGUIAppTraitsBase::CreateLogTarget() -{ -#if wxUSE_LOGGUI - return new wxLogGui; -#else - // we must have something! - return new wxLogStderr; -#endif -} - -#endif // wxUSE_LOG - -wxMessageOutput *wxGUIAppTraitsBase::CreateMessageOutput() -{ - // The standard way of printing help on command line arguments (app --help) - // is (according to common practice): - // - console apps: to stderr (on any platform) - // - GUI apps: stderr on Unix platforms (!) - // message box under Windows and others -#ifdef __UNIX__ - return new wxMessageOutputStderr; -#else // !__UNIX__ - // wxMessageOutputMessageBox doesn't work under Motif - #ifdef __WXMOTIF__ - return new wxMessageOutputLog; - #else - return new wxMessageOutputMessageBox; - #endif -#endif // __UNIX__/!__UNIX__ -} - -#if wxUSE_FONTMAP - -wxFontMapper *wxGUIAppTraitsBase::CreateFontMapper() -{ - return new wxFontMapper; -} - -#endif // wxUSE_FONTMAP - -wxRendererNative *wxGUIAppTraitsBase::CreateRenderer() -{ - // use the default native renderer by default - return NULL; -} - -#ifdef __WXDEBUG__ - -bool wxGUIAppTraitsBase::ShowAssertDialog(const wxString& msg) -{ -#if defined(__WXMSW__) || !wxUSE_MSGDLG - // under MSW we prefer to use the base class version using ::MessageBox() - // even if wxMessageBox() is available because it has less chances to - // double fault our app than our wxMessageBox() - return wxAppTraitsBase::ShowAssertDialog(msg); -#else // wxUSE_MSGDLG - wxString msgDlg = msg; - -#if wxUSE_STACKWALKER - // on Unix stack frame generation may take some time, depending on the - // size of the executable mainly... warn the user that we are working - wxFprintf(stderr, wxT("[Debug] Generating a stack trace... please wait")); - fflush(stderr); - - const wxString stackTrace = GetAssertStackTrace(); - if ( !stackTrace.empty() ) - msgDlg << _T("\n\nCall stack:\n") << stackTrace; -#endif // wxUSE_STACKWALKER - - // this message is intentionally not translated -- it is for - // developpers only - msgDlg += wxT("\nDo you want to stop the program?\n") - wxT("You can also choose [Cancel] to suppress ") - wxT("further warnings."); - -#ifdef __WXMAC__ - // in order to avoid reentrancy problems, use the lowest alert API available - CFOptionFlags exitButton; - wxMacCFStringHolder cfText(msgDlg); - OSStatus err = CFUserNotificationDisplayAlert( - 0, kAlertStopAlert, NULL, NULL, NULL, CFSTR("wxWidgets Debug Alert"), cfText, - CFSTR("Yes"), CFSTR("No"), CFSTR("Cancel"), &exitButton ); - if ( err == noErr ) - { - switch( exitButton ) - { - case 0 : // yes - wxTrap(); - break; - case 2 : // cancel - // no more asserts - return true; - case 1 : // no -> nothing to do - break ; - } - } -#else - switch ( wxMessageBox(msgDlg, wxT("wxWidgets Debug Alert"), - wxYES_NO | wxCANCEL | wxICON_STOP ) ) - { - case wxYES: - wxTrap(); - break; - - case wxCANCEL: - // no more asserts - return true; - - //case wxNO: nothing to do - } -#endif - return false; -#endif // !wxUSE_MSGDLG/wxUSE_MSGDLG -} - -#endif // __WXDEBUG__ - -bool wxGUIAppTraitsBase::HasStderr() -{ - // we consider that under Unix stderr always goes somewhere, even if the - // user doesn't always see it under GUI desktops -#ifdef __UNIX__ - return true; -#else - return false; -#endif -} - -void wxGUIAppTraitsBase::ScheduleForDestroy(wxObject *object) -{ - if ( !wxPendingDelete.Member(object) ) - wxPendingDelete.Append(object); -} - -void wxGUIAppTraitsBase::RemoveFromPendingDelete(wxObject *object) -{ - wxPendingDelete.DeleteObject(object); -} - -#if wxUSE_SOCKETS - -#if defined(__WINDOWS__) - #include "wx/msw/gsockmsw.h" -#elif defined(__UNIX__) || defined(__DARWIN__) || defined(__OS2__) - #include "wx/unix/gsockunx.h" -#elif defined(__WXMAC__) - #include - #define OTUNIXERRORS 1 - #include - #include - #include - - #include "wx/mac/gsockmac.h" -#else - #error "Must include correct GSocket header here" -#endif - -GSocketGUIFunctionsTable* wxGUIAppTraitsBase::GetSocketGUIFunctionsTable() -{ -#if defined(__WXMAC__) && !defined(__DARWIN__) - // NB: wxMac CFM does not have any GUI-specific functions in gsocket.c and - // so it doesn't need this table at all - return NULL; -#else // !__WXMAC__ || __DARWIN__ - static GSocketGUIFunctionsTableConcrete table; - return &table; -#endif // !__WXMAC__ || __DARWIN__ -} - -#endif diff --git a/wxWidgets/src/common/arcall.cpp b/wxWidgets/src/common/arcall.cpp deleted file mode 100644 index bedf19becd..0000000000 --- a/wxWidgets/src/common/arcall.cpp +++ /dev/null @@ -1,41 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/common/arcall.cpp -// Purpose: wxArchive link all archive streams -// Author: Mike Wetherell -// RCS-ID: $Id: arcall.cpp 42508 2006-10-27 09:53:38Z MW $ -// Copyright: (c) 2006 Mike Wetherell -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_ARCHIVE_STREAMS - -#if wxUSE_ZIPSTREAM -#include "wx/zipstrm.h" -#endif -#if wxUSE_TARSTREAM -#include "wx/tarstrm.h" -#endif - -// Reference archive classes to ensure they are linked into a statically -// linked program that uses Find or GetFirst to look for an archive handler. -// It is in its own file so that the user can override this behaviour by -// providing their own implementation. - -void wxUseArchiveClasses() -{ -#if wxUSE_ZIPSTREAM - wxZipClassFactory(); -#endif -#if wxUSE_TARSTREAM - wxTarClassFactory(); -#endif -} - -#endif // wxUSE_ARCHIVE_STREAMS diff --git a/wxWidgets/src/common/arcfind.cpp b/wxWidgets/src/common/arcfind.cpp deleted file mode 100644 index c105dc640c..0000000000 --- a/wxWidgets/src/common/arcfind.cpp +++ /dev/null @@ -1,43 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/common/arcfind.cpp -// Purpose: Streams for archive formats -// Author: Mike Wetherell -// RCS-ID: $Id: arcfind.cpp 42508 2006-10-27 09:53:38Z MW $ -// Copyright: (c) Mike Wetherell -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_ARCHIVE_STREAMS - -#include "wx/archive.h" - -// These functions are in a separate file so that statically linked apps -// that do not call them to search for archive handlers will only link in -// the archive classes they use. - -const wxArchiveClassFactory * -wxArchiveClassFactory::Find(const wxChar *protocol, wxStreamProtocolType type) -{ - for (const wxArchiveClassFactory *f = GetFirst(); f; f = f->GetNext()) - if (f->CanHandle(protocol, type)) - return f; - - return NULL; -} - -// static -const wxArchiveClassFactory *wxArchiveClassFactory::GetFirst() -{ - if (!sm_first) - wxUseArchiveClasses(); - return sm_first; -} - -#endif // wxUSE_ARCHIVE_STREAMS diff --git a/wxWidgets/src/common/archive.cpp b/wxWidgets/src/common/archive.cpp deleted file mode 100644 index 1c2dfdb44c..0000000000 --- a/wxWidgets/src/common/archive.cpp +++ /dev/null @@ -1,98 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/common/archive.cpp -// Purpose: Streams for archive formats -// Author: Mike Wetherell -// RCS-ID: $Id: archive.cpp 42508 2006-10-27 09:53:38Z MW $ -// Copyright: (c) Mike Wetherell -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_STREAMS && wxUSE_ARCHIVE_STREAMS - -#include "wx/archive.h" - -IMPLEMENT_ABSTRACT_CLASS(wxArchiveEntry, wxObject) -IMPLEMENT_ABSTRACT_CLASS(wxArchiveClassFactory, wxFilterClassFactoryBase) - - -///////////////////////////////////////////////////////////////////////////// -// wxArchiveInputStream - -wxArchiveInputStream::wxArchiveInputStream(wxInputStream& stream, - wxMBConv& conv) - : wxFilterInputStream(stream), - m_conv(conv) -{ -} - -wxArchiveInputStream::wxArchiveInputStream(wxInputStream *stream, - wxMBConv& conv) - : wxFilterInputStream(stream), - m_conv(conv) -{ -} - - -///////////////////////////////////////////////////////////////////////////// -// wxArchiveOutputStream - -wxArchiveOutputStream::wxArchiveOutputStream(wxOutputStream& stream, - wxMBConv& conv) - : wxFilterOutputStream(stream), - m_conv(conv) -{ -} - -wxArchiveOutputStream::wxArchiveOutputStream(wxOutputStream *stream, - wxMBConv& conv) - : wxFilterOutputStream(stream), - m_conv(conv) -{ -} - - -///////////////////////////////////////////////////////////////////////////// -// wxArchiveEntry - -void wxArchiveEntry::SetNotifier(wxArchiveNotifier& notifier) -{ - UnsetNotifier(); - m_notifier = ¬ifier; - m_notifier->OnEntryUpdated(*this); -} - -wxArchiveEntry& wxArchiveEntry::operator=(const wxArchiveEntry& WXUNUSED(e)) -{ - m_notifier = NULL; - return *this; -} - - -///////////////////////////////////////////////////////////////////////////// -// wxArchiveClassFactory - -wxArchiveClassFactory *wxArchiveClassFactory::sm_first = NULL; - -void wxArchiveClassFactory::Remove() -{ - if (m_next != this) - { - wxArchiveClassFactory **pp = &sm_first; - - while (*pp != this) - pp = &(*pp)->m_next; - - *pp = m_next; - - m_next = this; - } -} - -#endif // wxUSE_STREAMS && wxUSE_ARCHIVE_STREAMS diff --git a/wxWidgets/src/common/artprov.cpp b/wxWidgets/src/common/artprov.cpp deleted file mode 100644 index 5fec0e1c9e..0000000000 --- a/wxWidgets/src/common/artprov.cpp +++ /dev/null @@ -1,354 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/common/artprov.cpp -// Purpose: wxArtProvider class -// Author: Vaclav Slavik -// Modified by: -// Created: 18/03/2002 -// RCS-ID: $Id: artprov.cpp 57701 2008-12-31 23:40:06Z VS $ -// Copyright: (c) Vaclav Slavik -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// --------------------------------------------------------------------------- -// headers -// --------------------------------------------------------------------------- - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#if defined(__BORLANDC__) - #pragma hdrstop -#endif - -#include "wx/artprov.h" - -#ifndef WX_PRECOMP - #include "wx/list.h" - #include "wx/log.h" - #include "wx/hashmap.h" - #include "wx/image.h" - #include "wx/module.h" -#endif - -#ifdef __WXMSW__ - #include "wx/msw/wrapwin.h" -#endif - -// =========================================================================== -// implementation -// =========================================================================== - -#include "wx/listimpl.cpp" -WX_DECLARE_LIST(wxArtProvider, wxArtProvidersList); -WX_DEFINE_LIST(wxArtProvidersList) - -// ---------------------------------------------------------------------------- -// Cache class - stores already requested bitmaps -// ---------------------------------------------------------------------------- - -WX_DECLARE_EXPORTED_STRING_HASH_MAP(wxBitmap, wxArtProviderBitmapsHash); - -class WXDLLEXPORT wxArtProviderCache -{ -public: - bool GetBitmap(const wxString& full_id, wxBitmap* bmp); - void PutBitmap(const wxString& full_id, const wxBitmap& bmp) - { m_bitmapsHash[full_id] = bmp; } - - void Clear(); - - static wxString ConstructHashID(const wxArtID& id, - const wxArtClient& client, - const wxSize& size); - -private: - wxArtProviderBitmapsHash m_bitmapsHash; -}; - -bool wxArtProviderCache::GetBitmap(const wxString& full_id, wxBitmap* bmp) -{ - wxArtProviderBitmapsHash::iterator entry = m_bitmapsHash.find(full_id); - if ( entry == m_bitmapsHash.end() ) - { - return false; - } - else - { - *bmp = entry->second; - return true; - } -} - -void wxArtProviderCache::Clear() -{ - m_bitmapsHash.clear(); -} - -/*static*/ wxString wxArtProviderCache::ConstructHashID( - const wxArtID& id, const wxArtClient& client, - const wxSize& size) -{ - wxString str; - str.Printf(wxT("%s-%s-%i-%i"), id.c_str(), client.c_str(), size.x, size.y); - return str; -} - - -// ============================================================================ -// wxArtProvider class -// ============================================================================ - -IMPLEMENT_ABSTRACT_CLASS(wxArtProvider, wxObject) - -wxArtProvidersList *wxArtProvider::sm_providers = NULL; -wxArtProviderCache *wxArtProvider::sm_cache = NULL; - -// ---------------------------------------------------------------------------- -// wxArtProvider ctors/dtor -// ---------------------------------------------------------------------------- - -wxArtProvider::~wxArtProvider() -{ - Remove(this); -} - -// ---------------------------------------------------------------------------- -// wxArtProvider operations on provider stack -// ---------------------------------------------------------------------------- - -/*static*/ void wxArtProvider::CommonAddingProvider() -{ - if ( !sm_providers ) - { - sm_providers = new wxArtProvidersList; - sm_cache = new wxArtProviderCache; - } - - sm_cache->Clear(); -} - -/*static*/ void wxArtProvider::Push(wxArtProvider *provider) -{ - CommonAddingProvider(); - sm_providers->Insert(provider); -} - -/*static*/ void wxArtProvider::Insert(wxArtProvider *provider) -{ - CommonAddingProvider(); - sm_providers->Append(provider); -} - -/*static*/ void wxArtProvider::PushBack(wxArtProvider *provider) -{ - Insert(provider); -} - -/*static*/ bool wxArtProvider::Pop() -{ - wxCHECK_MSG( sm_providers, false, _T("no wxArtProvider exists") ); - wxCHECK_MSG( !sm_providers->empty(), false, _T("wxArtProviders stack is empty") ); - - delete sm_providers->GetFirst()->GetData(); - sm_cache->Clear(); - return true; -} - -/*static*/ bool wxArtProvider::Remove(wxArtProvider *provider) -{ - wxCHECK_MSG( sm_providers, false, _T("no wxArtProvider exists") ); - - if ( sm_providers->DeleteObject(provider) ) - { - sm_cache->Clear(); - return true; - } - - return false; -} - -/*static*/ bool wxArtProvider::Delete(wxArtProvider *provider) -{ - // provider will remove itself from the stack in its dtor - delete provider; - - return true; -} - -/*static*/ void wxArtProvider::CleanUpProviders() -{ - if ( sm_providers ) - { - while ( !sm_providers->empty() ) - delete *sm_providers->begin(); - - delete sm_providers; - sm_providers = NULL; - - delete sm_cache; - sm_cache = NULL; - } -} - -// ---------------------------------------------------------------------------- -// wxArtProvider: retrieving bitmaps/icons -// ---------------------------------------------------------------------------- - -/*static*/ wxBitmap wxArtProvider::GetBitmap(const wxArtID& id, - const wxArtClient& client, - const wxSize& size) -{ - // safety-check against writing client,id,size instead of id,client,size: - wxASSERT_MSG( client.Last() == _T('C'), _T("invalid 'client' parameter") ); - - wxCHECK_MSG( sm_providers, wxNullBitmap, _T("no wxArtProvider exists") ); - - wxString hashId = wxArtProviderCache::ConstructHashID(id, client, size); - - wxBitmap bmp; - if ( !sm_cache->GetBitmap(hashId, &bmp) ) - { - for (wxArtProvidersList::compatibility_iterator node = sm_providers->GetFirst(); - node; node = node->GetNext()) - { - bmp = node->GetData()->CreateBitmap(id, client, size); - if ( bmp.Ok() ) - { -#if wxUSE_IMAGE && (!defined(__WXMSW__) || wxUSE_WXDIB) - if ( size != wxDefaultSize && - (bmp.GetWidth() != size.x || bmp.GetHeight() != size.y) ) - { - wxImage img = bmp.ConvertToImage(); - img.Rescale(size.x, size.y); - bmp = wxBitmap(img); - } -#endif - break; - } - } - - sm_cache->PutBitmap(hashId, bmp); - } - - return bmp; -} - -/*static*/ wxIcon wxArtProvider::GetIcon(const wxArtID& id, - const wxArtClient& client, - const wxSize& size) -{ - wxCHECK_MSG( sm_providers, wxNullIcon, _T("no wxArtProvider exists") ); - - wxBitmap bmp = GetBitmap(id, client, size); - if ( !bmp.Ok() ) - return wxNullIcon; - - wxIcon icon; - icon.CopyFromBitmap(bmp); - return icon; -} - -#if defined(__WXGTK20__) && !defined(__WXUNIVERSAL__) - #include "wx/gtk/private.h" - extern GtkIconSize wxArtClientToIconSize(const wxArtClient& client); -#endif // defined(__WXGTK20__) && !defined(__WXUNIVERSAL__) - -/*static*/ wxSize wxArtProvider::GetSizeHint(const wxArtClient& client, - bool platform_dependent) -{ - if (!platform_dependent) - { - wxArtProvidersList::compatibility_iterator node = sm_providers->GetFirst(); - if (node) - return node->GetData()->DoGetSizeHint(client); - } - - // else return platform dependent size - -#if defined(__WXGTK20__) && !defined(__WXUNIVERSAL__) - // Gtk has specific sizes for each client, see artgtk.cpp - GtkIconSize gtk_size = wxArtClientToIconSize(client); - // no size hints for this client - if (gtk_size == GTK_ICON_SIZE_INVALID) - return wxDefaultSize; - gint width, height; - gtk_icon_size_lookup( gtk_size, &width, &height); - return wxSize(width, height); -#else // !GTK+ 2 - // NB: These size hints may have to be adjusted per platform - if (client == wxART_TOOLBAR) - return wxSize(16, 15); - else if (client == wxART_MENU) - return wxSize(16, 15); - else if (client == wxART_FRAME_ICON) - { -#ifdef __WXMSW__ - return wxSize(::GetSystemMetrics(SM_CXSMICON), - ::GetSystemMetrics(SM_CYSMICON)); -#else - return wxSize(16, 16); -#endif // __WXMSW__/!__WXMSW__ - } - else if (client == wxART_CMN_DIALOG || client == wxART_MESSAGE_BOX) - return wxSize(32, 32); - else if (client == wxART_HELP_BROWSER) - return wxSize(16, 15); - else if (client == wxART_BUTTON) - return wxSize(16, 15); - else // wxART_OTHER or perhaps a user's client, no specified size - return wxDefaultSize; -#endif // GTK+ 2/else -} - -// ---------------------------------------------------------------------------- -// deprecated wxArtProvider methods -// ---------------------------------------------------------------------------- - -#if WXWIN_COMPATIBILITY_2_6 - -/* static */ void wxArtProvider::PushProvider(wxArtProvider *provider) -{ - Push(provider); -} - -/* static */ void wxArtProvider::InsertProvider(wxArtProvider *provider) -{ - Insert(provider); -} - -/* static */ bool wxArtProvider::PopProvider() -{ - return Pop(); -} - -/* static */ bool wxArtProvider::RemoveProvider(wxArtProvider *provider) -{ - // RemoveProvider() used to delete the provider being removed so this is - // not a typo, we must call Delete() and not Remove() here - return Delete(provider); -} - -#endif // WXWIN_COMPATIBILITY_2_6 - -// ============================================================================ -// wxArtProviderModule -// ============================================================================ - -class wxArtProviderModule: public wxModule -{ -public: - bool OnInit() - { - wxArtProvider::InitStdProvider(); - wxArtProvider::InitNativeProvider(); - return true; - } - void OnExit() - { - wxArtProvider::CleanUpProviders(); - } - - DECLARE_DYNAMIC_CLASS(wxArtProviderModule) -}; - -IMPLEMENT_DYNAMIC_CLASS(wxArtProviderModule, wxModule) diff --git a/wxWidgets/src/common/artstd.cpp b/wxWidgets/src/common/artstd.cpp deleted file mode 100644 index c50aae5f67..0000000000 --- a/wxWidgets/src/common/artstd.cpp +++ /dev/null @@ -1,267 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/common/artstd.cpp -// Purpose: stock wxArtProvider instance with default wxWin art -// Author: Vaclav Slavik -// Modified by: -// Created: 18/03/2002 -// RCS-ID: $Id: artstd.cpp 52561 2008-03-16 00:36:37Z VS $ -// Copyright: (c) Vaclav Slavik -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// --------------------------------------------------------------------------- -// headers -// --------------------------------------------------------------------------- - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#if defined(__BORLANDC__) - #pragma hdrstop -#endif - -#ifndef WX_PRECOMP - #include "wx/image.h" -#endif - -#include "wx/artprov.h" - -// ---------------------------------------------------------------------------- -// wxDefaultArtProvider -// ---------------------------------------------------------------------------- - -class wxDefaultArtProvider : public wxArtProvider -{ -protected: - virtual wxBitmap CreateBitmap(const wxArtID& id, const wxArtClient& client, - const wxSize& size); -}; - -// ---------------------------------------------------------------------------- -// helper macros -// ---------------------------------------------------------------------------- - -// Standard macro for getting a resource from XPM file: -#define ART(artId, xpmRc) \ - if ( id == artId ) return wxBitmap(xpmRc##_xpm); - -// There are two ways of getting the standard icon: either via XPMs or via -// wxIcon ctor. This depends on the platform: -#if defined(__WXUNIVERSAL__) - #define CREATE_STD_ICON(iconId, xpmRc) return wxNullBitmap; -#elif defined(__WXGTK__) || defined(__WXMOTIF__) - #define CREATE_STD_ICON(iconId, xpmRc) return wxBitmap(xpmRc##_xpm); -#else - #define CREATE_STD_ICON(iconId, xpmRc) \ - { \ - wxIcon icon(_T(iconId)); \ - wxBitmap bmp; \ - bmp.CopyFromIcon(icon); \ - return bmp; \ - } -#endif - -// Macro used in CreateBitmap to get wxICON_FOO icons: -#define ART_MSGBOX(artId, iconId, xpmRc) \ - if ( id == artId ) \ - { \ - CREATE_STD_ICON(#iconId, xpmRc) \ - } - -// ---------------------------------------------------------------------------- -// wxArtProvider::InitStdProvider -// ---------------------------------------------------------------------------- - -/*static*/ void wxArtProvider::InitStdProvider() -{ - wxArtProvider::Push(new wxDefaultArtProvider); -} - -#if !defined(__WXGTK20__) || defined(__WXUNIVERSAL__) -/*static*/ void wxArtProvider::InitNativeProvider() -{ -} -#endif - - -// ---------------------------------------------------------------------------- -// XPMs with the art -// ---------------------------------------------------------------------------- - - -#if defined(__WXGTK__) - #include "../../art/gtk/info.xpm" - #include "../../art/gtk/error.xpm" - #include "../../art/gtk/warning.xpm" - #include "../../art/gtk/question.xpm" -#elif defined(__WXMOTIF__) - #include "../../art/motif/info.xpm" - #include "../../art/motif/error.xpm" - #include "../../art/motif/warning.xpm" - #include "../../art/motif/question.xpm" -#endif - -#if wxUSE_HTML - #include "../../art/htmsidep.xpm" - #include "../../art/htmoptns.xpm" - #include "../../art/htmbook.xpm" - #include "../../art/htmfoldr.xpm" - #include "../../art/htmpage.xpm" -#endif // wxUSE_HTML - -#include "../../art/missimg.xpm" -#include "../../art/addbookm.xpm" -#include "../../art/delbookm.xpm" -#include "../../art/back.xpm" -#include "../../art/forward.xpm" -#include "../../art/up.xpm" -#include "../../art/down.xpm" -#include "../../art/toparent.xpm" -#include "../../art/fileopen.xpm" -#include "../../art/print.xpm" -#include "../../art/helpicon.xpm" -#include "../../art/tipicon.xpm" -#include "../../art/home.xpm" -#include "../../art/repview.xpm" -#include "../../art/listview.xpm" -#include "../../art/new_dir.xpm" -#include "../../art/harddisk.xpm" -#include "../../art/cdrom.xpm" -#include "../../art/floppy.xpm" -#include "../../art/removable.xpm" -#include "../../art/folder.xpm" -#include "../../art/folder_open.xpm" -#include "../../art/dir_up.xpm" -#include "../../art/exefile.xpm" -#include "../../art/deffile.xpm" -#include "../../art/tick.xpm" -#include "../../art/cross.xpm" - -#include "../../art/filesave.xpm" -#include "../../art/filesaveas.xpm" -#include "../../art/copy.xpm" -#include "../../art/cut.xpm" -#include "../../art/paste.xpm" -#include "../../art/delete.xpm" -#include "../../art/new.xpm" -#include "../../art/undo.xpm" -#include "../../art/redo.xpm" -#include "../../art/quit.xpm" -#include "../../art/find.xpm" -#include "../../art/findrepl.xpm" - - - -wxBitmap wxDefaultArtProvider_CreateBitmap(const wxArtID& id) -{ - // wxMessageBox icons: - ART_MSGBOX(wxART_ERROR, wxICON_ERROR, error) - ART_MSGBOX(wxART_INFORMATION, wxICON_INFORMATION, info) - ART_MSGBOX(wxART_WARNING, wxICON_WARNING, warning) - ART_MSGBOX(wxART_QUESTION, wxICON_QUESTION, question) - - // standard icons: -#if wxUSE_HTML - ART(wxART_HELP_SIDE_PANEL, htmsidep) - ART(wxART_HELP_SETTINGS, htmoptns) - ART(wxART_HELP_BOOK, htmbook) - ART(wxART_HELP_FOLDER, htmfoldr) - ART(wxART_HELP_PAGE, htmpage) -#endif // wxUSE_HTML - ART(wxART_MISSING_IMAGE, missimg) - ART(wxART_ADD_BOOKMARK, addbookm) - ART(wxART_DEL_BOOKMARK, delbookm) - ART(wxART_GO_BACK, back) - ART(wxART_GO_FORWARD, forward) - ART(wxART_GO_UP, up) - ART(wxART_GO_DOWN, down) - ART(wxART_GO_TO_PARENT, toparent) - ART(wxART_GO_HOME, home) - ART(wxART_FILE_OPEN, fileopen) - ART(wxART_PRINT, print) - ART(wxART_HELP, helpicon) - ART(wxART_TIP, tipicon) - ART(wxART_REPORT_VIEW, repview) - ART(wxART_LIST_VIEW, listview) - ART(wxART_NEW_DIR, new_dir) - ART(wxART_HARDDISK, harddisk) - ART(wxART_FLOPPY, floppy) - ART(wxART_CDROM, cdrom) - ART(wxART_REMOVABLE, removable) - ART(wxART_FOLDER, folder) - ART(wxART_FOLDER_OPEN, folder_open) - ART(wxART_GO_DIR_UP, dir_up) - ART(wxART_EXECUTABLE_FILE, exefile) - ART(wxART_NORMAL_FILE, deffile) - ART(wxART_TICK_MARK, tick) - ART(wxART_CROSS_MARK, cross) - - ART(wxART_FILE_SAVE, filesave) - ART(wxART_FILE_SAVE_AS, filesaveas) - ART(wxART_COPY, copy) - ART(wxART_CUT, cut) - ART(wxART_PASTE, paste) - ART(wxART_DELETE, delete) - ART(wxART_UNDO, undo) - ART(wxART_REDO, redo) - ART(wxART_QUIT, quit) - ART(wxART_FIND, find) - ART(wxART_FIND_AND_REPLACE, findrepl) - ART(wxART_NEW, new) - - - return wxNullBitmap; -} - -// ---------------------------------------------------------------------------- -// CreateBitmap routine -// ---------------------------------------------------------------------------- - -wxBitmap wxDefaultArtProvider::CreateBitmap(const wxArtID& id, - const wxArtClient& client, - const wxSize& reqSize) -{ - wxBitmap bmp = wxDefaultArtProvider_CreateBitmap(id); - -#if wxUSE_IMAGE && (!defined(__WXMSW__) || wxUSE_WXDIB) - if (bmp.Ok()) - { - // fit into transparent image with desired size hint from the client - if (reqSize == wxDefaultSize) - { - // find out if there is a desired size for this client - wxSize bestSize = GetSizeHint(client); - if (bestSize != wxDefaultSize) - { - int bmp_w = bmp.GetWidth(); - int bmp_h = bmp.GetHeight(); - - if ((bmp_h < bestSize.x) && (bmp_w < bestSize.y)) - { - // the caller wants default size, which is larger than - // the image we have; to avoid degrading it visually by - // scaling it up, paste it into transparent image instead: - wxPoint offset((bestSize.x - bmp_w)/2, (bestSize.y - bmp_h)/2); - wxImage img = bmp.ConvertToImage(); - img.Resize(bestSize, offset); - bmp = wxBitmap(img); - } - else // scale (down or mixed, but not up) - { - wxImage img = bmp.ConvertToImage(); - bmp = wxBitmap - ( - img.Scale(bestSize.x, bestSize.y, - wxIMAGE_QUALITY_HIGH) - ); - } - } - } - } -#else - wxUnusedVar(client); - wxUnusedVar(reqSize); -#endif // wxUSE_IMAGE - - return bmp; -} diff --git a/wxWidgets/src/common/base.rc b/wxWidgets/src/common/base.rc deleted file mode 100644 index 5a814417f0..0000000000 --- a/wxWidgets/src/common/base.rc +++ /dev/null @@ -1,49 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: src/base/base.rc -// Purpose: contains version info resource for wxBase DLL build -// Author: Vadim Zeitlin -// Modified by: -// Created: 09.07.00 -// RCS-ID: $Id: base.rc 13410 2002-01-06 14:51:28Z VS $ -// Copyright: (c) 2000 Vadim Zeitlin -// Licence: wxWindows license -/////////////////////////////////////////////////////////////////////////////// - -#include "wx/version.h" - -#ifdef _DEBUG - #define DLL_FLAGS 0x1L - #define DLL_SUFFIX "d" -#else - #define DLL_FLAGS 0x0L - #define DLL_SUFFIX "" -#endif - -1 VERSIONINFO - FILEVERSION wxMAJOR_VERSION,wxMINOR_VERSION,wxRELEASE_NUMBER,wxBETA_NUMBER - PRODUCTVERSION wxMAJOR_VERSION,wxMINOR_VERSION,wxRELEASE_NUMBER,wxBETA_NUMBER - FILEFLAGSMASK 0x3fL - FILEFLAGS DLL_FLAGS - FILEOS 0x40004L - FILETYPE 0x2L - FILESUBTYPE 0x0L -BEGIN - BLOCK "StringFileInfo" - BEGIN - BLOCK "040904b0" - BEGIN - VALUE "Comments", "wxBase (part of Windows) cross-platform framework\0" - VALUE "CompanyName", "wxWindows development team\0" - VALUE "FileDescription", "wxBase is a non GUI part of wxWindows\0" - VALUE "FileVersion", wxVERSION_NUM_DOT_STRING "\0" - VALUE "InternalName", "wxBase\0" - VALUE "LegalCopyright", "Copyright © 1993-2002 wxWindows development team\0" - VALUE "LegalTrademarks", "\0" - VALUE "OriginalFilename", "wxbase" wxVERSION_NUM_STRING DLL_SUFFIX ".dll\0" - VALUE "PrivateBuild", "\0" - VALUE "ProductName", "wxWindows\0" - VALUE "ProductVersion", wxVERSION_NUM_DOT_STRING "\0" - VALUE "SpecialBuild", "\0" - END - END -END diff --git a/wxWidgets/src/common/bmpbase.cpp b/wxWidgets/src/common/bmpbase.cpp deleted file mode 100644 index 0c7edd3ac2..0000000000 --- a/wxWidgets/src/common/bmpbase.cpp +++ /dev/null @@ -1,211 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/common/bmpbase.cpp -// Purpose: wxBitmapBase -// Author: VaclavSlavik -// Created: 2001/04/11 -// RCS-ID: $Id: bmpbase.cpp 42752 2006-10-30 19:26:48Z VZ $ -// Copyright: (c) 2001, Vaclav Slavik -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#include "wx/bitmap.h" - -#ifndef WX_PRECOMP - #include "wx/colour.h" - #include "wx/icon.h" - #include "wx/image.h" -#endif // WX_PRECOMP - -// ---------------------------------------------------------------------------- -// wxVariant support -// ---------------------------------------------------------------------------- - -#if wxUSE_VARIANT -IMPLEMENT_VARIANT_OBJECT_EXPORTED_SHALLOWCMP(wxBitmap,WXDLLEXPORT) -IMPLEMENT_VARIANT_OBJECT_EXPORTED_SHALLOWCMP(wxIcon,WXDLLEXPORT) -#endif - -// ---------------------------------------------------------------------------- -// wxBitmapBase -// ---------------------------------------------------------------------------- - -#if wxUSE_BITMAP_BASE - -#ifndef WX_PRECOMP - #include "wx/log.h" - #include "wx/utils.h" - #include "wx/palette.h" - #include "wx/module.h" -#endif // WX_PRECOMP - - -IMPLEMENT_ABSTRACT_CLASS(wxBitmapBase, wxGDIObject) -IMPLEMENT_ABSTRACT_CLASS(wxBitmapHandlerBase,wxObject) - -wxList wxBitmapBase::sm_handlers; - -void wxBitmapBase::AddHandler(wxBitmapHandlerBase *handler) -{ - sm_handlers.Append(handler); -} - -void wxBitmapBase::InsertHandler(wxBitmapHandlerBase *handler) -{ - sm_handlers.Insert(handler); -} - -bool wxBitmapBase::RemoveHandler(const wxString& name) -{ - wxBitmapHandler *handler = FindHandler(name); - if ( handler ) - { - sm_handlers.DeleteObject(handler); - return true; - } - else - return false; -} - -wxBitmapHandler *wxBitmapBase::FindHandler(const wxString& name) -{ - wxList::compatibility_iterator node = sm_handlers.GetFirst(); - while ( node ) - { - wxBitmapHandler *handler = (wxBitmapHandler *)node->GetData(); - if ( handler->GetName() == name ) - return handler; - node = node->GetNext(); - } - return NULL; -} - -wxBitmapHandler *wxBitmapBase::FindHandler(const wxString& extension, wxBitmapType bitmapType) -{ - wxList::compatibility_iterator node = sm_handlers.GetFirst(); - while ( node ) - { - wxBitmapHandler *handler = (wxBitmapHandler *)node->GetData(); - if ( handler->GetExtension() == extension && - (bitmapType == wxBITMAP_TYPE_ANY || handler->GetType() == bitmapType) ) - return handler; - node = node->GetNext(); - } - return NULL; -} - -wxBitmapHandler *wxBitmapBase::FindHandler(wxBitmapType bitmapType) -{ - wxList::compatibility_iterator node = sm_handlers.GetFirst(); - while ( node ) - { - wxBitmapHandler *handler = (wxBitmapHandler *)node->GetData(); - if (handler->GetType() == bitmapType) - return handler; - node = node->GetNext(); - } - return NULL; -} - -void wxBitmapBase::CleanUpHandlers() -{ - wxList::compatibility_iterator node = sm_handlers.GetFirst(); - while ( node ) - { - wxBitmapHandler *handler = (wxBitmapHandler *)node->GetData(); - wxList::compatibility_iterator next = node->GetNext(); - delete handler; - sm_handlers.Erase(node); - node = next; - } -} - -bool wxBitmapHandlerBase::Create(wxBitmap*, const void*, long, int, int, int) -{ - return false; -} - -bool wxBitmapHandlerBase::LoadFile(wxBitmap*, const wxString&, long, int, int) -{ - return false; -} - -bool wxBitmapHandlerBase::SaveFile(const wxBitmap*, const wxString&, int, const wxPalette*) -{ - return false; -} - -class wxBitmapBaseModule: public wxModule -{ -DECLARE_DYNAMIC_CLASS(wxBitmapBaseModule) -public: - wxBitmapBaseModule() {} - bool OnInit() { wxBitmap::InitStandardHandlers(); return true; } - void OnExit() { wxBitmap::CleanUpHandlers(); } -}; - -IMPLEMENT_DYNAMIC_CLASS(wxBitmapBaseModule, wxModule) - -#endif // wxUSE_BITMAP_BASE - -// ---------------------------------------------------------------------------- -// wxBitmap common -// ---------------------------------------------------------------------------- - -#if !(defined(__WXGTK__) || defined(__WXMOTIF__) || defined(__WXX11__)) - -wxBitmap::wxBitmap(const char* const* bits) -{ - wxCHECK2_MSG(bits != NULL, return, wxT("invalid bitmap data")); - -#if wxUSE_IMAGE && wxUSE_XPM - wxImage image(bits); - wxCHECK2_MSG(image.Ok(), return, wxT("invalid bitmap data")); - - *this = wxBitmap(image); -#else - wxFAIL_MSG(_T("creating bitmaps from XPMs not supported")); -#endif // wxUSE_IMAGE && wxUSE_XPM -} -#endif // !(defined(__WXGTK__) || defined(__WXMOTIF__) || defined(__WXX11__)) - -// ---------------------------------------------------------------------------- -// wxMaskBase -// ---------------------------------------------------------------------------- - -bool wxMaskBase::Create(const wxBitmap& bitmap, const wxColour& colour) -{ - FreeData(); - - return InitFromColour(bitmap, colour); -} - -#if wxUSE_PALETTE - -bool wxMaskBase::Create(const wxBitmap& bitmap, int paletteIndex) -{ - wxPalette *pal = bitmap.GetPalette(); - - wxCHECK_MSG( pal, false, - wxT("Cannot create mask from palette index of a bitmap without palette") ); - - unsigned char r,g,b; - pal->GetRGB(paletteIndex, &r, &g, &b); - - return Create(bitmap, wxColour(r, g, b)); -} - -#endif // wxUSE_PALETTE - -bool wxMaskBase::Create(const wxBitmap& bitmap) -{ - FreeData(); - - return InitFromMonoBitmap(bitmap); -} diff --git a/wxWidgets/src/common/bookctrl.cpp b/wxWidgets/src/common/bookctrl.cpp deleted file mode 100644 index ca6c2a5900..0000000000 --- a/wxWidgets/src/common/bookctrl.cpp +++ /dev/null @@ -1,497 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: src/common/bookctrl.cpp -// Purpose: wxBookCtrlBase implementation -// Author: Vadim Zeitlin -// Modified by: -// Created: 19.08.03 -// RCS-ID: $Id: bookctrl.cpp 53783 2008-05-27 14:15:14Z SC $ -// Copyright: (c) 2003 Vadim Zeitlin -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_BOOKCTRL - -#include "wx/imaglist.h" - -#include "wx/bookctrl.h" - -// ============================================================================ -// implementation -// ============================================================================ - -// ---------------------------------------------------------------------------- -// event table -// ---------------------------------------------------------------------------- - -IMPLEMENT_ABSTRACT_CLASS(wxBookCtrlBase, wxControl) - -BEGIN_EVENT_TABLE(wxBookCtrlBase, wxControl) - EVT_SIZE(wxBookCtrlBase::OnSize) -#if wxUSE_HELP - EVT_HELP(wxID_ANY, wxBookCtrlBase::OnHelp) -#endif // wxUSE_HELP -END_EVENT_TABLE() - -// ---------------------------------------------------------------------------- -// constructors and destructors -// ---------------------------------------------------------------------------- - -void wxBookCtrlBase::Init() -{ - m_bookctrl = NULL; - m_imageList = NULL; - m_ownsImageList = false; - m_fitToCurrentPage = false; - -#if defined(__WXWINCE__) - m_internalBorder = 1; -#else - m_internalBorder = 5; -#endif - - m_controlMargin = 0; - m_controlSizer = NULL; -} - -bool -wxBookCtrlBase::Create(wxWindow *parent, - wxWindowID id, - const wxPoint& pos, - const wxSize& size, - long style, - const wxString& name) -{ - return wxControl::Create - ( - parent, - id, - pos, - size, - style, - wxDefaultValidator, - name - ); -} - -wxBookCtrlBase::~wxBookCtrlBase() -{ - if ( m_ownsImageList ) - { - // may be NULL, ok - delete m_imageList; - } -} - -// ---------------------------------------------------------------------------- -// image list -// ---------------------------------------------------------------------------- - -void wxBookCtrlBase::SetImageList(wxImageList *imageList) -{ - if ( m_ownsImageList ) - { - // may be NULL, ok - delete m_imageList; - - m_ownsImageList = false; - } - - m_imageList = imageList; -} - -void wxBookCtrlBase::AssignImageList(wxImageList* imageList) -{ - SetImageList(imageList); - - m_ownsImageList = true; -} - -// ---------------------------------------------------------------------------- -// geometry -// ---------------------------------------------------------------------------- - -void wxBookCtrlBase::DoInvalidateBestSize() -{ - // notice that it is not necessary to invalidate our own best size - // explicitly if we have m_bookctrl as it will already invalidate the best - // size of its parent when its own size is invalidated and its parent is - // this control - if ( m_bookctrl ) - m_bookctrl->InvalidateBestSize(); - else - wxControl::InvalidateBestSize(); -} - -void wxBookCtrlBase::SetPageSize(const wxSize& size) -{ - SetClientSize(CalcSizeFromPage(size)); -} - -wxSize wxBookCtrlBase::DoGetBestSize() const -{ - wxSize bestSize; - - // iterate over all pages, get the largest width and height - const size_t nCount = m_pages.size(); - for ( size_t nPage = 0; nPage < nCount; nPage++ ) - { - const wxWindow * const pPage = m_pages[nPage]; - if( pPage ) - { - wxSize childBestSize(pPage->GetBestSize()); - - if ( childBestSize.x > bestSize.x ) - bestSize.x = childBestSize.x; - - if ( childBestSize.y > bestSize.y ) - bestSize.y = childBestSize.y; - } - } - - if (m_fitToCurrentPage && GetCurrentPage()) - bestSize = GetCurrentPage()->GetBestSize(); - - // convert display area to window area, adding the size necessary for the - // tabs - wxSize best = CalcSizeFromPage(bestSize); - CacheBestSize(best); - return best; -} - -wxRect wxBookCtrlBase::GetPageRect() const -{ - const wxSize size = GetControllerSize(); - - wxPoint pt; - wxRect rectPage(pt, GetClientSize()); - - switch ( GetWindowStyle() & wxBK_ALIGN_MASK ) - { - default: - wxFAIL_MSG( _T("unexpected alignment") ); - // fall through - - case wxBK_TOP: - rectPage.y = size.y + GetInternalBorder(); - // fall through - - case wxBK_BOTTOM: - rectPage.height -= size.y + GetInternalBorder(); - if (rectPage.height < 0) - rectPage.height = 0; - break; - - case wxBK_LEFT: - rectPage.x = size.x + GetInternalBorder(); - // fall through - - case wxBK_RIGHT: - rectPage.width -= size.x + GetInternalBorder(); - if (rectPage.width < 0) - rectPage.width = 0; - break; - } - - return rectPage; -} - -// Lay out controls -void wxBookCtrlBase::DoSize() -{ - if ( !m_bookctrl ) - { - // we're not fully created yet or OnSize() should be hidden by derived class - return; - } - - if (GetSizer()) - Layout(); - else - { - // resize controller and the page area to fit inside our new size - const wxSize sizeClient( GetClientSize() ), - sizeBorder( m_bookctrl->GetSize() - m_bookctrl->GetClientSize() ), - sizeCtrl( GetControllerSize() ); - - m_bookctrl->SetClientSize( sizeCtrl.x - sizeBorder.x, sizeCtrl.y - sizeBorder.y ); - // if this changes the visibility of the scrollbars the best size changes, relayout in this case - wxSize sizeCtrl2 = GetControllerSize(); - if ( sizeCtrl != sizeCtrl2 ) - { - wxSize sizeBorder2 = m_bookctrl->GetSize() - m_bookctrl->GetClientSize(); - m_bookctrl->SetClientSize( sizeCtrl2.x - sizeBorder2.x, sizeCtrl2.y - sizeBorder2.y ); - } - - const wxSize sizeNew = m_bookctrl->GetSize(); - wxPoint posCtrl; - switch ( GetWindowStyle() & wxBK_ALIGN_MASK ) - { - default: - wxFAIL_MSG( _T("unexpected alignment") ); - // fall through - - case wxBK_TOP: - case wxBK_LEFT: - // posCtrl is already ok - break; - - case wxBK_BOTTOM: - posCtrl.y = sizeClient.y - sizeNew.y; - break; - - case wxBK_RIGHT: - posCtrl.x = sizeClient.x - sizeNew.x; - break; - } - - if ( m_bookctrl->GetPosition() != posCtrl ) - m_bookctrl->Move(posCtrl); - } - - // resize all pages to fit the new control size - const wxRect pageRect = GetPageRect(); - const unsigned pagesCount = m_pages.Count(); - for ( unsigned int i = 0; i < pagesCount; ++i ) - { - wxWindow * const page = m_pages[i]; - if ( !page ) - { - wxASSERT_MSG( AllowNullPage(), - _T("Null page in a control that does not allow null pages?") ); - continue; - } - - page->SetSize(pageRect); - } -} - -void wxBookCtrlBase::OnSize(wxSizeEvent& event) -{ - event.Skip(); - - DoSize(); -} - -wxSize wxBookCtrlBase::GetControllerSize() const -{ - if(!m_bookctrl) - return wxSize(0,0); - - const wxSize sizeClient = GetClientSize(), - sizeBorder = m_bookctrl->GetSize() - m_bookctrl->GetClientSize(), - sizeCtrl = m_bookctrl->GetBestSize() + sizeBorder; - - wxSize size; - - if ( IsVertical() ) - { - size.x = sizeClient.x; - size.y = sizeCtrl.y; - } - else // left/right aligned - { - size.x = sizeCtrl.x; - size.y = sizeClient.y; - } - - return size; -} - -// ---------------------------------------------------------------------------- -// miscellaneous stuff -// ---------------------------------------------------------------------------- - -#if wxUSE_HELP - -void wxBookCtrlBase::OnHelp(wxHelpEvent& event) -{ - // determine where does this even originate from to avoid redirecting it - // back to the page which generated it (resulting in an infinite loop) - - // notice that we have to check in the hard(er) way instead of just testing - // if the event object == this because the book control can have other - // subcontrols inside it (e.g. wxSpinButton in case of a notebook in wxUniv) - wxWindow *source = wxStaticCast(event.GetEventObject(), wxWindow); - while ( source && source != this && source->GetParent() != this ) - { - source = source->GetParent(); - } - - if ( source && m_pages.Index(source) == wxNOT_FOUND ) - { - // this event is for the book control itself, redirect it to the - // corresponding page - wxWindow *page = NULL; - - if ( event.GetOrigin() == wxHelpEvent::Origin_HelpButton ) - { - // show help for the page under the mouse - const int pagePos = HitTest(ScreenToClient(event.GetPosition())); - - if ( pagePos != wxNOT_FOUND) - { - page = GetPage((size_t)pagePos); - } - } - else // event from keyboard or unknown source - { - // otherwise show the current page help - page = GetCurrentPage(); - } - - if ( page ) - { - // change event object to the page to avoid infinite recursion if - // we get this event ourselves if the page doesn't handle it - event.SetEventObject(page); - - if ( page->GetEventHandler()->ProcessEvent(event) ) - { - // don't call event.Skip() - return; - } - } - } - //else: event coming from one of our pages already - - event.Skip(); -} - -#endif // wxUSE_HELP - -// ---------------------------------------------------------------------------- -// pages management -// ---------------------------------------------------------------------------- - -bool -wxBookCtrlBase::InsertPage(size_t nPage, - wxWindow *page, - const wxString& WXUNUSED(text), - bool WXUNUSED(bSelect), - int WXUNUSED(imageId)) -{ - wxCHECK_MSG( page || AllowNullPage(), false, - _T("NULL page in wxBookCtrlBase::InsertPage()") ); - wxCHECK_MSG( nPage <= m_pages.size(), false, - _T("invalid page index in wxBookCtrlBase::InsertPage()") ); - - m_pages.Insert(page, nPage); - if ( page ) - page->SetSize(GetPageRect()); - - DoInvalidateBestSize(); - - return true; -} - -bool wxBookCtrlBase::DeletePage(size_t nPage) -{ - wxWindow *page = DoRemovePage(nPage); - if ( !(page || AllowNullPage()) ) - return false; - - // delete NULL is harmless - delete page; - - return true; -} - -wxWindow *wxBookCtrlBase::DoRemovePage(size_t nPage) -{ - wxCHECK_MSG( nPage < m_pages.size(), NULL, - _T("invalid page index in wxBookCtrlBase::DoRemovePage()") ); - - wxWindow *pageRemoved = m_pages[nPage]; - m_pages.RemoveAt(nPage); - DoInvalidateBestSize(); - - return pageRemoved; -} - -int wxBookCtrlBase::GetNextPage(bool forward) const -{ - int nPage; - - int nMax = GetPageCount(); - if ( nMax-- ) // decrement it to get the last valid index - { - int nSel = GetSelection(); - - // change selection wrapping if it becomes invalid - nPage = forward ? nSel == nMax ? 0 - : nSel + 1 - : nSel == 0 ? nMax - : nSel - 1; - } - else // notebook is empty, no next page - { - nPage = wxNOT_FOUND; - } - - return nPage; -} - -int wxBookCtrlBase::DoSetSelection(size_t n, int flags) -{ - wxCHECK_MSG( n < GetPageCount(), wxNOT_FOUND, - wxT("invalid page index in wxBookCtrlBase::DoSetSelection()") ); - - const int oldSel = GetSelection(); - - if ( n != (size_t)oldSel ) - { - wxBookCtrlBaseEvent *event = CreatePageChangingEvent(); - bool allowed = false; - - if ( flags & SetSelection_SendEvent ) - { - event->SetSelection(n); - event->SetOldSelection(oldSel); - event->SetEventObject(this); - - allowed = !GetEventHandler()->ProcessEvent(*event) || event->IsAllowed(); - } - - if ( !(flags & SetSelection_SendEvent) || allowed) - { - if ( oldSel != wxNOT_FOUND ) - m_pages[oldSel]->Hide(); - - wxWindow *page = m_pages[n]; - page->SetSize(GetPageRect()); - page->Show(); - - // change selection now to ignore the selection change event - UpdateSelectedPage(n); - - if ( flags & SetSelection_SendEvent ) - { - // program allows the page change - MakeChangedEvent(*event); - (void)GetEventHandler()->ProcessEvent(*event); - } - } - - delete event; - } - - return oldSel; -} - - -#endif // wxUSE_BOOKCTRL diff --git a/wxWidgets/src/common/choiccmn.cpp b/wxWidgets/src/common/choiccmn.cpp deleted file mode 100644 index 7febe79e6e..0000000000 --- a/wxWidgets/src/common/choiccmn.cpp +++ /dev/null @@ -1,55 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/common/choiccmn.cpp -// Purpose: common (to all ports) wxChoice functions -// Author: Vadim Zeitlin -// Modified by: -// Created: 26.07.99 -// RCS-ID: $Id: choiccmn.cpp 39470 2006-05-30 07:34:30Z ABX $ -// Copyright: (c) wxWidgets team -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_CHOICE - -#include "wx/choice.h" - -#ifndef WX_PRECOMP -#endif - -const wxChar wxChoiceNameStr[] = wxT("choice"); - -// ============================================================================ -// implementation -// ============================================================================ - -wxChoiceBase::~wxChoiceBase() -{ - // this destructor is required for Darwin -} - -// ---------------------------------------------------------------------------- -// misc -// ---------------------------------------------------------------------------- - -void wxChoiceBase::Command(wxCommandEvent& event) -{ - SetSelection(event.GetInt()); - (void)ProcessEvent(event); -} - -#endif // wxUSE_CHOICE diff --git a/wxWidgets/src/common/clipcmn.cpp b/wxWidgets/src/common/clipcmn.cpp deleted file mode 100644 index 2421c48fe2..0000000000 --- a/wxWidgets/src/common/clipcmn.cpp +++ /dev/null @@ -1,63 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/common/clipcmn.cpp -// Purpose: common (to all ports) wxClipboard functions -// Author: Robert Roebling -// Modified by: -// Created: 28.06.99 -// RCS-ID: $Id: clipcmn.cpp 40943 2006-08-31 19:31:43Z ABX $ -// Copyright: (c) Robert Roebling -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_CLIPBOARD - -#include "wx/clipbrd.h" - -#ifndef WX_PRECOMP - #include "wx/module.h" -#endif - -static wxClipboard *gs_clipboard = NULL; - -/*static*/ wxClipboard *wxClipboardBase::Get() -{ - if ( !gs_clipboard ) - { - gs_clipboard = new wxClipboard; - } - return gs_clipboard; -} - -// ---------------------------------------------------------------------------- -// wxClipboardModule: module responsible for destroying the global clipboard -// object -// ---------------------------------------------------------------------------- - -class wxClipboardModule : public wxModule -{ -public: - bool OnInit() { return true; } - void OnExit() { wxDELETE(gs_clipboard); } - -private: - DECLARE_DYNAMIC_CLASS(wxClipboardModule) -}; - -IMPLEMENT_DYNAMIC_CLASS(wxClipboardModule, wxModule) - -#endif // wxUSE_CLIPBOARD diff --git a/wxWidgets/src/common/clntdata.cpp b/wxWidgets/src/common/clntdata.cpp deleted file mode 100644 index d226f15b33..0000000000 --- a/wxWidgets/src/common/clntdata.cpp +++ /dev/null @@ -1,83 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: common/clntdata.cpp -// Purpose: A mixin class for holding a wxClientData or void pointer -// Author: Robin Dunn -// Modified by: -// Created: 9-Oct-2001 -// RCS-ID: $Id: clntdata.cpp 35650 2005-09-23 12:56:45Z MR $ -// Copyright: (c) wxWidgets team -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#include "wx/clntdata.h" - - -// ---------------------------------------------------------------------------- - - -wxClientDataContainer::wxClientDataContainer() -{ - // no client data (yet) - m_clientData = NULL; - m_clientDataType = wxClientData_None; -} - -wxClientDataContainer::~wxClientDataContainer() -{ - // we only delete object data, not untyped - if ( m_clientDataType == wxClientData_Object ) - delete m_clientObject; -} - -void wxClientDataContainer::DoSetClientObject( wxClientData *data ) -{ - wxASSERT_MSG( m_clientDataType != wxClientData_Void, - wxT("can't have both object and void client data") ); - - if ( m_clientObject ) - delete m_clientObject; - - m_clientObject = data; - m_clientDataType = wxClientData_Object; -} - -wxClientData *wxClientDataContainer::DoGetClientObject() const -{ - // it's not an error to call GetClientObject() on a window which doesn't - // have client data at all - NULL will be returned - wxASSERT_MSG( m_clientDataType != wxClientData_Void, - wxT("this window doesn't have object client data") ); - - return m_clientObject; -} - -void wxClientDataContainer::DoSetClientData( void *data ) -{ - wxASSERT_MSG( m_clientDataType != wxClientData_Object, - wxT("can't have both object and void client data") ); - - m_clientData = data; - m_clientDataType = wxClientData_Void; -} - -void *wxClientDataContainer::DoGetClientData() const -{ - // it's not an error to call GetClientData() on a window which doesn't have - // client data at all - NULL will be returned - wxASSERT_MSG( m_clientDataType != wxClientData_Object, - wxT("this window doesn't have void client data") ); - - return m_clientData; -} - - -// ---------------------------------------------------------------------------- - - diff --git a/wxWidgets/src/common/clrpickercmn.cpp b/wxWidgets/src/common/clrpickercmn.cpp deleted file mode 100644 index 8e21d7f6ef..0000000000 --- a/wxWidgets/src/common/clrpickercmn.cpp +++ /dev/null @@ -1,149 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: src/common/clrpickercmn.cpp -// Purpose: wxColourPickerCtrl class implementation -// Author: Francesco Montorsi (readapted code written by Vadim Zeitlin) -// Modified by: -// Created: 15/04/2006 -// RCS-ID: $Id: clrpickercmn.cpp 42219 2006-10-21 19:53:05Z PC $ -// Copyright: (c) Vadim Zeitlin, Francesco Montorsi -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_COLOURPICKERCTRL - -#include "wx/clrpicker.h" - -#ifndef WX_PRECOMP - #include "wx/textctrl.h" -#endif - -const wxChar wxColourPickerCtrlNameStr[] = wxT("colourpicker"); -const wxChar wxColourPickerWidgetNameStr[] = wxT("colourpickerwidget"); - -// ============================================================================ -// implementation -// ============================================================================ - -DEFINE_EVENT_TYPE(wxEVT_COMMAND_COLOURPICKER_CHANGED) -IMPLEMENT_DYNAMIC_CLASS(wxColourPickerCtrl, wxPickerBase) -IMPLEMENT_DYNAMIC_CLASS(wxColourPickerEvent, wxEvent) - -// ---------------------------------------------------------------------------- -// wxColourPickerCtrl -// ---------------------------------------------------------------------------- - -#define M_PICKER ((wxColourPickerWidget*)m_picker) - -bool wxColourPickerCtrl::Create( wxWindow *parent, wxWindowID id, - const wxColour &col, - const wxPoint &pos, const wxSize &size, - long style, const wxValidator& validator, - const wxString &name ) -{ - if (!wxPickerBase::CreateBase(parent, id, col.GetAsString(), pos, size, - style, validator, name)) - return false; - - // we are not interested to the ID of our picker as we connect - // to its "changed" event dynamically... - m_picker = new wxColourPickerWidget(this, wxID_ANY, col, - wxDefaultPosition, wxDefaultSize, - GetPickerStyle(style)); - - // complete sizer creation - wxPickerBase::PostCreation(); - - m_picker->Connect(wxEVT_COMMAND_COLOURPICKER_CHANGED, - wxColourPickerEventHandler(wxColourPickerCtrl::OnColourChange), - NULL, this); - - return true; -} - -void wxColourPickerCtrl::SetColour(const wxColour &col) -{ - M_PICKER->SetColour(col); - UpdateTextCtrlFromPicker(); -} - -bool wxColourPickerCtrl::SetColour(const wxString &text) -{ - wxColour col(text); // smart wxString->wxColour conversion - if ( !col.Ok() ) - return false; - M_PICKER->SetColour(col); - UpdateTextCtrlFromPicker(); - - return true; -} - -void wxColourPickerCtrl::UpdatePickerFromTextCtrl() -{ - wxASSERT(m_text); - - if (m_bIgnoreNextTextCtrlUpdate) - { - // ignore this update - m_bIgnoreNextTextCtrlUpdate = false; - return; - } - - // wxString -> wxColour conversion - wxColour col(m_text->GetValue()); - if ( !col.Ok() ) - return; // invalid user input - - if (M_PICKER->GetColour() != col) - { - M_PICKER->SetColour(col); - - // fire an event - wxColourPickerEvent event(this, GetId(), col); - GetEventHandler()->ProcessEvent(event); - } -} - -void wxColourPickerCtrl::UpdateTextCtrlFromPicker() -{ - if (!m_text) - return; // no textctrl to update - - // NOTE: this SetValue() will generate an unwanted wxEVT_COMMAND_TEXT_UPDATED - // which will trigger a unneeded UpdateFromTextCtrl(); thus before using - // SetValue() we set the m_bIgnoreNextTextCtrlUpdate flag... - m_bIgnoreNextTextCtrlUpdate = true; - m_text->SetValue(M_PICKER->GetColour().GetAsString()); -} - - - -// ---------------------------------------------------------------------------- -// wxColourPickerCtrl - event handlers -// ---------------------------------------------------------------------------- - -void wxColourPickerCtrl::OnColourChange(wxColourPickerEvent &ev) -{ - UpdateTextCtrlFromPicker(); - - // the wxColourPickerWidget sent us a colour-change notification. - // forward this event to our parent - wxColourPickerEvent event(this, GetId(), ev.GetColour()); - GetEventHandler()->ProcessEvent(event); -} - -#endif // wxUSE_COLOURPICKERCTRL diff --git a/wxWidgets/src/common/cmdline.cpp b/wxWidgets/src/common/cmdline.cpp deleted file mode 100644 index c7b135d0c6..0000000000 --- a/wxWidgets/src/common/cmdline.cpp +++ /dev/null @@ -1,1246 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: src/common/cmdline.cpp -// Purpose: wxCmdLineParser implementation -// Author: Vadim Zeitlin -// Modified by: -// Created: 05.01.00 -// RCS-ID: $Id: cmdline.cpp 66920 2011-02-16 22:00:30Z JS $ -// Copyright: (c) 2000 Vadim Zeitlin -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#ifndef WX_PRECOMP - #include "wx/dynarray.h" - #include "wx/string.h" - #include "wx/log.h" - #include "wx/intl.h" - #include "wx/app.h" -#endif //WX_PRECOMP - -#include "wx/cmdline.h" - -#if wxUSE_CMDLINE_PARSER - -#include - -#include "wx/datetime.h" -#include "wx/msgout.h" -#include "wx/filename.h" - -// ---------------------------------------------------------------------------- -// private functions -// ---------------------------------------------------------------------------- - -static wxString GetTypeName(wxCmdLineParamType type); - -static wxString GetOptionName(const wxChar *p, const wxChar *allowedChars); - -static wxString GetShortOptionName(const wxChar *p); - -static wxString GetLongOptionName(const wxChar *p); - -// ---------------------------------------------------------------------------- -// private structs -// ---------------------------------------------------------------------------- - -// an internal representation of an option -struct wxCmdLineOption -{ - wxCmdLineOption(wxCmdLineEntryType k, - const wxString& shrt, - const wxString& lng, - const wxString& desc, - wxCmdLineParamType typ, - int fl) - { - wxASSERT_MSG( !shrt.empty() || !lng.empty(), - _T("option should have at least one name") ); - - wxASSERT_MSG - ( - GetShortOptionName(shrt).Len() == shrt.Len(), - wxT("Short option contains invalid characters") - ); - - wxASSERT_MSG - ( - GetLongOptionName(lng).Len() == lng.Len(), - wxT("Long option contains invalid characters") - ); - - - kind = k; - - shortName = shrt; - longName = lng; - description = desc; - - type = typ; - flags = fl; - - m_hasVal = false; - } - - // can't use union easily here, so just store all possible data fields, we - // don't waste much (might still use union later if the number of supported - // types increases, so always use the accessor functions and don't access - // the fields directly!) - - void Check(wxCmdLineParamType WXUNUSED_UNLESS_DEBUG(typ)) const - { - wxASSERT_MSG( type == typ, _T("type mismatch in wxCmdLineOption") ); - } - - long GetLongVal() const - { Check(wxCMD_LINE_VAL_NUMBER); return m_longVal; } - const wxString& GetStrVal() const - { Check(wxCMD_LINE_VAL_STRING); return m_strVal; } -#if wxUSE_DATETIME - const wxDateTime& GetDateVal() const - { Check(wxCMD_LINE_VAL_DATE); return m_dateVal; } -#endif // wxUSE_DATETIME - - void SetLongVal(long val) - { Check(wxCMD_LINE_VAL_NUMBER); m_longVal = val; m_hasVal = true; } - void SetStrVal(const wxString& val) - { Check(wxCMD_LINE_VAL_STRING); m_strVal = val; m_hasVal = true; } -#if wxUSE_DATETIME - void SetDateVal(const wxDateTime& val) - { Check(wxCMD_LINE_VAL_DATE); m_dateVal = val; m_hasVal = true; } -#endif // wxUSE_DATETIME - - void SetHasValue(bool hasValue = true) { m_hasVal = hasValue; } - bool HasValue() const { return m_hasVal; } - -public: - wxCmdLineEntryType kind; - wxString shortName, - longName, - description; - wxCmdLineParamType type; - int flags; - -private: - bool m_hasVal; - - long m_longVal; - wxString m_strVal; -#if wxUSE_DATETIME - wxDateTime m_dateVal; -#endif // wxUSE_DATETIME -}; - -struct wxCmdLineParam -{ - wxCmdLineParam(const wxString& desc, - wxCmdLineParamType typ, - int fl) - : description(desc) - { - type = typ; - flags = fl; - } - - wxString description; - wxCmdLineParamType type; - int flags; -}; - -WX_DECLARE_OBJARRAY(wxCmdLineOption, wxArrayOptions); -WX_DECLARE_OBJARRAY(wxCmdLineParam, wxArrayParams); - -#include "wx/arrimpl.cpp" - -WX_DEFINE_OBJARRAY(wxArrayOptions) -WX_DEFINE_OBJARRAY(wxArrayParams) - -// the parser internal state -struct wxCmdLineParserData -{ - // options - wxString m_switchChars; // characters which may start an option - bool m_enableLongOptions; // true if long options are enabled - wxString m_logo; // some extra text to show in Usage() - - // cmd line data - wxArrayString m_arguments; // == argv, argc == m_arguments.GetCount() - wxArrayOptions m_options; // all possible options and switchrs - wxArrayParams m_paramDesc; // description of all possible params - wxArrayString m_parameters; // all params found - - // methods - wxCmdLineParserData(); - void SetArguments(int argc, char **argv); -#if wxUSE_UNICODE - void SetArguments(int argc, wxChar **argv); -#endif // wxUSE_UNICODE - void SetArguments(const wxString& cmdline); - - int FindOption(const wxString& name); - int FindOptionByLongName(const wxString& name); -}; - -// ============================================================================ -// implementation -// ============================================================================ - -// ---------------------------------------------------------------------------- -// wxCmdLineParserData -// ---------------------------------------------------------------------------- - -wxCmdLineParserData::wxCmdLineParserData() -{ - m_enableLongOptions = true; -#ifdef __UNIX_LIKE__ - m_switchChars = _T("-"); -#else // !Unix - m_switchChars = _T("/-"); -#endif -} - -void wxCmdLineParserData::SetArguments(int argc, char **argv) -{ - m_arguments.clear(); - - for ( int n = 0; n < argc; n++ ) - { - m_arguments.push_back(wxString::FromAscii(argv[n])); - } -} - -#if wxUSE_UNICODE - -void wxCmdLineParserData::SetArguments(int argc, wxChar **argv) -{ - m_arguments.clear(); - - for ( int n = 0; n < argc; n++ ) - { - m_arguments.push_back(argv[n]); - } -} - -#endif // wxUSE_UNICODE - -void wxCmdLineParserData::SetArguments(const wxString& cmdLine) -{ - m_arguments.clear(); - - if(wxTheApp && wxTheApp->argc > 0) - m_arguments.push_back(wxTheApp->argv[0]); - else - m_arguments.push_back(wxEmptyString); - - wxArrayString args = wxCmdLineParser::ConvertStringToArgs(cmdLine); - - WX_APPEND_ARRAY(m_arguments, args); -} - -int wxCmdLineParserData::FindOption(const wxString& name) -{ - if ( !name.empty() ) - { - size_t count = m_options.GetCount(); - for ( size_t n = 0; n < count; n++ ) - { - if ( m_options[n].shortName == name ) - { - // found - return n; - } - } - } - - return wxNOT_FOUND; -} - -int wxCmdLineParserData::FindOptionByLongName(const wxString& name) -{ - size_t count = m_options.GetCount(); - for ( size_t n = 0; n < count; n++ ) - { - if ( m_options[n].longName == name ) - { - // found - return n; - } - } - - return wxNOT_FOUND; -} - -// ---------------------------------------------------------------------------- -// construction and destruction -// ---------------------------------------------------------------------------- - -void wxCmdLineParser::Init() -{ - m_data = new wxCmdLineParserData; -} - -void wxCmdLineParser::SetCmdLine(int argc, char **argv) -{ - m_data->SetArguments(argc, argv); -} - -#if wxUSE_UNICODE - -void wxCmdLineParser::SetCmdLine(int argc, wxChar **argv) -{ - m_data->SetArguments(argc, argv); -} - -#endif // wxUSE_UNICODE - -void wxCmdLineParser::SetCmdLine(const wxString& cmdline) -{ - m_data->SetArguments(cmdline); -} - -wxCmdLineParser::~wxCmdLineParser() -{ - delete m_data; -} - -// ---------------------------------------------------------------------------- -// options -// ---------------------------------------------------------------------------- - -void wxCmdLineParser::SetSwitchChars(const wxString& switchChars) -{ - m_data->m_switchChars = switchChars; -} - -void wxCmdLineParser::EnableLongOptions(bool enable) -{ - m_data->m_enableLongOptions = enable; -} - -bool wxCmdLineParser::AreLongOptionsEnabled() -{ - return m_data->m_enableLongOptions; -} - -void wxCmdLineParser::SetLogo(const wxString& logo) -{ - m_data->m_logo = logo; -} - -// ---------------------------------------------------------------------------- -// command line construction -// ---------------------------------------------------------------------------- - -void wxCmdLineParser::SetDesc(const wxCmdLineEntryDesc *desc) -{ - for ( ;; desc++ ) - { - switch ( desc->kind ) - { - case wxCMD_LINE_SWITCH: - AddSwitch(desc->shortName, desc->longName, desc->description, - desc->flags); - break; - - case wxCMD_LINE_OPTION: - AddOption(desc->shortName, desc->longName, desc->description, - desc->type, desc->flags); - break; - - case wxCMD_LINE_PARAM: - AddParam(desc->description, desc->type, desc->flags); - break; - - default: - wxFAIL_MSG( _T("unknown command line entry type") ); - // still fall through - - case wxCMD_LINE_NONE: - return; - } - } -} - -void wxCmdLineParser::AddSwitch(const wxString& shortName, - const wxString& longName, - const wxString& desc, - int flags) -{ - wxASSERT_MSG( m_data->FindOption(shortName) == wxNOT_FOUND, - _T("duplicate switch") ); - - wxCmdLineOption *option = new wxCmdLineOption(wxCMD_LINE_SWITCH, - shortName, longName, desc, - wxCMD_LINE_VAL_NONE, flags); - - m_data->m_options.Add(option); -} - -void wxCmdLineParser::AddOption(const wxString& shortName, - const wxString& longName, - const wxString& desc, - wxCmdLineParamType type, - int flags) -{ - wxASSERT_MSG( m_data->FindOption(shortName) == wxNOT_FOUND, - _T("duplicate option") ); - - wxCmdLineOption *option = new wxCmdLineOption(wxCMD_LINE_OPTION, - shortName, longName, desc, - type, flags); - - m_data->m_options.Add(option); -} - -void wxCmdLineParser::AddParam(const wxString& desc, - wxCmdLineParamType type, - int flags) -{ - // do some consistency checks: a required parameter can't follow an - // optional one and nothing should follow a parameter with MULTIPLE flag -#ifdef __WXDEBUG__ - if ( !m_data->m_paramDesc.IsEmpty() ) - { - wxCmdLineParam& param = m_data->m_paramDesc.Last(); - - wxASSERT_MSG( !(param.flags & wxCMD_LINE_PARAM_MULTIPLE), - _T("all parameters after the one with wxCMD_LINE_PARAM_MULTIPLE style will be ignored") ); - - if ( !(flags & wxCMD_LINE_PARAM_OPTIONAL) ) - { - wxASSERT_MSG( !(param.flags & wxCMD_LINE_PARAM_OPTIONAL), - _T("a required parameter can't follow an optional one") ); - } - } -#endif // Debug - - wxCmdLineParam *param = new wxCmdLineParam(desc, type, flags); - - m_data->m_paramDesc.Add(param); -} - -// ---------------------------------------------------------------------------- -// access to parse command line -// ---------------------------------------------------------------------------- - -bool wxCmdLineParser::Found(const wxString& name) const -{ - int i = m_data->FindOption(name); - if ( i == wxNOT_FOUND ) - i = m_data->FindOptionByLongName(name); - - wxCHECK_MSG( i != wxNOT_FOUND, false, _T("unknown switch") ); - - wxCmdLineOption& opt = m_data->m_options[(size_t)i]; - if ( !opt.HasValue() ) - return false; - - return true; -} - -bool wxCmdLineParser::Found(const wxString& name, wxString *value) const -{ - int i = m_data->FindOption(name); - if ( i == wxNOT_FOUND ) - i = m_data->FindOptionByLongName(name); - - wxCHECK_MSG( i != wxNOT_FOUND, false, _T("unknown option") ); - - wxCmdLineOption& opt = m_data->m_options[(size_t)i]; - if ( !opt.HasValue() ) - return false; - - wxCHECK_MSG( value, false, _T("NULL pointer in wxCmdLineOption::Found") ); - - *value = opt.GetStrVal(); - - return true; -} - -bool wxCmdLineParser::Found(const wxString& name, long *value) const -{ - int i = m_data->FindOption(name); - if ( i == wxNOT_FOUND ) - i = m_data->FindOptionByLongName(name); - - wxCHECK_MSG( i != wxNOT_FOUND, false, _T("unknown option") ); - - wxCmdLineOption& opt = m_data->m_options[(size_t)i]; - if ( !opt.HasValue() ) - return false; - - wxCHECK_MSG( value, false, _T("NULL pointer in wxCmdLineOption::Found") ); - - *value = opt.GetLongVal(); - - return true; -} - -#if wxUSE_DATETIME -bool wxCmdLineParser::Found(const wxString& name, wxDateTime *value) const -{ - int i = m_data->FindOption(name); - if ( i == wxNOT_FOUND ) - i = m_data->FindOptionByLongName(name); - - wxCHECK_MSG( i != wxNOT_FOUND, false, _T("unknown option") ); - - wxCmdLineOption& opt = m_data->m_options[(size_t)i]; - if ( !opt.HasValue() ) - return false; - - wxCHECK_MSG( value, false, _T("NULL pointer in wxCmdLineOption::Found") ); - - *value = opt.GetDateVal(); - - return true; -} -#endif // wxUSE_DATETIME - -size_t wxCmdLineParser::GetParamCount() const -{ - return m_data->m_parameters.size(); -} - -wxString wxCmdLineParser::GetParam(size_t n) const -{ - wxCHECK_MSG( n < GetParamCount(), wxEmptyString, _T("invalid param index") ); - - return m_data->m_parameters[n]; -} - -// Resets switches and options -void wxCmdLineParser::Reset() -{ - for ( size_t i = 0; i < m_data->m_options.Count(); i++ ) - { - wxCmdLineOption& opt = m_data->m_options[i]; - opt.SetHasValue(false); - } -} - - -// ---------------------------------------------------------------------------- -// the real work is done here -// ---------------------------------------------------------------------------- - -int wxCmdLineParser::Parse(bool showUsage) -{ - bool maybeOption = true; // can the following arg be an option? - bool ok = true; // true until an error is detected - bool helpRequested = false; // true if "-h" was given - bool hadRepeatableParam = false; // true if found param with MULTIPLE flag - - size_t currentParam = 0; // the index in m_paramDesc - - size_t countParam = m_data->m_paramDesc.GetCount(); - wxString errorMsg; - - Reset(); - - // parse everything - wxString arg; - size_t count = m_data->m_arguments.size(); - for ( size_t n = 1; ok && (n < count); n++ ) // 0 is program name - { - arg = m_data->m_arguments[n]; - - // special case: "--" should be discarded and all following arguments - // should be considered as parameters, even if they start with '-' and - // not like options (this is POSIX-like) - if ( arg == _T("--") ) - { - maybeOption = false; - - continue; - } - - // empty argument or just '-' is not an option but a parameter - if ( maybeOption && arg.length() > 1 && - wxStrchr(m_data->m_switchChars, arg[0u]) ) - { - bool isLong; - wxString name; - int optInd = wxNOT_FOUND; // init to suppress warnings - - // an option or a switch: find whether it's a long or a short one - if ( arg[0u] == _T('-') && arg[1u] == _T('-') ) - { - // a long one - isLong = true; - - // Skip leading "--" - const wxChar *p = arg.c_str() + 2; - - bool longOptionsEnabled = AreLongOptionsEnabled(); - - name = GetLongOptionName(p); - - if (longOptionsEnabled) - { - optInd = m_data->FindOptionByLongName(name); - if ( optInd == wxNOT_FOUND ) - { - errorMsg << wxString::Format(_("Unknown long option '%s'"), name.c_str()) - << _T('\n'); - } - } - else - { - optInd = wxNOT_FOUND; // Sanity check - - // Print the argument including leading "--" - name.Prepend( wxT("--") ); - errorMsg << wxString::Format(_("Unknown option '%s'"), name.c_str()) - << _T('\n'); - } - - } - else // not a long option - { - isLong = false; - - // a short one: as they can be cumulated, we try to find the - // longest substring which is a valid option - const wxChar *p = arg.c_str() + 1; - - name = GetShortOptionName(p); - - size_t len = name.length(); - do - { - if ( len == 0 ) - { - // we couldn't find a valid option name in the - // beginning of this string - errorMsg << wxString::Format(_("Unknown option '%s'"), name.c_str()) - << _T('\n'); - - break; - } - else - { - optInd = m_data->FindOption(name.Left(len)); - - // will try with one character less the next time - len--; - } - } - while ( optInd == wxNOT_FOUND ); - - len++; // compensates extra len-- above - if ( (optInd != wxNOT_FOUND) && (len != name.length()) ) - { - // first of all, the option name is only part of this - // string - name = name.Left(len); - - // our option is only part of this argument, there is - // something else in it - it is either the value of this - // option or other switches if it is a switch - if ( m_data->m_options[(size_t)optInd].kind - == wxCMD_LINE_SWITCH ) - { - // pretend that all the rest of the argument is the - // next argument, in fact - wxString arg2 = arg[0u]; - arg2 += arg.Mid(len + 1); // +1 for leading '-' - - m_data->m_arguments.insert - (m_data->m_arguments.begin() + n + 1, arg2); - count++; - } - //else: it's our value, we'll deal with it below - } - } - - if ( optInd == wxNOT_FOUND ) - { - ok = false; - - continue; // will break, in fact - } - - // look at what follows: - - // +1 for leading '-' - const wxChar *p = arg.c_str() + 1 + name.length(); - if ( isLong ) - p++; // for another leading '-' - - wxCmdLineOption& opt = m_data->m_options[(size_t)optInd]; - if ( opt.kind == wxCMD_LINE_SWITCH ) - { - // we must check that there is no value following the switch - if ( *p != _T('\0') ) - { - errorMsg << wxString::Format(_("Unexpected characters following option '%s'."), name.c_str()) - << _T('\n'); - ok = false; - } - else // no value, as expected - { - // nothing more to do - opt.SetHasValue(); - - if ( opt.flags & wxCMD_LINE_OPTION_HELP ) - { - helpRequested = true; - - // it's not an error, but we still stop here - ok = false; - } - } - } - else // it's an option. not a switch - { - // get the value - if ( isLong ) - { - if ( *p++ != _T('=') ) - { - errorMsg << wxString::Format(_("Option '%s' requires a value, '=' expected."), name.c_str()) - << _T('\n'); - - ok = false; - } - } - else // short option - { - switch ( *p ) - { - case _T('='): - case _T(':'): - // the value follows - p++; - break; - - case 0: - // the value is in the next argument - if ( ++n == count ) - { - // ... but there is none - errorMsg << wxString::Format(_("Option '%s' requires a value."), - name.c_str()) - << _T('\n'); - - ok = false; - } - else - { - // ... take it from there - p = m_data->m_arguments[n].c_str(); - } - break; - - default: - // the value is right here: this may be legal or - // not depending on the option style - if ( opt.flags & wxCMD_LINE_NEEDS_SEPARATOR ) - { - errorMsg << wxString::Format(_("Separator expected after the option '%s'."), - name.c_str()) - << _T('\n'); - - ok = false; - } - } - } - - if ( ok ) - { - wxString value = p; - switch ( opt.type ) - { - default: - wxFAIL_MSG( _T("unknown option type") ); - // still fall through - - case wxCMD_LINE_VAL_STRING: - opt.SetStrVal(value); - break; - - case wxCMD_LINE_VAL_NUMBER: - { - long val; - if ( value.ToLong(&val) ) - { - opt.SetLongVal(val); - } - else - { - errorMsg << wxString::Format(_("'%s' is not a correct numeric value for option '%s'."), - value.c_str(), name.c_str()) - << _T('\n'); - - ok = false; - } - } - break; - -#if wxUSE_DATETIME - case wxCMD_LINE_VAL_DATE: - { - wxDateTime dt; - const wxChar *res = dt.ParseDate(value); - if ( !res || *res ) - { - errorMsg << wxString::Format(_("Option '%s': '%s' cannot be converted to a date."), - name.c_str(), value.c_str()) - << _T('\n'); - - ok = false; - } - else - { - opt.SetDateVal(dt); - } - } - break; -#endif // wxUSE_DATETIME - } - } - } - } - else // not an option, must be a parameter - { - if ( currentParam < countParam ) - { - wxCmdLineParam& param = m_data->m_paramDesc[currentParam]; - - // TODO check the param type - - m_data->m_parameters.push_back(arg); - - if ( !(param.flags & wxCMD_LINE_PARAM_MULTIPLE) ) - { - currentParam++; - } - else - { - wxASSERT_MSG( currentParam == countParam - 1, - _T("all parameters after the one with wxCMD_LINE_PARAM_MULTIPLE style are ignored") ); - - // remember that we did have this last repeatable parameter - hadRepeatableParam = true; - } - } - else - { - errorMsg << wxString::Format(_("Unexpected parameter '%s'"), arg.c_str()) - << _T('\n'); - - ok = false; - } - } - } - - // verify that all mandatory options were given - if ( ok ) - { - size_t countOpt = m_data->m_options.GetCount(); - for ( size_t n = 0; ok && (n < countOpt); n++ ) - { - wxCmdLineOption& opt = m_data->m_options[n]; - if ( (opt.flags & wxCMD_LINE_OPTION_MANDATORY) && !opt.HasValue() ) - { - wxString optName; - if ( !opt.longName ) - { - optName = opt.shortName; - } - else - { - if ( AreLongOptionsEnabled() ) - { - optName.Printf( _("%s (or %s)"), - opt.shortName.c_str(), - opt.longName.c_str() ); - } - else - { - optName.Printf( wxT("%s"), - opt.shortName.c_str() ); - } - } - - errorMsg << wxString::Format(_("The value for the option '%s' must be specified."), - optName.c_str()) - << _T('\n'); - - ok = false; - } - } - - for ( ; ok && (currentParam < countParam); currentParam++ ) - { - wxCmdLineParam& param = m_data->m_paramDesc[currentParam]; - if ( (currentParam == countParam - 1) && - (param.flags & wxCMD_LINE_PARAM_MULTIPLE) && - hadRepeatableParam ) - { - // special case: currentParam wasn't incremented, but we did - // have it, so don't give error - continue; - } - - if ( !(param.flags & wxCMD_LINE_PARAM_OPTIONAL) ) - { - errorMsg << wxString::Format(_("The required parameter '%s' was not specified."), - param.description.c_str()) - << _T('\n'); - - ok = false; - } - } - } - - // if there was an error during parsing the command line, show this error - // and also the usage message if it had been requested - if ( !ok && (!errorMsg.empty() || (helpRequested && showUsage)) ) - { - wxMessageOutput* msgOut = wxMessageOutput::Get(); - if ( msgOut ) - { - wxString usage; - if ( showUsage ) - usage = GetUsageString(); - - msgOut->Printf( wxT("%s%s"), usage.c_str(), errorMsg.c_str() ); - } - else - { - wxFAIL_MSG( _T("no wxMessageOutput object?") ); - } - } - - return ok ? 0 : helpRequested ? -1 : 1; -} - -// ---------------------------------------------------------------------------- -// give the usage message -// ---------------------------------------------------------------------------- - -void wxCmdLineParser::Usage() -{ - wxMessageOutput* msgOut = wxMessageOutput::Get(); - if ( msgOut ) - { - msgOut->Printf( wxT("%s"), GetUsageString().c_str() ); - } - else - { - wxFAIL_MSG( _T("no wxMessageOutput object?") ); - } -} - -wxString wxCmdLineParser::GetUsageString() -{ - wxString appname; - if ( wxTheApp ) - { - appname = wxFileName(wxTheApp->argv[0]).GetFullName(); - } - else if (!m_data->m_arguments.empty() ) - { - appname = wxFileName(m_data->m_arguments[0]).GetFullName(); - } - - // we construct the brief cmd line desc on the fly, but not the detailed - // help message below because we want to align the options descriptions - // and for this we must first know the longest one of them - wxString usage; - wxArrayString namesOptions, descOptions; - - if ( !m_data->m_logo.empty() ) - { - usage << m_data->m_logo << _T('\n'); - } - - usage << wxString::Format(_("Usage: %s"), appname.c_str()); - - // the switch char is usually '-' but this can be changed with - // SetSwitchChars() and then the first one of possible chars is used - wxChar chSwitch = !m_data->m_switchChars ? _T('-') - : m_data->m_switchChars[0u]; - - bool areLongOptionsEnabled = AreLongOptionsEnabled(); - size_t n, count = m_data->m_options.GetCount(); - for ( n = 0; n < count; n++ ) - { - wxCmdLineOption& opt = m_data->m_options[n]; - - usage << _T(' '); - if ( !(opt.flags & wxCMD_LINE_OPTION_MANDATORY) ) - { - usage << _T('['); - } - - if ( !opt.shortName.empty() ) - { - usage << chSwitch << opt.shortName; - } - else if ( areLongOptionsEnabled && !opt.longName.empty() ) - { - usage << _T("--") << opt.longName; - } - else - { - if (!opt.longName.empty()) - { - wxFAIL_MSG( wxT("option with only a long name while long ") - wxT("options are disabled") ); - } - else - { - wxFAIL_MSG( _T("option without neither short nor long name") ); - } - } - - wxString option; - - if ( !opt.shortName.empty() ) - { - option << _T(" ") << chSwitch << opt.shortName; - } - - if ( areLongOptionsEnabled && !opt.longName.empty() ) - { - option << (option.empty() ? _T(" ") : _T(", ")) - << _T("--") << opt.longName; - } - - if ( opt.kind != wxCMD_LINE_SWITCH ) - { - wxString val; - val << _T('<') << GetTypeName(opt.type) << _T('>'); - usage << _T(' ') << val; - option << (!opt.longName ? _T(':') : _T('=')) << val; - } - - if ( !(opt.flags & wxCMD_LINE_OPTION_MANDATORY) ) - { - usage << _T(']'); - } - - namesOptions.push_back(option); - descOptions.push_back(opt.description); - } - - count = m_data->m_paramDesc.GetCount(); - for ( n = 0; n < count; n++ ) - { - wxCmdLineParam& param = m_data->m_paramDesc[n]; - - usage << _T(' '); - if ( param.flags & wxCMD_LINE_PARAM_OPTIONAL ) - { - usage << _T('['); - } - - usage << param.description; - - if ( param.flags & wxCMD_LINE_PARAM_MULTIPLE ) - { - usage << _T("..."); - } - - if ( param.flags & wxCMD_LINE_PARAM_OPTIONAL ) - { - usage << _T(']'); - } - } - - usage << _T('\n'); - - // now construct the detailed help message - size_t len, lenMax = 0; - count = namesOptions.size(); - for ( n = 0; n < count; n++ ) - { - len = namesOptions[n].length(); - if ( len > lenMax ) - lenMax = len; - } - - for ( n = 0; n < count; n++ ) - { - len = namesOptions[n].length(); - usage << namesOptions[n] - << wxString(_T(' '), lenMax - len) << _T('\t') - << descOptions[n] - << _T('\n'); - } - - return usage; -} - -// ---------------------------------------------------------------------------- -// private functions -// ---------------------------------------------------------------------------- - -static wxString GetTypeName(wxCmdLineParamType type) -{ - wxString s; - switch ( type ) - { - default: - wxFAIL_MSG( _T("unknown option type") ); - // still fall through - - case wxCMD_LINE_VAL_STRING: - s = _("str"); - break; - - case wxCMD_LINE_VAL_NUMBER: - s = _("num"); - break; - - case wxCMD_LINE_VAL_DATE: - s = _("date"); - break; - } - - return s; -} - -/* -Returns a string which is equal to the string pointed to by p, but up to the -point where p contains an character that's not allowed. -Allowable characters are letters and numbers, and characters pointed to by -the parameter allowedChars. - -For example, if p points to "abcde-@-_", and allowedChars is "-_", -this function returns "abcde-". -*/ -static wxString GetOptionName(const wxChar *p, - const wxChar *allowedChars) -{ - wxString argName; - - while ( *p && (wxIsalnum(*p) || wxStrchr(allowedChars, *p)) ) - { - argName += *p++; - } - - return argName; -} - -// Besides alphanumeric characters, short and long options can -// have other characters. - -// A short option additionally can have these -#define wxCMD_LINE_CHARS_ALLOWED_BY_SHORT_OPTION wxT("_?") - -// A long option can have the same characters as a short option and a '-'. -#define wxCMD_LINE_CHARS_ALLOWED_BY_LONG_OPTION \ - wxCMD_LINE_CHARS_ALLOWED_BY_SHORT_OPTION wxT("-") - -static wxString GetShortOptionName(const wxChar *p) -{ - return GetOptionName(p, wxCMD_LINE_CHARS_ALLOWED_BY_SHORT_OPTION); -} - -static wxString GetLongOptionName(const wxChar *p) -{ - return GetOptionName(p, wxCMD_LINE_CHARS_ALLOWED_BY_LONG_OPTION); -} - -#endif // wxUSE_CMDLINE_PARSER - -// ---------------------------------------------------------------------------- -// global functions -// ---------------------------------------------------------------------------- - -/* - This function is mainly used under Windows (as under Unix we always get the - command line arguments as argc/argv anyhow) and so it tries to follow - Windows conventions for the command line handling, not Unix ones. For - instance, backslash is not special except when it precedes double quote when - it does quote it. - */ - -/* static */ -wxArrayString wxCmdLineParser::ConvertStringToArgs(const wxChar *p) -{ - wxArrayString args; - - wxString arg; - arg.reserve(1024); - - bool isInsideQuotes = false; - for ( ;; ) - { - // skip white space - while ( *p == _T(' ') || *p == _T('\t') ) - p++; - - // anything left? - if ( *p == _T('\0') ) - break; - - // parse this parameter - bool endParam = false; - bool lastBS = false; - for ( arg.clear(); !endParam; p++ ) - { - switch ( *p ) - { - case _T('"'): - if ( !lastBS ) - { - isInsideQuotes = !isInsideQuotes; - - // don't put quote in arg - continue; - } - //else: quote has no special meaning but the backslash - // still remains -- makes no sense but this is what - // Windows does - break; - - case _T(' '): - case _T('\t'): - // backslash does *not* quote the space, only quotes do - if ( isInsideQuotes ) - { - // skip assignment below - break; - } - // fall through - - case _T('\0'): - endParam = true; - - break; - } - - if ( endParam ) - { - break; - } - - lastBS = !lastBS && *p == _T('\\'); - - arg += *p; - } - - args.push_back(arg); - } - - return args; -} diff --git a/wxWidgets/src/common/cmdproc.cpp b/wxWidgets/src/common/cmdproc.cpp deleted file mode 100644 index 808f7bd95e..0000000000 --- a/wxWidgets/src/common/cmdproc.cpp +++ /dev/null @@ -1,325 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: src/common/cmdproc.cpp -// Purpose: wxCommand and wxCommandProcessor classes -// Author: Julian Smart (extracted from docview.h by VZ) -// Modified by: -// Created: 05.11.00 -// RCS-ID: $Id: cmdproc.cpp 65725 2010-10-02 13:05:08Z TIK $ -// Copyright: (c) wxWidgets team -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -// 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/string.h" - #include "wx/menu.h" -#endif //WX_PRECOMP - -#include "wx/cmdproc.h" - -// ============================================================================ -// implementation -// ============================================================================ - -IMPLEMENT_CLASS(wxCommand, wxObject) -IMPLEMENT_DYNAMIC_CLASS(wxCommandProcessor, wxObject) - -// ---------------------------------------------------------------------------- -// wxCommand -// ---------------------------------------------------------------------------- - -wxCommand::wxCommand(bool canUndoIt, const wxString& name) -{ - m_canUndo = canUndoIt; - m_commandName = name; -} - -// ---------------------------------------------------------------------------- -// Command processor -// ---------------------------------------------------------------------------- - -wxCommandProcessor::wxCommandProcessor(int maxCommands) -{ - m_maxNoCommands = maxCommands; -#if wxUSE_MENUS - m_commandEditMenu = (wxMenu *) NULL; -#endif // wxUSE_MENUS - m_undoAccelerator = wxT("\tCtrl+Z"); - m_redoAccelerator = wxT("\tCtrl+Y"); - - m_lastSavedCommand = - m_currentCommand = wxList::compatibility_iterator(); -} - -wxCommandProcessor::~wxCommandProcessor() -{ - ClearCommands(); -} - -bool wxCommandProcessor::DoCommand(wxCommand& cmd) -{ - return cmd.Do(); -} - -bool wxCommandProcessor::UndoCommand(wxCommand& cmd) -{ - return cmd.Undo(); -} - -// Pass a command to the processor. The processor calls Do(); -// if successful, is appended to the command history unless -// storeIt is false. -bool wxCommandProcessor::Submit(wxCommand *command, bool storeIt) -{ - wxCHECK_MSG( command, false, _T("no command in wxCommandProcessor::Submit") ); - - if ( !DoCommand(*command) ) - { - // the user code expects the command to be deleted anyhow - delete command; - - return false; - } - - if ( storeIt ) - Store(command); - else - delete command; - - return true; -} - -void wxCommandProcessor::Store(wxCommand *command) -{ - wxCHECK_RET( command, _T("no command in wxCommandProcessor::Store") ); - - // Correct a bug: we must chop off the current 'branch' - // so that we're at the end of the command list. - if (!m_currentCommand) - ClearCommands(); - else - { - wxList::compatibility_iterator node = m_currentCommand->GetNext(); - while (node) - { - wxList::compatibility_iterator next = node->GetNext(); - delete (wxCommand *)node->GetData(); - m_commands.Erase(node); - - // Make sure m_lastSavedCommand won't point to freed memory - if ( m_lastSavedCommand == node ) - m_lastSavedCommand = wxList::compatibility_iterator(); - - node = next; - } - } - - if ( (int)m_commands.GetCount() == m_maxNoCommands ) - { - wxList::compatibility_iterator firstNode = m_commands.GetFirst(); - wxCommand *firstCommand = (wxCommand *)firstNode->GetData(); - delete firstCommand; - m_commands.Erase(firstNode); - - // Make sure m_lastSavedCommand won't point to freed memory - if ( m_lastSavedCommand == firstNode ) - m_lastSavedCommand = wxList::compatibility_iterator(); - } - - m_commands.Append(command); - m_currentCommand = m_commands.GetLast(); - SetMenuStrings(); -} - -bool wxCommandProcessor::Undo() -{ - wxCommand *command = GetCurrentCommand(); - if ( command && command->CanUndo() ) - { - if ( UndoCommand(*command) ) - { - m_currentCommand = m_currentCommand->GetPrevious(); - SetMenuStrings(); - return true; - } - } - - return false; -} - -bool wxCommandProcessor::Redo() -{ - wxCommand *redoCommand = (wxCommand *) NULL; - wxList::compatibility_iterator redoNode -#if !wxUSE_STL - = NULL // just to avoid warnings -#endif // !wxUSE_STL - ; - - if ( m_currentCommand ) - { - // is there anything to redo? - if ( m_currentCommand->GetNext() ) - { - redoCommand = (wxCommand *)m_currentCommand->GetNext()->GetData(); - redoNode = m_currentCommand->GetNext(); - } - } - else // no current command, redo the first one - { - if (m_commands.GetCount() > 0) - { - redoCommand = (wxCommand *)m_commands.GetFirst()->GetData(); - redoNode = m_commands.GetFirst(); - } - } - - if (redoCommand) - { - bool success = DoCommand(*redoCommand); - if (success) - { - m_currentCommand = redoNode; - SetMenuStrings(); - return true; - } - } - return false; -} - -bool wxCommandProcessor::CanUndo() const -{ - wxCommand *command = GetCurrentCommand(); - - return command && command->CanUndo(); -} - -bool wxCommandProcessor::CanRedo() const -{ - if (m_currentCommand && !m_currentCommand->GetNext()) - return false; - - if (m_currentCommand && m_currentCommand->GetNext()) - return true; - - if (!m_currentCommand && (m_commands.GetCount() > 0)) - return true; - - return false; -} - -void wxCommandProcessor::Initialize() -{ - m_currentCommand = m_commands.GetLast(); - SetMenuStrings(); -} - -void wxCommandProcessor::SetMenuStrings() -{ -#if wxUSE_MENUS - if (m_commandEditMenu) - { - wxString undoLabel = GetUndoMenuLabel(); - wxString redoLabel = GetRedoMenuLabel(); - - m_commandEditMenu->SetLabel(wxID_UNDO, undoLabel); - m_commandEditMenu->Enable(wxID_UNDO, CanUndo()); - - m_commandEditMenu->SetLabel(wxID_REDO, redoLabel); - m_commandEditMenu->Enable(wxID_REDO, CanRedo()); - } -#endif // wxUSE_MENUS -} - -// Gets the current Undo menu label. -wxString wxCommandProcessor::GetUndoMenuLabel() const -{ - wxString buf; - if (m_currentCommand) - { - wxCommand *command = (wxCommand *)m_currentCommand->GetData(); - wxString commandName(command->GetName()); - if (commandName.empty()) commandName = _("Unnamed command"); - bool canUndo = command->CanUndo(); - if (canUndo) - buf = wxString(_("&Undo ")) + commandName + m_undoAccelerator; - else - buf = wxString(_("Can't &Undo ")) + commandName + m_undoAccelerator; - } - else - { - buf = _("&Undo") + m_undoAccelerator; - } - - return buf; -} - -// Gets the current Undo menu label. -wxString wxCommandProcessor::GetRedoMenuLabel() const -{ - wxString buf; - if (m_currentCommand) - { - // We can redo, if we're not at the end of the history. - if (m_currentCommand->GetNext()) - { - wxCommand *redoCommand = (wxCommand *)m_currentCommand->GetNext()->GetData(); - wxString redoCommandName(redoCommand->GetName()); - if (redoCommandName.empty()) redoCommandName = _("Unnamed command"); - buf = wxString(_("&Redo ")) + redoCommandName + m_redoAccelerator; - } - else - { - buf = _("&Redo") + m_redoAccelerator; - } - } - else - { - if (m_commands.GetCount() == 0) - { - buf = _("&Redo") + m_redoAccelerator; - } - else - { - // currentCommand is NULL but there are commands: this means that - // we've undone to the start of the list, but can redo the first. - wxCommand *redoCommand = (wxCommand *)m_commands.GetFirst()->GetData(); - wxString redoCommandName(redoCommand->GetName()); - if (redoCommandName.empty()) redoCommandName = _("Unnamed command"); - buf = wxString(_("&Redo ")) + redoCommandName + m_redoAccelerator; - } - } - return buf; -} - -void wxCommandProcessor::ClearCommands() -{ - wxList::compatibility_iterator node = m_commands.GetFirst(); - while (node) - { - wxCommand *command = (wxCommand *)node->GetData(); - delete command; - m_commands.Erase(node); - node = m_commands.GetFirst(); - } - - m_currentCommand = wxList::compatibility_iterator(); - m_lastSavedCommand = wxList::compatibility_iterator(); -} - - diff --git a/wxWidgets/src/common/cmndata.cpp b/wxWidgets/src/common/cmndata.cpp deleted file mode 100644 index a6edb97b22..0000000000 --- a/wxWidgets/src/common/cmndata.cpp +++ /dev/null @@ -1,660 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/common/cmndata.cpp -// Purpose: Common GDI data -// Author: Julian Smart -// Modified by: -// Created: 01/02/97 -// RCS-ID: $Id: cmndata.cpp 60700 2009-05-20 13:18:11Z JS $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#include "wx/cmndata.h" - -#ifndef WX_PRECOMP - #if defined(__WXMSW__) - #include "wx/msw/wrapcdlg.h" - #endif // MSW - #include - #include "wx/string.h" - #include "wx/utils.h" - #include "wx/app.h" - #include "wx/log.h" - #include "wx/gdicmn.h" -#endif - -#include "wx/prntbase.h" -#include "wx/printdlg.h" - -#if wxUSE_FONTDLG - #include "wx/fontdlg.h" -#endif // wxUSE_FONTDLG - -#if wxUSE_PRINTING_ARCHITECTURE - -#include "wx/paper.h" - -#if defined(__WXMAC__) - #include "wx/mac/private/print.h" -#endif - -IMPLEMENT_DYNAMIC_CLASS(wxPrintData, wxObject) -IMPLEMENT_DYNAMIC_CLASS(wxPrintDialogData, wxObject) -IMPLEMENT_DYNAMIC_CLASS(wxPageSetupDialogData, wxObject) - -#endif // wxUSE_PRINTING_ARCHITECTURE - -IMPLEMENT_DYNAMIC_CLASS(wxFontData, wxObject) -IMPLEMENT_DYNAMIC_CLASS(wxColourData, wxObject) - -// ============================================================================ -// implementation -// ============================================================================ - -// ---------------------------------------------------------------------------- -// wxColourData -// ---------------------------------------------------------------------------- - -wxColourData::wxColourData() -{ - m_chooseFull = false; - m_dataColour.Set(0,0,0); - // m_custColours are wxNullColours initially -} - -wxColourData::wxColourData(const wxColourData& data) - : wxObject() -{ - (*this) = data; -} - -wxColourData::~wxColourData() -{ -} - -void wxColourData::SetCustomColour(int i, const wxColour& colour) -{ - wxCHECK_RET( (i >= 0 && i < 16), _T("custom colour index out of range") ); - - m_custColours[i] = colour; -} - -wxColour wxColourData::GetCustomColour(int i) -{ - wxCHECK_MSG( (i >= 0 && i < 16), wxColour(0,0,0), - _T("custom colour index out of range") ); - - return m_custColours[i]; -} - -void wxColourData::operator=(const wxColourData& data) -{ - int i; - for (i = 0; i < 16; i++) - m_custColours[i] = data.m_custColours[i]; - - m_dataColour = (wxColour&)data.m_dataColour; - m_chooseFull = data.m_chooseFull; -} - -// ---------------------------------------------------------------------------- -// Font data -// ---------------------------------------------------------------------------- - -wxFontData::wxFontData() -{ - // Intialize colour to black. - m_fontColour = wxNullColour; - - m_showHelp = false; - m_allowSymbols = true; - m_enableEffects = true; - m_minSize = 0; - m_maxSize = 0; - - m_encoding = wxFONTENCODING_SYSTEM; -} - -wxFontData::~wxFontData() -{ -} - -#if wxUSE_FONTDLG - -wxFontDialogBase::~wxFontDialogBase() -{ -} - -#endif // wxUSE_FONTDLG - -#if wxUSE_PRINTING_ARCHITECTURE -// ---------------------------------------------------------------------------- -// Print data -// ---------------------------------------------------------------------------- - -wxPrintData::wxPrintData() -{ - m_bin = wxPRINTBIN_DEFAULT; - m_media = wxPRINTMEDIA_DEFAULT; - m_printMode = wxPRINT_MODE_PRINTER; - m_printOrientation = wxPORTRAIT; - m_printOrientationReversed = false; - m_printNoCopies = 1; - m_printCollate = false; - - // New, 24/3/99 - m_printerName = wxEmptyString; - m_colour = true; - m_duplexMode = wxDUPLEX_SIMPLEX; - m_printQuality = wxPRINT_QUALITY_HIGH; - - // we intentionally don't initialize paper id and size at all, like this - // the default system settings will be used for them - m_paperId = wxPAPER_NONE; - m_paperSize = wxDefaultSize; - - m_privData = NULL; - m_privDataLen = 0; - - m_nativeData = wxPrintFactory::GetFactory()->CreatePrintNativeData(); -} - -wxPrintData::wxPrintData(const wxPrintData& printData) - : wxObject() -{ - m_nativeData = NULL; - m_privData = NULL; - (*this) = printData; -} - -void wxPrintData::SetPrivData( char *privData, int len ) -{ - if (m_privData) - { - delete [] m_privData; - m_privData = NULL; - } - m_privDataLen = len; - if (m_privDataLen > 0) - { - m_privData = new char[m_privDataLen]; - memcpy( m_privData, privData, m_privDataLen ); - } -} - -wxPrintData::~wxPrintData() -{ - m_nativeData->m_ref--; - if (m_nativeData->m_ref == 0) - delete m_nativeData; - - if (m_privData) - delete [] m_privData; -} - -void wxPrintData::ConvertToNative() -{ - m_nativeData->TransferFrom( *this ) ; -} - -void wxPrintData::ConvertFromNative() -{ - m_nativeData->TransferTo( *this ) ; -} - -void wxPrintData::operator=(const wxPrintData& data) -{ - m_printNoCopies = data.m_printNoCopies; - m_printCollate = data.m_printCollate; - m_printOrientation = data.m_printOrientation; - m_printOrientationReversed = data.m_printOrientationReversed; - m_printerName = data.m_printerName; - m_colour = data.m_colour; - m_duplexMode = data.m_duplexMode; - m_printQuality = data.m_printQuality; - m_paperId = data.m_paperId; - m_paperSize = data.m_paperSize; - m_bin = data.m_bin; - m_media = data.m_media; - m_printMode = data.m_printMode; - m_filename = data.m_filename; - - // UnRef old m_nativeData - if (m_nativeData) - { - m_nativeData->m_ref--; - if (m_nativeData->m_ref == 0) - delete m_nativeData; - } - // Set Ref new one - m_nativeData = data.GetNativeData(); - m_nativeData->m_ref++; - - if (m_privData) - { - delete [] m_privData; - m_privData = NULL; - } - m_privDataLen = data.GetPrivDataLen(); - if (m_privDataLen > 0) - { - m_privData = new char[m_privDataLen]; - memcpy( m_privData, data.GetPrivData(), m_privDataLen ); - } -} - -// Is this data OK for showing the print dialog? -bool wxPrintData::IsOk() const -{ - m_nativeData->TransferFrom( *this ); - - return m_nativeData->Ok(); -} - -// What should happen here? wxPostScriptPrintNativeData is not -// defined unless all this is true on MSW. -#if WXWIN_COMPATIBILITY_2_4 && wxUSE_PRINTING_ARCHITECTURE && (!defined(__WXMSW__) || wxUSE_POSTSCRIPT_ARCHITECTURE_IN_MSW) - -#include "wx/generic/prntdlgg.h" - -#if wxUSE_POSTSCRIPT - #define WXUNUSED_WITHOUT_PS(name) name -#else - #define WXUNUSED_WITHOUT_PS(name) WXUNUSED(name) -#endif - -wxString wxPrintData::GetPrinterCommand() const -{ -#if wxUSE_POSTSCRIPT - if (m_nativeData && wxIsKindOf(m_nativeData,wxPostScriptPrintNativeData)) - return ((wxPostScriptPrintNativeData*)m_nativeData)->GetPrinterCommand(); -#endif - return wxEmptyString; -} - -wxString wxPrintData::GetPrinterOptions() const -{ -#if wxUSE_POSTSCRIPT - if (m_nativeData && wxIsKindOf(m_nativeData,wxPostScriptPrintNativeData)) - return ((wxPostScriptPrintNativeData*)m_nativeData)->GetPrinterOptions(); -#endif - return wxEmptyString; -} - -wxString wxPrintData::GetPreviewCommand() const -{ -#if wxUSE_POSTSCRIPT - if (m_nativeData && wxIsKindOf(m_nativeData,wxPostScriptPrintNativeData)) - return ((wxPostScriptPrintNativeData*)m_nativeData)->GetPreviewCommand(); -#endif - return wxEmptyString; -} - -wxString wxPrintData::GetFontMetricPath() const -{ -#if wxUSE_POSTSCRIPT - if (m_nativeData && wxIsKindOf(m_nativeData,wxPostScriptPrintNativeData)) - return ((wxPostScriptPrintNativeData*)m_nativeData)->GetFontMetricPath(); -#endif - return wxEmptyString; -} - -double wxPrintData::GetPrinterScaleX() const -{ -#if wxUSE_POSTSCRIPT - if (m_nativeData && wxIsKindOf(m_nativeData,wxPostScriptPrintNativeData)) - return ((wxPostScriptPrintNativeData*)m_nativeData)->GetPrinterScaleX(); -#endif - return 1.0; -} - -double wxPrintData::GetPrinterScaleY() const -{ -#if wxUSE_POSTSCRIPT - if (m_nativeData && wxIsKindOf(m_nativeData,wxPostScriptPrintNativeData)) - return ((wxPostScriptPrintNativeData*)m_nativeData)->GetPrinterScaleY(); -#endif - return 1.0; -} - -long wxPrintData::GetPrinterTranslateX() const -{ -#if wxUSE_POSTSCRIPT - if (m_nativeData && wxIsKindOf(m_nativeData,wxPostScriptPrintNativeData)) - return ((wxPostScriptPrintNativeData*)m_nativeData)->GetPrinterTranslateX(); -#endif - return 0; -} - -long wxPrintData::GetPrinterTranslateY() const -{ -#if wxUSE_POSTSCRIPT - if (m_nativeData && wxIsKindOf(m_nativeData,wxPostScriptPrintNativeData)) - return ((wxPostScriptPrintNativeData*)m_nativeData)->GetPrinterTranslateY(); -#endif - return 0; -} - -void wxPrintData::SetPrinterCommand(const wxString& WXUNUSED_WITHOUT_PS(command)) -{ -#if wxUSE_POSTSCRIPT - if (m_nativeData && wxIsKindOf(m_nativeData,wxPostScriptPrintNativeData)) - ((wxPostScriptPrintNativeData*)m_nativeData)->SetPrinterCommand( command ); -#endif -} - -void wxPrintData::SetPrinterOptions(const wxString& WXUNUSED_WITHOUT_PS(options)) -{ -#if wxUSE_POSTSCRIPT - if (m_nativeData && wxIsKindOf(m_nativeData,wxPostScriptPrintNativeData)) - ((wxPostScriptPrintNativeData*)m_nativeData)->SetPrinterOptions( options ); -#endif -} - -void wxPrintData::SetPreviewCommand(const wxString& WXUNUSED_WITHOUT_PS(command)) -{ -#if wxUSE_POSTSCRIPT - if (m_nativeData && wxIsKindOf(m_nativeData,wxPostScriptPrintNativeData)) - ((wxPostScriptPrintNativeData*)m_nativeData)->SetPreviewCommand( command ); -#endif -} - -void wxPrintData::SetFontMetricPath(const wxString& WXUNUSED_WITHOUT_PS(path)) -{ -#if wxUSE_POSTSCRIPT - if (m_nativeData && wxIsKindOf(m_nativeData,wxPostScriptPrintNativeData)) - ((wxPostScriptPrintNativeData*)m_nativeData)->SetFontMetricPath( path ); -#endif -} - -void wxPrintData::SetPrinterScaleX(double WXUNUSED_WITHOUT_PS(x)) -{ -#if wxUSE_POSTSCRIPT - if (m_nativeData && wxIsKindOf(m_nativeData,wxPostScriptPrintNativeData)) - ((wxPostScriptPrintNativeData*)m_nativeData)->SetPrinterScaleX( x ); -#endif -} - -void wxPrintData::SetPrinterScaleY(double WXUNUSED_WITHOUT_PS(y)) -{ -#if wxUSE_POSTSCRIPT - if (m_nativeData && wxIsKindOf(m_nativeData,wxPostScriptPrintNativeData)) - ((wxPostScriptPrintNativeData*)m_nativeData)->SetPrinterScaleY( y ); -#endif -} - -void wxPrintData::SetPrinterScaling(double WXUNUSED_WITHOUT_PS(x), double WXUNUSED_WITHOUT_PS(y)) -{ -#if wxUSE_POSTSCRIPT - if (m_nativeData && wxIsKindOf(m_nativeData,wxPostScriptPrintNativeData)) - ((wxPostScriptPrintNativeData*)m_nativeData)->SetPrinterScaling( x, y ); -#endif -} - -void wxPrintData::SetPrinterTranslateX(long WXUNUSED_WITHOUT_PS(x)) -{ -#if wxUSE_POSTSCRIPT - if (m_nativeData && wxIsKindOf(m_nativeData,wxPostScriptPrintNativeData)) - ((wxPostScriptPrintNativeData*)m_nativeData)->SetPrinterTranslateX( x ); -#endif -} - -void wxPrintData::SetPrinterTranslateY(long WXUNUSED_WITHOUT_PS(y)) -{ -#if wxUSE_POSTSCRIPT - if (m_nativeData && wxIsKindOf(m_nativeData,wxPostScriptPrintNativeData)) - ((wxPostScriptPrintNativeData*)m_nativeData)->SetPrinterTranslateY( y ); -#endif -} - -void wxPrintData::SetPrinterTranslation(long WXUNUSED_WITHOUT_PS(x), long WXUNUSED_WITHOUT_PS(y)) -{ -#if wxUSE_POSTSCRIPT - if (m_nativeData && wxIsKindOf(m_nativeData,wxPostScriptPrintNativeData)) - ((wxPostScriptPrintNativeData*)m_nativeData)->SetPrinterTranslation( x, y ); -#endif -} -#endif - -// ---------------------------------------------------------------------------- -// Print dialog data -// ---------------------------------------------------------------------------- - -wxPrintDialogData::wxPrintDialogData() -{ - m_printFromPage = 0; - m_printToPage = 0; - m_printMinPage = 0; - m_printMaxPage = 0; - m_printNoCopies = 1; - m_printAllPages = false; - m_printCollate = false; - m_printToFile = false; - m_printSelection = false; - m_printEnableSelection = false; - m_printEnablePageNumbers = true; - - wxPrintFactory* factory = wxPrintFactory::GetFactory(); - m_printEnablePrintToFile = ! factory->HasOwnPrintToFile(); - - m_printEnableHelp = false; -#if WXWIN_COMPATIBILITY_2_4 - m_printSetupDialog = false; -#endif -} - -wxPrintDialogData::wxPrintDialogData(const wxPrintDialogData& dialogData) - : wxObject() -{ - (*this) = dialogData; -} - -wxPrintDialogData::wxPrintDialogData(const wxPrintData& printData) -{ - m_printFromPage = 1; - m_printToPage = 0; - m_printMinPage = 1; - m_printMaxPage = 9999; - m_printNoCopies = 1; - m_printAllPages = false; - m_printCollate = false; - m_printToFile = false; - m_printSelection = false; - m_printEnableSelection = false; - m_printEnablePageNumbers = true; - m_printEnablePrintToFile = true; - m_printEnableHelp = false; -#if WXWIN_COMPATIBILITY_2_4 - m_printSetupDialog = false; -#endif - m_printData = printData; -} - -wxPrintDialogData::~wxPrintDialogData() -{ -} - -void wxPrintDialogData::operator=(const wxPrintDialogData& data) -{ - m_printFromPage = data.m_printFromPage; - m_printToPage = data.m_printToPage; - m_printMinPage = data.m_printMinPage; - m_printMaxPage = data.m_printMaxPage; - m_printNoCopies = data.m_printNoCopies; - m_printAllPages = data.m_printAllPages; - m_printCollate = data.m_printCollate; - m_printToFile = data.m_printToFile; - m_printSelection = data.m_printSelection; - m_printEnableSelection = data.m_printEnableSelection; - m_printEnablePageNumbers = data.m_printEnablePageNumbers; - m_printEnableHelp = data.m_printEnableHelp; - m_printEnablePrintToFile = data.m_printEnablePrintToFile; -#if WXWIN_COMPATIBILITY_2_4 - m_printSetupDialog = data.m_printSetupDialog; -#endif - m_printData = data.m_printData; -} - -void wxPrintDialogData::operator=(const wxPrintData& data) -{ - m_printData = data; -} - -// ---------------------------------------------------------------------------- -// wxPageSetupDialogData -// ---------------------------------------------------------------------------- - -wxPageSetupDialogData::wxPageSetupDialogData() -{ - m_paperSize = wxSize(0,0); - - CalculatePaperSizeFromId(); - - m_minMarginTopLeft = - m_minMarginBottomRight = - m_marginTopLeft = - m_marginBottomRight = wxPoint(0,0); - - // Flags - m_defaultMinMargins = false; - m_enableMargins = true; - m_enableOrientation = true; - m_enablePaper = true; - m_enablePrinter = true; - m_enableHelp = false; - m_getDefaultInfo = false; -} - -wxPageSetupDialogData::wxPageSetupDialogData(const wxPageSetupDialogData& dialogData) - : wxObject() -{ - (*this) = dialogData; -} - -wxPageSetupDialogData::wxPageSetupDialogData(const wxPrintData& printData) -{ - m_paperSize = wxSize(0,0); - m_minMarginTopLeft = - m_minMarginBottomRight = - m_marginTopLeft = - m_marginBottomRight = wxPoint(0,0); - - // Flags - m_defaultMinMargins = false; - m_enableMargins = true; - m_enableOrientation = true; - m_enablePaper = true; - m_enablePrinter = true; - m_enableHelp = false; - m_getDefaultInfo = false; - - m_printData = printData; - - // The wxPrintData paper size overrides these values, unless the size cannot - // be found. - CalculatePaperSizeFromId(); -} - -wxPageSetupDialogData::~wxPageSetupDialogData() -{ -} - -wxPageSetupDialogData& wxPageSetupDialogData::operator=(const wxPageSetupDialogData& data) -{ - m_paperSize = data.m_paperSize; - m_minMarginTopLeft = data.m_minMarginTopLeft; - m_minMarginBottomRight = data.m_minMarginBottomRight; - m_marginTopLeft = data.m_marginTopLeft; - m_marginBottomRight = data.m_marginBottomRight; - m_defaultMinMargins = data.m_defaultMinMargins; - m_enableMargins = data.m_enableMargins; - m_enableOrientation = data.m_enableOrientation; - m_enablePaper = data.m_enablePaper; - m_enablePrinter = data.m_enablePrinter; - m_getDefaultInfo = data.m_getDefaultInfo; - m_enableHelp = data.m_enableHelp; - - m_printData = data.m_printData; - - return *this; -} - -wxPageSetupDialogData& wxPageSetupDialogData::operator=(const wxPrintData& data) -{ - m_printData = data; - CalculatePaperSizeFromId(); - - return *this; -} - -// If a corresponding paper type is found in the paper database, will set the m_printData -// paper size id member as well. -void wxPageSetupDialogData::SetPaperSize(const wxSize& sz) -{ - m_paperSize = sz; - - CalculateIdFromPaperSize(); -} - -// Sets the wxPrintData id, plus the paper width/height if found in the paper database. -void wxPageSetupDialogData::SetPaperSize(wxPaperSize id) -{ - m_printData.SetPaperId(id); - - CalculatePaperSizeFromId(); -} - -void wxPageSetupDialogData::SetPrintData(const wxPrintData& printData) -{ - m_printData = printData; - CalculatePaperSizeFromId(); -} - -// Use paper size defined in this object to set the wxPrintData -// paper id -void wxPageSetupDialogData::CalculateIdFromPaperSize() -{ - wxASSERT_MSG( (wxThePrintPaperDatabase != (wxPrintPaperDatabase*) NULL), - wxT("wxThePrintPaperDatabase should not be NULL. Do not create global print dialog data objects.") ); - - wxSize sz = GetPaperSize(); - - wxPaperSize id = wxThePrintPaperDatabase->GetSize(wxSize(sz.x* 10, sz.y * 10)); - if (id != wxPAPER_NONE) - { - m_printData.SetPaperId(id); - } -} - -// Use paper id in wxPrintData to set this object's paper size -void wxPageSetupDialogData::CalculatePaperSizeFromId() -{ - wxASSERT_MSG( (wxThePrintPaperDatabase != (wxPrintPaperDatabase*) NULL), - wxT("wxThePrintPaperDatabase should not be NULL. Do not create global print dialog data objects.") ); - - wxSize sz = wxThePrintPaperDatabase->GetSize(m_printData.GetPaperId()); - - if (sz != wxSize(0, 0)) - { - // sz is in 10ths of a mm, while paper size is in mm - m_paperSize.x = sz.x / 10; - m_paperSize.y = sz.y / 10; - } -} - -#endif // wxUSE_PRINTING_ARCHITECTURE diff --git a/wxWidgets/src/common/colourcmn.cpp b/wxWidgets/src/common/colourcmn.cpp deleted file mode 100644 index 5851dfcdf3..0000000000 --- a/wxWidgets/src/common/colourcmn.cpp +++ /dev/null @@ -1,126 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/common/colourcmn.cpp -// Purpose: wxColourBase implementation -// Author: Francesco Montorsi -// Modified by: -// Created: 20/4/2006 -// RCS-ID: $Id: colourcmn.cpp 41538 2006-09-30 20:45:15Z RR $ -// Copyright: (c) Francesco Montorsi -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#include "wx/colour.h" - -#ifndef WX_PRECOMP - #include "wx/log.h" - #include "wx/utils.h" - #include "wx/gdicmn.h" -#endif - -#if wxUSE_VARIANT -IMPLEMENT_VARIANT_OBJECT_EXPORTED(wxColour,WXDLLEXPORT) -#endif - -// ============================================================================ -// wxString <-> wxColour conversions -// ============================================================================ - -bool wxColourBase::FromString(const wxChar *str) -{ - if ( str == NULL || str[0] == wxT('\0')) - return false; // invalid or empty string - - if ( wxStrncmp(str, wxT("RGB"), 3) == 0 || - wxStrncmp(str, wxT("rgb"), 3) == 0 ) - { - // CSS-like RGB specification - // according to http://www.w3.org/TR/REC-CSS2/syndata.html#color-units - // values outside 0-255 range are allowed but should be clipped - int red, green, blue; - if (wxSscanf(&str[3], wxT("(%d, %d, %d)"), &red, &green, &blue) != 3) - return false; - - Set((unsigned char)wxClip(red,0,255), - (unsigned char)wxClip(green,0,255), - (unsigned char)wxClip(blue,0,255)); - } - else if ( str[0] == wxT('#') && wxStrlen(str) == 7 ) - { - // hexadecimal prefixed with # (HTML syntax) - unsigned long tmp; - if (wxSscanf(&str[1], wxT("%lx"), &tmp) != 1) - return false; - - Set((unsigned char)(tmp >> 16), - (unsigned char)(tmp >> 8), - (unsigned char)tmp); - } - else if (wxTheColourDatabase) // a colour name ? - { - // we can't do - // *this = wxTheColourDatabase->Find(str) - // because this place can be called from constructor - // and 'this' could not be available yet - wxColour clr = wxTheColourDatabase->Find(str); - if (clr.Ok()) - Set((unsigned char)clr.Red(), - (unsigned char)clr.Green(), - (unsigned char)clr.Blue()); - } - - if (Ok()) - return true; - - wxLogDebug(wxT("wxColour::Set - couldn't set to colour string '%s'"), str); - return false; -} - -wxString wxColourBase::GetAsString(long flags) const -{ - wxString colName; - - if (flags & wxC2S_NAME) - colName = wxTheColourDatabase->FindName((const wxColour &)(*this)).MakeLower(); - - if ( colName.empty() && (flags & wxC2S_CSS_SYNTAX) ) - { - // no name for this colour; return it in CSS syntax - colName.Printf(wxT("rgb(%d, %d, %d)"), - Red(), Green(), Blue()); - } - else if ( colName.empty() && (flags & wxC2S_HTML_SYNTAX) ) - { - // no name for this colour; return it in HTML syntax - colName.Printf(wxT("#%02X%02X%02X"), - Red(), Green(), Blue()); - } - - // this function always returns a non-empty string - wxASSERT_MSG(!colName.empty(), - wxT("Invalid wxColour -> wxString conversion flags")); - - return colName; -} - -#if WXWIN_COMPATIBILITY_2_6 - -// static -wxColour wxColourBase::CreateByName(const wxString& name) -{ - return wxColour(name); -} - -void wxColourBase::InitFromName(const wxString& col) -{ - Set(col); -} - -#endif // WXWIN_COMPATIBILITY_2_6 diff --git a/wxWidgets/src/common/combocmn.cpp b/wxWidgets/src/common/combocmn.cpp deleted file mode 100644 index f67061a3c9..0000000000 --- a/wxWidgets/src/common/combocmn.cpp +++ /dev/null @@ -1,2340 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/common/combocmn.cpp -// Purpose: wxComboCtrlBase -// Author: Jaakko Salli -// Modified by: -// Created: Apr-30-2006 -// RCS-ID: $Id: combocmn.cpp 67178 2011-03-13 09:32:19Z JMS $ -// Copyright: (c) 2005 Jaakko Salli -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_COMBOCTRL - -#include "wx/combobox.h" - -#ifndef WX_PRECOMP - #include "wx/app.h" - #include "wx/log.h" - #include "wx/dcclient.h" - #include "wx/settings.h" - #include "wx/dialog.h" - #include "wx/timer.h" -#endif - -#include "wx/tooltip.h" - -#include "wx/combo.h" - - - -// constants -// ---------------------------------------------------------------------------- - -#define DEFAULT_DROPBUTTON_WIDTH 19 - -#define BMP_BUTTON_MARGIN 4 - -#define DEFAULT_POPUP_HEIGHT 400 - -#define DEFAULT_TEXT_INDENT 3 - -#define COMBO_MARGIN 2 // spacing right of wxTextCtrl - - -#if defined(__WXMSW__) - -#define USE_TRANSIENT_POPUP 1 // Use wxPopupWindowTransient (preferred, if it works properly on platform) -#define TRANSIENT_POPUPWIN_IS_PERFECT 0 // wxPopupTransientWindow works, its child can have focus, and common - // native controls work on it like normal. -#define POPUPWIN_IS_PERFECT 0 // Same, but for non-transient popup window. -#define TEXTCTRL_TEXT_CENTERED 0 // 1 if text in textctrl is vertically centered -#define FOCUS_RING 0 // No focus ring on wxMSW - -//#undef wxUSE_POPUPWIN -//#define wxUSE_POPUPWIN 0 - -#elif defined(__WXGTK__) - -// NB: It is not recommended to use wxDialog as popup on wxGTK, because of -// this bug: If wxDialog is hidden, its position becomes corrupt -// between hide and next show, but without internal coordinates being -// reflected (or something like that - atleast commenting out ->Hide() -// seemed to eliminate the position change). - -#define USE_TRANSIENT_POPUP 1 // Use wxPopupWindowTransient (preferred, if it works properly on platform) -#define TRANSIENT_POPUPWIN_IS_PERFECT 0 // wxPopupTransientWindow works, its child can have focus, and common - // native controls work on it like normal. -#define POPUPWIN_IS_PERFECT 1 // Same, but for non-transient popup window. -#define TEXTCTRL_TEXT_CENTERED 1 // 1 if text in textctrl is vertically centered -#define FOCUS_RING 0 // No focus ring on wxGTK - -#elif defined(__WXMAC__) - -#define USE_TRANSIENT_POPUP 0 // Use wxPopupWindowTransient (preferred, if it works properly on platform) -#define TRANSIENT_POPUPWIN_IS_PERFECT 0 // wxPopupTransientWindow works, its child can have focus, and common - // native controls work on it like normal. -#define POPUPWIN_IS_PERFECT 0 // Same, but for non-transient popup window. -#define TEXTCTRL_TEXT_CENTERED 1 // 1 if text in textctrl is vertically centered -#define FOCUS_RING 3 // Reserve room for the textctrl's focus ring to display - -#undef DEFAULT_DROPBUTTON_WIDTH -#define DEFAULT_DROPBUTTON_WIDTH 22 -#undef COMBO_MARGIN -#define COMBO_MARGIN FOCUS_RING - -#else - -#define USE_TRANSIENT_POPUP 0 // Use wxPopupWindowTransient (preferred, if it works properly on platform) -#define TRANSIENT_POPUPWIN_IS_PERFECT 0 // wxPopupTransientWindow works, its child can have focus, and common - // native controls work on it like normal. -#define POPUPWIN_IS_PERFECT 0 // Same, but for non-transient popup window. -#define TEXTCTRL_TEXT_CENTERED 1 // 1 if text in textctrl is vertically centered -#define FOCUS_RING 0 - -#endif - - -// Popupwin is really only supported on wxMSW (not WINCE) and wxGTK, regardless -// what the wxUSE_POPUPWIN says. -// FIXME: Why isn't wxUSE_POPUPWIN reliable any longer? (it was in wxW2.6.2) -#if (!defined(__WXMSW__) && !defined(__WXGTK__)) || defined(__WXWINCE__) -#undef wxUSE_POPUPWIN -#define wxUSE_POPUPWIN 0 -#endif - - -#if wxUSE_POPUPWIN - #include "wx/popupwin.h" -#else - #undef USE_TRANSIENT_POPUP - #define USE_TRANSIENT_POPUP 0 -#endif - - -// Define different types of popup windows -enum -{ - POPUPWIN_NONE = 0, - POPUPWIN_WXPOPUPTRANSIENTWINDOW = 1, - POPUPWIN_WXPOPUPWINDOW = 2, - POPUPWIN_WXDIALOG = 3 -}; - - -#if USE_TRANSIENT_POPUP - // wxPopupTransientWindow is implemented - - #define wxComboPopupWindowBase wxPopupTransientWindow - #define PRIMARY_POPUP_TYPE POPUPWIN_WXPOPUPTRANSIENTWINDOW - #define USES_WXPOPUPTRANSIENTWINDOW 1 - - #if TRANSIENT_POPUPWIN_IS_PERFECT - // - #elif POPUPWIN_IS_PERFECT - #define wxComboPopupWindowBase2 wxPopupWindow - #define SECONDARY_POPUP_TYPE POPUPWIN_WXPOPUPWINDOW - #define USES_WXPOPUPWINDOW 1 - #else - #define wxComboPopupWindowBase2 wxDialog - #define SECONDARY_POPUP_TYPE POPUPWIN_WXDIALOG - #define USES_WXDIALOG 1 - #endif - -#elif wxUSE_POPUPWIN - // wxPopupWindow (but not wxPopupTransientWindow) is properly implemented - - #define wxComboPopupWindowBase wxPopupWindow - #define PRIMARY_POPUP_TYPE POPUPWIN_WXPOPUPWINDOW - #define USES_WXPOPUPWINDOW 1 - - #if !POPUPWIN_IS_PERFECT - #define wxComboPopupWindowBase2 wxDialog - #define SECONDARY_POPUP_TYPE POPUPWIN_WXDIALOG - #define USES_WXDIALOG 1 - #endif - -#else - // wxPopupWindow is not implemented - - #define wxComboPopupWindowBase wxDialog - #define PRIMARY_POPUP_TYPE POPUPWIN_WXDIALOG - #define USES_WXDIALOG 1 - -#endif - - -#ifndef USES_WXPOPUPTRANSIENTWINDOW - #define USES_WXPOPUPTRANSIENTWINDOW 0 -#endif - -#ifndef USES_WXPOPUPWINDOW - #define USES_WXPOPUPWINDOW 0 -#endif - -#ifndef USES_WXDIALOG - #define USES_WXDIALOG 0 -#endif - - -#if USES_WXPOPUPWINDOW - #define INSTALL_TOPLEV_HANDLER 1 -#else - #define INSTALL_TOPLEV_HANDLER 0 -#endif - - -// -// ** TODO ** -// * wxComboPopupWindow for external use (ie. replace old wxUniv wxPopupComboWindow) -// - - -// ---------------------------------------------------------------------------- -// wxComboFrameEventHandler takes care of hiding the popup when events happen -// in its top level parent. -// ---------------------------------------------------------------------------- - -#if INSTALL_TOPLEV_HANDLER - -// -// This will no longer be necessary after wxTransientPopupWindow -// works well on all platforms. -// - -class wxComboFrameEventHandler : public wxEvtHandler -{ -public: - wxComboFrameEventHandler( wxComboCtrlBase* pCb ); - virtual ~wxComboFrameEventHandler(); - - void OnPopup(); - - void OnIdle( wxIdleEvent& event ); - void OnMouseEvent( wxMouseEvent& event ); - void OnActivate( wxActivateEvent& event ); - void OnResize( wxSizeEvent& event ); - void OnMove( wxMoveEvent& event ); - void OnMenuEvent( wxMenuEvent& event ); - void OnClose( wxCloseEvent& event ); - -protected: - wxWindow* m_focusStart; - wxComboCtrlBase* m_combo; - -private: - DECLARE_EVENT_TABLE() -}; - -BEGIN_EVENT_TABLE(wxComboFrameEventHandler, wxEvtHandler) - EVT_IDLE(wxComboFrameEventHandler::OnIdle) - EVT_LEFT_DOWN(wxComboFrameEventHandler::OnMouseEvent) - EVT_RIGHT_DOWN(wxComboFrameEventHandler::OnMouseEvent) - EVT_SIZE(wxComboFrameEventHandler::OnResize) - EVT_MOVE(wxComboFrameEventHandler::OnMove) - EVT_MENU_HIGHLIGHT(wxID_ANY,wxComboFrameEventHandler::OnMenuEvent) - EVT_MENU_OPEN(wxComboFrameEventHandler::OnMenuEvent) - EVT_ACTIVATE(wxComboFrameEventHandler::OnActivate) - EVT_CLOSE(wxComboFrameEventHandler::OnClose) -END_EVENT_TABLE() - -wxComboFrameEventHandler::wxComboFrameEventHandler( wxComboCtrlBase* combo ) - : wxEvtHandler() -{ - m_combo = combo; -} - -wxComboFrameEventHandler::~wxComboFrameEventHandler() -{ -} - -void wxComboFrameEventHandler::OnPopup() -{ - m_focusStart = ::wxWindow::FindFocus(); -} - -void wxComboFrameEventHandler::OnIdle( wxIdleEvent& event ) -{ - wxWindow* winFocused = ::wxWindow::FindFocus(); - - wxWindow* popup = m_combo->GetPopupControl()->GetControl(); - wxWindow* winpopup = m_combo->GetPopupWindow(); - - if ( - winFocused != m_focusStart && - winFocused != popup && - winFocused->GetParent() != popup && - winFocused != winpopup && - winFocused->GetParent() != winpopup && - winFocused != m_combo && - winFocused != m_combo->GetButton() // GTK (atleast) requires this - ) - { - m_combo->HidePopup(); - } - - event.Skip(); -} - -void wxComboFrameEventHandler::OnMenuEvent( wxMenuEvent& event ) -{ - m_combo->HidePopup(); - event.Skip(); -} - -void wxComboFrameEventHandler::OnMouseEvent( wxMouseEvent& event ) -{ - m_combo->HidePopup(); - event.Skip(); -} - -void wxComboFrameEventHandler::OnClose( wxCloseEvent& event ) -{ - m_combo->HidePopup(); - event.Skip(); -} - -void wxComboFrameEventHandler::OnActivate( wxActivateEvent& event ) -{ - m_combo->HidePopup(); - event.Skip(); -} - -void wxComboFrameEventHandler::OnResize( wxSizeEvent& event ) -{ - m_combo->HidePopup(); - event.Skip(); -} - -void wxComboFrameEventHandler::OnMove( wxMoveEvent& event ) -{ - m_combo->HidePopup(); - event.Skip(); -} - -#endif // INSTALL_TOPLEV_HANDLER - -// ---------------------------------------------------------------------------- -// wxComboPopupWindow is, in essence, wxPopupWindow customized for -// wxComboCtrl. -// ---------------------------------------------------------------------------- - -class wxComboPopupWindow : public wxComboPopupWindowBase -{ -public: - - wxComboPopupWindow( wxComboCtrlBase *parent, - int style ) - #if USES_WXPOPUPWINDOW || USES_WXPOPUPTRANSIENTWINDOW - : wxComboPopupWindowBase(parent,style) - #else - : wxComboPopupWindowBase(parent, - wxID_ANY, - wxEmptyString, - wxPoint(-21,-21), - wxSize(20,20), - style) - #endif - { - m_inShow = 0; - } - -#if USES_WXPOPUPTRANSIENTWINDOW - virtual bool Show( bool show ); - virtual bool ProcessLeftDown(wxMouseEvent& event); -protected: - virtual void OnDismiss(); -#endif - -private: - wxByte m_inShow; -}; - - -#if USES_WXPOPUPTRANSIENTWINDOW -bool wxComboPopupWindow::Show( bool show ) -{ - // Guard against recursion - if ( m_inShow ) - return wxComboPopupWindowBase::Show(show); - - m_inShow++; - - wxASSERT( IsKindOf(CLASSINFO(wxPopupTransientWindow)) ); - - wxPopupTransientWindow* ptw = (wxPopupTransientWindow*) this; - wxComboCtrlBase* combo = (wxComboCtrlBase*) GetParent(); - - if ( show != ptw->IsShown() ) - { - if ( show ) - ptw->Popup(combo->GetPopupControl()->GetControl()); - else - ptw->Dismiss(); - } - - m_inShow--; - - return true; -} - -bool wxComboPopupWindow::ProcessLeftDown(wxMouseEvent& event) -{ - return wxPopupTransientWindow::ProcessLeftDown(event); -} - -// First thing that happens when a transient popup closes is that this method gets called. -void wxComboPopupWindow::OnDismiss() -{ - wxComboCtrlBase* combo = (wxComboCtrlBase*) GetParent(); - wxASSERT_MSG( combo->IsKindOf(CLASSINFO(wxComboCtrlBase)), - wxT("parent might not be wxComboCtrl, but check IMPLEMENT_DYNAMIC_CLASS(2) macro for correctness") ); - - combo->OnPopupDismiss(); -} -#endif // USES_WXPOPUPTRANSIENTWINDOW - - -// ---------------------------------------------------------------------------- -// wxComboPopupWindowEvtHandler does bulk of the custom event handling -// of a popup window. It is separate so we can have different types -// of popup windows. -// ---------------------------------------------------------------------------- - -class wxComboPopupWindowEvtHandler : public wxEvtHandler -{ -public: - - wxComboPopupWindowEvtHandler( wxComboCtrlBase *parent ) - { - m_combo = parent; - } - - void OnSizeEvent( wxSizeEvent& event ); - void OnKeyEvent(wxKeyEvent& event); -#if USES_WXDIALOG - void OnActivate( wxActivateEvent& event ); -#endif - -private: - wxComboCtrlBase* m_combo; - - DECLARE_EVENT_TABLE() -}; - - -BEGIN_EVENT_TABLE(wxComboPopupWindowEvtHandler, wxEvtHandler) - EVT_KEY_DOWN(wxComboPopupWindowEvtHandler::OnKeyEvent) - EVT_KEY_UP(wxComboPopupWindowEvtHandler::OnKeyEvent) -#if USES_WXDIALOG - EVT_ACTIVATE(wxComboPopupWindowEvtHandler::OnActivate) -#endif - EVT_SIZE(wxComboPopupWindowEvtHandler::OnSizeEvent) -END_EVENT_TABLE() - - -void wxComboPopupWindowEvtHandler::OnSizeEvent( wxSizeEvent& WXUNUSED(event) ) -{ - // Block the event so that the popup control does not get auto-resized. -} - -void wxComboPopupWindowEvtHandler::OnKeyEvent( wxKeyEvent& event ) -{ - // Relay keyboard event to the main child controls - wxWindowList children = m_combo->GetPopupWindow()->GetChildren(); - wxWindowList::iterator node = children.begin(); - wxWindow* child = (wxWindow*)*node; - child->AddPendingEvent(event); -} - -#if USES_WXDIALOG -void wxComboPopupWindowEvtHandler::OnActivate( wxActivateEvent& event ) -{ - if ( !event.GetActive() ) - { - // Tell combo control that we are dismissed. - m_combo->HidePopup(); - - event.Skip(); - } -} -#endif - - -// ---------------------------------------------------------------------------- -// wxComboPopup -// -// ---------------------------------------------------------------------------- - -wxComboPopup::~wxComboPopup() -{ -} - -void wxComboPopup::OnPopup() -{ -} - -void wxComboPopup::OnDismiss() -{ -} - -wxSize wxComboPopup::GetAdjustedSize( int minWidth, - int prefHeight, - int WXUNUSED(maxHeight) ) -{ - return wxSize(minWidth,prefHeight); -} - -void wxComboPopup::DefaultPaintComboControl( wxComboCtrlBase* combo, - wxDC& dc, const wxRect& rect ) -{ - if ( combo->GetWindowStyle() & wxCB_READONLY ) // ie. no textctrl - { - combo->PrepareBackground(dc,rect,0); - - dc.DrawText( combo->GetValue(), - rect.x + combo->GetTextIndent(), - (rect.height-dc.GetCharHeight())/2 + rect.y ); - } -} - -void wxComboPopup::PaintComboControl( wxDC& dc, const wxRect& rect ) -{ - DefaultPaintComboControl(m_combo,dc,rect); -} - -void wxComboPopup::OnComboKeyEvent( wxKeyEvent& event ) -{ - event.Skip(); -} - -void wxComboPopup::OnComboDoubleClick() -{ -} - -void wxComboPopup::SetStringValue( const wxString& WXUNUSED(value) ) -{ -} - -bool wxComboPopup::LazyCreate() -{ - return false; -} - -void wxComboPopup::Dismiss() -{ - m_combo->HidePopup(); -} - -// ---------------------------------------------------------------------------- -// input handling -// ---------------------------------------------------------------------------- - -// -// This is pushed to the event handler queue of the child textctrl. -// -class wxComboBoxExtraInputHandler : public wxEvtHandler -{ -public: - - wxComboBoxExtraInputHandler( wxComboCtrlBase* combo ) - : wxEvtHandler() - { - m_combo = combo; - } - virtual ~wxComboBoxExtraInputHandler() { } - void OnKey(wxKeyEvent& event); - void OnFocus(wxFocusEvent& event); - -protected: - wxComboCtrlBase* m_combo; - -private: - DECLARE_EVENT_TABLE() -}; - - -BEGIN_EVENT_TABLE(wxComboBoxExtraInputHandler, wxEvtHandler) - EVT_KEY_DOWN(wxComboBoxExtraInputHandler::OnKey) - EVT_KEY_UP(wxComboBoxExtraInputHandler::OnKey) - EVT_CHAR(wxComboBoxExtraInputHandler::OnKey) - EVT_SET_FOCUS(wxComboBoxExtraInputHandler::OnFocus) -END_EVENT_TABLE() - - -void wxComboBoxExtraInputHandler::OnKey(wxKeyEvent& event) -{ - // Let the wxComboCtrl event handler have a go first. - wxComboCtrlBase* combo = m_combo; - - wxKeyEvent redirectedEvent(event); - redirectedEvent.SetId(combo->GetId()); - redirectedEvent.SetEventObject(combo); - - if ( !combo->GetEventHandler()->ProcessEvent(redirectedEvent) ) - { - // Don't let TAB through to the text ctrl - looks ugly - if ( event.GetKeyCode() != WXK_TAB ) - event.Skip(); - } -} - -void wxComboBoxExtraInputHandler::OnFocus(wxFocusEvent& event) -{ - // FIXME: This code does run when control is clicked, - // yet on Windows it doesn't select all the text. - if ( !(m_combo->GetInternalFlags() & wxCC_NO_TEXT_AUTO_SELECT) ) - { - if ( m_combo->GetTextCtrl() ) - m_combo->GetTextCtrl()->SelectAll(); - else - m_combo->SetSelection(-1,-1); - } - - // Send focus indication to parent. - // NB: This is needed for cases where the textctrl gets focus - // instead of its parent. While this may trigger multiple - // wxEVT_SET_FOCUSes (since m_text->SetFocus is called - // from combo's focus event handler), they should be quite - // harmless. - wxFocusEvent evt2(wxEVT_SET_FOCUS,m_combo->GetId()); - evt2.SetEventObject(m_combo); - m_combo->GetEventHandler()->ProcessEvent(evt2); - - event.Skip(); -} - - -// -// This is pushed to the event handler queue of the control in popup. -// - -class wxComboPopupExtraEventHandler : public wxEvtHandler -{ -public: - - wxComboPopupExtraEventHandler( wxComboCtrlBase* combo ) - : wxEvtHandler() - { - m_combo = combo; - m_beenInside = false; - } - virtual ~wxComboPopupExtraEventHandler() { } - - void OnMouseEvent( wxMouseEvent& event ); - - // Called from wxComboCtrlBase::OnPopupDismiss - void OnPopupDismiss() - { - m_beenInside = false; - } - -protected: - wxComboCtrlBase* m_combo; - - bool m_beenInside; - -private: - DECLARE_EVENT_TABLE() -}; - - -BEGIN_EVENT_TABLE(wxComboPopupExtraEventHandler, wxEvtHandler) - EVT_MOUSE_EVENTS(wxComboPopupExtraEventHandler::OnMouseEvent) -END_EVENT_TABLE() - - -void wxComboPopupExtraEventHandler::OnMouseEvent( wxMouseEvent& event ) -{ - wxPoint pt = event.GetPosition(); - wxSize sz = m_combo->GetPopupControl()->GetControl()->GetClientSize(); - int evtType = event.GetEventType(); - bool isInside = pt.x >= 0 && pt.y >= 0 && pt.x < sz.x && pt.y < sz.y; - - if ( evtType == wxEVT_MOTION || - evtType == wxEVT_LEFT_DOWN || - evtType == wxEVT_RIGHT_DOWN ) - { - // Block motion and click events outside the popup - if ( !isInside || !m_combo->IsPopupShown() ) - { - event.Skip(false); - return; - } - } - else if ( evtType == wxEVT_LEFT_UP ) - { - if ( !m_combo->IsPopupShown() ) - { - event.Skip(false); - return; - } - - if ( !m_beenInside ) - { - if ( isInside ) - { - m_beenInside = true; - } - else - { - // - // Some mouse events to popup that happen outside it, before cursor - // has been inside the popu, need to be ignored by it but relayed to - // the dropbutton. - // - wxWindow* btn = m_combo->GetButton(); - if ( btn ) - btn->GetEventHandler()->AddPendingEvent(event); - else - m_combo->GetEventHandler()->AddPendingEvent(event); - - return; - } - - event.Skip(); - } - } - - event.Skip(); -} - -// ---------------------------------------------------------------------------- -// wxComboCtrlBase -// ---------------------------------------------------------------------------- - - -BEGIN_EVENT_TABLE(wxComboCtrlBase, wxControl) - EVT_TEXT(wxID_ANY,wxComboCtrlBase::OnTextCtrlEvent) - EVT_SIZE(wxComboCtrlBase::OnSizeEvent) - EVT_SET_FOCUS(wxComboCtrlBase::OnFocusEvent) - EVT_KILL_FOCUS(wxComboCtrlBase::OnFocusEvent) - EVT_IDLE(wxComboCtrlBase::OnIdleEvent) - //EVT_BUTTON(wxID_ANY,wxComboCtrlBase::OnButtonClickEvent) - EVT_KEY_DOWN(wxComboCtrlBase::OnKeyEvent) - EVT_TEXT_ENTER(wxID_ANY,wxComboCtrlBase::OnTextCtrlEvent) - EVT_SYS_COLOUR_CHANGED(wxComboCtrlBase::OnSysColourChanged) -END_EVENT_TABLE() - - -IMPLEMENT_ABSTRACT_CLASS(wxComboCtrlBase, wxControl) - -void wxComboCtrlBase::Init() -{ - m_winPopup = (wxWindow *)NULL; - m_popup = (wxWindow *)NULL; - m_popupWinState = Hidden; - m_btn = (wxWindow*) NULL; - m_text = (wxTextCtrl*) NULL; - m_popupInterface = (wxComboPopup*) NULL; - - m_popupExtraHandler = (wxEvtHandler*) NULL; - m_textEvtHandler = (wxEvtHandler*) NULL; - -#if INSTALL_TOPLEV_HANDLER - m_toplevEvtHandler = (wxEvtHandler*) NULL; -#endif - - m_mainCtrlWnd = this; - - m_heightPopup = -1; - m_widthMinPopup = -1; - m_anchorSide = 0; - m_widthCustomPaint = 0; - m_widthCustomBorder = 0; - - m_btnState = 0; - m_btnWidDefault = 0; - m_blankButtonBg = false; - m_ignoreEvtText = 0; - m_popupWinType = POPUPWIN_NONE; - m_btnWid = m_btnHei = -1; - m_btnSide = wxRIGHT; - m_btnSpacingX = 0; - - m_extLeft = 0; - m_extRight = 0; - m_absIndent = -1; - m_iFlags = 0; - m_timeCanAcceptClick = 0; - - m_resetFocus = false; -} - -bool wxComboCtrlBase::Create(wxWindow *parent, - wxWindowID id, - const wxString& value, - const wxPoint& pos, - const wxSize& size, - long style, - const wxValidator& validator, - const wxString& name) -{ - if ( !wxControl::Create(parent, - id, - pos, - size, - style | wxWANTS_CHARS, - validator, - name) ) - return false; - - m_valueString = value; - - // Get colours - OnThemeChange(); - m_absIndent = GetNativeTextIndent(); - - m_iFlags |= wxCC_IFLAG_CREATED; - - // If x and y indicate valid size, wxSizeEvent won't be - // emitted automatically, so we need to add artifical one. - if ( size.x > 0 && size.y > 0 ) - { - wxSizeEvent evt(size,GetId()); - GetEventHandler()->AddPendingEvent(evt); - } - - return true; -} - -void wxComboCtrlBase::InstallInputHandlers() -{ - if ( m_text ) - { - m_textEvtHandler = new wxComboBoxExtraInputHandler(this); - m_text->PushEventHandler(m_textEvtHandler); - } -} - -void -wxComboCtrlBase::CreateTextCtrl(int style, const wxValidator& validator) -{ - if ( !(m_windowStyle & wxCB_READONLY) ) - { - if ( m_text ) - m_text->Destroy(); - - // wxTE_PROCESS_TAB is needed because on Windows, wxTAB_TRAVERSAL is - // not used by the wxPropertyGrid and therefore the tab is processed by - // looking at ancestors to see if they have wxTAB_TRAVERSAL. The - // navigation event is then sent to the wrong window. - style |= wxTE_PROCESS_TAB; - - if ( HasFlag(wxTE_PROCESS_ENTER) ) - style |= wxTE_PROCESS_ENTER; - - // Ignore EVT_TEXT generated by the constructor (but only - // if the event redirector already exists) - // NB: This must be " = 1" instead of "++"; - if ( m_textEvtHandler ) - m_ignoreEvtText = 1; - else - m_ignoreEvtText = 0; - - m_text = new wxTextCtrl(this, wxID_ANY, m_valueString, - wxDefaultPosition, wxSize(10,-1), - style, validator); - } -} - -void wxComboCtrlBase::OnThemeChange() -{ - // Leave the default bg on the Mac so the area used by the focus ring will - // be the correct colour and themed brush. Instead we'll use - // wxSYS_COLOUR_WINDOW in the EVT_PAINT handler as needed. -#ifndef __WXMAC__ - if ( !m_hasBgCol ) - { -#ifdef __WXGTK__ - // Set background to gtk_rc_get_style(m_widget)->bg[GTK_STATE_NORMAL], - // which can be different than the background of text entry. - wxColour bgCol = GetDefaultAttributes().colBg; -#else - wxColour bgCol = wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW); -#endif - SetOwnBackgroundColour(bgCol); - m_hasBgCol = false; - } -#endif -} - -wxComboCtrlBase::~wxComboCtrlBase() -{ - if ( HasCapture() ) - ReleaseMouse(); - -#if INSTALL_TOPLEV_HANDLER - delete ((wxComboFrameEventHandler*)m_toplevEvtHandler); - m_toplevEvtHandler = (wxEvtHandler*) NULL; -#endif - - DestroyPopup(); - - if ( m_text ) - m_text->RemoveEventHandler(m_textEvtHandler); - - delete m_textEvtHandler; -} - - -// ---------------------------------------------------------------------------- -// geometry stuff -// ---------------------------------------------------------------------------- - -// Recalculates button and textctrl areas -void wxComboCtrlBase::CalculateAreas( int btnWidth ) -{ - wxSize sz = GetClientSize(); - int customBorder = m_widthCustomBorder; - int btnBorder; // border for button only - - // check if button should really be outside the border: we'll do it it if - // its platform default or bitmap+pushbutton background is used, but not if - // there is vertical size adjustment or horizontal spacing. - if ( ( (m_iFlags & wxCC_BUTTON_OUTSIDE_BORDER) || - (m_bmpNormal.Ok() && m_blankButtonBg) ) && - m_btnSpacingX == 0 && - m_btnHei <= 0 ) - { - m_iFlags |= wxCC_IFLAG_BUTTON_OUTSIDE; - btnBorder = 0; - } - else - { - m_iFlags &= ~(wxCC_IFLAG_BUTTON_OUTSIDE); - btnBorder = customBorder; - } - - // Defaul indentation - if ( m_absIndent < 0 ) - m_absIndent = GetNativeTextIndent(); - - int butWidth = btnWidth; - - if ( butWidth <= 0 ) - butWidth = m_btnWidDefault; - else - m_btnWidDefault = butWidth; - - if ( butWidth <= 0 ) - return; - - int butHeight = sz.y - btnBorder*2; - - // Adjust button width - if ( m_btnWid > 0 ) - butWidth = m_btnWid; - else - { - // Adjust button width to match aspect ratio - // (but only if control is smaller than best size). - int bestHeight = GetBestSize().y; - int height = GetSize().y; - - if ( height < bestHeight ) - { - // Make very small buttons square, as it makes - // them accommodate arrow image better and still - // looks decent. - if ( height > 18 ) - butWidth = (height*butWidth)/bestHeight; - else - butWidth = butHeight; - } - } - - // Adjust button height - if ( m_btnHei > 0 ) - butHeight = m_btnHei; - - // Use size of normal bitmap if... - // It is larger - // OR - // button width is set to default and blank button bg is not drawn - if ( m_bmpNormal.Ok() ) - { - int bmpReqWidth = m_bmpNormal.GetWidth(); - int bmpReqHeight = m_bmpNormal.GetHeight(); - - // If drawing blank button background, we need to add some margin. - if ( m_blankButtonBg ) - { - bmpReqWidth += BMP_BUTTON_MARGIN*2; - bmpReqHeight += BMP_BUTTON_MARGIN*2; - } - - if ( butWidth < bmpReqWidth || ( m_btnWid == 0 && !m_blankButtonBg ) ) - butWidth = bmpReqWidth; - if ( butHeight < bmpReqHeight || ( m_btnHei == 0 && !m_blankButtonBg ) ) - butHeight = bmpReqHeight; - - // Need to fix height? - if ( (sz.y-(customBorder*2)) < butHeight && btnWidth == 0 ) - { - int newY = butHeight+(customBorder*2); - SetClientSize(wxDefaultCoord,newY); - sz.y = newY; - } - } - - int butAreaWid = butWidth + (m_btnSpacingX*2); - - m_btnSize.x = butWidth; - m_btnSize.y = butHeight; - - m_btnArea.x = ( m_btnSide==wxRIGHT ? sz.x - butAreaWid - btnBorder : btnBorder ); - m_btnArea.y = btnBorder + FOCUS_RING; - m_btnArea.width = butAreaWid; - m_btnArea.height = sz.y - ((btnBorder+FOCUS_RING)*2); - - m_tcArea.x = ( m_btnSide==wxRIGHT ? 0 : butAreaWid ) + customBorder + FOCUS_RING; - m_tcArea.y = customBorder + FOCUS_RING; - m_tcArea.width = sz.x - butAreaWid - (customBorder*2) - (FOCUS_RING*2); - m_tcArea.height = sz.y - ((customBorder+FOCUS_RING)*2); - -/* - if ( m_text ) - { - ::wxMessageBox(wxString::Format(wxT("ButtonArea (%i,%i,%i,%i)\n"),m_btnArea.x,m_btnArea.y,m_btnArea.width,m_btnArea.height) + - wxString::Format(wxT("TextCtrlArea (%i,%i,%i,%i)"),m_tcArea.x,m_tcArea.y,m_tcArea.width,m_tcArea.height)); - } -*/ -} - -void wxComboCtrlBase::PositionTextCtrl( int textCtrlXAdjust, int textCtrlYAdjust ) -{ - if ( !m_text ) - return; - -#if !TEXTCTRL_TEXT_CENTERED - - wxSize sz = GetClientSize(); - - int customBorder = m_widthCustomBorder; - if ( (m_text->GetWindowStyleFlag() & wxBORDER_MASK) == wxNO_BORDER ) - { - // Centre textctrl - int tcSizeY = m_text->GetBestSize().y; - int diff = sz.y - tcSizeY; - int y = textCtrlYAdjust + (diff/2); - - if ( y < customBorder ) - y = customBorder; - - m_text->SetSize( m_tcArea.x + m_widthCustomPaint + m_absIndent + textCtrlXAdjust, - y, - m_tcArea.width - COMBO_MARGIN - - (textCtrlXAdjust + m_widthCustomPaint + m_absIndent), - -1 ); - - // Make sure textctrl doesn't exceed the bottom custom border - wxSize tsz = m_text->GetSize(); - diff = (y + tsz.y) - (sz.y - customBorder); - if ( diff >= 0 ) - { - tsz.y = tsz.y - diff - 1; - m_text->SetSize(tsz); - } - } - else -#else // TEXTCTRL_TEXT_CENTERED - wxUnusedVar(textCtrlXAdjust); - wxUnusedVar(textCtrlYAdjust); -#endif // !TEXTCTRL_TEXT_CENTERED/TEXTCTRL_TEXT_CENTERED - { - // If it has border, have textctrl will the entire text field. - m_text->SetSize( m_tcArea.x + m_widthCustomPaint, - m_tcArea.y, - m_tcArea.width - m_widthCustomPaint, - m_tcArea.height ); - } -} - -wxSize wxComboCtrlBase::DoGetBestSize() const -{ - wxSize sizeText(150,0); - - if ( m_text ) - sizeText = m_text->GetBestSize(); - - // TODO: Better method to calculate close-to-native control height. - - int fhei; - if ( m_font.Ok() ) - fhei = (m_font.GetPointSize()*2) + 5; - else if ( wxNORMAL_FONT->Ok() ) - fhei = (wxNORMAL_FONT->GetPointSize()*2) + 5; - else - fhei = sizeText.y + 4; - - // Need to force height to accomodate bitmap? - int btnSizeY = m_btnSize.y; - if ( m_bmpNormal.Ok() && fhei < btnSizeY ) - fhei = btnSizeY; - - // Control height doesn't depend on border -/* - // Add border - int border = m_windowStyle & wxBORDER_MASK; - if ( border == wxSIMPLE_BORDER ) - fhei += 2; - else if ( border == wxNO_BORDER ) - fhei += (m_widthCustomBorder*2); - else - // Sunken etc. - fhei += 4; -*/ - - // Final adjustments -#ifdef __WXGTK__ - fhei += 1; -#endif - -#ifdef __WXMAC__ - // these are the numbers from the HIG: - switch ( m_windowVariant ) - { - case wxWINDOW_VARIANT_NORMAL: - default : - fhei = 22; - break; - case wxWINDOW_VARIANT_SMALL: - fhei = 19; - break; - case wxWINDOW_VARIANT_MINI: - fhei = 15; - break; - } -#endif - - fhei += 2 * FOCUS_RING; - int width = sizeText.x + FOCUS_RING + COMBO_MARGIN + DEFAULT_DROPBUTTON_WIDTH; - - wxSize ret(width, fhei); - CacheBestSize(ret); - return ret; -} - -void wxComboCtrlBase::OnSizeEvent( wxSizeEvent& event ) -{ - if ( !IsCreated() ) - return; - - // defined by actual wxComboCtrls - OnResize(); - - event.Skip(); -} - -// ---------------------------------------------------------------------------- -// standard operations -// ---------------------------------------------------------------------------- - -bool wxComboCtrlBase::Enable(bool enable) -{ - if ( !wxControl::Enable(enable) ) - return false; - - if ( m_btn ) - m_btn->Enable(enable); - if ( m_text ) - m_text->Enable(enable); - - Refresh(); - - return true; -} - -bool wxComboCtrlBase::Show(bool show) -{ - if ( !wxControl::Show(show) ) - return false; - - if (m_btn) - m_btn->Show(show); - - if (m_text) - m_text->Show(show); - - return true; -} - -bool wxComboCtrlBase::SetFont ( const wxFont& font ) -{ - if ( !wxControl::SetFont(font) ) - return false; - - if (m_text) - m_text->SetFont(font); - - return true; -} - -#if wxUSE_TOOLTIPS -void wxComboCtrlBase::DoSetToolTip(wxToolTip *tooltip) -{ - wxControl::DoSetToolTip(tooltip); - - // Set tool tip for button and text box - if ( tooltip ) - { - const wxString &tip = tooltip->GetTip(); - if ( m_text ) m_text->SetToolTip(tip); - if ( m_btn ) m_btn->SetToolTip(tip); - } - else - { - if ( m_text ) m_text->SetToolTip( (wxToolTip*) NULL ); - if ( m_btn ) m_btn->SetToolTip( (wxToolTip*) NULL ); - } -} -#endif // wxUSE_TOOLTIPS - -#if wxUSE_VALIDATORS -void wxComboCtrlBase::SetValidator(const wxValidator& validator) -{ - wxTextCtrl* textCtrl = GetTextCtrl(); - - if ( textCtrl ) - textCtrl->SetValidator( validator ); - else - wxControl::SetValidator( validator ); -} - -wxValidator* wxComboCtrlBase::GetValidator() -{ - wxTextCtrl* textCtrl = GetTextCtrl(); - - return textCtrl ? textCtrl->GetValidator() : wxControl::GetValidator(); -} -#endif // wxUSE_VALIDATORS - -// ---------------------------------------------------------------------------- -// painting -// ---------------------------------------------------------------------------- - -#if (!defined(__WXMSW__)) || defined(__WXUNIVERSAL__) -// prepare combo box background on area in a way typical on platform -void wxComboCtrlBase::PrepareBackground( wxDC& dc, const wxRect& rect, int flags ) const -{ - wxSize sz = GetClientSize(); - bool isEnabled; - bool isFocused; // also selected - - // For smaller size control (and for disabled background) use less spacing - int focusSpacingX; - int focusSpacingY; - - if ( !(flags & wxCONTROL_ISSUBMENU) ) - { - // Drawing control - isEnabled = IsEnabled(); - isFocused = ShouldDrawFocus(); - - // Windows-style: for smaller size control (and for disabled background) use less spacing - focusSpacingX = isEnabled ? 2 : 1; - focusSpacingY = sz.y > (GetCharHeight()+2) && isEnabled ? 2 : 1; - } - else - { - // Drawing a list item - isEnabled = true; // they are never disabled - isFocused = flags & wxCONTROL_SELECTED ? true : false; - - focusSpacingX = 0; - focusSpacingY = 0; - } - - // Set the background sub-rectangle for selection, disabled etc - wxRect selRect(rect); - selRect.y += focusSpacingY; - selRect.height -= (focusSpacingY*2); - - int wcp = 0; - - if ( !(flags & wxCONTROL_ISSUBMENU) ) - wcp += m_widthCustomPaint; - - selRect.x += wcp + focusSpacingX; - selRect.width -= wcp + (focusSpacingX*2); - - wxColour fgCol; - wxColour bgCol; - - if ( isEnabled ) - { - if ( isFocused ) - fgCol = wxSystemSettings::GetColour(wxSYS_COLOUR_HIGHLIGHTTEXT); - else if ( m_hasFgCol ) - // Honour the custom foreground colour - fgCol = GetForegroundColour(); - else - fgCol = wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT); - } - else - { - fgCol = wxSystemSettings::GetColour(wxSYS_COLOUR_GRAYTEXT); - } - - if ( isEnabled ) - { - if ( isFocused ) - bgCol = wxSystemSettings::GetColour(wxSYS_COLOUR_HIGHLIGHT); - else if ( m_hasBgCol ) - // Honour the custom background colour - bgCol = GetBackgroundColour(); - else -#if defined(__WXMAC__) || defined(__WXGTK__) // see note in OnThemeChange - bgCol = wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW); -#else - bgCol = GetBackgroundColour(); -#endif - } - else - { -#if defined(__WXMAC__) || defined(__WXGTK__) // see note in OnThemeChange - bgCol = wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW); -#else - bgCol = GetBackgroundColour(); -#endif - } - - dc.SetTextForeground( fgCol ); - dc.SetBrush( bgCol ); - dc.SetPen( bgCol ); - dc.DrawRectangle( selRect ); - - // Don't clip exactly to the selection rectangle so we can draw - // to the non-selected area in front of it. - wxRect clipRect(rect.x,rect.y, - (selRect.x+selRect.width)-rect.x,rect.height); - dc.SetClippingRegion(clipRect); -} -#else -// Save the library size a bit for platforms that re-implement this. -void wxComboCtrlBase::PrepareBackground( wxDC&, const wxRect&, int ) const -{ -} -#endif - -void wxComboCtrlBase::DrawButton( wxDC& dc, const wxRect& rect, int flags ) -{ - int drawState = m_btnState; - -#ifdef __WXGTK__ - if ( GetPopupWindowState() >= Animating ) - drawState |= wxCONTROL_PRESSED; -#endif - - wxRect drawRect(rect.x+m_btnSpacingX, - rect.y+((rect.height-m_btnSize.y)/2), - m_btnSize.x, - m_btnSize.y); - - // Make sure area is not larger than the control - if ( drawRect.y < rect.y ) - drawRect.y = rect.y; - if ( drawRect.height > rect.height ) - drawRect.height = rect.height; - - bool enabled = IsEnabled(); - - if ( !enabled ) - drawState |= wxCONTROL_DISABLED; - - if ( !m_bmpNormal.Ok() ) - { - if ( flags & Draw_BitmapOnly ) - return; - - // Need to clear button background even if m_btn is present - if ( flags & Draw_PaintBg ) - { - wxColour bgCol; - - if ( m_iFlags & wxCC_IFLAG_BUTTON_OUTSIDE ) - bgCol = GetParent()->GetBackgroundColour(); - else - bgCol = GetBackgroundColour(); - - dc.SetBrush(bgCol); - dc.SetPen(bgCol); - dc.DrawRectangle(rect); - } - - // Draw standard button - wxRendererNative::Get().DrawComboBoxDropButton(this, - dc, - drawRect, - drawState); - } - else - { - // Draw bitmap - - wxBitmap* pBmp; - - if ( !enabled ) - pBmp = &m_bmpDisabled; - else if ( m_btnState & wxCONTROL_PRESSED ) - pBmp = &m_bmpPressed; - else if ( m_btnState & wxCONTROL_CURRENT ) - pBmp = &m_bmpHover; - else - pBmp = &m_bmpNormal; - - if ( m_blankButtonBg ) - { - // If using blank button background, we need to clear its background - // with button face colour instead of colour for rest of the control. - if ( flags & Draw_PaintBg ) - { - wxColour bgCol = GetParent()->GetBackgroundColour(); //wxSystemSettings::GetColour(wxSYS_COLOUR_BTNFACE); - //wxColour bgCol = wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW); - dc.SetPen(bgCol); - dc.SetBrush(bgCol); - dc.DrawRectangle(rect); - } - - wxRendererNative::Get().DrawPushButton(this, - dc, - drawRect, - drawState); - - } - else - - { - // Need to clear button background even if m_btn is present - // (assume non-button background was cleared just before this call so brushes are good) - if ( flags & Draw_PaintBg ) - dc.DrawRectangle(rect); - } - - // Draw bitmap centered in drawRect - dc.DrawBitmap(*pBmp, - drawRect.x + (drawRect.width-pBmp->GetWidth())/2, - drawRect.y + (drawRect.height-pBmp->GetHeight())/2, - true); - } -} - -void wxComboCtrlBase::RecalcAndRefresh() -{ - if ( IsCreated() ) - { - wxSizeEvent evt(GetSize(),GetId()); - GetEventHandler()->ProcessEvent(evt); - Refresh(); - } -} - -// ---------------------------------------------------------------------------- -// miscellaneous event handlers -// ---------------------------------------------------------------------------- - -void wxComboCtrlBase::OnTextCtrlEvent(wxCommandEvent& event) -{ - if ( event.GetEventType() == wxEVT_COMMAND_TEXT_UPDATED ) - { - if ( m_ignoreEvtText > 0 ) - { - m_ignoreEvtText--; - return; - } - } - - // Change event id, object and string before relaying it forward - event.SetId(GetId()); - wxString s = event.GetString(); - event.SetEventObject(this); - event.SetString(s); - event.Skip(); -} - -// call if cursor is on button area or mouse is captured for the button -bool wxComboCtrlBase::HandleButtonMouseEvent( wxMouseEvent& event, - int flags ) -{ - int type = event.GetEventType(); - - if ( type == wxEVT_MOTION ) - { - if ( flags & wxCC_MF_ON_BUTTON ) - { - if ( !(m_btnState & wxCONTROL_CURRENT) ) - { - // Mouse hover begins - m_btnState |= wxCONTROL_CURRENT; - if ( HasCapture() ) // Retain pressed state. - m_btnState |= wxCONTROL_PRESSED; - Refresh(); - } - } - else if ( (m_btnState & wxCONTROL_CURRENT) ) - { - // Mouse hover ends - m_btnState &= ~(wxCONTROL_CURRENT|wxCONTROL_PRESSED); - Refresh(); - } - } - else if ( type == wxEVT_LEFT_DOWN || type == wxEVT_LEFT_DCLICK ) - { - if ( flags & (wxCC_MF_ON_CLICK_AREA|wxCC_MF_ON_BUTTON) ) - { - m_btnState |= wxCONTROL_PRESSED; - Refresh(); - - if ( !(m_iFlags & wxCC_POPUP_ON_MOUSE_UP) ) - OnButtonClick(); - else - // If showing popup now, do not capture mouse or there will be interference - CaptureMouse(); - } - } - else if ( type == wxEVT_LEFT_UP ) - { - - // Only accept event if mouse was left-press was previously accepted - if ( HasCapture() ) - ReleaseMouse(); - - if ( m_btnState & wxCONTROL_PRESSED ) - { - // If mouse was inside, fire the click event. - if ( m_iFlags & wxCC_POPUP_ON_MOUSE_UP ) - { - if ( flags & (wxCC_MF_ON_CLICK_AREA|wxCC_MF_ON_BUTTON) ) - OnButtonClick(); - } - - m_btnState &= ~(wxCONTROL_PRESSED); - Refresh(); - } - } - else if ( type == wxEVT_LEAVE_WINDOW ) - { - if ( m_btnState & (wxCONTROL_CURRENT|wxCONTROL_PRESSED) ) - { - m_btnState &= ~(wxCONTROL_CURRENT); - - // Mouse hover ends - if ( IsPopupWindowState(Hidden) ) - { - m_btnState &= ~(wxCONTROL_PRESSED); - Refresh(); - } - } - } - else - return false; - - return true; -} - -// returns true if event was consumed or filtered -bool wxComboCtrlBase::PreprocessMouseEvent( wxMouseEvent& event, - int WXUNUSED(flags) ) -{ - wxLongLong t = ::wxGetLocalTimeMillis(); - int evtType = event.GetEventType(); - -#if USES_WXPOPUPWINDOW || USES_WXDIALOG - if ( m_popupWinType != POPUPWIN_WXPOPUPTRANSIENTWINDOW ) - { - if ( IsPopupWindowState(Visible) && - ( evtType == wxEVT_LEFT_DOWN || evtType == wxEVT_RIGHT_DOWN ) ) - { - HidePopup(); - return true; - } - } -#endif - - // Filter out clicks on button immediately after popup dismiss (Windows like behaviour) - if ( evtType == wxEVT_LEFT_DOWN && t < m_timeCanAcceptClick ) - { - event.SetEventType(0); - return true; - } - - return false; -} - -void wxComboCtrlBase::HandleNormalMouseEvent( wxMouseEvent& event ) -{ - int evtType = event.GetEventType(); - - if ( (evtType == wxEVT_LEFT_DOWN || evtType == wxEVT_LEFT_DCLICK) && - (m_windowStyle & wxCB_READONLY) ) - { - if ( GetPopupWindowState() >= Animating ) - { - #if USES_WXPOPUPWINDOW - // Click here always hides the popup. - if ( m_popupWinType == POPUPWIN_WXPOPUPWINDOW ) - HidePopup(); - #endif - } - else - { - if ( !(m_windowStyle & wxCC_SPECIAL_DCLICK) ) - { - // In read-only mode, clicking the text is the - // same as clicking the button. - OnButtonClick(); - } - else if ( /*evtType == wxEVT_LEFT_UP || */evtType == wxEVT_LEFT_DCLICK ) - { - //if ( m_popupInterface->CycleValue() ) - // Refresh(); - if ( m_popupInterface ) - m_popupInterface->OnComboDoubleClick(); - } - } - } - else - if ( IsPopupShown() ) - { - // relay (some) mouse events to the popup - if ( evtType == wxEVT_MOUSEWHEEL ) - m_popup->AddPendingEvent(event); - } - else if ( evtType ) - event.Skip(); -} - -void wxComboCtrlBase::OnKeyEvent(wxKeyEvent& event) -{ - if ( IsPopupShown() ) - { - // pass it to the popped up control - GetPopupControl()->GetControl()->AddPendingEvent(event); - } - else // no popup - { - int keycode = event.GetKeyCode(); - - wxWindow* mainCtrl = GetMainWindowOfCompositeControl(); - - if ( mainCtrl->GetParent()->HasFlag(wxTAB_TRAVERSAL) && - keycode == WXK_TAB ) - { - wxNavigationKeyEvent evt; - - evt.SetFlags(wxNavigationKeyEvent::FromTab| - (!event.ShiftDown() ? wxNavigationKeyEvent::IsForward - : wxNavigationKeyEvent::IsBackward)); - evt.SetEventObject(mainCtrl); - evt.SetCurrentFocus(mainCtrl); - mainCtrl->GetParent()->GetEventHandler()->AddPendingEvent(evt); - return; - } - - if ( IsKeyPopupToggle(event) ) - { - OnButtonClick(); - return; - } - - int comboStyle = GetWindowStyle(); - wxComboPopup* popupInterface = GetPopupControl(); - - if ( !popupInterface ) - { - event.Skip(); - return; - } - - if ( (comboStyle & wxCB_READONLY) || - (keycode != WXK_RIGHT && keycode != WXK_LEFT) ) - { - popupInterface->OnComboKeyEvent(event); - } - else - event.Skip(); - } -} - -void wxComboCtrlBase::OnFocusEvent( wxFocusEvent& event ) -{ - if ( event.GetEventType() == wxEVT_SET_FOCUS ) - { - wxWindow* tc = GetTextCtrl(); - if ( tc && tc != DoFindFocus() ) -#ifdef __WXMAC__ - m_resetFocus = true; -#else - tc->SetFocus(); -#endif - } - - Refresh(); -} - -void wxComboCtrlBase::OnIdleEvent( wxIdleEvent& WXUNUSED(event) ) -{ - if ( m_resetFocus ) - { - m_resetFocus = false; - wxWindow* tc = GetTextCtrl(); - if ( tc ) - tc->SetFocus(); - } -} - -void wxComboCtrlBase::OnSysColourChanged(wxSysColourChangedEvent& WXUNUSED(event)) -{ - OnThemeChange(); - // indentation may also have changed - if ( !(m_iFlags & wxCC_IFLAG_INDENT_SET) ) - m_absIndent = GetNativeTextIndent(); - RecalcAndRefresh(); -} - -// ---------------------------------------------------------------------------- -// popup handling -// ---------------------------------------------------------------------------- - -// Create popup window and the child control -void wxComboCtrlBase::CreatePopup() -{ - wxComboPopup* popupInterface = m_popupInterface; - wxWindow* popup; - - if ( !m_winPopup ) - { -#ifdef wxComboPopupWindowBase2 - if ( m_iFlags & wxCC_IFLAG_USE_ALT_POPUP ) - { - #if !USES_WXDIALOG - m_winPopup = new wxComboPopupWindowBase2( this, wxNO_BORDER ); - #else - m_winPopup = new wxComboPopupWindowBase2( this, wxID_ANY, wxEmptyString, - wxPoint(-21,-21), wxSize(20, 20), - wxNO_BORDER ); - #endif - m_popupWinType = SECONDARY_POPUP_TYPE; - } - else -#endif - { - m_winPopup = new wxComboPopupWindow( this, wxNO_BORDER ); - m_popupWinType = PRIMARY_POPUP_TYPE; - } - m_popupWinEvtHandler = new wxComboPopupWindowEvtHandler(this); - m_winPopup->PushEventHandler(m_popupWinEvtHandler); - } - - popupInterface->Create(m_winPopup); - m_popup = popup = popupInterface->GetControl(); - - m_popupExtraHandler = new wxComboPopupExtraEventHandler(this); - popup->PushEventHandler( m_popupExtraHandler ); - - // This may be helpful on some platforms - // (eg. it bypasses a wxGTK popupwindow bug where - // window is not initially hidden when it should be) - m_winPopup->Hide(); - - popupInterface->m_iFlags |= wxCP_IFLAG_CREATED; -} - -// Destroy popup window and the child control -void wxComboCtrlBase::DestroyPopup() -{ - HidePopup(); - - if ( m_popup ) - m_popup->RemoveEventHandler(m_popupExtraHandler); - - delete m_popupExtraHandler; - - delete m_popupInterface; - - if ( m_winPopup ) - { - m_winPopup->RemoveEventHandler(m_popupWinEvtHandler); - delete m_popupWinEvtHandler; - m_popupWinEvtHandler = NULL; - m_winPopup->Destroy(); - } - - m_popupExtraHandler = (wxEvtHandler*) NULL; - m_popupInterface = (wxComboPopup*) NULL; - m_winPopup = (wxWindow*) NULL; - m_popup = (wxWindow*) NULL; -} - -void wxComboCtrlBase::DoSetPopupControl(wxComboPopup* iface) -{ - wxCHECK_RET( iface, wxT("no popup interface set for wxComboCtrl") ); - - DestroyPopup(); - - iface->InitBase(this); - iface->Init(); - - m_popupInterface = iface; - - if ( !iface->LazyCreate() ) - { - CreatePopup(); - } - else - { - m_popup = (wxWindow*) NULL; - } - - // This must be done after creation - if ( m_valueString.length() ) - { - iface->SetStringValue(m_valueString); - //Refresh(); - } -} - -// Ensures there is atleast the default popup -void wxComboCtrlBase::EnsurePopupControl() -{ - if ( !m_popupInterface ) - SetPopupControl(NULL); -} - -void wxComboCtrlBase::OnButtonClick() -{ - // Derived classes can override this method for totally custom - // popup action - if ( !IsPopupWindowState(Visible) ) - ShowPopup(); - else - HidePopup(); -} - -void wxComboCtrlBase::ShowPopup() -{ - EnsurePopupControl(); - wxCHECK_RET( !IsPopupWindowState(Visible), wxT("popup window already shown") ); - - if ( IsPopupWindowState(Animating) ) - return; - - SetFocus(); - - // Space above and below - int screenHeight; - wxPoint scrPos; - int spaceAbove; - int spaceBelow; - int maxHeightPopup; - wxSize ctrlSz = GetSize(); - - screenHeight = wxSystemSettings::GetMetric( wxSYS_SCREEN_Y ); - scrPos = GetParent()->ClientToScreen(GetPosition()); - - spaceAbove = scrPos.y; - spaceBelow = screenHeight - spaceAbove - ctrlSz.y; - - maxHeightPopup = spaceBelow; - if ( spaceAbove > spaceBelow ) - maxHeightPopup = spaceAbove; - - // Width - int widthPopup = ctrlSz.x + m_extLeft + m_extRight; - - if ( widthPopup < m_widthMinPopup ) - widthPopup = m_widthMinPopup; - - wxWindow* winPopup = m_winPopup; - wxWindow* popup; - - // Need to disable tab traversal of parent - // - // NB: This is to fix a bug in wxMSW. In theory it could also be fixed - // by, for instance, adding check to window.cpp:wxWindowMSW::MSWProcessMessage - // that if transient popup is open, then tab traversal is to be ignored. - // However, I think this code would still be needed for cases where - // transient popup doesn't work yet (wxWinCE?). - wxWindow* parent = GetParent(); - int parentFlags = parent->GetWindowStyle(); - if ( parentFlags & wxTAB_TRAVERSAL ) - { - parent->SetWindowStyle( parentFlags & ~(wxTAB_TRAVERSAL) ); - m_iFlags |= wxCC_IFLAG_PARENT_TAB_TRAVERSAL; - } - - if ( !winPopup ) - { - CreatePopup(); - winPopup = m_winPopup; - popup = m_popup; - } - else - { - popup = m_popup; - } - - winPopup->Enable(); - - wxASSERT( !m_popup || m_popup == popup ); // Consistency check. - - wxSize adjustedSize = m_popupInterface->GetAdjustedSize(widthPopup, - m_heightPopup<=0?DEFAULT_POPUP_HEIGHT:m_heightPopup, - maxHeightPopup); - - popup->SetSize(adjustedSize); - popup->Move(0,0); - m_popupInterface->OnPopup(); - - // - // Reposition and resize popup window - // - - wxSize szp = popup->GetSize(); - - int popupX; - int popupY = scrPos.y + ctrlSz.y; - - // Default anchor is wxLEFT - int anchorSide = m_anchorSide; - if ( !anchorSide ) - anchorSide = wxLEFT; - - int rightX = scrPos.x + ctrlSz.x + m_extRight - szp.x; - int leftX = scrPos.x - m_extLeft; - - if ( wxTheApp->GetLayoutDirection() == wxLayout_RightToLeft ) - leftX -= ctrlSz.x; - - int screenWidth = wxSystemSettings::GetMetric( wxSYS_SCREEN_X ); - - // If there is not enough horizontal space, anchor on the other side. - // If there is no space even then, place the popup at x 0. - if ( anchorSide == wxRIGHT ) - { - if ( rightX < 0 ) - { - if ( (leftX+szp.x) < screenWidth ) - anchorSide = wxLEFT; - else - anchorSide = 0; - } - } - else - { - if ( (leftX+szp.x) >= screenWidth ) - { - if ( rightX >= 0 ) - anchorSide = wxRIGHT; - else - anchorSide = 0; - } - } - - // Select x coordinate according to the anchor side - if ( anchorSide == wxRIGHT ) - popupX = rightX; - else if ( anchorSide == wxLEFT ) - popupX = leftX; - else - popupX = 0; - - int showFlags = CanDeferShow; - - if ( spaceBelow < szp.y ) - { - popupY = scrPos.y - szp.y; - showFlags |= ShowAbove; - } - -#if INSTALL_TOPLEV_HANDLER - // Put top level window event handler into place - if ( m_popupWinType == POPUPWIN_WXPOPUPWINDOW ) - { - if ( !m_toplevEvtHandler ) - m_toplevEvtHandler = new wxComboFrameEventHandler(this); - - wxWindow* toplev = ::wxGetTopLevelParent( this ); - wxASSERT( toplev ); - ((wxComboFrameEventHandler*)m_toplevEvtHandler)->OnPopup(); - toplev->PushEventHandler( m_toplevEvtHandler ); - } -#endif - - // Set string selection (must be this way instead of SetStringSelection) - if ( m_text ) - { - if ( !(m_iFlags & wxCC_NO_TEXT_AUTO_SELECT) ) - m_text->SelectAll(); - - m_popupInterface->SetStringValue( m_text->GetValue() ); - } - else - { - // This is neede since focus/selection indication may change when popup is shown - Refresh(); - } - - // This must be after SetStringValue - m_popupWinState = Animating; - - wxRect popupWinRect( popupX, popupY, szp.x, szp.y ); - - m_popup = popup; - if ( (m_iFlags & wxCC_IFLAG_DISABLE_POPUP_ANIM) || - AnimateShow( popupWinRect, showFlags ) ) - { - DoShowPopup( popupWinRect, showFlags ); - } -} - -bool wxComboCtrlBase::AnimateShow( const wxRect& WXUNUSED(rect), int WXUNUSED(flags) ) -{ - return true; -} - -void wxComboCtrlBase::DoShowPopup( const wxRect& rect, int WXUNUSED(flags) ) -{ - wxWindow* winPopup = m_winPopup; - - if ( IsPopupWindowState(Animating) ) - { - // Make sure the popup window is shown in the right position. - // Should not matter even if animation already did this. - - // Some platforms (GTK) may like SetSize and Move to be separate - // (though the bug was probably fixed). - winPopup->SetSize( rect ); - - winPopup->Show(); - - m_popupWinState = Visible; - } - else if ( IsPopupWindowState(Hidden) ) - { - // Animation was aborted - - wxASSERT( !winPopup->IsShown() ); - - m_popupWinState = Hidden; - } -} - -void wxComboCtrlBase::OnPopupDismiss() -{ - // Just in case, avoid double dismiss - if ( IsPopupWindowState(Hidden) ) - return; - - // This must be set before focus - otherwise there will be recursive - // OnPopupDismisses. - m_popupWinState = Hidden; - - //SetFocus(); - m_winPopup->Disable(); - - // Inform popup control itself - m_popupInterface->OnDismiss(); - - if ( m_popupExtraHandler ) - ((wxComboPopupExtraEventHandler*)m_popupExtraHandler)->OnPopupDismiss(); - -#if INSTALL_TOPLEV_HANDLER - // Remove top level window event handler - if ( m_toplevEvtHandler ) - { - wxWindow* toplev = ::wxGetTopLevelParent( this ); - if ( toplev ) - toplev->RemoveEventHandler( m_toplevEvtHandler ); - } -#endif - - m_timeCanAcceptClick = ::wxGetLocalTimeMillis(); - - if ( m_popupWinType == POPUPWIN_WXPOPUPTRANSIENTWINDOW ) - m_timeCanAcceptClick += 150; - - // If cursor not on dropdown button, then clear its state - // (technically not required by all ports, but do it for all just in case) - if ( !m_btnArea.Contains(ScreenToClient(::wxGetMousePosition())) ) - m_btnState = 0; - - // Return parent's tab traversal flag. - // See ShowPopup for notes. - if ( m_iFlags & wxCC_IFLAG_PARENT_TAB_TRAVERSAL ) - { - wxWindow* parent = GetParent(); - parent->SetWindowStyle( parent->GetWindowStyle() | wxTAB_TRAVERSAL ); - m_iFlags &= ~(wxCC_IFLAG_PARENT_TAB_TRAVERSAL); - } - - // refresh control (necessary even if m_text) - Refresh(); - - SetFocus(); -} - -void wxComboCtrlBase::HidePopup() -{ - // Should be able to call this without popup interface - if ( IsPopupWindowState(Hidden) ) - return; - - // transfer value and show it in textctrl, if any - if ( !IsPopupWindowState(Animating) ) - SetValue( m_popupInterface->GetStringValue() ); - - m_winPopup->Hide(); - - OnPopupDismiss(); -} - -// ---------------------------------------------------------------------------- -// customization methods -// ---------------------------------------------------------------------------- - -void wxComboCtrlBase::SetButtonPosition( int width, int height, - int side, int spacingX ) -{ - m_btnWid = width; - m_btnHei = height; - m_btnSide = side; - m_btnSpacingX = spacingX; - - if ( width > 0 || height > 0 || spacingX ) - m_iFlags |= wxCC_IFLAG_HAS_NONSTANDARD_BUTTON; - - RecalcAndRefresh(); -} - -wxSize wxComboCtrlBase::GetButtonSize() -{ - if ( m_btnSize.x > 0 ) - return m_btnSize; - - wxSize retSize(m_btnWid,m_btnHei); - - // Need to call CalculateAreas now if button size is - // is not explicitly specified. - if ( retSize.x <= 0 || retSize.y <= 0) - { - OnResize(); - - retSize = m_btnSize; - } - - return retSize; -} - -void wxComboCtrlBase::SetButtonBitmaps( const wxBitmap& bmpNormal, - bool blankButtonBg, - const wxBitmap& bmpPressed, - const wxBitmap& bmpHover, - const wxBitmap& bmpDisabled ) -{ - m_bmpNormal = bmpNormal; - m_blankButtonBg = blankButtonBg; - - if ( bmpPressed.Ok() ) - m_bmpPressed = bmpPressed; - else - m_bmpPressed = bmpNormal; - - if ( bmpHover.Ok() ) - m_bmpHover = bmpHover; - else - m_bmpHover = bmpNormal; - - if ( bmpDisabled.Ok() ) - m_bmpDisabled = bmpDisabled; - else - m_bmpDisabled = bmpNormal; - - RecalcAndRefresh(); -} - -void wxComboCtrlBase::SetCustomPaintWidth( int width ) -{ - if ( m_text ) - { - // move textctrl accordingly - wxRect r = m_text->GetRect(); - int inc = width - m_widthCustomPaint; - r.x += inc; - r.width -= inc; - m_text->SetSize( r ); - } - - m_widthCustomPaint = width; - - RecalcAndRefresh(); -} - -void wxComboCtrlBase::SetTextIndent( int indent ) -{ - if ( indent < 0 ) - { - m_absIndent = GetNativeTextIndent(); - m_iFlags &= ~(wxCC_IFLAG_INDENT_SET); - } - else - { - m_absIndent = indent; - m_iFlags |= wxCC_IFLAG_INDENT_SET; - } - - RecalcAndRefresh(); -} - -wxCoord wxComboCtrlBase::GetNativeTextIndent() const -{ - return DEFAULT_TEXT_INDENT; -} - -// ---------------------------------------------------------------------------- -// methods forwarded to wxTextCtrl -// ---------------------------------------------------------------------------- - -wxString wxComboCtrlBase::GetValue() const -{ - if ( m_text ) - return m_text->GetValue(); - return m_valueString; -} - -void wxComboCtrlBase::SetValueWithEvent(const wxString& value, bool withEvent) -{ - if ( m_text ) - { - if ( !withEvent ) - m_ignoreEvtText++; - - m_text->SetValue(value); - if ( !(m_iFlags & wxCC_NO_TEXT_AUTO_SELECT) ) - m_text->SelectAll(); - } - - // Since wxComboPopup may want to paint the combo as well, we need - // to set the string value here (as well as sometimes in ShowPopup). - if ( m_valueString != value ) - { - m_valueString = value; - - EnsurePopupControl(); - - if (m_popupInterface) - m_popupInterface->SetStringValue(value); - } - - Refresh(); -} - -void wxComboCtrlBase::SetValue(const wxString& value) -{ - SetValueWithEvent(value, false); -} - -// In this SetValue variant wxComboPopup::SetStringValue is not called -void wxComboCtrlBase::SetText(const wxString& value) -{ - // Unlike in SetValue(), this must be called here or - // the behaviour will no be consistent in readonlys. - EnsurePopupControl(); - - m_valueString = value; - - if ( m_text ) - { - m_ignoreEvtText++; - m_text->SetValue( value ); - } - - Refresh(); -} - -void wxComboCtrlBase::Copy() -{ - if ( m_text ) - m_text->Copy(); -} - -void wxComboCtrlBase::Cut() -{ - if ( m_text ) - m_text->Cut(); -} - -void wxComboCtrlBase::Paste() -{ - if ( m_text ) - m_text->Paste(); -} - -void wxComboCtrlBase::SetInsertionPoint(long pos) -{ - if ( m_text ) - m_text->SetInsertionPoint(pos); -} - -void wxComboCtrlBase::SetInsertionPointEnd() -{ - if ( m_text ) - m_text->SetInsertionPointEnd(); -} - -long wxComboCtrlBase::GetInsertionPoint() const -{ - if ( m_text ) - return m_text->GetInsertionPoint(); - - return 0; -} - -long wxComboCtrlBase::GetLastPosition() const -{ - if ( m_text ) - return m_text->GetLastPosition(); - - return 0; -} - -void wxComboCtrlBase::Replace(long from, long to, const wxString& value) -{ - if ( m_text ) - m_text->Replace(from, to, value); -} - -void wxComboCtrlBase::Remove(long from, long to) -{ - if ( m_text ) - m_text->Remove(from, to); -} - -void wxComboCtrlBase::SetSelection(long from, long to) -{ - if ( m_text ) - m_text->SetSelection(from, to); -} - -void wxComboCtrlBase::Undo() -{ - if ( m_text ) - m_text->Undo(); -} - -#endif // wxUSE_COMBOCTRL diff --git a/wxWidgets/src/common/config.cpp b/wxWidgets/src/common/config.cpp deleted file mode 100644 index ce169563f7..0000000000 --- a/wxWidgets/src/common/config.cpp +++ /dev/null @@ -1,490 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: src/common/config.cpp -// Purpose: implementation of wxConfigBase class -// Author: Vadim Zeitlin -// Modified by: -// Created: 07.04.98 -// RCS-ID: $Id: config.cpp 50711 2007-12-15 02:57:58Z VZ $ -// Copyright: (c) 1997 Karsten Ballueder Ballueder@usa.net -// Vadim Zeitlin -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif //__BORLANDC__ - -#ifndef wxUSE_CONFIG_NATIVE - #define wxUSE_CONFIG_NATIVE 1 -#endif - -#include "wx/config.h" - -#ifndef WX_PRECOMP - #include "wx/intl.h" - #include "wx/log.h" - #include "wx/app.h" - #include "wx/utils.h" - #include "wx/arrstr.h" - #include "wx/math.h" -#endif //WX_PRECOMP - -#if wxUSE_CONFIG && ((wxUSE_FILE && wxUSE_TEXTFILE) || wxUSE_CONFIG_NATIVE) - -#include "wx/file.h" - -#include -#include -#include // for INT_MAX - -// ---------------------------------------------------------------------------- -// global and class static variables -// ---------------------------------------------------------------------------- - -wxConfigBase *wxConfigBase::ms_pConfig = NULL; -bool wxConfigBase::ms_bAutoCreate = true; - -// ============================================================================ -// implementation -// ============================================================================ - -// ---------------------------------------------------------------------------- -// wxConfigBase -// ---------------------------------------------------------------------------- - -// Not all args will always be used by derived classes, but including them all -// in each class ensures compatibility. -wxConfigBase::wxConfigBase(const wxString& appName, - const wxString& vendorName, - const wxString& WXUNUSED(localFilename), - const wxString& WXUNUSED(globalFilename), - long style) - : m_appName(appName), m_vendorName(vendorName), m_style(style) -{ - m_bExpandEnvVars = true; - m_bRecordDefaults = false; -} - -wxConfigBase::~wxConfigBase() -{ - // required here for Darwin -} - -wxConfigBase *wxConfigBase::Set(wxConfigBase *pConfig) -{ - wxConfigBase *pOld = ms_pConfig; - ms_pConfig = pConfig; - return pOld; -} - -wxConfigBase *wxConfigBase::Create() -{ - if ( ms_bAutoCreate && ms_pConfig == NULL ) { - ms_pConfig = - #if defined(__WXMSW__) && wxUSE_CONFIG_NATIVE - new wxRegConfig(wxTheApp->GetAppName(), wxTheApp->GetVendorName()); - #elif defined(__WXPALMOS__) && wxUSE_CONFIG_NATIVE - new wxPrefConfig(wxTheApp->GetAppName()); - #else // either we're under Unix or wish to use files even under Windows - new wxFileConfig(wxTheApp->GetAppName()); - #endif - } - - return ms_pConfig; -} - -// ---------------------------------------------------------------------------- -// wxConfigBase reading entries -// ---------------------------------------------------------------------------- - -// implement both Read() overloads for the given type in terms of DoRead() -#define IMPLEMENT_READ_FOR_TYPE(name, type, deftype, extra) \ - bool wxConfigBase::Read(const wxString& key, type *val) const \ - { \ - wxCHECK_MSG( val, false, _T("wxConfig::Read(): NULL parameter") ); \ - \ - if ( !DoRead##name(key, val) ) \ - return false; \ - \ - *val = extra(*val); \ - \ - return true; \ - } \ - \ - bool wxConfigBase::Read(const wxString& key, \ - type *val, \ - deftype defVal) const \ - { \ - wxCHECK_MSG( val, false, _T("wxConfig::Read(): NULL parameter") ); \ - \ - bool read = DoRead##name(key, val); \ - if ( !read ) \ - { \ - if ( IsRecordingDefaults() ) \ - { \ - ((wxConfigBase *)this)->DoWrite##name(key, defVal); \ - } \ - \ - *val = defVal; \ - } \ - \ - *val = extra(*val); \ - \ - return read; \ - } - - -IMPLEMENT_READ_FOR_TYPE(String, wxString, const wxString&, ExpandEnvVars) -IMPLEMENT_READ_FOR_TYPE(Long, long, long, long) -IMPLEMENT_READ_FOR_TYPE(Int, int, int, int) -IMPLEMENT_READ_FOR_TYPE(Double, double, double, double) -IMPLEMENT_READ_FOR_TYPE(Bool, bool, bool, bool) - -#undef IMPLEMENT_READ_FOR_TYPE - -// the DoReadXXX() for the other types have implementation in the base class -// but can be overridden in the derived ones -bool wxConfigBase::DoReadInt(const wxString& key, int *pi) const -{ - wxCHECK_MSG( pi, false, _T("wxConfig::Read(): NULL parameter") ); - - long l; - if ( !DoReadLong(key, &l) ) - return false; - - wxASSERT_MSG( l < INT_MAX, _T("overflow in wxConfig::DoReadInt") ); - - *pi = (int)l; - - return true; -} - -bool wxConfigBase::DoReadBool(const wxString& key, bool* val) const -{ - wxCHECK_MSG( val, false, _T("wxConfig::Read(): NULL parameter") ); - - long l; - if ( !DoReadLong(key, &l) ) - return false; - - wxASSERT_MSG( l == 0 || l == 1, _T("bad bool value in wxConfig::DoReadInt") ); - - *val = l != 0; - - return true; -} - -bool wxConfigBase::DoReadDouble(const wxString& key, double* val) const -{ - wxString str; - if ( Read(key, &str) ) - { - return str.ToDouble(val); - } - - return false; -} - -// string reading helper -wxString wxConfigBase::ExpandEnvVars(const wxString& str) const -{ - wxString tmp; // Required for BC++ - if (IsExpandingEnvVars()) - tmp = wxExpandEnvVars(str); - else - tmp = str; - return tmp; -} - -// ---------------------------------------------------------------------------- -// wxConfigBase writing -// ---------------------------------------------------------------------------- - -bool wxConfigBase::DoWriteDouble(const wxString& key, double val) -{ - return DoWriteString(key, wxString::Format(_T("%g"), val)); -} - -bool wxConfigBase::DoWriteInt(const wxString& key, int value) -{ - return DoWriteLong(key, (long)value); -} - -bool wxConfigBase::DoWriteBool(const wxString& key, bool value) -{ - return DoWriteLong(key, value ? 1l : 0l); -} - -// ---------------------------------------------------------------------------- -// wxConfigPathChanger -// ---------------------------------------------------------------------------- - -wxConfigPathChanger::wxConfigPathChanger(const wxConfigBase *pContainer, - const wxString& strEntry) -{ - m_bChanged = false; - m_pContainer = (wxConfigBase *)pContainer; - - // the path is everything which precedes the last slash - wxString strPath = strEntry.BeforeLast(wxCONFIG_PATH_SEPARATOR); - - // except in the special case of "/keyname" when there is nothing before "/" - if ( strPath.empty() && - ((!strEntry.empty()) && strEntry[0] == wxCONFIG_PATH_SEPARATOR) ) - { - strPath = wxCONFIG_PATH_SEPARATOR; - } - - if ( !strPath.empty() ) - { - if ( m_pContainer->GetPath() != strPath ) - { - // we do change the path so restore it later - m_bChanged = true; - - /* JACS: work around a memory bug that causes an assert - when using wxRegConfig, related to reference-counting. - Can be reproduced by removing (const wxChar*) below and - adding the following code to the config sample OnInit under - Windows: - - pConfig->SetPath(wxT("MySettings")); - pConfig->SetPath(wxT("..")); - int value; - pConfig->Read(_T("MainWindowX"), & value); - */ - m_strOldPath = (const wxChar*) m_pContainer->GetPath(); - if ( *m_strOldPath.c_str() != wxCONFIG_PATH_SEPARATOR ) - m_strOldPath += wxCONFIG_PATH_SEPARATOR; - m_pContainer->SetPath(strPath); - } - - // in any case, use the just the name, not full path - m_strName = strEntry.AfterLast(wxCONFIG_PATH_SEPARATOR); - } - else { - // it's a name only, without path - nothing to do - m_strName = strEntry; - } -} - -void wxConfigPathChanger::UpdateIfDeleted() -{ - // we don't have to do anything at all if we didn't change the path - if ( !m_bChanged ) - return; - - // find the deepest still existing parent path of the original path - while ( !m_pContainer->HasGroup(m_strOldPath) ) - { - m_strOldPath = m_strOldPath.BeforeLast(wxCONFIG_PATH_SEPARATOR); - if ( m_strOldPath.empty() ) - m_strOldPath = wxCONFIG_PATH_SEPARATOR; - } -} - -wxConfigPathChanger::~wxConfigPathChanger() -{ - // only restore path if it was changed - if ( m_bChanged ) { - m_pContainer->SetPath(m_strOldPath); - } -} - -// this is a wxConfig method but it's mainly used with wxConfigPathChanger -/* static */ -wxString wxConfigBase::RemoveTrailingSeparator(const wxString& key) -{ - wxString path(key); - - // don't remove the only separator from a root group path! - while ( path.length() > 1 ) - { - if ( *path.rbegin() != wxCONFIG_PATH_SEPARATOR ) - break; - - path.erase(path.end() - 1); - } - - return path; -} - -#endif // wxUSE_CONFIG - -// ---------------------------------------------------------------------------- -// static & global functions -// ---------------------------------------------------------------------------- - -// understands both Unix and Windows (but only under Windows) environment -// variables expansion: i.e. $var, $(var) and ${var} are always understood -// and in addition under Windows %var% is also. - -// don't change the values the enum elements: they must be equal -// to the matching [closing] delimiter. -enum Bracket -{ - Bracket_None, - Bracket_Normal = ')', - Bracket_Curly = '}', -#ifdef __WXMSW__ - Bracket_Windows = '%', // yeah, Windows people are a bit strange ;-) -#endif - Bracket_Max -}; - -wxString wxExpandEnvVars(const wxString& str) -{ - wxString strResult; - strResult.Alloc(str.length()); - - size_t m; - for ( size_t n = 0; n < str.length(); n++ ) { - switch ( str[n] ) { -#ifdef __WXMSW__ - case wxT('%'): -#endif //WINDOWS - case wxT('$'): - { - Bracket bracket; - #ifdef __WXMSW__ - if ( str[n] == wxT('%') ) - bracket = Bracket_Windows; - else - #endif //WINDOWS - if ( n == str.length() - 1 ) { - bracket = Bracket_None; - } - else { - switch ( str[n + 1] ) { - case wxT('('): - bracket = Bracket_Normal; - n++; // skip the bracket - break; - - case wxT('{'): - bracket = Bracket_Curly; - n++; // skip the bracket - break; - - default: - bracket = Bracket_None; - } - } - - m = n + 1; - - while ( m < str.length() && (wxIsalnum(str[m]) || str[m] == wxT('_')) ) - m++; - - wxString strVarName(str.c_str() + n + 1, m - n - 1); - -#ifdef __WXWINCE__ - const wxChar *pszValue = NULL; -#else - // NB: use wxGetEnv instead of wxGetenv as otherwise variables - // set through wxSetEnv may not be read correctly! - const wxChar *pszValue = NULL; - wxString tmp; - if (wxGetEnv(strVarName, &tmp)) - pszValue = tmp; -#endif - if ( pszValue != NULL ) { - strResult += pszValue; - } - else { - // variable doesn't exist => don't change anything - #ifdef __WXMSW__ - if ( bracket != Bracket_Windows ) - #endif - if ( bracket != Bracket_None ) - strResult << str[n - 1]; - strResult << str[n] << strVarName; - } - - // check the closing bracket - if ( bracket != Bracket_None ) { - if ( m == str.length() || str[m] != (wxChar)bracket ) { - // under MSW it's common to have '%' characters in the registry - // and it's annoying to have warnings about them each time, so - // ignroe them silently if they are not used for env vars - // - // under Unix, OTOH, this warning could be useful for the user to - // understand why isn't the variable expanded as intended - #ifndef __WXMSW__ - wxLogWarning(_("Environment variables expansion failed: missing '%c' at position %u in '%s'."), - (char)bracket, (unsigned int) (m + 1), str.c_str()); - #endif // __WXMSW__ - } - else { - // skip closing bracket unless the variables wasn't expanded - if ( pszValue == NULL ) - strResult << (wxChar)bracket; - m++; - } - } - - n = m - 1; // skip variable name - } - break; - - case '\\': - // backslash can be used to suppress special meaning of % and $ - if ( n != str.length() - 1 && - (str[n + 1] == wxT('%') || str[n + 1] == wxT('$')) ) { - strResult += str[++n]; - - break; - } - //else: fall through - - default: - strResult += str[n]; - } - } - - return strResult; -} - -// this function is used to properly interpret '..' in path -void wxSplitPath(wxArrayString& aParts, const wxChar *sz) -{ - aParts.clear(); - - wxString strCurrent; - const wxChar *pc = sz; - for ( ;; ) { - if ( *pc == wxT('\0') || *pc == wxCONFIG_PATH_SEPARATOR ) { - if ( strCurrent == wxT(".") ) { - // ignore - } - else if ( strCurrent == wxT("..") ) { - // go up one level - if ( aParts.size() == 0 ) - wxLogWarning(_("'%s' has extra '..', ignored."), sz); - else - aParts.erase(aParts.end() - 1); - - strCurrent.Empty(); - } - else if ( !strCurrent.empty() ) { - aParts.push_back(strCurrent); - strCurrent.Empty(); - } - //else: - // could log an error here, but we prefer to ignore extra '/' - - if ( *pc == wxT('\0') ) - break; - } - else - strCurrent += *pc; - - pc++; - } -} diff --git a/wxWidgets/src/common/containr.cpp b/wxWidgets/src/common/containr.cpp deleted file mode 100644 index ffa9ce975d..0000000000 --- a/wxWidgets/src/common/containr.cpp +++ /dev/null @@ -1,678 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: src/common/containr.cpp -// Purpose: implementation of wxControlContainer -// Author: Vadim Zeitlin -// Modified by: -// Created: 06.08.01 -// RCS-ID: $Id: containr.cpp 44273 2007-01-21 01:21:45Z VZ $ -// Copyright: (c) 2001 Vadim Zeitlin -// License: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#ifndef WX_PRECOMP - #include "wx/log.h" - #include "wx/event.h" - #include "wx/window.h" - #include "wx/scrolbar.h" - #include "wx/radiobut.h" - #include "wx/containr.h" -#endif //WX_PRECOMP - -// trace mask for focus messages -#define TRACE_FOCUS _T("focus") - -// ============================================================================ -// implementation -// ============================================================================ - -wxControlContainer::wxControlContainer(wxWindow *winParent) -{ - m_winParent = winParent; - m_winLastFocused = NULL; - m_inSetFocus = false; -} - -bool wxControlContainer::AcceptsFocus() const -{ - // if we're not shown or disabled, we can't accept focus - if ( m_winParent->IsShown() && m_winParent->IsEnabled() ) - { - // otherwise we can accept focus either if we have no children at all - // (in this case we're probably not used as a container) or only when - // at least one child will accept focus - wxWindowList::compatibility_iterator node = m_winParent->GetChildren().GetFirst(); - if ( !node ) - return true; - -#ifdef __WXMAC__ - // wxMac has eventually the two scrollbars as children, they don't count - // as real children in the algorithm mentioned above - bool hasRealChildren = false ; -#endif - - while ( node ) - { - wxWindow *child = node->GetData(); - node = node->GetNext(); - -#ifdef __WXMAC__ - if ( m_winParent->MacIsWindowScrollbar( child ) ) - continue; - hasRealChildren = true ; -#endif - if ( child->AcceptsFocus() ) - { - return true; - } - } - -#ifdef __WXMAC__ - if ( !hasRealChildren ) - return true ; -#endif - } - - return false; -} - -void wxControlContainer::SetLastFocus(wxWindow *win) -{ - // the panel itself should never get the focus at all but if it does happen - // temporarily (as it seems to do under wxGTK), at the very least don't - // forget our previous m_winLastFocused - if ( win != m_winParent ) - { - // if we're setting the focus - if ( win ) - { - // find the last _immediate_ child which got focus - wxWindow *winParent = win; - while ( winParent != m_winParent ) - { - win = winParent; - winParent = win->GetParent(); - - // Yes, this can happen, though in a totally pathological case. - // like when detaching a menubar from a frame with a child - // which has pushed itself as an event handler for the menubar. - // (under wxGTK) - - wxASSERT_MSG( winParent, - _T("Setting last focus for a window that is not our child?") ); - } - } - - m_winLastFocused = win; - - if ( win ) - { - wxLogTrace(TRACE_FOCUS, _T("Set last focus to %s(%s)"), - win->GetClassInfo()->GetClassName(), - win->GetLabel().c_str()); - } - else - { - wxLogTrace(TRACE_FOCUS, _T("No more last focus")); - } - } - - // propagate the last focus upwards so that our parent can set focus back - // to us if it loses it now and regains later - wxWindow *parent = m_winParent->GetParent(); - if ( parent ) - { - wxChildFocusEvent eventFocus(m_winParent); - parent->GetEventHandler()->ProcessEvent(eventFocus); - } -} - -// -------------------------------------------------------------------- -// The following four functions are used to find other radio buttons -// within the same group. Used by wxSetFocusToChild on wxMSW -// -------------------------------------------------------------------- - -#ifdef __WXMSW__ - -wxRadioButton* wxGetPreviousButtonInGroup(wxRadioButton *btn) -{ - if ( btn->HasFlag(wxRB_GROUP) || btn->HasFlag(wxRB_SINGLE) ) - return NULL; - - const wxWindowList& siblings = btn->GetParent()->GetChildren(); - wxWindowList::compatibility_iterator nodeThis = siblings.Find(btn); - wxCHECK_MSG( nodeThis, NULL, _T("radio button not a child of its parent?") ); - - // Iterate over all previous siblings until we find the next radio button - wxWindowList::compatibility_iterator nodeBefore = nodeThis->GetPrevious(); - wxRadioButton *prevBtn = 0; - while (nodeBefore) - { - prevBtn = wxDynamicCast(nodeBefore->GetData(), wxRadioButton); - if (prevBtn) - break; - - nodeBefore = nodeBefore->GetPrevious(); - } - - if (!prevBtn || prevBtn->HasFlag(wxRB_SINGLE)) - { - // no more buttons in group - return NULL; - } - - return prevBtn; -} - -wxRadioButton* wxGetNextButtonInGroup(wxRadioButton *btn) -{ - if (btn->HasFlag(wxRB_SINGLE)) - return NULL; - - const wxWindowList& siblings = btn->GetParent()->GetChildren(); - wxWindowList::compatibility_iterator nodeThis = siblings.Find(btn); - wxCHECK_MSG( nodeThis, NULL, _T("radio button not a child of its parent?") ); - - // Iterate over all previous siblings until we find the next radio button - wxWindowList::compatibility_iterator nodeNext = nodeThis->GetNext(); - wxRadioButton *nextBtn = 0; - while (nodeNext) - { - nextBtn = wxDynamicCast(nodeNext->GetData(), wxRadioButton); - if (nextBtn) - break; - - nodeNext = nodeNext->GetNext(); - } - - if ( !nextBtn || nextBtn->HasFlag(wxRB_GROUP) || nextBtn->HasFlag(wxRB_SINGLE) ) - { - // no more buttons or the first button of the next group - return NULL; - } - - return nextBtn; -} - -wxRadioButton* wxGetFirstButtonInGroup(wxRadioButton *btn) -{ - while (true) - { - wxRadioButton* prevBtn = wxGetPreviousButtonInGroup(btn); - if (!prevBtn) - return btn; - - btn = prevBtn; - } -} - -wxRadioButton* wxGetLastButtonInGroup(wxRadioButton *btn) -{ - while (true) - { - wxRadioButton* nextBtn = wxGetNextButtonInGroup(btn); - if (!nextBtn) - return btn; - - btn = nextBtn; - } -} - -wxRadioButton* wxGetSelectedButtonInGroup(wxRadioButton *btn) -{ - // Find currently selected button - if (btn->GetValue()) - return btn; - - if (btn->HasFlag(wxRB_SINGLE)) - return NULL; - - wxRadioButton *selBtn; - - // First check all previous buttons - for (selBtn = wxGetPreviousButtonInGroup(btn); selBtn; selBtn = wxGetPreviousButtonInGroup(selBtn)) - if (selBtn->GetValue()) - return selBtn; - - // Now all following buttons - for (selBtn = wxGetNextButtonInGroup(btn); selBtn; selBtn = wxGetNextButtonInGroup(selBtn)) - if (selBtn->GetValue()) - return selBtn; - - return NULL; -} - -#endif // __WXMSW__ - -// ---------------------------------------------------------------------------- -// Keyboard handling - this is the place where the TAB traversal logic is -// implemented. As this code is common to all ports, this ensures consistent -// behaviour even if we don't specify how exactly the wxNavigationKeyEvent are -// generated and this is done in platform specific code which also ensures that -// we can follow the given platform standards. -// ---------------------------------------------------------------------------- - -void wxControlContainer::HandleOnNavigationKey( wxNavigationKeyEvent& event ) -{ - wxWindow *parent = m_winParent->GetParent(); - - // the event is propagated downwards if the event emitter was our parent - bool goingDown = event.GetEventObject() == parent; - - const wxWindowList& children = m_winParent->GetChildren(); - - // if we have exactly one notebook-like child window (actually it could be - // any window that returns true from its HasMultiplePages()), then - // [Shift-]Ctrl-Tab and Ctrl-PageUp/Down keys should iterate over its pages - // even if the focus is outside of the control because this is how the - // standard MSW properties dialogs behave and we do it under other platforms - // as well because it seems like a good idea -- but we can always put this - // block inside "#ifdef __WXMSW__" if it's not suitable there - if ( event.IsWindowChange() && !goingDown ) - { - // check if we have a unique notebook-like child - wxWindow *bookctrl = NULL; - for ( wxWindowList::const_iterator i = children.begin(), - end = children.end(); - i != end; - ++i ) - { - wxWindow * const window = *i; - if ( window->HasMultiplePages() ) - { - if ( bookctrl ) - { - // this is the second book-like control already so don't do - // anything as we don't know which one should have its page - // changed - bookctrl = NULL; - break; - } - - bookctrl = window; - } - } - - if ( bookctrl ) - { - // make sure that we don't bubble up the event again from the book - // control resulting in infinite recursion - wxNavigationKeyEvent eventCopy(event); - eventCopy.SetEventObject(m_winParent); - if ( bookctrl->GetEventHandler()->ProcessEvent(eventCopy) ) - return; - } - } - - // there is not much to do if we don't have children and we're not - // interested in "notebook page change" events here - if ( !children.GetCount() || event.IsWindowChange() ) - { - // let the parent process it unless it already comes from our parent - // of we don't have any - if ( goingDown || - !parent || !parent->GetEventHandler()->ProcessEvent(event) ) - { - event.Skip(); - } - - return; - } - - // where are we going? - const bool forward = event.GetDirection(); - - // the node of the children list from which we should start looking for the - // next acceptable child - wxWindowList::compatibility_iterator node, start_node; - - // we should start from the first/last control and not from the one which - // had focus the last time if we're propagating the event downwards because - // for our parent we look like a single control - if ( goingDown ) - { - // just to be sure it's not used (normally this is not necessary, but - // doesn't hurt neither) - m_winLastFocused = (wxWindow *)NULL; - - // start from first or last depending on where we're going - node = forward ? children.GetFirst() : children.GetLast(); - } - else // going up - { - // try to find the child which has the focus currently - - // the event emitter might have done this for us - wxWindow *winFocus = event.GetCurrentFocus(); - - // but if not, we might know where the focus was ourselves - if (!winFocus) - winFocus = m_winLastFocused; - - // if still no luck, do it the hard way - if (!winFocus) - winFocus = wxWindow::FindFocus(); - - if ( winFocus ) - { -#ifdef __WXMSW__ - // If we are in a radio button group, start from the first item in the - // group - if ( event.IsFromTab() && wxIsKindOf(winFocus, wxRadioButton ) ) - winFocus = wxGetFirstButtonInGroup((wxRadioButton*)winFocus); -#endif - // ok, we found the focus - now is it our child? - start_node = children.Find( winFocus ); - } - - if ( !start_node && m_winLastFocused ) - { - // window which has focus isn't our child, fall back to the one - // which had the focus the last time - start_node = children.Find( m_winLastFocused ); - } - - // if we still didn't find anything, we should start with the first one - if ( !start_node ) - { - start_node = children.GetFirst(); - } - - // and the first child which we can try setting focus to is the next or - // the previous one - node = forward ? start_node->GetNext() : start_node->GetPrevious(); - } - - // we want to cycle over all elements passing by NULL - for ( ;; ) - { - // don't go into infinite loop - if ( start_node && node && node == start_node ) - break; - - // Have we come to the last or first item on the panel? - if ( !node ) - { - if ( !start_node ) - { - // exit now as otherwise we'd loop forever - break; - } - - if ( !goingDown ) - { - // Check if our (maybe grand) parent is another panel: if this - // is the case, they will know what to do with this navigation - // key and so give them the chance to process it instead of - // looping inside this panel (normally, the focus will go to - // the next/previous item after this panel in the parent - // panel). - wxWindow *focussed_child_of_parent = m_winParent; - while ( parent ) - { - // we don't want to tab into a different dialog or frame - if ( focussed_child_of_parent->IsTopLevel() ) - break; - - event.SetCurrentFocus( focussed_child_of_parent ); - if ( parent->GetEventHandler()->ProcessEvent( event ) ) - return; - - focussed_child_of_parent = parent; - - parent = parent->GetParent(); - } - } - //else: as the focus came from our parent, we definitely don't want - // to send it back to it! - - // no, we are not inside another panel so process this ourself - node = forward ? children.GetFirst() : children.GetLast(); - - continue; - } - - wxWindow *child = node->GetData(); - -#ifdef __WXMSW__ - if ( event.IsFromTab() ) - { - if ( wxIsKindOf(child, wxRadioButton) ) - { - // only radio buttons with either wxRB_GROUP or wxRB_SINGLE - // can be tabbed to - if ( child->HasFlag(wxRB_GROUP) ) - { - // need to tab into the active button within a group - wxRadioButton *rb = wxGetSelectedButtonInGroup((wxRadioButton*)child); - if ( rb ) - child = rb; - } - else if ( !child->HasFlag(wxRB_SINGLE) ) - { - node = forward ? node->GetNext() : node->GetPrevious(); - continue; - } - } - } - else if ( m_winLastFocused && - wxIsKindOf(m_winLastFocused, wxRadioButton) && - !m_winLastFocused->HasFlag(wxRB_SINGLE) ) - { - // cursor keys don't navigate out of a radio button group so - // find the correct radio button to focus - if ( forward ) - { - child = wxGetNextButtonInGroup((wxRadioButton*)m_winLastFocused); - if ( !child ) - { - // no next button in group, set it to the first button - child = wxGetFirstButtonInGroup((wxRadioButton*)m_winLastFocused); - } - } - else - { - child = wxGetPreviousButtonInGroup((wxRadioButton*)m_winLastFocused); - if ( !child ) - { - // no previous button in group, set it to the last button - child = wxGetLastButtonInGroup((wxRadioButton*)m_winLastFocused); - } - } - - if ( child == m_winLastFocused ) - { - // must be a group consisting of only one button therefore - // no need to send a navigation event - event.Skip(false); - return; - } - } -#endif // __WXMSW__ - - if ( child->AcceptsFocusFromKeyboard() ) - { - // if we're setting the focus to a child panel we should prevent it - // from giving it to the child which had the focus the last time - // and instead give it to the first/last child depending from which - // direction we're coming - event.SetEventObject(m_winParent); - - // disable propagation for this call as otherwise the event might - // bounce back to us. - wxPropagationDisabler disableProp(event); - if ( !child->GetEventHandler()->ProcessEvent(event) ) - { - // set it first in case SetFocusFromKbd() results in focus - // change too - m_winLastFocused = child; - - // everything is simple: just give focus to it - child->SetFocusFromKbd(); - } - //else: the child manages its focus itself - - event.Skip( false ); - - return; - } - - node = forward ? node->GetNext() : node->GetPrevious(); - } - - // we cycled through all of our children and none of them wanted to accept - // focus - event.Skip(); -} - -void wxControlContainer::HandleOnWindowDestroy(wxWindowBase *child) -{ - if ( child == m_winLastFocused ) - m_winLastFocused = NULL; -} - -// ---------------------------------------------------------------------------- -// focus handling -// ---------------------------------------------------------------------------- - -bool wxControlContainer::DoSetFocus() -{ - wxLogTrace(TRACE_FOCUS, _T("SetFocus on wxPanel 0x%p."), - m_winParent->GetHandle()); - - if (m_inSetFocus) - return true; - - // when the panel gets the focus we move the focus to either the last - // window that had the focus or the first one that can get it unless the - // focus had been already set to some other child - - wxWindow *win = wxWindow::FindFocus(); - while ( win ) - { - if ( win == m_winParent ) - { - // our child already has focus, don't take it away from it - return true; - } - - if ( win->IsTopLevel() ) - { - // don't look beyond the first top level parent - useless and - // unnecessary - break; - } - - win = win->GetParent(); - } - - // protect against infinite recursion: - m_inSetFocus = true; - - bool ret = SetFocusToChild(); - - m_inSetFocus = false; - - return ret; -} - -void wxControlContainer::HandleOnFocus(wxFocusEvent& event) -{ - wxLogTrace(TRACE_FOCUS, _T("OnFocus on wxPanel 0x%p, name: %s"), - m_winParent->GetHandle(), - m_winParent->GetName().c_str() ); - - DoSetFocus(); - - event.Skip(); -} - -bool wxControlContainer::SetFocusToChild() -{ - return wxSetFocusToChild(m_winParent, &m_winLastFocused); -} - -// ---------------------------------------------------------------------------- -// SetFocusToChild(): this function is used by wxPanel but also by wxFrame in -// wxMSW, this is why it is outside of wxControlContainer class -// ---------------------------------------------------------------------------- - -bool wxSetFocusToChild(wxWindow *win, wxWindow **childLastFocused) -{ - wxCHECK_MSG( win, false, _T("wxSetFocusToChild(): invalid window") ); - wxCHECK_MSG( childLastFocused, false, - _T("wxSetFocusToChild(): NULL child poonter") ); - - if ( *childLastFocused ) - { - // It might happen that the window got reparented - if ( (*childLastFocused)->GetParent() == win ) - { - wxLogTrace(TRACE_FOCUS, - _T("SetFocusToChild() => last child (0x%p)."), - (*childLastFocused)->GetHandle()); - - // not SetFocusFromKbd(): we're restoring focus back to the old - // window and not setting it as the result of a kbd action - (*childLastFocused)->SetFocus(); - return true; - } - else - { - // it doesn't count as such any more - *childLastFocused = (wxWindow *)NULL; - } - } - - // set the focus to the first child who wants it - wxWindowList::compatibility_iterator node = win->GetChildren().GetFirst(); - while ( node ) - { - wxWindow *child = node->GetData(); - node = node->GetNext(); - -#ifdef __WXMAC__ - if ( child->GetParent()->MacIsWindowScrollbar( child ) ) - continue; -#endif - - if ( child->AcceptsFocusFromKeyboard() && !child->IsTopLevel() ) - { -#ifdef __WXMSW__ - // If a radiobutton is the first focusable child, search for the - // selected radiobutton in the same group - wxRadioButton* btn = wxDynamicCast(child, wxRadioButton); - if (btn) - { - wxRadioButton* selected = wxGetSelectedButtonInGroup(btn); - if (selected) - child = selected; - } -#endif - - wxLogTrace(TRACE_FOCUS, - _T("SetFocusToChild() => first child (0x%p)."), - child->GetHandle()); - - *childLastFocused = child; - child->SetFocusFromKbd(); - return true; - } - } - - return false; -} diff --git a/wxWidgets/src/common/convauto.cpp b/wxWidgets/src/common/convauto.cpp deleted file mode 100644 index 3205b7bea6..0000000000 --- a/wxWidgets/src/common/convauto.cpp +++ /dev/null @@ -1,214 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: src/common/convauto.cpp -// Purpose: implementation of wxConvAuto -// Author: Vadim Zeitlin -// Created: 2006-04-04 -// RCS-ID: $Id: convauto.cpp 38570 2006-04-05 14:37:47Z VZ $ -// Copyright: (c) 2006 Vadim Zeitlin -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -// for compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_WCHAR_T - -#ifndef WX_PRECOMP -#endif //WX_PRECOMP - -#include "wx/convauto.h" - -// ============================================================================ -// implementation -// ============================================================================ - -/* static */ -wxConvAuto::BOMType wxConvAuto::DetectBOM(const char *src, size_t srcLen) -{ - if ( srcLen < 2 ) - { - // minimal BOM is 2 bytes so bail out immediately and simplify the code - // below which wouldn't need to check for length for UTF-16 cases - return BOM_None; - } - - // examine the buffer for BOM presence - // - // see http://www.unicode.org/faq/utf_bom.html#BOM - switch ( *src++ ) - { - case '\0': - // could only be big endian UTF-32 (00 00 FE FF) - if ( srcLen >= 4 && - src[0] == '\0' && - src[1] == '\xfe' && - src[2] == '\xff' ) - { - return BOM_UTF32BE; - } - break; - - case '\xfe': - // could only be big endian UTF-16 (FE FF) - if ( *src++ == '\xff' ) - { - return BOM_UTF16BE; - } - break; - - case '\xff': - // could be either little endian UTF-16 or UTF-32, both start - // with FF FE - if ( *src++ == '\xfe' ) - { - return srcLen >= 4 && src[0] == '\0' && src[1] == '\0' - ? BOM_UTF32LE - : BOM_UTF16LE; - } - break; - - case '\xef': - // is this UTF-8 BOM (EF BB BF)? - if ( srcLen >= 3 && src[0] == '\xbb' && src[1] == '\xbf' ) - { - return BOM_UTF8; - } - break; - } - - return BOM_None; -} - -void wxConvAuto::InitFromBOM(BOMType bomType) -{ - m_consumedBOM = false; - - switch ( bomType ) - { - case BOM_UTF32BE: - m_conv = new wxMBConvUTF32BE; - m_ownsConv = true; - break; - - case BOM_UTF32LE: - m_conv = new wxMBConvUTF32LE; - m_ownsConv = true; - break; - - case BOM_UTF16BE: - m_conv = new wxMBConvUTF16BE; - m_ownsConv = true; - break; - - case BOM_UTF16LE: - m_conv = new wxMBConvUTF16LE; - m_ownsConv = true; - break; - - case BOM_UTF8: - m_conv = &wxConvUTF8; - m_ownsConv = false; - break; - - default: - wxFAIL_MSG( _T("unexpected BOM type") ); - // fall through: still need to create something - - case BOM_None: - InitWithDefault(); - m_consumedBOM = true; // as there is nothing to consume - } -} - -void wxConvAuto::SkipBOM(const char **src, size_t *len) const -{ - int ofs; - switch ( m_bomType ) - { - case BOM_UTF32BE: - case BOM_UTF32LE: - ofs = 4; - break; - - case BOM_UTF16BE: - case BOM_UTF16LE: - ofs = 2; - break; - - case BOM_UTF8: - ofs = 3; - break; - - default: - wxFAIL_MSG( _T("unexpected BOM type") ); - // fall through: still need to create something - - case BOM_None: - ofs = 0; - } - - *src += ofs; - if ( *len != (size_t)-1 ) - *len -= ofs; -} - -void wxConvAuto::InitFromInput(const char **src, size_t *len) -{ - m_bomType = DetectBOM(*src, *len); - InitFromBOM(m_bomType); - SkipBOM(src, len); -} - -size_t -wxConvAuto::ToWChar(wchar_t *dst, size_t dstLen, - const char *src, size_t srcLen) const -{ - // we check BOM and create the appropriate conversion the first time we're - // called but we also need to ensure that the BOM is skipped not only - // during this initial call but also during the first call with non-NULL - // dst as typically we're first called with NULL dst to calculate the - // needed buffer size - wxConvAuto *self = wx_const_cast(wxConvAuto *, this); - if ( !m_conv ) - { - self->InitFromInput(&src, &srcLen); - if ( dst ) - self->m_consumedBOM = true; - } - - if ( !m_consumedBOM && dst ) - { - self->m_consumedBOM = true; - SkipBOM(&src, &srcLen); - } - - return m_conv->ToWChar(dst, dstLen, src, srcLen); -} - -size_t -wxConvAuto::FromWChar(char *dst, size_t dstLen, - const wchar_t *src, size_t srcLen) const -{ - if ( !m_conv ) - { - // default to UTF-8 for the multibyte output - wx_const_cast(wxConvAuto *, this)->InitWithDefault(); - } - - return m_conv->FromWChar(dst, dstLen, src, srcLen); -} - -#endif // wxUSE_WCHAR_T - diff --git a/wxWidgets/src/common/cshelp.cpp b/wxWidgets/src/common/cshelp.cpp deleted file mode 100644 index 6bd3d5cc00..0000000000 --- a/wxWidgets/src/common/cshelp.cpp +++ /dev/null @@ -1,512 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/common/cshelp.cpp -// Purpose: Context sensitive help class implementation -// Author: Julian Smart, Vadim Zeitlin -// Modified by: -// Created: 08/09/2000 -// RCS-ID: $Id: cshelp.cpp 52329 2008-03-05 13:20:26Z VZ $ -// Copyright: (c) 2000 Julian Smart, Vadim Zeitlin -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_HELP - -#ifndef WX_PRECOMP - #include "wx/app.h" - #include "wx/module.h" -#endif - -#include "wx/tipwin.h" -#include "wx/cshelp.h" - -#if wxUSE_MS_HTML_HELP - #include "wx/msw/helpchm.h" // for ShowContextHelpPopup - #include "wx/utils.h" // for wxGetMousePosition() -#endif - -// ---------------------------------------------------------------------------- -// wxContextHelpEvtHandler private class -// ---------------------------------------------------------------------------- - -// This class exists in order to eat events until the left mouse button is -// pressed -class wxContextHelpEvtHandler: public wxEvtHandler -{ -public: - wxContextHelpEvtHandler(wxContextHelp* contextHelp) - { - m_contextHelp = contextHelp; - } - - virtual bool ProcessEvent(wxEvent& event); - -//// Data - wxContextHelp* m_contextHelp; - - DECLARE_NO_COPY_CLASS(wxContextHelpEvtHandler) -}; - -// ============================================================================ -// implementation -// ============================================================================ - -// ---------------------------------------------------------------------------- -// wxContextHelp -// ---------------------------------------------------------------------------- - -/* - * Invokes context-sensitive help - */ - - -IMPLEMENT_DYNAMIC_CLASS(wxContextHelp, wxObject) - -wxContextHelp::wxContextHelp(wxWindow* win, bool beginHelp) -{ - m_inHelp = false; - - if (beginHelp) - BeginContextHelp(win); -} - -wxContextHelp::~wxContextHelp() -{ - if (m_inHelp) - EndContextHelp(); -} - -// Not currently needed, but on some systems capture may not work as -// expected so we'll leave it here for now. -#ifdef __WXMOTIF__ -static void wxPushOrPopEventHandlers(wxContextHelp* help, wxWindow* win, bool push) -{ - if (push) - win->PushEventHandler(new wxContextHelpEvtHandler(help)); - else - win->PopEventHandler(true); - - wxWindowList::compatibility_iterator node = win->GetChildren().GetFirst(); - while (node) - { - wxWindow* child = node->GetData(); - wxPushOrPopEventHandlers(help, child, push); - - node = node->GetNext(); - } -} -#endif - -// Begin 'context help mode' -bool wxContextHelp::BeginContextHelp(wxWindow* win) -{ - if (!win) - win = wxTheApp->GetTopWindow(); - if (!win) - return false; - - wxCursor cursor(wxCURSOR_QUESTION_ARROW); - wxCursor oldCursor = win->GetCursor(); - win->SetCursor(cursor); - -#ifdef __WXMAC__ - wxSetCursor(cursor); -#endif - - m_status = false; - -#ifdef __WXMOTIF__ - wxPushOrPopEventHandlers(this, win, true); -#else - win->PushEventHandler(new wxContextHelpEvtHandler(this)); -#endif - - win->CaptureMouse(); - - EventLoop(); - - win->ReleaseMouse(); - -#ifdef __WXMOTIF__ - wxPushOrPopEventHandlers(this, win, false); -#else - win->PopEventHandler(true); -#endif - - win->SetCursor(oldCursor); - -#ifdef __WXMAC__ - wxSetCursor(wxNullCursor); -#endif - - if (m_status) - { - wxPoint pt; - wxWindow* winAtPtr = wxFindWindowAtPointer(pt); - -#if 0 - if (winAtPtr) - { - printf("Picked %s (%d)\n", winAtPtr->GetName().c_str(), - winAtPtr->GetId()); - } -#endif - - if (winAtPtr) - DispatchEvent(winAtPtr, pt); - } - - return true; -} - -bool wxContextHelp::EndContextHelp() -{ - m_inHelp = false; - - return true; -} - -bool wxContextHelp::EventLoop() -{ - m_inHelp = true; - - while ( m_inHelp ) - { - if (wxTheApp->Pending()) - { - wxTheApp->Dispatch(); - } - else - { - wxTheApp->ProcessIdle(); - } - } - - return true; -} - -bool wxContextHelpEvtHandler::ProcessEvent(wxEvent& event) -{ - if (event.GetEventType() == wxEVT_LEFT_DOWN) - { - m_contextHelp->SetStatus(true); - m_contextHelp->EndContextHelp(); - return true; - } - - if ((event.GetEventType() == wxEVT_CHAR) || - (event.GetEventType() == wxEVT_KEY_DOWN) || - (event.GetEventType() == wxEVT_ACTIVATE) || - (event.GetEventType() == wxEVT_MOUSE_CAPTURE_CHANGED)) - { - // May have already been set to true by a left-click - //m_contextHelp->SetStatus(false); - m_contextHelp->EndContextHelp(); - return true; - } - - if ((event.GetEventType() == wxEVT_PAINT) || - (event.GetEventType() == wxEVT_ERASE_BACKGROUND)) - { - event.Skip(); - return false; - } - - return true; -} - -// Dispatch the help event to the relevant window -bool wxContextHelp::DispatchEvent(wxWindow* win, const wxPoint& pt) -{ - wxCHECK_MSG( win, false, _T("win parameter can't be NULL") ); - - wxHelpEvent helpEvent(wxEVT_HELP, win->GetId(), pt, - wxHelpEvent::Origin_HelpButton); - helpEvent.SetEventObject(win); - - return win->GetEventHandler()->ProcessEvent(helpEvent); -} - -// ---------------------------------------------------------------------------- -// wxContextHelpButton -// ---------------------------------------------------------------------------- - -/* - * wxContextHelpButton - * You can add this to your dialogs (especially on non-Windows platforms) - * to put the application into context help mode. - */ - -#ifndef __WXPM__ - -static const char * csquery_xpm[] = { -"12 11 2 1", -" c None", -". c #000000", -" ", -" .... ", -" .. .. ", -" .. .. ", -" .. ", -" .. ", -" .. ", -" ", -" .. ", -" .. ", -" "}; - -#endif - -IMPLEMENT_CLASS(wxContextHelpButton, wxBitmapButton) - -BEGIN_EVENT_TABLE(wxContextHelpButton, wxBitmapButton) - EVT_BUTTON(wxID_CONTEXT_HELP, wxContextHelpButton::OnContextHelp) -END_EVENT_TABLE() - -wxContextHelpButton::wxContextHelpButton(wxWindow* parent, - wxWindowID id, - const wxPoint& pos, - const wxSize& size, - long style) -#if defined(__WXPM__) - : wxBitmapButton(parent, id, wxBitmap(wxCSQUERY_BITMAP - ,wxBITMAP_TYPE_RESOURCE - ), - pos, size, style) -#else - : wxBitmapButton(parent, id, wxBitmap(csquery_xpm), - pos, size, style) -#endif -{ -} - -void wxContextHelpButton::OnContextHelp(wxCommandEvent& WXUNUSED(event)) -{ - wxContextHelp contextHelp(GetParent()); -} - -// ---------------------------------------------------------------------------- -// wxHelpProvider -// ---------------------------------------------------------------------------- - -wxHelpProvider *wxHelpProvider::ms_helpProvider = (wxHelpProvider *)NULL; - -// trivial implementation of some methods which we don't want to make pure -// virtual for convenience - -void wxHelpProvider::AddHelp(wxWindowBase * WXUNUSED(window), - const wxString& WXUNUSED(text)) -{ -} - -void wxHelpProvider::AddHelp(wxWindowID WXUNUSED(id), - const wxString& WXUNUSED(text)) -{ -} - -// removes the association -void wxHelpProvider::RemoveHelp(wxWindowBase* WXUNUSED(window)) -{ -} - -wxHelpProvider::~wxHelpProvider() -{ -} - -wxString wxHelpProvider::GetHelpTextMaybeAtPoint(wxWindowBase *window) -{ - if ( m_helptextAtPoint != wxDefaultPosition || - m_helptextOrigin != wxHelpEvent::Origin_Unknown ) - { - wxCHECK_MSG( window, wxEmptyString, _T("window must not be NULL") ); - - wxPoint pt = m_helptextAtPoint; - wxHelpEvent::Origin origin = m_helptextOrigin; - - m_helptextAtPoint = wxDefaultPosition; - m_helptextOrigin = wxHelpEvent::Origin_Unknown; - - return window->GetHelpTextAtPoint(pt, origin); - } - - return GetHelp(window); -} - -// ---------------------------------------------------------------------------- -// wxSimpleHelpProvider -// ---------------------------------------------------------------------------- - -#define WINHASH_KEY(w) wxPtrToUInt(w) - -wxString wxSimpleHelpProvider::GetHelp(const wxWindowBase *window) -{ - wxSimpleHelpProviderHashMap::iterator it = m_hashWindows.find(WINHASH_KEY(window)); - - if ( it == m_hashWindows.end() ) - { - it = m_hashIds.find(window->GetId()); - if ( it == m_hashIds.end() ) - return wxEmptyString; - } - - return it->second; -} - -void wxSimpleHelpProvider::AddHelp(wxWindowBase *window, const wxString& text) -{ - m_hashWindows.erase(WINHASH_KEY(window)); - m_hashWindows[WINHASH_KEY(window)] = text; -} - -void wxSimpleHelpProvider::AddHelp(wxWindowID id, const wxString& text) -{ - wxSimpleHelpProviderHashMap::key_type key = (wxSimpleHelpProviderHashMap::key_type)id; - m_hashIds.erase(key); - m_hashIds[key] = text; -} - -// removes the association -void wxSimpleHelpProvider::RemoveHelp(wxWindowBase* window) -{ - m_hashWindows.erase(WINHASH_KEY(window)); -} - -bool wxSimpleHelpProvider::ShowHelp(wxWindowBase *window) -{ -#if wxUSE_MS_HTML_HELP || wxUSE_TIPWINDOW -#if wxUSE_MS_HTML_HELP - // m_helptextAtPoint will be reset by GetHelpTextMaybeAtPoint(), stash it - const wxPoint posTooltip = m_helptextAtPoint; -#endif // wxUSE_MS_HTML_HELP - - const wxString text = GetHelpTextMaybeAtPoint(window); - - if ( !text.empty() ) - { - // use the native help popup style if it's available -#if wxUSE_MS_HTML_HELP - if ( !wxCHMHelpController::ShowContextHelpPopup - ( - text, - posTooltip, - (wxWindow *)window - ) ) -#endif // wxUSE_MS_HTML_HELP - { -#if wxUSE_TIPWINDOW - static wxTipWindow* s_tipWindow = NULL; - - if ( s_tipWindow ) - { - // Prevent s_tipWindow being nulled in OnIdle, thereby removing - // the chance for the window to be closed by ShowHelp - s_tipWindow->SetTipWindowPtr(NULL); - s_tipWindow->Close(); - } - - s_tipWindow = new wxTipWindow((wxWindow *)window, text, - 100, &s_tipWindow); -#else // !wxUSE_TIPWINDOW - // we tried wxCHMHelpController but it failed and we don't have - // wxTipWindow to fall back on, so - return false; -#endif // wxUSE_TIPWINDOW - } - - return true; - } -#else // !wxUSE_MS_HTML_HELP && !wxUSE_TIPWINDOW - wxUnusedVar(window); -#endif // wxUSE_MS_HTML_HELP || wxUSE_TIPWINDOW - - return false; -} - -// ---------------------------------------------------------------------------- -// wxHelpControllerHelpProvider -// ---------------------------------------------------------------------------- - -wxHelpControllerHelpProvider::wxHelpControllerHelpProvider(wxHelpControllerBase* hc) -{ - m_helpController = hc; -} - -bool wxHelpControllerHelpProvider::ShowHelp(wxWindowBase *window) -{ - const wxString text = GetHelpTextMaybeAtPoint(window); - - if ( text.empty() ) - return false; - - if ( m_helpController ) - { - // if it's a numeric topic, show it - long topic; - if ( text.ToLong(&topic) ) - return m_helpController->DisplayContextPopup(topic); - - // otherwise show the text directly - if ( m_helpController->DisplayTextPopup(text, wxGetMousePosition()) ) - return true; - } - - // if there is no help controller or it's not capable of showing the help, - // fallback to the default method - return wxSimpleHelpProvider::ShowHelp(window); -} - -// Convenience function for turning context id into wxString -wxString wxContextId(int id) -{ - return wxString::Format(_T("%d"), id); -} - -// ---------------------------------------------------------------------------- -// wxHelpProviderModule: module responsible for cleaning up help provider. -// ---------------------------------------------------------------------------- - -class wxHelpProviderModule : public wxModule -{ -public: - bool OnInit(); - void OnExit(); - -private: - DECLARE_DYNAMIC_CLASS(wxHelpProviderModule) -}; - -IMPLEMENT_DYNAMIC_CLASS(wxHelpProviderModule, wxModule) - -bool wxHelpProviderModule::OnInit() -{ - // Probably we don't want to do anything by default, - // since it could pull in extra code - // wxHelpProvider::Set(new wxSimpleHelpProvider); - - return true; -} - -void wxHelpProviderModule::OnExit() -{ - if (wxHelpProvider::Get()) - { - delete wxHelpProvider::Get(); - wxHelpProvider::Set(NULL); - } -} - -#endif // wxUSE_HELP diff --git a/wxWidgets/src/common/ctrlcmn.cpp b/wxWidgets/src/common/ctrlcmn.cpp deleted file mode 100644 index 9326835e9c..0000000000 --- a/wxWidgets/src/common/ctrlcmn.cpp +++ /dev/null @@ -1,188 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/common/ctrlcmn.cpp -// Purpose: wxControl common interface -// Author: Vadim Zeitlin -// Modified by: -// Created: 26.07.99 -// RCS-ID: $Id: ctrlcmn.cpp 40329 2006-07-25 18:40:04Z VZ $ -// Copyright: (c) wxWidgets team -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_CONTROLS - -#include "wx/control.h" - -#ifndef WX_PRECOMP - #include "wx/log.h" - #include "wx/radiobut.h" - #include "wx/statbmp.h" - #include "wx/bitmap.h" - #include "wx/utils.h" // for wxStripMenuCodes() -#endif - -const wxChar wxControlNameStr[] = wxT("control"); - -// ============================================================================ -// implementation -// ============================================================================ - -wxControlBase::~wxControlBase() -{ - // this destructor is required for Darwin -} - -bool wxControlBase::Create(wxWindow *parent, - wxWindowID id, - const wxPoint &pos, - const wxSize &size, - long style, - const wxValidator& wxVALIDATOR_PARAM(validator), - const wxString &name) -{ - bool ret = wxWindow::Create(parent, id, pos, size, style, name); - -#if wxUSE_VALIDATORS - if ( ret ) - SetValidator(validator); -#endif // wxUSE_VALIDATORS - - return ret; -} - -bool wxControlBase::CreateControl(wxWindowBase *parent, - wxWindowID id, - const wxPoint& pos, - const wxSize& size, - long style, - const wxValidator& validator, - const wxString& name) -{ - // even if it's possible to create controls without parents in some port, - // it should surely be discouraged because it doesn't work at all under - // Windows - wxCHECK_MSG( parent, false, wxT("all controls must have parents") ); - - if ( !CreateBase(parent, id, pos, size, style, validator, name) ) - return false; - - parent->AddChild(this); - - return true; -} - -/* static */ -wxString wxControlBase::GetLabelText(const wxString& label) -{ - // we don't want strip the TABs here, just the mnemonics - return wxStripMenuCodes(label, wxStrip_Mnemonics); -} - -void wxControlBase::Command(wxCommandEvent& event) -{ - (void)GetEventHandler()->ProcessEvent(event); -} - -void wxControlBase::InitCommandEvent(wxCommandEvent& event) const -{ - event.SetEventObject((wxControlBase *)this); // const_cast - - // event.SetId(GetId()); -- this is usuall done in the event ctor - - switch ( m_clientDataType ) - { - case wxClientData_Void: - event.SetClientData(GetClientData()); - break; - - case wxClientData_Object: - event.SetClientObject(GetClientObject()); - break; - - case wxClientData_None: - // nothing to do - ; - } -} - - -void wxControlBase::SetLabel( const wxString &label ) -{ - InvalidateBestSize(); - wxWindow::SetLabel(label); -} - -bool wxControlBase::SetFont(const wxFont& font) -{ - InvalidateBestSize(); - return wxWindow::SetFont(font); -} - -// wxControl-specific processing after processing the update event -void wxControlBase::DoUpdateWindowUI(wxUpdateUIEvent& event) -{ - // call inherited - wxWindowBase::DoUpdateWindowUI(event); - - // update label - if ( event.GetSetText() ) - { - if ( event.GetText() != GetLabel() ) - SetLabel(event.GetText()); - } - - // Unfortunately we don't yet have common base class for - // wxRadioButton, so we handle updates of radiobuttons here. - // TODO: If once wxRadioButtonBase will exist, move this code there. -#if wxUSE_RADIOBTN - if ( event.GetSetChecked() ) - { - wxRadioButton *radiobtn = wxDynamicCastThis(wxRadioButton); - if ( radiobtn ) - radiobtn->SetValue(event.GetChecked()); - } -#endif // wxUSE_RADIOBTN -} - -// ---------------------------------------------------------------------------- -// wxStaticBitmap -// ---------------------------------------------------------------------------- - -#if wxUSE_STATBMP - -wxStaticBitmapBase::~wxStaticBitmapBase() -{ - // this destructor is required for Darwin -} - -wxSize wxStaticBitmapBase::DoGetBestSize() const -{ - wxSize best; - wxBitmap bmp = GetBitmap(); - if ( bmp.Ok() ) - best = wxSize(bmp.GetWidth(), bmp.GetHeight()); - else - // this is completely arbitrary - best = wxSize(16, 16); - CacheBestSize(best); - return best; -} - -#endif // wxUSE_STATBMP - -#endif // wxUSE_CONTROLS diff --git a/wxWidgets/src/common/ctrlsub.cpp b/wxWidgets/src/common/ctrlsub.cpp deleted file mode 100644 index 387b174cc2..0000000000 --- a/wxWidgets/src/common/ctrlsub.cpp +++ /dev/null @@ -1,197 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: src/common/ctrlsub.cpp -// Purpose: wxItemContainer implementation -// Author: Vadim Zeitlin -// Modified by: -// Created: 22.10.99 -// RCS-ID: $Id: ctrlsub.cpp 39077 2006-05-06 19:05:50Z VZ $ -// Copyright: (c) wxWidgets team -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_CONTROLS - -#ifndef WX_PRECOMP - #include "wx/ctrlsub.h" - #include "wx/arrstr.h" -#endif - -IMPLEMENT_ABSTRACT_CLASS(wxControlWithItems, wxControl) - -// ============================================================================ -// wxItemContainerImmutable implementation -// ============================================================================ - -wxItemContainerImmutable::~wxItemContainerImmutable() -{ - // this destructor is required for Darwin -} - -// ---------------------------------------------------------------------------- -// selection -// ---------------------------------------------------------------------------- - -wxString wxItemContainerImmutable::GetStringSelection() const -{ - wxString s; - - int sel = GetSelection(); - if ( sel != wxNOT_FOUND ) - s = GetString((unsigned int)sel); - - return s; -} - -bool wxItemContainerImmutable::SetStringSelection(const wxString& s) -{ - const int sel = FindString(s); - if ( sel == wxNOT_FOUND ) - return false; - - SetSelection(sel); - - return true; -} - -wxArrayString wxItemContainerImmutable::GetStrings() const -{ - wxArrayString result; - - const unsigned int count = GetCount(); - result.Alloc(count); - for ( unsigned int n = 0; n < count; n++ ) - result.Add(GetString(n)); - - return result; -} - -// ============================================================================ -// wxItemContainer implementation -// ============================================================================ - -wxItemContainer::~wxItemContainer() -{ - // this destructor is required for Darwin -} - -// ---------------------------------------------------------------------------- -// appending items -// ---------------------------------------------------------------------------- - -void wxItemContainer::Append(const wxArrayString& strings) -{ - const size_t count = strings.GetCount(); - for ( size_t n = 0; n < count; n++ ) - { - Append(strings[n]); - } -} - -int wxItemContainer::Insert(const wxString& item, unsigned int pos, void *clientData) -{ - int n = DoInsert(item, pos); - if ( n != wxNOT_FOUND ) - SetClientData(n, clientData); - - return n; -} - -int wxItemContainer::Insert(const wxString& item, unsigned int pos, wxClientData *clientData) -{ - int n = DoInsert(item, pos); - if ( n != wxNOT_FOUND ) - SetClientObject(n, clientData); - - return n; -} - -// ---------------------------------------------------------------------------- -// client data -// ---------------------------------------------------------------------------- - -void wxItemContainer::SetClientObject(unsigned int n, wxClientData *data) -{ - wxASSERT_MSG( m_clientDataItemsType != wxClientData_Void, - wxT("can't have both object and void client data") ); - - // when we call SetClientObject() for the first time, m_clientDataItemsType - // is still wxClientData_None and so calling DoGetItemClientObject() would - // fail (in addition to being useless) - don't do it - if ( m_clientDataItemsType == wxClientData_Object ) - { - wxClientData *clientDataOld = DoGetItemClientObject(n); - if ( clientDataOld ) - delete clientDataOld; - } - else // m_clientDataItemsType == wxClientData_None - { - // now we have object client data - m_clientDataItemsType = wxClientData_Object; - } - - DoSetItemClientObject(n, data); -} - -wxClientData *wxItemContainer::GetClientObject(unsigned int n) const -{ - wxASSERT_MSG( m_clientDataItemsType == wxClientData_Object, - wxT("this window doesn't have object client data") ); - - return DoGetItemClientObject(n); -} - -void wxItemContainer::SetClientData(unsigned int n, void *data) -{ - wxASSERT_MSG( m_clientDataItemsType != wxClientData_Object, - wxT("can't have both object and void client data") ); - - DoSetItemClientData(n, data); - m_clientDataItemsType = wxClientData_Void; -} - -void *wxItemContainer::GetClientData(unsigned int n) const -{ - wxASSERT_MSG( m_clientDataItemsType == wxClientData_Void, - wxT("this window doesn't have void client data") ); - - return DoGetItemClientData(n); -} - -// ============================================================================ -// wxControlWithItems implementation -// ============================================================================ - -void wxControlWithItems::InitCommandEventWithItems(wxCommandEvent& event, int n) -{ - InitCommandEvent(event); - - if ( n != wxNOT_FOUND ) - { - if ( HasClientObjectData() ) - event.SetClientObject(GetClientObject(n)); - else if ( HasClientUntypedData() ) - event.SetClientData(GetClientData(n)); - } -} - -wxControlWithItems::~wxControlWithItems() -{ - // this destructor is required for Darwin -} - -#endif // wxUSE_CONTROLS diff --git a/wxWidgets/src/common/datacmn.cpp b/wxWidgets/src/common/datacmn.cpp deleted file mode 100644 index e82b5ead59..0000000000 --- a/wxWidgets/src/common/datacmn.cpp +++ /dev/null @@ -1,83 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: common/datacmn.cpp -// Purpose: contains definitions of various global wxWidgets variables -// Author: Vadim Zeitlin -// Modified by: -// Created: 10.04.03 (from src/*/data.cpp files) -// RCS-ID: $Id: datacmn.cpp 43874 2006-12-09 14:52:59Z VZ $ -// Copyright: (c) 1997-2002 wxWidgets development team -// 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 -#endif // WX_PRECOMP - -#include "wx/accel.h" - -// ============================================================================ -// implementation -// ============================================================================ - -// 'Null' objects -#if wxUSE_ACCEL -wxAcceleratorTable wxNullAcceleratorTable; -#endif // wxUSE_ACCEL - -// Default window names -extern WXDLLEXPORT_DATA(const wxChar) wxButtonNameStr[] = wxT("button"); -extern WXDLLEXPORT_DATA(const wxChar) wxCheckBoxNameStr[] = wxT("check"); -extern WXDLLEXPORT_DATA(const wxChar) wxComboBoxNameStr[] = wxT("comboBox"); -extern WXDLLEXPORT_DATA(const wxChar) wxDialogNameStr[] = wxT("dialog"); -extern WXDLLEXPORT_DATA(const wxChar) wxFrameNameStr[] = wxT("frame"); -extern WXDLLEXPORT_DATA(const wxChar) wxStaticBoxNameStr[] = wxT("groupBox"); -extern WXDLLEXPORT_DATA(const wxChar) wxListBoxNameStr[] = wxT("listBox"); -extern WXDLLEXPORT_DATA(const wxChar) wxStaticLineNameStr[] = wxT("staticLine"); -extern WXDLLEXPORT_DATA(const wxChar) wxStaticTextNameStr[] = wxT("staticText"); -extern WXDLLEXPORT_DATA(const wxChar) wxStaticBitmapNameStr[] = wxT("staticBitmap"); -extern WXDLLEXPORT_DATA(const wxChar) wxNotebookNameStr[] = wxT("notebook"); -extern WXDLLEXPORT_DATA(const wxChar) wxPanelNameStr[] = wxT("panel"); -extern WXDLLEXPORT_DATA(const wxChar) wxRadioBoxNameStr[] = wxT("radioBox"); -extern WXDLLEXPORT_DATA(const wxChar) wxRadioButtonNameStr[] = wxT("radioButton"); -extern WXDLLEXPORT_DATA(const wxChar) wxBitmapRadioButtonNameStr[] = wxT("radioButton"); -extern WXDLLEXPORT_DATA(const wxChar) wxScrollBarNameStr[] = wxT("scrollBar"); -extern WXDLLEXPORT_DATA(const wxChar) wxSliderNameStr[] = wxT("slider"); -extern WXDLLEXPORT_DATA(const wxChar) wxStatusLineNameStr[] = wxT("status_line"); -extern WXDLLEXPORT_DATA(const wxChar) wxTextCtrlNameStr[] = wxT("text"); -extern WXDLLEXPORT_DATA(const wxChar) wxTreeCtrlNameStr[] = wxT("treeCtrl"); -extern WXDLLEXPORT_DATA(const wxChar) wxToolBarNameStr[] = wxT("toolbar"); - -// Default messages -extern WXDLLEXPORT_DATA(const wxChar) wxMessageBoxCaptionStr[] = wxT("Message"); -extern WXDLLEXPORT_DATA(const wxChar) wxFileSelectorPromptStr[] = wxT("Select a file"); -extern WXDLLEXPORT_DATA(const wxChar) wxDirSelectorPromptStr[] = wxT("Select a directory"); - -// Other default strings -extern WXDLLEXPORT_DATA(const wxChar) wxFileSelectorDefaultWildcardStr[] = -#if defined(__WXMSW__) || defined(__OS2__) - wxT("*.*") -#else // Unix/Mac - wxT("*") -#endif - ; -extern WXDLLEXPORT_DATA(const wxChar) wxDirDialogNameStr[] = wxT("wxDirCtrl"); -extern WXDLLEXPORT_DATA(const wxChar) wxDirDialogDefaultFolderStr[] = wxT("/"); - -extern WXDLLEXPORT_DATA(const wxChar) wxFileDialogNameStr[] = wxT("filedlg"); -#if defined(__WXMSW__) || defined(__OS2__) -WXDLLEXPORT_DATA(const wxChar *) wxUserResourceStr = wxT("TEXT"); -#endif diff --git a/wxWidgets/src/common/datavcmn.cpp b/wxWidgets/src/common/datavcmn.cpp deleted file mode 100644 index 00c4cc26fb..0000000000 --- a/wxWidgets/src/common/datavcmn.cpp +++ /dev/null @@ -1,911 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/common/datavcmn.cpp -// Purpose: wxDataViewCtrl base classes and common parts -// Author: Robert Roebling -// Created: 2006/02/20 -// RCS-ID: $Id: datavcmn.cpp 41670 2006-10-07 14:15:53Z RR $ -// Copyright: (c) 2006, Robert Roebling -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_DATAVIEWCTRL - -#include "wx/dataview.h" - -#ifndef WX_PRECOMP - #include "wx/log.h" -#endif - -const wxChar wxDataViewCtrlNameStr[] = wxT("dataviewCtrl"); - -// --------------------------------------------------------- -// wxDataViewModel -// --------------------------------------------------------- - -IMPLEMENT_ABSTRACT_CLASS(wxDataViewModel, wxObject) - -// --------------------------------------------------------- -// wxDataViewListModel -// --------------------------------------------------------- - -IMPLEMENT_ABSTRACT_CLASS(wxDataViewListModel, wxDataViewModel) - -wxDataViewListModel::wxDataViewListModel() -{ - m_viewingColumns.DeleteContents( true ); - m_notifiers.DeleteContents( true ); -} - -wxDataViewListModel::~wxDataViewListModel() -{ -} - -bool wxDataViewListModel::RowAppended() -{ - bool ret = true; - - wxList::compatibility_iterator node = m_notifiers.GetFirst(); - while (node) - { - wxDataViewListModelNotifier* notifier = (wxDataViewListModelNotifier*) node->GetData(); - if (!notifier->RowAppended()) - ret = false; - node = node->GetNext(); - } - - return ret; -} - -bool wxDataViewListModel::RowPrepended() -{ - bool ret = true; - - wxList::compatibility_iterator node = m_notifiers.GetFirst(); - while (node) - { - wxDataViewListModelNotifier* notifier = (wxDataViewListModelNotifier*) node->GetData(); - if (!notifier->RowPrepended()) - ret = false; - node = node->GetNext(); - } - - return ret; -} - -bool wxDataViewListModel::RowInserted( unsigned int before ) -{ - bool ret = true; - - wxList::compatibility_iterator node = m_notifiers.GetFirst(); - while (node) - { - wxDataViewListModelNotifier* notifier = (wxDataViewListModelNotifier*) node->GetData(); - if (!notifier->RowInserted(before)) - ret = false; - node = node->GetNext(); - } - - return ret; -} - -bool wxDataViewListModel::RowDeleted( unsigned int row ) -{ - bool ret = true; - - wxList::compatibility_iterator node = m_notifiers.GetFirst(); - while (node) - { - wxDataViewListModelNotifier* notifier = (wxDataViewListModelNotifier*) node->GetData(); - if (!notifier->RowDeleted( row )) - ret = false; - node = node->GetNext(); - } - - return ret; -} - -bool wxDataViewListModel::RowChanged( unsigned int row ) -{ - bool ret = true; - - wxList::compatibility_iterator node = m_notifiers.GetFirst(); - while (node) - { - wxDataViewListModelNotifier* notifier = (wxDataViewListModelNotifier*) node->GetData(); - if (!notifier->RowChanged( row )) - ret = false; - node = node->GetNext(); - } - - return ret; -} - -bool wxDataViewListModel::ValueChanged( unsigned int col, unsigned int row ) -{ - bool ret = true; - - wxList::compatibility_iterator node = m_notifiers.GetFirst(); - while (node) - { - wxDataViewListModelNotifier* notifier = (wxDataViewListModelNotifier*) node->GetData(); - if (!notifier->ValueChanged( col, row )) - ret = false; - node = node->GetNext(); - } - - return ret; -} - -bool wxDataViewListModel::RowsReordered( unsigned int *new_order ) -{ - bool ret = true; - - wxList::compatibility_iterator node = m_notifiers.GetFirst(); - while (node) - { - wxDataViewListModelNotifier* notifier = (wxDataViewListModelNotifier*) node->GetData(); - if (!notifier->RowsReordered( new_order )) - ret = false; - node = node->GetNext(); - } - - return ret; -} - -bool wxDataViewListModel::Cleared() -{ - bool ret = true; - - wxList::compatibility_iterator node = m_notifiers.GetFirst(); - while (node) - { - wxDataViewListModelNotifier* notifier = (wxDataViewListModelNotifier*) node->GetData(); - if (!notifier->Cleared()) - ret = false; - node = node->GetNext(); - } - - return ret; -} - -void wxDataViewListModel::AddViewingColumn( wxDataViewColumn *view_column, unsigned int model_column ) -{ - m_viewingColumns.Append( new wxDataViewViewingColumn( view_column, model_column ) ); -} - -void wxDataViewListModel::RemoveViewingColumn( wxDataViewColumn *column ) -{ - wxList::compatibility_iterator node = m_viewingColumns.GetFirst(); - while (node) - { - wxDataViewViewingColumn* tmp = (wxDataViewViewingColumn*) node->GetData(); - - if (tmp->m_viewColumn == column) - { - m_viewingColumns.DeleteObject( tmp ); - return; - } - - node = node->GetNext(); - } -} - -void wxDataViewListModel::AddNotifier( wxDataViewListModelNotifier *notifier ) -{ - m_notifiers.Append( notifier ); - notifier->SetOwner( this ); -} - -void wxDataViewListModel::RemoveNotifier( wxDataViewListModelNotifier *notifier ) -{ - m_notifiers.DeleteObject( notifier ); -} - -// --------------------------------------------------------- -// wxDataViewSortedListModelNotifier -// --------------------------------------------------------- - -class wxDataViewSortedListModelNotifier: public wxDataViewListModelNotifier -{ -public: - wxDataViewSortedListModelNotifier( wxDataViewSortedListModel *model ) - { m_model = model; } - - virtual bool RowAppended() - { return m_model->ChildRowAppended(); } - - virtual bool RowPrepended() - { return m_model->ChildRowPrepended(); } - - virtual bool RowInserted( unsigned int before ) - { return m_model->ChildRowInserted( before ); } - - virtual bool RowDeleted( unsigned int row ) - { return m_model->ChildRowDeleted( row ); } - - virtual bool RowChanged( unsigned int row ) - { return m_model->ChildRowChanged( row ); } - - virtual bool ValueChanged( unsigned int col, unsigned int row ) - { return m_model->ChildValueChanged( col, row); } - - virtual bool RowsReordered( unsigned int *new_order ) - { return m_model->ChildRowsReordered( new_order ); } - - virtual bool Cleared() - { return m_model->ChildCleared(); } - - wxDataViewSortedListModel *m_model; -}; - -// --------------------------------------------------------- -// wxDataViewSortedListModel compare function -// --------------------------------------------------------- - -int wxCALLBACK wxDataViewListModelSortedDefaultCompare - (unsigned int row1, unsigned int row2, unsigned int col, wxDataViewListModel* model ) -{ - wxVariant value1,value2; - model->GetValue( value1, col, row1 ); - model->GetValue( value2, col, row2 ); - if (value1.GetType() == wxT("string")) - { - wxString str1 = value1.GetString(); - wxString str2 = value2.GetString(); - return str1.Cmp( str2 ); - } - if (value1.GetType() == wxT("long")) - { - long l1 = value1.GetLong(); - long l2 = value2.GetLong(); - return l1-l2; - } - if (value1.GetType() == wxT("double")) - { - double d1 = value1.GetDouble(); - double d2 = value2.GetDouble(); - if (d1 == d2) return 0; - if (d1 < d2) return 1; - return -1; - } - if (value1.GetType() == wxT("datetime")) - { - wxDateTime dt1 = value1.GetDateTime(); - wxDateTime dt2 = value2.GetDateTime(); - if (dt1.IsEqualTo(dt2)) return 0; - if (dt1.IsEarlierThan(dt2)) return 1; - return -1; - } - - return 0; -} - -int wxCALLBACK wxDataViewListModelSortedDefaultCompareDescending - (unsigned int row1, unsigned int row2, unsigned int col, wxDataViewListModel* model ) -{ - return wxDataViewListModelSortedDefaultCompare( row2, row1, col, model ); -} - -static wxDataViewListModelCompare s_CmpFunc; -static wxDataViewListModel *s_CmpModel; -static unsigned int s_CmpCol; - -int LINKAGEMODE wxDataViewIntermediateCmp( unsigned int row1, unsigned int row2 ) -{ - return s_CmpFunc( row1, row2, s_CmpCol, s_CmpModel ); -} - -// --------------------------------------------------------- -// wxDataViewSortedListModel -// --------------------------------------------------------- - -IMPLEMENT_ABSTRACT_CLASS(wxDataViewSortedListModel, wxDataViewListModel) - -wxDataViewSortedListModel::wxDataViewSortedListModel( wxDataViewListModel *child ) : - m_array( wxDataViewIntermediateCmp ) -{ - m_child = child; - - m_ascending = true; - - m_notifierOnChild = new wxDataViewSortedListModelNotifier( this ); - m_child->AddNotifier( m_notifierOnChild ); - - Resort(); -} - -wxDataViewSortedListModel::~wxDataViewSortedListModel() -{ - m_child->RemoveNotifier( m_notifierOnChild ); -} - -// FIXME -void wxDataViewSortedListModel::InitStatics() -{ - s_CmpCol = 0; - s_CmpModel = m_child; - if (m_ascending) - s_CmpFunc = wxDataViewListModelSortedDefaultCompare; - else - s_CmpFunc = wxDataViewListModelSortedDefaultCompareDescending; -} - -void wxDataViewSortedListModel::Resort() -{ - InitStatics(); - - m_array.Clear(); - unsigned int n = m_child->GetNumberOfRows(); - unsigned int i; - for (i = 0; i < n; i++) - m_array.Add( i ); -} - -#if 0 -static void Dump( wxDataViewListModel *model, unsigned int col ) -{ - unsigned int n = model->GetNumberOfRows(); - unsigned int i; - for (i = 0; i < n; i++) - { - wxVariant variant; - model->GetValue( variant, col, i ); - wxString tmp; - tmp = variant.GetString(); - wxPrintf( wxT("%d: %s\n"), (int) i, tmp.c_str() ); - } -} -#endif - -bool wxDataViewSortedListModel::ChildRowAppended() -{ - // no need to fix up array - - unsigned int len = m_array.GetCount(); - - unsigned int pos = m_array.Add( len ); - - if (pos == 0) - return wxDataViewListModel::RowPrepended(); - - if (pos == len) - return wxDataViewListModel::RowAppended(); - - return wxDataViewListModel::RowInserted( pos ); -} - -bool wxDataViewSortedListModel::ChildRowPrepended() -{ - // fix up array - unsigned int i; - unsigned int len = m_array.GetCount(); - for (i = 0; i < len; i++) - { - unsigned int value = m_array[i]; - m_array[i] = value+1; - } - - unsigned int pos = m_array.Add( 0 ); - - if (pos == 0) - return wxDataViewListModel::RowPrepended(); - - if (pos == len) - return wxDataViewListModel::RowAppended(); - - return wxDataViewListModel::RowInserted( pos ); -} - -bool wxDataViewSortedListModel::ChildRowInserted( unsigned int before ) -{ - // fix up array - unsigned int i; - unsigned int len = m_array.GetCount(); - for (i = 0; i < len; i++) - { - unsigned int value = m_array[i]; - if (value >= before) - m_array[i] = value+1; - } - - unsigned int pos = m_array.Add( before ); - - if (pos == 0) - return wxDataViewListModel::RowPrepended(); - - if (pos == len) - return wxDataViewListModel::RowAppended(); - - return wxDataViewListModel::RowInserted( pos ); -} - -bool wxDataViewSortedListModel::ChildRowDeleted( unsigned int row ) -{ - unsigned int i; - unsigned int len = m_array.GetCount(); - int pos = -1; - for (i = 0; i < len; i++) - { - unsigned int value = m_array[i]; - if (value == row) - { - // delete later - pos = (int) i; - } - else - { - // Fix up array - if (value > row) - m_array[i] = value-1; - } - } - - if (pos == -1) - return false; // we should probably assert - - // remove - m_array.RemoveAt( (unsigned int) pos ); - - return wxDataViewListModel::RowDeleted( (unsigned int) pos); -} - -bool wxDataViewSortedListModel::ChildRowChanged( unsigned int row ) -{ - unsigned int i; - unsigned int len = m_array.GetCount(); - - // Remove and readd sorted. Find out at which - // position it was and where it ended. - unsigned int start_pos = 0,end_pos = 0; - for (i = 0; i < len; i++) - if (m_array[i] == row) - { - start_pos = i; - break; - } - m_array.RemoveAt( start_pos ); - m_array.Add( row ); - - for (i = 0; i < len; i++) - if (m_array[i] == row) - { - end_pos = i; - break; - } - - if (end_pos == start_pos) - return wxDataViewListModel::RowChanged( start_pos ); - - // Create an array where order[old] -> new_pos, so that - // if nothing changed order[0] -> 0 etc. - unsigned int *order = new unsigned int[ len ]; - // Fill up initial values. - for (i = 0; i < len; i++) - order[i] = i; - - if (start_pos < end_pos) - { - for (i = start_pos; i < end_pos; i++) - order[i] = order[i+1]; - order[end_pos] = start_pos; - } - else - { - for (i = end_pos; i > start_pos; i--) - order[i] = order[i-1]; - order[start_pos] = end_pos; - } - - wxDataViewListModel::RowsReordered( order ); - - delete [] order; - - return true; -} - -bool wxDataViewSortedListModel::ChildValueChanged( unsigned int col, unsigned int row ) -{ - unsigned int i; - unsigned int len = m_array.GetCount(); - - // Remove and readd sorted. Find out at which - // position it was and where it ended. - unsigned int start_pos = 0,end_pos = 0; - for (i = 0; i < len; i++) - if (m_array[i] == row) - { - start_pos = i; - break; - } - m_array.RemoveAt( start_pos ); - m_array.Add( row ); - - for (i = 0; i < len; i++) - if (m_array[i] == row) - { - end_pos = i; - break; - } - - if (end_pos == start_pos) - return wxDataViewListModel::ValueChanged( col, start_pos ); - - // Create an array where order[old] -> new_pos, so that - // if nothing changed order[0] -> 0 etc. - unsigned int *order = new unsigned int[ len ]; - // Fill up initial values. - for (i = 0; i < len; i++) - order[i] = i; - - if (start_pos < end_pos) - { - for (i = start_pos; i < end_pos; i++) - order[i] = order[i+1]; - order[end_pos] = start_pos; - } - else - { - for (i = end_pos; i > start_pos; i--) - order[i] = order[i-1]; - order[start_pos] = end_pos; - } - - wxDataViewListModel::RowsReordered( order ); - - delete [] order; - - return true; -} - -bool wxDataViewSortedListModel::ChildRowsReordered( unsigned int *WXUNUSED(new_order) ) -{ - // Nothing needs to be done. If the sort criteria - // of this list don't change, the order of the - // items of the child list isn't relevant. - return true; -} - -bool wxDataViewSortedListModel::ChildCleared() -{ - return wxDataViewListModel::Cleared(); -} - -unsigned int wxDataViewSortedListModel::GetNumberOfRows() -{ - return m_array.GetCount(); -} - -unsigned int wxDataViewSortedListModel::GetNumberOfCols() -{ - return m_child->GetNumberOfCols(); -} - -wxString wxDataViewSortedListModel::GetColType( unsigned int col ) -{ - return m_child->GetColType( col ); -} - -void wxDataViewSortedListModel::GetValue( wxVariant &variant, unsigned int col, unsigned int row ) -{ - unsigned int child_row = m_array[row]; - m_child->GetValue( variant, col, child_row ); -} - -bool wxDataViewSortedListModel::SetValue( wxVariant &variant, unsigned int col, unsigned int row ) -{ - unsigned int child_row = m_array[row]; - bool ret = m_child->SetValue( variant, col, child_row ); - - // Do nothing here as the change in the - // child model will be reported back. - - return ret; -} - -bool wxDataViewSortedListModel::RowAppended() -{ - // you can only append - bool ret = m_child->RowAppended(); - - // Do nothing here as the change in the - // child model will be reported back. - - return ret; -} - -bool wxDataViewSortedListModel::RowPrepended() -{ - // you can only append - bool ret = m_child->RowAppended(); - - // Do nothing here as the change in the - // child model will be reported back. - - return ret; -} - -bool wxDataViewSortedListModel::RowInserted( unsigned int WXUNUSED(before) ) -{ - // you can only append - bool ret = m_child->RowAppended(); - - // Do nothing here as the change in the - // child model will be reported back. - - return ret; -} - -bool wxDataViewSortedListModel::RowDeleted( unsigned int row ) -{ - unsigned int child_row = m_array[row]; - - bool ret = m_child->RowDeleted( child_row ); - - // Do nothing here as the change in the - // child model will be reported back. - - return ret; -} - -bool wxDataViewSortedListModel::RowChanged( unsigned int row ) -{ - unsigned int child_row = m_array[row]; - bool ret = m_child->RowChanged( child_row ); - - // Do nothing here as the change in the - // child model will be reported back. - - return ret; -} - -bool wxDataViewSortedListModel::ValueChanged( unsigned int col, unsigned int row ) -{ - unsigned int child_row = m_array[row]; - bool ret = m_child->ValueChanged( col, child_row ); - - // Do nothing here as the change in the - // child model will be reported back. - - return ret; -} - -bool wxDataViewSortedListModel::RowsReordered( unsigned int *WXUNUSED(new_order) ) -{ - // We sort them ourselves. - - return false; -} - -bool wxDataViewSortedListModel::Cleared() -{ - bool ret = m_child->Cleared(); - - // Do nothing here as the change in the - // child model will be reported back. - - return ret; -} - -// --------------------------------------------------------- -// wxDataViewRendererBase -// --------------------------------------------------------- - -IMPLEMENT_ABSTRACT_CLASS(wxDataViewRendererBase, wxObject) - -wxDataViewRendererBase::wxDataViewRendererBase( const wxString &varianttype, wxDataViewCellMode mode ) -{ - m_variantType = varianttype; - m_mode = mode; -} - -// --------------------------------------------------------- -// wxDataViewColumnBase -// --------------------------------------------------------- - -IMPLEMENT_ABSTRACT_CLASS(wxDataViewColumnBase, wxObject) - -wxDataViewColumnBase::wxDataViewColumnBase(const wxString& title, - wxDataViewRenderer *renderer, - unsigned int model_column, - int WXUNUSED(width), - int flags ) -{ - m_renderer = renderer; - m_model_column = model_column; - m_flags = flags; - m_title = title; - m_owner = NULL; - m_renderer->SetOwner( (wxDataViewColumn*) this ); -} - -wxDataViewColumnBase::wxDataViewColumnBase(const wxBitmap& bitmap, - wxDataViewRenderer *renderer, - unsigned int model_column, - int WXUNUSED(width), - int flags ) -{ - m_renderer = renderer; - m_model_column = model_column; - m_flags = flags; - m_bitmap = bitmap; - m_owner = NULL; - m_renderer->SetOwner( (wxDataViewColumn*) this ); -} - -wxDataViewColumnBase::~wxDataViewColumnBase() -{ - if (m_renderer) - delete m_renderer; - - if (GetOwner()) - { - GetOwner()->GetModel()->RemoveViewingColumn( (wxDataViewColumn*) this ); - } -} - -void wxDataViewColumnBase::SetTitle( const wxString &title ) -{ - m_title = title; -} - -wxString wxDataViewColumnBase::GetTitle() -{ - return m_title; -} - -void wxDataViewColumnBase::SetBitmap( const wxBitmap &bitmap ) -{ - m_bitmap = bitmap; -} - -const wxBitmap &wxDataViewColumnBase::GetBitmap() -{ - return m_bitmap; -} - -// --------------------------------------------------------- -// wxDataViewCtrlBase -// --------------------------------------------------------- - -IMPLEMENT_ABSTRACT_CLASS(wxDataViewCtrlBase, wxControl) - -wxDataViewCtrlBase::wxDataViewCtrlBase() -{ - m_model = NULL; - m_cols.DeleteContents( true ); -} - -wxDataViewCtrlBase::~wxDataViewCtrlBase() -{ -} - -bool wxDataViewCtrlBase::AssociateModel( wxDataViewListModel *model ) -{ - m_model = model; - - return true; -} - -wxDataViewListModel* wxDataViewCtrlBase::GetModel() -{ - return m_model; -} - -bool wxDataViewCtrlBase::AppendTextColumn( const wxString &label, unsigned int model_column, - wxDataViewCellMode mode, int width ) -{ - return AppendColumn( new wxDataViewColumn( label, - new wxDataViewTextRenderer( wxT("string"), mode ), model_column, width ) ); -} - -bool wxDataViewCtrlBase::AppendToggleColumn( const wxString &label, unsigned int model_column, - wxDataViewCellMode mode, int width ) -{ - return AppendColumn( new wxDataViewColumn( label, - new wxDataViewToggleRenderer( wxT("bool"), mode ), model_column, width ) ); -} - -bool wxDataViewCtrlBase::AppendProgressColumn( const wxString &label, unsigned int model_column, - wxDataViewCellMode mode, int width ) -{ - return AppendColumn( new wxDataViewColumn( label, - new wxDataViewProgressRenderer( wxEmptyString, wxT("long"), mode ), model_column, width ) ); -} - -bool wxDataViewCtrlBase::AppendDateColumn( const wxString &label, unsigned int model_column, - wxDataViewCellMode mode, int width ) -{ - return AppendColumn( new wxDataViewColumn( label, - new wxDataViewDateRenderer( wxT("datetime"), mode), model_column, width ) ); -} - -bool wxDataViewCtrlBase::AppendBitmapColumn( const wxString &label, unsigned int model_column, - wxDataViewCellMode mode, int width ) -{ - return AppendColumn( new wxDataViewColumn( label, - new wxDataViewBitmapRenderer( wxT("wxBitmap"), mode ), model_column, width ) ); -} - -bool wxDataViewCtrlBase::AppendTextColumn( const wxBitmap &label, unsigned int model_column, - wxDataViewCellMode mode, int width ) -{ - return AppendColumn( new wxDataViewColumn( label, - new wxDataViewTextRenderer( wxT("string"), mode ), model_column, width ) ); -} - -bool wxDataViewCtrlBase::AppendToggleColumn( const wxBitmap &label, unsigned int model_column, - wxDataViewCellMode mode, int width ) -{ - return AppendColumn( new wxDataViewColumn( label, - new wxDataViewToggleRenderer( wxT("bool"), mode ), model_column, width ) ); -} - -bool wxDataViewCtrlBase::AppendProgressColumn( const wxBitmap &label, unsigned int model_column, - wxDataViewCellMode mode, int width ) -{ - return AppendColumn( new wxDataViewColumn( label, - new wxDataViewProgressRenderer( wxEmptyString, wxT("long"), mode ), model_column, width ) ); -} - -bool wxDataViewCtrlBase::AppendDateColumn( const wxBitmap &label, unsigned int model_column, - wxDataViewCellMode mode, int width ) -{ - return AppendColumn( new wxDataViewColumn( label, - new wxDataViewDateRenderer( wxT("datetime"), mode ), model_column, width ) ); -} - -bool wxDataViewCtrlBase::AppendBitmapColumn( const wxBitmap &label, unsigned int model_column, - wxDataViewCellMode mode, int width ) -{ - return AppendColumn( new wxDataViewColumn( label, - new wxDataViewBitmapRenderer( wxT("wxBitmap"), mode ), model_column, width ) ); -} - -bool wxDataViewCtrlBase::AppendColumn( wxDataViewColumn *col ) -{ - m_cols.Append( (wxObject*) col ); - col->SetOwner( (wxDataViewCtrl*) this ); - m_model->AddViewingColumn( col, col->GetModelColumn() ); - return true; -} - -unsigned int wxDataViewCtrlBase::GetNumberOfColumns() -{ - return m_cols.GetCount(); -} - -bool wxDataViewCtrlBase::DeleteColumn( unsigned int WXUNUSED(pos) ) -{ - return false; -} - -bool wxDataViewCtrlBase::ClearColumns() -{ - return false; -} - -wxDataViewColumn* wxDataViewCtrlBase::GetColumn( unsigned int pos ) -{ - return (wxDataViewColumn*) m_cols[ pos ]; -} - -// --------------------------------------------------------- -// wxDataViewEvent -// --------------------------------------------------------- - -IMPLEMENT_DYNAMIC_CLASS(wxDataViewEvent,wxNotifyEvent) - -DEFINE_EVENT_TYPE(wxEVT_COMMAND_DATAVIEW_ROW_SELECTED) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_DATAVIEW_ROW_ACTIVATED) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_DATAVIEW_COLUMN_HEADER_CLICK) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_DATAVIEW_COLUMN_HEADER_RIGHT_CLICK) - - -#endif diff --git a/wxWidgets/src/common/datetime.cpp b/wxWidgets/src/common/datetime.cpp deleted file mode 100644 index 30db343e87..0000000000 --- a/wxWidgets/src/common/datetime.cpp +++ /dev/null @@ -1,4615 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: src/common/datetime.cpp -// Purpose: implementation of time/date related classes -// Author: Vadim Zeitlin -// Modified by: -// Created: 11.05.99 -// RCS-ID: $Id: datetime.cpp 65730 2010-10-02 16:50:34Z TIK $ -// Copyright: (c) 1999 Vadim Zeitlin -// parts of code taken from sndcal library by Scott E. Lee: -// -// Copyright 1993-1995, Scott E. Lee, all rights reserved. -// Permission granted to use, copy, modify, distribute and sell -// so long as the above copyright and this permission statement -// are retained in all copies. -// -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -/* - * Implementation notes: - * - * 1. the time is stored as a 64bit integer containing the signed number of - * milliseconds since Jan 1. 1970 (the Unix Epoch) - so it is always - * expressed in GMT. - * - * 2. the range is thus something about 580 million years, but due to current - * algorithms limitations, only dates from Nov 24, 4714BC are handled - * - * 3. standard ANSI C functions are used to do time calculations whenever - * possible, i.e. when the date is in the range Jan 1, 1970 to 2038 - * - * 4. otherwise, the calculations are done by converting the date to/from JDN - * first (the range limitation mentioned above comes from here: the - * algorithm used by Scott E. Lee's code only works for positive JDNs, more - * or less) - * - * 5. the object constructed for the given DD-MM-YYYY HH:MM:SS corresponds to - * this moment in local time and may be converted to the object - * corresponding to the same date/time in another time zone by using - * ToTimezone() - * - * 6. the conversions to the current (or any other) timezone are done when the - * internal time representation is converted to the broken-down one in - * wxDateTime::Tm. - */ - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if !defined(wxUSE_DATETIME) || wxUSE_DATETIME - -#ifndef WX_PRECOMP - #ifdef __WXMSW__ - #include "wx/msw/wrapwin.h" - #endif - #include "wx/string.h" - #include "wx/log.h" - #include "wx/intl.h" - #include "wx/stopwatch.h" // for wxGetLocalTimeMillis() - #include "wx/module.h" -#endif // WX_PRECOMP - -#include "wx/thread.h" -#include "wx/tokenzr.h" - -#include - -#ifdef __WINDOWS__ - #include - #ifndef __WXWINCE__ - #include - #endif -#endif - -#include "wx/datetime.h" - -const long wxDateTime::TIME_T_FACTOR = 1000l; - -#if wxUSE_EXTENDED_RTTI - -template<> void wxStringReadValue(const wxString &s , wxDateTime &data ) -{ - data.ParseFormat(s,wxT("%Y-%m-%d %H:%M:%S")) ; -} - -template<> void wxStringWriteValue(wxString &s , const wxDateTime &data ) -{ - s = data.Format(wxT("%Y-%m-%d %H:%M:%S")) ; -} - -wxCUSTOM_TYPE_INFO(wxDateTime, wxToStringConverter , wxFromStringConverter) - -#endif - -// -// ---------------------------------------------------------------------------- -// conditional compilation -// ---------------------------------------------------------------------------- - -#if defined(HAVE_STRPTIME) && defined(__GLIBC__) && \ - ((__GLIBC__ == 2) && (__GLIBC_MINOR__ == 0)) - // glibc 2.0.7 strptime() is broken - the following snippet causes it to - // crash (instead of just failing): - // - // strncpy(buf, "Tue Dec 21 20:25:40 1999", 128); - // strptime(buf, "%x", &tm); - // - // so don't use it - #undef HAVE_STRPTIME -#endif // broken strptime() - -#if defined(HAVE_STRPTIME) && defined(__DARWIN__) && defined(_MSL_USING_MW_C_HEADERS) && _MSL_USING_MW_C_HEADERS - // configure detects strptime as linkable because it's in the OS X - // System library but MSL headers don't declare it. - -// char *strptime(const char *, const char *, struct tm *); - // However, we DON'T want to just provide it here because we would - // crash and/or overwrite data when strptime from OS X tries - // to fill in MW's struct tm which is two fields shorter (no TZ stuff) - // So for now let's just say we don't have strptime - #undef HAVE_STRPTIME -#endif - -#if defined(__MWERKS__) && wxUSE_UNICODE - #include -#endif - -// define a special symbol for VC8 instead of writing tests for 1400 repeatedly -#ifdef __VISUALC__ - #if __VISUALC__ >= 1400 - #define __VISUALC8__ - #endif -#endif - -#if !defined(WX_TIMEZONE) && !defined(WX_GMTOFF_IN_TM) - #if defined(__WXPALMOS__) - #define WX_GMTOFF_IN_TM - #elif defined(__WXMSW__) - static long wxGetTimeZone() - { - TIME_ZONE_INFORMATION info; - GetTimeZoneInformation(&info); - long timeZone = info.Bias * 60; // convert minutes to seconds - return timeZone; - } - #define WX_TIMEZONE wxGetTimeZone() - #elif defined(__VISAGECPP__) - #define WX_TIMEZONE _timezone - #elif defined(__MWERKS__) - long wxmw_timezone = 28800; - #define WX_TIMEZONE wxmw_timezone - #elif defined(__DARWIN__) - #define WX_GMTOFF_IN_TM - #else // unknown platform - try timezone - #define WX_TIMEZONE timezone - #endif -#endif // !WX_TIMEZONE && !WX_GMTOFF_IN_TM - -// everyone has strftime except Win CE unless VC8 is used -#if !defined(__WXWINCE__) || defined(__VISUALC8__) - #define HAVE_STRFTIME -#endif - -// NB: VC8 safe time functions could/should be used for wxMSW as well probably -#if defined(__WXWINCE__) && defined(__VISUALC8__) - -struct tm *wxLocaltime_r(const time_t *t, struct tm* tm) -{ - __time64_t t64 = *t; - return _localtime64_s(tm, &t64) == 0 ? tm : NULL; -} - -struct tm *wxGmtime_r(const time_t* t, struct tm* tm) -{ - __time64_t t64 = *t; - return _gmtime64_s(tm, &t64) == 0 ? tm : NULL; -} - -#else // !wxWinCE with VC8 - -#if (!defined(HAVE_LOCALTIME_R) || !defined(HAVE_GMTIME_R)) && wxUSE_THREADS && !defined(__WINDOWS__) -static wxMutex timeLock; -#endif - -#ifndef HAVE_LOCALTIME_R -struct tm *wxLocaltime_r(const time_t* ticks, struct tm* temp) -{ -#if wxUSE_THREADS && !defined(__WINDOWS__) - // No need to waste time with a mutex on windows since it's using - // thread local storage for localtime anyway. - wxMutexLocker locker(timeLock); -#endif - - // Borland CRT crashes when passed 0 ticks for some reason, see SF bug 1704438 -#ifdef __BORLANDC__ - if ( !*ticks ) - return NULL; -#endif - - const tm * const t = localtime(ticks); - if ( !t ) - return NULL; - - memcpy(temp, t, sizeof(struct tm)); - return temp; -} -#endif // !HAVE_LOCALTIME_R - -#ifndef HAVE_GMTIME_R -struct tm *wxGmtime_r(const time_t* ticks, struct tm* temp) -{ -#if wxUSE_THREADS && !defined(__WINDOWS__) - // No need to waste time with a mutex on windows since it's - // using thread local storage for gmtime anyway. - wxMutexLocker locker(timeLock); -#endif - -#ifdef __BORLANDC__ - if ( !*ticks ) - return NULL; -#endif - - const tm * const t = gmtime(ticks); - if ( !t ) - return NULL; - - memcpy(temp, gmtime(ticks), sizeof(struct tm)); - return temp; -} -#endif // !HAVE_GMTIME_R - -#endif // wxWinCE with VC8/other platforms - -// ---------------------------------------------------------------------------- -// macros -// ---------------------------------------------------------------------------- - -// debugging helper: just a convenient replacement of wxCHECK() -#define wxDATETIME_CHECK(expr, msg) \ - wxCHECK2_MSG(expr, *this = wxInvalidDateTime; return *this, msg) - -// ---------------------------------------------------------------------------- -// private classes -// ---------------------------------------------------------------------------- - -class wxDateTimeHolidaysModule : public wxModule -{ -public: - virtual bool OnInit() - { - wxDateTimeHolidayAuthority::AddAuthority(new wxDateTimeWorkDays); - - return true; - } - - virtual void OnExit() - { - wxDateTimeHolidayAuthority::ClearAllAuthorities(); - wxDateTimeHolidayAuthority::ms_authorities.clear(); - } - -private: - DECLARE_DYNAMIC_CLASS(wxDateTimeHolidaysModule) -}; - -IMPLEMENT_DYNAMIC_CLASS(wxDateTimeHolidaysModule, wxModule) - -// ---------------------------------------------------------------------------- -// constants -// ---------------------------------------------------------------------------- - -// some trivial ones -static const int MONTHS_IN_YEAR = 12; - -static const int SEC_PER_MIN = 60; - -static const int MIN_PER_HOUR = 60; - -static const int HOURS_PER_DAY = 24; - -static const long SECONDS_PER_DAY = 86400l; - -static const int DAYS_PER_WEEK = 7; - -static const long MILLISECONDS_PER_DAY = 86400000l; - -// this is the integral part of JDN of the midnight of Jan 1, 1970 -// (i.e. JDN(Jan 1, 1970) = 2440587.5) -static const long EPOCH_JDN = 2440587l; - -// used only in asserts -#ifdef __WXDEBUG__ -// the date of JDN -0.5 (as we don't work with fractional parts, this is the -// reference date for us) is Nov 24, 4714BC -static const int JDN_0_YEAR = -4713; -static const int JDN_0_MONTH = wxDateTime::Nov; -static const int JDN_0_DAY = 24; -#endif // __WXDEBUG__ - -// the constants used for JDN calculations -static const long JDN_OFFSET = 32046l; -static const long DAYS_PER_5_MONTHS = 153l; -static const long DAYS_PER_4_YEARS = 1461l; -static const long DAYS_PER_400_YEARS = 146097l; - -// this array contains the cumulated number of days in all previous months for -// normal and leap years -static const wxDateTime::wxDateTime_t gs_cumulatedDays[2][MONTHS_IN_YEAR] = -{ - { 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334 }, - { 0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335 } -}; - -// ---------------------------------------------------------------------------- -// global data -// ---------------------------------------------------------------------------- - -const wxChar * wxDefaultDateTimeFormat = wxT("%c"); -const wxChar * wxDefaultTimeSpanFormat = wxT("%H:%M:%S"); - -// in the fine tradition of ANSI C we use our equivalent of (time_t)-1 to -// indicate an invalid wxDateTime object -const wxDateTime wxDefaultDateTime; - -wxDateTime::Country wxDateTime::ms_country = wxDateTime::Country_Unknown; - -// ---------------------------------------------------------------------------- -// private functions -// ---------------------------------------------------------------------------- - -// debugger helper: shows what the date really is -#ifdef __WXDEBUG__ -extern const wxChar *wxDumpDate(const wxDateTime* dt) -{ - static wxChar buf[128]; - - wxStrcpy(buf, dt->Format(_T("%Y-%m-%d (%a) %H:%M:%S"))); - - return buf; -} -#endif // Debug - -// get the number of days in the given month of the given year -static inline -wxDateTime::wxDateTime_t GetNumOfDaysInMonth(int year, wxDateTime::Month month) -{ - // the number of days in month in Julian/Gregorian calendar: the first line - // is for normal years, the second one is for the leap ones - static wxDateTime::wxDateTime_t daysInMonth[2][MONTHS_IN_YEAR] = - { - { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }, - { 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 } - }; - - return daysInMonth[wxDateTime::IsLeapYear(year)][month]; -} - -// returns the time zone in the C sense, i.e. the difference UTC - local -// (in seconds) -static int GetTimeZone() -{ -#ifdef WX_GMTOFF_IN_TM - // set to true when the timezone is set - static bool s_timezoneSet = false; - static long gmtoffset = LONG_MAX; // invalid timezone - - // ensure that the timezone variable is set by calling wxLocaltime_r - if ( !s_timezoneSet ) - { - // just call wxLocaltime_r() instead of figuring out whether this - // system supports tzset(), _tzset() or something else - time_t t = 0; - struct tm tm; - - wxLocaltime_r(&t, &tm); - s_timezoneSet = true; - - // note that GMT offset is the opposite of time zone and so to return - // consistent results in both WX_GMTOFF_IN_TM and !WX_GMTOFF_IN_TM - // cases we have to negate it - gmtoffset = -tm.tm_gmtoff; - } - return (int)gmtoffset; -#else // !WX_GMTOFF_IN_TM - return WX_TIMEZONE; -#endif // WX_GMTOFF_IN_TM/!WX_GMTOFF_IN_TM -} - -// return the integral part of the JDN for the midnight of the given date (to -// get the real JDN you need to add 0.5, this is, in fact, JDN of the -// noon of the previous day) -static long GetTruncatedJDN(wxDateTime::wxDateTime_t day, - wxDateTime::Month mon, - int year) -{ - // CREDIT: code below is by Scott E. Lee (but bugs are mine) - - // check the date validity - wxASSERT_MSG( - (year > JDN_0_YEAR) || - ((year == JDN_0_YEAR) && (mon > JDN_0_MONTH)) || - ((year == JDN_0_YEAR) && (mon == JDN_0_MONTH) && (day >= JDN_0_DAY)), - _T("date out of range - can't convert to JDN") - ); - - // make the year positive to avoid problems with negative numbers division - year += 4800; - - // months are counted from March here - int month; - if ( mon >= wxDateTime::Mar ) - { - month = mon - 2; - } - else - { - month = mon + 10; - year--; - } - - // now we can simply add all the contributions together - return ((year / 100) * DAYS_PER_400_YEARS) / 4 - + ((year % 100) * DAYS_PER_4_YEARS) / 4 - + (month * DAYS_PER_5_MONTHS + 2) / 5 - + day - - JDN_OFFSET; -} - -#ifdef HAVE_STRFTIME - -// this function is a wrapper around strftime(3) adding error checking -static wxString CallStrftime(const wxChar *format, const tm* tm) -{ - wxChar buf[4096]; - // Create temp wxString here to work around mingw/cygwin bug 1046059 - // http://sourceforge.net/tracker/?func=detail&atid=102435&aid=1046059&group_id=2435 - wxString s; - - if ( !wxStrftime(buf, WXSIZEOF(buf), format, tm) ) - { - // buffer is too small? - wxFAIL_MSG(_T("strftime() failed")); - } - - s = buf; - return s; -} - -#endif // HAVE_STRFTIME - -#ifdef HAVE_STRPTIME - -#if wxUSE_UNIX && !defined(HAVE_STRPTIME_DECL) - // configure detected that we had strptime() but not its declaration, - // provide it ourselves - extern "C" char *strptime(const char *, const char *, struct tm *); -#endif - -// Unicode-friendly strptime() wrapper -static const wxChar * -CallStrptime(const wxChar *input, const char *fmt, tm *tm) -{ - // the problem here is that strptime() returns pointer into the string we - // passed to it while we're really interested in the pointer into the - // original, Unicode, string so we try to transform the pointer back -#if wxUSE_UNICODE - wxCharBuffer inputMB(wxConvertWX2MB(input)); -#else // ASCII - const char * const inputMB = input; -#endif // Unicode/Ascii - - const char *result = strptime(inputMB, fmt, tm); - if ( !result ) - return NULL; - -#if wxUSE_UNICODE - // FIXME: this is wrong in presence of surrogates &c - return input + (result - inputMB.data()); -#else // ASCII - return result; -#endif // Unicode/Ascii -} - -#endif // HAVE_STRPTIME - -// if year and/or month have invalid values, replace them with the current ones -static void ReplaceDefaultYearMonthWithCurrent(int *year, - wxDateTime::Month *month) -{ - struct tm *tmNow = NULL; - struct tm tmstruct; - - if ( *year == wxDateTime::Inv_Year ) - { - tmNow = wxDateTime::GetTmNow(&tmstruct); - - *year = 1900 + tmNow->tm_year; - } - - if ( *month == wxDateTime::Inv_Month ) - { - if ( !tmNow ) - tmNow = wxDateTime::GetTmNow(&tmstruct); - - *month = (wxDateTime::Month)tmNow->tm_mon; - } -} - -// fll the struct tm with default values -static void InitTm(struct tm& tm) -{ - // struct tm may have etxra fields (undocumented and with unportable - // names) which, nevertheless, must be set to 0 - memset(&tm, 0, sizeof(struct tm)); - - tm.tm_mday = 1; // mday 0 is invalid - tm.tm_year = 76; // any valid year - tm.tm_isdst = -1; // auto determine -} - -// parsing helpers -// --------------- - -// return the month if the string is a month name or Inv_Month otherwise -static wxDateTime::Month GetMonthFromName(const wxString& name, int flags) -{ - wxDateTime::Month mon; - for ( mon = wxDateTime::Jan; mon < wxDateTime::Inv_Month; wxNextMonth(mon) ) - { - // case-insensitive comparison either one of or with both abbreviated - // and not versions - if ( flags & wxDateTime::Name_Full ) - { - if ( name.CmpNoCase(wxDateTime:: - GetMonthName(mon, wxDateTime::Name_Full)) == 0 ) - { - break; - } - } - - if ( flags & wxDateTime::Name_Abbr ) - { - if ( name.CmpNoCase(wxDateTime:: - GetMonthName(mon, wxDateTime::Name_Abbr)) == 0 ) - { - break; - } - } - } - - return mon; -} - -// return the weekday if the string is a weekday name or Inv_WeekDay otherwise -static wxDateTime::WeekDay GetWeekDayFromName(const wxString& name, int flags) -{ - wxDateTime::WeekDay wd; - for ( wd = wxDateTime::Sun; wd < wxDateTime::Inv_WeekDay; wxNextWDay(wd) ) - { - // case-insensitive comparison either one of or with both abbreviated - // and not versions - if ( flags & wxDateTime::Name_Full ) - { - if ( name.CmpNoCase(wxDateTime:: - GetWeekDayName(wd, wxDateTime::Name_Full)) == 0 ) - { - break; - } - } - - if ( flags & wxDateTime::Name_Abbr ) - { - if ( name.CmpNoCase(wxDateTime:: - GetWeekDayName(wd, wxDateTime::Name_Abbr)) == 0 ) - { - break; - } - } - } - - return wd; -} - -/* static */ -struct tm *wxDateTime::GetTmNow(struct tm *tmstruct) -{ - time_t t = GetTimeNow(); - return wxLocaltime_r(&t, tmstruct); -} - -// scans all digits (but no more than len) and returns the resulting number -static bool GetNumericToken(size_t len, const wxChar*& p, unsigned long *number) -{ - size_t n = 1; - wxString s; - while ( wxIsdigit(*p) ) - { - s += *p++; - - if ( len && ++n > len ) - break; - } - - return !s.empty() && s.ToULong(number); -} - -// scans all alphabetic characters and returns the resulting string -static wxString GetAlphaToken(const wxChar*& p) -{ - wxString s; - while ( wxIsalpha(*p) ) - { - s += *p++; - } - - return s; -} - -// ============================================================================ -// implementation of wxDateTime -// ============================================================================ - -// ---------------------------------------------------------------------------- -// struct Tm -// ---------------------------------------------------------------------------- - -wxDateTime::Tm::Tm() -{ - year = (wxDateTime_t)wxDateTime::Inv_Year; - mon = wxDateTime::Inv_Month; - mday = 0; - hour = min = sec = msec = 0; - wday = wxDateTime::Inv_WeekDay; -} - -wxDateTime::Tm::Tm(const struct tm& tm, const TimeZone& tz) - : m_tz(tz) -{ - msec = 0; - sec = (wxDateTime::wxDateTime_t)tm.tm_sec; - min = (wxDateTime::wxDateTime_t)tm.tm_min; - hour = (wxDateTime::wxDateTime_t)tm.tm_hour; - mday = (wxDateTime::wxDateTime_t)tm.tm_mday; - mon = (wxDateTime::Month)tm.tm_mon; - year = 1900 + tm.tm_year; - wday = (wxDateTime::wxDateTime_t)tm.tm_wday; - yday = (wxDateTime::wxDateTime_t)tm.tm_yday; -} - -bool wxDateTime::Tm::IsValid() const -{ - // we allow for the leap seconds, although we don't use them (yet) - return (year != wxDateTime::Inv_Year) && (mon != wxDateTime::Inv_Month) && - (mday <= GetNumOfDaysInMonth(year, mon)) && - (hour < 24) && (min < 60) && (sec < 62) && (msec < 1000); -} - -void wxDateTime::Tm::ComputeWeekDay() -{ - // compute the week day from day/month/year: we use the dumbest algorithm - // possible: just compute our JDN and then use the (simple to derive) - // formula: weekday = (JDN + 1.5) % 7 - wday = (wxDateTime::wxDateTime_t)((GetTruncatedJDN(mday, mon, year) + 2) % 7); -} - -void wxDateTime::Tm::AddMonths(int monDiff) -{ - // normalize the months field - while ( monDiff < -mon ) - { - year--; - - monDiff += MONTHS_IN_YEAR; - } - - while ( monDiff + mon >= MONTHS_IN_YEAR ) - { - year++; - - monDiff -= MONTHS_IN_YEAR; - } - - mon = (wxDateTime::Month)(mon + monDiff); - - wxASSERT_MSG( mon >= 0 && mon < MONTHS_IN_YEAR, _T("logic error") ); - - // NB: we don't check here that the resulting date is valid, this function - // is private and the caller must check it if needed -} - -void wxDateTime::Tm::AddDays(int dayDiff) -{ - // normalize the days field - while ( dayDiff + mday < 1 ) - { - AddMonths(-1); - - dayDiff += GetNumOfDaysInMonth(year, mon); - } - - mday = (wxDateTime::wxDateTime_t)( mday + dayDiff ); - while ( mday > GetNumOfDaysInMonth(year, mon) ) - { - mday -= GetNumOfDaysInMonth(year, mon); - - AddMonths(1); - } - - wxASSERT_MSG( mday > 0 && mday <= GetNumOfDaysInMonth(year, mon), - _T("logic error") ); -} - -// ---------------------------------------------------------------------------- -// class TimeZone -// ---------------------------------------------------------------------------- - -wxDateTime::TimeZone::TimeZone(wxDateTime::TZ tz) -{ - switch ( tz ) - { - case wxDateTime::Local: - // get the offset from C RTL: it returns the difference GMT-local - // while we want to have the offset _from_ GMT, hence the '-' - m_offset = -GetTimeZone(); - break; - - case wxDateTime::GMT_12: - case wxDateTime::GMT_11: - case wxDateTime::GMT_10: - case wxDateTime::GMT_9: - case wxDateTime::GMT_8: - case wxDateTime::GMT_7: - case wxDateTime::GMT_6: - case wxDateTime::GMT_5: - case wxDateTime::GMT_4: - case wxDateTime::GMT_3: - case wxDateTime::GMT_2: - case wxDateTime::GMT_1: - m_offset = -3600*(wxDateTime::GMT0 - tz); - break; - - case wxDateTime::GMT0: - case wxDateTime::GMT1: - case wxDateTime::GMT2: - case wxDateTime::GMT3: - case wxDateTime::GMT4: - case wxDateTime::GMT5: - case wxDateTime::GMT6: - case wxDateTime::GMT7: - case wxDateTime::GMT8: - case wxDateTime::GMT9: - case wxDateTime::GMT10: - case wxDateTime::GMT11: - case wxDateTime::GMT12: - case wxDateTime::GMT13: - m_offset = 3600*(tz - wxDateTime::GMT0); - break; - - case wxDateTime::A_CST: - // Central Standard Time in use in Australia = UTC + 9.5 - m_offset = 60l*(9*MIN_PER_HOUR + MIN_PER_HOUR/2); - break; - - default: - wxFAIL_MSG( _T("unknown time zone") ); - } -} - -// ---------------------------------------------------------------------------- -// static functions -// ---------------------------------------------------------------------------- - -/* static */ -bool wxDateTime::IsLeapYear(int year, wxDateTime::Calendar cal) -{ - if ( year == Inv_Year ) - year = GetCurrentYear(); - - if ( cal == Gregorian ) - { - // in Gregorian calendar leap years are those divisible by 4 except - // those divisible by 100 unless they're also divisible by 400 - // (in some countries, like Russia and Greece, additional corrections - // exist, but they won't manifest themselves until 2700) - return (year % 4 == 0) && ((year % 100 != 0) || (year % 400 == 0)); - } - else if ( cal == Julian ) - { - // in Julian calendar the rule is simpler - return year % 4 == 0; - } - else - { - wxFAIL_MSG(_T("unknown calendar")); - - return false; - } -} - -/* static */ -int wxDateTime::GetCentury(int year) -{ - return year > 0 ? year / 100 : year / 100 - 1; -} - -/* static */ -int wxDateTime::ConvertYearToBC(int year) -{ - // year 0 is BC 1 - return year > 0 ? year : year - 1; -} - -/* static */ -int wxDateTime::GetCurrentYear(wxDateTime::Calendar cal) -{ - switch ( cal ) - { - case Gregorian: - return Now().GetYear(); - - case Julian: - wxFAIL_MSG(_T("TODO")); - break; - - default: - wxFAIL_MSG(_T("unsupported calendar")); - break; - } - - return Inv_Year; -} - -/* static */ -wxDateTime::Month wxDateTime::GetCurrentMonth(wxDateTime::Calendar cal) -{ - switch ( cal ) - { - case Gregorian: - return Now().GetMonth(); - - case Julian: - wxFAIL_MSG(_T("TODO")); - break; - - default: - wxFAIL_MSG(_T("unsupported calendar")); - break; - } - - return Inv_Month; -} - -/* static */ -wxDateTime::wxDateTime_t wxDateTime::GetNumberOfDays(int year, Calendar cal) -{ - if ( year == Inv_Year ) - { - // take the current year if none given - year = GetCurrentYear(); - } - - switch ( cal ) - { - case Gregorian: - case Julian: - return IsLeapYear(year) ? 366 : 365; - - default: - wxFAIL_MSG(_T("unsupported calendar")); - break; - } - - return 0; -} - -/* static */ -wxDateTime::wxDateTime_t wxDateTime::GetNumberOfDays(wxDateTime::Month month, - int year, - wxDateTime::Calendar cal) -{ - wxCHECK_MSG( month < MONTHS_IN_YEAR, 0, _T("invalid month") ); - - if ( cal == Gregorian || cal == Julian ) - { - if ( year == Inv_Year ) - { - // take the current year if none given - year = GetCurrentYear(); - } - - return GetNumOfDaysInMonth(year, month); - } - else - { - wxFAIL_MSG(_T("unsupported calendar")); - - return 0; - } -} - -/* static */ -wxString wxDateTime::GetMonthName(wxDateTime::Month month, - wxDateTime::NameFlags flags) -{ - wxCHECK_MSG( month != Inv_Month, wxEmptyString, _T("invalid month") ); -#ifdef HAVE_STRFTIME - // notice that we must set all the fields to avoid confusing libc (GNU one - // gets confused to a crash if we don't do this) - tm tm; - InitTm(tm); - tm.tm_mon = month; - - return CallStrftime(flags == Name_Abbr ? _T("%b") : _T("%B"), &tm); -#else // !HAVE_STRFTIME - wxString ret; - switch(month) - { - case Jan: - ret = (flags == Name_Abbr ? wxT("Jan"): wxT("January")); - break; - case Feb: - ret = (flags == Name_Abbr ? wxT("Feb"): wxT("Febuary")); - break; - case Mar: - ret = (flags == Name_Abbr ? wxT("Mar"): wxT("March")); - break; - case Apr: - ret = (flags == Name_Abbr ? wxT("Apr"): wxT("April")); - break; - case May: - ret = (flags == Name_Abbr ? wxT("May"): wxT("May")); - break; - case Jun: - ret = (flags == Name_Abbr ? wxT("Jun"): wxT("June")); - break; - case Jul: - ret = (flags == Name_Abbr ? wxT("Jul"): wxT("July")); - break; - case Aug: - ret = (flags == Name_Abbr ? wxT("Aug"): wxT("August")); - break; - case Sep: - ret = (flags == Name_Abbr ? wxT("Sep"): wxT("September")); - break; - case Oct: - ret = (flags == Name_Abbr ? wxT("Oct"): wxT("October")); - break; - case Nov: - ret = (flags == Name_Abbr ? wxT("Nov"): wxT("November")); - break; - case Dec: - ret = (flags == Name_Abbr ? wxT("Dec"): wxT("December")); - break; - } - return ret; -#endif // HAVE_STRFTIME/!HAVE_STRFTIME -} - -/* static */ -wxString wxDateTime::GetWeekDayName(wxDateTime::WeekDay wday, - wxDateTime::NameFlags flags) -{ - wxCHECK_MSG( wday != Inv_WeekDay, wxEmptyString, _T("invalid weekday") ); -#ifdef HAVE_STRFTIME - // take some arbitrary Sunday (but notice that the day should be such that - // after adding wday to it below we still have a valid date, e.g. don't - // take 28 here!) - tm tm; - InitTm(tm); - tm.tm_mday = 21; - tm.tm_mon = Nov; - tm.tm_year = 99; - - // and offset it by the number of days needed to get the correct wday - tm.tm_mday += wday; - - // call mktime() to normalize it... - (void)mktime(&tm); - - // ... and call strftime() - return CallStrftime(flags == Name_Abbr ? _T("%a") : _T("%A"), &tm); -#else // !HAVE_STRFTIME - wxString ret; - switch(wday) - { - case Sun: - ret = (flags == Name_Abbr ? wxT("Sun") : wxT("Sunday")); - break; - case Mon: - ret = (flags == Name_Abbr ? wxT("Mon") : wxT("Monday")); - break; - case Tue: - ret = (flags == Name_Abbr ? wxT("Tue") : wxT("Tuesday")); - break; - case Wed: - ret = (flags == Name_Abbr ? wxT("Wed") : wxT("Wednesday")); - break; - case Thu: - ret = (flags == Name_Abbr ? wxT("Thu") : wxT("Thursday")); - break; - case Fri: - ret = (flags == Name_Abbr ? wxT("Fri") : wxT("Friday")); - break; - case Sat: - ret = (flags == Name_Abbr ? wxT("Sat") : wxT("Saturday")); - break; - } - return ret; -#endif // HAVE_STRFTIME/!HAVE_STRFTIME -} - -/* static */ -void wxDateTime::GetAmPmStrings(wxString *am, wxString *pm) -{ - tm tm; - InitTm(tm); - wxChar buffer[64]; - // @Note: Do not call 'CallStrftime' here! CallStrftime checks the return code - // and causes an assertion failed if the buffer is to small (which is good) - OR - - // if strftime does not return anything because the format string is invalid - OR - - // if there are no 'am' / 'pm' tokens defined for the current locale (which is not good). - // wxDateTime::ParseTime will try several different formats to parse the time. - // As a result, GetAmPmStrings might get called, even if the current locale - // does not define any 'am' / 'pm' tokens. In this case, wxStrftime would - // assert, even though it is a perfectly legal use. - if ( am ) - { - if (wxStrftime(buffer, sizeof(buffer)/sizeof(wxChar), _T("%p"), &tm) > 0) - *am = wxString(buffer); - else - *am = wxString(); - } - if ( pm ) - { - tm.tm_hour = 13; - if (wxStrftime(buffer, sizeof(buffer)/sizeof(wxChar), _T("%p"), &tm) > 0) - *pm = wxString(buffer); - else - *pm = wxString(); - } -} - -// ---------------------------------------------------------------------------- -// Country stuff: date calculations depend on the country (DST, work days, -// ...), so we need to know which rules to follow. -// ---------------------------------------------------------------------------- - -/* static */ -wxDateTime::Country wxDateTime::GetCountry() -{ - // TODO use LOCALE_ICOUNTRY setting under Win32 -#ifndef __WXWINCE__ - if ( ms_country == Country_Unknown ) - { - // try to guess from the time zone name - time_t t = time(NULL); - struct tm tmstruct; - struct tm *tm = wxLocaltime_r(&t, &tmstruct); - - wxString tz = CallStrftime(_T("%Z"), tm); - if ( tz == _T("WET") || tz == _T("WEST") ) - { - ms_country = UK; - } - else if ( tz == _T("CET") || tz == _T("CEST") ) - { - ms_country = Country_EEC; - } - else if ( tz == _T("MSK") || tz == _T("MSD") ) - { - ms_country = Russia; - } - else if ( tz == _T("AST") || tz == _T("ADT") || - tz == _T("EST") || tz == _T("EDT") || - tz == _T("CST") || tz == _T("CDT") || - tz == _T("MST") || tz == _T("MDT") || - tz == _T("PST") || tz == _T("PDT") ) - { - ms_country = USA; - } - else - { - // well, choose a default one - ms_country = USA; - } - } -#else // __WXWINCE__ - ms_country = USA; -#endif // !__WXWINCE__/__WXWINCE__ - - return ms_country; -} - -/* static */ -void wxDateTime::SetCountry(wxDateTime::Country country) -{ - ms_country = country; -} - -/* static */ -bool wxDateTime::IsWestEuropeanCountry(Country country) -{ - if ( country == Country_Default ) - { - country = GetCountry(); - } - - return (Country_WesternEurope_Start <= country) && - (country <= Country_WesternEurope_End); -} - -// ---------------------------------------------------------------------------- -// DST calculations: we use 3 different rules for the West European countries, -// USA and for the rest of the world. This is undoubtedly false for many -// countries, but I lack the necessary info (and the time to gather it), -// please add the other rules here! -// ---------------------------------------------------------------------------- - -/* static */ -bool wxDateTime::IsDSTApplicable(int year, Country country) -{ - if ( year == Inv_Year ) - { - // take the current year if none given - year = GetCurrentYear(); - } - - if ( country == Country_Default ) - { - country = GetCountry(); - } - - switch ( country ) - { - case USA: - case UK: - // DST was first observed in the US and UK during WWI, reused - // during WWII and used again since 1966 - return year >= 1966 || - (year >= 1942 && year <= 1945) || - (year == 1918 || year == 1919); - - default: - // assume that it started after WWII - return year > 1950; - } -} - -/* static */ -wxDateTime wxDateTime::GetBeginDST(int year, Country country) -{ - if ( year == Inv_Year ) - { - // take the current year if none given - year = GetCurrentYear(); - } - - if ( country == Country_Default ) - { - country = GetCountry(); - } - - if ( !IsDSTApplicable(year, country) ) - { - return wxInvalidDateTime; - } - - wxDateTime dt; - - if ( IsWestEuropeanCountry(country) || (country == Russia) ) - { - // DST begins at 1 a.m. GMT on the last Sunday of March - if ( !dt.SetToLastWeekDay(Sun, Mar, year) ) - { - // weird... - wxFAIL_MSG( _T("no last Sunday in March?") ); - } - - dt += wxTimeSpan::Hours(1); - - // disable DST tests because it could result in an infinite recursion! - dt.MakeGMT(true); - } - else switch ( country ) - { - case USA: - switch ( year ) - { - case 1918: - case 1919: - // don't know for sure - assume it was in effect all year - - case 1943: - case 1944: - case 1945: - dt.Set(1, Jan, year); - break; - - case 1942: - // DST was installed Feb 2, 1942 by the Congress - dt.Set(2, Feb, year); - break; - - // Oil embargo changed the DST period in the US - case 1974: - dt.Set(6, Jan, 1974); - break; - - case 1975: - dt.Set(23, Feb, 1975); - break; - - default: - // before 1986, DST begun on the last Sunday of April, but - // in 1986 Reagan changed it to begin at 2 a.m. of the - // first Sunday in April - if ( year < 1986 ) - { - if ( !dt.SetToLastWeekDay(Sun, Apr, year) ) - { - // weird... - wxFAIL_MSG( _T("no first Sunday in April?") ); - } - } - else if ( year > 2006 ) - // Energy Policy Act of 2005, Pub. L. no. 109-58, 119 Stat 594 (2005). - // Starting in 2007, daylight time begins in the United States on the - // second Sunday in March and ends on the first Sunday in November - { - if ( !dt.SetToWeekDay(Sun, 2, Mar, year) ) - { - // weird... - wxFAIL_MSG( _T("no second Sunday in March?") ); - } - } - else - { - if ( !dt.SetToWeekDay(Sun, 1, Apr, year) ) - { - // weird... - wxFAIL_MSG( _T("no first Sunday in April?") ); - } - } - - dt += wxTimeSpan::Hours(2); - - // TODO what about timezone?? - } - - break; - - default: - // assume Mar 30 as the start of the DST for the rest of the world - // - totally bogus, of course - dt.Set(30, Mar, year); - } - - return dt; -} - -/* static */ -wxDateTime wxDateTime::GetEndDST(int year, Country country) -{ - if ( year == Inv_Year ) - { - // take the current year if none given - year = GetCurrentYear(); - } - - if ( country == Country_Default ) - { - country = GetCountry(); - } - - if ( !IsDSTApplicable(year, country) ) - { - return wxInvalidDateTime; - } - - wxDateTime dt; - - if ( IsWestEuropeanCountry(country) || (country == Russia) ) - { - // DST ends at 1 a.m. GMT on the last Sunday of October - if ( !dt.SetToLastWeekDay(Sun, Oct, year) ) - { - // weirder and weirder... - wxFAIL_MSG( _T("no last Sunday in October?") ); - } - - dt += wxTimeSpan::Hours(1); - - // disable DST tests because it could result in an infinite recursion! - dt.MakeGMT(true); - } - else switch ( country ) - { - case USA: - switch ( year ) - { - case 1918: - case 1919: - // don't know for sure - assume it was in effect all year - - case 1943: - case 1944: - dt.Set(31, Dec, year); - break; - - case 1945: - // the time was reset after the end of the WWII - dt.Set(30, Sep, year); - break; - - default: // default for switch (year) - if ( year > 2006 ) - // Energy Policy Act of 2005, Pub. L. no. 109-58, 119 Stat 594 (2005). - // Starting in 2007, daylight time begins in the United States on the - // second Sunday in March and ends on the first Sunday in November - { - if ( !dt.SetToWeekDay(Sun, 1, Nov, year) ) - { - // weird... - wxFAIL_MSG( _T("no first Sunday in November?") ); - } - } - else - // pre-2007 - // DST ends at 2 a.m. on the last Sunday of October - { - if ( !dt.SetToLastWeekDay(Sun, Oct, year) ) - { - // weirder and weirder... - wxFAIL_MSG( _T("no last Sunday in October?") ); - } - } - - dt += wxTimeSpan::Hours(2); - - // TODO: what about timezone?? - } - break; - - default: // default for switch (country) - // assume October 26th as the end of the DST - totally bogus too - dt.Set(26, Oct, year); - } - - return dt; -} - -// ---------------------------------------------------------------------------- -// constructors and assignment operators -// ---------------------------------------------------------------------------- - -// return the current time with ms precision -/* static */ wxDateTime wxDateTime::UNow() -{ - return wxDateTime(wxGetLocalTimeMillis()); -} - -// the values in the tm structure contain the local time -wxDateTime& wxDateTime::Set(const struct tm& tm) -{ - struct tm tm2(tm); - time_t timet = mktime(&tm2); - - if ( timet == (time_t)-1 ) - { - // mktime() rather unintuitively fails for Jan 1, 1970 if the hour is - // less than timezone - try to make it work for this case - if ( tm2.tm_year == 70 && tm2.tm_mon == 0 && tm2.tm_mday == 1 ) - { - return Set((time_t)( - GetTimeZone() + - tm2.tm_hour * MIN_PER_HOUR * SEC_PER_MIN + - tm2.tm_min * SEC_PER_MIN + - tm2.tm_sec)); - } - - wxFAIL_MSG( _T("mktime() failed") ); - - *this = wxInvalidDateTime; - - return *this; - } - else - { - return Set(timet); - } -} - -wxDateTime& wxDateTime::Set(wxDateTime_t hour, - wxDateTime_t minute, - wxDateTime_t second, - wxDateTime_t millisec) -{ - // we allow seconds to be 61 to account for the leap seconds, even if we - // don't use them really - wxDATETIME_CHECK( hour < 24 && - second < 62 && - minute < 60 && - millisec < 1000, - _T("Invalid time in wxDateTime::Set()") ); - - // get the current date from system - struct tm tmstruct; - struct tm *tm = GetTmNow(&tmstruct); - - wxDATETIME_CHECK( tm, _T("wxLocaltime_r() failed") ); - - // make a copy so it isn't clobbered by the call to mktime() below - struct tm tm1(*tm); - - // adjust the time - tm1.tm_hour = hour; - tm1.tm_min = minute; - tm1.tm_sec = second; - - // and the DST in case it changes on this date - struct tm tm2(tm1); - mktime(&tm2); - if ( tm2.tm_isdst != tm1.tm_isdst ) - tm1.tm_isdst = tm2.tm_isdst; - - (void)Set(tm1); - - // and finally adjust milliseconds - return SetMillisecond(millisec); -} - -wxDateTime& wxDateTime::Set(wxDateTime_t day, - Month month, - int year, - wxDateTime_t hour, - wxDateTime_t minute, - wxDateTime_t second, - wxDateTime_t millisec) -{ - wxDATETIME_CHECK( hour < 24 && - second < 62 && - minute < 60 && - millisec < 1000, - _T("Invalid time in wxDateTime::Set()") ); - - ReplaceDefaultYearMonthWithCurrent(&year, &month); - - wxDATETIME_CHECK( (0 < day) && (day <= GetNumberOfDays(month, year)), - _T("Invalid date in wxDateTime::Set()") ); - - // the range of time_t type (inclusive) - static const int yearMinInRange = 1970; - static const int yearMaxInRange = 2037; - - // test only the year instead of testing for the exact end of the Unix - // time_t range - it doesn't bring anything to do more precise checks - if ( year >= yearMinInRange && year <= yearMaxInRange ) - { - // use the standard library version if the date is in range - this is - // probably more efficient than our code - struct tm tm; - tm.tm_year = year - 1900; - tm.tm_mon = month; - tm.tm_mday = day; - tm.tm_hour = hour; - tm.tm_min = minute; - tm.tm_sec = second; - tm.tm_isdst = -1; // mktime() will guess it - - (void)Set(tm); - - // and finally adjust milliseconds - if (IsValid()) - SetMillisecond(millisec); - - return *this; - } - else - { - // do time calculations ourselves: we want to calculate the number of - // milliseconds between the given date and the epoch - - // get the JDN for the midnight of this day - m_time = GetTruncatedJDN(day, month, year); - m_time -= EPOCH_JDN; - m_time *= SECONDS_PER_DAY * TIME_T_FACTOR; - - // JDN corresponds to GMT, we take localtime - Add(wxTimeSpan(hour, minute, second + GetTimeZone(), millisec)); - } - - return *this; -} - -wxDateTime& wxDateTime::Set(double jdn) -{ - // so that m_time will be 0 for the midnight of Jan 1, 1970 which is jdn - // EPOCH_JDN + 0.5 - jdn -= EPOCH_JDN + 0.5; - - m_time.Assign(jdn*MILLISECONDS_PER_DAY); - - // JDNs always are in UTC, so we don't need any adjustments for time zone - - return *this; -} - -wxDateTime& wxDateTime::ResetTime() -{ - Tm tm = GetTm(); - - if ( tm.hour || tm.min || tm.sec || tm.msec ) - { - tm.msec = - tm.sec = - tm.min = - tm.hour = 0; - - Set(tm); - } - - return *this; -} - -wxDateTime wxDateTime::GetDateOnly() const -{ - Tm tm = GetTm(); - tm.msec = - tm.sec = - tm.min = - tm.hour = 0; - return wxDateTime(tm); -} - -// ---------------------------------------------------------------------------- -// DOS Date and Time Format functions -// ---------------------------------------------------------------------------- -// the dos date and time value is an unsigned 32 bit value in the format: -// YYYYYYYMMMMDDDDDhhhhhmmmmmmsssss -// -// Y = year offset from 1980 (0-127) -// M = month (1-12) -// D = day of month (1-31) -// h = hour (0-23) -// m = minute (0-59) -// s = bisecond (0-29) each bisecond indicates two seconds -// ---------------------------------------------------------------------------- - -wxDateTime& wxDateTime::SetFromDOS(unsigned long ddt) -{ - struct tm tm; - InitTm(tm); - - long year = ddt & 0xFE000000; - year >>= 25; - year += 80; - tm.tm_year = year; - - long month = ddt & 0x1E00000; - month >>= 21; - month -= 1; - tm.tm_mon = month; - - long day = ddt & 0x1F0000; - day >>= 16; - tm.tm_mday = day; - - long hour = ddt & 0xF800; - hour >>= 11; - tm.tm_hour = hour; - - long minute = ddt & 0x7E0; - minute >>= 5; - tm.tm_min = minute; - - long second = ddt & 0x1F; - tm.tm_sec = second * 2; - - return Set(mktime(&tm)); -} - -unsigned long wxDateTime::GetAsDOS() const -{ - unsigned long ddt; - time_t ticks = GetTicks(); - struct tm tmstruct; - struct tm *tm = wxLocaltime_r(&ticks, &tmstruct); - wxCHECK_MSG( tm, ULONG_MAX, _T("time can't be represented in DOS format") ); - - long year = tm->tm_year; - year -= 80; - year <<= 25; - - long month = tm->tm_mon; - month += 1; - month <<= 21; - - long day = tm->tm_mday; - day <<= 16; - - long hour = tm->tm_hour; - hour <<= 11; - - long minute = tm->tm_min; - minute <<= 5; - - long second = tm->tm_sec; - second /= 2; - - ddt = year | month | day | hour | minute | second; - return ddt; -} - -// ---------------------------------------------------------------------------- -// time_t <-> broken down time conversions -// ---------------------------------------------------------------------------- - -wxDateTime::Tm wxDateTime::GetTm(const TimeZone& tz) const -{ - wxASSERT_MSG( IsValid(), _T("invalid wxDateTime") ); - - time_t time = GetTicks(); - if ( time != (time_t)-1 ) - { - // use C RTL functions - struct tm tmstruct; - tm *tm; - if ( tz.GetOffset() == -GetTimeZone() ) - { - // we are working with local time - tm = wxLocaltime_r(&time, &tmstruct); - - // should never happen - wxCHECK_MSG( tm, Tm(), _T("wxLocaltime_r() failed") ); - } - else - { - time += (time_t)tz.GetOffset(); -#if defined(__VMS__) || defined(__WATCOMC__) // time is unsigned so avoid warning - int time2 = (int) time; - if ( time2 >= 0 ) -#else - if ( time >= 0 ) -#endif - { - tm = wxGmtime_r(&time, &tmstruct); - - // should never happen - wxCHECK_MSG( tm, Tm(), _T("wxGmtime_r() failed") ); - } - else - { - tm = (struct tm *)NULL; - } - } - - if ( tm ) - { - // adjust the milliseconds - Tm tm2(*tm, tz); - long timeOnly = (m_time % MILLISECONDS_PER_DAY).ToLong(); - tm2.msec = (wxDateTime_t)(timeOnly % 1000); - return tm2; - } - //else: use generic code below - } - - // remember the time and do the calculations with the date only - this - // eliminates rounding errors of the floating point arithmetics - - wxLongLong timeMidnight = m_time + tz.GetOffset() * 1000; - - long timeOnly = (timeMidnight % MILLISECONDS_PER_DAY).ToLong(); - - // we want to always have positive time and timeMidnight to be really - // the midnight before it - if ( timeOnly < 0 ) - { - timeOnly = MILLISECONDS_PER_DAY + timeOnly; - } - - timeMidnight -= timeOnly; - - // calculate the Gregorian date from JDN for the midnight of our date: - // this will yield day, month (in 1..12 range) and year - - // actually, this is the JDN for the noon of the previous day - long jdn = (timeMidnight / MILLISECONDS_PER_DAY).ToLong() + EPOCH_JDN; - - // CREDIT: code below is by Scott E. Lee (but bugs are mine) - - wxASSERT_MSG( jdn > -2, _T("JDN out of range") ); - - // calculate the century - long temp = (jdn + JDN_OFFSET) * 4 - 1; - long century = temp / DAYS_PER_400_YEARS; - - // then the year and day of year (1 <= dayOfYear <= 366) - temp = ((temp % DAYS_PER_400_YEARS) / 4) * 4 + 3; - long year = (century * 100) + (temp / DAYS_PER_4_YEARS); - long dayOfYear = (temp % DAYS_PER_4_YEARS) / 4 + 1; - - // and finally the month and day of the month - temp = dayOfYear * 5 - 3; - long month = temp / DAYS_PER_5_MONTHS; - long day = (temp % DAYS_PER_5_MONTHS) / 5 + 1; - - // month is counted from March - convert to normal - if ( month < 10 ) - { - month += 3; - } - else - { - year += 1; - month -= 9; - } - - // year is offset by 4800 - year -= 4800; - - // check that the algorithm gave us something reasonable - wxASSERT_MSG( (0 < month) && (month <= 12), _T("invalid month") ); - wxASSERT_MSG( (1 <= day) && (day < 32), _T("invalid day") ); - - // construct Tm from these values - Tm tm; - tm.year = (int)year; - tm.mon = (Month)(month - 1); // algorithm yields 1 for January, not 0 - tm.mday = (wxDateTime_t)day; - tm.msec = (wxDateTime_t)(timeOnly % 1000); - timeOnly -= tm.msec; - timeOnly /= 1000; // now we have time in seconds - - tm.sec = (wxDateTime_t)(timeOnly % SEC_PER_MIN); - timeOnly -= tm.sec; - timeOnly /= SEC_PER_MIN; // now we have time in minutes - - tm.min = (wxDateTime_t)(timeOnly % MIN_PER_HOUR); - timeOnly -= tm.min; - - tm.hour = (wxDateTime_t)(timeOnly / MIN_PER_HOUR); - - return tm; -} - -wxDateTime& wxDateTime::SetYear(int year) -{ - wxASSERT_MSG( IsValid(), _T("invalid wxDateTime") ); - - Tm tm(GetTm()); - tm.year = year; - Set(tm); - - return *this; -} - -wxDateTime& wxDateTime::SetMonth(Month month) -{ - wxASSERT_MSG( IsValid(), _T("invalid wxDateTime") ); - - Tm tm(GetTm()); - tm.mon = month; - Set(tm); - - return *this; -} - -wxDateTime& wxDateTime::SetDay(wxDateTime_t mday) -{ - wxASSERT_MSG( IsValid(), _T("invalid wxDateTime") ); - - Tm tm(GetTm()); - tm.mday = mday; - Set(tm); - - return *this; -} - -wxDateTime& wxDateTime::SetHour(wxDateTime_t hour) -{ - wxASSERT_MSG( IsValid(), _T("invalid wxDateTime") ); - - Tm tm(GetTm()); - tm.hour = hour; - Set(tm); - - return *this; -} - -wxDateTime& wxDateTime::SetMinute(wxDateTime_t min) -{ - wxASSERT_MSG( IsValid(), _T("invalid wxDateTime") ); - - Tm tm(GetTm()); - tm.min = min; - Set(tm); - - return *this; -} - -wxDateTime& wxDateTime::SetSecond(wxDateTime_t sec) -{ - wxASSERT_MSG( IsValid(), _T("invalid wxDateTime") ); - - Tm tm(GetTm()); - tm.sec = sec; - Set(tm); - - return *this; -} - -wxDateTime& wxDateTime::SetMillisecond(wxDateTime_t millisecond) -{ - wxASSERT_MSG( IsValid(), _T("invalid wxDateTime") ); - - // we don't need to use GetTm() for this one - m_time -= m_time % 1000l; - m_time += millisecond; - - return *this; -} - -// ---------------------------------------------------------------------------- -// wxDateTime arithmetics -// ---------------------------------------------------------------------------- - -wxDateTime& wxDateTime::Add(const wxDateSpan& diff) -{ - Tm tm(GetTm()); - - tm.year += diff.GetYears(); - tm.AddMonths(diff.GetMonths()); - - // check that the resulting date is valid - if ( tm.mday > GetNumOfDaysInMonth(tm.year, tm.mon) ) - { - // We suppose that when adding one month to Jan 31 we want to get Feb - // 28 (or 29), i.e. adding a month to the last day of the month should - // give the last day of the next month which is quite logical. - // - // Unfortunately, there is no logic way to understand what should - // Jan 30 + 1 month be - Feb 28 too or Feb 27 (assuming non leap year)? - // We make it Feb 28 (last day too), but it is highly questionable. - tm.mday = GetNumOfDaysInMonth(tm.year, tm.mon); - } - - tm.AddDays(diff.GetTotalDays()); - - Set(tm); - - wxASSERT_MSG( IsSameTime(tm), - _T("Add(wxDateSpan) shouldn't modify time") ); - - return *this; -} - -// ---------------------------------------------------------------------------- -// Weekday and monthday stuff -// ---------------------------------------------------------------------------- - -// convert Sun, Mon, ..., Sat into 6, 0, ..., 5 -static inline int ConvertWeekDayToMondayBase(int wd) -{ - return wd == wxDateTime::Sun ? 6 : wd - 1; -} - -/* static */ -wxDateTime -wxDateTime::SetToWeekOfYear(int year, wxDateTime_t numWeek, WeekDay wd) -{ - wxASSERT_MSG( numWeek > 0, - _T("invalid week number: weeks are counted from 1") ); - - // Jan 4 always lies in the 1st week of the year - wxDateTime dt(4, Jan, year); - dt.SetToWeekDayInSameWeek(wd); - dt += wxDateSpan::Weeks(numWeek - 1); - - return dt; -} - -#if WXWIN_COMPATIBILITY_2_6 -// use a separate function to avoid warnings about using deprecated -// SetToTheWeek in GetWeek below -static wxDateTime -SetToTheWeek(int year, - wxDateTime::wxDateTime_t numWeek, - wxDateTime::WeekDay weekday, - wxDateTime::WeekFlags flags) -{ - // Jan 4 always lies in the 1st week of the year - wxDateTime dt(4, wxDateTime::Jan, year); - dt.SetToWeekDayInSameWeek(weekday, flags); - dt += wxDateSpan::Weeks(numWeek - 1); - - return dt; -} - -bool wxDateTime::SetToTheWeek(wxDateTime_t numWeek, - WeekDay weekday, - WeekFlags flags) -{ - int year = GetYear(); - *this = ::SetToTheWeek(year, numWeek, weekday, flags); - if ( GetYear() != year ) - { - // oops... numWeek was too big - return false; - } - - return true; -} - -wxDateTime wxDateTime::GetWeek(wxDateTime_t numWeek, - WeekDay weekday, - WeekFlags flags) const -{ - return ::SetToTheWeek(GetYear(), numWeek, weekday, flags); -} -#endif // WXWIN_COMPATIBILITY_2_6 - -wxDateTime& wxDateTime::SetToLastMonthDay(Month month, - int year) -{ - // take the current month/year if none specified - if ( year == Inv_Year ) - year = GetYear(); - if ( month == Inv_Month ) - month = GetMonth(); - - return Set(GetNumOfDaysInMonth(year, month), month, year); -} - -wxDateTime& wxDateTime::SetToWeekDayInSameWeek(WeekDay weekday, WeekFlags flags) -{ - wxDATETIME_CHECK( weekday != Inv_WeekDay, _T("invalid weekday") ); - - int wdayDst = weekday, - wdayThis = GetWeekDay(); - if ( wdayDst == wdayThis ) - { - // nothing to do - return *this; - } - - if ( flags == Default_First ) - { - flags = GetCountry() == USA ? Sunday_First : Monday_First; - } - - // the logic below based on comparing weekday and wdayThis works if Sun (0) - // is the first day in the week, but breaks down for Monday_First case so - // we adjust the week days in this case - if ( flags == Monday_First ) - { - if ( wdayThis == Sun ) - wdayThis += 7; - if ( wdayDst == Sun ) - wdayDst += 7; - } - //else: Sunday_First, nothing to do - - // go forward or back in time to the day we want - if ( wdayDst < wdayThis ) - { - return Subtract(wxDateSpan::Days(wdayThis - wdayDst)); - } - else // weekday > wdayThis - { - return Add(wxDateSpan::Days(wdayDst - wdayThis)); - } -} - -wxDateTime& wxDateTime::SetToNextWeekDay(WeekDay weekday) -{ - wxDATETIME_CHECK( weekday != Inv_WeekDay, _T("invalid weekday") ); - - int diff; - WeekDay wdayThis = GetWeekDay(); - if ( weekday == wdayThis ) - { - // nothing to do - return *this; - } - else if ( weekday < wdayThis ) - { - // need to advance a week - diff = 7 - (wdayThis - weekday); - } - else // weekday > wdayThis - { - diff = weekday - wdayThis; - } - - return Add(wxDateSpan::Days(diff)); -} - -wxDateTime& wxDateTime::SetToPrevWeekDay(WeekDay weekday) -{ - wxDATETIME_CHECK( weekday != Inv_WeekDay, _T("invalid weekday") ); - - int diff; - WeekDay wdayThis = GetWeekDay(); - if ( weekday == wdayThis ) - { - // nothing to do - return *this; - } - else if ( weekday > wdayThis ) - { - // need to go to previous week - diff = 7 - (weekday - wdayThis); - } - else // weekday < wdayThis - { - diff = wdayThis - weekday; - } - - return Subtract(wxDateSpan::Days(diff)); -} - -bool wxDateTime::SetToWeekDay(WeekDay weekday, - int n, - Month month, - int year) -{ - wxCHECK_MSG( weekday != Inv_WeekDay, false, _T("invalid weekday") ); - - // we don't check explicitly that -5 <= n <= 5 because we will return false - // anyhow in such case - but may be should still give an assert for it? - - // take the current month/year if none specified - ReplaceDefaultYearMonthWithCurrent(&year, &month); - - wxDateTime dt; - - // TODO this probably could be optimised somehow... - - if ( n > 0 ) - { - // get the first day of the month - dt.Set(1, month, year); - - // get its wday - WeekDay wdayFirst = dt.GetWeekDay(); - - // go to the first weekday of the month - int diff = weekday - wdayFirst; - if ( diff < 0 ) - diff += 7; - - // add advance n-1 weeks more - diff += 7*(n - 1); - - dt += wxDateSpan::Days(diff); - } - else // count from the end of the month - { - // get the last day of the month - dt.SetToLastMonthDay(month, year); - - // get its wday - WeekDay wdayLast = dt.GetWeekDay(); - - // go to the last weekday of the month - int diff = wdayLast - weekday; - if ( diff < 0 ) - diff += 7; - - // and rewind n-1 weeks from there - diff += 7*(-n - 1); - - dt -= wxDateSpan::Days(diff); - } - - // check that it is still in the same month - if ( dt.GetMonth() == month ) - { - *this = dt; - - return true; - } - else - { - // no such day in this month - return false; - } -} - -static inline -wxDateTime::wxDateTime_t GetDayOfYearFromTm(const wxDateTime::Tm& tm) -{ - return (wxDateTime::wxDateTime_t)(gs_cumulatedDays[wxDateTime::IsLeapYear(tm.year)][tm.mon] + tm.mday); -} - -wxDateTime::wxDateTime_t wxDateTime::GetDayOfYear(const TimeZone& tz) const -{ - return GetDayOfYearFromTm(GetTm(tz)); -} - -wxDateTime::wxDateTime_t -wxDateTime::GetWeekOfYear(wxDateTime::WeekFlags flags, const TimeZone& tz) const -{ - if ( flags == Default_First ) - { - flags = GetCountry() == USA ? Sunday_First : Monday_First; - } - - Tm tm(GetTm(tz)); - wxDateTime_t nDayInYear = GetDayOfYearFromTm(tm); - - int wdTarget = GetWeekDay(tz); - int wdYearStart = wxDateTime(1, Jan, GetYear()).GetWeekDay(); - int week; - if ( flags == Sunday_First ) - { - // FIXME: First week is not calculated correctly. - week = (nDayInYear - wdTarget + 7) / 7; - if ( wdYearStart == Wed || wdYearStart == Thu ) - week++; - } - else // week starts with monday - { - // adjust the weekdays to non-US style. - wdYearStart = ConvertWeekDayToMondayBase(wdYearStart); - wdTarget = ConvertWeekDayToMondayBase(wdTarget); - - // quoting from http://www.cl.cam.ac.uk/~mgk25/iso-time.html: - // - // Week 01 of a year is per definition the first week that has the - // Thursday in this year, which is equivalent to the week that - // contains the fourth day of January. In other words, the first - // week of a new year is the week that has the majority of its - // days in the new year. Week 01 might also contain days from the - // previous year and the week before week 01 of a year is the last - // week (52 or 53) of the previous year even if it contains days - // from the new year. A week starts with Monday (day 1) and ends - // with Sunday (day 7). - // - - // if Jan 1 is Thursday or less, it is in the first week of this year - if ( wdYearStart < 4 ) - { - // count the number of entire weeks between Jan 1 and this date - week = (nDayInYear + wdYearStart + 6 - wdTarget)/7; - - // be careful to check for overflow in the next year - if ( week == 53 && tm.mday - wdTarget > 28 ) - week = 1; - } - else // Jan 1 is in the last week of the previous year - { - // check if we happen to be at the last week of previous year: - if ( tm.mon == Jan && tm.mday < 8 - wdYearStart ) - week = wxDateTime(31, Dec, GetYear()-1).GetWeekOfYear(); - else - week = (nDayInYear + wdYearStart - 1 - wdTarget)/7; - } - } - - return (wxDateTime::wxDateTime_t)week; -} - -wxDateTime::wxDateTime_t wxDateTime::GetWeekOfMonth(wxDateTime::WeekFlags flags, - const TimeZone& tz) const -{ - Tm tm = GetTm(tz); - const wxDateTime dateFirst = wxDateTime(1, tm.mon, tm.year); - const wxDateTime::WeekDay wdFirst = dateFirst.GetWeekDay(); - - if ( flags == Default_First ) - { - flags = GetCountry() == USA ? Sunday_First : Monday_First; - } - - // compute offset of dateFirst from the beginning of the week - int firstOffset; - if ( flags == Sunday_First ) - firstOffset = wdFirst - Sun; - else - firstOffset = wdFirst == Sun ? DAYS_PER_WEEK - 1 : wdFirst - Mon; - - return (wxDateTime::wxDateTime_t)((tm.mday - 1 + firstOffset)/7 + 1); -} - -wxDateTime& wxDateTime::SetToYearDay(wxDateTime::wxDateTime_t yday) -{ - int year = GetYear(); - wxDATETIME_CHECK( (0 < yday) && (yday <= GetNumberOfDays(year)), - _T("invalid year day") ); - - bool isLeap = IsLeapYear(year); - for ( Month mon = Jan; mon < Inv_Month; wxNextMonth(mon) ) - { - // for Dec, we can't compare with gs_cumulatedDays[mon + 1], but we - // don't need it neither - because of the CHECK above we know that - // yday lies in December then - if ( (mon == Dec) || (yday <= gs_cumulatedDays[isLeap][mon + 1]) ) - { - Set((wxDateTime::wxDateTime_t)(yday - gs_cumulatedDays[isLeap][mon]), mon, year); - - break; - } - } - - return *this; -} - -// ---------------------------------------------------------------------------- -// Julian day number conversion and related stuff -// ---------------------------------------------------------------------------- - -double wxDateTime::GetJulianDayNumber() const -{ - return m_time.ToDouble() / MILLISECONDS_PER_DAY + EPOCH_JDN + 0.5; -} - -double wxDateTime::GetRataDie() const -{ - // March 1 of the year 0 is Rata Die day -306 and JDN 1721119.5 - return GetJulianDayNumber() - 1721119.5 - 306; -} - -// ---------------------------------------------------------------------------- -// timezone and DST stuff -// ---------------------------------------------------------------------------- - -int wxDateTime::IsDST(wxDateTime::Country country) const -{ - wxCHECK_MSG( country == Country_Default, -1, - _T("country support not implemented") ); - - // use the C RTL for the dates in the standard range - time_t timet = GetTicks(); - if ( timet != (time_t)-1 ) - { - struct tm tmstruct; - tm *tm = wxLocaltime_r(&timet, &tmstruct); - - wxCHECK_MSG( tm, -1, _T("wxLocaltime_r() failed") ); - - return tm->tm_isdst; - } - else - { - int year = GetYear(); - - if ( !IsDSTApplicable(year, country) ) - { - // no DST time in this year in this country - return -1; - } - - return IsBetween(GetBeginDST(year, country), GetEndDST(year, country)); - } -} - -wxDateTime& wxDateTime::MakeTimezone(const TimeZone& tz, bool noDST) -{ - long secDiff = GetTimeZone() + tz.GetOffset(); - - // we need to know whether DST is or not in effect for this date unless - // the test disabled by the caller - if ( !noDST && (IsDST() == 1) ) - { - // FIXME we assume that the DST is always shifted by 1 hour - secDiff -= 3600; - } - - return Add(wxTimeSpan::Seconds(secDiff)); -} - -wxDateTime& wxDateTime::MakeFromTimezone(const TimeZone& tz, bool noDST) -{ - long secDiff = GetTimeZone() + tz.GetOffset(); - - // we need to know whether DST is or not in effect for this date unless - // the test disabled by the caller - if ( !noDST && (IsDST() == 1) ) - { - // FIXME we assume that the DST is always shifted by 1 hour - secDiff -= 3600; - } - - return Subtract(wxTimeSpan::Seconds(secDiff)); -} - -// ---------------------------------------------------------------------------- -// wxDateTime to/from text representations -// ---------------------------------------------------------------------------- - -wxString wxDateTime::Format(const wxChar *format, const TimeZone& tz) const -{ - wxCHECK_MSG( format, wxEmptyString, _T("NULL format in wxDateTime::Format") ); - - time_t time = GetTicks(); - - // we have to use our own implementation if the date is out of range of - // strftime() or if we use non standard specificators -#ifdef HAVE_STRFTIME - if ( (time != (time_t)-1) && !wxStrstr(format, _T("%l")) ) - { - // use strftime() - struct tm tmstruct; - struct tm *tm; - if ( tz.GetOffset() == -GetTimeZone() ) - { - // we are working with local time - tm = wxLocaltime_r(&time, &tmstruct); - - // should never happen - wxCHECK_MSG( tm, wxEmptyString, _T("wxLocaltime_r() failed") ); - } - else - { - time += (int)tz.GetOffset(); - -#if defined(__VMS__) || defined(__WATCOMC__) // time is unsigned so avoid warning - int time2 = (int) time; - if ( time2 >= 0 ) -#else - if ( time >= 0 ) -#endif - { - tm = wxGmtime_r(&time, &tmstruct); - - // should never happen - wxCHECK_MSG( tm, wxEmptyString, _T("wxGmtime_r() failed") ); - } - else - { - tm = (struct tm *)NULL; - } - } - - if ( tm ) - { - return CallStrftime(format, tm); - } - } - //else: use generic code below -#endif // HAVE_STRFTIME - - // we only parse ANSI C format specifications here, no POSIX 2 - // complications, no GNU extensions but we do add support for a "%l" format - // specifier allowing to get the number of milliseconds - Tm tm = GetTm(tz); - - // used for calls to strftime() when we only deal with time - struct tm tmTimeOnly; - memset(&tmTimeOnly, 0, sizeof(tmTimeOnly)); - tmTimeOnly.tm_hour = tm.hour; - tmTimeOnly.tm_min = tm.min; - tmTimeOnly.tm_sec = tm.sec; - tmTimeOnly.tm_wday = 0; - tmTimeOnly.tm_yday = 0; - tmTimeOnly.tm_mday = 1; // any date will do, use 1976-01-01 - tmTimeOnly.tm_mon = 0; - tmTimeOnly.tm_year = 76; - tmTimeOnly.tm_isdst = 0; // no DST, we adjust for tz ourselves - - wxString tmp, res, fmt; - for ( const wxChar *p = format; *p; p++ ) - { - if ( *p != _T('%') ) - { - // copy as is - res += *p; - - continue; - } - - // set the default format - switch ( *++p ) - { - case _T('Y'): // year has 4 digits - fmt = _T("%04d"); - break; - - case _T('j'): // day of year has 3 digits - case _T('l'): // milliseconds have 3 digits - fmt = _T("%03d"); - break; - - case _T('w'): // week day as number has only one - fmt = _T("%d"); - break; - - default: - // it's either another valid format specifier in which case - // the format is "%02d" (for all the rest) or we have the - // field width preceding the format in which case it will - // override the default format anyhow - fmt = _T("%02d"); - } - - bool restart = true; - while ( restart ) - { - restart = false; - - // start of the format specification - switch ( *p ) - { - case _T('a'): // a weekday name - case _T('A'): - // second parameter should be true for abbreviated names - res += GetWeekDayName(tm.GetWeekDay(), - *p == _T('a') ? Name_Abbr : Name_Full); - break; - - case _T('b'): // a month name - case _T('B'): - res += GetMonthName(tm.mon, - *p == _T('b') ? Name_Abbr : Name_Full); - break; - - case _T('c'): // locale default date and time representation - case _T('x'): // locale default date representation -#ifdef HAVE_STRFTIME - // - // the problem: there is no way to know what do these format - // specifications correspond to for the current locale. - // - // the solution: use a hack and still use strftime(): first - // find the YEAR which is a year in the strftime() range (1970 - // - 2038) whose Jan 1 falls on the same week day as the Jan 1 - // of the real year. Then make a copy of the format and - // replace all occurrences of YEAR in it with some unique - // string not appearing anywhere else in it, then use - // strftime() to format the date in year YEAR and then replace - // YEAR back by the real year and the unique replacement - // string back with YEAR. Notice that "all occurrences of YEAR" - // means all occurrences of 4 digit as well as 2 digit form! - // - // the bugs: we assume that neither of %c nor %x contains any - // fields which may change between the YEAR and real year. For - // example, the week number (%U, %W) and the day number (%j) - // will change if one of these years is leap and the other one - // is not! - { - // find the YEAR: normally, for any year X, Jan 1 or the - // year X + 28 is the same weekday as Jan 1 of X (because - // the weekday advances by 1 for each normal X and by 2 - // for each leap X, hence by 5 every 4 years or by 35 - // which is 0 mod 7 every 28 years) but this rule breaks - // down if there are years between X and Y which are - // divisible by 4 but not leap (i.e. divisible by 100 but - // not 400), hence the correction. - - int yearReal = GetYear(tz); - int mod28 = yearReal % 28; - - // be careful to not go too far - we risk to leave the - // supported range - int year; - if ( mod28 < 10 ) - { - year = 1988 + mod28; // 1988 == 0 (mod 28) - } - else - { - year = 1970 + mod28 - 10; // 1970 == 10 (mod 28) - } - - int nCentury = year / 100, - nCenturyReal = yearReal / 100; - - // need to adjust for the years divisble by 400 which are - // not leap but are counted like leap ones if we just take - // the number of centuries in between for nLostWeekDays - int nLostWeekDays = (nCentury - nCenturyReal) - - (nCentury / 4 - nCenturyReal / 4); - - // we have to gain back the "lost" weekdays: note that the - // effect of this loop is to not do anything to - // nLostWeekDays (which we won't use any more), but to - // (indirectly) set the year correctly - while ( (nLostWeekDays % 7) != 0 ) - { - nLostWeekDays += year++ % 4 ? 1 : 2; - } - - // Keep year below 2000 so the 2digit year number - // can never match the month or day of the month - if (year>=2000) year-=28; - // at any rate, we couldn't go further than 1988 + 9 + 28! - wxASSERT_MSG( year < 2030, - _T("logic error in wxDateTime::Format") ); - - wxString strYear, strYear2; - strYear.Printf(_T("%d"), year); - strYear2.Printf(_T("%d"), year % 100); - - // find four strings not occurring in format (this is surely - // not the optimal way of doing it... improvements welcome!) - wxString fmt2 = format; - wxString replacement,replacement2,replacement3,replacement4; - for (int rnr=1; rnr<5 ; rnr++) - { - wxString r = (wxChar)-rnr; - while ( fmt2.Find(r) != wxNOT_FOUND ) - { - r << (wxChar)-rnr; - } - - switch (rnr) - { - case 1: replacement=r; break; - case 2: replacement2=r; break; - case 3: replacement3=r; break; - case 4: replacement4=r; break; - } - } - // replace all occurrences of year with it - bool wasReplaced = fmt2.Replace(strYear, replacement) > 0; - // evaluation order ensures we always attempt the replacement. - wasReplaced = (fmt2.Replace(strYear2, replacement2) > 0) || wasReplaced; - - // use strftime() to format the same date but in supported - // year - // - // NB: we assume that strftime() doesn't check for the - // date validity and will happily format the date - // corresponding to Feb 29 of a non leap year (which - // may happen if yearReal was leap and year is not) - struct tm tmAdjusted; - InitTm(tmAdjusted); - tmAdjusted.tm_hour = tm.hour; - tmAdjusted.tm_min = tm.min; - tmAdjusted.tm_sec = tm.sec; - tmAdjusted.tm_wday = tm.GetWeekDay(); - tmAdjusted.tm_yday = GetDayOfYear(); - tmAdjusted.tm_mday = tm.mday; - tmAdjusted.tm_mon = tm.mon; - tmAdjusted.tm_year = year - 1900; - tmAdjusted.tm_isdst = 0; // no DST, already adjusted - wxString str = CallStrftime(*p == _T('c') ? _T("%c") - : _T("%x"), - &tmAdjusted); - - // now replace the occurrence of 1999 with the real year - // we do this in two stages to stop the 2 digit year - // matching any substring of the 4 digit year. - // Any day,month hours and minutes components should be safe due - // to ensuring the range of the years. - wxString strYearReal, strYearReal2; - strYearReal.Printf(_T("%04d"), yearReal); - strYearReal2.Printf(_T("%02d"), yearReal % 100); - str.Replace(strYear, replacement3); - str.Replace(strYear2,replacement4); - str.Replace(replacement3, strYearReal); - str.Replace(replacement4, strYearReal2); - - // and replace back all occurrences of replacement string - if ( wasReplaced ) - { - str.Replace(replacement2, strYear2); - str.Replace(replacement, strYear); - } - - res += str; - } -#else // !HAVE_STRFTIME - // Use "%m/%d/%y %H:%M:%S" format instead - res += wxString::Format(wxT("%02d/%02d/%04d %02d:%02d:%02d"), - tm.mon+1,tm.mday, tm.year, tm.hour, tm.min, tm.sec); -#endif // HAVE_STRFTIME/!HAVE_STRFTIME - break; - - case _T('d'): // day of a month (01-31) - res += wxString::Format(fmt, tm.mday); - break; - - case _T('H'): // hour in 24h format (00-23) - res += wxString::Format(fmt, tm.hour); - break; - - case _T('I'): // hour in 12h format (01-12) - { - // 24h -> 12h, 0h -> 12h too - int hour12 = tm.hour > 12 ? tm.hour - 12 - : tm.hour ? tm.hour : 12; - res += wxString::Format(fmt, hour12); - } - break; - - case _T('j'): // day of the year - res += wxString::Format(fmt, GetDayOfYear(tz)); - break; - - case _T('l'): // milliseconds (NOT STANDARD) - res += wxString::Format(fmt, GetMillisecond(tz)); - break; - - case _T('m'): // month as a number (01-12) - res += wxString::Format(fmt, tm.mon + 1); - break; - - case _T('M'): // minute as a decimal number (00-59) - res += wxString::Format(fmt, tm.min); - break; - - case _T('p'): // AM or PM string -#ifdef HAVE_STRFTIME - res += CallStrftime(_T("%p"), &tmTimeOnly); -#else // !HAVE_STRFTIME - res += (tmTimeOnly.tm_hour > 12) ? wxT("pm") : wxT("am"); -#endif // HAVE_STRFTIME/!HAVE_STRFTIME - break; - - case _T('S'): // second as a decimal number (00-61) - res += wxString::Format(fmt, tm.sec); - break; - - case _T('U'): // week number in the year (Sunday 1st week day) - res += wxString::Format(fmt, GetWeekOfYear(Sunday_First, tz)); - break; - - case _T('W'): // week number in the year (Monday 1st week day) - res += wxString::Format(fmt, GetWeekOfYear(Monday_First, tz)); - break; - - case _T('w'): // weekday as a number (0-6), Sunday = 0 - res += wxString::Format(fmt, tm.GetWeekDay()); - break; - - // case _T('x'): -- handled with "%c" - - case _T('X'): // locale default time representation - // just use strftime() to format the time for us -#ifdef HAVE_STRFTIME - res += CallStrftime(_T("%X"), &tmTimeOnly); -#else // !HAVE_STRFTIME - res += wxString::Format(wxT("%02d:%02d:%02d"),tm.hour, tm.min, tm.sec); -#endif // HAVE_STRFTIME/!HAVE_STRFTIME - break; - - case _T('y'): // year without century (00-99) - res += wxString::Format(fmt, tm.year % 100); - break; - - case _T('Y'): // year with century - res += wxString::Format(fmt, tm.year); - break; - - case _T('Z'): // timezone name -#ifdef HAVE_STRFTIME - res += CallStrftime(_T("%Z"), &tmTimeOnly); -#endif - break; - - default: - // is it the format width? - for( fmt.clear(); - *p == _T('-') || *p == _T('+') || - *p == _T(' ') || wxIsdigit(*p); - ++p ) - { - fmt += *p; - } - - if ( !fmt.empty() ) - { - // we've only got the flags and width so far in fmt - fmt.Prepend(_T('%')); - fmt.Append(_T('d')); - - restart = true; - - break; - } - - // no, it wasn't the width - wxFAIL_MSG(_T("unknown format specificator")); - - // fall through and just copy it nevertheless - - case _T('%'): // a percent sign - res += *p; - break; - - case 0: // the end of string - wxFAIL_MSG(_T("missing format at the end of string")); - - // just put the '%' which was the last char in format - res += _T('%'); - break; - } - } - } - - return res; -} - -// this function parses a string in (strict) RFC 822 format: see the section 5 -// of the RFC for the detailed description, but briefly it's something of the -// form "Sat, 18 Dec 1999 00:48:30 +0100" -// -// this function is "strict" by design - it must reject anything except true -// RFC822 time specs. -// -// TODO a great candidate for using reg exps -const wxChar *wxDateTime::ParseRfc822Date(const wxChar* date) -{ - wxCHECK_MSG( date, (wxChar *)NULL, _T("NULL pointer in wxDateTime::Parse") ); - - const wxChar *p = date; - const wxChar *comma = wxStrchr(p, _T(',')); - if ( comma ) - { - // the part before comma is the weekday - - // skip it for now - we don't use but might check that it really - // corresponds to the specfied date - p = comma + 1; - - if ( *p != _T(' ') ) - { - wxLogDebug(_T("no space after weekday in RFC822 time spec")); - - return (wxChar *)NULL; - } - - p++; // skip space - } - - // the following 1 or 2 digits are the day number - if ( !wxIsdigit(*p) ) - { - wxLogDebug(_T("day number expected in RFC822 time spec, none found")); - - return (wxChar *)NULL; - } - - wxDateTime_t day = (wxDateTime_t)(*p++ - _T('0')); - if ( wxIsdigit(*p) ) - { - day *= 10; - day = (wxDateTime_t)(day + (*p++ - _T('0'))); - } - - if ( *p++ != _T(' ') ) - { - return (wxChar *)NULL; - } - - // the following 3 letters specify the month - wxString monName(p, 3); - Month mon; - if ( monName == _T("Jan") ) - mon = Jan; - else if ( monName == _T("Feb") ) - mon = Feb; - else if ( monName == _T("Mar") ) - mon = Mar; - else if ( monName == _T("Apr") ) - mon = Apr; - else if ( monName == _T("May") ) - mon = May; - else if ( monName == _T("Jun") ) - mon = Jun; - else if ( monName == _T("Jul") ) - mon = Jul; - else if ( monName == _T("Aug") ) - mon = Aug; - else if ( monName == _T("Sep") ) - mon = Sep; - else if ( monName == _T("Oct") ) - mon = Oct; - else if ( monName == _T("Nov") ) - mon = Nov; - else if ( monName == _T("Dec") ) - mon = Dec; - else - { - wxLogDebug(_T("Invalid RFC 822 month name '%s'"), monName.c_str()); - - return (wxChar *)NULL; - } - - p += 3; - - if ( *p++ != _T(' ') ) - { - return (wxChar *)NULL; - } - - // next is the year - if ( !wxIsdigit(*p) ) - { - // no year? - return (wxChar *)NULL; - } - - int year = *p++ - _T('0'); - - if ( !wxIsdigit(*p) ) - { - // should have at least 2 digits in the year - return (wxChar *)NULL; - } - - year *= 10; - year += *p++ - _T('0'); - - // is it a 2 digit year (as per original RFC 822) or a 4 digit one? - if ( wxIsdigit(*p) ) - { - year *= 10; - year += *p++ - _T('0'); - - if ( !wxIsdigit(*p) ) - { - // no 3 digit years please - return (wxChar *)NULL; - } - - year *= 10; - year += *p++ - _T('0'); - } - - if ( *p++ != _T(' ') ) - { - return (wxChar *)NULL; - } - - // time is in the format hh:mm:ss and seconds are optional - if ( !wxIsdigit(*p) ) - { - return (wxChar *)NULL; - } - - wxDateTime_t hour = (wxDateTime_t)(*p++ - _T('0')); - - if ( !wxIsdigit(*p) ) - { - return (wxChar *)NULL; - } - - hour *= 10; - hour = (wxDateTime_t)(hour + (*p++ - _T('0'))); - - if ( *p++ != _T(':') ) - { - return (wxChar *)NULL; - } - - if ( !wxIsdigit(*p) ) - { - return (wxChar *)NULL; - } - - wxDateTime_t min = (wxDateTime_t)(*p++ - _T('0')); - - if ( !wxIsdigit(*p) ) - { - return (wxChar *)NULL; - } - - min *= 10; - min = (wxDateTime_t)(min + *p++ - _T('0')); - - wxDateTime_t sec = 0; - if ( *p == _T(':') ) - { - p++; - if ( !wxIsdigit(*p) ) - { - return (wxChar *)NULL; - } - - sec = (wxDateTime_t)(*p++ - _T('0')); - - if ( !wxIsdigit(*p) ) - { - return (wxChar *)NULL; - } - - sec *= 10; - sec = (wxDateTime_t)(sec + *p++ - _T('0')); - } - - if ( *p++ != _T(' ') ) - { - return (wxChar *)NULL; - } - - // and now the interesting part: the timezone - int offset wxDUMMY_INITIALIZE(0); - if ( *p == _T('-') || *p == _T('+') ) - { - // the explicit offset given: it has the form of hhmm - bool plus = *p++ == _T('+'); - - if ( !wxIsdigit(*p) || !wxIsdigit(*(p + 1)) ) - { - return (wxChar *)NULL; - } - - // hours - offset = MIN_PER_HOUR*(10*(*p - _T('0')) + (*(p + 1) - _T('0'))); - - p += 2; - - if ( !wxIsdigit(*p) || !wxIsdigit(*(p + 1)) ) - { - return (wxChar *)NULL; - } - - // minutes - offset += 10*(*p - _T('0')) + (*(p + 1) - _T('0')); - - if ( !plus ) - { - offset = -offset; - } - - p += 2; - } - else - { - // the symbolic timezone given: may be either military timezone or one - // of standard abbreviations - if ( !*(p + 1) ) - { - // military: Z = UTC, J unused, A = -1, ..., Y = +12 - static const int offsets[26] = - { - //A B C D E F G H I J K L M - -1, -2, -3, -4, -5, -6, -7, -8, -9, 0, -10, -11, -12, - //N O P R Q S T U V W Z Y Z - +1, +2, +3, +4, +5, +6, +7, +8, +9, +10, +11, +12, 0 - }; - - if ( *p < _T('A') || *p > _T('Z') || *p == _T('J') ) - { - wxLogDebug(_T("Invalid militaty timezone '%c'"), *p); - - return (wxChar *)NULL; - } - - offset = offsets[*p++ - _T('A')]; - } - else - { - // abbreviation - wxString tz = p; - if ( tz == _T("UT") || tz == _T("UTC") || tz == _T("GMT") ) - offset = 0; - else if ( tz == _T("AST") ) - offset = AST - GMT0; - else if ( tz == _T("ADT") ) - offset = ADT - GMT0; - else if ( tz == _T("EST") ) - offset = EST - GMT0; - else if ( tz == _T("EDT") ) - offset = EDT - GMT0; - else if ( tz == _T("CST") ) - offset = CST - GMT0; - else if ( tz == _T("CDT") ) - offset = CDT - GMT0; - else if ( tz == _T("MST") ) - offset = MST - GMT0; - else if ( tz == _T("MDT") ) - offset = MDT - GMT0; - else if ( tz == _T("PST") ) - offset = PST - GMT0; - else if ( tz == _T("PDT") ) - offset = PDT - GMT0; - else - { - wxLogDebug(_T("Unknown RFC 822 timezone '%s'"), p); - - return (wxChar *)NULL; - } - - p += tz.length(); - } - - // make it minutes - offset *= MIN_PER_HOUR; - } - - // the spec was correct, construct the date from the values we found - Set(day, mon, year, hour, min, sec); - MakeFromTimezone(TimeZone::Make(offset*SEC_PER_MIN)); - - return p; -} - -#ifdef __WINDOWS__ - -// returns the string containing strftime() format used for short dates in the -// current locale or an empty string -static wxString GetLocaleDateFormat() -{ - wxString fmtWX; - - // there is no setlocale() under Windows CE, so just always query the - // system there -#ifndef __WXWINCE__ - if ( strcmp(setlocale(LC_ALL, NULL), "C") != 0 ) -#endif - { - // The locale was programatically set to non-C. We assume that this was - // done using wxLocale, in which case thread's current locale is also - // set to correct LCID value and we can use GetLocaleInfo to determine - // the correct formatting string: -#ifdef __WXWINCE__ - LCID lcid = LOCALE_USER_DEFAULT; -#else - LCID lcid = GetThreadLocale(); -#endif - // according to MSDN 80 chars is max allowed for short date format - wxChar fmt[81]; - if ( ::GetLocaleInfo(lcid, LOCALE_SSHORTDATE, fmt, WXSIZEOF(fmt)) ) - { - wxChar chLast = _T('\0'); - size_t lastCount = 0; - for ( const wxChar *p = fmt; /* NUL handled inside */; p++ ) - { - if ( *p == chLast ) - { - lastCount++; - continue; - } - - switch ( *p ) - { - // these characters come in groups, start counting them - case _T('d'): - case _T('M'): - case _T('y'): - case _T('g'): - chLast = *p; - lastCount = 1; - break; - - default: - // first deal with any special characters we have had - if ( lastCount ) - { - switch ( chLast ) - { - case _T('d'): - switch ( lastCount ) - { - case 1: // d - case 2: // dd - // these two are the same as we - // don't distinguish between 1 and - // 2 digits for days - fmtWX += _T("%d"); - break; - - case 3: // ddd - fmtWX += _T("%a"); - break; - - case 4: // dddd - fmtWX += _T("%A"); - break; - - default: - wxFAIL_MSG( _T("too many 'd's") ); - } - break; - - case _T('M'): - switch ( lastCount ) - { - case 1: // M - case 2: // MM - // as for 'd' and 'dd' above - fmtWX += _T("%m"); - break; - - case 3: - fmtWX += _T("%b"); - break; - - case 4: - fmtWX += _T("%B"); - break; - - default: - wxFAIL_MSG( _T("too many 'M's") ); - } - break; - - case _T('y'): - switch ( lastCount ) - { - case 1: // y - case 2: // yy - fmtWX += _T("%y"); - break; - - case 4: // yyyy - fmtWX += _T("%Y"); - break; - - default: - wxFAIL_MSG( _T("wrong number of 'y's") ); - } - break; - - case _T('g'): - // strftime() doesn't have era string, - // ignore this format - wxASSERT_MSG( lastCount <= 2, - _T("too many 'g's") ); - break; - - default: - wxFAIL_MSG( _T("unreachable") ); - } - - chLast = _T('\0'); - lastCount = 0; - } - - // not a special character so must be just a separator, - // treat as is - if ( *p != _T('\0') ) - { - if ( *p == _T('%') ) - { - // this one needs to be escaped - fmtWX += _T('%'); - } - - fmtWX += *p; - } - } - - if ( *p == _T('\0') ) - break; - } - } - //else: GetLocaleInfo() failed, leave fmtDate value unchanged and - // try our luck with the default formats - } - //else: default C locale, default formats should work - - return fmtWX; -} - -#endif // __WINDOWS__ - -const wxChar *wxDateTime::ParseFormat(const wxChar *date, - const wxChar *format, - const wxDateTime& dateDef) -{ - wxCHECK_MSG( date && format, (wxChar *)NULL, - _T("NULL pointer in wxDateTime::ParseFormat()") ); - - wxString str; - unsigned long num; - - // what fields have we found? - bool haveWDay = false, - haveYDay = false, - haveDay = false, - haveMon = false, - haveYear = false, - haveHour = false, - haveMin = false, - haveSec = false; - - bool hourIsIn12hFormat = false, // or in 24h one? - isPM = false; // AM by default - - // and the value of the items we have (init them to get rid of warnings) - wxDateTime_t sec = 0, - min = 0, - hour = 0; - WeekDay wday = Inv_WeekDay; - wxDateTime_t yday = 0, - mday = 0; - wxDateTime::Month mon = Inv_Month; - int year = 0; - - const wxChar *input = date; - for ( const wxChar *fmt = format; *fmt; fmt++ ) - { - if ( *fmt != _T('%') ) - { - if ( wxIsspace(*fmt) ) - { - // a white space in the format string matches 0 or more white - // spaces in the input - while ( wxIsspace(*input) ) - { - input++; - } - } - else // !space - { - // any other character (not whitespace, not '%') must be - // matched by itself in the input - if ( *input++ != *fmt ) - { - // no match - return (wxChar *)NULL; - } - } - - // done with this format char - continue; - } - - // start of a format specification - - // parse the optional width - size_t width = 0; - while ( wxIsdigit(*++fmt) ) - { - width *= 10; - width += *fmt - _T('0'); - } - - // the default widths for the various fields - if ( !width ) - { - switch ( *fmt ) - { - case _T('Y'): // year has 4 digits - width = 4; - break; - - case _T('j'): // day of year has 3 digits - case _T('l'): // milliseconds have 3 digits - width = 3; - break; - - case _T('w'): // week day as number has only one - width = 1; - break; - - default: - // default for all other fields - width = 2; - } - } - - // then the format itself - switch ( *fmt ) - { - case _T('a'): // a weekday name - case _T('A'): - { - int flag = *fmt == _T('a') ? Name_Abbr : Name_Full; - wday = GetWeekDayFromName(GetAlphaToken(input), flag); - if ( wday == Inv_WeekDay ) - { - // no match - return (wxChar *)NULL; - } - } - haveWDay = true; - break; - - case _T('b'): // a month name - case _T('B'): - { - int flag = *fmt == _T('b') ? Name_Abbr : Name_Full; - mon = GetMonthFromName(GetAlphaToken(input), flag); - if ( mon == Inv_Month ) - { - // no match - return (wxChar *)NULL; - } - } - haveMon = true; - break; - - case _T('c'): // locale default date and time representation - { - wxDateTime dt; - - // this is the format which corresponds to ctime() output - // and strptime("%c") should parse it, so try it first - static const wxChar *fmtCtime = _T("%a %b %d %H:%M:%S %Y"); - - const wxChar *result = dt.ParseFormat(input, fmtCtime); - if ( !result ) - { - result = dt.ParseFormat(input, _T("%x %X")); - } - - if ( !result ) - { - result = dt.ParseFormat(input, _T("%X %x")); - } - - if ( !result ) - { - // we've tried everything and still no match - return (wxChar *)NULL; - } - - Tm tm = dt.GetTm(); - - haveDay = haveMon = haveYear = - haveHour = haveMin = haveSec = true; - - hour = tm.hour; - min = tm.min; - sec = tm.sec; - - year = tm.year; - mon = tm.mon; - mday = tm.mday; - - input = result; - } - break; - - case _T('d'): // day of a month (01-31) - if ( !GetNumericToken(width, input, &num) || - (num > 31) || (num < 1) ) - { - // no match - return (wxChar *)NULL; - } - - // we can't check whether the day range is correct yet, will - // do it later - assume ok for now - haveDay = true; - mday = (wxDateTime_t)num; - break; - - case _T('H'): // hour in 24h format (00-23) - if ( !GetNumericToken(width, input, &num) || (num > 23) ) - { - // no match - return (wxChar *)NULL; - } - - haveHour = true; - hour = (wxDateTime_t)num; - break; - - case _T('I'): // hour in 12h format (01-12) - if ( !GetNumericToken(width, input, &num) || !num || (num > 12) ) - { - // no match - return (wxChar *)NULL; - } - - haveHour = true; - hourIsIn12hFormat = true; - hour = (wxDateTime_t)(num % 12); // 12 should be 0 - break; - - case _T('j'): // day of the year - if ( !GetNumericToken(width, input, &num) || !num || (num > 366) ) - { - // no match - return (wxChar *)NULL; - } - - haveYDay = true; - yday = (wxDateTime_t)num; - break; - - case _T('m'): // month as a number (01-12) - if ( !GetNumericToken(width, input, &num) || !num || (num > 12) ) - { - // no match - return (wxChar *)NULL; - } - - haveMon = true; - mon = (Month)(num - 1); - break; - - case _T('M'): // minute as a decimal number (00-59) - if ( !GetNumericToken(width, input, &num) || (num > 59) ) - { - // no match - return (wxChar *)NULL; - } - - haveMin = true; - min = (wxDateTime_t)num; - break; - - case _T('p'): // AM or PM string - { - wxString am, pm, token = GetAlphaToken(input); - - GetAmPmStrings(&am, &pm); - if (am.empty() && pm.empty()) - return (wxChar *)NULL; // no am/pm strings defined - if ( token.CmpNoCase(pm) == 0 ) - { - isPM = true; - } - else if ( token.CmpNoCase(am) != 0 ) - { - // no match - return (wxChar *)NULL; - } - } - break; - - case _T('r'): // time as %I:%M:%S %p - { - wxDateTime dt; - input = dt.ParseFormat(input, _T("%I:%M:%S %p")); - if ( !input ) - { - // no match - return (wxChar *)NULL; - } - - haveHour = haveMin = haveSec = true; - - Tm tm = dt.GetTm(); - hour = tm.hour; - min = tm.min; - sec = tm.sec; - } - break; - - case _T('R'): // time as %H:%M - { - wxDateTime dt; - input = dt.ParseFormat(input, _T("%H:%M")); - if ( !input ) - { - // no match - return (wxChar *)NULL; - } - - haveHour = haveMin = true; - - Tm tm = dt.GetTm(); - hour = tm.hour; - min = tm.min; - } - break; - - case _T('S'): // second as a decimal number (00-61) - if ( !GetNumericToken(width, input, &num) || (num > 61) ) - { - // no match - return (wxChar *)NULL; - } - - haveSec = true; - sec = (wxDateTime_t)num; - break; - - case _T('T'): // time as %H:%M:%S - { - wxDateTime dt; - input = dt.ParseFormat(input, _T("%H:%M:%S")); - if ( !input ) - { - // no match - return (wxChar *)NULL; - } - - haveHour = haveMin = haveSec = true; - - Tm tm = dt.GetTm(); - hour = tm.hour; - min = tm.min; - sec = tm.sec; - } - break; - - case _T('w'): // weekday as a number (0-6), Sunday = 0 - if ( !GetNumericToken(width, input, &num) || (wday > 6) ) - { - // no match - return (wxChar *)NULL; - } - - haveWDay = true; - wday = (WeekDay)num; - break; - - case _T('x'): // locale default date representation -#ifdef HAVE_STRPTIME - // try using strptime() -- it may fail even if the input is - // correct but the date is out of range, so we will fall back - // to our generic code anyhow - { - struct tm tm; - - const wxChar *result = CallStrptime(input, "%x", &tm); - if ( result ) - { - input = result; - - haveDay = haveMon = haveYear = true; - - year = 1900 + tm.tm_year; - mon = (Month)tm.tm_mon; - mday = tm.tm_mday; - - break; - } - } -#endif // HAVE_STRPTIME - - { - wxDateTime dt; - wxString fmtDate, - fmtDateAlt; - -#ifdef __WINDOWS__ - // The above doesn't work for all locales, try to query - // Windows for the right way of formatting the date: - fmtDate = GetLocaleDateFormat(); - if ( fmtDate.empty() ) -#endif - { - if ( IsWestEuropeanCountry(GetCountry()) || - GetCountry() == Russia ) - { - fmtDate = _T("%d/%m/%y"); - fmtDateAlt = _T("%m/%d/%y"); - } - else // assume USA - { - fmtDate = _T("%m/%d/%y"); - fmtDateAlt = _T("%d/%m/%y"); - } - } - - const wxChar *result = dt.ParseFormat(input, fmtDate); - - if ( !result && !fmtDateAlt.empty() ) - { - // ok, be nice and try another one - result = dt.ParseFormat(input, fmtDateAlt); - } - - if ( !result ) - { - // bad luck - return (wxChar *)NULL; - } - - Tm tm = dt.GetTm(); - - haveDay = haveMon = haveYear = true; - - year = tm.year; - mon = tm.mon; - mday = tm.mday; - - input = result; - } - - break; - - case _T('X'): // locale default time representation -#ifdef HAVE_STRPTIME - { - // use strptime() to do it for us (FIXME !Unicode friendly) - struct tm tm; - input = CallStrptime(input, "%X", &tm); - if ( !input ) - { - return (wxChar *)NULL; - } - - haveHour = haveMin = haveSec = true; - - hour = tm.tm_hour; - min = tm.tm_min; - sec = tm.tm_sec; - } -#else // !HAVE_STRPTIME - // TODO under Win32 we can query the LOCALE_ITIME system - // setting which says whether the default time format is - // 24 or 12 hour - { - // try to parse what follows as "%H:%M:%S" and, if this - // fails, as "%I:%M:%S %p" - this should catch the most - // common cases - wxDateTime dt; - - const wxChar *result = dt.ParseFormat(input, _T("%T")); - if ( !result ) - { - result = dt.ParseFormat(input, _T("%r")); - } - - if ( !result ) - { - // no match - return (wxChar *)NULL; - } - - haveHour = haveMin = haveSec = true; - - Tm tm = dt.GetTm(); - hour = tm.hour; - min = tm.min; - sec = tm.sec; - - input = result; - } -#endif // HAVE_STRPTIME/!HAVE_STRPTIME - break; - - case _T('y'): // year without century (00-99) - if ( !GetNumericToken(width, input, &num) || (num > 99) ) - { - // no match - return (wxChar *)NULL; - } - - haveYear = true; - - // TODO should have an option for roll over date instead of - // hard coding it here - year = (num > 30 ? 1900 : 2000) + (wxDateTime_t)num; - break; - - case _T('Y'): // year with century - if ( !GetNumericToken(width, input, &num) ) - { - // no match - return (wxChar *)NULL; - } - - haveYear = true; - year = (wxDateTime_t)num; - break; - - case _T('Z'): // timezone name - wxFAIL_MSG(_T("TODO")); - break; - - case _T('%'): // a percent sign - if ( *input++ != _T('%') ) - { - // no match - return (wxChar *)NULL; - } - break; - - case 0: // the end of string - wxFAIL_MSG(_T("unexpected format end")); - - // fall through - - default: // not a known format spec - return (wxChar *)NULL; - } - } - - // format matched, try to construct a date from what we have now - Tm tmDef; - if ( dateDef.IsValid() ) - { - // take this date as default - tmDef = dateDef.GetTm(); - } - else if ( IsValid() ) - { - // if this date is valid, don't change it - tmDef = GetTm(); - } - else - { - // no default and this date is invalid - fall back to Today() - tmDef = Today().GetTm(); - } - - Tm tm = tmDef; - - // set the date - if ( haveYear ) - { - tm.year = year; - } - - // TODO we don't check here that the values are consistent, if both year - // day and month/day were found, we just ignore the year day and we - // also always ignore the week day - if ( haveMon && haveDay ) - { - if ( mday > GetNumOfDaysInMonth(tm.year, mon) ) - { - wxLogDebug(_T("bad month day in wxDateTime::ParseFormat")); - - return (wxChar *)NULL; - } - - tm.mon = mon; - tm.mday = mday; - } - else if ( haveYDay ) - { - if ( yday > GetNumberOfDays(tm.year) ) - { - wxLogDebug(_T("bad year day in wxDateTime::ParseFormat")); - - return (wxChar *)NULL; - } - - Tm tm2 = wxDateTime(1, Jan, tm.year).SetToYearDay(yday).GetTm(); - - tm.mon = tm2.mon; - tm.mday = tm2.mday; - } - - // deal with AM/PM - if ( haveHour && hourIsIn12hFormat && isPM ) - { - // translate to 24hour format - hour += 12; - } - //else: either already in 24h format or no translation needed - - // set the time - if ( haveHour ) - { - tm.hour = hour; - } - - if ( haveMin ) - { - tm.min = min; - } - - if ( haveSec ) - { - tm.sec = sec; - } - - Set(tm); - - // finally check that the week day is consistent -- if we had it - if ( haveWDay && GetWeekDay() != wday ) - { - wxLogDebug(_T("inconsistsnet week day in wxDateTime::ParseFormat()")); - - return NULL; - } - - return input; -} - -const wxChar *wxDateTime::ParseDateTime(const wxChar *date) -{ - wxCHECK_MSG( date, (wxChar *)NULL, _T("NULL pointer in wxDateTime::Parse") ); - - // Set to current day and hour, so strings like '14:00' becomes today at - // 14, not some other random date - wxDateTime dtDate = wxDateTime::Today(); - wxDateTime dtTime = wxDateTime::Today(); - - const wxChar* pchTime; - - // Try to parse the beginning of the string as a date - const wxChar* pchDate = dtDate.ParseDate(date); - - // We got a date in the beginning, see if there is a time specified after the date - if ( pchDate ) - { - // Skip spaces, as the ParseTime() function fails on spaces - while ( wxIsspace(*pchDate) ) - pchDate++; - - pchTime = dtTime.ParseTime(pchDate); - } - else // no date in the beginning - { - // check and see if we have a time followed by a date - pchTime = dtTime.ParseTime(date); - if ( pchTime ) - { - while ( wxIsspace(*pchTime) ) - pchTime++; - - pchDate = dtDate.ParseDate(pchTime); - } - } - - // If we have a date specified, set our own data to the same date - if ( !pchDate || !pchTime ) - return NULL; - - Set(dtDate.GetDay(), dtDate.GetMonth(), dtDate.GetYear(), - dtTime.GetHour(), dtTime.GetMinute(), dtTime.GetSecond(), - dtTime.GetMillisecond()); - - // Return endpoint of scan - return pchDate > pchTime ? pchDate : pchTime; -} - -const wxChar *wxDateTime::ParseDate(const wxChar *date) -{ - // this is a simplified version of ParseDateTime() which understands only - // "today" (for wxDate compatibility) and digits only otherwise (and not - // all esoteric constructions ParseDateTime() knows about) - - wxCHECK_MSG( date, (wxChar *)NULL, _T("NULL pointer in wxDateTime::Parse") ); - - const wxChar *p = date; - while ( wxIsspace(*p) ) - p++; - - // some special cases - static struct - { - const wxChar *str; - int dayDiffFromToday; - } literalDates[] = - { - { wxTRANSLATE("today"), 0 }, - { wxTRANSLATE("yesterday"), -1 }, - { wxTRANSLATE("tomorrow"), 1 }, - }; - - for ( size_t n = 0; n < WXSIZEOF(literalDates); n++ ) - { - const wxString dateStr = wxGetTranslation(literalDates[n].str); - size_t len = dateStr.length(); - if ( wxStrlen(p) >= len ) - { - wxString str(p, len); - if ( str.CmpNoCase(dateStr) == 0 ) - { - // nothing can follow this, so stop here - p += len; - - int dayDiffFromToday = literalDates[n].dayDiffFromToday; - *this = Today(); - if ( dayDiffFromToday ) - { - *this += wxDateSpan::Days(dayDiffFromToday); - } - - return p; - } - } - } - - // We try to guess what we have here: for each new (numeric) token, we - // determine if it can be a month, day or a year. Of course, there is an - // ambiguity as some numbers may be days as well as months, so we also - // have the ability to back track. - - // what do we have? - bool haveDay = false, // the months day? - haveWDay = false, // the day of week? - haveMon = false, // the month? - haveYear = false; // the year? - - // and the value of the items we have (init them to get rid of warnings) - WeekDay wday = Inv_WeekDay; - wxDateTime_t day = 0; - wxDateTime::Month mon = Inv_Month; - int year = 0; - - // tokenize the string - size_t nPosCur = 0; - static const wxChar *dateDelimiters = _T(".,/-\t\r\n "); - wxStringTokenizer tok(p, dateDelimiters); - while ( tok.HasMoreTokens() ) - { - wxString token = tok.GetNextToken(); - if ( !token ) - continue; - - // is it a number? - unsigned long val; - if ( token.ToULong(&val) ) - { - // guess what this number is - - bool isDay = false, - isMonth = false, - isYear = false; - - if ( !haveMon && val > 0 && val <= 12 ) - { - // assume it is month - isMonth = true; - } - else // not the month - { - if ( haveDay ) - { - // this can only be the year - isYear = true; - } - else // may be either day or year - { - // use a leap year if we don't have the year yet to allow - // dates like 2/29/1976 which would be rejected otherwise - wxDateTime_t max_days = (wxDateTime_t)( - haveMon - ? GetNumOfDaysInMonth(haveYear ? year : 1976, mon) - : 31 - ); - - // can it be day? - if ( (val == 0) || (val > (unsigned long)max_days) ) - { - // no - isYear = true; - } - else // yes, suppose it's the day - { - isDay = true; - } - } - } - - if ( isYear ) - { - if ( haveYear ) - break; - - haveYear = true; - - year = (wxDateTime_t)val; - } - else if ( isDay ) - { - if ( haveDay ) - break; - - haveDay = true; - - day = (wxDateTime_t)val; - } - else if ( isMonth ) - { - haveMon = true; - - mon = (Month)(val - 1); - } - } - else // not a number - { - // be careful not to overwrite the current mon value - Month mon2 = GetMonthFromName(token, Name_Full | Name_Abbr); - if ( mon2 != Inv_Month ) - { - // it's a month - if ( haveMon ) - { - // but we already have a month - maybe we guessed wrong? - if ( !haveDay ) - { - // no need to check in month range as always < 12, but - // the days are counted from 1 unlike the months - day = (wxDateTime_t)(mon + 1); - haveDay = true; - } - else - { - // could possible be the year (doesn't the year come - // before the month in the japanese format?) (FIXME) - break; - } - } - - mon = mon2; - - haveMon = true; - } - else // not a valid month name - { - WeekDay wday2 = GetWeekDayFromName(token, Name_Full | Name_Abbr); - if ( wday2 != Inv_WeekDay ) - { - // a week day - if ( haveWDay ) - { - break; - } - - wday = wday2; - - haveWDay = true; - } - else // not a valid weekday name - { - // try the ordinals - static const wxChar *ordinals[] = - { - wxTRANSLATE("first"), - wxTRANSLATE("second"), - wxTRANSLATE("third"), - wxTRANSLATE("fourth"), - wxTRANSLATE("fifth"), - wxTRANSLATE("sixth"), - wxTRANSLATE("seventh"), - wxTRANSLATE("eighth"), - wxTRANSLATE("ninth"), - wxTRANSLATE("tenth"), - wxTRANSLATE("eleventh"), - wxTRANSLATE("twelfth"), - wxTRANSLATE("thirteenth"), - wxTRANSLATE("fourteenth"), - wxTRANSLATE("fifteenth"), - wxTRANSLATE("sixteenth"), - wxTRANSLATE("seventeenth"), - wxTRANSLATE("eighteenth"), - wxTRANSLATE("nineteenth"), - wxTRANSLATE("twentieth"), - // that's enough - otherwise we'd have problems with - // composite (or not) ordinals - }; - - size_t n; - for ( n = 0; n < WXSIZEOF(ordinals); n++ ) - { - if ( token.CmpNoCase(ordinals[n]) == 0 ) - { - break; - } - } - - if ( n == WXSIZEOF(ordinals) ) - { - // stop here - something unknown - break; - } - - // it's a day - if ( haveDay ) - { - // don't try anything here (as in case of numeric day - // above) - the symbolic day spec should always - // precede the month/year - break; - } - - haveDay = true; - - day = (wxDateTime_t)(n + 1); - } - } - } - - nPosCur = tok.GetPosition(); - } - - // either no more tokens or the scan was stopped by something we couldn't - // parse - in any case, see if we can construct a date from what we have - if ( !haveDay && !haveWDay ) - { - wxLogDebug(_T("ParseDate: no day, no weekday hence no date.")); - - return NULL; - } - - if ( haveWDay && (haveMon || haveYear || haveDay) && - !(haveDay && haveMon && haveYear) ) - { - // without adjectives (which we don't support here) the week day only - // makes sense completely separately or with the full date - // specification (what would "Wed 1999" mean?) - return NULL; - } - - if ( !haveWDay && haveYear && !(haveDay && haveMon) ) - { - // may be we have month and day instead of day and year? - if ( haveDay && !haveMon ) - { - if ( day <= 12 ) - { - // exchange day and month - mon = (wxDateTime::Month)(day - 1); - - // we're in the current year then - if ( (year > 0) && (year <= (int)GetNumOfDaysInMonth(Inv_Year, mon)) ) - { - day = (wxDateTime_t)year; - - haveMon = true; - haveYear = false; - } - //else: no, can't exchange, leave haveMon == false - } - } - - if ( !haveMon ) - { - // if we give the year, month and day must be given too - wxLogDebug(_T("ParseDate: day and month should be specified if year is.")); - - return NULL; - } - } - - if ( !haveMon ) - { - mon = GetCurrentMonth(); - } - - if ( !haveYear ) - { - year = GetCurrentYear(); - } - - if ( haveDay ) - { - // normally we check the day above but the check is optimistic in case - // we find the day before its month/year so we have to redo it now - if ( day > GetNumOfDaysInMonth(year, mon) ) - return NULL; - - Set(day, mon, year); - - if ( haveWDay ) - { - // check that it is really the same - if ( GetWeekDay() != wday ) - { - // inconsistency detected - wxLogDebug(_T("ParseDate: inconsistent day/weekday.")); - - return (wxChar *)NULL; - } - } - } - else // haveWDay - { - *this = Today(); - - SetToWeekDayInSameWeek(wday); - } - - // return the pointer to the first unparsed char - p += nPosCur; - if ( nPosCur && wxStrchr(dateDelimiters, *(p - 1)) ) - { - // if we couldn't parse the token after the delimiter, put back the - // delimiter as well - p--; - } - - return p; -} - -const wxChar *wxDateTime::ParseTime(const wxChar *time) -{ - wxCHECK_MSG( time, (wxChar *)NULL, _T("NULL pointer in wxDateTime::Parse") ); - - // first try some extra things - static const struct - { - const wxChar *name; - wxDateTime_t hour; - } stdTimes[] = - { - { wxTRANSLATE("noon"), 12 }, - { wxTRANSLATE("midnight"), 00 }, - // anything else? - }; - - for ( size_t n = 0; n < WXSIZEOF(stdTimes); n++ ) - { - wxString timeString = wxGetTranslation(stdTimes[n].name); - size_t len = timeString.length(); - if ( timeString.CmpNoCase(wxString(time, len)) == 0 ) - { - // casts required by DigitalMars - Set(stdTimes[n].hour, wxDateTime_t(0), wxDateTime_t(0)); - - return time + len; - } - } - - // try all time formats we may think about in the order from longest to - // shortest - - // 12hour with AM/PM? - const wxChar *result = ParseFormat(time, _T("%I:%M:%S %p")); - - if ( !result ) - { - // normally, it's the same, but why not try it? - result = ParseFormat(time, _T("%H:%M:%S")); - } - - if ( !result ) - { - // 12hour with AM/PM but without seconds? - result = ParseFormat(time, _T("%I:%M %p")); - } - - if ( !result ) - { - // without seconds? - result = ParseFormat(time, _T("%H:%M")); - } - - if ( !result ) - { - // just the hour and AM/PM? - result = ParseFormat(time, _T("%I %p")); - } - - if ( !result ) - { - // just the hour? - result = ParseFormat(time, _T("%H")); - } - - if ( !result ) - { - // parse the standard format: normally it is one of the formats above - // but it may be set to something completely different by the user - result = ParseFormat(time, _T("%X")); - } - - // TODO: parse timezones - - return result; -} - -// ---------------------------------------------------------------------------- -// Workdays and holidays support -// ---------------------------------------------------------------------------- - -bool wxDateTime::IsWorkDay(Country WXUNUSED(country)) const -{ - return !wxDateTimeHolidayAuthority::IsHoliday(*this); -} - -// ============================================================================ -// wxDateSpan -// ============================================================================ - -wxDateSpan WXDLLIMPEXP_BASE operator*(int n, const wxDateSpan& ds) -{ - wxDateSpan ds1(ds); - return ds1.Multiply(n); -} - -// ============================================================================ -// wxTimeSpan -// ============================================================================ - -wxTimeSpan WXDLLIMPEXP_BASE operator*(int n, const wxTimeSpan& ts) -{ - return wxTimeSpan(ts).Multiply(n); -} - -// this enum is only used in wxTimeSpan::Format() below but we can't declare -// it locally to the method as it provokes an internal compiler error in egcs -// 2.91.60 when building with -O2 -enum TimeSpanPart -{ - Part_Week, - Part_Day, - Part_Hour, - Part_Min, - Part_Sec, - Part_MSec -}; - -// not all strftime(3) format specifiers make sense here because, for example, -// a time span doesn't have a year nor a timezone -// -// Here are the ones which are supported (all of them are supported by strftime -// as well): -// %H hour in 24 hour format -// %M minute (00 - 59) -// %S second (00 - 59) -// %% percent sign -// -// Also, for MFC CTimeSpan compatibility, we support -// %D number of days -// -// And, to be better than MFC :-), we also have -// %E number of wEeks -// %l milliseconds (000 - 999) -wxString wxTimeSpan::Format(const wxChar *format) const -{ - // we deal with only positive time spans here and just add the sign in - // front for the negative ones - if ( IsNegative() ) - { - wxString str(Negate().Format(format)); - return _T("-") + str; - } - - wxCHECK_MSG( format, wxEmptyString, - _T("NULL format in wxTimeSpan::Format") ); - - wxString str; - str.Alloc(wxStrlen(format)); - - // Suppose we have wxTimeSpan ts(1 /* hour */, 2 /* min */, 3 /* sec */) - // - // Then, of course, ts.Format("%H:%M:%S") must return "01:02:03", but the - // question is what should ts.Format("%S") do? The code here returns "3273" - // in this case (i.e. the total number of seconds, not just seconds % 60) - // because, for me, this call means "give me entire time interval in - // seconds" and not "give me the seconds part of the time interval" - // - // If we agree that it should behave like this, it is clear that the - // interpretation of each format specifier depends on the presence of the - // other format specs in the string: if there was "%H" before "%M", we - // should use GetMinutes() % 60, otherwise just GetMinutes() &c - - // we remember the most important unit found so far - TimeSpanPart partBiggest = Part_MSec; - - for ( const wxChar *pch = format; *pch; pch++ ) - { - wxChar ch = *pch; - - if ( ch == _T('%') ) - { - // the start of the format specification of the printf() below - wxString fmtPrefix(_T('%')); - - // the number - long n; - - // the number of digits for the format string, 0 if unused - unsigned digits = 0; - - ch = *++pch; // get the format spec char - switch ( ch ) - { - default: - wxFAIL_MSG( _T("invalid format character") ); - // fall through - - case _T('%'): - str += ch; - - // skip the part below switch - continue; - - case _T('D'): - n = GetDays(); - if ( partBiggest < Part_Day ) - { - n %= DAYS_PER_WEEK; - } - else - { - partBiggest = Part_Day; - } - break; - - case _T('E'): - partBiggest = Part_Week; - n = GetWeeks(); - break; - - case _T('H'): - n = GetHours(); - if ( partBiggest < Part_Hour ) - { - n %= HOURS_PER_DAY; - } - else - { - partBiggest = Part_Hour; - } - - digits = 2; - break; - - case _T('l'): - n = GetMilliseconds().ToLong(); - if ( partBiggest < Part_MSec ) - { - n %= 1000; - } - //else: no need to reset partBiggest to Part_MSec, it is - // the least significant one anyhow - - digits = 3; - break; - - case _T('M'): - n = GetMinutes(); - if ( partBiggest < Part_Min ) - { - n %= MIN_PER_HOUR; - } - else - { - partBiggest = Part_Min; - } - - digits = 2; - break; - - case _T('S'): - n = GetSeconds().ToLong(); - if ( partBiggest < Part_Sec ) - { - n %= SEC_PER_MIN; - } - else - { - partBiggest = Part_Sec; - } - - digits = 2; - break; - } - - if ( digits ) - { - fmtPrefix << _T("0") << digits; - } - - str += wxString::Format(fmtPrefix + _T("ld"), n); - } - else - { - // normal character, just copy - str += ch; - } - } - - return str; -} - -// ============================================================================ -// wxDateTimeHolidayAuthority and related classes -// ============================================================================ - -#include "wx/arrimpl.cpp" - -WX_DEFINE_OBJARRAY(wxDateTimeArray) - -static int wxCMPFUNC_CONV -wxDateTimeCompareFunc(wxDateTime **first, wxDateTime **second) -{ - wxDateTime dt1 = **first, - dt2 = **second; - - return dt1 == dt2 ? 0 : dt1 < dt2 ? -1 : +1; -} - -// ---------------------------------------------------------------------------- -// wxDateTimeHolidayAuthority -// ---------------------------------------------------------------------------- - -wxHolidayAuthoritiesArray wxDateTimeHolidayAuthority::ms_authorities; - -/* static */ -bool wxDateTimeHolidayAuthority::IsHoliday(const wxDateTime& dt) -{ - size_t count = ms_authorities.size(); - for ( size_t n = 0; n < count; n++ ) - { - if ( ms_authorities[n]->DoIsHoliday(dt) ) - { - return true; - } - } - - return false; -} - -/* static */ -size_t -wxDateTimeHolidayAuthority::GetHolidaysInRange(const wxDateTime& dtStart, - const wxDateTime& dtEnd, - wxDateTimeArray& holidays) -{ - wxDateTimeArray hol; - - holidays.Clear(); - - const size_t countAuth = ms_authorities.size(); - for ( size_t nAuth = 0; nAuth < countAuth; nAuth++ ) - { - ms_authorities[nAuth]->DoGetHolidaysInRange(dtStart, dtEnd, hol); - - WX_APPEND_ARRAY(holidays, hol); - } - - holidays.Sort(wxDateTimeCompareFunc); - - return holidays.size(); -} - -/* static */ -void wxDateTimeHolidayAuthority::ClearAllAuthorities() -{ - WX_CLEAR_ARRAY(ms_authorities); -} - -/* static */ -void wxDateTimeHolidayAuthority::AddAuthority(wxDateTimeHolidayAuthority *auth) -{ - ms_authorities.push_back(auth); -} - -wxDateTimeHolidayAuthority::~wxDateTimeHolidayAuthority() -{ - // required here for Darwin -} - -// ---------------------------------------------------------------------------- -// wxDateTimeWorkDays -// ---------------------------------------------------------------------------- - -bool wxDateTimeWorkDays::DoIsHoliday(const wxDateTime& dt) const -{ - wxDateTime::WeekDay wd = dt.GetWeekDay(); - - return (wd == wxDateTime::Sun) || (wd == wxDateTime::Sat); -} - -size_t wxDateTimeWorkDays::DoGetHolidaysInRange(const wxDateTime& dtStart, - const wxDateTime& dtEnd, - wxDateTimeArray& holidays) const -{ - if ( dtStart > dtEnd ) - { - wxFAIL_MSG( _T("invalid date range in GetHolidaysInRange") ); - - return 0u; - } - - holidays.Empty(); - - // instead of checking all days, start with the first Sat after dtStart and - // end with the last Sun before dtEnd - wxDateTime dtSatFirst = dtStart.GetNextWeekDay(wxDateTime::Sat), - dtSatLast = dtEnd.GetPrevWeekDay(wxDateTime::Sat), - dtSunFirst = dtStart.GetNextWeekDay(wxDateTime::Sun), - dtSunLast = dtEnd.GetPrevWeekDay(wxDateTime::Sun), - dt; - - for ( dt = dtSatFirst; dt <= dtSatLast; dt += wxDateSpan::Week() ) - { - holidays.Add(dt); - } - - for ( dt = dtSunFirst; dt <= dtSunLast; dt += wxDateSpan::Week() ) - { - holidays.Add(dt); - } - - return holidays.GetCount(); -} - -// ============================================================================ -// other helper functions -// ============================================================================ - -// ---------------------------------------------------------------------------- -// iteration helpers: can be used to write a for loop over enum variable like -// this: -// for ( m = wxDateTime::Jan; m < wxDateTime::Inv_Month; wxNextMonth(m) ) -// ---------------------------------------------------------------------------- - -WXDLLIMPEXP_BASE void wxNextMonth(wxDateTime::Month& m) -{ - wxASSERT_MSG( m < wxDateTime::Inv_Month, _T("invalid month") ); - - // no wrapping or the for loop above would never end! - m = (wxDateTime::Month)(m + 1); -} - -WXDLLIMPEXP_BASE void wxPrevMonth(wxDateTime::Month& m) -{ - wxASSERT_MSG( m < wxDateTime::Inv_Month, _T("invalid month") ); - - m = m == wxDateTime::Jan ? wxDateTime::Inv_Month - : (wxDateTime::Month)(m - 1); -} - -WXDLLIMPEXP_BASE void wxNextWDay(wxDateTime::WeekDay& wd) -{ - wxASSERT_MSG( wd < wxDateTime::Inv_WeekDay, _T("invalid week day") ); - - // no wrapping or the for loop above would never end! - wd = (wxDateTime::WeekDay)(wd + 1); -} - -WXDLLIMPEXP_BASE void wxPrevWDay(wxDateTime::WeekDay& wd) -{ - wxASSERT_MSG( wd < wxDateTime::Inv_WeekDay, _T("invalid week day") ); - - wd = wd == wxDateTime::Sun ? wxDateTime::Inv_WeekDay - : (wxDateTime::WeekDay)(wd - 1); -} - -#endif // wxUSE_DATETIME diff --git a/wxWidgets/src/common/datstrm.cpp b/wxWidgets/src/common/datstrm.cpp deleted file mode 100644 index fd16e9223d..0000000000 --- a/wxWidgets/src/common/datstrm.cpp +++ /dev/null @@ -1,745 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/common/datstrm.cpp -// Purpose: Data stream classes -// Author: Guilhem Lavaux -// Modified by: Mickael Gilabert -// Created: 28/06/98 -// RCS-ID: $Id: datstrm.cpp 53028 2008-04-05 17:28:32Z VZ $ -// Copyright: (c) Guilhem Lavaux -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_STREAMS - -#include "wx/datstrm.h" - -#ifndef WX_PRECOMP - #include "wx/math.h" -#endif //WX_PRECOMP - -// --------------------------------------------------------------------------- -// wxDataInputStream -// --------------------------------------------------------------------------- - -#if wxUSE_UNICODE -wxDataInputStream::wxDataInputStream(wxInputStream& s, const wxMBConv& conv) - : m_input(&s), m_be_order(false), m_conv(conv.Clone()) -#else -wxDataInputStream::wxDataInputStream(wxInputStream& s) - : m_input(&s), m_be_order(false) -#endif -{ -} - -wxDataInputStream::~wxDataInputStream() -{ -#if wxUSE_UNICODE - delete m_conv; -#endif // wxUSE_UNICODE -} - -#if wxHAS_INT64 -wxUint64 wxDataInputStream::Read64() -{ - wxUint64 tmp; - Read64(&tmp, 1); - return tmp; -} -#endif // wxHAS_INT64 - -wxUint32 wxDataInputStream::Read32() -{ - wxUint32 i32; - - m_input->Read(&i32, 4); - - if (m_be_order) - return wxUINT32_SWAP_ON_LE(i32); - else - return wxUINT32_SWAP_ON_BE(i32); -} - -wxUint16 wxDataInputStream::Read16() -{ - wxUint16 i16; - - m_input->Read(&i16, 2); - - if (m_be_order) - return wxUINT16_SWAP_ON_LE(i16); - else - return wxUINT16_SWAP_ON_BE(i16); -} - -wxUint8 wxDataInputStream::Read8() -{ - wxUint8 buf; - - m_input->Read(&buf, 1); - return (wxUint8)buf; -} - -double wxDataInputStream::ReadDouble() -{ -#if wxUSE_APPLE_IEEE - char buf[10]; - - m_input->Read(buf, 10); - return ConvertFromIeeeExtended((const wxInt8 *)buf); -#else - return 0.0; -#endif -} - -wxString wxDataInputStream::ReadString() -{ - wxString ret; - - const size_t len = Read32(); - if ( len > 0 ) - { -#if wxUSE_UNICODE - wxCharBuffer tmp(len + 1); - if ( tmp ) - { - m_input->Read(tmp.data(), len); - tmp.data()[len] = '\0'; - ret = m_conv->cMB2WX(tmp.data()); - } -#else - wxStringBuffer buf(ret, len); - if ( buf ) - m_input->Read(buf, len); -#endif - } - - return ret; -} - -#if wxUSE_LONGLONG - -template -static -void DoReadLL(T *buffer, size_t size, wxInputStream *input, bool be_order) -{ - typedef T DataType; - unsigned char *pchBuffer = new unsigned char[size * 8]; - // TODO: Check for overflow when size is of type uint and is > than 512m - input->Read(pchBuffer, size * 8); - size_t idx_base = 0; - if ( be_order ) - { - for ( size_t uiIndex = 0; uiIndex != size; ++uiIndex ) - { - buffer[uiIndex] = 0l; - for ( unsigned ui = 0; ui != 8; ++ui ) - { - buffer[uiIndex] = buffer[uiIndex] * 256l + - DataType((unsigned long) pchBuffer[idx_base + ui]); - } - - idx_base += 8; - } - } - else // little endian - { - for ( size_t uiIndex=0; uiIndex!=size; ++uiIndex ) - { - buffer[uiIndex] = 0l; - for ( unsigned ui=0; ui!=8; ++ui ) - buffer[uiIndex] = buffer[uiIndex] * 256l + - DataType((unsigned long) pchBuffer[idx_base + 7 - ui]); - idx_base += 8; - } - } - delete[] pchBuffer; -} - -template -static void DoWriteLL(const T *buffer, size_t size, wxOutputStream *output, bool be_order) -{ - typedef T DataType; - unsigned char *pchBuffer = new unsigned char[size * 8]; - size_t idx_base = 0; - if ( be_order ) - { - for ( size_t uiIndex = 0; uiIndex != size; ++uiIndex ) - { - DataType i64 = buffer[uiIndex]; - for ( unsigned ui = 0; ui != 8; ++ui ) - { - pchBuffer[idx_base + 7 - ui] = - (unsigned char) (i64.GetLo() & 255l); - i64 >>= 8l; - } - - idx_base += 8; - } - } - else // little endian - { - for ( size_t uiIndex=0; uiIndex != size; ++uiIndex ) - { - DataType i64 = buffer[uiIndex]; - for (unsigned ui=0; ui!=8; ++ui) - { - pchBuffer[idx_base + ui] = - (unsigned char) (i64.GetLo() & 255l); - i64 >>= 8l; - } - - idx_base += 8; - } - } - - // TODO: Check for overflow when size is of type uint and is > than 512m - output->Write(pchBuffer, size * 8); - delete[] pchBuffer; -} - -#endif // wxUSE_LONGLONG - -#ifdef wxLongLong_t - -template -static -void DoReadI64(T *buffer, size_t size, wxInputStream *input, bool be_order) -{ - typedef T DataType; - unsigned char *pchBuffer = (unsigned char*) buffer; - // TODO: Check for overflow when size is of type uint and is > than 512m - input->Read(pchBuffer, size * 8); - if ( be_order ) - { - for ( wxUint32 i = 0; i < size; i++ ) - { - DataType v = wxUINT64_SWAP_ON_LE(*buffer); - *(buffer++) = v; - } - } - else // little endian - { - for ( wxUint32 i=0; i -static -void DoWriteI64(const T *buffer, size_t size, wxOutputStream *output, bool be_order) -{ - typedef T DataType; - if ( be_order ) - { - for ( size_t i = 0; i < size; i++ ) - { - DataType i64 = wxUINT64_SWAP_ON_LE(*buffer); - buffer++; - output->Write(&i64, 8); - } - } - else // little endian - { - for ( size_t i=0; i < size; i++ ) - { - DataType i64 = wxUINT64_SWAP_ON_BE(*buffer); - buffer++; - output->Write(&i64, 8); - } - } -} - -#endif // wxLongLong_t - - -#if wxHAS_INT64 -void wxDataInputStream::Read64(wxUint64 *buffer, size_t size) -{ -#ifndef wxLongLong_t - DoReadLL(buffer, size, m_input, m_be_order); -#else - DoReadI64(buffer, size, m_input, m_be_order); -#endif -} - -void wxDataInputStream::Read64(wxInt64 *buffer, size_t size) -{ -#ifndef wxLongLong_t - DoReadLL(buffer, size, m_input, m_be_order); -#else - DoReadI64(buffer, size, m_input, m_be_order); -#endif -} -#endif // wxHAS_INT64 - -#if defined(wxLongLong_t) && wxUSE_LONGLONG -void wxDataInputStream::Read64(wxULongLong *buffer, size_t size) -{ - DoReadLL(buffer, size, m_input, m_be_order); -} - -void wxDataInputStream::Read64(wxLongLong *buffer, size_t size) -{ - DoReadLL(buffer, size, m_input, m_be_order); -} -#endif // wxLongLong_t - -#if wxUSE_LONGLONG -void wxDataInputStream::ReadLL(wxULongLong *buffer, size_t size) -{ - DoReadLL(buffer, size, m_input, m_be_order); -} - -void wxDataInputStream::ReadLL(wxLongLong *buffer, size_t size) -{ - DoReadLL(buffer, size, m_input, m_be_order); -} - -wxLongLong wxDataInputStream::ReadLL(void) -{ - wxLongLong ll; - DoReadLL(&ll, (size_t)1, m_input, m_be_order); - return ll; -} -#endif // wxUSE_LONGLONG - -void wxDataInputStream::Read32(wxUint32 *buffer, size_t size) -{ - m_input->Read(buffer, size * 4); - - if (m_be_order) - { - for (wxUint32 i=0; iRead(buffer, size * 2); - - if (m_be_order) - { - for (wxUint32 i=0; iRead(buffer, size); -} - -void wxDataInputStream::ReadDouble(double *buffer, size_t size) -{ - for (wxUint32 i=0; i>(wxString& s) -{ - s = ReadString(); - return *this; -} - -wxDataInputStream& wxDataInputStream::operator>>(wxInt8& c) -{ - c = (wxInt8)Read8(); - return *this; -} - -wxDataInputStream& wxDataInputStream::operator>>(wxInt16& i) -{ - i = (wxInt16)Read16(); - return *this; -} - -wxDataInputStream& wxDataInputStream::operator>>(wxInt32& i) -{ - i = (wxInt32)Read32(); - return *this; -} - -wxDataInputStream& wxDataInputStream::operator>>(wxUint8& c) -{ - c = Read8(); - return *this; -} - -wxDataInputStream& wxDataInputStream::operator>>(wxUint16& i) -{ - i = Read16(); - return *this; -} - -wxDataInputStream& wxDataInputStream::operator>>(wxUint32& i) -{ - i = Read32(); - return *this; -} - -#if wxHAS_INT64 -wxDataInputStream& wxDataInputStream::operator>>(wxUint64& i) -{ - i = Read64(); - return *this; -} - -wxDataInputStream& wxDataInputStream::operator>>(wxInt64& i) -{ - i = Read64(); - return *this; -} -#endif // wxHAS_INT64 - -#if defined(wxLongLong_t) && wxUSE_LONGLONG -wxDataInputStream& wxDataInputStream::operator>>(wxULongLong& i) -{ - i = ReadLL(); - return *this; -} - -wxDataInputStream& wxDataInputStream::operator>>(wxLongLong& i) -{ - i = ReadLL(); - return *this; -} -#endif // wxLongLong_t - -wxDataInputStream& wxDataInputStream::operator>>(double& i) -{ - i = ReadDouble(); - return *this; -} - -wxDataInputStream& wxDataInputStream::operator>>(float& f) -{ - f = (float)ReadDouble(); - return *this; -} - -// --------------------------------------------------------------------------- -// wxDataOutputStream -// --------------------------------------------------------------------------- - -#if wxUSE_UNICODE -wxDataOutputStream::wxDataOutputStream(wxOutputStream& s, const wxMBConv& conv) - : m_output(&s), m_be_order(false), m_conv(conv.Clone()) -#else -wxDataOutputStream::wxDataOutputStream(wxOutputStream& s) - : m_output(&s), m_be_order(false) -#endif -{ -} - -wxDataOutputStream::~wxDataOutputStream() -{ -#if wxUSE_UNICODE - delete m_conv; -#endif // wxUSE_UNICODE -} - -#if wxHAS_INT64 -void wxDataOutputStream::Write64(wxUint64 i) -{ - Write64(&i, 1); -} - -void wxDataOutputStream::Write64(wxInt64 i) -{ - Write64(&i, 1); -} -#endif // wxHAS_INT64 - -void wxDataOutputStream::Write32(wxUint32 i) -{ - wxUint32 i32; - - if (m_be_order) - i32 = wxUINT32_SWAP_ON_LE(i); - else - i32 = wxUINT32_SWAP_ON_BE(i); - m_output->Write(&i32, 4); -} - -void wxDataOutputStream::Write16(wxUint16 i) -{ - wxUint16 i16; - - if (m_be_order) - i16 = wxUINT16_SWAP_ON_LE(i); - else - i16 = wxUINT16_SWAP_ON_BE(i); - - m_output->Write(&i16, 2); -} - -void wxDataOutputStream::Write8(wxUint8 i) -{ - m_output->Write(&i, 1); -} - -void wxDataOutputStream::WriteString(const wxString& string) -{ -#if wxUSE_UNICODE - const wxWX2MBbuf buf = string.mb_str(*m_conv); -#else - const wxWX2MBbuf buf = string.mb_str(); -#endif - size_t len = strlen(buf); - Write32(len); - if (len > 0) - m_output->Write(buf, len); -} - -void wxDataOutputStream::WriteDouble(double d) -{ - char buf[10]; - -#if wxUSE_APPLE_IEEE - ConvertToIeeeExtended(d, (wxInt8 *)buf); -#else -#if !defined(__VMS__) && !defined(__GNUG__) -# pragma warning "wxDataOutputStream::WriteDouble() not using IeeeExtended - will not work!" -#endif - buf[0] = '\0'; -#endif - m_output->Write(buf, 10); -} - -#if wxHAS_INT64 -void wxDataOutputStream::Write64(const wxUint64 *buffer, size_t size) -{ -#ifndef wxLongLong_t - DoWriteLL(buffer, size, m_output, m_be_order); -#else - DoWriteI64(buffer, size, m_output, m_be_order); -#endif -} - -void wxDataOutputStream::Write64(const wxInt64 *buffer, size_t size) -{ -#ifndef wxLongLong_t - DoWriteLL(buffer, size, m_output, m_be_order); -#else - DoWriteI64(buffer, size, m_output, m_be_order); -#endif -} -#endif // wxHAS_INT64 - -#if defined(wxLongLong_t) && wxUSE_LONGLONG -void wxDataOutputStream::Write64(const wxULongLong *buffer, size_t size) -{ - DoWriteLL(buffer, size, m_output, m_be_order); -} - -void wxDataOutputStream::Write64(const wxLongLong *buffer, size_t size) -{ - DoWriteLL(buffer, size, m_output, m_be_order); -} -#endif // wxLongLong_t - -#if wxUSE_LONGLONG -void wxDataOutputStream::WriteLL(const wxULongLong *buffer, size_t size) -{ - DoWriteLL(buffer, size, m_output, m_be_order); -} - -void wxDataOutputStream::WriteLL(const wxLongLong *buffer, size_t size) -{ - DoWriteLL(buffer, size, m_output, m_be_order); -} - -void wxDataOutputStream::WriteLL(const wxLongLong &ll) -{ - WriteLL(&ll, 1); -} - -void wxDataOutputStream::WriteLL(const wxULongLong &ll) -{ - WriteLL(&ll, 1); -} -#endif // wxUSE_LONGLONG - -void wxDataOutputStream::Write32(const wxUint32 *buffer, size_t size) -{ - if (m_be_order) - { - for (wxUint32 i=0; iWrite(&i32, 4); - } - } - else - { - for (wxUint32 i=0; iWrite(&i32, 4); - } - } -} - -void wxDataOutputStream::Write16(const wxUint16 *buffer, size_t size) -{ - if (m_be_order) - { - for (wxUint32 i=0; iWrite(&i16, 2); - } - } - else - { - for (wxUint32 i=0; iWrite(&i16, 2); - } - } -} - -void wxDataOutputStream::Write8(const wxUint8 *buffer, size_t size) -{ - m_output->Write(buffer, size); -} - -void wxDataOutputStream::WriteDouble(const double *buffer, size_t size) -{ - for (wxUint32 i=0; iWrite((const char *)string, wxStrlen(string)*sizeof(wxChar)); - return *this; -} - -wxDataOutputStream& wxDataOutputStream::operator<<(const wxString& string) -{ - WriteString(string); - return *this; -} - -wxDataOutputStream& wxDataOutputStream::operator<<(wxInt8 c) -{ - Write8((wxUint8)c); - return *this; -} - -wxDataOutputStream& wxDataOutputStream::operator<<(wxInt16 i) -{ - Write16((wxUint16)i); - return *this; -} - -wxDataOutputStream& wxDataOutputStream::operator<<(wxInt32 i) -{ - Write32((wxUint32)i); - return *this; -} - -wxDataOutputStream& wxDataOutputStream::operator<<(wxUint8 c) -{ - Write8(c); - return *this; -} - -wxDataOutputStream& wxDataOutputStream::operator<<(wxUint16 i) -{ - Write16(i); - return *this; -} - -wxDataOutputStream& wxDataOutputStream::operator<<(wxUint32 i) -{ - Write32(i); - return *this; -} - -#if wxHAS_INT64 -wxDataOutputStream& wxDataOutputStream::operator<<(wxUint64 i) -{ - Write64(i); - return *this; -} - -wxDataOutputStream& wxDataOutputStream::operator<<(wxInt64 i) -{ - Write64(i); - return *this; -} -#endif // wxHAS_INT64 - -#if defined(wxLongLong_t) && wxUSE_LONGLONG -wxDataOutputStream& wxDataOutputStream::operator<<(const wxULongLong &i) -{ - WriteLL(i); - return *this; -} - -wxDataOutputStream& wxDataOutputStream::operator<<(const wxLongLong &i) -{ - WriteLL(i); - return *this; -} -#endif // wxLongLong_t - -wxDataOutputStream& wxDataOutputStream::operator<<(double f) -{ - WriteDouble(f); - return *this; -} - -wxDataOutputStream& wxDataOutputStream::operator<<(float f) -{ - WriteDouble((double)f); - return *this; -} - -#endif - // wxUSE_STREAMS diff --git a/wxWidgets/src/common/db.cpp b/wxWidgets/src/common/db.cpp deleted file mode 100644 index 9517fd91b4..0000000000 --- a/wxWidgets/src/common/db.cpp +++ /dev/null @@ -1,4524 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: src/common/db.cpp -// Purpose: Implementation of the wxDb class. The wxDb class represents a connection -// to an ODBC data source. The wxDb class allows operations on the data -// source such as opening and closing the data source. -// Author: Doug Card -// Modified by: George Tasker -// Bart Jourquin -// Mark Johnson, wxWindows@mj10777.de -// Mods: Dec, 1998: -// -Added support for SQL statement logging and database cataloging -// Mods: April, 1999 -// -Added QUERY_ONLY mode support to reduce default number of cursors -// -Added additional SQL logging code -// -Added DEBUG-ONLY tracking of wxTable objects to detect orphaned DB connections -// -Set ODBC option to only read committed writes to the DB so all -// databases operate the same in that respect -// Created: 9.96 -// RCS-ID: $Id: db.cpp 52489 2008-03-14 14:14:57Z JS $ -// Copyright: (c) 1996 Remstar International, Inc. -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_ODBC - -#ifndef WX_PRECOMP - #include "wx/object.h" - #include "wx/list.h" - #include "wx/string.h" - #include "wx/utils.h" - #include "wx/log.h" - #include "wx/app.h" -#endif - -#ifdef DBDEBUG_CONSOLE - #include "wx/ioswrap.h" -#endif - -#include "wx/filefn.h" -#include "wx/wxchar.h" - -#include -#include -#include -#include -#include - -#include "wx/db.h" - -// DLL options compatibility check: -WX_CHECK_BUILD_OPTIONS("wxODBC") - -WXDLLIMPEXP_DATA_ODBC(wxDbList*) PtrBegDbList = 0; - -wxChar const *SQL_LOG_FILENAME = wxT("sqllog.txt"); -wxChar const *SQL_CATALOG_FILENAME = wxT("catalog.txt"); - -#ifdef __WXDEBUG__ - #include "wx/thread.h" - - extern wxList TablesInUse; -#if wxUSE_THREADS - extern wxCriticalSection csTablesInUse; -#endif // wxUSE_THREADS -#endif - -// SQL Log defaults to be used by GetDbConnection -wxDbSqlLogState SQLLOGstate = sqlLogOFF; - -static wxString SQLLOGfn = SQL_LOG_FILENAME; - -// The wxDb::errorList is copied to this variable when the wxDb object -// is closed. This way, the error list is still available after the -// database object is closed. This is necessary if the database -// connection fails so the calling application can show the operator -// why the connection failed. Note: as each wxDb object is closed, it -// will overwrite the errors of the previously destroyed wxDb object in -// this variable. NOTE: This occurs during a CLOSE, not a FREEing of the -// connection -wxChar DBerrorList[DB_MAX_ERROR_HISTORY][DB_MAX_ERROR_MSG_LEN+1]; - - -// This type defines the return row-struct form -// SQLTablePrivileges, and is used by wxDB::TablePrivileges. -typedef struct -{ - wxChar tableQual[128+1]; - wxChar tableOwner[128+1]; - wxChar tableName[128+1]; - wxChar grantor[128+1]; - wxChar grantee[128+1]; - wxChar privilege[128+1]; - wxChar grantable[3+1]; -} wxDbTablePrivilegeInfo; - - -/********** wxDbConnectInf Constructor - form 1 **********/ -wxDbConnectInf::wxDbConnectInf() -{ - Henv = 0; - freeHenvOnDestroy = false; - - Initialize(); -} // Constructor - - -/********** wxDbConnectInf Constructor - form 2 **********/ -wxDbConnectInf::wxDbConnectInf(HENV henv, const wxString &dsn, const wxString &userID, - const wxString &password, const wxString &defaultDir, - const wxString &fileType, const wxString &description) -{ - Henv = 0; - freeHenvOnDestroy = false; - - Initialize(); - - if (henv) - SetHenv(henv); - else - AllocHenv(); - - SetDsn(dsn); - SetUserID(userID); - SetPassword(password); - SetDescription(description); - SetFileType(fileType); - SetDefaultDir(defaultDir); -} // wxDbConnectInf Constructor - - -wxDbConnectInf::~wxDbConnectInf() -{ - if (freeHenvOnDestroy) - { - FreeHenv(); - } -} // wxDbConnectInf Destructor - - - -/********** wxDbConnectInf::Initialize() **********/ -bool wxDbConnectInf::Initialize() -{ - freeHenvOnDestroy = false; - - if (freeHenvOnDestroy && Henv) - FreeHenv(); - - Henv = 0; - Dsn[0] = 0; - Uid[0] = 0; - AuthStr[0] = 0; - ConnectionStr[0] = 0; - Description.Empty(); - FileType.Empty(); - DefaultDir.Empty(); - - useConnectionStr = false; - - return true; -} // wxDbConnectInf::Initialize() - - -/********** wxDbConnectInf::AllocHenv() **********/ -bool wxDbConnectInf::AllocHenv() -{ - // This is here to help trap if you are getting a new henv - // without releasing an existing henv - wxASSERT(!Henv); - - // Initialize the ODBC Environment for Database Operations - if (SQLAllocEnv(&Henv) != SQL_SUCCESS) - { - wxLogDebug(wxT("A problem occurred while trying to get a connection to the data source")); - return false; - } - - freeHenvOnDestroy = true; - - return true; -} // wxDbConnectInf::AllocHenv() - - -void wxDbConnectInf::FreeHenv() -{ - wxASSERT(Henv); - - if (Henv) - SQLFreeEnv(Henv); - - Henv = 0; - freeHenvOnDestroy = false; - -} // wxDbConnectInf::FreeHenv() - - -void wxDbConnectInf::SetDsn(const wxString &dsn) -{ - wxASSERT(dsn.length() < WXSIZEOF(Dsn)); - - wxStrncpy(Dsn, dsn, WXSIZEOF(Dsn)-1); - Dsn[WXSIZEOF(Dsn)-1] = 0; // Prevent buffer overrun -} // wxDbConnectInf::SetDsn() - - -void wxDbConnectInf::SetUserID(const wxString &uid) -{ - wxASSERT(uid.length() < WXSIZEOF(Uid)); - wxStrncpy(Uid, uid, WXSIZEOF(Uid)-1); - Uid[WXSIZEOF(Uid)-1] = 0; // Prevent buffer overrun -} // wxDbConnectInf::SetUserID() - - -void wxDbConnectInf::SetPassword(const wxString &password) -{ - wxASSERT(password.length() < WXSIZEOF(AuthStr)); - - wxStrncpy(AuthStr, password, WXSIZEOF(AuthStr)-1); - AuthStr[WXSIZEOF(AuthStr)-1] = 0; // Prevent buffer overrun -} // wxDbConnectInf::SetPassword() - -void wxDbConnectInf::SetConnectionStr(const wxString &connectStr) -{ - wxASSERT(connectStr.length() < WXSIZEOF(ConnectionStr)); - - useConnectionStr = wxStrlen(connectStr) > 0; - - wxStrncpy(ConnectionStr, connectStr, WXSIZEOF(ConnectionStr)-1); - ConnectionStr[WXSIZEOF(ConnectionStr)-1] = 0; // Prevent buffer overrun -} // wxDbConnectInf::SetConnectionStr() - - -/********** wxDbColFor Constructor **********/ -wxDbColFor::wxDbColFor() -{ - Initialize(); -} // wxDbColFor::wxDbColFor() - - -/********** wxDbColFor::Initialize() **********/ -void wxDbColFor::Initialize() -{ - s_Field.Empty(); - int i; - for (i=0; i<7; i++) - { - s_Format[i].Empty(); - s_Amount[i].Empty(); - i_Amount[i] = 0; - } - i_Nation = 0; // 0=EU, 1=UK, 2=International, 3=US - i_dbDataType = 0; - i_sqlDataType = 0; - Format(1,DB_DATA_TYPE_VARCHAR,0,0,0); // the Function that does the work -} // wxDbColFor::Initialize() - - -/********** wxDbColFor::Format() **********/ -int wxDbColFor::Format(int Nation, int dbDataType, SWORD sqlDataType, - short columnLength, short decimalDigits) -{ - // ---------------------------------------------------------------------------------------- - // -- 19991224 : mj10777 : Create - // There is still a lot of work to do here, but it is a start - // It handles all the basic data-types that I have run into up to now - // The main work will have be with Dates and float Formatting - // (US 1,000.00 ; EU 1.000,00) - // There are wxWindow plans for locale support and the new wxDateTime. If - // they define some constants (wxEUROPEAN) that can be gloably used, - // they should be used here. - // ---------------------------------------------------------------------------------------- - // There should also be a function to scan in a string to fill the variable - // ---------------------------------------------------------------------------------------- - wxString tempStr; - i_Nation = Nation; // 0 = timestamp , 1=EU, 2=UK, 3=International, 4=US - i_dbDataType = dbDataType; - i_sqlDataType = sqlDataType; - s_Field.Printf(wxT("%s%d"),s_Amount[1].c_str(),i_Amount[1]); // OK for VARCHAR, INTEGER and FLOAT - - if (i_dbDataType == 0) // Filter unsupported dbDataTypes - { - if ((i_sqlDataType == SQL_VARCHAR) -#if wxUSE_UNICODE - #if defined(SQL_WCHAR) - || (i_sqlDataType == SQL_WCHAR) - #endif - #if defined(SQL_WVARCHAR) - || (i_sqlDataType == SQL_WVARCHAR) - #endif -#endif - || (i_sqlDataType == SQL_LONGVARCHAR)) - i_dbDataType = DB_DATA_TYPE_VARCHAR; - if ((i_sqlDataType == SQL_C_DATE) || (i_sqlDataType == SQL_C_TIMESTAMP)) - i_dbDataType = DB_DATA_TYPE_DATE; - if (i_sqlDataType == SQL_C_BIT) - i_dbDataType = DB_DATA_TYPE_INTEGER; - if (i_sqlDataType == SQL_NUMERIC) - i_dbDataType = DB_DATA_TYPE_VARCHAR; // glt - ??? is this right? - if (i_sqlDataType == SQL_REAL) - i_dbDataType = DB_DATA_TYPE_FLOAT; - if (i_sqlDataType == SQL_C_BINARY) - i_dbDataType = DB_DATA_TYPE_BLOB; - } - - if ((i_dbDataType == DB_DATA_TYPE_INTEGER) && (i_sqlDataType == SQL_C_DOUBLE)) - { // DBASE Numeric - i_dbDataType = DB_DATA_TYPE_FLOAT; - } - - switch(i_dbDataType) // TBD: Still a lot of proper formatting to do - { - case DB_DATA_TYPE_VARCHAR: - s_Field = wxT("%s"); - break; - case DB_DATA_TYPE_INTEGER: - s_Field = wxT("%d"); - break; - case DB_DATA_TYPE_FLOAT: - if (decimalDigits == 0) - decimalDigits = 2; - tempStr.Printf(wxT("%%%d.%d"), columnLength, decimalDigits); - s_Field.Printf(wxT("%sf"), tempStr.c_str()); - break; - case DB_DATA_TYPE_DATE: - if (i_Nation == 0) // timestamp YYYY-MM-DD HH:MM:SS.SSS (tested for SYBASE) - { - s_Field = wxT("%04d-%02d-%02d %02d:%02d:%02d.%03d"); - } - if (i_Nation == 1) // European DD.MM.YYYY HH:MM:SS.SSS - { - s_Field = wxT("%02d.%02d.%04d %02d:%02d:%02d.%03d"); - } - if (i_Nation == 2) // UK DD/MM/YYYY HH:MM:SS.SSS - { - s_Field = wxT("%02d/%02d/%04d %02d:%02d:%02d.%03d"); - } - if (i_Nation == 3) // International YYYY-MM-DD HH:MM:SS.SSS - { - s_Field = wxT("%04d-%02d-%02d %02d:%02d:%02d.%03d"); - } - if (i_Nation == 4) // US MM/DD/YYYY HH:MM:SS.SSS - { - s_Field = wxT("%02d/%02d/%04d %02d:%02d:%02d.%03d"); - } - break; - case DB_DATA_TYPE_BLOB: - s_Field.Printf(wxT("Unable to format(%d)-SQL(%d)"), dbDataType,sqlDataType); // - break; - default: - s_Field.Printf(wxT("Unknown Format(%d)-SQL(%d)"), dbDataType,sqlDataType); // - break; - }; - return TRUE; -} // wxDbColFor::Format() - - -/********** wxDbColInf Constructor **********/ -wxDbColInf::wxDbColInf() -{ - Initialize(); -} // wxDbColInf::wxDbColInf() - - -/********** wxDbColInf Destructor ********/ -wxDbColInf::~wxDbColInf() -{ - if (pColFor) - delete pColFor; - pColFor = NULL; -} // wxDbColInf::~wxDbColInf() - - -bool wxDbColInf::Initialize() -{ - catalog[0] = 0; - schema[0] = 0; - tableName[0] = 0; - colName[0] = 0; - sqlDataType = 0; - typeName[0] = 0; - columnLength = 0; - bufferSize = 0; - decimalDigits = 0; - numPrecRadix = 0; - nullable = 0; - remarks[0] = 0; - dbDataType = 0; - PkCol = 0; - PkTableName[0] = 0; - FkCol = 0; - FkTableName[0] = 0; - pColFor = NULL; - - return true; -} // wxDbColInf::Initialize() - - -/********** wxDbTableInf Constructor ********/ -wxDbTableInf::wxDbTableInf() -{ - Initialize(); -} // wxDbTableInf::wxDbTableInf() - - -/********** wxDbTableInf Constructor ********/ -wxDbTableInf::~wxDbTableInf() -{ - if (pColInf) - delete [] pColInf; - pColInf = NULL; -} // wxDbTableInf::~wxDbTableInf() - - -bool wxDbTableInf::Initialize() -{ - tableName[0] = 0; - tableType[0] = 0; - tableRemarks[0] = 0; - numCols = 0; - pColInf = NULL; - - return true; -} // wxDbTableInf::Initialize() - - -/********** wxDbInf Constructor *************/ -wxDbInf::wxDbInf() -{ - Initialize(); -} // wxDbInf::wxDbInf() - - -/********** wxDbInf Destructor *************/ -wxDbInf::~wxDbInf() -{ - if (pTableInf) - delete [] pTableInf; - pTableInf = NULL; -} // wxDbInf::~wxDbInf() - - -/********** wxDbInf::Initialize() *************/ -bool wxDbInf::Initialize() -{ - catalog[0] = 0; - schema[0] = 0; - numTables = 0; - pTableInf = NULL; - - return true; -} // wxDbInf::Initialize() - - -/********** wxDb Constructor **********/ -wxDb::wxDb(const HENV &aHenv, bool FwdOnlyCursors) -{ - // Copy the HENV into the db class - henv = aHenv; - fwdOnlyCursors = FwdOnlyCursors; - - initialize(); -} // wxDb::wxDb() - - -/********** wxDb Destructor **********/ -wxDb::~wxDb() -{ - wxASSERT_MSG(!IsCached(),wxT("Cached connections must not be manually deleted, use\nwxDbFreeConnection() or wxDbCloseConnections().")); - - if (IsOpen()) - { - Close(); - } -} // wxDb destructor - - - -/********** PRIVATE! wxDb::initialize PRIVATE! **********/ -/********** wxDb::initialize() **********/ -void wxDb::initialize() -/* - * Private member function that sets all wxDb member variables to - * known values at creation of the wxDb - */ -{ - int i; - - fpSqlLog = 0; // Sql Log file pointer - sqlLogState = sqlLogOFF; // By default, logging is turned off - nTables = 0; - dbmsType = dbmsUNIDENTIFIED; - - wxStrcpy(sqlState,wxEmptyString); - wxStrcpy(errorMsg,wxEmptyString); - nativeError = cbErrorMsg = 0; - for (i = 0; i < DB_MAX_ERROR_HISTORY; i++) - wxStrcpy(errorList[i], wxEmptyString); - - // Init typeInf structures - typeInfVarchar.TypeName.Empty(); - typeInfVarchar.FsqlType = 0; - typeInfVarchar.Precision = 0; - typeInfVarchar.CaseSensitive = 0; - typeInfVarchar.MaximumScale = 0; - - typeInfInteger.TypeName.Empty(); - typeInfInteger.FsqlType = 0; - typeInfInteger.Precision = 0; - typeInfInteger.CaseSensitive = 0; - typeInfInteger.MaximumScale = 0; - - typeInfFloat.TypeName.Empty(); - typeInfFloat.FsqlType = 0; - typeInfFloat.Precision = 0; - typeInfFloat.CaseSensitive = 0; - typeInfFloat.MaximumScale = 0; - - typeInfDate.TypeName.Empty(); - typeInfDate.FsqlType = 0; - typeInfDate.Precision = 0; - typeInfDate.CaseSensitive = 0; - typeInfDate.MaximumScale = 0; - - typeInfBlob.TypeName.Empty(); - typeInfBlob.FsqlType = 0; - typeInfBlob.Precision = 0; - typeInfBlob.CaseSensitive = 0; - typeInfBlob.MaximumScale = 0; - - typeInfMemo.TypeName.Empty(); - typeInfMemo.FsqlType = 0; - typeInfMemo.Precision = 0; - typeInfMemo.CaseSensitive = 0; - typeInfMemo.MaximumScale = 0; - - // Error reporting is turned OFF by default - silent = true; - - // Allocate a data source connection handle - if (SQLAllocConnect(henv, &hdbc) != SQL_SUCCESS) - DispAllErrors(henv); - - // Initialize the db status flag - DB_STATUS = 0; - - // Mark database as not open as of yet - dbIsOpen = false; - dbIsCached = false; - dbOpenedWithConnectionString = false; -} // wxDb::initialize() - - -/********** PRIVATE! wxDb::convertUserID PRIVATE! **********/ -// -// NOTE: Return value from this function MUST be copied -// immediately, as the value is not good after -// this function has left scope. -// -const wxChar *wxDb::convertUserID(const wxChar *userID, wxString &UserID) -{ - if (userID) - { - if (!wxStrlen(userID)) - UserID = uid; - else - UserID = userID; - } - else - UserID.Empty(); - - // dBase does not use user names, and some drivers fail if you try to pass one - if ( Dbms() == dbmsDBASE - || Dbms() == dbmsXBASE_SEQUITER ) - UserID.Empty(); - - // Some databases require user names to be specified in uppercase, - // so force the name to uppercase - if ((Dbms() == dbmsORACLE) || - (Dbms() == dbmsMAXDB)) - UserID = UserID.Upper(); - - return UserID.c_str(); -} // wxDb::convertUserID() - - -bool wxDb::determineDataTypes(bool failOnDataTypeUnsupported) -{ - size_t iIndex; - - // These are the possible SQL types we check for use against the datasource we are connected - // to for the purpose of determining which data type to use for the basic character strings - // column types - // - // NOTE: The first type in this enumeration that is determined to be supported by the - // datasource/driver is the one that will be used. - SWORD PossibleSqlCharTypes[] = { -#if wxUSE_UNICODE && defined(SQL_WVARCHAR) - SQL_WVARCHAR, -#endif - SQL_VARCHAR, -#if wxUSE_UNICODE && defined(SQL_WVARCHAR) - SQL_WCHAR, -#endif - SQL_CHAR - }; - - // These are the possible SQL types we check for use against the datasource we are connected - // to for the purpose of determining which data type to use for the basic non-floating point - // column types - // - // NOTE: The first type in this enumeration that is determined to be supported by the - // datasource/driver is the one that will be used. - SWORD PossibleSqlIntegerTypes[] = { - SQL_INTEGER - }; - - // These are the possible SQL types we check for use against the datasource we are connected - // to for the purpose of determining which data type to use for the basic floating point number - // column types - // - // NOTE: The first type in this enumeration that is determined to be supported by the - // datasource/driver is the one that will be used. - SWORD PossibleSqlFloatTypes[] = { - SQL_DOUBLE, - SQL_REAL, - SQL_FLOAT, - SQL_DECIMAL, - SQL_NUMERIC - }; - - // These are the possible SQL types we check for use agains the datasource we are connected - // to for the purpose of determining which data type to use for the date/time column types - // - // NOTE: The first type in this enumeration that is determined to be supported by the - // datasource/driver is the one that will be used. - SWORD PossibleSqlDateTypes[] = { - SQL_TIMESTAMP, - SQL_DATE, -#ifdef SQL_DATETIME - SQL_DATETIME -#endif - }; - - // These are the possible SQL types we check for use agains the datasource we are connected - // to for the purpose of determining which data type to use for the BLOB column types. - // - // NOTE: The first type in this enumeration that is determined to be supported by the - // datasource/driver is the one that will be used. - SWORD PossibleSqlBlobTypes[] = { - SQL_LONGVARBINARY, - SQL_VARBINARY - }; - - // These are the possible SQL types we check for use agains the datasource we are connected - // to for the purpose of determining which data type to use for the MEMO column types - // (a type which allow to store large strings; like VARCHAR just with a bigger precision) - // - // NOTE: The first type in this enumeration that is determined to be supported by the - // datasource/driver is the one that will be used. - SWORD PossibleSqlMemoTypes[] = { - SQL_LONGVARCHAR, - }; - - - // Query the data source regarding data type information - - // - // The way it was determined which SQL data types to use was by calling SQLGetInfo - // for all of the possible SQL data types to see which ones were supported. If - // a type is not supported, the SQLFetch() that's called from getDataTypeInfo() - // fails with SQL_NO_DATA_FOUND. This is ugly because I'm sure the three SQL data - // types I've selected below will not always be what we want. These are just - // what happened to work against an Oracle 7/Intersolv combination. The following is - // a complete list of the results I got back against the Oracle 7 database: - // - // SQL_BIGINT SQL_NO_DATA_FOUND - // SQL_BINARY SQL_NO_DATA_FOUND - // SQL_BIT SQL_NO_DATA_FOUND - // SQL_CHAR type name = 'CHAR', Precision = 255 - // SQL_DATE SQL_NO_DATA_FOUND - // SQL_DECIMAL type name = 'NUMBER', Precision = 38 - // SQL_DOUBLE type name = 'NUMBER', Precision = 15 - // SQL_FLOAT SQL_NO_DATA_FOUND - // SQL_INTEGER SQL_NO_DATA_FOUND - // SQL_LONGVARBINARY type name = 'LONG RAW', Precision = 2 billion - // SQL_LONGVARCHAR type name = 'LONG', Precision = 2 billion - // SQL_NUMERIC SQL_NO_DATA_FOUND - // SQL_REAL SQL_NO_DATA_FOUND - // SQL_SMALLINT SQL_NO_DATA_FOUND - // SQL_TIME SQL_NO_DATA_FOUND - // SQL_TIMESTAMP type name = 'DATE', Precision = 19 - // SQL_VARBINARY type name = 'RAW', Precision = 255 - // SQL_VARCHAR type name = 'VARCHAR2', Precision = 2000 - // ===================================================================== - // Results from a Microsoft Access 7.0 db, using a driver from Microsoft - // - // SQL_VARCHAR type name = 'TEXT', Precision = 255 - // SQL_TIMESTAMP type name = 'DATETIME' - // SQL_DECIMAL SQL_NO_DATA_FOUND - // SQL_NUMERIC type name = 'CURRENCY', Precision = 19 - // SQL_FLOAT SQL_NO_DATA_FOUND - // SQL_REAL type name = 'SINGLE', Precision = 7 - // SQL_DOUBLE type name = 'DOUBLE', Precision = 15 - // SQL_INTEGER type name = 'LONG', Precision = 10 - - // Query the data source for info about itself - if (!getDbInfo(failOnDataTypeUnsupported)) - return false; - - // --------------- Varchar - (Variable length character string) --------------- - for (iIndex = 0; iIndex < WXSIZEOF(PossibleSqlCharTypes) && - !getDataTypeInfo(PossibleSqlCharTypes[iIndex], typeInfVarchar); ++iIndex) - {} - - if (iIndex < WXSIZEOF(PossibleSqlCharTypes)) - typeInfVarchar.FsqlType = PossibleSqlCharTypes[iIndex]; - else if (failOnDataTypeUnsupported) - return false; - - // --------------- Float --------------- - for (iIndex = 0; iIndex < WXSIZEOF(PossibleSqlFloatTypes) && - !getDataTypeInfo(PossibleSqlFloatTypes[iIndex], typeInfFloat); ++iIndex) - {} - - if (iIndex < WXSIZEOF(PossibleSqlFloatTypes)) - typeInfFloat.FsqlType = PossibleSqlFloatTypes[iIndex]; - else if (failOnDataTypeUnsupported) - return false; - - // --------------- Integer ------------- - for (iIndex = 0; iIndex < WXSIZEOF(PossibleSqlIntegerTypes) && - !getDataTypeInfo(PossibleSqlIntegerTypes[iIndex], typeInfInteger); ++iIndex) - {} - - if (iIndex < WXSIZEOF(PossibleSqlIntegerTypes)) - typeInfInteger.FsqlType = PossibleSqlIntegerTypes[iIndex]; - else if (failOnDataTypeUnsupported) - { - // If no non-floating point data types are supported, we'll - // use the type assigned for floats to store integers as well - if (!getDataTypeInfo(typeInfFloat.FsqlType, typeInfInteger)) - { - if (failOnDataTypeUnsupported) - return false; - } - else - typeInfInteger.FsqlType = typeInfFloat.FsqlType; - } - - // --------------- Date/Time --------------- - for (iIndex = 0; iIndex < WXSIZEOF(PossibleSqlDateTypes) && - !getDataTypeInfo(PossibleSqlDateTypes[iIndex], typeInfDate); ++iIndex) - {} - - if (iIndex < WXSIZEOF(PossibleSqlDateTypes)) - typeInfDate.FsqlType = PossibleSqlDateTypes[iIndex]; - else if (failOnDataTypeUnsupported) - return false; - - // --------------- BLOB --------------- - for (iIndex = 0; iIndex < WXSIZEOF(PossibleSqlBlobTypes) && - !getDataTypeInfo(PossibleSqlBlobTypes[iIndex], typeInfBlob); ++iIndex) - {} - - if (iIndex < WXSIZEOF(PossibleSqlBlobTypes)) - typeInfBlob.FsqlType = PossibleSqlBlobTypes[iIndex]; - else if (failOnDataTypeUnsupported) - return false; - - // --------------- MEMO --------------- - for (iIndex = 0; iIndex < WXSIZEOF(PossibleSqlMemoTypes) && - !getDataTypeInfo(PossibleSqlMemoTypes[iIndex], typeInfMemo); ++iIndex) - {} - - if (iIndex < WXSIZEOF(PossibleSqlMemoTypes)) - typeInfMemo.FsqlType = PossibleSqlMemoTypes[iIndex]; - else if (failOnDataTypeUnsupported) - return false; - - return true; -} // wxDb::determineDataTypes - - -bool wxDb::open(bool failOnDataTypeUnsupported) -{ -/* - If using Intersolv branded ODBC drivers, this is the place where you would substitute - your branded driver license information - - SQLSetConnectOption(hdbc, 1041, (UDWORD) wxEmptyString); - SQLSetConnectOption(hdbc, 1042, (UDWORD) wxEmptyString); -*/ - - // Mark database as open - dbIsOpen = true; - - // Allocate a statement handle for the database connection - if (SQLAllocStmt(hdbc, &hstmt) != SQL_SUCCESS) - return(DispAllErrors(henv, hdbc)); - - // Set Connection Options - if (!setConnectionOptions()) - return false; - - if (!determineDataTypes(failOnDataTypeUnsupported)) - return false; - -#ifdef DBDEBUG_CONSOLE - cout << wxT("VARCHAR DATA TYPE: ") << typeInfVarchar.TypeName << endl; - cout << wxT("INTEGER DATA TYPE: ") << typeInfInteger.TypeName << endl; - cout << wxT("FLOAT DATA TYPE: ") << typeInfFloat.TypeName << endl; - cout << wxT("DATE DATA TYPE: ") << typeInfDate.TypeName << endl; - cout << wxT("BLOB DATA TYPE: ") << typeInfBlob.TypeName << endl; - cout << wxT("MEMO DATA TYPE: ") << typeInfMemo.TypeName << endl; - cout << endl; -#endif - - // Completed Successfully - return true; -} - -bool wxDb::Open(const wxString& inConnectStr, bool failOnDataTypeUnsupported) -{ - wxASSERT(inConnectStr.length()); - return Open(inConnectStr, NULL, failOnDataTypeUnsupported); -} - -bool wxDb::Open(const wxString& inConnectStr, SQLHWND parentWnd, bool failOnDataTypeUnsupported) -{ - dsn = wxEmptyString; - uid = wxEmptyString; - authStr = wxEmptyString; - - RETCODE retcode; - - if (!FwdOnlyCursors()) - { - // Specify that the ODBC cursor library be used, if needed. This must be - // specified before the connection is made. - retcode = SQLSetConnectOption(hdbc, SQL_ODBC_CURSORS, SQL_CUR_USE_IF_NEEDED); - -#ifdef DBDEBUG_CONSOLE - if (retcode == SQL_SUCCESS) - cout << wxT("SQLSetConnectOption(CURSOR_LIB) successful") << endl; - else - cout << wxT("SQLSetConnectOption(CURSOR_LIB) failed") << endl; -#else - wxUnusedVar(retcode); -#endif - } - - // Connect to the data source - SQLTCHAR outConnectBuffer[SQL_MAX_CONNECTSTR_LEN+1]; // MS recommends at least 1k buffer - short outConnectBufferLen; - - inConnectionStr = inConnectStr; - - retcode = SQLDriverConnect(hdbc, parentWnd, (SQLTCHAR FAR *)inConnectionStr.c_str(), - (SWORD)inConnectionStr.length(), (SQLTCHAR FAR *)outConnectBuffer, - WXSIZEOF(outConnectBuffer), &outConnectBufferLen, SQL_DRIVER_COMPLETE ); - - if ((retcode != SQL_SUCCESS) && - (retcode != SQL_SUCCESS_WITH_INFO)) - return(DispAllErrors(henv, hdbc)); - - outConnectBuffer[outConnectBufferLen] = 0; - outConnectionStr = outConnectBuffer; - dbOpenedWithConnectionString = true; - - return open(failOnDataTypeUnsupported); -} - -/********** wxDb::Open() **********/ -bool wxDb::Open(const wxString &Dsn, const wxString &Uid, const wxString &AuthStr, bool failOnDataTypeUnsupported) -{ - wxASSERT(!Dsn.empty()); - dsn = Dsn; - uid = Uid; - authStr = AuthStr; - - inConnectionStr = wxEmptyString; - outConnectionStr = wxEmptyString; - - RETCODE retcode; - - if (!FwdOnlyCursors()) - { - // Specify that the ODBC cursor library be used, if needed. This must be - // specified before the connection is made. - retcode = SQLSetConnectOption(hdbc, SQL_ODBC_CURSORS, SQL_CUR_USE_IF_NEEDED); - -#ifdef DBDEBUG_CONSOLE - if (retcode == SQL_SUCCESS) - cout << wxT("SQLSetConnectOption(CURSOR_LIB) successful") << endl; - else - cout << wxT("SQLSetConnectOption(CURSOR_LIB) failed") << endl; -#else - wxUnusedVar( retcode ); -#endif - } - - // Connect to the data source - retcode = SQLConnect(hdbc, (SQLTCHAR FAR *) dsn.c_str(), SQL_NTS, - (SQLTCHAR FAR *) uid.c_str(), SQL_NTS, - (SQLTCHAR FAR *) authStr.c_str(), SQL_NTS); - - if ((retcode != SQL_SUCCESS) && - (retcode != SQL_SUCCESS_WITH_INFO)) - return(DispAllErrors(henv, hdbc)); - - return open(failOnDataTypeUnsupported); - -} // wxDb::Open() - - -bool wxDb::Open(wxDbConnectInf *dbConnectInf, bool failOnDataTypeUnsupported) -{ - wxASSERT(dbConnectInf); - - // Use the connection string if one is present - if (dbConnectInf->UseConnectionStr()) - return Open(dbConnectInf->GetConnectionStr(), failOnDataTypeUnsupported); - else - return Open(dbConnectInf->GetDsn(), dbConnectInf->GetUserID(), - dbConnectInf->GetPassword(), failOnDataTypeUnsupported); -} // wxDb::Open() - - -bool wxDb::Open(wxDb *copyDb) -{ - dsn = copyDb->GetDatasourceName(); - uid = copyDb->GetUsername(); - authStr = copyDb->GetPassword(); - inConnectionStr = copyDb->GetConnectionInStr(); - outConnectionStr = copyDb->GetConnectionOutStr(); - - RETCODE retcode; - - if (!FwdOnlyCursors()) - { - // Specify that the ODBC cursor library be used, if needed. This must be - // specified before the connection is made. - retcode = SQLSetConnectOption(hdbc, SQL_ODBC_CURSORS, SQL_CUR_USE_IF_NEEDED); - -#ifdef DBDEBUG_CONSOLE - if (retcode == SQL_SUCCESS) - cout << wxT("SQLSetConnectOption(CURSOR_LIB) successful") << endl; - else - cout << wxT("SQLSetConnectOption(CURSOR_LIB) failed") << endl; -#else - wxUnusedVar( retcode ); -#endif - } - - if (copyDb->OpenedWithConnectionString()) - { - // Connect to the data source - SQLTCHAR outConnectBuffer[SQL_MAX_CONNECTSTR_LEN+1]; - short outConnectBufferLen; - - inConnectionStr = copyDb->GetConnectionInStr(); - - retcode = SQLDriverConnect(hdbc, NULL, (SQLTCHAR FAR *)inConnectionStr.c_str(), - (SWORD)inConnectionStr.length(), (SQLTCHAR FAR *)outConnectBuffer, - WXSIZEOF(outConnectBuffer), &outConnectBufferLen, SQL_DRIVER_COMPLETE); - - if ((retcode != SQL_SUCCESS) && - (retcode != SQL_SUCCESS_WITH_INFO)) - return(DispAllErrors(henv, hdbc)); - - outConnectBuffer[outConnectBufferLen] = 0; - outConnectionStr = outConnectBuffer; - dbOpenedWithConnectionString = true; - } - else - { - // Connect to the data source - retcode = SQLConnect(hdbc, (SQLTCHAR FAR *) dsn.c_str(), SQL_NTS, - (SQLTCHAR FAR *) uid.c_str(), SQL_NTS, - (SQLTCHAR FAR *) authStr.c_str(), SQL_NTS); - } - - if ((retcode != SQL_SUCCESS) && - (retcode != SQL_SUCCESS_WITH_INFO)) - return(DispAllErrors(henv, hdbc)); - -/* - If using Intersolv branded ODBC drivers, this is the place where you would substitute - your branded driver license information - - SQLSetConnectOption(hdbc, 1041, (UDWORD) wxEmptyString); - SQLSetConnectOption(hdbc, 1042, (UDWORD) wxEmptyString); -*/ - - // Mark database as open - dbIsOpen = true; - - // Allocate a statement handle for the database connection - if (SQLAllocStmt(hdbc, &hstmt) != SQL_SUCCESS) - return(DispAllErrors(henv, hdbc)); - - // Set Connection Options - if (!setConnectionOptions()) - return false; - - // Instead of Querying the data source for info about itself, it can just be copied - // from the wxDb instance that was passed in (copyDb). - wxStrcpy(dbInf.serverName,copyDb->dbInf.serverName); - wxStrcpy(dbInf.databaseName,copyDb->dbInf.databaseName); - wxStrcpy(dbInf.dbmsName,copyDb->dbInf.dbmsName); - wxStrcpy(dbInf.dbmsVer,copyDb->dbInf.dbmsVer); - dbInf.maxConnections = copyDb->dbInf.maxConnections; - dbInf.maxStmts = copyDb->dbInf.maxStmts; - wxStrcpy(dbInf.driverName,copyDb->dbInf.driverName); - wxStrcpy(dbInf.odbcVer,copyDb->dbInf.odbcVer); - wxStrcpy(dbInf.drvMgrOdbcVer,copyDb->dbInf.drvMgrOdbcVer); - wxStrcpy(dbInf.driverVer,copyDb->dbInf.driverVer); - dbInf.apiConfLvl = copyDb->dbInf.apiConfLvl; - dbInf.cliConfLvl = copyDb->dbInf.cliConfLvl; - dbInf.sqlConfLvl = copyDb->dbInf.sqlConfLvl; - wxStrcpy(dbInf.outerJoins,copyDb->dbInf.outerJoins); - wxStrcpy(dbInf.procedureSupport,copyDb->dbInf.procedureSupport); - wxStrcpy(dbInf.accessibleTables,copyDb->dbInf.accessibleTables); - dbInf.cursorCommitBehavior = copyDb->dbInf.cursorCommitBehavior; - dbInf.cursorRollbackBehavior = copyDb->dbInf.cursorRollbackBehavior; - dbInf.supportNotNullClause = copyDb->dbInf.supportNotNullClause; - wxStrcpy(dbInf.supportIEF,copyDb->dbInf.supportIEF); - dbInf.txnIsolation = copyDb->dbInf.txnIsolation; - dbInf.txnIsolationOptions = copyDb->dbInf.txnIsolationOptions; - dbInf.fetchDirections = copyDb->dbInf.fetchDirections; - dbInf.lockTypes = copyDb->dbInf.lockTypes; - dbInf.posOperations = copyDb->dbInf.posOperations; - dbInf.posStmts = copyDb->dbInf.posStmts; - dbInf.scrollConcurrency = copyDb->dbInf.scrollConcurrency; - dbInf.scrollOptions = copyDb->dbInf.scrollOptions; - dbInf.staticSensitivity = copyDb->dbInf.staticSensitivity; - dbInf.txnCapable = copyDb->dbInf.txnCapable; - dbInf.loginTimeout = copyDb->dbInf.loginTimeout; - - // VARCHAR = Variable length character string - typeInfVarchar.FsqlType = copyDb->typeInfVarchar.FsqlType; - typeInfVarchar.TypeName = copyDb->typeInfVarchar.TypeName; - typeInfVarchar.Precision = copyDb->typeInfVarchar.Precision; - typeInfVarchar.CaseSensitive = copyDb->typeInfVarchar.CaseSensitive; - typeInfVarchar.MaximumScale = copyDb->typeInfVarchar.MaximumScale; - - // Float - typeInfFloat.FsqlType = copyDb->typeInfFloat.FsqlType; - typeInfFloat.TypeName = copyDb->typeInfFloat.TypeName; - typeInfFloat.Precision = copyDb->typeInfFloat.Precision; - typeInfFloat.CaseSensitive = copyDb->typeInfFloat.CaseSensitive; - typeInfFloat.MaximumScale = copyDb->typeInfFloat.MaximumScale; - - // Integer - typeInfInteger.FsqlType = copyDb->typeInfInteger.FsqlType; - typeInfInteger.TypeName = copyDb->typeInfInteger.TypeName; - typeInfInteger.Precision = copyDb->typeInfInteger.Precision; - typeInfInteger.CaseSensitive = copyDb->typeInfInteger.CaseSensitive; - typeInfInteger.MaximumScale = copyDb->typeInfInteger.MaximumScale; - - // Date/Time - typeInfDate.FsqlType = copyDb->typeInfDate.FsqlType; - typeInfDate.TypeName = copyDb->typeInfDate.TypeName; - typeInfDate.Precision = copyDb->typeInfDate.Precision; - typeInfDate.CaseSensitive = copyDb->typeInfDate.CaseSensitive; - typeInfDate.MaximumScale = copyDb->typeInfDate.MaximumScale; - - // Blob - typeInfBlob.FsqlType = copyDb->typeInfBlob.FsqlType; - typeInfBlob.TypeName = copyDb->typeInfBlob.TypeName; - typeInfBlob.Precision = copyDb->typeInfBlob.Precision; - typeInfBlob.CaseSensitive = copyDb->typeInfBlob.CaseSensitive; - typeInfBlob.MaximumScale = copyDb->typeInfBlob.MaximumScale; - - // Memo - typeInfMemo.FsqlType = copyDb->typeInfMemo.FsqlType; - typeInfMemo.TypeName = copyDb->typeInfMemo.TypeName; - typeInfMemo.Precision = copyDb->typeInfMemo.Precision; - typeInfMemo.CaseSensitive = copyDb->typeInfMemo.CaseSensitive; - typeInfMemo.MaximumScale = copyDb->typeInfMemo.MaximumScale; - -#ifdef DBDEBUG_CONSOLE - cout << wxT("VARCHAR DATA TYPE: ") << typeInfVarchar.TypeName << endl; - cout << wxT("INTEGER DATA TYPE: ") << typeInfInteger.TypeName << endl; - cout << wxT("FLOAT DATA TYPE: ") << typeInfFloat.TypeName << endl; - cout << wxT("DATE DATA TYPE: ") << typeInfDate.TypeName << endl; - cout << wxT("BLOB DATA TYPE: ") << typeInfBlob.TypeName << endl; - cout << wxT("MEMO DATA TYPE: ") << typeInfMemo.TypeName << endl; - cout << endl; -#endif - - // Completed Successfully - return true; -} // wxDb::Open() 2 - - -/********** wxDb::setConnectionOptions() **********/ -bool wxDb::setConnectionOptions(void) -/* - * NOTE: The Intersolv/Oracle 7 driver was "Not Capable" of setting the login timeout. - */ -{ - SWORD cb; - - // I need to get the DBMS name here, because some of the connection options - // are database specific and need to call the Dbms() function. - RETCODE retcode; - - retcode = SQLGetInfo(hdbc, SQL_DBMS_NAME, (UCHAR *) dbInf.dbmsName, sizeof(dbInf.dbmsName), &cb); - if (retcode != SQL_SUCCESS && retcode != SQL_SUCCESS_WITH_INFO) - return(DispAllErrors(henv, hdbc)); - - /* retcode = */ SQLSetConnectOption(hdbc, SQL_AUTOCOMMIT, SQL_AUTOCOMMIT_OFF); - /* retcode = */ SQLSetConnectOption(hdbc, SQL_OPT_TRACE, SQL_OPT_TRACE_OFF); -// SQLSetConnectOption(hdbc, SQL_TXN_ISOLATION, SQL_TXN_READ_COMMITTED); // No dirty reads - - // By default, MS Sql Server closes cursors on commit and rollback. The following - // call to SQLSetConnectOption() is needed to force SQL Server to preserve cursors - // after a transaction. This is a driver specific option and is not part of the - // ODBC standard. Note: this behavior is specific to the ODBC interface to SQL Server. - // The database settings don't have any effect one way or the other. - if (Dbms() == dbmsMS_SQL_SERVER) - { - const long SQL_PRESERVE_CURSORS = 1204L; - const long SQL_PC_ON = 1L; - /* retcode = */ SQLSetConnectOption(hdbc, SQL_PRESERVE_CURSORS, SQL_PC_ON); - } - - // Display the connection options to verify them -#ifdef DBDEBUG_CONSOLE - long l; - cout << wxT("****** CONNECTION OPTIONS ******") << endl; - - retcode = SQLGetConnectOption(hdbc, SQL_AUTOCOMMIT, &l); - if (retcode != SQL_SUCCESS) - return(DispAllErrors(henv, hdbc)); - cout << wxT("AUTOCOMMIT: ") << (l == SQL_AUTOCOMMIT_OFF ? "OFF" : "ON") << endl; - - retcode = SQLGetConnectOption(hdbc, SQL_ODBC_CURSORS, &l); - if (retcode != SQL_SUCCESS) - return(DispAllErrors(henv, hdbc)); - cout << wxT("ODBC CURSORS: "); - switch(l) - { - case(SQL_CUR_USE_IF_NEEDED): - cout << wxT("SQL_CUR_USE_IF_NEEDED"); - break; - case(SQL_CUR_USE_ODBC): - cout << wxT("SQL_CUR_USE_ODBC"); - break; - case(SQL_CUR_USE_DRIVER): - cout << wxT("SQL_CUR_USE_DRIVER"); - break; - } - cout << endl; - - retcode = SQLGetConnectOption(hdbc, SQL_OPT_TRACE, &l) - if (retcode != SQL_SUCCESS) - return(DispAllErrors(henv, hdbc)); - cout << wxT("TRACING: ") << (l == SQL_OPT_TRACE_OFF ? wxT("OFF") : wxT("ON")) << endl; - - cout << endl; -#endif - - // Completed Successfully - return true; - -} // wxDb::setConnectionOptions() - - -/********** wxDb::getDbInfo() **********/ -bool wxDb::getDbInfo(bool failOnDataTypeUnsupported) -{ - SWORD cb; - RETCODE retcode; - - retcode = SQLGetInfo(hdbc, SQL_SERVER_NAME, (UCHAR*) dbInf.serverName, sizeof(dbInf.serverName), &cb); - if (retcode != SQL_SUCCESS && retcode != SQL_SUCCESS_WITH_INFO ) - { - DispAllErrors(henv, hdbc); - if (failOnDataTypeUnsupported) - return false; - } - - retcode = SQLGetInfo(hdbc, SQL_DATABASE_NAME, (UCHAR*) dbInf.databaseName, sizeof(dbInf.databaseName), &cb); - if (retcode != SQL_SUCCESS && retcode != SQL_SUCCESS_WITH_INFO ) - { - DispAllErrors(henv, hdbc); - if (failOnDataTypeUnsupported) - return false; - } - - retcode = SQLGetInfo(hdbc, SQL_DBMS_NAME, (UCHAR*) dbInf.dbmsName, sizeof(dbInf.dbmsName), &cb); - if (retcode != SQL_SUCCESS && retcode != SQL_SUCCESS_WITH_INFO ) - { - DispAllErrors(henv, hdbc); - if (failOnDataTypeUnsupported) - return false; - } - - // 16-Mar-1999 - // After upgrading to MSVC6, the original 20 char buffer below was insufficient, - // causing database connectivity to fail in some cases. - retcode = SQLGetInfo(hdbc, SQL_DBMS_VER, (UCHAR*) dbInf.dbmsVer, sizeof(dbInf.dbmsVer), &cb); - if (retcode != SQL_SUCCESS && retcode != SQL_SUCCESS_WITH_INFO ) - { - DispAllErrors(henv, hdbc); - if (failOnDataTypeUnsupported) - return false; - } - - retcode = SQLGetInfo(hdbc, SQL_ACTIVE_CONNECTIONS, (UCHAR*) &dbInf.maxConnections, sizeof(dbInf.maxConnections), &cb); - if (retcode != SQL_SUCCESS && retcode != SQL_SUCCESS_WITH_INFO ) - { - DispAllErrors(henv, hdbc); - if (failOnDataTypeUnsupported) - return false; - } - - retcode = SQLGetInfo(hdbc, SQL_ACTIVE_STATEMENTS, (UCHAR*) &dbInf.maxStmts, sizeof(dbInf.maxStmts), &cb); - if (retcode != SQL_SUCCESS && retcode != SQL_SUCCESS_WITH_INFO ) - { - DispAllErrors(henv, hdbc); - if (failOnDataTypeUnsupported) - return false; - } - - retcode = SQLGetInfo(hdbc, SQL_DRIVER_NAME, (UCHAR*) dbInf.driverName, sizeof(dbInf.driverName), &cb); - if (retcode != SQL_SUCCESS && retcode != SQL_SUCCESS_WITH_INFO ) - { - DispAllErrors(henv, hdbc); - if (failOnDataTypeUnsupported) - return false; - } - - retcode = SQLGetInfo(hdbc, SQL_DRIVER_ODBC_VER, (UCHAR*) dbInf.odbcVer, sizeof(dbInf.odbcVer), &cb); - if (retcode != SQL_SUCCESS && retcode != SQL_SUCCESS_WITH_INFO ) - { - DispAllErrors(henv, hdbc); - if (failOnDataTypeUnsupported) - return false; - } - - retcode = SQLGetInfo(hdbc, SQL_ODBC_VER, (UCHAR*) dbInf.drvMgrOdbcVer, sizeof(dbInf.drvMgrOdbcVer), &cb); - if (retcode != SQL_SUCCESS && retcode != SQL_SUCCESS_WITH_INFO) - { - DispAllErrors(henv, hdbc); - if (failOnDataTypeUnsupported) - return false; - } - - retcode = SQLGetInfo(hdbc, SQL_DRIVER_VER, (UCHAR*) dbInf.driverVer, sizeof(dbInf.driverVer), &cb); - if (retcode != SQL_SUCCESS && retcode != SQL_SUCCESS_WITH_INFO ) - { - DispAllErrors(henv, hdbc); - if (failOnDataTypeUnsupported) - return false; - } - - retcode = SQLGetInfo(hdbc, SQL_ODBC_API_CONFORMANCE, (UCHAR*) &dbInf.apiConfLvl, sizeof(dbInf.apiConfLvl), &cb); - if (retcode != SQL_SUCCESS && retcode != SQL_SUCCESS_WITH_INFO ) - { - DispAllErrors(henv, hdbc); - if (failOnDataTypeUnsupported) - return false; - } - - retcode = SQLGetInfo(hdbc, SQL_ODBC_SAG_CLI_CONFORMANCE, (UCHAR*) &dbInf.cliConfLvl, sizeof(dbInf.cliConfLvl), &cb); - if (retcode != SQL_SUCCESS && retcode != SQL_SUCCESS_WITH_INFO ) - { - // Not all drivers support this call - Nick Gorham(unixODBC) - dbInf.cliConfLvl = 0; - DispAllErrors(henv, hdbc); - if (failOnDataTypeUnsupported) - return false; - } - - retcode = SQLGetInfo(hdbc, SQL_ODBC_SQL_CONFORMANCE, (UCHAR*) &dbInf.sqlConfLvl, sizeof(dbInf.sqlConfLvl), &cb); - if (retcode != SQL_SUCCESS && retcode != SQL_SUCCESS_WITH_INFO ) - { - DispAllErrors(henv, hdbc); - if (failOnDataTypeUnsupported) - return false; - } - - retcode = SQLGetInfo(hdbc, SQL_OUTER_JOINS, (UCHAR*) dbInf.outerJoins, sizeof(dbInf.outerJoins), &cb); - if (retcode != SQL_SUCCESS && retcode != SQL_SUCCESS_WITH_INFO ) - { - DispAllErrors(henv, hdbc); - if (failOnDataTypeUnsupported) - return false; - } - - retcode = SQLGetInfo(hdbc, SQL_PROCEDURES, (UCHAR*) dbInf.procedureSupport, sizeof(dbInf.procedureSupport), &cb); - if (retcode != SQL_SUCCESS && retcode != SQL_SUCCESS_WITH_INFO ) - { - DispAllErrors(henv, hdbc); - if (failOnDataTypeUnsupported) - return false; - } - - retcode = SQLGetInfo(hdbc, SQL_ACCESSIBLE_TABLES, (UCHAR*) dbInf.accessibleTables, sizeof(dbInf.accessibleTables), &cb); - if (retcode != SQL_SUCCESS && retcode != SQL_SUCCESS_WITH_INFO ) - { - DispAllErrors(henv, hdbc); - if (failOnDataTypeUnsupported) - return false; - } - - retcode = SQLGetInfo(hdbc, SQL_CURSOR_COMMIT_BEHAVIOR, (UCHAR*) &dbInf.cursorCommitBehavior, sizeof(dbInf.cursorCommitBehavior), &cb); - if (retcode != SQL_SUCCESS && retcode != SQL_SUCCESS_WITH_INFO ) - { - DispAllErrors(henv, hdbc); - if (failOnDataTypeUnsupported) - return false; - } - - retcode = SQLGetInfo(hdbc, SQL_CURSOR_ROLLBACK_BEHAVIOR, (UCHAR*) &dbInf.cursorRollbackBehavior, sizeof(dbInf.cursorRollbackBehavior), &cb); - if (retcode != SQL_SUCCESS && retcode != SQL_SUCCESS_WITH_INFO ) - { - DispAllErrors(henv, hdbc); - if (failOnDataTypeUnsupported) - return false; - } - - retcode = SQLGetInfo(hdbc, SQL_NON_NULLABLE_COLUMNS, (UCHAR*) &dbInf.supportNotNullClause, sizeof(dbInf.supportNotNullClause), &cb); - if (retcode != SQL_SUCCESS && retcode != SQL_SUCCESS_WITH_INFO ) - { - DispAllErrors(henv, hdbc); - if (failOnDataTypeUnsupported) - return false; - } - - retcode = SQLGetInfo(hdbc, SQL_ODBC_SQL_OPT_IEF, (UCHAR*) dbInf.supportIEF, sizeof(dbInf.supportIEF), &cb); - if (retcode != SQL_SUCCESS && retcode != SQL_SUCCESS_WITH_INFO ) - { - DispAllErrors(henv, hdbc); - if (failOnDataTypeUnsupported) - return false; - } - - retcode = SQLGetInfo(hdbc, SQL_DEFAULT_TXN_ISOLATION, (UCHAR*) &dbInf.txnIsolation, sizeof(dbInf.txnIsolation), &cb); - if (retcode != SQL_SUCCESS && retcode != SQL_SUCCESS_WITH_INFO ) - { - DispAllErrors(henv, hdbc); - if (failOnDataTypeUnsupported) - return false; - } - - retcode = SQLGetInfo(hdbc, SQL_TXN_ISOLATION_OPTION, (UCHAR*) &dbInf.txnIsolationOptions, sizeof(dbInf.txnIsolationOptions), &cb); - if (retcode != SQL_SUCCESS && retcode != SQL_SUCCESS_WITH_INFO ) - { - DispAllErrors(henv, hdbc); - if (failOnDataTypeUnsupported) - return false; - } - - retcode = SQLGetInfo(hdbc, SQL_FETCH_DIRECTION, (UCHAR*) &dbInf.fetchDirections, sizeof(dbInf.fetchDirections), &cb); - if (retcode != SQL_SUCCESS && retcode != SQL_SUCCESS_WITH_INFO ) - { - DispAllErrors(henv, hdbc); - if (failOnDataTypeUnsupported) - return false; - } - - retcode = SQLGetInfo(hdbc, SQL_LOCK_TYPES, (UCHAR*) &dbInf.lockTypes, sizeof(dbInf.lockTypes), &cb); - if (retcode != SQL_SUCCESS && retcode != SQL_SUCCESS_WITH_INFO ) - { - DispAllErrors(henv, hdbc); - if (failOnDataTypeUnsupported) - return false; - } - - retcode = SQLGetInfo(hdbc, SQL_POS_OPERATIONS, (UCHAR*) &dbInf.posOperations, sizeof(dbInf.posOperations), &cb); - if (retcode != SQL_SUCCESS && retcode != SQL_SUCCESS_WITH_INFO ) - { - DispAllErrors(henv, hdbc); - if (failOnDataTypeUnsupported) - return false; - } - - retcode = SQLGetInfo(hdbc, SQL_POSITIONED_STATEMENTS, (UCHAR*) &dbInf.posStmts, sizeof(dbInf.posStmts), &cb); - if (retcode != SQL_SUCCESS && retcode != SQL_SUCCESS_WITH_INFO ) - { - DispAllErrors(henv, hdbc); - if (failOnDataTypeUnsupported) - return false; - } - - retcode = SQLGetInfo(hdbc, SQL_SCROLL_CONCURRENCY, (UCHAR*) &dbInf.scrollConcurrency, sizeof(dbInf.scrollConcurrency), &cb); - if (retcode != SQL_SUCCESS && retcode != SQL_SUCCESS_WITH_INFO ) - { - DispAllErrors(henv, hdbc); - if (failOnDataTypeUnsupported) - return false; - } - - retcode = SQLGetInfo(hdbc, SQL_SCROLL_OPTIONS, (UCHAR*) &dbInf.scrollOptions, sizeof(dbInf.scrollOptions), &cb); - if (retcode != SQL_SUCCESS && retcode != SQL_SUCCESS_WITH_INFO ) - { - DispAllErrors(henv, hdbc); - if (failOnDataTypeUnsupported) - return false; - } - - retcode = SQLGetInfo(hdbc, SQL_STATIC_SENSITIVITY, (UCHAR*) &dbInf.staticSensitivity, sizeof(dbInf.staticSensitivity), &cb); - if (retcode != SQL_SUCCESS && retcode != SQL_SUCCESS_WITH_INFO ) - { - DispAllErrors(henv, hdbc); - if (failOnDataTypeUnsupported) - return false; - } - - retcode = SQLGetInfo(hdbc, SQL_TXN_CAPABLE, (UCHAR*) &dbInf.txnCapable, sizeof(dbInf.txnCapable), &cb); - if (retcode != SQL_SUCCESS && retcode != SQL_SUCCESS_WITH_INFO ) - { - DispAllErrors(henv, hdbc); - if (failOnDataTypeUnsupported) - return false; - } - - retcode = SQLGetInfo(hdbc, SQL_LOGIN_TIMEOUT, (UCHAR*) &dbInf.loginTimeout, sizeof(dbInf.loginTimeout), &cb); - if (retcode != SQL_SUCCESS && retcode != SQL_SUCCESS_WITH_INFO ) - { - DispAllErrors(henv, hdbc); - if (failOnDataTypeUnsupported) - return false; - } - -#ifdef DBDEBUG_CONSOLE - cout << wxT("***** DATA SOURCE INFORMATION *****") << endl; - cout << wxT(wxT("SERVER Name: ") << dbInf.serverName << endl; - cout << wxT("DBMS Name: ") << dbInf.dbmsName << wxT("; DBMS Version: ") << dbInf.dbmsVer << endl; - cout << wxT("ODBC Version: ") << dbInf.odbcVer << wxT("; Driver Version: ") << dbInf.driverVer << endl; - - cout << wxT("API Conf. Level: "); - switch(dbInf.apiConfLvl) - { - case SQL_OAC_NONE: cout << wxT("None"); break; - case SQL_OAC_LEVEL1: cout << wxT("Level 1"); break; - case SQL_OAC_LEVEL2: cout << wxT("Level 2"); break; - } - cout << endl; - - cout << wxT("SAG CLI Conf. Level: "); - switch(dbInf.cliConfLvl) - { - case SQL_OSCC_NOT_COMPLIANT: cout << wxT("Not Compliant"); break; - case SQL_OSCC_COMPLIANT: cout << wxT("Compliant"); break; - } - cout << endl; - - cout << wxT("SQL Conf. Level: "); - switch(dbInf.sqlConfLvl) - { - case SQL_OSC_MINIMUM: cout << wxT("Minimum Grammar"); break; - case SQL_OSC_CORE: cout << wxT("Core Grammar"); break; - case SQL_OSC_EXTENDED: cout << wxT("Extended Grammar"); break; - } - cout << endl; - - cout << wxT("Max. Connections: ") << dbInf.maxConnections << endl; - cout << wxT("Outer Joins: ") << dbInf.outerJoins << endl; - cout << wxT("Support for Procedures: ") << dbInf.procedureSupport << endl; - cout << wxT("All tables accessible : ") << dbInf.accessibleTables << endl; - cout << wxT("Cursor COMMIT Behavior: "); - switch(dbInf.cursorCommitBehavior) - { - case SQL_CB_DELETE: cout << wxT("Delete cursors"); break; - case SQL_CB_CLOSE: cout << wxT("Close cursors"); break; - case SQL_CB_PRESERVE: cout << wxT("Preserve cursors"); break; - } - cout << endl; - - cout << wxT("Cursor ROLLBACK Behavior: "); - switch(dbInf.cursorRollbackBehavior) - { - case SQL_CB_DELETE: cout << wxT("Delete cursors"); break; - case SQL_CB_CLOSE: cout << wxT("Close cursors"); break; - case SQL_CB_PRESERVE: cout << wxT("Preserve cursors"); break; - } - cout << endl; - - cout << wxT("Support NOT NULL clause: "); - switch(dbInf.supportNotNullClause) - { - case SQL_NNC_NULL: cout << wxT("No"); break; - case SQL_NNC_NON_NULL: cout << wxT("Yes"); break; - } - cout << endl; - - cout << wxT("Support IEF (Ref. Integrity): ") << dbInf.supportIEF << endl; - cout << wxT("Login Timeout: ") << dbInf.loginTimeout << endl; - - cout << endl << endl << wxT("more ...") << endl; - getchar(); - - cout << wxT("Default Transaction Isolation: "; - switch(dbInf.txnIsolation) - { - case SQL_TXN_READ_UNCOMMITTED: cout << wxT("Read Uncommitted"); break; - case SQL_TXN_READ_COMMITTED: cout << wxT("Read Committed"); break; - case SQL_TXN_REPEATABLE_READ: cout << wxT("Repeatable Read"); break; - case SQL_TXN_SERIALIZABLE: cout << wxT("Serializable"); break; -#ifdef ODBC_V20 - case SQL_TXN_VERSIONING: cout << wxT("Versioning"); break; -#endif - } - cout << endl; - - cout << wxT("Transaction Isolation Options: "); - if (dbInf.txnIsolationOptions & SQL_TXN_READ_UNCOMMITTED) - cout << wxT("Read Uncommitted, "); - if (dbInf.txnIsolationOptions & SQL_TXN_READ_COMMITTED) - cout << wxT("Read Committed, "); - if (dbInf.txnIsolationOptions & SQL_TXN_REPEATABLE_READ) - cout << wxT("Repeatable Read, "); - if (dbInf.txnIsolationOptions & SQL_TXN_SERIALIZABLE) - cout << wxT("Serializable, "); -#ifdef ODBC_V20 - if (dbInf.txnIsolationOptions & SQL_TXN_VERSIONING) - cout << wxT("Versioning"); -#endif - cout << endl; - - cout << wxT("Fetch Directions Supported:") << endl << wxT(" "); - if (dbInf.fetchDirections & SQL_FD_FETCH_NEXT) - cout << wxT("Next, "); - if (dbInf.fetchDirections & SQL_FD_FETCH_PRIOR) - cout << wxT("Prev, "); - if (dbInf.fetchDirections & SQL_FD_FETCH_FIRST) - cout << wxT("First, "); - if (dbInf.fetchDirections & SQL_FD_FETCH_LAST) - cout << wxT("Last, "); - if (dbInf.fetchDirections & SQL_FD_FETCH_ABSOLUTE) - cout << wxT("Absolute, "); - if (dbInf.fetchDirections & SQL_FD_FETCH_RELATIVE) - cout << wxT("Relative, "); -#ifdef ODBC_V20 - if (dbInf.fetchDirections & SQL_FD_FETCH_RESUME) - cout << wxT("Resume, "); -#endif - if (dbInf.fetchDirections & SQL_FD_FETCH_BOOKMARK) - cout << wxT("Bookmark"); - cout << endl; - - cout << wxT("Lock Types Supported (SQLSetPos): "); - if (dbInf.lockTypes & SQL_LCK_NO_CHANGE) - cout << wxT("No Change, "); - if (dbInf.lockTypes & SQL_LCK_EXCLUSIVE) - cout << wxT("Exclusive, "); - if (dbInf.lockTypes & SQL_LCK_UNLOCK) - cout << wxT("UnLock"); - cout << endl; - - cout << wxT("Position Operations Supported (SQLSetPos): "); - if (dbInf.posOperations & SQL_POS_POSITION) - cout << wxT("Position, "); - if (dbInf.posOperations & SQL_POS_REFRESH) - cout << wxT("Refresh, "); - if (dbInf.posOperations & SQL_POS_UPDATE) - cout << wxT("Upd, ")); - if (dbInf.posOperations & SQL_POS_DELETE) - cout << wxT("Del, "); - if (dbInf.posOperations & SQL_POS_ADD) - cout << wxT("Add"); - cout << endl; - - cout << wxT("Positioned Statements Supported: "); - if (dbInf.posStmts & SQL_PS_POSITIONED_DELETE) - cout << wxT("Pos delete, "); - if (dbInf.posStmts & SQL_PS_POSITIONED_UPDATE) - cout << wxT("Pos update, "); - if (dbInf.posStmts & SQL_PS_SELECT_FOR_UPDATE) - cout << wxT("Select for update"); - cout << endl; - - cout << wxT("Scroll Concurrency: "); - if (dbInf.scrollConcurrency & SQL_SCCO_READ_ONLY) - cout << wxT("Read Only, "); - if (dbInf.scrollConcurrency & SQL_SCCO_LOCK) - cout << wxT("Lock, "); - if (dbInf.scrollConcurrency & SQL_SCCO_OPT_ROWVER) - cout << wxT("Opt. Rowver, "); - if (dbInf.scrollConcurrency & SQL_SCCO_OPT_VALUES) - cout << wxT("Opt. Values"); - cout << endl; - - cout << wxT("Scroll Options: "); - if (dbInf.scrollOptions & SQL_SO_FORWARD_ONLY) - cout << wxT("Fwd Only, "); - if (dbInf.scrollOptions & SQL_SO_STATIC) - cout << wxT("Static, "); - if (dbInf.scrollOptions & SQL_SO_KEYSET_DRIVEN) - cout << wxT("Keyset Driven, "); - if (dbInf.scrollOptions & SQL_SO_DYNAMIC) - cout << wxT("Dynamic, "); - if (dbInf.scrollOptions & SQL_SO_MIXED) - cout << wxT("Mixed"); - cout << endl; - - cout << wxT("Static Sensitivity: "); - if (dbInf.staticSensitivity & SQL_SS_ADDITIONS) - cout << wxT("Additions, "); - if (dbInf.staticSensitivity & SQL_SS_DELETIONS) - cout << wxT("Deletions, "); - if (dbInf.staticSensitivity & SQL_SS_UPDATES) - cout << wxT("Updates"); - cout << endl; - - cout << wxT("Transaction Capable?: "); - switch(dbInf.txnCapable) - { - case SQL_TC_NONE: cout << wxT("No"); break; - case SQL_TC_DML: cout << wxT("DML Only"); break; - case SQL_TC_DDL_COMMIT: cout << wxT("DDL Commit"); break; - case SQL_TC_DDL_IGNORE: cout << wxT("DDL Ignore"); break; - case SQL_TC_ALL: cout << wxT("DDL & DML"); break; - } - cout << endl; - - cout << endl; -#endif - - // Completed Successfully - return true; - -} // wxDb::getDbInfo() - - -/********** wxDb::getDataTypeInfo() **********/ -bool wxDb::getDataTypeInfo(SWORD fSqlType, wxDbSqlTypeInfo &structSQLTypeInfo) -{ -/* - * fSqlType will be something like SQL_VARCHAR. This parameter determines - * the data type inf. is gathered for. - * - * wxDbSqlTypeInfo is a structure that is filled in with data type information, - */ - RETCODE retcode; - SQLLEN cbRet; - - // Get information about the data type specified - if (SQLGetTypeInfo(hstmt, fSqlType) != SQL_SUCCESS) - return(DispAllErrors(henv, hdbc, hstmt)); - - // Fetch the record - retcode = SQLFetch(hstmt); - if (retcode != SQL_SUCCESS) - { -#ifdef DBDEBUG_CONSOLE - if (retcode == SQL_NO_DATA_FOUND) - cout << wxT("SQL_NO_DATA_FOUND fetching information about data type.") << endl; -#endif - DispAllErrors(henv, hdbc, hstmt); - SQLFreeStmt(hstmt, SQL_CLOSE); - return false; - } - - wxChar typeName[DB_TYPE_NAME_LEN+1]; - - // Obtain columns from the record - if (SQLGetData(hstmt, 1, SQL_C_WXCHAR, typeName, sizeof(typeName), &cbRet) != SQL_SUCCESS) - return(DispAllErrors(henv, hdbc, hstmt)); - - structSQLTypeInfo.TypeName = typeName; - - // BJO 20000503: no more needed with new GetColumns... -#if OLD_GETCOLUMNS - // BJO 991209 - if (Dbms() == dbmsMY_SQL) - { - if (structSQLTypeInfo.TypeName == wxT("middleint")) - structSQLTypeInfo.TypeName = wxT("mediumint"); - else if (structSQLTypeInfo.TypeName == wxT("middleint unsigned")) - structSQLTypeInfo.TypeName = wxT("mediumint unsigned"); - else if (structSQLTypeInfo.TypeName == wxT("integer")) - structSQLTypeInfo.TypeName = wxT("int"); - else if (structSQLTypeInfo.TypeName == wxT("integer unsigned")) - structSQLTypeInfo.TypeName = wxT("int unsigned"); - else if (structSQLTypeInfo.TypeName == wxT("middleint")) - structSQLTypeInfo.TypeName = wxT("mediumint"); - else if (structSQLTypeInfo.TypeName == wxT("varchar")) - structSQLTypeInfo.TypeName = wxT("char"); - } - - // BJO 20000427 : OpenLink driver - if (!wxStrncmp(dbInf.driverName, wxT("oplodbc"), 7) || - !wxStrncmp(dbInf.driverName, wxT("OLOD"), 4)) - { - if (structSQLTypeInfo.TypeName == wxT("double precision")) - structSQLTypeInfo.TypeName = wxT("real"); - } -#endif - - if (SQLGetData(hstmt, 3, SQL_C_LONG, (UCHAR*) &structSQLTypeInfo.Precision, 0, &cbRet) != SQL_SUCCESS) - return(DispAllErrors(henv, hdbc, hstmt)); - if (SQLGetData(hstmt, 8, SQL_C_SHORT, (UCHAR*) &structSQLTypeInfo.CaseSensitive, 0, &cbRet) != SQL_SUCCESS) - return(DispAllErrors(henv, hdbc, hstmt)); -// if (SQLGetData(hstmt, 14, SQL_C_SHORT, (UCHAR*) &structSQLTypeInfo.MinimumScale, 0, &cbRet) != SQL_SUCCESS) -// return(DispAllErrors(henv, hdbc, hstmt)); - - if (SQLGetData(hstmt, 15, SQL_C_SHORT,(UCHAR*) &structSQLTypeInfo.MaximumScale, 0, &cbRet) != SQL_SUCCESS) - return(DispAllErrors(henv, hdbc, hstmt)); - - if (structSQLTypeInfo.MaximumScale < 0) - structSQLTypeInfo.MaximumScale = 0; - - // Close the statement handle which closes open cursors - if (SQLFreeStmt(hstmt, SQL_CLOSE) != SQL_SUCCESS) - return(DispAllErrors(henv, hdbc, hstmt)); - - // Completed Successfully - return true; - -} // wxDb::getDataTypeInfo() - - -/********** wxDb::Close() **********/ -void wxDb::Close(void) -{ - // Close the Sql Log file - if (fpSqlLog) - { - fclose(fpSqlLog); - fpSqlLog = 0; - } - - // Free statement handle - if (dbIsOpen) - { - if (SQLFreeStmt(hstmt, SQL_DROP) != SQL_SUCCESS) - DispAllErrors(henv, hdbc); - } - - // Disconnect from the datasource - if (SQLDisconnect(hdbc) != SQL_SUCCESS) - DispAllErrors(henv, hdbc); - - // Free the connection to the datasource - if (SQLFreeConnect(hdbc) != SQL_SUCCESS) - DispAllErrors(henv, hdbc); - - // There should be zero Ctable objects still connected to this db object - wxASSERT(nTables == 0); - -#ifdef __WXDEBUG__ - { -#if wxUSE_THREADS - wxCriticalSectionLocker lock(csTablesInUse); -#endif // wxUSE_THREADS - wxTablesInUse *tiu; - wxList::compatibility_iterator pNode; - pNode = TablesInUse.GetFirst(); - wxString s,s2; - while (pNode) - { - tiu = (wxTablesInUse *)pNode->GetData(); - if (tiu->pDb == this) - { - s.Printf(wxT("(%-20s) tableID:[%6lu] pDb:[%p]"), - tiu->tableName, tiu->tableID, wx_static_cast(void*, tiu->pDb)); - s2.Printf(wxT("Orphaned table found using pDb:[%p]"), wx_static_cast(void*, this)); - wxLogDebug(s.c_str(),s2.c_str()); - } - pNode = pNode->GetNext(); - } - } -#endif - - // Copy the error messages to a global variable - int i; - for (i = 0; i < DB_MAX_ERROR_HISTORY; i++) - wxStrcpy(DBerrorList[i], errorList[i]); - - dbmsType = dbmsUNIDENTIFIED; - dbIsOpen = false; - -} // wxDb::Close() - - -/********** wxDb::CommitTrans() **********/ -bool wxDb::CommitTrans(void) -{ - if (this) - { - // Commit the transaction - if (SQLTransact(henv, hdbc, SQL_COMMIT) != SQL_SUCCESS) - return(DispAllErrors(henv, hdbc)); - } - - // Completed successfully - return true; - -} // wxDb::CommitTrans() - - -/********** wxDb::RollbackTrans() **********/ -bool wxDb::RollbackTrans(void) -{ - // Rollback the transaction - if (SQLTransact(henv, hdbc, SQL_ROLLBACK) != SQL_SUCCESS) - return(DispAllErrors(henv, hdbc)); - - // Completed successfully - return true; - -} // wxDb::RollbackTrans() - - -/********** wxDb::DispAllErrors() **********/ -bool wxDb::DispAllErrors(HENV aHenv, HDBC aHdbc, HSTMT aHstmt) -/* - * This function is called internally whenever an error condition prevents the user's - * request from being executed. This function will query the datasource as to the - * actual error(s) that just occurred on the previous request of the datasource. - * - * The function will retrieve each error condition from the datasource and - * Printf the codes/text values into a string which it then logs via logError(). - * If in DBDEBUG_CONSOLE mode, the constructed string will be displayed in the console - * window and program execution will be paused until the user presses a key. - * - * This function always returns false, so that functions which call this function - * can have a line like "return (DispAllErrors(henv, hdbc));" to indicate the failure - * of the user's request, so that the calling code can then process the error message log. - */ -{ - wxString odbcErrMsg; - - while (SQLError(aHenv, aHdbc, aHstmt, (SQLTCHAR FAR *) sqlState, &nativeError, (SQLTCHAR FAR *) errorMsg, SQL_MAX_MESSAGE_LENGTH - 1, &cbErrorMsg) == SQL_SUCCESS) - { - odbcErrMsg.Printf(wxT("SQL State = %s\nNative Error Code = %li\nError Message = %s\n"), - sqlState, (long)nativeError, errorMsg); - logError(odbcErrMsg, sqlState); - if (!silent) - { -#ifdef DBDEBUG_CONSOLE - // When run in console mode, use standard out to display errors. - cout << odbcErrMsg.c_str() << endl; - cout << wxT("Press any key to continue...") << endl; - getchar(); -#endif - -#ifdef __WXDEBUG__ - wxLogDebug(odbcErrMsg,wxT("ODBC DEBUG MESSAGE from DispAllErrors()")); -#endif - } - } - - return false; // This function always returns false. - -} // wxDb::DispAllErrors() - - -/********** wxDb::GetNextError() **********/ -bool wxDb::GetNextError(HENV aHenv, HDBC aHdbc, HSTMT aHstmt) -{ - if (SQLError(aHenv, aHdbc, aHstmt, (SQLTCHAR FAR *) sqlState, &nativeError, (SQLTCHAR FAR *) errorMsg, SQL_MAX_MESSAGE_LENGTH - 1, &cbErrorMsg) == SQL_SUCCESS) - return true; - else - return false; - -} // wxDb::GetNextError() - - -/********** wxDb::DispNextError() **********/ -void wxDb::DispNextError(void) -{ - wxString odbcErrMsg; - - odbcErrMsg.Printf(wxT("SQL State = %s\nNative Error Code = %li\nError Message = %s\n"), - sqlState, (long)nativeError, errorMsg); - logError(odbcErrMsg, sqlState); - - if (silent) - return; - -#ifdef DBDEBUG_CONSOLE - // When run in console mode, use standard out to display errors. - cout << odbcErrMsg.c_str() << endl; - cout << wxT("Press any key to continue...") << endl; - getchar(); -#endif - -#ifdef __WXDEBUG__ - wxLogDebug(odbcErrMsg,wxT("ODBC DEBUG MESSAGE")); -#endif // __WXDEBUG__ - -} // wxDb::DispNextError() - - -/********** wxDb::logError() **********/ -void wxDb::logError(const wxString &errMsg, const wxString &SQLState) -{ - wxASSERT(errMsg.length()); - - static int pLast = -1; - int dbStatus; - - if (++pLast == DB_MAX_ERROR_HISTORY) - { - int i; - for (i = 0; i < DB_MAX_ERROR_HISTORY-1; i++) - wxStrcpy(errorList[i], errorList[i+1]); - pLast--; - } - - wxStrncpy(errorList[pLast], errMsg, DB_MAX_ERROR_MSG_LEN); - errorList[pLast][DB_MAX_ERROR_MSG_LEN-1] = 0; - - if (SQLState.length()) - if ((dbStatus = TranslateSqlState(SQLState)) != DB_ERR_FUNCTION_SEQUENCE_ERROR) - DB_STATUS = dbStatus; - - // Add the errmsg to the sql log - WriteSqlLog(errMsg); - -} // wxDb::logError() - - -/**********wxDb::TranslateSqlState() **********/ -int wxDb::TranslateSqlState(const wxString &SQLState) -{ - if (!wxStrcmp(SQLState, wxT("01000"))) - return(DB_ERR_GENERAL_WARNING); - if (!wxStrcmp(SQLState, wxT("01002"))) - return(DB_ERR_DISCONNECT_ERROR); - if (!wxStrcmp(SQLState, wxT("01004"))) - return(DB_ERR_DATA_TRUNCATED); - if (!wxStrcmp(SQLState, wxT("01006"))) - return(DB_ERR_PRIV_NOT_REVOKED); - if (!wxStrcmp(SQLState, wxT("01S00"))) - return(DB_ERR_INVALID_CONN_STR_ATTR); - if (!wxStrcmp(SQLState, wxT("01S01"))) - return(DB_ERR_ERROR_IN_ROW); - if (!wxStrcmp(SQLState, wxT("01S02"))) - return(DB_ERR_OPTION_VALUE_CHANGED); - if (!wxStrcmp(SQLState, wxT("01S03"))) - return(DB_ERR_NO_ROWS_UPD_OR_DEL); - if (!wxStrcmp(SQLState, wxT("01S04"))) - return(DB_ERR_MULTI_ROWS_UPD_OR_DEL); - if (!wxStrcmp(SQLState, wxT("07001"))) - return(DB_ERR_WRONG_NO_OF_PARAMS); - if (!wxStrcmp(SQLState, wxT("07006"))) - return(DB_ERR_DATA_TYPE_ATTR_VIOL); - if (!wxStrcmp(SQLState, wxT("08001"))) - return(DB_ERR_UNABLE_TO_CONNECT); - if (!wxStrcmp(SQLState, wxT("08002"))) - return(DB_ERR_CONNECTION_IN_USE); - if (!wxStrcmp(SQLState, wxT("08003"))) - return(DB_ERR_CONNECTION_NOT_OPEN); - if (!wxStrcmp(SQLState, wxT("08004"))) - return(DB_ERR_REJECTED_CONNECTION); - if (!wxStrcmp(SQLState, wxT("08007"))) - return(DB_ERR_CONN_FAIL_IN_TRANS); - if (!wxStrcmp(SQLState, wxT("08S01"))) - return(DB_ERR_COMM_LINK_FAILURE); - if (!wxStrcmp(SQLState, wxT("21S01"))) - return(DB_ERR_INSERT_VALUE_LIST_MISMATCH); - if (!wxStrcmp(SQLState, wxT("21S02"))) - return(DB_ERR_DERIVED_TABLE_MISMATCH); - if (!wxStrcmp(SQLState, wxT("22001"))) - return(DB_ERR_STRING_RIGHT_TRUNC); - if (!wxStrcmp(SQLState, wxT("22003"))) - return(DB_ERR_NUMERIC_VALUE_OUT_OF_RNG); - if (!wxStrcmp(SQLState, wxT("22005"))) - return(DB_ERR_ERROR_IN_ASSIGNMENT); - if (!wxStrcmp(SQLState, wxT("22008"))) - return(DB_ERR_DATETIME_FLD_OVERFLOW); - if (!wxStrcmp(SQLState, wxT("22012"))) - return(DB_ERR_DIVIDE_BY_ZERO); - if (!wxStrcmp(SQLState, wxT("22026"))) - return(DB_ERR_STR_DATA_LENGTH_MISMATCH); - if (!wxStrcmp(SQLState, wxT("23000"))) - return(DB_ERR_INTEGRITY_CONSTRAINT_VIOL); - if (!wxStrcmp(SQLState, wxT("24000"))) - return(DB_ERR_INVALID_CURSOR_STATE); - if (!wxStrcmp(SQLState, wxT("25000"))) - return(DB_ERR_INVALID_TRANS_STATE); - if (!wxStrcmp(SQLState, wxT("28000"))) - return(DB_ERR_INVALID_AUTH_SPEC); - if (!wxStrcmp(SQLState, wxT("34000"))) - return(DB_ERR_INVALID_CURSOR_NAME); - if (!wxStrcmp(SQLState, wxT("37000"))) - return(DB_ERR_SYNTAX_ERROR_OR_ACCESS_VIOL); - if (!wxStrcmp(SQLState, wxT("3C000"))) - return(DB_ERR_DUPLICATE_CURSOR_NAME); - if (!wxStrcmp(SQLState, wxT("40001"))) - return(DB_ERR_SERIALIZATION_FAILURE); - if (!wxStrcmp(SQLState, wxT("42000"))) - return(DB_ERR_SYNTAX_ERROR_OR_ACCESS_VIOL2); - if (!wxStrcmp(SQLState, wxT("70100"))) - return(DB_ERR_OPERATION_ABORTED); - if (!wxStrcmp(SQLState, wxT("IM001"))) - return(DB_ERR_UNSUPPORTED_FUNCTION); - if (!wxStrcmp(SQLState, wxT("IM002"))) - return(DB_ERR_NO_DATA_SOURCE); - if (!wxStrcmp(SQLState, wxT("IM003"))) - return(DB_ERR_DRIVER_LOAD_ERROR); - if (!wxStrcmp(SQLState, wxT("IM004"))) - return(DB_ERR_SQLALLOCENV_FAILED); - if (!wxStrcmp(SQLState, wxT("IM005"))) - return(DB_ERR_SQLALLOCCONNECT_FAILED); - if (!wxStrcmp(SQLState, wxT("IM006"))) - return(DB_ERR_SQLSETCONNECTOPTION_FAILED); - if (!wxStrcmp(SQLState, wxT("IM007"))) - return(DB_ERR_NO_DATA_SOURCE_DLG_PROHIB); - if (!wxStrcmp(SQLState, wxT("IM008"))) - return(DB_ERR_DIALOG_FAILED); - if (!wxStrcmp(SQLState, wxT("IM009"))) - return(DB_ERR_UNABLE_TO_LOAD_TRANSLATION_DLL); - if (!wxStrcmp(SQLState, wxT("IM010"))) - return(DB_ERR_DATA_SOURCE_NAME_TOO_LONG); - if (!wxStrcmp(SQLState, wxT("IM011"))) - return(DB_ERR_DRIVER_NAME_TOO_LONG); - if (!wxStrcmp(SQLState, wxT("IM012"))) - return(DB_ERR_DRIVER_KEYWORD_SYNTAX_ERROR); - if (!wxStrcmp(SQLState, wxT("IM013"))) - return(DB_ERR_TRACE_FILE_ERROR); - if (!wxStrcmp(SQLState, wxT("S0001"))) - return(DB_ERR_TABLE_OR_VIEW_ALREADY_EXISTS); - if (!wxStrcmp(SQLState, wxT("S0002"))) - return(DB_ERR_TABLE_NOT_FOUND); - if (!wxStrcmp(SQLState, wxT("S0011"))) - return(DB_ERR_INDEX_ALREADY_EXISTS); - if (!wxStrcmp(SQLState, wxT("S0012"))) - return(DB_ERR_INDEX_NOT_FOUND); - if (!wxStrcmp(SQLState, wxT("S0021"))) - return(DB_ERR_COLUMN_ALREADY_EXISTS); - if (!wxStrcmp(SQLState, wxT("S0022"))) - return(DB_ERR_COLUMN_NOT_FOUND); - if (!wxStrcmp(SQLState, wxT("S0023"))) - return(DB_ERR_NO_DEFAULT_FOR_COLUMN); - if (!wxStrcmp(SQLState, wxT("S1000"))) - return(DB_ERR_GENERAL_ERROR); - if (!wxStrcmp(SQLState, wxT("S1001"))) - return(DB_ERR_MEMORY_ALLOCATION_FAILURE); - if (!wxStrcmp(SQLState, wxT("S1002"))) - return(DB_ERR_INVALID_COLUMN_NUMBER); - if (!wxStrcmp(SQLState, wxT("S1003"))) - return(DB_ERR_PROGRAM_TYPE_OUT_OF_RANGE); - if (!wxStrcmp(SQLState, wxT("S1004"))) - return(DB_ERR_SQL_DATA_TYPE_OUT_OF_RANGE); - if (!wxStrcmp(SQLState, wxT("S1008"))) - return(DB_ERR_OPERATION_CANCELLED); - if (!wxStrcmp(SQLState, wxT("S1009"))) - return(DB_ERR_INVALID_ARGUMENT_VALUE); - if (!wxStrcmp(SQLState, wxT("S1010"))) - return(DB_ERR_FUNCTION_SEQUENCE_ERROR); - if (!wxStrcmp(SQLState, wxT("S1011"))) - return(DB_ERR_OPERATION_INVALID_AT_THIS_TIME); - if (!wxStrcmp(SQLState, wxT("S1012"))) - return(DB_ERR_INVALID_TRANS_OPERATION_CODE); - if (!wxStrcmp(SQLState, wxT("S1015"))) - return(DB_ERR_NO_CURSOR_NAME_AVAIL); - if (!wxStrcmp(SQLState, wxT("S1090"))) - return(DB_ERR_INVALID_STR_OR_BUF_LEN); - if (!wxStrcmp(SQLState, wxT("S1091"))) - return(DB_ERR_DESCRIPTOR_TYPE_OUT_OF_RANGE); - if (!wxStrcmp(SQLState, wxT("S1092"))) - return(DB_ERR_OPTION_TYPE_OUT_OF_RANGE); - if (!wxStrcmp(SQLState, wxT("S1093"))) - return(DB_ERR_INVALID_PARAM_NO); - if (!wxStrcmp(SQLState, wxT("S1094"))) - return(DB_ERR_INVALID_SCALE_VALUE); - if (!wxStrcmp(SQLState, wxT("S1095"))) - return(DB_ERR_FUNCTION_TYPE_OUT_OF_RANGE); - if (!wxStrcmp(SQLState, wxT("S1096"))) - return(DB_ERR_INF_TYPE_OUT_OF_RANGE); - if (!wxStrcmp(SQLState, wxT("S1097"))) - return(DB_ERR_COLUMN_TYPE_OUT_OF_RANGE); - if (!wxStrcmp(SQLState, wxT("S1098"))) - return(DB_ERR_SCOPE_TYPE_OUT_OF_RANGE); - if (!wxStrcmp(SQLState, wxT("S1099"))) - return(DB_ERR_NULLABLE_TYPE_OUT_OF_RANGE); - if (!wxStrcmp(SQLState, wxT("S1100"))) - return(DB_ERR_UNIQUENESS_OPTION_TYPE_OUT_OF_RANGE); - if (!wxStrcmp(SQLState, wxT("S1101"))) - return(DB_ERR_ACCURACY_OPTION_TYPE_OUT_OF_RANGE); - if (!wxStrcmp(SQLState, wxT("S1103"))) - return(DB_ERR_DIRECTION_OPTION_OUT_OF_RANGE); - if (!wxStrcmp(SQLState, wxT("S1104"))) - return(DB_ERR_INVALID_PRECISION_VALUE); - if (!wxStrcmp(SQLState, wxT("S1105"))) - return(DB_ERR_INVALID_PARAM_TYPE); - if (!wxStrcmp(SQLState, wxT("S1106"))) - return(DB_ERR_FETCH_TYPE_OUT_OF_RANGE); - if (!wxStrcmp(SQLState, wxT("S1107"))) - return(DB_ERR_ROW_VALUE_OUT_OF_RANGE); - if (!wxStrcmp(SQLState, wxT("S1108"))) - return(DB_ERR_CONCURRENCY_OPTION_OUT_OF_RANGE); - if (!wxStrcmp(SQLState, wxT("S1109"))) - return(DB_ERR_INVALID_CURSOR_POSITION); - if (!wxStrcmp(SQLState, wxT("S1110"))) - return(DB_ERR_INVALID_DRIVER_COMPLETION); - if (!wxStrcmp(SQLState, wxT("S1111"))) - return(DB_ERR_INVALID_BOOKMARK_VALUE); - if (!wxStrcmp(SQLState, wxT("S1C00"))) - return(DB_ERR_DRIVER_NOT_CAPABLE); - if (!wxStrcmp(SQLState, wxT("S1T00"))) - return(DB_ERR_TIMEOUT_EXPIRED); - - // No match - return(0); - -} // wxDb::TranslateSqlState() - - -/********** wxDb::Grant() **********/ -bool wxDb::Grant(int privileges, const wxString &tableName, const wxString &userList) -{ - wxString sqlStmt; - - // Build the grant statement - sqlStmt = wxT("GRANT "); - if (privileges == DB_GRANT_ALL) - sqlStmt += wxT("ALL"); - else - { - int c = 0; - if (privileges & DB_GRANT_SELECT) - { - sqlStmt += wxT("SELECT"); - c++; - } - if (privileges & DB_GRANT_INSERT) - { - if (c++) - sqlStmt += wxT(", "); - sqlStmt += wxT("INSERT"); - } - if (privileges & DB_GRANT_UPDATE) - { - if (c++) - sqlStmt += wxT(", "); - sqlStmt += wxT("UPDATE"); - } - if (privileges & DB_GRANT_DELETE) - { - if (c++) - sqlStmt += wxT(", "); - sqlStmt += wxT("DELETE"); - } - } - - sqlStmt += wxT(" ON "); - sqlStmt += SQLTableName(tableName); - sqlStmt += wxT(" TO "); - sqlStmt += userList; - -#ifdef DBDEBUG_CONSOLE - cout << endl << sqlStmt.c_str() << endl; -#endif - - WriteSqlLog(sqlStmt); - - return(ExecSql(sqlStmt)); - -} // wxDb::Grant() - - -/********** wxDb::CreateView() **********/ -bool wxDb::CreateView(const wxString &viewName, const wxString &colList, - const wxString &pSqlStmt, bool attemptDrop) -{ - wxString sqlStmt; - - // Drop the view first - if (attemptDrop && !DropView(viewName)) - return false; - - // Build the create view statement - sqlStmt = wxT("CREATE VIEW "); - sqlStmt += viewName; - - if (colList.length()) - { - sqlStmt += wxT(" ("); - sqlStmt += colList; - sqlStmt += wxT(")"); - } - - sqlStmt += wxT(" AS "); - sqlStmt += pSqlStmt; - - WriteSqlLog(sqlStmt); - -#ifdef DBDEBUG_CONSOLE - cout << sqlStmt.c_str() << endl; -#endif - - return(ExecSql(sqlStmt)); - -} // wxDb::CreateView() - - -/********** wxDb::DropView() **********/ -bool wxDb::DropView(const wxString &viewName) -{ -/* - * NOTE: This function returns true if the View does not exist, but - * only for identified databases. Code will need to be added - * below for any other databases when those databases are defined - * to handle this situation consistently - */ - wxString sqlStmt; - - sqlStmt.Printf(wxT("DROP VIEW %s"), viewName.c_str()); - - WriteSqlLog(sqlStmt); - -#ifdef DBDEBUG_CONSOLE - cout << endl << sqlStmt.c_str() << endl; -#endif - - if (SQLExecDirect(hstmt, (SQLTCHAR FAR *) sqlStmt.c_str(), SQL_NTS) != SQL_SUCCESS) - { - // Check for "Base table not found" error and ignore - GetNextError(henv, hdbc, hstmt); - if (wxStrcmp(sqlState,wxT("S0002"))) // "Base table not found" - { - // Check for product specific error codes - if (!((Dbms() == dbmsSYBASE_ASA && !wxStrcmp(sqlState,wxT("42000"))))) // 5.x (and lower?) - { - DispNextError(); - DispAllErrors(henv, hdbc, hstmt); - RollbackTrans(); - return false; - } - } - } - - // Commit the transaction - if (!CommitTrans()) - return false; - - return true; - -} // wxDb::DropView() - - -/********** wxDb::ExecSql() **********/ -bool wxDb::ExecSql(const wxString &pSqlStmt) -{ - RETCODE retcode; - - SQLFreeStmt(hstmt, SQL_CLOSE); - - retcode = SQLExecDirect(hstmt, (SQLTCHAR FAR *) pSqlStmt.c_str(), SQL_NTS); - if (retcode == SQL_SUCCESS || - (Dbms() == dbmsDB2 && (retcode == SQL_SUCCESS_WITH_INFO || retcode == SQL_NO_DATA_FOUND))) - { - return true; - } - else - { - DispAllErrors(henv, hdbc, hstmt); - return false; - } - -} // wxDb::ExecSql() - - -/********** wxDb::ExecSql() with column info **********/ -bool wxDb::ExecSql(const wxString &pSqlStmt, wxDbColInf** columns, short& numcols) -{ - //execute the statement first - if (!ExecSql(pSqlStmt)) - return false; - - SWORD noCols; - if (SQLNumResultCols(hstmt, &noCols) != SQL_SUCCESS) - { - DispAllErrors(henv, hdbc, hstmt); - return false; - } - - if (noCols == 0) - return false; - else - numcols = noCols; - - // Get column information - short colNum; - wxChar name[DB_MAX_COLUMN_NAME_LEN+1]; - SWORD Sword; - SQLLEN Sqllen; - wxDbColInf* pColInf = new wxDbColInf[noCols]; - - // Fill in column information (name, datatype) - for (colNum = 0; colNum < noCols; colNum++) - { - if (SQLColAttributes(hstmt, (UWORD)(colNum+1), SQL_COLUMN_NAME, - name, sizeof(name), - &Sword, &Sqllen) != SQL_SUCCESS) - { - DispAllErrors(henv, hdbc, hstmt); - delete[] pColInf; - return false; - } - - wxStrncpy(pColInf[colNum].colName, name, DB_MAX_COLUMN_NAME_LEN); - pColInf[colNum].colName[DB_MAX_COLUMN_NAME_LEN] = 0; // Prevent buffer overrun - - if (SQLColAttributes(hstmt, (UWORD)(colNum+1), SQL_COLUMN_TYPE, - NULL, 0, &Sword, &Sqllen) != SQL_SUCCESS) - { - DispAllErrors(henv, hdbc, hstmt); - delete[] pColInf; - return false; - } - - switch (Sqllen) - { -#if wxUSE_UNICODE - #if defined(SQL_WCHAR) - case SQL_WCHAR: - #endif - #if defined(SQL_WVARCHAR) - case SQL_WVARCHAR: - #endif -#endif - case SQL_VARCHAR: - case SQL_CHAR: - pColInf[colNum].dbDataType = DB_DATA_TYPE_VARCHAR; - break; - case SQL_LONGVARCHAR: - pColInf[colNum].dbDataType = DB_DATA_TYPE_MEMO; - break; - case SQL_TINYINT: - case SQL_SMALLINT: - case SQL_INTEGER: - case SQL_BIT: - pColInf[colNum].dbDataType = DB_DATA_TYPE_INTEGER; - break; - case SQL_DOUBLE: - case SQL_DECIMAL: - case SQL_NUMERIC: - case SQL_FLOAT: - case SQL_REAL: - pColInf[colNum].dbDataType = DB_DATA_TYPE_FLOAT; - break; - case SQL_DATE: - case SQL_TIMESTAMP: - pColInf[colNum].dbDataType = DB_DATA_TYPE_DATE; - break; - case SQL_BINARY: - pColInf[colNum].dbDataType = DB_DATA_TYPE_BLOB; - break; -#ifdef __WXDEBUG__ - default: - wxString errMsg; - errMsg.Printf(wxT("SQL Data type %ld currently not supported by wxWidgets"), (long)Sqllen); - wxLogDebug(errMsg,wxT("ODBC DEBUG MESSAGE")); -#endif - } - } - - *columns = pColInf; - return true; -} // wxDb::ExecSql() - -/********** wxDb::GetNext() **********/ -bool wxDb::GetNext(void) -{ - if (SQLFetch(hstmt) == SQL_SUCCESS) - return true; - else - { - DispAllErrors(henv, hdbc, hstmt); - return false; - } - -} // wxDb::GetNext() - - -/********** wxDb::GetData() **********/ -bool wxDb::GetData(UWORD colNo, SWORD cType, PTR pData, SDWORD maxLen, SQLLEN FAR *cbReturned) -{ - wxASSERT(pData); - wxASSERT(cbReturned); - - long bufferSize = maxLen; - - if (cType == SQL_C_WXCHAR) - bufferSize = maxLen * sizeof(wxChar); - - if (SQLGetData(hstmt, colNo, cType, pData, bufferSize, cbReturned) == SQL_SUCCESS) - return true; - else - { - DispAllErrors(henv, hdbc, hstmt); - return false; - } - -} // wxDb::GetData() - - -/********** wxDb::GetKeyFields() **********/ -int wxDb::GetKeyFields(const wxString &tableName, wxDbColInf* colInf, UWORD noCols) -{ - wxChar szPkTable[DB_MAX_TABLE_NAME_LEN+1]; /* Primary key table name */ - wxChar szFkTable[DB_MAX_TABLE_NAME_LEN+1]; /* Foreign key table name */ - SWORD iKeySeq; - wxChar szPkCol[DB_MAX_COLUMN_NAME_LEN+1]; /* Primary key column */ - wxChar szFkCol[DB_MAX_COLUMN_NAME_LEN+1]; /* Foreign key column */ - SQLRETURN retcode; - SQLLEN cb; - SWORD i; - wxString tempStr; - /* - * ----------------------------------------------------------------------- - * -- 19991224 : mj10777 : Create ------ - * -- : Three things are done and stored here : ------ - * -- : 1) which Column(s) is/are Primary Key(s) ------ - * -- : 2) which tables use this Key as a Foreign Key ------ - * -- : 3) which columns are Foreign Key and the name ------ - * -- : of the Table where the Key is the Primary Key ----- - * -- : Called from GetColumns(const wxString &tableName, ------ - * -- int *numCols,const wxChar *userID ) ------ - * ----------------------------------------------------------------------- - */ - - /*---------------------------------------------------------------------*/ - /* Get the names of the columns in the primary key. */ - /*---------------------------------------------------------------------*/ - retcode = SQLPrimaryKeys(hstmt, - NULL, 0, /* Catalog name */ - NULL, 0, /* Schema name */ - (SQLTCHAR FAR *) tableName.c_str(), SQL_NTS); /* Table name */ - - /*---------------------------------------------------------------------*/ - /* Fetch and display the result set. This will be a list of the */ - /* columns in the primary key of the tableName table. */ - /*---------------------------------------------------------------------*/ - while ((retcode == SQL_SUCCESS) || (retcode == SQL_SUCCESS_WITH_INFO)) - { - retcode = SQLFetch(hstmt); - if (retcode == SQL_SUCCESS || retcode == SQL_SUCCESS_WITH_INFO) - { - GetData( 4, SQL_C_WXCHAR, szPkCol, DB_MAX_COLUMN_NAME_LEN+1, &cb); - GetData( 5, SQL_C_SSHORT, &iKeySeq, 0, &cb); - //------- - for (i=0;iGetColumns(tableList, userID); - * if (colInf) - * { - * // Use the column inf - * ....... - * // Destroy the memory - * delete [] colInf; - * } - * - * userID is evaluated in the following manner: - * userID == NULL ... UserID is ignored - * userID == "" ... UserID set equal to 'this->uid' - * userID != "" ... UserID set equal to 'userID' - * - * NOTE: ALL column bindings associated with this wxDb instance are unbound - * by this function. This function should use its own wxDb instance - * to avoid undesired unbinding of columns. - */ -{ - UWORD noCols = 0; - UWORD colNo = 0; - wxDbColInf *colInf = 0; - - RETCODE retcode; - SQLLEN cb; - - wxString TableName; - - wxString UserID; - convertUserID(userID,UserID); - - // Pass 1 - Determine how many columns there are. - // Pass 2 - Allocate the wxDbColInf array and fill in - // the array with the column information. - int pass; - for (pass = 1; pass <= 2; pass++) - { - if (pass == 2) - { - if (noCols == 0) // Probably a bogus table name(s) - break; - // Allocate n wxDbColInf objects to hold the column information - colInf = new wxDbColInf[noCols+1]; - if (!colInf) - break; - // Mark the end of the array - wxStrcpy(colInf[noCols].tableName, wxEmptyString); - wxStrcpy(colInf[noCols].colName, wxEmptyString); - colInf[noCols].sqlDataType = 0; - } - // Loop through each table name - int tbl; - for (tbl = 0; tableName[tbl]; tbl++) - { - TableName = tableName[tbl]; - // Oracle and Interbase table names are uppercase only, so force - // the name to uppercase just in case programmer forgot to do this - if ((Dbms() == dbmsORACLE) || - (Dbms() == dbmsFIREBIRD) || - (Dbms() == dbmsINTERBASE)) - TableName = TableName.Upper(); - - SQLFreeStmt(hstmt, SQL_CLOSE); - - // MySQL, SQLServer, and Access cannot accept a user name when looking up column names, so we - // use the call below that leaves out the user name - if (!UserID.empty() && - Dbms() != dbmsMY_SQL && - Dbms() != dbmsACCESS && - Dbms() != dbmsMS_SQL_SERVER) - { - retcode = SQLColumns(hstmt, - NULL, 0, // All qualifiers - (SQLTCHAR *) UserID.c_str(), SQL_NTS, // Owner - (SQLTCHAR *) TableName.c_str(), SQL_NTS, - NULL, 0); // All columns - } - else - { - retcode = SQLColumns(hstmt, - NULL, 0, // All qualifiers - NULL, 0, // Owner - (SQLTCHAR *) TableName.c_str(), SQL_NTS, - NULL, 0); // All columns - } - if (retcode != SQL_SUCCESS) - { // Error occurred, abort - DispAllErrors(henv, hdbc, hstmt); - if (colInf) - delete [] colInf; - SQLFreeStmt(hstmt, SQL_CLOSE); - return(0); - } - - while ((retcode = SQLFetch(hstmt)) == SQL_SUCCESS) - { - if (pass == 1) // First pass, just add up the number of columns - noCols++; - else // Pass 2; Fill in the array of structures - { - if (colNo < noCols) // Some extra error checking to prevent memory overwrites - { - // NOTE: Only the ODBC 1.x fields are retrieved - GetData( 1, SQL_C_WXCHAR, (UCHAR*) colInf[colNo].catalog, 128+1, &cb); - GetData( 2, SQL_C_WXCHAR, (UCHAR*) colInf[colNo].schema, 128+1, &cb); - GetData( 3, SQL_C_WXCHAR, (UCHAR*) colInf[colNo].tableName, DB_MAX_TABLE_NAME_LEN+1, &cb); - GetData( 4, SQL_C_WXCHAR, (UCHAR*) colInf[colNo].colName, DB_MAX_COLUMN_NAME_LEN+1, &cb); - GetData( 5, SQL_C_SSHORT, (UCHAR*) &colInf[colNo].sqlDataType, 0, &cb); - GetData( 6, SQL_C_WXCHAR, (UCHAR*) colInf[colNo].typeName, 128+1, &cb); - GetData( 7, SQL_C_SLONG, (UCHAR*) &colInf[colNo].columnLength, 0, &cb); - GetData( 8, SQL_C_SSHORT, (UCHAR*) &colInf[colNo].bufferSize, 0, &cb); - GetData( 9, SQL_C_SSHORT, (UCHAR*) &colInf[colNo].decimalDigits,0, &cb); - GetData(10, SQL_C_SSHORT, (UCHAR*) &colInf[colNo].numPrecRadix, 0, &cb); - GetData(11, SQL_C_SSHORT, (UCHAR*) &colInf[colNo].nullable, 0, &cb); - GetData(12, SQL_C_WXCHAR, (UCHAR*) colInf[colNo].remarks, 254+1, &cb); - - // Determine the wxDb data type that is used to represent the native data type of this data source - colInf[colNo].dbDataType = 0; - if (!wxStricmp(typeInfVarchar.TypeName,colInf[colNo].typeName)) - { -#ifdef _IODBC_ - // IODBC does not return a correct columnLength, so we set - // columnLength = bufferSize if no column length was returned - // IODBC returns the columnLength in bufferSize. (bug) - if (colInf[colNo].columnLength < 1) - { - colInf[colNo].columnLength = colInf[colNo].bufferSize; - } -#endif - colInf[colNo].dbDataType = DB_DATA_TYPE_VARCHAR; - } - else if (!wxStricmp(typeInfInteger.TypeName, colInf[colNo].typeName)) - colInf[colNo].dbDataType = DB_DATA_TYPE_INTEGER; - else if (!wxStricmp(typeInfFloat.TypeName, colInf[colNo].typeName)) - colInf[colNo].dbDataType = DB_DATA_TYPE_FLOAT; - else if (!wxStricmp(typeInfDate.TypeName, colInf[colNo].typeName)) - colInf[colNo].dbDataType = DB_DATA_TYPE_DATE; - else if (!wxStricmp(typeInfBlob.TypeName, colInf[colNo].typeName)) - colInf[colNo].dbDataType = DB_DATA_TYPE_BLOB; - colNo++; - } - } - } - if (retcode != SQL_NO_DATA_FOUND) - { // Error occurred, abort - DispAllErrors(henv, hdbc, hstmt); - if (colInf) - delete [] colInf; - SQLFreeStmt(hstmt, SQL_CLOSE); - return(0); - } - } - } - - SQLFreeStmt(hstmt, SQL_CLOSE); - return colInf; - -} // wxDb::GetColumns() - - -/********** wxDb::GetColumns() **********/ - -wxDbColInf *wxDb::GetColumns(const wxString &tableName, UWORD *numCols, const wxChar *userID) -// -// Same as the above GetColumns() function except this one gets columns -// only for a single table, and if 'numCols' is not NULL, the number of -// columns stored in the returned wxDbColInf is set in '*numCols' -// -// userID is evaluated in the following manner: -// userID == NULL ... UserID is ignored -// userID == "" ... UserID set equal to 'this->uid' -// userID != "" ... UserID set equal to 'userID' -// -// NOTE: ALL column bindings associated with this wxDb instance are unbound -// by this function. This function should use its own wxDb instance -// to avoid undesired unbinding of columns. - -{ - UWORD noCols = 0; - UWORD colNo = 0; - wxDbColInf *colInf = 0; - - RETCODE retcode; - SQLLEN cb; - - wxString TableName; - - wxString UserID; - convertUserID(userID,UserID); - - // Pass 1 - Determine how many columns there are. - // Pass 2 - Allocate the wxDbColInf array and fill in - // the array with the column information. - int pass; - for (pass = 1; pass <= 2; pass++) - { - if (pass == 2) - { - if (noCols == 0) // Probably a bogus table name(s) - break; - // Allocate n wxDbColInf objects to hold the column information - colInf = new wxDbColInf[noCols+1]; - if (!colInf) - break; - // Mark the end of the array - wxStrcpy(colInf[noCols].tableName, wxEmptyString); - wxStrcpy(colInf[noCols].colName, wxEmptyString); - colInf[noCols].sqlDataType = 0; - } - - TableName = tableName; - // Oracle and Interbase table names are uppercase only, so force - // the name to uppercase just in case programmer forgot to do this - if ((Dbms() == dbmsORACLE) || - (Dbms() == dbmsFIREBIRD) || - (Dbms() == dbmsINTERBASE)) - TableName = TableName.Upper(); - - SQLFreeStmt(hstmt, SQL_CLOSE); - - // MySQL, SQLServer, and Access cannot accept a user name when looking up column names, so we - // use the call below that leaves out the user name - if (!UserID.empty() && - Dbms() != dbmsMY_SQL && - Dbms() != dbmsACCESS && - Dbms() != dbmsMS_SQL_SERVER) - { - retcode = SQLColumns(hstmt, - NULL, 0, // All qualifiers - (SQLTCHAR *) UserID.c_str(), SQL_NTS, // Owner - (SQLTCHAR *) TableName.c_str(), SQL_NTS, - NULL, 0); // All columns - } - else - { - retcode = SQLColumns(hstmt, - NULL, 0, // All qualifiers - NULL, 0, // Owner - (SQLTCHAR *) TableName.c_str(), SQL_NTS, - NULL, 0); // All columns - } - if (retcode != SQL_SUCCESS) - { // Error occurred, abort - DispAllErrors(henv, hdbc, hstmt); - if (colInf) - delete [] colInf; - SQLFreeStmt(hstmt, SQL_CLOSE); - if (numCols) - *numCols = 0; - return(0); - } - - while ((retcode = SQLFetch(hstmt)) == SQL_SUCCESS) - { - if (pass == 1) // First pass, just add up the number of columns - noCols++; - else // Pass 2; Fill in the array of structures - { - if (colNo < noCols) // Some extra error checking to prevent memory overwrites - { - // NOTE: Only the ODBC 1.x fields are retrieved - GetData( 1, SQL_C_WXCHAR, (UCHAR*) colInf[colNo].catalog, 128+1, &cb); - GetData( 2, SQL_C_WXCHAR, (UCHAR*) colInf[colNo].schema, 128+1, &cb); - GetData( 3, SQL_C_WXCHAR, (UCHAR*) colInf[colNo].tableName, DB_MAX_TABLE_NAME_LEN+1, &cb); - GetData( 4, SQL_C_WXCHAR, (UCHAR*) colInf[colNo].colName, DB_MAX_COLUMN_NAME_LEN+1, &cb); - GetData( 5, SQL_C_SSHORT, (UCHAR*) &colInf[colNo].sqlDataType, 0, &cb); - GetData( 6, SQL_C_WXCHAR, (UCHAR*) colInf[colNo].typeName, 128+1, &cb); - GetData( 7, SQL_C_SLONG, (UCHAR*) &colInf[colNo].columnLength, 0, &cb); - // BJO 991214 : SQL_C_SSHORT instead of SQL_C_SLONG, otherwise fails on Sparc (probably all 64 bit architectures) - GetData( 8, SQL_C_SSHORT, (UCHAR*) &colInf[colNo].bufferSize, 0, &cb); - GetData( 9, SQL_C_SSHORT, (UCHAR*) &colInf[colNo].decimalDigits,0, &cb); - GetData(10, SQL_C_SSHORT, (UCHAR*) &colInf[colNo].numPrecRadix, 0, &cb); - GetData(11, SQL_C_SSHORT, (UCHAR*) &colInf[colNo].nullable, 0, &cb); - GetData(12, SQL_C_WXCHAR, (UCHAR*) colInf[colNo].remarks, 254+1, &cb); - // Start Values for Primary/Foriegn Key (=No) - colInf[colNo].PkCol = 0; // Primary key column 0=No; 1= First Key, 2 = Second Key etc. - colInf[colNo].PkTableName[0] = 0; // Tablenames where Primary Key is used as a Foreign Key - colInf[colNo].FkCol = 0; // Foreign key column 0=No; 1= First Key, 2 = Second Key etc. - colInf[colNo].FkTableName[0] = 0; // Foreign key table name - - // BJO 20000428 : Virtuoso returns type names with upper cases! - if (Dbms() == dbmsVIRTUOSO) - { - wxString s = colInf[colNo].typeName; - s = s.MakeLower(); - wxStrcmp(colInf[colNo].typeName, s.c_str()); - } - - // Determine the wxDb data type that is used to represent the native data type of this data source - colInf[colNo].dbDataType = 0; - if (!wxStricmp(typeInfVarchar.TypeName, colInf[colNo].typeName)) - { -#ifdef _IODBC_ - // IODBC does not return a correct columnLength, so we set - // columnLength = bufferSize if no column length was returned - // IODBC returns the columnLength in bufferSize. (bug) - if (colInf[colNo].columnLength < 1) - { - colInf[colNo].columnLength = colInf[colNo].bufferSize; - } -#endif - - colInf[colNo].dbDataType = DB_DATA_TYPE_VARCHAR; - } - else if (!wxStricmp(typeInfInteger.TypeName, colInf[colNo].typeName)) - colInf[colNo].dbDataType = DB_DATA_TYPE_INTEGER; - else if (!wxStricmp(typeInfFloat.TypeName, colInf[colNo].typeName)) - colInf[colNo].dbDataType = DB_DATA_TYPE_FLOAT; - else if (!wxStricmp(typeInfDate.TypeName, colInf[colNo].typeName)) - colInf[colNo].dbDataType = DB_DATA_TYPE_DATE; - else if (!wxStricmp(typeInfBlob.TypeName, colInf[colNo].typeName)) - colInf[colNo].dbDataType = DB_DATA_TYPE_BLOB; - - colNo++; - } - } - } - if (retcode != SQL_NO_DATA_FOUND) - { // Error occurred, abort - DispAllErrors(henv, hdbc, hstmt); - if (colInf) - delete [] colInf; - SQLFreeStmt(hstmt, SQL_CLOSE); - if (numCols) - *numCols = 0; - return(0); - } - } - - SQLFreeStmt(hstmt, SQL_CLOSE); - - // Store Primary and Foriegn Keys - GetKeyFields(tableName,colInf,noCols); - - if (numCols) - *numCols = noCols; - return colInf; - -} // wxDb::GetColumns() - - -#else // New GetColumns - - -/* - BJO 20000503 - These are tentative new GetColumns members which should be more database - independent and which always returns the columns in the order they were - created. - - - The first one (wxDbColInf *wxDb::GetColumns(wxChar *tableName[], const - wxChar* userID)) calls the second implementation for each separate table - before merging the results. This makes the code easier to maintain as - only one member (the second) makes the real work - - wxDbColInf *wxDb::GetColumns(const wxString &tableName, int *numCols, const - wxChar *userID) is a little bit improved - - It doesn't anymore rely on the type-name to find out which database-type - each column has - - It ends by sorting the columns, so that they are returned in the same - order they were created -*/ - -typedef struct -{ - UWORD noCols; - wxDbColInf *colInf; -} _TableColumns; - - -wxDbColInf *wxDb::GetColumns(wxChar *tableName[], const wxChar *userID) -{ - int i, j; - // The last array element of the tableName[] argument must be zero (null). - // This is how the end of the array is detected. - - UWORD noCols = 0; - - // How many tables ? - int tbl; - for (tbl = 0 ; tableName[tbl]; tbl++); - - // Create a table to maintain the columns for each separate table - _TableColumns *TableColumns = new _TableColumns[tbl]; - - // Fill the table - for (i = 0 ; i < tbl ; i++) - - { - TableColumns[i].colInf = GetColumns(tableName[i], &TableColumns[i].noCols, userID); - if (TableColumns[i].colInf == NULL) - return NULL; - noCols += TableColumns[i].noCols; - } - - // Now merge all the separate table infos - wxDbColInf *colInf = new wxDbColInf[noCols+1]; - - // Mark the end of the array - wxStrcpy(colInf[noCols].tableName, wxEmptyString); - wxStrcpy(colInf[noCols].colName, wxEmptyString); - colInf[noCols].sqlDataType = 0; - - // Merge ... - int offset = 0; - - for (i = 0 ; i < tbl ; i++) - { - for (j = 0 ; j < TableColumns[i].noCols ; j++) - { - colInf[offset++] = TableColumns[i].colInf[j]; - } - } - - delete [] TableColumns; - - return colInf; -} // wxDb::GetColumns() -- NEW - - -wxDbColInf *wxDb::GetColumns(const wxString &tableName, int *numCols, const wxChar *userID) -// -// Same as the above GetColumns() function except this one gets columns -// only for a single table, and if 'numCols' is not NULL, the number of -// columns stored in the returned wxDbColInf is set in '*numCols' -// -// userID is evaluated in the following manner: -// userID == NULL ... UserID is ignored -// userID == "" ... UserID set equal to 'this->uid' -// userID != "" ... UserID set equal to 'userID' -// -// NOTE: ALL column bindings associated with this wxDb instance are unbound -// by this function. This function should use its own wxDb instance -// to avoid undesired unbinding of columns. -{ - UWORD noCols = 0; - UWORD colNo = 0; - wxDbColInf *colInf = 0; - - RETCODE retcode; - SDWORD cb; - - wxString TableName; - - wxString UserID; - convertUserID(userID,UserID); - - // Pass 1 - Determine how many columns there are. - // Pass 2 - Allocate the wxDbColInf array and fill in - // the array with the column information. - int pass; - for (pass = 1; pass <= 2; pass++) - { - if (pass == 2) - { - if (noCols == 0) // Probably a bogus table name(s) - break; - // Allocate n wxDbColInf objects to hold the column information - colInf = new wxDbColInf[noCols+1]; - if (!colInf) - break; - // Mark the end of the array - wxStrcpy(colInf[noCols].tableName, wxEmptyString); - wxStrcpy(colInf[noCols].colName, wxEmptyString); - colInf[noCols].sqlDataType = 0; - } - - TableName = tableName; - // Oracle and Interbase table names are uppercase only, so force - // the name to uppercase just in case programmer forgot to do this - if ((Dbms() == dbmsORACLE) || - (Dbms() == dbmsFIREBIRD) || - (Dbms() == dbmsINTERBASE)) - TableName = TableName.Upper(); - - SQLFreeStmt(hstmt, SQL_CLOSE); - - // MySQL, SQLServer, and Access cannot accept a user name when looking up column names, so we - // use the call below that leaves out the user name - if (!UserID.empty() && - Dbms() != dbmsMY_SQL && - Dbms() != dbmsACCESS && - Dbms() != dbmsMS_SQL_SERVER) - { - retcode = SQLColumns(hstmt, - NULL, 0, // All qualifiers - (UCHAR *) UserID.c_str(), SQL_NTS, // Owner - (UCHAR *) TableName.c_str(), SQL_NTS, - NULL, 0); // All columns - } - else - { - retcode = SQLColumns(hstmt, - NULL, 0, // All qualifiers - NULL, 0, // Owner - (UCHAR *) TableName.c_str(), SQL_NTS, - NULL, 0); // All columns - } - if (retcode != SQL_SUCCESS) - { // Error occurred, abort - DispAllErrors(henv, hdbc, hstmt); - if (colInf) - delete [] colInf; - SQLFreeStmt(hstmt, SQL_CLOSE); - if (numCols) - *numCols = 0; - return(0); - } - - while ((retcode = SQLFetch(hstmt)) == SQL_SUCCESS) - { - if (pass == 1) // First pass, just add up the number of columns - noCols++; - else // Pass 2; Fill in the array of structures - { - if (colNo < noCols) // Some extra error checking to prevent memory overwrites - { - // NOTE: Only the ODBC 1.x fields are retrieved - GetData( 1, SQL_C_WXCHAR, (UCHAR*) colInf[colNo].catalog, 128+1, &cb); - GetData( 2, SQL_C_WXCHAR, (UCHAR*) colInf[colNo].schema, 128+1, &cb); - GetData( 3, SQL_C_WXCHAR, (UCHAR*) colInf[colNo].tableName, DB_MAX_TABLE_NAME_LEN+1, &cb); - GetData( 4, SQL_C_WXCHAR, (UCHAR*) colInf[colNo].colName, DB_MAX_COLUMN_NAME_LEN+1, &cb); - GetData( 5, SQL_C_SSHORT, (UCHAR*) &colInf[colNo].sqlDataType, 0, &cb); - GetData( 6, SQL_C_WXCHAR, (UCHAR*) colInf[colNo].typeName, 128+1, &cb); - GetData( 7, SQL_C_SLONG, (UCHAR*) &colInf[colNo].columnLength, 0, &cb); - GetData( 8, SQL_C_SSHORT, (UCHAR*) &colInf[colNo].bufferSize, 0, &cb); - GetData( 9, SQL_C_SSHORT, (UCHAR*) &colInf[colNo].decimalDigits,0, &cb); - GetData(10, SQL_C_SSHORT, (UCHAR*) &colInf[colNo].numPrecRadix, 0, &cb); - GetData(11, SQL_C_SSHORT, (UCHAR*) &colInf[colNo].nullable, 0, &cb); - GetData(12, SQL_C_WXCHAR, (UCHAR*) colInf[colNo].remarks, 254+1, &cb); - // Start Values for Primary/Foriegn Key (=No) - colInf[colNo].PkCol = 0; // Primary key column 0=No; 1= First Key, 2 = Second Key etc. - colInf[colNo].PkTableName[0] = 0; // Tablenames where Primary Key is used as a Foreign Key - colInf[colNo].FkCol = 0; // Foreign key column 0=No; 1= First Key, 2 = Second Key etc. - colInf[colNo].FkTableName[0] = 0; // Foreign key table name - -#ifdef _IODBC_ - // IODBC does not return a correct columnLength, so we set - // columnLength = bufferSize if no column length was returned - // IODBC returns the columnLength in bufferSize. (bug) - if (colInf[colNo].columnLength < 1) - { - colInf[colNo].columnLength = colInf[colNo].bufferSize; - } -#endif - - // Determine the wxDb data type that is used to represent the native data type of this data source - colInf[colNo].dbDataType = 0; - // Get the intern datatype - switch (colInf[colNo].sqlDataType) - { -#if wxUSE_UNICODE - #if defined(SQL_WCHAR) - case SQL_WCHAR: - #endif - #if defined(SQL_WVARCHAR) - case SQL_WVARCHAR: - #endif -#endif - case SQL_VARCHAR: - case SQL_CHAR: - colInf[colNo].dbDataType = DB_DATA_TYPE_VARCHAR; - break; - case SQL_LONGVARCHAR: - colInf[colNo].dbDataType = DB_DATA_TYPE_MEMO; - break; - case SQL_TINYINT: - case SQL_SMALLINT: - case SQL_INTEGER: - case SQL_BIT: - colInf[colNo].dbDataType = DB_DATA_TYPE_INTEGER; - break; - case SQL_DOUBLE: - case SQL_DECIMAL: - case SQL_NUMERIC: - case SQL_FLOAT: - case SQL_REAL: - colInf[colNo].dbDataType = DB_DATA_TYPE_FLOAT; - break; - case SQL_DATE: - case SQL_TIMESTAMP: - colInf[colNo].dbDataType = DB_DATA_TYPE_DATE; - break; - case SQL_BINARY: - colInf[colNo].dbDataType = DB_DATA_TYPE_BLOB; - break; -#ifdef __WXDEBUG__ - default: - wxString errMsg; - errMsg.Printf(wxT("SQL Data type %d currently not supported by wxWidgets"), colInf[colNo].sqlDataType); - wxLogDebug(errMsg,wxT("ODBC DEBUG MESSAGE")); -#endif - } - colNo++; - } - } - } - if (retcode != SQL_NO_DATA_FOUND) - { // Error occurred, abort - DispAllErrors(henv, hdbc, hstmt); - if (colInf) - delete [] colInf; - SQLFreeStmt(hstmt, SQL_CLOSE); - if (numCols) - *numCols = 0; - return(0); - } - } - - SQLFreeStmt(hstmt, SQL_CLOSE); - - // Store Primary and Foreign Keys - GetKeyFields(tableName,colInf,noCols); - - /////////////////////////////////////////////////////////////////////////// - // Now sort the the columns in order to make them appear in the right order - /////////////////////////////////////////////////////////////////////////// - - // Build a generic SELECT statement which returns 0 rows - wxString Stmt; - - Stmt.Printf(wxT("select * from \"%s\" where 0=1"), tableName); - - // Execute query - if (SQLExecDirect(hstmt, (UCHAR FAR *) Stmt.c_str(), SQL_NTS) != SQL_SUCCESS) - { - DispAllErrors(henv, hdbc, hstmt); - return NULL; - } - - // Get the number of result columns - if (SQLNumResultCols (hstmt, &noCols) != SQL_SUCCESS) - { - DispAllErrors(henv, hdbc, hstmt); - return NULL; - } - - if (noCols == 0) // Probably a bogus table name - return NULL; - - // Get the name - int i; - short colNum; - UCHAR name[100]; - SWORD Sword; - SDWORD Sdword; - for (colNum = 0; colNum < noCols; colNum++) - { - if (SQLColAttributes(hstmt,colNum+1, SQL_COLUMN_NAME, - name, sizeof(name), - &Sword, &Sdword) != SQL_SUCCESS) - { - DispAllErrors(henv, hdbc, hstmt); - return NULL; - } - - wxString Name1 = name; - Name1 = Name1.Upper(); - - // Where is this name in the array ? - for (i = colNum ; i < noCols ; i++) - { - wxString Name2 = colInf[i].colName; - Name2 = Name2.Upper(); - if (Name2 == Name1) - { - if (colNum != i) // swap to sort - { - wxDbColInf tmpColInf = colInf[colNum]; - colInf[colNum] = colInf[i]; - colInf[i] = tmpColInf; - } - break; - } - } - } - SQLFreeStmt(hstmt, SQL_CLOSE); - - /////////////////////////////////////////////////////////////////////////// - // End sorting - /////////////////////////////////////////////////////////////////////////// - - if (numCols) - *numCols = noCols; - return colInf; - -} // wxDb::GetColumns() - - -#endif // #else OLD_GETCOLUMNS - - -/********** wxDb::GetColumnCount() **********/ -int wxDb::GetColumnCount(const wxString &tableName, const wxChar *userID) -/* - * Returns a count of how many columns are in a table. - * If an error occurs in computing the number of columns - * this function will return a -1 for the count - * - * userID is evaluated in the following manner: - * userID == NULL ... UserID is ignored - * userID == "" ... UserID set equal to 'this->uid' - * userID != "" ... UserID set equal to 'userID' - * - * NOTE: ALL column bindings associated with this wxDb instance are unbound - * by this function. This function should use its own wxDb instance - * to avoid undesired unbinding of columns. - */ -{ - UWORD noCols = 0; - - RETCODE retcode; - - wxString TableName; - - wxString UserID; - convertUserID(userID,UserID); - - TableName = tableName; - // Oracle and Interbase table names are uppercase only, so force - // the name to uppercase just in case programmer forgot to do this - if ((Dbms() == dbmsORACLE) || - (Dbms() == dbmsFIREBIRD) || - (Dbms() == dbmsINTERBASE)) - TableName = TableName.Upper(); - - SQLFreeStmt(hstmt, SQL_CLOSE); - - // MySQL, SQLServer, and Access cannot accept a user name when looking up column names, so we - // use the call below that leaves out the user name - if (!UserID.empty() && - Dbms() != dbmsMY_SQL && - Dbms() != dbmsACCESS && - Dbms() != dbmsMS_SQL_SERVER) - { - retcode = SQLColumns(hstmt, - NULL, 0, // All qualifiers - (SQLTCHAR *) UserID.c_str(), SQL_NTS, // Owner - (SQLTCHAR *) TableName.c_str(), SQL_NTS, - NULL, 0); // All columns - } - else - { - retcode = SQLColumns(hstmt, - NULL, 0, // All qualifiers - NULL, 0, // Owner - (SQLTCHAR *) TableName.c_str(), SQL_NTS, - NULL, 0); // All columns - } - if (retcode != SQL_SUCCESS) - { // Error occurred, abort - DispAllErrors(henv, hdbc, hstmt); - SQLFreeStmt(hstmt, SQL_CLOSE); - return(-1); - } - - // Count the columns - while ((retcode = SQLFetch(hstmt)) == SQL_SUCCESS) - noCols++; - - if (retcode != SQL_NO_DATA_FOUND) - { // Error occurred, abort - DispAllErrors(henv, hdbc, hstmt); - SQLFreeStmt(hstmt, SQL_CLOSE); - return(-1); - } - - SQLFreeStmt(hstmt, SQL_CLOSE); - return noCols; - -} // wxDb::GetColumnCount() - - -/********** wxDb::GetCatalog() *******/ -wxDbInf *wxDb::GetCatalog(const wxChar *userID) -/* - * --------------------------------------------------------------------- - * -- 19991203 : mj10777 : Create ------ - * -- : Creates a wxDbInf with Tables / Cols Array ------ - * -- : uses SQLTables and fills pTableInf; ------ - * -- : pColInf is set to NULL and numCols to 0; ------ - * -- : returns pDbInf (wxDbInf) ------ - * -- - if unsuccessful (pDbInf == NULL) ------ - * -- : pColInf can be filled with GetColumns(..); ------ - * -- : numCols can be filled with GetColumnCount(..); ------ - * --------------------------------------------------------------------- - * - * userID is evaluated in the following manner: - * userID == NULL ... UserID is ignored - * userID == "" ... UserID set equal to 'this->uid' - * userID != "" ... UserID set equal to 'userID' - * - * NOTE: ALL column bindings associated with this wxDb instance are unbound - * by this function. This function should use its own wxDb instance - * to avoid undesired unbinding of columns. - */ -{ - int noTab = 0; // Counter while filling table entries - int pass; - RETCODE retcode; - SQLLEN cb; - wxString tblNameSave; - - wxString UserID; - convertUserID(userID,UserID); - - //------------------------------------------------------------- - // Create the Database Array of catalog entries - - wxDbInf *pDbInf = new wxDbInf; - - //------------------------------------------------------------- - // Table Information - // Pass 1 - Determine how many Tables there are. - // Pass 2 - Create the Table array and fill it - // - Create the Cols array = NULL - //------------------------------------------------------------- - - for (pass = 1; pass <= 2; pass++) - { - SQLFreeStmt(hstmt, SQL_CLOSE); // Close if Open - tblNameSave.Empty(); - - if (!UserID.empty() && - Dbms() != dbmsMY_SQL && - Dbms() != dbmsACCESS && - Dbms() != dbmsMS_SQL_SERVER) - { - retcode = SQLTables(hstmt, - NULL, 0, // All qualifiers - (SQLTCHAR *) UserID.c_str(), SQL_NTS, // User specified - NULL, 0, // All tables - NULL, 0); // All columns - } - else - { - retcode = SQLTables(hstmt, - NULL, 0, // All qualifiers - NULL, 0, // User specified - NULL, 0, // All tables - NULL, 0); // All columns - } - - if (retcode != SQL_SUCCESS) - { - DispAllErrors(henv, hdbc, hstmt); - pDbInf = NULL; - SQLFreeStmt(hstmt, SQL_CLOSE); - return pDbInf; - } - - while ((retcode = SQLFetch(hstmt)) == SQL_SUCCESS) // Table Information - { - if (pass == 1) // First pass, just count the Tables - { - if (pDbInf->numTables == 0) - { - GetData( 1, SQL_C_WXCHAR, (UCHAR*) pDbInf->catalog, 128+1, &cb); - GetData( 2, SQL_C_WXCHAR, (UCHAR*) pDbInf->schema, 128+1, &cb); - } - pDbInf->numTables++; // Counter for Tables - } // if (pass == 1) - if (pass == 2) // Create and fill the Table entries - { - if (pDbInf->pTableInf == NULL) // Has the Table Array been created - { // no, then create the Array - pDbInf->pTableInf = new wxDbTableInf[pDbInf->numTables]; - noTab = 0; - } // if (pDbInf->pTableInf == NULL) // Has the Table Array been created - - GetData( 3, SQL_C_WXCHAR, (UCHAR*) (pDbInf->pTableInf+noTab)->tableName, DB_MAX_TABLE_NAME_LEN+1, &cb); - GetData( 4, SQL_C_WXCHAR, (UCHAR*) (pDbInf->pTableInf+noTab)->tableType, 30+1, &cb); - GetData( 5, SQL_C_WXCHAR, (UCHAR*) (pDbInf->pTableInf+noTab)->tableRemarks, 254+1, &cb); - - noTab++; - } // if - } // while - } // for - SQLFreeStmt(hstmt, SQL_CLOSE); - - // Query how many columns are in each table - for (noTab=0;noTabnumTables;noTab++) - { - (pDbInf->pTableInf+noTab)->numCols = (UWORD)GetColumnCount((pDbInf->pTableInf+noTab)->tableName,UserID); - } - - return pDbInf; - -} // wxDb::GetCatalog() - - -/********** wxDb::Catalog() **********/ -bool wxDb::Catalog(const wxChar *userID, const wxString &fileName) -/* - * Creates the text file specified in 'filename' which will contain - * a minimal data dictionary of all tables accessible by the user specified - * in 'userID' - * - * userID is evaluated in the following manner: - * userID == NULL ... UserID is ignored - * userID == "" ... UserID set equal to 'this->uid' - * userID != "" ... UserID set equal to 'userID' - * - * NOTE: ALL column bindings associated with this wxDb instance are unbound - * by this function. This function should use its own wxDb instance - * to avoid undesired unbinding of columns. - */ -{ - wxASSERT(fileName.length()); - - RETCODE retcode; - SQLLEN cb; - wxChar tblName[DB_MAX_TABLE_NAME_LEN+1]; - wxString tblNameSave; - wxChar colName[DB_MAX_COLUMN_NAME_LEN+1]; - SWORD sqlDataType; - wxChar typeName[30+1]; - SDWORD precision, length; - - FILE *fp = wxFopen(fileName.c_str(),wxT("wt")); - if (fp == NULL) - return false; - - SQLFreeStmt(hstmt, SQL_CLOSE); - - wxString UserID; - convertUserID(userID,UserID); - - if (!UserID.empty() && - Dbms() != dbmsMY_SQL && - Dbms() != dbmsACCESS && - Dbms() != dbmsFIREBIRD && - Dbms() != dbmsINTERBASE && - Dbms() != dbmsMS_SQL_SERVER) - { - retcode = SQLColumns(hstmt, - NULL, 0, // All qualifiers - (SQLTCHAR *) UserID.c_str(), SQL_NTS, // User specified - NULL, 0, // All tables - NULL, 0); // All columns - } - else - { - retcode = SQLColumns(hstmt, - NULL, 0, // All qualifiers - NULL, 0, // User specified - NULL, 0, // All tables - NULL, 0); // All columns - } - if (retcode != SQL_SUCCESS) - { - DispAllErrors(henv, hdbc, hstmt); - fclose(fp); - return false; - } - - wxString outStr; - tblNameSave.Empty(); - int cnt = 0; - - while (true) - { - retcode = SQLFetch(hstmt); - if (retcode != SQL_SUCCESS && retcode != SQL_SUCCESS_WITH_INFO) - break; - - GetData(3,SQL_C_WXCHAR, (UCHAR *) tblName, DB_MAX_TABLE_NAME_LEN+1, &cb); - GetData(4,SQL_C_WXCHAR, (UCHAR *) colName, DB_MAX_COLUMN_NAME_LEN+1,&cb); - GetData(5,SQL_C_SSHORT, (UCHAR *)&sqlDataType, 0, &cb); - GetData(6,SQL_C_WXCHAR, (UCHAR *) typeName, sizeof(typeName), &cb); - GetData(7,SQL_C_SLONG, (UCHAR *)&precision, 0, &cb); - GetData(8,SQL_C_SLONG, (UCHAR *)&length, 0, &cb); - - if (wxStrcmp(tblName, tblNameSave.c_str())) - { - if (cnt) - wxFputs(wxT("\n"), fp); - wxFputs(wxT("================================ "), fp); - wxFputs(wxT("================================ "), fp); - wxFputs(wxT("===================== "), fp); - wxFputs(wxT("========= "), fp); - wxFputs(wxT("=========\n"), fp); - outStr.Printf(wxT("%-32s %-32s %-21s %9s %9s\n"), - wxT("TABLE NAME"), wxT("COLUMN NAME"), wxT("DATA TYPE"), wxT("PRECISION"), wxT("LENGTH")); - wxFputs(outStr.c_str(), fp); - wxFputs(wxT("================================ "), fp); - wxFputs(wxT("================================ "), fp); - wxFputs(wxT("===================== "), fp); - wxFputs(wxT("========= "), fp); - wxFputs(wxT("=========\n"), fp); - tblNameSave = tblName; - } - - outStr.Printf(wxT("%-32s %-32s (%04d)%-15s %9ld %9ld\n"), - tblName, colName, sqlDataType, typeName, precision, length); - if (wxFputs(outStr.c_str(), fp) == EOF) - { - SQLFreeStmt(hstmt, SQL_CLOSE); - fclose(fp); - return false; - } - cnt++; - } - - if (retcode != SQL_NO_DATA_FOUND) - DispAllErrors(henv, hdbc, hstmt); - - SQLFreeStmt(hstmt, SQL_CLOSE); - - fclose(fp); - return(retcode == SQL_NO_DATA_FOUND); - -} // wxDb::Catalog() - - -bool wxDb::TableExists(const wxString &tableName, const wxChar *userID, const wxString &tablePath) -/* - * Table name can refer to a table, view, alias or synonym. Returns true - * if the object exists in the database. This function does not indicate - * whether or not the user has privleges to query or perform other functions - * on the table. - * - * userID is evaluated in the following manner: - * userID == NULL ... UserID is ignored - * userID == "" ... UserID set equal to 'this->uid' - * userID != "" ... UserID set equal to 'userID' - */ -{ - wxASSERT(tableName.length()); - - wxString TableName; - - if (Dbms() == dbmsDBASE) - { - wxString dbName; - if (tablePath.length()) - dbName.Printf(wxT("%s/%s.dbf"), tablePath.c_str(), tableName.c_str()); - else - dbName.Printf(wxT("%s.dbf"), tableName.c_str()); - - bool exists; - exists = wxFileExists(dbName); - return exists; - } - - wxString UserID; - convertUserID(userID,UserID); - - TableName = tableName; - // Oracle and Interbase table names are uppercase only, so force - // the name to uppercase just in case programmer forgot to do this - if ((Dbms() == dbmsORACLE) || - (Dbms() == dbmsFIREBIRD) || - (Dbms() == dbmsINTERBASE)) - TableName = TableName.Upper(); - - SQLFreeStmt(hstmt, SQL_CLOSE); - RETCODE retcode; - - // Some databases cannot accept a user name when looking up table names, - // so we use the call below that leaves out the user name - if (!UserID.empty() && - Dbms() != dbmsMY_SQL && - Dbms() != dbmsACCESS && - Dbms() != dbmsMS_SQL_SERVER && - Dbms() != dbmsDB2 && - Dbms() != dbmsFIREBIRD && - Dbms() != dbmsINTERBASE && - Dbms() != dbmsPERVASIVE_SQL) - { - retcode = SQLTables(hstmt, - NULL, 0, // All qualifiers - (SQLTCHAR *) UserID.c_str(), SQL_NTS, // Only tables owned by this user - (SQLTCHAR FAR *)TableName.c_str(), SQL_NTS, - NULL, 0); // All table types - } - else - { - retcode = SQLTables(hstmt, - NULL, 0, // All qualifiers - NULL, 0, // All owners - (SQLTCHAR FAR *)TableName.c_str(), SQL_NTS, - NULL, 0); // All table types - } - if (retcode != SQL_SUCCESS) - return(DispAllErrors(henv, hdbc, hstmt)); - - retcode = SQLFetch(hstmt); - if (retcode != SQL_SUCCESS && retcode != SQL_SUCCESS_WITH_INFO) - { - SQLFreeStmt(hstmt, SQL_CLOSE); - return(DispAllErrors(henv, hdbc, hstmt)); - } - - SQLFreeStmt(hstmt, SQL_CLOSE); - - return true; - -} // wxDb::TableExists() - - -/********** wxDb::TablePrivileges() **********/ -bool wxDb::TablePrivileges(const wxString &tableName, const wxString &priv, const wxChar *userID, - const wxChar *schema, const wxString &WXUNUSED(tablePath)) -{ - wxASSERT(tableName.length()); - - wxDbTablePrivilegeInfo result; - SQLLEN cbRetVal; - RETCODE retcode; - - // We probably need to be able to dynamically set this based on - // the driver type, and state. - wxChar curRole[]=wxT("public"); - - wxString TableName; - - wxString UserID,Schema; - convertUserID(userID,UserID); - convertUserID(schema,Schema); - - TableName = tableName; - // Oracle and Interbase table names are uppercase only, so force - // the name to uppercase just in case programmer forgot to do this - if ((Dbms() == dbmsORACLE) || - (Dbms() == dbmsFIREBIRD) || - (Dbms() == dbmsINTERBASE)) - TableName = TableName.Upper(); - - SQLFreeStmt(hstmt, SQL_CLOSE); - - // Some databases cannot accept a user name when looking up table names, - // so we use the call below that leaves out the user name - if (!Schema.empty() && - Dbms() != dbmsMY_SQL && - Dbms() != dbmsACCESS && - Dbms() != dbmsMS_SQL_SERVER) - { - retcode = SQLTablePrivileges(hstmt, - NULL, 0, // Catalog - (SQLTCHAR FAR *)Schema.c_str(), SQL_NTS, // Schema - (SQLTCHAR FAR *)TableName.c_str(), SQL_NTS); - } - else - { - retcode = SQLTablePrivileges(hstmt, - NULL, 0, // Catalog - NULL, 0, // Schema - (SQLTCHAR FAR *)TableName.c_str(), SQL_NTS); - } - -#ifdef DBDEBUG_CONSOLE - wxFprintf(stderr ,wxT("SQLTablePrivileges() returned %i \n"),retcode); -#endif - - if ((retcode != SQL_SUCCESS) && (retcode != SQL_SUCCESS_WITH_INFO)) - return (DispAllErrors(henv, hdbc, hstmt)); - - bool failed = false; - retcode = SQLFetch(hstmt); - while (retcode == SQL_SUCCESS || retcode == SQL_SUCCESS_WITH_INFO) - { - if (SQLGetData(hstmt, 1, SQL_C_WXCHAR, (UCHAR*) result.tableQual, sizeof(result.tableQual), &cbRetVal) != SQL_SUCCESS) - failed = true; - - if (!failed && SQLGetData(hstmt, 2, SQL_C_WXCHAR, (UCHAR*) result.tableOwner, sizeof(result.tableOwner), &cbRetVal) != SQL_SUCCESS) - failed = true; - - if (!failed && SQLGetData(hstmt, 3, SQL_C_WXCHAR, (UCHAR*) result.tableName, sizeof(result.tableName), &cbRetVal) != SQL_SUCCESS) - failed = true; - - if (!failed && SQLGetData(hstmt, 4, SQL_C_WXCHAR, (UCHAR*) result.grantor, sizeof(result.grantor), &cbRetVal) != SQL_SUCCESS) - failed = true; - - if (!failed && SQLGetData(hstmt, 5, SQL_C_WXCHAR, (UCHAR*) result.grantee, sizeof(result.grantee), &cbRetVal) != SQL_SUCCESS) - failed = true; - - if (!failed && SQLGetData(hstmt, 6, SQL_C_WXCHAR, (UCHAR*) result.privilege, sizeof(result.privilege), &cbRetVal) != SQL_SUCCESS) - failed = true; - - if (!failed && SQLGetData(hstmt, 7, SQL_C_WXCHAR, (UCHAR*) result.grantable, sizeof(result.grantable), &cbRetVal) != SQL_SUCCESS) - failed = true; - - if (failed) - { - return(DispAllErrors(henv, hdbc, hstmt)); - } -#ifdef DBDEBUG_CONSOLE - wxFprintf(stderr,wxT("Scanning %s privilege on table %s.%s granted by %s to %s\n"), - result.privilege,result.tableOwner,result.tableName, - result.grantor, result.grantee); -#endif - - if (UserID.IsSameAs(result.tableOwner,false)) - { - SQLFreeStmt(hstmt, SQL_CLOSE); - return true; - } - - if (UserID.IsSameAs(result.grantee,false) && - !wxStrcmp(result.privilege,priv)) - { - SQLFreeStmt(hstmt, SQL_CLOSE); - return true; - } - - if (!wxStrcmp(result.grantee,curRole) && - !wxStrcmp(result.privilege,priv)) - { - SQLFreeStmt(hstmt, SQL_CLOSE); - return true; - } - - retcode = SQLFetch(hstmt); - } - - SQLFreeStmt(hstmt, SQL_CLOSE); - return false; - -} // wxDb::TablePrivileges - - -const wxString wxDb::SQLTableName(const wxChar *tableName) -{ - wxString TableName; - - if (Dbms() == dbmsACCESS) - TableName = _T("\""); - TableName += tableName; - if (Dbms() == dbmsACCESS) - TableName += _T("\""); - - return TableName; -} // wxDb::SQLTableName() - - -const wxString wxDb::SQLColumnName(const wxChar *colName) -{ - wxString ColName; - - if (Dbms() == dbmsACCESS) - ColName = _T("\""); - ColName += colName; - if (Dbms() == dbmsACCESS) - ColName += _T("\""); - - return ColName; -} // wxDb::SQLColumnName() - - -/********** wxDb::SetSqlLogging() **********/ -bool wxDb::SetSqlLogging(wxDbSqlLogState state, const wxString &filename, bool append) -{ - wxASSERT(state == sqlLogON || state == sqlLogOFF); - wxASSERT(state == sqlLogOFF || filename.length()); - - if (state == sqlLogON) - { - if (fpSqlLog == 0) - { - fpSqlLog = wxFopen(filename.c_str(), (append ? wxT("at") : wxT("wt"))); - if (fpSqlLog == NULL) - return false; - } - } - else // sqlLogOFF - { - if (fpSqlLog) - { - if (fclose(fpSqlLog)) - return false; - fpSqlLog = 0; - } - } - - sqlLogState = state; - return true; - -} // wxDb::SetSqlLogging() - - -/********** wxDb::WriteSqlLog() **********/ -bool wxDb::WriteSqlLog(const wxString &logMsg) -{ - wxASSERT(logMsg.length()); - - if (fpSqlLog == 0 || sqlLogState == sqlLogOFF) - return false; - - if (wxFputs(wxT("\n"), fpSqlLog) == EOF) - return false; - if (wxFputs(logMsg, fpSqlLog) == EOF) - return false; - if (wxFputs(wxT("\n"), fpSqlLog) == EOF) - return false; - - return true; - -} // wxDb::WriteSqlLog() - - -/********** wxDb::Dbms() **********/ -wxDBMS wxDb::Dbms(void) -/* - * Be aware that not all database engines use the exact same syntax, and not - * every ODBC compliant database is compliant to the same level of compliancy. - * Some manufacturers support the minimum Level 1 compliancy, and others up - * through Level 3. Others support subsets of features for levels above 1. - * - * If you find an inconsistency between the wxDb class and a specific database - * engine, and an identifier to this section, and special handle the database in - * the area where behavior is non-conforming with the other databases. - * - * - * NOTES ABOUT ISSUES SPECIFIC TO EACH DATABASE ENGINE - * --------------------------------------------------- - * - * ORACLE - * - Currently the only database supported by the class to support VIEWS - * - * DBASE - * - Does not support the SQL_TIMESTAMP structure - * - Supports only one cursor and one connect (apparently? with Microsoft driver only?) - * - Does not automatically create the primary index if the 'keyField' param of SetColDef - * is true. The user must create ALL indexes from their program. - * - Table names can only be 8 characters long - * - Column names can only be 10 characters long - * - * SYBASE (all) - * - To lock a record during QUERY functions, the reserved word 'HOLDLOCK' must be added - * after every table name involved in the query/join if that tables matching record(s) - * are to be locked - * - Ignores the keywords 'FOR UPDATE'. Use the HOLDLOCK functionality described above - * - * SYBASE (Enterprise) - * - If a column is part of the Primary Key, the column cannot be NULL - * - Maximum row size is somewhere in the neighborhood of 1920 bytes - * - * MY_SQL - * - If a column is part of the Primary Key, the column cannot be NULL - * - Cannot support selecting for update [::CanSelectForUpdate()]. Always returns FALSE - * - Columns that are part of primary or secondary keys must be defined as being NOT NULL - * when they are created. Some code is added in ::CreateIndex to try to adjust the - * column definition if it is not defined correctly, but it is experimental - * - Does not support sub-queries in SQL statements - * - * POSTGRES - * - Does not support the keywords 'ASC' or 'DESC' as of release v6.5.0 - * - Does not support sub-queries in SQL statements - * - * DB2 - * - Primary keys must be declared as NOT NULL - * - Table and index names must not be longer than 13 characters in length (technically - * table names can be up to 18 characters, but the primary index is created using the - * base table name plus "_PIDX", so the limit if the table has a primary index is 13. - * - * PERVASIVE SQL - * - * INTERBASE - * - Columns that are part of primary keys must be defined as being NOT NULL - * when they are created. Some code is added in ::CreateIndex to try to adjust the - * column definition if it is not defined correctly, but it is experimental - */ -{ - // Should only need to do this once for each new database connection - // so return the value we already determined it to be to save time - // and lots of string comparisons - if (dbmsType != dbmsUNIDENTIFIED) - return(dbmsType); - -#ifdef DBDEBUG_CONSOLE - // When run in console mode, use standard out to display errors. - cout << "Database connecting to: " << dbInf.dbmsName << endl; -#endif // DBDEBUG_CONSOLE - - wxLogDebug(wxT("Database connecting to: ")); - wxLogDebug(dbInf.dbmsName); - - wxChar baseName[25+1]; - wxStrncpy(baseName, dbInf.dbmsName, 25); - baseName[25] = 0; - - // RGG 20001025 : add support for Interbase - // GT : Integrated to base classes on 20001121 - if (!wxStricmp(dbInf.dbmsName,wxT("Interbase"))) - return((wxDBMS)(dbmsType = dbmsINTERBASE)); - - // BJO 20000428 : add support for Virtuoso - if (!wxStricmp(dbInf.dbmsName,wxT("OpenLink Virtuoso VDBMS"))) - return((wxDBMS)(dbmsType = dbmsVIRTUOSO)); - - if (!wxStricmp(dbInf.dbmsName,wxT("Adaptive Server Anywhere"))) - return((wxDBMS)(dbmsType = dbmsSYBASE_ASA)); - - // BJO 20000427 : The "SQL Server" string is also returned by SQLServer when - // connected through an OpenLink driver. - // Is it also returned by Sybase Adapatitve server? - // OpenLink driver name is OLOD3032.DLL for msw and oplodbc.so for unix - if (!wxStricmp(dbInf.dbmsName,wxT("SQL Server"))) - { - if (!wxStrncmp(dbInf.driverName, wxT("oplodbc"), 7) || - !wxStrncmp(dbInf.driverName, wxT("OLOD"), 4)) - return ((wxDBMS)(dbmsMS_SQL_SERVER)); - else - return ((wxDBMS)(dbmsType = dbmsSYBASE_ASE)); - } - - if (!wxStricmp(dbInf.dbmsName,wxT("Microsoft SQL Server"))) - return((wxDBMS)(dbmsType = dbmsMS_SQL_SERVER)); - - baseName[10] = 0; - if (!wxStricmp(baseName,wxT("PostgreSQL"))) // v6.5.0 - return((wxDBMS)(dbmsType = dbmsPOSTGRES)); - - baseName[9] = 0; - if (!wxStricmp(baseName,wxT("Pervasive"))) - return((wxDBMS)(dbmsType = dbmsPERVASIVE_SQL)); - - baseName[8] = 0; - if (!wxStricmp(baseName,wxT("Informix"))) - return((wxDBMS)(dbmsType = dbmsINFORMIX)); - - if (!wxStricmp(baseName,wxT("Firebird"))) - return((wxDBMS)(dbmsType = dbmsFIREBIRD)); - - baseName[6] = 0; - if (!wxStricmp(baseName,wxT("Oracle"))) - return((wxDBMS)(dbmsType = dbmsORACLE)); - if (!wxStricmp(baseName,wxT("ACCESS"))) - return((wxDBMS)(dbmsType = dbmsACCESS)); - if (!wxStricmp(baseName,wxT("Sybase"))) - return((wxDBMS)(dbmsType = dbmsSYBASE_ASE)); - - baseName[5] = 0; - if (!wxStricmp(baseName,wxT("DBASE"))) - return((wxDBMS)(dbmsType = dbmsDBASE)); - if (!wxStricmp(baseName,wxT("xBase"))) - return((wxDBMS)(dbmsType = dbmsXBASE_SEQUITER)); - if (!wxStricmp(baseName,wxT("MySQL"))) - return((wxDBMS)(dbmsType = dbmsMY_SQL)); - if (!wxStricmp(baseName,wxT("MaxDB"))) - return((wxDBMS)(dbmsType = dbmsMAXDB)); - - baseName[3] = 0; - if (!wxStricmp(baseName,wxT("DB2"))) - return((wxDBMS)(dbmsType = dbmsDB2)); - - return((wxDBMS)(dbmsType = dbmsUNIDENTIFIED)); - -} // wxDb::Dbms() - - -bool wxDb::ModifyColumn(const wxString &tableName, const wxString &columnName, - int dataType, ULONG columnLength, - const wxString &optionalParam) -{ - wxASSERT(tableName.length()); - wxASSERT(columnName.length()); - wxASSERT((dataType == DB_DATA_TYPE_VARCHAR && columnLength > 0) || - dataType != DB_DATA_TYPE_VARCHAR); - - // Must specify a columnLength if modifying a VARCHAR type column - if (dataType == DB_DATA_TYPE_VARCHAR && !columnLength) - return false; - - wxString dataTypeName; - wxString sqlStmt; - wxString alterSlashModify; - - switch(dataType) - { - case DB_DATA_TYPE_VARCHAR : - dataTypeName = typeInfVarchar.TypeName; - break; - case DB_DATA_TYPE_INTEGER : - dataTypeName = typeInfInteger.TypeName; - break; - case DB_DATA_TYPE_FLOAT : - dataTypeName = typeInfFloat.TypeName; - break; - case DB_DATA_TYPE_DATE : - dataTypeName = typeInfDate.TypeName; - break; - case DB_DATA_TYPE_BLOB : - dataTypeName = typeInfBlob.TypeName; - break; - default: - return false; - } - - // Set the modify or alter syntax depending on the type of database connected to - switch (Dbms()) - { - case dbmsORACLE : - alterSlashModify = _T("MODIFY"); - break; - case dbmsMS_SQL_SERVER : - alterSlashModify = _T("ALTER COLUMN"); - break; - case dbmsUNIDENTIFIED : - return false; - case dbmsSYBASE_ASA : - case dbmsSYBASE_ASE : - case dbmsMY_SQL : - case dbmsPOSTGRES : - case dbmsACCESS : - case dbmsDBASE : - case dbmsXBASE_SEQUITER : - default : - alterSlashModify = _T("MODIFY"); - break; - } - - // create the SQL statement - if ( Dbms() == dbmsMY_SQL ) - { - sqlStmt.Printf(wxT("ALTER TABLE %s %s %s %s"), tableName.c_str(), alterSlashModify.c_str(), - columnName.c_str(), dataTypeName.c_str()); - } - else - { - sqlStmt.Printf(wxT("ALTER TABLE \"%s\" \"%s\" \"%s\" %s"), tableName.c_str(), alterSlashModify.c_str(), - columnName.c_str(), dataTypeName.c_str()); - } - - // For varchars only, append the size of the column - if (dataType == DB_DATA_TYPE_VARCHAR && - (Dbms() != dbmsMY_SQL || dataTypeName != _T("text"))) - { - wxString s; - s.Printf(wxT("(%lu)"), columnLength); - sqlStmt += s; - } - - // for passing things like "NOT NULL" - if (optionalParam.length()) - { - sqlStmt += wxT(" "); - sqlStmt += optionalParam; - } - - return ExecSql(sqlStmt); - -} // wxDb::ModifyColumn() - -/********** wxDb::EscapeSqlChars() **********/ -wxString wxDb::EscapeSqlChars(const wxString& valueOrig) -{ - wxString value(valueOrig); - switch (Dbms()) - { - case dbmsACCESS: - // Access doesn't seem to care about backslashes, so only escape single quotes. - value.Replace(wxT("'"), wxT("''")); - break; - - default: - // All the others are supposed to be the same for now, add special - // handling for them if necessary - value.Replace(wxT("\\"), wxT("\\\\")); - value.Replace(wxT("'"), wxT("\\'")); - break; - } - - return value; -} // wxDb::EscapeSqlChars() - - -/********** wxDbGetConnection() **********/ -wxDb WXDLLIMPEXP_ODBC *wxDbGetConnection(wxDbConnectInf *pDbConfig, bool FwdOnlyCursors) -{ - wxDbList *pList; - - // Used to keep a pointer to a DB connection that matches the requested - // DSN and FwdOnlyCursors settings, even if it is not FREE, so that the - // data types can be copied from it (using the wxDb::Open(wxDb *) function) - // rather than having to re-query the datasource to get all the values - // using the wxDb::Open(Dsn,Uid,AuthStr) function - wxDb *matchingDbConnection = NULL; - - // Scan the linked list searching for an available database connection - // that's already been opened but is currently not in use. - for (pList = PtrBegDbList; pList; pList = pList->PtrNext) - { - // The database connection must be for the same datasource - // name and must currently not be in use. - if (pList->Free && - (pList->PtrDb->FwdOnlyCursors() == FwdOnlyCursors)) - { - if (pDbConfig->UseConnectionStr()) - { - if (pList->PtrDb->OpenedWithConnectionString() && - (!wxStrcmp(pDbConfig->GetConnectionStr(), pList->ConnectionStr))) - { - // Found a free connection - pList->Free = false; - return(pList->PtrDb); - } - } - else - { - if (!pList->PtrDb->OpenedWithConnectionString() && - (!wxStrcmp(pDbConfig->GetDsn(), pList->Dsn))) - { - // Found a free connection - pList->Free = false; - return(pList->PtrDb); - } - } - } - - if (pDbConfig->UseConnectionStr()) - { - if (!wxStrcmp(pDbConfig->GetConnectionStr(), pList->ConnectionStr)) - matchingDbConnection = pList->PtrDb; - } - else - { - if (!wxStrcmp(pDbConfig->GetDsn(), pList->Dsn) && - !wxStrcmp(pDbConfig->GetUserID(), pList->Uid) && - !wxStrcmp(pDbConfig->GetPassword(), pList->AuthStr)) - matchingDbConnection = pList->PtrDb; - } - } - - // No available connections. A new connection must be made and - // appended to the end of the linked list. - if (PtrBegDbList) - { - // Find the end of the list - for (pList = PtrBegDbList; pList->PtrNext; pList = pList->PtrNext); - // Append a new list item - pList->PtrNext = new wxDbList; - pList->PtrNext->PtrPrev = pList; - pList = pList->PtrNext; - } - else // Empty list - { - // Create the first node on the list - pList = PtrBegDbList = new wxDbList; - pList->PtrPrev = 0; - } - - // Initialize new node in the linked list - pList->PtrNext = 0; - pList->Free = false; - pList->Dsn = pDbConfig->GetDsn(); - pList->Uid = pDbConfig->GetUserID(); - pList->AuthStr = pDbConfig->GetPassword(); - pList->ConnectionStr = pDbConfig->GetConnectionStr(); - - pList->PtrDb = new wxDb(pDbConfig->GetHenv(), FwdOnlyCursors); - - bool opened; - - if (!matchingDbConnection) - { - if (pDbConfig->UseConnectionStr()) - { - opened = pList->PtrDb->Open(pDbConfig->GetConnectionStr()); - } - else - { - opened = pList->PtrDb->Open(pDbConfig->GetDsn(), pDbConfig->GetUserID(), pDbConfig->GetPassword()); - } - } - else - opened = pList->PtrDb->Open(matchingDbConnection); - - // Connect to the datasource - if (opened) - { - pList->PtrDb->setCached(true); // Prevent a user from deleting a cached connection - pList->PtrDb->SetSqlLogging(SQLLOGstate, SQLLOGfn, true); - return(pList->PtrDb); - } - else // Unable to connect, destroy list item - { - if (pList->PtrPrev) - pList->PtrPrev->PtrNext = 0; - else - PtrBegDbList = 0; // Empty list again - - pList->PtrDb->CommitTrans(); // Commit any open transactions on wxDb object - pList->PtrDb->Close(); // Close the wxDb object - delete pList->PtrDb; // Deletes the wxDb object - delete pList; // Deletes the linked list object - return(0); - } - -} // wxDbGetConnection() - - -/********** wxDbFreeConnection() **********/ -bool WXDLLIMPEXP_ODBC wxDbFreeConnection(wxDb *pDb) -{ - wxDbList *pList; - - // Scan the linked list searching for the database connection - for (pList = PtrBegDbList; pList; pList = pList->PtrNext) - { - if (pList->PtrDb == pDb) // Found it, now free it!!! - return (pList->Free = true); - } - - // Never found the database object, return failure - return false; - -} // wxDbFreeConnection() - - -/********** wxDbCloseConnections() **********/ -void WXDLLIMPEXP_ODBC wxDbCloseConnections(void) -{ - wxDbList *pList, *pNext; - - // Traverse the linked list closing database connections and freeing memory as I go. - for (pList = PtrBegDbList; pList; pList = pNext) - { - pNext = pList->PtrNext; // Save the pointer to next - pList->PtrDb->CommitTrans(); // Commit any open transactions on wxDb object - pList->PtrDb->Close(); // Close the wxDb object - pList->PtrDb->setCached(false); // Allows deletion of the wxDb instance - delete pList->PtrDb; // Deletes the wxDb object - delete pList; // Deletes the linked list object - } - - // Mark the list as empty - PtrBegDbList = 0; - -} // wxDbCloseConnections() - - -/********** wxDbConnectionsInUse() **********/ -int WXDLLIMPEXP_ODBC wxDbConnectionsInUse(void) -{ - wxDbList *pList; - int cnt = 0; - - // Scan the linked list counting db connections that are currently in use - for (pList = PtrBegDbList; pList; pList = pList->PtrNext) - { - if (pList->Free == false) - cnt++; - } - - return(cnt); - -} // wxDbConnectionsInUse() - - - -/********** wxDbLogExtendedErrorMsg() **********/ -// DEBUG ONLY function -const wxChar WXDLLIMPEXP_ODBC *wxDbLogExtendedErrorMsg(const wxChar *userText, - wxDb *pDb, - const wxChar *ErrFile, - int ErrLine) -{ - static wxString msg; - msg = userText; - - wxString tStr; - - if (ErrFile || ErrLine) - { - msg += wxT("File: "); - msg += ErrFile; - msg += wxT(" Line: "); - tStr.Printf(wxT("%d"),ErrLine); - msg += tStr.c_str(); - msg += wxT("\n"); - } - - msg.Append (wxT("\nODBC errors:\n")); - msg += wxT("\n"); - - // Display errors for this connection - int i; - for (i = 0; i < DB_MAX_ERROR_HISTORY; i++) - { - if (pDb->errorList[i]) - { - msg.Append(pDb->errorList[i]); - if (wxStrcmp(pDb->errorList[i], wxEmptyString) != 0) - msg.Append(wxT("\n")); - // Clear the errmsg buffer so the next error will not - // end up showing the previous error that have occurred - wxStrcpy(pDb->errorList[i], wxEmptyString); - } - } - msg += wxT("\n"); - - wxLogDebug(msg.c_str()); - - return msg.c_str(); -} // wxDbLogExtendedErrorMsg() - - -/********** wxDbSqlLog() **********/ -bool wxDbSqlLog(wxDbSqlLogState state, const wxChar *filename) -{ - bool append = false; - wxDbList *pList; - - for (pList = PtrBegDbList; pList; pList = pList->PtrNext) - { - if (!pList->PtrDb->SetSqlLogging(state,filename,append)) - return false; - append = true; - } - - SQLLOGstate = state; - SQLLOGfn = filename; - - return true; - -} // wxDbSqlLog() - - -#if 0 -/********** wxDbCreateDataSource() **********/ -int wxDbCreateDataSource(const wxString &driverName, const wxString &dsn, const wxString &description, - bool sysDSN, const wxString &defDir, wxWindow *parent) -/* - * !!!! ONLY FUNCTIONAL UNDER MSW with VC6 !!!! - * Very rudimentary creation of an ODBC data source. - * - * ODBC driver must be ODBC 3.0 compliant to use this function - */ -{ - int result = FALSE; - -//!!!! ONLY FUNCTIONAL UNDER MSW with VC6 !!!! -#ifdef __VISUALC__ - int dsnLocation; - wxString setupStr; - - if (sysDSN) - dsnLocation = ODBC_ADD_SYS_DSN; - else - dsnLocation = ODBC_ADD_DSN; - - // NOTE: The decimal 2 is an invalid character in all keyword pairs - // so that is why I used it, as wxString does not deal well with - // embedded nulls in strings - setupStr.Printf(wxT("DSN=%s%cDescription=%s%cDefaultDir=%s%c"),dsn,2,description,2,defDir,2); - - // Replace the separator from above with the '\0' separator needed - // by the SQLConfigDataSource() function - int k; - do - { - k = setupStr.Find((wxChar)2,true); - if (k != wxNOT_FOUND) - setupStr[(UINT)k] = wxT('\0'); - } - while (k != wxNOT_FOUND); - - result = SQLConfigDataSource((HWND)parent->GetHWND(), dsnLocation, - driverName, setupStr.c_str()); - - if ((result != SQL_SUCCESS) && (result != SQL_SUCCESS_WITH_INFO)) - { - // check for errors caused by ConfigDSN based functions - DWORD retcode = 0; - WORD cb; - wxChar errMsg[SQL_MAX_MESSAGE_LENGTH]; - errMsg[0] = wxT('\0'); - - // This function is only supported in ODBC drivers v3.0 compliant and above - SQLInstallerError(1,&retcode,errMsg,SQL_MAX_MESSAGE_LENGTH-1,&cb); - if (retcode) - { -#ifdef DBDEBUG_CONSOLE - // When run in console mode, use standard out to display errors. - cout << errMsg << endl; - cout << wxT("Press any key to continue...") << endl; - getchar(); -#endif // DBDEBUG_CONSOLE - -#ifdef __WXDEBUG__ - wxLogDebug(errMsg,wxT("ODBC DEBUG MESSAGE")); -#endif // __WXDEBUG__ - } - } - else - result = TRUE; -#else - // Using iODBC/unixODBC or some other compiler which does not support the APIs - // necessary to use this function, so this function is not supported -#ifdef __WXDEBUG__ - wxLogDebug(wxT("wxDbCreateDataSource() not available except under VC++/MSW"),wxT("ODBC DEBUG MESSAGE")); -#endif - result = FALSE; -#endif // __VISUALC__ - - return result; - -} // wxDbCreateDataSource() -#endif - - -/********** wxDbGetDataSource() **********/ -bool wxDbGetDataSource(HENV henv, wxChar *Dsn, SWORD DsnMaxLength, wxChar *DsDesc, - SWORD DsDescMaxLength, UWORD direction) -/* - * Dsn and DsDesc will contain the data source name and data source - * description upon return - */ -{ - SWORD cb1,cb2; - SWORD lengthDsn = (SWORD)(DsnMaxLength*sizeof(wxChar)); - SWORD lengthDsDesc = (SWORD)(DsDescMaxLength*sizeof(wxChar)); - - if (SQLDataSources(henv, direction, (SQLTCHAR FAR *) Dsn, lengthDsn, &cb1, - (SQLTCHAR FAR *) DsDesc, lengthDsDesc, &cb2) == SQL_SUCCESS) - return true; - else - return false; - -} // wxDbGetDataSource() - - -// Change this to 0 to remove use of all deprecated functions -#if wxODBC_BACKWARD_COMPATABILITY -/******************************************************************** - ******************************************************************** - * - * The following functions are all DEPRECATED and are included for - * backward compatibility reasons only - * - ******************************************************************** - ********************************************************************/ -bool SqlLog(sqlLog state, const wxChar *filename) -{ - return wxDbSqlLog((enum wxDbSqlLogState)state, filename); -} -/***** DEPRECATED: use wxGetDataSource() *****/ -bool GetDataSource(HENV henv, char *Dsn, SWORD DsnMax, char *DsDesc, SWORD DsDescMax, - UWORD direction) -{ - return wxDbGetDataSource(henv, Dsn, DsnMax, DsDesc, DsDescMax, direction); -} -/***** DEPRECATED: use wxDbGetConnection() *****/ -wxDb WXDLLIMPEXP_ODBC *GetDbConnection(DbStuff *pDbStuff, bool FwdOnlyCursors) -{ - return wxDbGetConnection((wxDbConnectInf *)pDbStuff, FwdOnlyCursors); -} -/***** DEPRECATED: use wxDbFreeConnection() *****/ -bool WXDLLIMPEXP_ODBC FreeDbConnection(wxDb *pDb) -{ - return wxDbFreeConnection(pDb); -} -/***** DEPRECATED: use wxDbCloseConnections() *****/ -void WXDLLIMPEXP_ODBC CloseDbConnections(void) -{ - wxDbCloseConnections(); -} -/***** DEPRECATED: use wxDbConnectionsInUse() *****/ -int WXDLLIMPEXP_ODBC NumberDbConnectionsInUse(void) -{ - return wxDbConnectionsInUse(); -} -#endif - - -#endif - // wxUSE_ODBC diff --git a/wxWidgets/src/common/dbgrid.cpp b/wxWidgets/src/common/dbgrid.cpp deleted file mode 100644 index 3a01b6c1eb..0000000000 --- a/wxWidgets/src/common/dbgrid.cpp +++ /dev/null @@ -1,727 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: src/common/dbgrid.cpp -// Purpose: Displays a wxDbTable in a wxGrid. -// Author: Roger Gammans, Paul Gammans -// Modified by: -// Created: -// RCS-ID: $Id: dbgrid.cpp 43769 2006-12-03 18:20:28Z VZ $ -// Copyright: (c) 1999 The Computer Surgery (roger@computer-surgery.co.uk) -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// -// Branched From : dbgrid.cpp,v 1.18 2000/12/19 13:00:58 -/////////////////////////////////////////////////////////////////////////////// - -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_ODBC && wxUSE_GRID - -#ifndef WX_PRECOMP - #include "wx/textctrl.h" - #include "wx/dc.h" - #include "wx/app.h" -#endif // WX_PRECOMP - -#include "wx/generic/gridctrl.h" -#include "wx/dbgrid.h" - -// DLL options compatibility check: -WX_CHECK_BUILD_OPTIONS("wxDbGrid") - - -wxDbGridCellAttrProvider::wxDbGridCellAttrProvider() -{ - m_data=NULL; - m_ColInfo=NULL; -} - -wxDbGridCellAttrProvider::wxDbGridCellAttrProvider(wxDbTable *tab, wxDbGridColInfoBase* ColInfo) -{ - m_data=tab; - m_ColInfo=ColInfo; -} - -wxDbGridCellAttrProvider::~wxDbGridCellAttrProvider() -{ -} - -wxGridCellAttr *wxDbGridCellAttrProvider::GetAttr(int row, int col, - wxGridCellAttr::wxAttrKind kind) const -{ - wxGridCellAttr *attr = wxGridCellAttrProvider::GetAttr(row,col,kind); - - if (m_data && m_ColInfo && (m_data->GetNumberOfColumns() > m_ColInfo[col].DbCol)) - { - //FIXME: this test could. - // ??::InsertPending == m_data->get_ModifiedStatus() - // and if InsertPending use colDef[].InsertAllowed - if (!(m_data->GetColDefs()[(m_ColInfo[col].DbCol)].Updateable)) - { - switch(kind) - { - case (wxGridCellAttr::Any): - if (!attr) - { - attr = new wxGridCellAttr; - // Store so we don't keep creating / deleting this... - wxDbGridCellAttrProvider * self = wxConstCast(this, wxDbGridCellAttrProvider) ; - attr->IncRef(); - self->SetColAttr(attr, col); - attr->SetReadOnly(); - } - else - { - //We now must check what we were returned. and do the right thing (tm) - wxGridCellAttr::wxAttrKind attrkind = attr->GetKind(); - if ((attrkind == (wxGridCellAttr::Default)) || (attrkind == (wxGridCellAttr::Cell)) || - (attrkind == (wxGridCellAttr::Col))) - { - wxGridCellAttr *attrtomerge = attr; - attr = new wxGridCellAttr; - attr->SetKind(wxGridCellAttr::Merged); - attr->MergeWith(attrtomerge); - attr->SetReadOnly(); - attrtomerge->DecRef(); - } - attr->SetReadOnly(); - } - break; - case (wxGridCellAttr::Col): - //As we must have a Coll, and were setting Coll attributes - // we can based on wxdbTable's so just set RO if attr valid - if (!attr) - { - attr = new wxGridCellAttr; - wxDbGridCellAttrProvider * self = wxConstCast(this, wxDbGridCellAttrProvider) ; - attr->IncRef(); - self->SetColAttr(attr, col); - } - attr->SetReadOnly(); - break; - default: - //Dont add RO for... - // wxGridCellAttr::Cell - Not required, will inherit on merge from row. - // wxGridCellAttr::Row - If wxDbtable ever supports row locking could add - // support to make RO on a row basis also. - // wxGridCellAttr::Default - Don't edit this ! or all cell with a attr will become readonly - // wxGridCellAttr::Merged - This should never be asked for. - break; - } - } - - } - return attr; -} - -void wxDbGridCellAttrProvider::AssignDbTable(wxDbTable *tab) -{ - m_data = tab; -} - -wxDbGridTableBase::wxDbGridTableBase(wxDbTable *tab, wxDbGridColInfo* ColInfo, - int count, bool takeOwnership) : - m_keys(), - m_data(tab), - m_dbowner(takeOwnership), - m_rowmodified(false) -{ - - if (count == wxUSE_QUERY) - { - m_rowtotal = m_data ? m_data->Count() : 0; - } - else - { - m_rowtotal = count; - } -// m_keys.Size(m_rowtotal); - m_row = -1; - if (ColInfo) - { - m_nocols = ColInfo->Length(); - m_ColInfo = new wxDbGridColInfoBase[m_nocols]; - //Do Copy. - wxDbGridColInfo *ptr = ColInfo; - int i =0; - while (ptr && i < m_nocols) - { - m_ColInfo[i] = ptr->m_data; - ptr = ptr->m_next; - i++; - } -#ifdef __WXDEBUG__ - if (ptr) - { - wxLogDebug(wxT("NoCols over length after traversing %i items"),i); - } - if (i < m_nocols) - { - wxLogDebug(wxT("NoCols under length after traversing %i items"),i); - } -#endif - } -} - -wxDbGridTableBase::~wxDbGridTableBase() -{ - wxDbGridCellAttrProvider *provider; - - //Can't check for update here as - - //FIXME: should i remove m_ColInfo and m_data from m_attrProvider if a wxDbGridAttrProvider -// if ((provider = dynamic_cast(GetAttrProvider()))) - // Using C casting for now until we can support dynamic_cast with wxWidgets - provider = (wxDbGridCellAttrProvider *)(GetAttrProvider()); - if (provider) - { - provider->AssignDbTable(NULL); - } - delete [] m_ColInfo; - - Writeback(); - if (m_dbowner) - { - delete m_data; - } -} - -bool wxDbGridTableBase::CanHaveAttributes() -{ - if (!GetAttrProvider()) - { - // use the default attr provider by default - SetAttrProvider(new wxDbGridCellAttrProvider(m_data, m_ColInfo)); - } - return true; -} - - -bool wxDbGridTableBase::AssignDbTable(wxDbTable *tab, int count, bool takeOwnership) -{ - wxDbGridCellAttrProvider *provider; - - //Remove Information from grid about old data - if (GetView()) - { - wxGrid *grid = GetView(); - grid->BeginBatch(); - grid->ClearSelection(); - if (grid->IsCellEditControlEnabled()) - { - grid->DisableCellEditControl(); - } - wxGridTableMessage msg(this, wxGRIDTABLE_NOTIFY_ROWS_DELETED,0,m_rowtotal); - grid->ProcessTableMessage(msg); - } - - //reset our internals... - Writeback(); - if (m_dbowner) - { - delete m_data; - } - m_keys.Empty(); - m_data = tab; - //FIXME: Remove dynamic_cast before sumision to wxwin -// if ((provider = dynamic_cast (GetAttrProvider()))) - // Using C casting for now until we can support dynamic_cast with wxWidgets - provider = (wxDbGridCellAttrProvider *)(GetAttrProvider()); - if (provider) - { - provider->AssignDbTable(m_data); - } - - if (count == wxUSE_QUERY) - { - m_rowtotal = m_data ? m_data->Count() : 0; - } - else - { - m_rowtotal = count; - } - m_row = -1; - - //Add Information to grid about new data - if (GetView()) - { - wxGrid * grid = GetView(); - wxGridTableMessage msg(this, wxGRIDTABLE_NOTIFY_ROWS_APPENDED, m_rowtotal); - grid->ProcessTableMessage(msg); - grid->EndBatch(); - } - m_dbowner = takeOwnership; - m_rowmodified = false; - return true; -} - -wxString wxDbGridTableBase::GetTypeName(int WXUNUSED(row), int col) -{ - if (GetNumberCols() > col) - { - if (m_ColInfo[col].wxtypename == wxGRID_VALUE_DBAUTO) - { - if (m_data->GetNumberOfColumns() <= m_ColInfo[col].DbCol) - { - wxFAIL_MSG (_T("You can not use wxGRID_VALUE_DBAUTO for virtual columns")); - } - switch(m_data->GetColDefs()[(m_ColInfo[col].DbCol)].SqlCtype) - { - case SQL_C_CHAR: -#ifdef SQL_C_WCHAR - case SQL_C_WCHAR: -#endif - return wxGRID_VALUE_STRING; - case SQL_C_SHORT: - case SQL_C_SSHORT: - return wxGRID_VALUE_NUMBER; - case SQL_C_USHORT: - return wxGRID_VALUE_NUMBER; - case SQL_C_LONG: - case SQL_C_SLONG: - return wxGRID_VALUE_NUMBER; - case SQL_C_ULONG: - return wxGRID_VALUE_NUMBER; - case SQL_C_FLOAT: - return wxGRID_VALUE_FLOAT; - case SQL_C_DOUBLE: - return wxGRID_VALUE_FLOAT; - case SQL_C_DATE: - return wxGRID_VALUE_DATETIME; - case SQL_C_TIME: - return wxGRID_VALUE_DATETIME; - case SQL_C_TIMESTAMP: - return wxGRID_VALUE_DATETIME; - default: - return wxGRID_VALUE_STRING; - } - } - else - { - return m_ColInfo[col].wxtypename; - } - } - wxFAIL_MSG (_T("unknown column")); - return wxString(); -} - -bool wxDbGridTableBase::CanGetValueAs(int row, int col, const wxString& typeName) -{ - wxLogDebug(wxT("CanGetValueAs() on %i,%i"),row,col); - //Is this needed? As it will be validated on GetValueAsXXXX - ValidateRow(row); - - if (typeName == wxGRID_VALUE_STRING) - { - //FIXME ummm What about blob field etc. - return true; - } - - if (m_data->IsColNull((UWORD)m_ColInfo[col].DbCol)) - { - return false; - } - - if (m_data->GetNumberOfColumns() <= m_ColInfo[col].DbCol) - { - //If a virtual column then we can't find it's type. we have to - // return false to get using wxVariant. - return false; - } - int sqltype = m_data->GetColDefs()[(m_ColInfo[col].DbCol)].SqlCtype; - - if (typeName == wxGRID_VALUE_DATETIME) - { - if ((sqltype == SQL_C_DATE) || - (sqltype == SQL_C_TIME) || - (sqltype == SQL_C_TIMESTAMP)) - { - return true; - } - return false; - } - if (typeName == wxGRID_VALUE_NUMBER) - { - if ((sqltype == SQL_C_SSHORT) || - (sqltype == SQL_C_USHORT) || - (sqltype == SQL_C_SLONG) || - (sqltype == SQL_C_ULONG)) - { - return true; - } - return false; - } - if (typeName == wxGRID_VALUE_FLOAT) - { - if ((sqltype == SQL_C_SSHORT) || - (sqltype == SQL_C_USHORT) || - (sqltype == SQL_C_SLONG) || - (sqltype == SQL_C_ULONG) || - (sqltype == SQL_C_FLOAT) || - (sqltype == SQL_C_DOUBLE)) - { - return true; - } - return false; - } - return false; -} - -bool wxDbGridTableBase::CanSetValueAs(int WXUNUSED(row), int col, const wxString& typeName) -{ - if (typeName == wxGRID_VALUE_STRING) - { - //FIXME ummm What about blob field etc. - return true; - } - - if (!(m_data->GetColDefs()[(m_ColInfo[col].DbCol)].Updateable)) - { - return false; - } - - if (m_data->GetNumberOfColumns() <= m_ColInfo[col].DbCol) - { - //If a virtual column then we can't find it's type. we have to faulse to - //get using wxVairent. - return false; - } - - int sqltype = m_data->GetColDefs()[(m_ColInfo[col].DbCol)].SqlCtype; - if (typeName == wxGRID_VALUE_DATETIME) - { - if ((sqltype == SQL_C_DATE) || - (sqltype == SQL_C_TIME) || - (sqltype == SQL_C_TIMESTAMP)) - { - return true; - } - return false; - } - if (typeName == wxGRID_VALUE_NUMBER) - { - if ((sqltype == SQL_C_SSHORT) || - (sqltype == SQL_C_USHORT) || - (sqltype == SQL_C_SLONG) || - (sqltype == SQL_C_ULONG)) - { - return true; - } - return false; - } - if (typeName == wxGRID_VALUE_FLOAT) - { - if ((sqltype == SQL_C_SSHORT) || - (sqltype == SQL_C_USHORT) || - (sqltype == SQL_C_SLONG) || - (sqltype == SQL_C_ULONG) || - (sqltype == SQL_C_FLOAT) || - (sqltype == SQL_C_DOUBLE)) - { - return true; - } - return false; - } - return false; -} - -long wxDbGridTableBase::GetValueAsLong(int row, int col) -{ - ValidateRow(row); - - if (m_data->GetNumberOfColumns() <= m_ColInfo[col].DbCol) - { - wxFAIL_MSG (_T("You can not use GetValueAsLong for virtual columns")); - return 0; - } - int sqltype = m_data->GetColDefs()[(m_ColInfo[col].DbCol)].SqlCtype; - if ((sqltype == SQL_C_SSHORT) || - (sqltype == SQL_C_USHORT) || - (sqltype == SQL_C_SLONG) || - (sqltype == SQL_C_ULONG)) - { - wxVariant val = m_data->GetColumn(m_ColInfo[col].DbCol); - return val.GetLong(); - } - wxFAIL_MSG (_T("unknown column, ")); - return 0; -} - -double wxDbGridTableBase::GetValueAsDouble(int row, int col) -{ - wxLogDebug(wxT("GetValueAsDouble() on %i,%i"),row,col); - ValidateRow(row); - - if (m_data->GetNumberOfColumns() <= m_ColInfo[col].DbCol) - { - wxFAIL_MSG (_T("You can not use GetValueAsDouble for virtual columns")); - return 0.0; - } - int sqltype = m_data->GetColDefs()[(m_ColInfo[col].DbCol)].SqlCtype; - if ((sqltype == SQL_C_SSHORT) || - (sqltype == SQL_C_USHORT) || - (sqltype == SQL_C_SLONG) || - (sqltype == SQL_C_ULONG) || - (sqltype == SQL_C_FLOAT) || - (sqltype == SQL_C_DOUBLE)) - { - wxVariant val = m_data->GetColumn(m_ColInfo[col].DbCol); - return val.GetDouble(); - } - wxFAIL_MSG (_T("unknown column")); - return 0.0; -} - -bool wxDbGridTableBase::GetValueAsBool(int row, int col) -{ - wxLogDebug(wxT("GetValueAsBool() on %i,%i"),row,col); - ValidateRow(row); - - if (m_data->GetNumberOfColumns() <= m_ColInfo[col].DbCol) - { - wxFAIL_MSG (_T("You can not use GetValueAsBool for virtual columns")); - return 0; - } - int sqltype = m_data->GetColDefs()[(m_ColInfo[col].DbCol)].SqlCtype; - if ((sqltype == SQL_C_SSHORT) || - (sqltype == SQL_C_USHORT) || - (sqltype == SQL_C_SLONG) || - (sqltype == SQL_C_ULONG)) - { - wxVariant val = m_data->GetColumn(m_ColInfo[col].DbCol); - return val.GetBool(); - } - wxFAIL_MSG (_T("unknown column, ")); - return 0; -} - -void* wxDbGridTableBase::GetValueAsCustom(int row, int col, const wxString& typeName) -{ - wxLogDebug(wxT("GetValueAsCustom() on %i,%i"),row,col); - ValidateRow(row); - - if (m_data->GetNumberOfColumns() <= m_ColInfo[col].DbCol) - { - wxFAIL_MSG (_T("You can not use GetValueAsCustom for virtual columns")); - return NULL; - } - if (m_data->IsColNull((UWORD)m_ColInfo[col].DbCol)) - return NULL; - - if (typeName == wxGRID_VALUE_DATETIME) - { - wxDbColDef *pColDefs = m_data->GetColDefs(); - int sqltype = pColDefs[(m_ColInfo[col].DbCol)].SqlCtype; - - if ((sqltype == SQL_C_DATE) || - (sqltype == SQL_C_TIME) || - (sqltype == SQL_C_TIMESTAMP)) - { - wxVariant val = m_data->GetColumn(m_ColInfo[col].DbCol); - return new wxDateTime(val.GetDateTime()); - } - } - wxFAIL_MSG (_T("unknown column data type ")); - return NULL; -} - - -void wxDbGridTableBase::SetValueAsCustom(int row, int col, const wxString& typeName, void* value) -{ - wxLogDebug(wxT("SetValueAsCustom() on %i,%i"),row,col); - ValidateRow(row); - - if (m_data->GetNumberOfColumns() <= m_ColInfo[col].DbCol) - { - wxFAIL_MSG (_T("You can not use SetValueAsCustom for virtual columns")); - return; - } - - if (typeName == wxGRID_VALUE_DATETIME) - { - int sqltype = m_data->GetColDefs()[(m_ColInfo[col].DbCol)].SqlCtype; - if ((sqltype == SQL_C_DATE) || - (sqltype == SQL_C_TIME) || - (sqltype == SQL_C_TIMESTAMP)) - { - //FIXME: you can't dynamic_cast from (void *) - //wxDateTime *date = wxDynamicCast(value, wxDateTime); - wxDateTime *date = (wxDateTime *)value; - if (!date) - { - wxFAIL_MSG (_T("Failed to convert data")); - return; - } - wxVariant val(date); - m_rowmodified = true; - m_data->SetColumn(m_ColInfo[col].DbCol,val); - } - } - wxFAIL_MSG (_T("unknown column data type")); - return ; -} - - -wxString wxDbGridTableBase::GetColLabelValue(int col) -{ - if (GetNumberCols() > col) - { - return m_ColInfo[col].Title; - } - wxFAIL_MSG (_T("unknown column")); - return wxString(); -} - -bool wxDbGridTableBase::IsEmptyCell(int row, int col) -{ - wxLogDebug(wxT("IsEmtpyCell on %i,%i"),row,col); - - ValidateRow(row); - return m_data->IsColNull((UWORD)m_ColInfo[col].DbCol); -} - - -wxString wxDbGridTableBase::GetValue(int row, int col) -{ - wxLogDebug(wxT("GetValue() on %i,%i"),row,col); - - ValidateRow(row); - wxVariant val = m_data->GetColumn(m_ColInfo[col].DbCol); - wxLogDebug(wxT("\tReturning \"%s\"\n"),val.GetString().c_str()); - - return val.GetString(); -} - - -void wxDbGridTableBase::SetValue(int row, int col,const wxString& value) -{ - wxLogDebug(wxT("SetValue() on %i,%i"),row,col); - - ValidateRow(row); - wxVariant val(value); - - m_rowmodified = true; - m_data->SetColumn(m_ColInfo[col].DbCol,val); -} - - -void wxDbGridTableBase::SetValueAsLong(int row, int col, long value) -{ - wxLogDebug(wxT("SetValueAsLong() on %i,%i"),row,col); - - ValidateRow(row); - wxVariant val(value); - - m_rowmodified = true; - m_data->SetColumn(m_ColInfo[col].DbCol,val); -} - - -void wxDbGridTableBase::SetValueAsDouble(int row, int col, double value) -{ - wxLogDebug(wxT("SetValueAsDouble() on %i,%i"),row,col); - - ValidateRow(row); - wxVariant val(value); - - m_rowmodified = true; - m_data->SetColumn(m_ColInfo[col].DbCol,val); - -} - - -void wxDbGridTableBase::SetValueAsBool(int row, int col, bool value) -{ - wxLogDebug(wxT("SetValueAsBool() on %i,%i"),row,col); - - ValidateRow(row); - wxVariant val(value); - - m_rowmodified = true; - m_data->SetColumn(m_ColInfo[col].DbCol,val); -} - - -void wxDbGridTableBase::ValidateRow(int row) -{ - wxLogDebug(wxT("ValidateRow(%i) currently on row (%i). Array count = %lu"), - row, m_row, (unsigned long)m_keys.GetCount()); - - if (row == m_row) - return; - Writeback(); - - //We add to row as Count is unsigned! - if ((unsigned)(row+1) > m_keys.GetCount()) - { - wxLogDebug(wxT("\trow key unknown")); - // Extend Array, iterate through data filling with keys - m_data->SetRowMode(wxDbTable::WX_ROW_MODE_QUERY); - int trow; - for (trow = m_keys.GetCount(); trow <= row; trow++) - { - wxLogDebug(wxT("Fetching row %i.."), trow); - bool ret = m_data->GetNext(); - - wxLogDebug(wxT(" ...success=(%i)"),ret); - GenericKey k = m_data->GetKey(); - m_keys.Add(k); - } - m_row = row; - } - else - { - wxLogDebug(wxT("\trow key known centering data")); - GenericKey k = m_keys.Item(row); - m_data->SetRowMode(wxDbTable::WX_ROW_MODE_INDIVIDUAL); - m_data->ClearMemberVars(); - m_data->SetKey(k); - if (!m_data->QueryOnKeyFields()) - { - wxDbLogExtendedErrorMsg(_T("ODBC error during Query()\n\n"), m_data->GetDb(),__TFILE__,__LINE__); - } - - m_data->GetNext(); - - m_row = row; - } - m_rowmodified = false; -} - -bool wxDbGridTableBase::Writeback() const -{ - if (!m_rowmodified) - { - return true; - } - - bool result=true; - wxLogDebug(wxT("\trow key unknown")); - -// FIXME: this code requires dbtable support for record status -#if 0 - switch (m_data->get_ModifiedStatus()) - { - case wxDbTable::UpdatePending: - result = m_data->Update(); - break; - case wxDbTable::InsertPending: - result = (m_data->Insert() == SQL_SUCCESS); - break; - default: - //Nothing - break; - } -#else - wxLogDebug(wxT("WARNING : Row writeback not implemented ")); -#endif - return result; -} - -#include "wx/arrimpl.cpp" - -WX_DEFINE_EXPORTED_OBJARRAY(keyarray) - -#endif // wxUSE_GRID && wxUSE_ODBC diff --git a/wxWidgets/src/common/dbtable.cpp b/wxWidgets/src/common/dbtable.cpp deleted file mode 100644 index 292b4390d2..0000000000 --- a/wxWidgets/src/common/dbtable.cpp +++ /dev/null @@ -1,2946 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: src/common/dbtable.cpp -// Purpose: Implementation of the wxDbTable class. -// Author: Doug Card -// Modified by: George Tasker -// Bart Jourquin -// Mark Johnson -// Created: 9.96 -// RCS-ID: $Id: dbtable.cpp 48685 2007-09-14 19:02:28Z VZ $ -// Copyright: (c) 1996 Remstar International, Inc. -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_ODBC - -#ifndef WX_PRECOMP - #include "wx/object.h" - #include "wx/list.h" - #include "wx/string.h" - #include "wx/utils.h" - #include "wx/log.h" -#endif - -#ifdef DBDEBUG_CONSOLE -#if wxUSE_IOSTREAMH - #include -#else - #include -#endif - #include "wx/ioswrap.h" -#endif - -#include "wx/filefn.h" - -#include -#include -#include - -#include "wx/dbtable.h" - -#ifdef __UNIX__ -// The HPUX preprocessor lines below were commented out on 8/20/97 -// because macros.h currently redefines DEBUG and is unneeded. -// # ifdef HPUX -// # include -// # endif -# ifdef LINUX -# include -# endif -#endif - -ULONG lastTableID = 0; - - -#ifdef __WXDEBUG__ - #include "wx/thread.h" - - wxList TablesInUse; -#if wxUSE_THREADS - wxCriticalSection csTablesInUse; -#endif // wxUSE_THREADS -#endif - - -void csstrncpyt(wxChar *target, const wxChar *source, int n) -{ - while ( (*target++ = *source++) != '\0' && --n != 0 ) - ; - - *target = '\0'; -} - - - -/********** wxDbColDef::wxDbColDef() Constructor **********/ -wxDbColDef::wxDbColDef() -{ - Initialize(); -} // Constructor - - -bool wxDbColDef::Initialize() -{ - ColName[0] = 0; - DbDataType = DB_DATA_TYPE_INTEGER; - SqlCtype = SQL_C_LONG; - PtrDataObj = NULL; - SzDataObj = 0; - KeyField = false; - Updateable = false; - InsertAllowed = false; - DerivedCol = false; - CbValue = 0; - Null = false; - - return true; -} // wxDbColDef::Initialize() - - -/********** wxDbTable::wxDbTable() Constructor **********/ -wxDbTable::wxDbTable(wxDb *pwxDb, const wxString &tblName, const UWORD numColumns, - const wxString &qryTblName, bool qryOnly, const wxString &tblPath) -{ - if (!initialize(pwxDb, tblName, numColumns, qryTblName, qryOnly, tblPath)) - cleanup(); -} // wxDbTable::wxDbTable() - - -/***** DEPRECATED: use wxDbTable::wxDbTable() format above *****/ -#if WXWIN_COMPATIBILITY_2_4 -wxDbTable::wxDbTable(wxDb *pwxDb, const wxString &tblName, const UWORD numColumns, - const wxChar *qryTblName, bool qryOnly, const wxString &tblPath) -{ - wxString tempQryTblName; - tempQryTblName = qryTblName; - if (!initialize(pwxDb, tblName, numColumns, tempQryTblName, qryOnly, tblPath)) - cleanup(); -} // wxDbTable::wxDbTable() -#endif // WXWIN_COMPATIBILITY_2_4 - - -/********** wxDbTable::~wxDbTable() **********/ -wxDbTable::~wxDbTable() -{ - this->cleanup(); -} // wxDbTable::~wxDbTable() - - -bool wxDbTable::initialize(wxDb *pwxDb, const wxString &tblName, const UWORD numColumns, - const wxString &qryTblName, bool qryOnly, const wxString &tblPath) -{ - // Initializing member variables - pDb = pwxDb; // Pointer to the wxDb object - henv = 0; - hdbc = 0; - hstmt = 0; - m_hstmtGridQuery = 0; - hstmtDefault = 0; // Initialized below - hstmtCount = 0; // Initialized first time it is needed - hstmtInsert = 0; - hstmtDelete = 0; - hstmtUpdate = 0; - hstmtInternal = 0; - colDefs = 0; - tableID = 0; - m_numCols = numColumns; // Number of columns in the table - where.Empty(); // Where clause - orderBy.Empty(); // Order By clause - from.Empty(); // From clause - selectForUpdate = false; // SELECT ... FOR UPDATE; Indicates whether to include the FOR UPDATE phrase - queryOnly = qryOnly; - insertable = true; - tablePath.Empty(); - tableName.Empty(); - queryTableName.Empty(); - - wxASSERT(tblName.length()); - wxASSERT(pDb); - - if (!pDb) - return false; - - tableName = tblName; // Table Name - if ((pDb->Dbms() == dbmsORACLE) || - (pDb->Dbms() == dbmsFIREBIRD) || - (pDb->Dbms() == dbmsINTERBASE)) - tableName = tableName.Upper(); - - if (tblPath.length()) - tablePath = tblPath; // Table Path - used for dBase files - else - tablePath.Empty(); - - if (qryTblName.length()) // Name of the table/view to query - queryTableName = qryTblName; - else - queryTableName = tblName; - - if ((pDb->Dbms() == dbmsORACLE) || - (pDb->Dbms() == dbmsFIREBIRD) || - (pDb->Dbms() == dbmsINTERBASE)) - queryTableName = queryTableName.Upper(); - - pDb->incrementTableCount(); - - wxString s; - tableID = ++lastTableID; - s.Printf(wxT("wxDbTable constructor (%-20s) tableID:[%6lu] pDb:[%p]"), - tblName.c_str(), tableID, wx_static_cast(void*, pDb)); - -#ifdef __WXDEBUG__ - wxTablesInUse *tableInUse; - tableInUse = new wxTablesInUse(); - tableInUse->tableName = tblName; - tableInUse->tableID = tableID; - tableInUse->pDb = pDb; - { -#if wxUSE_THREADS - wxCriticalSectionLocker lock(csTablesInUse); -#endif // wxUSE_THREADS - TablesInUse.Append(tableInUse); - } -#endif - - pDb->WriteSqlLog(s); - - // Grab the HENV and HDBC from the wxDb object - henv = pDb->GetHENV(); - hdbc = pDb->GetHDBC(); - - // Allocate space for column definitions - if (m_numCols) - colDefs = new wxDbColDef[m_numCols]; // Points to the first column definition - - // Allocate statement handles for the table - if (!queryOnly) - { - // Allocate a separate statement handle for performing inserts - if (SQLAllocStmt(hdbc, &hstmtInsert) != SQL_SUCCESS) - pDb->DispAllErrors(henv, hdbc); - // Allocate a separate statement handle for performing deletes - if (SQLAllocStmt(hdbc, &hstmtDelete) != SQL_SUCCESS) - pDb->DispAllErrors(henv, hdbc); - // Allocate a separate statement handle for performing updates - if (SQLAllocStmt(hdbc, &hstmtUpdate) != SQL_SUCCESS) - pDb->DispAllErrors(henv, hdbc); - } - // Allocate a separate statement handle for internal use - if (SQLAllocStmt(hdbc, &hstmtInternal) != SQL_SUCCESS) - pDb->DispAllErrors(henv, hdbc); - - // Set the cursor type for the statement handles - cursorType = SQL_CURSOR_STATIC; - - if (SQLSetStmtOption(hstmtInternal, SQL_CURSOR_TYPE, cursorType) != SQL_SUCCESS) - { - // Check to see if cursor type is supported - pDb->GetNextError(henv, hdbc, hstmtInternal); - if (! wxStrcmp(pDb->sqlState, wxT("01S02"))) // Option Value Changed - { - // Datasource does not support static cursors. Driver - // will substitute a cursor type. Call SQLGetStmtOption() - // to determine which cursor type was selected. - if (SQLGetStmtOption(hstmtInternal, SQL_CURSOR_TYPE, &cursorType) != SQL_SUCCESS) - pDb->DispAllErrors(henv, hdbc, hstmtInternal); -#ifdef DBDEBUG_CONSOLE - cout << wxT("Static cursor changed to: "); - switch(cursorType) - { - case SQL_CURSOR_FORWARD_ONLY: - cout << wxT("Forward Only"); - break; - case SQL_CURSOR_STATIC: - cout << wxT("Static"); - break; - case SQL_CURSOR_KEYSET_DRIVEN: - cout << wxT("Keyset Driven"); - break; - case SQL_CURSOR_DYNAMIC: - cout << wxT("Dynamic"); - break; - } - cout << endl << endl; -#endif - // BJO20000425 - if (pDb->FwdOnlyCursors() && cursorType != SQL_CURSOR_FORWARD_ONLY) - { - // Force the use of a forward only cursor... - cursorType = SQL_CURSOR_FORWARD_ONLY; - if (SQLSetStmtOption(hstmtInternal, SQL_CURSOR_TYPE, cursorType) != SQL_SUCCESS) - { - // Should never happen - pDb->GetNextError(henv, hdbc, hstmtInternal); - return false; - } - } - } - else - { - pDb->DispNextError(); - pDb->DispAllErrors(henv, hdbc, hstmtInternal); - } - } -#ifdef DBDEBUG_CONSOLE - else - cout << wxT("Cursor Type set to STATIC") << endl << endl; -#endif - - if (!queryOnly) - { - // Set the cursor type for the INSERT statement handle - if (SQLSetStmtOption(hstmtInsert, SQL_CURSOR_TYPE, SQL_CURSOR_FORWARD_ONLY) != SQL_SUCCESS) - pDb->DispAllErrors(henv, hdbc, hstmtInsert); - // Set the cursor type for the DELETE statement handle - if (SQLSetStmtOption(hstmtDelete, SQL_CURSOR_TYPE, SQL_CURSOR_FORWARD_ONLY) != SQL_SUCCESS) - pDb->DispAllErrors(henv, hdbc, hstmtDelete); - // Set the cursor type for the UPDATE statement handle - if (SQLSetStmtOption(hstmtUpdate, SQL_CURSOR_TYPE, SQL_CURSOR_FORWARD_ONLY) != SQL_SUCCESS) - pDb->DispAllErrors(henv, hdbc, hstmtUpdate); - } - - // Make the default cursor the active cursor - hstmtDefault = GetNewCursor(false,false); - wxASSERT(hstmtDefault); - hstmt = *hstmtDefault; - - return true; - -} // wxDbTable::initialize() - - -void wxDbTable::cleanup() -{ - wxString s; - if (pDb) - { - s.Printf(wxT("wxDbTable destructor (%-20s) tableID:[%6lu] pDb:[%p]"), - tableName.c_str(), tableID, wx_static_cast(void*, pDb)); - pDb->WriteSqlLog(s); - } - -#ifdef __WXDEBUG__ - if (tableID) - { - bool found = false; - - wxList::compatibility_iterator pNode; - { -#if wxUSE_THREADS - wxCriticalSectionLocker lock(csTablesInUse); -#endif // wxUSE_THREADS - pNode = TablesInUse.GetFirst(); - while (!found && pNode) - { - if (((wxTablesInUse *)pNode->GetData())->tableID == tableID) - { - found = true; - delete (wxTablesInUse *)pNode->GetData(); - TablesInUse.Erase(pNode); - } - else - pNode = pNode->GetNext(); - } - } - if (!found) - { - wxString msg; - msg.Printf(wxT("Unable to find the tableID in the linked\nlist of tables in use.\n\n%s"),s.c_str()); - wxLogDebug (msg,wxT("NOTICE...")); - } - } -#endif - - // Decrement the wxDb table count - if (pDb) - pDb->decrementTableCount(); - - // Delete memory allocated for column definitions - if (colDefs) - delete [] colDefs; - - // Free statement handles - if (!queryOnly) - { - if (hstmtInsert) - { -/* -ODBC 3.0 says to use this form - if (SQLFreeHandle(*hstmtDel, SQL_DROP) != SQL_SUCCESS) -*/ - if (SQLFreeStmt(hstmtInsert, SQL_DROP) != SQL_SUCCESS) - pDb->DispAllErrors(henv, hdbc); - } - - if (hstmtDelete) - { -/* -ODBC 3.0 says to use this form - if (SQLFreeHandle(*hstmtDel, SQL_DROP) != SQL_SUCCESS) -*/ - if (SQLFreeStmt(hstmtDelete, SQL_DROP) != SQL_SUCCESS) - pDb->DispAllErrors(henv, hdbc); - } - - if (hstmtUpdate) - { -/* -ODBC 3.0 says to use this form - if (SQLFreeHandle(*hstmtDel, SQL_DROP) != SQL_SUCCESS) -*/ - if (SQLFreeStmt(hstmtUpdate, SQL_DROP) != SQL_SUCCESS) - pDb->DispAllErrors(henv, hdbc); - } - } - - if (hstmtInternal) - { - if (SQLFreeStmt(hstmtInternal, SQL_DROP) != SQL_SUCCESS) - pDb->DispAllErrors(henv, hdbc); - } - - // Delete dynamically allocated cursors - if (hstmtDefault) - DeleteCursor(hstmtDefault); - - if (hstmtCount) - DeleteCursor(hstmtCount); - - if (m_hstmtGridQuery) - DeleteCursor(m_hstmtGridQuery); - -} // wxDbTable::cleanup() - - -/***************************** PRIVATE FUNCTIONS *****************************/ - - -void wxDbTable::setCbValueForColumn(int columnIndex) -{ - switch(colDefs[columnIndex].DbDataType) - { - case DB_DATA_TYPE_VARCHAR: - case DB_DATA_TYPE_MEMO: - if (colDefs[columnIndex].Null) - colDefs[columnIndex].CbValue = SQL_NULL_DATA; - else - colDefs[columnIndex].CbValue = SQL_NTS; - break; - case DB_DATA_TYPE_INTEGER: - if (colDefs[columnIndex].Null) - colDefs[columnIndex].CbValue = SQL_NULL_DATA; - else - colDefs[columnIndex].CbValue = 0; - break; - case DB_DATA_TYPE_FLOAT: - if (colDefs[columnIndex].Null) - colDefs[columnIndex].CbValue = SQL_NULL_DATA; - else - colDefs[columnIndex].CbValue = 0; - break; - case DB_DATA_TYPE_DATE: - if (colDefs[columnIndex].Null) - colDefs[columnIndex].CbValue = SQL_NULL_DATA; - else - colDefs[columnIndex].CbValue = 0; - break; - case DB_DATA_TYPE_BLOB: - if (colDefs[columnIndex].Null) - colDefs[columnIndex].CbValue = SQL_NULL_DATA; - else - if (colDefs[columnIndex].SqlCtype == SQL_C_WXCHAR) - colDefs[columnIndex].CbValue = SQL_NTS; - else - colDefs[columnIndex].CbValue = SQL_LEN_DATA_AT_EXEC(colDefs[columnIndex].SzDataObj); - break; - } -} - -/********** wxDbTable::bindParams() **********/ -bool wxDbTable::bindParams(bool forUpdate) -{ - wxASSERT(!queryOnly); - if (queryOnly) - return false; - - SWORD fSqlType = 0; - SDWORD precision = 0; - SWORD scale = 0; - - // Bind each column of the table that should be bound - // to a parameter marker - int i; - UWORD colNumber; - - for (i=0, colNumber=1; i < m_numCols; i++) - { - if (forUpdate) - { - if (!colDefs[i].Updateable) - continue; - } - else - { - if (!colDefs[i].InsertAllowed) - continue; - } - - switch(colDefs[i].DbDataType) - { - case DB_DATA_TYPE_VARCHAR: - fSqlType = pDb->GetTypeInfVarchar().FsqlType; - precision = colDefs[i].SzDataObj; - scale = 0; - break; - case DB_DATA_TYPE_MEMO: - fSqlType = pDb->GetTypeInfMemo().FsqlType; - precision = colDefs[i].SzDataObj; - scale = 0; - break; - case DB_DATA_TYPE_INTEGER: - fSqlType = pDb->GetTypeInfInteger().FsqlType; - precision = pDb->GetTypeInfInteger().Precision; - scale = 0; - break; - case DB_DATA_TYPE_FLOAT: - fSqlType = pDb->GetTypeInfFloat().FsqlType; - precision = pDb->GetTypeInfFloat().Precision; - scale = pDb->GetTypeInfFloat().MaximumScale; - // SQL Sybase Anywhere v5.5 returned a negative number for the - // MaxScale. This caused ODBC to kick out an error on ibscale. - // I check for this here and set the scale = precision. - //if (scale < 0) - // scale = (short) precision; - break; - case DB_DATA_TYPE_DATE: - fSqlType = pDb->GetTypeInfDate().FsqlType; - precision = pDb->GetTypeInfDate().Precision; - scale = 0; - break; - case DB_DATA_TYPE_BLOB: - fSqlType = pDb->GetTypeInfBlob().FsqlType; - precision = colDefs[i].SzDataObj; - scale = 0; - break; - } - - setCbValueForColumn(i); - - if (forUpdate) - { - if (SQLBindParameter(hstmtUpdate, colNumber++, SQL_PARAM_INPUT, colDefs[i].SqlCtype, - fSqlType, precision, scale, (UCHAR*) colDefs[i].PtrDataObj, - precision+1, &colDefs[i].CbValue) != SQL_SUCCESS) - { - return(pDb->DispAllErrors(henv, hdbc, hstmtUpdate)); - } - } - else - { - if (SQLBindParameter(hstmtInsert, colNumber++, SQL_PARAM_INPUT, colDefs[i].SqlCtype, - fSqlType, precision, scale, (UCHAR*) colDefs[i].PtrDataObj, - precision+1, &colDefs[i].CbValue) != SQL_SUCCESS) - { - return(pDb->DispAllErrors(henv, hdbc, hstmtInsert)); - } - } - } - - // Completed successfully - return true; - -} // wxDbTable::bindParams() - - -/********** wxDbTable::bindInsertParams() **********/ -bool wxDbTable::bindInsertParams(void) -{ - return bindParams(false); -} // wxDbTable::bindInsertParams() - - -/********** wxDbTable::bindUpdateParams() **********/ -bool wxDbTable::bindUpdateParams(void) -{ - return bindParams(true); -} // wxDbTable::bindUpdateParams() - - -/********** wxDbTable::bindCols() **********/ -bool wxDbTable::bindCols(HSTMT cursor) -{ - // Bind each column of the table to a memory address for fetching data - UWORD i; - for (i = 0; i < m_numCols; i++) - { - if (SQLBindCol(cursor, (UWORD)(i+1), colDefs[i].SqlCtype, (UCHAR*) colDefs[i].PtrDataObj, - colDefs[i].SzDataObj, &colDefs[i].CbValue ) != SQL_SUCCESS) - return (pDb->DispAllErrors(henv, hdbc, cursor)); - } - - // Completed successfully - return true; -} // wxDbTable::bindCols() - - -/********** wxDbTable::getRec() **********/ -bool wxDbTable::getRec(UWORD fetchType) -{ - RETCODE retcode; - - if (!pDb->FwdOnlyCursors()) - { - // Fetch the NEXT, PREV, FIRST or LAST record, depending on fetchType - SQLULEN cRowsFetched; - UWORD rowStatus; - - retcode = SQLExtendedFetch(hstmt, fetchType, 0, &cRowsFetched, &rowStatus); - if (retcode != SQL_SUCCESS && retcode != SQL_SUCCESS_WITH_INFO) - { - if (retcode == SQL_NO_DATA_FOUND) - return false; - else - return(pDb->DispAllErrors(henv, hdbc, hstmt)); - } - else - { - // Set the Null member variable to indicate the Null state - // of each column just read in. - int i; - for (i = 0; i < m_numCols; i++) - colDefs[i].Null = (colDefs[i].CbValue == SQL_NULL_DATA); - } - } - else - { - // Fetch the next record from the record set - retcode = SQLFetch(hstmt); - if (retcode != SQL_SUCCESS && retcode != SQL_SUCCESS_WITH_INFO) - { - if (retcode == SQL_NO_DATA_FOUND) - return false; - else - return(pDb->DispAllErrors(henv, hdbc, hstmt)); - } - else - { - // Set the Null member variable to indicate the Null state - // of each column just read in. - int i; - for (i = 0; i < m_numCols; i++) - colDefs[i].Null = (colDefs[i].CbValue == SQL_NULL_DATA); - } - } - - // Completed successfully - return true; - -} // wxDbTable::getRec() - - -/********** wxDbTable::execDelete() **********/ -bool wxDbTable::execDelete(const wxString &pSqlStmt) -{ - RETCODE retcode; - - // Execute the DELETE statement - retcode = SQLExecDirect(hstmtDelete, (SQLTCHAR FAR *) pSqlStmt.c_str(), SQL_NTS); - - if (retcode == SQL_SUCCESS || - retcode == SQL_NO_DATA_FOUND || - retcode == SQL_SUCCESS_WITH_INFO) - { - // Record deleted successfully - return true; - } - - // Problem deleting record - return(pDb->DispAllErrors(henv, hdbc, hstmtDelete)); - -} // wxDbTable::execDelete() - - -/********** wxDbTable::execUpdate() **********/ -bool wxDbTable::execUpdate(const wxString &pSqlStmt) -{ - RETCODE retcode; - - // Execute the UPDATE statement - retcode = SQLExecDirect(hstmtUpdate, (SQLTCHAR FAR *) pSqlStmt.c_str(), SQL_NTS); - - if (retcode == SQL_SUCCESS || - retcode == SQL_NO_DATA_FOUND || - retcode == SQL_SUCCESS_WITH_INFO) - { - // Record updated successfully - return true; - } - else if (retcode == SQL_NEED_DATA) - { - PTR pParmID; - retcode = SQLParamData(hstmtUpdate, &pParmID); - while (retcode == SQL_NEED_DATA) - { - // Find the parameter - int i; - for (i=0; i < m_numCols; i++) - { - if (colDefs[i].PtrDataObj == pParmID) - { - // We found it. Store the parameter. - retcode = SQLPutData(hstmtUpdate, pParmID, colDefs[i].SzDataObj); - if (retcode != SQL_SUCCESS) - { - pDb->DispNextError(); - return pDb->DispAllErrors(henv, hdbc, hstmtUpdate); - } - break; - } - } - retcode = SQLParamData(hstmtUpdate, &pParmID); - } - if (retcode == SQL_SUCCESS || - retcode == SQL_NO_DATA_FOUND || - retcode == SQL_SUCCESS_WITH_INFO) - { - // Record updated successfully - return true; - } - } - - // Problem updating record - return(pDb->DispAllErrors(henv, hdbc, hstmtUpdate)); - -} // wxDbTable::execUpdate() - - -/********** wxDbTable::query() **********/ -bool wxDbTable::query(int queryType, bool forUpdate, bool distinct, const wxString &pSqlStmt) -{ - wxString sqlStmt; - - if (forUpdate) - // The user may wish to select for update, but the DBMS may not be capable - selectForUpdate = CanSelectForUpdate(); - else - selectForUpdate = false; - - // Set the SQL SELECT string - if (queryType != DB_SELECT_STATEMENT) // A select statement was not passed in, - { // so generate a select statement. - BuildSelectStmt(sqlStmt, queryType, distinct); - pDb->WriteSqlLog(sqlStmt); - } - - // Make sure the cursor is closed first - if (!CloseCursor(hstmt)) - return false; - - // Execute the SQL SELECT statement - int retcode; - retcode = SQLExecDirect(hstmt, (SQLTCHAR FAR *) (queryType == DB_SELECT_STATEMENT ? pSqlStmt.c_str() : sqlStmt.c_str()), SQL_NTS); - if (retcode != SQL_SUCCESS && retcode != SQL_SUCCESS_WITH_INFO) - return(pDb->DispAllErrors(henv, hdbc, hstmt)); - - // Completed successfully - return true; - -} // wxDbTable::query() - - -/***************************** PUBLIC FUNCTIONS *****************************/ - - -/********** wxDbTable::Open() **********/ -bool wxDbTable::Open(bool checkPrivileges, bool checkTableExists) -{ - if (!pDb) - return false; - - int i; - wxString sqlStmt; - wxString s; - - // Calculate the maximum size of the concatenated - // keys for use with wxDbGrid - m_keysize = 0; - for (i=0; i < m_numCols; i++) - { - if (colDefs[i].KeyField) - { - m_keysize += colDefs[i].SzDataObj; - } - } - - s.Empty(); - - bool exists = true; - if (checkTableExists) - { - if (pDb->Dbms() == dbmsPOSTGRES) - exists = pDb->TableExists(tableName, NULL, tablePath); - else - exists = pDb->TableExists(tableName, pDb->GetUsername(), tablePath); - } - - // Verify that the table exists in the database - if (!exists) - { - s = wxT("Table/view does not exist in the database"); - if ( *(pDb->dbInf.accessibleTables) == wxT('Y')) - s += wxT(", or you have no permissions.\n"); - else - s += wxT(".\n"); - } - else if (checkPrivileges) - { - // Verify the user has rights to access the table. - bool hasPrivs wxDUMMY_INITIALIZE(true); - - if (pDb->Dbms() == dbmsPOSTGRES) - hasPrivs = pDb->TablePrivileges(tableName, wxT("SELECT"), pDb->GetUsername(), NULL, tablePath); - else - hasPrivs = pDb->TablePrivileges(tableName, wxT("SELECT"), pDb->GetUsername(), pDb->GetUsername(), tablePath); - - if (!hasPrivs) - s = wxT("Connecting user does not have sufficient privileges to access this table.\n"); - } - - if (!s.empty()) - { - wxString p; - - if (!tablePath.empty()) - p.Printf(wxT("Error opening '%s/%s'.\n"),tablePath.c_str(),tableName.c_str()); - else - p.Printf(wxT("Error opening '%s'.\n"), tableName.c_str()); - - p += s; - pDb->LogError(p.GetData()); - - return false; - } - - // Bind the member variables for field exchange between - // the wxDbTable object and the ODBC record. - if (!queryOnly) - { - if (!bindInsertParams()) // Inserts - return false; - - if (!bindUpdateParams()) // Updates - return false; - } - - if (!bindCols(*hstmtDefault)) // Selects - return false; - - if (!bindCols(hstmtInternal)) // Internal use only - return false; - - /* - * Do NOT bind the hstmtCount cursor!!! - */ - - // Build an insert statement using parameter markers - if (!queryOnly && m_numCols > 0) - { - bool needComma = false; - sqlStmt.Printf(wxT("INSERT INTO %s ("), - pDb->SQLTableName(tableName.c_str()).c_str()); - for (i = 0; i < m_numCols; i++) - { - if (! colDefs[i].InsertAllowed) - continue; - if (needComma) - sqlStmt += wxT(","); - sqlStmt += pDb->SQLColumnName(colDefs[i].ColName); - needComma = true; - } - needComma = false; - sqlStmt += wxT(") VALUES ("); - - int insertableCount = 0; - - for (i = 0; i < m_numCols; i++) - { - if (! colDefs[i].InsertAllowed) - continue; - if (needComma) - sqlStmt += wxT(","); - sqlStmt += wxT("?"); - needComma = true; - insertableCount++; - } - sqlStmt += wxT(")"); - - // Prepare the insert statement for execution - if (insertableCount) - { - if (SQLPrepare(hstmtInsert, (SQLTCHAR FAR *) sqlStmt.c_str(), SQL_NTS) != SQL_SUCCESS) - return(pDb->DispAllErrors(henv, hdbc, hstmtInsert)); - } - else - insertable = false; - } - - // Completed successfully - return true; - -} // wxDbTable::Open() - - -/********** wxDbTable::Query() **********/ -bool wxDbTable::Query(bool forUpdate, bool distinct) -{ - - return(query(DB_SELECT_WHERE, forUpdate, distinct)); - -} // wxDbTable::Query() - - -/********** wxDbTable::QueryBySqlStmt() **********/ -bool wxDbTable::QueryBySqlStmt(const wxString &pSqlStmt) -{ - pDb->WriteSqlLog(pSqlStmt); - - return(query(DB_SELECT_STATEMENT, false, false, pSqlStmt)); - -} // wxDbTable::QueryBySqlStmt() - - -/********** wxDbTable::QueryMatching() **********/ -bool wxDbTable::QueryMatching(bool forUpdate, bool distinct) -{ - - return(query(DB_SELECT_MATCHING, forUpdate, distinct)); - -} // wxDbTable::QueryMatching() - - -/********** wxDbTable::QueryOnKeyFields() **********/ -bool wxDbTable::QueryOnKeyFields(bool forUpdate, bool distinct) -{ - - return(query(DB_SELECT_KEYFIELDS, forUpdate, distinct)); - -} // wxDbTable::QueryOnKeyFields() - - -/********** wxDbTable::GetPrev() **********/ -bool wxDbTable::GetPrev(void) -{ - if (pDb->FwdOnlyCursors()) - { - wxFAIL_MSG(wxT("GetPrev()::Backward scrolling cursors are not enabled for this instance of wxDbTable")); - return false; - } - else - return(getRec(SQL_FETCH_PRIOR)); - -} // wxDbTable::GetPrev() - - -/********** wxDbTable::operator-- **********/ -bool wxDbTable::operator--(int) -{ - if (pDb->FwdOnlyCursors()) - { - wxFAIL_MSG(wxT("operator--:Backward scrolling cursors are not enabled for this instance of wxDbTable")); - return false; - } - else - return(getRec(SQL_FETCH_PRIOR)); - -} // wxDbTable::operator-- - - -/********** wxDbTable::GetFirst() **********/ -bool wxDbTable::GetFirst(void) -{ - if (pDb->FwdOnlyCursors()) - { - wxFAIL_MSG(wxT("GetFirst():Backward scrolling cursors are not enabled for this instance of wxDbTable")); - return false; - } - else - return(getRec(SQL_FETCH_FIRST)); - -} // wxDbTable::GetFirst() - - -/********** wxDbTable::GetLast() **********/ -bool wxDbTable::GetLast(void) -{ - if (pDb->FwdOnlyCursors()) - { - wxFAIL_MSG(wxT("GetLast()::Backward scrolling cursors are not enabled for this instance of wxDbTable")); - return false; - } - else - return(getRec(SQL_FETCH_LAST)); - -} // wxDbTable::GetLast() - - -/********** wxDbTable::BuildDeleteStmt() **********/ -void wxDbTable::BuildDeleteStmt(wxString &pSqlStmt, int typeOfDel, const wxString &pWhereClause) -{ - wxASSERT(!queryOnly); - if (queryOnly) - return; - - wxString whereClause; - - whereClause.Empty(); - - // Handle the case of DeleteWhere() and the where clause is blank. It should - // delete all records from the database in this case. - if (typeOfDel == DB_DEL_WHERE && (pWhereClause.length() == 0)) - { - pSqlStmt.Printf(wxT("DELETE FROM %s"), - pDb->SQLTableName(tableName.c_str()).c_str()); - return; - } - - pSqlStmt.Printf(wxT("DELETE FROM %s WHERE "), - pDb->SQLTableName(tableName.c_str()).c_str()); - - // Append the WHERE clause to the SQL DELETE statement - switch(typeOfDel) - { - case DB_DEL_KEYFIELDS: - // If the datasource supports the ROWID column, build - // the where on ROWID for efficiency purposes. - // e.g. DELETE FROM PARTS WHERE ROWID = '111.222.333' - if (CanUpdateByROWID()) - { - SQLLEN cb; - wxChar rowid[wxDB_ROWID_LEN+1]; - - // Get the ROWID value. If not successful retreiving the ROWID, - // simply fall down through the code and build the WHERE clause - // based on the key fields. - if (SQLGetData(hstmt, (UWORD)(m_numCols+1), SQL_C_WXCHAR, (UCHAR*) rowid, sizeof(rowid), &cb) == SQL_SUCCESS) - { - pSqlStmt += wxT("ROWID = '"); - pSqlStmt += rowid; - pSqlStmt += wxT("'"); - break; - } - } - // Unable to delete by ROWID, so build a WHERE - // clause based on the keyfields. - BuildWhereClause(whereClause, DB_WHERE_KEYFIELDS); - pSqlStmt += whereClause; - break; - case DB_DEL_WHERE: - pSqlStmt += pWhereClause; - break; - case DB_DEL_MATCHING: - BuildWhereClause(whereClause, DB_WHERE_MATCHING); - pSqlStmt += whereClause; - break; - } - -} // BuildDeleteStmt() - - -/***** DEPRECATED: use wxDbTable::BuildDeleteStmt(wxString &....) form *****/ -void wxDbTable::BuildDeleteStmt(wxChar *pSqlStmt, int typeOfDel, const wxString &pWhereClause) -{ - wxString tempSqlStmt; - BuildDeleteStmt(tempSqlStmt, typeOfDel, pWhereClause); - wxStrcpy(pSqlStmt, tempSqlStmt); -} // wxDbTable::BuildDeleteStmt() - - -/********** wxDbTable::BuildSelectStmt() **********/ -void wxDbTable::BuildSelectStmt(wxString &pSqlStmt, int typeOfSelect, bool distinct) -{ - wxString whereClause; - whereClause.Empty(); - - // Build a select statement to query the database - pSqlStmt = wxT("SELECT "); - - // SELECT DISTINCT values only? - if (distinct) - pSqlStmt += wxT("DISTINCT "); - - // Was a FROM clause specified to join tables to the base table? - // Available for ::Query() only!!! - bool appendFromClause = false; -#if wxODBC_BACKWARD_COMPATABILITY - if (typeOfSelect == DB_SELECT_WHERE && from && wxStrlen(from)) - appendFromClause = true; -#else - if (typeOfSelect == DB_SELECT_WHERE && from.length()) - appendFromClause = true; -#endif - - // Add the column list - int i; - wxString tStr; - for (i = 0; i < m_numCols; i++) - { - tStr = colDefs[i].ColName; - // If joining tables, the base table column names must be qualified to avoid ambiguity - if ((appendFromClause || pDb->Dbms() == dbmsACCESS) && tStr.Find(wxT('.')) == wxNOT_FOUND) - { - pSqlStmt += pDb->SQLTableName(queryTableName.c_str()); - pSqlStmt += wxT("."); - } - pSqlStmt += pDb->SQLColumnName(colDefs[i].ColName); - if (i + 1 < m_numCols) - pSqlStmt += wxT(","); - } - - // If the datasource supports ROWID, get this column as well. Exception: Don't retrieve - // the ROWID if querying distinct records. The rowid will always be unique. - if (!distinct && CanUpdateByROWID()) - { - // If joining tables, the base table column names must be qualified to avoid ambiguity - if (appendFromClause || pDb->Dbms() == dbmsACCESS) - { - pSqlStmt += wxT(","); - pSqlStmt += pDb->SQLTableName(queryTableName); - pSqlStmt += wxT(".ROWID"); - } - else - pSqlStmt += wxT(",ROWID"); - } - - // Append the FROM tablename portion - pSqlStmt += wxT(" FROM "); - pSqlStmt += pDb->SQLTableName(queryTableName); -// pSqlStmt += queryTableName; - - // Sybase uses the HOLDLOCK keyword to lock a record during query. - // The HOLDLOCK keyword follows the table name in the from clause. - // Each table in the from clause must specify HOLDLOCK or - // NOHOLDLOCK (the default). Note: The "FOR UPDATE" clause - // is parsed but ignored in SYBASE Transact-SQL. - if (selectForUpdate && (pDb->Dbms() == dbmsSYBASE_ASA || pDb->Dbms() == dbmsSYBASE_ASE)) - pSqlStmt += wxT(" HOLDLOCK"); - - if (appendFromClause) - pSqlStmt += from; - - // Append the WHERE clause. Either append the where clause for the class - // or build a where clause. The typeOfSelect determines this. - switch(typeOfSelect) - { - case DB_SELECT_WHERE: -#if wxODBC_BACKWARD_COMPATABILITY - if (where && wxStrlen(where)) // May not want a where clause!!! -#else - if (where.length()) // May not want a where clause!!! -#endif - { - pSqlStmt += wxT(" WHERE "); - pSqlStmt += where; - } - break; - case DB_SELECT_KEYFIELDS: - BuildWhereClause(whereClause, DB_WHERE_KEYFIELDS); - if (whereClause.length()) - { - pSqlStmt += wxT(" WHERE "); - pSqlStmt += whereClause; - } - break; - case DB_SELECT_MATCHING: - BuildWhereClause(whereClause, DB_WHERE_MATCHING); - if (whereClause.length()) - { - pSqlStmt += wxT(" WHERE "); - pSqlStmt += whereClause; - } - break; - } - - // Append the ORDER BY clause -#if wxODBC_BACKWARD_COMPATABILITY - if (orderBy && wxStrlen(orderBy)) -#else - if (orderBy.length()) -#endif - { - pSqlStmt += wxT(" ORDER BY "); - pSqlStmt += orderBy; - } - - // SELECT FOR UPDATE if told to do so and the datasource is capable. Sybase - // parses the FOR UPDATE clause but ignores it. See the comment above on the - // HOLDLOCK for Sybase. - if (selectForUpdate && CanSelectForUpdate()) - pSqlStmt += wxT(" FOR UPDATE"); - -} // wxDbTable::BuildSelectStmt() - - -/***** DEPRECATED: use wxDbTable::BuildSelectStmt(wxString &....) form *****/ -void wxDbTable::BuildSelectStmt(wxChar *pSqlStmt, int typeOfSelect, bool distinct) -{ - wxString tempSqlStmt; - BuildSelectStmt(tempSqlStmt, typeOfSelect, distinct); - wxStrcpy(pSqlStmt, tempSqlStmt); -} // wxDbTable::BuildSelectStmt() - - -/********** wxDbTable::BuildUpdateStmt() **********/ -void wxDbTable::BuildUpdateStmt(wxString &pSqlStmt, int typeOfUpdate, const wxString &pWhereClause) -{ - wxASSERT(!queryOnly); - if (queryOnly) - return; - - wxString whereClause; - whereClause.Empty(); - - bool firstColumn = true; - - pSqlStmt.Printf(wxT("UPDATE %s SET "), - pDb->SQLTableName(tableName.c_str()).c_str()); - - // Append a list of columns to be updated - int i; - for (i = 0; i < m_numCols; i++) - { - // Only append Updateable columns - if (colDefs[i].Updateable) - { - if (!firstColumn) - pSqlStmt += wxT(","); - else - firstColumn = false; - - pSqlStmt += pDb->SQLColumnName(colDefs[i].ColName); -// pSqlStmt += colDefs[i].ColName; - pSqlStmt += wxT(" = ?"); - } - } - - // Append the WHERE clause to the SQL UPDATE statement - pSqlStmt += wxT(" WHERE "); - switch(typeOfUpdate) - { - case DB_UPD_KEYFIELDS: - // If the datasource supports the ROWID column, build - // the where on ROWID for efficiency purposes. - // e.g. UPDATE PARTS SET Col1 = ?, Col2 = ? WHERE ROWID = '111.222.333' - if (CanUpdateByROWID()) - { - SQLLEN cb; - wxChar rowid[wxDB_ROWID_LEN+1]; - - // Get the ROWID value. If not successful retreiving the ROWID, - // simply fall down through the code and build the WHERE clause - // based on the key fields. - if (SQLGetData(hstmt, (UWORD)(m_numCols+1), SQL_C_WXCHAR, (UCHAR*) rowid, sizeof(rowid), &cb) == SQL_SUCCESS) - { - pSqlStmt += wxT("ROWID = '"); - pSqlStmt += rowid; - pSqlStmt += wxT("'"); - break; - } - } - // Unable to delete by ROWID, so build a WHERE - // clause based on the keyfields. - BuildWhereClause(whereClause, DB_WHERE_KEYFIELDS); - pSqlStmt += whereClause; - break; - case DB_UPD_WHERE: - pSqlStmt += pWhereClause; - break; - } -} // BuildUpdateStmt() - - -/***** DEPRECATED: use wxDbTable::BuildUpdateStmt(wxString &....) form *****/ -void wxDbTable::BuildUpdateStmt(wxChar *pSqlStmt, int typeOfUpdate, const wxString &pWhereClause) -{ - wxString tempSqlStmt; - BuildUpdateStmt(tempSqlStmt, typeOfUpdate, pWhereClause); - wxStrcpy(pSqlStmt, tempSqlStmt); -} // BuildUpdateStmt() - - -/********** wxDbTable::BuildWhereClause() **********/ -void wxDbTable::BuildWhereClause(wxString &pWhereClause, int typeOfWhere, - const wxString &qualTableName, bool useLikeComparison) -/* - * Note: BuildWhereClause() currently ignores timestamp columns. - * They are not included as part of the where clause. - */ -{ - bool moreThanOneColumn = false; - wxString colValue; - - // Loop through the columns building a where clause as you go - int colNumber; - for (colNumber = 0; colNumber < m_numCols; colNumber++) - { - // Determine if this column should be included in the WHERE clause - if ((typeOfWhere == DB_WHERE_KEYFIELDS && colDefs[colNumber].KeyField) || - (typeOfWhere == DB_WHERE_MATCHING && (!IsColNull((UWORD)colNumber)))) - { - // Skip over timestamp columns - if (colDefs[colNumber].SqlCtype == SQL_C_TIMESTAMP) - continue; - // If there is more than 1 column, join them with the keyword "AND" - if (moreThanOneColumn) - pWhereClause += wxT(" AND "); - else - moreThanOneColumn = true; - - // Concatenate where phrase for the column - wxString tStr = colDefs[colNumber].ColName; - - if (qualTableName.length() && tStr.Find(wxT('.')) == wxNOT_FOUND) - { - pWhereClause += pDb->SQLTableName(qualTableName); - pWhereClause += wxT("."); - } - pWhereClause += pDb->SQLColumnName(colDefs[colNumber].ColName); - - if (useLikeComparison && (colDefs[colNumber].SqlCtype == SQL_C_WXCHAR)) - pWhereClause += wxT(" LIKE "); - else - pWhereClause += wxT(" = "); - - switch(colDefs[colNumber].SqlCtype) - { - case SQL_C_CHAR: -#ifdef SQL_C_WCHAR - case SQL_C_WCHAR: -#endif - //case SQL_C_WXCHAR: SQL_C_WXCHAR is covered by either SQL_C_CHAR or SQL_C_WCHAR - colValue.Printf(wxT("'%s'"), GetDb()->EscapeSqlChars((wxChar *)colDefs[colNumber].PtrDataObj).c_str()); - break; - case SQL_C_SHORT: - case SQL_C_SSHORT: - colValue.Printf(wxT("%hi"), *((SWORD *) colDefs[colNumber].PtrDataObj)); - break; - case SQL_C_USHORT: - colValue.Printf(wxT("%hu"), *((UWORD *) colDefs[colNumber].PtrDataObj)); - break; - case SQL_C_LONG: - case SQL_C_SLONG: - colValue.Printf(wxT("%li"), *((SDWORD *) colDefs[colNumber].PtrDataObj)); - break; - case SQL_C_ULONG: - colValue.Printf(wxT("%lu"), *((UDWORD *) colDefs[colNumber].PtrDataObj)); - break; - case SQL_C_FLOAT: - colValue.Printf(wxT("%.6f"), *((SFLOAT *) colDefs[colNumber].PtrDataObj)); - break; - case SQL_C_DOUBLE: - colValue.Printf(wxT("%.6f"), *((SDOUBLE *) colDefs[colNumber].PtrDataObj)); - break; - default: - { - wxString strMsg; - strMsg.Printf(wxT("wxDbTable::bindParams(): Unknown column type for colDefs %d colName %s"), - colNumber,colDefs[colNumber].ColName); - wxFAIL_MSG(strMsg.c_str()); - } - break; - } - pWhereClause += colValue; - } - } -} // wxDbTable::BuildWhereClause() - - -/***** DEPRECATED: use wxDbTable::BuildWhereClause(wxString &....) form *****/ -void wxDbTable::BuildWhereClause(wxChar *pWhereClause, int typeOfWhere, - const wxString &qualTableName, bool useLikeComparison) -{ - wxString tempSqlStmt; - BuildWhereClause(tempSqlStmt, typeOfWhere, qualTableName, useLikeComparison); - wxStrcpy(pWhereClause, tempSqlStmt); -} // wxDbTable::BuildWhereClause() - - -/********** wxDbTable::GetRowNum() **********/ -UWORD wxDbTable::GetRowNum(void) -{ - UDWORD rowNum; - - if (SQLGetStmtOption(hstmt, SQL_ROW_NUMBER, (UCHAR*) &rowNum) != SQL_SUCCESS) - { - pDb->DispAllErrors(henv, hdbc, hstmt); - return(0); - } - - // Completed successfully - return((UWORD) rowNum); - -} // wxDbTable::GetRowNum() - - -/********** wxDbTable::CloseCursor() **********/ -bool wxDbTable::CloseCursor(HSTMT cursor) -{ - if (SQLFreeStmt(cursor, SQL_CLOSE) != SQL_SUCCESS) - return(pDb->DispAllErrors(henv, hdbc, cursor)); - - // Completed successfully - return true; - -} // wxDbTable::CloseCursor() - - -/********** wxDbTable::CreateTable() **********/ -bool wxDbTable::CreateTable(bool attemptDrop) -{ - if (!pDb) - return false; - - int i, j; - wxString sqlStmt; - -#ifdef DBDEBUG_CONSOLE - cout << wxT("Creating Table ") << tableName << wxT("...") << endl; -#endif - - // Drop table first - if (attemptDrop && !DropTable()) - return false; - - // Create the table -#ifdef DBDEBUG_CONSOLE - for (i = 0; i < m_numCols; i++) - { - // Exclude derived columns since they are NOT part of the base table - if (colDefs[i].DerivedCol) - continue; - cout << i + 1 << wxT(": ") << colDefs[i].ColName << wxT("; "); - switch(colDefs[i].DbDataType) - { - case DB_DATA_TYPE_VARCHAR: - cout << pDb->GetTypeInfVarchar().TypeName << wxT("(") << (int)(colDefs[i].SzDataObj / sizeof(wxChar)) << wxT(")"); - break; - case DB_DATA_TYPE_MEMO: - cout << pDb->GetTypeInfMemo().TypeName; - break; - case DB_DATA_TYPE_INTEGER: - cout << pDb->GetTypeInfInteger().TypeName; - break; - case DB_DATA_TYPE_FLOAT: - cout << pDb->GetTypeInfFloat().TypeName; - break; - case DB_DATA_TYPE_DATE: - cout << pDb->GetTypeInfDate().TypeName; - break; - case DB_DATA_TYPE_BLOB: - cout << pDb->GetTypeInfBlob().TypeName; - break; - } - cout << endl; - } -#endif - - // Build a CREATE TABLE string from the colDefs structure. - bool needComma = false; - - sqlStmt.Printf(wxT("CREATE TABLE %s ("), - pDb->SQLTableName(tableName.c_str()).c_str()); - - for (i = 0; i < m_numCols; i++) - { - // Exclude derived columns since they are NOT part of the base table - if (colDefs[i].DerivedCol) - continue; - // Comma Delimiter - if (needComma) - sqlStmt += wxT(","); - // Column Name - sqlStmt += pDb->SQLColumnName(colDefs[i].ColName); -// sqlStmt += colDefs[i].ColName; - sqlStmt += wxT(" "); - // Column Type - switch(colDefs[i].DbDataType) - { - case DB_DATA_TYPE_VARCHAR: - sqlStmt += pDb->GetTypeInfVarchar().TypeName; - break; - case DB_DATA_TYPE_MEMO: - sqlStmt += pDb->GetTypeInfMemo().TypeName; - break; - case DB_DATA_TYPE_INTEGER: - sqlStmt += pDb->GetTypeInfInteger().TypeName; - break; - case DB_DATA_TYPE_FLOAT: - sqlStmt += pDb->GetTypeInfFloat().TypeName; - break; - case DB_DATA_TYPE_DATE: - sqlStmt += pDb->GetTypeInfDate().TypeName; - break; - case DB_DATA_TYPE_BLOB: - sqlStmt += pDb->GetTypeInfBlob().TypeName; - break; - } - // For varchars, append the size of the string - if (colDefs[i].DbDataType == DB_DATA_TYPE_VARCHAR && - (pDb->Dbms() != dbmsMY_SQL || pDb->GetTypeInfVarchar().TypeName != _T("text")))// || -// colDefs[i].DbDataType == DB_DATA_TYPE_BLOB) - { - wxString s; - s.Printf(wxT("(%d)"), (int)(colDefs[i].SzDataObj / sizeof(wxChar))); - sqlStmt += s; - } - - if (pDb->Dbms() == dbmsDB2 || - pDb->Dbms() == dbmsMY_SQL || - pDb->Dbms() == dbmsSYBASE_ASE || - pDb->Dbms() == dbmsINTERBASE || - pDb->Dbms() == dbmsFIREBIRD || - pDb->Dbms() == dbmsMS_SQL_SERVER) - { - if (colDefs[i].KeyField) - { - sqlStmt += wxT(" NOT NULL"); - } - } - - needComma = true; - } - // If there is a primary key defined, include it in the create statement - for (i = j = 0; i < m_numCols; i++) - { - if (colDefs[i].KeyField) - { - j++; - break; - } - } - if ( j && (pDb->Dbms() != dbmsDBASE) - && (pDb->Dbms() != dbmsXBASE_SEQUITER) ) // Found a keyfield - { - switch (pDb->Dbms()) - { - case dbmsACCESS: - case dbmsINFORMIX: - case dbmsSYBASE_ASA: - case dbmsSYBASE_ASE: - case dbmsMY_SQL: - case dbmsFIREBIRD: - { - // MySQL goes out on this one. We also declare the relevant key NON NULL above - sqlStmt += wxT(",PRIMARY KEY ("); - break; - } - default: - { - sqlStmt += wxT(",CONSTRAINT "); - // DB2 is limited to 18 characters for index names - if (pDb->Dbms() == dbmsDB2) - { - wxASSERT_MSG((tableName && wxStrlen(tableName) <= 13), wxT("DB2 table/index names must be no longer than 13 characters in length.\n\nTruncating table name to 13 characters.")); - sqlStmt += pDb->SQLTableName(tableName.substr(0, 13).c_str()); -// sqlStmt += tableName.substr(0, 13); - } - else - sqlStmt += pDb->SQLTableName(tableName.c_str()); -// sqlStmt += tableName; - - sqlStmt += wxT("_PIDX PRIMARY KEY ("); - break; - } - } - - // List column name(s) of column(s) comprising the primary key - for (i = j = 0; i < m_numCols; i++) - { - if (colDefs[i].KeyField) - { - if (j++) // Multi part key, comma separate names - sqlStmt += wxT(","); - sqlStmt += pDb->SQLColumnName(colDefs[i].ColName); - - if (pDb->Dbms() == dbmsMY_SQL && - colDefs[i].DbDataType == DB_DATA_TYPE_VARCHAR) - { - wxString s; - s.Printf(wxT("(%d)"), (int)(colDefs[i].SzDataObj / sizeof(wxChar))); - sqlStmt += s; - } - } - } - sqlStmt += wxT(")"); - - if (pDb->Dbms() == dbmsINFORMIX || - pDb->Dbms() == dbmsSYBASE_ASA || - pDb->Dbms() == dbmsSYBASE_ASE) - { - sqlStmt += wxT(" CONSTRAINT "); - sqlStmt += pDb->SQLTableName(tableName); -// sqlStmt += tableName; - sqlStmt += wxT("_PIDX"); - } - } - // Append the closing parentheses for the create table statement - sqlStmt += wxT(")"); - - pDb->WriteSqlLog(sqlStmt); - -#ifdef DBDEBUG_CONSOLE - cout << endl << sqlStmt.c_str() << endl; -#endif - - // Execute the CREATE TABLE statement - RETCODE retcode = SQLExecDirect(hstmt, (SQLTCHAR FAR *) sqlStmt.c_str(), SQL_NTS); - if (retcode != SQL_SUCCESS && retcode != SQL_SUCCESS_WITH_INFO) - { - pDb->DispAllErrors(henv, hdbc, hstmt); - pDb->RollbackTrans(); - CloseCursor(hstmt); - return false; - } - - // Commit the transaction and close the cursor - if (!pDb->CommitTrans()) - return false; - if (!CloseCursor(hstmt)) - return false; - - // Database table created successfully - return true; - -} // wxDbTable::CreateTable() - - -/********** wxDbTable::DropTable() **********/ -bool wxDbTable::DropTable() -{ - // NOTE: This function returns true if the Table does not exist, but - // only for identified databases. Code will need to be added - // below for any other databases when those databases are defined - // to handle this situation consistently - - wxString sqlStmt; - - sqlStmt.Printf(wxT("DROP TABLE %s"), - pDb->SQLTableName(tableName.c_str()).c_str()); - - pDb->WriteSqlLog(sqlStmt); - -#ifdef DBDEBUG_CONSOLE - cout << endl << sqlStmt.c_str() << endl; -#endif - - RETCODE retcode = SQLExecDirect(hstmt, (SQLTCHAR FAR *) sqlStmt.c_str(), SQL_NTS); - if (retcode != SQL_SUCCESS) - { - // Check for "Base table not found" error and ignore - pDb->GetNextError(henv, hdbc, hstmt); - if (wxStrcmp(pDb->sqlState, wxT("S0002")) /*&& - wxStrcmp(pDb->sqlState, wxT("S1000"))*/) // "Base table not found" - { - // Check for product specific error codes - if (!((pDb->Dbms() == dbmsSYBASE_ASA && !wxStrcmp(pDb->sqlState,wxT("42000"))) || // 5.x (and lower?) - (pDb->Dbms() == dbmsSYBASE_ASE && !wxStrcmp(pDb->sqlState,wxT("37000"))) || - (pDb->Dbms() == dbmsPERVASIVE_SQL && !wxStrcmp(pDb->sqlState,wxT("S1000"))) || // Returns an S1000 then an S0002 - (pDb->Dbms() == dbmsPOSTGRES && !wxStrcmp(pDb->sqlState,wxT("08S01"))))) - { - pDb->DispNextError(); - pDb->DispAllErrors(henv, hdbc, hstmt); - pDb->RollbackTrans(); -// CloseCursor(hstmt); - return false; - } - } - } - - // Commit the transaction and close the cursor - if (! pDb->CommitTrans()) - return false; - if (! CloseCursor(hstmt)) - return false; - - return true; -} // wxDbTable::DropTable() - - -/********** wxDbTable::CreateIndex() **********/ -bool wxDbTable::CreateIndex(const wxString &indexName, bool unique, UWORD numIndexColumns, - wxDbIdxDef *pIndexDefs, bool attemptDrop) -{ - wxString sqlStmt; - - // Drop the index first - if (attemptDrop && !DropIndex(indexName)) - return false; - - // MySQL (and possibly Sybase ASE?? - gt) require that any columns which are used as portions - // of an index have the columns defined as "NOT NULL". During initial table creation though, - // it may not be known which columns are necessarily going to be part of an index (e.g. the - // table was created, then months later you determine that an additional index while - // give better performance, so you want to add an index). - // - // The following block of code will modify the column definition to make the column be - // defined with the "NOT NULL" qualifier. - if (pDb->Dbms() == dbmsMY_SQL) - { - wxString sqlStmt; - int i; - bool ok = true; - for (i = 0; i < numIndexColumns && ok; i++) - { - int j = 0; - bool found = false; - // Find the column definition that has the ColName that matches the - // index column name. We need to do this to get the DB_DATA_TYPE of - // the index column, as MySQL's syntax for the ALTER column requires - // this information - while (!found && (j < this->m_numCols)) - { - if (wxStrcmp(colDefs[j].ColName,pIndexDefs[i].ColName) == 0) - found = true; - if (!found) - j++; - } - - if (found) - { - ok = pDb->ModifyColumn(tableName, pIndexDefs[i].ColName, - colDefs[j].DbDataType, (int)(colDefs[j].SzDataObj / sizeof(wxChar)), - wxT("NOT NULL")); - - if (!ok) - { - #if 0 - // retcode is not used - wxODBC_ERRORS retcode; - // Oracle returns a DB_ERR_GENERAL_ERROR if the column is already - // defined to be NOT NULL, but reportedly MySQL doesn't mind. - // This line is just here for debug checking of the value - retcode = (wxODBC_ERRORS)pDb->DB_STATUS; - #endif - } - } - else - ok = false; - } - if (ok) - pDb->CommitTrans(); - else - { - pDb->RollbackTrans(); - return false; - } - } - - // Build a CREATE INDEX statement - sqlStmt = wxT("CREATE "); - if (unique) - sqlStmt += wxT("UNIQUE "); - - sqlStmt += wxT("INDEX "); - sqlStmt += pDb->SQLTableName(indexName); - sqlStmt += wxT(" ON "); - - sqlStmt += pDb->SQLTableName(tableName); -// sqlStmt += tableName; - sqlStmt += wxT(" ("); - - // Append list of columns making up index - int i; - for (i = 0; i < numIndexColumns; i++) - { - sqlStmt += pDb->SQLColumnName(pIndexDefs[i].ColName); -// sqlStmt += pIndexDefs[i].ColName; - - // MySQL requires a key length on VARCHAR keys - if ( pDb->Dbms() == dbmsMY_SQL ) - { - // Find the details on this column - int j; - for ( j = 0; j < m_numCols; ++j ) - { - if ( wxStrcmp( pIndexDefs[i].ColName, colDefs[j].ColName ) == 0 ) - { - break; - } - } - if ( colDefs[j].DbDataType == DB_DATA_TYPE_VARCHAR) - { - wxString s; - s.Printf(wxT("(%d)"), (int)(colDefs[i].SzDataObj / sizeof(wxChar))); - sqlStmt += s; - } - } - - // Postgres and SQL Server 7 do not support the ASC/DESC keywords for index columns - if (!((pDb->Dbms() == dbmsMS_SQL_SERVER) && (wxStrncmp(pDb->dbInf.dbmsVer,_T("07"),2)==0)) && - !(pDb->Dbms() == dbmsFIREBIRD) && - !(pDb->Dbms() == dbmsPOSTGRES)) - { - if (pIndexDefs[i].Ascending) - sqlStmt += wxT(" ASC"); - else - sqlStmt += wxT(" DESC"); - } - else - wxASSERT_MSG(pIndexDefs[i].Ascending, _T("Datasource does not support DESCending index columns")); - - if ((i + 1) < numIndexColumns) - sqlStmt += wxT(","); - } - - // Append closing parentheses - sqlStmt += wxT(")"); - - pDb->WriteSqlLog(sqlStmt); - -#ifdef DBDEBUG_CONSOLE - cout << endl << sqlStmt.c_str() << endl << endl; -#endif - - // Execute the CREATE INDEX statement - RETCODE retcode = SQLExecDirect(hstmt, (SQLTCHAR FAR *) sqlStmt.c_str(), SQL_NTS); - if (retcode != SQL_SUCCESS) - { - pDb->DispAllErrors(henv, hdbc, hstmt); - pDb->RollbackTrans(); - CloseCursor(hstmt); - return false; - } - - // Commit the transaction and close the cursor - if (! pDb->CommitTrans()) - return false; - if (! CloseCursor(hstmt)) - return false; - - // Index Created Successfully - return true; - -} // wxDbTable::CreateIndex() - - -/********** wxDbTable::DropIndex() **********/ -bool wxDbTable::DropIndex(const wxString &indexName) -{ - // NOTE: This function returns true if the Index does not exist, but - // only for identified databases. Code will need to be added - // below for any other databases when those databases are defined - // to handle this situation consistently - - wxString sqlStmt; - - if (pDb->Dbms() == dbmsACCESS || pDb->Dbms() == dbmsMY_SQL || - pDb->Dbms() == dbmsDBASE /*|| Paradox needs this syntax too when we add support*/) - sqlStmt.Printf(wxT("DROP INDEX %s ON %s"), - pDb->SQLTableName(indexName.c_str()).c_str(), - pDb->SQLTableName(tableName.c_str()).c_str()); - else if ((pDb->Dbms() == dbmsMS_SQL_SERVER) || - (pDb->Dbms() == dbmsSYBASE_ASE) || - (pDb->Dbms() == dbmsXBASE_SEQUITER)) - sqlStmt.Printf(wxT("DROP INDEX %s.%s"), - pDb->SQLTableName(tableName.c_str()).c_str(), - pDb->SQLTableName(indexName.c_str()).c_str()); - else - sqlStmt.Printf(wxT("DROP INDEX %s"), - pDb->SQLTableName(indexName.c_str()).c_str()); - - pDb->WriteSqlLog(sqlStmt); - -#ifdef DBDEBUG_CONSOLE - cout << endl << sqlStmt.c_str() << endl; -#endif - RETCODE retcode = SQLExecDirect(hstmt, (SQLTCHAR FAR *) sqlStmt.c_str(), SQL_NTS); - if (retcode != SQL_SUCCESS) - { - // Check for "Index not found" error and ignore - pDb->GetNextError(henv, hdbc, hstmt); - if (wxStrcmp(pDb->sqlState,wxT("S0012"))) // "Index not found" - { - // Check for product specific error codes - if (!((pDb->Dbms() == dbmsSYBASE_ASA && !wxStrcmp(pDb->sqlState,wxT("42000"))) || // v5.x (and lower?) - (pDb->Dbms() == dbmsSYBASE_ASE && !wxStrcmp(pDb->sqlState,wxT("37000"))) || - (pDb->Dbms() == dbmsMS_SQL_SERVER && !wxStrcmp(pDb->sqlState,wxT("S1000"))) || - (pDb->Dbms() == dbmsINTERBASE && !wxStrcmp(pDb->sqlState,wxT("S1000"))) || - (pDb->Dbms() == dbmsMAXDB && !wxStrcmp(pDb->sqlState,wxT("S1000"))) || - (pDb->Dbms() == dbmsFIREBIRD && !wxStrcmp(pDb->sqlState,wxT("HY000"))) || - (pDb->Dbms() == dbmsSYBASE_ASE && !wxStrcmp(pDb->sqlState,wxT("S0002"))) || // Base table not found - (pDb->Dbms() == dbmsMY_SQL && !wxStrcmp(pDb->sqlState,wxT("42S12"))) || // tested by Christopher Ludwik Marino-Cebulski using v3.23.21beta - (pDb->Dbms() == dbmsPOSTGRES && !wxStrcmp(pDb->sqlState,wxT("08S01"))) - )) - { - pDb->DispNextError(); - pDb->DispAllErrors(henv, hdbc, hstmt); - pDb->RollbackTrans(); - CloseCursor(hstmt); - return false; - } - } - } - - // Commit the transaction and close the cursor - if (! pDb->CommitTrans()) - return false; - if (! CloseCursor(hstmt)) - return false; - - return true; -} // wxDbTable::DropIndex() - - -/********** wxDbTable::SetOrderByColNums() **********/ -bool wxDbTable::SetOrderByColNums(UWORD first, ... ) -{ - int colNumber = first; // using 'int' to be able to look for wxDB_NO_MORE_COLUN_NUMBERS - va_list argptr; - - bool abort = false; - wxString tempStr; - - va_start(argptr, first); /* Initialize variable arguments. */ - while (!abort && (colNumber != wxDB_NO_MORE_COLUMN_NUMBERS)) - { - // Make sure the passed in column number - // is within the valid range of columns - // - // Valid columns are 0 thru m_numCols-1 - if (colNumber >= m_numCols || colNumber < 0) - { - abort = true; - continue; - } - - if (colNumber != first) - tempStr += wxT(","); - - tempStr += colDefs[colNumber].ColName; - colNumber = va_arg (argptr, int); - } - va_end (argptr); /* Reset variable arguments. */ - - SetOrderByClause(tempStr); - - return (!abort); -} // wxDbTable::SetOrderByColNums() - - -/********** wxDbTable::Insert() **********/ -int wxDbTable::Insert(void) -{ - wxASSERT(!queryOnly); - if (queryOnly || !insertable) - return(DB_FAILURE); - - bindInsertParams(); - - // Insert the record by executing the already prepared insert statement - RETCODE retcode; - retcode = SQLExecute(hstmtInsert); - if (retcode != SQL_SUCCESS && retcode != SQL_SUCCESS_WITH_INFO && - retcode != SQL_NEED_DATA) - { - // Check to see if integrity constraint was violated - pDb->GetNextError(henv, hdbc, hstmtInsert); - if (! wxStrcmp(pDb->sqlState, wxT("23000"))) // Integrity constraint violated - return(DB_ERR_INTEGRITY_CONSTRAINT_VIOL); - else - { - pDb->DispNextError(); - pDb->DispAllErrors(henv, hdbc, hstmtInsert); - return(DB_FAILURE); - } - } - if (retcode == SQL_NEED_DATA) - { - PTR pParmID; - retcode = SQLParamData(hstmtInsert, &pParmID); - while (retcode == SQL_NEED_DATA) - { - // Find the parameter - int i; - for (i=0; i < m_numCols; i++) - { - if (colDefs[i].PtrDataObj == pParmID) - { - // We found it. Store the parameter. - retcode = SQLPutData(hstmtInsert, pParmID, colDefs[i].SzDataObj); - if (retcode != SQL_SUCCESS) - { - pDb->DispNextError(); - pDb->DispAllErrors(henv, hdbc, hstmtInsert); - return(DB_FAILURE); - } - break; - } - } - retcode = SQLParamData(hstmtInsert, &pParmID); - if (retcode != SQL_SUCCESS && - retcode != SQL_SUCCESS_WITH_INFO) - { - // record was not inserted - pDb->DispNextError(); - pDb->DispAllErrors(henv, hdbc, hstmtInsert); - return(DB_FAILURE); - } - } - } - - // Record inserted into the datasource successfully - return(DB_SUCCESS); - -} // wxDbTable::Insert() - - -/********** wxDbTable::Update() **********/ -bool wxDbTable::Update(void) -{ - wxASSERT(!queryOnly); - if (queryOnly) - return false; - - wxString sqlStmt; - - // Build the SQL UPDATE statement - BuildUpdateStmt(sqlStmt, DB_UPD_KEYFIELDS); - - pDb->WriteSqlLog(sqlStmt); - -#ifdef DBDEBUG_CONSOLE - cout << endl << sqlStmt.c_str() << endl << endl; -#endif - - // Execute the SQL UPDATE statement - return(execUpdate(sqlStmt)); - -} // wxDbTable::Update() - - -/********** wxDbTable::Update(pSqlStmt) **********/ -bool wxDbTable::Update(const wxString &pSqlStmt) -{ - wxASSERT(!queryOnly); - if (queryOnly) - return false; - - pDb->WriteSqlLog(pSqlStmt); - - return(execUpdate(pSqlStmt)); - -} // wxDbTable::Update(pSqlStmt) - - -/********** wxDbTable::UpdateWhere() **********/ -bool wxDbTable::UpdateWhere(const wxString &pWhereClause) -{ - wxASSERT(!queryOnly); - if (queryOnly) - return false; - - wxString sqlStmt; - - // Build the SQL UPDATE statement - BuildUpdateStmt(sqlStmt, DB_UPD_WHERE, pWhereClause); - - pDb->WriteSqlLog(sqlStmt); - -#ifdef DBDEBUG_CONSOLE - cout << endl << sqlStmt.c_str() << endl << endl; -#endif - - // Execute the SQL UPDATE statement - return(execUpdate(sqlStmt)); - -} // wxDbTable::UpdateWhere() - - -/********** wxDbTable::Delete() **********/ -bool wxDbTable::Delete(void) -{ - wxASSERT(!queryOnly); - if (queryOnly) - return false; - - wxString sqlStmt; - sqlStmt.Empty(); - - // Build the SQL DELETE statement - BuildDeleteStmt(sqlStmt, DB_DEL_KEYFIELDS); - - pDb->WriteSqlLog(sqlStmt); - - // Execute the SQL DELETE statement - return(execDelete(sqlStmt)); - -} // wxDbTable::Delete() - - -/********** wxDbTable::DeleteWhere() **********/ -bool wxDbTable::DeleteWhere(const wxString &pWhereClause) -{ - wxASSERT(!queryOnly); - if (queryOnly) - return false; - - wxString sqlStmt; - sqlStmt.Empty(); - - // Build the SQL DELETE statement - BuildDeleteStmt(sqlStmt, DB_DEL_WHERE, pWhereClause); - - pDb->WriteSqlLog(sqlStmt); - - // Execute the SQL DELETE statement - return(execDelete(sqlStmt)); - -} // wxDbTable::DeleteWhere() - - -/********** wxDbTable::DeleteMatching() **********/ -bool wxDbTable::DeleteMatching(void) -{ - wxASSERT(!queryOnly); - if (queryOnly) - return false; - - wxString sqlStmt; - sqlStmt.Empty(); - - // Build the SQL DELETE statement - BuildDeleteStmt(sqlStmt, DB_DEL_MATCHING); - - pDb->WriteSqlLog(sqlStmt); - - // Execute the SQL DELETE statement - return(execDelete(sqlStmt)); - -} // wxDbTable::DeleteMatching() - - -/********** wxDbTable::IsColNull() **********/ -bool wxDbTable::IsColNull(UWORD colNumber) const -{ -/* - This logic is just not right. It would indicate true - if a numeric field were set to a value of 0. - - switch(colDefs[colNumber].SqlCtype) - { - case SQL_C_CHAR: - case SQL_C_WCHAR: - //case SQL_C_WXCHAR: SQL_C_WXCHAR is covered by either SQL_C_CHAR or SQL_C_WCHAR - return(((UCHAR FAR *) colDefs[colNumber].PtrDataObj)[0] == 0); - case SQL_C_SSHORT: - return(( *((SWORD *) colDefs[colNumber].PtrDataObj)) == 0); - case SQL_C_USHORT: - return(( *((UWORD*) colDefs[colNumber].PtrDataObj)) == 0); - case SQL_C_SLONG: - return(( *((SDWORD *) colDefs[colNumber].PtrDataObj)) == 0); - case SQL_C_ULONG: - return(( *((UDWORD *) colDefs[colNumber].PtrDataObj)) == 0); - case SQL_C_FLOAT: - return(( *((SFLOAT *) colDefs[colNumber].PtrDataObj)) == 0); - case SQL_C_DOUBLE: - return((*((SDOUBLE *) colDefs[colNumber].PtrDataObj)) == 0); - case SQL_C_TIMESTAMP: - TIMESTAMP_STRUCT *pDt; - pDt = (TIMESTAMP_STRUCT *) colDefs[colNumber].PtrDataObj; - if (pDt->year == 0 && pDt->month == 0 && pDt->day == 0) - return true; - else - return false; - default: - return true; - } -*/ - return (colDefs[colNumber].Null); -} // wxDbTable::IsColNull() - - -/********** wxDbTable::CanSelectForUpdate() **********/ -bool wxDbTable::CanSelectForUpdate(void) -{ - if (queryOnly) - return false; - - if (pDb->Dbms() == dbmsMY_SQL) - return false; - - if ((pDb->Dbms() == dbmsORACLE) || - (pDb->dbInf.posStmts & SQL_PS_SELECT_FOR_UPDATE)) - return true; - else - return false; - -} // wxDbTable::CanSelectForUpdate() - - -/********** wxDbTable::CanUpdateByROWID() **********/ -bool wxDbTable::CanUpdateByROWID(void) -{ -/* - * NOTE: Returning false for now until this can be debugged, - * as the ROWID is not getting updated correctly - */ - return false; -/* - if (pDb->Dbms() == dbmsORACLE) - return true; - else - return false; -*/ -} // wxDbTable::CanUpdateByROWID() - - -/********** wxDbTable::IsCursorClosedOnCommit() **********/ -bool wxDbTable::IsCursorClosedOnCommit(void) -{ - if (pDb->dbInf.cursorCommitBehavior == SQL_CB_PRESERVE) - return false; - else - return true; - -} // wxDbTable::IsCursorClosedOnCommit() - - - -/********** wxDbTable::ClearMemberVar() **********/ -void wxDbTable::ClearMemberVar(UWORD colNumber, bool setToNull) -{ - wxASSERT(colNumber < m_numCols); - - switch(colDefs[colNumber].SqlCtype) - { - case SQL_C_CHAR: -#ifdef SQL_C_WCHAR - case SQL_C_WCHAR: -#endif - //case SQL_C_WXCHAR: SQL_C_WXCHAR is covered by either SQL_C_CHAR or SQL_C_WCHAR - ((UCHAR FAR *) colDefs[colNumber].PtrDataObj)[0] = 0; - break; - case SQL_C_SSHORT: - *((SWORD *) colDefs[colNumber].PtrDataObj) = 0; - break; - case SQL_C_USHORT: - *((UWORD*) colDefs[colNumber].PtrDataObj) = 0; - break; - case SQL_C_LONG: - case SQL_C_SLONG: - *((SDWORD *) colDefs[colNumber].PtrDataObj) = 0; - break; - case SQL_C_ULONG: - *((UDWORD *) colDefs[colNumber].PtrDataObj) = 0; - break; - case SQL_C_FLOAT: - *((SFLOAT *) colDefs[colNumber].PtrDataObj) = 0.0f; - break; - case SQL_C_DOUBLE: - *((SDOUBLE *) colDefs[colNumber].PtrDataObj) = 0.0f; - break; - case SQL_C_TIMESTAMP: - TIMESTAMP_STRUCT *pDt; - pDt = (TIMESTAMP_STRUCT *) colDefs[colNumber].PtrDataObj; - pDt->year = 0; - pDt->month = 0; - pDt->day = 0; - pDt->hour = 0; - pDt->minute = 0; - pDt->second = 0; - pDt->fraction = 0; - break; - case SQL_C_DATE: - DATE_STRUCT *pDtd; - pDtd = (DATE_STRUCT *) colDefs[colNumber].PtrDataObj; - pDtd->year = 0; - pDtd->month = 0; - pDtd->day = 0; - break; - case SQL_C_TIME: - TIME_STRUCT *pDtt; - pDtt = (TIME_STRUCT *) colDefs[colNumber].PtrDataObj; - pDtt->hour = 0; - pDtt->minute = 0; - pDtt->second = 0; - break; - } - - if (setToNull) - SetColNull(colNumber); -} // wxDbTable::ClearMemberVar() - - -/********** wxDbTable::ClearMemberVars() **********/ -void wxDbTable::ClearMemberVars(bool setToNull) -{ - int i; - - // Loop through the columns setting each member variable to zero - for (i=0; i < m_numCols; i++) - ClearMemberVar((UWORD)i,setToNull); - -} // wxDbTable::ClearMemberVars() - - -/********** wxDbTable::SetQueryTimeout() **********/ -bool wxDbTable::SetQueryTimeout(UDWORD nSeconds) -{ - if (SQLSetStmtOption(hstmtInsert, SQL_QUERY_TIMEOUT, nSeconds) != SQL_SUCCESS) - return(pDb->DispAllErrors(henv, hdbc, hstmtInsert)); - if (SQLSetStmtOption(hstmtUpdate, SQL_QUERY_TIMEOUT, nSeconds) != SQL_SUCCESS) - return(pDb->DispAllErrors(henv, hdbc, hstmtUpdate)); - if (SQLSetStmtOption(hstmtDelete, SQL_QUERY_TIMEOUT, nSeconds) != SQL_SUCCESS) - return(pDb->DispAllErrors(henv, hdbc, hstmtDelete)); - if (SQLSetStmtOption(hstmtInternal, SQL_QUERY_TIMEOUT, nSeconds) != SQL_SUCCESS) - return(pDb->DispAllErrors(henv, hdbc, hstmtInternal)); - - // Completed Successfully - return true; - -} // wxDbTable::SetQueryTimeout() - - -/********** wxDbTable::SetColDefs() **********/ -bool wxDbTable::SetColDefs(UWORD index, const wxString &fieldName, int dataType, void *pData, - SWORD cType, int size, bool keyField, bool updateable, - bool insertAllowed, bool derivedColumn) -{ - wxString tmpStr; - - if (index >= m_numCols) // Columns numbers are zero based.... - { - tmpStr.Printf(wxT("Specified column index (%d) exceeds the maximum number of columns (%d) registered for this table definition. Column definition not added."), index, m_numCols); - wxFAIL_MSG(tmpStr); - wxLogDebug(tmpStr); - return false; - } - - if (!colDefs) // May happen if the database connection fails - return false; - - if (fieldName.length() > (unsigned int) DB_MAX_COLUMN_NAME_LEN) - { - wxStrncpy(colDefs[index].ColName, fieldName, DB_MAX_COLUMN_NAME_LEN); - colDefs[index].ColName[DB_MAX_COLUMN_NAME_LEN] = 0; // Prevent buffer overrun - - tmpStr.Printf(wxT("Column name '%s' is too long. Truncated to '%s'."), - fieldName.c_str(),colDefs[index].ColName); - wxFAIL_MSG(tmpStr); - wxLogDebug(tmpStr); - } - else - wxStrcpy(colDefs[index].ColName, fieldName); - - colDefs[index].DbDataType = dataType; - colDefs[index].PtrDataObj = pData; - colDefs[index].SqlCtype = cType; - colDefs[index].SzDataObj = size; //TODO: glt ??? * sizeof(wxChar) ??? - colDefs[index].KeyField = keyField; - colDefs[index].DerivedCol = derivedColumn; - // Derived columns by definition would NOT be "Insertable" or "Updateable" - if (derivedColumn) - { - colDefs[index].Updateable = false; - colDefs[index].InsertAllowed = false; - } - else - { - colDefs[index].Updateable = updateable; - colDefs[index].InsertAllowed = insertAllowed; - } - - colDefs[index].Null = false; - - return true; - -} // wxDbTable::SetColDefs() - - -/********** wxDbTable::SetColDefs() **********/ -wxDbColDataPtr* wxDbTable::SetColDefs(wxDbColInf *pColInfs, UWORD numCols) -{ - wxASSERT(pColInfs); - wxDbColDataPtr *pColDataPtrs = NULL; - - if (pColInfs) - { - UWORD index; - - pColDataPtrs = new wxDbColDataPtr[numCols+1]; - - for (index = 0; index < numCols; index++) - { - // Process the fields - switch (pColInfs[index].dbDataType) - { - case DB_DATA_TYPE_VARCHAR: - pColDataPtrs[index].PtrDataObj = new wxChar[pColInfs[index].bufferSize+(1*sizeof(wxChar))]; - pColDataPtrs[index].SzDataObj = pColInfs[index].bufferSize+(1*sizeof(wxChar)); - pColDataPtrs[index].SqlCtype = SQL_C_WXCHAR; - break; - case DB_DATA_TYPE_MEMO: - pColDataPtrs[index].PtrDataObj = new wxChar[pColInfs[index].bufferSize+(1*sizeof(wxChar))]; - pColDataPtrs[index].SzDataObj = pColInfs[index].bufferSize+(1*sizeof(wxChar)); - pColDataPtrs[index].SqlCtype = SQL_C_WXCHAR; - break; - case DB_DATA_TYPE_INTEGER: - // Can be long or short - if (pColInfs[index].bufferSize == sizeof(long)) - { - pColDataPtrs[index].PtrDataObj = new long; - pColDataPtrs[index].SzDataObj = sizeof(long); - pColDataPtrs[index].SqlCtype = SQL_C_SLONG; - } - else - { - pColDataPtrs[index].PtrDataObj = new short; - pColDataPtrs[index].SzDataObj = sizeof(short); - pColDataPtrs[index].SqlCtype = SQL_C_SSHORT; - } - break; - case DB_DATA_TYPE_FLOAT: - // Can be float or double - if (pColInfs[index].bufferSize == sizeof(float)) - { - pColDataPtrs[index].PtrDataObj = new float; - pColDataPtrs[index].SzDataObj = sizeof(float); - pColDataPtrs[index].SqlCtype = SQL_C_FLOAT; - } - else - { - pColDataPtrs[index].PtrDataObj = new double; - pColDataPtrs[index].SzDataObj = sizeof(double); - pColDataPtrs[index].SqlCtype = SQL_C_DOUBLE; - } - break; - case DB_DATA_TYPE_DATE: - pColDataPtrs[index].PtrDataObj = new TIMESTAMP_STRUCT; - pColDataPtrs[index].SzDataObj = sizeof(TIMESTAMP_STRUCT); - pColDataPtrs[index].SqlCtype = SQL_C_TIMESTAMP; - break; - case DB_DATA_TYPE_BLOB: - wxFAIL_MSG(wxT("This form of ::SetColDefs() cannot be used with BLOB columns")); - pColDataPtrs[index].PtrDataObj = /*BLOB ADDITION NEEDED*/NULL; - pColDataPtrs[index].SzDataObj = /*BLOB ADDITION NEEDED*/sizeof(void *); - pColDataPtrs[index].SqlCtype = SQL_VARBINARY; - break; - } - if (pColDataPtrs[index].PtrDataObj != NULL) - SetColDefs (index,pColInfs[index].colName,pColInfs[index].dbDataType, pColDataPtrs[index].PtrDataObj, pColDataPtrs[index].SqlCtype, pColDataPtrs[index].SzDataObj); - else - { - // Unable to build all the column definitions, as either one of - // the calls to "new" failed above, or there was a BLOB field - // to have a column definition for. If BLOBs are to be used, - // the other form of ::SetColDefs() must be used, as it is impossible - // to know the maximum size to create the PtrDataObj to be. - delete [] pColDataPtrs; - return NULL; - } - } - } - - return (pColDataPtrs); - -} // wxDbTable::SetColDefs() - - -/********** wxDbTable::SetCursor() **********/ -void wxDbTable::SetCursor(HSTMT *hstmtActivate) -{ - if (hstmtActivate == wxDB_DEFAULT_CURSOR) - hstmt = *hstmtDefault; - else - hstmt = *hstmtActivate; - -} // wxDbTable::SetCursor() - - -/********** wxDbTable::Count(const wxString &) **********/ -ULONG wxDbTable::Count(const wxString &args) -{ - ULONG count; - wxString sqlStmt; - SQLLEN cb; - - // Build a "SELECT COUNT(*) FROM queryTableName [WHERE whereClause]" SQL Statement - sqlStmt = wxT("SELECT COUNT("); - sqlStmt += args; - sqlStmt += wxT(") FROM "); - sqlStmt += pDb->SQLTableName(queryTableName); -// sqlStmt += queryTableName; -#if wxODBC_BACKWARD_COMPATABILITY - if (from && wxStrlen(from)) -#else - if (from.length()) -#endif - sqlStmt += from; - - // Add the where clause if one is provided -#if wxODBC_BACKWARD_COMPATABILITY - if (where && wxStrlen(where)) -#else - if (where.length()) -#endif - { - sqlStmt += wxT(" WHERE "); - sqlStmt += where; - } - - pDb->WriteSqlLog(sqlStmt); - - // Initialize the Count cursor if it's not already initialized - if (!hstmtCount) - { - hstmtCount = GetNewCursor(false,false); - wxASSERT(hstmtCount); - if (!hstmtCount) - return(0); - } - - // Execute the SQL statement - if (SQLExecDirect(*hstmtCount, (SQLTCHAR FAR *) sqlStmt.c_str(), SQL_NTS) != SQL_SUCCESS) - { - pDb->DispAllErrors(henv, hdbc, *hstmtCount); - return(0); - } - - // Fetch the record - if (SQLFetch(*hstmtCount) != SQL_SUCCESS) - { - pDb->DispAllErrors(henv, hdbc, *hstmtCount); - return(0); - } - - // Obtain the result - if (SQLGetData(*hstmtCount, (UWORD)1, SQL_C_ULONG, &count, sizeof(count), &cb) != SQL_SUCCESS) - { - pDb->DispAllErrors(henv, hdbc, *hstmtCount); - return(0); - } - - // Free the cursor - if (SQLFreeStmt(*hstmtCount, SQL_CLOSE) != SQL_SUCCESS) - pDb->DispAllErrors(henv, hdbc, *hstmtCount); - - // Return the record count - return(count); - -} // wxDbTable::Count() - - -/********** wxDbTable::Refresh() **********/ -bool wxDbTable::Refresh(void) -{ - bool result = true; - - // Switch to the internal cursor so any active cursors are not corrupted - HSTMT currCursor = GetCursor(); - hstmt = hstmtInternal; -#if wxODBC_BACKWARD_COMPATABILITY - // Save the where and order by clauses - wxChar *saveWhere = where; - wxChar *saveOrderBy = orderBy; -#else - wxString saveWhere = where; - wxString saveOrderBy = orderBy; -#endif - // Build a where clause to refetch the record with. Try and use the - // ROWID if it's available, ow use the key fields. - wxString whereClause; - whereClause.Empty(); - - if (CanUpdateByROWID()) - { - SQLLEN cb; - wxChar rowid[wxDB_ROWID_LEN+1]; - - // Get the ROWID value. If not successful retreiving the ROWID, - // simply fall down through the code and build the WHERE clause - // based on the key fields. - if (SQLGetData(hstmt, (UWORD)(m_numCols+1), SQL_C_WXCHAR, (UCHAR*) rowid, sizeof(rowid), &cb) == SQL_SUCCESS) - { - whereClause += pDb->SQLTableName(queryTableName); -// whereClause += queryTableName; - whereClause += wxT(".ROWID = '"); - whereClause += rowid; - whereClause += wxT("'"); - } - } - - // If unable to use the ROWID, build a where clause from the keyfields - if (wxStrlen(whereClause) == 0) - BuildWhereClause(whereClause, DB_WHERE_KEYFIELDS, queryTableName); - - // Requery the record - where = whereClause; - orderBy.Empty(); - if (!Query()) - result = false; - - if (result && !GetNext()) - result = false; - - // Switch back to original cursor - SetCursor(&currCursor); - - // Free the internal cursor - if (SQLFreeStmt(hstmtInternal, SQL_CLOSE) != SQL_SUCCESS) - pDb->DispAllErrors(henv, hdbc, hstmtInternal); - - // Restore the original where and order by clauses - where = saveWhere; - orderBy = saveOrderBy; - - return(result); - -} // wxDbTable::Refresh() - - -/********** wxDbTable::SetColNull() **********/ -bool wxDbTable::SetColNull(UWORD colNumber, bool set) -{ - if (colNumber < m_numCols) - { - colDefs[colNumber].Null = set; - if (set) // Blank out the values in the member variable - ClearMemberVar(colNumber, false); // Must call with false here, or infinite recursion will happen - - setCbValueForColumn(colNumber); - - return true; - } - else - return false; - -} // wxDbTable::SetColNull() - - -/********** wxDbTable::SetColNull() **********/ -bool wxDbTable::SetColNull(const wxString &colName, bool set) -{ - int colNumber; - for (colNumber = 0; colNumber < m_numCols; colNumber++) - { - if (!wxStricmp(colName, colDefs[colNumber].ColName)) - break; - } - - if (colNumber < m_numCols) - { - colDefs[colNumber].Null = set; - if (set) // Blank out the values in the member variable - ClearMemberVar((UWORD)colNumber,false); // Must call with false here, or infinite recursion will happen - - setCbValueForColumn(colNumber); - - return true; - } - else - return false; - -} // wxDbTable::SetColNull() - - -/********** wxDbTable::GetNewCursor() **********/ -HSTMT *wxDbTable::GetNewCursor(bool setCursor, bool bindColumns) -{ - HSTMT *newHSTMT = new HSTMT; - wxASSERT(newHSTMT); - if (!newHSTMT) - return(0); - - if (SQLAllocStmt(hdbc, newHSTMT) != SQL_SUCCESS) - { - pDb->DispAllErrors(henv, hdbc); - delete newHSTMT; - return(0); - } - - if (SQLSetStmtOption(*newHSTMT, SQL_CURSOR_TYPE, cursorType) != SQL_SUCCESS) - { - pDb->DispAllErrors(henv, hdbc, *newHSTMT); - delete newHSTMT; - return(0); - } - - if (bindColumns) - { - if (!bindCols(*newHSTMT)) - { - delete newHSTMT; - return(0); - } - } - - if (setCursor) - SetCursor(newHSTMT); - - return(newHSTMT); - -} // wxDbTable::GetNewCursor() - - -/********** wxDbTable::DeleteCursor() **********/ -bool wxDbTable::DeleteCursor(HSTMT *hstmtDel) -{ - bool result = true; - - if (!hstmtDel) // Cursor already deleted - return(result); - -/* -ODBC 3.0 says to use this form - if (SQLFreeHandle(*hstmtDel, SQL_DROP) != SQL_SUCCESS) - -*/ - if (SQLFreeStmt(*hstmtDel, SQL_DROP) != SQL_SUCCESS) - { - pDb->DispAllErrors(henv, hdbc); - result = false; - } - - delete hstmtDel; - - return(result); - -} // wxDbTable::DeleteCursor() - -////////////////////////////////////////////////////////////// -// wxDbGrid support functions -////////////////////////////////////////////////////////////// - -void wxDbTable::SetRowMode(const rowmode_t rowmode) -{ - if (!m_hstmtGridQuery) - { - m_hstmtGridQuery = GetNewCursor(false,false); - if (!bindCols(*m_hstmtGridQuery)) - return; - } - - m_rowmode = rowmode; - switch (m_rowmode) - { - case WX_ROW_MODE_QUERY: - SetCursor(m_hstmtGridQuery); - break; - case WX_ROW_MODE_INDIVIDUAL: - SetCursor(hstmtDefault); - break; - default: - wxASSERT(0); - } -} // wxDbTable::SetRowMode() - - -wxVariant wxDbTable::GetColumn(const int colNumber) const -{ - wxVariant val; - if ((colNumber < m_numCols) && (!IsColNull((UWORD)colNumber))) - { - switch (colDefs[colNumber].SqlCtype) - { -#if wxUSE_UNICODE - #if defined(SQL_WCHAR) - case SQL_WCHAR: - #endif - #if defined(SQL_WVARCHAR) - case SQL_WVARCHAR: - #endif -#endif - case SQL_CHAR: - case SQL_VARCHAR: - val = (wxChar *)(colDefs[colNumber].PtrDataObj); - break; - case SQL_C_LONG: - case SQL_C_SLONG: - val = *(long *)(colDefs[colNumber].PtrDataObj); - break; - case SQL_C_SHORT: - case SQL_C_SSHORT: - val = (long int )(*(short *)(colDefs[colNumber].PtrDataObj)); - break; - case SQL_C_ULONG: - val = (long)(*(unsigned long *)(colDefs[colNumber].PtrDataObj)); - break; - case SQL_C_TINYINT: - val = (long)(*(wxChar *)(colDefs[colNumber].PtrDataObj)); - break; - case SQL_C_UTINYINT: - val = (long)(*(wxChar *)(colDefs[colNumber].PtrDataObj)); - break; - case SQL_C_USHORT: - val = (long)(*(UWORD *)(colDefs[colNumber].PtrDataObj)); - break; - case SQL_C_DATE: - val = (DATE_STRUCT *)(colDefs[colNumber].PtrDataObj); - break; - case SQL_C_TIME: - val = (TIME_STRUCT *)(colDefs[colNumber].PtrDataObj); - break; - case SQL_C_TIMESTAMP: - val = (TIMESTAMP_STRUCT *)(colDefs[colNumber].PtrDataObj); - break; - case SQL_C_DOUBLE: - val = *(double *)(colDefs[colNumber].PtrDataObj); - break; - default: - assert(0); - } - } - return val; -} // wxDbTable::GetCol() - - -void wxDbTable::SetColumn(const int colNumber, const wxVariant val) -{ - //FIXME: Add proper wxDateTime support to wxVariant.. - wxDateTime dateval; - - SetColNull((UWORD)colNumber, val.IsNull()); - - if (!val.IsNull()) - { - if ((colDefs[colNumber].SqlCtype == SQL_C_DATE) - || (colDefs[colNumber].SqlCtype == SQL_C_TIME) - || (colDefs[colNumber].SqlCtype == SQL_C_TIMESTAMP)) - { - //Returns null if invalid! - if (!dateval.ParseDate(val.GetString())) - SetColNull((UWORD)colNumber, true); - } - - switch (colDefs[colNumber].SqlCtype) - { -#if wxUSE_UNICODE - #if defined(SQL_WCHAR) - case SQL_WCHAR: - #endif - #if defined(SQL_WVARCHAR) - case SQL_WVARCHAR: - #endif -#endif - case SQL_CHAR: - case SQL_VARCHAR: - csstrncpyt((wxChar *)(colDefs[colNumber].PtrDataObj), - val.GetString().c_str(), - colDefs[colNumber].SzDataObj-1); //TODO: glt ??? * sizeof(wxChar) ??? - break; - case SQL_C_LONG: - case SQL_C_SLONG: - *(long *)(colDefs[colNumber].PtrDataObj) = val; - break; - case SQL_C_SHORT: - case SQL_C_SSHORT: - *(short *)(colDefs[colNumber].PtrDataObj) = (short)val.GetLong(); - break; - case SQL_C_ULONG: - *(unsigned long *)(colDefs[colNumber].PtrDataObj) = val.GetLong(); - break; - case SQL_C_TINYINT: - *(wxChar *)(colDefs[colNumber].PtrDataObj) = val.GetChar(); - break; - case SQL_C_UTINYINT: - *(wxChar *)(colDefs[colNumber].PtrDataObj) = val.GetChar(); - break; - case SQL_C_USHORT: - *(unsigned short *)(colDefs[colNumber].PtrDataObj) = (unsigned short)val.GetLong(); - break; - //FIXME: Add proper wxDateTime support to wxVariant.. - case SQL_C_DATE: - { - DATE_STRUCT *dataptr = - (DATE_STRUCT *)colDefs[colNumber].PtrDataObj; - - dataptr->year = (SWORD)dateval.GetYear(); - dataptr->month = (UWORD)(dateval.GetMonth()+1); - dataptr->day = (UWORD)dateval.GetDay(); - } - break; - case SQL_C_TIME: - { - TIME_STRUCT *dataptr = - (TIME_STRUCT *)colDefs[colNumber].PtrDataObj; - - dataptr->hour = dateval.GetHour(); - dataptr->minute = dateval.GetMinute(); - dataptr->second = dateval.GetSecond(); - } - break; - case SQL_C_TIMESTAMP: - { - TIMESTAMP_STRUCT *dataptr = - (TIMESTAMP_STRUCT *)colDefs[colNumber].PtrDataObj; - dataptr->year = (SWORD)dateval.GetYear(); - dataptr->month = (UWORD)(dateval.GetMonth()+1); - dataptr->day = (UWORD)dateval.GetDay(); - - dataptr->hour = dateval.GetHour(); - dataptr->minute = dateval.GetMinute(); - dataptr->second = dateval.GetSecond(); - } - break; - case SQL_C_DOUBLE: - *(double *)(colDefs[colNumber].PtrDataObj) = val; - break; - default: - assert(0); - } // switch - } // if (!val.IsNull()) -} // wxDbTable::SetCol() - - -GenericKey wxDbTable::GetKey() -{ - void *blk; - wxChar *blkptr; - - blk = malloc(m_keysize); - blkptr = (wxChar *) blk; - - int i; - for (i=0; i < m_numCols; i++) - { - if (colDefs[i].KeyField) - { - memcpy(blkptr,colDefs[i].PtrDataObj, colDefs[i].SzDataObj); - blkptr += colDefs[i].SzDataObj; - } - } - - GenericKey k = GenericKey(blk, m_keysize); - free(blk); - - return k; -} // wxDbTable::GetKey() - - -void wxDbTable::SetKey(const GenericKey& k) -{ - void *blk; - wxChar *blkptr; - - blk = k.GetBlk(); - blkptr = (wxChar *)blk; - - int i; - for (i=0; i < m_numCols; i++) - { - if (colDefs[i].KeyField) - { - SetColNull((UWORD)i, false); - memcpy(colDefs[i].PtrDataObj, blkptr, colDefs[i].SzDataObj); - blkptr += colDefs[i].SzDataObj; - } - } -} // wxDbTable::SetKey() - - -#endif // wxUSE_ODBC diff --git a/wxWidgets/src/common/dcbase.cpp b/wxWidgets/src/common/dcbase.cpp deleted file mode 100644 index ecc821d002..0000000000 --- a/wxWidgets/src/common/dcbase.cpp +++ /dev/null @@ -1,1174 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/common/dcbase.cpp -// Purpose: generic methods of the wxDC Class -// Author: Vadim Zeitlin -// Modified by: -// Created: 05/25/99 -// RCS-ID: $Id: dcbase.cpp 56135 2008-10-06 21:04:02Z VZ $ -// Copyright: (c) wxWidgets team -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#include "wx/dc.h" -#include "wx/dcbuffer.h" // for IMPLEMENT_DYNAMIC_CLASS - -#ifndef WX_PRECOMP - #include "wx/math.h" -#endif - -// bool wxDCBase::sm_cacheing = false; - -IMPLEMENT_ABSTRACT_CLASS(wxDCBase, wxObject) - -// ============================================================================ -// implementation -// ============================================================================ - -IMPLEMENT_DYNAMIC_CLASS(wxBufferedDC, wxMemoryDC) -IMPLEMENT_ABSTRACT_CLASS(wxBufferedPaintDC, wxBufferedDC) - -#if WXWIN_COMPATIBILITY_2_6 -void wxDCBase::BeginDrawing() -{ -} - -void wxDCBase::EndDrawing() -{ -} -#endif // WXWIN_COMPATIBILITY_2_6 - -// ---------------------------------------------------------------------------- -// special symbols -// ---------------------------------------------------------------------------- - -void wxDCBase::DoDrawCheckMark(wxCoord x1, wxCoord y1, - wxCoord width, wxCoord height) -{ - wxCHECK_RET( Ok(), wxT("invalid window dc") ); - - wxCoord x2 = x1 + width, - y2 = y1 + height; - - // the pen width is calibrated to give 3 for width == height == 10 - wxDCPenChanger pen((wxDC&)*this, - wxPen(GetTextForeground(), (width + height + 1)/7)); - - // we're drawing a scaled version of wx/generic/tick.xpm here - wxCoord x3 = x1 + (4*width) / 10, // x of the tick bottom - y3 = y1 + height / 2; // y of the left tick branch - DoDrawLine(x1, y3, x3, y2); - DoDrawLine(x3, y2, x2, y1); - - CalcBoundingBox(x1, y1); - CalcBoundingBox(x2, y2); -} - -// ---------------------------------------------------------------------------- -// line/polygons -// ---------------------------------------------------------------------------- - -void wxDCBase::DrawLines(const wxList *list, wxCoord xoffset, wxCoord yoffset) -{ - int n = list->GetCount(); - wxPoint *points = new wxPoint[n]; - - int i = 0; - for ( wxList::compatibility_iterator node = list->GetFirst(); node; node = node->GetNext(), i++ ) - { - wxPoint *point = (wxPoint *)node->GetData(); - points[i].x = point->x; - points[i].y = point->y; - } - - DoDrawLines(n, points, xoffset, yoffset); - - delete [] points; -} - - -void wxDCBase::DrawPolygon(const wxList *list, - wxCoord xoffset, wxCoord yoffset, - int fillStyle) -{ - int n = list->GetCount(); - wxPoint *points = new wxPoint[n]; - - int i = 0; - for ( wxList::compatibility_iterator node = list->GetFirst(); node; node = node->GetNext(), i++ ) - { - wxPoint *point = (wxPoint *)node->GetData(); - points[i].x = point->x; - points[i].y = point->y; - } - - DoDrawPolygon(n, points, xoffset, yoffset, fillStyle); - - delete [] points; -} - -void -wxDCBase::DoDrawPolyPolygon(int n, - int count[], - wxPoint points[], - wxCoord xoffset, wxCoord yoffset, - int fillStyle) -{ - if ( n == 1 ) - { - DoDrawPolygon(count[0], points, xoffset, yoffset, fillStyle); - return; - } - - int i, j, lastOfs; - wxPoint* pts; - wxPen pen; - - for (i = j = lastOfs = 0; i < n; i++) - { - lastOfs = j; - j += count[i]; - } - pts = new wxPoint[j+n-1]; - for (i = 0; i < j; i++) - pts[i] = points[i]; - for (i = 2; i <= n; i++) - { - lastOfs -= count[n-i]; - pts[j++] = pts[lastOfs]; - } - - pen = GetPen(); - SetPen(wxPen(*wxBLACK, 0, wxTRANSPARENT)); - DoDrawPolygon(j, pts, xoffset, yoffset, fillStyle); - SetPen(pen); - for (i = j = 0; i < n; i++) - { - DoDrawLines(count[i], pts+j, xoffset, yoffset); - j += count[i]; - } - delete[] pts; -} - -// ---------------------------------------------------------------------------- -// splines -// ---------------------------------------------------------------------------- - -#if wxUSE_SPLINES - -// TODO: this API needs fixing (wxPointList, why (!const) "wxList *"?) -void wxDCBase::DrawSpline(wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2, wxCoord x3, wxCoord y3) -{ - wxList point_list; - - wxPoint *point1 = new wxPoint; - point1->x = x1; point1->y = y1; - point_list.Append((wxObject*)point1); - - wxPoint *point2 = new wxPoint; - point2->x = x2; point2->y = y2; - point_list.Append((wxObject*)point2); - - wxPoint *point3 = new wxPoint; - point3->x = x3; point3->y = y3; - point_list.Append((wxObject*)point3); - - DrawSpline(&point_list); - - for( wxList::compatibility_iterator node = point_list.GetFirst(); node; node = node->GetNext() ) - { - wxPoint *p = (wxPoint *)node->GetData(); - delete p; - } -} - -void wxDCBase::DrawSpline(int n, wxPoint points[]) -{ - wxList list; - for (int i =0; i < n; i++) - { - list.Append((wxObject*)&points[i]); - } - - DrawSpline(&list); -} - -// ----------------------------------- spline code ---------------------------------------- - -void wx_quadratic_spline(double a1, double b1, double a2, double b2, - double a3, double b3, double a4, double b4); -void wx_clear_stack(); -int wx_spline_pop(double *x1, double *y1, double *x2, double *y2, double *x3, - double *y3, double *x4, double *y4); -void wx_spline_push(double x1, double y1, double x2, double y2, double x3, double y3, - double x4, double y4); -static bool wx_spline_add_point(double x, double y); -static void wx_spline_draw_point_array(wxDCBase *dc); - -wxList wx_spline_point_list; - -#define half(z1, z2) ((z1+z2)/2.0) -#define THRESHOLD 5 - -/* iterative version */ - -void wx_quadratic_spline(double a1, double b1, double a2, double b2, double a3, double b3, double a4, - double b4) -{ - register double xmid, ymid; - double x1, y1, x2, y2, x3, y3, x4, y4; - - wx_clear_stack(); - wx_spline_push(a1, b1, a2, b2, a3, b3, a4, b4); - - while (wx_spline_pop(&x1, &y1, &x2, &y2, &x3, &y3, &x4, &y4)) { - xmid = (double)half(x2, x3); - ymid = (double)half(y2, y3); - if (fabs(x1 - xmid) < THRESHOLD && fabs(y1 - ymid) < THRESHOLD && - fabs(xmid - x4) < THRESHOLD && fabs(ymid - y4) < THRESHOLD) { - wx_spline_add_point( x1, y1 ); - wx_spline_add_point( xmid, ymid ); - } else { - wx_spline_push(xmid, ymid, (double)half(xmid, x3), (double)half(ymid, y3), - (double)half(x3, x4), (double)half(y3, y4), x4, y4); - wx_spline_push(x1, y1, (double)half(x1, x2), (double)half(y1, y2), - (double)half(x2, xmid), (double)half(y2, ymid), xmid, ymid); - } - } -} - -/* utilities used by spline drawing routines */ - -typedef struct wx_spline_stack_struct { - double x1, y1, x2, y2, x3, y3, x4, y4; -} Stack; - -#define SPLINE_STACK_DEPTH 20 -static Stack wx_spline_stack[SPLINE_STACK_DEPTH]; -static Stack *wx_stack_top; -static int wx_stack_count; - -void wx_clear_stack() -{ - wx_stack_top = wx_spline_stack; - wx_stack_count = 0; -} - -void wx_spline_push(double x1, double y1, double x2, double y2, double x3, double y3, double x4, double y4) -{ - wx_stack_top->x1 = x1; - wx_stack_top->y1 = y1; - wx_stack_top->x2 = x2; - wx_stack_top->y2 = y2; - wx_stack_top->x3 = x3; - wx_stack_top->y3 = y3; - wx_stack_top->x4 = x4; - wx_stack_top->y4 = y4; - wx_stack_top++; - wx_stack_count++; -} - -int wx_spline_pop(double *x1, double *y1, double *x2, double *y2, - double *x3, double *y3, double *x4, double *y4) -{ - if (wx_stack_count == 0) - return (0); - wx_stack_top--; - wx_stack_count--; - *x1 = wx_stack_top->x1; - *y1 = wx_stack_top->y1; - *x2 = wx_stack_top->x2; - *y2 = wx_stack_top->y2; - *x3 = wx_stack_top->x3; - *y3 = wx_stack_top->y3; - *x4 = wx_stack_top->x4; - *y4 = wx_stack_top->y4; - return (1); -} - -static bool wx_spline_add_point(double x, double y) -{ - wxPoint *point = new wxPoint ; - point->x = (int) x; - point->y = (int) y; - wx_spline_point_list.Append((wxObject*)point); - return true; -} - -static void wx_spline_draw_point_array(wxDCBase *dc) -{ - dc->DrawLines(&wx_spline_point_list, 0, 0 ); - wxList::compatibility_iterator node = wx_spline_point_list.GetFirst(); - while (node) - { - wxPoint *point = (wxPoint *)node->GetData(); - delete point; - wx_spline_point_list.Erase(node); - node = wx_spline_point_list.GetFirst(); - } -} - -void wxDCBase::DoDrawSpline( wxList *points ) -{ - wxCHECK_RET( Ok(), wxT("invalid window dc") ); - - wxPoint *p; - double cx1, cy1, cx2, cy2, cx3, cy3, cx4, cy4; - double x1, y1, x2, y2; - - wxList::compatibility_iterator node = points->GetFirst(); - if (!node) - // empty list - return; - - p = (wxPoint *)node->GetData(); - - x1 = p->x; - y1 = p->y; - - node = node->GetNext(); - p = (wxPoint *)node->GetData(); - - x2 = p->x; - y2 = p->y; - cx1 = (double)((x1 + x2) / 2); - cy1 = (double)((y1 + y2) / 2); - cx2 = (double)((cx1 + x2) / 2); - cy2 = (double)((cy1 + y2) / 2); - - wx_spline_add_point(x1, y1); - - while ((node = node->GetNext()) -#if !wxUSE_STL - != NULL -#endif // !wxUSE_STL - ) - { - p = (wxPoint *)node->GetData(); - x1 = x2; - y1 = y2; - x2 = p->x; - y2 = p->y; - cx4 = (double)(x1 + x2) / 2; - cy4 = (double)(y1 + y2) / 2; - cx3 = (double)(x1 + cx4) / 2; - cy3 = (double)(y1 + cy4) / 2; - - wx_quadratic_spline(cx1, cy1, cx2, cy2, cx3, cy3, cx4, cy4); - - cx1 = cx4; - cy1 = cy4; - cx2 = (double)(cx1 + x2) / 2; - cy2 = (double)(cy1 + y2) / 2; - } - - wx_spline_add_point( cx1, cy1 ); - wx_spline_add_point( x2, y2 ); - - wx_spline_draw_point_array( this ); -} - -#endif // wxUSE_SPLINES - -// ---------------------------------------------------------------------------- -// Partial Text Extents -// ---------------------------------------------------------------------------- - - -// Each element of the widths array will be the width of the string up to and -// including the corresponding character in text. This is the generic -// implementation, the port-specific classes should do this with native APIs -// if available and if faster. Note: pango_layout_index_to_pos is much slower -// than calling GetTextExtent!! - -#define FWC_SIZE 256 - -class FontWidthCache -{ -public: - FontWidthCache() : m_scaleX(1), m_widths(NULL) { } - ~FontWidthCache() { delete []m_widths; } - - void Reset() - { - if (!m_widths) - m_widths = new int[FWC_SIZE]; - - memset(m_widths, 0, sizeof(int)*FWC_SIZE); - } - - wxFont m_font; - double m_scaleX; - int *m_widths; -}; - -static FontWidthCache s_fontWidthCache; - -bool wxDCBase::DoGetPartialTextExtents(const wxString& text, wxArrayInt& widths) const -{ - int totalWidth = 0; - - const size_t len = text.length(); - widths.Empty(); - widths.Add(0, len); - - // reset the cache if font or horizontal scale have changed - if ( !s_fontWidthCache.m_widths || - !wxIsSameDouble(s_fontWidthCache.m_scaleX, m_scaleX) || - (s_fontWidthCache.m_font != GetFont()) ) - { - s_fontWidthCache.Reset(); - s_fontWidthCache.m_font = GetFont(); - s_fontWidthCache.m_scaleX = m_scaleX; - } - - // Calculate the position of each character based on the widths of - // the previous characters - int w, h; - for ( size_t i = 0; i < len; i++ ) - { - const wxChar c = text[i]; - unsigned int c_int = (unsigned int)c; - - if ((c_int < FWC_SIZE) && (s_fontWidthCache.m_widths[c_int] != 0)) - { - w = s_fontWidthCache.m_widths[c_int]; - } - else - { - GetTextExtent(c, &w, &h); - if (c_int < FWC_SIZE) - s_fontWidthCache.m_widths[c_int] = w; - } - - totalWidth += w; - widths[i] = totalWidth; - } - - return true; -} - - -// ---------------------------------------------------------------------------- -// enhanced text drawing -// ---------------------------------------------------------------------------- - -void wxDCBase::GetMultiLineTextExtent(const wxString& text, - wxCoord *x, - wxCoord *y, - wxCoord *h, - wxFont *font) const -{ - wxCoord widthTextMax = 0, widthLine, - heightTextTotal = 0, heightLineDefault = 0, heightLine = 0; - - wxString curLine; - for ( const wxChar *pc = text; ; pc++ ) - { - if ( *pc == _T('\n') || *pc == _T('\0') ) - { - if ( curLine.empty() ) - { - // we can't use GetTextExtent - it will return 0 for both width - // and height and an empty line should count in height - // calculation - - // assume that this line has the same height as the previous - // one - if ( !heightLineDefault ) - heightLineDefault = heightLine; - - if ( !heightLineDefault ) - { - // but we don't know it yet - choose something reasonable - GetTextExtent(_T("W"), NULL, &heightLineDefault, - NULL, NULL, font); - } - - heightTextTotal += heightLineDefault; - } - else - { - GetTextExtent(curLine, &widthLine, &heightLine, - NULL, NULL, font); - if ( widthLine > widthTextMax ) - widthTextMax = widthLine; - heightTextTotal += heightLine; - } - - if ( *pc == _T('\n') ) - { - curLine.clear(); - } - else - { - // the end of string - break; - } - } - else - { - curLine += *pc; - } - } - - if ( x ) - *x = widthTextMax; - if ( y ) - *y = heightTextTotal; - if ( h ) - *h = heightLine; -} - -void wxDCBase::DrawLabel(const wxString& text, - const wxBitmap& bitmap, - const wxRect& rect, - int alignment, - int indexAccel, - wxRect *rectBounding) -{ - // find the text position - wxCoord widthText, heightText, heightLine; - GetMultiLineTextExtent(text, &widthText, &heightText, &heightLine); - - wxCoord width, height; - if ( bitmap.Ok() ) - { - width = widthText + bitmap.GetWidth(); - height = bitmap.GetHeight(); - } - else // no bitmap - { - width = widthText; - height = heightText; - } - - wxCoord x, y; - if ( alignment & wxALIGN_RIGHT ) - { - x = rect.GetRight() - width; - } - else if ( alignment & wxALIGN_CENTRE_HORIZONTAL ) - { - x = (rect.GetLeft() + rect.GetRight() + 1 - width) / 2; - } - else // alignment & wxALIGN_LEFT - { - x = rect.GetLeft(); - } - - if ( alignment & wxALIGN_BOTTOM ) - { - y = rect.GetBottom() - height; - } - else if ( alignment & wxALIGN_CENTRE_VERTICAL ) - { - y = (rect.GetTop() + rect.GetBottom() + 1 - height) / 2; - } - else // alignment & wxALIGN_TOP - { - y = rect.GetTop(); - } - - // draw the bitmap first - wxCoord x0 = x, - y0 = y, - width0 = width; - if ( bitmap.Ok() ) - { - DrawBitmap(bitmap, x, y, true /* use mask */); - - wxCoord offset = bitmap.GetWidth() + 4; - x += offset; - width -= offset; - - y += (height - heightText) / 2; - } - - // we will draw the underscore under the accel char later - wxCoord startUnderscore = 0, - endUnderscore = 0, - yUnderscore = 0; - - // split the string into lines and draw each of them separately - wxString curLine; - for ( const wxChar *pc = text; ; pc++ ) - { - if ( *pc == _T('\n') || *pc == _T('\0') ) - { - int xRealStart = x; // init it here to avoid compielr warnings - - if ( !curLine.empty() ) - { - // NB: can't test for !(alignment & wxALIGN_LEFT) because - // wxALIGN_LEFT is 0 - if ( alignment & (wxALIGN_RIGHT | wxALIGN_CENTRE_HORIZONTAL) ) - { - wxCoord widthLine; - GetTextExtent(curLine, &widthLine, NULL); - - if ( alignment & wxALIGN_RIGHT ) - { - xRealStart += width - widthLine; - } - else // if ( alignment & wxALIGN_CENTRE_HORIZONTAL ) - { - xRealStart += (width - widthLine) / 2; - } - } - //else: left aligned, nothing to do - - DrawText(curLine, xRealStart, y); - } - - y += heightLine; - - // do we have underscore in this line? we can check yUnderscore - // because it is set below to just y + heightLine if we do - if ( y == yUnderscore ) - { - // adjust the horz positions to account for the shift - startUnderscore += xRealStart; - endUnderscore += xRealStart; - } - - if ( *pc == _T('\0') ) - break; - - curLine.clear(); - } - else // not end of line - { - if ( pc - text.c_str() == indexAccel ) - { - // remeber to draw underscore here - GetTextExtent(curLine, &startUnderscore, NULL); - curLine += *pc; - GetTextExtent(curLine, &endUnderscore, NULL); - - yUnderscore = y + heightLine; - } - else - { - curLine += *pc; - } - } - } - - // draw the underscore if found - if ( startUnderscore != endUnderscore ) - { - // it should be of the same colour as text - SetPen(wxPen(GetTextForeground(), 0, wxSOLID)); - - yUnderscore--; - - DrawLine(startUnderscore, yUnderscore, endUnderscore, yUnderscore); - } - - // return bounding rect if requested - if ( rectBounding ) - { - *rectBounding = wxRect(x, y - heightText, widthText, heightText); - } - - CalcBoundingBox(x0, y0); - CalcBoundingBox(x0 + width0, y0 + height); -} - - -void wxDCBase::DoGradientFillLinear(const wxRect& rect, - const wxColour& initialColour, - const wxColour& destColour, - wxDirection nDirection) -{ - // save old pen - wxPen oldPen = m_pen; - wxBrush oldBrush = m_brush; - - wxUint8 nR1 = initialColour.Red(); - wxUint8 nG1 = initialColour.Green(); - wxUint8 nB1 = initialColour.Blue(); - wxUint8 nR2 = destColour.Red(); - wxUint8 nG2 = destColour.Green(); - wxUint8 nB2 = destColour.Blue(); - wxUint8 nR, nG, nB; - - if ( nDirection == wxEAST || nDirection == wxWEST ) - { - wxInt32 x = rect.GetWidth(); - wxInt32 w = x; // width of area to shade - wxInt32 xDelta = w/256; // height of one shade bend - if (xDelta < 1) - xDelta = 1; - - while (x >= xDelta) - { - x -= xDelta; - if (nR1 > nR2) - nR = nR1 - (nR1-nR2)*(w-x)/w; - else - nR = nR1 + (nR2-nR1)*(w-x)/w; - - if (nG1 > nG2) - nG = nG1 - (nG1-nG2)*(w-x)/w; - else - nG = nG1 + (nG2-nG1)*(w-x)/w; - - if (nB1 > nB2) - nB = nB1 - (nB1-nB2)*(w-x)/w; - else - nB = nB1 + (nB2-nB1)*(w-x)/w; - - wxColour colour(nR,nG,nB); - SetPen(wxPen(colour, 1, wxSOLID)); - SetBrush(wxBrush(colour)); - if(nDirection == wxEAST) - DrawRectangle(rect.GetRight()-x-xDelta+1, rect.GetTop(), - xDelta, rect.GetHeight()); - else //nDirection == wxWEST - DrawRectangle(rect.GetLeft()+x, rect.GetTop(), - xDelta, rect.GetHeight()); - } - } - else // nDirection == wxNORTH || nDirection == wxSOUTH - { - wxInt32 y = rect.GetHeight(); - wxInt32 w = y; // height of area to shade - wxInt32 yDelta = w/255; // height of one shade bend - if (yDelta < 1) - yDelta = 1; - - while (y > 0) - { - y -= yDelta; - if (nR1 > nR2) - nR = nR1 - (nR1-nR2)*(w-y)/w; - else - nR = nR1 + (nR2-nR1)*(w-y)/w; - - if (nG1 > nG2) - nG = nG1 - (nG1-nG2)*(w-y)/w; - else - nG = nG1 + (nG2-nG1)*(w-y)/w; - - if (nB1 > nB2) - nB = nB1 - (nB1-nB2)*(w-y)/w; - else - nB = nB1 + (nB2-nB1)*(w-y)/w; - - wxColour colour(nR,nG,nB); - SetPen(wxPen(colour, 1, wxSOLID)); - SetBrush(wxBrush(colour)); - if(nDirection == wxNORTH) - DrawRectangle(rect.GetLeft(), rect.GetTop()+y, - rect.GetWidth(), yDelta); - else //nDirection == wxSOUTH - DrawRectangle(rect.GetLeft(), rect.GetBottom()-y-yDelta+1, - rect.GetWidth(), yDelta); - } - } - - SetPen(oldPen); - SetBrush(oldBrush); -} - -void wxDCBase::DoGradientFillConcentric(const wxRect& rect, - const wxColour& initialColour, - const wxColour& destColour, - const wxPoint& circleCenter) -{ - //save the old pen color - wxColour oldPenColour = m_pen.GetColour(); - - wxUint8 nR1 = destColour.Red(); - wxUint8 nG1 = destColour.Green(); - wxUint8 nB1 = destColour.Blue(); - wxUint8 nR2 = initialColour.Red(); - wxUint8 nG2 = initialColour.Green(); - wxUint8 nB2 = initialColour.Blue(); - wxUint8 nR, nG, nB; - - - //Radius - wxInt32 cx = rect.GetWidth() / 2; - wxInt32 cy = rect.GetHeight() / 2; - wxInt32 nRadius; - if (cx < cy) - nRadius = cx; - else - nRadius = cy; - - //Offset of circle - wxInt32 nCircleOffX = circleCenter.x - (rect.GetWidth() / 2); - wxInt32 nCircleOffY = circleCenter.y - (rect.GetHeight() / 2); - - for ( wxInt32 x = 0; x < rect.GetWidth(); x++ ) - { - for ( wxInt32 y = 0; y < rect.GetHeight(); y++ ) - { - //get color difference - wxInt32 nGradient = ((nRadius - - (wxInt32)sqrt( - pow((double)(x - cx - nCircleOffX), 2) + - pow((double)(y - cy - nCircleOffY), 2) - )) * 100) / nRadius; - - //normalize Gradient - if (nGradient < 0 ) - nGradient = 0; - - //get dest colors - nR = (wxUint8)(nR1 + ((nR2 - nR1) * nGradient / 100)); - nG = (wxUint8)(nG1 + ((nG2 - nG1) * nGradient / 100)); - nB = (wxUint8)(nB1 + ((nB2 - nB1) * nGradient / 100)); - - //set the pixel - m_pen.SetColour(wxColour(nR,nG,nB)); - DrawPoint(wxPoint(x + rect.GetLeft(), y + rect.GetTop())); - } - } - //return old pen color - m_pen.SetColour(oldPenColour); -} - -/* -Notes for wxWidgets DrawEllipticArcRot(...) - -wxDCBase::DrawEllipticArcRot(...) draws a rotated elliptic arc or an ellipse. -It uses wxDCBase::CalculateEllipticPoints(...) and wxDCBase::Rotate(...), -which are also new. - -All methods are generic, so they can be implemented in wxDCBase. -DoDrawEllipticArcRot(...) is virtual, so it can be called from deeper -methods like (WinCE) wxDC::DoDrawArc(...). - -CalculateEllipticPoints(...) fills a given list of wxPoints with some points -of an elliptic arc. The algorithm is pixel-based: In every row (in flat -parts) or every column (in steep parts) only one pixel is calculated. -Trigonometric calculation (sin, cos, tan, atan) is only done if the -starting angle is not equal to the ending angle. The calculation of the -pixels is done using simple arithmetic only and should perform not too -bad even on devices without floating point processor. I didn't test this yet. - -Rotate(...) rotates a list of point pixel-based, you will see rounding errors. -For instance: an ellipse rotated 180 degrees is drawn -slightly different from the original. - -The points are then moved to an array and used to draw a polyline and/or polygon -(with center added, the pie). -The result looks quite similar to the native ellipse, only e few pixels differ. - -The performance on a desktop system (Athlon 1800, WinXP) is about 7 times -slower as DrawEllipse(...), which calls the native API. -An rotated ellipse outside the clipping region takes nearly the same time, -while an native ellipse outside takes nearly no time to draw. - -If you draw an arc with this new method, you will see the starting and ending angles -are calculated properly. -If you use DrawEllipticArc(...), you will see they are only correct for circles -and not properly calculated for ellipses. - -Peter Lenhard -p.lenhard@t-online.de -*/ - -#ifdef __WXWINCE__ -void wxDCBase::DoDrawEllipticArcRot( wxCoord x, wxCoord y, - wxCoord w, wxCoord h, - double sa, double ea, double angle ) -{ - wxList list; - - CalculateEllipticPoints( &list, x, y, w, h, sa, ea ); - Rotate( &list, angle, wxPoint( x+w/2, y+h/2 ) ); - - // Add center (for polygon/pie) - list.Append( (wxObject*) new wxPoint( x+w/2, y+h/2 ) ); - - // copy list into array and delete list elements - int n = list.GetCount(); - wxPoint *points = new wxPoint[n]; - int i = 0; - wxNode* node = 0; - for ( node = list.GetFirst(); node; node = node->GetNext(), i++ ) - { - wxPoint *point = (wxPoint *)node->GetData(); - points[i].x = point->x; - points[i].y = point->y; - delete point; - } - - // first draw the pie without pen, if necessary - if( GetBrush() != *wxTRANSPARENT_BRUSH ) - { - wxPen tempPen( GetPen() ); - SetPen( *wxTRANSPARENT_PEN ); - DoDrawPolygon( n, points, 0, 0 ); - SetPen( tempPen ); - } - - // then draw the arc without brush, if necessary - if( GetPen() != *wxTRANSPARENT_PEN ) - { - // without center - DoDrawLines( n-1, points, 0, 0 ); - } - - delete [] points; - -} // DrawEllipticArcRot - -void wxDCBase::Rotate( wxList* points, double angle, wxPoint center ) -{ - if( angle != 0.0 ) - { - double pi(M_PI); - double dSinA = -sin(angle*2.0*pi/360.0); - double dCosA = cos(angle*2.0*pi/360.0); - for ( wxNode* node = points->GetFirst(); node; node = node->GetNext() ) - { - wxPoint* point = (wxPoint*)node->GetData(); - - // transform coordinates, if necessary - if( center.x ) point->x -= center.x; - if( center.y ) point->y -= center.y; - - // calculate rotation, rounding simply by implicit cast to integer - int xTemp = point->x * dCosA - point->y * dSinA; - point->y = point->x * dSinA + point->y * dCosA; - point->x = xTemp; - - // back transform coordinates, if necessary - if( center.x ) point->x += center.x; - if( center.y ) point->y += center.y; - } - } -} - -void wxDCBase::CalculateEllipticPoints( wxList* points, - wxCoord xStart, wxCoord yStart, - wxCoord w, wxCoord h, - double sa, double ea ) -{ - double pi = M_PI; - double sar = 0; - double ear = 0; - int xsa = 0; - int ysa = 0; - int xea = 0; - int yea = 0; - int sq = 0; - int eq = 0; - bool bUseAngles = false; - if( w<0 ) w = -w; - if( h<0 ) h = -h; - // half-axes - wxCoord a = w/2; - wxCoord b = h/2; - // decrement 1 pixel if ellipse is smaller than 2*a, 2*b - int decrX = 0; - if( 2*a == w ) decrX = 1; - int decrY = 0; - if( 2*b == h ) decrY = 1; - // center - wxCoord xCenter = xStart + a; - wxCoord yCenter = yStart + b; - // calculate data for start and end, if necessary - if( sa != ea ) - { - bUseAngles = true; - // normalisation of angles - while( sa<0 ) sa += 360; - while( ea<0 ) ea += 360; - while( sa>=360 ) sa -= 360; - while( ea>=360 ) ea -= 360; - // calculate quadrant numbers - if( sa > 270 ) sq = 3; - else if( sa > 180 ) sq = 2; - else if( sa > 90 ) sq = 1; - if( ea > 270 ) eq = 3; - else if( ea > 180 ) eq = 2; - else if( ea > 90 ) eq = 1; - sar = sa * pi / 180.0; - ear = ea * pi / 180.0; - // correct angle circle -> ellipse - sar = atan( -a/(double)b * tan( sar ) ); - if ( sq == 1 || sq == 2 ) sar += pi; - ear = atan( -a/(double)b * tan( ear ) ); - if ( eq == 1 || eq == 2 ) ear += pi; - // coordinates of points - xsa = xCenter + a * cos( sar ); - if( sq == 0 || sq == 3 ) xsa -= decrX; - ysa = yCenter + b * sin( sar ); - if( sq == 2 || sq == 3 ) ysa -= decrY; - xea = xCenter + a * cos( ear ); - if( eq == 0 || eq == 3 ) xea -= decrX; - yea = yCenter + b * sin( ear ); - if( eq == 2 || eq == 3 ) yea -= decrY; - } // if iUseAngles - // calculate c1 = b^2, c2 = b^2/a^2 with a = w/2, b = h/2 - double c1 = b * b; - double c2 = 2.0 / w; - c2 *= c2; - c2 *= c1; - wxCoord x = 0; - wxCoord y = b; - long x2 = 1; - long y2 = y*y; - long y2_old = 0; - long y_old = 0; - // Lists for quadrant 1 to 4 - wxList pointsarray[4]; - // Calculate points for first quadrant and set in all quadrants - for( x = 0; x <= a; ++x ) - { - x2 = x2+x+x-1; - y2_old = y2; - y_old = y; - bool bNewPoint = false; - while( y2 > c1 - c2 * x2 && y > 0 ) - { - bNewPoint = true; - y2 = y2-y-y+1; - --y; - } - // old y now to big: set point with old y, old x - if( bNewPoint && x>1) - { - int x1 = x - 1; - // remove points on the same line - pointsarray[0].Insert( (wxObject*) new wxPoint( xCenter + x1 - decrX, yCenter - y_old ) ); - pointsarray[1].Append( (wxObject*) new wxPoint( xCenter - x1, yCenter - y_old ) ); - pointsarray[2].Insert( (wxObject*) new wxPoint( xCenter - x1, yCenter + y_old - decrY ) ); - pointsarray[3].Append( (wxObject*) new wxPoint( xCenter + x1 - decrX, yCenter + y_old - decrY ) ); - } // set point - } // calculate point - - // Starting and/or ending points for the quadrants, first quadrant gets both. - pointsarray[0].Insert( (wxObject*) new wxPoint( xCenter + a - decrX, yCenter ) ); - pointsarray[0].Append( (wxObject*) new wxPoint( xCenter, yCenter - b ) ); - pointsarray[1].Append( (wxObject*) new wxPoint( xCenter - a, yCenter ) ); - pointsarray[2].Append( (wxObject*) new wxPoint( xCenter, yCenter + b - decrY ) ); - pointsarray[3].Append( (wxObject*) new wxPoint( xCenter + a - decrX, yCenter ) ); - - // copy quadrants in original list - if( bUseAngles ) - { - // Copy the right part of the points in the lists - // and delete the wxPoints, because they do not leave this method. - points->Append( (wxObject*) new wxPoint( xsa, ysa ) ); - int q = sq; - bool bStarted = false; - bool bReady = false; - bool bForceTurn = ( sq == eq && sa > ea ); - while( !bReady ) - { - for( wxNode *node = pointsarray[q].GetFirst(); node; node = node->GetNext() ) - { - // once: go to starting point in start quadrant - if( !bStarted && - ( - ( (wxPoint*) node->GetData() )->x < xsa+1 && q <= 1 - || - ( (wxPoint*) node->GetData() )->x > xsa-1 && q >= 2 - ) - ) - { - bStarted = true; - } - - // copy point, if not at ending point - if( bStarted ) - { - if( q != eq || bForceTurn - || - ( (wxPoint*) node->GetData() )->x > xea+1 && q <= 1 - || - ( (wxPoint*) node->GetData() )->x < xea-1 && q >= 2 - ) - { - // copy point - wxPoint* pPoint = new wxPoint( *((wxPoint*) node->GetData() ) ); - points->Append( (wxObject*) pPoint ); - } - else if( q == eq && !bForceTurn || ( (wxPoint*) node->GetData() )->x == xea) - { - bReady = true; - } - } - } // for node - ++q; - if( q > 3 ) q = 0; - bForceTurn = false; - bStarted = true; - } // while not bReady - points->Append( (wxObject*) new wxPoint( xea, yea ) ); - - // delete points - for( q = 0; q < 4; ++q ) - { - for( wxNode *node = pointsarray[q].GetFirst(); node; node = node->GetNext() ) - { - wxPoint *p = (wxPoint *)node->GetData(); - delete p; - } - } - } - else - { - wxNode* node; - // copy whole ellipse, wxPoints will be deleted outside - for( node = pointsarray[0].GetFirst(); node; node = node->GetNext() ) - { - wxObject *p = node->GetData(); - points->Append( p ); - } - for( node = pointsarray[1].GetFirst(); node; node = node->GetNext() ) - { - wxObject *p = node->GetData(); - points->Append( p ); - } - for( node = pointsarray[2].GetFirst(); node; node = node->GetNext() ) - { - wxObject *p = node->GetData(); - points->Append( p ); - } - for( node = pointsarray[3].GetFirst(); node; node = node->GetNext() ) - { - wxObject *p = node->GetData(); - points->Append( p ); - } - } // not iUseAngles -} // CalculateEllipticPoints - -#endif - - -float wxDCBase::GetFontPointSizeAdjustment(float dpi) -{ - // wxMSW has long-standing bug where wxFont point size is interpreted as - // "pixel size corresponding to given point size *on screen*". In other - // words, on a typical 600dpi printer and a typical 96dpi screen, fonts - // are ~6 times smaller when printing. Unfortunately, this bug is so severe - // that *all* printing code has to account for it and consequently, other - // ports need to emulate this bug too: - const wxSize screenPixels = wxGetDisplaySize(); - const wxSize screenMM = wxGetDisplaySizeMM(); - const float screenPPI_y = (screenPixels.y * 25.4) / screenMM.y; - return screenPPI_y / dpi; -} diff --git a/wxWidgets/src/common/dcbufcmn.cpp b/wxWidgets/src/common/dcbufcmn.cpp deleted file mode 100644 index 3ac28eae90..0000000000 --- a/wxWidgets/src/common/dcbufcmn.cpp +++ /dev/null @@ -1,95 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/common/dcbufcmn.cpp -// Purpose: Buffered DC implementation -// Author: Ron Lee, Jaakko Salli -// Modified by: -// Created: Sep-20-2006 -// RCS-ID: $Id: dcbufcmn.cpp 52152 2008-02-27 18:03:12Z VZ $ -// Copyright: (c) wxWidgets team -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#include "wx/dcbuffer.h" - -#ifndef WX_PRECOMP - #include "wx/module.h" -#endif - -// ============================================================================ -// implementation -// ============================================================================ - -// ---------------------------------------------------------------------------- -// wxSharedDCBufferManager: helper class maintaining backing store bitmap -// ---------------------------------------------------------------------------- - -class wxSharedDCBufferManager : public wxModule -{ -public: - wxSharedDCBufferManager() { } - - virtual bool OnInit() { return true; } - virtual void OnExit() { wxDELETE(ms_buffer); } - - static wxBitmap* GetBuffer(int w, int h) - { - if ( !ms_buffer || - w > ms_buffer->GetWidth() || - h > ms_buffer->GetHeight() ) - { - delete ms_buffer; - - // we must always return a valid bitmap but creating a bitmap of - // size 0 would fail, so create a 1*1 bitmap in this case - if ( !w ) - w = 1; - if ( !h ) - h = 1; - - ms_buffer = new wxBitmap(w, h); - } - return ms_buffer; - } - -private: - static wxBitmap *ms_buffer; - - DECLARE_DYNAMIC_CLASS(wxSharedDCBufferManager) -}; - -wxBitmap* wxSharedDCBufferManager::ms_buffer = NULL; - -IMPLEMENT_DYNAMIC_CLASS(wxSharedDCBufferManager, wxModule) - -// ============================================================================ -// wxBufferedDC -// ============================================================================ - -void wxBufferedDC::UseBuffer(wxCoord w, wxCoord h) -{ - if ( !m_buffer || !m_buffer->IsOk() ) - { - if ( w == -1 || h == -1 ) - m_dc->GetSize(&w, &h); - - m_buffer = wxSharedDCBufferManager::GetBuffer(w, h); - } - - SelectObject(*m_buffer); -} - diff --git a/wxWidgets/src/common/dcgraph.cpp b/wxWidgets/src/common/dcgraph.cpp deleted file mode 100644 index c9d5e11fe2..0000000000 --- a/wxWidgets/src/common/dcgraph.cpp +++ /dev/null @@ -1,1034 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/common/graphcmn.cpp -// Purpose: graphics context methods common to all platforms -// Author: Stefan Csomor -// Modified by: -// Created: -// RCS-ID: $Id: dcgraph.cpp 60190 2009-04-16 00:57:35Z KO $ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#if defined(__BORLANDC__) - #pragma hdrstop -#endif - -#if wxUSE_GRAPHICS_CONTEXT - -#include "wx/graphics.h" - -#ifndef WX_PRECOMP - #include "wx/icon.h" - #include "wx/bitmap.h" - #include "wx/dcmemory.h" - #include "wx/region.h" -#endif - -#ifdef __WXMAC__ -#include "wx/mac/private.h" -#endif -//----------------------------------------------------------------------------- -// constants -//----------------------------------------------------------------------------- - -static const double RAD2DEG = 180.0 / M_PI; - -//----------------------------------------------------------------------------- -// Local functions -//----------------------------------------------------------------------------- - -static inline double DegToRad(double deg) -{ - return (deg * M_PI) / 180.0; -} - -//----------------------------------------------------------------------------- -// wxDC bridge class -//----------------------------------------------------------------------------- - -#ifdef __WXMAC__ -IMPLEMENT_DYNAMIC_CLASS(wxGCDC, wxDCBase) -#else -IMPLEMENT_DYNAMIC_CLASS(wxGCDC, wxDC) -#endif - -wxGCDC::wxGCDC() -{ - Init(); -} - -void wxGCDC::SetGraphicsContext( wxGraphicsContext* ctx ) -{ - delete m_graphicContext; - m_graphicContext = ctx; - if ( m_graphicContext ) - { - m_matrixOriginal = m_graphicContext->GetTransform(); - m_ok = true; - // apply the stored transformations to the passed in context - ComputeScaleAndOrigin(); - m_graphicContext->SetFont( m_font , m_textForegroundColour ); - m_graphicContext->SetPen( m_pen ); - m_graphicContext->SetBrush( m_brush); - } -} - -wxGCDC::wxGCDC(const wxWindowDC& dc) -{ - Init(); - wxGraphicsContext* context; -#if wxUSE_CAIRO - wxGraphicsRenderer* renderer = wxGraphicsRenderer::GetCairoRenderer(); - context = renderer->CreateContext(dc); -#else - context = wxGraphicsContext::Create(dc); -#endif - - SetGraphicsContext( context ); -} - -#ifdef __WXMSW__ -wxGCDC::wxGCDC(const wxMemoryDC& dc) -{ - Init(); - SetGraphicsContext( wxGraphicsContext::Create(dc) ); -} -#endif - -void wxGCDC::Init() -{ - m_ok = false; - m_colour = true; - m_mm_to_pix_x = mm2pt; - m_mm_to_pix_y = mm2pt; - - m_pen = *wxBLACK_PEN; - m_font = *wxNORMAL_FONT; - m_brush = *wxWHITE_BRUSH; - - m_graphicContext = NULL; - m_logicalFunctionSupported = true; -} - - -wxGCDC::~wxGCDC() -{ - delete m_graphicContext; -} - -void wxGCDC::DoDrawBitmap( const wxBitmap &bmp, wxCoord x, wxCoord y, bool WXUNUSED(useMask) ) -{ - wxCHECK_RET( Ok(), wxT("wxGCDC(cg)::DoDrawBitmap - invalid DC") ); - wxCHECK_RET( bmp.Ok(), wxT("wxGCDC(cg)::DoDrawBitmap - invalid bitmap") ); - - if ( bmp.GetDepth() == 1 ) - { - m_graphicContext->SetPen(*wxTRANSPARENT_PEN); - m_graphicContext->SetBrush( wxBrush( m_textBackgroundColour , wxSOLID ) ); - m_graphicContext->DrawRectangle( x , y , bmp.GetWidth() , bmp.GetHeight() ); - m_graphicContext->SetBrush( wxBrush( m_textForegroundColour , wxSOLID ) ); - m_graphicContext->DrawBitmap( bmp, x , y , bmp.GetWidth() , bmp.GetHeight() ); - m_graphicContext->SetBrush( m_graphicContext->CreateBrush(m_brush)); - m_graphicContext->SetPen( m_graphicContext->CreatePen(m_pen)); - } - else - m_graphicContext->DrawBitmap( bmp, x , y , bmp.GetWidth() , bmp.GetHeight() ); -} - -void wxGCDC::DoDrawIcon( const wxIcon &icon, wxCoord x, wxCoord y ) -{ - wxCHECK_RET( Ok(), wxT("wxGCDC(cg)::DoDrawIcon - invalid DC") ); - wxCHECK_RET( icon.Ok(), wxT("wxGCDC(cg)::DoDrawIcon - invalid icon") ); - - wxCoord w = icon.GetWidth(); - wxCoord h = icon.GetHeight(); - - m_graphicContext->DrawIcon( icon , x, y, w, h ); -} - -bool wxGCDC::StartDoc( const wxString& WXUNUSED(message) ) -{ - return true; -} - -void wxGCDC::EndDoc() -{ -} - -void wxGCDC::StartPage() -{ -} - -void wxGCDC::EndPage() -{ -} - -void wxGCDC::Flush() -{ -#ifdef __WXMAC__ - CGContextFlush( (CGContextRef) m_graphicContext->GetNativeContext() ); -#endif -} - -void wxGCDC::DoSetClippingRegion( wxCoord x, wxCoord y, wxCoord w, wxCoord h ) -{ - wxCHECK_RET( Ok(), wxT("wxGCDC(cg)::DoSetClippingRegion - invalid DC") ); - - m_graphicContext->Clip( x, y, w, h ); - if ( m_clipping ) - { - m_clipX1 = wxMax( m_clipX1, x ); - m_clipY1 = wxMax( m_clipY1, y ); - m_clipX2 = wxMin( m_clipX2, (x + w) ); - m_clipY2 = wxMin( m_clipY2, (y + h) ); - } - else - { - m_clipping = true; - - m_clipX1 = x; - m_clipY1 = y; - m_clipX2 = x + w; - m_clipY2 = y + h; - } -} - -void wxGCDC::DoSetClippingRegionAsRegion( const wxRegion ®ion ) -{ - // region is in device coordinates - wxCHECK_RET( Ok(), wxT("wxGCDC(cg)::DoSetClippingRegionAsRegion - invalid DC") ); - - if (region.Empty()) - { - //DestroyClippingRegion(); - return; - } - - wxRegion logRegion( region ); - wxCoord x, y, w, h; - - logRegion.Offset( DeviceToLogicalX(0), DeviceToLogicalY(0) ); - logRegion.GetBox( x, y, w, h ); - - m_graphicContext->Clip( logRegion ); - if ( m_clipping ) - { - m_clipX1 = wxMax( m_clipX1, x ); - m_clipY1 = wxMax( m_clipY1, y ); - m_clipX2 = wxMin( m_clipX2, (x + w) ); - m_clipY2 = wxMin( m_clipY2, (y + h) ); - } - else - { - m_clipping = true; - - m_clipX1 = x; - m_clipY1 = y; - m_clipX2 = x + w; - m_clipY2 = y + h; - } -} - -void wxGCDC::DestroyClippingRegion() -{ - m_graphicContext->ResetClip(); - // currently the clip eg of a window extends to the area between the scrollbars - // so we must explicitely make sure it only covers the area we want it to draw - int width, height ; - GetSize( &width , &height ) ; - m_graphicContext->Clip( DeviceToLogicalX(0) , DeviceToLogicalY(0) , DeviceToLogicalXRel(width), DeviceToLogicalYRel(height) ); - - m_graphicContext->SetPen( m_pen ); - m_graphicContext->SetBrush( m_brush ); - - m_clipping = false; -} - -void wxGCDC::DoGetSizeMM( int* width, int* height ) const -{ - int w = 0, h = 0; - - GetSize( &w, &h ); - if (width) - *width = long( double(w) / (m_scaleX * m_mm_to_pix_x) ); - if (height) - *height = long( double(h) / (m_scaleY * m_mm_to_pix_y) ); -} - -void wxGCDC::SetTextForeground( const wxColour &col ) -{ - wxCHECK_RET( Ok(), wxT("wxGCDC(cg)::SetTextForeground - invalid DC") ); - - if ( col != m_textForegroundColour ) - { - m_textForegroundColour = col; - m_graphicContext->SetFont( m_font, m_textForegroundColour ); - } -} - -void wxGCDC::SetTextBackground( const wxColour &col ) -{ - wxCHECK_RET( Ok(), wxT("wxGCDC(cg)::SetTextBackground - invalid DC") ); - - m_textBackgroundColour = col; -} - -void wxGCDC::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; - - case wxMM_TEXT: - default: - SetLogicalScale( 1.0, 1.0 ); - break; - } - - ComputeScaleAndOrigin(); -} - -void wxGCDC::SetUserScale( double x, double y ) -{ - // allow negative ? -> no - - m_userScaleX = x; - m_userScaleY = y; - ComputeScaleAndOrigin(); -} - -void wxGCDC::SetLogicalScale( double x, double y ) -{ - // allow negative ? - m_logicalScaleX = x; - m_logicalScaleY = y; - ComputeScaleAndOrigin(); -} - -void wxGCDC::SetLogicalOrigin( wxCoord x, wxCoord y ) -{ - m_logicalOriginX = x * m_signX; // is this still correct ? - m_logicalOriginY = y * m_signY; - ComputeScaleAndOrigin(); -} - -void wxGCDC::SetDeviceOrigin( wxCoord x, wxCoord y ) -{ - m_deviceOriginX = x; - m_deviceOriginY = y; - ComputeScaleAndOrigin(); -} - -void wxGCDC::SetAxisOrientation( bool xLeftRight, bool yBottomUp ) -{ - m_signX = (xLeftRight ? 1 : -1); - m_signY = (yBottomUp ? -1 : 1); - ComputeScaleAndOrigin(); -} - -wxSize wxGCDC::GetPPI() const -{ - return wxSize(72, 72); -} - -int wxGCDC::GetDepth() const -{ - return 32; -} - -void wxGCDC::ComputeScaleAndOrigin() -{ - m_scaleX = m_logicalScaleX * m_userScaleX; - m_scaleY = m_logicalScaleY * m_userScaleY; - - if ( m_graphicContext ) - { - m_matrixCurrent = m_graphicContext->CreateMatrix(); - m_matrixCurrent.Translate( m_deviceOriginX, m_deviceOriginY ); - m_matrixCurrent.Scale( m_scaleX, m_scaleY ); - // the logical origin sets the origin to have new coordinates - m_matrixCurrent.Translate( -m_logicalOriginX, -m_logicalOriginY ); - - m_graphicContext->SetTransform( m_matrixOriginal ); - m_graphicContext->ConcatTransform( m_matrixCurrent ); - } -} - -void wxGCDC::SetPalette( const wxPalette& WXUNUSED(palette) ) -{ - -} - -void wxGCDC::SetBackgroundMode( int mode ) -{ - m_backgroundMode = mode; -} - -void wxGCDC::SetFont( const wxFont &font ) -{ - m_font = font; - if ( m_graphicContext ) - { - wxFont f = font; - if ( f.Ok() ) - f.SetPointSize( /*LogicalToDeviceYRel*/(font.GetPointSize())); - m_graphicContext->SetFont( f, m_textForegroundColour ); - } -} - -void wxGCDC::SetPen( const wxPen &pen ) -{ - if ( m_pen == pen ) - return; - - m_pen = pen; - if ( m_graphicContext ) - { - m_graphicContext->SetPen( m_pen ); - } -} - -void wxGCDC::SetBrush( const wxBrush &brush ) -{ - if (m_brush == brush) - return; - - m_brush = brush; - if ( m_graphicContext ) - { - m_graphicContext->SetBrush( m_brush ); - } -} - -void wxGCDC::SetBackground( const wxBrush &brush ) -{ - if (m_backgroundBrush == brush) - return; - - m_backgroundBrush = brush; - if (!m_backgroundBrush.Ok()) - return; -} - -void wxGCDC::SetLogicalFunction( int function ) -{ - if (m_logicalFunction == function) - return; - - m_logicalFunction = function; - if ( m_graphicContext->SetLogicalFunction( function ) ) - m_logicalFunctionSupported=true; - else - m_logicalFunctionSupported=false; -} - -bool wxGCDC::DoFloodFill(wxCoord WXUNUSED(x), wxCoord WXUNUSED(y), - const wxColour& WXUNUSED(col), int WXUNUSED(style)) -{ - return false; -} - -bool wxGCDC::DoGetPixel( wxCoord WXUNUSED(x), wxCoord WXUNUSED(y), wxColour *WXUNUSED(col) ) const -{ - // wxCHECK_MSG( 0 , false, wxT("wxGCDC(cg)::DoGetPixel - not implemented") ); - return false; -} - -void wxGCDC::DoDrawLine( wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2 ) -{ - wxCHECK_RET( Ok(), wxT("wxGCDC(cg)::DoDrawLine - invalid DC") ); - - if ( !m_logicalFunctionSupported ) - return; - - m_graphicContext->StrokeLine(x1,y1,x2,y2); - - CalcBoundingBox(x1, y1); - CalcBoundingBox(x2, y2); -} - -void wxGCDC::DoCrossHair( wxCoord x, wxCoord y ) -{ - wxCHECK_RET( Ok(), wxT("wxGCDC(cg)::DoCrossHair - invalid DC") ); - - if ( !m_logicalFunctionSupported ) - return; - - int w = 0, h = 0; - - GetSize( &w, &h ); - - m_graphicContext->StrokeLine(0,y,w,y); - m_graphicContext->StrokeLine(x,0,x,h); - - CalcBoundingBox(0, 0); - CalcBoundingBox(0+w, 0+h); -} - -void wxGCDC::DoDrawArc( wxCoord x1, wxCoord y1, - wxCoord x2, wxCoord y2, - wxCoord xc, wxCoord yc ) -{ - wxCHECK_RET( Ok(), wxT("wxGCDC(cg)::DoDrawArc - invalid DC") ); - - if ( !m_logicalFunctionSupported ) - return; - - double dx = x1 - xc; - double dy = y1 - yc; - double radius = sqrt((double)(dx * dx + dy * dy)); - wxCoord rad = (wxCoord)radius; - double sa, ea; - if (x1 == x2 && y1 == y2) - { - sa = 0.0; - ea = 360.0; - } - else if (radius == 0.0) - { - sa = ea = 0.0; - } - else - { - sa = (x1 - xc == 0) ? - (y1 - yc < 0) ? 90.0 : -90.0 : - -atan2(double(y1 - yc), double(x1 - xc)) * RAD2DEG; - ea = (x2 - xc == 0) ? - (y2 - yc < 0) ? 90.0 : -90.0 : - -atan2(double(y2 - yc), double(x2 - xc)) * RAD2DEG; - } - - bool fill = m_brush.GetStyle() != wxTRANSPARENT; - - wxGraphicsPath path = m_graphicContext->CreatePath(); - if ( fill && ((x1!=x2)||(y1!=y2)) ) - path.MoveToPoint( xc, yc ); - // since these angles (ea,sa) are measured counter-clockwise, we invert them to - // get clockwise angles - path.AddArc( xc, yc , rad , DegToRad(-sa) , DegToRad(-ea), false ); - if ( fill && ((x1!=x2)||(y1!=y2)) ) - path.AddLineToPoint( xc, yc ); - m_graphicContext->DrawPath(path); -} - -void wxGCDC::DoDrawEllipticArc( wxCoord x, wxCoord y, wxCoord w, wxCoord h, - double sa, double ea ) -{ - wxCHECK_RET( Ok(), wxT("wxGCDC(cg)::DoDrawEllipticArc - invalid DC") ); - - if ( !m_logicalFunctionSupported ) - return; - - m_graphicContext->PushState(); - m_graphicContext->Translate(x+w/2.0,y+h/2.0); - wxDouble factor = ((wxDouble) w) / h; - m_graphicContext->Scale( factor , 1.0); - - // since these angles (ea,sa) are measured counter-clockwise, we invert them to - // get clockwise angles - if ( m_brush.GetStyle() != wxTRANSPARENT ) - { - wxGraphicsPath path = m_graphicContext->CreatePath(); - path.MoveToPoint( 0, 0 ); - path.AddArc( 0, 0, h/2.0 , DegToRad(-sa) , DegToRad(-ea), sa > ea ); - path.AddLineToPoint( 0, 0 ); - m_graphicContext->FillPath( path ); - - path = m_graphicContext->CreatePath(); - path.AddArc( 0, 0, h/2.0 , DegToRad(-sa) , DegToRad(-ea), sa > ea ); - m_graphicContext->StrokePath( path ); - } - else - { - wxGraphicsPath path = m_graphicContext->CreatePath(); - path.AddArc( 0, 0, h/2.0 , DegToRad(-sa) , DegToRad(-ea), sa > ea ); - m_graphicContext->DrawPath( path ); - } - - m_graphicContext->PopState(); -} - -void wxGCDC::DoDrawPoint( wxCoord x, wxCoord y ) -{ - wxCHECK_RET( Ok(), wxT("wxGCDC(cg)::DoDrawPoint - invalid DC") ); - - DoDrawLine( x , y , x + 1 , y + 1 ); -} - -void wxGCDC::DoDrawLines(int n, wxPoint points[], - wxCoord xoffset, wxCoord yoffset) -{ - wxCHECK_RET( Ok(), wxT("wxGCDC(cg)::DoDrawLines - invalid DC") ); - - if ( !m_logicalFunctionSupported ) - return; - - wxPoint2DDouble* pointsD = new wxPoint2DDouble[n]; - for( int i = 0; i < n; ++i) - { - pointsD[i].m_x = points[i].x + xoffset; - pointsD[i].m_y = points[i].y + yoffset; - } - - m_graphicContext->StrokeLines( n , pointsD); - delete[] pointsD; -} - -#if wxUSE_SPLINES -void wxGCDC::DoDrawSpline(wxList *points) -{ - wxCHECK_RET( Ok(), wxT("wxGCDC(cg)::DoDrawSpline - invalid DC") ); - - if ( !m_logicalFunctionSupported ) - return; - - wxGraphicsPath path = m_graphicContext->CreatePath(); - - wxList::compatibility_iterator node = points->GetFirst(); - if (node == wxList::compatibility_iterator()) - // empty list - return; - - wxPoint *p = (wxPoint *)node->GetData(); - - wxCoord x1 = p->x; - wxCoord y1 = p->y; - - node = node->GetNext(); - p = (wxPoint *)node->GetData(); - - wxCoord x2 = p->x; - wxCoord y2 = p->y; - wxCoord cx1 = ( x1 + x2 ) / 2; - wxCoord cy1 = ( y1 + y2 ) / 2; - - path.MoveToPoint( x1 , y1 ); - path.AddLineToPoint( cx1 , cy1 ); -#if !wxUSE_STL - - while ((node = node->GetNext()) != NULL) -#else - - while ((node = node->GetNext())) -#endif // !wxUSE_STL - - { - p = (wxPoint *)node->GetData(); - x1 = x2; - y1 = y2; - x2 = p->x; - y2 = p->y; - wxCoord cx4 = (x1 + x2) / 2; - wxCoord cy4 = (y1 + y2) / 2; - - path.AddQuadCurveToPoint(x1 , y1 ,cx4 , cy4 ); - - cx1 = cx4; - cy1 = cy4; - } - - path.AddLineToPoint( x2 , y2 ); - - m_graphicContext->StrokePath( path ); -} -#endif // wxUSE_SPLINES - -void wxGCDC::DoDrawPolygon( int n, wxPoint points[], - wxCoord xoffset, wxCoord yoffset, - int fillStyle ) -{ - wxCHECK_RET( Ok(), wxT("wxGCDC(cg)::DoDrawPolygon - invalid DC") ); - - if ( n <= 0 || (m_brush.GetStyle() == wxTRANSPARENT && m_pen.GetStyle() == wxTRANSPARENT ) ) - return; - if ( !m_logicalFunctionSupported ) - return; - - bool closeIt = false; - if (points[n-1] != points[0]) - closeIt = true; - - wxPoint2DDouble* pointsD = new wxPoint2DDouble[n+(closeIt?1:0)]; - for( int i = 0; i < n; ++i) - { - pointsD[i].m_x = points[i].x + xoffset; - pointsD[i].m_y = points[i].y + yoffset; - } - if ( closeIt ) - pointsD[n] = pointsD[0]; - - m_graphicContext->DrawLines( n+(closeIt?1:0) , pointsD, fillStyle); - delete[] pointsD; -} - -void wxGCDC::DoDrawPolyPolygon(int n, - int count[], - wxPoint points[], - wxCoord xoffset, - wxCoord yoffset, - int fillStyle) -{ - wxASSERT(n > 1); - wxGraphicsPath path = m_graphicContext->CreatePath(); - - int i = 0; - for ( int j = 0; j < n; ++j) - { - wxPoint start = points[i]; - path.MoveToPoint( start.x+ xoffset, start.y+ yoffset); - ++i; - int l = count[j]; - for ( int k = 1; k < l; ++k) - { - path.AddLineToPoint( points[i].x+ xoffset, points[i].y+ yoffset); - ++i; - } - // close the polygon - if ( start != points[i-1]) - path.AddLineToPoint( start.x+ xoffset, start.y+ yoffset); - } - m_graphicContext->DrawPath( path , fillStyle); -} - -void wxGCDC::DoDrawRectangle(wxCoord x, wxCoord y, wxCoord w, wxCoord h) -{ - wxCHECK_RET( Ok(), wxT("wxGCDC(cg)::DoDrawRectangle - invalid DC") ); - - if ( !m_logicalFunctionSupported ) - return; - - // CMB: draw nothing if transformed w or h is 0 - if (w == 0 || h == 0) - return; - - if ( m_graphicContext->ShouldOffset() ) - { - // if we are offsetting the entire rectangle is moved 0.5, so the - // border line gets off by 1 - w -= 1; - h -= 1; - } - m_graphicContext->DrawRectangle(x,y,w,h); -} - -void wxGCDC::DoDrawRoundedRectangle(wxCoord x, wxCoord y, - wxCoord w, wxCoord h, - double radius) -{ - wxCHECK_RET( Ok(), wxT("wxGCDC(cg)::DoDrawRoundedRectangle - invalid DC") ); - - if ( !m_logicalFunctionSupported ) - return; - - if (radius < 0.0) - radius = - radius * ((w < h) ? w : h); - - // CMB: draw nothing if transformed w or h is 0 - if (w == 0 || h == 0) - return; - - if ( m_graphicContext->ShouldOffset() ) - { - // if we are offsetting the entire rectangle is moved 0.5, so the - // border line gets off by 1 - w -= 1; - h -= 1; - } - m_graphicContext->DrawRoundedRectangle( x,y,w,h,radius); -} - -void wxGCDC::DoDrawEllipse(wxCoord x, wxCoord y, wxCoord w, wxCoord h) -{ - wxCHECK_RET( Ok(), wxT("wxGCDC(cg)::DoDrawEllipse - invalid DC") ); - - if ( !m_logicalFunctionSupported ) - return; - - if ( m_graphicContext->ShouldOffset() ) - { - // if we are offsetting the entire rectangle is moved 0.5, so the - // border line gets off by 1 - w -= 1; - h -= 1; - } - m_graphicContext->DrawEllipse(x,y,w,h); -} - -bool wxGCDC::CanDrawBitmap() const -{ - return true; -} - -bool wxGCDC::DoBlit( - wxCoord xdest, wxCoord ydest, wxCoord width, wxCoord height, - wxDC *source, wxCoord xsrc, wxCoord ysrc, int logical_func , bool WXUNUSED(useMask), - wxCoord xsrcMask, wxCoord ysrcMask ) -{ - wxCHECK_MSG( Ok(), false, wxT("wxGCDC(cg)::DoBlit - invalid DC") ); - wxCHECK_MSG( source->Ok(), false, wxT("wxGCDC(cg)::DoBlit - invalid source DC") ); - - if ( logical_func == wxNO_OP ) - return true; - else if ( !m_graphicContext->SetLogicalFunction( logical_func ) ) - - { - wxFAIL_MSG( wxT("Logical function is not supported by the graphics context.") ); - return false; - } - - if (xsrcMask == -1 && ysrcMask == -1) - { - xsrcMask = xsrc; - ysrcMask = ysrc; - } - - wxRect subrect(source->LogicalToDeviceX(xsrc), - source->LogicalToDeviceY(ysrc), - source->LogicalToDeviceXRel(width), - source->LogicalToDeviceYRel(height)); - - // if needed clip the subrect down to the size of the source DC - wxCoord sw, sh; - source->GetSize(&sw, &sh); - sw = source->LogicalToDeviceXRel(sw); - sh = source->LogicalToDeviceYRel(sh); - if (subrect.x + subrect.width > sw) - subrect.width = sw - subrect.x; - if (subrect.y + subrect.height > sh) - subrect.height = sh - subrect.y; - - wxBitmap blit = source->GetAsBitmap( &subrect ); - - if ( blit.Ok() ) - { - m_graphicContext->DrawBitmap( blit, xdest, ydest, - wxMin(width, blit.GetWidth()), - wxMin(height, blit.GetHeight())); - } - else - { - wxFAIL_MSG( wxT("Cannot Blit. Unable to get contents of DC as bitmap.") ); - return false; - } - - // reset logical function - m_graphicContext->SetLogicalFunction( m_logicalFunction ); - - return true; -} - -void wxGCDC::DoDrawRotatedText(const wxString& str, wxCoord x, wxCoord y, - double angle) -{ - wxCHECK_RET( Ok(), wxT("wxGCDC(cg)::DoDrawRotatedText - invalid DC") ); - - if ( str.length() == 0 ) - return; - if ( !m_logicalFunctionSupported ) - return; - - if ( m_backgroundMode == wxTRANSPARENT ) - m_graphicContext->DrawText( str, x ,y , DegToRad(angle )); - else - m_graphicContext->DrawText( str, x ,y , DegToRad(angle ), m_graphicContext->CreateBrush( wxBrush(m_textBackgroundColour,wxSOLID) ) ); -} - -void wxGCDC::DoDrawText(const wxString& str, wxCoord x, wxCoord y) -{ - wxCHECK_RET( Ok(), wxT("wxGCDC(cg)::DoDrawRotatedText - invalid DC") ); - - if ( str.length() == 0 ) - return; - - if ( !m_logicalFunctionSupported ) - return; - - if ( m_backgroundMode == wxTRANSPARENT ) - m_graphicContext->DrawText( str, x ,y); - else - m_graphicContext->DrawText( str, x ,y , m_graphicContext->CreateBrush( wxBrush(m_textBackgroundColour,wxSOLID) ) ); -} - -bool wxGCDC::CanGetTextExtent() const -{ - wxCHECK_MSG( Ok(), false, wxT("wxGCDC(cg)::CanGetTextExtent - invalid DC") ); - - return true; -} - -void wxGCDC::DoGetTextExtent( const wxString &str, wxCoord *width, wxCoord *height, - wxCoord *descent, wxCoord *externalLeading , - wxFont *theFont ) const -{ - wxCHECK_RET( Ok(), wxT("wxGCDC(cg)::DoGetTextExtent - invalid DC") ); - - if ( theFont ) - { - m_graphicContext->SetFont( *theFont, m_textForegroundColour ); - } - - wxDouble h , d , e , w; - - m_graphicContext->GetTextExtent( str, &w, &h, &d, &e ); - - if ( height ) - *height = (wxCoord)(h+0.5); - if ( descent ) - *descent = (wxCoord)(d+0.5); - if ( externalLeading ) - *externalLeading = (wxCoord)(e+0.5); - if ( width ) - *width = (wxCoord)(w+0.5); - - if ( theFont ) - { - m_graphicContext->SetFont( m_font, m_textForegroundColour ); - } -} - -bool wxGCDC::DoGetPartialTextExtents(const wxString& text, wxArrayInt& widths) const -{ - wxCHECK_MSG( Ok(), false, wxT("wxGCDC(cg)::DoGetPartialTextExtents - invalid DC") ); - widths.Clear(); - widths.Add(0,text.Length()); - if ( text.IsEmpty() ) - return true; - - wxArrayDouble widthsD; - - m_graphicContext->GetPartialTextExtents( text, widthsD ); - for ( size_t i = 0; i < widths.GetCount(); ++i ) - widths[i] = (wxCoord)(widthsD[i] + 0.5); - - return true; -} - -wxCoord wxGCDC::GetCharWidth(void) const -{ - wxCoord width; - DoGetTextExtent( wxT("g") , &width , NULL , NULL , NULL , NULL ); - - return width; -} - -wxCoord wxGCDC::GetCharHeight(void) const -{ - wxCoord height; - DoGetTextExtent( wxT("g") , NULL , &height , NULL , NULL , NULL ); - - return height; -} - -void wxGCDC::Clear(void) -{ - wxCHECK_RET( Ok(), wxT("wxGCDC(cg)::Clear - invalid DC") ); - // TODO better implementation / incorporate size info into wxGCDC or context - m_graphicContext->SetBrush( m_backgroundBrush ); - wxPen p = *wxTRANSPARENT_PEN; - m_graphicContext->SetPen( p ); - DoDrawRectangle( 0, 0, 32000 , 32000 ); - m_graphicContext->SetPen( m_pen ); - m_graphicContext->SetBrush( m_brush ); -} - -void wxGCDC::DoGetSize(int *width, int *height) const -{ - *width = 10000; - *height = 10000; -} - -void wxGCDC::DoGradientFillLinear(const wxRect& rect, - const wxColour& initialColour, - const wxColour& destColour, - wxDirection nDirection ) -{ - wxPoint start; - wxPoint end; - switch( nDirection) - { - case wxWEST : - start = rect.GetRightBottom(); - start.x++; - end = rect.GetLeftBottom(); - break; - case wxEAST : - start = rect.GetLeftBottom(); - end = rect.GetRightBottom(); - end.x++; - break; - case wxNORTH : - start = rect.GetLeftBottom(); - start.y++; - end = rect.GetLeftTop(); - break; - case wxSOUTH : - start = rect.GetLeftTop(); - end = rect.GetLeftBottom(); - end.y++; - break; - default : - break; - } - - if (rect.width == 0 || rect.height == 0) - return; - - m_graphicContext->SetBrush( m_graphicContext->CreateLinearGradientBrush( - start.x,start.y,end.x,end.y, initialColour, destColour)); - m_graphicContext->SetPen(*wxTRANSPARENT_PEN); - m_graphicContext->DrawRectangle(rect.x,rect.y,rect.width,rect.height); - m_graphicContext->SetPen(m_pen); -} - -void wxGCDC::DoGradientFillConcentric(const wxRect& rect, - const wxColour& initialColour, - const wxColour& destColour, - const wxPoint& circleCenter) -{ - //Radius - wxInt32 cx = rect.GetWidth() / 2; - wxInt32 cy = rect.GetHeight() / 2; - wxInt32 nRadius; - if (cx < cy) - nRadius = cx; - else - nRadius = cy; - - // make sure the background is filled (todo move into specific platform implementation ?) - m_graphicContext->SetPen(*wxTRANSPARENT_PEN); - m_graphicContext->SetBrush( wxBrush( destColour) ); - m_graphicContext->DrawRectangle(rect.x,rect.y,rect.width,rect.height); - - m_graphicContext->SetBrush( m_graphicContext->CreateRadialGradientBrush( - rect.x+circleCenter.x,rect.y+circleCenter.y, - rect.x+circleCenter.x,rect.y+circleCenter.y, - nRadius,initialColour,destColour)); - - m_graphicContext->DrawRectangle(rect.x,rect.y,rect.width,rect.height); - m_graphicContext->SetPen(m_pen); -} - -void wxGCDC::DoDrawCheckMark(wxCoord x, wxCoord y, - wxCoord width, wxCoord height) -{ - wxDCBase::DoDrawCheckMark(x,y,width,height); -} - -#endif // wxUSE_GRAPHICS_CONTEXT diff --git a/wxWidgets/src/common/debugrpt.cpp b/wxWidgets/src/common/debugrpt.cpp deleted file mode 100644 index 2520a2d286..0000000000 --- a/wxWidgets/src/common/debugrpt.cpp +++ /dev/null @@ -1,698 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: src/common/debugrpt.cpp -// Purpose: wxDebugReport and related classes implementation -// Author: Vadim Zeitlin -// Modified by: -// Created: 2005-01-17 -// RCS-ID: $Id: debugrpt.cpp 42650 2006-10-29 19:53:53Z VZ $ -// Copyright: (c) 2005 Vadim Zeitlin -// License: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#ifndef WX_PRECOMP - #include "wx/app.h" - #include "wx/log.h" - #include "wx/intl.h" - #include "wx/utils.h" -#endif // WX_PRECOMP - -#if wxUSE_DEBUGREPORT && wxUSE_XML - -#include "wx/debugrpt.h" - -#include "wx/ffile.h" -#include "wx/filename.h" -#include "wx/dir.h" -#include "wx/dynlib.h" - -#include "wx/xml/xml.h" - -#if wxUSE_STACKWALKER - #include "wx/stackwalk.h" -#endif - -#if wxUSE_CRASHREPORT - #include "wx/msw/crashrpt.h" -#endif - -#if wxUSE_ZIPSTREAM - #include "wx/wfstream.h" - #include "wx/zipstrm.h" -#endif // wxUSE_ZIPSTREAM - -WX_CHECK_BUILD_OPTIONS("wxQA") - -// ---------------------------------------------------------------------------- -// XmlStackWalker: stack walker specialization which dumps stack in XML -// ---------------------------------------------------------------------------- - -#if wxUSE_STACKWALKER - -class XmlStackWalker : public wxStackWalker -{ -public: - XmlStackWalker(wxXmlNode *nodeStack) - { - m_isOk = false; - m_nodeStack = nodeStack; - } - - bool IsOk() const { return m_isOk; } - -protected: - virtual void OnStackFrame(const wxStackFrame& frame); - - wxXmlNode *m_nodeStack; - bool m_isOk; -}; - -// ---------------------------------------------------------------------------- -// local functions -// ---------------------------------------------------------------------------- - -static inline void -HexProperty(wxXmlNode *node, const wxChar *name, unsigned long value) -{ - node->AddProperty(name, wxString::Format(_T("%08lx"), value)); -} - -static inline void -NumProperty(wxXmlNode *node, const wxChar *name, unsigned long value) -{ - node->AddProperty(name, wxString::Format(_T("%lu"), value)); -} - -static inline void -TextElement(wxXmlNode *node, const wxChar *name, const wxString& value) -{ - wxXmlNode *nodeChild = new wxXmlNode(wxXML_ELEMENT_NODE, name); - node->AddChild(nodeChild); - nodeChild->AddChild(new wxXmlNode(wxXML_TEXT_NODE, wxEmptyString, value)); -} - -#if wxUSE_CRASHREPORT && defined(__INTEL__) - -static inline void -HexElement(wxXmlNode *node, const wxChar *name, unsigned long value) -{ - TextElement(node, name, wxString::Format(_T("%08lx"), value)); -} - -#endif // wxUSE_CRASHREPORT - -// ============================================================================ -// XmlStackWalker implementation -// ============================================================================ - -void XmlStackWalker::OnStackFrame(const wxStackFrame& frame) -{ - m_isOk = true; - - wxXmlNode *nodeFrame = new wxXmlNode(wxXML_ELEMENT_NODE, _T("frame")); - m_nodeStack->AddChild(nodeFrame); - - NumProperty(nodeFrame, _T("level"), frame.GetLevel()); - wxString func = frame.GetName(); - if ( !func.empty() ) - { - nodeFrame->AddProperty(_T("function"), func); - HexProperty(nodeFrame, _T("offset"), frame.GetOffset()); - } - - if ( frame.HasSourceLocation() ) - { - nodeFrame->AddProperty(_T("file"), frame.GetFileName()); - NumProperty(nodeFrame, _T("line"), frame.GetLine()); - } - - const size_t nParams = frame.GetParamCount(); - if ( nParams ) - { - wxXmlNode *nodeParams = new wxXmlNode(wxXML_ELEMENT_NODE, _T("parameters")); - nodeFrame->AddChild(nodeParams); - - for ( size_t n = 0; n < nParams; n++ ) - { - wxXmlNode * - nodeParam = new wxXmlNode(wxXML_ELEMENT_NODE, _T("parameter")); - nodeParams->AddChild(nodeParam); - - NumProperty(nodeParam, _T("number"), n); - - wxString type, name, value; - if ( !frame.GetParam(n, &type, &name, &value) ) - continue; - - if ( !type.empty() ) - TextElement(nodeParam, _T("type"), type); - - if ( !name.empty() ) - TextElement(nodeParam, _T("name"), name); - - if ( !value.empty() ) - TextElement(nodeParam, _T("value"), value); - } - } -} - -#endif // wxUSE_STACKWALKER - -// ============================================================================ -// wxDebugReport implementation -// ============================================================================ - -// ---------------------------------------------------------------------------- -// initialization and cleanup -// ---------------------------------------------------------------------------- - -wxDebugReport::wxDebugReport() -{ - // get a temporary directory name - wxString appname = GetReportName(); - - // we can't use CreateTempFileName() because it creates a file, not a - // directory, so do our best to create a unique name ourselves - // - // of course, this doesn't protect us against malicious users... - wxFileName fn; - fn.AssignTempFileName(appname); -#if wxUSE_DATETIME - m_dir.Printf(_T("%s%c%s_dbgrpt-%lu-%s"), - fn.GetPath().c_str(), wxFILE_SEP_PATH, appname.c_str(), - wxGetProcessId(), - wxDateTime::Now().Format(_T("%Y%m%dT%H%M%S")).c_str()); -#else - m_dir.Printf(_T("%s%c%s_dbgrpt-%lu"), - fn.GetPath().c_str(), wxFILE_SEP_PATH, appname.c_str(), - wxGetProcessId()); -#endif - - // as we are going to save the process state there use restrictive - // permissions - if ( !wxMkdir(m_dir, 0700) ) - { - wxLogSysError(_("Failed to create directory \"%s\""), m_dir.c_str()); - wxLogError(_("Debug report couldn't be created.")); - - Reset(); - } -} - -wxDebugReport::~wxDebugReport() -{ - if ( !m_dir.empty() ) - { - // remove all files in this directory - wxDir dir(m_dir); - wxString file; - for ( bool cont = dir.GetFirst(&file); cont; cont = dir.GetNext(&file) ) - { - if ( wxRemove(wxFileName(m_dir, file).GetFullPath()) != 0 ) - { - wxLogSysError(_("Failed to remove debug report file \"%s\""), - file.c_str()); - m_dir.clear(); - break; - } - } - } - - if ( !m_dir.empty() ) - { - // Temp fix: what should this be? eVC++ doesn't like wxRmDir -#ifdef __WXWINCE__ - if ( wxRmdir(m_dir.fn_str()) != 0 ) -#else - if ( wxRmDir(m_dir.fn_str()) != 0 ) -#endif - { - wxLogSysError(_("Failed to clean up debug report directory \"%s\""), - m_dir.c_str()); - } - } -} - -// ---------------------------------------------------------------------------- -// various helpers -// ---------------------------------------------------------------------------- - -wxString wxDebugReport::GetReportName() const -{ - if(wxTheApp) - return wxTheApp->GetAppName(); - - return _T("wx"); -} - -void -wxDebugReport::AddFile(const wxString& filename, const wxString& description) -{ - wxString name; - wxFileName fn(filename); - if ( fn.IsAbsolute() ) - { - // we need to copy the file to the debug report directory: give it the - // same name there - name = fn.GetFullName(); - wxCopyFile(fn.GetFullPath(), - wxFileName(GetDirectory(), name).GetFullPath()); - } - else // file relative to the report directory - { - name = filename; - - wxASSERT_MSG( wxFileName(GetDirectory(), name).FileExists(), - _T("file should exist in debug report directory") ); - } - - m_files.Add(name); - m_descriptions.Add(description); -} - -bool -wxDebugReport::AddText(const wxString& filename, - const wxString& text, - const wxString& description) -{ - wxASSERT_MSG( !wxFileName(filename).IsAbsolute(), - _T("filename should be relative to debug report directory") ); - - wxFileName fn(GetDirectory(), filename); - wxFFile file(fn.GetFullPath(), _T("w")); - if ( !file.IsOpened() || !file.Write(text) ) - return false; - - AddFile(filename, description); - - return true; -} - -void wxDebugReport::RemoveFile(const wxString& name) -{ - const int n = m_files.Index(name); - wxCHECK_RET( n != wxNOT_FOUND, _T("No such file in wxDebugReport") ); - - m_files.RemoveAt(n); - m_descriptions.RemoveAt(n); - - wxRemove(wxFileName(GetDirectory(), name).GetFullPath()); -} - -bool wxDebugReport::GetFile(size_t n, wxString *name, wxString *desc) const -{ - if ( n >= m_files.GetCount() ) - return false; - - if ( name ) - *name = m_files[n]; - if ( desc ) - *desc = m_descriptions[n]; - - return true; -} - -void wxDebugReport::AddAll(Context context) -{ -#if wxUSE_STACKWALKER - AddContext(context); -#endif // wxUSE_STACKWALKER - -#if wxUSE_CRASHREPORT - AddDump(context); -#endif // wxUSE_CRASHREPORT - -#if !wxUSE_STACKWALKER && !wxUSE_CRASHREPORT - wxUnusedVar(context); -#endif -} - -// ---------------------------------------------------------------------------- -// adding basic text information about current context -// ---------------------------------------------------------------------------- - -#if wxUSE_STACKWALKER - -bool wxDebugReport::DoAddSystemInfo(wxXmlNode *nodeSystemInfo) -{ - nodeSystemInfo->AddProperty(_T("description"), wxGetOsDescription()); - - return true; -} - -bool wxDebugReport::DoAddLoadedModules(wxXmlNode *nodeModules) -{ - wxDynamicLibraryDetailsArray modules(wxDynamicLibrary::ListLoaded()); - const size_t count = modules.GetCount(); - if ( !count ) - return false; - - for ( size_t n = 0; n < count; n++ ) - { - const wxDynamicLibraryDetails& info = modules[n]; - - wxXmlNode *nodeModule = new wxXmlNode(wxXML_ELEMENT_NODE, _T("module")); - nodeModules->AddChild(nodeModule); - - wxString path = info.GetPath(); - if ( path.empty() ) - path = info.GetName(); - if ( !path.empty() ) - nodeModule->AddProperty(_T("path"), path); - - void *addr = NULL; - size_t len = 0; - if ( info.GetAddress(&addr, &len) ) - { - HexProperty(nodeModule, _T("address"), wxPtrToUInt(addr)); - HexProperty(nodeModule, _T("size"), len); - } - - wxString ver = info.GetVersion(); - if ( !ver.empty() ) - { - nodeModule->AddProperty(_T("version"), ver); - } - } - - return true; -} - -bool wxDebugReport::DoAddExceptionInfo(wxXmlNode *nodeContext) -{ -#if wxUSE_CRASHREPORT - wxCrashContext c; - if ( !c.code ) - return false; - - wxXmlNode *nodeExc = new wxXmlNode(wxXML_ELEMENT_NODE, _T("exception")); - nodeContext->AddChild(nodeExc); - - HexProperty(nodeExc, _T("code"), c.code); - nodeExc->AddProperty(_T("name"), c.GetExceptionString()); - HexProperty(nodeExc, _T("address"), wxPtrToUInt(c.addr)); - -#ifdef __INTEL__ - wxXmlNode *nodeRegs = new wxXmlNode(wxXML_ELEMENT_NODE, _T("registers")); - nodeContext->AddChild(nodeRegs); - HexElement(nodeRegs, _T("eax"), c.regs.eax); - HexElement(nodeRegs, _T("ebx"), c.regs.ebx); - HexElement(nodeRegs, _T("ecx"), c.regs.edx); - HexElement(nodeRegs, _T("edx"), c.regs.edx); - HexElement(nodeRegs, _T("esi"), c.regs.esi); - HexElement(nodeRegs, _T("edi"), c.regs.edi); - - HexElement(nodeRegs, _T("ebp"), c.regs.ebp); - HexElement(nodeRegs, _T("esp"), c.regs.esp); - HexElement(nodeRegs, _T("eip"), c.regs.eip); - - HexElement(nodeRegs, _T("cs"), c.regs.cs); - HexElement(nodeRegs, _T("ds"), c.regs.ds); - HexElement(nodeRegs, _T("es"), c.regs.es); - HexElement(nodeRegs, _T("fs"), c.regs.fs); - HexElement(nodeRegs, _T("gs"), c.regs.gs); - HexElement(nodeRegs, _T("ss"), c.regs.ss); - - HexElement(nodeRegs, _T("flags"), c.regs.flags); -#endif // __INTEL__ - - return true; -#else // !wxUSE_CRASHREPORT - wxUnusedVar(nodeContext); - - return false; -#endif // wxUSE_CRASHREPORT/!wxUSE_CRASHREPORT -} - -bool wxDebugReport::AddContext(wxDebugReport::Context ctx) -{ - wxCHECK_MSG( IsOk(), false, _T("use IsOk() first") ); - - // create XML dump of current context - wxXmlDocument xmldoc; - wxXmlNode *nodeRoot = new wxXmlNode(wxXML_ELEMENT_NODE, _T("report")); - xmldoc.SetRoot(nodeRoot); - nodeRoot->AddProperty(_T("version"), _T("1.0")); - nodeRoot->AddProperty(_T("kind"), ctx == Context_Current ? _T("user") - : _T("exception")); - - // add system information - wxXmlNode *nodeSystemInfo = new wxXmlNode(wxXML_ELEMENT_NODE, _T("system")); - if ( DoAddSystemInfo(nodeSystemInfo) ) - nodeRoot->AddChild(nodeSystemInfo); - else - delete nodeSystemInfo; - - // add information about the loaded modules - wxXmlNode *nodeModules = new wxXmlNode(wxXML_ELEMENT_NODE, _T("modules")); - if ( DoAddLoadedModules(nodeModules) ) - nodeRoot->AddChild(nodeModules); - else - delete nodeModules; - - // add CPU context information: this only makes sense for exceptions as our - // current context is not very interesting otherwise - if ( ctx == Context_Exception ) - { - wxXmlNode *nodeContext = new wxXmlNode(wxXML_ELEMENT_NODE, _T("context")); - if ( DoAddExceptionInfo(nodeContext) ) - nodeRoot->AddChild(nodeContext); - else - delete nodeContext; - } - - // add stack traceback -#if wxUSE_STACKWALKER - wxXmlNode *nodeStack = new wxXmlNode(wxXML_ELEMENT_NODE, _T("stack")); - XmlStackWalker sw(nodeStack); - if ( ctx == Context_Exception ) - { - sw.WalkFromException(); - } - else // Context_Current - { - sw.Walk(); - } - - if ( sw.IsOk() ) - nodeRoot->AddChild(nodeStack); - else - delete nodeStack; -#endif // wxUSE_STACKWALKER - - // finally let the user add any extra information he needs - DoAddCustomContext(nodeRoot); - - - // save the entire context dump in a file - wxFileName fn(m_dir, GetReportName(), _T("xml")); - - if ( !xmldoc.Save(fn.GetFullPath()) ) - return false; - - AddFile(fn.GetFullName(), _("process context description")); - - return true; -} - -#endif // wxUSE_STACKWALKER - -// ---------------------------------------------------------------------------- -// adding core dump -// ---------------------------------------------------------------------------- - -#if wxUSE_CRASHREPORT - -bool wxDebugReport::AddDump(Context ctx) -{ - wxCHECK_MSG( IsOk(), false, _T("use IsOk() first") ); - - wxFileName fn(m_dir, GetReportName(), _T("dmp")); - wxCrashReport::SetFileName(fn.GetFullPath()); - - if ( !(ctx == Context_Exception ? wxCrashReport::Generate() - : wxCrashReport::GenerateNow()) ) - return false; - - AddFile(fn.GetFullName(), _("dump of the process state (binary)")); - - return true; -} - -#endif // wxUSE_CRASHREPORT - -// ---------------------------------------------------------------------------- -// report processing -// ---------------------------------------------------------------------------- - -bool wxDebugReport::Process() -{ - if ( !GetFilesCount() ) - { - wxLogError(_("Debug report generation has failed.")); - - return false; - } - - if ( !DoProcess() ) - { - wxLogError(_("Processing debug report has failed, leaving the files in \"%s\" directory."), - GetDirectory().c_str()); - - Reset(); - - return false; - } - - return true; -} - -bool wxDebugReport::DoProcess() -{ - wxString msg(_("A debug report has been generated. It can be found in")); - msg << _T("\n") - _T("\t") << GetDirectory() << _T("\n\n") - << _("And includes the following files:\n"); - - wxString name, desc; - const size_t count = GetFilesCount(); - for ( size_t n = 0; n < count; n++ ) - { - GetFile(n, &name, &desc); - msg += wxString::Format(_("\t%s: %s\n"), name.c_str(), desc.c_str()); - } - - msg += _("\nPlease send this report to the program maintainer, thank you!\n"); - - wxLogMessage(_T("%s"), msg.c_str()); - - // we have to do this or the report would be deleted, and we don't even - // have any way to ask the user if he wants to keep it from here - Reset(); - - return true; -} - -// ============================================================================ -// wxDebugReport-derived classes -// ============================================================================ - -#if wxUSE_ZIPSTREAM - -// ---------------------------------------------------------------------------- -// wxDebugReportCompress -// ---------------------------------------------------------------------------- - -bool wxDebugReportCompress::DoProcess() -{ - const size_t count = GetFilesCount(); - if ( !count ) - return false; - - // create the streams - wxFileName fn(GetDirectory(), GetReportName(), _T("zip")); - wxFFileOutputStream os(fn.GetFullPath(), _T("wb")); - wxZipOutputStream zos(os, 9); - - // add all files to the ZIP one - wxString name, desc; - for ( size_t n = 0; n < count; n++ ) - { - GetFile(n, &name, &desc); - - wxZipEntry *ze = new wxZipEntry(name); - ze->SetComment(desc); - - if ( !zos.PutNextEntry(ze) ) - return false; - - wxFileName filename(fn.GetPath(), name); - wxFFileInputStream is(filename.GetFullPath()); - if ( !is.IsOk() || !zos.Write(is).IsOk() ) - return false; - } - - if ( !zos.Close() ) - return false; - - m_zipfile = fn.GetFullPath(); - - return true; -} - -// ---------------------------------------------------------------------------- -// wxDebugReportUpload -// ---------------------------------------------------------------------------- - -wxDebugReportUpload::wxDebugReportUpload(const wxString& url, - const wxString& input, - const wxString& action, - const wxString& curl) - : m_uploadURL(url), - m_inputField(input), - m_curlCmd(curl) -{ - if ( m_uploadURL.Last() != _T('/') ) - m_uploadURL += _T('/'); - m_uploadURL += action; -} - -bool wxDebugReportUpload::DoProcess() -{ - if ( !wxDebugReportCompress::DoProcess() ) - return false; - - - wxArrayString output, errors; - int rc = wxExecute(wxString::Format - ( - _T("%s -F %s=@\"%s\" %s"), - m_curlCmd.c_str(), - m_inputField.c_str(), - GetCompressedFileName().c_str(), - m_uploadURL.c_str() - ), - output, - errors); - if ( rc == -1 ) - { - wxLogError(_("Failed to execute curl, please install it in PATH.")); - } - else if ( rc != 0 ) - { - const size_t count = errors.GetCount(); - if ( count ) - { - for ( size_t n = 0; n < count; n++ ) - { - wxLogWarning(_T("%s"), errors[n].c_str()); - } - } - - wxLogError(_("Failed to upload the debug report (error code %d)."), rc); - } - else // rc == 0 - { - if ( OnServerReply(output) ) - return true; - } - - return false; -} - -#endif // wxUSE_ZIPSTREAM - -#endif // wxUSE_DEBUGREPORT diff --git a/wxWidgets/src/common/descrip.mms b/wxWidgets/src/common/descrip.mms deleted file mode 100644 index b5c7b37ae8..0000000000 --- a/wxWidgets/src/common/descrip.mms +++ /dev/null @@ -1,583 +0,0 @@ -#***************************************************************************** -# * -# Make file for VMS * -# Author : J.Jansen (joukj@hrem.nano.tudelft.nl) * -# Date : 1 December 2006 * -# * -#***************************************************************************** -.first - define wx [--.include.wx] - -.ifdef __WXMOTIF__ -CXX_DEFINE = /define=(__WXMOTIF__=1)/name=(as_is,short)\ - /assume=(nostdnew,noglobal_array_new) -CC_DEFINE = /define=(__WXMOTIF__=1)/name=(as_is,short) -.else -.ifdef __WXGTK__ -CXX_DEFINE = /define=(__WXGTK__=1)/float=ieee/name=(as_is,short)/ieee=denorm\ - /assume=(nostdnew,noglobal_array_new) -CC_DEFINE = /define=(__WXGTK__=1)/float=ieee/name=(as_is,short)/ieee=denorm -.else -.ifdef __WXGTK2__ -CXX_DEFINE = /define=(__WXGTK__=1,VMS_GTK2=1)/float=ieee/name=(as_is,short)/ieee=denorm\ - /assume=(nostdnew,noglobal_array_new) -CC_DEFINE = /define=(__WXGTK__=1,VMS_GTK2=1)/float=ieee/name=(as_is,short)/ieee=denorm -.else -.ifdef __WXX11__ -CXX_DEFINE = /define=(__WXX11__=1,__WXUNIVERSAL__==1)/float=ieee\ - /name=(as_is,short)/assume=(nostdnew,noglobal_array_new) -CC_DEFINE = /define=(__WXX11__=1,__WXUNIVERSAL__==1)/float=ieee\ - /name=(as_is,short) -.else -CXX_DEFINE = -CC_DEFINE = -.endif -.endif -.endif -.endif - -YACC=bison/yacc - -SED=gsed - -LEX=flex - -.suffixes : .cpp - -.cpp.obj : - cxx $(CXXFLAGS)$(CXX_DEFINE) $(MMS$TARGET_NAME).cpp -.c.obj : - cc $(CFLAGS)$(CC_DEFINE) $(MMS$TARGET_NAME).c - -OBJECTS = \ - anidecod.obj,\ - animatecmn.obj,\ - appbase.obj,\ - appcmn.obj,\ - artprov.obj,\ - artstd.obj,\ - bmpbase.obj,\ - bookctrl.obj,\ - choiccmn.obj,\ - clipcmn.obj,\ - clntdata.obj,\ - cmdline.obj,\ - cmdproc.obj,\ - cmndata.obj,\ - config.obj,\ - containr.obj,\ - convauto.obj,\ - colourcmn.obj,\ - cshelp.obj,\ - ctrlcmn.obj,\ - ctrlsub.obj,\ - datacmn.obj,\ - datetime.obj,\ - datstrm.obj,\ - db.obj,\ - dbgrid.obj,\ - dbtable.obj,\ - dcbase.obj,\ - dcbufcmn.obj,\ - dircmn.obj,\ - dlgcmn.obj,\ - dobjcmn.obj,\ - docmdi.obj,\ - docview.obj,\ - dpycmn.obj,\ - dynarray.obj,\ - dynlib.obj,\ - encconv.obj,\ - event.obj,\ - evtloopcmn.obj,\ - extended.obj,\ - fddlgcmn.obj,\ - ffile.obj,\ - file.obj,\ - fileback.obj,\ - fileconf.obj,\ - filename.obj,\ - filefn.obj,\ - filesys.obj,\ - fldlgcmn.obj,\ - fmapbase.obj,\ - fontcmn.obj,\ - fontenumcmn.obj,\ - fontmap.obj,\ - framecmn.obj - -OBJECTS1=fs_inet.obj,\ - ftp.obj,\ - gaugecmn.obj,\ - gbsizer.obj,\ - gdicmn.obj,\ - gifdecod.obj,\ - hash.obj,\ - hashmap.obj,\ - helpbase.obj,\ - http.obj,\ - iconbndl.obj,\ - init.obj,\ - imagall.obj,\ - imagbmp.obj,\ - image.obj,\ - imagfill.obj,\ - imaggif.obj,\ - imagiff.obj,\ - imagjpeg.obj,\ - imagpcx.obj,\ - imagpng.obj,\ - imagpnm.obj,\ - imagtga.obj,\ - imagtiff.obj,\ - imagxpm.obj,\ - intl.obj,\ - ipcbase.obj,\ - layout.obj,\ - lboxcmn.obj,\ - list.obj,\ - log.obj,\ - longlong.obj,\ - memory.obj,\ - menucmn.obj,\ - mimecmn.obj,\ - module.obj,\ - msgout.obj,\ - mstream.obj,\ - nbkbase.obj,\ - object.obj,\ - paper.obj,\ - platinfo.obj,\ - popupcmn.obj,\ - prntbase.obj,\ - process.obj,\ - protocol.obj,\ - quantize.obj,\ - radiocmn.obj,\ - rendcmn.obj,\ - sckaddr.obj,\ - sckfile.obj,\ - sckipc.obj,\ - sckstrm.obj,\ - sizer.obj,\ - socket.obj,\ - settcmn.obj,\ - statbar.obj,\ - stdpbase.obj,\ - stockitem.obj,\ - stopwatch.obj,\ - strconv.obj,\ - stream.obj,\ - string.obj,\ - sysopt.obj - -OBJECTS2=tbarbase.obj,\ - textbuf.obj,\ - textcmn.obj,\ - textfile.obj,\ - timercmn.obj,\ - tokenzr.obj,\ - toplvcmn.obj,\ - treebase.obj,\ - txtstrm.obj,\ - url.obj,\ - utilscmn.obj,\ - rgncmn.obj,\ - uri.obj,\ - valgen.obj,\ - validate.obj,\ - valtext.obj,\ - variant.obj,\ - wfstream.obj,\ - wxchar.obj,\ - wincmn.obj,\ - xpmdecod.obj,\ - zipstrm.obj,\ - zstream.obj,\ - clrpickercmn.obj,\ - filepickercmn.obj,\ - fontpickercmn.obj,\ - pickerbase.obj,\ - listctrlcmn.obj - -OBJECTS_MOTIF=radiocmn.obj,combocmn.obj - -OBJECTS_X11=accesscmn.obj,dndcmn.obj,dpycmn.obj,dseldlg.obj,\ - dynload.obj,effects.obj,fddlgcmn.obj,fs_mem.obj,\ - gbsizer.obj,geometry.obj,matrix.obj,radiocmn.obj,\ - regex.obj,taskbarcmn.obj,xti.obj,xtistrm.obj,xtixml.obj,\ - combocmn.obj - -OBJECTS_X11_2=socketevtdispatch.obj - -SOURCES = \ - anidecod.cpp,\ - animatecmn.cpp,\ - appbase.cpp,\ - appcmn.cpp,\ - artprov.cpp,\ - artstd.cpp,\ - bmpbase.cpp,\ - bookctrl.cpp,\ - choiccmn.cpp,\ - clipcmn.cpp,\ - clntdata.cpp,\ - cmdline.cpp,\ - cmdproc.cpp,\ - cmndata.cpp,\ - config.cpp,\ - containr.cpp,\ - convauto.cpp,\ - colourcmn.cpp,\ - cshelp.cpp,\ - ctrlcmn.cpp,\ - ctrlsub.cpp,\ - datacmn.cpp,\ - datetime.cpp,\ - datstrm.cpp,\ - db.cpp,\ - dbgrid.cpp,\ - dbtable.cpp,\ - dcbase.cpp,\ - dcbufcmn.cpp,\ - dircmn.cpp,\ - dlgcmn.cpp,\ - dobjcmn.cpp,\ - docmdi.cpp,\ - docview.cpp,\ - dpycmn.cpp,\ - dynarray.cpp,\ - dynlib.cpp,\ - encconv.cpp,\ - event.cpp,\ - evtloopcmn.cpp,\ - extended.c,\ - ffile.cpp,\ - fddlgcmn.cpp,\ - file.cpp,\ - fileback.cpp,\ - fileconf.cpp,\ - filename.cpp,\ - filefn.cpp,\ - filesys.cpp,\ - fldlgcmn.cpp,\ - fmapbase.cpp,\ - fontcmn.cpp,\ - fontenumcmn.cpp,\ - fontmap.cpp,\ - framecmn.cpp,\ - fs_inet.cpp,\ - ftp.cpp,\ - gaugecmn.cpp,\ - gbsizer.cpp,\ - gdicmn.cpp,\ - gifdecod.cpp,\ - hash.cpp,\ - hashmap.cpp,\ - helpbase.cpp,\ - http.cpp,\ - iconbndl.cpp,\ - init.cpp,\ - imagall.cpp,\ - imagbmp.cpp,\ - image.cpp,\ - imagfill.cpp,\ - imaggif.cpp,\ - imagiff.cpp,\ - imagjpeg.cpp,\ - imagpcx.cpp,\ - imagpng.cpp,\ - imagpnm.cpp,\ - imagtga.cpp,\ - imagtiff.cpp,\ - imagxpm.cpp,\ - intl.cpp,\ - ipcbase.cpp,\ - layout.cpp,\ - lboxcmn.cpp,\ - list.cpp,\ - listctrlcmn.cpp,\ - log.cpp,\ - longlong.cpp,\ - memory.cpp,\ - menucmn.cpp,\ - mimecmn.cpp,\ - module.cpp,\ - msgout.cpp,\ - mstream.cpp,\ - nbkbase.cpp,\ - object.cpp,\ - paper.cpp,\ - platinfo.cpp,\ - popupcmn.cpp,\ - prntbase.cpp,\ - process.cpp,\ - protocol.cpp,\ - quantize.cpp,\ - radiocmn.cpp,\ - rendcmn.cpp,\ - rgncmn.cpp,\ - sckaddr.cpp,\ - sckfile.cpp,\ - sckipc.cpp,\ - sckstrm.cpp,\ - sizer.cpp,\ - socket.cpp,\ - socketevtdispatch.cpp,\ - settcmn.cpp,\ - statbar.cpp,\ - stdpbase.cpp,\ - stockitem.cpp,\ - stopwatch.cpp,\ - strconv.cpp,\ - stream.cpp,\ - sysopt.cpp,\ - string.cpp,\ - tbarbase.cpp,\ - textbuf.cpp,\ - textcmn.cpp,\ - textfile.cpp,\ - timercmn.cpp,\ - tokenzr.cpp,\ - toplvcmn.cpp,\ - treebase.cpp,\ - txtstrm.cpp,\ - url.cpp,\ - utilscmn.cpp,\ - valgen.cpp,\ - validate.cpp,\ - valtext.cpp,\ - variant.cpp,\ - wfstream.cpp,\ - wincmn.cpp,\ - wxchar.cpp,\ - xpmdecod.cpp,\ - zipstrm.cpp,\ - zstream.cpp,\ - clrpickercmn.cpp,\ - filepickercmn.cpp,\ - fontpickercmn.cpp,\ - pickerbase.cpp,\ - accesscmn.cpp,\ - dndcmn.cpp,\ - dpycmn.cpp,\ - dseldlg.cpp,\ - dynload.cpp,\ - effects.cpp,\ - fddlgcmn.cpp,\ - fs_mem.cpp,\ - gbsizer.cpp,\ - geometry.cpp,\ - matrix.cpp,\ - radiocmn.cpp,\ - regex.cpp,\ - taskbarcmn.cpp,\ - uri.cpp,\ - xti.cpp,\ - xtistrm.cpp,\ - xtixml.cpp - -all : $(SOURCES) - $(MMS)$(MMSQUALIFIERS) $(OBJECTS) - $(MMS)$(MMSQUALIFIERS) $(OBJECTS1) - $(MMS)$(MMSQUALIFIERS) $(OBJECTS2) -.ifdef __WXMOTIF__ - $(MMS)$(MMSQUALIFIERS) $(OBJECTS_MOTIF) - library [--.lib]libwx_motif.olb $(OBJECTS) - library [--.lib]libwx_motif.olb $(OBJECTS1) - library [--.lib]libwx_motif.olb $(OBJECTS2) - library [--.lib]libwx_motif.olb $(OBJECTS_MOTIF) -.else -.ifdef __WXGTK__ - $(MMS)$(MMSQUALIFIERS) $(OBJECTS_X11) - library [--.lib]libwx_gtk.olb $(OBJECTS) - library [--.lib]libwx_gtk.olb $(OBJECTS1) - library [--.lib]libwx_gtk.olb $(OBJECTS2) - library [--.lib]libwx_gtk.olb $(OBJECTS_X11) -.else -.ifdef __WXGTK2__ - $(MMS)$(MMSQUALIFIERS) $(OBJECTS_X11) - library [--.lib]libwx_gtk2.olb $(OBJECTS) - library [--.lib]libwx_gtk2.olb $(OBJECTS1) - library [--.lib]libwx_gtk2.olb $(OBJECTS2) - library [--.lib]libwx_gtk2.olb $(OBJECTS_X11) -.else -.ifdef __WXX11__ - $(MMS)$(MMSQUALIFIERS) $(OBJECTS_X11) - $(MMS)$(MMSQUALIFIERS) $(OBJECTS_X11_2) - library [--.lib]libwx_x11_univ.olb $(OBJECTS) - library [--.lib]libwx_x11_univ.olb $(OBJECTS1) - library [--.lib]libwx_x11_univ.olb $(OBJECTS2) - library [--.lib]libwx_x11_univ.olb $(OBJECTS_X11) - library [--.lib]libwx_x11_univ.olb $(OBJECTS_X11_2) -.endif -.endif -.endif -.endif - -anidecod.obj : anidecod.cpp -animatecmn.obj : animatecmn.cpp -appbase.obj : appbase.cpp -appcmn.obj : appcmn.cpp -artprov.obj : artprov.cpp -artstd.obj : artstd.cpp -bmpbase.obj : bmpbase.cpp -bookctrl.obj : bookctrl.cpp -choiccmn.obj : choiccmn.cpp -clipcmn.obj : clipcmn.cpp -clntdata.obj : clntdata.cpp -cmdline.obj : cmdline.cpp -cmdproc.obj : cmdproc.cpp -cmndata.obj : cmndata.cpp -config.obj : config.cpp -containr.obj : containr.cpp -convauto.obj : convauto.cpp -colourcmn.obj : colourcmn.cpp -cshelp.obj : cshelp.cpp -ctrlcmn.obj : ctrlcmn.cpp -ctrlsub.obj : ctrlsub.cpp -datacmn.obj : datacmn.cpp -datetime.obj : datetime.cpp -datstrm.obj : datstrm.cpp -db.obj : db.cpp -dbgrid.obj : dbgrid.cpp -dbtable.obj : dbtable.cpp -dcbase.obj : dcbase.cpp -dcbufcmn.obj : dcbufcmn.cpp -dircmn.obj : dircmn.cpp -dlgcmn.obj : dlgcmn.cpp -dobjcmn.obj : dobjcmn.cpp -docmdi.obj : docmdi.cpp -docview.obj : docview.cpp -dynarray.obj : dynarray.cpp -dynlib.obj : dynlib.cpp -encconv.obj : encconv.cpp -event.obj : event.cpp -evtloopcmn.obj : evtloopcmn.cpp -extended.obj : extended.c -ffile.obj : ffile.cpp -fddlgcmn.obj : fddlgcmn.cpp -file.obj : file.cpp -fileback.obj : fileback.cpp -fileconf.obj : fileconf.cpp -filefn.obj : filefn.cpp -filename.obj : filename.cpp -filesys.obj : filesys.cpp -fldlgcmn.obj : fldlgcmn.cpp -fmapbase.obj : fmapbase.cpp -fontcmn.obj : fontcmn.cpp -fontenumcmn.obj : fontenumcmn.cpp -fontmap.obj : fontmap.cpp -framecmn.obj : framecmn.cpp -fs_inet.obj : fs_inet.cpp -ftp.obj : ftp.cpp -gaugecmn.obj : gaugecmn.cpp -gbsizer.obj : gbsizer.cpp -gdicmn.obj : gdicmn.cpp -gifdecod.obj : gifdecod.cpp -hash.obj : hash.cpp -hashmap.obj : hashmap.cpp -helpbase.obj : helpbase.cpp -http.obj : http.cpp -iconbndl.obj : iconbndl.cpp -init.obj : init.cpp -imagall.obj : imagall.cpp -imagbmp.obj : imagbmp.cpp -image.obj : image.cpp -imagfill.obj : imagfill.cpp -imaggif.obj : imaggif.cpp -imagiff.obj : imagiff.cpp -imagjpeg.obj : imagjpeg.cpp -imagpcx.obj : imagpcx.cpp -imagpng.obj : imagpng.cpp -imagpnm.obj : imagpnm.cpp -imagtga.obj : imagtga.cpp -imagtiff.obj : imagtiff.cpp -imagxpm.obj : imagxpm.cpp -intl.obj : intl.cpp -ipcbase.obj : ipcbase.cpp -layout.obj : layout.cpp -lboxcmn.obj : lboxcmn.cpp -list.obj : list.cpp -log.obj : log.cpp -longlong.obj : longlong.cpp -memory.obj : memory.cpp -menucmn.obj : menucmn.cpp -mimecmn.obj : mimecmn.cpp -module.obj : module.cpp -msgout.obj : msgout.cpp -mstream.obj : mstream.cpp -nbkbase.obj : nbkbase.cpp -object.obj : object.cpp -paper.obj : paper.cpp -platinfo.obj : platinfo.cpp -popupcmn.obj : popupcmn.cpp -prntbase.obj : prntbase.cpp -process.obj : process.cpp -protocol.obj : protocol.cpp -quantize.obj : quantize.cpp -radiocmn.obj : radiocmn.cpp -rendcmn.obj : rendcmn.cpp -rgncmn.obj : rgncmn.cpp -sckaddr.obj : sckaddr.cpp -sckfile.obj : sckfile.cpp -sckipc.obj : sckipc.cpp -sckstrm.obj : sckstrm.cpp -sizer.obj : sizer.cpp -socket.obj : socket.cpp -socketevtdispatch.obj : socketevtdispatch.cpp -settcmn.obj : settcmn.cpp -statbar.obj : statbar.cpp -stdpbase.obj : stdpbase.cpp -stockitem.obj : stockitem.cpp -stopwatch.obj : stopwatch.cpp -strconv.obj : strconv.cpp -stream.obj : stream.cpp -sysopt.obj : sysopt.cpp -string.obj : string.cpp -tbarbase.obj : tbarbase.cpp -textbuf.obj : textbuf.cpp -textcmn.obj : textcmn.cpp -textfile.obj : textfile.cpp -timercmn.obj : timercmn.cpp -tokenzr.obj : tokenzr.cpp -toplvcmn.obj : toplvcmn.cpp -treebase.obj : treebase.cpp -txtstrm.obj : txtstrm.cpp -url.obj : url.cpp -utilscmn.obj : utilscmn.cpp -valgen.obj : valgen.cpp -validate.obj : validate.cpp -valtext.obj : valtext.cpp -variant.obj : variant.cpp -wfstream.obj : wfstream.cpp -wincmn.obj : wincmn.cpp -wxchar.obj : wxchar.cpp -xpmdecod.obj : xpmdecod.cpp -zipstrm.obj : zipstrm.cpp -zstream.obj : zstream.cpp -accesscmn.obj : accesscmn.cpp -dndcmn.obj : dndcmn.cpp -dpycmn.obj : dpycmn.cpp -dseldlg.obj : dseldlg.cpp -dynload.obj : dynload.cpp -effects.obj : effects.cpp -fddlgcmn.obj : fddlgcmn.cpp -fs_mem.obj : fs_mem.cpp -gbsizer.obj : gbsizer.cpp -geometry.obj : geometry.cpp -matrix.obj : matrix.cpp -radiocmn.obj : radiocmn.cpp -regex.obj : regex.cpp -taskbarcmn.obj : taskbarcmn.cpp -xti.obj : xti.cpp -xtistrm.obj : xtistrm.cpp -xtixml.obj : xtixml.cpp -uri.obj : uri.cpp -dpycmn.obj : dpycmn.cpp -combocmn.obj : combocmn.cpp -clrpickercmn.obj : clrpickercmn.cpp -filepickercmn.obj : filepickercmn.cpp -fontpickercmn.obj : fontpickercmn.cpp -pickerbase.obj : pickerbase.cpp -listctrlcmn.obj : listctrlcmn.cpp diff --git a/wxWidgets/src/common/dircmn.cpp b/wxWidgets/src/common/dircmn.cpp deleted file mode 100644 index 3e79a7a4e9..0000000000 --- a/wxWidgets/src/common/dircmn.cpp +++ /dev/null @@ -1,357 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: src/common/dircmn.cpp -// Purpose: wxDir methods common to all implementations -// Author: Vadim Zeitlin -// Modified by: -// Created: 19.05.01 -// RCS-ID: $Id: dircmn.cpp 40665 2006-08-19 08:45:31Z JS $ -// Copyright: (c) 2001 Vadim Zeitlin -// License: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// 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/log.h" - #include "wx/intl.h" - #include "wx/filefn.h" - #include "wx/arrstr.h" -#endif //WX_PRECOMP - -#include "wx/dir.h" -#include "wx/filename.h" - -// ============================================================================ -// implementation -// ============================================================================ - -// ---------------------------------------------------------------------------- -// wxDirTraverser -// ---------------------------------------------------------------------------- - -wxDirTraverseResult -wxDirTraverser::OnOpenError(const wxString& WXUNUSED(dirname)) -{ - return wxDIR_IGNORE; -} - -// ---------------------------------------------------------------------------- -// wxDir::HasFiles() and HasSubDirs() -// ---------------------------------------------------------------------------- - -// dumb generic implementation - -bool wxDir::HasFiles(const wxString& spec) -{ - wxString s; - return GetFirst(&s, spec, wxDIR_FILES | wxDIR_HIDDEN); -} - -// we have a (much) faster version for Unix -#if (defined(__CYGWIN__) && defined(__WINDOWS__)) || !defined(__UNIX_LIKE__) || defined(__WXMAC__) || defined(__EMX__) || defined(__WINE__) - -bool wxDir::HasSubDirs(const wxString& spec) -{ - wxString s; - return GetFirst(&s, spec, wxDIR_DIRS | wxDIR_HIDDEN); -} - -#endif // !Unix - -// ---------------------------------------------------------------------------- -// wxDir::Traverse() -// ---------------------------------------------------------------------------- - -size_t wxDir::Traverse(wxDirTraverser& sink, - const wxString& filespec, - int flags) const -{ - wxCHECK_MSG( IsOpened(), (size_t)-1, - _T("dir must be opened before traversing it") ); - - // the total number of files found - size_t nFiles = 0; - - // the name of this dir with path delimiter at the end - wxString prefix = GetName(); - prefix += wxFILE_SEP_PATH; - - // first, recurse into subdirs - if ( flags & wxDIR_DIRS ) - { - wxString dirname; - for ( bool cont = GetFirst(&dirname, wxEmptyString, wxDIR_DIRS | (flags & wxDIR_HIDDEN) ); - cont; - cont = cont && GetNext(&dirname) ) - { - const wxString fulldirname = prefix + dirname; - - switch ( sink.OnDir(fulldirname) ) - { - default: - wxFAIL_MSG(_T("unexpected OnDir() return value") ); - // fall through - - case wxDIR_STOP: - cont = false; - break; - - case wxDIR_CONTINUE: - { - wxDir subdir; - - // don't give the error messages for the directories - // which we can't open: there can be all sorts of good - // reason for this (e.g. insufficient privileges) and - // this shouldn't be treated as an error -- instead - // let the user code decide what to do - bool ok; - do - { - wxLogNull noLog; - ok = subdir.Open(fulldirname); - if ( !ok ) - { - // ask the user code what to do - bool tryagain; - switch ( sink.OnOpenError(fulldirname) ) - { - default: - wxFAIL_MSG(_T("unexpected OnOpenError() return value") ); - // fall through - - case wxDIR_STOP: - cont = false; - // fall through - - case wxDIR_IGNORE: - tryagain = false; - break; - - case wxDIR_CONTINUE: - tryagain = true; - } - - if ( !tryagain ) - break; - } - } - while ( !ok ); - - if ( ok ) - { - nFiles += subdir.Traverse(sink, filespec, flags); - } - } - break; - - case wxDIR_IGNORE: - // nothing to do - ; - } - } - } - - // now enum our own files - if ( flags & wxDIR_FILES ) - { - flags &= ~wxDIR_DIRS; - - wxString filename; - bool cont = GetFirst(&filename, filespec, flags); - while ( cont ) - { - wxDirTraverseResult res = sink.OnFile(prefix + filename); - if ( res == wxDIR_STOP ) - break; - - wxASSERT_MSG( res == wxDIR_CONTINUE, - _T("unexpected OnFile() return value") ); - - nFiles++; - - cont = GetNext(&filename); - } - } - - return nFiles; -} - -// ---------------------------------------------------------------------------- -// wxDir::GetAllFiles() -// ---------------------------------------------------------------------------- - -class wxDirTraverserSimple : public wxDirTraverser -{ -public: - wxDirTraverserSimple(wxArrayString& files) : m_files(files) { } - - virtual wxDirTraverseResult OnFile(const wxString& filename) - { - m_files.push_back(filename); - return wxDIR_CONTINUE; - } - - virtual wxDirTraverseResult OnDir(const wxString& WXUNUSED(dirname)) - { - return wxDIR_CONTINUE; - } - -private: - wxArrayString& m_files; - - DECLARE_NO_COPY_CLASS(wxDirTraverserSimple) -}; - -/* static */ -size_t wxDir::GetAllFiles(const wxString& dirname, - wxArrayString *files, - const wxString& filespec, - int flags) -{ - wxCHECK_MSG( files, (size_t)-1, _T("NULL pointer in wxDir::GetAllFiles") ); - - size_t nFiles = 0; - - wxDir dir(dirname); - if ( dir.IsOpened() ) - { - wxDirTraverserSimple traverser(*files); - - nFiles += dir.Traverse(traverser, filespec, flags); - } - - return nFiles; -} - -// ---------------------------------------------------------------------------- -// wxDir::FindFirst() -// ---------------------------------------------------------------------------- - -class wxDirTraverserFindFirst : public wxDirTraverser -{ -public: - wxDirTraverserFindFirst() { } - - virtual wxDirTraverseResult OnFile(const wxString& filename) - { - m_file = filename; - return wxDIR_STOP; - } - - virtual wxDirTraverseResult OnDir(const wxString& WXUNUSED(dirname)) - { - return wxDIR_CONTINUE; - } - - const wxString& GetFile() const - { - return m_file; - } - -private: - wxString m_file; - - DECLARE_NO_COPY_CLASS(wxDirTraverserFindFirst) -}; - -/* static */ -wxString wxDir::FindFirst(const wxString& dirname, - const wxString& filespec, - int flags) -{ - wxDir dir(dirname); - if ( dir.IsOpened() ) - { - wxDirTraverserFindFirst traverser; - - dir.Traverse(traverser, filespec, flags | wxDIR_FILES); - return traverser.GetFile(); - } - - return wxEmptyString; -} - - -// ---------------------------------------------------------------------------- -// wxDir::GetTotalSize() -// ---------------------------------------------------------------------------- - -class wxDirTraverserSumSize : public wxDirTraverser -{ -public: - wxDirTraverserSumSize() { } - - virtual wxDirTraverseResult OnFile(const wxString& filename) - { - wxULongLong sz = wxFileName::GetSize(filename); - - // wxFileName::GetSize won't use this class again as - // we're passing it a file and not a directory; - // thus we are sure to avoid an endless loop - if (sz == wxInvalidSize) - { - // if the GetSize() failed (this can happen because e.g. a - // file is locked by another process), we can proceed but - // we need to at least warn the user that the resulting - // final size could be not reliable (if e.g. the locked - // file is very big). - m_skippedFiles.Add(filename); - return wxDIR_CONTINUE; - } - - m_sz += sz; - return wxDIR_CONTINUE; - } - - virtual wxDirTraverseResult OnDir(const wxString& WXUNUSED(dirname)) - { - return wxDIR_CONTINUE; - } - - wxULongLong GetTotalSize() const - { return m_sz; } - wxArrayString &FilesSkipped() - { return m_skippedFiles; } - -protected: - wxULongLong m_sz; - wxArrayString m_skippedFiles; -}; - -wxULongLong wxDir::GetTotalSize(const wxString &dirname, wxArrayString *filesSkipped) -{ - if (!wxDirExists(dirname)) - return wxInvalidSize; - - // to get the size of this directory and its contents we need - // to recursively walk it... - wxDir dir(dirname); - if ( !dir.IsOpened() ) - return wxInvalidSize; - - wxDirTraverserSumSize traverser; - if (dir.Traverse(traverser) == (size_t)-1 || - traverser.GetTotalSize() == 0) - return wxInvalidSize; - - if (filesSkipped) - *filesSkipped = traverser.FilesSkipped(); - - return traverser.GetTotalSize(); -} - diff --git a/wxWidgets/src/common/dlgcmn.cpp b/wxWidgets/src/common/dlgcmn.cpp deleted file mode 100644 index 597b14e2ce..0000000000 --- a/wxWidgets/src/common/dlgcmn.cpp +++ /dev/null @@ -1,565 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/common/dlgcmn.cpp -// Purpose: common (to all ports) wxDialog functions -// Author: Vadim Zeitlin -// Modified by: -// Created: 28.06.99 -// RCS-ID: $Id: dlgcmn.cpp 49747 2007-11-09 15:06:52Z JS $ -// Copyright: (c) Vadim Zeitlin -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#include "wx/dialog.h" - -#ifndef WX_PRECOMP - #include "wx/button.h" - #include "wx/dcclient.h" - #include "wx/intl.h" - #include "wx/settings.h" - #include "wx/stattext.h" - #include "wx/sizer.h" - #include "wx/containr.h" -#endif - -#include "wx/statline.h" -#include "wx/sysopt.h" - -#if wxUSE_STATTEXT - -// ---------------------------------------------------------------------------- -// wxTextWrapper -// ---------------------------------------------------------------------------- - -// this class is used to wrap the text on word boundary: wrapping is done by -// calling OnStartLine() and OnOutputLine() functions -class wxTextWrapper -{ -public: - wxTextWrapper() { m_eol = false; } - - // win is used for getting the font, text is the text to wrap, width is the - // max line width or -1 to disable wrapping - void Wrap(wxWindow *win, const wxString& text, int widthMax); - - // we don't need it, but just to avoid compiler warnings - virtual ~wxTextWrapper() { } - -protected: - // line may be empty - virtual void OnOutputLine(const wxString& line) = 0; - - // called at the start of every new line (except the very first one) - virtual void OnNewLine() { } - -private: - // call OnOutputLine() and set m_eol to true - void DoOutputLine(const wxString& line) - { - OnOutputLine(line); - - m_eol = true; - } - - // this function is a destructive inspector: when it returns true it also - // resets the flag to false so calling it again woulnd't return true any - // more - bool IsStartOfNewLine() - { - if ( !m_eol ) - return false; - - m_eol = false; - - return true; - } - - - bool m_eol; -}; - -#endif // wxUSE_STATTEXT - -// ---------------------------------------------------------------------------- -// wxDialogBase -// ---------------------------------------------------------------------------- - -BEGIN_EVENT_TABLE(wxDialogBase, wxTopLevelWindow) - EVT_BUTTON(wxID_ANY, wxDialogBase::OnButton) - - EVT_CLOSE(wxDialogBase::OnCloseWindow) - - EVT_CHAR_HOOK(wxDialogBase::OnCharHook) - - WX_EVENT_TABLE_CONTROL_CONTAINER(wxDialogBase) -END_EVENT_TABLE() - -WX_DELEGATE_TO_CONTROL_CONTAINER(wxDialogBase, wxTopLevelWindow) - -void wxDialogBase::Init() -{ - m_returnCode = 0; - m_affirmativeId = wxID_OK; - m_escapeId = wxID_ANY; - - // the dialogs have this flag on by default to prevent the events from the - // dialog controls from reaching the parent frame which is usually - // undesirable and can lead to unexpected and hard to find bugs - SetExtraStyle(GetExtraStyle() | wxWS_EX_BLOCK_EVENTS); - - m_container.SetContainerWindow(this); -} - -#if wxUSE_STATTEXT - -void wxTextWrapper::Wrap(wxWindow *win, const wxString& text, int widthMax) -{ - const wxChar *lastSpace = NULL; - wxString line; - - const wxChar *lineStart = text.c_str(); - for ( const wxChar *p = lineStart; ; p++ ) - { - if ( IsStartOfNewLine() ) - { - OnNewLine(); - - lastSpace = NULL; - line.clear(); - lineStart = p; - } - - if ( *p == _T('\n') || *p == _T('\0') ) - { - DoOutputLine(line); - - if ( *p == _T('\0') ) - break; - } - else // not EOL - { - if ( *p == _T(' ') ) - lastSpace = p; - - line += *p; - - if ( widthMax >= 0 && lastSpace ) - { - int width; - win->GetTextExtent(line, &width, NULL); - - if ( width > widthMax ) - { - // remove the last word from this line - line.erase(lastSpace - lineStart, p + 1 - lineStart); - DoOutputLine(line); - - // go back to the last word of this line which we didn't - // output yet - p = lastSpace; - } - } - //else: no wrapping at all or impossible to wrap - } - } -} - -class wxTextSizerWrapper : public wxTextWrapper -{ -public: - wxTextSizerWrapper(wxWindow *win) - { - m_win = win; - m_hLine = 0; - } - - wxSizer *CreateSizer(const wxString& text, int widthMax) - { - m_sizer = new wxBoxSizer(wxVERTICAL); - Wrap(m_win, text, widthMax); - return m_sizer; - } - -protected: - virtual void OnOutputLine(const wxString& line) - { - if ( !line.empty() ) - { - m_sizer->Add(new wxStaticText(m_win, wxID_ANY, line)); - } - else // empty line, no need to create a control for it - { - if ( !m_hLine ) - m_hLine = m_win->GetCharHeight(); - - m_sizer->Add(5, m_hLine); - } - } - -private: - wxWindow *m_win; - wxSizer *m_sizer; - int m_hLine; -}; - -wxSizer *wxDialogBase::CreateTextSizer(const wxString& message) -{ - // I admit that this is complete bogus, but it makes - // message boxes work for pda screens temporarily.. - int widthMax = -1; - const bool is_pda = wxSystemSettings::GetScreenType() <= wxSYS_SCREEN_PDA; - if (is_pda) - { - widthMax = wxSystemSettings::GetMetric( wxSYS_SCREEN_X ) - 25; - } - - // '&' is used as accel mnemonic prefix in the wxWidgets controls but in - // the static messages created by CreateTextSizer() (used by wxMessageBox, - // for example), we don't want this special meaning, so we need to quote it - wxString text(message); - text.Replace(_T("&"), _T("&&")); - - wxTextSizerWrapper wrapper(this); - - return wrapper.CreateSizer(text, widthMax); -} - -class wxLabelWrapper : public wxTextWrapper -{ -public: - void WrapLabel(wxWindow *text, int widthMax) - { - m_text.clear(); - Wrap(text, text->GetLabel(), widthMax); - text->SetLabel(m_text); - } - -protected: - virtual void OnOutputLine(const wxString& line) - { - m_text += line; - } - - virtual void OnNewLine() - { - m_text += _T('\n'); - } - -private: - wxString m_text; -}; - -// NB: don't "factor out" the scope operator, SGI MIPSpro 7.3 (but not 7.4) -// gets confused if it doesn't immediately follow the class name -void -#if defined(__WXGTK__) && !defined(__WXUNIVERSAL__) -wxStaticText:: -#else -wxStaticTextBase:: -#endif -Wrap(int width) -{ - wxLabelWrapper wrapper; - wrapper.WrapLabel(this, width); -} - -#endif // wxUSE_STATTEXT - -wxSizer *wxDialogBase::CreateButtonSizer(long flags) -{ - wxSizer *sizer = NULL; - -#ifdef __SMARTPHONE__ - wxDialog* dialog = (wxDialog*) this; - if ( flags & wxOK ) - dialog->SetLeftMenu(wxID_OK); - - if ( flags & wxCANCEL ) - dialog->SetRightMenu(wxID_CANCEL); - - if ( flags & wxYES ) - dialog->SetLeftMenu(wxID_YES); - - if ( flags & wxNO ) - dialog->SetRightMenu(wxID_NO); -#else // !__SMARTPHONE__ - -#if wxUSE_BUTTON - -#ifdef __POCKETPC__ - // PocketPC guidelines recommend for Ok/Cancel dialogs to use OK button - // located inside caption bar and implement Cancel functionality through - // Undo outside dialog. As native behaviour this will be default here but - // can be replaced with real wxButtons by setting the option below to 1 - if ( (flags & ~(wxCANCEL|wxNO_DEFAULT)) != wxOK || - wxSystemOptions::GetOptionInt(wxT("wince.dialog.real-ok-cancel")) ) -#endif // __POCKETPC__ - { - sizer = CreateStdDialogButtonSizer(flags); - } -#endif // wxUSE_BUTTON - -#endif // __SMARTPHONE__/!__SMARTPHONE__ - - return sizer; -} - -wxSizer *wxDialogBase::CreateSeparatedButtonSizer(long flags) -{ - wxSizer *sizer = CreateButtonSizer(flags); - if ( !sizer ) - return NULL; - - // Mac Human Interface Guidelines recommend not to use static lines as - // grouping elements -#if wxUSE_STATLINE && !defined(__WXMAC__) - wxBoxSizer *topsizer = new wxBoxSizer(wxVERTICAL); - topsizer->Add(new wxStaticLine(this), - wxSizerFlags().Expand().DoubleBorder(wxBOTTOM)); - topsizer->Add(sizer, wxSizerFlags().Expand()); - sizer = topsizer; -#endif // wxUSE_STATLINE - - return sizer; -} - -#if wxUSE_BUTTON - -wxStdDialogButtonSizer *wxDialogBase::CreateStdDialogButtonSizer( long flags ) -{ - wxStdDialogButtonSizer *sizer = new wxStdDialogButtonSizer(); - - wxButton *ok = NULL; - wxButton *yes = NULL; - wxButton *no = NULL; - - if (flags & wxOK) - { - ok = new wxButton(this, wxID_OK); - sizer->AddButton(ok); - } - - if (flags & wxCANCEL) - { - wxButton *cancel = new wxButton(this, wxID_CANCEL); - sizer->AddButton(cancel); - } - - if (flags & wxYES) - { - yes = new wxButton(this, wxID_YES); - sizer->AddButton(yes); - } - - if (flags & wxNO) - { - no = new wxButton(this, wxID_NO); - sizer->AddButton(no); - } - - if (flags & wxHELP) - { - wxButton *help = new wxButton(this, wxID_HELP); - sizer->AddButton(help); - } - - if (flags & wxNO_DEFAULT) - { - if (no) - { - no->SetDefault(); - no->SetFocus(); - } - } - else - { - if (ok) - { - ok->SetDefault(); - ok->SetFocus(); - } - else if (yes) - { - yes->SetDefault(); - yes->SetFocus(); - } - } - - if (flags & wxOK) - SetAffirmativeId(wxID_OK); - else if (flags & wxYES) - SetAffirmativeId(wxID_YES); - - sizer->Realize(); - - return sizer; -} - -#endif // wxUSE_BUTTON - -// ---------------------------------------------------------------------------- -// standard buttons handling -// ---------------------------------------------------------------------------- - -void wxDialogBase::EndDialog(int rc) -{ - if ( IsModal() ) - EndModal(rc); - else - Hide(); -} - -void wxDialogBase::AcceptAndClose() -{ - if ( Validate() && TransferDataFromWindow() ) - { - EndDialog(m_affirmativeId); - } -} - -void wxDialogBase::SetAffirmativeId(int affirmativeId) -{ - m_affirmativeId = affirmativeId; -} - -void wxDialogBase::SetEscapeId(int escapeId) -{ - m_escapeId = escapeId; -} - -bool wxDialogBase::EmulateButtonClickIfPresent(int id) -{ -#if wxUSE_BUTTON - wxButton *btn = wxDynamicCast(FindWindow(id), wxButton); - - if ( !btn || !btn->IsEnabled() || !btn->IsShown() ) - return false; - - wxCommandEvent event(wxEVT_COMMAND_BUTTON_CLICKED, id); - event.SetEventObject(btn); - btn->GetEventHandler()->ProcessEvent(event); - - return true; -#else // !wxUSE_BUTTON - wxUnusedVar(id); - return false; -#endif // wxUSE_BUTTON/!wxUSE_BUTTON -} - -bool wxDialogBase::IsEscapeKey(const wxKeyEvent& event) -{ - // for most platforms, Esc key is used to close the dialogs - return event.GetKeyCode() == WXK_ESCAPE && - event.GetModifiers() == wxMOD_NONE; -} - -void wxDialogBase::OnCharHook(wxKeyEvent& event) -{ - if ( event.GetKeyCode() == WXK_ESCAPE ) - { - int idCancel = GetEscapeId(); - switch ( idCancel ) - { - case wxID_NONE: - // don't handle Esc specially at all - break; - - case wxID_ANY: - // this value is special: it means translate Esc to wxID_CANCEL - // but if there is no such button, then fall back to wxID_OK - if ( EmulateButtonClickIfPresent(wxID_CANCEL) ) - return; - idCancel = GetAffirmativeId(); - // fall through - - default: - // translate Esc to button press for the button with given id - if ( EmulateButtonClickIfPresent(idCancel) ) - return; - } - } - - event.Skip(); -} - -void wxDialogBase::OnButton(wxCommandEvent& event) -{ - const int id = event.GetId(); - if ( id == GetAffirmativeId() ) - { - AcceptAndClose(); - } - else if ( id == wxID_APPLY ) - { - if ( Validate() ) - TransferDataFromWindow(); - - // TODO: disable the Apply button until things change again - } - else if ( id == GetEscapeId() || - (id == wxID_CANCEL && GetEscapeId() == wxID_ANY) ) - { - EndDialog(wxID_CANCEL); - } - else // not a standard button - { - event.Skip(); - } -} - -// ---------------------------------------------------------------------------- -// other event handlers -// ---------------------------------------------------------------------------- - -void wxDialogBase::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. - - // VZ: this is horrible and MT-unsafe. Can't we reuse some of these global - // lists here? don't dare to change it now, but should be done later! - 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 wxDialogBase::OnSysColourChanged(wxSysColourChangedEvent& event) -{ -#ifndef __WXGTK__ - SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE)); - Refresh(); -#endif - event.Skip(); -} diff --git a/wxWidgets/src/common/dndcmn.cpp b/wxWidgets/src/common/dndcmn.cpp deleted file mode 100644 index 5daf3da7dd..0000000000 --- a/wxWidgets/src/common/dndcmn.cpp +++ /dev/null @@ -1,31 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: common/dndcmn.cpp -// Author: Robert Roebling -// Modified by: -// Created: 19.10.99 -// RCS-ID: $Id: dndcmn.cpp 43664 2006-11-26 21:50:51Z JS $ -// Copyright: (c) wxWidgets Team -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#include "wx/dnd.h" - -#if wxUSE_DRAG_AND_DROP - -bool wxIsDragResultOk(wxDragResult res) -{ - return res == wxDragCopy || res == wxDragMove || res == wxDragLink; -} - -#endif - diff --git a/wxWidgets/src/common/dobjcmn.cpp b/wxWidgets/src/common/dobjcmn.cpp deleted file mode 100644 index 68b194d3ee..0000000000 --- a/wxWidgets/src/common/dobjcmn.cpp +++ /dev/null @@ -1,517 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: src/common/dobjcmn.cpp -// Purpose: implementation of data object methods common to all platforms -// Author: Vadim Zeitlin, Robert Roebling -// Modified by: -// Created: 19.10.99 -// RCS-ID: $Id: dobjcmn.cpp 49036 2007-10-04 10:10:06Z SC $ -// Copyright: (c) wxWidgets Team -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_DATAOBJ - -#include "wx/dataobj.h" - -#ifndef WX_PRECOMP - #include "wx/app.h" -#endif - -// ---------------------------------------------------------------------------- -// lists -// ---------------------------------------------------------------------------- - -#include "wx/listimpl.cpp" - -WX_DEFINE_LIST(wxSimpleDataObjectList) - -// ---------------------------------------------------------------------------- -// globals -// ---------------------------------------------------------------------------- - -static wxDataFormat dataFormatInvalid; -WXDLLEXPORT const wxDataFormat& wxFormatInvalid = dataFormatInvalid; - -// ============================================================================ -// implementation -// ============================================================================ - -// ---------------------------------------------------------------------------- -// wxDataObjectBase -// ---------------------------------------------------------------------------- - -wxDataObjectBase::~wxDataObjectBase() -{ -} - -bool wxDataObjectBase::IsSupported(const wxDataFormat& format, - Direction dir) const -{ - size_t nFormatCount = GetFormatCount( dir ); - if ( nFormatCount == 1 ) - { - return format == GetPreferredFormat( dir ); - } - else - { - wxDataFormat *formats = new wxDataFormat[nFormatCount]; - GetAllFormats( formats, dir ); - - size_t n; - for ( n = 0; n < nFormatCount; n++ ) - { - if ( formats[n] == format ) - break; - } - - delete [] formats; - - // found? - return n < nFormatCount; - } -} - -// ---------------------------------------------------------------------------- -// wxDataObjectComposite -// ---------------------------------------------------------------------------- - -wxDataObjectComposite::wxDataObjectComposite() -{ - m_preferred = 0; - m_receivedFormat = wxFormatInvalid; -} - -wxDataObjectComposite::~wxDataObjectComposite() -{ - WX_CLEAR_LIST( wxSimpleDataObjectList, m_dataObjects ); -} - -wxDataObjectSimple * -wxDataObjectComposite::GetObject(const wxDataFormat& format) const -{ - wxSimpleDataObjectList::compatibility_iterator node = m_dataObjects.GetFirst(); - while ( node ) - { - wxDataObjectSimple *dataObj = node->GetData(); - - if ( dataObj->GetFormat() == format ) - { - return dataObj; - } - - node = node->GetNext(); - } - - return (wxDataObjectSimple *)NULL; -} - -void wxDataObjectComposite::Add(wxDataObjectSimple *dataObject, bool preferred) -{ - if ( preferred ) - m_preferred = m_dataObjects.GetCount(); - - m_dataObjects.Append( dataObject ); -} - -wxDataFormat wxDataObjectComposite::GetReceivedFormat() const -{ - return m_receivedFormat; -} - -wxDataFormat -wxDataObjectComposite::GetPreferredFormat(Direction WXUNUSED(dir)) const -{ - wxSimpleDataObjectList::compatibility_iterator node = m_dataObjects.Item( m_preferred ); - - wxCHECK_MSG( node, wxFormatInvalid, wxT("no preferred format") ); - - wxDataObjectSimple* dataObj = node->GetData(); - - return dataObj->GetFormat(); -} - -#if defined(__WXMSW__) - -size_t wxDataObjectComposite::GetBufferOffset( const wxDataFormat& format ) -{ - wxDataObjectSimple *dataObj = GetObject(format); - - wxCHECK_MSG( dataObj, 0, - wxT("unsupported format in wxDataObjectComposite")); - - return dataObj->GetBufferOffset( format ); -} - - -const void* wxDataObjectComposite::GetSizeFromBuffer( const void* buffer, - size_t* size, - const wxDataFormat& format ) -{ - wxDataObjectSimple *dataObj = GetObject(format); - - wxCHECK_MSG( dataObj, NULL, - wxT("unsupported format in wxDataObjectComposite")); - - return dataObj->GetSizeFromBuffer( buffer, size, format ); -} - - -void* wxDataObjectComposite::SetSizeInBuffer( void* buffer, size_t size, - const wxDataFormat& format ) -{ - wxDataObjectSimple *dataObj = GetObject( format ); - - wxCHECK_MSG( dataObj, NULL, - wxT("unsupported format in wxDataObjectComposite")); - - return dataObj->SetSizeInBuffer( buffer, size, format ); -} - -#endif - -size_t wxDataObjectComposite::GetFormatCount(Direction WXUNUSED(dir)) const -{ - // TODO what about the Get/Set only formats? - return m_dataObjects.GetCount(); -} - -void wxDataObjectComposite::GetAllFormats(wxDataFormat *formats, - Direction WXUNUSED(dir)) const -{ - size_t n = 0; - wxSimpleDataObjectList::compatibility_iterator node; - for ( node = m_dataObjects.GetFirst(); node; node = node->GetNext() ) - { - // TODO if ( !outputOnlyToo ) && this one counts ... - formats[n++] = node->GetData()->GetFormat(); - } -} - -size_t wxDataObjectComposite::GetDataSize(const wxDataFormat& format) const -{ - wxDataObjectSimple *dataObj = GetObject(format); - - wxCHECK_MSG( dataObj, 0, - wxT("unsupported format in wxDataObjectComposite")); - - return dataObj->GetDataSize(); -} - -bool wxDataObjectComposite::GetDataHere(const wxDataFormat& format, - void *buf) const -{ - wxDataObjectSimple *dataObj = GetObject( format ); - - wxCHECK_MSG( dataObj, false, - wxT("unsupported format in wxDataObjectComposite")); - - return dataObj->GetDataHere( buf ); -} - -bool wxDataObjectComposite::SetData(const wxDataFormat& format, - size_t len, - const void *buf) -{ - wxDataObjectSimple *dataObj = GetObject( format ); - - wxCHECK_MSG( dataObj, false, - wxT("unsupported format in wxDataObjectComposite")); - - m_receivedFormat = format; - return dataObj->SetData( len, buf ); -} - -// ---------------------------------------------------------------------------- -// wxTextDataObject -// ---------------------------------------------------------------------------- - -#if defined(__WXGTK20__) && wxUSE_UNICODE - -static inline wxMBConv& GetConv(const wxDataFormat& format) -{ - // use UTF8 for wxDF_UNICODETEXT and UCS4 for wxDF_TEXT - return format == wxDF_UNICODETEXT ? wxConvUTF8 : wxConvLibc; -} - -size_t wxTextDataObject::GetDataSize(const wxDataFormat& format) const -{ - wxCharBuffer buffer = GetConv(format).cWX2MB( GetText().c_str() ); - - return buffer ? strlen( buffer ) : 0; -} - -bool wxTextDataObject::GetDataHere(const wxDataFormat& format, void *buf) const -{ - if ( !buf ) - return false; - - wxCharBuffer buffer = GetConv(format).cWX2MB( GetText().c_str() ); - if ( !buffer ) - return false; - - memcpy( (char*) buf, buffer, GetDataSize(format) ); - // strcpy( (char*) buf, buffer ); - - return true; -} - -bool wxTextDataObject::SetData(const wxDataFormat& format, - size_t WXUNUSED(len), const void *buf) -{ - if ( buf == NULL ) - return false; - - wxWCharBuffer buffer = GetConv(format).cMB2WX( (const char*)buf ); - - SetText( buffer ); - - return true; -} - -#elif wxUSE_UNICODE && defined(__WXMAC__) - -static wxMBConvUTF16 sUTF16Converter; - -static inline wxMBConv& GetConv(const wxDataFormat& format) -{ - return - format == wxDF_UNICODETEXT - ? (wxMBConv&) sUTF16Converter - : (wxMBConv&) wxConvLocal; -} - -size_t wxTextDataObject::GetDataSize(const wxDataFormat& format) const -{ - wxCharBuffer buffer = GetConv(format).cWX2MB( GetText().c_str() ); - if ( !buffer ) - return 0; - - size_t len = GetConv(format).WC2MB( NULL, GetText().c_str(), 0 ); - return len; -} - -bool wxTextDataObject::GetDataHere(const wxDataFormat& format, void *buf) const -{ - if ( buf == NULL ) - return false; - - wxCharBuffer buffer = GetConv(format).cWX2MB( GetText().c_str() ); - if ( !buffer ) - return false; - - size_t len = GetConv(format).WC2MB( NULL, GetText().c_str(), 0 ); - memcpy( (char*)buf, (const char*)buffer, len ); - - return true; -} - -bool wxTextDataObject::SetData(const wxDataFormat& format, - size_t WXUNUSED(len), const void *buf) -{ - if ( buf == NULL ) - return false; - - wxWCharBuffer buffer = GetConv(format).cMB2WX( (const char*)buf ); - - SetText( buffer ); - - return true; -} - -#else - -size_t wxTextDataObject::GetDataSize() const -{ - return GetTextLength() * sizeof(wxChar); -} - -bool wxTextDataObject::GetDataHere(void *buf) const -{ - wxStrcpy( (wxChar*)buf, GetText().c_str() ); - - return true; -} - -bool wxTextDataObject::SetData(size_t WXUNUSED(len), const void *buf) -{ - SetText( wxString((const wxChar*)buf) ); - - return true; -} - -#endif - -// ---------------------------------------------------------------------------- -// wxFileDataObjectBase -// ---------------------------------------------------------------------------- - -// VZ: I don't need this in MSW finally, so if it is needed in wxGTK, it should -// be moved to gtk/dataobj.cpp -#if 0 - -wxString wxFileDataObjectBase::GetFilenames() const -{ - wxString str; - size_t count = m_filenames.GetCount(); - for ( size_t n = 0; n < count; n++ ) - { - str << m_filenames[n] << wxT('\0'); - } - - return str; -} - -void wxFileDataObjectBase::SetFilenames(const wxChar* filenames) -{ - m_filenames.Empty(); - - wxString current; - for ( const wxChar *pc = filenames; ; pc++ ) - { - if ( *pc ) - { - current += *pc; - } - else - { - if ( !current ) - { - // 2 consecutive NULs - this is the end of the string - break; - } - - m_filenames.Add(current); - current.Empty(); - } - } -} - -#endif - -// ---------------------------------------------------------------------------- -// wxCustomDataObject -// ---------------------------------------------------------------------------- - -wxCustomDataObject::wxCustomDataObject(const wxDataFormat& format) - : wxDataObjectSimple(format) -{ - m_data = NULL; - m_size = 0; -} - -wxCustomDataObject::~wxCustomDataObject() -{ - Free(); -} - -void wxCustomDataObject::TakeData(size_t size, void *data) -{ - Free(); - - m_size = size; - m_data = data; -} - -void *wxCustomDataObject::Alloc(size_t size) -{ - return (void *)new char[size]; -} - -void wxCustomDataObject::Free() -{ - delete [] (char*)m_data; - m_size = 0; - m_data = (void*)NULL; -} - -size_t wxCustomDataObject::GetDataSize() const -{ - return GetSize(); -} - -bool wxCustomDataObject::GetDataHere(void *buf) const -{ - if ( buf == NULL ) - return false; - - void *data = GetData(); - if ( data == NULL ) - return false; - - memcpy( buf, data, GetSize() ); - - return true; -} - -bool wxCustomDataObject::SetData(size_t size, const void *buf) -{ - Free(); - - m_data = Alloc(size); - if ( m_data == NULL ) - return false; - - m_size = size; - memcpy( m_data, buf, m_size ); - - return true; -} - -// ============================================================================ -// some common dnd related code -// ============================================================================ - -#if wxUSE_DRAG_AND_DROP - -#include "wx/dnd.h" - -// ---------------------------------------------------------------------------- -// wxTextDropTarget -// ---------------------------------------------------------------------------- - -// NB: we can't use "new" in ctor initializer lists because this provokes an -// internal compiler error with VC++ 5.0 (hey, even gcc compiles this!), -// so use SetDataObject() instead - -wxTextDropTarget::wxTextDropTarget() -{ - SetDataObject(new wxTextDataObject); -} - -wxDragResult wxTextDropTarget::OnData(wxCoord x, wxCoord y, wxDragResult def) -{ - if ( !GetData() ) - return wxDragNone; - - wxTextDataObject *dobj = (wxTextDataObject *)m_dataObject; - return OnDropText( x, y, dobj->GetText() ) ? def : wxDragNone; -} - -// ---------------------------------------------------------------------------- -// wxFileDropTarget -// ---------------------------------------------------------------------------- - -wxFileDropTarget::wxFileDropTarget() -{ - SetDataObject(new wxFileDataObject); -} - -wxDragResult wxFileDropTarget::OnData(wxCoord x, wxCoord y, wxDragResult def) -{ - if ( !GetData() ) - return wxDragNone; - - wxFileDataObject *dobj = (wxFileDataObject *)m_dataObject; - return OnDropFiles( x, y, dobj->GetFilenames() ) ? def : wxDragNone; -} - -#endif // wxUSE_DRAG_AND_DROP - -#endif // wxUSE_DATAOBJ diff --git a/wxWidgets/src/common/docmdi.cpp b/wxWidgets/src/common/docmdi.cpp deleted file mode 100644 index d63628f69d..0000000000 --- a/wxWidgets/src/common/docmdi.cpp +++ /dev/null @@ -1,206 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: docmdi.cpp -// Purpose: Frame classes for MDI document/view applications -// Author: Julian Smart -// Modified by: -// Created: 01/02/97 -// RCS-ID: $Id: docmdi.cpp 66911 2011-02-16 21:31:33Z JS $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_MDI_ARCHITECTURE - -#include "wx/docmdi.h" - -/* - * Docview MDI parent frame - */ - -IMPLEMENT_CLASS(wxDocMDIParentFrame, wxMDIParentFrame) - -BEGIN_EVENT_TABLE(wxDocMDIParentFrame, wxMDIParentFrame) - EVT_MENU(wxID_EXIT, wxDocMDIParentFrame::OnExit) - EVT_MENU_RANGE(wxID_FILE1, wxID_FILE9, wxDocMDIParentFrame::OnMRUFile) - EVT_CLOSE(wxDocMDIParentFrame::OnCloseWindow) -END_EVENT_TABLE() - -wxDocMDIParentFrame::wxDocMDIParentFrame() -{ - Init(); -} - -wxDocMDIParentFrame::wxDocMDIParentFrame(wxDocManager *manager, wxFrame *frame, wxWindowID id, const wxString& title, - const wxPoint& pos, const wxSize& size, long style, const wxString& name) -{ - Init(); - Create(manager, frame, id, title, pos, size, style, name); -} - -bool wxDocMDIParentFrame::Create(wxDocManager *manager, wxFrame *frame, wxWindowID id, const wxString& title, - const wxPoint& pos, const wxSize& size, long style, const wxString& name) -{ - m_docManager = manager; - return wxMDIParentFrame::Create(frame, id, title, pos, size, style, name); -} - -void wxDocMDIParentFrame::OnExit(wxCommandEvent& WXUNUSED(event)) -{ - Close(); -} - -void wxDocMDIParentFrame::Init() -{ - m_docManager = NULL; -} - -void wxDocMDIParentFrame::OnMRUFile(wxCommandEvent& event) -{ - wxString f(m_docManager->GetHistoryFile(event.GetId() - wxID_FILE1)); - if (!f.empty()) - (void)m_docManager->CreateDocument(f, wxDOC_SILENT); -} - -// Extend event processing to search the view's event table -bool wxDocMDIParentFrame::ProcessEvent(wxEvent& event) -{ - // Try the document manager, then do default processing - if (!m_docManager || !m_docManager->ProcessEvent(event)) - return wxEvtHandler::ProcessEvent(event); - else - return true; -} - -void wxDocMDIParentFrame::OnCloseWindow(wxCloseEvent& event) -{ - if ( m_docManager && !m_docManager->Clear(!event.CanVeto()) ) - { - // The user decided not to close finally, abort. - event.Veto(); - } - else - { - this->Destroy(); - } -} - -/* - * Default document child frame for MDI children - */ - -IMPLEMENT_CLASS(wxDocMDIChildFrame, wxMDIChildFrame) - -BEGIN_EVENT_TABLE(wxDocMDIChildFrame, wxMDIChildFrame) - EVT_ACTIVATE(wxDocMDIChildFrame::OnActivate) - EVT_CLOSE(wxDocMDIChildFrame::OnCloseWindow) -END_EVENT_TABLE() - -void wxDocMDIChildFrame::Init() -{ - m_childDocument = (wxDocument*) NULL; - m_childView = (wxView*) NULL; -} - -wxDocMDIChildFrame::wxDocMDIChildFrame() -{ - Init(); -} - -wxDocMDIChildFrame::wxDocMDIChildFrame(wxDocument *doc, wxView *view, wxMDIParentFrame *frame, wxWindowID id, - const wxString& title, const wxPoint& pos, const wxSize& size, long style, const wxString& name) -{ - Init(); - Create(doc, view, frame, id, title, pos, size, style, name); -} - -bool wxDocMDIChildFrame::Create(wxDocument *doc, wxView *view, wxMDIParentFrame *frame, wxWindowID id, - const wxString& title, const wxPoint& pos, const wxSize& size, long style, const wxString& name) -{ - m_childDocument = doc; - m_childView = view; - if (wxMDIChildFrame::Create(frame, id, title, pos, size, style, name)) - { - if (view) - view->SetFrame(this); - return true; - } - - return false; -} - -wxDocMDIChildFrame::~wxDocMDIChildFrame(void) -{ - m_childView = (wxView *) NULL; -} - -// Extend event processing to search the view's event table -bool wxDocMDIChildFrame::ProcessEvent(wxEvent& event) -{ - static wxEvent *ActiveEvent = NULL; - - // Break recursion loops - if (ActiveEvent == &event) - return false; - - ActiveEvent = &event; - - bool ret; - if ( !m_childView || ! m_childView->ProcessEvent(event) ) - { - // Only hand up to the parent if it's a menu command - if (!event.IsKindOf(CLASSINFO(wxCommandEvent)) || !GetParent() || !GetParent()->ProcessEvent(event)) - ret = wxEvtHandler::ProcessEvent(event); - else - ret = true; - } - else - ret = true; - - ActiveEvent = NULL; - return ret; -} - -void wxDocMDIChildFrame::OnActivate(wxActivateEvent& event) -{ - wxMDIChildFrame::OnActivate(event); - - if (event.GetActive() && m_childView) - m_childView->Activate(event.GetActive()); -} - -void wxDocMDIChildFrame::OnCloseWindow(wxCloseEvent& event) -{ - // Close view but don't delete the frame while doing so! - // ...since it will be deleted by wxWidgets if we return true. - if (m_childView) - { - bool ans = event.CanVeto() - ? m_childView->Close(false) // false means don't delete associated window - : true; // Must delete. - - if (ans) - { - m_childView->Activate(false); - delete m_childView; - m_childView = (wxView *) NULL; - m_childDocument = (wxDocument *) NULL; - - this->Destroy(); - } - else - event.Veto(); - } - else - event.Veto(); -} - -#endif - // wxUSE_DOC_VIEW_ARCHITECTURE - diff --git a/wxWidgets/src/common/docview.cpp b/wxWidgets/src/common/docview.cpp deleted file mode 100644 index be1393f86d..0000000000 --- a/wxWidgets/src/common/docview.cpp +++ /dev/null @@ -1,2491 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/common/docview.cpp -// Purpose: Document/view classes -// Author: Julian Smart -// Modified by: -// Created: 01/02/97 -// RCS-ID: $Id: docview.cpp 66911 2011-02-16 21:31:33Z JS $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_DOC_VIEW_ARCHITECTURE - -#include "wx/docview.h" - -#ifndef WX_PRECOMP - #include "wx/list.h" - #include "wx/string.h" - #include "wx/utils.h" - #include "wx/app.h" - #include "wx/dc.h" - #include "wx/dialog.h" - #include "wx/menu.h" - #include "wx/filedlg.h" - #include "wx/intl.h" - #include "wx/log.h" - #include "wx/msgdlg.h" - #include "wx/mdi.h" - #include "wx/choicdlg.h" -#endif - -#include "wx/ffile.h" - -#ifdef __WXMAC__ - #include "wx/filename.h" -#endif - -#if wxUSE_PRINTING_ARCHITECTURE - #include "wx/prntbase.h" - #include "wx/printdlg.h" -#endif - -#include "wx/confbase.h" -#include "wx/file.h" -#include "wx/cmdproc.h" -#include "wx/tokenzr.h" - -#include -#include - -#if wxUSE_STD_IOSTREAM - #include "wx/ioswrap.h" - #if wxUSE_IOSTREAMH - #include - #else - #include - #endif -#else - #include "wx/wfstream.h" -#endif - -// ---------------------------------------------------------------------------- -// wxWidgets macros -// ---------------------------------------------------------------------------- - -IMPLEMENT_ABSTRACT_CLASS(wxDocument, wxEvtHandler) -IMPLEMENT_ABSTRACT_CLASS(wxView, wxEvtHandler) -IMPLEMENT_ABSTRACT_CLASS(wxDocTemplate, wxObject) -IMPLEMENT_DYNAMIC_CLASS(wxDocManager, wxEvtHandler) -IMPLEMENT_CLASS(wxDocChildFrame, wxFrame) -IMPLEMENT_CLASS(wxDocParentFrame, wxFrame) - -#if wxUSE_PRINTING_ARCHITECTURE - IMPLEMENT_DYNAMIC_CLASS(wxDocPrintout, wxPrintout) -#endif - -IMPLEMENT_DYNAMIC_CLASS(wxFileHistory, wxObject) - -// ---------------------------------------------------------------------------- -// function prototypes -// ---------------------------------------------------------------------------- - -static wxWindow* wxFindSuitableParent(void); - -// ---------------------------------------------------------------------------- -// local constants -// ---------------------------------------------------------------------------- - -static const wxChar *s_MRUEntryFormat = wxT("&%d %s"); - -// ============================================================================ -// implementation -// ============================================================================ - -// ---------------------------------------------------------------------------- -// local functions -// ---------------------------------------------------------------------------- - -static wxString FindExtension(const wxChar *path) -{ - wxString ext; - wxSplitPath(path, NULL, NULL, &ext); - - // VZ: extensions are considered not case sensitive - is this really a good - // idea? - return ext.MakeLower(); -} - -// ---------------------------------------------------------------------------- -// Definition of wxDocument -// ---------------------------------------------------------------------------- - -wxDocument::wxDocument(wxDocument *parent) -{ - m_documentModified = false; - m_documentParent = parent; - m_documentTemplate = (wxDocTemplate *) NULL; - m_commandProcessor = (wxCommandProcessor*) NULL; - m_savedYet = false; -} - -bool wxDocument::DeleteContents() -{ - return true; -} - -wxDocument::~wxDocument() -{ - DeleteContents(); - - if (m_commandProcessor) - delete m_commandProcessor; - - if (GetDocumentManager()) - GetDocumentManager()->RemoveDocument(this); - - // Not safe to do here, since it'll invoke virtual view functions - // expecting to see valid derived objects: and by the time we get here, - // we've called destructors higher up. - //DeleteAllViews(); -} - -bool wxDocument::Close() -{ - if (OnSaveModified()) - return OnCloseDocument(); - else - return false; -} - -bool wxDocument::OnCloseDocument() -{ - // Tell all views that we're about to close - NotifyClosing(); - DeleteContents(); - Modify(false); - return true; -} - -// Note that this implicitly deletes the document when the last view is -// deleted. -bool wxDocument::DeleteAllViews() -{ - wxDocManager* manager = GetDocumentManager(); - - // first check if all views agree to be closed - const wxList::iterator end = m_documentViews.end(); - for ( wxList::iterator i = m_documentViews.begin(); i != end; ++i ) - { - wxView *view = (wxView *)*i; - if ( !view->Close() ) - return false; - } - - // all views agreed to close, now do close them - if ( m_documentViews.empty() ) - { - // normally the document would be implicitly deleted when the last view - // is, but if don't have any views, do it here instead - if ( manager && manager->GetDocuments().Member(this) ) - delete this; - } - else // have views - { - // as we delete elements we iterate over, don't use the usual "from - // begin to end" loop - for ( ;; ) - { - wxView *view = (wxView *)*m_documentViews.begin(); - - bool isLastOne = m_documentViews.size() == 1; - - // this always deletes the node implicitly and if this is the last - // view also deletes this object itself (also implicitly, great), - // so we can't test for m_documentViews.empty() after calling this! - delete view; - - if ( isLastOne ) - break; - } - } - - return true; -} - -wxView *wxDocument::GetFirstView() const -{ - if (m_documentViews.GetCount() == 0) - return (wxView *) NULL; - return (wxView *)m_documentViews.GetFirst()->GetData(); -} - -wxDocManager *wxDocument::GetDocumentManager() const -{ - return (m_documentTemplate ? m_documentTemplate->GetDocumentManager() : (wxDocManager*) NULL); -} - -bool wxDocument::OnNewDocument() -{ - if (!OnSaveModified()) - return false; - - if (OnCloseDocument()==false) return false; - DeleteContents(); - Modify(false); - SetDocumentSaved(false); - - wxString name; - GetDocumentManager()->MakeDefaultName(name); - SetTitle(name); - SetFilename(name, true); - - return true; -} - -bool wxDocument::Save() -{ - if (!IsModified() && m_savedYet) - return true; - - if ( m_documentFile.empty() || !m_savedYet ) - return SaveAs(); - - return OnSaveDocument(m_documentFile); -} - -bool wxDocument::SaveAs() -{ - wxDocTemplate *docTemplate = GetDocumentTemplate(); - if (!docTemplate) - return false; - -#if defined(__WXMSW__) || defined(__WXGTK__) || defined(__WXMAC__) - wxString filter = docTemplate->GetDescription() + wxT(" (") + docTemplate->GetFileFilter() + wxT(")|") + docTemplate->GetFileFilter(); - - // Now see if there are some other template with identical view and document - // classes, whose filters may also be used. - - if (docTemplate->GetViewClassInfo() && docTemplate->GetDocClassInfo()) - { - wxList::compatibility_iterator node = docTemplate->GetDocumentManager()->GetTemplates().GetFirst(); - while (node) - { - wxDocTemplate *t = (wxDocTemplate*) node->GetData(); - - if (t->IsVisible() && t != docTemplate && - t->GetViewClassInfo() == docTemplate->GetViewClassInfo() && - t->GetDocClassInfo() == docTemplate->GetDocClassInfo()) - { - // add a '|' to separate this filter from the previous one - if ( !filter.empty() ) - filter << wxT('|'); - - filter << t->GetDescription() << wxT(" (") << t->GetFileFilter() << wxT(") |") - << t->GetFileFilter(); - } - - node = node->GetNext(); - } - } -#else - wxString filter = docTemplate->GetFileFilter() ; -#endif - wxString defaultDir = docTemplate->GetDirectory(); - if (defaultDir.IsEmpty()) - defaultDir = wxPathOnly(GetFilename()); - - wxString tmp = wxFileSelector(_("Save as"), - defaultDir, - wxFileNameFromPath(GetFilename()), - docTemplate->GetDefaultExtension(), - filter, - wxFD_SAVE | wxFD_OVERWRITE_PROMPT, - GetDocumentWindow()); - - if (tmp.empty()) - return false; - - wxString fileName(tmp); - wxString path, name, ext; - wxSplitPath(fileName, & path, & name, & ext); - - if (ext.empty()) - { - fileName += wxT("."); - fileName += docTemplate->GetDefaultExtension(); - } - - SetFilename(fileName); - SetTitle(wxFileNameFromPath(fileName)); - - // Notify the views that the filename has changed - wxList::compatibility_iterator node = m_documentViews.GetFirst(); - while (node) - { - wxView *view = (wxView *)node->GetData(); - view->OnChangeFilename(); - node = node->GetNext(); - } - - // Files that were not saved correctly are not added to the FileHistory. - if (!OnSaveDocument(m_documentFile)) - return false; - - // A file that doesn't use the default extension of its document template cannot be opened - // via the FileHistory, so we do not add it. - if (docTemplate->FileMatchesTemplate(fileName)) - { - GetDocumentManager()->AddFileToHistory(fileName); - } - else - { - // The user will probably not be able to open the file again, so - // we could warn about the wrong file-extension here. - } - return true; -} - -bool wxDocument::OnSaveDocument(const wxString& file) -{ - if ( !file ) - return false; - - if ( !DoSaveDocument(file) ) - return false; - - Modify(false); - SetFilename(file); - SetDocumentSaved(true); -#ifdef __WXMAC__ - wxFileName fn(file) ; - fn.MacSetDefaultTypeAndCreator() ; -#endif - return true; -} - -bool wxDocument::OnOpenDocument(const wxString& file) -{ - if (!OnSaveModified()) - return false; - - if ( !DoOpenDocument(file) ) - return false; - - SetFilename(file, true); - Modify(false); - m_savedYet = true; - - UpdateAllViews(); - - return true; -} - -#if wxUSE_STD_IOSTREAM -wxSTD istream& wxDocument::LoadObject(wxSTD istream& stream) -#else -wxInputStream& wxDocument::LoadObject(wxInputStream& stream) -#endif -{ - return stream; -} - -#if wxUSE_STD_IOSTREAM -wxSTD ostream& wxDocument::SaveObject(wxSTD ostream& stream) -#else -wxOutputStream& wxDocument::SaveObject(wxOutputStream& stream) -#endif -{ - return stream; -} - -bool wxDocument::Revert() -{ - return false; -} - - -// Get title, or filename if no title, else unnamed -bool wxDocument::GetPrintableName(wxString& buf) const -{ - if (!m_documentTitle.empty()) - { - buf = m_documentTitle; - return true; - } - else if (!m_documentFile.empty()) - { - buf = wxFileNameFromPath(m_documentFile); - return true; - } - else - { - buf = _("unnamed"); - return true; - } -} - -wxWindow *wxDocument::GetDocumentWindow() const -{ - wxView *view = GetFirstView(); - if (view) - return view->GetFrame(); - else - return wxTheApp->GetTopWindow(); -} - -wxCommandProcessor *wxDocument::OnCreateCommandProcessor() -{ - return new wxCommandProcessor; -} - -// true if safe to close -bool wxDocument::OnSaveModified() -{ - if (IsModified()) - { - wxString title; - GetPrintableName(title); - - wxString msgTitle; - if (!wxTheApp->GetAppName().empty()) - msgTitle = wxTheApp->GetAppName(); - else - msgTitle = wxString(_("Warning")); - - wxString prompt; - prompt.Printf(_("Do you want to save changes to document %s?"), - (const wxChar *)title); - int res = wxMessageBox(prompt, msgTitle, - wxYES_NO|wxCANCEL|wxICON_QUESTION, - GetDocumentWindow()); - if (res == wxNO) - { - Modify(false); - return true; - } - else if (res == wxYES) - return Save(); - else if (res == wxCANCEL) - return false; - } - return true; -} - -bool wxDocument::Draw(wxDC& WXUNUSED(context)) -{ - return true; -} - -bool wxDocument::AddView(wxView *view) -{ - if (!m_documentViews.Member(view)) - { - m_documentViews.Append(view); - OnChangedViewList(); - } - return true; -} - -bool wxDocument::RemoveView(wxView *view) -{ - (void)m_documentViews.DeleteObject(view); - OnChangedViewList(); - return true; -} - -bool wxDocument::OnCreate(const wxString& WXUNUSED(path), long flags) -{ - if (GetDocumentTemplate()->CreateView(this, flags)) - return true; - else - return false; -} - -// Called after a view is added or removed. -// The default implementation deletes the document if -// there are no more views. -void wxDocument::OnChangedViewList() -{ - if (m_documentViews.GetCount() == 0) - { - if (OnSaveModified()) - { - delete this; - } - } -} - -void wxDocument::UpdateAllViews(wxView *sender, wxObject *hint) -{ - wxList::compatibility_iterator node = m_documentViews.GetFirst(); - while (node) - { - wxView *view = (wxView *)node->GetData(); - if (view != sender) - view->OnUpdate(sender, hint); - node = node->GetNext(); - } -} - -void wxDocument::NotifyClosing() -{ - wxList::compatibility_iterator node = m_documentViews.GetFirst(); - while (node) - { - wxView *view = (wxView *)node->GetData(); - view->OnClosingDocument(); - node = node->GetNext(); - } -} - -void wxDocument::SetFilename(const wxString& filename, bool notifyViews) -{ - m_documentFile = filename; - if ( notifyViews ) - { - // Notify the views that the filename has changed - wxList::compatibility_iterator node = m_documentViews.GetFirst(); - while (node) - { - wxView *view = (wxView *)node->GetData(); - view->OnChangeFilename(); - node = node->GetNext(); - } - } -} - -bool wxDocument::DoSaveDocument(const wxString& file) -{ - wxString msgTitle; - if (!wxTheApp->GetAppName().empty()) - msgTitle = wxTheApp->GetAppName(); - else - msgTitle = wxString(_("File error")); - -#if wxUSE_STD_IOSTREAM - wxSTD ofstream store(file.mb_str(), wxSTD ios::binary); - if (store.fail() || store.bad()) -#else - wxFileOutputStream store(file); - if (store.GetLastError() != wxSTREAM_NO_ERROR) -#endif - { - (void)wxMessageBox(_("Sorry, could not open this file for saving."), msgTitle, wxOK | wxICON_EXCLAMATION, - GetDocumentWindow()); - // Saving error - return false; - } - if (!SaveObject(store)) - { - (void)wxMessageBox(_("Sorry, could not save this file."), msgTitle, wxOK | wxICON_EXCLAMATION, - GetDocumentWindow()); - // Saving error - return false; - } - - return true; -} - -bool wxDocument::DoOpenDocument(const wxString& file) -{ -#if wxUSE_STD_IOSTREAM - wxSTD ifstream store(file.mb_str(), wxSTD ios::binary); - if (!store.fail() && !store.bad()) -#else - wxFileInputStream store(file); - if (store.GetLastError() == wxSTREAM_NO_ERROR) -#endif - { -#if wxUSE_STD_IOSTREAM - LoadObject(store); - if ( !!store || store.eof() ) -#else - int res = LoadObject(store).GetLastError(); - if ( res == wxSTREAM_NO_ERROR || res == wxSTREAM_EOF ) -#endif - return true; - } - - wxLogError(_("Sorry, could not open this file.")); - return false; -} - - -// ---------------------------------------------------------------------------- -// Document view -// ---------------------------------------------------------------------------- - -wxView::wxView() -{ - m_viewDocument = (wxDocument*) NULL; - - m_viewFrame = (wxFrame *) NULL; -} - -wxView::~wxView() -{ - if (m_viewDocument && GetDocumentManager()) - GetDocumentManager()->ActivateView(this, false); - if (m_viewDocument) - m_viewDocument->RemoveView(this); -} - -// Extend event processing to search the document's event table -bool wxView::ProcessEvent(wxEvent& event) -{ - if ( !GetDocument() || !GetDocument()->ProcessEvent(event) ) - return wxEvtHandler::ProcessEvent(event); - - return true; -} - -void wxView::OnActivateView(bool WXUNUSED(activate), wxView *WXUNUSED(activeView), wxView *WXUNUSED(deactiveView)) -{ -} - -void wxView::OnPrint(wxDC *dc, wxObject *WXUNUSED(info)) -{ - OnDraw(dc); -} - -void wxView::OnUpdate(wxView *WXUNUSED(sender), wxObject *WXUNUSED(hint)) -{ -} - -void wxView::OnChangeFilename() -{ - // GetFrame can return wxWindow rather than wxTopLevelWindow due to - // generic MDI implementation so use SetLabel rather than SetTitle. - // It should cause SetTitle() for top level windows. - wxWindow *win = GetFrame(); - if (!win) return; - - wxDocument *doc = GetDocument(); - if (!doc) return; - - wxString name; - doc->GetPrintableName(name); - win->SetLabel(name); -} - -void wxView::SetDocument(wxDocument *doc) -{ - m_viewDocument = doc; - if (doc) - doc->AddView(this); -} - -bool wxView::Close(bool deleteWindow) -{ - if (OnClose(deleteWindow)) - return true; - else - return false; -} - -void wxView::Activate(bool activate) -{ - if (GetDocument() && GetDocumentManager()) - { - OnActivateView(activate, this, GetDocumentManager()->GetCurrentView()); - GetDocumentManager()->ActivateView(this, activate); - } -} - -bool wxView::OnClose(bool WXUNUSED(deleteWindow)) -{ - return GetDocument() ? GetDocument()->Close() : true; -} - -#if wxUSE_PRINTING_ARCHITECTURE -wxPrintout *wxView::OnCreatePrintout() -{ - return new wxDocPrintout(this); -} -#endif // wxUSE_PRINTING_ARCHITECTURE - -// ---------------------------------------------------------------------------- -// wxDocTemplate -// ---------------------------------------------------------------------------- - -wxDocTemplate::wxDocTemplate(wxDocManager *manager, - const wxString& descr, - const wxString& filter, - const wxString& dir, - const wxString& ext, - const wxString& docTypeName, - const wxString& viewTypeName, - wxClassInfo *docClassInfo, - wxClassInfo *viewClassInfo, - long flags) -{ - m_documentManager = manager; - m_description = descr; - m_directory = dir; - m_defaultExt = ext; - m_fileFilter = filter; - m_flags = flags; - m_docTypeName = docTypeName; - m_viewTypeName = viewTypeName; - m_documentManager->AssociateTemplate(this); - - m_docClassInfo = docClassInfo; - m_viewClassInfo = viewClassInfo; -} - -wxDocTemplate::~wxDocTemplate() -{ - m_documentManager->DisassociateTemplate(this); -} - -// Tries to dynamically construct an object of the right class. -wxDocument *wxDocTemplate::CreateDocument(const wxString& path, long flags) -{ - wxDocument *doc = DoCreateDocument(); - if ( doc == NULL ) - return (wxDocument *) NULL; - - if (InitDocument(doc, path, flags)) - { - return doc; - } - else - { - return (wxDocument *) NULL; - } -} - -bool wxDocTemplate::InitDocument(wxDocument* doc, const wxString& path, long flags) -{ - doc->SetFilename(path); - doc->SetDocumentTemplate(this); - GetDocumentManager()->AddDocument(doc); - doc->SetCommandProcessor(doc->OnCreateCommandProcessor()); - - if (doc->OnCreate(path, flags)) - return true; - else - { - if (GetDocumentManager()->GetDocuments().Member(doc)) - doc->DeleteAllViews(); - return false; - } -} - -wxView *wxDocTemplate::CreateView(wxDocument *doc, long flags) -{ - wxView *view = DoCreateView(); - if ( view == NULL ) - return (wxView *) NULL; - - view->SetDocument(doc); - if (view->OnCreate(doc, flags)) - { - return view; - } - else - { - delete view; - return (wxView *) NULL; - } -} - -// The default (very primitive) format detection: check is the extension is -// that of the template -bool wxDocTemplate::FileMatchesTemplate(const wxString& path) -{ - wxStringTokenizer parser (GetFileFilter(), wxT(";")); - wxString anything = wxT ("*"); - while (parser.HasMoreTokens()) - { - wxString filter = parser.GetNextToken(); - wxString filterExt = FindExtension (filter); - if ( filter.IsSameAs (anything) || - filterExt.IsSameAs (anything) || - filterExt.IsSameAs (FindExtension (path)) ) - return true; - } - return GetDefaultExtension().IsSameAs(FindExtension(path)); -} - -wxDocument *wxDocTemplate::DoCreateDocument() -{ - if (!m_docClassInfo) - return (wxDocument *) NULL; - - return (wxDocument *)m_docClassInfo->CreateObject(); -} - -wxView *wxDocTemplate::DoCreateView() -{ - if (!m_viewClassInfo) - return (wxView *) NULL; - - return (wxView *)m_viewClassInfo->CreateObject(); -} - -// ---------------------------------------------------------------------------- -// wxDocManager -// ---------------------------------------------------------------------------- - -BEGIN_EVENT_TABLE(wxDocManager, wxEvtHandler) - EVT_MENU(wxID_OPEN, wxDocManager::OnFileOpen) - EVT_MENU(wxID_CLOSE, wxDocManager::OnFileClose) - EVT_MENU(wxID_CLOSE_ALL, wxDocManager::OnFileCloseAll) - EVT_MENU(wxID_REVERT, wxDocManager::OnFileRevert) - EVT_MENU(wxID_NEW, wxDocManager::OnFileNew) - EVT_MENU(wxID_SAVE, wxDocManager::OnFileSave) - EVT_MENU(wxID_SAVEAS, wxDocManager::OnFileSaveAs) - EVT_MENU(wxID_UNDO, wxDocManager::OnUndo) - EVT_MENU(wxID_REDO, wxDocManager::OnRedo) - - EVT_UPDATE_UI(wxID_OPEN, wxDocManager::OnUpdateFileOpen) - EVT_UPDATE_UI(wxID_CLOSE, wxDocManager::OnUpdateFileClose) - EVT_UPDATE_UI(wxID_CLOSE_ALL, wxDocManager::OnUpdateFileClose) - EVT_UPDATE_UI(wxID_REVERT, wxDocManager::OnUpdateFileRevert) - EVT_UPDATE_UI(wxID_NEW, wxDocManager::OnUpdateFileNew) - EVT_UPDATE_UI(wxID_SAVE, wxDocManager::OnUpdateFileSave) - EVT_UPDATE_UI(wxID_SAVEAS, wxDocManager::OnUpdateFileSaveAs) - EVT_UPDATE_UI(wxID_UNDO, wxDocManager::OnUpdateUndo) - EVT_UPDATE_UI(wxID_REDO, wxDocManager::OnUpdateRedo) - -#if wxUSE_PRINTING_ARCHITECTURE - EVT_MENU(wxID_PRINT, wxDocManager::OnPrint) - EVT_MENU(wxID_PREVIEW, wxDocManager::OnPreview) - - EVT_UPDATE_UI(wxID_PRINT, wxDocManager::OnUpdatePrint) - EVT_UPDATE_UI(wxID_PREVIEW, wxDocManager::OnUpdatePreview) -#endif -END_EVENT_TABLE() - -wxDocManager* wxDocManager::sm_docManager = (wxDocManager*) NULL; - -wxDocManager::wxDocManager(long flags, bool initialize) -{ - m_defaultDocumentNameCounter = 1; - m_flags = flags; - m_currentView = (wxView *) NULL; - m_maxDocsOpen = 10000; - m_fileHistory = (wxFileHistory *) NULL; - if (initialize) - Initialize(); - sm_docManager = this; -} - -wxDocManager::~wxDocManager() -{ - Clear(); - if (m_fileHistory) - delete m_fileHistory; - sm_docManager = (wxDocManager*) NULL; -} - -// closes the specified document -bool wxDocManager::CloseDocument(wxDocument* doc, bool force) -{ - if (doc->Close() || force) - { - // Implicitly deletes the document when - // the last view is deleted - doc->DeleteAllViews(); - - // Check we're really deleted - if (m_docs.Member(doc)) - delete doc; - - return true; - } - return false; -} - -bool wxDocManager::CloseDocuments(bool force) -{ - wxList::compatibility_iterator node = m_docs.GetFirst(); - while (node) - { - wxDocument *doc = (wxDocument *)node->GetData(); - wxList::compatibility_iterator next = node->GetNext(); - - if (!CloseDocument(doc, force)) - return false; - - // This assumes that documents are not connected in - // any way, i.e. deleting one document does NOT - // delete another. - node = next; - } - return true; -} - -bool wxDocManager::Clear(bool force) -{ - if (!CloseDocuments(force)) - return false; - - m_currentView = NULL; - - wxList::compatibility_iterator node = m_templates.GetFirst(); - while (node) - { - wxDocTemplate *templ = (wxDocTemplate*) node->GetData(); - wxList::compatibility_iterator next = node->GetNext(); - delete templ; - node = next; - } - return true; -} - -bool wxDocManager::Initialize() -{ - m_fileHistory = OnCreateFileHistory(); - return true; -} - -wxFileHistory *wxDocManager::OnCreateFileHistory() -{ - return new wxFileHistory; -} - -void wxDocManager::OnFileClose(wxCommandEvent& WXUNUSED(event)) -{ - wxDocument *doc = GetCurrentDocument(); - if (!doc) - return; - if (doc->Close()) - { - doc->DeleteAllViews(); - if (m_docs.Member(doc)) - delete doc; - } -} - -void wxDocManager::OnFileCloseAll(wxCommandEvent& WXUNUSED(event)) -{ - CloseDocuments(false); -} - -void wxDocManager::OnFileNew(wxCommandEvent& WXUNUSED(event)) -{ - CreateDocument( wxEmptyString, wxDOC_NEW ); -} - -void wxDocManager::OnFileOpen(wxCommandEvent& WXUNUSED(event)) -{ - if ( !CreateDocument( wxEmptyString, 0) ) - { - OnOpenFileFailure(); - } -} - -void wxDocManager::OnFileRevert(wxCommandEvent& WXUNUSED(event)) -{ - wxDocument *doc = GetCurrentDocument(); - if (!doc) - return; - doc->Revert(); -} - -void wxDocManager::OnFileSave(wxCommandEvent& WXUNUSED(event)) -{ - wxDocument *doc = GetCurrentDocument(); - if (!doc) - return; - doc->Save(); -} - -void wxDocManager::OnFileSaveAs(wxCommandEvent& WXUNUSED(event)) -{ - wxDocument *doc = GetCurrentDocument(); - if (!doc) - return; - doc->SaveAs(); -} - -void wxDocManager::OnPrint(wxCommandEvent& WXUNUSED(event)) -{ -#if wxUSE_PRINTING_ARCHITECTURE - wxView *view = GetCurrentView(); - if (!view) - return; - - wxPrintout *printout = view->OnCreatePrintout(); - if (printout) - { - wxPrinter printer; - printer.Print(view->GetFrame(), printout, true); - - delete printout; - } -#endif // wxUSE_PRINTING_ARCHITECTURE -} - -void wxDocManager::OnPreview(wxCommandEvent& WXUNUSED(event)) -{ -#if wxUSE_PRINTING_ARCHITECTURE - wxBusyCursor busy; - wxView *view = GetCurrentView(); - if (!view) - return; - - wxPrintout *printout = view->OnCreatePrintout(); - if (printout) - { - // Pass two printout objects: for preview, and possible printing. - wxPrintPreviewBase *preview = new wxPrintPreview(printout, view->OnCreatePrintout()); - if ( !preview->Ok() ) - { - delete preview; - wxMessageBox( _("Sorry, print preview needs a printer to be installed.") ); - return; - } - - wxPreviewFrame *frame = new wxPreviewFrame(preview, (wxFrame *)wxTheApp->GetTopWindow(), _("Print Preview"), - wxPoint(100, 100), wxSize(600, 650)); - frame->Centre(wxBOTH); - frame->Initialize(); - frame->Show(true); - } -#endif // wxUSE_PRINTING_ARCHITECTURE -} - -void wxDocManager::OnUndo(wxCommandEvent& event) -{ - wxDocument *doc = GetCurrentDocument(); - if (!doc) - return; - if (doc->GetCommandProcessor()) - doc->GetCommandProcessor()->Undo(); - else - event.Skip(); -} - -void wxDocManager::OnRedo(wxCommandEvent& event) -{ - wxDocument *doc = GetCurrentDocument(); - if (!doc) - return; - if (doc->GetCommandProcessor()) - doc->GetCommandProcessor()->Redo(); - else - event.Skip(); -} - -// Handlers for UI update commands - -void wxDocManager::OnUpdateFileOpen(wxUpdateUIEvent& event) -{ - event.Enable( true ); -} - -void wxDocManager::OnUpdateFileClose(wxUpdateUIEvent& event) -{ - wxDocument *doc = GetCurrentDocument(); - event.Enable( (doc != (wxDocument*) NULL) ); -} - -void wxDocManager::OnUpdateFileRevert(wxUpdateUIEvent& event) -{ - wxDocument *doc = GetCurrentDocument(); - event.Enable( (doc != (wxDocument*) NULL) ); -} - -void wxDocManager::OnUpdateFileNew(wxUpdateUIEvent& event) -{ - event.Enable( true ); -} - -void wxDocManager::OnUpdateFileSave(wxUpdateUIEvent& event) -{ - wxDocument *doc = GetCurrentDocument(); - event.Enable( doc && doc->IsModified() ); -} - -void wxDocManager::OnUpdateFileSaveAs(wxUpdateUIEvent& event) -{ - wxDocument *doc = GetCurrentDocument(); - event.Enable( (doc != (wxDocument*) NULL) ); -} - -void wxDocManager::OnUpdateUndo(wxUpdateUIEvent& event) -{ - wxDocument *doc = GetCurrentDocument(); - if (!doc) - event.Enable(false); - else if (!doc->GetCommandProcessor()) - event.Skip(); - else - { - event.Enable( doc->GetCommandProcessor()->CanUndo() ); - doc->GetCommandProcessor()->SetMenuStrings(); - } -} - -void wxDocManager::OnUpdateRedo(wxUpdateUIEvent& event) -{ - wxDocument *doc = GetCurrentDocument(); - if (!doc) - event.Enable(false); - else if (!doc->GetCommandProcessor()) - event.Skip(); - else - { - event.Enable( doc->GetCommandProcessor()->CanRedo() ); - doc->GetCommandProcessor()->SetMenuStrings(); - } -} - -void wxDocManager::OnUpdatePrint(wxUpdateUIEvent& event) -{ - wxDocument *doc = GetCurrentDocument(); - event.Enable( (doc != (wxDocument*) NULL) ); -} - -void wxDocManager::OnUpdatePreview(wxUpdateUIEvent& event) -{ - wxDocument *doc = GetCurrentDocument(); - event.Enable( (doc != (wxDocument*) NULL) ); -} - -wxView *wxDocManager::GetCurrentView() const -{ - if (m_currentView) - return m_currentView; - if (m_docs.GetCount() == 1) - { - wxDocument* doc = (wxDocument*) m_docs.GetFirst()->GetData(); - return doc->GetFirstView(); - } - return (wxView *) NULL; -} - -// Extend event processing to search the view's event table -bool wxDocManager::ProcessEvent(wxEvent& event) -{ - wxView* view = GetCurrentView(); - if (view) - { - if (view->ProcessEvent(event)) - return true; - } - return wxEvtHandler::ProcessEvent(event); -} - -wxDocument *wxDocManager::CreateDocument(const wxString& path, long flags) -{ - wxDocTemplate **templates = new wxDocTemplate *[m_templates.GetCount()]; - int n = 0; - - for (size_t i = 0; i < m_templates.GetCount(); i++) - { - wxDocTemplate *temp = (wxDocTemplate *)(m_templates.Item(i)->GetData()); - if (temp->IsVisible()) - { - templates[n] = temp; - n ++; - } - } - if (n == 0) - { - delete[] templates; - return (wxDocument *) NULL; - } - - wxDocument* docToClose = NULL; - - // If we've reached the max number of docs, close the - // first one. - if ( (int)GetDocuments().GetCount() >= m_maxDocsOpen ) - { - wxDocument *doc = (wxDocument *)GetDocuments().GetFirst()->GetData(); - docToClose = doc; - } - - // New document: user chooses a template, unless there's only one. - if (flags & wxDOC_NEW) - { - if (n == 1) - { - if (docToClose) - { - if (!CloseDocument(docToClose, false)) - { - delete[] templates; - return NULL; - } - } - - wxDocTemplate *temp = templates[0]; - delete[] templates; - wxDocument *newDoc = temp->CreateDocument(path, flags); - - if (newDoc) - { - newDoc->SetDocumentName(temp->GetDocumentName()); - newDoc->SetDocumentTemplate(temp); - if (!newDoc->OnNewDocument() ) - { - // Document is implicitly deleted by DeleteAllViews - newDoc->DeleteAllViews(); - return NULL; - } - } - return newDoc; - } - - wxDocTemplate *temp = SelectDocumentType(templates, n); - delete[] templates; - if (temp) - { - if (docToClose) - { - if (!CloseDocument(docToClose, false)) - { - return NULL; - } - } - - wxDocument *newDoc = temp->CreateDocument(path, flags); - - if (newDoc) - { - newDoc->SetDocumentName(temp->GetDocumentName()); - newDoc->SetDocumentTemplate(temp); - if (!newDoc->OnNewDocument() ) - { - // Document is implicitly deleted by DeleteAllViews - newDoc->DeleteAllViews(); - return NULL; - } - } - return newDoc; - } - else - return (wxDocument *) NULL; - } - - // Existing document - wxDocTemplate *temp; - - wxString path2 = path; - - if (flags & wxDOC_SILENT) - { - temp = FindTemplateForPath(path2); - if (!temp) - { - // Since we do not add files with non-default extensions to the FileHistory this - // can only happen if the application changes the allowed templates in runtime. - (void)wxMessageBox(_("Sorry, the format for this file is unknown."), - _("Open File"), - wxOK | wxICON_EXCLAMATION, wxFindSuitableParent()); - } - } - else - temp = SelectDocumentPath(templates, n, path2, flags); - - delete[] templates; - - if (temp) - { - if (docToClose) - { - if (!CloseDocument(docToClose, false)) - { - return NULL; - } - } - - //see if this file is already open - for (size_t i = 0; i < GetDocuments().GetCount(); ++i) - { - wxDocument* currentDoc = (wxDocument*)(GetDocuments().Item(i)->GetData()); -#ifdef __WXMSW__ - //file paths are case-insensitive on Windows - if (path2.CmpNoCase(currentDoc->GetFilename()) == 0) -#else - if (path2.Cmp(currentDoc->GetFilename()) == 0) -#endif - { - //file already open. Just activate it and return - if (currentDoc->GetFirstView()) - { - ActivateView(currentDoc->GetFirstView(), true); - if (currentDoc->GetDocumentWindow()) - currentDoc->GetDocumentWindow()->SetFocus(); - return currentDoc; - } - } - } - - wxDocument *newDoc = temp->CreateDocument(path2, flags); - if (newDoc) - { - newDoc->SetDocumentName(temp->GetDocumentName()); - newDoc->SetDocumentTemplate(temp); - if (!newDoc->OnOpenDocument(path2)) - { - newDoc->DeleteAllViews(); - // delete newDoc; // Implicitly deleted by DeleteAllViews - return (wxDocument *) NULL; - } - // A file that doesn't use the default extension of its document - // template cannot be opened via the FileHistory, so we do not - // add it. - if (temp->FileMatchesTemplate(path2)) - AddFileToHistory(path2); - } - return newDoc; - } - - return (wxDocument *) NULL; -} - -wxView *wxDocManager::CreateView(wxDocument *doc, long flags) -{ - wxDocTemplate **templates = new wxDocTemplate *[m_templates.GetCount()]; - int n =0; - - for (size_t i = 0; i < m_templates.GetCount(); i++) - { - wxDocTemplate *temp = (wxDocTemplate *)(m_templates.Item(i)->GetData()); - if (temp->IsVisible()) - { - if (temp->GetDocumentName() == doc->GetDocumentName()) - { - templates[n] = temp; - n ++; - } - } - } - if (n == 0) - { - delete[] templates; - return (wxView *) NULL; - } - if (n == 1) - { - wxDocTemplate *temp = templates[0]; - delete[] templates; - wxView *view = temp->CreateView(doc, flags); - if (view) - view->SetViewName(temp->GetViewName()); - return view; - } - - wxDocTemplate *temp = SelectViewType(templates, n); - delete[] templates; - if (temp) - { - wxView *view = temp->CreateView(doc, flags); - if (view) - view->SetViewName(temp->GetViewName()); - return view; - } - else - return (wxView *) NULL; -} - -// Not yet implemented -void wxDocManager::DeleteTemplate(wxDocTemplate *WXUNUSED(temp), long WXUNUSED(flags)) -{ -} - -// Not yet implemented -bool wxDocManager::FlushDoc(wxDocument *WXUNUSED(doc)) -{ - return false; -} - -wxDocument *wxDocManager::GetCurrentDocument() const -{ - wxView *view = GetCurrentView(); - if (view) - return view->GetDocument(); - else - return (wxDocument *) NULL; -} - -// Make a default document name -bool wxDocManager::MakeDefaultName(wxString& name) -{ - name.Printf(_("unnamed%d"), m_defaultDocumentNameCounter); - m_defaultDocumentNameCounter++; - - return true; -} - -// Make a frame title (override this to do something different) -// If docName is empty, a document is not currently active. -wxString wxDocManager::MakeFrameTitle(wxDocument* doc) -{ - wxString appName = wxTheApp->GetAppName(); - wxString title; - if (!doc) - title = appName; - else - { - wxString docName; - doc->GetPrintableName(docName); - title = docName + wxString(_(" - ")) + appName; - } - return title; -} - - -// Not yet implemented -wxDocTemplate *wxDocManager::MatchTemplate(const wxString& WXUNUSED(path)) -{ - return (wxDocTemplate *) NULL; -} - -// File history management -void wxDocManager::AddFileToHistory(const wxString& file) -{ - if (m_fileHistory) - m_fileHistory->AddFileToHistory(file); -} - -void wxDocManager::RemoveFileFromHistory(size_t i) -{ - if (m_fileHistory) - m_fileHistory->RemoveFileFromHistory(i); -} - -wxString wxDocManager::GetHistoryFile(size_t i) const -{ - wxString histFile; - - if (m_fileHistory) - histFile = m_fileHistory->GetHistoryFile(i); - - return histFile; -} - -void wxDocManager::FileHistoryUseMenu(wxMenu *menu) -{ - if (m_fileHistory) - m_fileHistory->UseMenu(menu); -} - -void wxDocManager::FileHistoryRemoveMenu(wxMenu *menu) -{ - if (m_fileHistory) - m_fileHistory->RemoveMenu(menu); -} - -#if wxUSE_CONFIG -void wxDocManager::FileHistoryLoad(wxConfigBase& config) -{ - if (m_fileHistory) - m_fileHistory->Load(config); -} - -void wxDocManager::FileHistorySave(wxConfigBase& config) -{ - if (m_fileHistory) - m_fileHistory->Save(config); -} -#endif - -void wxDocManager::FileHistoryAddFilesToMenu(wxMenu* menu) -{ - if (m_fileHistory) - m_fileHistory->AddFilesToMenu(menu); -} - -void wxDocManager::FileHistoryAddFilesToMenu() -{ - if (m_fileHistory) - m_fileHistory->AddFilesToMenu(); -} - -size_t wxDocManager::GetHistoryFilesCount() const -{ - return m_fileHistory ? m_fileHistory->GetCount() : 0; -} - - -// Find out the document template via matching in the document file format -// against that of the template -wxDocTemplate *wxDocManager::FindTemplateForPath(const wxString& path) -{ - wxDocTemplate *theTemplate = (wxDocTemplate *) NULL; - - // Find the template which this extension corresponds to - for (size_t i = 0; i < m_templates.GetCount(); i++) - { - wxDocTemplate *temp = (wxDocTemplate *)m_templates.Item(i)->GetData(); - if ( temp->FileMatchesTemplate(path) ) - { - theTemplate = temp; - break; - } - } - return theTemplate; -} - -// Try to get a more suitable parent frame than the top window, -// for selection dialogs. Otherwise you may get an unexpected -// window being activated when a dialog is shown. -static wxWindow* wxFindSuitableParent() -{ - wxWindow* parent = wxTheApp->GetTopWindow(); - - wxWindow* focusWindow = wxWindow::FindFocus(); - if (focusWindow) - { - while (focusWindow && - !focusWindow->IsKindOf(CLASSINFO(wxDialog)) && - !focusWindow->IsKindOf(CLASSINFO(wxFrame))) - - focusWindow = focusWindow->GetParent(); - - if (focusWindow) - parent = focusWindow; - } - return parent; -} - -// Prompts user to open a file, using file specs in templates. -// Must extend the file selector dialog or implement own; OR -// match the extension to the template extension. - -wxDocTemplate *wxDocManager::SelectDocumentPath(wxDocTemplate **templates, -#if defined(__WXMSW__) || defined(__WXGTK__) || defined(__WXMAC__) - int noTemplates, -#else - int WXUNUSED(noTemplates), -#endif - wxString& path, - long WXUNUSED(flags), - bool WXUNUSED(save)) -{ - // We can only have multiple filters in Windows and GTK -#if defined(__WXMSW__) || defined(__WXGTK__) || defined(__WXMAC__) - wxString descrBuf; - - int i; - for (i = 0; i < noTemplates; i++) - { - if (templates[i]->IsVisible()) - { - // add a '|' to separate this filter from the previous one - if ( !descrBuf.empty() ) - descrBuf << wxT('|'); - - descrBuf << templates[i]->GetDescription() - << wxT(" (") << templates[i]->GetFileFilter() << wxT(") |") - << templates[i]->GetFileFilter(); - } - } -#else - wxString descrBuf = wxT("*.*"); -#endif - - int FilterIndex = -1; - - wxWindow* parent = wxFindSuitableParent(); - - wxString pathTmp = wxFileSelectorEx(_("Select a file"), - m_lastDirectory, - wxEmptyString, - &FilterIndex, - descrBuf, - 0, - parent); - - wxDocTemplate *theTemplate = (wxDocTemplate *)NULL; - if (!pathTmp.empty()) - { - if (!wxFileExists(pathTmp)) - { - wxString msgTitle; - if (!wxTheApp->GetAppName().empty()) - msgTitle = wxTheApp->GetAppName(); - else - msgTitle = wxString(_("File error")); - - (void)wxMessageBox(_("Sorry, could not open this file."), msgTitle, wxOK | wxICON_EXCLAMATION, - parent); - - path = wxEmptyString; - return (wxDocTemplate *) NULL; - } - m_lastDirectory = wxPathOnly(pathTmp); - - path = pathTmp; - - // first choose the template using the extension, if this fails (i.e. - // wxFileSelectorEx() didn't fill it), then use the path - if ( FilterIndex != -1 ) - theTemplate = templates[FilterIndex]; - if ( !theTemplate ) - theTemplate = FindTemplateForPath(path); - if ( !theTemplate ) - { - // Since we do not add files with non-default extensions to the FileHistory this - // can only happen if the application changes the allowed templates in runtime. - (void)wxMessageBox(_("Sorry, the format for this file is unknown."), - _("Open File"), - wxOK | wxICON_EXCLAMATION, wxFindSuitableParent()); - } - } - else - { - path = wxEmptyString; - } - - return theTemplate; -} - -wxDocTemplate *wxDocManager::SelectDocumentType(wxDocTemplate **templates, - int noTemplates, bool sort) -{ - wxArrayString strings; - wxDocTemplate **data = new wxDocTemplate *[noTemplates]; - int i; - int n = 0; - - for (i = 0; i < noTemplates; i++) - { - if (templates[i]->IsVisible()) - { - int j; - bool want = true; - for (j = 0; j < n; j++) - { - //filter out NOT unique documents + view combinations - if ( templates[i]->m_docTypeName == data[j]->m_docTypeName && - templates[i]->m_viewTypeName == data[j]->m_viewTypeName - ) - want = false; - } - - if ( want ) - { - strings.Add(templates[i]->m_description); - - data[n] = templates[i]; - n ++; - } - } - } // for - - if (sort) - { - strings.Sort(); // ascending sort - // Yes, this will be slow, but template lists - // are typically short. - int j; - n = strings.Count(); - for (i = 0; i < n; i++) - { - for (j = 0; j < noTemplates; j++) - { - if (strings[i] == templates[j]->m_description) - data[i] = templates[j]; - } - } - } - - wxDocTemplate *theTemplate; - - switch ( n ) - { - case 0: - // no visible templates, hence nothing to choose from - theTemplate = NULL; - break; - - case 1: - // don't propose the user to choose if he heas no choice - theTemplate = data[0]; - break; - - default: - // propose the user to choose one of several - theTemplate = (wxDocTemplate *)wxGetSingleChoiceData - ( - _("Select a document template"), - _("Templates"), - strings, - (void **)data, - wxFindSuitableParent() - ); - } - - delete[] data; - - return theTemplate; -} - -wxDocTemplate *wxDocManager::SelectViewType(wxDocTemplate **templates, - int noTemplates, bool sort) -{ - wxArrayString strings; - wxDocTemplate **data = new wxDocTemplate *[noTemplates]; - int i; - int n = 0; - - for (i = 0; i < noTemplates; i++) - { - wxDocTemplate *templ = templates[i]; - if ( templ->IsVisible() && !templ->GetViewName().empty() ) - { - int j; - bool want = true; - for (j = 0; j < n; j++) - { - //filter out NOT unique views - if ( templates[i]->m_viewTypeName == data[j]->m_viewTypeName ) - want = false; - } - - if ( want ) - { - strings.Add(templ->m_viewTypeName); - data[n] = templ; - n ++; - } - } - } - - if (sort) - { - strings.Sort(); // ascending sort - // Yes, this will be slow, but template lists - // are typically short. - int j; - n = strings.Count(); - for (i = 0; i < n; i++) - { - for (j = 0; j < noTemplates; j++) - { - if (strings[i] == templates[j]->m_viewTypeName) - data[i] = templates[j]; - } - } - } - - wxDocTemplate *theTemplate; - - // the same logic as above - switch ( n ) - { - case 0: - theTemplate = (wxDocTemplate *)NULL; - break; - - case 1: - theTemplate = data[0]; - break; - - default: - theTemplate = (wxDocTemplate *)wxGetSingleChoiceData - ( - _("Select a document view"), - _("Views"), - strings, - (void **)data, - wxFindSuitableParent() - ); - - } - - delete[] data; - return theTemplate; -} - -void wxDocManager::AssociateTemplate(wxDocTemplate *temp) -{ - if (!m_templates.Member(temp)) - m_templates.Append(temp); -} - -void wxDocManager::DisassociateTemplate(wxDocTemplate *temp) -{ - m_templates.DeleteObject(temp); -} - -// Add and remove a document from the manager's list -void wxDocManager::AddDocument(wxDocument *doc) -{ - if (!m_docs.Member(doc)) - m_docs.Append(doc); -} - -void wxDocManager::RemoveDocument(wxDocument *doc) -{ - m_docs.DeleteObject(doc); -} - -// Views or windows should inform the document manager -// when a view is going in or out of focus -void wxDocManager::ActivateView(wxView *view, bool activate) -{ - if ( activate ) - { - m_currentView = view; - } - else // deactivate - { - if ( m_currentView == view ) - { - // don't keep stale pointer - m_currentView = (wxView *) NULL; - } - } -} - -// ---------------------------------------------------------------------------- -// Default document child frame -// ---------------------------------------------------------------------------- - -BEGIN_EVENT_TABLE(wxDocChildFrame, wxFrame) - EVT_ACTIVATE(wxDocChildFrame::OnActivate) - EVT_CLOSE(wxDocChildFrame::OnCloseWindow) -END_EVENT_TABLE() - -wxDocChildFrame::wxDocChildFrame(wxDocument *doc, - wxView *view, - wxFrame *frame, - wxWindowID id, - const wxString& title, - const wxPoint& pos, - const wxSize& size, - long style, - const wxString& name) - : wxFrame(frame, id, title, pos, size, style, name) -{ - m_childDocument = doc; - m_childView = view; - if (view) - view->SetFrame(this); -} - -// Extend event processing to search the view's event table -bool wxDocChildFrame::ProcessEvent(wxEvent& event) -{ - if (m_childView) - m_childView->Activate(true); - - if ( !m_childView || ! m_childView->ProcessEvent(event) ) - { - // Only hand up to the parent if it's a menu command - if (!event.IsKindOf(CLASSINFO(wxCommandEvent)) || !GetParent() || !GetParent()->ProcessEvent(event)) - return wxEvtHandler::ProcessEvent(event); - else - return true; - } - else - return true; -} - -void wxDocChildFrame::OnActivate(wxActivateEvent& event) -{ - wxFrame::OnActivate(event); - - if (m_childView) - m_childView->Activate(event.GetActive()); -} - -void wxDocChildFrame::OnCloseWindow(wxCloseEvent& event) -{ - if (m_childView) - { - bool ans = event.CanVeto() - ? m_childView->Close(false) // false means don't delete associated window - : true; // Must delete. - - if (ans) - { - m_childView->Activate(false); - delete m_childView; - m_childView = (wxView *) NULL; - m_childDocument = (wxDocument *) NULL; - - this->Destroy(); - } - else - event.Veto(); - } - else - event.Veto(); -} - -// ---------------------------------------------------------------------------- -// Default parent frame -// ---------------------------------------------------------------------------- - -BEGIN_EVENT_TABLE(wxDocParentFrame, wxFrame) - EVT_MENU(wxID_EXIT, wxDocParentFrame::OnExit) - EVT_MENU_RANGE(wxID_FILE1, wxID_FILE9, wxDocParentFrame::OnMRUFile) - EVT_CLOSE(wxDocParentFrame::OnCloseWindow) -END_EVENT_TABLE() - -wxDocParentFrame::wxDocParentFrame() -{ - m_docManager = NULL; -} - -wxDocParentFrame::wxDocParentFrame(wxDocManager *manager, - wxFrame *frame, - wxWindowID id, - const wxString& title, - const wxPoint& pos, - const wxSize& size, - long style, - const wxString& name) - : wxFrame(frame, id, title, pos, size, style, name) -{ - m_docManager = manager; -} - -bool wxDocParentFrame::Create(wxDocManager *manager, - wxFrame *frame, - wxWindowID id, - const wxString& title, - const wxPoint& pos, - const wxSize& size, - long style, - const wxString& name) -{ - m_docManager = manager; - return base_type::Create(frame, id, title, pos, size, style, name); -} - -void wxDocParentFrame::OnExit(wxCommandEvent& WXUNUSED(event)) -{ - Close(); -} - -void wxDocParentFrame::OnMRUFile(wxCommandEvent& event) -{ - int n = event.GetId() - wxID_FILE1; // the index in MRU list - wxString filename(m_docManager->GetHistoryFile(n)); - if ( !filename.empty() ) - { - // verify that the file exists before doing anything else - if ( wxFile::Exists(filename) ) - { - // try to open it - if (!m_docManager->CreateDocument(filename, wxDOC_SILENT)) - { - // remove the file from the MRU list. The user should already be notified. - m_docManager->RemoveFileFromHistory(n); - - wxLogError(_("The file '%s' couldn't be opened.\nIt has been removed from the most recently used files list."), - filename.c_str()); - } - } - else - { - // remove the bogus filename from the MRU list and notify the user - // about it - m_docManager->RemoveFileFromHistory(n); - - wxLogError(_("The file '%s' doesn't exist and couldn't be opened.\nIt has been removed from the most recently used files list."), - filename.c_str()); - } - } -} - -// Extend event processing to search the view's event table -bool wxDocParentFrame::ProcessEvent(wxEvent& event) -{ - // Try the document manager, then do default processing - if (!m_docManager || !m_docManager->ProcessEvent(event)) - return wxEvtHandler::ProcessEvent(event); - else - return true; -} - -// Define the behaviour for the frame closing -// - must delete all frames except for the main one. -void wxDocParentFrame::OnCloseWindow(wxCloseEvent& event) -{ - if ( m_docManager && !m_docManager->Clear(!event.CanVeto()) ) - { - // The user decided not to close finally, abort. - event.Veto(); - } - else - { - this->Destroy(); - } -} - -#if wxUSE_PRINTING_ARCHITECTURE - -wxDocPrintout::wxDocPrintout(wxView *view, const wxString& title) - : wxPrintout(title) -{ - m_printoutView = view; -} - -bool wxDocPrintout::OnPrintPage(int WXUNUSED(page)) -{ - wxDC *dc = GetDC(); - - // Get the logical pixels per inch of screen and printer - int ppiScreenX, ppiScreenY; - GetPPIScreen(&ppiScreenX, &ppiScreenY); - wxUnusedVar(ppiScreenY); - int ppiPrinterX, ppiPrinterY; - GetPPIPrinter(&ppiPrinterX, &ppiPrinterY); - wxUnusedVar(ppiPrinterY); - - // This scales the DC so that the printout roughly represents the - // the screen scaling. The text point size _should_ be the right size - // but in fact is too small for some reason. This is a detail that will - // need to be addressed at some point but can be fudged for the - // moment. - float scale = (float)((float)ppiPrinterX/(float)ppiScreenX); - - // Now we have to check in case our real page size is reduced - // (e.g. because we're drawing to a print preview memory DC) - int pageWidth, pageHeight; - int w, h; - dc->GetSize(&w, &h); - GetPageSizePixels(&pageWidth, &pageHeight); - wxUnusedVar(pageHeight); - - // If printer pageWidth == current DC width, then this doesn't - // change. But w might be the preview bitmap width, so scale down. - float overallScale = scale * (float)(w/(float)pageWidth); - dc->SetUserScale(overallScale, overallScale); - - if (m_printoutView) - { - m_printoutView->OnDraw(dc); - } - return true; -} - -bool wxDocPrintout::HasPage(int pageNum) -{ - return (pageNum == 1); -} - -bool wxDocPrintout::OnBeginDocument(int startPage, int endPage) -{ - if (!wxPrintout::OnBeginDocument(startPage, endPage)) - return false; - - return true; -} - -void wxDocPrintout::GetPageInfo(int *minPage, int *maxPage, int *selPageFrom, int *selPageTo) -{ - *minPage = 1; - *maxPage = 1; - *selPageFrom = 1; - *selPageTo = 1; -} - -#endif // wxUSE_PRINTING_ARCHITECTURE - -// ---------------------------------------------------------------------------- -// File history processor -// ---------------------------------------------------------------------------- - -static inline wxChar* MYcopystring(const wxString& s) -{ - wxChar* copy = new wxChar[s.length() + 1]; - return wxStrcpy(copy, s.c_str()); -} - -static inline wxChar* MYcopystring(const wxChar* s) -{ - wxChar* copy = new wxChar[wxStrlen(s) + 1]; - return wxStrcpy(copy, s); -} - -wxFileHistory::wxFileHistory(size_t maxFiles, wxWindowID idBase) -{ - m_fileMaxFiles = maxFiles; - m_idBase = idBase; - m_fileHistoryN = 0; - m_fileHistory = new wxChar *[m_fileMaxFiles]; -} - -wxFileHistory::~wxFileHistory() -{ - size_t i; - for (i = 0; i < m_fileHistoryN; i++) - delete[] m_fileHistory[i]; - delete[] m_fileHistory; -} - -// File history management -void wxFileHistory::AddFileToHistory(const wxString& file) -{ - size_t i; - - // Check we don't already have this file - for (i = 0; i < m_fileHistoryN; i++) - { -#if defined( __WXMSW__ ) // Add any other OSes with case insensitive file names - wxString testString; - if ( m_fileHistory[i] ) - testString = m_fileHistory[i]; - if ( m_fileHistory[i] && ( file.Lower() == testString.Lower() ) ) -#else - if ( m_fileHistory[i] && ( file == m_fileHistory[i] ) ) -#endif - { - // we do have it, move it to the top of the history - RemoveFileFromHistory (i); - AddFileToHistory (file); - return; - } - } - - // if we already have a full history, delete the one at the end - if ( m_fileMaxFiles == m_fileHistoryN ) - { - RemoveFileFromHistory (m_fileHistoryN - 1); - AddFileToHistory (file); - return; - } - - // Add to the project file history: - // Move existing files (if any) down so we can insert file at beginning. - if (m_fileHistoryN < m_fileMaxFiles) - { - wxList::compatibility_iterator node = m_fileMenus.GetFirst(); - while (node) - { - wxMenu* menu = (wxMenu*) node->GetData(); - if ( m_fileHistoryN == 0 && menu->GetMenuItemCount() ) - { - menu->AppendSeparator(); - } - menu->Append(m_idBase+m_fileHistoryN, _("[EMPTY]")); - node = node->GetNext(); - } - m_fileHistoryN ++; - } - // Shuffle filenames down - for (i = (m_fileHistoryN-1); i > 0; i--) - { - m_fileHistory[i] = m_fileHistory[i-1]; - } - m_fileHistory[0] = MYcopystring(file); - - // this is the directory of the last opened file - wxString pathCurrent; - wxSplitPath( m_fileHistory[0], &pathCurrent, NULL, NULL ); - for (i = 0; i < m_fileHistoryN; i++) - { - if ( m_fileHistory[i] ) - { - // if in same directory just show the filename; otherwise the full - // path - wxString pathInMenu, path, filename, ext; - wxSplitPath( m_fileHistory[i], &path, &filename, &ext ); - if ( path == pathCurrent ) - { - pathInMenu = filename; - if ( !ext.empty() ) - pathInMenu = pathInMenu + wxFILE_SEP_EXT + ext; - } - else - { - // absolute path; could also set relative path - pathInMenu = m_fileHistory[i]; - } - - // we need to quote '&' characters which are used for mnemonics - pathInMenu.Replace(_T("&"), _T("&&")); - wxString buf; - buf.Printf(s_MRUEntryFormat, i + 1, pathInMenu.c_str()); - wxList::compatibility_iterator node = m_fileMenus.GetFirst(); - while (node) - { - wxMenu* menu = (wxMenu*) node->GetData(); - menu->SetLabel(m_idBase + i, buf); - node = node->GetNext(); - } - } - } -} - -void wxFileHistory::RemoveFileFromHistory(size_t i) -{ - wxCHECK_RET( i < m_fileHistoryN, - wxT("invalid index in wxFileHistory::RemoveFileFromHistory") ); - - // delete the element from the array (could use memmove() too...) - delete [] m_fileHistory[i]; - - size_t j; - for ( j = i; j < m_fileHistoryN - 1; j++ ) - { - m_fileHistory[j] = m_fileHistory[j + 1]; - } - - wxList::compatibility_iterator node = m_fileMenus.GetFirst(); - while ( node ) - { - wxMenu* menu = (wxMenu*) node->GetData(); - - // shuffle filenames up - wxString buf; - for ( j = i; j < m_fileHistoryN - 1; j++ ) - { - buf.Printf(s_MRUEntryFormat, j + 1, m_fileHistory[j]); - menu->SetLabel(m_idBase + j, buf); - } - - node = node->GetNext(); - - // delete the last menu item which is unused now - wxWindowID lastItemId = m_idBase + wx_truncate_cast(wxWindowID, m_fileHistoryN) - 1; - if (menu->FindItem(lastItemId)) - { - menu->Delete(lastItemId); - } - - // delete the last separator too if no more files are left - if ( m_fileHistoryN == 1 ) - { - wxMenuItemList::compatibility_iterator nodeLast = menu->GetMenuItems().GetLast(); - if ( nodeLast ) - { - wxMenuItem *menuItem = nodeLast->GetData(); - if ( menuItem->IsSeparator() ) - { - menu->Delete(menuItem); - } - //else: should we search backwards for the last separator? - } - //else: menu is empty somehow - } - } - - m_fileHistoryN--; -} - -wxString wxFileHistory::GetHistoryFile(size_t i) const -{ - wxString s; - if ( i < m_fileHistoryN ) - { - s = m_fileHistory[i]; - } - else - { - wxFAIL_MSG( wxT("bad index in wxFileHistory::GetHistoryFile") ); - } - - return s; -} - -void wxFileHistory::UseMenu(wxMenu *menu) -{ - if (!m_fileMenus.Member(menu)) - m_fileMenus.Append(menu); -} - -void wxFileHistory::RemoveMenu(wxMenu *menu) -{ - m_fileMenus.DeleteObject(menu); -} - -#if wxUSE_CONFIG -void wxFileHistory::Load(wxConfigBase& config) -{ - m_fileHistoryN = 0; - wxString buf; - buf.Printf(wxT("file%d"), (int)m_fileHistoryN+1); - wxString historyFile; - while ((m_fileHistoryN < m_fileMaxFiles) && config.Read(buf, &historyFile) && (!historyFile.empty())) - { - m_fileHistory[m_fileHistoryN] = MYcopystring((const wxChar*) historyFile); - m_fileHistoryN ++; - buf.Printf(wxT("file%d"), (int)m_fileHistoryN+1); - historyFile = wxEmptyString; - } - AddFilesToMenu(); -} - -void wxFileHistory::Save(wxConfigBase& config) -{ - size_t i; - for (i = 0; i < m_fileMaxFiles; i++) - { - wxString buf; - buf.Printf(wxT("file%d"), (int)i+1); - if (i < m_fileHistoryN) - config.Write(buf, wxString(m_fileHistory[i])); - else - config.Write(buf, wxEmptyString); - } -} -#endif // wxUSE_CONFIG - -void wxFileHistory::AddFilesToMenu() -{ - if (m_fileHistoryN > 0) - { - wxList::compatibility_iterator node = m_fileMenus.GetFirst(); - while (node) - { - wxMenu* menu = (wxMenu*) node->GetData(); - if (menu->GetMenuItemCount()) - { - menu->AppendSeparator(); - } - - size_t i; - for (i = 0; i < m_fileHistoryN; i++) - { - if (m_fileHistory[i]) - { - wxString buf; - buf.Printf(s_MRUEntryFormat, i+1, m_fileHistory[i]); - menu->Append(m_idBase+i, buf); - } - } - node = node->GetNext(); - } - } -} - -void wxFileHistory::AddFilesToMenu(wxMenu* menu) -{ - if (m_fileHistoryN > 0) - { - if (menu->GetMenuItemCount()) - { - menu->AppendSeparator(); - } - - size_t i; - for (i = 0; i < m_fileHistoryN; i++) - { - if (m_fileHistory[i]) - { - wxString buf; - buf.Printf(s_MRUEntryFormat, i+1, m_fileHistory[i]); - menu->Append(m_idBase+i, buf); - } - } - } -} - -// ---------------------------------------------------------------------------- -// Permits compatibility with existing file formats and functions that -// manipulate files directly -// ---------------------------------------------------------------------------- - -#if wxUSE_STD_IOSTREAM - -bool wxTransferFileToStream(const wxString& filename, wxSTD ostream& stream) -{ - wxFFile file(filename, _T("rb")); - if ( !file.IsOpened() ) - return false; - - char buf[4096]; - - size_t nRead; - do - { - nRead = file.Read(buf, WXSIZEOF(buf)); - if ( file.Error() ) - return false; - - stream.write(buf, nRead); - if ( !stream ) - return false; - } - while ( !file.Eof() ); - - return true; -} - -bool wxTransferStreamToFile(wxSTD istream& stream, const wxString& filename) -{ - wxFFile file(filename, _T("wb")); - if ( !file.IsOpened() ) - return false; - - char buf[4096]; - do - { - stream.read(buf, WXSIZEOF(buf)); - if ( !stream.bad() ) // fail may be set on EOF, don't use operator!() - { - if ( !file.Write(buf, stream.gcount()) ) - return false; - } - } - while ( !stream.eof() ); - - return true; -} - -#else // !wxUSE_STD_IOSTREAM - -bool wxTransferFileToStream(const wxString& filename, wxOutputStream& stream) -{ - wxFFile file(filename, _T("rb")); - if ( !file.IsOpened() ) - return false; - - char buf[4096]; - - size_t nRead; - do - { - nRead = file.Read(buf, WXSIZEOF(buf)); - if ( file.Error() ) - return false; - - stream.Write(buf, nRead); - if ( !stream ) - return false; - } - while ( !file.Eof() ); - - return true; -} - -bool wxTransferStreamToFile(wxInputStream& stream, const wxString& filename) -{ - wxFFile file(filename, _T("wb")); - if ( !file.IsOpened() ) - return false; - - char buf[4096]; - for ( ;; ) - { - stream.Read(buf, WXSIZEOF(buf)); - - const size_t nRead = stream.LastRead(); - if ( !nRead ) - { - if ( stream.Eof() ) - break; - - return false; - } - - if ( !file.Write(buf, nRead) ) - return false; - } - - return true; -} - -#endif // wxUSE_STD_IOSTREAM/!wxUSE_STD_IOSTREAM - -#endif // wxUSE_DOC_VIEW_ARCHITECTURE diff --git a/wxWidgets/src/common/dpycmn.cpp b/wxWidgets/src/common/dpycmn.cpp deleted file mode 100644 index 4cc0e44352..0000000000 --- a/wxWidgets/src/common/dpycmn.cpp +++ /dev/null @@ -1,269 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: src/common/dpycmn.cpp -// Purpose: wxDisplay and wxDisplayImplSingle implementation -// Author: Vadim Zeitlin -// Modified by: -// Created: 01.03.03 -// RCS-ID: $Id: dpycmn.cpp 41548 2006-10-02 05:38:05Z PC $ -// Copyright: (c) 2003-2006 Vadim Zeitlin -// License: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#ifndef WX_PRECOMP - #include "wx/gdicmn.h" - #include "wx/window.h" - #include "wx/module.h" -#endif //WX_PRECOMP - -#include "wx/display.h" -#include "wx/display_impl.h" - -#if wxUSE_DISPLAY - -#include "wx/arrimpl.cpp" -WX_DEFINE_OBJARRAY(wxArrayVideoModes) - -const wxVideoMode wxDefaultVideoMode; - -#endif // wxUSE_DISPLAY - -// ---------------------------------------------------------------------------- -// globals -// ---------------------------------------------------------------------------- - -// the factory object used by wxDisplay -// -// created on demand and destroyed by wxDisplayModule -static wxDisplayFactory *gs_factory = NULL; - -// ---------------------------------------------------------------------------- -// wxDisplayImplSingle: trivial implementation working for main display only -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxDisplayImplSingle : public wxDisplayImpl -{ -public: - wxDisplayImplSingle() : wxDisplayImpl(0) { } - - virtual wxRect GetGeometry() const - { - wxRect r; - wxDisplaySize(&r.width, &r.height); - return r; - } - - virtual wxRect GetClientArea() const { return wxGetClientDisplayRect(); } - - virtual wxString GetName() const { return wxString(); } - -#if wxUSE_DISPLAY - // no video modes support for us, provide just the stubs - - virtual wxArrayVideoModes GetModes(const wxVideoMode& WXUNUSED(mode)) const - { - return wxArrayVideoModes(); - } - - virtual wxVideoMode GetCurrentMode() const { return wxVideoMode(); } - - virtual bool ChangeMode(const wxVideoMode& WXUNUSED(mode)) { return false; } -#endif // wxUSE_DISPLAY - - - DECLARE_NO_COPY_CLASS(wxDisplayImplSingle) -}; - -// ---------------------------------------------------------------------------- -// wxDisplayModule is used to cleanup gs_factory -// ---------------------------------------------------------------------------- - -class wxDisplayModule : public wxModule -{ -public: - virtual bool OnInit() { return true; } - virtual void OnExit() - { - if ( gs_factory ) - { - delete gs_factory; - gs_factory = NULL; - } - } - - DECLARE_DYNAMIC_CLASS(wxDisplayModule) -}; - -IMPLEMENT_DYNAMIC_CLASS(wxDisplayModule, wxModule) - -// ============================================================================ -// wxDisplay implementation -// ============================================================================ - -// ---------------------------------------------------------------------------- -// ctor/dtor -// ---------------------------------------------------------------------------- - -wxDisplay::wxDisplay(unsigned n) -{ - wxASSERT_MSG( n < GetCount(), - wxT("An invalid index was passed to wxDisplay") ); - - m_impl = Factory().CreateDisplay(n); -} - -wxDisplay::~wxDisplay() -{ - delete m_impl; -} - -// ---------------------------------------------------------------------------- -// static functions forwarded to wxDisplayFactory -// ---------------------------------------------------------------------------- - -/* static */ unsigned wxDisplay::GetCount() -{ - return Factory().GetCount(); -} - -/* static */ int wxDisplay::GetFromPoint(const wxPoint& pt) -{ - return Factory().GetFromPoint(pt); -} - -/* static */ int wxDisplay::GetFromWindow(wxWindow *window) -{ - wxCHECK_MSG( window, wxNOT_FOUND, _T("invalid window") ); - - return Factory().GetFromWindow(window); -} - -// ---------------------------------------------------------------------------- -// functions forwarded to wxDisplayImpl -// ---------------------------------------------------------------------------- - -wxRect wxDisplay::GetGeometry() const -{ - wxCHECK_MSG( IsOk(), wxRect(), _T("invalid wxDisplay object") ); - - return m_impl->GetGeometry(); -} - -wxRect wxDisplay::GetClientArea() const -{ - wxCHECK_MSG( IsOk(), wxRect(), _T("invalid wxDisplay object") ); - - return m_impl->GetClientArea(); -} - -wxString wxDisplay::GetName() const -{ - wxCHECK_MSG( IsOk(), wxString(), _T("invalid wxDisplay object") ); - - return m_impl->GetName(); -} - -bool wxDisplay::IsPrimary() const -{ - return m_impl && m_impl->GetIndex() == 0; -} - -#if wxUSE_DISPLAY - -wxArrayVideoModes wxDisplay::GetModes(const wxVideoMode& mode) const -{ - wxCHECK_MSG( IsOk(), wxArrayVideoModes(), _T("invalid wxDisplay object") ); - - return m_impl->GetModes(mode); -} - -wxVideoMode wxDisplay::GetCurrentMode() const -{ - wxCHECK_MSG( IsOk(), wxVideoMode(), _T("invalid wxDisplay object") ); - - return m_impl->GetCurrentMode(); -} - -bool wxDisplay::ChangeMode(const wxVideoMode& mode) -{ - wxCHECK_MSG( IsOk(), false, _T("invalid wxDisplay object") ); - - return m_impl->ChangeMode(mode); -} - -#endif // wxUSE_DIRECTDRAW - -// ---------------------------------------------------------------------------- -// static functions implementation -// ---------------------------------------------------------------------------- - -// if wxUSE_DISPLAY == 1 this is implemented in port-specific code -#if !wxUSE_DISPLAY - -/* static */ wxDisplayFactory *wxDisplay::CreateFactory() -{ - return new wxDisplayFactorySingle; -} - -#endif // !wxUSE_DISPLAY - -/* static */ wxDisplayFactory& wxDisplay::Factory() -{ - if ( !gs_factory ) - { - gs_factory = CreateFactory(); - } - - return *gs_factory; -} - -// ============================================================================ -// wxDisplayFactory implementation -// ============================================================================ - -int wxDisplayFactory::GetFromWindow(wxWindow *window) -{ - // consider that the window belongs to the display containing its centre - const wxRect r(window->GetRect()); - return GetFromPoint(wxPoint(r.x + r.width/2, r.y + r.height/2)); -} - -// ============================================================================ -// wxDisplayFactorySingle implementation -// ============================================================================ - -/* static */ -wxDisplayImpl *wxDisplayFactorySingle::CreateDisplay(unsigned n) -{ - // we recognize the main display only - return n != 0 ? NULL : new wxDisplayImplSingle; -} - -int wxDisplayFactorySingle::GetFromPoint(const wxPoint& pt) -{ - if ( pt.x >= 0 && pt.y >= 0 ) - { - int w, h; - wxDisplaySize(&w, &h); - - if ( pt.x < w && pt.y < h ) - return 0; - } - - // the point is outside of the screen - return wxNOT_FOUND; -} diff --git a/wxWidgets/src/common/dseldlg.cpp b/wxWidgets/src/common/dseldlg.cpp deleted file mode 100644 index 04944fc65e..0000000000 --- a/wxWidgets/src/common/dseldlg.cpp +++ /dev/null @@ -1,55 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: src/common/dseldlg.cpp -// Purpose: implementation of ::wxDirSelector() -// Author: Paul Thiessen -// Modified by: -// Created: 20.02.01 -// RCS-ID: $Id: dseldlg.cpp 39613 2006-06-07 11:44:19Z ABX $ -// Copyright: (c) 2001 wxWidgets team -// License: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_DIRDLG - -#include "wx/dirdlg.h" - -#ifndef WX_PRECOMP -#endif //WX_PRECOMP - -// ============================================================================ -// implementation -// ============================================================================ - -wxString wxDirSelector(const wxString& message, - const wxString& defaultPath, - long style, - const wxPoint& pos, - wxWindow *parent) -{ - wxString path; - - wxDirDialog dirDialog(parent, message, defaultPath, style, pos); - if ( dirDialog.ShowModal() == wxID_OK ) - { - path = dirDialog.GetPath(); - } - - return path; -} - -#endif // wxUSE_DIRDLG diff --git a/wxWidgets/src/common/dummy.cpp b/wxWidgets/src/common/dummy.cpp deleted file mode 100644 index db74ef7c68..0000000000 --- a/wxWidgets/src/common/dummy.cpp +++ /dev/null @@ -1,32 +0,0 @@ -/* - * File: src/common/dummy.cpp - * Purpose: See below - * Author: Julian Smart - * Created: 1993 - * Updated: - * Copyright: (c) 1993, AIAI, University of Edinburgh - */ - -/* A dummy file to include wx.h. If precompiling wx.h, - * always start by compiling this and producing the PCH file. - * Then subsequent source files use the PCH file. - * - * If precompiling wx.h for wxWidgets and derived apps, - * link dummy.obj with your program. - * - * This will produce a big PCH file. - */ - -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#ifdef __WXMSW__ - #include "wx/msw/msvcrt.h" -#endif - -#ifdef __VISAGECPP__ - char wxDummyChar = 0; -#endif diff --git a/wxWidgets/src/common/dynarray.cpp b/wxWidgets/src/common/dynarray.cpp deleted file mode 100644 index b5f2b4bc7d..0000000000 --- a/wxWidgets/src/common/dynarray.cpp +++ /dev/null @@ -1,527 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: src/common/dynarray.cpp -// Purpose: implementation of wxBaseArray class -// Author: Vadim Zeitlin -// Modified by: -// Created: 12.09.97 -// RCS-ID: $Id: dynarray.cpp 43030 2006-11-04 12:51:01Z VZ $ -// Copyright: (c) 1998 Vadim Zeitlin -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// headers -// ============================================================================ - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#ifndef WX_PRECOMP - #include "wx/dynarray.h" - #include "wx/intl.h" -#endif //WX_PRECOMP - -#include -#include // for memmove - -// we cast the value to long from which we cast it to void * in IndexForInsert: -// this can't work if the pointers are not big enough -wxCOMPILE_TIME_ASSERT( sizeof(wxUIntPtr) <= sizeof(void *), - wxArraySizeOfPtrLessSizeOfLong ); // < 32 symbols - -// ============================================================================ -// constants -// ============================================================================ - -// size increment = max(50% of current size, ARRAY_MAXSIZE_INCREMENT) -#define ARRAY_MAXSIZE_INCREMENT 4096 - -// ============================================================================ -// implementation -// ============================================================================ - -// ---------------------------------------------------------------------------- -// wxBaseArray - dynamic array of 'T's -// ---------------------------------------------------------------------------- - -#define _WX_DEFINE_BASEARRAY_COMMON(T, name) \ -/* searches the array for an item (forward or backwards) */ \ -int name::Index(T lItem, bool bFromEnd) const \ -{ \ - if ( bFromEnd ) { \ - if ( size() > 0 ) { \ - size_t n = size(); \ - do { \ - if ( (*this)[--n] == lItem ) \ - return n; \ - } \ - while ( n != 0 ); \ - } \ - } \ - else { \ - for( size_t n = 0; n < size(); n++ ) { \ - if( (*this)[n] == lItem ) \ - return n; \ - } \ - } \ - \ - return wxNOT_FOUND; \ -} \ - \ -/* add item assuming the array is sorted with fnCompare function */ \ -size_t name::Add(T lItem, CMPFUNC fnCompare) \ -{ \ - size_t idx = IndexForInsert(lItem, fnCompare); \ - Insert(lItem, idx); \ - return idx; \ -} - -#if wxUSE_STL - -#define _WX_DEFINE_BASEARRAY_NOCOMMON(T, name) \ -size_t name::IndexForInsert(T lItem, CMPFUNC fnCompare) const \ -{ \ - Predicate p((SCMPFUNC)fnCompare); \ - const_iterator it = std::lower_bound(begin(), end(), lItem, p); \ - return it - begin(); \ -} \ - \ -int name::Index(T lItem, CMPFUNC fnCompare) const \ -{ \ - Predicate p((SCMPFUNC)fnCompare); \ - const_iterator it = std::lower_bound(begin(), end(), lItem, p); \ - return (it != end() && !p(lItem, *it)) ? \ - (int)(it - begin()) : wxNOT_FOUND; \ -} \ - \ -void name::Shrink() \ -{ \ - name tmp(*this); \ - swap(tmp); \ -} - -#else // if !wxUSE_STL - -#define _WX_DEFINE_BASEARRAY_NOCOMMON(T, name) \ -/* ctor */ \ -name::name() \ -{ \ - m_nSize = \ - m_nCount = 0; \ - m_pItems = (T *)NULL; \ -} \ - \ -/* copy ctor */ \ -name::name(const name& src) \ -{ \ - m_nSize = /* not src.m_nSize to save memory */ \ - m_nCount = src.m_nCount; \ - \ - if ( m_nSize != 0 ) { \ - m_pItems = new T[m_nSize]; \ - /* only copy if allocation succeeded */ \ - if ( m_pItems ) { \ - memcpy(m_pItems, src.m_pItems, m_nCount*sizeof(T)); \ - } \ - else { \ - m_nSize = 0; \ - } \ - } \ - else \ - m_pItems = (T *) NULL; \ -} \ - \ -/* assignment operator */ \ -name& name::operator=(const name& src) \ -{ \ - wxDELETEA(m_pItems); \ - \ - m_nSize = /* not src.m_nSize to save memory */ \ - m_nCount = src.m_nCount; \ - \ - if ( m_nSize != 0 ){ \ - m_pItems = new T[m_nSize]; \ - /* only copy if allocation succeeded */ \ - if ( m_pItems ) { \ - memcpy(m_pItems, src.m_pItems, m_nCount*sizeof(T)); \ - } \ - else { \ - m_nSize = 0; \ - } \ - } \ - else \ - m_pItems = (T *) NULL; \ - \ - return *this; \ -} \ - \ -/* allocate new buffer of the given size and move our data to it */ \ -bool name::Realloc(size_t nSize) \ -{ \ - T *pNew = new T[nSize]; \ - /* only grow if allocation succeeded */ \ - if ( !pNew ) \ - return false; \ - \ - m_nSize = nSize; \ - /* copy data to new location */ \ - memcpy(pNew, m_pItems, m_nCount*sizeof(T)); \ - delete [] m_pItems; \ - m_pItems = pNew; \ - \ - return true; \ -} \ - \ -/* grow the array */ \ -void name::Grow(size_t nIncrement) \ -{ \ - /* only do it if no more place */ \ - if( (m_nCount == m_nSize) || ((m_nSize - m_nCount) < nIncrement) ) { \ - if( m_nSize == 0 ) { \ - /* was empty, determine initial size */ \ - size_t size = WX_ARRAY_DEFAULT_INITIAL_SIZE; \ - if (size < nIncrement) size = nIncrement; \ - /* allocate some memory */ \ - m_pItems = new T[size]; \ - /* only grow if allocation succeeded */ \ - if ( m_pItems ) { \ - m_nSize = size; \ - } \ - } \ - else \ - { \ - /* add at least 50% but not too much */ \ - size_t ndefIncrement = m_nSize < WX_ARRAY_DEFAULT_INITIAL_SIZE \ - ? WX_ARRAY_DEFAULT_INITIAL_SIZE : m_nSize >> 1; \ - if ( ndefIncrement > ARRAY_MAXSIZE_INCREMENT ) \ - ndefIncrement = ARRAY_MAXSIZE_INCREMENT; \ - if ( nIncrement < ndefIncrement ) \ - nIncrement = ndefIncrement; \ - Realloc(m_nSize + nIncrement); \ - } \ - } \ -} \ - \ -/* make sure that the array has at least count elements */ \ -void name::SetCount(size_t count, T defval) \ -{ \ - if ( m_nSize < count ) \ - { \ - /* need to realloc memory: don't overallocate it here as if */ \ - /* SetCount() is called, it probably means that the caller */ \ - /* knows in advance how many elements there will be in the */ \ - /* array and so it won't be necessary to realloc it later */ \ - if ( !Realloc(count) ) \ - { \ - /* out of memory -- what can we do? */ \ - return; \ - } \ - } \ - \ - /* add new elements if we extend the array */ \ - while ( m_nCount < count ) \ - { \ - m_pItems[m_nCount++] = defval; \ - } \ -} \ - \ -/* dtor */ \ -name::~name() \ -{ \ - wxDELETEA(m_pItems); \ -} \ - \ -/* clears the list */ \ -void name::Clear() \ -{ \ - m_nSize = \ - m_nCount = 0; \ - \ - wxDELETEA(m_pItems); \ -} \ - \ -/* minimizes the memory usage by freeing unused memory */ \ -void name::Shrink() \ -{ \ - /* only do it if we have some memory to free */ \ - if( m_nCount < m_nSize ) { \ - /* allocates exactly as much memory as we need */ \ - T *pNew = new T[m_nCount]; \ - /* only shrink if allocation succeeded */ \ - if ( pNew ) { \ - /* copy data to new location */ \ - memcpy(pNew, m_pItems, m_nCount*sizeof(T)); \ - delete [] m_pItems; \ - m_pItems = pNew; \ - \ - /* update the size of the new block */ \ - m_nSize = m_nCount; \ - } \ - /* else: don't do anything, better keep old memory block! */ \ - } \ -} \ - \ -/* add item at the end */ \ -void name::Add(T lItem, size_t nInsert) \ -{ \ - if (nInsert == 0) \ - return; \ - Grow(nInsert); \ - for (size_t i = 0; i < nInsert; i++) \ - m_pItems[m_nCount++] = lItem; \ -} \ - \ -/* add item at the given position */ \ -void name::Insert(T lItem, size_t nIndex, size_t nInsert) \ -{ \ - wxCHECK_RET( nIndex <= m_nCount, wxT("bad index in wxArray::Insert") ); \ - wxCHECK_RET( m_nCount <= m_nCount + nInsert, \ - wxT("array size overflow in wxArray::Insert") ); \ - \ - if (nInsert == 0) \ - return; \ - Grow(nInsert); \ - \ - memmove(&m_pItems[nIndex + nInsert], &m_pItems[nIndex], \ - (m_nCount - nIndex)*sizeof(T)); \ - for (size_t i = 0; i < nInsert; i++) \ - m_pItems[nIndex + i] = lItem; \ - m_nCount += nInsert; \ -} \ - \ -/* search for a place to insert item into sorted array (binary search) */ \ -size_t name::IndexForInsert(T lItem, CMPFUNC fnCompare) const \ -{ \ - size_t i, \ - lo = 0, \ - hi = m_nCount; \ - int res; \ - \ - while ( lo < hi ) { \ - i = (lo + hi)/2; \ - \ - res = (*fnCompare)((const void *)(wxUIntPtr)lItem, \ - (const void *)(wxUIntPtr)(m_pItems[i])); \ - if ( res < 0 ) \ - hi = i; \ - else if ( res > 0 ) \ - lo = i + 1; \ - else { \ - lo = i; \ - break; \ - } \ - } \ - \ - return lo; \ -} \ - \ -/* search for an item in a sorted array (binary search) */ \ -int name::Index(T lItem, CMPFUNC fnCompare) const \ -{ \ - size_t n = IndexForInsert(lItem, fnCompare); \ - \ - return (n >= m_nCount || \ - (*fnCompare)((const void *)(wxUIntPtr)lItem, \ - ((const void *)(wxUIntPtr)m_pItems[n]))) \ - ? wxNOT_FOUND \ - : (int)n; \ -} \ - \ -/* removes item from array (by index) */ \ -void name::RemoveAt(size_t nIndex, size_t nRemove) \ -{ \ - wxCHECK_RET( nIndex < m_nCount, wxT("bad index in wxArray::RemoveAt") ); \ - wxCHECK_RET( nIndex + nRemove <= m_nCount, \ - wxT("removing too many elements in wxArray::RemoveAt") ); \ - \ - memmove(&m_pItems[nIndex], &m_pItems[nIndex + nRemove], \ - (m_nCount - nIndex - nRemove)*sizeof(T)); \ - m_nCount -= nRemove; \ -} \ - \ -/* removes item from array (by value) */ \ -void name::Remove(T lItem) \ -{ \ - int iIndex = Index(lItem); \ - \ - wxCHECK_RET( iIndex != wxNOT_FOUND, \ - wxT("removing inexistent item in wxArray::Remove") ); \ - \ - RemoveAt((size_t)iIndex); \ -} \ - \ -/* sort array elements using passed comparaison function */ \ -void name::Sort(CMPFUNC fCmp) \ -{ \ - qsort(m_pItems, m_nCount, sizeof(T), fCmp); \ -} \ - \ -void name::assign(const_iterator first, const_iterator last) \ -{ \ - clear(); \ - reserve(last - first); \ - for(; first != last; ++first) \ - push_back(*first); \ -} \ - \ -void name::assign(size_type n, const_reference v) \ -{ \ - clear(); \ - reserve(n); \ - for( size_type i = 0; i < n; ++i ) \ - push_back(v); \ -} \ - \ -void name::insert(iterator it, const_iterator first, const_iterator last) \ -{ \ - size_t nInsert = last - first, nIndex = it - begin(); \ - if (nInsert == 0) \ - return; \ - Grow(nInsert); \ - \ - memmove(&m_pItems[nIndex + nInsert], &m_pItems[nIndex], \ - (m_nCount - nIndex)*sizeof(T)); \ - for (size_t i = 0; i < nInsert; ++i, ++it, ++first) \ - *it = *first; \ - m_nCount += nInsert; \ -} - -#endif - -#define _WX_DEFINE_BASEARRAY(T, name) \ - _WX_DEFINE_BASEARRAY_COMMON(T, name) \ - _WX_DEFINE_BASEARRAY_NOCOMMON(T, name) - -#ifdef __INTELC__ - #pragma warning(push) - #pragma warning(disable: 1684) - #pragma warning(disable: 1572) -#endif - -_WX_DEFINE_BASEARRAY(const void *, wxBaseArrayPtrVoid) -_WX_DEFINE_BASEARRAY(char, wxBaseArrayChar) -_WX_DEFINE_BASEARRAY(short, wxBaseArrayShort) -_WX_DEFINE_BASEARRAY(int, wxBaseArrayInt) -_WX_DEFINE_BASEARRAY(long, wxBaseArrayLong) -_WX_DEFINE_BASEARRAY(size_t, wxBaseArraySizeT) -_WX_DEFINE_BASEARRAY(double, wxBaseArrayDouble) - -#ifdef __INTELC__ - #pragma warning(pop) -#endif - -#if wxUSE_STL -#include "wx/arrstr.h" - -#include "wx/beforestd.h" -#include -#include "wx/afterstd.h" - -_WX_DEFINE_BASEARRAY(wxString, wxBaseArrayStringBase) - -// some compilers (Sun CC being the only known example) distinguish between -// extern "C" functions and the functions with C++ linkage and ptr_fun and -// wxStringCompareLess can't take wxStrcmp/wxStricmp directly as arguments in -// this case, we need the wrappers below to make this work -inline int wxStrcmpCppWrapper(const wxChar *p, const wxChar *q) -{ - return wxStrcmp(p, q); -} - -inline int wxStricmpCppWrapper(const wxChar *p, const wxChar *q) -{ - return wxStricmp(p, q); -} - -int wxArrayString::Index(const wxChar* sz, bool bCase, bool WXUNUSED(bFromEnd)) const -{ - wxArrayString::const_iterator it; - - if (bCase) - { - it = std::find_if(begin(), end(), - std::not1( - std::bind2nd( - std::ptr_fun(wxStrcmpCppWrapper), sz))); - } - else // !bCase - { - it = std::find_if(begin(), end(), - std::not1( - std::bind2nd( - std::ptr_fun(wxStricmpCppWrapper), sz))); - } - - return it == end() ? wxNOT_FOUND : it - begin(); -} - -template -class wxStringCompareLess -{ -public: - wxStringCompareLess(F f) : m_f(f) { } - bool operator()(const wxChar* s1, const wxChar* s2) - { return m_f(s1, s2) < 0; } - bool operator()(const wxString& s1, const wxString& s2) - { return m_f(s1, s2) < 0; } -private: - F m_f; -}; - -template -wxStringCompareLess wxStringCompare(F f) -{ - return wxStringCompareLess(f); -} - -void wxArrayString::Sort(CompareFunction function) -{ - std::sort(begin(), end(), wxStringCompare(function)); -} - -void wxArrayString::Sort(bool reverseOrder) -{ - if (reverseOrder) - { - std::sort(begin(), end(), std::greater()); - } - else - { - std::sort(begin(), end()); - } -} - -int wxSortedArrayString::Index(const wxChar* sz, bool bCase, bool WXUNUSED(bFromEnd)) const -{ - wxSortedArrayString::const_iterator it; - wxString s(sz); - - if (bCase) - it = std::lower_bound(begin(), end(), s, - wxStringCompare(wxStrcmpCppWrapper)); - else - it = std::lower_bound(begin(), end(), s, - wxStringCompare(wxStricmpCppWrapper)); - - if (it == end()) - return wxNOT_FOUND; - - if (bCase) - { - if (wxStrcmp(it->c_str(), sz) != 0) - return wxNOT_FOUND; - } - else - { - if (wxStricmp(it->c_str(), sz) != 0) - return wxNOT_FOUND; - } - - return it - begin(); -} - -#endif diff --git a/wxWidgets/src/common/dynlib.cpp b/wxWidgets/src/common/dynlib.cpp deleted file mode 100644 index a2db5e3bab..0000000000 --- a/wxWidgets/src/common/dynlib.cpp +++ /dev/null @@ -1,323 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/common/dynlib.cpp -// Purpose: Dynamic library management -// Author: Guilhem Lavaux -// Modified by: -// Created: 20/07/98 -// RCS-ID: $Id: dynlib.cpp 41807 2006-10-09 15:58:56Z VZ $ -// Copyright: (c) 1998 Guilhem Lavaux -// 2000-2005 Vadim Zeitlin -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -//FIXME: This class isn't really common at all, it should be moved into -// platform dependent files (already done for Windows and Unix) - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_DYNLIB_CLASS - -#include "wx/dynlib.h" - -#ifndef WX_PRECOMP - #include "wx/intl.h" - #include "wx/log.h" - #include "wx/app.h" - #include "wx/utils.h" -#endif //WX_PRECOMP - -#include "wx/filefn.h" -#include "wx/filename.h" // for SplitPath() -#include "wx/platinfo.h" - -#include "wx/arrimpl.cpp" - -#if defined(__WXMAC__) - #include "wx/mac/private.h" -#endif - -WX_DEFINE_USER_EXPORTED_OBJARRAY(wxDynamicLibraryDetailsArray) - -// ============================================================================ -// implementation -// ============================================================================ - -// --------------------------------------------------------------------------- -// wxDynamicLibrary -// --------------------------------------------------------------------------- - -#if defined(__WXPM__) || defined(__EMX__) - const wxChar *wxDynamicLibrary::ms_dllext = _T(".dll"); -#elif defined(__WXMAC__) && !defined(__DARWIN__) - const wxChar *wxDynamicLibrary::ms_dllext = wxEmptyString; -#endif - -// for MSW/Unix it is defined in platform-specific file -#if !(defined(__WXMSW__) || defined(__UNIX__)) || defined(__EMX__) - -wxDllType wxDynamicLibrary::GetProgramHandle() -{ - wxFAIL_MSG( wxT("GetProgramHandle() is not implemented under this platform")); - return 0; -} - -#endif // __WXMSW__ || __UNIX__ - - -bool wxDynamicLibrary::Load(const wxString& libnameOrig, int flags) -{ - wxASSERT_MSG(m_handle == 0, _T("Library already loaded.")); - - // add the proper extension for the DLL ourselves unless told not to - wxString libname = libnameOrig; - if ( !(flags & wxDL_VERBATIM) ) - { - // and also check that the libname doesn't already have it - wxString ext; - wxFileName::SplitPath(libname, NULL, NULL, &ext); - if ( ext.empty() ) - { - libname += GetDllExt(); - } - } - - // different ways to load a shared library - // - // FIXME: should go to the platform-specific files! -#if defined(__WXMAC__) && !defined(__DARWIN__) - FSSpec myFSSpec; - Ptr myMainAddr; - Str255 myErrName; - - wxMacFilename2FSSpec( libname , &myFSSpec ); - - if( GetDiskFragment( &myFSSpec, - 0, - kCFragGoesToEOF, - "\p", - kPrivateCFragCopy, - &m_handle, - &myMainAddr, - myErrName ) != noErr ) - { - wxLogSysError( _("Failed to load shared library '%s' Error '%s'"), - libname.c_str(), - wxMacMakeStringFromPascal( myErrName ).c_str() ); - m_handle = 0; - } - -#elif defined(__WXPM__) || defined(__EMX__) - char err[256] = ""; - DosLoadModule(err, sizeof(err), (PSZ)libname.c_str(), &m_handle); -#else // this should be the only remaining branch eventually - m_handle = RawLoad(libname, flags); -#endif - - if ( m_handle == 0 ) - { -#ifdef wxHAVE_DYNLIB_ERROR - Error(); -#else - wxLogSysError(_("Failed to load shared library '%s'"), libname.c_str()); -#endif - } - - return IsLoaded(); -} - -// for MSW and Unix this is implemented in the platform-specific file -// -// TODO: move the rest to os2/dlpm.cpp and mac/dlmac.cpp! -#if (!defined(__WXMSW__) && !defined(__UNIX__)) || defined(__EMX__) - -/* static */ -void wxDynamicLibrary::Unload(wxDllType handle) -{ -#if defined(__OS2__) || defined(__EMX__) - DosFreeModule( handle ); -#elif defined(__WXMAC__) && !defined(__DARWIN__) - CloseConnection( (CFragConnectionID*) &handle ); -#else - #error "runtime shared lib support not implemented" -#endif -} - -#endif // !(__WXMSW__ || __UNIX__) - -void *wxDynamicLibrary::DoGetSymbol(const wxString &name, bool *success) const -{ - wxCHECK_MSG( IsLoaded(), NULL, - _T("Can't load symbol from unloaded library") ); - - void *symbol = 0; - - wxUnusedVar(symbol); -#if defined(__WXMAC__) && !defined(__DARWIN__) - Ptr symAddress; - CFragSymbolClass symClass; - Str255 symName; -#if TARGET_CARBON - c2pstrcpy( (StringPtr) symName, name.fn_str() ); -#else - strcpy( (char *)symName, name.fn_str() ); - c2pstr( (char *)symName ); -#endif - if( FindSymbol( m_handle, symName, &symAddress, &symClass ) == noErr ) - symbol = (void *)symAddress; -#elif defined(__WXPM__) || defined(__EMX__) - DosQueryProcAddr( m_handle, 1L, (PSZ)name.c_str(), (PFN*)symbol ); -#else - symbol = RawGetSymbol(m_handle, name); -#endif - - if ( success ) - *success = symbol != NULL; - - return symbol; -} - -void *wxDynamicLibrary::GetSymbol(const wxString& name, bool *success) const -{ - void *symbol = DoGetSymbol(name, success); - if ( !symbol ) - { -#ifdef wxHAVE_DYNLIB_ERROR - Error(); -#else - wxLogSysError(_("Couldn't find symbol '%s' in a dynamic library"), - name.c_str()); -#endif - } - - return symbol; -} - -// ---------------------------------------------------------------------------- -// informational methods -// ---------------------------------------------------------------------------- - -/*static*/ -wxString -wxDynamicLibrary::CanonicalizeName(const wxString& name, - wxDynamicLibraryCategory cat) -{ - wxString nameCanonic; - - // under Unix the library names usually start with "lib" prefix, add it -#if defined(__UNIX__) && !defined(__EMX__) - switch ( cat ) - { - default: - wxFAIL_MSG( _T("unknown wxDynamicLibraryCategory value") ); - // fall through - - case wxDL_MODULE: - // don't do anything for modules, their names are arbitrary - break; - - case wxDL_LIBRARY: - // library names should start with "lib" under Unix - nameCanonic = _T("lib"); - break; - } -#else // !__UNIX__ - wxUnusedVar(cat); -#endif // __UNIX__/!__UNIX__ - - nameCanonic << name << GetDllExt(); - return nameCanonic; -} - -/*static*/ -wxString wxDynamicLibrary::CanonicalizePluginName(const wxString& name, - wxPluginCategory cat) -{ - wxString suffix; - if ( cat == wxDL_PLUGIN_GUI ) - { - suffix = wxPlatformInfo::Get().GetPortIdShortName(); - } -#if wxUSE_UNICODE - suffix << _T('u'); -#endif -#ifdef __WXDEBUG__ - suffix << _T('d'); -#endif - - if ( !suffix.empty() ) - suffix = wxString(_T("_")) + suffix; - -#define WXSTRINGIZE(x) #x -#if defined(__UNIX__) && !defined(__EMX__) - #if (wxMINOR_VERSION % 2) == 0 - #define wxDLLVER(x,y,z) "-" WXSTRINGIZE(x) "." WXSTRINGIZE(y) - #else - #define wxDLLVER(x,y,z) "-" WXSTRINGIZE(x) "." WXSTRINGIZE(y) "." WXSTRINGIZE(z) - #endif -#else - #if (wxMINOR_VERSION % 2) == 0 - #define wxDLLVER(x,y,z) WXSTRINGIZE(x) WXSTRINGIZE(y) - #else - #define wxDLLVER(x,y,z) WXSTRINGIZE(x) WXSTRINGIZE(y) WXSTRINGIZE(z) - #endif -#endif - - suffix << wxString::FromAscii(wxDLLVER(wxMAJOR_VERSION, wxMINOR_VERSION, - wxRELEASE_NUMBER)); -#undef wxDLLVER -#undef WXSTRINGIZE - -#ifdef __WINDOWS__ - // Add compiler identification: - #if defined(__GNUG__) - suffix << _T("_gcc"); - #elif defined(__VISUALC__) - suffix << _T("_vc"); - #elif defined(__WATCOMC__) - suffix << _T("_wat"); - #elif defined(__BORLANDC__) - suffix << _T("_bcc"); - #endif -#endif - - return CanonicalizeName(name + suffix, wxDL_MODULE); -} - -/*static*/ -wxString wxDynamicLibrary::GetPluginsDirectory() -{ -#ifdef __UNIX__ - wxString format = wxGetInstallPrefix(); - wxString dir; - format << wxFILE_SEP_PATH - << wxT("lib") << wxFILE_SEP_PATH - << wxT("wx") << wxFILE_SEP_PATH -#if (wxMINOR_VERSION % 2) == 0 - << wxT("%i.%i"); - dir.Printf(format.c_str(), wxMAJOR_VERSION, wxMINOR_VERSION); -#else - << wxT("%i.%i.%i"); - dir.Printf(format.c_str(), - wxMAJOR_VERSION, wxMINOR_VERSION, wxRELEASE_NUMBER); -#endif - return dir; - -#else // ! __UNIX__ - return wxEmptyString; -#endif -} - - -#endif // wxUSE_DYNLIB_CLASS diff --git a/wxWidgets/src/common/dynload.cpp b/wxWidgets/src/common/dynload.cpp deleted file mode 100644 index a28b9e5289..0000000000 --- a/wxWidgets/src/common/dynload.cpp +++ /dev/null @@ -1,362 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/common/dynload.cpp -// Purpose: Dynamic loading framework -// Author: Ron Lee, David Falkinder, Vadim Zeitlin and a cast of 1000's -// (derived in part from dynlib.cpp (c) 1998 Guilhem Lavaux) -// Modified by: -// Created: 03/12/01 -// RCS-ID: $Id: dynload.cpp 40943 2006-08-31 19:31:43Z ABX $ -// Copyright: (c) 2001 Ron Lee -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_DYNAMIC_LOADER - -#ifdef __WINDOWS__ - #include "wx/msw/private.h" -#endif - -#ifndef WX_PRECOMP - #include "wx/log.h" - #include "wx/intl.h" - #include "wx/hash.h" - #include "wx/utils.h" - #include "wx/module.h" -#endif - -#include "wx/strconv.h" - -#include "wx/dynload.h" - - -// --------------------------------------------------------------------------- -// wxPluginLibrary -// --------------------------------------------------------------------------- - - -wxDLImports* wxPluginLibrary::ms_classes = NULL; - -class wxPluginLibraryModule : public wxModule -{ -public: - wxPluginLibraryModule() { } - - // TODO: create ms_classes on demand, why always preallocate it? - virtual bool OnInit() - { - wxPluginLibrary::ms_classes = new wxDLImports; - wxPluginManager::CreateManifest(); - return true; - } - - virtual void OnExit() - { - delete wxPluginLibrary::ms_classes; - wxPluginLibrary::ms_classes = NULL; - wxPluginManager::ClearManifest(); - } - -private: - DECLARE_DYNAMIC_CLASS(wxPluginLibraryModule ) -}; - -IMPLEMENT_DYNAMIC_CLASS(wxPluginLibraryModule, wxModule) - - -wxPluginLibrary::wxPluginLibrary(const wxString &libname, int flags) - : m_linkcount(1) - , m_objcount(0) -{ - m_before = wxClassInfo::sm_first; - Load( libname, flags ); - m_after = wxClassInfo::sm_first; - - if( m_handle != 0 ) - { - UpdateClasses(); - RegisterModules(); - } - else - { - // Flag us for deletion - --m_linkcount; - } -} - -wxPluginLibrary::~wxPluginLibrary() -{ - if( m_handle != 0 ) - { - UnregisterModules(); - RestoreClasses(); - } -} - -wxPluginLibrary *wxPluginLibrary::RefLib() -{ - wxCHECK_MSG( m_linkcount > 0, NULL, - _T("Library had been already deleted!") ); - - ++m_linkcount; - return this; -} - -bool wxPluginLibrary::UnrefLib() -{ - wxASSERT_MSG( m_objcount == 0, - _T("Library unloaded before all objects were destroyed") ); - - if ( m_linkcount == 0 || --m_linkcount == 0 ) - { - delete this; - return true; - } - - return false; -} - -// ------------------------ -// Private methods -// ------------------------ - -void wxPluginLibrary::UpdateClasses() -{ - for (wxClassInfo *info = m_after; info != m_before; info = info->m_next) - { - if( info->GetClassName() ) - { - // Hash all the class names into a local table too so - // we can quickly find the entry they correspond to. - (*ms_classes)[info->GetClassName()] = this; - } - } -} - -void wxPluginLibrary::RestoreClasses() -{ - // Check if there is a need to restore classes. - if (!ms_classes) - return; - - for(wxClassInfo *info = m_after; info != m_before; info = info->m_next) - { - ms_classes->erase(ms_classes->find(info->GetClassName())); - } -} - -void wxPluginLibrary::RegisterModules() -{ - // Plugin libraries might have wxModules, Register and initialise them if - // they do. - // - // Note that these classes are NOT included in the reference counting since - // it's implicit that they will be unloaded if and when the last handle to - // the library is. We do have to keep a copy of the module's pointer - // though, as there is currently no way to Unregister it without it. - - wxASSERT_MSG( m_linkcount == 1, - _T("RegisterModules should only be called for the first load") ); - - for ( wxClassInfo *info = m_after; info != m_before; info = info->m_next) - { - if( info->IsKindOf(CLASSINFO(wxModule)) ) - { - wxModule *m = wxDynamicCast(info->CreateObject(), wxModule); - - wxASSERT_MSG( m, _T("wxDynamicCast of wxModule failed") ); - - m_wxmodules.push_back(m); - wxModule::RegisterModule(m); - } - } - - // FIXME: Likewise this is (well was) very similar to InitializeModules() - - for ( wxModuleList::iterator it = m_wxmodules.begin(); - it != m_wxmodules.end(); - ++it) - { - if( !(*it)->Init() ) - { - wxLogDebug(_T("wxModule::Init() failed for wxPluginLibrary")); - - // XXX: Watch this, a different hash implementation might break it, - // a good hash implementation would let us fix it though. - - // The name of the game is to remove any uninitialised modules and - // let the dtor Exit the rest on shutdown, (which we'll initiate - // shortly). - - wxModuleList::iterator oldNode = m_wxmodules.end(); - do { - ++it; - if( oldNode != m_wxmodules.end() ) - m_wxmodules.erase(oldNode); - wxModule::UnregisterModule( *it ); - oldNode = it; - } while( it != m_wxmodules.end() ); - - --m_linkcount; // Flag us for deletion - break; - } - } -} - -void wxPluginLibrary::UnregisterModules() -{ - wxModuleList::iterator it; - - for ( it = m_wxmodules.begin(); it != m_wxmodules.end(); ++it ) - (*it)->Exit(); - - for ( it = m_wxmodules.begin(); it != m_wxmodules.end(); ++it ) - wxModule::UnregisterModule( *it ); - - // NB: content of the list was deleted by UnregisterModule calls above: - m_wxmodules.clear(); -} - - -// --------------------------------------------------------------------------- -// wxPluginManager -// --------------------------------------------------------------------------- - -wxDLManifest* wxPluginManager::ms_manifest = NULL; - -// ------------------------ -// Static accessors -// ------------------------ - -wxPluginLibrary * -wxPluginManager::LoadLibrary(const wxString &libname, int flags) -{ - wxString realname(libname); - - if( !(flags & wxDL_VERBATIM) ) - realname += wxDynamicLibrary::GetDllExt(); - - wxPluginLibrary *entry; - - if ( flags & wxDL_NOSHARE ) - { - entry = NULL; - } - else - { - entry = FindByName(realname); - } - - if ( entry ) - { - wxLogTrace(_T("dll"), - _T("LoadLibrary(%s): already loaded."), realname.c_str()); - - entry->RefLib(); - } - else - { - entry = new wxPluginLibrary( libname, flags ); - - if ( entry->IsLoaded() ) - { - (*ms_manifest)[realname] = entry; - - wxLogTrace(_T("dll"), - _T("LoadLibrary(%s): loaded ok."), realname.c_str()); - - } - else - { - wxLogTrace(_T("dll"), - _T("LoadLibrary(%s): failed to load."), realname.c_str()); - - // we have created entry just above - if ( !entry->UnrefLib() ) - { - // ... so UnrefLib() is supposed to delete it - wxFAIL_MSG( _T("Currently linked library is not loaded?") ); - } - - entry = NULL; - } - } - - return entry; -} - -bool wxPluginManager::UnloadLibrary(const wxString& libname) -{ - wxString realname = libname; - - wxPluginLibrary *entry = FindByName(realname); - - if ( !entry ) - { - realname += wxDynamicLibrary::GetDllExt(); - - entry = FindByName(realname); - } - - if ( !entry ) - { - wxLogDebug(_T("Attempt to unload library '%s' which is not loaded."), - libname.c_str()); - - return false; - } - - wxLogTrace(_T("dll"), _T("UnloadLibrary(%s)"), realname.c_str()); - - if ( !entry->UnrefLib() ) - { - // not really unloaded yet - return false; - } - - ms_manifest->erase(ms_manifest->find(realname)); - - return true; -} - -// ------------------------ -// Class implementation -// ------------------------ - -bool wxPluginManager::Load(const wxString &libname, int flags) -{ - m_entry = wxPluginManager::LoadLibrary(libname, flags); - - return IsLoaded(); -} - -void wxPluginManager::Unload() -{ - wxCHECK_RET( m_entry, _T("unloading an invalid wxPluginManager?") ); - - for ( wxDLManifest::iterator i = ms_manifest->begin(); - i != ms_manifest->end(); - ++i ) - { - if ( i->second == m_entry ) - { - ms_manifest->erase(i); - break; - } - } - - m_entry->UnrefLib(); - - m_entry = NULL; -} - -#endif // wxUSE_DYNAMIC_LOADER diff --git a/wxWidgets/src/common/effects.cpp b/wxWidgets/src/common/effects.cpp deleted file mode 100644 index dc1ab01e5c..0000000000 --- a/wxWidgets/src/common/effects.cpp +++ /dev/null @@ -1,124 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/common/effects.cpp -// Purpose: wxEffects implementation -// Author: Julian Smart -// Modified by: -// Created: 25/4/2000 -// RCS-ID: $Id: effects.cpp 42755 2006-10-30 19:41:46Z VZ $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#include "wx/effects.h" - -#ifndef WX_PRECOMP - #include "wx/dcmemory.h" - #include "wx/pen.h" - #include "wx/settings.h" - #include "wx/gdicmn.h" -#endif //WX_PRECOMP - -/* - * wxEffects: various 3D effects - */ - -IMPLEMENT_CLASS(wxEffects, wxObject) - -// Assume system colours -wxEffects::wxEffects() -{ - m_highlightColour = wxSystemSettings::GetColour(wxSYS_COLOUR_3DHILIGHT) ; - m_lightShadow = wxSystemSettings::GetColour(wxSYS_COLOUR_3DLIGHT) ; - m_faceColour = wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE) ; - m_mediumShadow = wxSystemSettings::GetColour(wxSYS_COLOUR_3DSHADOW) ; - m_darkShadow = wxSystemSettings::GetColour(wxSYS_COLOUR_3DDKSHADOW) ; -} - -// Going from lightest to darkest -wxEffects::wxEffects(const wxColour& highlightColour, const wxColour& lightShadow, - const wxColour& faceColour, const wxColour& mediumShadow, const wxColour& darkShadow) -{ - m_highlightColour = highlightColour; - m_lightShadow = lightShadow; - m_faceColour = faceColour; - m_mediumShadow = mediumShadow; - m_darkShadow = darkShadow; -} - -// Draw a sunken edge -void wxEffects::DrawSunkenEdge(wxDC& dc, const wxRect& rect, int WXUNUSED(borderSize)) -{ - wxPen highlightPen(m_highlightColour, 1, wxSOLID); - wxPen lightShadowPen(m_lightShadow, 1, wxSOLID); - wxPen facePen(m_faceColour, 1, wxSOLID); - wxPen mediumShadowPen(m_mediumShadow, 1, wxSOLID); - wxPen darkShadowPen(m_darkShadow, 1, wxSOLID); - - //// LEFT AND TOP - // Draw a medium shadow pen on left and top, followed by dark shadow line to - // right and below of these lines - - dc.SetPen(mediumShadowPen); - dc.DrawLine(rect.x, rect.y, rect.x+rect.width-1, rect.y); // Top - dc.DrawLine(rect.x, rect.y, rect.x, rect.y+rect.height-1); // Left - - dc.SetPen(darkShadowPen); - dc.DrawLine(rect.x+1, rect.y+1, rect.x+rect.width-2, rect.y+1); // Top - dc.DrawLine(rect.x+1, rect.y+1, rect.x+1, rect.y+rect.height-1); // Left - - //// RIGHT AND BOTTOM - - dc.SetPen(highlightPen); - dc.DrawLine(rect.x+rect.width-1, rect.y, rect.x+rect.width-1, rect.y+rect.height-1); // Right - dc.DrawLine(rect.x, rect.y+rect.height-1, rect.x+rect.width, rect.y+rect.height-1); // Bottom - - dc.SetPen(lightShadowPen); - dc.DrawLine(rect.x+rect.width-2, rect.y+1, rect.x+rect.width-2, rect.y+rect.height-2); // Right - dc.DrawLine(rect.x+1, rect.y+rect.height-2, rect.x+rect.width-1, rect.y+rect.height-2); // Bottom - - dc.SetPen(wxNullPen); -} - -bool wxEffects::TileBitmap(const wxRect& rect, wxDC& dc, const wxBitmap& bitmap) -{ - int w = bitmap.GetWidth(); - int h = bitmap.GetHeight(); - - wxMemoryDC dcMem; - -#if wxUSE_PALETTE - static bool hiColour = (wxDisplayDepth() >= 16) ; - if (bitmap.GetPalette() && !hiColour) - { - dc.SetPalette(* bitmap.GetPalette()); - dcMem.SetPalette(* bitmap.GetPalette()); - } -#endif // wxUSE_PALETTE - - dcMem.SelectObjectAsSource(bitmap); - - int i, j; - for (i = rect.x; i < rect.x + rect.width; i += w) - { - for (j = rect.y; j < rect.y + rect.height; j+= h) - dc.Blit(i, j, bitmap.GetWidth(), bitmap.GetHeight(), & dcMem, 0, 0); - } - dcMem.SelectObject(wxNullBitmap); - -#if wxUSE_PALETTE - if (bitmap.GetPalette() && !hiColour) - { - dc.SetPalette(wxNullPalette); - dcMem.SetPalette(wxNullPalette); - } -#endif // wxUSE_PALETTE - - return true; -} diff --git a/wxWidgets/src/common/emptydmy.cpp b/wxWidgets/src/common/emptydmy.cpp deleted file mode 100644 index 4c2b115372..0000000000 --- a/wxWidgets/src/common/emptydmy.cpp +++ /dev/null @@ -1,3 +0,0 @@ -// This file exists so that it can be compiled into an object so the linker -// will have something to chew on so that builds don't break when a platform -// lacks any objects in a particular multilib. diff --git a/wxWidgets/src/common/encconv.cpp b/wxWidgets/src/common/encconv.cpp deleted file mode 100644 index 15509c9cbc..0000000000 --- a/wxWidgets/src/common/encconv.cpp +++ /dev/null @@ -1,531 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: encconv.cpp -// Purpose: wxEncodingConverter class for converting between different -// font encodings -// Author: Vaclav Slavik -// Copyright: (c) 1999 Vaclav Slavik -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#include "wx/encconv.h" - -#include - -// conversion tables, generated by scripts in $(WXWIN)/misc/unictabl: -#if defined( __BORLANDC__ ) || defined(__DARWIN__) - #include "../common/unictabl.inc" -#else - #include "unictabl.inc" -#endif - -#if wxUSE_WCHAR_T - typedef wchar_t tchar; -#else - typedef char tchar; -#endif - -#ifdef __WXMAC__ -#ifdef __DARWIN__ -#include -#else -#include -#include -#include -#endif - #include "wx/fontutil.h" - #include "wx/mac/private.h" // includes mac headers - - wxUint16 gMacEncodings[wxFONTENCODING_MACMAX-wxFONTENCODING_MACMIN+1][128] ; - bool gMacEncodingsInited[wxFONTENCODING_MACMAX-wxFONTENCODING_MACMIN+1] ; -#endif - -#ifdef __WXWINCE__ - #include "wx/msw/wince/missing.h" // for bsearch() -#endif - -static const wxUint16* GetEncTable(wxFontEncoding enc) -{ -#ifdef __WXMAC__ - if( enc >= wxFONTENCODING_MACMIN && enc <= wxFONTENCODING_MACMAX ) - { - int i = enc-wxFONTENCODING_MACMIN ; - if ( gMacEncodingsInited[i] == false ) - { - TECObjectRef converter ; - TextEncodingBase code = wxMacGetSystemEncFromFontEnc( enc ) ; - TextEncodingBase unicode = CreateTextEncoding(kTextEncodingUnicodeDefault,0,kUnicode16BitFormat) ; - OSStatus status = TECCreateConverter(&converter,code,unicode); - char s[2] ; - s[1] = 0 ; - ByteCount byteInLen, byteOutLen ; - for( unsigned char c = 255 ; c >= 128 ; --c ) - { - s[0] = c ; - status = TECConvertText(converter, (ConstTextPtr) &s , 1, &byteInLen, - (TextPtr) &gMacEncodings[i][c-128] , 2, &byteOutLen); - } - status = TECDisposeConverter(converter); - gMacEncodingsInited[i]=true; - } - return gMacEncodings[i] ; - } -#endif - - for (int i = 0; encodings_list[i].table != NULL; i++) - { - if (encodings_list[i].encoding == enc) - return encodings_list[i].table; - } - return NULL; -} - -typedef struct { - wxUint16 u; - wxUint8 c; -} CharsetItem; - -extern "C" int wxCMPFUNC_CONV -CompareCharsetItems(const void *i1, const void *i2) -{ - return ( ((CharsetItem*)i1) -> u - ((CharsetItem*)i2) -> u ); -} - - -static CharsetItem* BuildReverseTable(const wxUint16 *tbl) -{ - CharsetItem *rev = new CharsetItem[128]; - - for (int i = 0; i < 128; i++) - rev[i].c = wxUint8(128 + i), rev[i].u = tbl[i]; - - qsort(rev, 128, sizeof(CharsetItem), CompareCharsetItems); - - return rev; -} - - - -wxEncodingConverter::wxEncodingConverter() -{ - m_Table = NULL; - m_UnicodeInput = m_UnicodeOutput = false; - m_JustCopy = false; -} - - - -bool wxEncodingConverter::Init(wxFontEncoding input_enc, wxFontEncoding output_enc, int method) -{ - unsigned i; - const wxUint16 *in_tbl; - const wxUint16 *out_tbl = NULL; - - if (m_Table) {delete[] m_Table; m_Table = NULL;} - -#if !wxUSE_WCHAR_T - if (input_enc == wxFONTENCODING_UNICODE || output_enc == wxFONTENCODING_UNICODE) return false; -#endif - - if (input_enc == output_enc) {m_JustCopy = true; return true;} - - m_UnicodeOutput = (output_enc == wxFONTENCODING_UNICODE); - m_JustCopy = false; - - if (input_enc == wxFONTENCODING_UNICODE) - { - if ((out_tbl = GetEncTable(output_enc)) == NULL) return false; - - m_Table = new tchar[65536]; - for (i = 0; i < 128; i++) m_Table[i] = (tchar)i; // 7bit ASCII - for (i = 128; i < 65536; i++) m_Table[i] = (tchar)0; - - if (method == wxCONVERT_SUBSTITUTE) - { - for (i = 0; i < encoding_unicode_fallback_count; i++) - m_Table[encoding_unicode_fallback[i].c] = (tchar) encoding_unicode_fallback[i].s; - } - - for (i = 0; i < 128; i++) - m_Table[out_tbl[i]] = (tchar)(128 + i); - - m_UnicodeInput = true; - } - else // input !Unicode - { - if ((in_tbl = GetEncTable(input_enc)) == NULL) return false; - if (output_enc != wxFONTENCODING_UNICODE) - if ((out_tbl = GetEncTable(output_enc)) == NULL) return false; - - m_UnicodeInput = false; - - m_Table = new tchar[256]; - for (i = 0; i < 128; i++) m_Table[i] = (tchar)i; // 7bit ASCII - - if (output_enc == wxFONTENCODING_UNICODE) - { - for (i = 0; i < 128; i++) m_Table[128 + i] = (tchar)in_tbl[i]; - return true; - } - else // output !Unicode - { - CharsetItem *rev = BuildReverseTable(out_tbl); - CharsetItem *item; - CharsetItem key; - - for (i = 0; i < 128; i++) - { - key.u = in_tbl[i]; - item = (CharsetItem*) bsearch(&key, rev, 128, sizeof(CharsetItem), CompareCharsetItems); - if (item == NULL && method == wxCONVERT_SUBSTITUTE) - item = (CharsetItem*) bsearch(&key, encoding_unicode_fallback, - encoding_unicode_fallback_count, sizeof(CharsetItem), CompareCharsetItems); - if (item) - m_Table[128 + i] = (tchar)item -> c; - else -#if wxUSE_WCHAR_T - m_Table[128 + i] = (wchar_t)(128 + i); -#else - m_Table[128 + i] = (char)(128 + i); -#endif - } - - delete[] rev; - } - } - - return true; -} - - -#define REPLACEMENT_CHAR ((tchar)'?') - -inline tchar GetTableValue(const tchar *table, tchar value, bool& repl) -{ - tchar r = table[value]; - if (r == 0 && value != 0) - { - r = REPLACEMENT_CHAR; - repl = true; - } - return r; -} - - -bool wxEncodingConverter::Convert(const char* input, char* output) const -{ - wxASSERT_MSG(!m_UnicodeOutput, wxT("You cannot convert to unicode if output is const char*!")); - wxASSERT_MSG(!m_UnicodeInput, wxT("You cannot convert from unicode if input is const char*!")); - - const char *i; - char *o; - - if (m_JustCopy) - { - strcpy(output, input); - return true; - } - - wxCHECK_MSG(m_Table != NULL, false, - wxT("You must call wxEncodingConverter::Init() before actually converting!")); - - bool replaced = false; - - for (i = input, o = output; *i != 0;) - *(o++) = (char)(GetTableValue(m_Table, (wxUint8)*(i++), replaced)); - *o = 0; - - return !replaced; -} - - -#if wxUSE_WCHAR_T - -bool wxEncodingConverter::Convert(const char* input, wchar_t* output) const -{ - wxASSERT_MSG(m_UnicodeOutput, wxT("You cannot convert to 8-bit if output is const wchar_t*!")); - wxASSERT_MSG(!m_UnicodeInput, wxT("You cannot convert from unicode if input is const char*!")); - - const char *i; - wchar_t *o; - - if (m_JustCopy) - { - for (i = input, o = output; *i != 0;) - *(o++) = (wchar_t)(*(i++)); - *o = 0; - return true; - } - - wxCHECK_MSG(m_Table != NULL, false, - wxT("You must call wxEncodingConverter::Init() before actually converting!")); - - bool replaced = false; - - for (i = input, o = output; *i != 0;) - *(o++) = (wchar_t)(GetTableValue(m_Table, (wxUint8)*(i++), replaced)); - *o = 0; - - return !replaced; -} - - - -bool wxEncodingConverter::Convert(const wchar_t* input, char* output) const -{ - wxASSERT_MSG(!m_UnicodeOutput, wxT("You cannot convert to unicode if output is const char*!")); - wxASSERT_MSG(m_UnicodeInput, wxT("You cannot convert from 8-bit if input is const wchar_t*!")); - - const wchar_t *i; - char *o; - - if (m_JustCopy) - { - for (i = input, o = output; *i != 0;) - *(o++) = (char)(*(i++)); - *o = 0; - return true; - } - - wxCHECK_MSG(m_Table != NULL, false, - wxT("You must call wxEncodingConverter::Init() before actually converting!")); - - bool replaced = false; - - for (i = input, o = output; *i != 0;) - *(o++) = (char)(GetTableValue(m_Table, (wxUint16)*(i++), replaced)); - *o = 0; - - return !replaced; -} - - - -bool wxEncodingConverter::Convert(const wchar_t* input, wchar_t* output) const -{ - wxASSERT_MSG(m_UnicodeOutput, wxT("You cannot convert to 8-bit if output is const wchar_t*!")); - wxASSERT_MSG(m_UnicodeInput, wxT("You cannot convert from 8-bit if input is const wchar_t*!")); - - const wchar_t *i; - wchar_t *o; - - if (m_JustCopy) - { - // wcscpy() is not guaranteed to exist - for (i = input, o = output; *i != 0;) - *(o++) = (*(i++)); - *o = 0; - return true; - } - - wxCHECK_MSG(m_Table != NULL, false, - wxT("You must call wxEncodingConverter::Init() before actually converting!")); - - bool replaced = false; - - for (i = input, o = output; *i != 0;) - *(o++) = (wchar_t)(GetTableValue(m_Table, (wxUint8)*(i++), replaced)); - *o = 0; - - return !replaced; -} - -#endif // wxUSE_WCHAR_T - - -wxString wxEncodingConverter::Convert(const wxString& input) const -{ - if (m_JustCopy) return input; - - wxString s; - const wxChar *i; - - wxCHECK_MSG(m_Table != NULL, s, - wxT("You must call wxEncodingConverter::Init() before actually converting!")); - - if (m_UnicodeInput) - { - for (i = input.c_str(); *i != 0; i++) - s << (wxChar)(m_Table[(wxUint16)*i]); - } - else - { - for (i = input.c_str(); *i != 0; i++) - s << (wxChar)(m_Table[(wxUint8)*i]); - } - - return s; -} - - - - - - - -// Following tables describe classes of encoding equivalence. -// - -#define STOP wxFONTENCODING_SYSTEM - -#define NUM_OF_PLATFORMS 4 /*must conform to enum wxPLATFORM_XXXX !!!*/ -#define ENC_PER_PLATFORM 3 - // max no. of encodings for one language used on one platform. - // Using maximum of everything at the current moment to not make the - // library larger than necessary. Make larger only if necessary - MR - -static const wxFontEncoding - EquivalentEncodings[][NUM_OF_PLATFORMS][ENC_PER_PLATFORM+1] = { - - // *** Please put more common encodings as first! *** - - // Western European - { - /* unix */ {wxFONTENCODING_ISO8859_1, wxFONTENCODING_ISO8859_15, STOP}, - /* windows */ {wxFONTENCODING_CP1252, STOP}, - /* os2 */ {STOP}, - /* mac */ {wxFONTENCODING_MACROMAN, STOP} - }, - - // Central European - { - /* unix */ {wxFONTENCODING_ISO8859_2, STOP}, - /* windows */ {wxFONTENCODING_CP1250, STOP}, - /* os2 */ {STOP}, - /* mac */ {wxFONTENCODING_MACCENTRALEUR, STOP} - }, - - // Baltic - { - /* unix */ {wxFONTENCODING_ISO8859_13, wxFONTENCODING_ISO8859_4, STOP}, - /* windows */ {wxFONTENCODING_CP1257, STOP}, - /* os2 */ {STOP}, - /* mac */ {STOP} - }, - - // Hebrew - { - /* unix */ {wxFONTENCODING_ISO8859_8, STOP}, - /* windows */ {wxFONTENCODING_CP1255, STOP}, - /* os2 */ {STOP}, - /* mac */ {wxFONTENCODING_MACHEBREW, STOP} - }, - - // Greek - { - /* unix */ {wxFONTENCODING_ISO8859_7, STOP}, - /* windows */ {wxFONTENCODING_CP1253, STOP}, - /* os2 */ {STOP}, - /* mac */ {wxFONTENCODING_MACGREEK, STOP} - }, - - // Arabic - { - /* unix */ {wxFONTENCODING_ISO8859_6, STOP}, - /* windows */ {wxFONTENCODING_CP1256, STOP}, - /* os2 */ {STOP}, - /* mac */ {wxFONTENCODING_MACARABIC, STOP} - }, - - // Turkish - { - /* unix */ {wxFONTENCODING_ISO8859_9, STOP}, - /* windows */ {wxFONTENCODING_CP1254, STOP}, - /* os2 */ {STOP}, - /* mac */ {wxFONTENCODING_MACTURKISH, STOP} - }, - - // Cyrillic - { - /* unix */ {wxFONTENCODING_KOI8, wxFONTENCODING_KOI8_U, wxFONTENCODING_ISO8859_5, STOP}, - /* windows */ {wxFONTENCODING_CP1251, STOP}, - /* os2 */ {STOP}, - /* mac */ {wxFONTENCODING_MACCYRILLIC, STOP} - }, - - {{STOP},{STOP},{STOP},{STOP}} /* Terminator */ - /* no, _not_ Arnold! */ -}; - - -static bool FindEncoding(const wxFontEncodingArray& arr, wxFontEncoding f) -{ - for (wxFontEncodingArray::const_iterator it = arr.begin(), en = arr.end(); - it != en; ++it) - if (*it == f) - return true; - return false; -} - -wxFontEncodingArray wxEncodingConverter::GetPlatformEquivalents(wxFontEncoding enc, int platform) -{ - if (platform == wxPLATFORM_CURRENT) - { -#if defined(__WXMSW__) - platform = wxPLATFORM_WINDOWS; -#elif defined(__WXGTK__) || defined(__WXMOTIF__) - platform = wxPLATFORM_UNIX; -#elif defined(__WXPM__) - platform = wxPLATFORM_OS2; -#elif defined(__WXMAC__) - platform = wxPLATFORM_MAC; -#endif - } - - int i, clas, e ; - const wxFontEncoding *f; - wxFontEncodingArray arr; - - clas = 0; - while (EquivalentEncodings[clas][0][0] != STOP) - { - for (i = 0; i < NUM_OF_PLATFORMS; i++) - for (e = 0; EquivalentEncodings[clas][i][e] != STOP; e++) - if (EquivalentEncodings[clas][i][e] == enc) - { - for (f = EquivalentEncodings[clas][platform]; *f != STOP; f++) - if (*f == enc) arr.push_back(enc); - for (f = EquivalentEncodings[clas][platform]; *f != STOP; f++) - if (!FindEncoding(arr, *f)) arr.push_back(*f); - i = NUM_OF_PLATFORMS/*hack*/; break; - } - clas++; - } - - return arr; -} - - - -wxFontEncodingArray wxEncodingConverter::GetAllEquivalents(wxFontEncoding enc) -{ - int i, clas, e, j ; - const wxFontEncoding *f; - wxFontEncodingArray arr; - - arr = GetPlatformEquivalents(enc); // we want them to be first items in array - - clas = 0; - while (EquivalentEncodings[clas][0][0] != STOP) - { - for (i = 0; i < NUM_OF_PLATFORMS; i++) - for (e = 0; EquivalentEncodings[clas][i][e] != STOP; e++) - if (EquivalentEncodings[clas][i][e] == enc) - { - for (j = 0; j < NUM_OF_PLATFORMS; j++) - for (f = EquivalentEncodings[clas][j]; *f != STOP; f++) - if (!FindEncoding(arr, *f)) arr.push_back(*f); - i = NUM_OF_PLATFORMS/*hack*/; break; - } - clas++; - } - - return arr; -} - diff --git a/wxWidgets/src/common/event.cpp b/wxWidgets/src/common/event.cpp deleted file mode 100644 index 934456c802..0000000000 --- a/wxWidgets/src/common/event.cpp +++ /dev/null @@ -1,1499 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/common/event.cpp -// Purpose: Event classes -// Author: Julian Smart -// Modified by: -// Created: 01/02/97 -// RCS-ID: $Id: event.cpp 61982 2009-09-20 21:48:50Z VZ $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#include "wx/event.h" - -#ifndef WX_PRECOMP - #include "wx/list.h" - #include "wx/app.h" - #include "wx/utils.h" - #include "wx/stopwatch.h" - #include "wx/module.h" - - #if wxUSE_GUI - #include "wx/window.h" - #include "wx/control.h" - #include "wx/dc.h" - #include "wx/textctrl.h" - #include "wx/validate.h" - #endif // wxUSE_GUI -#endif - -#if wxUSE_BASE - #include "wx/ptr_scpd.h" - - wxDECLARE_SCOPED_PTR(wxEvent, wxEventPtr) - wxDEFINE_SCOPED_PTR(wxEvent, wxEventPtr) -#endif // wxUSE_BASE - -// ---------------------------------------------------------------------------- -// wxWin macros -// ---------------------------------------------------------------------------- - -#if wxUSE_BASE - IMPLEMENT_DYNAMIC_CLASS(wxEvtHandler, wxObject) - IMPLEMENT_ABSTRACT_CLASS(wxEvent, wxObject) -#endif // wxUSE_BASE - -#if wxUSE_GUI - IMPLEMENT_DYNAMIC_CLASS(wxIdleEvent, wxEvent) - IMPLEMENT_DYNAMIC_CLASS(wxCommandEvent, wxEvent) - IMPLEMENT_DYNAMIC_CLASS(wxNotifyEvent, wxCommandEvent) - IMPLEMENT_DYNAMIC_CLASS(wxScrollEvent, wxCommandEvent) - IMPLEMENT_DYNAMIC_CLASS(wxScrollWinEvent, wxEvent) - IMPLEMENT_DYNAMIC_CLASS(wxMouseEvent, wxEvent) - IMPLEMENT_DYNAMIC_CLASS(wxKeyEvent, wxEvent) - IMPLEMENT_DYNAMIC_CLASS(wxSizeEvent, wxEvent) - IMPLEMENT_DYNAMIC_CLASS(wxPaintEvent, wxEvent) - IMPLEMENT_DYNAMIC_CLASS(wxNcPaintEvent, wxEvent) - IMPLEMENT_DYNAMIC_CLASS(wxEraseEvent, wxEvent) - IMPLEMENT_DYNAMIC_CLASS(wxMoveEvent, wxEvent) - IMPLEMENT_DYNAMIC_CLASS(wxFocusEvent, wxEvent) - IMPLEMENT_DYNAMIC_CLASS(wxChildFocusEvent, wxCommandEvent) - IMPLEMENT_DYNAMIC_CLASS(wxCloseEvent, wxEvent) - IMPLEMENT_DYNAMIC_CLASS(wxShowEvent, wxEvent) - IMPLEMENT_DYNAMIC_CLASS(wxMaximizeEvent, wxEvent) - IMPLEMENT_DYNAMIC_CLASS(wxIconizeEvent, wxEvent) - IMPLEMENT_DYNAMIC_CLASS(wxMenuEvent, wxEvent) - IMPLEMENT_DYNAMIC_CLASS(wxJoystickEvent, wxEvent) - IMPLEMENT_DYNAMIC_CLASS(wxDropFilesEvent, wxEvent) - IMPLEMENT_DYNAMIC_CLASS(wxActivateEvent, wxEvent) - IMPLEMENT_DYNAMIC_CLASS(wxInitDialogEvent, wxEvent) - IMPLEMENT_DYNAMIC_CLASS(wxSetCursorEvent, wxEvent) - IMPLEMENT_DYNAMIC_CLASS(wxSysColourChangedEvent, wxEvent) - IMPLEMENT_DYNAMIC_CLASS(wxDisplayChangedEvent, wxEvent) - IMPLEMENT_DYNAMIC_CLASS(wxUpdateUIEvent, wxCommandEvent) - IMPLEMENT_DYNAMIC_CLASS(wxNavigationKeyEvent, wxEvent) - IMPLEMENT_DYNAMIC_CLASS(wxPaletteChangedEvent, wxEvent) - IMPLEMENT_DYNAMIC_CLASS(wxQueryNewPaletteEvent, wxEvent) - IMPLEMENT_DYNAMIC_CLASS(wxWindowCreateEvent, wxEvent) - IMPLEMENT_DYNAMIC_CLASS(wxWindowDestroyEvent, wxEvent) - IMPLEMENT_DYNAMIC_CLASS(wxHelpEvent, wxCommandEvent) - IMPLEMENT_DYNAMIC_CLASS(wxContextMenuEvent, wxCommandEvent) - IMPLEMENT_DYNAMIC_CLASS(wxMouseCaptureChangedEvent, wxEvent) - IMPLEMENT_DYNAMIC_CLASS(wxMouseCaptureLostEvent, wxEvent) - IMPLEMENT_DYNAMIC_CLASS(wxClipboardTextEvent, wxCommandEvent) -#endif // wxUSE_GUI - -#if wxUSE_BASE - -const wxEventTable *wxEvtHandler::GetEventTable() const - { return &wxEvtHandler::sm_eventTable; } - -const wxEventTable wxEvtHandler::sm_eventTable = - { (const wxEventTable *)NULL, &wxEvtHandler::sm_eventTableEntries[0] }; - -wxEventHashTable &wxEvtHandler::GetEventHashTable() const - { return wxEvtHandler::sm_eventHashTable; } - -wxEventHashTable wxEvtHandler::sm_eventHashTable(wxEvtHandler::sm_eventTable); - -const wxEventTableEntry wxEvtHandler::sm_eventTableEntries[] = - { DECLARE_EVENT_TABLE_ENTRY(wxEVT_NULL, 0, 0, (wxObjectEventFunction)NULL, NULL) }; - - -#ifdef __WXDEBUG__ -// Clear up event hash table contents or we can get problems -// when C++ is cleaning up the static object -class wxEventTableEntryModule: public wxModule -{ -DECLARE_DYNAMIC_CLASS(wxEventTableEntryModule) -public: - wxEventTableEntryModule() {} - bool OnInit() - { - wxEventHashTable::ReconstructAll(); - return true; - } - void OnExit() - { - wxEventHashTable::ClearAll(); - } -}; -IMPLEMENT_DYNAMIC_CLASS(wxEventTableEntryModule, wxModule) -#endif - -// ---------------------------------------------------------------------------- -// global variables -// ---------------------------------------------------------------------------- - -// To put pending event handlers -wxList *wxPendingEvents = (wxList *)NULL; - -#if wxUSE_THREADS - // protects wxPendingEvents list - wxCriticalSection *wxPendingEventsLocker = (wxCriticalSection *)NULL; -#endif - -#if !WXWIN_COMPATIBILITY_EVENT_TYPES - -// common event types are defined here, other event types are defined by the -// components which use them - -const wxEventType wxEVT_FIRST = 10000; -const wxEventType wxEVT_USER_FIRST = wxEVT_FIRST + 2000; - -DEFINE_EVENT_TYPE(wxEVT_NULL) -DEFINE_EVENT_TYPE(wxEVT_IDLE) -DEFINE_EVENT_TYPE(wxEVT_SOCKET) - -#endif // !WXWIN_COMPATIBILITY_EVENT_TYPES - -#endif // wxUSE_BASE - -#if wxUSE_GUI - -#if !WXWIN_COMPATIBILITY_EVENT_TYPES - -DEFINE_EVENT_TYPE(wxEVT_COMMAND_BUTTON_CLICKED) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_CHECKBOX_CLICKED) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_CHOICE_SELECTED) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_LISTBOX_SELECTED) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_LISTBOX_DOUBLECLICKED) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_CHECKLISTBOX_TOGGLED) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_MENU_SELECTED) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_SLIDER_UPDATED) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_RADIOBOX_SELECTED) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_RADIOBUTTON_SELECTED) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_SCROLLBAR_UPDATED) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_VLBOX_SELECTED) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_COMBOBOX_SELECTED) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_TOOL_RCLICKED) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_TOOL_ENTER) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_SPINCTRL_UPDATED) - -// Sockets and timers send events, too -DEFINE_EVENT_TYPE(wxEVT_TIMER) - -// Mouse event types -DEFINE_EVENT_TYPE(wxEVT_LEFT_DOWN) -DEFINE_EVENT_TYPE(wxEVT_LEFT_UP) -DEFINE_EVENT_TYPE(wxEVT_MIDDLE_DOWN) -DEFINE_EVENT_TYPE(wxEVT_MIDDLE_UP) -DEFINE_EVENT_TYPE(wxEVT_RIGHT_DOWN) -DEFINE_EVENT_TYPE(wxEVT_RIGHT_UP) -DEFINE_EVENT_TYPE(wxEVT_MOTION) -DEFINE_EVENT_TYPE(wxEVT_ENTER_WINDOW) -DEFINE_EVENT_TYPE(wxEVT_LEAVE_WINDOW) -DEFINE_EVENT_TYPE(wxEVT_LEFT_DCLICK) -DEFINE_EVENT_TYPE(wxEVT_MIDDLE_DCLICK) -DEFINE_EVENT_TYPE(wxEVT_RIGHT_DCLICK) -DEFINE_EVENT_TYPE(wxEVT_SET_FOCUS) -DEFINE_EVENT_TYPE(wxEVT_KILL_FOCUS) -DEFINE_EVENT_TYPE(wxEVT_CHILD_FOCUS) -DEFINE_EVENT_TYPE(wxEVT_MOUSEWHEEL) - -// Non-client mouse events -DEFINE_EVENT_TYPE(wxEVT_NC_LEFT_DOWN) -DEFINE_EVENT_TYPE(wxEVT_NC_LEFT_UP) -DEFINE_EVENT_TYPE(wxEVT_NC_MIDDLE_DOWN) -DEFINE_EVENT_TYPE(wxEVT_NC_MIDDLE_UP) -DEFINE_EVENT_TYPE(wxEVT_NC_RIGHT_DOWN) -DEFINE_EVENT_TYPE(wxEVT_NC_RIGHT_UP) -DEFINE_EVENT_TYPE(wxEVT_NC_MOTION) -DEFINE_EVENT_TYPE(wxEVT_NC_ENTER_WINDOW) -DEFINE_EVENT_TYPE(wxEVT_NC_LEAVE_WINDOW) -DEFINE_EVENT_TYPE(wxEVT_NC_LEFT_DCLICK) -DEFINE_EVENT_TYPE(wxEVT_NC_MIDDLE_DCLICK) -DEFINE_EVENT_TYPE(wxEVT_NC_RIGHT_DCLICK) - -// Character input event type -DEFINE_EVENT_TYPE(wxEVT_CHAR) -DEFINE_EVENT_TYPE(wxEVT_CHAR_HOOK) -DEFINE_EVENT_TYPE(wxEVT_NAVIGATION_KEY) -DEFINE_EVENT_TYPE(wxEVT_KEY_DOWN) -DEFINE_EVENT_TYPE(wxEVT_KEY_UP) -#if wxUSE_HOTKEY -DEFINE_EVENT_TYPE(wxEVT_HOTKEY) -#endif - -// Set cursor event -DEFINE_EVENT_TYPE(wxEVT_SET_CURSOR) - -// wxScrollbar and wxSlider event identifiers -DEFINE_EVENT_TYPE(wxEVT_SCROLL_TOP) -DEFINE_EVENT_TYPE(wxEVT_SCROLL_BOTTOM) -DEFINE_EVENT_TYPE(wxEVT_SCROLL_LINEUP) -DEFINE_EVENT_TYPE(wxEVT_SCROLL_LINEDOWN) -DEFINE_EVENT_TYPE(wxEVT_SCROLL_PAGEUP) -DEFINE_EVENT_TYPE(wxEVT_SCROLL_PAGEDOWN) -DEFINE_EVENT_TYPE(wxEVT_SCROLL_THUMBTRACK) -DEFINE_EVENT_TYPE(wxEVT_SCROLL_THUMBRELEASE) -DEFINE_EVENT_TYPE(wxEVT_SCROLL_CHANGED) - -// Scroll events from wxWindow -DEFINE_EVENT_TYPE(wxEVT_SCROLLWIN_TOP) -DEFINE_EVENT_TYPE(wxEVT_SCROLLWIN_BOTTOM) -DEFINE_EVENT_TYPE(wxEVT_SCROLLWIN_LINEUP) -DEFINE_EVENT_TYPE(wxEVT_SCROLLWIN_LINEDOWN) -DEFINE_EVENT_TYPE(wxEVT_SCROLLWIN_PAGEUP) -DEFINE_EVENT_TYPE(wxEVT_SCROLLWIN_PAGEDOWN) -DEFINE_EVENT_TYPE(wxEVT_SCROLLWIN_THUMBTRACK) -DEFINE_EVENT_TYPE(wxEVT_SCROLLWIN_THUMBRELEASE) - -// System events -DEFINE_EVENT_TYPE(wxEVT_SIZE) -DEFINE_EVENT_TYPE(wxEVT_SIZING) -DEFINE_EVENT_TYPE(wxEVT_MOVE) -DEFINE_EVENT_TYPE(wxEVT_MOVING) -DEFINE_EVENT_TYPE(wxEVT_CLOSE_WINDOW) -DEFINE_EVENT_TYPE(wxEVT_END_SESSION) -DEFINE_EVENT_TYPE(wxEVT_QUERY_END_SESSION) -DEFINE_EVENT_TYPE(wxEVT_HIBERNATE) -DEFINE_EVENT_TYPE(wxEVT_ACTIVATE_APP) -DEFINE_EVENT_TYPE(wxEVT_POWER) -DEFINE_EVENT_TYPE(wxEVT_ACTIVATE) -DEFINE_EVENT_TYPE(wxEVT_CREATE) -DEFINE_EVENT_TYPE(wxEVT_DESTROY) -DEFINE_EVENT_TYPE(wxEVT_SHOW) -DEFINE_EVENT_TYPE(wxEVT_ICONIZE) -DEFINE_EVENT_TYPE(wxEVT_MAXIMIZE) -DEFINE_EVENT_TYPE(wxEVT_MOUSE_CAPTURE_CHANGED) -DEFINE_EVENT_TYPE(wxEVT_MOUSE_CAPTURE_LOST) -DEFINE_EVENT_TYPE(wxEVT_PAINT) -DEFINE_EVENT_TYPE(wxEVT_ERASE_BACKGROUND) -DEFINE_EVENT_TYPE(wxEVT_NC_PAINT) -DEFINE_EVENT_TYPE(wxEVT_PAINT_ICON) -DEFINE_EVENT_TYPE(wxEVT_MENU_OPEN) -DEFINE_EVENT_TYPE(wxEVT_MENU_CLOSE) -DEFINE_EVENT_TYPE(wxEVT_MENU_HIGHLIGHT) -DEFINE_EVENT_TYPE(wxEVT_CONTEXT_MENU) -DEFINE_EVENT_TYPE(wxEVT_SYS_COLOUR_CHANGED) -DEFINE_EVENT_TYPE(wxEVT_DISPLAY_CHANGED) -DEFINE_EVENT_TYPE(wxEVT_SETTING_CHANGED) -DEFINE_EVENT_TYPE(wxEVT_QUERY_NEW_PALETTE) -DEFINE_EVENT_TYPE(wxEVT_PALETTE_CHANGED) -DEFINE_EVENT_TYPE(wxEVT_JOY_BUTTON_DOWN) -DEFINE_EVENT_TYPE(wxEVT_JOY_BUTTON_UP) -DEFINE_EVENT_TYPE(wxEVT_JOY_MOVE) -DEFINE_EVENT_TYPE(wxEVT_JOY_ZMOVE) -DEFINE_EVENT_TYPE(wxEVT_DROP_FILES) -DEFINE_EVENT_TYPE(wxEVT_DRAW_ITEM) -DEFINE_EVENT_TYPE(wxEVT_MEASURE_ITEM) -DEFINE_EVENT_TYPE(wxEVT_COMPARE_ITEM) -DEFINE_EVENT_TYPE(wxEVT_INIT_DIALOG) -DEFINE_EVENT_TYPE(wxEVT_UPDATE_UI) - -// Clipboard events -DEFINE_EVENT_TYPE(wxEVT_COMMAND_TEXT_COPY) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_TEXT_CUT) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_TEXT_PASTE) - -// Generic command events -// Note: a click is a higher-level event than button down/up -DEFINE_EVENT_TYPE(wxEVT_COMMAND_LEFT_CLICK) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_LEFT_DCLICK) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_RIGHT_CLICK) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_RIGHT_DCLICK) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_SET_FOCUS) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_KILL_FOCUS) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_ENTER) - -// Help events -DEFINE_EVENT_TYPE(wxEVT_HELP) -DEFINE_EVENT_TYPE(wxEVT_DETAILED_HELP) - -#endif // !WXWIN_COMPATIBILITY_EVENT_TYPES - -#endif // wxUSE_GUI - -#if wxUSE_BASE - -// ============================================================================ -// implementation -// ============================================================================ - -// ---------------------------------------------------------------------------- -// event initialization -// ---------------------------------------------------------------------------- - -int wxNewEventType() -{ - // MT-FIXME - static int s_lastUsedEventType = wxEVT_FIRST; - - return s_lastUsedEventType++; -} - -// ---------------------------------------------------------------------------- -// wxEvent -// ---------------------------------------------------------------------------- - -/* - * General wxWidgets events, covering - * all interesting things that might happen (button clicking, resizing, - * setting text in widgets, etc.). - * - * For each completely new event type, derive a new event class. - * - */ - -wxEvent::wxEvent(int theId, wxEventType commandType ) -{ - m_eventType = commandType; - m_eventObject = (wxObject *) NULL; - m_timeStamp = 0; - m_id = theId; - m_skipped = false; - m_callbackUserData = (wxObject *) NULL; - m_isCommandEvent = false; - m_propagationLevel = wxEVENT_PROPAGATE_NONE; -} - -wxEvent::wxEvent(const wxEvent &src) - : wxObject(src) - , m_eventObject(src.m_eventObject) - , m_eventType(src.m_eventType) - , m_timeStamp(src.m_timeStamp) - , m_id(src.m_id) - , m_callbackUserData(src.m_callbackUserData) - , m_propagationLevel(src.m_propagationLevel) - , m_skipped(src.m_skipped) - , m_isCommandEvent(src.m_isCommandEvent) -{ -} - -#endif // wxUSE_BASE - -#if wxUSE_GUI - -/* - * Command events - * - */ - -#ifdef __VISUALC__ - // 'this' : used in base member initializer list (for m_commandString) - #pragma warning(disable:4355) -#endif - -wxCommandEvent::wxCommandEvent(wxEventType commandType, int theId) - : wxEvent(theId, commandType) -#if WXWIN_COMPATIBILITY_2_4 - , m_commandString(this) -#endif -{ - m_clientData = (char *) NULL; - m_clientObject = (wxClientData *) NULL; - m_extraLong = 0; - m_commandInt = 0; - m_isCommandEvent = true; - - // the command events are propagated upwards by default - m_propagationLevel = wxEVENT_PROPAGATE_MAX; -} - -#ifdef __VISUALC__ - #pragma warning(default:4355) -#endif - -wxString wxCommandEvent::GetString() const -{ - if(m_eventType != wxEVT_COMMAND_TEXT_UPDATED || !m_eventObject) - return m_cmdString; - else - { -#if wxUSE_TEXTCTRL - wxTextCtrl *txt = wxDynamicCast(m_eventObject, wxTextCtrl); - if(txt) - return txt->GetValue(); - else -#endif // wxUSE_TEXTCTRL - return m_cmdString; - } -} - -/* - * UI update events - */ - -#if wxUSE_LONGLONG -wxLongLong wxUpdateUIEvent::sm_lastUpdate = 0; -#endif - -long wxUpdateUIEvent::sm_updateInterval = 0; - -wxUpdateUIMode wxUpdateUIEvent::sm_updateMode = wxUPDATE_UI_PROCESS_ALL; - -// Can we update? -bool wxUpdateUIEvent::CanUpdate(wxWindowBase *win) -{ - // Don't update if we've switched global updating off - // and this window doesn't support updates. - if (win && - (GetMode() == wxUPDATE_UI_PROCESS_SPECIFIED && - ((win->GetExtraStyle() & wxWS_EX_PROCESS_UI_UPDATES) == 0))) - return false; - - if (sm_updateInterval == -1) - return false; - - if (sm_updateInterval == 0) - return true; - -#if wxUSE_STOPWATCH && wxUSE_LONGLONG - wxLongLong now = wxGetLocalTimeMillis(); - if (now > (sm_lastUpdate + sm_updateInterval)) - { - return true; - } - - return false; -#else - // If we don't have wxStopWatch or wxLongLong, we - // should err on the safe side and update now anyway. - return true; -#endif -} - -// Reset the update time to provide a delay until the next -// time we should update -void wxUpdateUIEvent::ResetUpdateTime() -{ -#if wxUSE_STOPWATCH && wxUSE_LONGLONG - if (sm_updateInterval > 0) - { - wxLongLong now = wxGetLocalTimeMillis(); - if (now > (sm_lastUpdate + sm_updateInterval)) - { - sm_lastUpdate = now; - } - } -#endif -} - -/* - * Idle events - */ - -wxIdleMode wxIdleEvent::sm_idleMode = wxIDLE_PROCESS_ALL; - -// Can we send an idle event? -bool wxIdleEvent::CanSend(wxWindow* win) -{ - // Don't update if we've switched global updating off - // and this window doesn't support updates. - if (win && - (GetMode() == wxIDLE_PROCESS_SPECIFIED && - ((win->GetExtraStyle() & wxWS_EX_PROCESS_IDLE) == 0))) - return false; - - return true; -} - -/* - * Scroll events - */ - -wxScrollEvent::wxScrollEvent(wxEventType commandType, - int id, - int pos, - int orient) - : wxCommandEvent(commandType, id) -{ - m_extraLong = orient; - m_commandInt = pos; -} - -/* - * ScrollWin events - */ - -wxScrollWinEvent::wxScrollWinEvent(wxEventType commandType, - int pos, - int orient) -{ - m_eventType = commandType; - m_extraLong = orient; - m_commandInt = pos; -} - -/* - * Mouse events - * - */ - -wxMouseEvent::wxMouseEvent(wxEventType commandType) -{ - m_eventType = commandType; - m_metaDown = false; - m_altDown = false; - m_controlDown = false; - m_shiftDown = false; - m_leftDown = false; - m_rightDown = false; - m_middleDown = false; - m_x = 0; - m_y = 0; - m_wheelRotation = 0; - m_wheelDelta = 0; - m_linesPerAction = 0; -} - -void wxMouseEvent::Assign(const wxMouseEvent& event) -{ - m_eventType = event.m_eventType; - - m_x = event.m_x; - m_y = event.m_y; - - m_leftDown = event.m_leftDown; - m_middleDown = event.m_middleDown; - m_rightDown = event.m_rightDown; - - m_controlDown = event.m_controlDown; - m_shiftDown = event.m_shiftDown; - m_altDown = event.m_altDown; - m_metaDown = event.m_metaDown; - - m_wheelRotation = event.m_wheelRotation; - m_wheelDelta = event.m_wheelDelta; - m_linesPerAction = event.m_linesPerAction; -} - -// return true if was a button dclick event -bool wxMouseEvent::ButtonDClick(int but) const -{ - switch (but) - { - default: - wxFAIL_MSG(wxT("invalid parameter in wxMouseEvent::ButtonDClick")); - // fall through - - case wxMOUSE_BTN_ANY: - return (LeftDClick() || MiddleDClick() || RightDClick()); - - case wxMOUSE_BTN_LEFT: - return LeftDClick(); - - case wxMOUSE_BTN_MIDDLE: - return MiddleDClick(); - - case wxMOUSE_BTN_RIGHT: - return RightDClick(); - } -} - -// return true if was a button down event -bool wxMouseEvent::ButtonDown(int but) const -{ - switch (but) - { - default: - wxFAIL_MSG(wxT("invalid parameter in wxMouseEvent::ButtonDown")); - // fall through - - case wxMOUSE_BTN_ANY: - return (LeftDown() || MiddleDown() || RightDown()); - - case wxMOUSE_BTN_LEFT: - return LeftDown(); - - case wxMOUSE_BTN_MIDDLE: - return MiddleDown(); - - case wxMOUSE_BTN_RIGHT: - return RightDown(); - } -} - -// return true if was a button up event -bool wxMouseEvent::ButtonUp(int but) const -{ - switch (but) - { - default: - wxFAIL_MSG(wxT("invalid parameter in wxMouseEvent::ButtonUp")); - // fall through - - case wxMOUSE_BTN_ANY: - return (LeftUp() || MiddleUp() || RightUp()); - - case wxMOUSE_BTN_LEFT: - return LeftUp(); - - case wxMOUSE_BTN_MIDDLE: - return MiddleUp(); - - case wxMOUSE_BTN_RIGHT: - return RightUp(); - } -} - -// return true if the given button is currently changing state -bool wxMouseEvent::Button(int but) const -{ - switch (but) - { - default: - wxFAIL_MSG(wxT("invalid parameter in wxMouseEvent::Button")); - // fall through - - case wxMOUSE_BTN_ANY: - return ButtonUp(wxMOUSE_BTN_ANY) || - ButtonDown(wxMOUSE_BTN_ANY) || - ButtonDClick(wxMOUSE_BTN_ANY); - - case wxMOUSE_BTN_LEFT: - return LeftDown() || LeftUp() || LeftDClick(); - - case wxMOUSE_BTN_MIDDLE: - return MiddleDown() || MiddleUp() || MiddleDClick(); - - case wxMOUSE_BTN_RIGHT: - return RightDown() || RightUp() || RightDClick(); - } -} - -bool wxMouseEvent::ButtonIsDown(int but) const -{ - switch (but) - { - default: - wxFAIL_MSG(wxT("invalid parameter in wxMouseEvent::ButtonIsDown")); - // fall through - - case wxMOUSE_BTN_ANY: - return LeftIsDown() || MiddleIsDown() || RightIsDown(); - - case wxMOUSE_BTN_LEFT: - return LeftIsDown(); - - case wxMOUSE_BTN_MIDDLE: - return MiddleIsDown(); - - case wxMOUSE_BTN_RIGHT: - return RightIsDown(); - } -} - -int wxMouseEvent::GetButton() const -{ - for ( int i = 1; i <= 3; i++ ) - { - if ( Button(i) ) - { - return i; - } - } - - return wxMOUSE_BTN_NONE; -} - -// Find the logical position of the event given the DC -wxPoint wxMouseEvent::GetLogicalPosition(const wxDC& dc) const -{ - wxPoint pt(dc.DeviceToLogicalX(m_x), dc.DeviceToLogicalY(m_y)); - return pt; -} - - -/* - * Keyboard event - * - */ - -wxKeyEvent::wxKeyEvent(wxEventType type) -{ - m_eventType = type; - m_shiftDown = false; - m_controlDown = false; - m_metaDown = false; - m_altDown = false; - m_keyCode = 0; - m_scanCode = 0; -#if wxUSE_UNICODE - m_uniChar = 0; -#endif -} - -wxKeyEvent::wxKeyEvent(const wxKeyEvent& evt) - : wxEvent(evt) -{ - m_x = evt.m_x; - m_y = evt.m_y; - - m_keyCode = evt.m_keyCode; - - m_controlDown = evt.m_controlDown; - m_shiftDown = evt.m_shiftDown; - m_altDown = evt.m_altDown; - m_metaDown = evt.m_metaDown; - m_scanCode = evt.m_scanCode; - m_rawCode = evt.m_rawCode; - m_rawFlags = evt.m_rawFlags; - -#if wxUSE_UNICODE - m_uniChar = evt.m_uniChar; -#endif -} - -#if WXWIN_COMPATIBILITY_2_6 -long wxKeyEvent::KeyCode() const -{ - return m_keyCode; -} -#endif // WXWIN_COMPATIBILITY_2_6 - -wxWindowCreateEvent::wxWindowCreateEvent(wxWindow *win) -{ - SetEventType(wxEVT_CREATE); - SetEventObject(win); -} - -wxWindowDestroyEvent::wxWindowDestroyEvent(wxWindow *win) -{ - SetEventType(wxEVT_DESTROY); - SetEventObject(win); -} - -wxChildFocusEvent::wxChildFocusEvent(wxWindow *win) - : wxCommandEvent(wxEVT_CHILD_FOCUS) -{ - SetEventObject(win); -} - -// ---------------------------------------------------------------------------- -// wxHelpEvent -// ---------------------------------------------------------------------------- - -/* static */ -wxHelpEvent::Origin wxHelpEvent::GuessOrigin(Origin origin) -{ - if ( origin == Origin_Unknown ) - { - // assume that the event comes from the help button if it's not from - // keyboard and that pressing F1 always results in the help event - origin = wxGetKeyState(WXK_F1) ? Origin_Keyboard : Origin_HelpButton; - } - - return origin; -} - -#endif // wxUSE_GUI - - -#if wxUSE_BASE - -// ---------------------------------------------------------------------------- -// wxEventHashTable -// ---------------------------------------------------------------------------- - -static const int EVENT_TYPE_TABLE_INIT_SIZE = 31; // Not too big not too small... - -wxEventHashTable* wxEventHashTable::sm_first = NULL; - -wxEventHashTable::wxEventHashTable(const wxEventTable &table) - : m_table(table), - m_rebuildHash(true) -{ - AllocEventTypeTable(EVENT_TYPE_TABLE_INIT_SIZE); - - m_next = sm_first; - if (m_next) - m_next->m_previous = this; - sm_first = this; -} - -wxEventHashTable::~wxEventHashTable() -{ - if (m_next) - m_next->m_previous = m_previous; - if (m_previous) - m_previous->m_next = m_next; - if (sm_first == this) - sm_first = m_next; - - Clear(); -} - -void wxEventHashTable::Clear() -{ - size_t i; - for(i = 0; i < m_size; i++) - { - EventTypeTablePointer eTTnode = m_eventTypeTable[i]; - if (eTTnode) - { - delete eTTnode; - } - } - - // Necessary in order to not invoke the - // overloaded delete operator when statics are cleaned up - if (m_eventTypeTable) - delete[] m_eventTypeTable; - - m_eventTypeTable = NULL; - m_size = 0; -} - -// Clear all tables -void wxEventHashTable::ClearAll() -{ - wxEventHashTable* table = sm_first; - while (table) - { - table->Clear(); - table = table->m_next; - } -} - -// Rebuild all tables if they were cleared by ClearAll -void wxEventHashTable::ReconstructAll() -{ - wxEventHashTable* table = sm_first; - while (table) - { - // This will only be true if the event table was cleared. - // What we do here is basically what the constructor does. - if(table->m_eventTypeTable == NULL) - { - table->AllocEventTypeTable(EVENT_TYPE_TABLE_INIT_SIZE); - table->m_rebuildHash = true; - } - table = table->m_next; - } -} - -bool wxEventHashTable::HandleEvent(wxEvent &event, wxEvtHandler *self) -{ - if (m_rebuildHash) - { - InitHashTable(); - m_rebuildHash = false; - } - - if (!m_eventTypeTable) - return false; - - // Find all entries for the given event type. - wxEventType eventType = event.GetEventType(); - const EventTypeTablePointer eTTnode = m_eventTypeTable[eventType % m_size]; - if (eTTnode && eTTnode->eventType == eventType) - { - // Now start the search for an event handler - // that can handle an event with the given ID. - const wxEventTableEntryPointerArray& - eventEntryTable = eTTnode->eventEntryTable; - - const size_t count = eventEntryTable.GetCount(); - for (size_t n = 0; n < count; n++) - { - if ( wxEvtHandler:: - ProcessEventIfMatches(*eventEntryTable[n], self, event) ) - { - return true; - } - } - } - - return false; -} - -void wxEventHashTable::InitHashTable() -{ - // Loop over the event tables and all its base tables. - const wxEventTable *table = &m_table; - while (table) - { - // Retrieve all valid event handler entries - const wxEventTableEntry *entry = table->entries; - while (entry->m_fn != 0) - { - // Add the event entry in the Hash. - AddEntry(*entry); - - entry++; - } - - table = table->baseTable; - } - - // Lets free some memory. - size_t i; - for(i = 0; i < m_size; i++) - { - EventTypeTablePointer eTTnode = m_eventTypeTable[i]; - if (eTTnode) - { - eTTnode->eventEntryTable.Shrink(); - } - } -} - -void wxEventHashTable::AddEntry(const wxEventTableEntry &entry) -{ - // This might happen 'accidentally' as the app is exiting - if (!m_eventTypeTable) - return; - - EventTypeTablePointer *peTTnode = &m_eventTypeTable[entry.m_eventType % m_size]; - EventTypeTablePointer eTTnode = *peTTnode; - - if (eTTnode) - { - if (eTTnode->eventType != entry.m_eventType) - { - // Resize the table! - GrowEventTypeTable(); - // Try again to add it. - AddEntry(entry); - return; - } - } - else - { - eTTnode = new EventTypeTable; - eTTnode->eventType = entry.m_eventType; - *peTTnode = eTTnode; - } - - // Fill all hash entries between entry.m_id and entry.m_lastId... - eTTnode->eventEntryTable.Add(&entry); -} - -void wxEventHashTable::AllocEventTypeTable(size_t size) -{ - m_eventTypeTable = new EventTypeTablePointer[size]; - memset((void *)m_eventTypeTable, 0, sizeof(EventTypeTablePointer)*size); - m_size = size; -} - -void wxEventHashTable::GrowEventTypeTable() -{ - size_t oldSize = m_size; - EventTypeTablePointer *oldEventTypeTable = m_eventTypeTable; - - // TODO: Search the most optimal grow sequence - AllocEventTypeTable(/* GetNextPrime(oldSize) */oldSize*2+1); - - for ( size_t i = 0; i < oldSize; /* */ ) - { - EventTypeTablePointer eTToldNode = oldEventTypeTable[i]; - if (eTToldNode) - { - EventTypeTablePointer *peTTnode = &m_eventTypeTable[eTToldNode->eventType % m_size]; - EventTypeTablePointer eTTnode = *peTTnode; - - // Check for collision, we don't want any. - if (eTTnode) - { - GrowEventTypeTable(); - continue; // Don't increment the counter, - // as we still need to add this element. - } - else - { - // Get the old value and put it in the new table. - *peTTnode = oldEventTypeTable[i]; - } - } - - i++; - } - - delete[] oldEventTypeTable; -} - - -// ---------------------------------------------------------------------------- -// wxEvtHandler -// ---------------------------------------------------------------------------- - -/* - * Event handler - */ - -wxEvtHandler::wxEvtHandler() -{ - m_nextHandler = (wxEvtHandler *) NULL; - m_previousHandler = (wxEvtHandler *) NULL; - m_enabled = true; - m_dynamicEvents = (wxList *) NULL; - m_pendingEvents = (wxList *) NULL; -#if wxUSE_THREADS -# if !defined(__VISAGECPP__) - m_eventsLocker = new wxCriticalSection; -# endif -#endif - - // no client data (yet) - m_clientData = NULL; - m_clientDataType = wxClientData_None; -} - -wxEvtHandler::~wxEvtHandler() -{ - // Takes itself out of the list of handlers - if (m_previousHandler) - m_previousHandler->m_nextHandler = m_nextHandler; - - if (m_nextHandler) - m_nextHandler->m_previousHandler = m_previousHandler; - - if (m_dynamicEvents) - { - for ( wxList::iterator it = m_dynamicEvents->begin(), - end = m_dynamicEvents->end(); - it != end; - ++it ) - { -#if WXWIN_COMPATIBILITY_EVENT_TYPES - wxEventTableEntry *entry = (wxEventTableEntry*)*it; -#else // !WXWIN_COMPATIBILITY_EVENT_TYPES - wxDynamicEventTableEntry *entry = (wxDynamicEventTableEntry*)*it; -#endif // WXWIN_COMPATIBILITY_EVENT_TYPES/!WXWIN_COMPATIBILITY_EVENT_TYPES - - if (entry->m_callbackUserData) - delete entry->m_callbackUserData; - delete entry; - } - delete m_dynamicEvents; - }; - - if (m_pendingEvents) - m_pendingEvents->DeleteContents(true); - delete m_pendingEvents; - -#if wxUSE_THREADS -# if !defined(__VISAGECPP__) - delete m_eventsLocker; -# endif - - // Remove us from wxPendingEvents if necessary. - if(wxPendingEventsLocker) - wxENTER_CRIT_SECT(*wxPendingEventsLocker); -#endif // wxUSE_THREADS - - if ( wxPendingEvents ) - { - // Delete all occurences of this from the list of pending events - while (wxPendingEvents->DeleteObject(this)) { } // Do nothing - } - -#if wxUSE_THREADS - if(wxPendingEventsLocker) - wxLEAVE_CRIT_SECT(*wxPendingEventsLocker); -#endif // wxUSE_THREADS - - // we only delete object data, not untyped - if ( m_clientDataType == wxClientData_Object ) - delete m_clientObject; -} - -#if wxUSE_THREADS - -bool wxEvtHandler::ProcessThreadEvent(wxEvent& event) -{ - // check that we are really in a child thread - wxASSERT_MSG( !wxThread::IsMain(), - wxT("use ProcessEvent() in main thread") ); - - AddPendingEvent(event); - - return true; -} - -void wxEvtHandler::ClearEventLocker() -{ -#if !defined(__VISAGECPP__) - delete m_eventsLocker; - m_eventsLocker = NULL; -#endif -} - -#endif // wxUSE_THREADS - -void wxEvtHandler::AddPendingEvent(wxEvent& event) -{ - // 1) Add event to list of pending events of this event handler - - wxEvent *eventCopy = event.Clone(); - - // we must be able to copy the events here so the event class must - // implement Clone() properly instead of just providing a NULL stab for it - wxCHECK_RET( eventCopy, - _T("events of this type aren't supposed to be posted") ); - - wxENTER_CRIT_SECT( Lock() ); - - if ( !m_pendingEvents ) - m_pendingEvents = new wxList; - - m_pendingEvents->Append(eventCopy); - - // 2) Add this event handler to list of event handlers that - // have pending events. - - wxENTER_CRIT_SECT(*wxPendingEventsLocker); - - if ( !wxPendingEvents ) - wxPendingEvents = new wxList; - wxPendingEvents->Append(this); - - wxLEAVE_CRIT_SECT(*wxPendingEventsLocker); - - wxLEAVE_CRIT_SECT( Lock() ); - - // 3) Inform the system that new pending events are somewhere, - // and that these should be processed in idle time. - wxWakeUpIdle(); -} - -void wxEvtHandler::ProcessPendingEvents() -{ - // this method is only called by wxApp if this handler does have - // pending events - wxCHECK_RET( m_pendingEvents, - wxT("Please call wxApp::ProcessPendingEvents() instead") ); - - wxENTER_CRIT_SECT( Lock() ); - - // we leave the loop once we have processed all events that were present at - // the start of ProcessPendingEvents because otherwise we could get into - // infinite loop if the pending event handler execution resulted in another - // event being posted - size_t n = m_pendingEvents->size(); - for ( wxList::compatibility_iterator node = m_pendingEvents->GetFirst(); - node; - node = m_pendingEvents->GetFirst() ) - { - { - wxEventPtr event(wx_static_cast(wxEvent *, node->GetData())); - - // It's important we remove event from list before processing it. - // Else a nested event loop, for example from a modal dialog, might - // process the same event again. - - m_pendingEvents->Erase(node); - - wxLEAVE_CRIT_SECT( Lock() ); - - ProcessEvent(*event); - } // delete the event at this block exit, before re-locking our - // critical section, to avoid deadlocks if the event dtor locks - // something else itself (see #10790) - - wxENTER_CRIT_SECT( Lock() ); - - if ( --n == 0 ) - break; - } - - wxLEAVE_CRIT_SECT( Lock() ); -} - -/* - * Event table stuff - */ -/* static */ bool -wxEvtHandler::ProcessEventIfMatches(const wxEventTableEntryBase& entry, - wxEvtHandler *handler, - wxEvent& event) -{ - int tableId1 = entry.m_id, - tableId2 = entry.m_lastId; - - // match only if the event type is the same and the id is either -1 in - // the event table (meaning "any") or the event id matches the id - // specified in the event table either exactly or by falling into - // range between first and last - if ((tableId1 == wxID_ANY) || - (tableId2 == wxID_ANY && tableId1 == event.GetId()) || - (tableId2 != wxID_ANY && - (event.GetId() >= tableId1 && event.GetId() <= tableId2))) - { - event.Skip(false); - event.m_callbackUserData = entry.m_callbackUserData; - -#if wxUSE_EXCEPTIONS - if ( wxTheApp ) - { - // call the handler via wxApp method which allows the user to catch - // any exceptions which may be thrown by any handler in the program - // in one place - wxTheApp->HandleEvent(handler, (wxEventFunction)entry.m_fn, event); - } - else -#endif // wxUSE_EXCEPTIONS - { - // no need for an extra virtual function call - (handler->*((wxEventFunction) (entry.m_fn)))(event); - } - - if (!event.GetSkipped()) - return true; - } - - return false; -} - -bool wxEvtHandler::TryParent(wxEvent& event) -{ - if ( wxTheApp && (this != wxTheApp) ) - { - // Special case: don't pass wxEVT_IDLE to wxApp, since it'll always - // swallow it. wxEVT_IDLE is sent explicitly to wxApp so it will be - // processed appropriately via SearchEventTable. - if ( event.GetEventType() != wxEVT_IDLE ) - { - if ( wxTheApp->ProcessEvent(event) ) - return true; - } - } - - return false; -} - -bool wxEvtHandler::ProcessEvent(wxEvent& event) -{ - // allow the application to hook into event processing - if ( wxTheApp ) - { - int rc = wxTheApp->FilterEvent(event); - if ( rc != -1 ) - { - wxASSERT_MSG( rc == 1 || rc == 0, - _T("unexpected wxApp::FilterEvent return value") ); - - return rc != 0; - } - //else: proceed normally - } - - // An event handler can be enabled or disabled - if ( GetEvtHandlerEnabled() ) - { - // if we have a validator, it has higher priority than our own event - // table - if ( TryValidator(event) ) - return true; - - // Handle per-instance dynamic event tables first - if ( m_dynamicEvents && SearchDynamicEventTable(event) ) - return true; - - // Then static per-class event tables - if ( GetEventHashTable().HandleEvent(event, this) ) - return true; - } - - // Try going down the event handler chain - if ( GetNextHandler() ) - { - if ( GetNextHandler()->ProcessEvent(event) ) - return true; - } - - // Finally propagate the event upwards the window chain and/or to the - // application object as necessary - return TryParent(event); -} - - -bool wxEvtHandler::SearchEventTable(wxEventTable& table, wxEvent& event) -{ - const wxEventType eventType = event.GetEventType(); - for ( int i = 0; table.entries[i].m_fn != 0; i++ ) - { - const wxEventTableEntry& entry = table.entries[i]; - if ( eventType == entry.m_eventType ) - { - if ( ProcessEventIfMatches(entry, this, event) ) - return true; - } - } - - return false; -} - -void wxEvtHandler::Connect( int id, int lastId, - int eventType, - wxObjectEventFunction func, - wxObject *userData, - wxEvtHandler* eventSink ) -{ -#if WXWIN_COMPATIBILITY_EVENT_TYPES - wxEventTableEntry *entry = new wxEventTableEntry; - entry->m_eventType = eventType; - entry->m_id = id; - entry->m_lastId = lastId; - entry->m_fn = func; - entry->m_callbackUserData = userData; -#else // !WXWIN_COMPATIBILITY_EVENT_TYPES - wxDynamicEventTableEntry *entry = - new wxDynamicEventTableEntry(eventType, id, lastId, func, userData, eventSink); -#endif // WXWIN_COMPATIBILITY_EVENT_TYPES/!WXWIN_COMPATIBILITY_EVENT_TYPES - - if (!m_dynamicEvents) - m_dynamicEvents = new wxList; - - // Insert at the front of the list so most recent additions are found first - m_dynamicEvents->Insert( (wxObject*) entry ); -} - -bool wxEvtHandler::Disconnect( int id, int lastId, wxEventType eventType, - wxObjectEventFunction func, - wxObject *userData, - wxEvtHandler* eventSink ) -{ - if (!m_dynamicEvents) - return false; - - wxList::compatibility_iterator node = m_dynamicEvents->GetFirst(); - while (node) - { -#if WXWIN_COMPATIBILITY_EVENT_TYPES - wxEventTableEntry *entry = (wxEventTableEntry*)node->GetData(); -#else // !WXWIN_COMPATIBILITY_EVENT_TYPES - wxDynamicEventTableEntry *entry = (wxDynamicEventTableEntry*)node->GetData(); -#endif // WXWIN_COMPATIBILITY_EVENT_TYPES/!WXWIN_COMPATIBILITY_EVENT_TYPES - - if ((entry->m_id == id) && - ((entry->m_lastId == lastId) || (lastId == wxID_ANY)) && - ((entry->m_eventType == eventType) || (eventType == wxEVT_NULL)) && - ((entry->m_fn == func) || (func == (wxObjectEventFunction)NULL)) && - ((entry->m_eventSink == eventSink) || (eventSink == (wxEvtHandler*)NULL)) && - ((entry->m_callbackUserData == userData) || (userData == (wxObject*)NULL))) - { - if (entry->m_callbackUserData) - delete entry->m_callbackUserData; - m_dynamicEvents->Erase( node ); - delete entry; - return true; - } - node = node->GetNext(); - } - return false; -} - -bool wxEvtHandler::SearchDynamicEventTable( wxEvent& event ) -{ - wxCHECK_MSG( m_dynamicEvents, false, - wxT("caller should check that we have dynamic events") ); - - wxList::compatibility_iterator node = m_dynamicEvents->GetFirst(); - while (node) - { -#if WXWIN_COMPATIBILITY_EVENT_TYPES - wxEventTableEntry *entry = (wxEventTableEntry*)node->GetData(); -#else // !WXWIN_COMPATIBILITY_EVENT_TYPES - wxDynamicEventTableEntry *entry = (wxDynamicEventTableEntry*)node->GetData(); -#endif // WXWIN_COMPATIBILITY_EVENT_TYPES/!WXWIN_COMPATIBILITY_EVENT_TYPES - - // get next node before (maybe) calling the event handler as it could - // call Disconnect() invalidating the current node - node = node->GetNext(); - - if ((event.GetEventType() == entry->m_eventType) && (entry->m_fn != 0)) - { - wxEvtHandler *handler = -#if !WXWIN_COMPATIBILITY_EVENT_TYPES - entry->m_eventSink ? entry->m_eventSink - : -#endif - this; - - if ( ProcessEventIfMatches(*entry, handler, event) ) - { - return true; - } - } - } - - return false; -} - -void wxEvtHandler::DoSetClientObject( wxClientData *data ) -{ - wxASSERT_MSG( m_clientDataType != wxClientData_Void, - wxT("can't have both object and void client data") ); - - if ( m_clientObject ) - delete m_clientObject; - - m_clientObject = data; - m_clientDataType = wxClientData_Object; -} - -wxClientData *wxEvtHandler::DoGetClientObject() const -{ - // it's not an error to call GetClientObject() on a window which doesn't - // have client data at all - NULL will be returned - wxASSERT_MSG( m_clientDataType != wxClientData_Void, - wxT("this window doesn't have object client data") ); - - return m_clientObject; -} - -void wxEvtHandler::DoSetClientData( void *data ) -{ - wxASSERT_MSG( m_clientDataType != wxClientData_Object, - wxT("can't have both object and void client data") ); - - m_clientData = data; - m_clientDataType = wxClientData_Void; -} - -void *wxEvtHandler::DoGetClientData() const -{ - // it's not an error to call GetClientData() on a window which doesn't have - // client data at all - NULL will be returned - wxASSERT_MSG( m_clientDataType != wxClientData_Object, - wxT("this window doesn't have void client data") ); - - return m_clientData; -} - -#endif // wxUSE_BASE - -#if wxUSE_GUI - -// Find a window with the focus, that is also a descendant of the given window. -// This is used to determine the window to initially send commands to. -wxWindow* wxFindFocusDescendant(wxWindow* ancestor) -{ - // Process events starting with the window with the focus, if any. - wxWindow* focusWin = wxWindow::FindFocus(); - wxWindow* win = focusWin; - - // Check if this is a descendant of this frame. - // If not, win will be set to NULL. - while (win) - { - if (win == ancestor) - break; - else - win = win->GetParent(); - } - if (win == (wxWindow*) NULL) - focusWin = (wxWindow*) NULL; - - return focusWin; -} - -#endif // wxUSE_GUI diff --git a/wxWidgets/src/common/evtloopcmn.cpp b/wxWidgets/src/common/evtloopcmn.cpp deleted file mode 100644 index 00bc1001bb..0000000000 --- a/wxWidgets/src/common/evtloopcmn.cpp +++ /dev/null @@ -1,172 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: src/common/evtloopcmn.cpp -// Purpose: common wxEventLoop-related stuff -// Author: Vadim Zeitlin -// Modified by: -// Created: 2006-01-12 -// RCS-ID: $Id: evtloopcmn.cpp 45938 2007-05-10 02:07:41Z VZ $ -// Copyright: (c) 2006 Vadim Zeitlin -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -// for compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#include "wx/evtloop.h" - -#ifndef WX_PRECOMP - #include "wx/app.h" -#endif //WX_PRECOMP - -// see the comment near the declaration of wxRunningEventLoopCount in -// src/msw/thread.cpp for the explanation of this hack -#if defined(__WXMSW__) && wxUSE_THREADS - -extern WXDLLIMPEXP_DATA_BASE(int) wxRunningEventLoopCount; -struct wxRunningEventLoopCounter -{ - wxRunningEventLoopCounter() { wxRunningEventLoopCount++; } - ~wxRunningEventLoopCounter() { wxRunningEventLoopCount--; } -}; - -#endif // __WXMSW__ - -// ---------------------------------------------------------------------------- -// globals -// ---------------------------------------------------------------------------- - -wxEventLoop *wxEventLoopBase::ms_activeLoop = NULL; - -// wxEventLoopManual is unused in the other ports -#if defined(__WXMSW__) || defined(__WXMAC__) || defined(__WXDFB__) - -// ============================================================================ -// wxEventLoopManual implementation -// ============================================================================ - -wxEventLoopManual::wxEventLoopManual() -{ - m_exitcode = 0; - m_shouldExit = false; -} - -int wxEventLoopManual::Run() -{ - // event loops are not recursive, you need to create another loop! - wxCHECK_MSG( !IsRunning(), -1, _T("can't reenter a message loop") ); - - // ProcessIdle() and Dispatch() below may throw so the code here should - // be exception-safe, hence we must use local objects for all actions we - // should undo - wxEventLoopActivator activate(wx_static_cast(wxEventLoop *, this)); - -#if defined(__WXMSW__) && wxUSE_THREADS - wxRunningEventLoopCounter evtLoopCounter; -#endif // __WXMSW__ - - // we must ensure that OnExit() is called even if an exception is thrown - // from inside Dispatch() but we must call it from Exit() in normal - // situations because it is supposed to be called synchronously, - // wxModalEventLoop depends on this (so we can't just use ON_BLOCK_EXIT or - // something similar here) -#if wxUSE_EXCEPTIONS - for ( ;; ) - { - try - { -#endif // wxUSE_EXCEPTIONS - - // this is the event loop itself - for ( ;; ) - { - // give them the possibility to do whatever they want - OnNextIteration(); - - // generate and process idle events for as long as we don't - // have anything else to do - while ( !Pending() && (wxTheApp && wxTheApp->ProcessIdle()) ) - ; - - // if the "should exit" flag is set, the loop should terminate - // but not before processing any remaining messages so while - // Pending() returns true, do process them - if ( m_shouldExit ) - { - while ( Pending() ) - Dispatch(); - - break; - } - - // a message came or no more idle processing to do, sit in - // Dispatch() waiting for the next message - if ( !Dispatch() ) - { - // we got WM_QUIT - break; - } - } - -#if wxUSE_EXCEPTIONS - // exit the outer loop as well - break; - } - catch ( ... ) - { - try - { - if ( !wxTheApp || !wxTheApp->OnExceptionInMainLoop() ) - { - OnExit(); - break; - } - //else: continue running the event loop - } - catch ( ... ) - { - // OnException() throwed, possibly rethrowing the same - // exception again: very good, but we still need OnExit() to - // be called - OnExit(); - throw; - } - } - } -#endif // wxUSE_EXCEPTIONS - - return m_exitcode; -} - -void wxEventLoopManual::Exit(int rc) -{ - wxCHECK_RET( IsRunning(), _T("can't call Exit() if not running") ); - - m_exitcode = rc; - m_shouldExit = true; - - OnExit(); - - // all we have to do to exit from the loop is to (maybe) wake it up so that - // it can notice that Exit() had been called - // - // in particular, do *not* use here calls such as PostQuitMessage() (under - // MSW) which terminate the current event loop here because we're not sure - // that it is going to be processed by the correct event loop: it would be - // possible that another one is started and terminated by mistake if we do - // this - WakeUp(); -} - -#endif // __WXMSW__ || __WXMAC__ || __WXDFB__ diff --git a/wxWidgets/src/common/execcmn.cpp b/wxWidgets/src/common/execcmn.cpp deleted file mode 100644 index 2b2025270f..0000000000 --- a/wxWidgets/src/common/execcmn.cpp +++ /dev/null @@ -1,122 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: common/wxexec.cpp -// Purpose: defines wxStreamTempInputBuffer which is used by Unix and MSW -// implementations of wxExecute; this file is only used by the -// library and never by the user code -// Author: Vadim Zeitlin -// Modified by: -// Created: 20.08.02 -// RCS-ID: $Id: execcmn.cpp 35289 2005-08-23 23:12:48Z VZ $ -// Copyright: (c) 2002 Vadim Zeitlin -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_WXEXEC_CPP_ -#define _WX_WXEXEC_CPP_ - -// this file should never be compiled directly, just included by other code -#ifndef _WX_USED_BY_WXEXECUTE_ - #error "You should never directly build this file!" -#endif - -// ---------------------------------------------------------------------------- -// wxStreamTempInputBuffer -// ---------------------------------------------------------------------------- - -/* - wxStreamTempInputBuffer is a hack which we need to solve the problem of - executing a child process synchronously with IO redirecting: when we do - this, the child writes to a pipe we open to it but when the pipe buffer - (which has finite capacity, e.g. commonly just 4Kb) becomes full we have to - read data from it because the child blocks in its write() until then and if - it blocks we are never going to return from wxExecute() so we dead lock. - - So here is the fix: we now read the output as soon as it appears into a temp - buffer (wxStreamTempInputBuffer object) and later just stuff it back into - the stream when the process terminates. See supporting code in wxExecute() - itself as well. - - Note that this is horribly inefficient for large amounts of output (count - the number of times we copy the data around) and so a better API is badly - needed! However it's not easy to devise a way to do this keeping backwards - compatibility with the existing wxExecute(wxEXEC_SYNC)... -*/ - -class wxStreamTempInputBuffer -{ -public: - wxStreamTempInputBuffer(); - - // call to associate a stream with this buffer, otherwise nothing happens - // at all - void Init(wxPipeInputStream *stream); - - // check for input on our stream and cache it in our buffer if any - void Update(); - - ~wxStreamTempInputBuffer(); - -private: - // the stream we're buffering, if NULL we don't do anything at all - wxPipeInputStream *m_stream; - - // the buffer of size m_size (NULL if m_size == 0) - void *m_buffer; - - // the size of the buffer - size_t m_size; - - DECLARE_NO_COPY_CLASS(wxStreamTempInputBuffer) -}; - -inline wxStreamTempInputBuffer::wxStreamTempInputBuffer() -{ - m_stream = NULL; - m_buffer = NULL; - m_size = 0; -} - -inline void wxStreamTempInputBuffer::Init(wxPipeInputStream *stream) -{ - m_stream = stream; -} - -inline -void wxStreamTempInputBuffer::Update() -{ - if ( m_stream && m_stream->CanRead() ) - { - // realloc in blocks of 4Kb: this is the default (and minimal) buffer - // size of the Unix pipes so it should be the optimal step - // - // NB: don't use "static int" in this inline function, some compilers - // (e.g. IBM xlC) don't like it - enum { incSize = 4096 }; - - void *buf = realloc(m_buffer, m_size + incSize); - if ( !buf ) - { - // don't read any more, we don't have enough memory to do it - m_stream = NULL; - } - else // got memory for the buffer - { - m_buffer = buf; - m_stream->Read((char *)m_buffer + m_size, incSize); - m_size += m_stream->LastRead(); - } - } -} - -inline -wxStreamTempInputBuffer::~wxStreamTempInputBuffer() -{ - if ( m_buffer ) - { - m_stream->Ungetch(m_buffer, m_size); - free(m_buffer); - } -} - -#endif // _WX_WXEXEC_CPP_ - diff --git a/wxWidgets/src/common/extended.c b/wxWidgets/src/common/extended.c deleted file mode 100644 index 2f9df1b300..0000000000 --- a/wxWidgets/src/common/extended.c +++ /dev/null @@ -1,196 +0,0 @@ -/***************************************************************************** -** Name: extended.c -** Purpose: IEEE Extended<->Double routines to save floats to file -** Maintainer: Ryan Norton -** Modified by: -** Created: 11/24/04 -** RCS-ID: $Id: extended.c 36952 2006-01-18 10:25:04Z JS $ -*****************************************************************************/ - - -#if defined(_WIN32_WCE) - /* eVC cause warnings in its own headers: stdlib.h and winnt.h */ - #pragma warning (disable:4115) - #pragma warning (disable:4214) -#endif - -#include -#include -#include -#include -#include -#include "wx/defs.h" - -#if defined(_WIN32_WCE) - #pragma warning (default:4115) - #pragma warning (default:4214) -#endif - -#if wxUSE_APPLE_IEEE - -#include "wx/math.h" - -/* Copyright (C) 1989-1991 Ken Turkowski. - * - * All rights reserved. - * - * Warranty Information - * Even though I have reviewed this software, I make no warranty - * or representation, either express or implied, with respect to this - * software, its quality, accuracy, merchantability, or fitness for a - * particular purpose. As a result, this software is provided "as is," - * and you, its user, are assuming the entire risk as to its quality - * and accuracy. - * - * This code may be used and freely distributed as long as it includes - * this copyright notice and the above warranty information. - * - * Machine-independent I/O routines for IEEE floating-point numbers. - * - * NaN's and infinities are converted to HUGE_VAL or HUGE, which - * happens to be infinity on IEEE machines. Unfortunately, it is - * impossible to preserve NaN's in a machine-independent way. - * Infinities are, however, preserved on IEEE machines. - * - * These routines have been tested on the following machines: - * Apple Macintosh, MPW 3.1 C compiler - * Apple Macintosh, THINK C compiler - * Silicon Graphics IRIS, MIPS compiler - * Cray X/MP and Y/MP - * Digital Equipment VAX - * Sequent Balance (Multiprocesor 386) - * NeXT - * - * - * Implemented by Malcolm Slaney and Ken Turkowski. - * - * Malcolm Slaney contributions during 1988-1990 include big- and little- - * endian file I/O, conversion to and from Motorola's extended 80-bit - * floating-point format, and conversions to and from IEEE single- - * precision floating-point format. - * - * In 1991, Ken Turkowski implemented the conversions to and from - * IEEE double-precision format, added more precision to the extended - * conversions, and accommodated conversions involving +/- infinity, - * NaN's, and denormalized numbers. - */ - -#ifndef HUGE_VAL -# define HUGE_VAL HUGE -#endif /*HUGE_VAL*/ - - -/**************************************************************** - * The following two routines make up for deficiencies in many - * compilers to convert properly between unsigned integers and - * floating-point. Some compilers which have this bug are the - * THINK_C compiler for the Macintosh and the C compiler for the - * Silicon Graphics MIPS-based Iris. - ****************************************************************/ - -#ifdef applec /* The Apple C compiler works */ -# define FloatToUnsigned(f) ((wxUint32)(f)) -# define UnsignedToFloat(u) ((wxFloat64)(u)) -#else /*applec*/ -# define FloatToUnsigned(f) ((wxUint32)(((wxInt32)((f) - 2147483648.0)) + 2147483647L) + 1) -# define UnsignedToFloat(u) (((wxFloat64)((wxInt32)((u) - 2147483647L - 1))) + 2147483648.0) -#endif /*applec*/ - - - -/**************************************************************** - * Extended precision IEEE floating-point conversion routines. - * Extended is an 80-bit number as defined by Motorola, - * with a sign bit, 15 bits of exponent (offset 16383?), - * and a 64-bit mantissa, with no hidden bit. - ****************************************************************/ - -wxFloat64 ConvertFromIeeeExtended(const wxInt8 *bytes) -{ - wxFloat64 f; - wxInt32 expon; - wxUint32 hiMant, loMant; - - expon = ((bytes[0] & 0x7F) << 8) | (bytes[1] & 0xFF); - hiMant = ((wxUint32)(bytes[2] & 0xFF) << 24) - | ((wxUint32)(bytes[3] & 0xFF) << 16) - | ((wxUint32)(bytes[4] & 0xFF) << 8) - | ((wxUint32)(bytes[5] & 0xFF)); - loMant = ((wxUint32)(bytes[6] & 0xFF) << 24) - | ((wxUint32)(bytes[7] & 0xFF) << 16) - | ((wxUint32)(bytes[8] & 0xFF) << 8) - | ((wxUint32)(bytes[9] & 0xFF)); - - if (expon == 0 && hiMant == 0 && loMant == 0) { - f = 0; - } - else { - if (expon == 0x7FFF) { /* Infinity or NaN */ - f = HUGE_VAL; - } - else { - expon -= 16383; - f = ldexp(UnsignedToFloat(hiMant), expon-=31); - f += ldexp(UnsignedToFloat(loMant), expon-=32); - } - } - - if (bytes[0] & 0x80) - return -f; - else - return f; -} - - -/****************************************************************/ - - -void ConvertToIeeeExtended(wxFloat64 num, wxInt8 *bytes) -{ - wxInt32 sign; - wxInt32 expon; - wxFloat64 fMant, fsMant; - wxUint32 hiMant, loMant; - - if (num < 0) { - sign = 0x8000; - num *= -1; - } else { - sign = 0; - } - - if (num == 0) { - expon = 0; hiMant = 0; loMant = 0; - } - else { - fMant = frexp(num, &expon); - if ((expon > 16384) || !(fMant < 1)) { /* Infinity or NaN */ - expon = sign|0x7FFF; hiMant = 0; loMant = 0; /* infinity */ - } - else { /* Finite */ - expon += 16382; - if (expon < 0) { /* denormalized */ - fMant = ldexp(fMant, expon); - expon = 0; - } - expon |= sign; - fMant = ldexp(fMant, 32); fsMant = floor(fMant); hiMant = FloatToUnsigned(fsMant); - fMant = ldexp(fMant - fsMant, 32); fsMant = floor(fMant); loMant = FloatToUnsigned(fsMant); - } - } - - bytes[0] = expon >> 8; - bytes[1] = expon; - bytes[2] = hiMant >> 24; - bytes[3] = hiMant >> 16; - bytes[4] = hiMant >> 8; - bytes[5] = hiMant; - bytes[6] = loMant >> 24; - bytes[7] = loMant >> 16; - bytes[8] = loMant >> 8; - bytes[9] = loMant; -} - - - -#endif /* wxUSE_APPLE_IEEE */ diff --git a/wxWidgets/src/common/fddlgcmn.cpp b/wxWidgets/src/common/fddlgcmn.cpp deleted file mode 100644 index 64d9f91ccd..0000000000 --- a/wxWidgets/src/common/fddlgcmn.cpp +++ /dev/null @@ -1,102 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/common/fdrepdlg.cpp -// Purpose: common parts of wxFindReplaceDialog implementations -// Author: Vadim Zeitlin -// Modified by: -// Created: 01.08.01 -// RCS-ID: -// Copyright: (c) 2001 Vadim Zeitlin -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_FINDREPLDLG - -#ifndef WX_PRECOMP -#endif - -#include "wx/fdrepdlg.h" - -// ---------------------------------------------------------------------------- -// wxWin macros -// ---------------------------------------------------------------------------- - -IMPLEMENT_DYNAMIC_CLASS(wxFindDialogEvent, wxCommandEvent) - -DEFINE_EVENT_TYPE(wxEVT_COMMAND_FIND) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_FIND_NEXT) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_FIND_REPLACE) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_FIND_REPLACE_ALL) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_FIND_CLOSE) - -// ============================================================================ -// implementations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// wxFindReplaceData -// ---------------------------------------------------------------------------- - -void wxFindReplaceData::Init() -{ - m_Flags = 0; -} - -// ---------------------------------------------------------------------------- -// wxFindReplaceDialogBase -// ---------------------------------------------------------------------------- - -wxFindReplaceDialogBase::~wxFindReplaceDialogBase() -{ -} - -void wxFindReplaceDialogBase::Send(wxFindDialogEvent& event) -{ - // we copy the data to dialog->GetData() as well - - m_FindReplaceData->m_Flags = event.GetFlags(); - m_FindReplaceData->m_FindWhat = event.GetFindString(); - if ( HasFlag(wxFR_REPLACEDIALOG) && - (event.GetEventType() == wxEVT_COMMAND_FIND_REPLACE || - event.GetEventType() == wxEVT_COMMAND_FIND_REPLACE_ALL) ) - { - m_FindReplaceData->m_ReplaceWith = event.GetReplaceString(); - } - - // translate wxEVT_COMMAND_FIND_NEXT to wxEVT_COMMAND_FIND if needed - if ( event.GetEventType() == wxEVT_COMMAND_FIND_NEXT ) - { - if ( m_FindReplaceData->m_FindWhat != m_lastSearch ) - { - event.SetEventType(wxEVT_COMMAND_FIND); - - m_lastSearch = m_FindReplaceData->m_FindWhat; - } - } - - if ( !GetEventHandler()->ProcessEvent(event) ) - { - // the event is not propagated upwards to the parent automatically - // because the dialog is a top level window, so do it manually as - // in 9 cases of 10 the message must be processed by the dialog - // owner and not the dialog itself - (void)GetParent()->GetEventHandler()->ProcessEvent(event); - } -} - -#endif // wxUSE_FINDREPLDLG - diff --git a/wxWidgets/src/common/ffile.cpp b/wxWidgets/src/common/ffile.cpp deleted file mode 100644 index 92bc8ede9a..0000000000 --- a/wxWidgets/src/common/ffile.cpp +++ /dev/null @@ -1,256 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: ffile.cpp -// Purpose: wxFFile encapsulates "FILE *" IO stream -// Author: Vadim Zeitlin -// Modified by: -// Created: 14.07.99 -// RCS-ID: $Id: ffile.cpp 63300 2010-01-28 21:36:09Z MW $ -// Copyright: (c) 1998 Vadim Zeitlin -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_FFILE - -#ifndef WX_PRECOMP - #include "wx/intl.h" - #include "wx/log.h" -#endif - -#ifdef __WINDOWS__ -#include "wx/msw/mslu.h" -#endif - -#include "wx/ffile.h" - -// ============================================================================ -// implementation -// ============================================================================ - -// ---------------------------------------------------------------------------- -// opening the file -// ---------------------------------------------------------------------------- - -wxFFile::wxFFile(const wxChar *filename, const wxChar *mode) -{ - Detach(); - - (void)Open(filename, mode); -} - -bool wxFFile::Open(const wxChar *filename, const wxChar *mode) -{ - wxASSERT_MSG( !m_fp, wxT("should close or detach the old file first") ); - - m_fp = wxFopen(filename, mode); - - if ( !m_fp ) - { - wxLogSysError(_("can't open file '%s'"), filename); - - return false; - } - - m_name = filename; - - return true; -} - -bool wxFFile::Close() -{ - if ( IsOpened() ) - { - if ( fclose(m_fp) != 0 ) - { - wxLogSysError(_("can't close file '%s'"), m_name.c_str()); - - return false; - } - - Detach(); - } - - return true; -} - -// ---------------------------------------------------------------------------- -// read/write -// ---------------------------------------------------------------------------- - -bool wxFFile::ReadAll(wxString *str, const wxMBConv& conv) -{ - wxCHECK_MSG( str, false, wxT("invalid parameter") ); - wxCHECK_MSG( IsOpened(), false, wxT("can't read from closed file") ); - wxCHECK_MSG( Length() >= 0, false, wxT("invalid length") ); - size_t length = wx_truncate_cast(size_t, Length()); - wxCHECK_MSG( (wxFileOffset)length == Length(), false, wxT("huge file not supported") ); - - clearerr(m_fp); - - wxCharBuffer buf(length + 1); - - // note that real length may be less than file length for text files with DOS EOLs - // ('\r's get dropped by CRT when reading which means that we have - // realLen = fileLen - numOfLinesInTheFile) - length = fread(buf.data(), sizeof(char), length, m_fp); - - if ( Error() ) - { - wxLogSysError(_("Read error on file '%s'"), m_name.c_str()); - - return false; - } - - buf.data()[length] = 0; - *str = wxString(buf, conv); - - return true; -} - -size_t wxFFile::Read(void *pBuf, size_t nCount) -{ - wxCHECK_MSG( pBuf, 0, wxT("invalid parameter") ); - wxCHECK_MSG( IsOpened(), 0, wxT("can't read from closed file") ); - - size_t nRead = fread(pBuf, 1, nCount, m_fp); - if ( (nRead < nCount) && Error() ) - { - wxLogSysError(_("Read error on file '%s'"), m_name.c_str()); - } - - return nRead; -} - -size_t wxFFile::Write(const void *pBuf, size_t nCount) -{ - wxCHECK_MSG( pBuf, 0, wxT("invalid parameter") ); - wxCHECK_MSG( IsOpened(), 0, wxT("can't write to closed file") ); - - size_t nWritten = fwrite(pBuf, 1, nCount, m_fp); - if ( nWritten < nCount ) - { - wxLogSysError(_("Write error on file '%s'"), m_name.c_str()); - } - - return nWritten; -} - -bool wxFFile::Flush() -{ - if ( IsOpened() ) - { - // fflush returns non-zero on error - // - if ( fflush(m_fp) ) - { - wxLogSysError(_("failed to flush the file '%s'"), m_name.c_str()); - - return false; - } - } - - return true; -} - -// ---------------------------------------------------------------------------- -// seeking -// ---------------------------------------------------------------------------- - -bool wxFFile::Seek(wxFileOffset ofs, wxSeekMode mode) -{ - wxCHECK_MSG( IsOpened(), false, wxT("can't seek on closed file") ); - - int origin; - switch ( mode ) - { - default: - wxFAIL_MSG(wxT("unknown seek mode")); - // still fall through - - case wxFromStart: - origin = SEEK_SET; - break; - - case wxFromCurrent: - origin = SEEK_CUR; - break; - - case wxFromEnd: - origin = SEEK_END; - break; - } - -#ifndef wxHAS_LARGE_FFILES - if ((long)ofs != ofs) - { - wxLogError(_("Seek error on file '%s' (large files not supported by stdio)"), m_name.c_str()); - - return false; - } - - if ( wxFseek(m_fp, (long)ofs, origin) != 0 ) -#else - if ( wxFseek(m_fp, ofs, origin) != 0 ) -#endif - { - wxLogSysError(_("Seek error on file '%s'"), m_name.c_str()); - - return false; - } - - return true; -} - -wxFileOffset wxFFile::Tell() const -{ - wxCHECK_MSG( IsOpened(), wxInvalidOffset, - _T("wxFFile::Tell(): file is closed!") ); - - wxFileOffset rc = wxFtell(m_fp); - if ( rc == wxInvalidOffset ) - { - wxLogSysError(_("Can't find current position in file '%s'"), - m_name.c_str()); - } - - return rc; -} - -wxFileOffset wxFFile::Length() const -{ - wxCHECK_MSG( IsOpened(), wxInvalidOffset, - _T("wxFFile::Length(): file is closed!") ); - - wxFFile& self = *(wxFFile *)this; // const_cast - - wxFileOffset posOld = Tell(); - if ( posOld != wxInvalidOffset ) - { - if ( self.SeekEnd() ) - { - wxFileOffset len = Tell(); - - (void)self.Seek(posOld); - - return len; - } - } - - return wxInvalidOffset; -} - -#endif // wxUSE_FFILE diff --git a/wxWidgets/src/common/file.cpp b/wxWidgets/src/common/file.cpp deleted file mode 100644 index 26f0ce80de..0000000000 --- a/wxWidgets/src/common/file.cpp +++ /dev/null @@ -1,559 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: file.cpp -// Purpose: wxFile - encapsulates low-level "file descriptor" -// wxTempFile -// Author: Vadim Zeitlin -// Modified by: -// Created: 29/01/98 -// RCS-ID: $Id: file.cpp 42876 2006-10-31 23:29:02Z SN $ -// Copyright: (c) 1998 Vadim Zeitlin -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_FILE - -// standard -#if defined(__WXMSW__) && !defined(__GNUWIN32__) && !defined(__WXMICROWIN__) && !defined(__WXWINCE__) - -#ifndef __SALFORDC__ - #define WIN32_LEAN_AND_MEAN - #define NOSERVICE - #define NOIME - #define NOATOM - #define NOGDI - #define NOGDICAPMASKS - #define NOMETAFILE - #define NOMINMAX - #define NOMSG - #define NOOPENFILE - #define NORASTEROPS - #define NOSCROLL - #define NOSOUND - #define NOSYSMETRICS - #define NOTEXTMETRIC - #define NOWH - #define NOCOMM - #define NOKANJI - #define NOCRYPT - #define NOMCX -#endif - -#elif defined(__WXMSW__) && defined(__WXWINCE__) - #include "wx/msw/missing.h" -#elif (defined(__OS2__)) - #include -#elif (defined(__UNIX__) || defined(__GNUWIN32__)) - #include - #include - #include - #ifdef __GNUWIN32__ - #include "wx/msw/wrapwin.h" - #endif -#elif defined(__DOS__) - #if defined(__WATCOMC__) - #include - #elif defined(__DJGPP__) - #include - #include - #include - #else - #error "Please specify the header with file functions declarations." - #endif -#elif (defined(__WXSTUBS__)) - // Have to ifdef this for different environments - #include -#elif (defined(__WXMAC__)) -#if __MSL__ < 0x6000 - int access( const char *path, int mode ) { return 0 ; } -#else - int _access( const char *path, int mode ) { return 0 ; } -#endif - char* mktemp( char * path ) { return path ;} - #include - #include -#else - #error "Please specify the header with file functions declarations." -#endif //Win/UNIX - -#include // SEEK_xxx constants - -// Windows compilers don't have these constants -#ifndef W_OK - enum - { - F_OK = 0, // test for existence - X_OK = 1, // execute permission - W_OK = 2, // write - R_OK = 4 // read - }; -#endif // W_OK - -#ifdef __SALFORDC__ - #include -#endif - -// some broken compilers don't have 3rd argument in open() and creat() -#ifdef __SALFORDC__ - #define ACCESS(access) - #define stat _stat -#else // normal compiler - #define ACCESS(access) , (access) -#endif // Salford C - -// wxWidgets -#ifndef WX_PRECOMP - #include "wx/string.h" - #include "wx/intl.h" - #include "wx/log.h" -#endif // !WX_PRECOMP - -#include "wx/filename.h" -#include "wx/file.h" -#include "wx/filefn.h" - -// there is no distinction between text and binary files under Unix, so define -// O_BINARY as 0 if the system headers don't do it already -#if defined(__UNIX__) && !defined(O_BINARY) - #define O_BINARY (0) -#endif //__UNIX__ - -#ifdef __WXMSW__ - #include "wx/msw/mslu.h" -#endif - -#ifdef __WXWINCE__ - #include "wx/msw/private.h" -#endif - -#ifndef MAX_PATH - #define MAX_PATH 512 -#endif - -// ============================================================================ -// implementation of wxFile -// ============================================================================ - -// ---------------------------------------------------------------------------- -// static functions -// ---------------------------------------------------------------------------- - -bool wxFile::Exists(const wxChar *name) -{ - return wxFileExists(name); -} - -bool wxFile::Access(const wxChar *name, OpenMode mode) -{ - int how; - - switch ( mode ) - { - default: - wxFAIL_MSG(wxT("bad wxFile::Access mode parameter.")); - // fall through - - case read: - how = R_OK; - break; - - case write: - how = W_OK; - break; - - case read_write: - how = R_OK | W_OK; - break; - } - - return wxAccess(name, how) == 0; -} - -// ---------------------------------------------------------------------------- -// opening/closing -// ---------------------------------------------------------------------------- - -// ctors -wxFile::wxFile(const wxChar *szFileName, OpenMode mode) -{ - m_fd = fd_invalid; - m_error = false; - - Open(szFileName, mode); -} - -// create the file, fail if it already exists and bOverwrite -bool wxFile::Create(const wxChar *szFileName, bool bOverwrite, int accessMode) -{ - // if bOverwrite we create a new file or truncate the existing one, - // otherwise we only create the new file and fail if it already exists -#if defined(__WXMAC__) && !defined(__UNIX__) && !wxUSE_UNICODE - // Dominic Mazzoni [dmazzoni+@cs.cmu.edu] reports that open is still broken on the mac, so we replace - // int fd = open( szFileName , O_CREAT | (bOverwrite ? O_TRUNC : O_EXCL), access); - int fd = creat( szFileName , accessMode); -#else - int fd = wxOpen( szFileName, - O_BINARY | O_WRONLY | O_CREAT | - (bOverwrite ? O_TRUNC : O_EXCL) - ACCESS(accessMode) ); -#endif - if ( fd == -1 ) - { - wxLogSysError(_("can't create file '%s'"), szFileName); - return false; - } - - Attach(fd); - return true; -} - -// open the file -bool wxFile::Open(const wxChar *szFileName, OpenMode mode, int accessMode) -{ - int flags = O_BINARY; - - switch ( mode ) - { - case read: - flags |= O_RDONLY; - break; - - case write_append: - if ( wxFile::Exists(szFileName) ) - { - flags |= O_WRONLY | O_APPEND; - break; - } - //else: fall through as write_append is the same as write if the - // file doesn't exist - - case write: - flags |= O_WRONLY | O_CREAT | O_TRUNC; - break; - - case write_excl: - flags |= O_WRONLY | O_CREAT | O_EXCL; - break; - - case read_write: - flags |= O_RDWR; - break; - } - -#ifdef __WINDOWS__ - // only read/write bits for "all" are supported by this function under - // Windows, and VC++ 8 returns EINVAL if any other bits are used in - // accessMode, so clear them as they have at best no effect anyhow - accessMode &= wxS_IRUSR | wxS_IWUSR; -#endif // __WINDOWS__ - - int fd = wxOpen( szFileName, flags ACCESS(accessMode)); - - if ( fd == -1 ) - { - wxLogSysError(_("can't open file '%s'"), szFileName); - return false; - } - - Attach(fd); - return true; -} - -// close -bool wxFile::Close() -{ - if ( IsOpened() ) { - if (wxClose(m_fd) == -1) - { - wxLogSysError(_("can't close file descriptor %d"), m_fd); - m_fd = fd_invalid; - return false; - } - else - m_fd = fd_invalid; - } - - return true; -} - -// ---------------------------------------------------------------------------- -// read/write -// ---------------------------------------------------------------------------- - -// read -ssize_t wxFile::Read(void *pBuf, size_t nCount) -{ - wxCHECK( (pBuf != NULL) && IsOpened(), 0 ); - - ssize_t iRc = wxRead(m_fd, pBuf, nCount); - - if ( iRc == -1 ) - { - wxLogSysError(_("can't read from file descriptor %d"), m_fd); - return wxInvalidOffset; - } - - return iRc; -} - -// write -size_t wxFile::Write(const void *pBuf, size_t nCount) -{ - wxCHECK( (pBuf != NULL) && IsOpened(), 0 ); - - ssize_t iRc = wxWrite(m_fd, pBuf, nCount); - - if ( iRc == -1 ) - { - wxLogSysError(_("can't write to file descriptor %d"), m_fd); - m_error = true; - iRc = 0; - } - - return iRc; -} - -// flush -bool wxFile::Flush() -{ -#ifdef HAVE_FSYNC - // fsync() only works on disk files and returns errors for pipes, don't - // call it then - if ( IsOpened() && GetKind() == wxFILE_KIND_DISK ) - { - if ( wxFsync(m_fd) == -1 ) - { - wxLogSysError(_("can't flush file descriptor %d"), m_fd); - return false; - } - } -#endif // HAVE_FSYNC - - return true; -} - -// ---------------------------------------------------------------------------- -// seek -// ---------------------------------------------------------------------------- - -// seek -wxFileOffset wxFile::Seek(wxFileOffset ofs, wxSeekMode mode) -{ - wxASSERT_MSG( IsOpened(), _T("can't seek on closed file") ); - wxCHECK_MSG( ofs != wxInvalidOffset || mode != wxFromStart, - wxInvalidOffset, - _T("invalid absolute file offset") ); - - int origin; - switch ( mode ) { - default: - wxFAIL_MSG(_("unknown seek origin")); - - case wxFromStart: - origin = SEEK_SET; - break; - - case wxFromCurrent: - origin = SEEK_CUR; - break; - - case wxFromEnd: - origin = SEEK_END; - break; - } - - wxFileOffset iRc = wxSeek(m_fd, ofs, origin); - if ( iRc == wxInvalidOffset ) - { - wxLogSysError(_("can't seek on file descriptor %d"), m_fd); - } - - return iRc; -} - -// get current file offset -wxFileOffset wxFile::Tell() const -{ - wxASSERT( IsOpened() ); - - wxFileOffset iRc = wxTell(m_fd); - if ( iRc == wxInvalidOffset ) - { - wxLogSysError(_("can't get seek position on file descriptor %d"), m_fd); - } - - return iRc; -} - -// get current file length -wxFileOffset wxFile::Length() const -{ - wxASSERT( IsOpened() ); - - wxFileOffset iRc = Tell(); - if ( iRc != wxInvalidOffset ) { - // have to use const_cast :-( - wxFileOffset iLen = ((wxFile *)this)->SeekEnd(); - if ( iLen != wxInvalidOffset ) { - // restore old position - if ( ((wxFile *)this)->Seek(iRc) == wxInvalidOffset ) { - // error - iLen = wxInvalidOffset; - } - } - - iRc = iLen; - } - - if ( iRc == wxInvalidOffset ) - { - wxLogSysError(_("can't find length of file on file descriptor %d"), m_fd); - } - - return iRc; -} - -// is end of file reached? -bool wxFile::Eof() const -{ - wxASSERT( IsOpened() ); - - wxFileOffset iRc; - -#if defined(__DOS__) || defined(__UNIX__) || defined(__GNUWIN32__) || defined( __MWERKS__ ) || defined(__SALFORDC__) - // @@ this doesn't work, of course, on unseekable file descriptors - wxFileOffset ofsCur = Tell(), - ofsMax = Length(); - if ( ofsCur == wxInvalidOffset || ofsMax == wxInvalidOffset ) - iRc = wxInvalidOffset; - else - iRc = ofsCur == ofsMax; -#else // Windows and "native" compiler - iRc = wxEof(m_fd); -#endif // Windows/Unix - - if ( iRc == 1) - {} - else if ( iRc == 0 ) - return false; - else if ( iRc == wxInvalidOffset ) - wxLogSysError(_("can't determine if the end of file is reached on descriptor %d"), m_fd); - else - wxFAIL_MSG(_("invalid eof() return value.")); - - return true; -} - -// ============================================================================ -// implementation of wxTempFile -// ============================================================================ - -// ---------------------------------------------------------------------------- -// construction -// ---------------------------------------------------------------------------- - -wxTempFile::wxTempFile(const wxString& strName) -{ - Open(strName); -} - -bool wxTempFile::Open(const wxString& strName) -{ - // we must have an absolute filename because otherwise CreateTempFileName() - // would create the temp file in $TMP (i.e. the system standard location - // for the temp files) which might be on another volume/drive/mount and - // wxRename()ing it later to m_strName from Commit() would then fail - // - // with the absolute filename, the temp file is created in the same - // directory as this one which ensures that wxRename() may work later - wxFileName fn(strName); - if ( !fn.IsAbsolute() ) - { - fn.Normalize(wxPATH_NORM_ABSOLUTE); - } - - m_strName = fn.GetFullPath(); - - m_strTemp = wxFileName::CreateTempFileName(m_strName, &m_file); - - if ( m_strTemp.empty() ) - { - // CreateTempFileName() failed - return false; - } - -#ifdef __UNIX__ - // the temp file should have the same permissions as the original one - mode_t mode; - - wxStructStat st; - if ( stat( (const char*) m_strName.fn_str(), &st) == 0 ) - { - mode = st.st_mode; - } - else - { - // file probably didn't exist, just give it the default mode _using_ - // user's umask (new files creation should respect umask) - mode_t mask = umask(0777); - mode = 0666 & ~mask; - umask(mask); - } - - if ( chmod( (const char*) m_strTemp.fn_str(), mode) == -1 ) - { -#ifndef __OS2__ - wxLogSysError(_("Failed to set temporary file permissions")); -#endif - } -#endif // Unix - - return true; -} - -// ---------------------------------------------------------------------------- -// destruction -// ---------------------------------------------------------------------------- - -wxTempFile::~wxTempFile() -{ - if ( IsOpened() ) - Discard(); -} - -bool wxTempFile::Commit() -{ - m_file.Close(); - - if ( wxFile::Exists(m_strName) && wxRemove(m_strName) != 0 ) { - wxLogSysError(_("can't remove file '%s'"), m_strName.c_str()); - return false; - } - - if ( !wxRenameFile(m_strTemp, m_strName) ) { - wxLogSysError(_("can't commit changes to file '%s'"), m_strName.c_str()); - return false; - } - - return true; -} - -void wxTempFile::Discard() -{ - m_file.Close(); - if ( wxRemove(m_strTemp) != 0 ) - wxLogSysError(_("can't remove temporary file '%s'"), m_strTemp.c_str()); -} - -#endif // wxUSE_FILE - diff --git a/wxWidgets/src/common/fileback.cpp b/wxWidgets/src/common/fileback.cpp deleted file mode 100644 index ccce957bfb..0000000000 --- a/wxWidgets/src/common/fileback.cpp +++ /dev/null @@ -1,338 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/common/fileback.cpp -// Purpose: Back an input stream with memory or a file -// Author: Mike Wetherell -// RCS-ID: $Id: fileback.cpp 42651 2006-10-29 20:06:45Z MW $ -// Copyright: (c) 2006 Mike Wetherell -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_FILESYSTEM - -#include "wx/private/fileback.h" - -#ifndef WX_PRECOMP - #include "wx/utils.h" - #include "wx/log.h" -#endif - -#include "wx/private/filename.h" - -// Prefer wxFFile unless wxFile has large file support but wxFFile does not. -// -#if wxUSE_FFILE && (defined wxHAS_LARGE_FFILES || !defined wxHAS_LARGE_FILES) -typedef wxFFile wxBFFile; -static const bool wxBadSeek = false; -#else -typedef wxFile wxBFFile; -static const wxFileOffset wxBadSeek = wxInvalidOffset; -#endif - -///////////////////////////////////////////////////////////////////////////// -// Backing file implementation - -class wxBackingFileImpl -{ -public: - wxBackingFileImpl(wxInputStream *stream, - size_t bufsize, - const wxString& prefix); - ~wxBackingFileImpl(); - - void Release() { if (--m_refcount == 0) delete this; } - wxBackingFileImpl *AddRef() { m_refcount++; return this; } - - wxStreamError ReadAt(wxFileOffset pos, void *buffer, size_t *size); - wxFileOffset GetLength() const; - -private: - int m_refcount; - - wxInputStream *m_stream; - wxStreamError m_parenterror; - - char *m_buf; - size_t m_bufsize; - size_t m_buflen; - - wxString m_prefix; - wxString m_filename; - wxBFFile m_file; - wxFileOffset m_filelen; -}; - -wxBackingFileImpl::wxBackingFileImpl(wxInputStream *stream, - size_t bufsize, - const wxString& prefix) - : m_refcount(1), - m_stream(stream), - m_parenterror(wxSTREAM_NO_ERROR), - m_buf(NULL), - m_bufsize(bufsize), - m_buflen(0), - m_prefix(prefix), - m_filelen(0) -{ - wxFileOffset len = m_stream->GetLength(); - - if (len >= 0 && len + size_t(1) < m_bufsize) - m_bufsize = size_t(len + 1); - - if (m_bufsize) - m_buf = new char[m_bufsize]; -} - -wxBackingFileImpl::~wxBackingFileImpl() -{ - delete m_stream; - delete [] m_buf; - - if (!m_filename.empty()) - wxRemoveFile(m_filename); -} - -wxStreamError wxBackingFileImpl::ReadAt(wxFileOffset pos, - void *buffer, - size_t *size) -{ - size_t reqestedSize = *size; - *size = 0; - - // size1 is the number of bytes it will read directly from the backing - // file. size2 is any remaining bytes not yet backed, these are returned - // from the buffer or read from the parent stream. - size_t size1, size2; - - if (pos + reqestedSize <= m_filelen + size_t(0)) { - size1 = reqestedSize; - size2 = 0; - } else if (pos < m_filelen) { - size1 = size_t(m_filelen - pos); - size2 = reqestedSize - size1; - } else { - size1 = 0; - size2 = reqestedSize; - } - - if (pos < 0) - return wxSTREAM_READ_ERROR; - - // read the backing file - if (size1) { - if (m_file.Seek(pos) == wxBadSeek) - return wxSTREAM_READ_ERROR; - - ssize_t n = m_file.Read(buffer, size1); - if (n > 0) { - *size = n; - pos += n; - } - - if (*size < size1) - return wxSTREAM_READ_ERROR; - } - - // read from the buffer or parent stream - if (size2) - { - while (*size < reqestedSize) - { - // if pos is further ahead than the parent has been read so far, - // then read forward in the parent stream - while (pos - m_filelen + size_t(0) >= m_buflen) - { - // if the parent is small enough, don't use a backing file - // just the buffer memory - if (!m_stream && m_filelen == 0) - return m_parenterror; - - // before refilling the buffer write out the current buffer - // to the backing file if there is anything in it - if (m_buflen) - { - if (!m_file.IsOpened()) - if (!wxCreateTempFile(m_prefix, &m_file, &m_filename)) - return wxSTREAM_READ_ERROR; - - if (m_file.Seek(m_filelen) == wxBadSeek) - return wxSTREAM_READ_ERROR; - - size_t count = m_file.Write(m_buf, m_buflen); - m_filelen += count; - - if (count < m_buflen) { - delete m_stream; - m_stream = NULL; - if (count > 0) { - delete[] m_buf; - m_buf = NULL; - m_buflen = 0; - } - m_parenterror = wxSTREAM_READ_ERROR; - return m_parenterror; - } - - m_buflen = 0; - - if (!m_stream) { - delete[] m_buf; - m_buf = NULL; - } - } - - if (!m_stream) - return m_parenterror; - - // refill buffer - m_buflen = m_stream->Read(m_buf, m_bufsize).LastRead(); - - if (m_buflen < m_bufsize) { - m_parenterror = m_stream->GetLastError(); - if (m_parenterror == wxSTREAM_NO_ERROR) - m_parenterror = wxSTREAM_EOF; - delete m_stream; - m_stream = NULL; - } - } - - // copy to the user's buffer - size_t start = size_t(pos - m_filelen); - size_t len = wxMin(m_buflen - start, reqestedSize - *size); - - memcpy((char*)buffer + *size, m_buf + start, len); - *size += len; - pos += len; - } - } - - return wxSTREAM_NO_ERROR; -} - -wxFileOffset wxBackingFileImpl::GetLength() const -{ - if (m_parenterror != wxSTREAM_EOF) { - wxLogNull nolog; - return m_stream->GetLength(); - } - return m_filelen + m_buflen; -} - - -///////////////////////////////////////////////////////////////////////////// -// Backing File, the handle part - -wxBackingFile::wxBackingFile(wxInputStream *stream, - size_t bufsize, - const wxString& prefix) - : m_impl(new wxBackingFileImpl(stream, bufsize, prefix)) -{ -} - -wxBackingFile::wxBackingFile(const wxBackingFile& backer) - : m_impl(backer.m_impl ? backer.m_impl->AddRef() : NULL) -{ -} - -wxBackingFile& wxBackingFile::operator=(const wxBackingFile& backer) -{ - if (backer.m_impl != m_impl) { - if (m_impl) - m_impl->Release(); - - m_impl = backer.m_impl; - - if (m_impl) - m_impl->AddRef(); - } - - return *this; -} - -wxBackingFile::~wxBackingFile() -{ - if (m_impl) - m_impl->Release(); -} - - -///////////////////////////////////////////////////////////////////////////// -// Input stream - -wxBackedInputStream::wxBackedInputStream(const wxBackingFile& backer) - : m_backer(backer), - m_pos(0) -{ -} - -wxFileOffset wxBackedInputStream::GetLength() const -{ - return m_backer.m_impl->GetLength(); -} - -wxFileOffset wxBackedInputStream::FindLength() const -{ - wxFileOffset len = GetLength(); - - if (len == wxInvalidOffset && IsOk()) { - // read a byte at 7ff...ffe - wxFileOffset pos = 1; - pos <<= sizeof(pos) * 8 - 1; - pos = ~pos - 1; - char ch; - size_t size = 1; - m_backer.m_impl->ReadAt(pos, &ch, &size); - len = GetLength(); - } - - return len; -} - -size_t wxBackedInputStream::OnSysRead(void *buffer, size_t size) -{ - if (!IsOk()) - return 0; - - m_lasterror = m_backer.m_impl->ReadAt(m_pos, buffer, &size); - m_pos += size; - return size; -} - -wxFileOffset wxBackedInputStream::OnSysSeek(wxFileOffset pos, wxSeekMode mode) -{ - switch (mode) { - case wxFromCurrent: - { - m_pos += pos; - break; - } - case wxFromEnd: - { - wxFileOffset len = GetLength(); - if (len == wxInvalidOffset) - return wxInvalidOffset; - m_pos = len + pos; - break; - } - default: - { - m_pos = pos; - break; - } - } - - return m_pos; -} - -wxFileOffset wxBackedInputStream::OnSysTell() const -{ - return m_pos; -} - -#endif // wxUSE_FILESYSTEM diff --git a/wxWidgets/src/common/fileconf.cpp b/wxWidgets/src/common/fileconf.cpp deleted file mode 100644 index c85ebe894f..0000000000 --- a/wxWidgets/src/common/fileconf.cpp +++ /dev/null @@ -1,2131 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: src/common/fileconf.cpp -// Purpose: implementation of wxFileConfig derivation of wxConfig -// Author: Vadim Zeitlin -// Modified by: -// Created: 07.04.98 (adapted from appconf.cpp) -// RCS-ID: $Id: fileconf.cpp 50711 2007-12-15 02:57:58Z VZ $ -// Copyright: (c) 1997 Karsten Ballueder & Vadim Zeitlin -// Ballueder@usa.net -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif //__BORLANDC__ - -#if wxUSE_CONFIG && wxUSE_FILECONFIG - -#ifndef WX_PRECOMP - #include "wx/dynarray.h" - #include "wx/string.h" - #include "wx/intl.h" - #include "wx/log.h" - #include "wx/app.h" - #include "wx/utils.h" // for wxGetHomeDir - #if wxUSE_STREAMS - #include "wx/stream.h" - #endif // wxUSE_STREAMS -#endif //WX_PRECOMP - -#include "wx/file.h" -#include "wx/textfile.h" -#include "wx/memtext.h" -#include "wx/config.h" -#include "wx/fileconf.h" -#include "wx/filefn.h" - -#if defined(__WXMAC__) - #include "wx/mac/private.h" // includes mac headers - #include "wx/filename.h" // for MacSetTypeAndCreator -#endif - -#if defined(__WXMSW__) - #include "wx/msw/private.h" -#endif //windows.h -#if defined(__WXPM__) - #define INCL_DOS - #include -#endif - -#include -#include - -// ---------------------------------------------------------------------------- -// macros -// ---------------------------------------------------------------------------- -#define CONST_CAST ((wxFileConfig *)this)-> - -// ---------------------------------------------------------------------------- -// constants -// ---------------------------------------------------------------------------- - -#ifndef MAX_PATH - #define MAX_PATH 512 -#endif - -#define FILECONF_TRACE_MASK _T("fileconf") - -// ---------------------------------------------------------------------------- -// global functions declarations -// ---------------------------------------------------------------------------- - -// compare functions for sorting the arrays -static int LINKAGEMODE CompareEntries(wxFileConfigEntry *p1, wxFileConfigEntry *p2); -static int LINKAGEMODE CompareGroups(wxFileConfigGroup *p1, wxFileConfigGroup *p2); - -// filter strings -static wxString FilterInValue(const wxString& str); -static wxString FilterOutValue(const wxString& str); - -static wxString FilterInEntryName(const wxString& str); -static wxString FilterOutEntryName(const wxString& str); - -// get the name to use in wxFileConfig ctor -static wxString GetAppName(const wxString& appname); - -// ============================================================================ -// private classes -// ============================================================================ - -// ---------------------------------------------------------------------------- -// "template" array types -// ---------------------------------------------------------------------------- - -#ifdef WXMAKINGDLL_BASE - WX_DEFINE_SORTED_USER_EXPORTED_ARRAY(wxFileConfigEntry *, ArrayEntries, - WXDLLIMPEXP_BASE); - WX_DEFINE_SORTED_USER_EXPORTED_ARRAY(wxFileConfigGroup *, ArrayGroups, - WXDLLIMPEXP_BASE); -#else - WX_DEFINE_SORTED_ARRAY(wxFileConfigEntry *, ArrayEntries); - WX_DEFINE_SORTED_ARRAY(wxFileConfigGroup *, ArrayGroups); -#endif - -// ---------------------------------------------------------------------------- -// wxFileConfigLineList -// ---------------------------------------------------------------------------- - -// we store all lines of the local config file as a linked list in memory -class wxFileConfigLineList -{ -public: - void SetNext(wxFileConfigLineList *pNext) { m_pNext = pNext; } - void SetPrev(wxFileConfigLineList *pPrev) { m_pPrev = pPrev; } - - // ctor - wxFileConfigLineList(const wxString& str, - wxFileConfigLineList *pNext = NULL) : m_strLine(str) - { SetNext(pNext); SetPrev(NULL); } - - // next/prev nodes in the linked list - wxFileConfigLineList *Next() const { return m_pNext; } - wxFileConfigLineList *Prev() const { return m_pPrev; } - - // get/change lines text - void SetText(const wxString& str) { m_strLine = str; } - const wxString& Text() const { return m_strLine; } - -private: - wxString m_strLine; // line contents - wxFileConfigLineList *m_pNext, // next node - *m_pPrev; // previous one - - DECLARE_NO_COPY_CLASS(wxFileConfigLineList) -}; - -// ---------------------------------------------------------------------------- -// wxFileConfigEntry: a name/value pair -// ---------------------------------------------------------------------------- - -class wxFileConfigEntry -{ -private: - wxFileConfigGroup *m_pParent; // group that contains us - - wxString m_strName, // entry name - m_strValue; // value - bool m_bImmutable:1, // can be overriden locally? - m_bHasValue:1; // set after first call to SetValue() - - int m_nLine; // used if m_pLine == NULL only - - // pointer to our line in the linked list or NULL if it was found in global - // file (which we don't modify) - wxFileConfigLineList *m_pLine; - -public: - wxFileConfigEntry(wxFileConfigGroup *pParent, - const wxString& strName, int nLine); - - // simple accessors - const wxString& Name() const { return m_strName; } - const wxString& Value() const { return m_strValue; } - wxFileConfigGroup *Group() const { return m_pParent; } - bool IsImmutable() const { return m_bImmutable; } - bool IsLocal() const { return m_pLine != 0; } - int Line() const { return m_nLine; } - wxFileConfigLineList * - GetLine() const { return m_pLine; } - - // modify entry attributes - void SetValue(const wxString& strValue, bool bUser = true); - void SetLine(wxFileConfigLineList *pLine); - - DECLARE_NO_COPY_CLASS(wxFileConfigEntry) -}; - -// ---------------------------------------------------------------------------- -// wxFileConfigGroup: container of entries and other groups -// ---------------------------------------------------------------------------- - -class wxFileConfigGroup -{ -private: - wxFileConfig *m_pConfig; // config object we belong to - wxFileConfigGroup *m_pParent; // parent group (NULL for root group) - ArrayEntries m_aEntries; // entries in this group - ArrayGroups m_aSubgroups; // subgroups - wxString m_strName; // group's name - wxFileConfigLineList *m_pLine; // pointer to our line in the linked list - wxFileConfigEntry *m_pLastEntry; // last entry/subgroup of this group in the - wxFileConfigGroup *m_pLastGroup; // local file (we insert new ones after it) - - // DeleteSubgroupByName helper - bool DeleteSubgroup(wxFileConfigGroup *pGroup); - - // used by Rename() - void UpdateGroupAndSubgroupsLines(); - -public: - // ctor - wxFileConfigGroup(wxFileConfigGroup *pParent, const wxString& strName, wxFileConfig *); - - // dtor deletes all entries and subgroups also - ~wxFileConfigGroup(); - - // simple accessors - const wxString& Name() const { return m_strName; } - wxFileConfigGroup *Parent() const { return m_pParent; } - wxFileConfig *Config() const { return m_pConfig; } - - const ArrayEntries& Entries() const { return m_aEntries; } - const ArrayGroups& Groups() const { return m_aSubgroups; } - bool IsEmpty() const { return Entries().IsEmpty() && Groups().IsEmpty(); } - - // find entry/subgroup (NULL if not found) - wxFileConfigGroup *FindSubgroup(const wxChar *szName) const; - wxFileConfigEntry *FindEntry (const wxChar *szName) const; - - // delete entry/subgroup, return false if doesn't exist - bool DeleteSubgroupByName(const wxChar *szName); - bool DeleteEntry(const wxChar *szName); - - // create new entry/subgroup returning pointer to newly created element - wxFileConfigGroup *AddSubgroup(const wxString& strName); - wxFileConfigEntry *AddEntry (const wxString& strName, int nLine = wxNOT_FOUND); - - void SetLine(wxFileConfigLineList *pLine); - - // rename: no checks are done to ensure that the name is unique! - void Rename(const wxString& newName); - - // - wxString GetFullName() const; - - // get the last line belonging to an entry/subgroup of this group - wxFileConfigLineList *GetGroupLine(); // line which contains [group] - // may be NULL for "/" only - wxFileConfigLineList *GetLastEntryLine(); // after which our subgroups start - wxFileConfigLineList *GetLastGroupLine(); // after which the next group starts - - // called by entries/subgroups when they're created/deleted - void SetLastEntry(wxFileConfigEntry *pEntry); - void SetLastGroup(wxFileConfigGroup *pGroup) - { m_pLastGroup = pGroup; } - - DECLARE_NO_COPY_CLASS(wxFileConfigGroup) -}; - -// ============================================================================ -// implementation -// ============================================================================ - -// ---------------------------------------------------------------------------- -// static functions -// ---------------------------------------------------------------------------- -wxString wxFileConfig::GetGlobalDir() -{ - wxString strDir; - -#ifdef __VMS__ // Note if __VMS is defined __UNIX is also defined - strDir = wxT("sys$manager:"); -#elif defined(__WXMAC__) - strDir = wxMacFindFolder( (short) kOnSystemDisk, kPreferencesFolderType, kDontCreateFolder ) ; -#elif defined( __UNIX__ ) - strDir = wxT("/etc/"); -#elif defined(__OS2__) - ULONG aulSysInfo[QSV_MAX] = {0}; - UINT drive; - APIRET rc; - - rc = DosQuerySysInfo( 1L, QSV_MAX, (PVOID)aulSysInfo, sizeof(ULONG)*QSV_MAX); - if (rc == 0) - { - drive = aulSysInfo[QSV_BOOT_DRIVE - 1]; - strDir.Printf(wxT("%c:\\OS2\\"), 'A'+drive-1); - } -#elif defined(__WXSTUBS__) - wxFAIL_MSG( wxT("TODO") ); -#elif defined(__DOS__) - // There's no such thing as global cfg dir in MS-DOS, let's return - // current directory (FIXME_MGL?) - strDir = wxT(".\\"); -#elif defined(__WXWINCE__) - strDir = wxT("\\Windows\\"); -#else // Windows - - wxChar szWinDir[MAX_PATH]; - ::GetWindowsDirectory(szWinDir, MAX_PATH); - - strDir = szWinDir; - strDir << wxT('\\'); -#endif // Unix/Windows - - return strDir; -} - -wxString wxFileConfig::GetLocalDir() -{ - wxString strDir; - -#if defined(__WXMAC__) || defined(__DOS__) - // no local dir concept on Mac OS 9 or MS-DOS - strDir << GetGlobalDir() ; -#else - wxGetHomeDir(&strDir); - - #ifdef __UNIX__ - if ( - (strDir.Last() != wxT('/')) - #ifdef __VMS - && (strDir.Last() != wxT(']')) - #endif - ) - strDir << wxT('/'); - #else - if (strDir.Last() != wxT('\\')) - strDir << wxT('\\'); - #endif -#endif - - return strDir; -} - -wxString wxFileConfig::GetGlobalFileName(const wxChar *szFile) -{ - wxString str = GetGlobalDir(); - str << szFile; - - if ( wxStrchr(szFile, wxT('.')) == NULL ) -#if defined( __WXMAC__ ) - str << wxT(" Preferences") ; -#elif defined( __UNIX__ ) - str << wxT(".conf"); -#else // Windows - str << wxT(".ini"); -#endif // UNIX/Win - - return str; -} - -wxString wxFileConfig::GetLocalFileName(const wxChar *szFile) -{ -#ifdef __VMS__ - // On VMS I saw the problem that the home directory was appended - // twice for the configuration file. Does that also happen for - // other platforms? - wxString str = wxT( '.' ); -#else - wxString str = GetLocalDir(); -#endif - -#if defined( __UNIX__ ) && !defined( __VMS ) && !defined( __WXMAC__ ) - str << wxT('.'); -#endif - - str << szFile; - -#if defined(__WINDOWS__) || defined(__DOS__) - if ( wxStrchr(szFile, wxT('.')) == NULL ) - str << wxT(".ini"); -#endif - -#ifdef __WXMAC__ - str << wxT(" Preferences") ; -#endif - - return str; -} - -// ---------------------------------------------------------------------------- -// ctor -// ---------------------------------------------------------------------------- - -void wxFileConfig::Init() -{ - m_pCurrentGroup = - m_pRootGroup = new wxFileConfigGroup(NULL, wxEmptyString, this); - - m_linesHead = - m_linesTail = NULL; - - // It's not an error if (one of the) file(s) doesn't exist. - - // parse the global file - if ( !m_strGlobalFile.empty() && wxFile::Exists(m_strGlobalFile) ) - { - wxTextFile fileGlobal(m_strGlobalFile); - - if ( fileGlobal.Open(*m_conv/*ignored in ANSI build*/) ) - { - Parse(fileGlobal, false /* global */); - SetRootPath(); - } - else - { - wxLogWarning(_("can't open global configuration file '%s'."), m_strGlobalFile.c_str()); - } - } - - // parse the local file - if ( !m_strLocalFile.empty() && wxFile::Exists(m_strLocalFile) ) - { - wxTextFile fileLocal(m_strLocalFile); - if ( fileLocal.Open(*m_conv/*ignored in ANSI build*/) ) - { - Parse(fileLocal, true /* local */); - SetRootPath(); - } - else - { - wxLogWarning(_("can't open user configuration file '%s'."), m_strLocalFile.c_str() ); - } - } - - m_isDirty = false; -} - -// constructor supports creation of wxFileConfig objects of any type -wxFileConfig::wxFileConfig(const wxString& appName, const wxString& vendorName, - const wxString& strLocal, const wxString& strGlobal, - long style, - const wxMBConv& conv) - : wxConfigBase(::GetAppName(appName), vendorName, - strLocal, strGlobal, - style), - m_strLocalFile(strLocal), m_strGlobalFile(strGlobal), - m_conv(conv.Clone()) -{ - // Make up names for files if empty - if ( m_strLocalFile.empty() && (style & wxCONFIG_USE_LOCAL_FILE) ) - { - m_strLocalFile = GetLocalFileName(GetAppName()); -#if defined(__UNIX__) && !defined(__VMS) - if ( style & wxCONFIG_USE_SUBDIR ) - m_strLocalFile << wxFILE_SEP_PATH << GetAppName() << _T(".conf"); -#endif - } - - if ( m_strGlobalFile.empty() && (style & wxCONFIG_USE_GLOBAL_FILE) ) - m_strGlobalFile = GetGlobalFileName(GetAppName()); - - // Check if styles are not supplied, but filenames are, in which case - // add the correct styles. - if ( !m_strLocalFile.empty() ) - SetStyle(GetStyle() | wxCONFIG_USE_LOCAL_FILE); - - if ( !m_strGlobalFile.empty() ) - SetStyle(GetStyle() | wxCONFIG_USE_GLOBAL_FILE); - - // if the path is not absolute, prepend the standard directory to it - // UNLESS wxCONFIG_USE_RELATIVE_PATH style is set - if ( !(style & wxCONFIG_USE_RELATIVE_PATH) ) - { - if ( !m_strLocalFile.empty() && !wxIsAbsolutePath(m_strLocalFile) ) - { - const wxString strLocalOrig = m_strLocalFile; - m_strLocalFile = GetLocalDir(); - m_strLocalFile << strLocalOrig; - } - - if ( !m_strGlobalFile.empty() && !wxIsAbsolutePath(m_strGlobalFile) ) - { - const wxString strGlobalOrig = m_strGlobalFile; - m_strGlobalFile = GetGlobalDir(); - m_strGlobalFile << strGlobalOrig; - } - } - - SetUmask(-1); - - Init(); -} - -#if wxUSE_STREAMS - -wxFileConfig::wxFileConfig(wxInputStream &inStream, const wxMBConv& conv) - : m_conv(conv.Clone()) -{ - // always local_file when this constructor is called (?) - SetStyle(GetStyle() | wxCONFIG_USE_LOCAL_FILE); - - m_pCurrentGroup = - m_pRootGroup = new wxFileConfigGroup(NULL, wxEmptyString, this); - - m_linesHead = - m_linesTail = NULL; - - // read the entire stream contents in memory - wxString str; - { - static const size_t chunkLen = 1024; - - wxMemoryBuffer buf(chunkLen); - do - { - inStream.Read(buf.GetAppendBuf(chunkLen), chunkLen); - buf.UngetAppendBuf(inStream.LastRead()); - - const wxStreamError err = inStream.GetLastError(); - - if ( err != wxSTREAM_NO_ERROR && err != wxSTREAM_EOF ) - { - wxLogError(_("Error reading config options.")); - break; - } - } - while ( !inStream.Eof() ); - -#if wxUSE_UNICODE - size_t len; - str = conv.cMB2WC((char *)buf.GetData(), buf.GetDataLen(), &len); - if ( !len && buf.GetDataLen() ) - { - wxLogError(_("Failed to read config options.")); - } -#else // !wxUSE_UNICODE - // no need for conversion - str.assign((char *)buf.GetData(), buf.GetDataLen()); -#endif // wxUSE_UNICODE/!wxUSE_UNICODE - } - - - // translate everything to the current (platform-dependent) line - // termination character - str = wxTextBuffer::Translate(str); - - wxMemoryText memText; - - // Now we can add the text to the memory text. To do this we extract line - // by line from the translated string, until we've reached the end. - // - // VZ: all this is horribly inefficient, we should do the translation on - // the fly in one pass saving both memory and time (TODO) - - const wxChar *pEOL = wxTextBuffer::GetEOL(wxTextBuffer::typeDefault); - const size_t EOLLen = wxStrlen(pEOL); - - int posLineStart = str.Find(pEOL); - while ( posLineStart != -1 ) - { - wxString line(str.Left(posLineStart)); - - memText.AddLine(line); - - str = str.Mid(posLineStart + EOLLen); - - posLineStart = str.Find(pEOL); - } - - // also add whatever we have left in the translated string. - if ( !str.empty() ) - memText.AddLine(str); - - // Finally we can parse it all. - Parse(memText, true /* local */); - - SetRootPath(); - ResetDirty(); -} - -#endif // wxUSE_STREAMS - -void wxFileConfig::CleanUp() -{ - delete m_pRootGroup; - - wxFileConfigLineList *pCur = m_linesHead; - while ( pCur != NULL ) { - wxFileConfigLineList *pNext = pCur->Next(); - delete pCur; - pCur = pNext; - } -} - -wxFileConfig::~wxFileConfig() -{ - Flush(); - - CleanUp(); - - delete m_conv; -} - -// ---------------------------------------------------------------------------- -// parse a config file -// ---------------------------------------------------------------------------- - -void wxFileConfig::Parse(const wxTextBuffer& buffer, bool bLocal) -{ - const wxChar *pStart; - const wxChar *pEnd; - wxString strLine; - - size_t nLineCount = buffer.GetLineCount(); - - for ( size_t n = 0; n < nLineCount; n++ ) - { - strLine = buffer[n]; - - // add the line to linked list - if ( bLocal ) - LineListAppend(strLine); - - - // skip leading spaces - for ( pStart = strLine; wxIsspace(*pStart); pStart++ ) - ; - - // skip blank/comment lines - if ( *pStart == wxT('\0')|| *pStart == wxT(';') || *pStart == wxT('#') ) - continue; - - if ( *pStart == wxT('[') ) { // a new group - pEnd = pStart; - - while ( *++pEnd != wxT(']') ) { - if ( *pEnd == wxT('\\') ) { - // the next char is escaped, so skip it even if it is ']' - pEnd++; - } - - if ( *pEnd == wxT('\n') || *pEnd == wxT('\0') ) { - // we reached the end of line, break out of the loop - break; - } - } - - if ( *pEnd != wxT(']') ) { - wxLogError(_("file '%s': unexpected character %c at line %d."), - buffer.GetName(), *pEnd, n + 1); - continue; // skip this line - } - - // group name here is always considered as abs path - wxString strGroup; - pStart++; - strGroup << wxCONFIG_PATH_SEPARATOR - << FilterInEntryName(wxString(pStart, pEnd - pStart)); - - // will create it if doesn't yet exist - SetPath(strGroup); - - if ( bLocal ) - { - if ( m_pCurrentGroup->Parent() ) - m_pCurrentGroup->Parent()->SetLastGroup(m_pCurrentGroup); - m_pCurrentGroup->SetLine(m_linesTail); - } - - // check that there is nothing except comments left on this line - bool bCont = true; - while ( *++pEnd != wxT('\0') && bCont ) { - switch ( *pEnd ) { - case wxT('#'): - case wxT(';'): - bCont = false; - break; - - case wxT(' '): - case wxT('\t'): - // ignore whitespace ('\n' impossible here) - break; - - default: - wxLogWarning(_("file '%s', line %d: '%s' ignored after group header."), - buffer.GetName(), n + 1, pEnd); - bCont = false; - } - } - } - else { // a key - pEnd = pStart; - while ( *pEnd && *pEnd != wxT('=') /* && !wxIsspace(*pEnd)*/ ) { - if ( *pEnd == wxT('\\') ) { - // next character may be space or not - still take it because it's - // quoted (unless there is nothing) - pEnd++; - if ( !*pEnd ) { - // the error message will be given below anyhow - break; - } - } - - pEnd++; - } - - wxString strKey(FilterInEntryName(wxString(pStart, pEnd).Trim())); - - // skip whitespace - while ( wxIsspace(*pEnd) ) - pEnd++; - - if ( *pEnd++ != wxT('=') ) { - wxLogError(_("file '%s', line %d: '=' expected."), - buffer.GetName(), n + 1); - } - else { - wxFileConfigEntry *pEntry = m_pCurrentGroup->FindEntry(strKey); - - if ( pEntry == NULL ) { - // new entry - pEntry = m_pCurrentGroup->AddEntry(strKey, n); - } - else { - if ( bLocal && pEntry->IsImmutable() ) { - // immutable keys can't be changed by user - wxLogWarning(_("file '%s', line %d: value for immutable key '%s' ignored."), - buffer.GetName(), n + 1, strKey.c_str()); - continue; - } - // the condition below catches the cases (a) and (b) but not (c): - // (a) global key found second time in global file - // (b) key found second (or more) time in local file - // (c) key from global file now found in local one - // which is exactly what we want. - else if ( !bLocal || pEntry->IsLocal() ) { - wxLogWarning(_("file '%s', line %d: key '%s' was first found at line %d."), - buffer.GetName(), n + 1, strKey.c_str(), pEntry->Line()); - - } - } - - if ( bLocal ) - pEntry->SetLine(m_linesTail); - - // skip whitespace - while ( wxIsspace(*pEnd) ) - pEnd++; - - wxString value = pEnd; - if ( !(GetStyle() & wxCONFIG_USE_NO_ESCAPE_CHARACTERS) ) - value = FilterInValue(value); - - pEntry->SetValue(value, false); - } - } - } -} - -// ---------------------------------------------------------------------------- -// set/retrieve path -// ---------------------------------------------------------------------------- - -void wxFileConfig::SetRootPath() -{ - m_strPath.Empty(); - m_pCurrentGroup = m_pRootGroup; -} - -bool -wxFileConfig::DoSetPath(const wxString& strPath, bool createMissingComponents) -{ - wxArrayString aParts; - - if ( strPath.empty() ) { - SetRootPath(); - return true; - } - - if ( strPath[0] == wxCONFIG_PATH_SEPARATOR ) { - // absolute path - wxSplitPath(aParts, strPath); - } - else { - // relative path, combine with current one - wxString strFullPath = m_strPath; - strFullPath << wxCONFIG_PATH_SEPARATOR << strPath; - wxSplitPath(aParts, strFullPath); - } - - // change current group - size_t n; - m_pCurrentGroup = m_pRootGroup; - for ( n = 0; n < aParts.Count(); n++ ) { - wxFileConfigGroup *pNextGroup = m_pCurrentGroup->FindSubgroup(aParts[n]); - if ( pNextGroup == NULL ) - { - if ( !createMissingComponents ) - return false; - - pNextGroup = m_pCurrentGroup->AddSubgroup(aParts[n]); - } - - m_pCurrentGroup = pNextGroup; - } - - // recombine path parts in one variable - m_strPath.Empty(); - for ( n = 0; n < aParts.Count(); n++ ) { - m_strPath << wxCONFIG_PATH_SEPARATOR << aParts[n]; - } - - return true; -} - -void wxFileConfig::SetPath(const wxString& strPath) -{ - DoSetPath(strPath, true /* create missing path components */); -} - -// ---------------------------------------------------------------------------- -// enumeration -// ---------------------------------------------------------------------------- - -bool wxFileConfig::GetFirstGroup(wxString& str, long& lIndex) const -{ - lIndex = 0; - return GetNextGroup(str, lIndex); -} - -bool wxFileConfig::GetNextGroup (wxString& str, long& lIndex) const -{ - if ( size_t(lIndex) < m_pCurrentGroup->Groups().Count() ) { - str = m_pCurrentGroup->Groups()[(size_t)lIndex++]->Name(); - return true; - } - else - return false; -} - -bool wxFileConfig::GetFirstEntry(wxString& str, long& lIndex) const -{ - lIndex = 0; - return GetNextEntry(str, lIndex); -} - -bool wxFileConfig::GetNextEntry (wxString& str, long& lIndex) const -{ - if ( size_t(lIndex) < m_pCurrentGroup->Entries().Count() ) { - str = m_pCurrentGroup->Entries()[(size_t)lIndex++]->Name(); - return true; - } - else - return false; -} - -size_t wxFileConfig::GetNumberOfEntries(bool bRecursive) const -{ - size_t n = m_pCurrentGroup->Entries().Count(); - if ( bRecursive ) { - wxFileConfigGroup *pOldCurrentGroup = m_pCurrentGroup; - size_t nSubgroups = m_pCurrentGroup->Groups().Count(); - for ( size_t nGroup = 0; nGroup < nSubgroups; nGroup++ ) { - CONST_CAST m_pCurrentGroup = m_pCurrentGroup->Groups()[nGroup]; - n += GetNumberOfEntries(true); - CONST_CAST m_pCurrentGroup = pOldCurrentGroup; - } - } - - return n; -} - -size_t wxFileConfig::GetNumberOfGroups(bool bRecursive) const -{ - size_t n = m_pCurrentGroup->Groups().Count(); - if ( bRecursive ) { - wxFileConfigGroup *pOldCurrentGroup = m_pCurrentGroup; - size_t nSubgroups = m_pCurrentGroup->Groups().Count(); - for ( size_t nGroup = 0; nGroup < nSubgroups; nGroup++ ) { - CONST_CAST m_pCurrentGroup = m_pCurrentGroup->Groups()[nGroup]; - n += GetNumberOfGroups(true); - CONST_CAST m_pCurrentGroup = pOldCurrentGroup; - } - } - - return n; -} - -// ---------------------------------------------------------------------------- -// tests for existence -// ---------------------------------------------------------------------------- - -bool wxFileConfig::HasGroup(const wxString& strName) const -{ - // special case: DoSetPath("") does work as it's equivalent to DoSetPath("/") - // but there is no group with empty name so treat this separately - if ( strName.empty() ) - return false; - - const wxString pathOld = GetPath(); - - wxFileConfig *self = wx_const_cast(wxFileConfig *, this); - const bool - rc = self->DoSetPath(strName, false /* don't create missing components */); - - self->SetPath(pathOld); - - return rc; -} - -bool wxFileConfig::HasEntry(const wxString& entry) const -{ - // path is the part before the last "/" - wxString path = entry.BeforeLast(wxCONFIG_PATH_SEPARATOR); - - // except in the special case of "/keyname" when there is nothing before "/" - if ( path.empty() && *entry.c_str() == wxCONFIG_PATH_SEPARATOR ) - { - path = wxCONFIG_PATH_SEPARATOR; - } - - // change to the path of the entry if necessary and remember the old path - // to restore it later - wxString pathOld; - wxFileConfig * const self = wx_const_cast(wxFileConfig *, this); - if ( !path.empty() ) - { - pathOld = GetPath(); - if ( pathOld.empty() ) - pathOld = wxCONFIG_PATH_SEPARATOR; - - if ( !self->DoSetPath(path, false /* don't create if doesn't exist */) ) - { - return false; - } - } - - // check if the entry exists in this group - const bool exists = m_pCurrentGroup->FindEntry( - entry.AfterLast(wxCONFIG_PATH_SEPARATOR)) != NULL; - - // restore the old path if we changed it above - if ( !pathOld.empty() ) - { - self->SetPath(pathOld); - } - - return exists; -} - -// ---------------------------------------------------------------------------- -// read/write values -// ---------------------------------------------------------------------------- - -bool wxFileConfig::DoReadString(const wxString& key, wxString* pStr) const -{ - wxConfigPathChanger path(this, key); - - wxFileConfigEntry *pEntry = m_pCurrentGroup->FindEntry(path.Name()); - if (pEntry == NULL) { - return false; - } - - *pStr = pEntry->Value(); - - return true; -} - -bool wxFileConfig::DoReadLong(const wxString& key, long *pl) const -{ - wxString str; - if ( !Read(key, &str) ) - return false; - - // extra spaces shouldn't prevent us from reading numeric values - str.Trim(); - - return str.ToLong(pl); -} - -bool wxFileConfig::DoWriteString(const wxString& key, const wxString& szValue) -{ - wxConfigPathChanger path(this, key); - wxString strName = path.Name(); - - wxLogTrace( FILECONF_TRACE_MASK, - _T(" Writing String '%s' = '%s' to Group '%s'"), - strName.c_str(), - szValue.c_str(), - GetPath().c_str() ); - - if ( strName.empty() ) - { - // setting the value of a group is an error - - wxASSERT_MSG( szValue.empty(), wxT("can't set value of a group!") ); - - // ... except if it's empty in which case it's a way to force it's creation - - wxLogTrace( FILECONF_TRACE_MASK, - _T(" Creating group %s"), - m_pCurrentGroup->Name().c_str() ); - - SetDirty(); - - // this will add a line for this group if it didn't have it before (or - // do nothing for the root but it's ok as it always exists anyhow) - (void)m_pCurrentGroup->GetGroupLine(); - } - else - { - // writing an entry check that the name is reasonable - if ( strName[0u] == wxCONFIG_IMMUTABLE_PREFIX ) - { - wxLogError( _("Config entry name cannot start with '%c'."), - wxCONFIG_IMMUTABLE_PREFIX); - return false; - } - - wxFileConfigEntry *pEntry = m_pCurrentGroup->FindEntry(strName); - - if ( pEntry == 0 ) - { - wxLogTrace( FILECONF_TRACE_MASK, - _T(" Adding Entry %s"), - strName.c_str() ); - pEntry = m_pCurrentGroup->AddEntry(strName); - } - - wxLogTrace( FILECONF_TRACE_MASK, - _T(" Setting value %s"), - szValue.c_str() ); - pEntry->SetValue(szValue); - - SetDirty(); - } - - return true; -} - -bool wxFileConfig::DoWriteLong(const wxString& key, long lValue) -{ - return Write(key, wxString::Format(_T("%ld"), lValue)); -} - -bool wxFileConfig::Flush(bool /* bCurrentOnly */) -{ - if ( !IsDirty() || !m_strLocalFile ) - return true; - - // set the umask if needed - wxCHANGE_UMASK(m_umask); - - wxTempFile file(m_strLocalFile); - - if ( !file.IsOpened() ) - { - wxLogError(_("can't open user configuration file.")); - return false; - } - - // write all strings to file - wxString filetext; - filetext.reserve(4096); - for ( wxFileConfigLineList *p = m_linesHead; p != NULL; p = p->Next() ) - { - filetext << p->Text() << wxTextFile::GetEOL(); - } - - if ( !file.Write(filetext, *m_conv) ) - { - wxLogError(_("can't write user configuration file.")); - return false; - } - - if ( !file.Commit() ) - { - wxLogError(_("Failed to update user configuration file.")); - - return false; - } - - ResetDirty(); - -#if defined(__WXMAC__) - wxFileName(m_strLocalFile).MacSetTypeAndCreator('TEXT', 'ttxt'); -#endif // __WXMAC__ - - return true; -} - -#if wxUSE_STREAMS - -bool wxFileConfig::Save(wxOutputStream& os, const wxMBConv& conv) -{ - // save unconditionally, even if not dirty - for ( wxFileConfigLineList *p = m_linesHead; p != NULL; p = p->Next() ) - { - wxString line = p->Text(); - line += wxTextFile::GetEOL(); - - wxCharBuffer buf(line.mb_str(conv)); - if ( !os.Write(buf, strlen(buf)) ) - { - wxLogError(_("Error saving user configuration data.")); - - return false; - } - } - - ResetDirty(); - - return true; -} - -#endif // wxUSE_STREAMS - -// ---------------------------------------------------------------------------- -// renaming groups/entries -// ---------------------------------------------------------------------------- - -bool wxFileConfig::RenameEntry(const wxString& oldName, - const wxString& newName) -{ - wxASSERT_MSG( !wxStrchr(oldName, wxCONFIG_PATH_SEPARATOR), - _T("RenameEntry(): paths are not supported") ); - - // check that the entry exists - wxFileConfigEntry *oldEntry = m_pCurrentGroup->FindEntry(oldName); - if ( !oldEntry ) - return false; - - // check that the new entry doesn't already exist - if ( m_pCurrentGroup->FindEntry(newName) ) - return false; - - // delete the old entry, create the new one - wxString value = oldEntry->Value(); - if ( !m_pCurrentGroup->DeleteEntry(oldName) ) - return false; - - SetDirty(); - - wxFileConfigEntry *newEntry = m_pCurrentGroup->AddEntry(newName); - newEntry->SetValue(value); - - return true; -} - -bool wxFileConfig::RenameGroup(const wxString& oldName, - const wxString& newName) -{ - // check that the group exists - wxFileConfigGroup *group = m_pCurrentGroup->FindSubgroup(oldName); - if ( !group ) - return false; - - // check that the new group doesn't already exist - if ( m_pCurrentGroup->FindSubgroup(newName) ) - return false; - - group->Rename(newName); - - SetDirty(); - - return true; -} - -// ---------------------------------------------------------------------------- -// delete groups/entries -// ---------------------------------------------------------------------------- - -bool wxFileConfig::DeleteEntry(const wxString& key, bool bGroupIfEmptyAlso) -{ - wxConfigPathChanger path(this, key); - - if ( !m_pCurrentGroup->DeleteEntry(path.Name()) ) - return false; - - SetDirty(); - - if ( bGroupIfEmptyAlso && m_pCurrentGroup->IsEmpty() ) { - if ( m_pCurrentGroup != m_pRootGroup ) { - wxFileConfigGroup *pGroup = m_pCurrentGroup; - SetPath(wxT("..")); // changes m_pCurrentGroup! - m_pCurrentGroup->DeleteSubgroupByName(pGroup->Name()); - } - //else: never delete the root group - } - - return true; -} - -bool wxFileConfig::DeleteGroup(const wxString& key) -{ - wxConfigPathChanger path(this, RemoveTrailingSeparator(key)); - - if ( !m_pCurrentGroup->DeleteSubgroupByName(path.Name()) ) - return false; - - path.UpdateIfDeleted(); - - SetDirty(); - - return true; -} - -bool wxFileConfig::DeleteAll() -{ - CleanUp(); - - if ( !m_strLocalFile.empty() ) - { - if ( wxFile::Exists(m_strLocalFile) && wxRemove(m_strLocalFile) == -1 ) - { - wxLogSysError(_("can't delete user configuration file '%s'"), - m_strLocalFile.c_str()); - return false; - } - } - - Init(); - - return true; -} - -// ---------------------------------------------------------------------------- -// linked list functions -// ---------------------------------------------------------------------------- - - // append a new line to the end of the list - -wxFileConfigLineList *wxFileConfig::LineListAppend(const wxString& str) -{ - wxLogTrace( FILECONF_TRACE_MASK, - _T(" ** Adding Line '%s'"), - str.c_str() ); - wxLogTrace( FILECONF_TRACE_MASK, - _T(" head: %s"), - ((m_linesHead) ? m_linesHead->Text().c_str() : wxEmptyString) ); - wxLogTrace( FILECONF_TRACE_MASK, - _T(" tail: %s"), - ((m_linesTail) ? m_linesTail->Text().c_str() : wxEmptyString) ); - - wxFileConfigLineList *pLine = new wxFileConfigLineList(str); - - if ( m_linesTail == NULL ) - { - // list is empty - m_linesHead = pLine; - } - else - { - // adjust pointers - m_linesTail->SetNext(pLine); - pLine->SetPrev(m_linesTail); - } - - m_linesTail = pLine; - - wxLogTrace( FILECONF_TRACE_MASK, - _T(" head: %s"), - ((m_linesHead) ? m_linesHead->Text().c_str() : wxEmptyString) ); - wxLogTrace( FILECONF_TRACE_MASK, - _T(" tail: %s"), - ((m_linesTail) ? m_linesTail->Text().c_str() : wxEmptyString) ); - - return m_linesTail; -} - -// insert a new line after the given one or in the very beginning if !pLine -wxFileConfigLineList *wxFileConfig::LineListInsert(const wxString& str, - wxFileConfigLineList *pLine) -{ - wxLogTrace( FILECONF_TRACE_MASK, - _T(" ** Inserting Line '%s' after '%s'"), - str.c_str(), - ((pLine) ? pLine->Text().c_str() : wxEmptyString) ); - wxLogTrace( FILECONF_TRACE_MASK, - _T(" head: %s"), - ((m_linesHead) ? m_linesHead->Text().c_str() : wxEmptyString) ); - wxLogTrace( FILECONF_TRACE_MASK, - _T(" tail: %s"), - ((m_linesTail) ? m_linesTail->Text().c_str() : wxEmptyString) ); - - if ( pLine == m_linesTail ) - return LineListAppend(str); - - wxFileConfigLineList *pNewLine = new wxFileConfigLineList(str); - if ( pLine == NULL ) - { - // prepend to the list - pNewLine->SetNext(m_linesHead); - m_linesHead->SetPrev(pNewLine); - m_linesHead = pNewLine; - } - else - { - // insert before pLine - wxFileConfigLineList *pNext = pLine->Next(); - pNewLine->SetNext(pNext); - pNewLine->SetPrev(pLine); - pNext->SetPrev(pNewLine); - pLine->SetNext(pNewLine); - } - - wxLogTrace( FILECONF_TRACE_MASK, - _T(" head: %s"), - ((m_linesHead) ? m_linesHead->Text().c_str() : wxEmptyString) ); - wxLogTrace( FILECONF_TRACE_MASK, - _T(" tail: %s"), - ((m_linesTail) ? m_linesTail->Text().c_str() : wxEmptyString) ); - - return pNewLine; -} - -void wxFileConfig::LineListRemove(wxFileConfigLineList *pLine) -{ - wxLogTrace( FILECONF_TRACE_MASK, - _T(" ** Removing Line '%s'"), - pLine->Text().c_str() ); - wxLogTrace( FILECONF_TRACE_MASK, - _T(" head: %s"), - ((m_linesHead) ? m_linesHead->Text().c_str() : wxEmptyString) ); - wxLogTrace( FILECONF_TRACE_MASK, - _T(" tail: %s"), - ((m_linesTail) ? m_linesTail->Text().c_str() : wxEmptyString) ); - - wxFileConfigLineList *pPrev = pLine->Prev(), - *pNext = pLine->Next(); - - // first entry? - - if ( pPrev == NULL ) - m_linesHead = pNext; - else - pPrev->SetNext(pNext); - - // last entry? - - if ( pNext == NULL ) - m_linesTail = pPrev; - else - pNext->SetPrev(pPrev); - - if ( m_pRootGroup->GetGroupLine() == pLine ) - m_pRootGroup->SetLine(m_linesHead); - - wxLogTrace( FILECONF_TRACE_MASK, - _T(" head: %s"), - ((m_linesHead) ? m_linesHead->Text().c_str() : wxEmptyString) ); - wxLogTrace( FILECONF_TRACE_MASK, - _T(" tail: %s"), - ((m_linesTail) ? m_linesTail->Text().c_str() : wxEmptyString) ); - - delete pLine; -} - -bool wxFileConfig::LineListIsEmpty() -{ - return m_linesHead == NULL; -} - -// ============================================================================ -// wxFileConfig::wxFileConfigGroup -// ============================================================================ - -// ---------------------------------------------------------------------------- -// ctor/dtor -// ---------------------------------------------------------------------------- - -// ctor -wxFileConfigGroup::wxFileConfigGroup(wxFileConfigGroup *pParent, - const wxString& strName, - wxFileConfig *pConfig) - : m_aEntries(CompareEntries), - m_aSubgroups(CompareGroups), - m_strName(strName) -{ - m_pConfig = pConfig; - m_pParent = pParent; - m_pLine = NULL; - - m_pLastEntry = NULL; - m_pLastGroup = NULL; -} - -// dtor deletes all children -wxFileConfigGroup::~wxFileConfigGroup() -{ - // entries - size_t n, nCount = m_aEntries.Count(); - for ( n = 0; n < nCount; n++ ) - delete m_aEntries[n]; - - // subgroups - nCount = m_aSubgroups.Count(); - for ( n = 0; n < nCount; n++ ) - delete m_aSubgroups[n]; -} - -// ---------------------------------------------------------------------------- -// line -// ---------------------------------------------------------------------------- - -void wxFileConfigGroup::SetLine(wxFileConfigLineList *pLine) -{ - // for a normal (i.e. not root) group this method shouldn't be called twice - // unless we are resetting the line - wxASSERT_MSG( !m_pParent || !m_pLine || !pLine, - _T("changing line for a non-root group?") ); - - m_pLine = pLine; -} - -/* - This is a bit complicated, so let me explain it in details. All lines that - were read from the local file (the only one we will ever modify) are stored - in a (doubly) linked list. Our problem is to know at which position in this - list should we insert the new entries/subgroups. To solve it we keep three - variables for each group: m_pLine, m_pLastEntry and m_pLastGroup. - - m_pLine points to the line containing "[group_name]" - m_pLastEntry points to the last entry of this group in the local file. - m_pLastGroup subgroup - - Initially, they're NULL all three. When the group (an entry/subgroup) is read - from the local file, the corresponding variable is set. However, if the group - was read from the global file and then modified or created by the application - these variables are still NULL and we need to create the corresponding lines. - See the following functions (and comments preceding them) for the details of - how we do it. - - Also, when our last entry/group are deleted we need to find the new last - element - the code in DeleteEntry/Subgroup does this by backtracking the list - of lines until it either founds an entry/subgroup (and this is the new last - element) or the m_pLine of the group, in which case there are no more entries - (or subgroups) left and m_pLast becomes NULL. - - NB: This last problem could be avoided for entries if we added new entries - immediately after m_pLine, but in this case the entries would appear - backwards in the config file (OTOH, it's not that important) and as we - would still need to do it for the subgroups the code wouldn't have been - significantly less complicated. -*/ - -// Return the line which contains "[our name]". If we're still not in the list, -// add our line to it immediately after the last line of our parent group if we -// have it or in the very beginning if we're the root group. -wxFileConfigLineList *wxFileConfigGroup::GetGroupLine() -{ - wxLogTrace( FILECONF_TRACE_MASK, - _T(" GetGroupLine() for Group '%s'"), - Name().c_str() ); - - if ( !m_pLine ) - { - wxLogTrace( FILECONF_TRACE_MASK, - _T(" Getting Line item pointer") ); - - wxFileConfigGroup *pParent = Parent(); - - // this group wasn't present in local config file, add it now - if ( pParent ) - { - wxLogTrace( FILECONF_TRACE_MASK, - _T(" checking parent '%s'"), - pParent->Name().c_str() ); - - wxString strFullName; - - // add 1 to the name because we don't want to start with '/' - strFullName << wxT("[") - << FilterOutEntryName(GetFullName().c_str() + 1) - << wxT("]"); - m_pLine = m_pConfig->LineListInsert(strFullName, - pParent->GetLastGroupLine()); - pParent->SetLastGroup(this); // we're surely after all the others - } - //else: this is the root group and so we return NULL because we don't - // have any group line - } - - return m_pLine; -} - -// Return the last line belonging to the subgroups of this group (after which -// we can add a new subgroup), if we don't have any subgroups or entries our -// last line is the group line (m_pLine) itself. -wxFileConfigLineList *wxFileConfigGroup::GetLastGroupLine() -{ - // if we have any subgroups, our last line is the last line of the last - // subgroup - if ( m_pLastGroup ) - { - wxFileConfigLineList *pLine = m_pLastGroup->GetLastGroupLine(); - - wxASSERT_MSG( pLine, _T("last group must have !NULL associated line") ); - - return pLine; - } - - // no subgroups, so the last line is the line of thelast entry (if any) - return GetLastEntryLine(); -} - -// return the last line belonging to the entries of this group (after which -// we can add a new entry), if we don't have any entries we will add the new -// one immediately after the group line itself. -wxFileConfigLineList *wxFileConfigGroup::GetLastEntryLine() -{ - wxLogTrace( FILECONF_TRACE_MASK, - _T(" GetLastEntryLine() for Group '%s'"), - Name().c_str() ); - - if ( m_pLastEntry ) - { - wxFileConfigLineList *pLine = m_pLastEntry->GetLine(); - - wxASSERT_MSG( pLine, _T("last entry must have !NULL associated line") ); - - return pLine; - } - - // no entries: insert after the group header, if any - return GetGroupLine(); -} - -void wxFileConfigGroup::SetLastEntry(wxFileConfigEntry *pEntry) -{ - m_pLastEntry = pEntry; - - if ( !m_pLine ) - { - // the only situation in which a group without its own line can have - // an entry is when the first entry is added to the initially empty - // root pseudo-group - wxASSERT_MSG( !m_pParent, _T("unexpected for non root group") ); - - // let the group know that it does have a line in the file now - m_pLine = pEntry->GetLine(); - } -} - -// ---------------------------------------------------------------------------- -// group name -// ---------------------------------------------------------------------------- - -void wxFileConfigGroup::UpdateGroupAndSubgroupsLines() -{ - // update the line of this group - wxFileConfigLineList *line = GetGroupLine(); - wxCHECK_RET( line, _T("a non root group must have a corresponding line!") ); - - // +1: skip the leading '/' - line->SetText(wxString::Format(_T("[%s]"), GetFullName().c_str() + 1)); - - - // also update all subgroups as they have this groups name in their lines - const size_t nCount = m_aSubgroups.Count(); - for ( size_t n = 0; n < nCount; n++ ) - { - m_aSubgroups[n]->UpdateGroupAndSubgroupsLines(); - } -} - -void wxFileConfigGroup::Rename(const wxString& newName) -{ - wxCHECK_RET( m_pParent, _T("the root group can't be renamed") ); - - if ( newName == m_strName ) - return; - - // we need to remove the group from the parent and it back under the new - // name to keep the parents array of subgroups alphabetically sorted - m_pParent->m_aSubgroups.Remove(this); - - m_strName = newName; - - m_pParent->m_aSubgroups.Add(this); - - // update the group lines recursively - UpdateGroupAndSubgroupsLines(); -} - -wxString wxFileConfigGroup::GetFullName() const -{ - wxString fullname; - if ( Parent() ) - fullname = Parent()->GetFullName() + wxCONFIG_PATH_SEPARATOR + Name(); - - return fullname; -} - -// ---------------------------------------------------------------------------- -// find an item -// ---------------------------------------------------------------------------- - -// use binary search because the array is sorted -wxFileConfigEntry * -wxFileConfigGroup::FindEntry(const wxChar *szName) const -{ - size_t i, - lo = 0, - hi = m_aEntries.Count(); - int res; - wxFileConfigEntry *pEntry; - - while ( lo < hi ) { - i = (lo + hi)/2; - pEntry = m_aEntries[i]; - - #if wxCONFIG_CASE_SENSITIVE - res = wxStrcmp(pEntry->Name(), szName); - #else - res = wxStricmp(pEntry->Name(), szName); - #endif - - if ( res > 0 ) - hi = i; - else if ( res < 0 ) - lo = i + 1; - else - return pEntry; - } - - return NULL; -} - -wxFileConfigGroup * -wxFileConfigGroup::FindSubgroup(const wxChar *szName) const -{ - size_t i, - lo = 0, - hi = m_aSubgroups.Count(); - int res; - wxFileConfigGroup *pGroup; - - while ( lo < hi ) { - i = (lo + hi)/2; - pGroup = m_aSubgroups[i]; - - #if wxCONFIG_CASE_SENSITIVE - res = wxStrcmp(pGroup->Name(), szName); - #else - res = wxStricmp(pGroup->Name(), szName); - #endif - - if ( res > 0 ) - hi = i; - else if ( res < 0 ) - lo = i + 1; - else - return pGroup; - } - - return NULL; -} - -// ---------------------------------------------------------------------------- -// create a new item -// ---------------------------------------------------------------------------- - -// create a new entry and add it to the current group -wxFileConfigEntry *wxFileConfigGroup::AddEntry(const wxString& strName, int nLine) -{ - wxASSERT( FindEntry(strName) == 0 ); - - wxFileConfigEntry *pEntry = new wxFileConfigEntry(this, strName, nLine); - - m_aEntries.Add(pEntry); - return pEntry; -} - -// create a new group and add it to the current group -wxFileConfigGroup *wxFileConfigGroup::AddSubgroup(const wxString& strName) -{ - wxASSERT( FindSubgroup(strName) == 0 ); - - wxFileConfigGroup *pGroup = new wxFileConfigGroup(this, strName, m_pConfig); - - m_aSubgroups.Add(pGroup); - return pGroup; -} - -// ---------------------------------------------------------------------------- -// delete an item -// ---------------------------------------------------------------------------- - -/* - The delete operations are _very_ slow if we delete the last item of this - group (see comments before GetXXXLineXXX functions for more details), - so it's much better to start with the first entry/group if we want to - delete several of them. - */ - -bool wxFileConfigGroup::DeleteSubgroupByName(const wxChar *szName) -{ - wxFileConfigGroup * const pGroup = FindSubgroup(szName); - - return pGroup ? DeleteSubgroup(pGroup) : false; -} - -// Delete the subgroup and remove all references to it from -// other data structures. -bool wxFileConfigGroup::DeleteSubgroup(wxFileConfigGroup *pGroup) -{ - wxCHECK_MSG( pGroup, false, _T("deleting non existing group?") ); - - wxLogTrace( FILECONF_TRACE_MASK, - _T("Deleting group '%s' from '%s'"), - pGroup->Name().c_str(), - Name().c_str() ); - - wxLogTrace( FILECONF_TRACE_MASK, - _T(" (m_pLine) = prev: %p, this %p, next %p"), - m_pLine ? wx_static_cast(void*, m_pLine->Prev()) : 0, - wx_static_cast(void*, m_pLine), - m_pLine ? wx_static_cast(void*, m_pLine->Next()) : 0 ); - wxLogTrace( FILECONF_TRACE_MASK, - _T(" text: '%s'"), - m_pLine ? m_pLine->Text().c_str() : wxEmptyString ); - - // delete all entries... - size_t nCount = pGroup->m_aEntries.Count(); - - wxLogTrace(FILECONF_TRACE_MASK, - _T("Removing %lu entries"), (unsigned long)nCount ); - - for ( size_t nEntry = 0; nEntry < nCount; nEntry++ ) - { - wxFileConfigLineList *pLine = pGroup->m_aEntries[nEntry]->GetLine(); - - if ( pLine ) - { - wxLogTrace( FILECONF_TRACE_MASK, - _T(" '%s'"), - pLine->Text().c_str() ); - m_pConfig->LineListRemove(pLine); - } - } - - // ...and subgroups of this subgroup - nCount = pGroup->m_aSubgroups.Count(); - - wxLogTrace( FILECONF_TRACE_MASK, - _T("Removing %lu subgroups"), (unsigned long)nCount ); - - for ( size_t nGroup = 0; nGroup < nCount; nGroup++ ) - { - pGroup->DeleteSubgroup(pGroup->m_aSubgroups[0]); - } - - // and then finally the group itself - wxFileConfigLineList *pLine = pGroup->m_pLine; - if ( pLine ) - { - wxLogTrace( FILECONF_TRACE_MASK, - _T(" Removing line for group '%s' : '%s'"), - pGroup->Name().c_str(), - pLine->Text().c_str() ); - wxLogTrace( FILECONF_TRACE_MASK, - _T(" Removing from group '%s' : '%s'"), - Name().c_str(), - ((m_pLine) ? m_pLine->Text().c_str() : wxEmptyString) ); - - // notice that we may do this test inside the previous "if" - // because the last entry's line is surely !NULL - if ( pGroup == m_pLastGroup ) - { - wxLogTrace( FILECONF_TRACE_MASK, - _T(" Removing last group") ); - - // our last entry is being deleted, so find the last one which - // stays by going back until we find a subgroup or reach the - // group line - const size_t nSubgroups = m_aSubgroups.Count(); - - m_pLastGroup = NULL; - for ( wxFileConfigLineList *pl = pLine->Prev(); - pl && !m_pLastGroup; - pl = pl->Prev() ) - { - // does this line belong to our subgroup? - for ( size_t n = 0; n < nSubgroups; n++ ) - { - // do _not_ call GetGroupLine! we don't want to add it to - // the local file if it's not already there - if ( m_aSubgroups[n]->m_pLine == pl ) - { - m_pLastGroup = m_aSubgroups[n]; - break; - } - } - - if ( pl == m_pLine ) - break; - } - } - - m_pConfig->LineListRemove(pLine); - } - else - { - wxLogTrace( FILECONF_TRACE_MASK, - _T(" No line entry for Group '%s'?"), - pGroup->Name().c_str() ); - } - - m_aSubgroups.Remove(pGroup); - delete pGroup; - - return true; -} - -bool wxFileConfigGroup::DeleteEntry(const wxChar *szName) -{ - wxFileConfigEntry *pEntry = FindEntry(szName); - if ( !pEntry ) - { - // entry doesn't exist, nothing to do - return false; - } - - wxFileConfigLineList *pLine = pEntry->GetLine(); - if ( pLine != NULL ) { - // notice that we may do this test inside the previous "if" because the - // last entry's line is surely !NULL - if ( pEntry == m_pLastEntry ) { - // our last entry is being deleted - find the last one which stays - wxASSERT( m_pLine != NULL ); // if we have an entry with !NULL pLine... - - // find the previous entry (if any) - wxFileConfigEntry *pNewLast = NULL; - const wxFileConfigLineList * const - pNewLastLine = m_pLastEntry->GetLine()->Prev(); - const size_t nEntries = m_aEntries.GetCount(); - for ( size_t n = 0; n < nEntries; n++ ) { - if ( m_aEntries[n]->GetLine() == pNewLastLine ) { - pNewLast = m_aEntries[n]; - break; - } - } - - // pNewLast can be NULL here -- it's ok and can happen if we have no - // entries left - m_pLastEntry = pNewLast; - } - - m_pConfig->LineListRemove(pLine); - } - - m_aEntries.Remove(pEntry); - delete pEntry; - - return true; -} - -// ============================================================================ -// wxFileConfig::wxFileConfigEntry -// ============================================================================ - -// ---------------------------------------------------------------------------- -// ctor -// ---------------------------------------------------------------------------- -wxFileConfigEntry::wxFileConfigEntry(wxFileConfigGroup *pParent, - const wxString& strName, - int nLine) - : m_strName(strName) -{ - wxASSERT( !strName.empty() ); - - m_pParent = pParent; - m_nLine = nLine; - m_pLine = NULL; - - m_bHasValue = false; - - m_bImmutable = strName[0] == wxCONFIG_IMMUTABLE_PREFIX; - if ( m_bImmutable ) - m_strName.erase(0, 1); // remove first character -} - -// ---------------------------------------------------------------------------- -// set value -// ---------------------------------------------------------------------------- - -void wxFileConfigEntry::SetLine(wxFileConfigLineList *pLine) -{ - if ( m_pLine != NULL ) { - wxLogWarning(_("entry '%s' appears more than once in group '%s'"), - Name().c_str(), m_pParent->GetFullName().c_str()); - } - - m_pLine = pLine; - Group()->SetLastEntry(this); -} - -// second parameter is false if we read the value from file and prevents the -// entry from being marked as 'dirty' -void wxFileConfigEntry::SetValue(const wxString& strValue, bool bUser) -{ - if ( bUser && IsImmutable() ) - { - wxLogWarning( _("attempt to change immutable key '%s' ignored."), - Name().c_str()); - return; - } - - // do nothing if it's the same value: but don't test for it if m_bHasValue - // hadn't been set yet or we'd never write empty values to the file - if ( m_bHasValue && strValue == m_strValue ) - return; - - m_bHasValue = true; - m_strValue = strValue; - - if ( bUser ) - { - wxString strValFiltered; - - if ( Group()->Config()->GetStyle() & wxCONFIG_USE_NO_ESCAPE_CHARACTERS ) - { - strValFiltered = strValue; - } - else { - strValFiltered = FilterOutValue(strValue); - } - - wxString strLine; - strLine << FilterOutEntryName(m_strName) << wxT('=') << strValFiltered; - - if ( m_pLine ) - { - // entry was read from the local config file, just modify the line - m_pLine->SetText(strLine); - } - else // this entry didn't exist in the local file - { - // add a new line to the file: note that line returned by - // GetLastEntryLine() may be NULL if we're in the root group and it - // doesn't have any entries yet, but this is ok as passing NULL - // line to LineListInsert() means to prepend new line to the list - wxFileConfigLineList *line = Group()->GetLastEntryLine(); - m_pLine = Group()->Config()->LineListInsert(strLine, line); - - Group()->SetLastEntry(this); - } - } -} - -// ============================================================================ -// global functions -// ============================================================================ - -// ---------------------------------------------------------------------------- -// compare functions for array sorting -// ---------------------------------------------------------------------------- - -int CompareEntries(wxFileConfigEntry *p1, wxFileConfigEntry *p2) -{ -#if wxCONFIG_CASE_SENSITIVE - return wxStrcmp(p1->Name(), p2->Name()); -#else - return wxStricmp(p1->Name(), p2->Name()); -#endif -} - -int CompareGroups(wxFileConfigGroup *p1, wxFileConfigGroup *p2) -{ -#if wxCONFIG_CASE_SENSITIVE - return wxStrcmp(p1->Name(), p2->Name()); -#else - return wxStricmp(p1->Name(), p2->Name()); -#endif -} - -// ---------------------------------------------------------------------------- -// filter functions -// ---------------------------------------------------------------------------- - -// undo FilterOutValue -static wxString FilterInValue(const wxString& str) -{ - wxString strResult; - strResult.Alloc(str.Len()); - - bool bQuoted = !str.empty() && str[0] == '"'; - - for ( size_t n = bQuoted ? 1 : 0; n < str.Len(); n++ ) { - if ( str[n] == wxT('\\') ) { - switch ( str[++n] ) { - case wxT('n'): - strResult += wxT('\n'); - break; - - case wxT('r'): - strResult += wxT('\r'); - break; - - case wxT('t'): - strResult += wxT('\t'); - break; - - case wxT('\\'): - strResult += wxT('\\'); - break; - - case wxT('"'): - strResult += wxT('"'); - break; - } - } - else { - if ( str[n] != wxT('"') || !bQuoted ) - strResult += str[n]; - else if ( n != str.Len() - 1 ) { - wxLogWarning(_("unexpected \" at position %d in '%s'."), - n, str.c_str()); - } - //else: it's the last quote of a quoted string, ok - } - } - - return strResult; -} - -// quote the string before writing it to file -static wxString FilterOutValue(const wxString& str) -{ - if ( !str ) - return str; - - wxString strResult; - strResult.Alloc(str.Len()); - - // quoting is necessary to preserve spaces in the beginning of the string - bool bQuote = wxIsspace(str[0]) || str[0] == wxT('"'); - - if ( bQuote ) - strResult += wxT('"'); - - wxChar c; - for ( size_t n = 0; n < str.Len(); n++ ) { - switch ( str[n] ) { - case wxT('\n'): - c = wxT('n'); - break; - - case wxT('\r'): - c = wxT('r'); - break; - - case wxT('\t'): - c = wxT('t'); - break; - - case wxT('\\'): - c = wxT('\\'); - break; - - case wxT('"'): - if ( bQuote ) { - c = wxT('"'); - break; - } - //else: fall through - - default: - strResult += str[n]; - continue; // nothing special to do - } - - // we get here only for special characters - strResult << wxT('\\') << c; - } - - if ( bQuote ) - strResult += wxT('"'); - - return strResult; -} - -// undo FilterOutEntryName -static wxString FilterInEntryName(const wxString& str) -{ - wxString strResult; - strResult.Alloc(str.Len()); - - for ( const wxChar *pc = str.c_str(); *pc != '\0'; pc++ ) { - if ( *pc == wxT('\\') ) { - // we need to test it here or we'd skip past the NUL in the loop line - if ( *++pc == _T('\0') ) - break; - } - - strResult += *pc; - } - - return strResult; -} - -// sanitize entry or group name: insert '\\' before any special characters -static wxString FilterOutEntryName(const wxString& str) -{ - wxString strResult; - strResult.Alloc(str.Len()); - - for ( const wxChar *pc = str.c_str(); *pc != wxT('\0'); pc++ ) { - const wxChar c = *pc; - - // we explicitly allow some of "safe" chars and 8bit ASCII characters - // which will probably never have special meaning and with which we can't - // use isalnum() anyhow (in ASCII built, in Unicode it's just fine) - // - // NB: note that wxCONFIG_IMMUTABLE_PREFIX and wxCONFIG_PATH_SEPARATOR - // should *not* be quoted - if ( -#if !wxUSE_UNICODE - ((unsigned char)c < 127) && -#endif // ANSI - !wxIsalnum(c) && !wxStrchr(wxT("@_/-!.*%"), c) ) - { - strResult += wxT('\\'); - } - - strResult += c; - } - - return strResult; -} - -// we can't put ?: in the ctor initializer list because it confuses some -// broken compilers (Borland C++) -static wxString GetAppName(const wxString& appName) -{ - if ( !appName && wxTheApp ) - return wxTheApp->GetAppName(); - else - return appName; -} - -#endif // wxUSE_CONFIG diff --git a/wxWidgets/src/common/filefn.cpp b/wxWidgets/src/common/filefn.cpp deleted file mode 100644 index b9700d4c4a..0000000000 --- a/wxWidgets/src/common/filefn.cpp +++ /dev/null @@ -1,2123 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/common/filefn.cpp -// Purpose: File- and directory-related functions -// Author: Julian Smart -// Modified by: -// Created: 29/01/98 -// RCS-ID: $Id: filefn.cpp 66990 2011-02-22 12:10:44Z JS $ -// Copyright: (c) 1998 Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#include "wx/filefn.h" - -#ifndef WX_PRECOMP - #include "wx/intl.h" - #include "wx/log.h" - #include "wx/utils.h" -#endif - -#include "wx/file.h" -#include "wx/filename.h" -#include "wx/dir.h" - -#include "wx/tokenzr.h" - -// there are just too many of those... -#ifdef __VISUALC__ - #pragma warning(disable:4706) // assignment within conditional expression -#endif // VC++ - -#include -#include -#include -#include -#if !wxONLY_WATCOM_EARLIER_THAN(1,4) - #if !(defined(_MSC_VER) && (_MSC_VER > 800)) - #include - #endif -#endif - -#if defined(__WXMAC__) - #include "wx/mac/private.h" // includes mac headers -#endif - -#ifdef __WINDOWS__ - #include "wx/msw/private.h" - #include "wx/msw/mslu.h" - - // sys/cygwin.h is needed for cygwin_conv_to_full_win32_path() - // - // note that it must be included after - #ifdef __GNUWIN32__ - #ifdef __CYGWIN__ - #include - #endif - #endif // __GNUWIN32__ - - // io.h is needed for _get_osfhandle() - // Already included by filefn.h for many Windows compilers - #if defined __MWERKS__ || defined __CYGWIN__ - #include - #endif -#endif // __WINDOWS__ - -#if defined(__VMS__) - #include -#endif - -// TODO: Borland probably has _wgetcwd as well? -#ifdef _MSC_VER - #define HAVE_WGETCWD -#endif - -// ---------------------------------------------------------------------------- -// constants -// ---------------------------------------------------------------------------- - -#ifndef _MAXPATHLEN - #define _MAXPATHLEN 1024 -#endif - -#ifdef __WXMAC__ -# include "MoreFilesX.h" -#endif - -// ---------------------------------------------------------------------------- -// private globals -// ---------------------------------------------------------------------------- - -// MT-FIXME: get rid of this horror and all code using it -static wxChar wxFileFunctionsBuffer[4*_MAXPATHLEN]; - -#if defined(__VISAGECPP__) && __IBMCPP__ >= 400 -// -// VisualAge C++ V4.0 cannot have any external linkage const decs -// in headers included by more than one primary source -// -const int wxInvalidOffset = -1; -#endif - -// ---------------------------------------------------------------------------- -// macros -// ---------------------------------------------------------------------------- - -// translate the filenames before passing them to OS functions -#define OS_FILENAME(s) (s.fn_str()) - -// ============================================================================ -// implementation -// ============================================================================ - -// ---------------------------------------------------------------------------- -// wrappers around standard POSIX functions -// ---------------------------------------------------------------------------- - -#ifdef wxNEED_WX_UNISTD_H - -WXDLLEXPORT int wxStat( const wxChar *file_name, wxStructStat *buf ) -{ - return stat( wxConvFile.cWX2MB( file_name ), buf ); -} - -WXDLLEXPORT int wxLstat( const wxChar *file_name, wxStructStat *buf ) -{ - return lstat( wxConvFile.cWX2MB( file_name ), buf ); -} - -WXDLLEXPORT int wxAccess( const wxChar *pathname, int mode ) -{ - return access( wxConvFile.cWX2MB( pathname ), mode ); -} - -WXDLLEXPORT int wxOpen( const wxChar *pathname, int flags, mode_t mode ) -{ - return open( wxConvFile.cWX2MB( pathname ), flags, mode ); -} - -#endif // wxNEED_WX_UNISTD_H - -#if wxUSE_UNICODE && defined __BORLANDC__ \ - && __BORLANDC__ >= 0x550 && __BORLANDC__ <= 0x551 - -// BCC 5.5 and 5.5.1 have a bug in _wopen where files are created read only -// regardless of the mode parameter. This hack works around the problem by -// setting the mode with _wchmod. -// -int wxOpen(const wchar_t *pathname, int flags, mode_t mode) -{ - int moreflags = 0; - - // we only want to fix the mode when the file is actually created, so - // when creating first try doing it O_EXCL so we can tell if the file - // was already there. - if ((flags & O_CREAT) && !(flags & O_EXCL) && (mode & wxS_IWUSR) != 0) - moreflags = O_EXCL; - - int fd = _wopen(pathname, flags | moreflags, mode); - - // the file was actually created and needs fixing - if (fd != -1 && (flags & O_CREAT) != 0 && (mode & wxS_IWUSR) != 0) - { - close(fd); - _wchmod(pathname, mode); - fd = _wopen(pathname, flags & ~(O_EXCL | O_CREAT)); - } - // the open failed, but it may have been because the added O_EXCL stopped - // the opening of an existing file, so try again without. - else if (fd == -1 && moreflags != 0) - { - fd = _wopen(pathname, flags & ~O_CREAT); - } - - return fd; -} - -#endif - -// ---------------------------------------------------------------------------- -// wxPathList -// ---------------------------------------------------------------------------- - -bool wxPathList::Add(const wxString& path) -{ - // add a path separator to force wxFileName to interpret it always as a directory - // (i.e. if we are called with '/home/user' we want to consider it a folder and - // not, as wxFileName would consider, a filename). - wxFileName fn(path + wxFileName::GetPathSeparator()); - - // add only normalized relative/absolute paths - // NB: we won't do wxPATH_NORM_DOTS in order to avoid problems when trying to - // normalize paths which starts with ".." (which can be normalized only if - // we use also wxPATH_NORM_ABSOLUTE - which we don't want to use). - if (!fn.Normalize(wxPATH_NORM_TILDE|wxPATH_NORM_LONG|wxPATH_NORM_ENV_VARS)) - return false; - - wxString toadd = fn.GetPath(); - if (Index(toadd) == wxNOT_FOUND) - wxArrayString::Add(toadd); // do not add duplicates - - return true; -} - -void wxPathList::Add(const wxArrayString &arr) -{ - for (size_t j=0; j < arr.GetCount(); j++) - Add(arr[j]); -} - -// Add paths e.g. from the PATH environment variable -void wxPathList::AddEnvList (const wxString& WXUNUSED_IN_WINCE(envVariable)) -{ - // No environment variables on WinCE -#ifndef __WXWINCE__ - - // The space has been removed from the tokenizers, otherwise a - // path such as "C:\Program Files" would be split into 2 paths: - // "C:\Program" and "Files"; this is true for both Windows and Unix. - - static const wxChar PATH_TOKS[] = -#if defined(__WINDOWS__) || defined(__OS2__) - wxT(";"); // Don't separate with colon in DOS (used for drive) -#else - wxT(":;"); -#endif - - wxString val; - if ( wxGetEnv(envVariable, &val) ) - { - // split into an array of string the value of the env var - wxArrayString arr = wxStringTokenize(val, PATH_TOKS); - WX_APPEND_ARRAY(*this, arr); - } -#endif // !__WXWINCE__ -} - -// Given a full filename (with path), ensure that that file can -// be accessed again USING FILENAME ONLY by adding the path -// to the list if not already there. -bool wxPathList::EnsureFileAccessible (const wxString& path) -{ - return Add(wxPathOnly(path)); -} - -#if WXWIN_COMPATIBILITY_2_6 -bool wxPathList::Member (const wxString& path) const -{ - return Index(path) != wxNOT_FOUND; -} -#endif - -wxString wxPathList::FindValidPath (const wxString& file) const -{ - // normalize the given string as it could be a path + a filename - // and not only a filename - wxFileName fn(file); - wxString strend; - - // NB: normalize without making absolute otherwise calling this function with - // e.g. "b/c.txt" would result in removing the directory 'b' and the for loop - // below would only add to the paths of this list the 'c.txt' part when doing - // the existence checks... - // NB: we don't use wxPATH_NORM_DOTS here, too (see wxPathList::Add for more info) - if (!fn.Normalize(wxPATH_NORM_TILDE|wxPATH_NORM_LONG|wxPATH_NORM_ENV_VARS)) - return wxEmptyString; - - wxASSERT_MSG(!fn.IsDir(), wxT("Cannot search for directories; only for files")); - if (fn.IsAbsolute()) - strend = fn.GetFullName(); // search for the file name and ignore the path part - else - strend = fn.GetFullPath(); - - for (size_t i=0; i 0) - { - if (buffer[i] == wxT('.')) - { - buffer[i] = 0; - break; - } - i --; - } -} - -void wxStripExtension(wxString& buffer) -{ - //RN: Be careful about the handling the case where - //buffer.length() == 0 - for(size_t i = buffer.length() - 1; i != wxString::npos; --i) - { - if (buffer.GetChar(i) == wxT('.')) - { - buffer = buffer.Left(i); - break; - } - } -} - -// Destructive removal of /./ and /../ stuff -wxChar *wxRealPath (wxChar *path) -{ -#ifdef __WXMSW__ - static const wxChar SEP = wxT('\\'); - wxUnix2DosFilename(path); -#else - static const wxChar SEP = wxT('/'); -#endif - if (path[0] && path[1]) { - /* MATTHEW: special case "/./x" */ - wxChar *p; - if (path[2] == SEP && path[1] == wxT('.')) - p = &path[0]; - else - p = &path[2]; - for (; *p; p++) - { - if (*p == SEP) - { - if (p[1] == wxT('.') && p[2] == wxT('.') && (p[3] == SEP || p[3] == wxT('\0'))) - { - wxChar *q; - for (q = p - 1; q >= path && *q != SEP; q--) - { - // Empty - } - - if (q[0] == SEP && (q[1] != wxT('.') || q[2] != wxT('.') || q[3] != SEP) - && (q - 1 <= path || q[-1] != SEP)) - { - wxStrcpy (q, p + 3); - if (path[0] == wxT('\0')) - { - path[0] = SEP; - path[1] = wxT('\0'); - } -#if defined(__WXMSW__) || defined(__OS2__) - /* Check that path[2] is NULL! */ - else if (path[1] == wxT(':') && !path[2]) - { - path[2] = SEP; - path[3] = wxT('\0'); - } -#endif - p = q - 1; - } - } - else if (p[1] == wxT('.') && (p[2] == SEP || p[2] == wxT('\0'))) - wxStrcpy (p, p + 2); - } - } - } - return path; -} - -wxString wxRealPath(const wxString& path) -{ - wxChar *buf1=MYcopystring(path); - wxChar *buf2=wxRealPath(buf1); - wxString buf(buf2); - delete [] buf1; - return buf; -} - - -// Must be destroyed -wxChar *wxCopyAbsolutePath(const wxString& filename) -{ - if (filename.empty()) - return (wxChar *) NULL; - - if (! wxIsAbsolutePath(wxExpandPath(wxFileFunctionsBuffer, filename))) - { - wxString buf = ::wxGetCwd(); - wxChar ch = buf.Last(); -#ifdef __WXMSW__ - if (ch != wxT('\\') && ch != wxT('/')) - buf << wxT("\\"); -#else - if (ch != wxT('/')) - buf << wxT("/"); -#endif - buf << wxFileFunctionsBuffer; - buf = wxRealPath( buf ); - return MYcopystring( buf ); - } - return MYcopystring( wxFileFunctionsBuffer ); -} - -/*- - Handles: - ~/ => home dir - ~user/ => user's home dir - If the environment variable a = "foo" and b = "bar" then: - Unix: - $a => foo - $a$b => foobar - $a.c => foo.c - xxx$a => xxxfoo - ${a}! => foo! - $(b)! => bar! - \$a => \$a - MSDOS: - $a ==> $a - $(a) ==> foo - $(a)$b ==> foo$b - $(a)$(b)==> foobar - test.$$ ==> test.$$ - */ - -/* input name in name, pathname output to buf. */ - -wxChar *wxExpandPath(wxChar *buf, const wxChar *name) -{ - register wxChar *d, *s, *nm; - wxChar lnm[_MAXPATHLEN]; - int q; - - // Some compilers don't like this line. -// const wxChar trimchars[] = wxT("\n \t"); - - wxChar trimchars[4]; - trimchars[0] = wxT('\n'); - trimchars[1] = wxT(' '); - trimchars[2] = wxT('\t'); - trimchars[3] = 0; - -#ifdef __WXMSW__ - const wxChar SEP = wxT('\\'); -#else - const wxChar SEP = wxT('/'); -#endif - buf[0] = wxT('\0'); - if (name == NULL || *name == wxT('\0')) - return buf; - nm = MYcopystring(name); // Make a scratch copy - wxChar *nm_tmp = nm; - - /* Skip leading whitespace and cr */ - while (wxStrchr((wxChar *)trimchars, *nm) != NULL) - nm++; - /* And strip off trailing whitespace and cr */ - s = nm + (q = wxStrlen(nm)) - 1; - while (q-- && wxStrchr((wxChar *)trimchars, *s) != NULL) - *s = wxT('\0'); - - s = nm; - d = lnm; -#ifdef __WXMSW__ - q = FALSE; -#else - q = nm[0] == wxT('\\') && nm[1] == wxT('~'); -#endif - - /* Expand inline environment variables */ -#ifdef __VISAGECPP__ - while (*d) - { - *d++ = *s; - if(*s == wxT('\\')) - { - *(d - 1) = *++s; - if (*d) - { - s++; - continue; - } - else - break; - } - else -#else - while ((*d++ = *s) != 0) { -# ifndef __WXMSW__ - if (*s == wxT('\\')) { - if ((*(d - 1) = *++s)!=0) { - s++; - continue; - } else - break; - } else -# endif -#endif - // No env variables on WinCE -#ifndef __WXWINCE__ -#ifdef __WXMSW__ - if (*s++ == wxT('$') && (*s == wxT('{') || *s == wxT(')'))) -#else - if (*s++ == wxT('$')) -#endif - { - register wxChar *start = d; - register int braces = (*s == wxT('{') || *s == wxT('(')); - register wxChar *value; - while ((*d++ = *s) != 0) - if (braces ? (*s == wxT('}') || *s == wxT(')')) : !(wxIsalnum(*s) || *s == wxT('_')) ) - break; - else - s++; - *--d = 0; - value = wxGetenv(braces ? start + 1 : start); - if (value) { - for ((d = start - 1); (*d++ = *value++) != 0;) - { - // Empty - } - - d--; - if (braces && *s) - s++; - } - } -#endif - // __WXWINCE__ - } - - /* Expand ~ and ~user */ - nm = lnm; - if (nm[0] == wxT('~') && !q) - { - /* prefix ~ */ - if (nm[1] == SEP || nm[1] == 0) - { /* ~/filename */ - // FIXME: wxGetUserHome could return temporary storage in Unicode mode - if ((s = WXSTRINGCAST wxGetUserHome(wxEmptyString)) != NULL) { - if (*++nm) - nm++; - } - } else - { /* ~user/filename */ - register wxChar *nnm; - register wxChar *home; - for (s = nm; *s && *s != SEP; s++) - { - // Empty - } - int was_sep; /* MATTHEW: Was there a separator, or NULL? */ - was_sep = (*s == SEP); - nnm = *s ? s + 1 : s; - *s = 0; - // FIXME: wxGetUserHome could return temporary storage in Unicode mode - if ((home = WXSTRINGCAST wxGetUserHome(wxString(nm + 1))) == NULL) - { - if (was_sep) /* replace only if it was there: */ - *s = SEP; - s = NULL; - } - else - { - nm = nnm; - s = home; - } - } - } - - d = buf; - if (s && *s) { /* MATTHEW: s could be NULL if user '~' didn't exist */ - /* Copy home dir */ - while (wxT('\0') != (*d++ = *s++)) - /* loop */; - // Handle root home - if (d - 1 > buf && *(d - 2) != SEP) - *(d - 1) = SEP; - } - s = nm; - while ((*d++ = *s++) != 0) - { - // Empty - } - delete[] nm_tmp; // clean up alloc - /* Now clean up the buffer */ - return wxRealPath(buf); -} - -/* Contract Paths to be build upon an environment variable - component: - - example: "/usr/openwin/lib", OPENWINHOME --> ${OPENWINHOME}/lib - - The call wxExpandPath can convert these back! - */ -wxChar * -wxContractPath (const wxString& filename, - const wxString& WXUNUSED_IN_WINCE(envname), - const wxString& user) -{ - static wxChar dest[_MAXPATHLEN]; - - if (filename.empty()) - return (wxChar *) NULL; - - wxStrcpy (dest, WXSTRINGCAST filename); -#ifdef __WXMSW__ - wxUnix2DosFilename(dest); -#endif - - // Handle environment - const wxChar *val; -#ifndef __WXWINCE__ - wxChar *tcp; - if (!envname.empty() && (val = wxGetenv (WXSTRINGCAST envname)) != NULL && - (tcp = wxStrstr (dest, val)) != NULL) - { - wxStrcpy (wxFileFunctionsBuffer, tcp + wxStrlen (val)); - *tcp++ = wxT('$'); - *tcp++ = wxT('{'); - wxStrcpy (tcp, WXSTRINGCAST envname); - wxStrcat (tcp, wxT("}")); - wxStrcat (tcp, wxFileFunctionsBuffer); - } -#endif - - // Handle User's home (ignore root homes!) - val = wxGetUserHome (user); - if (!val) - return dest; - - const size_t len = wxStrlen(val); - if (len <= 2) - return dest; - - if (wxStrncmp(dest, val, len) == 0) - { - wxStrcpy(wxFileFunctionsBuffer, wxT("~")); - if (!user.empty()) - wxStrcat(wxFileFunctionsBuffer, (const wxChar*) user); - wxStrcat(wxFileFunctionsBuffer, dest + len); - wxStrcpy (dest, wxFileFunctionsBuffer); - } - - return dest; -} - -// Return just the filename, not the path (basename) -wxChar *wxFileNameFromPath (wxChar *path) -{ - wxString p = path; - wxString n = wxFileNameFromPath(p); - - return path + p.length() - n.length(); -} - -wxString wxFileNameFromPath (const wxString& path) -{ - wxString name, ext; - wxFileName::SplitPath(path, NULL, &name, &ext); - - wxString fullname = name; - if ( !ext.empty() ) - { - fullname << wxFILE_SEP_EXT << ext; - } - - return fullname; -} - -// Return just the directory, or NULL if no directory -wxChar * -wxPathOnly (wxChar *path) -{ - if (path && *path) - { - static wxChar buf[_MAXPATHLEN]; - - // Local copy - wxStrcpy (buf, path); - - int l = wxStrlen(path); - int i = l - 1; - - // Search backward for a backward or forward slash - while (i > -1) - { -#if defined(__WXMAC__) && !defined(__DARWIN__) - // Classic or Carbon CodeWarrior like - // Carbon with Apple DevTools is Unix like - if (path[i] == wxT(':') ) - { - buf[i] = 0; - return buf; - } -#else - // Unix like or Windows - if (path[i] == wxT('/') || path[i] == wxT('\\')) - { - buf[i] = 0; - return buf; - } -#endif -#ifdef __VMS__ - if (path[i] == wxT(']')) - { - buf[i+1] = 0; - return buf; - } -#endif - i --; - } - -#if defined(__WXMSW__) || defined(__OS2__) - // Try Drive specifier - if (wxIsalpha (buf[0]) && buf[1] == wxT(':')) - { - // A:junk --> A:. (since A:.\junk Not A:\junk) - buf[2] = wxT('.'); - buf[3] = wxT('\0'); - return buf; - } -#endif - } - return (wxChar *) NULL; -} - -// Return just the directory, or NULL if no directory -wxString wxPathOnly (const wxString& path) -{ - if (!path.empty()) - { - wxChar buf[_MAXPATHLEN]; - - // Local copy - wxStrcpy (buf, WXSTRINGCAST path); - - int l = path.length(); - int i = l - 1; - - // Search backward for a backward or forward slash - while (i > -1) - { -#if defined(__WXMAC__) && !defined(__DARWIN__) - // Classic or Carbon CodeWarrior like - // Carbon with Apple DevTools is Unix like - if (path[i] == wxT(':') ) - { - buf[i] = 0; - return wxString(buf); - } -#else - // Unix like or Windows - if (path[i] == wxT('/') || path[i] == wxT('\\')) - { - // Don't return an empty string - if (i == 0) - i ++; - buf[i] = 0; - return wxString(buf); - } -#endif -#ifdef __VMS__ - if (path[i] == wxT(']')) - { - buf[i+1] = 0; - return wxString(buf); - } -#endif - i --; - } - -#if defined(__WXMSW__) || defined(__OS2__) - // Try Drive specifier - if (wxIsalpha (buf[0]) && buf[1] == wxT(':')) - { - // A:junk --> A:. (since A:.\junk Not A:\junk) - buf[2] = wxT('.'); - buf[3] = wxT('\0'); - return wxString(buf); - } -#endif - } - return wxEmptyString; -} - -// Utility for converting delimiters in DOS filenames to UNIX style -// and back again - or we get nasty problems with delimiters. -// Also, convert to lower case, since case is significant in UNIX. - -#if defined(__WXMAC__) - -#if TARGET_API_MAC_OSX -#define kDefaultPathStyle kCFURLPOSIXPathStyle -#else -#define kDefaultPathStyle kCFURLHFSPathStyle -#endif - -wxString wxMacFSRefToPath( const FSRef *fsRef , CFStringRef additionalPathComponent ) -{ - CFURLRef fullURLRef; - fullURLRef = CFURLCreateFromFSRef(NULL, fsRef); - if ( additionalPathComponent ) - { - CFURLRef parentURLRef = fullURLRef ; - fullURLRef = CFURLCreateCopyAppendingPathComponent(NULL, parentURLRef, - additionalPathComponent,false); - CFRelease( parentURLRef ) ; - } - CFStringRef cfString = CFURLCopyFileSystemPath(fullURLRef, kDefaultPathStyle); - CFRelease( fullURLRef ) ; - CFMutableStringRef cfMutableString = CFStringCreateMutableCopy(NULL, 0, cfString); - CFRelease( cfString ); - CFStringNormalize(cfMutableString,kCFStringNormalizationFormC); - return wxMacCFStringHolder(cfMutableString).AsString(); -} - -OSStatus wxMacPathToFSRef( const wxString&path , FSRef *fsRef ) -{ - OSStatus err = noErr ; - CFMutableStringRef cfMutableString = CFStringCreateMutableCopy(NULL, 0, wxMacCFStringHolder(path)); - CFStringNormalize(cfMutableString,kCFStringNormalizationFormD); - CFURLRef url = CFURLCreateWithFileSystemPath(kCFAllocatorDefault, cfMutableString , kDefaultPathStyle, false); - CFRelease( cfMutableString ); - if ( NULL != url ) - { - if ( CFURLGetFSRef(url, fsRef) == false ) - err = fnfErr ; - CFRelease( url ) ; - } - else - { - err = fnfErr ; - } - return err ; -} - -wxString wxMacHFSUniStrToString( ConstHFSUniStr255Param uniname ) -{ - CFStringRef cfname = CFStringCreateWithCharacters( kCFAllocatorDefault, - uniname->unicode, - uniname->length ); - CFMutableStringRef cfMutableString = CFStringCreateMutableCopy(NULL, 0, cfname); - CFRelease( cfname ); - CFStringNormalize(cfMutableString,kCFStringNormalizationFormC); - return wxMacCFStringHolder(cfMutableString).AsString() ; -} - -#ifndef __LP64__ - -wxString wxMacFSSpec2MacFilename( const FSSpec *spec ) -{ - FSRef fsRef ; - if ( FSpMakeFSRef( spec , &fsRef) == noErr ) - { - return wxMacFSRefToPath( &fsRef ) ; - } - return wxEmptyString ; -} - -void wxMacFilename2FSSpec( const wxString& path , FSSpec *spec ) -{ - OSStatus err = noErr ; - FSRef fsRef ; - wxMacPathToFSRef( path , &fsRef ) ; - err = FSRefMakeFSSpec( &fsRef , spec ) ; -} -#endif - -#endif // __WXMAC__ - -void -wxDos2UnixFilename (wxChar *s) -{ - if (s) - while (*s) - { - if (*s == _T('\\')) - *s = _T('/'); -#ifdef __WXMSW__ - else - *s = (wxChar)wxTolower (*s); // Case INDEPENDENT -#endif - s++; - } -} - -void -#if defined(__WXMSW__) || defined(__OS2__) -wxUnix2DosFilename (wxChar *s) -#else -wxUnix2DosFilename (wxChar *WXUNUSED(s) ) -#endif -{ -// Yes, I really mean this to happen under DOS only! JACS -#if defined(__WXMSW__) || defined(__OS2__) - if (s) - while (*s) - { - if (*s == wxT('/')) - *s = wxT('\\'); - s++; - } -#endif -} - -// Concatenate two files to form third -bool -wxConcatFiles (const wxString& file1, const wxString& file2, const wxString& file3) -{ -#if wxUSE_FILE - - wxFile in1(file1), in2(file2); - wxTempFile out(file3); - - if ( !in1.IsOpened() || !in2.IsOpened() || !out.IsOpened() ) - return false; - - ssize_t ofs; - unsigned char buf[1024]; - - for( int i=0; i<2; i++) - { - wxFile *in = i==0 ? &in1 : &in2; - do{ - if ( (ofs = in->Read(buf,WXSIZEOF(buf))) == wxInvalidOffset ) return false; - if ( ofs > 0 ) - if ( !out.Write(buf,ofs) ) - return false; - } while ( ofs == (ssize_t)WXSIZEOF(buf) ); - } - - return out.Commit(); - -#else - - wxUnusedVar(file1); - wxUnusedVar(file2); - wxUnusedVar(file3); - return false; - -#endif -} - -// Copy files -bool -wxCopyFile (const wxString& file1, const wxString& file2, bool overwrite) -{ -#if defined(__WIN32__) && !defined(__WXMICROWIN__) - // CopyFile() copies file attributes and modification time too, so use it - // instead of our code if available - // - // NB: 3rd parameter is bFailIfExists i.e. the inverse of overwrite - if ( !::CopyFile(file1, file2, !overwrite) ) - { - wxLogSysError(_("Failed to copy the file '%s' to '%s'"), - file1.c_str(), file2.c_str()); - - return false; - } -#elif defined(__OS2__) - if ( ::DosCopy((PSZ)file1.c_str(), (PSZ)file2.c_str(), overwrite ? DCPY_EXISTING : 0) != 0 ) - return false; -#elif defined(__PALMOS__) - // TODO with http://www.palmos.com/dev/support/docs/protein_books/Memory_Databases_Files/ - return false; -#elif wxUSE_FILE // !Win32 - - wxStructStat fbuf; - // get permissions of file1 - if ( wxStat( file1.c_str(), &fbuf) != 0 ) - { - // the file probably doesn't exist or we haven't the rights to read - // from it anyhow - wxLogSysError(_("Impossible to get permissions for file '%s'"), - file1.c_str()); - return false; - } - - // open file1 for reading - wxFile fileIn(file1, wxFile::read); - if ( !fileIn.IsOpened() ) - return false; - - // remove file2, if it exists. This is needed for creating - // file2 with the correct permissions in the next step - if ( wxFileExists(file2) && (!overwrite || !wxRemoveFile(file2))) - { - wxLogSysError(_("Impossible to overwrite the file '%s'"), - file2.c_str()); - return false; - } - - // reset the umask as we want to create the file with exactly the same - // permissions as the original one - wxCHANGE_UMASK(0); - - // create file2 with the same permissions than file1 and open it for - // writing - - wxFile fileOut; - if ( !fileOut.Create(file2, overwrite, fbuf.st_mode & 0777) ) - return false; - - // copy contents of file1 to file2 - char buf[4096]; - size_t count; - for ( ;; ) - { - count = fileIn.Read(buf, WXSIZEOF(buf)); - if ( fileIn.Error() ) - return false; - - // end of file? - if ( !count ) - break; - - if ( fileOut.Write(buf, count) < count ) - return false; - } - - // we can expect fileIn to be closed successfully, but we should ensure - // that fileOut was closed as some write errors (disk full) might not be - // detected before doing this - if ( !fileIn.Close() || !fileOut.Close() ) - return false; - -#if !defined(__VISAGECPP__) && !defined(__WXMAC__) || defined(__UNIX__) - // no chmod in VA. Should be some permission API for HPFS386 partitions - // however - if ( chmod(OS_FILENAME(file2), fbuf.st_mode) != 0 ) - { - wxLogSysError(_("Impossible to set permissions for the file '%s'"), - file2.c_str()); - return false; - } -#endif // OS/2 || Mac - -#else // !Win32 && ! wxUSE_FILE - - // impossible to simulate with wxWidgets API - wxUnusedVar(file1); - wxUnusedVar(file2); - wxUnusedVar(overwrite); - return false; - -#endif // __WXMSW__ && __WIN32__ - - return true; -} - -bool -wxRenameFile(const wxString& file1, const wxString& file2, bool overwrite) -{ - if ( !overwrite && wxFileExists(file2) ) - { - wxLogSysError - ( - _("Failed to rename the file '%s' to '%s' because the destination file already exists."), - file1.c_str(), file2.c_str() - ); - - return false; - } - -#if !defined(__WXWINCE__) && !defined(__WXPALMOS__) - // Normal system call - if ( wxRename (file1, file2) == 0 ) - return true; -#endif - - // Try to copy - if (wxCopyFile(file1, file2, overwrite)) { - wxRemoveFile(file1); - return true; - } - // Give up - return false; -} - -bool wxRemoveFile(const wxString& file) -{ -#if defined(__VISUALC__) \ - || defined(__BORLANDC__) \ - || defined(__WATCOMC__) \ - || defined(__DMC__) \ - || defined(__GNUWIN32__) \ - || (defined(__MWERKS__) && defined(__MSL__)) - int res = wxRemove(file); -#elif defined(__WXMAC__) - int res = unlink(wxFNCONV(file)); -#elif defined(__WXPALMOS__) - int res = 1; - // TODO with VFSFileDelete() -#else - int res = unlink(OS_FILENAME(file)); -#endif - - return res == 0; -} - -bool wxMkdir(const wxString& dir, int perm) -{ -#if defined(__WXPALMOS__) - return false; -#elif defined(__WXMAC__) && !defined(__UNIX__) - return (mkdir( wxFNCONV(dir) , 0 ) == 0); -#else // !Mac - const wxChar *dirname = dir.c_str(); - - // assume mkdir() has 2 args on non Windows-OS/2 platforms and on Windows too - // for the GNU compiler -#if (!(defined(__WXMSW__) || defined(__OS2__) || defined(__DOS__))) || (defined(__GNUWIN32__) && !defined(__MINGW32__)) || defined(__WINE__) || defined(__WXMICROWIN__) - #if defined(MSVCRT) - wxUnusedVar(perm); - if ( mkdir(wxFNCONV(dirname)) != 0 ) - #else - if ( mkdir(wxFNCONV(dirname), perm) != 0 ) - #endif -#elif defined(__OS2__) - wxUnusedVar(perm); - if (::DosCreateDir((PSZ)dirname, NULL) != 0) // enhance for EAB's?? -#elif defined(__DOS__) - #if defined(__WATCOMC__) - (void)perm; - if ( wxMkDir(wxFNSTRINGCAST wxFNCONV(dirname)) != 0 ) - #elif defined(__DJGPP__) - if ( mkdir(wxFNCONV(dirname), perm) != 0 ) - #else - #error "Unsupported DOS compiler!" - #endif -#else // !MSW, !DOS and !OS/2 VAC++ - wxUnusedVar(perm); -#ifdef __WXWINCE__ - if ( !CreateDirectory(dirname, NULL) ) -#else - if ( wxMkDir(dir.fn_str()) != 0 ) -#endif -#endif // !MSW/MSW - { - wxLogSysError(_("Directory '%s' couldn't be created"), dirname); - - return false; - } - - return true; -#endif // Mac/!Mac -} - -bool wxRmdir(const wxString& dir, int WXUNUSED(flags)) -{ -#if defined(__VMS__) - return false; //to be changed since rmdir exists in VMS7.x -#elif defined(__OS2__) - return (::DosDeleteDir((PSZ)dir.c_str()) == 0); -#elif defined(__WXWINCE__) - return (RemoveDirectory(dir) != 0); -#elif defined(__WXPALMOS__) - // TODO with VFSFileRename() - return false; -#else - return (wxRmDir(OS_FILENAME(dir)) == 0); -#endif -} - -// does the path exists? (may have or not '/' or '\\' at the end) -bool wxDirExists(const wxChar *pszPathName) -{ - wxString strPath(pszPathName); - -#if defined(__WINDOWS__) || defined(__OS2__) - // Windows fails to find directory named "c:\dir\" even if "c:\dir" exists, - // so remove all trailing backslashes from the path - but don't do this for - // the paths "d:\" (which are different from "d:") nor for just "\" - while ( wxEndsWithPathSeparator(strPath) ) - { - size_t len = strPath.length(); - if ( len == 1 || (len == 3 && strPath[len - 2] == _T(':')) ) - break; - - strPath.Truncate(len - 1); - } -#endif // __WINDOWS__ - -#ifdef __OS2__ - // OS/2 can't handle "d:", it wants either "d:\" or "d:." - if (strPath.length() == 2 && strPath[1u] == _T(':')) - strPath << _T('.'); -#endif - -#if defined(__WXPALMOS__) - return false; -#elif defined(__WIN32__) && !defined(__WXMICROWIN__) - // stat() can't cope with network paths - DWORD ret = ::GetFileAttributes(strPath); - - return (ret != (DWORD)-1) && (ret & FILE_ATTRIBUTE_DIRECTORY); -#elif defined(__OS2__) - FILESTATUS3 Info = {{0}}; - APIRET rc = ::DosQueryPathInfo((PSZ)(WXSTRINGCAST strPath), FIL_STANDARD, - (void*) &Info, sizeof(FILESTATUS3)); - - return ((rc == NO_ERROR) && (Info.attrFile & FILE_DIRECTORY)) || - (rc == ERROR_SHARING_VIOLATION); - // If we got a sharing violation, there must be something with this name. -#else // !__WIN32__ - - wxStructStat st; -#ifndef __VISAGECPP__ - return wxStat(strPath.c_str(), &st) == 0 && ((st.st_mode & S_IFMT) == S_IFDIR); -#else - // S_IFMT not supported in VA compilers.. st_mode is a 2byte value only - return wxStat(pszPathName, &st) == 0 && (st.st_mode == S_IFDIR); -#endif - -#endif // __WIN32__/!__WIN32__ -} - -// Get a temporary filename, opening and closing the file. -wxChar *wxGetTempFileName(const wxString& prefix, wxChar *buf) -{ - wxString filename; - if ( !wxGetTempFileName(prefix, filename) ) - return NULL; - - if ( buf ) - wxStrcpy(buf, filename); - else - buf = MYcopystring(filename); - - return buf; -} - -bool wxGetTempFileName(const wxString& prefix, wxString& buf) -{ -#if wxUSE_FILE - buf = wxFileName::CreateTempFileName(prefix); - - return !buf.empty(); -#else // !wxUSE_FILE - wxUnusedVar(prefix); - wxUnusedVar(buf); - - return false; -#endif // wxUSE_FILE/!wxUSE_FILE -} - -// Get first file name matching given wild card. - -static wxDir *gs_dir = NULL; -static wxString gs_dirPath; - -wxString wxFindFirstFile(const wxChar *spec, int flags) -{ - wxSplitPath(spec, &gs_dirPath, NULL, NULL); - if ( gs_dirPath.empty() ) - gs_dirPath = wxT("."); - if ( !wxEndsWithPathSeparator(gs_dirPath ) ) - gs_dirPath << wxFILE_SEP_PATH; - - if (gs_dir) - delete gs_dir; - gs_dir = new wxDir(gs_dirPath); - - if ( !gs_dir->IsOpened() ) - { - wxLogSysError(_("Can not enumerate files '%s'"), spec); - return wxEmptyString; - } - - int dirFlags; - switch (flags) - { - case wxDIR: dirFlags = wxDIR_DIRS; break; - case wxFILE: dirFlags = wxDIR_FILES; break; - default: dirFlags = wxDIR_DIRS | wxDIR_FILES; break; - } - - wxString result; - gs_dir->GetFirst(&result, wxFileNameFromPath(wxString(spec)), dirFlags); - if ( result.empty() ) - { - wxDELETE(gs_dir); - return result; - } - - return gs_dirPath + result; -} - -wxString wxFindNextFile() -{ - wxASSERT_MSG( gs_dir, wxT("You must call wxFindFirstFile before!") ); - - wxString result; - gs_dir->GetNext(&result); - - if ( result.empty() ) - { - wxDELETE(gs_dir); - return result; - } - - return gs_dirPath + result; -} - - -// Get current working directory. -// If buf is NULL, allocates space using new, else copies into buf. -// wxGetWorkingDirectory() is obsolete, use wxGetCwd() -// wxDoGetCwd() is their common core to be moved -// to wxGetCwd() once wxGetWorkingDirectory() will be removed. -// Do not expose wxDoGetCwd in headers! - -wxChar *wxDoGetCwd(wxChar *buf, int sz) -{ -#if defined(__WXPALMOS__) - // TODO - if(buf && sz>0) buf[0] = _T('\0'); - return buf; -#elif defined(__WXWINCE__) - // TODO - if(buf && sz>0) buf[0] = _T('\0'); - return buf; -#else - if ( !buf ) - { - buf = new wxChar[sz + 1]; - } - - bool ok wxDUMMY_INITIALIZE(false); - - // for the compilers which have Unicode version of _getcwd(), call it - // directly, for the others call the ANSI version and do the translation -#if !wxUSE_UNICODE - #define cbuf buf -#else // wxUSE_UNICODE - bool needsANSI = true; - - #if !defined(HAVE_WGETCWD) || wxUSE_UNICODE_MSLU - char cbuf[_MAXPATHLEN]; - #endif - - #ifdef HAVE_WGETCWD - #if wxUSE_UNICODE_MSLU - if ( wxGetOsVersion() != wxOS_WINDOWS_9X ) - #else - char *cbuf = NULL; // never really used because needsANSI will always be false - #endif - { - ok = _wgetcwd(buf, sz) != NULL; - needsANSI = false; - } - #endif - - if ( needsANSI ) -#endif // wxUSE_UNICODE - { - #if defined(_MSC_VER) || defined(__MINGW32__) - ok = _getcwd(cbuf, sz) != NULL; - #elif defined(__WXMAC__) && !defined(__DARWIN__) - char lbuf[1024] ; - if ( getcwd( lbuf , sizeof( lbuf ) ) ) - { - wxString res( lbuf , *wxConvCurrent ) ; - wxStrcpy( buf , res ) ; - ok = true; - } - else - ok = false ; - #elif defined(__OS2__) - APIRET rc; - ULONG ulDriveNum = 0; - ULONG ulDriveMap = 0; - rc = ::DosQueryCurrentDisk(&ulDriveNum, &ulDriveMap); - ok = rc == 0; - if (ok) - { - sz -= 3; - rc = ::DosQueryCurrentDir( 0 // current drive - ,(PBYTE)cbuf + 3 - ,(PULONG)&sz - ); - cbuf[0] = char('A' + (ulDriveNum - 1)); - cbuf[1] = ':'; - cbuf[2] = '\\'; - ok = rc == 0; - } - #else // !Win32/VC++ !Mac !OS2 - ok = getcwd(cbuf, sz) != NULL; - #endif // platform - - #if wxUSE_UNICODE && !(defined(__WXMAC__) && !defined(__DARWIN__)) - // finally convert the result to Unicode if needed - wxConvFile.MB2WC(buf, cbuf, sz); - #endif // wxUSE_UNICODE - } - - if ( !ok ) - { - wxLogSysError(_("Failed to get the working directory")); - - // VZ: the old code used to return "." on error which didn't make any - // sense at all to me - empty string is a better error indicator - // (NULL might be even better but I'm afraid this could lead to - // problems with the old code assuming the return is never NULL) - buf[0] = _T('\0'); - } - else // ok, but we might need to massage the path into the right format - { -#ifdef __DJGPP__ - // VS: DJGPP is a strange mix of DOS and UNIX API and returns paths - // with / deliminers. We don't like that. - for (wxChar *ch = buf; *ch; ch++) - { - if (*ch == wxT('/')) - *ch = wxT('\\'); - } -#endif // __DJGPP__ - -// MBN: we hope that in the case the user is compiling a GTK+/Motif app, -// he needs Unix as opposed to Win32 pathnames -#if defined( __CYGWIN__ ) && defined( __WINDOWS__ ) - // another example of DOS/Unix mix (Cygwin) - wxString pathUnix = buf; -#if wxUSE_UNICODE - char bufA[_MAXPATHLEN]; - cygwin_conv_to_full_win32_path(pathUnix.mb_str(wxConvFile), bufA); - wxConvFile.MB2WC(buf, bufA, sz); -#else - cygwin_conv_to_full_win32_path(pathUnix, buf); -#endif // wxUSE_UNICODE -#endif // __CYGWIN__ - } - - return buf; - -#if !wxUSE_UNICODE - #undef cbuf -#endif - -#endif - // __WXWINCE__ -} - -#if WXWIN_COMPATIBILITY_2_6 -wxChar *wxGetWorkingDirectory(wxChar *buf, int sz) -{ - return wxDoGetCwd(buf,sz); -} -#endif // WXWIN_COMPATIBILITY_2_6 - -wxString wxGetCwd() -{ - wxString str; - wxDoGetCwd(wxStringBuffer(str, _MAXPATHLEN), _MAXPATHLEN); - return str; -} - -bool wxSetWorkingDirectory(const wxString& d) -{ -#if defined(__OS2__) - if (d[1] == ':') - { - ::DosSetDefaultDisk(1 + wxToupper(d[0]) - _T('A')); - // do not call DosSetCurrentDir when just changing drive, - // since it requires e.g. "d:." instead of "d:"! - if (d.length() == 2) - return true; - } - return (::DosSetCurrentDir((PSZ)d.c_str()) == 0); -#elif defined(__UNIX__) || defined(__WXMAC__) || defined(__DOS__) - return (chdir(wxFNSTRINGCAST d.fn_str()) == 0); -#elif defined(__WINDOWS__) - -#ifdef __WIN32__ -#ifdef __WXWINCE__ - // No equivalent in WinCE - wxUnusedVar(d); - return false; -#else - return (bool)(SetCurrentDirectory(d) != 0); -#endif -#else - // Must change drive, too. - bool isDriveSpec = ((strlen(d) > 1) && (d[1] == ':')); - if (isDriveSpec) - { - wxChar firstChar = d[0]; - - // To upper case - if (firstChar > 90) - firstChar = firstChar - 32; - - // To a drive number - unsigned int driveNo = firstChar - 64; - if (driveNo > 0) - { - unsigned int noDrives; - _dos_setdrive(driveNo, &noDrives); - } - } - bool success = (chdir(WXSTRINGCAST d) == 0); - - return success; -#endif - -#endif -} - -// Get the OS directory if appropriate (such as the Windows directory). -// On non-Windows platform, probably just return the empty string. -wxString wxGetOSDirectory() -{ -#ifdef __WXWINCE__ - return wxString(wxT("\\Windows")); -#elif defined(__WINDOWS__) && !defined(__WXMICROWIN__) - wxChar buf[256]; - GetWindowsDirectory(buf, 256); - return wxString(buf); -#elif defined(__WXMAC__) - return wxMacFindFolder(kOnSystemDisk, 'macs', false); -#else - return wxEmptyString; -#endif -} - -bool wxEndsWithPathSeparator(const wxChar *pszFileName) -{ - size_t len = wxStrlen(pszFileName); - - return len && wxIsPathSeparator(pszFileName[len - 1]); -} - -// find a file in a list of directories, returns false if not found -bool wxFindFileInPath(wxString *pStr, const wxChar *pszPath, const wxChar *pszFile) -{ - // we assume that it's not empty - wxCHECK_MSG( !wxIsEmpty(pszFile), false, - _T("empty file name in wxFindFileInPath")); - - // skip path separator in the beginning of the file name if present - if ( wxIsPathSeparator(*pszFile) ) - pszFile++; - - // copy the path (strtok will modify it) - wxChar *szPath = new wxChar[wxStrlen(pszPath) + 1]; - wxStrcpy(szPath, pszPath); - - wxString strFile; - wxChar *pc, *save_ptr; - for ( pc = wxStrtok(szPath, wxPATH_SEP, &save_ptr); - pc != NULL; - pc = wxStrtok((wxChar *) NULL, wxPATH_SEP, &save_ptr) ) - { - // search for the file in this directory - strFile = pc; - if ( !wxEndsWithPathSeparator(pc) ) - strFile += wxFILE_SEP_PATH; - strFile += pszFile; - - if ( wxFileExists(strFile) ) { - *pStr = strFile; - break; - } - } - - // suppress warning about unused variable save_ptr when wxStrtok() is a - // macro which throws away its third argument - save_ptr = pc; - - delete [] szPath; - - return pc != NULL; // if true => we breaked from the loop -} - -void WXDLLEXPORT wxSplitPath(const wxChar *pszFileName, - wxString *pstrPath, - wxString *pstrName, - wxString *pstrExt) -{ - // it can be empty, but it shouldn't be NULL - wxCHECK_RET( pszFileName, wxT("NULL file name in wxSplitPath") ); - - wxFileName::SplitPath(pszFileName, pstrPath, pstrName, pstrExt); -} - -#if wxUSE_DATETIME - -time_t WXDLLEXPORT wxFileModificationTime(const wxString& filename) -{ - wxDateTime mtime; - if ( !wxFileName(filename).GetTimes(NULL, &mtime, NULL) ) - return (time_t)-1; - - return mtime.GetTicks(); -} - -#endif // wxUSE_DATETIME - - -// Parses the filterStr, returning the number of filters. -// Returns 0 if none or if there's a problem. -// filterStr is in the form: "All files (*.*)|*.*|JPEG Files (*.jpeg)|*.jpeg" - -int WXDLLEXPORT wxParseCommonDialogsFilter(const wxString& filterStr, - wxArrayString& descriptions, - wxArrayString& filters) -{ - descriptions.Clear(); - filters.Clear(); - - wxString str(filterStr); - - wxString description, filter; - int pos = 0; - while( pos != wxNOT_FOUND ) - { - pos = str.Find(wxT('|')); - if ( pos == wxNOT_FOUND ) - { - // if there are no '|'s at all in the string just take the entire - // string as filter and make description empty for later autocompletion - if ( filters.IsEmpty() ) - { - descriptions.Add(wxEmptyString); - filters.Add(filterStr); - } - else - { - wxFAIL_MSG( _T("missing '|' in the wildcard string!") ); - } - - break; - } - - description = str.Left(pos); - str = str.Mid(pos + 1); - pos = str.Find(wxT('|')); - if ( pos == wxNOT_FOUND ) - { - filter = str; - } - else - { - filter = str.Left(pos); - str = str.Mid(pos + 1); - } - - descriptions.Add(description); - filters.Add(filter); - } - -#if defined(__WXMOTIF__) - // split it so there is one wildcard per entry - for( size_t i = 0 ; i < descriptions.GetCount() ; i++ ) - { - pos = filters[i].Find(wxT(';')); - if (pos != wxNOT_FOUND) - { - // first split only filters - descriptions.Insert(descriptions[i],i+1); - filters.Insert(filters[i].Mid(pos+1),i+1); - filters[i]=filters[i].Left(pos); - - // autoreplace new filter in description with pattern: - // C/C++ Files(*.cpp;*.c;*.h)|*.cpp;*.c;*.h - // cause split into: - // C/C++ Files(*.cpp)|*.cpp - // C/C++ Files(*.c;*.h)|*.c;*.h - // and next iteration cause another split into: - // C/C++ Files(*.cpp)|*.cpp - // C/C++ Files(*.c)|*.c - // C/C++ Files(*.h)|*.h - for ( size_t k=i;kbefore.Find(_T(')'),true)) - { - before = before.Left(pos+1); - before << filters[k]; - pos = after.Find(_T(')')); - int pos1 = after.Find(_T('(')); - if (pos != wxNOT_FOUND && (pos -* -* The match procedure is public domain code (from ircII's reg.c) -* but modified to suit our tastes (RN: No "%" syntax I guess) -*/ - -bool wxMatchWild( const wxString& pat, const wxString& text, bool dot_special ) -{ - if (text.empty()) - { - /* Match if both are empty. */ - return pat.empty(); - } - - const wxChar *m = pat.c_str(), - *n = text.c_str(), - *ma = NULL, - *na = NULL; - int just = 0, - acount = 0, - count = 0; - - if (dot_special && (*n == wxT('.'))) - { - /* Never match so that hidden Unix files - * are never found. */ - return false; - } - - for (;;) - { - if (*m == wxT('*')) - { - ma = ++m; - na = n; - just = 1; - acount = count; - } - else if (*m == wxT('?')) - { - m++; - if (!*n++) - return false; - } - else - { - if (*m == wxT('\\')) - { - m++; - /* Quoting "nothing" is a bad thing */ - if (!*m) - return false; - } - if (!*m) - { - /* - * If we are out of both strings or we just - * saw a wildcard, then we can say we have a - * match - */ - if (!*n) - return true; - if (just) - return true; - just = 0; - goto not_matched; - } - /* - * We could check for *n == NULL at this point, but - * since it's more common to have a character there, - * check to see if they match first (m and n) and - * then if they don't match, THEN we can check for - * the NULL of n - */ - just = 0; - if (*m == *n) - { - m++; - count++; - n++; - } - else - { - - not_matched: - - /* - * If there are no more characters in the - * string, but we still need to find another - * character (*m != NULL), then it will be - * impossible to match it - */ - if (!*n) - return false; - - if (ma) - { - m = ma; - n = ++na; - count = acount; - } - else - return false; - } - } - } -} - -#ifdef __VISUALC__ - #pragma warning(default:4706) // assignment within conditional expression -#endif // VC++ diff --git a/wxWidgets/src/common/filename.cpp b/wxWidgets/src/common/filename.cpp deleted file mode 100644 index f50c409279..0000000000 --- a/wxWidgets/src/common/filename.cpp +++ /dev/null @@ -1,2558 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/common/filename.cpp -// Purpose: wxFileName - encapsulates a file path -// Author: Robert Roebling, Vadim Zeitlin -// Modified by: -// Created: 28.12.2000 -// RCS-ID: $Id: filename.cpp 66915 2011-02-16 21:46:49Z JS $ -// Copyright: (c) 2000 Robert Roebling -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -/* - Here are brief descriptions of the filename formats supported by this class: - - wxPATH_UNIX: standard Unix format, used under Darwin as well, absolute file - names have the form: - /dir1/dir2/.../dirN/filename, "." and ".." stand for the - current and parent directory respectively, "~" is parsed as the - user HOME and "~username" as the HOME of that user - - wxPATH_DOS: DOS/Windows format, absolute file names have the form: - drive:\dir1\dir2\...\dirN\filename.ext where drive is a single - letter. "." and ".." as for Unix but no "~". - - There are also UNC names of the form \\share\fullpath - - wxPATH_MAC: Mac OS 8/9 and Mac OS X under CodeWarrior 7 format, absolute file - names have the form - volume:dir1:...:dirN:filename - and the relative file names are either - :dir1:...:dirN:filename - or just - filename - (although :filename works as well). - Since the volume is just part of the file path, it is not - treated like a separate entity as it is done under DOS and - VMS, it is just treated as another dir. - - wxPATH_VMS: VMS native format, absolute file names have the form - :[dir1.dir2.dir3]file.txt - or - :[000000.dir1.dir2.dir3]file.txt - - the is the physical device (i.e. disk). 000000 is the - root directory on the device which can be omitted. - - Note that VMS uses different separators unlike Unix: - : always after the device. If the path does not contain : than - the default (the device of the current directory) is assumed. - [ start of directory specification - . separator between directory and subdirectory - ] between directory and file - */ - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ -#pragma hdrstop -#endif - -#ifndef WX_PRECOMP - #ifdef __WXMSW__ - #include "wx/msw/wrapwin.h" // For GetShort/LongPathName - #endif - #include "wx/dynarray.h" - #include "wx/intl.h" - #include "wx/log.h" - #include "wx/utils.h" -#endif - -#include "wx/filename.h" -#include "wx/private/filename.h" -#include "wx/tokenzr.h" -#include "wx/config.h" // for wxExpandEnvVars -#include "wx/dynlib.h" - -#if defined(__WIN32__) && defined(__MINGW32__) - #include "wx/msw/gccpriv.h" -#endif - -#ifdef __WXWINCE__ -#include "wx/msw/private.h" -#endif - -#if defined(__WXMAC__) - #include "wx/mac/private.h" // includes mac headers -#endif - -// utime() is POSIX so should normally be available on all Unices -#ifdef __UNIX_LIKE__ -#include -#include -#include -#include -#endif - -#ifdef __DJGPP__ -#include -#endif - -#ifdef __MWERKS__ -#ifdef __MACH__ -#include -#include -#include -#include -#else -#include -#include -#include -#endif -#endif - -#ifdef __WATCOMC__ -#include -#include -#include -#endif - -#ifdef __VISAGECPP__ -#ifndef MAX_PATH -#define MAX_PATH 256 -#endif -#endif - -#ifdef __EMX__ -#include -#define MAX_PATH _MAX_PATH -#endif - - -wxULongLong wxInvalidSize = (unsigned)-1; - - -// ---------------------------------------------------------------------------- -// private classes -// ---------------------------------------------------------------------------- - -// small helper class which opens and closes the file - we use it just to get -// a file handle for the given file name to pass it to some Win32 API function -#if defined(__WIN32__) && !defined(__WXMICROWIN__) - -class wxFileHandle -{ -public: - enum OpenMode - { - Read, - Write - }; - - wxFileHandle(const wxString& filename, OpenMode mode, int flags = 0) - { - m_hFile = ::CreateFile - ( - filename, // name - mode == Read ? GENERIC_READ // access mask - : GENERIC_WRITE, - FILE_SHARE_READ | // sharing mode - FILE_SHARE_WRITE, // (allow everything) - NULL, // no secutity attr - OPEN_EXISTING, // creation disposition - flags, // flags - NULL // no template file - ); - - if ( m_hFile == INVALID_HANDLE_VALUE ) - { - wxLogSysError(_("Failed to open '%s' for %s"), - filename.c_str(), - mode == Read ? _("reading") : _("writing")); - } - } - - ~wxFileHandle() - { - if ( m_hFile != INVALID_HANDLE_VALUE ) - { - if ( !::CloseHandle(m_hFile) ) - { - wxLogSysError(_("Failed to close file handle")); - } - } - } - - // return true only if the file could be opened successfully - bool IsOk() const { return m_hFile != INVALID_HANDLE_VALUE; } - - // get the handle - operator HANDLE() const { return m_hFile; } - -private: - HANDLE m_hFile; -}; - -#endif // __WIN32__ - -// ---------------------------------------------------------------------------- -// private functions -// ---------------------------------------------------------------------------- - -#if wxUSE_DATETIME && defined(__WIN32__) && !defined(__WXMICROWIN__) - -// convert between wxDateTime and FILETIME which is a 64-bit value representing -// the number of 100-nanosecond intervals since January 1, 1601. - -static void ConvertFileTimeToWx(wxDateTime *dt, const FILETIME &ft) -{ - FILETIME ftcopy = ft; - FILETIME ftLocal; - if ( !::FileTimeToLocalFileTime(&ftcopy, &ftLocal) ) - { - wxLogLastError(_T("FileTimeToLocalFileTime")); - } - - SYSTEMTIME st; - if ( !::FileTimeToSystemTime(&ftLocal, &st) ) - { - wxLogLastError(_T("FileTimeToSystemTime")); - } - - dt->Set(st.wDay, wxDateTime::Month(st.wMonth - 1), st.wYear, - st.wHour, st.wMinute, st.wSecond, st.wMilliseconds); -} - -static void ConvertWxToFileTime(FILETIME *ft, const wxDateTime& dt) -{ - SYSTEMTIME st; - st.wDay = dt.GetDay(); - st.wMonth = (WORD)(dt.GetMonth() + 1); - st.wYear = (WORD)dt.GetYear(); - st.wHour = dt.GetHour(); - st.wMinute = dt.GetMinute(); - st.wSecond = dt.GetSecond(); - st.wMilliseconds = dt.GetMillisecond(); - - FILETIME ftLocal; - if ( !::SystemTimeToFileTime(&st, &ftLocal) ) - { - wxLogLastError(_T("SystemTimeToFileTime")); - } - - if ( !::LocalFileTimeToFileTime(&ftLocal, ft) ) - { - wxLogLastError(_T("LocalFileTimeToFileTime")); - } -} - -#endif // wxUSE_DATETIME && __WIN32__ - -// return a string with the volume par -static wxString wxGetVolumeString(const wxString& volume, wxPathFormat format) -{ - wxString path; - - if ( !volume.empty() ) - { - format = wxFileName::GetFormat(format); - - // Special Windows UNC paths hack, part 2: undo what we did in - // SplitPath() and make an UNC path if we have a drive which is not a - // single letter (hopefully the network shares can't be one letter only - // although I didn't find any authoritative docs on this) - if ( format == wxPATH_DOS && volume.length() > 1 ) - { - path << wxFILE_SEP_PATH_DOS << wxFILE_SEP_PATH_DOS << volume; - } - else if ( format == wxPATH_DOS || format == wxPATH_VMS ) - { - path << volume << wxFileName::GetVolumeSeparator(format); - } - // else ignore - } - - return path; -} - -// return true if the character is a DOS path separator i.e. either a slash or -// a backslash -inline bool IsDOSPathSep(wxChar ch) -{ - return ch == wxFILE_SEP_PATH_DOS || ch == wxFILE_SEP_PATH_UNIX; -} - -// return true if the format used is the DOS/Windows one and the string looks -// like a UNC path -static bool IsUNCPath(const wxString& path, wxPathFormat format) -{ - return format == wxPATH_DOS && - path.length() >= 4 && // "\\a" can't be a UNC path - IsDOSPathSep(path[0u]) && - IsDOSPathSep(path[1u]) && - !IsDOSPathSep(path[2u]); -} - -// ============================================================================ -// implementation -// ============================================================================ - -// ---------------------------------------------------------------------------- -// wxFileName construction -// ---------------------------------------------------------------------------- - -void wxFileName::Assign( const wxFileName &filepath ) -{ - if ( &filepath == this ) - return; - - m_volume = filepath.GetVolume(); - m_dirs = filepath.GetDirs(); - m_name = filepath.GetName(); - m_ext = filepath.GetExt(); - m_relative = filepath.m_relative; - m_hasExt = filepath.m_hasExt; -} - -void wxFileName::Assign(const wxString& volume, - const wxString& path, - const wxString& name, - const wxString& ext, - bool hasExt, - wxPathFormat format) -{ - // we should ignore paths which look like UNC shares because we already - // have the volume here and the UNC notation (\\server\path) is only valid - // for paths which don't start with a volume, so prevent SetPath() from - // recognizing "\\foo\bar" in "c:\\foo\bar" as an UNC path - // - // note also that this is a rather ugly way to do what we want (passing - // some kind of flag telling to ignore UNC paths to SetPath() would be - // better) but this is the safest thing to do to avoid breaking backwards - // compatibility in 2.8 - if ( IsUNCPath(path, format) ) - { - // remove one of the 2 leading backslashes to ensure that it's not - // recognized as an UNC path by SetPath() - wxString pathNonUNC(path, 1, wxString::npos); - SetPath(pathNonUNC, format); - } - else // no UNC complications - { - SetPath(path, format); - } - - m_volume = volume; - m_ext = ext; - m_name = name; - - m_hasExt = hasExt; -} - -void wxFileName::SetPath( const wxString& pathOrig, wxPathFormat format ) -{ - m_dirs.Clear(); - - if ( pathOrig.empty() ) - { - // no path at all - m_relative = true; - - return; - } - - format = GetFormat( format ); - - // 0) deal with possible volume part first - wxString volume, - path; - SplitVolume(pathOrig, &volume, &path, format); - if ( !volume.empty() ) - { - m_relative = false; - - SetVolume(volume); - } - - // 1) Determine if the path is relative or absolute. - wxChar leadingChar = path[0u]; - - switch (format) - { - case wxPATH_MAC: - m_relative = leadingChar == wxT(':'); - - // We then remove a leading ":". The reason is in our - // storage form for relative paths: - // ":dir:file.txt" actually means "./dir/file.txt" in - // DOS notation and should get stored as - // (relative) (dir) (file.txt) - // "::dir:file.txt" actually means "../dir/file.txt" - // stored as (relative) (..) (dir) (file.txt) - // This is important only for the Mac as an empty dir - // actually means , whereas under DOS, double - // slashes can be ignored: "\\\\" is the same as "\\". - if (m_relative) - path.erase( 0, 1 ); - break; - - case wxPATH_VMS: - // TODO: what is the relative path format here? - m_relative = false; - break; - - default: - wxFAIL_MSG( _T("Unknown path format") ); - // !! Fall through !! - - case wxPATH_UNIX: - // the paths of the form "~" or "~username" are absolute - m_relative = leadingChar != wxT('/') && leadingChar != _T('~'); - break; - - case wxPATH_DOS: - m_relative = !IsPathSeparator(leadingChar, format); - break; - - } - - // 2) Break up the path into its members. If the original path - // was just "/" or "\\", m_dirs will be empty. We know from - // the m_relative field, if this means "nothing" or "root dir". - - wxStringTokenizer tn( path, GetPathSeparators(format) ); - - while ( tn.HasMoreTokens() ) - { - wxString token = tn.GetNextToken(); - - // Remove empty token under DOS and Unix, interpret them - // as .. under Mac. - if (token.empty()) - { - if (format == wxPATH_MAC) - m_dirs.Add( wxT("..") ); - // else ignore - } - else - { - m_dirs.Add( token ); - } - } -} - -void wxFileName::Assign(const wxString& fullpath, - wxPathFormat format) -{ - wxString volume, path, name, ext; - bool hasExt; - SplitPath(fullpath, &volume, &path, &name, &ext, &hasExt, format); - - Assign(volume, path, name, ext, hasExt, format); -} - -void wxFileName::Assign(const wxString& fullpathOrig, - const wxString& fullname, - wxPathFormat format) -{ - // always recognize fullpath as directory, even if it doesn't end with a - // slash - wxString fullpath = fullpathOrig; - if ( !fullpath.empty() && !wxEndsWithPathSeparator(fullpath) ) - { - fullpath += GetPathSeparator(format); - } - - wxString volume, path, name, ext; - bool hasExt; - - // do some consistency checks in debug mode: the name should be really just - // the filename and the path should be really just a path -#ifdef __WXDEBUG__ - wxString volDummy, pathDummy, nameDummy, extDummy; - - SplitPath(fullname, &volDummy, &pathDummy, &name, &ext, &hasExt, format); - - wxASSERT_MSG( volDummy.empty() && pathDummy.empty(), - _T("the file name shouldn't contain the path") ); - - SplitPath(fullpath, &volume, &path, &nameDummy, &extDummy, format); - - wxASSERT_MSG( nameDummy.empty() && extDummy.empty(), - _T("the path shouldn't contain file name nor extension") ); - -#else // !__WXDEBUG__ - SplitPath(fullname, NULL /* no volume */, NULL /* no path */, - &name, &ext, &hasExt, format); - SplitPath(fullpath, &volume, &path, NULL, NULL, format); -#endif // __WXDEBUG__/!__WXDEBUG__ - - Assign(volume, path, name, ext, hasExt, format); -} - -void wxFileName::Assign(const wxString& pathOrig, - const wxString& name, - const wxString& ext, - wxPathFormat format) -{ - wxString volume, - path; - SplitVolume(pathOrig, &volume, &path, format); - - Assign(volume, path, name, ext, format); -} - -void wxFileName::AssignDir(const wxString& dir, wxPathFormat format) -{ - Assign(dir, wxEmptyString, format); -} - -void wxFileName::Clear() -{ - m_dirs.Clear(); - - m_volume = - m_name = - m_ext = wxEmptyString; - - // we don't have any absolute path for now - m_relative = true; - - // nor any extension - m_hasExt = false; -} - -/* static */ -wxFileName wxFileName::FileName(const wxString& file, wxPathFormat format) -{ - return wxFileName(file, format); -} - -/* static */ -wxFileName wxFileName::DirName(const wxString& dir, wxPathFormat format) -{ - wxFileName fn; - fn.AssignDir(dir, format); - return fn; -} - -// ---------------------------------------------------------------------------- -// existence tests -// ---------------------------------------------------------------------------- - -bool wxFileName::FileExists() const -{ - return wxFileName::FileExists( GetFullPath() ); -} - -bool wxFileName::FileExists( const wxString &file ) -{ - return ::wxFileExists( file ); -} - -bool wxFileName::DirExists() const -{ - return wxFileName::DirExists( GetPath() ); -} - -bool wxFileName::DirExists( const wxString &dir ) -{ - return ::wxDirExists( dir ); -} - -// ---------------------------------------------------------------------------- -// CWD and HOME stuff -// ---------------------------------------------------------------------------- - -void wxFileName::AssignCwd(const wxString& volume) -{ - AssignDir(wxFileName::GetCwd(volume)); -} - -/* static */ -wxString wxFileName::GetCwd(const wxString& volume) -{ - // if we have the volume, we must get the current directory on this drive - // and to do this we have to chdir to this volume - at least under Windows, - // I don't know how to get the current drive on another volume elsewhere - // (TODO) - wxString cwdOld; - if ( !volume.empty() ) - { - cwdOld = wxGetCwd(); - SetCwd(volume + GetVolumeSeparator()); - } - - wxString cwd = ::wxGetCwd(); - - if ( !volume.empty() ) - { - SetCwd(cwdOld); - } - - return cwd; -} - -bool wxFileName::SetCwd() -{ - return wxFileName::SetCwd( GetPath() ); -} - -bool wxFileName::SetCwd( const wxString &cwd ) -{ - return ::wxSetWorkingDirectory( cwd ); -} - -void wxFileName::AssignHomeDir() -{ - AssignDir(wxFileName::GetHomeDir()); -} - -wxString wxFileName::GetHomeDir() -{ - return ::wxGetHomeDir(); -} - - -// ---------------------------------------------------------------------------- -// CreateTempFileName -// ---------------------------------------------------------------------------- - -#if wxUSE_FILE || wxUSE_FFILE - - -#if !defined wx_fdopen && defined HAVE_FDOPEN - #define wx_fdopen fdopen -#endif - -// NB: GetTempFileName() under Windows creates the file, so using -// O_EXCL there would fail -#ifdef __WINDOWS__ - #define wxOPEN_EXCL 0 -#else - #define wxOPEN_EXCL O_EXCL -#endif - - -#ifdef wxOpenOSFHandle -#define WX_HAVE_DELETE_ON_CLOSE -// On Windows create a file with the FILE_FLAGS_DELETE_ON_CLOSE flags. -// -static int wxOpenWithDeleteOnClose(const wxString& filename) -{ - DWORD access = GENERIC_READ | GENERIC_WRITE; - - DWORD disposition = OPEN_ALWAYS; - - DWORD attributes = FILE_ATTRIBUTE_TEMPORARY | - FILE_FLAG_DELETE_ON_CLOSE; - - HANDLE h = ::CreateFile(filename, access, 0, NULL, - disposition, attributes, NULL); - - return wxOpenOSFHandle(h, wxO_BINARY); -} -#endif // wxOpenOSFHandle - - -// Helper to open the file -// -static int wxTempOpen(const wxString& path, bool *deleteOnClose) -{ -#ifdef WX_HAVE_DELETE_ON_CLOSE - if (*deleteOnClose) - return wxOpenWithDeleteOnClose(path); -#endif - - *deleteOnClose = false; - - return wxOpen(path, wxO_BINARY | O_RDWR | O_CREAT | wxOPEN_EXCL, 0600); -} - - -#if wxUSE_FFILE -// Helper to open the file and attach it to the wxFFile -// -static bool wxTempOpen(wxFFile *file, const wxString& path, bool *deleteOnClose) -{ -#ifndef wx_fdopen - *deleteOnClose = false; - return file->Open(path, _T("w+b")); -#else // wx_fdopen - int fd = wxTempOpen(path, deleteOnClose); - if (fd == -1) - return false; - file->Attach(wx_fdopen(fd, "w+b")); - return file->IsOpened(); -#endif // wx_fdopen -} -#endif // wxUSE_FFILE - - -#if !wxUSE_FILE - #define WXFILEARGS(x, y) y -#elif !wxUSE_FFILE - #define WXFILEARGS(x, y) x -#else - #define WXFILEARGS(x, y) x, y -#endif - - -// Implementation of wxFileName::CreateTempFileName(). -// -static wxString wxCreateTempImpl( - const wxString& prefix, - WXFILEARGS(wxFile *fileTemp, wxFFile *ffileTemp), - bool *deleteOnClose = NULL) -{ -#if wxUSE_FILE && wxUSE_FFILE - wxASSERT(fileTemp == NULL || ffileTemp == NULL); -#endif - wxString path, dir, name; - bool wantDeleteOnClose = false; - - if (deleteOnClose) - { - // set the result to false initially - wantDeleteOnClose = *deleteOnClose; - *deleteOnClose = false; - } - else - { - // easier if it alwasys points to something - deleteOnClose = &wantDeleteOnClose; - } - - // use the directory specified by the prefix - wxFileName::SplitPath(prefix, &dir, &name, NULL /* extension */); - - if (dir.empty()) - { - dir = wxFileName::GetTempDir(); - } - -#if defined(__WXWINCE__) - path = dir + wxT("\\") + name; - int i = 1; - while (wxFileName::FileExists(path)) - { - path = dir + wxT("\\") + name ; - path << i; - i ++; - } - -#elif defined(__WINDOWS__) && !defined(__WXMICROWIN__) - if ( !::GetTempFileName(dir, name, 0, wxStringBuffer(path, MAX_PATH + 1)) ) - { - wxLogLastError(_T("GetTempFileName")); - - path.clear(); - } - -#else // !Windows - path = dir; - - if ( !wxEndsWithPathSeparator(dir) && - (name.empty() || !wxIsPathSeparator(name[0u])) ) - { - path += wxFILE_SEP_PATH; - } - - path += name; - -#if defined(HAVE_MKSTEMP) - // scratch space for mkstemp() - path += _T("XXXXXX"); - - // we need to copy the path to the buffer in which mkstemp() can modify it - wxCharBuffer buf( wxConvFile.cWX2MB( path ) ); - - // cast is safe because the string length doesn't change - int fdTemp = mkstemp( (char*)(const char*) buf ); - if ( fdTemp == -1 ) - { - // this might be not necessary as mkstemp() on most systems should have - // already done it but it doesn't hurt neither... - path.clear(); - } - else // mkstemp() succeeded - { - path = wxConvFile.cMB2WX( (const char*) buf ); - - #if wxUSE_FILE - // avoid leaking the fd - if ( fileTemp ) - { - fileTemp->Attach(fdTemp); - } - else - #endif - - #if wxUSE_FFILE - if ( ffileTemp ) - { - #ifdef wx_fdopen - ffileTemp->Attach(wx_fdopen(fdTemp, "r+b")); - #else - ffileTemp->Open(path, _T("r+b")); - close(fdTemp); - #endif - } - else - #endif - - { - close(fdTemp); - } - } -#else // !HAVE_MKSTEMP - -#ifdef HAVE_MKTEMP - // same as above - path += _T("XXXXXX"); - - wxCharBuffer buf = wxConvFile.cWX2MB( path ); - if ( !mktemp( (char*)(const char*) buf ) ) - { - path.clear(); - } - else - { - path = wxConvFile.cMB2WX( (const char*) buf ); - } -#else // !HAVE_MKTEMP (includes __DOS__) - // generate the unique file name ourselves - #if !defined(__DOS__) && !defined(__PALMOS__) && (!defined(__MWERKS__) || defined(__DARWIN__) ) - path << (unsigned int)getpid(); - #endif - - wxString pathTry; - - static const size_t numTries = 1000; - for ( size_t n = 0; n < numTries; n++ ) - { - // 3 hex digits is enough for numTries == 1000 < 4096 - pathTry = path + wxString::Format(_T("%.03x"), (unsigned int) n); - if ( !wxFileName::FileExists(pathTry) ) - { - break; - } - - pathTry.clear(); - } - - path = pathTry; -#endif // HAVE_MKTEMP/!HAVE_MKTEMP - -#endif // HAVE_MKSTEMP/!HAVE_MKSTEMP - -#endif // Windows/!Windows - - if ( path.empty() ) - { - wxLogSysError(_("Failed to create a temporary file name")); - } - else - { - bool ok = true; - - // open the file - of course, there is a race condition here, this is - // why we always prefer using mkstemp()... - #if wxUSE_FILE - if ( fileTemp && !fileTemp->IsOpened() ) - { - *deleteOnClose = wantDeleteOnClose; - int fd = wxTempOpen(path, deleteOnClose); - if (fd != -1) - fileTemp->Attach(fd); - else - ok = false; - } - #endif - - #if wxUSE_FFILE - if ( ffileTemp && !ffileTemp->IsOpened() ) - { - *deleteOnClose = wantDeleteOnClose; - ok = wxTempOpen(ffileTemp, path, deleteOnClose); - } - #endif - - if ( !ok ) - { - // FIXME: If !ok here should we loop and try again with another - // file name? That is the standard recourse if open(O_EXCL) - // fails, though of course it should be protected against - // possible infinite looping too. - - wxLogError(_("Failed to open temporary file.")); - - path.clear(); - } - } - - return path; -} - - -static bool wxCreateTempImpl( - const wxString& prefix, - WXFILEARGS(wxFile *fileTemp, wxFFile *ffileTemp), - wxString *name) -{ - bool deleteOnClose = true; - - *name = wxCreateTempImpl(prefix, - WXFILEARGS(fileTemp, ffileTemp), - &deleteOnClose); - - bool ok = !name->empty(); - - if (deleteOnClose) - name->clear(); -#ifdef __UNIX__ - else if (ok && wxRemoveFile(*name)) - name->clear(); -#endif - - return ok; -} - - -static void wxAssignTempImpl( - wxFileName *fn, - const wxString& prefix, - WXFILEARGS(wxFile *fileTemp, wxFFile *ffileTemp)) -{ - wxString tempname; - tempname = wxCreateTempImpl(prefix, WXFILEARGS(fileTemp, ffileTemp)); - - if ( tempname.empty() ) - { - // error, failed to get temp file name - fn->Clear(); - } - else // ok - { - fn->Assign(tempname); - } -} - - -void wxFileName::AssignTempFileName(const wxString& prefix) -{ - wxAssignTempImpl(this, prefix, WXFILEARGS(NULL, NULL)); -} - -/* static */ -wxString wxFileName::CreateTempFileName(const wxString& prefix) -{ - return wxCreateTempImpl(prefix, WXFILEARGS(NULL, NULL)); -} - -#endif // wxUSE_FILE || wxUSE_FFILE - - -#if wxUSE_FILE - -wxString wxCreateTempFileName(const wxString& prefix, - wxFile *fileTemp, - bool *deleteOnClose) -{ - return wxCreateTempImpl(prefix, WXFILEARGS(fileTemp, NULL), deleteOnClose); -} - -bool wxCreateTempFile(const wxString& prefix, - wxFile *fileTemp, - wxString *name) -{ - return wxCreateTempImpl(prefix, WXFILEARGS(fileTemp, NULL), name); -} - -void wxFileName::AssignTempFileName(const wxString& prefix, wxFile *fileTemp) -{ - wxAssignTempImpl(this, prefix, WXFILEARGS(fileTemp, NULL)); -} - -/* static */ -wxString -wxFileName::CreateTempFileName(const wxString& prefix, wxFile *fileTemp) -{ - return wxCreateTempFileName(prefix, fileTemp); -} - -#endif // wxUSE_FILE - - -#if wxUSE_FFILE - -wxString wxCreateTempFileName(const wxString& prefix, - wxFFile *fileTemp, - bool *deleteOnClose) -{ - return wxCreateTempImpl(prefix, WXFILEARGS(NULL, fileTemp), deleteOnClose); -} - -bool wxCreateTempFile(const wxString& prefix, - wxFFile *fileTemp, - wxString *name) -{ - return wxCreateTempImpl(prefix, WXFILEARGS(NULL, fileTemp), name); - -} - -void wxFileName::AssignTempFileName(const wxString& prefix, wxFFile *fileTemp) -{ - wxAssignTempImpl(this, prefix, WXFILEARGS(NULL, fileTemp)); -} - -/* static */ -wxString -wxFileName::CreateTempFileName(const wxString& prefix, wxFFile *fileTemp) -{ - return wxCreateTempFileName(prefix, fileTemp); -} - -#endif // wxUSE_FFILE - - -// ---------------------------------------------------------------------------- -// directory operations -// ---------------------------------------------------------------------------- - -wxString wxFileName::GetTempDir() -{ - wxString dir; - dir = wxGetenv(_T("TMPDIR")); - if (dir.empty()) - { - dir = wxGetenv(_T("TMP")); - if (dir.empty()) - { - dir = wxGetenv(_T("TEMP")); - } - } - -#if defined(__WXWINCE__) - if (dir.empty()) - { - // FIXME. Create \temp dir? - if (DirExists(wxT("\\temp"))) - dir = wxT("\\temp"); - } -#elif defined(__WINDOWS__) && !defined(__WXMICROWIN__) - - if ( dir.empty() ) - { - if ( !::GetTempPath(MAX_PATH, wxStringBuffer(dir, MAX_PATH + 1)) ) - { - wxLogLastError(_T("GetTempPath")); - } - - if ( dir.empty() ) - { - // GetTempFileName() fails if we pass it an empty string - dir = _T('.'); - } - } -#else // !Windows - - if ( dir.empty() ) - { - // default -#if defined(__DOS__) || defined(__OS2__) - dir = _T("."); -#elif defined(__WXMAC__) - dir = wxMacFindFolder(short(kOnSystemDisk), kTemporaryFolderType, kCreateFolder); -#else - dir = _T("/tmp"); -#endif - } -#endif - - return dir; -} - -bool wxFileName::Mkdir( int perm, int flags ) -{ - return wxFileName::Mkdir(GetPath(), perm, flags); -} - -bool wxFileName::Mkdir( const wxString& dir, int perm, int flags ) -{ - if ( flags & wxPATH_MKDIR_FULL ) - { - // split the path in components - wxFileName filename; - filename.AssignDir(dir); - - wxString currPath; - if ( filename.HasVolume()) - { - currPath << wxGetVolumeString(filename.GetVolume(), wxPATH_NATIVE); - } - - wxArrayString dirs = filename.GetDirs(); - size_t count = dirs.GetCount(); - for ( size_t i = 0; i < count; i++ ) - { - if ( i > 0 || -#if defined(__WXMAC__) && !defined(__DARWIN__) - // relative pathnames are exactely the other way round under mac... - !filename.IsAbsolute() -#else - filename.IsAbsolute() -#endif - ) - currPath += wxFILE_SEP_PATH; - currPath += dirs[i]; - - if (!DirExists(currPath)) - { - if (!wxMkdir(currPath, perm)) - { - // no need to try creating further directories - return false; - } - } - } - - return true; - - } - - return ::wxMkdir( dir, perm ); -} - -bool wxFileName::Rmdir() -{ - return wxFileName::Rmdir( GetPath() ); -} - -bool wxFileName::Rmdir( const wxString &dir ) -{ - return ::wxRmdir( dir ); -} - -// ---------------------------------------------------------------------------- -// path normalization -// ---------------------------------------------------------------------------- - -bool wxFileName::Normalize(int flags, - const wxString& cwd, - wxPathFormat format) -{ - // deal with env vars renaming first as this may seriously change the path - if ( flags & wxPATH_NORM_ENV_VARS ) - { - wxString pathOrig = GetFullPath(format); - wxString path = wxExpandEnvVars(pathOrig); - if ( path != pathOrig ) - { - Assign(path); - } - } - - - // the existing path components - wxArrayString dirs = GetDirs(); - - // the path to prepend in front to make the path absolute - wxFileName curDir; - - format = GetFormat(format); - - // set up the directory to use for making the path absolute later - if ( (flags & wxPATH_NORM_ABSOLUTE) && !IsAbsolute(format) ) - { - if ( cwd.empty() ) - { - curDir.AssignCwd(GetVolume()); - } - else // cwd provided - { - curDir.AssignDir(cwd); - } - } - - // handle ~ stuff under Unix only - if ( (format == wxPATH_UNIX) && (flags & wxPATH_NORM_TILDE) ) - { - if ( !dirs.IsEmpty() ) - { - wxString dir = dirs[0u]; - if ( !dir.empty() && dir[0u] == _T('~') ) - { - // to make the path absolute use the home directory - curDir.AssignDir(wxGetUserHome(dir.c_str() + 1)); - - // if we are expanding the tilde, then this path - // *should* be already relative (since we checked for - // the tilde only in the first char of the first dir); - // if m_relative==false, it's because it was initialized - // from a string which started with /~; in that case - // we reach this point but then need m_relative=true - // for relative->absolute expansion later - m_relative = true; - - dirs.RemoveAt(0u); - } - } - } - - // transform relative path into abs one - if ( curDir.IsOk() ) - { - // this path may be relative because it doesn't have the volume name - // and still have m_relative=true; in this case we shouldn't modify - // our directory components but just set the current volume - if ( !HasVolume() && curDir.HasVolume() ) - { - SetVolume(curDir.GetVolume()); - - if ( !m_relative ) - { - // yes, it was the case - we don't need curDir then - curDir.Clear(); - } - } - - // finally, prepend curDir to the dirs array - wxArrayString dirsNew = curDir.GetDirs(); - WX_PREPEND_ARRAY(dirs, dirsNew); - - // if we used e.g. tilde expansion previously and wxGetUserHome didn't - // return for some reason an absolute path, then curDir maybe not be absolute! - if ( curDir.IsAbsolute(format) ) - { - // we have prepended an absolute path and thus we are now an absolute - // file name too - m_relative = false; - } - // else if (flags & wxPATH_NORM_ABSOLUTE): - // should we warn the user that we didn't manage to make the path absolute? - } - - // now deal with ".", ".." and the rest - m_dirs.Empty(); - size_t count = dirs.GetCount(); - for ( size_t n = 0; n < count; n++ ) - { - wxString dir = dirs[n]; - - if ( flags & wxPATH_NORM_DOTS ) - { - if ( dir == wxT(".") ) - { - // just ignore - continue; - } - - if ( dir == wxT("..") ) - { - if ( m_dirs.IsEmpty() ) - { - wxLogError(_("The path '%s' contains too many \"..\"!"), - GetFullPath().c_str()); - return false; - } - - m_dirs.RemoveAt(m_dirs.GetCount() - 1); - continue; - } - } - - m_dirs.Add(dir); - } - -#if defined(__WIN32__) && !defined(__WXWINCE__) && wxUSE_OLE - if ( (flags & wxPATH_NORM_SHORTCUT) ) - { - wxString filename; - if (GetShortcutTarget(GetFullPath(format), filename)) - { - m_relative = false; - Assign(filename); - } - } -#endif - -#if defined(__WIN32__) - if ( (flags & wxPATH_NORM_LONG) && (format == wxPATH_DOS) ) - { - Assign(GetLongPath()); - } -#endif // Win32 - - // Change case (this should be kept at the end of the function, to ensure - // that the path doesn't change any more after we normalize its case) - if ( (flags & wxPATH_NORM_CASE) && !IsCaseSensitive(format) ) - { - m_volume.MakeLower(); - m_name.MakeLower(); - m_ext.MakeLower(); - - // directory entries must be made lower case as well - count = m_dirs.GetCount(); - for ( size_t i = 0; i < count; i++ ) - { - m_dirs[i].MakeLower(); - } - } - - return true; -} - -// ---------------------------------------------------------------------------- -// get the shortcut target -// ---------------------------------------------------------------------------- - -// WinCE (3) doesn't have CLSID_ShellLink, IID_IShellLink definitions. -// The .lnk file is a plain text file so it should be easy to -// make it work. Hint from Google Groups: -// "If you open up a lnk file, you'll see a -// number, followed by a pound sign (#), followed by more text. The -// number is the number of characters that follows the pound sign. The -// characters after the pound sign are the command line (which _can_ -// include arguments) to be executed. Any path (e.g. \windows\program -// files\myapp.exe) that includes spaces needs to be enclosed in -// quotation marks." - -#if defined(__WIN32__) && !defined(__WXWINCE__) && wxUSE_OLE -// The following lines are necessary under WinCE -// #include "wx/msw/private.h" -// #include -#include -#if defined(__WXWINCE__) -#include -#endif - -bool wxFileName::GetShortcutTarget(const wxString& shortcutPath, - wxString& targetFilename, - wxString* arguments) -{ - wxString path, file, ext; - wxSplitPath(shortcutPath, & path, & file, & ext); - - HRESULT hres; - IShellLink* psl; - bool success = false; - - // Assume it's not a shortcut if it doesn't end with lnk - if (ext.CmpNoCase(wxT("lnk"))!=0) - return false; - - // create a ShellLink object - hres = CoCreateInstance(CLSID_ShellLink, NULL, CLSCTX_INPROC_SERVER, - IID_IShellLink, (LPVOID*) &psl); - - if (SUCCEEDED(hres)) - { - IPersistFile* ppf; - hres = psl->QueryInterface( IID_IPersistFile, (LPVOID *) &ppf); - if (SUCCEEDED(hres)) - { - WCHAR wsz[MAX_PATH]; - - MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, shortcutPath.mb_str(), -1, wsz, - MAX_PATH); - - hres = ppf->Load(wsz, 0); - ppf->Release(); - - if (SUCCEEDED(hres)) - { - wxChar buf[2048]; - // Wrong prototype in early versions -#if defined(__MINGW32__) && !wxCHECK_W32API_VERSION(2, 2) - psl->GetPath((CHAR*) buf, 2048, NULL, SLGP_UNCPRIORITY); -#else - psl->GetPath(buf, 2048, NULL, SLGP_UNCPRIORITY); -#endif - targetFilename = wxString(buf); - success = (shortcutPath != targetFilename); - - psl->GetArguments(buf, 2048); - wxString args(buf); - if (!args.empty() && arguments) - { - *arguments = args; - } - } - } - - psl->Release(); - } - return success; -} - -#endif // __WIN32__ && !__WXWINCE__ - - -// ---------------------------------------------------------------------------- -// absolute/relative paths -// ---------------------------------------------------------------------------- - -bool wxFileName::IsAbsolute(wxPathFormat format) const -{ - // if our path doesn't start with a path separator, it's not an absolute - // path - if ( m_relative ) - return false; - - if ( !GetVolumeSeparator(format).empty() ) - { - // this format has volumes and an absolute path must have one, it's not - // enough to have the full path to bean absolute file under Windows - if ( GetVolume().empty() ) - return false; - } - - return true; -} - -bool wxFileName::MakeRelativeTo(const wxString& pathBase, wxPathFormat format) -{ - wxFileName fnBase = wxFileName::DirName(pathBase, format); - - // get cwd only once - small time saving - wxString cwd = wxGetCwd(); - Normalize(wxPATH_NORM_ALL & ~wxPATH_NORM_CASE, cwd, format); - fnBase.Normalize(wxPATH_NORM_ALL & ~wxPATH_NORM_CASE, cwd, format); - - bool withCase = IsCaseSensitive(format); - - // we can't do anything if the files live on different volumes - if ( !GetVolume().IsSameAs(fnBase.GetVolume(), withCase) ) - { - // nothing done - return false; - } - - // same drive, so we don't need our volume - m_volume.clear(); - - // remove common directories starting at the top - while ( !m_dirs.IsEmpty() && !fnBase.m_dirs.IsEmpty() && - m_dirs[0u].IsSameAs(fnBase.m_dirs[0u], withCase) ) - { - m_dirs.RemoveAt(0); - fnBase.m_dirs.RemoveAt(0); - } - - // add as many ".." as needed - size_t count = fnBase.m_dirs.GetCount(); - for ( size_t i = 0; i < count; i++ ) - { - m_dirs.Insert(wxT(".."), 0u); - } - - if ( format == wxPATH_UNIX || format == wxPATH_DOS ) - { - // a directory made relative with respect to itself is '.' under Unix - // and DOS, by definition (but we don't have to insert "./" for the - // files) - if ( m_dirs.IsEmpty() && IsDir() ) - { - m_dirs.Add(_T('.')); - } - } - - m_relative = true; - - // we were modified - return true; -} - -// ---------------------------------------------------------------------------- -// filename kind tests -// ---------------------------------------------------------------------------- - -bool wxFileName::SameAs(const wxFileName& filepath, wxPathFormat format) const -{ - wxFileName fn1 = *this, - fn2 = filepath; - - // get cwd only once - small time saving - wxString cwd = wxGetCwd(); - fn1.Normalize(wxPATH_NORM_ALL | wxPATH_NORM_CASE, cwd, format); - fn2.Normalize(wxPATH_NORM_ALL | wxPATH_NORM_CASE, cwd, format); - - if ( fn1.GetFullPath() == fn2.GetFullPath() ) - return true; - - // TODO: compare inodes for Unix, this works even when filenames are - // different but files are the same (symlinks) (VZ) - - return false; -} - -/* static */ -bool wxFileName::IsCaseSensitive( wxPathFormat format ) -{ - // only Unix filenames are truely case-sensitive - return GetFormat(format) == wxPATH_UNIX; -} - -/* static */ -wxString wxFileName::GetForbiddenChars(wxPathFormat format) -{ - // Inits to forbidden characters that are common to (almost) all platforms. - wxString strForbiddenChars = wxT("*?"); - - // If asserts, wxPathFormat has been changed. In case of a new path format - // addition, the following code might have to be updated. - wxCOMPILE_TIME_ASSERT(wxPATH_MAX == 5, wxPathFormatChanged); - switch ( GetFormat(format) ) - { - default : - wxFAIL_MSG( wxT("Unknown path format") ); - // !! Fall through !! - - case wxPATH_UNIX: - break; - - case wxPATH_MAC: - // On a Mac even names with * and ? are allowed (Tested with OS - // 9.2.1 and OS X 10.2.5) - strForbiddenChars = wxEmptyString; - break; - - case wxPATH_DOS: - strForbiddenChars += wxT("\\/:\"<>|"); - break; - - case wxPATH_VMS: - break; - } - - return strForbiddenChars; -} - -/* static */ -wxString wxFileName::GetVolumeSeparator(wxPathFormat WXUNUSED_IN_WINCE(format)) -{ -#ifdef __WXWINCE__ - return wxEmptyString; -#else - wxString sepVol; - - if ( (GetFormat(format) == wxPATH_DOS) || - (GetFormat(format) == wxPATH_VMS) ) - { - sepVol = wxFILE_SEP_DSK; - } - //else: leave empty - - return sepVol; -#endif -} - -/* static */ -wxString wxFileName::GetPathSeparators(wxPathFormat format) -{ - wxString seps; - switch ( GetFormat(format) ) - { - case wxPATH_DOS: - // accept both as native APIs do but put the native one first as - // this is the one we use in GetFullPath() - seps << wxFILE_SEP_PATH_DOS << wxFILE_SEP_PATH_UNIX; - break; - - default: - wxFAIL_MSG( _T("Unknown wxPATH_XXX style") ); - // fall through - - case wxPATH_UNIX: - seps = wxFILE_SEP_PATH_UNIX; - break; - - case wxPATH_MAC: - seps = wxFILE_SEP_PATH_MAC; - break; - - case wxPATH_VMS: - seps = wxFILE_SEP_PATH_VMS; - break; - } - - return seps; -} - -/* static */ -wxString wxFileName::GetPathTerminators(wxPathFormat format) -{ - format = GetFormat(format); - - // under VMS the end of the path is ']', not the path separator used to - // separate the components - return format == wxPATH_VMS ? wxString(_T(']')) : GetPathSeparators(format); -} - -/* static */ -bool wxFileName::IsPathSeparator(wxChar ch, wxPathFormat format) -{ - // wxString::Find() doesn't work as expected with NUL - it will always find - // it, so test for it separately - return ch != _T('\0') && GetPathSeparators(format).Find(ch) != wxNOT_FOUND; -} - -// ---------------------------------------------------------------------------- -// path components manipulation -// ---------------------------------------------------------------------------- - -/* static */ bool wxFileName::IsValidDirComponent(const wxString& dir) -{ - if ( dir.empty() ) - { - wxFAIL_MSG( _T("empty directory passed to wxFileName::InsertDir()") ); - - return false; - } - - const size_t len = dir.length(); - for ( size_t n = 0; n < len; n++ ) - { - if ( dir[n] == GetVolumeSeparator() || IsPathSeparator(dir[n]) ) - { - wxFAIL_MSG( _T("invalid directory component in wxFileName") ); - - return false; - } - } - - return true; -} - -void wxFileName::AppendDir( const wxString& dir ) -{ - if ( IsValidDirComponent(dir) ) - m_dirs.Add( dir ); -} - -void wxFileName::PrependDir( const wxString& dir ) -{ - InsertDir(0, dir); -} - -void wxFileName::InsertDir(size_t before, const wxString& dir) -{ - if ( IsValidDirComponent(dir) ) - m_dirs.Insert(dir, before); -} - -void wxFileName::RemoveDir(size_t pos) -{ - m_dirs.RemoveAt(pos); -} - -// ---------------------------------------------------------------------------- -// accessors -// ---------------------------------------------------------------------------- - -void wxFileName::SetFullName(const wxString& fullname) -{ - SplitPath(fullname, NULL /* no volume */, NULL /* no path */, - &m_name, &m_ext, &m_hasExt); -} - -wxString wxFileName::GetFullName() const -{ - wxString fullname = m_name; - if ( m_hasExt ) - { - fullname << wxFILE_SEP_EXT << m_ext; - } - - return fullname; -} - -wxString wxFileName::GetPath( int flags, wxPathFormat format ) const -{ - format = GetFormat( format ); - - wxString fullpath; - - // return the volume with the path as well if requested - if ( flags & wxPATH_GET_VOLUME ) - { - fullpath += wxGetVolumeString(GetVolume(), format); - } - - // the leading character - switch ( format ) - { - case wxPATH_MAC: - if ( m_relative ) - fullpath += wxFILE_SEP_PATH_MAC; - break; - - case wxPATH_DOS: - if ( !m_relative ) - fullpath += wxFILE_SEP_PATH_DOS; - break; - - default: - wxFAIL_MSG( wxT("Unknown path format") ); - // fall through - - case wxPATH_UNIX: - if ( !m_relative ) - { - // normally the absolute file names start with a slash - // with one exception: the ones like "~/foo.bar" don't - // have it - if ( m_dirs.IsEmpty() || m_dirs[0u] != _T('~') ) - { - fullpath += wxFILE_SEP_PATH_UNIX; - } - } - break; - - case wxPATH_VMS: - // no leading character here but use this place to unset - // wxPATH_GET_SEPARATOR flag: under VMS it doesn't make sense - // as, if I understand correctly, there should never be a dot - // before the closing bracket - flags &= ~wxPATH_GET_SEPARATOR; - } - - if ( m_dirs.empty() ) - { - // there is nothing more - return fullpath; - } - - // then concatenate all the path components using the path separator - if ( format == wxPATH_VMS ) - { - fullpath += wxT('['); - } - - const size_t dirCount = m_dirs.GetCount(); - for ( size_t i = 0; i < dirCount; i++ ) - { - switch (format) - { - case wxPATH_MAC: - if ( m_dirs[i] == wxT(".") ) - { - // skip appending ':', this shouldn't be done in this - // case as "::" is interpreted as ".." under Unix - continue; - } - - // convert back from ".." to nothing - if ( !m_dirs[i].IsSameAs(wxT("..")) ) - fullpath += m_dirs[i]; - break; - - default: - wxFAIL_MSG( wxT("Unexpected path format") ); - // still fall through - - case wxPATH_DOS: - case wxPATH_UNIX: - fullpath += m_dirs[i]; - break; - - case wxPATH_VMS: - // TODO: What to do with ".." under VMS - - // convert back from ".." to nothing - if ( !m_dirs[i].IsSameAs(wxT("..")) ) - fullpath += m_dirs[i]; - break; - } - - if ( (flags & wxPATH_GET_SEPARATOR) || (i != dirCount - 1) ) - fullpath += GetPathSeparator(format); - } - - if ( format == wxPATH_VMS ) - { - fullpath += wxT(']'); - } - - return fullpath; -} - -wxString wxFileName::GetFullPath( wxPathFormat format ) const -{ - // we already have a function to get the path - wxString fullpath = GetPath(wxPATH_GET_VOLUME | wxPATH_GET_SEPARATOR, - format); - - // now just add the file name and extension to it - fullpath += GetFullName(); - - return fullpath; -} - -// Return the short form of the path (returns identity on non-Windows platforms) -wxString wxFileName::GetShortPath() const -{ - wxString path(GetFullPath()); - -#if defined(__WXMSW__) && defined(__WIN32__) && !defined(__WXMICROWIN__) && !defined(__WXWINCE__) - DWORD sz = ::GetShortPathName(path, NULL, 0); - if ( sz != 0 ) - { - wxString pathOut; - if ( ::GetShortPathName - ( - path, - wxStringBuffer(pathOut, sz), - sz - ) != 0 ) - { - return pathOut; - } - } -#endif // Windows - - return path; -} - -// Return the long form of the path (returns identity on non-Windows platforms) -wxString wxFileName::GetLongPath() const -{ - wxString pathOut, - path = GetFullPath(); - -#if defined(__WIN32__) && !defined(__WXWINCE__) && !defined(__WXMICROWIN__) - -#if wxUSE_DYNLIB_CLASS - typedef DWORD (WINAPI *GET_LONG_PATH_NAME)(const wxChar *, wxChar *, DWORD); - - // this is MT-safe as in the worst case we're going to resolve the function - // twice -- but as the result is the same in both threads, it's ok - static GET_LONG_PATH_NAME s_pfnGetLongPathName = NULL; - if ( !s_pfnGetLongPathName ) - { - static bool s_triedToLoad = false; - - if ( !s_triedToLoad ) - { - s_triedToLoad = true; - - wxDynamicLibrary dllKernel(_T("kernel32")); - - const wxChar* GetLongPathName = _T("GetLongPathName") -#if wxUSE_UNICODE - _T("W"); -#else // ANSI - _T("A"); -#endif // Unicode/ANSI - - if ( dllKernel.HasSymbol(GetLongPathName) ) - { - s_pfnGetLongPathName = (GET_LONG_PATH_NAME) - dllKernel.GetSymbol(GetLongPathName); - } - - // note that kernel32.dll can be unloaded, it stays in memory - // anyhow as all Win32 programs link to it and so it's safe to call - // GetLongPathName() even after unloading it - } - } - - if ( s_pfnGetLongPathName ) - { - DWORD dwSize = (*s_pfnGetLongPathName)(path, NULL, 0); - if ( dwSize > 0 ) - { - if ( (*s_pfnGetLongPathName) - ( - path, - wxStringBuffer(pathOut, dwSize), - dwSize - ) != 0 ) - { - return pathOut; - } - } - } -#endif // wxUSE_DYNLIB_CLASS - - // The OS didn't support GetLongPathName, or some other error. - // We need to call FindFirstFile on each component in turn. - - WIN32_FIND_DATA findFileData; - HANDLE hFind; - - if ( HasVolume() ) - pathOut = GetVolume() + - GetVolumeSeparator(wxPATH_DOS) + - GetPathSeparator(wxPATH_DOS); - else - pathOut = wxEmptyString; - - wxArrayString dirs = GetDirs(); - dirs.Add(GetFullName()); - - wxString tmpPath; - - size_t count = dirs.GetCount(); - for ( size_t i = 0; i < count; i++ ) - { - // We're using pathOut to collect the long-name path, but using a - // temporary for appending the last path component which may be - // short-name - tmpPath = pathOut + dirs[i]; - - if ( tmpPath.empty() ) - continue; - - // can't see this being necessary? MF - if ( tmpPath.Last() == GetVolumeSeparator(wxPATH_DOS) ) - { - // Can't pass a drive and root dir to FindFirstFile, - // so continue to next dir - tmpPath += wxFILE_SEP_PATH; - pathOut = tmpPath; - continue; - } - - hFind = ::FindFirstFile(tmpPath, &findFileData); - if (hFind == INVALID_HANDLE_VALUE) - { - // Error: most likely reason is that path doesn't exist, so - // append any unprocessed parts and return - for ( i += 1; i < count; i++ ) - tmpPath += wxFILE_SEP_PATH + dirs[i]; - - return tmpPath; - } - - pathOut += findFileData.cFileName; - if ( (i < (count-1)) ) - pathOut += wxFILE_SEP_PATH; - - ::FindClose(hFind); - } -#else // !Win32 - pathOut = path; -#endif // Win32/!Win32 - - return pathOut; -} - -wxPathFormat wxFileName::GetFormat( wxPathFormat format ) -{ - if (format == wxPATH_NATIVE) - { -#if defined(__WXMSW__) || defined(__OS2__) || defined(__DOS__) - format = wxPATH_DOS; -#elif defined(__WXMAC__) && !defined(__DARWIN__) - format = wxPATH_MAC; -#elif defined(__VMS) - format = wxPATH_VMS; -#else - format = wxPATH_UNIX; -#endif - } - return format; -} - -// ---------------------------------------------------------------------------- -// path splitting function -// ---------------------------------------------------------------------------- - -/* static */ -void -wxFileName::SplitVolume(const wxString& fullpathWithVolume, - wxString *pstrVolume, - wxString *pstrPath, - wxPathFormat format) -{ - format = GetFormat(format); - - wxString fullpath = fullpathWithVolume; - - // special Windows UNC paths hack: transform \\share\path into share:path - if ( IsUNCPath(fullpath, format) ) - { - fullpath.erase(0, 2); - - size_t posFirstSlash = - fullpath.find_first_of(GetPathTerminators(format)); - if ( posFirstSlash != wxString::npos ) - { - fullpath[posFirstSlash] = wxFILE_SEP_DSK; - - // UNC paths are always absolute, right? (FIXME) - fullpath.insert(posFirstSlash + 1, 1, wxFILE_SEP_PATH_DOS); - } - } - - // We separate the volume here - if ( format == wxPATH_DOS || format == wxPATH_VMS ) - { - wxString sepVol = GetVolumeSeparator(format); - - size_t posFirstColon = fullpath.find_first_of(sepVol); - if ( posFirstColon != wxString::npos ) - { - if ( pstrVolume ) - { - *pstrVolume = fullpath.Left(posFirstColon); - } - - // remove the volume name and the separator from the full path - fullpath.erase(0, posFirstColon + sepVol.length()); - } - } - - if ( pstrPath ) - *pstrPath = fullpath; -} - -/* static */ -void wxFileName::SplitPath(const wxString& fullpathWithVolume, - wxString *pstrVolume, - wxString *pstrPath, - wxString *pstrName, - wxString *pstrExt, - bool *hasExt, - wxPathFormat format) -{ - format = GetFormat(format); - - wxString fullpath; - SplitVolume(fullpathWithVolume, pstrVolume, &fullpath, format); - - // find the positions of the last dot and last path separator in the path - size_t posLastDot = fullpath.find_last_of(wxFILE_SEP_EXT); - size_t posLastSlash = fullpath.find_last_of(GetPathTerminators(format)); - - // check whether this dot occurs at the very beginning of a path component - if ( (posLastDot != wxString::npos) && - (posLastDot == 0 || - IsPathSeparator(fullpath[posLastDot - 1]) || - (format == wxPATH_VMS && fullpath[posLastDot - 1] == _T(']'))) ) - { - // dot may be (and commonly -- at least under Unix -- is) the first - // character of the filename, don't treat the entire filename as - // extension in this case - posLastDot = wxString::npos; - } - - // if we do have a dot and a slash, check that the dot is in the name part - if ( (posLastDot != wxString::npos) && - (posLastSlash != wxString::npos) && - (posLastDot < posLastSlash) ) - { - // the dot is part of the path, not the start of the extension - posLastDot = wxString::npos; - } - - // now fill in the variables provided by user - if ( pstrPath ) - { - if ( posLastSlash == wxString::npos ) - { - // no path at all - pstrPath->Empty(); - } - else - { - // take everything up to the path separator but take care to make - // the path equal to something like '/', not empty, for the files - // immediately under root directory - size_t len = posLastSlash; - - // this rule does not apply to mac since we do not start with colons (sep) - // except for relative paths - if ( !len && format != wxPATH_MAC) - len++; - - *pstrPath = fullpath.Left(len); - - // special VMS hack: remove the initial bracket - if ( format == wxPATH_VMS ) - { - if ( (*pstrPath)[0u] == _T('[') ) - pstrPath->erase(0, 1); - } - } - } - - if ( pstrName ) - { - // take all characters starting from the one after the last slash and - // up to, but excluding, the last dot - size_t nStart = posLastSlash == wxString::npos ? 0 : posLastSlash + 1; - size_t count; - if ( posLastDot == wxString::npos ) - { - // take all until the end - count = wxString::npos; - } - else if ( posLastSlash == wxString::npos ) - { - count = posLastDot; - } - else // have both dot and slash - { - count = posLastDot - posLastSlash - 1; - } - - *pstrName = fullpath.Mid(nStart, count); - } - - // finally deal with the extension here: we have an added complication that - // extension may be empty (but present) as in "foo." where trailing dot - // indicates the empty extension at the end -- and hence we must remember - // that we have it independently of pstrExt - if ( posLastDot == wxString::npos ) - { - // no extension - if ( pstrExt ) - pstrExt->clear(); - if ( hasExt ) - *hasExt = false; - } - else - { - // take everything after the dot - if ( pstrExt ) - *pstrExt = fullpath.Mid(posLastDot + 1); - if ( hasExt ) - *hasExt = true; - } -} - -/* static */ -void wxFileName::SplitPath(const wxString& fullpath, - wxString *path, - wxString *name, - wxString *ext, - wxPathFormat format) -{ - wxString volume; - SplitPath(fullpath, &volume, path, name, ext, format); - - if ( path ) - { - path->Prepend(wxGetVolumeString(volume, format)); - } -} - -/* static */ -wxString wxFileName::StripExtension(const wxString& fullpath) -{ - wxFileName fn(fullpath); - fn.SetExt(_T("")); - return fn.GetFullPath(); -} - -// ---------------------------------------------------------------------------- -// time functions -// ---------------------------------------------------------------------------- - -#if wxUSE_DATETIME - -bool wxFileName::SetTimes(const wxDateTime *dtAccess, - const wxDateTime *dtMod, - const wxDateTime *dtCreate) -{ -#if defined(__WIN32__) - FILETIME ftAccess, ftCreate, ftWrite; - - if ( dtCreate ) - ConvertWxToFileTime(&ftCreate, *dtCreate); - if ( dtAccess ) - ConvertWxToFileTime(&ftAccess, *dtAccess); - if ( dtMod ) - ConvertWxToFileTime(&ftWrite, *dtMod); - - wxString path; - int flags; - if ( IsDir() ) - { - if ( wxGetOsVersion() == wxOS_WINDOWS_9X ) - { - wxLogError(_("Setting directory access times is not supported under this OS version")); - return false; - } - - path = GetPath(); - flags = FILE_FLAG_BACKUP_SEMANTICS; - } - else // file - { - path = GetFullPath(); - flags = 0; - } - - wxFileHandle fh(path, wxFileHandle::Write, flags); - if ( fh.IsOk() ) - { - if ( ::SetFileTime(fh, - dtCreate ? &ftCreate : NULL, - dtAccess ? &ftAccess : NULL, - dtMod ? &ftWrite : NULL) ) - { - return true; - } - } -#elif defined(__UNIX_LIKE__) || (defined(__DOS__) && defined(__WATCOMC__)) - wxUnusedVar(dtCreate); - - if ( !dtAccess && !dtMod ) - { - // can't modify the creation time anyhow, don't try - return true; - } - - // if dtAccess or dtMod is not specified, use the other one (which must be - // non NULL because of the test above) for both times - utimbuf utm; - utm.actime = dtAccess ? dtAccess->GetTicks() : dtMod->GetTicks(); - utm.modtime = dtMod ? dtMod->GetTicks() : dtAccess->GetTicks(); - if ( utime(GetFullPath().fn_str(), &utm) == 0 ) - { - return true; - } -#else // other platform - wxUnusedVar(dtAccess); - wxUnusedVar(dtMod); - wxUnusedVar(dtCreate); -#endif // platforms - - wxLogSysError(_("Failed to modify file times for '%s'"), - GetFullPath().c_str()); - - return false; -} - -bool wxFileName::Touch() -{ -#if defined(__UNIX_LIKE__) - // under Unix touching file is simple: just pass NULL to utime() - if ( utime(GetFullPath().fn_str(), NULL) == 0 ) - { - return true; - } - - wxLogSysError(_("Failed to touch the file '%s'"), GetFullPath().c_str()); - - return false; -#else // other platform - wxDateTime dtNow = wxDateTime::Now(); - - return SetTimes(&dtNow, &dtNow, NULL /* don't change create time */); -#endif // platforms -} - -#ifdef wxNEED_WX_UNISTD_H - -static int wxStat( const char *file_name, wxStructStat *buf ) -{ - return stat( file_name , buf ); -} - -#endif - -bool wxFileName::GetTimes(wxDateTime *dtAccess, - wxDateTime *dtMod, - wxDateTime *dtCreate) const -{ -#if defined(__WIN32__) - // we must use different methods for the files and directories under - // Windows as CreateFile(GENERIC_READ) doesn't work for the directories and - // CreateFile(FILE_FLAG_BACKUP_SEMANTICS) works -- but only under NT and - // not 9x - bool ok; - FILETIME ftAccess, ftCreate, ftWrite; - if ( IsDir() ) - { - // implemented in msw/dir.cpp - extern bool wxGetDirectoryTimes(const wxString& dirname, - FILETIME *, FILETIME *, FILETIME *); - - // we should pass the path without the trailing separator to - // wxGetDirectoryTimes() - ok = wxGetDirectoryTimes(GetPath(wxPATH_GET_VOLUME), - &ftAccess, &ftCreate, &ftWrite); - } - else // file - { - wxFileHandle fh(GetFullPath(), wxFileHandle::Read); - if ( fh.IsOk() ) - { - ok = ::GetFileTime(fh, - dtCreate ? &ftCreate : NULL, - dtAccess ? &ftAccess : NULL, - dtMod ? &ftWrite : NULL) != 0; - } - else - { - ok = false; - } - } - - if ( ok ) - { - if ( dtCreate ) - ConvertFileTimeToWx(dtCreate, ftCreate); - if ( dtAccess ) - ConvertFileTimeToWx(dtAccess, ftAccess); - if ( dtMod ) - ConvertFileTimeToWx(dtMod, ftWrite); - - return true; - } -#elif defined(__UNIX_LIKE__) || defined(__WXMAC__) || defined(__OS2__) || (defined(__DOS__) && defined(__WATCOMC__)) - // no need to test for IsDir() here - wxStructStat stBuf; - if ( wxStat( GetFullPath().fn_str(), &stBuf) == 0 ) - { - if ( dtAccess ) - dtAccess->Set(stBuf.st_atime); - if ( dtMod ) - dtMod->Set(stBuf.st_mtime); - if ( dtCreate ) - dtCreate->Set(stBuf.st_ctime); - - return true; - } -#else // other platform - wxUnusedVar(dtAccess); - wxUnusedVar(dtMod); - wxUnusedVar(dtCreate); -#endif // platforms - - wxLogSysError(_("Failed to retrieve file times for '%s'"), - GetFullPath().c_str()); - - return false; -} - -#endif // wxUSE_DATETIME - - -// ---------------------------------------------------------------------------- -// file size functions -// ---------------------------------------------------------------------------- - -/* static */ -wxULongLong wxFileName::GetSize(const wxString &filename) -{ - if (!wxFileExists(filename)) - return wxInvalidSize; - -#if defined(__WXPALMOS__) - // TODO - return wxInvalidSize; -#elif defined(__WIN32__) - wxFileHandle f(filename, wxFileHandle::Read); - if (!f.IsOk()) - return wxInvalidSize; - - DWORD lpFileSizeHigh; - DWORD ret = GetFileSize(f, &lpFileSizeHigh); - if ( ret == INVALID_FILE_SIZE && ::GetLastError() != NO_ERROR ) - return wxInvalidSize; - - return wxULongLong(lpFileSizeHigh, ret); -#else // ! __WIN32__ - wxStructStat st; -#ifndef wxNEED_WX_UNISTD_H - if (wxStat( filename.fn_str() , &st) != 0) -#else - if (wxStat( filename, &st) != 0) -#endif - return wxInvalidSize; - return wxULongLong(st.st_size); -#endif -} - -/* static */ -wxString wxFileName::GetHumanReadableSize(const wxULongLong &bs, - const wxString &nullsize, - int precision) -{ - static const double KILOBYTESIZE = 1024.0; - static const double MEGABYTESIZE = 1024.0*KILOBYTESIZE; - static const double GIGABYTESIZE = 1024.0*MEGABYTESIZE; - static const double TERABYTESIZE = 1024.0*GIGABYTESIZE; - - if (bs == 0 || bs == wxInvalidSize) - return nullsize; - - double bytesize = bs.ToDouble(); - if (bytesize < KILOBYTESIZE) - return wxString::Format(_("%s B"), bs.ToString().c_str()); - if (bytesize < MEGABYTESIZE) - return wxString::Format(_("%.*f kB"), precision, bytesize/KILOBYTESIZE); - if (bytesize < GIGABYTESIZE) - return wxString::Format(_("%.*f MB"), precision, bytesize/MEGABYTESIZE); - if (bytesize < TERABYTESIZE) - return wxString::Format(_("%.*f GB"), precision, bytesize/GIGABYTESIZE); - - return wxString::Format(_("%.*f TB"), precision, bytesize/TERABYTESIZE); -} - -wxULongLong wxFileName::GetSize() const -{ - return GetSize(GetFullPath()); -} - -wxString wxFileName::GetHumanReadableSize(const wxString &failmsg, int precision) const -{ - return GetHumanReadableSize(GetSize(), failmsg, precision); -} - - -// ---------------------------------------------------------------------------- -// Mac-specific functions -// ---------------------------------------------------------------------------- - -#ifdef __WXMAC__ - -const short kMacExtensionMaxLength = 16 ; -class MacDefaultExtensionRecord -{ -public : - MacDefaultExtensionRecord() - { - m_ext[0] = 0 ; - m_type = m_creator = 0 ; - } - MacDefaultExtensionRecord( const MacDefaultExtensionRecord& from ) - { - wxStrcpy( m_ext , from.m_ext ) ; - m_type = from.m_type ; - m_creator = from.m_creator ; - } - MacDefaultExtensionRecord( const wxChar * extension , OSType type , OSType creator ) - { - wxStrncpy( m_ext , extension , kMacExtensionMaxLength ) ; - m_ext[kMacExtensionMaxLength] = 0 ; - m_type = type ; - m_creator = creator ; - } - wxChar m_ext[kMacExtensionMaxLength] ; - OSType m_type ; - OSType m_creator ; -} ; - -WX_DECLARE_OBJARRAY(MacDefaultExtensionRecord, MacDefaultExtensionArray) ; - -bool gMacDefaultExtensionsInited = false ; - -#include "wx/arrimpl.cpp" - -WX_DEFINE_EXPORTED_OBJARRAY(MacDefaultExtensionArray) ; - -MacDefaultExtensionArray gMacDefaultExtensions ; - -// load the default extensions -MacDefaultExtensionRecord gDefaults[] = -{ - MacDefaultExtensionRecord( wxT("txt") , 'TEXT' , 'ttxt' ) , - MacDefaultExtensionRecord( wxT("tif") , 'TIFF' , '****' ) , - MacDefaultExtensionRecord( wxT("jpg") , 'JPEG' , '****' ) , -} ; - -static void MacEnsureDefaultExtensionsLoaded() -{ - if ( !gMacDefaultExtensionsInited ) - { - // we could load the pc exchange prefs here too - for ( size_t i = 0 ; i < WXSIZEOF( gDefaults ) ; ++i ) - { - gMacDefaultExtensions.Add( gDefaults[i] ) ; - } - gMacDefaultExtensionsInited = true ; - } -} - -bool wxFileName::MacSetTypeAndCreator( wxUint32 type , wxUint32 creator ) -{ - FSRef fsRef ; - FSCatalogInfo catInfo; - FileInfo *finfo ; - - if ( wxMacPathToFSRef( GetFullPath() , &fsRef ) == noErr ) - { - if ( FSGetCatalogInfo (&fsRef, kFSCatInfoFinderInfo, &catInfo, NULL, NULL, NULL) == noErr ) - { - finfo = (FileInfo*)&catInfo.finderInfo; - finfo->fileType = type ; - finfo->fileCreator = creator ; - FSSetCatalogInfo( &fsRef, kFSCatInfoFinderInfo, &catInfo ) ; - return true ; - } - } - return false ; -} - -bool wxFileName::MacGetTypeAndCreator( wxUint32 *type , wxUint32 *creator ) -{ - FSRef fsRef ; - FSCatalogInfo catInfo; - FileInfo *finfo ; - - if ( wxMacPathToFSRef( GetFullPath() , &fsRef ) == noErr ) - { - if ( FSGetCatalogInfo (&fsRef, kFSCatInfoFinderInfo, &catInfo, NULL, NULL, NULL) == noErr ) - { - finfo = (FileInfo*)&catInfo.finderInfo; - *type = finfo->fileType ; - *creator = finfo->fileCreator ; - return true ; - } - } - return false ; -} - -bool wxFileName::MacSetDefaultTypeAndCreator() -{ - wxUint32 type , creator ; - if ( wxFileName::MacFindDefaultTypeAndCreator(GetExt() , &type , - &creator ) ) - { - return MacSetTypeAndCreator( type , creator ) ; - } - return false; -} - -bool wxFileName::MacFindDefaultTypeAndCreator( const wxString& ext , wxUint32 *type , wxUint32 *creator ) -{ - MacEnsureDefaultExtensionsLoaded() ; - wxString extl = ext.Lower() ; - for( int i = gMacDefaultExtensions.Count() - 1 ; i >= 0 ; --i ) - { - if ( gMacDefaultExtensions.Item(i).m_ext == extl ) - { - *type = gMacDefaultExtensions.Item(i).m_type ; - *creator = gMacDefaultExtensions.Item(i).m_creator ; - return true ; - } - } - return false ; -} - -void wxFileName::MacRegisterDefaultTypeAndCreator( const wxString& ext , wxUint32 type , wxUint32 creator ) -{ - MacEnsureDefaultExtensionsLoaded() ; - MacDefaultExtensionRecord rec ; - rec.m_type = type ; - rec.m_creator = creator ; - wxStrncpy( rec.m_ext , ext.Lower().c_str() , kMacExtensionMaxLength ) ; - gMacDefaultExtensions.Add( rec ) ; -} -#endif diff --git a/wxWidgets/src/common/filepickercmn.cpp b/wxWidgets/src/common/filepickercmn.cpp deleted file mode 100644 index 7b805dc8fe..0000000000 --- a/wxWidgets/src/common/filepickercmn.cpp +++ /dev/null @@ -1,224 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: src/common/filepickercmn.cpp -// Purpose: wxFilePickerCtrl class implementation -// Author: Francesco Montorsi (readapted code written by Vadim Zeitlin) -// Modified by: -// Created: 15/04/2006 -// RCS-ID: $Id: filepickercmn.cpp 42219 2006-10-21 19:53:05Z PC $ -// Copyright: (c) Vadim Zeitlin, Francesco Montorsi -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_FILEPICKERCTRL || wxUSE_DIRPICKERCTRL - -#include "wx/filepicker.h" -#include "wx/filename.h" - -#ifndef WX_PRECOMP - #include "wx/textctrl.h" -#endif - -// ============================================================================ -// implementation -// ============================================================================ - -const wxChar wxFilePickerCtrlNameStr[] = wxT("filepicker"); -const wxChar wxFilePickerWidgetNameStr[] = wxT("filepickerwidget"); -const wxChar wxDirPickerCtrlNameStr[] = wxT("dirpicker"); -const wxChar wxDirPickerWidgetNameStr[] = wxT("dirpickerwidget"); -const wxChar wxFilePickerWidgetLabel[] = wxT("Browse"); -const wxChar wxDirPickerWidgetLabel[] = wxT("Browse"); - -DEFINE_EVENT_TYPE(wxEVT_COMMAND_FILEPICKER_CHANGED) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_DIRPICKER_CHANGED) -IMPLEMENT_DYNAMIC_CLASS(wxFileDirPickerEvent, wxCommandEvent) - -// ---------------------------------------------------------------------------- -// wxFileDirPickerCtrlBase -// ---------------------------------------------------------------------------- - -bool wxFileDirPickerCtrlBase::CreateBase(wxWindow *parent, - wxWindowID id, - const wxString &path, - const wxString &message, - const wxString &wildcard, - const wxPoint &pos, - const wxSize &size, - long style, - const wxValidator& validator, - const wxString &name ) -{ - wxASSERT_MSG(path.empty() || CheckPath(path), wxT("Invalid initial path!")); - - if (!wxPickerBase::CreateBase(parent, id, path, pos, size, - style, validator, name)) - return false; - - if (!HasFlag(wxFLP_OPEN) && !HasFlag(wxFLP_SAVE)) - m_windowStyle |= wxFLP_OPEN; // wxFD_OPEN is the default - - // check that the styles are not contradictory - wxASSERT_MSG( !(HasFlag(wxFLP_SAVE) && HasFlag(wxFLP_OPEN)), - _T("can't specify both wxFLP_SAVE and wxFLP_OPEN at once") ); - - wxASSERT_MSG( !HasFlag(wxFLP_SAVE) || !HasFlag(wxFLP_FILE_MUST_EXIST), - _T("wxFLP_FILE_MUST_EXIST can't be used with wxFLP_SAVE" ) ); - - wxASSERT_MSG( !HasFlag(wxFLP_OPEN) || !HasFlag(wxFLP_OVERWRITE_PROMPT), - _T("wxFLP_OVERWRITE_PROMPT can't be used with wxFLP_OPEN") ); - - // create a wxFilePickerWidget or a wxDirPickerWidget... - m_pickerIface = CreatePicker(this, path, message, wildcard); - if ( !m_pickerIface ) - return false; - m_picker = m_pickerIface->AsControl(); - - // complete sizer creation - wxPickerBase::PostCreation(); - - m_picker->Connect(GetEventType(), - wxFileDirPickerEventHandler(wxFileDirPickerCtrlBase::OnFileDirChange), - NULL, this); - - // default's wxPickerBase textctrl limit is too small for this control: - // make it bigger - if (m_text) m_text->SetMaxLength(512); - - return true; -} - -wxString wxFileDirPickerCtrlBase::GetPath() const -{ - return m_pickerIface->GetPath(); -} - -void wxFileDirPickerCtrlBase::SetPath(const wxString &path) -{ - m_pickerIface->SetPath(path); - UpdateTextCtrlFromPicker(); -} - -void wxFileDirPickerCtrlBase::UpdatePickerFromTextCtrl() -{ - wxASSERT(m_text); - - if (m_bIgnoreNextTextCtrlUpdate) - { - // ignore this update - m_bIgnoreNextTextCtrlUpdate = false; - return; - } - - // remove the eventually present path-separator from the end of the textctrl - // string otherwise we would generate a wxFileDirPickerEvent when changing - // from e.g. /home/user to /home/user/ and we want to avoid it ! - wxString newpath(GetTextCtrlValue()); - if (!CheckPath(newpath)) - return; // invalid user input - - if (m_pickerIface->GetPath() != newpath) - { - m_pickerIface->SetPath(newpath); - - // update current working directory, if necessary - // NOTE: the path separator is required because if newpath is "C:" - // then no change would happen - if (IsCwdToUpdate()) - wxSetWorkingDirectory(newpath); - - // fire an event - wxFileDirPickerEvent event(GetEventType(), this, GetId(), newpath); - GetEventHandler()->ProcessEvent(event); - } -} - -void wxFileDirPickerCtrlBase::UpdateTextCtrlFromPicker() -{ - if (!m_text) - return; // no textctrl to update - - // NOTE: this SetValue() will generate an unwanted wxEVT_COMMAND_TEXT_UPDATED - // which will trigger a unneeded UpdateFromTextCtrl(); thus before using - // SetValue() we set the m_bIgnoreNextTextCtrlUpdate flag... - m_bIgnoreNextTextCtrlUpdate = true; - m_text->SetValue(m_pickerIface->GetPath()); -} - - - -// ---------------------------------------------------------------------------- -// wxFileDirPickerCtrlBase - event handlers -// ---------------------------------------------------------------------------- - -void wxFileDirPickerCtrlBase::OnFileDirChange(wxFileDirPickerEvent &ev) -{ - UpdateTextCtrlFromPicker(); - - // the wxFilePickerWidget sent us a colour-change notification. - // forward this event to our parent - wxFileDirPickerEvent event(GetEventType(), this, GetId(), ev.GetPath()); - GetEventHandler()->ProcessEvent(event); -} - -#endif // wxUSE_FILEPICKERCTRL || wxUSE_DIRPICKERCTRL - -// ---------------------------------------------------------------------------- -// wxFileDirPickerCtrl -// ---------------------------------------------------------------------------- - -#if wxUSE_FILEPICKERCTRL - -IMPLEMENT_DYNAMIC_CLASS(wxFilePickerCtrl, wxPickerBase) - -bool wxFilePickerCtrl::CheckPath(const wxString& path) const -{ - // if wxFLP_SAVE was given or wxFLP_FILE_MUST_EXIST has NOT been given we - // must accept any path - return HasFlag(wxFLP_SAVE) || - !HasFlag(wxFLP_FILE_MUST_EXIST) || - wxFileName::FileExists(path); -} - -wxString wxFilePickerCtrl::GetTextCtrlValue() const -{ - // filter it through wxFileName to remove any spurious path separator - return wxFileName(m_text->GetValue()).GetFullPath(); -} - -#endif // wxUSE_FILEPICKERCTRL - -// ---------------------------------------------------------------------------- -// wxDirPickerCtrl -// ---------------------------------------------------------------------------- - -#if wxUSE_DIRPICKERCTRL -IMPLEMENT_DYNAMIC_CLASS(wxDirPickerCtrl, wxPickerBase) - -bool wxDirPickerCtrl::CheckPath(const wxString& path) const -{ - // if wxDIRP_DIR_MUST_EXIST has NOT been given we must accept any path - return !HasFlag(wxDIRP_DIR_MUST_EXIST) || wxFileName::DirExists(path); -} - -wxString wxDirPickerCtrl::GetTextCtrlValue() const -{ - // filter it through wxFileName to remove any spurious path separator - return wxFileName::DirName(m_text->GetValue()).GetPath(); -} - -#endif // wxUSE_DIRPICKERCTRL diff --git a/wxWidgets/src/common/filesys.cpp b/wxWidgets/src/common/filesys.cpp deleted file mode 100644 index 0f850bcf66..0000000000 --- a/wxWidgets/src/common/filesys.cpp +++ /dev/null @@ -1,700 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/common/filesys.cpp -// Purpose: wxFileSystem class - interface for opening files -// Author: Vaclav Slavik -// Copyright: (c) 1999 Vaclav Slavik -// CVS-ID: $Id: filesys.cpp 55271 2008-08-26 00:03:04Z VZ $ -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - - -#if wxUSE_FILESYSTEM - -#include "wx/filesys.h" - -#ifndef WX_PRECOMP - #include "wx/log.h" - #include "wx/module.h" -#endif - -#include "wx/sysopt.h" -#include "wx/wfstream.h" -#include "wx/mimetype.h" -#include "wx/filename.h" -#include "wx/tokenzr.h" -#include "wx/uri.h" -#include "wx/private/fileback.h" - - -//-------------------------------------------------------------------------------- -// wxFileSystemHandler -//-------------------------------------------------------------------------------- - -IMPLEMENT_ABSTRACT_CLASS(wxFileSystemHandler, wxObject) - - -wxString wxFileSystemHandler::GetMimeTypeFromExt(const wxString& location) -{ - wxString ext, mime; - wxString loc = GetRightLocation(location); - wxChar c; - int l = loc.length(), l2; - - l2 = l; - for (int i = l-1; i >= 0; i--) - { - c = loc[(unsigned int) i]; - if ( c == wxT('#') ) - l2 = i + 1; - if ( c == wxT('.') ) - { - ext = loc.Right(l2-i-1); - break; - } - if ( (c == wxT('/')) || (c == wxT('\\')) || (c == wxT(':')) ) - return wxEmptyString; - } - -#if wxUSE_MIMETYPE - static bool s_MinimalMimeEnsured = false; - - // Don't use mime types manager if the application doesn't need it and it would be - // cause an unacceptable delay, especially on startup. - bool useMimeTypesManager = true; -#if wxUSE_SYSTEM_OPTIONS - useMimeTypesManager = (wxSystemOptions::GetOptionInt(wxT("filesys.no-mimetypesmanager")) == 0); -#endif - - if (useMimeTypesManager) - { - if (!s_MinimalMimeEnsured) - { - static const wxFileTypeInfo fallbacks[] = - { - wxFileTypeInfo(_T("image/jpeg"), - wxEmptyString, - wxEmptyString, - _T("JPEG image (from fallback)"), - _T("jpg"), _T("jpeg"), _T("JPG"), _T("JPEG"), NULL), - wxFileTypeInfo(_T("image/gif"), - wxEmptyString, - wxEmptyString, - _T("GIF image (from fallback)"), - _T("gif"), _T("GIF"), NULL), - wxFileTypeInfo(_T("image/png"), - wxEmptyString, - wxEmptyString, - _T("PNG image (from fallback)"), - _T("png"), _T("PNG"), NULL), - wxFileTypeInfo(_T("image/bmp"), - wxEmptyString, - wxEmptyString, - _T("windows bitmap image (from fallback)"), - _T("bmp"), _T("BMP"), NULL), - wxFileTypeInfo(_T("text/html"), - wxEmptyString, - wxEmptyString, - _T("HTML document (from fallback)"), - _T("htm"), _T("html"), _T("HTM"), _T("HTML"), NULL), - // must terminate the table with this! - wxFileTypeInfo() - }; - wxTheMimeTypesManager->AddFallbacks(fallbacks); - s_MinimalMimeEnsured = true; - } - - wxFileType *ft = wxTheMimeTypesManager->GetFileTypeFromExtension(ext); - if ( !ft || !ft -> GetMimeType(&mime) ) - { - mime = wxEmptyString; - } - - delete ft; - - return mime; - } - else -#endif - { - if ( ext.IsSameAs(wxT("htm"), false) || ext.IsSameAs(_T("html"), false) ) - return wxT("text/html"); - if ( ext.IsSameAs(wxT("jpg"), false) || ext.IsSameAs(_T("jpeg"), false) ) - return wxT("image/jpeg"); - if ( ext.IsSameAs(wxT("gif"), false) ) - return wxT("image/gif"); - if ( ext.IsSameAs(wxT("png"), false) ) - return wxT("image/png"); - if ( ext.IsSameAs(wxT("bmp"), false) ) - return wxT("image/bmp"); - return wxEmptyString; - } -} - - - -wxString wxFileSystemHandler::GetProtocol(const wxString& location) const -{ - wxString s = wxEmptyString; - int i, l = location.length(); - bool fnd = false; - - for (i = l-1; (i >= 0) && ((location[i] != wxT('#')) || (!fnd)); i--) { - if ((location[i] == wxT(':')) && (i != 1 /*win: C:\path*/)) fnd = true; - } - if (!fnd) return wxT("file"); - for (++i; (i < l) && (location[i] != wxT(':')); i++) s << location[i]; - return s; -} - - -wxString wxFileSystemHandler::GetLeftLocation(const wxString& location) const -{ - int i; - bool fnd = false; - - for (i = location.length()-1; i >= 0; i--) { - if ((location[i] == wxT(':')) && (i != 1 /*win: C:\path*/)) fnd = true; - else if (fnd && (location[i] == wxT('#'))) return location.Left(i); - } - return wxEmptyString; -} - -wxString wxFileSystemHandler::GetRightLocation(const wxString& location) const -{ - int i, l = location.length(); - int l2 = l + 1; - - for (i = l-1; - (i >= 0) && - ((location[i] != wxT(':')) || (i == 1) || (location[i-2] == wxT(':'))); - i--) - { - if (location[i] == wxT('#')) l2 = i + 1; - } - if (i == 0) return wxEmptyString; - else return location.Mid(i + 1, l2 - i - 2); -} - -wxString wxFileSystemHandler::GetAnchor(const wxString& location) const -{ - wxChar c; - int l = location.length(); - - for (int i = l-1; i >= 0; i--) { - c = location[i]; - if (c == wxT('#')) - return location.Right(l-i-1); - else if ((c == wxT('/')) || (c == wxT('\\')) || (c == wxT(':'))) - return wxEmptyString; - } - return wxEmptyString; -} - - -wxString wxFileSystemHandler::FindFirst(const wxString& WXUNUSED(spec), - int WXUNUSED(flags)) -{ - return wxEmptyString; -} - -wxString wxFileSystemHandler::FindNext() -{ - return wxEmptyString; -} - -//-------------------------------------------------------------------------------- -// wxLocalFSHandler -//-------------------------------------------------------------------------------- - - -wxString wxLocalFSHandler::ms_root; - -bool wxLocalFSHandler::CanOpen(const wxString& location) -{ - return GetProtocol(location) == wxT("file"); -} - -wxFSFile* wxLocalFSHandler::OpenFile(wxFileSystem& WXUNUSED(fs), const wxString& location) -{ - // location has Unix path separators - wxString right = GetRightLocation(location); - wxFileName fn = wxFileSystem::URLToFileName(right); - wxString fullpath = ms_root + fn.GetFullPath(); - - if (!wxFileExists(fullpath)) - return (wxFSFile*) NULL; - - // we need to check whether we can really read from this file, otherwise - // wxFSFile is not going to work -#if wxUSE_FFILE - wxFFileInputStream *is = new wxFFileInputStream(fullpath); -#elif wxUSE_FILE - wxFileInputStream *is = new wxFileInputStream(fullpath); -#else -#error One of wxUSE_FILE or wxUSE_FFILE must be set to 1 for wxFSHandler to work -#endif - if ( !is->Ok() ) - { - delete is; - return (wxFSFile*) NULL; - } - - return new wxFSFile(is, - right, - GetMimeTypeFromExt(location), - GetAnchor(location) -#if wxUSE_DATETIME - ,wxDateTime(wxFileModificationTime(fullpath)) -#endif // wxUSE_DATETIME - ); -} - -wxString wxLocalFSHandler::FindFirst(const wxString& spec, int flags) -{ - wxFileName fn = wxFileSystem::URLToFileName(GetRightLocation(spec)); - return wxFindFirstFile(ms_root + fn.GetFullPath(), flags); -} - -wxString wxLocalFSHandler::FindNext() -{ - return wxFindNextFile(); -} - - - -//----------------------------------------------------------------------------- -// wxFileSystem -//----------------------------------------------------------------------------- - -IMPLEMENT_DYNAMIC_CLASS(wxFileSystem, wxObject) -IMPLEMENT_ABSTRACT_CLASS(wxFSFile, wxObject) - - -wxList wxFileSystem::m_Handlers; - - -wxFileSystem::~wxFileSystem() -{ - WX_CLEAR_HASH_MAP(wxFSHandlerHash, m_LocalHandlers) -} - - -static wxString MakeCorrectPath(const wxString& path) -{ - wxString p(path); - wxString r; - int i, j, cnt; - - cnt = p.length(); - for (i = 0; i < cnt; i++) - if (p.GetChar(i) == wxT('\\')) p.GetWritableChar(i) = wxT('/'); // Want to be windows-safe - - if (p.Left(2) == wxT("./")) { p = p.Mid(2); cnt -= 2; } - - if (cnt < 3) return p; - - r << p.GetChar(0) << p.GetChar(1); - - // skip trailing ../.., if any - for (i = 2; i < cnt && (p.GetChar(i) == wxT('/') || p.GetChar(i) == wxT('.')); i++) r << p.GetChar(i); - - // remove back references: translate dir1/../dir2 to dir2 - for (; i < cnt; i++) - { - r << p.GetChar(i); - if (p.GetChar(i) == wxT('/') && p.GetChar(i-1) == wxT('.') && p.GetChar(i-2) == wxT('.')) - { - for (j = r.length() - 2; j >= 0 && r.GetChar(j) != wxT('/') && r.GetChar(j) != wxT(':'); j--) {} - if (j >= 0 && r.GetChar(j) != wxT(':')) - { - for (j = j - 1; j >= 0 && r.GetChar(j) != wxT('/') && r.GetChar(j) != wxT(':'); j--) {} - r.Remove(j + 1); - } - } - } - - for (; i < cnt; i++) r << p.GetChar(i); - - return r; -} - - -void wxFileSystem::ChangePathTo(const wxString& location, bool is_dir) -{ - int i, pathpos = -1; - - m_Path = MakeCorrectPath(location); - - if (is_dir) - { - if (m_Path.length() > 0 && m_Path.Last() != wxT('/') && m_Path.Last() != wxT(':')) - m_Path << wxT('/'); - } - - else - { - for (i = m_Path.length()-1; i >= 0; i--) - { - if (m_Path[(unsigned int) i] == wxT('/')) - { - if ((i > 1) && (m_Path[(unsigned int) (i-1)] == wxT('/')) && (m_Path[(unsigned int) (i-2)] == wxT(':'))) - { - i -= 2; - continue; - } - else - { - pathpos = i; - break; - } - } - else if (m_Path[(unsigned int) i] == wxT(':')) { - pathpos = i; - break; - } - } - if (pathpos == -1) - { - for (i = 0; i < (int) m_Path.length(); i++) - { - if (m_Path[(unsigned int) i] == wxT(':')) - { - m_Path.Remove(i+1); - break; - } - } - if (i == (int) m_Path.length()) - m_Path = wxEmptyString; - } - else - { - m_Path.Remove(pathpos+1); - } - } -} - - - -wxFileSystemHandler *wxFileSystem::MakeLocal(wxFileSystemHandler *h) -{ - wxClassInfo *classinfo = h->GetClassInfo(); - - if (classinfo->IsDynamic()) - { - wxFileSystemHandler*& local = m_LocalHandlers[classinfo]; - if (!local) - local = (wxFileSystemHandler*)classinfo->CreateObject(); - return local; - } - else - { - return h; - } -} - - - -wxFSFile* wxFileSystem::OpenFile(const wxString& location, int flags) -{ - if ((flags & wxFS_READ) == 0) - return NULL; - - wxString loc = MakeCorrectPath(location); - unsigned i, ln; - wxChar meta; - wxFSFile *s = NULL; - wxList::compatibility_iterator node; - - ln = loc.length(); - meta = 0; - for (i = 0; i < ln; i++) - { - switch (loc[i]) - { - case wxT('/') : case wxT(':') : case wxT('#') : - meta = loc[i]; - break; - } - if (meta != 0) break; - } - m_LastName = wxEmptyString; - - // try relative paths first : - if (meta != wxT(':')) - { - node = m_Handlers.GetFirst(); - while (node) - { - wxFileSystemHandler *h = (wxFileSystemHandler*) node -> GetData(); - if (h->CanOpen(m_Path + loc)) - { - s = MakeLocal(h)->OpenFile(*this, m_Path + loc); - if (s) { m_LastName = m_Path + loc; break; } - } - node = node->GetNext(); - } - } - - // if failed, try absolute paths : - if (s == NULL) - { - node = m_Handlers.GetFirst(); - while (node) - { - wxFileSystemHandler *h = (wxFileSystemHandler*) node->GetData(); - if (h->CanOpen(loc)) - { - s = MakeLocal(h)->OpenFile(*this, loc); - if (s) { m_LastName = loc; break; } - } - node = node->GetNext(); - } - } - - if (s && (flags & wxFS_SEEKABLE) != 0 && !s->GetStream()->IsSeekable()) - { - wxBackedInputStream *stream; - stream = new wxBackedInputStream(s->DetachStream()); - stream->FindLength(); - s->SetStream(stream); - } - - return (s); -} - - - -wxString wxFileSystem::FindFirst(const wxString& spec, int flags) -{ - wxList::compatibility_iterator node; - wxString spec2(spec); - - m_FindFileHandler = NULL; - - for (int i = spec2.length()-1; i >= 0; i--) - if (spec2[(unsigned int) i] == wxT('\\')) spec2.GetWritableChar(i) = wxT('/'); // Want to be windows-safe - - node = m_Handlers.GetFirst(); - while (node) - { - wxFileSystemHandler *h = (wxFileSystemHandler*) node -> GetData(); - if (h -> CanOpen(m_Path + spec2)) - { - m_FindFileHandler = MakeLocal(h); - return m_FindFileHandler -> FindFirst(m_Path + spec2, flags); - } - node = node->GetNext(); - } - - node = m_Handlers.GetFirst(); - while (node) - { - wxFileSystemHandler *h = (wxFileSystemHandler*) node -> GetData(); - if (h -> CanOpen(spec2)) - { - m_FindFileHandler = MakeLocal(h); - return m_FindFileHandler -> FindFirst(spec2, flags); - } - node = node->GetNext(); - } - - return wxEmptyString; -} - - - -wxString wxFileSystem::FindNext() -{ - if (m_FindFileHandler == NULL) return wxEmptyString; - else return m_FindFileHandler -> FindNext(); -} - -bool wxFileSystem::FindFileInPath(wxString *pStr, - const wxChar *path, - const wxChar *basename) -{ - // we assume that it's not empty - wxCHECK_MSG( !wxIsEmpty(basename), false, - _T("empty file name in wxFileSystem::FindFileInPath")); - - // skip path separator in the beginning of the file name if present - if ( wxIsPathSeparator(*basename) ) - basename++; - - wxStringTokenizer tokenizer(path, wxPATH_SEP); - while ( tokenizer.HasMoreTokens() ) - { - wxString strFile = tokenizer.GetNextToken(); - if ( !wxEndsWithPathSeparator(strFile) ) - strFile += wxFILE_SEP_PATH; - strFile += basename; - - wxFSFile *file = OpenFile(strFile); - if ( file ) - { - delete file; - *pStr = strFile; - return true; - } - } - - return false; -} - -void wxFileSystem::AddHandler(wxFileSystemHandler *handler) -{ - // prepend the handler to the beginning of the list because handlers added - // last should have the highest priority to allow overriding them - m_Handlers.Insert((size_t)0, handler); -} - -wxFileSystemHandler* wxFileSystem::RemoveHandler(wxFileSystemHandler *handler) -{ - // if handler has already been removed (or deleted) - // we return NULL. This is by design in case - // CleanUpHandlers() is called before RemoveHandler - // is called, as we cannot control the order - // which modules are unloaded - if (!m_Handlers.DeleteObject(handler)) - return NULL; - - return handler; -} - - -bool wxFileSystem::HasHandlerForPath(const wxString &location) -{ - for ( wxList::compatibility_iterator node = m_Handlers.GetFirst(); - node; node = node->GetNext() ) - { - wxFileSystemHandler *h = (wxFileSystemHandler*) node->GetData(); - if (h->CanOpen(location)) - return true; - } - - return false; -} - -void wxFileSystem::CleanUpHandlers() -{ - WX_CLEAR_LIST(wxList, m_Handlers); -} - -static const wxString g_unixPathString(wxT("/")); -static const wxString g_nativePathString(wxFILE_SEP_PATH); - -// Returns the native path for a file URL -wxFileName wxFileSystem::URLToFileName(const wxString& url) -{ - wxString path = url; - - if ( path.Find(wxT("file://")) == 0 ) - { - path = path.Mid(7); - } - else if ( path.Find(wxT("file:")) == 0 ) - { - path = path.Mid(5); - } - // Remove preceding double slash on Mac Classic -#if defined(__WXMAC__) && !defined(__UNIX__) - else if ( path.Find(wxT("//")) == 0 ) - path = path.Mid(2); -#endif - - path = wxURI::Unescape(path); - -#ifdef __WXMSW__ - // file urls either start with a forward slash (local harddisk), - // otherwise they have a servername/sharename notation, - // which only exists on msw and corresponds to a unc - if ( path[0u] == wxT('/') && path [1u] != wxT('/')) - { - path = path.Mid(1); - } - else if ( (url.Find(wxT("file://")) == 0) && - (path.Find(wxT('/')) != wxNOT_FOUND) && - (path.length() > 1) && (path[1u] != wxT(':')) ) - { - path = wxT("//") + path; - } -#endif - - path.Replace(g_unixPathString, g_nativePathString); - - return wxFileName(path, wxPATH_NATIVE); -} - -// Returns the file URL for a native path -wxString wxFileSystem::FileNameToURL(const wxFileName& filename) -{ - wxFileName fn = filename; - fn.Normalize(wxPATH_NORM_DOTS | wxPATH_NORM_TILDE | wxPATH_NORM_ABSOLUTE); - wxString url = fn.GetFullPath(wxPATH_NATIVE); - -#ifndef __UNIX__ - // unc notation, wxMSW - if ( url.Find(wxT("\\\\")) == 0 ) - { - url = wxT("//") + url.Mid(2); - } - else - { - url = wxT("/") + url; -#ifdef __WXMAC__ - url = wxT("/") + url; -#endif - - } -#endif - - url.Replace(g_nativePathString, g_unixPathString); - url.Replace(wxT("%"), wxT("%25")); // '%'s must be replaced first! - url.Replace(wxT("#"), wxT("%23")); - url.Replace(wxT(":"), wxT("%3A")); - url = wxT("file:") + url; - return url; -} - - -///// Module: - -class wxFileSystemModule : public wxModule -{ - DECLARE_DYNAMIC_CLASS(wxFileSystemModule) - - public: - wxFileSystemModule() : - wxModule(), - m_handler(NULL) - { - } - - virtual bool OnInit() - { - m_handler = new wxLocalFSHandler; - wxFileSystem::AddHandler(m_handler); - return true; - } - virtual void OnExit() - { - delete wxFileSystem::RemoveHandler(m_handler); - - wxFileSystem::CleanUpHandlers(); - } - - private: - wxFileSystemHandler* m_handler; - -}; - -IMPLEMENT_DYNAMIC_CLASS(wxFileSystemModule, wxModule) - -#endif - // wxUSE_FILESYSTEM diff --git a/wxWidgets/src/common/filtall.cpp b/wxWidgets/src/common/filtall.cpp deleted file mode 100644 index 952730f82b..0000000000 --- a/wxWidgets/src/common/filtall.cpp +++ /dev/null @@ -1,36 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/common/filtall.cpp -// Purpose: Link all filter streams -// Author: Mike Wetherell -// RCS-ID: $Id: filtall.cpp 42412 2006-10-25 20:41:12Z MW $ -// Copyright: (c) 2006 Mike Wetherell -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_STREAMS - -#if wxUSE_ZLIB -#include "wx/zstream.h" -#endif - -// Reference filter classes to ensure they are linked into a statically -// linked program that uses Find or GetFirst to look for an filter handler. -// It is in its own file so that the user can override this behaviour by -// providing their own implementation. - -void wxUseFilterClasses() -{ -#if wxUSE_ZLIB - wxZlibClassFactory(); - wxGzipClassFactory(); -#endif -} - -#endif // wxUSE_STREAMS diff --git a/wxWidgets/src/common/filtfind.cpp b/wxWidgets/src/common/filtfind.cpp deleted file mode 100644 index 16cb227f3b..0000000000 --- a/wxWidgets/src/common/filtfind.cpp +++ /dev/null @@ -1,43 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/common/filtfind.cpp -// Purpose: Streams for filter formats -// Author: Mike Wetherell -// RCS-ID: $Id: filtfind.cpp 42412 2006-10-25 20:41:12Z MW $ -// Copyright: (c) Mike Wetherell -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_STREAMS - -#include "wx/stream.h" - -// These functions are in a separate file so that statically linked apps -// that do not call them to search for filter handlers will only link in -// the filter classes they use. - -const wxFilterClassFactory * -wxFilterClassFactory::Find(const wxChar *protocol, wxStreamProtocolType type) -{ - for (const wxFilterClassFactory *f = GetFirst(); f; f = f->GetNext()) - if (f->CanHandle(protocol, type)) - return f; - - return NULL; -} - -// static -const wxFilterClassFactory *wxFilterClassFactory::GetFirst() -{ - if (!sm_first) - wxUseFilterClasses(); - return sm_first; -} - -#endif // wxUSE_STREAMS diff --git a/wxWidgets/src/common/fldlgcmn.cpp b/wxWidgets/src/common/fldlgcmn.cpp deleted file mode 100644 index 6f59d40eb6..0000000000 --- a/wxWidgets/src/common/fldlgcmn.cpp +++ /dev/null @@ -1,348 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/common/fldlgcmn.cpp -// Purpose: wxFileDialog common functions -// Author: John Labenski -// Modified by: -// Created: 14.06.03 (extracted from src/*/filedlg.cpp) -// RCS-ID: $Id: fldlgcmn.cpp 66916 2011-02-16 21:48:55Z JS $ -// Copyright: (c) Robert Roebling -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __BORLANDC__ -#pragma hdrstop -#endif - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#if wxUSE_FILEDLG - -#include "wx/filedlg.h" -#include "wx/dirdlg.h" - -#ifndef WX_PRECOMP - #include "wx/string.h" - #include "wx/intl.h" - #include "wx/window.h" -#endif // WX_PRECOMP - -//---------------------------------------------------------------------------- -// wxFileDialogBase -//---------------------------------------------------------------------------- - -IMPLEMENT_DYNAMIC_CLASS(wxFileDialogBase, wxDialog) - -void wxFileDialogBase::Init() -{ - m_filterIndex = - m_windowStyle = 0; -} - -bool wxFileDialogBase::Create(wxWindow *parent, - const wxString& message, - const wxString& defaultDir, - const wxString& defaultFile, - const wxString& wildCard, - long style, - const wxPoint& WXUNUSED(pos), - const wxSize& WXUNUSED(sz), - const wxString& WXUNUSED(name)) -{ - m_message = message; - m_dir = defaultDir; - m_fileName = defaultFile; - m_wildCard = wildCard; - - m_parent = parent; - m_windowStyle = style; - m_filterIndex = 0; - - if (!HasFdFlag(wxFD_OPEN) && !HasFdFlag(wxFD_SAVE)) - m_windowStyle |= wxFD_OPEN; // wxFD_OPEN is the default - - // check that the styles are not contradictory - wxASSERT_MSG( !(HasFdFlag(wxFD_SAVE) && HasFdFlag(wxFD_OPEN)), - _T("can't specify both wxFD_SAVE and wxFD_OPEN at once") ); - - wxASSERT_MSG( !HasFdFlag(wxFD_SAVE) || - (!HasFdFlag(wxFD_MULTIPLE) && !HasFdFlag(wxFD_FILE_MUST_EXIST)), - _T("wxFD_MULTIPLE or wxFD_FILE_MUST_EXIST can't be used with wxFD_SAVE" ) ); - - wxASSERT_MSG( !HasFdFlag(wxFD_OPEN) || !HasFdFlag(wxFD_OVERWRITE_PROMPT), - _T("wxFD_OVERWRITE_PROMPT can't be used with wxFD_OPEN") ); - - if ( wildCard.empty() || wildCard == wxFileSelectorDefaultWildcardStr ) - { - m_wildCard = wxString::Format(_("All files (%s)|%s"), - wxFileSelectorDefaultWildcardStr, - wxFileSelectorDefaultWildcardStr); - } - else // have wild card - { - // convert m_wildCard from "*.bar" to "bar files (*.bar)|*.bar" - if ( m_wildCard.Find(wxT('|')) == wxNOT_FOUND ) - { - wxString::size_type nDot = m_wildCard.find(_T("*.")); - if ( nDot != wxString::npos ) - nDot++; - else - nDot = 0; - - m_wildCard = wxString::Format - ( - _("%s files (%s)|%s"), - wildCard.c_str() + nDot, - wildCard.c_str(), - wildCard.c_str() - ); - } - } - - return true; -} - -#if WXWIN_COMPATIBILITY_2_4 -// Parses the filterStr, returning the number of filters. -// Returns 0 if none or if there's a problem. -// filterStr is in the form: "All files (*.*)|*.*|JPEG Files (*.jpeg)|*.jpg" -int wxFileDialogBase::ParseWildcard(const wxString& filterStr, - wxArrayString& descriptions, - wxArrayString& filters) -{ - return ::wxParseCommonDialogsFilter(filterStr, descriptions, filters); -} -#endif // WXWIN_COMPATIBILITY_2_4 - -#if WXWIN_COMPATIBILITY_2_6 -long wxFileDialogBase::GetStyle() const -{ - return GetWindowStyle(); -} - -void wxFileDialogBase::SetStyle(long style) -{ - SetWindowStyle(style); -} -#endif // WXWIN_COMPATIBILITY_2_6 - - -wxString wxFileDialogBase::AppendExtension(const wxString &filePath, - const wxString &extensionList) -{ - // strip off path, to avoid problems with "path.bar/foo" - wxString fileName = filePath.AfterLast(wxFILE_SEP_PATH); - - // if fileName is of form "foo.bar" it's ok, return it - int idx_dot = fileName.Find(wxT('.'), true); - if ((idx_dot != wxNOT_FOUND) && (idx_dot < (int)fileName.length() - 1)) - return filePath; - - // get the first extension from extensionList, or all of it - wxString ext = extensionList.BeforeFirst(wxT(';')); - - // if ext == "foo" or "foo." there's no extension - int idx_ext_dot = ext.Find(wxT('.'), true); - if ((idx_ext_dot == wxNOT_FOUND) || (idx_ext_dot == (int)ext.length() - 1)) - return filePath; - else - ext = ext.AfterLast(wxT('.')); - - // if ext == "*" or "bar*" or "b?r" or " " then its not valid - if ((ext.Find(wxT('*')) != wxNOT_FOUND) || - (ext.Find(wxT('?')) != wxNOT_FOUND) || - (ext.Strip(wxString::both).empty())) - return filePath; - - // if fileName doesn't have a '.' then add one - if (filePath.Last() != wxT('.')) - ext = wxT(".") + ext; - - return filePath + ext; -} - -//---------------------------------------------------------------------------- -// wxFileDialog convenience functions -//---------------------------------------------------------------------------- - -wxString wxFileSelector(const wxChar *title, - const wxChar *defaultDir, - const wxChar *defaultFileName, - const wxChar *defaultExtension, - const wxChar *filter, - int flags, - wxWindow *parent, - int x, int y) -{ - // The defaultExtension, if non-NULL, is - // appended to the filename if the user fails to type an extension. The new - // implementation (taken from wxFileSelectorEx) appends the extension - // automatically, by looking at the filter specification. In fact this - // should be better than the native Microsoft implementation because - // Windows only allows *one* default extension, whereas here we do the - // right thing depending on the filter the user has chosen. - - // If there's a default extension specified but no filter, we create a - // suitable filter. - - wxString filter2; - if ( !wxIsEmpty(defaultExtension) && wxIsEmpty(filter) ) - filter2 = wxString(wxT("*.")) + defaultExtension; - else if ( !wxIsEmpty(filter) ) - filter2 = filter; - - wxString defaultDirString; - if (!wxIsEmpty(defaultDir)) - defaultDirString = defaultDir; - - wxString defaultFilenameString; - if (!wxIsEmpty(defaultFileName)) - defaultFilenameString = defaultFileName; - - wxFileDialog fileDialog(parent, title, defaultDirString, - defaultFilenameString, filter2, - flags, wxPoint(x, y)); - - // if filter is of form "All files (*)|*|..." set correct filter index - if((wxStrlen(defaultExtension) != 0) && (filter2.Find(wxT('|')) != wxNOT_FOUND)) - { - int filterIndex = 0; - - wxArrayString descriptions, filters; - // don't care about errors, handled already by wxFileDialog - (void)wxParseCommonDialogsFilter(filter2, descriptions, filters); - for (size_t n=0; n 0) - fileDialog.SetFilterIndex(filterIndex); - } - - wxString filename; - if ( fileDialog.ShowModal() == wxID_OK ) - { - filename = fileDialog.GetPath(); - } - - return filename; -} - -//---------------------------------------------------------------------------- -// wxFileSelectorEx -//---------------------------------------------------------------------------- - -wxString wxFileSelectorEx(const wxChar *title, - const wxChar *defaultDir, - const wxChar *defaultFileName, - int* defaultFilterIndex, - const wxChar *filter, - int flags, - wxWindow* parent, - int x, - int y) - -{ - wxFileDialog fileDialog(parent, - !wxIsEmpty(title) ? title : wxEmptyString, - !wxIsEmpty(defaultDir) ? defaultDir : wxEmptyString, - !wxIsEmpty(defaultFileName) ? defaultFileName : wxEmptyString, - !wxIsEmpty(filter) ? filter : wxEmptyString, - flags, wxPoint(x, y)); - - wxString filename; - if ( fileDialog.ShowModal() == wxID_OK ) - { - if ( defaultFilterIndex ) - *defaultFilterIndex = fileDialog.GetFilterIndex(); - - filename = fileDialog.GetPath(); - } - - return filename; -} - -//---------------------------------------------------------------------------- -// wxDefaultFileSelector - Generic load/save dialog (for internal use only) -//---------------------------------------------------------------------------- - -static wxString wxDefaultFileSelector(bool load, - const wxChar *what, - const wxChar *extension, - const wxChar *default_name, - wxWindow *parent) -{ - wxString prompt; - wxString str; - if (load) - str = _("Load %s file"); - else - str = _("Save %s file"); - prompt.Printf(str, what); - - wxString wild; - const wxChar *ext = extension; - if ( !wxIsEmpty(ext) ) - { - if ( *ext == wxT('.') ) - ext++; - - wild.Printf(wxT("*.%s"), ext); - } - else // no extension specified - { - wild = wxFileSelectorDefaultWildcardStr; - } - - return wxFileSelector(prompt, NULL, default_name, ext, wild, - load ? (wxFD_OPEN | wxFD_FILE_MUST_EXIST) : wxFD_SAVE, parent); -} - -//---------------------------------------------------------------------------- -// wxLoadFileSelector -//---------------------------------------------------------------------------- - -WXDLLEXPORT wxString wxLoadFileSelector(const wxChar *what, - const wxChar *extension, - const wxChar *default_name, - wxWindow *parent) -{ - return wxDefaultFileSelector(true, what, extension, default_name, parent); -} - -//---------------------------------------------------------------------------- -// wxSaveFileSelector -//---------------------------------------------------------------------------- - -WXDLLEXPORT wxString wxSaveFileSelector(const wxChar *what, - const wxChar *extension, - const wxChar *default_name, - wxWindow *parent) -{ - return wxDefaultFileSelector(false, what, extension, default_name, parent); -} - - -//---------------------------------------------------------------------------- -// wxDirDialogBase -//---------------------------------------------------------------------------- - -#if WXWIN_COMPATIBILITY_2_6 -long wxDirDialogBase::GetStyle() const -{ - return GetWindowStyle(); -} - -void wxDirDialogBase::SetStyle(long style) -{ - SetWindowStyle(style); -} -#endif // WXWIN_COMPATIBILITY_2_6 - - -#endif // wxUSE_FILEDLG diff --git a/wxWidgets/src/common/fmapbase.cpp b/wxWidgets/src/common/fmapbase.cpp deleted file mode 100644 index d273922c1b..0000000000 --- a/wxWidgets/src/common/fmapbase.cpp +++ /dev/null @@ -1,737 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: src/common/fmapbase.cpp -// Purpose: wxFontMapperBase class implementation -// Author: Vadim Zeitlin -// Modified by: -// Created: 21.06.2003 (extracted from common/fontmap.cpp) -// RCS-ID: $Id: fmapbase.cpp 43063 2006-11-04 20:48:04Z VZ $ -// Copyright: (c) 1999-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 - -#if wxUSE_FONTMAP - -#ifndef WX_PRECOMP - #include "wx/app.h" - #include "wx/log.h" - #include "wx/intl.h" - #include "wx/module.h" -#endif //WX_PRECOMP - -#if defined(__WXMSW__) - #include "wx/msw/private.h" // includes windows.h for LOGFONT - #include "wx/msw/winundef.h" -#endif - -#include "wx/fontmap.h" -#include "wx/fmappriv.h" - -#include "wx/apptrait.h" - -// wxMemoryConfig uses wxFileConfig -#if wxUSE_CONFIG && wxUSE_FILECONFIG - #include "wx/config.h" - #include "wx/memconf.h" -#endif - -// ---------------------------------------------------------------------------- -// constants -// ---------------------------------------------------------------------------- - -// encodings supported by GetEncodingDescription -static wxFontEncoding gs_encodings[] = -{ - wxFONTENCODING_ISO8859_1, - wxFONTENCODING_ISO8859_2, - wxFONTENCODING_ISO8859_3, - wxFONTENCODING_ISO8859_4, - wxFONTENCODING_ISO8859_5, - wxFONTENCODING_ISO8859_6, - wxFONTENCODING_ISO8859_7, - wxFONTENCODING_ISO8859_8, - wxFONTENCODING_ISO8859_9, - wxFONTENCODING_ISO8859_10, - wxFONTENCODING_ISO8859_11, - wxFONTENCODING_ISO8859_12, - wxFONTENCODING_ISO8859_13, - wxFONTENCODING_ISO8859_14, - wxFONTENCODING_ISO8859_15, - wxFONTENCODING_KOI8, - wxFONTENCODING_KOI8_U, - wxFONTENCODING_CP874, - wxFONTENCODING_CP932, - wxFONTENCODING_CP936, - wxFONTENCODING_CP949, - wxFONTENCODING_CP950, - wxFONTENCODING_CP1250, - wxFONTENCODING_CP1251, - wxFONTENCODING_CP1252, - wxFONTENCODING_CP1253, - wxFONTENCODING_CP1254, - wxFONTENCODING_CP1255, - wxFONTENCODING_CP1256, - wxFONTENCODING_CP1257, - wxFONTENCODING_CP437, - wxFONTENCODING_UTF7, - wxFONTENCODING_UTF8, - wxFONTENCODING_UTF16BE, - wxFONTENCODING_UTF16LE, - wxFONTENCODING_UTF32BE, - wxFONTENCODING_UTF32LE, - wxFONTENCODING_EUC_JP, - wxFONTENCODING_DEFAULT, - wxFONTENCODING_BIG5, - wxFONTENCODING_SHIFT_JIS, - wxFONTENCODING_GB2312, -}; - -// the descriptions for them -static const wxChar* gs_encodingDescs[] = -{ - wxTRANSLATE( "Western European (ISO-8859-1)" ), - wxTRANSLATE( "Central European (ISO-8859-2)" ), - wxTRANSLATE( "Esperanto (ISO-8859-3)" ), - wxTRANSLATE( "Baltic (old) (ISO-8859-4)" ), - wxTRANSLATE( "Cyrillic (ISO-8859-5)" ), - wxTRANSLATE( "Arabic (ISO-8859-6)" ), - wxTRANSLATE( "Greek (ISO-8859-7)" ), - wxTRANSLATE( "Hebrew (ISO-8859-8)" ), - wxTRANSLATE( "Turkish (ISO-8859-9)" ), - wxTRANSLATE( "Nordic (ISO-8859-10)" ), - wxTRANSLATE( "Thai (ISO-8859-11)" ), - wxTRANSLATE( "Indian (ISO-8859-12)" ), - wxTRANSLATE( "Baltic (ISO-8859-13)" ), - wxTRANSLATE( "Celtic (ISO-8859-14)" ), - wxTRANSLATE( "Western European with Euro (ISO-8859-15)" ), - wxTRANSLATE( "KOI8-R" ), - wxTRANSLATE( "KOI8-U" ), - wxTRANSLATE( "Windows Thai (CP 874)" ), - wxTRANSLATE( "Windows Japanese (CP 932)" ), - wxTRANSLATE( "Windows Chinese Simplified (CP 936)" ), - wxTRANSLATE( "Windows Korean (CP 949)" ), - wxTRANSLATE( "Windows Chinese Traditional (CP 950)" ), - wxTRANSLATE( "Windows Central European (CP 1250)" ), - wxTRANSLATE( "Windows Cyrillic (CP 1251)" ), - wxTRANSLATE( "Windows Western European (CP 1252)" ), - wxTRANSLATE( "Windows Greek (CP 1253)" ), - wxTRANSLATE( "Windows Turkish (CP 1254)" ), - wxTRANSLATE( "Windows Hebrew (CP 1255)" ), - wxTRANSLATE( "Windows Arabic (CP 1256)" ), - wxTRANSLATE( "Windows Baltic (CP 1257)" ), - wxTRANSLATE( "Windows/DOS OEM (CP 437)" ), - wxTRANSLATE( "Unicode 7 bit (UTF-7)" ), - wxTRANSLATE( "Unicode 8 bit (UTF-8)" ), -#ifdef WORDS_BIGENDIAN - wxTRANSLATE( "Unicode 16 bit (UTF-16)" ), - wxTRANSLATE( "Unicode 16 bit Little Endian (UTF-16LE)" ), - wxTRANSLATE( "Unicode 32 bit (UTF-32)" ), - wxTRANSLATE( "Unicode 32 bit Little Endian (UTF-32LE)" ), -#else // WORDS_BIGENDIAN - wxTRANSLATE( "Unicode 16 bit Big Endian (UTF-16BE)" ), - wxTRANSLATE( "Unicode 16 bit (UTF-16)" ), - wxTRANSLATE( "Unicode 32 bit Big Endian (UTF-32BE)" ), - wxTRANSLATE( "Unicode 32 bit (UTF-32)" ), -#endif // WORDS_BIGENDIAN - wxTRANSLATE( "Extended Unix Codepage for Japanese (EUC-JP)" ), - wxTRANSLATE( "US-ASCII" ), - wxTRANSLATE( "BIG5" ), - wxTRANSLATE( "SHIFT-JIS" ), - wxTRANSLATE( "GB-2312" ), -}; - -// and the internal names (these are not translated on purpose!) -static const wxChar* gs_encodingNames[WXSIZEOF(gs_encodingDescs)][9] = -{ - // names from the columns correspond to these OS: - // Linux Solaris and IRIX HP-UX AIX - { _T("ISO-8859-1"), _T("ISO8859-1"), _T("iso88591"), _T("8859-1"), wxT("iso_8859_1"), NULL }, - { _T("ISO-8859-2"), _T("ISO8859-2"), _T("iso88592"), _T("8859-2"), NULL }, - { _T("ISO-8859-3"), _T("ISO8859-3"), _T("iso88593"), _T("8859-3"), NULL }, - { _T("ISO-8859-4"), _T("ISO8859-4"), _T("iso88594"), _T("8859-4"), NULL }, - { _T("ISO-8859-5"), _T("ISO8859-5"), _T("iso88595"), _T("8859-5"), NULL }, - { _T("ISO-8859-6"), _T("ISO8859-6"), _T("iso88596"), _T("8859-6"), NULL }, - { _T("ISO-8859-7"), _T("ISO8859-7"), _T("iso88597"), _T("8859-7"), NULL }, - { _T("ISO-8859-8"), _T("ISO8859-8"), _T("iso88598"), _T("8859-8"), NULL }, - { _T("ISO-8859-9"), _T("ISO8859-9"), _T("iso88599"), _T("8859-9"), NULL }, - { _T("ISO-8859-10"), _T("ISO8859-10"), _T("iso885910"), _T("8859-10"), NULL }, - { _T("ISO-8859-11"), _T("ISO8859-11"), _T("iso885911"), _T("8859-11"), NULL }, - { _T("ISO-8859-12"), _T("ISO8859-12"), _T("iso885912"), _T("8859-12"), NULL }, - { _T("ISO-8859-13"), _T("ISO8859-13"), _T("iso885913"), _T("8859-13"), NULL }, - { _T("ISO-8859-14"), _T("ISO8859-14"), _T("iso885914"), _T("8859-14"), NULL }, - { _T("ISO-8859-15"), _T("ISO8859-15"), _T("iso885915"), _T("8859-15"), NULL }, - - // although koi8-ru is not strictly speaking the same as koi8-r, - // they are similar enough to make mapping it to koi8 better than - // not recognizing it at all - { wxT( "KOI8-R" ), wxT( "KOI8-RU" ), NULL }, - { wxT( "KOI8-U" ), NULL }, - - { wxT( "WINDOWS-874" ), wxT( "CP-874" ), NULL }, - { wxT( "WINDOWS-932" ), wxT( "CP-932" ), NULL }, - { wxT( "WINDOWS-936" ), wxT( "CP-936" ), NULL }, - { wxT( "WINDOWS-949" ), wxT( "CP-949" ), wxT( "EUC-KR" ), wxT( "eucKR" ), wxT( "euc_kr" ), NULL }, - { wxT( "WINDOWS-950" ), wxT( "CP-950" ), NULL }, - { wxT( "WINDOWS-1250" ),wxT( "CP-1250" ), NULL }, - { wxT( "WINDOWS-1251" ),wxT( "CP-1251" ), NULL }, - { wxT( "WINDOWS-1252" ),wxT( "CP-1252" ), wxT("IBM-1252"), NULL }, - { wxT( "WINDOWS-1253" ),wxT( "CP-1253" ), NULL }, - { wxT( "WINDOWS-1254" ),wxT( "CP-1254" ), NULL }, - { wxT( "WINDOWS-1255" ),wxT( "CP-1255" ), NULL }, - { wxT( "WINDOWS-1256" ),wxT( "CP-1256" ), NULL }, - { wxT( "WINDOWS-1257" ),wxT( "CP-1257" ), NULL }, - { wxT( "WINDOWS-437" ), wxT( "CP-437" ), NULL }, - - { wxT( "UTF-7" ), wxT("utf7"), NULL }, - { wxT( "UTF-8" ), wxT("utf8"), NULL }, -#ifdef WORDS_BIGENDIAN - { wxT( "UTF-16BE" ), wxT("UCS-2BE"), wxT( "UTF-16" ), wxT("UCS-2"), wxT("UCS2"), NULL }, - { wxT( "UTF-16LE" ), wxT("UCS-2LE"), NULL }, - { wxT( "UTF-32BE" ), wxT( "UCS-4BE" ), wxT( "UTF-32" ), wxT( "UCS-4" ), wxT("UCS4"), NULL }, - { wxT( "UTF-32LE" ), wxT( "UCS-4LE" ), NULL }, -#else // WORDS_BIGENDIAN - { wxT( "UTF-16BE" ), wxT("UCS-2BE"), NULL }, - { wxT( "UTF-16LE" ), wxT("UCS-2LE"), wxT( "UTF-16" ), wxT("UCS-2"), wxT("UCS2"), NULL }, - { wxT( "UTF-32BE" ), wxT( "UCS-4BE" ), NULL }, - { wxT( "UTF-32LE" ), wxT( "UCS-4LE" ), wxT( "UTF-32" ), wxT( "UCS-4" ), wxT("UCS4"), NULL }, -#endif // WORDS_BIGENDIAN - - { wxT( "EUC-JP" ), wxT( "eucJP" ), wxT( "euc_jp" ), wxT( "IBM-eucJP" ), NULL }, - - // 646 is for Solaris, roman8 -- for HP-UX - { wxT( "US-ASCII" ), wxT( "ASCII" ), wxT("C"), wxT("POSIX"), wxT("ANSI_X3.4-1968"), - wxT("646"), wxT("roman8"), wxT( "" ), NULL }, - - { wxT( "BIG5" ), wxT("big5"), NULL }, - { wxT( "SJIS" ), wxT( "SHIFT-JIS" ), wxT( "SHIFT_JIS" ), NULL }, - { wxT( "GB2312" ), NULL }, -}; - -wxCOMPILE_TIME_ASSERT( WXSIZEOF(gs_encodingDescs) == WXSIZEOF(gs_encodings), EncodingsArraysNotInSync ); -wxCOMPILE_TIME_ASSERT( WXSIZEOF(gs_encodingNames) == WXSIZEOF(gs_encodings), EncodingsArraysNotInSync ); - -// ---------------------------------------------------------------------------- -// private classes -// ---------------------------------------------------------------------------- - -// clean up the font mapper object -class wxFontMapperModule : public wxModule -{ -public: - wxFontMapperModule() : wxModule() { } - - virtual bool OnInit() - { - // a dummy wxFontMapperBase object could have been created during the - // program startup before wxApp was created, we have to delete it to - // allow creating the real font mapper next time it is needed now that - // we can create it (when the modules are initialized, wxApp object - // already exists) - wxFontMapperBase *fm = wxFontMapperBase::Get(); - if ( fm && fm->IsDummy() ) - wxFontMapperBase::Reset(); - - return true; - } - - virtual void OnExit() - { - wxFontMapperBase::Reset(); - } - - DECLARE_DYNAMIC_CLASS(wxFontMapperModule) -}; - -IMPLEMENT_DYNAMIC_CLASS(wxFontMapperModule, wxModule) - - -// ============================================================================ -// wxFontMapperBase implementation -// ============================================================================ - -wxFontMapper *wxFontMapperBase::sm_instance = NULL; - -// ---------------------------------------------------------------------------- -// ctor and dtor -// ---------------------------------------------------------------------------- - -wxFontMapperBase::wxFontMapperBase() -{ -#if wxUSE_CONFIG && wxUSE_FILECONFIG - m_configDummy = NULL; -#endif // wxUSE_CONFIG -} - -wxFontMapperBase::~wxFontMapperBase() -{ -#if wxUSE_CONFIG && wxUSE_FILECONFIG - if ( m_configDummy ) - delete m_configDummy; -#endif // wxUSE_CONFIG -} - -/* static */ -wxFontMapperBase *wxFontMapperBase::Get() -{ - if ( !sm_instance ) - { - wxAppTraits *traits = wxTheApp ? wxTheApp->GetTraits() : NULL; - if ( traits ) - { - sm_instance = traits->CreateFontMapper(); - - wxASSERT_MSG( sm_instance, - _T("wxAppTraits::CreateFontMapper() failed") ); - } - - if ( !sm_instance ) - { - // last resort: we must create something because the existing code - // relies on always having a valid font mapper object - sm_instance = (wxFontMapper *)new wxFontMapperBase; - } - } - - return (wxFontMapperBase*)sm_instance; -} - -/* static */ -wxFontMapper *wxFontMapperBase::Set(wxFontMapper *mapper) -{ - wxFontMapper *old = sm_instance; - sm_instance = mapper; - return old; -} - -/* static */ -void wxFontMapperBase::Reset() -{ - if ( sm_instance ) - { - // we need a cast as wxFontMapper is not fully declared here and so the - // compiler can't know that it derives from wxFontMapperBase (but - // run-time behaviour will be correct because the dtor is virtual) - delete (wxFontMapperBase *)sm_instance; - sm_instance = NULL; - } -} - -#if wxUSE_CONFIG && wxUSE_FILECONFIG - -// ---------------------------------------------------------------------------- -// config usage customisation -// ---------------------------------------------------------------------------- - -/* static */ -const wxChar *wxFontMapperBase::GetDefaultConfigPath() -{ - return FONTMAPPER_ROOT_PATH; -} - -void wxFontMapperBase::SetConfigPath(const wxString& prefix) -{ - wxCHECK_RET( !prefix.empty() && prefix[0] == wxCONFIG_PATH_SEPARATOR, - wxT("an absolute path should be given to wxFontMapper::SetConfigPath()") ); - - m_configRootPath = prefix; -} - -// ---------------------------------------------------------------------------- -// get config object and path for it -// ---------------------------------------------------------------------------- - -wxConfigBase *wxFontMapperBase::GetConfig() -{ - wxConfigBase *config = wxConfig::Get(false); - - // If there is no global configuration, use an internal memory configuration - if ( !config ) - { - if ( !m_configDummy ) - m_configDummy = new wxMemoryConfig; - config = m_configDummy; - - // FIXME: ideally, we should add keys from dummy config to a real one later, - // but it is a low-priority task because typical wxWin application - // either doesn't use wxConfig at all or creates wxConfig object in - // wxApp::OnInit(), before any real interaction with the user takes - // place... - } - - return config; -} - -const wxString& wxFontMapperBase::GetConfigPath() -{ - if ( !m_configRootPath ) - { - // use the default - m_configRootPath = GetDefaultConfigPath(); - } - - return m_configRootPath; -} - -// ---------------------------------------------------------------------------- -// config helpers -// ---------------------------------------------------------------------------- - -bool wxFontMapperBase::ChangePath(const wxString& pathNew, wxString *pathOld) -{ - wxConfigBase *config = GetConfig(); - if ( !config ) - return false; - - *pathOld = config->GetPath(); - - wxString path = GetConfigPath(); - if ( path.empty() || path.Last() != wxCONFIG_PATH_SEPARATOR ) - { - path += wxCONFIG_PATH_SEPARATOR; - } - - wxASSERT_MSG( !pathNew || (pathNew[0] != wxCONFIG_PATH_SEPARATOR), - wxT("should be a relative path") ); - - path += pathNew; - - config->SetPath(path); - - return true; -} - -void wxFontMapperBase::RestorePath(const wxString& pathOld) -{ - GetConfig()->SetPath(pathOld); -} - -#endif - -// ---------------------------------------------------------------------------- -// charset/encoding correspondence -// ---------------------------------------------------------------------------- - -wxFontEncoding -wxFontMapperBase::CharsetToEncoding(const wxString& charset, - bool WXUNUSED(interactive)) -{ - int enc = NonInteractiveCharsetToEncoding(charset); - if ( enc == wxFONTENCODING_UNKNOWN ) - { - // we should return wxFONTENCODING_SYSTEM from here for unknown - // encodings - enc = wxFONTENCODING_SYSTEM; - } - - return (wxFontEncoding)enc; -} - -int -wxFontMapperBase::NonInteractiveCharsetToEncoding(const wxString& charset) -{ - wxFontEncoding encoding = wxFONTENCODING_SYSTEM; - - // we're going to modify it, make a copy - wxString cs = charset; - -#if wxUSE_CONFIG && wxUSE_FILECONFIG - // first try the user-defined settings - wxFontMapperPathChanger path(this, FONTMAPPER_CHARSET_PATH); - if ( path.IsOk() ) - { - wxConfigBase *config = GetConfig(); - - // do we have an encoding for this charset? - long value = config->Read(charset, -1l); - if ( value != -1 ) - { - if ( value == wxFONTENCODING_UNKNOWN ) - { - // don't try to find it, in particular don't ask the user - return value; - } - - if ( value >= 0 && value <= wxFONTENCODING_MAX ) - { - encoding = (wxFontEncoding)value; - } - else - { - wxLogDebug(wxT("corrupted config data: invalid encoding %ld for charset '%s' ignored"), - value, charset.c_str()); - } - } - - if ( encoding == wxFONTENCODING_SYSTEM ) - { - // may be we have an alias? - config->SetPath(FONTMAPPER_CHARSET_ALIAS_PATH); - - wxString alias = config->Read(charset); - if ( !alias.empty() ) - { - // yes, we do - use it instead - cs = alias; - } - } - } -#endif // wxUSE_CONFIG - - // if didn't find it there, try to recognize it ourselves - if ( encoding == wxFONTENCODING_SYSTEM ) - { - // trim any spaces - cs.Trim(true); - cs.Trim(false); - - // discard the optional quotes - if ( !cs.empty() ) - { - if ( cs[0u] == _T('"') && cs.Last() == _T('"') ) - { - cs = wxString(cs.c_str(), cs.length() - 1); - } - } - - for ( size_t i = 0; i < WXSIZEOF(gs_encodingNames); ++i ) - { - for ( const wxChar** encName = gs_encodingNames[i]; *encName; ++encName ) - { - if ( cs.CmpNoCase(*encName) == 0 ) - return gs_encodings[i]; - } - } - - cs.MakeUpper(); - - if ( cs.Left(3) == wxT("ISO") ) - { - // the dash is optional (or, to be exact, it is not, but - // several brokenmails "forget" it) - const wxChar *p = cs.c_str() + 3; - if ( *p == wxT('-') ) - p++; - - // printf( "iso %s\n", (const char*) cs.ToAscii() ); - - unsigned int value; - if ( wxSscanf(p, wxT("8859-%u"), &value) == 1 ) - { - // printf( "value %d\n", (int)value ); - - // make it 0 based and check that it is strictly positive in - // the process (no such thing as iso8859-0 encoding) - if ( (value-- > 0) && - (value < wxFONTENCODING_ISO8859_MAX - - wxFONTENCODING_ISO8859_1) ) - { - // it's a valid ISO8859 encoding - value += wxFONTENCODING_ISO8859_1; - encoding = (wxFontEncoding)value; - } - } - } - else if ( cs.Left(4) == wxT("8859") ) - { - const wxChar *p = cs.c_str(); - - unsigned int value; - if ( wxSscanf(p, wxT("8859-%u"), &value) == 1 ) - { - // printf( "value %d\n", (int)value ); - - // make it 0 based and check that it is strictly positive in - // the process (no such thing as iso8859-0 encoding) - if ( (value-- > 0) && - (value < wxFONTENCODING_ISO8859_MAX - - wxFONTENCODING_ISO8859_1) ) - { - // it's a valid ISO8859 encoding - value += wxFONTENCODING_ISO8859_1; - encoding = (wxFontEncoding)value; - } - } - } - else // check for Windows charsets - { - size_t len; - if ( cs.Left(7) == wxT("WINDOWS") ) - { - len = 7; - } - else if ( cs.Left(2) == wxT("CP") ) - { - len = 2; - } - else // not a Windows encoding - { - len = 0; - } - - if ( len ) - { - const wxChar *p = cs.c_str() + len; - if ( *p == wxT('-') ) - p++; - - unsigned int value; - if ( wxSscanf(p, wxT("%u"), &value) == 1 ) - { - if ( value >= 1250 ) - { - value -= 1250; - if ( value < wxFONTENCODING_CP12_MAX - - wxFONTENCODING_CP1250 ) - { - // a valid Windows code page - value += wxFONTENCODING_CP1250; - encoding = (wxFontEncoding)value; - } - } - - switch ( value ) - { - case 866: - encoding = wxFONTENCODING_CP866; - break; - - case 874: - encoding = wxFONTENCODING_CP874; - break; - - case 932: - encoding = wxFONTENCODING_CP932; - break; - - case 936: - encoding = wxFONTENCODING_CP936; - break; - - case 949: - encoding = wxFONTENCODING_CP949; - break; - - case 950: - encoding = wxFONTENCODING_CP950; - break; - } - } - } - } - //else: unknown - } - - return encoding; -} - -/* static */ -size_t wxFontMapperBase::GetSupportedEncodingsCount() -{ - return WXSIZEOF(gs_encodings); -} - -/* static */ -wxFontEncoding wxFontMapperBase::GetEncoding(size_t n) -{ - wxCHECK_MSG( n < WXSIZEOF(gs_encodings), wxFONTENCODING_SYSTEM, - _T("wxFontMapper::GetEncoding(): invalid index") ); - - return gs_encodings[n]; -} - -/* static */ -wxString wxFontMapperBase::GetEncodingDescription(wxFontEncoding encoding) -{ - if ( encoding == wxFONTENCODING_DEFAULT ) - { - return _("Default encoding"); - } - - const size_t count = WXSIZEOF(gs_encodingDescs); - - for ( size_t i = 0; i < count; i++ ) - { - if ( gs_encodings[i] == encoding ) - { - return wxGetTranslation(gs_encodingDescs[i]); - } - } - - wxString str; - str.Printf(_("Unknown encoding (%d)"), encoding); - - return str; -} - -/* static */ -wxString wxFontMapperBase::GetEncodingName(wxFontEncoding encoding) -{ - if ( encoding == wxFONTENCODING_DEFAULT ) - { - return _("default"); - } - - const size_t count = WXSIZEOF(gs_encodingNames); - - for ( size_t i = 0; i < count; i++ ) - { - if ( gs_encodings[i] == encoding ) - { - return gs_encodingNames[i][0]; - } - } - - wxString str; - str.Printf(_("unknown-%d"), encoding); - - return str; -} - -/* static */ -const wxChar** wxFontMapperBase::GetAllEncodingNames(wxFontEncoding encoding) -{ - static const wxChar* dummy[] = { NULL }; - - for ( size_t i = 0; i < WXSIZEOF(gs_encodingNames); i++ ) - { - if ( gs_encodings[i] == encoding ) - { - return gs_encodingNames[i]; - } - } - - return dummy; -} - -/* static */ -wxFontEncoding wxFontMapperBase::GetEncodingFromName(const wxString& name) -{ - const size_t count = WXSIZEOF(gs_encodingNames); - - for ( size_t i = 0; i < count; i++ ) - { - for ( const wxChar** encName = gs_encodingNames[i]; *encName; ++encName ) - { - if ( name.CmpNoCase(*encName) == 0 ) - return gs_encodings[i]; - } - } - - return wxFONTENCODING_MAX; -} - -#endif // wxUSE_FONTMAP diff --git a/wxWidgets/src/common/fontcmn.cpp b/wxWidgets/src/common/fontcmn.cpp deleted file mode 100644 index f88b54dcb9..0000000000 --- a/wxWidgets/src/common/fontcmn.cpp +++ /dev/null @@ -1,784 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/common/fontcmn.cpp -// Purpose: implementation of wxFontBase methods -// Author: Vadim Zeitlin -// Modified by: -// Created: 20.09.99 -// RCS-ID: $Id: fontcmn.cpp 43661 2006-11-26 20:18:53Z VZ $ -// Copyright: (c) wxWidgets team -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#include "wx/font.h" - -#ifndef WX_PRECOMP - #include "wx/dc.h" - #include "wx/intl.h" - #include "wx/dcscreen.h" - #include "wx/log.h" - #include "wx/gdicmn.h" -#endif // WX_PRECOMP - -#if defined(__WXMSW__) - #include "wx/msw/private.h" // includes windows.h for LOGFONT - #include "wx/msw/winundef.h" -#endif - -#include "wx/fontutil.h" // for wxNativeFontInfo -#include "wx/fontmap.h" -#include "wx/fontenum.h" - -#include "wx/tokenzr.h" - -// ============================================================================ -// implementation -// ============================================================================ - -// ---------------------------------------------------------------------------- -// helper functions -// ---------------------------------------------------------------------------- - -static void AdjustFontSize(wxFont& font, wxDC& dc, const wxSize& pixelSize) -{ - int currentSize = 0; - int largestGood = 0; - int smallestBad = 0; - - bool initialGoodFound = false; - bool initialBadFound = false; - - // NB: this assignment was separated from the variable definition - // in order to fix a gcc v3.3.3 compiler crash - currentSize = font.GetPointSize(); - while (currentSize > 0) - { - dc.SetFont(font); - - // if currentSize (in points) results in a font that is smaller - // than required by pixelSize it is considered a good size - if (dc.GetCharHeight() <= pixelSize.GetHeight() && - (!pixelSize.GetWidth() || - dc.GetCharWidth() <= pixelSize.GetWidth())) - { - largestGood = currentSize; - initialGoodFound = true; - } - else - { - smallestBad = currentSize; - initialBadFound = true; - } - if (!initialGoodFound) - { - currentSize /= 2; - } - else if (!initialBadFound) - { - currentSize *= 2; - } - else - { - int distance = smallestBad - largestGood; - if (distance == 1) - break; - - currentSize = largestGood + distance / 2; - } - - font.SetPointSize(currentSize); - } - - if (currentSize != largestGood) - font.SetPointSize(largestGood); -} - -// ---------------------------------------------------------------------------- -// wxFontBase -// ---------------------------------------------------------------------------- - -wxFontEncoding wxFontBase::ms_encodingDefault = wxFONTENCODING_SYSTEM; - -/* static */ -void wxFontBase::SetDefaultEncoding(wxFontEncoding encoding) -{ - // GetDefaultEncoding() should return something != wxFONTENCODING_DEFAULT - // and, besides, using this value here doesn't make any sense - wxCHECK_RET( encoding != wxFONTENCODING_DEFAULT, - _T("can't set default encoding to wxFONTENCODING_DEFAULT") ); - - ms_encodingDefault = encoding; -} - -wxFontBase::~wxFontBase() -{ - // this destructor is required for Darwin -} - -/* static */ -wxFont *wxFontBase::New(int size, - int family, - int style, - int weight, - bool underlined, - const wxString& face, - wxFontEncoding encoding) -{ - return new wxFont(size, family, style, weight, underlined, face, encoding); -} - -static inline int flags2Style(int flags) -{ - return flags & wxFONTFLAG_ITALIC - ? wxFONTSTYLE_ITALIC - : flags & wxFONTFLAG_SLANT - ? wxFONTSTYLE_SLANT - : wxFONTSTYLE_NORMAL; -} - -static inline int flags2Weight(int flags) -{ - return flags & wxFONTFLAG_LIGHT - ? wxFONTWEIGHT_LIGHT - : flags & wxFONTFLAG_BOLD - ? wxFONTWEIGHT_BOLD - : wxFONTWEIGHT_NORMAL; -} - -static inline bool flags2Underlined(int flags) -{ - return (flags & wxFONTFLAG_UNDERLINED) != 0; -} - -/* static */ -wxFont *wxFontBase::New(int pointSize, - wxFontFamily family, - int flags, - const wxString& face, - wxFontEncoding encoding) -{ - return New(pointSize, family, flags2Style(flags), flags2Weight(flags), - flags2Underlined(flags), face, encoding); -} - -/* static */ -wxFont *wxFontBase::New(const wxSize& pixelSize, - int family, - int style, - int weight, - bool underlined, - const wxString& face, - wxFontEncoding encoding) -{ -#if defined(__WXMSW__) - return new wxFont(pixelSize, family, style, weight, underlined, - face, encoding); -#else - wxFont *self = New(10, family, style, weight, underlined, face, encoding); - wxScreenDC dc; - AdjustFontSize(*(wxFont *)self, dc, pixelSize); - return self; -#endif -} - -/* static */ -wxFont *wxFontBase::New(const wxSize& pixelSize, - wxFontFamily family, - int flags, - const wxString& face, - wxFontEncoding encoding) -{ - return New(pixelSize, family, flags2Style(flags), flags2Weight(flags), - flags2Underlined(flags), face, encoding); -} - -wxSize wxFontBase::GetPixelSize() const -{ - wxScreenDC dc; - dc.SetFont(*(wxFont *)this); - return wxSize(dc.GetCharWidth(), dc.GetCharHeight()); -} - -bool wxFontBase::IsUsingSizeInPixels() const -{ - return false; -} - -void wxFontBase::SetPixelSize( const wxSize& pixelSize ) -{ - wxScreenDC dc; - AdjustFontSize(*(wxFont *)this, dc, pixelSize); -} - -/* static */ -wxFont *wxFontBase::New(const wxNativeFontInfo& info) -{ - return new wxFont(info); -} - -/* static */ -wxFont *wxFontBase::New(const wxString& strNativeFontDesc) -{ - wxNativeFontInfo fontInfo; - if ( !fontInfo.FromString(strNativeFontDesc) ) - return new wxFont(*wxNORMAL_FONT); - - return New(fontInfo); -} - -bool wxFontBase::IsFixedWidth() const -{ - return GetFamily() == wxFONTFAMILY_TELETYPE; -} - -void wxFontBase::DoSetNativeFontInfo(const wxNativeFontInfo& info) -{ -#ifdef wxNO_NATIVE_FONTINFO - SetPointSize(info.pointSize); - SetFamily(info.family); - SetStyle(info.style); - SetWeight(info.weight); - SetUnderlined(info.underlined); - SetFaceName(info.faceName); - SetEncoding(info.encoding); -#else - (void)info; -#endif -} - -wxString wxFontBase::GetNativeFontInfoDesc() const -{ - wxString fontDesc; - const wxNativeFontInfo *fontInfo = GetNativeFontInfo(); - if ( fontInfo ) - { - fontDesc = fontInfo->ToString(); - wxASSERT_MSG(!fontDesc.empty(), wxT("This should be a non-empty string!")); - } - else - { - wxFAIL_MSG(wxT("Derived class should have created the wxNativeFontInfo!")); - } - - return fontDesc; -} - -wxString wxFontBase::GetNativeFontInfoUserDesc() const -{ - wxString fontDesc; - const wxNativeFontInfo *fontInfo = GetNativeFontInfo(); - if ( fontInfo ) - { - fontDesc = fontInfo->ToUserString(); - wxASSERT_MSG(!fontDesc.empty(), wxT("This should be a non-empty string!")); - } - else - { - wxFAIL_MSG(wxT("Derived class should have created the wxNativeFontInfo!")); - } - - return fontDesc; -} - -bool wxFontBase::SetNativeFontInfo(const wxString& info) -{ - wxNativeFontInfo fontInfo; - if ( !info.empty() && fontInfo.FromString(info) ) - { - SetNativeFontInfo(fontInfo); - return true; - } - - UnRef(); - return false; -} - -bool wxFontBase::SetNativeFontInfoUserDesc(const wxString& info) -{ - wxNativeFontInfo fontInfo; - if ( !info.empty() && fontInfo.FromUserString(info) ) - { - SetNativeFontInfo(fontInfo); - return true; - } - - UnRef(); - return false; -} - -bool wxFontBase::operator==(const wxFont& font) const -{ - // either it is the same font, i.e. they share the same common data or they - // have different ref datas but still describe the same font - return IsSameAs(font) || - ( - Ok() == font.Ok() && - GetPointSize() == font.GetPointSize() && - // in wxGTK1 GetPixelSize() calls GetInternalFont() which uses - // operator==() resulting in infinite recursion so we can't use it - // in that port -#if !defined(__WXGTK__) || defined(__WXGTK20__) - GetPixelSize() == font.GetPixelSize() && -#endif - GetFamily() == font.GetFamily() && - GetStyle() == font.GetStyle() && - GetWeight() == font.GetWeight() && - GetUnderlined() == font.GetUnderlined() && - GetFaceName().IsSameAs(font.GetFaceName(), false) && - GetEncoding() == font.GetEncoding() - ); -} - -bool wxFontBase::operator!=(const wxFont& font) const -{ - return !(*this == font); -} - -wxString wxFontBase::GetFamilyString() const -{ - wxCHECK_MSG( Ok(), wxT("wxDEFAULT"), wxT("invalid font") ); - - switch ( GetFamily() ) - { - case wxDECORATIVE: return wxT("wxDECORATIVE"); - case wxROMAN: return wxT("wxROMAN"); - case wxSCRIPT: return wxT("wxSCRIPT"); - case wxSWISS: return wxT("wxSWISS"); - case wxMODERN: return wxT("wxMODERN"); - case wxTELETYPE: return wxT("wxTELETYPE"); - default: return wxT("wxDEFAULT"); - } -} - -wxString wxFontBase::GetStyleString() const -{ - wxCHECK_MSG( Ok(), wxT("wxDEFAULT"), wxT("invalid font") ); - - switch ( GetStyle() ) - { - case wxNORMAL: return wxT("wxNORMAL"); - case wxSLANT: return wxT("wxSLANT"); - case wxITALIC: return wxT("wxITALIC"); - default: return wxT("wxDEFAULT"); - } -} - -wxString wxFontBase::GetWeightString() const -{ - wxCHECK_MSG( Ok(), wxT("wxDEFAULT"), wxT("invalid font") ); - - switch ( GetWeight() ) - { - case wxNORMAL: return wxT("wxNORMAL"); - case wxBOLD: return wxT("wxBOLD"); - case wxLIGHT: return wxT("wxLIGHT"); - default: return wxT("wxDEFAULT"); - } -} - -bool wxFontBase::SetFaceName(const wxString &facename) -{ - if (!wxFontEnumerator::IsValidFacename(facename)) - { - UnRef(); // make Ok() return false - return false; - } - - return true; -} - - -// ---------------------------------------------------------------------------- -// wxNativeFontInfo -// ---------------------------------------------------------------------------- - -// Up to now, there are no native implementations of this function: -void wxNativeFontInfo::SetFaceName(const wxArrayString &facenames) -{ - for (size_t i=0; i < facenames.GetCount(); i++) - { - if (wxFontEnumerator::IsValidFacename(facenames[i])) - { - SetFaceName(facenames[i]); - return; - } - } - - // set the first valid facename we can find on this system - wxString validfacename = wxFontEnumerator::GetFacenames().Item(0); - wxLogTrace(wxT("font"), wxT("Falling back to '%s'"), validfacename.c_str()); - SetFaceName(validfacename); -} - - -#ifdef wxNO_NATIVE_FONTINFO - -// These are the generic forms of FromString()/ToString. -// -// convert to/from the string representation: format is -// version;pointsize;family;style;weight;underlined;facename;encoding - -bool wxNativeFontInfo::FromString(const wxString& s) -{ - long l; - - wxStringTokenizer tokenizer(s, _T(";")); - - wxString token = tokenizer.GetNextToken(); - // - // Ignore the version for now - // - - token = tokenizer.GetNextToken(); - if ( !token.ToLong(&l) ) - return false; - pointSize = (int)l; - - token = tokenizer.GetNextToken(); - if ( !token.ToLong(&l) ) - return false; - family = (wxFontFamily)l; - - token = tokenizer.GetNextToken(); - if ( !token.ToLong(&l) ) - return false; - style = (wxFontStyle)l; - - token = tokenizer.GetNextToken(); - if ( !token.ToLong(&l) ) - return false; - weight = (wxFontWeight)l; - - token = tokenizer.GetNextToken(); - if ( !token.ToLong(&l) ) - return false; - underlined = l != 0; - - faceName = tokenizer.GetNextToken(); - -#ifndef __WXMAC__ - if( !faceName ) - return false; -#endif - - token = tokenizer.GetNextToken(); - if ( !token.ToLong(&l) ) - return false; - encoding = (wxFontEncoding)l; - - return true; -} - -wxString wxNativeFontInfo::ToString() const -{ - wxString s; - - s.Printf(_T("%d;%d;%d;%d;%d;%d;%s;%d"), - 0, // version - pointSize, - family, - (int)style, - (int)weight, - underlined, - faceName.GetData(), - (int)encoding); - - return s; -} - -void wxNativeFontInfo::Init() -{ - pointSize = 0; - family = wxFONTFAMILY_DEFAULT; - style = wxFONTSTYLE_NORMAL; - weight = wxFONTWEIGHT_NORMAL; - underlined = false; - faceName.clear(); - encoding = wxFONTENCODING_DEFAULT; -} - -int wxNativeFontInfo::GetPointSize() const -{ - return pointSize; -} - -wxFontStyle wxNativeFontInfo::GetStyle() const -{ - return style; -} - -wxFontWeight wxNativeFontInfo::GetWeight() const -{ - return weight; -} - -bool wxNativeFontInfo::GetUnderlined() const -{ - return underlined; -} - -wxString wxNativeFontInfo::GetFaceName() const -{ - return faceName; -} - -wxFontFamily wxNativeFontInfo::GetFamily() const -{ - return family; -} - -wxFontEncoding wxNativeFontInfo::GetEncoding() const -{ - return encoding; -} - -void wxNativeFontInfo::SetPointSize(int pointsize) -{ - pointSize = pointsize; -} - -void wxNativeFontInfo::SetStyle(wxFontStyle style_) -{ - style = style_; -} - -void wxNativeFontInfo::SetWeight(wxFontWeight weight_) -{ - weight = weight_; -} - -void wxNativeFontInfo::SetUnderlined(bool underlined_) -{ - underlined = underlined_; -} - -bool wxNativeFontInfo::SetFaceName(const wxString& facename_) -{ - faceName = facename_; - return true; -} - -void wxNativeFontInfo::SetFamily(wxFontFamily family_) -{ - family = family_; -} - -void wxNativeFontInfo::SetEncoding(wxFontEncoding encoding_) -{ - encoding = encoding_; -} - -#endif // generic wxNativeFontInfo implementation - -// conversion to/from user-readable string: this is used in the generic -// versions and under MSW as well because there is no standard font description -// format there anyhow (but there is a well-defined standard for X11 fonts used -// by wxGTK and wxMotif) - -#if defined(wxNO_NATIVE_FONTINFO) || defined(__WXMSW__) || defined (__WXPM__) - -wxString wxNativeFontInfo::ToUserString() const -{ - wxString desc; - - // first put the adjectives, if any - this is English-centric, of course, - // but what else can we do? - if ( GetUnderlined() ) - { - desc << _("underlined"); - } - - switch ( GetWeight() ) - { - default: - wxFAIL_MSG( _T("unknown font weight") ); - // fall through - - case wxFONTWEIGHT_NORMAL: - break; - - case wxFONTWEIGHT_LIGHT: - desc << _(" light"); - break; - - case wxFONTWEIGHT_BOLD: - desc << _(" bold"); - break; - } - - switch ( GetStyle() ) - { - default: - wxFAIL_MSG( _T("unknown font style") ); - // fall through - - case wxFONTSTYLE_NORMAL: - break; - - // we don't distinguish between the two for now anyhow... - case wxFONTSTYLE_ITALIC: - case wxFONTSTYLE_SLANT: - desc << _(" italic"); - break; - } - - wxString face = GetFaceName(); - if ( !face.empty() ) - { - desc << _T(' ') << face; - } - - int size = GetPointSize(); - if ( size != wxNORMAL_FONT->GetPointSize() ) - { - desc << _T(' ') << size; - } - -#if wxUSE_FONTMAP - wxFontEncoding enc = GetEncoding(); - if ( enc != wxFONTENCODING_DEFAULT && enc != wxFONTENCODING_SYSTEM ) - { - desc << _T(' ') << wxFontMapper::GetEncodingName(enc); - } -#endif // wxUSE_FONTMAP - - return desc.Strip(wxString::both).MakeLower(); -} - -bool wxNativeFontInfo::FromUserString(const wxString& s) -{ - // reset to the default state - Init(); - - // parse a more or less free form string - // - // TODO: we should handle at least the quoted facenames - wxStringTokenizer tokenizer(s, _T(";, "), wxTOKEN_STRTOK); - - wxString face; - unsigned long size; - bool weightfound = false, pointsizefound = false; -#if wxUSE_FONTMAP - bool encodingfound = false; -#endif - - while ( tokenizer.HasMoreTokens() ) - { - wxString token = tokenizer.GetNextToken(); - - // normalize it - token.Trim(true).Trim(false).MakeLower(); - - // look for the known tokens - if ( token == _T("underlined") || token == _("underlined") ) - { - SetUnderlined(true); - } - else if ( token == _T("light") || token == _("light") ) - { - SetWeight(wxFONTWEIGHT_LIGHT); - weightfound = true; - } - else if ( token == _T("bold") || token == _("bold") ) - { - SetWeight(wxFONTWEIGHT_BOLD); - weightfound = true; - } - else if ( token == _T("italic") || token == _("italic") ) - { - SetStyle(wxFONTSTYLE_ITALIC); - } - else if ( token.ToULong(&size) ) - { - SetPointSize(size); - pointsizefound = true; - } - else - { -#if wxUSE_FONTMAP - // try to interpret this as an encoding - wxFontEncoding encoding = wxFontMapper::Get()->CharsetToEncoding(token, false); - if ( encoding != wxFONTENCODING_DEFAULT && - encoding != wxFONTENCODING_SYSTEM ) // returned when the recognition failed - { - SetEncoding(encoding); - encodingfound = true; - } - else - { -#endif // wxUSE_FONTMAP - - // assume it is the face name - if ( !face.empty() ) - { - face += _T(' '); - } - - face += token; - - // skip the code which resets face below - continue; - -#if wxUSE_FONTMAP - } -#endif // wxUSE_FONTMAP - } - - // if we had had the facename, we shouldn't continue appending tokens - // to it (i.e. "foo bold bar" shouldn't result in the facename "foo - // bar") - if ( !face.empty() ) - { - // NB: the check on the facename is implemented in wxFontBase::SetFaceName - // and not in wxNativeFontInfo::SetFaceName thus we need to explicitely - // call here wxFontEnumerator::IsValidFacename - if (!wxFontEnumerator::IsValidFacename(face) || - !SetFaceName(face)) - SetFaceName(wxNORMAL_FONT->GetFaceName()); - face.clear(); - } - } - - // we might not have flushed it inside the loop - if ( !face.empty() ) - { - // NB: the check on the facename is implemented in wxFontBase::SetFaceName - // and not in wxNativeFontInfo::SetFaceName thus we need to explicitely - // call here wxFontEnumerator::IsValidFacename - if (!wxFontEnumerator::IsValidFacename(face) || - !SetFaceName(face)) - SetFaceName(wxNORMAL_FONT->GetFaceName()); - } - - // set point size to default value if size was not given - if ( !pointsizefound ) - SetPointSize(wxNORMAL_FONT->GetPointSize()); - - // set font weight to default value if weight was not given - if ( !weightfound ) - SetWeight(wxFONTWEIGHT_NORMAL); - -#if wxUSE_FONTMAP - // set font encoding to default value if encoding was not given - if ( !encodingfound ) - SetEncoding(wxFONTENCODING_SYSTEM); -#endif // wxUSE_FONTMAP - - return true; -} - -#endif // generic or wxMSW or wxOS2 diff --git a/wxWidgets/src/common/fontenumcmn.cpp b/wxWidgets/src/common/fontenumcmn.cpp deleted file mode 100644 index 6ea8a30cb1..0000000000 --- a/wxWidgets/src/common/fontenumcmn.cpp +++ /dev/null @@ -1,131 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/common/fontenumcmn.cpp -// Purpose: wxFontEnumerator class -// Author: Vadim Zeitlin -// Modified by: -// Created: 7/5/2006 -// RCS-ID: $Id: fontenumcmn.cpp 43727 2006-12-01 10:14:28Z VS $ -// Copyright: (c) 1999-2003 Vadim Zeitlin -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#include "wx/fontenum.h" - -// ============================================================================ -// implementation -// ============================================================================ - -// A simple wxFontEnumerator which doesn't perform any filtering and -// just returns all facenames and encodings found in the system -class WXDLLEXPORT wxSimpleFontEnumerator : public wxFontEnumerator -{ -public: - wxSimpleFontEnumerator() { } - - // called by EnumerateFacenames - virtual bool OnFacename(const wxString& facename) - { - m_arrFacenames.Add(facename); - return true; - } - - // called by EnumerateEncodings - virtual bool OnFontEncoding(const wxString& WXUNUSED(facename), - const wxString& encoding) - { - m_arrEncodings.Add(encoding); - return true; - } - -public: - wxArrayString m_arrFacenames, m_arrEncodings; -}; - - -/* static */ -wxArrayString wxFontEnumerator::GetFacenames(wxFontEncoding encoding, bool fixedWidthOnly) -{ - wxSimpleFontEnumerator temp; - temp.EnumerateFacenames(encoding, fixedWidthOnly); - return temp.m_arrFacenames; -} - -/* static */ -wxArrayString wxFontEnumerator::GetEncodings(const wxString& facename) -{ - wxSimpleFontEnumerator temp; - temp.EnumerateEncodings(facename); - return temp.m_arrEncodings; -} - -/* static */ -bool wxFontEnumerator::IsValidFacename(const wxString &facename) -{ - // we cache the result of wxFontEnumerator::GetFacenames supposing that - // the array of face names won't change in the session of this program - static wxArrayString s_arr = wxFontEnumerator::GetFacenames(); - -#ifdef __WXMSW__ - // Quoting the MSDN: - // "MS Shell Dlg is a mapping mechanism that enables - // U.S. English Microsoft Windows NT, and Microsoft Windows 2000 to - // support locales that have characters that are not contained in code - // page 1252. It is not a font but a face name for a nonexistent font." - // Thus we need to consider "Ms Shell Dlg" and "Ms Shell Dlg 2" as valid - // font face names even if they are enumerated by wxFontEnumerator - if (facename.IsSameAs(wxT("Ms Shell Dlg"), false) || - facename.IsSameAs(wxT("Ms Shell Dlg 2"), false)) - return true; -#endif - - // is given font face name a valid one ? - if (s_arr.Index(facename, false) == wxNOT_FOUND) - return false; - - return true; -} - -#ifdef wxHAS_UTF8_FONTS -bool wxFontEnumerator::EnumerateEncodingsUTF8(const wxString& facename) -{ - // name of UTF-8 encoding: no need to use wxFontMapper for it as it's - // unlikely to change - const wxString utf8(_T("UTF-8")); - - // all fonts are in UTF-8 only if this code is used - if ( !facename.empty() ) - { - OnFontEncoding(facename, utf8); - return true; - } - - // so enumerating all facenames supporting this encoding is the same as - // enumerating all facenames - const wxArrayString facenames(GetFacenames(wxFONTENCODING_UTF8)); - const size_t count = facenames.size(); - if ( !count ) - return false; - - for ( size_t n = 0; n < count; n++ ) - { - OnFontEncoding(facenames[n], utf8); - } - - return true; -} -#endif // wxHAS_UTF8_FONTS diff --git a/wxWidgets/src/common/fontmap.cpp b/wxWidgets/src/common/fontmap.cpp deleted file mode 100644 index 3d38007660..0000000000 --- a/wxWidgets/src/common/fontmap.cpp +++ /dev/null @@ -1,519 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/common/fontmap.cpp -// Purpose: wxFontMapper class -// Author: Vadim Zeitlin -// Modified by: -// Created: 04.11.99 -// RCS-ID: $Id: fontmap.cpp 39651 2006-06-09 17:50:46Z ABX $ -// Copyright: (c) 1999-2003 Vadim Zeitlin -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_FONTMAP - -#include "wx/fontmap.h" - -#ifndef WX_PRECOMP - #include "wx/app.h" - #include "wx/log.h" - #include "wx/intl.h" - #include "wx/msgdlg.h" - #include "wx/choicdlg.h" -#endif // PCH - -#if wxUSE_CONFIG - #include "wx/config.h" -#endif // wxUSE_CONFIG - -#if defined(__WXMSW__) - #include "wx/msw/private.h" // includes windows.h for LOGFONT - #include "wx/msw/winundef.h" -#endif - -#include "wx/fmappriv.h" -#include "wx/fontutil.h" -#include "wx/fontdlg.h" -#include "wx/encinfo.h" - -#include "wx/encconv.h" - -#if wxUSE_EXTENDED_RTTI - -wxBEGIN_ENUM( wxFontEncoding ) - wxENUM_MEMBER( wxFONTENCODING_SYSTEM ) - wxENUM_MEMBER( wxFONTENCODING_DEFAULT ) - - wxENUM_MEMBER( wxFONTENCODING_ISO8859_1 ) - wxENUM_MEMBER( wxFONTENCODING_ISO8859_2 ) - wxENUM_MEMBER( wxFONTENCODING_ISO8859_3 ) - wxENUM_MEMBER( wxFONTENCODING_ISO8859_4 ) - wxENUM_MEMBER( wxFONTENCODING_ISO8859_5 ) - wxENUM_MEMBER( wxFONTENCODING_ISO8859_6 ) - wxENUM_MEMBER( wxFONTENCODING_ISO8859_7 ) - wxENUM_MEMBER( wxFONTENCODING_ISO8859_8 ) - wxENUM_MEMBER( wxFONTENCODING_ISO8859_9 ) - wxENUM_MEMBER( wxFONTENCODING_ISO8859_10 ) - wxENUM_MEMBER( wxFONTENCODING_ISO8859_11 ) - wxENUM_MEMBER( wxFONTENCODING_ISO8859_12 ) - wxENUM_MEMBER( wxFONTENCODING_ISO8859_13 ) - wxENUM_MEMBER( wxFONTENCODING_ISO8859_14 ) - wxENUM_MEMBER( wxFONTENCODING_ISO8859_15 ) - wxENUM_MEMBER( wxFONTENCODING_ISO8859_MAX ) - wxENUM_MEMBER( wxFONTENCODING_KOI8 ) - wxENUM_MEMBER( wxFONTENCODING_KOI8_U ) - wxENUM_MEMBER( wxFONTENCODING_ALTERNATIVE ) - wxENUM_MEMBER( wxFONTENCODING_BULGARIAN ) - wxENUM_MEMBER( wxFONTENCODING_CP437 ) - wxENUM_MEMBER( wxFONTENCODING_CP850 ) - wxENUM_MEMBER( wxFONTENCODING_CP852 ) - wxENUM_MEMBER( wxFONTENCODING_CP855 ) - wxENUM_MEMBER( wxFONTENCODING_CP866 ) - - wxENUM_MEMBER( wxFONTENCODING_CP874 ) - wxENUM_MEMBER( wxFONTENCODING_CP932 ) - wxENUM_MEMBER( wxFONTENCODING_CP936 ) - wxENUM_MEMBER( wxFONTENCODING_CP949 ) - wxENUM_MEMBER( wxFONTENCODING_CP950 ) - wxENUM_MEMBER( wxFONTENCODING_CP1250 ) - wxENUM_MEMBER( wxFONTENCODING_CP1251 ) - wxENUM_MEMBER( wxFONTENCODING_CP1252 ) - wxENUM_MEMBER( wxFONTENCODING_CP1253 ) - wxENUM_MEMBER( wxFONTENCODING_CP1254 ) - wxENUM_MEMBER( wxFONTENCODING_CP1255 ) - wxENUM_MEMBER( wxFONTENCODING_CP1256 ) - wxENUM_MEMBER( wxFONTENCODING_CP1257 ) - wxENUM_MEMBER( wxFONTENCODING_CP12_MAX ) - wxENUM_MEMBER( wxFONTENCODING_UTF7 ) - wxENUM_MEMBER( wxFONTENCODING_UTF8 ) - wxENUM_MEMBER( wxFONTENCODING_GB2312 ) - wxENUM_MEMBER( wxFONTENCODING_BIG5 ) - wxENUM_MEMBER( wxFONTENCODING_SHIFT_JIS ) - wxENUM_MEMBER( wxFONTENCODING_EUC_JP ) - wxENUM_MEMBER( wxFONTENCODING_UNICODE ) -wxEND_ENUM( wxFontEncoding ) -#endif - -// ---------------------------------------------------------------------------- -// constants -// ---------------------------------------------------------------------------- - -// the config paths we use -#if wxUSE_CONFIG - -static const wxChar* FONTMAPPER_FONT_FROM_ENCODING_PATH = wxT("Encodings"); -static const wxChar* FONTMAPPER_FONT_DONT_ASK = wxT("none"); - -#endif // wxUSE_CONFIG - -// ---------------------------------------------------------------------------- -// private classes -// ---------------------------------------------------------------------------- - -// it may happen that while we're showing a dialog asking the user about -// something, another request for an encoding mapping arrives: in this case it -// is best to not do anything because otherwise we risk to enter an infinite -// loop so we create an object of this class on stack to test for this in all -// interactive functions -class ReentrancyBlocker -{ -public: - ReentrancyBlocker(bool& flag) : m_flagOld(flag), m_flag(flag) - { m_flag = true; } - ~ReentrancyBlocker() { m_flag = m_flagOld; } - -private: - bool m_flagOld; - bool& m_flag; - - DECLARE_NO_COPY_CLASS(ReentrancyBlocker) -}; - -// ============================================================================ -// implementation -// ============================================================================ - -// ---------------------------------------------------------------------------- -// ctor and dtor -// ---------------------------------------------------------------------------- - -wxFontMapper::wxFontMapper() -{ - m_windowParent = NULL; -} - -wxFontMapper::~wxFontMapper() -{ -} - -/* static */ -wxFontMapper *wxFontMapper::Get() -{ - wxFontMapperBase *fontmapper = wxFontMapperBase::Get(); - wxASSERT_MSG( !fontmapper->IsDummy(), - wxT("GUI code requested a wxFontMapper but we only have a wxFontMapperBase.") ); - - // Now return it anyway because there's a chance the GUI code might just - // only want to call wxFontMapperBase functions and it's better than - // crashing by returning NULL - return (wxFontMapper *)fontmapper; -} - -wxFontEncoding -wxFontMapper::CharsetToEncoding(const wxString& charset, bool interactive) -{ - // try the ways not needing the users intervention first - int encoding = wxFontMapperBase::NonInteractiveCharsetToEncoding(charset); - - // if we failed to find the encoding, ask the user -- unless disabled - if ( encoding == wxFONTENCODING_UNKNOWN ) - { - // this is the special value which disables asking the user (he had - // chosen to suppress this the last time) - encoding = wxFONTENCODING_SYSTEM; - } -#if wxUSE_CHOICEDLG - else if ( (encoding == wxFONTENCODING_SYSTEM) && interactive ) - { - // prepare the dialog data - - // the dialog title - wxString title(m_titleDialog); - if ( !title ) - title << wxTheApp->GetAppName() << _(": unknown charset"); - - // the message - wxString msg; - msg.Printf(_("The charset '%s' is unknown. You may select\nanother charset to replace it with or choose\n[Cancel] if it cannot be replaced"), charset.c_str()); - - // the list of choices - const size_t count = GetSupportedEncodingsCount(); - - wxString *encodingNamesTranslated = new wxString[count]; - - for ( size_t i = 0; i < count; i++ ) - { - encodingNamesTranslated[i] = GetEncodingDescription(GetEncoding(i)); - } - - // the parent window - wxWindow *parent = m_windowParent; - if ( !parent ) - parent = wxTheApp->GetTopWindow(); - - // do ask the user and get back the index in encodings table - int n = wxGetSingleChoiceIndex(msg, title, - count, - encodingNamesTranslated, - parent); - - delete [] encodingNamesTranslated; - - if ( n != -1 ) - { - encoding = GetEncoding(n); - } - -#if wxUSE_CONFIG && wxUSE_FILECONFIG - // save the result in the config now - wxFontMapperPathChanger path(this, FONTMAPPER_CHARSET_PATH); - if ( path.IsOk() ) - { - wxConfigBase *config = GetConfig(); - - // remember the alt encoding for this charset -- or remember that - // we don't know it - long value = n == -1 ? (long)wxFONTENCODING_UNKNOWN : (long)encoding; - if ( !config->Write(charset, value) ) - { - wxLogError(_("Failed to remember the encoding for the charset '%s'."), charset.c_str()); - } - } -#endif // wxUSE_CONFIG - } -#else - wxUnusedVar(interactive); -#endif // wxUSE_CHOICEDLG - - return (wxFontEncoding)encoding; -} - -// ---------------------------------------------------------------------------- -// support for unknown encodings: we maintain a map between the -// (platform-specific) strings identifying them and our wxFontEncodings they -// correspond to which is used by GetFontForEncoding() function -// ---------------------------------------------------------------------------- - -bool wxFontMapper::TestAltEncoding(const wxString& configEntry, - wxFontEncoding encReplacement, - wxNativeEncodingInfo *info) -{ - if ( wxGetNativeFontEncoding(encReplacement, info) && - wxTestFontEncoding(*info) ) - { -#if wxUSE_CONFIG && wxUSE_FILECONFIG - // remember the mapping in the config - wxFontMapperPathChanger path(this, FONTMAPPER_FONT_FROM_ENCODING_PATH); - - if ( path.IsOk() ) - { - GetConfig()->Write(configEntry, info->ToString()); - } -#else - wxUnusedVar(configEntry); -#endif // wxUSE_CONFIG - return true; - } - - return false; -} - -bool wxFontMapper::GetAltForEncoding(wxFontEncoding encoding, - wxNativeEncodingInfo *info, - const wxString& facename, - bool interactive) -{ -#if wxUSE_GUI - // we need a flag to prevent infinite recursion which happens, for - // example, when GetAltForEncoding() is called from an OnPaint() handler: - // in this case, wxYield() which is called from wxMessageBox() we use here - // will lead to another call of OnPaint() and hence to another call of - // GetAltForEncoding() -- and it is impossible to catch this from the user - // code because we are called from wxFont ctor implicitly. - - // assume we're always called from the main thread, so that it is safe to - // use a static var - static bool s_inGetAltForEncoding = false; - - if ( interactive && s_inGetAltForEncoding ) - return false; - - ReentrancyBlocker blocker(s_inGetAltForEncoding); -#endif // wxUSE_GUI - - wxCHECK_MSG( info, false, wxT("bad pointer in GetAltForEncoding") ); - - info->facename = facename; - - if ( encoding == wxFONTENCODING_DEFAULT ) - { - encoding = wxFont::GetDefaultEncoding(); - } - - // if we failed to load the system default encoding, something is really - // wrong and we'd better stop now -- otherwise we will go into endless - // recursion trying to create the font in the msg box with the error - // message - if ( encoding == wxFONTENCODING_SYSTEM ) - { - wxLogFatalError(_("can't load any font, aborting")); - - // wxLogFatalError doesn't return - } - - wxString configEntry, - encName = GetEncodingName(encoding); - if ( !facename.empty() ) - { - configEntry = facename + _T("_"); - } - configEntry += encName; - -#if wxUSE_CONFIG && wxUSE_FILECONFIG - // do we have a font spec for this encoding? - wxString fontinfo; - wxFontMapperPathChanger path(this, FONTMAPPER_FONT_FROM_ENCODING_PATH); - if ( path.IsOk() ) - { - fontinfo = GetConfig()->Read(configEntry); - } - - // this special value means that we don't know of fonts for this - // encoding but, moreover, have already asked the user as well and he - // didn't specify any font neither - if ( fontinfo == FONTMAPPER_FONT_DONT_ASK ) - { - interactive = false; - } - else // use the info entered the last time - { - if ( !fontinfo.empty() && !facename.empty() ) - { - // we tried to find a match with facename -- now try without it - fontinfo = GetConfig()->Read(encName); - } - - if ( !fontinfo.empty() ) - { - if ( info->FromString(fontinfo) ) - { - if ( wxTestFontEncoding(*info) ) - { - // ok, got something - return true; - } - //else: no such fonts, look for something else - // (should we erase the outdated value?) - } - else - { - wxLogDebug(wxT("corrupted config data: string '%s' is not a valid font encoding info"), - fontinfo.c_str()); - } - } - //else: there is no information in config about this encoding - } -#endif // wxUSE_CONFIG - - // now try to map this encoding to a compatible one which we have on this - // system - wxFontEncodingArray equiv = wxEncodingConverter::GetAllEquivalents(encoding); - size_t count = equiv.GetCount(); - bool foundEquivEncoding = false; - wxFontEncoding equivEncoding = wxFONTENCODING_SYSTEM; - if ( count ) - { - for ( size_t i = 0; i < count && !foundEquivEncoding; i++ ) - { - // don't test for encoding itself, we already know we don't have it - if ( equiv[i] == encoding ) - continue; - - if ( TestAltEncoding(configEntry, equiv[i], info) ) - { - equivEncoding = equiv[i]; - - foundEquivEncoding = true; - } - } - } - - // ask the user -#if wxUSE_FONTDLG - if ( interactive ) - { - wxString title(m_titleDialog); - if ( !title ) - title << wxTheApp->GetAppName() << _(": unknown encoding"); - - // built the message - wxString encDesc = GetEncodingDescription(encoding), - msg; - if ( foundEquivEncoding ) - { - // ask the user if he wants to override found alternative encoding - msg.Printf(_("No font for displaying text in encoding '%s' found,\nbut an alternative encoding '%s' is available.\nDo you want to use this encoding (otherwise you will have to choose another one)?"), - encDesc.c_str(), GetEncodingDescription(equivEncoding).c_str()); - } - else - { - msg.Printf(_("No font for displaying text in encoding '%s' found.\nWould you like to select a font to be used for this encoding\n(otherwise the text in this encoding will not be shown correctly)?"), - encDesc.c_str()); - } - - // the question is different in 2 cases so the answer has to be - // interpreted differently as well - int answer = foundEquivEncoding ? wxNO : wxYES; - - if ( wxMessageBox(msg, title, - wxICON_QUESTION | wxYES_NO, - m_windowParent) == answer ) - { - wxFontData data; - data.SetEncoding(encoding); - data.EncodingInfo() = *info; - wxFontDialog dialog(m_windowParent, data); - if ( dialog.ShowModal() == wxID_OK ) - { - wxFontData retData = dialog.GetFontData(); - - *info = retData.EncodingInfo(); - info->encoding = retData.GetEncoding(); - -#if wxUSE_CONFIG && wxUSE_FILECONFIG - // remember this in the config - wxFontMapperPathChanger path2(this, - FONTMAPPER_FONT_FROM_ENCODING_PATH); - if ( path2.IsOk() ) - { - GetConfig()->Write(configEntry, info->ToString()); - } -#endif // wxUSE_CONFIG - - return true; - } - //else: the user canceled the font selection dialog - } - else - { - // the user doesn't want to select a font for this encoding - // or selected to use equivalent encoding - // - // remember it to avoid asking the same question again later -#if wxUSE_CONFIG && wxUSE_FILECONFIG - wxFontMapperPathChanger path2(this, - FONTMAPPER_FONT_FROM_ENCODING_PATH); - if ( path2.IsOk() ) - { - GetConfig()->Write - ( - configEntry, - foundEquivEncoding ? info->ToString().c_str() - : FONTMAPPER_FONT_DONT_ASK - ); - } -#endif // wxUSE_CONFIG - } - } - //else: we're in non-interactive mode -#else - wxUnusedVar(equivEncoding); -#endif // wxUSE_FONTDLG - - return foundEquivEncoding; -} - -bool wxFontMapper::GetAltForEncoding(wxFontEncoding encoding, - wxFontEncoding *encodingAlt, - const wxString& facename, - bool interactive) -{ - wxCHECK_MSG( encodingAlt, false, - _T("wxFontEncoding::GetAltForEncoding(): NULL pointer") ); - - wxNativeEncodingInfo info; - if ( !GetAltForEncoding(encoding, &info, facename, interactive) ) - return false; - - *encodingAlt = info.encoding; - - return true; -} - -bool wxFontMapper::IsEncodingAvailable(wxFontEncoding encoding, - const wxString& facename) -{ - wxNativeEncodingInfo info; - - if ( !wxGetNativeFontEncoding(encoding, &info) ) - return false; - - info.facename = facename; - return wxTestFontEncoding(info); -} - -#endif // wxUSE_FONTMAP diff --git a/wxWidgets/src/common/fontmgrcmn.cpp b/wxWidgets/src/common/fontmgrcmn.cpp deleted file mode 100644 index 986d71b490..0000000000 --- a/wxWidgets/src/common/fontmgrcmn.cpp +++ /dev/null @@ -1,348 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/common/fontmgrcmn.cpp -// Purpose: font management for ports that don't have their own -// Author: Vaclav Slavik -// Created: 2006-11-18 -// RCS-ID: $Id: fontmgrcmn.cpp 54757 2008-07-21 17:34:48Z VZ $ -// Copyright: (c) 2001-2002 SciTech Software, Inc. (www.scitechsoft.com) -// (c) 2006 REA Elektronik GmbH -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#include "wx/private/fontmgr.h" - -#include "wx/listimpl.cpp" -#include "wx/hashmap.h" - -WX_DECLARE_LIST(wxFontInstance, wxFontInstanceList); -WX_DEFINE_LIST(wxFontInstanceList) -WX_DEFINE_LIST(wxFontBundleList) - -WX_DECLARE_HASH_MAP(wxString, wxFontBundle*, - wxStringHash, wxStringEqual, - wxFontBundleHashBase); -// in STL build, hash class is typedef to a template, so it can't be forward -// declared, as we do; solve it by having a dummy class: -class wxFontBundleHash : public wxFontBundleHashBase -{ -}; - -// ============================================================================ -// implementation -// ============================================================================ - -// ---------------------------------------------------------------------------- -// wxFontFaceBase -// ---------------------------------------------------------------------------- - -wxFontFaceBase::wxFontFaceBase() - : m_refCnt(0) -{ - m_instances = new wxFontInstanceList; - m_instances->DeleteContents(true); -} - -wxFontFaceBase::~wxFontFaceBase() -{ - delete m_instances; -} - -void wxFontFaceBase::Acquire() -{ - m_refCnt++; -} - -void wxFontFaceBase::Release() -{ - if ( --m_refCnt == 0 ) - { - m_instances->Clear(); - } -} - -wxFontInstance *wxFontFaceBase::GetFontInstance(float ptSize, bool aa) -{ - wxASSERT_MSG( m_refCnt > 0, _T("font library not loaded!") ); - - for ( wxFontInstanceList::const_iterator i = m_instances->begin(); - i != m_instances->end(); ++i ) - { - if ( (*i)->GetPointSize() == ptSize && (*i)->IsAntiAliased() == aa ) - return *i; - } - - wxFontInstance *i = CreateFontInstance(ptSize, aa); - m_instances->Append(i); - return i; -} - -// ---------------------------------------------------------------------------- -// wxFontBundleBase -// ---------------------------------------------------------------------------- - -wxFontBundleBase::wxFontBundleBase() -{ - for (int i = 0; i < FaceType_Max; i++) - m_faces[i] = NULL; -} - -wxFontBundleBase::~wxFontBundleBase() -{ - for (int i = 0; i < FaceType_Max; i++) - delete m_faces[i]; -} - -wxFontFace *wxFontBundleBase::GetFace(FaceType type) const -{ - wxFontFace *f = m_faces[type]; - - wxCHECK_MSG( f, NULL, _T("no such face in font bundle") ); - - f->Acquire(); - - return f; -} - -wxFontFace * -wxFontBundleBase::GetFaceForFont(const wxFontMgrFontRefData& font) const -{ - wxASSERT_MSG( font.GetFaceName().empty() || font.GetFaceName() == GetName(), - _T("calling GetFaceForFont for incompatible font") ); - - int type = FaceType_Regular; - - if ( font.GetWeight() == wxBOLD ) - type |= FaceType_Bold; - - // FIXME -- this should read "if ( font->GetStyle() == wxITALIC )", - // but since MGL neither DFB supports slant, we try to display it with - // italic face (better than nothing...) - if ( font.GetStyle() == wxITALIC || font.GetStyle() == wxSLANT ) - { - if ( HasFace((FaceType)(type | FaceType_Italic)) ) - type |= FaceType_Italic; - } - - if ( !HasFace((FaceType)type) ) - { - for (int i = 0; i < FaceType_Max; i++) - { - if ( HasFace((FaceType)i) ) - return GetFace((FaceType)i); - } - - wxFAIL_MSG( _T("no face") ); - return NULL; - } - - return GetFace((FaceType)type); -} - -// ---------------------------------------------------------------------------- -// wxFontsManagerBase -// ---------------------------------------------------------------------------- - -wxFontsManager *wxFontsManagerBase::ms_instance = NULL; - -wxFontsManagerBase::wxFontsManagerBase() -{ - m_hash = new wxFontBundleHash(); - m_list = new wxFontBundleList; - m_list->DeleteContents(true); -} - -wxFontsManagerBase::~wxFontsManagerBase() -{ - delete m_hash; - delete m_list; -} - -/* static */ -wxFontsManager *wxFontsManagerBase::Get() -{ - if ( !ms_instance ) - ms_instance = new wxFontsManager(); - return ms_instance; -} - -/* static */ -void wxFontsManagerBase::CleanUp() -{ - wxDELETE(ms_instance); -} - -wxFontBundle *wxFontsManagerBase::GetBundle(const wxString& name) const -{ - return (*m_hash)[name.Lower()]; -} - -wxFontBundle * -wxFontsManagerBase::GetBundleForFont(const wxFontMgrFontRefData& font) const -{ - wxFontBundle *bundle = NULL; - - wxString facename = font.GetFaceName(); - if ( !facename.empty() ) - bundle = GetBundle(facename); - - if ( !bundle ) - { - facename = GetDefaultFacename((wxFontFamily)font.GetFamily()); - if ( !facename.empty() ) - bundle = GetBundle(facename); - } - - if ( !bundle ) - { - if ( m_list->GetFirst() ) - bundle = m_list->GetFirst()->GetData(); - else - wxFAIL_MSG(wxT("Fatal error, no fonts available!")); - } - - return bundle; -} - -void wxFontsManagerBase::AddBundle(wxFontBundle *bundle) -{ - (*m_hash)[bundle->GetName().Lower()] = bundle; - m_list->Append(bundle); -} - - -// ---------------------------------------------------------------------------- -// wxFontMgrFontRefData -// ---------------------------------------------------------------------------- - -wxFontMgrFontRefData::wxFontMgrFontRefData(int size, - int family, - int style, - int weight, - bool underlined, - const wxString& faceName, - wxFontEncoding encoding) -{ - if ( family == wxDEFAULT ) - family = wxSWISS; - if ( style == wxDEFAULT ) - style = wxNORMAL; - if ( weight == wxDEFAULT ) - weight = wxNORMAL; - if ( size == wxDEFAULT ) - size = 12; - - m_info.family = (wxFontFamily)family; - m_info.faceName = faceName; - m_info.style = (wxFontStyle)style; - m_info.weight = (wxFontWeight)weight; - m_info.pointSize = size; - m_info.underlined = underlined; - m_info.encoding = encoding; - - m_noAA = false; - - m_fontFace = NULL; - m_fontBundle = NULL; - m_fontValid = false; -} - -wxFontMgrFontRefData::wxFontMgrFontRefData(const wxFontMgrFontRefData& data) -{ - m_info = data.m_info; - m_noAA = data.m_noAA; - - m_fontFace = data.m_fontFace; - m_fontBundle = data.m_fontBundle; - m_fontValid = data.m_fontValid; - if ( m_fontFace ) - m_fontFace->Acquire(); -} - -wxFontMgrFontRefData::~wxFontMgrFontRefData() -{ - if ( m_fontFace ) - m_fontFace->Release(); -} - -wxFontBundle *wxFontMgrFontRefData::GetFontBundle() const -{ - wxConstCast(this, wxFontMgrFontRefData)->EnsureValidFont(); - return m_fontBundle; -} - -wxFontInstance * -wxFontMgrFontRefData::GetFontInstance(float scale, bool antialiased) const -{ - wxConstCast(this, wxFontMgrFontRefData)->EnsureValidFont(); - return m_fontFace->GetFontInstance(m_info.pointSize * scale, - antialiased && !m_noAA); -} - -void wxFontMgrFontRefData::SetPointSize(int pointSize) -{ - m_info.pointSize = pointSize; - m_fontValid = false; -} - -void wxFontMgrFontRefData::SetFamily(int family) -{ - m_info.family = (wxFontFamily)family; - m_fontValid = false; -} - -void wxFontMgrFontRefData::SetStyle(int style) -{ - m_info.style = (wxFontStyle)style; - m_fontValid = false; -} - -void wxFontMgrFontRefData::SetWeight(int weight) -{ - m_info.weight = (wxFontWeight)weight; - m_fontValid = false; -} - -void wxFontMgrFontRefData::SetFaceName(const wxString& faceName) -{ - m_info.faceName = faceName; - m_fontValid = false; -} - -void wxFontMgrFontRefData::SetUnderlined(bool underlined) -{ - m_info.underlined = underlined; - m_fontValid = false; -} - -void wxFontMgrFontRefData::SetEncoding(wxFontEncoding encoding) -{ - m_info.encoding = encoding; - m_fontValid = false; -} - -void wxFontMgrFontRefData::SetNoAntiAliasing(bool no) -{ - m_noAA = no; -} - - -void wxFontMgrFontRefData::EnsureValidFont() -{ - if ( !m_fontValid ) - { - wxFontFace *old = m_fontFace; - - m_fontBundle = wxFontsManager::Get()->GetBundleForFont(*this); - m_fontFace = m_fontBundle->GetFaceForFont(*this); - - if ( old ) - old->Release(); - } -} diff --git a/wxWidgets/src/common/fontpickercmn.cpp b/wxWidgets/src/common/fontpickercmn.cpp deleted file mode 100644 index c4af53f25c..0000000000 --- a/wxWidgets/src/common/fontpickercmn.cpp +++ /dev/null @@ -1,181 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: src/common/fontpickercmn.cpp -// Purpose: wxFontPickerCtrl class implementation -// Author: Francesco Montorsi -// Modified by: -// Created: 15/04/2006 -// RCS-ID: $Id: fontpickercmn.cpp 42999 2006-11-03 21:54:13Z VZ $ -// Copyright: (c) Francesco Montorsi -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_FONTPICKERCTRL - -#include "wx/fontpicker.h" - -#ifndef WX_PRECOMP - #include "wx/textctrl.h" -#endif - -#include "wx/fontenum.h" -#include "wx/tokenzr.h" - -// ============================================================================ -// implementation -// ============================================================================ - -const wxChar wxFontPickerCtrlNameStr[] = wxT("fontpicker"); -const wxChar wxFontPickerWidgetNameStr[] = wxT("fontpickerwidget"); - -DEFINE_EVENT_TYPE(wxEVT_COMMAND_FONTPICKER_CHANGED) -IMPLEMENT_DYNAMIC_CLASS(wxFontPickerCtrl, wxPickerBase) -IMPLEMENT_DYNAMIC_CLASS(wxFontPickerEvent, wxCommandEvent) - -// ---------------------------------------------------------------------------- -// wxFontPickerCtrl -// ---------------------------------------------------------------------------- - -#define M_PICKER ((wxFontPickerWidget*)m_picker) - -bool wxFontPickerCtrl::Create( wxWindow *parent, wxWindowID id, - const wxFont &initial, - const wxPoint &pos, const wxSize &size, - long style, const wxValidator& validator, - const wxString &name ) -{ - if (!wxPickerBase::CreateBase(parent, id, - Font2String(initial.IsOk() ? initial - : *wxNORMAL_FONT), - pos, size, style, validator, name)) - return false; - - // the picker of a wxFontPickerCtrl is a wxFontPickerWidget - m_picker = new wxFontPickerWidget(this, wxID_ANY, initial, - wxDefaultPosition, wxDefaultSize, - GetPickerStyle(style)); - // complete sizer creation - wxPickerBase::PostCreation(); - - m_picker->Connect(wxEVT_COMMAND_FONTPICKER_CHANGED, - wxFontPickerEventHandler(wxFontPickerCtrl::OnFontChange), - NULL, this); - - return true; -} - -wxString wxFontPickerCtrl::Font2String(const wxFont &f) -{ - wxString ret = f.GetNativeFontInfoUserDesc(); -#ifdef __WXMSW__ - // on wxMSW the encoding of the font is appended at the end of the string; - // since encoding is not very user-friendly we remove it. - wxFontEncoding enc = f.GetEncoding(); - if ( enc != wxFONTENCODING_DEFAULT && enc != wxFONTENCODING_SYSTEM ) - ret = ret.BeforeLast(wxT(' ')); -#endif - return ret; -} - -wxFont wxFontPickerCtrl::String2Font(const wxString &s) -{ - wxString str(s); - wxFont ret; - double n; - - // put a limit on the maximum point size which the user can enter - // NOTE: we suppose the last word of given string is the pointsize - wxString size = str.AfterLast(wxT(' ')); - if (size.ToDouble(&n)) - { - if (n < 1) - str = str.Left(str.length() - size.length()) + wxT("1"); - else if (n >= m_nMaxPointSize) - str = str.Left(str.length() - size.length()) + - wxString::Format(wxT("%d"), m_nMaxPointSize); - } - - if (!ret.SetNativeFontInfoUserDesc(str)) - return wxNullFont; - - return ret; -} - -void wxFontPickerCtrl::SetSelectedFont(const wxFont &f) -{ - M_PICKER->SetSelectedFont(f); - UpdateTextCtrlFromPicker(); -} - -void wxFontPickerCtrl::UpdatePickerFromTextCtrl() -{ - wxASSERT(m_text); - - if (m_bIgnoreNextTextCtrlUpdate) - { - // ignore this update - m_bIgnoreNextTextCtrlUpdate = false; - return; - } - - // NB: we don't use the wxFont::wxFont(const wxString &) constructor - // since that constructor expects the native font description - // string returned by wxFont::GetNativeFontInfoDesc() and not - // the user-friendly one returned by wxFont::GetNativeFontInfoUserDesc() - wxFont f = String2Font(m_text->GetValue()); - if (!f.Ok()) - return; // invalid user input - - if (M_PICKER->GetSelectedFont() != f) - { - M_PICKER->SetSelectedFont(f); - - // fire an event - wxFontPickerEvent event(this, GetId(), f); - GetEventHandler()->ProcessEvent(event); - } -} - -void wxFontPickerCtrl::UpdateTextCtrlFromPicker() -{ - if (!m_text) - return; // no textctrl to update - - // NOTE: this SetValue() will generate an unwanted wxEVT_COMMAND_TEXT_UPDATED - // which will trigger a unneeded UpdateFromTextCtrl(); thus before using - // SetValue() we set the m_bIgnoreNextTextCtrlUpdate flag... - m_bIgnoreNextTextCtrlUpdate = true; - m_text->SetValue(Font2String(M_PICKER->GetSelectedFont())); -} - - - -// ---------------------------------------------------------------------------- -// wxFontPickerCtrl - event handlers -// ---------------------------------------------------------------------------- - -void wxFontPickerCtrl::OnFontChange(wxFontPickerEvent &ev) -{ - UpdateTextCtrlFromPicker(); - - // the wxFontPickerWidget sent us a colour-change notification. - // forward this event to our parent - wxFontPickerEvent event(this, GetId(), ev.GetFont()); - GetEventHandler()->ProcessEvent(event); -} - -#endif // wxUSE_FONTPICKERCTRL diff --git a/wxWidgets/src/common/framecmn.cpp b/wxWidgets/src/common/framecmn.cpp deleted file mode 100644 index 65c3c48ac8..0000000000 --- a/wxWidgets/src/common/framecmn.cpp +++ /dev/null @@ -1,590 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/common/framecmn.cpp -// Purpose: common (for all platforms) wxFrame functions -// Author: Julian Smart, Vadim Zeitlin -// Created: 01/02/97 -// Id: $Id: framecmn.cpp 51463 2008-01-30 21:31:03Z VZ $ -// Copyright: (c) 1998 Robert Roebling and Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#include "wx/frame.h" - -#ifndef WX_PRECOMP - #include "wx/menu.h" - #include "wx/menuitem.h" - #include "wx/dcclient.h" - #include "wx/toolbar.h" - #include "wx/statusbr.h" -#endif // WX_PRECOMP - -// ---------------------------------------------------------------------------- -// event table -// ---------------------------------------------------------------------------- - -#if wxUSE_MENUS && wxUSE_STATUSBAR - -BEGIN_EVENT_TABLE(wxFrameBase, wxTopLevelWindow) - EVT_MENU_OPEN(wxFrameBase::OnMenuOpen) - EVT_MENU_CLOSE(wxFrameBase::OnMenuClose) - - EVT_MENU_HIGHLIGHT_ALL(wxFrameBase::OnMenuHighlight) -END_EVENT_TABLE() - -#endif // wxUSE_MENUS && wxUSE_STATUSBAR - -// ============================================================================ -// implementation -// ============================================================================ - -// ---------------------------------------------------------------------------- -// construction/destruction -// ---------------------------------------------------------------------------- - -wxFrameBase::wxFrameBase() -{ -#if wxUSE_MENUS - m_frameMenuBar = NULL; -#endif // wxUSE_MENUS - -#if wxUSE_TOOLBAR - m_frameToolBar = NULL; -#endif // wxUSE_TOOLBAR - -#if wxUSE_STATUSBAR - m_frameStatusBar = NULL; -#endif // wxUSE_STATUSBAR - - m_statusBarPane = 0; -} - -wxFrameBase::~wxFrameBase() -{ - // this destructor is required for Darwin -} - -wxFrame *wxFrameBase::New(wxWindow *parent, - wxWindowID id, - const wxString& title, - const wxPoint& pos, - const wxSize& size, - long style, - const wxString& name) -{ - return new wxFrame(parent, id, title, pos, size, style, name); -} - -void wxFrameBase::DeleteAllBars() -{ -#if wxUSE_MENUS - if ( m_frameMenuBar ) - { - delete m_frameMenuBar; - m_frameMenuBar = (wxMenuBar *) NULL; - } -#endif // wxUSE_MENUS - -#if wxUSE_STATUSBAR - if ( m_frameStatusBar ) - { - delete m_frameStatusBar; - m_frameStatusBar = (wxStatusBar *) NULL; - } -#endif // wxUSE_STATUSBAR - -#if wxUSE_TOOLBAR - if ( m_frameToolBar ) - { - delete m_frameToolBar; - m_frameToolBar = (wxToolBar *) NULL; - } -#endif // wxUSE_TOOLBAR -} - -bool wxFrameBase::IsOneOfBars(const wxWindow *win) const -{ -#if wxUSE_MENUS - if ( win == GetMenuBar() ) - return true; -#endif // wxUSE_MENUS - -#if wxUSE_STATUSBAR - if ( win == GetStatusBar() ) - return true; -#endif // wxUSE_STATUSBAR - -#if wxUSE_TOOLBAR - if ( win == GetToolBar() ) - return true; -#endif // wxUSE_TOOLBAR - - return false; -} - -// ---------------------------------------------------------------------------- -// wxFrame size management: we exclude the areas taken by menu/status/toolbars -// from the client area, so the client area is what's really available for the -// frame contents -// ---------------------------------------------------------------------------- - -// get the origin of the client area in the client coordinates -wxPoint wxFrameBase::GetClientAreaOrigin() const -{ - wxPoint pt = wxTopLevelWindow::GetClientAreaOrigin(); - -#if wxUSE_TOOLBAR && !defined(__WXUNIVERSAL__) - wxToolBar *toolbar = GetToolBar(); - if ( toolbar && toolbar->IsShown() ) - { - int w, h; - toolbar->GetSize(&w, &h); - - if ( toolbar->GetWindowStyleFlag() & wxTB_VERTICAL ) - { - pt.x += w; - } - else - { - pt.y += h; - } - } -#endif // wxUSE_TOOLBAR - - return pt; -} - - -void wxFrameBase::SendSizeEvent() -{ - const wxSize size = GetSize(); - wxSizeEvent event( size, GetId() ); - event.SetEventObject( this ); - GetEventHandler()->AddPendingEvent( event ); - -#ifdef __WXGTK__ - // SendSizeEvent is typically called when a toolbar is shown - // or hidden, but sending the size event alone is not enough - // to trigger a full layout. - ((wxFrame*)this)->GtkOnSize( -#ifndef __WXGTK20__ - 0, 0, size.x, size.y -#endif // __WXGTK20__ - ); -#endif // __WXGTK__ -} - - -// ---------------------------------------------------------------------------- -// misc -// ---------------------------------------------------------------------------- - -bool wxFrameBase::ProcessCommand(int id) -{ -#if wxUSE_MENUS - wxMenuBar *bar = GetMenuBar(); - if ( !bar ) - return false; - - wxCommandEvent commandEvent(wxEVT_COMMAND_MENU_SELECTED, id); - commandEvent.SetEventObject(this); - - wxMenuItem *item = bar->FindItem(id); - if (item) - { - if (!item->IsEnabled()) - return true; - - if ((item->GetKind() == wxITEM_RADIO) && item->IsChecked() ) - return true; - - if (item->IsCheckable()) - { - item->Toggle(); - - // use the new value - commandEvent.SetInt(item->IsChecked()); - } - } - - return GetEventHandler()->ProcessEvent(commandEvent); -#else // !wxUSE_MENUS - return false; -#endif // wxUSE_MENUS/!wxUSE_MENUS -} - -// Do the UI update processing for this window. This is -// provided for the application to call if it wants to -// force a UI update, particularly for the menus and toolbar. -void wxFrameBase::UpdateWindowUI(long flags) -{ - wxWindowBase::UpdateWindowUI(flags); - -#if wxUSE_TOOLBAR - if (GetToolBar()) - GetToolBar()->UpdateWindowUI(flags); -#endif - -#if wxUSE_MENUS - if (GetMenuBar()) - { - if ((flags & wxUPDATE_UI_FROMIDLE) && !wxUSE_IDLEMENUUPDATES) - { - // If coming from an idle event, we only - // want to update the menus if we're - // in the wxUSE_IDLEMENUUPDATES configuration: - // so if we're not, do nothing - } - else - DoMenuUpdates(); - } -#endif // wxUSE_MENUS -} - -// ---------------------------------------------------------------------------- -// event handlers for status bar updates from menus -// ---------------------------------------------------------------------------- - -#if wxUSE_MENUS && wxUSE_STATUSBAR - -void wxFrameBase::OnMenuHighlight(wxMenuEvent& event) -{ -#if wxUSE_STATUSBAR - (void)ShowMenuHelp(GetStatusBar(), event.GetMenuId()); -#endif // wxUSE_STATUSBAR -} - -#if !wxUSE_IDLEMENUUPDATES -void wxFrameBase::OnMenuOpen(wxMenuEvent& event) -#else -void wxFrameBase::OnMenuOpen(wxMenuEvent& WXUNUSED(event)) -#endif -{ -#if !wxUSE_IDLEMENUUPDATES - DoMenuUpdates(event.GetMenu()); -#endif // !wxUSE_IDLEMENUUPDATES -} - -void wxFrameBase::OnMenuClose(wxMenuEvent& WXUNUSED(event)) -{ - // do we have real status text to restore? - if ( !m_oldStatusText.empty() ) - { - if ( m_statusBarPane >= 0 ) - { - wxStatusBar *statbar = GetStatusBar(); - if ( statbar ) - statbar->SetStatusText(m_oldStatusText, m_statusBarPane); - } - - m_oldStatusText.clear(); - } -} - -#endif // wxUSE_MENUS && wxUSE_STATUSBAR - -// Implement internal behaviour (menu updating on some platforms) -void wxFrameBase::OnInternalIdle() -{ - wxTopLevelWindow::OnInternalIdle(); - -#if wxUSE_MENUS && wxUSE_IDLEMENUUPDATES - if (wxUpdateUIEvent::CanUpdate(this)) - DoMenuUpdates(); -#endif -} - -// ---------------------------------------------------------------------------- -// status bar stuff -// ---------------------------------------------------------------------------- - -#if wxUSE_STATUSBAR - -wxStatusBar* wxFrameBase::CreateStatusBar(int number, - long style, - wxWindowID id, - const wxString& name) -{ - // the main status bar can only be created once (or else it should be - // deleted before calling CreateStatusBar() again) - wxCHECK_MSG( !m_frameStatusBar, (wxStatusBar *)NULL, - wxT("recreating status bar in wxFrame") ); - - SetStatusBar(OnCreateStatusBar(number, style, id, name)); - - return m_frameStatusBar; -} - -wxStatusBar *wxFrameBase::OnCreateStatusBar(int number, - long style, - wxWindowID id, - const wxString& name) -{ - wxStatusBar *statusBar = new wxStatusBar(this, id, style, name); - - statusBar->SetFieldsCount(number); - - return statusBar; -} - -void wxFrameBase::SetStatusText(const wxString& text, int number) -{ - wxCHECK_RET( m_frameStatusBar != NULL, wxT("no statusbar to set text for") ); - - m_frameStatusBar->SetStatusText(text, number); -} - -void wxFrameBase::SetStatusWidths(int n, const int widths_field[] ) -{ - wxCHECK_RET( m_frameStatusBar != NULL, wxT("no statusbar to set widths for") ); - - m_frameStatusBar->SetStatusWidths(n, widths_field); - - PositionStatusBar(); -} - -void wxFrameBase::PushStatusText(const wxString& text, int number) -{ - wxCHECK_RET( m_frameStatusBar != NULL, wxT("no statusbar to set text for") ); - - m_frameStatusBar->PushStatusText(text, number); -} - -void wxFrameBase::PopStatusText(int number) -{ - wxCHECK_RET( m_frameStatusBar != NULL, wxT("no statusbar to set text for") ); - - m_frameStatusBar->PopStatusText(number); -} - -bool wxFrameBase::ShowMenuHelp(wxStatusBar *WXUNUSED(statbar), int menuId) -{ -#if wxUSE_MENUS - // if no help string found, we will clear the status bar text - wxString helpString; - bool show = menuId != wxID_SEPARATOR && menuId != -2 /* wxID_TITLE */; - - if ( show ) - { - wxMenuBar *menuBar = GetMenuBar(); - if ( menuBar ) - { - // it's ok if we don't find the item because it might belong - // to the popup menu - wxMenuItem *item = menuBar->FindItem(menuId); - if ( item ) - helpString = item->GetHelp(); - } - } - - DoGiveHelp(helpString, show); - - return !helpString.empty(); -#else // !wxUSE_MENUS - return false; -#endif // wxUSE_MENUS/!wxUSE_MENUS -} - -void wxFrameBase::SetStatusBar(wxStatusBar *statBar) -{ - bool hadBar = m_frameStatusBar != NULL; - m_frameStatusBar = statBar; - - if ( (m_frameStatusBar != NULL) != hadBar ) - { - PositionStatusBar(); - - DoLayout(); - } -} - -#endif // wxUSE_STATUSBAR - -#if wxUSE_MENUS || wxUSE_TOOLBAR -void wxFrameBase::DoGiveHelp(const wxString& text, bool show) -{ -#if wxUSE_STATUSBAR - if ( m_statusBarPane < 0 ) - { - // status bar messages disabled - return; - } - - wxStatusBar *statbar = GetStatusBar(); - if ( !statbar ) - return; - - wxString help; - if ( show ) - { - help = text; - - // remember the old status bar text if this is the first time we're - // called since the menu has been opened as we're going to overwrite it - // in our DoGiveHelp() and we want to restore it when the menu is - // closed - // - // note that it would be logical to do this in OnMenuOpen() but under - // MSW we get an EVT_MENU_HIGHLIGHT before EVT_MENU_OPEN, strangely - // enough, and so this doesn't work and instead we use the ugly trick - // with using special m_oldStatusText value as "menu opened" (but it is - // arguably better than adding yet another member variable to wxFrame - // on all platforms) - if ( m_oldStatusText.empty() ) - { - m_oldStatusText = statbar->GetStatusText(m_statusBarPane); - if ( m_oldStatusText.empty() ) - { - // use special value to prevent us from doing this the next time - m_oldStatusText += _T('\0'); - } - } - } - else // hide the status bar text - { - // i.e. restore the old one - help = m_oldStatusText; - - // make sure we get the up to date text when showing it the next time - m_oldStatusText.clear(); - } - - statbar->SetStatusText(help, m_statusBarPane); -#else - wxUnusedVar(text); - wxUnusedVar(show); -#endif // wxUSE_STATUSBAR -} -#endif // wxUSE_MENUS || wxUSE_TOOLBAR - - -// ---------------------------------------------------------------------------- -// toolbar stuff -// ---------------------------------------------------------------------------- - -#if wxUSE_TOOLBAR - -wxToolBar* wxFrameBase::CreateToolBar(long style, - wxWindowID id, - const wxString& name) -{ - // the main toolbar can't be recreated (unless it was explicitly deleted - // before) - wxCHECK_MSG( !m_frameToolBar, (wxToolBar *)NULL, - wxT("recreating toolbar in wxFrame") ); - - if ( style == -1 ) - { - // use default style - // - // NB: we don't specify the default value in the method declaration - // because - // a) this allows us to have different defaults for different - // platforms (even if we don't have them right now) - // b) we don't need to include wx/toolbar.h in the header then - style = wxBORDER_NONE | wxTB_HORIZONTAL | wxTB_FLAT; - } - - SetToolBar(OnCreateToolBar(style, id, name)); - - return m_frameToolBar; -} - -wxToolBar* wxFrameBase::OnCreateToolBar(long style, - wxWindowID id, - const wxString& name) -{ -#if defined(__WXWINCE__) && defined(__POCKETPC__) - return new wxToolMenuBar(this, id, - wxDefaultPosition, wxDefaultSize, - style, name); -#else - return new wxToolBar(this, id, - wxDefaultPosition, wxDefaultSize, - style, name); -#endif -} - -void wxFrameBase::SetToolBar(wxToolBar *toolbar) -{ - bool hadBar = m_frameToolBar != NULL; - m_frameToolBar = toolbar; - - if ( (m_frameToolBar != NULL) != hadBar ) - { - PositionToolBar(); - - DoLayout(); - } -} - -#endif // wxUSE_TOOLBAR - -// ---------------------------------------------------------------------------- -// menus -// ---------------------------------------------------------------------------- - -#if wxUSE_MENUS - -// update all menus -void wxFrameBase::DoMenuUpdates(wxMenu* menu) -{ - if (menu) - { - wxEvtHandler* source = GetEventHandler(); - menu->UpdateUI(source); - } - else - { - wxMenuBar* bar = GetMenuBar(); - if (bar != NULL) - bar->UpdateMenus(); - } -} - -void wxFrameBase::DetachMenuBar() -{ - if ( m_frameMenuBar ) - { - m_frameMenuBar->Detach(); - m_frameMenuBar = NULL; - } -} - -void wxFrameBase::AttachMenuBar(wxMenuBar *menubar) -{ - if ( menubar ) - { - menubar->Attach((wxFrame *)this); - m_frameMenuBar = menubar; - } -} - -void wxFrameBase::SetMenuBar(wxMenuBar *menubar) -{ - if ( menubar == GetMenuBar() ) - { - // nothing to do - return; - } - - DetachMenuBar(); - - this->AttachMenuBar(menubar); -} - -#endif // wxUSE_MENUS diff --git a/wxWidgets/src/common/fs_arc.cpp b/wxWidgets/src/common/fs_arc.cpp deleted file mode 100644 index ee1220cfc2..0000000000 --- a/wxWidgets/src/common/fs_arc.cpp +++ /dev/null @@ -1,533 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: fs_arc.cpp -// Purpose: wxArchive file system -// Author: Vaclav Slavik, Mike Wetherell -// Copyright: (c) 1999 Vaclav Slavik, (c) 2006 Mike Wetherell -// CVS-ID: $Id: fs_arc.cpp 51495 2008-02-01 16:44:56Z MW $ -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ -#pragma hdrstop -#endif - -#if wxUSE_FS_ARCHIVE - -#include "wx/fs_arc.h" - -#ifndef WXPRECOMP - #include "wx/intl.h" - #include "wx/log.h" -#endif - -#if WXWIN_COMPATIBILITY_2_6 && wxUSE_ZIPSTREAM - #include "wx/zipstrm.h" -#else - #include "wx/archive.h" -#endif - -#include "wx/private/fileback.h" - -//--------------------------------------------------------------------------- -// wxArchiveFSCacheDataImpl -// -// Holds the catalog of an archive file, and if it is being read from a -// non-seekable stream, a copy of its backing file. -// -// This class is actually the reference counted implementation for the -// wxArchiveFSCacheData class below. It was done that way to allow sharing -// between instances of wxFileSystem, though that's a feature not used in this -// version. -//--------------------------------------------------------------------------- - -WX_DECLARE_STRING_HASH_MAP(wxArchiveEntry*, wxArchiveFSEntryHash); - -struct wxArchiveFSEntry -{ - wxArchiveEntry *entry; - wxArchiveFSEntry *next; -}; - -class wxArchiveFSCacheDataImpl -{ -public: - wxArchiveFSCacheDataImpl(const wxArchiveClassFactory& factory, - const wxBackingFile& backer); - wxArchiveFSCacheDataImpl(const wxArchiveClassFactory& factory, - wxInputStream *stream); - - ~wxArchiveFSCacheDataImpl(); - - void Release() { if (--m_refcount == 0) delete this; } - wxArchiveFSCacheDataImpl *AddRef() { m_refcount++; return this; } - - wxArchiveEntry *Get(const wxString& name); - wxInputStream *NewStream() const; - - wxArchiveFSEntry *GetNext(wxArchiveFSEntry *fse); - -private: - wxArchiveFSEntry *AddToCache(wxArchiveEntry *entry); - void CloseStreams(); - - int m_refcount; - - wxArchiveFSEntryHash m_hash; - wxArchiveFSEntry *m_begin; - wxArchiveFSEntry **m_endptr; - - wxBackingFile m_backer; - wxInputStream *m_stream; - wxArchiveInputStream *m_archive; -}; - -wxArchiveFSCacheDataImpl::wxArchiveFSCacheDataImpl( - const wxArchiveClassFactory& factory, - const wxBackingFile& backer) - : m_refcount(1), - m_begin(NULL), - m_endptr(&m_begin), - m_backer(backer), - m_stream(new wxBackedInputStream(backer)), - m_archive(factory.NewStream(*m_stream)) -{ -} - -wxArchiveFSCacheDataImpl::wxArchiveFSCacheDataImpl( - const wxArchiveClassFactory& factory, - wxInputStream *stream) - : m_refcount(1), - m_begin(NULL), - m_endptr(&m_begin), - m_stream(stream), - m_archive(factory.NewStream(*m_stream)) -{ -} - -wxArchiveFSCacheDataImpl::~wxArchiveFSCacheDataImpl() -{ - WX_CLEAR_HASH_MAP(wxArchiveFSEntryHash, m_hash); - - wxArchiveFSEntry *entry = m_begin; - - while (entry) - { - wxArchiveFSEntry *next = entry->next; - delete entry; - entry = next; - } - - CloseStreams(); -} - -wxArchiveFSEntry *wxArchiveFSCacheDataImpl::AddToCache(wxArchiveEntry *entry) -{ - m_hash[entry->GetName(wxPATH_UNIX)] = entry; - wxArchiveFSEntry *fse = new wxArchiveFSEntry; - *m_endptr = fse; - (*m_endptr)->entry = entry; - (*m_endptr)->next = NULL; - m_endptr = &(*m_endptr)->next; - return fse; -} - -void wxArchiveFSCacheDataImpl::CloseStreams() -{ - delete m_archive; - m_archive = NULL; - delete m_stream; - m_stream = NULL; -} - -wxArchiveEntry *wxArchiveFSCacheDataImpl::Get(const wxString& name) -{ - wxArchiveFSEntryHash::iterator it = m_hash.find(name); - - if (it != m_hash.end()) - return it->second; - - if (!m_archive) - return NULL; - - wxArchiveEntry *entry; - - while ((entry = m_archive->GetNextEntry()) != NULL) - { - AddToCache(entry); - - if (entry->GetName(wxPATH_UNIX) == name) - return entry; - } - - CloseStreams(); - - return NULL; -} - -wxInputStream* wxArchiveFSCacheDataImpl::NewStream() const -{ - if (m_backer) - return new wxBackedInputStream(m_backer); - else - return NULL; -} - -wxArchiveFSEntry *wxArchiveFSCacheDataImpl::GetNext(wxArchiveFSEntry *fse) -{ - wxArchiveFSEntry *next = fse ? fse->next : m_begin; - - if (!next && m_archive) - { - wxArchiveEntry *entry = m_archive->GetNextEntry(); - - if (entry) - next = AddToCache(entry); - else - CloseStreams(); - } - - return next; -} - -//--------------------------------------------------------------------------- -// wxArchiveFSCacheData -// -// This is the inteface for wxArchiveFSCacheDataImpl above. Holds the catalog -// of an archive file, and if it is being read from a non-seekable stream, a -// copy of its backing file. -//--------------------------------------------------------------------------- - -class wxArchiveFSCacheData -{ -public: - wxArchiveFSCacheData() : m_impl(NULL) { } - wxArchiveFSCacheData(const wxArchiveClassFactory& factory, - const wxBackingFile& backer); - wxArchiveFSCacheData(const wxArchiveClassFactory& factory, - wxInputStream *stream); - - wxArchiveFSCacheData(const wxArchiveFSCacheData& data); - wxArchiveFSCacheData& operator=(const wxArchiveFSCacheData& data); - - ~wxArchiveFSCacheData() { if (m_impl) m_impl->Release(); } - - wxArchiveEntry *Get(const wxString& name) { return m_impl->Get(name); } - wxInputStream *NewStream() const { return m_impl->NewStream(); } - wxArchiveFSEntry *GetNext(wxArchiveFSEntry *fse) - { return m_impl->GetNext(fse); } - -private: - wxArchiveFSCacheDataImpl *m_impl; -}; - -wxArchiveFSCacheData::wxArchiveFSCacheData( - const wxArchiveClassFactory& factory, - const wxBackingFile& backer) - : m_impl(new wxArchiveFSCacheDataImpl(factory, backer)) -{ -} - -wxArchiveFSCacheData::wxArchiveFSCacheData( - const wxArchiveClassFactory& factory, - wxInputStream *stream) - : m_impl(new wxArchiveFSCacheDataImpl(factory, stream)) -{ -} - -wxArchiveFSCacheData::wxArchiveFSCacheData(const wxArchiveFSCacheData& data) - : m_impl(data.m_impl ? data.m_impl->AddRef() : NULL) -{ -} - -wxArchiveFSCacheData& wxArchiveFSCacheData::operator=( - const wxArchiveFSCacheData& data) -{ - if (data.m_impl != m_impl) - { - if (m_impl) - m_impl->Release(); - - m_impl = data.m_impl; - - if (m_impl) - m_impl->AddRef(); - } - - return *this; -} - -//--------------------------------------------------------------------------- -// wxArchiveFSCache -// -// wxArchiveFSCacheData caches a single archive, and this class holds a -// collection of them to cache all the archives accessed by this instance -// of wxFileSystem. -//--------------------------------------------------------------------------- - -WX_DECLARE_STRING_HASH_MAP(wxArchiveFSCacheData, wxArchiveFSCacheDataHash); - -class wxArchiveFSCache -{ -public: - wxArchiveFSCache() { } - ~wxArchiveFSCache() { } - - wxArchiveFSCacheData* Add(const wxString& name, - const wxArchiveClassFactory& factory, - wxInputStream *stream); - - wxArchiveFSCacheData *Get(const wxString& name); - -private: - wxArchiveFSCacheDataHash m_hash; -}; - -wxArchiveFSCacheData* wxArchiveFSCache::Add( - const wxString& name, - const wxArchiveClassFactory& factory, - wxInputStream *stream) -{ - wxArchiveFSCacheData& data = m_hash[name]; - - if (stream->IsSeekable()) - data = wxArchiveFSCacheData(factory, stream); - else - data = wxArchiveFSCacheData(factory, wxBackingFile(stream)); - - return &data; -} - -wxArchiveFSCacheData *wxArchiveFSCache::Get(const wxString& name) -{ - wxArchiveFSCacheDataHash::iterator it; - - if ((it = m_hash.find(name)) != m_hash.end()) - return &it->second; - - return NULL; -} - -//---------------------------------------------------------------------------- -// wxArchiveFSHandler -//---------------------------------------------------------------------------- - -IMPLEMENT_DYNAMIC_CLASS(wxArchiveFSHandler, wxFileSystemHandler) - -wxArchiveFSHandler::wxArchiveFSHandler() - : wxFileSystemHandler() -{ - m_Archive = NULL; - m_FindEntry = NULL; - m_ZipFile = m_Pattern = m_BaseDir = wxEmptyString; - m_AllowDirs = m_AllowFiles = true; - m_DirsFound = NULL; - m_cache = NULL; -} - -wxArchiveFSHandler::~wxArchiveFSHandler() -{ - Cleanup(); - delete m_cache; -} - -void wxArchiveFSHandler::Cleanup() -{ - wxDELETE(m_DirsFound); -} - -bool wxArchiveFSHandler::CanOpen(const wxString& location) -{ - wxString p = GetProtocol(location); - return wxArchiveClassFactory::Find(p) != NULL; -} - -wxFSFile* wxArchiveFSHandler::OpenFile( - wxFileSystem& WXUNUSED(fs), - const wxString& location) -{ - wxString right = GetRightLocation(location); - wxString left = GetLeftLocation(location); - wxString protocol = GetProtocol(location); - wxString key = left + wxT("#") + protocol + wxT(":"); - - if (right.Contains(wxT("./"))) - { - if (right.GetChar(0) != wxT('/')) right = wxT('/') + right; - wxFileName rightPart(right, wxPATH_UNIX); - rightPart.Normalize(wxPATH_NORM_DOTS, wxT("/"), wxPATH_UNIX); - right = rightPart.GetFullPath(wxPATH_UNIX); - } - - if (right.GetChar(0) == wxT('/')) right = right.Mid(1); - - if (!m_cache) - m_cache = new wxArchiveFSCache; - - const wxArchiveClassFactory *factory; - factory = wxArchiveClassFactory::Find(protocol); - if (!factory) - return NULL; - - wxArchiveFSCacheData *cached = m_cache->Get(key); - if (!cached) - { - wxFSFile *leftFile = m_fs.OpenFile(left); - if (!leftFile) - return NULL; - cached = m_cache->Add(key, *factory, leftFile->DetachStream()); - delete leftFile; - } - - wxArchiveEntry *entry = cached->Get(right); - if (!entry) - return NULL; - - wxInputStream *leftStream = cached->NewStream(); - if (!leftStream) - { - wxFSFile *leftFile = m_fs.OpenFile(left); - if (!leftFile) - return NULL; - leftStream = leftFile->DetachStream(); - delete leftFile; - } - - wxArchiveInputStream *s = factory->NewStream(leftStream); - s->OpenEntry(*entry); - - if (s && s->IsOk()) - { -#if WXWIN_COMPATIBILITY_2_6 && wxUSE_ZIPSTREAM - if (factory->IsKindOf(CLASSINFO(wxZipClassFactory))) - ((wxZipInputStream*)s)->m_allowSeeking = true; -#endif // WXWIN_COMPATIBILITY_2_6 - - return new wxFSFile(s, - key + right, - GetMimeTypeFromExt(location), - GetAnchor(location) -#if wxUSE_DATETIME - , entry->GetDateTime() -#endif // wxUSE_DATETIME - ); - } - - delete s; - return NULL; -} - -wxString wxArchiveFSHandler::FindFirst(const wxString& spec, int flags) -{ - wxString right = GetRightLocation(spec); - wxString left = GetLeftLocation(spec); - wxString protocol = GetProtocol(spec); - wxString key = left + wxT("#") + protocol + wxT(":"); - - if (!right.empty() && right.Last() == wxT('/')) right.RemoveLast(); - - if (!m_cache) - m_cache = new wxArchiveFSCache; - - const wxArchiveClassFactory *factory; - factory = wxArchiveClassFactory::Find(protocol); - if (!factory) - return wxEmptyString; - - m_Archive = m_cache->Get(key); - if (!m_Archive) - { - wxFSFile *leftFile = m_fs.OpenFile(left); - if (!leftFile) - return wxEmptyString; - m_Archive = m_cache->Add(key, *factory, leftFile->DetachStream()); - delete leftFile; - } - - m_FindEntry = NULL; - - switch (flags) - { - case wxFILE: - m_AllowDirs = false, m_AllowFiles = true; break; - case wxDIR: - m_AllowDirs = true, m_AllowFiles = false; break; - default: - m_AllowDirs = m_AllowFiles = true; break; - } - - m_ZipFile = key; - - m_Pattern = right.AfterLast(wxT('/')); - m_BaseDir = right.BeforeLast(wxT('/')); - if (m_BaseDir.StartsWith(wxT("/"))) - m_BaseDir = m_BaseDir.Mid(1); - - if (m_Archive) - { - if (m_AllowDirs) - { - delete m_DirsFound; - m_DirsFound = new wxArchiveFilenameHashMap(); - if (right.empty()) // allow "/" to match the archive root - return spec; - } - return DoFind(); - } - return wxEmptyString; -} - -wxString wxArchiveFSHandler::FindNext() -{ - if (!m_Archive) return wxEmptyString; - return DoFind(); -} - -wxString wxArchiveFSHandler::DoFind() -{ - wxString namestr, dir, filename; - wxString match = wxEmptyString; - - while (match == wxEmptyString) - { - m_FindEntry = m_Archive->GetNext(m_FindEntry); - - if (!m_FindEntry) - { - m_Archive = NULL; - m_FindEntry = NULL; - break; - } - namestr = m_FindEntry->entry->GetName(wxPATH_UNIX); - - if (m_AllowDirs) - { - dir = namestr.BeforeLast(wxT('/')); - while (!dir.empty()) - { - if( m_DirsFound->find(dir) == m_DirsFound->end() ) - { - (*m_DirsFound)[dir] = 1; - filename = dir.AfterLast(wxT('/')); - dir = dir.BeforeLast(wxT('/')); - if (!filename.empty() && m_BaseDir == dir && - wxMatchWild(m_Pattern, filename, false)) - match = m_ZipFile + dir + wxT("/") + filename; - } - else - break; // already tranversed - } - } - - filename = namestr.AfterLast(wxT('/')); - dir = namestr.BeforeLast(wxT('/')); - if (m_AllowFiles && !filename.empty() && m_BaseDir == dir && - wxMatchWild(m_Pattern, filename, false)) - match = m_ZipFile + namestr; - } - - return match; -} - -#endif // wxUSE_FS_ARCHIVE diff --git a/wxWidgets/src/common/fs_filter.cpp b/wxWidgets/src/common/fs_filter.cpp deleted file mode 100644 index d0fae32ba4..0000000000 --- a/wxWidgets/src/common/fs_filter.cpp +++ /dev/null @@ -1,92 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/common/fs_filter.cpp -// Purpose: wxFilter file system handler -// Author: Mike Wetherell -// Copyright: (c) 2006 Mike Wetherell -// CVS-ID: $Id: fs_filter.cpp 42514 2006-10-27 10:47:13Z MW $ -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_FILESYSTEM - -#include "wx/fs_filter.h" - -#ifndef WXPRECOMP -#endif - -#include "wx/ptr_scpd.h" - -wxDEFINE_SCOPED_PTR_TYPE(wxFSFile) -wxDEFINE_SCOPED_PTR_TYPE(wxInputStream) - -//---------------------------------------------------------------------------- -// wxFilterFSHandler -//---------------------------------------------------------------------------- - -bool wxFilterFSHandler::CanOpen(const wxString& location) -{ - return wxFilterClassFactory::Find(GetProtocol(location)) != NULL; -} - -wxFSFile* wxFilterFSHandler::OpenFile( - wxFileSystem& fs, - const wxString& location) -{ - wxString right = GetRightLocation(location); - if (!right.empty()) - return NULL; - - wxString protocol = GetProtocol(location); - const wxFilterClassFactory *factory = wxFilterClassFactory::Find(protocol); - if (!factory) - return NULL; - - wxString left = GetLeftLocation(location); - wxFSFilePtr leftFile(fs.OpenFile(left)); - if (!leftFile.get()) - return NULL; - - wxInputStreamPtr leftStream(leftFile->DetachStream()); - if (!leftStream.get() || !leftStream->IsOk()) - return NULL; - - wxInputStreamPtr stream(factory->NewStream(leftStream.release())); - - // The way compressed streams are supposed to be served is e.g.: - // Content-type: application/postscript - // Content-encoding: gzip - // So the mime type should be just the mime type of the lhs. However check - // whether the mime type is that of this compression format (e.g. - // application/gzip). If so pop any extension and try GetMimeTypeFromExt, - // e.g. if it were '.ps.gz' pop the '.gz' and try looking up '.ps' - wxString mime = leftFile->GetMimeType(); - if (factory->CanHandle(mime, wxSTREAM_MIMETYPE)) - mime = GetMimeTypeFromExt(factory->PopExtension(left)); - - return new wxFSFile(stream.release(), - left + wxT("#") + protocol + wxT(":") + right, - mime, - GetAnchor(location) -#if wxUSE_DATETIME - , leftFile->GetModificationTime() -#endif // wxUSE_DATETIME - ); -} - -wxString wxFilterFSHandler::FindFirst(const wxString& WXUNUSED(spec), int WXUNUSED(flags)) -{ - return wxEmptyString; -} - -wxString wxFilterFSHandler::FindNext() -{ - return wxEmptyString; -} - -#endif //wxUSE_FILESYSTEM diff --git a/wxWidgets/src/common/fs_inet.cpp b/wxWidgets/src/common/fs_inet.cpp deleted file mode 100644 index 6bcb1cf4b7..0000000000 --- a/wxWidgets/src/common/fs_inet.cpp +++ /dev/null @@ -1,167 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/common/fs_inet.cpp -// Purpose: HTTP and FTP file system -// Author: Vaclav Slavik -// Copyright: (c) 1999 Vaclav Slavik -// RCS-ID: $Id: fs_inet.cpp 41033 2006-09-06 13:49:42Z RR $ -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if !wxUSE_SOCKETS - #undef wxUSE_FS_INET - #define wxUSE_FS_INET 0 -#endif - -#if wxUSE_FILESYSTEM && wxUSE_FS_INET - -#ifndef WXPRECOMP - #include "wx/module.h" -#endif - -#include "wx/wfstream.h" -#include "wx/url.h" -#include "wx/filesys.h" -#include "wx/fs_inet.h" - -// ---------------------------------------------------------------------------- -// Helper classes -// ---------------------------------------------------------------------------- - -// This stream deletes the file when destroyed -class wxTemporaryFileInputStream : public wxFileInputStream -{ -public: - wxTemporaryFileInputStream(const wxString& filename) : - wxFileInputStream(filename), m_filename(filename) {} - - virtual ~wxTemporaryFileInputStream() - { - // NB: copied from wxFileInputStream dtor, we need to do it before - // wxRemoveFile - if (m_file_destroy) - { - delete m_file; - m_file_destroy = false; - } - wxRemoveFile(m_filename); - } - -protected: - wxString m_filename; -}; - - -// ---------------------------------------------------------------------------- -// wxInternetFSHandler -// ---------------------------------------------------------------------------- - -static wxString StripProtocolAnchor(const wxString& location) -{ - wxString myloc(location.BeforeLast(wxT('#'))); - if (myloc.empty()) myloc = location.AfterFirst(wxT(':')); - else myloc = myloc.AfterFirst(wxT(':')); - - // fix malformed url: - if (!myloc.Left(2).IsSameAs(wxT("//"))) - { - if (myloc.GetChar(0) != wxT('/')) myloc = wxT("//") + myloc; - else myloc = wxT("/") + myloc; - } - if (myloc.Mid(2).Find(wxT('/')) == wxNOT_FOUND) myloc << wxT('/'); - - return myloc; -} - - -bool wxInternetFSHandler::CanOpen(const wxString& location) -{ -#if wxUSE_URL - wxString p = GetProtocol(location); - if ((p == wxT("http")) || (p == wxT("ftp"))) - { - wxURL url(p + wxT(":") + StripProtocolAnchor(location)); - return (url.GetError() == wxURL_NOERR); - } -#endif - return false; -} - - -wxFSFile* wxInternetFSHandler::OpenFile(wxFileSystem& WXUNUSED(fs), - const wxString& location) -{ -#if !wxUSE_URL - return NULL; -#else - wxString right = - GetProtocol(location) + wxT(":") + StripProtocolAnchor(location); - - wxURL url(right); - if (url.GetError() == wxURL_NOERR) - { - wxInputStream *s = url.GetInputStream(); - wxString content = url.GetProtocol().GetContentType(); - if (content == wxEmptyString) content = GetMimeTypeFromExt(location); - if (s) - { - wxString tmpfile = - wxFileName::CreateTempFileName(wxT("wxhtml")); - - { // now copy streams content to temporary file: - wxFileOutputStream sout(tmpfile); - s->Read(sout); - } - delete s; - - return new wxFSFile(new wxTemporaryFileInputStream(tmpfile), - right, - content, - GetAnchor(location) -#if wxUSE_DATETIME - , wxDateTime::Now() -#endif // wxUSE_DATETIME - ); - } - } - - return (wxFSFile*) NULL; // incorrect URL -#endif -} - - -class wxFileSystemInternetModule : public wxModule -{ - DECLARE_DYNAMIC_CLASS(wxFileSystemInternetModule) - - public: - wxFileSystemInternetModule() : - wxModule(), - m_handler(NULL) - { - } - - virtual bool OnInit() - { - m_handler = new wxInternetFSHandler; - wxFileSystem::AddHandler(m_handler); - return true; - } - - virtual void OnExit() - { - delete wxFileSystem::RemoveHandler(m_handler); - } - - private: - wxFileSystemHandler* m_handler; -}; - -IMPLEMENT_DYNAMIC_CLASS(wxFileSystemInternetModule, wxModule) - -#endif // wxUSE_FILESYSTEM && wxUSE_FS_INET diff --git a/wxWidgets/src/common/fs_mem.cpp b/wxWidgets/src/common/fs_mem.cpp deleted file mode 100644 index 3bf24969e3..0000000000 --- a/wxWidgets/src/common/fs_mem.cpp +++ /dev/null @@ -1,288 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/common/fs_mem.cpp -// Purpose: in-memory file system -// Author: Vaclav Slavik -// RCS-ID: $Id: fs_mem.cpp 46522 2007-06-18 18:37:40Z VS $ -// Copyright: (c) 2000 Vaclav Slavik -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_FILESYSTEM && wxUSE_STREAMS - -#include "wx/fs_mem.h" - -#ifndef WXPRECOMP - #include "wx/intl.h" - #include "wx/log.h" - #include "wx/hash.h" - #if wxUSE_GUI - #include "wx/bitmap.h" - #include "wx/image.h" - #endif // wxUSE_GUI -#endif - -#include "wx/mstream.h" - -class MemFSHashObj : public wxObject -{ - public: - - MemFSHashObj(const void *data, size_t len, const wxString& mime) - { - m_Data = new char[len]; - memcpy(m_Data, data, len); - m_Len = len; - m_MimeType = mime; - InitTime(); - } - - MemFSHashObj(const wxMemoryOutputStream& stream, const wxString& mime) - { - m_Len = stream.GetSize(); - m_Data = new char[m_Len]; - stream.CopyTo(m_Data, m_Len); - m_MimeType = mime; - InitTime(); - } - - virtual ~MemFSHashObj() - { - delete[] m_Data; - } - - char *m_Data; - size_t m_Len; - wxString m_MimeType; -#if wxUSE_DATETIME - wxDateTime m_Time; -#endif // wxUSE_DATETIME - - DECLARE_NO_COPY_CLASS(MemFSHashObj) - - private: - void InitTime() - { -#if wxUSE_DATETIME - m_Time = wxDateTime::Now(); -#endif // wxUSE_DATETIME - } -}; - -#if wxUSE_BASE - - -//-------------------------------------------------------------------------------- -// wxMemoryFSHandler -//-------------------------------------------------------------------------------- - - -wxHashTable *wxMemoryFSHandlerBase::m_Hash = NULL; - - -wxMemoryFSHandlerBase::wxMemoryFSHandlerBase() : wxFileSystemHandler() -{ -} - - - -wxMemoryFSHandlerBase::~wxMemoryFSHandlerBase() -{ - // as only one copy of FS handler is supposed to exist, we may silently - // delete static data here. (There is no way how to remove FS handler from - // wxFileSystem other than releasing _all_ handlers.) - - if (m_Hash) - { - WX_CLEAR_HASH_TABLE(*m_Hash); - delete m_Hash; - m_Hash = NULL; - } -} - - - -bool wxMemoryFSHandlerBase::CanOpen(const wxString& location) -{ - wxString p = GetProtocol(location); - return (p == wxT("memory")); -} - - - - -wxFSFile* wxMemoryFSHandlerBase::OpenFile(wxFileSystem& WXUNUSED(fs), const wxString& location) -{ - if (m_Hash) - { - MemFSHashObj *obj = (MemFSHashObj*) m_Hash -> Get(GetRightLocation(location)); - if (obj == NULL) - { - return NULL; - } - else - { - wxString mime = obj->m_MimeType; - if ( mime.empty() ) - mime = GetMimeTypeFromExt(location); - return new wxFSFile - ( - new wxMemoryInputStream(obj -> m_Data, obj -> m_Len), - location, - mime, - GetAnchor(location) -#if wxUSE_DATETIME - , obj -> m_Time -#endif // wxUSE_DATETIME - ); - } - } - else return NULL; -} - - - -wxString wxMemoryFSHandlerBase::FindFirst(const wxString& WXUNUSED(spec), - int WXUNUSED(flags)) -{ - wxFAIL_MSG(wxT("wxMemoryFSHandlerBase::FindFirst not implemented")); - - return wxEmptyString; -} - - - -wxString wxMemoryFSHandlerBase::FindNext() -{ - wxFAIL_MSG(wxT("wxMemoryFSHandlerBase::FindNext not implemented")); - - return wxEmptyString; -} - - -bool wxMemoryFSHandlerBase::CheckHash(const wxString& filename) -{ - if (m_Hash == NULL) - { - m_Hash = new wxHashTable(wxKEY_STRING); - } - - if (m_Hash -> Get(filename) != NULL) - { - wxString s; - s.Printf(_("Memory VFS already contains file '%s'!"), filename.c_str()); - wxLogError(s); - return false; - } - else - return true; -} - - -/*static*/ -void wxMemoryFSHandlerBase::AddFileWithMimeType(const wxString& filename, - const wxString& textdata, - const wxString& mimetype) -{ - AddFileWithMimeType(filename, - (const void*) textdata.mb_str(), textdata.length(), - mimetype); -} - - -/*static*/ -void wxMemoryFSHandlerBase::AddFileWithMimeType(const wxString& filename, - const void *binarydata, size_t size, - const wxString& mimetype) -{ - if (!CheckHash(filename)) return; - m_Hash -> Put(filename, new MemFSHashObj(binarydata, size, mimetype)); -} - -/*static*/ -void wxMemoryFSHandlerBase::AddFile(const wxString& filename, - const wxString& textdata) -{ - AddFileWithMimeType(filename, textdata, wxEmptyString); -} - - -/*static*/ -void wxMemoryFSHandlerBase::AddFile(const wxString& filename, - const void *binarydata, size_t size) -{ - AddFileWithMimeType(filename, binarydata, size, wxEmptyString); -} - - - -/*static*/ void wxMemoryFSHandlerBase::RemoveFile(const wxString& filename) -{ - if (m_Hash == NULL || - m_Hash -> Get(filename) == NULL) - { - wxString s; - s.Printf(_("Trying to remove file '%s' from memory VFS, but it is not loaded!"), filename.c_str()); - wxLogError(s); - } - - else - delete m_Hash -> Delete(filename); -} - -#endif // wxUSE_BASE - -#if wxUSE_GUI - -#if wxUSE_IMAGE -/*static*/ void -wxMemoryFSHandler::AddFile(const wxString& filename, - const wxImage& image, - long type) -{ - if (!CheckHash(filename)) return; - - wxMemoryOutputStream mems; - if (image.Ok() && image.SaveFile(mems, (int)type)) - { - m_Hash->Put - ( - filename, - new MemFSHashObj - ( - mems, - wxImage::FindHandler(type)->GetMimeType() - ) - ); - } - else - { - wxString s; - s.Printf(_("Failed to store image '%s' to memory VFS!"), filename.c_str()); - wxPrintf(wxT("'%s'\n"), s.c_str()); - wxLogError(s); - } -} - -/*static*/ void -wxMemoryFSHandler::AddFile(const wxString& filename, - const wxBitmap& bitmap, - long type) -{ -#if !defined(__WXMSW__) || wxUSE_WXDIB - wxImage img = bitmap.ConvertToImage(); - AddFile(filename, img, type); -#endif -} - -#endif // wxUSE_IMAGE - -#endif // wxUSE_GUI - - -#endif // wxUSE_FILESYSTEM && wxUSE_FS_ZIP diff --git a/wxWidgets/src/common/ftp.cpp b/wxWidgets/src/common/ftp.cpp deleted file mode 100644 index 0878f90d0e..0000000000 --- a/wxWidgets/src/common/ftp.cpp +++ /dev/null @@ -1,1008 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: common/ftp.cpp -// Purpose: FTP protocol -// Author: Guilhem Lavaux -// Modified by: Mark Johnson, wxWindows@mj10777.de -// 20000917 : RmDir, GetLastResult, GetList -// Vadim Zeitlin (numerous fixes and rewrites to all part of the -// code, support ASCII/Binary modes, better error reporting, more -// robust Abort(), support for arbitrary FTP commands, ...) -// Randall Fox (support for active mode) -// Created: 07/07/1997 -// RCS-ID: $Id: ftp.cpp 47969 2007-08-08 23:34:14Z VZ $ -// Copyright: (c) 1997, 1998 Guilhem Lavaux -// (c) 1998-2004 wxWidgets team -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_PROTOCOL_FTP - -#ifndef WX_PRECOMP - #include - #include "wx/string.h" - #include "wx/utils.h" - #include "wx/log.h" - #include "wx/intl.h" -#endif // WX_PRECOMP - -#include "wx/sckaddr.h" -#include "wx/socket.h" -#include "wx/url.h" -#include "wx/sckstrm.h" -#include "wx/protocol/protocol.h" -#include "wx/protocol/ftp.h" - -#if defined(__WXMAC__) - #include "wx/mac/macsock.h" -#endif - -#ifndef __MWERKS__ - #include -#endif - -// ---------------------------------------------------------------------------- -// constants -// ---------------------------------------------------------------------------- - -// the length of FTP status code (3 digits) -static const size_t LEN_CODE = 3; - -// ---------------------------------------------------------------------------- -// macros -// ---------------------------------------------------------------------------- - -IMPLEMENT_DYNAMIC_CLASS(wxFTP, wxProtocol) -IMPLEMENT_PROTOCOL(wxFTP, wxT("ftp"), wxT("ftp"), true) - -// ============================================================================ -// implementation -// ============================================================================ - -// ---------------------------------------------------------------------------- -// wxFTP constructor and destructor -// ---------------------------------------------------------------------------- - -wxFTP::wxFTP() -{ - m_lastError = wxPROTO_NOERR; - m_streaming = false; - m_currentTransfermode = NONE; - - m_user = wxT("anonymous"); - m_passwd << wxGetUserId() << wxT('@') << wxGetFullHostName(); - - SetNotify(0); - SetFlags(wxSOCKET_NOWAIT); - m_bPassive = true; - SetDefaultTimeout(60); // Default is Sixty Seconds - m_bEncounteredError = false; -} - -wxFTP::~wxFTP() -{ - if ( m_streaming ) - { - // if we are streaming, this will issue - // an FTP ABORT command, to tell the server we are aborting - (void)Abort(); - } - - // now this issues a "QUIT" command to tell the server we are - Close(); -} - -// ---------------------------------------------------------------------------- -// wxFTP connect and login methods -// ---------------------------------------------------------------------------- - -bool wxFTP::Connect(wxSockAddress& addr, bool WXUNUSED(wait)) -{ - if ( !wxProtocol::Connect(addr) ) - { - m_lastError = wxPROTO_NETERR; - return false; - } - - if ( !m_user ) - { - m_lastError = wxPROTO_CONNERR; - return false; - } - - // we should have 220 welcome message - if ( !CheckResult('2') ) - { - Close(); - return false; - } - - wxString command; - command.Printf(wxT("USER %s"), m_user.c_str()); - char rc = SendCommand(command); - if ( rc == '2' ) - { - // 230 return: user accepted without password - return true; - } - - if ( rc != '3' ) - { - Close(); - return false; - } - - command.Printf(wxT("PASS %s"), m_passwd.c_str()); - if ( !CheckCommand(command, '2') ) - { - Close(); - return false; - } - - return true; -} - -bool wxFTP::Connect(const wxString& host) -{ - wxIPV4address addr; - addr.Hostname(host); - addr.Service(wxT("ftp")); - - return Connect(addr); -} - -bool wxFTP::Close() -{ - if ( m_streaming ) - { - m_lastError = wxPROTO_STREAMING; - return false; - } - - if ( IsConnected() ) - { - if ( !CheckCommand(wxT("QUIT"), '2') ) - { - wxLogDebug(_T("Failed to close connection gracefully.")); - } - } - - return wxSocketClient::Close(); -} - -// ============================================================================ -// low level methods -// ============================================================================ - -// ---------------------------------------------------------------------------- -// Send command to FTP server -// ---------------------------------------------------------------------------- - -char wxFTP::SendCommand(const wxString& command) -{ - if ( m_streaming ) - { - m_lastError = wxPROTO_STREAMING; - return 0; - } - - wxString tmp_str = command + wxT("\r\n"); - const wxWX2MBbuf tmp_buf = tmp_str.mb_str(); - if ( Write(wxMBSTRINGCAST tmp_buf, strlen(tmp_buf)).Error()) - { - m_lastError = wxPROTO_NETERR; - return 0; - } - -#ifdef __WXDEBUG__ - // don't show the passwords in the logs (even in debug ones) - wxString cmd, password; - if ( command.Upper().StartsWith(_T("PASS "), &password) ) - { - cmd << _T("PASS ") << wxString(_T('*'), password.length()); - } - else - { - cmd = command; - } - - wxLogTrace(FTP_TRACE_MASK, _T("==> %s"), cmd.c_str()); -#endif // __WXDEBUG__ - - return GetResult(); -} - -// ---------------------------------------------------------------------------- -// Recieve servers reply -// ---------------------------------------------------------------------------- - -char wxFTP::GetResult() -{ - // if we've already had a read or write timeout error, the connection is - // probably toast, so don't bother, it just wastes the users time - if ( m_bEncounteredError ) - return 0; - - wxString code; - - // m_lastResult will contain the entire server response, possibly on - // multiple lines - m_lastResult.clear(); - - // we handle multiline replies here according to RFC 959: it says that a - // reply may either be on 1 line of the form "xyz ..." or on several lines - // in whuch case it looks like - // xyz-... - // ... - // xyz ... - // and the intermeidate lines may start with xyz or not - bool badReply = false; - bool firstLine = true; - bool endOfReply = false; - while ( !endOfReply && !badReply ) - { - wxString line; - m_lastError = ReadLine(this,line); - if ( m_lastError ) - { - m_bEncounteredError = true; - return 0; - } - - if ( !m_lastResult.empty() ) - { - // separate from last line - m_lastResult += _T('\n'); - } - - m_lastResult += line; - - // unless this is an intermediate line of a multiline reply, it must - // contain the code in the beginning and '-' or ' ' following it - if ( line.Len() < LEN_CODE + 1 ) - { - if ( firstLine ) - { - badReply = true; - } - else - { - wxLogTrace(FTP_TRACE_MASK, _T("<== %s %s"), - code.c_str(), line.c_str()); - } - } - else // line has at least 4 chars - { - // this is the char which tells us what we're dealing with - wxChar chMarker = line.GetChar(LEN_CODE); - - if ( firstLine ) - { - code = wxString(line, LEN_CODE); - wxLogTrace(FTP_TRACE_MASK, _T("<== %s %s"), - code.c_str(), line.c_str() + LEN_CODE + 1); - - switch ( chMarker ) - { - case _T(' '): - endOfReply = true; - break; - - case _T('-'): - firstLine = false; - break; - - default: - // unexpected - badReply = true; - } - } - else // subsequent line of multiline reply - { - if ( wxStrncmp(line, code, LEN_CODE) == 0 ) - { - if ( chMarker == _T(' ') ) - { - endOfReply = true; - } - - wxLogTrace(FTP_TRACE_MASK, _T("<== %s %s"), - code.c_str(), line.c_str() + LEN_CODE + 1); - } - else - { - // just part of reply - wxLogTrace(FTP_TRACE_MASK, _T("<== %s %s"), - code.c_str(), line.c_str()); - } - } - } - } - - if ( badReply ) - { - wxLogDebug(_T("Broken FTP server: '%s' is not a valid reply."), - m_lastResult.c_str()); - - m_lastError = wxPROTO_PROTERR; - - return 0; - } - - // if we got here we must have a non empty code string - return (char)code[0u]; -} - -// ---------------------------------------------------------------------------- -// wxFTP simple commands -// ---------------------------------------------------------------------------- - -bool wxFTP::SetTransferMode(TransferMode transferMode) -{ - if ( transferMode == m_currentTransfermode ) - { - // nothing to do - return true; - } - - wxString mode; - switch ( transferMode ) - { - default: - wxFAIL_MSG(_T("unknown FTP transfer mode")); - // fall through - - case BINARY: - mode = _T('I'); - break; - - case ASCII: - mode = _T('A'); - break; - } - - if ( !DoSimpleCommand(_T("TYPE"), mode) ) - { - wxLogError(_("Failed to set FTP transfer mode to %s."), (const wxChar*) - (transferMode == ASCII ? _("ASCII") : _("binary"))); - - return false; - } - - // If we get here the operation has been successfully completed - // Set the status-member - m_currentTransfermode = transferMode; - - return true; -} - -bool wxFTP::DoSimpleCommand(const wxChar *command, const wxString& arg) -{ - wxString fullcmd = command; - if ( !arg.empty() ) - { - fullcmd << _T(' ') << arg; - } - - if ( !CheckCommand(fullcmd, '2') ) - { - wxLogDebug(_T("FTP command '%s' failed."), fullcmd.c_str()); - - return false; - } - - return true; -} - -bool wxFTP::ChDir(const wxString& dir) -{ - // some servers might not understand ".." if they use different directory - // tree conventions, but they always understand CDUP - should we use it if - // dir == ".."? OTOH, do such servers (still) exist? - - return DoSimpleCommand(_T("CWD"), dir); -} - -bool wxFTP::MkDir(const wxString& dir) -{ - return DoSimpleCommand(_T("MKD"), dir); -} - -bool wxFTP::RmDir(const wxString& dir) -{ - return DoSimpleCommand(_T("RMD"), dir); -} - -wxString wxFTP::Pwd() -{ - wxString path; - - if ( CheckCommand(wxT("PWD"), '2') ) - { - // the result is at least that long if CheckCommand() succeeded - const wxChar *p = m_lastResult.c_str() + LEN_CODE + 1; - if ( *p != _T('"') ) - { - wxLogDebug(_T("Missing starting quote in reply for PWD: %s"), p); - } - else - { - for ( p++; *p; p++ ) - { - if ( *p == _T('"') ) - { - // check if the quote is doubled - p++; - if ( !*p || *p != _T('"') ) - { - // no, this is the end - break; - } - //else: yes, it is: this is an embedded quote in the - // filename, treat as normal char - } - - path += *p; - } - - if ( !*p ) - { - wxLogDebug(_T("Missing ending quote in reply for PWD: %s"), - m_lastResult.c_str() + LEN_CODE + 1); - } - } - } - else - { - wxLogDebug(_T("FTP PWD command failed.")); - } - - return path; -} - -bool wxFTP::Rename(const wxString& src, const wxString& dst) -{ - wxString str; - - str = wxT("RNFR ") + src; - if ( !CheckCommand(str, '3') ) - return false; - - str = wxT("RNTO ") + dst; - - return CheckCommand(str, '2'); -} - -bool wxFTP::RmFile(const wxString& path) -{ - wxString str; - str = wxT("DELE ") + path; - - return CheckCommand(str, '2'); -} - -// ---------------------------------------------------------------------------- -// wxFTP download and upload -// ---------------------------------------------------------------------------- - -class wxInputFTPStream : public wxSocketInputStream -{ -public: - wxInputFTPStream(wxFTP *ftp, wxSocketBase *sock) - : wxSocketInputStream(*sock) - { - m_ftp = ftp; - // socket timeout automatically set in GetPort function - } - - virtual ~wxInputFTPStream() - { - delete m_i_socket; // keep at top - - // when checking the result, the stream will - // almost always show an error, even if the file was - // properly transfered, thus, lets just grab the result - - // we are looking for "226 transfer completed" - char code = m_ftp->GetResult(); - if ('2' == code) - { - // it was a good transfer. - // we're done! - m_ftp->m_streaming = false; - return; - } - // did we timeout? - if (0 == code) - { - // the connection is probably toast. issue an abort, and - // then a close. there won't be any more waiting - // for this connection - m_ftp->Abort(); - m_ftp->Close(); - return; - } - // There was a problem with the transfer and the server - // has acknowledged it. If we issue an "ABORT" now, the user - // would get the "226" for the abort and think the xfer was - // complete, thus, don't do anything here, just return - } - - wxFTP *m_ftp; - - DECLARE_NO_COPY_CLASS(wxInputFTPStream) -}; - -class wxOutputFTPStream : public wxSocketOutputStream -{ -public: - wxOutputFTPStream(wxFTP *ftp_clt, wxSocketBase *sock) - : wxSocketOutputStream(*sock), m_ftp(ftp_clt) - { - } - - virtual ~wxOutputFTPStream(void) - { - if ( IsOk() ) - { - // close data connection first, this will generate "transfer - // completed" reply - delete m_o_socket; - - // read this reply - m_ftp->GetResult(); // save result so user can get to it - - m_ftp->m_streaming = false; - } - else - { - // abort data connection first - m_ftp->Abort(); - - // and close it after - delete m_o_socket; - } - } - - wxFTP *m_ftp; - - DECLARE_NO_COPY_CLASS(wxOutputFTPStream) -}; - -void wxFTP::SetDefaultTimeout(wxUint32 Value) -{ - m_uiDefaultTimeout = Value; - SetTimeout(Value); // sets it for this socket -} - - -wxSocketBase *wxFTP::GetPort() -{ - /* - PASSIVE: Client sends a "PASV" to the server. The server responds with - an address and port number which it will be listening on. Then - the client connects to the server at the specified address and - port. - - ACTIVE: Client sends the server a PORT command which includes an - address and port number which the client will be listening on. - The server then connects to the client at that address and - port. - */ - - wxSocketBase *socket = m_bPassive ? GetPassivePort() : GetActivePort(); - if ( !socket ) - { - m_bEncounteredError = true; - return NULL; - } - - // Now set the time for the new socket to the default or user selected - // timeout period - socket->SetTimeout(m_uiDefaultTimeout); - - return socket; -} - -wxSocketBase *wxFTP::AcceptIfActive(wxSocketBase *sock) -{ - if ( m_bPassive ) - return sock; - - // now wait for a connection from server - wxSocketServer *sockSrv = (wxSocketServer *)sock; - if ( !sockSrv->WaitForAccept() ) - { - m_lastError = wxPROTO_CONNERR; - wxLogError(_("Timeout while waiting for FTP server to connect, try passive mode.")); - delete sock; - sock = NULL; - } - else - { - sock = sockSrv->Accept(true); - delete sockSrv; - } - - return sock; -} - -wxString wxFTP::GetPortCmdArgument(const wxIPV4address& addrLocal, - const wxIPV4address& addrNew) -{ - // Just fills in the return value with the local IP - // address of the current socket. Also it fill in the - // PORT which the client will be listening on - - wxString addrIP = addrLocal.IPAddress(); - int portNew = addrNew.Service(); - - // We need to break the PORT number in bytes - addrIP.Replace(_T("."), _T(",")); - addrIP << _T(',') - << wxString::Format(_T("%d"), portNew >> 8) << _T(',') - << wxString::Format(_T("%d"), portNew & 0xff); - - // Now we have a value like "10,0,0,1,5,23" - return addrIP; -} - -wxSocketBase *wxFTP::GetActivePort() -{ - // we need an address to listen on - wxIPV4address addrNew, addrLocal; - GetLocal(addrLocal); - addrNew.AnyAddress(); - addrNew.Service(0); // pick an open port number. - - wxSocketServer *sockSrv = new wxSocketServer(addrNew); - if (!sockSrv->Ok()) - { - // We use Ok() here to see if everything is ok - m_lastError = wxPROTO_PROTERR; - delete sockSrv; - return NULL; - } - - //gets the new address, actually it is just the port number - sockSrv->GetLocal(addrNew); - - // Now we create the argument of the PORT command, we send in both - // addresses because the addrNew has an IP of "0.0.0.0", so we need the - // value in addrLocal - wxString port = GetPortCmdArgument(addrLocal, addrNew); - if ( !DoSimpleCommand(_T("PORT"), port) ) - { - m_lastError = wxPROTO_PROTERR; - delete sockSrv; - wxLogError(_("The FTP server doesn't support the PORT command.")); - return NULL; - } - - sockSrv->Notify(false); // Don't send any events - return sockSrv; -} - -wxSocketBase *wxFTP::GetPassivePort() -{ - if ( !DoSimpleCommand(_T("PASV")) ) - { - wxLogError(_("The FTP server doesn't support passive mode.")); - return NULL; - } - - const wxChar *addrStart = wxStrchr(m_lastResult, _T('(')); - const wxChar *addrEnd = addrStart ? wxStrchr(addrStart, _T(')')) : NULL; - if ( !addrEnd ) - { - m_lastError = wxPROTO_PROTERR; - - return NULL; - } - - // get the port number and address - int a[6]; - wxString straddr(addrStart + 1, addrEnd); - wxSscanf(straddr, wxT("%d,%d,%d,%d,%d,%d"), - &a[2],&a[3],&a[4],&a[5],&a[0],&a[1]); - - wxUint32 hostaddr = (wxUint16)a[2] << 24 | - (wxUint16)a[3] << 16 | - (wxUint16)a[4] << 8 | - a[5]; - wxUint16 port = (wxUint16)(a[0] << 8 | a[1]); - - wxIPV4address addr; - addr.Hostname(hostaddr); - addr.Service(port); - - wxSocketClient *client = new wxSocketClient(); - if ( !client->Connect(addr) ) - { - delete client; - return NULL; - } - - client->Notify(false); - - return client; -} - -bool wxFTP::Abort() -{ - if ( !m_streaming ) - return true; - - m_streaming = false; - if ( !CheckCommand(wxT("ABOR"), '4') ) - return false; - - return CheckResult('2'); -} - -wxInputStream *wxFTP::GetInputStream(const wxString& path) -{ - if ( ( m_currentTransfermode == NONE ) && !SetTransferMode(BINARY) ) - return NULL; - - wxSocketBase *sock = GetPort(); - - if ( !sock ) - { - m_lastError = wxPROTO_NETERR; - return NULL; - } - - wxString tmp_str = wxT("RETR ") + wxURI::Unescape(path); - if ( !CheckCommand(tmp_str, '1') ) - return NULL; - - sock = AcceptIfActive(sock); - if ( !sock ) - return NULL; - - sock->SetFlags(wxSOCKET_WAITALL); - - m_streaming = true; - - wxInputFTPStream *in_stream = new wxInputFTPStream(this, sock); - - return in_stream; -} - -wxOutputStream *wxFTP::GetOutputStream(const wxString& path) -{ - if ( ( m_currentTransfermode == NONE ) && !SetTransferMode(BINARY) ) - return NULL; - - wxSocketBase *sock = GetPort(); - - wxString tmp_str = wxT("STOR ") + path; - if ( !CheckCommand(tmp_str, '1') ) - return NULL; - - sock = AcceptIfActive(sock); - - m_streaming = true; - - return new wxOutputFTPStream(this, sock); -} - -// ---------------------------------------------------------------------------- -// FTP directory listing -// ---------------------------------------------------------------------------- - -bool wxFTP::GetList(wxArrayString& files, - const wxString& wildcard, - bool details) -{ - wxSocketBase *sock = GetPort(); - if (!sock) - return false; - - // NLST : List of Filenames (including Directory's !) - // LIST : depending on BS of FTP-Server - // - Unix : result like "ls" command - // - Windows : like "dir" command - // - others : ? - wxString line(details ? _T("LIST") : _T("NLST")); - if ( !wildcard.empty() ) - { - line << _T(' ') << wildcard; - } - - if ( !CheckCommand(line, '1') ) - { - m_lastError = wxPROTO_PROTERR; - wxLogDebug(_T("FTP 'LIST' command returned unexpected result from server")); - delete sock; - return false; - } - - sock = AcceptIfActive(sock); - if ( !sock ) - return false; - - files.Empty(); - while (ReadLine(sock, line) == wxPROTO_NOERR ) - { - files.Add(line); - } - - delete sock; - - // the file list should be terminated by "226 Transfer complete"" - return CheckResult('2'); -} - -bool wxFTP::FileExists(const wxString& fileName) -{ - // This function checks if the file specified in fileName exists in the - // current dir. It does so by simply doing an NLST (via GetList). - // If this succeeds (and the list is not empty) the file exists. - - bool retval = false; - wxArrayString fileList; - - if ( GetList(fileList, fileName, false) ) - { - // Some ftp-servers (Ipswitch WS_FTP Server 1.0.5 does this) - // displays this behaviour when queried on a nonexistent file: - // NLST this_file_does_not_exist - // 150 Opening ASCII data connection for directory listing - // (no data transferred) - // 226 Transfer complete - // Here wxFTP::GetList(...) will succeed but it will return an empty - // list. - retval = !fileList.IsEmpty(); - } - - return retval; -} - -// ---------------------------------------------------------------------------- -// FTP GetSize -// ---------------------------------------------------------------------------- - -int wxFTP::GetFileSize(const wxString& fileName) -{ - // return the filesize of the given file if possible - // return -1 otherwise (predominantly if file doesn't exist - // in current dir) - - int filesize = -1; - - // Check for existance of file via wxFTP::FileExists(...) - if ( FileExists(fileName) ) - { - wxString command; - - // First try "SIZE" command using BINARY(IMAGE) transfermode - // Especially UNIX ftp-servers distinguish between the different - // transfermodes and reports different filesizes accordingly. - // The BINARY size is the interesting one: How much memory - // will we need to hold this file? - TransferMode oldTransfermode = m_currentTransfermode; - SetTransferMode(BINARY); - command << _T("SIZE ") << fileName; - - bool ok = CheckCommand(command, '2'); - - if ( ok ) - { - // The answer should be one line: "213 \n" - // 213 is File Status (STD9) - // "SIZE" is not described anywhere..? It works on most servers - int statuscode; - if ( wxSscanf(GetLastResult().c_str(), _T("%i %i"), - &statuscode, &filesize) == 2 ) - { - // We've gotten a good reply. - ok = true; - } - else - { - // Something bad happened.. A "2yz" reply with no size - // Fallback - ok = false; - } - } - - // Set transfermode back to the original. Only the "SIZE"-command - // is dependant on transfermode - if ( oldTransfermode != NONE ) - { - SetTransferMode(oldTransfermode); - } - - // this is not a direct else clause.. The size command might return an - // invalid "2yz" reply - if ( !ok ) - { - // The server didn't understand the "SIZE"-command or it - // returned an invalid reply. - // We now try to get details for the file with a "LIST"-command - // and then parse the output from there.. - wxArrayString fileList; - if ( GetList(fileList, fileName, true) ) - { - if ( !fileList.IsEmpty() ) - { - // We _should_ only get one line in return, but just to be - // safe we run through the line(s) returned and look for a - // substring containing the name we are looking for. We - // stop the iteration at the first occurrence of the - // filename. The search is not case-sensitive. - bool foundIt = false; - - size_t i; - for ( i = 0; !foundIt && i < fileList.Count(); i++ ) - { - foundIt = fileList[i].Upper().Contains(fileName.Upper()); - } - - if ( foundIt ) - { - // The index i points to the first occurrence of - // fileName in the array Now we have to find out what - // format the LIST has returned. There are two - // "schools": Unix-like - // - // '-rw-rw-rw- owner group size month day time filename' - // - // or Windows-like - // - // 'date size filename' - - // check if the first character is '-'. This would - // indicate Unix-style (this also limits this function - // to searching for files, not directories) - if ( fileList[i].Mid(0, 1) == _T("-") ) - { - - if ( wxSscanf(fileList[i].c_str(), - _T("%*s %*s %*s %*s %i %*s %*s %*s %*s"), - &filesize) != 9 ) - { - // Hmm... Invalid response - wxLogTrace(FTP_TRACE_MASK, - _T("Invalid LIST response")); - } - } - else // Windows-style response (?) - { - if ( wxSscanf(fileList[i].c_str(), - _T("%*s %*s %i %*s"), - &filesize) != 4 ) - { - // something bad happened..? - wxLogTrace(FTP_TRACE_MASK, - _T("Invalid or unknown LIST response")); - } - } - } - } - } - } - } - - // filesize might still be -1 when exiting - return filesize; -} - -#endif // wxUSE_PROTOCOL_FTP - diff --git a/wxWidgets/src/common/gaugecmn.cpp b/wxWidgets/src/common/gaugecmn.cpp deleted file mode 100644 index d8ab642e69..0000000000 --- a/wxWidgets/src/common/gaugecmn.cpp +++ /dev/null @@ -1,156 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: src/common/gaugecmn.cpp -// Purpose: wxGaugeBase: common to all ports methods of wxGauge -// Author: Vadim Zeitlin -// Modified by: -// Created: 20.02.01 -// RCS-ID: $Id: gaugecmn.cpp 41089 2006-09-09 13:36:54Z RR $ -// Copyright: (c) 2001 Vadim Zeitlin -// License: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#ifndef WX_PRECOMP -#endif //WX_PRECOMP - -#if wxUSE_GAUGE - -#include "wx/gauge.h" - -const wxChar wxGaugeNameStr[] = wxT("gauge"); - -// ============================================================================ -// implementation -// ============================================================================ - -wxGaugeBase::~wxGaugeBase() -{ - // this destructor is required for Darwin -} - -// ---------------------------------------------------------------------------- -// wxGauge creation -// ---------------------------------------------------------------------------- - -bool wxGaugeBase::Create(wxWindow *parent, - wxWindowID id, - int range, - 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; - - SetName(name); - -#if wxUSE_VALIDATORS - SetValidator(validator); -#endif // wxUSE_VALIDATORS - - SetRange(range); - SetValue(0); -#if wxGAUGE_EMULATE_INDETERMINATE_MODE - m_nDirection = wxRIGHT; -#endif - - return true; -} - -// ---------------------------------------------------------------------------- -// wxGauge determinate mode range/position -// ---------------------------------------------------------------------------- - -void wxGaugeBase::SetRange(int range) -{ - m_rangeMax = range; -} - -int wxGaugeBase::GetRange() const -{ - return m_rangeMax; -} - -void wxGaugeBase::SetValue(int pos) -{ - m_gaugePos = pos; -} - -int wxGaugeBase::GetValue() const -{ - return m_gaugePos; -} - -// ---------------------------------------------------------------------------- -// wxGauge indeterminate mode -// ---------------------------------------------------------------------------- - -void wxGaugeBase::Pulse() -{ -#if wxGAUGE_EMULATE_INDETERMINATE_MODE - // simulate indeterminate mode - int curr = GetValue(), max = GetRange(); - - if (m_nDirection == wxRIGHT) - { - if (curr < max) - SetValue(curr + 1); - else - { - SetValue(max - 1); - m_nDirection = wxLEFT; - } - } - else - { - if (curr > 0) - SetValue(curr - 1); - else - { - SetValue(1); - m_nDirection = wxRIGHT; - } - } -#endif -} - -// ---------------------------------------------------------------------------- -// wxGauge appearance params -// ---------------------------------------------------------------------------- - -void wxGaugeBase::SetShadowWidth(int WXUNUSED(w)) -{ -} - -int wxGaugeBase::GetShadowWidth() const -{ - return 0; -} - - -void wxGaugeBase::SetBezelFace(int WXUNUSED(w)) -{ -} - -int wxGaugeBase::GetBezelFace() const -{ - return 0; -} - -#endif // wxUSE_GAUGE diff --git a/wxWidgets/src/common/gbsizer.cpp b/wxWidgets/src/common/gbsizer.cpp deleted file mode 100644 index c81e80c2b1..0000000000 --- a/wxWidgets/src/common/gbsizer.cpp +++ /dev/null @@ -1,784 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: gbsizer.cpp -// Purpose: wxGridBagSizer: A sizer that can lay out items in a grid, -// with items at specified cells, and with the option of row -// and/or column spanning -// -// Author: Robin Dunn -// Created: 03-Nov-2003 -// RCS-ID: $Id: gbsizer.cpp 54568 2008-07-10 01:32:23Z RD $ -// Copyright: (c) Robin Dunn -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#include "wx/gbsizer.h" - -//--------------------------------------------------------------------------- - -IMPLEMENT_DYNAMIC_CLASS(wxGBSizerItem, wxSizerItem) -IMPLEMENT_CLASS(wxGridBagSizer, wxFlexGridSizer) - -const wxGBSpan wxDefaultSpan; - -//--------------------------------------------------------------------------- -// wxGBSizerItem -//--------------------------------------------------------------------------- - -wxGBSizerItem::wxGBSizerItem( int width, - int height, - const wxGBPosition& pos, - const wxGBSpan& span, - int flag, - int border, - wxObject* userData) - : wxSizerItem(width, height, 0, flag, border, userData), - m_pos(pos), - m_span(span), - m_gbsizer(NULL) -{ -} - - -wxGBSizerItem::wxGBSizerItem( wxWindow *window, - const wxGBPosition& pos, - const wxGBSpan& span, - int flag, - int border, - wxObject* userData ) - : wxSizerItem(window, 0, flag, border, userData), - m_pos(pos), - m_span(span), - m_gbsizer(NULL) -{ -} - - -wxGBSizerItem::wxGBSizerItem( wxSizer *sizer, - const wxGBPosition& pos, - const wxGBSpan& span, - int flag, - int border, - wxObject* userData ) - : wxSizerItem(sizer, 0, flag, border, userData), - m_pos(pos), - m_span(span), - m_gbsizer(NULL) -{ -} - -wxGBSizerItem::wxGBSizerItem() - : wxSizerItem(), - m_pos(-1,-1), - m_span(-1,-1), - m_gbsizer(NULL) -{ -} - -//--------------------------------------------------------------------------- - - -void wxGBSizerItem::GetPos(int& row, int& col) const -{ - row = m_pos.GetRow(); - col = m_pos.GetCol(); -} - -void wxGBSizerItem::GetSpan(int& rowspan, int& colspan) const -{ - rowspan = m_span.GetRowspan(); - colspan = m_span.GetColspan(); -} - - -bool wxGBSizerItem::SetPos( const wxGBPosition& pos ) -{ - if (m_gbsizer) - { - wxCHECK_MSG( !m_gbsizer->CheckForIntersection(pos, m_span, this), false, - wxT("An item is already at that position") ); - } - m_pos = pos; - return true; -} - -bool wxGBSizerItem::SetSpan( const wxGBSpan& span ) -{ - if (m_gbsizer) - { - wxCHECK_MSG( !m_gbsizer->CheckForIntersection(m_pos, span, this), false, - wxT("An item is already at that position") ); - } - m_span = span; - return true; -} - - -inline bool InRange(int val, int min, int max) -{ - return (val >= min && val <= max); -} - -bool wxGBSizerItem::Intersects(const wxGBSizerItem& other) -{ - return Intersects(other.GetPos(), other.GetSpan()); -} - -bool wxGBSizerItem::Intersects(const wxGBPosition& pos, const wxGBSpan& span) -{ - - int row, col, endrow, endcol; - int otherrow, othercol, otherendrow, otherendcol; - - GetPos(row, col); - GetEndPos(endrow, endcol); - - otherrow = pos.GetRow(); - othercol = pos.GetCol(); - otherendrow = otherrow + span.GetRowspan() - 1; - otherendcol = othercol + span.GetColspan() - 1; - - // is the other item's start or end in the range of this one? - if (( InRange(otherrow, row, endrow) && InRange(othercol, col, endcol) ) || - ( InRange(otherendrow, row, endrow) && InRange(otherendcol, col, endcol) )) - return true; - - // is this item's start or end in the range of the other one? - if (( InRange(row, otherrow, otherendrow) && InRange(col, othercol, otherendcol) ) || - ( InRange(endrow, otherrow, otherendrow) && InRange(endcol, othercol, otherendcol) )) - return true; - - return false; -} - - -void wxGBSizerItem::GetEndPos(int& row, int& col) -{ - row = m_pos.GetRow() + m_span.GetRowspan() - 1; - col = m_pos.GetCol() + m_span.GetColspan() - 1; -} - - -//--------------------------------------------------------------------------- -// wxGridBagSizer -//--------------------------------------------------------------------------- - -wxGridBagSizer::wxGridBagSizer(int vgap, int hgap ) - : wxFlexGridSizer(1, vgap, hgap), - m_emptyCellSize(10,20) - -{ -} - - -wxSizerItem* wxGridBagSizer::Add( wxWindow *window, - const wxGBPosition& pos, const wxGBSpan& span, - int flag, int border, wxObject* userData ) -{ - wxGBSizerItem* item = new wxGBSizerItem(window, pos, span, flag, border, userData); - if ( Add(item) ) - return item; - else - { - delete item; - return (wxSizerItem*)NULL; - } -} - -wxSizerItem* wxGridBagSizer::Add( wxSizer *sizer, - const wxGBPosition& pos, const wxGBSpan& span, - int flag, int border, wxObject* userData ) -{ - wxGBSizerItem* item = new wxGBSizerItem(sizer, pos, span, flag, border, userData); - if ( Add(item) ) - return item; - else - { - delete item; - return (wxSizerItem*)NULL; - } -} - -wxSizerItem* wxGridBagSizer::Add( int width, int height, - const wxGBPosition& pos, const wxGBSpan& span, - int flag, int border, wxObject* userData ) -{ - wxGBSizerItem* item = new wxGBSizerItem(width, height, pos, span, flag, border, userData); - if ( Add(item) ) - return item; - else - { - delete item; - return (wxSizerItem*)NULL; - } -} - -wxSizerItem* wxGridBagSizer::Add( wxGBSizerItem *item ) -{ - wxCHECK_MSG( !CheckForIntersection(item), NULL, - wxT("An item is already at that position") ); - m_children.Append(item); - item->SetGBSizer(this); - if ( item->GetWindow() ) - item->GetWindow()->SetContainingSizer( this ); - - return item; -} - - - -//--------------------------------------------------------------------------- - -wxSize wxGridBagSizer::GetCellSize(int row, int col) const -{ - wxCHECK_MSG( (row < m_rows) && (col < m_cols), - wxDefaultSize, - wxT("Invalid cell.")); - return wxSize( m_colWidths[col], m_rowHeights[row] ); -} - - -wxGBPosition wxGridBagSizer::GetItemPosition(wxWindow *window) -{ - wxGBPosition badpos(-1,-1); - wxGBSizerItem* item = FindItem(window); - wxCHECK_MSG(item, badpos, wxT("Failed to find item.")); - return item->GetPos(); -} - - -wxGBPosition wxGridBagSizer::GetItemPosition(wxSizer *sizer) -{ - wxGBPosition badpos(-1,-1); - wxGBSizerItem* item = FindItem(sizer); - wxCHECK_MSG(item, badpos, wxT("Failed to find item.")); - return item->GetPos(); -} - - -wxGBPosition wxGridBagSizer::GetItemPosition(size_t index) -{ - wxGBPosition badpos(-1,-1); - wxSizerItemList::compatibility_iterator node = m_children.Item( index ); - wxCHECK_MSG( node, badpos, _T("Failed to find item.") ); - wxGBSizerItem* item = (wxGBSizerItem*)node->GetData(); - return item->GetPos(); -} - - - -bool wxGridBagSizer::SetItemPosition(wxWindow *window, const wxGBPosition& pos) -{ - wxGBSizerItem* item = FindItem(window); - wxCHECK_MSG(item, false, wxT("Failed to find item.")); - return item->SetPos(pos); -} - - -bool wxGridBagSizer::SetItemPosition(wxSizer *sizer, const wxGBPosition& pos) -{ - wxGBSizerItem* item = FindItem(sizer); - wxCHECK_MSG(item, false, wxT("Failed to find item.")); - return item->SetPos(pos); -} - - -bool wxGridBagSizer::SetItemPosition(size_t index, const wxGBPosition& pos) -{ - wxSizerItemList::compatibility_iterator node = m_children.Item( index ); - wxCHECK_MSG( node, false, _T("Failed to find item.") ); - wxGBSizerItem* item = (wxGBSizerItem*)node->GetData(); - return item->SetPos(pos); -} - - - -wxGBSpan wxGridBagSizer::GetItemSpan(wxWindow *window) -{ - wxGBSpan badspan(-1,-1); - wxGBSizerItem* item = FindItem(window); - wxCHECK_MSG( item, badspan, _T("Failed to find item.") ); - return item->GetSpan(); -} - - -wxGBSpan wxGridBagSizer::GetItemSpan(wxSizer *sizer) -{ - wxGBSpan badspan(-1,-1); - wxGBSizerItem* item = FindItem(sizer); - wxCHECK_MSG( item, badspan, _T("Failed to find item.") ); - return item->GetSpan(); -} - - -wxGBSpan wxGridBagSizer::GetItemSpan(size_t index) -{ - wxGBSpan badspan(-1,-1); - wxSizerItemList::compatibility_iterator node = m_children.Item( index ); - wxCHECK_MSG( node, badspan, _T("Failed to find item.") ); - wxGBSizerItem* item = (wxGBSizerItem*)node->GetData(); - return item->GetSpan(); -} - - - -bool wxGridBagSizer::SetItemSpan(wxWindow *window, const wxGBSpan& span) -{ - wxGBSizerItem* item = FindItem(window); - wxCHECK_MSG(item, false, wxT("Failed to find item.")); - return item->SetSpan(span); -} - - -bool wxGridBagSizer::SetItemSpan(wxSizer *sizer, const wxGBSpan& span) -{ - wxGBSizerItem* item = FindItem(sizer); - wxCHECK_MSG(item, false, wxT("Failed to find item.")); - return item->SetSpan(span); -} - - -bool wxGridBagSizer::SetItemSpan(size_t index, const wxGBSpan& span) -{ - wxSizerItemList::compatibility_iterator node = m_children.Item( index ); - wxCHECK_MSG( node, false, _T("Failed to find item.") ); - wxGBSizerItem* item = (wxGBSizerItem*)node->GetData(); - return item->SetSpan(span); -} - - - - -wxGBSizerItem* wxGridBagSizer::FindItem(wxWindow* window) -{ - wxSizerItemList::compatibility_iterator node = m_children.GetFirst(); - while (node) - { - wxGBSizerItem* item = (wxGBSizerItem*)node->GetData(); - if ( item->GetWindow() == window ) - return item; - node = node->GetNext(); - } - return NULL; -} - - -wxGBSizerItem* wxGridBagSizer::FindItem(wxSizer* sizer) -{ - wxSizerItemList::compatibility_iterator node = m_children.GetFirst(); - while (node) - { - wxGBSizerItem* item = (wxGBSizerItem*)node->GetData(); - if ( item->GetSizer() == sizer ) - return item; - node = node->GetNext(); - } - return NULL; -} - - - - -wxGBSizerItem* wxGridBagSizer::FindItemAtPosition(const wxGBPosition& pos) -{ - wxSizerItemList::compatibility_iterator node = m_children.GetFirst(); - while (node) - { - wxGBSizerItem* item = (wxGBSizerItem*)node->GetData(); - if ( item->Intersects(pos, wxDefaultSpan) ) - return item; - node = node->GetNext(); - } - return NULL; -} - - - - -wxGBSizerItem* wxGridBagSizer::FindItemAtPoint(const wxPoint& pt) -{ - wxSizerItemList::compatibility_iterator node = m_children.GetFirst(); - while (node) - { - wxGBSizerItem* item = (wxGBSizerItem*)node->GetData(); - wxRect rect(item->GetPosition(), item->GetSize()); - rect.Inflate(m_hgap, m_vgap); - if ( rect.Contains(pt) ) - return item; - node = node->GetNext(); - } - return NULL; -} - - - - -wxGBSizerItem* wxGridBagSizer::FindItemWithData(const wxObject* userData) -{ - wxSizerItemList::compatibility_iterator node = m_children.GetFirst(); - while (node) - { - wxGBSizerItem* item = (wxGBSizerItem*)node->GetData(); - if ( item->GetUserData() == userData ) - return item; - node = node->GetNext(); - } - return NULL; -} - - - - -//--------------------------------------------------------------------------- - -// Figure out what all the min row heights and col widths are, and calculate -// min size from that. -wxSize wxGridBagSizer::CalcMin() -{ - int idx; - - if (m_children.GetCount() == 0) - return m_emptyCellSize; - - m_rowHeights.Empty(); - m_colWidths.Empty(); - - wxSizerItemList::compatibility_iterator node = m_children.GetFirst(); - while (node) - { - wxGBSizerItem* item = (wxGBSizerItem*)node->GetData(); - if ( item->ShouldAccountFor() ) - { - int row, col, endrow, endcol; - - item->GetPos(row, col); - item->GetEndPos(endrow, endcol); - - // fill heights and widths upto this item if needed - while ( m_rowHeights.GetCount() <= (size_t)endrow ) - m_rowHeights.Add(m_emptyCellSize.GetHeight()); - while ( m_colWidths.GetCount() <= (size_t)endcol ) - m_colWidths.Add(m_emptyCellSize.GetWidth()); - - // See if this item increases the size of its row(s) or col(s) - wxSize size(item->CalcMin()); - for (idx=row; idx <= endrow; idx++) - m_rowHeights[idx] = wxMax(m_rowHeights[idx], size.GetHeight() / (endrow-row+1)); - for (idx=col; idx <= endcol; idx++) - m_colWidths[idx] = wxMax(m_colWidths[idx], size.GetWidth() / (endcol-col+1)); - } - node = node->GetNext(); - } - - AdjustForOverflow(); - AdjustForFlexDirection(); - - // Now traverse the heights and widths arrays calcing the totals, including gaps - int width = 0; - m_cols = m_colWidths.GetCount(); - for (idx=0; idx < m_cols; idx++) - width += m_colWidths[idx] + ( idx == m_cols-1 ? 0 : m_hgap ); - - int height = 0; - m_rows = m_rowHeights.GetCount(); - for (idx=0; idx < m_rows; idx++) - height += m_rowHeights[idx] + ( idx == m_rows-1 ? 0 : m_vgap ); - - m_calculatedMinSize = wxSize(width, height); - return m_calculatedMinSize; -} - - - -void wxGridBagSizer::RecalcSizes() -{ - if (m_children.GetCount() == 0) - return; - - wxPoint pt( GetPosition() ); - wxSize sz( GetSize() ); - - m_rows = m_rowHeights.GetCount(); - m_cols = m_colWidths.GetCount(); - int idx, width, height; - - AdjustForGrowables(sz, m_calculatedMinSize, m_rows, m_cols); - - // Find the start positions on the window of the rows and columns - wxArrayInt rowpos; - rowpos.Add(0, m_rows); - int y = pt.y; - for (idx=0; idx < m_rows; idx++) - { - height = m_rowHeights[idx] + m_vgap; - rowpos[idx] = y; - y += height; - } - - wxArrayInt colpos; - colpos.Add(0, m_cols); - int x = pt.x; - for (idx=0; idx < m_cols; idx++) - { - width = m_colWidths[idx] + m_hgap; - colpos[idx] = x; - x += width; - } - - - // Now iterate the children, setting each child's dimensions - wxSizerItemList::compatibility_iterator node = m_children.GetFirst(); - while (node) - { - int row, col, endrow, endcol; - wxGBSizerItem* item = (wxGBSizerItem*)node->GetData(); - - if ( item->ShouldAccountFor() ) - { - item->GetPos(row, col); - item->GetEndPos(endrow, endcol); - - height = 0; - for(idx=row; idx <= endrow; idx++) - height += m_rowHeights[idx]; - height += (endrow - row) * m_vgap; // add a vgap for every row spanned - - width = 0; - for (idx=col; idx <= endcol; idx++) - width += m_colWidths[idx]; - width += (endcol - col) * m_hgap; // add a hgap for every col spanned - - SetItemBounds(item, colpos[col], rowpos[row], width, height); - } - - node = node->GetNext(); - } -} - - -// Sometimes CalcMin can result in some rows or cols having too much space in -// them because as it traverses the items it makes some assumptions when -// items span to other cells. But those assumptions can become invalid later -// on when other items are fitted into the same rows or columns that the -// spanning item occupies. This method tries to find those situations and -// fixes them. -void wxGridBagSizer::AdjustForOverflow() -{ - int row, col; - - for (row=0; row<(int)m_rowHeights.GetCount(); row++) - { - int rowExtra=INT_MAX; - int rowHeight = m_rowHeights[row]; - for (col=0; col<(int)m_colWidths.GetCount(); col++) - { - wxGBPosition pos(row,col); - wxGBSizerItem* item = FindItemAtPosition(pos); - if ( !item || !item->ShouldAccountFor() ) - continue; - - int endrow, endcol; - item->GetEndPos(endrow, endcol); - - // If the item starts in this position and doesn't span rows, then - // just look at the whole item height - if ( item->GetPos() == pos && endrow == row ) - { - int itemHeight = item->CalcMin().GetHeight(); - rowExtra = wxMin(rowExtra, rowHeight - itemHeight); - continue; - } - - // Otherwise, only look at spanning items if they end on this row - if ( endrow == row ) - { - // first deduct the portions of the item that are on prior rows - int itemHeight = item->CalcMin().GetHeight(); - for (int r=item->GetPos().GetRow(); rShouldAccountFor() ) - continue; - - int endrow, endcol; - item->GetEndPos(endrow, endcol); - - if ( item->GetPos() == pos && endcol == col ) - { - int itemWidth = item->CalcMin().GetWidth(); - colExtra = wxMin(colExtra, colWidth - itemWidth); - continue; - } - - if ( endcol == col ) - { - int itemWidth = item->CalcMin().GetWidth(); - for (int c=item->GetPos().GetCol(); cGetPos(), item->GetSpan(), excludeItem); -} - -bool wxGridBagSizer::CheckForIntersection(const wxGBPosition& pos, const wxGBSpan& span, wxGBSizerItem* excludeItem) -{ - wxSizerItemList::compatibility_iterator node = m_children.GetFirst(); - while (node) - { - wxGBSizerItem* item = (wxGBSizerItem*)node->GetData(); - node = node->GetNext(); - - if ( excludeItem && item == excludeItem ) - continue; - - if ( item->Intersects(pos, span) ) - return true; - - } - return false; -} - - -// Assumes a 10x10 grid, and returns the first empty cell found. This is -// really stupid but it is only used by the Add methods that match the base -// class virtuals, which should normally not be used anyway... -wxGBPosition wxGridBagSizer::FindEmptyCell() -{ - int row, col; - - for (row=0; row<10; row++) - for (col=0; col<10; col++) - { - wxGBPosition pos(row, col); - if ( !CheckForIntersection(pos, wxDefaultSpan) ) - return pos; - } - return wxGBPosition(-1, -1); -} - - -//--------------------------------------------------------------------------- - -// The Add base class virtuals should not be used with this class, but -// we'll try to make them automatically select a location for the item -// anyway. - -wxSizerItem* wxGridBagSizer::Add( wxWindow *window, int, int flag, int border, wxObject* userData ) -{ - return Add(window, FindEmptyCell(), wxDefaultSpan, flag, border, userData); -} - -wxSizerItem* wxGridBagSizer::Add( wxSizer *sizer, int, int flag, int border, wxObject* userData ) -{ - return Add(sizer, FindEmptyCell(), wxDefaultSpan, flag, border, userData); -} - -wxSizerItem* wxGridBagSizer::Add( int width, int height, int, int flag, int border, wxObject* userData ) -{ - return Add(width, height, FindEmptyCell(), wxDefaultSpan, flag, border, userData); -} - - - -// The Insert nad Prepend base class virtuals that are not appropriate for -// this class and should not be used. Their implementation in this class -// simply fails. - -wxSizerItem* wxGridBagSizer::Add( wxSizerItem * ) -{ - wxFAIL_MSG(wxT("Invalid Add form called.")); - return (wxSizerItem*)NULL; -} - -wxSizerItem* wxGridBagSizer::Prepend( wxWindow *, int, int, int, wxObject* ) -{ - wxFAIL_MSG(wxT("Prepend should not be used with wxGridBagSizer.")); - return (wxSizerItem*)NULL; -} - -wxSizerItem* wxGridBagSizer::Prepend( wxSizer *, int, int, int, wxObject* ) -{ - wxFAIL_MSG(wxT("Prepend should not be used with wxGridBagSizer.")); - return (wxSizerItem*)NULL; -} - -wxSizerItem* wxGridBagSizer::Prepend( int, int, int, int, int, wxObject* ) -{ - wxFAIL_MSG(wxT("Prepend should not be used with wxGridBagSizer.")); - return (wxSizerItem*)NULL; -} - -wxSizerItem* wxGridBagSizer::Prepend( wxSizerItem * ) -{ - wxFAIL_MSG(wxT("Prepend should not be used with wxGridBagSizer.")); - return (wxSizerItem*)NULL; -} - - -wxSizerItem* wxGridBagSizer::Insert( size_t, wxWindow *, int, int, int, wxObject* ) -{ - wxFAIL_MSG(wxT("Insert should not be used with wxGridBagSizer.")); - return (wxSizerItem*)NULL; -} - -wxSizerItem* wxGridBagSizer::Insert( size_t, wxSizer *, int, int, int, wxObject* ) -{ - wxFAIL_MSG(wxT("Insert should not be used with wxGridBagSizer.")); - return (wxSizerItem*)NULL; -} - -wxSizerItem* wxGridBagSizer::Insert( size_t, int, int, int, int, int, wxObject* ) -{ - wxFAIL_MSG(wxT("Insert should not be used with wxGridBagSizer.")); - return (wxSizerItem*)NULL; -} - -wxSizerItem* wxGridBagSizer::Insert( size_t, wxSizerItem * ) -{ - wxFAIL_MSG(wxT("Insert should not be used with wxGridBagSizer.")); - return (wxSizerItem*)NULL; -} - - -//--------------------------------------------------------------------------- -//--------------------------------------------------------------------------- diff --git a/wxWidgets/src/common/gdicmn.cpp b/wxWidgets/src/common/gdicmn.cpp deleted file mode 100644 index 2322388537..0000000000 --- a/wxWidgets/src/common/gdicmn.cpp +++ /dev/null @@ -1,871 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/common/gdicmn.cpp -// Purpose: Common GDI classes -// Author: Julian Smart -// Modified by: -// Created: 01/02/97 -// RCS-ID: $Id: gdicmn.cpp 50022 2007-11-17 14:24:18Z VZ $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#include "wx/gdicmn.h" -#include "wx/gdiobj.h" - -#ifndef WX_PRECOMP - #include "wx/log.h" - #include "wx/pen.h" - #include "wx/brush.h" - #include "wx/palette.h" - #include "wx/icon.h" - #include "wx/cursor.h" - #include "wx/settings.h" - #include "wx/bitmap.h" - #include "wx/colour.h" - #include "wx/font.h" -#endif - - -IMPLEMENT_DYNAMIC_CLASS(wxGDIObject, wxObject) - - -WXDLLIMPEXP_DATA_CORE(wxBrushList*) wxTheBrushList; -WXDLLIMPEXP_DATA_CORE(wxFontList*) wxTheFontList; -WXDLLIMPEXP_DATA_CORE(wxPenList*) wxThePenList; - -WXDLLIMPEXP_DATA_CORE(wxColourDatabase*) wxTheColourDatabase; - -WXDLLIMPEXP_DATA_CORE(wxBitmap) wxNullBitmap; -WXDLLIMPEXP_DATA_CORE(wxBrush) wxNullBrush; -WXDLLIMPEXP_DATA_CORE(wxColour) wxNullColour; -WXDLLIMPEXP_DATA_CORE(wxCursor) wxNullCursor; -WXDLLIMPEXP_DATA_CORE(wxFont) wxNullFont; -WXDLLIMPEXP_DATA_CORE(wxIcon) wxNullIcon; -WXDLLIMPEXP_DATA_CORE(wxPen) wxNullPen; -#if wxUSE_PALETTE -WXDLLIMPEXP_DATA_CORE(wxPalette) wxNullPalette; -#endif - -const wxSize wxDefaultSize(wxDefaultCoord, wxDefaultCoord); -const wxPoint wxDefaultPosition(wxDefaultCoord, wxDefaultCoord); - -#if wxUSE_EXTENDED_RTTI - -// wxPoint - -template<> void wxStringReadValue(const wxString &s , wxPoint &data ) -{ - wxSscanf(s, wxT("%d,%d"), &data.x , &data.y ) ; -} - -template<> void wxStringWriteValue(wxString &s , const wxPoint &data ) -{ - s = wxString::Format(wxT("%d,%d"), data.x , data.y ) ; -} - -wxCUSTOM_TYPE_INFO(wxPoint, wxToStringConverter , wxFromStringConverter) - -template<> void wxStringReadValue(const wxString &s , wxSize &data ) -{ - wxSscanf(s, wxT("%d,%d"), &data.x , &data.y ) ; -} - -template<> void wxStringWriteValue(wxString &s , const wxSize &data ) -{ - s = wxString::Format(wxT("%d,%d"), data.x , data.y ) ; -} - -wxCUSTOM_TYPE_INFO(wxSize, wxToStringConverter , wxFromStringConverter) - -#endif - -wxRect::wxRect(const wxPoint& point1, const wxPoint& point2) -{ - x = point1.x; - y = point1.y; - width = point2.x - point1.x; - height = point2.y - point1.y; - - if (width < 0) - { - width = -width; - x = point2.x; - } - width++; - - if (height < 0) - { - height = -height; - y = point2.y; - } - height++; -} - -bool wxRect::operator==(const wxRect& rect) const -{ - return ((x == rect.x) && - (y == rect.y) && - (width == rect.width) && - (height == rect.height)); -} - -wxRect wxRect::operator+(const wxRect& rect) const -{ - int x1 = wxMin(this->x, rect.x); - int y1 = wxMin(this->y, rect.y); - int y2 = wxMax(y+height, rect.height+rect.y); - int x2 = wxMax(x+width, rect.width+rect.x); - return wxRect(x1, y1, x2-x1, y2-y1); -} - -wxRect& wxRect::Union(const wxRect& rect) -{ - // ignore empty rectangles: union with an empty rectangle shouldn't extend - // this one to (0, 0) - if ( !width || !height ) - { - *this = rect; - } - else if ( rect.width && rect.height ) - { - int x1 = wxMin(x, rect.x); - int y1 = wxMin(y, rect.y); - int y2 = wxMax(y + height, rect.height + rect.y); - int x2 = wxMax(x + width, rect.width + rect.x); - - x = x1; - y = y1; - width = x2 - x1; - height = y2 - y1; - } - //else: we're not empty and rect is empty - - return *this; -} - -wxRect& wxRect::Inflate(wxCoord dx, wxCoord dy) -{ - if (-2*dx>width) - { - // Don't allow deflate to eat more width than we have, - // a well-defined rectangle cannot have negative width. - x+=width/2; - width=0; - } - else - { - // The inflate is valid. - x-=dx; - width+=2*dx; - } - - if (-2*dy>height) - { - // Don't allow deflate to eat more height than we have, - // a well-defined rectangle cannot have negative height. - y+=height/2; - height=0; - } - else - { - // The inflate is valid. - y-=dy; - height+=2*dy; - } - - return *this; -} - -bool wxRect::Contains(int cx, int cy) const -{ - return ( (cx >= x) && (cy >= y) - && ((cy - y) < height) - && ((cx - x) < width) - ); -} - -bool wxRect::Contains(const wxRect& rect) const -{ - return Contains(rect.GetTopLeft()) && Contains(rect.GetBottomRight()); -} - -wxRect& wxRect::Intersect(const wxRect& rect) -{ - int x2 = GetRight(), - y2 = GetBottom(); - - if ( x < rect.x ) - x = rect.x; - if ( y < rect.y ) - y = rect.y; - if ( x2 > rect.GetRight() ) - x2 = rect.GetRight(); - if ( y2 > rect.GetBottom() ) - y2 = rect.GetBottom(); - - width = x2 - x + 1; - height = y2 - y + 1; - - if ( width <= 0 || height <= 0 ) - { - width = - height = 0; - } - - return *this; -} - -bool wxRect::Intersects(const wxRect& rect) const -{ - wxRect r = Intersect(rect); - - // if there is no intersection, both width and height are 0 - return r.width != 0; -} - -// ============================================================================ -// wxColourDatabase -// ============================================================================ - -// ---------------------------------------------------------------------------- -// wxColourDatabase ctor/dtor -// ---------------------------------------------------------------------------- - -wxColourDatabase::wxColourDatabase () -{ - // will be created on demand in Initialize() - m_map = NULL; -} - -wxColourDatabase::~wxColourDatabase () -{ - if ( m_map ) - { - WX_CLEAR_HASH_MAP(wxStringToColourHashMap, *m_map); - - delete m_map; - } - -#ifdef __WXPM__ - delete [] m_palTable; -#endif -} - -// Colour database stuff -void wxColourDatabase::Initialize() -{ - if ( m_map ) - { - // already initialized - return; - } - - m_map = new wxStringToColourHashMap; - - static const struct wxColourDesc - { - const wxChar *name; - unsigned char r,g,b; - } - wxColourTable[] = - { - {wxT("AQUAMARINE"),112, 219, 147}, - {wxT("BLACK"),0, 0, 0}, - {wxT("BLUE"), 0, 0, 255}, - {wxT("BLUE VIOLET"), 159, 95, 159}, - {wxT("BROWN"), 165, 42, 42}, - {wxT("CADET BLUE"), 95, 159, 159}, - {wxT("CORAL"), 255, 127, 0}, - {wxT("CORNFLOWER BLUE"), 66, 66, 111}, - {wxT("CYAN"), 0, 255, 255}, - {wxT("DARK GREY"), 47, 47, 47}, // ? - - {wxT("DARK GREEN"), 47, 79, 47}, - {wxT("DARK OLIVE GREEN"), 79, 79, 47}, - {wxT("DARK ORCHID"), 153, 50, 204}, - {wxT("DARK SLATE BLUE"), 107, 35, 142}, - {wxT("DARK SLATE GREY"), 47, 79, 79}, - {wxT("DARK TURQUOISE"), 112, 147, 219}, - {wxT("DIM GREY"), 84, 84, 84}, - {wxT("FIREBRICK"), 142, 35, 35}, - {wxT("FOREST GREEN"), 35, 142, 35}, - {wxT("GOLD"), 204, 127, 50}, - {wxT("GOLDENROD"), 219, 219, 112}, - {wxT("GREY"), 128, 128, 128}, - {wxT("GREEN"), 0, 255, 0}, - {wxT("GREEN YELLOW"), 147, 219, 112}, - {wxT("INDIAN RED"), 79, 47, 47}, - {wxT("KHAKI"), 159, 159, 95}, - {wxT("LIGHT BLUE"), 191, 216, 216}, - {wxT("LIGHT GREY"), 192, 192, 192}, - {wxT("LIGHT STEEL BLUE"), 143, 143, 188}, - {wxT("LIME GREEN"), 50, 204, 50}, - {wxT("LIGHT MAGENTA"), 255, 0, 255}, - {wxT("MAGENTA"), 255, 0, 255}, - {wxT("MAROON"), 142, 35, 107}, - {wxT("MEDIUM AQUAMARINE"), 50, 204, 153}, - {wxT("MEDIUM GREY"), 100, 100, 100}, - {wxT("MEDIUM BLUE"), 50, 50, 204}, - {wxT("MEDIUM FOREST GREEN"), 107, 142, 35}, - {wxT("MEDIUM GOLDENROD"), 234, 234, 173}, - {wxT("MEDIUM ORCHID"), 147, 112, 219}, - {wxT("MEDIUM SEA GREEN"), 66, 111, 66}, - {wxT("MEDIUM SLATE BLUE"), 127, 0, 255}, - {wxT("MEDIUM SPRING GREEN"), 127, 255, 0}, - {wxT("MEDIUM TURQUOISE"), 112, 219, 219}, - {wxT("MEDIUM VIOLET RED"), 219, 112, 147}, - {wxT("MIDNIGHT BLUE"), 47, 47, 79}, - {wxT("NAVY"), 35, 35, 142}, - {wxT("ORANGE"), 204, 50, 50}, - {wxT("ORANGE RED"), 255, 0, 127}, - {wxT("ORCHID"), 219, 112, 219}, - {wxT("PALE GREEN"), 143, 188, 143}, - {wxT("PINK"), 255, 192, 203}, - {wxT("PLUM"), 234, 173, 234}, - {wxT("PURPLE"), 176, 0, 255}, - {wxT("RED"), 255, 0, 0}, - {wxT("SALMON"), 111, 66, 66}, - {wxT("SEA GREEN"), 35, 142, 107}, - {wxT("SIENNA"), 142, 107, 35}, - {wxT("SKY BLUE"), 50, 153, 204}, - {wxT("SLATE BLUE"), 0, 127, 255}, - {wxT("SPRING GREEN"), 0, 255, 127}, - {wxT("STEEL BLUE"), 35, 107, 142}, - {wxT("TAN"), 219, 147, 112}, - {wxT("THISTLE"), 216, 191, 216}, - {wxT("TURQUOISE"), 173, 234, 234}, - {wxT("VIOLET"), 79, 47, 79}, - {wxT("VIOLET RED"), 204, 50, 153}, - {wxT("WHEAT"), 216, 216, 191}, - {wxT("WHITE"), 255, 255, 255}, - {wxT("YELLOW"), 255, 255, 0}, - {wxT("YELLOW GREEN"), 153, 204, 50} - }; - - size_t n; - - for ( n = 0; n < WXSIZEOF(wxColourTable); n++ ) - { - const wxColourDesc& cc = wxColourTable[n]; - (*m_map)[cc.name] = new wxColour(cc.r, cc.g, cc.b); - } - -#ifdef __WXPM__ - m_palTable = new long[n]; - for ( n = 0; n < WXSIZEOF(wxColourTable); n++ ) - { - const wxColourDesc& cc = wxColourTable[n]; - m_palTable[n] = OS2RGB(cc.r,cc.g,cc.b); - } - m_nSize = n; -#endif -} - -// ---------------------------------------------------------------------------- -// wxColourDatabase operations -// ---------------------------------------------------------------------------- - -void wxColourDatabase::AddColour(const wxString& name, const wxColour& colour) -{ - Initialize(); - - // canonicalize the colour names before using them as keys: they should be - // in upper case - wxString colName = name; - colName.MakeUpper(); - - // ... and we also allow both grey/gray - wxString colNameAlt = colName; - if ( !colNameAlt.Replace(_T("GRAY"), _T("GREY")) ) - { - // but in this case it is not necessary so avoid extra search below - colNameAlt.clear(); - } - - wxStringToColourHashMap::iterator it = m_map->find(colName); - if ( it == m_map->end() && !colNameAlt.empty() ) - it = m_map->find(colNameAlt); - if ( it != m_map->end() ) - { - *(it->second) = colour; - } - else // new colour - { - (*m_map)[colName] = new wxColour(colour); - } -} - -wxColour wxColourDatabase::Find(const wxString& colour) const -{ - wxColourDatabase * const self = wxConstCast(this, wxColourDatabase); - self->Initialize(); - - // make the comparaison case insensitive and also match both grey and gray - wxString colName = colour; - colName.MakeUpper(); - wxString colNameAlt = colName; - if ( !colNameAlt.Replace(_T("GRAY"), _T("GREY")) ) - colNameAlt.clear(); - - wxStringToColourHashMap::iterator it = m_map->find(colName); - if ( it == m_map->end() && !colNameAlt.empty() ) - it = m_map->find(colNameAlt); - if ( it != m_map->end() ) - return *(it->second); - - // we did not find any result in existing colours: - // we won't use wxString -> wxColour conversion because the - // wxColour::Set(const wxString &) function which does that conversion - // internally uses this function (wxColourDatabase::Find) and we want - // to avoid infinite recursion ! - return wxNullColour; -} - -wxString wxColourDatabase::FindName(const wxColour& colour) const -{ - wxColourDatabase * const self = wxConstCast(this, wxColourDatabase); - self->Initialize(); - - typedef wxStringToColourHashMap::iterator iterator; - - for ( iterator it = m_map->begin(), en = m_map->end(); it != en; ++it ) - { - if ( *(it->second) == colour ) - return it->first; - } - - return wxEmptyString; -} - -// ---------------------------------------------------------------------------- -// deprecated wxColourDatabase methods -// ---------------------------------------------------------------------------- - -#if WXWIN_COMPATIBILITY_2_6 -wxColour *wxColourDatabase::FindColour(const wxString& name) -{ - // This function is deprecated, use Find() instead. - // Formerly this function sometimes would return a deletable pointer and - // sometimes a non-deletable one (when returning a colour from the database). - // Trying to delete the latter anyway results in problems, so probably - // nobody ever freed the pointers. Currently it always returns a new - // instance, which means there will be memory leaks. - wxLogDebug(wxT("wxColourDataBase::FindColour():") - wxT(" Please use wxColourDataBase::Find() instead")); - - // using a static variable here is not the most elegant solution but unless - // we want to make wxStringToColourHashMap public (i.e. move it to the - // header) so that we could have a member function returning - // wxStringToColourHashMap::iterator, there is really no good way to do it - // otherwise - // - // and knowing that this function is going to disappear in the next release - // anyhow I don't want to waste time on this - - static wxColour s_col; - - s_col = Find(name); - if ( !s_col.Ok() ) - return NULL; - - return new wxColour(s_col); -} -#endif // WXWIN_COMPATIBILITY_2_6 - -// ============================================================================ -// stock objects -// ============================================================================ - -static wxStockGDI gs_wxStockGDI_instance; -wxStockGDI* wxStockGDI::ms_instance = &gs_wxStockGDI_instance; -wxObject* wxStockGDI::ms_stockObject[ITEMCOUNT]; - -wxStockGDI::wxStockGDI() -{ -} - -wxStockGDI::~wxStockGDI() -{ -} - -void wxStockGDI::DeleteAll() -{ - for (unsigned i = 0; i < ITEMCOUNT; i++) - { - delete ms_stockObject[i]; - ms_stockObject[i] = NULL; - } -} - -const wxBrush* wxStockGDI::GetBrush(Item item) -{ - wxBrush* brush = wx_static_cast(wxBrush*, ms_stockObject[item]); - if (brush == NULL) - { - switch (item) - { - case BRUSH_BLACK: - brush = new wxBrush(*GetColour(COLOUR_BLACK), wxSOLID); - break; - case BRUSH_BLUE: - brush = new wxBrush(*GetColour(COLOUR_BLUE), wxSOLID); - break; - case BRUSH_CYAN: - brush = new wxBrush(*GetColour(COLOUR_CYAN), wxSOLID); - break; - case BRUSH_GREEN: - brush = new wxBrush(*GetColour(COLOUR_GREEN), wxSOLID); - break; - case BRUSH_GREY: - brush = new wxBrush(wxColour(wxT("GREY")), wxSOLID); - break; - case BRUSH_LIGHTGREY: - brush = new wxBrush(*GetColour(COLOUR_LIGHTGREY), wxSOLID); - break; - case BRUSH_MEDIUMGREY: - brush = new wxBrush(wxColour(wxT("MEDIUM GREY")), wxSOLID); - break; - case BRUSH_RED: - brush = new wxBrush(*GetColour(COLOUR_RED), wxSOLID); - break; - case BRUSH_TRANSPARENT: - brush = new wxBrush(*GetColour(COLOUR_BLACK), wxTRANSPARENT); - break; - case BRUSH_WHITE: - brush = new wxBrush(*GetColour(COLOUR_WHITE), wxSOLID); - break; - default: - wxFAIL; - } - ms_stockObject[item] = brush; - } - return brush; -} - -const wxColour* wxStockGDI::GetColour(Item item) -{ - wxColour* colour = wx_static_cast(wxColour*, ms_stockObject[item]); - if (colour == NULL) - { - switch (item) - { - case COLOUR_BLACK: - colour = new wxColour(0, 0, 0); - break; - case COLOUR_BLUE: - colour = new wxColour(0, 0, 255); - break; - case COLOUR_CYAN: - colour = new wxColour(wxT("CYAN")); - break; - case COLOUR_GREEN: - colour = new wxColour(0, 255, 0); - break; - case COLOUR_LIGHTGREY: - colour = new wxColour(wxT("LIGHT GREY")); - break; - case COLOUR_RED: - colour = new wxColour(255, 0, 0); - break; - case COLOUR_WHITE: - colour = new wxColour(255, 255, 255); - break; - default: - wxFAIL; - } - ms_stockObject[item] = colour; - } - return colour; -} - -const wxCursor* wxStockGDI::GetCursor(Item item) -{ - wxCursor* cursor = wx_static_cast(wxCursor*, ms_stockObject[item]); - if (cursor == NULL) - { - switch (item) - { - case CURSOR_CROSS: - cursor = new wxCursor(wxCURSOR_CROSS); - break; - case CURSOR_HOURGLASS: - cursor = new wxCursor(wxCURSOR_WAIT); - break; - case CURSOR_STANDARD: - cursor = new wxCursor(wxCURSOR_ARROW); - break; - default: - wxFAIL; - } - ms_stockObject[item] = cursor; - } - return cursor; -} - -const wxFont* wxStockGDI::GetFont(Item item) -{ - wxFont* font = wx_static_cast(wxFont*, ms_stockObject[item]); - if (font == NULL) - { - switch (item) - { - case FONT_ITALIC: - font = new wxFont(GetFont(FONT_NORMAL)->GetPointSize(), wxROMAN, wxITALIC, wxNORMAL); - break; - case FONT_NORMAL: - font = new wxFont(wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT)); - break; - case FONT_SMALL: - font = new wxFont(GetFont(FONT_NORMAL)->GetPointSize() - 2, wxSWISS, wxNORMAL, wxNORMAL); - break; - case FONT_SWISS: - font = new wxFont(GetFont(FONT_NORMAL)->GetPointSize(), wxSWISS, wxNORMAL, wxNORMAL); - break; - default: - wxFAIL; - } - ms_stockObject[item] = font; - } - return font; -} - -const wxPen* wxStockGDI::GetPen(Item item) -{ - wxPen* pen = wx_static_cast(wxPen*, ms_stockObject[item]); - if (pen == NULL) - { - switch (item) - { - case PEN_BLACK: - pen = new wxPen(*GetColour(COLOUR_BLACK), 1, wxSOLID); - break; - case PEN_BLACKDASHED: - pen = new wxPen(*GetColour(COLOUR_BLACK), 1, wxSHORT_DASH); - break; - case PEN_CYAN: - pen = new wxPen(*GetColour(COLOUR_CYAN), 1, wxSOLID); - break; - case PEN_GREEN: - pen = new wxPen(*GetColour(COLOUR_GREEN), 1, wxSOLID); - break; - case PEN_GREY: - pen = new wxPen(wxColour(wxT("GREY")), 1, wxSOLID); - break; - case PEN_LIGHTGREY: - pen = new wxPen(*GetColour(COLOUR_LIGHTGREY), 1, wxSOLID); - break; - case PEN_MEDIUMGREY: - pen = new wxPen(wxColour(wxT("MEDIUM GREY")), 1, wxSOLID); - break; - case PEN_RED: - pen = new wxPen(*GetColour(COLOUR_RED), 1, wxSOLID); - break; - case PEN_TRANSPARENT: - pen = new wxPen(*GetColour(COLOUR_BLACK), 1, wxTRANSPARENT); - break; - case PEN_WHITE: - pen = new wxPen(*GetColour(COLOUR_WHITE), 1, wxSOLID); - break; - default: - wxFAIL; - } - ms_stockObject[item] = pen; - } - return pen; -} - -void wxInitializeStockLists() -{ - wxTheColourDatabase = new wxColourDatabase; - - wxTheBrushList = new wxBrushList; - wxThePenList = new wxPenList; - wxTheFontList = new wxFontList; -} - -void wxDeleteStockLists() -{ - wxDELETE(wxTheBrushList); - wxDELETE(wxThePenList); - wxDELETE(wxTheFontList); -} - -// ============================================================================ -// wxTheXXXList stuff (semi-obsolete) -// ============================================================================ - -wxGDIObjListBase::wxGDIObjListBase() -{ -} - -wxGDIObjListBase::~wxGDIObjListBase() -{ - for (wxList::compatibility_iterator node = list.GetFirst(); node; node = node->GetNext()) - { - delete wx_static_cast(wxObject*, node->GetData()); - } -} - -wxPen *wxPenList::FindOrCreatePen (const wxColour& colour, int width, int style) -{ - for ( wxList::compatibility_iterator node = list.GetFirst(); - node; - node = node->GetNext() ) - { - wxPen * const pen = (wxPen *) node->GetData(); - if ( pen->GetWidth () == width && - pen->GetStyle () == style && - pen->GetColour() == colour ) - return pen; - } - - wxPen* pen = NULL; - wxPen penTmp(colour, width, style); - if (penTmp.Ok()) - { - pen = new wxPen(penTmp); - list.Append(pen); - } - - return pen; -} - -wxBrush *wxBrushList::FindOrCreateBrush (const wxColour& colour, int style) -{ - for ( wxList::compatibility_iterator node = list.GetFirst(); - node; - node = node->GetNext() ) - { - wxBrush * const brush = (wxBrush *) node->GetData (); - if ( brush->GetStyle () == style && brush->GetColour() == colour ) - return brush; - } - - wxBrush* brush = NULL; - wxBrush brushTmp(colour, style); - if (brushTmp.Ok()) - { - brush = new wxBrush(brushTmp); - list.Append(brush); - } - - return brush; -} - -wxFont *wxFontList::FindOrCreateFont(int pointSize, - int family, - int style, - int weight, - bool underline, - const wxString& facename, - wxFontEncoding encoding) -{ - wxFont *font; - wxList::compatibility_iterator node; - for (node = list.GetFirst(); node; node = node->GetNext()) - { - font = (wxFont *)node->GetData(); - if ( - font->GetPointSize () == pointSize && - font->GetStyle () == style && - font->GetWeight () == weight && - font->GetUnderlined () == underline ) - { - int fontFamily = font->GetFamily(); - -#if defined(__WXGTK__) - // under GTK the default family is wxSWISS, so looking for a font - // with wxDEFAULT family should return a wxSWISS one instead of - // creating a new one - bool same = (fontFamily == family) || - (fontFamily == wxSWISS && family == wxDEFAULT); -#else // !GTK - // VZ: but why elsewhere do we require an exact match? mystery... - bool same = fontFamily == family; -#endif // GTK/!GTK - - // empty facename matches anything at all: this is bad because - // depending on which fonts are already created, we might get back - // a different font if we create it with empty facename, but it is - // still better than never matching anything in the cache at all - // in this case - if ( same && !facename.empty() ) - { - const wxString& fontFace = font->GetFaceName(); - - // empty facename matches everything - same = !fontFace || fontFace == facename; - } - - if ( same && (encoding != wxFONTENCODING_DEFAULT) ) - { - // have to match the encoding too - same = font->GetEncoding() == encoding; - } - - if ( same ) - { - return font; - } - } - } - - // font not found, create the new one - font = NULL; - wxFont fontTmp(pointSize, family, style, weight, underline, facename, encoding); - if (fontTmp.Ok()) - { - font = new wxFont(fontTmp); - list.Append(font); - } - - return font; -} - -#if WXWIN_COMPATIBILITY_2_6 -void wxBrushList::AddBrush(wxBrush*) { } -void wxBrushList::RemoveBrush(wxBrush*) { } -void wxFontList::AddFont(wxFont*) { } -void wxFontList::RemoveFont(wxFont*) { } -void wxPenList::AddPen(wxPen*) { } -void wxPenList::RemovePen(wxPen*) { } -#endif - -wxSize wxGetDisplaySize() -{ - int x, y; - wxDisplaySize(& x, & y); - return wxSize(x, y); -} - -wxRect wxGetClientDisplayRect() -{ - int x, y, width, height; - wxClientDisplayRect(&x, &y, &width, &height); // call plat-specific version - return wxRect(x, y, width, height); -} - -wxSize wxGetDisplaySizeMM() -{ - int x, y; - wxDisplaySizeMM(& x, & y); - return wxSize(x, y); -} - -wxResourceCache::~wxResourceCache () -{ - wxList::compatibility_iterator node = GetFirst (); - while (node) { - wxObject *item = (wxObject *)node->GetData(); - delete item; - - node = node->GetNext (); - } -} diff --git a/wxWidgets/src/common/geometry.cpp b/wxWidgets/src/common/geometry.cpp deleted file mode 100644 index 362b1aee50..0000000000 --- a/wxWidgets/src/common/geometry.cpp +++ /dev/null @@ -1,364 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/common/geometry.cpp -// Purpose: Common Geometry Classes -// Author: Stefan Csomor -// Modified by: -// Created: 08/05/99 -// RCS-ID: -// Copyright: (c) 1999 Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_GEOMETRY - -#include "wx/geometry.h" - -#ifndef WX_PRECOMP - #include "wx/log.h" -#endif - -#include - -#include "wx/datstrm.h" - -// -// wxPoint2D -// - -// -// wxRect2D -// - -// wxDouble version - -// for the following calculations always remember -// that the right and bottom edges are not part of a rect - -bool wxRect2DDouble::Intersects( const wxRect2DDouble &rect ) const -{ - wxDouble left,right,bottom,top; - left = wxMax ( m_x , rect.m_x ); - right = wxMin ( m_x+m_width, rect.m_x + rect.m_width ); - top = wxMax ( m_y , rect.m_y ); - bottom = wxMin ( m_y+m_height, rect.m_y + rect.m_height ); - - if ( left < right && top < bottom ) - { - return true; - } - return false; -} - -void wxRect2DDouble::Intersect( const wxRect2DDouble &src1 , const wxRect2DDouble &src2 , wxRect2DDouble *dest ) -{ - wxDouble left,right,bottom,top; - left = wxMax ( src1.m_x , src2.m_x ); - right = wxMin ( src1.m_x+src1.m_width, src2.m_x + src2.m_width ); - top = wxMax ( src1.m_y , src2.m_y ); - bottom = wxMin ( src1.m_y+src1.m_height, src2.m_y + src2.m_height ); - - if ( left < right && top < bottom ) - { - dest->m_x = left; - dest->m_y = top; - dest->m_width = right - left; - dest->m_height = bottom - top; - } - else - { - dest->m_width = dest->m_height = 0; - } -} - -void wxRect2DDouble::Union( const wxRect2DDouble &src1 , const wxRect2DDouble &src2 , wxRect2DDouble *dest ) -{ - wxDouble left,right,bottom,top; - - left = wxMin ( src1.m_x , src2.m_x ); - right = wxMax ( src1.m_x+src1.m_width, src2.m_x + src2.m_width ); - top = wxMin ( src1.m_y , src2.m_y ); - bottom = wxMax ( src1.m_y+src1.m_height, src2.m_y + src2.m_height ); - - dest->m_x = left; - dest->m_y = top; - dest->m_width = right - left; - dest->m_height = bottom - top; -} - -void wxRect2DDouble::Union( const wxPoint2DDouble &pt ) -{ - wxDouble x = pt.m_x; - wxDouble y = pt.m_y; - - if ( x < m_x ) - { - SetLeft( x ); - } - else if ( x < m_x + m_width ) - { - // contained - } - else - { - SetRight( x ); - } - - if ( y < m_y ) - { - SetTop( y ); - } - else if ( y < m_y + m_height ) - { - // contained - } - else - { - SetBottom( y ); - } -} - -void wxRect2DDouble::ConstrainTo( const wxRect2DDouble &rect ) -{ - if ( GetLeft() < rect.GetLeft() ) - SetLeft( rect.GetLeft() ); - - if ( GetRight() > rect.GetRight() ) - SetRight( rect.GetRight() ); - - if ( GetBottom() > rect.GetBottom() ) - SetBottom( rect.GetBottom() ); - - if ( GetTop() < rect.GetTop() ) - SetTop( rect.GetTop() ); -} - -wxRect2DDouble& wxRect2DDouble::operator=( const wxRect2DDouble &r ) -{ - m_x = r.m_x; - m_y = r.m_y; - m_width = r.m_width; - m_height = r.m_height; - return *this; -} - -// integer version - -// for the following calculations always remember -// that the right and bottom edges are not part of a rect - -// wxPoint2D - -#if wxUSE_STREAMS -void wxPoint2DInt::WriteTo( wxDataOutputStream &stream ) const -{ - stream.Write32( m_x ); - stream.Write32( m_y ); -} - -void wxPoint2DInt::ReadFrom( wxDataInputStream &stream ) -{ - m_x = stream.Read32(); - m_y = stream.Read32(); -} -#endif // wxUSE_STREAMS - -wxDouble wxPoint2DInt::GetVectorAngle() const -{ - if ( m_x == 0 ) - { - if ( m_y >= 0 ) - return 90; - else - return 270; - } - if ( m_y == 0 ) - { - if ( m_x >= 0 ) - return 0; - else - return 180; - } - - // casts needed for MIPSpro compiler under SGI - wxDouble deg = atan2( (double)m_y , (double)m_x ) * 180 / M_PI; - if ( deg < 0 ) - { - deg += 360; - } - return deg; -} - - -void wxPoint2DInt::SetVectorAngle( wxDouble degrees ) -{ - wxDouble length = GetVectorLength(); - m_x = (int)(length * cos( degrees / 180 * M_PI )); - m_y = (int)(length * sin( degrees / 180 * M_PI )); -} - -wxDouble wxPoint2DDouble::GetVectorAngle() const -{ - if ( wxIsNullDouble(m_x) ) - { - if ( m_y >= 0 ) - return 90; - else - return 270; - } - if ( wxIsNullDouble(m_y) ) - { - if ( m_x >= 0 ) - return 0; - else - return 180; - } - wxDouble deg = atan2( m_y , m_x ) * 180 / M_PI; - if ( deg < 0 ) - { - deg += 360; - } - return deg; -} - -void wxPoint2DDouble::SetVectorAngle( wxDouble degrees ) -{ - wxDouble length = GetVectorLength(); - m_x = length * cos( degrees / 180 * M_PI ); - m_y = length * sin( degrees / 180 * M_PI ); -} - -// wxRect2D - -bool wxRect2DInt::Intersects( const wxRect2DInt &rect ) const -{ - wxInt32 left,right,bottom,top; - left = wxMax ( m_x , rect.m_x ); - right = wxMin ( m_x+m_width, rect.m_x + rect.m_width ); - top = wxMax ( m_y , rect.m_y ); - bottom = wxMin ( m_y+m_height, rect.m_y + rect.m_height ); - - if ( left < right && top < bottom ) - { - return true; - } - return false; -} - -void wxRect2DInt::Intersect( const wxRect2DInt &src1 , const wxRect2DInt &src2 , wxRect2DInt *dest ) -{ - wxInt32 left,right,bottom,top; - left = wxMax ( src1.m_x , src2.m_x ); - right = wxMin ( src1.m_x+src1.m_width, src2.m_x + src2.m_width ); - top = wxMax ( src1.m_y , src2.m_y ); - bottom = wxMin ( src1.m_y+src1.m_height, src2.m_y + src2.m_height ); - - if ( left < right && top < bottom ) - { - dest->m_x = left; - dest->m_y = top; - dest->m_width = right - left; - dest->m_height = bottom - top; - } - else - { - dest->m_width = dest->m_height = 0; - } -} - -void wxRect2DInt::Union( const wxRect2DInt &src1 , const wxRect2DInt &src2 , wxRect2DInt *dest ) -{ - wxInt32 left,right,bottom,top; - - left = wxMin ( src1.m_x , src2.m_x ); - right = wxMax ( src1.m_x+src1.m_width, src2.m_x + src2.m_width ); - top = wxMin ( src1.m_y , src2.m_y ); - bottom = wxMax ( src1.m_y+src1.m_height, src2.m_y + src2.m_height ); - - dest->m_x = left; - dest->m_y = top; - dest->m_width = right - left; - dest->m_height = bottom - top; -} - -void wxRect2DInt::Union( const wxPoint2DInt &pt ) -{ - wxInt32 x = pt.m_x; - wxInt32 y = pt.m_y; - - if ( x < m_x ) - { - SetLeft( x ); - } - else if ( x < m_x + m_width ) - { - // contained - } - else - { - SetRight( x ); - } - - if ( y < m_y ) - { - SetTop( y ); - } - else if ( y < m_y + m_height ) - { - // contained - } - else - { - SetBottom( y ); - } -} - -void wxRect2DInt::ConstrainTo( const wxRect2DInt &rect ) -{ - if ( GetLeft() < rect.GetLeft() ) - SetLeft( rect.GetLeft() ); - - if ( GetRight() > rect.GetRight() ) - SetRight( rect.GetRight() ); - - if ( GetBottom() > rect.GetBottom() ) - SetBottom( rect.GetBottom() ); - - if ( GetTop() < rect.GetTop() ) - SetTop( rect.GetTop() ); -} - -wxRect2DInt& wxRect2DInt::operator=( const wxRect2DInt &r ) -{ - m_x = r.m_x; - m_y = r.m_y; - m_width = r.m_width; - m_height = r.m_height; - return *this; -} - -#if wxUSE_STREAMS -void wxRect2DInt::WriteTo( wxDataOutputStream &stream ) const -{ - stream.Write32( m_x ); - stream.Write32( m_y ); - stream.Write32( m_width ); - stream.Write32( m_height ); -} - -void wxRect2DInt::ReadFrom( wxDataInputStream &stream ) -{ - m_x = stream.Read32(); - m_y = stream.Read32(); - m_width = stream.Read32(); - m_height = stream.Read32(); -} -#endif // wxUSE_STREAMS - -#endif // wxUSE_GEOMETRY diff --git a/wxWidgets/src/common/gifdecod.cpp b/wxWidgets/src/common/gifdecod.cpp deleted file mode 100644 index 1f3c869d58..0000000000 --- a/wxWidgets/src/common/gifdecod.cpp +++ /dev/null @@ -1,933 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/common/gifdecod.cpp -// Purpose: wxGIFDecoder, GIF reader for wxImage and wxAnimation -// Author: Guillermo Rodriguez Garcia -// Version: 3.04 -// RCS-ID: $Id: gifdecod.cpp 62183 2009-09-28 09:40:20Z JS $ -// Copyright: (c) Guillermo Rodriguez Garcia -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_STREAMS && wxUSE_GIF - -#ifndef WX_PRECOMP - #include "wx/palette.h" - #include "wx/log.h" - #include "wx/intl.h" -#endif - -#include -#include -#include "wx/gifdecod.h" - - - -//--------------------------------------------------------------------------- -// GIFImage -//--------------------------------------------------------------------------- - -// internal class for storing GIF image data -class GIFImage -{ -public: - // def ctor - GIFImage(); - - unsigned int w; // width - unsigned int h; // height - unsigned int left; // x coord (in logical screen) - unsigned int top; // y coord (in logical screen) - int transparent; // transparent color index (-1 = none) - wxAnimationDisposal disposal; // disposal method - long delay; // delay in ms (-1 = unused) - unsigned char *p; // bitmap - unsigned char *pal; // palette - unsigned int ncolours; // number of colours - - DECLARE_NO_COPY_CLASS(GIFImage) -}; - - - -//--------------------------------------------------------------------------- -// GIFImage constructor -//--------------------------------------------------------------------------- -GIFImage::GIFImage() -{ - w = 0; - h = 0; - left = 0; - top = 0; - transparent = 0; - disposal = wxANIM_DONOTREMOVE; - delay = -1; - p = (unsigned char *) NULL; - pal = (unsigned char *) NULL; - ncolours = 0; -} - -//--------------------------------------------------------------------------- -// wxGIFDecoder constructor and destructor -//--------------------------------------------------------------------------- - -wxGIFDecoder::wxGIFDecoder() -{ -} - -wxGIFDecoder::~wxGIFDecoder() -{ - Destroy(); -} - -void wxGIFDecoder::Destroy() -{ - wxASSERT(m_nFrames==m_frames.GetCount()); - for (unsigned int i=0; ip); - free(f->pal); - delete f; - } - - m_frames.Clear(); - m_nFrames = 0; -} - - -//--------------------------------------------------------------------------- -// Convert this image to a wxImage object -//--------------------------------------------------------------------------- - -// This function was designed by Vaclav Slavik - -bool wxGIFDecoder::ConvertToImage(unsigned int frame, wxImage *image) const -{ - unsigned char *src, *dst, *pal; - unsigned long i; - int transparent; - - // just in case... - image->Destroy(); - - // create the image - wxSize sz = GetFrameSize(frame); - image->Create(sz.GetWidth(), sz.GetHeight()); - - if (!image->Ok()) - return false; - - pal = GetPalette(frame); - src = GetData(frame); - dst = image->GetData(); - transparent = GetTransparentColourIndex(frame); - - // set transparent colour mask - if (transparent != -1) - { - for (i = 0; i < GetNcolours(frame); i++) - { - if ((pal[3 * i + 0] == 255) && - (pal[3 * i + 1] == 0) && - (pal[3 * i + 2] == 255)) - { - pal[3 * i + 2] = 254; - } - } - - pal[3 * transparent + 0] = 255, - pal[3 * transparent + 1] = 0, - pal[3 * transparent + 2] = 255; - - image->SetMaskColour(255, 0, 255); - } - else - image->SetMask(false); - -#if wxUSE_PALETTE - unsigned char r[256]; - unsigned char g[256]; - unsigned char b[256]; - - for (i = 0; i < 256; i++) - { - r[i] = pal[3*i + 0]; - g[i] = pal[3*i + 1]; - b[i] = pal[3*i + 2]; - } - - image->SetPalette(wxPalette(GetNcolours(frame), r, g, b)); -#endif // wxUSE_PALETTE - - // copy image data - unsigned long npixel = sz.GetWidth() * sz.GetHeight(); - for (i = 0; i < npixel; i++, src++) - { - *(dst++) = pal[3 * (*src) + 0]; - *(dst++) = pal[3 * (*src) + 1]; - *(dst++) = pal[3 * (*src) + 2]; - } - - return true; -} - - -//--------------------------------------------------------------------------- -// Data accessors -//--------------------------------------------------------------------------- - -#define GetFrame(n) ((GIFImage*)m_frames[n]) - - -// Get data for current frame - -wxSize wxGIFDecoder::GetFrameSize(unsigned int frame) const -{ - return wxSize(GetFrame(frame)->w, GetFrame(frame)->h); -} - -wxPoint wxGIFDecoder::GetFramePosition(unsigned int frame) const -{ - return wxPoint(GetFrame(frame)->left, GetFrame(frame)->top); -} - -wxAnimationDisposal wxGIFDecoder::GetDisposalMethod(unsigned int frame) const -{ - return GetFrame(frame)->disposal; -} - -long wxGIFDecoder::GetDelay(unsigned int frame) const -{ - return GetFrame(frame)->delay; -} - -wxColour wxGIFDecoder::GetTransparentColour(unsigned int frame) const -{ - unsigned char *pal = GetFrame(frame)->pal; - int n = GetFrame(frame)->transparent; - if (n == -1) - return wxNullColour; - - return wxColour(pal[n*3 + 0], - pal[n*3 + 1], - pal[n*3 + 2]); -} - -unsigned char* wxGIFDecoder::GetData(unsigned int frame) const { return (GetFrame(frame)->p); } -unsigned char* wxGIFDecoder::GetPalette(unsigned int frame) const { return (GetFrame(frame)->pal); } -unsigned int wxGIFDecoder::GetNcolours(unsigned int frame) const { return (GetFrame(frame)->ncolours); } -int wxGIFDecoder::GetTransparentColourIndex(unsigned int frame) const { return (GetFrame(frame)->transparent); } - - - -//--------------------------------------------------------------------------- -// GIF reading and decoding -//--------------------------------------------------------------------------- - -// getcode: -// Reads the next code from the file stream, with size 'bits' -// -int wxGIFDecoder::getcode(wxInputStream& stream, int bits, int ab_fin) -{ - unsigned int mask; // bit mask - unsigned int code; // code (result) - - // get remaining bits from last byte read - mask = (1 << bits) - 1; - code = (m_lastbyte >> (8 - m_restbits)) & mask; - - // keep reading new bytes while needed - while (bits > m_restbits) - { - // if no bytes left in this block, read the next block - if (m_restbyte == 0) - { - m_restbyte = (unsigned char)stream.GetC(); - - /* Some encoders are a bit broken: instead of issuing - * an end-of-image symbol (ab_fin) they come up with - * a zero-length subblock!! We catch this here so - * that the decoder sees an ab_fin code. - */ - if (m_restbyte == 0) - { - code = ab_fin; - break; - } - - // prefetch data - stream.Read((void *) m_buffer, m_restbyte); - if (stream.LastRead() != m_restbyte) - { - code = ab_fin; - return code; - } - m_bufp = m_buffer; - } - - // read next byte and isolate the bits we need - m_lastbyte = (unsigned char) (*m_bufp++); - mask = (1 << (bits - m_restbits)) - 1; - code = code + ((m_lastbyte & mask) << m_restbits); - m_restbyte--; - - // adjust total number of bits extracted from the buffer - m_restbits = m_restbits + 8; - } - - // find number of bits remaining for next code - m_restbits = (m_restbits - bits); - - return code; -} - - -// dgif: -// GIF decoding function. The initial code size (aka root size) -// is 'bits'. Supports interlaced images (interl == 1). -// Returns wxGIF_OK (== 0) on success, or an error code if something -// fails (see header file for details) -wxGIFErrorCode -wxGIFDecoder::dgif(wxInputStream& stream, GIFImage *img, int interl, int bits) -{ - static const int allocSize = 4096 + 1; - int *ab_prefix = new int[allocSize]; // alphabet (prefixes) - if (ab_prefix == NULL) - { - return wxGIF_MEMERR; - } - - int *ab_tail = new int[allocSize]; // alphabet (tails) - if (ab_tail == NULL) - { - delete[] ab_prefix; - return wxGIF_MEMERR; - } - - int *stack = new int[allocSize]; // decompression stack - if (stack == NULL) - { - delete[] ab_prefix; - delete[] ab_tail; - return wxGIF_MEMERR; - } - - int ab_clr; // clear code - int ab_fin; // end of info code - int ab_bits; // actual symbol width, in bits - int ab_free; // first free position in alphabet - int ab_max; // last possible character in alphabet - int pass; // pass number in interlaced images - int pos; // index into decompresion stack - unsigned int x, y; // position in image buffer - - int code, readcode, lastcode, abcabca; - - // these won't change - ab_clr = (1 << bits); - ab_fin = (1 << bits) + 1; - - // these will change through the decompression proccess - ab_bits = bits + 1; - ab_free = (1 << bits) + 2; - ab_max = (1 << ab_bits) - 1; - lastcode = -1; - abcabca = -1; - pass = 1; - pos = x = y = 0; - - // reset decoder vars - m_restbits = 0; - m_restbyte = 0; - m_lastbyte = 0; - - do - { - // get next code - readcode = code = getcode(stream, ab_bits, ab_fin); - - // end of image? - if (code == ab_fin) break; - - // reset alphabet? - if (code == ab_clr) - { - // reset main variables - ab_bits = bits + 1; - ab_free = (1 << bits) + 2; - ab_max = (1 << ab_bits) - 1; - lastcode = -1; - abcabca = -1; - - // skip to next code - continue; - } - - // unknown code: special case (like in ABCABCA) - if (code >= ab_free) - { - code = lastcode; // take last string - stack[pos++] = abcabca; // add first character - } - - // build the string for this code in the stack - while (code > ab_clr) - { - stack[pos++] = ab_tail[code]; - code = ab_prefix[code]; - - // Don't overflow. This shouldn't happen with normal - // GIF files, the allocSize of 4096+1 is enough. This - // will only happen with badly formed GIFs. - if (pos >= allocSize) - { - delete[] ab_prefix; - delete[] ab_tail; - delete[] stack; - return wxGIF_INVFORMAT; - } - } - - if (pos >= allocSize) - { - delete[] ab_prefix; - delete[] ab_tail; - delete[] stack; - return wxGIF_INVFORMAT; - } - - stack[pos] = code; // push last code into the stack - abcabca = code; // save for special case - - // make new entry in alphabet (only if NOT just cleared) - if (lastcode != -1) - { - // Normally, after the alphabet is full and can't grow any - // further (ab_free == 4096), encoder should (must?) emit CLEAR - // to reset it. This checks whether we really got it, otherwise - // the GIF is damaged. - if (ab_free > ab_max) - { - delete[] ab_prefix; - delete[] ab_tail; - delete[] stack; - return wxGIF_INVFORMAT; - } - - // This assert seems unnecessary since the condition above - // eliminates the only case in which it went false. But I really - // don't like being forced to ask "Who in .text could have - // written there?!" And I wouldn't have been forced to ask if - // this line had already been here. - wxASSERT(ab_free < allocSize); - - ab_prefix[ab_free] = lastcode; - ab_tail[ab_free] = code; - ab_free++; - - if ((ab_free > ab_max) && (ab_bits < 12)) - { - ab_bits++; - ab_max = (1 << ab_bits) - 1; - } - } - - // dump stack data to the image buffer - while (pos >= 0) - { - (img->p)[x + (y * (img->w))] = (char) stack[pos]; - pos--; - - if (++x >= (img->w)) - { - x = 0; - - if (interl) - { - // support for interlaced images - switch (pass) - { - case 1: y += 8; break; - case 2: y += 8; break; - case 3: y += 4; break; - case 4: y += 2; break; - } - - /* loop until a valid y coordinate has been - found, Or if the maximum number of passes has - been reached, exit the loop, and stop image - decoding (At this point the image is successfully - decoded). - If we don't loop, but merely set y to some other - value, that new value might still be invalid depending - on the height of the image. This would cause out of - bounds writing. - */ - while (y >= (img->h)) - { - switch (++pass) - { - case 2: y = 4; break; - case 3: y = 2; break; - case 4: y = 1; break; - - default: - /* - It's possible we arrive here. For example this - happens when the image is interlaced, and the - height is 1. Looking at the above cases, the - lowest possible y is 1. While the only valid - one would be 0 for an image of height 1. So - 'eventually' the loop will arrive here. - This case makes sure this while loop is - exited, as well as the 2 other ones. - */ - - // Set y to a valid coordinate so the local - // while loop will be exited. (y = 0 always - // is >= img->h since if img->h == 0 the - // image is never decoded) - y = 0; - - // This will exit the other outer while loop - pos = -1; - - // This will halt image decoding. - code = ab_fin; - - break; - } - } - } - else - { - // non-interlaced - y++; -/* -Normally image decoding is finished when an End of Information code is -encountered (code == ab_fin) however some broken encoders write wrong -"block byte counts" (The first byte value after the "code size" byte), -being one value too high. It might very well be possible other variants -of this problem occur as well. The only sensible solution seems to -be to check for clipping. -Example of wrong encoding: -(1 * 1 B/W image, raster data stream follows in hex bytes) - -02 << B/W images have a code size of 2 -02 << Block byte count -44 << LZW packed -00 << Zero byte count (terminates data stream) - -Because the block byte count is 2, the zero byte count is used in the -decoding process, and decoding is continued after this byte. (While it -should signal an end of image) - -It should be: -02 -02 -44 -01 << When decoded this correctly includes the End of Information code -00 - -Or (Worse solution): -02 -01 -44 -00 -(The 44 doesn't include an End of Information code, but at least the -decoder correctly skips to 00 now after decoding, and signals this -as an End of Information itself) -*/ - if (y >= img->h) - { - code = ab_fin; - break; - } - } - } - } - - pos = 0; - lastcode = readcode; - } - while (code != ab_fin); - - delete [] ab_prefix ; - delete [] ab_tail ; - delete [] stack ; - - return wxGIF_OK; -} - - -// CanRead: -// Returns true if the file looks like a valid GIF, false otherwise. -// -bool wxGIFDecoder::CanRead(wxInputStream &stream) const -{ - unsigned char buf[3]; - - if ( !stream.Read(buf, WXSIZEOF(buf)) ) - return false; - - stream.SeekI(-(wxFileOffset)WXSIZEOF(buf), wxFromCurrent); - - return memcmp(buf, "GIF", WXSIZEOF(buf)) == 0; -} - - -// LoadGIF: -// Reads and decodes one or more GIF images, depending on whether -// animated GIF support is enabled. Can read GIFs with any bit -// size (color depth), but the output images are always expanded -// to 8 bits per pixel. Also, the image palettes always contain -// 256 colors, although some of them may be unused. Returns wxGIF_OK -// (== 0) on success, or an error code if something fails (see -// header file for details) -// -wxGIFErrorCode wxGIFDecoder::LoadGIF(wxInputStream& stream) -{ - unsigned int global_ncolors = 0; - int bits, interl, i; - wxAnimationDisposal disposal; - long size; - long delay; - unsigned char type = 0; - unsigned char pal[768]; - unsigned char buf[16]; - bool anim = true; - - // check GIF signature - if (!CanRead(stream)) - return wxGIF_INVFORMAT; - - // check for animated GIF support (ver. >= 89a) - - static const unsigned int headerSize = (3 + 3); - stream.Read(buf, headerSize); - if (stream.LastRead() != headerSize) - { - return wxGIF_INVFORMAT; - } - - if (memcmp(buf + 3, "89a", 3) < 0) - { - anim = false; - } - - // read logical screen descriptor block (LSDB) - static const unsigned int lsdbSize = (2 + 2 + 1 + 1 + 1); - stream.Read(buf, lsdbSize); - if (stream.LastRead() != lsdbSize) - { - return wxGIF_INVFORMAT; - } - - m_szAnimation.SetWidth( buf[0] + 256 * buf[1] ); - m_szAnimation.SetHeight( buf[2] + 256 * buf[3] ); - - if (anim && ((m_szAnimation.GetWidth() == 0) || (m_szAnimation.GetHeight() == 0))) - { - return wxGIF_INVFORMAT; - } - - // load global color map if available - if ((buf[4] & 0x80) == 0x80) - { - int backgroundColIndex = buf[5]; - - global_ncolors = 2 << (buf[4] & 0x07); - unsigned int numBytes = 3 * global_ncolors; - stream.Read(pal, numBytes); - if (stream.LastRead() != numBytes) - { - return wxGIF_INVFORMAT; - } - - m_background.Set(pal[backgroundColIndex*3 + 0], - pal[backgroundColIndex*3 + 1], - pal[backgroundColIndex*3 + 2]); - } - - // transparent colour, disposal method and delay default to unused - int transparent = -1; - disposal = wxANIM_UNSPECIFIED; - delay = -1; - - bool done = false; - while (!done) - { - type = (unsigned char)stream.GetC(); - - /* - If the end of file has been reached (or an error) and a ";" - (0x3B) hasn't been encountered yet, exit the loop. (Without this - check the while loop would loop endlessly.) Later on, in the next while - loop, the file will be treated as being truncated (But still - be decoded as far as possible). returning wxGIF_TRUNCATED is not - possible here since some init code is done after this loop. - */ - if (stream.Eof())// || !stream.IsOk()) - { - /* - type is set to some bogus value, so there's no - need to continue evaluating it. - */ - break; // Alternative : "return wxGIF_INVFORMAT;" - } - - // end of data? - if (type == 0x3B) - { - done = true; - } - else - // extension block? - if (type == 0x21) - { - if (((unsigned char)stream.GetC()) == 0xF9) - // graphics control extension, parse it - { - static const unsigned int gceSize = 6; - stream.Read(buf, gceSize); - if (stream.LastRead() != gceSize) - { - Destroy(); - return wxGIF_INVFORMAT; - } - - // read delay and convert from 1/100 of a second to ms - delay = 10 * (buf[2] + 256 * buf[3]); - - // read transparent colour index, if used - transparent = buf[1] & 0x01 ? buf[4] : -1; - - // read disposal method - disposal = (wxAnimationDisposal)(((buf[1] & 0x1C) >> 2) - 1); - } - else - // other extension, skip - { - while ((i = (unsigned char)stream.GetC()) != 0) - { - if (stream.Eof() || (stream.LastRead() == 0)) - { - done = true; - break; - } - stream.SeekI(i, wxFromCurrent); - } - } - } - else - // image descriptor block? - if (type == 0x2C) - { - // allocate memory for IMAGEN struct - GIFImage *pimg = new GIFImage(); - - if (pimg == NULL) - { - Destroy(); - return wxGIF_MEMERR; - } - - // fill in the data - static const unsigned int idbSize = (2 + 2 + 2 + 2 + 1); - stream.Read(buf, idbSize); - if (stream.LastRead() != idbSize) - { - Destroy(); - return wxGIF_INVFORMAT; - } - - pimg->left = buf[0] + 256 * buf[1]; - pimg->top = buf[2] + 256 * buf[3]; -/* - pimg->left = buf[4] + 256 * buf[5]; - pimg->top = buf[4] + 256 * buf[5]; -*/ - pimg->w = buf[4] + 256 * buf[5]; - pimg->h = buf[6] + 256 * buf[7]; - -#if 0 - if (anim && ((pimg->w == 0) || (pimg->w > (unsigned int)m_szAnimation.GetWidth()) || - (pimg->h == 0) || (pimg->h > (unsigned int)m_szAnimation.GetHeight()))) - { - Destroy(); - return wxGIF_INVFORMAT; - } -#endif - if ( anim ) - { - // some GIF images specify incorrect animation size but we can - // still open them if we fix up the animation size, see #9465 - if ( m_nFrames == 0 ) - { - if ( pimg->w > (unsigned)m_szAnimation.x ) - m_szAnimation.x = pimg->w; - if ( pimg->h > (unsigned)m_szAnimation.y ) - m_szAnimation.y = pimg->h; - } - else // subsequent frames - { - // check that we have valid size - if ( (!pimg->w || pimg->w > (unsigned)m_szAnimation.x) || - (!pimg->h || pimg->h > (unsigned)m_szAnimation.y) ) - { - wxLogError(_("Incorrect GIF frame size (%u, %d) for the frame #%u"), - pimg->w, pimg->h, m_nFrames); - Destroy(); - return wxGIF_INVFORMAT; - } - } - } - - interl = ((buf[8] & 0x40)? 1 : 0); - size = pimg->w * pimg->h; - - pimg->transparent = transparent; - pimg->disposal = disposal; - pimg->delay = delay; - - // allocate memory for image and palette - pimg->p = (unsigned char *) malloc((unsigned int)size); - pimg->pal = (unsigned char *) malloc(768); - - if ((!pimg->p) || (!pimg->pal)) - { - Destroy(); - return wxGIF_MEMERR; - } - - // load local color map if available, else use global map - if ((buf[8] & 0x80) == 0x80) - { - unsigned int local_ncolors = 2 << (buf[8] & 0x07); - unsigned int numBytes = 3 * local_ncolors; - stream.Read(pimg->pal, numBytes); - pimg->ncolours = local_ncolors; - if (stream.LastRead() != numBytes) - { - Destroy(); - return wxGIF_INVFORMAT; - } - } - else - { - memcpy(pimg->pal, pal, 768); - pimg->ncolours = global_ncolors; - } - - // get initial code size from first byte in raster data - bits = (unsigned char)stream.GetC(); - if (bits == 0) - { - Destroy(); - return wxGIF_INVFORMAT; - } - - // decode image - wxGIFErrorCode result = dgif(stream, pimg, interl, bits); - if (result != wxGIF_OK) - { - Destroy(); - return result; - } - - // add the image to our frame array - m_frames.Add((void*)pimg); - m_nFrames++; - - // if this is not an animated GIF, exit after first image - if (!anim) - done = true; - } - } - - if (m_nFrames <= 0) - { - Destroy(); - return wxGIF_INVFORMAT; - } - - // try to read to the end of the stream - while (type != 0x3B) - { - if (!stream.IsOk()) - return wxGIF_TRUNCATED; - - type = (unsigned char)stream.GetC(); - - if (type == 0x21) - { - // extension type - (void) stream.GetC(); - - // skip all data - while ((i = (unsigned char)stream.GetC()) != 0) - { - if (stream.Eof() || (stream.LastRead() == 0)) - { - Destroy(); - return wxGIF_INVFORMAT; - } - stream.SeekI(i, wxFromCurrent); - } - } - else if (type == 0x2C) - { - // image descriptor block - static const unsigned int idbSize = (2 + 2 + 2 + 2 + 1); - stream.Read(buf, idbSize); - if (stream.LastRead() != idbSize) - { - Destroy(); - return wxGIF_INVFORMAT; - } - - // local color map - if ((buf[8] & 0x80) == 0x80) - { - unsigned int local_ncolors = 2 << (buf[8] & 0x07); - wxFileOffset numBytes = 3 * local_ncolors; - stream.SeekI(numBytes, wxFromCurrent); - } - - // initial code size - (void) stream.GetC(); - if (stream.Eof() || (stream.LastRead() == 0)) - { - Destroy(); - return wxGIF_INVFORMAT; - } - - // skip all data - while ((i = (unsigned char)stream.GetC()) != 0) - { - if (stream.Eof() || (stream.LastRead() == 0)) - { - Destroy(); - return wxGIF_INVFORMAT; - } - stream.SeekI(i, wxFromCurrent); - } - } - else if ((type != 0x3B) && (type != 00)) // testing - { - // images are OK, but couldn't read to the end of the stream - return wxGIF_TRUNCATED; - } - } - - return wxGIF_OK; -} - -#endif // wxUSE_STREAMS && wxUSE_GIF diff --git a/wxWidgets/src/common/glob.inc b/wxWidgets/src/common/glob.inc deleted file mode 100644 index fc1e084d62..0000000000 --- a/wxWidgets/src/common/glob.inc +++ /dev/null @@ -1,367 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: glob.inc -// Purpose: File and other globbing (included by utils.cpp) -// Author: Karsten Ballueder -// Modified by: -// Created: 20/5/1998 -// RCS-ID: $Id: glob.inc 33948 2005-05-04 18:57:50Z JS $ -// Copyright: (c) Karsten Ballueder -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// This file includes: -// wxIsWild(const char *pattern) -// wxMatchWild(const char *pattern, const char *str, bool dot_special) -// - -//--------------------------------------------------------------------------------- -#ifndef UNIX_GLOB -# ifdef wx_x -# define UNIX_GLOB 1 -# else -# define UNIX_GLOB 0 -# endif -#endif - -#if UNIX_GLOB -# ifdef wx_msw -# error "Can't use Unix file globbing under Windows!" -# endif -#endif - -/************************************************************************* - * - * wxIsWild checks whether the pattern contains wildcards, and - * returns TRUE if it does, and FALSE if it does not (or if the - * pattern is NULL -- i.e. no string). - * - * The argument is: - * - * 1) pattern - a character string - */ -bool -wxIsWild (const char *pattern) -{ - while (*pattern) - { - switch (*pattern++) - { - case '?': - case '*': -#if UNIX_GLOB - case '[': - case '{': /* } */ -#endif - return TRUE; -#if UNIX_GLOB - case '\\': - if (!*pattern++) - return FALSE; -#endif - } /* switch() */ - } /* while() */ - return FALSE; -} - - - -#if UNIX_GLOB - -// Unix Glob() -// -// Pattern Function -// ----------------------------------------------------- -// '*' = match 0 or more occurances of anything -// "[abc]" = match anyof "abc" (ranges supported) -// "{xx,yy,zz}" = match anyof "xx", "yy", or "zz" -// '?' = match any character -// -// '\' is used to "escape" special characters -// Recursive - -bool -wxMatchWild (const char *pattern, const char *str, bool dot_special) -{ - char c; - const char *cp; - bool done = FALSE, ret_code, ok; - // Below is for vi fans - const char OB = '{', CB = '}'; - -#if 0 - if (strcmp(pattern, "*.*") == 0) - pattern = "*"; // Hack for MS-DOS compat. -#endif - - // dot_special means '.' only matches '.' - if (dot_special && *str == '.' && *pattern != *str) - return FALSE; - - while ((*pattern != '\0') && (!done) && (((*str == '\0') && - ((*pattern == OB) || (*pattern == '*'))) || (*str != '\0'))) - { - switch (*pattern) - { - case '\\': - pattern++; - if (*pattern != '\0') - pattern++; - break; - case '*': - pattern++; - ret_code = FALSE; - while ((*str != '\0') && (!(ret_code = wxMatchWild (pattern, str++, FALSE)))); - if (ret_code) - { - while (*str != '\0') - str++; - while (*pattern != '\0') - pattern++; - } - break; - case '[': - pattern++; - repeat: - if ((*pattern == '\0') || (*pattern == ']')) - { - done = TRUE; - break; - } - if (*pattern == '\\') - { - pattern++; - if (*pattern == '\0') - { - done = TRUE; - break; - } - } - if (*(pattern + 1) == '-') - { - c = *pattern; - pattern += 2; - if (*pattern == ']') - { - done = TRUE; - break; - } - if (*pattern == '\\') - { - pattern++; - if (*pattern == '\0') - { - done = TRUE; - break; - } - } - if ((*str < c) || (*str > *pattern)) - { - pattern++; - goto repeat; - } - } - else if (*pattern != *str) - { - pattern++; - goto repeat; - } - pattern++; - while ((*pattern != ']') && (*pattern != '\0')) - { - if ((*pattern == '\\') && (*(pattern + 1) != '\0')) - pattern++; - pattern++; - } // while() - if (*pattern != '\0') - { - pattern++, str++; - } - break; - case '?': - pattern++; - str++; - break; - case OB: - pattern++; - while ((*pattern != CB) && (*pattern != '\0')) - { - cp = str; - ok = TRUE; - while (ok && (*cp != '\0') && (*pattern != '\0') && - (*pattern != ',') && (*pattern != CB)) - { - if (*pattern == '\\') - pattern++; - ok = (*pattern++ == *cp++); - } // while() - if (*pattern == '\0') - { - ok = FALSE; - done = TRUE; - break; - } - else if (ok) - { - str = cp; - while ((*pattern != CB) && (*pattern != '\0')) - { - if (*++pattern == '\\') - { - if (*++pattern == CB) - pattern++; - } - } // while() - } - else - { - while (*pattern != CB && *pattern != ',' && *pattern != '\0') - { - if (*++pattern == '\\') - { - if (*++pattern == CB || *pattern == ',') - pattern++; - } - } // while() - } - if (*pattern != '\0') - pattern++; - } // while() - break; - default: - if (*str == *pattern) - { - str++, pattern++; - } - else - { - done = TRUE; - } - } // switch() - } // while() - while (*pattern == '*') - pattern++; - return ((*str == '\0') && (*pattern == '\0')); -} - -#else /* MS-DOS/Windows glob() */ -/************************************************************************* - * - * wxMatchWild matches the given pattern string against - * a text string, and returns TRUE if it matches, FALSE otherwise. - * - * A match means that the entire text string is used up in the matching. - * The pattern can contain the following wildcards. - * - * * -- matches any sequence of characters - * ? -- matches one character - * - * If one or other or both of the string arguments to wxMatchWild function is - * NULL (i.e. there isn't a string), then the function returns FALSE. - * - */ -static bool wxPatternMatch (const char *pattern, const char *text, size_t i, size_t j); - -// @@@@ dotSpecial is ignored by MS-DOS -bool -wxMatchWild (const char *pattern, const char *text, bool /* dotSpecial */ ) -{ - if (pattern == NULL || text == NULL || *pattern == '\0' || *text == '\0') - return FALSE; - return wxPatternMatch (pattern, text, 0, 0); -} - -/************************************************************************* - * - * wxPatternMatch does the work for wxMatchWild. wxPatternMatch matches - * the given pattern string against a text string, and returns TRUE if - * it matches, FALSE otherwise. It is assumed that the string arguments - * to wxPatternMatch exist. - * - * A match means that the entire text string is used up in the matching. - * The pattern can contain the following wildcards. - * - * * -- matches any sequence of characters - * ? -- matches one character - * - * wxPatternMatch works by going down the pattern trying to match the - * the same index character in the pattern and string arrays, and stops - * when the end of the pattern or text string is reached. However, if a - * '*' wildcard is met, the algorithm checks to see whether the remaining - * pattern (after the wildcard) matches the rest of the text (i.e. the - * wxPatternMatch function is called recursively). - */ -// Recursive -static bool -wxPatternMatch (const char *pattern, const char *text, size_t i, size_t j) -{ - size_t pattern_length = strlen (pattern); - size_t text_length = strlen (text); - bool match = FALSE; - -#ifdef wx_msw -// MS-DOS file system is case INDEPENDENT -# define EQU(x,y) (wxToLower(x) == wxToLower(y)) -#else -# define EQU(x,y) ((x) == (y)) -#endif - - while (j < pattern_length && i < text_length) - { - if (EQU(text[i], pattern[j]) || pattern[j] == '?') - { - match = TRUE; - i++, j++; - } - else if (pattern[j] == '*') - { - // If pattern ends in '*' - if (++j == pattern_length) - { - match = TRUE; - i = text_length; - } - else - { - match = FALSE; -// after wildcard check to see whether rest of pattern matches - // up with rest of text - while (i < text_length && match != TRUE) - { - match = wxPatternMatch (pattern, text, i, j); - i++; - } -// text index is decremented so that it points to where - // the text string starts to match the rest of the pattern - i--; - } - } - else if (! EQU(text[i], pattern[j])) - { - j = pattern_length; - match = FALSE; - } - } - if (j == pattern_length && i == text_length && match == TRUE) - { - return TRUE; - } - else -// special case where pattern and text are the same except that pattern - // also only has '*' wildcards on the end - if (i == text_length && pattern[j] == '*' && match == TRUE) - { - for (; j < pattern_length; j++) - { - if (pattern[j] != '*') - return FALSE; - } - return TRUE; - } - else - { - return FALSE; - } -} - -#endif /* UNIX_GLOB */ -//----------------------------------------------------------------------------- diff --git a/wxWidgets/src/common/graphcmn.cpp b/wxWidgets/src/common/graphcmn.cpp deleted file mode 100644 index 70f1a34164..0000000000 --- a/wxWidgets/src/common/graphcmn.cpp +++ /dev/null @@ -1,776 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/common/graphcmn.cpp -// Purpose: graphics context methods common to all platforms -// Author: Stefan Csomor -// Modified by: -// Created: -// RCS-ID: $Id: graphcmn.cpp 56801 2008-11-16 23:25:09Z KO $ -// Copyright: (c) Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#if defined(__BORLANDC__) - #pragma hdrstop -#endif - -#if wxUSE_GRAPHICS_CONTEXT - -#include "wx/graphics.h" - -#ifndef WX_PRECOMP - #include "wx/icon.h" - #include "wx/bitmap.h" - #include "wx/dcmemory.h" - #include "wx/region.h" - #include "wx/log.h" -#endif - -#if !defined(wxMAC_USE_CORE_GRAPHICS_BLEND_MODES) -#define wxMAC_USE_CORE_GRAPHICS_BLEND_MODES 0 -#endif - -//----------------------------------------------------------------------------- -// constants -//----------------------------------------------------------------------------- - -static const double RAD2DEG = 180.0 / M_PI; - -//----------------------------------------------------------------------------- -// Local functions -//----------------------------------------------------------------------------- - -static inline double DegToRad(double deg) -{ - return (deg * M_PI) / 180.0; -} - -//----------------------------------------------------------------------------- - -//----------------------------------------------------------------------------- -// wxGraphicsObject -//----------------------------------------------------------------------------- - -IMPLEMENT_DYNAMIC_CLASS(wxGraphicsObject, wxObject) - -wxGraphicsObjectRefData::wxGraphicsObjectRefData( wxGraphicsRenderer* renderer ) -{ - m_renderer = renderer; -} -wxGraphicsObjectRefData::wxGraphicsObjectRefData( const wxGraphicsObjectRefData* data ) -{ - m_renderer = data->m_renderer; -} -wxGraphicsRenderer* wxGraphicsObjectRefData::GetRenderer() const -{ - return m_renderer ; -} - -wxGraphicsObjectRefData* wxGraphicsObjectRefData::Clone() const -{ - return new wxGraphicsObjectRefData(this); -} - -wxGraphicsObject::wxGraphicsObject() -{ -} - -wxGraphicsObject::wxGraphicsObject( wxGraphicsRenderer* renderer ) -{ - SetRefData( new wxGraphicsObjectRefData(renderer)); -} - -wxGraphicsObject::~wxGraphicsObject() -{ -} - -bool wxGraphicsObject::IsNull() const -{ - return m_refData == NULL; -} - -wxGraphicsRenderer* wxGraphicsObject::GetRenderer() const -{ - return ( IsNull() ? NULL : GetGraphicsData()->GetRenderer() ); -} - -wxGraphicsObjectRefData* wxGraphicsObject::GetGraphicsData() const -{ - return (wxGraphicsObjectRefData*) m_refData; -} - -wxObjectRefData* wxGraphicsObject::CreateRefData() const -{ - wxLogDebug(wxT("A Null Object cannot be changed")); - return NULL; -} - -wxObjectRefData* wxGraphicsObject::CloneRefData(const wxObjectRefData* data) const -{ - const wxGraphicsObjectRefData* ptr = (const wxGraphicsObjectRefData*) data; - return ptr->Clone(); -} - -//----------------------------------------------------------------------------- -// pens etc. -//----------------------------------------------------------------------------- - -IMPLEMENT_DYNAMIC_CLASS(wxGraphicsPen, wxGraphicsObject) -IMPLEMENT_DYNAMIC_CLASS(wxGraphicsBrush, wxGraphicsObject) -IMPLEMENT_DYNAMIC_CLASS(wxGraphicsFont, wxGraphicsObject) -IMPLEMENT_DYNAMIC_CLASS(wxGraphicsBitmap, wxGraphicsObject) - -WXDLLIMPEXP_DATA_CORE(wxGraphicsPen) wxNullGraphicsPen; -WXDLLIMPEXP_DATA_CORE(wxGraphicsBrush) wxNullGraphicsBrush; -WXDLLIMPEXP_DATA_CORE(wxGraphicsFont) wxNullGraphicsFont; -WXDLLIMPEXP_DATA_CORE(wxGraphicsBitmap) wxNullGraphicsBitmap; - -//----------------------------------------------------------------------------- -// matrix -//----------------------------------------------------------------------------- - -IMPLEMENT_DYNAMIC_CLASS(wxGraphicsMatrix, wxGraphicsObject) -WXDLLIMPEXP_DATA_CORE(wxGraphicsMatrix) wxNullGraphicsMatrix; - -// concatenates the matrix -void wxGraphicsMatrix::Concat( const wxGraphicsMatrix *t ) -{ - AllocExclusive(); - GetMatrixData()->Concat(t->GetMatrixData()); -} - -// sets the matrix to the respective values -void wxGraphicsMatrix::Set(wxDouble a, wxDouble b, wxDouble c, wxDouble d, - wxDouble tx, wxDouble ty) -{ - AllocExclusive(); - GetMatrixData()->Set(a,b,c,d,tx,ty); -} - -// gets the component valuess of the matrix -void wxGraphicsMatrix::Get(wxDouble* a, wxDouble* b, wxDouble* c, - wxDouble* d, wxDouble* tx, wxDouble* ty) const -{ - GetMatrixData()->Get(a, b, c, d, tx, ty); -} - -// makes this the inverse matrix -void wxGraphicsMatrix::Invert() -{ - AllocExclusive(); - GetMatrixData()->Invert(); -} - -// returns true if the elements of the transformation matrix are equal ? -bool wxGraphicsMatrix::IsEqual( const wxGraphicsMatrix* t) const -{ - return GetMatrixData()->IsEqual(t->GetMatrixData()); -} - -// return true if this is the identity matrix -bool wxGraphicsMatrix::IsIdentity() const -{ - return GetMatrixData()->IsIdentity(); -} - -// add the translation to this matrix -void wxGraphicsMatrix::Translate( wxDouble dx , wxDouble dy ) -{ - AllocExclusive(); - GetMatrixData()->Translate(dx,dy); -} - -// add the scale to this matrix -void wxGraphicsMatrix::Scale( wxDouble xScale , wxDouble yScale ) -{ - AllocExclusive(); - GetMatrixData()->Scale(xScale,yScale); -} - -// add the rotation to this matrix (radians) -void wxGraphicsMatrix::Rotate( wxDouble angle ) -{ - AllocExclusive(); - GetMatrixData()->Rotate(angle); -} - -// -// apply the transforms -// - -// applies that matrix to the point -void wxGraphicsMatrix::TransformPoint( wxDouble *x, wxDouble *y ) const -{ - GetMatrixData()->TransformPoint(x,y); -} - -// applies the matrix except for translations -void wxGraphicsMatrix::TransformDistance( wxDouble *dx, wxDouble *dy ) const -{ - GetMatrixData()->TransformDistance(dx,dy); -} - -// returns the native representation -void * wxGraphicsMatrix::GetNativeMatrix() const -{ - return GetMatrixData()->GetNativeMatrix(); -} - -//----------------------------------------------------------------------------- -// path -//----------------------------------------------------------------------------- - -IMPLEMENT_DYNAMIC_CLASS(wxGraphicsPath, wxGraphicsObject) -WXDLLIMPEXP_DATA_CORE(wxGraphicsPath) wxNullGraphicsPath; - -// convenience functions, for using wxPoint2DDouble etc - -wxPoint2DDouble wxGraphicsPath::GetCurrentPoint() const -{ - wxDouble x,y; - GetCurrentPoint(&x,&y); - return wxPoint2DDouble(x,y); -} - -void wxGraphicsPath::MoveToPoint( const wxPoint2DDouble& p) -{ - MoveToPoint( p.m_x , p.m_y); -} - -void wxGraphicsPath::AddLineToPoint( const wxPoint2DDouble& p) -{ - AddLineToPoint( p.m_x , p.m_y); -} - -void wxGraphicsPath::AddCurveToPoint( const wxPoint2DDouble& c1, const wxPoint2DDouble& c2, const wxPoint2DDouble& e) -{ - AddCurveToPoint(c1.m_x, c1.m_y, c2.m_x, c2.m_y, e.m_x, e.m_y); -} - -void wxGraphicsPath::AddArc( const wxPoint2DDouble& c, wxDouble r, wxDouble startAngle, wxDouble endAngle, bool clockwise) -{ - AddArc(c.m_x, c.m_y, r, startAngle, endAngle, clockwise); -} - -wxRect2DDouble wxGraphicsPath::GetBox() const -{ - wxDouble x,y,w,h; - GetBox(&x,&y,&w,&h); - return wxRect2DDouble( x,y,w,h ); -} - -bool wxGraphicsPath::Contains( const wxPoint2DDouble& c, int fillStyle ) const -{ - return Contains( c.m_x, c.m_y, fillStyle); -} - -// true redirections - -// begins a new subpath at (x,y) -void wxGraphicsPath::MoveToPoint( wxDouble x, wxDouble y ) -{ - AllocExclusive(); - GetPathData()->MoveToPoint(x,y); -} - -// adds a straight line from the current point to (x,y) -void wxGraphicsPath::AddLineToPoint( wxDouble x, wxDouble y ) -{ - AllocExclusive(); - GetPathData()->AddLineToPoint(x,y); -} - -// adds a cubic Bezier curve from the current point, using two control points and an end point -void wxGraphicsPath::AddCurveToPoint( wxDouble cx1, wxDouble cy1, wxDouble cx2, wxDouble cy2, wxDouble x, wxDouble y ) -{ - AllocExclusive(); - GetPathData()->AddCurveToPoint(cx1,cy1,cx2,cy2,x,y); -} - -// adds another path -void wxGraphicsPath::AddPath( const wxGraphicsPath& path ) -{ - AllocExclusive(); - GetPathData()->AddPath(path.GetPathData()); -} - -// closes the current sub-path -void wxGraphicsPath::CloseSubpath() -{ - AllocExclusive(); - GetPathData()->CloseSubpath(); -} - -// gets the last point of the current path, (0,0) if not yet set -void wxGraphicsPath::GetCurrentPoint( wxDouble* x, wxDouble* y) const -{ - GetPathData()->GetCurrentPoint(x,y); -} - -// adds an arc of a circle centering at (x,y) with radius (r) from startAngle to endAngle -void wxGraphicsPath::AddArc( wxDouble x, wxDouble y, wxDouble r, wxDouble startAngle, wxDouble endAngle, bool clockwise ) -{ - AllocExclusive(); - GetPathData()->AddArc(x,y,r,startAngle,endAngle,clockwise); -} - -// -// These are convenience functions which - if not available natively will be assembled -// using the primitives from above -// - -// adds a quadratic Bezier curve from the current point, using a control point and an end point -void wxGraphicsPath::AddQuadCurveToPoint( wxDouble cx, wxDouble cy, wxDouble x, wxDouble y ) -{ - AllocExclusive(); - GetPathData()->AddQuadCurveToPoint(cx,cy,x,y); -} - -// appends a rectangle as a new closed subpath -void wxGraphicsPath::AddRectangle( wxDouble x, wxDouble y, wxDouble w, wxDouble h ) -{ - AllocExclusive(); - GetPathData()->AddRectangle(x,y,w,h); -} - -// appends an ellipsis as a new closed subpath fitting the passed rectangle -void wxGraphicsPath::AddCircle( wxDouble x, wxDouble y, wxDouble r ) -{ - AllocExclusive(); - GetPathData()->AddCircle(x,y,r); -} - -// appends a an arc to two tangents connecting (current) to (x1,y1) and (x1,y1) to (x2,y2), also a straight line from (current) to (x1,y1) -void wxGraphicsPath::AddArcToPoint( wxDouble x1, wxDouble y1 , wxDouble x2, wxDouble y2, wxDouble r ) -{ - GetPathData()->AddArcToPoint(x1,y1,x2,y2,r); -} - -// appends an ellipse -void wxGraphicsPath::AddEllipse( wxDouble x, wxDouble y, wxDouble w, wxDouble h) -{ - AllocExclusive(); - GetPathData()->AddEllipse(x,y,w,h); -} - -// appends a rounded rectangle -void wxGraphicsPath::AddRoundedRectangle( wxDouble x, wxDouble y, wxDouble w, wxDouble h, wxDouble radius) -{ - AllocExclusive(); - GetPathData()->AddRoundedRectangle(x,y,w,h,radius); -} - -// returns the native path -void * wxGraphicsPath::GetNativePath() const -{ - return GetPathData()->GetNativePath(); -} - -// give the native path returned by GetNativePath() back (there might be some deallocations necessary) -void wxGraphicsPath::UnGetNativePath(void *p)const -{ - GetPathData()->UnGetNativePath(p); -} - -// transforms each point of this path by the matrix -void wxGraphicsPath::Transform( const wxGraphicsMatrix& matrix ) -{ - AllocExclusive(); - GetPathData()->Transform(matrix.GetMatrixData()); -} - -// gets the bounding box enclosing all points (possibly including control points) -void wxGraphicsPath::GetBox(wxDouble *x, wxDouble *y, wxDouble *w, wxDouble *h) const -{ - GetPathData()->GetBox(x,y,w,h); -} - -bool wxGraphicsPath::Contains( wxDouble x, wxDouble y, int fillStyle ) const -{ - return GetPathData()->Contains(x,y,fillStyle); -} - -// -// Emulations, these mus be implemented in the ...Data classes in order to allow for proper overrides -// - -void wxGraphicsPathData::AddQuadCurveToPoint( wxDouble cx, wxDouble cy, wxDouble x, wxDouble y ) -{ - // calculate using degree elevation to a cubic bezier - wxPoint2DDouble c1; - wxPoint2DDouble c2; - - wxPoint2DDouble start; - GetCurrentPoint(&start.m_x,&start.m_y); - wxPoint2DDouble end(x,y); - wxPoint2DDouble c(cx,cy); - c1 = wxDouble(1/3.0) * start + wxDouble(2/3.0) * c; - c2 = wxDouble(2/3.0) * c + wxDouble(1/3.0) * end; - AddCurveToPoint(c1.m_x,c1.m_y,c2.m_x,c2.m_y,x,y); -} - -void wxGraphicsPathData::AddRectangle( wxDouble x, wxDouble y, wxDouble w, wxDouble h ) -{ - MoveToPoint(x,y); - AddLineToPoint(x,y+h); - AddLineToPoint(x+w,y+h); - AddLineToPoint(x+w,y); - CloseSubpath(); -} - -void wxGraphicsPathData::AddCircle( wxDouble x, wxDouble y, wxDouble r ) -{ - MoveToPoint(x+r,y); - AddArc( x,y,r,0,2*M_PI,false); - CloseSubpath(); -} - -void wxGraphicsPathData::AddEllipse( wxDouble x, wxDouble y, wxDouble w, wxDouble h) -{ - wxDouble rw = w/2; - wxDouble rh = h/2; - wxDouble xc = x + rw; - wxDouble yc = y + rh; - wxGraphicsMatrix m = GetRenderer()->CreateMatrix(); - m.Translate(xc,yc); - m.Scale(rw/rh,1.0); - wxGraphicsPath p = GetRenderer()->CreatePath(); - p.AddCircle(0,0,rh); - p.Transform(m); - AddPath(p.GetPathData()); -} - -void wxGraphicsPathData::AddRoundedRectangle( wxDouble x, wxDouble y, wxDouble w, wxDouble h, wxDouble radius) -{ - if ( radius == 0 ) - AddRectangle(x,y,w,h); - else - { - MoveToPoint( x + w, y + h / 2); - AddArcToPoint(x + w, y + h, x + w / 2, y + h, radius); - AddArcToPoint(x, y + h, x, y + h / 2, radius); - AddArcToPoint(x, y , x + w / 2, y, radius); - AddArcToPoint(x + w, y, x + w, y + h / 2, radius); - CloseSubpath(); - } -} - -// draws a an arc to two tangents connecting (current) to (x1,y1) and (x1,y1) to (x2,y2), also a straight line from (current) to (x1,y1) -void wxGraphicsPathData::AddArcToPoint( wxDouble x1, wxDouble y1 , wxDouble x2, wxDouble y2, wxDouble r ) -{ - wxPoint2DDouble current; - GetCurrentPoint(¤t.m_x,¤t.m_y); - wxPoint2DDouble p1(x1,y1); - wxPoint2DDouble p2(x2,y2); - - wxPoint2DDouble v1 = current - p1; - v1.Normalize(); - wxPoint2DDouble v2 = p2 - p1; - v2.Normalize(); - - wxDouble alpha = v1.GetVectorAngle() - v2.GetVectorAngle(); - - if ( alpha < 0 ) - alpha = 360 + alpha; - // TODO obtuse angles - - alpha = DegToRad(alpha); - - wxDouble dist = r / sin(alpha/2) * cos(alpha/2); - // calculate tangential points - wxPoint2DDouble t1 = dist*v1 + p1; - wxPoint2DDouble t2 = dist*v2 + p1; - - wxPoint2DDouble nv1 = v1; - nv1.SetVectorAngle(v1.GetVectorAngle()-90); - wxPoint2DDouble c = t1 + r*nv1; - - wxDouble a1 = v1.GetVectorAngle()+90; - wxDouble a2 = v2.GetVectorAngle()-90; - - AddLineToPoint(t1.m_x,t1.m_y); - AddArc(c.m_x,c.m_y,r,DegToRad(a1),DegToRad(a2),true); - AddLineToPoint(p2.m_x,p2.m_y); -} - -//----------------------------------------------------------------------------- -// wxGraphicsContext Convenience Methods -//----------------------------------------------------------------------------- - -IMPLEMENT_ABSTRACT_CLASS(wxGraphicsContext, wxObject) - - -wxGraphicsContext::wxGraphicsContext(wxGraphicsRenderer* renderer) : wxGraphicsObject(renderer) -{ - m_logicalFunction = wxCOPY; -} - -wxGraphicsContext::~wxGraphicsContext() -{ -} - -// sets the pen -void wxGraphicsContext::SetPen( const wxGraphicsPen& pen ) -{ - m_pen = pen; -} - -void wxGraphicsContext::SetPen( const wxPen& pen ) -{ - if ( !pen.Ok() || pen.GetStyle() == wxTRANSPARENT ) - SetPen( wxNullGraphicsPen ); - else - SetPen( CreatePen( pen ) ); -} - -// sets the brush for filling -void wxGraphicsContext::SetBrush( const wxGraphicsBrush& brush ) -{ - m_brush = brush; -} - -void wxGraphicsContext::SetBrush( const wxBrush& brush ) -{ - if ( !brush.Ok() || brush.GetStyle() == wxTRANSPARENT ) - SetBrush( wxNullGraphicsBrush ); - else - SetBrush( CreateBrush( brush ) ); -} - -// sets the brush for filling -void wxGraphicsContext::SetFont( const wxGraphicsFont& font ) -{ - m_font = font; -} - -bool wxGraphicsContext::SetLogicalFunction( int function ) -{ - if ( function == wxCOPY ) - { - m_logicalFunction = function; - return true; - } - return false; -} - -void wxGraphicsContext::SetFont( const wxFont& font, const wxColour& colour ) -{ - if ( font.Ok() ) - SetFont( CreateFont( font, colour ) ); - else - SetFont( wxNullGraphicsFont ); -} - -void wxGraphicsContext::DrawPath( const wxGraphicsPath& path, int fillStyle ) -{ - FillPath( path , fillStyle ); - StrokePath( path ); -} - -void wxGraphicsContext::DrawText( const wxString &str, wxDouble x, wxDouble y, wxDouble angle ) -{ - Translate(x,y); - Rotate( -angle ); - DrawText( str , 0, 0 ); - Rotate( angle ); - Translate(-x,-y); -} - -void wxGraphicsContext::DrawText( const wxString &str, wxDouble x, wxDouble y, const wxGraphicsBrush& backgroundBrush ) -{ - wxGraphicsBrush formerBrush = m_brush; - wxGraphicsPen formerPen = m_pen; - wxDouble width; - wxDouble height; - wxDouble descent; - wxDouble externalLeading; - GetTextExtent( str , &width, &height, &descent, &externalLeading ); - SetBrush( backgroundBrush ); - // to make sure our 'OffsetToPixelBoundaries' doesn't move the fill shape - SetPen( wxNullGraphicsPen ); - - wxGraphicsPath path = CreatePath(); - path.AddRectangle( x , y, width, height ); - FillPath( path ); - - DrawText( str, x ,y); - SetBrush( formerBrush ); - SetPen( formerPen ); -} - -void wxGraphicsContext::DrawText( const wxString &str, wxDouble x, wxDouble y, wxDouble angle, const wxGraphicsBrush& backgroundBrush ) -{ - wxGraphicsBrush formerBrush = m_brush; - wxGraphicsPen formerPen = m_pen; - - wxDouble width; - wxDouble height; - wxDouble descent; - wxDouble externalLeading; - GetTextExtent( str , &width, &height, &descent, &externalLeading ); - SetBrush( backgroundBrush ); - // to make sure our 'OffsetToPixelBoundaries' doesn't move the fill shape - SetPen( wxNullGraphicsPen ); - - wxGraphicsPath path = CreatePath(); - path.MoveToPoint( x , y ); - path.AddLineToPoint( (int) (x + sin(angle) * height) , (int) (y + cos(angle) * height) ); - path.AddLineToPoint( - (int) (x + sin(angle) * height + cos(angle) * width) , - (int) (y + cos(angle) * height - sin(angle) * width)); - path.AddLineToPoint((int) (x + cos(angle) * width) , (int) (y - sin(angle) * width) ); - FillPath( path ); - DrawText( str, x ,y, angle); - SetBrush( formerBrush ); - SetPen( formerPen ); -} - -void wxGraphicsContext::StrokeLine( wxDouble x1, wxDouble y1, wxDouble x2, wxDouble y2) -{ - wxGraphicsPath path = CreatePath(); - path.MoveToPoint(x1, y1); - path.AddLineToPoint( x2, y2 ); - StrokePath( path ); -} - -void wxGraphicsContext::DrawRectangle( wxDouble x, wxDouble y, wxDouble w, wxDouble h) -{ - wxGraphicsPath path = CreatePath(); - path.AddRectangle( x , y , w , h ); - DrawPath( path ); -} - -void wxGraphicsContext::DrawEllipse( wxDouble x, wxDouble y, wxDouble w, wxDouble h) -{ - wxGraphicsPath path = CreatePath(); - path.AddEllipse(x,y,w,h); - DrawPath(path); -} - -void wxGraphicsContext::DrawRoundedRectangle( wxDouble x, wxDouble y, wxDouble w, wxDouble h, wxDouble radius) -{ - wxGraphicsPath path = CreatePath(); - path.AddRoundedRectangle(x,y,w,h,radius); - DrawPath(path); -} - -void wxGraphicsContext::StrokeLines( size_t n, const wxPoint2DDouble *points) -{ - wxASSERT(n > 1); - wxGraphicsPath path = CreatePath(); - path.MoveToPoint(points[0].m_x, points[0].m_y); - for ( size_t i = 1; i < n; ++i) - path.AddLineToPoint( points[i].m_x, points[i].m_y ); - StrokePath( path ); -} - -void wxGraphicsContext::DrawLines( size_t n, const wxPoint2DDouble *points, int fillStyle) -{ - wxASSERT(n > 1); - wxGraphicsPath path = CreatePath(); - path.MoveToPoint(points[0].m_x, points[0].m_y); - for ( size_t i = 1; i < n; ++i) - path.AddLineToPoint( points[i].m_x, points[i].m_y ); - DrawPath( path , fillStyle); -} - -void wxGraphicsContext::StrokeLines( size_t n, const wxPoint2DDouble *beginPoints, const wxPoint2DDouble *endPoints) -{ - wxASSERT(n > 0); - wxGraphicsPath path = CreatePath(); - for ( size_t i = 0; i < n; ++i) - { - path.MoveToPoint(beginPoints[i].m_x, beginPoints[i].m_y); - path.AddLineToPoint( endPoints[i].m_x, endPoints[i].m_y ); - } - StrokePath( path ); -} - -// create a 'native' matrix corresponding to these values -wxGraphicsMatrix wxGraphicsContext::CreateMatrix( wxDouble a, wxDouble b, wxDouble c, wxDouble d, - wxDouble tx, wxDouble ty) const -{ - return GetRenderer()->CreateMatrix(a,b,c,d,tx,ty); -} - -wxGraphicsPath wxGraphicsContext::CreatePath() const -{ - return GetRenderer()->CreatePath(); -} - -wxGraphicsPen wxGraphicsContext::CreatePen(const wxPen& pen) const -{ - return GetRenderer()->CreatePen(pen); -} - -wxGraphicsBrush wxGraphicsContext::CreateBrush(const wxBrush& brush ) const -{ - return GetRenderer()->CreateBrush(brush); -} - -// sets the brush to a linear gradient, starting at (x1,y1) with color c1 to (x2,y2) with color c2 -wxGraphicsBrush wxGraphicsContext::CreateLinearGradientBrush( wxDouble x1, wxDouble y1, wxDouble x2, wxDouble y2, - const wxColour&c1, const wxColour&c2) const -{ - return GetRenderer()->CreateLinearGradientBrush(x1,y1,x2,y2,c1,c2); -} - -// sets the brush to a radial gradient originating at (xo,yc) with color oColor and ends on a circle around (xc,yc) -// with radius r and color cColor -wxGraphicsBrush wxGraphicsContext::CreateRadialGradientBrush( wxDouble xo, wxDouble yo, wxDouble xc, wxDouble yc, wxDouble radius, - const wxColour &oColor, const wxColour &cColor) const -{ - return GetRenderer()->CreateRadialGradientBrush(xo,yo,xc,yc,radius,oColor,cColor); -} - -// sets the font -wxGraphicsFont wxGraphicsContext::CreateFont( const wxFont &font , const wxColour &col ) const -{ - return GetRenderer()->CreateFont(font,col); -} - -wxGraphicsBitmap wxGraphicsContext::CreateBitmap( const wxBitmap& bmp ) const -{ - return GetRenderer()->CreateBitmap(bmp); -} - -wxGraphicsContext* wxGraphicsContext::Create( const wxWindowDC& dc) -{ - return wxGraphicsRenderer::GetDefaultRenderer()->CreateContext(dc); -} -#ifdef __WXMSW__ -wxGraphicsContext* wxGraphicsContext::Create( const wxMemoryDC& dc) -{ - return wxGraphicsRenderer::GetDefaultRenderer()->CreateContext(dc); -} -#endif - -wxGraphicsContext* wxGraphicsContext::CreateFromNative( void * context ) -{ - return wxGraphicsRenderer::GetDefaultRenderer()->CreateContextFromNativeContext(context); -} - -wxGraphicsContext* wxGraphicsContext::CreateFromNativeWindow( void * window ) -{ - return wxGraphicsRenderer::GetDefaultRenderer()->CreateContextFromNativeWindow(window); -} - -wxGraphicsContext* wxGraphicsContext::Create( wxWindow* window ) -{ - return wxGraphicsRenderer::GetDefaultRenderer()->CreateContext(window); -} - -wxGraphicsContext* wxGraphicsContext::Create() -{ - return wxGraphicsRenderer::GetDefaultRenderer()->CreateMeasuringContext(); -} - -//----------------------------------------------------------------------------- -// wxGraphicsRenderer -//----------------------------------------------------------------------------- - -IMPLEMENT_ABSTRACT_CLASS(wxGraphicsRenderer, wxObject) - -#endif // wxUSE_GRAPHICS_CONTEXT diff --git a/wxWidgets/src/common/hash.cpp b/wxWidgets/src/common/hash.cpp deleted file mode 100644 index 9969bb1884..0000000000 --- a/wxWidgets/src/common/hash.cpp +++ /dev/null @@ -1,1077 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/common/hash.cpp -// Purpose: wxHashTable implementation -// Author: Julian Smart -// Modified by: VZ at 25.02.00: type safe hashes with WX_DECLARE_HASH() -// Created: 01/02/97 -// RCS-ID: $Id: hash.cpp 49529 2007-10-30 00:32:18Z VZ $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#ifndef WX_PRECOMP - #include "wx/list.h" - #include "wx/hash.h" -#endif - -#if wxUSE_OLD_HASH_TABLE - -#include -#include - -// ---------------------------------------------------------------------------- -// wxWin macros -// ---------------------------------------------------------------------------- - -IMPLEMENT_DYNAMIC_CLASS(wxHashTable, wxObject) - -// ============================================================================ -// implementation -// ============================================================================ - -// ---------------------------------------------------------------------------- -// wxHashTablleBase for working with "void *" data -// ---------------------------------------------------------------------------- - -wxHashTableBase::wxHashTableBase() -{ - m_deleteContents = false; - m_hashTable = (wxListBase **)NULL; - m_hashSize = 0; - m_count = 0; - m_keyType = wxKEY_NONE; -} - -void wxHashTableBase::Create(wxKeyType keyType, size_t size) -{ - Destroy(); - - m_hashSize = size; - m_keyType = keyType; - m_hashTable = new wxListBase *[size]; - for ( size_t n = 0; n < m_hashSize; n++ ) - { - m_hashTable[n] = (wxListBase *) NULL; - } -} - -void wxHashTableBase::Destroy() -{ - if ( m_hashTable ) - { - for ( size_t n = 0; n < m_hashSize; n++ ) - { - delete m_hashTable[n]; - } - - delete [] m_hashTable; - - m_hashTable = (wxListBase **)NULL; - - m_count = 0; - } -} - -void wxHashTableBase::DeleteContents(bool flag) -{ - m_deleteContents = flag; - for ( size_t n = 0; n < m_hashSize; n++ ) - { - if ( m_hashTable[n] ) - { - m_hashTable[n]->DeleteContents(flag); - } - } -} - -wxNodeBase *wxHashTableBase::GetNode(long key, long value) const -{ - size_t slot = (size_t)abs((int)(key % (long)m_hashSize)); - - wxNodeBase *node; - if ( m_hashTable[slot] ) - { - node = m_hashTable[slot]->Find(wxListKey(value)); - } - else - { - node = (wxNodeBase *)NULL; - } - - return node; -} - -#if WXWIN_COMPATIBILITY_2_4 - -// ---------------------------------------------------------------------------- -// wxHashTableLong -// ---------------------------------------------------------------------------- - -wxHashTableLong::~wxHashTableLong() -{ - Destroy(); -} - -void wxHashTableLong::Init(size_t size) -{ - m_hashSize = size; - m_values = new wxArrayLong *[size]; - m_keys = new wxArrayLong *[size]; - - for ( size_t n = 0; n < m_hashSize; n++ ) - { - m_values[n] = - m_keys[n] = (wxArrayLong *)NULL; - } - - m_count = 0; -} - -void wxHashTableLong::Create(size_t size) -{ - Init(size); -} - -void wxHashTableLong::Destroy() -{ - for ( size_t n = 0; n < m_hashSize; n++ ) - { - delete m_values[n]; - delete m_keys[n]; - } - - delete [] m_values; - delete [] m_keys; - m_hashSize = 0; - m_count = 0; -} - -void wxHashTableLong::Put(long key, long value) -{ - wxCHECK_RET( m_hashSize, _T("must call Create() first") ); - - size_t slot = (size_t)abs((int)(key % (long)m_hashSize)); - - if ( !m_keys[slot] ) - { - m_keys[slot] = new wxArrayLong; - m_values[slot] = new wxArrayLong; - } - - m_keys[slot]->Add(key); - m_values[slot]->Add(value); - - m_count++; -} - -long wxHashTableLong::Get(long key) const -{ - wxCHECK_MSG( m_hashSize, wxNOT_FOUND, _T("must call Create() first") ); - - size_t slot = (size_t)abs((int)(key % (long)m_hashSize)); - - wxArrayLong *keys = m_keys[slot]; - if ( keys ) - { - size_t count = keys->GetCount(); - for ( size_t n = 0; n < count; n++ ) - { - if ( keys->Item(n) == key ) - { - return m_values[slot]->Item(n); - } - } - } - - return wxNOT_FOUND; -} - -long wxHashTableLong::Delete(long key) -{ - wxCHECK_MSG( m_hashSize, wxNOT_FOUND, _T("must call Create() first") ); - - size_t slot = (size_t)abs((int)(key % (long)m_hashSize)); - - wxArrayLong *keys = m_keys[slot]; - if ( keys ) - { - size_t count = keys->GetCount(); - for ( size_t n = 0; n < count; n++ ) - { - if ( keys->Item(n) == key ) - { - long val = m_values[slot]->Item(n); - - keys->RemoveAt(n); - m_values[slot]->RemoveAt(n); - - m_count--; - - return val; - } - } - } - - return wxNOT_FOUND; -} - -// ---------------------------------------------------------------------------- -// wxStringHashTable: more efficient than storing strings in a list -// ---------------------------------------------------------------------------- - -wxStringHashTable::wxStringHashTable(size_t sizeTable) -{ - m_keys = new wxArrayLong *[sizeTable]; - m_values = new wxArrayString *[sizeTable]; - - m_hashSize = sizeTable; - for ( size_t n = 0; n < m_hashSize; n++ ) - { - m_values[n] = (wxArrayString *)NULL; - m_keys[n] = (wxArrayLong *)NULL; - } -} - -wxStringHashTable::~wxStringHashTable() -{ - Destroy(); -} - -void wxStringHashTable::Destroy() -{ - for ( size_t n = 0; n < m_hashSize; n++ ) - { - delete m_values[n]; - delete m_keys[n]; - } - - delete [] m_values; - delete [] m_keys; - m_hashSize = 0; -} - -void wxStringHashTable::Put(long key, const wxString& value) -{ - wxCHECK_RET( m_hashSize, _T("must call Create() first") ); - - size_t slot = (size_t)abs((int)(key % (long)m_hashSize)); - - if ( !m_keys[slot] ) - { - m_keys[slot] = new wxArrayLong; - m_values[slot] = new wxArrayString; - } - - m_keys[slot]->Add(key); - m_values[slot]->Add(value); -} - -wxString wxStringHashTable::Get(long key, bool *wasFound) const -{ - wxCHECK_MSG( m_hashSize, wxEmptyString, _T("must call Create() first") ); - - size_t slot = (size_t)abs((int)(key % (long)m_hashSize)); - - wxArrayLong *keys = m_keys[slot]; - if ( keys ) - { - size_t count = keys->GetCount(); - for ( size_t n = 0; n < count; n++ ) - { - if ( keys->Item(n) == key ) - { - if ( wasFound ) - *wasFound = true; - - return m_values[slot]->Item(n); - } - } - } - - if ( wasFound ) - *wasFound = false; - - return wxEmptyString; -} - -bool wxStringHashTable::Delete(long key) const -{ - wxCHECK_MSG( m_hashSize, false, _T("must call Create() first") ); - - size_t slot = (size_t)abs((int)(key % (long)m_hashSize)); - - wxArrayLong *keys = m_keys[slot]; - if ( keys ) - { - size_t count = keys->GetCount(); - for ( size_t n = 0; n < count; n++ ) - { - if ( keys->Item(n) == key ) - { - keys->RemoveAt(n); - m_values[slot]->RemoveAt(n); - return true; - } - } - } - - return false; -} - -#endif // WXWIN_COMPATIBILITY_2_4 - -// ---------------------------------------------------------------------------- -// old not type safe wxHashTable -// ---------------------------------------------------------------------------- - -wxHashTable::wxHashTable (int the_key_type, int size) -{ - n = 0; - hash_table = (wxList**) NULL; - Create(the_key_type, size); - m_count = 0; - m_deleteContents = false; -/* - n = size; - current_position = -1; - current_node = (wxNode *) NULL; - - key_type = the_key_type; - hash_table = new wxList *[size]; - int i; - for (i = 0; i < size; i++) - hash_table[i] = (wxList *) NULL; -*/ -} - -wxHashTable::~wxHashTable () -{ - Destroy(); -} - -void wxHashTable::Destroy() -{ - if (!hash_table) return; - int i; - for (i = 0; i < n; i++) - if (hash_table[i]) - delete hash_table[i]; - delete[] hash_table; - hash_table = NULL; -} - -bool wxHashTable::Create(int the_key_type, int size) -{ - Destroy(); - - n = size; - current_position = -1; - current_node = (wxNode *) NULL; - - key_type = the_key_type; - hash_table = new wxList *[size]; - int i; - for (i = 0; i < size; i++) - hash_table[i] = (wxList *) NULL; - return true; -} - - -void wxHashTable::DoCopy(const wxHashTable& table) -{ - n = table.n; - m_count = table.m_count; - current_position = table.current_position; - current_node = NULL; // doesn't matter - Next() will reconstruct it - key_type = table.key_type; - - hash_table = new wxList *[n]; - for (int i = 0; i < n; i++) { - if (table.hash_table[i] == NULL) - hash_table[i] = NULL; - else { - hash_table[i] = new wxList(key_type); - *hash_table[i] = *(table.hash_table[i]); - } - } -} - -void wxHashTable::Put (long key, long value, wxObject * object) -{ - // Should NEVER be - long k = (long) key; - - int position = (int) (k % n); - if (position < 0) position = -position; - - if (!hash_table[position]) - { - hash_table[position] = new wxList (wxKEY_INTEGER); - if (m_deleteContents) hash_table[position]->DeleteContents(true); - } - - hash_table[position]->Append (value, object); - m_count++; -} - -void wxHashTable::Put (long key, const wxChar *value, wxObject * object) -{ - // Should NEVER be - long k = (long) key; - - int position = (int) (k % n); - if (position < 0) position = -position; - - if (!hash_table[position]) - { - hash_table[position] = new wxList (wxKEY_STRING); - if (m_deleteContents) hash_table[position]->DeleteContents(true); - } - - hash_table[position]->Append (value, object); - m_count++; -} - -void wxHashTable::Put (long key, wxObject * object) -{ - // Should NEVER be - long k = (long) key; - - int position = (int) (k % n); - if (position < 0) position = -position; - - if (!hash_table[position]) - { - hash_table[position] = new wxList (wxKEY_INTEGER); - if (m_deleteContents) hash_table[position]->DeleteContents(true); - } - - hash_table[position]->Append (k, object); - m_count++; -} - -void wxHashTable::Put (const wxChar *key, wxObject * object) -{ - int position = (int) (MakeKey (key) % n); - if (position < 0) position = -position; - - if (!hash_table[position]) - { - hash_table[position] = new wxList (wxKEY_STRING); - if (m_deleteContents) hash_table[position]->DeleteContents(true); - } - - hash_table[position]->Append (key, object); - m_count++; -} - -wxObject *wxHashTable::Get (long key, long value) const -{ - // Should NEVER be - long k = (long) key; - - int position = (int) (k % n); - if (position < 0) position = -position; - - if (!hash_table[position]) - return (wxObject *) NULL; - else - { - wxNode *node = hash_table[position]->Find (value); - if (node) - return node->GetData (); - else - return (wxObject *) NULL; - } -} - -wxObject *wxHashTable::Get (long key, const wxChar *value) const -{ - // Should NEVER be - long k = (long) key; - - int position = (int) (k % n); - if (position < 0) position = -position; - - if (!hash_table[position]) - return (wxObject *) NULL; - else - { - wxNode *node = hash_table[position]->Find (value); - if (node) - return node->GetData (); - else - return (wxObject *) NULL; - } -} - -wxObject *wxHashTable::Get (long key) const -{ - // Should NEVER be - long k = (long) key; - - int position = (int) (k % n); - if (position < 0) position = -position; - - if (!hash_table[position]) - return (wxObject *) NULL; - else - { - wxNode *node = hash_table[position]->Find (k); - return node ? node->GetData () : (wxObject*)NULL; - } -} - -wxObject *wxHashTable::Get (const wxChar *key) const -{ - int position = (int) (MakeKey (key) % n); - if (position < 0) position = -position; - - if (!hash_table[position]) - return (wxObject *) NULL; - else - { - wxNode *node = hash_table[position]->Find (key); - return node ? node->GetData () : (wxObject*)NULL; - } -} - -wxObject *wxHashTable::Delete (long key) -{ - // Should NEVER be - long k = (long) key; - - int position = (int) (k % n); - if (position < 0) position = -position; - - if (!hash_table[position]) - return (wxObject *) NULL; - else - { - wxNode *node = hash_table[position]->Find (k); - if (node) - { - wxObject *data = node->GetData (); - delete node; - m_count--; - return data; - } - else - return (wxObject *) NULL; - } -} - -wxObject *wxHashTable::Delete (const wxChar *key) -{ - int position = (int) (MakeKey (key) % n); - if (position < 0) position = -position; - - if (!hash_table[position]) - return (wxObject *) NULL; - else - { - wxNode *node = hash_table[position]->Find (key); - if (node) - { - wxObject *data = node->GetData (); - delete node; - m_count--; - return data; - } - else - return (wxObject *) NULL; - } -} - -wxObject *wxHashTable::Delete (long key, int value) -{ - // Should NEVER be - long k = (long) key; - - int position = (int) (k % n); - if (position < 0) position = -position; - - if (!hash_table[position]) - return (wxObject *) NULL; - else - { - wxNode *node = hash_table[position]->Find (value); - if (node) - { - wxObject *data = node->GetData (); - delete node; - m_count--; - return data; - } - else - return (wxObject *) NULL; - } -} - -wxObject *wxHashTable::Delete (long key, const wxChar *value) -{ - int position = (int) (key % n); - if (position < 0) position = -position; - - if (!hash_table[position]) - return (wxObject *) NULL; - else - { - wxNode *node = hash_table[position]->Find (value); - if (node) - { - wxObject *data = node->GetData (); - delete node; - m_count--; - return data; - } - else - return (wxObject *) NULL; - } -} - -long wxHashTable::MakeKey (const wxChar *string) const -{ - long int_key = 0; - - while (*string) - int_key += (wxUChar) *string++; - - return int_key; -} - -void wxHashTable::BeginFind () -{ - current_position = -1; - current_node = (wxNode *) NULL; -} - -wxHashTable::Node* wxHashTable::Next () -{ - wxNode *found = (wxNode *) NULL; - bool end = false; - while (!end && !found) - { - if (!current_node) - { - current_position++; - if (current_position >= n) - { - current_position = -1; - current_node = (wxNode *) NULL; - end = true; - } - else - { - if (hash_table[current_position]) - { - current_node = hash_table[current_position]->GetFirst (); - found = current_node; - } - } - } - else - { - current_node = current_node->GetNext (); - found = current_node; - } - } - return found; -} - -void wxHashTable::DeleteContents (bool flag) -{ - int i; - m_deleteContents = flag; - for (i = 0; i < n; i++) - { - if (hash_table[i]) - hash_table[i]->DeleteContents (flag); - } -} - -void wxHashTable::Clear () -{ - int i; - if (hash_table) - { - for (i = 0; i < n; i++) - { - if (hash_table[i]) - hash_table[i]->Clear (); - } - } - m_count = 0; -} - -#else // if !wxUSE_OLD_HASH_TABLE - -wxHashTableBase_Node::wxHashTableBase_Node( long key, void* value, - wxHashTableBase* table ) - : m_value( value ), m_hashPtr( table ) -{ - m_key.integer = key; -} - -wxHashTableBase_Node::wxHashTableBase_Node( const wxChar* key, void* value, - wxHashTableBase* table ) - : m_value( value ), m_hashPtr( table ) -{ - m_key.string = wxStrcpy( new wxChar[wxStrlen( key ) + 1], key ); -} - -wxHashTableBase_Node::~wxHashTableBase_Node() -{ - if( m_hashPtr ) m_hashPtr->DoRemoveNode( this ); -} - -// - -wxHashTableBase::wxHashTableBase() - : m_size( 0 ), m_count( 0 ), m_table( NULL ), m_keyType( wxKEY_NONE ), - m_deleteContents( false ) -{ -} - -void wxHashTableBase::Create( wxKeyType keyType, size_t size ) -{ - m_keyType = keyType; - m_size = size; - m_table = new wxHashTableBase_Node*[ m_size ]; - - for( size_t i = 0; i < m_size; ++i ) - m_table[i] = NULL; -} - -void wxHashTableBase::Clear() -{ - for( size_t i = 0; i < m_size; ++i ) - { - Node* end = m_table[i]; - - if( end == NULL ) - continue; - - Node *curr, *next = end->GetNext(); - - do - { - curr = next; - next = curr->GetNext(); - - DoDestroyNode( curr ); - - delete curr; - } - while( curr != end ); - - m_table[i] = NULL; - } - - m_count = 0; -} - -void wxHashTableBase::DoRemoveNode( wxHashTableBase_Node* node ) -{ - size_t bucket = ( m_keyType == wxKEY_INTEGER ? - node->m_key.integer : - MakeKey( node->m_key.string ) ) % m_size; - - if( node->GetNext() == node ) - { - // single-node chain (common case) - m_table[bucket] = NULL; - } - else - { - Node *start = m_table[bucket], *curr; - Node* prev = start; - - for( curr = prev->GetNext(); curr != node; - prev = curr, curr = curr->GetNext() ) ; - - DoUnlinkNode( bucket, node, prev ); - } - - DoDestroyNode( node ); -} - -void wxHashTableBase::DoDestroyNode( wxHashTableBase_Node* node ) -{ - // if it is called from DoRemoveNode, node has already been - // removed, from other places it does not matter - node->m_hashPtr = NULL; - - if( m_keyType == wxKEY_STRING ) - delete[] node->m_key.string; - if( m_deleteContents ) - DoDeleteContents( node ); -} - -void wxHashTableBase::Destroy() -{ - Clear(); - - delete[] m_table; - - m_table = NULL; - m_size = 0; -} - -void wxHashTableBase::DoInsertNode( size_t bucket, wxHashTableBase_Node* node ) -{ - if( m_table[bucket] == NULL ) - { - m_table[bucket] = node->m_next = node; - } - else - { - Node *prev = m_table[bucket]; - Node *next = prev->m_next; - - prev->m_next = node; - node->m_next = next; - m_table[bucket] = node; - } - - ++m_count; -} - -void wxHashTableBase::DoPut( long key, long hash, void* data ) -{ - wxASSERT( m_keyType == wxKEY_INTEGER ); - - size_t bucket = size_t(hash) % m_size; - Node* node = new wxHashTableBase_Node( key, data, this ); - - DoInsertNode( bucket, node ); -} - -void wxHashTableBase::DoPut( const wxChar* key, long hash, void* data ) -{ - wxASSERT( m_keyType == wxKEY_STRING ); - - size_t bucket = size_t(hash) % m_size; - Node* node = new wxHashTableBase_Node( key, data, this ); - - DoInsertNode( bucket, node ); -} - -void* wxHashTableBase::DoGet( long key, long hash ) const -{ - wxASSERT( m_keyType == wxKEY_INTEGER ); - - size_t bucket = size_t(hash) % m_size; - - if( m_table[bucket] == NULL ) - return NULL; - - Node *first = m_table[bucket]->GetNext(), - *curr = first; - - do - { - if( curr->m_key.integer == key ) - return curr->m_value; - - curr = curr->GetNext(); - } - while( curr != first ); - - return NULL; -} - -void* wxHashTableBase::DoGet( const wxChar* key, long hash ) const -{ - wxASSERT( m_keyType == wxKEY_STRING ); - - size_t bucket = size_t(hash) % m_size; - - if( m_table[bucket] == NULL ) - return NULL; - - Node *first = m_table[bucket]->GetNext(), - *curr = first; - - do - { - if( wxStrcmp( curr->m_key.string, key ) == 0 ) - return curr->m_value; - - curr = curr->GetNext(); - } - while( curr != first ); - - return NULL; -} - -void wxHashTableBase::DoUnlinkNode( size_t bucket, wxHashTableBase_Node* node, - wxHashTableBase_Node* prev ) -{ - if( node == m_table[bucket] ) - m_table[bucket] = prev; - - if( prev == node && prev == node->GetNext() ) - m_table[bucket] = NULL; - else - prev->m_next = node->m_next; - - DoDestroyNode( node ); - --m_count; -} - -void* wxHashTableBase::DoDelete( long key, long hash ) -{ - wxASSERT( m_keyType == wxKEY_INTEGER ); - - size_t bucket = size_t(hash) % m_size; - - if( m_table[bucket] == NULL ) - return NULL; - - Node *first = m_table[bucket]->GetNext(), - *curr = first, - *prev = m_table[bucket]; - - do - { - if( curr->m_key.integer == key ) - { - void* retval = curr->m_value; - curr->m_value = NULL; - - DoUnlinkNode( bucket, curr, prev ); - delete curr; - - return retval; - } - - prev = curr; - curr = curr->GetNext(); - } - while( curr != first ); - - return NULL; -} - -void* wxHashTableBase::DoDelete( const wxChar* key, long hash ) -{ - wxASSERT( m_keyType == wxKEY_STRING ); - - size_t bucket = size_t(hash) % m_size; - - if( m_table[bucket] == NULL ) - return NULL; - - Node *first = m_table[bucket]->GetNext(), - *curr = first, - *prev = m_table[bucket]; - - do - { - if( wxStrcmp( curr->m_key.string, key ) == 0 ) - { - void* retval = curr->m_value; - curr->m_value = NULL; - - DoUnlinkNode( bucket, curr, prev ); - delete curr; - - return retval; - } - - prev = curr; - curr = curr->GetNext(); - } - while( curr != first ); - - return NULL; -} - -long wxHashTableBase::MakeKey( const wxChar *str ) -{ - long int_key = 0; - - while( *str ) - int_key += (wxUChar)*str++; - - return int_key; -} - -// ---------------------------------------------------------------------------- -// wxHashTable -// ---------------------------------------------------------------------------- - -wxHashTable::wxHashTable( const wxHashTable& table ) - : wxHashTableBase() -{ - DoCopy( table ); -} - -const wxHashTable& wxHashTable::operator=( const wxHashTable& table ) -{ - Destroy(); - DoCopy( table ); - - return *this; -} - -void wxHashTable::DoCopy( const wxHashTable& WXUNUSED(table) ) -{ - Create( m_keyType, m_size ); - - wxFAIL; -} - -void wxHashTable::DoDeleteContents( wxHashTableBase_Node* node ) -{ - delete ((wxHashTable_Node*)node)->GetData(); -} - -void wxHashTable::GetNextNode( size_t bucketStart ) -{ - for( size_t i = bucketStart; i < m_size; ++i ) - { - if( m_table[i] != NULL ) - { - m_curr = ((Node*)m_table[i])->GetNext(); - m_currBucket = i; - return; - } - } - - m_curr = NULL; - m_currBucket = 0; -} - -wxHashTable::Node* wxHashTable::Next() -{ - if( m_curr == NULL ) - GetNextNode( 0 ); - else - { - m_curr = m_curr->GetNext(); - - if( m_curr == ( (Node*)m_table[m_currBucket] )->GetNext() ) - GetNextNode( m_currBucket + 1 ); - } - - return m_curr; -} - -#endif // !wxUSE_OLD_HASH_TABLE diff --git a/wxWidgets/src/common/hashmap.cpp b/wxWidgets/src/common/hashmap.cpp deleted file mode 100644 index 215396f8e0..0000000000 --- a/wxWidgets/src/common/hashmap.cpp +++ /dev/null @@ -1,152 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/common/hashmap.cpp -// Purpose: wxHashMap implementation -// Author: Mattia Barbon -// Modified by: -// Created: 29/01/2002 -// RCS-ID: $Id: hashmap.cpp 39802 2006-06-20 10:24:07Z ABX $ -// Copyright: (c) Mattia Barbon -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#include "wx/hashmap.h" - -/* FYI: This is the "One-at-a-Time" algorithm by Bob Jenkins */ -/* from requirements by Colin Plumb. */ -/* (http://burtleburtle.net/bob/hash/doobs.html) */ -/* adapted from Perl sources ( hv.h ) */ -unsigned long wxStringHash::wxCharStringHash( const wxChar* k ) -{ - unsigned long hash = 0; - - while( *k ) - { - hash += *k++; - hash += (hash << 10); - hash ^= (hash >> 6); - } - hash += (hash << 3); - hash ^= (hash >> 11); - - return hash + (hash << 15); -} - -#if wxUSE_UNICODE -unsigned long wxStringHash::charStringHash( const char* k ) -{ - unsigned long hash = 0; - - while( *k ) - { - hash += *k++; - hash += (hash << 10); - hash ^= (hash >> 6); - } - hash += (hash << 3); - hash ^= (hash >> 11); - - return hash + (hash << 15); -} -#endif - -#if !wxUSE_STL || !defined(HAVE_STL_HASH_MAP) - -/* from SGI STL */ -const unsigned long _wxHashTableBase2::ms_primes[prime_count] = -{ - 7ul, 13ul, 29ul, - 53ul, 97ul, 193ul, 389ul, 769ul, - 1543ul, 3079ul, 6151ul, 12289ul, 24593ul, - 49157ul, 98317ul, 196613ul, 393241ul, 786433ul, - 1572869ul, 3145739ul, 6291469ul, 12582917ul, 25165843ul, - 50331653ul, 100663319ul, 201326611ul, 402653189ul, 805306457ul, - 1610612741ul, 3221225473ul, 4294967291ul -}; - -unsigned long _wxHashTableBase2::GetNextPrime( unsigned long n ) -{ - const unsigned long* ptr = &ms_primes[0]; - for( size_t i = 0; i < prime_count; ++i, ++ptr ) - { - if( n < *ptr ) - return *ptr; - } - - /* someone might try to alloc a 2^32-element hash table */ - wxFAIL_MSG( _T("hash table too big?") ); - - /* quiet warning */ - return 0; -} - -unsigned long _wxHashTableBase2::GetPreviousPrime( unsigned long n ) -{ - const unsigned long* ptr = &ms_primes[prime_count - 1]; - - for( size_t i = 0; i < prime_count; ++i, --ptr ) - { - if( n > *ptr ) - return *ptr; - } - - /* quiet warning */ - return 1; -} - -void _wxHashTableBase2::DeleteNodes( size_t buckets, - _wxHashTable_NodeBase** table, - NodeDtor dtor ) -{ - size_t i; - - for( i = 0; i < buckets; ++i ) - { - _wxHashTable_NodeBase* node = table[i]; - _wxHashTable_NodeBase* tmp; - - while( node ) - { - tmp = node->m_nxt; - dtor( node ); - node = tmp; - } - } - - memset( table, 0, buckets * sizeof(void*) ); -} - -void _wxHashTableBase2::CopyHashTable( _wxHashTable_NodeBase** srcTable, - size_t srcBuckets, - _wxHashTableBase2* dst, - _wxHashTable_NodeBase** dstTable, - BucketFromNode func, ProcessNode proc ) -{ - for( size_t i = 0; i < srcBuckets; ++i ) - { - _wxHashTable_NodeBase* nextnode; - - for( _wxHashTable_NodeBase* node = srcTable[i]; node; node = nextnode ) - { - size_t bucket = func( dst, node ); - - nextnode = node->m_nxt; - _wxHashTable_NodeBase* newnode = proc( node ); - newnode->m_nxt = dstTable[bucket]; - dstTable[bucket] = newnode; - } - } -} - -_wxHashTable_NodeBase* _wxHashTableBase2::DummyProcessNode(_wxHashTable_NodeBase* node) -{ - return node; -} - -#endif // !wxUSE_STL || !defined(HAVE_STL_HASH_MAP) diff --git a/wxWidgets/src/common/helpbase.cpp b/wxWidgets/src/common/helpbase.cpp deleted file mode 100644 index 83ede72d74..0000000000 --- a/wxWidgets/src/common/helpbase.cpp +++ /dev/null @@ -1,28 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/common/helpbase.cpp -// Purpose: Help system base classes -// Author: Julian Smart -// Modified by: -// Created: 04/01/98 -// RCS-ID: $Id: helpbase.cpp 38787 2006-04-18 07:24:35Z ABX $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_HELP - -#ifndef WX_PRECOMP -#endif - -#include "wx/helpbase.h" - -IMPLEMENT_CLASS(wxHelpControllerBase, wxObject) - -#endif // wxUSE_HELP diff --git a/wxWidgets/src/common/http.cpp b/wxWidgets/src/common/http.cpp deleted file mode 100644 index cf21f6a34d..0000000000 --- a/wxWidgets/src/common/http.cpp +++ /dev/null @@ -1,422 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/common/http.cpp -// Purpose: HTTP protocol -// Author: Guilhem Lavaux -// Modified by: Simo Virokannas (authentication, Dec 2005) -// Created: August 1997 -// RCS-ID: $Id: http.cpp 44660 2007-03-07 23:07:17Z VZ $ -// Copyright: (c) 1997, 1998 Guilhem Lavaux -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_PROTOCOL_HTTP - -#include -#include - -#ifndef WX_PRECOMP - #include "wx/string.h" - #include "wx/app.h" -#endif - -#include "wx/tokenzr.h" -#include "wx/socket.h" -#include "wx/protocol/protocol.h" -#include "wx/url.h" -#include "wx/protocol/http.h" -#include "wx/sckstrm.h" - -IMPLEMENT_DYNAMIC_CLASS(wxHTTP, wxProtocol) -IMPLEMENT_PROTOCOL(wxHTTP, wxT("http"), wxT("80"), true) - -wxHTTP::wxHTTP() - : wxProtocol() -{ - m_addr = NULL; - m_read = false; - m_proxy_mode = false; - m_post_buf = wxEmptyString; - m_http_response = 0; - - SetNotify(wxSOCKET_LOST_FLAG); -} - -wxHTTP::~wxHTTP() -{ - ClearHeaders(); - - delete m_addr; -} - -void wxHTTP::ClearHeaders() -{ - m_headers.clear(); -} - -wxString wxHTTP::GetContentType() -{ - return GetHeader(wxT("Content-Type")); -} - -void wxHTTP::SetProxyMode(bool on) -{ - m_proxy_mode = on; -} - -wxHTTP::wxHeaderIterator wxHTTP::FindHeader(const wxString& header) -{ - wxHeaderIterator it = m_headers.begin(); - for ( wxHeaderIterator en = m_headers.end(); it != en; ++it ) - { - if ( wxStricmp(it->first, header) == 0 ) - break; - } - - return it; -} - -wxHTTP::wxHeaderConstIterator wxHTTP::FindHeader(const wxString& header) const -{ - wxHeaderConstIterator it = m_headers.begin(); - for ( wxHeaderConstIterator en = m_headers.end(); it != en; ++it ) - { - if ( wxStricmp(it->first, header) == 0 ) - break; - } - - return it; -} - -void wxHTTP::SetHeader(const wxString& header, const wxString& h_data) -{ - if (m_read) { - ClearHeaders(); - m_read = false; - } - - wxHeaderIterator it = FindHeader(header); - if (it != m_headers.end()) - it->second = h_data; - else - m_headers[header] = h_data; -} - -wxString wxHTTP::GetHeader(const wxString& header) const -{ - wxHeaderConstIterator it = FindHeader(header); - - return it == m_headers.end() ? wxGetEmptyString() : it->second; -} - -wxString wxHTTP::GenerateAuthString(const wxString& user, const wxString& pass) const -{ - static const char *base64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; - - wxString buf; - wxString toencode; - - buf.Printf(wxT("Basic ")); - - toencode.Printf(wxT("%s:%s"),user.c_str(),pass.c_str()); - - size_t len = toencode.length(); - const wxChar *from = toencode.c_str(); - while (len >= 3) { // encode full blocks first - buf << wxString::Format(wxT("%c%c"), base64[(from[0] >> 2) & 0x3f], base64[((from[0] << 4) & 0x30) | ((from[1] >> 4) & 0xf)]); - buf << wxString::Format(wxT("%c%c"), base64[((from[1] << 2) & 0x3c) | ((from[2] >> 6) & 0x3)], base64[from[2] & 0x3f]); - from += 3; - len -= 3; - } - if (len > 0) { // pad the remaining characters - buf << wxString::Format(wxT("%c"), base64[(from[0] >> 2) & 0x3f]); - if (len == 1) { - buf << wxString::Format(wxT("%c="), base64[(from[0] << 4) & 0x30]); - } else { - buf << wxString::Format(wxT("%c%c"), base64[((from[0] << 4) & 0x30) | ((from[1] >> 4) & 0xf)], base64[(from[1] << 2) & 0x3c]); - } - buf << wxString::Format(wxT("=")); - } - - return buf; -} - -void wxHTTP::SetPostBuffer(const wxString& post_buf) -{ - m_post_buf = post_buf; -} - -void wxHTTP::SendHeaders() -{ - typedef wxStringToStringHashMap::iterator iterator; - wxString buf; - - for (iterator it = m_headers.begin(), en = m_headers.end(); it != en; ++it ) - { - buf.Printf(wxT("%s: %s\r\n"), it->first.c_str(), it->second.c_str()); - - const wxWX2MBbuf cbuf = buf.mb_str(); - Write(cbuf, strlen(cbuf)); - } -} - -bool wxHTTP::ParseHeaders() -{ - wxString line; - wxStringTokenizer tokenzr; - - ClearHeaders(); - m_read = true; - - for ( ;; ) - { - m_perr = ReadLine(this, line); - if (m_perr != wxPROTO_NOERR) - return false; - - if (line.length() == 0) - break; - - wxString left_str = line.BeforeFirst(':'); - m_headers[left_str] = line.AfterFirst(':').Strip(wxString::both); - } - return true; -} - -bool wxHTTP::Connect(const wxString& host, unsigned short port) -{ - wxIPV4address *addr; - - if (m_addr) { - delete m_addr; - m_addr = NULL; - Close(); - } - - m_addr = addr = new wxIPV4address(); - - if (!addr->Hostname(host)) { - delete m_addr; - m_addr = NULL; - m_perr = wxPROTO_NETERR; - return false; - } - - if ( port ) - addr->Service(port); - else if (!addr->Service(wxT("http"))) - addr->Service(80); - - SetHeader(wxT("Host"), host); - - return true; -} - -bool wxHTTP::Connect(wxSockAddress& addr, bool WXUNUSED(wait)) -{ - if (m_addr) { - delete m_addr; - Close(); - } - - m_addr = addr.Clone(); - - wxIPV4address *ipv4addr = wxDynamicCast(&addr, wxIPV4address); - if (ipv4addr) - SetHeader(wxT("Host"), ipv4addr->OrigHostname()); - - return true; -} - -bool wxHTTP::BuildRequest(const wxString& path, wxHTTP_Req req) -{ - const wxChar *request; - - switch (req) - { - case wxHTTP_GET: - request = wxT("GET"); - break; - - case wxHTTP_POST: - request = wxT("POST"); - if ( GetHeader( wxT("Content-Length") ).IsNull() ) - SetHeader( wxT("Content-Length"), wxString::Format( wxT("%lu"), (unsigned long)m_post_buf.Len() ) ); - break; - - default: - return false; - } - - m_http_response = 0; - - // If there is no User-Agent defined, define it. - if (GetHeader(wxT("User-Agent")).IsNull()) - SetHeader(wxT("User-Agent"), wxT("wxWidgets 2.x")); - - // Send authentication information - if (!m_username.empty() || !m_password.empty()) { - SetHeader(wxT("Authorization"), GenerateAuthString(m_username, m_password)); - } - - SaveState(); - - // we may use non blocking sockets only if we can dispatch events from them - SetFlags( wxIsMainThread() && wxApp::IsMainLoopRunning() ? wxSOCKET_NONE - : wxSOCKET_BLOCK ); - Notify(false); - - wxString buf; - buf.Printf(wxT("%s %s HTTP/1.0\r\n"), request, path.c_str()); - const wxWX2MBbuf pathbuf = wxConvLocal.cWX2MB(buf); - Write(pathbuf, strlen(wxMBSTRINGCAST pathbuf)); - SendHeaders(); - Write("\r\n", 2); - - if ( req == wxHTTP_POST ) { - Write(m_post_buf.mbc_str(), m_post_buf.Len()); - m_post_buf = wxEmptyString; - } - - wxString tmp_str; - m_perr = ReadLine(this, tmp_str); - if (m_perr != wxPROTO_NOERR) { - RestoreState(); - return false; - } - - if (!tmp_str.Contains(wxT("HTTP/"))) { - // TODO: support HTTP v0.9 which can have no header. - // FIXME: tmp_str is not put back in the in-queue of the socket. - SetHeader(wxT("Content-Length"), wxT("-1")); - SetHeader(wxT("Content-Type"), wxT("none/none")); - RestoreState(); - return true; - } - - wxStringTokenizer token(tmp_str,wxT(' ')); - wxString tmp_str2; - bool ret_value; - - token.NextToken(); - tmp_str2 = token.NextToken(); - - m_http_response = wxAtoi(tmp_str2); - - switch (tmp_str2[0u]) - { - case wxT('1'): - /* INFORMATION / SUCCESS */ - break; - - case wxT('2'): - /* SUCCESS */ - break; - - case wxT('3'): - /* REDIRECTION */ - break; - - default: - m_perr = wxPROTO_NOFILE; - RestoreState(); - return false; - } - - ret_value = ParseHeaders(); - RestoreState(); - return ret_value; -} - -class wxHTTPStream : public wxSocketInputStream -{ -public: - wxHTTP *m_http; - size_t m_httpsize; - unsigned long m_read_bytes; - - wxHTTPStream(wxHTTP *http) : wxSocketInputStream(*http), m_http(http) {} - size_t GetSize() const { return m_httpsize; } - virtual ~wxHTTPStream(void) { m_http->Abort(); } - -protected: - size_t OnSysRead(void *buffer, size_t bufsize); - - DECLARE_NO_COPY_CLASS(wxHTTPStream) -}; - -size_t wxHTTPStream::OnSysRead(void *buffer, size_t bufsize) -{ - if (m_httpsize > 0 && m_read_bytes >= m_httpsize) - { - m_lasterror = wxSTREAM_EOF; - return 0; - } - - size_t ret = wxSocketInputStream::OnSysRead(buffer, bufsize); - m_read_bytes += ret; - - if (m_httpsize==(size_t)-1 && m_lasterror == wxSTREAM_READ_ERROR ) - { - // if m_httpsize is (size_t) -1 this means read until connection closed - // which is equivalent to getting a READ_ERROR, for clients however this - // must be translated into EOF, as it is the expected way of signalling - // end end of the content - m_lasterror = wxSTREAM_EOF ; - } - - return ret; -} - -bool wxHTTP::Abort(void) -{ - return wxSocketClient::Close(); -} - -wxInputStream *wxHTTP::GetInputStream(const wxString& path) -{ - wxHTTPStream *inp_stream; - - wxString new_path; - - m_perr = wxPROTO_CONNERR; - if (!m_addr) - return NULL; - - // We set m_connected back to false so wxSocketBase will know what to do. -#ifdef __WXMAC__ - wxSocketClient::Connect(*m_addr , false ); - wxSocketClient::WaitOnConnect(10); - - if (!wxSocketClient::IsConnected()) - return NULL; -#else - if (!wxProtocol::Connect(*m_addr)) - return NULL; -#endif - - if (!BuildRequest(path, m_post_buf.empty() ? wxHTTP_GET : wxHTTP_POST)) - return NULL; - - inp_stream = new wxHTTPStream(this); - - if (!GetHeader(wxT("Content-Length")).empty()) - inp_stream->m_httpsize = wxAtoi(WXSTRINGCAST GetHeader(wxT("Content-Length"))); - else - inp_stream->m_httpsize = (size_t)-1; - - inp_stream->m_read_bytes = 0; - - Notify(false); - SetFlags(wxSOCKET_BLOCK | wxSOCKET_WAITALL); - - return inp_stream; -} - -#endif // wxUSE_PROTOCOL_HTTP diff --git a/wxWidgets/src/common/iconbndl.cpp b/wxWidgets/src/common/iconbndl.cpp deleted file mode 100644 index 98805d7e8a..0000000000 --- a/wxWidgets/src/common/iconbndl.cpp +++ /dev/null @@ -1,142 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/common/iconbndl.cpp -// Purpose: wxIconBundle -// Author: Mattia Barbon -// Created: 23.03.2002 -// RCS-ID: $Id: iconbndl.cpp 40654 2006-08-17 16:08:13Z VS $ -// Copyright: (c) Mattia barbon -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#include "wx/iconbndl.h" - -#ifndef WX_PRECOMP - #include "wx/settings.h" - #include "wx/icon.h" - #include "wx/log.h" - #include "wx/intl.h" - #include "wx/bitmap.h" - #include "wx/image.h" -#endif - -#include "wx/arrimpl.cpp" - -WX_DEFINE_OBJARRAY(wxIconArray) - -const wxIconBundle& wxIconBundle::operator =( const wxIconBundle& ic ) -{ - if( this == &ic ) return *this; - - size_t i, max = ic.m_icons.GetCount(); - - DeleteIcons(); - for( i = 0; i < max; ++i ) - m_icons.Add( ic.m_icons[i] ); - - return *this; -} - -void wxIconBundle::DeleteIcons() -{ - m_icons.Empty(); -} - -#if wxUSE_IMAGE -void wxIconBundle::AddIcon( const wxString& file, long type ) -#else -void wxIconBundle::AddIcon( const wxString& WXUNUSED(file), long WXUNUSED(type) ) -#endif -{ -#if wxUSE_IMAGE && (!defined(__WXMSW__) || wxUSE_WXDIB) - size_t count = wxImage::GetImageCount( file, type ); - size_t i; - wxImage image; - - for( i = 0; i < count; ++i ) - { - if( !image.LoadFile( file, type, i ) ) - { - wxLogError( _("Failed to load image %d from file '%s'."), - i, file.c_str() ); - continue; - } - - wxIcon* tmp = new wxIcon(); - tmp->CopyFromBitmap( wxBitmap( image ) ); - AddIcon( *tmp ); - delete tmp; - } -#endif -} - -const wxIcon& wxIconBundle::GetIcon( const wxSize& size ) const -{ - // temp. variable needed to fix Borland C++ 5.5.1 problem - // with passing a return value through two functions - wxIcon *tmp; - - size_t max = m_icons.GetCount(); - - // if we have one or no icon, we can return now without doing more work: - if ( max <= 1 ) - { - if ( max == 1 ) // fix for broken BCC - tmp = &m_icons[0]; - else // max == 0 - tmp = &wxNullIcon; - return *tmp; - } - - // there are more icons, find the best match: - wxCoord sysX = wxSystemSettings::GetMetric( wxSYS_ICON_X ), - sysY = wxSystemSettings::GetMetric( wxSYS_ICON_Y ); - - wxIcon *sysIcon = 0; - - for( size_t i = 0; i < max; i++ ) - { - if( !m_icons[i].Ok() ) - continue; - wxCoord sx = m_icons[i].GetWidth(), sy = m_icons[i].GetHeight(); - // requested size - if( sx == size.x && sy == size.y ) - { - tmp = &m_icons[i]; // fix for broken BCC - return *tmp; - } - // keep track if there is a system-size icon - if( sx == sysX && sy == sysY ) - sysIcon = &m_icons[i]; - } - - // return the system-sized icon if we've got one - if( sysIcon ) return *sysIcon; - // we certainly have at least one icon thanks to the <=1 check above - tmp = &m_icons[0]; - return *tmp; -} - -void wxIconBundle::AddIcon( const wxIcon& icon ) -{ - size_t i, max = m_icons.GetCount(); - - for( i = 0; i < max; ++i ) - { - wxIcon& tmp = m_icons[i]; - if( tmp.Ok() && tmp.GetWidth() == icon.GetWidth() && - tmp.GetHeight() == icon.GetHeight() ) - { - tmp = icon; - return; - } - } - - m_icons.Add( icon ); -} diff --git a/wxWidgets/src/common/imagall.cpp b/wxWidgets/src/common/imagall.cpp deleted file mode 100644 index 90e66ac95f..0000000000 --- a/wxWidgets/src/common/imagall.cpp +++ /dev/null @@ -1,64 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/common/imagall.cpp -// Purpose: wxImage access all handler -// Author: Sylvain Bougnoux -// RCS-ID: $Id: imagall.cpp 42644 2006-10-29 18:58:25Z VZ $ -// Copyright: (c) Sylvain Bougnoux -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_IMAGE - -#ifndef WX_PRECOMP - #include "wx/image.h" -#endif - -//----------------------------------------------------------------------------- -// This function allows dynamic access to all image handlers compile within -// the library. This function should be in a separate file as some compilers -// link against the whole object file as long as just one of is function is called! - -void wxInitAllImageHandlers() -{ -#if wxUSE_LIBPNG - wxImage::AddHandler( new wxPNGHandler ); -#endif -#if wxUSE_LIBJPEG - wxImage::AddHandler( new wxJPEGHandler ); -#endif -#if wxUSE_LIBTIFF - wxImage::AddHandler( new wxTIFFHandler ); -#endif -#if wxUSE_GIF - wxImage::AddHandler( new wxGIFHandler ); -#endif -#if wxUSE_PNM - wxImage::AddHandler( new wxPNMHandler ); -#endif -#if wxUSE_PCX - wxImage::AddHandler( new wxPCXHandler ); -#endif -#if wxUSE_IFF - wxImage::AddHandler( new wxIFFHandler ); -#endif -#if wxUSE_ICO_CUR - wxImage::AddHandler( new wxICOHandler ); - wxImage::AddHandler( new wxCURHandler ); - wxImage::AddHandler( new wxANIHandler ); -#endif -#if wxUSE_TGA - wxImage::AddHandler( new wxTGAHandler ); -#endif -#if wxUSE_XPM - wxImage::AddHandler( new wxXPMHandler ); -#endif -} - -#endif // wxUSE_IMAGE diff --git a/wxWidgets/src/common/imagbmp.cpp b/wxWidgets/src/common/imagbmp.cpp deleted file mode 100644 index d0930f464f..0000000000 --- a/wxWidgets/src/common/imagbmp.cpp +++ /dev/null @@ -1,1383 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/common/imagbmp.cpp -// Purpose: wxImage BMP,ICO and CUR handlers -// Author: Robert Roebling, Chris Elliott -// RCS-ID: $Id: imagbmp.cpp 54942 2008-08-03 00:23:38Z VZ $ -// Copyright: (c) Robert Roebling, Chris Elliott -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_IMAGE - -#include "wx/imagbmp.h" - -#ifndef WX_PRECOMP - #ifdef __WXMSW__ - #include "wx/msw/wrapwin.h" - #endif - #include "wx/log.h" - #include "wx/app.h" - #include "wx/bitmap.h" - #include "wx/palette.h" - #include "wx/intl.h" -#endif - -#include "wx/filefn.h" -#include "wx/wfstream.h" -#include "wx/quantize.h" -#include "wx/anidecod.h" - -// For memcpy -#include - -#ifdef __SALFORDC__ -#ifdef FAR -#undef FAR -#endif -#endif - -//----------------------------------------------------------------------------- -// wxBMPHandler -//----------------------------------------------------------------------------- - -IMPLEMENT_DYNAMIC_CLASS(wxBMPHandler,wxImageHandler) - -#if wxUSE_STREAMS - -#ifndef BI_RGB - #define BI_RGB 0 -#endif - -#ifndef BI_RLE8 -#define BI_RLE8 1 -#endif - -#ifndef BI_RLE4 -#define BI_RLE4 2 -#endif - -#ifndef BI_BITFIELDS -#define BI_BITFIELDS 3 -#endif - -#define poffset (line * width * 3 + column * 3) - -bool wxBMPHandler::SaveFile(wxImage *image, - wxOutputStream& stream, - bool verbose) -{ - return SaveDib(image, stream, verbose, true/*IsBmp*/, false/*IsMask*/); -} - -bool wxBMPHandler::SaveDib(wxImage *image, - wxOutputStream& stream, - bool verbose, - bool IsBmp, - bool IsMask) - -{ - wxCHECK_MSG( image, false, _T("invalid pointer in wxBMPHandler::SaveFile") ); - - if ( !image->Ok() ) - { - if ( verbose ) - wxLogError(_("BMP: Couldn't save invalid image.")); - return false; - } - - // get the format of the BMP file to save, else use 24bpp - unsigned format = wxBMP_24BPP; - if ( image->HasOption(wxIMAGE_OPTION_BMP_FORMAT) ) - format = image->GetOptionInt(wxIMAGE_OPTION_BMP_FORMAT); - - wxUint16 bpp; // # of bits per pixel - int palette_size; // # of color map entries, ie. 2^bpp colors - - // set the bpp and appropriate palette_size, and do additional checks - if ( (format == wxBMP_1BPP) || (format == wxBMP_1BPP_BW) ) - { - bpp = 1; - palette_size = 2; - } - else if ( format == wxBMP_4BPP ) - { - bpp = 4; - palette_size = 16; - } - else if ( (format == wxBMP_8BPP) || (format == wxBMP_8BPP_GREY) || - (format == wxBMP_8BPP_RED) || (format == wxBMP_8BPP_PALETTE) ) - { - // need to set a wxPalette to use this, HOW TO CHECK IF VALID, SIZE? - if ((format == wxBMP_8BPP_PALETTE) -#if wxUSE_PALETTE - && !image->HasPalette() -#endif // wxUSE_PALETTE - ) - { - if ( verbose ) - wxLogError(_("BMP: wxImage doesn't have own wxPalette.")); - return false; - } - bpp = 8; - palette_size = 256; - } - else // you get 24bpp - { - format = wxBMP_24BPP; - bpp = 24; - palette_size = 0; - } - - unsigned width = image->GetWidth(); - unsigned row_padding = (4 - int(width*bpp/8.0) % 4) % 4; // # bytes to pad to dword - unsigned row_width = int(width * bpp/8.0) + row_padding; // # of bytes per row - - struct - { - // BitmapHeader: - wxUint16 magic; // format magic, always 'BM' - wxUint32 filesize; // total file size, inc. headers - wxUint32 reserved; // for future use - wxUint32 data_offset; // image data offset in the file - - // BitmapInfoHeader: - wxUint32 bih_size; // 2nd part's size - wxUint32 width, height; // bitmap's dimensions - wxUint16 planes; // num of planes - wxUint16 bpp; // bits per pixel - wxUint32 compression; // compression method - wxUint32 size_of_bmp; // size of the bitmap - wxUint32 h_res, v_res; // image resolution in dpi - wxUint32 num_clrs; // number of colors used - wxUint32 num_signif_clrs;// number of significant colors - } hdr; - - wxUint32 hdr_size = 14/*BitmapHeader*/ + 40/*BitmapInfoHeader*/; - - hdr.magic = wxUINT16_SWAP_ON_BE(0x4D42/*'BM'*/); - hdr.filesize = wxUINT32_SWAP_ON_BE( hdr_size + palette_size*4 + - row_width * image->GetHeight() ); - hdr.reserved = 0; - hdr.data_offset = wxUINT32_SWAP_ON_BE(hdr_size + palette_size*4); - - hdr.bih_size = wxUINT32_SWAP_ON_BE(hdr_size - 14); - hdr.width = wxUINT32_SWAP_ON_BE(image->GetWidth()); - if ( IsBmp ) - { - hdr.height = wxUINT32_SWAP_ON_BE(image->GetHeight()); - } - else - { - hdr.height = wxUINT32_SWAP_ON_BE(2 * image->GetHeight()); - } - hdr.planes = wxUINT16_SWAP_ON_BE(1); // always 1 plane - hdr.bpp = wxUINT16_SWAP_ON_BE(bpp); - hdr.compression = 0; // RGB uncompressed - hdr.size_of_bmp = wxUINT32_SWAP_ON_BE(row_width * image->GetHeight()); - hdr.h_res = hdr.v_res = wxUINT32_SWAP_ON_BE(72); // 72dpi is standard - hdr.num_clrs = wxUINT32_SWAP_ON_BE(palette_size); // # colors in colormap - hdr.num_signif_clrs = 0; // all colors are significant - - if ( IsBmp ) - { - if (// VS: looks ugly but compilers tend to do ugly things with structs, - // like aligning hdr.filesize's ofset to dword :( - // VZ: we should add padding then... - !stream.Write(&hdr.magic, 2) || - !stream.Write(&hdr.filesize, 4) || - !stream.Write(&hdr.reserved, 4) || - !stream.Write(&hdr.data_offset, 4) - ) - { - if (verbose) - wxLogError(_("BMP: Couldn't write the file (Bitmap) header.")); - return false; - } - } - if ( !IsMask ) - { - if ( - !stream.Write(&hdr.bih_size, 4) || - !stream.Write(&hdr.width, 4) || - !stream.Write(&hdr.height, 4) || - !stream.Write(&hdr.planes, 2) || - !stream.Write(&hdr.bpp, 2) || - !stream.Write(&hdr.compression, 4) || - !stream.Write(&hdr.size_of_bmp, 4) || - !stream.Write(&hdr.h_res, 4) || - !stream.Write(&hdr.v_res, 4) || - !stream.Write(&hdr.num_clrs, 4) || - !stream.Write(&hdr.num_signif_clrs, 4) - ) - { - if (verbose) - wxLogError(_("BMP: Couldn't write the file (BitmapInfo) header.")); - return false; - } - } - - wxPalette *palette = NULL; // entries for quantized images - wxUint8 *rgbquad = NULL; // for the RGBQUAD bytes for the colormap - wxImage *q_image = NULL; // destination for quantized image - - // if <24bpp use quantization to reduce colors for *some* of the formats - if ( (format == wxBMP_1BPP) || (format == wxBMP_4BPP) || - (format == wxBMP_8BPP) || (format == wxBMP_8BPP_PALETTE) ) - { - // make a new palette and quantize the image - if (format != wxBMP_8BPP_PALETTE) - { - q_image = new wxImage(); - - // I get a delete error using Quantize when desired colors > 236 - int quantize = ((palette_size > 236) ? 236 : palette_size); - // fill the destination too, it gives much nicer 4bpp images - wxQuantize::Quantize( *image, *q_image, &palette, quantize, 0, - wxQUANTIZE_FILL_DESTINATION_IMAGE ); - } - else - { -#if wxUSE_PALETTE - palette = new wxPalette(image->GetPalette()); -#endif // wxUSE_PALETTE - } - - int i; - unsigned char r, g, b; - rgbquad = new wxUint8 [palette_size*4]; - - for (i = 0; i < palette_size; i++) - { -#if wxUSE_PALETTE - if ( !palette->GetRGB(i, &r, &g, &b) ) -#endif // wxUSE_PALETTE - r = g = b = 0; - - rgbquad[i*4] = b; - rgbquad[i*4+1] = g; - rgbquad[i*4+2] = r; - rgbquad[i*4+3] = 0; - } - } - // make a 256 entry greyscale colormap or 2 entry black & white - else if ( (format == wxBMP_8BPP_GREY) || (format == wxBMP_8BPP_RED) || - (format == wxBMP_1BPP_BW) ) - { - rgbquad = new wxUint8 [palette_size*4]; - - for ( int i = 0; i < palette_size; i++ ) - { - // if 1BPP_BW then the value should be either 0 or 255 - wxUint8 c = (wxUint8)((i > 0) && (format == wxBMP_1BPP_BW) ? 255 : i); - - rgbquad[i*4] = - rgbquad[i*4+1] = - rgbquad[i*4+2] = c; - rgbquad[i*4+3] = 0; - } - } - - // if the colormap was made, then it needs to be written - if (rgbquad) - { - if ( !IsMask ) - { - if ( !stream.Write(rgbquad, palette_size*4) ) - { - if (verbose) - wxLogError(_("BMP: Couldn't write RGB color map.")); - delete[] rgbquad; -#if wxUSE_PALETTE - delete palette; -#endif // wxUSE_PALETTE - delete q_image; - return false; - } - } - delete []rgbquad; - } - - // pointer to the image data, use quantized if available - wxUint8 *data = (wxUint8*) image->GetData(); - if (q_image) if (q_image->Ok()) data = (wxUint8*) q_image->GetData(); - - wxUint8 *buffer = new wxUint8[row_width]; - memset(buffer, 0, row_width); - int y; unsigned x; - long int pixel; - - for (y = image->GetHeight() -1; y >= 0; y--) - { - if ( format == wxBMP_24BPP ) // 3 bytes per pixel red,green,blue - { - for ( x = 0; x < width; x++ ) - { - pixel = 3*(y*width + x); - - buffer[3*x ] = data[pixel+2]; - buffer[3*x + 1] = data[pixel+1]; - buffer[3*x + 2] = data[pixel]; - } - } - else if ((format == wxBMP_8BPP) || // 1 byte per pixel in color - (format == wxBMP_8BPP_PALETTE)) - { - for (x = 0; x < width; x++) - { - pixel = 3*(y*width + x); -#if wxUSE_PALETTE - buffer[x] = (wxUint8)palette->GetPixel( data[pixel], - data[pixel+1], - data[pixel+2] ); -#else - // FIXME: what should this be? use some std palette maybe? - buffer[x] = 0; -#endif // wxUSE_PALETTE - } - } - else if ( format == wxBMP_8BPP_GREY ) // 1 byte per pix, rgb ave to grey - { - for (x = 0; x < width; x++) - { - pixel = 3*(y*width + x); - buffer[x] = (wxUint8)(.299*data[pixel] + - .587*data[pixel+1] + - .114*data[pixel+2]); - } - } - else if ( format == wxBMP_8BPP_RED ) // 1 byte per pixel, red as greys - { - for (x = 0; x < width; x++) - { - buffer[x] = (wxUint8)data[3*(y*width + x)]; - } - } - else if ( format == wxBMP_4BPP ) // 4 bpp in color - { - for (x = 0; x < width; x+=2) - { - pixel = 3*(y*width + x); - - // fill buffer, ignore if > width -#if wxUSE_PALETTE - buffer[x/2] = (wxUint8)( - ((wxUint8)palette->GetPixel(data[pixel], - data[pixel+1], - data[pixel+2]) << 4) | - (((x+1) > width) - ? 0 - : ((wxUint8)palette->GetPixel(data[pixel+3], - data[pixel+4], - data[pixel+5]) )) ); -#else - // FIXME: what should this be? use some std palette maybe? - buffer[x/2] = 0; -#endif // wxUSE_PALETTE - } - } - else if ( format == wxBMP_1BPP ) // 1 bpp in "color" - { - for (x = 0; x < width; x+=8) - { - pixel = 3*(y*width + x); - -#if wxUSE_PALETTE - buffer[x/8] = (wxUint8)( - ((wxUint8)palette->GetPixel(data[pixel], data[pixel+1], data[pixel+2]) << 7) | - (((x+1) > width) ? 0 : ((wxUint8)palette->GetPixel(data[pixel+3], data[pixel+4], data[pixel+5]) << 6)) | - (((x+2) > width) ? 0 : ((wxUint8)palette->GetPixel(data[pixel+6], data[pixel+7], data[pixel+8]) << 5)) | - (((x+3) > width) ? 0 : ((wxUint8)palette->GetPixel(data[pixel+9], data[pixel+10], data[pixel+11]) << 4)) | - (((x+4) > width) ? 0 : ((wxUint8)palette->GetPixel(data[pixel+12], data[pixel+13], data[pixel+14]) << 3)) | - (((x+5) > width) ? 0 : ((wxUint8)palette->GetPixel(data[pixel+15], data[pixel+16], data[pixel+17]) << 2)) | - (((x+6) > width) ? 0 : ((wxUint8)palette->GetPixel(data[pixel+18], data[pixel+19], data[pixel+20]) << 1)) | - (((x+7) > width) ? 0 : ((wxUint8)palette->GetPixel(data[pixel+21], data[pixel+22], data[pixel+23]) )) ); -#else - // FIXME: what should this be? use some std palette maybe? - buffer[x/8] = 0; -#endif // wxUSE_PALETTE - } - } - else if ( format == wxBMP_1BPP_BW ) // 1 bpp B&W colormap from red color ONLY - { - for (x = 0; x < width; x+=8) - { - pixel = 3*(y*width + x); - - buffer[x/8] = (wxUint8)( - (((wxUint8)(data[pixel] /128.)) << 7) | - (((x+1) > width) ? 0 : (((wxUint8)(data[pixel+3] /128.)) << 6)) | - (((x+2) > width) ? 0 : (((wxUint8)(data[pixel+6] /128.)) << 5)) | - (((x+3) > width) ? 0 : (((wxUint8)(data[pixel+9] /128.)) << 4)) | - (((x+4) > width) ? 0 : (((wxUint8)(data[pixel+12]/128.)) << 3)) | - (((x+5) > width) ? 0 : (((wxUint8)(data[pixel+15]/128.)) << 2)) | - (((x+6) > width) ? 0 : (((wxUint8)(data[pixel+18]/128.)) << 1)) | - (((x+7) > width) ? 0 : (((wxUint8)(data[pixel+21]/128.)) )) ); - } - } - - if ( !stream.Write(buffer, row_width) ) - { - if (verbose) - wxLogError(_("BMP: Couldn't write data.")); - delete[] buffer; -#if wxUSE_PALETTE - delete palette; -#endif // wxUSE_PALETTE - delete q_image; - return false; - } - } - delete[] buffer; -#if wxUSE_PALETTE - delete palette; -#endif // wxUSE_PALETTE - delete q_image; - - return true; -} - - -typedef struct -{ - unsigned char r, g, b; -} _cmap; - -bool wxBMPHandler::DoLoadDib(wxImage * image, int width, int height, - int bpp, int ncolors, int comp, - wxFileOffset bmpOffset, wxInputStream& stream, - bool verbose, bool IsBmp, bool hasPalette) -{ - wxInt32 aDword, rmask = 0, gmask = 0, bmask = 0, amask = 0; - int rshift = 0, gshift = 0, bshift = 0, ashift = 0; - int rbits = 0, gbits = 0, bbits = 0, abits = 0; - wxInt32 dbuf[4]; - wxInt8 bbuf[4]; - wxUint8 aByte; - wxUint16 aWord; - - // allocate space for palette if needed: - _cmap *cmap; - - if ( bpp < 16 ) - { - cmap = new _cmap[ncolors]; - if ( !cmap ) - { - if (verbose) - wxLogError(_("BMP: Couldn't allocate memory.")); - return false; - } - } - else - cmap = NULL; - - // destroy existing here instead of: - image->Destroy(); - image->Create(width, height); - - unsigned char *ptr = image->GetData(); - - if ( !ptr ) - { - if ( verbose ) - wxLogError( _("BMP: Couldn't allocate memory.") ); - delete[] cmap; - return false; - } - - unsigned char *alpha; - if ( bpp == 32 ) - { - // tell the image to allocate an alpha buffer - image->SetAlpha(); - alpha = image->GetAlpha(); - if ( !alpha ) - { - if ( verbose ) - wxLogError(_("BMP: Couldn't allocate memory.")); - delete[] cmap; - return false; - } - } - else // no alpha - { - alpha = NULL; - } - - // Reading the palette, if it exists: - if ( bpp < 16 && ncolors != 0 ) - { - unsigned char* r = new unsigned char[ncolors]; - unsigned char* g = new unsigned char[ncolors]; - unsigned char* b = new unsigned char[ncolors]; - for (int j = 0; j < ncolors; j++) - { - if (hasPalette) - { - stream.Read(bbuf, 4); - cmap[j].b = bbuf[0]; - cmap[j].g = bbuf[1]; - cmap[j].r = bbuf[2]; - - r[j] = cmap[j].r; - g[j] = cmap[j].g; - b[j] = cmap[j].b; - } - else - { - //used in reading .ico file mask - r[j] = cmap[j].r = - g[j] = cmap[j].g = - b[j] = cmap[j].b = ( j ? 255 : 0 ); - } - } - -#if wxUSE_PALETTE - // Set the palette for the wxImage - image->SetPalette(wxPalette(ncolors, r, g, b)); -#endif // wxUSE_PALETTE - - delete[] r; - delete[] g; - delete[] b; - } - else if ( bpp == 16 || bpp == 32 ) - { - if ( comp == BI_BITFIELDS ) - { - int bit = 0; - stream.Read(dbuf, 4 * 3); - rmask = wxINT32_SWAP_ON_BE(dbuf[0]); - gmask = wxINT32_SWAP_ON_BE(dbuf[1]); - bmask = wxINT32_SWAP_ON_BE(dbuf[2]); - // find shift amount (Least significant bit of mask) - for (bit = bpp-1; bit>=0; bit--) - { - if (bmask & (1 << bit)) - bshift = bit; - if (gmask & (1 << bit)) - gshift = bit; - if (rmask & (1 << bit)) - rshift = bit; - } - // Find number of bits in mask (MSB-LSB+1) - for (bit = 0; bit < bpp; bit++) - { - if (bmask & (1 << bit)) - bbits = bit-bshift+1; - if (gmask & (1 << bit)) - gbits = bit-gshift+1; - if (rmask & (1 << bit)) - rbits = bit-rshift+1; - } - } - else if ( bpp == 16 ) - { - rmask = 0x7C00; - gmask = 0x03E0; - bmask = 0x001F; - rshift = 10; - gshift = 5; - bshift = 0; - rbits = 5; - gbits = 5; - bbits = 5; - } - else if ( bpp == 32 ) - { - rmask = 0x00FF0000; - gmask = 0x0000FF00; - bmask = 0x000000FF; - amask = 0xFF000000; - - ashift = 24; - rshift = 16; - gshift = 8; - bshift = 0; - abits = 8; - rbits = 8; - gbits = 8; - bbits = 8; - } - } - - /* - * Reading the image data - */ - if ( IsBmp ) - stream.SeekI(bmpOffset); // else icon, just carry on - - unsigned char *data = ptr; - - /* set the whole image to the background color */ - if ( bpp < 16 && (comp == BI_RLE4 || comp == BI_RLE8) ) - { - for (int i = 0; i < width * height; i++) - { - *ptr++ = cmap[0].r; - *ptr++ = cmap[0].g; - *ptr++ = cmap[0].b; - } - ptr = data; - } - - int linesize = ((width * bpp + 31) / 32) * 4; - - /* BMPs are stored upside down */ - for ( int line = (height - 1); line >= 0; line-- ) - { - int linepos = 0; - for ( int column = 0; column < width ; ) - { - if ( bpp < 16 ) - { - linepos++; - aByte = stream.GetC(); - if ( bpp == 1 ) - { - for (int bit = 0; bit < 8 && column < width; bit++) - { - int index = ((aByte & (0x80 >> bit)) ? 1 : 0); - ptr[poffset] = cmap[index].r; - ptr[poffset + 1] = cmap[index].g; - ptr[poffset + 2] = cmap[index].b; - column++; - } - } - else if ( bpp == 4 ) - { - if ( comp == BI_RLE4 ) - { - wxUint8 first; - first = aByte; - aByte = stream.GetC(); - if ( first == 0 ) - { - if ( aByte == 0 ) - { - if ( column > 0 ) - column = width; - } - else if ( aByte == 1 ) - { - column = width; - line = -1; - } - else if ( aByte == 2 ) - { - aByte = stream.GetC(); - column += aByte; - linepos = column * bpp / 4; - aByte = stream.GetC(); - line -= aByte; // upside down - } - else - { - int absolute = aByte; - wxUint8 nibble[2] ; - int readBytes = 0 ; - for (int k = 0; k < absolute; k++) - { - if ( !(k % 2 ) ) - { - ++readBytes ; - aByte = stream.GetC(); - nibble[0] = (wxUint8)( (aByte & 0xF0) >> 4 ) ; - nibble[1] = (wxUint8)( aByte & 0x0F ) ; - } - ptr[poffset ] = cmap[nibble[k%2]].r; - ptr[poffset + 1] = cmap[nibble[k%2]].g; - ptr[poffset + 2] = cmap[nibble[k%2]].b; - column++; - if ( k % 2 ) - linepos++; - } - if ( readBytes & 0x01 ) - aByte = stream.GetC(); - } - } - else - { - wxUint8 nibble[2] ; - nibble[0] = (wxUint8)( (aByte & 0xF0) >> 4 ) ; - nibble[1] = (wxUint8)( aByte & 0x0F ) ; - - for ( int l = 0; l < first && column < width; l++ ) - { - ptr[poffset ] = cmap[nibble[l%2]].r; - ptr[poffset + 1] = cmap[nibble[l%2]].g; - ptr[poffset + 2] = cmap[nibble[l%2]].b; - column++; - if ( l % 2 ) - linepos++; - } - } - } - else - { - for (int nibble = 0; nibble < 2 && column < width; nibble++) - { - int index = ((aByte & (0xF0 >> nibble * 4)) >> (!nibble * 4)); - if ( index >= 16 ) - index = 15; - ptr[poffset] = cmap[index].r; - ptr[poffset + 1] = cmap[index].g; - ptr[poffset + 2] = cmap[index].b; - column++; - } - } - } - else if ( bpp == 8 ) - { - if ( comp == BI_RLE8 ) - { - unsigned char first; - first = aByte; - aByte = stream.GetC(); - if ( first == 0 ) - { - if ( aByte == 0 ) - { - /* column = width; */ - } - else if ( aByte == 1 ) - { - column = width; - line = -1; - } - else if ( aByte == 2 ) - { - aByte = stream.GetC(); - column += aByte; - linepos = column * bpp / 8; - aByte = stream.GetC(); - line += aByte; - } - else - { - int absolute = aByte; - for (int k = 0; k < absolute; k++) - { - linepos++; - aByte = stream.GetC(); - ptr[poffset ] = cmap[aByte].r; - ptr[poffset + 1] = cmap[aByte].g; - ptr[poffset + 2] = cmap[aByte].b; - column++; - } - if ( absolute & 0x01 ) - aByte = stream.GetC(); - } - } - else - { - for ( int l = 0; l < first && column < width; l++ ) - { - ptr[poffset ] = cmap[aByte].r; - ptr[poffset + 1] = cmap[aByte].g; - ptr[poffset + 2] = cmap[aByte].b; - column++; - linepos++; - } - } - } - else - { - ptr[poffset ] = cmap[aByte].r; - ptr[poffset + 1] = cmap[aByte].g; - ptr[poffset + 2] = cmap[aByte].b; - column++; - // linepos += size; seems to be wrong, RR - } - } - } - else if ( bpp == 24 ) - { - stream.Read(bbuf, 3); - linepos += 3; - ptr[poffset ] = (unsigned char)bbuf[2]; - ptr[poffset + 1] = (unsigned char)bbuf[1]; - ptr[poffset + 2] = (unsigned char)bbuf[0]; - column++; - } - else if ( bpp == 16 ) - { - unsigned char temp; - stream.Read(&aWord, 2); - aWord = wxUINT16_SWAP_ON_BE(aWord); - linepos += 2; - /* use the masks and calculated amonut of shift - to retrieve the color data out of the word. Then - shift it left by (8 - number of bits) such that - the image has the proper dynamic range */ - temp = (unsigned char)((aWord & rmask) >> rshift << (8-rbits)); - ptr[poffset] = temp; - temp = (unsigned char)((aWord & gmask) >> gshift << (8-gbits)); - ptr[poffset + 1] = temp; - temp = (unsigned char)((aWord & bmask) >> bshift << (8-bbits)); - ptr[poffset + 2] = temp; - column++; - } - else - { - unsigned char temp; - stream.Read(&aDword, 4); - aDword = wxINT32_SWAP_ON_BE(aDword); - linepos += 4; - temp = (unsigned char)((aDword & rmask) >> rshift); - ptr[poffset] = temp; - temp = (unsigned char)((aDword & gmask) >> gshift); - ptr[poffset + 1] = temp; - temp = (unsigned char)((aDword & bmask) >> bshift); - ptr[poffset + 2] = temp; - if ( alpha ) - { - temp = (unsigned char)((aDword & amask) >> ashift); - alpha[line * width + column] = temp; - } - column++; - } - } - while ( (linepos < linesize) && (comp != 1) && (comp != 2) ) - { - stream.Read(&aByte, 1); - linepos += 1; - if ( !stream ) - break; - } - } - - delete[] cmap; - - image->SetMask(false); - - const wxStreamError err = stream.GetLastError(); - return err == wxSTREAM_NO_ERROR || err == wxSTREAM_EOF; -} - -bool wxBMPHandler::LoadDib(wxImage *image, wxInputStream& stream, - bool verbose, bool IsBmp) -{ - wxUint16 aWord; - wxInt32 dbuf[4]; - wxInt8 bbuf[4]; - - wxFileOffset offset = 0; // keep gcc quiet - if ( IsBmp ) - { - // read the header off the .BMP format file - - offset = stream.TellI(); - if (offset == wxInvalidOffset) - offset = 0; - - stream.Read(bbuf, 2); - stream.Read(dbuf, 16); - } - else - { - stream.Read(dbuf, 4); - } - #if 0 // unused - wxInt32 size = wxINT32_SWAP_ON_BE(dbuf[0]); - #endif - offset = offset + wxINT32_SWAP_ON_BE(dbuf[2]); - - stream.Read(dbuf, 4 * 2); - int width = wxINT32_SWAP_ON_BE((int)dbuf[0]); - int height = wxINT32_SWAP_ON_BE((int)dbuf[1]); - if ( !IsBmp)height = height / 2; // for icons divide by 2 - - if ( width > 32767 ) - { - if (verbose) - wxLogError( _("DIB Header: Image width > 32767 pixels for file.") ); - return false; - } - if ( height > 32767 ) - { - if (verbose) - wxLogError( _("DIB Header: Image height > 32767 pixels for file.") ); - return false; - } - - stream.Read(&aWord, 2); - /* - TODO - int planes = (int)wxUINT16_SWAP_ON_BE( aWord ); - */ - stream.Read(&aWord, 2); - int bpp = wxUINT16_SWAP_ON_BE((int)aWord); - if ( bpp != 1 && bpp != 4 && bpp != 8 && bpp != 16 && bpp != 24 && bpp != 32 ) - { - if (verbose) - wxLogError( _("DIB Header: Unknown bitdepth in file.") ); - return false; - } - - stream.Read(dbuf, 4 * 4); - int comp = wxINT32_SWAP_ON_BE((int)dbuf[0]); - if ( comp != BI_RGB && comp != BI_RLE4 && comp != BI_RLE8 && - comp != BI_BITFIELDS ) - { - if (verbose) - wxLogError( _("DIB Header: Unknown encoding in file.") ); - return false; - } - - stream.Read(dbuf, 4 * 2); - int ncolors = wxINT32_SWAP_ON_BE( (int)dbuf[0] ); - if (ncolors == 0) - ncolors = 1 << bpp; - /* some more sanity checks */ - if (((comp == BI_RLE4) && (bpp != 4)) || - ((comp == BI_RLE8) && (bpp != 8)) || - ((comp == BI_BITFIELDS) && (bpp != 16 && bpp != 32))) - { - if (verbose) - wxLogError( _("DIB Header: Encoding doesn't match bitdepth.") ); - return false; - } - - //read DIB; this is the BMP image or the XOR part of an icon image - if ( !DoLoadDib(image, width, height, bpp, ncolors, comp, offset, stream, - verbose, IsBmp, true) ) - { - if (verbose) - wxLogError( _("Error in reading image DIB.") ); - return false; - } - - if ( !IsBmp ) - { - //read Icon mask which is monochrome - //there is no palette, so we will create one - wxImage mask; - if ( !DoLoadDib(&mask, width, height, 1, 2, BI_RGB, offset, stream, - verbose, IsBmp, false) ) - { - if (verbose) - wxLogError( _("ICO: Error in reading mask DIB.") ); - return false; - } - image->SetMaskFromImage(mask, 255, 255, 255); - - } - - return true; -} - -bool wxBMPHandler::LoadFile(wxImage *image, wxInputStream& stream, - bool verbose, int WXUNUSED(index)) -{ - // Read a single DIB fom the file: - return LoadDib(image, stream, verbose, true/*isBmp*/); -} - -bool wxBMPHandler::DoCanRead(wxInputStream& stream) -{ - unsigned char hdr[2]; - - if ( !stream.Read(hdr, WXSIZEOF(hdr)) ) - return false; - - // do we have the BMP file signature? - return hdr[0] == 'B' && hdr[1] == 'M'; -} - -#endif // wxUSE_STREAMS - - -#if wxUSE_ICO_CUR -//----------------------------------------------------------------------------- -// wxICOHandler -//----------------------------------------------------------------------------- - -IMPLEMENT_DYNAMIC_CLASS(wxICOHandler, wxBMPHandler) - -#if wxUSE_STREAMS - -struct ICONDIRENTRY -{ - wxUint8 bWidth; // Width of the image - wxUint8 bHeight; // Height of the image (times 2) - wxUint8 bColorCount; // Number of colors in image (0 if >=8bpp) - wxUint8 bReserved; // Reserved - - // these two are different in icons and cursors: - // icon or cursor - wxUint16 wPlanes; // Color Planes or XHotSpot - wxUint16 wBitCount; // Bits per pixel or YHotSpot - - wxUint32 dwBytesInRes; // how many bytes in this resource? - wxUint32 dwImageOffset; // where in the file is this image -}; - -struct ICONDIR -{ - wxUint16 idReserved; // Reserved - wxUint16 idType; // resource type (1 for icons, 2 for cursors) - wxUint16 idCount; // how many images? -}; - - -bool wxICOHandler::SaveFile(wxImage *image, - wxOutputStream& stream, - bool verbose) - -{ - //sanity check; icon must be less than 127 pixels high and 255 wide - if ( image->GetHeight () > 127 ) - { - if ( verbose ) - wxLogError(_("ICO: Image too tall for an icon.")); - return false; - } - if ( image->GetWidth () > 255 ) - { - if ( verbose ) - wxLogError(_("ICO: Image too wide for an icon.")); - return false; - } - - const int images = 1; // only generate one image - - // VS: This is a hack of sort - since ICO and CUR files are almost - // identical, we have all the meat in wxICOHandler and check for - // the actual (handler) type when the code has to distinguish between - // the two formats - int type = (this->GetType() == wxBITMAP_TYPE_CUR) ? 2 : 1; - - // write a header, (ICONDIR) - // Calculate the header size - wxUint32 offset = 3 * sizeof(wxUint16); - - ICONDIR IconDir; - IconDir.idReserved = 0; - IconDir.idType = wxUINT16_SWAP_ON_BE((wxUint16)type); - IconDir.idCount = wxUINT16_SWAP_ON_BE((wxUint16)images); - stream.Write(&IconDir.idReserved, sizeof(IconDir.idReserved)); - stream.Write(&IconDir.idType, sizeof(IconDir.idType)); - stream.Write(&IconDir.idCount, sizeof(IconDir.idCount)); - if ( !stream.IsOk() ) - { - if ( verbose ) - wxLogError(_("ICO: Error writing the image file!")); - return false; - } - - // for each iamage write a description ICONDIRENTRY: - ICONDIRENTRY icondirentry; - for (int img = 0; img < images; img++) - { - wxImage mask; - - if ( image->HasMask() ) - { - // make another image with black/white: - mask = image->ConvertToMono (image->GetMaskRed(), image->GetMaskGreen(), image->GetMaskBlue() ); - - // now we need to change the masked regions to black: - unsigned char r = image->GetMaskRed(); - unsigned char g = image->GetMaskGreen(); - unsigned char b = image->GetMaskBlue(); - if ( (r != 0) || (g != 0) || (b != 0) ) - { - // Go round and apply black to the masked bits: - int i, j; - for (i = 0; i < mask.GetWidth(); i++) - { - for (j = 0; j < mask.GetHeight(); j++) - { - if ((r == mask.GetRed(i, j)) && - (g == mask.GetGreen(i, j))&& - (b == mask.GetBlue(i, j)) ) - image->SetRGB(i, j, 0, 0, 0 ); - } - } - } - } - else - { - // just make a black mask all over: - mask = image->Copy(); - int i, j; - for (i = 0; i < mask.GetWidth(); i++) - for (j = 0; j < mask.GetHeight(); j++) - mask.SetRGB(i, j, 0, 0, 0 ); - } - // Set the formats for image and mask - // (Windows never saves with more than 8 colors): - image->SetOption(wxIMAGE_OPTION_BMP_FORMAT, wxBMP_8BPP); - - // monochome bitmap: - mask.SetOption(wxIMAGE_OPTION_BMP_FORMAT, wxBMP_1BPP_BW); - bool IsBmp = false; - bool IsMask = false; - - //calculate size and offset of image and mask - wxCountingOutputStream cStream; - bool bResult = SaveDib(image, cStream, verbose, IsBmp, IsMask); - if ( !bResult ) - { - if ( verbose ) - wxLogError(_("ICO: Error writing the image file!")); - return false; - } - IsMask = true; - - bResult = SaveDib(&mask, cStream, verbose, IsBmp, IsMask); - if ( !bResult ) - { - if ( verbose ) - wxLogError(_("ICO: Error writing the image file!")); - return false; - } - wxUint32 Size = cStream.GetSize(); - - // wxCountingOutputStream::IsOk() always returns true for now and this - // "if" provokes VC++ warnings in optimized build -#if 0 - if ( !cStream.Ok() ) - { - if ( verbose ) - wxLogError(_("ICO: Error writing the image file!")); - return false; - } -#endif // 0 - - offset = offset + sizeof(ICONDIRENTRY); - - icondirentry.bWidth = (wxUint8)image->GetWidth(); - icondirentry.bHeight = (wxUint8)(2 * image->GetHeight()); - icondirentry.bColorCount = 0; - icondirentry.bReserved = 0; - icondirentry.wPlanes = wxUINT16_SWAP_ON_BE(1); - icondirentry.wBitCount = wxUINT16_SWAP_ON_BE(wxBMP_8BPP); - if ( type == 2 /*CUR*/) - { - int hx = image->HasOption(wxIMAGE_OPTION_CUR_HOTSPOT_X) ? - image->GetOptionInt(wxIMAGE_OPTION_CUR_HOTSPOT_X) : - image->GetWidth() / 2; - int hy = image->HasOption(wxIMAGE_OPTION_CUR_HOTSPOT_Y) ? - image->GetOptionInt(wxIMAGE_OPTION_CUR_HOTSPOT_Y) : - image->GetHeight() / 2; - - // actually write the values of the hot spot here: - icondirentry.wPlanes = wxUINT16_SWAP_ON_BE((wxUint16)hx); - icondirentry.wBitCount = wxUINT16_SWAP_ON_BE((wxUint16)hy); - } - icondirentry.dwBytesInRes = wxUINT32_SWAP_ON_BE(Size); - icondirentry.dwImageOffset = wxUINT32_SWAP_ON_BE(offset); - - // increase size to allow for the data written: - offset += Size; - - // write to stream: - stream.Write(&icondirentry.bWidth, sizeof(icondirentry.bWidth)); - stream.Write(&icondirentry.bHeight, sizeof(icondirentry.bHeight)); - stream.Write(&icondirentry.bColorCount, sizeof(icondirentry.bColorCount)); - stream.Write(&icondirentry.bReserved, sizeof(icondirentry.bReserved)); - stream.Write(&icondirentry.wPlanes, sizeof(icondirentry.wPlanes)); - stream.Write(&icondirentry.wBitCount, sizeof(icondirentry.wBitCount)); - stream.Write(&icondirentry.dwBytesInRes, sizeof(icondirentry.dwBytesInRes)); - stream.Write(&icondirentry.dwImageOffset, sizeof(icondirentry.dwImageOffset)); - if ( !stream.IsOk() ) - { - if ( verbose ) - wxLogError(_("ICO: Error writing the image file!")); - return false; - } - - // actually save it: - IsMask = false; - bResult = SaveDib(image, stream, verbose, IsBmp, IsMask); - if ( !bResult ) - { - if ( verbose ) - wxLogError(_("ICO: Error writing the image file!")); - return false; - } - IsMask = true; - - bResult = SaveDib(&mask, stream, verbose, IsBmp, IsMask); - if ( !bResult ) - { - if ( verbose ) - wxLogError(_("ICO: Error writing the image file!")); - return false; - } - - } // end of for loop - - return true; -} - -bool wxICOHandler::LoadFile(wxImage *image, wxInputStream& stream, - bool verbose, int index) -{ - stream.SeekI(0); - return DoLoadFile(image, stream, verbose, index); -} - -bool wxICOHandler::DoLoadFile(wxImage *image, wxInputStream& stream, - bool WXUNUSED(verbose), int index) -{ - bool bResult wxDUMMY_INITIALIZE(false); - bool IsBmp = false; - - ICONDIR IconDir; - - wxFileOffset iPos = stream.TellI(); - stream.Read(&IconDir, sizeof(IconDir)); - wxUint16 nIcons = wxUINT16_SWAP_ON_BE(IconDir.idCount); - // nType is 1 for Icons, 2 for Cursors: - wxUint16 nType = wxUINT16_SWAP_ON_BE(IconDir.idType); - - // loop round the icons and choose the best one: - ICONDIRENTRY *pIconDirEntry = new ICONDIRENTRY[nIcons]; - ICONDIRENTRY *pCurrentEntry = pIconDirEntry; - int wMax = 0; - int colmax = 0; - int iSel = wxNOT_FOUND; - - for (int i = 0; i < nIcons; i++ ) - { - stream.Read(pCurrentEntry, sizeof(ICONDIRENTRY)); - // bHeight and bColorCount are wxUint8 - if ( pCurrentEntry->bWidth >= wMax ) - { - // see if we have more colors, ==0 indicates > 8bpp: - if ( pCurrentEntry->bColorCount == 0 ) - pCurrentEntry->bColorCount = 255; - if ( pCurrentEntry->bColorCount >= colmax ) - { - iSel = i; - wMax = pCurrentEntry->bWidth; - colmax = pCurrentEntry->bColorCount; - } - } - pCurrentEntry++; - } - - if ( index != -1 ) - { - // VS: Note that we *have* to run the loop above even if index != -1, because - // it reads ICONDIRENTRies. - iSel = index; - } - - if ( iSel == wxNOT_FOUND || iSel < 0 || iSel >= nIcons ) - { - wxLogError(_("ICO: Invalid icon index.")); - bResult = false; - } - else - { - // seek to selected icon: - pCurrentEntry = pIconDirEntry + iSel; - stream.SeekI(iPos + wxUINT32_SWAP_ON_BE(pCurrentEntry->dwImageOffset), wxFromStart); - bResult = LoadDib(image, stream, true, IsBmp); - bool bIsCursorType = (this->GetType() == wxBITMAP_TYPE_CUR) || (this->GetType() == wxBITMAP_TYPE_ANI); - if ( bResult && bIsCursorType && nType == 2 ) - { - // it is a cursor, so let's set the hotspot: - image->SetOption(wxIMAGE_OPTION_CUR_HOTSPOT_X, wxUINT16_SWAP_ON_BE(pCurrentEntry->wPlanes)); - image->SetOption(wxIMAGE_OPTION_CUR_HOTSPOT_Y, wxUINT16_SWAP_ON_BE(pCurrentEntry->wBitCount)); - } - } - delete[] pIconDirEntry; - return bResult; -} - -int wxICOHandler::GetImageCount(wxInputStream& stream) -{ - ICONDIR IconDir; - wxFileOffset iPos = stream.TellI(); - stream.SeekI(0); - stream.Read(&IconDir, sizeof(IconDir)); - wxUint16 nIcons = wxUINT16_SWAP_ON_BE(IconDir.idCount); - stream.SeekI(iPos); - return (int)nIcons; -} - -bool wxICOHandler::DoCanRead(wxInputStream& stream) -{ - stream.SeekI(0); - unsigned char hdr[4]; - if ( !stream.Read(hdr, WXSIZEOF(hdr)) ) - return false; - - // hdr[2] is one for an icon and two for a cursor - return hdr[0] == '\0' && hdr[1] == '\0' && hdr[2] == '\1' && hdr[3] == '\0'; -} - -#endif // wxUSE_STREAMS - - -//----------------------------------------------------------------------------- -// wxCURHandler -//----------------------------------------------------------------------------- - -IMPLEMENT_DYNAMIC_CLASS(wxCURHandler, wxICOHandler) - -#if wxUSE_STREAMS - -bool wxCURHandler::DoCanRead(wxInputStream& stream) -{ - stream.SeekI(0); - unsigned char hdr[4]; - if ( !stream.Read(hdr, WXSIZEOF(hdr)) ) - return false; - - // hdr[2] is one for an icon and two for a cursor - return hdr[0] == '\0' && hdr[1] == '\0' && hdr[2] == '\2' && hdr[3] == '\0'; -} - -#endif // wxUSE_STREAMS - -//----------------------------------------------------------------------------- -// wxANIHandler -//----------------------------------------------------------------------------- - -IMPLEMENT_DYNAMIC_CLASS(wxANIHandler, wxCURHandler) - -#if wxUSE_STREAMS - -bool wxANIHandler::LoadFile(wxImage *image, wxInputStream& stream, - bool WXUNUSED(verbose), int index) -{ - wxANIDecoder decoder; - if (!decoder.Load(stream)) - return false; - - return decoder.ConvertToImage(index != -1 ? (size_t)index : 0, image); -} - -bool wxANIHandler::DoCanRead(wxInputStream& stream) -{ - wxANIDecoder decod; - return decod.CanRead(stream); -} - -int wxANIHandler::GetImageCount(wxInputStream& stream) -{ - wxANIDecoder decoder; - if (!decoder.Load(stream)) - return wxNOT_FOUND; - - return decoder.GetFrameCount(); -} - -#endif // wxUSE_STREAMS - -#endif // wxUSE_ICO_CUR - -#endif // wxUSE_IMAGE diff --git a/wxWidgets/src/common/image.cpp b/wxWidgets/src/common/image.cpp deleted file mode 100644 index 7885d6486c..0000000000 --- a/wxWidgets/src/common/image.cpp +++ /dev/null @@ -1,3126 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/common/image.cpp -// Purpose: wxImage -// Author: Robert Roebling -// RCS-ID: $Id: image.cpp 59197 2009-02-28 15:44:53Z VZ $ -// Copyright: (c) Robert Roebling -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_IMAGE - -#include "wx/image.h" - -#ifndef WX_PRECOMP - #include "wx/log.h" - #include "wx/hash.h" - #include "wx/utils.h" - #include "wx/math.h" - #include "wx/module.h" - #include "wx/palette.h" - #include "wx/intl.h" -#endif - -#include "wx/filefn.h" -#include "wx/wfstream.h" -#include "wx/xpmdecod.h" - -// For memcpy -#include - -// make the code compile with either wxFile*Stream or wxFFile*Stream: -#define HAS_FILE_STREAMS (wxUSE_STREAMS && (wxUSE_FILE || wxUSE_FFILE)) - -#if HAS_FILE_STREAMS - #if wxUSE_FFILE - typedef wxFFileInputStream wxImageFileInputStream; - typedef wxFFileOutputStream wxImageFileOutputStream; - #elif wxUSE_FILE - typedef wxFileInputStream wxImageFileInputStream; - typedef wxFileOutputStream wxImageFileOutputStream; - #endif // wxUSE_FILE/wxUSE_FFILE -#endif // HAS_FILE_STREAMS - -#if wxUSE_VARIANT -IMPLEMENT_VARIANT_OBJECT_EXPORTED_SHALLOWCMP(wxImage,WXDLLEXPORT) -#endif - -//----------------------------------------------------------------------------- -// wxImage -//----------------------------------------------------------------------------- - -class wxImageRefData: public wxObjectRefData -{ -public: - wxImageRefData(); - virtual ~wxImageRefData(); - - int m_width; - int m_height; - unsigned char *m_data; - - bool m_hasMask; - unsigned char m_maskRed,m_maskGreen,m_maskBlue; - - // alpha channel data, may be NULL for the formats without alpha support - unsigned char *m_alpha; - - bool m_ok; - - // if true, m_data is pointer to static data and shouldn't be freed - bool m_static; - - // same as m_static but for m_alpha - bool m_staticAlpha; - -#if wxUSE_PALETTE - wxPalette m_palette; -#endif // wxUSE_PALETTE - - wxArrayString m_optionNames; - wxArrayString m_optionValues; - - DECLARE_NO_COPY_CLASS(wxImageRefData) -}; - -wxImageRefData::wxImageRefData() -{ - m_width = 0; - m_height = 0; - m_data = - m_alpha = (unsigned char *) NULL; - - m_maskRed = 0; - m_maskGreen = 0; - m_maskBlue = 0; - m_hasMask = false; - - m_ok = false; - m_static = - m_staticAlpha = false; -} - -wxImageRefData::~wxImageRefData() -{ - if ( !m_static ) - free( m_data ); - if ( !m_staticAlpha ) - free( m_alpha ); -} - -wxList wxImage::sm_handlers; - -wxImage wxNullImage; - -//----------------------------------------------------------------------------- - -#define M_IMGDATA wx_static_cast(wxImageRefData*, m_refData) - -IMPLEMENT_DYNAMIC_CLASS(wxImage, wxObject) - -wxImage::wxImage( int width, int height, bool clear ) -{ - Create( width, height, clear ); -} - -wxImage::wxImage( int width, int height, unsigned char* data, bool static_data ) -{ - Create( width, height, data, static_data ); -} - -wxImage::wxImage( int width, int height, unsigned char* data, unsigned char* alpha, bool static_data ) -{ - Create( width, height, data, alpha, static_data ); -} - -wxImage::wxImage( const wxString& name, long type, int index ) -{ - LoadFile( name, type, index ); -} - -wxImage::wxImage( const wxString& name, const wxString& mimetype, int index ) -{ - LoadFile( name, mimetype, index ); -} - -#if wxUSE_STREAMS -wxImage::wxImage( wxInputStream& stream, long type, int index ) -{ - LoadFile( stream, type, index ); -} - -wxImage::wxImage( wxInputStream& stream, const wxString& mimetype, int index ) -{ - LoadFile( stream, mimetype, index ); -} -#endif // wxUSE_STREAMS - -wxImage::wxImage(const char* const* xpmData) -{ - Create(xpmData); -} - -bool wxImage::Create(const char* const* xpmData) -{ -#if wxUSE_XPM - UnRef(); - - wxXPMDecoder decoder; - (*this) = decoder.ReadData(xpmData); - return Ok(); -#else - return false; -#endif -} - -bool wxImage::Create( int width, int height, bool clear ) -{ - UnRef(); - - m_refData = new wxImageRefData(); - - M_IMGDATA->m_data = (unsigned char *) malloc( width*height*3 ); - if (!M_IMGDATA->m_data) - { - UnRef(); - return false; - } - - if (clear) - memset(M_IMGDATA->m_data, 0, width*height*3); - - M_IMGDATA->m_width = width; - M_IMGDATA->m_height = height; - M_IMGDATA->m_ok = true; - - return true; -} - -bool wxImage::Create( int width, int height, unsigned char* data, bool static_data ) -{ - UnRef(); - - wxCHECK_MSG( data, false, _T("NULL data in wxImage::Create") ); - - m_refData = new wxImageRefData(); - - M_IMGDATA->m_data = data; - M_IMGDATA->m_width = width; - M_IMGDATA->m_height = height; - M_IMGDATA->m_ok = true; - M_IMGDATA->m_static = static_data; - - return true; -} - -bool wxImage::Create( int width, int height, unsigned char* data, unsigned char* alpha, bool static_data ) -{ - UnRef(); - - wxCHECK_MSG( data, false, _T("NULL data in wxImage::Create") ); - - m_refData = new wxImageRefData(); - - M_IMGDATA->m_data = data; - M_IMGDATA->m_alpha = alpha; - M_IMGDATA->m_width = width; - M_IMGDATA->m_height = height; - M_IMGDATA->m_ok = true; - M_IMGDATA->m_static = static_data; - M_IMGDATA->m_staticAlpha = static_data; - - return true; -} - -void wxImage::Destroy() -{ - UnRef(); -} - -wxObjectRefData* wxImage::CreateRefData() const -{ - return new wxImageRefData; -} - -wxObjectRefData* wxImage::CloneRefData(const wxObjectRefData* that) const -{ - const wxImageRefData* refData = wx_static_cast(const wxImageRefData*, that); - wxCHECK_MSG(refData->m_ok, NULL, wxT("invalid image") ); - - wxImageRefData* refData_new = new wxImageRefData; - refData_new->m_width = refData->m_width; - refData_new->m_height = refData->m_height; - refData_new->m_maskRed = refData->m_maskRed; - refData_new->m_maskGreen = refData->m_maskGreen; - refData_new->m_maskBlue = refData->m_maskBlue; - refData_new->m_hasMask = refData->m_hasMask; - refData_new->m_ok = true; - unsigned size = unsigned(refData->m_width) * unsigned(refData->m_height); - if (refData->m_alpha != NULL) - { - refData_new->m_alpha = (unsigned char*)malloc(size); - memcpy(refData_new->m_alpha, refData->m_alpha, size); - } - size *= 3; - refData_new->m_data = (unsigned char*)malloc(size); - memcpy(refData_new->m_data, refData->m_data, size); -#if wxUSE_PALETTE - refData_new->m_palette = refData->m_palette; -#endif - refData_new->m_optionNames = refData->m_optionNames; - refData_new->m_optionValues = refData->m_optionValues; - return refData_new; -} - -wxImage wxImage::Copy() const -{ - wxImage image; - - wxCHECK_MSG( Ok(), image, wxT("invalid image") ); - - image.m_refData = CloneRefData(m_refData); - - return image; -} - -wxImage wxImage::ShrinkBy( int xFactor , int yFactor ) const -{ - if( xFactor == 1 && yFactor == 1 ) - return *this; - - wxImage image; - - wxCHECK_MSG( Ok(), image, wxT("invalid image") ); - - // can't scale to/from 0 size - wxCHECK_MSG( (xFactor > 0) && (yFactor > 0), image, - wxT("invalid new image size") ); - - long old_height = M_IMGDATA->m_height, - old_width = M_IMGDATA->m_width; - - wxCHECK_MSG( (old_height > 0) && (old_width > 0), image, - wxT("invalid old image size") ); - - long width = old_width / xFactor ; - long height = old_height / yFactor ; - - image.Create( width, height, false ); - - char unsigned *data = image.GetData(); - - wxCHECK_MSG( data, image, wxT("unable to create image") ); - - bool hasMask = false ; - unsigned char maskRed = 0; - unsigned char maskGreen = 0; - unsigned char maskBlue =0 ; - - unsigned char *source_data = M_IMGDATA->m_data; - unsigned char *target_data = data; - unsigned char *source_alpha = 0 ; - unsigned char *target_alpha = 0 ; - if (M_IMGDATA->m_hasMask) - { - hasMask = true ; - maskRed = M_IMGDATA->m_maskRed; - maskGreen = M_IMGDATA->m_maskGreen; - maskBlue =M_IMGDATA->m_maskBlue ; - - image.SetMaskColour( M_IMGDATA->m_maskRed, - M_IMGDATA->m_maskGreen, - M_IMGDATA->m_maskBlue ); - } - else - { - source_alpha = M_IMGDATA->m_alpha ; - if ( source_alpha ) - { - image.SetAlpha() ; - target_alpha = image.GetAlpha() ; - } - } - - for (long y = 0; y < height; y++) - { - for (long x = 0; x < width; x++) - { - unsigned long avgRed = 0 ; - unsigned long avgGreen = 0; - unsigned long avgBlue = 0; - unsigned long avgAlpha = 0 ; - unsigned long counter = 0 ; - // determine average - for ( int y1 = 0 ; y1 < yFactor ; ++y1 ) - { - long y_offset = (y * yFactor + y1) * old_width; - for ( int x1 = 0 ; x1 < xFactor ; ++x1 ) - { - unsigned char *pixel = source_data + 3 * ( y_offset + x * xFactor + x1 ) ; - unsigned char red = pixel[0] ; - unsigned char green = pixel[1] ; - unsigned char blue = pixel[2] ; - unsigned char alpha = 255 ; - if ( source_alpha ) - alpha = *(source_alpha + y_offset + x * xFactor + x1) ; - if ( !hasMask || red != maskRed || green != maskGreen || blue != maskBlue ) - { - if ( alpha > 0 ) - { - avgRed += red ; - avgGreen += green ; - avgBlue += blue ; - } - avgAlpha += alpha ; - counter++ ; - } - } - } - if ( counter == 0 ) - { - *(target_data++) = M_IMGDATA->m_maskRed ; - *(target_data++) = M_IMGDATA->m_maskGreen ; - *(target_data++) = M_IMGDATA->m_maskBlue ; - } - else - { - if ( source_alpha ) - *(target_alpha++) = (unsigned char)(avgAlpha / counter ) ; - *(target_data++) = (unsigned char)(avgRed / counter); - *(target_data++) = (unsigned char)(avgGreen / counter); - *(target_data++) = (unsigned char)(avgBlue / counter); - } - } - } - - // In case this is a cursor, make sure the hotspot is scaled accordingly: - if ( HasOption(wxIMAGE_OPTION_CUR_HOTSPOT_X) ) - image.SetOption(wxIMAGE_OPTION_CUR_HOTSPOT_X, - (GetOptionInt(wxIMAGE_OPTION_CUR_HOTSPOT_X))/xFactor); - if ( HasOption(wxIMAGE_OPTION_CUR_HOTSPOT_Y) ) - image.SetOption(wxIMAGE_OPTION_CUR_HOTSPOT_Y, - (GetOptionInt(wxIMAGE_OPTION_CUR_HOTSPOT_Y))/yFactor); - - return image; -} - -wxImage wxImage::Scale( int width, int height, int quality ) const -{ - wxImage image; - - wxCHECK_MSG( Ok(), image, wxT("invalid image") ); - - // can't scale to/from 0 size - wxCHECK_MSG( (width > 0) && (height > 0), image, - wxT("invalid new image size") ); - - long old_height = M_IMGDATA->m_height, - old_width = M_IMGDATA->m_width; - wxCHECK_MSG( (old_height > 0) && (old_width > 0), image, - wxT("invalid old image size") ); - - // If the image's new width and height are the same as the original, no - // need to waste time or CPU cycles - if ( old_width == width && old_height == height ) - return *this; - - // Scale the image (...or more appropriately, resample the image) using - // either the high-quality or normal method as specified - if ( quality == wxIMAGE_QUALITY_HIGH ) - { - // We need to check whether we are downsampling or upsampling the image - if ( width < old_width && height < old_height ) - { - // Downsample the image using the box averaging method for best results - image = ResampleBox(width, height); - } - else - { - // For upsampling or other random/wierd image dimensions we'll use - // a bicubic b-spline scaling method - image = ResampleBicubic(width, height); - } - } - else // Default scaling method == simple pixel replication - { - if ( old_width % width == 0 && old_width >= width && - old_height % height == 0 && old_height >= height ) - { - return ShrinkBy( old_width / width , old_height / height ) ; - } - image.Create( width, height, false ); - - unsigned char *data = image.GetData(); - - wxCHECK_MSG( data, image, wxT("unable to create image") ); - - unsigned char *source_data = M_IMGDATA->m_data; - unsigned char *target_data = data; - unsigned char *source_alpha = 0 ; - unsigned char *target_alpha = 0 ; - - if ( !M_IMGDATA->m_hasMask ) - { - source_alpha = M_IMGDATA->m_alpha ; - if ( source_alpha ) - { - image.SetAlpha() ; - target_alpha = image.GetAlpha() ; - } - } - - long x_delta = (old_width<<16) / width; - long y_delta = (old_height<<16) / height; - - unsigned char* dest_pixel = target_data; - - long y = 0; - for ( long j = 0; j < height; j++ ) - { - unsigned char* src_line = &source_data[(y>>16)*old_width*3]; - unsigned char* src_alpha_line = source_alpha ? &source_alpha[(y>>16)*old_width] : 0 ; - - long x = 0; - for ( long i = 0; i < width; i++ ) - { - unsigned char* src_pixel = &src_line[(x>>16)*3]; - unsigned char* src_alpha_pixel = source_alpha ? &src_alpha_line[(x>>16)] : 0 ; - dest_pixel[0] = src_pixel[0]; - dest_pixel[1] = src_pixel[1]; - dest_pixel[2] = src_pixel[2]; - dest_pixel += 3; - if ( source_alpha ) - *(target_alpha++) = *src_alpha_pixel ; - x += x_delta; - } - - y += y_delta; - } - } - - // If the original image has a mask, apply the mask to the new image - if (M_IMGDATA->m_hasMask) - { - image.SetMaskColour( M_IMGDATA->m_maskRed, - M_IMGDATA->m_maskGreen, - M_IMGDATA->m_maskBlue ); - } - - // In case this is a cursor, make sure the hotspot is scaled accordingly: - if ( HasOption(wxIMAGE_OPTION_CUR_HOTSPOT_X) ) - image.SetOption(wxIMAGE_OPTION_CUR_HOTSPOT_X, - (GetOptionInt(wxIMAGE_OPTION_CUR_HOTSPOT_X)*width)/old_width); - if ( HasOption(wxIMAGE_OPTION_CUR_HOTSPOT_Y) ) - image.SetOption(wxIMAGE_OPTION_CUR_HOTSPOT_Y, - (GetOptionInt(wxIMAGE_OPTION_CUR_HOTSPOT_Y)*height)/old_height); - - return image; -} - -wxImage wxImage::ResampleBox(int width, int height) const -{ - // This function implements a simple pre-blur/box averaging method for - // downsampling that gives reasonably smooth results To scale the image - // down we will need to gather a grid of pixels of the size of the scale - // factor in each direction and then do an averaging of the pixels. - - wxImage ret_image(width, height, false); - - const double scale_factor_x = double(M_IMGDATA->m_width) / width; - const double scale_factor_y = double(M_IMGDATA->m_height) / height; - - const int scale_factor_x_2 = (int)(scale_factor_x / 2); - const int scale_factor_y_2 = (int)(scale_factor_y / 2); - - unsigned char* src_data = M_IMGDATA->m_data; - unsigned char* src_alpha = M_IMGDATA->m_alpha; - unsigned char* dst_data = ret_image.GetData(); - unsigned char* dst_alpha = NULL; - - if ( src_alpha ) - { - ret_image.SetAlpha(); - dst_alpha = ret_image.GetAlpha(); - } - - int averaged_pixels, src_pixel_index; - double sum_r, sum_g, sum_b, sum_a; - - for ( int y = 0; y < height; y++ ) // Destination image - Y direction - { - // Source pixel in the Y direction - int src_y = (int)(y * scale_factor_y); - - for ( int x = 0; x < width; x++ ) // Destination image - X direction - { - // Source pixel in the X direction - int src_x = (int)(x * scale_factor_x); - - // Box of pixels to average - averaged_pixels = 0; - sum_r = sum_g = sum_b = sum_a = 0.0; - - for ( int j = int(src_y - scale_factor_y/2.0 + 1); - j <= int(src_y + scale_factor_y_2); - j++ ) - { - // We don't care to average pixels that don't exist (edges) - if ( j < 0 || j > M_IMGDATA->m_height - 1 ) - continue; - - for ( int i = int(src_x - scale_factor_x/2.0 + 1); - i <= src_x + scale_factor_x_2; - i++ ) - { - // Don't average edge pixels - if ( i < 0 || i > M_IMGDATA->m_width - 1 ) - continue; - - // Calculate the actual index in our source pixels - src_pixel_index = j * M_IMGDATA->m_width + i; - - sum_r += src_data[src_pixel_index * 3 + 0]; - sum_g += src_data[src_pixel_index * 3 + 1]; - sum_b += src_data[src_pixel_index * 3 + 2]; - if ( src_alpha ) - sum_a += src_alpha[src_pixel_index]; - - averaged_pixels++; - } - } - - // Calculate the average from the sum and number of averaged pixels - dst_data[0] = (unsigned char)(sum_r / averaged_pixels); - dst_data[1] = (unsigned char)(sum_g / averaged_pixels); - dst_data[2] = (unsigned char)(sum_b / averaged_pixels); - dst_data += 3; - if ( src_alpha ) - *dst_alpha++ = (unsigned char)(sum_a / averaged_pixels); - } - } - - return ret_image; -} - -// The following two local functions are for the B-spline weighting of the -// bicubic sampling algorithm -static inline double spline_cube(double value) -{ - return value <= 0.0 ? 0.0 : value * value * value; -} - -static inline double spline_weight(double value) -{ - return (spline_cube(value + 2) - - 4 * spline_cube(value + 1) + - 6 * spline_cube(value) - - 4 * spline_cube(value - 1)) / 6; -} - -// This is the bicubic resampling algorithm -wxImage wxImage::ResampleBicubic(int width, int height) const -{ - // This function implements a Bicubic B-Spline algorithm for resampling. - // This method is certainly a little slower than wxImage's default pixel - // replication method, however for most reasonably sized images not being - // upsampled too much on a fairly average CPU this difference is hardly - // noticeable and the results are far more pleasing to look at. - // - // This particular bicubic algorithm does pixel weighting according to a - // B-Spline that basically implements a Gaussian bell-like weighting - // kernel. Because of this method the results may appear a bit blurry when - // upsampling by large factors. This is basically because a slight - // gaussian blur is being performed to get the smooth look of the upsampled - // image. - - // Edge pixels: 3-4 possible solutions - // - (Wrap/tile) Wrap the image, take the color value from the opposite - // side of the image. - // - (Mirror) Duplicate edge pixels, so that pixel at coordinate (2, n), - // where n is nonpositive, will have the value of (2, 1). - // - (Ignore) Simply ignore the edge pixels and apply the kernel only to - // pixels which do have all neighbours. - // - (Clamp) Choose the nearest pixel along the border. This takes the - // border pixels and extends them out to infinity. - // - // NOTE: below the y_offset and x_offset variables are being set for edge - // pixels using the "Mirror" method mentioned above - - wxImage ret_image; - - ret_image.Create(width, height, false); - - unsigned char* src_data = M_IMGDATA->m_data; - unsigned char* src_alpha = M_IMGDATA->m_alpha; - unsigned char* dst_data = ret_image.GetData(); - unsigned char* dst_alpha = NULL; - - if ( src_alpha ) - { - ret_image.SetAlpha(); - dst_alpha = ret_image.GetAlpha(); - } - - for ( int dsty = 0; dsty < height; dsty++ ) - { - // We need to calculate the source pixel to interpolate from - Y-axis - double srcpixy = double(dsty * M_IMGDATA->m_height) / height; - double dy = srcpixy - (int)srcpixy; - - for ( int dstx = 0; dstx < width; dstx++ ) - { - // X-axis of pixel to interpolate from - double srcpixx = double(dstx * M_IMGDATA->m_width) / width; - double dx = srcpixx - (int)srcpixx; - - // Sums for each color channel - double sum_r = 0, sum_g = 0, sum_b = 0, sum_a = 0; - - // Here we actually determine the RGBA values for the destination pixel - for ( int k = -1; k <= 2; k++ ) - { - // Y offset - int y_offset = srcpixy + k < 0.0 - ? 0 - : srcpixy + k >= M_IMGDATA->m_height - ? M_IMGDATA->m_height - 1 - : (int)(srcpixy + k); - - // Loop across the X axis - for ( int i = -1; i <= 2; i++ ) - { - // X offset - int x_offset = srcpixx + i < 0.0 - ? 0 - : srcpixx + i >= M_IMGDATA->m_width - ? M_IMGDATA->m_width - 1 - : (int)(srcpixx + i); - - // Calculate the exact position where the source data - // should be pulled from based on the x_offset and y_offset - int src_pixel_index = y_offset*M_IMGDATA->m_width + x_offset; - - // Calculate the weight for the specified pixel according - // to the bicubic b-spline kernel we're using for - // interpolation - double - pixel_weight = spline_weight(i - dx)*spline_weight(k - dy); - - // Create a sum of all velues for each color channel - // adjusted for the pixel's calculated weight - sum_r += src_data[src_pixel_index * 3 + 0] * pixel_weight; - sum_g += src_data[src_pixel_index * 3 + 1] * pixel_weight; - sum_b += src_data[src_pixel_index * 3 + 2] * pixel_weight; - if ( src_alpha ) - sum_a += src_alpha[src_pixel_index] * pixel_weight; - } - } - - // Put the data into the destination image. The summed values are - // of double data type and are rounded here for accuracy - dst_data[0] = (unsigned char)(sum_r + 0.5); - dst_data[1] = (unsigned char)(sum_g + 0.5); - dst_data[2] = (unsigned char)(sum_b + 0.5); - dst_data += 3; - - if ( src_alpha ) - *dst_alpha++ = (unsigned char)sum_a; - } - } - - return ret_image; -} - -// Blur in the horizontal direction -wxImage wxImage::BlurHorizontal(int blurRadius) -{ - wxImage ret_image; - ret_image.Create(M_IMGDATA->m_width, M_IMGDATA->m_height, false); - - unsigned char* src_data = M_IMGDATA->m_data; - unsigned char* dst_data = ret_image.GetData(); - unsigned char* src_alpha = M_IMGDATA->m_alpha; - unsigned char* dst_alpha = NULL; - - // Check for a mask or alpha - if ( M_IMGDATA->m_hasMask ) - { - ret_image.SetMaskColour(M_IMGDATA->m_maskRed, - M_IMGDATA->m_maskGreen, - M_IMGDATA->m_maskBlue); - } - else - { - if ( src_alpha ) - { - ret_image.SetAlpha(); - dst_alpha = ret_image.GetAlpha(); - } - } - - // number of pixels we average over - const int blurArea = blurRadius*2 + 1; - - // Horizontal blurring algorithm - average all pixels in the specified blur - // radius in the X or horizontal direction - for ( int y = 0; y < M_IMGDATA->m_height; y++ ) - { - // Variables used in the blurring algorithm - long sum_r = 0, - sum_g = 0, - sum_b = 0, - sum_a = 0; - - long pixel_idx; - const unsigned char *src; - unsigned char *dst; - - // Calculate the average of all pixels in the blur radius for the first - // pixel of the row - for ( int kernel_x = -blurRadius; kernel_x <= blurRadius; kernel_x++ ) - { - // To deal with the pixels at the start of a row so it's not - // grabbing GOK values from memory at negative indices of the - // image's data or grabbing from the previous row - if ( kernel_x < 0 ) - pixel_idx = y * M_IMGDATA->m_width; - else - pixel_idx = kernel_x + y * M_IMGDATA->m_width; - - src = src_data + pixel_idx*3; - sum_r += src[0]; - sum_g += src[1]; - sum_b += src[2]; - if ( src_alpha ) - sum_a += src_alpha[pixel_idx]; - } - - dst = dst_data + y * M_IMGDATA->m_width*3; - dst[0] = (unsigned char)(sum_r / blurArea); - dst[1] = (unsigned char)(sum_g / blurArea); - dst[2] = (unsigned char)(sum_b / blurArea); - if ( src_alpha ) - dst_alpha[y * M_IMGDATA->m_width] = (unsigned char)(sum_a / blurArea); - - // Now average the values of the rest of the pixels by just moving the - // blur radius box along the row - for ( int x = 1; x < M_IMGDATA->m_width; x++ ) - { - // Take care of edge pixels on the left edge by essentially - // duplicating the edge pixel - if ( x - blurRadius - 1 < 0 ) - pixel_idx = y * M_IMGDATA->m_width; - else - pixel_idx = (x - blurRadius - 1) + y * M_IMGDATA->m_width; - - // Subtract the value of the pixel at the left side of the blur - // radius box - src = src_data + pixel_idx*3; - sum_r -= src[0]; - sum_g -= src[1]; - sum_b -= src[2]; - if ( src_alpha ) - sum_a -= src_alpha[pixel_idx]; - - // Take care of edge pixels on the right edge - if ( x + blurRadius > M_IMGDATA->m_width - 1 ) - pixel_idx = M_IMGDATA->m_width - 1 + y * M_IMGDATA->m_width; - else - pixel_idx = x + blurRadius + y * M_IMGDATA->m_width; - - // Add the value of the pixel being added to the end of our box - src = src_data + pixel_idx*3; - sum_r += src[0]; - sum_g += src[1]; - sum_b += src[2]; - if ( src_alpha ) - sum_a += src_alpha[pixel_idx]; - - // Save off the averaged data - dst = dst_data + x*3 + y*M_IMGDATA->m_width*3; - dst[0] = (unsigned char)(sum_r / blurArea); - dst[1] = (unsigned char)(sum_g / blurArea); - dst[2] = (unsigned char)(sum_b / blurArea); - if ( src_alpha ) - dst_alpha[x + y * M_IMGDATA->m_width] = (unsigned char)(sum_a / blurArea); - } - } - - return ret_image; -} - -// Blur in the vertical direction -wxImage wxImage::BlurVertical(int blurRadius) -{ - wxImage ret_image; - ret_image.Create(M_IMGDATA->m_width, M_IMGDATA->m_height, false); - - unsigned char* src_data = M_IMGDATA->m_data; - unsigned char* dst_data = ret_image.GetData(); - unsigned char* src_alpha = M_IMGDATA->m_alpha; - unsigned char* dst_alpha = NULL; - - // Check for a mask or alpha - if ( M_IMGDATA->m_hasMask ) - { - ret_image.SetMaskColour(M_IMGDATA->m_maskRed, - M_IMGDATA->m_maskGreen, - M_IMGDATA->m_maskBlue); - } - else - { - if ( src_alpha ) - { - ret_image.SetAlpha(); - dst_alpha = ret_image.GetAlpha(); - } - } - - // number of pixels we average over - const int blurArea = blurRadius*2 + 1; - - // Vertical blurring algorithm - same as horizontal but switched the - // opposite direction - for ( int x = 0; x < M_IMGDATA->m_width; x++ ) - { - // Variables used in the blurring algorithm - long sum_r = 0, - sum_g = 0, - sum_b = 0, - sum_a = 0; - - long pixel_idx; - const unsigned char *src; - unsigned char *dst; - - // Calculate the average of all pixels in our blur radius box for the - // first pixel of the column - for ( int kernel_y = -blurRadius; kernel_y <= blurRadius; kernel_y++ ) - { - // To deal with the pixels at the start of a column so it's not - // grabbing GOK values from memory at negative indices of the - // image's data or grabbing from the previous column - if ( kernel_y < 0 ) - pixel_idx = x; - else - pixel_idx = x + kernel_y * M_IMGDATA->m_width; - - src = src_data + pixel_idx*3; - sum_r += src[0]; - sum_g += src[1]; - sum_b += src[2]; - if ( src_alpha ) - sum_a += src_alpha[pixel_idx]; - } - - dst = dst_data + x*3; - dst[0] = (unsigned char)(sum_r / blurArea); - dst[1] = (unsigned char)(sum_g / blurArea); - dst[2] = (unsigned char)(sum_b / blurArea); - if ( src_alpha ) - dst_alpha[x] = (unsigned char)(sum_a / blurArea); - - // Now average the values of the rest of the pixels by just moving the - // box along the column from top to bottom - for ( int y = 1; y < M_IMGDATA->m_height; y++ ) - { - // Take care of pixels that would be beyond the top edge by - // duplicating the top edge pixel for the column - if ( y - blurRadius - 1 < 0 ) - pixel_idx = x; - else - pixel_idx = x + (y - blurRadius - 1) * M_IMGDATA->m_width; - - // Subtract the value of the pixel at the top of our blur radius box - src = src_data + pixel_idx*3; - sum_r -= src[0]; - sum_g -= src[1]; - sum_b -= src[2]; - if ( src_alpha ) - sum_a -= src_alpha[pixel_idx]; - - // Take care of the pixels that would be beyond the bottom edge of - // the image similar to the top edge - if ( y + blurRadius > M_IMGDATA->m_height - 1 ) - pixel_idx = x + (M_IMGDATA->m_height - 1) * M_IMGDATA->m_width; - else - pixel_idx = x + (blurRadius + y) * M_IMGDATA->m_width; - - // Add the value of the pixel being added to the end of our box - src = src_data + pixel_idx*3; - sum_r += src[0]; - sum_g += src[1]; - sum_b += src[2]; - if ( src_alpha ) - sum_a += src_alpha[pixel_idx]; - - // Save off the averaged data - dst = dst_data + (x + y * M_IMGDATA->m_width) * 3; - dst[0] = (unsigned char)(sum_r / blurArea); - dst[1] = (unsigned char)(sum_g / blurArea); - dst[2] = (unsigned char)(sum_b / blurArea); - if ( src_alpha ) - dst_alpha[x + y * M_IMGDATA->m_width] = (unsigned char)(sum_a / blurArea); - } - } - - return ret_image; -} - -// The new blur function -wxImage wxImage::Blur(int blurRadius) -{ - wxImage ret_image; - ret_image.Create(M_IMGDATA->m_width, M_IMGDATA->m_height, false); - - // Blur the image in each direction - ret_image = BlurHorizontal(blurRadius); - ret_image = ret_image.BlurVertical(blurRadius); - - return ret_image; -} - -wxImage wxImage::Rotate90( bool clockwise ) const -{ - wxImage image; - - wxCHECK_MSG( Ok(), image, wxT("invalid image") ); - - image.Create( M_IMGDATA->m_height, M_IMGDATA->m_width, false ); - - unsigned char *data = image.GetData(); - - wxCHECK_MSG( data, image, wxT("unable to create image") ); - - unsigned char *source_data = M_IMGDATA->m_data; - unsigned char *target_data; - unsigned char *alpha_data = 0 ; - unsigned char *source_alpha = 0 ; - unsigned char *target_alpha = 0 ; - - if (M_IMGDATA->m_hasMask) - { - image.SetMaskColour( M_IMGDATA->m_maskRed, M_IMGDATA->m_maskGreen, M_IMGDATA->m_maskBlue ); - } - else - { - source_alpha = M_IMGDATA->m_alpha ; - if ( source_alpha ) - { - image.SetAlpha() ; - alpha_data = image.GetAlpha() ; - } - } - - long height = M_IMGDATA->m_height; - long width = M_IMGDATA->m_width; - - for (long j = 0; j < height; j++) - { - for (long i = 0; i < width; i++) - { - if (clockwise) - { - target_data = data + (((i+1)*height) - j - 1)*3; - if(source_alpha) - target_alpha = alpha_data + (((i+1)*height) - j - 1); - } - else - { - target_data = data + ((height*(width-1)) + j - (i*height))*3; - if(source_alpha) - target_alpha = alpha_data + ((height*(width-1)) + j - (i*height)); - } - memcpy( target_data, source_data, 3 ); - source_data += 3; - - if(source_alpha) - { - memcpy( target_alpha, source_alpha, 1 ); - source_alpha += 1; - } - } - } - - return image; -} - -wxImage wxImage::Mirror( bool horizontally ) const -{ - wxImage image; - - wxCHECK_MSG( Ok(), image, wxT("invalid image") ); - - image.Create( M_IMGDATA->m_width, M_IMGDATA->m_height, false ); - - unsigned char *data = image.GetData(); - unsigned char *alpha = NULL; - - wxCHECK_MSG( data, image, wxT("unable to create image") ); - - if (M_IMGDATA->m_alpha != NULL) { - image.SetAlpha(); - alpha = image.GetAlpha(); - wxCHECK_MSG( alpha, image, wxT("unable to create alpha channel") ); - } - - if (M_IMGDATA->m_hasMask) - image.SetMaskColour( M_IMGDATA->m_maskRed, M_IMGDATA->m_maskGreen, M_IMGDATA->m_maskBlue ); - - long height = M_IMGDATA->m_height; - long width = M_IMGDATA->m_width; - - unsigned char *source_data = M_IMGDATA->m_data; - unsigned char *target_data; - - if (horizontally) - { - for (long j = 0; j < height; j++) - { - data += width*3; - target_data = data-3; - for (long i = 0; i < width; i++) - { - memcpy( target_data, source_data, 3 ); - source_data += 3; - target_data -= 3; - } - } - - if (alpha != NULL) - { - // src_alpha starts at the first pixel and increases by 1 after each step - // (a step here is the copy of the alpha value of one pixel) - const unsigned char *src_alpha = M_IMGDATA->m_alpha; - // dest_alpha starts just beyond the first line, decreases before each step, - // and after each line is finished, increases by 2 widths (skipping the line - // just copied and the line that will be copied next) - unsigned char *dest_alpha = alpha + width; - - for (long jj = 0; jj < height; ++jj) - { - for (long i = 0; i < width; ++i) { - *(--dest_alpha) = *(src_alpha++); // copy one pixel - } - dest_alpha += 2 * width; // advance beyond the end of the next line - } - } - } - else - { - for (long i = 0; i < height; i++) - { - target_data = data + 3*width*(height-1-i); - memcpy( target_data, source_data, (size_t)3*width ); - source_data += 3*width; - } - - if (alpha != NULL) - { - // src_alpha starts at the first pixel and increases by 1 width after each step - // (a step here is the copy of the alpha channel of an entire line) - const unsigned char *src_alpha = M_IMGDATA->m_alpha; - // dest_alpha starts just beyond the last line (beyond the whole image) - // and decreases by 1 width before each step - unsigned char *dest_alpha = alpha + width * height; - - for (long jj = 0; jj < height; ++jj) - { - dest_alpha -= width; - memcpy( dest_alpha, src_alpha, (size_t)width ); - src_alpha += width; - } - } - } - - return image; -} - -wxImage wxImage::GetSubImage( const wxRect &rect ) const -{ - wxImage image; - - wxCHECK_MSG( Ok(), image, wxT("invalid image") ); - - wxCHECK_MSG( (rect.GetLeft()>=0) && (rect.GetTop()>=0) && - (rect.GetRight()<=GetWidth()) && (rect.GetBottom()<=GetHeight()), - image, wxT("invalid subimage size") ); - - const int subwidth = rect.GetWidth(); - const int subheight = rect.GetHeight(); - - image.Create( subwidth, subheight, false ); - - const unsigned char *src_data = GetData(); - const unsigned char *src_alpha = M_IMGDATA->m_alpha; - unsigned char *subdata = image.GetData(); - unsigned char *subalpha = NULL; - - wxCHECK_MSG( subdata, image, wxT("unable to create image") ); - - if (src_alpha != NULL) { - image.SetAlpha(); - subalpha = image.GetAlpha(); - wxCHECK_MSG( subalpha, image, wxT("unable to create alpha channel")); - } - - if (M_IMGDATA->m_hasMask) - image.SetMaskColour( M_IMGDATA->m_maskRed, M_IMGDATA->m_maskGreen, M_IMGDATA->m_maskBlue ); - - const int width = GetWidth(); - const int pixsoff = rect.GetLeft() + width * rect.GetTop(); - - src_data += 3 * pixsoff; - src_alpha += pixsoff; // won't be used if was NULL, so this is ok - - for (long j = 0; j < subheight; ++j) - { - memcpy( subdata, src_data, 3 * subwidth ); - subdata += 3 * subwidth; - src_data += 3 * width; - if (subalpha != NULL) { - memcpy( subalpha, src_alpha, subwidth ); - subalpha += subwidth; - src_alpha += width; - } - } - - return image; -} - -wxImage wxImage::Size( const wxSize& size, const wxPoint& pos, - int r_, int g_, int b_ ) const -{ - wxImage image; - - wxCHECK_MSG( Ok(), image, wxT("invalid image") ); - wxCHECK_MSG( (size.GetWidth() > 0) && (size.GetHeight() > 0), image, wxT("invalid size") ); - - int width = GetWidth(), height = GetHeight(); - image.Create(size.GetWidth(), size.GetHeight(), false); - - unsigned char r = (unsigned char)r_; - unsigned char g = (unsigned char)g_; - unsigned char b = (unsigned char)b_; - if ((r_ == -1) && (g_ == -1) && (b_ == -1)) - { - GetOrFindMaskColour( &r, &g, &b ); - image.SetMaskColour(r, g, b); - } - - image.SetRGB(wxRect(), r, g, b); - - wxRect subRect(pos.x, pos.y, width, height); - wxRect finalRect(0, 0, size.GetWidth(), size.GetHeight()); - if (pos.x < 0) - finalRect.width -= pos.x; - if (pos.y < 0) - finalRect.height -= pos.y; - - subRect.Intersect(finalRect); - - if (!subRect.IsEmpty()) - { - if ((subRect.GetWidth() == width) && (subRect.GetHeight() == height)) - image.Paste(*this, pos.x, pos.y); - else - image.Paste(GetSubImage(subRect), pos.x, pos.y); - } - - return image; -} - -void wxImage::Paste( const wxImage &image, int x, int y ) -{ - wxCHECK_RET( Ok(), wxT("invalid image") ); - wxCHECK_RET( image.Ok(), wxT("invalid image") ); - - AllocExclusive(); - - int xx = 0; - int yy = 0; - int width = image.GetWidth(); - int height = image.GetHeight(); - - if (x < 0) - { - xx = -x; - width += x; - } - if (y < 0) - { - yy = -y; - height += y; - } - - if ((x+xx)+width > M_IMGDATA->m_width) - width = M_IMGDATA->m_width - (x+xx); - if ((y+yy)+height > M_IMGDATA->m_height) - height = M_IMGDATA->m_height - (y+yy); - - if (width < 1) return; - if (height < 1) return; - - if ((!HasMask() && !image.HasMask()) || - (HasMask() && !image.HasMask()) || - ((HasMask() && image.HasMask() && - (GetMaskRed()==image.GetMaskRed()) && - (GetMaskGreen()==image.GetMaskGreen()) && - (GetMaskBlue()==image.GetMaskBlue())))) - { - unsigned char* source_data = image.GetData() + xx*3 + yy*3*image.GetWidth(); - int source_step = image.GetWidth()*3; - - unsigned char* target_data = GetData() + (x+xx)*3 + (y+yy)*3*M_IMGDATA->m_width; - int target_step = M_IMGDATA->m_width*3; - for (int j = 0; j < height; j++) - { - memcpy( target_data, source_data, width*3 ); - source_data += source_step; - target_data += target_step; - } - } - - // Copy over the alpha channel from the original image - if ( image.HasAlpha() ) - { - if ( !HasAlpha() ) - InitAlpha(); - - unsigned char* source_data = image.GetAlpha() + xx + yy*image.GetWidth(); - int source_step = image.GetWidth(); - - unsigned char* target_data = GetAlpha() + (x+xx) + (y+yy)*M_IMGDATA->m_width; - int target_step = M_IMGDATA->m_width; - - for (int j = 0; j < height; j++, - source_data += source_step, - target_data += target_step) - { - memcpy( target_data, source_data, width ); - } - } - - if (!HasMask() && image.HasMask()) - { - unsigned char r = image.GetMaskRed(); - unsigned char g = image.GetMaskGreen(); - unsigned char b = image.GetMaskBlue(); - - unsigned char* source_data = image.GetData() + xx*3 + yy*3*image.GetWidth(); - int source_step = image.GetWidth()*3; - - unsigned char* target_data = GetData() + (x+xx)*3 + (y+yy)*3*M_IMGDATA->m_width; - int target_step = M_IMGDATA->m_width*3; - - for (int j = 0; j < height; j++) - { - for (int i = 0; i < width*3; i+=3) - { - if ((source_data[i] != r) || - (source_data[i+1] != g) || - (source_data[i+2] != b)) - { - memcpy( target_data+i, source_data+i, 3 ); - } - } - source_data += source_step; - target_data += target_step; - } - } -} - -void wxImage::Replace( unsigned char r1, unsigned char g1, unsigned char b1, - unsigned char r2, unsigned char g2, unsigned char b2 ) -{ - wxCHECK_RET( Ok(), wxT("invalid image") ); - - AllocExclusive(); - - unsigned char *data = GetData(); - - const int w = GetWidth(); - const int h = GetHeight(); - - for (int j = 0; j < h; j++) - for (int i = 0; i < w; i++) - { - if ((data[0] == r1) && (data[1] == g1) && (data[2] == b1)) - { - data[0] = r2; - data[1] = g2; - data[2] = b2; - } - data += 3; - } -} - -wxImage wxImage::ConvertToGreyscale( double lr, double lg, double lb ) const -{ - wxImage image; - - wxCHECK_MSG( Ok(), image, wxT("invalid image") ); - - image.Create(M_IMGDATA->m_width, M_IMGDATA->m_height, false); - - unsigned char *dest = image.GetData(); - - wxCHECK_MSG( dest, image, wxT("unable to create image") ); - - unsigned char *src = M_IMGDATA->m_data; - bool hasMask = M_IMGDATA->m_hasMask; - unsigned char maskRed = M_IMGDATA->m_maskRed; - unsigned char maskGreen = M_IMGDATA->m_maskGreen; - unsigned char maskBlue = M_IMGDATA->m_maskBlue; - - if ( hasMask ) - image.SetMaskColour(maskRed, maskGreen, maskBlue); - - const long size = M_IMGDATA->m_width * M_IMGDATA->m_height; - for ( long i = 0; i < size; i++, src += 3, dest += 3 ) - { - // don't modify the mask - if ( hasMask && src[0] == maskRed && src[1] == maskGreen && src[2] == maskBlue ) - { - memcpy(dest, src, 3); - } - else - { - // calculate the luma - double luma = (src[0] * lr + src[1] * lg + src[2] * lb) + 0.5; - dest[0] = dest[1] = dest[2] = wx_static_cast(unsigned char, luma); - } - } - - // copy the alpha channel, if any - if (HasAlpha()) - { - const size_t alphaSize = GetWidth() * GetHeight(); - unsigned char *alpha = (unsigned char*)malloc(alphaSize); - memcpy(alpha, GetAlpha(), alphaSize); - image.InitAlpha(); - image.SetAlpha(alpha); - } - - return image; -} - -wxImage wxImage::ConvertToMono( unsigned char r, unsigned char g, unsigned char b ) const -{ - wxImage image; - - wxCHECK_MSG( Ok(), image, wxT("invalid image") ); - - image.Create( M_IMGDATA->m_width, M_IMGDATA->m_height, false ); - - unsigned char *data = image.GetData(); - - wxCHECK_MSG( data, image, wxT("unable to create image") ); - - if (M_IMGDATA->m_hasMask) - { - if (M_IMGDATA->m_maskRed == r && M_IMGDATA->m_maskGreen == g && - M_IMGDATA->m_maskBlue == b) - image.SetMaskColour( 255, 255, 255 ); - else - image.SetMaskColour( 0, 0, 0 ); - } - - long size = M_IMGDATA->m_height * M_IMGDATA->m_width; - - unsigned char *srcd = M_IMGDATA->m_data; - unsigned char *tard = image.GetData(); - - for ( long i = 0; i < size; i++, srcd += 3, tard += 3 ) - { - if (srcd[0] == r && srcd[1] == g && srcd[2] == b) - tard[0] = tard[1] = tard[2] = 255; - else - tard[0] = tard[1] = tard[2] = 0; - } - - return image; -} - -int wxImage::GetWidth() const -{ - wxCHECK_MSG( Ok(), 0, wxT("invalid image") ); - - return M_IMGDATA->m_width; -} - -int wxImage::GetHeight() const -{ - wxCHECK_MSG( Ok(), 0, wxT("invalid image") ); - - return M_IMGDATA->m_height; -} - -long wxImage::XYToIndex(int x, int y) const -{ - if ( Ok() && - x >= 0 && y >= 0 && - x < M_IMGDATA->m_width && y < M_IMGDATA->m_height ) - { - return y*M_IMGDATA->m_width + x; - } - - return -1; -} - -void wxImage::SetRGB( int x, int y, unsigned char r, unsigned char g, unsigned char b ) -{ - long pos = XYToIndex(x, y); - wxCHECK_RET( pos != -1, wxT("invalid image coordinates") ); - - AllocExclusive(); - - pos *= 3; - - M_IMGDATA->m_data[ pos ] = r; - M_IMGDATA->m_data[ pos+1 ] = g; - M_IMGDATA->m_data[ pos+2 ] = b; -} - -void wxImage::SetRGB( const wxRect& rect_, unsigned char r, unsigned char g, unsigned char b ) -{ - wxCHECK_RET( Ok(), wxT("invalid image") ); - - AllocExclusive(); - - wxRect rect(rect_); - wxRect imageRect(0, 0, GetWidth(), GetHeight()); - if ( rect == wxRect() ) - { - rect = imageRect; - } - else - { - wxCHECK_RET( imageRect.Contains(rect.GetTopLeft()) && - imageRect.Contains(rect.GetBottomRight()), - wxT("invalid bounding rectangle") ); - } - - int x1 = rect.GetLeft(), - y1 = rect.GetTop(), - x2 = rect.GetRight() + 1, - y2 = rect.GetBottom() + 1; - - unsigned char *data wxDUMMY_INITIALIZE(NULL); - int x, y, width = GetWidth(); - for (y = y1; y < y2; y++) - { - data = M_IMGDATA->m_data + (y*width + x1)*3; - for (x = x1; x < x2; x++) - { - *data++ = r; - *data++ = g; - *data++ = b; - } - } -} - -unsigned char wxImage::GetRed( int x, int y ) const -{ - long pos = XYToIndex(x, y); - wxCHECK_MSG( pos != -1, 0, wxT("invalid image coordinates") ); - - pos *= 3; - - return M_IMGDATA->m_data[pos]; -} - -unsigned char wxImage::GetGreen( int x, int y ) const -{ - long pos = XYToIndex(x, y); - wxCHECK_MSG( pos != -1, 0, wxT("invalid image coordinates") ); - - pos *= 3; - - return M_IMGDATA->m_data[pos+1]; -} - -unsigned char wxImage::GetBlue( int x, int y ) const -{ - long pos = XYToIndex(x, y); - wxCHECK_MSG( pos != -1, 0, wxT("invalid image coordinates") ); - - pos *= 3; - - return M_IMGDATA->m_data[pos+2]; -} - -bool wxImage::IsOk() const -{ - // image of 0 width or height can't be considered ok - at least because it - // causes crashes in ConvertToBitmap() if we don't catch it in time - wxImageRefData *data = M_IMGDATA; - return data && data->m_ok && data->m_width && data->m_height; -} - -unsigned char *wxImage::GetData() const -{ - wxCHECK_MSG( Ok(), (unsigned char *)NULL, wxT("invalid image") ); - - return M_IMGDATA->m_data; -} - -void wxImage::SetData( unsigned char *data, bool static_data ) -{ - wxCHECK_RET( Ok(), wxT("invalid image") ); - - wxImageRefData *newRefData = new wxImageRefData(); - - newRefData->m_width = M_IMGDATA->m_width; - newRefData->m_height = M_IMGDATA->m_height; - newRefData->m_data = data; - newRefData->m_ok = true; - newRefData->m_maskRed = M_IMGDATA->m_maskRed; - newRefData->m_maskGreen = M_IMGDATA->m_maskGreen; - newRefData->m_maskBlue = M_IMGDATA->m_maskBlue; - newRefData->m_hasMask = M_IMGDATA->m_hasMask; - newRefData->m_static = static_data; - - UnRef(); - - m_refData = newRefData; -} - -void wxImage::SetData( unsigned char *data, int new_width, int new_height, bool static_data ) -{ - wxImageRefData *newRefData = new wxImageRefData(); - - if (m_refData) - { - newRefData->m_width = new_width; - newRefData->m_height = new_height; - newRefData->m_data = data; - newRefData->m_ok = true; - newRefData->m_maskRed = M_IMGDATA->m_maskRed; - newRefData->m_maskGreen = M_IMGDATA->m_maskGreen; - newRefData->m_maskBlue = M_IMGDATA->m_maskBlue; - newRefData->m_hasMask = M_IMGDATA->m_hasMask; - } - else - { - newRefData->m_width = new_width; - newRefData->m_height = new_height; - newRefData->m_data = data; - newRefData->m_ok = true; - } - newRefData->m_static = static_data; - - UnRef(); - - m_refData = newRefData; -} - -// ---------------------------------------------------------------------------- -// alpha channel support -// ---------------------------------------------------------------------------- - -void wxImage::SetAlpha(int x, int y, unsigned char alpha) -{ - wxCHECK_RET( HasAlpha(), wxT("no alpha channel") ); - - long pos = XYToIndex(x, y); - wxCHECK_RET( pos != -1, wxT("invalid image coordinates") ); - - AllocExclusive(); - - M_IMGDATA->m_alpha[pos] = alpha; -} - -unsigned char wxImage::GetAlpha(int x, int y) const -{ - wxCHECK_MSG( HasAlpha(), 0, wxT("no alpha channel") ); - - long pos = XYToIndex(x, y); - wxCHECK_MSG( pos != -1, 0, wxT("invalid image coordinates") ); - - return M_IMGDATA->m_alpha[pos]; -} - -bool -wxImage::ConvertColourToAlpha(unsigned char r, unsigned char g, unsigned char b) -{ - SetAlpha(NULL); - - const int w = M_IMGDATA->m_width; - const int h = M_IMGDATA->m_height; - - unsigned char *alpha = GetAlpha(); - unsigned char *data = GetData(); - - for ( int y = 0; y < h; y++ ) - { - for ( int x = 0; x < w; x++ ) - { - *alpha++ = *data; - *data++ = r; - *data++ = g; - *data++ = b; - } - } - - return true; -} - -void wxImage::SetAlpha( unsigned char *alpha, bool static_data ) -{ - wxCHECK_RET( Ok(), wxT("invalid image") ); - - AllocExclusive(); - - if ( !alpha ) - { - alpha = (unsigned char *)malloc(M_IMGDATA->m_width*M_IMGDATA->m_height); - } - - if( !M_IMGDATA->m_staticAlpha ) - free(M_IMGDATA->m_alpha); - - M_IMGDATA->m_alpha = alpha; - M_IMGDATA->m_staticAlpha = static_data; -} - -unsigned char *wxImage::GetAlpha() const -{ - wxCHECK_MSG( Ok(), (unsigned char *)NULL, wxT("invalid image") ); - - return M_IMGDATA->m_alpha; -} - -void wxImage::InitAlpha() -{ - wxCHECK_RET( !HasAlpha(), wxT("image already has an alpha channel") ); - - // initialize memory for alpha channel - SetAlpha(); - - unsigned char *alpha = M_IMGDATA->m_alpha; - const size_t lenAlpha = M_IMGDATA->m_width * M_IMGDATA->m_height; - - if ( HasMask() ) - { - // use the mask to initialize the alpha channel. - const unsigned char * const alphaEnd = alpha + lenAlpha; - - const unsigned char mr = M_IMGDATA->m_maskRed; - const unsigned char mg = M_IMGDATA->m_maskGreen; - const unsigned char mb = M_IMGDATA->m_maskBlue; - for ( unsigned char *src = M_IMGDATA->m_data; - alpha < alphaEnd; - src += 3, alpha++ ) - { - *alpha = (src[0] == mr && src[1] == mg && src[2] == mb) - ? wxIMAGE_ALPHA_TRANSPARENT - : wxIMAGE_ALPHA_OPAQUE; - } - - M_IMGDATA->m_hasMask = false; - } - else // no mask - { - // make the image fully opaque - memset(alpha, wxIMAGE_ALPHA_OPAQUE, lenAlpha); - } -} - -// ---------------------------------------------------------------------------- -// mask support -// ---------------------------------------------------------------------------- - -void wxImage::SetMaskColour( unsigned char r, unsigned char g, unsigned char b ) -{ - wxCHECK_RET( Ok(), wxT("invalid image") ); - - AllocExclusive(); - - M_IMGDATA->m_maskRed = r; - M_IMGDATA->m_maskGreen = g; - M_IMGDATA->m_maskBlue = b; - M_IMGDATA->m_hasMask = true; -} - -bool wxImage::GetOrFindMaskColour( unsigned char *r, unsigned char *g, unsigned char *b ) const -{ - wxCHECK_MSG( Ok(), false, wxT("invalid image") ); - - if (M_IMGDATA->m_hasMask) - { - if (r) *r = M_IMGDATA->m_maskRed; - if (g) *g = M_IMGDATA->m_maskGreen; - if (b) *b = M_IMGDATA->m_maskBlue; - return true; - } - else - { - FindFirstUnusedColour(r, g, b); - return false; - } -} - -unsigned char wxImage::GetMaskRed() const -{ - wxCHECK_MSG( Ok(), 0, wxT("invalid image") ); - - return M_IMGDATA->m_maskRed; -} - -unsigned char wxImage::GetMaskGreen() const -{ - wxCHECK_MSG( Ok(), 0, wxT("invalid image") ); - - return M_IMGDATA->m_maskGreen; -} - -unsigned char wxImage::GetMaskBlue() const -{ - wxCHECK_MSG( Ok(), 0, wxT("invalid image") ); - - return M_IMGDATA->m_maskBlue; -} - -void wxImage::SetMask( bool mask ) -{ - wxCHECK_RET( Ok(), wxT("invalid image") ); - - AllocExclusive(); - - M_IMGDATA->m_hasMask = mask; -} - -bool wxImage::HasMask() const -{ - wxCHECK_MSG( Ok(), false, wxT("invalid image") ); - - return M_IMGDATA->m_hasMask; -} - -bool wxImage::IsTransparent(int x, int y, unsigned char threshold) const -{ - long pos = XYToIndex(x, y); - wxCHECK_MSG( pos != -1, false, wxT("invalid image coordinates") ); - - // check mask - if ( M_IMGDATA->m_hasMask ) - { - const unsigned char *p = M_IMGDATA->m_data + 3*pos; - if ( p[0] == M_IMGDATA->m_maskRed && - p[1] == M_IMGDATA->m_maskGreen && - p[2] == M_IMGDATA->m_maskBlue ) - { - return true; - } - } - - // then check alpha - if ( M_IMGDATA->m_alpha ) - { - if ( M_IMGDATA->m_alpha[pos] < threshold ) - { - // transparent enough - return true; - } - } - - // not transparent - return false; -} - -bool wxImage::SetMaskFromImage(const wxImage& mask, - unsigned char mr, unsigned char mg, unsigned char mb) -{ - // check that the images are the same size - if ( (M_IMGDATA->m_height != mask.GetHeight() ) || (M_IMGDATA->m_width != mask.GetWidth () ) ) - { - wxLogError( _("Image and mask have different sizes.") ); - return false; - } - - // find unused colour - unsigned char r,g,b ; - if (!FindFirstUnusedColour(&r, &g, &b)) - { - wxLogError( _("No unused colour in image being masked.") ); - return false ; - } - - AllocExclusive(); - - unsigned char *imgdata = GetData(); - unsigned char *maskdata = mask.GetData(); - - const int w = GetWidth(); - const int h = GetHeight(); - - for (int j = 0; j < h; j++) - { - for (int i = 0; i < w; i++) - { - if ((maskdata[0] == mr) && (maskdata[1] == mg) && (maskdata[2] == mb)) - { - imgdata[0] = r; - imgdata[1] = g; - imgdata[2] = b; - } - imgdata += 3; - maskdata += 3; - } - } - - SetMaskColour(r, g, b); - SetMask(true); - - return true; -} - -bool wxImage::ConvertAlphaToMask(unsigned char threshold) -{ - if (!HasAlpha()) - return true; - - unsigned char mr, mg, mb; - if (!FindFirstUnusedColour(&mr, &mg, &mb)) - { - wxLogError( _("No unused colour in image being masked.") ); - return false; - } - - AllocExclusive(); - - SetMask(true); - SetMaskColour(mr, mg, mb); - - unsigned char *imgdata = GetData(); - unsigned char *alphadata = GetAlpha(); - - int w = GetWidth(); - int h = GetHeight(); - - for (int y = 0; y < h; y++) - { - for (int x = 0; x < w; x++, imgdata += 3, alphadata++) - { - if (*alphadata < threshold) - { - imgdata[0] = mr; - imgdata[1] = mg; - imgdata[2] = mb; - } - } - } - - if( !M_IMGDATA->m_staticAlpha ) - free(M_IMGDATA->m_alpha); - - M_IMGDATA->m_alpha = NULL; - M_IMGDATA->m_staticAlpha = false; - - return true; -} - -// ---------------------------------------------------------------------------- -// Palette functions -// ---------------------------------------------------------------------------- - -#if wxUSE_PALETTE - -bool wxImage::HasPalette() const -{ - if (!Ok()) - return false; - - return M_IMGDATA->m_palette.Ok(); -} - -const wxPalette& wxImage::GetPalette() const -{ - wxCHECK_MSG( Ok(), wxNullPalette, wxT("invalid image") ); - - return M_IMGDATA->m_palette; -} - -void wxImage::SetPalette(const wxPalette& palette) -{ - wxCHECK_RET( Ok(), wxT("invalid image") ); - - AllocExclusive(); - - M_IMGDATA->m_palette = palette; -} - -#endif // wxUSE_PALETTE - -// ---------------------------------------------------------------------------- -// Option functions (arbitrary name/value mapping) -// ---------------------------------------------------------------------------- - -void wxImage::SetOption(const wxString& name, const wxString& value) -{ - wxCHECK_RET( Ok(), wxT("invalid image") ); - - AllocExclusive(); - - int idx = M_IMGDATA->m_optionNames.Index(name, false); - if (idx == wxNOT_FOUND) - { - M_IMGDATA->m_optionNames.Add(name); - M_IMGDATA->m_optionValues.Add(value); - } - else - { - M_IMGDATA->m_optionNames[idx] = name; - M_IMGDATA->m_optionValues[idx] = value; - } -} - -void wxImage::SetOption(const wxString& name, int value) -{ - wxString valStr; - valStr.Printf(wxT("%d"), value); - SetOption(name, valStr); -} - -wxString wxImage::GetOption(const wxString& name) const -{ - wxCHECK_MSG( Ok(), wxEmptyString, wxT("invalid image") ); - - int idx = M_IMGDATA->m_optionNames.Index(name, false); - if (idx == wxNOT_FOUND) - return wxEmptyString; - else - return M_IMGDATA->m_optionValues[idx]; -} - -int wxImage::GetOptionInt(const wxString& name) const -{ - return wxAtoi(GetOption(name)); -} - -bool wxImage::HasOption(const wxString& name) const -{ - wxCHECK_MSG( Ok(), false, wxT("invalid image") ); - - return (M_IMGDATA->m_optionNames.Index(name, false) != wxNOT_FOUND); -} - -// ---------------------------------------------------------------------------- -// image I/O -// ---------------------------------------------------------------------------- - -bool wxImage::LoadFile( const wxString& WXUNUSED_UNLESS_STREAMS(filename), - long WXUNUSED_UNLESS_STREAMS(type), - int WXUNUSED_UNLESS_STREAMS(index) ) -{ -#if HAS_FILE_STREAMS - if (wxFileExists(filename)) - { - wxImageFileInputStream stream(filename); - wxBufferedInputStream bstream( stream ); - return LoadFile(bstream, type, index); - } - else - { - wxLogError( _("Can't load image from file '%s': file does not exist."), filename.c_str() ); - - return false; - } -#else // !HAS_FILE_STREAMS - return false; -#endif // HAS_FILE_STREAMS -} - -bool wxImage::LoadFile( const wxString& WXUNUSED_UNLESS_STREAMS(filename), - const wxString& WXUNUSED_UNLESS_STREAMS(mimetype), - int WXUNUSED_UNLESS_STREAMS(index) ) -{ -#if HAS_FILE_STREAMS - if (wxFileExists(filename)) - { - wxImageFileInputStream stream(filename); - wxBufferedInputStream bstream( stream ); - return LoadFile(bstream, mimetype, index); - } - else - { - wxLogError( _("Can't load image from file '%s': file does not exist."), filename.c_str() ); - - return false; - } -#else // !HAS_FILE_STREAMS - return false; -#endif // HAS_FILE_STREAMS -} - - - -bool wxImage::SaveFile( const wxString& filename ) const -{ - wxString ext = filename.AfterLast('.').Lower(); - - wxImageHandler * pHandler = FindHandler(ext, -1); - if (pHandler) - { - return SaveFile(filename, pHandler->GetType()); - } - - wxLogError(_("Can't save image to file '%s': unknown extension."), filename.c_str()); - - return false; -} - -bool wxImage::SaveFile( const wxString& WXUNUSED_UNLESS_STREAMS(filename), - int WXUNUSED_UNLESS_STREAMS(type) ) const -{ -#if HAS_FILE_STREAMS - wxCHECK_MSG( Ok(), false, wxT("invalid image") ); - - ((wxImage*)this)->SetOption(wxIMAGE_OPTION_FILENAME, filename); - - wxImageFileOutputStream stream(filename); - - if ( stream.IsOk() ) - { - wxBufferedOutputStream bstream( stream ); - return SaveFile(bstream, type); - } -#endif // HAS_FILE_STREAMS - - return false; -} - -bool wxImage::SaveFile( const wxString& WXUNUSED_UNLESS_STREAMS(filename), - const wxString& WXUNUSED_UNLESS_STREAMS(mimetype) ) const -{ -#if HAS_FILE_STREAMS - wxCHECK_MSG( Ok(), false, wxT("invalid image") ); - - ((wxImage*)this)->SetOption(wxIMAGE_OPTION_FILENAME, filename); - - wxImageFileOutputStream stream(filename); - - if ( stream.IsOk() ) - { - wxBufferedOutputStream bstream( stream ); - return SaveFile(bstream, mimetype); - } -#endif // HAS_FILE_STREAMS - - return false; -} - -bool wxImage::CanRead( const wxString& WXUNUSED_UNLESS_STREAMS(name) ) -{ -#if HAS_FILE_STREAMS - wxImageFileInputStream stream(name); - return CanRead(stream); -#else - return false; -#endif -} - -int wxImage::GetImageCount( const wxString& WXUNUSED_UNLESS_STREAMS(name), - long WXUNUSED_UNLESS_STREAMS(type) ) -{ -#if HAS_FILE_STREAMS - wxImageFileInputStream stream(name); - if (stream.Ok()) - return GetImageCount(stream, type); -#endif - - return 0; -} - -#if wxUSE_STREAMS - -bool wxImage::CanRead( wxInputStream &stream ) -{ - const wxList& list = GetHandlers(); - - for ( wxList::compatibility_iterator node = list.GetFirst(); node; node = node->GetNext() ) - { - wxImageHandler *handler=(wxImageHandler*)node->GetData(); - if (handler->CanRead( stream )) - return true; - } - - return false; -} - -int wxImage::GetImageCount( wxInputStream &stream, long type ) -{ - wxImageHandler *handler; - - if ( type == wxBITMAP_TYPE_ANY ) - { - wxList &list=GetHandlers(); - - for (wxList::compatibility_iterator node = list.GetFirst(); node; node = node->GetNext()) - { - handler=(wxImageHandler*)node->GetData(); - if ( handler->CanRead(stream) ) - return handler->GetImageCount(stream); - - } - - wxLogWarning(_("No handler found for image type.")); - return 0; - } - - handler = FindHandler(type); - - if ( !handler ) - { - wxLogWarning(_("No image handler for type %ld defined."), type); - return false; - } - - if ( handler->CanRead(stream) ) - { - return handler->GetImageCount(stream); - } - else - { - wxLogError(_("Image file is not of type %ld."), type); - return 0; - } -} - -bool wxImage::LoadFile( wxInputStream& stream, long type, int index ) -{ - UnRef(); - - m_refData = new wxImageRefData; - - wxImageHandler *handler; - - if ( type == wxBITMAP_TYPE_ANY ) - { - wxList &list=GetHandlers(); - - for ( wxList::compatibility_iterator node = list.GetFirst(); node; node = node->GetNext() ) - { - handler=(wxImageHandler*)node->GetData(); - if ( handler->CanRead(stream) ) - return handler->LoadFile(this, stream, true/*verbose*/, index); - - } - - wxLogWarning( _("No handler found for image type.") ); - return false; - } - - handler = FindHandler(type); - - if (handler == 0) - { - wxLogWarning( _("No image handler for type %ld defined."), type ); - - return false; - } - - if (stream.IsSeekable() && !handler->CanRead(stream)) - { - wxLogError(_("Image file is not of type %ld."), type); - return false; - } - else - return handler->LoadFile(this, stream, true/*verbose*/, index); -} - -bool wxImage::LoadFile( wxInputStream& stream, const wxString& mimetype, int index ) -{ - UnRef(); - - m_refData = new wxImageRefData; - - wxImageHandler *handler = FindHandlerMime(mimetype); - - if (handler == 0) - { - wxLogWarning( _("No image handler for type %s defined."), mimetype.GetData() ); - - return false; - } - - if (stream.IsSeekable() && !handler->CanRead(stream)) - { - wxLogError(_("Image file is not of type %s."), (const wxChar*) mimetype); - return false; - } - else - return handler->LoadFile( this, stream, true/*verbose*/, index ); -} - -bool wxImage::SaveFile( wxOutputStream& stream, int type ) const -{ - wxCHECK_MSG( Ok(), false, wxT("invalid image") ); - - wxImageHandler *handler = FindHandler(type); - if ( !handler ) - { - wxLogWarning( _("No image handler for type %d defined."), type ); - - return false; - } - - return handler->SaveFile( (wxImage*)this, stream ); -} - -bool wxImage::SaveFile( wxOutputStream& stream, const wxString& mimetype ) const -{ - wxCHECK_MSG( Ok(), false, wxT("invalid image") ); - - wxImageHandler *handler = FindHandlerMime(mimetype); - if ( !handler ) - { - wxLogWarning( _("No image handler for type %s defined."), mimetype.GetData() ); - - return false; - } - - return handler->SaveFile( (wxImage*)this, stream ); -} -#endif // wxUSE_STREAMS - -// ---------------------------------------------------------------------------- -// image I/O handlers -// ---------------------------------------------------------------------------- - -void wxImage::AddHandler( wxImageHandler *handler ) -{ - // Check for an existing handler of the type being added. - if (FindHandler( handler->GetType() ) == 0) - { - sm_handlers.Append( handler ); - } - else - { - // This is not documented behaviour, merely the simplest 'fix' - // for preventing duplicate additions. If someone ever has - // a good reason to add and remove duplicate handlers (and they - // may) we should probably refcount the duplicates. - // also an issue in InsertHandler below. - - wxLogDebug( _T("Adding duplicate image handler for '%s'"), - handler->GetName().c_str() ); - delete handler; - } -} - -void wxImage::InsertHandler( wxImageHandler *handler ) -{ - // Check for an existing handler of the type being added. - if (FindHandler( handler->GetType() ) == 0) - { - sm_handlers.Insert( handler ); - } - else - { - // see AddHandler for additional comments. - wxLogDebug( _T("Inserting duplicate image handler for '%s'"), - handler->GetName().c_str() ); - delete handler; - } -} - -bool wxImage::RemoveHandler( const wxString& name ) -{ - wxImageHandler *handler = FindHandler(name); - if (handler) - { - sm_handlers.DeleteObject(handler); - delete handler; - return true; - } - else - return false; -} - -wxImageHandler *wxImage::FindHandler( const wxString& name ) -{ - wxList::compatibility_iterator node = sm_handlers.GetFirst(); - while (node) - { - wxImageHandler *handler = (wxImageHandler*)node->GetData(); - if (handler->GetName().Cmp(name) == 0) return handler; - - node = node->GetNext(); - } - return 0; -} - -wxImageHandler *wxImage::FindHandler( const wxString& extension, long bitmapType ) -{ - wxList::compatibility_iterator node = sm_handlers.GetFirst(); - while (node) - { - wxImageHandler *handler = (wxImageHandler*)node->GetData(); - if ( (handler->GetExtension().Cmp(extension) == 0) && - (bitmapType == -1 || handler->GetType() == bitmapType) ) - return handler; - node = node->GetNext(); - } - return 0; -} - -wxImageHandler *wxImage::FindHandler( long bitmapType ) -{ - wxList::compatibility_iterator node = sm_handlers.GetFirst(); - while (node) - { - wxImageHandler *handler = (wxImageHandler *)node->GetData(); - if (handler->GetType() == bitmapType) return handler; - node = node->GetNext(); - } - return 0; -} - -wxImageHandler *wxImage::FindHandlerMime( const wxString& mimetype ) -{ - wxList::compatibility_iterator node = sm_handlers.GetFirst(); - while (node) - { - wxImageHandler *handler = (wxImageHandler *)node->GetData(); - if (handler->GetMimeType().IsSameAs(mimetype, false)) return handler; - node = node->GetNext(); - } - return 0; -} - -void wxImage::InitStandardHandlers() -{ -#if wxUSE_STREAMS - AddHandler(new wxBMPHandler); -#endif // wxUSE_STREAMS -} - -void wxImage::CleanUpHandlers() -{ - wxList::compatibility_iterator node = sm_handlers.GetFirst(); - while (node) - { - wxImageHandler *handler = (wxImageHandler *)node->GetData(); - wxList::compatibility_iterator next = node->GetNext(); - delete handler; - node = next; - } - - sm_handlers.Clear(); -} - -wxString wxImage::GetImageExtWildcard() -{ - wxString fmts; - - wxList& Handlers = wxImage::GetHandlers(); - wxList::compatibility_iterator Node = Handlers.GetFirst(); - while ( Node ) - { - wxImageHandler* Handler = (wxImageHandler*)Node->GetData(); - fmts += wxT("*.") + Handler->GetExtension(); - Node = Node->GetNext(); - if ( Node ) fmts += wxT(";"); - } - - return wxT("(") + fmts + wxT(")|") + fmts; -} - -wxImage::HSVValue wxImage::RGBtoHSV(const RGBValue& rgb) -{ - const double red = rgb.red / 255.0, - green = rgb.green / 255.0, - blue = rgb.blue / 255.0; - - // find the min and max intensity (and remember which one was it for the - // latter) - double minimumRGB = red; - if ( green < minimumRGB ) - minimumRGB = green; - if ( blue < minimumRGB ) - minimumRGB = blue; - - enum { RED, GREEN, BLUE } chMax = RED; - double maximumRGB = red; - if ( green > maximumRGB ) - { - chMax = GREEN; - maximumRGB = green; - } - if ( blue > maximumRGB ) - { - chMax = BLUE; - maximumRGB = blue; - } - - const double value = maximumRGB; - - double hue = 0.0, saturation; - const double deltaRGB = maximumRGB - minimumRGB; - if ( wxIsNullDouble(deltaRGB) ) - { - // Gray has no color - hue = 0.0; - saturation = 0.0; - } - else - { - switch ( chMax ) - { - case RED: - hue = (green - blue) / deltaRGB; - break; - - case GREEN: - hue = 2.0 + (blue - red) / deltaRGB; - break; - - case BLUE: - hue = 4.0 + (red - green) / deltaRGB; - break; - - default: - wxFAIL_MSG(wxT("hue not specified")); - break; - } - - hue /= 6.0; - - if ( hue < 0.0 ) - hue += 1.0; - - saturation = deltaRGB / maximumRGB; - } - - return HSVValue(hue, saturation, value); -} - -wxImage::RGBValue wxImage::HSVtoRGB(const HSVValue& hsv) -{ - double red, green, blue; - - if ( wxIsNullDouble(hsv.saturation) ) - { - // Grey - red = hsv.value; - green = hsv.value; - blue = hsv.value; - } - else // not grey - { - double hue = hsv.hue * 6.0; // sector 0 to 5 - int i = (int)floor(hue); - double f = hue - i; // fractional part of h - double p = hsv.value * (1.0 - hsv.saturation); - - switch (i) - { - case 0: - red = hsv.value; - green = hsv.value * (1.0 - hsv.saturation * (1.0 - f)); - blue = p; - break; - - case 1: - red = hsv.value * (1.0 - hsv.saturation * f); - green = hsv.value; - blue = p; - break; - - case 2: - red = p; - green = hsv.value; - blue = hsv.value * (1.0 - hsv.saturation * (1.0 - f)); - break; - - case 3: - red = p; - green = hsv.value * (1.0 - hsv.saturation * f); - blue = hsv.value; - break; - - case 4: - red = hsv.value * (1.0 - hsv.saturation * (1.0 - f)); - green = p; - blue = hsv.value; - break; - - default: // case 5: - red = hsv.value; - green = p; - blue = hsv.value * (1.0 - hsv.saturation * f); - break; - } - } - - return RGBValue((unsigned char)(red * 255.0), - (unsigned char)(green * 255.0), - (unsigned char)(blue * 255.0)); -} - -/* - * Rotates the hue of each pixel of the image. angle is a double in the range - * -1.0..1.0 where -1.0 is -360 degrees and 1.0 is 360 degrees - */ -void wxImage::RotateHue(double angle) -{ - AllocExclusive(); - - unsigned char *srcBytePtr; - unsigned char *dstBytePtr; - unsigned long count; - wxImage::HSVValue hsv; - wxImage::RGBValue rgb; - - wxASSERT (angle >= -1.0 && angle <= 1.0); - count = M_IMGDATA->m_width * M_IMGDATA->m_height; - if ( count > 0 && !wxIsNullDouble(angle) ) - { - srcBytePtr = M_IMGDATA->m_data; - dstBytePtr = srcBytePtr; - do - { - rgb.red = *srcBytePtr++; - rgb.green = *srcBytePtr++; - rgb.blue = *srcBytePtr++; - hsv = RGBtoHSV(rgb); - - hsv.hue = hsv.hue + angle; - if (hsv.hue > 1.0) - hsv.hue = hsv.hue - 1.0; - else if (hsv.hue < 0.0) - hsv.hue = hsv.hue + 1.0; - - rgb = HSVtoRGB(hsv); - *dstBytePtr++ = rgb.red; - *dstBytePtr++ = rgb.green; - *dstBytePtr++ = rgb.blue; - } while (--count != 0); - } -} - -//----------------------------------------------------------------------------- -// wxImageHandler -//----------------------------------------------------------------------------- - -IMPLEMENT_ABSTRACT_CLASS(wxImageHandler,wxObject) - -#if wxUSE_STREAMS -bool wxImageHandler::LoadFile( wxImage *WXUNUSED(image), wxInputStream& WXUNUSED(stream), bool WXUNUSED(verbose), int WXUNUSED(index) ) -{ - return false; -} - -bool wxImageHandler::SaveFile( wxImage *WXUNUSED(image), wxOutputStream& WXUNUSED(stream), bool WXUNUSED(verbose) ) -{ - return false; -} - -int wxImageHandler::GetImageCount( wxInputStream& WXUNUSED(stream) ) -{ - return 1; -} - -bool wxImageHandler::CanRead( const wxString& name ) -{ - if (wxFileExists(name)) - { - wxImageFileInputStream stream(name); - return CanRead(stream); - } - - wxLogError( _("Can't check image format of file '%s': file does not exist."), name.c_str() ); - - return false; -} - -bool wxImageHandler::CallDoCanRead(wxInputStream& stream) -{ - wxFileOffset posOld = stream.TellI(); - if ( posOld == wxInvalidOffset ) - { - // can't test unseekable stream - return false; - } - - bool ok = DoCanRead(stream); - - // restore the old position to be able to test other formats and so on - if ( stream.SeekI(posOld) == wxInvalidOffset ) - { - wxLogDebug(_T("Failed to rewind the stream in wxImageHandler!")); - - // reading would fail anyhow as we're not at the right position - return false; - } - - return ok; -} - -#endif // wxUSE_STREAMS - -// ---------------------------------------------------------------------------- -// image histogram stuff -// ---------------------------------------------------------------------------- - -bool -wxImageHistogram::FindFirstUnusedColour(unsigned char *r, - unsigned char *g, - unsigned char *b, - unsigned char r2, - unsigned char b2, - unsigned char g2) const -{ - unsigned long key = MakeKey(r2, g2, b2); - - while ( find(key) != end() ) - { - // color already used - r2++; - if ( r2 >= 255 ) - { - r2 = 0; - g2++; - if ( g2 >= 255 ) - { - g2 = 0; - b2++; - if ( b2 >= 255 ) - { - wxLogError(_("No unused colour in image.") ); - return false; - } - } - } - - key = MakeKey(r2, g2, b2); - } - - if ( r ) - *r = r2; - if ( g ) - *g = g2; - if ( b ) - *b = b2; - - return true; -} - -bool -wxImage::FindFirstUnusedColour(unsigned char *r, - unsigned char *g, - unsigned char *b, - unsigned char r2, - unsigned char b2, - unsigned char g2) const -{ - wxImageHistogram histogram; - - ComputeHistogram(histogram); - - return histogram.FindFirstUnusedColour(r, g, b, r2, g2, b2); -} - - - -// GRG, Dic/99 -// Counts and returns the number of different colours. Optionally stops -// when it exceeds 'stopafter' different colours. This is useful, for -// example, to see if the image can be saved as 8-bit (256 colour or -// less, in this case it would be invoked as CountColours(256)). Default -// value for stopafter is -1 (don't care). -// -unsigned long wxImage::CountColours( unsigned long stopafter ) const -{ - wxHashTable h; - wxObject dummy; - unsigned char r, g, b; - unsigned char *p; - unsigned long size, nentries, key; - - p = GetData(); - size = GetWidth() * GetHeight(); - nentries = 0; - - for (unsigned long j = 0; (j < size) && (nentries <= stopafter) ; j++) - { - r = *(p++); - g = *(p++); - b = *(p++); - key = wxImageHistogram::MakeKey(r, g, b); - - if (h.Get(key) == NULL) - { - h.Put(key, &dummy); - nentries++; - } - } - - return nentries; -} - - -unsigned long wxImage::ComputeHistogram( wxImageHistogram &h ) const -{ - unsigned char *p = GetData(); - unsigned long nentries = 0; - - h.clear(); - - const unsigned long size = GetWidth() * GetHeight(); - - unsigned char r, g, b; - for ( unsigned long n = 0; n < size; n++ ) - { - r = *p++; - g = *p++; - b = *p++; - - wxImageHistogramEntry& entry = h[wxImageHistogram::MakeKey(r, g, b)]; - - if ( entry.value++ == 0 ) - entry.index = nentries++; - } - - return nentries; -} - -/* - * Rotation code by Carlos Moreno - */ - -static const double wxROTATE_EPSILON = 1e-10; - -// Auxiliary function to rotate a point (x,y) with respect to point p0 -// make it inline and use a straight return to facilitate optimization -// also, the function receives the sine and cosine of the angle to avoid -// repeating the time-consuming calls to these functions -- sin/cos can -// be computed and stored in the calling function. - -static inline wxRealPoint -wxRotatePoint(const wxRealPoint& p, double cos_angle, double sin_angle, - const wxRealPoint& p0) -{ - return wxRealPoint(p0.x + (p.x - p0.x) * cos_angle - (p.y - p0.y) * sin_angle, - p0.y + (p.y - p0.y) * cos_angle + (p.x - p0.x) * sin_angle); -} - -static inline wxRealPoint -wxRotatePoint(double x, double y, double cos_angle, double sin_angle, - const wxRealPoint & p0) -{ - return wxRotatePoint (wxRealPoint(x,y), cos_angle, sin_angle, p0); -} - -wxImage wxImage::Rotate(double angle, const wxPoint & centre_of_rotation, bool interpolating, wxPoint * offset_after_rotation) const -{ - int i; - angle = -angle; // screen coordinates are a mirror image of "real" coordinates - - bool has_alpha = HasAlpha(); - - const int w = GetWidth(), - h = GetHeight(); - - // Create pointer-based array to accelerate access to wxImage's data - unsigned char ** data = new unsigned char * [h]; - data[0] = GetData(); - for (i = 1; i < h; i++) - data[i] = data[i - 1] + (3 * w); - - // Same for alpha channel - unsigned char ** alpha = NULL; - if (has_alpha) - { - alpha = new unsigned char * [h]; - alpha[0] = GetAlpha(); - for (i = 1; i < h; i++) - alpha[i] = alpha[i - 1] + w; - } - - // precompute coefficients for rotation formula - // (sine and cosine of the angle) - const double cos_angle = cos(angle); - const double sin_angle = sin(angle); - - // Create new Image to store the result - // First, find rectangle that covers the rotated image; to do that, - // rotate the four corners - - const wxRealPoint p0(centre_of_rotation.x, centre_of_rotation.y); - - wxRealPoint p1 = wxRotatePoint (0, 0, cos_angle, sin_angle, p0); - wxRealPoint p2 = wxRotatePoint (0, h, cos_angle, sin_angle, p0); - wxRealPoint p3 = wxRotatePoint (w, 0, cos_angle, sin_angle, p0); - wxRealPoint p4 = wxRotatePoint (w, h, cos_angle, sin_angle, p0); - - int x1a = (int) floor (wxMin (wxMin(p1.x, p2.x), wxMin(p3.x, p4.x))); - int y1a = (int) floor (wxMin (wxMin(p1.y, p2.y), wxMin(p3.y, p4.y))); - int x2a = (int) ceil (wxMax (wxMax(p1.x, p2.x), wxMax(p3.x, p4.x))); - int y2a = (int) ceil (wxMax (wxMax(p1.y, p2.y), wxMax(p3.y, p4.y))); - - // Create rotated image - wxImage rotated (x2a - x1a + 1, y2a - y1a + 1, false); - // With alpha channel - if (has_alpha) - rotated.SetAlpha(); - - if (offset_after_rotation != NULL) - { - *offset_after_rotation = wxPoint (x1a, y1a); - } - - // GRG: The rotated (destination) image is always accessed - // sequentially, so there is no need for a pointer-based - // array here (and in fact it would be slower). - // - unsigned char * dst = rotated.GetData(); - - unsigned char * alpha_dst = NULL; - if (has_alpha) - alpha_dst = rotated.GetAlpha(); - - // GRG: if the original image has a mask, use its RGB values - // as the blank pixel, else, fall back to default (black). - // - unsigned char blank_r = 0; - unsigned char blank_g = 0; - unsigned char blank_b = 0; - - if (HasMask()) - { - blank_r = GetMaskRed(); - blank_g = GetMaskGreen(); - blank_b = GetMaskBlue(); - rotated.SetMaskColour( blank_r, blank_g, blank_b ); - } - - // Now, for each point of the rotated image, find where it came from, by - // performing an inverse rotation (a rotation of -angle) and getting the - // pixel at those coordinates - - const int rH = rotated.GetHeight(); - const int rW = rotated.GetWidth(); - - // GRG: I've taken the (interpolating) test out of the loops, so that - // it is done only once, instead of repeating it for each pixel. - - if (interpolating) - { - for (int y = 0; y < rH; y++) - { - for (int x = 0; x < rW; x++) - { - wxRealPoint src = wxRotatePoint (x + x1a, y + y1a, cos_angle, -sin_angle, p0); - - if (-0.25 < src.x && src.x < w - 0.75 && - -0.25 < src.y && src.y < h - 0.75) - { - // interpolate using the 4 enclosing grid-points. Those - // points can be obtained using floor and ceiling of the - // exact coordinates of the point - int x1, y1, x2, y2; - - if (0 < src.x && src.x < w - 1) - { - x1 = wxRound(floor(src.x)); - x2 = wxRound(ceil(src.x)); - } - else // else means that x is near one of the borders (0 or width-1) - { - x1 = x2 = wxRound (src.x); - } - - if (0 < src.y && src.y < h - 1) - { - y1 = wxRound(floor(src.y)); - y2 = wxRound(ceil(src.y)); - } - else - { - y1 = y2 = wxRound (src.y); - } - - // get four points and the distances (square of the distance, - // for efficiency reasons) for the interpolation formula - - // GRG: Do not calculate the points until they are - // really needed -- this way we can calculate - // just one, instead of four, if d1, d2, d3 - // or d4 are < wxROTATE_EPSILON - - const double d1 = (src.x - x1) * (src.x - x1) + (src.y - y1) * (src.y - y1); - const double d2 = (src.x - x2) * (src.x - x2) + (src.y - y1) * (src.y - y1); - const double d3 = (src.x - x2) * (src.x - x2) + (src.y - y2) * (src.y - y2); - const double d4 = (src.x - x1) * (src.x - x1) + (src.y - y2) * (src.y - y2); - - // Now interpolate as a weighted average of the four surrounding - // points, where the weights are the distances to each of those points - - // If the point is exactly at one point of the grid of the source - // image, then don't interpolate -- just assign the pixel - - // d1,d2,d3,d4 are positive -- no need for abs() - if (d1 < wxROTATE_EPSILON) - { - unsigned char *p = data[y1] + (3 * x1); - *(dst++) = *(p++); - *(dst++) = *(p++); - *(dst++) = *p; - - if (has_alpha) - *(alpha_dst++) = *(alpha[y1] + x1); - } - else if (d2 < wxROTATE_EPSILON) - { - unsigned char *p = data[y1] + (3 * x2); - *(dst++) = *(p++); - *(dst++) = *(p++); - *(dst++) = *p; - - if (has_alpha) - *(alpha_dst++) = *(alpha[y1] + x2); - } - else if (d3 < wxROTATE_EPSILON) - { - unsigned char *p = data[y2] + (3 * x2); - *(dst++) = *(p++); - *(dst++) = *(p++); - *(dst++) = *p; - - if (has_alpha) - *(alpha_dst++) = *(alpha[y2] + x2); - } - else if (d4 < wxROTATE_EPSILON) - { - unsigned char *p = data[y2] + (3 * x1); - *(dst++) = *(p++); - *(dst++) = *(p++); - *(dst++) = *p; - - if (has_alpha) - *(alpha_dst++) = *(alpha[y2] + x1); - } - else - { - // weights for the weighted average are proportional to the inverse of the distance - unsigned char *v1 = data[y1] + (3 * x1); - unsigned char *v2 = data[y1] + (3 * x2); - unsigned char *v3 = data[y2] + (3 * x2); - unsigned char *v4 = data[y2] + (3 * x1); - - const double w1 = 1/d1, w2 = 1/d2, w3 = 1/d3, w4 = 1/d4; - - // GRG: Unrolled. - - *(dst++) = (unsigned char) - ( (w1 * *(v1++) + w2 * *(v2++) + - w3 * *(v3++) + w4 * *(v4++)) / - (w1 + w2 + w3 + w4) ); - *(dst++) = (unsigned char) - ( (w1 * *(v1++) + w2 * *(v2++) + - w3 * *(v3++) + w4 * *(v4++)) / - (w1 + w2 + w3 + w4) ); - *(dst++) = (unsigned char) - ( (w1 * *v1 + w2 * *v2 + - w3 * *v3 + w4 * *v4) / - (w1 + w2 + w3 + w4) ); - - if (has_alpha) - { - v1 = alpha[y1] + (x1); - v2 = alpha[y1] + (x2); - v3 = alpha[y2] + (x2); - v4 = alpha[y2] + (x1); - - *(alpha_dst++) = (unsigned char) - ( (w1 * *v1 + w2 * *v2 + - w3 * *v3 + w4 * *v4) / - (w1 + w2 + w3 + w4) ); - } - } - } - else - { - *(dst++) = blank_r; - *(dst++) = blank_g; - *(dst++) = blank_b; - - if (has_alpha) - *(alpha_dst++) = 0; - } - } - } - } - else // not interpolating - { - for (int y = 0; y < rH; y++) - { - for (int x = 0; x < rW; x++) - { - wxRealPoint src = wxRotatePoint (x + x1a, y + y1a, cos_angle, -sin_angle, p0); - - const int xs = wxRound (src.x); // wxRound rounds to the - const int ys = wxRound (src.y); // closest integer - - if (0 <= xs && xs < w && 0 <= ys && ys < h) - { - unsigned char *p = data[ys] + (3 * xs); - *(dst++) = *(p++); - *(dst++) = *(p++); - *(dst++) = *p; - - if (has_alpha) - *(alpha_dst++) = *(alpha[ys] + (xs)); - } - else - { - *(dst++) = blank_r; - *(dst++) = blank_g; - *(dst++) = blank_b; - - if (has_alpha) - *(alpha_dst++) = 255; - } - } - } - } - - delete [] data; - - if (has_alpha) - delete [] alpha; - - return rotated; -} - - - - - -// A module to allow wxImage initialization/cleanup -// without calling these functions from app.cpp or from -// the user's application. - -class wxImageModule: public wxModule -{ -DECLARE_DYNAMIC_CLASS(wxImageModule) -public: - wxImageModule() {} - bool OnInit() { wxImage::InitStandardHandlers(); return true; } - void OnExit() { wxImage::CleanUpHandlers(); } -}; - -IMPLEMENT_DYNAMIC_CLASS(wxImageModule, wxModule) - - -#endif // wxUSE_IMAGE diff --git a/wxWidgets/src/common/imagfill.cpp b/wxWidgets/src/common/imagfill.cpp deleted file mode 100644 index a784b50581..0000000000 --- a/wxWidgets/src/common/imagfill.cpp +++ /dev/null @@ -1,325 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/common/imagfill.cpp -// Purpose: FloodFill for wxImage -// Author: Julian Smart -// RCS-ID: $Id: imagfill.cpp 63770 2010-03-28 22:34:12Z VZ $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_IMAGE && !defined(__WXMSW__) -// we have no use for this code in wxMSW... - -#ifndef WX_PRECOMP - #include "wx/brush.h" - #include "wx/dc.h" - #include "wx/dcmemory.h" - #include "wx/image.h" -#endif - -// DoFloodFill -// Fills with the colour extracted from fillBrush, starting at x,y until either -// a color different from the start pixel is reached (wxFLOOD_SURFACE) -// or fill color is reached (wxFLOOD_BORDER) - -static bool LINKAGEMODE MatchPixel(wxImage *img, int x, int y, int w, int h, const wxColour& c) -{ - if ((x<0)||(x>=w)||(y<0)||(y>=h)) return false; - - unsigned char r = img->GetRed(x,y); - unsigned char g = img->GetGreen(x,y); - unsigned char b = img->GetBlue(x,y); - return c.Red() == r && c.Green() == g && c.Blue() == b ; -} - -static bool LINKAGEMODE MatchBoundaryPixel(wxImage *img, int x, int y, int w, int h, const wxColour & fill, const wxColour& bound) -{ - if ((x<0)||(x>=w)||(y<0)||(y>=h)) return true; - - unsigned char r = img->GetRed(x,y); - unsigned char g = img->GetGreen(x,y); - unsigned char b = img->GetBlue(x,y); - if ( fill.Red() == r && fill.Green() == g && fill.Blue() == b ) - return true; - if ( bound.Red() == r && bound.Green() == g && bound.Blue() == b ) - return true; - return false; -} - - -static void LINKAGEMODE -wxImageFloodFill(wxImage *image, - wxCoord x, wxCoord y, const wxBrush & fillBrush, - const wxColour& testColour, int style, - int WXUNUSED(LogicalFunction)) -{ - /* A diamond flood-fill using a circular queue system. - Each pixel surrounding the current pixel is added to - the queue if it meets the criteria, then is retrieved in - its turn. Code originally based on http://www.drawit.co.nz/Developers.htm, - with explicit permission to use this for wxWidgets granted by Andrew Empson - (no copyright claimed) - */ - - int width = image->GetWidth(); - int height = image->GetHeight(); - - //Draw using a pen made from the current brush colour - //Potentially allows us to use patterned flood fills in future code - wxColour fillColour = fillBrush.GetColour(); - unsigned char r = fillColour.Red(); - unsigned char g = fillColour.Green(); - unsigned char b = fillColour.Blue(); - - //initial test : - if (style == wxFLOOD_SURFACE) - { - //if wxFLOOD_SURFACE, if fill colour is same as required, we don't do anything - if ( image->GetRed(x,y) != r - || image->GetGreen(x,y) != g - || image->GetBlue (x,y) != b ) - { - //prepare memory for queue - //queue save, start, read - size_t *qs, *qst, *qr; - - //queue size (physical) - long qSz= height * width * 2; - qst = new size_t [qSz]; - - //temporary x and y locations - int xt, yt; - - for (int i=0; i < qSz; i++) - qst[i] = 0; - - // start queue - qs=qr=qst; - *qs=xt=x; - qs++; - *qs=yt=y; - qs++; - - image->SetRGB(xt,yt,r,g,b); - - //Main queue loop - while(qr!=qs) - { - //Add new members to queue - //Above current pixel - if(MatchPixel(image,xt,yt-1,width,height,testColour)) - { - *qs=xt; - qs++; - *qs=yt-1; - qs++; - image->SetRGB(xt,yt-1,r,g,b); - - //Loop back to beginning of queue - if(qs>=(qst+qSz)) qs=qst; - } - - //Below current pixel - if(MatchPixel(image,xt,yt+1,width,height,testColour)) - { - *qs=xt; - qs++; - *qs=yt+1; - qs++; - image->SetRGB(xt,yt+1,r,g,b); - if(qs>=(qst+qSz)) qs=qst; - } - - //Left of current pixel - if(MatchPixel(image,xt-1,yt,width,height,testColour)) - { - *qs=xt-1; - qs++; - *qs=yt; - qs++; - image->SetRGB(xt-1,yt,r,g,b); - if(qs>=(qst+qSz)) qs=qst; - } - - //Right of current pixel - if(MatchPixel(image,xt+1,yt,width,height,testColour)) - { - *qs=xt+1; - qs++; - *qs=yt; - qs++; - image->SetRGB(xt+1,yt,r,g,b); - if(qs>=(qst+qSz)) qs=qst; - } - - //Retrieve current queue member - qr+=2; - - //Loop back to the beginning - if(qr>=(qst+qSz)) qr=qst; - xt=*qr; - yt=*(qr+1); - - //Go Back to beginning of loop - } - - delete[] qst; - } - } - else - { - //style is wxFLOOD_BORDER - // fill up to testColor border - if already testColour don't do anything - if ( image->GetRed(x,y) != testColour.Red() - || image->GetGreen(x,y) != testColour.Green() - || image->GetBlue(x,y) != testColour.Blue() ) - { - //prepare memory for queue - //queue save, start, read - size_t *qs, *qst, *qr; - - //queue size (physical) - long qSz= height * width * 2; - qst = new size_t [qSz]; - - //temporary x and y locations - int xt, yt; - - for (int i=0; i < qSz; i++) - qst[i] = 0; - - // start queue - qs=qr=qst; - *qs=xt=x; - qs++; - *qs=yt=y; - qs++; - - image->SetRGB(xt,yt,r,g,b); - - //Main queue loop - while (qr!=qs) - { - //Add new members to queue - //Above current pixel - if(!MatchBoundaryPixel(image,xt,yt-1,width,height,fillColour,testColour)) - { - *qs=xt; - qs++; - *qs=yt-1; - qs++; - image->SetRGB(xt,yt-1,r,g,b); - - //Loop back to beginning of queue - if(qs>=(qst+qSz)) qs=qst; - } - - //Below current pixel - if(!MatchBoundaryPixel(image,xt,yt+1,width,height,fillColour,testColour)) - { - *qs=xt; - qs++; - *qs=yt+1; - qs++; - image->SetRGB(xt,yt+1,r,g,b); - if(qs>=(qst+qSz)) qs=qst; - } - - //Left of current pixel - if(!MatchBoundaryPixel(image,xt-1,yt,width,height,fillColour,testColour)) - { - *qs=xt-1; - qs++; - *qs=yt; - qs++; - image->SetRGB(xt-1,yt,r,g,b); - if(qs>=(qst+qSz)) qs=qst; - } - - //Right of current pixel - if(!MatchBoundaryPixel(image,xt+1,yt,width,height,fillColour,testColour)) - { - *qs=xt+1; - qs++; - *qs=yt; - qs++; - image->SetRGB(xt+1,yt,r,g,b); - if(qs>=(qst+qSz)) qs=qst; - } - - //Retrieve current queue member - qr+=2; - - //Loop back to the beginning - if(qr>=(qst+qSz)) qr=qst; - xt=*qr; - yt=*(qr+1); - - //Go Back to beginning of loop - } - - delete[] qst; - } - } - //all done, -} - - -bool wxDoFloodFill(wxDC *dc, wxCoord x, wxCoord y, - const wxColour& col, int style) -{ - if (dc->GetBrush().GetStyle() == wxTRANSPARENT) - return true; - - int height = 0; - int width = 0; - dc->GetSize(&width, &height); - - //it would be nice to fail if we don't get a sensible size... - wxCHECK_MSG(width >= 1 && height >= 1, false, - wxT("In FloodFill, dc.GetSize routine failed, method not supported by this DC")); - - const int x_dev = dc->LogicalToDeviceX(x); - const int y_dev = dc->LogicalToDeviceY(y); - - // if start point is outside dc, can't do anything - if (!wxRect(0, 0, width, height).Contains(x_dev, y_dev)) - return false; - - wxBitmap bitmap(width, height); - wxMemoryDC memdc(bitmap); - // match dc scales - double sx, sy; - dc->GetUserScale(&sx, &sy); - memdc.SetUserScale(sx, sy); - dc->GetLogicalScale(&sx, &sy); - memdc.SetLogicalScale(sx, sy); - - // get logical size and origin - const int w_log = dc->DeviceToLogicalXRel(width); - const int h_log = dc->DeviceToLogicalYRel(height); - const int x0_log = dc->DeviceToLogicalX(0); - const int y0_log = dc->DeviceToLogicalY(0); - - memdc.Blit(0, 0, w_log, h_log, dc, x0_log, y0_log); - memdc.SelectObject(wxNullBitmap); - - wxImage image = bitmap.ConvertToImage(); - wxImageFloodFill(&image, x_dev, y_dev, dc->GetBrush(), col, style, - dc->GetLogicalFunction()); - bitmap = wxBitmap(image); - memdc.SelectObject(bitmap); - dc->Blit(x0_log, y0_log, w_log, h_log, &memdc, 0, 0); - - return true; -} - -#endif // wxUSE_IMAGE diff --git a/wxWidgets/src/common/imaggif.cpp b/wxWidgets/src/common/imaggif.cpp deleted file mode 100644 index bb49847cf1..0000000000 --- a/wxWidgets/src/common/imaggif.cpp +++ /dev/null @@ -1,105 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/common/imaggif.cpp -// Purpose: wxGIFHandler -// Author: Vaclav Slavik & Guillermo Rodriguez Garcia -// RCS-ID: $Id: imaggif.cpp 41819 2006-10-09 17:51:07Z VZ $ -// Copyright: (c) 1999 Vaclav Slavik & Guillermo Rodriguez Garcia -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_IMAGE && wxUSE_GIF - -#ifndef WX_PRECOMP - #include "wx/intl.h" - #include "wx/log.h" -#endif - -#include "wx/imaggif.h" -#include "wx/gifdecod.h" -#include "wx/wfstream.h" - -IMPLEMENT_DYNAMIC_CLASS(wxGIFHandler,wxImageHandler) - -//----------------------------------------------------------------------------- -// wxGIFHandler -//----------------------------------------------------------------------------- - -#if wxUSE_STREAMS - -bool wxGIFHandler::LoadFile(wxImage *image, wxInputStream& stream, - bool verbose, int index) -{ - wxGIFDecoder *decod; - wxGIFErrorCode error; - bool ok = true; - -// image->Destroy(); - decod = new wxGIFDecoder(); - error = decod->LoadGIF(stream); - - if ((error != wxGIF_OK) && (error != wxGIF_TRUNCATED)) - { - if (verbose) - { - switch (error) - { - case wxGIF_INVFORMAT: - wxLogError(_("GIF: error in GIF image format.")); - break; - case wxGIF_MEMERR: - wxLogError(_("GIF: not enough memory.")); - break; - default: - wxLogError(_("GIF: unknown error!!!")); - break; - } - } - delete decod; - return false; - } - - if ((error == wxGIF_TRUNCATED) && verbose) - { - wxLogError(_("GIF: data stream seems to be truncated.")); - /* go on; image data is OK */ - } - - if (ok) - { - ok = decod->ConvertToImage(index != -1 ? (size_t)index : 0, image); - } - else - { - wxLogError(_("GIF: Invalid gif index.")); - } - - delete decod; - - return ok; -} - -bool wxGIFHandler::SaveFile( wxImage * WXUNUSED(image), - wxOutputStream& WXUNUSED(stream), bool verbose ) -{ - if (verbose) - wxLogDebug(wxT("GIF: the handler is read-only!!")); - - return false; -} - -bool wxGIFHandler::DoCanRead( wxInputStream& stream ) -{ - wxGIFDecoder decod; - return decod.CanRead(stream); -} - -#endif // wxUSE_STREAMS - -#endif // wxUSE_GIF diff --git a/wxWidgets/src/common/imagiff.cpp b/wxWidgets/src/common/imagiff.cpp deleted file mode 100644 index 87ef214455..0000000000 --- a/wxWidgets/src/common/imagiff.cpp +++ /dev/null @@ -1,794 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/common/imagiff.h -// Purpose: wxImage handler for Amiga IFF images -// Author: Steffen Gutmann, Thomas Meyer -// RCS-ID: $Id: imagiff.cpp 38787 2006-04-18 07:24:35Z ABX $ -// Copyright: (c) Steffen Gutmann, 2002 -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// Parts of this source are based on the iff loading algorithm found -// in xviff.c. Permission by the original author, Thomas Meyer, and -// by the author of xv, John Bradley for using the iff loading part -// in wxWidgets has been gratefully given. - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_IMAGE && wxUSE_IFF - -#ifndef WX_PRECOMP - #include "wx/log.h" - #include "wx/intl.h" -#endif - -#include "wx/imagiff.h" -#include "wx/wfstream.h" - -#if wxUSE_PALETTE - #include "wx/palette.h" -#endif // wxUSE_PALETTE - -#include -#include - - -// -------------------------------------------------------------------------- -// Constants -// -------------------------------------------------------------------------- - -// Error codes: -// Note that the error code wxIFF_TRUNCATED means that the image itself -// is most probably OK, but the decoder didn't reach the end of the data -// stream; this means that if it was not reading directly from file, -// the stream will not be correctly positioned. -// - -enum -{ - wxIFF_OK = 0, /* everything was OK */ - wxIFF_INVFORMAT, /* error in iff header */ - wxIFF_MEMERR, /* error allocating memory */ - wxIFF_TRUNCATED /* file appears to be truncated */ -}; - -// -------------------------------------------------------------------------- -// wxIFFDecoder class -// -------------------------------------------------------------------------- - -// internal class for storing IFF image data -class IFFImage -{ -public: - unsigned int w; /* width */ - unsigned int h; /* height */ - int transparent; /* transparent color (-1 = none) */ - int colors; /* number of colors */ - unsigned char *p; /* bitmap */ - unsigned char *pal; /* palette */ - - IFFImage() : w(0), h(0), colors(0), p(0), pal(0) {} - ~IFFImage() { delete [] p; delete [] pal; } -}; - -class WXDLLEXPORT wxIFFDecoder -{ -private: - IFFImage *m_image; // image data - wxInputStream *m_f; // input stream - unsigned char *databuf; - unsigned char *picptr; - unsigned char *decomp_mem; - - void Destroy(); - -public: - // get data of current frame - unsigned char* GetData() const; - unsigned char* GetPalette() const; - int GetNumColors() const; - unsigned int GetWidth() const; - unsigned int GetHeight() const; - int GetTransparentColour() const; - - // constructor, destructor, etc. - wxIFFDecoder(wxInputStream *s); - ~wxIFFDecoder() { Destroy(); } - bool CanRead(); - int ReadIFF(); - bool ConvertToImage(wxImage *image) const; -}; - - -//--------------------------------------------------------------------------- -// wxIFFDecoder constructor and destructor -//--------------------------------------------------------------------------- - -wxIFFDecoder::wxIFFDecoder(wxInputStream *s) -{ - m_f = s; - m_image = 0; - databuf = 0; - decomp_mem = 0; -} - -void wxIFFDecoder::Destroy() -{ - delete m_image; - m_image = 0; - delete [] databuf; - databuf = 0; - delete [] decomp_mem; - decomp_mem = 0; -} - -//--------------------------------------------------------------------------- -// Convert this image to a wxImage object -//--------------------------------------------------------------------------- - -// This function was designed by Vaclav Slavik - -bool wxIFFDecoder::ConvertToImage(wxImage *image) const -{ - // just in case... - image->Destroy(); - - // create the image - image->Create(GetWidth(), GetHeight()); - - if (!image->Ok()) - return false; - - unsigned char *pal = GetPalette(); - unsigned char *src = GetData(); - unsigned char *dst = image->GetData(); - int colors = GetNumColors(); - int transparent = GetTransparentColour(); - long i; - - // set transparent colour mask - if (transparent != -1) - { - for (i = 0; i < colors; i++) - { - if ((pal[3 * i + 0] == 255) && - (pal[3 * i + 1] == 0) && - (pal[3 * i + 2] == 255)) - { - pal[3 * i + 2] = 254; - } - } - - pal[3 * transparent + 0] = 255, - pal[3 * transparent + 1] = 0, - pal[3 * transparent + 2] = 255; - - image->SetMaskColour(255, 0, 255); - } - else - image->SetMask(false); - -#if wxUSE_PALETTE - if (pal && colors > 0) - { - unsigned char* r = new unsigned char[colors]; - unsigned char* g = new unsigned char[colors]; - unsigned char* b = new unsigned char[colors]; - - for (i = 0; i < colors; i++) - { - r[i] = pal[3*i + 0]; - g[i] = pal[3*i + 1]; - b[i] = pal[3*i + 2]; - } - - image->SetPalette(wxPalette(colors, r, g, b)); - - delete [] r; - delete [] g; - delete [] b; - } -#endif // wxUSE_PALETTE - - // copy image data - for (i = 0; i < (long)(GetWidth() * GetHeight()); i++, src += 3, dst += 3) - { - dst[0] = src[0]; - dst[1] = src[1]; - dst[2] = src[2]; - } - - return true; -} - - -//--------------------------------------------------------------------------- -// Data accessors -//--------------------------------------------------------------------------- - -// Get data for current frame - -unsigned char* wxIFFDecoder::GetData() const { return (m_image->p); } -unsigned char* wxIFFDecoder::GetPalette() const { return (m_image->pal); } -int wxIFFDecoder::GetNumColors() const { return m_image->colors; } -unsigned int wxIFFDecoder::GetWidth() const { return (m_image->w); } -unsigned int wxIFFDecoder::GetHeight() const { return (m_image->h); } -int wxIFFDecoder::GetTransparentColour() const { return m_image->transparent; } - -//--------------------------------------------------------------------------- -// IFF reading and decoding -//--------------------------------------------------------------------------- - -// -// CanRead: -// Returns true if the file looks like a valid IFF, false otherwise. -// -bool wxIFFDecoder::CanRead() -{ - unsigned char buf[12]; - - if ( !m_f->Read(buf, WXSIZEOF(buf)) ) - return false; - - m_f->SeekI(-(wxFileOffset)WXSIZEOF(buf), wxFromCurrent); - - return (memcmp(buf, "FORM", 4) == 0) && (memcmp(buf+8, "ILBM", 4) == 0); -} - - -// ReadIFF: -// Based on xv source code by Thomas Meyer -// Permission for use in wxWidgets has been gratefully given. - -typedef unsigned char byte; -#define IFFDEBUG 0 - -/************************************************************************* - void decomprle(source, destination, source length, buffer size) - - Decompress run-length encoded data from source to destination. Terminates - when source is decoded completely or destination buffer is full. - - The decruncher is as optimized as I could make it, without risking - safety in case of corrupt BODY chunks. -**************************************************************************/ - -static void decomprle(const byte *sptr, byte *dptr, long slen, long dlen) -{ - byte codeByte, dataByte; - - while ((slen > 0) && (dlen > 0)) { - // read control byte - codeByte = *sptr++; - - if (codeByte < 0x80) { - codeByte++; - if ((slen > (long) codeByte) && (dlen >= (long) codeByte)) { - slen -= codeByte + 1; - dlen -= codeByte; - while (codeByte > 0) { - *dptr++ = *sptr++; - codeByte--; - } - } - else slen = 0; - } - - else if (codeByte > 0x80) { - codeByte = 0x81 - (codeByte & 0x7f); - if ((slen > (long) 0) && (dlen >= (long) codeByte)) { - dataByte = *sptr++; - slen -= 2; - dlen -= codeByte; - while (codeByte > 0) { - *dptr++ = dataByte; - codeByte--; - } - } - else slen = 0; - } - } -} - -/******************************************/ -static unsigned int iff_getword(const byte *ptr) -{ - unsigned int v; - - v = *ptr++; - v = (v << 8) + *ptr; - return v; -} - -/******************************************/ -static unsigned long iff_getlong(const byte *ptr) -{ - unsigned long l; - - l = *ptr++; - l = (l << 8) + *ptr++; - l = (l << 8) + *ptr++; - l = (l << 8) + *ptr; - return l; -} - -// Define internal ILBM types -#define ILBM_NORMAL 0 -#define ILBM_EHB 1 -#define ILBM_HAM 2 -#define ILBM_HAM8 3 -#define ILBM_24BIT 4 - -int wxIFFDecoder::ReadIFF() -{ - Destroy(); - - m_image = new IFFImage(); - if (m_image == 0) { - Destroy(); - return wxIFF_MEMERR; - } - - // compute file length - wxFileOffset currentPos = m_f->TellI(); - m_f->SeekI(0, wxFromEnd); - long filesize = m_f->TellI(); - m_f->SeekI(currentPos, wxFromStart); - - // allocate memory for complete file - if ((databuf = new byte[filesize]) == 0) { - Destroy(); - return wxIFF_MEMERR; - } - - m_f->Read(databuf, filesize); - const byte *dataend = databuf + filesize; - - // initialize work pointer. used to trace the buffer for IFF chunks - const byte *dataptr = databuf; - - // check for minmal size - if (dataptr + 12 > dataend) { - Destroy(); - return wxIFF_INVFORMAT; - } - - // check if we really got an IFF file - if (strncmp((char *)dataptr, "FORM", 4) != 0) { - Destroy(); - return wxIFF_INVFORMAT; - } - - dataptr = dataptr + 8; // skip ID and length of FORM - - // check if the IFF file is an ILBM (picture) file - if (strncmp((char *) dataptr, "ILBM", 4) != 0) { - Destroy(); - return wxIFF_INVFORMAT; - } - - wxLogTrace(_T("iff"), _T("IFF ILBM file recognized")); - - dataptr = dataptr + 4; // skip ID - - // - // main decoding loop. searches IFF chunks and handles them. - // terminates when BODY chunk was found or dataptr ran over end of file - // - bool BMHDok = false, CMAPok = false, CAMGok = false; - int bmhd_width = 0, bmhd_height = 0, bmhd_bitplanes = 0, bmhd_transcol = -1; - byte bmhd_masking = 0, bmhd_compression = 0; - long camg_viewmode = 0; - int colors = 0; - while (dataptr + 8 <= dataend) { - // get chunk length and make even - size_t chunkLen = (iff_getlong(dataptr + 4) + 1) & 0xfffffffe; -#ifdef __VMS - // Silence compiler warning - int chunkLen_; - chunkLen_ = chunkLen; - if (chunkLen_ < 0) { // format error? -#else - if (chunkLen < 0) { // format error? -#endif - break; - } - bool truncated = (dataptr + 8 + chunkLen > dataend); - - if (strncmp((char *)dataptr, "BMHD", 4) == 0) { // BMHD chunk? - if (chunkLen < 12 + 2 || truncated) { - break; - } - bmhd_width = iff_getword(dataptr + 8); // width of picture - bmhd_height= iff_getword(dataptr + 8 + 2); // height of picture - bmhd_bitplanes = *(dataptr + 8 + 8); // # of bitplanes - bmhd_masking = *(dataptr + 8 + 9); - bmhd_compression = *(dataptr + 8 + 10); // get compression - bmhd_transcol = iff_getword(dataptr + 8 + 12); - BMHDok = true; // got BMHD - dataptr += 8 + chunkLen; // to next chunk - } - else if (strncmp((char *)dataptr, "CMAP", 4) == 0) { // CMAP ? - if (truncated) { - break; - } - const byte *cmapptr = dataptr + 8; - colors = chunkLen / 3; // calc no of colors - - delete m_image->pal; - m_image->pal = 0; - m_image->colors = colors; - if (colors > 0) { - m_image->pal = new byte[3*colors]; - if (!m_image->pal) { - Destroy(); - return wxIFF_MEMERR; - } - - // copy colors to color map - for (int i=0; i < colors; i++) { - m_image->pal[3*i + 0] = *cmapptr++; - m_image->pal[3*i + 1] = *cmapptr++; - m_image->pal[3*i + 2] = *cmapptr++; - } - } - - wxLogTrace(_T("iff"), _T("Read %d colors from IFF file."), - colors); - - CMAPok = true; // got CMAP - dataptr += 8 + chunkLen; // to next chunk - } else if (strncmp((char *)dataptr, "CAMG", 4) == 0) { // CAMG ? - if (chunkLen < 4 || truncated) { - break; - } - camg_viewmode = iff_getlong(dataptr + 8); // get viewmodes - CAMGok = true; // got CAMG - dataptr += 8 + chunkLen; // to next chunk - } - else if (strncmp((char *)dataptr, "BODY", 4) == 0) { // BODY ? - if (!BMHDok) { // BMHD found? - break; - } - const byte *bodyptr = dataptr + 8; // -> BODY data - - if (truncated) { - chunkLen = dataend - dataptr; - } - - // - // if BODY is compressed, allocate buffer for decrunched BODY - // and decompress it (run length encoding) - // - if (bmhd_compression == 1) { - // calc size of decrunch buffer - (size of the actual pic. - // decompressed in interleaved Amiga bitplane format) - - size_t decomp_bufsize = (((bmhd_width + 15) >> 4) << 1) - * bmhd_height * bmhd_bitplanes; - - if ((decomp_mem = new byte[decomp_bufsize]) == 0) { - Destroy(); - return wxIFF_MEMERR; - } - - decomprle(bodyptr, decomp_mem, chunkLen, decomp_bufsize); - bodyptr = decomp_mem; // -> uncompressed BODY - chunkLen = decomp_bufsize; - delete [] databuf; - databuf = 0; - } - - // the following determines the type of the ILBM file. - // it's either NORMAL, EHB, HAM, HAM8 or 24BIT - - int fmt = ILBM_NORMAL; // assume normal ILBM - if (bmhd_bitplanes == 24) { - fmt = ILBM_24BIT; - } else if (bmhd_bitplanes == 8) { - if (CAMGok && (camg_viewmode & 0x800)) { - fmt = ILBM_HAM8; - } - } else if ((bmhd_bitplanes > 5) && CAMGok) { - if (camg_viewmode & 0x80) { - fmt = ILBM_EHB; - } else if (camg_viewmode & 0x800) { - fmt = ILBM_HAM; - } - } - - wxLogTrace(_T("iff"), - _T("LoadIFF: %s %dx%d, planes=%d (%d cols), comp=%d"), - (fmt==ILBM_NORMAL) ? "Normal ILBM" : - (fmt==ILBM_HAM) ? "HAM ILBM" : - (fmt==ILBM_HAM8) ? "HAM8 ILBM" : - (fmt==ILBM_EHB) ? "EHB ILBM" : - (fmt==ILBM_24BIT) ? "24BIT ILBM" : "unknown ILBM", - bmhd_width, bmhd_height, bmhd_bitplanes, - 1< m_image->colors) { - byte *pal = new byte[colors*3]; - if (!pal) { - Destroy(); - return wxIFF_MEMERR; - } - int i; - for (i = 0; i < m_image->colors; i++) { - pal[3*i + 0] = m_image->pal[3*i + 0]; - pal[3*i + 1] = m_image->pal[3*i + 1]; - pal[3*i + 2] = m_image->pal[3*i + 2]; - } - for (; i < colors; i++) { - pal[3*i + 0] = 0; - pal[3*i + 1] = 0; - pal[3*i + 2] = 0; - } - delete m_image->pal; - m_image->pal = pal; - m_image->colors = colors; - } - - for (int i=0; i < colors; i++) { - m_image->pal[3*i + 0] = (m_image->pal[3*i + 0] >> 4) * 17; - m_image->pal[3*i + 1] = (m_image->pal[3*i + 1] >> 4) * 17; - m_image->pal[3*i + 2] = (m_image->pal[3*i + 2] >> 4) * 17; - } - } - - m_image->p = new byte[bmhd_width * bmhd_height * 3]; - byte *picptr = m_image->p; - if (!picptr) { - Destroy(); - return wxIFF_MEMERR; - } - - byte *pal = m_image->pal; - int lineskip = ((bmhd_width + 15) >> 4) << 1; - int height = chunkLen / (lineskip * bmhd_bitplanes); - - if (bmhd_height < height) { - height = bmhd_height; - } - - if (fmt == ILBM_HAM || fmt == ILBM_HAM8 || fmt == ILBM_24BIT) { - byte *pic = picptr; - const byte *workptr = bodyptr; - - for (int i=0; i < height; i++) { - byte bitmsk = 0x80; - const byte *workptr2 = workptr; - - // at start of each line, init RGB values to background - byte rval = pal[0]; - byte gval = pal[1]; - byte bval = pal[2]; - - for (int j=0; j < bmhd_width; j++) { - long col = 0; - long colbit = 1; - const byte *workptr3 = workptr2; - for (int k=0; k < bmhd_bitplanes; k++) { - if (*workptr3 & bitmsk) { - col += colbit; - } - workptr3 += lineskip; - colbit <<= 1; - } - - if (fmt==ILBM_HAM) { - int c = (col & 0x0f); - switch (col & 0x30) { - case 0x00: if (c >= 0 && c < colors) { - rval = pal[3*c + 0]; - gval = pal[3*c + 1]; - bval = pal[3*c + 2]; - } - break; - - case 0x10: bval = c * 17; - break; - - case 0x20: rval = c * 17; - break; - - case 0x30: gval = c * 17; - break; - } - } else if (fmt == ILBM_HAM8) { - int c = (col & 0x3f); - switch(col & 0xc0) { - case 0x00: if (c >= 0 && c < colors) { - rval = pal[3*c + 0]; - gval = pal[3*c + 1]; - bval = pal[3*c + 2]; - } - break; - - case 0x40: bval = (bval & 3) | (c << 2); - break; - - case 0x80: rval = (rval & 3) | (c << 2); - break; - - case 0xc0: gval = (rval & 3) | (c << 2); - } - } else { - rval = col & 0xff; - gval = (col >> 8) & 0xff; - bval = (col >> 16) & 0xff; - } - - *pic++ = rval; - *pic++ = gval; - *pic++ = bval; - - bitmsk = bitmsk >> 1; - if (bitmsk == 0) { - bitmsk = 0x80; - workptr2++; - } - } - workptr += lineskip * bmhd_bitplanes; - } - } else if ((fmt == ILBM_NORMAL) || (fmt == ILBM_EHB)) { - if (fmt == ILBM_EHB) { - wxLogTrace(_T("iff"), _T("Doubling CMAP for EHB mode")); - - for (int i=0; i<32; i++) { - pal[3*(i + 32) + 0] = pal[3*i + 0] >> 1; - pal[3*(i + 32) + 1] = pal[3*i + 1] >> 1; - pal[3*(i + 32) + 2] = pal[3*i + 2] >> 1; - } - } - - byte *pic = picptr; // ptr to buffer - const byte *workptr = bodyptr; // ptr to pic, planar format - - if (bmhd_height < height) { - height = bmhd_height; - } - - for (int i=0; i < height; i++) { - byte bitmsk = 0x80; // left most bit (mask) - const byte *workptr2 = workptr; // work ptr to source - for (int j=0; j < bmhd_width; j++) { - long col = 0; - long colbit = 1; - const byte *workptr3 = workptr2; // 1st byte in 1st pln - - for (int k=0; k < bmhd_bitplanes; k++) { - if (*workptr3 & bitmsk) { // if bit set in this pln - col = col + colbit; // add bit to chunky byte - } - workptr3 += lineskip; // go to next line - colbit <<= 1; // shift color bit - } - - if (col >= 0 && col < colors) { - pic[0] = pal[3*col + 0]; - pic[1] = pal[3*col + 1]; - pic[2] = pal[3*col + 2]; - } else { - pic[0] = pic[1] = pic[2] = 0; - } - pic += 3; - bitmsk = bitmsk >> 1; // shift mask to next bit - if (bitmsk == 0) { // if mask is zero - bitmsk = 0x80; // reset mask - workptr2++; // mv ptr to next byte - } - } - - workptr += lineskip * bmhd_bitplanes; // to next line - } - } else { - break; // unknown format - } - - m_image->w = bmhd_width; - m_image->h = height; - m_image->transparent = bmhd_transcol; - - wxLogTrace(_T("iff"), _T("Loaded IFF picture %s"), - truncated? "truncated" : "completely"); - - return (truncated? wxIFF_TRUNCATED : wxIFF_OK); - } else { - wxLogTrace(_T("iff"), _T("Skipping unknown chunk '%c%c%c%c'"), - *dataptr, *(dataptr+1), *(dataptr+2), *(dataptr+3)); - - dataptr = dataptr + 8 + chunkLen; // skip unknown chunk - } - } - - Destroy(); - return wxIFF_INVFORMAT; -} - - - -//----------------------------------------------------------------------------- -// wxIFFHandler -//----------------------------------------------------------------------------- - -IMPLEMENT_DYNAMIC_CLASS(wxIFFHandler, wxImageHandler) - -#if wxUSE_STREAMS - -bool wxIFFHandler::LoadFile(wxImage *image, wxInputStream& stream, - bool verbose, int WXUNUSED(index)) -{ - wxIFFDecoder *decod; - int error; - bool ok; - - decod = new wxIFFDecoder(&stream); - error = decod->ReadIFF(); - - if ((error != wxIFF_OK) && (error != wxIFF_TRUNCATED)) - { - if (verbose) - { - switch (error) - { - case wxIFF_INVFORMAT: - wxLogError(_("IFF: error in IFF image format.")); - break; - case wxIFF_MEMERR: - wxLogError(_("IFF: not enough memory.")); - break; - default: - wxLogError(_("IFF: unknown error!!!")); - break; - } - } - delete decod; - return false; - } - - if ((error == wxIFF_TRUNCATED) && verbose) - { - wxLogError(_("IFF: data stream seems to be truncated.")); - /* go on; image data is OK */ - } - - ok = decod->ConvertToImage(image); - delete decod; - - return ok; -} - -bool wxIFFHandler::SaveFile(wxImage * WXUNUSED(image), - wxOutputStream& WXUNUSED(stream), bool verbose) -{ - if (verbose) - wxLogDebug(wxT("IFF: the handler is read-only!!")); - - return false; -} - -bool wxIFFHandler::DoCanRead(wxInputStream& stream) -{ - wxIFFDecoder decod(&stream); - - return decod.CanRead(); -} - -#endif // wxUSE_STREAMS - -#endif // wxUSE_IFF diff --git a/wxWidgets/src/common/imagjpeg.cpp b/wxWidgets/src/common/imagjpeg.cpp deleted file mode 100644 index 9fb2d4e699..0000000000 --- a/wxWidgets/src/common/imagjpeg.cpp +++ /dev/null @@ -1,480 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/common/imagjpeg.cpp -// Purpose: wxImage JPEG handler -// Author: Vaclav Slavik -// RCS-ID: $Id: imagjpeg.cpp 43781 2006-12-03 21:59:47Z MW $ -// Copyright: (c) Vaclav Slavik -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_IMAGE && wxUSE_LIBJPEG - -#include "wx/imagjpeg.h" - -#ifndef WX_PRECOMP - #include "wx/log.h" - #include "wx/app.h" - #include "wx/intl.h" - #include "wx/bitmap.h" - #include "wx/module.h" -#endif - -// A hack based on one from tif_jpeg.c to overcome the problem on Windows -// of rpcndr.h defining boolean with a different type to the jpeg headers. -// -// This hack is only necessary for an external jpeg library, the builtin one -// usually used on Windows doesn't use the type boolean, so always works. -// -#ifdef wxHACK_BOOLEAN - #define HAVE_BOOLEAN - #define boolean wxHACK_BOOLEAN -#endif - -extern "C" -{ - #if defined(__WXMSW__) - #define XMD_H - #endif - #include "jpeglib.h" -} - -#ifndef HAVE_WXJPEG_BOOLEAN -typedef boolean wxjpeg_boolean; -#endif - -#include "wx/filefn.h" -#include "wx/wfstream.h" - -// For memcpy -#include -// For JPEG library error handling -#include - -#ifdef __SALFORDC__ -#undef FAR -#endif - -// ---------------------------------------------------------------------------- -// types -// ---------------------------------------------------------------------------- - -// the standard definition of METHODDEF(type) from jmorecfg.h is "static type" -// which means that we can't declare the method functions as extern "C" - the -// compiler (rightfully) complains about the multiple storage classes in -// declaration -// -// so we only add extern "C" when using our own, modified, jmorecfg.h - and use -// whatever we have in the system headers if this is what we use hoping that it -// should be ok (can't do anything else) -#ifdef JPEG_METHOD_LINKAGE - #define CPP_METHODDEF(type) extern "C" METHODDEF(type) -#else // not using our jmorecfg.h header - #define CPP_METHODDEF(type) METHODDEF(type) -#endif - -//----------------------------------------------------------------------------- -// wxJPEGHandler -//----------------------------------------------------------------------------- - -IMPLEMENT_DYNAMIC_CLASS(wxJPEGHandler,wxImageHandler) - -#if wxUSE_STREAMS - -//------------- JPEG Data Source Manager - -#define JPEG_IO_BUFFER_SIZE 2048 - -typedef struct { - struct jpeg_source_mgr pub; /* public fields */ - - JOCTET* buffer; /* start of buffer */ - wxInputStream *stream; -} wx_source_mgr; - -typedef wx_source_mgr * wx_src_ptr; - -CPP_METHODDEF(void) wx_init_source ( j_decompress_ptr WXUNUSED(cinfo) ) -{ -} - -CPP_METHODDEF(wxjpeg_boolean) wx_fill_input_buffer ( j_decompress_ptr cinfo ) -{ - wx_src_ptr src = (wx_src_ptr) cinfo->src; - - src->pub.next_input_byte = src->buffer; - src->pub.bytes_in_buffer = src->stream->Read(src->buffer, JPEG_IO_BUFFER_SIZE).LastRead(); - - if (src->pub.bytes_in_buffer == 0) // check for end-of-stream - { - // Insert a fake EOI marker - src->buffer[0] = 0xFF; - src->buffer[1] = JPEG_EOI; - src->pub.bytes_in_buffer = 2; - } - return TRUE; -} - -CPP_METHODDEF(void) wx_skip_input_data ( j_decompress_ptr cinfo, long num_bytes ) -{ - if (num_bytes > 0) - { - wx_src_ptr src = (wx_src_ptr) cinfo->src; - - while (num_bytes > (long)src->pub.bytes_in_buffer) - { - num_bytes -= (long) src->pub.bytes_in_buffer; - src->pub.fill_input_buffer(cinfo); - } - src->pub.next_input_byte += (size_t) num_bytes; - src->pub.bytes_in_buffer -= (size_t) num_bytes; - } -} - -CPP_METHODDEF(void) wx_term_source ( j_decompress_ptr cinfo ) -{ - wx_src_ptr src = (wx_src_ptr) cinfo->src; - - if (src->pub.bytes_in_buffer > 0) - src->stream->SeekI(-(long)src->pub.bytes_in_buffer, wxFromCurrent); - delete[] src->buffer; -} - - -// JPEG error manager: - -struct wx_error_mgr { - struct jpeg_error_mgr pub; /* "public" fields */ - - jmp_buf setjmp_buffer; /* for return to caller */ -}; - -typedef struct wx_error_mgr * wx_error_ptr; - -/* - * Here's the routine that will replace the standard error_exit method: - */ - -CPP_METHODDEF(void) wx_error_exit (j_common_ptr cinfo) -{ - /* cinfo->err really points to a wx_error_mgr struct, so coerce pointer */ - wx_error_ptr myerr = (wx_error_ptr) cinfo->err; - - /* Always display the message. */ - /* We could postpone this until after returning, if we chose. */ - (*cinfo->err->output_message) (cinfo); - - /* Return control to the setjmp point */ - longjmp(myerr->setjmp_buffer, 1); -} - -/* - * This will replace the standard output_message method when the user - * wants us to be silent (verbose==false). We must have such method instead of - * simply using NULL for cinfo->err->output_message because it's called - * unconditionally from within libjpeg when there's "garbage input". - */ -CPP_METHODDEF(void) wx_ignore_message (j_common_ptr WXUNUSED(cinfo)) -{ -} - -void wx_jpeg_io_src( j_decompress_ptr cinfo, wxInputStream& infile ) -{ - wx_src_ptr src; - - if (cinfo->src == NULL) { /* first time for this JPEG object? */ - cinfo->src = (struct jpeg_source_mgr *) - (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT, - sizeof(wx_source_mgr)); - } - src = (wx_src_ptr) cinfo->src; - src->pub.bytes_in_buffer = 0; /* forces fill_input_buffer on first read */ - src->buffer = new JOCTET[JPEG_IO_BUFFER_SIZE]; - src->pub.next_input_byte = NULL; /* until buffer loaded */ - src->stream = &infile; - - src->pub.init_source = wx_init_source; - src->pub.fill_input_buffer = wx_fill_input_buffer; - src->pub.skip_input_data = wx_skip_input_data; - src->pub.resync_to_restart = jpeg_resync_to_restart; /* use default method */ - src->pub.term_source = wx_term_source; -} - -static inline void wx_cmyk_to_rgb(unsigned char* rgb, const unsigned char* cmyk) -{ - register int k = 255 - cmyk[3]; - register int k2 = cmyk[3]; - register int c; - - c = k + k2 * (255 - cmyk[0]) / 255; - rgb[0] = (unsigned char)((c > 255) ? 0 : (255 - c)); - - c = k + k2 * (255 - cmyk[1]) / 255; - rgb[1] = (unsigned char)((c > 255) ? 0 : (255 - c)); - - c = k + k2 * (255 - cmyk[2]) / 255; - rgb[2] = (unsigned char)((c > 255) ? 0 : (255 - c)); -} - -// temporarily disable the warning C4611 (interaction between '_setjmp' and -// C++ object destruction is non-portable) - I don't see any dtors here -#ifdef __VISUALC__ - #pragma warning(disable:4611) -#endif /* VC++ */ - -bool wxJPEGHandler::LoadFile( wxImage *image, wxInputStream& stream, bool verbose, int WXUNUSED(index) ) -{ - struct jpeg_decompress_struct cinfo; - struct wx_error_mgr jerr; - unsigned char *ptr; - - image->Destroy(); - cinfo.err = jpeg_std_error( &jerr.pub ); - jerr.pub.error_exit = wx_error_exit; - - if (!verbose) - cinfo.err->output_message = wx_ignore_message; - - /* Establish the setjmp return context for wx_error_exit to use. */ - if (setjmp(jerr.setjmp_buffer)) { - /* If we get here, the JPEG code has signaled an error. - * We need to clean up the JPEG object, close the input file, and return. - */ - if (verbose) - wxLogError(_("JPEG: Couldn't load - file is probably corrupted.")); - (cinfo.src->term_source)(&cinfo); - jpeg_destroy_decompress(&cinfo); - if (image->Ok()) image->Destroy(); - return false; - } - - jpeg_create_decompress( &cinfo ); - wx_jpeg_io_src( &cinfo, stream ); - jpeg_read_header( &cinfo, TRUE ); - - int bytesPerPixel; - if ((cinfo.out_color_space == JCS_CMYK) || (cinfo.out_color_space == JCS_YCCK)) - { - cinfo.out_color_space = JCS_CMYK; - bytesPerPixel = 4; - } - else // all the rest is treated as RGB - { - cinfo.out_color_space = JCS_RGB; - bytesPerPixel = 3; - } - - jpeg_start_decompress( &cinfo ); - - image->Create( cinfo.image_width, cinfo.image_height ); - if (!image->Ok()) { - jpeg_finish_decompress( &cinfo ); - jpeg_destroy_decompress( &cinfo ); - return false; - } - image->SetMask( false ); - ptr = image->GetData(); - - unsigned stride = cinfo.output_width * bytesPerPixel; - JSAMPARRAY tempbuf = (*cinfo.mem->alloc_sarray) - ((j_common_ptr) &cinfo, JPOOL_IMAGE, stride, 1 ); - - while ( cinfo.output_scanline < cinfo.output_height ) - { - jpeg_read_scanlines( &cinfo, tempbuf, 1 ); - if (cinfo.out_color_space == JCS_RGB) - { - memcpy( ptr, tempbuf[0], stride ); - ptr += stride; - } - else // CMYK - { - const unsigned char* inptr = (const unsigned char*) tempbuf[0]; - for (size_t i = 0; i < cinfo.output_width; i++) - { - wx_cmyk_to_rgb(ptr, inptr); - ptr += 3; - inptr += 4; - } - } - } - - jpeg_finish_decompress( &cinfo ); - jpeg_destroy_decompress( &cinfo ); - return true; -} - -typedef struct { - struct jpeg_destination_mgr pub; - - wxOutputStream *stream; - JOCTET * buffer; -} wx_destination_mgr; - -typedef wx_destination_mgr * wx_dest_ptr; - -#define OUTPUT_BUF_SIZE 4096 /* choose an efficiently fwrite'able size */ - -CPP_METHODDEF(void) wx_init_destination (j_compress_ptr cinfo) -{ - wx_dest_ptr dest = (wx_dest_ptr) cinfo->dest; - - /* Allocate the output buffer --- it will be released when done with image */ - dest->buffer = (JOCTET *) - (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, - OUTPUT_BUF_SIZE * sizeof(JOCTET)); - dest->pub.next_output_byte = dest->buffer; - dest->pub.free_in_buffer = OUTPUT_BUF_SIZE; -} - -CPP_METHODDEF(wxjpeg_boolean) wx_empty_output_buffer (j_compress_ptr cinfo) -{ - wx_dest_ptr dest = (wx_dest_ptr) cinfo->dest; - - dest->stream->Write(dest->buffer, OUTPUT_BUF_SIZE); - dest->pub.next_output_byte = dest->buffer; - dest->pub.free_in_buffer = OUTPUT_BUF_SIZE; - return TRUE; -} - -CPP_METHODDEF(void) wx_term_destination (j_compress_ptr cinfo) -{ - wx_dest_ptr dest = (wx_dest_ptr) cinfo->dest; - size_t datacount = OUTPUT_BUF_SIZE - dest->pub.free_in_buffer; - /* Write any data remaining in the buffer */ - if (datacount > 0) - dest->stream->Write(dest->buffer, datacount); -} - -GLOBAL(void) wx_jpeg_io_dest (j_compress_ptr cinfo, wxOutputStream& outfile) -{ - wx_dest_ptr dest; - - if (cinfo->dest == NULL) { /* first time for this JPEG object? */ - cinfo->dest = (struct jpeg_destination_mgr *) - (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT, - sizeof(wx_destination_mgr)); - } - - dest = (wx_dest_ptr) cinfo->dest; - dest->pub.init_destination = wx_init_destination; - dest->pub.empty_output_buffer = wx_empty_output_buffer; - dest->pub.term_destination = wx_term_destination; - dest->stream = &outfile; -} - -bool wxJPEGHandler::SaveFile( wxImage *image, wxOutputStream& stream, bool verbose ) -{ - struct jpeg_compress_struct cinfo; - struct wx_error_mgr jerr; - JSAMPROW row_pointer[1]; /* pointer to JSAMPLE row[s] */ - JSAMPLE *image_buffer; - int stride; /* physical row width in image buffer */ - - cinfo.err = jpeg_std_error(&jerr.pub); - jerr.pub.error_exit = wx_error_exit; - - if (!verbose) - cinfo.err->output_message = wx_ignore_message; - - /* Establish the setjmp return context for wx_error_exit to use. */ - if (setjmp(jerr.setjmp_buffer)) - { - /* If we get here, the JPEG code has signaled an error. - * We need to clean up the JPEG object, close the input file, and return. - */ - if (verbose) - wxLogError(_("JPEG: Couldn't save image.")); - jpeg_destroy_compress(&cinfo); - return false; - } - - jpeg_create_compress(&cinfo); - wx_jpeg_io_dest(&cinfo, stream); - - cinfo.image_width = image->GetWidth(); - cinfo.image_height = image->GetHeight(); - cinfo.input_components = 3; - cinfo.in_color_space = JCS_RGB; - jpeg_set_defaults(&cinfo); - - // TODO: 3rd parameter is force_baseline, what value should this be? - // Code says: "If force_baseline is TRUE, the computed quantization table entries - // are limited to 1..255 for JPEG baseline compatibility." - // 'Quality' is a number between 0 (terrible) and 100 (very good). - // The default (in jcparam.c, jpeg_set_defaults) is 75, - // and force_baseline is TRUE. - if (image->HasOption(wxIMAGE_OPTION_QUALITY)) - jpeg_set_quality(&cinfo, image->GetOptionInt(wxIMAGE_OPTION_QUALITY), TRUE); - - // set the resolution fields in the output file - UINT16 resX, - resY; - if ( image->HasOption(wxIMAGE_OPTION_RESOLUTIONX) && - image->HasOption(wxIMAGE_OPTION_RESOLUTIONY) ) - { - resX = (UINT16)image->GetOptionInt(wxIMAGE_OPTION_RESOLUTIONX); - resY = (UINT16)image->GetOptionInt(wxIMAGE_OPTION_RESOLUTIONY); - } - else if ( image->HasOption(wxIMAGE_OPTION_RESOLUTION) ) - { - resX = - resY = (UINT16)image->GetOptionInt(wxIMAGE_OPTION_RESOLUTION); - } - else - { - resX = - resY = 0; - } - - if ( resX && resY ) - { - cinfo.X_density = resX; - cinfo.Y_density = resY; - } - - // sets the resolution unit field in the output file - // wxIMAGE_RESOLUTION_INCHES for inches - // wxIMAGE_RESOLUTION_CM for centimeters - if ( image->HasOption(wxIMAGE_OPTION_RESOLUTIONUNIT) ) - { - cinfo.density_unit = (UINT8)image->GetOptionInt(wxIMAGE_OPTION_RESOLUTIONUNIT); - } - - jpeg_start_compress(&cinfo, TRUE); - - stride = cinfo.image_width * 3; /* JSAMPLEs per row in image_buffer */ - image_buffer = image->GetData(); - while (cinfo.next_scanline < cinfo.image_height) { - row_pointer[0] = &image_buffer[cinfo.next_scanline * stride]; - jpeg_write_scanlines( &cinfo, row_pointer, 1 ); - } - jpeg_finish_compress(&cinfo); - jpeg_destroy_compress(&cinfo); - - return true; -} - -#ifdef __VISUALC__ - #pragma warning(default:4611) -#endif /* VC++ */ - -bool wxJPEGHandler::DoCanRead( wxInputStream& stream ) -{ - unsigned char hdr[2]; - - if ( !stream.Read(hdr, WXSIZEOF(hdr)) ) - return false; - - return hdr[0] == 0xFF && hdr[1] == 0xD8; -} - -#endif // wxUSE_STREAMS - -#endif // wxUSE_LIBJPEG diff --git a/wxWidgets/src/common/imagpcx.cpp b/wxWidgets/src/common/imagpcx.cpp deleted file mode 100644 index d77be9b83c..0000000000 --- a/wxWidgets/src/common/imagpcx.cpp +++ /dev/null @@ -1,500 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/common/imagpcx.cpp -// Purpose: wxImage PCX handler -// Author: Guillermo Rodriguez Garcia -// Version: 1.1 -// CVS-ID: $Id: imagpcx.cpp 54766 2008-07-22 20:16:03Z VZ $ -// Copyright: (c) 1999 Guillermo Rodriguez Garcia -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_IMAGE && wxUSE_PCX - -#ifndef WX_PRECOMP - #include "wx/object.h" - #include "wx/list.h" - #include "wx/log.h" - #include "wx/intl.h" - #include "wx/palette.h" - #include "wx/hash.h" - #include "wx/module.h" -#endif - -#include "wx/imagpcx.h" -#include "wx/wfstream.h" - -//----------------------------------------------------------------------------- -// wxPCXHandler -//----------------------------------------------------------------------------- - -IMPLEMENT_DYNAMIC_CLASS(wxPCXHandler,wxImageHandler) - -#if wxUSE_STREAMS - -//----------------------------------------------------------------------------- -// RLE encoding and decoding -//----------------------------------------------------------------------------- - -void RLEencode(unsigned char *p, unsigned int size, wxOutputStream& s) -{ - unsigned int data, last, cont; - - // Write 'size' bytes. The PCX official specs say there will be - // a decoding break at the end of each scanline, so in order to - // force this decoding break use this function to write, at most, - // _one_ complete scanline at a time. - - last = (unsigned char) *(p++); - cont = 1; - size--; - - while (size-- > 0) - { - data = (unsigned char) *(p++); - - // Up to 63 bytes with the same value can be stored using - // a single { cont, value } pair. - // - if ((data == last) && (cont < 63)) - { - cont++; - } - else - { - // need to write a 'counter' byte? - if ((cont > 1) || ((last & 0xC0) == 0xC0)) - s.PutC((char) (cont | 0xC0)); - - s.PutC((char) last); - last = data; - cont = 1; - } - } - - // write the last one and return; - if ((cont > 1) || ((last & 0xC0) == 0xC0)) - s.PutC((char) (cont | 0xC0)); - - s.PutC((char) last); -} - -void RLEdecode(unsigned char *p, unsigned int size, wxInputStream& s) -{ - // Read 'size' bytes. The PCX official specs say there will be - // a decoding break at the end of each scanline (but not at the - // end of each plane inside a scanline). Only use this function - // to read one or more _complete_ scanlines. Else, more than - // 'size' bytes might be read and the buffer might overflow. - - while (size != 0) - { - unsigned int data = (unsigned char)s.GetC(); - - // If ((data & 0xC0) != 0xC0), then the value read is a data - // byte. Else, it is a counter (cont = val & 0x3F) and the - // next byte is the data byte. - - if ((data & 0xC0) != 0xC0) - { - *(p++) = (unsigned char)data; - size--; - } - else - { - unsigned int cont = data & 0x3F; - if (cont > size) // can happen only if the file is malformed - break; - data = (unsigned char)s.GetC(); - for (unsigned int i = 1; i <= cont; i++) - *(p++) = (unsigned char)data; - size -= cont; - } - } -} - - -//----------------------------------------------------------------------------- -// PCX reading and saving -//----------------------------------------------------------------------------- - -// PCX header -#define HDR_MANUFACTURER 0 -#define HDR_VERSION 1 -#define HDR_ENCODING 2 -#define HDR_BITSPERPIXEL 3 -#define HDR_XMIN 4 -#define HDR_YMIN 6 -#define HDR_XMAX 8 -#define HDR_YMAX 10 -#define HDR_NPLANES 65 -#define HDR_BYTESPERLINE 66 -#define HDR_PALETTEINFO 68 - -// image formats -enum { - wxPCX_8BIT, // 8 bpp, 1 plane (8 bit) - wxPCX_24BIT // 8 bpp, 3 planes (24 bit) -}; - -// error codes -enum { - wxPCX_OK = 0, // everything was OK - wxPCX_INVFORMAT = 1, // error in pcx file format - wxPCX_MEMERR = 2, // error allocating memory - wxPCX_VERERR = 3 // error in pcx version number -}; - - -// ReadPCX: -// Loads a PCX file into the wxImage object pointed by image. -// Returns wxPCX_OK on success, or an error code otherwise -// (see above for error codes) -// -int ReadPCX(wxImage *image, wxInputStream& stream) -{ - unsigned char hdr[128]; // PCX header - unsigned char pal[768]; // palette for 8 bit images - unsigned char *p; // space to store one scanline - unsigned char *dst; // pointer into wxImage data - unsigned int width, height; // size of the image - unsigned int bytesperline; // bytes per line (each plane) - int bitsperpixel; // bits per pixel (each plane) - int nplanes; // number of planes - int encoding; // is the image RLE encoded? - int format; // image format (8 bit, 24 bit) - unsigned int i, j; - - // Read PCX header and check the version number (it must - // be at least 5 or higher for 8 bit and 24 bit images). - - stream.Read(hdr, 128); - - if (hdr[HDR_VERSION] < 5) return wxPCX_VERERR; - - // Extract all image info from the PCX header. - - encoding = hdr[HDR_ENCODING]; - nplanes = hdr[HDR_NPLANES]; - bitsperpixel = hdr[HDR_BITSPERPIXEL]; - bytesperline = hdr[HDR_BYTESPERLINE] + 256 * hdr[HDR_BYTESPERLINE + 1]; - width = (hdr[HDR_XMAX] + 256 * hdr[HDR_XMAX + 1]) - - (hdr[HDR_XMIN] + 256 * hdr[HDR_XMIN + 1]) + 1; - height = (hdr[HDR_YMAX] + 256 * hdr[HDR_YMAX + 1]) - - (hdr[HDR_YMIN] + 256 * hdr[HDR_YMIN + 1]) + 1; - - // Check image format. Currently supported formats are - // 8 bits (8 bpp, 1 plane) and 24 bits (8 bpp, 3 planes). - - if ((nplanes == 3) && (bitsperpixel == 8)) - format = wxPCX_24BIT; - else if ((nplanes == 1) && (bitsperpixel == 8)) - format = wxPCX_8BIT; - else - return wxPCX_INVFORMAT; - - // If the image is of type wxPCX_8BIT, then there is - // a palette at the end of the image data. If we were - // working with a file, we could seek at the end to the - // end (SeekI(-769, wxFromEnd) and read the palette - // before proceeding. Unfortunately, this would prevent - // loading several PCXs in a single stream, so we can't - // do it. Thus, 8-bit images will have to be decoded in - // two passes: one to read and decode the image data, - // and another to replace 'colour indexes' with RGB - // values. - - // Resize the image and allocate memory for a scanline. - - image->Create(width, height); - - if (!image->Ok()) - return wxPCX_MEMERR; - - if ((p = (unsigned char *) malloc(bytesperline * nplanes)) == NULL) - return wxPCX_MEMERR; - - // Now start reading the file, line by line, and store - // the data in the format required by wxImage. - - dst = image->GetData(); - - for (j = height; j; j--) - { - if (encoding) - RLEdecode(p, bytesperline * nplanes, stream); - else - stream.Read(p, bytesperline * nplanes); - - switch (format) - { - case wxPCX_8BIT: - { - for (i = 0; i < width; i++) - { - // first pass, just store the colour index - *dst = p[i]; - dst += 3; - } - break; - } - case wxPCX_24BIT: - { - for (i = 0; i < width; i++) - { - *(dst++) = p[i]; - *(dst++) = p[i + bytesperline]; - *(dst++) = p[i + 2 * bytesperline]; - } - break; - } - } - } - - free(p); - - // For 8 bit images, we read the palette, and then do a second - // pass replacing indexes with their RGB values; - - if (format == wxPCX_8BIT) - { - unsigned char index; - - if (stream.GetC() != 12) - return wxPCX_INVFORMAT; - - stream.Read(pal, 768); - - p = image->GetData(); - for (unsigned long k = height * width; k; k--) - { - index = *p; - *(p++) = pal[3 * index]; - *(p++) = pal[3 * index + 1]; - *(p++) = pal[3 * index + 2]; - } - -#if wxUSE_PALETTE - unsigned char r[256]; - unsigned char g[256]; - unsigned char b[256]; - for (i = 0; i < 256; i++) - { - r[i] = pal[3*i + 0]; - g[i] = pal[3*i + 1]; - b[i] = pal[3*i + 2]; - } - image->SetPalette(wxPalette(256, r, g, b)); -#endif // wxUSE_PALETTE - } - - return wxPCX_OK; -} - -// SavePCX: -// Saves a PCX file into the wxImage object pointed by image. -// Returns wxPCX_OK on success, or an error code otherwise -// (see above for error codes). Will try to save as 8-bit -// PCX if possible, and then fall back to 24-bit if there -// are more than 256 different colours. -// -int SavePCX(wxImage *image, wxOutputStream& stream) -{ - unsigned char hdr[128]; // PCX header - unsigned char pal[768]; // palette for 8 bit images - unsigned char *p; // space to store one scanline - unsigned char *src; // pointer into wxImage data - unsigned int width, height; // size of the image - unsigned int bytesperline; // bytes per line (each plane) - unsigned char nplanes = 3; // number of planes - int format = wxPCX_24BIT; // image format (8 bit, 24 bit) - wxImageHistogram histogram; // image histogram - unsigned long key; // key in the hashtable - unsigned int i; - - // See if we can save as 8 bit. - - if (image->CountColours(256) <= 256) - { - image->ComputeHistogram(histogram); - format = wxPCX_8BIT; - nplanes = 1; - } - - // Get image dimensions, calculate bytesperline (must be even, - // according to PCX specs) and allocate space for one complete - // scanline. - - if (!image->Ok()) - return wxPCX_INVFORMAT; - - width = image->GetWidth(); - height = image->GetHeight(); - bytesperline = width; - if (bytesperline % 2) - bytesperline++; - - if ((p = (unsigned char *) malloc(bytesperline * nplanes)) == NULL) - return wxPCX_MEMERR; - - // Build header data and write it to the stream. Initially, - // set all bytes to zero (most values default to zero). - - memset(hdr, 0, sizeof(hdr)); - - hdr[HDR_MANUFACTURER] = 10; - hdr[HDR_VERSION] = 5; - hdr[HDR_ENCODING] = 1; - hdr[HDR_NPLANES] = nplanes; - hdr[HDR_BITSPERPIXEL] = 8; - hdr[HDR_BYTESPERLINE] = (unsigned char)(bytesperline % 256); - hdr[HDR_BYTESPERLINE + 1] = (unsigned char)(bytesperline / 256); - hdr[HDR_XMAX] = (unsigned char)((width - 1) % 256); - hdr[HDR_XMAX + 1] = (unsigned char)((width - 1) / 256); - hdr[HDR_YMAX] = (unsigned char)((height - 1) % 256); - hdr[HDR_YMAX + 1] = (unsigned char)((height - 1) / 256); - hdr[HDR_PALETTEINFO] = 1; - - stream.Write(hdr, 128); - - // Encode image data line by line and write it to the stream - - src = image->GetData(); - - for (; height; height--) - { - switch (format) - { - case wxPCX_8BIT: - { - unsigned char r, g, b; - - for (i = 0; i < width; i++) - { - r = *(src++); - g = *(src++); - b = *(src++); - key = (r << 16) | (g << 8) | b; - - p[i] = (unsigned char)histogram[key].index; - } - break; - } - case wxPCX_24BIT: - { - for (i = 0; i < width; i++) - { - p[i] = *(src++); - p[i + bytesperline] = *(src++); - p[i + 2 * bytesperline] = *(src++); - } - break; - } - } - - RLEencode(p, bytesperline * nplanes, stream); - } - - free(p); - - // For 8 bit images, build the palette and write it to the stream: - if (format == wxPCX_8BIT) - { - // zero unused colours - memset(pal, 0, sizeof(pal)); - - unsigned long index; - - for (wxImageHistogram::iterator entry = histogram.begin(); - entry != histogram.end(); ++entry ) - { - key = entry->first; - index = entry->second.index; - pal[3 * index] = (unsigned char)(key >> 16); - pal[3 * index + 1] = (unsigned char)(key >> 8); - pal[3 * index + 2] = (unsigned char)(key); - } - - stream.PutC(12); - stream.Write(pal, 768); - } - - return wxPCX_OK; -} - -//----------------------------------------------------------------------------- -// wxPCXHandler -//----------------------------------------------------------------------------- - -bool wxPCXHandler::LoadFile( wxImage *image, wxInputStream& stream, bool verbose, int WXUNUSED(index) ) -{ - int error; - - if (!CanRead(stream)) - { - if (verbose) - wxLogError(_("PCX: this is not a PCX file.")); - - return false; - } - - image->Destroy(); - - if ((error = ReadPCX(image, stream)) != wxPCX_OK) - { - if (verbose) - { - switch (error) - { - case wxPCX_INVFORMAT: wxLogError(_("PCX: image format unsupported")); break; - case wxPCX_MEMERR: wxLogError(_("PCX: couldn't allocate memory")); break; - case wxPCX_VERERR: wxLogError(_("PCX: version number too low")); break; - default: wxLogError(_("PCX: unknown error !!!")); - } - } - image->Destroy(); - return false; - } - - return true; -} - -bool wxPCXHandler::SaveFile( wxImage *image, wxOutputStream& stream, bool verbose ) -{ - int error; - - if ((error = SavePCX(image, stream)) != wxPCX_OK) - { - if (verbose) - { - switch (error) - { - case wxPCX_INVFORMAT: wxLogError(_("PCX: invalid image")); break; - case wxPCX_MEMERR: wxLogError(_("PCX: couldn't allocate memory")); break; - default: wxLogError(_("PCX: unknown error !!!")); - } - } - } - - return (error == wxPCX_OK); -} - -bool wxPCXHandler::DoCanRead( wxInputStream& stream ) -{ - unsigned char c = stream.GetC(); - if ( !stream ) - return false; - - // not very safe, but this is all we can get from PCX header :-( - return c == 10; -} - -#endif // wxUSE_STREAMS - -#endif // wxUSE_IMAGE && wxUSE_PCX diff --git a/wxWidgets/src/common/imagpng.cpp b/wxWidgets/src/common/imagpng.cpp deleted file mode 100644 index d1bac65976..0000000000 --- a/wxWidgets/src/common/imagpng.cpp +++ /dev/null @@ -1,869 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/common/imagepng.cpp -// Purpose: wxImage PNG handler -// Author: Robert Roebling -// RCS-ID: $Id: imagpng.cpp 67009 2011-02-24 08:42:57Z JS $ -// Copyright: (c) Robert Roebling -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_IMAGE && wxUSE_LIBPNG - -#include "wx/imagpng.h" - -#ifndef WX_PRECOMP - #include "wx/log.h" - #include "wx/app.h" - #include "wx/bitmap.h" - #include "wx/module.h" -#endif - -#include "png.h" -#include "wx/filefn.h" -#include "wx/wfstream.h" -#include "wx/intl.h" -#include "wx/palette.h" - -// For memcpy -#include - -#ifdef __SALFORDC__ -#ifdef FAR -#undef FAR -#endif -#endif - -// ---------------------------------------------------------------------------- -// constants -// ---------------------------------------------------------------------------- - -// image can not have any transparent pixels at all, have only 100% opaque -// and/or 100% transparent pixels in which case a simple mask is enough to -// store this information in wxImage or have a real alpha channel in which case -// we need to have it in wxImage as well -enum Transparency -{ - Transparency_None, - Transparency_Mask, - Transparency_Alpha -}; - -// ---------------------------------------------------------------------------- -// local functions -// ---------------------------------------------------------------------------- - -// return the kind of transparency needed for this image assuming that it does -// have transparent pixels, i.e. either Transparency_Alpha or Transparency_Mask -static Transparency -CheckTransparency(unsigned char **lines, - png_uint_32 x, png_uint_32 y, png_uint_32 w, png_uint_32 h, - size_t numColBytes); - -// init the alpha channel for the image and fill it with 1s up to (x, y) -static unsigned char *InitAlpha(wxImage *image, png_uint_32 x, png_uint_32 y); - -// find a free colour for the mask in the PNG data array -static void -FindMaskColour(unsigned char **lines, png_uint_32 width, png_uint_32 height, - unsigned char& rMask, unsigned char& gMask, unsigned char& bMask); - -// is the pixel with this value of alpha a fully opaque one? -static inline -bool IsOpaque(unsigned char a) -{ - return a == 0xff; -} - -// is the pixel with this value of alpha a fully transparent one? -static inline -bool IsTransparent(unsigned char a) -{ - return !a; -} - -// ============================================================================ -// wxPNGHandler implementation -// ============================================================================ - -IMPLEMENT_DYNAMIC_CLASS(wxPNGHandler,wxImageHandler) - -#if wxUSE_STREAMS - -#ifndef PNGLINKAGEMODE - #ifdef PNGAPI - #define PNGLINKAGEMODE PNGAPI - #elif defined(__WATCOMC__) - // we need an explicit cdecl for Watcom, at least according to - // - // http://sf.net/tracker/index.php?func=detail&aid=651492&group_id=9863&atid=109863 - // - // more testing is needed for this however, please remove this comment - // if you can confirm that my fix works with Watcom 11 - #define PNGLINKAGEMODE cdecl - #else - #define PNGLINKAGEMODE LINKAGEMODE - #endif -#endif - - -// VS: wxPNGInfoStruct declared below is a hack that needs some explanation. -// First, let me describe what's the problem: libpng uses jmp_buf in -// its png_struct structure. Unfortunately, this structure is -// compiler-specific and may vary in size, so if you use libpng compiled -// as DLL with another compiler than the main executable, it may not work -// (this is for example the case with wxMGL port and SciTech MGL library -// that provides custom runtime-loadable libpng implementation with jmpbuf -// disabled altogether). Luckily, it is still possible to use setjmp() & -// longjmp() as long as the structure is not part of png_struct. -// -// Sadly, there's no clean way to attach user-defined data to png_struct. -// There is only one customizable place, png_struct.io_ptr, which is meant -// only for I/O routines and is set with png_set_read_fn or -// png_set_write_fn. The hacky part is that we use io_ptr to store -// a pointer to wxPNGInfoStruct that holds I/O structures _and_ jmp_buf. - -struct wxPNGInfoStruct -{ - jmp_buf jmpbuf; - bool verbose; - - union - { - wxInputStream *in; - wxOutputStream *out; - } stream; -}; - -#define WX_PNG_INFO(png_ptr) ((wxPNGInfoStruct*)png_get_io_ptr(png_ptr)) - -// ---------------------------------------------------------------------------- -// helper functions -// ---------------------------------------------------------------------------- - -extern "C" -{ - -void PNGLINKAGEMODE wx_PNG_stream_reader( png_structp png_ptr, png_bytep data, - png_size_t length ) -{ - WX_PNG_INFO(png_ptr)->stream.in->Read(data, length); -} - -void PNGLINKAGEMODE wx_PNG_stream_writer( png_structp png_ptr, png_bytep data, - png_size_t length ) -{ - WX_PNG_INFO(png_ptr)->stream.out->Write(data, length); -} - -void -PNGLINKAGEMODE wx_png_warning(png_structp png_ptr, png_const_charp message) -{ - wxPNGInfoStruct *info = png_ptr ? WX_PNG_INFO(png_ptr) : NULL; - if ( !info || info->verbose ) - wxLogWarning( wxString::FromAscii(message) ); -} - -// from pngerror.c -// so that the libpng doesn't send anything on stderr -void -PNGLINKAGEMODE wx_png_error(png_structp png_ptr, png_const_charp message) -{ - wx_png_warning(NULL, message); - - // we're not using libpng built-in jump buffer (see comment before - // wxPNGInfoStruct above) so we have to return ourselves, otherwise libpng - // would just abort - longjmp(WX_PNG_INFO(png_ptr)->jmpbuf, 1); -} - -} // extern "C" - -// ---------------------------------------------------------------------------- -// LoadFile() helpers -// ---------------------------------------------------------------------------- - -// determine the kind of transparency we need for this image: if the only alpha -// values it has are 0 (transparent) and 0xff (opaque) then we can simply -// create a mask for it, we should be ok with a simple mask but otherwise we -// need a full blown alpha channel in wxImage -// -// parameters: -// lines raw PNG data -// x, y starting position -// w, h size of the image -// numColBytes number of colour bytes (1 for grey scale, 3 for RGB) -// (NB: alpha always follows the colour bytes) -Transparency -CheckTransparency(unsigned char **lines, - png_uint_32 x, png_uint_32 y, png_uint_32 w, png_uint_32 h, - size_t numColBytes) -{ - // suppose that a mask will suffice and check all the remaining alpha - // values to see if it does - for ( ; y < h; y++ ) - { - // each pixel is numColBytes+1 bytes, offset into the current line by - // the current x position - unsigned const char *ptr = lines[y] + (x * (numColBytes + 1)); - - for ( png_uint_32 x2 = x; x2 < w; x2++ ) - { - // skip the grey or colour byte(s) - ptr += numColBytes; - - unsigned char a2 = *ptr++; - - if ( !IsTransparent(a2) && !IsOpaque(a2) ) - { - // not fully opaque nor fully transparent, hence need alpha - return Transparency_Alpha; - } - } - - // during the next loop iteration check all the pixels in the row - x = 0; - } - - // mask will be enough - return Transparency_Mask; -} - -unsigned char *InitAlpha(wxImage *image, png_uint_32 x, png_uint_32 y) -{ - // create alpha channel - image->SetAlpha(); - - unsigned char *alpha = image->GetAlpha(); - - // set alpha for the pixels we had so far - png_uint_32 end = y * image->GetWidth() + x; - for ( png_uint_32 i = 0; i < end; i++ ) - { - // all the previous pixels were opaque - *alpha++ = 0xff; - } - - return alpha; -} - -void -FindMaskColour(unsigned char **lines, png_uint_32 width, png_uint_32 height, - unsigned char& rMask, unsigned char& gMask, unsigned char& bMask) -{ - // choosing the colour for the mask is more - // difficult: we need to iterate over the entire - // image for this in order to choose an unused - // colour (this is not very efficient but what else - // can we do?) - wxImageHistogram h; - unsigned nentries = 0; - unsigned char r2, g2, b2; - for ( png_uint_32 y2 = 0; y2 < height; y2++ ) - { - const unsigned char *p = lines[y2]; - for ( png_uint_32 x2 = 0; x2 < width; x2++ ) - { - r2 = *p++; - g2 = *p++; - b2 = *p++; - ++p; // jump over alpha - - wxImageHistogramEntry& - entry = h[wxImageHistogram:: MakeKey(r2, g2, b2)]; - - if ( entry.value++ == 0 ) - entry.index = nentries++; - } - } - - if ( !h.FindFirstUnusedColour(&rMask, &gMask, &bMask) ) - { - wxLogWarning(_("Too many colours in PNG, the image may be slightly blurred.")); - - // use a fixed mask colour and we'll fudge - // the real pixels with this colour (see - // below) - rMask = 0xfe; - gMask = 0; - bMask = 0xff; - } -} - -// ---------------------------------------------------------------------------- -// reading PNGs -// ---------------------------------------------------------------------------- - -bool wxPNGHandler::DoCanRead( wxInputStream& stream ) -{ - unsigned char hdr[4]; - - if ( !stream.Read(hdr, WXSIZEOF(hdr)) ) - return false; - - return memcmp(hdr, "\211PNG", WXSIZEOF(hdr)) == 0; -} - -// convert data from RGB to wxImage format -static -void CopyDataFromPNG(wxImage *image, - unsigned char **lines, - png_uint_32 width, - png_uint_32 height, - int color_type) -{ - Transparency transparency = Transparency_None; - - // only non NULL if transparency == Transparency_Alpha - unsigned char *alpha = NULL; - - // RGB of the mask colour if transparency == Transparency_Mask - // (but init them anyhow to avoid compiler warnings) - unsigned char rMask = 0, - gMask = 0, - bMask = 0; - - unsigned char *ptrDst = image->GetData(); - if ( !(color_type & PNG_COLOR_MASK_COLOR) ) - { - // grey image: GAGAGA... where G == grey component and A == alpha - for ( png_uint_32 y = 0; y < height; y++ ) - { - const unsigned char *ptrSrc = lines[y]; - for ( png_uint_32 x = 0; x < width; x++ ) - { - unsigned char g = *ptrSrc++; - unsigned char a = *ptrSrc++; - - // the first time we encounter a transparent pixel we must - // decide about what to do about them - if ( !IsOpaque(a) && transparency == Transparency_None ) - { - // we'll need at least the mask for this image and - // maybe even full alpha channel info: the former is - // only enough if we have alpha values of 0 and 0xff - // only, otherwisewe need the latter - transparency = CheckTransparency - ( - lines, - x, y, - width, height, - 1 - ); - - if ( transparency == Transparency_Mask ) - { - // let's choose this colour for the mask: this is - // not a problem here as all the other pixels are - // grey, i.e. R == G == B which is not the case for - // this one so no confusion is possible - rMask = 0xff; - gMask = 0; - bMask = 0xff; - } - else // transparency == Transparency_Alpha - { - alpha = InitAlpha(image, x, y); - } - } - - switch ( transparency ) - { - case Transparency_Mask: - if ( IsTransparent(a) ) - { - *ptrDst++ = rMask; - *ptrDst++ = gMask; - *ptrDst++ = bMask; - break; - } - // else: !transparent - - // must be opaque then as otherwise we shouldn't be - // using the mask at all - wxASSERT_MSG( IsOpaque(a), _T("logic error") ); - - // fall through - - case Transparency_Alpha: - if ( alpha ) - *alpha++ = a; - // fall through - - case Transparency_None: - *ptrDst++ = g; - *ptrDst++ = g; - *ptrDst++ = g; - break; - } - } - } - } - else // colour image: RGBRGB... - { - for ( png_uint_32 y = 0; y < height; y++ ) - { - const unsigned char *ptrSrc = lines[y]; - for ( png_uint_32 x = 0; x < width; x++ ) - { - unsigned char r = *ptrSrc++; - unsigned char g = *ptrSrc++; - unsigned char b = *ptrSrc++; - unsigned char a = *ptrSrc++; - - // the logic here is the same as for the grey case except - // where noted - if ( !IsOpaque(a) && transparency == Transparency_None ) - { - transparency = CheckTransparency - ( - lines, - x, y, - width, height, - 3 - ); - - if ( transparency == Transparency_Mask ) - { - FindMaskColour(lines, width, height, - rMask, gMask, bMask); - } - else // transparency == Transparency_Alpha - { - alpha = InitAlpha(image, x, y); - } - - } - - switch ( transparency ) - { - case Transparency_Mask: - if ( IsTransparent(a) ) - { - *ptrDst++ = rMask; - *ptrDst++ = gMask; - *ptrDst++ = bMask; - break; - } - else // !transparent - { - // must be opaque then as otherwise we shouldn't be - // using the mask at all - wxASSERT_MSG( IsOpaque(a), _T("logic error") ); - - // if we couldn't find a unique colour for the - // mask, we can have real pixels with the same - // value as the mask and it's better to slightly - // change their colour than to make them - // transparent - if ( r == rMask && g == gMask && b == bMask ) - { - r++; - } - } - - // fall through - - case Transparency_Alpha: - if ( alpha ) - *alpha++ = a; - // fall through - - case Transparency_None: - *ptrDst++ = r; - *ptrDst++ = g; - *ptrDst++ = b; - break; - } - } - } - } - - if ( transparency == Transparency_Mask ) - { - image->SetMaskColour(rMask, gMask, bMask); - } -} - -// temporarily disable the warning C4611 (interaction between '_setjmp' and -// C++ object destruction is non-portable) - I don't see any dtors here -#ifdef __VISUALC__ - #pragma warning(disable:4611) -#endif /* VC++ */ - -bool -wxPNGHandler::LoadFile(wxImage *image, - wxInputStream& stream, - bool verbose, - int WXUNUSED(index)) -{ - // VZ: as this function uses setjmp() the only fool-proof error handling - // method is to use goto (setjmp is not really C++ dtors friendly...) - - unsigned char **lines = NULL; - png_infop info_ptr = (png_infop) NULL; - wxPNGInfoStruct wxinfo; - - png_uint_32 i, width, height = 0; - int bit_depth, color_type, interlace_type; - - wxinfo.verbose = verbose; - wxinfo.stream.in = &stream; - - image->Destroy(); - - png_structp png_ptr = png_create_read_struct - ( - PNG_LIBPNG_VER_STRING, - NULL, - wx_png_error, - wx_png_warning - ); - if (!png_ptr) - goto error; - - // NB: please see the comment near wxPNGInfoStruct declaration for - // explanation why this line is mandatory - png_set_read_fn( png_ptr, &wxinfo, wx_PNG_stream_reader); - - info_ptr = png_create_info_struct( png_ptr ); - if (!info_ptr) - goto error; - - if (setjmp(wxinfo.jmpbuf)) - goto error; - - png_read_info( png_ptr, info_ptr ); - png_get_IHDR( png_ptr, info_ptr, &width, &height, &bit_depth, &color_type, &interlace_type, (int*) NULL, (int*) NULL ); - - if (color_type == PNG_COLOR_TYPE_PALETTE) - png_set_expand( png_ptr ); - - // Fix for Bug [ 439207 ] Monochrome PNG images come up black - if (bit_depth < 8) - png_set_expand( png_ptr ); - - png_set_strip_16( png_ptr ); - png_set_packing( png_ptr ); - if (png_get_valid( png_ptr, info_ptr, PNG_INFO_tRNS)) - png_set_expand( png_ptr ); - png_set_filler( png_ptr, 0xff, PNG_FILLER_AFTER ); - - image->Create((int)width, (int)height, (bool) false /* no need to init pixels */); - - if (!image->Ok()) - goto error; - - // initialize all line pointers to NULL to ensure that they can be safely - // free()d if an error occurs before all of them could be allocated - lines = (unsigned char **)calloc(height, sizeof(unsigned char *)); - if ( !lines ) - goto error; - - for (i = 0; i < height; i++) - { - if ((lines[i] = (unsigned char *)malloc( (size_t)(width * (sizeof(unsigned char) * 4)))) == NULL) - goto error; - } - - png_read_image( png_ptr, lines ); - png_read_end( png_ptr, info_ptr ); - -#if wxUSE_PALETTE - if (color_type == PNG_COLOR_TYPE_PALETTE) - { - int ncolors = 0; - png_colorp palette; - png_get_PLTE( png_ptr, info_ptr, &palette, &ncolors); - unsigned char* r = new unsigned char[ncolors]; - unsigned char* g = new unsigned char[ncolors]; - unsigned char* b = new unsigned char[ncolors]; - int j; - - for (j = 0; j < ncolors; j++) - { - r[j] = palette[j].red; - g[j] = palette[j].green; - b[j] = palette[j].blue; - } - - image->SetPalette(wxPalette(ncolors, r, g, b)); - delete[] r; - delete[] g; - delete[] b; - } -#endif // wxUSE_PALETTE - - png_destroy_read_struct( &png_ptr, &info_ptr, (png_infopp) NULL ); - - // loaded successfully, now init wxImage with this data - CopyDataFromPNG(image, lines, width, height, color_type); - - for ( i = 0; i < height; i++ ) - free( lines[i] ); - free( lines ); - - return true; - -error: - if (verbose) - wxLogError(_("Couldn't load a PNG image - file is corrupted or not enough memory.")); - - if ( image->Ok() ) - { - image->Destroy(); - } - - if ( lines ) - { - for ( unsigned int n = 0; n < height; n++ ) - free( lines[n] ); - - free( lines ); - } - - if ( png_ptr ) - { - if ( info_ptr ) - { - png_destroy_read_struct( &png_ptr, &info_ptr, (png_infopp) NULL ); - free(info_ptr); - } - else - png_destroy_read_struct( &png_ptr, (png_infopp) NULL, (png_infopp) NULL ); - } - return false; -} - -// ---------------------------------------------------------------------------- -// writing PNGs -// ---------------------------------------------------------------------------- - -bool wxPNGHandler::SaveFile( wxImage *image, wxOutputStream& stream, bool verbose ) -{ - wxPNGInfoStruct wxinfo; - - wxinfo.verbose = verbose; - wxinfo.stream.out = &stream; - - png_structp png_ptr = png_create_write_struct - ( - PNG_LIBPNG_VER_STRING, - NULL, - wx_png_error, - wx_png_warning - ); - if (!png_ptr) - { - if (verbose) - wxLogError(_("Couldn't save PNG image.")); - return false; - } - - png_infop info_ptr = png_create_info_struct(png_ptr); - if (info_ptr == NULL) - { - png_destroy_write_struct( &png_ptr, (png_infopp)NULL ); - if (verbose) - wxLogError(_("Couldn't save PNG image.")); - return false; - } - - if (setjmp(wxinfo.jmpbuf)) - { - png_destroy_write_struct( &png_ptr, (png_infopp)NULL ); - if (verbose) - wxLogError(_("Couldn't save PNG image.")); - return false; - } - - // NB: please see the comment near wxPNGInfoStruct declaration for - // explanation why this line is mandatory - png_set_write_fn( png_ptr, &wxinfo, wx_PNG_stream_writer, NULL); - - const int iColorType = image->HasOption(wxIMAGE_OPTION_PNG_FORMAT) - ? image->GetOptionInt(wxIMAGE_OPTION_PNG_FORMAT) - : wxPNG_TYPE_COLOUR; - const int iBitDepth = image->HasOption(wxIMAGE_OPTION_PNG_BITDEPTH) - ? image->GetOptionInt(wxIMAGE_OPTION_PNG_BITDEPTH) - : 8; - - wxASSERT_MSG( iBitDepth == 8 || iBitDepth == 16, - _T("PNG bit depth must be 8 or 16") ); - - bool bHasAlpha = image->HasAlpha(); - bool bHasMask = image->HasMask(); - bool bUseAlpha = bHasAlpha || bHasMask; - - int iPngColorType; - if ( iColorType==wxPNG_TYPE_COLOUR ) - { - iPngColorType = bUseAlpha ? PNG_COLOR_TYPE_RGB_ALPHA - : PNG_COLOR_TYPE_RGB; - } - else - { - iPngColorType = bUseAlpha ? PNG_COLOR_TYPE_GRAY_ALPHA - : PNG_COLOR_TYPE_GRAY; - } - - png_set_IHDR( png_ptr, info_ptr, image->GetWidth(), image->GetHeight(), - iBitDepth, iPngColorType, - PNG_INTERLACE_NONE, PNG_COMPRESSION_TYPE_BASE, - PNG_FILTER_TYPE_BASE); - - int iElements; - png_color_8 sig_bit; - - if ( iPngColorType & PNG_COLOR_MASK_COLOR ) - { - sig_bit.red = - sig_bit.green = - sig_bit.blue = (png_byte)iBitDepth; - iElements = 3; - } - else // grey - { - sig_bit.gray = (png_byte)iBitDepth; - iElements = 1; - } - - if ( iPngColorType & PNG_COLOR_MASK_ALPHA ) - { - sig_bit.alpha = (png_byte)iBitDepth; - iElements++; - } - - if ( iBitDepth == 16 ) - iElements *= 2; - - png_set_sBIT( png_ptr, info_ptr, &sig_bit ); - png_write_info( png_ptr, info_ptr ); - png_set_shift( png_ptr, &sig_bit ); - png_set_packing( png_ptr ); - - unsigned char * - data = (unsigned char *)malloc( image->GetWidth() * iElements ); - if ( !data ) - { - png_destroy_write_struct( &png_ptr, (png_infopp)NULL ); - return false; - } - - unsigned char * - pAlpha = (unsigned char *)(bHasAlpha ? image->GetAlpha() : NULL); - int iHeight = image->GetHeight(); - int iWidth = image->GetWidth(); - - unsigned char uchMaskRed = 0, uchMaskGreen = 0, uchMaskBlue = 0; - - if ( bHasMask ) - { - uchMaskRed = image->GetMaskRed(); - uchMaskGreen = image->GetMaskGreen(); - uchMaskBlue = image->GetMaskBlue(); - } - - unsigned char *pColors = image->GetData(); - - for (int y = 0; y != iHeight; ++y) - { - unsigned char *pData = data; - for (int x = 0; x != iWidth; x++) - { - unsigned char uchRed = *pColors++; - unsigned char uchGreen = *pColors++; - unsigned char uchBlue = *pColors++; - - switch ( iColorType ) - { - default: - wxFAIL_MSG( _T("unknown wxPNG_TYPE_XXX") ); - // fall through - - case wxPNG_TYPE_COLOUR: - *pData++ = uchRed; - if ( iBitDepth == 16 ) - *pData++ = 0; - *pData++ = uchGreen; - if ( iBitDepth == 16 ) - *pData++ = 0; - *pData++ = uchBlue; - if ( iBitDepth == 16 ) - *pData++ = 0; - break; - - case wxPNG_TYPE_GREY: - { - // where do these coefficients come from? maybe we - // should have image options for them as well? - unsigned uiColor = - (unsigned) (76.544*(unsigned)uchRed + - 150.272*(unsigned)uchGreen + - 36.864*(unsigned)uchBlue); - - *pData++ = (unsigned char)((uiColor >> 8) & 0xFF); - if ( iBitDepth == 16 ) - *pData++ = (unsigned char)(uiColor & 0xFF); - } - break; - - case wxPNG_TYPE_GREY_RED: - *pData++ = uchRed; - if ( iBitDepth == 16 ) - *pData++ = 0; - break; - } - - if ( bUseAlpha ) - { - unsigned char uchAlpha = 255; - if ( bHasAlpha ) - uchAlpha = *pAlpha++; - - if ( bHasMask ) - { - if ( (uchRed == uchMaskRed) - && (uchGreen == uchMaskGreen) - && (uchBlue == uchMaskBlue) ) - uchAlpha = 0; - } - - *pData++ = uchAlpha; - if ( iBitDepth == 16 ) - *pData++ = 0; - } - } - - png_bytep row_ptr = data; - png_write_rows( png_ptr, &row_ptr, 1 ); - } - - free(data); - png_write_end( png_ptr, info_ptr ); - png_destroy_write_struct( &png_ptr, (png_infopp)&info_ptr ); - - return true; -} - -#ifdef __VISUALC__ - #pragma warning(default:4611) -#endif /* VC++ */ - -#endif // wxUSE_STREAMS - -#endif // wxUSE_LIBPNG diff --git a/wxWidgets/src/common/imagpnm.cpp b/wxWidgets/src/common/imagpnm.cpp deleted file mode 100644 index 3fcc959169..0000000000 --- a/wxWidgets/src/common/imagpnm.cpp +++ /dev/null @@ -1,201 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/common/imagpnm.cpp -// Purpose: wxImage PNM handler -// Author: Sylvain Bougnoux -// RCS-ID: $Id: imagpnm.cpp 46311 2007-06-03 22:14:32Z VZ $ -// Copyright: (c) Sylvain Bougnoux -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_IMAGE && wxUSE_PNM - -#include "wx/imagpnm.h" - -#ifndef WX_PRECOMP - #include "wx/intl.h" - #include "wx/log.h" -#endif - -#include "wx/txtstrm.h" - -//----------------------------------------------------------------------------- -// wxBMPHandler -//----------------------------------------------------------------------------- - -IMPLEMENT_DYNAMIC_CLASS(wxPNMHandler,wxImageHandler) - -#if wxUSE_STREAMS - -void Skip_Comment(wxInputStream &stream) -{ - wxTextInputStream text_stream(stream); - - if (stream.Peek()==wxT('#')) - { - text_stream.ReadLine(); - Skip_Comment(stream); - } -} - -bool wxPNMHandler::LoadFile( wxImage *image, wxInputStream& stream, bool verbose, int WXUNUSED(index) ) -{ - wxUint32 width, height; - wxUint16 maxval; - char c(0); - - image->Destroy(); - - /* - * Read the PNM header - */ - - wxBufferedInputStream buf_stream(stream); - wxTextInputStream text_stream(buf_stream); - - Skip_Comment(buf_stream); - if (buf_stream.GetC()==wxT('P')) c=buf_stream.GetC(); - - switch (c) - { - case wxT('2'): // ASCII Grey - case wxT('3'): // ASCII RGB - case wxT('5'): // RAW Grey - case wxT('6'): break; - default: - if (verbose) wxLogError(_("PNM: File format is not recognized.")); - return false; - } - - text_stream.ReadLine(); // for the \n - Skip_Comment(buf_stream); - text_stream >> width >> height ; - Skip_Comment(buf_stream); - text_stream >> maxval; - - //cout << line << " " << width << " " << height << " " << maxval << endl; - image->Create( width, height ); - unsigned char *ptr = image->GetData(); - if (!ptr) - { - if (verbose) - wxLogError( _("PNM: Couldn't allocate memory.") ); - return false; - } - - - if (c=='2') // Ascii GREY - { - wxUint32 value, size=width*height; - for (wxUint32 i=0; iSetMask( false ); - - const wxStreamError err = buf_stream.GetLastError(); - return err == wxSTREAM_NO_ERROR || err == wxSTREAM_EOF; -} - -bool wxPNMHandler::SaveFile( wxImage *image, wxOutputStream& stream, bool WXUNUSED(verbose) ) -{ - wxTextOutputStream text_stream(stream); - - //text_stream << "P6" << endl - //<< image->GetWidth() << " " << image->GetHeight() << endl - //<< "255" << endl; - text_stream << wxT("P6\n") << image->GetWidth() << wxT(" ") << image->GetHeight() << wxT("\n255\n"); - stream.Write(image->GetData(),3*image->GetWidth()*image->GetHeight()); - - return stream.IsOk(); -} - -bool wxPNMHandler::DoCanRead( wxInputStream& stream ) -{ - Skip_Comment(stream); - - if ( stream.GetC() == 'P' ) - { - switch ( stream.GetC() ) - { - case '2': // ASCII Grey - case '3': // ASCII RGB - case '5': // RAW Grey - case '6': // RAW RGB - return true; - } - } - - return false; -} - - -#endif // wxUSE_STREAMS - -#endif // wxUSE_IMAGE && wxUSE_PNM diff --git a/wxWidgets/src/common/imagtga.cpp b/wxWidgets/src/common/imagtga.cpp deleted file mode 100644 index c9b39dce7d..0000000000 --- a/wxWidgets/src/common/imagtga.cpp +++ /dev/null @@ -1,750 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: imagtga.cpp -// Purpose: wxImage TGA handler -// Author: Seth Jackson -// CVS-ID: $Id: imagtga.cpp 43681 2006-11-27 15:01:58Z VZ $ -// Copyright: (c) 2005 Seth Jackson -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_IMAGE && wxUSE_TGA - -#ifndef WX_PRECOMP - #include "wx/palette.h" -#endif - -#include "wx/imagtga.h" -#include "wx/log.h" -#include "wx/scopeguard.h" - -// ---------------------------------------------------------------------------- -// constants -// ---------------------------------------------------------------------------- - -// TGA error codes. -enum -{ - wxTGA_OK = 0, - wxTGA_INVFORMAT = 1, - wxTGA_MEMERR = 2 -}; - -// TGA header bytes. -enum -{ - HDR_OFFSET = 0, - HDR_COLORTYPE = 1, - HDR_IMAGETYPE = 2, - HDR_PALETTESTART = 3, - HDR_PALETTELENGTH = 5, - HDR_PALETTEBITS = 7, - HDR_XORIGIN = 8, - HDR_YORIGIN = 10, - HDR_WIDTH = 12, - HDR_HEIGHT = 14, - HDR_BPP = 16, - HDR_ORIENTATION = 17, - HDR_SIZE -}; - -// TGA color types. -enum -{ - wxTGA_UNMAPPED = 0, - wxTGA_MAPPED = 1 -}; - -// ============================================================================ -// implementation -// ============================================================================ - -IMPLEMENT_DYNAMIC_CLASS(wxTGAHandler, wxImageHandler) - -#if wxUSE_STREAMS - -// ---------------------------------------------------------------------------- -// worker functions -// ---------------------------------------------------------------------------- - -static -void FlipTGA(unsigned char* imageData, int width, int height, short pixelSize) -{ - int lineLength = width * pixelSize; - unsigned char *line1 = imageData; - unsigned char *line2 = &imageData[lineLength * (height - 1)]; - - unsigned char temp; - for ( ; line1 < line2; line2 -= (lineLength * 2)) - { - for (int index = 0; index < lineLength; line1++, line2++, index++) - { - temp = *line1; - *line1 = *line2; - *line2 = temp; - } - } -} - -static -void DecodeRLE(unsigned char* imageData, unsigned long imageSize, - short pixelSize, wxInputStream& stream) -{ - unsigned long index = 0; - unsigned char current; - unsigned int length; - unsigned char buf[4]; - - while (index < imageSize) - { - current = stream.GetC(); - - // RLE packet. - if ( current & 0x80 ) - { - // Get the run length of the packet. - current &= 0x7f; - - current++; - - length = current; - - index += current * pixelSize; - - // Repeat the pixel length times. - stream.Read(buf, pixelSize); - - for (unsigned int i = 0; i < length; i++) - { - memcpy(imageData, buf, pixelSize); - - imageData += pixelSize; - } - } - else // Raw packet. - { - // Get the run length of the packet. - current++; - - length = current * pixelSize; - - index += length; - - // Write the next length pixels directly to the image data. - stream.Read(imageData, length); - - imageData += length; - } - } -} - -static -int ReadTGA(wxImage* image, wxInputStream& stream) -{ - // Read in the TGA header - unsigned char hdr[HDR_SIZE]; - stream.Read(hdr, HDR_SIZE); - - short offset = hdr[HDR_OFFSET] + HDR_SIZE; - short colorType = hdr[HDR_COLORTYPE]; - short imageType = hdr[HDR_IMAGETYPE]; - int paletteLength = hdr[HDR_PALETTELENGTH] + 256 * hdr[HDR_PALETTELENGTH + 1]; - int width = (hdr[HDR_WIDTH] + 256 * hdr[HDR_WIDTH + 1]) - - (hdr[HDR_XORIGIN] + 256 * hdr[HDR_XORIGIN + 1]); - int height = (hdr[HDR_HEIGHT] + 256 * hdr[HDR_HEIGHT + 1]) - - (hdr[HDR_YORIGIN] + 256 * hdr[HDR_YORIGIN + 1]); - short bpp = hdr[HDR_BPP]; - short orientation = hdr[HDR_ORIENTATION] & 0x20; - - image->Create(width, height); - - if (!image->Ok()) - { - return wxTGA_MEMERR; - } - - const short pixelSize = bpp / 8; - - const unsigned long imageSize = width * height * pixelSize; - - unsigned char *imageData = (unsigned char* )malloc(imageSize); - - if (!imageData) - { - return wxTGA_MEMERR; - } - - wxON_BLOCK_EXIT1(free, imageData); - - unsigned char *dst = image->GetData(); - - unsigned char* alpha = NULL; - if (bpp == 16 || bpp == 32) - { - image->SetAlpha(); - - alpha = image->GetAlpha(); - } - - // Seek from the offset we got from the TGA header. - stream.SeekI(offset, wxFromStart); - - // Load a palette if we have one. - if (colorType == wxTGA_MAPPED) - { - unsigned char buf[3]; - - unsigned char* r = new unsigned char[paletteLength]; - unsigned char* g = new unsigned char[paletteLength]; - unsigned char* b = new unsigned char[paletteLength]; - - for (int i = 0; i < paletteLength; i++) - { - stream.Read(buf, 3); - - r[i] = buf[2]; - g[i] = buf[1]; - b[i] = buf[0]; - } - -#if wxUSE_PALETTE - // Set the palette of the image. - image->SetPalette(wxPalette(paletteLength, r, g, b)); -#endif // wxUSE_PALETTE - - delete[] r; - delete[] g; - delete[] b; - } - - // Handle the various TGA formats we support. - - switch (imageType) - { -#if wxUSE_PALETTE - // Raw indexed. - - case 1: - { - const wxPalette& palette = image->GetPalette(); - unsigned char r; - unsigned char g; - unsigned char b; - - // No compression read the data directly to imageData. - - stream.Read(imageData, imageSize); - - // If orientation == 0, then the image is stored upside down. - // We need to store it right side up. - - if (orientation == 0) - { - FlipTGA(imageData, width, height, pixelSize); - } - - // Handle the different pixel depths. - - switch (bpp) - { - // 8 bpp. - - case 8: - { - for (unsigned long index = 0; index < imageSize; index += pixelSize) - { - palette.GetRGB(imageData[index], &r, &g, &b); - - *(dst++) = r; - *(dst++) = g; - *(dst++) = b; - } - } - break; - - // 16 bpp. - - case 16: - { - for (unsigned long index = 0; index < imageSize; index += pixelSize) - { - palette.GetRGB(imageData[index], &r, &g, &b); - - *(dst++) = r; - *(dst++) = g; - *(dst++) = b; - *(alpha++) = (imageData[index + 1] & 0x80) ? 0 : 255; - } - } - break; - - default: - return wxTGA_INVFORMAT; - } - } - break; -#endif // wxUSE_PALETTE - - // Raw RGB. - - case 2: - { - // No compression read the data directly to imageData. - - stream.Read(imageData, imageSize); - - // If orientation == 0, then the image is stored upside down. - // We need to store it right side up. - - if (orientation == 0) - { - FlipTGA(imageData, width, height, pixelSize); - } - - // Handle the different pixel depths. - - switch (bpp) - { - //16 bpp. - - case 16: - { - unsigned char temp; - - for (unsigned long index = 0; index < imageSize; index += pixelSize) - { - temp = (imageData[index + 1] & 0x7c) << 1; - temp |= temp >> 5; - *(dst++) = temp; - - temp = ((imageData[index + 1] & 0x03) << 6) | ((imageData[index] & 0xe0) >> 2); - temp |= temp >> 5; - *(dst++) = temp; - - temp = (imageData[index] & 0x1f) << 3; - temp |= temp >> 5; - *(dst++) = temp; - - *(alpha++) = (imageData[index + 1] & 0x80) ? 0 : 255; - } - } - break; - - // 24 bpp. - - case 24: - { - for (unsigned long index = 0; index < imageSize; index += pixelSize) - { - *(dst++) = imageData[index + 2]; - *(dst++) = imageData[index + 1]; - *(dst++) = imageData[index]; - } - } - break; - - // 32 bpp. - - case 32: - { - for (unsigned long index = 0; index < imageSize; index += pixelSize) - { - *(dst++) = imageData[index + 2]; - *(dst++) = imageData[index + 1]; - *(dst++) = imageData[index]; - *(alpha++) = imageData[index + 3]; - } - } - break; - - default: - return wxTGA_INVFORMAT; - } - } - break; - - // Raw grayscale. - - case 3: - { - // No compression read the data directly to imageData. - - stream.Read(imageData, imageSize); - - // If orientation == 0, then the image is stored upside down. - // We need to store it right side up. - - if (orientation == 0) - { - FlipTGA(imageData, width, height, pixelSize); - } - - // Handle the different pixel depths. - - switch (bpp) - { - // 8 bpp. - - case 8: - { - for (unsigned long index = 0; index < imageSize; index += pixelSize) - { - *(dst++) = imageData[index]; - *(dst++) = imageData[index]; - *(dst++) = imageData[index]; - } - } - break; - - // 16 bpp. - - case 16: - { - for (unsigned long index = 0; index < imageSize; index += pixelSize) - { - *(dst++) = imageData[index]; - *(dst++) = imageData[index]; - *(dst++) = imageData[index]; - *(alpha++) = imageData[index + 1]; - } - } - break; - - default: - return wxTGA_INVFORMAT; - } - } - break; - -#if wxUSE_PALETTE - // RLE indexed. - - case 9: - { - const wxPalette& palette = image->GetPalette(); - unsigned char r; - unsigned char g; - unsigned char b; - - // Decode the RLE data. - - DecodeRLE(imageData, imageSize, pixelSize, stream); - - // If orientation == 0, then the image is stored upside down. - // We need to store it right side up. - - if (orientation == 0) - { - FlipTGA(imageData, width, height, pixelSize); - } - - // Handle the different pixel depths. - - switch (bpp) - { - // 8 bpp. - - case 8: - { - for (unsigned long index = 0; index < imageSize; index += pixelSize) - { - palette.GetRGB(imageData[index], &r, &g, &b); - - *(dst++) = r; - *(dst++) = g; - *(dst++) = b; - } - } - break; - - // 16 bpp. - - case 16: - { - for (unsigned long index = 0; index < imageSize; index += pixelSize) - { - palette.GetRGB(imageData[index], &r, &g, &b); - - *(dst++) = r; - *(dst++) = g; - *(dst++) = b; - *(alpha++) = (imageData[index + 1] & 0x80) ? 0 : 255; - } - } - break; - - default: - return wxTGA_INVFORMAT; - } - } - break; -#endif // wxUSE_PALETTE - - // RLE RGB. - - case 10: - { - // Decode the RLE data. - - DecodeRLE(imageData, imageSize, pixelSize, stream); - - // If orientation == 0, then the image is stored upside down. - // We need to store it right side up. - - if (orientation == 0) - { - FlipTGA(imageData, width, height, pixelSize); - } - - // Handle the different pixel depths. - - switch (bpp) - { - //16 bpp. - - case 16: - { - unsigned char temp; - - for (unsigned long index = 0; index < imageSize; index += pixelSize) - { - temp = (imageData[index + 1] & 0x7c) << 1; - temp |= temp >> 5; - *(dst++) = temp; - - temp = ((imageData[index + 1] & 0x03) << 6) | ((imageData[index] & 0xe0) >> 2); - temp |= temp >> 5; - *(dst++) = temp; - - temp = (imageData[index] & 0x1f) << 3; - temp |= temp >> 5; - *(dst++) = temp; - - *(alpha++) = (imageData[index + 1] & 0x80) ? 0 : 255; - } - } - break; - - // 24 bpp. - - case 24: - { - for (unsigned long index = 0; index < imageSize; index += pixelSize) - { - *(dst++) = imageData[index + 2]; - *(dst++) = imageData[index + 1]; - *(dst++) = imageData[index]; - } - } - break; - - // 32 bpp. - - case 32: - { - for (unsigned long index = 0; index < imageSize; index += pixelSize) - { - *(dst++) = imageData[index + 2]; - *(dst++) = imageData[index + 1]; - *(dst++) = imageData[index]; - *(alpha++) = imageData[index + 3]; - } - } - break; - - default: - return wxTGA_INVFORMAT; - } - } - break; - - // RLE grayscale. - - case 11: - { - // Decode the RLE data. - - DecodeRLE(imageData, imageSize, pixelSize, stream); - - // If orientation == 0, then the image is stored upside down. - // We need to store it right side up. - - if (orientation == 0) - { - FlipTGA(imageData, width, height, pixelSize); - } - - // Handle the different pixel depths. - - switch (bpp) - { - // 8 bpp. - - case 8: - { - for (unsigned long index = 0; index < imageSize; index += pixelSize) - { - *(dst++) = imageData[index]; - *(dst++) = imageData[index]; - *(dst++) = imageData[index]; - } - } - break; - - // 16 bpp. - - case 16: - { - for (unsigned long index = 0; index < imageSize; index += pixelSize) - { - *(dst++) = imageData[index]; - *(dst++) = imageData[index]; - *(dst++) = imageData[index]; - *(alpha++) = imageData[index + 1]; - } - } - break; - - default: - return wxTGA_INVFORMAT; - } - } - break; - - default: - return wxTGA_INVFORMAT; - } - - return wxTGA_OK; -} - -static -int SaveTGA(wxImage* WXUNUSED(image), wxOutputStream& WXUNUSED(stream)) -{ - wxLogError(wxT("Saving in TGA format is not implemented.")); - - return wxTGA_OK; -} - -// ---------------------------------------------------------------------------- -// wxTGAHandler -// ---------------------------------------------------------------------------- - -bool wxTGAHandler::LoadFile(wxImage* image, - wxInputStream& stream, - bool verbose, - int WXUNUSED(index)) -{ - if ( !CanRead(stream) ) - { - if ( verbose ) - wxLogError(wxT("TGA: this is not a TGA file.")); - - return false; - } - - image->Destroy(); - - int error = ReadTGA(image, stream); - if ( error != wxTGA_OK ) - { - if ( verbose ) - { - switch ( error ) - { - case wxTGA_INVFORMAT: - wxLogError(wxT("TGA: image format unsupported.")); - break; - - case wxTGA_MEMERR: - wxLogError(wxT("TGA: couldn't allocate memory.")); - break; - - default: - wxLogError(wxT("TGA: unknown error!")); - } - } - - image->Destroy(); - - return false; - } - - return true; -} - -bool wxTGAHandler::SaveFile(wxImage* image, wxOutputStream& stream, bool verbose) -{ - int error = SaveTGA(image, stream); - - if ( error != wxTGA_OK ) - { - if ( verbose ) - { - switch ( error ) - { - case wxTGA_INVFORMAT: - wxLogError(wxT("TGA: invalid image.")); - break; - - case wxTGA_MEMERR: - wxLogError(wxT("TGA: couldn't allocate memory.")); - break; - - default: - wxLogError(wxT("TGA: unknown error!")); - } - } - - return false; - } - - return true; -} - -bool wxTGAHandler::DoCanRead(wxInputStream& stream) -{ - // read the fixed-size TGA headers - unsigned char hdr[HDR_SIZE]; - stream.Read(hdr, HDR_SIZE); - - // Check wether we can read the file or not. - - short colorType = hdr[HDR_COLORTYPE]; - if ( colorType != wxTGA_UNMAPPED && colorType != wxTGA_MAPPED ) - { - return false; - } - - short imageType = hdr[HDR_IMAGETYPE]; - if ( imageType == 0 || imageType == 32 || imageType == 33 ) - { - return false; - } - - short bpp = hdr[HDR_BPP]; - if ( bpp != 8 && bpp != 16 && bpp != 24 && bpp != 32 ) - { - return false; - } - - return true; -} - -#endif // wxUSE_STREAMS - -#endif // wxUSE_IMAGE && wxUSE_TGA diff --git a/wxWidgets/src/common/imagtiff.cpp b/wxWidgets/src/common/imagtiff.cpp deleted file mode 100644 index 7a48cf51c0..0000000000 --- a/wxWidgets/src/common/imagtiff.cpp +++ /dev/null @@ -1,525 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/common/imagtiff.cpp -// Purpose: wxImage TIFF handler -// Author: Robert Roebling -// RCS-ID: $Id: imagtiff.cpp 60897 2009-06-04 22:28:48Z VZ $ -// Copyright: (c) Robert Roebling -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_IMAGE && wxUSE_LIBTIFF - -#include "wx/imagtiff.h" - -#ifndef WX_PRECOMP - #include "wx/log.h" - #include "wx/app.h" - #include "wx/intl.h" - #include "wx/bitmap.h" - #include "wx/module.h" -#endif - -extern "C" -{ - #include "tiff.h" - #include "tiffio.h" -} -#include "wx/filefn.h" -#include "wx/wfstream.h" - -#ifndef TIFFLINKAGEMODE - #if defined(__WATCOMC__) && defined(__WXMGL__) - #define TIFFLINKAGEMODE cdecl - #else - #define TIFFLINKAGEMODE LINKAGEMODE - #endif -#endif - -//----------------------------------------------------------------------------- -// wxTIFFHandler -//----------------------------------------------------------------------------- - -IMPLEMENT_DYNAMIC_CLASS(wxTIFFHandler,wxImageHandler) - -#if wxUSE_STREAMS - -// helper to translate our, possibly 64 bit, wxFileOffset to TIFF, always 32 -// bit, toff_t -static toff_t wxFileOffsetToTIFF(wxFileOffset ofs) -{ - if ( ofs == wxInvalidOffset ) - return (toff_t)-1; - - toff_t tofs = wx_truncate_cast(toff_t, ofs); - wxCHECK_MSG( (wxFileOffset)tofs == ofs, (toff_t)-1, - _T("TIFF library doesn't support large files") ); - - return tofs; -} - -// another helper to convert standard seek mode to our -static wxSeekMode wxSeekModeFromTIFF(int whence) -{ - switch ( whence ) - { - case SEEK_SET: - return wxFromStart; - - case SEEK_CUR: - return wxFromCurrent; - - case SEEK_END: - return wxFromEnd; - - default: - return wxFromCurrent; - } -} - -extern "C" -{ - -tsize_t TIFFLINKAGEMODE -wxTIFFNullProc(thandle_t WXUNUSED(handle), - tdata_t WXUNUSED(buf), - tsize_t WXUNUSED(size)) -{ - return (tsize_t) -1; -} - -tsize_t TIFFLINKAGEMODE -wxTIFFReadProc(thandle_t handle, tdata_t buf, tsize_t size) -{ - wxInputStream *stream = (wxInputStream*) handle; - stream->Read( (void*) buf, (size_t) size ); - return wx_truncate_cast(tsize_t, stream->LastRead()); -} - -tsize_t TIFFLINKAGEMODE -wxTIFFWriteProc(thandle_t handle, tdata_t buf, tsize_t size) -{ - wxOutputStream *stream = (wxOutputStream*) handle; - stream->Write( (void*) buf, (size_t) size ); - return wx_truncate_cast(tsize_t, stream->LastWrite()); -} - -toff_t TIFFLINKAGEMODE -wxTIFFSeekIProc(thandle_t handle, toff_t off, int whence) -{ - wxInputStream *stream = (wxInputStream*) handle; - - return wxFileOffsetToTIFF(stream->SeekI((wxFileOffset)off, - wxSeekModeFromTIFF(whence))); -} - -toff_t TIFFLINKAGEMODE -wxTIFFSeekOProc(thandle_t handle, toff_t off, int whence) -{ - wxOutputStream *stream = (wxOutputStream*) handle; - - return wxFileOffsetToTIFF(stream->SeekO((wxFileOffset)off, - wxSeekModeFromTIFF(whence))); -} - -int TIFFLINKAGEMODE -wxTIFFCloseIProc(thandle_t WXUNUSED(handle)) -{ - // there is no need to close the input stream - return 0; -} - -int TIFFLINKAGEMODE -wxTIFFCloseOProc(thandle_t handle) -{ - wxOutputStream *stream = (wxOutputStream*) handle; - - return stream->Close() ? 0 : -1; -} - -toff_t TIFFLINKAGEMODE -wxTIFFSizeProc(thandle_t handle) -{ - wxStreamBase *stream = (wxStreamBase*) handle; - return (toff_t) stream->GetSize(); -} - -int TIFFLINKAGEMODE -wxTIFFMapProc(thandle_t WXUNUSED(handle), - tdata_t* WXUNUSED(pbase), - toff_t* WXUNUSED(psize)) -{ - return 0; -} - -void TIFFLINKAGEMODE -wxTIFFUnmapProc(thandle_t WXUNUSED(handle), - tdata_t WXUNUSED(base), - toff_t WXUNUSED(size)) -{ -} - -static void -TIFFwxWarningHandler(const char* module, - const char* WXUNUSED_IN_UNICODE(fmt), - va_list WXUNUSED_IN_UNICODE(ap)) -{ - if (module != NULL) - wxLogWarning(_("tiff module: %s"), wxString::FromAscii(module).c_str()); - - // FIXME: this is not terrible informative but better than crashing! -#if wxUSE_UNICODE - wxLogWarning(_("TIFF library warning.")); -#else - wxVLogWarning(fmt, ap); -#endif -} - -static void -TIFFwxErrorHandler(const char* module, - const char* WXUNUSED_IN_UNICODE(fmt), - va_list WXUNUSED_IN_UNICODE(ap)) -{ - if (module != NULL) - wxLogError(_("tiff module: %s"), wxString::FromAscii(module).c_str()); - - // FIXME: as above -#if wxUSE_UNICODE - wxLogError(_("TIFF library error.")); -#else - wxVLogError(fmt, ap); -#endif -} - -} // extern "C" - -TIFF* -TIFFwxOpen(wxInputStream &stream, const char* name, const char* mode) -{ - TIFF* tif = TIFFClientOpen(name, mode, - (thandle_t) &stream, - wxTIFFReadProc, wxTIFFNullProc, - wxTIFFSeekIProc, wxTIFFCloseIProc, wxTIFFSizeProc, - wxTIFFMapProc, wxTIFFUnmapProc); - - return tif; -} - -TIFF* -TIFFwxOpen(wxOutputStream &stream, const char* name, const char* mode) -{ - TIFF* tif = TIFFClientOpen(name, mode, - (thandle_t) &stream, - wxTIFFNullProc, wxTIFFWriteProc, - wxTIFFSeekOProc, wxTIFFCloseOProc, wxTIFFSizeProc, - wxTIFFMapProc, wxTIFFUnmapProc); - - return tif; -} - -wxTIFFHandler::wxTIFFHandler() -{ - m_name = wxT("TIFF file"); - m_extension = wxT("tif"); - m_type = wxBITMAP_TYPE_TIF; - m_mime = wxT("image/tiff"); - TIFFSetWarningHandler((TIFFErrorHandler) TIFFwxWarningHandler); - TIFFSetErrorHandler((TIFFErrorHandler) TIFFwxErrorHandler); -} - -bool wxTIFFHandler::LoadFile( wxImage *image, wxInputStream& stream, bool verbose, int index ) -{ - if (index == -1) - index = 0; - - image->Destroy(); - - TIFF *tif = TIFFwxOpen( stream, "image", "r" ); - - if (!tif) - { - if (verbose) - wxLogError( _("TIFF: Error loading image.") ); - - return false; - } - - if (!TIFFSetDirectory( tif, (tdir_t)index )) - { - if (verbose) - wxLogError( _("Invalid TIFF image index.") ); - - TIFFClose( tif ); - - return false; - } - - uint32 w, h; - uint32 *raster; - - TIFFGetField( tif, TIFFTAG_IMAGEWIDTH, &w ); - TIFFGetField( tif, TIFFTAG_IMAGELENGTH, &h ); - - uint16 extraSamples; - uint16* samplesInfo; - TIFFGetFieldDefaulted(tif, TIFFTAG_EXTRASAMPLES, - &extraSamples, &samplesInfo); - const bool hasAlpha = (extraSamples == 1 && - (samplesInfo[0] == EXTRASAMPLE_ASSOCALPHA || - samplesInfo[0] == EXTRASAMPLE_UNASSALPHA)); - - // guard against integer overflow during multiplication which could result - // in allocating a too small buffer and then overflowing it - const double bytesNeeded = (double)w * (double)h * sizeof(uint32); - if ( bytesNeeded >= 4294967295U /* UINT32_MAX */ ) - { - if ( verbose ) - wxLogError( _("TIFF: Image size is abnormally big.") ); - - TIFFClose(tif); - - return false; - } - - raster = (uint32*) _TIFFmalloc( bytesNeeded ); - - if (!raster) - { - if (verbose) - wxLogError( _("TIFF: Couldn't allocate memory.") ); - - TIFFClose( tif ); - - return false; - } - - image->Create( (int)w, (int)h ); - if (!image->Ok()) - { - if (verbose) - wxLogError( _("TIFF: Couldn't allocate memory.") ); - - _TIFFfree( raster ); - TIFFClose( tif ); - - return false; - } - - if ( hasAlpha ) - image->SetAlpha(); - - if (!TIFFReadRGBAImage( tif, w, h, raster, 0 )) - { - if (verbose) - wxLogError( _("TIFF: Error reading image.") ); - - _TIFFfree( raster ); - image->Destroy(); - TIFFClose( tif ); - - return false; - } - - unsigned char *ptr = image->GetData(); - ptr += w*3*(h-1); - - unsigned char *alpha = hasAlpha ? image->GetAlpha() : NULL; - if ( hasAlpha ) - alpha += w*(h-1); - - uint32 pos = 0; - - for (uint32 i = 0; i < h; i++) - { - for (uint32 j = 0; j < w; j++) - { - *(ptr++) = (unsigned char)TIFFGetR(raster[pos]); - *(ptr++) = (unsigned char)TIFFGetG(raster[pos]); - *(ptr++) = (unsigned char)TIFFGetB(raster[pos]); - if ( hasAlpha ) - *(alpha++) = (unsigned char)TIFFGetA(raster[pos]); - - pos++; - } - - // subtract line we just added plus one line: - ptr -= 2*w*3; - if ( hasAlpha ) - alpha -= 2*w; - } - - _TIFFfree( raster ); - - TIFFClose( tif ); - - return true; -} - -int wxTIFFHandler::GetImageCount( wxInputStream& stream ) -{ - TIFF *tif = TIFFwxOpen( stream, "image", "r" ); - - if (!tif) - return 0; - - int dircount = 0; // according to the libtiff docs, dircount should be set to 1 here??? - do { - dircount++; - } while (TIFFReadDirectory(tif)); - - TIFFClose( tif ); - - return dircount; -} - -bool wxTIFFHandler::SaveFile( wxImage *image, wxOutputStream& stream, bool verbose ) -{ - TIFF *tif = TIFFwxOpen( stream, "image", "w" ); - - if (!tif) - { - if (verbose) - wxLogError( _("TIFF: Error saving image.") ); - - return false; - } - - TIFFSetField(tif, TIFFTAG_ORIENTATION, ORIENTATION_TOPLEFT); - TIFFSetField(tif, TIFFTAG_IMAGEWIDTH, (uint32)image->GetWidth()); - TIFFSetField(tif, TIFFTAG_IMAGELENGTH, (uint32)image->GetHeight()); - TIFFSetField(tif, TIFFTAG_ORIENTATION, ORIENTATION_TOPLEFT); - TIFFSetField(tif, TIFFTAG_PLANARCONFIG, PLANARCONFIG_CONTIG); - - if ( image->HasOption(wxIMAGE_OPTION_RESOLUTIONX) && - image->HasOption(wxIMAGE_OPTION_RESOLUTIONY) ) - { - TIFFSetField(tif, TIFFTAG_XRESOLUTION, - (float)image->GetOptionInt(wxIMAGE_OPTION_RESOLUTIONX)); - TIFFSetField(tif, TIFFTAG_YRESOLUTION, - (float)image->GetOptionInt(wxIMAGE_OPTION_RESOLUTIONY)); - } - - int spp = image->GetOptionInt(wxIMAGE_OPTION_SAMPLESPERPIXEL); - if ( !spp ) - spp = 3; - - int bpp = image->GetOptionInt(wxIMAGE_OPTION_BITSPERSAMPLE); - if ( !bpp ) - bpp=8; - - int compression = image->GetOptionInt(wxIMAGE_OPTION_COMPRESSION); - if ( !compression ) - { - // we can't use COMPRESSION_LZW because current version of libtiff - // doesn't implement it ("no longer implemented due to Unisys patent - // enforcement") and other compression methods are lossy so we - // shouldn't use them by default -- and the only remaining one is none - compression = COMPRESSION_NONE; - } - - TIFFSetField(tif, TIFFTAG_SAMPLESPERPIXEL, spp); - TIFFSetField(tif, TIFFTAG_BITSPERSAMPLE, bpp); - TIFFSetField(tif, TIFFTAG_PHOTOMETRIC, spp*bpp == 1 ? PHOTOMETRIC_MINISBLACK - : PHOTOMETRIC_RGB); - TIFFSetField(tif, TIFFTAG_COMPRESSION, compression); - - // scanlinesize if determined by spp and bpp - tsize_t linebytes = (tsize_t)image->GetWidth() * spp * bpp / 8; - - if ( (image->GetWidth() % 8 > 0) && (spp * bpp < 8) ) - linebytes+=1; - - unsigned char *buf; - - if (TIFFScanlineSize(tif) > linebytes || (spp * bpp < 24)) - { - buf = (unsigned char *)_TIFFmalloc(TIFFScanlineSize(tif)); - if (!buf) - { - if (verbose) - wxLogError( _("TIFF: Couldn't allocate memory.") ); - - TIFFClose( tif ); - - return false; - } - } - else - { - buf = NULL; - } - - TIFFSetField(tif, TIFFTAG_ROWSPERSTRIP,TIFFDefaultStripSize(tif, (uint32) -1)); - - unsigned char *ptr = image->GetData(); - for ( int row = 0; row < image->GetHeight(); row++ ) - { - if ( buf ) - { - if ( spp * bpp > 1 ) - { - // color image - memcpy(buf, ptr, image->GetWidth()); - } - else // black and white image - { - for ( int column = 0; column < linebytes; column++ ) - { - uint8 reverse = 0; - for ( int bp = 0; bp < 8; bp++ ) - { - if ( ptr[column*24 + bp*3] > 0 ) - { - // check only red as this is sufficient - reverse = (uint8)(reverse | 128 >> bp); - } - } - - buf[column] = reverse; - } - } - } - - if ( TIFFWriteScanline(tif, buf ? buf : ptr, (uint32)row, 0) < 0 ) - { - if (verbose) - wxLogError( _("TIFF: Error writing image.") ); - - TIFFClose( tif ); - if (buf) - _TIFFfree(buf); - - return false; - } - - ptr += image->GetWidth()*3; - } - - (void) TIFFClose(tif); - - if (buf) - _TIFFfree(buf); - - return true; -} - -bool wxTIFFHandler::DoCanRead( wxInputStream& stream ) -{ - unsigned char hdr[2]; - - if ( !stream.Read(&hdr[0], WXSIZEOF(hdr)) ) - return false; - - return (hdr[0] == 'I' && hdr[1] == 'I') || - (hdr[0] == 'M' && hdr[1] == 'M'); -} - -#endif // wxUSE_STREAMS - -#endif // wxUSE_LIBTIFF diff --git a/wxWidgets/src/common/imagxpm.cpp b/wxWidgets/src/common/imagxpm.cpp deleted file mode 100644 index 8ef328cf2f..0000000000 --- a/wxWidgets/src/common/imagxpm.cpp +++ /dev/null @@ -1,224 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/common/imagxpm.cpp -// Purpose: wxXPMHandler -// Author: Vaclav Slavik, Robert Roebling -// RCS-ID: $Id: imagxpm.cpp 53477 2008-05-07 07:28:57Z JS $ -// Copyright: (c) 2001 Vaclav Slavik -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -/* - -This file is partially based on source code of ImageMagick by John Cristy. Its -license is as follows: - -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% % -% % -% % -% X X PPPP M M % -% X X P P MM MM % -% X PPPP M M M % -% X X P M M % -% X X P M M % -% % -% % -% Read/Write ImageMagick Image Format. % -% % -% % -% Software Design % -% John Cristy % -% July 1992 % -% % -% % -% Copyright (C) 2001 ImageMagick Studio, a non-profit organization dedicated % -% to making software imaging solutions freely available. % -% % -% Permission is hereby granted, free of charge, to any person obtaining a % -% copy of this software and associated documentation files ("ImageMagick"), % -% to deal in ImageMagick without restriction, including without limitation % -% the rights to use, copy, modify, merge, publish, distribute, sublicense, % -% and/or sell copies of ImageMagick, and to permit persons to whom the % -% ImageMagick is furnished to do so, subject to the following conditions: % -% % -% The above copyright notice and this permission notice shall be included in % -% all copies or substantial portions of ImageMagick. % -% % -% The software is provided "as is", without warranty of any kind, express or % -% implied, including but not limited to the warranties of merchantability, % -% fitness for a particular purpose and noninfringement. In no event shall % -% ImageMagick Studio be liable for any claim, damages or other liability, % -% whether in an action of contract, tort or otherwise, arising from, out of % -% or in connection with ImageMagick or the use or other dealings in % -% ImageMagick. % -% % -% Except as contained in this notice, the name of the ImageMagick Studio % -% shall not be used in advertising or otherwise to promote the sale, use or % -% other dealings in ImageMagick without prior written authorization from the % -% ImageMagick Studio. % -% % -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% -% -*/ - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_XPM - -#ifndef WX_PRECOMP - #include "wx/log.h" - #include "wx/intl.h" - #include "wx/utils.h" -#endif - -#include "wx/imagxpm.h" -#include "wx/wfstream.h" -#include "wx/xpmdecod.h" - -IMPLEMENT_DYNAMIC_CLASS(wxXPMHandler,wxImageHandler) - -//----------------------------------------------------------------------------- -// wxXPMHandler -//----------------------------------------------------------------------------- - -#if wxUSE_STREAMS - -bool wxXPMHandler::LoadFile(wxImage *image, - wxInputStream& stream, - bool WXUNUSED(verbose), int WXUNUSED(index)) -{ - wxXPMDecoder decoder; - - wxImage img = decoder.ReadFile(stream); - if ( !img.Ok() ) - return false; - *image = img; - return true; -} - -bool wxXPMHandler::SaveFile(wxImage * image, - wxOutputStream& stream, bool WXUNUSED(verbose)) -{ - // 1. count colours: - #define MaxCixels 92 - static const char Cixel[MaxCixels+1] = - " .XoO+@#$%&*=-;:>,<1234567890qwertyuipasdfghjk" - "lzxcvbnmMNBVCZASDFGHJKLPIUYTREWQ!~^/()_`'][{}|"; - int i, j, k; - - wxImageHistogram histogram; - int cols = int(image->ComputeHistogram(histogram)); - - int chars_per_pixel = 1; - for ( k = MaxCixels; cols > k; k *= MaxCixels) - chars_per_pixel++; - - // 2. write the header: - wxString sName; - if ( image->HasOption(wxIMAGE_OPTION_FILENAME) ) - { - wxSplitPath(image->GetOption(wxIMAGE_OPTION_FILENAME), - NULL, &sName, NULL); - sName << wxT("_xpm"); - } - - if ( !sName.empty() ) - sName = wxString(wxT("/* XPM */\nstatic const char *")) + sName; - else - sName = wxT("/* XPM */\nstatic const char *xpm_data"); - stream.Write( (const char*) sName.ToAscii(), sName.Len() ); - - char tmpbuf[200]; - // VS: 200b is safe upper bound for anything produced by sprintf below - // (<101 bytes the string, neither %i can expand into more than 10 chars) - sprintf(tmpbuf, - "[] = {\n" - "/* columns rows colors chars-per-pixel */\n" - "\"%i %i %i %i\",\n", - image->GetWidth(), image->GetHeight(), cols, chars_per_pixel); - stream.Write(tmpbuf, strlen(tmpbuf)); - - // 3. create color symbols table: - char *symbols_data = new char[cols * (chars_per_pixel+1)]; - char **symbols = new char*[cols]; - - // 2a. find mask colour: - unsigned long mask_key = 0x1000000 /*invalid RGB value*/; - if (image->HasMask()) - mask_key = (image->GetMaskRed() << 16) | - (image->GetMaskGreen() << 8) | image->GetMaskBlue(); - - // 2b. generate colour table: - for (wxImageHistogram::iterator entry = histogram.begin(); - entry != histogram.end(); ++entry ) - { - unsigned long index = entry->second.index; - symbols[index] = symbols_data + index * (chars_per_pixel+1); - char *sym = symbols[index]; - - for (j = 0; j < chars_per_pixel; j++) - { - sym[j] = Cixel[index % MaxCixels]; - index /= MaxCixels; - } - sym[j] = '\0'; - - unsigned long key = entry->first; - - if (key == 0) - sprintf( tmpbuf, "\"%s c Black\",\n", sym); - else if (key == mask_key) - sprintf( tmpbuf, "\"%s c None\",\n", sym); - else - { - wxByte r = wxByte(key >> 16); - wxByte g = wxByte(key >> 8); - wxByte b = wxByte(key); - sprintf(tmpbuf, "\"%s c #%02X%02X%02X\",\n", sym, r, g, b); - } - stream.Write( tmpbuf, strlen(tmpbuf) ); - } - - stream.Write("/* pixels */\n", 13); - - unsigned char *data = image->GetData(); - for (j = 0; j < image->GetHeight(); j++) - { - char tmp_c; - tmp_c = '\"'; stream.Write(&tmp_c, 1); - for (i = 0; i < image->GetWidth(); i++, data += 3) - { - unsigned long key = (data[0] << 16) | (data[1] << 8) | (data[2]); - stream.Write(symbols[histogram[key].index], chars_per_pixel); - } - tmp_c = '\"'; stream.Write(&tmp_c, 1); - if ( j + 1 < image->GetHeight() ) - { - tmp_c = ','; stream.Write(&tmp_c, 1); - } - tmp_c = '\n'; stream.Write(&tmp_c, 1); - } - stream.Write("};\n", 3 ); - - // Clean up: - delete[] symbols; - delete[] symbols_data; - - return true; -} - -bool wxXPMHandler::DoCanRead(wxInputStream& stream) -{ - wxXPMDecoder decoder; - return decoder.CanRead(stream); -} - -#endif // wxUSE_STREAMS - -#endif // wxUSE_XPM diff --git a/wxWidgets/src/common/init.cpp b/wxWidgets/src/common/init.cpp deleted file mode 100644 index 9d68e6abb6..0000000000 --- a/wxWidgets/src/common/init.cpp +++ /dev/null @@ -1,505 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/common/init.cpp -// Purpose: initialisation for the library -// Author: Vadim Zeitlin -// Modified by: -// Created: 04.10.99 -// RCS-ID: $Id: init.cpp 61555 2009-07-30 07:42:54Z VS $ -// Copyright: (c) Vadim Zeitlin -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif //__BORLANDC__ - -#ifndef WX_PRECOMP - #include "wx/app.h" - #include "wx/filefn.h" - #include "wx/log.h" - #include "wx/thread.h" - #include "wx/intl.h" - #include "wx/module.h" -#endif - -#include "wx/init.h" - -#include "wx/ptr_scpd.h" -#include "wx/except.h" - -#if defined(__WXMSW__) && defined(__WXDEBUG__) - #include "wx/msw/msvcrt.h" - - static struct EnableMemLeakChecking - { - EnableMemLeakChecking() - { - // do check for memory leaks on program exit (another useful flag - // is _CRTDBG_DELAY_FREE_MEM_DF which doesn't free deallocated - // memory which may be used to simulate low-memory condition) - wxCrtSetDbgFlag(_CRTDBG_LEAK_CHECK_DF); - } - } gs_enableLeakChecks; -#endif // __WXMSW__ && __WXDEBUG__ - -// ---------------------------------------------------------------------------- -// private classes -// ---------------------------------------------------------------------------- - -// we need a dummy app object if the user doesn't want to create a real one -class wxDummyConsoleApp : public wxAppConsole -{ -public: - wxDummyConsoleApp() { } - - virtual int OnRun() { wxFAIL_MSG( _T("unreachable code") ); return 0; } - - DECLARE_NO_COPY_CLASS(wxDummyConsoleApp) -}; - -// we need a special kind of auto pointer to wxApp which not only deletes the -// pointer it holds in its dtor but also resets the global application pointer -wxDECLARE_SCOPED_PTR(wxAppConsole, wxAppPtrBase) -wxDEFINE_SCOPED_PTR(wxAppConsole, wxAppPtrBase) - -class wxAppPtr : public wxAppPtrBase -{ -public: - wxEXPLICIT wxAppPtr(wxAppConsole *ptr = NULL) : wxAppPtrBase(ptr) { } - ~wxAppPtr() - { - if ( get() ) - { - // the pointer is going to be deleted in the base class dtor, don't - // leave the dangling pointer! - wxApp::SetInstance(NULL); - } - } - - void Set(wxAppConsole *ptr) - { - reset(ptr); - - wxApp::SetInstance(ptr); - } - - DECLARE_NO_COPY_CLASS(wxAppPtr) -}; - -// class to ensure that wxAppBase::CleanUp() is called if our Initialize() -// fails -class wxCallAppCleanup -{ -public: - wxCallAppCleanup(wxAppConsole *app) : m_app(app) { } - ~wxCallAppCleanup() { if ( m_app ) m_app->CleanUp(); } - - void Dismiss() { m_app = NULL; } - -private: - wxAppConsole *m_app; -}; - -// ---------------------------------------------------------------------------- -// private functions -// ---------------------------------------------------------------------------- - -// suppress warnings about unused variables -static inline void Use(void *) { } - -#define WX_SUPPRESS_UNUSED_WARN(x) Use(&x) - -// ---------------------------------------------------------------------------- -// initialization data -// ---------------------------------------------------------------------------- - -static struct InitData -{ - InitData() - { - nInitCount = 0; - -#if wxUSE_UNICODE - argc = 0; - // argv = NULL; -- not even really needed -#endif // wxUSE_UNICODE - } - - // critical section protecting this struct - wxCRIT_SECT_DECLARE_MEMBER(csInit); - - // number of times wxInitialize() was called minus the number of times - // wxUninitialize() was - size_t nInitCount; - -#if wxUSE_UNICODE - int argc; - - // if we receive the command line arguments as ASCII and have to convert - // them to Unicode ourselves (this is the case under Unix but not Windows, - // for example), we remember the converted argv here because we'll have to - // free it when doing cleanup to avoid memory leaks - wchar_t **argv; -#endif // wxUSE_UNICODE - - DECLARE_NO_COPY_CLASS(InitData) -} gs_initData; - -// ============================================================================ -// implementation -// ============================================================================ - -// ---------------------------------------------------------------------------- -// command line arguments ANSI -> Unicode conversion -// ---------------------------------------------------------------------------- - -#if wxUSE_UNICODE - -static void ConvertArgsToUnicode(int argc, char **argv) -{ - gs_initData.argv = new wchar_t *[argc + 1]; - int wargc = 0; - for ( int i = 0; i < argc; i++ ) - { -#ifdef __DARWIN__ - wxWCharBuffer buf(wxConvFileName->cMB2WX(argv[i])); -#else - wxWCharBuffer buf(wxConvLocal.cMB2WX(argv[i])); -#endif - if ( !buf ) - { - wxLogWarning(_("Command line argument %d couldn't be converted to Unicode and will be ignored."), - i); - } - else // converted ok - { - gs_initData.argv[wargc++] = wxStrdup(buf); - } - } - - gs_initData.argc = wargc; - gs_initData.argv[wargc] = NULL; -} - -static void FreeConvertedArgs() -{ - if ( gs_initData.argv ) - { - for ( int i = 0; i < gs_initData.argc; i++ ) - { - free(gs_initData.argv[i]); - } - - delete [] gs_initData.argv; - gs_initData.argv = NULL; - gs_initData.argc = 0; - } -} - -#endif // wxUSE_UNICODE - -// ---------------------------------------------------------------------------- -// start up -// ---------------------------------------------------------------------------- - -// initialization which is always done (not customizable) before wxApp creation -static bool DoCommonPreInit() -{ -#if wxUSE_LOG - // Reset logging in case we were cleaned up and are being reinitialized. - wxLog::DoCreateOnDemand(); - - // install temporary log sink: we can't use wxLogGui before wxApp is - // constructed and if we use wxLogStderr, all messages during - // initialization simply disappear under Windows - // - // note that we will delete this log target below - delete wxLog::SetActiveTarget(new wxLogBuffer); -#endif // wxUSE_LOG - - return true; -} - -// non customizable initialization done after wxApp creation and initialization -static bool DoCommonPostInit() -{ - wxModule::RegisterModules(); - - if ( !wxModule::InitializeModules() ) - { - wxLogError(_("Initialization failed in post init, aborting.")); - return false; - } - - return true; -} - -bool wxEntryStart(int& argc, wxChar **argv) -{ - // do minimal, always necessary, initialization - // -------------------------------------------- - - // initialize wxRTTI - if ( !DoCommonPreInit() ) - { - return false; - } - - - // first of all, we need an application object - // ------------------------------------------- - - // the user might have already created it himself somehow - wxAppPtr app(wxTheApp); - if ( !app.get() ) - { - // if not, he might have used IMPLEMENT_APP() to give us a function to - // create it - wxAppInitializerFunction fnCreate = wxApp::GetInitializerFunction(); - - if ( fnCreate ) - { - // he did, try to create the custom wxApp object - app.Set((*fnCreate)()); - } - } - - if ( !app.get() ) - { - // either IMPLEMENT_APP() was not used at all or it failed -- in any - // case we still need something - app.Set(new wxDummyConsoleApp); - } - - - // wxApp initialization: this can be customized - // -------------------------------------------- - - if ( !app->Initialize(argc, argv) ) - { - return false; - } - - wxCallAppCleanup callAppCleanup(app.get()); - - // for compatibility call the old initialization function too - if ( !app->OnInitGui() ) - return false; - - - // common initialization after wxTheApp creation - // --------------------------------------------- - - if ( !DoCommonPostInit() ) - return false; - - - // prevent the smart pointer from destroying its contents - app.release(); - - // and the cleanup object from doing cleanup - callAppCleanup.Dismiss(); - -#if wxUSE_LOG - // now that we have a valid wxApp (wxLogGui would have crashed if we used - // it before now), we can delete the temporary sink we had created for the - // initialization messages -- the next time logging function is called, the - // sink will be recreated but this time wxAppTraits will be used - delete wxLog::SetActiveTarget(NULL); -#endif // wxUSE_LOG - - return true; -} - -#if wxUSE_UNICODE - -// we provide a wxEntryStart() wrapper taking "char *" pointer too -bool wxEntryStart(int& argc, char **argv) -{ - ConvertArgsToUnicode(argc, argv); - - if ( !wxEntryStart(gs_initData.argc, gs_initData.argv) ) - { - FreeConvertedArgs(); - - return false; - } - - return true; -} - -#endif // wxUSE_UNICODE - -// ---------------------------------------------------------------------------- -// clean up -// ---------------------------------------------------------------------------- - -// cleanup done before destroying wxTheApp -static void DoCommonPreCleanup() -{ -#if wxUSE_LOG - // flush the logged messages if any and install a 'safer' log target: the - // default one (wxLogGui) can't be used after the resources are freed just - // below and the user supplied one might be even more unsafe (using any - // wxWidgets GUI function is unsafe starting from now) - wxLog::DontCreateOnDemand(); - - // this will flush the old messages if any - delete wxLog::SetActiveTarget(new wxLogStderr); -#endif // wxUSE_LOG -} - -// cleanup done after destroying wxTheApp -static void DoCommonPostCleanup() -{ - wxModule::CleanUpModules(); - - // we can't do this in wxApp itself because it doesn't know if argv had - // been allocated -#if wxUSE_UNICODE - FreeConvertedArgs(); -#endif // wxUSE_UNICODE - - // use Set(NULL) and not Get() to avoid creating a message output object on - // demand when we just want to delete it - delete wxMessageOutput::Set(NULL); - -#if wxUSE_LOG - // and now delete the last logger as well - delete wxLog::SetActiveTarget(NULL); -#endif // wxUSE_LOG -} - -void wxEntryCleanup() -{ - DoCommonPreCleanup(); - - - // delete the application object - if ( wxTheApp ) - { - wxTheApp->CleanUp(); - - // reset the global pointer to it to NULL before destroying it as in - // some circumstances this can result in executing the code using - // wxTheApp and using half-destroyed object is no good - wxAppConsole * const app = wxApp::GetInstance(); - wxApp::SetInstance(NULL); - delete app; - } - - - DoCommonPostCleanup(); -} - -// ---------------------------------------------------------------------------- -// wxEntry -// ---------------------------------------------------------------------------- - -// for MSW the real wxEntry is defined in msw/main.cpp -#ifndef __WXMSW__ - #define wxEntryReal wxEntry -#endif // !__WXMSW__ - -int wxEntryReal(int& argc, wxChar **argv) -{ - // library initialization - wxInitializer initializer(argc, argv); - - if ( !initializer.IsOk() ) - { -#if wxUSE_LOG - // flush any log messages explaining why we failed - delete wxLog::SetActiveTarget(NULL); -#endif - return -1; - } - - wxTRY - { - - // app initialization - if ( !wxTheApp->CallOnInit() ) - { - // don't call OnExit() if OnInit() failed - return -1; - } - - // ensure that OnExit() is called if OnInit() had succeeded - class CallOnExit - { - public: - ~CallOnExit() { wxTheApp->OnExit(); } - } callOnExit; - - WX_SUPPRESS_UNUSED_WARN(callOnExit); - - // app execution - return wxTheApp->OnRun(); - } - wxCATCH_ALL( wxTheApp->OnUnhandledException(); return -1; ) -} - -#if wxUSE_UNICODE - -// as with wxEntryStart, we provide an ANSI wrapper -int wxEntry(int& argc, char **argv) -{ - ConvertArgsToUnicode(argc, argv); - - return wxEntry(gs_initData.argc, gs_initData.argv); -} - -#endif // wxUSE_UNICODE - -// ---------------------------------------------------------------------------- -// wxInitialize/wxUninitialize -// ---------------------------------------------------------------------------- - -bool wxInitialize(int argc, wxChar **argv) -{ - wxCRIT_SECT_LOCKER(lockInit, gs_initData.csInit); - - if ( gs_initData.nInitCount++ ) - { - // already initialized - return true; - } - - return wxEntryStart(argc, argv); -} - -#if wxUSE_UNICODE -bool wxInitialize(int argc, char **argv) -{ - wxCRIT_SECT_LOCKER(lockInit, gs_initData.csInit); - - if ( gs_initData.nInitCount++ ) - { - // already initialized - return true; - } - - return wxEntryStart(argc, argv); -} -#endif // wxUSE_UNICODE - -void wxUninitialize() -{ - wxCRIT_SECT_LOCKER(lockInit, gs_initData.csInit); - - if ( --gs_initData.nInitCount == 0 ) - { - wxEntryCleanup(); - } -} diff --git a/wxWidgets/src/common/intl.cpp b/wxWidgets/src/common/intl.cpp deleted file mode 100644 index 60083b7f59..0000000000 --- a/wxWidgets/src/common/intl.cpp +++ /dev/null @@ -1,3784 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/common/intl.cpp -// Purpose: Internationalization and localisation for wxWidgets -// Author: Vadim Zeitlin -// Modified by: Michael N. Filippov -// (2003/09/30 - PluralForms support) -// Created: 29/01/98 -// RCS-ID: $Id: intl.cpp 61340 2009-07-06 21:19:58Z VZ $ -// Copyright: (c) 1998 Vadim Zeitlin -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declaration -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#ifdef __EMX__ -// The following define is needed by Innotek's libc to -// make the definition of struct localeconv available. -#define __INTERNAL_DEFS -#endif - -#if wxUSE_INTL - -#ifndef WX_PRECOMP - #include "wx/dynarray.h" - #include "wx/string.h" - #include "wx/intl.h" - #include "wx/log.h" - #include "wx/utils.h" - #include "wx/app.h" - #include "wx/hashmap.h" - #include "wx/module.h" -#endif // WX_PRECOMP - -#ifndef __WXWINCE__ - #include -#endif - -// standard headers -#include -#include -#ifdef HAVE_LANGINFO_H - #include -#endif - -#ifdef __WIN32__ - #include "wx/msw/private.h" -#elif defined(__UNIX_LIKE__) - #include "wx/fontmap.h" // for CharsetToEncoding() -#endif - -#include "wx/file.h" -#include "wx/filename.h" -#include "wx/tokenzr.h" -#include "wx/fontmap.h" -#include "wx/encconv.h" -#include "wx/ptr_scpd.h" -#include "wx/apptrait.h" -#include "wx/stdpaths.h" - -#if defined(__WXMAC__) - #include "wx/mac/private.h" // includes mac headers -#endif - -#if defined(__DARWIN__) - #include "wx/mac/corefoundation/cfref.h" - #include - #include "wx/mac/corefoundation/cfstring.h" -#endif - -// ---------------------------------------------------------------------------- -// simple types -// ---------------------------------------------------------------------------- - -// this should *not* be wxChar, this type must have exactly 8 bits! -typedef wxUint8 size_t8; -typedef wxUint32 size_t32; - -// ---------------------------------------------------------------------------- -// constants -// ---------------------------------------------------------------------------- - -// magic number identifying the .mo format file -const size_t32 MSGCATALOG_MAGIC = 0x950412de; -const size_t32 MSGCATALOG_MAGIC_SW = 0xde120495; - -// the constants describing the format of lang_LANG locale string -static const size_t LEN_LANG = 2; -static const size_t LEN_SUBLANG = 2; -static const size_t LEN_FULL = LEN_LANG + 1 + LEN_SUBLANG; // 1 for '_' - -#define TRACE_I18N _T("i18n") - -// ---------------------------------------------------------------------------- -// global functions -// ---------------------------------------------------------------------------- - -#ifdef __WXDEBUG__ - -// small class to suppress the translation erros until exit from current scope -class NoTransErr -{ -public: - NoTransErr() { ms_suppressCount++; } - ~NoTransErr() { ms_suppressCount--; } - - static bool Suppress() { return ms_suppressCount > 0; } - -private: - static size_t ms_suppressCount; -}; - -size_t NoTransErr::ms_suppressCount = 0; - -#else // !Debug - -class NoTransErr -{ -public: - NoTransErr() { } - ~NoTransErr() { } -}; - -#endif // Debug/!Debug - -static wxLocale *wxSetLocale(wxLocale *pLocale); - -// helper functions of GetSystemLanguage() -#ifdef __UNIX__ - -// get just the language part -static inline wxString ExtractLang(const wxString& langFull) -{ - return langFull.Left(LEN_LANG); -} - -// get everything else (including the leading '_') -static inline wxString ExtractNotLang(const wxString& langFull) -{ - return langFull.Mid(LEN_LANG); -} - -#endif // __UNIX__ - - -// ---------------------------------------------------------------------------- -// Plural forms parser -// ---------------------------------------------------------------------------- - -/* - Simplified Grammar - -Expression: - LogicalOrExpression '?' Expression ':' Expression - LogicalOrExpression - -LogicalOrExpression: - LogicalAndExpression "||" LogicalOrExpression // to (a || b) || c - LogicalAndExpression - -LogicalAndExpression: - EqualityExpression "&&" LogicalAndExpression // to (a && b) && c - EqualityExpression - -EqualityExpression: - RelationalExpression "==" RelationalExperession - RelationalExpression "!=" RelationalExperession - RelationalExpression - -RelationalExpression: - MultiplicativeExpression '>' MultiplicativeExpression - MultiplicativeExpression '<' MultiplicativeExpression - MultiplicativeExpression ">=" MultiplicativeExpression - MultiplicativeExpression "<=" MultiplicativeExpression - MultiplicativeExpression - -MultiplicativeExpression: - PmExpression '%' PmExpression - PmExpression - -PmExpression: - N - Number - '(' Expression ')' -*/ - -class wxPluralFormsToken -{ -public: - enum Type - { - T_ERROR, T_EOF, T_NUMBER, T_N, T_PLURAL, T_NPLURALS, T_EQUAL, T_ASSIGN, - T_GREATER, T_GREATER_OR_EQUAL, T_LESS, T_LESS_OR_EQUAL, - T_REMINDER, T_NOT_EQUAL, - T_LOGICAL_AND, T_LOGICAL_OR, T_QUESTION, T_COLON, T_SEMICOLON, - T_LEFT_BRACKET, T_RIGHT_BRACKET - }; - Type type() const { return m_type; } - void setType(Type type) { m_type = type; } - // for T_NUMBER only - typedef int Number; - Number number() const { return m_number; } - void setNumber(Number num) { m_number = num; } -private: - Type m_type; - Number m_number; -}; - - -class wxPluralFormsScanner -{ -public: - wxPluralFormsScanner(const char* s); - const wxPluralFormsToken& token() const { return m_token; } - bool nextToken(); // returns false if error -private: - const char* m_s; - wxPluralFormsToken m_token; -}; - -wxPluralFormsScanner::wxPluralFormsScanner(const char* s) : m_s(s) -{ - nextToken(); -} - -bool wxPluralFormsScanner::nextToken() -{ - wxPluralFormsToken::Type type = wxPluralFormsToken::T_ERROR; - while (isspace((unsigned char) *m_s)) - { - ++m_s; - } - if (*m_s == 0) - { - type = wxPluralFormsToken::T_EOF; - } - else if (isdigit((unsigned char) *m_s)) - { - wxPluralFormsToken::Number number = *m_s++ - '0'; - while (isdigit((unsigned char) *m_s)) - { - number = number * 10 + (*m_s++ - '0'); - } - m_token.setNumber(number); - type = wxPluralFormsToken::T_NUMBER; - } - else if (isalpha((unsigned char) *m_s)) - { - const char* begin = m_s++; - while (isalnum((unsigned char) *m_s)) - { - ++m_s; - } - size_t size = m_s - begin; - if (size == 1 && memcmp(begin, "n", size) == 0) - { - type = wxPluralFormsToken::T_N; - } - else if (size == 6 && memcmp(begin, "plural", size) == 0) - { - type = wxPluralFormsToken::T_PLURAL; - } - else if (size == 8 && memcmp(begin, "nplurals", size) == 0) - { - type = wxPluralFormsToken::T_NPLURALS; - } - } - else if (*m_s == '=') - { - ++m_s; - if (*m_s == '=') - { - ++m_s; - type = wxPluralFormsToken::T_EQUAL; - } - else - { - type = wxPluralFormsToken::T_ASSIGN; - } - } - else if (*m_s == '>') - { - ++m_s; - if (*m_s == '=') - { - ++m_s; - type = wxPluralFormsToken::T_GREATER_OR_EQUAL; - } - else - { - type = wxPluralFormsToken::T_GREATER; - } - } - else if (*m_s == '<') - { - ++m_s; - if (*m_s == '=') - { - ++m_s; - type = wxPluralFormsToken::T_LESS_OR_EQUAL; - } - else - { - type = wxPluralFormsToken::T_LESS; - } - } - else if (*m_s == '%') - { - ++m_s; - type = wxPluralFormsToken::T_REMINDER; - } - else if (*m_s == '!' && m_s[1] == '=') - { - m_s += 2; - type = wxPluralFormsToken::T_NOT_EQUAL; - } - else if (*m_s == '&' && m_s[1] == '&') - { - m_s += 2; - type = wxPluralFormsToken::T_LOGICAL_AND; - } - else if (*m_s == '|' && m_s[1] == '|') - { - m_s += 2; - type = wxPluralFormsToken::T_LOGICAL_OR; - } - else if (*m_s == '?') - { - ++m_s; - type = wxPluralFormsToken::T_QUESTION; - } - else if (*m_s == ':') - { - ++m_s; - type = wxPluralFormsToken::T_COLON; - } else if (*m_s == ';') { - ++m_s; - type = wxPluralFormsToken::T_SEMICOLON; - } - else if (*m_s == '(') - { - ++m_s; - type = wxPluralFormsToken::T_LEFT_BRACKET; - } - else if (*m_s == ')') - { - ++m_s; - type = wxPluralFormsToken::T_RIGHT_BRACKET; - } - m_token.setType(type); - return type != wxPluralFormsToken::T_ERROR; -} - -class wxPluralFormsNode; - -// NB: Can't use wxDEFINE_SCOPED_PTR_TYPE because wxPluralFormsNode is not -// fully defined yet: -class wxPluralFormsNodePtr -{ -public: - wxPluralFormsNodePtr(wxPluralFormsNode *p = NULL) : m_p(p) {} - ~wxPluralFormsNodePtr(); - wxPluralFormsNode& operator*() const { return *m_p; } - wxPluralFormsNode* operator->() const { return m_p; } - wxPluralFormsNode* get() const { return m_p; } - wxPluralFormsNode* release(); - void reset(wxPluralFormsNode *p); - -private: - wxPluralFormsNode *m_p; -}; - -class wxPluralFormsNode -{ -public: - wxPluralFormsNode(const wxPluralFormsToken& token) : m_token(token) {} - const wxPluralFormsToken& token() const { return m_token; } - const wxPluralFormsNode* node(size_t i) const - { return m_nodes[i].get(); } - void setNode(size_t i, wxPluralFormsNode* n); - wxPluralFormsNode* releaseNode(size_t i); - wxPluralFormsToken::Number evaluate(wxPluralFormsToken::Number n) const; - -private: - wxPluralFormsToken m_token; - wxPluralFormsNodePtr m_nodes[3]; -}; - -wxPluralFormsNodePtr::~wxPluralFormsNodePtr() -{ - delete m_p; -} -wxPluralFormsNode* wxPluralFormsNodePtr::release() -{ - wxPluralFormsNode *p = m_p; - m_p = NULL; - return p; -} -void wxPluralFormsNodePtr::reset(wxPluralFormsNode *p) -{ - if (p != m_p) - { - delete m_p; - m_p = p; - } -} - - -void wxPluralFormsNode::setNode(size_t i, wxPluralFormsNode* n) -{ - m_nodes[i].reset(n); -} - -wxPluralFormsNode* wxPluralFormsNode::releaseNode(size_t i) -{ - return m_nodes[i].release(); -} - -wxPluralFormsToken::Number -wxPluralFormsNode::evaluate(wxPluralFormsToken::Number n) const -{ - switch (token().type()) - { - // leaf - case wxPluralFormsToken::T_NUMBER: - return token().number(); - case wxPluralFormsToken::T_N: - return n; - // 2 args - case wxPluralFormsToken::T_EQUAL: - return node(0)->evaluate(n) == node(1)->evaluate(n); - case wxPluralFormsToken::T_NOT_EQUAL: - return node(0)->evaluate(n) != node(1)->evaluate(n); - case wxPluralFormsToken::T_GREATER: - return node(0)->evaluate(n) > node(1)->evaluate(n); - case wxPluralFormsToken::T_GREATER_OR_EQUAL: - return node(0)->evaluate(n) >= node(1)->evaluate(n); - case wxPluralFormsToken::T_LESS: - return node(0)->evaluate(n) < node(1)->evaluate(n); - case wxPluralFormsToken::T_LESS_OR_EQUAL: - return node(0)->evaluate(n) <= node(1)->evaluate(n); - case wxPluralFormsToken::T_REMINDER: - { - wxPluralFormsToken::Number number = node(1)->evaluate(n); - if (number != 0) - { - return node(0)->evaluate(n) % number; - } - else - { - return 0; - } - } - case wxPluralFormsToken::T_LOGICAL_AND: - return node(0)->evaluate(n) && node(1)->evaluate(n); - case wxPluralFormsToken::T_LOGICAL_OR: - return node(0)->evaluate(n) || node(1)->evaluate(n); - // 3 args - case wxPluralFormsToken::T_QUESTION: - return node(0)->evaluate(n) - ? node(1)->evaluate(n) - : node(2)->evaluate(n); - default: - return 0; - } -} - - -class wxPluralFormsCalculator -{ -public: - wxPluralFormsCalculator() : m_nplurals(0), m_plural(0) {} - - // input: number, returns msgstr index - int evaluate(int n) const; - - // input: text after "Plural-Forms:" (e.g. "nplurals=2; plural=(n != 1);"), - // if s == 0, creates default handler - // returns 0 if error - static wxPluralFormsCalculator* make(const char* s = 0); - - ~wxPluralFormsCalculator() {} - - void init(wxPluralFormsToken::Number nplurals, wxPluralFormsNode* plural); - -private: - wxPluralFormsToken::Number m_nplurals; - wxPluralFormsNodePtr m_plural; -}; - -wxDEFINE_SCOPED_PTR_TYPE(wxPluralFormsCalculator) - -void wxPluralFormsCalculator::init(wxPluralFormsToken::Number nplurals, - wxPluralFormsNode* plural) -{ - m_nplurals = nplurals; - m_plural.reset(plural); -} - -int wxPluralFormsCalculator::evaluate(int n) const -{ - if (m_plural.get() == 0) - { - return 0; - } - wxPluralFormsToken::Number number = m_plural->evaluate(n); - if (number < 0 || number > m_nplurals) - { - return 0; - } - return number; -} - - -class wxPluralFormsParser -{ -public: - wxPluralFormsParser(wxPluralFormsScanner& scanner) : m_scanner(scanner) {} - bool parse(wxPluralFormsCalculator& rCalculator); - -private: - wxPluralFormsNode* parsePlural(); - // stops at T_SEMICOLON, returns 0 if error - wxPluralFormsScanner& m_scanner; - const wxPluralFormsToken& token() const; - bool nextToken(); - - wxPluralFormsNode* expression(); - wxPluralFormsNode* logicalOrExpression(); - wxPluralFormsNode* logicalAndExpression(); - wxPluralFormsNode* equalityExpression(); - wxPluralFormsNode* multiplicativeExpression(); - wxPluralFormsNode* relationalExpression(); - wxPluralFormsNode* pmExpression(); -}; - -bool wxPluralFormsParser::parse(wxPluralFormsCalculator& rCalculator) -{ - if (token().type() != wxPluralFormsToken::T_NPLURALS) - return false; - if (!nextToken()) - return false; - if (token().type() != wxPluralFormsToken::T_ASSIGN) - return false; - if (!nextToken()) - return false; - if (token().type() != wxPluralFormsToken::T_NUMBER) - return false; - wxPluralFormsToken::Number nplurals = token().number(); - if (!nextToken()) - return false; - if (token().type() != wxPluralFormsToken::T_SEMICOLON) - return false; - if (!nextToken()) - return false; - if (token().type() != wxPluralFormsToken::T_PLURAL) - return false; - if (!nextToken()) - return false; - if (token().type() != wxPluralFormsToken::T_ASSIGN) - return false; - if (!nextToken()) - return false; - wxPluralFormsNode* plural = parsePlural(); - if (plural == 0) - return false; - if (token().type() != wxPluralFormsToken::T_SEMICOLON) - return false; - if (!nextToken()) - return false; - if (token().type() != wxPluralFormsToken::T_EOF) - return false; - rCalculator.init(nplurals, plural); - return true; -} - -wxPluralFormsNode* wxPluralFormsParser::parsePlural() -{ - wxPluralFormsNode* p = expression(); - if (p == NULL) - { - return NULL; - } - wxPluralFormsNodePtr n(p); - if (token().type() != wxPluralFormsToken::T_SEMICOLON) - { - return NULL; - } - return n.release(); -} - -const wxPluralFormsToken& wxPluralFormsParser::token() const -{ - return m_scanner.token(); -} - -bool wxPluralFormsParser::nextToken() -{ - if (!m_scanner.nextToken()) - return false; - return true; -} - -wxPluralFormsNode* wxPluralFormsParser::expression() -{ - wxPluralFormsNode* p = logicalOrExpression(); - if (p == NULL) - return NULL; - wxPluralFormsNodePtr n(p); - if (token().type() == wxPluralFormsToken::T_QUESTION) - { - wxPluralFormsNodePtr qn(new wxPluralFormsNode(token())); - if (!nextToken()) - { - return 0; - } - p = expression(); - if (p == 0) - { - return 0; - } - qn->setNode(1, p); - if (token().type() != wxPluralFormsToken::T_COLON) - { - return 0; - } - if (!nextToken()) - { - return 0; - } - p = expression(); - if (p == 0) - { - return 0; - } - qn->setNode(2, p); - qn->setNode(0, n.release()); - return qn.release(); - } - return n.release(); -} - -wxPluralFormsNode*wxPluralFormsParser::logicalOrExpression() -{ - wxPluralFormsNode* p = logicalAndExpression(); - if (p == NULL) - return NULL; - wxPluralFormsNodePtr ln(p); - if (token().type() == wxPluralFormsToken::T_LOGICAL_OR) - { - wxPluralFormsNodePtr un(new wxPluralFormsNode(token())); - if (!nextToken()) - { - return 0; - } - p = logicalOrExpression(); - if (p == 0) - { - return 0; - } - wxPluralFormsNodePtr rn(p); // right - if (rn->token().type() == wxPluralFormsToken::T_LOGICAL_OR) - { - // see logicalAndExpression comment - un->setNode(0, ln.release()); - un->setNode(1, rn->releaseNode(0)); - rn->setNode(0, un.release()); - return rn.release(); - } - - - un->setNode(0, ln.release()); - un->setNode(1, rn.release()); - return un.release(); - } - return ln.release(); -} - -wxPluralFormsNode* wxPluralFormsParser::logicalAndExpression() -{ - wxPluralFormsNode* p = equalityExpression(); - if (p == NULL) - return NULL; - wxPluralFormsNodePtr ln(p); // left - if (token().type() == wxPluralFormsToken::T_LOGICAL_AND) - { - wxPluralFormsNodePtr un(new wxPluralFormsNode(token())); // up - if (!nextToken()) - { - return NULL; - } - p = logicalAndExpression(); - if (p == 0) - { - return NULL; - } - wxPluralFormsNodePtr rn(p); // right - if (rn->token().type() == wxPluralFormsToken::T_LOGICAL_AND) - { -// transform 1 && (2 && 3) -> (1 && 2) && 3 -// u r -// l r -> u 3 -// 2 3 l 2 - un->setNode(0, ln.release()); - un->setNode(1, rn->releaseNode(0)); - rn->setNode(0, un.release()); - return rn.release(); - } - - un->setNode(0, ln.release()); - un->setNode(1, rn.release()); - return un.release(); - } - return ln.release(); -} - -wxPluralFormsNode* wxPluralFormsParser::equalityExpression() -{ - wxPluralFormsNode* p = relationalExpression(); - if (p == NULL) - return NULL; - wxPluralFormsNodePtr n(p); - if (token().type() == wxPluralFormsToken::T_EQUAL - || token().type() == wxPluralFormsToken::T_NOT_EQUAL) - { - wxPluralFormsNodePtr qn(new wxPluralFormsNode(token())); - if (!nextToken()) - { - return NULL; - } - p = relationalExpression(); - if (p == NULL) - { - return NULL; - } - qn->setNode(1, p); - qn->setNode(0, n.release()); - return qn.release(); - } - return n.release(); -} - -wxPluralFormsNode* wxPluralFormsParser::relationalExpression() -{ - wxPluralFormsNode* p = multiplicativeExpression(); - if (p == NULL) - return NULL; - wxPluralFormsNodePtr n(p); - if (token().type() == wxPluralFormsToken::T_GREATER - || token().type() == wxPluralFormsToken::T_LESS - || token().type() == wxPluralFormsToken::T_GREATER_OR_EQUAL - || token().type() == wxPluralFormsToken::T_LESS_OR_EQUAL) - { - wxPluralFormsNodePtr qn(new wxPluralFormsNode(token())); - if (!nextToken()) - { - return NULL; - } - p = multiplicativeExpression(); - if (p == NULL) - { - return NULL; - } - qn->setNode(1, p); - qn->setNode(0, n.release()); - return qn.release(); - } - return n.release(); -} - -wxPluralFormsNode* wxPluralFormsParser::multiplicativeExpression() -{ - wxPluralFormsNode* p = pmExpression(); - if (p == NULL) - return NULL; - wxPluralFormsNodePtr n(p); - if (token().type() == wxPluralFormsToken::T_REMINDER) - { - wxPluralFormsNodePtr qn(new wxPluralFormsNode(token())); - if (!nextToken()) - { - return NULL; - } - p = pmExpression(); - if (p == NULL) - { - return NULL; - } - qn->setNode(1, p); - qn->setNode(0, n.release()); - return qn.release(); - } - return n.release(); -} - -wxPluralFormsNode* wxPluralFormsParser::pmExpression() -{ - wxPluralFormsNodePtr n; - if (token().type() == wxPluralFormsToken::T_N - || token().type() == wxPluralFormsToken::T_NUMBER) - { - n.reset(new wxPluralFormsNode(token())); - if (!nextToken()) - { - return NULL; - } - } - else if (token().type() == wxPluralFormsToken::T_LEFT_BRACKET) { - if (!nextToken()) - { - return NULL; - } - wxPluralFormsNode* p = expression(); - if (p == NULL) - { - return NULL; - } - n.reset(p); - if (token().type() != wxPluralFormsToken::T_RIGHT_BRACKET) - { - return NULL; - } - if (!nextToken()) - { - return NULL; - } - } - else - { - return NULL; - } - return n.release(); -} - -wxPluralFormsCalculator* wxPluralFormsCalculator::make(const char* s) -{ - wxPluralFormsCalculatorPtr calculator(new wxPluralFormsCalculator); - if (s != NULL) - { - wxPluralFormsScanner scanner(s); - wxPluralFormsParser p(scanner); - if (!p.parse(*calculator)) - { - return NULL; - } - } - return calculator.release(); -} - - - - -// ---------------------------------------------------------------------------- -// wxMsgCatalogFile corresponds to one disk-file message catalog. -// -// This is a "low-level" class and is used only by wxMsgCatalog -// ---------------------------------------------------------------------------- - -WX_DECLARE_EXPORTED_STRING_HASH_MAP(wxString, wxMessagesHash); - -class wxMsgCatalogFile -{ -public: - // ctor & dtor - wxMsgCatalogFile(); - ~wxMsgCatalogFile(); - - // load the catalog from disk (szDirPrefix corresponds to language) - bool Load(const wxChar *szDirPrefix, const wxChar *szName, - wxPluralFormsCalculatorPtr& rPluralFormsCalculator); - - // fills the hash with string-translation pairs - void FillHash(wxMessagesHash& hash, - const wxString& msgIdCharset, - bool convertEncoding) const; - - // return the charset of the strings in this catalog or empty string if - // none/unknown - wxString GetCharset() const { return m_charset; } - -private: - // this implementation is binary compatible with GNU gettext() version 0.10 - - // an entry in the string table - struct wxMsgTableEntry - { - size_t32 nLen; // length of the string - size_t32 ofsString; // pointer to the string - }; - - // header of a .mo file - struct wxMsgCatalogHeader - { - size_t32 magic, // offset +00: magic id - revision, // +04: revision - numStrings; // +08: number of strings in the file - size_t32 ofsOrigTable, // +0C: start of original string table - ofsTransTable; // +10: start of translated string table - size_t32 nHashSize, // +14: hash table size - ofsHashTable; // +18: offset of hash table start - }; - - // all data is stored here, NULL if no data loaded - size_t8 *m_pData; - - // amount of memory pointed to by m_pData. - size_t32 m_nSize; - - // data description - size_t32 m_numStrings; // number of strings in this domain - wxMsgTableEntry *m_pOrigTable, // pointer to original strings - *m_pTransTable; // translated - - wxString m_charset; // from the message catalog header - - - // swap the 2 halves of 32 bit integer if needed - size_t32 Swap(size_t32 ui) const - { - return m_bSwapped ? (ui << 24) | ((ui & 0xff00) << 8) | - ((ui >> 8) & 0xff00) | (ui >> 24) - : ui; - } - - const char *StringAtOfs(wxMsgTableEntry *pTable, size_t32 n) const - { - const wxMsgTableEntry * const ent = pTable + n; - - // this check could fail for a corrupt message catalog - size_t32 ofsString = Swap(ent->ofsString); - if ( ofsString + Swap(ent->nLen) > m_nSize) - { - return NULL; - } - - return (const char *)(m_pData + ofsString); - } - - bool m_bSwapped; // wrong endianness? - - DECLARE_NO_COPY_CLASS(wxMsgCatalogFile) -}; - - -// ---------------------------------------------------------------------------- -// wxMsgCatalog corresponds to one loaded message catalog. -// -// This is a "low-level" class and is used only by wxLocale (that's why -// it's designed to be stored in a linked list) -// ---------------------------------------------------------------------------- - -class wxMsgCatalog -{ -public: -#if !wxUSE_UNICODE - wxMsgCatalog() { m_conv = NULL; } - ~wxMsgCatalog(); -#endif - - // load the catalog from disk (szDirPrefix corresponds to language) - bool Load(const wxChar *szDirPrefix, const wxChar *szName, - const wxChar *msgIdCharset = NULL, bool bConvertEncoding = false); - - // get name of the catalog - wxString GetName() const { return m_name; } - - // get the translated string: returns NULL if not found - const wxChar *GetString(const wxChar *sz, size_t n = size_t(-1)) const; - - // public variable pointing to the next element in a linked list (or NULL) - wxMsgCatalog *m_pNext; - -private: - wxMessagesHash m_messages; // all messages in the catalog - wxString m_name; // name of the domain - -#if !wxUSE_UNICODE - // the conversion corresponding to this catalog charset if we installed it - // as the global one - wxCSConv *m_conv; -#endif - - wxPluralFormsCalculatorPtr m_pluralFormsCalculator; -}; - -// ---------------------------------------------------------------------------- -// global variables -// ---------------------------------------------------------------------------- - -// the list of the directories to search for message catalog files -static wxArrayString gs_searchPrefixes; - -// ============================================================================ -// implementation -// ============================================================================ - -// ---------------------------------------------------------------------------- -// wxMsgCatalogFile class -// ---------------------------------------------------------------------------- - -wxMsgCatalogFile::wxMsgCatalogFile() -{ - m_pData = NULL; - m_nSize = 0; -} - -wxMsgCatalogFile::~wxMsgCatalogFile() -{ - delete [] m_pData; -} - -// return the directories to search for message catalogs under the given -// prefix, separated by wxPATH_SEP -static -wxString GetMsgCatalogSubdirs(const wxChar *prefix, const wxChar *lang) -{ - // Search first in Unix-standard prefix/lang/LC_MESSAGES, then in - // prefix/lang and finally in just prefix. - // - // Note that we use LC_MESSAGES on all platforms and not just Unix, because - // it doesn't cost much to look into one more directory and doing it this - // way has two important benefits: - // a) we don't break compatibility with wx-2.6 and older by stopping to - // look in a directory where the catalogs used to be and thus silently - // breaking apps after they are recompiled against the latest wx - // b) it makes it possible to package app's support files in the same - // way on all target platforms - wxString pathPrefix; - pathPrefix << prefix << wxFILE_SEP_PATH << lang; - - wxString searchPath; - searchPath.reserve(4*pathPrefix.length()); - searchPath << pathPrefix << wxFILE_SEP_PATH << wxT("LC_MESSAGES") << wxPATH_SEP - << prefix << wxFILE_SEP_PATH << wxPATH_SEP - << pathPrefix; - - return searchPath; -} - -// construct the search path for the given language -static wxString GetFullSearchPath(const wxChar *lang) -{ - // first take the entries explicitly added by the program - wxArrayString paths; - paths.reserve(gs_searchPrefixes.size() + 1); - size_t n, - count = gs_searchPrefixes.size(); - for ( n = 0; n < count; n++ ) - { - paths.Add(GetMsgCatalogSubdirs(gs_searchPrefixes[n], lang)); - } - - -#if wxUSE_STDPATHS - // then look in the standard location - const wxString stdp = wxStandardPaths::Get(). - GetLocalizedResourcesDir(lang, wxStandardPaths::ResourceCat_Messages); - - if ( paths.Index(stdp) == wxNOT_FOUND ) - paths.Add(stdp); -#endif // wxUSE_STDPATHS - - // last look in default locations -#ifdef __UNIX__ - // LC_PATH is a standard env var containing the search path for the .mo - // files - const wxChar *pszLcPath = wxGetenv(wxT("LC_PATH")); - if ( pszLcPath ) - { - const wxString lcp = GetMsgCatalogSubdirs(pszLcPath, lang); - if ( paths.Index(lcp) == wxNOT_FOUND ) - paths.Add(lcp); - } - - // also add the one from where wxWin was installed: - wxString wxp = wxGetInstallPrefix(); - if ( !wxp.empty() ) - { - wxp = GetMsgCatalogSubdirs(wxp + _T("/share/locale"), lang); - if ( paths.Index(wxp) == wxNOT_FOUND ) - paths.Add(wxp); - } -#endif // __UNIX__ - - - // finally construct the full search path - wxString searchPath; - searchPath.reserve(500); - count = paths.size(); - for ( n = 0; n < count; n++ ) - { - searchPath += paths[n]; - if ( n != count - 1 ) - searchPath += wxPATH_SEP; - } - - return searchPath; -} - -// open disk file and read in it's contents -bool wxMsgCatalogFile::Load(const wxChar *szDirPrefix, const wxChar *szName, - wxPluralFormsCalculatorPtr& rPluralFormsCalculator) -{ - wxString searchPath; - -#if wxUSE_FONTMAP - // first look for the catalog for this language and the current locale: - // notice that we don't use the system name for the locale as this would - // force us to install catalogs in different locations depending on the - // system but always use the canonical name - wxFontEncoding encSys = wxLocale::GetSystemEncoding(); - if ( encSys != wxFONTENCODING_SYSTEM ) - { - wxString fullname(szDirPrefix); - fullname << _T('.') << wxFontMapperBase::GetEncodingName(encSys); - searchPath << GetFullSearchPath(fullname) << wxPATH_SEP; - } -#endif // wxUSE_FONTMAP - - - searchPath += GetFullSearchPath(szDirPrefix); - const wxChar *sublocale = wxStrchr(szDirPrefix, wxT('_')); - if ( sublocale ) - { - // also add just base locale name: for things like "fr_BE" (belgium - // french) we should use "fr" if no belgium specific message catalogs - // exist - searchPath << wxPATH_SEP - << GetFullSearchPath(wxString(szDirPrefix). - Left((size_t)(sublocale - szDirPrefix))); - } - - // don't give translation errors here because the wxstd catalog might - // not yet be loaded (and it's normal) - // - // (we're using an object because we have several return paths) - - NoTransErr noTransErr; - wxLogVerbose(_("looking for catalog '%s' in path '%s'."), - szName, searchPath.c_str()); - wxLogTrace(TRACE_I18N, _T("Looking for \"%s.mo\" in \"%s\""), - szName, searchPath.c_str()); - - wxFileName fn(szName); - fn.SetExt(_T("mo")); - wxString strFullName; - if ( !wxFindFileInPath(&strFullName, searchPath, fn.GetFullPath()) ) { - wxLogVerbose(_("catalog file for domain '%s' not found."), szName); - wxLogTrace(TRACE_I18N, _T("Catalog \"%s.mo\" not found"), szName); - return false; - } - - // open file - wxLogVerbose(_("using catalog '%s' from '%s'."), szName, strFullName.c_str()); - wxLogTrace(TRACE_I18N, _T("Using catalog \"%s\"."), strFullName.c_str()); - - wxFile fileMsg(strFullName); - if ( !fileMsg.IsOpened() ) - return false; - - // get the file size (assume it is less than 4Gb...) - wxFileOffset lenFile = fileMsg.Length(); - if ( lenFile == wxInvalidOffset ) - return false; - - size_t nSize = wx_truncate_cast(size_t, lenFile); - wxASSERT_MSG( nSize == lenFile + size_t(0), _T("message catalog bigger than 4GB?") ); - - // read the whole file in memory - m_pData = new size_t8[nSize]; - if ( fileMsg.Read(m_pData, nSize) != lenFile ) { - wxDELETEA(m_pData); - return false; - } - - // examine header - bool bValid = nSize + (size_t)0 > sizeof(wxMsgCatalogHeader); - - wxMsgCatalogHeader *pHeader = (wxMsgCatalogHeader *)m_pData; - if ( bValid ) { - // we'll have to swap all the integers if it's true - m_bSwapped = pHeader->magic == MSGCATALOG_MAGIC_SW; - - // check the magic number - bValid = m_bSwapped || pHeader->magic == MSGCATALOG_MAGIC; - } - - if ( !bValid ) { - // it's either too short or has incorrect magic number - wxLogWarning(_("'%s' is not a valid message catalog."), strFullName.c_str()); - - wxDELETEA(m_pData); - return false; - } - - // initialize - m_numStrings = Swap(pHeader->numStrings); - m_pOrigTable = (wxMsgTableEntry *)(m_pData + - Swap(pHeader->ofsOrigTable)); - m_pTransTable = (wxMsgTableEntry *)(m_pData + - Swap(pHeader->ofsTransTable)); - m_nSize = (size_t32)nSize; - - // now parse catalog's header and try to extract catalog charset and - // plural forms formula from it: - - const char* headerData = StringAtOfs(m_pOrigTable, 0); - if (headerData && headerData[0] == 0) - { - // Extract the charset: - wxString header = wxString::FromAscii(StringAtOfs(m_pTransTable, 0)); - int begin = header.Find(wxT("Content-Type: text/plain; charset=")); - if (begin != wxNOT_FOUND) - { - begin += 34; //strlen("Content-Type: text/plain; charset=") - size_t end = header.find('\n', begin); - if (end != size_t(-1)) - { - m_charset.assign(header, begin, end - begin); - if (m_charset == wxT("CHARSET")) - { - // "CHARSET" is not valid charset, but lazy translator - m_charset.Clear(); - } - } - } - // else: incorrectly filled Content-Type header - - // Extract plural forms: - begin = header.Find(wxT("Plural-Forms:")); - if (begin != wxNOT_FOUND) - { - begin += 13; - size_t end = header.find('\n', begin); - if (end != size_t(-1)) - { - wxString pfs(header, begin, end - begin); - wxPluralFormsCalculator* pCalculator = wxPluralFormsCalculator - ::make(pfs.ToAscii()); - if (pCalculator != 0) - { - rPluralFormsCalculator.reset(pCalculator); - } - else - { - wxLogVerbose(_("Cannot parse Plural-Forms:'%s'"), pfs.c_str()); - } - } - } - if (rPluralFormsCalculator.get() == NULL) - { - rPluralFormsCalculator.reset(wxPluralFormsCalculator::make()); - } - } - - // everything is fine - return true; -} - -void wxMsgCatalogFile::FillHash(wxMessagesHash& hash, - const wxString& msgIdCharset, - bool convertEncoding) const -{ -#if wxUSE_UNICODE - // this parameter doesn't make sense, we always must convert encoding in - // Unicode build - convertEncoding = true; -#elif wxUSE_FONTMAP - if ( convertEncoding ) - { - // determine if we need any conversion at all - wxFontEncoding encCat = wxFontMapperBase::GetEncodingFromName(m_charset); - if ( encCat == wxLocale::GetSystemEncoding() ) - { - // no need to convert - convertEncoding = false; - } - } -#endif // wxUSE_UNICODE/wxUSE_FONTMAP - -#if wxUSE_WCHAR_T - // conversion to use to convert catalog strings to the GUI encoding - wxMBConv *inputConv, - *inputConvPtr = NULL; // same as inputConv but safely deleteable - if ( convertEncoding && !m_charset.empty() ) - { - inputConvPtr = - inputConv = new wxCSConv(m_charset); - } - else // no need or not possible to convert the encoding - { -#if wxUSE_UNICODE - // we must somehow convert the narrow strings in the message catalog to - // wide strings, so use the default conversion if we have no charset - inputConv = wxConvCurrent; -#else // !wxUSE_UNICODE - inputConv = NULL; -#endif // wxUSE_UNICODE/!wxUSE_UNICODE - } - - // conversion to apply to msgid strings before looking them up: we only - // need it if the msgids are neither in 7 bit ASCII nor in the same - // encoding as the catalog - wxCSConv *sourceConv = msgIdCharset.empty() || (msgIdCharset == m_charset) - ? NULL - : new wxCSConv(msgIdCharset); - -#elif wxUSE_FONTMAP - wxASSERT_MSG( msgIdCharset.empty(), - _T("non-ASCII msgid languages only supported if wxUSE_WCHAR_T=1") ); - - wxEncodingConverter converter; - if ( convertEncoding ) - { - wxFontEncoding targetEnc = wxFONTENCODING_SYSTEM; - wxFontEncoding enc = wxFontMapperBase::Get()->CharsetToEncoding(m_charset, false); - if ( enc == wxFONTENCODING_SYSTEM ) - { - convertEncoding = false; // unknown encoding - } - else - { - targetEnc = wxLocale::GetSystemEncoding(); - if (targetEnc == wxFONTENCODING_SYSTEM) - { - wxFontEncodingArray a = wxEncodingConverter::GetPlatformEquivalents(enc); - if (a[0] == enc) - // no conversion needed, locale uses native encoding - convertEncoding = false; - if (a.GetCount() == 0) - // we don't know common equiv. under this platform - convertEncoding = false; - targetEnc = a[0]; - } - } - - if ( convertEncoding ) - { - converter.Init(enc, targetEnc); - } - } -#endif // wxUSE_WCHAR_T/!wxUSE_WCHAR_T - (void)convertEncoding; // get rid of warnings about unused parameter - - for (size_t32 i = 0; i < m_numStrings; i++) - { - const char *data = StringAtOfs(m_pOrigTable, i); - - wxString msgid; -#if wxUSE_UNICODE - msgid = wxString(data, *inputConv); -#else // ASCII - #if wxUSE_WCHAR_T - if ( inputConv && sourceConv ) - msgid = wxString(inputConv->cMB2WC(data), *sourceConv); - else - #endif - msgid = data; -#endif // wxUSE_UNICODE - - data = StringAtOfs(m_pTransTable, i); - size_t length = Swap(m_pTransTable[i].nLen); - size_t offset = 0; - size_t index = 0; - while (offset < length) - { - const char * const str = data + offset; - - wxString msgstr; -#if wxUSE_UNICODE - msgstr = wxString(str, *inputConv); -#elif wxUSE_WCHAR_T - if ( inputConv ) - msgstr = wxString(inputConv->cMB2WC(str), *wxConvUI); - else - msgstr = str; -#else // !wxUSE_WCHAR_T - #if wxUSE_FONTMAP - if ( convertEncoding ) - msgstr = wxString(converter.Convert(str)); - else - #endif - msgstr = str; -#endif // wxUSE_WCHAR_T/!wxUSE_WCHAR_T - - if ( !msgstr.empty() ) - { - hash[index == 0 ? msgid : msgid + wxChar(index)] = msgstr; - } - - // skip this string - offset += strlen(str) + 1; - ++index; - } - } - -#if wxUSE_WCHAR_T - delete sourceConv; - delete inputConvPtr; -#endif // wxUSE_WCHAR_T -} - - -// ---------------------------------------------------------------------------- -// wxMsgCatalog class -// ---------------------------------------------------------------------------- - -#if !wxUSE_UNICODE -wxMsgCatalog::~wxMsgCatalog() -{ - if ( m_conv ) - { - if ( wxConvUI == m_conv ) - { - // we only change wxConvUI if it points to wxConvLocal so we reset - // it back to it too - wxConvUI = &wxConvLocal; - } - - delete m_conv; - } -} -#endif // !wxUSE_UNICODE - -bool wxMsgCatalog::Load(const wxChar *szDirPrefix, const wxChar *szName, - const wxChar *msgIdCharset, bool bConvertEncoding) -{ - wxMsgCatalogFile file; - - m_name = szName; - - if ( !file.Load(szDirPrefix, szName, m_pluralFormsCalculator) ) - return false; - - file.FillHash(m_messages, msgIdCharset, bConvertEncoding); - -#if !wxUSE_UNICODE && wxUSE_WCHAR_T - // we should use a conversion compatible with the message catalog encoding - // in the GUI if we don't convert the strings to the current conversion but - // as the encoding is global, only change it once, otherwise we could get - // into trouble if we use several message catalogs with different encodings - // - // this is, of course, a hack but it at least allows the program to use - // message catalogs in any encodings without asking the user to change his - // locale - if ( !bConvertEncoding && - !file.GetCharset().empty() && - wxConvUI == &wxConvLocal ) - { - wxConvUI = - m_conv = new wxCSConv(file.GetCharset()); - } -#endif // !wxUSE_UNICODE && wxUSE_WCHAR_T - - return true; -} - -const wxChar *wxMsgCatalog::GetString(const wxChar *sz, size_t n) const -{ - int index = 0; - if (n != size_t(-1)) - { - index = m_pluralFormsCalculator->evaluate(n); - } - wxMessagesHash::const_iterator i; - if (index != 0) - { - i = m_messages.find(wxString(sz) + wxChar(index)); // plural - } - else - { - i = m_messages.find(sz); - } - - if ( i != m_messages.end() ) - { - return i->second.c_str(); - } - else - return NULL; -} - -// ---------------------------------------------------------------------------- -// wxLocale -// ---------------------------------------------------------------------------- - -#include "wx/arrimpl.cpp" -WX_DECLARE_EXPORTED_OBJARRAY(wxLanguageInfo, wxLanguageInfoArray); -WX_DEFINE_OBJARRAY(wxLanguageInfoArray) - -wxLanguageInfoArray *wxLocale::ms_languagesDB = NULL; - -/*static*/ void wxLocale::CreateLanguagesDB() -{ - if (ms_languagesDB == NULL) - { - ms_languagesDB = new wxLanguageInfoArray; - InitLanguagesDB(); - } -} - -/*static*/ void wxLocale::DestroyLanguagesDB() -{ - delete ms_languagesDB; - ms_languagesDB = NULL; -} - - -void wxLocale::DoCommonInit() -{ - m_pszOldLocale = NULL; - - m_pOldLocale = wxSetLocale(this); - - m_pMsgCat = NULL; - m_language = wxLANGUAGE_UNKNOWN; - m_initialized = false; -} - -// NB: this function has (desired) side effect of changing current locale -bool wxLocale::Init(const wxChar *szName, - const wxChar *szShort, - const wxChar *szLocale, - bool bLoadDefault, - bool bConvertEncoding) -{ - wxASSERT_MSG( !m_initialized, - _T("you can't call wxLocale::Init more than once") ); - - m_initialized = true; - m_strLocale = szName; - m_strShort = szShort; - m_bConvertEncoding = bConvertEncoding; - m_language = wxLANGUAGE_UNKNOWN; - - // change current locale (default: same as long name) - if ( szLocale == NULL ) - { - // the argument to setlocale() - szLocale = szShort; - - wxCHECK_MSG( szLocale, false, _T("no locale to set in wxLocale::Init()") ); - } - -#ifdef __WXWINCE__ - // FIXME: I'm guessing here - wxChar localeName[256]; - int ret = GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_SLANGUAGE, localeName, - 256); - if (ret != 0) - { - m_pszOldLocale = wxStrdup(localeName); - } - else - m_pszOldLocale = NULL; - - // TODO: how to find languageId - // SetLocaleInfo(languageId, SORT_DEFAULT, localeName); -#else - wxMB2WXbuf oldLocale = wxSetlocale(LC_ALL, szLocale); - if ( oldLocale ) - m_pszOldLocale = wxStrdup(oldLocale); - else - m_pszOldLocale = NULL; -#endif - - if ( m_pszOldLocale == NULL ) - wxLogError(_("locale '%s' can not be set."), szLocale); - - // the short name will be used to look for catalog files as well, - // so we need something here - if ( m_strShort.empty() ) { - // FIXME I don't know how these 2 letter abbreviations are formed, - // this wild guess is surely wrong - if ( szLocale && szLocale[0] ) - { - m_strShort += (wxChar)wxTolower(szLocale[0]); - if ( szLocale[1] ) - m_strShort += (wxChar)wxTolower(szLocale[1]); - } - } - - // load the default catalog with wxWidgets standard messages - m_pMsgCat = NULL; - bool bOk = true; - if ( bLoadDefault ) - { - bOk = AddCatalog(wxT("wxstd")); - - // there may be a catalog with toolkit specific overrides, it is not - // an error if this does not exist - if ( bOk ) - { - wxString port(wxPlatformInfo::Get().GetPortIdName()); - if ( !port.empty() ) - { - AddCatalog(port.BeforeFirst(wxT('/')).MakeLower()); - } - } - } - - return bOk; -} - - -#if defined(__UNIX__) && wxUSE_UNICODE && !defined(__WXMAC__) -static wxWCharBuffer wxSetlocaleTryUTF(int c, const wxChar *lc) -{ - wxMB2WXbuf l = wxSetlocale(c, lc); - if ( !l && lc && lc[0] != 0 ) - { - wxString buf(lc); - wxString buf2; - buf2 = buf + wxT(".UTF-8"); - l = wxSetlocale(c, buf2.c_str()); - if ( !l ) - { - buf2 = buf + wxT(".utf-8"); - l = wxSetlocale(c, buf2.c_str()); - } - if ( !l ) - { - buf2 = buf + wxT(".UTF8"); - l = wxSetlocale(c, buf2.c_str()); - } - if ( !l ) - { - buf2 = buf + wxT(".utf8"); - l = wxSetlocale(c, buf2.c_str()); - } - } - return l; -} -#else -#define wxSetlocaleTryUTF(c, lc) wxSetlocale(c, lc) -#endif - -bool wxLocale::Init(int language, int flags) -{ - int lang = language; - if (lang == wxLANGUAGE_DEFAULT) - { - // auto detect the language - lang = GetSystemLanguage(); - } - - // We failed to detect system language, so we will use English: - if (lang == wxLANGUAGE_UNKNOWN) - { - return false; - } - - const wxLanguageInfo *info = GetLanguageInfo(lang); - - // Unknown language: - if (info == NULL) - { - wxLogError(wxT("Unknown language %i."), lang); - return false; - } - - wxString name = info->Description; - wxString canonical = info->CanonicalName; - wxString locale; - - // Set the locale: -#if defined(__OS2__) - wxMB2WXbuf retloc = wxSetlocale(LC_ALL , wxEmptyString); -#elif defined(__UNIX__) && !defined(__WXMAC__) - if (language != wxLANGUAGE_DEFAULT) - locale = info->CanonicalName; - - wxMB2WXbuf retloc = wxSetlocaleTryUTF(LC_ALL, locale); - - const wxString langOnly = locale.Left(2); - if ( !retloc ) - { - // Some C libraries don't like xx_YY form and require xx only - retloc = wxSetlocaleTryUTF(LC_ALL, langOnly); - } - -#if wxUSE_FONTMAP - // some systems (e.g. FreeBSD and HP-UX) don't have xx_YY aliases but - // require the full xx_YY.encoding form, so try using UTF-8 because this is - // the only thing we can do generically - // - // TODO: add encodings applicable to each language to the lang DB and try - // them all in turn here - if ( !retloc ) - { - const wxChar **names = - wxFontMapperBase::GetAllEncodingNames(wxFONTENCODING_UTF8); - while ( *names ) - { - retloc = wxSetlocale(LC_ALL, locale + _T('.') + *names++); - if ( retloc ) - break; - } - } -#endif // wxUSE_FONTMAP - - if ( !retloc ) - { - // Some C libraries (namely glibc) still use old ISO 639, - // so will translate the abbrev for them - wxString localeAlt; - if ( langOnly == wxT("he") ) - localeAlt = wxT("iw") + locale.Mid(3); - else if ( langOnly == wxT("id") ) - localeAlt = wxT("in") + locale.Mid(3); - else if ( langOnly == wxT("yi") ) - localeAlt = wxT("ji") + locale.Mid(3); - else if ( langOnly == wxT("nb") ) - localeAlt = wxT("no_NO"); - else if ( langOnly == wxT("nn") ) - localeAlt = wxT("no_NY"); - - if ( !localeAlt.empty() ) - { - retloc = wxSetlocaleTryUTF(LC_ALL, localeAlt); - if ( !retloc ) - retloc = wxSetlocaleTryUTF(LC_ALL, localeAlt.Left(2)); - } - } - - if ( !retloc ) - { - wxLogError(wxT("Cannot set locale to '%s'."), locale.c_str()); - return false; - } - -#ifdef __AIX__ - // at least in AIX 5.2 libc is buggy and the string returned from setlocale(LC_ALL) - // can't be passed back to it because it returns 6 strings (one for each locale - // category), i.e. for C locale we get back "C C C C C C" - // - // this contradicts IBM own docs but this is not of much help, so just work around - // it in the crudest possible manner - wxChar *p = wxStrchr((wxChar *)retloc, _T(' ')); - if ( p ) - *p = _T('\0'); -#endif // __AIX__ - -#elif defined(__WIN32__) - - #if wxUSE_UNICODE && (defined(__VISUALC__) || defined(__MINGW32__)) - // NB: setlocale() from msvcrt.dll (used by VC++ and Mingw) - // can't set locale to language that can only be written using - // Unicode. Therefore wxSetlocale call failed, but we don't want - // to report it as an error -- so that at least message catalogs - // can be used. Watch for code marked with - // #ifdef SETLOCALE_FAILS_ON_UNICODE_LANGS bellow. - #define SETLOCALE_FAILS_ON_UNICODE_LANGS - #endif - -#if !wxUSE_UNICODE - const -#endif - wxMB2WXbuf retloc = wxT("C"); - if (language != wxLANGUAGE_DEFAULT) - { - if (info->WinLang == 0) - { - wxLogWarning(wxT("Locale '%s' not supported by OS."), name.c_str()); - // retloc already set to "C" - } - else - { - int codepage - #ifdef SETLOCALE_FAILS_ON_UNICODE_LANGS - = -1 - #endif - ; - wxUint32 lcid = MAKELCID(MAKELANGID(info->WinLang, info->WinSublang), - SORT_DEFAULT); - // FIXME -#ifndef __WXWINCE__ - SetThreadLocale(lcid); -#endif - // NB: we must translate LCID to CRT's setlocale string ourselves, - // because SetThreadLocale does not modify change the - // interpretation of setlocale(LC_ALL, "") call: - wxChar buffer[256]; - buffer[0] = wxT('\0'); - GetLocaleInfo(lcid, LOCALE_SENGLANGUAGE, buffer, 256); - locale << buffer; - if (GetLocaleInfo(lcid, LOCALE_SENGCOUNTRY, buffer, 256) > 0) - locale << wxT("_") << buffer; - if (GetLocaleInfo(lcid, LOCALE_IDEFAULTANSICODEPAGE, buffer, 256) > 0) - { - codepage = wxAtoi(buffer); - if (codepage != 0) - locale << wxT(".") << buffer; - } - if (locale.empty()) - { - wxLogLastError(wxT("SetThreadLocale")); - wxLogError(wxT("Cannot set locale to language %s."), name.c_str()); - return false; - } - else - { - // FIXME -#ifndef __WXWINCE__ - retloc = wxSetlocale(LC_ALL, locale); -#endif -#ifdef SETLOCALE_FAILS_ON_UNICODE_LANGS - if (codepage == 0 && (const wxChar*)retloc == NULL) - { - retloc = wxT("C"); - } -#endif - } - } - } - else - { - // FIXME -#ifndef __WXWINCE__ - retloc = wxSetlocale(LC_ALL, wxEmptyString); -#else - retloc = NULL; -#endif -#ifdef SETLOCALE_FAILS_ON_UNICODE_LANGS - if ((const wxChar*)retloc == NULL) - { - wxChar buffer[16]; - if (GetLocaleInfo(LOCALE_USER_DEFAULT, - LOCALE_IDEFAULTANSICODEPAGE, buffer, 16) > 0 && - wxStrcmp(buffer, wxT("0")) == 0) - { - retloc = wxT("C"); - } - } -#endif - } - - if ( !retloc ) - { - wxLogError(wxT("Cannot set locale to language %s."), name.c_str()); - return false; - } -#elif defined(__WXMAC__) - if (lang == wxLANGUAGE_DEFAULT) - locale = wxEmptyString; - else - locale = info->CanonicalName; - - wxMB2WXbuf retloc = wxSetlocale(LC_ALL, locale); - - if ( !retloc ) - { - // Some C libraries don't like xx_YY form and require xx only - retloc = wxSetlocale(LC_ALL, locale.Mid(0,2)); - } - if ( !retloc ) - { - wxLogError(wxT("Cannot set locale to '%s'."), locale.c_str()); - return false; - } -#else - wxUnusedVar(flags); - return false; - #define WX_NO_LOCALE_SUPPORT -#endif - -#ifndef WX_NO_LOCALE_SUPPORT - wxChar *szLocale = retloc ? wxStrdup(retloc) : NULL; - bool ret = Init(name, canonical, szLocale, - (flags & wxLOCALE_LOAD_DEFAULT) != 0, - (flags & wxLOCALE_CONV_ENCODING) != 0); - free(szLocale); - - if (IsOk()) // setlocale() succeeded - m_language = lang; - - return ret; -#endif // !WX_NO_LOCALE_SUPPORT -} - - - -void wxLocale::AddCatalogLookupPathPrefix(const wxString& prefix) -{ - if ( gs_searchPrefixes.Index(prefix) == wxNOT_FOUND ) - { - gs_searchPrefixes.Add(prefix); - } - //else: already have it -} - -/*static*/ int wxLocale::GetSystemLanguage() -{ - CreateLanguagesDB(); - - // init i to avoid compiler warning - size_t i = 0, - count = ms_languagesDB->GetCount(); - -#if defined(__UNIX__) && !defined(__WXMAC__) - // first get the string identifying the language from the environment - wxString langFull; - if (!wxGetEnv(wxT("LC_ALL"), &langFull) && - !wxGetEnv(wxT("LC_MESSAGES"), &langFull) && - !wxGetEnv(wxT("LANG"), &langFull)) - { - // no language specified, treat it as English - return wxLANGUAGE_ENGLISH_US; - } - - if ( langFull == _T("C") || langFull == _T("POSIX") ) - { - // default C locale is English too - return wxLANGUAGE_ENGLISH_US; - } - - // the language string has the following form - // - // lang[_LANG][.encoding][@modifier] - // - // (see environ(5) in the Open Unix specification) - // - // where lang is the primary language, LANG is a sublang/territory, - // encoding is the charset to use and modifier "allows the user to select - // a specific instance of localization data within a single category" - // - // for example, the following strings are valid: - // fr - // fr_FR - // de_DE.iso88591 - // de_DE@euro - // de_DE.iso88591@euro - - // for now we don't use the encoding, although we probably should (doing - // translations of the msg catalogs on the fly as required) (TODO) - // - // we need the modified for languages like Valencian: ca_ES@valencia - // though, remember it - wxString modifier; - size_t posModifier = langFull.find_first_of(_T("@")); - if ( posModifier != wxString::npos ) - modifier = langFull.Mid(posModifier); - - size_t posEndLang = langFull.find_first_of(_T("@.")); - if ( posEndLang != wxString::npos ) - { - langFull.Truncate(posEndLang); - } - - // in addition to the format above, we also can have full language names - // in LANG env var - for example, SuSE is known to use LANG="german" - so - // check for this - - // do we have just the language (or sublang too)? - bool justLang = langFull.length() == LEN_LANG; - if ( justLang || - (langFull.length() == LEN_FULL && langFull[LEN_LANG] == wxT('_')) ) - { - // 0. Make sure the lang is according to latest ISO 639 - // (this is necessary because glibc uses iw and in instead - // of he and id respectively). - - // the language itself (second part is the dialect/sublang) - wxString langOrig = ExtractLang(langFull); - - wxString lang; - if ( langOrig == wxT("iw")) - lang = _T("he"); - else if (langOrig == wxT("in")) - lang = wxT("id"); - else if (langOrig == wxT("ji")) - lang = wxT("yi"); - else if (langOrig == wxT("no_NO")) - lang = wxT("nb_NO"); - else if (langOrig == wxT("no_NY")) - lang = wxT("nn_NO"); - else if (langOrig == wxT("no")) - lang = wxT("nb_NO"); - else - lang = langOrig; - - // did we change it? - if ( lang != langOrig ) - { - langFull = lang + ExtractNotLang(langFull); - } - - // 1. Try to find the language either as is: - // a) With modifier if set - if ( !modifier.empty() ) - { - wxString langFullWithModifier = langFull + modifier; - for ( i = 0; i < count; i++ ) - { - if ( ms_languagesDB->Item(i).CanonicalName == langFullWithModifier ) - break; - } - } - - // b) Without modifier - if ( modifier.empty() || i == count ) - { - for ( i = 0; i < count; i++ ) - { - if ( ms_languagesDB->Item(i).CanonicalName == langFull ) - break; - } - } - - // 2. If langFull is of the form xx_YY, try to find xx: - if ( i == count && !justLang ) - { - for ( i = 0; i < count; i++ ) - { - if ( ms_languagesDB->Item(i).CanonicalName == lang ) - { - break; - } - } - } - - // 3. If langFull is of the form xx, try to find any xx_YY record: - if ( i == count && justLang ) - { - for ( i = 0; i < count; i++ ) - { - if ( ExtractLang(ms_languagesDB->Item(i).CanonicalName) - == langFull ) - { - break; - } - } - } - } - else // not standard format - { - // try to find the name in verbose description - for ( i = 0; i < count; i++ ) - { - if (ms_languagesDB->Item(i).Description.CmpNoCase(langFull) == 0) - { - break; - } - } - } -#elif defined(__WXMAC__) - const wxChar * lc = NULL ; - long lang = GetScriptVariable( smSystemScript, smScriptLang) ; - switch( GetScriptManagerVariable( smRegionCode ) ) { - case verUS : - lc = wxT("en_US") ; - break ; - case verFrance : - lc = wxT("fr_FR") ; - break ; - case verBritain : - lc = wxT("en_GB") ; - break ; - case verGermany : - lc = wxT("de_DE") ; - break ; - case verItaly : - lc = wxT("it_IT") ; - break ; - case verNetherlands : - lc = wxT("nl_NL") ; - break ; - case verFlemish : - lc = wxT("nl_BE") ; - break ; - case verSweden : - lc = wxT("sv_SE" ); - break ; - case verSpain : - lc = wxT("es_ES" ); - break ; - case verDenmark : - lc = wxT("da_DK") ; - break ; - case verPortugal : - lc = wxT("pt_PT") ; - break ; - case verFrCanada: - lc = wxT("fr_CA") ; - break ; - case verNorway: - lc = wxT("nb_NO") ; - break ; - case verIsrael: - lc = wxT("iw_IL") ; - break ; - case verJapan: - lc = wxT("ja_JP") ; - break ; - case verAustralia: - lc = wxT("en_AU") ; - break ; - case verArabic: - lc = wxT("ar") ; - break ; - case verFinland: - lc = wxT("fi_FI") ; - break ; - case verFrSwiss: - lc = wxT("fr_CH") ; - break ; - case verGrSwiss: - lc = wxT("de_CH") ; - break ; - case verGreece: - lc = wxT("el_GR") ; - break ; - case verIceland: - lc = wxT("is_IS") ; - break ; - case verMalta: - lc = wxT("mt_MT") ; - break ; - case verCyprus: - // _CY is not part of wx, so we have to translate according to the system language - if ( lang == langGreek ) { - lc = wxT("el_GR") ; - } - else if ( lang == langTurkish ) { - lc = wxT("tr_TR") ; - } - break ; - case verTurkey: - lc = wxT("tr_TR") ; - break ; - case verYugoCroatian: - lc = wxT("hr_HR") ; - break ; - case verIndiaHindi: - lc = wxT("hi_IN") ; - break ; - case verPakistanUrdu: - lc = wxT("ur_PK") ; - break ; - case verTurkishModified: - lc = wxT("tr_TR") ; - break ; - case verItalianSwiss: - lc = wxT("it_CH") ; - break ; - case verInternational: - lc = wxT("en") ; - break ; - case verRomania: - lc = wxT("ro_RO") ; - break ; - case verGreecePoly: - lc = wxT("el_GR") ; - break ; - case verLithuania: - lc = wxT("lt_LT") ; - break ; - case verPoland: - lc = wxT("pl_PL") ; - break ; - case verMagyar : - case verHungary: - lc = wxT("hu_HU") ; - break ; - case verEstonia: - lc = wxT("et_EE") ; - break ; - case verLatvia: - lc = wxT("lv_LV") ; - break ; - case verSami: - lc = wxT("se_NO") ; - break ; - case verFaroeIsl: - lc = wxT("fo_FO") ; - break ; - case verIran: - lc = wxT("fa_IR") ; - break ; - case verRussia: - lc = wxT("ru_RU") ; - break ; - case verIreland: - lc = wxT("ga_IE") ; - break ; - case verKorea: - lc = wxT("ko_KR") ; - break ; - case verChina: - lc = wxT("zh_CN") ; - break ; - case verTaiwan: - lc = wxT("zh_TW") ; - break ; - case verThailand: - lc = wxT("th_TH") ; - break ; - case verCzech: - lc = wxT("cs_CZ") ; - break ; - case verSlovak: - lc = wxT("sk_SK") ; - break ; - case verBengali: - lc = wxT("bn") ; - break ; - case verByeloRussian: - lc = wxT("be_BY") ; - break ; - case verUkraine: - lc = wxT("uk_UA") ; - break ; - case verGreeceAlt: - lc = wxT("el_GR") ; - break ; - case verSerbian: - lc = wxT("sr_YU") ; - break ; - case verSlovenian: - lc = wxT("sl_SI") ; - break ; - case verMacedonian: - lc = wxT("mk_MK") ; - break ; - case verCroatia: - lc = wxT("hr_HR") ; - break ; - case verBrazil: - lc = wxT("pt_BR ") ; - break ; - case verBulgaria: - lc = wxT("bg_BG") ; - break ; - case verCatalonia: - lc = wxT("ca_ES") ; - break ; - case verScottishGaelic: - lc = wxT("gd") ; - break ; - case verManxGaelic: - lc = wxT("gv") ; - break ; - case verBreton: - lc = wxT("br") ; - break ; - case verNunavut: - lc = wxT("iu_CA") ; - break ; - case verWelsh: - lc = wxT("cy") ; - break ; - case verIrishGaelicScript: - lc = wxT("ga_IE") ; - break ; - case verEngCanada: - lc = wxT("en_CA") ; - break ; - case verBhutan: - lc = wxT("dz_BT") ; - break ; - case verArmenian: - lc = wxT("hy_AM") ; - break ; - case verGeorgian: - lc = wxT("ka_GE") ; - break ; - case verSpLatinAmerica: - lc = wxT("es_AR") ; - break ; - case verTonga: - lc = wxT("to_TO" ); - break ; - case verFrenchUniversal: - lc = wxT("fr_FR") ; - break ; - case verAustria: - lc = wxT("de_AT") ; - break ; - case verGujarati: - lc = wxT("gu_IN") ; - break ; - case verPunjabi: - lc = wxT("pa") ; - break ; - case verIndiaUrdu: - lc = wxT("ur_IN") ; - break ; - case verVietnam: - lc = wxT("vi_VN") ; - break ; - case verFrBelgium: - lc = wxT("fr_BE") ; - break ; - case verUzbek: - lc = wxT("uz_UZ") ; - break ; - case verSingapore: - lc = wxT("zh_SG") ; - break ; - case verNynorsk: - lc = wxT("nn_NO") ; - break ; - case verAfrikaans: - lc = wxT("af_ZA") ; - break ; - case verEsperanto: - lc = wxT("eo") ; - break ; - case verMarathi: - lc = wxT("mr_IN") ; - break ; - case verTibetan: - lc = wxT("bo") ; - break ; - case verNepal: - lc = wxT("ne_NP") ; - break ; - case verGreenland: - lc = wxT("kl_GL") ; - break ; - default : - break ; - } - if ( !lc ) - return wxLANGUAGE_UNKNOWN; - for ( i = 0; i < count; i++ ) - { - if ( ms_languagesDB->Item(i).CanonicalName == lc ) - { - break; - } - } - -#elif defined(__WIN32__) - LCID lcid = GetUserDefaultLCID(); - if ( lcid != 0 ) - { - wxUint32 lang = PRIMARYLANGID(LANGIDFROMLCID(lcid)); - wxUint32 sublang = SUBLANGID(LANGIDFROMLCID(lcid)); - - for ( i = 0; i < count; i++ ) - { - if (ms_languagesDB->Item(i).WinLang == lang && - ms_languagesDB->Item(i).WinSublang == sublang) - { - break; - } - } - } - //else: leave wxlang == wxLANGUAGE_UNKNOWN -#endif // Unix/Win32 - - if ( i < count ) - { - // we did find a matching entry, use it - return ms_languagesDB->Item(i).Language; - } - - // no info about this language in the database - return wxLANGUAGE_UNKNOWN; -} - -// ---------------------------------------------------------------------------- -// encoding stuff -// ---------------------------------------------------------------------------- - -// this is a bit strange as under Windows we get the encoding name using its -// numeric value and under Unix we do it the other way round, but this just -// reflects the way different systems provide the encoding info - -/* static */ -wxString wxLocale::GetSystemEncodingName() -{ - wxString encname; - -#if defined(__WIN32__) && !defined(__WXMICROWIN__) - // FIXME: what is the error return value for GetACP()? - UINT codepage = ::GetACP(); - encname.Printf(_T("windows-%u"), codepage); -#elif defined(__WXMAC__) - // default is just empty string, this resolves to the default system - // encoding later -#elif defined(__UNIX_LIKE__) - -#if defined(HAVE_LANGINFO_H) && defined(CODESET) - // GNU libc provides current character set this way (this conforms - // to Unix98) - char *oldLocale = strdup(setlocale(LC_CTYPE, NULL)); - setlocale(LC_CTYPE, ""); - const char *alang = nl_langinfo(CODESET); - setlocale(LC_CTYPE, oldLocale); - free(oldLocale); - - if ( alang ) - { - encname = wxString::FromAscii( alang ); - } - else // nl_langinfo() failed -#endif // HAVE_LANGINFO_H - { - // if we can't get at the character set directly, try to see if it's in - // the environment variables (in most cases this won't work, but I was - // out of ideas) - char *lang = getenv( "LC_ALL"); - char *dot = lang ? strchr(lang, '.') : (char *)NULL; - if (!dot) - { - lang = getenv( "LC_CTYPE" ); - if ( lang ) - dot = strchr(lang, '.' ); - } - if (!dot) - { - lang = getenv( "LANG"); - if ( lang ) - dot = strchr(lang, '.'); - } - - if ( dot ) - { - encname = wxString::FromAscii( dot+1 ); - } - } -#endif // Win32/Unix - - return encname; -} - -/* static */ -wxFontEncoding wxLocale::GetSystemEncoding() -{ -#if defined(__WIN32__) && !defined(__WXMICROWIN__) - UINT codepage = ::GetACP(); - - // wxWidgets only knows about CP1250-1257, 874, 932, 936, 949, 950 - if ( codepage >= 1250 && codepage <= 1257 ) - { - return (wxFontEncoding)(wxFONTENCODING_CP1250 + codepage - 1250); - } - - if ( codepage == 874 ) - { - return wxFONTENCODING_CP874; - } - - if ( codepage == 932 ) - { - return wxFONTENCODING_CP932; - } - - if ( codepage == 936 ) - { - return wxFONTENCODING_CP936; - } - - if ( codepage == 949 ) - { - return wxFONTENCODING_CP949; - } - - if ( codepage == 950 ) - { - return wxFONTENCODING_CP950; - } -#elif defined(__WXMAC__) - TextEncoding encoding = 0 ; -#if TARGET_CARBON - encoding = CFStringGetSystemEncoding() ; -#else - UpgradeScriptInfoToTextEncoding ( smSystemScript , kTextLanguageDontCare , kTextRegionDontCare , NULL , &encoding ) ; -#endif - return wxMacGetFontEncFromSystemEnc( encoding ) ; -#elif defined(__UNIX_LIKE__) && wxUSE_FONTMAP - const wxString encname = GetSystemEncodingName(); - if ( !encname.empty() ) - { - wxFontEncoding enc = wxFontMapperBase::GetEncodingFromName(encname); - - // on some modern Linux systems (RedHat 8) the default system locale - // is UTF8 -- but it isn't supported by wxGTK1 in ANSI build at all so - // don't even try to use it in this case -#if !wxUSE_UNICODE && \ - ((defined(__WXGTK__) && !defined(__WXGTK20__)) || defined(__WXMOTIF__)) - if ( enc == wxFONTENCODING_UTF8 ) - { - // the most similar supported encoding... - enc = wxFONTENCODING_ISO8859_1; - } -#endif // !wxUSE_UNICODE - - // GetEncodingFromName() returns wxFONTENCODING_DEFAULT for C locale - // (a.k.a. US-ASCII) which is arguably a bug but keep it like this for - // backwards compatibility and just take care to not return - // wxFONTENCODING_DEFAULT from here as this surely doesn't make sense - if ( enc == wxFONTENCODING_DEFAULT ) - { - // we don't have wxFONTENCODING_ASCII, so use the closest one - return wxFONTENCODING_ISO8859_1; - } - - if ( enc != wxFONTENCODING_MAX ) - { - return enc; - } - //else: return wxFONTENCODING_SYSTEM below - } -#endif // Win32/Unix - - return wxFONTENCODING_SYSTEM; -} - -/* static */ -void wxLocale::AddLanguage(const wxLanguageInfo& info) -{ - CreateLanguagesDB(); - ms_languagesDB->Add(info); -} - -/* static */ -const wxLanguageInfo *wxLocale::GetLanguageInfo(int lang) -{ - CreateLanguagesDB(); - - // calling GetLanguageInfo(wxLANGUAGE_DEFAULT) is a natural thing to do, so - // make it work - if ( lang == wxLANGUAGE_DEFAULT ) - lang = GetSystemLanguage(); - - const size_t count = ms_languagesDB->GetCount(); - for ( size_t i = 0; i < count; i++ ) - { - if ( ms_languagesDB->Item(i).Language == lang ) - { - // We need to create a temporary here in order to make this work with BCC in final build mode - wxLanguageInfo *ptr = &ms_languagesDB->Item(i); - return ptr; - } - } - - return NULL; -} - -/* static */ -wxString wxLocale::GetLanguageName(int lang) -{ - const wxLanguageInfo *info = GetLanguageInfo(lang); - if ( !info ) - return wxEmptyString; - else - return info->Description; -} - -/* static */ -const wxLanguageInfo *wxLocale::FindLanguageInfo(const wxString& locale) -{ - CreateLanguagesDB(); - - const wxLanguageInfo *infoRet = NULL; - - const size_t count = ms_languagesDB->GetCount(); - for ( size_t i = 0; i < count; i++ ) - { - const wxLanguageInfo *info = &ms_languagesDB->Item(i); - - if ( wxStricmp(locale, info->CanonicalName) == 0 || - wxStricmp(locale, info->Description) == 0 ) - { - // exact match, stop searching - infoRet = info; - break; - } - - if ( wxStricmp(locale, info->CanonicalName.BeforeFirst(_T('_'))) == 0 ) - { - // a match -- but maybe we'll find an exact one later, so continue - // looking - // - // OTOH, maybe we had already found a language match and in this - // case don't overwrite it becauce the entry for the default - // country always appears first in ms_languagesDB - if ( !infoRet ) - infoRet = info; - } - } - - return infoRet; -} - -wxString wxLocale::GetSysName() const -{ - // FIXME -#ifndef __WXWINCE__ - return wxSetlocale(LC_ALL, NULL); -#else - return wxEmptyString; -#endif -} - -// clean up -wxLocale::~wxLocale() -{ - // free memory - wxMsgCatalog *pTmpCat; - while ( m_pMsgCat != NULL ) { - pTmpCat = m_pMsgCat; - m_pMsgCat = m_pMsgCat->m_pNext; - delete pTmpCat; - } - - // restore old locale pointer - wxSetLocale(m_pOldLocale); - - // FIXME -#ifndef __WXWINCE__ - wxSetlocale(LC_ALL, m_pszOldLocale); -#endif - free((wxChar *)m_pszOldLocale); // const_cast -} - -// get the translation of given string in current locale -const wxChar *wxLocale::GetString(const wxChar *szOrigString, - const wxChar *szDomain) const -{ - return GetString(szOrigString, szOrigString, size_t(-1), szDomain); -} - -const wxChar *wxLocale::GetString(const wxChar *szOrigString, - const wxChar *szOrigString2, - size_t n, - const wxChar *szDomain) const -{ - if ( wxIsEmpty(szOrigString) ) - return wxEmptyString; - - const wxChar *pszTrans = NULL; - wxMsgCatalog *pMsgCat; - - if ( szDomain != NULL && szDomain[0] ) - { - pMsgCat = FindCatalog(szDomain); - - // does the catalog exist? - if ( pMsgCat != NULL ) - pszTrans = pMsgCat->GetString(szOrigString, n); - } - else - { - // search in all domains - for ( pMsgCat = m_pMsgCat; pMsgCat != NULL; pMsgCat = pMsgCat->m_pNext ) - { - pszTrans = pMsgCat->GetString(szOrigString, n); - if ( pszTrans != NULL ) // take the first found - break; - } - } - - if ( pszTrans == NULL ) - { -#ifdef __WXDEBUG__ - if ( !NoTransErr::Suppress() ) - { - NoTransErr noTransErr; - - wxLogTrace(TRACE_I18N, - _T("string \"%s\"[%ld] not found in %slocale '%s'."), - szOrigString, (long)n, - szDomain ? wxString::Format(_T("domain '%s' "), szDomain).c_str() - : _T(""), - m_strLocale.c_str()); - } -#endif // __WXDEBUG__ - - if (n == size_t(-1)) - return szOrigString; - else - return n == 1 ? szOrigString : szOrigString2; - } - - return pszTrans; -} - -wxString wxLocale::GetHeaderValue( const wxChar* szHeader, - const wxChar* szDomain ) const -{ - if ( wxIsEmpty(szHeader) ) - return wxEmptyString; - - wxChar const * pszTrans = NULL; - wxMsgCatalog *pMsgCat; - - if ( szDomain != NULL ) - { - pMsgCat = FindCatalog(szDomain); - - // does the catalog exist? - if ( pMsgCat == NULL ) - return wxEmptyString; - - pszTrans = pMsgCat->GetString(wxEmptyString, (size_t)-1); - } - else - { - // search in all domains - for ( pMsgCat = m_pMsgCat; pMsgCat != NULL; pMsgCat = pMsgCat->m_pNext ) - { - pszTrans = pMsgCat->GetString(wxEmptyString, (size_t)-1); - if ( pszTrans != NULL ) // take the first found - break; - } - } - - if ( wxIsEmpty(pszTrans) ) - return wxEmptyString; - - wxChar const * pszFound = wxStrstr(pszTrans, szHeader); - if ( pszFound == NULL ) - return wxEmptyString; - - pszFound += wxStrlen(szHeader) + 2 /* ': ' */; - - // Every header is separated by \n - - wxChar const * pszEndLine = wxStrchr(pszFound, wxT('\n')); - if ( pszEndLine == NULL ) pszEndLine = pszFound + wxStrlen(pszFound); - - - // wxString( wxChar*, length); - wxString retVal( pszFound, pszEndLine - pszFound ); - - return retVal; -} - - -// find catalog by name in a linked list, return NULL if !found -wxMsgCatalog *wxLocale::FindCatalog(const wxChar *szDomain) const -{ - // linear search in the linked list - wxMsgCatalog *pMsgCat; - for ( pMsgCat = m_pMsgCat; pMsgCat != NULL; pMsgCat = pMsgCat->m_pNext ) - { - if ( wxStricmp(pMsgCat->GetName(), szDomain) == 0 ) - return pMsgCat; - } - - return NULL; -} - -// check if the given locale is provided by OS and C run time -/* static */ -bool wxLocale::IsAvailable(int lang) -{ - const wxLanguageInfo *info = wxLocale::GetLanguageInfo(lang); - wxCHECK_MSG( info, false, _T("invalid language") ); - -#if defined(__WIN32__) - if ( !info->WinLang ) - return false; - - if ( !::IsValidLocale - ( - MAKELCID(MAKELANGID(info->WinLang, info->WinSublang), - SORT_DEFAULT), - LCID_INSTALLED - ) ) - return false; - -#elif defined(__UNIX__) - - // Test if setting the locale works, then set it back. - wxMB2WXbuf oldLocale = wxSetlocale(LC_ALL, wxEmptyString); - wxMB2WXbuf tmp = wxSetlocaleTryUTF(LC_ALL, info->CanonicalName); - if ( !tmp ) - { - // Some C libraries don't like xx_YY form and require xx only - tmp = wxSetlocaleTryUTF(LC_ALL, info->CanonicalName.Left(2)); - if ( !tmp ) - return false; - } - // restore the original locale - wxSetlocale(LC_ALL, oldLocale); -#endif - - return true; -} - -// check if the given catalog is loaded -bool wxLocale::IsLoaded(const wxChar *szDomain) const -{ - return FindCatalog(szDomain) != NULL; -} - -// add a catalog to our linked list -bool wxLocale::AddCatalog(const wxChar *szDomain) -{ - return AddCatalog(szDomain, wxLANGUAGE_ENGLISH_US, NULL); -} - -// add a catalog to our linked list -bool wxLocale::AddCatalog(const wxChar *szDomain, - wxLanguage msgIdLanguage, - const wxChar *msgIdCharset) - -{ - wxMsgCatalog *pMsgCat = new wxMsgCatalog; - - if ( pMsgCat->Load(m_strShort, szDomain, msgIdCharset, m_bConvertEncoding) ) { - // add it to the head of the list so that in GetString it will - // be searched before the catalogs added earlier - pMsgCat->m_pNext = m_pMsgCat; - m_pMsgCat = pMsgCat; - - return true; - } - else { - // don't add it because it couldn't be loaded anyway - delete pMsgCat; - - // It is OK to not load catalog if the msgid language and m_language match, - // in which case we can directly display the texts embedded in program's - // source code: - if (m_language == msgIdLanguage) - return true; - - // If there's no exact match, we may still get partial match where the - // (basic) language is same, but the country differs. For example, it's - // permitted to use en_US strings from sources even if m_language is en_GB: - const wxLanguageInfo *msgIdLangInfo = GetLanguageInfo(msgIdLanguage); - if ( msgIdLangInfo && - msgIdLangInfo->CanonicalName.Mid(0, 2) == m_strShort.Mid(0, 2) ) - { - return true; - } - - return false; - } -} - -// ---------------------------------------------------------------------------- -// accessors for locale-dependent data -// ---------------------------------------------------------------------------- - -#ifdef __WXMSW__ - -/* static */ -wxString wxLocale::GetInfo(wxLocaleInfo index, wxLocaleCategory WXUNUSED(cat)) -{ - wxUint32 lcid = LOCALE_USER_DEFAULT; - - if (wxGetLocale()) - { - const wxLanguageInfo *info = GetLanguageInfo(wxGetLocale()->GetLanguage()); - if (info) - { ; - lcid = MAKELCID(MAKELANGID(info->WinLang, info->WinSublang), - SORT_DEFAULT); - } - } - - wxString str; - wxChar buffer[256]; - size_t count; - buffer[0] = wxT('\0'); - switch (index) - { - case wxLOCALE_DECIMAL_POINT: - count = ::GetLocaleInfo(lcid, LOCALE_SDECIMAL, buffer, 256); - if (!count) - str << wxT("."); - else - str << buffer; - break; -#if 0 - case wxSYS_LIST_SEPARATOR: - count = ::GetLocaleInfo(lcid, LOCALE_SLIST, buffer, 256); - if (!count) - str << wxT(","); - else - str << buffer; - break; - case wxSYS_LEADING_ZERO: // 0 means no leading zero, 1 means leading zero - count = ::GetLocaleInfo(lcid, LOCALE_ILZERO, buffer, 256); - if (!count) - str << wxT("0"); - else - str << buffer; - break; -#endif - default: - wxFAIL_MSG(wxT("Unknown System String !")); - } - return str; -} - -#elif defined(__DARWIN__) - -/* static */ -wxString wxLocale::GetInfo(wxLocaleInfo index, wxLocaleCategory WXUNUSED(cat)) -{ - CFLocaleRef userLocaleRefRaw; - if ( wxGetLocale() ) - { - userLocaleRefRaw = CFLocaleCreate - ( - kCFAllocatorDefault, - wxMacCFStringHolder(wxGetLocale()->GetCanonicalName()) - ); - } - else // no current locale, use the default one - { - userLocaleRefRaw = CFLocaleCopyCurrent(); - } - - wxCFRef userLocaleRef(userLocaleRefRaw); - - CFTypeRef cfstr; - switch ( index ) - { - case wxLOCALE_THOUSANDS_SEP: - cfstr = CFLocaleGetValue(userLocaleRef, kCFLocaleGroupingSeparator); - break; - - case wxLOCALE_DECIMAL_POINT: - cfstr = CFLocaleGetValue(userLocaleRef, kCFLocaleDecimalSeparator); - break; - - default: - wxFAIL_MSG( _T("Unknown locale info") ); - } - - wxMacCFStringHolder - str(CFStringCreateCopy(NULL, static_cast(cfstr))); - return str.AsString(); -} - -#else // !__WXMSW__ && !__DARWIN__ - -/* static */ -wxString wxLocale::GetInfo(wxLocaleInfo index, wxLocaleCategory cat) -{ - struct lconv *locale_info = localeconv(); - switch (cat) - { - case wxLOCALE_CAT_NUMBER: - switch (index) - { - case wxLOCALE_THOUSANDS_SEP: - return wxString(locale_info->thousands_sep, - *wxConvCurrent); - case wxLOCALE_DECIMAL_POINT: - return wxString(locale_info->decimal_point, - *wxConvCurrent); - default: - return wxEmptyString; - } - case wxLOCALE_CAT_MONEY: - switch (index) - { - case wxLOCALE_THOUSANDS_SEP: - return wxString(locale_info->mon_thousands_sep, - *wxConvCurrent); - case wxLOCALE_DECIMAL_POINT: - return wxString(locale_info->mon_decimal_point, - *wxConvCurrent); - default: - return wxEmptyString; - } - default: - return wxEmptyString; - } -} - -#endif // __WXMSW__/!__WXMSW__ - -// ---------------------------------------------------------------------------- -// global functions and variables -// ---------------------------------------------------------------------------- - -// retrieve/change current locale -// ------------------------------ - -// the current locale object -static wxLocale *g_pLocale = NULL; - -wxLocale *wxGetLocale() -{ - return g_pLocale; -} - -wxLocale *wxSetLocale(wxLocale *pLocale) -{ - wxLocale *pOld = g_pLocale; - g_pLocale = pLocale; - return pOld; -} - - - -// ---------------------------------------------------------------------------- -// wxLocale module (for lazy destruction of languagesDB) -// ---------------------------------------------------------------------------- - -class wxLocaleModule: public wxModule -{ - DECLARE_DYNAMIC_CLASS(wxLocaleModule) - public: - wxLocaleModule() {} - bool OnInit() { return true; } - void OnExit() { wxLocale::DestroyLanguagesDB(); } -}; - -IMPLEMENT_DYNAMIC_CLASS(wxLocaleModule, wxModule) - - - -// ---------------------------------------------------------------------------- -// default languages table & initialization -// ---------------------------------------------------------------------------- - - - -// --- --- --- generated code begins here --- --- --- - -// This table is generated by misc/languages/genlang.py -// When making changes, please put them into misc/languages/langtabl.txt - -#if !defined(__WIN32__) || defined(__WXMICROWIN__) - -#define SETWINLANG(info,lang,sublang) - -#else - -#define SETWINLANG(info,lang,sublang) \ - info.WinLang = lang, info.WinSublang = sublang; - -#ifndef LANG_AFRIKAANS -#define LANG_AFRIKAANS (0) -#endif -#ifndef LANG_ALBANIAN -#define LANG_ALBANIAN (0) -#endif -#ifndef LANG_ARABIC -#define LANG_ARABIC (0) -#endif -#ifndef LANG_ARMENIAN -#define LANG_ARMENIAN (0) -#endif -#ifndef LANG_ASSAMESE -#define LANG_ASSAMESE (0) -#endif -#ifndef LANG_AZERI -#define LANG_AZERI (0) -#endif -#ifndef LANG_BASQUE -#define LANG_BASQUE (0) -#endif -#ifndef LANG_BELARUSIAN -#define LANG_BELARUSIAN (0) -#endif -#ifndef LANG_BENGALI -#define LANG_BENGALI (0) -#endif -#ifndef LANG_BULGARIAN -#define LANG_BULGARIAN (0) -#endif -#ifndef LANG_CATALAN -#define LANG_CATALAN (0) -#endif -#ifndef LANG_CHINESE -#define LANG_CHINESE (0) -#endif -#ifndef LANG_CROATIAN -#define LANG_CROATIAN (0) -#endif -#ifndef LANG_CZECH -#define LANG_CZECH (0) -#endif -#ifndef LANG_DANISH -#define LANG_DANISH (0) -#endif -#ifndef LANG_DUTCH -#define LANG_DUTCH (0) -#endif -#ifndef LANG_ENGLISH -#define LANG_ENGLISH (0) -#endif -#ifndef LANG_ESTONIAN -#define LANG_ESTONIAN (0) -#endif -#ifndef LANG_FAEROESE -#define LANG_FAEROESE (0) -#endif -#ifndef LANG_FARSI -#define LANG_FARSI (0) -#endif -#ifndef LANG_FINNISH -#define LANG_FINNISH (0) -#endif -#ifndef LANG_FRENCH -#define LANG_FRENCH (0) -#endif -#ifndef LANG_GEORGIAN -#define LANG_GEORGIAN (0) -#endif -#ifndef LANG_GERMAN -#define LANG_GERMAN (0) -#endif -#ifndef LANG_GREEK -#define LANG_GREEK (0) -#endif -#ifndef LANG_GUJARATI -#define LANG_GUJARATI (0) -#endif -#ifndef LANG_HEBREW -#define LANG_HEBREW (0) -#endif -#ifndef LANG_HINDI -#define LANG_HINDI (0) -#endif -#ifndef LANG_HUNGARIAN -#define LANG_HUNGARIAN (0) -#endif -#ifndef LANG_ICELANDIC -#define LANG_ICELANDIC (0) -#endif -#ifndef LANG_INDONESIAN -#define LANG_INDONESIAN (0) -#endif -#ifndef LANG_ITALIAN -#define LANG_ITALIAN (0) -#endif -#ifndef LANG_JAPANESE -#define LANG_JAPANESE (0) -#endif -#ifndef LANG_KANNADA -#define LANG_KANNADA (0) -#endif -#ifndef LANG_KASHMIRI -#define LANG_KASHMIRI (0) -#endif -#ifndef LANG_KAZAK -#define LANG_KAZAK (0) -#endif -#ifndef LANG_KONKANI -#define LANG_KONKANI (0) -#endif -#ifndef LANG_KOREAN -#define LANG_KOREAN (0) -#endif -#ifndef LANG_LATVIAN -#define LANG_LATVIAN (0) -#endif -#ifndef LANG_LITHUANIAN -#define LANG_LITHUANIAN (0) -#endif -#ifndef LANG_MACEDONIAN -#define LANG_MACEDONIAN (0) -#endif -#ifndef LANG_MALAY -#define LANG_MALAY (0) -#endif -#ifndef LANG_MALAYALAM -#define LANG_MALAYALAM (0) -#endif -#ifndef LANG_MANIPURI -#define LANG_MANIPURI (0) -#endif -#ifndef LANG_MARATHI -#define LANG_MARATHI (0) -#endif -#ifndef LANG_NEPALI -#define LANG_NEPALI (0) -#endif -#ifndef LANG_NORWEGIAN -#define LANG_NORWEGIAN (0) -#endif -#ifndef LANG_ORIYA -#define LANG_ORIYA (0) -#endif -#ifndef LANG_POLISH -#define LANG_POLISH (0) -#endif -#ifndef LANG_PORTUGUESE -#define LANG_PORTUGUESE (0) -#endif -#ifndef LANG_PUNJABI -#define LANG_PUNJABI (0) -#endif -#ifndef LANG_ROMANIAN -#define LANG_ROMANIAN (0) -#endif -#ifndef LANG_RUSSIAN -#define LANG_RUSSIAN (0) -#endif -#ifndef LANG_SAMI -#define LANG_SAMI (0) -#endif -#ifndef LANG_SANSKRIT -#define LANG_SANSKRIT (0) -#endif -#ifndef LANG_SERBIAN -#define LANG_SERBIAN (0) -#endif -#ifndef LANG_SINDHI -#define LANG_SINDHI (0) -#endif -#ifndef LANG_SLOVAK -#define LANG_SLOVAK (0) -#endif -#ifndef LANG_SLOVENIAN -#define LANG_SLOVENIAN (0) -#endif -#ifndef LANG_SPANISH -#define LANG_SPANISH (0) -#endif -#ifndef LANG_SWAHILI -#define LANG_SWAHILI (0) -#endif -#ifndef LANG_SWEDISH -#define LANG_SWEDISH (0) -#endif -#ifndef LANG_TAMIL -#define LANG_TAMIL (0) -#endif -#ifndef LANG_TATAR -#define LANG_TATAR (0) -#endif -#ifndef LANG_TELUGU -#define LANG_TELUGU (0) -#endif -#ifndef LANG_THAI -#define LANG_THAI (0) -#endif -#ifndef LANG_TURKISH -#define LANG_TURKISH (0) -#endif -#ifndef LANG_UKRAINIAN -#define LANG_UKRAINIAN (0) -#endif -#ifndef LANG_URDU -#define LANG_URDU (0) -#endif -#ifndef LANG_UZBEK -#define LANG_UZBEK (0) -#endif -#ifndef LANG_VALENCIAN -#define LANG_VALENCIAN (0) -#endif -#ifndef LANG_VIETNAMESE -#define LANG_VIETNAMESE (0) -#endif -#ifndef SUBLANG_ARABIC_ALGERIA -#define SUBLANG_ARABIC_ALGERIA SUBLANG_DEFAULT -#endif -#ifndef SUBLANG_ARABIC_BAHRAIN -#define SUBLANG_ARABIC_BAHRAIN SUBLANG_DEFAULT -#endif -#ifndef SUBLANG_ARABIC_EGYPT -#define SUBLANG_ARABIC_EGYPT SUBLANG_DEFAULT -#endif -#ifndef SUBLANG_ARABIC_IRAQ -#define SUBLANG_ARABIC_IRAQ SUBLANG_DEFAULT -#endif -#ifndef SUBLANG_ARABIC_JORDAN -#define SUBLANG_ARABIC_JORDAN SUBLANG_DEFAULT -#endif -#ifndef SUBLANG_ARABIC_KUWAIT -#define SUBLANG_ARABIC_KUWAIT SUBLANG_DEFAULT -#endif -#ifndef SUBLANG_ARABIC_LEBANON -#define SUBLANG_ARABIC_LEBANON SUBLANG_DEFAULT -#endif -#ifndef SUBLANG_ARABIC_LIBYA -#define SUBLANG_ARABIC_LIBYA SUBLANG_DEFAULT -#endif -#ifndef SUBLANG_ARABIC_MOROCCO -#define SUBLANG_ARABIC_MOROCCO SUBLANG_DEFAULT -#endif -#ifndef SUBLANG_ARABIC_OMAN -#define SUBLANG_ARABIC_OMAN SUBLANG_DEFAULT -#endif -#ifndef SUBLANG_ARABIC_QATAR -#define SUBLANG_ARABIC_QATAR SUBLANG_DEFAULT -#endif -#ifndef SUBLANG_ARABIC_SAUDI_ARABIA -#define SUBLANG_ARABIC_SAUDI_ARABIA SUBLANG_DEFAULT -#endif -#ifndef SUBLANG_ARABIC_SYRIA -#define SUBLANG_ARABIC_SYRIA SUBLANG_DEFAULT -#endif -#ifndef SUBLANG_ARABIC_TUNISIA -#define SUBLANG_ARABIC_TUNISIA SUBLANG_DEFAULT -#endif -#ifndef SUBLANG_ARABIC_UAE -#define SUBLANG_ARABIC_UAE SUBLANG_DEFAULT -#endif -#ifndef SUBLANG_ARABIC_YEMEN -#define SUBLANG_ARABIC_YEMEN SUBLANG_DEFAULT -#endif -#ifndef SUBLANG_AZERI_CYRILLIC -#define SUBLANG_AZERI_CYRILLIC SUBLANG_DEFAULT -#endif -#ifndef SUBLANG_AZERI_LATIN -#define SUBLANG_AZERI_LATIN SUBLANG_DEFAULT -#endif -#ifndef SUBLANG_CHINESE_SIMPLIFIED -#define SUBLANG_CHINESE_SIMPLIFIED SUBLANG_DEFAULT -#endif -#ifndef SUBLANG_CHINESE_TRADITIONAL -#define SUBLANG_CHINESE_TRADITIONAL SUBLANG_DEFAULT -#endif -#ifndef SUBLANG_CHINESE_HONGKONG -#define SUBLANG_CHINESE_HONGKONG SUBLANG_DEFAULT -#endif -#ifndef SUBLANG_CHINESE_MACAU -#define SUBLANG_CHINESE_MACAU SUBLANG_DEFAULT -#endif -#ifndef SUBLANG_CHINESE_SINGAPORE -#define SUBLANG_CHINESE_SINGAPORE SUBLANG_DEFAULT -#endif -#ifndef SUBLANG_DUTCH -#define SUBLANG_DUTCH SUBLANG_DEFAULT -#endif -#ifndef SUBLANG_DUTCH_BELGIAN -#define SUBLANG_DUTCH_BELGIAN SUBLANG_DEFAULT -#endif -#ifndef SUBLANG_ENGLISH_UK -#define SUBLANG_ENGLISH_UK SUBLANG_DEFAULT -#endif -#ifndef SUBLANG_ENGLISH_US -#define SUBLANG_ENGLISH_US SUBLANG_DEFAULT -#endif -#ifndef SUBLANG_ENGLISH_AUS -#define SUBLANG_ENGLISH_AUS SUBLANG_DEFAULT -#endif -#ifndef SUBLANG_ENGLISH_BELIZE -#define SUBLANG_ENGLISH_BELIZE SUBLANG_DEFAULT -#endif -#ifndef SUBLANG_ENGLISH_CAN -#define SUBLANG_ENGLISH_CAN SUBLANG_DEFAULT -#endif -#ifndef SUBLANG_ENGLISH_CARIBBEAN -#define SUBLANG_ENGLISH_CARIBBEAN SUBLANG_DEFAULT -#endif -#ifndef SUBLANG_ENGLISH_EIRE -#define SUBLANG_ENGLISH_EIRE SUBLANG_DEFAULT -#endif -#ifndef SUBLANG_ENGLISH_JAMAICA -#define SUBLANG_ENGLISH_JAMAICA SUBLANG_DEFAULT -#endif -#ifndef SUBLANG_ENGLISH_NZ -#define SUBLANG_ENGLISH_NZ SUBLANG_DEFAULT -#endif -#ifndef SUBLANG_ENGLISH_PHILIPPINES -#define SUBLANG_ENGLISH_PHILIPPINES SUBLANG_DEFAULT -#endif -#ifndef SUBLANG_ENGLISH_SOUTH_AFRICA -#define SUBLANG_ENGLISH_SOUTH_AFRICA SUBLANG_DEFAULT -#endif -#ifndef SUBLANG_ENGLISH_TRINIDAD -#define SUBLANG_ENGLISH_TRINIDAD SUBLANG_DEFAULT -#endif -#ifndef SUBLANG_ENGLISH_ZIMBABWE -#define SUBLANG_ENGLISH_ZIMBABWE SUBLANG_DEFAULT -#endif -#ifndef SUBLANG_FRENCH -#define SUBLANG_FRENCH SUBLANG_DEFAULT -#endif -#ifndef SUBLANG_FRENCH_BELGIAN -#define SUBLANG_FRENCH_BELGIAN SUBLANG_DEFAULT -#endif -#ifndef SUBLANG_FRENCH_CANADIAN -#define SUBLANG_FRENCH_CANADIAN SUBLANG_DEFAULT -#endif -#ifndef SUBLANG_FRENCH_LUXEMBOURG -#define SUBLANG_FRENCH_LUXEMBOURG SUBLANG_DEFAULT -#endif -#ifndef SUBLANG_FRENCH_MONACO -#define SUBLANG_FRENCH_MONACO SUBLANG_DEFAULT -#endif -#ifndef SUBLANG_FRENCH_SWISS -#define SUBLANG_FRENCH_SWISS SUBLANG_DEFAULT -#endif -#ifndef SUBLANG_GERMAN -#define SUBLANG_GERMAN SUBLANG_DEFAULT -#endif -#ifndef SUBLANG_GERMAN_AUSTRIAN -#define SUBLANG_GERMAN_AUSTRIAN SUBLANG_DEFAULT -#endif -#ifndef SUBLANG_GERMAN_LIECHTENSTEIN -#define SUBLANG_GERMAN_LIECHTENSTEIN SUBLANG_DEFAULT -#endif -#ifndef SUBLANG_GERMAN_LUXEMBOURG -#define SUBLANG_GERMAN_LUXEMBOURG SUBLANG_DEFAULT -#endif -#ifndef SUBLANG_GERMAN_SWISS -#define SUBLANG_GERMAN_SWISS SUBLANG_DEFAULT -#endif -#ifndef SUBLANG_ITALIAN -#define SUBLANG_ITALIAN SUBLANG_DEFAULT -#endif -#ifndef SUBLANG_ITALIAN_SWISS -#define SUBLANG_ITALIAN_SWISS SUBLANG_DEFAULT -#endif -#ifndef SUBLANG_KASHMIRI_INDIA -#define SUBLANG_KASHMIRI_INDIA SUBLANG_DEFAULT -#endif -#ifndef SUBLANG_KOREAN -#define SUBLANG_KOREAN SUBLANG_DEFAULT -#endif -#ifndef SUBLANG_LITHUANIAN -#define SUBLANG_LITHUANIAN SUBLANG_DEFAULT -#endif -#ifndef SUBLANG_MALAY_BRUNEI_DARUSSALAM -#define SUBLANG_MALAY_BRUNEI_DARUSSALAM SUBLANG_DEFAULT -#endif -#ifndef SUBLANG_MALAY_MALAYSIA -#define SUBLANG_MALAY_MALAYSIA SUBLANG_DEFAULT -#endif -#ifndef SUBLANG_NEPALI_INDIA -#define SUBLANG_NEPALI_INDIA SUBLANG_DEFAULT -#endif -#ifndef SUBLANG_NORWEGIAN_BOKMAL -#define SUBLANG_NORWEGIAN_BOKMAL SUBLANG_DEFAULT -#endif -#ifndef SUBLANG_NORWEGIAN_NYNORSK -#define SUBLANG_NORWEGIAN_NYNORSK SUBLANG_DEFAULT -#endif -#ifndef SUBLANG_PORTUGUESE -#define SUBLANG_PORTUGUESE SUBLANG_DEFAULT -#endif -#ifndef SUBLANG_PORTUGUESE_BRAZILIAN -#define SUBLANG_PORTUGUESE_BRAZILIAN SUBLANG_DEFAULT -#endif -#ifndef SUBLANG_SERBIAN_CYRILLIC -#define SUBLANG_SERBIAN_CYRILLIC SUBLANG_DEFAULT -#endif -#ifndef SUBLANG_SERBIAN_LATIN -#define SUBLANG_SERBIAN_LATIN SUBLANG_DEFAULT -#endif -#ifndef SUBLANG_SPANISH -#define SUBLANG_SPANISH SUBLANG_DEFAULT -#endif -#ifndef SUBLANG_SPANISH_ARGENTINA -#define SUBLANG_SPANISH_ARGENTINA SUBLANG_DEFAULT -#endif -#ifndef SUBLANG_SPANISH_BOLIVIA -#define SUBLANG_SPANISH_BOLIVIA SUBLANG_DEFAULT -#endif -#ifndef SUBLANG_SPANISH_CHILE -#define SUBLANG_SPANISH_CHILE SUBLANG_DEFAULT -#endif -#ifndef SUBLANG_SPANISH_COLOMBIA -#define SUBLANG_SPANISH_COLOMBIA SUBLANG_DEFAULT -#endif -#ifndef SUBLANG_SPANISH_COSTA_RICA -#define SUBLANG_SPANISH_COSTA_RICA SUBLANG_DEFAULT -#endif -#ifndef SUBLANG_SPANISH_DOMINICAN_REPUBLIC -#define SUBLANG_SPANISH_DOMINICAN_REPUBLIC SUBLANG_DEFAULT -#endif -#ifndef SUBLANG_SPANISH_ECUADOR -#define SUBLANG_SPANISH_ECUADOR SUBLANG_DEFAULT -#endif -#ifndef SUBLANG_SPANISH_EL_SALVADOR -#define SUBLANG_SPANISH_EL_SALVADOR SUBLANG_DEFAULT -#endif -#ifndef SUBLANG_SPANISH_GUATEMALA -#define SUBLANG_SPANISH_GUATEMALA SUBLANG_DEFAULT -#endif -#ifndef SUBLANG_SPANISH_HONDURAS -#define SUBLANG_SPANISH_HONDURAS SUBLANG_DEFAULT -#endif -#ifndef SUBLANG_SPANISH_MEXICAN -#define SUBLANG_SPANISH_MEXICAN SUBLANG_DEFAULT -#endif -#ifndef SUBLANG_SPANISH_MODERN -#define SUBLANG_SPANISH_MODERN SUBLANG_DEFAULT -#endif -#ifndef SUBLANG_SPANISH_NICARAGUA -#define SUBLANG_SPANISH_NICARAGUA SUBLANG_DEFAULT -#endif -#ifndef SUBLANG_SPANISH_PANAMA -#define SUBLANG_SPANISH_PANAMA SUBLANG_DEFAULT -#endif -#ifndef SUBLANG_SPANISH_PARAGUAY -#define SUBLANG_SPANISH_PARAGUAY SUBLANG_DEFAULT -#endif -#ifndef SUBLANG_SPANISH_PERU -#define SUBLANG_SPANISH_PERU SUBLANG_DEFAULT -#endif -#ifndef SUBLANG_SPANISH_PUERTO_RICO -#define SUBLANG_SPANISH_PUERTO_RICO SUBLANG_DEFAULT -#endif -#ifndef SUBLANG_SPANISH_URUGUAY -#define SUBLANG_SPANISH_URUGUAY SUBLANG_DEFAULT -#endif -#ifndef SUBLANG_SPANISH_VENEZUELA -#define SUBLANG_SPANISH_VENEZUELA SUBLANG_DEFAULT -#endif -#ifndef SUBLANG_SWEDISH -#define SUBLANG_SWEDISH SUBLANG_DEFAULT -#endif -#ifndef SUBLANG_SWEDISH_FINLAND -#define SUBLANG_SWEDISH_FINLAND SUBLANG_DEFAULT -#endif -#ifndef SUBLANG_URDU_INDIA -#define SUBLANG_URDU_INDIA SUBLANG_DEFAULT -#endif -#ifndef SUBLANG_URDU_PAKISTAN -#define SUBLANG_URDU_PAKISTAN SUBLANG_DEFAULT -#endif -#ifndef SUBLANG_UZBEK_CYRILLIC -#define SUBLANG_UZBEK_CYRILLIC SUBLANG_DEFAULT -#endif -#ifndef SUBLANG_UZBEK_LATIN -#define SUBLANG_UZBEK_LATIN SUBLANG_DEFAULT -#endif - - -#endif // __WIN32__ - -#define LNG(wxlang, canonical, winlang, winsublang, layout, desc) \ - info.Language = wxlang; \ - info.CanonicalName = wxT(canonical); \ - info.LayoutDirection = layout; \ - info.Description = wxT(desc); \ - SETWINLANG(info, winlang, winsublang) \ - AddLanguage(info); - -void wxLocale::InitLanguagesDB() -{ - wxLanguageInfo info; - wxStringTokenizer tkn; - - LNG(wxLANGUAGE_ABKHAZIAN, "ab" , 0 , 0 , wxLayout_LeftToRight, "Abkhazian") - LNG(wxLANGUAGE_AFAR, "aa" , 0 , 0 , wxLayout_LeftToRight, "Afar") - LNG(wxLANGUAGE_AFRIKAANS, "af_ZA", LANG_AFRIKAANS , SUBLANG_DEFAULT , wxLayout_LeftToRight, "Afrikaans") - LNG(wxLANGUAGE_ALBANIAN, "sq_AL", LANG_ALBANIAN , SUBLANG_DEFAULT , wxLayout_LeftToRight, "Albanian") - LNG(wxLANGUAGE_AMHARIC, "am" , 0 , 0 , wxLayout_LeftToRight, "Amharic") - LNG(wxLANGUAGE_ARABIC, "ar" , LANG_ARABIC , SUBLANG_DEFAULT , wxLayout_RightToLeft, "Arabic") - LNG(wxLANGUAGE_ARABIC_ALGERIA, "ar_DZ", LANG_ARABIC , SUBLANG_ARABIC_ALGERIA , wxLayout_RightToLeft, "Arabic (Algeria)") - LNG(wxLANGUAGE_ARABIC_BAHRAIN, "ar_BH", LANG_ARABIC , SUBLANG_ARABIC_BAHRAIN , wxLayout_RightToLeft, "Arabic (Bahrain)") - LNG(wxLANGUAGE_ARABIC_EGYPT, "ar_EG", LANG_ARABIC , SUBLANG_ARABIC_EGYPT , wxLayout_RightToLeft, "Arabic (Egypt)") - LNG(wxLANGUAGE_ARABIC_IRAQ, "ar_IQ", LANG_ARABIC , SUBLANG_ARABIC_IRAQ , wxLayout_RightToLeft, "Arabic (Iraq)") - LNG(wxLANGUAGE_ARABIC_JORDAN, "ar_JO", LANG_ARABIC , SUBLANG_ARABIC_JORDAN , wxLayout_RightToLeft, "Arabic (Jordan)") - LNG(wxLANGUAGE_ARABIC_KUWAIT, "ar_KW", LANG_ARABIC , SUBLANG_ARABIC_KUWAIT , wxLayout_RightToLeft, "Arabic (Kuwait)") - LNG(wxLANGUAGE_ARABIC_LEBANON, "ar_LB", LANG_ARABIC , SUBLANG_ARABIC_LEBANON , wxLayout_RightToLeft, "Arabic (Lebanon)") - LNG(wxLANGUAGE_ARABIC_LIBYA, "ar_LY", LANG_ARABIC , SUBLANG_ARABIC_LIBYA , wxLayout_RightToLeft, "Arabic (Libya)") - LNG(wxLANGUAGE_ARABIC_MOROCCO, "ar_MA", LANG_ARABIC , SUBLANG_ARABIC_MOROCCO , wxLayout_RightToLeft, "Arabic (Morocco)") - LNG(wxLANGUAGE_ARABIC_OMAN, "ar_OM", LANG_ARABIC , SUBLANG_ARABIC_OMAN , wxLayout_RightToLeft, "Arabic (Oman)") - LNG(wxLANGUAGE_ARABIC_QATAR, "ar_QA", LANG_ARABIC , SUBLANG_ARABIC_QATAR , wxLayout_RightToLeft, "Arabic (Qatar)") - LNG(wxLANGUAGE_ARABIC_SAUDI_ARABIA, "ar_SA", LANG_ARABIC , SUBLANG_ARABIC_SAUDI_ARABIA , wxLayout_RightToLeft, "Arabic (Saudi Arabia)") - LNG(wxLANGUAGE_ARABIC_SUDAN, "ar_SD", 0 , 0 , wxLayout_RightToLeft, "Arabic (Sudan)") - LNG(wxLANGUAGE_ARABIC_SYRIA, "ar_SY", LANG_ARABIC , SUBLANG_ARABIC_SYRIA , wxLayout_RightToLeft, "Arabic (Syria)") - LNG(wxLANGUAGE_ARABIC_TUNISIA, "ar_TN", LANG_ARABIC , SUBLANG_ARABIC_TUNISIA , wxLayout_RightToLeft, "Arabic (Tunisia)") - LNG(wxLANGUAGE_ARABIC_UAE, "ar_AE", LANG_ARABIC , SUBLANG_ARABIC_UAE , wxLayout_RightToLeft, "Arabic (Uae)") - LNG(wxLANGUAGE_ARABIC_YEMEN, "ar_YE", LANG_ARABIC , SUBLANG_ARABIC_YEMEN , wxLayout_RightToLeft, "Arabic (Yemen)") - LNG(wxLANGUAGE_ARMENIAN, "hy" , LANG_ARMENIAN , SUBLANG_DEFAULT , wxLayout_LeftToRight, "Armenian") - LNG(wxLANGUAGE_ASSAMESE, "as" , LANG_ASSAMESE , SUBLANG_DEFAULT , wxLayout_LeftToRight, "Assamese") - LNG(wxLANGUAGE_AYMARA, "ay" , 0 , 0 , wxLayout_LeftToRight, "Aymara") - LNG(wxLANGUAGE_AZERI, "az" , LANG_AZERI , SUBLANG_DEFAULT , wxLayout_LeftToRight, "Azeri") - LNG(wxLANGUAGE_AZERI_CYRILLIC, "az" , LANG_AZERI , SUBLANG_AZERI_CYRILLIC , wxLayout_LeftToRight, "Azeri (Cyrillic)") - LNG(wxLANGUAGE_AZERI_LATIN, "az" , LANG_AZERI , SUBLANG_AZERI_LATIN , wxLayout_LeftToRight, "Azeri (Latin)") - LNG(wxLANGUAGE_BASHKIR, "ba" , 0 , 0 , wxLayout_LeftToRight, "Bashkir") - LNG(wxLANGUAGE_BASQUE, "eu_ES", LANG_BASQUE , SUBLANG_DEFAULT , wxLayout_LeftToRight, "Basque") - LNG(wxLANGUAGE_BELARUSIAN, "be_BY", LANG_BELARUSIAN, SUBLANG_DEFAULT , wxLayout_LeftToRight, "Belarusian") - LNG(wxLANGUAGE_BENGALI, "bn" , LANG_BENGALI , SUBLANG_DEFAULT , wxLayout_LeftToRight, "Bengali") - LNG(wxLANGUAGE_BHUTANI, "dz" , 0 , 0 , wxLayout_LeftToRight, "Bhutani") - LNG(wxLANGUAGE_BIHARI, "bh" , 0 , 0 , wxLayout_LeftToRight, "Bihari") - LNG(wxLANGUAGE_BISLAMA, "bi" , 0 , 0 , wxLayout_LeftToRight, "Bislama") - LNG(wxLANGUAGE_BRETON, "br" , 0 , 0 , wxLayout_LeftToRight, "Breton") - LNG(wxLANGUAGE_BULGARIAN, "bg_BG", LANG_BULGARIAN , SUBLANG_DEFAULT , wxLayout_LeftToRight, "Bulgarian") - LNG(wxLANGUAGE_BURMESE, "my" , 0 , 0 , wxLayout_LeftToRight, "Burmese") - LNG(wxLANGUAGE_CAMBODIAN, "km" , 0 , 0 , wxLayout_LeftToRight, "Cambodian") - LNG(wxLANGUAGE_CATALAN, "ca_ES", LANG_CATALAN , SUBLANG_DEFAULT , wxLayout_LeftToRight, "Catalan") - LNG(wxLANGUAGE_CHINESE, "zh_TW", LANG_CHINESE , SUBLANG_DEFAULT , wxLayout_LeftToRight, "Chinese") - LNG(wxLANGUAGE_CHINESE_SIMPLIFIED, "zh_CN", LANG_CHINESE , SUBLANG_CHINESE_SIMPLIFIED , wxLayout_LeftToRight, "Chinese (Simplified)") - LNG(wxLANGUAGE_CHINESE_TRADITIONAL, "zh_TW", LANG_CHINESE , SUBLANG_CHINESE_TRADITIONAL , wxLayout_LeftToRight, "Chinese (Traditional)") - LNG(wxLANGUAGE_CHINESE_HONGKONG, "zh_HK", LANG_CHINESE , SUBLANG_CHINESE_HONGKONG , wxLayout_LeftToRight, "Chinese (Hongkong)") - LNG(wxLANGUAGE_CHINESE_MACAU, "zh_MO", LANG_CHINESE , SUBLANG_CHINESE_MACAU , wxLayout_LeftToRight, "Chinese (Macau)") - LNG(wxLANGUAGE_CHINESE_SINGAPORE, "zh_SG", LANG_CHINESE , SUBLANG_CHINESE_SINGAPORE , wxLayout_LeftToRight, "Chinese (Singapore)") - LNG(wxLANGUAGE_CHINESE_TAIWAN, "zh_TW", LANG_CHINESE , SUBLANG_CHINESE_TRADITIONAL , wxLayout_LeftToRight, "Chinese (Taiwan)") - LNG(wxLANGUAGE_CORSICAN, "co" , 0 , 0 , wxLayout_LeftToRight, "Corsican") - LNG(wxLANGUAGE_CROATIAN, "hr_HR", LANG_CROATIAN , SUBLANG_DEFAULT , wxLayout_LeftToRight, "Croatian") - LNG(wxLANGUAGE_CZECH, "cs_CZ", LANG_CZECH , SUBLANG_DEFAULT , wxLayout_LeftToRight, "Czech") - LNG(wxLANGUAGE_DANISH, "da_DK", LANG_DANISH , SUBLANG_DEFAULT , wxLayout_LeftToRight, "Danish") - LNG(wxLANGUAGE_DUTCH, "nl_NL", LANG_DUTCH , SUBLANG_DUTCH , wxLayout_LeftToRight, "Dutch") - LNG(wxLANGUAGE_DUTCH_BELGIAN, "nl_BE", LANG_DUTCH , SUBLANG_DUTCH_BELGIAN , wxLayout_LeftToRight, "Dutch (Belgian)") - LNG(wxLANGUAGE_ENGLISH, "en_GB", LANG_ENGLISH , SUBLANG_ENGLISH_UK , wxLayout_LeftToRight, "English") - LNG(wxLANGUAGE_ENGLISH_UK, "en_GB", LANG_ENGLISH , SUBLANG_ENGLISH_UK , wxLayout_LeftToRight, "English (U.K.)") - LNG(wxLANGUAGE_ENGLISH_US, "en_US", LANG_ENGLISH , SUBLANG_ENGLISH_US , wxLayout_LeftToRight, "English (U.S.)") - LNG(wxLANGUAGE_ENGLISH_AUSTRALIA, "en_AU", LANG_ENGLISH , SUBLANG_ENGLISH_AUS , wxLayout_LeftToRight, "English (Australia)") - LNG(wxLANGUAGE_ENGLISH_BELIZE, "en_BZ", LANG_ENGLISH , SUBLANG_ENGLISH_BELIZE , wxLayout_LeftToRight, "English (Belize)") - LNG(wxLANGUAGE_ENGLISH_BOTSWANA, "en_BW", 0 , 0 , wxLayout_LeftToRight, "English (Botswana)") - LNG(wxLANGUAGE_ENGLISH_CANADA, "en_CA", LANG_ENGLISH , SUBLANG_ENGLISH_CAN , wxLayout_LeftToRight, "English (Canada)") - LNG(wxLANGUAGE_ENGLISH_CARIBBEAN, "en_CB", LANG_ENGLISH , SUBLANG_ENGLISH_CARIBBEAN , wxLayout_LeftToRight, "English (Caribbean)") - LNG(wxLANGUAGE_ENGLISH_DENMARK, "en_DK", 0 , 0 , wxLayout_LeftToRight, "English (Denmark)") - LNG(wxLANGUAGE_ENGLISH_EIRE, "en_IE", LANG_ENGLISH , SUBLANG_ENGLISH_EIRE , wxLayout_LeftToRight, "English (Eire)") - LNG(wxLANGUAGE_ENGLISH_JAMAICA, "en_JM", LANG_ENGLISH , SUBLANG_ENGLISH_JAMAICA , wxLayout_LeftToRight, "English (Jamaica)") - LNG(wxLANGUAGE_ENGLISH_NEW_ZEALAND, "en_NZ", LANG_ENGLISH , SUBLANG_ENGLISH_NZ , wxLayout_LeftToRight, "English (New Zealand)") - LNG(wxLANGUAGE_ENGLISH_PHILIPPINES, "en_PH", LANG_ENGLISH , SUBLANG_ENGLISH_PHILIPPINES , wxLayout_LeftToRight, "English (Philippines)") - LNG(wxLANGUAGE_ENGLISH_SOUTH_AFRICA, "en_ZA", LANG_ENGLISH , SUBLANG_ENGLISH_SOUTH_AFRICA , wxLayout_LeftToRight, "English (South Africa)") - LNG(wxLANGUAGE_ENGLISH_TRINIDAD, "en_TT", LANG_ENGLISH , SUBLANG_ENGLISH_TRINIDAD , wxLayout_LeftToRight, "English (Trinidad)") - LNG(wxLANGUAGE_ENGLISH_ZIMBABWE, "en_ZW", LANG_ENGLISH , SUBLANG_ENGLISH_ZIMBABWE , wxLayout_LeftToRight, "English (Zimbabwe)") - LNG(wxLANGUAGE_ESPERANTO, "eo" , 0 , 0 , wxLayout_LeftToRight, "Esperanto") - LNG(wxLANGUAGE_ESTONIAN, "et_EE", LANG_ESTONIAN , SUBLANG_DEFAULT , wxLayout_LeftToRight, "Estonian") - LNG(wxLANGUAGE_FAEROESE, "fo_FO", LANG_FAEROESE , SUBLANG_DEFAULT , wxLayout_LeftToRight, "Faeroese") - LNG(wxLANGUAGE_FARSI, "fa_IR", LANG_FARSI , SUBLANG_DEFAULT , wxLayout_RightToLeft, "Farsi") - LNG(wxLANGUAGE_FIJI, "fj" , 0 , 0 , wxLayout_LeftToRight, "Fiji") - LNG(wxLANGUAGE_FINNISH, "fi_FI", LANG_FINNISH , SUBLANG_DEFAULT , wxLayout_LeftToRight, "Finnish") - LNG(wxLANGUAGE_FRENCH, "fr_FR", LANG_FRENCH , SUBLANG_FRENCH , wxLayout_LeftToRight, "French") - LNG(wxLANGUAGE_FRENCH_BELGIAN, "fr_BE", LANG_FRENCH , SUBLANG_FRENCH_BELGIAN , wxLayout_LeftToRight, "French (Belgian)") - LNG(wxLANGUAGE_FRENCH_CANADIAN, "fr_CA", LANG_FRENCH , SUBLANG_FRENCH_CANADIAN , wxLayout_LeftToRight, "French (Canadian)") - LNG(wxLANGUAGE_FRENCH_LUXEMBOURG, "fr_LU", LANG_FRENCH , SUBLANG_FRENCH_LUXEMBOURG , wxLayout_LeftToRight, "French (Luxembourg)") - LNG(wxLANGUAGE_FRENCH_MONACO, "fr_MC", LANG_FRENCH , SUBLANG_FRENCH_MONACO , wxLayout_LeftToRight, "French (Monaco)") - LNG(wxLANGUAGE_FRENCH_SWISS, "fr_CH", LANG_FRENCH , SUBLANG_FRENCH_SWISS , wxLayout_LeftToRight, "French (Swiss)") - LNG(wxLANGUAGE_FRISIAN, "fy" , 0 , 0 , wxLayout_LeftToRight, "Frisian") - LNG(wxLANGUAGE_GALICIAN, "gl_ES", 0 , 0 , wxLayout_LeftToRight, "Galician") - LNG(wxLANGUAGE_GEORGIAN, "ka_GE", LANG_GEORGIAN , SUBLANG_DEFAULT , wxLayout_LeftToRight, "Georgian") - LNG(wxLANGUAGE_GERMAN, "de_DE", LANG_GERMAN , SUBLANG_GERMAN , wxLayout_LeftToRight, "German") - LNG(wxLANGUAGE_GERMAN_AUSTRIAN, "de_AT", LANG_GERMAN , SUBLANG_GERMAN_AUSTRIAN , wxLayout_LeftToRight, "German (Austrian)") - LNG(wxLANGUAGE_GERMAN_BELGIUM, "de_BE", 0 , 0 , wxLayout_LeftToRight, "German (Belgium)") - LNG(wxLANGUAGE_GERMAN_LIECHTENSTEIN, "de_LI", LANG_GERMAN , SUBLANG_GERMAN_LIECHTENSTEIN , wxLayout_LeftToRight, "German (Liechtenstein)") - LNG(wxLANGUAGE_GERMAN_LUXEMBOURG, "de_LU", LANG_GERMAN , SUBLANG_GERMAN_LUXEMBOURG , wxLayout_LeftToRight, "German (Luxembourg)") - LNG(wxLANGUAGE_GERMAN_SWISS, "de_CH", LANG_GERMAN , SUBLANG_GERMAN_SWISS , wxLayout_LeftToRight, "German (Swiss)") - LNG(wxLANGUAGE_GREEK, "el_GR", LANG_GREEK , SUBLANG_DEFAULT , wxLayout_LeftToRight, "Greek") - LNG(wxLANGUAGE_GREENLANDIC, "kl_GL", 0 , 0 , wxLayout_LeftToRight, "Greenlandic") - LNG(wxLANGUAGE_GUARANI, "gn" , 0 , 0 , wxLayout_LeftToRight, "Guarani") - LNG(wxLANGUAGE_GUJARATI, "gu" , LANG_GUJARATI , SUBLANG_DEFAULT , wxLayout_LeftToRight, "Gujarati") - LNG(wxLANGUAGE_HAUSA, "ha" , 0 , 0 , wxLayout_LeftToRight, "Hausa") - LNG(wxLANGUAGE_HEBREW, "he_IL", LANG_HEBREW , SUBLANG_DEFAULT , wxLayout_RightToLeft, "Hebrew") - LNG(wxLANGUAGE_HINDI, "hi_IN", LANG_HINDI , SUBLANG_DEFAULT , wxLayout_LeftToRight, "Hindi") - LNG(wxLANGUAGE_HUNGARIAN, "hu_HU", LANG_HUNGARIAN , SUBLANG_DEFAULT , wxLayout_LeftToRight, "Hungarian") - LNG(wxLANGUAGE_ICELANDIC, "is_IS", LANG_ICELANDIC , SUBLANG_DEFAULT , wxLayout_LeftToRight, "Icelandic") - LNG(wxLANGUAGE_INDONESIAN, "id_ID", LANG_INDONESIAN, SUBLANG_DEFAULT , wxLayout_LeftToRight, "Indonesian") - LNG(wxLANGUAGE_INTERLINGUA, "ia" , 0 , 0 , wxLayout_LeftToRight, "Interlingua") - LNG(wxLANGUAGE_INTERLINGUE, "ie" , 0 , 0 , wxLayout_LeftToRight, "Interlingue") - LNG(wxLANGUAGE_INUKTITUT, "iu" , 0 , 0 , wxLayout_LeftToRight, "Inuktitut") - LNG(wxLANGUAGE_INUPIAK, "ik" , 0 , 0 , wxLayout_LeftToRight, "Inupiak") - LNG(wxLANGUAGE_IRISH, "ga_IE", 0 , 0 , wxLayout_LeftToRight, "Irish") - LNG(wxLANGUAGE_ITALIAN, "it_IT", LANG_ITALIAN , SUBLANG_ITALIAN , wxLayout_LeftToRight, "Italian") - LNG(wxLANGUAGE_ITALIAN_SWISS, "it_CH", LANG_ITALIAN , SUBLANG_ITALIAN_SWISS , wxLayout_LeftToRight, "Italian (Swiss)") - LNG(wxLANGUAGE_JAPANESE, "ja_JP", LANG_JAPANESE , SUBLANG_DEFAULT , wxLayout_LeftToRight, "Japanese") - LNG(wxLANGUAGE_JAVANESE, "jw" , 0 , 0 , wxLayout_LeftToRight, "Javanese") - LNG(wxLANGUAGE_KANNADA, "kn" , LANG_KANNADA , SUBLANG_DEFAULT , wxLayout_LeftToRight, "Kannada") - LNG(wxLANGUAGE_KASHMIRI, "ks" , LANG_KASHMIRI , SUBLANG_DEFAULT , wxLayout_LeftToRight, "Kashmiri") - LNG(wxLANGUAGE_KASHMIRI_INDIA, "ks_IN", LANG_KASHMIRI , SUBLANG_KASHMIRI_INDIA , wxLayout_LeftToRight, "Kashmiri (India)") - LNG(wxLANGUAGE_KAZAKH, "kk" , LANG_KAZAK , SUBLANG_DEFAULT , wxLayout_LeftToRight, "Kazakh") - LNG(wxLANGUAGE_KERNEWEK, "kw_GB", 0 , 0 , wxLayout_LeftToRight, "Kernewek") - LNG(wxLANGUAGE_KINYARWANDA, "rw" , 0 , 0 , wxLayout_LeftToRight, "Kinyarwanda") - LNG(wxLANGUAGE_KIRGHIZ, "ky" , 0 , 0 , wxLayout_LeftToRight, "Kirghiz") - LNG(wxLANGUAGE_KIRUNDI, "rn" , 0 , 0 , wxLayout_LeftToRight, "Kirundi") - LNG(wxLANGUAGE_KONKANI, "" , LANG_KONKANI , SUBLANG_DEFAULT , wxLayout_LeftToRight, "Konkani") - LNG(wxLANGUAGE_KOREAN, "ko_KR", LANG_KOREAN , SUBLANG_KOREAN , wxLayout_LeftToRight, "Korean") - LNG(wxLANGUAGE_KURDISH, "ku_TR", 0 , 0 , wxLayout_LeftToRight, "Kurdish") - LNG(wxLANGUAGE_LAOTHIAN, "lo" , 0 , 0 , wxLayout_LeftToRight, "Laothian") - LNG(wxLANGUAGE_LATIN, "la" , 0 , 0 , wxLayout_LeftToRight, "Latin") - LNG(wxLANGUAGE_LATVIAN, "lv_LV", LANG_LATVIAN , SUBLANG_DEFAULT , wxLayout_LeftToRight, "Latvian") - LNG(wxLANGUAGE_LINGALA, "ln" , 0 , 0 , wxLayout_LeftToRight, "Lingala") - LNG(wxLANGUAGE_LITHUANIAN, "lt_LT", LANG_LITHUANIAN, SUBLANG_LITHUANIAN , wxLayout_LeftToRight, "Lithuanian") - LNG(wxLANGUAGE_MACEDONIAN, "mk_MK", LANG_MACEDONIAN, SUBLANG_DEFAULT , wxLayout_LeftToRight, "Macedonian") - LNG(wxLANGUAGE_MALAGASY, "mg" , 0 , 0 , wxLayout_LeftToRight, "Malagasy") - LNG(wxLANGUAGE_MALAY, "ms_MY", LANG_MALAY , SUBLANG_DEFAULT , wxLayout_LeftToRight, "Malay") - LNG(wxLANGUAGE_MALAYALAM, "ml" , LANG_MALAYALAM , SUBLANG_DEFAULT , wxLayout_LeftToRight, "Malayalam") - LNG(wxLANGUAGE_MALAY_BRUNEI_DARUSSALAM, "ms_BN", LANG_MALAY , SUBLANG_MALAY_BRUNEI_DARUSSALAM , wxLayout_LeftToRight, "Malay (Brunei Darussalam)") - LNG(wxLANGUAGE_MALAY_MALAYSIA, "ms_MY", LANG_MALAY , SUBLANG_MALAY_MALAYSIA , wxLayout_LeftToRight, "Malay (Malaysia)") - LNG(wxLANGUAGE_MALTESE, "mt_MT", 0 , 0 , wxLayout_LeftToRight, "Maltese") - LNG(wxLANGUAGE_MANIPURI, "" , LANG_MANIPURI , SUBLANG_DEFAULT , wxLayout_LeftToRight, "Manipuri") - LNG(wxLANGUAGE_MAORI, "mi" , 0 , 0 , wxLayout_LeftToRight, "Maori") - LNG(wxLANGUAGE_MARATHI, "mr_IN", LANG_MARATHI , SUBLANG_DEFAULT , wxLayout_LeftToRight, "Marathi") - LNG(wxLANGUAGE_MOLDAVIAN, "mo" , 0 , 0 , wxLayout_LeftToRight, "Moldavian") - LNG(wxLANGUAGE_MONGOLIAN, "mn" , 0 , 0 , wxLayout_LeftToRight, "Mongolian") - LNG(wxLANGUAGE_NAURU, "na" , 0 , 0 , wxLayout_LeftToRight, "Nauru") - LNG(wxLANGUAGE_NEPALI, "ne_NP", LANG_NEPALI , SUBLANG_DEFAULT , wxLayout_LeftToRight, "Nepali") - LNG(wxLANGUAGE_NEPALI_INDIA, "ne_IN", LANG_NEPALI , SUBLANG_NEPALI_INDIA , wxLayout_LeftToRight, "Nepali (India)") - LNG(wxLANGUAGE_NORWEGIAN_BOKMAL, "nb_NO", LANG_NORWEGIAN , SUBLANG_NORWEGIAN_BOKMAL , wxLayout_LeftToRight, "Norwegian (Bokmal)") - LNG(wxLANGUAGE_NORWEGIAN_NYNORSK, "nn_NO", LANG_NORWEGIAN , SUBLANG_NORWEGIAN_NYNORSK , wxLayout_LeftToRight, "Norwegian (Nynorsk)") - LNG(wxLANGUAGE_OCCITAN, "oc" , 0 , 0 , wxLayout_LeftToRight, "Occitan") - LNG(wxLANGUAGE_ORIYA, "or" , LANG_ORIYA , SUBLANG_DEFAULT , wxLayout_LeftToRight, "Oriya") - LNG(wxLANGUAGE_OROMO, "om" , 0 , 0 , wxLayout_LeftToRight, "(Afan) Oromo") - LNG(wxLANGUAGE_PASHTO, "ps" , 0 , 0 , wxLayout_LeftToRight, "Pashto, Pushto") - LNG(wxLANGUAGE_POLISH, "pl_PL", LANG_POLISH , SUBLANG_DEFAULT , wxLayout_LeftToRight, "Polish") - LNG(wxLANGUAGE_PORTUGUESE, "pt_PT", LANG_PORTUGUESE, SUBLANG_PORTUGUESE , wxLayout_LeftToRight, "Portuguese") - LNG(wxLANGUAGE_PORTUGUESE_BRAZILIAN, "pt_BR", LANG_PORTUGUESE, SUBLANG_PORTUGUESE_BRAZILIAN , wxLayout_LeftToRight, "Portuguese (Brazilian)") - LNG(wxLANGUAGE_PUNJABI, "pa" , LANG_PUNJABI , SUBLANG_DEFAULT , wxLayout_LeftToRight, "Punjabi") - LNG(wxLANGUAGE_QUECHUA, "qu" , 0 , 0 , wxLayout_LeftToRight, "Quechua") - LNG(wxLANGUAGE_RHAETO_ROMANCE, "rm" , 0 , 0 , wxLayout_LeftToRight, "Rhaeto-Romance") - LNG(wxLANGUAGE_ROMANIAN, "ro_RO", LANG_ROMANIAN , SUBLANG_DEFAULT , wxLayout_LeftToRight, "Romanian") - LNG(wxLANGUAGE_RUSSIAN, "ru_RU", LANG_RUSSIAN , SUBLANG_DEFAULT , wxLayout_LeftToRight, "Russian") - LNG(wxLANGUAGE_RUSSIAN_UKRAINE, "ru_UA", 0 , 0 , wxLayout_LeftToRight, "Russian (Ukraine)") - LNG(wxLANGUAGE_SAMI, "se_NO", LANG_SAMI , SUBLANG_DEFAULT , wxLayout_LeftToRight, "Northern Sami") - LNG(wxLANGUAGE_SAMOAN, "sm" , 0 , 0 , wxLayout_LeftToRight, "Samoan") - LNG(wxLANGUAGE_SANGHO, "sg" , 0 , 0 , wxLayout_LeftToRight, "Sangho") - LNG(wxLANGUAGE_SANSKRIT, "sa" , LANG_SANSKRIT , SUBLANG_DEFAULT , wxLayout_LeftToRight, "Sanskrit") - LNG(wxLANGUAGE_SCOTS_GAELIC, "gd" , 0 , 0 , wxLayout_LeftToRight, "Scots Gaelic") - LNG(wxLANGUAGE_SERBIAN, "sr_RS", LANG_SERBIAN , SUBLANG_DEFAULT , wxLayout_LeftToRight, "Serbian") - LNG(wxLANGUAGE_SERBIAN_CYRILLIC, "sr_RS", LANG_SERBIAN , SUBLANG_SERBIAN_CYRILLIC , wxLayout_LeftToRight, "Serbian (Cyrillic)") - LNG(wxLANGUAGE_SERBIAN_LATIN, "sr_RS@latin", LANG_SERBIAN , SUBLANG_SERBIAN_LATIN , wxLayout_LeftToRight, "Serbian (Latin)") - LNG(wxLANGUAGE_SERBIAN_CYRILLIC, "sr_YU", LANG_SERBIAN , SUBLANG_SERBIAN_CYRILLIC , wxLayout_LeftToRight, "Serbian (Cyrillic)") - LNG(wxLANGUAGE_SERBIAN_LATIN, "sr_YU@latin", LANG_SERBIAN , SUBLANG_SERBIAN_LATIN , wxLayout_LeftToRight, "Serbian (Latin)") - LNG(wxLANGUAGE_SERBO_CROATIAN, "sh" , 0 , 0 , wxLayout_LeftToRight, "Serbo-Croatian") - LNG(wxLANGUAGE_SESOTHO, "st" , 0 , 0 , wxLayout_LeftToRight, "Sesotho") - LNG(wxLANGUAGE_SETSWANA, "tn" , 0 , 0 , wxLayout_LeftToRight, "Setswana") - LNG(wxLANGUAGE_SHONA, "sn" , 0 , 0 , wxLayout_LeftToRight, "Shona") - LNG(wxLANGUAGE_SINDHI, "sd" , LANG_SINDHI , SUBLANG_DEFAULT , wxLayout_LeftToRight, "Sindhi") - LNG(wxLANGUAGE_SINHALESE, "si" , 0 , 0 , wxLayout_LeftToRight, "Sinhalese") - LNG(wxLANGUAGE_SISWATI, "ss" , 0 , 0 , wxLayout_LeftToRight, "Siswati") - LNG(wxLANGUAGE_SLOVAK, "sk_SK", LANG_SLOVAK , SUBLANG_DEFAULT , wxLayout_LeftToRight, "Slovak") - LNG(wxLANGUAGE_SLOVENIAN, "sl_SI", LANG_SLOVENIAN , SUBLANG_DEFAULT , wxLayout_LeftToRight, "Slovenian") - LNG(wxLANGUAGE_SOMALI, "so" , 0 , 0 , wxLayout_LeftToRight, "Somali") - LNG(wxLANGUAGE_SPANISH, "es_ES", LANG_SPANISH , SUBLANG_SPANISH , wxLayout_LeftToRight, "Spanish") - LNG(wxLANGUAGE_SPANISH_ARGENTINA, "es_AR", LANG_SPANISH , SUBLANG_SPANISH_ARGENTINA , wxLayout_LeftToRight, "Spanish (Argentina)") - LNG(wxLANGUAGE_SPANISH_BOLIVIA, "es_BO", LANG_SPANISH , SUBLANG_SPANISH_BOLIVIA , wxLayout_LeftToRight, "Spanish (Bolivia)") - LNG(wxLANGUAGE_SPANISH_CHILE, "es_CL", LANG_SPANISH , SUBLANG_SPANISH_CHILE , wxLayout_LeftToRight, "Spanish (Chile)") - LNG(wxLANGUAGE_SPANISH_COLOMBIA, "es_CO", LANG_SPANISH , SUBLANG_SPANISH_COLOMBIA , wxLayout_LeftToRight, "Spanish (Colombia)") - LNG(wxLANGUAGE_SPANISH_COSTA_RICA, "es_CR", LANG_SPANISH , SUBLANG_SPANISH_COSTA_RICA , wxLayout_LeftToRight, "Spanish (Costa Rica)") - LNG(wxLANGUAGE_SPANISH_DOMINICAN_REPUBLIC, "es_DO", LANG_SPANISH , SUBLANG_SPANISH_DOMINICAN_REPUBLIC, wxLayout_LeftToRight, "Spanish (Dominican republic)") - LNG(wxLANGUAGE_SPANISH_ECUADOR, "es_EC", LANG_SPANISH , SUBLANG_SPANISH_ECUADOR , wxLayout_LeftToRight, "Spanish (Ecuador)") - LNG(wxLANGUAGE_SPANISH_EL_SALVADOR, "es_SV", LANG_SPANISH , SUBLANG_SPANISH_EL_SALVADOR , wxLayout_LeftToRight, "Spanish (El Salvador)") - LNG(wxLANGUAGE_SPANISH_GUATEMALA, "es_GT", LANG_SPANISH , SUBLANG_SPANISH_GUATEMALA , wxLayout_LeftToRight, "Spanish (Guatemala)") - LNG(wxLANGUAGE_SPANISH_HONDURAS, "es_HN", LANG_SPANISH , SUBLANG_SPANISH_HONDURAS , wxLayout_LeftToRight, "Spanish (Honduras)") - LNG(wxLANGUAGE_SPANISH_MEXICAN, "es_MX", LANG_SPANISH , SUBLANG_SPANISH_MEXICAN , wxLayout_LeftToRight, "Spanish (Mexican)") - LNG(wxLANGUAGE_SPANISH_MODERN, "es_ES", LANG_SPANISH , SUBLANG_SPANISH_MODERN , wxLayout_LeftToRight, "Spanish (Modern)") - LNG(wxLANGUAGE_SPANISH_NICARAGUA, "es_NI", LANG_SPANISH , SUBLANG_SPANISH_NICARAGUA , wxLayout_LeftToRight, "Spanish (Nicaragua)") - LNG(wxLANGUAGE_SPANISH_PANAMA, "es_PA", LANG_SPANISH , SUBLANG_SPANISH_PANAMA , wxLayout_LeftToRight, "Spanish (Panama)") - LNG(wxLANGUAGE_SPANISH_PARAGUAY, "es_PY", LANG_SPANISH , SUBLANG_SPANISH_PARAGUAY , wxLayout_LeftToRight, "Spanish (Paraguay)") - LNG(wxLANGUAGE_SPANISH_PERU, "es_PE", LANG_SPANISH , SUBLANG_SPANISH_PERU , wxLayout_LeftToRight, "Spanish (Peru)") - LNG(wxLANGUAGE_SPANISH_PUERTO_RICO, "es_PR", LANG_SPANISH , SUBLANG_SPANISH_PUERTO_RICO , wxLayout_LeftToRight, "Spanish (Puerto Rico)") - LNG(wxLANGUAGE_SPANISH_URUGUAY, "es_UY", LANG_SPANISH , SUBLANG_SPANISH_URUGUAY , wxLayout_LeftToRight, "Spanish (Uruguay)") - LNG(wxLANGUAGE_SPANISH_US, "es_US", 0 , 0 , wxLayout_LeftToRight, "Spanish (U.S.)") - LNG(wxLANGUAGE_SPANISH_VENEZUELA, "es_VE", LANG_SPANISH , SUBLANG_SPANISH_VENEZUELA , wxLayout_LeftToRight, "Spanish (Venezuela)") - LNG(wxLANGUAGE_SUNDANESE, "su" , 0 , 0 , wxLayout_LeftToRight, "Sundanese") - LNG(wxLANGUAGE_SWAHILI, "sw_KE", LANG_SWAHILI , SUBLANG_DEFAULT , wxLayout_LeftToRight, "Swahili") - LNG(wxLANGUAGE_SWEDISH, "sv_SE", LANG_SWEDISH , SUBLANG_SWEDISH , wxLayout_LeftToRight, "Swedish") - LNG(wxLANGUAGE_SWEDISH_FINLAND, "sv_FI", LANG_SWEDISH , SUBLANG_SWEDISH_FINLAND , wxLayout_LeftToRight, "Swedish (Finland)") - LNG(wxLANGUAGE_TAGALOG, "tl_PH", 0 , 0 , wxLayout_LeftToRight, "Tagalog") - LNG(wxLANGUAGE_TAJIK, "tg" , 0 , 0 , wxLayout_LeftToRight, "Tajik") - LNG(wxLANGUAGE_TAMIL, "ta" , LANG_TAMIL , SUBLANG_DEFAULT , wxLayout_LeftToRight, "Tamil") - LNG(wxLANGUAGE_TATAR, "tt" , LANG_TATAR , SUBLANG_DEFAULT , wxLayout_LeftToRight, "Tatar") - LNG(wxLANGUAGE_TELUGU, "te" , LANG_TELUGU , SUBLANG_DEFAULT , wxLayout_LeftToRight, "Telugu") - LNG(wxLANGUAGE_THAI, "th_TH", LANG_THAI , SUBLANG_DEFAULT , wxLayout_LeftToRight, "Thai") - LNG(wxLANGUAGE_TIBETAN, "bo" , 0 , 0 , wxLayout_LeftToRight, "Tibetan") - LNG(wxLANGUAGE_TIGRINYA, "ti" , 0 , 0 , wxLayout_LeftToRight, "Tigrinya") - LNG(wxLANGUAGE_TONGA, "to" , 0 , 0 , wxLayout_LeftToRight, "Tonga") - LNG(wxLANGUAGE_TSONGA, "ts" , 0 , 0 , wxLayout_LeftToRight, "Tsonga") - LNG(wxLANGUAGE_TURKISH, "tr_TR", LANG_TURKISH , SUBLANG_DEFAULT , wxLayout_LeftToRight, "Turkish") - LNG(wxLANGUAGE_TURKMEN, "tk" , 0 , 0 , wxLayout_LeftToRight, "Turkmen") - LNG(wxLANGUAGE_TWI, "tw" , 0 , 0 , wxLayout_LeftToRight, "Twi") - LNG(wxLANGUAGE_UIGHUR, "ug" , 0 , 0 , wxLayout_LeftToRight, "Uighur") - LNG(wxLANGUAGE_UKRAINIAN, "uk_UA", LANG_UKRAINIAN , SUBLANG_DEFAULT , wxLayout_LeftToRight, "Ukrainian") - LNG(wxLANGUAGE_URDU, "ur" , LANG_URDU , SUBLANG_DEFAULT , wxLayout_LeftToRight, "Urdu") - LNG(wxLANGUAGE_URDU_INDIA, "ur_IN", LANG_URDU , SUBLANG_URDU_INDIA , wxLayout_LeftToRight, "Urdu (India)") - LNG(wxLANGUAGE_URDU_PAKISTAN, "ur_PK", LANG_URDU , SUBLANG_URDU_PAKISTAN , wxLayout_LeftToRight, "Urdu (Pakistan)") - LNG(wxLANGUAGE_UZBEK, "uz" , LANG_UZBEK , SUBLANG_DEFAULT , wxLayout_LeftToRight, "Uzbek") - LNG(wxLANGUAGE_UZBEK_CYRILLIC, "uz" , LANG_UZBEK , SUBLANG_UZBEK_CYRILLIC , wxLayout_LeftToRight, "Uzbek (Cyrillic)") - LNG(wxLANGUAGE_UZBEK_LATIN, "uz" , LANG_UZBEK , SUBLANG_UZBEK_LATIN , wxLayout_LeftToRight, "Uzbek (Latin)") - LNG(wxLANGUAGE_VALENCIAN, "ca_ES@valencia", LANG_VALENCIAN , SUBLANG_DEFAULT , wxLayout_LeftToRight, "Valencian") - LNG(wxLANGUAGE_VIETNAMESE, "vi_VN", LANG_VIETNAMESE, SUBLANG_DEFAULT , wxLayout_LeftToRight, "Vietnamese") - LNG(wxLANGUAGE_VOLAPUK, "vo" , 0 , 0 , wxLayout_LeftToRight, "Volapuk") - LNG(wxLANGUAGE_WELSH, "cy" , 0 , 0 , wxLayout_LeftToRight, "Welsh") - LNG(wxLANGUAGE_WOLOF, "wo" , 0 , 0 , wxLayout_LeftToRight, "Wolof") - LNG(wxLANGUAGE_XHOSA, "xh" , 0 , 0 , wxLayout_LeftToRight, "Xhosa") - LNG(wxLANGUAGE_YIDDISH, "yi" , 0 , 0 , wxLayout_LeftToRight, "Yiddish") - LNG(wxLANGUAGE_YORUBA, "yo" , 0 , 0 , wxLayout_LeftToRight, "Yoruba") - LNG(wxLANGUAGE_ZHUANG, "za" , 0 , 0 , wxLayout_LeftToRight, "Zhuang") - LNG(wxLANGUAGE_ZULU, "zu" , 0 , 0 , wxLayout_LeftToRight, "Zulu") -} -#undef LNG - -// --- --- --- generated code ends here --- --- --- - -#endif // wxUSE_INTL diff --git a/wxWidgets/src/common/ipcbase.cpp b/wxWidgets/src/common/ipcbase.cpp deleted file mode 100644 index 80fa9412d0..0000000000 --- a/wxWidgets/src/common/ipcbase.cpp +++ /dev/null @@ -1,87 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/common/ipcbase.cpp -// Purpose: IPC base classes -// Author: Julian Smart -// Modified by: -// Created: 04/01/98 -// RCS-ID: $Id: ipcbase.cpp 54615 2008-07-14 02:34:29Z VZ $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#ifndef WX_PRECOMP -#endif - -#include "wx/ipcbase.h" - -IMPLEMENT_CLASS(wxServerBase, wxObject) -IMPLEMENT_CLASS(wxClientBase, wxObject) -IMPLEMENT_CLASS(wxConnectionBase, wxObject) - -wxConnectionBase::wxConnectionBase(wxChar *buffer, int bytes) - : m_connected(true), - m_buffer(buffer), - m_buffersize(bytes), - m_deletebufferwhendone(false) -{ - if ( buffer == (wxChar *)NULL ) - { // behave like next constructor - m_buffersize = 0; - m_deletebufferwhendone = true; - } -} - -wxConnectionBase::wxConnectionBase() - : m_connected(true), - m_buffer(NULL), - m_buffersize(0), - m_deletebufferwhendone(true) -{ -} - -wxConnectionBase::wxConnectionBase(const wxConnectionBase& copy) - : wxObject(), - m_connected(copy.m_connected), - m_buffer(copy.m_buffer), - m_buffersize(copy.m_buffersize), - m_deletebufferwhendone(false) - -{ - // copy constructor would require ref-counted pointer to buffer - wxFAIL_MSG( _T("Copy constructor of wxConnectionBase not implemented") ); -} - - -wxConnectionBase::~wxConnectionBase(void) -{ - if ( m_deletebufferwhendone ) - delete [] m_buffer; -} - -wxChar *wxConnectionBase::GetBufferAtLeast( size_t bytes ) -{ - if ( m_buffersize >= bytes ) - return m_buffer; - else - { // need to resize buffer - if ( m_deletebufferwhendone ) - { // we're in charge of buffer, increase it - delete [] m_buffer; - // the argument specifies **byte size**, but m_buffer is of type - // wxChar. Under unicode: sizeof(wxChar) > 1, so the buffer size is - // bytes / sizeof(wxChar) rounded upwards. - m_buffer = new wxChar[(bytes + sizeof(wxChar) - 1) / sizeof(wxChar)]; - m_buffersize = bytes; - return m_buffer; - } // user-supplied buffer, fail - else - return NULL; - } -} diff --git a/wxWidgets/src/common/layout.cpp b/wxWidgets/src/common/layout.cpp deleted file mode 100644 index d796eee1f7..0000000000 --- a/wxWidgets/src/common/layout.cpp +++ /dev/null @@ -1,1026 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/common/layout.cpp -// Purpose: Constraint layout system classes -// Author: Julian Smart -// Modified by: -// Created: 04/01/98 -// RCS-ID: $Id: layout.cpp 39627 2006-06-08 06:57:39Z ABX $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// ============================================================================= -// declarations -// ============================================================================= - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_CONSTRAINTS - -#include "wx/layout.h" - -#ifndef WX_PRECOMP - #include "wx/window.h" - #include "wx/utils.h" - #include "wx/dialog.h" - #include "wx/msgdlg.h" - #include "wx/intl.h" -#endif - - -IMPLEMENT_DYNAMIC_CLASS(wxIndividualLayoutConstraint, wxObject) -IMPLEMENT_DYNAMIC_CLASS(wxLayoutConstraints, wxObject) - - -inline void wxGetAsIs(wxWindowBase* win, int* w, int* h) -{ -#if 1 - // The old way. Works for me. - win->GetSize(w, h); -#endif - -#if 0 - // Vadim's change. Breaks wxPython's LayoutAnchors - win->GetBestSize(w, h); -#endif - -#if 0 - // Proposed compromise. Doesn't work. - int sw, sh, bw, bh; - win->GetSize(&sw, &sh); - win->GetBestSize(&bw, &bh); - if (w) - *w = wxMax(sw, bw); - if (h) - *h = wxMax(sh, bh); -#endif -} - - -wxIndividualLayoutConstraint::wxIndividualLayoutConstraint() -{ - myEdge = wxTop; - relationship = wxUnconstrained; - margin = 0; - value = 0; - percent = 0; - otherEdge = wxTop; - done = false; - otherWin = (wxWindowBase *) NULL; -} - -void wxIndividualLayoutConstraint::Set(wxRelationship rel, wxWindowBase *otherW, wxEdge otherE, int val, int marg) -{ - if (rel == wxSameAs) - { - // If Set is called by the user with wxSameAs then call SameAs to do - // it since it will actually use wxPercent instead. - SameAs(otherW, otherE, marg); - return; - } - - relationship = rel; - otherWin = otherW; - otherEdge = otherE; - - if ( rel == wxPercentOf ) - { - percent = val; - } - else - { - value = val; - } - - margin = marg; -} - -void wxIndividualLayoutConstraint::LeftOf(wxWindowBase *sibling, int marg) -{ - Set(wxLeftOf, sibling, wxLeft, 0, marg); -} - -void wxIndividualLayoutConstraint::RightOf(wxWindowBase *sibling, int marg) -{ - Set(wxRightOf, sibling, wxRight, 0, marg); -} - -void wxIndividualLayoutConstraint::Above(wxWindowBase *sibling, int marg) -{ - Set(wxAbove, sibling, wxTop, 0, marg); -} - -void wxIndividualLayoutConstraint::Below(wxWindowBase *sibling, int marg) -{ - Set(wxBelow, sibling, wxBottom, 0, marg); -} - -// -// 'Same edge' alignment -// -void wxIndividualLayoutConstraint::SameAs(wxWindowBase *otherW, wxEdge edge, int marg) -{ - Set(wxPercentOf, otherW, edge, 100, marg); -} - -// The edge is a percentage of the other window's edge -void wxIndividualLayoutConstraint::PercentOf(wxWindowBase *otherW, wxEdge wh, int per) -{ - Set(wxPercentOf, otherW, wh, per); -} - -// -// Edge has absolute value -// -void wxIndividualLayoutConstraint::Absolute(int val) -{ - value = val; - relationship = wxAbsolute; -} - -// Reset constraint if it mentions otherWin -bool wxIndividualLayoutConstraint::ResetIfWin(wxWindowBase *otherW) -{ - if (otherW == otherWin) - { - myEdge = wxTop; - relationship = wxAsIs; - margin = 0; - value = 0; - percent = 0; - otherEdge = wxTop; - otherWin = (wxWindowBase *) NULL; - return true; - } - - return false; -} - -// Try to satisfy constraint -bool wxIndividualLayoutConstraint::SatisfyConstraint(wxLayoutConstraints *constraints, wxWindowBase *win) -{ - if (relationship == wxAbsolute) - { - done = true; - return true; - } - - switch (myEdge) - { - case wxLeft: - { - switch (relationship) - { - case wxLeftOf: - { - // We can know this edge if: otherWin is win's - // parent, or otherWin has a satisfied constraint, - // or otherWin has no constraint. - int edgePos = GetEdge(otherEdge, win, otherWin); - if (edgePos != -1) - { - value = edgePos - margin; - done = true; - return true; - } - else - return false; - } - case wxRightOf: - { - int edgePos = GetEdge(otherEdge, win, otherWin); - if (edgePos != -1) - { - value = edgePos + margin; - done = true; - return true; - } - else - return false; - } - case wxPercentOf: - { - int edgePos = GetEdge(otherEdge, win, otherWin); - if (edgePos != -1) - { - value = (int)(edgePos*(((float)percent)*0.01) + margin); - done = true; - return true; - } - else - return false; - } - case wxUnconstrained: - { - // We know the left-hand edge position if we know - // the right-hand edge and we know the width; OR if - // we know the centre and the width. - if (constraints->right.GetDone() && constraints->width.GetDone()) - { - value = (constraints->right.GetValue() - constraints->width.GetValue() + margin); - done = true; - return true; - } - else if (constraints->centreX.GetDone() && constraints->width.GetDone()) - { - value = (int)(constraints->centreX.GetValue() - (constraints->width.GetValue()/2) + margin); - done = true; - return true; - } - else - return false; - } - case wxAsIs: - { - int y; - win->GetPosition(&value, &y); - done = true; - return true; - } - default: - break; - } - break; - } - case wxRight: - { - switch (relationship) - { - case wxLeftOf: - { - // We can know this edge if: otherWin is win's - // parent, or otherWin has a satisfied constraint, - // or otherWin has no constraint. - int edgePos = GetEdge(otherEdge, win, otherWin); - if (edgePos != -1) - { - value = edgePos - margin; - done = true; - return true; - } - else - return false; - } - case wxRightOf: - { - int edgePos = GetEdge(otherEdge, win, otherWin); - if (edgePos != -1) - { - value = edgePos + margin; - done = true; - return true; - } - else - return false; - } - case wxPercentOf: - { - int edgePos = GetEdge(otherEdge, win, otherWin); - if (edgePos != -1) - { - value = (int)(edgePos*(((float)percent)*0.01) - margin); - done = true; - return true; - } - else - return false; - } - case wxUnconstrained: - { - // We know the right-hand edge position if we know the - // left-hand edge and we know the width, OR if we know the - // centre edge and the width. - if (constraints->left.GetDone() && constraints->width.GetDone()) - { - value = (constraints->left.GetValue() + constraints->width.GetValue() - margin); - done = true; - return true; - } - else if (constraints->centreX.GetDone() && constraints->width.GetDone()) - { - value = (int)(constraints->centreX.GetValue() + (constraints->width.GetValue()/2) - margin); - done = true; - return true; - } - else - return false; - } - case wxAsIs: - { - int x, y; - int w, h; - wxGetAsIs(win, &w, &h); - win->GetPosition(&x, &y); - value = x + w; - done = true; - return true; - } - default: - break; - } - break; - } - case wxTop: - { - switch (relationship) - { - case wxAbove: - { - // We can know this edge if: otherWin is win's - // parent, or otherWin has a satisfied constraint, - // or otherWin has no constraint. - int edgePos = GetEdge(otherEdge, win, otherWin); - if (edgePos != -1) - { - value = edgePos - margin; - done = true; - return true; - } - else - return false; - } - case wxBelow: - { - int edgePos = GetEdge(otherEdge, win, otherWin); - if (edgePos != -1) - { - value = edgePos + margin; - done = true; - return true; - } - else - return false; - } - case wxPercentOf: - { - int edgePos = GetEdge(otherEdge, win, otherWin); - if (edgePos != -1) - { - value = (int)(edgePos*(((float)percent)*0.01) + margin); - done = true; - return true; - } - else - return false; - } - case wxUnconstrained: - { - // We know the top edge position if we know the bottom edge - // and we know the height; OR if we know the centre edge and - // the height. - if (constraints->bottom.GetDone() && constraints->height.GetDone()) - { - value = (constraints->bottom.GetValue() - constraints->height.GetValue() + margin); - done = true; - return true; - } - else if (constraints->centreY.GetDone() && constraints->height.GetDone()) - { - value = (constraints->centreY.GetValue() - (constraints->height.GetValue()/2) + margin); - done = true; - return true; - } - else - return false; - } - case wxAsIs: - { - int x; - win->GetPosition(&x, &value); - done = true; - return true; - } - default: - break; - } - break; - } - case wxBottom: - { - switch (relationship) - { - case wxAbove: - { - // We can know this edge if: otherWin is win's parent, - // or otherWin has a satisfied constraint, or - // otherWin has no constraint. - int edgePos = GetEdge(otherEdge, win, otherWin); - if (edgePos != -1) - { - value = edgePos + margin; - done = true; - return true; - } - else - return false; - } - case wxBelow: - { - int edgePos = GetEdge(otherEdge, win, otherWin); - if (edgePos != -1) - { - value = edgePos - margin; - done = true; - return true; - } - else - return false; - } - case wxPercentOf: - { - int edgePos = GetEdge(otherEdge, win, otherWin); - if (edgePos != -1) - { - value = (int)(edgePos*(((float)percent)*0.01) - margin); - done = true; - return true; - } - else - return false; - } - case wxUnconstrained: - { - // We know the bottom edge position if we know the top edge - // and we know the height; OR if we know the centre edge and - // the height. - if (constraints->top.GetDone() && constraints->height.GetDone()) - { - value = (constraints->top.GetValue() + constraints->height.GetValue() - margin); - done = true; - return true; - } - else if (constraints->centreY.GetDone() && constraints->height.GetDone()) - { - value = (constraints->centreY.GetValue() + (constraints->height.GetValue()/2) - margin); - done = true; - return true; - } - else - return false; - } - case wxAsIs: - { - int x, y; - int w, h; - wxGetAsIs(win, &w, &h); - win->GetPosition(&x, &y); - value = h + y; - done = true; - return true; - } - default: - break; - } - break; - } - case wxCentreX: - { - switch (relationship) - { - case wxLeftOf: - { - // We can know this edge if: otherWin is win's parent, or - // otherWin has a satisfied constraint, or otherWin has no - // constraint. - int edgePos = GetEdge(otherEdge, win, otherWin); - if (edgePos != -1) - { - value = edgePos - margin; - done = true; - return true; - } - else - return false; - } - case wxRightOf: - { - int edgePos = GetEdge(otherEdge, win, otherWin); - if (edgePos != -1) - { - value = edgePos + margin; - done = true; - return true; - } - else - return false; - } - case wxPercentOf: - { - int edgePos = GetEdge(otherEdge, win, otherWin); - if (edgePos != -1) - { - value = (int)(edgePos*(((float)percent)*0.01) + margin); - done = true; - return true; - } - else - return false; - } - case wxUnconstrained: - { - // We know the centre position if we know - // the left-hand edge and we know the width, OR - // the right-hand edge and the width - if (constraints->left.GetDone() && constraints->width.GetDone()) - { - value = (int)(constraints->left.GetValue() + (constraints->width.GetValue()/2) + margin); - done = true; - return true; - } - else if (constraints->right.GetDone() && constraints->width.GetDone()) - { - value = (int)(constraints->left.GetValue() - (constraints->width.GetValue()/2) + margin); - done = true; - return true; - } - else - return false; - } - default: - break; - } - break; - } - case wxCentreY: - { - switch (relationship) - { - case wxAbove: - { - // We can know this edge if: otherWin is win's parent, - // or otherWin has a satisfied constraint, or otherWin - // has no constraint. - int edgePos = GetEdge(otherEdge, win, otherWin); - if (edgePos != -1) - { - value = edgePos - margin; - done = true; - return true; - } - else - return false; - } - case wxBelow: - { - int edgePos = GetEdge(otherEdge, win, otherWin); - if (edgePos != -1) - { - value = edgePos + margin; - done = true; - return true; - } - else - return false; - } - case wxPercentOf: - { - int edgePos = GetEdge(otherEdge, win, otherWin); - if (edgePos != -1) - { - value = (int)(edgePos*(((float)percent)*0.01) + margin); - done = true; - return true; - } - else - return false; - } - case wxUnconstrained: - { - // We know the centre position if we know - // the top edge and we know the height, OR - // the bottom edge and the height. - if (constraints->bottom.GetDone() && constraints->height.GetDone()) - { - value = (int)(constraints->bottom.GetValue() - (constraints->height.GetValue()/2) + margin); - done = true; - return true; - } - else if (constraints->top.GetDone() && constraints->height.GetDone()) - { - value = (int)(constraints->top.GetValue() + (constraints->height.GetValue()/2) + margin); - done = true; - return true; - } - else - return false; - } - default: - break; - } - break; - } - case wxWidth: - { - switch (relationship) - { - case wxPercentOf: - { - int edgePos = GetEdge(otherEdge, win, otherWin); - if (edgePos != -1) - { - value = (int)(edgePos*(((float)percent)*0.01)); - done = true; - return true; - } - else - return false; - } - case wxAsIs: - { - if (win) - { - int h; - wxGetAsIs(win, &value, &h); - done = true; - return true; - } - else return false; - } - case wxUnconstrained: - { - // We know the width if we know the left edge and the right edge, OR - // if we know the left edge and the centre, OR - // if we know the right edge and the centre - if (constraints->left.GetDone() && constraints->right.GetDone()) - { - value = constraints->right.GetValue() - constraints->left.GetValue(); - done = true; - return true; - } - else if (constraints->centreX.GetDone() && constraints->left.GetDone()) - { - value = (int)(2*(constraints->centreX.GetValue() - constraints->left.GetValue())); - done = true; - return true; - } - else if (constraints->centreX.GetDone() && constraints->right.GetDone()) - { - value = (int)(2*(constraints->right.GetValue() - constraints->centreX.GetValue())); - done = true; - return true; - } - else - return false; - } - default: - break; - } - break; - } - case wxHeight: - { - switch (relationship) - { - case wxPercentOf: - { - int edgePos = GetEdge(otherEdge, win, otherWin); - if (edgePos != -1) - { - value = (int)(edgePos*(((float)percent)*0.01)); - done = true; - return true; - } - else - return false; - } - case wxAsIs: - { - if (win) - { - int w; - wxGetAsIs(win, &w, &value); - done = true; - return true; - } - else return false; - } - case wxUnconstrained: - { - // We know the height if we know the top edge and the bottom edge, OR - // if we know the top edge and the centre, OR - // if we know the bottom edge and the centre - if (constraints->top.GetDone() && constraints->bottom.GetDone()) - { - value = constraints->bottom.GetValue() - constraints->top.GetValue(); - done = true; - return true; - } - else if (constraints->top.GetDone() && constraints->centreY.GetDone()) - { - value = (int)(2*(constraints->centreY.GetValue() - constraints->top.GetValue())); - done = true; - return true; - } - else if (constraints->bottom.GetDone() && constraints->centreY.GetDone()) - { - value = (int)(2*(constraints->bottom.GetValue() - constraints->centreY.GetValue())); - done = true; - return true; - } - else - return false; - } - default: - break; - } - break; - } - default: - break; - } - return false; -} - -// Get the value of this edge or dimension, or if this is not determinable, -1. -int wxIndividualLayoutConstraint::GetEdge(wxEdge which, - wxWindowBase *thisWin, - wxWindowBase *other) const -{ - // If the edge or dimension belongs to the parent, then we know the - // dimension is obtainable immediately. E.g. a wxExpandSizer may contain a - // button (but the button's true parent is a panel, not the sizer) - if (other->GetChildren().Find((wxWindow*)thisWin)) - { - switch (which) - { - case wxLeft: - { - return 0; - } - case wxTop: - { - return 0; - } - case wxRight: - { - int w, h; - other->GetClientSizeConstraint(&w, &h); - return w; - } - case wxBottom: - { - int w, h; - other->GetClientSizeConstraint(&w, &h); - return h; - } - case wxWidth: - { - int w, h; - other->GetClientSizeConstraint(&w, &h); - return w; - } - case wxHeight: - { - int w, h; - other->GetClientSizeConstraint(&w, &h); - return h; - } - case wxCentreX: - case wxCentreY: - { - int w, h; - other->GetClientSizeConstraint(&w, &h); - if (which == wxCentreX) - return (int)(w/2); - else - return (int)(h/2); - } - default: - return -1; - } - } - switch (which) - { - case wxLeft: - { - wxLayoutConstraints *constr = other->GetConstraints(); - // If no constraints, it means the window is not dependent - // on anything, and therefore we know its value immediately - if (constr) - { - if (constr->left.GetDone()) - return constr->left.GetValue(); - else - return -1; - } - else - { - int x, y; - other->GetPosition(&x, &y); - return x; - } - } - case wxTop: - { - wxLayoutConstraints *constr = other->GetConstraints(); - // If no constraints, it means the window is not dependent - // on anything, and therefore we know its value immediately - if (constr) - { - if (constr->top.GetDone()) - return constr->top.GetValue(); - else - return -1; - } - else - { - int x, y; - other->GetPosition(&x, &y); - return y; - } - } - case wxRight: - { - wxLayoutConstraints *constr = other->GetConstraints(); - // If no constraints, it means the window is not dependent - // on anything, and therefore we know its value immediately - if (constr) - { - if (constr->right.GetDone()) - return constr->right.GetValue(); - else - return -1; - } - else - { - int x, y, w, h; - other->GetPosition(&x, &y); - other->GetSize(&w, &h); - return (int)(x + w); - } - } - case wxBottom: - { - wxLayoutConstraints *constr = other->GetConstraints(); - // If no constraints, it means the window is not dependent - // on anything, and therefore we know its value immediately - if (constr) - { - if (constr->bottom.GetDone()) - return constr->bottom.GetValue(); - else - return -1; - } - else - { - int x, y, w, h; - other->GetPosition(&x, &y); - other->GetSize(&w, &h); - return (int)(y + h); - } - } - case wxWidth: - { - wxLayoutConstraints *constr = other->GetConstraints(); - // If no constraints, it means the window is not dependent - // on anything, and therefore we know its value immediately - if (constr) - { - if (constr->width.GetDone()) - return constr->width.GetValue(); - else - return -1; - } - else - { - int w, h; - other->GetSize(&w, &h); - return w; - } - } - case wxHeight: - { - wxLayoutConstraints *constr = other->GetConstraints(); - // If no constraints, it means the window is not dependent - // on anything, and therefore we know its value immediately - if (constr) - { - if (constr->height.GetDone()) - return constr->height.GetValue(); - else - return -1; - } - else - { - int w, h; - other->GetSize(&w, &h); - return h; - } - } - case wxCentreX: - { - wxLayoutConstraints *constr = other->GetConstraints(); - // If no constraints, it means the window is not dependent - // on anything, and therefore we know its value immediately - if (constr) - { - if (constr->centreX.GetDone()) - return constr->centreX.GetValue(); - else - return -1; - } - else - { - int x, y, w, h; - other->GetPosition(&x, &y); - other->GetSize(&w, &h); - return (int)(x + (w/2)); - } - } - case wxCentreY: - { - wxLayoutConstraints *constr = other->GetConstraints(); - // If no constraints, it means the window is not dependent - // on anything, and therefore we know its value immediately - if (constr) - { - if (constr->centreY.GetDone()) - return constr->centreY.GetValue(); - else - return -1; - } - else - { - int x, y, w, h; - other->GetPosition(&x, &y); - other->GetSize(&w, &h); - return (int)(y + (h/2)); - } - } - default: - break; - } - return -1; -} - -wxLayoutConstraints::wxLayoutConstraints() -{ - left.SetEdge(wxLeft); - top.SetEdge(wxTop); - right.SetEdge(wxRight); - bottom.SetEdge(wxBottom); - centreX.SetEdge(wxCentreX); - centreY.SetEdge(wxCentreY); - width.SetEdge(wxWidth); - height.SetEdge(wxHeight); -} - -bool wxLayoutConstraints::SatisfyConstraints(wxWindowBase *win, int *nChanges) -{ - int noChanges = 0; - - bool done = width.GetDone(); - bool newDone = (done ? true : width.SatisfyConstraint(this, win)); - if (newDone != done) - noChanges ++; - - done = height.GetDone(); - newDone = (done ? true : height.SatisfyConstraint(this, win)); - if (newDone != done) - noChanges ++; - - done = left.GetDone(); - newDone = (done ? true : left.SatisfyConstraint(this, win)); - if (newDone != done) - noChanges ++; - - done = top.GetDone(); - newDone = (done ? true : top.SatisfyConstraint(this, win)); - if (newDone != done) - noChanges ++; - - done = right.GetDone(); - newDone = (done ? true : right.SatisfyConstraint(this, win)); - if (newDone != done) - noChanges ++; - - done = bottom.GetDone(); - newDone = (done ? true : bottom.SatisfyConstraint(this, win)); - if (newDone != done) - noChanges ++; - - done = centreX.GetDone(); - newDone = (done ? true : centreX.SatisfyConstraint(this, win)); - if (newDone != done) - noChanges ++; - - done = centreY.GetDone(); - newDone = (done ? true : centreY.SatisfyConstraint(this, win)); - if (newDone != done) - noChanges ++; - - *nChanges = noChanges; - - return AreSatisfied(); -} - -#endif // wxUSE_CONSTRAINTS diff --git a/wxWidgets/src/common/lboxcmn.cpp b/wxWidgets/src/common/lboxcmn.cpp deleted file mode 100644 index 883e4858c5..0000000000 --- a/wxWidgets/src/common/lboxcmn.cpp +++ /dev/null @@ -1,147 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: src/common/lboxcmn.cpp -// Purpose: wxListBox class methods common to all platforms -// Author: Vadim Zeitlin -// Modified by: -// Created: 22.10.99 -// RCS-ID: $Id: lboxcmn.cpp 39964 2006-07-04 00:31:52Z VZ $ -// Copyright: (c) wxWidgets team -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_LISTBOX - -#include "wx/listbox.h" - -#ifndef WX_PRECOMP - #include "wx/dynarray.h" - #include "wx/arrstr.h" -#endif - -// ============================================================================ -// implementation -// ============================================================================ - -wxListBoxBase::~wxListBoxBase() -{ - // this destructor is required for Darwin -} - -// ---------------------------------------------------------------------------- -// adding items -// ---------------------------------------------------------------------------- - -void wxListBoxBase::InsertItems(unsigned int nItems, const wxString *items, unsigned int pos) -{ - wxArrayString aItems; - for ( unsigned int n = 0; n < nItems; n++ ) - { - aItems.Add(items[n]); - } - - DoInsertItems(aItems, pos); -} - - -void wxListBoxBase::Set(int nItems, const wxString* items, void **clientData) -{ - wxArrayString aItems; - for ( int n = 0; n < nItems; n++ ) - { - aItems.Add(items[n]); - } - - DoSetItems(aItems, clientData); -} - -// ---------------------------------------------------------------------------- -// selection -// ---------------------------------------------------------------------------- - -bool wxListBoxBase::SetStringSelection(const wxString& s, bool select) -{ - const int sel = FindString(s); - if ( sel == wxNOT_FOUND ) - return false; - - SetSelection(sel, select); - - return true; -} - -void wxListBoxBase::DeselectAll(int itemToLeaveSelected) -{ - if ( HasMultipleSelection() ) - { - wxArrayInt selections; - GetSelections(selections); - - size_t count = selections.GetCount(); - for ( size_t n = 0; n < count; n++ ) - { - int item = selections[n]; - if ( item != itemToLeaveSelected ) - Deselect(item); - } - } - else // single selection - { - int sel = GetSelection(); - if ( sel != wxNOT_FOUND && sel != itemToLeaveSelected ) - { - Deselect(sel); - } - } -} - -// ---------------------------------------------------------------------------- -// misc -// ---------------------------------------------------------------------------- - -void wxListBoxBase::Command(wxCommandEvent& event) -{ - SetSelection(event.GetInt(), event.GetExtraLong() != 0); - (void)ProcessEvent(event); -} - -// ---------------------------------------------------------------------------- -// SetFirstItem() and such -// ---------------------------------------------------------------------------- - -void wxListBoxBase::SetFirstItem(const wxString& s) -{ - int n = FindString(s); - - wxCHECK_RET( n != wxNOT_FOUND, wxT("invalid string in wxListBox::SetFirstItem") ); - - DoSetFirstItem(n); -} - -void wxListBoxBase::AppendAndEnsureVisible(const wxString& s) -{ - Append(s); - EnsureVisible(GetCount() - 1); -} - -void wxListBoxBase::EnsureVisible(int WXUNUSED(n)) -{ - // the base class version does nothing (the only alternative would be to - // call SetFirstItem() but this is probably even more stupid) -} - -#endif // wxUSE_LISTBOX diff --git a/wxWidgets/src/common/list.cpp b/wxWidgets/src/common/list.cpp deleted file mode 100644 index 6074a8fddb..0000000000 --- a/wxWidgets/src/common/list.cpp +++ /dev/null @@ -1,768 +0,0 @@ -//////////////////////////////////////////////////////////////////////////////// -// Name: src/common/list.cpp -// Purpose: wxList implementation -// Author: Julian Smart -// Modified by: VZ at 16/11/98: WX_DECLARE_LIST() and typesafe lists added -// Created: 04/01/98 -// RCS-ID: $Id: list.cpp 43048 2006-11-04 18:14:50Z VZ $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -//////////////////////////////////////////////////////////////////////////////// - -// ============================================================================= -// declarations -// ============================================================================= - -// ----------------------------------------------------------------------------- -// headers -// ----------------------------------------------------------------------------- - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#include -#include -#include - -#ifndef WX_PRECOMP - #include "wx/list.h" -#endif - -#if !wxUSE_STL - -// ============================================================================= -// implementation -// ============================================================================= - -// ----------------------------------------------------------------------------- -// wxListKey -// ----------------------------------------------------------------------------- -wxListKey wxDefaultListKey; - -bool wxListKey::operator==(wxListKeyValue value) const -{ - switch ( m_keyType ) - { - default: - wxFAIL_MSG(wxT("bad key type.")); - // let compiler optimize the line above away in release build - // by not putting return here... - - case wxKEY_STRING: - return wxStrcmp(m_key.string, value.string) == 0; - - case wxKEY_INTEGER: - return m_key.integer == value.integer; - } -} - -// ----------------------------------------------------------------------------- -// wxNodeBase -// ----------------------------------------------------------------------------- - -wxNodeBase::wxNodeBase(wxListBase *list, - wxNodeBase *previous, wxNodeBase *next, - void *data, const wxListKey& key) -{ - m_list = list; - m_data = data; - m_previous = previous; - m_next = next; - - switch ( key.GetKeyType() ) - { - case wxKEY_NONE: - break; - - case wxKEY_INTEGER: - m_key.integer = key.GetNumber(); - break; - - case wxKEY_STRING: - // to be free()d later - m_key.string = wxStrdup(key.GetString()); - break; - - default: - wxFAIL_MSG(wxT("invalid key type")); - } - - if ( previous ) - previous->m_next = this; - - if ( next ) - next->m_previous = this; -} - -wxNodeBase::~wxNodeBase() -{ - // handle the case when we're being deleted from the list by the user (i.e. - // not by the list itself from DeleteNode) - we must do it for - // compatibility with old code - if ( m_list != NULL ) - { - if ( m_list->m_keyType == wxKEY_STRING ) - { - free(m_key.string); - } - - m_list->DetachNode(this); - } -} - -int wxNodeBase::IndexOf() const -{ - wxCHECK_MSG( m_list, wxNOT_FOUND, wxT("node doesn't belong to a list in IndexOf")); - - // It would be more efficient to implement IndexOf() completely inside - // wxListBase (only traverse the list once), but this is probably a more - // reusable way of doing it. Can always be optimized at a later date (since - // IndexOf() resides in wxListBase as well) if efficiency is a problem. - int i; - wxNodeBase *prev = m_previous; - - for( i = 0; prev; i++ ) - { - prev = prev->m_previous; - } - - return i; -} - -// ----------------------------------------------------------------------------- -// wxListBase -// ----------------------------------------------------------------------------- - -void wxListBase::Init(wxKeyType keyType) -{ - m_nodeFirst = - m_nodeLast = (wxNodeBase *) NULL; - m_count = 0; - m_destroy = false; - m_keyType = keyType; -} - -wxListBase::wxListBase(size_t count, void *elements[]) -{ - Init(); - - for ( size_t n = 0; n < count; n++ ) - { - Append(elements[n]); - } -} - -void wxListBase::DoCopy(const wxListBase& list) -{ - wxASSERT_MSG( !list.m_destroy, - wxT("copying list which owns it's elements is a bad idea") ); - - m_destroy = list.m_destroy; - m_keyType = list.m_keyType; - m_nodeFirst = - m_nodeLast = (wxNodeBase *) NULL; - - switch (m_keyType) - { - case wxKEY_INTEGER: - { - long key; - for ( wxNodeBase *node = list.GetFirst(); node; node = node->GetNext() ) - { - key = node->GetKeyInteger(); - Append(key, node->GetData()); - } - break; - } - - case wxKEY_STRING: - { - const wxChar *key; - for ( wxNodeBase *node = list.GetFirst(); node; node = node->GetNext() ) - { - key = node->GetKeyString(); - Append(key, node->GetData()); - } - break; - } - - default: - { - for ( wxNodeBase *node = list.GetFirst(); node; node = node->GetNext() ) - { - Append(node->GetData()); - } - break; - } - } - - wxASSERT_MSG( m_count == list.m_count, _T("logic error in wxList::DoCopy") ); -} - -wxListBase::~wxListBase() -{ - wxNodeBase *each = m_nodeFirst; - while ( each != NULL ) - { - wxNodeBase *next = each->GetNext(); - DoDeleteNode(each); - each = next; - } -} - -wxNodeBase *wxListBase::AppendCommon(wxNodeBase *node) -{ - if ( !m_nodeFirst ) - { - m_nodeFirst = node; - m_nodeLast = m_nodeFirst; - } - else - { - m_nodeLast->m_next = node; - m_nodeLast = node; - } - - m_count++; - - return node; -} - -wxNodeBase *wxListBase::Append(void *object) -{ - // all objects in a keyed list should have a key - wxCHECK_MSG( m_keyType == wxKEY_NONE, (wxNodeBase *)NULL, - wxT("need a key for the object to append") ); - - // we use wxDefaultListKey even though it is the default parameter value - // because gcc under Mac OS X seems to miscompile this call otherwise - wxNodeBase *node = CreateNode(m_nodeLast, (wxNodeBase *)NULL, object, - wxDefaultListKey); - - return AppendCommon(node); -} - -wxNodeBase *wxListBase::Append(long key, void *object) -{ - wxCHECK_MSG( (m_keyType == wxKEY_INTEGER) || - (m_keyType == wxKEY_NONE && m_count == 0), - (wxNodeBase *)NULL, - wxT("can't append object with numeric key to this list") ); - - wxNodeBase *node = CreateNode(m_nodeLast, (wxNodeBase *)NULL, object, key); - return AppendCommon(node); -} - -wxNodeBase *wxListBase::Append (const wxChar *key, void *object) -{ - wxCHECK_MSG( (m_keyType == wxKEY_STRING) || - (m_keyType == wxKEY_NONE && m_count == 0), - (wxNodeBase *)NULL, - wxT("can't append object with string key to this list") ); - - wxNodeBase *node = CreateNode(m_nodeLast, (wxNodeBase *)NULL, object, key); - return AppendCommon(node); -} - -wxNodeBase *wxListBase::Insert(wxNodeBase *position, void *object) -{ - // all objects in a keyed list should have a key - wxCHECK_MSG( m_keyType == wxKEY_NONE, (wxNodeBase *)NULL, - wxT("need a key for the object to insert") ); - - wxCHECK_MSG( !position || position->m_list == this, (wxNodeBase *)NULL, - wxT("can't insert before a node from another list") ); - - // previous and next node for the node being inserted - wxNodeBase *prev, *next; - if ( position ) - { - prev = position->GetPrevious(); - next = position; - } - else - { - // inserting in the beginning of the list - prev = (wxNodeBase *)NULL; - next = m_nodeFirst; - } - - // wxDefaultListKey: see comment in Append() above - wxNodeBase *node = CreateNode(prev, next, object, wxDefaultListKey); - if ( !m_nodeFirst ) - { - m_nodeLast = node; - } - - if ( prev == NULL ) - { - m_nodeFirst = node; - } - - m_count++; - - return node; -} - -wxNodeBase *wxListBase::Item(size_t n) const -{ - for ( wxNodeBase *current = GetFirst(); current; current = current->GetNext() ) - { - if ( n-- == 0 ) - { - return current; - } - } - - wxFAIL_MSG( wxT("invalid index in wxListBase::Item") ); - - return (wxNodeBase *)NULL; -} - -wxNodeBase *wxListBase::Find(const wxListKey& key) const -{ - wxASSERT_MSG( m_keyType == key.GetKeyType(), - wxT("this list is not keyed on the type of this key") ); - - for ( wxNodeBase *current = GetFirst(); current; current = current->GetNext() ) - { - if ( key == current->m_key ) - { - return current; - } - } - - // not found - return (wxNodeBase *)NULL; -} - -wxNodeBase *wxListBase::Find(const void *object) const -{ - for ( wxNodeBase *current = GetFirst(); current; current = current->GetNext() ) - { - if ( current->GetData() == object ) - return current; - } - - // not found - return (wxNodeBase *)NULL; -} - -int wxListBase::IndexOf(void *object) const -{ - wxNodeBase *node = Find( object ); - - return node ? node->IndexOf() : wxNOT_FOUND; -} - -void wxListBase::DoDeleteNode(wxNodeBase *node) -{ - // free node's data - if ( m_keyType == wxKEY_STRING ) - { - free(node->m_key.string); - } - - if ( m_destroy ) - { - node->DeleteData(); - } - - // so that the node knows that it's being deleted by the list - node->m_list = NULL; - delete node; -} - -wxNodeBase *wxListBase::DetachNode(wxNodeBase *node) -{ - wxCHECK_MSG( node, NULL, wxT("detaching NULL wxNodeBase") ); - wxCHECK_MSG( node->m_list == this, NULL, - wxT("detaching node which is not from this list") ); - - // update the list - wxNodeBase **prevNext = node->GetPrevious() ? &node->GetPrevious()->m_next - : &m_nodeFirst; - wxNodeBase **nextPrev = node->GetNext() ? &node->GetNext()->m_previous - : &m_nodeLast; - - *prevNext = node->GetNext(); - *nextPrev = node->GetPrevious(); - - m_count--; - - // mark the node as not belonging to this list any more - node->m_list = NULL; - - return node; -} - -bool wxListBase::DeleteNode(wxNodeBase *node) -{ - if ( !DetachNode(node) ) - return false; - - DoDeleteNode(node); - - return true; -} - -bool wxListBase::DeleteObject(void *object) -{ - for ( wxNodeBase *current = GetFirst(); current; current = current->GetNext() ) - { - if ( current->GetData() == object ) - { - DeleteNode(current); - return true; - } - } - - // not found - return false; -} - -void wxListBase::Clear() -{ - wxNodeBase *current = m_nodeFirst; - while ( current ) - { - wxNodeBase *next = current->GetNext(); - DoDeleteNode(current); - current = next; - } - - m_nodeFirst = - m_nodeLast = (wxNodeBase *)NULL; - - m_count = 0; -} - -void wxListBase::ForEach(wxListIterateFunction F) -{ - for ( wxNodeBase *current = GetFirst(); current; current = current->GetNext() ) - { - (*F)(current->GetData()); - } -} - -void *wxListBase::FirstThat(wxListIterateFunction F) -{ - for ( wxNodeBase *current = GetFirst(); current; current = current->GetNext() ) - { - if ( (*F)(current->GetData()) ) - return current->GetData(); - } - - return (wxNodeBase *)NULL; -} - -void *wxListBase::LastThat(wxListIterateFunction F) -{ - for ( wxNodeBase *current = GetLast(); current; current = current->GetPrevious() ) - { - if ( (*F)(current->GetData()) ) - return current->GetData(); - } - - return (wxNodeBase *)NULL; -} - -// (stefan.hammes@urz.uni-heidelberg.de) -// -// function for sorting lists. the concept is borrowed from 'qsort'. -// by giving a sort function, arbitrary lists can be sorted. -// method: -// - put wxObject pointers into an array -// - sort the array with qsort -// - put back the sorted wxObject pointers into the list -// -// CAVE: the sort function receives pointers to wxObject pointers (wxObject **), -// so dereference right! -// EXAMPLE: -// int listcompare(const void *arg1, const void *arg2) -// { -// return(compare(**(wxString **)arg1, -// **(wxString **)arg2)); -// } -// -// void main() -// { -// wxListBase list; -// -// list.Append(new wxString("DEF")); -// list.Append(new wxString("GHI")); -// list.Append(new wxString("ABC")); -// list.Sort(listcompare); -// } - -void wxListBase::Sort(const wxSortCompareFunction compfunc) -{ - // allocate an array for the wxObject pointers of the list - const size_t num = GetCount(); - void **objArray = new void *[num]; - void **objPtr = objArray; - - // go through the list and put the pointers into the array - wxNodeBase *node; - for ( node = GetFirst(); node; node = node->GetNext() ) - { - *objPtr++ = node->GetData(); - } - - // sort the array - qsort((void *)objArray,num,sizeof(wxObject *), -#ifdef __WXWINCE__ - (int (__cdecl *)(const void *,const void *)) -#endif - compfunc); - - // put the sorted pointers back into the list - objPtr = objArray; - for ( node = GetFirst(); node; node = node->GetNext() ) - { - node->SetData(*objPtr++); - } - - // free the array - delete[] objArray; -} - -void wxListBase::Reverse() -{ - wxNodeBase* node = m_nodeFirst; - wxNodeBase* tmp; - - while (node) - { - // swap prev and next pointers - tmp = node->m_next; - node->m_next = node->m_previous; - node->m_previous = tmp; - - // this is the node that was next before swapping - node = tmp; - } - - // swap first and last node - tmp = m_nodeFirst; m_nodeFirst = m_nodeLast; m_nodeLast = tmp; -} - -void wxListBase::DeleteNodes(wxNodeBase* first, wxNodeBase* last) -{ - wxNodeBase* node = first; - - while (node != last) - { - wxNodeBase* next = node->GetNext(); - DeleteNode(node); - node = next; - } -} - -// ============================================================================ -// compatibility section from now on -// ============================================================================ - -#ifdef wxLIST_COMPATIBILITY - -// ----------------------------------------------------------------------------- -// wxList (a.k.a. wxObjectList) -// ----------------------------------------------------------------------------- - -IMPLEMENT_DYNAMIC_CLASS(wxList, wxObject) - -wxList::wxList( int key_type ) - : wxObjectList( (wxKeyType)key_type ) -{ -} - -void wxObjectListNode::DeleteData() -{ - delete (wxObject *)GetData(); -} - -// ---------------------------------------------------------------------------- -// wxStringList -// ---------------------------------------------------------------------------- - -static inline wxChar* MYcopystring(const wxChar* s) -{ - wxChar* copy = new wxChar[wxStrlen(s) + 1]; - return wxStrcpy(copy, s); -} - -IMPLEMENT_DYNAMIC_CLASS(wxStringList, wxObject) - -// instead of WX_DEFINE_LIST(wxStringListBase) we define this function -// ourselves -void wxStringListNode::DeleteData() -{ - delete [] (char *)GetData(); -} - -bool wxStringList::Delete(const wxChar *s) -{ - wxStringListNode *current; - - for ( current = GetFirst(); current; current = current->GetNext() ) - { - if ( wxStrcmp(current->GetData(), s) == 0 ) - { - DeleteNode(current); - return true; - } - } - - // not found - return false; -} - -void wxStringList::DoCopy(const wxStringList& other) -{ - wxASSERT( GetCount() == 0 ); // this list must be empty before copying! - - size_t count = other.GetCount(); - for ( size_t n = 0; n < count; n++ ) - { - Add(other.Item(n)->GetData()); - } -} - -wxStringList::wxStringList() -{ - DeleteContents(true); -} - -// Variable argument list, terminated by a zero -// Makes new storage for the strings -wxStringList::wxStringList (const wxChar *first, ...) -{ - DeleteContents(true); - if ( !first ) - return; - - va_list ap; - va_start(ap, first); - - const wxChar *s = first; - for (;;) - { - Add(s); - - // icc gives this warning in its own va_arg() macro, argh -#ifdef __INTELC__ - #pragma warning(push) - #pragma warning(disable: 1684) -#endif - - s = va_arg(ap, const wxChar *); - -#ifdef __INTELC__ - #pragma warning(pop) -#endif - - if ( !s ) - break; - } - - va_end(ap); -} - -// Only makes new strings if arg is true -wxChar **wxStringList::ListToArray(bool new_copies) const -{ - wxChar **string_array = new wxChar *[GetCount()]; - wxStringListNode *node = GetFirst(); - for (size_t i = 0; i < GetCount(); i++) - { - wxChar *s = node->GetData(); - if ( new_copies ) - string_array[i] = MYcopystring(s); - else - string_array[i] = s; - node = node->GetNext(); - } - - return string_array; -} - -// Checks whether s is a member of the list -bool wxStringList::Member(const wxChar *s) const -{ - for ( wxStringListNode *node = GetFirst(); node; node = node->GetNext() ) - { - const wxChar *s1 = node->GetData(); - if (s == s1 || wxStrcmp (s, s1) == 0) - return true; - } - - return false; -} - -#ifdef __WXWINCE__ -extern "C" int __cdecl -#else -extern "C" int LINKAGEMODE -#endif - -wx_comparestrings(const void *arg1, const void *arg2) -{ - wxChar **s1 = (wxChar **) arg1; - wxChar **s2 = (wxChar **) arg2; - - return wxStrcmp (*s1, *s2); -} - -// Sort a list of strings - deallocates old nodes, allocates new -void wxStringList::Sort() -{ - size_t N = GetCount(); - wxChar **array = new wxChar *[N]; - wxStringListNode *node; - - size_t i = 0; - for ( node = GetFirst(); node; node = node->GetNext() ) - { - array[i++] = node->GetData(); - } - - qsort (array, N, sizeof (wxChar *), wx_comparestrings); - - i = 0; - for ( node = GetFirst(); node; node = node->GetNext() ) - node->SetData( array[i++] ); - - delete [] array; -} - -wxNode *wxStringList::Add(const wxChar *s) -{ - return (wxNode *)(wxStringListBase::Node *) - wxStringListBase::Append(MYcopystring(s)); -} - -wxNode *wxStringList::Prepend(const wxChar *s) -{ - return (wxNode *)(wxStringListBase::Node *) - wxStringListBase::Insert(MYcopystring(s)); -} - -#endif // wxLIST_COMPATIBILITY - -#else // wxUSE_STL = 1 - - #include "wx/listimpl.cpp" - WX_DEFINE_LIST(wxObjectList) - -// with wxUSE_STL wxStringList contains wxString objects, not pointers -void _WX_LIST_HELPER_wxStringListBase::DeleteFunction( wxString WXUNUSED(X) ) -{ -} - -wxStringListBase::BaseListType wxStringListBase::EmptyList; - -#endif // !wxUSE_STL diff --git a/wxWidgets/src/common/listctrlcmn.cpp b/wxWidgets/src/common/listctrlcmn.cpp deleted file mode 100644 index c5366a1aac..0000000000 --- a/wxWidgets/src/common/listctrlcmn.cpp +++ /dev/null @@ -1,54 +0,0 @@ -//////////////////////////////////////////////////////////////////////////////// -// Name: src/common/listctrlcmn.cpp -// Purpose: Common defines for wxListCtrl and wxListCtrl-based classes. -// Author: Kevin Ollivier -// Created: 09/15/06 -// RCS-ID: $Id: listctrlcmn.cpp 41568 2006-10-02 17:38:30Z PC $ -// Copyright: (c) Kevin Ollivier -// Licence: wxWindows licence -//////////////////////////////////////////////////////////////////////////////// - -// ============================================================================= -// declarations -// ============================================================================= - -// ----------------------------------------------------------------------------- -// headers -// ----------------------------------------------------------------------------- - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#if wxUSE_LISTCTRL - -#include "wx/listctrl.h" - -const wxChar wxListCtrlNameStr[] = wxT("listCtrl"); - -// ListCtrl events -DEFINE_EVENT_TYPE(wxEVT_COMMAND_LIST_BEGIN_DRAG) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_LIST_BEGIN_RDRAG) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_LIST_BEGIN_LABEL_EDIT) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_LIST_END_LABEL_EDIT) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_LIST_DELETE_ITEM) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_LIST_DELETE_ALL_ITEMS) -#if WXWIN_COMPATIBILITY_2_4 -DEFINE_EVENT_TYPE(wxEVT_COMMAND_LIST_GET_INFO) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_LIST_SET_INFO) -#endif -DEFINE_EVENT_TYPE(wxEVT_COMMAND_LIST_ITEM_SELECTED) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_LIST_ITEM_DESELECTED) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_LIST_KEY_DOWN) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_LIST_INSERT_ITEM) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_LIST_COL_CLICK) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_LIST_COL_RIGHT_CLICK) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_LIST_COL_BEGIN_DRAG) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_LIST_COL_DRAGGING) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_LIST_COL_END_DRAG) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_LIST_ITEM_RIGHT_CLICK) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_LIST_ITEM_MIDDLE_CLICK) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_LIST_ITEM_ACTIVATED) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_LIST_ITEM_FOCUSED) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_LIST_CACHE_HINT) - -#endif // wxUSE_LISTCTRL diff --git a/wxWidgets/src/common/log.cpp b/wxWidgets/src/common/log.cpp deleted file mode 100644 index dc23a83e35..0000000000 --- a/wxWidgets/src/common/log.cpp +++ /dev/null @@ -1,838 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/common/log.cpp -// Purpose: Assorted wxLogXXX functions, and wxLog (sink for logs) -// Author: Vadim Zeitlin -// Modified by: -// Created: 29/01/98 -// RCS-ID: $Id: log.cpp 67119 2011-03-03 15:09:44Z JS $ -// Copyright: (c) 1998 Vadim Zeitlin -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_LOG - -// wxWidgets -#ifndef WX_PRECOMP - #include "wx/log.h" - #include "wx/app.h" - #include "wx/arrstr.h" - #include "wx/intl.h" - #include "wx/string.h" - #include "wx/utils.h" -#endif //WX_PRECOMP - -#include "wx/apptrait.h" -#include "wx/datetime.h" -#include "wx/file.h" -#include "wx/msgout.h" -#include "wx/textfile.h" -#include "wx/thread.h" -#include "wx/wxchar.h" - -// other standard headers -#ifndef __WXWINCE__ -#include -#endif - -#include - -#ifndef __WXWINCE__ -#include -#else -#include "wx/msw/wince/time.h" -#endif - -#if defined(__WINDOWS__) - #include "wx/msw/private.h" // includes windows.h -#endif - -// ---------------------------------------------------------------------------- -// non member functions -// ---------------------------------------------------------------------------- - -// define this to enable wrapping of log messages -//#define LOG_PRETTY_WRAP - -#ifdef LOG_PRETTY_WRAP - static void wxLogWrap(FILE *f, const char *pszPrefix, const char *psz); -#endif - -// ============================================================================ -// implementation -// ============================================================================ - -// ---------------------------------------------------------------------------- -// implementation of Log functions -// -// NB: unfortunately we need all these distinct functions, we can't make them -// macros and not all compilers inline vararg functions. -// ---------------------------------------------------------------------------- - -// generic log function -void wxVLogGeneric(wxLogLevel level, const wxChar *szFormat, va_list argptr) -{ - if ( wxLog::IsEnabled() ) { - wxLog::OnLog(level, wxString::FormatV(szFormat, argptr), time(NULL)); - } -} - -void wxLogGeneric(wxLogLevel level, const wxChar *szFormat, ...) -{ - va_list argptr; - va_start(argptr, szFormat); - wxVLogGeneric(level, szFormat, argptr); - va_end(argptr); -} - -#define IMPLEMENT_LOG_FUNCTION(level) \ - void wxVLog##level(const wxChar *szFormat, va_list argptr) \ - { \ - if ( wxLog::IsEnabled() ) { \ - wxLog::OnLog(wxLOG_##level, \ - wxString::FormatV(szFormat, argptr), time(NULL));\ - } \ - } \ - \ - void wxLog##level(const wxChar *szFormat, ...) \ - { \ - va_list argptr; \ - va_start(argptr, szFormat); \ - wxVLog##level(szFormat, argptr); \ - va_end(argptr); \ - } - -IMPLEMENT_LOG_FUNCTION(Error) -IMPLEMENT_LOG_FUNCTION(Warning) -IMPLEMENT_LOG_FUNCTION(Message) -IMPLEMENT_LOG_FUNCTION(Info) -IMPLEMENT_LOG_FUNCTION(Status) - -void wxSafeShowMessage(const wxString& title, const wxString& text) -{ -#ifdef __WINDOWS__ - ::MessageBox(NULL, text, title, MB_OK | MB_ICONSTOP); -#else - wxFprintf(stderr, _T("%s: %s\n"), title.c_str(), text.c_str()); - fflush(stderr); -#endif -} - -// fatal errors can't be suppressed nor handled by the custom log target and -// always terminate the program -void wxVLogFatalError(const wxChar *szFormat, va_list argptr) -{ - wxSafeShowMessage(_T("Fatal Error"), wxString::FormatV(szFormat, argptr)); - -#ifdef __WXWINCE__ - ExitThread(3); -#else - abort(); -#endif -} - -void wxLogFatalError(const wxChar *szFormat, ...) -{ - va_list argptr; - va_start(argptr, szFormat); - wxVLogFatalError(szFormat, argptr); - - // some compilers warn about unreachable code and it shouldn't matter - // for the others anyhow... - //va_end(argptr); -} - -// same as info, but only if 'verbose' mode is on -void wxVLogVerbose(const wxChar *szFormat, va_list argptr) -{ - if ( wxLog::IsEnabled() ) { - if ( wxLog::GetActiveTarget() != NULL && wxLog::GetVerbose() ) { - wxLog::OnLog(wxLOG_Info, - wxString::FormatV(szFormat, argptr), time(NULL)); - } - } -} - -void wxLogVerbose(const wxChar *szFormat, ...) -{ - va_list argptr; - va_start(argptr, szFormat); - wxVLogVerbose(szFormat, argptr); - va_end(argptr); -} - -// debug functions -#ifdef __WXDEBUG__ -#define IMPLEMENT_LOG_DEBUG_FUNCTION(level) \ - void wxVLog##level(const wxChar *szFormat, va_list argptr) \ - { \ - if ( wxLog::IsEnabled() ) { \ - wxLog::OnLog(wxLOG_##level, \ - wxString::FormatV(szFormat, argptr), time(NULL));\ - } \ - } \ - \ - void wxLog##level(const wxChar *szFormat, ...) \ - { \ - va_list argptr; \ - va_start(argptr, szFormat); \ - wxVLog##level(szFormat, argptr); \ - va_end(argptr); \ - } - - void wxVLogTrace(const wxChar *mask, const wxChar *szFormat, va_list argptr) - { - if ( wxLog::IsEnabled() && wxLog::IsAllowedTraceMask(mask) ) { - wxString msg; - msg << _T("(") << mask << _T(") ") << wxString::FormatV(szFormat, argptr); - - wxLog::OnLog(wxLOG_Trace, msg, time(NULL)); - } - } - - void wxLogTrace(const wxChar *mask, const wxChar *szFormat, ...) - { - va_list argptr; - va_start(argptr, szFormat); - wxVLogTrace(mask, szFormat, argptr); - va_end(argptr); - } - - void wxVLogTrace(wxTraceMask mask, const wxChar *szFormat, va_list argptr) - { - // we check that all of mask bits are set in the current mask, so - // that wxLogTrace(wxTraceRefCount | wxTraceOle) will only do something - // if both bits are set. - if ( wxLog::IsEnabled() && ((wxLog::GetTraceMask() & mask) == mask) ) { - wxLog::OnLog(wxLOG_Trace, wxString::FormatV(szFormat, argptr), time(NULL)); - } - } - - void wxLogTrace(wxTraceMask mask, const wxChar *szFormat, ...) - { - va_list argptr; - va_start(argptr, szFormat); - wxVLogTrace(mask, szFormat, argptr); - va_end(argptr); - } - -#else // release - #define IMPLEMENT_LOG_DEBUG_FUNCTION(level) -#endif - -IMPLEMENT_LOG_DEBUG_FUNCTION(Debug) -IMPLEMENT_LOG_DEBUG_FUNCTION(Trace) - -// wxLogSysError: one uses the last error code, for other you must give it -// explicitly - -// return the system error message description -static inline wxString wxLogSysErrorHelper(long err) -{ - return wxString::Format(_(" (error %ld: %s)"), err, wxSysErrorMsg(err)); -} - -void WXDLLEXPORT wxVLogSysError(const wxChar *szFormat, va_list argptr) -{ - wxVLogSysError(wxSysErrorCode(), szFormat, argptr); -} - -void WXDLLEXPORT wxLogSysError(const wxChar *szFormat, ...) -{ - va_list argptr; - va_start(argptr, szFormat); - wxVLogSysError(szFormat, argptr); - va_end(argptr); -} - -void WXDLLEXPORT wxVLogSysError(long err, const wxChar *fmt, va_list argptr) -{ - if ( wxLog::IsEnabled() ) { - wxLog::OnLog(wxLOG_Error, - wxString::FormatV(fmt, argptr) + wxLogSysErrorHelper(err), - time(NULL)); - } -} - -void WXDLLEXPORT wxLogSysError(long lErrCode, const wxChar *szFormat, ...) -{ - va_list argptr; - va_start(argptr, szFormat); - wxVLogSysError(lErrCode, szFormat, argptr); - va_end(argptr); -} - -// ---------------------------------------------------------------------------- -// wxLog class implementation -// ---------------------------------------------------------------------------- - -// define a critical section gs_prevCS protecting access to wxLog::ms_prevXXX -wxCRIT_SECT_DECLARE(gs_prevCS); - -/* static */ -unsigned wxLog::DoLogNumberOfRepeats() -{ - wxLog * const pLogger = GetActiveTarget(); - return pLogger ? pLogger->LogLastRepeatIfNeeded() : 0u; -} - -unsigned wxLog::LogLastRepeatIfNeeded() -{ - wxCRIT_SECT_LOCKER(lock, gs_prevCS); - - return LogLastRepeatIfNeededUnlocked(); -} - -unsigned wxLog::LogLastRepeatIfNeededUnlocked() -{ - long retval = ms_prevCounter; - if ( ms_prevCounter > 0 ) - { - wxString msg; -#if wxUSE_INTL - msg.Printf(wxPLURAL("The previous message repeated once.", - "The previous message repeated %lu times.", - ms_prevCounter), - ms_prevCounter); -#else - msg.Printf(wxT("The previous message was repeated.")); -#endif - ms_prevCounter = 0; - ms_prevString.clear(); - DoLog(ms_prevLevel, msg.c_str(), ms_prevTimeStamp); - } - return retval; -} - -wxLog::~wxLog() -{ -} - -/* static */ -void wxLog::OnLog(wxLogLevel level, const wxChar *szString, time_t t) -{ - if ( IsEnabled() && ms_logLevel >= level ) - { - wxLog *pLogger = GetActiveTarget(); - if ( pLogger ) - { - if ( GetRepetitionCounting() ) - { - wxCRIT_SECT_LOCKER(lock, gs_prevCS); - - if ( szString == ms_prevString ) - { - ms_prevCounter++; - - // nothing else to do, in particular, don't log the - // repeated message - return; - } - - pLogger->LogLastRepeatIfNeededUnlocked(); - - // reset repetition counter for a new message - ms_prevString = szString; - ms_prevLevel = level; - ms_prevTimeStamp = t; - } - - pLogger->DoLog(level, szString, t); - } - } -} - -// deprecated function -#if WXWIN_COMPATIBILITY_2_6 - -wxChar *wxLog::SetLogBuffer(wxChar * WXUNUSED(buf), size_t WXUNUSED(size)) -{ - return NULL; -} - -#endif // WXWIN_COMPATIBILITY_2_6 - -wxLog *wxLog::GetActiveTarget() -{ - if ( ms_bAutoCreate && ms_pLogger == NULL ) { - // prevent infinite recursion if someone calls wxLogXXX() from - // wxApp::CreateLogTarget() - static bool s_bInGetActiveTarget = false; - if ( !s_bInGetActiveTarget ) { - s_bInGetActiveTarget = true; - - // ask the application to create a log target for us - if ( wxTheApp != NULL ) - ms_pLogger = wxTheApp->GetTraits()->CreateLogTarget(); - else - ms_pLogger = new wxLogStderr; - - s_bInGetActiveTarget = false; - - // do nothing if it fails - what can we do? - } - } - - return ms_pLogger; -} - -wxLog *wxLog::SetActiveTarget(wxLog *pLogger) -{ - if ( ms_pLogger != NULL ) { - // flush the old messages before changing because otherwise they might - // get lost later if this target is not restored - ms_pLogger->Flush(); - } - - wxLog *pOldLogger = ms_pLogger; - ms_pLogger = pLogger; - - return pOldLogger; -} - -void wxLog::DontCreateOnDemand() -{ - ms_bAutoCreate = false; - - // this is usually called at the end of the program and we assume that it - // is *always* called at the end - so we free memory here to avoid false - // memory leak reports from wxWin memory tracking code - ClearTraceMasks(); -} - -void wxLog::DoCreateOnDemand() -{ - ms_bAutoCreate = true; -} - -void wxLog::RemoveTraceMask(const wxString& str) -{ - int index = ms_aTraceMasks.Index(str); - if ( index != wxNOT_FOUND ) - ms_aTraceMasks.RemoveAt((size_t)index); -} - -void wxLog::ClearTraceMasks() -{ - ms_aTraceMasks.Clear(); -} - -void wxLog::TimeStamp(wxString *str) -{ -#if wxUSE_DATETIME - if ( ms_timestamp ) - { - wxChar buf[256]; - time_t timeNow; - (void)time(&timeNow); - - struct tm tm; - wxStrftime(buf, WXSIZEOF(buf), - ms_timestamp, wxLocaltime_r(&timeNow, &tm)); - - str->Empty(); - *str << buf << wxT(": "); - } -#endif // wxUSE_DATETIME -} - -void wxLog::DoLog(wxLogLevel level, const wxChar *szString, time_t t) -{ - switch ( level ) { - case wxLOG_FatalError: - DoLogString(wxString(_("Fatal error: ")) + szString, t); - DoLogString(_("Program aborted."), t); - Flush(); -#ifdef __WXWINCE__ - ExitThread(3); -#else - abort(); -#endif - break; - - case wxLOG_Error: - DoLogString(wxString(_("Error: ")) + szString, t); - break; - - case wxLOG_Warning: - DoLogString(wxString(_("Warning: ")) + szString, t); - break; - - case wxLOG_Info: - if ( GetVerbose() ) - case wxLOG_Message: - case wxLOG_Status: - default: // log unknown log levels too - DoLogString(szString, t); - break; - - case wxLOG_Trace: - case wxLOG_Debug: -#ifdef __WXDEBUG__ - { - wxString msg = level == wxLOG_Trace ? wxT("Trace: ") - : wxT("Debug: "); - msg << szString; - DoLogString(msg, t); - } -#endif // Debug - break; - } -} - -void wxLog::DoLogString(const wxChar *WXUNUSED(szString), time_t WXUNUSED(t)) -{ - wxFAIL_MSG(wxT("DoLogString must be overriden if it's called.")); -} - -void wxLog::Flush() -{ - LogLastRepeatIfNeeded(); -} - -/*static*/ bool wxLog::IsAllowedTraceMask(const wxChar *mask) -{ - for ( wxArrayString::iterator it = ms_aTraceMasks.begin(), - en = ms_aTraceMasks.end(); - it != en; ++it ) - if ( *it == mask) - return true; - return false; -} - -// ---------------------------------------------------------------------------- -// wxLogBuffer implementation -// ---------------------------------------------------------------------------- - -void wxLogBuffer::Flush() -{ - if ( !m_str.empty() ) - { - wxMessageOutputBest out; - out.Printf(_T("%s"), m_str.c_str()); - m_str.clear(); - } -} - -void wxLogBuffer::DoLog(wxLogLevel level, const wxChar *szString, time_t t) -{ - switch ( level ) - { - case wxLOG_Trace: - case wxLOG_Debug: -#ifdef __WXDEBUG__ - // don't put debug messages in the buffer, we don't want to show - // them to the user in a msg box, log them immediately - { - wxString str; - TimeStamp(&str); - str += szString; - - wxMessageOutputDebug dbgout; - dbgout.Printf(_T("%s\n"), str.c_str()); - } -#endif // __WXDEBUG__ - break; - - default: - wxLog::DoLog(level, szString, t); - } -} - -void wxLogBuffer::DoLogString(const wxChar *szString, time_t WXUNUSED(t)) -{ - m_str << szString << _T("\n"); -} - -// ---------------------------------------------------------------------------- -// wxLogStderr class implementation -// ---------------------------------------------------------------------------- - -wxLogStderr::wxLogStderr(FILE *fp) -{ - if ( fp == NULL ) - m_fp = stderr; - else - m_fp = fp; -} - -void wxLogStderr::DoLogString(const wxChar *szString, time_t WXUNUSED(t)) -{ - wxString str; - TimeStamp(&str); - str << szString; - - wxFputs(str, m_fp); - wxFputc(_T('\n'), m_fp); - fflush(m_fp); - - // under GUI systems such as Windows or Mac, programs usually don't have - // stderr at all, so show the messages also somewhere else, typically in - // the debugger window so that they go at least somewhere instead of being - // simply lost - if ( m_fp == stderr ) - { - wxAppTraits *traits = wxTheApp ? wxTheApp->GetTraits() : NULL; - if ( traits && !traits->HasStderr() ) - { - wxMessageOutputDebug dbgout; - dbgout.Printf(_T("%s\n"), str.c_str()); - } - } -} - -// ---------------------------------------------------------------------------- -// wxLogStream implementation -// ---------------------------------------------------------------------------- - -#if wxUSE_STD_IOSTREAM -#include "wx/ioswrap.h" -wxLogStream::wxLogStream(wxSTD ostream *ostr) -{ - if ( ostr == NULL ) - m_ostr = &wxSTD cerr; - else - m_ostr = ostr; -} - -void wxLogStream::DoLogString(const wxChar *szString, time_t WXUNUSED(t)) -{ - wxString str; - TimeStamp(&str); - (*m_ostr) << wxSafeConvertWX2MB(str) << wxSafeConvertWX2MB(szString) << wxSTD endl; -} -#endif // wxUSE_STD_IOSTREAM - -// ---------------------------------------------------------------------------- -// wxLogChain -// ---------------------------------------------------------------------------- - -wxLogChain::wxLogChain(wxLog *logger) -{ - m_bPassMessages = true; - - m_logNew = logger; - m_logOld = wxLog::SetActiveTarget(this); -} - -wxLogChain::~wxLogChain() -{ - wxLog::SetActiveTarget(m_logOld); - - if ( m_logNew != this ) - delete m_logNew; -} - -void wxLogChain::SetLog(wxLog *logger) -{ - if ( m_logNew != this ) - delete m_logNew; - - m_logNew = logger; -} - -void wxLogChain::Flush() -{ - if ( m_logOld ) - m_logOld->Flush(); - - // be careful to avoid infinite recursion - if ( m_logNew && m_logNew != this ) - m_logNew->Flush(); -} - -void wxLogChain::DoLog(wxLogLevel level, const wxChar *szString, time_t t) -{ - // let the previous logger show it - if ( m_logOld && IsPassingMessages() ) - { - // bogus cast just to access protected DoLog - ((wxLogChain *)m_logOld)->DoLog(level, szString, t); - } - - if ( m_logNew && m_logNew != this ) - { - // as above... - ((wxLogChain *)m_logNew)->DoLog(level, szString, t); - } -} - -// ---------------------------------------------------------------------------- -// wxLogPassThrough -// ---------------------------------------------------------------------------- - -#ifdef __VISUALC__ - // "'this' : used in base member initializer list" - so what? - #pragma warning(disable:4355) -#endif // VC++ - -wxLogPassThrough::wxLogPassThrough() - : wxLogChain(this) -{ -} - -#ifdef __VISUALC__ - #pragma warning(default:4355) -#endif // VC++ - -// ============================================================================ -// Global functions/variables -// ============================================================================ - -// ---------------------------------------------------------------------------- -// static variables -// ---------------------------------------------------------------------------- - -bool wxLog::ms_bRepetCounting = false; -wxString wxLog::ms_prevString; -unsigned int wxLog::ms_prevCounter = 0; -time_t wxLog::ms_prevTimeStamp= 0; -wxLogLevel wxLog::ms_prevLevel; - -wxLog *wxLog::ms_pLogger = (wxLog *)NULL; -bool wxLog::ms_doLog = true; -bool wxLog::ms_bAutoCreate = true; -bool wxLog::ms_bVerbose = false; - -wxLogLevel wxLog::ms_logLevel = wxLOG_Max; // log everything by default - -size_t wxLog::ms_suspendCount = 0; - -const wxChar *wxLog::ms_timestamp = wxT("%X"); // time only, no date - -wxTraceMask wxLog::ms_ulTraceMask = (wxTraceMask)0; -wxArrayString wxLog::ms_aTraceMasks; - -// ---------------------------------------------------------------------------- -// stdout error logging helper -// ---------------------------------------------------------------------------- - -// helper function: wraps the message and justifies it under given position -// (looks more pretty on the terminal). Also adds newline at the end. -// -// TODO this is now disabled until I find a portable way of determining the -// terminal window size (ok, I found it but does anybody really cares?) -#ifdef LOG_PRETTY_WRAP -static void wxLogWrap(FILE *f, const char *pszPrefix, const char *psz) -{ - size_t nMax = 80; // FIXME - size_t nStart = strlen(pszPrefix); - fputs(pszPrefix, f); - - size_t n; - while ( *psz != '\0' ) { - for ( n = nStart; (n < nMax) && (*psz != '\0'); n++ ) - putc(*psz++, f); - - // wrapped? - if ( *psz != '\0' ) { - /*putc('\n', f);*/ - for ( n = 0; n < nStart; n++ ) - putc(' ', f); - - // as we wrapped, squeeze all white space - while ( isspace(*psz) ) - psz++; - } - } - - putc('\n', f); -} -#endif //LOG_PRETTY_WRAP - -// ---------------------------------------------------------------------------- -// error code/error message retrieval functions -// ---------------------------------------------------------------------------- - -// get error code from syste -unsigned long wxSysErrorCode() -{ -#if defined(__WXMSW__) && !defined(__WXMICROWIN__) - return ::GetLastError(); -#else //Unix - return errno; -#endif //Win/Unix -} - -// get error message from system -const wxChar *wxSysErrorMsg(unsigned long nErrCode) -{ - if ( nErrCode == 0 ) - nErrCode = wxSysErrorCode(); - -#if defined(__WXMSW__) && !defined(__WXMICROWIN__) - static wxChar s_szBuf[1024]; - - // get error message from system - LPVOID lpMsgBuf; - if ( ::FormatMessage - ( - FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, - NULL, - nErrCode, - MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), - (LPTSTR)&lpMsgBuf, - 0, - NULL - ) == 0 ) - { - // if this happens, something is seriously wrong, so don't use _() here - // for safety - wxSprintf(s_szBuf, _T("unknown error %lx"), nErrCode); - return s_szBuf; - } - - - // copy it to our buffer and free memory - // Crashes on SmartPhone (FIXME) -#if !defined(__SMARTPHONE__) /* of WinCE */ - if( lpMsgBuf != 0 ) - { - wxStrncpy(s_szBuf, (const wxChar *)lpMsgBuf, WXSIZEOF(s_szBuf) - 1); - s_szBuf[WXSIZEOF(s_szBuf) - 1] = wxT('\0'); - - LocalFree(lpMsgBuf); - - // returned string is capitalized and ended with '\r\n' - bad - s_szBuf[0] = (wxChar)wxTolower(s_szBuf[0]); - size_t len = wxStrlen(s_szBuf); - if ( len > 0 ) { - // truncate string - if ( s_szBuf[len - 2] == wxT('\r') ) - s_szBuf[len - 2] = wxT('\0'); - } - } - else -#endif // !__SMARTPHONE__ - { - s_szBuf[0] = wxT('\0'); - } - - return s_szBuf; -#else // !__WXMSW__ - #if wxUSE_UNICODE - static wchar_t s_wzBuf[1024]; - wxConvCurrent->MB2WC(s_wzBuf, strerror((int)nErrCode), - WXSIZEOF(s_wzBuf) - 1); - return s_wzBuf; - #else - return strerror((int)nErrCode); - #endif -#endif // __WXMSW__/!__WXMSW__ -} - -#endif // wxUSE_LOG diff --git a/wxWidgets/src/common/longlong.cpp b/wxWidgets/src/common/longlong.cpp deleted file mode 100644 index 78a47ce25d..0000000000 --- a/wxWidgets/src/common/longlong.cpp +++ /dev/null @@ -1,1363 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/common/longlong.cpp -// Purpose: implementation of wxLongLongNative -// Author: Jeffrey C. Ollie , Vadim Zeitlin -// Remarks: this class is not public in wxWidgets 2.0! It is intentionally -// not documented and is for private use only. -// Modified by: -// Created: 10.02.99 -// RCS-ID: $Id: longlong.cpp 40750 2006-08-22 19:04:45Z MW $ -// Copyright: (c) 1998 Vadim Zeitlin -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// headers -// ============================================================================ - -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_LONGLONG - -#include "wx/longlong.h" - -#ifndef WX_PRECOMP - #include "wx/math.h" // for fabs() -#endif - -#if wxUSE_STREAMS - #include "wx/txtstrm.h" -#endif - -#include // for memset() - -#include "wx/ioswrap.h" - -// ============================================================================ -// implementation -// ============================================================================ - -#if wxUSE_LONGLONG_NATIVE - -// ---------------------------------------------------------------------------- -// misc -// ---------------------------------------------------------------------------- - -void *wxLongLongNative::asArray() const -{ - static unsigned char temp[8]; - - temp[0] = wx_truncate_cast(unsigned char, ((m_ll >> 56) & 0xFF)); - temp[1] = wx_truncate_cast(unsigned char, ((m_ll >> 48) & 0xFF)); - temp[2] = wx_truncate_cast(unsigned char, ((m_ll >> 40) & 0xFF)); - temp[3] = wx_truncate_cast(unsigned char, ((m_ll >> 32) & 0xFF)); - temp[4] = wx_truncate_cast(unsigned char, ((m_ll >> 24) & 0xFF)); - temp[5] = wx_truncate_cast(unsigned char, ((m_ll >> 16) & 0xFF)); - temp[6] = wx_truncate_cast(unsigned char, ((m_ll >> 8) & 0xFF)); - temp[7] = wx_truncate_cast(unsigned char, ((m_ll >> 0) & 0xFF)); - - return temp; -} - -void *wxULongLongNative::asArray() const -{ - static unsigned char temp[8]; - - temp[0] = wx_truncate_cast(unsigned char, ((m_ll >> 56) & 0xFF)); - temp[1] = wx_truncate_cast(unsigned char, ((m_ll >> 48) & 0xFF)); - temp[2] = wx_truncate_cast(unsigned char, ((m_ll >> 40) & 0xFF)); - temp[3] = wx_truncate_cast(unsigned char, ((m_ll >> 32) & 0xFF)); - temp[4] = wx_truncate_cast(unsigned char, ((m_ll >> 24) & 0xFF)); - temp[5] = wx_truncate_cast(unsigned char, ((m_ll >> 16) & 0xFF)); - temp[6] = wx_truncate_cast(unsigned char, ((m_ll >> 8) & 0xFF)); - temp[7] = wx_truncate_cast(unsigned char, ((m_ll >> 0) & 0xFF)); - - return temp; -} - -#if wxUSE_LONGLONG_WX -wxLongLongNative::wxLongLongNative(wxLongLongWx ll) -{ - // assign first to avoid precision loss! - m_ll = ll.GetHi(); - m_ll <<= 32; - m_ll |= ll.GetLo(); -} - -wxLongLongNative& wxLongLongNative::operator=(wxLongLongWx ll) -{ - // assign first to avoid precision loss! - m_ll = ll.GetHi(); - m_ll <<= 32; - m_ll |= ll.GetLo(); - return *this; -} - -wxLongLongNative& wxLongLongNative::operator=(const class wxULongLongWx &ll) -{ - // assign first to avoid precision loss! - m_ll = ll.GetHi(); - m_ll <<= 32; - m_ll |= ll.GetLo(); - return *this; -} - -wxULongLongNative::wxULongLongNative(const class wxULongLongWx &ll) -{ - // assign first to avoid precision loss! - m_ll = ll.GetHi(); - m_ll <<= 32; - m_ll |= ((unsigned long) ll.GetLo()); -} - -wxULongLongNative& wxULongLongNative::operator=(wxLongLongWx ll) -{ - // assign first to avoid precision loss! - m_ll = ll.GetHi(); - m_ll <<= 32; - m_ll |= ((unsigned long) ll.GetLo()); - return *this; -} - -wxULongLongNative& wxULongLongNative::operator=(const class wxULongLongWx &ll) -{ - // assign first to avoid precision loss! - m_ll = ll.GetHi(); - m_ll <<= 32; - m_ll |= ((unsigned long) ll.GetLo()); - return *this; -} -#endif - -#endif // wxUSE_LONGLONG_NATIVE - -// ============================================================================ -// wxLongLongWx: emulation of 'long long' using 2 longs -// ============================================================================ - -#if wxUSE_LONGLONG_WX - -// Set value from unsigned wxULongLongWx -wxLongLongWx &wxLongLongWx::operator=(const class wxULongLongWx &ll) -{ - m_hi = (unsigned long) ll.GetHi(); - m_lo = ll.GetLo(); - return *this; -} - -// assignment -wxLongLongWx& wxLongLongWx::Assign(double d) -{ - bool positive = d >= 0; - d = fabs(d); - if ( d <= ULONG_MAX ) - { - m_hi = 0; - m_lo = (long)d; - } - else - { - m_hi = (unsigned long)(d / (1.0 + (double)ULONG_MAX)); - m_lo = (unsigned long)(d - ((double)m_hi * (1.0 + (double)ULONG_MAX))); - } - -#ifdef wxLONGLONG_TEST_MODE - m_ll = (wxLongLong_t)d; - - Check(); -#endif // wxLONGLONG_TEST_MODE - - if ( !positive ) - Negate(); - - return *this; -} - -double wxLongLongWx::ToDouble() const -{ - double d = m_hi; - d *= 1.0 + (double)ULONG_MAX; - d += m_lo; - -#ifdef wxLONGLONG_TEST_MODE - wxASSERT( d == m_ll ); -#endif // wxLONGLONG_TEST_MODE - - return d; -} - -double wxULongLongWx::ToDouble() const -{ - unsigned double d = m_hi; - d *= 1.0 + (double)ULONG_MAX; - d += m_lo; - -#ifdef wxLONGLONG_TEST_MODE - wxASSERT( d == m_ll ); -#endif // wxLONGLONG_TEST_MODE - - return d; -} - -wxLongLongWx wxLongLongWx::operator<<(int shift) const -{ - wxLongLongWx ll(*this); - ll <<= shift; - - return ll; -} - -wxULongLongWx wxULongLongWx::operator<<(int shift) const -{ - wxULongLongWx ll(*this); - ll <<= shift; - - return ll; -} - -wxLongLongWx& wxLongLongWx::operator<<=(int shift) -{ - if (shift != 0) - { - if (shift < 32) - { - m_hi <<= shift; - m_hi |= m_lo >> (32 - shift); - m_lo <<= shift; - } - else - { - m_hi = m_lo << (shift - 32); - m_lo = 0; - } - } - -#ifdef wxLONGLONG_TEST_MODE - m_ll <<= shift; - - Check(); -#endif // wxLONGLONG_TEST_MODE - - return *this; -} - -wxULongLongWx& wxULongLongWx::operator<<=(int shift) -{ - if (shift != 0) - { - if (shift < 32) - { - m_hi <<= shift; - m_hi |= m_lo >> (32 - shift); - m_lo <<= shift; - } - else - { - m_hi = m_lo << (shift - 32); - m_lo = 0; - } - } - -#ifdef wxLONGLONG_TEST_MODE - m_ll <<= shift; - - Check(); -#endif // wxLONGLONG_TEST_MODE - - return *this; -} - -wxLongLongWx wxLongLongWx::operator>>(int shift) const -{ - wxLongLongWx ll(*this); - ll >>= shift; - - return ll; -} - -wxULongLongWx wxULongLongWx::operator>>(int shift) const -{ - wxULongLongWx ll(*this); - ll >>= shift; - - return ll; -} - -wxLongLongWx& wxLongLongWx::operator>>=(int shift) -{ - if (shift != 0) - { - if (shift < 32) - { - m_lo >>= shift; - m_lo |= m_hi << (32 - shift); - m_hi >>= shift; - } - else - { - m_lo = m_hi >> (shift - 32); - m_hi = (m_hi < 0 ? -1L : 0); - } - } - -#ifdef wxLONGLONG_TEST_MODE - m_ll >>= shift; - - Check(); -#endif // wxLONGLONG_TEST_MODE - - return *this; -} - -wxULongLongWx& wxULongLongWx::operator>>=(int shift) -{ - if (shift != 0) - { - if (shift < 32) - { - m_lo >>= shift; - m_lo |= m_hi << (32 - shift); - m_hi >>= shift; - } - else - { - m_lo = m_hi >> (shift - 32); - m_hi = 0; - } - } - -#ifdef wxLONGLONG_TEST_MODE - m_ll >>= shift; - - Check(); -#endif // wxLONGLONG_TEST_MODE - - return *this; -} - -wxLongLongWx wxLongLongWx::operator+(const wxLongLongWx& ll) const -{ - wxLongLongWx res(*this); - res += ll; - - return res; -} - -wxULongLongWx wxULongLongWx::operator+(const wxULongLongWx& ll) const -{ - wxULongLongWx res(*this); - res += ll; - - return res; -} - -wxLongLongWx wxLongLongWx::operator+(long l) const -{ - wxLongLongWx res(*this); - res += l; - - return res; -} - -wxULongLongWx wxULongLongWx::operator+(unsigned long l) const -{ - wxULongLongWx res(*this); - res += l; - - return res; -} - -wxLongLongWx& wxLongLongWx::operator+=(const wxLongLongWx& ll) -{ - unsigned long previous = m_lo; - - m_lo += ll.m_lo; - m_hi += ll.m_hi; - - if ((m_lo < previous) || (m_lo < ll.m_lo)) - m_hi++; - -#ifdef wxLONGLONG_TEST_MODE - m_ll += ll.m_ll; - - Check(); -#endif // wxLONGLONG_TEST_MODE - - return *this; -} - -wxULongLongWx& wxULongLongWx::operator+=(const wxULongLongWx& ll) -{ - unsigned long previous = m_lo; - - m_lo += ll.m_lo; - m_hi += ll.m_hi; - - if ((m_lo < previous) || (m_lo < ll.m_lo)) - m_hi++; - -#ifdef wxLONGLONG_TEST_MODE - m_ll += ll.m_ll; - - Check(); -#endif // wxLONGLONG_TEST_MODE - - return *this; -} - -wxLongLongWx& wxLongLongWx::operator+=(long l) -{ - unsigned long previous = m_lo; - - m_lo += l; - if (l < 0) - m_hi += -1l; - - if ((m_lo < previous) || (m_lo < (unsigned long)l)) - m_hi++; - -#ifdef wxLONGLONG_TEST_MODE - m_ll += l; - - Check(); -#endif // wxLONGLONG_TEST_MODE - - return *this; -} - -wxULongLongWx& wxULongLongWx::operator+=(unsigned long l) -{ - unsigned long previous = m_lo; - - m_lo += l; - - if ((m_lo < previous) || (m_lo < l)) - m_hi++; - -#ifdef wxLONGLONG_TEST_MODE - m_ll += l; - - Check(); -#endif // wxLONGLONG_TEST_MODE - - return *this; -} - -// pre increment -wxLongLongWx& wxLongLongWx::operator++() -{ - m_lo++; - if (m_lo == 0) - m_hi++; - -#ifdef wxLONGLONG_TEST_MODE - m_ll++; - - Check(); -#endif // wxLONGLONG_TEST_MODE - - return *this; -} - -wxULongLongWx& wxULongLongWx::operator++() -{ - m_lo++; - if (m_lo == 0) - m_hi++; - -#ifdef wxLONGLONG_TEST_MODE - m_ll++; - - Check(); -#endif // wxLONGLONG_TEST_MODE - - return *this; -} - -// negation -wxLongLongWx wxLongLongWx::operator-() const -{ - wxLongLongWx res(*this); - res.Negate(); - - return res; -} - -wxLongLongWx& wxLongLongWx::Negate() -{ - m_hi = ~m_hi; - m_lo = ~m_lo; - - m_lo++; - if ( m_lo == 0 ) - m_hi++; - -#ifdef wxLONGLONG_TEST_MODE - m_ll = -m_ll; - - Check(); -#endif // wxLONGLONG_TEST_MODE - - return *this; -} - -// subtraction - -wxLongLongWx wxLongLongWx::operator-(const wxLongLongWx& ll) const -{ - wxLongLongWx res(*this); - res -= ll; - - return res; -} - -wxLongLongWx wxULongLongWx::operator-(const wxULongLongWx& ll) const -{ - wxASSERT(m_hi <= LONG_MAX ); - wxASSERT(ll.m_hi <= LONG_MAX ); - - wxLongLongWx res( (long)m_hi , m_lo ); - wxLongLongWx op( (long)ll.m_hi , ll.m_lo ); - res -= op; - - return res; -} - -wxLongLongWx& wxLongLongWx::operator-=(const wxLongLongWx& ll) -{ - unsigned long previous = m_lo; - - m_lo -= ll.m_lo; - m_hi -= ll.m_hi; - - if (previous < ll.m_lo) - m_hi--; - -#ifdef wxLONGLONG_TEST_MODE - m_ll -= ll.m_ll; - - Check(); -#endif // wxLONGLONG_TEST_MODE - - return *this; -} - -wxULongLongWx& wxULongLongWx::operator-=(const wxULongLongWx& ll) -{ - unsigned long previous = m_lo; - - m_lo -= ll.m_lo; - m_hi -= ll.m_hi; - - if (previous < ll.m_lo) - m_hi--; - -#ifdef wxLONGLONG_TEST_MODE - m_ll -= ll.m_ll; - - Check(); -#endif // wxLONGLONG_TEST_MODE - - return *this; -} - -// pre decrement -wxLongLongWx& wxLongLongWx::operator--() -{ - m_lo--; - if (m_lo == 0xFFFFFFFF) - m_hi--; - -#ifdef wxLONGLONG_TEST_MODE - m_ll--; - - Check(); -#endif // wxLONGLONG_TEST_MODE - - return *this; -} - -wxULongLongWx& wxULongLongWx::operator--() -{ - m_lo--; - if (m_lo == 0xFFFFFFFF) - m_hi--; - -#ifdef wxLONGLONG_TEST_MODE - m_ll--; - - Check(); -#endif // wxLONGLONG_TEST_MODE - - return *this; -} - -// comparison operators - -bool wxLongLongWx::operator<(const wxLongLongWx& ll) const -{ - if ( m_hi < ll.m_hi ) - return true; - else if ( m_hi == ll.m_hi ) - return m_lo < ll.m_lo; - else - return false; -} - -bool wxULongLongWx::operator<(const wxULongLongWx& ll) const -{ - if ( m_hi < ll.m_hi ) - return true; - else if ( m_hi == ll.m_hi ) - return m_lo < ll.m_lo; - else - return false; -} - -bool wxLongLongWx::operator>(const wxLongLongWx& ll) const -{ - if ( m_hi > ll.m_hi ) - return true; - else if ( m_hi == ll.m_hi ) - return m_lo > ll.m_lo; - else - return false; -} - -bool wxULongLongWx::operator>(const wxULongLongWx& ll) const -{ - if ( m_hi > ll.m_hi ) - return true; - else if ( m_hi == ll.m_hi ) - return m_lo > ll.m_lo; - else - return false; -} - -// bitwise operators - -wxLongLongWx wxLongLongWx::operator&(const wxLongLongWx& ll) const -{ - return wxLongLongWx(m_hi & ll.m_hi, m_lo & ll.m_lo); -} - -wxULongLongWx wxULongLongWx::operator&(const wxULongLongWx& ll) const -{ - return wxULongLongWx(m_hi & ll.m_hi, m_lo & ll.m_lo); -} - -wxLongLongWx wxLongLongWx::operator|(const wxLongLongWx& ll) const -{ - return wxLongLongWx(m_hi | ll.m_hi, m_lo | ll.m_lo); -} - -wxULongLongWx wxULongLongWx::operator|(const wxULongLongWx& ll) const -{ - return wxULongLongWx(m_hi | ll.m_hi, m_lo | ll.m_lo); -} - -wxLongLongWx wxLongLongWx::operator^(const wxLongLongWx& ll) const -{ - return wxLongLongWx(m_hi ^ ll.m_hi, m_lo ^ ll.m_lo); -} - -wxULongLongWx wxULongLongWx::operator^(const wxULongLongWx& ll) const -{ - return wxULongLongWx(m_hi ^ ll.m_hi, m_lo ^ ll.m_lo); -} - -wxLongLongWx& wxLongLongWx::operator&=(const wxLongLongWx& ll) -{ - m_lo &= ll.m_lo; - m_hi &= ll.m_hi; - -#ifdef wxLONGLONG_TEST_MODE - m_ll &= ll.m_ll; - - Check(); -#endif // wxLONGLONG_TEST_MODE - - return *this; -} - -wxULongLongWx& wxULongLongWx::operator&=(const wxULongLongWx& ll) -{ - m_lo &= ll.m_lo; - m_hi &= ll.m_hi; - -#ifdef wxLONGLONG_TEST_MODE - m_ll &= ll.m_ll; - - Check(); -#endif // wxLONGLONG_TEST_MODE - - return *this; -} - -wxLongLongWx& wxLongLongWx::operator|=(const wxLongLongWx& ll) -{ - m_lo |= ll.m_lo; - m_hi |= ll.m_hi; - -#ifdef wxLONGLONG_TEST_MODE - m_ll |= ll.m_ll; - - Check(); -#endif // wxLONGLONG_TEST_MODE - - return *this; -} - -wxULongLongWx& wxULongLongWx::operator|=(const wxULongLongWx& ll) -{ - m_lo |= ll.m_lo; - m_hi |= ll.m_hi; - -#ifdef wxLONGLONG_TEST_MODE - m_ll |= ll.m_ll; - - Check(); -#endif // wxLONGLONG_TEST_MODE - - return *this; -} - -wxLongLongWx& wxLongLongWx::operator^=(const wxLongLongWx& ll) -{ - m_lo ^= ll.m_lo; - m_hi ^= ll.m_hi; - -#ifdef wxLONGLONG_TEST_MODE - m_ll ^= ll.m_ll; - - Check(); -#endif // wxLONGLONG_TEST_MODE - - return *this; -} - -wxULongLongWx& wxULongLongWx::operator^=(const wxULongLongWx& ll) -{ - m_lo ^= ll.m_lo; - m_hi ^= ll.m_hi; - -#ifdef wxLONGLONG_TEST_MODE - m_ll ^= ll.m_ll; - - Check(); -#endif // wxLONGLONG_TEST_MODE - - return *this; -} - -wxLongLongWx wxLongLongWx::operator~() const -{ - return wxLongLongWx(~m_hi, ~m_lo); -} - -wxULongLongWx wxULongLongWx::operator~() const -{ - return wxULongLongWx(~m_hi, ~m_lo); -} - -// multiplication - -wxLongLongWx wxLongLongWx::operator*(const wxLongLongWx& ll) const -{ - wxLongLongWx res(*this); - res *= ll; - - return res; -} - -wxULongLongWx wxULongLongWx::operator*(const wxULongLongWx& ll) const -{ - wxULongLongWx res(*this); - res *= ll; - - return res; -} - -wxLongLongWx& wxLongLongWx::operator*=(const wxLongLongWx& ll) -{ - wxLongLongWx t(m_hi, m_lo); - wxLongLongWx q(ll.m_hi, ll.m_lo); - - m_hi = m_lo = 0; - -#ifdef wxLONGLONG_TEST_MODE - wxLongLong_t llOld = m_ll; - m_ll = 0; -#endif // wxLONGLONG_TEST_MODE - - int counter = 0; - do - { - if ((q.m_lo & 1) != 0) - *this += t; - q >>= 1; - t <<= 1; - counter++; - } - while ((counter < 64) && ((q.m_hi != 0) || (q.m_lo != 0))); - -#ifdef wxLONGLONG_TEST_MODE - m_ll = llOld * ll.m_ll; - - Check(); -#endif // wxLONGLONG_TEST_MODE - - return *this; -} - -wxULongLongWx& wxULongLongWx::operator*=(const wxULongLongWx& ll) -{ - wxULongLongWx t(m_hi, m_lo); - wxULongLongWx q(ll.m_hi, ll.m_lo); - - m_hi = m_lo = 0; - -#ifdef wxLONGLONG_TEST_MODE - wxULongLong_t llOld = m_ll; - m_ll = 0; -#endif // wxLONGLONG_TEST_MODE - - int counter = 0; - do - { - if ((q.m_lo & 1) != 0) - *this += t; - q >>= 1; - t <<= 1; - counter++; - } - while ((counter < 64) && ((q.m_hi != 0) || (q.m_lo != 0))); - -#ifdef wxLONGLONG_TEST_MODE - m_ll = llOld * ll.m_ll; - - Check(); -#endif // wxLONGLONG_TEST_MODE - - return *this; -} - -// division - -#define IS_MSB_SET(ll) ((ll.GetHi()) & (1 << (8*sizeof(long) - 1))) - -void wxLongLongWx::Divide(const wxLongLongWx& divisorIn, - wxLongLongWx& quotient, - wxLongLongWx& remainderIO) const -{ - if ((divisorIn.m_lo == 0) && (divisorIn.m_hi == 0)) - { - // provoke division by zero error and silence the compilers warnings - // about an expression without effect and unused variable - long dummy = divisorIn.m_lo/divisorIn.m_hi; - dummy += 0; - } - - // VZ: I'm writing this in a hurry and it's surely not the fastest way to - // do this - any improvements are more than welcome - // - // code inspired by the snippet at - // http://www.bearcave.com/software/divide.htm - // - // Copyright notice: - // - // Use of this program, for any purpose, is granted the author, Ian - // Kaplan, as long as this copyright notice is included in the source - // code or any source code derived from this program. The user assumes - // all responsibility for using this code. - - // init everything - wxULongLongWx dividend, divisor, remainder; - - quotient = 0l; - remainder = 0l; - - // always do unsigned division and adjust the signs later: in C integer - // division, the sign of the remainder is the same as the sign of the - // dividend, while the sign of the quotient is the product of the signs of - // the dividend and divisor. Of course, we also always have - // - // dividend = quotient*divisor + remainder - // - // with 0 <= abs(remainder) < abs(divisor) - bool negRemainder = GetHi() < 0; - bool negQuotient = false; // assume positive - if ( GetHi() < 0 ) - { - negQuotient = !negQuotient; - dividend = -*this; - } else { - dividend = *this; - } - if ( divisorIn.GetHi() < 0 ) - { - negQuotient = !negQuotient; - divisor = -divisorIn; - } else { - divisor = divisorIn; - } - - // check for some particular cases - if ( divisor > dividend ) - { - remainder = dividend; - } - else if ( divisor == dividend ) - { - quotient = 1l; - } - else - { - // here: dividend > divisor and both are positive: do unsigned division - size_t nBits = 64u; - wxLongLongWx d; - - while ( remainder < divisor ) - { - remainder <<= 1; - if ( IS_MSB_SET(dividend) ) - { - remainder |= 1; - } - - d = dividend; - dividend <<= 1; - - nBits--; - } - - // undo the last loop iteration - dividend = d; - remainder >>= 1; - nBits++; - - for ( size_t i = 0; i < nBits; i++ ) - { - remainder <<= 1; - if ( IS_MSB_SET(dividend) ) - { - remainder |= 1; - } - - wxLongLongWx t = remainder - divisor; - dividend <<= 1; - quotient <<= 1; - if ( !IS_MSB_SET(t) ) - { - quotient |= 1; - - remainder = t; - } - } - } - - remainderIO = remainder; - - // adjust signs - if ( negRemainder ) - { - remainderIO = -remainderIO; - } - - if ( negQuotient ) - { - quotient = -quotient; - } -} - -void wxULongLongWx::Divide(const wxULongLongWx& divisorIn, - wxULongLongWx& quotient, - wxULongLongWx& remainder) const -{ - if ((divisorIn.m_lo == 0) && (divisorIn.m_hi == 0)) - { - // provoke division by zero error and silence the compilers warnings - // about an expression without effect and unused variable - unsigned long dummy = divisorIn.m_lo/divisorIn.m_hi; - dummy += 0; - } - - // VZ: I'm writing this in a hurry and it's surely not the fastest way to - // do this - any improvements are more than welcome - // - // code inspired by the snippet at - // http://www.bearcave.com/software/divide.htm - // - // Copyright notice: - // - // Use of this program, for any purpose, is granted the author, Ian - // Kaplan, as long as this copyright notice is included in the source - // code or any source code derived from this program. The user assumes - // all responsibility for using this code. - - // init everything - wxULongLongWx dividend = *this, - divisor = divisorIn; - - quotient = 0l; - remainder = 0l; - - // check for some particular cases - if ( divisor > dividend ) - { - remainder = dividend; - } - else if ( divisor == dividend ) - { - quotient = 1l; - } - else - { - // here: dividend > divisor - size_t nBits = 64u; - wxULongLongWx d; - - while ( remainder < divisor ) - { - remainder <<= 1; - if ( IS_MSB_SET(dividend) ) - { - remainder |= 1; - } - - d = dividend; - dividend <<= 1; - - nBits--; - } - - // undo the last loop iteration - dividend = d; - remainder >>= 1; - nBits++; - - for ( size_t i = 0; i < nBits; i++ ) - { - remainder <<= 1; - if ( IS_MSB_SET(dividend) ) - { - remainder |= 1; - } - - wxULongLongWx t = remainder - divisor; - dividend <<= 1; - quotient <<= 1; - if ( !IS_MSB_SET(t) ) - { - quotient |= 1; - - remainder = t; - } - } - } -} - -wxLongLongWx wxLongLongWx::operator/(const wxLongLongWx& ll) const -{ - wxLongLongWx quotient, remainder; - - Divide(ll, quotient, remainder); - - return quotient; -} - -wxULongLongWx wxULongLongWx::operator/(const wxULongLongWx& ll) const -{ - wxULongLongWx quotient, remainder; - - Divide(ll, quotient, remainder); - - return quotient; -} - -wxLongLongWx& wxLongLongWx::operator/=(const wxLongLongWx& ll) -{ - wxLongLongWx quotient, remainder; - - Divide(ll, quotient, remainder); - - *this = quotient; - - return *this; -} - -wxULongLongWx& wxULongLongWx::operator/=(const wxULongLongWx& ll) -{ - wxULongLongWx quotient, remainder; - - Divide(ll, quotient, remainder); - - *this = quotient; - - return *this; -} - -wxLongLongWx wxLongLongWx::operator%(const wxLongLongWx& ll) const -{ - wxLongLongWx quotient, remainder; - - Divide(ll, quotient, remainder); - - return remainder; -} - -wxULongLongWx wxULongLongWx::operator%(const wxULongLongWx& ll) const -{ - wxULongLongWx quotient, remainder; - - Divide(ll, quotient, remainder); - - return remainder; -} - -// ---------------------------------------------------------------------------- -// misc -// ---------------------------------------------------------------------------- - -// temporary - just for testing -void *wxLongLongWx::asArray(void) const -{ - static unsigned char temp[8]; - - temp[0] = (char)((m_hi >> 24) & 0xFF); - temp[1] = (char)((m_hi >> 16) & 0xFF); - temp[2] = (char)((m_hi >> 8) & 0xFF); - temp[3] = (char)((m_hi >> 0) & 0xFF); - temp[4] = (char)((m_lo >> 24) & 0xFF); - temp[5] = (char)((m_lo >> 16) & 0xFF); - temp[6] = (char)((m_lo >> 8) & 0xFF); - temp[7] = (char)((m_lo >> 0) & 0xFF); - - return temp; -} - -void *wxULongLongWx::asArray(void) const -{ - static unsigned char temp[8]; - - temp[0] = (char)((m_hi >> 24) & 0xFF); - temp[1] = (char)((m_hi >> 16) & 0xFF); - temp[2] = (char)((m_hi >> 8) & 0xFF); - temp[3] = (char)((m_hi >> 0) & 0xFF); - temp[4] = (char)((m_lo >> 24) & 0xFF); - temp[5] = (char)((m_lo >> 16) & 0xFF); - temp[6] = (char)((m_lo >> 8) & 0xFF); - temp[7] = (char)((m_lo >> 0) & 0xFF); - - return temp; -} - -#endif // wxUSE_LONGLONG_WX - -#define LL_TO_STRING(name) \ - wxString name::ToString() const \ - { \ - /* TODO: this is awfully inefficient, anything better? */ \ - wxString result; \ - \ - name ll = *this; \ - \ - bool neg = ll < 0; \ - if ( neg ) \ - { \ - while ( ll != 0 ) \ - { \ - long digit = (ll % 10).ToLong(); \ - result.Prepend((wxChar)(_T('0') - digit)); \ - ll /= 10; \ - } \ - } \ - else \ - { \ - while ( ll != 0 ) \ - { \ - long digit = (ll % 10).ToLong(); \ - result.Prepend((wxChar)(_T('0') + digit)); \ - ll /= 10; \ - } \ - } \ - \ - if ( result.empty() ) \ - result = _T('0'); \ - else if ( neg ) \ - result.Prepend(_T('-')); \ - \ - return result; \ - } - -#define ULL_TO_STRING(name) \ - wxString name::ToString() const \ - { \ - /* TODO: this is awfully inefficient, anything better? */ \ - wxString result; \ - \ - name ll = *this; \ - \ - while ( ll != 0 ) \ - { \ - result.Prepend((wxChar)(_T('0') + (ll % 10).ToULong())); \ - ll /= 10; \ - } \ - \ - if ( result.empty() ) \ - result = _T('0'); \ - \ - return result; \ - } - -#if wxUSE_LONGLONG_NATIVE - LL_TO_STRING(wxLongLongNative) - ULL_TO_STRING(wxULongLongNative) -#endif - -#if wxUSE_LONGLONG_WX - LL_TO_STRING(wxLongLongWx) - ULL_TO_STRING(wxULongLongWx) -#endif - -#if wxUSE_STD_IOSTREAM - -// input/output -WXDLLIMPEXP_BASE -wxSTD ostream& operator<< (wxSTD ostream& o, const wxLongLong& ll) -{ - return o << ll.ToString(); -} - -WXDLLIMPEXP_BASE -wxSTD ostream& operator<< (wxSTD ostream& o, const wxULongLong& ll) -{ - return o << ll.ToString(); -} - -#endif // wxUSE_STD_IOSTREAM - -WXDLLIMPEXP_BASE wxString& operator<< (wxString& s, const wxLongLong& ll) -{ - return s << ll.ToString(); -} - -WXDLLIMPEXP_BASE wxString& operator<< (wxString& s, const wxULongLong& ll) -{ - return s << ll.ToString(); -} - -#if wxUSE_STREAMS - -WXDLLIMPEXP_BASE wxTextOutputStream& operator<< (wxTextOutputStream& o, const wxULongLong& ll) -{ - return o << ll.ToString(); -} - -WXDLLIMPEXP_BASE wxTextOutputStream& operator<< (wxTextOutputStream& o, const wxLongLong& ll) -{ - return o << ll.ToString(); -} - -#define READ_STRING_CHAR(s, idx, len) ((wxChar) ((idx!=len) ? s[idx++] : 0)) - -WXDLLIMPEXP_BASE class wxTextInputStream &operator>>(class wxTextInputStream &o, wxULongLong &ll) -{ - wxString s = o.ReadWord(); - - ll = wxULongLong(0l, 0l); - size_t length = s.length(); - size_t idx = 0; - - wxChar ch = READ_STRING_CHAR(s, idx, length); - - // Skip WS - while (ch==wxT(' ') || ch==wxT('\t')) - ch = READ_STRING_CHAR(s, idx, length); - - // Read number - wxULongLong multiplier(0l, 10l); - while (ch>=wxT('0') && ch<=wxT('9')) { - long lValue = (unsigned) (ch - wxT('0')); - ll = ll * multiplier + wxULongLong(0l, lValue); - ch = READ_STRING_CHAR(s, idx, length); - } - - return o; -} - -WXDLLIMPEXP_BASE class wxTextInputStream &operator>>(class wxTextInputStream &o, wxLongLong &ll) -{ - wxString s = o.ReadWord(); - - ll = wxLongLong(0l, 0l); - size_t length = s.length(); - size_t idx = 0; - - wxChar ch = READ_STRING_CHAR(s, idx, length); - - // Skip WS - while (ch==wxT(' ') || ch==wxT('\t')) - ch = READ_STRING_CHAR(s, idx, length); - - // Ask for sign - int iSign = 1; - if (ch==wxT('-') || ch==wxT('+')) { - iSign = ((ch==wxT('-')) ? -1 : 1); - ch = READ_STRING_CHAR(s, idx, length); - } - - // Read number - wxLongLong multiplier(0l, 10l); - while (ch>=wxT('0') && ch<=wxT('9')) { - long lValue = (unsigned) (ch - wxT('0')); - ll = ll * multiplier + wxLongLong(0l, lValue); - ch = READ_STRING_CHAR(s, idx, length); - } - -#if wxUSE_LONGLONG_NATIVE - ll = ll * wxLongLong((wxLongLong_t) iSign); -#else - ll = ll * wxLongLong((long) iSign); -#endif - - return o; -} - -#if wxUSE_LONGLONG_NATIVE - -WXDLLIMPEXP_BASE class wxTextOutputStream &operator<<(class wxTextOutputStream &o, wxULongLong_t value) -{ - return o << wxULongLong(value).ToString(); -} - -WXDLLIMPEXP_BASE class wxTextOutputStream &operator<<(class wxTextOutputStream &o, wxLongLong_t value) -{ - return o << wxLongLong(value).ToString(); -} - -WXDLLIMPEXP_BASE class wxTextInputStream &operator>>(class wxTextInputStream &o, wxULongLong_t &value) -{ - wxULongLong ll; - o >> ll; - value = ll.GetValue(); - return o; -} - -WXDLLIMPEXP_BASE class wxTextInputStream &operator>>(class wxTextInputStream &o, wxLongLong_t &value) -{ - wxLongLong ll; - o >> ll; - value = ll.GetValue(); - return o; -} - -#endif // wxUSE_LONGLONG_NATIVE - -#endif // wxUSE_STREAMS - -#endif // wxUSE_LONGLONG diff --git a/wxWidgets/src/common/matrix.cpp b/wxWidgets/src/common/matrix.cpp deleted file mode 100644 index 4903aca392..0000000000 --- a/wxWidgets/src/common/matrix.cpp +++ /dev/null @@ -1,601 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: src/common/matrix.cpp -// Purpose: wxTransformMatrix class -// Author: Chris Breeze, Julian Smart -// Modified by: Klaas Holwerda -// Created: 01/02/97 -// RCS-ID: $Id: matrix.cpp 39745 2006-06-15 17:58:49Z ABX $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -// Note: this is intended to be used in wxDC at some point to replace -// the current system of scaling/translation. It is not yet used. - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#include "wx/matrix.h" - -#ifndef WX_PRECOMP - #include "wx/math.h" -#endif - -static const double pi = M_PI; - -wxTransformMatrix::wxTransformMatrix(void) -{ - m_isIdentity = false; - - Identity(); -} - -wxTransformMatrix::wxTransformMatrix(const wxTransformMatrix& mat) - : wxObject() -{ - (*this) = mat; -} - -double wxTransformMatrix::GetValue(int col, int row) const -{ - if (row < 0 || row > 2 || col < 0 || col > 2) - return 0.0; - - return m_matrix[col][row]; -} - -void wxTransformMatrix::SetValue(int col, int row, double value) -{ - if (row < 0 || row > 2 || col < 0 || col > 2) - return; - - m_matrix[col][row] = value; - m_isIdentity = IsIdentity1(); -} - -void wxTransformMatrix::operator = (const wxTransformMatrix& mat) -{ - int i, j; - for (i = 0; i < 3; i++) - { - for (j = 0; j < 3; j++) - { - m_matrix[i][j] = mat.m_matrix[i][j]; - } - } - m_isIdentity = mat.m_isIdentity; -} - -bool wxTransformMatrix::operator == (const wxTransformMatrix& mat) const -{ - if (m_isIdentity && mat.m_isIdentity) - return true; - - int i, j; - for (i = 0; i < 3; i++) - { - for (j = 0; j < 3; j++) - { - if ( !wxIsSameDouble(m_matrix[i][j], mat.m_matrix[i][j]) ) - return false; - } - } - return true; -} - -bool wxTransformMatrix::operator != (const wxTransformMatrix& mat) const -{ - return (! ((*this) == mat)); -} - -double& wxTransformMatrix::operator()(int col, int row) -{ - if (row < 0 || row > 2 || col < 0 || col > 2) - return m_matrix[0][0]; - - return m_matrix[col][row]; -} - -double wxTransformMatrix::operator()(int col, int row) const -{ - if (row < 0 || row > 2 || col < 0 || col > 2) - return 0.0; - - return m_matrix[col][row]; -} - -// Invert matrix -bool wxTransformMatrix::Invert(void) -{ - double inverseMatrix[3][3]; - - // calculate the adjoint - inverseMatrix[0][0] = wxCalculateDet(m_matrix[1][1],m_matrix[2][1],m_matrix[1][2],m_matrix[2][2]); - inverseMatrix[0][1] = -wxCalculateDet(m_matrix[0][1],m_matrix[2][1],m_matrix[0][2],m_matrix[2][2]); - inverseMatrix[0][2] = wxCalculateDet(m_matrix[0][1],m_matrix[1][1],m_matrix[0][2],m_matrix[1][2]); - - inverseMatrix[1][0] = -wxCalculateDet(m_matrix[1][0],m_matrix[2][0],m_matrix[1][2],m_matrix[2][2]); - inverseMatrix[1][1] = wxCalculateDet(m_matrix[0][0],m_matrix[2][0],m_matrix[0][2],m_matrix[2][2]); - inverseMatrix[1][2] = -wxCalculateDet(m_matrix[0][0],m_matrix[1][0],m_matrix[0][2],m_matrix[1][2]); - - inverseMatrix[2][0] = wxCalculateDet(m_matrix[1][0],m_matrix[2][0],m_matrix[1][1],m_matrix[2][1]); - inverseMatrix[2][1] = -wxCalculateDet(m_matrix[0][0],m_matrix[2][0],m_matrix[0][1],m_matrix[2][1]); - inverseMatrix[2][2] = wxCalculateDet(m_matrix[0][0],m_matrix[1][0],m_matrix[0][1],m_matrix[1][1]); - - // now divide by the determinant - double det = m_matrix[0][0] * inverseMatrix[0][0] + m_matrix[0][1] * inverseMatrix[1][0] + m_matrix[0][2] * inverseMatrix[2][0]; - if ( wxIsNullDouble(det) ) - return false; - - inverseMatrix[0][0] /= det; inverseMatrix[1][0] /= det; inverseMatrix[2][0] /= det; - inverseMatrix[0][1] /= det; inverseMatrix[1][1] /= det; inverseMatrix[2][1] /= det; - inverseMatrix[0][2] /= det; inverseMatrix[1][2] /= det; inverseMatrix[2][2] /= det; - - for (int i = 0; i < 3; i++) - { - for (int j = 0; j < 3; j++) - { - m_matrix[i][j] = inverseMatrix[i][j]; - } - } - m_isIdentity = IsIdentity1(); - return true; -} - -// Make into identity matrix -bool wxTransformMatrix::Identity(void) -{ - m_matrix[0][0] = m_matrix[1][1] = m_matrix[2][2] = 1.0; - m_matrix[1][0] = m_matrix[2][0] = m_matrix[0][1] = m_matrix[2][1] = m_matrix[0][2] = m_matrix[1][2] = 0.0; - m_isIdentity = true; - - return true; -} - -// Scale by scale (isotropic scaling i.e. the same in x and y): -// | scale 0 0 | -// matrix' = | 0 scale 0 | x matrix -// | 0 0 scale | -// -bool wxTransformMatrix::Scale(double scale) -{ - int i, j; - for (i = 0; i < 3; i++) - { - for (j = 0; j < 3; j++) - { - m_matrix[i][j] *= scale; - } - } - m_isIdentity = IsIdentity1(); - - return true; -} - - -// scale a matrix in 2D -// -// xs 0 xc(1-xs) -// 0 ys yc(1-ys) -// 0 0 1 -// -wxTransformMatrix& wxTransformMatrix::Scale(const double &xs, const double &ys,const double &xc, const double &yc) -{ - double r00,r10,r20,r01,r11,r21; - - if (m_isIdentity) - { - double tx = xc*(1-xs); - double ty = yc*(1-ys); - r00 = xs; - r10 = 0; - r20 = tx; - r01 = 0; - r11 = ys; - r21 = ty; - } - else if ( !wxIsNullDouble(xc) || !wxIsNullDouble(yc) ) - { - double tx = xc*(1-xs); - double ty = yc*(1-ys); - r00 = xs * m_matrix[0][0]; - r10 = xs * m_matrix[1][0]; - r20 = xs * m_matrix[2][0] + tx; - r01 = ys * m_matrix[0][1]; - r11 = ys * m_matrix[1][1]; - r21 = ys * m_matrix[2][1] + ty; - } - else - { - r00 = xs * m_matrix[0][0]; - r10 = xs * m_matrix[1][0]; - r20 = xs * m_matrix[2][0]; - r01 = ys * m_matrix[0][1]; - r11 = ys * m_matrix[1][1]; - r21 = ys * m_matrix[2][1]; - } - - m_matrix[0][0] = r00; - m_matrix[1][0] = r10; - m_matrix[2][0] = r20; - m_matrix[0][1] = r01; - m_matrix[1][1] = r11; - m_matrix[2][1] = r21; - -/* or like this - // first translate to origin O - (*this).Translate(-x_cen, -y_cen); - - // now do the scaling - wxTransformMatrix scale; - scale.m_matrix[0][0] = x_fac; - scale.m_matrix[1][1] = y_fac; - scale.m_isIdentity = IsIdentity1(); - - *this = scale * (*this); - - // translate back from origin to x_cen, y_cen - (*this).Translate(x_cen, y_cen); -*/ - - m_isIdentity = IsIdentity1(); - - return *this; -} - - -// mirror a matrix in x, y -// -// -1 0 0 Y-mirror -// 0 -1 0 X-mirror -// 0 0 -1 Z-mirror -wxTransformMatrix& wxTransformMatrix::Mirror(bool x, bool y) -{ - wxTransformMatrix temp; - if (x) - { - temp.m_matrix[1][1] = -1; - temp.m_isIdentity=false; - } - if (y) - { - temp.m_matrix[0][0] = -1; - temp.m_isIdentity=false; - } - - *this = temp * (*this); - m_isIdentity = IsIdentity1(); - return *this; -} - -// Translate by dx, dy: -// | 1 0 dx | -// matrix' = | 0 1 dy | x matrix -// | 0 0 1 | -// -bool wxTransformMatrix::Translate(double dx, double dy) -{ - int i; - for (i = 0; i < 3; i++) - m_matrix[i][0] += dx * m_matrix[i][2]; - for (i = 0; i < 3; i++) - m_matrix[i][1] += dy * m_matrix[i][2]; - - m_isIdentity = IsIdentity1(); - - return true; -} - -// Rotate clockwise by the given number of degrees: -// | cos sin 0 | -// matrix' = | -sin cos 0 | x matrix -// | 0 0 1 | -bool wxTransformMatrix::Rotate(double degrees) -{ - Rotate(-degrees,0,0); - return true; -} - -// counter clockwise rotate around a point -// -// cos(r) -sin(r) x(1-cos(r))+y(sin(r) -// sin(r) cos(r) y(1-cos(r))-x(sin(r) -// 0 0 1 -wxTransformMatrix& wxTransformMatrix::Rotate(const double °rees, const double &x, const double &y) -{ - double angle = degrees * pi / 180.0; - double c = cos(angle); - double s = sin(angle); - double r00,r10,r20,r01,r11,r21; - - if (m_isIdentity) - { - double tx = x*(1-c)+y*s; - double ty = y*(1-c)-x*s; - r00 = c ; - r10 = -s; - r20 = tx; - r01 = s; - r11 = c; - r21 = ty; - } - else if ( !wxIsNullDouble(x) || !wxIsNullDouble(y) ) - { - double tx = x*(1-c)+y*s; - double ty = y*(1-c)-x*s; - r00 = c * m_matrix[0][0] - s * m_matrix[0][1] + tx * m_matrix[0][2]; - r10 = c * m_matrix[1][0] - s * m_matrix[1][1] + tx * m_matrix[1][2]; - r20 = c * m_matrix[2][0] - s * m_matrix[2][1] + tx;// * m_matrix[2][2]; - r01 = c * m_matrix[0][1] + s * m_matrix[0][0] + ty * m_matrix[0][2]; - r11 = c * m_matrix[1][1] + s * m_matrix[1][0] + ty * m_matrix[1][2]; - r21 = c * m_matrix[2][1] + s * m_matrix[2][0] + ty;// * m_matrix[2][2]; - } - else - { - r00 = c * m_matrix[0][0] - s * m_matrix[0][1]; - r10 = c * m_matrix[1][0] - s * m_matrix[1][1]; - r20 = c * m_matrix[2][0] - s * m_matrix[2][1]; - r01 = c * m_matrix[0][1] + s * m_matrix[0][0]; - r11 = c * m_matrix[1][1] + s * m_matrix[1][0]; - r21 = c * m_matrix[2][1] + s * m_matrix[2][0]; - } - - m_matrix[0][0] = r00; - m_matrix[1][0] = r10; - m_matrix[2][0] = r20; - m_matrix[0][1] = r01; - m_matrix[1][1] = r11; - m_matrix[2][1] = r21; - -/* or like this - wxTransformMatrix rotate; - rotate.m_matrix[2][0] = tx; - rotate.m_matrix[2][1] = ty; - - rotate.m_matrix[0][0] = c; - rotate.m_matrix[0][1] = s; - - rotate.m_matrix[1][0] = -s; - rotate.m_matrix[1][1] = c; - - rotate.m_isIdentity=false; - *this = rotate * (*this); -*/ - m_isIdentity = IsIdentity1(); - - return *this; -} - -// Transform a point from logical to device coordinates -bool wxTransformMatrix::TransformPoint(double x, double y, double& tx, double& ty) const -{ - if (IsIdentity()) - { - tx = x; ty = y; return true; - } - - tx = x * m_matrix[0][0] + y * m_matrix[1][0] + m_matrix[2][0]; - ty = x * m_matrix[0][1] + y * m_matrix[1][1] + m_matrix[2][1]; - - return true; -} - -// Transform a point from device to logical coordinates. - -// Example of use: -// wxTransformMatrix mat = dc.GetTransformation(); -// mat.Invert(); -// mat.InverseTransformPoint(x, y, x1, y1); -// OR (shorthand:) -// dc.LogicalToDevice(x, y, x1, y1); -// The latter is slightly less efficient if we're doing several -// conversions, since the matrix is inverted several times. -bool wxTransformMatrix::InverseTransformPoint(double x, double y, double& tx, double& ty) const -{ - if (IsIdentity()) - { - tx = x; - ty = y; - return true; - } - - const double z = (1.0 - m_matrix[0][2] * x - m_matrix[1][2] * y) / m_matrix[2][2]; - if ( wxIsNullDouble(z) ) - return false; - - tx = x * m_matrix[0][0] + y * m_matrix[1][0] + z * m_matrix[2][0]; - ty = x * m_matrix[0][1] + y * m_matrix[1][1] + z * m_matrix[2][1]; - return true; -} - -wxTransformMatrix& wxTransformMatrix::operator*=(const double& t) -{ - for (int i = 0; i < 3; i++) - for (int j = 0; j < 3; j++) - m_matrix[i][j]*= t; - m_isIdentity = IsIdentity1(); - return *this; -} - -wxTransformMatrix& wxTransformMatrix::operator/=(const double& t) -{ - for (int i = 0; i < 3; i++) - for (int j = 0; j < 3; j++) - m_matrix[i][j]/= t; - m_isIdentity = IsIdentity1(); - return *this; -} - -wxTransformMatrix& wxTransformMatrix::operator+=(const wxTransformMatrix& mat) -{ - for (int i = 0; i < 3; i++) - for (int j = 0; j < 3; j++) - m_matrix[i][j] += mat.m_matrix[i][j]; - m_isIdentity = IsIdentity1(); - return *this; -} - -wxTransformMatrix& wxTransformMatrix::operator-=(const wxTransformMatrix& mat) -{ - for (int i = 0; i < 3; i++) - for (int j = 0; j < 3; j++) - m_matrix[i][j] -= mat.m_matrix[i][j]; - m_isIdentity = IsIdentity1(); - return *this; -} - -wxTransformMatrix& wxTransformMatrix::operator*=(const wxTransformMatrix& mat) -{ - - if (mat.m_isIdentity) - return *this; - if (m_isIdentity) - { - *this = mat; - return *this; - } - else - { - wxTransformMatrix result; - for (int i = 0; i < 3; i++) - { - for (int j = 0; j < 3; j++) - { - double sum = 0; - for (int k = 0; k < 3; k++) - sum += m_matrix[k][i] * mat.m_matrix[j][k]; - result.m_matrix[j][i] = sum; - } - } - *this = result; - } - - m_isIdentity = IsIdentity1(); - return *this; -} - - -// constant operators -wxTransformMatrix wxTransformMatrix::operator*(const double& t) const -{ - wxTransformMatrix result = *this; - result *= t; - result.m_isIdentity = result.IsIdentity1(); - return result; -} - -wxTransformMatrix wxTransformMatrix::operator/(const double& t) const -{ - wxTransformMatrix result = *this; -// wxASSERT(t!=0); - result /= t; - result.m_isIdentity = result.IsIdentity1(); - return result; -} - -wxTransformMatrix wxTransformMatrix::operator+(const wxTransformMatrix& m) const -{ - wxTransformMatrix result = *this; - result += m; - result.m_isIdentity = result.IsIdentity1(); - return result; -} - -wxTransformMatrix wxTransformMatrix::operator-(const wxTransformMatrix& m) const -{ - wxTransformMatrix result = *this; - result -= m; - result.m_isIdentity = result.IsIdentity1(); - return result; -} - - -wxTransformMatrix wxTransformMatrix::operator*(const wxTransformMatrix& m) const -{ - wxTransformMatrix result = *this; - result *= m; - result.m_isIdentity = result.IsIdentity1(); - return result; -} - - -wxTransformMatrix wxTransformMatrix::operator-() const -{ - wxTransformMatrix result = *this; - for (int i = 0; i < 3; i++) - for (int j = 0; j < 3; j++) - result.m_matrix[i][j] = -(this->m_matrix[i][j]); - result.m_isIdentity = result.IsIdentity1(); - return result; -} - -static double CheckInt(double getal) -{ - // check if the number is very close to an integer - if ( (ceil(getal) - getal) < 0.0001) - return ceil(getal); - - else if ( (getal - floor(getal)) < 0.0001) - return floor(getal); - - return getal; - -} - -double wxTransformMatrix::Get_scaleX() -{ - double scale_factor; - double rot_angle = CheckInt(atan2(m_matrix[1][0],m_matrix[0][0])*180/pi); - if ( !wxIsSameDouble(rot_angle, 90) && !wxIsSameDouble(rot_angle, -90) ) - scale_factor = m_matrix[0][0]/cos((rot_angle/180)*pi); - else - scale_factor = m_matrix[0][0]/sin((rot_angle/180)*pi); // er kan nl. niet door 0 gedeeld worden ! - - scale_factor = CheckInt(scale_factor); - if (scale_factor < 0) - scale_factor = -scale_factor; - - return scale_factor; -} - -double wxTransformMatrix::Get_scaleY() -{ - double scale_factor; - double rot_angle = CheckInt(atan2(m_matrix[1][0],m_matrix[0][0])*180/pi); - if ( !wxIsSameDouble(rot_angle, 90) && !wxIsSameDouble(rot_angle, -90) ) - scale_factor = m_matrix[1][1]/cos((rot_angle/180)*pi); - else - scale_factor = m_matrix[1][1]/sin((rot_angle/180)*pi); // er kan nl. niet door 0 gedeeld worden ! - - scale_factor = CheckInt(scale_factor); - if (scale_factor < 0) - - scale_factor = -scale_factor; - - return scale_factor; - -} - -double wxTransformMatrix::GetRotation() -{ - double temp1 = GetValue(0,0); // for angle calculation - double temp2 = GetValue(0,1); // - - // Rotation - double rot_angle = atan2(temp2,temp1)*180/pi; - - rot_angle = CheckInt(rot_angle); - return rot_angle; -} - -void wxTransformMatrix::SetRotation(double rotation) -{ - double x=GetValue(2,0); - double y=GetValue(2,1); - Rotate(-GetRotation(), x, y); - Rotate(rotation, x, y); -} diff --git a/wxWidgets/src/common/mediactrlcmn.cpp b/wxWidgets/src/common/mediactrlcmn.cpp deleted file mode 100644 index 4c25559d6b..0000000000 --- a/wxWidgets/src/common/mediactrlcmn.cpp +++ /dev/null @@ -1,559 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/common/mediactrl.cpp -// Purpose: wxMediaCtrl common code -// Author: Ryan Norton -// Modified by: -// Created: 11/07/04 -// RCS-ID: $Id: mediactrlcmn.cpp 42816 2006-10-31 08:50:17Z RD $ -// Copyright: (c) Ryan Norton -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// TODO: Platform specific backend defaults? - -//=========================================================================== -// Definitions -//=========================================================================== - -//--------------------------------------------------------------------------- -// Pre-compiled header stuff -//--------------------------------------------------------------------------- - -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_MEDIACTRL - -#ifndef WX_PRECOMP - #include "wx/hash.h" -#endif - -//--------------------------------------------------------------------------- -// Includes -//--------------------------------------------------------------------------- -#include "wx/mediactrl.h" - -//=========================================================================== -// -// Implementation -// -//=========================================================================== - -//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -// RTTI and Event implementations -//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - -IMPLEMENT_CLASS(wxMediaCtrl, wxControl) -DEFINE_EVENT_TYPE(wxEVT_MEDIA_STATECHANGED) -DEFINE_EVENT_TYPE(wxEVT_MEDIA_PLAY) -DEFINE_EVENT_TYPE(wxEVT_MEDIA_PAUSE) -IMPLEMENT_CLASS(wxMediaBackend, wxObject) -IMPLEMENT_DYNAMIC_CLASS(wxMediaEvent, wxEvent) -DEFINE_EVENT_TYPE(wxEVT_MEDIA_FINISHED) -DEFINE_EVENT_TYPE(wxEVT_MEDIA_LOADED) -DEFINE_EVENT_TYPE(wxEVT_MEDIA_STOP) - -//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -// -// wxMediaCtrl -// -//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - -//--------------------------------------------------------------------------- -// wxMediaBackend Destructor -// -// This is here because the DARWIN gcc compiler badly screwed up and -// needs the destructor implementation in the source -//--------------------------------------------------------------------------- -wxMediaBackend::~wxMediaBackend() -{ -} - -//--------------------------------------------------------------------------- -// wxMediaCtrl::Create (file version) -// wxMediaCtrl::Create (URL version) -// -// Searches for a backend that is installed on the system (backends -// starting with lower characters in the alphabet are given priority), -// and creates the control from it -// -// This searches by searching the global RTTI hashtable, class by class, -// attempting to call CreateControl on each one found that is a derivative -// of wxMediaBackend - if it succeeded Create returns true, otherwise -// it keeps iterating through the hashmap. -//--------------------------------------------------------------------------- -bool wxMediaCtrl::Create(wxWindow* parent, wxWindowID id, - const wxString& fileName, - const wxPoint& pos, - const wxSize& size, - long style, - const wxString& szBackend, - const wxValidator& validator, - const wxString& name) -{ - if(!szBackend.empty()) - { - wxClassInfo* pClassInfo = wxClassInfo::FindClass(szBackend); - - if(!pClassInfo || !DoCreate(pClassInfo, parent, id, - pos, size, style, validator, name)) - { - m_imp = NULL; - return false; - } - - if (!fileName.empty()) - { - if (!Load(fileName)) - { - delete m_imp; - m_imp = NULL; - return false; - } - } - - SetInitialSize(size); - return true; - } - else - { - wxClassInfo::sm_classTable->BeginFind(); - - wxClassInfo* classInfo; - - while((classInfo = NextBackend()) != NULL) - { - if(!DoCreate(classInfo, parent, id, - pos, size, style, validator, name)) - continue; - - if (!fileName.empty()) - { - if (Load(fileName)) - { - SetInitialSize(size); - return true; - } - else - delete m_imp; - } - else - { - SetInitialSize(size); - return true; - } - } - - m_imp = NULL; - return false; - } -} - -bool wxMediaCtrl::Create(wxWindow* parent, wxWindowID id, - const wxURI& location, - const wxPoint& pos, - const wxSize& size, - long style, - const wxString& szBackend, - const wxValidator& validator, - const wxString& name) -{ - if(!szBackend.empty()) - { - wxClassInfo* pClassInfo = wxClassInfo::FindClass(szBackend); - if(!pClassInfo || !DoCreate(pClassInfo, parent, id, - pos, size, style, validator, name)) - { - m_imp = NULL; - return false; - } - - if (!Load(location)) - { - delete m_imp; - m_imp = NULL; - return false; - } - - SetInitialSize(size); - return true; - } - else - { - wxClassInfo::sm_classTable->BeginFind(); - - wxClassInfo* classInfo; - - while((classInfo = NextBackend()) != NULL) - { - if(!DoCreate(classInfo, parent, id, - pos, size, style, validator, name)) - continue; - - if (Load(location)) - { - SetInitialSize(size); - return true; - } - else - delete m_imp; - } - - m_imp = NULL; - return false; - } -} - -//--------------------------------------------------------------------------- -// wxMediaCtrl::DoCreate -// -// Attempts to create the control from a backend -//--------------------------------------------------------------------------- -bool wxMediaCtrl::DoCreate(wxClassInfo* classInfo, - wxWindow* parent, wxWindowID id, - const wxPoint& pos, - const wxSize& size, - long style, - const wxValidator& validator, - const wxString& name) -{ - m_imp = (wxMediaBackend*)classInfo->CreateObject(); - - if( m_imp->CreateControl(this, parent, id, pos, size, - style, validator, name) ) - { - return true; - } - - delete m_imp; - return false; -} - -//--------------------------------------------------------------------------- -// wxMediaCtrl::NextBackend (static) -// -// -// Search through the RTTI hashmap one at a -// time, attempting to create each derivative -// of wxMediaBackend -// -// -// STL isn't compatible with and will have a compilation error -// on a wxNode, however, wxHashTable::compatibility_iterator is -// incompatible with the old 2.4 stable version - but since -// we're in 2.5+ only we don't need to worry about the new version -//--------------------------------------------------------------------------- -wxClassInfo* wxMediaCtrl::NextBackend() -{ - wxHashTable::compatibility_iterator - node = wxClassInfo::sm_classTable->Next(); - while (node) - { - wxClassInfo* classInfo = (wxClassInfo *)node->GetData(); - if ( classInfo->IsKindOf(CLASSINFO(wxMediaBackend)) && - classInfo != CLASSINFO(wxMediaBackend) ) - { - return classInfo; - } - node = wxClassInfo::sm_classTable->Next(); - } - - // - // Nope - couldn't successfully find one... fail - // - return NULL; -} - - -//--------------------------------------------------------------------------- -// wxMediaCtrl Destructor -// -// Free up the backend if it exists -//--------------------------------------------------------------------------- -wxMediaCtrl::~wxMediaCtrl() -{ - if (m_imp) - delete m_imp; -} - -//--------------------------------------------------------------------------- -// wxMediaCtrl::Load (file version) -// wxMediaCtrl::Load (URL version) -// wxMediaCtrl::Load (URL & Proxy version) -// wxMediaCtrl::Load (wxInputStream version) -// -// Here we call load of the backend - keeping -// track of whether it was successful or not - which -// will determine which later method calls work -//--------------------------------------------------------------------------- -bool wxMediaCtrl::Load(const wxString& fileName) -{ - if(m_imp) - return (m_bLoaded = m_imp->Load(fileName)); - return false; -} - -bool wxMediaCtrl::Load(const wxURI& location) -{ - if(m_imp) - return (m_bLoaded = m_imp->Load(location)); - return false; -} - -bool wxMediaCtrl::Load(const wxURI& location, const wxURI& proxy) -{ - if(m_imp) - return (m_bLoaded = m_imp->Load(location, proxy)); - return false; -} - -//--------------------------------------------------------------------------- -// wxMediaCtrl::Play -// wxMediaCtrl::Pause -// wxMediaCtrl::Stop -// wxMediaCtrl::GetPlaybackRate -// wxMediaCtrl::SetPlaybackRate -// wxMediaCtrl::Seek --> SetPosition -// wxMediaCtrl::Tell --> GetPosition -// wxMediaCtrl::Length --> GetDuration -// wxMediaCtrl::GetState -// wxMediaCtrl::DoGetBestSize -// wxMediaCtrl::SetVolume -// wxMediaCtrl::GetVolume -// wxMediaCtrl::ShowInterface -// wxMediaCtrl::GetDownloadProgress -// wxMediaCtrl::GetDownloadTotal -// -// 1) Check to see whether the backend exists and is loading -// 2) Call the backend's version of the method, returning success -// if the backend's version succeeds -//--------------------------------------------------------------------------- -bool wxMediaCtrl::Play() -{ - if(m_imp && m_bLoaded) - return m_imp->Play(); - return 0; -} - -bool wxMediaCtrl::Pause() -{ - if(m_imp && m_bLoaded) - return m_imp->Pause(); - return 0; -} - -bool wxMediaCtrl::Stop() -{ - if(m_imp && m_bLoaded) - return m_imp->Stop(); - return 0; -} - -double wxMediaCtrl::GetPlaybackRate() -{ - if(m_imp && m_bLoaded) - return m_imp->GetPlaybackRate(); - return 0; -} - -bool wxMediaCtrl::SetPlaybackRate(double dRate) -{ - if(m_imp && m_bLoaded) - return m_imp->SetPlaybackRate(dRate); - return false; -} - -wxFileOffset wxMediaCtrl::Seek(wxFileOffset where, wxSeekMode mode) -{ - wxFileOffset offset; - - switch (mode) - { - case wxFromStart: - offset = where; - break; - case wxFromEnd: - offset = Length() - where; - break; -// case wxFromCurrent: - default: - offset = Tell() + where; - break; - } - - if(m_imp && m_bLoaded && m_imp->SetPosition(offset)) - return offset; - return wxInvalidOffset; -} - -wxFileOffset wxMediaCtrl::Tell() -{ - if(m_imp && m_bLoaded) - return (wxFileOffset) m_imp->GetPosition().ToLong(); - return wxInvalidOffset; -} - -wxFileOffset wxMediaCtrl::Length() -{ - if(m_imp && m_bLoaded) - return (wxFileOffset) m_imp->GetDuration().ToLong(); - return wxInvalidOffset; -} - -wxMediaState wxMediaCtrl::GetState() -{ - if(m_imp && m_bLoaded) - return m_imp->GetState(); - return wxMEDIASTATE_STOPPED; -} - -wxSize wxMediaCtrl::DoGetBestSize() const -{ - if(m_imp) - return m_imp->GetVideoSize(); - return wxSize(0,0); -} - -double wxMediaCtrl::GetVolume() -{ - if(m_imp && m_bLoaded) - return m_imp->GetVolume(); - return 0.0; -} - -bool wxMediaCtrl::SetVolume(double dVolume) -{ - if(m_imp && m_bLoaded) - return m_imp->SetVolume(dVolume); - return false; -} - -bool wxMediaCtrl::ShowPlayerControls(wxMediaCtrlPlayerControls flags) -{ - if(m_imp) - return m_imp->ShowPlayerControls(flags); - return false; -} - -wxFileOffset wxMediaCtrl::GetDownloadProgress() -{ - if(m_imp && m_bLoaded) - return (wxFileOffset) m_imp->GetDownloadProgress().ToLong(); - return wxInvalidOffset; -} - -wxFileOffset wxMediaCtrl::GetDownloadTotal() -{ - if(m_imp && m_bLoaded) - return (wxFileOffset) m_imp->GetDownloadTotal().ToLong(); - return wxInvalidOffset; -} - -//--------------------------------------------------------------------------- -// wxMediaCtrl::DoMoveWindow -// -// 1) Call parent's version so that our control's window moves where -// it's supposed to -// 2) If the backend exists and is loaded, move the video -// of the media to where our control's window is now located -//--------------------------------------------------------------------------- -void wxMediaCtrl::DoMoveWindow(int x, int y, int w, int h) -{ - wxControl::DoMoveWindow(x,y,w,h); - - if(m_imp) - m_imp->Move(x, y, w, h); -} - -//--------------------------------------------------------------------------- -// wxMediaCtrl::MacVisibilityChanged -//--------------------------------------------------------------------------- -#ifdef __WXMAC__ -void wxMediaCtrl::MacVisibilityChanged() -{ - wxControl::MacVisibilityChanged(); - - if(m_imp) - m_imp->MacVisibilityChanged(); -} -#endif - -//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -// -// wxMediaBackendCommonBase -// -//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - -void wxMediaBackendCommonBase::NotifyMovieSizeChanged() -{ - // our best size changed after opening a new file - m_ctrl->InvalidateBestSize(); - m_ctrl->SetSize(m_ctrl->GetSize()); - - // if the parent of the control has a sizer ask it to refresh our size - wxWindow * const parent = m_ctrl->GetParent(); - if ( parent->GetSizer() ) - { - m_ctrl->GetParent()->Layout(); - m_ctrl->GetParent()->Refresh(); - m_ctrl->GetParent()->Update(); - } -} - -void wxMediaBackendCommonBase::NotifyMovieLoaded() -{ - NotifyMovieSizeChanged(); - - // notify about movie being fully loaded - QueueEvent(wxEVT_MEDIA_LOADED); -} - -bool wxMediaBackendCommonBase::SendStopEvent() -{ - wxMediaEvent theEvent(wxEVT_MEDIA_STOP, m_ctrl->GetId()); - - return !m_ctrl->ProcessEvent(theEvent) || theEvent.IsAllowed(); -} - -void wxMediaBackendCommonBase::QueueEvent(wxEventType evtType) -{ - wxMediaEvent theEvent(evtType, m_ctrl->GetId()); - m_ctrl->AddPendingEvent(theEvent); -} - -void wxMediaBackendCommonBase::QueuePlayEvent() -{ - QueueEvent(wxEVT_MEDIA_STATECHANGED); - QueueEvent(wxEVT_MEDIA_PLAY); -} - -void wxMediaBackendCommonBase::QueuePauseEvent() -{ - QueueEvent(wxEVT_MEDIA_STATECHANGED); - QueueEvent(wxEVT_MEDIA_PAUSE); -} - -void wxMediaBackendCommonBase::QueueStopEvent() -{ - QueueEvent(wxEVT_MEDIA_STATECHANGED); - QueueEvent(wxEVT_MEDIA_STOP); -} - - -// -// Force link default backends in - -// see http://wiki.wxwidgets.org/wiki.pl?RTTI -// -#include "wx/html/forcelnk.h" - -#ifdef __WXMSW__ // MSW has huge backends so we do it seperately -FORCE_LINK(wxmediabackend_am) -FORCE_LINK(wxmediabackend_wmp10) -#else -FORCE_LINK(basewxmediabackends) -#endif - -#endif //wxUSE_MEDIACTRL diff --git a/wxWidgets/src/common/memory.cpp b/wxWidgets/src/common/memory.cpp deleted file mode 100644 index e3a1d7866e..0000000000 --- a/wxWidgets/src/common/memory.cpp +++ /dev/null @@ -1,1148 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/common/memory.cpp -// Purpose: Memory checking implementation -// Author: Arthur Seaton, Julian Smart -// Modified by: -// Created: 04/01/98 -// RCS-ID: $Id: memory.cpp 41054 2006-09-07 19:01:45Z ABX $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if (defined(__WXDEBUG__) && wxUSE_MEMORY_TRACING) || wxUSE_DEBUG_CONTEXT - -#include "wx/memory.h" - -#ifndef WX_PRECOMP - #ifdef __WXMSW__ - #include "wx/msw/wrapwin.h" - #endif - #include "wx/utils.h" - #include "wx/app.h" - #include "wx/hash.h" - #include "wx/log.h" -#endif - -#if wxUSE_THREADS - #include "wx/thread.h" -#endif - -#include - -#include "wx/ioswrap.h" - -#if !defined(__WATCOMC__) && !(defined(__VMS__) && ( __VMS_VER < 70000000 ) )\ - && !defined( __MWERKS__ ) && !defined(__SALFORDC__) -#include -#endif - -#include -#include - -#if wxUSE_THREADS && defined(__WXDEBUG__) -#define USE_THREADSAFE_MEMORY_ALLOCATION 1 -#else -#define USE_THREADSAFE_MEMORY_ALLOCATION 0 -#endif - - -#ifdef new -#undef new -#endif - -// wxDebugContext wxTheDebugContext; -/* - Redefine new and delete so that we can pick up situations where: - - we overwrite or underwrite areas of malloc'd memory. - - we use uninitialise variables - Only do this in debug mode. - - We change new to get enough memory to allocate a struct, followed - by the caller's requested memory, followed by a tag. The struct - is used to create a doubly linked list of these areas and also - contains another tag. The tags are used to determine when the area - has been over/under written. -*/ - - -/* - Values which are used to set the markers which will be tested for - under/over write. There are 3 of these, one in the struct, one - immediately after the struct but before the caller requested memory and - one immediately after the requested memory. -*/ -#define MemStartCheck 0x23A8 -#define MemMidCheck 0xA328 -#define MemEndCheck 0x8A32 -#define MemFillChar 0xAF -#define MemStructId 0x666D - -/* - External interface for the wxMemStruct class. Others are - defined inline within the class def. Here we only need to be able - to add and delete nodes from the list and handle errors in some way. -*/ - -/* - Used for internal "this shouldn't happen" type of errors. -*/ -void wxMemStruct::ErrorMsg (const char * mesg) -{ - wxLogMessage(wxT("wxWidgets memory checking error: %s"), mesg); - PrintNode (); -} - -/* - Used when we find an overwrite or an underwrite error. -*/ -void wxMemStruct::ErrorMsg () -{ - wxLogMessage(wxT("wxWidgets over/underwrite memory error:")); - PrintNode (); -} - - -/* - We want to find out if pointers have been overwritten as soon as is - possible, so test everything before we dereference it. Of course it's still - quite possible that, if things have been overwritten, this function will - fall over, but the only way of dealing with that would cost too much in terms - of time. -*/ -int wxMemStruct::AssertList () -{ - if (wxDebugContext::GetHead () != 0 && ! (wxDebugContext::GetHead ())->AssertIt () || - wxDebugContext::GetTail () != 0 && ! wxDebugContext::GetTail ()->AssertIt ()) { - ErrorMsg ("Head or tail pointers trashed"); - return 0; - } - return 1; -} - - -/* - Check that the thing we're pointing to has the correct id for a wxMemStruct - object and also that it's previous and next pointers are pointing at objects - which have valid ids. - This is definitely not perfect since we could fall over just trying to access - any of the slots which we use here, but I think it's about the best that I - can do without doing something like taking all new wxMemStruct pointers and - comparing them against all known pointer within the list and then only - doing this sort of check _after_ you've found the pointer in the list. That - would be safer, but also much more time consuming. -*/ -int wxMemStruct::AssertIt () -{ - return (m_id == MemStructId && - (m_prev == 0 || m_prev->m_id == MemStructId) && - (m_next == 0 || m_next->m_id == MemStructId)); -} - - -/* - Additions are always at the tail of the list. - Returns 0 on error, non-zero on success. -*/ -int wxMemStruct::Append () -{ - if (! AssertList ()) - return 0; - - if (wxDebugContext::GetHead () == 0) { - if (wxDebugContext::GetTail () != 0) { - ErrorMsg ("Null list should have a null tail pointer"); - return 0; - } - (void) wxDebugContext::SetHead (this); - (void) wxDebugContext::SetTail (this); - } else { - wxDebugContext::GetTail ()->m_next = this; - this->m_prev = wxDebugContext::GetTail (); - (void) wxDebugContext::SetTail (this); - } - return 1; -} - - -/* - Don't actually free up anything here as the space which is used - by the node will be free'd up when the whole block is free'd. - Returns 0 on error, non-zero on success. -*/ -int wxMemStruct::Unlink () -{ - if (! AssertList ()) - return 0; - - if (wxDebugContext::GetHead () == 0 || wxDebugContext::GetTail () == 0) { - ErrorMsg ("Trying to remove node from empty list"); - return 0; - } - - // Handle the part of the list before this node. - if (m_prev == 0) { - if (this != wxDebugContext::GetHead ()) { - ErrorMsg ("No previous node for non-head node"); - return 0; - } - (void) wxDebugContext::SetHead (m_next); - } else { - if (! m_prev->AssertIt ()) { - ErrorMsg ("Trashed previous pointer"); - return 0; - } - - if (m_prev->m_next != this) { - ErrorMsg ("List is inconsistent"); - return 0; - } - m_prev->m_next = m_next; - } - - // Handle the part of the list after this node. - if (m_next == 0) { - if (this != wxDebugContext::GetTail ()) { - ErrorMsg ("No next node for non-tail node"); - return 0; - } - (void) wxDebugContext::SetTail (m_prev); - } else { - if (! m_next->AssertIt ()) { - ErrorMsg ("Trashed next pointer"); - return 0; - } - - if (m_next->m_prev != this) { - ErrorMsg ("List is inconsistent"); - return 0; - } - m_next->m_prev = m_prev; - } - - return 1; -} - - - -/* - Checks a node and block of memory to see that the markers are still - intact. -*/ -int wxMemStruct::CheckBlock () -{ - int nFailures = 0; - - if (m_firstMarker != MemStartCheck) { - nFailures++; - ErrorMsg (); - } - - char * pointer = wxDebugContext::MidMarkerPos ((char *) this); - if (* (wxMarkerType *) pointer != MemMidCheck) { - nFailures++; - ErrorMsg (); - } - - pointer = wxDebugContext::EndMarkerPos ((char *) this, RequestSize ()); - if (* (wxMarkerType *) pointer != MemEndCheck) { - nFailures++; - ErrorMsg (); - } - - return nFailures; -} - - -/* - Check the list of nodes to see if they are all ok. -*/ -int wxMemStruct::CheckAllPrevious () -{ - int nFailures = 0; - - for (wxMemStruct * st = this->m_prev; st != 0; st = st->m_prev) { - if (st->AssertIt ()) - nFailures += st->CheckBlock (); - else - return -1; - } - - return nFailures; -} - - -/* - When we delete a node we set the id slot to a specific value and then test - against this to see if a nodes have been deleted previously. I don't - just set the entire memory to the fillChar because then I'd be overwriting - useful stuff like the vtbl which may be needed to output the error message - including the file name and line numbers. Without this info the whole point - of this class is lost! -*/ -void wxMemStruct::SetDeleted () -{ - m_id = MemFillChar; -} - -int wxMemStruct::IsDeleted () -{ - return (m_id == MemFillChar); -} - - -/* - Print out a single node. There are many far better ways of doing this - but this will suffice for now. -*/ -void wxMemStruct::PrintNode () -{ - if (m_isObject) - { - wxObject *obj = (wxObject *)m_actualData; - wxClassInfo *info = obj->GetClassInfo(); - - // Let's put this in standard form so IDEs can load the file at the appropriate - // line - wxString msg; - - if (m_fileName) - msg.Printf(wxT("%s(%d): "), m_fileName, (int)m_lineNum); - - if (info && info->GetClassName()) - msg += info->GetClassName(); - else - msg += wxT("object"); - - wxString msg2; - msg2.Printf(wxT(" at 0x%lX, size %d"), (long)GetActualData(), (int)RequestSize()); - msg += msg2; - - wxLogMessage(msg); - } - else - { - wxString msg; - - if (m_fileName) - msg.Printf(wxT("%s(%d): "), m_fileName, (int)m_lineNum); - msg += wxT("non-object data"); - wxString msg2; - msg2.Printf(wxT(" at 0x%lX, size %d\n"), (long)GetActualData(), (int)RequestSize()); - msg += msg2; - - wxLogMessage(msg); - } -} - -void wxMemStruct::Dump () -{ - if (!ValidateNode()) return; - - if (m_isObject) - { - wxObject *obj = (wxObject *)m_actualData; - - wxString msg; - if (m_fileName) - msg.Printf(wxT("%s(%d): "), m_fileName, (int)m_lineNum); - - - /* TODO: We no longer have a stream (using wxLogDebug) so we can't dump it. - * Instead, do what wxObject::Dump does. - * What should we do long-term, eliminate Dumping? Or specify - * that MyClass::Dump should use wxLogDebug? Ugh. - obj->Dump(wxDebugContext::GetStream()); - */ - - if (obj->GetClassInfo() && obj->GetClassInfo()->GetClassName()) - msg += obj->GetClassInfo()->GetClassName(); - else - msg += wxT("unknown object class"); - - wxString msg2; - msg2.Printf(wxT(" at 0x%lX, size %d"), (long)GetActualData(), (int)RequestSize()); - msg += msg2; - - wxDebugContext::OutputDumpLine(msg); - } - else - { - wxString msg; - if (m_fileName) - msg.Printf(wxT("%s(%d): "), m_fileName, (int)m_lineNum); - - wxString msg2; - msg2.Printf(wxT("non-object data at 0x%lX, size %d"), (long)GetActualData(), (int)RequestSize() ); - msg += msg2; - wxDebugContext::OutputDumpLine(msg); - } -} - - -/* - Validate a node. Check to see that the node is "clean" in the sense - that nothing has over/underwritten it etc. -*/ -int wxMemStruct::ValidateNode () -{ - char * startPointer = (char *) this; - if (!AssertIt ()) { - if (IsDeleted ()) - ErrorMsg ("Object already deleted"); - else { - // Can't use the error routines as we have no recognisable object. -#ifndef __WXGTK__ - wxLogMessage(wxT("Can't verify memory struct - all bets are off!")); -#endif - } - return 0; - } - -/* - int i; - for (i = 0; i < wxDebugContext::TotSize (requestSize ()); i++) - cout << startPointer [i]; - cout << endl; -*/ - if (Marker () != MemStartCheck) - ErrorMsg (); - if (* (wxMarkerType *) wxDebugContext::MidMarkerPos (startPointer) != MemMidCheck) - ErrorMsg (); - if (* (wxMarkerType *) wxDebugContext::EndMarkerPos (startPointer, - RequestSize ()) != - MemEndCheck) - ErrorMsg (); - - // Back to before the extra buffer and check that - // we can still read what we originally wrote. - if (Marker () != MemStartCheck || - * (wxMarkerType *) wxDebugContext::MidMarkerPos (startPointer) - != MemMidCheck || - * (wxMarkerType *) wxDebugContext::EndMarkerPos (startPointer, - RequestSize ()) != MemEndCheck) - { - ErrorMsg (); - return 0; - } - - return 1; -} - -/* - The wxDebugContext class. -*/ - -wxMemStruct *wxDebugContext::m_head = NULL; -wxMemStruct *wxDebugContext::m_tail = NULL; - -bool wxDebugContext::m_checkPrevious = false; -int wxDebugContext::debugLevel = 1; -bool wxDebugContext::debugOn = true; -wxMemStruct *wxDebugContext::checkPoint = NULL; - -// For faster alignment calculation -static wxMarkerType markerCalc[2]; -int wxDebugContext::m_balign = (int)((char *)&markerCalc[1] - (char*)&markerCalc[0]); -int wxDebugContext::m_balignmask = (int)((char *)&markerCalc[1] - (char*)&markerCalc[0]) - 1; - -wxDebugContext::wxDebugContext(void) -{ -} - -wxDebugContext::~wxDebugContext(void) -{ -} - -/* - Work out the positions of the markers by creating an array of 2 markers - and comparing the addresses of the 2 elements. Use this number as the - alignment for markers. -*/ -size_t wxDebugContext::CalcAlignment () -{ - wxMarkerType ar[2]; - return (char *) &ar[1] - (char *) &ar[0]; -} - - -char * wxDebugContext::StructPos (const char * buf) -{ - return (char *) buf; -} - -char * wxDebugContext::MidMarkerPos (const char * buf) -{ - return StructPos (buf) + PaddedSize (sizeof (wxMemStruct)); -} - -char * wxDebugContext::CallerMemPos (const char * buf) -{ - return MidMarkerPos (buf) + PaddedSize (sizeof(wxMarkerType)); -} - - -char * wxDebugContext::EndMarkerPos (const char * buf, const size_t size) -{ - return CallerMemPos (buf) + PaddedSize (size); -} - - -/* - Slightly different as this takes a pointer to the start of the caller - requested region and returns a pointer to the start of the buffer. - */ -char * wxDebugContext::StartPos (const char * caller) -{ - return ((char *) (caller - wxDebugContext::PaddedSize (sizeof(wxMarkerType)) - - wxDebugContext::PaddedSize (sizeof (wxMemStruct)))); -} - -/* - We may need padding between various parts of the allocated memory. - Given a size of memory, this returns the amount of memory which should - be allocated in order to allow for alignment of the following object. - - I don't know how portable this stuff is, but it seems to work for me at - the moment. It would be real nice if I knew more about this! - - // Note: this function is now obsolete (along with CalcAlignment) - // because the calculations are done statically, for greater speed. -*/ -size_t wxDebugContext::GetPadding (const size_t size) -{ - size_t pad = size % CalcAlignment (); - return (pad) ? sizeof(wxMarkerType) - pad : 0; -} - -size_t wxDebugContext::PaddedSize (const size_t size) -{ - // Added by Terry Farnham to replace - // slow GetPadding call. - int padb; - - padb = size & m_balignmask; - if(padb) - return(size + m_balign - padb); - else - return(size); -} - -/* - Returns the total amount of memory which we need to get from the system - in order to satisfy a caller request. This includes space for the struct - plus markers and the caller's memory as well. -*/ -size_t wxDebugContext::TotSize (const size_t reqSize) -{ - return (PaddedSize (sizeof (wxMemStruct)) + PaddedSize (reqSize) + - 2 * sizeof(wxMarkerType)); -} - - -/* - Traverse the list of nodes executing the given function on each node. -*/ -void wxDebugContext::TraverseList (PmSFV func, wxMemStruct *from) -{ - if (!from) - from = wxDebugContext::GetHead (); - - wxMemStruct * st = NULL; - for (st = from; st != 0; st = st->m_next) - { - void* data = st->GetActualData(); -// if ((data != (void*)m_debugStream) && (data != (void*) m_streamBuf)) - if (data != (void*) wxLog::GetActiveTarget()) - { - (st->*func) (); - } - } -} - - -/* - Print out the list. - */ -bool wxDebugContext::PrintList (void) -{ -#ifdef __WXDEBUG__ - TraverseList ((PmSFV)&wxMemStruct::PrintNode, (checkPoint ? checkPoint->m_next : (wxMemStruct*)NULL)); - - return true; -#else - return false; -#endif -} - -bool wxDebugContext::Dump(void) -{ -#ifdef __WXDEBUG__ - { - wxChar* appName = (wxChar*) wxT("application"); - wxString appNameStr; - if (wxTheApp) - { - appNameStr = wxTheApp->GetAppName(); - appName = WXSTRINGCAST appNameStr; - OutputDumpLine(wxT("----- Memory dump of %s at %s -----"), appName, WXSTRINGCAST wxNow() ); - } - else - { - OutputDumpLine( wxT("----- Memory dump -----") ); - } - } - - TraverseList ((PmSFV)&wxMemStruct::Dump, (checkPoint ? checkPoint->m_next : (wxMemStruct*)NULL)); - - OutputDumpLine(wxEmptyString); - OutputDumpLine(wxEmptyString); - - return true; -#else - return false; -#endif -} - -#ifdef __WXDEBUG__ -struct wxDebugStatsStruct -{ - long instanceCount; - long totalSize; - wxChar *instanceClass; - wxDebugStatsStruct *next; -}; - -static wxDebugStatsStruct *FindStatsStruct(wxDebugStatsStruct *st, wxChar *name) -{ - while (st) - { - if (wxStrcmp(st->instanceClass, name) == 0) - return st; - st = st->next; - } - return NULL; -} - -static wxDebugStatsStruct *InsertStatsStruct(wxDebugStatsStruct *head, wxDebugStatsStruct *st) -{ - st->next = head; - return st; -} -#endif - -bool wxDebugContext::PrintStatistics(bool detailed) -{ -#ifdef __WXDEBUG__ - { - wxChar* appName = (wxChar*) wxT("application"); - wxString appNameStr; - if (wxTheApp) - { - appNameStr = wxTheApp->GetAppName(); - appName = WXSTRINGCAST appNameStr; - OutputDumpLine(wxT("----- Memory statistics of %s at %s -----"), appName, WXSTRINGCAST wxNow() ); - } - else - { - OutputDumpLine( wxT("----- Memory statistics -----") ); - } - } - - bool currentMode = GetDebugMode(); - SetDebugMode(false); - - long noNonObjectNodes = 0; - long noObjectNodes = 0; - long totalSize = 0; - - wxDebugStatsStruct *list = NULL; - - wxMemStruct *from = (checkPoint ? checkPoint->m_next : (wxMemStruct*)NULL ); - if (!from) - from = wxDebugContext::GetHead (); - - wxMemStruct *st; - for (st = from; st != 0; st = st->m_next) - { - void* data = st->GetActualData(); - if (detailed && (data != (void*) wxLog::GetActiveTarget())) - { - wxChar *className = (wxChar*) wxT("nonobject"); - if (st->m_isObject && st->GetActualData()) - { - wxObject *obj = (wxObject *)st->GetActualData(); - if (obj->GetClassInfo()->GetClassName()) - className = (wxChar*)obj->GetClassInfo()->GetClassName(); - } - wxDebugStatsStruct *stats = FindStatsStruct(list, className); - if (!stats) - { - stats = (wxDebugStatsStruct *)malloc(sizeof(wxDebugStatsStruct)); - stats->instanceClass = className; - stats->instanceCount = 0; - stats->totalSize = 0; - list = InsertStatsStruct(list, stats); - } - stats->instanceCount ++; - stats->totalSize += st->RequestSize(); - } - - if (data != (void*) wxLog::GetActiveTarget()) - { - totalSize += st->RequestSize(); - if (st->m_isObject) - noObjectNodes ++; - else - noNonObjectNodes ++; - } - } - - if (detailed) - { - while (list) - { - OutputDumpLine(wxT("%ld objects of class %s, total size %ld"), - list->instanceCount, list->instanceClass, list->totalSize); - wxDebugStatsStruct *old = list; - list = old->next; - free((char *)old); - } - OutputDumpLine(wxEmptyString); - } - - SetDebugMode(currentMode); - - OutputDumpLine(wxT("Number of object items: %ld"), noObjectNodes); - OutputDumpLine(wxT("Number of non-object items: %ld"), noNonObjectNodes); - OutputDumpLine(wxT("Total allocated size: %ld"), totalSize); - OutputDumpLine(wxEmptyString); - OutputDumpLine(wxEmptyString); - - return true; -#else - (void)detailed; - return false; -#endif -} - -bool wxDebugContext::PrintClasses(void) -{ - { - wxChar* appName = (wxChar*) wxT("application"); - wxString appNameStr; - if (wxTheApp) - { - appNameStr = wxTheApp->GetAppName(); - appName = WXSTRINGCAST appNameStr; - wxLogMessage(wxT("----- Classes in %s -----"), appName); - } - } - - int n = 0; - wxHashTable::compatibility_iterator node; - wxClassInfo *info; - - wxClassInfo::sm_classTable->BeginFind(); - node = wxClassInfo::sm_classTable->Next(); - while (node) - { - info = (wxClassInfo *)node->GetData(); - if (info->GetClassName()) - { - wxString msg(info->GetClassName()); - msg += wxT(" "); - - if (info->GetBaseClassName1() && !info->GetBaseClassName2()) - { - msg += wxT("is a "); - msg += info->GetBaseClassName1(); - } - else if (info->GetBaseClassName1() && info->GetBaseClassName2()) - { - msg += wxT("is a "); - msg += info->GetBaseClassName1() ; - msg += wxT(", "); - msg += info->GetBaseClassName2() ; - } - if (info->GetConstructor()) - msg += wxT(": dynamic"); - - wxLogMessage(msg); - } - node = wxClassInfo::sm_classTable->Next(); - n ++; - } - wxLogMessage(wxEmptyString); - wxLogMessage(wxT("There are %d classes derived from wxObject."), n); - wxLogMessage(wxEmptyString); - wxLogMessage(wxEmptyString); - return true; -} - -void wxDebugContext::SetCheckpoint(bool all) -{ - if (all) - checkPoint = NULL; - else - checkPoint = m_tail; -} - -// Checks all nodes since checkpoint, or since start. -int wxDebugContext::Check(bool checkAll) -{ - int nFailures = 0; - - wxMemStruct *from = (checkPoint ? checkPoint->m_next : (wxMemStruct*)NULL ); - if (!from || checkAll) - from = wxDebugContext::GetHead (); - - for (wxMemStruct * st = from; st != 0; st = st->m_next) - { - if (st->AssertIt ()) - nFailures += st->CheckBlock (); - else - return -1; - } - - return nFailures; -} - -// Count the number of non-wxDebugContext-related objects -// that are outstanding -int wxDebugContext::CountObjectsLeft(bool sinceCheckpoint) -{ - int n = 0; - - wxMemStruct *from = NULL; - if (sinceCheckpoint && checkPoint) - from = checkPoint->m_next; - else - from = wxDebugContext::GetHead () ; - - for (wxMemStruct * st = from; st != 0; st = st->m_next) - { - void* data = st->GetActualData(); - if (data != (void*) wxLog::GetActiveTarget()) - n ++; - } - - return n ; -} - -// This function is used to output the dump -void wxDebugContext::OutputDumpLine(const wxChar *szFormat, ...) -{ - // a buffer of 2048 bytes should be long enough for a file name - // and a class name - wxChar buf[2048]; - int count; - va_list argptr; - va_start(argptr, szFormat); - buf[sizeof(buf)/sizeof(wxChar)-1] = _T('\0'); - - // keep 3 bytes for a \r\n\0 - count = wxVsnprintf(buf, sizeof(buf)/sizeof(wxChar)-3, szFormat, argptr); - - if ( count < 0 ) - count = sizeof(buf)/sizeof(wxChar)-3; - buf[count]=_T('\r'); - buf[count+1]=_T('\n'); - buf[count+2]=_T('\0'); - - wxMessageOutputDebug dbgout; - dbgout.Printf(buf); -} - - -#if USE_THREADSAFE_MEMORY_ALLOCATION -static bool memSectionOk = false; - -class MemoryCriticalSection : public wxCriticalSection -{ -public: - MemoryCriticalSection() { - memSectionOk = true; - } - ~MemoryCriticalSection() { - memSectionOk = false; - } -}; - -class MemoryCriticalSectionLocker -{ -public: - inline MemoryCriticalSectionLocker(wxCriticalSection& critsect) - : m_critsect(critsect), m_locked(memSectionOk) { if(m_locked) m_critsect.Enter(); } - inline ~MemoryCriticalSectionLocker() { if(m_locked) m_critsect.Leave(); } - -private: - // no assignment operator nor copy ctor - MemoryCriticalSectionLocker(const MemoryCriticalSectionLocker&); - MemoryCriticalSectionLocker& operator=(const MemoryCriticalSectionLocker&); - - wxCriticalSection& m_critsect; - bool m_locked; -}; - -static MemoryCriticalSection memLocker; - -#endif // USE_THREADSAFE_MEMORY_ALLOCATION - - -#ifdef __WXDEBUG__ -#if !(defined(__WXMSW__) && (defined(WXUSINGDLL) || defined(WXMAKINGDLL_BASE))) -#if wxUSE_GLOBAL_MEMORY_OPERATORS -void * operator new (size_t size, wxChar * fileName, int lineNum) -{ - return wxDebugAlloc(size, fileName, lineNum, false, false); -} - -void * operator new (size_t size) -{ - return wxDebugAlloc(size, NULL, 0, false); -} - -void operator delete (void * buf) -{ - wxDebugFree(buf, false); -} - -#if wxUSE_ARRAY_MEMORY_OPERATORS -void * operator new[] (size_t size) -{ - return wxDebugAlloc(size, NULL, 0, false, true); -} - -void * operator new[] (size_t size, wxChar * fileName, int lineNum) -{ - return wxDebugAlloc(size, fileName, lineNum, false, true); -} - -void operator delete[] (void * buf) -{ - wxDebugFree(buf, true); -} -#endif // wxUSE_ARRAY_MEMORY_OPERATORS -#endif // wxUSE_GLOBAL_MEMORY_OPERATORS -#endif // !(defined(__WXMSW__) && (defined(WXUSINGDLL) || defined(WXMAKINGDLL_BASE))) - -// TODO: store whether this is a vector or not. -void * wxDebugAlloc(size_t size, wxChar * fileName, int lineNum, bool isObject, bool WXUNUSED(isVect) ) -{ -#if USE_THREADSAFE_MEMORY_ALLOCATION - MemoryCriticalSectionLocker lock(memLocker); -#endif - - // If not in debugging allocation mode, do the normal thing - // so we don't leave any trace of ourselves in the node list. - -#if defined(__VISAGECPP__) && (__IBMCPP__ < 400 || __IBMC__ < 400 ) -// VA 3.0 still has trouble in here - return (void *)malloc(size); -#endif - if (!wxDebugContext::GetDebugMode()) - { - return (void *)malloc(size); - } - - int totSize = wxDebugContext::TotSize (size); - char * buf = (char *) malloc(totSize); - if (!buf) { - wxLogMessage(wxT("Call to malloc (%ld) failed."), (long)size); - return 0; - } - wxMemStruct * st = (wxMemStruct *)buf; - st->m_firstMarker = MemStartCheck; - st->m_reqSize = size; - st->m_fileName = fileName; - st->m_lineNum = lineNum; - st->m_id = MemStructId; - st->m_prev = 0; - st->m_next = 0; - st->m_isObject = isObject; - - // Errors from Append() shouldn't really happen - but just in case! - if (st->Append () == 0) { - st->ErrorMsg ("Trying to append new node"); - } - - if (wxDebugContext::GetCheckPrevious ()) { - if (st->CheckAllPrevious () < 0) { - st->ErrorMsg ("Checking previous nodes"); - } - } - - // Set up the extra markers at the middle and end. - char * ptr = wxDebugContext::MidMarkerPos (buf); - * (wxMarkerType *) ptr = MemMidCheck; - ptr = wxDebugContext::EndMarkerPos (buf, size); - * (wxMarkerType *) ptr = MemEndCheck; - - // pointer returned points to the start of the caller's - // usable area. - void *m_actualData = (void *) wxDebugContext::CallerMemPos (buf); - st->m_actualData = m_actualData; - - return m_actualData; -} - -// TODO: check whether was allocated as a vector -void wxDebugFree(void * buf, bool WXUNUSED(isVect) ) -{ -#if USE_THREADSAFE_MEMORY_ALLOCATION - MemoryCriticalSectionLocker lock(memLocker); -#endif - - if (!buf) - return; - -#if defined(__VISAGECPP__) && (__IBMCPP__ < 400 || __IBMC__ < 400 ) -// VA 3.0 still has trouble in here - free((char *)buf); -#endif - // If not in debugging allocation mode, do the normal thing - // so we don't leave any trace of ourselves in the node list. - if (!wxDebugContext::GetDebugMode()) - { - free((char *)buf); - return; - } - - // Points to the start of the entire allocated area. - char * startPointer = wxDebugContext::StartPos ((char *) buf); - // Find the struct and make sure that it's identifiable. - wxMemStruct * st = (wxMemStruct *) wxDebugContext::StructPos (startPointer); - - if (! st->ValidateNode ()) - return; - - // If this is the current checkpoint, we need to - // move the checkpoint back so it points to a valid - // node. - if (st == wxDebugContext::checkPoint) - wxDebugContext::checkPoint = wxDebugContext::checkPoint->m_prev; - - if (! st->Unlink ()) - { - st->ErrorMsg ("Unlinking deleted node"); - } - - // Now put in the fill char into the id slot and the caller requested - // memory locations. - st->SetDeleted (); - (void) memset (wxDebugContext::CallerMemPos (startPointer), MemFillChar, - st->RequestSize ()); - - free((char *)st); -} - -#endif // __WXDEBUG__ - -// Trace: send output to the current debugging stream -void wxTrace(const wxChar * ...) -{ -#if 1 - wxFAIL_MSG(wxT("wxTrace is now obsolete. Please use wxDebugXXX instead.")); -#else - va_list ap; - static wxChar buffer[512]; - - va_start(ap, fmt); - -#ifdef __WXMSW__ - wvsprintf(buffer,fmt,ap) ; -#else - vsprintf(buffer,fmt,ap) ; -#endif - - va_end(ap); - - if (wxDebugContext::HasStream()) - { - wxDebugContext::GetStream() << buffer; - wxDebugContext::GetStream().flush(); - } - else -#ifdef __WXMSW__ -#ifdef __WIN32__ - OutputDebugString((LPCTSTR)buffer) ; -#else - OutputDebugString((const char*) buffer) ; -#endif -#else - fprintf(stderr, buffer); -#endif -#endif -} - -// Trace with level -void wxTraceLevel(int, const wxChar * ...) -{ -#if 1 - wxFAIL_MSG(wxT("wxTrace is now obsolete. Please use wxDebugXXX instead.")); -#else - if (wxDebugContext::GetLevel() < level) - return; - - va_list ap; - static wxChar buffer[512]; - - va_start(ap, fmt); - -#ifdef __WXMSW__ - wxWvsprintf(buffer,fmt,ap) ; -#else - vsprintf(buffer,fmt,ap) ; -#endif - - va_end(ap); - - if (wxDebugContext::HasStream()) - { - wxDebugContext::GetStream() << buffer; - wxDebugContext::GetStream().flush(); - } - else -#ifdef __WXMSW__ -#ifdef __WIN32__ - OutputDebugString((LPCTSTR)buffer) ; -#else - OutputDebugString((const char*) buffer) ; -#endif -#else - fprintf(stderr, buffer); -#endif -#endif -} - -//---------------------------------------------------------------------------- -// Final cleanup after all global objects in all files have been destroyed -//---------------------------------------------------------------------------- - -// Don't set it to 0 by dynamic initialization -// Some compilers will really do the assignment later -// All global variables are initialized to 0 at the very beginning, and this is just fine. -int wxDebugContextDumpDelayCounter::sm_count; - -void wxDebugContextDumpDelayCounter::DoDump() -{ - if (wxDebugContext::CountObjectsLeft(true) > 0) - { - wxDebugContext::OutputDumpLine(wxT("There were memory leaks.\n")); - wxDebugContext::Dump(); - wxDebugContext::PrintStatistics(); - } -} - -// Even if there is nothing else, make sure that there is at -// least one cleanup counter object -static wxDebugContextDumpDelayCounter wxDebugContextDumpDelayCounter_One; - -#endif // (defined(__WXDEBUG__) && wxUSE_MEMORY_TRACING) || wxUSE_DEBUG_CONTEXT diff --git a/wxWidgets/src/common/menucmn.cpp b/wxWidgets/src/common/menucmn.cpp deleted file mode 100644 index 145fe9b01e..0000000000 --- a/wxWidgets/src/common/menucmn.cpp +++ /dev/null @@ -1,1173 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: src/common/menucmn.cpp -// Purpose: wxMenu and wxMenuBar methods common to all ports -// Author: Vadim Zeitlin -// Modified by: -// Created: 26.10.99 -// RCS-ID: $Id: menucmn.cpp 57852 2009-01-06 09:40:34Z SC $ -// Copyright: (c) wxWidgets team -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_MENUS - -#include - -#ifndef WX_PRECOMP - #include "wx/intl.h" - #include "wx/log.h" - #include "wx/menu.h" -#endif - -#include "wx/stockitem.h" - -// ---------------------------------------------------------------------------- -// template lists -// ---------------------------------------------------------------------------- - -#include "wx/listimpl.cpp" - -WX_DEFINE_LIST(wxMenuList) -WX_DEFINE_LIST(wxMenuItemList) - -// ============================================================================ -// implementation -// ============================================================================ - -// ---------------------------------------------------------------------------- -// wxAcceleratorEntry -// ---------------------------------------------------------------------------- - - -#if wxUSE_ACCEL - -static const struct wxKeyName -{ - wxKeyCode code; - const wxChar *name; -} wxKeyNames[] = -{ - { WXK_DELETE, wxTRANSLATE("DEL") }, - { WXK_DELETE, wxTRANSLATE("DELETE") }, - { WXK_BACK, wxTRANSLATE("BACK") }, - { WXK_INSERT, wxTRANSLATE("INS") }, - { WXK_INSERT, wxTRANSLATE("INSERT") }, - { WXK_RETURN, wxTRANSLATE("ENTER") }, - { WXK_RETURN, wxTRANSLATE("RETURN") }, - { WXK_PAGEUP, wxTRANSLATE("PGUP") }, - { WXK_PAGEDOWN, wxTRANSLATE("PGDN") }, - { WXK_LEFT, wxTRANSLATE("LEFT") }, - { WXK_RIGHT, wxTRANSLATE("RIGHT") }, - { WXK_UP, wxTRANSLATE("UP") }, - { WXK_DOWN, wxTRANSLATE("DOWN") }, - { WXK_HOME, wxTRANSLATE("HOME") }, - { WXK_END, wxTRANSLATE("END") }, - { WXK_SPACE, wxTRANSLATE("SPACE") }, - { WXK_TAB, wxTRANSLATE("TAB") }, - { WXK_ESCAPE, wxTRANSLATE("ESC") }, - { WXK_ESCAPE, wxTRANSLATE("ESCAPE") }, - { WXK_CANCEL, wxTRANSLATE("CANCEL") }, - { WXK_CLEAR, wxTRANSLATE("CLEAR") }, - { WXK_MENU, wxTRANSLATE("MENU") }, - { WXK_PAUSE, wxTRANSLATE("PAUSE") }, - { WXK_CAPITAL, wxTRANSLATE("CAPITAL") }, - { WXK_SELECT, wxTRANSLATE("SELECT") }, - { WXK_PRINT, wxTRANSLATE("PRINT") }, - { WXK_EXECUTE, wxTRANSLATE("EXECUTE") }, - { WXK_SNAPSHOT, wxTRANSLATE("SNAPSHOT") }, - { WXK_HELP, wxTRANSLATE("HELP") }, - { WXK_ADD, wxTRANSLATE("ADD") }, - { WXK_SEPARATOR, wxTRANSLATE("SEPARATOR") }, - { WXK_SUBTRACT, wxTRANSLATE("SUBTRACT") }, - { WXK_DECIMAL, wxTRANSLATE("DECIMAL") }, - { WXK_DIVIDE, wxTRANSLATE("DIVIDE") }, - { WXK_NUMLOCK, wxTRANSLATE("NUM_LOCK") }, - { WXK_SCROLL, wxTRANSLATE("SCROLL_LOCK") }, - { WXK_PAGEUP, wxTRANSLATE("PAGEUP") }, - { WXK_PAGEDOWN, wxTRANSLATE("PAGEDOWN") }, - { WXK_NUMPAD_SPACE, wxTRANSLATE("KP_SPACE") }, - { WXK_NUMPAD_TAB, wxTRANSLATE("KP_TAB") }, - { WXK_NUMPAD_ENTER, wxTRANSLATE("KP_ENTER") }, - { WXK_NUMPAD_HOME, wxTRANSLATE("KP_HOME") }, - { WXK_NUMPAD_LEFT, wxTRANSLATE("KP_LEFT") }, - { WXK_NUMPAD_UP, wxTRANSLATE("KP_UP") }, - { WXK_NUMPAD_RIGHT, wxTRANSLATE("KP_RIGHT") }, - { WXK_NUMPAD_DOWN, wxTRANSLATE("KP_DOWN") }, - { WXK_NUMPAD_PAGEUP, wxTRANSLATE("KP_PRIOR") }, - { WXK_NUMPAD_PAGEUP, wxTRANSLATE("KP_PAGEUP") }, - { WXK_NUMPAD_PAGEDOWN, wxTRANSLATE("KP_NEXT") }, - { WXK_NUMPAD_PAGEDOWN, wxTRANSLATE("KP_PAGEDOWN") }, - { WXK_NUMPAD_END, wxTRANSLATE("KP_END") }, - { WXK_NUMPAD_BEGIN, wxTRANSLATE("KP_BEGIN") }, - { WXK_NUMPAD_INSERT, wxTRANSLATE("KP_INSERT") }, - { WXK_NUMPAD_DELETE, wxTRANSLATE("KP_DELETE") }, - { WXK_NUMPAD_EQUAL, wxTRANSLATE("KP_EQUAL") }, - { WXK_NUMPAD_MULTIPLY, wxTRANSLATE("KP_MULTIPLY") }, - { WXK_NUMPAD_ADD, wxTRANSLATE("KP_ADD") }, - { WXK_NUMPAD_SEPARATOR, wxTRANSLATE("KP_SEPARATOR") }, - { WXK_NUMPAD_SUBTRACT, wxTRANSLATE("KP_SUBTRACT") }, - { WXK_NUMPAD_DECIMAL, wxTRANSLATE("KP_DECIMAL") }, - { WXK_NUMPAD_DIVIDE, wxTRANSLATE("KP_DIVIDE") }, - { WXK_WINDOWS_LEFT, wxTRANSLATE("WINDOWS_LEFT") }, - { WXK_WINDOWS_RIGHT, wxTRANSLATE("WINDOWS_RIGHT") }, - { WXK_WINDOWS_MENU, wxTRANSLATE("WINDOWS_MENU") }, - { WXK_COMMAND, wxTRANSLATE("COMMAND") }, -}; - -// return true if the 2 strings refer to the same accel -// -// as accels can be either translated or not, check for both possibilities and -// also compare case-insensitively as the key names case doesn't count -static inline bool CompareAccelString(const wxString& str, const wxChar *accel) -{ - return str.CmpNoCase(accel) == 0 -#if wxUSE_INTL - || str.CmpNoCase(wxGetTranslation(accel)) == 0 -#endif - ; -} - -// return prefixCode+number if the string is of the form "" and -// 0 if it isn't -// -// first and last parameter specify the valid domain for "number" part -static int - IsNumberedAccelKey(const wxString& str, - const wxChar *prefix, - wxKeyCode prefixCode, - unsigned first, - unsigned last) -{ - const size_t lenPrefix = wxStrlen(prefix); - if ( !CompareAccelString(str.Left(lenPrefix), prefix) ) - return 0; - - unsigned long num; - if ( !str.Mid(lenPrefix).ToULong(&num) ) - return 0; - - if ( num < first || num > last ) - { - // this must be a mistake, chances that this is a valid name of another - // key are vanishingly small - wxLogDebug(_T("Invalid key string \"%s\""), str.c_str()); - return 0; - } - - return prefixCode + num - first; -} - -/* static */ -bool -wxAcceleratorEntry::ParseAccel(const wxString& text, int *flagsOut, int *keyOut) -{ - // the parser won't like trailing spaces - wxString label = text; - label.Trim(true); // the initial \t must be preserved so don't strip leading whitespaces - - // check for accelerators: they are given after '\t' - int posTab = label.Find(wxT('\t')); - if ( posTab == wxNOT_FOUND ) - { - return false; - } - - // parse the accelerator string - int accelFlags = wxACCEL_NORMAL; - wxString current; - for ( size_t n = (size_t)posTab + 1; n < label.length(); n++ ) - { - if ( (label[n] == '+') || (label[n] == '-') ) - { - // differentiate between a ctrl that will be translated to cmd on mac - // and an explicit xctrl that will not be translated and remains a ctrl - if ( CompareAccelString(current, wxTRANSLATE("ctrl")) ) - accelFlags |= wxACCEL_CMD; - else if ( CompareAccelString(current, wxTRANSLATE("xctrl")) ) - accelFlags |= wxACCEL_CTRL; - else if ( CompareAccelString(current, wxTRANSLATE("alt")) ) - accelFlags |= wxACCEL_ALT; - else if ( CompareAccelString(current, wxTRANSLATE("shift")) ) - accelFlags |= wxACCEL_SHIFT; - else // not a recognized modifier name - { - // we may have "Ctrl-+", for example, but we still want to - // catch typos like "Crtl-A" so only give the warning if we - // have something before the current '+' or '-', else take - // it as a literal symbol - if ( current.empty() ) - { - current += label[n]; - - // skip clearing it below - continue; - } - else - { - wxLogDebug(wxT("Unknown accel modifier: '%s'"), - current.c_str()); - } - } - - current.clear(); - } - else // not special character - { - current += (wxChar) wxTolower(label[n]); - } - } - - int keyCode; - const size_t len = current.length(); - switch ( len ) - { - case 0: - wxLogDebug(wxT("No accel key found, accel string ignored.")); - return false; - - case 1: - // it's just a letter - keyCode = current[0U]; - - // if the key is used with any modifiers, make it an uppercase one - // because Ctrl-A and Ctrl-a are the same; but keep it as is if it's - // used alone as 'a' and 'A' are different - if ( accelFlags != wxACCEL_NORMAL ) - keyCode = wxToupper(keyCode); - break; - - default: - keyCode = IsNumberedAccelKey(current, wxTRANSLATE("F"), - WXK_F1, 1, 12); - if ( !keyCode ) - { - for ( size_t n = 0; n < WXSIZEOF(wxKeyNames); n++ ) - { - const wxKeyName& kn = wxKeyNames[n]; - if ( CompareAccelString(current, kn.name) ) - { - keyCode = kn.code; - break; - } - } - } - - if ( !keyCode ) - keyCode = IsNumberedAccelKey(current, wxTRANSLATE("KP_"), - WXK_NUMPAD0, 0, 9); - if ( !keyCode ) - keyCode = IsNumberedAccelKey(current, wxTRANSLATE("SPECIAL"), - WXK_SPECIAL1, 1, 20); - - if ( !keyCode ) - { - wxLogDebug(wxT("Unrecognized accel key '%s', accel string ignored."), - current.c_str()); - return false; - } - } - - - wxASSERT_MSG( keyCode, _T("logic error: should have key code here") ); - - if ( flagsOut ) - *flagsOut = accelFlags; - if ( keyOut ) - *keyOut = keyCode; - - return true; -} - -/* static */ -wxAcceleratorEntry *wxAcceleratorEntry::Create(const wxString& str) -{ - int flags, - keyCode; - if ( !ParseAccel(str, &flags, &keyCode) ) - return NULL; - - return new wxAcceleratorEntry(flags, keyCode); -} - -bool wxAcceleratorEntry::FromString(const wxString& str) -{ - return ParseAccel(str, &m_flags, &m_keyCode); -} - -wxString wxAcceleratorEntry::ToString() const -{ - wxString text; - - int flags = GetFlags(); - if ( flags & wxACCEL_ALT ) - text += _("Alt-"); - if ( flags & wxACCEL_CMD ) - text += _("Ctrl-"); -#ifdef __WXMAC__ - if ( flags & wxACCEL_CTRL ) - text += _("XCtrl-"); -#endif - if ( flags & wxACCEL_SHIFT ) - text += _("Shift-"); - - const int code = GetKeyCode(); - - if ( code >= WXK_F1 && code <= WXK_F12 ) - text << _("F") << code - WXK_F1 + 1; - else if ( code >= WXK_NUMPAD0 && code <= WXK_NUMPAD9 ) - text << _("KP_") << code - WXK_NUMPAD0; - else if ( code >= WXK_SPECIAL1 && code <= WXK_SPECIAL20 ) - text << _("SPECIAL") << code - WXK_SPECIAL1 + 1; - else // check the named keys - { - size_t n; - for ( n = 0; n < WXSIZEOF(wxKeyNames); n++ ) - { - const wxKeyName& kn = wxKeyNames[n]; - if ( code == kn.code ) - { - text << wxGetTranslation(kn.name); - break; - } - } - - if ( n == WXSIZEOF(wxKeyNames) ) - { - // must be a simple key - if ( -#if !wxUSE_UNICODE - isascii(code) && -#endif // ANSI - wxIsalnum(code) ) - { - text << (wxChar)code; - } - else - { - wxFAIL_MSG( wxT("unknown keyboard accelerator code") ); - } - } - } - - return text; -} - -wxAcceleratorEntry *wxGetAccelFromString(const wxString& label) -{ - return wxAcceleratorEntry::Create(label); -} - -#endif // wxUSE_ACCEL - - -// ---------------------------------------------------------------------------- -// wxMenuItem -// ---------------------------------------------------------------------------- - -wxMenuItemBase::wxMenuItemBase(wxMenu *parentMenu, - int id, - const wxString& text, - const wxString& help, - wxItemKind kind, - wxMenu *subMenu) -{ - wxASSERT_MSG( parentMenu != NULL, wxT("menuitem should have a menu") ); - - m_parentMenu = parentMenu; - m_subMenu = subMenu; - m_isEnabled = true; - m_isChecked = false; - m_id = id; - m_kind = kind; - if (m_id == wxID_ANY) - m_id = wxNewId(); - if (m_id == wxID_SEPARATOR) - m_kind = wxITEM_SEPARATOR; - - SetText(text); - SetHelp(help); -} - -wxMenuItemBase::~wxMenuItemBase() -{ - delete m_subMenu; -} - -#if wxUSE_ACCEL - -wxAcceleratorEntry *wxMenuItemBase::GetAccel() const -{ - return wxAcceleratorEntry::Create(GetText()); -} - -void wxMenuItemBase::SetAccel(wxAcceleratorEntry *accel) -{ - wxString text = m_text.BeforeFirst(wxT('\t')); - if ( accel ) - { - text += wxT('\t'); - text += accel->ToString(); - } - - SetText(text); -} - -#endif // wxUSE_ACCEL - -void wxMenuItemBase::SetText(const wxString& str) -{ - m_text = str; - - if ( m_text.empty() && !IsSeparator() ) - { - wxASSERT_MSG( wxIsStockID(GetId()), - wxT("A non-stock menu item with an empty label?") ); - m_text = wxGetStockLabel(GetId(), wxSTOCK_WITH_ACCELERATOR | - wxSTOCK_WITH_MNEMONIC); - } -} - -void wxMenuItemBase::SetHelp(const wxString& str) -{ - m_help = str; - - if ( m_help.empty() && !IsSeparator() && wxIsStockID(GetId()) ) - { - // get a stock help string - m_help = wxGetStockHelpString(GetId()); - } -} - -wxString wxMenuItemBase::GetLabelText(const wxString& label) -{ - return GetLabelFromText(label); -} - -bool wxMenuBase::ms_locked = true; - -// ---------------------------------------------------------------------------- -// wxMenu ctor and dtor -// ---------------------------------------------------------------------------- - -void wxMenuBase::Init(long style) -{ - m_menuBar = (wxMenuBar *)NULL; - m_menuParent = (wxMenu *)NULL; - - m_invokingWindow = (wxWindow *)NULL; - m_style = style; - m_clientData = (void *)NULL; - m_eventHandler = this; -} - -wxMenuBase::~wxMenuBase() -{ - WX_CLEAR_LIST(wxMenuItemList, m_items); -} - -// ---------------------------------------------------------------------------- -// wxMenu item adding/removing -// ---------------------------------------------------------------------------- - -void wxMenuBase::AddSubMenu(wxMenu *submenu) -{ - wxCHECK_RET( submenu, _T("can't add a NULL submenu") ); - - submenu->SetParent((wxMenu *)this); -} - -wxMenuItem* wxMenuBase::DoAppend(wxMenuItem *item) -{ - wxCHECK_MSG( item, NULL, wxT("invalid item in wxMenu::Append()") ); - - m_items.Append(item); - item->SetMenu((wxMenu*)this); - if ( item->IsSubMenu() ) - { - AddSubMenu(item->GetSubMenu()); - } - - return item; -} - -wxMenuItem* wxMenuBase::Insert(size_t pos, wxMenuItem *item) -{ - wxCHECK_MSG( item, NULL, wxT("invalid item in wxMenu::Insert") ); - - if ( pos == GetMenuItemCount() ) - { - return DoAppend(item); - } - else - { - wxCHECK_MSG( pos < GetMenuItemCount(), NULL, - wxT("invalid index in wxMenu::Insert") ); - - return DoInsert(pos, item); - } -} - -wxMenuItem* wxMenuBase::DoInsert(size_t pos, wxMenuItem *item) -{ - wxCHECK_MSG( item, NULL, wxT("invalid item in wxMenu::Insert()") ); - - wxMenuItemList::compatibility_iterator node = m_items.Item(pos); - wxCHECK_MSG( node, NULL, wxT("invalid index in wxMenu::Insert()") ); - - m_items.Insert(node, item); - item->SetMenu((wxMenu*)this); - if ( item->IsSubMenu() ) - { - AddSubMenu(item->GetSubMenu()); - } - - return item; -} - -wxMenuItem *wxMenuBase::Remove(wxMenuItem *item) -{ - wxCHECK_MSG( item, NULL, wxT("invalid item in wxMenu::Remove") ); - - return DoRemove(item); -} - -wxMenuItem *wxMenuBase::DoRemove(wxMenuItem *item) -{ - wxMenuItemList::compatibility_iterator node = m_items.Find(item); - - // if we get here, the item is valid or one of Remove() functions is broken - wxCHECK_MSG( node, NULL, wxT("bug in wxMenu::Remove logic") ); - - // we detach the item, but we do delete the list node (i.e. don't call - // DetachNode() here!) - m_items.Erase(node); - - // item isn't attached to anything any more - item->SetMenu((wxMenu *)NULL); - wxMenu *submenu = item->GetSubMenu(); - if ( submenu ) - { - submenu->SetParent((wxMenu *)NULL); - if ( submenu->IsAttached() ) - submenu->Detach(); - } - - return item; -} - -bool wxMenuBase::Delete(wxMenuItem *item) -{ - wxCHECK_MSG( item, false, wxT("invalid item in wxMenu::Delete") ); - - return DoDelete(item); -} - -bool wxMenuBase::DoDelete(wxMenuItem *item) -{ - wxMenuItem *item2 = DoRemove(item); - wxCHECK_MSG( item2, false, wxT("failed to delete menu item") ); - - // don't delete the submenu - item2->SetSubMenu((wxMenu *)NULL); - - delete item2; - - return true; -} - -bool wxMenuBase::Destroy(wxMenuItem *item) -{ - wxCHECK_MSG( item, false, wxT("invalid item in wxMenu::Destroy") ); - - return DoDestroy(item); -} - -bool wxMenuBase::DoDestroy(wxMenuItem *item) -{ - wxMenuItem *item2 = DoRemove(item); - wxCHECK_MSG( item2, false, wxT("failed to delete menu item") ); - - delete item2; - - return true; -} - -// ---------------------------------------------------------------------------- -// wxMenu searching for items -// ---------------------------------------------------------------------------- - -// Finds the item id matching the given string, wxNOT_FOUND if not found. -int wxMenuBase::FindItem(const wxString& text) const -{ - wxString label = wxMenuItem::GetLabelFromText(text); - for ( wxMenuItemList::compatibility_iterator node = m_items.GetFirst(); - node; - node = node->GetNext() ) - { - wxMenuItem *item = node->GetData(); - if ( item->IsSubMenu() ) - { - int rc = item->GetSubMenu()->FindItem(label); - if ( rc != wxNOT_FOUND ) - return rc; - } - - // we execute this code for submenus as well to alllow finding them by - // name just like the ordinary items - if ( !item->IsSeparator() ) - { - if ( item->GetLabel() == label ) - return item->GetId(); - } - } - - return wxNOT_FOUND; -} - -// recursive search for item by id -wxMenuItem *wxMenuBase::FindItem(int itemId, wxMenu **itemMenu) const -{ - if ( itemMenu ) - *itemMenu = NULL; - - wxMenuItem *item = NULL; - for ( wxMenuItemList::compatibility_iterator node = m_items.GetFirst(); - node && !item; - node = node->GetNext() ) - { - item = node->GetData(); - - if ( item->GetId() == itemId ) - { - if ( itemMenu ) - *itemMenu = (wxMenu *)this; - } - else if ( item->IsSubMenu() ) - { - item = item->GetSubMenu()->FindItem(itemId, itemMenu); - } - else - { - // don't exit the loop - item = NULL; - } - } - - return item; -} - -// non recursive search -wxMenuItem *wxMenuBase::FindChildItem(int id, size_t *ppos) const -{ - wxMenuItem *item = (wxMenuItem *)NULL; - wxMenuItemList::compatibility_iterator node = GetMenuItems().GetFirst(); - - size_t pos; - for ( pos = 0; node; pos++ ) - { - if ( node->GetData()->GetId() == id ) - { - item = node->GetData(); - - break; - } - - node = node->GetNext(); - } - - if ( ppos ) - { - *ppos = item ? pos : (size_t)wxNOT_FOUND; - } - - return item; -} - -// find by position -wxMenuItem* wxMenuBase::FindItemByPosition(size_t position) const -{ - wxCHECK_MSG( position < m_items.GetCount(), NULL, - _T("wxMenu::FindItemByPosition(): invalid menu index") ); - - return m_items.Item( position )->GetData(); -} - -// ---------------------------------------------------------------------------- -// wxMenu helpers used by derived classes -// ---------------------------------------------------------------------------- - -// Update a menu and all submenus recursively. source is the object that has -// the update event handlers defined for it. If NULL, the menu or associated -// window will be used. -void wxMenuBase::UpdateUI(wxEvtHandler* source) -{ - if (GetInvokingWindow()) - { - // Don't update menus if the parent - // frame is about to get deleted - wxWindow *tlw = wxGetTopLevelParent( GetInvokingWindow() ); - if (tlw && wxPendingDelete.Member(tlw)) - return; - } - - if ( !source && GetInvokingWindow() ) - source = GetInvokingWindow()->GetEventHandler(); - if ( !source ) - source = GetEventHandler(); - if ( !source ) - source = this; - - wxMenuItemList::compatibility_iterator node = GetMenuItems().GetFirst(); - while ( node ) - { - wxMenuItem* item = node->GetData(); - if ( !item->IsSeparator() ) - { - wxWindowID id = item->GetId(); - wxUpdateUIEvent event(id); - event.SetEventObject( source ); - - if ( source->ProcessEvent(event) ) - { - // if anything changed, update the changed attribute - if (event.GetSetText()) - SetLabel(id, event.GetText()); - if (event.GetSetChecked()) - Check(id, event.GetChecked()); - if (event.GetSetEnabled()) - Enable(id, event.GetEnabled()); - } - - // recurse to the submenus - if ( item->GetSubMenu() ) - item->GetSubMenu()->UpdateUI(source); - } - //else: item is a separator (which doesn't process update UI events) - - node = node->GetNext(); - } -} - -bool wxMenuBase::SendEvent(int id, int checked) -{ - wxCommandEvent event(wxEVT_COMMAND_MENU_SELECTED, id); - event.SetEventObject(this); - event.SetInt(checked); - - bool processed = false; - - // Try the menu's event handler - // if ( !processed ) - { - wxEvtHandler *handler = GetEventHandler(); - if ( handler ) - processed = handler->ProcessEvent(event); - } - - // Try the window the menu was popped up from (and up through the - // hierarchy) - if ( !processed ) - { - const wxMenuBase *menu = this; - while ( menu ) - { - wxWindow *win = menu->GetInvokingWindow(); - if ( win ) - { - processed = win->GetEventHandler()->ProcessEvent(event); - break; - } - - menu = menu->GetParent(); - } - } - - return processed; -} - -// ---------------------------------------------------------------------------- -// wxMenu attaching/detaching to/from menu bar -// ---------------------------------------------------------------------------- - -wxMenuBar* wxMenuBase::GetMenuBar() const -{ - if(GetParent()) - return GetParent()->GetMenuBar(); - return m_menuBar; -} - -void wxMenuBase::Attach(wxMenuBarBase *menubar) -{ - // use Detach() instead! - wxASSERT_MSG( menubar, _T("menu can't be attached to NULL menubar") ); - - // use IsAttached() to prevent this from happening - wxASSERT_MSG( !m_menuBar, _T("attaching menu twice?") ); - - m_menuBar = (wxMenuBar *)menubar; -} - -void wxMenuBase::Detach() -{ - // use IsAttached() to prevent this from happening - wxASSERT_MSG( m_menuBar, _T("detaching unattached menu?") ); - - m_menuBar = NULL; -} - -// ---------------------------------------------------------------------------- -// wxMenu functions forwarded to wxMenuItem -// ---------------------------------------------------------------------------- - -void wxMenuBase::Enable( int id, bool enable ) -{ - wxMenuItem *item = FindItem(id); - - wxCHECK_RET( item, wxT("wxMenu::Enable: no such item") ); - - item->Enable(enable); -} - -bool wxMenuBase::IsEnabled( int id ) const -{ - wxMenuItem *item = FindItem(id); - - wxCHECK_MSG( item, false, wxT("wxMenu::IsEnabled: no such item") ); - - return item->IsEnabled(); -} - -void wxMenuBase::Check( int id, bool enable ) -{ - wxMenuItem *item = FindItem(id); - - wxCHECK_RET( item, wxT("wxMenu::Check: no such item") ); - - item->Check(enable); -} - -bool wxMenuBase::IsChecked( int id ) const -{ - wxMenuItem *item = FindItem(id); - - wxCHECK_MSG( item, false, wxT("wxMenu::IsChecked: no such item") ); - - return item->IsChecked(); -} - -void wxMenuBase::SetLabel( int id, const wxString &label ) -{ - wxMenuItem *item = FindItem(id); - - wxCHECK_RET( item, wxT("wxMenu::SetLabel: no such item") ); - - item->SetText(label); -} - -wxString wxMenuBase::GetLabel( int id ) const -{ - wxMenuItem *item = FindItem(id); - - wxCHECK_MSG( item, wxEmptyString, wxT("wxMenu::GetLabel: no such item") ); - - return item->GetText(); -} - -void wxMenuBase::SetHelpString( int id, const wxString& helpString ) -{ - wxMenuItem *item = FindItem(id); - - wxCHECK_RET( item, wxT("wxMenu::SetHelpString: no such item") ); - - item->SetHelp( helpString ); -} - -wxString wxMenuBase::GetHelpString( int id ) const -{ - wxMenuItem *item = FindItem(id); - - wxCHECK_MSG( item, wxEmptyString, wxT("wxMenu::GetHelpString: no such item") ); - - return item->GetHelp(); -} - -// ---------------------------------------------------------------------------- -// wxMenuBarBase ctor and dtor -// ---------------------------------------------------------------------------- - -wxMenuBarBase::wxMenuBarBase() -{ - // not attached yet - m_menuBarFrame = NULL; -} - -wxMenuBarBase::~wxMenuBarBase() -{ - WX_CLEAR_LIST(wxMenuList, m_menus); -} - -// ---------------------------------------------------------------------------- -// wxMenuBar item access: the base class versions manage m_menus list, the -// derived class should reflect the changes in the real menubar -// ---------------------------------------------------------------------------- - -wxMenu *wxMenuBarBase::GetMenu(size_t pos) const -{ - wxMenuList::compatibility_iterator node = m_menus.Item(pos); - wxCHECK_MSG( node, NULL, wxT("bad index in wxMenuBar::GetMenu()") ); - - return node->GetData(); -} - -bool wxMenuBarBase::Append(wxMenu *menu, const wxString& WXUNUSED(title)) -{ - wxCHECK_MSG( menu, false, wxT("can't append NULL menu") ); - - m_menus.Append(menu); - menu->Attach(this); - - return true; -} - -bool wxMenuBarBase::Insert(size_t pos, wxMenu *menu, - const wxString& title) -{ - if ( pos == m_menus.GetCount() ) - { - return wxMenuBarBase::Append(menu, title); - } - else // not at the end - { - wxCHECK_MSG( menu, false, wxT("can't insert NULL menu") ); - - wxMenuList::compatibility_iterator node = m_menus.Item(pos); - wxCHECK_MSG( node, false, wxT("bad index in wxMenuBar::Insert()") ); - - m_menus.Insert(node, menu); - menu->Attach(this); - - return true; - } -} - -wxMenu *wxMenuBarBase::Replace(size_t pos, wxMenu *menu, - const wxString& WXUNUSED(title)) -{ - wxCHECK_MSG( menu, NULL, wxT("can't insert NULL menu") ); - - wxMenuList::compatibility_iterator node = m_menus.Item(pos); - wxCHECK_MSG( node, NULL, wxT("bad index in wxMenuBar::Replace()") ); - - wxMenu *menuOld = node->GetData(); - node->SetData(menu); - - menu->Attach(this); - menuOld->Detach(); - - return menuOld; -} - -wxMenu *wxMenuBarBase::Remove(size_t pos) -{ - wxMenuList::compatibility_iterator node = m_menus.Item(pos); - wxCHECK_MSG( node, NULL, wxT("bad index in wxMenuBar::Remove()") ); - - wxMenu *menu = node->GetData(); - m_menus.Erase(node); - menu->Detach(); - - return menu; -} - -int wxMenuBarBase::FindMenu(const wxString& title) const -{ - wxString label = wxMenuItem::GetLabelFromText(title); - - size_t count = GetMenuCount(); - for ( size_t i = 0; i < count; i++ ) - { - wxString title2 = GetLabelTop(i); - if ( (title2 == title) || - (wxMenuItem::GetLabelFromText(title2) == label) ) - { - // found - return (int)i; - } - } - - return wxNOT_FOUND; - -} - -// ---------------------------------------------------------------------------- -// wxMenuBar attaching/detaching to/from the frame -// ---------------------------------------------------------------------------- - -void wxMenuBarBase::Attach(wxFrame *frame) -{ - wxASSERT_MSG( !IsAttached(), wxT("menubar already attached!") ); - - m_menuBarFrame = frame; -} - -void wxMenuBarBase::Detach() -{ - wxASSERT_MSG( IsAttached(), wxT("detaching unattached menubar") ); - - m_menuBarFrame = NULL; -} - -// ---------------------------------------------------------------------------- -// wxMenuBar searching for items -// ---------------------------------------------------------------------------- - -wxMenuItem *wxMenuBarBase::FindItem(int id, wxMenu **menu) const -{ - if ( menu ) - *menu = NULL; - - wxMenuItem *item = NULL; - size_t count = GetMenuCount(), i; - wxMenuList::const_iterator it; - for ( i = 0, it = m_menus.begin(); !item && (i < count); i++, it++ ) - { - item = (*it)->FindItem(id, menu); - } - - return item; -} - -int wxMenuBarBase::FindMenuItem(const wxString& menu, const wxString& item) const -{ - wxString label = wxMenuItem::GetLabelFromText(menu); - - int i = 0; - wxMenuList::compatibility_iterator node; - for ( node = m_menus.GetFirst(); node; node = node->GetNext(), i++ ) - { - if ( label == wxMenuItem::GetLabelFromText(GetLabelTop(i)) ) - return node->GetData()->FindItem(item); - } - - return wxNOT_FOUND; -} - -// --------------------------------------------------------------------------- -// wxMenuBar functions forwarded to wxMenuItem -// --------------------------------------------------------------------------- - -void wxMenuBarBase::Enable(int id, bool enable) -{ - wxMenuItem *item = FindItem(id); - - wxCHECK_RET( item, wxT("attempt to enable an item which doesn't exist") ); - - item->Enable(enable); -} - -void wxMenuBarBase::Check(int id, bool check) -{ - wxMenuItem *item = FindItem(id); - - wxCHECK_RET( item, wxT("attempt to check an item which doesn't exist") ); - wxCHECK_RET( item->IsCheckable(), wxT("attempt to check an uncheckable item") ); - - item->Check(check); -} - -bool wxMenuBarBase::IsChecked(int id) const -{ - wxMenuItem *item = FindItem(id); - - wxCHECK_MSG( item, false, wxT("wxMenuBar::IsChecked(): no such item") ); - - return item->IsChecked(); -} - -bool wxMenuBarBase::IsEnabled(int id) const -{ - wxMenuItem *item = FindItem(id); - - wxCHECK_MSG( item, false, wxT("wxMenuBar::IsEnabled(): no such item") ); - - return item->IsEnabled(); -} - -void wxMenuBarBase::SetLabel(int id, const wxString& label) -{ - wxMenuItem *item = FindItem(id); - - wxCHECK_RET( item, wxT("wxMenuBar::SetLabel(): no such item") ); - - item->SetText(label); -} - -wxString wxMenuBarBase::GetLabel(int id) const -{ - wxMenuItem *item = FindItem(id); - - wxCHECK_MSG( item, wxEmptyString, - wxT("wxMenuBar::GetLabel(): no such item") ); - - return item->GetText(); -} - -void wxMenuBarBase::SetHelpString(int id, const wxString& helpString) -{ - wxMenuItem *item = FindItem(id); - - wxCHECK_RET( item, wxT("wxMenuBar::SetHelpString(): no such item") ); - - item->SetHelp(helpString); -} - -wxString wxMenuBarBase::GetHelpString(int id) const -{ - wxMenuItem *item = FindItem(id); - - wxCHECK_MSG( item, wxEmptyString, - wxT("wxMenuBar::GetHelpString(): no such item") ); - - return item->GetHelp(); -} - -void wxMenuBarBase::UpdateMenus( void ) -{ - wxEvtHandler* source; - wxMenu* menu; - int nCount = GetMenuCount(); - for (int n = 0; n < nCount; n++) - { - menu = GetMenu( n ); - if (menu != NULL) - { - source = menu->GetEventHandler(); - if (source != NULL) - menu->UpdateUI( source ); - } - } -} - -// Get the text only, from the label -wxString wxMenuBarBase::GetMenuLabelText(size_t pos) const -{ - return wxMenuItem::GetLabelText(((wxMenuBar*)this)->GetMenuLabel(pos)); -} - - -#endif // wxUSE_MENUS diff --git a/wxWidgets/src/common/mimecmn.cpp b/wxWidgets/src/common/mimecmn.cpp deleted file mode 100644 index 8f914e3472..0000000000 --- a/wxWidgets/src/common/mimecmn.cpp +++ /dev/null @@ -1,752 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/common/mimecmn.cpp -// Purpose: classes and functions to manage MIME types -// Author: Vadim Zeitlin -// Modified by: -// Chris Elliott (biol75@york.ac.uk) 5 Dec 00: write support for Win32 -// Created: 23.09.98 -// RCS-ID: $Id: mimecmn.cpp 47027 2007-06-29 18:23:39Z VZ $ -// Copyright: (c) 1998 Vadim Zeitlin -// Licence: wxWindows licence (part of wxExtra library) -///////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -// for compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_MIMETYPE - -#include "wx/mimetype.h" - -#ifndef WX_PRECOMP - #include "wx/dynarray.h" - #include "wx/string.h" - #include "wx/intl.h" - #include "wx/log.h" - #include "wx/module.h" -#endif //WX_PRECOMP - -#include "wx/file.h" -#include "wx/iconloc.h" -#include "wx/confbase.h" - -// other standard headers -#include - -// implementation classes: -#if defined(__WXMSW__) - #include "wx/msw/mimetype.h" -#elif defined(__WXMAC__) - #include "wx/mac/mimetype.h" -#elif defined(__WXPM__) || defined (__EMX__) - #include "wx/os2/mimetype.h" - #undef __UNIX__ -#elif defined(__DOS__) - #include "wx/msdos/mimetype.h" -#else // Unix - #include "wx/unix/mimetype.h" -#endif - -// ============================================================================ -// common classes -// ============================================================================ - -// ---------------------------------------------------------------------------- -// wxMimeTypeCommands -// ---------------------------------------------------------------------------- - -void -wxMimeTypeCommands::AddOrReplaceVerb(const wxString& verb, const wxString& cmd) -{ - int n = m_verbs.Index(verb, false /* ignore case */); - if ( n == wxNOT_FOUND ) - { - m_verbs.Add(verb); - m_commands.Add(cmd); - } - else - { - m_commands[n] = cmd; - } -} - -wxString -wxMimeTypeCommands::GetCommandForVerb(const wxString& verb, size_t *idx) const -{ - wxString s; - - int n = m_verbs.Index(verb); - if ( n != wxNOT_FOUND ) - { - s = m_commands[(size_t)n]; - if ( idx ) - *idx = n; - } - else if ( idx ) - { - // different from any valid index - *idx = (size_t)-1; - } - - return s; -} - -wxString wxMimeTypeCommands::GetVerbCmd(size_t n) const -{ - return m_verbs[n] + wxT('=') + m_commands[n]; -} - -// ---------------------------------------------------------------------------- -// wxFileTypeInfo -// ---------------------------------------------------------------------------- - -wxFileTypeInfo::wxFileTypeInfo(const wxChar *mimeType, - const wxChar *openCmd, - const wxChar *printCmd, - const wxChar *desc, - ...) - : m_mimeType(mimeType), - m_openCmd(openCmd), - m_printCmd(printCmd), - m_desc(desc) -{ - va_list argptr; - va_start(argptr, desc); - - for ( ;; ) - { - // icc gives this warning in its own va_arg() macro, argh -#ifdef __INTELC__ - #pragma warning(push) - #pragma warning(disable: 1684) -#endif - - const wxChar *ext = va_arg(argptr, const wxChar *); - -#ifdef __INTELC__ - #pragma warning(pop) -#endif - if ( !ext ) - { - // NULL terminates the list - break; - } - - m_exts.Add(ext); - } - - va_end(argptr); -} - - -wxFileTypeInfo::wxFileTypeInfo(const wxArrayString& sArray) -{ - m_mimeType = sArray [0u]; - m_openCmd = sArray [1u]; - m_printCmd = sArray [2u]; - m_desc = sArray [3u]; - - size_t count = sArray.GetCount(); - for ( size_t i = 4; i < count; i++ ) - { - m_exts.Add(sArray[i]); - } -} - -#include "wx/arrimpl.cpp" -WX_DEFINE_OBJARRAY(wxArrayFileTypeInfo) - -// ============================================================================ -// implementation of the wrapper classes -// ============================================================================ - -// ---------------------------------------------------------------------------- -// wxFileType -// ---------------------------------------------------------------------------- - -/* static */ -wxString wxFileType::ExpandCommand(const wxString& command, - const wxFileType::MessageParameters& params) -{ - bool hasFilename = false; - - wxString str; - for ( const wxChar *pc = command.c_str(); *pc != wxT('\0'); pc++ ) { - if ( *pc == wxT('%') ) { - switch ( *++pc ) { - case wxT('s'): - // '%s' expands into file name (quoted because it might - // contain spaces) - except if there are already quotes - // there because otherwise some programs may get confused - // by double double quotes -#if 0 - if ( *(pc - 2) == wxT('"') ) - str << params.GetFileName(); - else - str << wxT('"') << params.GetFileName() << wxT('"'); -#endif - str << params.GetFileName(); - hasFilename = true; - break; - - case wxT('t'): - // '%t' expands into MIME type (quote it too just to be - // consistent) - str << wxT('\'') << params.GetMimeType() << wxT('\''); - break; - - case wxT('{'): - { - const wxChar *pEnd = wxStrchr(pc, wxT('}')); - if ( pEnd == NULL ) { - wxString mimetype; - wxLogWarning(_("Unmatched '{' in an entry for mime type %s."), - params.GetMimeType().c_str()); - str << wxT("%{"); - } - else { - wxString param(pc + 1, pEnd - pc - 1); - str << wxT('\'') << params.GetParamValue(param) << wxT('\''); - pc = pEnd; - } - } - break; - - case wxT('n'): - case wxT('F'): - // TODO %n is the number of parts, %F is an array containing - // the names of temp files these parts were written to - // and their mime types. - break; - - default: - wxLogDebug(wxT("Unknown field %%%c in command '%s'."), - *pc, command.c_str()); - str << *pc; - } - } - else { - str << *pc; - } - } - - // metamail(1) man page states that if the mailcap entry doesn't have '%s' - // the program will accept the data on stdin so normally we should append - // "< %s" to the end of the command in such case, but not all commands - // behave like this, in particular a common test is 'test -n "$DISPLAY"' - // and appending "< %s" to this command makes the test fail... I don't - // know of the correct solution, try to guess what we have to do. - - // test now carried out on reading file so test should never get here - if ( !hasFilename && !str.empty() -#ifdef __UNIX__ - && !str.StartsWith(_T("test ")) -#endif // Unix - ) { - str << wxT(" < '") << params.GetFileName() << wxT('\''); - } - - return str; -} - -wxFileType::wxFileType(const wxFileTypeInfo& info) -{ - m_info = &info; - m_impl = NULL; -} - -wxFileType::wxFileType() -{ - m_info = NULL; - m_impl = new wxFileTypeImpl; -} - -wxFileType::~wxFileType() -{ - if ( m_impl ) - delete m_impl; -} - -bool wxFileType::GetExtensions(wxArrayString& extensions) -{ - if ( m_info ) - { - extensions = m_info->GetExtensions(); - return true; - } - - return m_impl->GetExtensions(extensions); -} - -bool wxFileType::GetMimeType(wxString *mimeType) const -{ - wxCHECK_MSG( mimeType, false, _T("invalid parameter in GetMimeType") ); - - if ( m_info ) - { - *mimeType = m_info->GetMimeType(); - - return true; - } - - return m_impl->GetMimeType(mimeType); -} - -bool wxFileType::GetMimeTypes(wxArrayString& mimeTypes) const -{ - if ( m_info ) - { - mimeTypes.Clear(); - mimeTypes.Add(m_info->GetMimeType()); - - return true; - } - - return m_impl->GetMimeTypes(mimeTypes); -} - -bool wxFileType::GetIcon(wxIconLocation *iconLoc) const -{ - if ( m_info ) - { - if ( iconLoc ) - { - iconLoc->SetFileName(m_info->GetIconFile()); -#ifdef __WXMSW__ - iconLoc->SetIndex(m_info->GetIconIndex()); -#endif // __WXMSW__ - } - - return true; - } - - return m_impl->GetIcon(iconLoc); -} - -bool -wxFileType::GetIcon(wxIconLocation *iconloc, - const MessageParameters& params) const -{ - if ( !GetIcon(iconloc) ) - { - return false; - } - - // we may have "%s" in the icon location string, at least under Windows, so - // expand this - if ( iconloc ) - { - iconloc->SetFileName(ExpandCommand(iconloc->GetFileName(), params)); - } - - return true; -} - -bool wxFileType::GetDescription(wxString *desc) const -{ - wxCHECK_MSG( desc, false, _T("invalid parameter in GetDescription") ); - - if ( m_info ) - { - *desc = m_info->GetDescription(); - - return true; - } - - return m_impl->GetDescription(desc); -} - -bool -wxFileType::GetOpenCommand(wxString *openCmd, - const wxFileType::MessageParameters& params) const -{ - wxCHECK_MSG( openCmd, false, _T("invalid parameter in GetOpenCommand") ); - - if ( m_info ) - { - *openCmd = ExpandCommand(m_info->GetOpenCommand(), params); - - return true; - } - - return m_impl->GetOpenCommand(openCmd, params); -} - -wxString wxFileType::GetOpenCommand(const wxString& filename) const -{ - wxString cmd; - if ( !GetOpenCommand(&cmd, filename) ) - { - // return empty string to indicate an error - cmd.clear(); - } - - return cmd; -} - -bool -wxFileType::GetPrintCommand(wxString *printCmd, - const wxFileType::MessageParameters& params) const -{ - wxCHECK_MSG( printCmd, false, _T("invalid parameter in GetPrintCommand") ); - - if ( m_info ) - { - *printCmd = ExpandCommand(m_info->GetPrintCommand(), params); - - return true; - } - - return m_impl->GetPrintCommand(printCmd, params); -} - - -size_t wxFileType::GetAllCommands(wxArrayString *verbs, - wxArrayString *commands, - const wxFileType::MessageParameters& params) const -{ - if ( verbs ) - verbs->Clear(); - if ( commands ) - commands->Clear(); - -#if defined (__WXMSW__) || defined(__UNIX__) - return m_impl->GetAllCommands(verbs, commands, params); -#else // !__WXMSW__ || Unix - // we don't know how to retrieve all commands, so just try the 2 we know - // about - size_t count = 0; - wxString cmd; - if ( GetOpenCommand(&cmd, params) ) - { - if ( verbs ) - verbs->Add(_T("Open")); - if ( commands ) - commands->Add(cmd); - count++; - } - - if ( GetPrintCommand(&cmd, params) ) - { - if ( verbs ) - verbs->Add(_T("Print")); - if ( commands ) - commands->Add(cmd); - - count++; - } - - return count; -#endif // __WXMSW__/| __UNIX__ -} - -bool wxFileType::Unassociate() -{ -#if defined(__WXMSW__) - return m_impl->Unassociate(); -#elif defined(__UNIX__) - return m_impl->Unassociate(this); -#else - wxFAIL_MSG( _T("not implemented") ); // TODO - return false; -#endif -} - -bool wxFileType::SetCommand(const wxString& cmd, - const wxString& verb, - bool overwriteprompt) -{ -#if defined (__WXMSW__) || defined(__UNIX__) - return m_impl->SetCommand(cmd, verb, overwriteprompt); -#else - wxUnusedVar(cmd); - wxUnusedVar(verb); - wxUnusedVar(overwriteprompt); - wxFAIL_MSG(_T("not implemented")); - return false; -#endif -} - -bool wxFileType::SetDefaultIcon(const wxString& cmd, int index) -{ - wxString sTmp = cmd; -#ifdef __WXMSW__ - // VZ: should we do this? - // chris elliott : only makes sense in MS windows - if ( sTmp.empty() ) - GetOpenCommand(&sTmp, wxFileType::MessageParameters(wxEmptyString, wxEmptyString)); -#endif - wxCHECK_MSG( !sTmp.empty(), false, _T("need the icon file") ); - -#if defined (__WXMSW__) || defined(__UNIX__) - return m_impl->SetDefaultIcon (cmd, index); -#else - wxUnusedVar(index); - wxFAIL_MSG(_T("not implemented")); - return false; -#endif -} - -// ---------------------------------------------------------------------------- -// wxMimeTypesManagerFactory -// ---------------------------------------------------------------------------- - -wxMimeTypesManagerFactory *wxMimeTypesManagerFactory::m_factory = NULL; - -/* static */ -void wxMimeTypesManagerFactory::Set(wxMimeTypesManagerFactory *factory) -{ - delete m_factory; - - m_factory = factory; -} - -/* static */ -wxMimeTypesManagerFactory *wxMimeTypesManagerFactory::Get() -{ - if ( !m_factory ) - m_factory = new wxMimeTypesManagerFactory; - - return m_factory; -} - -wxMimeTypesManagerImpl *wxMimeTypesManagerFactory::CreateMimeTypesManagerImpl() -{ - return new wxMimeTypesManagerImpl; -} - -// ---------------------------------------------------------------------------- -// wxMimeTypesManager -// ---------------------------------------------------------------------------- - -void wxMimeTypesManager::EnsureImpl() -{ - if ( !m_impl ) - m_impl = wxMimeTypesManagerFactory::Get()->CreateMimeTypesManagerImpl(); -} - -bool wxMimeTypesManager::IsOfType(const wxString& mimeType, - const wxString& wildcard) -{ - wxASSERT_MSG( mimeType.Find(wxT('*')) == wxNOT_FOUND, - wxT("first MIME type can't contain wildcards") ); - - // all comparaisons are case insensitive (2nd arg of IsSameAs() is false) - if ( wildcard.BeforeFirst(wxT('/')). - IsSameAs(mimeType.BeforeFirst(wxT('/')), false) ) - { - wxString strSubtype = wildcard.AfterFirst(wxT('/')); - - if ( strSubtype == wxT("*") || - strSubtype.IsSameAs(mimeType.AfterFirst(wxT('/')), false) ) - { - // matches (either exactly or it's a wildcard) - return true; - } - } - - return false; -} - -wxMimeTypesManager::wxMimeTypesManager() -{ - m_impl = NULL; -} - -wxMimeTypesManager::~wxMimeTypesManager() -{ - if ( m_impl ) - delete m_impl; -} - -bool wxMimeTypesManager::Unassociate(wxFileType *ft) -{ - EnsureImpl(); - -#if defined(__UNIX__) && !defined(__CYGWIN__) && !defined(__WINE__) - return m_impl->Unassociate(ft); -#else - return ft->Unassociate(); -#endif -} - - -wxFileType * -wxMimeTypesManager::Associate(const wxFileTypeInfo& ftInfo) -{ - EnsureImpl(); - -#if defined(__WXMSW__) || defined(__UNIX__) - return m_impl->Associate(ftInfo); -#else // other platforms - wxUnusedVar(ftInfo); - wxFAIL_MSG( _T("not implemented") ); // TODO - return NULL; -#endif // platforms -} - -wxFileType * -wxMimeTypesManager::GetFileTypeFromExtension(const wxString& ext) -{ - EnsureImpl(); - - wxString::const_iterator i = ext.begin(); - const wxString::const_iterator end = ext.end(); - wxString extWithoutDot; - if ( i != end && *i == '.' ) - extWithoutDot.assign(++i, ext.end()); - else - extWithoutDot = ext; - - wxCHECK_MSG( !ext.empty(), NULL, _T("extension can't be empty") ); - - wxFileType *ft = m_impl->GetFileTypeFromExtension(extWithoutDot); - - if ( !ft ) { - // check the fallbacks - // - // TODO linear search is potentially slow, perhaps we should use a - // sorted array? - size_t count = m_fallbacks.GetCount(); - for ( size_t n = 0; n < count; n++ ) { - if ( m_fallbacks[n].GetExtensions().Index(ext) != wxNOT_FOUND ) { - ft = new wxFileType(m_fallbacks[n]); - - break; - } - } - } - - return ft; -} - -wxFileType * -wxMimeTypesManager::GetFileTypeFromMimeType(const wxString& mimeType) -{ - EnsureImpl(); - wxFileType *ft = m_impl->GetFileTypeFromMimeType(mimeType); - - if ( !ft ) { - // check the fallbacks - // - // TODO linear search is potentially slow, perhaps we should use a - // sorted array? - size_t count = m_fallbacks.GetCount(); - for ( size_t n = 0; n < count; n++ ) { - if ( wxMimeTypesManager::IsOfType(mimeType, - m_fallbacks[n].GetMimeType()) ) { - ft = new wxFileType(m_fallbacks[n]); - - break; - } - } - } - - return ft; -} - -bool wxMimeTypesManager::ReadMailcap(const wxString& filename, bool fallback) -{ - EnsureImpl(); - return m_impl->ReadMailcap(filename, fallback); -} - -bool wxMimeTypesManager::ReadMimeTypes(const wxString& filename) -{ - EnsureImpl(); - return m_impl->ReadMimeTypes(filename); -} - -void wxMimeTypesManager::AddFallbacks(const wxFileTypeInfo *filetypes) -{ - EnsureImpl(); - for ( const wxFileTypeInfo *ft = filetypes; ft && ft->IsValid(); ft++ ) { - AddFallback(*ft); - } -} - -size_t wxMimeTypesManager::EnumAllFileTypes(wxArrayString& mimetypes) -{ - EnsureImpl(); - size_t countAll = m_impl->EnumAllFileTypes(mimetypes); - - // add the fallback filetypes - size_t count = m_fallbacks.GetCount(); - for ( size_t n = 0; n < count; n++ ) { - if ( mimetypes.Index(m_fallbacks[n].GetMimeType()) == wxNOT_FOUND ) { - mimetypes.Add(m_fallbacks[n].GetMimeType()); - countAll++; - } - } - - return countAll; -} - -void wxMimeTypesManager::Initialize(int mcapStyle, - const wxString& sExtraDir) -{ -#if defined(__UNIX__) && !defined(__CYGWIN__) && !defined(__WINE__) - EnsureImpl(); - - m_impl->Initialize(mcapStyle, sExtraDir); -#else - (void)mcapStyle; - (void)sExtraDir; -#endif // Unix -} - -// and this function clears all the data from the manager -void wxMimeTypesManager::ClearData() -{ -#if defined(__UNIX__) && !defined(__CYGWIN__) && !defined(__WINE__) - EnsureImpl(); - - m_impl->ClearData(); -#endif // Unix -} - -// ---------------------------------------------------------------------------- -// global data and wxMimeTypeCmnModule -// ---------------------------------------------------------------------------- - -// private object -static wxMimeTypesManager gs_mimeTypesManager; - -// and public pointer -wxMimeTypesManager *wxTheMimeTypesManager = &gs_mimeTypesManager; - -class wxMimeTypeCmnModule: public wxModule -{ -public: - wxMimeTypeCmnModule() : wxModule() { } - - virtual bool OnInit() { return true; } - virtual void OnExit() - { - wxMimeTypesManagerFactory::Set(NULL); - - if ( gs_mimeTypesManager.m_impl != NULL ) - { - delete gs_mimeTypesManager.m_impl; - gs_mimeTypesManager.m_impl = NULL; - gs_mimeTypesManager.m_fallbacks.Clear(); - } - } - - DECLARE_DYNAMIC_CLASS(wxMimeTypeCmnModule) -}; - -IMPLEMENT_DYNAMIC_CLASS(wxMimeTypeCmnModule, wxModule) - -#endif // wxUSE_MIMETYPE diff --git a/wxWidgets/src/common/module.cpp b/wxWidgets/src/common/module.cpp deleted file mode 100644 index d4d963b631..0000000000 --- a/wxWidgets/src/common/module.cpp +++ /dev/null @@ -1,202 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/common/module.cpp -// Purpose: Modules initialization/destruction -// Author: Wolfram Gloger/adapted by Guilhem Lavaux -// Modified by: -// Created: 04/11/98 -// RCS-ID: $Id: module.cpp 39677 2006-06-11 22:19:12Z VZ $ -// Copyright: (c) Wolfram Gloger and Guilhem Lavaux -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#include "wx/module.h" - -#ifndef WX_PRECOMP - #include "wx/hash.h" - #include "wx/intl.h" - #include "wx/log.h" -#endif - -#include "wx/listimpl.cpp" - -#define TRACE_MODULE _T("module") - -WX_DEFINE_LIST(wxModuleList) - -IMPLEMENT_CLASS(wxModule, wxObject) - -wxModuleList wxModule::m_modules; - -void wxModule::RegisterModule(wxModule* module) -{ - module->m_state = State_Registered; - m_modules.Append(module); -} - -void wxModule::UnregisterModule(wxModule* module) -{ - m_modules.DeleteObject(module); - delete module; -} - -// Collect up all module-derived classes, create an instance of each, -// and register them. -void wxModule::RegisterModules() -{ - wxHashTable::compatibility_iterator node; - wxClassInfo* classInfo; - - wxClassInfo::sm_classTable->BeginFind(); - node = wxClassInfo::sm_classTable->Next(); - while (node) - { - classInfo = (wxClassInfo *)node->GetData(); - if ( classInfo->IsKindOf(CLASSINFO(wxModule)) && - (classInfo != (& (wxModule::ms_classInfo))) ) - { - wxLogTrace(TRACE_MODULE, wxT("Registering module %s"), - classInfo->GetClassName()); - wxModule* module = (wxModule *)classInfo->CreateObject(); - RegisterModule(module); - } - node = wxClassInfo::sm_classTable->Next(); - } -} - -bool wxModule::DoInitializeModule(wxModule *module, - wxModuleList &initializedModules) -{ - if ( module->m_state == State_Initializing ) - { - wxLogError(_("Circular dependency involving module \"%s\" detected."), - module->GetClassInfo()->GetClassName()); - return false; - } - - module->m_state = State_Initializing; - - const wxArrayClassInfo& dependencies = module->m_dependencies; - - // satisfy module dependencies by loading them before the current module - for ( unsigned int i = 0; i < dependencies.size(); ++i ) - { - wxClassInfo * cinfo = dependencies[i]; - - // Check if the module is already initialized - wxModuleList::compatibility_iterator node; - for ( node = initializedModules.GetFirst(); node; node = node->GetNext() ) - { - if ( node->GetData()->GetClassInfo() == cinfo ) - break; - } - - if ( node ) - { - // this dependency is already initialized, nothing to do - continue; - } - - // find the module in the registered modules list - for ( node = m_modules.GetFirst(); node; node = node->GetNext() ) - { - wxModule *moduleDep = node->GetData(); - if ( moduleDep->GetClassInfo() == cinfo ) - { - if ( !DoInitializeModule(moduleDep, initializedModules ) ) - { - // failed to initialize a dependency, so fail this one too - return false; - } - - break; - } - } - - if ( !node ) - { - wxLogError(_("Dependency \"%s\" of module \"%s\" doesn't exist."), - cinfo->GetClassName(), - module->GetClassInfo()->GetClassName()); - return false; - } - } - - if ( !module->Init() ) - { - wxLogError(_("Module \"%s\" initialization failed"), - module->GetClassInfo()->GetClassName()); - return false; - } - - wxLogTrace(TRACE_MODULE, wxT("Module \"%s\" initialized"), - module->GetClassInfo()->GetClassName()); - - module->m_state = State_Initialized; - initializedModules.Append(module); - - return true; -} - -// Initialize user-defined modules -bool wxModule::InitializeModules() -{ - wxModuleList initializedModules; - - for ( wxModuleList::compatibility_iterator node = m_modules.GetFirst(); - node; - node = node->GetNext() ) - { - wxModule *module = node->GetData(); - - // the module could have been already initialized as dependency of - // another one - if ( module->m_state == State_Registered ) - { - if ( !DoInitializeModule( module, initializedModules ) ) - { - // failed to initialize all modules, so clean up the already - // initialized ones - DoCleanUpModules(initializedModules); - - return false; - } - } - } - - // remember the real initialisation order - m_modules = initializedModules; - - return true; -} - -// Clean up all currently initialized modules -void wxModule::DoCleanUpModules(const wxModuleList& modules) -{ - // cleanup user-defined modules in the reverse order compared to their - // initialization -- this ensures that dependencies are respected - for ( wxModuleList::compatibility_iterator node = modules.GetLast(); - node; - node = node->GetPrevious() ) - { - wxLogTrace(TRACE_MODULE, wxT("Cleanup module %s"), - node->GetData()->GetClassInfo()->GetClassName()); - - wxModule * module = node->GetData(); - - wxASSERT_MSG( module->m_state == State_Initialized, - _T("not initialized module being cleaned up") ); - - module->Exit(); - module->m_state = State_Registered; - } - - // clear all modules, even the non-initialized ones - WX_CLEAR_LIST(wxModuleList, m_modules); -} diff --git a/wxWidgets/src/common/msgout.cpp b/wxWidgets/src/common/msgout.cpp deleted file mode 100644 index ebeed13be0..0000000000 --- a/wxWidgets/src/common/msgout.cpp +++ /dev/null @@ -1,222 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/common/msgout.cpp -// Purpose: wxMessageOutput implementation -// Author: Mattia Barbon -// Modified by: -// Created: 17.07.02 -// RCS-ID: $Id: msgout.cpp 38920 2006-04-26 08:21:31Z ABX $ -// Copyright: (c) the wxWidgets team -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declarations -// ============================================================================ - -// --------------------------------------------------------------------------- -// headers -// --------------------------------------------------------------------------- - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#if defined(__BORLANDC__) - #pragma hdrstop -#endif - -#ifndef WX_PRECOMP - #include "wx/string.h" - #include "wx/ffile.h" - #include "wx/app.h" - #include "wx/intl.h" - #include "wx/log.h" - #if wxUSE_GUI - #include "wx/msgdlg.h" - #endif // wxUSE_GUI -#endif - -#include "wx/msgout.h" -#include "wx/apptrait.h" -#include -#include - -#if defined(__WINDOWS__) - #include "wx/msw/private.h" -#endif -#ifdef __WXMAC__ - #include "wx/mac/private.h" -#endif - -// =========================================================================== -// implementation -// =========================================================================== - -#if wxUSE_BASE - -// ---------------------------------------------------------------------------- -// wxMessageOutput -// ---------------------------------------------------------------------------- - -wxMessageOutput* wxMessageOutput::ms_msgOut = 0; - -wxMessageOutput* wxMessageOutput::Get() -{ - if ( !ms_msgOut && wxTheApp ) - { - ms_msgOut = wxTheApp->GetTraits()->CreateMessageOutput(); - } - - return ms_msgOut; -} - -wxMessageOutput* wxMessageOutput::Set(wxMessageOutput* msgout) -{ - wxMessageOutput* old = ms_msgOut; - ms_msgOut = msgout; - return old; -} - -// ---------------------------------------------------------------------------- -// wxMessageOutputBest -// ---------------------------------------------------------------------------- - -#ifdef __WINDOWS__ - -// check if we're running in a console under Windows -static inline bool IsInConsole() -{ -#ifdef __WXWINCE__ - return false; -#else // !__WXWINCE__ - HANDLE hStdErr = ::GetStdHandle(STD_ERROR_HANDLE); - return hStdErr && hStdErr != INVALID_HANDLE_VALUE; -#endif // __WXWINCE__/!__WXWINCE__ -} - -#endif // __WINDOWS__ - -void wxMessageOutputBest::Printf(const wxChar* format, ...) -{ - va_list args; - va_start(args, format); - wxString out; - - out.PrintfV(format, args); - va_end(args); - -#ifdef __WINDOWS__ - if ( !IsInConsole() ) - { - ::MessageBox(NULL, out, _T("wxWidgets"), MB_ICONINFORMATION | MB_OK); - } - else -#endif // __WINDOWS__/!__WINDOWS__ - { - fprintf(stderr, "%s", (const char*) out.mb_str()); - } -} - -// ---------------------------------------------------------------------------- -// wxMessageOutputStderr -// ---------------------------------------------------------------------------- - -void wxMessageOutputStderr::Printf(const wxChar* format, ...) -{ - va_list args; - va_start(args, format); - wxString out; - - out.PrintfV(format, args); - va_end(args); - - fprintf(stderr, "%s", (const char*) out.mb_str()); -} - -// ---------------------------------------------------------------------------- -// wxMessageOutputDebug -// ---------------------------------------------------------------------------- - -void wxMessageOutputDebug::Printf(const wxChar* format, ...) -{ - wxString out; - - va_list args; - va_start(args, format); - - out.PrintfV(format, args); - va_end(args); - -#if defined(__WXMSW__) && !defined(__WXMICROWIN__) - out.Replace(wxT("\t"), wxT(" ")); - out.Replace(wxT("\n"), wxT("\r\n")); - ::OutputDebugString(out); -#elif defined(__WXMAC__) && !defined(__DARWIN__) - if ( wxIsDebuggerRunning() ) - { - Str255 pstr; - wxString output = out + wxT(";g") ; - wxMacStringToPascal(output.c_str(), pstr); - - #ifdef __powerc - DebugStr(pstr); - #else - SysBreakStr(pstr); - #endif - } -#else - wxFputs( out , stderr ) ; - if ( out.Right(1) != wxT("\n") ) - wxFputs( wxT("\n") , stderr ) ; - fflush( stderr ) ; -#endif // platform -} - -// ---------------------------------------------------------------------------- -// wxMessageOutputLog -// ---------------------------------------------------------------------------- - -void wxMessageOutputLog::Printf(const wxChar* format, ...) -{ - wxString out; - - va_list args; - va_start(args, format); - - out.PrintfV(format, args); - va_end(args); - - out.Replace(wxT("\t"), wxT(" ")); - - ::wxLogMessage(wxT("%s"), out.c_str()); -} - -#endif // wxUSE_BASE - -// ---------------------------------------------------------------------------- -// wxMessageOutputMessageBox -// ---------------------------------------------------------------------------- - -#if wxUSE_GUI - -void wxMessageOutputMessageBox::Printf(const wxChar* format, ...) -{ - va_list args; - va_start(args, format); - wxString out; - - out.PrintfV(format, args); - va_end(args); - - // the native MSW msg box understands the TABs, others don't -#ifndef __WXMSW__ - out.Replace(wxT("\t"), wxT(" ")); -#endif - - wxString title; - if ( wxTheApp ) - title.Printf(_("%s message"), wxTheApp->GetAppName().c_str()); - - ::wxMessageBox(out, title); -} - -#endif // wxUSE_GUI diff --git a/wxWidgets/src/common/mstream.cpp b/wxWidgets/src/common/mstream.cpp deleted file mode 100644 index cbefd2a7c0..0000000000 --- a/wxWidgets/src/common/mstream.cpp +++ /dev/null @@ -1,174 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/common/mstream.cpp -// Purpose: "Memory stream" classes -// Author: Guilhem Lavaux -// Modified by: VZ (23.11.00): general code review -// Created: 04/01/98 -// RCS-ID: $Id: mstream.cpp 39001 2006-05-03 21:50:35Z ABX $ -// Copyright: (c) Guilhem Lavaux -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_STREAMS - -#include "wx/mstream.h" - -#ifndef WX_PRECOMP - #include "wx/stream.h" -#endif //WX_PRECOMP - -#include - -// ============================================================================ -// implementation -// ============================================================================ - -// ---------------------------------------------------------------------------- -// wxMemoryInputStream -// ---------------------------------------------------------------------------- - -wxMemoryInputStream::wxMemoryInputStream(const void *data, size_t len) -{ - m_i_streambuf = new wxStreamBuffer(wxStreamBuffer::read); - m_i_streambuf->SetBufferIO((void *)data, len); // const_cast - m_i_streambuf->SetIntPosition(0); // seek to start pos - m_i_streambuf->Fixed(true); - - m_length = len; -} - -wxMemoryInputStream::wxMemoryInputStream(const wxMemoryOutputStream& stream) -{ - const wxFileOffset lenFile = stream.GetLength(); - if ( lenFile == wxInvalidOffset ) - { - m_i_streambuf = NULL; - m_lasterror = wxSTREAM_EOF; - return; - } - - const size_t len = wx_truncate_cast(size_t, lenFile); - wxASSERT_MSG( len == lenFile + size_t(0), _T("huge files not supported") ); - - m_i_streambuf = new wxStreamBuffer(wxStreamBuffer::read); - m_i_streambuf->SetBufferIO(len); // create buffer - stream.CopyTo(m_i_streambuf->GetBufferStart(), len); - m_i_streambuf->SetIntPosition(0); // seek to start pos - m_i_streambuf->Fixed(true); - m_length = len; -} - -wxMemoryInputStream::~wxMemoryInputStream() -{ - delete m_i_streambuf; -} - -char wxMemoryInputStream::Peek() -{ - char *buf = (char *)m_i_streambuf->GetBufferStart(); - size_t pos = m_i_streambuf->GetIntPosition(); - if ( pos == m_length ) - { - m_lasterror = wxSTREAM_READ_ERROR; - - return 0; - } - - return buf[pos]; -} - -size_t wxMemoryInputStream::OnSysRead(void *buffer, size_t nbytes) -{ - size_t pos = m_i_streambuf->GetIntPosition(); - if ( pos == m_length ) - { - m_lasterror = wxSTREAM_EOF; - - return 0; - } - - m_i_streambuf->Read(buffer, nbytes); - m_lasterror = wxSTREAM_NO_ERROR; - - return m_i_streambuf->GetIntPosition() - pos; -} - -wxFileOffset wxMemoryInputStream::OnSysSeek(wxFileOffset pos, wxSeekMode mode) -{ - return m_i_streambuf->Seek(pos, mode); -} - -wxFileOffset wxMemoryInputStream::OnSysTell() const -{ - return m_i_streambuf->Tell(); -} - -// ---------------------------------------------------------------------------- -// wxMemoryOutputStream -// ---------------------------------------------------------------------------- - -wxMemoryOutputStream::wxMemoryOutputStream(void *data, size_t len) -{ - m_o_streambuf = new wxStreamBuffer(wxStreamBuffer::write); - if ( data ) - m_o_streambuf->SetBufferIO(data, len); - m_o_streambuf->Fixed(false); - m_o_streambuf->Flushable(false); -} - -wxMemoryOutputStream::~wxMemoryOutputStream() -{ - delete m_o_streambuf; -} - -size_t wxMemoryOutputStream::OnSysWrite(const void *buffer, size_t nbytes) -{ - size_t oldpos = m_o_streambuf->GetIntPosition(); - m_o_streambuf->Write(buffer, nbytes); - size_t newpos = m_o_streambuf->GetIntPosition(); - - // FIXME can someone please explain what this does? (VZ) - if ( !newpos ) - newpos = m_o_streambuf->GetBufferSize(); - - return newpos - oldpos; -} - -wxFileOffset wxMemoryOutputStream::OnSysSeek(wxFileOffset pos, wxSeekMode mode) -{ - return m_o_streambuf->Seek(pos, mode); -} - -wxFileOffset wxMemoryOutputStream::OnSysTell() const -{ - return m_o_streambuf->Tell(); -} - -size_t wxMemoryOutputStream::CopyTo(void *buffer, size_t len) const -{ - wxCHECK_MSG( buffer, 0, _T("must have buffer to CopyTo") ); - - if ( len > GetSize() ) - len = GetSize(); - - memcpy(buffer, m_o_streambuf->GetBufferStart(), len); - - return len; -} - -#endif // wxUSE_STREAMS diff --git a/wxWidgets/src/common/nbkbase.cpp b/wxWidgets/src/common/nbkbase.cpp deleted file mode 100644 index 011f53e16a..0000000000 --- a/wxWidgets/src/common/nbkbase.cpp +++ /dev/null @@ -1,84 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: src/common/nbkbase.cpp -// Purpose: common wxNotebook methods -// Author: Vadim Zeitlin -// Modified by: -// Created: 02.07.01 -// RCS-ID: $Id: nbkbase.cpp 41764 2006-10-08 23:41:52Z VZ $ -// Copyright: (c) 2001 Vadim Zeitlin -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_NOTEBOOK - -#ifndef WX_PRECOMP -#endif //WX_PRECOMP - -#include "wx/notebook.h" - -// ============================================================================ -// implementation -// ============================================================================ - -// ---------------------------------------------------------------------------- -// geometry -// ---------------------------------------------------------------------------- - -wxSize wxNotebookBase::CalcSizeFromPage(const wxSize& sizePage) const -{ - // this is, of course, totally bogus -- but we must do something by - // default because not all ports implement this - wxSize sizeTotal = sizePage; - - if ( HasFlag(wxBK_LEFT) || HasFlag(wxBK_RIGHT) ) - { - sizeTotal.x += 90; - sizeTotal.y += 10; - } - else // tabs on top/bottom side - { - sizeTotal.x += 10; - sizeTotal.y += 40; - } - - return sizeTotal; -} - -// ---------------------------------------------------------------------------- -// events -// ---------------------------------------------------------------------------- - -bool wxNotebookBase::SendPageChangingEvent(int nPage) -{ - wxNotebookEvent event(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING, GetId()); - event.SetSelection(nPage); - event.SetOldSelection(GetSelection()); - event.SetEventObject(this); - return !GetEventHandler()->ProcessEvent(event) || event.IsAllowed(); -} - -void wxNotebookBase::SendPageChangedEvent(int nPageOld, int nPageNew) -{ - wxNotebookEvent event(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED, GetId()); - event.SetSelection(nPageNew == -1 ? GetSelection() : nPageNew); - event.SetOldSelection(nPageOld); - event.SetEventObject(this); - GetEventHandler()->ProcessEvent(event); -} - -#endif // wxUSE_NOTEBOOK diff --git a/wxWidgets/src/common/object.cpp b/wxWidgets/src/common/object.cpp deleted file mode 100644 index 24eddcde72..0000000000 --- a/wxWidgets/src/common/object.cpp +++ /dev/null @@ -1,390 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/common/object.cpp -// Purpose: wxObject implementation -// Author: Julian Smart -// Modified by: Ron Lee -// Created: 04/01/98 -// RCS-ID: $Id: object.cpp 56500 2008-10-23 14:48:31Z MW $ -// Copyright: (c) 1998 Julian Smart -// (c) 2001 Ron Lee -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#ifndef WX_PRECOMP - #include "wx/object.h" - #include "wx/hash.h" - #include "wx/memory.h" -#endif - -#include - -#if defined(__WXDEBUG__) || wxUSE_DEBUG_CONTEXT - #if defined(__VISAGECPP__) - #define DEBUG_PRINTF(NAME) { static int raz=0; \ - printf( #NAME " %i\n",raz); fflush(stdout); raz++; } - #else - #define DEBUG_PRINTF(NAME) - #endif -#endif // __WXDEBUG__ || wxUSE_DEBUG_CONTEXT - -// we must disable optimizations for VC.NET because otherwise its too eager -// linker discards wxClassInfo objects in release build thus breaking many, -// many things -#if defined __VISUALC__ && __VISUALC__ >= 1300 - #pragma optimize("", off) -#endif - -#if wxUSE_EXTENDED_RTTI -const wxClassInfo* wxObject::ms_classParents[] = { NULL } ; - wxObject* wxVariantToObjectConverterwxObject ( wxxVariant &data ) -{ return data.wxTEMPLATED_MEMBER_CALL(Get , wxObject*) ; } - wxObject* wxVariantOfPtrToObjectConverterwxObject ( wxxVariant &data ) -{ return &data.wxTEMPLATED_MEMBER_CALL(Get , wxObject) ; } - wxxVariant wxObjectToVariantConverterwxObject ( wxObject *data ) - { return wxxVariant( dynamic_cast (data) ) ; } - wxClassInfo wxObject::ms_classInfo(ms_classParents , wxEmptyString , wxT("wxObject"), - (int) sizeof(wxObject), \ - (wxObjectConstructorFn) 0 , - (wxPropertyInfo*) NULL,(wxHandlerInfo*) NULL,0 , 0 , - 0 , wxVariantOfPtrToObjectConverterwxObject , wxVariantToObjectConverterwxObject , wxObjectToVariantConverterwxObject); - template<> void wxStringReadValue(const wxString & , wxObject * & ){assert(0) ;} - template<> void wxStringWriteValue(wxString & , wxObject* const & ){assert(0) ;} - template<> void wxStringReadValue(const wxString & , wxObject & ){assert(0) ;} - template<> void wxStringWriteValue(wxString & , wxObject const & ){assert(0) ;} - wxClassTypeInfo s_typeInfo(wxT_OBJECT_PTR , &wxObject::ms_classInfo , NULL , NULL , typeid(wxObject*).name() ) ; - wxClassTypeInfo s_typeInfowxObject(wxT_OBJECT , &wxObject::ms_classInfo , NULL , NULL , typeid(wxObject).name() ) ; -#else -wxClassInfo wxObject::ms_classInfo( wxT("wxObject"), 0, 0, - (int) sizeof(wxObject), - (wxObjectConstructorFn) 0 ); -#endif - -// restore optimizations -#if defined __VISUALC__ && __VISUALC__ >= 1300 - #pragma optimize("", on) -#endif - -wxClassInfo* wxClassInfo::sm_first = NULL; -wxHashTable* wxClassInfo::sm_classTable = NULL; - -// when using XTI, this method is already implemented inline inside -// DECLARE_DYNAMIC_CLASS but otherwise we intentionally make this function -// non-inline because this allows us to have a non-inline virtual function in -// all wx classes and this solves linking problems for HP-UX native toolchain -// and possibly others (we could make dtor non-inline as well but it's more -// useful to keep it inline than this function) -#if !wxUSE_EXTENDED_RTTI - -wxClassInfo *wxObject::GetClassInfo() const -{ - return &wxObject::ms_classInfo; -} - -#endif // wxUSE_EXTENDED_RTTI - -// this variable exists only so that we can avoid 'always true/false' warnings -const bool wxFalse = false; - -// Is this object a kind of (a subclass of) 'info'? -// E.g. is wxWindow a kind of wxObject? -// Go from this class to superclass, taking into account -// two possible base classes. -bool wxObject::IsKindOf(wxClassInfo *info) const -{ - wxClassInfo *thisInfo = GetClassInfo(); - return (thisInfo) ? thisInfo->IsKindOf(info) : false ; -} - -#if defined(__WXDEBUG__) && wxUSE_MEMORY_TRACING && defined( new ) - #undef new -#endif - - -#ifdef _WX_WANT_NEW_SIZET_WXCHAR_INT -void *wxObject::operator new ( size_t size, const wxChar *fileName, int lineNum ) -{ - return wxDebugAlloc(size, (wxChar*) fileName, lineNum, true); -} -#endif - -#ifdef _WX_WANT_DELETE_VOID -void wxObject::operator delete ( void *buf ) -{ - wxDebugFree(buf); -} -#endif - -#ifdef _WX_WANT_DELETE_VOID_CONSTCHAR_SIZET -void wxObject::operator delete ( void *buf, const char *_fname, size_t _line ) -{ - wxDebugFree(buf); -} -#endif - -#ifdef _WX_WANT_DELETE_VOID_WXCHAR_INT -void wxObject::operator delete ( void *buf, const wxChar *WXUNUSED(fileName), int WXUNUSED(lineNum) ) -{ - wxDebugFree(buf); -} -#endif - -#ifdef _WX_WANT_ARRAY_NEW_SIZET_WXCHAR_INT -void *wxObject::operator new[] ( size_t size, const wxChar* fileName, int lineNum ) -{ - return wxDebugAlloc(size, (wxChar*) fileName, lineNum, true, true); -} -#endif - -#ifdef _WX_WANT_ARRAY_DELETE_VOID -void wxObject::operator delete[] ( void *buf ) -{ - wxDebugFree(buf, true); -} -#endif - -#ifdef _WX_WANT_ARRAY_DELETE_VOID_WXCHAR_INT -void wxObject::operator delete[] (void * buf, const wxChar* WXUNUSED(fileName), int WXUNUSED(lineNum) ) -{ - wxDebugFree(buf, true); -} -#endif - - -// ---------------------------------------------------------------------------- -// wxClassInfo -// ---------------------------------------------------------------------------- - -wxClassInfo::~wxClassInfo() -{ - // remove this object from the linked list of all class infos: if we don't - // do it, loading/unloading a DLL containing static wxClassInfo objects is - // not going to work - if ( this == sm_first ) - { - sm_first = m_next; - } - else - { - wxClassInfo *info = sm_first; - while (info) - { - if ( info->m_next == this ) - { - info->m_next = m_next; - break; - } - - info = info->m_next; - } - } - Unregister(); -} - -wxClassInfo *wxClassInfo::FindClass(const wxChar *className) -{ - if ( sm_classTable ) - { - return (wxClassInfo *)wxClassInfo::sm_classTable->Get(className); - } - else - { - for ( wxClassInfo *info = sm_first; info ; info = info->m_next ) - { - if ( wxStrcmp(info->GetClassName(), className) == 0 ) - return info; - } - - return NULL; - } -} - -// Reentrance can occur on some platforms (Solaris for one), as the use of hash -// and string objects can cause other modules to load and register classes -// before the original call returns. This is handled by keeping the hash table -// local when it is first created and only assigning it to the global variable -// when the function is ready to return. -// -// That does make the assumption that after the function has completed the -// first time the problem will no longer happen; all the modules it depends on -// will have been loaded. The assumption is checked using the 'entry' variable -// as a reentrance guard, it checks that once the hash table is global it is -// not accessed multiple times simulateously. - -void wxClassInfo::Register() -{ -#ifdef __WXDEBUG__ - // reentrance guard - see note above - static int entry = 0; -#endif - - wxHashTable *classTable; - - if ( !sm_classTable ) - { - // keep the hash local initially, reentrance is possible - classTable = new wxHashTable(wxKEY_STRING); - } - else - { - // guard againt reentrance once the global has been created - wxASSERT_MSG(++entry == 1, _T("wxClassInfo::Register() reentrance")); - classTable = sm_classTable; - } - - // Using IMPLEMENT_DYNAMIC_CLASS() macro twice (which may happen if you - // link any object module twice mistakenly, or link twice against wx shared - // library) will break this function because it will enter an infinite loop - // and eventually die with "out of memory" - as this is quite hard to - // detect if you're unaware of this, try to do some checks here. - wxASSERT_MSG( classTable->Get(m_className) == NULL, - wxString::Format - ( - _T("Class \"%s\" already in RTTI table - have you used IMPLEMENT_DYNAMIC_CLASS() multiple times or linked some object file twice)?"), - m_className - ) - ); - - classTable->Put(m_className, (wxObject *)this); - - // if we're using a local hash we need to try to make it global - if ( sm_classTable != classTable ) - { - if ( !sm_classTable ) - { - // make the hash global - sm_classTable = classTable; - } - else - { - // the gobal hash has already been created by a reentrant call, - // so delete the local hash and try again - delete classTable; - Register(); - } - } - -#ifdef __WXDEBUG__ - entry = 0; -#endif -} - -void wxClassInfo::Unregister() -{ - if ( sm_classTable ) - { - sm_classTable->Delete(m_className); - if ( sm_classTable->GetCount() == 0 ) - { - delete sm_classTable; - sm_classTable = NULL; - } - } -} - -wxObject *wxCreateDynamicObject(const wxChar *name) -{ -#if defined(__WXDEBUG__) || wxUSE_DEBUG_CONTEXT - DEBUG_PRINTF(wxObject *wxCreateDynamicObject) -#endif - - if ( wxClassInfo::sm_classTable ) - { - wxClassInfo *info = (wxClassInfo *)wxClassInfo::sm_classTable->Get(name); - return info ? info->CreateObject() : NULL; - } - else // no sm_classTable yet - { - for ( wxClassInfo *info = wxClassInfo::sm_first; - info; - info = info->m_next ) - { - if (info->m_className && wxStrcmp(info->m_className, name) == 0) - return info->CreateObject(); - } - - return NULL; - } -} - - -// ---------------------------------------------------------------------------- -// wxObject -// ---------------------------------------------------------------------------- - -void wxObject::Ref(const wxObject& clone) -{ -#if defined(__WXDEBUG__) || wxUSE_DEBUG_CONTEXT - DEBUG_PRINTF(wxObject::Ref) -#endif - - // nothing to be done - if (m_refData == clone.m_refData) - return; - - // delete reference to old data - UnRef(); - - // reference new data - if ( clone.m_refData ) - { - m_refData = clone.m_refData; - ++(m_refData->m_count); - } -} - -void wxObject::UnRef() -{ - if ( m_refData ) - { - wxASSERT_MSG( m_refData->m_count > 0, _T("invalid ref data count") ); - - if ( --m_refData->m_count == 0 ) - delete m_refData; - m_refData = NULL; - } -} - -void wxObject::AllocExclusive() -{ - if ( !m_refData ) - { - m_refData = CreateRefData(); - } - else if ( m_refData->GetRefCount() > 1 ) - { - // note that ref is not going to be destroyed in this case - const wxObjectRefData* ref = m_refData; - UnRef(); - - // ... so we can still access it - m_refData = CloneRefData(ref); - } - //else: ref count is 1, we are exclusive owners of m_refData anyhow - - wxASSERT_MSG( m_refData && m_refData->GetRefCount() == 1, - _T("wxObject::AllocExclusive() failed.") ); -} - -wxObjectRefData *wxObject::CreateRefData() const -{ - // if you use AllocExclusive() you must override this method - wxFAIL_MSG( _T("CreateRefData() must be overridden if called!") ); - - return NULL; -} - -wxObjectRefData * -wxObject::CloneRefData(const wxObjectRefData * WXUNUSED(data)) const -{ - // if you use AllocExclusive() you must override this method - wxFAIL_MSG( _T("CloneRefData() must be overridden if called!") ); - - return NULL; -} diff --git a/wxWidgets/src/common/overlaycmn.cpp b/wxWidgets/src/common/overlaycmn.cpp deleted file mode 100644 index 7867edb0ec..0000000000 --- a/wxWidgets/src/common/overlaycmn.cpp +++ /dev/null @@ -1,197 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/common/overlaycmn.cpp -// Purpose: common wxOverlay code -// Author: Stefan Csomor -// Modified by: -// Created: 2006-10-20 -// RCS-ID: $Id: overlaycmn.cpp 42397 2006-10-25 12:12:56Z VS $ -// Copyright: (c) wxWidgets team -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#include "wx/overlay.h" -#include "wx/private/overlay.h" -#include "wx/dcclient.h" -#include "wx/dcmemory.h" - -// ============================================================================ -// implementation -// ============================================================================ - -// ---------------------------------------------------------------------------- -// wxOverlay -// ---------------------------------------------------------------------------- - -wxOverlay::wxOverlay() -{ - m_impl = new wxOverlayImpl(); - m_inDrawing = false; -} - -wxOverlay::~wxOverlay() -{ - delete m_impl; -} - -bool wxOverlay::IsOk() -{ - return m_impl->IsOk(); -} - -void wxOverlay::Init( wxWindowDC* dc, int x , int y , int width , int height ) -{ - m_impl->Init(dc, x, y, width, height); -} - -void wxOverlay::BeginDrawing( wxWindowDC* dc) -{ - m_impl->BeginDrawing(dc); - m_inDrawing = true ; -} - -void wxOverlay::EndDrawing( wxWindowDC* dc) -{ - m_impl->EndDrawing(dc); - m_inDrawing = false ; -} - -void wxOverlay::Clear( wxWindowDC* dc) -{ - m_impl->Clear(dc); -} - -void wxOverlay::Reset() -{ - wxASSERT_MSG(m_inDrawing==false,wxT("cannot reset overlay during drawing")); - m_impl->Reset(); -} - - -// ---------------------------------------------------------------------------- -// wxDCOverlay -// ---------------------------------------------------------------------------- - -wxDCOverlay::wxDCOverlay(wxOverlay &overlay, wxWindowDC *dc, int x , int y , int width , int height) : - m_overlay(overlay) -{ - Init(dc, x, y, width, height); -} - -wxDCOverlay::wxDCOverlay(wxOverlay &overlay, wxWindowDC *dc) : - m_overlay(overlay) -{ - int width; - int height; - dc->GetSize(&width,&height); - Init(dc, 0, 0, width, height); -} - -wxDCOverlay::~wxDCOverlay() -{ - m_overlay.EndDrawing(m_dc); -} - -void wxDCOverlay::Init(wxWindowDC *dc, int x , int y , int width , int height ) -{ - m_dc = dc ; - if ( !m_overlay.IsOk() ) - { - m_overlay.Init(dc,x,y,width,height); - } - m_overlay.BeginDrawing(dc); -} - -void wxDCOverlay::Clear() -{ - m_overlay.Clear(m_dc); -} - -// ---------------------------------------------------------------------------- -// generic implementation of wxOverlayImpl -// ---------------------------------------------------------------------------- - -#ifndef wxHAS_NATIVE_OVERLAY - -wxOverlayImpl::wxOverlayImpl() -{ -#if defined(__WXGTK__) || defined(__WXMSW__) - m_window = NULL ; -#endif - m_x = m_y = m_width = m_height = 0 ; -} - -wxOverlayImpl::~wxOverlayImpl() -{ -} - -bool wxOverlayImpl::IsOk() -{ - return m_bmpSaved.Ok() ; -} - -void wxOverlayImpl::Init( wxWindowDC* dc, int x , int y , int width , int height ) -{ -#if defined(__WXGTK__) - m_window = dc->m_owner; -#else - #if defined (__WXMSW__) - m_window = dc->GetWindow(); - #endif // __WXMSW__ - -#endif - wxMemoryDC dcMem ; - m_bmpSaved.Create( width, height ); - dcMem.SelectObject( m_bmpSaved ); - m_x = x ; - m_y = y ; - m_width = width ; - m_height = height ; -#if defined(__WXGTK__) && !defined(__WX_DC_BLIT_FIXED__) - wxPoint pt = dc->GetDeviceOrigin(); - x += pt.x; - y += pt.y; -#endif // broken wxGTK wxDC::Blit - dcMem.Blit(0, 0, m_width, m_height, - dc, x, y); - dcMem.SelectObject( wxNullBitmap ); -} - -void wxOverlayImpl::Clear(wxWindowDC* dc) -{ - wxMemoryDC dcMem ; - dcMem.SelectObject( m_bmpSaved ); - dc->Blit( m_x, m_y, m_width, m_height , &dcMem , 0 , 0 ); - dcMem.SelectObject( wxNullBitmap ); -} - -void wxOverlayImpl::Reset() -{ - m_bmpSaved = wxBitmap(); -} - -void wxOverlayImpl::BeginDrawing(wxWindowDC* WXUNUSED(dc)) -{ -} - -void wxOverlayImpl::EndDrawing(wxWindowDC* WXUNUSED(dc)) -{ -} - -#endif // !wxHAS_NATIVE_OVERLAY - - diff --git a/wxWidgets/src/common/paper.cpp b/wxWidgets/src/common/paper.cpp deleted file mode 100644 index 714eee2867..0000000000 --- a/wxWidgets/src/common/paper.cpp +++ /dev/null @@ -1,376 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/common/paper.cpp -// Purpose: Paper size classes -// Author: Julian Smart -// Modified by: -// Created: 04/01/98 -// RCS-ID: $Id: paper.cpp 60706 2009-05-21 10:17:44Z JS $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_PRINTING_ARCHITECTURE - -#ifndef WX_PRECOMP - #if defined(__WXMSW__) - #include "wx/msw/wrapcdlg.h" - #endif // MSW - #include "wx/utils.h" - #include "wx/settings.h" - #include "wx/intl.h" - #include "wx/module.h" -#endif - -#include "wx/paper.h" - -#include -#include - -#ifdef __WXMSW__ - #ifndef __WIN32__ - #include - #endif -#endif - // End __WXMSW__ - -IMPLEMENT_DYNAMIC_CLASS(wxPrintPaperType, wxObject) -// IMPLEMENT_DYNAMIC_CLASS(wxPrintPaperDatabase, wxList) - -/* - * Paper size database for all platforms - */ - -wxPrintPaperType::wxPrintPaperType() -{ - m_paperId = wxPAPER_NONE; - m_platformId = 0; - m_paperName = wxEmptyString; - m_width = 0; - m_height = 0; -} - -wxPrintPaperType::wxPrintPaperType(wxPaperSize paperId, int platformId, const wxString& name, int w, int h) -{ - m_paperId = paperId; - m_platformId = platformId; - m_paperName = name; - m_width = w; - m_height = h; -} - -// Get width and height in points (1/72th of an inch) -wxSize wxPrintPaperType::GetSizeDeviceUnits() const -{ - return wxSize( (int) ((m_width / 10.0) / (25.4 / 72.0)), (int) ((m_height / 10.0) / (25.4 / 72.0)) ); -} - -/* - * Print paper database for PostScript - */ - -WX_DECLARE_LIST(wxPrintPaperType, wxPrintPaperTypeList); -#include "wx/listimpl.cpp" -WX_DEFINE_LIST(wxPrintPaperTypeList) - -wxPrintPaperDatabase* wxThePrintPaperDatabase = (wxPrintPaperDatabase*) NULL; - -wxPrintPaperDatabase::wxPrintPaperDatabase() -{ - m_map = new wxStringToPrintPaperTypeHashMap; - m_list = new wxPrintPaperTypeList; -} - -wxPrintPaperDatabase::~wxPrintPaperDatabase() -{ - ClearDatabase(); -} - -void wxPrintPaperDatabase::CreateDatabase() -{ - WXADDPAPER(wxPAPER_LETTER, DMPAPER_LETTER, wxTRANSLATE("Letter, 8 1/2 x 11 in"), 2159, 2794); - WXADDPAPER(wxPAPER_LEGAL, DMPAPER_LEGAL, wxTRANSLATE("Legal, 8 1/2 x 14 in"), 2159, 3556); - WXADDPAPER(wxPAPER_A4, DMPAPER_A4, wxTRANSLATE("A4 sheet, 210 x 297 mm"), 2100, 2970); - WXADDPAPER(wxPAPER_CSHEET, DMPAPER_CSHEET, wxTRANSLATE("C sheet, 17 x 22 in"), 4318, 5588); - WXADDPAPER(wxPAPER_DSHEET, DMPAPER_DSHEET, wxTRANSLATE("D sheet, 22 x 34 in"), 5588, 8636); - WXADDPAPER(wxPAPER_ESHEET, DMPAPER_ESHEET, wxTRANSLATE("E sheet, 34 x 44 in"), 8636, 11176); - WXADDPAPER(wxPAPER_LETTERSMALL, DMPAPER_LETTERSMALL, wxTRANSLATE("Letter Small, 8 1/2 x 11 in"), 2159, 2794); - WXADDPAPER(wxPAPER_TABLOID, DMPAPER_TABLOID, wxTRANSLATE("Tabloid, 11 x 17 in"), 2794, 4318); - WXADDPAPER(wxPAPER_LEDGER, DMPAPER_LEDGER, wxTRANSLATE("Ledger, 17 x 11 in"), 4318, 2794); - WXADDPAPER(wxPAPER_STATEMENT, DMPAPER_STATEMENT, wxTRANSLATE("Statement, 5 1/2 x 8 1/2 in"), 1397, 2159); - WXADDPAPER(wxPAPER_EXECUTIVE, DMPAPER_EXECUTIVE, wxTRANSLATE("Executive, 7 1/4 x 10 1/2 in"), 1842, 2667); - WXADDPAPER(wxPAPER_A3, DMPAPER_A3, wxTRANSLATE("A3 sheet, 297 x 420 mm"), 2970, 4200); - WXADDPAPER(wxPAPER_A4SMALL, DMPAPER_A4SMALL, wxTRANSLATE("A4 small sheet, 210 x 297 mm"), 2100, 2970); - WXADDPAPER(wxPAPER_A5, DMPAPER_A5, wxTRANSLATE("A5 sheet, 148 x 210 mm"), 1480, 2100); - WXADDPAPER(wxPAPER_B4, DMPAPER_B4, wxTRANSLATE("B4 sheet, 250 x 354 mm"), 2500, 3540); - WXADDPAPER(wxPAPER_B5, DMPAPER_B5, wxTRANSLATE("B5 sheet, 182 x 257 millimeter"), 1820, 2570); - WXADDPAPER(wxPAPER_FOLIO, DMPAPER_FOLIO, wxTRANSLATE("Folio, 8 1/2 x 13 in"), 2159, 3302); - WXADDPAPER(wxPAPER_QUARTO, DMPAPER_QUARTO, wxTRANSLATE("Quarto, 215 x 275 mm"), 2150, 2750); - WXADDPAPER(wxPAPER_10X14, DMPAPER_10X14, wxTRANSLATE("10 x 14 in"), 2540, 3556); - WXADDPAPER(wxPAPER_11X17, DMPAPER_11X17, wxTRANSLATE("11 x 17 in"), 2794, 4318); - WXADDPAPER(wxPAPER_NOTE, DMPAPER_NOTE, wxTRANSLATE("Note, 8 1/2 x 11 in"), 2159, 2794); - WXADDPAPER(wxPAPER_ENV_9, DMPAPER_ENV_9, wxTRANSLATE("#9 Envelope, 3 7/8 x 8 7/8 in"), 984, 2254); - WXADDPAPER(wxPAPER_ENV_10, DMPAPER_ENV_10, wxTRANSLATE("#10 Envelope, 4 1/8 x 9 1/2 in"), 1048, 2413); - WXADDPAPER(wxPAPER_ENV_11, DMPAPER_ENV_11, wxTRANSLATE("#11 Envelope, 4 1/2 x 10 3/8 in"), 1143, 2635); - WXADDPAPER(wxPAPER_ENV_12, DMPAPER_ENV_12, wxTRANSLATE("#12 Envelope, 4 3/4 x 11 in"), 1206, 2794); - WXADDPAPER(wxPAPER_ENV_14, DMPAPER_ENV_14, wxTRANSLATE("#14 Envelope, 5 x 11 1/2 in"), 1270, 2921); - WXADDPAPER(wxPAPER_ENV_DL, DMPAPER_ENV_DL, wxTRANSLATE("DL Envelope, 110 x 220 mm"), 1100, 2200); - WXADDPAPER(wxPAPER_ENV_C5, DMPAPER_ENV_C5, wxTRANSLATE("C5 Envelope, 162 x 229 mm"), 1620, 2290); - WXADDPAPER(wxPAPER_ENV_C3, DMPAPER_ENV_C3, wxTRANSLATE("C3 Envelope, 324 x 458 mm"), 3240, 4580); - WXADDPAPER(wxPAPER_ENV_C4, DMPAPER_ENV_C4, wxTRANSLATE("C4 Envelope, 229 x 324 mm"), 2290, 3240); - WXADDPAPER(wxPAPER_ENV_C6, DMPAPER_ENV_C6, wxTRANSLATE("C6 Envelope, 114 x 162 mm"), 1140, 1620); - WXADDPAPER(wxPAPER_ENV_C65, DMPAPER_ENV_C65, wxTRANSLATE("C65 Envelope, 114 x 229 mm"), 1140, 2290); - WXADDPAPER(wxPAPER_ENV_B4, DMPAPER_ENV_B4, wxTRANSLATE("B4 Envelope, 250 x 353 mm"), 2500, 3530); - WXADDPAPER(wxPAPER_ENV_B5, DMPAPER_ENV_B5, wxTRANSLATE("B5 Envelope, 176 x 250 mm"), 1760, 2500); - WXADDPAPER(wxPAPER_ENV_B6, DMPAPER_ENV_B6, wxTRANSLATE("B6 Envelope, 176 x 125 mm"), 1760, 1250); - WXADDPAPER(wxPAPER_ENV_ITALY, DMPAPER_ENV_ITALY, wxTRANSLATE("Italy Envelope, 110 x 230 mm"), 1100, 2300); - WXADDPAPER(wxPAPER_ENV_MONARCH, DMPAPER_ENV_MONARCH, wxTRANSLATE("Monarch Envelope, 3 7/8 x 7 1/2 in"), 984, 1905); - WXADDPAPER(wxPAPER_ENV_PERSONAL, DMPAPER_ENV_PERSONAL, wxTRANSLATE("6 3/4 Envelope, 3 5/8 x 6 1/2 in"), 921, 1651); - WXADDPAPER(wxPAPER_FANFOLD_US, DMPAPER_FANFOLD_US, wxTRANSLATE("US Std Fanfold, 14 7/8 x 11 in"), 3778, 2794); - WXADDPAPER(wxPAPER_FANFOLD_STD_GERMAN, DMPAPER_FANFOLD_STD_GERMAN, wxTRANSLATE("German Std Fanfold, 8 1/2 x 12 in"), 2159, 3048); - WXADDPAPER(wxPAPER_FANFOLD_LGL_GERMAN, DMPAPER_FANFOLD_LGL_GERMAN, wxTRANSLATE("German Legal Fanfold, 8 1/2 x 13 in"), 2159, 3302); - - WXADDPAPER(wxPAPER_ISO_B4, DMPAPER_ISO_B4, wxTRANSLATE("B4 (ISO) 250 x 353 mm"), 2500, 2530); - WXADDPAPER(wxPAPER_JAPANESE_POSTCARD, DMPAPER_JAPANESE_POSTCARD, wxTRANSLATE("Japanese Postcard 100 x 148 mm"), 1000, 1480); - WXADDPAPER(wxPAPER_9X11, DMPAPER_9X11, wxTRANSLATE("9 x 11 in"), 2286, 2794); - WXADDPAPER(wxPAPER_10X11, DMPAPER_10X11, wxTRANSLATE("10 x 11 in"), 2540, 2794); - WXADDPAPER(wxPAPER_15X11, DMPAPER_15X11, wxTRANSLATE("15 x 11 in"), 3810, 2794); - WXADDPAPER(wxPAPER_ENV_INVITE, DMPAPER_ENV_INVITE, wxTRANSLATE("Envelope Invite 220 x 220 mm"), 2200, 2200); - WXADDPAPER(wxPAPER_LETTER_EXTRA, DMPAPER_LETTER_EXTRA, wxTRANSLATE("Letter Extra 9 1/2 x 12 in"), 2413, 3048); - WXADDPAPER(wxPAPER_LEGAL_EXTRA, DMPAPER_LEGAL_EXTRA, wxTRANSLATE("Legal Extra 9 1/2 x 15 in"), 2413, 3810); - WXADDPAPER(wxPAPER_TABLOID_EXTRA, DMPAPER_TABLOID_EXTRA, wxTRANSLATE("Tabloid Extra 11.69 x 18 in"), 2969, 4572); - WXADDPAPER(wxPAPER_A4_EXTRA, DMPAPER_A4_EXTRA, wxTRANSLATE("A4 Extra 9.27 x 12.69 in"), 2355, 3223); - WXADDPAPER(wxPAPER_LETTER_TRANSVERSE, DMPAPER_LETTER_TRANSVERSE, wxTRANSLATE("Letter Transverse 8 1/2 x 11 in"), 2159, 2794); - WXADDPAPER(wxPAPER_A4_TRANSVERSE, DMPAPER_A4_TRANSVERSE, wxTRANSLATE("A4 Transverse 210 x 297 mm"), 2100, 2970); - WXADDPAPER(wxPAPER_LETTER_EXTRA_TRANSVERSE, DMPAPER_LETTER_EXTRA_TRANSVERSE, wxTRANSLATE("Letter Extra Transverse 9.275 x 12 in"), 2355, 3048); - WXADDPAPER(wxPAPER_A_PLUS, DMPAPER_A_PLUS, wxTRANSLATE("SuperA/SuperA/A4 227 x 356 mm"), 2270, 3560); - WXADDPAPER(wxPAPER_B_PLUS, DMPAPER_B_PLUS, wxTRANSLATE("SuperB/SuperB/A3 305 x 487 mm"), 3050, 4870); - WXADDPAPER(wxPAPER_LETTER_PLUS, DMPAPER_LETTER_PLUS, wxTRANSLATE("Letter Plus 8 1/2 x 12.69 in"), 2159, 3223); - WXADDPAPER(wxPAPER_A4_PLUS, DMPAPER_A4_PLUS, wxTRANSLATE("A4 Plus 210 x 330 mm"), 2100, 3300); - WXADDPAPER(wxPAPER_A5_TRANSVERSE, DMPAPER_A5_TRANSVERSE, wxTRANSLATE("A5 Transverse 148 x 210 mm"), 1480, 2100); - WXADDPAPER(wxPAPER_B5_TRANSVERSE, DMPAPER_B5_TRANSVERSE, wxTRANSLATE("B5 (JIS) Transverse 182 x 257 mm"), 1820, 2570); - WXADDPAPER(wxPAPER_A3_EXTRA, DMPAPER_A3_EXTRA, wxTRANSLATE("A3 Extra 322 x 445 mm"), 3220, 4450); - WXADDPAPER(wxPAPER_A5_EXTRA, DMPAPER_A5_EXTRA, wxTRANSLATE("A5 Extra 174 x 235 mm"), 1740, 2350); - WXADDPAPER(wxPAPER_B5_EXTRA, DMPAPER_B5_EXTRA, wxTRANSLATE("B5 (ISO) Extra 201 x 276 mm"), 2010, 2760); - WXADDPAPER(wxPAPER_A2, DMPAPER_A2, wxTRANSLATE("A2 420 x 594 mm"), 4200, 5940); - WXADDPAPER(wxPAPER_A3_TRANSVERSE, DMPAPER_A3_TRANSVERSE, wxTRANSLATE("A3 Transverse 297 x 420 mm"), 2970, 4200); - WXADDPAPER(wxPAPER_A3_EXTRA_TRANSVERSE,DMPAPER_A3_EXTRA_TRANSVERSE,wxTRANSLATE("A3 Extra Transverse 322 x 445 mm"), 3220, 4450); - - WXADDPAPER(wxPAPER_DBL_JAPANESE_POSTCARD, 69, wxTRANSLATE("Japanese Double Postcard 200 x 148 mm"), 2000, 1480); - WXADDPAPER(wxPAPER_A6, 70, wxTRANSLATE("A6 105 x 148 mm"), 1050, 1480); - WXADDPAPER(wxPAPER_JENV_KAKU2, 71, wxTRANSLATE("Japanese Envelope Kaku #2"), 2400, 3320); - WXADDPAPER(wxPAPER_JENV_KAKU3, 72, wxTRANSLATE("Japanese Envelope Kaku #3"), 2160, 2770); - WXADDPAPER(wxPAPER_JENV_CHOU3, 73, wxTRANSLATE("Japanese Envelope Chou #3"), 1200, 2350); - WXADDPAPER(wxPAPER_JENV_CHOU4, 74, wxTRANSLATE("Japanese Envelope Chou #4"), 900, 2050); - WXADDPAPER(wxPAPER_LETTER_ROTATED, 75, wxTRANSLATE("Letter Rotated 11 x 8 1/2 in"), 2794, 2159); - WXADDPAPER(wxPAPER_A3_ROTATED, 76, wxTRANSLATE("A3 Rotated 420 x 297 mm"), 4200, 2970); - WXADDPAPER(wxPAPER_A4_ROTATED, 77, wxTRANSLATE("A4 Rotated 297 x 210 mm"), 2970, 2100); - WXADDPAPER(wxPAPER_A5_ROTATED, 78, wxTRANSLATE("A5 Rotated 210 x 148 mm"), 2100, 1480); - WXADDPAPER(wxPAPER_B4_JIS_ROTATED, 79, wxTRANSLATE("B4 (JIS) Rotated 364 x 257 mm"), 3640, 2570); - WXADDPAPER(wxPAPER_B5_JIS_ROTATED, 80, wxTRANSLATE("B5 (JIS) Rotated 257 x 182 mm"), 2570, 1820); - WXADDPAPER(wxPAPER_JAPANESE_POSTCARD_ROTATED, 81, wxTRANSLATE("Japanese Postcard Rotated 148 x 100 mm"), 1480, 1000); - WXADDPAPER(wxPAPER_DBL_JAPANESE_POSTCARD_ROTATED, 82, wxTRANSLATE("Double Japanese Postcard Rotated 148 x 200 mm"), 1480, 2000); - WXADDPAPER(wxPAPER_A6_ROTATED, 83, wxTRANSLATE("A6 Rotated 148 x 105 mm"), 1480, 1050); - WXADDPAPER(wxPAPER_JENV_KAKU2_ROTATED, 84, wxTRANSLATE("Japanese Envelope Kaku #2 Rotated"), 3320, 2400); - WXADDPAPER(wxPAPER_JENV_KAKU3_ROTATED, 85, wxTRANSLATE("Japanese Envelope Kaku #3 Rotated"), 2770, 2160); - WXADDPAPER(wxPAPER_JENV_CHOU3_ROTATED, 86, wxTRANSLATE("Japanese Envelope Chou #3 Rotated"), 2350, 1200); - WXADDPAPER(wxPAPER_JENV_CHOU4_ROTATED, 87, wxTRANSLATE("Japanese Envelope Chou #4 Rotated"), 2050, 900); - WXADDPAPER(wxPAPER_B6_JIS, 88, wxTRANSLATE("B6 (JIS) 128 x 182 mm"), 1280, 1820); - WXADDPAPER(wxPAPER_B6_JIS_ROTATED, 89, wxTRANSLATE("B6 (JIS) Rotated 182 x 128 mm"), 1920, 1280); - WXADDPAPER(wxPAPER_12X11, 90, wxTRANSLATE("12 x 11 in"), 3048, 2794); - WXADDPAPER(wxPAPER_JENV_YOU4, 91, wxTRANSLATE("Japanese Envelope You #4"), 2350, 1050); - WXADDPAPER(wxPAPER_JENV_YOU4_ROTATED, 92, wxTRANSLATE("Japanese Envelope You #4 Rotated"), 1050, 2350); - WXADDPAPER(wxPAPER_P16K, 93, wxTRANSLATE("PRC 16K 146 x 215 mm"), 1460, 2150); - WXADDPAPER(wxPAPER_P32K, 94, wxTRANSLATE("PRC 32K 97 x 151 mm"), 970, 1510); - WXADDPAPER(wxPAPER_P32KBIG, 95, wxTRANSLATE("PRC 32K(Big) 97 x 151 mm"), 970, 1510); - WXADDPAPER(wxPAPER_PENV_1, 96, wxTRANSLATE("PRC Envelope #1 102 x 165 mm"), 1020, 1650); - WXADDPAPER(wxPAPER_PENV_2, 97, wxTRANSLATE("PRC Envelope #2 102 x 176 mm"), 1020, 1760); - WXADDPAPER(wxPAPER_PENV_3, 98, wxTRANSLATE("PRC Envelope #3 125 x 176 mm"), 1250, 1760); - WXADDPAPER(wxPAPER_PENV_4, 99, wxTRANSLATE("PRC Envelope #4 110 x 208 mm"), 1100, 2080); - WXADDPAPER(wxPAPER_PENV_5, 100, wxTRANSLATE("PRC Envelope #5 110 x 220 mm"), 1100, 2200); - WXADDPAPER(wxPAPER_PENV_6, 101, wxTRANSLATE("PRC Envelope #6 120 x 230 mm"), 1200, 2300); - WXADDPAPER(wxPAPER_PENV_7, 102, wxTRANSLATE("PRC Envelope #7 160 x 230 mm"), 1600, 2300); - WXADDPAPER(wxPAPER_PENV_8, 103, wxTRANSLATE("PRC Envelope #8 120 x 309 mm"), 1200, 3090); - WXADDPAPER(wxPAPER_PENV_9, 104, wxTRANSLATE("PRC Envelope #9 229 x 324 mm"), 2290, 3240); - WXADDPAPER(wxPAPER_PENV_10, 105, wxTRANSLATE("PRC Envelope #10 324 x 458 mm"), 3240, 4580); - WXADDPAPER(wxPAPER_P16K_ROTATED, 106, wxTRANSLATE("PRC 16K Rotated"), 2150, 1460); - WXADDPAPER(wxPAPER_P32K_ROTATED, 107, wxTRANSLATE("PRC 32K Rotated"), 1510, 970); - WXADDPAPER(wxPAPER_P32KBIG_ROTATED, 108, wxTRANSLATE("PRC 32K(Big) Rotated"), 1510, 970); - WXADDPAPER(wxPAPER_PENV_1_ROTATED, 109, wxTRANSLATE("PRC Envelope #1 Rotated 165 x 102 mm"), 1650, 1020); - WXADDPAPER(wxPAPER_PENV_2_ROTATED, 110, wxTRANSLATE("PRC Envelope #2 Rotated 176 x 102 mm"), 1760, 1020); - WXADDPAPER(wxPAPER_PENV_3_ROTATED, 111, wxTRANSLATE("PRC Envelope #3 Rotated 176 x 125 mm"), 1760, 1250); - WXADDPAPER(wxPAPER_PENV_4_ROTATED, 112, wxTRANSLATE("PRC Envelope #4 Rotated 208 x 110 mm"), 2080, 1100); - WXADDPAPER(wxPAPER_PENV_5_ROTATED, 113, wxTRANSLATE("PRC Envelope #5 Rotated 220 x 110 mm"), 2200, 1100); - WXADDPAPER(wxPAPER_PENV_6_ROTATED, 114, wxTRANSLATE("PRC Envelope #6 Rotated 230 x 120 mm"), 2300, 1200); - WXADDPAPER(wxPAPER_PENV_7_ROTATED, 115, wxTRANSLATE("PRC Envelope #7 Rotated 230 x 160 mm"), 2300, 1600); - WXADDPAPER(wxPAPER_PENV_8_ROTATED, 116, wxTRANSLATE("PRC Envelope #8 Rotated 309 x 120 mm"), 3090, 1200); - WXADDPAPER(wxPAPER_PENV_9_ROTATED, 117, wxTRANSLATE("PRC Envelope #9 Rotated 324 x 229 mm"), 3240, 2290); - WXADDPAPER(wxPAPER_PENV_10_ROTATED, 118, wxTRANSLATE("PRC Envelope #10 Rotated 458 x 324 mm"), 4580, 3240); -} - -void wxPrintPaperDatabase::ClearDatabase() -{ - delete m_list; - WX_CLEAR_HASH_MAP(wxStringToPrintPaperTypeHashMap, *m_map); - delete m_map; -} - -void wxPrintPaperDatabase::AddPaperType(wxPaperSize paperId, const wxString& name, int w, int h) -{ - wxPrintPaperType* tmp = new wxPrintPaperType(paperId, 0, name, w, h); - (*m_map)[name] = tmp; - m_list->push_back(tmp); -} - -void wxPrintPaperDatabase::AddPaperType(wxPaperSize paperId, int platformId, const wxString& name, int w, int h) -{ - wxPrintPaperType* tmp = new wxPrintPaperType(paperId, platformId, name, w, h); - (*m_map)[name] = tmp; - m_list->push_back(tmp); -} - -wxPrintPaperType *wxPrintPaperDatabase::FindPaperType(const wxString& name) -{ - wxStringToPrintPaperTypeHashMap::iterator it = m_map->find(name); - if (it != m_map->end()) - return it->second; - else - return NULL; -} - -wxPrintPaperType *wxPrintPaperDatabase::FindPaperType(wxPaperSize id) -{ - typedef wxStringToPrintPaperTypeHashMap::iterator iterator; - - for (iterator it = m_map->begin(), en = m_map->end(); it != en; ++it) - { - wxPrintPaperType* paperType = it->second; - if (paperType->GetId() == id) - return paperType; - } - - return NULL; -} - -wxPrintPaperType *wxPrintPaperDatabase::FindPaperTypeByPlatformId(int id) -{ - typedef wxStringToPrintPaperTypeHashMap::iterator iterator; - - for (iterator it = m_map->begin(), en = m_map->end(); it != en; ++it) - { - wxPrintPaperType* paperType = it->second; - if (paperType->GetPlatformId() == id) - return paperType; - } - - return NULL; -} - -wxPrintPaperType *wxPrintPaperDatabase::FindPaperType(const wxSize& sz) -{ - // Take the item ordering into account so that the more common types - // are likely to be taken into account first. This fixes problems with, - // for example, Letter reverting to A4 in the page setup dialog because - // it was wrongly translated to Note. - size_t i; - for (i = 0; i < GetCount(); i++) - { - wxPrintPaperType* paperType = Item(i); - wxSize paperSize = paperType->GetSize() ; - if ( abs( paperSize.x - sz.x ) < 10 && abs( paperSize.y - sz.y ) < 10 ) - return paperType; - } - - return NULL; -} - -// Convert name to size id -wxPaperSize wxPrintPaperDatabase::ConvertNameToId(const wxString& name) -{ - wxPrintPaperType* type = FindPaperType(name); - if (type) - return type->GetId(); - else - return wxPAPER_NONE; -} - -// Convert size id to name -wxString wxPrintPaperDatabase::ConvertIdToName(wxPaperSize paperId) -{ - wxPrintPaperType* type = FindPaperType(paperId); - if (type) - return type->GetName(); - else - return wxEmptyString; -} - -// Get the paper size -wxSize wxPrintPaperDatabase::GetSize(wxPaperSize paperId) -{ - wxPrintPaperType* type = FindPaperType(paperId); - if (type) - return type->GetSize(); - else - return wxSize(0,0); -} - -// Get the paper size -wxPaperSize wxPrintPaperDatabase::GetSize(const wxSize& size) -{ - wxPrintPaperType* type = FindPaperType(size); - if (type) - return type->GetId(); - else - return wxPAPER_NONE; -} - -// QUICK and DIRTY -size_t wxPrintPaperDatabase::GetCount() const -{ - return m_list->GetCount(); -} - -wxPrintPaperType* wxPrintPaperDatabase::Item(size_t index) const -{ - return m_list->Item(index)->GetData(); -} - -// A module to allow initialization/cleanup of print paper -// things without calling these functions from app.cpp. - -class WXDLLEXPORT wxPrintPaperModule: public wxModule -{ -DECLARE_DYNAMIC_CLASS(wxPrintPaperModule) -public: - wxPrintPaperModule() {} - bool OnInit(); - void OnExit(); -}; - -IMPLEMENT_DYNAMIC_CLASS(wxPrintPaperModule, wxModule) - -/* - * Initialization/cleanup module - */ - -bool wxPrintPaperModule::OnInit() -{ - wxThePrintPaperDatabase = new wxPrintPaperDatabase; - wxThePrintPaperDatabase->CreateDatabase(); - - return true; -} - -void wxPrintPaperModule::OnExit() -{ - delete wxThePrintPaperDatabase; - wxThePrintPaperDatabase = NULL; -} - -#endif // wxUSE_PRINTING_ARCHITECTURE diff --git a/wxWidgets/src/common/pickerbase.cpp b/wxWidgets/src/common/pickerbase.cpp deleted file mode 100644 index 87c99066c3..0000000000 --- a/wxWidgets/src/common/pickerbase.cpp +++ /dev/null @@ -1,175 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: src/common/pickerbase.cpp -// Purpose: wxPickerBase class implementation -// Author: Francesco Montorsi -// Modified by: -// Created: 15/04/2006 -// RCS-ID: $Id: pickerbase.cpp 58463 2009-01-27 17:39:50Z BP $ -// Copyright: (c) Francesco Montorsi -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_COLOURPICKERCTRL || \ - wxUSE_DIRPICKERCTRL || \ - wxUSE_FILEPICKERCTRL || \ - wxUSE_FONTPICKERCTRL - -#include "wx/pickerbase.h" -#include "wx/tooltip.h" - -#ifndef WX_PRECOMP - #include "wx/textctrl.h" -#endif - - -// ============================================================================ -// implementation -// ============================================================================ - -IMPLEMENT_ABSTRACT_CLASS(wxPickerBase, wxControl) - -BEGIN_EVENT_TABLE(wxPickerBase, wxControl) - EVT_SIZE(wxPickerBase::OnSize) - WX_EVENT_TABLE_CONTROL_CONTAINER(wxPickerBase) -END_EVENT_TABLE() -WX_DELEGATE_TO_CONTROL_CONTAINER(wxPickerBase, wxControl) - - -// ---------------------------------------------------------------------------- -// wxPickerBase -// ---------------------------------------------------------------------------- - -bool wxPickerBase::CreateBase(wxWindow *parent, - wxWindowID id, - const wxString &text, - const wxPoint& pos, - const wxSize& size, - long style, - const wxValidator& validator, - const wxString& name) -{ - // remove any border style from our style as wxPickerBase's window must be - // invisible (user styles must be set on the textctrl or the platform-dependent picker) - style &= ~wxBORDER_MASK; - if (!wxControl::Create(parent, id, pos, size, style | wxNO_BORDER | wxTAB_TRAVERSAL, - validator, name)) - return false; - - m_sizer = new wxBoxSizer(wxHORIZONTAL); - - if (HasFlag(wxPB_USE_TEXTCTRL)) - { - // NOTE: the style of this class (wxPickerBase) and the style of the - // attached text control are different: GetTextCtrlStyle() extracts - // the styles related to the textctrl from the styles passed here - m_text = new wxTextCtrl(this, wxID_ANY, wxEmptyString, - wxDefaultPosition, wxDefaultSize, - GetTextCtrlStyle(style)); - if (!m_text) - { - wxFAIL_MSG( wxT("wxPickerBase's textctrl creation failed") ); - return false; - } - - // set the maximum lenght allowed for this textctrl. - // This is very important since any change to it will trigger an update in - // the m_picker; for very long strings, this real-time synchronization could - // become a CPU-blocker and thus should be avoided. - // 32 characters will be more than enough for all common uses. - m_text->SetMaxLength(32); - - // set the initial contents of the textctrl - m_text->SetValue(text); - - m_text->Connect(m_text->GetId(), wxEVT_COMMAND_TEXT_UPDATED, - wxCommandEventHandler(wxPickerBase::OnTextCtrlUpdate), - NULL, this); - m_text->Connect(m_text->GetId(), wxEVT_KILL_FOCUS, - wxFocusEventHandler(wxPickerBase::OnTextCtrlKillFocus), - NULL, this); - - m_text->Connect(m_text->GetId(), wxEVT_DESTROY, - wxWindowDestroyEventHandler(wxPickerBase::OnTextCtrlDelete), - NULL, this); - - // the text control's proportion values defaults to 2 - m_sizer->Add(m_text, 2, GetDefaultTextCtrlFlag(), 5); - } - - return true; -} - -void wxPickerBase::PostCreation() -{ - // the picker's proportion value defaults to 1 when there's no text control - // associated with it - in that case it defaults to 0 - m_sizer->Add(m_picker, HasTextCtrl() ? 0 : 1, GetDefaultPickerCtrlFlag(), 5); - - SetSizer(m_sizer); - SetMinSize( m_sizer->GetMinSize() ); -} - -#if wxUSE_TOOLTIPS - -void wxPickerBase::DoSetToolTip(wxToolTip *tip) -{ - // don't set the tooltip on us but rather on our two child windows - // as otherwise it would appear only when the cursor is placed on the - // small area around the child windows which belong to wxPickerBase - m_picker->SetToolTip(tip); - - // do a copy as wxWindow will own the pointer we pass - if ( m_text ) - m_text->SetToolTip(tip ? new wxToolTip(tip->GetTip()) : NULL); -} - -#endif // wxUSE_TOOLTIPS - -// ---------------------------------------------------------------------------- -// wxPickerBase - event handlers -// ---------------------------------------------------------------------------- - -void wxPickerBase::OnTextCtrlKillFocus(wxFocusEvent& event) -{ - event.Skip(); - - // don't leave the textctrl empty - if (m_text && m_text->GetValue().empty()) - UpdateTextCtrlFromPicker(); -} - -void wxPickerBase::OnTextCtrlDelete(wxWindowDestroyEvent &) -{ - // the textctrl has been deleted; our pointer is invalid! - m_text = NULL; -} - -void wxPickerBase::OnTextCtrlUpdate(wxCommandEvent &) -{ - // for each text-change, update the picker - UpdatePickerFromTextCtrl(); -} - -void wxPickerBase::OnSize(wxSizeEvent &event) -{ - if (GetAutoLayout()) - Layout(); - event.Skip(); -} - -#endif // Any picker in use diff --git a/wxWidgets/src/common/platinfo.cpp b/wxWidgets/src/common/platinfo.cpp deleted file mode 100644 index bf33db2e6b..0000000000 --- a/wxWidgets/src/common/platinfo.cpp +++ /dev/null @@ -1,336 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: src/common/platinfo.cpp -// Purpose: implements wxPlatformInfo class -// Author: Francesco Montorsi -// Modified by: -// Created: 07.07.2006 (based on wxToolkitInfo) -// RCS-ID: $Id: platinfo.cpp 44078 2006-12-30 21:46:22Z SN $ -// Copyright: (c) 2006 Francesco Montorsi -// License: wxWindows license -/////////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -// for compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#include "wx/platinfo.h" - -#ifndef WX_PRECOMP - #include "wx/app.h" - #include "wx/utils.h" -#endif //WX_PRECOMP - -#include "wx/apptrait.h" - -// global object -// VERY IMPORTANT: do not use the default constructor since it would -// try to init the wxPlatformInfo instance using -// gs_platInfo itself! -static wxPlatformInfo gs_platInfo(wxPORT_UNKNOWN); - -// ---------------------------------------------------------------------------- -// constants -// ---------------------------------------------------------------------------- - -static const wxChar* const wxOperatingSystemIdNames[] = -{ - _T("Apple Mac OS"), - _T("Apple Mac OS X"), - - _T("Microsoft Windows 9X"), - _T("Microsoft Windows NT"), - _T("Microsoft Windows Micro"), - _T("Microsoft Windows CE"), - - _T("Linux"), - _T("FreeBSD"), - _T("OpenBSD"), - _T("NetBSD"), - - _T("SunOS"), - _T("AIX"), - _T("HPUX"), - - _T("Other Unix"), - _T("Other Unix"), - - _T("DOS"), - _T("OS/2") -}; - -static const wxChar* const wxPortIdNames[] = -{ - _T("wxBase"), - _T("wxMSW"), - _T("wxMotif"), - _T("wxGTK"), - _T("wxMGL"), - _T("wxX11"), - _T("wxOS2"), - _T("wxMac"), - _T("wxCocoa"), - _T("wxWinCE"), - _T("wxPalmOS"), - _T("wxDFB") -}; - -static const wxChar* const wxArchitectureNames[] = -{ - _T("32 bit"), - _T("64 bit") -}; - -static const wxChar* const wxEndiannessNames[] = -{ - _T("Big endian"), - _T("Little endian"), - _T("PDP endian") -}; - -// ---------------------------------------------------------------------------- -// local functions -// ---------------------------------------------------------------------------- - -// returns log in base 2 of the value, this maps the enum values to the -// corresponding indices -static unsigned wxGetIndexFromEnumValue(int value) -{ - wxCHECK_MSG( value, (unsigned)-1, _T("invalid enum value") ); - - int n = 0; - while ( !(value & 1) ) - { - value >>= 1; - n++; - } - - wxASSERT_MSG( value == 1, _T("more than one bit set in enum value") ); - - return n; -} - -// ---------------------------------------------------------------------------- -// wxPlatformInfo -// ---------------------------------------------------------------------------- - -wxPlatformInfo::wxPlatformInfo() -{ - // just copy platform info for currently running platform - *this = Get(); -} - -wxPlatformInfo::wxPlatformInfo(wxPortId pid, int tkMajor, int tkMinor, - wxOperatingSystemId id, int osMajor, int osMinor, - wxArchitecture arch, - wxEndianness endian, - bool usingUniversal) -{ - m_tkVersionMajor = tkMajor; - m_tkVersionMinor = tkMinor; - m_port = pid; - m_usingUniversal = usingUniversal; - - m_os = id; - m_osVersionMajor = osMajor; - m_osVersionMinor = osMinor; - - m_endian = endian; - m_arch = arch; -} - -bool wxPlatformInfo::operator==(const wxPlatformInfo &t) const -{ - return m_tkVersionMajor == t.m_tkVersionMajor && - m_tkVersionMinor == t.m_tkVersionMinor && - m_osVersionMajor == t.m_osVersionMajor && - m_osVersionMinor == t.m_osVersionMinor && - m_os == t.m_os && - m_port == t.m_port && - m_usingUniversal == t.m_usingUniversal && - m_arch == t.m_arch && - m_endian == t.m_endian; -} - -void wxPlatformInfo::InitForCurrentPlatform() -{ - // autodetect all informations - const wxAppTraits * const traits = wxTheApp ? wxTheApp->GetTraits() : NULL; - if ( !traits ) - { - wxFAIL_MSG( _T("failed to initialize wxPlatformInfo") ); - - m_port = wxPORT_UNKNOWN; - m_usingUniversal = false; - m_tkVersionMajor = - m_tkVersionMinor = 0; - } - else - { - m_port = traits->GetToolkitVersion(&m_tkVersionMajor, &m_tkVersionMinor); - m_usingUniversal = traits->IsUsingUniversalWidgets(); - } - - m_os = wxGetOsVersion(&m_osVersionMajor, &m_osVersionMinor); - m_endian = wxIsPlatformLittleEndian() ? wxENDIAN_LITTLE : wxENDIAN_BIG; - m_arch = wxIsPlatform64Bit() ? wxARCH_64 : wxARCH_32; -} - -/* static */ -const wxPlatformInfo& wxPlatformInfo::Get() -{ - static bool initialized = false; - if ( !initialized ) - { - gs_platInfo.InitForCurrentPlatform(); - initialized = true; - } - - return gs_platInfo; -} - - - -// ---------------------------------------------------------------------------- -// wxPlatformInfo - enum -> string conversions -// ---------------------------------------------------------------------------- - -wxString wxPlatformInfo::GetOperatingSystemFamilyName(wxOperatingSystemId os) -{ - const wxChar* string = _T("Unknown"); - if ( os & wxOS_MAC ) - string = _T("Macintosh"); - else if ( os & wxOS_WINDOWS ) - string = _T("Windows"); - else if ( os & wxOS_UNIX ) - string = _T("Unix"); - else if ( os == wxOS_DOS ) - string = _T("DOS"); - else if ( os == wxOS_OS2 ) - string = _T("OS/2"); - - return string; -} - -wxString wxPlatformInfo::GetOperatingSystemIdName(wxOperatingSystemId os) -{ - const unsigned idx = wxGetIndexFromEnumValue(os); - - wxCHECK_MSG( idx < WXSIZEOF(wxOperatingSystemIdNames), wxEmptyString, - _T("invalid OS id") ); - - return wxOperatingSystemIdNames[idx]; -} - -wxString wxPlatformInfo::GetPortIdName(wxPortId port, bool usingUniversal) -{ - const unsigned idx = wxGetIndexFromEnumValue(port); - - wxCHECK_MSG( idx < WXSIZEOF(wxPortIdNames), wxEmptyString, - _T("invalid port id") ); - - wxString ret = wxPortIdNames[idx]; - - if ( usingUniversal ) - ret += wxT("/wxUniversal"); - - return ret; -} - -wxString wxPlatformInfo::GetPortIdShortName(wxPortId port, bool usingUniversal) -{ - const unsigned idx = wxGetIndexFromEnumValue(port); - - wxCHECK_MSG( idx < WXSIZEOF(wxPortIdNames), wxEmptyString, - _T("invalid port id") ); - - wxString ret = wxPortIdNames[idx]; - ret = ret.Mid(2).Lower(); // remove 'wx' prefix - - if ( usingUniversal ) - ret += wxT("univ"); - - return ret; -} - -wxString wxPlatformInfo::GetArchName(wxArchitecture arch) -{ - wxCOMPILE_TIME_ASSERT( WXSIZEOF(wxArchitectureNames) == wxARCH_MAX, - wxArchitectureNamesMismatch ); - - return wxArchitectureNames[arch]; -} - -wxString wxPlatformInfo::GetEndiannessName(wxEndianness end) -{ - wxCOMPILE_TIME_ASSERT( WXSIZEOF(wxEndiannessNames) == wxENDIAN_MAX, - wxEndiannessNamesMismatch ); - - return wxEndiannessNames[end]; -} - - -// ---------------------------------------------------------------------------- -// wxPlatformInfo - string -> enum conversions -// ---------------------------------------------------------------------------- - -wxOperatingSystemId wxPlatformInfo::GetOperatingSystemId(const wxString &str) -{ - for ( size_t i = 0; i < WXSIZEOF(wxOperatingSystemIdNames); i++ ) - { - if ( wxString(wxOperatingSystemIdNames[i]).CmpNoCase(str) == 0 ) - return (wxOperatingSystemId)(1 << i); - } - - return wxOS_UNKNOWN; -} - -wxPortId wxPlatformInfo::GetPortId(const wxString &str) -{ - // recognize both short and long port names - for ( size_t i = 0; i < WXSIZEOF(wxPortIdNames); i++ ) - { - wxPortId current = (wxPortId)(1 << i); - - if ( wxString(wxPortIdNames[i]).CmpNoCase(str) == 0 || - GetPortIdShortName(current, true).CmpNoCase(str) == 0 || - GetPortIdShortName(current, false).CmpNoCase(str) == 0 ) - return current; - } - - return wxPORT_UNKNOWN; -} - -wxArchitecture wxPlatformInfo::GetArch(const wxString &arch) -{ - if ( arch.Contains(wxT("32")) ) - return wxARCH_32; - - if ( arch.Contains(wxT("64")) ) - return wxARCH_64; - - return wxARCH_INVALID; -} - -wxEndianness wxPlatformInfo::GetEndianness(const wxString& end) -{ - wxString endl(end.Lower()); - if ( end.StartsWith(wxT("little")) ) - return wxENDIAN_LITTLE; - - if ( end.StartsWith(wxT("big")) ) - return wxENDIAN_BIG; - - return wxENDIAN_INVALID; -} - diff --git a/wxWidgets/src/common/popupcmn.cpp b/wxWidgets/src/common/popupcmn.cpp deleted file mode 100644 index 7582c313e1..0000000000 --- a/wxWidgets/src/common/popupcmn.cpp +++ /dev/null @@ -1,623 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: src/common/popupcmn.cpp -// Purpose: implementation of wxPopupTransientWindow -// Author: Vadim Zeitlin -// Modified by: -// Created: 06.01.01 -// RCS-ID: $Id: popupcmn.cpp 61466 2009-07-19 16:45:08Z VZ $ -// Copyright: (c) 2001 Vadim Zeitlin -// License: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_POPUPWIN - -#include "wx/popupwin.h" - -#ifndef WX_PRECOMP - #include "wx/combobox.h" // wxComboCtrl - #include "wx/app.h" // wxPostEvent - #include "wx/log.h" -#endif //WX_PRECOMP - -#include "wx/display.h" -#include "wx/recguard.h" - -#ifdef __WXUNIVERSAL__ - #include "wx/univ/renderer.h" - #include "wx/scrolbar.h" -#endif // __WXUNIVERSAL__ - -#ifdef __WXGTK__ - #include -#elif defined(__WXMSW__) - #include "wx/msw/private.h" -#elif defined(__WXX11__) - #include "wx/x11/private.h" -#endif - -IMPLEMENT_DYNAMIC_CLASS(wxPopupWindow, wxWindow) -IMPLEMENT_DYNAMIC_CLASS(wxPopupTransientWindow, wxPopupWindow) - -#if wxUSE_COMBOBOX && defined(__WXUNIVERSAL__) - IMPLEMENT_DYNAMIC_CLASS(wxPopupComboWindow, wxPopupTransientWindow) -#endif - -// ---------------------------------------------------------------------------- -// private classes -// ---------------------------------------------------------------------------- - -// event handlers which we use to intercept events which cause the popup to -// disappear -class wxPopupWindowHandler : public wxEvtHandler -{ -public: - wxPopupWindowHandler(wxPopupTransientWindow *popup) : m_popup(popup) {} - -protected: - // event handlers - void OnLeftDown(wxMouseEvent& event); - -private: - wxPopupTransientWindow *m_popup; - - DECLARE_EVENT_TABLE() - DECLARE_NO_COPY_CLASS(wxPopupWindowHandler) -}; - -class wxPopupFocusHandler : public wxEvtHandler -{ -public: - wxPopupFocusHandler(wxPopupTransientWindow *popup) : m_popup(popup) {} - -protected: - void OnKillFocus(wxFocusEvent& event); - void OnKeyDown(wxKeyEvent& event); - -private: - wxPopupTransientWindow *m_popup; - - DECLARE_EVENT_TABLE() - DECLARE_NO_COPY_CLASS(wxPopupFocusHandler) -}; - -// ---------------------------------------------------------------------------- -// event tables -// ---------------------------------------------------------------------------- - -BEGIN_EVENT_TABLE(wxPopupWindowHandler, wxEvtHandler) - EVT_LEFT_DOWN(wxPopupWindowHandler::OnLeftDown) -END_EVENT_TABLE() - -BEGIN_EVENT_TABLE(wxPopupFocusHandler, wxEvtHandler) - EVT_KILL_FOCUS(wxPopupFocusHandler::OnKillFocus) - EVT_KEY_DOWN(wxPopupFocusHandler::OnKeyDown) -END_EVENT_TABLE() - -BEGIN_EVENT_TABLE(wxPopupTransientWindow, wxPopupWindow) -#if defined( __WXMSW__ ) || defined( __WXMAC__ ) - EVT_IDLE(wxPopupTransientWindow::OnIdle) -#endif -END_EVENT_TABLE() - -// ============================================================================ -// implementation -// ============================================================================ - -// ---------------------------------------------------------------------------- -// wxPopupWindowBase -// ---------------------------------------------------------------------------- - -wxPopupWindowBase::~wxPopupWindowBase() -{ - // this destructor is required for Darwin -} - -bool wxPopupWindowBase::Create(wxWindow* WXUNUSED(parent), int WXUNUSED(flags)) -{ - return true; -} - -void wxPopupWindowBase::Position(const wxPoint& ptOrigin, - const wxSize& size) -{ - // determine the position and size of the screen we clamp the popup to - wxPoint posScreen; - wxSize sizeScreen; - - const int displayNum = wxDisplay::GetFromPoint(ptOrigin); - if ( displayNum != wxNOT_FOUND ) - { - const wxRect rectScreen = wxDisplay(displayNum).GetGeometry(); - posScreen = rectScreen.GetPosition(); - sizeScreen = rectScreen.GetSize(); - } - else // outside of any display? - { - // just use the primary one then - posScreen = wxPoint(0, 0); - sizeScreen = wxGetDisplaySize(); - } - - - const wxSize sizeSelf = GetSize(); - - // is there enough space to put the popup below the window (where we put it - // by default)? - wxCoord y = ptOrigin.y + size.y; - if ( y + sizeSelf.y > posScreen.y + sizeScreen.y ) - { - // check if there is enough space above - if ( ptOrigin.y > sizeSelf.y ) - { - // do position the control above the window - y -= size.y + sizeSelf.y; - } - //else: not enough space below nor above, leave below - } - - // now check left/right too - wxCoord x = ptOrigin.x; - - if ( wxTheApp->GetLayoutDirection() == wxLayout_RightToLeft ) - { - // shift the window to the left instead of the right. - x -= size.x; - x -= sizeSelf.x; // also shift it by window width. - } - else - x += size.x; - - - if ( x + sizeSelf.x > posScreen.x + sizeScreen.x ) - { - // check if there is enough space to the left - if ( ptOrigin.x > sizeSelf.x ) - { - // do position the control to the left - x -= size.x + sizeSelf.x; - } - //else: not enough space there neither, leave in default position - } - - Move(x, y, wxSIZE_NO_ADJUSTMENTS); -} - -// ---------------------------------------------------------------------------- -// wxPopupTransientWindow -// ---------------------------------------------------------------------------- - -void wxPopupTransientWindow::Init() -{ - m_child = - m_focus = (wxWindow *)NULL; - - m_handlerFocus = NULL; - m_handlerPopup = NULL; -} - -wxPopupTransientWindow::wxPopupTransientWindow(wxWindow *parent, int style) -{ - Init(); - - (void)Create(parent, style); -} - -wxPopupTransientWindow::~wxPopupTransientWindow() -{ - if (m_handlerPopup && m_handlerPopup->GetNextHandler()) - PopHandlers(); - - wxASSERT(!m_handlerFocus || !m_handlerFocus->GetNextHandler()); - wxASSERT(!m_handlerPopup || !m_handlerPopup->GetNextHandler()); - - delete m_handlerFocus; - delete m_handlerPopup; -} - -void wxPopupTransientWindow::PopHandlers() -{ - if ( m_child ) - { - if ( !m_child->RemoveEventHandler(m_handlerPopup) ) - { - // something is very wrong and someone else probably deleted our - // handler - so don't risk deleting it second time - m_handlerPopup = NULL; - } - if (m_child->HasCapture()) - { - m_child->ReleaseMouse(); - } - m_child = NULL; - } - - if ( m_focus ) - { - if ( !m_focus->RemoveEventHandler(m_handlerFocus) ) - { - // see above - m_handlerFocus = NULL; - } - } - m_focus = NULL; -} - -void wxPopupTransientWindow::Popup(wxWindow *winFocus) -{ - const wxWindowList& children = GetChildren(); - if ( children.GetCount() ) - { - m_child = children.GetFirst()->GetData(); - } - else - { - m_child = this; - } - - Show(); - - // There is is a problem if these are still in use - wxASSERT(!m_handlerFocus || !m_handlerFocus->GetNextHandler()); - wxASSERT(!m_handlerPopup || !m_handlerPopup->GetNextHandler()); - - if (!m_handlerPopup) - m_handlerPopup = new wxPopupWindowHandler(this); - - m_child->PushEventHandler(m_handlerPopup); - -#if defined(__WXMSW__) - // Focusing on child of popup window does not work on MSW unless WS_POPUP - // style is set. We do not even want to try to set the focus, as it may - // provoke errors on some Windows versions (Vista and later). - if ( ::GetWindowLong(GetHwnd(), GWL_STYLE) & WS_POPUP ) -#endif - { - m_focus = winFocus ? winFocus : this; - m_focus->SetFocus(); - } - -#if defined( __WXMSW__ ) || defined( __WXMAC__ ) - // MSW doesn't allow to set focus to the popup window, but we need to - // subclass the window which has the focus, and not winFocus passed in or - // otherwise everything else breaks down - m_focus = FindFocus(); -#elif defined(__WXGTK__) - // GTK+ catches the activate events from the popup - // window, not the focus events from the child window - m_focus = this; -#endif - - if ( m_focus ) - { - if (!m_handlerFocus) - m_handlerFocus = new wxPopupFocusHandler(this); - - m_focus->PushEventHandler(m_handlerFocus); - } -} - -bool wxPopupTransientWindow::Show( bool show ) -{ -#ifdef __WXGTK__ - if (!show) - { - gdk_pointer_ungrab( (guint32)GDK_CURRENT_TIME ); - - gtk_grab_remove( m_widget ); - } -#endif - -#ifdef __WXX11__ - if (!show) - { - XUngrabPointer( wxGlobalDisplay(), CurrentTime ); - } -#endif - -#if defined( __WXMSW__ ) || defined( __WMAC__ ) - if (!show && m_child && m_child->HasCapture()) - { - m_child->ReleaseMouse(); - } -#endif - - bool ret = wxPopupWindow::Show( show ); - -#ifdef __WXGTK__ - if (show) - { - gtk_grab_add( m_widget ); - - gdk_pointer_grab( m_widget->window, TRUE, - (GdkEventMask) - (GDK_BUTTON_PRESS_MASK | - GDK_BUTTON_RELEASE_MASK | - GDK_POINTER_MOTION_HINT_MASK | - GDK_POINTER_MOTION_MASK), - (GdkWindow *) NULL, - (GdkCursor *) NULL, - (guint32)GDK_CURRENT_TIME ); - } -#endif - -#ifdef __WXX11__ - if (show) - { - Window xwindow = (Window) m_clientWindow; - - /* int res =*/ XGrabPointer(wxGlobalDisplay(), xwindow, - True, - ButtonPressMask | ButtonReleaseMask | ButtonMotionMask | EnterWindowMask | LeaveWindowMask | PointerMotionMask, - GrabModeAsync, - GrabModeAsync, - None, - None, - CurrentTime ); - } -#endif - -#if defined( __WXMSW__ ) || defined( __WMAC__ ) - if (show && m_child) - { - // Assume that the mouse is outside the popup to begin with - m_child->CaptureMouse(); - } -#endif - - return ret; -} - -void wxPopupTransientWindow::Dismiss() -{ - Hide(); - PopHandlers(); -} - -void wxPopupTransientWindow::DismissAndNotify() -{ - Dismiss(); - OnDismiss(); -} - -void wxPopupTransientWindow::OnDismiss() -{ - // nothing to do here - but it may be interesting for derived class -} - -bool wxPopupTransientWindow::ProcessLeftDown(wxMouseEvent& WXUNUSED(event)) -{ - // no special processing here - return false; -} - -#if defined( __WXMSW__ ) || defined( __WXMAC__ ) -void wxPopupTransientWindow::OnIdle(wxIdleEvent& event) -{ - event.Skip(); - - if (IsShown() && m_child) - { - wxPoint pos = ScreenToClient(wxGetMousePosition()); - wxRect rect(GetSize()); - - if ( rect.Contains(pos) ) - { - if ( m_child->HasCapture() ) - { - m_child->ReleaseMouse(); - } - } - else - { - if ( !m_child->HasCapture() ) - { - m_child->CaptureMouse(); - } - } - } -} -#endif // __WXMSW__ - - -#if wxUSE_COMBOBOX && defined(__WXUNIVERSAL__) - -// ---------------------------------------------------------------------------- -// wxPopupComboWindow -// ---------------------------------------------------------------------------- - -BEGIN_EVENT_TABLE(wxPopupComboWindow, wxPopupTransientWindow) - EVT_KEY_DOWN(wxPopupComboWindow::OnKeyDown) -END_EVENT_TABLE() - -wxPopupComboWindow::wxPopupComboWindow(wxComboCtrl *parent) - : wxPopupTransientWindow(parent) -{ - m_combo = parent; -} - -bool wxPopupComboWindow::Create(wxComboCtrl *parent) -{ - m_combo = parent; - - return wxPopupWindow::Create(parent); -} - -void wxPopupComboWindow::PositionNearCombo() -{ - // the origin point must be in screen coords - wxPoint ptOrigin = m_combo->ClientToScreen(wxPoint(0,0)); - -#if 0 //def __WXUNIVERSAL__ - // account for the fact that (0, 0) is not the top left corner of the - // window: there is also the border - wxRect rectBorders = m_combo->GetRenderer()-> - GetBorderDimensions(m_combo->GetBorder()); - ptOrigin.x -= rectBorders.x; - ptOrigin.y -= rectBorders.y; -#endif // __WXUNIVERSAL__ - - // position below or above the combobox: the width is 0 to put it exactly - // below us, not to the left or to the right - Position(ptOrigin, wxSize(0, m_combo->GetSize().y)); -} - -void wxPopupComboWindow::OnDismiss() -{ - m_combo->OnPopupDismiss(); -} - -void wxPopupComboWindow::OnKeyDown(wxKeyEvent& event) -{ - m_combo->ProcessEvent(event); -} - -#endif // wxUSE_COMBOBOX && defined(__WXUNIVERSAL__) - -// ---------------------------------------------------------------------------- -// wxPopupWindowHandler -// ---------------------------------------------------------------------------- - -void wxPopupWindowHandler::OnLeftDown(wxMouseEvent& event) -{ - // let the window have it first (we're the first event handler in the chain - // of handlers for this window) - if ( m_popup->ProcessLeftDown(event) ) - { - return; - } - - wxPoint pos = event.GetPosition(); - - // in non-Univ ports the system manages scrollbars for us -#if defined(__WXUNIVERSAL__) && wxUSE_SCROLLBAR - // scrollbar on which the click occurred - wxWindow *sbar = NULL; -#endif // __WXUNIVERSAL__ && wxUSE_SCROLLBAR - - wxWindow *win = (wxWindow *)event.GetEventObject(); - - switch ( win->HitTest(pos.x, pos.y) ) - { - case wxHT_WINDOW_OUTSIDE: - { - // do the coords translation now as after DismissAndNotify() - // m_popup may be destroyed - wxMouseEvent event2(event); - - m_popup->ClientToScreen(&event2.m_x, &event2.m_y); - - // clicking outside a popup dismisses it - m_popup->DismissAndNotify(); - - // dismissing a tooltip shouldn't waste a click, i.e. you - // should be able to dismiss it and press the button with the - // same click, so repost this event to the window beneath us - wxWindow *winUnder = wxFindWindowAtPoint(event2.GetPosition()); - if ( winUnder ) - { - // translate the event coords to the ones of the window - // which is going to get the event - winUnder->ScreenToClient(&event2.m_x, &event2.m_y); - - event2.SetEventObject(winUnder); - wxPostEvent(winUnder, event2); - } - } - break; - -#if defined(__WXUNIVERSAL__) && wxUSE_SCROLLBAR - case wxHT_WINDOW_HORZ_SCROLLBAR: - sbar = win->GetScrollbar(wxHORIZONTAL); - break; - - case wxHT_WINDOW_VERT_SCROLLBAR: - sbar = win->GetScrollbar(wxVERTICAL); - break; -#endif // __WXUNIVERSAL__ && wxUSE_SCROLLBAR - - default: - // forgot to update the switch after adding a new hit test code? - wxFAIL_MSG( _T("unexpected HitTest() return value") ); - // fall through - - case wxHT_WINDOW_CORNER: - // don't actually know if this one is good for anything, but let it - // pass just in case - - case wxHT_WINDOW_INSIDE: - // let the normal processing take place - event.Skip(); - break; - } - -#if defined(__WXUNIVERSAL__) && wxUSE_SCROLLBAR - if ( sbar ) - { - // translate the event coordinates to the scrollbar ones - pos = sbar->ScreenToClient(win->ClientToScreen(pos)); - - // and give the event to it - wxMouseEvent event2 = event; - event2.m_x = pos.x; - event2.m_y = pos.y; - - (void)sbar->GetEventHandler()->ProcessEvent(event2); - } -#endif // __WXUNIVERSAL__ && wxUSE_SCROLLBAR -} - -// ---------------------------------------------------------------------------- -// wxPopupFocusHandler -// ---------------------------------------------------------------------------- - -void wxPopupFocusHandler::OnKillFocus(wxFocusEvent& event) -{ - // when we lose focus we always disappear - unless it goes to the popup (in - // which case we don't really lose it) - wxWindow *win = event.GetWindow(); - while ( win ) - { - if ( win == m_popup ) - return; - win = win->GetParent(); - } - - m_popup->DismissAndNotify(); -} - -void wxPopupFocusHandler::OnKeyDown(wxKeyEvent& event) -{ - // we can be associated with the popup itself in which case we should avoid - // infinite recursion - static int s_inside; - wxRecursionGuard guard(s_inside); - if ( guard.IsInside() ) - { - event.Skip(); - return; - } - - // let the window have it first, it might process the keys - if ( !m_popup->GetEventHandler()->ProcessEvent(event) ) - { - // by default, dismiss the popup - m_popup->DismissAndNotify(); - } -} - -#endif // wxUSE_POPUPWIN diff --git a/wxWidgets/src/common/powercmn.cpp b/wxWidgets/src/common/powercmn.cpp deleted file mode 100644 index cf2086ff84..0000000000 --- a/wxWidgets/src/common/powercmn.cpp +++ /dev/null @@ -1,59 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: src/common/powercmn.cpp -// Purpose: power event types and stubs for power functions -// Author: Vadim Zeitlin -// Modified by: -// Created: 2006-05-27 -// RCS-ID: $Id: powercmn.cpp 48811 2007-09-19 23:11:28Z RD $ -// Copyright: (c) 2006 Vadim Zeitlin -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -// for compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#ifndef WX_PRECOMP -#endif //WX_PRECOMP - -#include "wx/power.h" - -// ============================================================================ -// implementation -// ============================================================================ - -#ifdef wxHAS_POWER_EVENTS - DEFINE_EVENT_TYPE(wxEVT_POWER_SUSPENDING) - DEFINE_EVENT_TYPE(wxEVT_POWER_SUSPENDED) - DEFINE_EVENT_TYPE(wxEVT_POWER_SUSPEND_CANCEL) - DEFINE_EVENT_TYPE(wxEVT_POWER_RESUME) - - IMPLEMENT_ABSTRACT_CLASS(wxPowerEvent, wxEvent) -#endif - -// provide stubs for the systems not implementing these functions -#if !defined(__WXPALMOS__) && !defined(__WXMSW__) - -wxPowerType wxGetPowerType() -{ - return wxPOWER_UNKNOWN; -} - -wxBatteryState wxGetBatteryState() -{ - return wxBATTERY_UNKNOWN_STATE; -} - -#endif // systems without power management functions - diff --git a/wxWidgets/src/common/prntbase.cpp b/wxWidgets/src/common/prntbase.cpp deleted file mode 100644 index b45b319b8f..0000000000 --- a/wxWidgets/src/common/prntbase.cpp +++ /dev/null @@ -1,1869 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/common/prntbase.cpp -// Purpose: Printing framework base class implementation -// Author: Julian Smart -// Modified by: -// Created: 04/01/98 -// RCS-ID: $Id: prntbase.cpp 60850 2009-06-01 10:16:13Z JS $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_PRINTING_ARCHITECTURE - -// change this to 1 to use experimental high-quality printing on Windows -// (NB: this can't be in msw/printwin.cpp because of binary compatibility) -#define wxUSE_HIGH_QUALITY_PREVIEW_IN_WXMSW 0 - -#if wxUSE_HIGH_QUALITY_PREVIEW_IN_WXMSW - #if !defined(__WXMSW__) || !wxUSE_IMAGE || !wxUSE_WXDIB - #undef wxUSE_HIGH_QUALITY_PREVIEW_IN_WXMSW - #define wxUSE_HIGH_QUALITY_PREVIEW_IN_WXMSW 0 - #endif -#endif - -#if wxUSE_HIGH_QUALITY_PREVIEW_IN_WXMSW -#include "wx/msw/enhmeta.h" -#endif - -#if wxUSE_HIGH_QUALITY_PREVIEW_IN_WXMSW && !wxUSE_ENH_METAFILE_FROM_DC -#error Please set wxUSE_ENH_METAFILE_FROM_DC to 1 in include/wx/msw/enhmeta.h. -#endif - -#include "wx/dcprint.h" - -#ifndef WX_PRECOMP - #if defined(__WXMSW__) - #include "wx/msw/wrapcdlg.h" - #endif // MSW - #include "wx/utils.h" - #include "wx/dc.h" - #include "wx/app.h" - #include "wx/math.h" - #include "wx/msgdlg.h" - #include "wx/layout.h" - #include "wx/choice.h" - #include "wx/button.h" - #include "wx/settings.h" - #include "wx/dcmemory.h" - #include "wx/stattext.h" - #include "wx/intl.h" - #include "wx/textdlg.h" - #include "wx/sizer.h" - #include "wx/module.h" -#endif // !WX_PRECOMP - -#include "wx/prntbase.h" -#include "wx/printdlg.h" -#include "wx/print.h" -#include "wx/dcprint.h" - -#include -#include - -#if defined(__WXMSW__) && !defined(__WXUNIVERSAL__) -#include "wx/msw/printdlg.h" -#elif defined(__WXMAC__) -#include "wx/mac/printdlg.h" -#include "wx/mac/private/print.h" -#else -#include "wx/generic/prntdlgg.h" -#include "wx/dcps.h" -#endif - -#ifdef __WXMSW__ - #ifndef __WIN32__ - #include - #endif -#endif // __WXMSW__ - -#if wxUSE_HIGH_QUALITY_PREVIEW_IN_WXMSW - -#include "wx/msw/dib.h" -#include "wx/image.h" - -typedef bool (wxPrintPreviewBase::*RenderPageIntoDCFunc)(wxDC&, int); -static bool RenderPageIntoBitmapHQ(wxPrintPreviewBase *preview, - RenderPageIntoDCFunc RenderPageIntoDC, - wxBitmap& bmp, int pageNum); -#endif // wxUSE_HIGH_QUALITY_PREVIEW_IN_WXMSW - -//---------------------------------------------------------------------------- -// wxPrintFactory -//---------------------------------------------------------------------------- - -wxPrintFactory *wxPrintFactory::m_factory = NULL; - -void wxPrintFactory::SetPrintFactory( wxPrintFactory *factory ) -{ - if (wxPrintFactory::m_factory) - delete wxPrintFactory::m_factory; - - wxPrintFactory::m_factory = factory; -} - -wxPrintFactory *wxPrintFactory::GetFactory() -{ - if (!wxPrintFactory::m_factory) - wxPrintFactory::m_factory = new wxNativePrintFactory; - - return wxPrintFactory::m_factory; -} - -//---------------------------------------------------------------------------- -// wxNativePrintFactory -//---------------------------------------------------------------------------- - -wxPrinterBase *wxNativePrintFactory::CreatePrinter( wxPrintDialogData *data ) -{ -#if defined(__WXMSW__) && !defined(__WXUNIVERSAL__) - return new wxWindowsPrinter( data ); -#elif defined(__WXMAC__) - return new wxMacPrinter( data ); -#elif defined(__WXPM__) - return new wxOS2Printer( data ); -#else - return new wxPostScriptPrinter( data ); -#endif -} - -wxPrintPreviewBase *wxNativePrintFactory::CreatePrintPreview( wxPrintout *preview, - wxPrintout *printout, wxPrintDialogData *data ) -{ -#if defined(__WXMSW__) && !defined(__WXUNIVERSAL__) - return new wxWindowsPrintPreview( preview, printout, data ); -#elif defined(__WXMAC__) - return new wxMacPrintPreview( preview, printout, data ); -#elif defined(__WXPM__) - return new wxOS2PrintPreview( preview, printout, data ); -#else - return new wxPostScriptPrintPreview( preview, printout, data ); -#endif -} - -wxPrintPreviewBase *wxNativePrintFactory::CreatePrintPreview( wxPrintout *preview, - wxPrintout *printout, wxPrintData *data ) -{ -#if defined(__WXMSW__) && !defined(__WXUNIVERSAL__) - return new wxWindowsPrintPreview( preview, printout, data ); -#elif defined(__WXMAC__) - return new wxMacPrintPreview( preview, printout, data ); -#elif defined(__WXPM__) - return new wxOS2PrintPreview( preview, printout, data ); -#else - return new wxPostScriptPrintPreview( preview, printout, data ); -#endif -} - -wxPrintDialogBase *wxNativePrintFactory::CreatePrintDialog( wxWindow *parent, - wxPrintDialogData *data ) -{ -#if defined(__WXMSW__) && !defined(__WXUNIVERSAL__) - return new wxWindowsPrintDialog( parent, data ); -#elif defined(__WXMAC__) - return new wxMacPrintDialog( parent, data ); -#else - return new wxGenericPrintDialog( parent, data ); -#endif -} - -wxPrintDialogBase *wxNativePrintFactory::CreatePrintDialog( wxWindow *parent, - wxPrintData *data ) -{ -#if defined(__WXMSW__) && !defined(__WXUNIVERSAL__) - return new wxWindowsPrintDialog( parent, data ); -#elif defined(__WXMAC__) - return new wxMacPrintDialog( parent, data ); -#else - return new wxGenericPrintDialog( parent, data ); -#endif -} - -wxPageSetupDialogBase *wxNativePrintFactory::CreatePageSetupDialog( wxWindow *parent, - wxPageSetupDialogData *data ) -{ -#if defined(__WXMSW__) && !defined(__WXUNIVERSAL__) - return new wxWindowsPageSetupDialog( parent, data ); -#elif defined(__WXMAC__) - return new wxMacPageSetupDialog( parent, data ); -#else - return new wxGenericPageSetupDialog( parent, data ); -#endif -} - -bool wxNativePrintFactory::HasPrintSetupDialog() -{ -#if defined(__WXMSW__) && !defined(__WXUNIVERSAL__) - return false; -#elif defined(__WXMAC__) - return false; -#else - // Only here do we need to provide the print setup - // dialog ourselves, the other platforms either have - // none, don't make it accessible or let you configure - // the printer from the wxPrintDialog anyway. - return true; -#endif - -} - -wxDialog *wxNativePrintFactory::CreatePrintSetupDialog( wxWindow *parent, - wxPrintData *data ) -{ -#if defined(__WXMSW__) && !defined(__WXUNIVERSAL__) - wxUnusedVar(parent); - wxUnusedVar(data); - return NULL; -#elif defined(__WXMAC__) - wxUnusedVar(parent); - wxUnusedVar(data); - return NULL; -#else - // Only here do we need to provide the print setup - // dialog ourselves, the other platforms either have - // none, don't make it accessible or let you configure - // the printer from the wxPrintDialog anyway. - return new wxGenericPrintSetupDialog( parent, data ); -#endif -} - -wxDC* wxNativePrintFactory::CreatePrinterDC( const wxPrintData& data ) -{ -#if defined(__WXMSW__) && !defined(__WXUNIVERSAL__) - return new wxPrinterDC(data); -#elif defined(__WXMAC__) - return new wxPrinterDC(data); -#else - return new wxPostScriptDC(data); -#endif -} - -bool wxNativePrintFactory::HasOwnPrintToFile() -{ - // Only relevant for PostScript and here the - // setup dialog provides no "print to file" - // option. In the GNOME setup dialog, the - // setup dialog has its own print to file. - return false; -} - -bool wxNativePrintFactory::HasPrinterLine() -{ - // Only relevant for PostScript for now - return true; -} - -wxString wxNativePrintFactory::CreatePrinterLine() -{ - // Only relevant for PostScript for now - - // We should query "lpstat -d" here - return _("Generic PostScript"); -} - -bool wxNativePrintFactory::HasStatusLine() -{ - // Only relevant for PostScript for now - return true; -} - -wxString wxNativePrintFactory::CreateStatusLine() -{ - // Only relevant for PostScript for now - - // We should query "lpstat -r" or "lpstat -p" here - return _("Ready"); -} - -wxPrintNativeDataBase *wxNativePrintFactory::CreatePrintNativeData() -{ -#if defined(__WXMSW__) && !defined(__WXUNIVERSAL__) - return new wxWindowsPrintNativeData; -#elif defined(__WXMAC__) - return new wxMacCarbonPrintData; -#else - return new wxPostScriptPrintNativeData; -#endif -} - -//---------------------------------------------------------------------------- -// wxPrintNativeDataBase -//---------------------------------------------------------------------------- - -IMPLEMENT_ABSTRACT_CLASS(wxPrintNativeDataBase, wxObject) - -wxPrintNativeDataBase::wxPrintNativeDataBase() -{ - m_ref = 1; -} - -//---------------------------------------------------------------------------- -// wxPrintFactoryModule -//---------------------------------------------------------------------------- - -class wxPrintFactoryModule: public wxModule -{ -public: - wxPrintFactoryModule() {} - bool OnInit() { return true; } - void OnExit() { wxPrintFactory::SetPrintFactory( NULL ); } - -private: - DECLARE_DYNAMIC_CLASS(wxPrintFactoryModule) -}; - -IMPLEMENT_DYNAMIC_CLASS(wxPrintFactoryModule, wxModule) - -//---------------------------------------------------------------------------- -// wxPrinterBase -//---------------------------------------------------------------------------- - -IMPLEMENT_CLASS(wxPrinterBase, wxObject) - -wxPrinterBase::wxPrinterBase(wxPrintDialogData *data) -{ - m_currentPrintout = (wxPrintout *) NULL; - sm_abortWindow = (wxWindow *) NULL; - sm_abortIt = false; - if (data) - m_printDialogData = (*data); - sm_lastError = wxPRINTER_NO_ERROR; -} - -wxWindow *wxPrinterBase::sm_abortWindow = (wxWindow *) NULL; -bool wxPrinterBase::sm_abortIt = false; -wxPrinterError wxPrinterBase::sm_lastError = wxPRINTER_NO_ERROR; - -wxPrinterBase::~wxPrinterBase() -{ -} - -wxWindow *wxPrinterBase::CreateAbortWindow(wxWindow *parent, wxPrintout * printout) -{ - wxPrintAbortDialog *dialog = new wxPrintAbortDialog(parent, _("Printing ") , wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE); - - wxBoxSizer *button_sizer = new wxBoxSizer( wxVERTICAL ); - button_sizer->Add( new wxStaticText(dialog, wxID_ANY, _("Please wait while printing\n") + printout->GetTitle() ), 0, wxALL, 10 ); - button_sizer->Add( new wxButton( dialog, wxID_CANCEL, wxT("Cancel") ), 0, wxALL | wxALIGN_CENTER, 10 ); - - dialog->SetAutoLayout( true ); - dialog->SetSizer( button_sizer ); - - button_sizer->Fit(dialog); - button_sizer->SetSizeHints (dialog) ; - - return dialog; -} - -void wxPrinterBase::ReportError(wxWindow *parent, wxPrintout *WXUNUSED(printout), const wxString& message) -{ - wxMessageBox(message, _("Printing Error"), wxOK, parent); -} - -wxPrintDialogData& wxPrinterBase::GetPrintDialogData() const -{ - return (wxPrintDialogData&) m_printDialogData; -} - -//---------------------------------------------------------------------------- -// wxPrinter -//---------------------------------------------------------------------------- - -IMPLEMENT_CLASS(wxPrinter, wxPrinterBase) - -wxPrinter::wxPrinter(wxPrintDialogData *data) -{ - m_pimpl = wxPrintFactory::GetFactory()->CreatePrinter( data ); -} - -wxPrinter::~wxPrinter() -{ - delete m_pimpl; -} - -wxWindow *wxPrinter::CreateAbortWindow(wxWindow *parent, wxPrintout *printout) -{ - return m_pimpl->CreateAbortWindow( parent, printout ); -} - -void wxPrinter::ReportError(wxWindow *parent, wxPrintout *printout, const wxString& message) -{ - m_pimpl->ReportError( parent, printout, message ); -} - -bool wxPrinter::Setup(wxWindow *parent) -{ - return m_pimpl->Setup( parent ); -} - -bool wxPrinter::Print(wxWindow *parent, wxPrintout *printout, bool prompt) -{ - return m_pimpl->Print( parent, printout, prompt ); -} - -wxDC* wxPrinter::PrintDialog(wxWindow *parent) -{ - return m_pimpl->PrintDialog( parent ); -} - -wxPrintDialogData& wxPrinter::GetPrintDialogData() const -{ - return m_pimpl->GetPrintDialogData(); -} - -// --------------------------------------------------------------------------- -// wxPrintDialogBase: the dialog for printing. -// --------------------------------------------------------------------------- - -IMPLEMENT_ABSTRACT_CLASS(wxPrintDialogBase, wxDialog) - -wxPrintDialogBase::wxPrintDialogBase(wxWindow *parent, - wxWindowID id, - const wxString &title, - const wxPoint &pos, - const wxSize &size, - long style) - : wxDialog( parent, id, title.empty() ? wxString(_("Print")) : title, - pos, size, style ) -{ -} - -// --------------------------------------------------------------------------- -// wxPrintDialog: the dialog for printing -// --------------------------------------------------------------------------- - -IMPLEMENT_CLASS(wxPrintDialog, wxObject) - -wxPrintDialog::wxPrintDialog(wxWindow *parent, wxPrintDialogData* data) -{ - m_pimpl = wxPrintFactory::GetFactory()->CreatePrintDialog( parent, data ); -} - -wxPrintDialog::wxPrintDialog(wxWindow *parent, wxPrintData* data) -{ - m_pimpl = wxPrintFactory::GetFactory()->CreatePrintDialog( parent, data ); -} - -wxPrintDialog::~wxPrintDialog() -{ - delete m_pimpl; -} - -int wxPrintDialog::ShowModal() -{ - return m_pimpl->ShowModal(); -} - -wxPrintDialogData& wxPrintDialog::GetPrintDialogData() -{ - return m_pimpl->GetPrintDialogData(); -} - -wxPrintData& wxPrintDialog::GetPrintData() -{ - return m_pimpl->GetPrintData(); -} - -wxDC *wxPrintDialog::GetPrintDC() -{ - return m_pimpl->GetPrintDC(); -} - -// --------------------------------------------------------------------------- -// wxPageSetupDialogBase: the page setup dialog -// --------------------------------------------------------------------------- - -IMPLEMENT_ABSTRACT_CLASS(wxPageSetupDialogBase, wxDialog) - -wxPageSetupDialogBase::wxPageSetupDialogBase(wxWindow *parent, - wxWindowID id, - const wxString &title, - const wxPoint &pos, - const wxSize &size, - long style) - : wxDialog( parent, id, title.empty() ? wxString(_("Page setup")) : title, - pos, size, style ) -{ -} - -// --------------------------------------------------------------------------- -// wxPageSetupDialog: the page setup dialog -// --------------------------------------------------------------------------- - -IMPLEMENT_CLASS(wxPageSetupDialog, wxObject) - -wxPageSetupDialog::wxPageSetupDialog(wxWindow *parent, wxPageSetupDialogData *data ) -{ - m_pimpl = wxPrintFactory::GetFactory()->CreatePageSetupDialog( parent, data ); -} - -wxPageSetupDialog::~wxPageSetupDialog() -{ - delete m_pimpl; -} - -int wxPageSetupDialog::ShowModal() -{ - return m_pimpl->ShowModal(); -} - -wxPageSetupDialogData& wxPageSetupDialog::GetPageSetupDialogData() -{ - return m_pimpl->GetPageSetupDialogData(); -} - -// old name -wxPageSetupDialogData& wxPageSetupDialog::GetPageSetupData() -{ - return m_pimpl->GetPageSetupDialogData(); -} - -//---------------------------------------------------------------------------- -// wxPrintAbortDialog -//---------------------------------------------------------------------------- - -BEGIN_EVENT_TABLE(wxPrintAbortDialog, wxDialog) - EVT_BUTTON(wxID_CANCEL, wxPrintAbortDialog::OnCancel) -END_EVENT_TABLE() - -void wxPrintAbortDialog::OnCancel(wxCommandEvent& WXUNUSED(event)) -{ - wxPrinterBase::sm_abortIt = true; - wxPrinterBase::sm_abortWindow->Show(false); - wxPrinterBase::sm_abortWindow->Close(true); - wxPrinterBase::sm_abortWindow->Destroy(); - wxPrinterBase::sm_abortWindow = (wxWindow *) NULL; -} - -//---------------------------------------------------------------------------- -// wxPrintout -//---------------------------------------------------------------------------- - -IMPLEMENT_ABSTRACT_CLASS(wxPrintout, wxObject) - -wxPrintout::wxPrintout(const wxString& title) -{ - m_printoutTitle = title ; - m_printoutDC = (wxDC *) NULL; - m_pageWidthMM = 0; - m_pageHeightMM = 0; - m_pageWidthPixels = 0; - m_pageHeightPixels = 0; - m_PPIScreenX = 0; - m_PPIScreenY = 0; - m_PPIPrinterX = 0; - m_PPIPrinterY = 0; - m_isPreview = false; -} - -wxPrintout::~wxPrintout() -{ -} - -bool wxPrintout::OnBeginDocument(int WXUNUSED(startPage), int WXUNUSED(endPage)) -{ - return GetDC()->StartDoc(_("Printing ") + m_printoutTitle); -} - -void wxPrintout::OnEndDocument() -{ - GetDC()->EndDoc(); -} - -void wxPrintout::OnBeginPrinting() -{ -} - -void wxPrintout::OnEndPrinting() -{ -} - -bool wxPrintout::HasPage(int page) -{ - return (page == 1); -} - -void wxPrintout::GetPageInfo(int *minPage, int *maxPage, int *fromPage, int *toPage) -{ - *minPage = 1; - *maxPage = 32000; - *fromPage = 1; - *toPage = 1; -} - -void wxPrintout::FitThisSizeToPaper(const wxSize& imageSize) -{ - // Set the DC scale and origin so that the given image size fits within the - // entire page and the origin is at the top left corner of the page. Note - // that with most printers, portions of the page will be non-printable. Use - // this if you're managing your own page margins. - if (!m_printoutDC) return; - wxRect paperRect = GetPaperRectPixels(); - wxCoord pw, ph; - GetPageSizePixels(&pw, &ph); - wxCoord w, h; - m_printoutDC->GetSize(&w, &h); - float scaleX = ((float(paperRect.width) * w) / (float(pw) * imageSize.x)); - float scaleY = ((float(paperRect.height) * h) / (float(ph) * imageSize.y)); - float actualScale = wxMin(scaleX, scaleY); - m_printoutDC->SetUserScale(actualScale, actualScale); - m_printoutDC->SetDeviceOrigin(0, 0); - wxRect logicalPaperRect = GetLogicalPaperRect(); - SetLogicalOrigin(logicalPaperRect.x, logicalPaperRect.y); -} - -void wxPrintout::FitThisSizeToPage(const wxSize& imageSize) -{ - // Set the DC scale and origin so that the given image size fits within the - // printable area of the page and the origin is at the top left corner of - // the printable area. - if (!m_printoutDC) return; - int w, h; - m_printoutDC->GetSize(&w, &h); - float scaleX = float(w) / imageSize.x; - float scaleY = float(h) / imageSize.y; - float actualScale = wxMin(scaleX, scaleY); - m_printoutDC->SetUserScale(actualScale, actualScale); - m_printoutDC->SetDeviceOrigin(0, 0); -} - -void wxPrintout::FitThisSizeToPageMargins(const wxSize& imageSize, const wxPageSetupDialogData& pageSetupData) -{ - // Set the DC scale and origin so that the given image size fits within the - // page margins defined in the given wxPageSetupDialogData object and the - // origin is at the top left corner of the page margins. - if (!m_printoutDC) return; - wxRect paperRect = GetPaperRectPixels(); - wxCoord pw, ph; - GetPageSizePixels(&pw, &ph); - wxPoint topLeft = pageSetupData.GetMarginTopLeft(); - wxPoint bottomRight = pageSetupData.GetMarginBottomRight(); - wxCoord mw, mh; - GetPageSizeMM(&mw, &mh); - float mmToDeviceX = float(pw) / mw; - float mmToDeviceY = float(ph) / mh; - wxRect pageMarginsRect(paperRect.x + wxRound(mmToDeviceX * topLeft.x), - paperRect.y + wxRound(mmToDeviceY * topLeft.y), - paperRect.width - wxRound(mmToDeviceX * (topLeft.x + bottomRight.x)), - paperRect.height - wxRound(mmToDeviceY * (topLeft.y + bottomRight.y))); - wxCoord w, h; - m_printoutDC->GetSize(&w, &h); - float scaleX = (float(pageMarginsRect.width) * w) / (float(pw) * imageSize.x); - float scaleY = (float(pageMarginsRect.height) * h) / (float(ph) * imageSize.y); - float actualScale = wxMin(scaleX, scaleY); - m_printoutDC->SetUserScale(actualScale, actualScale); - m_printoutDC->SetDeviceOrigin(0, 0); - wxRect logicalPageMarginsRect = GetLogicalPageMarginsRect(pageSetupData); - SetLogicalOrigin(logicalPageMarginsRect.x, logicalPageMarginsRect.y); -} - -void wxPrintout::MapScreenSizeToPaper() -{ - // Set the DC scale so that an image on the screen is the same size on the - // paper and the origin is at the top left of the paper. Note that with most - // printers, portions of the page will be cut off. Use this if you're - // managing your own page margins. - if (!m_printoutDC) return; - MapScreenSizeToPage(); - wxRect logicalPaperRect = GetLogicalPaperRect(); - SetLogicalOrigin(logicalPaperRect.x, logicalPaperRect.y); -} - -void wxPrintout::MapScreenSizeToPage() -{ - // Set the DC scale and origin so that an image on the screen is the same - // size on the paper and the origin is at the top left of the printable area. - if (!m_printoutDC) return; - int ppiScreenX, ppiScreenY; - GetPPIScreen(&ppiScreenX, &ppiScreenY); - int ppiPrinterX, ppiPrinterY; - GetPPIPrinter(&ppiPrinterX, &ppiPrinterY); - int w, h; - m_printoutDC->GetSize(&w, &h); - int pageSizePixelsX, pageSizePixelsY; - GetPageSizePixels(&pageSizePixelsX, &pageSizePixelsY); - float userScaleX = (float(ppiPrinterX) * w) / (float(ppiScreenX) * pageSizePixelsX); - float userScaleY = (float(ppiPrinterY) * h) / (float(ppiScreenY) * pageSizePixelsY); - m_printoutDC->SetUserScale(userScaleX, userScaleY); - m_printoutDC->SetDeviceOrigin(0, 0); -} - -void wxPrintout::MapScreenSizeToPageMargins(const wxPageSetupDialogData& pageSetupData) -{ - // Set the DC scale so that an image on the screen is the same size on the - // paper and the origin is at the top left of the page margins defined by - // the given wxPageSetupDialogData object. - if (!m_printoutDC) return; - MapScreenSizeToPage(); - wxRect logicalPageMarginsRect = GetLogicalPageMarginsRect(pageSetupData); - SetLogicalOrigin(logicalPageMarginsRect.x, logicalPageMarginsRect.y); -} - -void wxPrintout::MapScreenSizeToDevice() -{ - // Set the DC scale so that a screen pixel is the same size as a device - // pixel and the origin is at the top left of the printable area. - if (!m_printoutDC) return; - int w, h; - m_printoutDC->GetSize(&w, &h); - int pageSizePixelsX, pageSizePixelsY; - GetPageSizePixels(&pageSizePixelsX, &pageSizePixelsY); - float userScaleX = float(w) / pageSizePixelsX; - float userScaleY = float(h) / pageSizePixelsY; - m_printoutDC->SetUserScale(userScaleX, userScaleY); - m_printoutDC->SetDeviceOrigin(0, 0); -} - -wxRect wxPrintout::GetLogicalPaperRect() const -{ - // Return the rectangle in logical units that corresponds to the paper - // rectangle. - wxRect paperRect = GetPaperRectPixels(); - wxCoord pw, ph; - GetPageSizePixels(&pw, &ph); - wxCoord w, h; - m_printoutDC->GetSize(&w, &h); - if (w == pw && h == ph) { - // this DC matches the printed page, so no scaling - return wxRect(m_printoutDC->DeviceToLogicalX(paperRect.x), - m_printoutDC->DeviceToLogicalY(paperRect.y), - m_printoutDC->DeviceToLogicalXRel(paperRect.width), - m_printoutDC->DeviceToLogicalYRel(paperRect.height)); - } - // This DC doesn't match the printed page, so we have to scale. - float scaleX = float(w) / pw; - float scaleY = float(h) / ph; - return wxRect(m_printoutDC->DeviceToLogicalX(wxRound(paperRect.x * scaleX)), - m_printoutDC->DeviceToLogicalY(wxRound(paperRect.y * scaleY)), - m_printoutDC->DeviceToLogicalXRel(wxRound(paperRect.width * scaleX)), - m_printoutDC->DeviceToLogicalYRel(wxRound(paperRect.height * scaleY))); -} - -wxRect wxPrintout::GetLogicalPageRect() const -{ - // Return the rectangle in logical units that corresponds to the printable - // area. - int w, h; - m_printoutDC->GetSize(&w, &h); - return wxRect(m_printoutDC->DeviceToLogicalX(0), - m_printoutDC->DeviceToLogicalY(0), - m_printoutDC->DeviceToLogicalXRel(w), - m_printoutDC->DeviceToLogicalYRel(h)); -} - -wxRect wxPrintout::GetLogicalPageMarginsRect(const wxPageSetupDialogData& pageSetupData) const -{ - // Return the rectangle in logical units that corresponds to the region - // within the page margins as specified by the given wxPageSetupDialogData - // object. - wxRect paperRect = GetPaperRectPixels(); - wxCoord pw, ph; - GetPageSizePixels(&pw, &ph); - wxPoint topLeft = pageSetupData.GetMarginTopLeft(); - wxPoint bottomRight = pageSetupData.GetMarginBottomRight(); - wxCoord mw, mh; - GetPageSizeMM(&mw, &mh); - float mmToDeviceX = float(pw) / mw; - float mmToDeviceY = float(ph) / mh; - wxRect pageMarginsRect(paperRect.x + wxRound(mmToDeviceX * topLeft.x), - paperRect.y + wxRound(mmToDeviceY * topLeft.y), - paperRect.width - wxRound(mmToDeviceX * (topLeft.x + bottomRight.x)), - paperRect.height - wxRound(mmToDeviceY * (topLeft.y + bottomRight.y))); - wxCoord w, h; - m_printoutDC->GetSize(&w, &h); - if (w == pw && h == ph) { - // this DC matches the printed page, so no scaling - return wxRect(m_printoutDC->DeviceToLogicalX(pageMarginsRect.x), - m_printoutDC->DeviceToLogicalY(pageMarginsRect.y), - m_printoutDC->DeviceToLogicalXRel(pageMarginsRect.width), - m_printoutDC->DeviceToLogicalYRel(pageMarginsRect.height)); - } - // This DC doesn't match the printed page, so we have to scale. - float scaleX = float(w) / pw; - float scaleY = float(h) / ph; - return wxRect(m_printoutDC->DeviceToLogicalX(wxRound(pageMarginsRect.x * scaleX)), - m_printoutDC->DeviceToLogicalY(wxRound(pageMarginsRect.y * scaleY)), - m_printoutDC->DeviceToLogicalXRel(wxRound(pageMarginsRect.width * scaleX)), - m_printoutDC->DeviceToLogicalYRel(wxRound(pageMarginsRect.height * scaleY))); -} - -void wxPrintout::SetLogicalOrigin(wxCoord x, wxCoord y) -{ - // Set the device origin by specifying a point in logical coordinates. - m_printoutDC->SetDeviceOrigin(m_printoutDC->LogicalToDeviceX(x), - m_printoutDC->LogicalToDeviceY(y)); -} - -void wxPrintout::OffsetLogicalOrigin(wxCoord xoff, wxCoord yoff) -{ - // Offset the device origin by a specified distance in device coordinates. - wxCoord x = m_printoutDC->LogicalToDeviceX(0); - wxCoord y = m_printoutDC->LogicalToDeviceY(0); - m_printoutDC->SetDeviceOrigin(x + m_printoutDC->LogicalToDeviceXRel(xoff), - y + m_printoutDC->LogicalToDeviceYRel(yoff)); -} - - -//---------------------------------------------------------------------------- -// wxPreviewCanvas -//---------------------------------------------------------------------------- - -IMPLEMENT_CLASS(wxPreviewCanvas, wxWindow) - -BEGIN_EVENT_TABLE(wxPreviewCanvas, wxScrolledWindow) - EVT_PAINT(wxPreviewCanvas::OnPaint) - EVT_CHAR(wxPreviewCanvas::OnChar) - EVT_SYS_COLOUR_CHANGED(wxPreviewCanvas::OnSysColourChanged) -#if wxUSE_MOUSEWHEEL - EVT_MOUSEWHEEL(wxPreviewCanvas::OnMouseWheel) -#endif -END_EVENT_TABLE() - -// VZ: the current code doesn't refresh properly without -// wxFULL_REPAINT_ON_RESIZE, this must be fixed as otherwise we have -// really horrible flicker when resizing the preview frame, but without -// this style it simply doesn't work correctly at all... -wxPreviewCanvas::wxPreviewCanvas(wxPrintPreviewBase *preview, wxWindow *parent, - const wxPoint& pos, const wxSize& size, long style, const wxString& name): -wxScrolledWindow(parent, wxID_ANY, pos, size, style | wxFULL_REPAINT_ON_RESIZE, name) -{ - m_printPreview = preview; -#ifdef __WXMAC__ - // The app workspace colour is always white, but we should have - // a contrast with the page. - wxSystemColour colourIndex = wxSYS_COLOUR_3DDKSHADOW; -#elif defined(__WXGTK__) - wxSystemColour colourIndex = wxSYS_COLOUR_BTNFACE; -#else - wxSystemColour colourIndex = wxSYS_COLOUR_APPWORKSPACE; -#endif - SetBackgroundColour(wxSystemSettings::GetColour(colourIndex)); - - SetScrollbars(10, 10, 100, 100); -} - -wxPreviewCanvas::~wxPreviewCanvas() -{ -} - -void wxPreviewCanvas::OnPaint(wxPaintEvent& WXUNUSED(event)) -{ - wxPaintDC dc(this); - PrepareDC( dc ); - -/* -#ifdef __WXGTK__ - if (!GetUpdateRegion().IsEmpty()) - dc.SetClippingRegion( GetUpdateRegion() ); -#endif -*/ - - if (m_printPreview) - { - m_printPreview->PaintPage(this, dc); - } -} - -// Responds to colour changes, and passes event on to children. -void wxPreviewCanvas::OnSysColourChanged(wxSysColourChangedEvent& event) -{ -#ifdef __WXMAC__ - // The app workspace colour is always white, but we should have - // a contrast with the page. - wxSystemColour colourIndex = wxSYS_COLOUR_3DDKSHADOW; -#elif defined(__WXGTK__) - wxSystemColour colourIndex = wxSYS_COLOUR_BTNFACE; -#else - wxSystemColour colourIndex = wxSYS_COLOUR_APPWORKSPACE; -#endif - SetBackgroundColour(wxSystemSettings::GetColour(colourIndex)); - Refresh(); - - // Propagate the event to the non-top-level children - wxWindow::OnSysColourChanged(event); -} - -void wxPreviewCanvas::OnChar(wxKeyEvent &event) -{ - wxPreviewControlBar* controlBar = ((wxPreviewFrame*) GetParent())->GetControlBar(); - if (event.GetKeyCode() == WXK_ESCAPE) - { - ((wxPreviewFrame*) GetParent())->Close(true); - return; - } - else if (event.GetKeyCode() == WXK_TAB) - { - controlBar->OnGoto(); - return; - } - else if (event.GetKeyCode() == WXK_RETURN) - { - controlBar->OnPrint(); - return; - } - - if (!event.ControlDown()) - { - event.Skip(); - return; - } - - switch(event.GetKeyCode()) - { - case WXK_PAGEDOWN: - controlBar->OnNext(); break; - case WXK_PAGEUP: - controlBar->OnPrevious(); break; - case WXK_HOME: - controlBar->OnFirst(); break; - case WXK_END: - controlBar->OnLast(); break; - default: - event.Skip(); - } -} - -#if wxUSE_MOUSEWHEEL - -void wxPreviewCanvas::OnMouseWheel(wxMouseEvent& event) -{ - wxPreviewControlBar * - controlBar = wxStaticCast(GetParent(), wxPreviewFrame)->GetControlBar(); - - if ( controlBar ) - { - if ( event.ControlDown() && event.GetWheelRotation() != 0 ) - { - int currentZoom = controlBar->GetZoomControl(); - - int delta; - if ( currentZoom < 100 ) - delta = 5; - else if ( currentZoom <= 120 ) - delta = 10; - else - delta = 50; - - if ( event.GetWheelRotation() > 0 ) - delta = -delta; - - int newZoom = currentZoom + delta; - if ( newZoom < 10 ) - newZoom = 10; - if ( newZoom > 200 ) - newZoom = 200; - if ( newZoom != currentZoom ) - { - controlBar->SetZoomControl(newZoom); - m_printPreview->SetZoom(newZoom); - Refresh(); - } - return; - } - } - - event.Skip(); -} - -#endif // wxUSE_MOUSEWHEEL - -//---------------------------------------------------------------------------- -// wxPreviewControlBar -//---------------------------------------------------------------------------- - -IMPLEMENT_CLASS(wxPreviewControlBar, wxWindow) - -BEGIN_EVENT_TABLE(wxPreviewControlBar, wxPanel) - EVT_BUTTON(wxID_PREVIEW_CLOSE, wxPreviewControlBar::OnWindowClose) - EVT_BUTTON(wxID_PREVIEW_PRINT, wxPreviewControlBar::OnPrintButton) - EVT_BUTTON(wxID_PREVIEW_PREVIOUS, wxPreviewControlBar::OnPreviousButton) - EVT_BUTTON(wxID_PREVIEW_NEXT, wxPreviewControlBar::OnNextButton) - EVT_BUTTON(wxID_PREVIEW_FIRST, wxPreviewControlBar::OnFirstButton) - EVT_BUTTON(wxID_PREVIEW_LAST, wxPreviewControlBar::OnLastButton) - EVT_BUTTON(wxID_PREVIEW_GOTO, wxPreviewControlBar::OnGotoButton) - EVT_CHOICE(wxID_PREVIEW_ZOOM, wxPreviewControlBar::OnZoom) - EVT_PAINT(wxPreviewControlBar::OnPaint) -END_EVENT_TABLE() - -wxPreviewControlBar::wxPreviewControlBar(wxPrintPreviewBase *preview, long buttons, - wxWindow *parent, const wxPoint& pos, const wxSize& size, - long style, const wxString& name): -wxPanel(parent, wxID_ANY, pos, size, style, name) -{ - m_printPreview = preview; - m_closeButton = (wxButton *) NULL; - m_nextPageButton = (wxButton *) NULL; - m_previousPageButton = (wxButton *) NULL; - m_printButton = (wxButton *) NULL; - m_zoomControl = (wxChoice *) NULL; - m_buttonFlags = buttons; -} - -wxPreviewControlBar::~wxPreviewControlBar() -{ -} - -void wxPreviewControlBar::OnPaint(wxPaintEvent& WXUNUSED(event)) -{ - wxPaintDC dc(this); - - int w, h; - GetSize(&w, &h); - dc.SetPen(*wxBLACK_PEN); - dc.SetBrush(*wxTRANSPARENT_BRUSH); - dc.DrawLine( 0, h-1, w, h-1 ); -} - -void wxPreviewControlBar::OnWindowClose(wxCommandEvent& WXUNUSED(event)) -{ - wxPreviewFrame *frame = (wxPreviewFrame *)GetParent(); - frame->Close(true); -} - -void wxPreviewControlBar::OnPrint(void) -{ - wxPrintPreviewBase *preview = GetPrintPreview(); - preview->Print(true); -} - -void wxPreviewControlBar::OnNext(void) -{ - wxPrintPreviewBase *preview = GetPrintPreview(); - if (preview) - { - int currentPage = preview->GetCurrentPage(); - if ((preview->GetMaxPage() > 0) && - (currentPage < preview->GetMaxPage()) && - preview->GetPrintout()->HasPage(currentPage + 1)) - { - preview->SetCurrentPage(currentPage + 1); - } - } -} - -void wxPreviewControlBar::OnPrevious(void) -{ - wxPrintPreviewBase *preview = GetPrintPreview(); - if (preview) - { - int currentPage = preview->GetCurrentPage(); - if ((preview->GetMinPage() > 0) && - (currentPage > preview->GetMinPage()) && - preview->GetPrintout()->HasPage(currentPage - 1)) - { - preview->SetCurrentPage(currentPage - 1); - } - } -} - -void wxPreviewControlBar::OnFirst(void) -{ - wxPrintPreviewBase *preview = GetPrintPreview(); - if (preview) - { - int currentPage = preview->GetMinPage(); - if (preview->GetPrintout()->HasPage(currentPage)) - { - preview->SetCurrentPage(currentPage); - } - } -} - -void wxPreviewControlBar::OnLast(void) -{ - wxPrintPreviewBase *preview = GetPrintPreview(); - if (preview) - { - int currentPage = preview->GetMaxPage(); - if (preview->GetPrintout()->HasPage(currentPage)) - { - preview->SetCurrentPage(currentPage); - } - } -} - -void wxPreviewControlBar::OnGoto(void) -{ - wxPrintPreviewBase *preview = GetPrintPreview(); - if (preview) - { - long currentPage; - - if (preview->GetMinPage() > 0) - { - wxString strPrompt; - wxString strPage; - - strPrompt.Printf( _("Enter a page number between %d and %d:"), - preview->GetMinPage(), preview->GetMaxPage()); - strPage.Printf( wxT("%d"), preview->GetCurrentPage() ); - - strPage = - wxGetTextFromUser( strPrompt, _("Goto Page"), strPage, GetParent()); - - if ( strPage.ToLong( ¤tPage ) ) - if (preview->GetPrintout()->HasPage(currentPage)) - { - preview->SetCurrentPage(currentPage); - } - } - } -} - -void wxPreviewControlBar::OnZoom(wxCommandEvent& WXUNUSED(event)) -{ - int zoom = GetZoomControl(); - if (GetPrintPreview()) - GetPrintPreview()->SetZoom(zoom); -} - -void wxPreviewControlBar::CreateButtons() -{ - SetSize(0, 0, 400, 40); - - wxBoxSizer *item0 = new wxBoxSizer( wxHORIZONTAL ); - - m_closeButton = new wxButton( this, wxID_PREVIEW_CLOSE, _("&Close"), wxDefaultPosition, wxDefaultSize, 0 ); - item0->Add( m_closeButton, 0, wxALIGN_CENTRE|wxALL, 5 ); - - if (m_buttonFlags & wxPREVIEW_PRINT) - { - m_printButton = new wxButton( this, wxID_PREVIEW_PRINT, _("&Print..."), wxDefaultPosition, wxDefaultSize, 0 ); - item0->Add( m_printButton, 0, wxALIGN_CENTRE|wxALL, 5 ); - } - - // Exact-fit buttons are too tiny on wxUniversal - int navButtonStyle; - wxSize navButtonSize; -#ifdef __WXUNIVERSAL__ - navButtonStyle = 0; - navButtonSize = wxSize(40, m_closeButton->GetSize().y); -#else - navButtonStyle = wxBU_EXACTFIT; - navButtonSize = wxDefaultSize; -#endif - - if (m_buttonFlags & wxPREVIEW_FIRST) - { - m_firstPageButton = new wxButton( this, wxID_PREVIEW_FIRST, _("|<<"), wxDefaultPosition, navButtonSize, navButtonStyle ); - item0->Add( m_firstPageButton, 0, wxALIGN_CENTRE|wxALL, 5 ); - } - - if (m_buttonFlags & wxPREVIEW_PREVIOUS) - { - m_previousPageButton = new wxButton( this, wxID_PREVIEW_PREVIOUS, _("<<"), wxDefaultPosition, navButtonSize, navButtonStyle ); - item0->Add( m_previousPageButton, 0, wxALIGN_CENTRE|wxRIGHT|wxTOP|wxBOTTOM, 5 ); - } - - if (m_buttonFlags & wxPREVIEW_NEXT) - { - m_nextPageButton = new wxButton( this, wxID_PREVIEW_NEXT, _(">>"), wxDefaultPosition, navButtonSize, navButtonStyle ); - item0->Add( m_nextPageButton, 0, wxALIGN_CENTRE|wxRIGHT|wxTOP|wxBOTTOM, 5 ); - } - - if (m_buttonFlags & wxPREVIEW_LAST) - { - m_lastPageButton = new wxButton( this, wxID_PREVIEW_LAST, _(">>|"), wxDefaultPosition, navButtonSize, navButtonStyle ); - item0->Add( m_lastPageButton, 0, wxALIGN_CENTRE|wxRIGHT|wxTOP|wxBOTTOM, 5 ); - } - - if (m_buttonFlags & wxPREVIEW_GOTO) - { - m_gotoPageButton = new wxButton( this, wxID_PREVIEW_GOTO, _("&Goto..."), wxDefaultPosition, wxDefaultSize, 0 ); - item0->Add( m_gotoPageButton, 0, wxALIGN_CENTRE|wxALL, 5 ); - } - - if (m_buttonFlags & wxPREVIEW_ZOOM) - { - wxString choices[] = - { - wxT("10%"), wxT("15%"), wxT("20%"), wxT("25%"), wxT("30%"), wxT("35%"), wxT("40%"), wxT("45%"), wxT("50%"), wxT("55%"), - wxT("60%"), wxT("65%"), wxT("70%"), wxT("75%"), wxT("80%"), wxT("85%"), wxT("90%"), wxT("95%"), wxT("100%"), wxT("110%"), - wxT("120%"), wxT("150%"), wxT("200%") - }; - int n = WXSIZEOF(choices); - - m_zoomControl = new wxChoice( this, wxID_PREVIEW_ZOOM, wxDefaultPosition, wxSize(70,wxDefaultCoord), n, choices, 0 ); - item0->Add( m_zoomControl, 0, wxALIGN_CENTRE|wxALL, 5 ); - SetZoomControl(m_printPreview->GetZoom()); - } - - SetSizer(item0); - item0->Fit(this); -} - -void wxPreviewControlBar::SetZoomControl(int zoom) -{ - if (m_zoomControl) - { - int n, count = m_zoomControl->GetCount(); - long val; - for (n=0; nGetString(n).BeforeFirst(wxT('%')).ToLong(&val) && - (val >= long(zoom))) - { - m_zoomControl->SetSelection(n); - return; - } - } - - m_zoomControl->SetSelection(count-1); - } -} - -int wxPreviewControlBar::GetZoomControl() -{ - if (m_zoomControl && (m_zoomControl->GetStringSelection() != wxEmptyString)) - { - long val; - if (m_zoomControl->GetStringSelection().BeforeFirst(wxT('%')).ToLong(&val)) - return int(val); - } - - return 0; -} - - -/* -* Preview frame -*/ - -IMPLEMENT_CLASS(wxPreviewFrame, wxFrame) - -BEGIN_EVENT_TABLE(wxPreviewFrame, wxFrame) - EVT_CLOSE(wxPreviewFrame::OnCloseWindow) -END_EVENT_TABLE() - -wxPreviewFrame::wxPreviewFrame(wxPrintPreviewBase *preview, wxWindow *parent, const wxString& title, - const wxPoint& pos, const wxSize& size, long style, const wxString& name): -wxFrame(parent, wxID_ANY, title, pos, size, style, name) -{ - m_printPreview = preview; - m_controlBar = NULL; - m_previewCanvas = NULL; - m_windowDisabler = NULL; - - // Give the application icon -#ifdef __WXMSW__ - wxFrame* topFrame = wxDynamicCast(wxTheApp->GetTopWindow(), wxFrame); - if (topFrame) - SetIcon(topFrame->GetIcon()); -#endif -} - -wxPreviewFrame::~wxPreviewFrame() -{ -} - -void wxPreviewFrame::OnCloseWindow(wxCloseEvent& WXUNUSED(event)) -{ - if (m_windowDisabler) - delete m_windowDisabler; - - // Need to delete the printout and the print preview - wxPrintout *printout = m_printPreview->GetPrintout(); - if (printout) - { - delete printout; - m_printPreview->SetPrintout(NULL); - m_printPreview->SetCanvas(NULL); - m_printPreview->SetFrame(NULL); - } - delete m_printPreview; - - Destroy(); -} - -void wxPreviewFrame::Initialize() -{ -#if wxUSE_STATUSBAR - CreateStatusBar(); -#endif - CreateCanvas(); - CreateControlBar(); - - m_printPreview->SetCanvas(m_previewCanvas); - m_printPreview->SetFrame(this); - - wxBoxSizer *item0 = new wxBoxSizer( wxVERTICAL ); - - item0->Add( m_controlBar, 0, wxGROW|wxALIGN_CENTER_VERTICAL, 5 ); - item0->Add( m_previewCanvas, 1, wxGROW|wxALIGN_CENTER_VERTICAL, 5 ); - - SetAutoLayout( true ); - SetSizer( item0 ); - - m_windowDisabler = new wxWindowDisabler(this); - - Layout(); - - m_printPreview->AdjustScrollbars(m_previewCanvas); - m_previewCanvas->SetFocus(); - m_controlBar->SetFocus(); -} - -void wxPreviewFrame::CreateCanvas() -{ - m_previewCanvas = new wxPreviewCanvas(m_printPreview, this); -} - -void wxPreviewFrame::CreateControlBar() -{ - long buttons = wxPREVIEW_DEFAULT; - if (m_printPreview->GetPrintoutForPrinting()) - buttons |= wxPREVIEW_PRINT; - - m_controlBar = new wxPreviewControlBar(m_printPreview, buttons, this, wxPoint(0,0), wxSize(400, 40)); - m_controlBar->CreateButtons(); -} - -/* -* Print preview -*/ - -IMPLEMENT_CLASS(wxPrintPreviewBase, wxObject) - -wxPrintPreviewBase::wxPrintPreviewBase(wxPrintout *printout, - wxPrintout *printoutForPrinting, - wxPrintData *data) -{ - if (data) - m_printDialogData = (*data); - - Init(printout, printoutForPrinting); -} - -wxPrintPreviewBase::wxPrintPreviewBase(wxPrintout *printout, - wxPrintout *printoutForPrinting, - wxPrintDialogData *data) -{ - if (data) - m_printDialogData = (*data); - - Init(printout, printoutForPrinting); -} - -void wxPrintPreviewBase::Init(wxPrintout *printout, - wxPrintout *printoutForPrinting) -{ - m_isOk = true; - m_previewPrintout = printout; - if (m_previewPrintout) - m_previewPrintout->SetIsPreview(true); - - m_printPrintout = printoutForPrinting; - - m_previewCanvas = NULL; - m_previewFrame = NULL; - m_previewBitmap = NULL; - m_currentPage = 1; - m_currentZoom = 70; - m_topMargin = 40; - m_leftMargin = 40; - m_pageWidth = 0; - m_pageHeight = 0; - m_printingPrepared = false; - m_minPage = 1; - m_maxPage = 1; -} - -wxPrintPreviewBase::~wxPrintPreviewBase() -{ - if (m_previewPrintout) - delete m_previewPrintout; - if (m_previewBitmap) - delete m_previewBitmap; - if (m_printPrintout) - delete m_printPrintout; -} - -bool wxPrintPreviewBase::SetCurrentPage(int pageNum) -{ - if (m_currentPage == pageNum) - return true; - - m_currentPage = pageNum; - if (m_previewBitmap) - { - delete m_previewBitmap; - m_previewBitmap = NULL; - } - - if (m_previewCanvas) - { - AdjustScrollbars(m_previewCanvas); - - if (!RenderPage(pageNum)) - return false; - m_previewCanvas->Refresh(); - m_previewCanvas->SetFocus(); - } - return true; -} - -int wxPrintPreviewBase::GetCurrentPage() const - { return m_currentPage; } -void wxPrintPreviewBase::SetPrintout(wxPrintout *printout) - { m_previewPrintout = printout; } -wxPrintout *wxPrintPreviewBase::GetPrintout() const - { return m_previewPrintout; } -wxPrintout *wxPrintPreviewBase::GetPrintoutForPrinting() const - { return m_printPrintout; } -void wxPrintPreviewBase::SetFrame(wxFrame *frame) - { m_previewFrame = frame; } -void wxPrintPreviewBase::SetCanvas(wxPreviewCanvas *canvas) - { m_previewCanvas = canvas; } -wxFrame *wxPrintPreviewBase::GetFrame() const - { return m_previewFrame; } -wxPreviewCanvas *wxPrintPreviewBase::GetCanvas() const - { return m_previewCanvas; } - -void wxPrintPreviewBase::CalcRects(wxPreviewCanvas *canvas, wxRect& pageRect, wxRect& paperRect) -{ - // Calculate the rectangles for the printable area of the page and the - // entire paper as they appear on the canvas on-screen. - int canvasWidth, canvasHeight; - canvas->GetSize(&canvasWidth, &canvasHeight); - - float zoomScale = float(m_currentZoom) / 100; - float screenPrintableWidth = zoomScale * m_pageWidth * m_previewScaleX; - float screenPrintableHeight = zoomScale * m_pageHeight * m_previewScaleY; - - wxRect devicePaperRect = m_previewPrintout->GetPaperRectPixels(); - wxCoord devicePrintableWidth, devicePrintableHeight; - m_previewPrintout->GetPageSizePixels(&devicePrintableWidth, &devicePrintableHeight); - float scaleX = screenPrintableWidth / devicePrintableWidth; - float scaleY = screenPrintableHeight / devicePrintableHeight; - paperRect.width = wxCoord(scaleX * devicePaperRect.width); - paperRect.height = wxCoord(scaleY * devicePaperRect.height); - - paperRect.x = wxCoord((canvasWidth - paperRect.width)/ 2.0); - if (paperRect.x < m_leftMargin) - paperRect.x = m_leftMargin; - paperRect.y = wxCoord((canvasHeight - paperRect.height)/ 2.0); - if (paperRect.y < m_topMargin) - paperRect.y = m_topMargin; - - pageRect.x = paperRect.x - wxCoord(scaleX * devicePaperRect.x); - pageRect.y = paperRect.y - wxCoord(scaleY * devicePaperRect.y); - pageRect.width = wxCoord(screenPrintableWidth); - pageRect.height = wxCoord(screenPrintableHeight); -} - - -bool wxPrintPreviewBase::PaintPage(wxPreviewCanvas *canvas, wxDC& dc) -{ - DrawBlankPage(canvas, dc); - - if (!m_previewBitmap) - if (!RenderPage(m_currentPage)) - return false; - if (!m_previewBitmap) - return false; - if (!canvas) - return false; - - wxRect pageRect, paperRect; - CalcRects(canvas, pageRect, paperRect); - wxMemoryDC temp_dc; - temp_dc.SelectObject(*m_previewBitmap); - - dc.Blit(pageRect.x, pageRect.y, - m_previewBitmap->GetWidth(), m_previewBitmap->GetHeight(), &temp_dc, 0, 0); - - temp_dc.SelectObject(wxNullBitmap); - return true; -} - -// Adjusts the scrollbars for the current scale -void wxPrintPreviewBase::AdjustScrollbars(wxPreviewCanvas *canvas) -{ - if (!canvas) - return ; - - wxRect pageRect, paperRect; - CalcRects(canvas, pageRect, paperRect); - int totalWidth = paperRect.width + 2 * m_leftMargin; - int totalHeight = paperRect.height + 2 * m_topMargin; - int scrollUnitsX = totalWidth / 10; - int scrollUnitsY = totalHeight / 10; - wxSize virtualSize = canvas->GetVirtualSize(); - if (virtualSize.GetWidth() != totalWidth || virtualSize.GetHeight() != totalHeight) - canvas->SetScrollbars(10, 10, scrollUnitsX, scrollUnitsY, 0, 0, true); -} - -bool wxPrintPreviewBase::RenderPageIntoDC(wxDC& dc, int pageNum) -{ - m_previewPrintout->SetDC(&dc); - m_previewPrintout->SetPageSizePixels(m_pageWidth, m_pageHeight); - - // Need to delay OnPreparePrinting() until here, so we have enough - // information. - if (!m_printingPrepared) - { - m_previewPrintout->OnPreparePrinting(); - int selFrom, selTo; - m_previewPrintout->GetPageInfo(&m_minPage, &m_maxPage, &selFrom, &selTo); - m_printingPrepared = true; - } - - m_previewPrintout->OnBeginPrinting(); - - if (!m_previewPrintout->OnBeginDocument(m_printDialogData.GetFromPage(), m_printDialogData.GetToPage())) - { - wxMessageBox(_("Could not start document preview."), _("Print Preview Failure"), wxOK); - return false; - } - - m_previewPrintout->OnPrintPage(pageNum); - m_previewPrintout->OnEndDocument(); - m_previewPrintout->OnEndPrinting(); - - m_previewPrintout->SetDC(NULL); - - return true; -} - -bool wxPrintPreviewBase::RenderPageIntoBitmap(wxBitmap& bmp, int pageNum) -{ -#if wxUSE_HIGH_QUALITY_PREVIEW_IN_WXMSW - { - if ( RenderPageIntoBitmapHQ(this, - &wxPrintPreviewBase::RenderPageIntoDC, - bmp, pageNum) ) - { - return true; - } - } -#endif // wxUSE_HIGH_QUALITY_PREVIEW_IN_WXMSW - - wxMemoryDC memoryDC; - memoryDC.SelectObject(bmp); - memoryDC.Clear(); - - return RenderPageIntoDC(memoryDC, pageNum); -} - -bool wxPrintPreviewBase::RenderPage(int pageNum) -{ - wxBusyCursor busy; - - if (!m_previewCanvas) - { - wxFAIL_MSG(_T("wxPrintPreviewBase::RenderPage: must use wxPrintPreviewBase::SetCanvas to let me know about the canvas!")); - return false; - } - - wxRect pageRect, paperRect; - CalcRects(m_previewCanvas, pageRect, paperRect); - - if (!m_previewBitmap) - { - m_previewBitmap = new wxBitmap(pageRect.width, pageRect.height); - - if (!m_previewBitmap || !m_previewBitmap->Ok()) - { - if (m_previewBitmap) { - delete m_previewBitmap; - m_previewBitmap = NULL; - } - wxMessageBox(_("Sorry, not enough memory to create a preview."), _("Print Preview Failure"), wxOK); - return false; - } - } - - if ( !RenderPageIntoBitmap(*m_previewBitmap, pageNum) ) - { - wxMessageBox(_("Could not start document preview."), _("Print Preview Failure"), wxOK); - - delete m_previewBitmap; - m_previewBitmap = NULL; - return false; - } - -#if wxUSE_STATUSBAR - wxString status; - if (m_maxPage != 0) - status = wxString::Format(_("Page %d of %d"), pageNum, m_maxPage); - else - status = wxString::Format(_("Page %d"), pageNum); - - if (m_previewFrame) - m_previewFrame->SetStatusText(status); -#endif - - return true; -} - -bool wxPrintPreviewBase::DrawBlankPage(wxPreviewCanvas *canvas, wxDC& dc) -{ - wxRect pageRect, paperRect; - - CalcRects(canvas, pageRect, paperRect); - - // Draw shadow, allowing for 1-pixel border AROUND the actual paper - wxCoord shadowOffset = 4; - - dc.SetPen(*wxBLACK_PEN); - dc.SetBrush(*wxBLACK_BRUSH); - dc.DrawRectangle(paperRect.x + shadowOffset, paperRect.y + paperRect.height + 1, - paperRect.width, shadowOffset); - - dc.DrawRectangle(paperRect.x + paperRect.width, paperRect.y + shadowOffset, - shadowOffset, paperRect.height); - - // Draw blank page allowing for 1-pixel border AROUND the actual paper - dc.SetPen(*wxBLACK_PEN); - dc.SetBrush(*wxWHITE_BRUSH); - dc.DrawRectangle(paperRect.x - 2, paperRect.y - 1, - paperRect.width + 3, paperRect.height + 2); - - return true; -} - -void wxPrintPreviewBase::SetZoom(int percent) -{ - if (m_currentZoom == percent) - return; - - m_currentZoom = percent; - if (m_previewBitmap) - { - delete m_previewBitmap; - m_previewBitmap = NULL; - } - - if (m_previewCanvas) - { - AdjustScrollbars(m_previewCanvas); - RenderPage(m_currentPage); - ((wxScrolledWindow *) m_previewCanvas)->Scroll(0, 0); - m_previewCanvas->ClearBackground(); - m_previewCanvas->Refresh(); - m_previewCanvas->SetFocus(); - } -} - -wxPrintDialogData& wxPrintPreviewBase::GetPrintDialogData() -{ - return m_printDialogData; -} - -int wxPrintPreviewBase::GetZoom() const -{ return m_currentZoom; } -int wxPrintPreviewBase::GetMaxPage() const -{ return m_maxPage; } -int wxPrintPreviewBase::GetMinPage() const -{ return m_minPage; } -bool wxPrintPreviewBase::IsOk() const -{ return m_isOk; } -void wxPrintPreviewBase::SetOk(bool ok) -{ m_isOk = ok; } - -//---------------------------------------------------------------------------- -// wxPrintPreview -//---------------------------------------------------------------------------- - -IMPLEMENT_CLASS(wxPrintPreview, wxPrintPreviewBase) - -wxPrintPreview::wxPrintPreview(wxPrintout *printout, - wxPrintout *printoutForPrinting, - wxPrintDialogData *data) : - wxPrintPreviewBase( printout, printoutForPrinting, data ) -{ - m_pimpl = wxPrintFactory::GetFactory()-> - CreatePrintPreview( printout, printoutForPrinting, data ); -} - -wxPrintPreview::wxPrintPreview(wxPrintout *printout, - wxPrintout *printoutForPrinting, - wxPrintData *data ) : - wxPrintPreviewBase( printout, printoutForPrinting, data ) -{ - m_pimpl = wxPrintFactory::GetFactory()-> - CreatePrintPreview( printout, printoutForPrinting, data ); -} - -wxPrintPreview::~wxPrintPreview() -{ - delete m_pimpl; - - // don't delete twice - m_printPrintout = NULL; - m_previewPrintout = NULL; - m_previewBitmap = NULL; -} - -bool wxPrintPreview::SetCurrentPage(int pageNum) -{ - return m_pimpl->SetCurrentPage( pageNum ); -} - -int wxPrintPreview::GetCurrentPage() const -{ - return m_pimpl->GetCurrentPage(); -} - -void wxPrintPreview::SetPrintout(wxPrintout *printout) -{ - m_pimpl->SetPrintout( printout ); -} - -wxPrintout *wxPrintPreview::GetPrintout() const -{ - return m_pimpl->GetPrintout(); -} - -wxPrintout *wxPrintPreview::GetPrintoutForPrinting() const -{ - return m_pimpl->GetPrintoutForPrinting(); -} - -void wxPrintPreview::SetFrame(wxFrame *frame) -{ - m_pimpl->SetFrame( frame ); -} - -void wxPrintPreview::SetCanvas(wxPreviewCanvas *canvas) -{ - m_pimpl->SetCanvas( canvas ); -} - -wxFrame *wxPrintPreview::GetFrame() const -{ - return m_pimpl->GetFrame(); -} - -wxPreviewCanvas *wxPrintPreview::GetCanvas() const -{ - return m_pimpl->GetCanvas(); -} - -bool wxPrintPreview::PaintPage(wxPreviewCanvas *canvas, wxDC& dc) -{ - return m_pimpl->PaintPage( canvas, dc ); -} - -bool wxPrintPreview::DrawBlankPage(wxPreviewCanvas *canvas, wxDC& dc) -{ - return m_pimpl->DrawBlankPage( canvas, dc ); -} - -void wxPrintPreview::AdjustScrollbars(wxPreviewCanvas *canvas) -{ - m_pimpl->AdjustScrollbars( canvas ); -} - -bool wxPrintPreview::RenderPage(int pageNum) -{ - return m_pimpl->RenderPage( pageNum ); -} - -void wxPrintPreview::SetZoom(int percent) -{ - m_pimpl->SetZoom( percent ); -} - -int wxPrintPreview::GetZoom() const -{ - return m_pimpl->GetZoom(); -} - -wxPrintDialogData& wxPrintPreview::GetPrintDialogData() -{ - return m_pimpl->GetPrintDialogData(); -} - -int wxPrintPreview::GetMaxPage() const -{ - return m_pimpl->GetMaxPage(); -} - -int wxPrintPreview::GetMinPage() const -{ - return m_pimpl->GetMinPage(); -} - -bool wxPrintPreview::IsOk() const -{ - return m_pimpl->Ok(); -} - -void wxPrintPreview::SetOk(bool ok) -{ - m_pimpl->SetOk( ok ); -} - -bool wxPrintPreview::Print(bool interactive) -{ - return m_pimpl->Print( interactive ); -} - -void wxPrintPreview::DetermineScaling() -{ - m_pimpl->DetermineScaling(); -} - -//---------------------------------------------------------------------------- -// experimental backport of high-quality preview on Windows -//---------------------------------------------------------------------------- - -#if wxUSE_HIGH_QUALITY_PREVIEW_IN_WXMSW -static bool RenderPageIntoBitmapHQ(wxPrintPreviewBase *preview, - RenderPageIntoDCFunc RenderPageIntoDC, - wxBitmap& bmp, int pageNum) -{ - // The preview, as implemented in wxPrintPreviewBase (and as used prior to - // wx3) is inexact: it uses screen DC, which has much lower resolution and - // has other properties different from printer DC, so the preview is not - // quite right. - // - // To make matters worse, if the application depends heavily on - // GetTextExtent() or does text layout itself, the output in preview and on - // paper can be very different. In particular, wxHtmlEasyPrinting is - // affected and the preview can be easily off by several pages. - // - // To fix this, we render the preview into high-resolution enhanced - // metafile with properties identical to the printer DC. This guarantees - // metrics correctness while still being fast. - - - // print the preview into a metafile: - wxPrinterDC printerDC(preview->GetPrintDialogData().GetPrintData()); - wxEnhMetaFileDC metaDC(printerDC, - wxEmptyString, - printerDC.GetSize().x, printerDC.GetSize().y); - - if ( !(preview->*RenderPageIntoDC)(metaDC, pageNum) ) - return false; - - wxEnhMetaFile *metafile = metaDC.Close(); - if ( !metafile ) - return false; - - // now render the metafile: - wxMemoryDC bmpDC; - bmpDC.SelectObject(bmp); - bmpDC.Clear(); - - wxRect outRect(0, 0, bmp.GetWidth(), bmp.GetHeight()); - metafile->Play(&bmpDC, &outRect); - - - delete metafile; - - // TODO: we should keep the metafile and reuse it when changing zoom level - - return true; -} -#endif // wxUSE_HIGH_QUALITY_PREVIEW_IN_WXMSW - -#endif // wxUSE_PRINTING_ARCHITECTURE diff --git a/wxWidgets/src/common/process.cpp b/wxWidgets/src/common/process.cpp deleted file mode 100644 index 9e8681ad29..0000000000 --- a/wxWidgets/src/common/process.cpp +++ /dev/null @@ -1,172 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: process.cpp -// Purpose: Process termination classes -// Author: Guilhem Lavaux -// Modified by: Vadim Zeitlin to check error codes, added Detach() method -// Created: 24/06/98 -// RCS-ID: $Id: process.cpp 42702 2006-10-30 09:03:18Z JS $ -// Copyright: (c) Guilhem Lavaux -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#include "wx/process.h" - -// ---------------------------------------------------------------------------- -// event tables and such -// ---------------------------------------------------------------------------- - -DEFINE_EVENT_TYPE(wxEVT_END_PROCESS) - -IMPLEMENT_DYNAMIC_CLASS(wxProcess, wxEvtHandler) -IMPLEMENT_DYNAMIC_CLASS(wxProcessEvent, wxEvent) - -// ============================================================================ -// wxProcess implementation -// ============================================================================ - -// ---------------------------------------------------------------------------- -// wxProcess creation -// ---------------------------------------------------------------------------- - -void wxProcess::Init(wxEvtHandler *parent, int id, int flags) -{ - if ( parent ) - SetNextHandler(parent); - - m_id = id; - m_pid = 0; - m_redirect = (flags & wxPROCESS_REDIRECT) != 0; - -#if wxUSE_STREAMS - m_inputStream = NULL; - m_errorStream = NULL; - m_outputStream = NULL; -#endif // wxUSE_STREAMS -} - -/* static */ -wxProcess *wxProcess::Open(const wxString& cmd, int flags) -{ - wxASSERT_MSG( !(flags & wxEXEC_SYNC), wxT("wxEXEC_SYNC should not be used." )); - wxProcess *process = new wxProcess(wxPROCESS_REDIRECT); - long pid = wxExecute(cmd, flags, process); - if( !pid ) - { - // couldn't launch the process - delete process; - return NULL; - } - - process->SetPid(pid); - - return process; -} - -// ---------------------------------------------------------------------------- -// wxProcess termination -// ---------------------------------------------------------------------------- - -wxProcess::~wxProcess() -{ -#if wxUSE_STREAMS - delete m_inputStream; - delete m_errorStream; - delete m_outputStream; -#endif // wxUSE_STREAMS -} - -void wxProcess::OnTerminate(int pid, int status) -{ - wxProcessEvent event(m_id, pid, status); - - if ( !ProcessEvent(event) ) - delete this; - //else: the object which processed the event is responsible for deleting - // us! -} - -void wxProcess::Detach() -{ - SetNextHandler(NULL); -} - -// ---------------------------------------------------------------------------- -// process IO redirection -// ---------------------------------------------------------------------------- - -#if wxUSE_STREAMS - -void wxProcess::SetPipeStreams(wxInputStream *inputSstream, - wxOutputStream *outputStream, - wxInputStream *errorStream) -{ - m_inputStream = inputSstream; - m_errorStream = errorStream; - m_outputStream = outputStream; -} - -bool wxProcess::IsInputOpened() const -{ - return m_inputStream && m_inputStream->GetLastError() != wxSTREAM_EOF; -} - -bool wxProcess::IsInputAvailable() const -{ - return m_inputStream && m_inputStream->CanRead(); -} - -bool wxProcess::IsErrorAvailable() const -{ - return m_errorStream && m_errorStream->CanRead(); -} - -#endif // wxUSE_STREAMS - -// ---------------------------------------------------------------------------- -// process killing -// ---------------------------------------------------------------------------- - -/* static */ -wxKillError wxProcess::Kill(int pid, wxSignal sig, int flags) -{ - wxKillError rc; - (void)wxKill(pid, sig, &rc, flags); - - return rc; -} - -/* static */ -bool wxProcess::Exists(int pid) -{ - switch ( Kill(pid, wxSIGNONE) ) - { - case wxKILL_OK: - case wxKILL_ACCESS_DENIED: - return true; - - default: - case wxKILL_ERROR: - case wxKILL_BAD_SIGNAL: - wxFAIL_MSG( _T("unexpected wxProcess::Kill() return code") ); - // fall through - - case wxKILL_NO_PROCESS: - return false; - } -} - diff --git a/wxWidgets/src/common/protocol.cpp b/wxWidgets/src/common/protocol.cpp deleted file mode 100644 index 2e2d84fe02..0000000000 --- a/wxWidgets/src/common/protocol.cpp +++ /dev/null @@ -1,215 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/common/protocol.cpp -// Purpose: Implement protocol base class -// Author: Guilhem Lavaux -// Modified by: -// Created: 07/07/1997 -// RCS-ID: $Id: protocol.cpp 40943 2006-08-31 19:31:43Z ABX $ -// Copyright: (c) 1997, 1998 Guilhem Lavaux -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_PROTOCOL - -#include "wx/protocol/protocol.h" - -#ifndef WX_PRECOMP - #include "wx/module.h" -#endif - -#include "wx/url.h" - -#include - -///////////////////////////////////////////////////////////////// -// wxProtoInfo -///////////////////////////////////////////////////////////////// - -/* - * -------------------------------------------------------------- - * --------- wxProtoInfo CONSTRUCTOR ---------------------------- - * -------------------------------------------------------------- - */ - -wxProtoInfo::wxProtoInfo(const wxChar *name, const wxChar *serv, - const bool need_host1, wxClassInfo *info) - : m_protoname(name), - m_servname(serv) -{ - m_cinfo = info; - m_needhost = need_host1; -#if wxUSE_URL - next = wxURL::ms_protocols; - wxURL::ms_protocols = this; -#else - next = NULL; -#endif -} - -///////////////////////////////////////////////////////////////// -// wxProtocol /////////////////////////////////////////////////// -///////////////////////////////////////////////////////////////// - -#if wxUSE_SOCKETS -IMPLEMENT_ABSTRACT_CLASS(wxProtocol, wxSocketClient) -#else -IMPLEMENT_ABSTRACT_CLASS(wxProtocol, wxObject) -#endif - -wxProtocol::wxProtocol() -#if wxUSE_SOCKETS - : wxSocketClient() -#endif -{ -} - -#if wxUSE_SOCKETS -bool wxProtocol::Reconnect() -{ - wxIPV4address addr; - - if (!GetPeer(addr)) - { - Close(); - return false; - } - - if (!Close()) - return false; - - if (!Connect(addr)) - return false; - - return true; -} - -// ---------------------------------------------------------------------------- -// Read a line from socket -// ---------------------------------------------------------------------------- - -/* static */ -wxProtocolError wxProtocol::ReadLine(wxSocketBase *sock, wxString& result) -{ - static const int LINE_BUF = 4095; - - result.clear(); - - wxCharBuffer buf(LINE_BUF); - char *pBuf = buf.data(); - while ( sock->WaitForRead() ) - { - // peek at the socket to see if there is a CRLF - sock->Peek(pBuf, LINE_BUF); - - size_t nRead = sock->LastCount(); - if ( !nRead && sock->Error() ) - return wxPROTO_NETERR; - - // look for "\r\n" paying attention to a special case: "\r\n" could - // have been split by buffer boundary, so check also for \r at the end - // of the last chunk and \n at the beginning of this one - pBuf[nRead] = '\0'; - const char *eol = strchr(pBuf, '\n'); - - // if we found '\n', is there a '\r' as well? - if ( eol ) - { - if ( eol == pBuf ) - { - // check for case of "\r\n" being split - if ( result.empty() || result.Last() != _T('\r') ) - { - // ignore the stray '\n' - eol = NULL; - } - //else: ok, got real EOL - - // read just this '\n' and restart - nRead = 1; - } - else // '\n' in the middle of the buffer - { - // in any case, read everything up to and including '\n' - nRead = eol - pBuf + 1; - - if ( eol[-1] != '\r' ) - { - // as above, simply ignore stray '\n' - eol = NULL; - } - } - } - - sock->Read(pBuf, nRead); - if ( sock->LastCount() != nRead ) - return wxPROTO_NETERR; - - pBuf[nRead] = '\0'; - result += wxString::FromAscii(pBuf); - - if ( eol ) - { - // remove trailing "\r\n" - result.RemoveLast(2); - - return wxPROTO_NOERR; - } - } - - return wxPROTO_NETERR; -} - -wxProtocolError wxProtocol::ReadLine(wxString& result) -{ - return ReadLine(this, result); -} - -// old function which only chops '\n' and not '\r\n' -wxProtocolError GetLine(wxSocketBase *sock, wxString& result) -{ -#define PROTO_BSIZE 2048 - size_t avail, size; - char tmp_buf[PROTO_BSIZE], tmp_str[PROTO_BSIZE]; - char *ret; - bool found; - - avail = sock->Read(tmp_buf, PROTO_BSIZE).LastCount(); - if (sock->Error() || avail == 0) - return wxPROTO_NETERR; - - memcpy(tmp_str, tmp_buf, avail); - - // Not implemented on all systems - // ret = (char *)memccpy(tmp_str, tmp_buf, '\n', avail); - found = false; - for (ret=tmp_str;ret < (tmp_str+avail); ret++) - if (*ret == '\n') - { - found = true; - break; - } - - if (!found) - return wxPROTO_PROTERR; - - *ret = 0; - - result = wxString::FromAscii( tmp_str ); - result = result.Left(result.length()-1); - - size = ret-tmp_str+1; - sock->Unread(&tmp_buf[size], avail-size); - - return wxPROTO_NOERR; -#undef PROTO_BSIZE -} -#endif // wxUSE_SOCKETS - -#endif // wxUSE_PROTOCOL diff --git a/wxWidgets/src/common/quantize.cpp b/wxWidgets/src/common/quantize.cpp deleted file mode 100644 index 7ffa7b19a5..0000000000 --- a/wxWidgets/src/common/quantize.cpp +++ /dev/null @@ -1,1654 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/common/quantize.cpp -// Purpose: wxQuantize implementation -// Author: Julian Smart -// Modified by: -// Created: 22/6/2000 -// RCS-ID: $Id: quantize.cpp 39957 2006-07-03 19:02:54Z ABX $ -// Copyright: (c) Thomas G. Lane, Vaclav Slavik, Julian Smart -// Licence: wxWindows licence + JPEG library licence -///////////////////////////////////////////////////////////////////////////// - -/* - * jquant2.c - * - * Copyright (C) 1991-1996, Thomas G. Lane. - * This file is part of the Independent JPEG Group's software. - * For conditions of distribution and use, see the accompanying README file. - * - * This file contains 2-pass color quantization (color mapping) routines. - * These routines provide selection of a custom color map for an image, - * followed by mapping of the image to that color map, with optional - * Floyd-Steinberg dithering. - * It is also possible to use just the second pass to map to an arbitrary - * externally-given color map. - * - * Note: ordered dithering is not supported, since there isn't any fast - * way to compute intercolor distances; it's unclear that ordered dither's - * fundamental assumptions even hold with an irregularly spaced color map. - */ - -/* modified by Vaclav Slavik for use as jpeglib-independent module */ - -// For compilers that support precompilation, includes "wx/wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ -#pragma hdrstop -#endif - -#if wxUSE_IMAGE - -#include "wx/quantize.h" - -#ifndef WX_PRECOMP - #include "wx/palette.h" - #include "wx/image.h" -#endif - -#ifdef __WXMSW__ - #include "wx/msw/private.h" -#endif - -#include -#include - -#if defined(__OS2__) -#define RGB_RED_OS2 0 -#define RGB_GREEN_OS2 1 -#define RGB_BLUE_OS2 2 -#else -#define RGB_RED 0 -#define RGB_GREEN 1 -#define RGB_BLUE 2 -#endif -#define RGB_PIXELSIZE 3 - -#define MAXJSAMPLE 255 -#define CENTERJSAMPLE 128 -#define BITS_IN_JSAMPLE 8 -#define GETJSAMPLE(value) ((int) (value)) - -#define RIGHT_SHIFT(x,shft) ((x) >> (shft)) - -typedef unsigned short UINT16; -typedef signed short INT16; -#if !(defined(__WATCOMC__) && (defined(__WXMSW__) || defined(__WXMOTIF__))) -typedef signed int INT32; -#endif - -typedef unsigned char JSAMPLE; -typedef JSAMPLE *JSAMPROW; -typedef JSAMPROW *JSAMPARRAY; -typedef unsigned int JDIMENSION; - -typedef struct { - void *cquantize; - JDIMENSION output_width; - JSAMPARRAY colormap; - int actual_number_of_colors; - int desired_number_of_colors; - JSAMPLE *sample_range_limit, *srl_orig; -} j_decompress; - -#if defined(__WINDOWS__) && !defined(__WXMICROWIN__) - #define JMETHOD(type,methodname,arglist) type (__cdecl methodname) arglist -#else - #define JMETHOD(type,methodname,arglist) type (methodname) arglist -#endif - -typedef j_decompress *j_decompress_ptr; -struct jpeg_color_quantizer { - JMETHOD(void, start_pass, (j_decompress_ptr cinfo, bool is_pre_scan)); - JMETHOD(void, color_quantize, (j_decompress_ptr cinfo, - JSAMPARRAY input_buf, JSAMPARRAY output_buf, - int num_rows)); - JMETHOD(void, finish_pass, (j_decompress_ptr cinfo)); - JMETHOD(void, new_color_map, (j_decompress_ptr cinfo)); -}; - - - - -/* - * This module implements the well-known Heckbert paradigm for color - * quantization. Most of the ideas used here can be traced back to - * Heckbert's seminal paper - * Heckbert, Paul. "Color Image Quantization for Frame Buffer Display", - * Proc. SIGGRAPH '82, Computer Graphics v.16 #3 (July 1982), pp 297-304. - * - * In the first pass over the image, we accumulate a histogram showing the - * usage count of each possible color. To keep the histogram to a reasonable - * size, we reduce the precision of the input; typical practice is to retain - * 5 or 6 bits per color, so that 8 or 4 different input values are counted - * in the same histogram cell. - * - * Next, the color-selection step begins with a box representing the whole - * color space, and repeatedly splits the "largest" remaining box until we - * have as many boxes as desired colors. Then the mean color in each - * remaining box becomes one of the possible output colors. - * - * The second pass over the image maps each input pixel to the closest output - * color (optionally after applying a Floyd-Steinberg dithering correction). - * This mapping is logically trivial, but making it go fast enough requires - * considerable care. - * - * Heckbert-style quantizers vary a good deal in their policies for choosing - * the "largest" box and deciding where to cut it. The particular policies - * used here have proved out well in experimental comparisons, but better ones - * may yet be found. - * - * In earlier versions of the IJG code, this module quantized in YCbCr color - * space, processing the raw upsampled data without a color conversion step. - * This allowed the color conversion math to be done only once per colormap - * entry, not once per pixel. However, that optimization precluded other - * useful optimizations (such as merging color conversion with upsampling) - * and it also interfered with desired capabilities such as quantizing to an - * externally-supplied colormap. We have therefore abandoned that approach. - * The present code works in the post-conversion color space, typically RGB. - * - * To improve the visual quality of the results, we actually work in scaled - * RGB space, giving G distances more weight than R, and R in turn more than - * B. To do everything in integer math, we must use integer scale factors. - * The 2/3/1 scale factors used here correspond loosely to the relative - * weights of the colors in the NTSC grayscale equation. - * If you want to use this code to quantize a non-RGB color space, you'll - * probably need to change these scale factors. - */ - -#define R_SCALE 2 /* scale R distances by this much */ -#define G_SCALE 3 /* scale G distances by this much */ -#define B_SCALE 1 /* and B by this much */ - -/* Relabel R/G/B as components 0/1/2, respecting the RGB ordering defined - * in jmorecfg.h. As the code stands, it will do the right thing for R,G,B - * and B,G,R orders. If you define some other weird order in jmorecfg.h, - * you'll get compile errors until you extend this logic. In that case - * you'll probably want to tweak the histogram sizes too. - */ - -#if defined(__OS2__) - -#if RGB_RED_OS2 == 0 -#define C0_SCALE R_SCALE -#endif -#if RGB_BLUE_OS2 == 0 -#define C0_SCALE B_SCALE -#endif -#if RGB_GREEN_OS2 == 1 -#define C1_SCALE G_SCALE -#endif -#if RGB_RED_OS2 == 2 -#define C2_SCALE R_SCALE -#endif -#if RGB_BLUE_OS2 == 2 -#define C2_SCALE B_SCALE -#endif - -#else - -#if RGB_RED == 0 -#define C0_SCALE R_SCALE -#endif -#if RGB_BLUE == 0 -#define C0_SCALE B_SCALE -#endif -#if RGB_GREEN == 1 -#define C1_SCALE G_SCALE -#endif -#if RGB_RED == 2 -#define C2_SCALE R_SCALE -#endif -#if RGB_BLUE == 2 -#define C2_SCALE B_SCALE -#endif - -#endif - -/* - * First we have the histogram data structure and routines for creating it. - * - * The number of bits of precision can be adjusted by changing these symbols. - * We recommend keeping 6 bits for G and 5 each for R and B. - * If you have plenty of memory and cycles, 6 bits all around gives marginally - * better results; if you are short of memory, 5 bits all around will save - * some space but degrade the results. - * To maintain a fully accurate histogram, we'd need to allocate a "long" - * (preferably unsigned long) for each cell. In practice this is overkill; - * we can get by with 16 bits per cell. Few of the cell counts will overflow, - * and clamping those that do overflow to the maximum value will give close- - * enough results. This reduces the recommended histogram size from 256Kb - * to 128Kb, which is a useful savings on PC-class machines. - * (In the second pass the histogram space is re-used for pixel mapping data; - * in that capacity, each cell must be able to store zero to the number of - * desired colors. 16 bits/cell is plenty for that too.) - * Since the JPEG code is intended to run in small memory model on 80x86 - * machines, we can't just allocate the histogram in one chunk. Instead - * of a true 3-D array, we use a row of pointers to 2-D arrays. Each - * pointer corresponds to a C0 value (typically 2^5 = 32 pointers) and - * each 2-D array has 2^6*2^5 = 2048 or 2^6*2^6 = 4096 entries. Note that - * on 80x86 machines, the pointer row is in near memory but the actual - * arrays are in far memory (same arrangement as we use for image arrays). - */ - -#define MAXNUMCOLORS (MAXJSAMPLE+1) /* maximum size of colormap */ - -/* These will do the right thing for either R,G,B or B,G,R color order, - * but you may not like the results for other color orders. - */ -#define HIST_C0_BITS 5 /* bits of precision in R/B histogram */ -#define HIST_C1_BITS 6 /* bits of precision in G histogram */ -#define HIST_C2_BITS 5 /* bits of precision in B/R histogram */ - -/* Number of elements along histogram axes. */ -#define HIST_C0_ELEMS (1<cquantize; - register JSAMPROW ptr; - register histptr histp; - register hist3d histogram = cquantize->histogram; - int row; - JDIMENSION col; - JDIMENSION width = cinfo->output_width; - - for (row = 0; row < num_rows; row++) { - ptr = input_buf[row]; - for (col = width; col > 0; col--) { - - { - - /* get pixel value and index into the histogram */ - histp = & histogram[GETJSAMPLE(ptr[0]) >> C0_SHIFT] - [GETJSAMPLE(ptr[1]) >> C1_SHIFT] - [GETJSAMPLE(ptr[2]) >> C2_SHIFT]; - /* increment, check for overflow and undo increment if so. */ - if (++(*histp) <= 0) - (*histp)--; - } - ptr += 3; - } - } -} - - -/* - * Next we have the really interesting routines: selection of a colormap - * given the completed histogram. - * These routines work with a list of "boxes", each representing a rectangular - * subset of the input color space (to histogram precision). - */ - -typedef struct { - /* The bounds of the box (inclusive); expressed as histogram indexes */ - int c0min, c0max; - int c1min, c1max; - int c2min, c2max; - /* The volume (actually 2-norm) of the box */ - INT32 volume; - /* The number of nonzero histogram cells within this box */ - long colorcount; -} box; - -typedef box * boxptr; - - -boxptr -find_biggest_color_pop (boxptr boxlist, int numboxes) -/* Find the splittable box with the largest color population */ -/* Returns NULL if no splittable boxes remain */ -{ - register boxptr boxp; - register int i; - register long maxc = 0; - boxptr which = NULL; - - for (i = 0, boxp = boxlist; i < numboxes; i++, boxp++) { - if (boxp->colorcount > maxc && boxp->volume > 0) { - which = boxp; - maxc = boxp->colorcount; - } - } - return which; -} - - -boxptr -find_biggest_volume (boxptr boxlist, int numboxes) -/* Find the splittable box with the largest (scaled) volume */ -/* Returns NULL if no splittable boxes remain */ -{ - register boxptr boxp; - register int i; - register INT32 maxv = 0; - boxptr which = NULL; - - for (i = 0, boxp = boxlist; i < numboxes; i++, boxp++) { - if (boxp->volume > maxv) { - which = boxp; - maxv = boxp->volume; - } - } - return which; -} - - -void -update_box (j_decompress_ptr cinfo, boxptr boxp) -/* Shrink the min/max bounds of a box to enclose only nonzero elements, */ -/* and recompute its volume and population */ -{ - my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize; - hist3d histogram = cquantize->histogram; - histptr histp; - int c0,c1,c2; - int c0min,c0max,c1min,c1max,c2min,c2max; - INT32 dist0,dist1,dist2; - long ccount; - - c0min = boxp->c0min; c0max = boxp->c0max; - c1min = boxp->c1min; c1max = boxp->c1max; - c2min = boxp->c2min; c2max = boxp->c2max; - - if (c0max > c0min) - for (c0 = c0min; c0 <= c0max; c0++) - for (c1 = c1min; c1 <= c1max; c1++) { - histp = & histogram[c0][c1][c2min]; - for (c2 = c2min; c2 <= c2max; c2++) - if (*histp++ != 0) { - boxp->c0min = c0min = c0; - goto have_c0min; - } - } - have_c0min: - if (c0max > c0min) - for (c0 = c0max; c0 >= c0min; c0--) - for (c1 = c1min; c1 <= c1max; c1++) { - histp = & histogram[c0][c1][c2min]; - for (c2 = c2min; c2 <= c2max; c2++) - if (*histp++ != 0) { - boxp->c0max = c0max = c0; - goto have_c0max; - } - } - have_c0max: - if (c1max > c1min) - for (c1 = c1min; c1 <= c1max; c1++) - for (c0 = c0min; c0 <= c0max; c0++) { - histp = & histogram[c0][c1][c2min]; - for (c2 = c2min; c2 <= c2max; c2++) - if (*histp++ != 0) { - boxp->c1min = c1min = c1; - goto have_c1min; - } - } - have_c1min: - if (c1max > c1min) - for (c1 = c1max; c1 >= c1min; c1--) - for (c0 = c0min; c0 <= c0max; c0++) { - histp = & histogram[c0][c1][c2min]; - for (c2 = c2min; c2 <= c2max; c2++) - if (*histp++ != 0) { - boxp->c1max = c1max = c1; - goto have_c1max; - } - } - have_c1max: - if (c2max > c2min) - for (c2 = c2min; c2 <= c2max; c2++) - for (c0 = c0min; c0 <= c0max; c0++) { - histp = & histogram[c0][c1min][c2]; - for (c1 = c1min; c1 <= c1max; c1++, histp += HIST_C2_ELEMS) - if (*histp != 0) { - boxp->c2min = c2min = c2; - goto have_c2min; - } - } - have_c2min: - if (c2max > c2min) - for (c2 = c2max; c2 >= c2min; c2--) - for (c0 = c0min; c0 <= c0max; c0++) { - histp = & histogram[c0][c1min][c2]; - for (c1 = c1min; c1 <= c1max; c1++, histp += HIST_C2_ELEMS) - if (*histp != 0) { - boxp->c2max = c2max = c2; - goto have_c2max; - } - } - have_c2max: - - /* Update box volume. - * We use 2-norm rather than real volume here; this biases the method - * against making long narrow boxes, and it has the side benefit that - * a box is splittable iff norm > 0. - * Since the differences are expressed in histogram-cell units, - * we have to shift back to JSAMPLE units to get consistent distances; - * after which, we scale according to the selected distance scale factors. - */ - dist0 = ((c0max - c0min) << C0_SHIFT) * C0_SCALE; - dist1 = ((c1max - c1min) << C1_SHIFT) * C1_SCALE; - dist2 = ((c2max - c2min) << C2_SHIFT) * C2_SCALE; - boxp->volume = dist0*dist0 + dist1*dist1 + dist2*dist2; - - /* Now scan remaining volume of box and compute population */ - ccount = 0; - for (c0 = c0min; c0 <= c0max; c0++) - for (c1 = c1min; c1 <= c1max; c1++) { - histp = & histogram[c0][c1][c2min]; - for (c2 = c2min; c2 <= c2max; c2++, histp++) - if (*histp != 0) { - ccount++; - } - } - boxp->colorcount = ccount; -} - - -int -median_cut (j_decompress_ptr cinfo, boxptr boxlist, int numboxes, - int desired_colors) -/* Repeatedly select and split the largest box until we have enough boxes */ -{ - int n,lb; - int c0,c1,c2,cmax; - register boxptr b1,b2; - - while (numboxes < desired_colors) { - /* Select box to split. - * Current algorithm: by population for first half, then by volume. - */ - if ((numboxes*2) <= desired_colors) { - b1 = find_biggest_color_pop(boxlist, numboxes); - } else { - b1 = find_biggest_volume(boxlist, numboxes); - } - if (b1 == NULL) /* no splittable boxes left! */ - break; - b2 = &boxlist[numboxes]; /* where new box will go */ - /* Copy the color bounds to the new box. */ - b2->c0max = b1->c0max; b2->c1max = b1->c1max; b2->c2max = b1->c2max; - b2->c0min = b1->c0min; b2->c1min = b1->c1min; b2->c2min = b1->c2min; - /* Choose which axis to split the box on. - * Current algorithm: longest scaled axis. - * See notes in update_box about scaling distances. - */ - c0 = ((b1->c0max - b1->c0min) << C0_SHIFT) * C0_SCALE; - c1 = ((b1->c1max - b1->c1min) << C1_SHIFT) * C1_SCALE; - c2 = ((b1->c2max - b1->c2min) << C2_SHIFT) * C2_SCALE; - /* We want to break any ties in favor of green, then red, blue last. - * This code does the right thing for R,G,B or B,G,R color orders only. - */ -#if defined(__VISAGECPP__) - -#if RGB_RED_OS2 == 0 - cmax = c1; n = 1; - if (c0 > cmax) { cmax = c0; n = 0; } - if (c2 > cmax) { n = 2; } -#else - cmax = c1; n = 1; - if (c2 > cmax) { cmax = c2; n = 2; } - if (c0 > cmax) { n = 0; } -#endif - -#else - -#if RGB_RED == 0 - cmax = c1; n = 1; - if (c0 > cmax) { cmax = c0; n = 0; } - if (c2 > cmax) { n = 2; } -#else - cmax = c1; n = 1; - if (c2 > cmax) { cmax = c2; n = 2; } - if (c0 > cmax) { n = 0; } -#endif - -#endif - /* Choose split point along selected axis, and update box bounds. - * Current algorithm: split at halfway point. - * (Since the box has been shrunk to minimum volume, - * any split will produce two nonempty subboxes.) - * Note that lb value is max for lower box, so must be < old max. - */ - switch (n) { - case 0: - lb = (b1->c0max + b1->c0min) / 2; - b1->c0max = lb; - b2->c0min = lb+1; - break; - case 1: - lb = (b1->c1max + b1->c1min) / 2; - b1->c1max = lb; - b2->c1min = lb+1; - break; - case 2: - lb = (b1->c2max + b1->c2min) / 2; - b1->c2max = lb; - b2->c2min = lb+1; - break; - } - /* Update stats for boxes */ - update_box(cinfo, b1); - update_box(cinfo, b2); - numboxes++; - } - return numboxes; -} - - -void -compute_color (j_decompress_ptr cinfo, boxptr boxp, int icolor) -/* Compute representative color for a box, put it in colormap[icolor] */ -{ - /* Current algorithm: mean weighted by pixels (not colors) */ - /* Note it is important to get the rounding correct! */ - my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize; - hist3d histogram = cquantize->histogram; - histptr histp; - int c0,c1,c2; - int c0min,c0max,c1min,c1max,c2min,c2max; - long count; - long total = 0; - long c0total = 0; - long c1total = 0; - long c2total = 0; - - c0min = boxp->c0min; c0max = boxp->c0max; - c1min = boxp->c1min; c1max = boxp->c1max; - c2min = boxp->c2min; c2max = boxp->c2max; - - for (c0 = c0min; c0 <= c0max; c0++) - for (c1 = c1min; c1 <= c1max; c1++) { - histp = & histogram[c0][c1][c2min]; - for (c2 = c2min; c2 <= c2max; c2++) { - if ((count = *histp++) != 0) { - total += count; - c0total += ((c0 << C0_SHIFT) + ((1<>1)) * count; - c1total += ((c1 << C1_SHIFT) + ((1<>1)) * count; - c2total += ((c2 << C2_SHIFT) + ((1<>1)) * count; - } - } - } - - cinfo->colormap[0][icolor] = (JSAMPLE) ((c0total + (total>>1)) / total); - cinfo->colormap[1][icolor] = (JSAMPLE) ((c1total + (total>>1)) / total); - cinfo->colormap[2][icolor] = (JSAMPLE) ((c2total + (total>>1)) / total); -} - - -static void -select_colors (j_decompress_ptr cinfo, int desired_colors) -/* Master routine for color selection */ -{ - boxptr boxlist; - int numboxes; - int i; - - /* Allocate workspace for box list */ - boxlist = (boxptr) malloc(desired_colors * sizeof(box)); - /* Initialize one box containing whole space */ - numboxes = 1; - boxlist[0].c0min = 0; - boxlist[0].c0max = MAXJSAMPLE >> C0_SHIFT; - boxlist[0].c1min = 0; - boxlist[0].c1max = MAXJSAMPLE >> C1_SHIFT; - boxlist[0].c2min = 0; - boxlist[0].c2max = MAXJSAMPLE >> C2_SHIFT; - /* Shrink it to actually-used volume and set its statistics */ - update_box(cinfo, & boxlist[0]); - /* Perform median-cut to produce final box list */ - numboxes = median_cut(cinfo, boxlist, numboxes, desired_colors); - /* Compute the representative color for each box, fill colormap */ - for (i = 0; i < numboxes; i++) - compute_color(cinfo, & boxlist[i], i); - cinfo->actual_number_of_colors = numboxes; - - free(boxlist); //FIXME?? I don't know if this is correct - VS -} - - -/* - * These routines are concerned with the time-critical task of mapping input - * colors to the nearest color in the selected colormap. - * - * We re-use the histogram space as an "inverse color map", essentially a - * cache for the results of nearest-color searches. All colors within a - * histogram cell will be mapped to the same colormap entry, namely the one - * closest to the cell's center. This may not be quite the closest entry to - * the actual input color, but it's almost as good. A zero in the cache - * indicates we haven't found the nearest color for that cell yet; the array - * is cleared to zeroes before starting the mapping pass. When we find the - * nearest color for a cell, its colormap index plus one is recorded in the - * cache for future use. The pass2 scanning routines call fill_inverse_cmap - * when they need to use an unfilled entry in the cache. - * - * Our method of efficiently finding nearest colors is based on the "locally - * sorted search" idea described by Heckbert and on the incremental distance - * calculation described by Spencer W. Thomas in chapter III.1 of Graphics - * Gems II (James Arvo, ed. Academic Press, 1991). Thomas points out that - * the distances from a given colormap entry to each cell of the histogram can - * be computed quickly using an incremental method: the differences between - * distances to adjacent cells themselves differ by a constant. This allows a - * fairly fast implementation of the "brute force" approach of computing the - * distance from every colormap entry to every histogram cell. Unfortunately, - * it needs a work array to hold the best-distance-so-far for each histogram - * cell (because the inner loop has to be over cells, not colormap entries). - * The work array elements have to be INT32s, so the work array would need - * 256Kb at our recommended precision. This is not feasible in DOS machines. - * - * To get around these problems, we apply Thomas' method to compute the - * nearest colors for only the cells within a small subbox of the histogram. - * The work array need be only as big as the subbox, so the memory usage - * problem is solved. Furthermore, we need not fill subboxes that are never - * referenced in pass2; many images use only part of the color gamut, so a - * fair amount of work is saved. An additional advantage of this - * approach is that we can apply Heckbert's locality criterion to quickly - * eliminate colormap entries that are far away from the subbox; typically - * three-fourths of the colormap entries are rejected by Heckbert's criterion, - * and we need not compute their distances to individual cells in the subbox. - * The speed of this approach is heavily influenced by the subbox size: too - * small means too much overhead, too big loses because Heckbert's criterion - * can't eliminate as many colormap entries. Empirically the best subbox - * size seems to be about 1/512th of the histogram (1/8th in each direction). - * - * Thomas' article also describes a refined method which is asymptotically - * faster than the brute-force method, but it is also far more complex and - * cannot efficiently be applied to small subboxes. It is therefore not - * useful for programs intended to be portable to DOS machines. On machines - * with plenty of memory, filling the whole histogram in one shot with Thomas' - * refined method might be faster than the present code --- but then again, - * it might not be any faster, and it's certainly more complicated. - */ - - -/* log2(histogram cells in update box) for each axis; this can be adjusted */ -#define BOX_C0_LOG (HIST_C0_BITS-3) -#define BOX_C1_LOG (HIST_C1_BITS-3) -#define BOX_C2_LOG (HIST_C2_BITS-3) - -#define BOX_C0_ELEMS (1<actual_number_of_colors; - int maxc0, maxc1, maxc2; - int centerc0, centerc1, centerc2; - int i, x, ncolors; - INT32 minmaxdist, min_dist, max_dist, tdist; - INT32 mindist[MAXNUMCOLORS]; /* min distance to colormap entry i */ - - /* Compute true coordinates of update box's upper corner and center. - * Actually we compute the coordinates of the center of the upper-corner - * histogram cell, which are the upper bounds of the volume we care about. - * Note that since ">>" rounds down, the "center" values may be closer to - * min than to max; hence comparisons to them must be "<=", not "<". - */ - maxc0 = minc0 + ((1 << BOX_C0_SHIFT) - (1 << C0_SHIFT)); - centerc0 = (minc0 + maxc0) >> 1; - maxc1 = minc1 + ((1 << BOX_C1_SHIFT) - (1 << C1_SHIFT)); - centerc1 = (minc1 + maxc1) >> 1; - maxc2 = minc2 + ((1 << BOX_C2_SHIFT) - (1 << C2_SHIFT)); - centerc2 = (minc2 + maxc2) >> 1; - - /* For each color in colormap, find: - * 1. its minimum squared-distance to any point in the update box - * (zero if color is within update box); - * 2. its maximum squared-distance to any point in the update box. - * Both of these can be found by considering only the corners of the box. - * We save the minimum distance for each color in mindist[]; - * only the smallest maximum distance is of interest. - */ - minmaxdist = 0x7FFFFFFFL; - - for (i = 0; i < numcolors; i++) { - /* We compute the squared-c0-distance term, then add in the other two. */ - x = GETJSAMPLE(cinfo->colormap[0][i]); - if (x < minc0) { - tdist = (x - minc0) * C0_SCALE; - min_dist = tdist*tdist; - tdist = (x - maxc0) * C0_SCALE; - max_dist = tdist*tdist; - } else if (x > maxc0) { - tdist = (x - maxc0) * C0_SCALE; - min_dist = tdist*tdist; - tdist = (x - minc0) * C0_SCALE; - max_dist = tdist*tdist; - } else { - /* within cell range so no contribution to min_dist */ - min_dist = 0; - if (x <= centerc0) { - tdist = (x - maxc0) * C0_SCALE; - max_dist = tdist*tdist; - } else { - tdist = (x - minc0) * C0_SCALE; - max_dist = tdist*tdist; - } - } - - x = GETJSAMPLE(cinfo->colormap[1][i]); - if (x < minc1) { - tdist = (x - minc1) * C1_SCALE; - min_dist += tdist*tdist; - tdist = (x - maxc1) * C1_SCALE; - max_dist += tdist*tdist; - } else if (x > maxc1) { - tdist = (x - maxc1) * C1_SCALE; - min_dist += tdist*tdist; - tdist = (x - minc1) * C1_SCALE; - max_dist += tdist*tdist; - } else { - /* within cell range so no contribution to min_dist */ - if (x <= centerc1) { - tdist = (x - maxc1) * C1_SCALE; - max_dist += tdist*tdist; - } else { - tdist = (x - minc1) * C1_SCALE; - max_dist += tdist*tdist; - } - } - - x = GETJSAMPLE(cinfo->colormap[2][i]); - if (x < minc2) { - tdist = (x - minc2) * C2_SCALE; - min_dist += tdist*tdist; - tdist = (x - maxc2) * C2_SCALE; - max_dist += tdist*tdist; - } else if (x > maxc2) { - tdist = (x - maxc2) * C2_SCALE; - min_dist += tdist*tdist; - tdist = (x - minc2) * C2_SCALE; - max_dist += tdist*tdist; - } else { - /* within cell range so no contribution to min_dist */ - if (x <= centerc2) { - tdist = (x - maxc2) * C2_SCALE; - max_dist += tdist*tdist; - } else { - tdist = (x - minc2) * C2_SCALE; - max_dist += tdist*tdist; - } - } - - mindist[i] = min_dist; /* save away the results */ - if (max_dist < minmaxdist) - minmaxdist = max_dist; - } - - /* Now we know that no cell in the update box is more than minmaxdist - * away from some colormap entry. Therefore, only colors that are - * within minmaxdist of some part of the box need be considered. - */ - ncolors = 0; - for (i = 0; i < numcolors; i++) { - if (mindist[i] <= minmaxdist) - colorlist[ncolors++] = (JSAMPLE) i; - } - return ncolors; -} - - -static void -find_best_colors (j_decompress_ptr cinfo, int minc0, int minc1, int minc2, - int numcolors, JSAMPLE colorlist[], JSAMPLE bestcolor[]) -/* Find the closest colormap entry for each cell in the update box, - * given the list of candidate colors prepared by find_nearby_colors. - * Return the indexes of the closest entries in the bestcolor[] array. - * This routine uses Thomas' incremental distance calculation method to - * find the distance from a colormap entry to successive cells in the box. - */ -{ - int ic0, ic1, ic2; - int i, icolor; - register INT32 * bptr; /* pointer into bestdist[] array */ - JSAMPLE * cptr; /* pointer into bestcolor[] array */ - INT32 dist0, dist1; /* initial distance values */ - register INT32 dist2; /* current distance in inner loop */ - INT32 xx0, xx1; /* distance increments */ - register INT32 xx2; - INT32 inc0, inc1, inc2; /* initial values for increments */ - /* This array holds the distance to the nearest-so-far color for each cell */ - INT32 bestdist[BOX_C0_ELEMS * BOX_C1_ELEMS * BOX_C2_ELEMS]; - - /* Initialize best-distance for each cell of the update box */ - bptr = bestdist; - for (i = BOX_C0_ELEMS*BOX_C1_ELEMS*BOX_C2_ELEMS-1; i >= 0; i--) - *bptr++ = 0x7FFFFFFFL; - - /* For each color selected by find_nearby_colors, - * compute its distance to the center of each cell in the box. - * If that's less than best-so-far, update best distance and color number. - */ - - /* Nominal steps between cell centers ("x" in Thomas article) */ -#define STEP_C0 ((1 << C0_SHIFT) * C0_SCALE) -#define STEP_C1 ((1 << C1_SHIFT) * C1_SCALE) -#define STEP_C2 ((1 << C2_SHIFT) * C2_SCALE) - - for (i = 0; i < numcolors; i++) { - icolor = GETJSAMPLE(colorlist[i]); - /* Compute (square of) distance from minc0/c1/c2 to this color */ - inc0 = (minc0 - GETJSAMPLE(cinfo->colormap[0][icolor])) * C0_SCALE; - dist0 = inc0*inc0; - inc1 = (minc1 - GETJSAMPLE(cinfo->colormap[1][icolor])) * C1_SCALE; - dist0 += inc1*inc1; - inc2 = (minc2 - GETJSAMPLE(cinfo->colormap[2][icolor])) * C2_SCALE; - dist0 += inc2*inc2; - /* Form the initial difference increments */ - inc0 = inc0 * (2 * STEP_C0) + STEP_C0 * STEP_C0; - inc1 = inc1 * (2 * STEP_C1) + STEP_C1 * STEP_C1; - inc2 = inc2 * (2 * STEP_C2) + STEP_C2 * STEP_C2; - /* Now loop over all cells in box, updating distance per Thomas method */ - bptr = bestdist; - cptr = bestcolor; - xx0 = inc0; - for (ic0 = BOX_C0_ELEMS-1; ic0 >= 0; ic0--) { - dist1 = dist0; - xx1 = inc1; - for (ic1 = BOX_C1_ELEMS-1; ic1 >= 0; ic1--) { - dist2 = dist1; - xx2 = inc2; - for (ic2 = BOX_C2_ELEMS-1; ic2 >= 0; ic2--) { - if (dist2 < *bptr) { - *bptr = dist2; - *cptr = (JSAMPLE) icolor; - } - dist2 += xx2; - xx2 += 2 * STEP_C2 * STEP_C2; - bptr++; - cptr++; - } - dist1 += xx1; - xx1 += 2 * STEP_C1 * STEP_C1; - } - dist0 += xx0; - xx0 += 2 * STEP_C0 * STEP_C0; - } - } -} - - -static void -fill_inverse_cmap (j_decompress_ptr cinfo, int c0, int c1, int c2) -/* Fill the inverse-colormap entries in the update box that contains */ -/* histogram cell c0/c1/c2. (Only that one cell MUST be filled, but */ -/* we can fill as many others as we wish.) */ -{ - my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize; - hist3d histogram = cquantize->histogram; - int minc0, minc1, minc2; /* lower left corner of update box */ - int ic0, ic1, ic2; - register JSAMPLE * cptr; /* pointer into bestcolor[] array */ - register histptr cachep; /* pointer into main cache array */ - /* This array lists the candidate colormap indexes. */ - JSAMPLE colorlist[MAXNUMCOLORS]; - int numcolors; /* number of candidate colors */ - /* This array holds the actually closest colormap index for each cell. */ - JSAMPLE bestcolor[BOX_C0_ELEMS * BOX_C1_ELEMS * BOX_C2_ELEMS]; - - /* Convert cell coordinates to update box ID */ - c0 >>= BOX_C0_LOG; - c1 >>= BOX_C1_LOG; - c2 >>= BOX_C2_LOG; - - /* Compute true coordinates of update box's origin corner. - * Actually we compute the coordinates of the center of the corner - * histogram cell, which are the lower bounds of the volume we care about. - */ - minc0 = (c0 << BOX_C0_SHIFT) + ((1 << C0_SHIFT) >> 1); - minc1 = (c1 << BOX_C1_SHIFT) + ((1 << C1_SHIFT) >> 1); - minc2 = (c2 << BOX_C2_SHIFT) + ((1 << C2_SHIFT) >> 1); - - /* Determine which colormap entries are close enough to be candidates - * for the nearest entry to some cell in the update box. - */ - numcolors = find_nearby_colors(cinfo, minc0, minc1, minc2, colorlist); - - /* Determine the actually nearest colors. */ - find_best_colors(cinfo, minc0, minc1, minc2, numcolors, colorlist, - bestcolor); - - /* Save the best color numbers (plus 1) in the main cache array */ - c0 <<= BOX_C0_LOG; /* convert ID back to base cell indexes */ - c1 <<= BOX_C1_LOG; - c2 <<= BOX_C2_LOG; - cptr = bestcolor; - for (ic0 = 0; ic0 < BOX_C0_ELEMS; ic0++) { - for (ic1 = 0; ic1 < BOX_C1_ELEMS; ic1++) { - cachep = & histogram[c0+ic0][c1+ic1][c2]; - for (ic2 = 0; ic2 < BOX_C2_ELEMS; ic2++) { - *cachep++ = (histcell) (GETJSAMPLE(*cptr++) + 1); - } - } - } -} - - -/* - * Map some rows of pixels to the output colormapped representation. - */ - -void -pass2_no_dither (j_decompress_ptr cinfo, - JSAMPARRAY input_buf, JSAMPARRAY output_buf, int num_rows) -/* This version performs no dithering */ -{ - my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize; - hist3d histogram = cquantize->histogram; - register JSAMPROW inptr, outptr; - register histptr cachep; - register int c0, c1, c2; - int row; - JDIMENSION col; - JDIMENSION width = cinfo->output_width; - - for (row = 0; row < num_rows; row++) { - inptr = input_buf[row]; - outptr = output_buf[row]; - for (col = width; col > 0; col--) { - /* get pixel value and index into the cache */ - c0 = GETJSAMPLE(*inptr++) >> C0_SHIFT; - c1 = GETJSAMPLE(*inptr++) >> C1_SHIFT; - c2 = GETJSAMPLE(*inptr++) >> C2_SHIFT; - cachep = & histogram[c0][c1][c2]; - /* If we have not seen this color before, find nearest colormap entry */ - /* and update the cache */ - if (*cachep == 0) - fill_inverse_cmap(cinfo, c0,c1,c2); - /* Now emit the colormap index for this cell */ - *outptr++ = (JSAMPLE) (*cachep - 1); - } - } -} - - -void -pass2_fs_dither (j_decompress_ptr cinfo, - JSAMPARRAY input_buf, JSAMPARRAY output_buf, int num_rows) -/* This version performs Floyd-Steinberg dithering */ -{ - my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize; - hist3d histogram = cquantize->histogram; - register LOCFSERROR cur0, cur1, cur2; /* current error or pixel value */ - LOCFSERROR belowerr0, belowerr1, belowerr2; /* error for pixel below cur */ - LOCFSERROR bpreverr0, bpreverr1, bpreverr2; /* error for below/prev col */ - register FSERRPTR errorptr; /* => fserrors[] at column before current */ - JSAMPROW inptr; /* => current input pixel */ - JSAMPROW outptr; /* => current output pixel */ - histptr cachep; - int dir; /* +1 or -1 depending on direction */ - int dir3; /* 3*dir, for advancing inptr & errorptr */ - int row; - JDIMENSION col; - JDIMENSION width = cinfo->output_width; - JSAMPLE *range_limit = cinfo->sample_range_limit; - int *error_limit = cquantize->error_limiter; - JSAMPROW colormap0 = cinfo->colormap[0]; - JSAMPROW colormap1 = cinfo->colormap[1]; - JSAMPROW colormap2 = cinfo->colormap[2]; - - - for (row = 0; row < num_rows; row++) { - inptr = input_buf[row]; - outptr = output_buf[row]; - if (cquantize->on_odd_row) { - /* work right to left in this row */ - inptr += (width-1) * 3; /* so point to rightmost pixel */ - outptr += width-1; - dir = -1; - dir3 = -3; - errorptr = cquantize->fserrors + (width+1)*3; /* => entry after last column */ - cquantize->on_odd_row = false; /* flip for next time */ - } else { - /* work left to right in this row */ - dir = 1; - dir3 = 3; - errorptr = cquantize->fserrors; /* => entry before first real column */ - cquantize->on_odd_row = true; /* flip for next time */ - } - /* Preset error values: no error propagated to first pixel from left */ - cur0 = cur1 = cur2 = 0; - /* and no error propagated to row below yet */ - belowerr0 = belowerr1 = belowerr2 = 0; - bpreverr0 = bpreverr1 = bpreverr2 = 0; - - for (col = width; col > 0; col--) { - /* curN holds the error propagated from the previous pixel on the - * current line. Add the error propagated from the previous line - * to form the complete error correction term for this pixel, and - * round the error term (which is expressed * 16) to an integer. - * RIGHT_SHIFT rounds towards minus infinity, so adding 8 is correct - * for either sign of the error value. - * Note: errorptr points to *previous* column's array entry. - */ - cur0 = RIGHT_SHIFT(cur0 + errorptr[dir3+0] + 8, 4); - cur1 = RIGHT_SHIFT(cur1 + errorptr[dir3+1] + 8, 4); - cur2 = RIGHT_SHIFT(cur2 + errorptr[dir3+2] + 8, 4); - /* Limit the error using transfer function set by init_error_limit. - * See comments with init_error_limit for rationale. - */ - cur0 = error_limit[cur0]; - cur1 = error_limit[cur1]; - cur2 = error_limit[cur2]; - /* Form pixel value + error, and range-limit to 0..MAXJSAMPLE. - * The maximum error is +- MAXJSAMPLE (or less with error limiting); - * this sets the required size of the range_limit array. - */ - cur0 += GETJSAMPLE(inptr[0]); - cur1 += GETJSAMPLE(inptr[1]); - cur2 += GETJSAMPLE(inptr[2]); - cur0 = GETJSAMPLE(range_limit[cur0]); - cur1 = GETJSAMPLE(range_limit[cur1]); - cur2 = GETJSAMPLE(range_limit[cur2]); - /* Index into the cache with adjusted pixel value */ - cachep = & histogram[cur0>>C0_SHIFT][cur1>>C1_SHIFT][cur2>>C2_SHIFT]; - /* If we have not seen this color before, find nearest colormap */ - /* entry and update the cache */ - if (*cachep == 0) - fill_inverse_cmap(cinfo, cur0>>C0_SHIFT,cur1>>C1_SHIFT,cur2>>C2_SHIFT); - /* Now emit the colormap index for this cell */ - { register int pixcode = *cachep - 1; - *outptr = (JSAMPLE) pixcode; - /* Compute representation error for this pixel */ - cur0 -= GETJSAMPLE(colormap0[pixcode]); - cur1 -= GETJSAMPLE(colormap1[pixcode]); - cur2 -= GETJSAMPLE(colormap2[pixcode]); - } - /* Compute error fractions to be propagated to adjacent pixels. - * Add these into the running sums, and simultaneously shift the - * next-line error sums left by 1 column. - */ - { register LOCFSERROR bnexterr, delta; - - bnexterr = cur0; /* Process component 0 */ - delta = cur0 * 2; - cur0 += delta; /* form error * 3 */ - errorptr[0] = (FSERROR) (bpreverr0 + cur0); - cur0 += delta; /* form error * 5 */ - bpreverr0 = belowerr0 + cur0; - belowerr0 = bnexterr; - cur0 += delta; /* form error * 7 */ - bnexterr = cur1; /* Process component 1 */ - delta = cur1 * 2; - cur1 += delta; /* form error * 3 */ - errorptr[1] = (FSERROR) (bpreverr1 + cur1); - cur1 += delta; /* form error * 5 */ - bpreverr1 = belowerr1 + cur1; - belowerr1 = bnexterr; - cur1 += delta; /* form error * 7 */ - bnexterr = cur2; /* Process component 2 */ - delta = cur2 * 2; - cur2 += delta; /* form error * 3 */ - errorptr[2] = (FSERROR) (bpreverr2 + cur2); - cur2 += delta; /* form error * 5 */ - bpreverr2 = belowerr2 + cur2; - belowerr2 = bnexterr; - cur2 += delta; /* form error * 7 */ - } - /* At this point curN contains the 7/16 error value to be propagated - * to the next pixel on the current line, and all the errors for the - * next line have been shifted over. We are therefore ready to move on. - */ - inptr += dir3; /* Advance pixel pointers to next column */ - outptr += dir; - errorptr += dir3; /* advance errorptr to current column */ - } - /* Post-loop cleanup: we must unload the final error values into the - * final fserrors[] entry. Note we need not unload belowerrN because - * it is for the dummy column before or after the actual array. - */ - errorptr[0] = (FSERROR) bpreverr0; /* unload prev errs into array */ - errorptr[1] = (FSERROR) bpreverr1; - errorptr[2] = (FSERROR) bpreverr2; - } -} - - -/* - * Initialize the error-limiting transfer function (lookup table). - * The raw F-S error computation can potentially compute error values of up to - * +- MAXJSAMPLE. But we want the maximum correction applied to a pixel to be - * much less, otherwise obviously wrong pixels will be created. (Typical - * effects include weird fringes at color-area boundaries, isolated bright - * pixels in a dark area, etc.) The standard advice for avoiding this problem - * is to ensure that the "corners" of the color cube are allocated as output - * colors; then repeated errors in the same direction cannot cause cascading - * error buildup. However, that only prevents the error from getting - * completely out of hand; Aaron Giles reports that error limiting improves - * the results even with corner colors allocated. - * A simple clamping of the error values to about +- MAXJSAMPLE/8 works pretty - * well, but the smoother transfer function used below is even better. Thanks - * to Aaron Giles for this idea. - */ - -static void -init_error_limit (j_decompress_ptr cinfo) -/* Allocate and fill in the error_limiter table */ -{ - my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize; - int * table; - int in, out; - - table = (int *) malloc((MAXJSAMPLE*2+1) * sizeof(int)); - table += MAXJSAMPLE; /* so can index -MAXJSAMPLE .. +MAXJSAMPLE */ - cquantize->error_limiter = table; - -#define STEPSIZE ((MAXJSAMPLE+1)/16) - /* Map errors 1:1 up to +- MAXJSAMPLE/16 */ - out = 0; - for (in = 0; in < STEPSIZE; in++, out++) { - table[in] = out; table[-in] = -out; - } - /* Map errors 1:2 up to +- 3*MAXJSAMPLE/16 */ - for (; in < STEPSIZE*3; in++, out += (in&1) ? 0 : 1) { - table[in] = out; table[-in] = -out; - } - /* Clamp the rest to final out value (which is (MAXJSAMPLE+1)/8) */ - for (; in <= MAXJSAMPLE; in++) { - table[in] = out; table[-in] = -out; - } -#undef STEPSIZE -} - - -/* - * Finish up at the end of each pass. - */ - -void -finish_pass1 (j_decompress_ptr cinfo) -{ - my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize; - - /* Select the representative colors and fill in cinfo->colormap */ - cinfo->colormap = cquantize->sv_colormap; - select_colors(cinfo, cquantize->desired); - /* Force next pass to zero the color index table */ - cquantize->needs_zeroed = true; -} - - -void -finish_pass2 (j_decompress_ptr WXUNUSED(cinfo)) -{ - /* no work */ -} - - -/* - * Initialize for each processing pass. - */ - -void -start_pass_2_quant (j_decompress_ptr cinfo, bool is_pre_scan) -{ - my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize; - hist3d histogram = cquantize->histogram; - - if (is_pre_scan) { - /* Set up method pointers */ - cquantize->pub.color_quantize = prescan_quantize; - cquantize->pub.finish_pass = finish_pass1; - cquantize->needs_zeroed = true; /* Always zero histogram */ - } else { - /* Set up method pointers */ - cquantize->pub.color_quantize = pass2_fs_dither; - cquantize->pub.finish_pass = finish_pass2; - - { - size_t arraysize = (size_t) ((cinfo->output_width + 2) * - (3 * sizeof(FSERROR))); - /* Allocate Floyd-Steinberg workspace if we didn't already. */ - if (cquantize->fserrors == NULL) - cquantize->fserrors = (INT16*) malloc(arraysize); - /* Initialize the propagated errors to zero. */ - memset((void *) cquantize->fserrors, 0, arraysize); - /* Make the error-limit table if we didn't already. */ - if (cquantize->error_limiter == NULL) - init_error_limit(cinfo); - cquantize->on_odd_row = false; - } - - } - /* Zero the histogram or inverse color map, if necessary */ - if (cquantize->needs_zeroed) { - for (int i = 0; i < HIST_C0_ELEMS; i++) { - memset((void *) histogram[i], 0, - HIST_C1_ELEMS*HIST_C2_ELEMS * sizeof(histcell)); - } - cquantize->needs_zeroed = false; - } -} - - -/* - * Switch to a new external colormap between output passes. - */ - -void -new_color_map_2_quant (j_decompress_ptr cinfo) -{ - my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize; - - /* Reset the inverse color map */ - cquantize->needs_zeroed = true; -} - - -/* - * Module initialization routine for 2-pass color quantization. - */ - -void -jinit_2pass_quantizer (j_decompress_ptr cinfo) -{ - my_cquantize_ptr cquantize; - int i; - - cquantize = (my_cquantize_ptr) malloc(sizeof(my_cquantizer)); - cinfo->cquantize = (jpeg_color_quantizer *) cquantize; - cquantize->pub.start_pass = start_pass_2_quant; - cquantize->pub.new_color_map = new_color_map_2_quant; - cquantize->fserrors = NULL; /* flag optional arrays not allocated */ - cquantize->error_limiter = NULL; - - - /* Allocate the histogram/inverse colormap storage */ - cquantize->histogram = (hist3d) malloc(HIST_C0_ELEMS * sizeof(hist2d)); - for (i = 0; i < HIST_C0_ELEMS; i++) { - cquantize->histogram[i] = (hist2d) malloc(HIST_C1_ELEMS*HIST_C2_ELEMS * sizeof(histcell)); - } - cquantize->needs_zeroed = true; /* histogram is garbage now */ - - /* Allocate storage for the completed colormap, if required. - * We do this now since it is storage and may affect - * the memory manager's space calculations. - */ - { - /* Make sure color count is acceptable */ - int desired = cinfo->desired_number_of_colors; - - cquantize->sv_colormap = (JSAMPARRAY) malloc(sizeof(JSAMPROW) * 3); - cquantize->sv_colormap[0] = (JSAMPROW) malloc(sizeof(JSAMPLE) * desired); - cquantize->sv_colormap[1] = (JSAMPROW) malloc(sizeof(JSAMPLE) * desired); - cquantize->sv_colormap[2] = (JSAMPROW) malloc(sizeof(JSAMPLE) * desired); - - cquantize->desired = desired; - } - - /* Allocate Floyd-Steinberg workspace if necessary. - * This isn't really needed until pass 2, but again it is storage. - * Although we will cope with a later change in dither_mode, - * we do not promise to honor max_memory_to_use if dither_mode changes. - */ - { - cquantize->fserrors = (FSERRPTR) malloc( - (size_t) ((cinfo->output_width + 2) * (3 * sizeof(FSERROR)))); - /* Might as well create the error-limiting table too. */ - init_error_limit(cinfo); - } -} - - - - - - - - - - -void -prepare_range_limit_table (j_decompress_ptr cinfo) -/* Allocate and fill in the sample_range_limit table */ -{ - JSAMPLE * table; - int i; - - table = (JSAMPLE *) malloc((5 * (MAXJSAMPLE+1) + CENTERJSAMPLE) * sizeof(JSAMPLE)); - cinfo->srl_orig = table; - table += (MAXJSAMPLE+1); /* allow negative subscripts of simple table */ - cinfo->sample_range_limit = table; - /* First segment of "simple" table: limit[x] = 0 for x < 0 */ - memset(table - (MAXJSAMPLE+1), 0, (MAXJSAMPLE+1) * sizeof(JSAMPLE)); - /* Main part of "simple" table: limit[x] = x */ - for (i = 0; i <= MAXJSAMPLE; i++) - table[i] = (JSAMPLE) i; - table += CENTERJSAMPLE; /* Point to where post-IDCT table starts */ - /* End of simple table, rest of first half of post-IDCT table */ - for (i = CENTERJSAMPLE; i < 2*(MAXJSAMPLE+1); i++) - table[i] = MAXJSAMPLE; - /* Second half of post-IDCT table */ - memset(table + (2 * (MAXJSAMPLE+1)), 0, - (2 * (MAXJSAMPLE+1) - CENTERJSAMPLE) * sizeof(JSAMPLE)); - memcpy(table + (4 * (MAXJSAMPLE+1) - CENTERJSAMPLE), - cinfo->sample_range_limit, CENTERJSAMPLE * sizeof(JSAMPLE)); -} - - - - -/* - * wxQuantize - */ - -IMPLEMENT_DYNAMIC_CLASS(wxQuantize, wxObject) - -void wxQuantize::DoQuantize(unsigned w, unsigned h, unsigned char **in_rows, unsigned char **out_rows, - unsigned char *palette, int desiredNoColours) -{ - j_decompress dec; - my_cquantize_ptr cquantize; - - dec.output_width = w; - dec.desired_number_of_colors = desiredNoColours; - prepare_range_limit_table(&dec); - jinit_2pass_quantizer(&dec); - cquantize = (my_cquantize_ptr) dec.cquantize; - - - cquantize->pub.start_pass(&dec, true); - cquantize->pub.color_quantize(&dec, in_rows, out_rows, h); - cquantize->pub.finish_pass(&dec); - - cquantize->pub.start_pass(&dec, false); - cquantize->pub.color_quantize(&dec, in_rows, out_rows, h); - cquantize->pub.finish_pass(&dec); - - - for (int i = 0; i < dec.desired_number_of_colors; i++) { - palette[3 * i + 0] = dec.colormap[0][i]; - palette[3 * i + 1] = dec.colormap[1][i]; - palette[3 * i + 2] = dec.colormap[2][i]; - } - - for (int ii = 0; ii < HIST_C0_ELEMS; ii++) free(cquantize->histogram[ii]); - free(cquantize->histogram); - free(dec.colormap[0]); - free(dec.colormap[1]); - free(dec.colormap[2]); - free(dec.colormap); - free(dec.srl_orig); - - //free(cquantize->error_limiter); - free((void*)(cquantize->error_limiter - MAXJSAMPLE)); // To reverse what was done to it - - free(cquantize->fserrors); - free(cquantize); -} - -// TODO: somehow make use of the Windows system colours, rather than ignoring them for the -// purposes of quantization. - -bool wxQuantize::Quantize(const wxImage& src, wxImage& dest, - wxPalette** pPalette, - int desiredNoColours, - unsigned char** eightBitData, - int flags) - -{ - int i; - - int windowsSystemColourCount = 20; - - int paletteShift = 0; - - // Shift the palette up by the number of Windows system colours, - // if necessary - if (flags & wxQUANTIZE_INCLUDE_WINDOWS_COLOURS) - paletteShift = windowsSystemColourCount; - - // Make room for the Windows system colours -#ifdef __WXMSW__ - if ((flags & wxQUANTIZE_INCLUDE_WINDOWS_COLOURS) && (desiredNoColours > (256 - windowsSystemColourCount))) - desiredNoColours = 256 - windowsSystemColourCount; -#endif - - // create rows info: - int h = src.GetHeight(); - int w = src.GetWidth(); - unsigned char **rows = new unsigned char *[h]; - unsigned char *imgdt = src.GetData(); - for (i = 0; i < h; i++) - rows[i] = imgdt + 3/*RGB*/ * w * i; - - unsigned char palette[3*256]; - - // This is the image as represented by palette indexes. - unsigned char *data8bit = new unsigned char[w * h]; - unsigned char **outrows = new unsigned char *[h]; - for (i = 0; i < h; i++) - outrows[i] = data8bit + w * i; - - //RGB->palette - DoQuantize(w, h, rows, outrows, palette, desiredNoColours); - - delete[] rows; - delete[] outrows; - - // palette->RGB(max.256) - - if (flags & wxQUANTIZE_FILL_DESTINATION_IMAGE) - { - if (!dest.Ok()) - dest.Create(w, h); - - imgdt = dest.GetData(); - for (i = 0; i < w * h; i++) - { - unsigned char c = data8bit[i]; - imgdt[3 * i + 0/*R*/] = palette[3 * c + 0]; - imgdt[3 * i + 1/*G*/] = palette[3 * c + 1]; - imgdt[3 * i + 2/*B*/] = palette[3 * c + 2]; - } - } - - if (eightBitData && (flags & wxQUANTIZE_RETURN_8BIT_DATA)) - { -#ifdef __WXMSW__ - if (flags & wxQUANTIZE_INCLUDE_WINDOWS_COLOURS) - { - // We need to shift the palette entries up - // to make room for the Windows system colours. - for (i = 0; i < w * h; i++) - data8bit[i] = (unsigned char)(data8bit[i] + paletteShift); - } -#endif - *eightBitData = data8bit; - } - else - delete[] data8bit; - -#if wxUSE_PALETTE - // Make a wxWidgets palette - if (pPalette) - { - unsigned char* r = new unsigned char[256]; - unsigned char* g = new unsigned char[256]; - unsigned char* b = new unsigned char[256]; - -#ifdef __WXMSW__ - // Fill the first 20 entries with Windows system colours - if (flags & wxQUANTIZE_INCLUDE_WINDOWS_COLOURS) - { - HDC hDC = ::GetDC(NULL); - PALETTEENTRY* entries = new PALETTEENTRY[windowsSystemColourCount]; - ::GetSystemPaletteEntries(hDC, 0, windowsSystemColourCount, entries); - ::ReleaseDC(NULL, hDC); - - for (i = 0; i < windowsSystemColourCount; i++) - { - r[i] = entries[i].peRed; - g[i] = entries[i].peGreen; - b[i] = entries[i].peBlue; - } - delete[] entries; - } -#endif - - for (i = 0; i < desiredNoColours; i++) - { - r[i+paletteShift] = palette[i*3 + 0]; - g[i+paletteShift] = palette[i*3 + 1]; - b[i+paletteShift] = palette[i*3 + 2]; - } - - // Blank out any remaining palette entries - for (i = desiredNoColours+paletteShift; i < 256; i++) - { - r[i] = 0; - g[i] = 0; - b[i] = 0; - } - *pPalette = new wxPalette(256, r, g, b); - delete[] r; - delete[] g; - delete[] b; - } -#endif // wxUSE_PALETTE - - return true; -} - -// This version sets a palette in the destination image so you don't -// have to manage it yourself. - -bool wxQuantize::Quantize(const wxImage& src, - wxImage& dest, - int desiredNoColours, - unsigned char** eightBitData, - int flags) -{ - wxPalette* palette = NULL; - if ( !Quantize(src, dest, & palette, desiredNoColours, eightBitData, flags) ) - return false; - -#if wxUSE_PALETTE - if (palette) - { - dest.SetPalette(* palette); - delete palette; - } -#endif // wxUSE_PALETTE - - return true; -} - -#endif - // wxUSE_IMAGE diff --git a/wxWidgets/src/common/radiocmn.cpp b/wxWidgets/src/common/radiocmn.cpp deleted file mode 100644 index 418d4f04f2..0000000000 --- a/wxWidgets/src/common/radiocmn.cpp +++ /dev/null @@ -1,304 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: src/common/radiocmn.cpp -// Purpose: wxRadioBox methods common to all ports -// Author: Vadim Zeitlin -// Modified by: -// Created: 03.06.01 -// RCS-ID: $Id: radiocmn.cpp 54930 2008-08-02 19:45:23Z VZ $ -// Copyright: (c) 2001 Vadim Zeitlin -// License: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_RADIOBOX - -#ifndef WX_PRECOMP - #include "wx/radiobox.h" -#endif //WX_PRECOMP - -#if wxUSE_TOOLTIPS - #include "wx/tooltip.h" -#endif // wxUSE_TOOLTIPS - -#if wxUSE_HELP - #include "wx/cshelp.h" -#endif - -// ============================================================================ -// implementation -// ============================================================================ - -void wxRadioBoxBase::SetMajorDim(unsigned int majorDim, long style) -{ - wxCHECK_RET( majorDim != 0, _T("major radiobox dimension can't be 0") ); - - m_majorDim = majorDim; - - int minorDim = (GetCount() + m_majorDim - 1) / m_majorDim; - - if ( style & wxRA_SPECIFY_COLS ) - { - m_numCols = majorDim; - m_numRows = minorDim; - } - else // wxRA_SPECIFY_ROWS - { - m_numCols = minorDim; - m_numRows = majorDim; - } -} - -int wxRadioBoxBase::GetNextItem(int item, wxDirection dir, long style) const -{ - const int itemStart = item; - - int count = GetCount(), - numCols = GetColumnCount(), - numRows = GetRowCount(); - - bool horz = (style & wxRA_SPECIFY_COLS) != 0; - - do - { - switch ( dir ) - { - case wxUP: - if ( horz ) - { - item -= numCols; - } - else // vertical layout - { - if ( !item-- ) - item = count - 1; - } - break; - - case wxLEFT: - if ( horz ) - { - if ( !item-- ) - item = count - 1; - } - else // vertical layout - { - item -= numRows; - } - break; - - case wxDOWN: - if ( horz ) - { - item += numCols; - } - else // vertical layout - { - if ( ++item == count ) - item = 0; - } - break; - - case wxRIGHT: - if ( horz ) - { - if ( ++item == count ) - item = 0; - } - else // vertical layout - { - item += numRows; - } - break; - - default: - wxFAIL_MSG( _T("unexpected wxDirection value") ); - return wxNOT_FOUND; - } - - // ensure that the item is in range [0..count) - if ( item < 0 ) - { - // first map the item to the one in the same column but in the last - // row - item += count; - - // now there are 2 cases: either it is the first item of the last - // row in which case we need to wrap again and get to the last item - // or we can just go to the previous item - if ( item % (horz ? numCols : numRows) ) - item--; - else - item = count - 1; - } - else if ( item >= count ) - { - // same logic as above - item -= count; - - // ... except that we need to check if this is not the last item, - // not the first one - if ( (item + 1) % (horz ? numCols : numRows) ) - item++; - else - item = 0; - } - - wxASSERT_MSG( item < count && item >= 0, - _T("logic error in wxRadioBox::GetNextItem()") ); - } - // we shouldn't select the non-active items, continue looking for a - // visible and shown one unless we came back to the item we started from in - // which case bail out to avoid infinite loop - while ( !(IsItemShown(item) && IsItemEnabled(item)) && item != itemStart ); - - return item; -} - -#if wxUSE_TOOLTIPS - -void wxRadioBoxBase::SetItemToolTip(unsigned int item, const wxString& text) -{ - wxASSERT_MSG( item < GetCount(), _T("Invalid item index") ); - - // extend the array to have entries for all our items on first use - if ( !m_itemsTooltips ) - { - m_itemsTooltips = new wxToolTipArray; - m_itemsTooltips->resize(GetCount()); - } - - wxToolTip *tooltip = (*m_itemsTooltips)[item]; - - bool changed = true; - if ( text.empty() ) - { - if ( tooltip ) - { - // delete the tooltip - delete tooltip; - tooltip = NULL; - } - else // nothing to do - { - changed = false; - } - } - else // non empty tooltip text - { - if ( tooltip ) - { - // just change the existing tooltip text, don't change the tooltip - tooltip->SetTip(text); - changed = false; - } - else // no tooltip yet - { - // create the new one - tooltip = new wxToolTip(text); - } - } - - if ( changed ) - { - (*m_itemsTooltips)[item] = tooltip; - DoSetItemToolTip(item, tooltip); - } -} - -void -wxRadioBoxBase::DoSetItemToolTip(unsigned int WXUNUSED(item), - wxToolTip * WXUNUSED(tooltip)) -{ - // per-item tooltips not implemented by default -} - -#endif // wxUSE_TOOLTIPS - -wxRadioBoxBase::~wxRadioBoxBase() -{ -#if wxUSE_TOOLTIPS - if ( m_itemsTooltips ) - { - const size_t n = m_itemsTooltips->size(); - for ( size_t i = 0; i < n; i++ ) - delete (*m_itemsTooltips)[i]; - - delete m_itemsTooltips; - } -#endif // wxUSE_TOOLTIPS -} - -#if wxUSE_HELP - -// set helptext for a particular item -void wxRadioBoxBase::SetItemHelpText(unsigned int n, const wxString& helpText) -{ - wxCHECK_RET( n < GetCount(), _T("Invalid item index") ); - - if ( m_itemsHelpTexts.empty() ) - { - // once-only initialization of the array: reserve space for all items - m_itemsHelpTexts.Add(wxEmptyString, GetCount()); - } - - m_itemsHelpTexts[n] = helpText; -} - -// retrieve helptext for a particular item -wxString wxRadioBoxBase::GetItemHelpText( unsigned int n ) const -{ - wxCHECK_MSG( n < GetCount(), wxEmptyString, _T("Invalid item index") ); - - return m_itemsHelpTexts.empty() ? wxString() : m_itemsHelpTexts[n]; -} - -// return help text for the item for which wxEVT_HELP was generated. -wxString wxRadioBoxBase::DoGetHelpTextAtPoint(const wxWindow *derived, - const wxPoint& pt, - wxHelpEvent::Origin origin) const -{ - const int item = origin == wxHelpEvent::Origin_HelpButton - ? GetItemFromPoint(pt) - : GetSelection(); - - if ( item != wxNOT_FOUND ) - { - wxString text = GetItemHelpText(wx_static_cast(unsigned int, item)); - if( !text.empty() ) - return text; - } - - return derived->wxWindowBase::GetHelpTextAtPoint(pt, origin); -} - -#endif // wxUSE_HELP - -#if WXWIN_COMPATIBILITY_2_4 - -// these functions are deprecated and don't do anything -int wxRadioBoxBase::GetNumberOfRowsOrCols() const -{ - return 1; -} - -void wxRadioBoxBase::SetNumberOfRowsOrCols(int WXUNUSED(n)) -{ -} - -#endif // WXWIN_COMPATIBILITY_2_4 - -#endif // wxUSE_RADIOBOX diff --git a/wxWidgets/src/common/regex.cpp b/wxWidgets/src/common/regex.cpp deleted file mode 100644 index bd77aafe23..0000000000 --- a/wxWidgets/src/common/regex.cpp +++ /dev/null @@ -1,689 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: src/common/regex.cpp -// Purpose: regular expression matching -// Author: Karsten Ballueder and Vadim Zeitlin -// Modified by: -// Created: 13.07.01 -// RCS-ID: $Id: regex.cpp 57779 2009-01-02 17:35:16Z PC $ -// Copyright: (c) 2000 Karsten Ballueder -// 2001 Vadim Zeitlin -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_REGEX - -#include "wx/regex.h" - -#ifndef WX_PRECOMP - #include "wx/object.h" - #include "wx/log.h" - #include "wx/intl.h" -#endif //WX_PRECOMP - -// FreeBSD, Watcom and DMars require this, CW doesn't have nor need it. -// Others also don't seem to need it. If you have an error related to -// (not) including please report details to -// wx-dev@lists.wxwindows.org -#if defined(__UNIX__) || defined(__WATCOMC__) || defined(__DIGITALMARS__) -# include -#endif - -#include - -// WXREGEX_USING_BUILTIN defined when using the built-in regex lib -// WXREGEX_USING_RE_SEARCH defined when using re_search in the GNU regex lib -// WXREGEX_IF_NEED_LEN() wrap the len parameter only used with the built-in -// or GNU regex -// WXREGEX_CONVERT_TO_MB defined when the regex lib is using chars and -// wxChar is wide, so conversion must be done -// WXREGEX_CHAR(x) Convert wxChar to wxRegChar -// -#ifdef __REG_NOFRONT -# define WXREGEX_USING_BUILTIN -# define WXREGEX_IF_NEED_LEN(x) ,x -# define WXREGEX_CHAR(x) x -#else -# ifdef HAVE_RE_SEARCH -# define WXREGEX_IF_NEED_LEN(x) ,x -# define WXREGEX_USING_RE_SEARCH -# else -# define WXREGEX_IF_NEED_LEN(x) -# endif -# if wxUSE_UNICODE -# define WXREGEX_CONVERT_TO_MB -# endif -# define WXREGEX_CHAR(x) wxConvertWX2MB(x) -# define wx_regfree regfree -# define wx_regerror regerror -#endif - -// ---------------------------------------------------------------------------- -// private classes -// ---------------------------------------------------------------------------- - -#ifndef WXREGEX_USING_RE_SEARCH - -// the array of offsets for the matches, the usual POSIX regmatch_t array. -class wxRegExMatches -{ -public: - typedef regmatch_t *match_type; - - wxRegExMatches(size_t n) { m_matches = new regmatch_t[n]; } - ~wxRegExMatches() { delete [] m_matches; } - - // we just use casts here because the fields of regmatch_t struct may be 64 - // bit but we're limited to size_t in our public API and are not going to - // change it because operating on strings longer than 4GB using it is - // absolutely impractical anyhow - size_t Start(size_t n) const - { - return wx_truncate_cast(size_t, m_matches[n].rm_so); - } - - size_t End(size_t n) const - { - return wx_truncate_cast(size_t, m_matches[n].rm_eo); - } - - regmatch_t *get() const { return m_matches; } - -private: - regmatch_t *m_matches; -}; - -#else // WXREGEX_USING_RE_SEARCH - -// the array of offsets for the matches, the struct used by the GNU lib -class wxRegExMatches -{ -public: - typedef re_registers *match_type; - - wxRegExMatches(size_t n) - { - m_matches.num_regs = n; - m_matches.start = new regoff_t[n]; - m_matches.end = new regoff_t[n]; - } - - ~wxRegExMatches() - { - delete [] m_matches.start; - delete [] m_matches.end; - } - - size_t Start(size_t n) const { return m_matches.start[n]; } - size_t End(size_t n) const { return m_matches.end[n]; } - - re_registers *get() { return &m_matches; } - -private: - re_registers m_matches; -}; - -#endif // WXREGEX_USING_RE_SEARCH - -// the character type used by the regular expression engine -#ifndef WXREGEX_CONVERT_TO_MB -typedef wxChar wxRegChar; -#else -typedef char wxRegChar; -#endif - -// the real implementation of wxRegEx -class wxRegExImpl -{ -public: - // ctor and dtor - wxRegExImpl(); - ~wxRegExImpl(); - - // return true if Compile() had been called successfully - bool IsValid() const { return m_isCompiled; } - - // RE operations - bool Compile(const wxString& expr, int flags = 0); - bool Matches(const wxRegChar *str, int flags - WXREGEX_IF_NEED_LEN(size_t len)) const; - bool GetMatch(size_t *start, size_t *len, size_t index = 0) const; - size_t GetMatchCount() const; - int Replace(wxString *pattern, const wxString& replacement, - size_t maxMatches = 0) const; - -private: - // return the string containing the error message for the given err code - wxString GetErrorMsg(int errorcode, bool badconv) const; - - // init the members - void Init() - { - m_isCompiled = false; - m_Matches = NULL; - m_nMatches = 0; - } - - // free the RE if compiled - void Free() - { - if ( IsValid() ) - { - wx_regfree(&m_RegEx); - } - - delete m_Matches; - } - - // free the RE if any and reinit the members - void Reinit() - { - Free(); - Init(); - } - - // compiled RE - regex_t m_RegEx; - - // the subexpressions data - wxRegExMatches *m_Matches; - size_t m_nMatches; - - // true if m_RegEx is valid - bool m_isCompiled; -}; - - -// ============================================================================ -// implementation -// ============================================================================ - -// ---------------------------------------------------------------------------- -// wxRegExImpl -// ---------------------------------------------------------------------------- - -wxRegExImpl::wxRegExImpl() -{ - Init(); -} - -wxRegExImpl::~wxRegExImpl() -{ - Free(); -} - -wxString wxRegExImpl::GetErrorMsg(int errorcode, bool badconv) const -{ -#ifdef WXREGEX_CONVERT_TO_MB - // currently only needed when using system library in Unicode mode - if ( badconv ) - { - return _("conversion to 8-bit encoding failed"); - } -#else - // 'use' badconv to avoid a compiler warning - (void)badconv; -#endif - - wxString szError; - - // first get the string length needed - int len = wx_regerror(errorcode, &m_RegEx, NULL, 0); - if ( len > 0 ) - { - char* szcmbError = new char[++len]; - - (void)wx_regerror(errorcode, &m_RegEx, szcmbError, len); - - szError = wxConvertMB2WX(szcmbError); - delete [] szcmbError; - } - else // regerror() returned 0 - { - szError = _("unknown error"); - } - - return szError; -} - -bool wxRegExImpl::Compile(const wxString& expr, int flags) -{ - Reinit(); - -#ifdef WX_NO_REGEX_ADVANCED -# define FLAVORS wxRE_BASIC -#else -# define FLAVORS (wxRE_ADVANCED | wxRE_BASIC) - wxASSERT_MSG( (flags & FLAVORS) != FLAVORS, - _T("incompatible flags in wxRegEx::Compile") ); -#endif - wxASSERT_MSG( !(flags & ~(FLAVORS | wxRE_ICASE | wxRE_NOSUB | wxRE_NEWLINE)), - _T("unrecognized flags in wxRegEx::Compile") ); - - // translate our flags to regcomp() ones - int flagsRE = 0; - if ( !(flags & wxRE_BASIC) ) - { -#ifndef WX_NO_REGEX_ADVANCED - if (flags & wxRE_ADVANCED) - flagsRE |= REG_ADVANCED; - else -#endif - flagsRE |= REG_EXTENDED; - } - - if ( flags & wxRE_ICASE ) - flagsRE |= REG_ICASE; - if ( flags & wxRE_NOSUB ) - flagsRE |= REG_NOSUB; - if ( flags & wxRE_NEWLINE ) - flagsRE |= REG_NEWLINE; - - // compile it -#ifdef WXREGEX_USING_BUILTIN - bool conv = true; - int errorcode = wx_re_comp(&m_RegEx, expr, expr.length(), flagsRE); -#else - const wxWX2MBbuf conv = expr.mbc_str(); - int errorcode = conv ? regcomp(&m_RegEx, conv, flagsRE) : REG_BADPAT; -#endif - - if ( errorcode ) - { - wxLogError(_("Invalid regular expression '%s': %s"), - expr.c_str(), GetErrorMsg(errorcode, !conv).c_str()); - - m_isCompiled = false; - } - else // ok - { - // don't allocate the matches array now, but do it later if necessary - if ( flags & wxRE_NOSUB ) - { - // we don't need it at all - m_nMatches = 0; - } - else - { - // we will alloc the array later (only if really needed) but count - // the number of sub-expressions in the regex right now - - // there is always one for the whole expression - m_nMatches = 1; - - // and some more for bracketed subexperessions - for ( const wxChar *cptr = expr.c_str(); *cptr; cptr++ ) - { - if ( *cptr == _T('\\') ) - { - // in basic RE syntax groups are inside \(...\) - if ( *++cptr == _T('(') && (flags & wxRE_BASIC) ) - { - m_nMatches++; - } - } - else if ( *cptr == _T('(') && !(flags & wxRE_BASIC) ) - { - // we know that the previous character is not an unquoted - // backslash because it would have been eaten above, so we - // have a bare '(' and this indicates a group start for the - // extended syntax. '(?' is used for extensions by perl- - // like REs (e.g. advanced), and is not valid for POSIX - // extended, so ignore them always. - if ( cptr[1] != _T('?') ) - m_nMatches++; - } - } - } - - m_isCompiled = true; - } - - return IsValid(); -} - -#ifdef WXREGEX_USING_RE_SEARCH - -// On GNU, regexec is implemented as a wrapper around re_search. re_search -// requires a length parameter which the POSIX regexec does not have, -// therefore regexec must do a strlen on the search text each time it is -// called. This can drastically affect performance when matching is done in -// a loop along a string, such as during a search and replace. Therefore if -// re_search is detected by configure, it is used directly. -// -static int ReSearch(const regex_t *preg, - const char *text, - size_t len, - re_registers *matches, - int eflags) -{ - regex_t *pattern = wx_const_cast(regex_t*, preg); - - pattern->not_bol = (eflags & REG_NOTBOL) != 0; - pattern->not_eol = (eflags & REG_NOTEOL) != 0; - pattern->regs_allocated = REGS_FIXED; - - int ret = re_search(pattern, text, len, 0, len, matches); - return ret >= 0 ? 0 : REG_NOMATCH; -} - -#endif // WXREGEX_USING_RE_SEARCH - -bool wxRegExImpl::Matches(const wxRegChar *str, - int flags - WXREGEX_IF_NEED_LEN(size_t len)) const -{ - wxCHECK_MSG( IsValid(), false, _T("must successfully Compile() first") ); - - // translate our flags to regexec() ones - wxASSERT_MSG( !(flags & ~(wxRE_NOTBOL | wxRE_NOTEOL)), - _T("unrecognized flags in wxRegEx::Matches") ); - - int flagsRE = 0; - if ( flags & wxRE_NOTBOL ) - flagsRE |= REG_NOTBOL; - if ( flags & wxRE_NOTEOL ) - flagsRE |= REG_NOTEOL; - - // allocate matches array if needed - wxRegExImpl *self = wxConstCast(this, wxRegExImpl); - if ( !m_Matches && m_nMatches ) - { - self->m_Matches = new wxRegExMatches(m_nMatches); - } - - wxRegExMatches::match_type matches = m_Matches ? m_Matches->get() : NULL; - - // do match it -#if defined WXREGEX_USING_BUILTIN - int rc = wx_re_exec(&self->m_RegEx, str, len, NULL, m_nMatches, matches, flagsRE); -#elif defined WXREGEX_USING_RE_SEARCH - int rc = str ? ReSearch(&self->m_RegEx, str, len, matches, flagsRE) : REG_BADPAT; -#else - int rc = str ? regexec(&self->m_RegEx, str, m_nMatches, matches, flagsRE) : REG_BADPAT; -#endif - - switch ( rc ) - { - case 0: - // matched successfully - return true; - - default: - // an error occurred - wxLogError(_("Failed to find match for regular expression: %s"), - GetErrorMsg(rc, !str).c_str()); - // fall through - - case REG_NOMATCH: - // no match - return false; - } -} - -bool wxRegExImpl::GetMatch(size_t *start, size_t *len, size_t index) const -{ - wxCHECK_MSG( IsValid(), false, _T("must successfully Compile() first") ); - wxCHECK_MSG( m_nMatches, false, _T("can't use with wxRE_NOSUB") ); - wxCHECK_MSG( m_Matches, false, _T("must call Matches() first") ); - wxCHECK_MSG( index < m_nMatches, false, _T("invalid match index") ); - - if ( start ) - *start = m_Matches->Start(index); - if ( len ) - *len = m_Matches->End(index) - m_Matches->Start(index); - - return true; -} - -size_t wxRegExImpl::GetMatchCount() const -{ - wxCHECK_MSG( IsValid(), 0, _T("must successfully Compile() first") ); - wxCHECK_MSG( m_nMatches, 0, _T("can't use with wxRE_NOSUB") ); - - return m_nMatches; -} - -int wxRegExImpl::Replace(wxString *text, - const wxString& replacement, - size_t maxMatches) const -{ - wxCHECK_MSG( text, wxNOT_FOUND, _T("NULL text in wxRegEx::Replace") ); - wxCHECK_MSG( IsValid(), wxNOT_FOUND, _T("must successfully Compile() first") ); - - // the input string -#ifndef WXREGEX_CONVERT_TO_MB - const wxChar *textstr = text->c_str(); - size_t textlen = text->length(); -#else - const wxWX2MBbuf textstr = WXREGEX_CHAR(*text); - if (!textstr) - { - wxLogError(_("Failed to find match for regular expression: %s"), - GetErrorMsg(0, true).c_str()); - return 0; - } - size_t textlen = strlen(textstr); - text->clear(); -#endif - - // the replacement text - wxString textNew; - - // the result, allow 25% extra - wxString result; - result.reserve(5 * textlen / 4); - - // attempt at optimization: don't iterate over the string if it doesn't - // contain back references at all - bool mayHaveBackrefs = - replacement.find_first_of(_T("\\&")) != wxString::npos; - - if ( !mayHaveBackrefs ) - { - textNew = replacement; - } - - // the position where we start looking for the match - size_t matchStart = 0; - - // number of replacement made: we won't make more than maxMatches of them - // (unless maxMatches is 0 which doesn't limit the number of replacements) - size_t countRepl = 0; - - // note that "^" shouldn't match after the first call to Matches() so we - // use wxRE_NOTBOL to prevent it from happening - while ( (!maxMatches || countRepl < maxMatches) && - Matches(textstr + matchStart, - countRepl ? wxRE_NOTBOL : 0 - WXREGEX_IF_NEED_LEN(textlen - matchStart)) ) - { - // the string possibly contains back references: we need to calculate - // the replacement text anew after each match - if ( mayHaveBackrefs ) - { - mayHaveBackrefs = false; - textNew.clear(); - textNew.reserve(replacement.length()); - - for ( const wxChar *p = replacement.c_str(); *p; p++ ) - { - size_t index = (size_t)-1; - - if ( *p == _T('\\') ) - { - if ( wxIsdigit(*++p) ) - { - // back reference - wxChar *end; - index = (size_t)wxStrtoul(p, &end, 10); - p = end - 1; // -1 to compensate for p++ in the loop - } - //else: backslash used as escape character - } - else if ( *p == _T('&') ) - { - // treat this as "\0" for compatbility with ed and such - index = 0; - } - - // do we have a back reference? - if ( index != (size_t)-1 ) - { - // yes, get its text - size_t start, len; - if ( !GetMatch(&start, &len, index) ) - { - wxFAIL_MSG( _T("invalid back reference") ); - - // just eat it... - } - else - { - textNew += wxString(textstr + matchStart + start, - *wxConvCurrent, len); - - mayHaveBackrefs = true; - } - } - else // ordinary character - { - textNew += *p; - } - } - } - - size_t start, len; - if ( !GetMatch(&start, &len) ) - { - // we did have match as Matches() returned true above! - wxFAIL_MSG( _T("internal logic error in wxRegEx::Replace") ); - - return wxNOT_FOUND; - } - - // an insurance against implementations that don't grow exponentially - // to ensure building the result takes linear time - if (result.capacity() < result.length() + start + textNew.length()) - result.reserve(2 * result.length()); - -#ifndef WXREGEX_CONVERT_TO_MB - result.append(*text, matchStart, start); -#else - result.append(wxString(textstr + matchStart, *wxConvCurrent, start)); -#endif - matchStart += start; - result.append(textNew); - - countRepl++; - - matchStart += len; - } - -#ifndef WXREGEX_CONVERT_TO_MB - result.append(*text, matchStart, wxString::npos); -#else - result.append(wxString(textstr + matchStart, *wxConvCurrent)); -#endif - *text = result; - - return countRepl; -} - -// ---------------------------------------------------------------------------- -// wxRegEx: all methods are mostly forwarded to wxRegExImpl -// ---------------------------------------------------------------------------- - -void wxRegEx::Init() -{ - m_impl = NULL; -} - -wxRegEx::~wxRegEx() -{ - delete m_impl; -} - -bool wxRegEx::Compile(const wxString& expr, int flags) -{ - if ( !m_impl ) - { - m_impl = new wxRegExImpl; - } - - if ( !m_impl->Compile(expr, flags) ) - { - // error message already given in wxRegExImpl::Compile - delete m_impl; - m_impl = NULL; - - return false; - } - - return true; -} - -bool wxRegEx::Matches(const wxChar *str, int flags, size_t len) const -{ - wxCHECK_MSG( IsValid(), false, _T("must successfully Compile() first") ); - (void)len; - - return m_impl->Matches(WXREGEX_CHAR(str), flags WXREGEX_IF_NEED_LEN(len)); -} - -bool wxRegEx::Matches(const wxChar *str, int flags) const -{ - wxCHECK_MSG( IsValid(), false, _T("must successfully Compile() first") ); - - return m_impl->Matches(WXREGEX_CHAR(str), - flags - WXREGEX_IF_NEED_LEN(wxStrlen(str))); -} - -bool wxRegEx::GetMatch(size_t *start, size_t *len, size_t index) const -{ - wxCHECK_MSG( IsValid(), false, _T("must successfully Compile() first") ); - - return m_impl->GetMatch(start, len, index); -} - -wxString wxRegEx::GetMatch(const wxString& text, size_t index) const -{ - size_t start, len; - if ( !GetMatch(&start, &len, index) ) - return wxEmptyString; - - return text.Mid(start, len); -} - -size_t wxRegEx::GetMatchCount() const -{ - wxCHECK_MSG( IsValid(), 0, _T("must successfully Compile() first") ); - - return m_impl->GetMatchCount(); -} - -int wxRegEx::Replace(wxString *pattern, - const wxString& replacement, - size_t maxMatches) const -{ - wxCHECK_MSG( IsValid(), wxNOT_FOUND, _T("must successfully Compile() first") ); - - return m_impl->Replace(pattern, replacement, maxMatches); -} - -#endif // wxUSE_REGEX diff --git a/wxWidgets/src/common/rendcmn.cpp b/wxWidgets/src/common/rendcmn.cpp deleted file mode 100644 index 702ffb4fa5..0000000000 --- a/wxWidgets/src/common/rendcmn.cpp +++ /dev/null @@ -1,208 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: src/common/rendcmn.cpp -// Purpose: wxRendererNative common functions -// Author: Vadim Zeitlin -// Modified by: -// Created: 28.07.03 -// RCS-ID: $Id: rendcmn.cpp 41216 2006-09-14 16:04:18Z ABX $ -// Copyright: (c) 2003 Vadim Zeitlin -// License: wxWindows license -/////////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#ifndef WX_PRECOMP - #include "wx/app.h" - #include "wx/log.h" - #include "wx/intl.h" -#endif //WX_PRECOMP - -#include "wx/apptrait.h" -#include "wx/renderer.h" - -#include "wx/ptr_scpd.h" - -#if wxUSE_DYNLIB_CLASS - #include "wx/dynlib.h" -#endif // wxUSE_DYNLIB_CLASS - -// ---------------------------------------------------------------------------- -// wxRendererPtr: auto pointer holding the global renderer -// ---------------------------------------------------------------------------- - -wxDECLARE_SCOPED_PTR(wxRendererNative, wxRendererPtrBase) -wxDEFINE_SCOPED_PTR(wxRendererNative, wxRendererPtrBase) - -class wxRendererPtr : public wxRendererPtrBase -{ -public: - // return true if we have a renderer, false otherwise - bool IsOk() - { - if ( !m_initialized ) - { - // only try to create the renderer once - m_initialized = true; - - DoInit(); - } - - return get() != NULL; - } - - // return the global and unique wxRendererPtr - static wxRendererPtr& Get(); - -private: - wxRendererPtr() : wxRendererPtrBase(NULL) { m_initialized = false; } - - void DoInit() - { - wxAppTraits *traits = wxTheApp ? wxTheApp->GetTraits() : NULL; - if ( traits ) - { - // ask the traits object to create a renderer for us - reset(traits->CreateRenderer()); - } - } - - bool m_initialized; - - // just to suppress a gcc warning - friend class wxRendererPtrDummyFriend; - - DECLARE_NO_COPY_CLASS(wxRendererPtr) -}; - -// return the global and unique wxRendererPtr -/*static*/ wxRendererPtr& wxRendererPtr::Get() -{ - static wxRendererPtr s_renderer; - - return s_renderer; -} - -#if wxUSE_DYNLIB_CLASS - -// ---------------------------------------------------------------------------- -// wxRendererFromDynLib: represents a renderer dynamically loaded from a DLL -// ---------------------------------------------------------------------------- - -class wxRendererFromDynLib : public wxDelegateRendererNative -{ -public: - // create the object wrapping the given renderer created from this DLL - // - // we take ownership of the pointer and will delete it (and also unload the - // DLL) when we're deleted - wxRendererFromDynLib(wxDynamicLibrary& dll, wxRendererNative *renderer) - : wxDelegateRendererNative(*renderer), - m_renderer(renderer), - m_dllHandle(dll.Detach()) - { - } - - virtual ~wxRendererFromDynLib() - { - delete m_renderer; - wxDynamicLibrary::Unload(m_dllHandle); - } - -private: - wxRendererNative *m_renderer; - wxDllType m_dllHandle; -}; - -#endif // wxUSE_DYNLIB_CLASS - -// ============================================================================ -// wxRendererNative implementation -// ============================================================================ - -wxRendererNative::~wxRendererNative() -{ - // empty but necessary -} - -// ---------------------------------------------------------------------------- -// Managing the global renderer -// ---------------------------------------------------------------------------- - -/* static */ -wxRendererNative& wxRendererNative::Get() -{ - wxRendererPtr& renderer = wxRendererPtr::Get(); - - return renderer.IsOk() ? *renderer.get() : GetDefault(); -} - -/* static */ -wxRendererNative *wxRendererNative::Set(wxRendererNative *rendererNew) -{ - wxRendererPtr& renderer = wxRendererPtr::Get(); - - wxRendererNative *rendererOld = renderer.release(); - - renderer.reset(rendererNew); - - return rendererOld; -} - - -// ---------------------------------------------------------------------------- -// Dynamic renderers loading -// ---------------------------------------------------------------------------- - -#if wxUSE_DYNLIB_CLASS - -/* static */ -wxRendererNative *wxRendererNative::Load(const wxString& name) -{ - wxString fullname = wxDynamicLibrary::CanonicalizePluginName(name); - - wxDynamicLibrary dll(fullname); - if ( !dll.IsLoaded() ) - return NULL; - - // each theme DLL must export a wxCreateRenderer() function with this - // signature - typedef wxRendererNative *(*wxCreateRenderer_t)(); - - wxDYNLIB_FUNCTION(wxCreateRenderer_t, wxCreateRenderer, dll); - if ( !pfnwxCreateRenderer ) - return NULL; - - // create a renderer object - wxRendererNative *renderer = (*pfnwxCreateRenderer)(); - if ( !renderer ) - return NULL; - - // check that its version is compatible with ours - wxRendererVersion ver = renderer->GetVersion(); - if ( !wxRendererVersion::IsCompatible(ver) ) - { - wxLogError(_("Renderer \"%s\" has incompatible version %d.%d and couldn't be loaded."), - name.c_str(), ver.version, ver.age); - delete renderer; - - return NULL; - } - - // finally wrap the renderer in an object which will delete it and unload - // the library when it is deleted and return it to the caller - return new wxRendererFromDynLib(dll, renderer); -} - -#endif // wxUSE_DYNLIB_CLASS diff --git a/wxWidgets/src/common/rgncmn.cpp b/wxWidgets/src/common/rgncmn.cpp deleted file mode 100644 index 0f9c8b216f..0000000000 --- a/wxWidgets/src/common/rgncmn.cpp +++ /dev/null @@ -1,192 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/common/rgncmn.cpp -// Purpose: Methods of wxRegion that have a generic implementation -// Author: Robin Dunn -// Modified by: -// Created: 27-Mar-2003 -// RCS-ID: $Id: rgncmn.cpp 41901 2006-10-10 17:33:49Z PC $ -// Copyright: (c) Robin Dunn -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declarations -// ============================================================================ - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#include "wx/region.h" - -#ifndef WX_PRECOMP - #include "wx/dcmemory.h" - #include "wx/bitmap.h" - #include "wx/image.h" -#endif //WX_PRECOMP - -// ============================================================================ -// wxRegionBase implementation -// ============================================================================ - -// ---------------------------------------------------------------------------- -// region comparision -// ---------------------------------------------------------------------------- - -bool wxRegionBase::IsEqual(const wxRegion& region) const -{ - if ( m_refData == region.GetRefData() ) - { - // regions are identical, hence equal - return true; - } - - if ( !m_refData || !region.GetRefData() ) - { - // one, but not both, of the regions is invalid - return false; - } - - return DoIsEqual(region); -} - -// ---------------------------------------------------------------------------- -// region to/from bitmap conversions -// ---------------------------------------------------------------------------- - -wxBitmap wxRegionBase::ConvertToBitmap() const -{ - wxRect box = GetBox(); - wxBitmap bmp(box.GetRight(), box.GetBottom()); - wxMemoryDC dc; - dc.SelectObject(bmp); - dc.SetBackground(*wxBLACK_BRUSH); - dc.Clear(); - dc.SetClippingRegion(*wx_static_cast(const wxRegion *, this)); - dc.SetBackground(*wxWHITE_BRUSH); - dc.Clear(); - dc.SelectObject(wxNullBitmap); - return bmp; -} - -#if wxUSE_IMAGE - -static bool DoRegionUnion(wxRegionBase& region, - const wxImage& image, - unsigned char loR, - unsigned char loG, - unsigned char loB, - int tolerance) -{ - unsigned char hiR, hiG, hiB; - - hiR = (unsigned char)wxMin(0xFF, loR + tolerance); - hiG = (unsigned char)wxMin(0xFF, loG + tolerance); - hiB = (unsigned char)wxMin(0xFF, loB + tolerance); - - // Loop through the image row by row, pixel by pixel, building up - // rectangles to add to the region. - int width = image.GetWidth(); - int height = image.GetHeight(); - for (int y=0; y < height; y++) - { - wxRect rect; - rect.y = y; - rect.height = 1; - - for (int x=0; x < width; x++) - { - // search for a continuous range of non-transparent pixels - int x0 = x; - while ( x < width) - { - unsigned char R = image.GetRed(x,y); - unsigned char G = image.GetGreen(x,y); - unsigned char B = image.GetBlue(x,y); - if (( R >= loR && R <= hiR) && - ( G >= loG && G <= hiG) && - ( B >= loB && B <= hiB)) // It's transparent - break; - x++; - } - - // Add the run of non-transparent pixels (if any) to the region - if (x > x0) { - rect.x = x0; - rect.width = x - x0; - region.Union(rect); - } - } - } - - return true; -} - - -bool wxRegionBase::Union(const wxBitmap& bmp) -{ - if (bmp.GetMask()) - { - wxImage image = bmp.ConvertToImage(); - wxASSERT_MSG( image.HasMask(), _T("wxBitmap::ConvertToImage doesn't preserve mask?") ); - return DoRegionUnion(*this, image, - image.GetMaskRed(), - image.GetMaskGreen(), - image.GetMaskBlue(), - 0); - } - else - { - return Union(0, 0, bmp.GetWidth(), bmp.GetHeight()); - } -} - -bool wxRegionBase::Union(const wxBitmap& bmp, - const wxColour& transColour, - int tolerance) -{ - wxImage image = bmp.ConvertToImage(); - return DoRegionUnion(*this, image, - transColour.Red(), - transColour.Green(), - transColour.Blue(), - tolerance); -} - -#endif // wxUSE_IMAGE - -#ifdef wxHAS_REGION_COMBINE -// ============================================================================ -// wxRegionWithCombine -// ============================================================================ - -// implement some wxRegionBase pure virtuals in terms of Combine() -bool wxRegionWithCombine::DoUnionWithRect(const wxRect& rect) -{ - return Combine(rect, wxRGN_OR); -} - -bool wxRegionWithCombine::DoUnionWithRegion(const wxRegion& region) -{ - return DoCombine(region, wxRGN_OR); -} - -bool wxRegionWithCombine::DoIntersect(const wxRegion& region) -{ - return DoCombine(region, wxRGN_AND); -} - -bool wxRegionWithCombine::DoSubtract(const wxRegion& region) -{ - return DoCombine(region, wxRGN_DIFF); -} - -bool wxRegionWithCombine::DoXor(const wxRegion& region) -{ - return DoCombine(region, wxRGN_XOR); -} - -#endif // wxHAS_REGION_COMBINE diff --git a/wxWidgets/src/common/sckaddr.cpp b/wxWidgets/src/common/sckaddr.cpp deleted file mode 100644 index efbe3850ec..0000000000 --- a/wxWidgets/src/common/sckaddr.cpp +++ /dev/null @@ -1,349 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/common/sckaddr.cpp -// Purpose: Network address manager -// Author: Guilhem Lavaux -// Modified by: -// Created: 26/04/97 -// RCS-ID: $Id: sckaddr.cpp 38787 2006-04-18 07:24:35Z ABX $ -// Copyright: (c) 1997, 1998 Guilhem Lavaux -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_SOCKETS - -#ifndef WX_PRECOMP - #include "wx/object.h" - #include "wx/log.h" - #include "wx/intl.h" - - #include - #include - #include - - #if !defined(__MWERKS__) && !defined(__SALFORDC__) - #include - #endif -#endif // !WX_PRECOMP - -#include "wx/gsocket.h" -#include "wx/socket.h" -#include "wx/sckaddr.h" - -IMPLEMENT_ABSTRACT_CLASS(wxSockAddress, wxObject) -IMPLEMENT_ABSTRACT_CLASS(wxIPaddress, wxSockAddress) -IMPLEMENT_DYNAMIC_CLASS(wxIPV4address, wxIPaddress) -#if wxUSE_IPV6 -IMPLEMENT_DYNAMIC_CLASS(wxIPV6address, wxIPaddress) -#endif -#if defined(__UNIX__) && !defined(__WINDOWS__) && !defined(__WINE__) && (!defined(__WXMAC__) || defined(__DARWIN__)) -IMPLEMENT_DYNAMIC_CLASS(wxUNIXaddress, wxSockAddress) -#endif - -// --------------------------------------------------------------------------- -// wxSockAddress -// --------------------------------------------------------------------------- - -void wxSockAddress::Init() -{ - if ( !wxSocketBase::IsInitialized() ) - { - // we must do it before using GAddress_XXX functions - (void)wxSocketBase::Initialize(); - } -} - -wxSockAddress::wxSockAddress() -{ - Init(); - - m_address = GAddress_new(); -} - -wxSockAddress::wxSockAddress(const wxSockAddress& other) - : wxObject() -{ - Init(); - - m_address = GAddress_copy(other.m_address); -} - -wxSockAddress::~wxSockAddress() -{ - GAddress_destroy(m_address); -} - -void wxSockAddress::SetAddress(GAddress *address) -{ - if ( address != m_address ) - { - GAddress_destroy(m_address); - m_address = GAddress_copy(address); - } -} - -wxSockAddress& wxSockAddress::operator=(const wxSockAddress& addr) -{ - SetAddress(addr.GetAddress()); - return *this; -} - -void wxSockAddress::Clear() -{ - GAddress_destroy(m_address); - m_address = GAddress_new(); -} - -// --------------------------------------------------------------------------- -// wxIPaddress -// --------------------------------------------------------------------------- - -wxIPaddress::wxIPaddress() - : wxSockAddress() -{ -} - -wxIPaddress::wxIPaddress(const wxIPaddress& other) - : wxSockAddress(other) -{ -} - -wxIPaddress::~wxIPaddress() -{ -} - -// --------------------------------------------------------------------------- -// wxIPV4address -// --------------------------------------------------------------------------- - -wxIPV4address::wxIPV4address() - : wxIPaddress() -{ -} - -wxIPV4address::wxIPV4address(const wxIPV4address& other) - : wxIPaddress(other) -{ -} - -wxIPV4address::~wxIPV4address() -{ -} - -bool wxIPV4address::Hostname(const wxString& name) -{ - // Some people are sometimes fool. - if (name.empty()) - { - wxLogWarning( _("Trying to solve a NULL hostname: giving up") ); - return false; - } - m_origHostname = name; - return (GAddress_INET_SetHostName(m_address, name.mb_str()) == GSOCK_NOERROR); -} - -bool wxIPV4address::Hostname(unsigned long addr) -{ - bool rv = (GAddress_INET_SetHostAddress(m_address, addr) == GSOCK_NOERROR); - if (rv) - m_origHostname = Hostname(); - else - m_origHostname = wxEmptyString; - return rv; -} - -bool wxIPV4address::Service(const wxString& name) -{ - return (GAddress_INET_SetPortName(m_address, name.mb_str(), "tcp") == GSOCK_NOERROR); -} - -bool wxIPV4address::Service(unsigned short port) -{ - return (GAddress_INET_SetPort(m_address, port) == GSOCK_NOERROR); -} - -bool wxIPV4address::LocalHost() -{ - return (GAddress_INET_SetHostName(m_address, "localhost") == GSOCK_NOERROR); -} - -bool wxIPV4address::IsLocalHost() const -{ - return (Hostname() == wxT("localhost") || IPAddress() == wxT("127.0.0.1")); -} - -bool wxIPV4address::AnyAddress() -{ - return (GAddress_INET_SetAnyAddress(m_address) == GSOCK_NOERROR); -} - -wxString wxIPV4address::Hostname() const -{ - char hostname[1024]; - - hostname[0] = 0; - GAddress_INET_GetHostName(m_address, hostname, 1024); - return wxString::FromAscii(hostname); -} - -unsigned short wxIPV4address::Service() const -{ - return GAddress_INET_GetPort(m_address); -} - -wxSockAddress *wxIPV4address::Clone() const -{ - wxIPV4address *addr = new wxIPV4address(*this); - addr->m_origHostname = m_origHostname; - return addr; -} - -wxString wxIPV4address::IPAddress() const -{ - unsigned long raw = GAddress_INET_GetHostAddress(m_address); - return wxString::Format(_T("%lu.%lu.%lu.%lu"), - (raw>>24) & 0xff, - (raw>>16) & 0xff, - (raw>>8) & 0xff, - raw & 0xff - ); -} - -bool wxIPV4address::operator==(const wxIPV4address& addr) const -{ - return Hostname().Cmp(addr.Hostname().c_str()) == 0 && - Service() == addr.Service(); -} - -#if wxUSE_IPV6 -// --------------------------------------------------------------------------- -// wxIPV6address -// --------------------------------------------------------------------------- - -wxIPV6address::wxIPV6address() - : wxIPaddress() -{ -} - -wxIPV6address::wxIPV6address(const wxIPV6address& other) - : wxIPaddress(other) -{ -} - -wxIPV6address::~wxIPV6address() -{ -} - -bool wxIPV6address::Hostname(const wxString& name) -{ - if (name.empty()) - { - wxLogWarning( _("Trying to solve a NULL hostname: giving up") ); - return false; - } - return (GAddress_INET_SetHostName(m_address, name.mb_str()) == GSOCK_NOERROR); -} - -bool wxIPV6address::Hostname(unsigned char[16] WXUNUSED(addr)) -{ - return true; -} - -bool wxIPV6address::Service(const wxString& name) -{ - return (GAddress_INET_SetPortName(m_address, name.mb_str(), "tcp") == GSOCK_NOERROR); -} - -bool wxIPV6address::Service(unsigned short port) -{ - return (GAddress_INET_SetPort(m_address, port) == GSOCK_NOERROR); -} - -bool wxIPV6address::LocalHost() -{ - return (GAddress_INET_SetHostName(m_address, "localhost") == GSOCK_NOERROR); -} - -bool wxIPV6address::IsLocalHost() const -{ - return (Hostname() == wxT("localhost") || IPAddress() == wxT("127.0.0.1")); -} - -bool wxIPV6address::AnyAddress() -{ - return (GAddress_INET_SetAnyAddress(m_address) == GSOCK_NOERROR); -} - -wxString wxIPV6address::IPAddress() const -{ - unsigned long raw = GAddress_INET_GetHostAddress(m_address); - return wxString::Format( - _T("%u.%u.%u.%u"), - (unsigned char)((raw>>24) & 0xff), - (unsigned char)((raw>>16) & 0xff), - (unsigned char)((raw>>8) & 0xff), - (unsigned char)(raw & 0xff) - ); -} - -wxString wxIPV6address::Hostname() const -{ - char hostname[1024]; - - hostname[0] = 0; - GAddress_INET_GetHostName(m_address, hostname, 1024); - return wxString::FromAscii(hostname); -} - -unsigned short wxIPV6address::Service() const -{ - return GAddress_INET_GetPort(m_address); -} - -#endif // wxUSE_IPV6 - -#if defined(__UNIX__) && !defined(__WINDOWS__) && !defined(__WINE__) && (!defined(__WXMAC__) || defined(__DARWIN__)) - -// --------------------------------------------------------------------------- -// wxUNIXaddress -// --------------------------------------------------------------------------- - -wxUNIXaddress::wxUNIXaddress() - : wxSockAddress() -{ -} - -wxUNIXaddress::wxUNIXaddress(const wxUNIXaddress& other) - : wxSockAddress(other) -{ -} - -wxUNIXaddress::~wxUNIXaddress() -{ -} - -void wxUNIXaddress::Filename(const wxString& fname) -{ - GAddress_UNIX_SetPath(m_address, fname.fn_str()); -} - -wxString wxUNIXaddress::Filename() -{ - char path[1024]; - - path[0] = 0; - GAddress_UNIX_GetPath(m_address, path, 1024); - - return wxString::FromAscii(path); -} - -#endif // __UNIX__ - -#endif - // wxUSE_SOCKETS diff --git a/wxWidgets/src/common/sckfile.cpp b/wxWidgets/src/common/sckfile.cpp deleted file mode 100644 index 87ef23a3bc..0000000000 --- a/wxWidgets/src/common/sckfile.cpp +++ /dev/null @@ -1,57 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/common/sckfile.cpp -// Purpose: File protocol -// Author: Guilhem Lavaux -// Modified by: -// Created: 20/07/97 -// RCS-ID: $Id: sckfile.cpp 43836 2006-12-06 19:20:40Z VZ $ -// Copyright: (c) 1997, 1998 Guilhem Lavaux -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_STREAMS && wxUSE_PROTOCOL_FILE - -#ifndef WX_PRECOMP -#endif - -#include "wx/uri.h" -#include "wx/wfstream.h" -#include "wx/protocol/file.h" - -IMPLEMENT_DYNAMIC_CLASS(wxFileProto, wxProtocol) -IMPLEMENT_PROTOCOL(wxFileProto, wxT("file"), NULL, false) - -wxFileProto::wxFileProto() - : wxProtocol() -{ - m_error = wxPROTO_NOERR; -} - -wxFileProto::~wxFileProto() -{ -} - -wxInputStream *wxFileProto::GetInputStream(const wxString& path) -{ - wxFileInputStream *retval = new wxFileInputStream(wxURI::Unescape(path)); - if ( retval->Ok() ) - { - m_error = wxPROTO_NOERR; - - return retval; - } - - m_error = wxPROTO_NOFILE; - delete retval; - - return NULL; -} - -#endif // wxUSE_STREAMS && wxUSE_PROTOCOL_FILE diff --git a/wxWidgets/src/common/sckipc.cpp b/wxWidgets/src/common/sckipc.cpp deleted file mode 100644 index e170eb6599..0000000000 --- a/wxWidgets/src/common/sckipc.cpp +++ /dev/null @@ -1,769 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/common/sckipc.cpp -// Purpose: Interprocess communication implementation (wxSocket version) -// Author: Julian Smart -// Modified by: Guilhem Lavaux (big rewrite) May 1997, 1998 -// Guillermo Rodriguez (updated for wxSocket v2) Jan 2000 -// (callbacks deprecated) Mar 2000 -// Vadim Zeitlin (added support for Unix sockets) Apr 2002 -// Created: 1993 -// RCS-ID: $Id: sckipc.cpp 41982 2006-10-13 09:00:06Z RR $ -// Copyright: (c) Julian Smart 1993 -// (c) Guilhem Lavaux 1997, 1998 -// (c) 2000 Guillermo Rodriguez -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// ========================================================================== -// declarations -// ========================================================================== - -// -------------------------------------------------------------------------- -// headers -// -------------------------------------------------------------------------- - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_SOCKETS && wxUSE_IPC && wxUSE_STREAMS - -#include "wx/sckipc.h" - -#ifndef WX_PRECOMP - #include "wx/log.h" - #include "wx/event.h" - #include "wx/module.h" -#endif - -#include -#include -#include - -#include "wx/socket.h" - -// -------------------------------------------------------------------------- -// macros and constants -// -------------------------------------------------------------------------- - -// It seems to be already defined somewhere in the Xt includes. -#ifndef __XT__ -// Message codes -enum -{ - IPC_EXECUTE = 1, - IPC_REQUEST, - IPC_POKE, - IPC_ADVISE_START, - IPC_ADVISE_REQUEST, - IPC_ADVISE, - IPC_ADVISE_STOP, - IPC_REQUEST_REPLY, - IPC_FAIL, - IPC_CONNECT, - IPC_DISCONNECT -}; -#endif - -// All sockets will be created with the following flags -#define SCKIPC_FLAGS (wxSOCKET_WAITALL) - -// headers needed for umask() -#ifdef __UNIX_LIKE__ - #include - #include -#endif // __UNIX_LIKE__ - -// ---------------------------------------------------------------------------- -// private functions -// ---------------------------------------------------------------------------- - -// get the address object for the given server name, the caller must delete it -static wxSockAddress * -GetAddressFromName(const wxString& serverName, const wxString& host = wxEmptyString) -{ - // we always use INET sockets under non-Unix systems -#if defined(__UNIX__) && !defined(__WINDOWS__) && !defined(__WINE__) && (!defined(__WXMAC__) || defined(__DARWIN__)) - // under Unix, if the server name looks like a path, create a AF_UNIX - // socket instead of AF_INET one - if ( serverName.Find(_T('/')) != wxNOT_FOUND ) - { - wxUNIXaddress *addr = new wxUNIXaddress; - addr->Filename(serverName); - - return addr; - } -#endif // Unix/!Unix - { - wxIPV4address *addr = new wxIPV4address; - addr->Service(serverName); - if ( !host.empty() ) - { - addr->Hostname(host); - } - - return addr; - } -} - -// -------------------------------------------------------------------------- -// wxTCPEventHandler stuff (private class) -// -------------------------------------------------------------------------- - -class wxTCPEventHandler : public wxEvtHandler -{ -public: - wxTCPEventHandler() : wxEvtHandler() {} - - void Client_OnRequest(wxSocketEvent& event); - void Server_OnRequest(wxSocketEvent& event); - - DECLARE_EVENT_TABLE() - DECLARE_NO_COPY_CLASS(wxTCPEventHandler) -}; - -enum -{ - _CLIENT_ONREQUEST_ID = 1000, - _SERVER_ONREQUEST_ID -}; - -static wxTCPEventHandler *gs_handler = NULL; - -// ========================================================================== -// implementation -// ========================================================================== - -IMPLEMENT_DYNAMIC_CLASS(wxTCPServer, wxServerBase) -IMPLEMENT_DYNAMIC_CLASS(wxTCPClient, wxClientBase) -IMPLEMENT_CLASS(wxTCPConnection, wxConnectionBase) - -// -------------------------------------------------------------------------- -// wxTCPClient -// -------------------------------------------------------------------------- - -wxTCPClient::wxTCPClient () : wxClientBase() -{ -} - -wxTCPClient::~wxTCPClient () -{ -} - -bool wxTCPClient::ValidHost(const wxString& host) -{ - wxIPV4address addr; - - return addr.Hostname(host); -} - -wxConnectionBase *wxTCPClient::MakeConnection (const wxString& host, - const wxString& serverName, - const wxString& topic) -{ - wxSockAddress *addr = GetAddressFromName(serverName, host); - if ( !addr ) - return NULL; - - wxSocketClient *client = new wxSocketClient(SCKIPC_FLAGS); - wxSocketStream *stream = new wxSocketStream(*client); - wxDataInputStream *data_is = new wxDataInputStream(*stream); - wxDataOutputStream *data_os = new wxDataOutputStream(*stream); - - bool ok = client->Connect(*addr); - delete addr; - - if ( ok ) - { - unsigned char msg; - - // Send topic name, and enquire whether this has succeeded - data_os->Write8(IPC_CONNECT); - data_os->WriteString(topic); - - msg = data_is->Read8(); - - // OK! Confirmation. - if (msg == IPC_CONNECT) - { - wxTCPConnection *connection = (wxTCPConnection *)OnMakeConnection (); - - if (connection) - { - if (connection->IsKindOf(CLASSINFO(wxTCPConnection))) - { - connection->m_topic = topic; - connection->m_sock = client; - connection->m_sockstrm = stream; - connection->m_codeci = data_is; - connection->m_codeco = data_os; - client->SetEventHandler(*gs_handler, _CLIENT_ONREQUEST_ID); - client->SetClientData(connection); - client->SetNotify(wxSOCKET_INPUT_FLAG | wxSOCKET_LOST_FLAG); - client->Notify(true); - return connection; - } - else - { - delete connection; - // and fall through to delete everything else - } - } - } - } - - // Something went wrong, delete everything - delete data_is; - delete data_os; - delete stream; - client->Destroy(); - - return NULL; -} - -wxConnectionBase *wxTCPClient::OnMakeConnection() -{ - return new wxTCPConnection(); -} - -// -------------------------------------------------------------------------- -// wxTCPServer -// -------------------------------------------------------------------------- - -wxTCPServer::wxTCPServer () : wxServerBase() -{ - m_server = NULL; -} - -bool wxTCPServer::Create(const wxString& serverName) -{ - // Destroy previous server, if any - if (m_server) - { - m_server->SetClientData(NULL); - m_server->Destroy(); - m_server = NULL; - } - - wxSockAddress *addr = GetAddressFromName(serverName); - if ( !addr ) - return false; - -#ifdef __UNIX_LIKE__ - mode_t umaskOld; - if ( addr->Type() == wxSockAddress::UNIX ) - { - // ensure that the file doesn't exist as otherwise calling socket() would - // fail - int rc = remove(serverName.fn_str()); - if ( rc < 0 && errno != ENOENT ) - { - delete addr; - - return false; - } - - // also set the umask to prevent the others from reading our file - umaskOld = umask(077); - } - else - { - // unused anyhow but shut down the compiler warnings - umaskOld = 0; - } -#endif // __UNIX_LIKE__ - - // Create a socket listening on the specified port - m_server = new wxSocketServer(*addr, SCKIPC_FLAGS); - -#ifdef __UNIX_LIKE__ - if ( addr->Type() == wxSockAddress::UNIX ) - { - // restore the umask - umask(umaskOld); - - // save the file name to remove it later - m_filename = serverName; - } -#endif // __UNIX_LIKE__ - - delete addr; - - if (!m_server->Ok()) - { - m_server->Destroy(); - m_server = NULL; - - return false; - } - - m_server->SetEventHandler(*gs_handler, _SERVER_ONREQUEST_ID); - m_server->SetClientData(this); - m_server->SetNotify(wxSOCKET_CONNECTION_FLAG); - m_server->Notify(true); - - return true; -} - -wxTCPServer::~wxTCPServer() -{ - if (m_server) - { - m_server->SetClientData(NULL); - m_server->Destroy(); - } - -#ifdef __UNIX_LIKE__ - if ( !m_filename.empty() ) - { - if ( remove(m_filename.fn_str()) != 0 ) - { - wxLogDebug(_T("Stale AF_UNIX file '%s' left."), m_filename.c_str()); - } - } -#endif // __UNIX_LIKE__ -} - -wxConnectionBase *wxTCPServer::OnAcceptConnection( const wxString& WXUNUSED(topic) ) -{ - return new wxTCPConnection(); -} - -// -------------------------------------------------------------------------- -// wxTCPConnection -// -------------------------------------------------------------------------- - -wxTCPConnection::wxTCPConnection () : wxConnectionBase() -{ - m_sock = NULL; - m_sockstrm = NULL; - m_codeci = NULL; - m_codeco = NULL; -} - -wxTCPConnection::wxTCPConnection(wxChar *buffer, int size) - : wxConnectionBase(buffer, size) -{ - m_sock = NULL; - m_sockstrm = NULL; - m_codeci = NULL; - m_codeco = NULL; -} - -wxTCPConnection::~wxTCPConnection () -{ - Disconnect(); - - if (m_sock) - { - m_sock->SetClientData(NULL); - m_sock->Destroy(); - } - - /* Delete after destroy */ - wxDELETE(m_codeci); - wxDELETE(m_codeco); - wxDELETE(m_sockstrm); -} - -void wxTCPConnection::Compress(bool WXUNUSED(on)) -{ - // Use wxLZWStream -} - -// Calls that CLIENT can make. -bool wxTCPConnection::Disconnect () -{ - if ( !GetConnected() ) - return true; - // Send the the disconnect message to the peer. - m_codeco->Write8(IPC_DISCONNECT); - m_sock->Notify(false); - m_sock->Close(); - SetConnected(false); - - return true; -} - -bool wxTCPConnection::Execute(const wxChar *data, int size, wxIPCFormat format) -{ - if (!m_sock->IsConnected()) - return false; - - // Prepare EXECUTE message - m_codeco->Write8(IPC_EXECUTE); - m_codeco->Write8(format); - - if (size < 0) - size = (wxStrlen(data) + 1) * sizeof(wxChar); // includes final NUL - - m_codeco->Write32(size); - m_sockstrm->Write(data, size); - - return true; -} - -wxChar *wxTCPConnection::Request (const wxString& item, int *size, wxIPCFormat format) -{ - if (!m_sock->IsConnected()) - return NULL; - - m_codeco->Write8(IPC_REQUEST); - m_codeco->WriteString(item); - m_codeco->Write8(format); - - // If Unpack doesn't initialize it. - int ret; - - ret = m_codeci->Read8(); - if (ret == IPC_FAIL) - return NULL; - else - { - size_t s; - - s = m_codeci->Read32(); - - wxChar *data = GetBufferAtLeast( s ); - wxASSERT_MSG(data != NULL, - _T("Buffer too small in wxTCPConnection::Request") ); - m_sockstrm->Read(data, s); - - if (size) - *size = s; - return data; - } -} - -bool wxTCPConnection::Poke (const wxString& item, wxChar *data, int size, wxIPCFormat format) -{ - if (!m_sock->IsConnected()) - return false; - - m_codeco->Write8(IPC_POKE); - m_codeco->WriteString(item); - m_codeco->Write8(format); - - if (size < 0) - size = (wxStrlen(data) + 1) * sizeof(wxChar); // includes final NUL - - m_codeco->Write32(size); - m_sockstrm->Write(data, size); - - return true; -} - -bool wxTCPConnection::StartAdvise (const wxString& item) -{ - int ret; - - if (!m_sock->IsConnected()) - return false; - - m_codeco->Write8(IPC_ADVISE_START); - m_codeco->WriteString(item); - - ret = m_codeci->Read8(); - - if (ret != IPC_FAIL) - return true; - else - return false; -} - -bool wxTCPConnection::StopAdvise (const wxString& item) -{ - int msg; - - if (!m_sock->IsConnected()) - return false; - - m_codeco->Write8(IPC_ADVISE_STOP); - m_codeco->WriteString(item); - - msg = m_codeci->Read8(); - - if (msg != IPC_FAIL) - return true; - else - return false; -} - -// Calls that SERVER can make -bool wxTCPConnection::Advise (const wxString& item, - wxChar *data, int size, wxIPCFormat format) -{ - if (!m_sock->IsConnected()) - return false; - - m_codeco->Write8(IPC_ADVISE); - m_codeco->WriteString(item); - m_codeco->Write8(format); - - if (size < 0) - size = (wxStrlen(data) + 1) * sizeof(wxChar); // includes final NUL - - m_codeco->Write32(size); - m_sockstrm->Write(data, size); - - return true; -} - -// -------------------------------------------------------------------------- -// wxTCPEventHandler (private class) -// -------------------------------------------------------------------------- - -BEGIN_EVENT_TABLE(wxTCPEventHandler, wxEvtHandler) - EVT_SOCKET(_CLIENT_ONREQUEST_ID, wxTCPEventHandler::Client_OnRequest) - EVT_SOCKET(_SERVER_ONREQUEST_ID, wxTCPEventHandler::Server_OnRequest) -END_EVENT_TABLE() - -void wxTCPEventHandler::Client_OnRequest(wxSocketEvent &event) -{ - wxSocketBase *sock = event.GetSocket(); - if (!sock) { /* No socket, no glory */ - return ; - } - wxSocketNotify evt = event.GetSocketEvent(); - wxTCPConnection *connection = (wxTCPConnection *)(sock->GetClientData()); - - // This socket is being deleted; skip this event - if (!connection) - return; - - wxDataInputStream *codeci; - wxDataOutputStream *codeco; - wxSocketStream *sockstrm; - wxString topic_name = connection->m_topic; - wxString item; - - // We lost the connection: destroy everything - if (evt == wxSOCKET_LOST) - { - sock->Notify(false); - sock->Close(); - connection->OnDisconnect(); - return; - } - - // Receive message number. - codeci = connection->m_codeci; - codeco = connection->m_codeco; - sockstrm = connection->m_sockstrm; - int msg = codeci->Read8(); - - switch (msg) - { - case IPC_EXECUTE: - { - wxChar *data; - size_t size; - wxIPCFormat format; - - format = (wxIPCFormat)codeci->Read8(); - size = codeci->Read32(); - - data = connection->GetBufferAtLeast( size ); - wxASSERT_MSG(data != NULL, - _T("Buffer too small in wxTCPEventHandler::Client_OnRequest") ); - sockstrm->Read(data, size); - - connection->OnExecute (topic_name, data, size, format); - - break; - } - case IPC_ADVISE: - { - wxChar *data; - size_t size; - wxIPCFormat format; - - item = codeci->ReadString(); - format = (wxIPCFormat)codeci->Read8(); - size = codeci->Read32(); - data = connection->GetBufferAtLeast( size ); - wxASSERT_MSG(data != NULL, - _T("Buffer too small in wxTCPEventHandler::Client_OnRequest") ); - sockstrm->Read(data, size); - - connection->OnAdvise (topic_name, item, data, size, format); - - break; - } - case IPC_ADVISE_START: - { - item = codeci->ReadString(); - - bool ok = connection->OnStartAdvise (topic_name, item); - if (ok) - codeco->Write8(IPC_ADVISE_START); - else - codeco->Write8(IPC_FAIL); - - break; - } - case IPC_ADVISE_STOP: - { - item = codeci->ReadString(); - - bool ok = connection->OnStopAdvise (topic_name, item); - if (ok) - codeco->Write8(IPC_ADVISE_STOP); - else - codeco->Write8(IPC_FAIL); - - break; - } - case IPC_POKE: - { - wxIPCFormat format; - size_t size; - wxChar *data; - - item = codeci->ReadString(); - format = (wxIPCFormat)codeci->Read8(); - size = codeci->Read32(); - data = connection->GetBufferAtLeast( size ); - wxASSERT_MSG(data != NULL, - _T("Buffer too small in wxTCPEventHandler::Client_OnRequest") ); - sockstrm->Read(data, size); - - connection->OnPoke (topic_name, item, data, size, format); - - break; - } - case IPC_REQUEST: - { - wxIPCFormat format; - - item = codeci->ReadString(); - format = (wxIPCFormat)codeci->Read8(); - - int user_size = -1; - wxChar *user_data = connection->OnRequest (topic_name, item, &user_size, format); - - if (user_data) - { - codeco->Write8(IPC_REQUEST_REPLY); - - if (user_size == -1) - user_size = (wxStrlen(user_data) + 1) * sizeof(wxChar); // includes final NUL - - codeco->Write32(user_size); - sockstrm->Write(user_data, user_size); - } - else - codeco->Write8(IPC_FAIL); - - break; - } - case IPC_DISCONNECT: - { - sock->Notify(false); - sock->Close(); - connection->SetConnected(false); - connection->OnDisconnect(); - break; - } - default: - codeco->Write8(IPC_FAIL); - break; - } -} - -void wxTCPEventHandler::Server_OnRequest(wxSocketEvent &event) -{ - wxSocketServer *server = (wxSocketServer *) event.GetSocket(); - if (!server) { /* No server, Then exit */ - return ; - } - wxTCPServer *ipcserv = (wxTCPServer *) server->GetClientData(); - - // This socket is being deleted; skip this event - if (!ipcserv) - return; - - if (event.GetSocketEvent() != wxSOCKET_CONNECTION) - return; - - // Accept the connection, getting a new socket - wxSocketBase *sock = server->Accept(); - if (!sock) { /* No socket, no glory */ - return ; - } - if (!sock->Ok()) - { - sock->Destroy(); - return; - } - - wxSocketStream *stream = new wxSocketStream(*sock); - wxDataInputStream *codeci = new wxDataInputStream(*stream); - wxDataOutputStream *codeco = new wxDataOutputStream(*stream); - - int msg; - msg = codeci->Read8(); - - if (msg == IPC_CONNECT) - { - wxString topic_name; - topic_name = codeci->ReadString(); - - wxTCPConnection *new_connection = - (wxTCPConnection *)ipcserv->OnAcceptConnection (topic_name); - - if (new_connection) - { - if (new_connection->IsKindOf(CLASSINFO(wxTCPConnection))) - { - // Acknowledge success - codeco->Write8(IPC_CONNECT); - new_connection->m_topic = topic_name; - new_connection->m_sock = sock; - new_connection->m_sockstrm = stream; - new_connection->m_codeci = codeci; - new_connection->m_codeco = codeco; - sock->SetEventHandler(*gs_handler, _CLIENT_ONREQUEST_ID); - sock->SetClientData(new_connection); - sock->SetNotify(wxSOCKET_INPUT_FLAG | wxSOCKET_LOST_FLAG); - sock->Notify(true); - return; - } - else - { - delete new_connection; - // and fall through to delete everything else - } - } - } - - // Something went wrong, send failure message and delete everything - codeco->Write8(IPC_FAIL); - - delete codeco; - delete codeci; - delete stream; - sock->Destroy(); -} - -// -------------------------------------------------------------------------- -// wxTCPEventHandlerModule (private class) -// -------------------------------------------------------------------------- - -class wxTCPEventHandlerModule: public wxModule -{ - DECLARE_DYNAMIC_CLASS(wxTCPEventHandlerModule) - -public: - bool OnInit() { gs_handler = new wxTCPEventHandler(); return true; } - void OnExit() { wxDELETE(gs_handler); } -}; - -IMPLEMENT_DYNAMIC_CLASS(wxTCPEventHandlerModule, wxModule) - - -#endif - // wxUSE_SOCKETS && wxUSE_IPC && wxUSE_STREAMS diff --git a/wxWidgets/src/common/sckstrm.cpp b/wxWidgets/src/common/sckstrm.cpp deleted file mode 100644 index ae4d847620..0000000000 --- a/wxWidgets/src/common/sckstrm.cpp +++ /dev/null @@ -1,135 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/common/sckstrm.cpp -// Purpose: wxSocket*Stream -// Author: Guilhem Lavaux -// Modified by: -// Created: 17/07/97 -// RCS-ID: $Id: sckstrm.cpp 42897 2006-11-01 10:21:24Z JS $ -// Copyright: (c) -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_SOCKETS && wxUSE_STREAMS - -#include "wx/sckstrm.h" - -#ifndef WX_PRECOMP - #include "wx/stream.h" -#endif - -#include "wx/socket.h" - -// --------------------------------------------------------------------------- -// wxSocketOutputStream -// --------------------------------------------------------------------------- - -wxSocketOutputStream::wxSocketOutputStream(wxSocketBase& s) - : m_o_socket(&s) -{ -} - -wxSocketOutputStream::~wxSocketOutputStream() -{ -} - -size_t wxSocketOutputStream::OnSysWrite(const void *buffer, size_t size) -{ - size_t ret = m_o_socket->Write((const char *)buffer, size).LastCount(); - m_lasterror = m_o_socket->Error() ? wxSTREAM_WRITE_ERROR : wxSTREAM_NO_ERROR; - return ret; - - // Patch 1476893 caused Advise to hang, needs further investigation -#if 0 - const char *buf = (const char *)buffer; - size_t count = 0; - - while ( count < size && m_o_socket->WaitForWrite() ) - { - const size_t ret = m_o_socket->Write(buf, size - count).LastCount(); - - buf += ret; - count += ret; - - if ( m_o_socket->Error() ) - { - if (m_o_socket->LastError() != wxSOCKET_WOULDBLOCK) - { - m_lasterror = wxSTREAM_WRITE_ERROR; - return count; - } - } - } - - m_lasterror = wxSTREAM_NO_ERROR; - return count; -#endif -} - -// --------------------------------------------------------------------------- -// wxSocketInputStream -// --------------------------------------------------------------------------- - -wxSocketInputStream::wxSocketInputStream(wxSocketBase& s) - : m_i_socket(&s) -{ -} - -wxSocketInputStream::~wxSocketInputStream() -{ -} - -size_t wxSocketInputStream::OnSysRead(void *buffer, size_t size) -{ - size_t ret = m_i_socket->Read((char *)buffer, size).LastCount(); - m_lasterror = m_i_socket->Error() ? wxSTREAM_READ_ERROR : wxSTREAM_NO_ERROR; - return ret; - - // Patch 1476893 caused Advise to hang, needs further investigation -#if 0 - char *buf = (char *)buffer; - size_t count = 0; - - while ( count < size && m_i_socket->WaitForRead() ) - { - const size_t ret = m_i_socket->Read(buf, size - count).LastCount(); - - buf += ret; - count += ret; - - if ( m_i_socket->Error() ) - { - if (m_i_socket->LastError() != wxSOCKET_WOULDBLOCK) - { - m_lasterror = wxSTREAM_READ_ERROR; - return count; - } - } - } - - m_lasterror = wxSTREAM_NO_ERROR; - return count; -#endif -} - -// --------------------------------------------------------------------------- -// wxSocketStream -// --------------------------------------------------------------------------- - -wxSocketStream::wxSocketStream(wxSocketBase& s) - : wxSocketInputStream(s), wxSocketOutputStream(s) -{ -} - -wxSocketStream::~wxSocketStream() -{ -} - -#endif - // wxUSE_STREAMS && wxUSE_SOCKETS diff --git a/wxWidgets/src/common/settcmn.cpp b/wxWidgets/src/common/settcmn.cpp deleted file mode 100644 index 334a8f8b8a..0000000000 --- a/wxWidgets/src/common/settcmn.cpp +++ /dev/null @@ -1,88 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/common/settcmn.cpp -// Purpose: common (to all ports) wxWindow functions -// Author: Robert Roebling -// RCS-ID: $Id: settcmn.cpp 39310 2006-05-24 07:16:32Z ABX $ -// Copyright: (c) wxWidgets team -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#include "wx/settings.h" - -#ifndef WX_PRECOMP - #include "wx/utils.h" -#endif //WX_PRECOMP - -// ---------------------------------------------------------------------------- -// static data -// ---------------------------------------------------------------------------- - -wxSystemScreenType wxSystemSettings::ms_screen = wxSYS_SCREEN_NONE; - -// ---------------------------------------------------------------------------- -// ---------------------------------------------------------------------------- - -wxSystemScreenType wxSystemSettings::GetScreenType() -{ - if (ms_screen == wxSYS_SCREEN_NONE) - { - // wxUniv will be used on small devices, too. - int x = GetMetric( wxSYS_SCREEN_X ); - - ms_screen = wxSYS_SCREEN_DESKTOP; - - if (x < 800) - ms_screen = wxSYS_SCREEN_SMALL; - - if (x < 640) - ms_screen = wxSYS_SCREEN_PDA; - - if (x < 200) - ms_screen = wxSYS_SCREEN_TINY; - - // This is probably a bug, but VNC seems to report 0 - if (x < 10) - ms_screen = wxSYS_SCREEN_DESKTOP; - } - - return ms_screen; -} - -void wxSystemSettings::SetScreenType( wxSystemScreenType screen ) -{ - ms_screen = screen; -} - -#if WXWIN_COMPATIBILITY_2_4 - -wxColour wxSystemSettings::GetSystemColour(int index) -{ - return GetColour((wxSystemColour)index); -} - -wxFont wxSystemSettings::GetSystemFont(int index) -{ - return GetFont((wxSystemFont)index); -} - -int wxSystemSettings::GetSystemMetric(int index) -{ - return GetMetric((wxSystemMetric)index); -} - -#endif // WXWIN_COMPATIBILITY_2_4 diff --git a/wxWidgets/src/common/sizer.cpp b/wxWidgets/src/common/sizer.cpp deleted file mode 100644 index 34a649aaa6..0000000000 --- a/wxWidgets/src/common/sizer.cpp +++ /dev/null @@ -1,2265 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/common/sizer.cpp -// Purpose: provide new wxSizer class for layout -// Author: Robert Roebling and Robin Dunn, contributions by -// Dirk Holtwick, Ron Lee -// Modified by: Ron Lee -// Created: -// RCS-ID: $Id: sizer.cpp 66936 2011-02-17 09:52:57Z JS $ -// Copyright: (c) Robin Dunn, Robert Roebling -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#include "wx/display.h" -#include "wx/sizer.h" - -#ifndef WX_PRECOMP - #include "wx/string.h" - #include "wx/intl.h" - #include "wx/math.h" - #include "wx/utils.h" - #include "wx/settings.h" - #include "wx/button.h" - #include "wx/statbox.h" - #include "wx/toplevel.h" -#endif // WX_PRECOMP - -#include "wx/listimpl.cpp" - -#if WXWIN_COMPATIBILITY_2_4 - #include "wx/notebook.h" -#endif - -//--------------------------------------------------------------------------- - -IMPLEMENT_CLASS(wxSizerItem, wxObject) -IMPLEMENT_CLASS(wxSizer, wxObject) -IMPLEMENT_CLASS(wxGridSizer, wxSizer) -IMPLEMENT_CLASS(wxFlexGridSizer, wxGridSizer) -IMPLEMENT_CLASS(wxBoxSizer, wxSizer) -#if wxUSE_STATBOX -IMPLEMENT_CLASS(wxStaticBoxSizer, wxBoxSizer) -#endif -#if wxUSE_BUTTON -IMPLEMENT_CLASS(wxStdDialogButtonSizer, wxBoxSizer) -#endif - -WX_DEFINE_EXPORTED_LIST( wxSizerItemList ) - -/* - TODO PROPERTIES - sizeritem - object - object_ref - minsize - option - flag - border - spacer - option - flag - borfder - boxsizer - orient - staticboxsizer - orient - label - gridsizer - rows - cols - vgap - hgap - flexgridsizer - rows - cols - vgap - hgap - growablerows - growablecols - minsize -*/ - - -// ---------------------------------------------------------------------------- -// wxSizerFlags -// ---------------------------------------------------------------------------- - -wxSizerFlags& wxSizerFlags::ReserveSpaceEvenIfHidden() -{ - m_flags |= wxRESERVE_SPACE_EVEN_IF_HIDDEN; - return *this; -} - -// ---------------------------------------------------------------------------- -// wxSizerItem -// ---------------------------------------------------------------------------- - -void wxSizerItem::Init(const wxSizerFlags& flags) -{ - Init(); - - m_proportion = flags.GetProportion(); - m_flag = flags.GetFlags(); - m_border = flags.GetBorderInPixels(); -} - -wxSizerItem::wxSizerItem() -{ - Init(); - - m_proportion = 0; - m_border = 0; - m_flag = 0; - - m_kind = Item_None; -} - -// window item -void wxSizerItem::SetWindow(wxWindow *window) -{ - wxCHECK_RET( window, _T("NULL window in wxSizerItem::SetWindow()") ); - - m_kind = Item_Window; - m_window = window; - - // window doesn't become smaller than its initial size, whatever happens - m_minSize = window->GetSize(); - - if ( m_flag & wxFIXED_MINSIZE ) - window->SetMinSize(m_minSize); - - // aspect ratio calculated from initial size - SetRatio(m_minSize); -} - -wxSizerItem::wxSizerItem(wxWindow *window, - int proportion, - int flag, - int border, - wxObject* userData) - : m_proportion(proportion), - m_border(border), - m_flag(flag), - m_userData(userData) -{ - SetWindow(window); -} - -// sizer item -void wxSizerItem::SetSizer(wxSizer *sizer) -{ - m_kind = Item_Sizer; - m_sizer = sizer; -} - -wxSizerItem::wxSizerItem(wxSizer *sizer, - int proportion, - int flag, - int border, - wxObject* userData) - : m_proportion(proportion), - m_border(border), - m_flag(flag), - m_ratio(0.0), - m_userData(userData) -{ - SetSizer(sizer); - - // m_minSize is set later -} - -// spacer item -void wxSizerItem::SetSpacer(const wxSize& size) -{ - m_kind = Item_Spacer; - m_spacer = new wxSizerSpacer(size); - m_minSize = size; - SetRatio(size); -} - -wxSizerItem::wxSizerItem(int width, - int height, - int proportion, - int flag, - int border, - wxObject* userData) - : m_minSize(width, height), // minimal size is the initial size - m_proportion(proportion), - m_border(border), - m_flag(flag), - m_userData(userData) -{ - SetSpacer(width, height); -} - -wxSizerItem::~wxSizerItem() -{ - delete m_userData; - - switch ( m_kind ) - { - case Item_None: - break; - - case Item_Window: - m_window->SetContainingSizer(NULL); - break; - - case Item_Sizer: - delete m_sizer; - break; - - case Item_Spacer: - delete m_spacer; - break; - - case Item_Max: - default: - wxFAIL_MSG( _T("unexpected wxSizerItem::m_kind") ); - } -} - -wxSize wxSizerItem::GetSpacer() const -{ - wxSize size; - if ( m_kind == Item_Spacer ) - size = m_spacer->GetSize(); - - return size; -} - - -wxSize wxSizerItem::GetSize() const -{ - wxSize ret; - switch ( m_kind ) - { - case Item_None: - break; - - case Item_Window: - ret = m_window->GetSize(); - break; - - case Item_Sizer: - ret = m_sizer->GetSize(); - break; - - case Item_Spacer: - ret = m_spacer->GetSize(); - break; - - case Item_Max: - default: - wxFAIL_MSG( _T("unexpected wxSizerItem::m_kind") ); - } - - if (m_flag & wxWEST) - ret.x += m_border; - if (m_flag & wxEAST) - ret.x += m_border; - if (m_flag & wxNORTH) - ret.y += m_border; - if (m_flag & wxSOUTH) - ret.y += m_border; - - return ret; -} - -wxSize wxSizerItem::CalcMin() -{ - if (IsSizer()) - { - m_minSize = m_sizer->GetMinSize(); - - // if we have to preserve aspect ratio _AND_ this is - // the first-time calculation, consider ret to be initial size - if ( (m_flag & wxSHAPED) && wxIsNullDouble(m_ratio) ) - SetRatio(m_minSize); - } - else if ( IsWindow() ) - { - // Since the size of the window may change during runtime, we - // should use the current minimal/best size. - m_minSize = m_window->GetEffectiveMinSize(); - } - - return GetMinSizeWithBorder(); -} - -wxSize wxSizerItem::GetMinSizeWithBorder() const -{ - wxSize ret = m_minSize; - - if (m_flag & wxWEST) - ret.x += m_border; - if (m_flag & wxEAST) - ret.x += m_border; - if (m_flag & wxNORTH) - ret.y += m_border; - if (m_flag & wxSOUTH) - ret.y += m_border; - - return ret; -} - - -void wxSizerItem::SetDimension( const wxPoint& pos_, const wxSize& size_ ) -{ - wxPoint pos = pos_; - wxSize size = size_; - if (m_flag & wxSHAPED) - { - // adjust aspect ratio - int rwidth = (int) (size.y * m_ratio); - if (rwidth > size.x) - { - // fit horizontally - int rheight = (int) (size.x / m_ratio); - // add vertical space - if (m_flag & wxALIGN_CENTER_VERTICAL) - pos.y += (size.y - rheight) / 2; - else if (m_flag & wxALIGN_BOTTOM) - pos.y += (size.y - rheight); - // use reduced dimensions - size.y =rheight; - } - else if (rwidth < size.x) - { - // add horizontal space - if (m_flag & wxALIGN_CENTER_HORIZONTAL) - pos.x += (size.x - rwidth) / 2; - else if (m_flag & wxALIGN_RIGHT) - pos.x += (size.x - rwidth); - size.x = rwidth; - } - } - - // This is what GetPosition() returns. Since we calculate - // borders afterwards, GetPosition() will be the left/top - // corner of the surrounding border. - m_pos = pos; - - if (m_flag & wxWEST) - { - pos.x += m_border; - size.x -= m_border; - } - if (m_flag & wxEAST) - { - size.x -= m_border; - } - if (m_flag & wxNORTH) - { - pos.y += m_border; - size.y -= m_border; - } - if (m_flag & wxSOUTH) - { - size.y -= m_border; - } - - if (size.x < 0) - size.x = 0; - if (size.y < 0) - size.y = 0; - - m_rect = wxRect(pos, size); - - switch ( m_kind ) - { - case Item_None: - wxFAIL_MSG( _T("can't set size of uninitialized sizer item") ); - break; - - case Item_Window: - m_window->SetSize(pos.x, pos.y, size.x, size.y, - wxSIZE_ALLOW_MINUS_ONE); - break; - - case Item_Sizer: - m_sizer->SetDimension(pos.x, pos.y, size.x, size.y); - break; - - case Item_Spacer: - m_spacer->SetSize(size); - break; - - case Item_Max: - default: - wxFAIL_MSG( _T("unexpected wxSizerItem::m_kind") ); - } -} - -void wxSizerItem::DeleteWindows() -{ - switch ( m_kind ) - { - case Item_None: - case Item_Spacer: - break; - - case Item_Window: - //We are deleting the window from this sizer - normally - //the window destroys the sizer associated with it, - //which might destroy this, which we don't want - m_window->SetContainingSizer(NULL); - m_window->Destroy(); - //Putting this after the switch will result in a spacer - //not being deleted properly on destruction - m_kind = Item_None; - break; - - case Item_Sizer: - m_sizer->DeleteWindows(); - break; - - case Item_Max: - default: - wxFAIL_MSG( _T("unexpected wxSizerItem::m_kind") ); - } - -} - -void wxSizerItem::Show( bool show ) -{ - switch ( m_kind ) - { - case Item_None: - wxFAIL_MSG( _T("can't show uninitialized sizer item") ); - break; - - case Item_Window: - m_window->Show(show); - break; - - case Item_Sizer: - m_sizer->Show(show); - break; - - case Item_Spacer: - m_spacer->Show(show); - break; - - case Item_Max: - default: - wxFAIL_MSG( _T("unexpected wxSizerItem::m_kind") ); - } -} - -bool wxSizerItem::IsShown() const -{ - switch ( m_kind ) - { - case Item_None: - // we may be called from CalcMin(), just return false so that we're - // not used - break; - - case Item_Window: - return m_window->IsShown(); - - case Item_Sizer: - // arbitrarily decide that if at least one of our elements is - // shown, so are we (this arbitrariness is the reason for - // deprecating this function) - { - // Some apps (such as dialog editors) depend on an empty sizer still - // being laid out correctly and reporting the correct size and position. - if (m_sizer->GetChildren().GetCount() == 0) - return true; - - for ( wxSizerItemList::compatibility_iterator - node = m_sizer->GetChildren().GetFirst(); - node; - node = node->GetNext() ) - { - if ( node->GetData()->IsShown() ) - return true; - } - } - return false; - - case Item_Spacer: - return m_spacer->IsShown(); - - case Item_Max: - default: - wxFAIL_MSG( _T("unexpected wxSizerItem::m_kind") ); - } - - return false; -} - -// This is a helper to support wxRESERVE_SPACE_EVEN_IF_HIDDEN. In wx 2.9+, -// this flag is respected by IsShown(), but not in wx 2.8. -bool wxSizerItem::ShouldAccountFor() const -{ - if ( m_flag & wxRESERVE_SPACE_EVEN_IF_HIDDEN ) - return true; - - if ( IsSizer() ) - { - // this mirrors wxSizerItem::IsShown() code above - const wxSizerItemList& children = m_sizer->GetChildren(); - if ( children.GetCount() == 0 ) - return true; - - for ( wxSizerItemList::compatibility_iterator - node = children.GetFirst(); - node; - node = node->GetNext() ) - { - if ( node->GetData()->ShouldAccountFor() ) - return true; - } - return false; - } - else - { - return IsShown(); - } -} - - -#if WXWIN_COMPATIBILITY_2_6 -void wxSizerItem::SetOption( int option ) -{ - SetProportion( option ); -} - -int wxSizerItem::GetOption() const -{ - return GetProportion(); -} -#endif // WXWIN_COMPATIBILITY_2_6 - - -//--------------------------------------------------------------------------- -// wxSizer -//--------------------------------------------------------------------------- - -wxSizer::~wxSizer() -{ - WX_CLEAR_LIST(wxSizerItemList, m_children); -} - -wxSizerItem* wxSizer::Insert( size_t index, wxSizerItem *item ) -{ - m_children.Insert( index, item ); - - if ( item->GetWindow() ) - item->GetWindow()->SetContainingSizer( this ); - - if ( item->GetSizer() ) - item->GetSizer()->SetContainingWindow( m_containingWindow ); - - return item; -} - -void wxSizer::SetContainingWindow(wxWindow *win) -{ - if ( win == m_containingWindow ) - return; - - m_containingWindow = win; - - // set the same window for all nested sizers as well, they also are in the - // same window - for ( wxSizerItemList::compatibility_iterator node = m_children.GetFirst(); - node; - node = node->GetNext() ) - { - wxSizerItem *const item = node->GetData(); - wxSizer *const sizer = item->GetSizer(); - - if ( sizer ) - { - sizer->SetContainingWindow(win); - } - } -} - -#if WXWIN_COMPATIBILITY_2_6 -bool wxSizer::Remove( wxWindow *window ) -{ - return Detach( window ); -} -#endif // WXWIN_COMPATIBILITY_2_6 - -bool wxSizer::Remove( wxSizer *sizer ) -{ - wxASSERT_MSG( sizer, _T("Removing NULL sizer") ); - - wxSizerItemList::compatibility_iterator node = m_children.GetFirst(); - while (node) - { - wxSizerItem *item = node->GetData(); - - if (item->GetSizer() == sizer) - { - delete item; - m_children.Erase( node ); - return true; - } - - node = node->GetNext(); - } - - return false; -} - -bool wxSizer::Remove( int index ) -{ - wxCHECK_MSG( index >= 0 && (size_t)index < m_children.GetCount(), - false, - _T("Remove index is out of range") ); - - wxSizerItemList::compatibility_iterator node = m_children.Item( index ); - - wxCHECK_MSG( node, false, _T("Failed to find child node") ); - - wxSizerItem *item = node->GetData(); - - if ( item->IsWindow() ) - item->GetWindow()->SetContainingSizer( NULL ); - - delete item; - m_children.Erase( node ); - return true; -} - -bool wxSizer::Detach( wxSizer *sizer ) -{ - wxASSERT_MSG( sizer, _T("Detaching NULL sizer") ); - - wxSizerItemList::compatibility_iterator node = m_children.GetFirst(); - while (node) - { - wxSizerItem *item = node->GetData(); - - if (item->GetSizer() == sizer) - { - item->DetachSizer(); - delete item; - m_children.Erase( node ); - return true; - } - node = node->GetNext(); - } - - return false; -} - -bool wxSizer::Detach( wxWindow *window ) -{ - wxASSERT_MSG( window, _T("Detaching NULL window") ); - - wxSizerItemList::compatibility_iterator node = m_children.GetFirst(); - while (node) - { - wxSizerItem *item = node->GetData(); - - if (item->GetWindow() == window) - { - item->GetWindow()->SetContainingSizer( NULL ); - delete item; - m_children.Erase( node ); - return true; - } - node = node->GetNext(); - } - - return false; -} - -bool wxSizer::Detach( int index ) -{ - wxCHECK_MSG( index >= 0 && (size_t)index < m_children.GetCount(), - false, - _T("Detach index is out of range") ); - - wxSizerItemList::compatibility_iterator node = m_children.Item( index ); - - wxCHECK_MSG( node, false, _T("Failed to find child node") ); - - wxSizerItem *item = node->GetData(); - - if ( item->IsSizer() ) - item->DetachSizer(); - else if ( item->IsWindow() ) - item->GetWindow()->SetContainingSizer( NULL ); - - delete item; - m_children.Erase( node ); - return true; -} - -bool wxSizer::Replace( wxWindow *oldwin, wxWindow *newwin, bool recursive ) -{ - wxASSERT_MSG( oldwin, _T("Replacing NULL window") ); - wxASSERT_MSG( newwin, _T("Replacing with NULL window") ); - - wxSizerItemList::compatibility_iterator node = m_children.GetFirst(); - while (node) - { - wxSizerItem *item = node->GetData(); - - if (item->GetWindow() == oldwin) - { - item->GetWindow()->SetContainingSizer( NULL ); - item->SetWindow(newwin); - newwin->SetContainingSizer( this ); - return true; - } - else if (recursive && item->IsSizer()) - { - if (item->GetSizer()->Replace( oldwin, newwin, true )) - return true; - } - - node = node->GetNext(); - } - - return false; -} - -bool wxSizer::Replace( wxSizer *oldsz, wxSizer *newsz, bool recursive ) -{ - wxASSERT_MSG( oldsz, _T("Replacing NULL sizer") ); - wxASSERT_MSG( newsz, _T("Replacing with NULL sizer") ); - - wxSizerItemList::compatibility_iterator node = m_children.GetFirst(); - while (node) - { - wxSizerItem *item = node->GetData(); - - if (item->GetSizer() == oldsz) - { - wxSizer *old = item->GetSizer(); - item->SetSizer(newsz); - delete old; - return true; - } - else if (recursive && item->IsSizer()) - { - if (item->GetSizer()->Replace( oldsz, newsz, true )) - return true; - } - - node = node->GetNext(); - } - - return false; -} - -bool wxSizer::Replace( size_t old, wxSizerItem *newitem ) -{ - wxCHECK_MSG( old < m_children.GetCount(), false, _T("Replace index is out of range") ); - wxASSERT_MSG( newitem, _T("Replacing with NULL item") ); - - wxSizerItemList::compatibility_iterator node = m_children.Item( old ); - - wxCHECK_MSG( node, false, _T("Failed to find child node") ); - - wxSizerItem *item = node->GetData(); - node->SetData(newitem); - - if (item->IsWindow() && item->GetWindow()) - item->GetWindow()->SetContainingSizer(NULL); - - delete item; - - return true; -} - -void wxSizer::Clear( bool delete_windows ) -{ - // First clear the ContainingSizer pointers - wxSizerItemList::compatibility_iterator node = m_children.GetFirst(); - while (node) - { - wxSizerItem *item = node->GetData(); - - if (item->IsWindow()) - item->GetWindow()->SetContainingSizer( NULL ); - node = node->GetNext(); - } - - // Destroy the windows if needed - if (delete_windows) - DeleteWindows(); - - // Now empty the list - WX_CLEAR_LIST(wxSizerItemList, m_children); -} - -void wxSizer::DeleteWindows() -{ - wxSizerItemList::compatibility_iterator node = m_children.GetFirst(); - while (node) - { - wxSizerItem *item = node->GetData(); - - item->DeleteWindows(); - node = node->GetNext(); - } -} - -wxSize wxSizer::ComputeFittingWindowSize(wxWindow *window) -{ - // take the min size by default and limit it by max size - wxSize size = GetMinWindowSize(window); - wxSize sizeMax = GetMaxWindowSize(window); - - wxTopLevelWindow *tlw = wxDynamicCast(window, wxTopLevelWindow); - if ( tlw ) - { - // hack for small screen devices where TLWs are always full screen - if ( tlw->IsAlwaysMaximized() ) - { - size = tlw->GetSize(); - } - else // normal situation - { - // limit the window to the size of the display it is on - int disp = wxDisplay::GetFromWindow(window); - if ( disp == wxNOT_FOUND ) - { - // or, if we don't know which one it is, of the main one - disp = 0; - } - - sizeMax = wxDisplay(disp).GetClientArea().GetSize(); - } - } - - if ( sizeMax.x != wxDefaultCoord && size.x > sizeMax.x ) - size.x = sizeMax.x; - if ( sizeMax.y != wxDefaultCoord && size.y > sizeMax.y ) - size.y = sizeMax.y; - - return size; -} - -wxSize wxSizer::ComputeFittingClientSize(wxWindow *window) -{ - wxCHECK_MSG( window, wxDefaultSize, _T("window can't be NULL") ); - - return window->WindowToClientSize(ComputeFittingWindowSize(window)); -} - -wxSize wxSizer::Fit( wxWindow *window ) -{ - wxSize size = ComputeFittingWindowSize(window); - window->SetSize(size); - return size; -} - -void wxSizer::FitInside( wxWindow *window ) -{ - wxSize size; - if (window->IsTopLevel()) - size = VirtualFitSize( window ); - else - size = GetMinClientSize( window ); - - window->SetVirtualSize( size ); -} - -void wxSizer::Layout() -{ - // (re)calculates minimums needed for each item and other preparations - // for layout - CalcMin(); - - // Applies the layout and repositions/resizes the items - RecalcSizes(); -} - -void wxSizer::SetSizeHints( wxWindow *window ) -{ - // Preserve the window's max size hints, but set the - // lower bound according to the sizer calculations. - - // This is equivalent to calling Fit(), except that we need to set - // the size hints _in between_ the two steps performed by Fit - // (1. ComputeFittingWindowSize, 2. SetSize). That's because - // otherwise SetSize() could have no effect if there already are - // size hints in effect that forbid requested size. - const wxSize size = ComputeFittingWindowSize(window); - - window->SetSizeHints( size.x, - size.y, - window->GetMaxWidth(), - window->GetMaxHeight() ); - - window->SetSize(size); -} - -void wxSizer::SetVirtualSizeHints( wxWindow *window ) -{ - // Preserve the window's max size hints, but set the - // lower bound according to the sizer calculations. - - FitInside( window ); - wxSize size( window->GetVirtualSize() ); - window->SetVirtualSizeHints( size.x, - size.y, - window->GetMaxWidth(), - window->GetMaxHeight() ); -} - -wxSize wxSizer::GetMaxWindowSize( wxWindow *window ) const -{ - return window->GetMaxSize(); -} - -wxSize wxSizer::GetMinWindowSize( wxWindow *window ) -{ - wxSize minSize( GetMinSize() ); - wxSize size( window->GetSize() ); - wxSize client_size( window->GetClientSize() ); - - return wxSize( minSize.x+size.x-client_size.x, - minSize.y+size.y-client_size.y ); -} - -// TODO on mac we need a function that determines how much free space this -// min size contains, in order to make sure that we have 20 pixels of free -// space around the controls -wxSize wxSizer::GetMaxClientSize( wxWindow *window ) const -{ - wxSize maxSize( window->GetMaxSize() ); - - if ( maxSize != wxDefaultSize ) - { - wxSize size( window->GetSize() ); - wxSize client_size( window->GetClientSize() ); - - return wxSize( maxSize.x + client_size.x - size.x, - maxSize.y + client_size.y - size.y ); - } - else - return wxDefaultSize; -} - -wxSize wxSizer::GetMinClientSize( wxWindow *WXUNUSED(window) ) -{ - return GetMinSize(); // Already returns client size. -} - -wxSize wxSizer::VirtualFitSize( wxWindow *window ) -{ - wxSize size = GetMinClientSize( window ); - wxSize sizeMax = GetMaxClientSize( window ); - - // Limit the size if sizeMax != wxDefaultSize - - if ( size.x > sizeMax.x && sizeMax.x != wxDefaultCoord ) - size.x = sizeMax.x; - if ( size.y > sizeMax.y && sizeMax.y != wxDefaultCoord ) - size.y = sizeMax.y; - - return size; -} - -void wxSizer::SetDimension( int x, int y, int width, int height ) -{ - m_position.x = x; - m_position.y = y; - m_size.x = width; - m_size.y = height; - Layout(); -} - -wxSize wxSizer::GetMinSize() -{ - wxSize ret( CalcMin() ); - if (ret.x < m_minSize.x) ret.x = m_minSize.x; - if (ret.y < m_minSize.y) ret.y = m_minSize.y; - return ret; -} - -void wxSizer::DoSetMinSize( int width, int height ) -{ - m_minSize.x = width; - m_minSize.y = height; -} - -bool wxSizer::DoSetItemMinSize( wxWindow *window, int width, int height ) -{ - wxASSERT_MSG( window, _T("SetMinSize for NULL window") ); - - // Is it our immediate child? - - wxSizerItemList::compatibility_iterator node = m_children.GetFirst(); - while (node) - { - wxSizerItem *item = node->GetData(); - - if (item->GetWindow() == window) - { - item->SetMinSize( width, height ); - return true; - } - node = node->GetNext(); - } - - // No? Search any subsizers we own then - - node = m_children.GetFirst(); - while (node) - { - wxSizerItem *item = node->GetData(); - - if ( item->GetSizer() && - item->GetSizer()->DoSetItemMinSize( window, width, height ) ) - { - // A child sizer found the requested windw, exit. - return true; - } - node = node->GetNext(); - } - - return false; -} - -bool wxSizer::DoSetItemMinSize( wxSizer *sizer, int width, int height ) -{ - wxASSERT_MSG( sizer, _T("SetMinSize for NULL sizer") ); - - // Is it our immediate child? - - wxSizerItemList::compatibility_iterator node = m_children.GetFirst(); - while (node) - { - wxSizerItem *item = node->GetData(); - - if (item->GetSizer() == sizer) - { - item->GetSizer()->DoSetMinSize( width, height ); - return true; - } - node = node->GetNext(); - } - - // No? Search any subsizers we own then - - node = m_children.GetFirst(); - while (node) - { - wxSizerItem *item = node->GetData(); - - if ( item->GetSizer() && - item->GetSizer()->DoSetItemMinSize( sizer, width, height ) ) - { - // A child found the requested sizer, exit. - return true; - } - node = node->GetNext(); - } - - return false; -} - -bool wxSizer::DoSetItemMinSize( size_t index, int width, int height ) -{ - wxSizerItemList::compatibility_iterator node = m_children.Item( index ); - - wxCHECK_MSG( node, false, _T("Failed to find child node") ); - - wxSizerItem *item = node->GetData(); - - if (item->GetSizer()) - { - // Sizers contains the minimal size in them, if not calculated ... - item->GetSizer()->DoSetMinSize( width, height ); - } - else - { - // ... but the minimal size of spacers and windows is stored via the item - item->SetMinSize( width, height ); - } - - return true; -} - -wxSizerItem* wxSizer::GetItem( wxWindow *window, bool recursive ) -{ - wxASSERT_MSG( window, _T("GetItem for NULL window") ); - - wxSizerItemList::compatibility_iterator node = m_children.GetFirst(); - while (node) - { - wxSizerItem *item = node->GetData(); - - if (item->GetWindow() == window) - { - return item; - } - else if (recursive && item->IsSizer()) - { - wxSizerItem *subitem = item->GetSizer()->GetItem( window, true ); - if (subitem) - return subitem; - } - - node = node->GetNext(); - } - - return NULL; -} - -wxSizerItem* wxSizer::GetItem( wxSizer *sizer, bool recursive ) -{ - wxASSERT_MSG( sizer, _T("GetItem for NULL sizer") ); - - wxSizerItemList::compatibility_iterator node = m_children.GetFirst(); - while (node) - { - wxSizerItem *item = node->GetData(); - - if (item->GetSizer() == sizer) - { - return item; - } - else if (recursive && item->IsSizer()) - { - wxSizerItem *subitem = item->GetSizer()->GetItem( sizer, true ); - if (subitem) - return subitem; - } - - node = node->GetNext(); - } - - return NULL; -} - -wxSizerItem* wxSizer::GetItem( size_t index ) -{ - wxCHECK_MSG( index < m_children.GetCount(), - NULL, - _T("GetItem index is out of range") ); - - return m_children.Item( index )->GetData(); -} - -bool wxSizer::Show( wxWindow *window, bool show, bool recursive ) -{ - wxSizerItem *item = GetItem( window, recursive ); - - if ( item ) - { - item->Show( show ); - return true; - } - - return false; -} - -bool wxSizer::Show( wxSizer *sizer, bool show, bool recursive ) -{ - wxSizerItem *item = GetItem( sizer, recursive ); - - if ( item ) - { - item->Show( show ); - return true; - } - - return false; -} - -bool wxSizer::Show( size_t index, bool show) -{ - wxSizerItem *item = GetItem( index ); - - if ( item ) - { - item->Show( show ); - return true; - } - - return false; -} - -void wxSizer::ShowItems( bool show ) -{ - wxSizerItemList::compatibility_iterator node = m_children.GetFirst(); - while (node) - { - node->GetData()->Show( show ); - node = node->GetNext(); - } -} - -bool wxSizer::IsShown( wxWindow *window ) const -{ - wxSizerItemList::compatibility_iterator node = m_children.GetFirst(); - while (node) - { - wxSizerItem *item = node->GetData(); - - if (item->GetWindow() == window) - { - return item->IsShown(); - } - node = node->GetNext(); - } - - wxFAIL_MSG( _T("IsShown failed to find sizer item") ); - - return false; -} - -bool wxSizer::IsShown( wxSizer *sizer ) const -{ - wxSizerItemList::compatibility_iterator node = m_children.GetFirst(); - while (node) - { - wxSizerItem *item = node->GetData(); - - if (item->GetSizer() == sizer) - { - return item->IsShown(); - } - node = node->GetNext(); - } - - wxFAIL_MSG( _T("IsShown failed to find sizer item") ); - - return false; -} - -bool wxSizer::IsShown( size_t index ) const -{ - wxCHECK_MSG( index < m_children.GetCount(), - false, - _T("IsShown index is out of range") ); - - return m_children.Item( index )->GetData()->IsShown(); -} - - -//--------------------------------------------------------------------------- -// wxGridSizer -//--------------------------------------------------------------------------- - -wxGridSizer::wxGridSizer( int rows, int cols, int vgap, int hgap ) - : m_rows( ( cols == 0 && rows == 0 ) ? 1 : rows ) - , m_cols( cols ) - , m_vgap( vgap ) - , m_hgap( hgap ) -{ -} - -wxGridSizer::wxGridSizer( int cols, int vgap, int hgap ) - : m_rows( cols == 0 ? 1 : 0 ) - , m_cols( cols ) - , m_vgap( vgap ) - , m_hgap( hgap ) -{ -} - -int wxGridSizer::CalcRowsCols(int& nrows, int& ncols) const -{ - int nitems = m_children.GetCount(); - if ( nitems) - { - if ( m_cols ) - { - ncols = m_cols; - nrows = (nitems + m_cols - 1) / m_cols; - } - else if ( m_rows ) - { - ncols = (nitems + m_rows - 1) / m_rows; - nrows = m_rows; - } - else // 0 columns, 0 rows? - { - wxFAIL_MSG( _T("grid sizer must have either rows or columns fixed") ); - - nrows = ncols = 0; - } - } - - return nitems; -} - -void wxGridSizer::RecalcSizes() -{ - int nitems, nrows, ncols; - if ( (nitems = CalcRowsCols(nrows, ncols)) == 0 ) - return; - - wxSize sz( GetSize() ); - wxPoint pt( GetPosition() ); - - int w = (sz.x - (ncols - 1) * m_hgap) / ncols; - int h = (sz.y - (nrows - 1) * m_vgap) / nrows; - - int x = pt.x; - for (int c = 0; c < ncols; c++) - { - int y = pt.y; - for (int r = 0; r < nrows; r++) - { - int i = r * ncols + c; - if (i < nitems) - { - wxSizerItemList::compatibility_iterator node = m_children.Item( i ); - - wxASSERT_MSG( node, _T("Failed to find SizerItemList node") ); - - SetItemBounds( node->GetData(), x, y, w, h); - } - y = y + h + m_vgap; - } - x = x + w + m_hgap; - } -} - -wxSize wxGridSizer::CalcMin() -{ - int nrows, ncols; - if ( CalcRowsCols(nrows, ncols) == 0 ) - return wxSize(); - - // Find the max width and height for any component - int w = 0; - int h = 0; - - wxSizerItemList::compatibility_iterator node = m_children.GetFirst(); - while (node) - { - wxSizerItem *item = node->GetData(); - wxSize sz( item->CalcMin() ); - - w = wxMax( w, sz.x ); - h = wxMax( h, sz.y ); - - node = node->GetNext(); - } - - return wxSize( ncols * w + (ncols-1) * m_hgap, - nrows * h + (nrows-1) * m_vgap ); -} - -void wxGridSizer::SetItemBounds( wxSizerItem *item, int x, int y, int w, int h ) -{ - wxPoint pt( x,y ); - wxSize sz( item->GetMinSizeWithBorder() ); - int flag = item->GetFlag(); - - if ((flag & wxEXPAND) || (flag & wxSHAPED)) - { - sz = wxSize(w, h); - } - else - { - if (flag & wxALIGN_CENTER_HORIZONTAL) - { - pt.x = x + (w - sz.x) / 2; - } - else if (flag & wxALIGN_RIGHT) - { - pt.x = x + (w - sz.x); - } - - if (flag & wxALIGN_CENTER_VERTICAL) - { - pt.y = y + (h - sz.y) / 2; - } - else if (flag & wxALIGN_BOTTOM) - { - pt.y = y + (h - sz.y); - } - } - - item->SetDimension(pt, sz); -} - -//--------------------------------------------------------------------------- -// wxFlexGridSizer -//--------------------------------------------------------------------------- - -wxFlexGridSizer::wxFlexGridSizer( int rows, int cols, int vgap, int hgap ) - : wxGridSizer( rows, cols, vgap, hgap ), - m_flexDirection(wxBOTH), - m_growMode(wxFLEX_GROWMODE_SPECIFIED) -{ -} - -wxFlexGridSizer::wxFlexGridSizer( int cols, int vgap, int hgap ) - : wxGridSizer( cols, vgap, hgap ), - m_flexDirection(wxBOTH), - m_growMode(wxFLEX_GROWMODE_SPECIFIED) -{ -} - -wxFlexGridSizer::~wxFlexGridSizer() -{ -} - -void wxFlexGridSizer::RecalcSizes() -{ - int nitems, nrows, ncols; - if ( (nitems = CalcRowsCols(nrows, ncols)) == 0 ) - return; - - wxPoint pt( GetPosition() ); - wxSize sz( GetSize() ); - - AdjustForGrowables(sz, m_calculatedMinSize, nrows, ncols); - - sz = wxSize( pt.x + sz.x, pt.y + sz.y ); - - int x = pt.x; - for (int c = 0; c < ncols; c++) - { - int y = pt.y; - for (int r = 0; r < nrows; r++) - { - int i = r * ncols + c; - if (i < nitems) - { - wxSizerItemList::compatibility_iterator node = m_children.Item( i ); - - wxASSERT_MSG( node, _T("Failed to find node") ); - - int w = wxMax( 0, wxMin( m_colWidths[c], sz.x - x ) ); - int h = wxMax( 0, wxMin( m_rowHeights[r], sz.y - y ) ); - - SetItemBounds( node->GetData(), x, y, w, h); - } - if (m_rowHeights[r] != -1) - y = y + m_rowHeights[r] + m_vgap; - } - if (m_colWidths[c] != -1) - x = x + m_colWidths[c] + m_hgap; - } -} - -wxSize wxFlexGridSizer::CalcMin() -{ - int nrows, - ncols; - size_t i, s; - - // Number of rows/columns can change as items are added or removed. - if ( !CalcRowsCols(nrows, ncols) ) - return wxSize(); - - m_rowHeights.SetCount(nrows); - m_colWidths.SetCount(ncols); - - // We have to recalcuate the sizes in case the item minimum size has - // changed since the previous layout, or the item has been hidden using - // wxSizer::Show(). If all the items in a row/column are hidden, the final - // dimension of the row/column will be -1, indicating that the column - // itself is hidden. - for( s = m_rowHeights.GetCount(), i = 0; i < s; ++i ) - m_rowHeights[ i ] = -1; - for( s = m_colWidths.GetCount(), i = 0; i < s; ++i ) - m_colWidths[ i ] = -1; - - wxSizerItemList::compatibility_iterator node = m_children.GetFirst(); - - i = 0; - while (node) - { - wxSizerItem *item = node->GetData(); - if ( item->ShouldAccountFor() ) - { - wxSize sz( item->CalcMin() ); - int row = i / ncols; - int col = i % ncols; - - m_rowHeights[ row ] = wxMax( wxMax( 0, sz.y ), m_rowHeights[ row ] ); - m_colWidths[ col ] = wxMax( wxMax( 0, sz.x ), m_colWidths[ col ] ); - } - - node = node->GetNext(); - i++; - } - - AdjustForFlexDirection(); - - // Sum total minimum size, including gaps between rows/columns. - // -1 is used as a magic number meaning empty column. - int width = 0; - for (int col = 0; col < ncols; col++) - if ( m_colWidths[ col ] != -1 ) - width += m_colWidths[ col ] + m_hgap; - if (width > 0) - width -= m_hgap; - - int height = 0; - for (int row = 0; row < nrows; row++) - if ( m_rowHeights[ row ] != -1 ) - height += m_rowHeights[ row ] + m_vgap; - if (height > 0) - height -= m_vgap; - - m_calculatedMinSize = wxSize( width, height ); - return m_calculatedMinSize; -} - -void wxFlexGridSizer::AdjustForFlexDirection() -{ - // the logic in CalcMin works when we resize flexibly in both directions - // but maybe this is not the case - if ( m_flexDirection != wxBOTH ) - { - // select the array corresponding to the direction in which we do *not* - // resize flexibly - wxArrayInt& array = m_flexDirection == wxVERTICAL ? m_colWidths - : m_rowHeights; - - const size_t count = array.GetCount(); - - // find the largest value in this array - size_t n; - int largest = 0; - - for ( n = 0; n < count; ++n ) - { - if ( array[n] > largest ) - largest = array[n]; - } - - // and now fill it with the largest value - for ( n = 0; n < count; ++n ) - { - // don't touch hidden rows - if ( array[n] != -1 ) - array[n] = largest; - } - } -} - - -void wxFlexGridSizer::AdjustForGrowables(const wxSize& sz, const wxSize& minsz, - int nrows, int ncols) -{ - // what to do with the rows? by default, resize them proportionally - if ( sz.y > minsz.y && ( (m_flexDirection & wxVERTICAL) || (m_growMode == wxFLEX_GROWMODE_SPECIFIED) ) ) - { - int sum_proportions = 0; - int growable_space = 0; - int num = 0; - size_t idx; - for (idx = 0; idx < m_growableRows.GetCount(); idx++) - { - // Since the number of rows/columns can change as items are - // inserted/deleted, we need to verify at runtime that the - // requested growable rows/columns are still valid. - if (m_growableRows[idx] >= nrows) - continue; - - // If all items in a row/column are hidden, that row/column will - // have a dimension of -1. This causes the row/column to be - // hidden completely. - if (m_rowHeights[ m_growableRows[idx] ] == -1) - continue; - sum_proportions += m_growableRowsProportions[idx]; - growable_space += m_rowHeights[ m_growableRows[idx] ]; - num++; - } - - if (num > 0) - { - for (idx = 0; idx < m_growableRows.GetCount(); idx++) - { - if (m_growableRows[idx] >= nrows ) - continue; - if (m_rowHeights[ m_growableRows[idx] ] != -1) - { - int delta = (sz.y - minsz.y); - if (sum_proportions == 0) - delta = (delta/num) + m_rowHeights[ m_growableRows[idx] ]; - else - delta = ((delta+growable_space)*m_growableRowsProportions[idx]) / sum_proportions; - m_rowHeights[ m_growableRows[idx] ] = delta; - } - } - } - } - else if ( (m_growMode == wxFLEX_GROWMODE_ALL) && (sz.y > minsz.y) ) - { - // rounding problem? - for ( int row = 0; row < nrows; ++row ) - m_rowHeights[ row ] = sz.y / nrows; - } - - // the same logic as above but for the columns - if ( sz.x > minsz.x && ( (m_flexDirection & wxHORIZONTAL) || (m_growMode == wxFLEX_GROWMODE_SPECIFIED) ) ) - { - int sum_proportions = 0; - int growable_space = 0; - int num = 0; - size_t idx; - for (idx = 0; idx < m_growableCols.GetCount(); idx++) - { - // Since the number of rows/columns can change as items are - // inserted/deleted, we need to verify at runtime that the - // requested growable rows/columns are still valid. - if (m_growableCols[idx] >= ncols) - continue; - - // If all items in a row/column are hidden, that row/column will - // have a dimension of -1. This causes the column to be hidden - // completely. - if (m_colWidths[ m_growableCols[idx] ] == -1) - continue; - sum_proportions += m_growableColsProportions[idx]; - growable_space += m_colWidths[ m_growableCols[idx] ]; - num++; - } - - if (num > 0) - { - for (idx = 0; idx < m_growableCols.GetCount(); idx++) - { - if (m_growableCols[idx] >= ncols ) - continue; - if (m_colWidths[ m_growableCols[idx] ] != -1) - { - int delta = (sz.x - minsz.x); - if (sum_proportions == 0) - delta = (delta/num) + m_colWidths[ m_growableCols[idx] ]; - else - delta = ((delta+growable_space)*m_growableColsProportions[idx])/sum_proportions; - m_colWidths[ m_growableCols[idx] ] = delta; - } - } - } - } - else if ( (m_growMode == wxFLEX_GROWMODE_ALL) && (sz.x > minsz.x) ) - { - for ( int col=0; col < ncols; ++col ) - m_colWidths[ col ] = sz.x / ncols; - } -} - - -void wxFlexGridSizer::AddGrowableRow( size_t idx, int proportion ) -{ - m_growableRows.Add( idx ); - m_growableRowsProportions.Add( proportion ); -} - -void wxFlexGridSizer::AddGrowableCol( size_t idx, int proportion ) -{ - m_growableCols.Add( idx ); - m_growableColsProportions.Add( proportion ); -} - -// helper function for RemoveGrowableCol/Row() -static void -DoRemoveFromArrays(size_t idx, wxArrayInt& items, wxArrayInt& proportions) -{ - const size_t count = items.size(); - for ( size_t n = 0; n < count; n++ ) - { - if ( (size_t)items[n] == idx ) - { - items.RemoveAt(n); - proportions.RemoveAt(n); - return; - } - } - - wxFAIL_MSG( _T("column/row is already not growable") ); -} - -void wxFlexGridSizer::RemoveGrowableCol( size_t idx ) -{ - DoRemoveFromArrays(idx, m_growableCols, m_growableColsProportions); -} - -void wxFlexGridSizer::RemoveGrowableRow( size_t idx ) -{ - DoRemoveFromArrays(idx, m_growableRows, m_growableRowsProportions); -} - -//--------------------------------------------------------------------------- -// wxBoxSizer -//--------------------------------------------------------------------------- - -wxBoxSizer::wxBoxSizer( int orient ) - : m_orient( orient ) -{ -} - -void wxBoxSizer::RecalcSizes() -{ - if (m_children.GetCount() == 0) - return; - - int delta = 0; - if (m_stretchable) - { - if (m_orient == wxHORIZONTAL) - delta = m_size.x - m_fixedWidth; - else - delta = m_size.y - m_fixedHeight; - } - - wxPoint pt( m_position ); - - int stretchable = m_stretchable; - wxSizerItemList::compatibility_iterator node = m_children.GetFirst(); - while (node) - { - wxSizerItem *item = node->GetData(); - - if (item->ShouldAccountFor()) - { - wxSize size( item->GetMinSizeWithBorder() ); - - if (m_orient == wxVERTICAL) - { - wxCoord height = size.y; - if (item->GetProportion()) - { - // Because of at least one visible item has non-zero - // proportion then m_stretchable is not zero - height = (delta * item->GetProportion()) / stretchable; - delta -= height; - stretchable -= item->GetProportion(); - } - - wxPoint child_pos( pt ); - wxSize child_size( size.x, height ); - - if (item->GetFlag() & (wxEXPAND | wxSHAPED)) - child_size.x = m_size.x; - else if (item->GetFlag() & wxALIGN_RIGHT) - child_pos.x += m_size.x - size.x; - else if (item->GetFlag() & (wxCENTER | wxALIGN_CENTER_HORIZONTAL)) - // XXX wxCENTER is added for backward compatibility; - // wxALIGN_CENTER should be used in new code - child_pos.x += (m_size.x - size.x) / 2; - - item->SetDimension( child_pos, child_size ); - - pt.y += height; - } - else - { - wxCoord width = size.x; - if (item->GetProportion()) - { - // Because of at least one visible item has non-zero - // proportion then m_stretchable is not zero - width = (delta * item->GetProportion()) / stretchable; - delta -= width; - stretchable -= item->GetProportion(); - } - - wxPoint child_pos( pt ); - wxSize child_size( width, size.y ); - - if (item->GetFlag() & (wxEXPAND | wxSHAPED)) - child_size.y = m_size.y; - else if (item->GetFlag() & wxALIGN_BOTTOM) - child_pos.y += m_size.y - size.y; - else if (item->GetFlag() & (wxCENTER | wxALIGN_CENTER_VERTICAL)) - // XXX wxCENTER is added for backward compatibility; - // wxALIGN_CENTER should be used in new code - child_pos.y += (m_size.y - size.y) / 2; - - if ( m_containingWindow ) - { - child_pos.x = m_containingWindow->AdjustForLayoutDirection - ( - child_pos.x, - width, - m_size.x - ); - } - - item->SetDimension( child_pos, child_size ); - - pt.x += width; - } - } - - node = node->GetNext(); - } -} - -wxSize wxBoxSizer::CalcMin() -{ - if (m_children.GetCount() == 0) - return wxSize(); - - m_stretchable = 0; - m_minWidth = 0; - m_minHeight = 0; - m_fixedWidth = 0; - m_fixedHeight = 0; - - // precalc item minsizes and count proportions - wxSizerItemList::compatibility_iterator node = m_children.GetFirst(); - while (node) - { - wxSizerItem *item = node->GetData(); - - if ( item->ShouldAccountFor() ) - { - item->CalcMin(); // result is stored in the item - - m_stretchable += item->GetProportion(); - } - - node = node->GetNext(); - } - - // Total minimum size (width or height) of sizer - int maxMinSize = 0; - - node = m_children.GetFirst(); - while (node) - { - wxSizerItem *item = node->GetData(); - - if (item->ShouldAccountFor() && item->GetProportion() != 0) - { - int stretch = item->GetProportion(); - wxSize size( item->GetMinSizeWithBorder() ); - int minSize; - - // Integer division rounded up is (a + b - 1) / b - // Round up needed in order to guarantee that all - // all items will have size not less then their min size - if (m_orient == wxHORIZONTAL) - minSize = ( size.x*m_stretchable + stretch - 1)/stretch; - else - minSize = ( size.y*m_stretchable + stretch - 1)/stretch; - - if (minSize > maxMinSize) - maxMinSize = minSize; - } - node = node->GetNext(); - } - - // Calculate overall minimum size - node = m_children.GetFirst(); - while (node) - { - wxSizerItem *item = node->GetData(); - - if (item->ShouldAccountFor()) - { - wxSize size( item->GetMinSizeWithBorder() ); - if (item->GetProportion() != 0) - { - if (m_orient == wxHORIZONTAL) - size.x = (maxMinSize*item->GetProportion())/m_stretchable; - else - size.y = (maxMinSize*item->GetProportion())/m_stretchable; - } - else - { - if (m_orient == wxVERTICAL) - { - m_fixedHeight += size.y; - m_fixedWidth = wxMax( m_fixedWidth, size.x ); - } - else - { - m_fixedWidth += size.x; - m_fixedHeight = wxMax( m_fixedHeight, size.y ); - } - } - - if (m_orient == wxHORIZONTAL) - { - m_minWidth += size.x; - m_minHeight = wxMax( m_minHeight, size.y ); - } - else - { - m_minHeight += size.y; - m_minWidth = wxMax( m_minWidth, size.x ); - } - } - node = node->GetNext(); - } - - return wxSize( m_minWidth, m_minHeight ); -} - -//--------------------------------------------------------------------------- -// wxStaticBoxSizer -//--------------------------------------------------------------------------- - -#if wxUSE_STATBOX - -wxStaticBoxSizer::wxStaticBoxSizer( wxStaticBox *box, int orient ) - : wxBoxSizer( orient ), - m_staticBox( box ) -{ - wxASSERT_MSG( box, wxT("wxStaticBoxSizer needs a static box") ); - - // do this so that our Detach() is called if the static box is destroyed - // before we are - m_staticBox->SetContainingSizer(this); -} - -wxStaticBoxSizer::wxStaticBoxSizer(int orient, wxWindow *win, const wxString& s) - : wxBoxSizer(orient), - m_staticBox(new wxStaticBox(win, wxID_ANY, s)) -{ - // same as above - m_staticBox->SetContainingSizer(this); -} - -wxStaticBoxSizer::~wxStaticBoxSizer() -{ - delete m_staticBox; -} - -static void GetStaticBoxBorders( wxStaticBox *box, - int *borderTop, - int *borderOther) -{ - // this has to be done platform by platform as there is no way to - // guess the thickness of a wxStaticBox border - box->GetBordersForSizer(borderTop, borderOther); -} - -void wxStaticBoxSizer::RecalcSizes() -{ - int top_border, other_border; - GetStaticBoxBorders(m_staticBox, &top_border, &other_border); - - m_staticBox->SetSize( m_position.x, m_position.y, m_size.x, m_size.y ); - - wxPoint old_pos( m_position ); - m_position.x += other_border; - m_position.y += top_border; - wxSize old_size( m_size ); - m_size.x -= 2*other_border; - m_size.y -= top_border + other_border; - - wxBoxSizer::RecalcSizes(); - - m_position = old_pos; - m_size = old_size; -} - -wxSize wxStaticBoxSizer::CalcMin() -{ - int top_border, other_border; - GetStaticBoxBorders(m_staticBox, &top_border, &other_border); - - wxSize ret( wxBoxSizer::CalcMin() ); - ret.x += 2*other_border; - ret.y += other_border + top_border; - - return ret; -} - -void wxStaticBoxSizer::ShowItems( bool show ) -{ - m_staticBox->Show( show ); - wxBoxSizer::ShowItems( show ); -} - -bool wxStaticBoxSizer::Detach( wxWindow *window ) -{ - // avoid deleting m_staticBox in our dtor if it's being detached from the - // sizer (which can happen because it's being already destroyed for - // example) - if ( window == m_staticBox ) - { - m_staticBox = NULL; - return true; - } - - return wxSizer::Detach( window ); -} - -#endif // wxUSE_STATBOX - -#if wxUSE_BUTTON - -wxStdDialogButtonSizer::wxStdDialogButtonSizer() - : wxBoxSizer(wxHORIZONTAL) -{ - // Vertical buttons with lots of space on either side - // looks rubbish on WinCE, so let's not do this for now. - // If we are going to use vertical buttons, we should - // put the sizer to the right of other controls in the dialog, - // and that's beyond the scope of this sizer. -#ifndef __WXWINCE__ - bool is_pda = (wxSystemSettings::GetScreenType() <= wxSYS_SCREEN_PDA); - // If we have a PDA screen, put yes/no button over - // all other buttons, otherwise on the left side. - if (is_pda) - m_orient = wxVERTICAL; -#endif - - m_buttonAffirmative = NULL; - m_buttonApply = NULL; - m_buttonNegative = NULL; - m_buttonCancel = NULL; - m_buttonHelp = NULL; -} - -void wxStdDialogButtonSizer::AddButton(wxButton *mybutton) -{ - switch (mybutton->GetId()) - { - case wxID_OK: - case wxID_YES: - case wxID_SAVE: - m_buttonAffirmative = mybutton; - break; - case wxID_APPLY: - m_buttonApply = mybutton; - break; - case wxID_NO: - m_buttonNegative = mybutton; - break; - case wxID_CANCEL: - m_buttonCancel = mybutton; - break; - case wxID_HELP: - case wxID_CONTEXT_HELP: - m_buttonHelp = mybutton; - break; - default: - break; - } -} - -void wxStdDialogButtonSizer::SetAffirmativeButton( wxButton *button ) -{ - m_buttonAffirmative = button; -} - -void wxStdDialogButtonSizer::SetNegativeButton( wxButton *button ) -{ - m_buttonNegative = button; -} - -void wxStdDialogButtonSizer::SetCancelButton( wxButton *button ) -{ - m_buttonCancel = button; -} - -void wxStdDialogButtonSizer::Realize() -{ -#ifdef __WXMAC__ - Add(0, 0, 0, wxLEFT, 6); - if (m_buttonHelp) - Add((wxWindow*)m_buttonHelp, 0, wxALIGN_CENTRE | wxLEFT | wxRIGHT, 6); - - if (m_buttonNegative){ - // HIG POLICE BULLETIN - destructive buttons need extra padding - // 24 pixels on either side - Add((wxWindow*)m_buttonNegative, 0, wxALIGN_CENTRE | wxLEFT | wxRIGHT, 12); - } - - // extra whitespace between help/negative and cancel/ok buttons - Add(0, 0, 1, wxEXPAND, 0); - - if (m_buttonCancel){ - Add((wxWindow*)m_buttonCancel, 0, wxALIGN_CENTRE | wxLEFT | wxRIGHT, 6); - // Cancel or help should be default - // m_buttonCancel->SetDefaultButton(); - } - - // Ugh, Mac doesn't really have apply dialogs, so I'll just - // figure the best place is between Cancel and OK - if (m_buttonApply) - Add((wxWindow*)m_buttonApply, 0, wxALIGN_CENTRE | wxLEFT | wxRIGHT, 6); - - if (m_buttonAffirmative){ - Add((wxWindow*)m_buttonAffirmative, 0, wxALIGN_CENTRE | wxLEFT, 6); - - if (m_buttonAffirmative->GetId() == wxID_SAVE){ - // these buttons have set labels under Mac so we should use them - m_buttonAffirmative->SetLabel(_("Save")); - if (m_buttonNegative) - m_buttonNegative->SetLabel(_("Don't Save")); - } - } - - // Extra space around and at the right - Add(12, 24); -#elif defined(__WXGTK20__) - Add(0, 0, 0, wxLEFT, 9); - if (m_buttonHelp) - Add((wxWindow*)m_buttonHelp, 0, wxALIGN_CENTRE | wxLEFT | wxRIGHT, 3); - - // extra whitespace between help and cancel/ok buttons - Add(0, 0, 1, wxEXPAND, 0); - - if (m_buttonNegative){ - Add((wxWindow*)m_buttonNegative, 0, wxALIGN_CENTRE | wxLEFT | wxRIGHT, 3); - } - - if (m_buttonCancel){ - Add((wxWindow*)m_buttonCancel, 0, wxALIGN_CENTRE | wxLEFT | wxRIGHT, 3); - // Cancel or help should be default - // m_buttonCancel->SetDefaultButton(); - } - - if (m_buttonApply) - Add((wxWindow*)m_buttonApply, 0, wxALIGN_CENTRE | wxLEFT | wxRIGHT, 3); - - if (m_buttonAffirmative) - Add((wxWindow*)m_buttonAffirmative, 0, wxALIGN_CENTRE | wxLEFT, 6); -#elif defined(__WXMSW__) - // Windows - - // right-justify buttons - Add(0, 0, 1, wxEXPAND, 0); - - if (m_buttonAffirmative){ - Add((wxWindow*)m_buttonAffirmative, 0, wxALIGN_CENTRE | wxLEFT | wxRIGHT, m_buttonAffirmative->ConvertDialogToPixels(wxSize(2, 0)).x); - } - - if (m_buttonNegative){ - Add((wxWindow*)m_buttonNegative, 0, wxALIGN_CENTRE | wxLEFT | wxRIGHT, m_buttonNegative->ConvertDialogToPixels(wxSize(2, 0)).x); - } - - if (m_buttonCancel){ - Add((wxWindow*)m_buttonCancel, 0, wxALIGN_CENTRE | wxLEFT | wxRIGHT, m_buttonCancel->ConvertDialogToPixels(wxSize(2, 0)).x); - } - if (m_buttonApply) - Add((wxWindow*)m_buttonApply, 0, wxALIGN_CENTRE | wxLEFT | wxRIGHT, m_buttonApply->ConvertDialogToPixels(wxSize(2, 0)).x); - - if (m_buttonHelp) - Add((wxWindow*)m_buttonHelp, 0, wxALIGN_CENTRE | wxLEFT | wxRIGHT, m_buttonHelp->ConvertDialogToPixels(wxSize(2, 0)).x); -#else - // GTK+1 and any other platform - - // Add(0, 0, 0, wxLEFT, 5); // Not sure what this was for but it unbalances the dialog - if (m_buttonHelp) - Add((wxWindow*)m_buttonHelp, 0, wxALIGN_CENTRE | wxLEFT | wxRIGHT, m_buttonHelp->ConvertDialogToPixels(wxSize(4, 0)).x); - - // extra whitespace between help and cancel/ok buttons - Add(0, 0, 1, wxEXPAND, 0); - - if (m_buttonApply) - Add((wxWindow*)m_buttonApply, 0, wxALIGN_CENTRE | wxLEFT | wxRIGHT, m_buttonApply->ConvertDialogToPixels(wxSize(4, 0)).x); - - if (m_buttonAffirmative){ - Add((wxWindow*)m_buttonAffirmative, 0, wxALIGN_CENTRE | wxLEFT | wxRIGHT, m_buttonAffirmative->ConvertDialogToPixels(wxSize(4, 0)).x); - } - - if (m_buttonNegative){ - Add((wxWindow*)m_buttonNegative, 0, wxALIGN_CENTRE | wxLEFT | wxRIGHT, m_buttonNegative->ConvertDialogToPixels(wxSize(4, 0)).x); - } - - if (m_buttonCancel){ - Add((wxWindow*)m_buttonCancel, 0, wxALIGN_CENTRE | wxLEFT | wxRIGHT, m_buttonCancel->ConvertDialogToPixels(wxSize(4, 0)).x); - // Cancel or help should be default - // m_buttonCancel->SetDefaultButton(); - } - -#endif -} - -#endif // wxUSE_BUTTON - -#if WXWIN_COMPATIBILITY_2_4 - -// ---------------------------------------------------------------------------- -// wxNotebookSizer -// ---------------------------------------------------------------------------- - -#if wxUSE_BOOKCTRL -IMPLEMENT_CLASS(wxBookCtrlSizer, wxSizer) -#if wxUSE_NOTEBOOK -IMPLEMENT_CLASS(wxNotebookSizer, wxBookCtrlSizer) -#endif // wxUSE_NOTEBOOK -#endif // wxUSE_BOOKCTRL - -#if wxUSE_BOOKCTRL - -#if WXWIN_COMPATIBILITY_2_6 - -wxBookCtrlSizer::wxBookCtrlSizer(wxBookCtrlBase *bookctrl) - : m_bookctrl(bookctrl) -{ - wxASSERT_MSG( bookctrl, wxT("wxBookCtrlSizer needs a control") ); -} - -#endif // WXWIN_COMPATIBILITY_2_6 - -void wxBookCtrlSizer::RecalcSizes() -{ - m_bookctrl->SetSize( m_position.x, m_position.y, m_size.x, m_size.y ); -} - -wxSize wxBookCtrlSizer::CalcMin() -{ - wxSize sizeBorder = m_bookctrl->CalcSizeFromPage(wxSize(0,0)); - - sizeBorder.x += 5; - sizeBorder.y += 5; - - if ( m_bookctrl->GetPageCount() == 0 ) - { - return wxSize(sizeBorder.x + 10, sizeBorder.y + 10); - } - - int maxX = 0; - int maxY = 0; - - wxWindowList::compatibility_iterator - node = m_bookctrl->GetChildren().GetFirst(); - while (node) - { - wxWindow *item = node->GetData(); - wxSizer *itemsizer = item->GetSizer(); - - if (itemsizer) - { - wxSize subsize( itemsizer->CalcMin() ); - - if (subsize.x > maxX) - maxX = subsize.x; - if (subsize.y > maxY) - maxY = subsize.y; - } - - node = node->GetNext(); - } - - return wxSize( maxX, maxY ) + sizeBorder; -} - -#if wxUSE_NOTEBOOK - -#if WXWIN_COMPATIBILITY_2_6 - -wxNotebookSizer::wxNotebookSizer(wxNotebook *nb) -{ - wxASSERT_MSG( nb, wxT("wxNotebookSizer needs a control") ); - m_bookctrl = nb; -} - -#endif // WXWIN_COMPATIBILITY_2_6 - -#endif // wxUSE_NOTEBOOOK -#endif // wxUSE_BOOKCTRL - -#endif // WXWIN_COMPATIBILITY_2_4 diff --git a/wxWidgets/src/common/socket.cpp b/wxWidgets/src/common/socket.cpp deleted file mode 100644 index fce138f069..0000000000 --- a/wxWidgets/src/common/socket.cpp +++ /dev/null @@ -1,1420 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/common/socket.cpp -// Purpose: Socket handler classes -// Authors: Guilhem Lavaux, Guillermo Rodriguez Garcia -// Created: April 1997 -// Copyright: (C) 1999-1997, Guilhem Lavaux -// (C) 2000-1999, Guillermo Rodriguez Garcia -// RCS_ID: $Id: socket.cpp 44662 2007-03-07 23:21:48Z VZ $ -// License: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// ========================================================================== -// Declarations -// ========================================================================== - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_SOCKETS - -#include "wx/socket.h" - -#ifndef WX_PRECOMP - #include "wx/object.h" - #include "wx/string.h" - #include "wx/intl.h" - #include "wx/log.h" - #include "wx/event.h" - #include "wx/app.h" - #include "wx/utils.h" - #include "wx/timer.h" - #include "wx/module.h" -#endif - -#include "wx/apptrait.h" - -#include "wx/sckaddr.h" -#include "wx/datetime.h" - -// DLL options compatibility check: -#include "wx/build.h" -WX_CHECK_BUILD_OPTIONS("wxNet") - -// -------------------------------------------------------------------------- -// macros and constants -// -------------------------------------------------------------------------- - -// discard buffer -#define MAX_DISCARD_SIZE (10 * 1024) - -// what to do within waits: we have 2 cases: from the main thread itself we -// have to call wxYield() to let the events (including the GUI events and the -// low-level (not wxWidgets) events from GSocket) be processed. From another -// thread it is enough to just call wxThread::Yield() which will give away the -// rest of our time slice: the explanation is that the events will be processed -// by the main thread anyhow, without calling wxYield(), but we don't want to -// eat the CPU time uselessly while sitting in the loop waiting for the data -#if wxUSE_THREADS - #define PROCESS_EVENTS() \ - { \ - if ( wxThread::IsMain() ) \ - wxYield(); \ - else \ - wxThread::Yield(); \ - } -#else // !wxUSE_THREADS - #define PROCESS_EVENTS() wxYield() -#endif // wxUSE_THREADS/!wxUSE_THREADS - -#define wxTRACE_Socket _T("wxSocket") - -// -------------------------------------------------------------------------- -// wxWin macros -// -------------------------------------------------------------------------- - -IMPLEMENT_CLASS(wxSocketBase, wxObject) -IMPLEMENT_CLASS(wxSocketServer, wxSocketBase) -IMPLEMENT_CLASS(wxSocketClient, wxSocketBase) -IMPLEMENT_CLASS(wxDatagramSocket, wxSocketBase) -IMPLEMENT_DYNAMIC_CLASS(wxSocketEvent, wxEvent) - -// -------------------------------------------------------------------------- -// private classes -// -------------------------------------------------------------------------- - -class wxSocketState : public wxObject -{ -public: - wxSocketFlags m_flags; - wxSocketEventFlags m_eventmask; - bool m_notify; - void *m_clientData; - -public: - wxSocketState() : wxObject() {} - - DECLARE_NO_COPY_CLASS(wxSocketState) -}; - -// ========================================================================== -// wxSocketBase -// ========================================================================== - -// -------------------------------------------------------------------------- -// Initialization and shutdown -// -------------------------------------------------------------------------- - -// FIXME-MT: all this is MT-unsafe, of course, we should protect all accesses -// to m_countInit with a crit section -size_t wxSocketBase::m_countInit = 0; - -bool wxSocketBase::IsInitialized() -{ - return m_countInit > 0; -} - -bool wxSocketBase::Initialize() -{ - if ( !m_countInit++ ) - { - /* - Details: Initialize() creates a hidden window as a sink for socket - events, such as 'read completed'. wxMSW has only one message loop - for the main thread. If Initialize is called in a secondary thread, - the socket window will be created for the secondary thread, but - since there is no message loop on this thread, it will never - receive events and all socket operations will time out. - BTW, the main thread must not be stopped using sleep or block - on a semaphore (a bad idea in any case) or socket operations - will time out. - - On the Mac side, Initialize() stores a pointer to the CFRunLoop for - the main thread. Because secondary threads do not have run loops, - adding event notifications to the "Current" loop would have no - effect at all, events would never fire. - */ - wxASSERT_MSG( wxIsMainThread(), - wxT("Call wxSocketBase::Initialize() from the main thread first!")); - - wxAppTraits *traits = wxAppConsole::GetInstance() ? - wxAppConsole::GetInstance()->GetTraits() : NULL; - GSocketGUIFunctionsTable *functions = - traits ? traits->GetSocketGUIFunctionsTable() : NULL; - GSocket_SetGUIFunctions(functions); - - if ( !GSocket_Init() ) - { - m_countInit--; - - return false; - } - } - - return true; -} - -void wxSocketBase::Shutdown() -{ - // we should be initialized - wxASSERT_MSG( m_countInit, _T("extra call to Shutdown()") ); - if ( --m_countInit == 0 ) - { - GSocket_Cleanup(); - } -} - -// -------------------------------------------------------------------------- -// Ctor and dtor -// -------------------------------------------------------------------------- - -void wxSocketBase::Init() -{ - m_socket = NULL; - m_type = wxSOCKET_UNINIT; - - // state - m_flags = 0; - m_connected = - m_establishing = - m_reading = - m_writing = - m_error = false; - m_lcount = 0; - m_timeout = 600; - m_beingDeleted = false; - - // pushback buffer - m_unread = NULL; - m_unrd_size = 0; - m_unrd_cur = 0; - - // events - m_id = wxID_ANY; - m_handler = NULL; - m_clientData = NULL; - m_notify = false; - m_eventmask = 0; - - if ( !IsInitialized() ) - { - // this Initialize() will be undone by wxSocketModule::OnExit(), all the - // other calls to it should be matched by a call to Shutdown() - Initialize(); - } -} - -wxSocketBase::wxSocketBase() -{ - Init(); -} - -wxSocketBase::wxSocketBase(wxSocketFlags flags, wxSocketType type) -{ - Init(); - - m_flags = flags; - m_type = type; -} - -wxSocketBase::~wxSocketBase() -{ - // Just in case the app called Destroy() *and* then deleted - // the socket immediately: don't leave dangling pointers. - wxAppTraits *traits = wxTheApp ? wxTheApp->GetTraits() : NULL; - if ( traits ) - traits->RemoveFromPendingDelete(this); - - // Shutdown and close the socket - if (!m_beingDeleted) - Close(); - - // Destroy the GSocket object - if (m_socket) - delete m_socket; - - // Free the pushback buffer - if (m_unread) - free(m_unread); -} - -bool wxSocketBase::Destroy() -{ - // Delayed destruction: the socket will be deleted during the next - // idle loop iteration. This ensures that all pending events have - // been processed. - m_beingDeleted = true; - - // Shutdown and close the socket - Close(); - - // Supress events from now on - Notify(false); - - // schedule this object for deletion - wxAppTraits *traits = wxTheApp ? wxTheApp->GetTraits() : NULL; - if ( traits ) - { - // let the traits object decide what to do with us - traits->ScheduleForDestroy(this); - } - else // no app or no traits - { - // in wxBase we might have no app object at all, don't leak memory - delete this; - } - - return true; -} - -// -------------------------------------------------------------------------- -// Basic IO calls -// -------------------------------------------------------------------------- - -// The following IO operations update m_error and m_lcount: -// {Read, Write, ReadMsg, WriteMsg, Peek, Unread, Discard} -// -// TODO: Should Connect, Accept and AcceptWith update m_error? - -bool wxSocketBase::Close() -{ - // Interrupt pending waits - InterruptWait(); - - if (m_socket) - { - // Disable callbacks - m_socket->UnsetCallback(GSOCK_INPUT_FLAG | GSOCK_OUTPUT_FLAG | - GSOCK_LOST_FLAG | GSOCK_CONNECTION_FLAG); - - // Shutdown the connection - m_socket->Shutdown(); - } - - m_connected = false; - m_establishing = false; - return true; -} - -wxSocketBase& wxSocketBase::Read(void* buffer, wxUint32 nbytes) -{ - // Mask read events - m_reading = true; - - m_lcount = _Read(buffer, nbytes); - - // If in wxSOCKET_WAITALL mode, all bytes should have been read. - if (m_flags & wxSOCKET_WAITALL) - m_error = (m_lcount != nbytes); - else - m_error = (m_lcount == 0); - - // Allow read events from now on - m_reading = false; - - return *this; -} - -wxUint32 wxSocketBase::_Read(void* buffer, wxUint32 nbytes) -{ - int total; - - // Try the pushback buffer first - total = GetPushback(buffer, nbytes, false); - nbytes -= total; - buffer = (char *)buffer + total; - - // Return now in one of the following cases: - // - the socket is invalid, - // - we got all the data - if ( !m_socket || - !nbytes ) - return total; - - // Possible combinations (they are checked in this order) - // wxSOCKET_NOWAIT - // wxSOCKET_WAITALL (with or without wxSOCKET_BLOCK) - // wxSOCKET_BLOCK - // wxSOCKET_NONE - // - int ret; - if (m_flags & wxSOCKET_NOWAIT) - { - m_socket->SetNonBlocking(1); - ret = m_socket->Read((char *)buffer, nbytes); - m_socket->SetNonBlocking(0); - - if (ret > 0) - total += ret; - } - else - { - bool more = true; - - while (more) - { - if ( !(m_flags & wxSOCKET_BLOCK) && !WaitForRead() ) - break; - - ret = m_socket->Read((char *)buffer, nbytes); - - if (ret > 0) - { - total += ret; - nbytes -= ret; - buffer = (char *)buffer + ret; - } - - // If we got here and wxSOCKET_WAITALL is not set, we can leave - // now. Otherwise, wait until we recv all the data or until there - // is an error. - // - more = (ret > 0 && nbytes > 0 && (m_flags & wxSOCKET_WAITALL)); - } - } - - return total; -} - -wxSocketBase& wxSocketBase::ReadMsg(void* buffer, wxUint32 nbytes) -{ - wxUint32 len, len2, sig, total; - bool error; - int old_flags; - struct - { - unsigned char sig[4]; - unsigned char len[4]; - } msg; - - // Mask read events - m_reading = true; - - total = 0; - error = true; - old_flags = m_flags; - SetFlags((m_flags & wxSOCKET_BLOCK) | wxSOCKET_WAITALL); - - if (_Read(&msg, sizeof(msg)) != sizeof(msg)) - goto exit; - - sig = (wxUint32)msg.sig[0]; - sig |= (wxUint32)(msg.sig[1] << 8); - sig |= (wxUint32)(msg.sig[2] << 16); - sig |= (wxUint32)(msg.sig[3] << 24); - - if (sig != 0xfeeddead) - { - wxLogWarning(_("wxSocket: invalid signature in ReadMsg.")); - goto exit; - } - - len = (wxUint32)msg.len[0]; - len |= (wxUint32)(msg.len[1] << 8); - len |= (wxUint32)(msg.len[2] << 16); - len |= (wxUint32)(msg.len[3] << 24); - - if (len > nbytes) - { - len2 = len - nbytes; - len = nbytes; - } - else - len2 = 0; - - // Don't attemp to read if the msg was zero bytes long. - if (len) - { - total = _Read(buffer, len); - - if (total != len) - goto exit; - } - if (len2) - { - char *discard_buffer = new char[MAX_DISCARD_SIZE]; - long discard_len; - - // NOTE: discarded bytes don't add to m_lcount. - do - { - discard_len = ((len2 > MAX_DISCARD_SIZE)? MAX_DISCARD_SIZE : len2); - discard_len = _Read(discard_buffer, (wxUint32)discard_len); - len2 -= (wxUint32)discard_len; - } - while ((discard_len > 0) && len2); - - delete [] discard_buffer; - - if (len2 != 0) - goto exit; - } - if (_Read(&msg, sizeof(msg)) != sizeof(msg)) - goto exit; - - sig = (wxUint32)msg.sig[0]; - sig |= (wxUint32)(msg.sig[1] << 8); - sig |= (wxUint32)(msg.sig[2] << 16); - sig |= (wxUint32)(msg.sig[3] << 24); - - if (sig != 0xdeadfeed) - { - wxLogWarning(_("wxSocket: invalid signature in ReadMsg.")); - goto exit; - } - - // everything was OK - error = false; - -exit: - m_error = error; - m_lcount = total; - m_reading = false; - SetFlags(old_flags); - - return *this; -} - -wxSocketBase& wxSocketBase::Peek(void* buffer, wxUint32 nbytes) -{ - // Mask read events - m_reading = true; - - m_lcount = _Read(buffer, nbytes); - Pushback(buffer, m_lcount); - - // If in wxSOCKET_WAITALL mode, all bytes should have been read. - if (m_flags & wxSOCKET_WAITALL) - m_error = (m_lcount != nbytes); - else - m_error = (m_lcount == 0); - - // Allow read events again - m_reading = false; - - return *this; -} - -wxSocketBase& wxSocketBase::Write(const void *buffer, wxUint32 nbytes) -{ - // Mask write events - m_writing = true; - - m_lcount = _Write(buffer, nbytes); - - // If in wxSOCKET_WAITALL mode, all bytes should have been written. - if (m_flags & wxSOCKET_WAITALL) - m_error = (m_lcount != nbytes); - else - m_error = (m_lcount == 0); - - // Allow write events again - m_writing = false; - - return *this; -} - -wxUint32 wxSocketBase::_Write(const void *buffer, wxUint32 nbytes) -{ - wxUint32 total = 0; - - // If the socket is invalid or parameters are ill, return immediately - if (!m_socket || !buffer || !nbytes) - return 0; - - // Possible combinations (they are checked in this order) - // wxSOCKET_NOWAIT - // wxSOCKET_WAITALL (with or without wxSOCKET_BLOCK) - // wxSOCKET_BLOCK - // wxSOCKET_NONE - // - int ret; - if (m_flags & wxSOCKET_NOWAIT) - { - m_socket->SetNonBlocking(1); - ret = m_socket->Write((const char *)buffer, nbytes); - m_socket->SetNonBlocking(0); - - if (ret > 0) - total = ret; - } - else - { - bool more = true; - - while (more) - { - if ( !(m_flags & wxSOCKET_BLOCK) && !WaitForWrite() ) - break; - - ret = m_socket->Write((const char *)buffer, nbytes); - - if (ret > 0) - { - total += ret; - nbytes -= ret; - buffer = (const char *)buffer + ret; - } - - // If we got here and wxSOCKET_WAITALL is not set, we can leave - // now. Otherwise, wait until we send all the data or until there - // is an error. - // - more = (ret > 0 && nbytes > 0 && (m_flags & wxSOCKET_WAITALL)); - } - } - - return total; -} - -wxSocketBase& wxSocketBase::WriteMsg(const void *buffer, wxUint32 nbytes) -{ - wxUint32 total; - bool error; - struct - { - unsigned char sig[4]; - unsigned char len[4]; - } msg; - - // Mask write events - m_writing = true; - - error = true; - total = 0; - SetFlags((m_flags & wxSOCKET_BLOCK) | wxSOCKET_WAITALL); - - msg.sig[0] = (unsigned char) 0xad; - msg.sig[1] = (unsigned char) 0xde; - msg.sig[2] = (unsigned char) 0xed; - msg.sig[3] = (unsigned char) 0xfe; - - msg.len[0] = (unsigned char) (nbytes & 0xff); - msg.len[1] = (unsigned char) ((nbytes >> 8) & 0xff); - msg.len[2] = (unsigned char) ((nbytes >> 16) & 0xff); - msg.len[3] = (unsigned char) ((nbytes >> 24) & 0xff); - - if (_Write(&msg, sizeof(msg)) < sizeof(msg)) - goto exit; - - total = _Write(buffer, nbytes); - - if (total < nbytes) - goto exit; - - msg.sig[0] = (unsigned char) 0xed; - msg.sig[1] = (unsigned char) 0xfe; - msg.sig[2] = (unsigned char) 0xad; - msg.sig[3] = (unsigned char) 0xde; - msg.len[0] = msg.len[1] = msg.len[2] = msg.len[3] = (char) 0; - - if ((_Write(&msg, sizeof(msg))) < sizeof(msg)) - goto exit; - - // everything was OK - error = false; - -exit: - m_error = error; - m_lcount = total; - m_writing = false; - - return *this; -} - -wxSocketBase& wxSocketBase::Unread(const void *buffer, wxUint32 nbytes) -{ - if (nbytes != 0) - Pushback(buffer, nbytes); - - m_error = false; - m_lcount = nbytes; - - return *this; -} - -wxSocketBase& wxSocketBase::Discard() -{ - char *buffer = new char[MAX_DISCARD_SIZE]; - wxUint32 ret; - wxUint32 total = 0; - - // Mask read events - m_reading = true; - - SetFlags(wxSOCKET_NOWAIT); - - do - { - ret = _Read(buffer, MAX_DISCARD_SIZE); - total += ret; - } - while (ret == MAX_DISCARD_SIZE); - - delete[] buffer; - m_lcount = total; - m_error = false; - - // Allow read events again - m_reading = false; - - return *this; -} - -// -------------------------------------------------------------------------- -// Wait functions -// -------------------------------------------------------------------------- - -// All Wait functions poll the socket using GSocket_Select() to -// check for the specified combination of conditions, until one -// of these conditions become true, an error occurs, or the -// timeout elapses. The polling loop calls PROCESS_EVENTS(), so -// this won't block the GUI. - -bool wxSocketBase::_Wait(long seconds, - long milliseconds, - wxSocketEventFlags flags) -{ - GSocketEventFlags result; - long timeout; - - // Set this to true to interrupt ongoing waits - m_interrupt = false; - - // Check for valid socket - if (!m_socket) - return false; - - // Check for valid timeout value. - if (seconds != -1) - timeout = seconds * 1000 + milliseconds; - else - timeout = m_timeout * 1000; - - bool has_event_loop = wxTheApp->GetTraits() ? (wxTheApp->GetTraits()->GetSocketGUIFunctionsTable() ? true : false) : false; - - // Wait in an active polling loop. - // - // NOTE: We duplicate some of the code in OnRequest, but this doesn't - // hurt. It has to be here because the (GSocket) event might arrive - // a bit delayed, and it has to be in OnRequest as well because we - // don't know whether the Wait functions are being used. - // - // Do this at least once (important if timeout == 0, when - // we are just polling). Also, if just polling, do not yield. - - wxDateTime current_time = wxDateTime::UNow(); - unsigned int time_limit = (current_time.GetTicks() * 1000) + current_time.GetMillisecond() + timeout; - bool done = false; - bool valid_result = false; - - if (!has_event_loop) - { - // This is used to avoid a busy loop on wxBase - having a select - // timeout of 50 ms per iteration should be enough. - if (timeout > 50) - m_socket->SetTimeout(50); - else - m_socket->SetTimeout(timeout); - } - - while (!done) - { - result = m_socket->Select(flags | GSOCK_LOST_FLAG); - - // Incoming connection (server) or connection established (client) - if (result & GSOCK_CONNECTION_FLAG) - { - m_connected = true; - m_establishing = false; - valid_result = true; - break; - } - - // Data available or output buffer ready - if ((result & GSOCK_INPUT_FLAG) || (result & GSOCK_OUTPUT_FLAG)) - { - valid_result = true; - break; - } - - // Connection lost - if (result & GSOCK_LOST_FLAG) - { - m_connected = false; - m_establishing = false; - valid_result = ((flags & GSOCK_LOST_FLAG) != 0); - break; - } - - // Wait more? - current_time = wxDateTime::UNow(); - int time_left = time_limit - ((current_time.GetTicks() * 1000) + current_time.GetMillisecond()); - if ((!timeout) || (time_left <= 0) || (m_interrupt)) - done = true; - else - { - if (has_event_loop) - { - PROCESS_EVENTS(); - } - else - { - // If there's less than 50 ms left, just call select with that timeout. - if (time_left < 50) - m_socket->SetTimeout(time_left); - } - } - } - - // Set timeout back to original value (we overwrote it for polling) - if (!has_event_loop) - m_socket->SetTimeout(m_timeout*1000); - - return valid_result; -} - -bool wxSocketBase::Wait(long seconds, long milliseconds) -{ - return _Wait(seconds, milliseconds, GSOCK_INPUT_FLAG | - GSOCK_OUTPUT_FLAG | - GSOCK_CONNECTION_FLAG | - GSOCK_LOST_FLAG); -} - -bool wxSocketBase::WaitForRead(long seconds, long milliseconds) -{ - // Check pushback buffer before entering _Wait - if (m_unread) - return true; - - // Note that GSOCK_INPUT_LOST has to be explicitly passed to - // _Wait because of the semantics of WaitForRead: a return - // value of true means that a GSocket_Read call will return - // immediately, not that there is actually data to read. - - return _Wait(seconds, milliseconds, GSOCK_INPUT_FLAG | - GSOCK_LOST_FLAG); -} - - -bool wxSocketBase::WaitForWrite(long seconds, long milliseconds) -{ - return _Wait(seconds, milliseconds, GSOCK_OUTPUT_FLAG); -} - -bool wxSocketBase::WaitForLost(long seconds, long milliseconds) -{ - return _Wait(seconds, milliseconds, GSOCK_LOST_FLAG); -} - -// -------------------------------------------------------------------------- -// Miscellaneous -// -------------------------------------------------------------------------- - -// -// Get local or peer address -// - -bool wxSocketBase::GetPeer(wxSockAddress& addr_man) const -{ - GAddress *peer; - - if (!m_socket) - return false; - - peer = m_socket->GetPeer(); - - // copying a null address would just trigger an assert anyway - - if (!peer) - return false; - - addr_man.SetAddress(peer); - GAddress_destroy(peer); - - return true; -} - -bool wxSocketBase::GetLocal(wxSockAddress& addr_man) const -{ - GAddress *local; - - if (!m_socket) - return false; - - local = m_socket->GetLocal(); - addr_man.SetAddress(local); - GAddress_destroy(local); - - return true; -} - -// -// Save and restore socket state -// - -void wxSocketBase::SaveState() -{ - wxSocketState *state; - - state = new wxSocketState(); - - state->m_flags = m_flags; - state->m_notify = m_notify; - state->m_eventmask = m_eventmask; - state->m_clientData = m_clientData; - - m_states.Append(state); -} - -void wxSocketBase::RestoreState() -{ - wxList::compatibility_iterator node; - wxSocketState *state; - - node = m_states.GetLast(); - if (!node) - return; - - state = (wxSocketState *)node->GetData(); - - m_flags = state->m_flags; - m_notify = state->m_notify; - m_eventmask = state->m_eventmask; - m_clientData = state->m_clientData; - - m_states.Erase(node); - delete state; -} - -// -// Timeout and flags -// - -void wxSocketBase::SetTimeout(long seconds) -{ - m_timeout = seconds; - - if (m_socket) - m_socket->SetTimeout(m_timeout * 1000); -} - -void wxSocketBase::SetFlags(wxSocketFlags flags) -{ - m_flags = flags; -} - - -// -------------------------------------------------------------------------- -// Event handling -// -------------------------------------------------------------------------- - -// A note on how events are processed, which is probably the most -// difficult thing to get working right while keeping the same API -// and functionality for all platforms. -// -// When GSocket detects an event, it calls wx_socket_callback, which in -// turn just calls wxSocketBase::OnRequest in the corresponding wxSocket -// object. OnRequest does some housekeeping, and if the event is to be -// propagated to the user, it creates a new wxSocketEvent object and -// posts it. The event is not processed immediately, but delayed with -// AddPendingEvent instead. This is necessary in order to decouple the -// event processing from wx_socket_callback; otherwise, subsequent IO -// calls made from the user event handler would fail, as gtk callbacks -// are not reentrant. -// -// Note that, unlike events, user callbacks (now deprecated) are _not_ -// decoupled from wx_socket_callback and thus they suffer from a variety -// of problems. Avoid them where possible and use events instead. - -extern "C" -void LINKAGEMODE wx_socket_callback(GSocket * WXUNUSED(socket), - GSocketEvent notification, - char *cdata) -{ - wxSocketBase *sckobj = (wxSocketBase *)cdata; - - sckobj->OnRequest((wxSocketNotify) notification); -} - -void wxSocketBase::OnRequest(wxSocketNotify notification) -{ - // NOTE: We duplicate some of the code in _Wait, but this doesn't - // hurt. It has to be here because the (GSocket) event might arrive - // a bit delayed, and it has to be in _Wait as well because we don't - // know whether the Wait functions are being used. - - switch(notification) - { - case wxSOCKET_CONNECTION: - m_establishing = false; - m_connected = true; - break; - - // If we are in the middle of a R/W operation, do not - // propagate events to users. Also, filter 'late' events - // which are no longer valid. - - case wxSOCKET_INPUT: - if (m_reading || !m_socket->Select(GSOCK_INPUT_FLAG)) - return; - break; - - case wxSOCKET_OUTPUT: - if (m_writing || !m_socket->Select(GSOCK_OUTPUT_FLAG)) - return; - break; - - case wxSOCKET_LOST: - m_connected = false; - m_establishing = false; - break; - - default: - break; - } - - // Schedule the event - - wxSocketEventFlags flag = 0; - wxUnusedVar(flag); - switch (notification) - { - case GSOCK_INPUT: flag = GSOCK_INPUT_FLAG; break; - case GSOCK_OUTPUT: flag = GSOCK_OUTPUT_FLAG; break; - case GSOCK_CONNECTION: flag = GSOCK_CONNECTION_FLAG; break; - case GSOCK_LOST: flag = GSOCK_LOST_FLAG; break; - default: - wxLogWarning(_("wxSocket: unknown event!.")); - return; - } - - if (((m_eventmask & flag) == flag) && m_notify) - { - if (m_handler) - { - wxSocketEvent event(m_id); - event.m_event = notification; - event.m_clientData = m_clientData; - event.SetEventObject(this); - - m_handler->AddPendingEvent(event); - } - } -} - -void wxSocketBase::Notify(bool notify) -{ - m_notify = notify; -} - -void wxSocketBase::SetNotify(wxSocketEventFlags flags) -{ - m_eventmask = flags; -} - -void wxSocketBase::SetEventHandler(wxEvtHandler& handler, int id) -{ - m_handler = &handler; - m_id = id; -} - -// -------------------------------------------------------------------------- -// Pushback buffer -// -------------------------------------------------------------------------- - -void wxSocketBase::Pushback(const void *buffer, wxUint32 size) -{ - if (!size) return; - - if (m_unread == NULL) - m_unread = malloc(size); - else - { - void *tmp; - - tmp = malloc(m_unrd_size + size); - memcpy((char *)tmp + size, m_unread, m_unrd_size); - free(m_unread); - - m_unread = tmp; - } - - m_unrd_size += size; - - memcpy(m_unread, buffer, size); -} - -wxUint32 wxSocketBase::GetPushback(void *buffer, wxUint32 size, bool peek) -{ - if (!m_unrd_size) - return 0; - - if (size > (m_unrd_size-m_unrd_cur)) - size = m_unrd_size-m_unrd_cur; - - memcpy(buffer, (char *)m_unread + m_unrd_cur, size); - - if (!peek) - { - m_unrd_cur += size; - if (m_unrd_size == m_unrd_cur) - { - free(m_unread); - m_unread = NULL; - m_unrd_size = 0; - m_unrd_cur = 0; - } - } - - return size; -} - - -// ========================================================================== -// wxSocketServer -// ========================================================================== - -// -------------------------------------------------------------------------- -// Ctor -// -------------------------------------------------------------------------- - -wxSocketServer::wxSocketServer(const wxSockAddress& addr_man, - wxSocketFlags flags) - : wxSocketBase(flags, wxSOCKET_SERVER) -{ - wxLogTrace( wxTRACE_Socket, _T("Opening wxSocketServer") ); - - m_socket = GSocket_new(); - - if (!m_socket) - { - wxLogTrace( wxTRACE_Socket, _T("*** GSocket_new failed") ); - return; - } - - // Setup the socket as server - - m_socket->SetLocal(addr_man.GetAddress()); - - if (GetFlags() & wxSOCKET_REUSEADDR) { - m_socket->SetReusable(); - } - - if (m_socket->SetServer() != GSOCK_NOERROR) - { - delete m_socket; - m_socket = NULL; - - wxLogTrace( wxTRACE_Socket, _T("*** GSocket_SetServer failed") ); - return; - } - - m_socket->SetTimeout(m_timeout * 1000); - m_socket->SetCallback(GSOCK_INPUT_FLAG | GSOCK_OUTPUT_FLAG | - GSOCK_LOST_FLAG | GSOCK_CONNECTION_FLAG, - wx_socket_callback, (char *)this); -} - -// -------------------------------------------------------------------------- -// Accept -// -------------------------------------------------------------------------- - -bool wxSocketServer::AcceptWith(wxSocketBase& sock, bool wait) -{ - GSocket *child_socket; - - if (!m_socket) - return false; - - // If wait == false, then the call should be nonblocking. - // When we are finished, we put the socket to blocking mode - // again. - - if (!wait) - m_socket->SetNonBlocking(1); - - child_socket = m_socket->WaitConnection(); - - if (!wait) - m_socket->SetNonBlocking(0); - - if (!child_socket) - return false; - - sock.m_type = wxSOCKET_BASE; - sock.m_socket = child_socket; - sock.m_connected = true; - - sock.m_socket->SetTimeout(sock.m_timeout * 1000); - sock.m_socket->SetCallback(GSOCK_INPUT_FLAG | GSOCK_OUTPUT_FLAG | - GSOCK_LOST_FLAG | GSOCK_CONNECTION_FLAG, - wx_socket_callback, (char *)&sock); - - return true; -} - -wxSocketBase *wxSocketServer::Accept(bool wait) -{ - wxSocketBase* sock = new wxSocketBase(); - - sock->SetFlags(m_flags); - - if (!AcceptWith(*sock, wait)) - { - sock->Destroy(); - sock = NULL; - } - - return sock; -} - -bool wxSocketServer::WaitForAccept(long seconds, long milliseconds) -{ - return _Wait(seconds, milliseconds, GSOCK_CONNECTION_FLAG); -} - -bool wxSocketBase::GetOption(int level, int optname, void *optval, int *optlen) -{ - wxASSERT_MSG( m_socket, _T("Socket not initialised") ); - - if (m_socket->GetSockOpt(level, optname, optval, optlen) - != GSOCK_NOERROR) - { - return false; - } - return true; -} - -bool wxSocketBase::SetOption(int level, int optname, const void *optval, - int optlen) -{ - wxASSERT_MSG( m_socket, _T("Socket not initialised") ); - - if (m_socket->SetSockOpt(level, optname, optval, optlen) - != GSOCK_NOERROR) - { - return false; - } - return true; -} - -bool wxSocketBase::SetLocal(wxIPV4address& local) -{ - GAddress* la = local.GetAddress(); - - // If the address is valid, save it for use when we call Connect - if (la && la->m_addr) - { - m_localAddress = local; - - return true; - } - - return false; -} - -// ========================================================================== -// wxSocketClient -// ========================================================================== - -// -------------------------------------------------------------------------- -// Ctor and dtor -// -------------------------------------------------------------------------- - -wxSocketClient::wxSocketClient(wxSocketFlags flags) - : wxSocketBase(flags, wxSOCKET_CLIENT) -{ -} - -wxSocketClient::~wxSocketClient() -{ -} - -// -------------------------------------------------------------------------- -// Connect -// -------------------------------------------------------------------------- - -bool wxSocketClient::DoConnect(wxSockAddress& addr_man, wxSockAddress* local, bool wait) -{ - GSocketError err; - - if (m_socket) - { - // Shutdown and destroy the socket - Close(); - delete m_socket; - } - - m_socket = GSocket_new(); - m_connected = false; - m_establishing = false; - - if (!m_socket) - return false; - - m_socket->SetTimeout(m_timeout * 1000); - m_socket->SetCallback(GSOCK_INPUT_FLAG | GSOCK_OUTPUT_FLAG | - GSOCK_LOST_FLAG | GSOCK_CONNECTION_FLAG, - wx_socket_callback, (char *)this); - - // If wait == false, then the call should be nonblocking. - // When we are finished, we put the socket to blocking mode - // again. - - if (!wait) - m_socket->SetNonBlocking(1); - - // Reuse makes sense for clients too, if we are trying to rebind to the same port - if (GetFlags() & wxSOCKET_REUSEADDR) - { - m_socket->SetReusable(); - } - - // If no local address was passed and one has been set, use the one that was Set - if (!local && m_localAddress.GetAddress()) - { - local = &m_localAddress; - } - - // Bind to the local IP address and port, when provided - if (local) - { - GAddress* la = local->GetAddress(); - - if (la && la->m_addr) - m_socket->SetLocal(la); - } - - m_socket->SetPeer(addr_man.GetAddress()); - err = m_socket->Connect(GSOCK_STREAMED); - - if (!wait) - m_socket->SetNonBlocking(0); - - if (err != GSOCK_NOERROR) - { - if (err == GSOCK_WOULDBLOCK) - m_establishing = true; - - return false; - } - - m_connected = true; - return true; -} - -bool wxSocketClient::Connect(wxSockAddress& addr_man, bool wait) -{ - return (DoConnect(addr_man, NULL, wait)); -} - -bool wxSocketClient::Connect(wxSockAddress& addr_man, wxSockAddress& local, bool wait) -{ - return (DoConnect(addr_man, &local, wait)); -} - -bool wxSocketClient::WaitOnConnect(long seconds, long milliseconds) -{ - if (m_connected) // Already connected - return true; - - if (!m_establishing || !m_socket) // No connection in progress - return false; - - return _Wait(seconds, milliseconds, GSOCK_CONNECTION_FLAG | - GSOCK_LOST_FLAG); -} - -// ========================================================================== -// wxDatagramSocket -// ========================================================================== - -/* NOTE: experimental stuff - might change */ - -wxDatagramSocket::wxDatagramSocket( const wxSockAddress& addr, - wxSocketFlags flags ) - : wxSocketBase( flags, wxSOCKET_DATAGRAM ) -{ - // Create the socket - m_socket = GSocket_new(); - - if (!m_socket) - { - wxFAIL_MSG( _T("datagram socket not new'd") ); - return; - } - // Setup the socket as non connection oriented - m_socket->SetLocal(addr.GetAddress()); - if (flags & wxSOCKET_REUSEADDR) - { - m_socket->SetReusable(); - } - if ( m_socket->SetNonOriented() != GSOCK_NOERROR ) - { - delete m_socket; - m_socket = NULL; - return; - } - - // Initialize all stuff - m_connected = false; - m_establishing = false; - m_socket->SetTimeout( m_timeout ); - m_socket->SetCallback( GSOCK_INPUT_FLAG | GSOCK_OUTPUT_FLAG | - GSOCK_LOST_FLAG | GSOCK_CONNECTION_FLAG, - wx_socket_callback, (char*)this ); -} - -wxDatagramSocket& wxDatagramSocket::RecvFrom( wxSockAddress& addr, - void* buf, - wxUint32 nBytes ) -{ - Read(buf, nBytes); - GetPeer(addr); - return (*this); -} - -wxDatagramSocket& wxDatagramSocket::SendTo( const wxSockAddress& addr, - const void* buf, - wxUint32 nBytes ) -{ - wxASSERT_MSG( m_socket, _T("Socket not initialised") ); - - m_socket->SetPeer(addr.GetAddress()); - Write(buf, nBytes); - return (*this); -} - -// ========================================================================== -// wxSocketModule -// ========================================================================== - -class wxSocketModule : public wxModule -{ -public: - virtual bool OnInit() - { - // wxSocketBase will call GSocket_Init() itself when/if needed - return true; - } - - virtual void OnExit() - { - if ( wxSocketBase::IsInitialized() ) - wxSocketBase::Shutdown(); - } - -private: - DECLARE_DYNAMIC_CLASS(wxSocketModule) -}; - -IMPLEMENT_DYNAMIC_CLASS(wxSocketModule, wxModule) - -#endif - // wxUSE_SOCKETS diff --git a/wxWidgets/src/common/socketevtdispatch.cpp b/wxWidgets/src/common/socketevtdispatch.cpp deleted file mode 100644 index 546b4c5205..0000000000 --- a/wxWidgets/src/common/socketevtdispatch.cpp +++ /dev/null @@ -1,339 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: src/common/socketevtdispatch.cpp -// Purpose: implements wxSocketEventDispatcher for platforms with no -// socket events notification -// Author: Angel Vidal -// Modified by: -// Created: 08.24.06 -// RCS-ID: $Id: socketevtdispatch.cpp 43976 2006-12-14 14:13:57Z VS $ -// Copyright: (c) 2006 Angel vidal -// License: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -// for compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#if wxUSE_SOCKETS - -#include "wx/private/socketevtdispatch.h" -#include "wx/module.h" -#include "wx/unix/private.h" -#include "wx/gsocket.h" -#include "wx/unix/gsockunx.h" - -#ifndef WX_PRECOMP - #include "wx/hash.h" -#endif - -#include -#include - -#ifdef HAVE_SYS_SELECT_H -# include -#endif - -// ============================================================================ -// implementation -// ============================================================================ - -// ---------------------------------------------------------------------------- -// wxSocketEventDispatcherEntry -// ---------------------------------------------------------------------------- - -class wxSocketEventDispatcherEntry: public wxObject -{ - public: - wxSocketEventDispatcherEntry() - { - m_fdInput = -1; m_fdOutput = -1; - m_socket = NULL; - } - - int m_fdInput; - int m_fdOutput; - GSocket* m_socket; -}; - -// ---------------------------------------------------------------------------- -// wxSocketEventDispatcher -// ---------------------------------------------------------------------------- - -wxSocketEventDispatcher* wxSocketEventDispatcher::ms_instance = NULL; - -/* static */ -wxSocketEventDispatcher& wxSocketEventDispatcher::Get() -{ - if ( !ms_instance ) - ms_instance = new wxSocketEventDispatcher; - return *ms_instance; -} - -wxSocketEventDispatcherEntry* wxSocketEventDispatcher::FindEntry(int fd) -{ - wxSocketEventDispatcherEntry* entry = - (wxSocketEventDispatcherEntry*) wxHashTable::Get(fd); - return entry; -} - -void -wxSocketEventDispatcher::RegisterCallback(int fd, - wxSocketEventDispatcherType socketType, - GSocket* socket) -{ - wxSocketEventDispatcherEntry* entry = FindEntry(fd); - if (!entry) - { - entry = new wxSocketEventDispatcherEntry(); - Put(fd, entry); - } - - if (socketType == wxSocketEventDispatcherInput) - entry->m_fdInput = fd; - else - entry->m_fdOutput = fd; - - entry->m_socket = socket; -} - -void -wxSocketEventDispatcher::UnregisterCallback(int fd, - wxSocketEventDispatcherType socketType) -{ - wxSocketEventDispatcherEntry* entry = FindEntry(fd); - if (entry) - { - if (socketType == wxSocketEventDispatcherInput) - entry->m_fdInput = -1; - else - entry->m_fdOutput = -1; - - if (entry->m_fdInput == -1 && entry->m_fdOutput == -1) - { - entry->m_socket = NULL; - Delete(fd); - delete entry; - } - } -} - -int wxSocketEventDispatcher::FillSets(fd_set* readset, fd_set* writeset) -{ - int max_fd = 0; - - wxFD_ZERO(readset); - wxFD_ZERO(writeset); - - BeginFind(); - wxHashTable::compatibility_iterator node = Next(); - while (node) - { - wxSocketEventDispatcherEntry* entry = - (wxSocketEventDispatcherEntry*) node->GetData(); - - if (entry->m_fdInput != -1) - { - wxFD_SET(entry->m_fdInput, readset); - if (entry->m_fdInput > max_fd) - max_fd = entry->m_fdInput; - } - - if (entry->m_fdOutput != -1) - { - wxFD_SET(entry->m_fdOutput, writeset); - if (entry->m_fdOutput > max_fd) - max_fd = entry->m_fdOutput; - } - - node = Next(); - } - - return max_fd; -} - -void wxSocketEventDispatcher::AddEvents(fd_set* readset, fd_set* writeset) -{ - BeginFind(); - wxHashTable::compatibility_iterator node = Next(); - while (node) - { - // We have to store the next node here, because the event processing can - // destroy the object before we call Next() - - wxHashTable::compatibility_iterator next_node = Next(); - - wxSocketEventDispatcherEntry* entry = - (wxSocketEventDispatcherEntry*) node->GetData(); - - wxCHECK_RET(entry->m_socket, wxT("Critical: Processing a NULL socket in wxSocketEventDispatcher")); - - if (entry->m_fdInput != -1 && wxFD_ISSET(entry->m_fdInput, readset)) - entry->m_socket->Detected_Read(); - - if (entry->m_fdOutput != -1 && wxFD_ISSET(entry->m_fdOutput, writeset)) - entry->m_socket->Detected_Write();; - - node = next_node; - } -} - -void wxSocketEventDispatcher::RunLoop(int timeout) -{ - struct timeval tv; - tv.tv_sec = 0; - tv.tv_usec = timeout; - fd_set readset; - fd_set writeset; - - int max_fd = FillSets( &readset, &writeset); - if (select( max_fd+1, &readset, &writeset, NULL, &tv ) == 0) - { - // No socket input/output. Don't add events. - return; - } - else - { - AddEvents(&readset, &writeset); - } -} - -// ---------------------------------------------------------------------------- -// wxSocketEventDispatcherModule -// ---------------------------------------------------------------------------- - -class wxSocketEventDispatcherModule: public wxModule -{ -public: - bool OnInit() { return true; } - void OnExit() { wxDELETE(wxSocketEventDispatcher::ms_instance); } - -private: - DECLARE_DYNAMIC_CLASS(wxSocketEventDispatcherModule) -}; - -IMPLEMENT_DYNAMIC_CLASS(wxSocketEventDispatcherModule, wxModule) - - -// ---------------------------------------------------------------------------- -// GSocket interface -// ---------------------------------------------------------------------------- - -bool GSocketGUIFunctionsTableConcrete::CanUseEventLoop() -{ - return true; -} - -bool GSocketGUIFunctionsTableConcrete::OnInit(void) -{ - return 1; -} - -void GSocketGUIFunctionsTableConcrete::OnExit(void) -{ -} - -bool GSocketGUIFunctionsTableConcrete::Init_Socket(GSocket *socket) -{ - int *m_id; - - socket->m_gui_dependent = (char *)malloc(sizeof(int)*2); - m_id = (int *)(socket->m_gui_dependent); - - m_id[0] = -1; - m_id[1] = -1; - - return true; -} - -void GSocketGUIFunctionsTableConcrete::Destroy_Socket(GSocket *socket) -{ - free(socket->m_gui_dependent); -} - -void GSocketGUIFunctionsTableConcrete::Install_Callback(GSocket *socket, - GSocketEvent event) -{ - int *m_id = (int *)(socket->m_gui_dependent); - int c; - - if (socket->m_fd == -1) - return; - - switch (event) - { - case GSOCK_LOST: /* fall-through */ - case GSOCK_INPUT: c = 0; break; - case GSOCK_OUTPUT: c = 1; break; - case GSOCK_CONNECTION: c = ((socket->m_server) ? 0 : 1); break; - default: return; - } - -#if 0 - if (m_id[c] != -1) - XtRemoveInput(m_id[c]); -#endif /* 0 */ - - if (c == 0) - { - m_id[0] = socket->m_fd; - - wxSocketEventDispatcher::Get().RegisterCallback( - socket->m_fd, wxSocketEventDispatcherInput, socket); - } - else - { - m_id[1] = socket->m_fd; - - wxSocketEventDispatcher::Get().RegisterCallback( - socket->m_fd, wxSocketEventDispatcherOutput, socket); - } -} - -void GSocketGUIFunctionsTableConcrete::Uninstall_Callback(GSocket *socket, - GSocketEvent event) -{ - int *m_id = (int *)(socket->m_gui_dependent); - int c; - - switch (event) - { - case GSOCK_LOST: /* fall-through */ - case GSOCK_INPUT: c = 0; break; - case GSOCK_OUTPUT: c = 1; break; - case GSOCK_CONNECTION: c = ((socket->m_server) ? 0 : 1); break; - default: return; - } - - if (m_id[c] != -1) - { - if (c == 0) - wxSocketEventDispatcher::Get().UnregisterCallback( - m_id[c], wxSocketEventDispatcherInput); - else - wxSocketEventDispatcher::Get().UnregisterCallback( - m_id[c], wxSocketEventDispatcherOutput); - } - - m_id[c] = -1; -} - -void GSocketGUIFunctionsTableConcrete::Enable_Events(GSocket *socket) -{ - Install_Callback(socket, GSOCK_INPUT); - Install_Callback(socket, GSOCK_OUTPUT); -} - -void GSocketGUIFunctionsTableConcrete::Disable_Events(GSocket *socket) -{ - Uninstall_Callback(socket, GSOCK_INPUT); - Uninstall_Callback(socket, GSOCK_OUTPUT); -} - -#endif // wxUSE_SOCKETS diff --git a/wxWidgets/src/common/srchcmn.cpp b/wxWidgets/src/common/srchcmn.cpp deleted file mode 100644 index 093577f5ca..0000000000 --- a/wxWidgets/src/common/srchcmn.cpp +++ /dev/null @@ -1,42 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/common/srchcmn.cpp -// Purpose: common (to all ports) bits of wxSearchCtrl -// Author: Robin Dunn -// Modified by: -// Created: 19-Dec-2006 -// RCS-ID: $Id: srchcmn.cpp 43939 2006-12-11 20:32:16Z KO $ -// Copyright: (c) wxWidgets team -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_SEARCHCTRL - -#include "wx/srchctrl.h" - -#ifndef WX_PRECOMP -#endif - -// ---------------------------------------------------------------------------- - -const wxChar wxSearchCtrlNameStr[] = wxT("searchCtrl"); - -DEFINE_EVENT_TYPE(wxEVT_COMMAND_SEARCHCTRL_CANCEL_BTN) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_SEARCHCTRL_SEARCH_BTN) - - -#endif // wxUSE_SEARCHCTRL diff --git a/wxWidgets/src/common/sstream.cpp b/wxWidgets/src/common/sstream.cpp deleted file mode 100644 index 3d792b1741..0000000000 --- a/wxWidgets/src/common/sstream.cpp +++ /dev/null @@ -1,235 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: common/sstream.cpp -// Purpose: string-based streams implementation -// Author: Vadim Zeitlin -// Modified by: Ryan Norton (UTF8 UNICODE) -// Created: 2004-09-19 -// RCS-ID: $Id: sstream.cpp 45772 2007-05-03 02:19:16Z VZ $ -// Copyright: (c) 2004 Vadim Zeitlin -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_STREAMS - -#include "wx/sstream.h" - -#if wxUSE_UNICODE - #include "wx/hashmap.h" -#endif - -// ============================================================================ -// wxStringInputStream implementation -// ============================================================================ - -// ---------------------------------------------------------------------------- -// construction/destruction -// ---------------------------------------------------------------------------- - -// TODO: Do we want to include the null char in the stream? If so then -// just add +1 to m_len in the ctor -wxStringInputStream::wxStringInputStream(const wxString& s) -#if wxUSE_UNICODE - : m_str(s), m_buf(wxMBConvUTF8().cWX2MB(s).release()), m_len(strlen(m_buf)) -#else - : m_str(s), m_buf((char*)s.c_str()), m_len(s.length()) -#endif -{ -#if wxUSE_UNICODE - wxASSERT_MSG(m_buf != NULL, _T("Could not convert string to UTF8!")); -#endif - m_pos = 0; -} - -wxStringInputStream::~wxStringInputStream() -{ -#if wxUSE_UNICODE - // Note: wx[W]CharBuffer uses malloc()/free() - free(m_buf); -#endif -} - -// ---------------------------------------------------------------------------- -// getlength -// ---------------------------------------------------------------------------- - -wxFileOffset wxStringInputStream::GetLength() const -{ - return m_len; -} - -// ---------------------------------------------------------------------------- -// seek/tell -// ---------------------------------------------------------------------------- - -wxFileOffset wxStringInputStream::OnSysSeek(wxFileOffset ofs, wxSeekMode mode) -{ - switch ( mode ) - { - case wxFromStart: - // nothing to do, ofs already ok - break; - - case wxFromEnd: - ofs += m_len; - break; - - case wxFromCurrent: - ofs += m_pos; - break; - - default: - wxFAIL_MSG( _T("invalid seek mode") ); - return wxInvalidOffset; - } - - if ( ofs < 0 || ofs > wx_static_cast(wxFileOffset, m_len) ) - return wxInvalidOffset; - - // FIXME: this can't be right - m_pos = wx_truncate_cast(size_t, ofs); - - return ofs; -} - -wxFileOffset wxStringInputStream::OnSysTell() const -{ - return wx_static_cast(wxFileOffset, m_pos); -} - -// ---------------------------------------------------------------------------- -// actual IO -// ---------------------------------------------------------------------------- - -size_t wxStringInputStream::OnSysRead(void *buffer, size_t size) -{ - const size_t sizeMax = m_len - m_pos; - - if ( size >= sizeMax ) - { - if ( sizeMax == 0 ) - { - m_lasterror = wxSTREAM_EOF; - return 0; - } - - size = sizeMax; - } - - memcpy(buffer, m_buf + m_pos, size); - m_pos += size; - - return size; -} - -// ============================================================================ -// wxStringOutputStream implementation -// ============================================================================ - -// ---------------------------------------------------------------------------- -// seek/tell -// ---------------------------------------------------------------------------- - -wxFileOffset wxStringOutputStream::OnSysTell() const -{ - return wx_static_cast(wxFileOffset, m_pos); -} - -// ---------------------------------------------------------------------------- -// actual IO -// ---------------------------------------------------------------------------- - -#if wxUSE_UNICODE - -// we can't add a member to wxStringOutputStream in 2.8 branch without breaking -// backwards binary compatibility, so we emulate it by using a hash indexed by -// wxStringOutputStream pointers - -// can't use wxCharBuffer as it has incorrect copying semantics and doesn't -// store the length which we need here -WX_DECLARE_VOIDPTR_HASH_MAP(wxMemoryBuffer, wxStringStreamUnconvBuffers); - -static wxStringStreamUnconvBuffers gs_unconverted; - -wxStringOutputStream::~wxStringOutputStream() -{ - // TODO: check that nothing remains (i.e. the unconverted buffer is empty)? - gs_unconverted.erase(this); -} - -#endif // wxUSE_UNICODE - -size_t wxStringOutputStream::OnSysWrite(const void *buffer, size_t size) -{ - const char *p = wx_static_cast(const char *, buffer); - -#if wxUSE_UNICODE - // the part of the string we have here may be incomplete, i.e. it can stop - // in the middle of an UTF-8 character and so converting it would fail; if - // this is the case, accumulate the part which we failed to convert until - // we get the rest (and also take into account the part which we might have - // left unconverted before) - const char *src; - size_t srcLen; - wxMemoryBuffer& unconv = gs_unconverted[this]; - if ( unconv.GetDataLen() ) - { - // append the new data to the data remaining since the last time - unconv.AppendData(p, size); - src = unconv; - srcLen = unconv.GetDataLen(); - } - else // no unconverted data left, avoid extra copy - { - src = p; - srcLen = size; - } - - wxWCharBuffer wbuf(m_conv.cMB2WC(src, srcLen, NULL /* out len */)); - if ( wbuf ) - { - // conversion succeeded, clear the unconverted buffer - unconv = wxMemoryBuffer(0); - - *m_str += wbuf; - } - else // conversion failed - { - // remember unconverted data if there had been none before (otherwise - // we've already got it in the buffer) - if ( src == p ) - unconv.AppendData(src, srcLen); - - // pretend that we wrote the data anyhow, otherwise the caller would - // believe there was an error and this might not be the case, but do - // not update m_pos as m_str hasn't changed - return size; - } -#else // !wxUSE_UNICODE - // append directly, no conversion necessary - m_str->Append(wxString(p, size)); -#endif // wxUSE_UNICODE/!wxUSE_UNICODE - - // update position - m_pos += size; - - // return number of bytes actually written - return size; -} - -#endif // wxUSE_STREAMS - diff --git a/wxWidgets/src/common/statbar.cpp b/wxWidgets/src/common/statbar.cpp deleted file mode 100644 index 82de44f332..0000000000 --- a/wxWidgets/src/common/statbar.cpp +++ /dev/null @@ -1,368 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: src/common/statbar.cpp -// Purpose: wxStatusBarBase implementation -// Author: Vadim Zeitlin -// Modified by: -// Created: 14.10.01 -// RCS-ID: $Id: statbar.cpp 42171 2006-10-20 14:54:14Z VS $ -// Copyright: (c) 2001 Vadim Zeitlin -// License: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_STATUSBAR - -#include "wx/statusbr.h" - -#ifndef WX_PRECOMP - #include "wx/frame.h" -#endif //WX_PRECOMP - -#include "wx/listimpl.cpp" -WX_DEFINE_LIST(wxListString) - -const wxChar wxStatusBarNameStr[] = wxT("statusBar"); - -// ============================================================================ -// wxStatusBarBase implementation -// ============================================================================ - -IMPLEMENT_DYNAMIC_CLASS(wxStatusBar, wxWindow) - -// ---------------------------------------------------------------------------- -// ctor/dtor -// ---------------------------------------------------------------------------- - -wxStatusBarBase::wxStatusBarBase() -{ - m_nFields = 0; - - InitWidths(); - InitStacks(); - InitStyles(); -} - -wxStatusBarBase::~wxStatusBarBase() -{ - FreeWidths(); - FreeStacks(); - FreeStyles(); - - // notify the frame that it doesn't have a status bar any longer to avoid - // dangling pointers - wxFrame *frame = wxDynamicCast(GetParent(), wxFrame); - if ( frame && frame->GetStatusBar() == this ) - { - frame->SetStatusBar(NULL); - } -} - -// ---------------------------------------------------------------------------- -// widths array handling -// ---------------------------------------------------------------------------- - -void wxStatusBarBase::InitWidths() -{ - m_statusWidths = NULL; -} - -void wxStatusBarBase::FreeWidths() -{ - delete [] m_statusWidths; -} - -// ---------------------------------------------------------------------------- -// styles array handling -// ---------------------------------------------------------------------------- - -void wxStatusBarBase::InitStyles() -{ - m_statusStyles = NULL; -} - -void wxStatusBarBase::FreeStyles() -{ - delete [] m_statusStyles; -} - -// ---------------------------------------------------------------------------- -// field widths -// ---------------------------------------------------------------------------- - -void wxStatusBarBase::SetFieldsCount(int number, const int *widths) -{ - wxCHECK_RET( number > 0, _T("invalid field number in SetFieldsCount") ); - - bool refresh = false; - - if ( number != m_nFields ) - { - // copy stacks if present - if(m_statusTextStacks) - { - wxListString **newStacks = new wxListString*[number]; - size_t i, j, max = wxMin(number, m_nFields); - - // copy old stacks - for(i = 0; i < max; ++i) - newStacks[i] = m_statusTextStacks[i]; - // free old stacks in excess - for(j = i; j < (size_t)m_nFields; ++j) - { - if(m_statusTextStacks[j]) - { - m_statusTextStacks[j]->Clear(); - delete m_statusTextStacks[j]; - } - } - // initialize new stacks to NULL - for(j = i; j < (size_t)number; ++j) - newStacks[j] = 0; - - m_statusTextStacks = newStacks; - } - - // Resize styles array - if (m_statusStyles) - { - int *oldStyles = m_statusStyles; - m_statusStyles = new int[number]; - int i, max = wxMin(number, m_nFields); - - // copy old styles - for (i = 0; i < max; ++i) - m_statusStyles[i] = oldStyles[i]; - - // initialize new styles to wxSB_NORMAL - for (i = max; i < number; ++i) - m_statusStyles[i] = wxSB_NORMAL; - - // free old styles - delete [] oldStyles; - } - - - m_nFields = number; - - ReinitWidths(); - - refresh = true; - } - //else: keep the old m_statusWidths if we had them - - if ( widths ) - { - SetStatusWidths(number, widths); - - // already done from SetStatusWidths() - refresh = false; - } - - if ( refresh ) - Refresh(); -} - -void wxStatusBarBase::SetStatusWidths(int WXUNUSED_UNLESS_DEBUG(n), - const int widths[]) -{ - wxCHECK_RET( widths, _T("NULL pointer in SetStatusWidths") ); - - wxASSERT_MSG( n == m_nFields, _T("field number mismatch") ); - - if ( !m_statusWidths ) - m_statusWidths = new int[m_nFields]; - - for ( int i = 0; i < m_nFields; i++ ) - { - m_statusWidths[i] = widths[i]; - } - - // update the display after the widths changed - Refresh(); -} - -void wxStatusBarBase::SetStatusStyles(int WXUNUSED_UNLESS_DEBUG(n), - const int styles[]) -{ - wxCHECK_RET( styles, _T("NULL pointer in SetStatusStyles") ); - - wxASSERT_MSG( n == m_nFields, _T("field number mismatch") ); - - if ( !m_statusStyles ) - m_statusStyles = new int[m_nFields]; - - for ( int i = 0; i < m_nFields; i++ ) - { - m_statusStyles[i] = styles[i]; - } - - // update the display after the widths changed - Refresh(); -} - -wxArrayInt wxStatusBarBase::CalculateAbsWidths(wxCoord widthTotal) const -{ - wxArrayInt widths; - - if ( m_statusWidths == NULL ) - { - if ( m_nFields ) - { - // Default: all fields have the same width. This is not always - // possible to do exactly (if widthTotal is not divisible by - // m_nFields) - if that happens, we distribute the extra pixels - // among all fields: - int widthToUse = widthTotal; - - for ( int i = m_nFields; i > 0; i-- ) - { - // divide the unassigned width evently between the - // not yet processed fields: - int w = widthToUse / i; - widths.Add(w); - widthToUse -= w; - } - - } - //else: we're empty anyhow - } - else // have explicit status widths - { - // calculate the total width of all the fixed width fields and the - // total number of var field widths counting with multiplicity - int nTotalWidth = 0, - nVarCount = 0, - i; - for ( i = 0; i < m_nFields; i++ ) - { - if ( m_statusWidths[i] >= 0 ) - { - nTotalWidth += m_statusWidths[i]; - } - else - { - nVarCount += -m_statusWidths[i]; - } - } - - // the amount of extra width we have per each var width field - int widthExtra = widthTotal - nTotalWidth; - - // do fill the array - for ( i = 0; i < m_nFields; i++ ) - { - if ( m_statusWidths[i] >= 0 ) - { - widths.Add(m_statusWidths[i]); - } - else - { - int nVarWidth = widthExtra > 0 ? (widthExtra * -m_statusWidths[i]) / nVarCount : 0; - nVarCount += m_statusWidths[i]; - widthExtra -= nVarWidth; - widths.Add(nVarWidth); - } - } - } - - return widths; -} - -// ---------------------------------------------------------------------------- -// text stacks handling -// ---------------------------------------------------------------------------- - -void wxStatusBarBase::InitStacks() -{ - m_statusTextStacks = NULL; -} - -void wxStatusBarBase::FreeStacks() -{ - if ( !m_statusTextStacks ) - return; - - for ( size_t i = 0; i < (size_t)m_nFields; ++i ) - { - if ( m_statusTextStacks[i] ) - { - wxListString& t = *m_statusTextStacks[i]; - WX_CLEAR_LIST(wxListString, t); - delete m_statusTextStacks[i]; - } - } - - delete[] m_statusTextStacks; -} - -// ---------------------------------------------------------------------------- -// text stacks -// ---------------------------------------------------------------------------- - -void wxStatusBarBase::PushStatusText(const wxString& text, int number) -{ - wxListString* st = GetOrCreateStatusStack(number); - // This long-winded way around avoids an internal compiler error - // in VC++ 6 with RTTI enabled - wxString tmp1(GetStatusText(number)); - wxString* tmp = new wxString(tmp1); - st->Insert(tmp); - SetStatusText(text, number); -} - -void wxStatusBarBase::PopStatusText(int number) -{ - wxListString *st = GetStatusStack(number); - wxCHECK_RET( st, _T("Unbalanced PushStatusText/PopStatusText") ); - wxListString::compatibility_iterator top = st->GetFirst(); - - SetStatusText(*top->GetData(), number); - delete top->GetData(); - st->Erase(top); - if(st->GetCount() == 0) - { - delete st; - m_statusTextStacks[number] = 0; - } -} - -wxListString *wxStatusBarBase::GetStatusStack(int i) const -{ - if(!m_statusTextStacks) - return 0; - return m_statusTextStacks[i]; -} - -wxListString *wxStatusBarBase::GetOrCreateStatusStack(int i) -{ - if(!m_statusTextStacks) - { - m_statusTextStacks = new wxListString*[m_nFields]; - - size_t j; - for(j = 0; j < (size_t)m_nFields; ++j) m_statusTextStacks[j] = 0; - } - - if(!m_statusTextStacks[i]) - { - m_statusTextStacks[i] = new wxListString(); - } - - return m_statusTextStacks[i]; -} - -#endif // wxUSE_STATUSBAR diff --git a/wxWidgets/src/common/stdpbase.cpp b/wxWidgets/src/common/stdpbase.cpp deleted file mode 100644 index f2d4ff6b02..0000000000 --- a/wxWidgets/src/common/stdpbase.cpp +++ /dev/null @@ -1,172 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: common/stdpbase.cpp -// Purpose: wxStandardPathsBase methods common to all ports -// Author: Vadim Zeitlin -// Modified by: -// Created: 2004-10-19 -// RCS-ID: $Id: stdpbase.cpp 53093 2008-04-08 13:51:17Z JS $ -// Copyright: (c) 2004 Vadim Zeitlin -// License: wxWindows license -/////////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -// for compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_STDPATHS - -#ifndef WX_PRECOMP - #include "wx/app.h" -#endif //WX_PRECOMP -#include "wx/apptrait.h" - -#include "wx/filename.h" -#include "wx/stdpaths.h" - -#if defined(__UNIX__) && !defined(__WXMAC__) -#include "wx/log.h" -#include "wx/textfile.h" -#endif - -// ---------------------------------------------------------------------------- -// module globals -// ---------------------------------------------------------------------------- - -static wxStandardPaths gs_stdPaths; - -// ============================================================================ -// implementation -// ============================================================================ - -/* static */ -wxStandardPathsBase& wxStandardPathsBase::Get() -{ - wxAppTraits * const traits = wxTheApp ? wxTheApp->GetTraits() : NULL; - wxCHECK_MSG( traits, gs_stdPaths, _T("create wxApp before calling this") ); - - return traits->GetStandardPaths(); -} - -wxString wxStandardPathsBase::GetExecutablePath() const -{ - if ( !wxTheApp || !wxTheApp->argv ) - return wxEmptyString; - - wxString argv0 = wxTheApp->argv[0]; - if (wxIsAbsolutePath(argv0)) - return argv0; - - // Search PATH.environment variable... - wxPathList pathlist; - pathlist.AddEnvList(wxT("PATH")); - wxString path = pathlist.FindAbsoluteValidPath(argv0); - if ( path.empty() ) - return argv0; // better than nothing - - wxFileName filename(path); - filename.Normalize(); - return filename.GetFullPath(); -} - -wxStandardPathsBase& wxAppTraitsBase::GetStandardPaths() -{ - return gs_stdPaths; -} - -wxStandardPathsBase::~wxStandardPathsBase() -{ - // nothing to do here -} - -wxString wxStandardPathsBase::GetLocalDataDir() const -{ - return GetDataDir(); -} - -wxString wxStandardPathsBase::GetUserLocalDataDir() const -{ - return GetUserDataDir(); -} - -wxString wxStandardPathsBase::GetDocumentsDir() const -{ -#if defined(__UNIX__) && !defined(__WXMAC__) - { - wxLogNull logNull; - wxString homeDir = wxFileName::GetHomeDir(); - wxString configPath; - if (wxGetenv(wxT("XDG_CONFIG_HOME"))) - configPath = wxGetenv(wxT("XDG_CONFIG_HOME")); - else - configPath = homeDir + wxT("/.config"); - wxString dirsFile = configPath + wxT("/user-dirs.dirs"); - if (wxFileExists(dirsFile)) - { - wxTextFile textFile; - if (textFile.Open(dirsFile)) - { - size_t i; - for (i = 0; i < textFile.GetLineCount(); i++) - { - wxString line(textFile[i]); - int pos = line.Find(wxT("XDG_DOCUMENTS_DIR")); - if (pos != wxNOT_FOUND) - { - wxString value = line.AfterFirst(wxT('=')); - value.Replace(wxT("$HOME"), homeDir); - value.Trim(true); - value.Trim(false); - if (!value.IsEmpty() && wxDirExists(value)) - return value; - else - break; - } - } - } - } - } -#endif - - return wxFileName::GetHomeDir(); -} - -// return the temporary directory for the current user -wxString wxStandardPathsBase::GetTempDir() const -{ - return wxFileName::GetTempDir(); -} - -/* static */ -wxString wxStandardPathsBase::AppendAppName(const wxString& dir) -{ - wxString subdir(dir); - - // empty string indicates that an error has occurred, don't touch it then - if ( !subdir.empty() ) - { - const wxString appname = wxTheApp->GetAppName(); - if ( !appname.empty() ) - { - const wxChar ch = *(subdir.end() - 1); - if ( !wxFileName::IsPathSeparator(ch) && ch != _T('.') ) - subdir += wxFileName::GetPathSeparator(); - - subdir += appname; - } - } - - return subdir; -} - -#endif // wxUSE_STDPATHS diff --git a/wxWidgets/src/common/stockitem.cpp b/wxWidgets/src/common/stockitem.cpp deleted file mode 100644 index 8c1cd480b9..0000000000 --- a/wxWidgets/src/common/stockitem.cpp +++ /dev/null @@ -1,278 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: src/common/stockitem.cpp -// Purpose: Stock buttons, menu and toolbar items labels -// Author: Vaclav Slavik -// Modified by: -// Created: 2004-08-15 -// RCS-ID: $Id: stockitem.cpp 58617 2009-02-02 05:12:43Z SC $ -// Copyright: (c) Vaclav Slavik, 2004 -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#include "wx/stockitem.h" - -#ifndef WX_PRECOMP - #include "wx/intl.h" - #include "wx/utils.h" // for wxStripMenuCodes() -#endif - -bool wxIsStockID(wxWindowID id) -{ - switch (id) - { - case wxID_ABOUT: - case wxID_ADD: - case wxID_APPLY: - case wxID_BOLD: - case wxID_CANCEL: - case wxID_CLEAR: - case wxID_CLOSE: - case wxID_COPY: - case wxID_CUT: - case wxID_DELETE: - case wxID_EDIT: - case wxID_FIND: - case wxID_FILE: - case wxID_REPLACE: - case wxID_BACKWARD: - case wxID_DOWN: - case wxID_FORWARD: - case wxID_UP: - case wxID_HELP: - case wxID_HOME: - case wxID_INDENT: - case wxID_INDEX: - case wxID_ITALIC: - case wxID_JUSTIFY_CENTER: - case wxID_JUSTIFY_FILL: - case wxID_JUSTIFY_LEFT: - case wxID_JUSTIFY_RIGHT: - case wxID_NEW: - case wxID_NO: - case wxID_OK: - case wxID_OPEN: - case wxID_PASTE: - case wxID_PREFERENCES: - case wxID_PRINT: - case wxID_PREVIEW: - case wxID_PROPERTIES: - case wxID_EXIT: - case wxID_REDO: - case wxID_REFRESH: - case wxID_REMOVE: - case wxID_REVERT_TO_SAVED: - case wxID_SAVE: - case wxID_SAVEAS: - case wxID_SELECTALL: - case wxID_STOP: - case wxID_UNDELETE: - case wxID_UNDERLINE: - case wxID_UNDO: - case wxID_UNINDENT: - case wxID_YES: - case wxID_ZOOM_100: - case wxID_ZOOM_FIT: - case wxID_ZOOM_IN: - case wxID_ZOOM_OUT: - return true; - - default: - return false; - } -} - -wxString wxGetStockLabel(wxWindowID id, long flags) -{ - wxString stockLabel; - - #define STOCKITEM(stockid, label) \ - case stockid: \ - stockLabel = label; \ - break; - - switch (id) - { - STOCKITEM(wxID_ABOUT, _("&About")) - STOCKITEM(wxID_ADD, _("Add")) - STOCKITEM(wxID_APPLY, _("&Apply")) - STOCKITEM(wxID_BOLD, _("&Bold")) - STOCKITEM(wxID_CANCEL, _("&Cancel")) - STOCKITEM(wxID_CLEAR, _("&Clear")) - STOCKITEM(wxID_CLOSE, _("&Close")) - STOCKITEM(wxID_COPY, _("&Copy")) - STOCKITEM(wxID_CUT, _("Cu&t")) - STOCKITEM(wxID_DELETE, _("&Delete")) - STOCKITEM(wxID_EDIT, _("&Edit")) - STOCKITEM(wxID_FIND, _("&Find")) - STOCKITEM(wxID_FILE, _("&File")) - STOCKITEM(wxID_REPLACE, _("Rep&lace")) - STOCKITEM(wxID_BACKWARD, _("&Back")) - STOCKITEM(wxID_DOWN, _("&Down")) - STOCKITEM(wxID_FORWARD, _("&Forward")) - STOCKITEM(wxID_UP, _("&Up")) - STOCKITEM(wxID_HELP, _("&Help")) - STOCKITEM(wxID_HOME, _("&Home")) - STOCKITEM(wxID_INDENT, _("Indent")) - STOCKITEM(wxID_INDEX, _("&Index")) - STOCKITEM(wxID_ITALIC, _("&Italic")) - STOCKITEM(wxID_JUSTIFY_CENTER, _("Centered")) - STOCKITEM(wxID_JUSTIFY_FILL, _("Justified")) - STOCKITEM(wxID_JUSTIFY_LEFT, _("Align Left")) - STOCKITEM(wxID_JUSTIFY_RIGHT, _("Align Right")) - STOCKITEM(wxID_NEW, _("&New")) - STOCKITEM(wxID_NO, _("&No")) - STOCKITEM(wxID_OK, _("&OK")) - STOCKITEM(wxID_OPEN, _("&Open")) - STOCKITEM(wxID_PASTE, _("&Paste")) - STOCKITEM(wxID_PREFERENCES, _("&Preferences")) - STOCKITEM(wxID_PRINT, _("&Print")) - STOCKITEM(wxID_PREVIEW, _("Print previe&w")) - STOCKITEM(wxID_PROPERTIES, _("&Properties")) - STOCKITEM(wxID_EXIT, _("&Quit")) - STOCKITEM(wxID_REDO, _("&Redo")) - STOCKITEM(wxID_REFRESH, _("Refresh")) - STOCKITEM(wxID_REMOVE, _("Remove")) - STOCKITEM(wxID_REVERT_TO_SAVED, _("Revert to Saved")) - STOCKITEM(wxID_SAVE, _("&Save")) - STOCKITEM(wxID_SAVEAS, _("Save &As...")) - STOCKITEM(wxID_SELECTALL, _("Select all")) - STOCKITEM(wxID_STOP, _("&Stop")) - STOCKITEM(wxID_UNDELETE, _("Undelete")) - STOCKITEM(wxID_UNDERLINE, _("&Underline")) - STOCKITEM(wxID_UNDO, _("&Undo")) - STOCKITEM(wxID_UNINDENT, _("&Unindent")) - STOCKITEM(wxID_YES, _("&Yes")) - STOCKITEM(wxID_ZOOM_100, _("&Actual Size")) - STOCKITEM(wxID_ZOOM_FIT, _("Zoom to &Fit")) - STOCKITEM(wxID_ZOOM_IN, _("Zoom &In")) - STOCKITEM(wxID_ZOOM_OUT, _("Zoom &Out")) - - default: - wxFAIL_MSG( _T("invalid stock item ID") ); - break; - }; - - #undef STOCKITEM - - if ( !(flags & wxSTOCK_WITH_MNEMONIC) ) - { - stockLabel = wxStripMenuCodes(stockLabel); - } - -#if wxUSE_ACCEL - if ( !stockLabel.empty() && (flags & wxSTOCK_WITH_ACCELERATOR) ) - { - wxAcceleratorEntry accel = wxGetStockAccelerator(id); - if (accel.IsOk()) - stockLabel << _T('\t') << accel.ToString(); - } -#endif // wxUSE_ACCEL - - return stockLabel; -} - -wxString wxGetStockHelpString(wxWindowID id, wxStockHelpStringClient client) -{ - wxString stockHelp; - - #define STOCKITEM(stockid, ctx, helpstr) \ - case stockid: \ - if (client==ctx) stockHelp = helpstr; \ - break; - - switch (id) - { - // NB: these help string should be not too specific as they could be used - // in completely different programs! - STOCKITEM(wxID_ABOUT, wxSTOCK_MENU, _("Show about dialog")) - STOCKITEM(wxID_COPY, wxSTOCK_MENU, _("Copy selection")) - STOCKITEM(wxID_CUT, wxSTOCK_MENU, _("Cut selection")) - STOCKITEM(wxID_DELETE, wxSTOCK_MENU, _("Delete selection")) - STOCKITEM(wxID_REPLACE, wxSTOCK_MENU, _("Replace selection")) - STOCKITEM(wxID_PASTE, wxSTOCK_MENU, _("Paste selection")) - STOCKITEM(wxID_EXIT, wxSTOCK_MENU, _("Quit this program")) - STOCKITEM(wxID_REDO, wxSTOCK_MENU, _("Redo last action")) - STOCKITEM(wxID_UNDO, wxSTOCK_MENU, _("Undo last action")) - STOCKITEM(wxID_CLOSE, wxSTOCK_MENU, _("Close current document")) - STOCKITEM(wxID_SAVE, wxSTOCK_MENU, _("Save current document")) - STOCKITEM(wxID_SAVEAS, wxSTOCK_MENU, _("Save current document with a different filename")) - - default: - // there's no stock help string for this ID / client - return wxEmptyString; - } - - #undef STOCKITEM - - return stockHelp; -} - -#if wxUSE_ACCEL - -wxAcceleratorEntry wxGetStockAccelerator(wxWindowID id) -{ - wxAcceleratorEntry ret; - - #define STOCKITEM(stockid, flags, keycode) \ - case stockid: \ - ret.Set(flags, keycode, stockid); \ - break; - - switch (id) - { - STOCKITEM(wxID_COPY, wxACCEL_CMD,'C') - STOCKITEM(wxID_CUT, wxACCEL_CMD,'X') - STOCKITEM(wxID_FIND, wxACCEL_CMD,'F') - STOCKITEM(wxID_REPLACE, wxACCEL_CMD,'R') - STOCKITEM(wxID_HELP, wxACCEL_CMD,'H') - STOCKITEM(wxID_NEW, wxACCEL_CMD,'N') - STOCKITEM(wxID_OPEN, wxACCEL_CMD,'O') - STOCKITEM(wxID_PASTE, wxACCEL_CMD,'V') - STOCKITEM(wxID_SAVE, wxACCEL_CMD,'S') - - default: - // set the wxAcceleratorEntry to return into an invalid state: - // there's no stock accelerator for that. - ret.Set(0, 0, id); - break; - }; - - #undef STOCKITEM - - // always use wxAcceleratorEntry::IsOk on returned value ! - return ret; -} - -#endif // wxUSE_ACCEL - -bool wxIsStockLabel(wxWindowID id, const wxString& label) -{ - if (label.empty()) - return true; - - wxString stock = wxGetStockLabel(id); - - if (label == stock) - return true; - - stock.Replace(_T("&"), wxEmptyString); - if (label == stock) - return true; - - return false; -} diff --git a/wxWidgets/src/common/stopwatch.cpp b/wxWidgets/src/common/stopwatch.cpp deleted file mode 100644 index eefbae7e91..0000000000 --- a/wxWidgets/src/common/stopwatch.cpp +++ /dev/null @@ -1,372 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: src/common/stopwatch.cpp -// Purpose: wxStopWatch and other non-GUI stuff from wx/timer.h -// Author: -// Original version by Julian Smart -// Vadim Zeitlin got rid of all ifdefs (11.12.99) -// Sylvain Bougnoux added wxStopWatch class -// Guillermo Rodriguez rewrote from scratch (Dic/99) -// Modified by: -// Created: 20.06.2003 (extracted from common/timercmn.cpp) -// RCS-ID: $Id: stopwatch.cpp 41054 2006-09-07 19:01:45Z ABX $ -// Copyright: (c) 1998-2003 wxWidgets Team -// License: wxWindows license -/////////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -// for compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#include "wx/stopwatch.h" - -#ifndef WX_PRECOMP - #ifdef __WXMSW__ - #include "wx/msw/wrapwin.h" - #endif - #include "wx/intl.h" - #include "wx/log.h" -#endif //WX_PRECOMP - -// ---------------------------------------------------------------------------- -// System headers -// ---------------------------------------------------------------------------- - -#if defined(__WIN32__) && !defined(HAVE_FTIME) && !defined(__MWERKS__) && !defined(__WXWINCE__) - #define HAVE_FTIME -#endif - -#if defined(__VISAGECPP__) && !defined(HAVE_FTIME) - #define HAVE_FTIME -# if __IBMCPP__ >= 400 - # define ftime(x) _ftime(x) -# endif -#endif - -#if defined(__MWERKS__) && defined(__WXMSW__) -# undef HAVE_FTIME -# undef HAVE_GETTIMEOFDAY -#endif - -#ifndef __WXWINCE__ -#include -#else -#include "wx/msw/private.h" -#include "wx/msw/wince/time.h" -#endif - -#if !defined(__WXMAC__) && !defined(__WXWINCE__) - #include // for time_t -#endif - -#if defined(HAVE_GETTIMEOFDAY) - #include - #include -#elif defined(HAVE_FTIME) - #include -#endif - -#ifdef __WXMAC__ -#ifndef __DARWIN__ - #include - #include -#else - #include -#endif -#endif - -#ifdef __WXPALMOS__ - #include - #include - #include -#endif - -// ---------------------------------------------------------------------------- -// macros -// ---------------------------------------------------------------------------- - -// on some really old systems gettimeofday() doesn't have the second argument, -// define wxGetTimeOfDay() to hide this difference -#ifdef HAVE_GETTIMEOFDAY - #ifdef WX_GETTIMEOFDAY_NO_TZ - struct timezone; - #define wxGetTimeOfDay(tv, tz) gettimeofday(tv) - #else - #define wxGetTimeOfDay(tv, tz) gettimeofday((tv), (tz)) - #endif -#endif // HAVE_GETTIMEOFDAY - -// ============================================================================ -// implementation -// ============================================================================ - -// ---------------------------------------------------------------------------- -// wxStopWatch -// ---------------------------------------------------------------------------- - -#if wxUSE_STOPWATCH - -void wxStopWatch::Start(long t) -{ -#if 0 -// __WXMSW__ - LARGE_INTEGER frequency_li; - ::QueryPerformanceFrequency( &frequency_li ); - m_frequency = frequency_li.QuadPart; - if (m_frequency == 0) - { - m_t0 = wxGetLocalTimeMillis() - t; - } - else - { - LARGE_INTEGER counter_li; - ::QueryPerformanceCounter( &counter_li ); - wxLongLong counter = counter_li.QuadPart; - m_t0 = (counter * 10000 / m_frequency) - t*10; - } -#else - m_t0 = wxGetLocalTimeMillis() - t; -#endif - m_pause = 0; - m_pauseCount = 0; -} - -long wxStopWatch::GetElapsedTime() const -{ -#if 0 -//__WXMSW__ - if (m_frequency == 0) - { - return (wxGetLocalTimeMillis() - m_t0).GetLo(); - } - else - { - LARGE_INTEGER counter_li; - ::QueryPerformanceCounter( &counter_li ); - wxLongLong counter = counter_li.QuadPart; - wxLongLong res = (counter * 10000 / m_frequency) - m_t0; - return res.GetLo() / 10; - } -#else - return (wxGetLocalTimeMillis() - m_t0).GetLo(); -#endif -} - -long wxStopWatch::Time() const -{ - return m_pauseCount ? m_pause : GetElapsedTime(); -} - -#endif // wxUSE_STOPWATCH - -// ---------------------------------------------------------------------------- -// old timer functions superceded by wxStopWatch -// ---------------------------------------------------------------------------- - -#if wxUSE_LONGLONG - -static wxLongLong wxStartTime = 0l; - -// starts the global timer -void wxStartTimer() -{ - wxStartTime = wxGetLocalTimeMillis(); -} - -// Returns elapsed time in milliseconds -long wxGetElapsedTime(bool resetTimer) -{ - wxLongLong oldTime = wxStartTime; - wxLongLong newTime = wxGetLocalTimeMillis(); - - if ( resetTimer ) - wxStartTime = newTime; - - return (newTime - oldTime).GetLo(); -} - -#endif // wxUSE_LONGLONG - -// ---------------------------------------------------------------------------- -// the functions to get the current time and timezone info -// ---------------------------------------------------------------------------- - -// Get local time as seconds since 00:00:00, Jan 1st 1970 -long wxGetLocalTime() -{ - struct tm tm; - time_t t0, t1; - - // This cannot be made static because mktime can overwrite it. - // - memset(&tm, 0, sizeof(tm)); - tm.tm_year = 70; - tm.tm_mon = 0; - tm.tm_mday = 5; // not Jan 1st 1970 due to mktime 'feature' - tm.tm_hour = 0; - tm.tm_min = 0; - tm.tm_sec = 0; - tm.tm_isdst = -1; // let mktime guess - - // Note that mktime assumes that the struct tm contains local time. - // - t1 = time(&t1); // now - t0 = mktime(&tm); // origin - - // Return the difference in seconds. - // - if (( t0 != (time_t)-1 ) && ( t1 != (time_t)-1 )) - return (long)difftime(t1, t0) + (60 * 60 * 24 * 4); - - wxLogSysError(_("Failed to get the local system time")); - return -1; -} - -// Get UTC time as seconds since 00:00:00, Jan 1st 1970 -long wxGetUTCTime() -{ - return (long)time(NULL); -} - -#if wxUSE_LONGLONG - -// Get local time as milliseconds since 00:00:00, Jan 1st 1970 -wxLongLong wxGetLocalTimeMillis() -{ - wxLongLong val = 1000l; - - // If possible, use a function which avoids conversions from - // broken-up time structures to milliseconds - -#if defined(__WXPALMOS__) - DateTimeType thenst; - thenst.second = 0; - thenst.minute = 0; - thenst.hour = 0; - thenst.day = 1; - thenst.month = 1; - thenst.year = 1970; - thenst.weekDay = 5; - uint32_t now = TimGetSeconds(); - uint32_t then = TimDateTimeToSeconds (&thenst); - return SysTimeToMilliSecs(SysTimeInSecs(now - then)); -#elif defined(__WXMSW__) && (defined(__WINE__) || defined(__MWERKS__)) - // This should probably be the way all WXMSW compilers should do it - // Go direct to the OS for time - - SYSTEMTIME thenst = { 1970, 1, 4, 1, 0, 0, 0, 0 }; // 00:00:00 Jan 1st 1970 - FILETIME thenft; - SystemTimeToFileTime( &thenst, &thenft ); - wxLongLong then( thenft.dwHighDateTime, thenft.dwLowDateTime ); // time in 100 nanoseconds - - SYSTEMTIME nowst; - GetLocalTime( &nowst ); - FILETIME nowft; - SystemTimeToFileTime( &nowst, &nowft ); - wxLongLong now( nowft.dwHighDateTime, nowft.dwLowDateTime ); // time in 100 nanoseconds - - return ( now - then ) / 10000.0; // time from 00:00:00 Jan 1st 1970 to now in milliseconds - -#elif defined(HAVE_GETTIMEOFDAY) - struct timeval tp; - if ( wxGetTimeOfDay(&tp, (struct timezone *)NULL) != -1 ) - { - val *= tp.tv_sec; - return (val + (tp.tv_usec / 1000)); - } - else - { - wxLogError(_("wxGetTimeOfDay failed.")); - return 0; - } -#elif defined(HAVE_FTIME) - struct timeb tp; - - // ftime() is void and not int in some mingw32 headers, so don't - // test the return code (well, it shouldn't fail anyhow...) - (void)::ftime(&tp); - val *= tp.time; - return (val + tp.millitm); -#elif defined(__WXMAC__) - - static UInt64 gMilliAtStart = 0; - - Nanoseconds upTime = AbsoluteToNanoseconds( UpTime() ); - - if ( gMilliAtStart == 0 ) - { - time_t start = time(NULL); - gMilliAtStart = ((UInt64) start) * 1000000L; - gMilliAtStart -= upTime.lo / 1000 ; - gMilliAtStart -= ( ( (UInt64) upTime.hi ) << 32 ) / (1000 * 1000); - } - - UInt64 millival = gMilliAtStart; - millival += upTime.lo / (1000 * 1000); - millival += ( ( (UInt64) upTime.hi ) << 32 ) / (1000 * 1000); - val = millival; - - return val; -#else // no gettimeofday() nor ftime() - // We use wxGetLocalTime() to get the seconds since - // 00:00:00 Jan 1st 1970 and then whatever is available - // to get millisecond resolution. - // - // NOTE that this might lead to a problem if the clocks - // use different sources, so this approach should be - // avoided where possible. - - val *= wxGetLocalTime(); - -// GRG: This will go soon as all WIN32 seem to have ftime -// JACS: unfortunately not. WinCE doesn't have it. -#if defined (__WIN32__) - // If your platform/compiler needs to use two different functions - // to get ms resolution, please do NOT just shut off these warnings, - // drop me a line instead at - - // FIXME -#ifndef __WXWINCE__ - #warning "Possible clock skew bug in wxGetLocalTimeMillis()!" -#endif - - SYSTEMTIME st; - ::GetLocalTime(&st); - val += st.wMilliseconds; -#else // !Win32 - // If your platform/compiler does not support ms resolution please - // do NOT just shut off these warnings, drop me a line instead at - // - - #if defined(__VISUALC__) || defined (__WATCOMC__) - #pragma message("wxStopWatch will be up to second resolution!") - #elif defined(__BORLANDC__) - #pragma message "wxStopWatch will be up to second resolution!" - #else - #warning "wxStopWatch will be up to second resolution!" - #endif // compiler -#endif - - return val; - -#endif // time functions -} - -#else // !wxUSE_LONGLONG - -double wxGetLocalTimeMillis(void) -{ - return (double(clock()) / double(CLOCKS_PER_SEC)) * 1000.0; -} - -#endif // wxUSE_LONGLONG/!wxUSE_LONGLONG diff --git a/wxWidgets/src/common/strconv.cpp b/wxWidgets/src/common/strconv.cpp deleted file mode 100644 index 102462916c..0000000000 --- a/wxWidgets/src/common/strconv.cpp +++ /dev/null @@ -1,3742 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/common/strconv.cpp -// Purpose: Unicode conversion classes -// Author: Ove Kaaven, Robert Roebling, Vadim Zeitlin, Vaclav Slavik, -// Ryan Norton, Fredrik Roubert (UTF7) -// Modified by: -// Created: 29/01/98 -// RCS-ID: $Id: strconv.cpp 64156 2010-04-27 08:52:30Z VZ $ -// Copyright: (c) 1999 Ove Kaaven, Robert Roebling, Vaclav Slavik -// (c) 2000-2003 Vadim Zeitlin -// (c) 2004 Ryan Norton, Fredrik Roubert -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifndef WX_PRECOMP - #ifdef __WXMSW__ - #include "wx/msw/missing.h" - #endif - #include "wx/intl.h" - #include "wx/log.h" - #include "wx/utils.h" - #include "wx/hashmap.h" -#endif - -#include "wx/strconv.h" - -#if wxUSE_WCHAR_T - -#ifdef __WINDOWS__ - #include "wx/msw/private.h" -#endif - -#ifndef __WXWINCE__ -#include -#endif - -#include -#include -#include - -#if defined(__WIN32__) && !defined(__WXMICROWIN__) - #define wxHAVE_WIN32_MB2WC -#endif - -#ifdef __SALFORDC__ - #include -#endif - -#ifdef HAVE_ICONV - #include - #include "wx/thread.h" -#endif - -#include "wx/encconv.h" -#include "wx/fontmap.h" - -#ifdef __WXMAC__ -#ifndef __DARWIN__ -#include -#include -#include -#endif - -// includes Mac headers -#include "wx/mac/private.h" -#include "wx/thread.h" - -#endif - - -#define TRACE_STRCONV _T("strconv") - -// WC_UTF16 is defined only if sizeof(wchar_t) == 2, otherwise it's supposed to -// be 4 bytes -#if SIZEOF_WCHAR_T == 2 - #define WC_UTF16 -#endif - - -// ============================================================================ -// implementation -// ============================================================================ - -// helper function of cMB2WC(): check if n bytes at this location are all NUL -static bool NotAllNULs(const char *p, size_t n) -{ - while ( n && *p++ == '\0' ) - n--; - - return n != 0; -} - -// ---------------------------------------------------------------------------- -// UTF-16 en/decoding to/from UCS-4 with surrogates handling -// ---------------------------------------------------------------------------- - -static size_t encode_utf16(wxUint32 input, wxUint16 *output) -{ - if (input <= 0xffff) - { - if (output) - *output = (wxUint16) input; - - return 1; - } - else if (input >= 0x110000) - { - return wxCONV_FAILED; - } - else - { - if (output) - { - *output++ = (wxUint16) ((input >> 10) + 0xd7c0); - *output = (wxUint16) ((input & 0x3ff) + 0xdc00); - } - - return 2; - } -} - -static size_t decode_utf16(const wxUint16* input, wxUint32& output) -{ - if ((*input < 0xd800) || (*input > 0xdfff)) - { - output = *input; - return 1; - } - else if ((input[1] < 0xdc00) || (input[1] > 0xdfff)) - { - output = *input; - return wxCONV_FAILED; - } - else - { - output = ((input[0] - 0xd7c0) << 10) + (input[1] - 0xdc00); - return 2; - } -} - -#ifdef WC_UTF16 - typedef wchar_t wxDecodeSurrogate_t; -#else // !WC_UTF16 - typedef wxUint16 wxDecodeSurrogate_t; -#endif // WC_UTF16/!WC_UTF16 - -// returns the next UTF-32 character from the wchar_t buffer and advances the -// pointer to the character after this one -// -// if an invalid character is found, *pSrc is set to NULL, the caller must -// check for this -static wxUint32 wxDecodeSurrogate(const wxDecodeSurrogate_t **pSrc) -{ - wxUint32 out; - const size_t - n = decode_utf16(wx_reinterpret_cast(const wxUint16 *, *pSrc), out); - if ( n == wxCONV_FAILED ) - *pSrc = NULL; - else - *pSrc += n; - - return out; -} - -// ---------------------------------------------------------------------------- -// wxMBConv -// ---------------------------------------------------------------------------- - -size_t -wxMBConv::ToWChar(wchar_t *dst, size_t dstLen, - const char *src, size_t srcLen) const -{ - // although new conversion classes are supposed to implement this function - // directly, the existins ones only implement the old MB2WC() and so, to - // avoid to have to rewrite all conversion classes at once, we provide a - // default (but not efficient) implementation of this one in terms of the - // old function by copying the input to ensure that it's NUL-terminated and - // then using MB2WC() to convert it - - // the number of chars [which would be] written to dst [if it were not NULL] - size_t dstWritten = 0; - - // the number of NULs terminating this string - size_t nulLen = 0; // not really needed, but just to avoid warnings - - // if we were not given the input size we just have to assume that the - // string is properly terminated as we have no way of knowing how long it - // is anyhow, but if we do have the size check whether there are enough - // NULs at the end - wxCharBuffer bufTmp; - const char *srcEnd; - if ( srcLen != wxNO_LEN ) - { - // we need to know how to find the end of this string - nulLen = GetMBNulLen(); - if ( nulLen == wxCONV_FAILED ) - return wxCONV_FAILED; - - // if there are enough NULs we can avoid the copy - if ( srcLen < nulLen || NotAllNULs(src + srcLen - nulLen, nulLen) ) - { - // make a copy in order to properly NUL-terminate the string - bufTmp = wxCharBuffer(srcLen + nulLen - 1 /* 1 will be added */); - char * const p = bufTmp.data(); - memcpy(p, src, srcLen); - for ( char *s = p + srcLen; s < p + srcLen + nulLen; s++ ) - *s = '\0'; - - src = bufTmp; - } - - srcEnd = src + srcLen; - } - else // quit after the first loop iteration - { - srcEnd = NULL; - } - - for ( ;; ) - { - // try to convert the current chunk - size_t lenChunk = MB2WC(NULL, src, 0); - if ( lenChunk == wxCONV_FAILED ) - return wxCONV_FAILED; - - lenChunk++; // for the L'\0' at the end of this chunk - - dstWritten += lenChunk; - - if ( lenChunk == 1 ) - { - // nothing left in the input string, conversion succeeded - break; - } - - if ( dst ) - { - if ( dstWritten > dstLen ) - return wxCONV_FAILED; - - if ( MB2WC(dst, src, lenChunk) == wxCONV_FAILED ) - return wxCONV_FAILED; - - dst += lenChunk; - } - - if ( !srcEnd ) - { - // we convert just one chunk in this case as this is the entire - // string anyhow - break; - } - - // advance the input pointer past the end of this chunk - while ( NotAllNULs(src, nulLen) ) - { - // notice that we must skip over multiple bytes here as we suppose - // that if NUL takes 2 or 4 bytes, then all the other characters do - // too and so if advanced by a single byte we might erroneously - // detect sequences of NUL bytes in the middle of the input - src += nulLen; - } - - src += nulLen; // skipping over its terminator as well - - // note that ">=" (and not just "==") is needed here as the terminator - // we skipped just above could be inside or just after the buffer - // delimited by inEnd - if ( src >= srcEnd ) - break; - } - - return dstWritten; -} - -size_t -wxMBConv::FromWChar(char *dst, size_t dstLen, - const wchar_t *src, size_t srcLen) const -{ - // the number of chars [which would be] written to dst [if it were not NULL] - size_t dstWritten = 0; - - // make a copy of the input string unless it is already properly - // NUL-terminated - // - // if we don't know its length we have no choice but to assume that it is, - // indeed, properly terminated - wxWCharBuffer bufTmp; - if ( srcLen == wxNO_LEN ) - { - srcLen = wxWcslen(src) + 1; - } - else if ( srcLen != 0 && src[srcLen - 1] != L'\0' ) - { - // make a copy in order to properly NUL-terminate the string - bufTmp = wxWCharBuffer(srcLen); - memcpy(bufTmp.data(), src, srcLen * sizeof(wchar_t)); - src = bufTmp; - } - - const size_t lenNul = GetMBNulLen(); - for ( const wchar_t * const srcEnd = src + srcLen; - src < srcEnd; - src += wxWcslen(src) + 1 /* skip L'\0' too */ ) - { - // try to convert the current chunk - size_t lenChunk = WC2MB(NULL, src, 0); - - if ( lenChunk == wxCONV_FAILED ) - return wxCONV_FAILED; - - lenChunk += lenNul; - dstWritten += lenChunk; - - if ( dst ) - { - if ( dstWritten > dstLen ) - return wxCONV_FAILED; - - if ( WC2MB(dst, src, lenChunk) == wxCONV_FAILED ) - return wxCONV_FAILED; - - dst += lenChunk; - } - } - - return dstWritten; -} - -size_t wxMBConv::MB2WC(wchar_t *outBuff, const char *inBuff, size_t outLen) const -{ - size_t rc = ToWChar(outBuff, outLen, inBuff); - if ( rc != wxCONV_FAILED ) - { - // ToWChar() returns the buffer length, i.e. including the trailing - // NUL, while this method doesn't take it into account - rc--; - } - - return rc; -} - -size_t wxMBConv::WC2MB(char *outBuff, const wchar_t *inBuff, size_t outLen) const -{ - size_t rc = FromWChar(outBuff, outLen, inBuff); - if ( rc != wxCONV_FAILED ) - { - rc -= GetMBNulLen(); - } - - return rc; -} - -wxMBConv::~wxMBConv() -{ - // nothing to do here (necessary for Darwin linking probably) -} - -const wxWCharBuffer wxMBConv::cMB2WC(const char *psz) const -{ - if ( psz ) - { - // calculate the length of the buffer needed first - const size_t nLen = MB2WC(NULL, psz, 0); - if ( nLen != wxCONV_FAILED ) - { - // now do the actual conversion - wxWCharBuffer buf(nLen /* +1 added implicitly */); - - // +1 for the trailing NULL - if ( MB2WC(buf.data(), psz, nLen + 1) != wxCONV_FAILED ) - return buf; - } - } - - return wxWCharBuffer(); -} - -const wxCharBuffer wxMBConv::cWC2MB(const wchar_t *pwz) const -{ - if ( pwz ) - { - const size_t nLen = WC2MB(NULL, pwz, 0); - if ( nLen != wxCONV_FAILED ) - { - // extra space for trailing NUL(s) - static const size_t extraLen = GetMaxMBNulLen(); - - wxCharBuffer buf(nLen + extraLen - 1); - if ( WC2MB(buf.data(), pwz, nLen + extraLen) != wxCONV_FAILED ) - return buf; - } - } - - return wxCharBuffer(); -} - -const wxWCharBuffer -wxMBConv::cMB2WC(const char *inBuff, size_t inLen, size_t *outLen) const -{ - const size_t dstLen = ToWChar(NULL, 0, inBuff, inLen); - if ( dstLen != wxCONV_FAILED ) - { - wxWCharBuffer wbuf(dstLen - 1); - if ( ToWChar(wbuf.data(), dstLen, inBuff, inLen) != wxCONV_FAILED ) - { - if ( outLen ) - { - *outLen = dstLen; - if ( wbuf[dstLen - 1] == L'\0' ) - (*outLen)--; - } - - return wbuf; - } - } - - if ( outLen ) - *outLen = 0; - - return wxWCharBuffer(); -} - -const wxCharBuffer -wxMBConv::cWC2MB(const wchar_t *inBuff, size_t inLen, size_t *outLen) const -{ - size_t dstLen = FromWChar(NULL, 0, inBuff, inLen); - if ( dstLen != wxCONV_FAILED ) - { - // special case of empty input: can't allocate 0 size buffer below as - // wxCharBuffer insists on NUL-terminating it - wxCharBuffer buf(dstLen ? dstLen - 1 : 1); - if ( FromWChar(buf.data(), dstLen, inBuff, inLen) != wxCONV_FAILED ) - { - if ( outLen ) - { - *outLen = dstLen; - - const size_t nulLen = GetMBNulLen(); - if ( dstLen >= nulLen && - !NotAllNULs(buf.data() + dstLen - nulLen, nulLen) ) - { - // in this case the output is NUL-terminated and we're not - // supposed to count NUL - *outLen -= nulLen; - } - } - - return buf; - } - } - - if ( outLen ) - *outLen = 0; - - return wxCharBuffer(); -} - -// ---------------------------------------------------------------------------- -// wxMBConvLibc -// ---------------------------------------------------------------------------- - -size_t wxMBConvLibc::MB2WC(wchar_t *buf, const char *psz, size_t n) const -{ - return wxMB2WC(buf, psz, n); -} - -size_t wxMBConvLibc::WC2MB(char *buf, const wchar_t *psz, size_t n) const -{ - return wxWC2MB(buf, psz, n); -} - -// ---------------------------------------------------------------------------- -// wxConvBrokenFileNames -// ---------------------------------------------------------------------------- - -#ifdef __UNIX__ - -wxConvBrokenFileNames::wxConvBrokenFileNames(const wxChar *charset) -{ - if ( !charset || wxStricmp(charset, _T("UTF-8")) == 0 - || wxStricmp(charset, _T("UTF8")) == 0 ) - m_conv = new wxMBConvUTF8(wxMBConvUTF8::MAP_INVALID_UTF8_TO_PUA); - else - m_conv = new wxCSConv(charset); -} - -#endif // __UNIX__ - -// ---------------------------------------------------------------------------- -// UTF-7 -// ---------------------------------------------------------------------------- - -// Implementation (C) 2004 Fredrik Roubert - -// -// BASE64 decoding table -// -static const unsigned char utf7unb64[] = -{ - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0x3e, 0xff, 0xff, 0xff, 0x3f, - 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3a, 0x3b, - 0x3c, 0x3d, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, - 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, - 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, - 0x17, 0x18, 0x19, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20, - 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, - 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, 0x30, - 0x31, 0x32, 0x33, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff -}; - -size_t wxMBConvUTF7::MB2WC(wchar_t *buf, const char *psz, size_t n) const -{ - size_t len = 0; - - while ( *psz && (!buf || (len < n)) ) - { - unsigned char cc = *psz++; - if (cc != '+') - { - // plain ASCII char - if (buf) - *buf++ = cc; - len++; - } - else if (*psz == '-') - { - // encoded plus sign - if (buf) - *buf++ = cc; - len++; - psz++; - } - else // start of BASE64 encoded string - { - bool lsb, ok; - unsigned int d, l; - for ( ok = lsb = false, d = 0, l = 0; - (cc = utf7unb64[(unsigned char)*psz]) != 0xff; - psz++ ) - { - d <<= 6; - d += cc; - for (l += 6; l >= 8; lsb = !lsb) - { - unsigned char c = (unsigned char)((d >> (l -= 8)) % 256); - if (lsb) - { - if (buf) - *buf++ |= c; - len ++; - } - else - { - if (buf) - *buf = (wchar_t)(c << 8); - } - - ok = true; - } - } - - if ( !ok ) - { - // in valid UTF7 we should have valid characters after '+' - return wxCONV_FAILED; - } - - if (*psz == '-') - psz++; - } - } - - if ( buf && (len < n) ) - *buf = '\0'; - - return len; -} - -// -// BASE64 encoding table -// -static const unsigned char utf7enb64[] = -{ - 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', - 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', - 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', - 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f', - 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', - 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', - 'w', 'x', 'y', 'z', '0', '1', '2', '3', - '4', '5', '6', '7', '8', '9', '+', '/' -}; - -// -// UTF-7 encoding table -// -// 0 - Set D (directly encoded characters) -// 1 - Set O (optional direct characters) -// 2 - whitespace characters (optional) -// 3 - special characters -// -static const unsigned char utf7encode[128] = -{ - 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, 2, 3, 3, 2, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 2, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 3, 0, 0, 0, 3, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, - 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 3, 1, 1, 1, - 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 3, 3 -}; - -size_t wxMBConvUTF7::WC2MB(char *buf, const wchar_t *psz, size_t n) const -{ - size_t len = 0; - - while (*psz && ((!buf) || (len < n))) - { - wchar_t cc = *psz++; - if (cc < 0x80 && utf7encode[cc] < 1) - { - // plain ASCII char - if (buf) - *buf++ = (char)cc; - - len++; - } -#ifndef WC_UTF16 - else if (((wxUint32)cc) > 0xffff) - { - // no surrogate pair generation (yet?) - return wxCONV_FAILED; - } -#endif - else - { - if (buf) - *buf++ = '+'; - - len++; - if (cc != '+') - { - // BASE64 encode string - unsigned int lsb, d, l; - for (d = 0, l = 0; /*nothing*/; psz++) - { - for (lsb = 0; lsb < 2; lsb ++) - { - d <<= 8; - d += lsb ? cc & 0xff : (cc & 0xff00) >> 8; - - for (l += 8; l >= 6; ) - { - l -= 6; - if (buf) - *buf++ = utf7enb64[(d >> l) % 64]; - len++; - } - } - - cc = *psz; - if (!(cc) || (cc < 0x80 && utf7encode[cc] < 1)) - break; - } - - if (l != 0) - { - if (buf) - *buf++ = utf7enb64[((d % 16) << (6 - l)) % 64]; - - len++; - } - } - - if (buf) - *buf++ = '-'; - len++; - } - } - - if (buf && (len < n)) - *buf = 0; - - return len; -} - -// ---------------------------------------------------------------------------- -// UTF-8 -// ---------------------------------------------------------------------------- - -static wxUint32 utf8_max[]= - { 0x7f, 0x7ff, 0xffff, 0x1fffff, 0x3ffffff, 0x7fffffff, 0xffffffff }; - -// boundaries of the private use area we use to (temporarily) remap invalid -// characters invalid in a UTF-8 encoded string -const wxUint32 wxUnicodePUA = 0x100000; -const wxUint32 wxUnicodePUAEnd = wxUnicodePUA + 256; - -size_t wxMBConvUTF8::MB2WC(wchar_t *buf, const char *psz, size_t n) const -{ - size_t len = 0; - - while (*psz && ((!buf) || (len < n))) - { - const char *opsz = psz; - bool invalid = false; - unsigned char cc = *psz++, fc = cc; - unsigned cnt; - for (cnt = 0; fc & 0x80; cnt++) - fc <<= 1; - - if (!cnt) - { - // plain ASCII char - if (buf) - *buf++ = cc; - len++; - - // escape the escape character for octal escapes - if ((m_options & MAP_INVALID_UTF8_TO_OCTAL) - && cc == '\\' && (!buf || len < n)) - { - if (buf) - *buf++ = cc; - len++; - } - } - else - { - cnt--; - if (!cnt) - { - // invalid UTF-8 sequence - invalid = true; - } - else - { - unsigned ocnt = cnt - 1; - wxUint32 res = cc & (0x3f >> cnt); - while (cnt--) - { - cc = *psz; - if ((cc & 0xC0) != 0x80) - { - // invalid UTF-8 sequence - invalid = true; - break; - } - - psz++; - res = (res << 6) | (cc & 0x3f); - } - - if (invalid || res <= utf8_max[ocnt]) - { - // illegal UTF-8 encoding - invalid = true; - } - else if ((m_options & MAP_INVALID_UTF8_TO_PUA) && - res >= wxUnicodePUA && res < wxUnicodePUAEnd) - { - // if one of our PUA characters turns up externally - // it must also be treated as an illegal sequence - // (a bit like you have to escape an escape character) - invalid = true; - } - else - { -#ifdef WC_UTF16 - // cast is ok because wchar_t == wxUuint16 if WC_UTF16 - size_t pa = encode_utf16(res, (wxUint16 *)buf); - if (pa == wxCONV_FAILED) - { - invalid = true; - } - else - { - if (buf) - buf += pa; - len += pa; - } -#else // !WC_UTF16 - if (buf) - *buf++ = (wchar_t)res; - len++; -#endif // WC_UTF16/!WC_UTF16 - } - } - - if (invalid) - { - if (m_options & MAP_INVALID_UTF8_TO_PUA) - { - while (opsz < psz && (!buf || len < n)) - { -#ifdef WC_UTF16 - // cast is ok because wchar_t == wxUuint16 if WC_UTF16 - size_t pa = encode_utf16((unsigned char)*opsz + wxUnicodePUA, (wxUint16 *)buf); - wxASSERT(pa != wxCONV_FAILED); - if (buf) - buf += pa; - opsz++; - len += pa; -#else - if (buf) - *buf++ = (wchar_t)(wxUnicodePUA + (unsigned char)*opsz); - opsz++; - len++; -#endif - } - } - else if (m_options & MAP_INVALID_UTF8_TO_OCTAL) - { - while (opsz < psz && (!buf || len < n)) - { - if ( buf && len + 3 < n ) - { - unsigned char on = *opsz; - *buf++ = L'\\'; - *buf++ = (wchar_t)( L'0' + on / 0100 ); - *buf++ = (wchar_t)( L'0' + (on % 0100) / 010 ); - *buf++ = (wchar_t)( L'0' + on % 010 ); - } - - opsz++; - len += 4; - } - } - else // MAP_INVALID_UTF8_NOT - { - return wxCONV_FAILED; - } - } - } - } - - if (buf && (len < n)) - *buf = 0; - - return len; -} - -static inline bool isoctal(wchar_t wch) -{ - return L'0' <= wch && wch <= L'7'; -} - -size_t wxMBConvUTF8::WC2MB(char *buf, const wchar_t *psz, size_t n) const -{ - size_t len = 0; - - while (*psz && ((!buf) || (len < n))) - { - wxUint32 cc; - -#ifdef WC_UTF16 - // cast is ok for WC_UTF16 - size_t pa = decode_utf16((const wxUint16 *)psz, cc); - psz += (pa == wxCONV_FAILED) ? 1 : pa; -#else - cc = (*psz++) & 0x7fffffff; -#endif - - if ( (m_options & MAP_INVALID_UTF8_TO_PUA) - && cc >= wxUnicodePUA && cc < wxUnicodePUAEnd ) - { - if (buf) - *buf++ = (char)(cc - wxUnicodePUA); - len++; - } - else if ( (m_options & MAP_INVALID_UTF8_TO_OCTAL) - && cc == L'\\' && psz[0] == L'\\' ) - { - if (buf) - *buf++ = (char)cc; - psz++; - len++; - } - else if ( (m_options & MAP_INVALID_UTF8_TO_OCTAL) && - cc == L'\\' && - isoctal(psz[0]) && isoctal(psz[1]) && isoctal(psz[2]) ) - { - if (buf) - { - *buf++ = (char) ((psz[0] - L'0') * 0100 + - (psz[1] - L'0') * 010 + - (psz[2] - L'0')); - } - - psz += 3; - len++; - } - else - { - unsigned cnt; - for (cnt = 0; cc > utf8_max[cnt]; cnt++) - { - } - - if (!cnt) - { - // plain ASCII char - if (buf) - *buf++ = (char) cc; - len++; - } - else - { - len += cnt + 1; - if (buf) - { - *buf++ = (char) ((-128 >> cnt) | ((cc >> (cnt * 6)) & (0x3f >> cnt))); - while (cnt--) - *buf++ = (char) (0x80 | ((cc >> (cnt * 6)) & 0x3f)); - } - } - } - } - - if (buf && (len < n)) - *buf = 0; - - return len; -} - -// ============================================================================ -// UTF-16 -// ============================================================================ - -#ifdef WORDS_BIGENDIAN - #define wxMBConvUTF16straight wxMBConvUTF16BE - #define wxMBConvUTF16swap wxMBConvUTF16LE -#else - #define wxMBConvUTF16swap wxMBConvUTF16BE - #define wxMBConvUTF16straight wxMBConvUTF16LE -#endif - -/* static */ -size_t wxMBConvUTF16Base::GetLength(const char *src, size_t srcLen) -{ - if ( srcLen == wxNO_LEN ) - { - // count the number of bytes in input, including the trailing NULs - const wxUint16 *inBuff = wx_reinterpret_cast(const wxUint16 *, src); - for ( srcLen = 1; *inBuff++; srcLen++ ) - ; - - srcLen *= BYTES_PER_CHAR; - } - else // we already have the length - { - // we can only convert an entire number of UTF-16 characters - if ( srcLen % BYTES_PER_CHAR ) - return wxCONV_FAILED; - } - - return srcLen; -} - -// case when in-memory representation is UTF-16 too -#ifdef WC_UTF16 - -// ---------------------------------------------------------------------------- -// conversions without endianness change -// ---------------------------------------------------------------------------- - -size_t -wxMBConvUTF16straight::ToWChar(wchar_t *dst, size_t dstLen, - const char *src, size_t srcLen) const -{ - // set up the scene for using memcpy() (which is presumably more efficient - // than copying the bytes one by one) - srcLen = GetLength(src, srcLen); - if ( srcLen == wxNO_LEN ) - return wxCONV_FAILED; - - const size_t inLen = srcLen / BYTES_PER_CHAR; - if ( dst ) - { - if ( dstLen < inLen ) - return wxCONV_FAILED; - - memcpy(dst, src, srcLen); - } - - return inLen; -} - -size_t -wxMBConvUTF16straight::FromWChar(char *dst, size_t dstLen, - const wchar_t *src, size_t srcLen) const -{ - if ( srcLen == wxNO_LEN ) - srcLen = wxWcslen(src) + 1; - - srcLen *= BYTES_PER_CHAR; - - if ( dst ) - { - if ( dstLen < srcLen ) - return wxCONV_FAILED; - - memcpy(dst, src, srcLen); - } - - return srcLen; -} - -// ---------------------------------------------------------------------------- -// endian-reversing conversions -// ---------------------------------------------------------------------------- - -size_t -wxMBConvUTF16swap::ToWChar(wchar_t *dst, size_t dstLen, - const char *src, size_t srcLen) const -{ - srcLen = GetLength(src, srcLen); - if ( srcLen == wxNO_LEN ) - return wxCONV_FAILED; - - srcLen /= BYTES_PER_CHAR; - - if ( dst ) - { - if ( dstLen < srcLen ) - return wxCONV_FAILED; - - const wxUint16 *inBuff = wx_reinterpret_cast(const wxUint16 *, src); - for ( size_t n = 0; n < srcLen; n++, inBuff++ ) - { - *dst++ = wxUINT16_SWAP_ALWAYS(*inBuff); - } - } - - return srcLen; -} - -size_t -wxMBConvUTF16swap::FromWChar(char *dst, size_t dstLen, - const wchar_t *src, size_t srcLen) const -{ - if ( srcLen == wxNO_LEN ) - srcLen = wxWcslen(src) + 1; - - srcLen *= BYTES_PER_CHAR; - - if ( dst ) - { - if ( dstLen < srcLen ) - return wxCONV_FAILED; - - wxUint16 *outBuff = wx_reinterpret_cast(wxUint16 *, dst); - for ( size_t n = 0; n < srcLen; n += BYTES_PER_CHAR, src++ ) - { - *outBuff++ = wxUINT16_SWAP_ALWAYS(*src); - } - } - - return srcLen; -} - -#else // !WC_UTF16: wchar_t is UTF-32 - -// ---------------------------------------------------------------------------- -// conversions without endianness change -// ---------------------------------------------------------------------------- - -size_t -wxMBConvUTF16straight::ToWChar(wchar_t *dst, size_t dstLen, - const char *src, size_t srcLen) const -{ - srcLen = GetLength(src, srcLen); - if ( srcLen == wxNO_LEN ) - return wxCONV_FAILED; - - const size_t inLen = srcLen / BYTES_PER_CHAR; - if ( !dst ) - { - // optimization: return maximal space which could be needed for this - // string even if the real size could be smaller if the buffer contains - // any surrogates - return inLen; - } - - size_t outLen = 0; - const wxUint16 *inBuff = wx_reinterpret_cast(const wxUint16 *, src); - for ( const wxUint16 * const inEnd = inBuff + inLen; inBuff < inEnd; ) - { - const wxUint32 ch = wxDecodeSurrogate(&inBuff); - if ( !inBuff ) - return wxCONV_FAILED; - - if ( ++outLen > dstLen ) - return wxCONV_FAILED; - - *dst++ = ch; - } - - - return outLen; -} - -size_t -wxMBConvUTF16straight::FromWChar(char *dst, size_t dstLen, - const wchar_t *src, size_t srcLen) const -{ - if ( srcLen == wxNO_LEN ) - srcLen = wxWcslen(src) + 1; - - size_t outLen = 0; - wxUint16 *outBuff = wx_reinterpret_cast(wxUint16 *, dst); - for ( size_t n = 0; n < srcLen; n++ ) - { - wxUint16 cc[2]; - const size_t numChars = encode_utf16(*src++, cc); - if ( numChars == wxCONV_FAILED ) - return wxCONV_FAILED; - - outLen += numChars * BYTES_PER_CHAR; - if ( outBuff ) - { - if ( outLen > dstLen ) - return wxCONV_FAILED; - - *outBuff++ = cc[0]; - if ( numChars == 2 ) - { - // second character of a surrogate - *outBuff++ = cc[1]; - } - } - } - - return outLen; -} - -// ---------------------------------------------------------------------------- -// endian-reversing conversions -// ---------------------------------------------------------------------------- - -size_t -wxMBConvUTF16swap::ToWChar(wchar_t *dst, size_t dstLen, - const char *src, size_t srcLen) const -{ - srcLen = GetLength(src, srcLen); - if ( srcLen == wxNO_LEN ) - return wxCONV_FAILED; - - const size_t inLen = srcLen / BYTES_PER_CHAR; - if ( !dst ) - { - // optimization: return maximal space which could be needed for this - // string even if the real size could be smaller if the buffer contains - // any surrogates - return inLen; - } - - size_t outLen = 0; - const wxUint16 *inBuff = wx_reinterpret_cast(const wxUint16 *, src); - for ( const wxUint16 * const inEnd = inBuff + inLen; inBuff < inEnd; ) - { - wxUint32 ch; - wxUint16 tmp[2]; - - tmp[0] = wxUINT16_SWAP_ALWAYS(*inBuff); - inBuff++; - tmp[1] = wxUINT16_SWAP_ALWAYS(*inBuff); - - const size_t numChars = decode_utf16(tmp, ch); - if ( numChars == wxCONV_FAILED ) - return wxCONV_FAILED; - - if ( numChars == 2 ) - inBuff++; - - if ( ++outLen > dstLen ) - return wxCONV_FAILED; - - *dst++ = ch; - } - - - return outLen; -} - -size_t -wxMBConvUTF16swap::FromWChar(char *dst, size_t dstLen, - const wchar_t *src, size_t srcLen) const -{ - if ( srcLen == wxNO_LEN ) - srcLen = wxWcslen(src) + 1; - - size_t outLen = 0; - wxUint16 *outBuff = wx_reinterpret_cast(wxUint16 *, dst); - for ( const wchar_t *srcEnd = src + srcLen; src < srcEnd; src++ ) - { - wxUint16 cc[2]; - const size_t numChars = encode_utf16(*src, cc); - if ( numChars == wxCONV_FAILED ) - return wxCONV_FAILED; - - outLen += numChars * BYTES_PER_CHAR; - if ( outBuff ) - { - if ( outLen > dstLen ) - return wxCONV_FAILED; - - *outBuff++ = wxUINT16_SWAP_ALWAYS(cc[0]); - if ( numChars == 2 ) - { - // second character of a surrogate - *outBuff++ = wxUINT16_SWAP_ALWAYS(cc[1]); - } - } - } - - return outLen; -} - -#endif // WC_UTF16/!WC_UTF16 - - -// ============================================================================ -// UTF-32 -// ============================================================================ - -#ifdef WORDS_BIGENDIAN - #define wxMBConvUTF32straight wxMBConvUTF32BE - #define wxMBConvUTF32swap wxMBConvUTF32LE -#else - #define wxMBConvUTF32swap wxMBConvUTF32BE - #define wxMBConvUTF32straight wxMBConvUTF32LE -#endif - - -WXDLLIMPEXP_DATA_BASE(wxMBConvUTF32LE) wxConvUTF32LE; -WXDLLIMPEXP_DATA_BASE(wxMBConvUTF32BE) wxConvUTF32BE; - -/* static */ -size_t wxMBConvUTF32Base::GetLength(const char *src, size_t srcLen) -{ - if ( srcLen == wxNO_LEN ) - { - // count the number of bytes in input, including the trailing NULs - const wxUint32 *inBuff = wx_reinterpret_cast(const wxUint32 *, src); - for ( srcLen = 1; *inBuff++; srcLen++ ) - ; - - srcLen *= BYTES_PER_CHAR; - } - else // we already have the length - { - // we can only convert an entire number of UTF-32 characters - if ( srcLen % BYTES_PER_CHAR ) - return wxCONV_FAILED; - } - - return srcLen; -} - -// case when in-memory representation is UTF-16 -#ifdef WC_UTF16 - -// ---------------------------------------------------------------------------- -// conversions without endianness change -// ---------------------------------------------------------------------------- - -size_t -wxMBConvUTF32straight::ToWChar(wchar_t *dst, size_t dstLen, - const char *src, size_t srcLen) const -{ - srcLen = GetLength(src, srcLen); - if ( srcLen == wxNO_LEN ) - return wxCONV_FAILED; - - const wxUint32 *inBuff = wx_reinterpret_cast(const wxUint32 *, src); - const size_t inLen = srcLen / BYTES_PER_CHAR; - size_t outLen = 0; - for ( size_t n = 0; n < inLen; n++ ) - { - wxUint16 cc[2]; - const size_t numChars = encode_utf16(*inBuff++, cc); - if ( numChars == wxCONV_FAILED ) - return wxCONV_FAILED; - - outLen += numChars; - if ( dst ) - { - if ( outLen > dstLen ) - return wxCONV_FAILED; - - *dst++ = cc[0]; - if ( numChars == 2 ) - { - // second character of a surrogate - *dst++ = cc[1]; - } - } - } - - return outLen; -} - -size_t -wxMBConvUTF32straight::FromWChar(char *dst, size_t dstLen, - const wchar_t *src, size_t srcLen) const -{ - if ( srcLen == wxNO_LEN ) - srcLen = wxWcslen(src) + 1; - - if ( !dst ) - { - // optimization: return maximal space which could be needed for this - // string instead of the exact amount which could be less if there are - // any surrogates in the input - // - // we consider that surrogates are rare enough to make it worthwhile to - // avoid running the loop below at the cost of slightly extra memory - // consumption - return srcLen * BYTES_PER_CHAR; - } - - wxUint32 *outBuff = wx_reinterpret_cast(wxUint32 *, dst); - size_t outLen = 0; - for ( const wchar_t * const srcEnd = src + srcLen; src < srcEnd; ) - { - const wxUint32 ch = wxDecodeSurrogate(&src); - if ( !src ) - return wxCONV_FAILED; - - outLen += BYTES_PER_CHAR; - - if ( outLen > dstLen ) - return wxCONV_FAILED; - - *outBuff++ = ch; - } - - return outLen; -} - -// ---------------------------------------------------------------------------- -// endian-reversing conversions -// ---------------------------------------------------------------------------- - -size_t -wxMBConvUTF32swap::ToWChar(wchar_t *dst, size_t dstLen, - const char *src, size_t srcLen) const -{ - srcLen = GetLength(src, srcLen); - if ( srcLen == wxNO_LEN ) - return wxCONV_FAILED; - - const wxUint32 *inBuff = wx_reinterpret_cast(const wxUint32 *, src); - const size_t inLen = srcLen / BYTES_PER_CHAR; - size_t outLen = 0; - for ( size_t n = 0; n < inLen; n++, inBuff++ ) - { - wxUint16 cc[2]; - const size_t numChars = encode_utf16(wxUINT32_SWAP_ALWAYS(*inBuff), cc); - if ( numChars == wxCONV_FAILED ) - return wxCONV_FAILED; - - outLen += numChars; - if ( dst ) - { - if ( outLen > dstLen ) - return wxCONV_FAILED; - - *dst++ = cc[0]; - if ( numChars == 2 ) - { - // second character of a surrogate - *dst++ = cc[1]; - } - } - } - - return outLen; -} - -size_t -wxMBConvUTF32swap::FromWChar(char *dst, size_t dstLen, - const wchar_t *src, size_t srcLen) const -{ - if ( srcLen == wxNO_LEN ) - srcLen = wxWcslen(src) + 1; - - if ( !dst ) - { - // optimization: return maximal space which could be needed for this - // string instead of the exact amount which could be less if there are - // any surrogates in the input - // - // we consider that surrogates are rare enough to make it worthwhile to - // avoid running the loop below at the cost of slightly extra memory - // consumption - return srcLen*BYTES_PER_CHAR; - } - - wxUint32 *outBuff = wx_reinterpret_cast(wxUint32 *, dst); - size_t outLen = 0; - for ( const wchar_t * const srcEnd = src + srcLen; src < srcEnd; ) - { - const wxUint32 ch = wxDecodeSurrogate(&src); - if ( !src ) - return wxCONV_FAILED; - - outLen += BYTES_PER_CHAR; - - if ( outLen > dstLen ) - return wxCONV_FAILED; - - *outBuff++ = wxUINT32_SWAP_ALWAYS(ch); - } - - return outLen; -} - -#else // !WC_UTF16: wchar_t is UTF-32 - -// ---------------------------------------------------------------------------- -// conversions without endianness change -// ---------------------------------------------------------------------------- - -size_t -wxMBConvUTF32straight::ToWChar(wchar_t *dst, size_t dstLen, - const char *src, size_t srcLen) const -{ - // use memcpy() as it should be much faster than hand-written loop - srcLen = GetLength(src, srcLen); - if ( srcLen == wxNO_LEN ) - return wxCONV_FAILED; - - const size_t inLen = srcLen/BYTES_PER_CHAR; - if ( dst ) - { - if ( dstLen < inLen ) - return wxCONV_FAILED; - - memcpy(dst, src, srcLen); - } - - return inLen; -} - -size_t -wxMBConvUTF32straight::FromWChar(char *dst, size_t dstLen, - const wchar_t *src, size_t srcLen) const -{ - if ( srcLen == wxNO_LEN ) - srcLen = wxWcslen(src) + 1; - - srcLen *= BYTES_PER_CHAR; - - if ( dst ) - { - if ( dstLen < srcLen ) - return wxCONV_FAILED; - - memcpy(dst, src, srcLen); - } - - return srcLen; -} - -// ---------------------------------------------------------------------------- -// endian-reversing conversions -// ---------------------------------------------------------------------------- - -size_t -wxMBConvUTF32swap::ToWChar(wchar_t *dst, size_t dstLen, - const char *src, size_t srcLen) const -{ - srcLen = GetLength(src, srcLen); - if ( srcLen == wxNO_LEN ) - return wxCONV_FAILED; - - srcLen /= BYTES_PER_CHAR; - - if ( dst ) - { - if ( dstLen < srcLen ) - return wxCONV_FAILED; - - const wxUint32 *inBuff = wx_reinterpret_cast(const wxUint32 *, src); - for ( size_t n = 0; n < srcLen; n++, inBuff++ ) - { - *dst++ = wxUINT32_SWAP_ALWAYS(*inBuff); - } - } - - return srcLen; -} - -size_t -wxMBConvUTF32swap::FromWChar(char *dst, size_t dstLen, - const wchar_t *src, size_t srcLen) const -{ - if ( srcLen == wxNO_LEN ) - srcLen = wxWcslen(src) + 1; - - srcLen *= BYTES_PER_CHAR; - - if ( dst ) - { - if ( dstLen < srcLen ) - return wxCONV_FAILED; - - wxUint32 *outBuff = wx_reinterpret_cast(wxUint32 *, dst); - for ( size_t n = 0; n < srcLen; n += BYTES_PER_CHAR, src++ ) - { - *outBuff++ = wxUINT32_SWAP_ALWAYS(*src); - } - } - - return srcLen; -} - -#endif // WC_UTF16/!WC_UTF16 - - -// ============================================================================ -// The classes doing conversion using the iconv_xxx() functions -// ============================================================================ - -#ifdef HAVE_ICONV - -// VS: glibc 2.1.3 is broken in that iconv() conversion to/from UCS4 fails with -// E2BIG if output buffer is _exactly_ as big as needed. Such case is -// (unless there's yet another bug in glibc) the only case when iconv() -// returns with (size_t)-1 (which means error) and says there are 0 bytes -// left in the input buffer -- when _real_ error occurs, -// bytes-left-in-input buffer is non-zero. Hence, this alternative test for -// iconv() failure. -// [This bug does not appear in glibc 2.2.] -#if defined(__GLIBC__) && __GLIBC__ == 2 && __GLIBC_MINOR__ <= 1 -#define ICONV_FAILED(cres, bufLeft) ((cres == (size_t)-1) && \ - (errno != E2BIG || bufLeft != 0)) -#else -#define ICONV_FAILED(cres, bufLeft) (cres == (size_t)-1) -#endif - -#define ICONV_CHAR_CAST(x) ((ICONV_CONST char **)(x)) - -#define ICONV_T_INVALID ((iconv_t)-1) - -#if SIZEOF_WCHAR_T == 4 - #define WC_BSWAP wxUINT32_SWAP_ALWAYS - #define WC_ENC wxFONTENCODING_UTF32 -#elif SIZEOF_WCHAR_T == 2 - #define WC_BSWAP wxUINT16_SWAP_ALWAYS - #define WC_ENC wxFONTENCODING_UTF16 -#else // sizeof(wchar_t) != 2 nor 4 - // does this ever happen? - #error "Unknown sizeof(wchar_t): please report this to wx-dev@lists.wxwindows.org" -#endif - -// ---------------------------------------------------------------------------- -// wxMBConv_iconv: encapsulates an iconv character set -// ---------------------------------------------------------------------------- - -class wxMBConv_iconv : public wxMBConv -{ -public: - wxMBConv_iconv(const wxChar *name); - virtual ~wxMBConv_iconv(); - - virtual size_t MB2WC(wchar_t *buf, const char *psz, size_t n) const; - virtual size_t WC2MB(char *buf, const wchar_t *psz, size_t n) const; - - // classify this encoding as explained in wxMBConv::GetMBNulLen() comment - virtual size_t GetMBNulLen() const; - - virtual wxMBConv *Clone() const - { - wxMBConv_iconv *p = new wxMBConv_iconv(m_name); - p->m_minMBCharWidth = m_minMBCharWidth; - return p; - } - - bool IsOk() const - { return (m2w != ICONV_T_INVALID) && (w2m != ICONV_T_INVALID); } - -protected: - // the iconv handlers used to translate from multibyte - // to wide char and in the other direction - iconv_t m2w, - w2m; - -#if wxUSE_THREADS - // guards access to m2w and w2m objects - wxMutex m_iconvMutex; -#endif - -private: - // the name (for iconv_open()) of a wide char charset -- if none is - // available on this machine, it will remain NULL - static wxString ms_wcCharsetName; - - // true if the wide char encoding we use (i.e. ms_wcCharsetName) has - // different endian-ness than the native one - static bool ms_wcNeedsSwap; - - - // name of the encoding handled by this conversion - wxString m_name; - - // cached result of GetMBNulLen(); set to 0 meaning "unknown" - // initially - size_t m_minMBCharWidth; -}; - -// make the constructor available for unit testing -WXDLLIMPEXP_BASE wxMBConv* new_wxMBConv_iconv( const wxChar* name ) -{ - wxMBConv_iconv* result = new wxMBConv_iconv( name ); - if ( !result->IsOk() ) - { - delete result; - return 0; - } - - return result; -} - -wxString wxMBConv_iconv::ms_wcCharsetName; -bool wxMBConv_iconv::ms_wcNeedsSwap = false; - -wxMBConv_iconv::wxMBConv_iconv(const wxChar *name) - : m_name(name) -{ - m_minMBCharWidth = 0; - - // iconv operates with chars, not wxChars, but luckily it uses only ASCII - // names for the charsets - const wxCharBuffer cname(wxString(name).ToAscii()); - - // check for charset that represents wchar_t: - if ( ms_wcCharsetName.empty() ) - { - wxLogTrace(TRACE_STRCONV, _T("Looking for wide char codeset:")); - -#if wxUSE_FONTMAP - const wxChar **names = wxFontMapperBase::GetAllEncodingNames(WC_ENC); -#else // !wxUSE_FONTMAP - static const wxChar *names_static[] = - { -#if SIZEOF_WCHAR_T == 4 - _T("UCS-4"), -#elif SIZEOF_WCHAR_T == 2 - _T("UCS-2"), -#endif - NULL - }; - const wxChar **names = names_static; -#endif // wxUSE_FONTMAP/!wxUSE_FONTMAP - - for ( ; *names && ms_wcCharsetName.empty(); ++names ) - { - const wxString nameCS(*names); - - // first try charset with explicit bytesex info (e.g. "UCS-4LE"): - wxString nameXE(nameCS); - -#ifdef WORDS_BIGENDIAN - nameXE += _T("BE"); -#else // little endian - nameXE += _T("LE"); -#endif - - wxLogTrace(TRACE_STRCONV, _T(" trying charset \"%s\""), - nameXE.c_str()); - - m2w = iconv_open(nameXE.ToAscii(), cname); - if ( m2w == ICONV_T_INVALID ) - { - // try charset w/o bytesex info (e.g. "UCS4") - wxLogTrace(TRACE_STRCONV, _T(" trying charset \"%s\""), - nameCS.c_str()); - m2w = iconv_open(nameCS.ToAscii(), cname); - - // and check for bytesex ourselves: - if ( m2w != ICONV_T_INVALID ) - { - char buf[2], *bufPtr; - wchar_t wbuf[2], *wbufPtr; - size_t insz, outsz; - size_t res; - - buf[0] = 'A'; - buf[1] = 0; - wbuf[0] = 0; - insz = 2; - outsz = SIZEOF_WCHAR_T * 2; - wbufPtr = wbuf; - bufPtr = buf; - - res = iconv( - m2w, ICONV_CHAR_CAST(&bufPtr), &insz, - (char**)&wbufPtr, &outsz); - - if (ICONV_FAILED(res, insz)) - { - wxLogLastError(wxT("iconv")); - wxLogError(_("Conversion to charset '%s' doesn't work."), - nameCS.c_str()); - } - else // ok, can convert to this encoding, remember it - { - ms_wcCharsetName = nameCS; - ms_wcNeedsSwap = wbuf[0] != (wchar_t)buf[0]; - } - } - } - else // use charset not requiring byte swapping - { - ms_wcCharsetName = nameXE; - } - } - - wxLogTrace(TRACE_STRCONV, - wxT("iconv wchar_t charset is \"%s\"%s"), - ms_wcCharsetName.empty() ? _T("") - : ms_wcCharsetName.c_str(), - ms_wcNeedsSwap ? _T(" (needs swap)") - : _T("")); - } - else // we already have ms_wcCharsetName - { - m2w = iconv_open(ms_wcCharsetName.ToAscii(), cname); - } - - if ( ms_wcCharsetName.empty() ) - { - w2m = ICONV_T_INVALID; - } - else - { - w2m = iconv_open(cname, ms_wcCharsetName.ToAscii()); - if ( w2m == ICONV_T_INVALID ) - { - wxLogTrace(TRACE_STRCONV, - wxT("\"%s\" -> \"%s\" works but not the converse!?"), - ms_wcCharsetName.c_str(), cname.data()); - } - } -} - -wxMBConv_iconv::~wxMBConv_iconv() -{ - if ( m2w != ICONV_T_INVALID ) - iconv_close(m2w); - if ( w2m != ICONV_T_INVALID ) - iconv_close(w2m); -} - -size_t wxMBConv_iconv::MB2WC(wchar_t *buf, const char *psz, size_t n) const -{ - // find the string length: notice that must be done differently for - // NUL-terminated strings and UTF-16/32 which are terminated with 2/4 NULs - size_t inbuf; - const size_t nulLen = GetMBNulLen(); - switch ( nulLen ) - { - default: - return wxCONV_FAILED; - - case 1: - inbuf = strlen(psz); // arguably more optimized than our version - break; - - case 2: - case 4: - // for UTF-16/32 not only we need to have 2/4 consecutive NULs but - // they also have to start at character boundary and not span two - // adjacent characters - const char *p; - for ( p = psz; NotAllNULs(p, nulLen); p += nulLen ) - ; - inbuf = p - psz; - break; - } - -#if wxUSE_THREADS - // NB: iconv() is MT-safe, but each thread must use its own iconv_t handle. - // Unfortunately there are a couple of global wxCSConv objects such as - // wxConvLocal that are used all over wx code, so we have to make sure - // the handle is used by at most one thread at the time. Otherwise - // only a few wx classes would be safe to use from non-main threads - // as MB<->WC conversion would fail "randomly". - wxMutexLocker lock(wxConstCast(this, wxMBConv_iconv)->m_iconvMutex); -#endif // wxUSE_THREADS - - size_t outbuf = n * SIZEOF_WCHAR_T; - size_t res, cres; - // VS: Use these instead of psz, buf because iconv() modifies its arguments: - wchar_t *bufPtr = buf; - const char *pszPtr = psz; - - if (buf) - { - // have destination buffer, convert there - cres = iconv(m2w, - ICONV_CHAR_CAST(&pszPtr), &inbuf, - (char**)&bufPtr, &outbuf); - res = n - (outbuf / SIZEOF_WCHAR_T); - - if (ms_wcNeedsSwap) - { - // convert to native endianness - for ( unsigned i = 0; i < res; i++ ) - buf[n] = WC_BSWAP(buf[i]); - } - - // NUL-terminate the string if there is any space left - if (res < n) - buf[res] = 0; - } - else - { - // no destination buffer... convert using temp buffer - // to calculate destination buffer requirement - wchar_t tbuf[8]; - res = 0; - - do - { - bufPtr = tbuf; - outbuf = 8 * SIZEOF_WCHAR_T; - - cres = iconv(m2w, - ICONV_CHAR_CAST(&pszPtr), &inbuf, - (char**)&bufPtr, &outbuf ); - - res += 8 - (outbuf / SIZEOF_WCHAR_T); - } - while ((cres == (size_t)-1) && (errno == E2BIG)); - } - - if (ICONV_FAILED(cres, inbuf)) - { - //VS: it is ok if iconv fails, hence trace only - wxLogTrace(TRACE_STRCONV, wxT("iconv failed: %s"), wxSysErrorMsg(wxSysErrorCode())); - return wxCONV_FAILED; - } - - return res; -} - -size_t wxMBConv_iconv::WC2MB(char *buf, const wchar_t *psz, size_t n) const -{ -#if wxUSE_THREADS - // NB: explained in MB2WC - wxMutexLocker lock(wxConstCast(this, wxMBConv_iconv)->m_iconvMutex); -#endif - - size_t inlen = wxWcslen(psz); - size_t inbuf = inlen * SIZEOF_WCHAR_T; - size_t outbuf = n; - size_t res, cres; - - wchar_t *tmpbuf = 0; - - if (ms_wcNeedsSwap) - { - // need to copy to temp buffer to switch endianness - // (doing WC_BSWAP twice on the original buffer won't help, as it - // could be in read-only memory, or be accessed in some other thread) - tmpbuf = (wchar_t *)malloc(inbuf + SIZEOF_WCHAR_T); - for ( size_t i = 0; i < inlen; i++ ) - tmpbuf[n] = WC_BSWAP(psz[i]); - - tmpbuf[inlen] = L'\0'; - psz = tmpbuf; - } - - if (buf) - { - // have destination buffer, convert there - cres = iconv( w2m, ICONV_CHAR_CAST(&psz), &inbuf, &buf, &outbuf ); - - res = n - outbuf; - - // NB: iconv was given only wcslen(psz) characters on input, and so - // it couldn't convert the trailing zero. Let's do it ourselves - // if there's some room left for it in the output buffer. - if (res < n) - buf[0] = 0; - } - else - { - // no destination buffer: convert using temp buffer - // to calculate destination buffer requirement - char tbuf[16]; - res = 0; - do - { - buf = tbuf; - outbuf = 16; - - cres = iconv( w2m, ICONV_CHAR_CAST(&psz), &inbuf, &buf, &outbuf ); - - res += 16 - outbuf; - } - while ((cres == (size_t)-1) && (errno == E2BIG)); - } - - if (ms_wcNeedsSwap) - { - free(tmpbuf); - } - - if (ICONV_FAILED(cres, inbuf)) - { - wxLogTrace(TRACE_STRCONV, wxT("iconv failed: %s"), wxSysErrorMsg(wxSysErrorCode())); - return wxCONV_FAILED; - } - - return res; -} - -size_t wxMBConv_iconv::GetMBNulLen() const -{ - if ( m_minMBCharWidth == 0 ) - { - wxMBConv_iconv * const self = wxConstCast(this, wxMBConv_iconv); - -#if wxUSE_THREADS - // NB: explained in MB2WC - wxMutexLocker lock(self->m_iconvMutex); -#endif - - const wchar_t *wnul = L""; - char buf[8]; // should be enough for NUL in any encoding - size_t inLen = sizeof(wchar_t), - outLen = WXSIZEOF(buf); - char *inBuff = (char *)wnul; - char *outBuff = buf; - if ( iconv(w2m, ICONV_CHAR_CAST(&inBuff), &inLen, &outBuff, &outLen) == (size_t)-1 ) - { - self->m_minMBCharWidth = (size_t)-1; - } - else // ok - { - self->m_minMBCharWidth = outBuff - buf; - } - } - - return m_minMBCharWidth; -} - -#endif // HAVE_ICONV - - -// ============================================================================ -// Win32 conversion classes -// ============================================================================ - -#ifdef wxHAVE_WIN32_MB2WC - -// from utils.cpp -#if wxUSE_FONTMAP -extern WXDLLIMPEXP_BASE long wxCharsetToCodepage(const wxChar *charset); -extern WXDLLIMPEXP_BASE long wxEncodingToCodepage(wxFontEncoding encoding); -#endif - -class wxMBConv_win32 : public wxMBConv -{ -public: - wxMBConv_win32() - { - m_CodePage = CP_ACP; - m_minMBCharWidth = 0; - } - - wxMBConv_win32(const wxMBConv_win32& conv) - : wxMBConv() - { - m_CodePage = conv.m_CodePage; - m_minMBCharWidth = conv.m_minMBCharWidth; - } - -#if wxUSE_FONTMAP - wxMBConv_win32(const wxChar* name) - { - m_CodePage = wxCharsetToCodepage(name); - m_minMBCharWidth = 0; - } - - wxMBConv_win32(wxFontEncoding encoding) - { - m_CodePage = wxEncodingToCodepage(encoding); - m_minMBCharWidth = 0; - } -#endif // wxUSE_FONTMAP - - virtual size_t MB2WC(wchar_t *buf, const char *psz, size_t n) const - { - // note that we have to use MB_ERR_INVALID_CHARS flag as it without it - // the behaviour is not compatible with the Unix version (using iconv) - // and break the library itself, e.g. wxTextInputStream::NextChar() - // wouldn't work if reading an incomplete MB char didn't result in an - // error - // - // Moreover, MB_ERR_INVALID_CHARS is only supported on Win 2K SP4 or - // Win XP or newer and it is not supported for UTF-[78] so we always - // use our own conversions in this case. See - // http://blogs.msdn.com/michkap/archive/2005/04/19/409566.aspx - // http://msdn.microsoft.com/library/en-us/intl/unicode_17si.asp - if ( m_CodePage == CP_UTF8 ) - { - return wxConvUTF8.MB2WC(buf, psz, n); - } - - if ( m_CodePage == CP_UTF7 ) - { - return wxConvUTF7.MB2WC(buf, psz, n); - } - - int flags = 0; - if ( (m_CodePage < 50000 && m_CodePage != CP_SYMBOL) && - IsAtLeastWin2kSP4() ) - { - flags = MB_ERR_INVALID_CHARS; - } - - const size_t len = ::MultiByteToWideChar - ( - m_CodePage, // code page - flags, // flags: fall on error - psz, // input string - -1, // its length (NUL-terminated) - buf, // output string - buf ? n : 0 // size of output buffer - ); - if ( !len ) - { - // function totally failed - return wxCONV_FAILED; - } - - // if we were really converting and didn't use MB_ERR_INVALID_CHARS, - // check if we succeeded, by doing a double trip: - if ( !flags && buf ) - { - const size_t mbLen = strlen(psz); - wxCharBuffer mbBuf(mbLen); - if ( ::WideCharToMultiByte - ( - m_CodePage, - 0, - buf, - -1, - mbBuf.data(), - mbLen + 1, // size in bytes, not length - NULL, - NULL - ) == 0 || - strcmp(mbBuf, psz) != 0 ) - { - // we didn't obtain the same thing we started from, hence - // the conversion was lossy and we consider that it failed - return wxCONV_FAILED; - } - } - - // note that it returns count of written chars for buf != NULL and size - // of the needed buffer for buf == NULL so in either case the length of - // the string (which never includes the terminating NUL) is one less - return len - 1; - } - - virtual size_t WC2MB(char *buf, const wchar_t *pwz, size_t n) const - { - /* - we have a problem here: by default, WideCharToMultiByte() may - replace characters unrepresentable in the target code page with bad - quality approximations such as turning "1/2" symbol (U+00BD) into - "1" for the code pages which don't have it and we, obviously, want - to avoid this at any price - - the trouble is that this function does it _silently_, i.e. it won't - even tell us whether it did or not... Win98/2000 and higher provide - WC_NO_BEST_FIT_CHARS but it doesn't work for the older systems and - we have to resort to a round trip, i.e. check that converting back - results in the same string -- this is, of course, expensive but - otherwise we simply can't be sure to not garble the data. - */ - - // determine if we can rely on WC_NO_BEST_FIT_CHARS: according to MSDN - // it doesn't work with CJK encodings (which we test for rather roughly - // here...) nor with UTF-7/8 nor, of course, with Windows versions not - // supporting it - BOOL usedDef wxDUMMY_INITIALIZE(false); - BOOL *pUsedDef; - int flags; - if ( CanUseNoBestFit() && m_CodePage < 50000 ) - { - // it's our lucky day - flags = WC_NO_BEST_FIT_CHARS; - pUsedDef = &usedDef; - } - else // old system or unsupported encoding - { - flags = 0; - pUsedDef = NULL; - } - - const size_t len = ::WideCharToMultiByte - ( - m_CodePage, // code page - flags, // either none or no best fit - pwz, // input string - -1, // it is (wide) NUL-terminated - buf, // output buffer - buf ? n : 0, // and its size - NULL, // default "replacement" char - pUsedDef // [out] was it used? - ); - - if ( !len ) - { - // function totally failed - return wxCONV_FAILED; - } - - // if we were really converting, check if we succeeded - if ( buf ) - { - if ( flags ) - { - // check if the conversion failed, i.e. if any replacements - // were done - if ( usedDef ) - return wxCONV_FAILED; - } - else // we must resort to double tripping... - { - wxWCharBuffer wcBuf(n); - if ( MB2WC(wcBuf.data(), buf, n) == wxCONV_FAILED || - wcscmp(wcBuf, pwz) != 0 ) - { - // we didn't obtain the same thing we started from, hence - // the conversion was lossy and we consider that it failed - return wxCONV_FAILED; - } - } - } - - // see the comment above for the reason of "len - 1" - return len - 1; - } - - virtual size_t GetMBNulLen() const - { - if ( m_minMBCharWidth == 0 ) - { - int len = ::WideCharToMultiByte - ( - m_CodePage, // code page - 0, // no flags - L"", // input string - 1, // translate just the NUL - NULL, // output buffer - 0, // and its size - NULL, // no replacement char - NULL // [out] don't care if it was used - ); - - wxMBConv_win32 * const self = wxConstCast(this, wxMBConv_win32); - switch ( len ) - { - default: - wxLogDebug(_T("Unexpected NUL length %d"), len); - self->m_minMBCharWidth = (size_t)-1; - break; - - case 0: - self->m_minMBCharWidth = (size_t)-1; - break; - - case 1: - case 2: - case 4: - self->m_minMBCharWidth = len; - break; - } - } - - return m_minMBCharWidth; - } - - virtual wxMBConv *Clone() const { return new wxMBConv_win32(*this); } - - bool IsOk() const { return m_CodePage != -1; } - -private: - static bool CanUseNoBestFit() - { - static int s_isWin98Or2k = -1; - - if ( s_isWin98Or2k == -1 ) - { - int verMaj, verMin; - switch ( wxGetOsVersion(&verMaj, &verMin) ) - { - case wxOS_WINDOWS_9X: - s_isWin98Or2k = verMaj >= 4 && verMin >= 10; - break; - - case wxOS_WINDOWS_NT: - s_isWin98Or2k = verMaj >= 5; - break; - - default: - // unknown: be conservative by default - s_isWin98Or2k = 0; - break; - } - - wxASSERT_MSG( s_isWin98Or2k != -1, _T("should be set above") ); - } - - return s_isWin98Or2k == 1; - } - - static bool IsAtLeastWin2kSP4() - { -#ifdef __WXWINCE__ - return false; -#else - static int s_isAtLeastWin2kSP4 = -1; - - if ( s_isAtLeastWin2kSP4 == -1 ) - { - OSVERSIONINFOEX ver; - - memset(&ver, 0, sizeof(ver)); - ver.dwOSVersionInfoSize = sizeof(ver); - GetVersionEx((OSVERSIONINFO*)&ver); - - s_isAtLeastWin2kSP4 = - ((ver.dwMajorVersion > 5) || // Vista+ - (ver.dwMajorVersion == 5 && ver.dwMinorVersion > 0) || // XP/2003 - (ver.dwMajorVersion == 5 && ver.dwMinorVersion == 0 && - ver.wServicePackMajor >= 4)) // 2000 SP4+ - ? 1 : 0; - } - - return s_isAtLeastWin2kSP4 == 1; -#endif - } - - - // the code page we're working with - long m_CodePage; - - // cached result of GetMBNulLen(), set to 0 initially meaning - // "unknown" - size_t m_minMBCharWidth; -}; - -#endif // wxHAVE_WIN32_MB2WC - -// ============================================================================ -// Cocoa conversion classes -// ============================================================================ - -#if defined(__WXCOCOA__) - -// RN: There is no UTF-32 support in either Core Foundation or Cocoa. -// Strangely enough, internally Core Foundation uses -// UTF-32 internally quite a bit - its just not public (yet). - -#include -#include - -CFStringEncoding wxCFStringEncFromFontEnc(wxFontEncoding encoding) -{ - CFStringEncoding enc = kCFStringEncodingInvalidId ; - - switch (encoding) - { - case wxFONTENCODING_DEFAULT : - enc = CFStringGetSystemEncoding(); - break ; - - case wxFONTENCODING_ISO8859_1 : - enc = kCFStringEncodingISOLatin1 ; - break ; - case wxFONTENCODING_ISO8859_2 : - enc = kCFStringEncodingISOLatin2; - break ; - case wxFONTENCODING_ISO8859_3 : - enc = kCFStringEncodingISOLatin3 ; - break ; - case wxFONTENCODING_ISO8859_4 : - enc = kCFStringEncodingISOLatin4; - break ; - case wxFONTENCODING_ISO8859_5 : - enc = kCFStringEncodingISOLatinCyrillic; - break ; - case wxFONTENCODING_ISO8859_6 : - enc = kCFStringEncodingISOLatinArabic; - break ; - case wxFONTENCODING_ISO8859_7 : - enc = kCFStringEncodingISOLatinGreek; - break ; - case wxFONTENCODING_ISO8859_8 : - enc = kCFStringEncodingISOLatinHebrew; - break ; - case wxFONTENCODING_ISO8859_9 : - enc = kCFStringEncodingISOLatin5; - break ; - case wxFONTENCODING_ISO8859_10 : - enc = kCFStringEncodingISOLatin6; - break ; - case wxFONTENCODING_ISO8859_11 : - enc = kCFStringEncodingISOLatinThai; - break ; - case wxFONTENCODING_ISO8859_13 : - enc = kCFStringEncodingISOLatin7; - break ; - case wxFONTENCODING_ISO8859_14 : - enc = kCFStringEncodingISOLatin8; - break ; - case wxFONTENCODING_ISO8859_15 : - enc = kCFStringEncodingISOLatin9; - break ; - - case wxFONTENCODING_KOI8 : - enc = kCFStringEncodingKOI8_R; - break ; - case wxFONTENCODING_ALTERNATIVE : // MS-DOS CP866 - enc = kCFStringEncodingDOSRussian; - break ; - -// case wxFONTENCODING_BULGARIAN : -// enc = ; -// break ; - - case wxFONTENCODING_CP437 : - enc = kCFStringEncodingDOSLatinUS ; - break ; - case wxFONTENCODING_CP850 : - enc = kCFStringEncodingDOSLatin1; - break ; - case wxFONTENCODING_CP852 : - enc = kCFStringEncodingDOSLatin2; - break ; - case wxFONTENCODING_CP855 : - enc = kCFStringEncodingDOSCyrillic; - break ; - case wxFONTENCODING_CP866 : - enc = kCFStringEncodingDOSRussian ; - break ; - case wxFONTENCODING_CP874 : - enc = kCFStringEncodingDOSThai; - break ; - case wxFONTENCODING_CP932 : - enc = kCFStringEncodingDOSJapanese; - break ; - case wxFONTENCODING_CP936 : - enc = kCFStringEncodingDOSChineseSimplif ; - break ; - case wxFONTENCODING_CP949 : - enc = kCFStringEncodingDOSKorean; - break ; - case wxFONTENCODING_CP950 : - enc = kCFStringEncodingDOSChineseTrad; - break ; - case wxFONTENCODING_CP1250 : - enc = kCFStringEncodingWindowsLatin2; - break ; - case wxFONTENCODING_CP1251 : - enc = kCFStringEncodingWindowsCyrillic ; - break ; - case wxFONTENCODING_CP1252 : - enc = kCFStringEncodingWindowsLatin1 ; - break ; - case wxFONTENCODING_CP1253 : - enc = kCFStringEncodingWindowsGreek; - break ; - case wxFONTENCODING_CP1254 : - enc = kCFStringEncodingWindowsLatin5; - break ; - case wxFONTENCODING_CP1255 : - enc = kCFStringEncodingWindowsHebrew ; - break ; - case wxFONTENCODING_CP1256 : - enc = kCFStringEncodingWindowsArabic ; - break ; - case wxFONTENCODING_CP1257 : - enc = kCFStringEncodingWindowsBalticRim; - break ; -// This only really encodes to UTF7 (if that) evidently -// case wxFONTENCODING_UTF7 : -// enc = kCFStringEncodingNonLossyASCII ; -// break ; - case wxFONTENCODING_UTF8 : - enc = kCFStringEncodingUTF8 ; - break ; - case wxFONTENCODING_EUC_JP : - enc = kCFStringEncodingEUC_JP; - break ; - case wxFONTENCODING_UTF16 : - enc = kCFStringEncodingUnicode ; - break ; - case wxFONTENCODING_MACROMAN : - enc = kCFStringEncodingMacRoman ; - break ; - case wxFONTENCODING_MACJAPANESE : - enc = kCFStringEncodingMacJapanese ; - break ; - case wxFONTENCODING_MACCHINESETRAD : - enc = kCFStringEncodingMacChineseTrad ; - break ; - case wxFONTENCODING_MACKOREAN : - enc = kCFStringEncodingMacKorean ; - break ; - case wxFONTENCODING_MACARABIC : - enc = kCFStringEncodingMacArabic ; - break ; - case wxFONTENCODING_MACHEBREW : - enc = kCFStringEncodingMacHebrew ; - break ; - case wxFONTENCODING_MACGREEK : - enc = kCFStringEncodingMacGreek ; - break ; - case wxFONTENCODING_MACCYRILLIC : - enc = kCFStringEncodingMacCyrillic ; - break ; - case wxFONTENCODING_MACDEVANAGARI : - enc = kCFStringEncodingMacDevanagari ; - break ; - case wxFONTENCODING_MACGURMUKHI : - enc = kCFStringEncodingMacGurmukhi ; - break ; - case wxFONTENCODING_MACGUJARATI : - enc = kCFStringEncodingMacGujarati ; - break ; - case wxFONTENCODING_MACORIYA : - enc = kCFStringEncodingMacOriya ; - break ; - case wxFONTENCODING_MACBENGALI : - enc = kCFStringEncodingMacBengali ; - break ; - case wxFONTENCODING_MACTAMIL : - enc = kCFStringEncodingMacTamil ; - break ; - case wxFONTENCODING_MACTELUGU : - enc = kCFStringEncodingMacTelugu ; - break ; - case wxFONTENCODING_MACKANNADA : - enc = kCFStringEncodingMacKannada ; - break ; - case wxFONTENCODING_MACMALAJALAM : - enc = kCFStringEncodingMacMalayalam ; - break ; - case wxFONTENCODING_MACSINHALESE : - enc = kCFStringEncodingMacSinhalese ; - break ; - case wxFONTENCODING_MACBURMESE : - enc = kCFStringEncodingMacBurmese ; - break ; - case wxFONTENCODING_MACKHMER : - enc = kCFStringEncodingMacKhmer ; - break ; - case wxFONTENCODING_MACTHAI : - enc = kCFStringEncodingMacThai ; - break ; - case wxFONTENCODING_MACLAOTIAN : - enc = kCFStringEncodingMacLaotian ; - break ; - case wxFONTENCODING_MACGEORGIAN : - enc = kCFStringEncodingMacGeorgian ; - break ; - case wxFONTENCODING_MACARMENIAN : - enc = kCFStringEncodingMacArmenian ; - break ; - case wxFONTENCODING_MACCHINESESIMP : - enc = kCFStringEncodingMacChineseSimp ; - break ; - case wxFONTENCODING_MACTIBETAN : - enc = kCFStringEncodingMacTibetan ; - break ; - case wxFONTENCODING_MACMONGOLIAN : - enc = kCFStringEncodingMacMongolian ; - break ; - case wxFONTENCODING_MACETHIOPIC : - enc = kCFStringEncodingMacEthiopic ; - break ; - case wxFONTENCODING_MACCENTRALEUR : - enc = kCFStringEncodingMacCentralEurRoman ; - break ; - case wxFONTENCODING_MACVIATNAMESE : - enc = kCFStringEncodingMacVietnamese ; - break ; - case wxFONTENCODING_MACARABICEXT : - enc = kCFStringEncodingMacExtArabic ; - break ; - case wxFONTENCODING_MACSYMBOL : - enc = kCFStringEncodingMacSymbol ; - break ; - case wxFONTENCODING_MACDINGBATS : - enc = kCFStringEncodingMacDingbats ; - break ; - case wxFONTENCODING_MACTURKISH : - enc = kCFStringEncodingMacTurkish ; - break ; - case wxFONTENCODING_MACCROATIAN : - enc = kCFStringEncodingMacCroatian ; - break ; - case wxFONTENCODING_MACICELANDIC : - enc = kCFStringEncodingMacIcelandic ; - break ; - case wxFONTENCODING_MACROMANIAN : - enc = kCFStringEncodingMacRomanian ; - break ; - case wxFONTENCODING_MACCELTIC : - enc = kCFStringEncodingMacCeltic ; - break ; - case wxFONTENCODING_MACGAELIC : - enc = kCFStringEncodingMacGaelic ; - break ; -// case wxFONTENCODING_MACKEYBOARD : -// enc = kCFStringEncodingMacKeyboardGlyphs ; -// break ; - - default : - // because gcc is picky - break ; - } - - return enc ; -} - -class wxMBConv_cocoa : public wxMBConv -{ -public: - wxMBConv_cocoa() - { - Init(CFStringGetSystemEncoding()) ; - } - - wxMBConv_cocoa(const wxMBConv_cocoa& conv) - { - m_encoding = conv.m_encoding; - } - -#if wxUSE_FONTMAP - wxMBConv_cocoa(const wxChar* name) - { - Init( wxCFStringEncFromFontEnc(wxFontMapperBase::Get()->CharsetToEncoding(name, false) ) ) ; - } -#endif - - wxMBConv_cocoa(wxFontEncoding encoding) - { - Init( wxCFStringEncFromFontEnc(encoding) ); - } - - virtual ~wxMBConv_cocoa() - { - } - - void Init( CFStringEncoding encoding) - { - m_encoding = encoding ; - } - - size_t MB2WC(wchar_t * szOut, const char * szUnConv, size_t nOutSize) const - { - wxASSERT(szUnConv); - - CFStringRef theString = CFStringCreateWithBytes ( - NULL, //the allocator - (const UInt8*)szUnConv, - strlen(szUnConv), - m_encoding, - false //no BOM/external representation - ); - - wxASSERT(theString); - - size_t nOutLength = CFStringGetLength(theString); - - if (szOut == NULL) - { - CFRelease(theString); - return nOutLength; - } - - CFRange theRange = { 0, nOutSize }; - -#if SIZEOF_WCHAR_T == 4 - UniChar* szUniCharBuffer = new UniChar[nOutSize]; -#endif - - CFStringGetCharacters(theString, theRange, szUniCharBuffer); - - CFRelease(theString); - - szUniCharBuffer[nOutLength] = '\0'; - -#if SIZEOF_WCHAR_T == 4 - wxMBConvUTF16 converter; - converter.MB2WC( szOut, (const char*)szUniCharBuffer, nOutSize ); - delete [] szUniCharBuffer; -#endif - - return nOutLength; - } - - size_t WC2MB(char *szOut, const wchar_t *szUnConv, size_t nOutSize) const - { - wxASSERT(szUnConv); - - size_t nRealOutSize; - size_t nBufSize = wxWcslen(szUnConv); - UniChar* szUniBuffer = (UniChar*) szUnConv; - -#if SIZEOF_WCHAR_T == 4 - wxMBConvUTF16 converter ; - nBufSize = converter.WC2MB( NULL, szUnConv, 0 ); - szUniBuffer = new UniChar[ (nBufSize / sizeof(UniChar)) + 1]; - converter.WC2MB( (char*) szUniBuffer, szUnConv, nBufSize + sizeof(UniChar)); - nBufSize /= sizeof(UniChar); -#endif - - CFStringRef theString = CFStringCreateWithCharactersNoCopy( - NULL, //allocator - szUniBuffer, - nBufSize, - kCFAllocatorNull //deallocator - we want to deallocate it ourselves - ); - - wxASSERT(theString); - - //Note that CER puts a BOM when converting to unicode - //so we check and use getchars instead in that case - if (m_encoding == kCFStringEncodingUnicode) - { - if (szOut != NULL) - CFStringGetCharacters(theString, CFRangeMake(0, nOutSize - 1), (UniChar*) szOut); - - nRealOutSize = CFStringGetLength(theString) + 1; - } - else - { - CFStringGetBytes( - theString, - CFRangeMake(0, CFStringGetLength(theString)), - m_encoding, - 0, //what to put in characters that can't be converted - - //0 tells CFString to return NULL if it meets such a character - false, //not an external representation - (UInt8*) szOut, - nOutSize, - (CFIndex*) &nRealOutSize - ); - } - - CFRelease(theString); - -#if SIZEOF_WCHAR_T == 4 - delete[] szUniBuffer; -#endif - - return nRealOutSize - 1; - } - - virtual wxMBConv *Clone() const { return new wxMBConv_cocoa(*this); } - - bool IsOk() const - { - return m_encoding != kCFStringEncodingInvalidId && - CFStringIsEncodingAvailable(m_encoding); - } - -private: - CFStringEncoding m_encoding ; -}; - -#endif // defined(__WXCOCOA__) - -// ============================================================================ -// Mac conversion classes -// ============================================================================ - -#if defined(__WXMAC__) && defined(TARGET_CARBON) - -class wxMBConv_mac : public wxMBConv -{ -public: - wxMBConv_mac() - { - Init(CFStringGetSystemEncoding()) ; - } - - wxMBConv_mac(const wxMBConv_mac& conv) - { - Init(conv.m_char_encoding); - } - -#if wxUSE_FONTMAP - wxMBConv_mac(const wxChar* name) - { - wxFontEncoding enc = wxFontMapperBase::Get()->CharsetToEncoding(name, false); - Init( (enc != wxFONTENCODING_SYSTEM) ? wxMacGetSystemEncFromFontEnc( enc ) : kTextEncodingUnknown); - } -#endif - - wxMBConv_mac(wxFontEncoding encoding) - { - Init( wxMacGetSystemEncFromFontEnc(encoding) ); - } - - virtual ~wxMBConv_mac() - { - OSStatus status = noErr ; - if (m_MB2WC_converter) - status = TECDisposeConverter(m_MB2WC_converter); - if (m_WC2MB_converter) - status = TECDisposeConverter(m_WC2MB_converter); - } - - void Init( TextEncodingBase encoding,TextEncodingVariant encodingVariant = kTextEncodingDefaultVariant , - TextEncodingFormat encodingFormat = kTextEncodingDefaultFormat) - { - m_MB2WC_converter = NULL ; - m_WC2MB_converter = NULL ; - if ( encoding != kTextEncodingUnknown ) - { - m_char_encoding = CreateTextEncoding(encoding, encodingVariant, encodingFormat) ; - m_unicode_encoding = CreateTextEncoding(kTextEncodingUnicodeDefault, 0, kUnicode16BitFormat) ; - } - else - { - m_char_encoding = kTextEncodingUnknown; - m_unicode_encoding = kTextEncodingUnknown; - } - } - - virtual void CreateIfNeeded() const - { - if ( m_MB2WC_converter == NULL && m_WC2MB_converter == NULL && - m_char_encoding != kTextEncodingUnknown && m_unicode_encoding != kTextEncodingUnknown ) - { - OSStatus status = noErr ; - status = TECCreateConverter(&m_MB2WC_converter, - m_char_encoding, - m_unicode_encoding); - wxASSERT_MSG( status == noErr , _("Unable to create TextEncodingConverter")) ; - status = TECCreateConverter(&m_WC2MB_converter, - m_unicode_encoding, - m_char_encoding); - wxASSERT_MSG( status == noErr , _("Unable to create TextEncodingConverter")) ; - } - } - - size_t MB2WC(wchar_t *buf, const char *psz, size_t n) const - { - CreateIfNeeded() ; - OSStatus status = noErr ; - ByteCount byteOutLen ; - ByteCount byteInLen = strlen(psz) + 1; - wchar_t *tbuf = NULL ; - UniChar* ubuf = NULL ; - size_t res = 0 ; - - if (buf == NULL) - { - // Apple specs say at least 32 - n = wxMax( 32, byteInLen ) ; - tbuf = (wchar_t*) malloc( n * SIZEOF_WCHAR_T ) ; - } - - ByteCount byteBufferLen = n * sizeof( UniChar ) ; - -#if SIZEOF_WCHAR_T == 4 - ubuf = (UniChar*) malloc( byteBufferLen + 2 ) ; -#else - ubuf = (UniChar*) (buf ? buf : tbuf) ; -#endif - { -#if wxUSE_THREADS - wxMutexLocker lock( m_MB2WC_guard ); -#endif - status = TECConvertText( - m_MB2WC_converter, (ConstTextPtr) psz, byteInLen, &byteInLen, - (TextPtr) ubuf, byteBufferLen, &byteOutLen); - } - -#if SIZEOF_WCHAR_T == 4 - // we have to terminate here, because n might be larger for the trailing zero, and if UniChar - // is not properly terminated we get random characters at the end - ubuf[byteOutLen / sizeof( UniChar ) ] = 0 ; - wxMBConvUTF16 converter ; - res = converter.MB2WC( (buf ? buf : tbuf), (const char*)ubuf, n ) ; - free( ubuf ) ; -#else - res = byteOutLen / sizeof( UniChar ) ; -#endif - - if ( buf == NULL ) - free(tbuf) ; - - if ( buf && res < n) - buf[res] = 0; - - return res ; - } - - size_t WC2MB(char *buf, const wchar_t *psz, size_t n) const - { - CreateIfNeeded() ; - OSStatus status = noErr ; - ByteCount byteOutLen ; - ByteCount byteInLen = wxWcslen(psz) * SIZEOF_WCHAR_T ; - - char *tbuf = NULL ; - - if (buf == NULL) - { - // Apple specs say at least 32 - n = wxMax( 32, ((byteInLen / SIZEOF_WCHAR_T) * 8) + SIZEOF_WCHAR_T ); - tbuf = (char*) malloc( n ) ; - } - - ByteCount byteBufferLen = n ; - UniChar* ubuf = NULL ; - -#if SIZEOF_WCHAR_T == 4 - wxMBConvUTF16 converter ; - size_t unicharlen = converter.WC2MB( NULL, psz, 0 ) ; - byteInLen = unicharlen ; - ubuf = (UniChar*) malloc( byteInLen + 2 ) ; - converter.WC2MB( (char*) ubuf, psz, unicharlen + 2 ) ; -#else - ubuf = (UniChar*) psz ; -#endif - - { -#if wxUSE_THREADS - wxMutexLocker lock( m_WC2MB_guard ); -#endif - status = TECConvertText( - m_WC2MB_converter, (ConstTextPtr) ubuf, byteInLen, &byteInLen, - (TextPtr) (buf ? buf : tbuf), byteBufferLen, &byteOutLen); - } - -#if SIZEOF_WCHAR_T == 4 - free( ubuf ) ; -#endif - - if ( buf == NULL ) - free(tbuf) ; - - size_t res = byteOutLen ; - if ( buf && res < n) - { - buf[res] = 0; - - //we need to double-trip to verify it didn't insert any ? in place - //of bogus characters - wxWCharBuffer wcBuf(n); - size_t pszlen = wxWcslen(psz); - if ( MB2WC(wcBuf.data(), buf, n) == wxCONV_FAILED || - wxWcslen(wcBuf) != pszlen || - memcmp(wcBuf, psz, pszlen * sizeof(wchar_t)) != 0 ) - { - // we didn't obtain the same thing we started from, hence - // the conversion was lossy and we consider that it failed - return wxCONV_FAILED; - } - } - - return res ; - } - - virtual wxMBConv *Clone() const { return new wxMBConv_mac(*this); } - - bool IsOk() const - { - CreateIfNeeded() ; - return m_MB2WC_converter != NULL && m_WC2MB_converter != NULL; - } - -protected : - mutable TECObjectRef m_MB2WC_converter; - mutable TECObjectRef m_WC2MB_converter; -#if wxUSE_THREADS - mutable wxMutex m_MB2WC_guard; - mutable wxMutex m_WC2MB_guard; -#endif - - TextEncodingBase m_char_encoding; - TextEncodingBase m_unicode_encoding; -}; - -// MB is decomposed (D) normalized UTF8 - -class wxMBConv_macUTF8D : public wxMBConv_mac -{ -public : - wxMBConv_macUTF8D() - { - Init( kTextEncodingUnicodeDefault , kUnicodeNoSubset , kUnicodeUTF8Format ) ; - m_uni = NULL; - m_uniBack = NULL ; - } - - virtual ~wxMBConv_macUTF8D() - { - if (m_uni!=NULL) - DisposeUnicodeToTextInfo(&m_uni); - if (m_uniBack!=NULL) - DisposeUnicodeToTextInfo(&m_uniBack); - } - - size_t WC2MB(char *buf, const wchar_t *psz, size_t n) const - { - CreateIfNeeded() ; - OSStatus status = noErr ; - ByteCount byteOutLen ; - ByteCount byteInLen = wxWcslen(psz) * SIZEOF_WCHAR_T ; - - char *tbuf = NULL ; - - if (buf == NULL) - { - // Apple specs say at least 32 - n = wxMax( 32, ((byteInLen / SIZEOF_WCHAR_T) * 8) + SIZEOF_WCHAR_T ); - tbuf = (char*) malloc( n ) ; - } - - ByteCount byteBufferLen = n ; - UniChar* ubuf = NULL ; - -#if SIZEOF_WCHAR_T == 4 - wxMBConvUTF16 converter ; - size_t unicharlen = converter.WC2MB( NULL, psz, 0 ) ; - byteInLen = unicharlen ; - ubuf = (UniChar*) malloc( byteInLen + 2 ) ; - converter.WC2MB( (char*) ubuf, psz, unicharlen + 2 ) ; -#else - ubuf = (UniChar*) psz ; -#endif - - // ubuf is a non-decomposed UniChar buffer - - ByteCount dcubuflen = byteInLen * 2 + 2 ; - ByteCount dcubufread , dcubufwritten ; - UniChar *dcubuf = (UniChar*) malloc( dcubuflen ) ; - - { -#if wxUSE_THREADS - wxMutexLocker lock( m_WC2MB_guard ); -#endif - ConvertFromUnicodeToText( m_uni , byteInLen , ubuf , - kUnicodeDefaultDirectionMask, 0, NULL, NULL, NULL, dcubuflen , &dcubufread , &dcubufwritten , dcubuf ) ; - - // we now convert that decomposed buffer into UTF8 - - status = TECConvertText( - m_WC2MB_converter, (ConstTextPtr) dcubuf, dcubufwritten, &dcubufread, - (TextPtr) (buf ? buf : tbuf), byteBufferLen, &byteOutLen); - } - - free( dcubuf ); - -#if SIZEOF_WCHAR_T == 4 - free( ubuf ) ; -#endif - - if ( buf == NULL ) - free(tbuf) ; - - size_t res = byteOutLen ; - if ( buf && res < n) - { - buf[res] = 0; - // don't test for round-trip fidelity yet, we cannot guarantee it yet - } - - return res ; - } - - size_t MB2WC(wchar_t *buf, const char *psz, size_t n) const - { - CreateIfNeeded() ; - OSStatus status = noErr ; - ByteCount byteOutLen ; - ByteCount byteInLen = strlen(psz) + 1; - wchar_t *tbuf = NULL ; - UniChar* ubuf = NULL ; - size_t res = 0 ; - - if (buf == NULL) - { - // Apple specs say at least 32 - n = wxMax( 32, byteInLen ) ; - tbuf = (wchar_t*) malloc( n * SIZEOF_WCHAR_T ) ; - } - - ByteCount byteBufferLen = n * sizeof( UniChar ) ; - -#if SIZEOF_WCHAR_T == 4 - ubuf = (UniChar*) malloc( byteBufferLen + 2 ) ; -#else - ubuf = (UniChar*) (buf ? buf : tbuf) ; -#endif - - ByteCount dcubuflen = byteBufferLen * 2 + 2 ; - ByteCount dcubufread , dcubufwritten ; - UniChar *dcubuf = (UniChar*) malloc( dcubuflen ) ; - - { -#if wxUSE_THREADS - wxMutexLocker lock( m_MB2WC_guard ); -#endif - status = TECConvertText( - m_MB2WC_converter, (ConstTextPtr) psz, byteInLen, &byteInLen, - (TextPtr) dcubuf, dcubuflen, &byteOutLen); - // we have to terminate here, because n might be larger for the trailing zero, and if UniChar - // is not properly terminated we get random characters at the end - dcubuf[byteOutLen / sizeof( UniChar ) ] = 0 ; - - // now from the decomposed UniChar to properly composed uniChar - ConvertFromUnicodeToText( m_uniBack , byteOutLen , dcubuf , - kUnicodeDefaultDirectionMask, 0, NULL, NULL, NULL, dcubuflen , &dcubufread , &dcubufwritten , ubuf ) ; - } - - free( dcubuf ); - byteOutLen = dcubufwritten ; - ubuf[byteOutLen / sizeof( UniChar ) ] = 0 ; - - -#if SIZEOF_WCHAR_T == 4 - wxMBConvUTF16 converter ; - res = converter.MB2WC( (buf ? buf : tbuf), (const char*)ubuf, n ) ; - free( ubuf ) ; -#else - res = byteOutLen / sizeof( UniChar ) ; -#endif - - if ( buf == NULL ) - free(tbuf) ; - - if ( buf && res < n) - buf[res] = 0; - - return res ; - } - - virtual void CreateIfNeeded() const - { - wxMBConv_mac::CreateIfNeeded() ; - if ( m_uni == NULL ) - { - m_map.unicodeEncoding = CreateTextEncoding(kTextEncodingUnicodeDefault, - kUnicodeNoSubset, kTextEncodingDefaultFormat); - m_map.otherEncoding = CreateTextEncoding(kTextEncodingUnicodeDefault, - kUnicodeCanonicalDecompVariant, kTextEncodingDefaultFormat); - m_map.mappingVersion = kUnicodeUseLatestMapping; - - OSStatus err = CreateUnicodeToTextInfo(&m_map, &m_uni); - wxASSERT_MSG( err == noErr , _(" Couldn't create the UnicodeConverter")) ; - - m_map.unicodeEncoding = CreateTextEncoding(kTextEncodingUnicodeDefault, - kUnicodeNoSubset, kTextEncodingDefaultFormat); - m_map.otherEncoding = CreateTextEncoding(kTextEncodingUnicodeDefault, - kUnicodeCanonicalCompVariant, kTextEncodingDefaultFormat); - m_map.mappingVersion = kUnicodeUseLatestMapping; - err = CreateUnicodeToTextInfo(&m_map, &m_uniBack); - wxASSERT_MSG( err == noErr , _(" Couldn't create the UnicodeConverter")) ; - } - } -protected : - mutable UnicodeToTextInfo m_uni; - mutable UnicodeToTextInfo m_uniBack; - mutable UnicodeMapping m_map; -}; -#endif // defined(__WXMAC__) && defined(TARGET_CARBON) - -// ============================================================================ -// wxEncodingConverter based conversion classes -// ============================================================================ - -#if wxUSE_FONTMAP - -class wxMBConv_wxwin : public wxMBConv -{ -private: - void Init() - { - m_ok = m2w.Init(m_enc, wxFONTENCODING_UNICODE) && - w2m.Init(wxFONTENCODING_UNICODE, m_enc); - } - -public: - // temporarily just use wxEncodingConverter stuff, - // so that it works while a better implementation is built - wxMBConv_wxwin(const wxChar* name) - { - if (name) - m_enc = wxFontMapperBase::Get()->CharsetToEncoding(name, false); - else - m_enc = wxFONTENCODING_SYSTEM; - - Init(); - } - - wxMBConv_wxwin(wxFontEncoding enc) - { - m_enc = enc; - - Init(); - } - - size_t MB2WC(wchar_t *buf, const char *psz, size_t WXUNUSED(n)) const - { - size_t inbuf = strlen(psz); - if (buf) - { - if (!m2w.Convert(psz, buf)) - return wxCONV_FAILED; - } - return inbuf; - } - - size_t WC2MB(char *buf, const wchar_t *psz, size_t WXUNUSED(n)) const - { - const size_t inbuf = wxWcslen(psz); - if (buf) - { - if (!w2m.Convert(psz, buf)) - return wxCONV_FAILED; - } - - return inbuf; - } - - virtual size_t GetMBNulLen() const - { - switch ( m_enc ) - { - case wxFONTENCODING_UTF16BE: - case wxFONTENCODING_UTF16LE: - return 2; - - case wxFONTENCODING_UTF32BE: - case wxFONTENCODING_UTF32LE: - return 4; - - default: - return 1; - } - } - - virtual wxMBConv *Clone() const { return new wxMBConv_wxwin(m_enc); } - - bool IsOk() const { return m_ok; } - -public: - wxFontEncoding m_enc; - wxEncodingConverter m2w, w2m; - -private: - // were we initialized successfully? - bool m_ok; - - DECLARE_NO_COPY_CLASS(wxMBConv_wxwin) -}; - -// make the constructors available for unit testing -WXDLLIMPEXP_BASE wxMBConv* new_wxMBConv_wxwin( const wxChar* name ) -{ - wxMBConv_wxwin* result = new wxMBConv_wxwin( name ); - if ( !result->IsOk() ) - { - delete result; - return 0; - } - - return result; -} - -#endif // wxUSE_FONTMAP - -// ============================================================================ -// wxCSConv implementation -// ============================================================================ - -void wxCSConv::Init() -{ - m_name = NULL; - m_convReal = NULL; - m_deferred = true; -} - -wxCSConv::wxCSConv(const wxChar *charset) -{ - Init(); - - if ( charset ) - { - SetName(charset); - } - -#if wxUSE_FONTMAP - m_encoding = wxFontMapperBase::GetEncodingFromName(charset); - if ( m_encoding == wxFONTENCODING_MAX ) - { - // set to unknown/invalid value - m_encoding = wxFONTENCODING_SYSTEM; - } - else if ( m_encoding == wxFONTENCODING_DEFAULT ) - { - // wxFONTENCODING_DEFAULT is same as US-ASCII in this context - m_encoding = wxFONTENCODING_ISO8859_1; - } -#else - m_encoding = wxFONTENCODING_SYSTEM; -#endif -} - -wxCSConv::wxCSConv(wxFontEncoding encoding) -{ - if ( encoding == wxFONTENCODING_MAX || encoding == wxFONTENCODING_DEFAULT ) - { - wxFAIL_MSG( _T("invalid encoding value in wxCSConv ctor") ); - - encoding = wxFONTENCODING_SYSTEM; - } - - Init(); - - m_encoding = encoding; -} - -wxCSConv::~wxCSConv() -{ - Clear(); -} - -wxCSConv::wxCSConv(const wxCSConv& conv) - : wxMBConv() -{ - Init(); - - SetName(conv.m_name); - m_encoding = conv.m_encoding; -} - -wxCSConv& wxCSConv::operator=(const wxCSConv& conv) -{ - Clear(); - - SetName(conv.m_name); - m_encoding = conv.m_encoding; - - return *this; -} - -void wxCSConv::Clear() -{ - free(m_name); - delete m_convReal; - - m_name = NULL; - m_convReal = NULL; -} - -void wxCSConv::SetName(const wxChar *charset) -{ - if (charset) - { - m_name = wxStrdup(charset); - m_deferred = true; - } -} - -#if wxUSE_FONTMAP - -WX_DECLARE_HASH_MAP( wxFontEncoding, wxString, wxIntegerHash, wxIntegerEqual, - wxEncodingNameCache ); - -static wxEncodingNameCache gs_nameCache; -#endif - -wxMBConv *wxCSConv::DoCreate() const -{ -#if wxUSE_FONTMAP - wxLogTrace(TRACE_STRCONV, - wxT("creating conversion for %s"), - (m_name ? m_name - : wxFontMapperBase::GetEncodingName(m_encoding).c_str())); -#endif // wxUSE_FONTMAP - - // check for the special case of ASCII or ISO8859-1 charset: as we have - // special knowledge of it anyhow, we don't need to create a special - // conversion object - if ( m_encoding == wxFONTENCODING_ISO8859_1 || - m_encoding == wxFONTENCODING_DEFAULT ) - { - // don't convert at all - return NULL; - } - - // we trust OS to do conversion better than we can so try external - // conversion methods first - // - // the full order is: - // 1. OS conversion (iconv() under Unix or Win32 API) - // 2. hard coded conversions for UTF - // 3. wxEncodingConverter as fall back - - // step (1) -#ifdef HAVE_ICONV -#if !wxUSE_FONTMAP - if ( m_name ) -#endif // !wxUSE_FONTMAP - { - wxString name(m_name); -#if wxUSE_FONTMAP - wxFontEncoding encoding(m_encoding); -#endif - - if ( !name.empty() ) - { - wxMBConv_iconv *conv = new wxMBConv_iconv(name); - if ( conv->IsOk() ) - return conv; - - delete conv; - -#if wxUSE_FONTMAP - encoding = - wxFontMapperBase::Get()->CharsetToEncoding(name, false); -#endif // wxUSE_FONTMAP - } -#if wxUSE_FONTMAP - { - const wxEncodingNameCache::iterator it = gs_nameCache.find(encoding); - if ( it != gs_nameCache.end() ) - { - if ( it->second.empty() ) - return NULL; - - wxMBConv_iconv *conv = new wxMBConv_iconv(it->second); - if ( conv->IsOk() ) - return conv; - - delete conv; - } - - const wxChar** names = wxFontMapperBase::GetAllEncodingNames(encoding); - // CS : in case this does not return valid names (eg for MacRoman) encoding - // got a 'failure' entry in the cache all the same, although it just has to - // be created using a different method, so only store failed iconv creation - // attempts (or perhaps we shoulnd't do this at all ?) - if ( names[0] != NULL ) - { - for ( ; *names; ++names ) - { - wxMBConv_iconv *conv = new wxMBConv_iconv(*names); - if ( conv->IsOk() ) - { - gs_nameCache[encoding] = *names; - return conv; - } - - delete conv; - } - - gs_nameCache[encoding] = _T(""); // cache the failure - } - } -#endif // wxUSE_FONTMAP - } -#endif // HAVE_ICONV - -#ifdef wxHAVE_WIN32_MB2WC - { -#if wxUSE_FONTMAP - wxMBConv_win32 *conv = m_name ? new wxMBConv_win32(m_name) - : new wxMBConv_win32(m_encoding); - if ( conv->IsOk() ) - return conv; - - delete conv; -#else - return NULL; -#endif - } -#endif // wxHAVE_WIN32_MB2WC - -#if defined(__WXMAC__) - { - // leave UTF16 and UTF32 to the built-ins of wx - if ( m_name || ( m_encoding < wxFONTENCODING_UTF16BE || - ( m_encoding >= wxFONTENCODING_MACMIN && m_encoding <= wxFONTENCODING_MACMAX ) ) ) - { -#if wxUSE_FONTMAP - wxMBConv_mac *conv = m_name ? new wxMBConv_mac(m_name) - : new wxMBConv_mac(m_encoding); -#else - wxMBConv_mac *conv = new wxMBConv_mac(m_encoding); -#endif - if ( conv->IsOk() ) - return conv; - - delete conv; - } - } -#endif - -#if defined(__WXCOCOA__) - { - if ( m_name || ( m_encoding <= wxFONTENCODING_UTF16 ) ) - { -#if wxUSE_FONTMAP - wxMBConv_cocoa *conv = m_name ? new wxMBConv_cocoa(m_name) - : new wxMBConv_cocoa(m_encoding); -#else - wxMBConv_cocoa *conv = new wxMBConv_cocoa(m_encoding); -#endif - - if ( conv->IsOk() ) - return conv; - - delete conv; - } - } -#endif - // step (2) - wxFontEncoding enc = m_encoding; -#if wxUSE_FONTMAP - if ( enc == wxFONTENCODING_SYSTEM && m_name ) - { - // use "false" to suppress interactive dialogs -- we can be called from - // anywhere and popping up a dialog from here is the last thing we want to - // do - enc = wxFontMapperBase::Get()->CharsetToEncoding(m_name, false); - } -#endif // wxUSE_FONTMAP - - switch ( enc ) - { - case wxFONTENCODING_UTF7: - return new wxMBConvUTF7; - - case wxFONTENCODING_UTF8: - return new wxMBConvUTF8; - - case wxFONTENCODING_UTF16BE: - return new wxMBConvUTF16BE; - - case wxFONTENCODING_UTF16LE: - return new wxMBConvUTF16LE; - - case wxFONTENCODING_UTF32BE: - return new wxMBConvUTF32BE; - - case wxFONTENCODING_UTF32LE: - return new wxMBConvUTF32LE; - - default: - // nothing to do but put here to suppress gcc warnings - break; - } - - // step (3) -#if wxUSE_FONTMAP - { - wxMBConv_wxwin *conv = m_name ? new wxMBConv_wxwin(m_name) - : new wxMBConv_wxwin(m_encoding); - if ( conv->IsOk() ) - return conv; - - delete conv; - } -#endif // wxUSE_FONTMAP - - // NB: This is a hack to prevent deadlock. What could otherwise happen - // in Unicode build: wxConvLocal creation ends up being here - // because of some failure and logs the error. But wxLog will try to - // attach a timestamp, for which it will need wxConvLocal (to convert - // time to char* and then wchar_t*), but that fails, tries to log the - // error, but wxLog has an (already locked) critical section that - // guards the static buffer. - static bool alreadyLoggingError = false; - if (!alreadyLoggingError) - { - alreadyLoggingError = true; - wxLogError(_("Cannot convert from the charset '%s'!"), - m_name ? m_name - : -#if wxUSE_FONTMAP - wxFontMapperBase::GetEncodingDescription(m_encoding).c_str() -#else // !wxUSE_FONTMAP - wxString::Format(_("encoding %i"), m_encoding).c_str() -#endif // wxUSE_FONTMAP/!wxUSE_FONTMAP - ); - - alreadyLoggingError = false; - } - - return NULL; -} - -void wxCSConv::CreateConvIfNeeded() const -{ - if ( m_deferred ) - { - wxCSConv *self = (wxCSConv *)this; // const_cast - - // if we don't have neither the name nor the encoding, use the default - // encoding for this system - if ( !m_name && m_encoding == wxFONTENCODING_SYSTEM ) - { -#if wxUSE_INTL - self->m_encoding = wxLocale::GetSystemEncoding(); -#else - // fallback to some reasonable default: - self->m_encoding = wxFONTENCODING_ISO8859_1; -#endif // wxUSE_INTL - } - - self->m_convReal = DoCreate(); - self->m_deferred = false; - } -} - -bool wxCSConv::IsOk() const -{ - CreateConvIfNeeded(); - - // special case: no convReal created for wxFONTENCODING_ISO8859_1 - if ( m_encoding == wxFONTENCODING_ISO8859_1 ) - return true; // always ok as we do it ourselves - - // m_convReal->IsOk() is called at its own creation, so we know it must - // be ok if m_convReal is non-NULL - return m_convReal != NULL; -} - -size_t wxCSConv::ToWChar(wchar_t *dst, size_t dstLen, - const char *src, size_t srcLen) const -{ - CreateConvIfNeeded(); - - if (m_convReal) - return m_convReal->ToWChar(dst, dstLen, src, srcLen); - - // latin-1 (direct) - if ( srcLen == wxNO_LEN ) - srcLen = strlen(src) + 1; // take trailing NUL too - - if ( dst ) - { - if ( dstLen < srcLen ) - return wxCONV_FAILED; - - for ( size_t n = 0; n < srcLen; n++ ) - dst[n] = (unsigned char)(src[n]); - } - - return srcLen; -} - -size_t wxCSConv::FromWChar(char *dst, size_t dstLen, - const wchar_t *src, size_t srcLen) const -{ - CreateConvIfNeeded(); - - if (m_convReal) - return m_convReal->FromWChar(dst, dstLen, src, srcLen); - - // latin-1 (direct) - if ( srcLen == wxNO_LEN ) - srcLen = wxWcslen(src) + 1; - - if ( dst ) - { - if ( dstLen < srcLen ) - return wxCONV_FAILED; - - for ( size_t n = 0; n < srcLen; n++ ) - { - if ( src[n] > 0xFF ) - return wxCONV_FAILED; - - dst[n] = (char)src[n]; - } - - } - else // still need to check the input validity - { - for ( size_t n = 0; n < srcLen; n++ ) - { - if ( src[n] > 0xFF ) - return wxCONV_FAILED; - } - } - - return srcLen; -} - -size_t wxCSConv::MB2WC(wchar_t *buf, const char *psz, size_t n) const -{ - // this function exists only for ABI-compatibility in 2.8 branch - return wxMBConv::MB2WC(buf, psz, n); -} - -size_t wxCSConv::WC2MB(char *buf, const wchar_t *psz, size_t n) const -{ - // this function exists only for ABI-compatibility in 2.8 branch - return wxMBConv::WC2MB(buf, psz, n); -} - -size_t wxCSConv::GetMBNulLen() const -{ - CreateConvIfNeeded(); - - if ( m_convReal ) - { - return m_convReal->GetMBNulLen(); - } - - return 1; -} - -// ---------------------------------------------------------------------------- -// globals -// ---------------------------------------------------------------------------- - -#ifdef __WINDOWS__ - static wxMBConv_win32 wxConvLibcObj; -#elif defined(__WXMAC__) && !defined(__MACH__) - static wxMBConv_mac wxConvLibcObj ; -#else - static wxMBConvLibc wxConvLibcObj; -#endif - -static wxCSConv wxConvLocalObj(wxFONTENCODING_SYSTEM); -static wxCSConv wxConvISO8859_1Obj(wxFONTENCODING_ISO8859_1); -static wxMBConvUTF7 wxConvUTF7Obj; -static wxMBConvUTF8 wxConvUTF8Obj; -#if defined(__WXMAC__) && defined(TARGET_CARBON) -static wxMBConv_macUTF8D wxConvMacUTF8DObj; -#endif -WXDLLIMPEXP_DATA_BASE(wxMBConv&) wxConvLibc = wxConvLibcObj; -WXDLLIMPEXP_DATA_BASE(wxCSConv&) wxConvLocal = wxConvLocalObj; -WXDLLIMPEXP_DATA_BASE(wxCSConv&) wxConvISO8859_1 = wxConvISO8859_1Obj; -WXDLLIMPEXP_DATA_BASE(wxMBConvUTF7&) wxConvUTF7 = wxConvUTF7Obj; -WXDLLIMPEXP_DATA_BASE(wxMBConvUTF8&) wxConvUTF8 = wxConvUTF8Obj; -WXDLLIMPEXP_DATA_BASE(wxMBConv *) wxConvCurrent = &wxConvLibcObj; -WXDLLIMPEXP_DATA_BASE(wxMBConv *) wxConvUI = &wxConvLocal; -WXDLLIMPEXP_DATA_BASE(wxMBConv *) wxConvFileName = & -#ifdef __WXOSX__ -#if defined(__WXMAC__) && defined(TARGET_CARBON) - wxConvMacUTF8DObj; -#else - wxConvUTF8Obj; -#endif -#else // !__WXOSX__ - wxConvLibcObj; -#endif // __WXOSX__/!__WXOSX__ - -#if wxUSE_UNICODE - -wxWCharBuffer wxSafeConvertMB2WX(const char *s) -{ - if ( !s ) - return wxWCharBuffer(); - - wxWCharBuffer wbuf(wxConvLibc.cMB2WX(s)); - if ( !wbuf ) - wbuf = wxConvUTF8.cMB2WX(s); - if ( !wbuf ) - wbuf = wxConvISO8859_1.cMB2WX(s); - - return wbuf; -} - -wxCharBuffer wxSafeConvertWX2MB(const wchar_t *ws) -{ - if ( !ws ) - return wxCharBuffer(); - - wxCharBuffer buf(wxConvLibc.cWX2MB(ws)); - if ( !buf ) - buf = wxMBConvUTF8(wxMBConvUTF8::MAP_INVALID_UTF8_TO_OCTAL).cWX2MB(ws); - - return buf; -} - -#endif // wxUSE_UNICODE - -#else // !wxUSE_WCHAR_T - -// stand-ins in absence of wchar_t -WXDLLIMPEXP_DATA_BASE(wxMBConv) wxConvLibc, - wxConvISO8859_1, - wxConvLocal, - wxConvUTF8; - -WXDLLIMPEXP_DATA_BASE(wxMBConv *) wxConvCurrent = NULL; - -#endif // wxUSE_WCHAR_T/!wxUSE_WCHAR_T diff --git a/wxWidgets/src/common/stream.cpp b/wxWidgets/src/common/stream.cpp deleted file mode 100644 index 27a9a7cc81..0000000000 --- a/wxWidgets/src/common/stream.cpp +++ /dev/null @@ -1,1388 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/common/stream.cpp -// Purpose: wxStream base classes -// Author: Guilhem Lavaux -// Modified by: VZ (23.11.00) to fix realloc()ing new[]ed memory, -// general code review -// Created: 11/07/98 -// RCS-ID: $Id: stream.cpp 51662 2008-02-11 20:23:29Z VZ $ -// Copyright: (c) Guilhem Lavaux -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_STREAMS - -#include "wx/stream.h" - -#ifndef WX_PRECOMP - #include "wx/log.h" -#endif - -#include -#include "wx/datstrm.h" -#include "wx/textfile.h" - -// ---------------------------------------------------------------------------- -// constants -// ---------------------------------------------------------------------------- - -// the temporary buffer size used when copying from stream to stream -#define BUF_TEMP_SIZE 4096 - -// ============================================================================ -// implementation -// ============================================================================ - -// ---------------------------------------------------------------------------- -// wxStreamBuffer -// ---------------------------------------------------------------------------- - -void wxStreamBuffer::SetError(wxStreamError err) -{ - if ( m_stream && m_stream->m_lasterror == wxSTREAM_NO_ERROR ) - m_stream->m_lasterror = err; -} - -void wxStreamBuffer::InitBuffer() -{ - m_buffer_start = - m_buffer_end = - m_buffer_pos = NULL; - m_buffer_size = 0; - - // if we are going to allocate the buffer, we should free it later as well - m_destroybuf = true; -} - -void wxStreamBuffer::Init() -{ - InitBuffer(); - - m_fixed = true; -} - -wxStreamBuffer::wxStreamBuffer(BufMode mode) -{ - Init(); - - m_stream = NULL; - m_mode = mode; - - m_flushable = false; -} - -wxStreamBuffer::wxStreamBuffer(wxStreamBase& stream, BufMode mode) -{ - Init(); - - m_stream = &stream; - m_mode = mode; - - m_flushable = true; -} - -wxStreamBuffer::wxStreamBuffer(const wxStreamBuffer& buffer) -{ - // doing this has big chances to lead to a crash when the source buffer is - // destroyed (otherwise assume the caller knows what he does) - wxASSERT_MSG( !buffer.m_destroybuf, - _T("it's a bad idea to copy this buffer") ); - - m_buffer_start = buffer.m_buffer_start; - m_buffer_end = buffer.m_buffer_end; - m_buffer_pos = buffer.m_buffer_pos; - m_buffer_size = buffer.m_buffer_size; - m_fixed = buffer.m_fixed; - m_flushable = buffer.m_flushable; - m_stream = buffer.m_stream; - m_mode = buffer.m_mode; - m_destroybuf = false; -} - -void wxStreamBuffer::FreeBuffer() -{ - if ( m_destroybuf ) - { - free(m_buffer_start); - m_buffer_start = NULL; - } -} - -wxStreamBuffer::~wxStreamBuffer() -{ - FreeBuffer(); -} - -wxInputStream *wxStreamBuffer::GetInputStream() const -{ - return m_mode == write ? NULL : (wxInputStream *)m_stream; -} - -wxOutputStream *wxStreamBuffer::GetOutputStream() const -{ - return m_mode == read ? NULL : (wxOutputStream *)m_stream; -} - -void wxStreamBuffer::SetBufferIO(void *buffer_start, - void *buffer_end, - bool takeOwnership) -{ - SetBufferIO(buffer_start, (char *)buffer_end - (char *)buffer_start, - takeOwnership); -} - -void wxStreamBuffer::SetBufferIO(void *start, - size_t len, - bool takeOwnership) -{ - // start by freeing the old buffer - FreeBuffer(); - - m_buffer_start = (char *)start; - m_buffer_end = m_buffer_start + len; - - m_buffer_size = len; - - // if we own it, we free it - m_destroybuf = takeOwnership; - - ResetBuffer(); -} - -void wxStreamBuffer::SetBufferIO(size_t bufsize) -{ - if ( bufsize ) - { - // this will free the old buffer and allocate the new one - SetBufferIO(malloc(bufsize), bufsize, true /* take ownership */); - } - else // no buffer size => no buffer - { - // still free the old one - FreeBuffer(); - InitBuffer(); - } -} - -void wxStreamBuffer::ResetBuffer() -{ - if ( m_stream ) - { - m_stream->Reset(); - m_stream->m_lastcount = 0; - } - - m_buffer_pos = m_mode == read && m_flushable - ? m_buffer_end - : m_buffer_start; -} - -// fill the buffer with as much data as possible (only for read buffers) -bool wxStreamBuffer::FillBuffer() -{ - wxInputStream *inStream = GetInputStream(); - - // It's legal to have no stream, so we don't complain about it just return false - if ( !inStream ) - return false; - - size_t count = inStream->OnSysRead(m_buffer_start, m_buffer_size); - if ( !count ) - return false; - - m_buffer_end = m_buffer_start + count; - m_buffer_pos = m_buffer_start; - - return true; -} - -// write the buffer contents to the stream (only for write buffers) -bool wxStreamBuffer::FlushBuffer() -{ - wxCHECK_MSG( m_flushable, false, _T("can't flush this buffer") ); - - // FIXME: what is this check for? (VZ) - if ( m_buffer_pos == m_buffer_start ) - return false; - - wxOutputStream *outStream = GetOutputStream(); - - wxCHECK_MSG( outStream, false, _T("should have a stream in wxStreamBuffer") ); - - size_t current = m_buffer_pos - m_buffer_start; - size_t count = outStream->OnSysWrite(m_buffer_start, current); - if ( count != current ) - return false; - - m_buffer_pos = m_buffer_start; - - return true; -} - -size_t wxStreamBuffer::GetDataLeft() -{ - /* Why is this done? RR. */ - if ( m_buffer_pos == m_buffer_end && m_flushable) - FillBuffer(); - - return GetBytesLeft(); -} - -// copy up to size bytes from our buffer into the provided one -void wxStreamBuffer::GetFromBuffer(void *buffer, size_t size) -{ - // don't get more bytes than left in the buffer - size_t left = GetBytesLeft(); - - if ( size > left ) - size = left; - - memcpy(buffer, m_buffer_pos, size); - m_buffer_pos += size; -} - -// copy the contents of the provided buffer into this one -void wxStreamBuffer::PutToBuffer(const void *buffer, size_t size) -{ - size_t left = GetBytesLeft(); - - if ( size > left ) - { - if ( m_fixed ) - { - // we can't realloc the buffer, so just copy what we can - size = left; - } - else // !m_fixed - { - // realloc the buffer to have enough space for the data - size_t delta = m_buffer_pos - m_buffer_start; - - char *startOld = m_buffer_start; - m_buffer_size += size; - m_buffer_start = (char *)realloc(m_buffer_start, m_buffer_size); - if ( !m_buffer_start ) - { - // don't leak memory if realloc() failed - m_buffer_start = startOld; - m_buffer_size -= size; - - // what else can we do? - return; - } - - // adjust the pointers invalidated by realloc() - m_buffer_pos = m_buffer_start + delta; - m_buffer_end = m_buffer_start + m_buffer_size; - } - } - - memcpy(m_buffer_pos, buffer, size); - m_buffer_pos += size; -} - -void wxStreamBuffer::PutChar(char c) -{ - wxOutputStream *outStream = GetOutputStream(); - - wxCHECK_RET( outStream, _T("should have a stream in wxStreamBuffer") ); - - // if we don't have buffer at all, just forward this call to the stream, - if ( !HasBuffer() ) - { - outStream->OnSysWrite(&c, sizeof(c)); - } - else - { - // otherwise check we have enough space left - if ( !GetDataLeft() && !FlushBuffer() ) - { - // we don't - SetError(wxSTREAM_WRITE_ERROR); - } - else - { - PutToBuffer(&c, sizeof(c)); - m_stream->m_lastcount = 1; - } - } -} - -char wxStreamBuffer::Peek() -{ - wxCHECK_MSG( m_stream && HasBuffer(), 0, - _T("should have the stream and the buffer in wxStreamBuffer") ); - - if ( !GetDataLeft() ) - { - SetError(wxSTREAM_READ_ERROR); - return 0; - } - - char c; - GetFromBuffer(&c, sizeof(c)); - m_buffer_pos--; - - return c; -} - -char wxStreamBuffer::GetChar() -{ - wxInputStream *inStream = GetInputStream(); - - wxCHECK_MSG( inStream, 0, _T("should have a stream in wxStreamBuffer") ); - - char c; - if ( !HasBuffer() ) - { - inStream->OnSysRead(&c, sizeof(c)); - } - else - { - if ( !GetDataLeft() ) - { - SetError(wxSTREAM_READ_ERROR); - c = 0; - } - else - { - GetFromBuffer(&c, sizeof(c)); - m_stream->m_lastcount = 1; - } - } - - return c; -} - -size_t wxStreamBuffer::Read(void *buffer, size_t size) -{ - wxASSERT_MSG( buffer, _T("Warning: Null pointer is about to be used") ); - - /* Clear buffer first */ - memset(buffer, 0x00, size); - - // lasterror is reset before all new IO calls - if ( m_stream ) - m_stream->Reset(); - - size_t readBytes; - if ( !HasBuffer() ) - { - wxInputStream *inStream = GetInputStream(); - - wxCHECK_MSG( inStream, 0, _T("should have a stream in wxStreamBuffer") ); - - readBytes = inStream->OnSysRead(buffer, size); - } - else // we have a buffer, use it - { - size_t orig_size = size; - - while ( size > 0 ) - { - size_t left = GetDataLeft(); - - // if the requested number of bytes if greater than the buffer - // size, read data in chunks - if ( size > left ) - { - GetFromBuffer(buffer, left); - size -= left; - buffer = (char *)buffer + left; - - if ( !FillBuffer() ) - { - SetError(wxSTREAM_EOF); - break; - } - } - else // otherwise just do it in one gulp - { - GetFromBuffer(buffer, size); - size = 0; - } - } - - readBytes = orig_size - size; - } - - if ( m_stream ) - m_stream->m_lastcount = readBytes; - - return readBytes; -} - -// this should really be called "Copy()" -size_t wxStreamBuffer::Read(wxStreamBuffer *dbuf) -{ - wxCHECK_MSG( m_mode != write, 0, _T("can't read from this buffer") ); - - char buf[BUF_TEMP_SIZE]; - size_t nRead, - total = 0; - - do - { - nRead = Read(buf, WXSIZEOF(buf)); - if ( nRead ) - { - nRead = dbuf->Write(buf, nRead); - total += nRead; - } - } - while ( nRead ); - - return total; -} - -size_t wxStreamBuffer::Write(const void *buffer, size_t size) -{ - wxASSERT_MSG( buffer, _T("Warning: Null pointer is about to be send") ); - - if (m_stream) - { - // lasterror is reset before all new IO calls - m_stream->Reset(); - } - - size_t ret; - - if ( !HasBuffer() && m_fixed ) - { - wxOutputStream *outStream = GetOutputStream(); - - wxCHECK_MSG( outStream, 0, _T("should have a stream in wxStreamBuffer") ); - - // no buffer, just forward the call to the stream - ret = outStream->OnSysWrite(buffer, size); - } - else // we [may] have a buffer, use it - { - size_t orig_size = size; - - while ( size > 0 ) - { - size_t left = GetBytesLeft(); - - // if the buffer is too large to fit in the stream buffer, split - // it in smaller parts - // - // NB: If stream buffer isn't fixed (as for wxMemoryOutputStream), - // we always go to the second case. - // - // FIXME: fine, but if it fails we should (re)try writing it by - // chunks as this will (hopefully) always work (VZ) - - if ( size > left && m_fixed ) - { - PutToBuffer(buffer, left); - size -= left; - buffer = (char *)buffer + left; - - if ( !FlushBuffer() ) - { - SetError(wxSTREAM_WRITE_ERROR); - - break; - } - - m_buffer_pos = m_buffer_start; - } - else // we can do it in one gulp - { - PutToBuffer(buffer, size); - size = 0; - } - } - - ret = orig_size - size; - } - - if (m_stream) - { - // i am not entirely sure what we do this for - m_stream->m_lastcount = ret; - } - - return ret; -} - -size_t wxStreamBuffer::Write(wxStreamBuffer *sbuf) -{ - wxCHECK_MSG( m_mode != read, 0, _T("can't write to this buffer") ); - wxCHECK_MSG( sbuf->m_mode != write, 0, _T("can't read from that buffer") ); - - char buf[BUF_TEMP_SIZE]; - size_t nWrite, - total = 0; - - do - { - size_t nRead = sbuf->Read(buf, WXSIZEOF(buf)); - if ( nRead ) - { - nWrite = Write(buf, nRead); - if ( nWrite < nRead ) - { - // put back data we couldn't copy - wxInputStream *in_stream = (wxInputStream *)sbuf->GetStream(); - - in_stream->Ungetch(buf + nWrite, nRead - nWrite); - } - - total += nWrite; - } - else - { - nWrite = 0; - } - } - while ( nWrite == WXSIZEOF(buf) ); - - return total; -} - -wxFileOffset wxStreamBuffer::Seek(wxFileOffset pos, wxSeekMode mode) -{ - wxFileOffset ret_off, diff; - - wxFileOffset last_access = GetLastAccess(); - - if ( !m_flushable ) - { - switch (mode) - { - case wxFromStart: - diff = pos; - break; - - case wxFromCurrent: - diff = pos + GetIntPosition(); - break; - - case wxFromEnd: - diff = pos + last_access; - break; - - default: - wxFAIL_MSG( _T("invalid seek mode") ); - - return wxInvalidOffset; - } - if (diff < 0 || diff > last_access) - return wxInvalidOffset; - size_t int_diff = wx_truncate_cast(size_t, diff); - wxCHECK_MSG( (wxFileOffset)int_diff == diff, wxInvalidOffset, wxT("huge file not supported") ); - SetIntPosition(int_diff); - return diff; - } - - switch ( mode ) - { - case wxFromStart: - // We'll try to compute an internal position later ... - ret_off = m_stream->OnSysSeek(pos, wxFromStart); - ResetBuffer(); - return ret_off; - - case wxFromCurrent: - diff = pos + GetIntPosition(); - - if ( (diff > last_access) || (diff < 0) ) - { - // We must take into account the fact that we have read - // something previously. - ret_off = m_stream->OnSysSeek(diff-last_access, wxFromCurrent); - ResetBuffer(); - return ret_off; - } - else - { - size_t int_diff = wx_truncate_cast(size_t, diff); - wxCHECK_MSG( (wxFileOffset)int_diff == diff, wxInvalidOffset, wxT("huge file not supported") ); - SetIntPosition(int_diff); - return pos; - } - - case wxFromEnd: - // Hard to compute: always seek to the requested position. - ret_off = m_stream->OnSysSeek(pos, wxFromEnd); - ResetBuffer(); - return ret_off; - } - - return wxInvalidOffset; -} - -wxFileOffset wxStreamBuffer::Tell() const -{ - wxFileOffset pos; - - // ask the stream for position if we have a real one - if ( m_stream ) - { - pos = m_stream->OnSysTell(); - if ( pos == wxInvalidOffset ) - return wxInvalidOffset; - } - else // no associated stream - { - pos = 0; - } - - pos += GetIntPosition(); - - if ( m_mode == read && m_flushable ) - pos -= GetLastAccess(); - - return pos; -} - -// ---------------------------------------------------------------------------- -// wxStreamBase -// ---------------------------------------------------------------------------- - -wxStreamBase::wxStreamBase() -{ - m_lasterror = wxSTREAM_NO_ERROR; - m_lastcount = 0; -} - -wxStreamBase::~wxStreamBase() -{ -} - -size_t wxStreamBase::GetSize() const -{ - wxFileOffset length = GetLength(); - if ( length == (wxFileOffset)wxInvalidOffset ) - return 0; - - const size_t len = wx_truncate_cast(size_t, length); - wxASSERT_MSG( len == length + size_t(0), _T("large files not supported") ); - - return len; -} - -wxFileOffset wxStreamBase::OnSysSeek(wxFileOffset WXUNUSED(seek), wxSeekMode WXUNUSED(mode)) -{ - return wxInvalidOffset; -} - -wxFileOffset wxStreamBase::OnSysTell() const -{ - return wxInvalidOffset; -} - -// ---------------------------------------------------------------------------- -// wxInputStream -// ---------------------------------------------------------------------------- - -wxInputStream::wxInputStream() -{ - m_wback = NULL; - m_wbacksize = - m_wbackcur = 0; -} - -wxInputStream::~wxInputStream() -{ - free(m_wback); -} - -bool wxInputStream::CanRead() const -{ - // we don't know if there is anything to read or not and by default we - // prefer to be optimistic and try to read data unless we know for sure - // there is no more of it - return m_lasterror != wxSTREAM_EOF; -} - -bool wxInputStream::Eof() const -{ - // the only way the base class can know we're at EOF is when we'd already - // tried to read beyond it in which case last error is set accordingly - return GetLastError() == wxSTREAM_EOF; -} - -char *wxInputStream::AllocSpaceWBack(size_t needed_size) -{ - // get number of bytes left from previous wback buffer - size_t toget = m_wbacksize - m_wbackcur; - - // allocate a buffer large enough to hold prev + new data - char *temp_b = (char *)malloc(needed_size + toget); - - if (!temp_b) - return NULL; - - // copy previous data (and free old buffer) if needed - if (m_wback) - { - memmove(temp_b + needed_size, m_wback + m_wbackcur, toget); - free(m_wback); - } - - // done - m_wback = temp_b; - m_wbackcur = 0; - m_wbacksize = needed_size + toget; - - return m_wback; -} - -size_t wxInputStream::GetWBack(void *buf, size_t size) -{ - wxASSERT_MSG( buf, _T("Warning: Null pointer is about to be used") ); - - /* Clear buffer first */ - memset(buf, 0x00, size); - - if (!m_wback) - return 0; - - // how many bytes do we have in the buffer? - size_t toget = m_wbacksize - m_wbackcur; - - if ( size < toget ) - { - // we won't read everything - toget = size; - } - - // copy the data from the cache - memcpy(buf, m_wback + m_wbackcur, toget); - - m_wbackcur += toget; - if ( m_wbackcur == m_wbacksize ) - { - // TODO: should we really free it here all the time? maybe keep it? - free(m_wback); - m_wback = NULL; - m_wbacksize = 0; - m_wbackcur = 0; - } - - // return the number of bytes copied - return toget; -} - -size_t wxInputStream::Ungetch(const void *buf, size_t bufsize) -{ - wxASSERT_MSG( buf, _T("Warning: Null pointer is about to be used in Ungetch()") ); - - if ( m_lasterror != wxSTREAM_NO_ERROR && m_lasterror != wxSTREAM_EOF ) - { - // can't operate on this stream until the error is cleared - return 0; - } - - char *ptrback = AllocSpaceWBack(bufsize); - if (!ptrback) - return 0; - - // Eof() shouldn't return true any longer - if ( m_lasterror == wxSTREAM_EOF ) - m_lasterror = wxSTREAM_NO_ERROR; - - memcpy(ptrback, buf, bufsize); - return bufsize; -} - -bool wxInputStream::Ungetch(char c) -{ - return Ungetch(&c, sizeof(c)) != 0; -} - -int wxInputStream::GetC() -{ - unsigned char c; - Read(&c, sizeof(c)); - return LastRead() ? c : wxEOF; -} - -wxInputStream& wxInputStream::Read(void *buf, size_t size) -{ - wxASSERT_MSG( buf, _T("Warning: Null pointer is about to be read") ); - - char *p = (char *)buf; - m_lastcount = 0; - - size_t read = GetWBack(buf, size); - for ( ;; ) - { - size -= read; - m_lastcount += read; - p += read; - - if ( !size ) - { - // we read the requested amount of data - break; - } - - if ( p != buf && !CanRead() ) - { - // we have already read something and we would block in OnSysRead() - // now: don't do it but return immediately - break; - } - - read = OnSysRead(p, size); - if ( !read ) - { - // no more data available - break; - } - } - - return *this; -} - -char wxInputStream::Peek() -{ - char c; - Read(&c, sizeof(c)); - if (m_lasterror == wxSTREAM_NO_ERROR) - { - Ungetch(c); - return c; - } - - return 0; -} - -wxInputStream& wxInputStream::Read(wxOutputStream& stream_out) -{ - size_t lastcount = 0; - char buf[BUF_TEMP_SIZE]; - - for ( ;; ) - { - size_t bytes_read = Read(buf, WXSIZEOF(buf)).LastRead(); - if ( !bytes_read ) - break; - - if ( stream_out.Write(buf, bytes_read).LastWrite() != bytes_read ) - break; - - lastcount += bytes_read; - } - - m_lastcount = lastcount; - - return *this; -} - -wxFileOffset wxInputStream::SeekI(wxFileOffset pos, wxSeekMode mode) -{ - // RR: This code is duplicated in wxBufferedInputStream. This is - // not really a good design, but buffered stream are different - // from all other in that they handle two stream-related objects, - // the stream buffer and parent stream. - - // I don't know whether it should be put as well in wxFileInputStream::OnSysSeek - if (m_lasterror==wxSTREAM_EOF) - m_lasterror=wxSTREAM_NO_ERROR; - - /* RR: A call to SeekI() will automatically invalidate any previous - call to Ungetch(), otherwise it would be possible to SeekI() to - one position, unread some bytes there, SeekI() to another position - and the data would be corrupted. - - GRG: Could add code here to try to navigate within the wback - buffer if possible, but is it really needed? It would only work - when seeking in wxFromCurrent mode, else it would invalidate - anyway... */ - - if (m_wback) - { - wxLogDebug( wxT("Seeking in stream which has data written back to it.") ); - - free(m_wback); - m_wback = NULL; - m_wbacksize = 0; - m_wbackcur = 0; - } - - return OnSysSeek(pos, mode); -} - -wxFileOffset wxInputStream::TellI() const -{ - wxFileOffset pos = OnSysTell(); - - if (pos != wxInvalidOffset) - pos -= (m_wbacksize - m_wbackcur); - - return pos; -} - - -// ---------------------------------------------------------------------------- -// wxOutputStream -// ---------------------------------------------------------------------------- - -wxOutputStream::wxOutputStream() -{ -} - -wxOutputStream::~wxOutputStream() -{ -} - -size_t wxOutputStream::OnSysWrite(const void * WXUNUSED(buffer), - size_t WXUNUSED(bufsize)) -{ - return 0; -} - -void wxOutputStream::PutC(char c) -{ - Write(&c, sizeof(c)); -} - -wxOutputStream& wxOutputStream::Write(const void *buffer, size_t size) -{ - m_lastcount = OnSysWrite(buffer, size); - return *this; -} - -wxOutputStream& wxOutputStream::Write(wxInputStream& stream_in) -{ - stream_in.Read(*this); - return *this; -} - -wxFileOffset wxOutputStream::TellO() const -{ - return OnSysTell(); -} - -wxFileOffset wxOutputStream::SeekO(wxFileOffset pos, wxSeekMode mode) -{ - return OnSysSeek(pos, mode); -} - -void wxOutputStream::Sync() -{ -} - - -// ---------------------------------------------------------------------------- -// wxCountingOutputStream -// ---------------------------------------------------------------------------- - -wxCountingOutputStream::wxCountingOutputStream () -{ - m_currentPos = 0; -} - -wxFileOffset wxCountingOutputStream::GetLength() const -{ - return m_lastcount; -} - -size_t wxCountingOutputStream::OnSysWrite(const void *WXUNUSED(buffer), - size_t size) -{ - m_currentPos += size; - if (m_currentPos > m_lastcount) - m_lastcount = m_currentPos; - - return m_currentPos; -} - -wxFileOffset wxCountingOutputStream::OnSysSeek(wxFileOffset pos, wxSeekMode mode) -{ - ssize_t new_pos = wx_truncate_cast(ssize_t, pos); - - switch ( mode ) - { - case wxFromStart: - wxCHECK_MSG( (wxFileOffset)new_pos == pos, wxInvalidOffset, wxT("huge position not supported") ); - break; - - case wxFromEnd: - new_pos = m_lastcount + new_pos; - wxCHECK_MSG( (wxFileOffset)new_pos == (wxFileOffset)(m_lastcount + pos), wxInvalidOffset, wxT("huge position not supported") ); - break; - - case wxFromCurrent: - new_pos = m_currentPos + new_pos; - wxCHECK_MSG( (wxFileOffset)new_pos == (wxFileOffset)(m_currentPos + pos), wxInvalidOffset, wxT("huge position not supported") ); - break; - - default: - wxFAIL_MSG( _T("invalid seek mode") ); - return wxInvalidOffset; - } - - m_currentPos = new_pos; - - if (m_currentPos > m_lastcount) - m_lastcount = m_currentPos; - - return m_currentPos; -} - -wxFileOffset wxCountingOutputStream::OnSysTell() const -{ - return m_currentPos; -} - -// ---------------------------------------------------------------------------- -// wxFilterInputStream -// ---------------------------------------------------------------------------- - -wxFilterInputStream::wxFilterInputStream() - : m_parent_i_stream(NULL), - m_owns(false) -{ -} - -wxFilterInputStream::wxFilterInputStream(wxInputStream& stream) - : m_parent_i_stream(&stream), - m_owns(false) -{ -} - -wxFilterInputStream::wxFilterInputStream(wxInputStream *stream) - : m_parent_i_stream(stream), - m_owns(true) -{ -} - -wxFilterInputStream::~wxFilterInputStream() -{ - if (m_owns) - delete m_parent_i_stream; -} - -// ---------------------------------------------------------------------------- -// wxFilterOutputStream -// ---------------------------------------------------------------------------- - -wxFilterOutputStream::wxFilterOutputStream() - : m_parent_o_stream(NULL), - m_owns(false) -{ -} - -wxFilterOutputStream::wxFilterOutputStream(wxOutputStream& stream) - : m_parent_o_stream(&stream), - m_owns(false) -{ -} - -wxFilterOutputStream::wxFilterOutputStream(wxOutputStream *stream) - : m_parent_o_stream(stream), - m_owns(true) -{ -} - -bool wxFilterOutputStream::Close() -{ - if (m_parent_o_stream && m_owns) - return m_parent_o_stream->Close(); - else - return true; -} - -wxFilterOutputStream::~wxFilterOutputStream() -{ - if (m_owns) - delete m_parent_o_stream; -} - -// ---------------------------------------------------------------------------- -// wxFilterClassFactoryBase -// ---------------------------------------------------------------------------- - -IMPLEMENT_ABSTRACT_CLASS(wxFilterClassFactoryBase, wxObject) - -wxString wxFilterClassFactoryBase::PopExtension(const wxString& location) const -{ - return location.substr(0, FindExtension(location)); -} - -wxString::size_type wxFilterClassFactoryBase::FindExtension( - const wxChar *location) const -{ - size_t len = wxStrlen(location); - - for (const wxChar *const *p = GetProtocols(wxSTREAM_FILEEXT); *p; p++) - { - size_t l = wxStrlen(*p); - - if (l <= len && wxStrcmp(*p, location + len - l) == 0) - return len - l; - } - - return wxString::npos; -} - -bool wxFilterClassFactoryBase::CanHandle(const wxChar *protocol, - wxStreamProtocolType type) const -{ - if (type == wxSTREAM_FILEEXT) - return FindExtension(protocol) != wxString::npos; - else - for (const wxChar *const *p = GetProtocols(type); *p; p++) - if (wxStrcmp(*p, protocol) == 0) - return true; - - return false; -} - -// ---------------------------------------------------------------------------- -// wxFilterClassFactory -// ---------------------------------------------------------------------------- - -IMPLEMENT_ABSTRACT_CLASS(wxFilterClassFactory, wxFilterClassFactoryBase) - -wxFilterClassFactory *wxFilterClassFactory::sm_first = NULL; - -void wxFilterClassFactory::Remove() -{ - if (m_next != this) - { - wxFilterClassFactory **pp = &sm_first; - - while (*pp != this) - pp = &(*pp)->m_next; - - *pp = m_next; - - m_next = this; - } -} - -// ---------------------------------------------------------------------------- -// wxBufferedInputStream -// ---------------------------------------------------------------------------- - -wxBufferedInputStream::wxBufferedInputStream(wxInputStream& s, - wxStreamBuffer *buffer) - : wxFilterInputStream(s) -{ - if ( buffer ) - { - // use the buffer provided by the user - m_i_streambuf = buffer; - } - else // create a default buffer - { - m_i_streambuf = new wxStreamBuffer(*this, wxStreamBuffer::read); - - m_i_streambuf->SetBufferIO(1024); - } -} - -wxBufferedInputStream::~wxBufferedInputStream() -{ - m_parent_i_stream->SeekI(-(wxFileOffset)m_i_streambuf->GetBytesLeft(), - wxFromCurrent); - - delete m_i_streambuf; -} - -char wxBufferedInputStream::Peek() -{ - return m_i_streambuf->Peek(); -} - -wxInputStream& wxBufferedInputStream::Read(void *buf, size_t size) -{ - // reset the error flag - Reset(); - - // first read from the already cached data - m_lastcount = GetWBack(buf, size); - - // do we have to read anything more? - if ( m_lastcount < size ) - { - size -= m_lastcount; - buf = (char *)buf + m_lastcount; - - // the call to wxStreamBuffer::Read() below may reset our m_lastcount - // (but it also may not do it if the buffer is associated to another - // existing stream and wasn't created by us), so save it - size_t countOld = m_lastcount; - - // the new count of the bytes read is the count of bytes read this time - m_lastcount = m_i_streambuf->Read(buf, size); - - // plus those we had read before - m_lastcount += countOld; - } - - return *this; -} - -wxFileOffset wxBufferedInputStream::SeekI(wxFileOffset pos, wxSeekMode mode) -{ - // RR: Look at wxInputStream for comments. - - if (m_lasterror==wxSTREAM_EOF) - Reset(); - - if (m_wback) - { - wxLogDebug( wxT("Seeking in stream which has data written back to it.") ); - - free(m_wback); - m_wback = NULL; - m_wbacksize = 0; - m_wbackcur = 0; - } - - return m_i_streambuf->Seek(pos, mode); -} - -wxFileOffset wxBufferedInputStream::TellI() const -{ - wxFileOffset pos = m_i_streambuf->Tell(); - - if (pos != wxInvalidOffset) - pos -= (m_wbacksize - m_wbackcur); - - return pos; -} - -size_t wxBufferedInputStream::OnSysRead(void *buffer, size_t bufsize) -{ - return m_parent_i_stream->Read(buffer, bufsize).LastRead(); -} - -wxFileOffset wxBufferedInputStream::OnSysSeek(wxFileOffset seek, wxSeekMode mode) -{ - return m_parent_i_stream->SeekI(seek, mode); -} - -wxFileOffset wxBufferedInputStream::OnSysTell() const -{ - return m_parent_i_stream->TellI(); -} - -void wxBufferedInputStream::SetInputStreamBuffer(wxStreamBuffer *buffer) -{ - wxCHECK_RET( buffer, _T("wxBufferedInputStream needs buffer") ); - - delete m_i_streambuf; - m_i_streambuf = buffer; -} - -// ---------------------------------------------------------------------------- -// wxBufferedOutputStream -// ---------------------------------------------------------------------------- - -wxBufferedOutputStream::wxBufferedOutputStream(wxOutputStream& s, - wxStreamBuffer *buffer) - : wxFilterOutputStream(s) -{ - if ( buffer ) - { - m_o_streambuf = buffer; - } - else // create a default one - { - m_o_streambuf = new wxStreamBuffer(*this, wxStreamBuffer::write); - - m_o_streambuf->SetBufferIO(1024); - } -} - -wxBufferedOutputStream::~wxBufferedOutputStream() -{ - Sync(); - delete m_o_streambuf; -} - -bool wxBufferedOutputStream::Close() -{ - Sync(); - return IsOk(); -} - - -wxOutputStream& wxBufferedOutputStream::Write(const void *buffer, size_t size) -{ - m_lastcount = 0; - m_o_streambuf->Write(buffer, size); - return *this; -} - -wxFileOffset wxBufferedOutputStream::SeekO(wxFileOffset pos, wxSeekMode mode) -{ - Sync(); - return m_o_streambuf->Seek(pos, mode); -} - -wxFileOffset wxBufferedOutputStream::TellO() const -{ - return m_o_streambuf->Tell(); -} - -void wxBufferedOutputStream::Sync() -{ - m_o_streambuf->FlushBuffer(); - m_parent_o_stream->Sync(); -} - -size_t wxBufferedOutputStream::OnSysWrite(const void *buffer, size_t bufsize) -{ - return m_parent_o_stream->Write(buffer, bufsize).LastWrite(); -} - -wxFileOffset wxBufferedOutputStream::OnSysSeek(wxFileOffset seek, wxSeekMode mode) -{ - return m_parent_o_stream->SeekO(seek, mode); -} - -wxFileOffset wxBufferedOutputStream::OnSysTell() const -{ - return m_parent_o_stream->TellO(); -} - -wxFileOffset wxBufferedOutputStream::GetLength() const -{ - return m_parent_o_stream->GetLength() + m_o_streambuf->GetIntPosition(); -} - -void wxBufferedOutputStream::SetOutputStreamBuffer(wxStreamBuffer *buffer) -{ - wxCHECK_RET( buffer, _T("wxBufferedOutputStream needs buffer") ); - - delete m_o_streambuf; - m_o_streambuf = buffer; -} - -// ---------------------------------------------------------------------------- -// Some IOManip function -// ---------------------------------------------------------------------------- - -wxOutputStream& wxEndL(wxOutputStream& stream) -{ - static const wxChar *eol = wxTextFile::GetEOL(); - - return stream.Write(eol, wxStrlen(eol)); -} - -#endif // wxUSE_STREAMS diff --git a/wxWidgets/src/common/string.cpp b/wxWidgets/src/common/string.cpp deleted file mode 100644 index 1bb1052ed6..0000000000 --- a/wxWidgets/src/common/string.cpp +++ /dev/null @@ -1,2659 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/common/string.cpp -// Purpose: wxString class -// Author: Vadim Zeitlin, Ryan Norton -// Modified by: -// Created: 29/01/98 -// RCS-ID: $Id: string.cpp 63008 2009-12-28 20:01:39Z VZ $ -// Copyright: (c) 1998 Vadim Zeitlin -// (c) 2004 Ryan Norton -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -/* - * About ref counting: - * 1) all empty strings use g_strEmpty, nRefs = -1 (set in Init()) - * 2) AllocBuffer() sets nRefs to 1, Lock() increments it by one - * 3) Unlock() decrements nRefs and frees memory if it goes to 0 - */ - -// =========================================================================== -// headers, declarations, constants -// =========================================================================== - -// 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/intl.h" - #include "wx/thread.h" -#endif - -#include - -#ifndef __WXWINCE__ - #include -#endif - -#include -#include - -#ifdef __SALFORDC__ - #include -#endif - -// allocating extra space for each string consumes more memory but speeds up -// the concatenation operations (nLen is the current string's length) -// NB: EXTRA_ALLOC must be >= 0! -#define EXTRA_ALLOC (19 - nLen % 16) - -// --------------------------------------------------------------------------- -// static class variables definition -// --------------------------------------------------------------------------- - -#if !wxUSE_STL - //According to STL _must_ be a -1 size_t - const size_t wxStringBase::npos = (size_t) -1; -#endif - -// ---------------------------------------------------------------------------- -// static data -// ---------------------------------------------------------------------------- - -#if wxUSE_STL - -extern const wxChar WXDLLIMPEXP_BASE *wxEmptyString = _T(""); - -#else - -// for an empty string, GetStringData() will return this address: this -// structure has the same layout as wxStringData and it's data() method will -// return the empty string (dummy pointer) -static const struct -{ - wxStringData data; - wxChar dummy; -} g_strEmpty = { {-1, 0, 0}, wxT('\0') }; - -// empty C style string: points to 'string data' byte of g_strEmpty -extern const wxChar WXDLLIMPEXP_BASE *wxEmptyString = &g_strEmpty.dummy; - -#endif - -// ---------------------------------------------------------------------------- -// global functions -// ---------------------------------------------------------------------------- - -#if wxUSE_STD_IOSTREAM - -#include - -wxSTD ostream& operator<<(wxSTD ostream& os, const wxString& str) -{ -#ifdef __BORLANDC__ - os << str.mb_str(); -#else - os << str.c_str(); -#endif - return os; -} - -#endif // wxUSE_STD_IOSTREAM - -// ---------------------------------------------------------------------------- -// private classes -// ---------------------------------------------------------------------------- - -// this small class is used to gather statistics for performance tuning -//#define WXSTRING_STATISTICS -#ifdef WXSTRING_STATISTICS - class Averager - { - public: - Averager(const wxChar *sz) { m_sz = sz; m_nTotal = m_nCount = 0; } - ~Averager() - { wxPrintf("wxString: average %s = %f\n", m_sz, ((float)m_nTotal)/m_nCount); } - - void Add(size_t n) { m_nTotal += n; m_nCount++; } - - private: - size_t m_nCount, m_nTotal; - const wxChar *m_sz; - } g_averageLength("allocation size"), - g_averageSummandLength("summand length"), - g_averageConcatHit("hit probability in concat"), - g_averageInitialLength("initial string length"); - - #define STATISTICS_ADD(av, val) g_average##av.Add(val) -#else - #define STATISTICS_ADD(av, val) -#endif // WXSTRING_STATISTICS - -#if !wxUSE_STL - -// =========================================================================== -// wxStringData class deallocation -// =========================================================================== - -#if defined(__VISUALC__) && defined(_MT) && !defined(_DLL) -# pragma message (__FILE__ ": building with Multithreaded non DLL runtime has a performance impact on wxString!") -void wxStringData::Free() -{ - free(this); -} -#endif - -// =========================================================================== -// wxStringBase -// =========================================================================== - -// takes nLength elements of psz starting at nPos -void wxStringBase::InitWith(const wxChar *psz, size_t nPos, size_t nLength) -{ - Init(); - - // if the length is not given, assume the string to be NUL terminated - if ( nLength == npos ) { - wxASSERT_MSG( nPos <= wxStrlen(psz), _T("index out of bounds") ); - - nLength = wxStrlen(psz + nPos); - } - - STATISTICS_ADD(InitialLength, nLength); - - if ( nLength > 0 ) { - // trailing '\0' is written in AllocBuffer() - if ( !AllocBuffer(nLength) ) { - wxFAIL_MSG( _T("out of memory in wxStringBase::InitWith") ); - return; - } - wxTmemcpy(m_pchData, psz + nPos, nLength); - } -} - -// poor man's iterators are "void *" pointers -wxStringBase::wxStringBase(const void *pStart, const void *pEnd) -{ - if ( pEnd >= pStart ) - { - InitWith((const wxChar *)pStart, 0, - (const wxChar *)pEnd - (const wxChar *)pStart); - } - else - { - wxFAIL_MSG( _T("pStart is not before pEnd") ); - Init(); - } -} - -wxStringBase::wxStringBase(size_type n, wxChar ch) -{ - Init(); - append(n, ch); -} - -// --------------------------------------------------------------------------- -// memory allocation -// --------------------------------------------------------------------------- - -// allocates memory needed to store a C string of length nLen -bool wxStringBase::AllocBuffer(size_t nLen) -{ - // allocating 0 sized buffer doesn't make sense, all empty strings should - // reuse g_strEmpty - wxASSERT( nLen > 0 ); - - // make sure that we don't overflow - wxCHECK( nLen < (INT_MAX / sizeof(wxChar)) - - (sizeof(wxStringData) + EXTRA_ALLOC + 1), false ); - - STATISTICS_ADD(Length, nLen); - - // allocate memory: - // 1) one extra character for '\0' termination - // 2) sizeof(wxStringData) for housekeeping info - wxStringData* pData = (wxStringData*) - malloc(sizeof(wxStringData) + (nLen + EXTRA_ALLOC + 1)*sizeof(wxChar)); - - if ( pData == NULL ) { - // allocation failures are handled by the caller - return false; - } - - pData->nRefs = 1; - pData->nDataLength = nLen; - pData->nAllocLength = nLen + EXTRA_ALLOC; - m_pchData = pData->data(); // data starts after wxStringData - m_pchData[nLen] = wxT('\0'); - return true; -} - -// must be called before changing this string -bool wxStringBase::CopyBeforeWrite() -{ - wxStringData* pData = GetStringData(); - - if ( pData->IsShared() ) { - pData->Unlock(); // memory not freed because shared - size_t nLen = pData->nDataLength; - if ( !AllocBuffer(nLen) ) { - // allocation failures are handled by the caller - return false; - } - wxTmemcpy(m_pchData, pData->data(), nLen); - } - - wxASSERT( !GetStringData()->IsShared() ); // we must be the only owner - - return true; -} - -// must be called before replacing contents of this string -bool wxStringBase::AllocBeforeWrite(size_t nLen) -{ - wxASSERT( nLen != 0 ); // doesn't make any sense - - // must not share string and must have enough space - wxStringData* pData = GetStringData(); - if ( pData->IsShared() || pData->IsEmpty() ) { - // can't work with old buffer, get new one - pData->Unlock(); - if ( !AllocBuffer(nLen) ) { - // allocation failures are handled by the caller - return false; - } - } - else { - if ( nLen > pData->nAllocLength ) { - // realloc the buffer instead of calling malloc() again, this is more - // efficient - STATISTICS_ADD(Length, nLen); - - nLen += EXTRA_ALLOC; - - pData = (wxStringData*) - realloc(pData, sizeof(wxStringData) + (nLen + 1)*sizeof(wxChar)); - - if ( pData == NULL ) { - // allocation failures are handled by the caller - // keep previous data since reallocation failed - return false; - } - - pData->nAllocLength = nLen; - m_pchData = pData->data(); - } - } - - wxASSERT( !GetStringData()->IsShared() ); // we must be the only owner - - // it doesn't really matter what the string length is as it's going to be - // overwritten later but, for extra safety, set it to 0 for now as we may - // have some junk in m_pchData - GetStringData()->nDataLength = 0; - - return true; -} - -wxStringBase& wxStringBase::append(size_t n, wxChar ch) -{ - size_type len = length(); - - if ( !Alloc(len + n) || !CopyBeforeWrite() ) { - wxFAIL_MSG( _T("out of memory in wxStringBase::append") ); - } - GetStringData()->nDataLength = len + n; - m_pchData[len + n] = '\0'; - for ( size_t i = 0; i < n; ++i ) - m_pchData[len + i] = ch; - return *this; -} - -void wxStringBase::resize(size_t nSize, wxChar ch) -{ - size_t len = length(); - - if ( nSize < len ) - { - erase(begin() + nSize, end()); - } - else if ( nSize > len ) - { - append(nSize - len, ch); - } - //else: we have exactly the specified length, nothing to do -} - -// allocate enough memory for nLen characters -bool wxStringBase::Alloc(size_t nLen) -{ - wxStringData *pData = GetStringData(); - if ( pData->nAllocLength <= nLen ) { - if ( pData->IsEmpty() ) { - nLen += EXTRA_ALLOC; - - pData = (wxStringData *) - malloc(sizeof(wxStringData) + (nLen + 1)*sizeof(wxChar)); - - if ( pData == NULL ) { - // allocation failure handled by caller - return false; - } - - pData->nRefs = 1; - pData->nDataLength = 0; - pData->nAllocLength = nLen; - m_pchData = pData->data(); // data starts after wxStringData - m_pchData[0u] = wxT('\0'); - } - else if ( pData->IsShared() ) { - pData->Unlock(); // memory not freed because shared - size_t nOldLen = pData->nDataLength; - if ( !AllocBuffer(nLen) ) { - // allocation failure handled by caller - return false; - } - // +1 to copy the terminator, too - memcpy(m_pchData, pData->data(), (nOldLen+1)*sizeof(wxChar)); - GetStringData()->nDataLength = nOldLen; - } - else { - nLen += EXTRA_ALLOC; - - pData = (wxStringData *) - realloc(pData, sizeof(wxStringData) + (nLen + 1)*sizeof(wxChar)); - - if ( pData == NULL ) { - // allocation failure handled by caller - // keep previous data since reallocation failed - return false; - } - - // it's not important if the pointer changed or not (the check for this - // is not faster than assigning to m_pchData in all cases) - pData->nAllocLength = nLen; - m_pchData = pData->data(); - } - } - //else: we've already got enough - return true; -} - -wxStringBase::iterator wxStringBase::begin() -{ - if (length() > 0) - CopyBeforeWrite(); - return m_pchData; -} - -wxStringBase::iterator wxStringBase::end() -{ - if (length() > 0) - CopyBeforeWrite(); - return m_pchData + length(); -} - -wxStringBase::iterator wxStringBase::erase(iterator it) -{ - size_type idx = it - begin(); - erase(idx, 1); - return begin() + idx; -} - -wxStringBase& wxStringBase::erase(size_t nStart, size_t nLen) -{ - wxASSERT(nStart <= length()); - size_t strLen = length() - nStart; - // delete nLen or up to the end of the string characters - nLen = strLen < nLen ? strLen : nLen; - wxString strTmp(c_str(), nStart); - strTmp.append(c_str() + nStart + nLen, length() - nStart - nLen); - - swap(strTmp); - return *this; -} - -wxStringBase& wxStringBase::insert(size_t nPos, const wxChar *sz, size_t n) -{ - wxASSERT( nPos <= length() ); - - if ( n == npos ) n = wxStrlen(sz); - if ( n == 0 ) return *this; - - if ( !Alloc(length() + n) || !CopyBeforeWrite() ) { - wxFAIL_MSG( _T("out of memory in wxStringBase::insert") ); - } - - memmove(m_pchData + nPos + n, m_pchData + nPos, - (length() - nPos) * sizeof(wxChar)); - memcpy(m_pchData + nPos, sz, n * sizeof(wxChar)); - GetStringData()->nDataLength = length() + n; - m_pchData[length()] = '\0'; - - return *this; -} - -void wxStringBase::swap(wxStringBase& str) -{ - wxChar* tmp = str.m_pchData; - str.m_pchData = m_pchData; - m_pchData = tmp; -} - -size_t wxStringBase::find(const wxStringBase& str, size_t nStart) const -{ - // deal with the special case of empty string first - const size_t nLen = length(); - const size_t nLenOther = str.length(); - - if ( !nLenOther ) - { - // empty string is a substring of anything - return 0; - } - - if ( !nLen ) - { - // the other string is non empty so can't be our substring - return npos; - } - - wxASSERT( str.GetStringData()->IsValid() ); - wxASSERT( nStart <= nLen ); - - const wxChar * const other = str.c_str(); - - // anchor - const wxChar* p = (const wxChar*)wxTmemchr(c_str() + nStart, - *other, - nLen - nStart); - - if ( !p ) - return npos; - - while ( p - c_str() + nLenOther <= nLen && wxTmemcmp(p, other, nLenOther) ) - { - p++; - - // anchor again - p = (const wxChar*)wxTmemchr(p, *other, nLen - (p - c_str())); - - if ( !p ) - return npos; - } - - return p - c_str() + nLenOther <= nLen ? p - c_str() : npos; -} - -size_t wxStringBase::find(const wxChar* sz, size_t nStart, size_t n) const -{ - return find(wxStringBase(sz, n), nStart); -} - -size_t wxStringBase::find(wxChar ch, size_t nStart) const -{ - wxASSERT( nStart <= length() ); - - const wxChar *p = (const wxChar*)wxTmemchr(c_str() + nStart, ch, length() - nStart); - - return p == NULL ? npos : p - c_str(); -} - -size_t wxStringBase::rfind(const wxStringBase& str, size_t nStart) const -{ - wxASSERT( str.GetStringData()->IsValid() ); - wxASSERT( nStart == npos || nStart <= length() ); - - if ( length() >= str.length() ) - { - // avoids a corner case later - if ( length() == 0 && str.length() == 0 ) - return 0; - - // "top" is the point where search starts from - size_t top = length() - str.length(); - - if ( nStart == npos ) - nStart = length() - 1; - if ( nStart < top ) - top = nStart; - - const wxChar *cursor = c_str() + top; - do - { - if ( wxTmemcmp(cursor, str.c_str(), - str.length()) == 0 ) - { - return cursor - c_str(); - } - } while ( cursor-- > c_str() ); - } - - return npos; -} - -size_t wxStringBase::rfind(const wxChar* sz, size_t nStart, size_t n) const -{ - return rfind(wxStringBase(sz, n), nStart); -} - -size_t wxStringBase::rfind(wxChar ch, size_t nStart) const -{ - if ( nStart == npos ) - { - nStart = length(); - } - else - { - wxASSERT( nStart <= length() ); - } - - const wxChar *actual; - for ( actual = c_str() + ( nStart == npos ? length() : nStart + 1 ); - actual > c_str(); --actual ) - { - if ( *(actual - 1) == ch ) - return (actual - 1) - c_str(); - } - - return npos; -} - -size_t wxStringBase::find_first_of(const wxChar* sz, size_t nStart) const -{ - wxASSERT(nStart <= length()); - - size_t len = wxStrlen(sz); - - size_t i; - for(i = nStart; i < this->length(); ++i) - { - if (wxTmemchr(sz, *(c_str() + i), len)) - break; - } - - if(i == this->length()) - return npos; - else - return i; -} - -size_t wxStringBase::find_first_of(const wxChar* sz, size_t nStart, - size_t n) const -{ - return find_first_of(wxStringBase(sz, n), nStart); -} - -size_t wxStringBase::find_last_of(const wxChar* sz, size_t nStart) const -{ - if ( nStart == npos ) - { - nStart = length() - 1; - } - else - { - wxASSERT_MSG( nStart <= length(), - _T("invalid index in find_last_of()") ); - } - - size_t len = wxStrlen(sz); - - for ( const wxChar *p = c_str() + nStart; p >= c_str(); --p ) - { - if ( wxTmemchr(sz, *p, len) ) - return p - c_str(); - } - - return npos; -} - -size_t wxStringBase::find_last_of(const wxChar* sz, size_t nStart, - size_t n) const -{ - return find_last_of(wxStringBase(sz, n), nStart); -} - -size_t wxStringBase::find_first_not_of(const wxChar* sz, size_t nStart) const -{ - if ( nStart == npos ) - { - nStart = length(); - } - else - { - wxASSERT( nStart <= length() ); - } - - size_t len = wxStrlen(sz); - - size_t i; - for(i = nStart; i < this->length(); ++i) - { - if (!wxTmemchr(sz, *(c_str() + i), len)) - break; - } - - if(i == this->length()) - return npos; - else - return i; -} - -size_t wxStringBase::find_first_not_of(const wxChar* sz, size_t nStart, - size_t n) const -{ - return find_first_not_of(wxStringBase(sz, n), nStart); -} - -size_t wxStringBase::find_first_not_of(wxChar ch, size_t nStart) const -{ - wxASSERT( nStart <= length() ); - - for ( const wxChar *p = c_str() + nStart; *p; p++ ) - { - if ( *p != ch ) - return p - c_str(); - } - - return npos; -} - -size_t wxStringBase::find_last_not_of(const wxChar* sz, size_t nStart) const -{ - if ( nStart == npos ) - { - nStart = length() - 1; - } - else - { - wxASSERT( nStart <= length() ); - } - - size_t len = wxStrlen(sz); - - for ( const wxChar *p = c_str() + nStart; p >= c_str(); --p ) - { - if ( !wxTmemchr(sz, *p,len) ) - return p - c_str(); - } - - return npos; -} - -size_t wxStringBase::find_last_not_of(const wxChar* sz, size_t nStart, - size_t n) const -{ - return find_last_not_of(wxStringBase(sz, n), nStart); -} - -size_t wxStringBase::find_last_not_of(wxChar ch, size_t nStart) const -{ - if ( nStart == npos ) - { - nStart = length() - 1; - } - else - { - wxASSERT( nStart <= length() ); - } - - for ( const wxChar *p = c_str() + nStart; p >= c_str(); --p ) - { - if ( *p != ch ) - return p - c_str(); - } - - return npos; -} - -wxStringBase& wxStringBase::replace(size_t nStart, size_t nLen, - const wxChar *sz) -{ - wxASSERT_MSG( nStart <= length(), - _T("index out of bounds in wxStringBase::replace") ); - size_t strLen = length() - nStart; - nLen = strLen < nLen ? strLen : nLen; - - wxStringBase strTmp; - strTmp.reserve(length()); // micro optimisation to avoid multiple mem allocs - - //This is kind of inefficient, but its pretty good considering... - //we don't want to use character access operators here because on STL - //it will freeze the reference count of strTmp, which means a deep copy - //at the end when swap is called - // - //Also, we can't use append with the full character pointer and must - //do it manually because this string can contain null characters - for(size_t i1 = 0; i1 < nStart; ++i1) - strTmp.append(1, this->c_str()[i1]); - - //its safe to do the full version here because - //sz must be a normal c string - strTmp.append(sz); - - for(size_t i2 = nStart + nLen; i2 < length(); ++i2) - strTmp.append(1, this->c_str()[i2]); - - swap(strTmp); - return *this; -} - -wxStringBase& wxStringBase::replace(size_t nStart, size_t nLen, - size_t nCount, wxChar ch) -{ - return replace(nStart, nLen, wxStringBase(nCount, ch).c_str()); -} - -wxStringBase& wxStringBase::replace(size_t nStart, size_t nLen, - const wxStringBase& str, - size_t nStart2, size_t nLen2) -{ - return replace(nStart, nLen, str.substr(nStart2, nLen2)); -} - -wxStringBase& wxStringBase::replace(size_t nStart, size_t nLen, - const wxChar* sz, size_t nCount) -{ - return replace(nStart, nLen, wxStringBase(sz, nCount).c_str()); -} - -wxStringBase wxStringBase::substr(size_t nStart, size_t nLen) const -{ - if ( nLen == npos ) - nLen = length() - nStart; - return wxStringBase(*this, nStart, nLen); -} - -// assigns one string to another -wxStringBase& wxStringBase::operator=(const wxStringBase& stringSrc) -{ - wxASSERT( stringSrc.GetStringData()->IsValid() ); - - // don't copy string over itself - if ( m_pchData != stringSrc.m_pchData ) { - if ( stringSrc.GetStringData()->IsEmpty() ) { - Reinit(); - } - else { - // adjust references - GetStringData()->Unlock(); - m_pchData = stringSrc.m_pchData; - GetStringData()->Lock(); - } - } - - return *this; -} - -// assigns a single character -wxStringBase& wxStringBase::operator=(wxChar ch) -{ - if ( !AssignCopy(1, &ch) ) { - wxFAIL_MSG( _T("out of memory in wxStringBase::operator=(wxChar)") ); - } - return *this; -} - -// assigns C string -wxStringBase& wxStringBase::operator=(const wxChar *psz) -{ - if ( !AssignCopy(wxStrlen(psz), psz) ) { - wxFAIL_MSG( _T("out of memory in wxStringBase::operator=(const wxChar *)") ); - } - return *this; -} - -// helper function: does real copy -bool wxStringBase::AssignCopy(size_t nSrcLen, const wxChar *pszSrcData) -{ - if ( nSrcLen == 0 ) { - Reinit(); - } - else { - if ( !AllocBeforeWrite(nSrcLen) ) { - // allocation failure handled by caller - return false; - } - - // use memmove() and not memcpy() here as we might be copying from our own - // buffer in case of assignment such as "s = s.c_str()" (see #11294) - memmove(m_pchData, pszSrcData, nSrcLen*sizeof(wxChar)); - - GetStringData()->nDataLength = nSrcLen; - m_pchData[nSrcLen] = wxT('\0'); - } - return true; -} - -// --------------------------------------------------------------------------- -// string concatenation -// --------------------------------------------------------------------------- - -// add something to this string -bool wxStringBase::ConcatSelf(size_t nSrcLen, const wxChar *pszSrcData, - size_t nMaxLen) -{ - STATISTICS_ADD(SummandLength, nSrcLen); - - nSrcLen = nSrcLen < nMaxLen ? nSrcLen : nMaxLen; - - // concatenating an empty string is a NOP - if ( nSrcLen > 0 ) { - wxStringData *pData = GetStringData(); - size_t nLen = pData->nDataLength; - size_t nNewLen = nLen + nSrcLen; - - // take special care when appending part of this string to itself: the code - // below reallocates our buffer and this invalidates pszSrcData pointer so - // we have to copy it in another temporary string in this case (but avoid - // doing this unnecessarily) - if ( pszSrcData >= m_pchData && pszSrcData < m_pchData + nLen ) - { - wxStringBase tmp(pszSrcData, nSrcLen); - return ConcatSelf(nSrcLen, tmp.m_pchData, nSrcLen); - } - - // alloc new buffer if current is too small - if ( pData->IsShared() ) { - STATISTICS_ADD(ConcatHit, 0); - - // we have to allocate another buffer - wxStringData* pOldData = GetStringData(); - if ( !AllocBuffer(nNewLen) ) { - // allocation failure handled by caller - return false; - } - memcpy(m_pchData, pOldData->data(), nLen*sizeof(wxChar)); - pOldData->Unlock(); - } - else if ( nNewLen > pData->nAllocLength ) { - STATISTICS_ADD(ConcatHit, 0); - - reserve(nNewLen); - // we have to grow the buffer - if ( capacity() < nNewLen ) { - // allocation failure handled by caller - return false; - } - } - else { - STATISTICS_ADD(ConcatHit, 1); - - // the buffer is already big enough - } - - // should be enough space - wxASSERT( nNewLen <= GetStringData()->nAllocLength ); - - // fast concatenation - all is done in our buffer - memcpy(m_pchData + nLen, pszSrcData, nSrcLen*sizeof(wxChar)); - - m_pchData[nNewLen] = wxT('\0'); // put terminating '\0' - GetStringData()->nDataLength = nNewLen; // and fix the length - } - //else: the string to append was empty - return true; -} - -// --------------------------------------------------------------------------- -// simple sub-string extraction -// --------------------------------------------------------------------------- - -// helper function: clone the data attached to this string -bool wxStringBase::AllocCopy(wxString& dest, int nCopyLen, int nCopyIndex) const -{ - if ( nCopyLen == 0 ) { - dest.Init(); - } - else { - if ( !dest.AllocBuffer(nCopyLen) ) { - // allocation failure handled by caller - return false; - } - memcpy(dest.m_pchData, m_pchData + nCopyIndex, nCopyLen*sizeof(wxChar)); - } - return true; -} - -#endif // !wxUSE_STL - -#if !wxUSE_STL || !defined(HAVE_STD_STRING_COMPARE) - -#if !wxUSE_STL - #define STRINGCLASS wxStringBase -#else - #define STRINGCLASS wxString -#endif - -static inline int wxDoCmp(const wxChar* s1, size_t l1, - const wxChar* s2, size_t l2) -{ - if( l1 == l2 ) - return wxTmemcmp(s1, s2, l1); - else if( l1 < l2 ) - { - int ret = wxTmemcmp(s1, s2, l1); - return ret == 0 ? -1 : ret; - } - else - { - int ret = wxTmemcmp(s1, s2, l2); - return ret == 0 ? +1 : ret; - } -} - -int STRINGCLASS::compare(const wxStringBase& str) const -{ - return ::wxDoCmp(data(), length(), str.data(), str.length()); -} - -int STRINGCLASS::compare(size_t nStart, size_t nLen, - const wxStringBase& str) const -{ - wxASSERT(nStart <= length()); - size_type strLen = length() - nStart; - nLen = strLen < nLen ? strLen : nLen; - return ::wxDoCmp(data() + nStart, nLen, str.data(), str.length()); -} - -int STRINGCLASS::compare(size_t nStart, size_t nLen, - const wxStringBase& str, - size_t nStart2, size_t nLen2) const -{ - wxASSERT(nStart <= length()); - wxASSERT(nStart2 <= str.length()); - size_type strLen = length() - nStart, - strLen2 = str.length() - nStart2; - nLen = strLen < nLen ? strLen : nLen; - nLen2 = strLen2 < nLen2 ? strLen2 : nLen2; - return ::wxDoCmp(data() + nStart, nLen, str.data() + nStart2, nLen2); -} - -int STRINGCLASS::compare(const wxChar* sz) const -{ - size_t nLen = wxStrlen(sz); - return ::wxDoCmp(data(), length(), sz, nLen); -} - -int STRINGCLASS::compare(size_t nStart, size_t nLen, - const wxChar* sz, size_t nCount) const -{ - wxASSERT(nStart <= length()); - size_type strLen = length() - nStart; - nLen = strLen < nLen ? strLen : nLen; - if( nCount == npos ) - nCount = wxStrlen(sz); - - return ::wxDoCmp(data() + nStart, nLen, sz, nCount); -} - -#undef STRINGCLASS - -#endif // !wxUSE_STL || !defined(HAVE_STD_STRING_COMPARE) - -// =========================================================================== -// wxString class core -// =========================================================================== - -// --------------------------------------------------------------------------- -// construction and conversion -// --------------------------------------------------------------------------- - -#if wxUSE_UNICODE - -// from multibyte string -wxString::wxString(const char *psz, const wxMBConv& conv, size_t nLength) -{ - // anything to do? - if ( psz && nLength != 0 ) - { - if ( nLength == npos ) - { - nLength = wxNO_LEN; - } - - size_t nLenWide; - wxWCharBuffer wbuf = conv.cMB2WC(psz, nLength, &nLenWide); - - if ( nLenWide ) - assign(wbuf, nLenWide); - } -} - -//Convert wxString in Unicode mode to a multi-byte string -const wxCharBuffer wxString::mb_str(const wxMBConv& conv) const -{ - return conv.cWC2MB(c_str(), length() + 1 /* size, not length */, NULL); -} - -#else // ANSI - -#if wxUSE_WCHAR_T - -// from wide string -wxString::wxString(const wchar_t *pwz, const wxMBConv& conv, size_t nLength) -{ - // anything to do? - if ( pwz && nLength != 0 ) - { - if ( nLength == npos ) - { - nLength = wxNO_LEN; - } - - size_t nLenMB; - wxCharBuffer buf = conv.cWC2MB(pwz, nLength, &nLenMB); - - if ( nLenMB ) - assign(buf, nLenMB); - } -} - -//Converts this string to a wide character string if unicode -//mode is not enabled and wxUSE_WCHAR_T is enabled -const wxWCharBuffer wxString::wc_str(const wxMBConv& conv) const -{ - return conv.cMB2WC(c_str(), length() + 1 /* size, not length */, NULL); -} - -#endif // wxUSE_WCHAR_T - -#endif // Unicode/ANSI - -// shrink to minimal size (releasing extra memory) -bool wxString::Shrink() -{ - wxString tmp(begin(), end()); - swap(tmp); - return tmp.length() == length(); -} - -#if !wxUSE_STL -// get the pointer to writable buffer of (at least) nLen bytes -wxChar *wxString::GetWriteBuf(size_t nLen) -{ - if ( !AllocBeforeWrite(nLen) ) { - // allocation failure handled by caller - return NULL; - } - - wxASSERT( GetStringData()->nRefs == 1 ); - GetStringData()->Validate(false); - - return m_pchData; -} - -// put string back in a reasonable state after GetWriteBuf -void wxString::UngetWriteBuf() -{ - UngetWriteBuf(wxStrlen(m_pchData)); -} - -void wxString::UngetWriteBuf(size_t nLen) -{ - wxStringData * const pData = GetStringData(); - - wxASSERT_MSG( nLen < pData->nAllocLength, _T("buffer overrun") ); - - // the strings we store are always NUL-terminated - pData->data()[nLen] = _T('\0'); - pData->nDataLength = nLen; - pData->Validate(true); -} -#endif // !wxUSE_STL - -// --------------------------------------------------------------------------- -// data access -// --------------------------------------------------------------------------- - -// all functions are inline in string.h - -// --------------------------------------------------------------------------- -// assignment operators -// --------------------------------------------------------------------------- - -#if !wxUSE_UNICODE - -// same as 'signed char' variant -wxString& wxString::operator=(const unsigned char* psz) -{ - *this = (const char *)psz; - return *this; -} - -#if wxUSE_WCHAR_T -wxString& wxString::operator=(const wchar_t *pwz) -{ - wxString str(pwz); - swap(str); - return *this; -} -#endif - -#endif - -/* - * concatenation functions come in 5 flavours: - * string + string - * char + string and string + char - * C str + string and string + C str - */ - -wxString operator+(const wxString& str1, const wxString& str2) -{ -#if !wxUSE_STL - wxASSERT( str1.GetStringData()->IsValid() ); - wxASSERT( str2.GetStringData()->IsValid() ); -#endif - - wxString s = str1; - s += str2; - - return s; -} - -wxString operator+(const wxString& str, wxChar ch) -{ -#if !wxUSE_STL - wxASSERT( str.GetStringData()->IsValid() ); -#endif - - wxString s = str; - s += ch; - - return s; -} - -wxString operator+(wxChar ch, const wxString& str) -{ -#if !wxUSE_STL - wxASSERT( str.GetStringData()->IsValid() ); -#endif - - wxString s = ch; - s += str; - - return s; -} - -wxString operator+(const wxString& str, const wxChar *psz) -{ -#if !wxUSE_STL - wxASSERT( str.GetStringData()->IsValid() ); -#endif - - wxString s; - if ( !s.Alloc(wxStrlen(psz) + str.length()) ) { - wxFAIL_MSG( _T("out of memory in wxString::operator+") ); - } - s += str; - s += psz; - - return s; -} - -wxString operator+(const wxChar *psz, const wxString& str) -{ -#if !wxUSE_STL - wxASSERT( str.GetStringData()->IsValid() ); -#endif - - wxString s; - if ( !s.Alloc(wxStrlen(psz) + str.length()) ) { - wxFAIL_MSG( _T("out of memory in wxString::operator+") ); - } - s = psz; - s += str; - - return s; -} - -// =========================================================================== -// other common string functions -// =========================================================================== - -int wxString::Cmp(const wxString& s) const -{ - return compare(s); -} - -int wxString::Cmp(const wxChar* psz) const -{ - return compare(psz); -} - -static inline int wxDoCmpNoCase(const wxChar* s1, size_t l1, - const wxChar* s2, size_t l2) -{ - size_t i; - - if( l1 == l2 ) - { - for(i = 0; i < l1; ++i) - { - if(wxTolower(s1[i]) != wxTolower(s2[i])) - break; - } - return i == l1 ? 0 : wxTolower(s1[i]) < wxTolower(s2[i]) ? -1 : 1; - } - else if( l1 < l2 ) - { - for(i = 0; i < l1; ++i) - { - if(wxTolower(s1[i]) != wxTolower(s2[i])) - break; - } - return i == l1 ? -1 : wxTolower(s1[i]) < wxTolower(s2[i]) ? -1 : 1; - } - else - { - for(i = 0; i < l2; ++i) - { - if(wxTolower(s1[i]) != wxTolower(s2[i])) - break; - } - return i == l2 ? 1 : wxTolower(s1[i]) < wxTolower(s2[i]) ? -1 : 1; - } -} - -int wxString::CmpNoCase(const wxString& s) const -{ - return wxDoCmpNoCase(data(), length(), s.data(), s.length()); -} - -int wxString::CmpNoCase(const wxChar* psz) const -{ - int nLen = wxStrlen(psz); - - return wxDoCmpNoCase(data(), length(), psz, nLen); -} - - -#if wxUSE_UNICODE - -#ifdef __MWERKS__ -#ifndef __SCHAR_MAX__ -#define __SCHAR_MAX__ 127 -#endif -#endif - -wxString wxString::FromAscii(const char *ascii) -{ - if (!ascii) - return wxEmptyString; - - size_t len = strlen( ascii ); - wxString res; - - if ( len ) - { - wxStringBuffer buf(res, len); - - wchar_t *dest = buf; - - for ( ;; ) - { - if ( (*dest++ = (wchar_t)(unsigned char)*ascii++) == L'\0' ) - break; - } - } - - return res; -} - -wxString wxString::FromAscii(const char ascii) -{ - // What do we do with '\0' ? - - wxString res; - res += (wchar_t)(unsigned char) ascii; - - return res; -} - -const wxCharBuffer wxString::ToAscii() const -{ - // this will allocate enough space for the terminating NUL too - wxCharBuffer buffer(length()); - - - char *dest = buffer.data(); - - const wchar_t *pwc = c_str(); - for ( ;; ) - { - *dest++ = (char)(*pwc > SCHAR_MAX ? wxT('_') : *pwc); - - // the output string can't have embedded NULs anyhow, so we can safely - // stop at first of them even if we do have any - if ( !*pwc++ ) - break; - } - - return buffer; -} - -#endif // Unicode - -// extract string of length nCount starting at nFirst -wxString wxString::Mid(size_t nFirst, size_t nCount) const -{ - size_t nLen = length(); - - // default value of nCount is npos and means "till the end" - if ( nCount == npos ) - { - nCount = nLen - nFirst; - } - - // out-of-bounds requests return sensible things - if ( nFirst + nCount > nLen ) - { - nCount = nLen - nFirst; - } - - if ( nFirst > nLen ) - { - // AllocCopy() will return empty string - return wxEmptyString; - } - - wxString dest(*this, nFirst, nCount); - if ( dest.length() != nCount ) - { - wxFAIL_MSG( _T("out of memory in wxString::Mid") ); - } - - return dest; -} - -// check that the string starts with prefix and return the rest of the string -// in the provided pointer if it is not NULL, otherwise return false -bool wxString::StartsWith(const wxChar *prefix, wxString *rest) const -{ - wxASSERT_MSG( prefix, _T("invalid parameter in wxString::StartsWith") ); - - // first check if the beginning of the string matches the prefix: note - // that we don't have to check that we don't run out of this string as - // when we reach the terminating NUL, either prefix string ends too (and - // then it's ok) or we break out of the loop because there is no match - const wxChar *p = c_str(); - while ( *prefix ) - { - if ( *prefix++ != *p++ ) - { - // no match - return false; - } - } - - if ( rest ) - { - // put the rest of the string into provided pointer - *rest = p; - } - - return true; -} - - -// check that the string ends with suffix and return the rest of it in the -// provided pointer if it is not NULL, otherwise return false -bool wxString::EndsWith(const wxChar *suffix, wxString *rest) const -{ - wxASSERT_MSG( suffix, _T("invalid parameter in wxString::EndssWith") ); - - int start = length() - wxStrlen(suffix); - if ( start < 0 || wxStrcmp(c_str() + start, suffix) != 0 ) - return false; - - if ( rest ) - { - // put the rest of the string into provided pointer - rest->assign(*this, 0, start); - } - - return true; -} - - -// extract nCount last (rightmost) characters -wxString wxString::Right(size_t nCount) const -{ - if ( nCount > length() ) - nCount = length(); - - wxString dest(*this, length() - nCount, nCount); - if ( dest.length() != nCount ) { - wxFAIL_MSG( _T("out of memory in wxString::Right") ); - } - return dest; -} - -// get all characters after the last occurence of ch -// (returns the whole string if ch not found) -wxString wxString::AfterLast(wxChar ch) const -{ - wxString str; - int iPos = Find(ch, true); - if ( iPos == wxNOT_FOUND ) - str = *this; - else - str = c_str() + iPos + 1; - - return str; -} - -// extract nCount first (leftmost) characters -wxString wxString::Left(size_t nCount) const -{ - if ( nCount > length() ) - nCount = length(); - - wxString dest(*this, 0, nCount); - if ( dest.length() != nCount ) { - wxFAIL_MSG( _T("out of memory in wxString::Left") ); - } - return dest; -} - -// get all characters before the first occurence of ch -// (returns the whole string if ch not found) -wxString wxString::BeforeFirst(wxChar ch) const -{ - int iPos = Find(ch); - if ( iPos == wxNOT_FOUND ) iPos = length(); - return wxString(*this, 0, iPos); -} - -/// get all characters before the last occurence of ch -/// (returns empty string if ch not found) -wxString wxString::BeforeLast(wxChar ch) const -{ - wxString str; - int iPos = Find(ch, true); - if ( iPos != wxNOT_FOUND && iPos != 0 ) - str = wxString(c_str(), iPos); - - return str; -} - -/// get all characters after the first occurence of ch -/// (returns empty string if ch not found) -wxString wxString::AfterFirst(wxChar ch) const -{ - wxString str; - int iPos = Find(ch); - if ( iPos != wxNOT_FOUND ) - str = c_str() + iPos + 1; - - return str; -} - -// replace first (or all) occurences of some substring with another one -size_t -wxString::Replace(const wxChar *szOld, const wxChar *szNew, bool bReplaceAll) -{ - // if we tried to replace an empty string we'd enter an infinite loop below - wxCHECK_MSG( szOld && *szOld && szNew, 0, - _T("wxString::Replace(): invalid parameter") ); - - size_t uiCount = 0; // count of replacements made - - // optimize the special common case of replacing one character with another - // one - if ( szOld[1] == '\0' && (szNew[0] != '\0' && szNew[1] == '\0') ) - { - // this loop is the simplified version of the one below - for ( size_t pos = 0; ; ) - { - pos = find(*szOld, pos); - if ( pos == npos ) - break; - - (*this)[pos++] = *szNew; - - uiCount++; - - if ( !bReplaceAll ) - break; - } - } - else // general case - { - const size_t uiOldLen = wxStrlen(szOld); - const size_t uiNewLen = wxStrlen(szNew); - - for ( size_t pos = 0; ; ) - { - pos = find(szOld, pos); - if ( pos == npos ) - break; - - // replace this occurrence of the old string with the new one - replace(pos, uiOldLen, szNew, uiNewLen); - - // move past the string that was replaced - pos += uiNewLen; - - // increase replace count - uiCount++; - - // stop now? - if ( !bReplaceAll ) - break; - } - } - - return uiCount; -} - -bool wxString::IsAscii() const -{ - const wxChar *s = (const wxChar*) *this; - while(*s){ - if(!isascii(*s)) return(false); - s++; - } - return(true); -} - -bool wxString::IsWord() const -{ - const wxChar *s = (const wxChar*) *this; - while(*s){ - if(!wxIsalpha(*s)) return(false); - s++; - } - return(true); -} - -bool wxString::IsNumber() const -{ - const wxChar *s = (const wxChar*) *this; - if (wxStrlen(s)) - if ((s[0] == wxT('-')) || (s[0] == wxT('+'))) s++; - while(*s){ - if(!wxIsdigit(*s)) return(false); - s++; - } - return(true); -} - -wxString wxString::Strip(stripType w) const -{ - wxString s = *this; - if ( w & leading ) s.Trim(false); - if ( w & trailing ) s.Trim(true); - return s; -} - -// --------------------------------------------------------------------------- -// case conversion -// --------------------------------------------------------------------------- - -wxString& wxString::MakeUpper() -{ - for ( iterator it = begin(), en = end(); it != en; ++it ) - *it = (wxChar)wxToupper(*it); - - return *this; -} - -wxString& wxString::MakeLower() -{ - for ( iterator it = begin(), en = end(); it != en; ++it ) - *it = (wxChar)wxTolower(*it); - - return *this; -} - -// --------------------------------------------------------------------------- -// trimming and padding -// --------------------------------------------------------------------------- - -// some compilers (VC++ 6.0 not to name them) return true for a call to -// isspace('\xEA') in the C locale which seems to be broken to me, but we have -// to live with this by checking that the character is a 7 bit one - even if -// this may fail to detect some spaces (I don't know if Unicode doesn't have -// space-like symbols somewhere except in the first 128 chars), it is arguably -// still better than trimming away accented letters -inline int wxSafeIsspace(wxChar ch) { return (ch < 127) && wxIsspace(ch); } - -// trims spaces (in the sense of isspace) from left or right side -wxString& wxString::Trim(bool bFromRight) -{ - // first check if we're going to modify the string at all - if ( !empty() && - ( - (bFromRight && wxSafeIsspace(GetChar(length() - 1))) || - (!bFromRight && wxSafeIsspace(GetChar(0u))) - ) - ) - { - if ( bFromRight ) - { - // find last non-space character - reverse_iterator psz = rbegin(); - while ( (psz != rend()) && wxSafeIsspace(*psz) ) - psz++; - - // truncate at trailing space start - erase(psz.base(), end()); - } - else - { - // find first non-space character - iterator psz = begin(); - while ( (psz != end()) && wxSafeIsspace(*psz) ) - psz++; - - // fix up data and length - erase(begin(), psz); - } - } - - return *this; -} - -// adds nCount characters chPad to the string from either side -wxString& wxString::Pad(size_t nCount, wxChar chPad, bool bFromRight) -{ - wxString s(chPad, nCount); - - if ( bFromRight ) - *this += s; - else - { - s += *this; - swap(s); - } - - return *this; -} - -// truncate the string -wxString& wxString::Truncate(size_t uiLen) -{ - if ( uiLen < length() ) - { - erase(begin() + uiLen, end()); - } - //else: nothing to do, string is already short enough - - return *this; -} - -// --------------------------------------------------------------------------- -// finding (return wxNOT_FOUND if not found and index otherwise) -// --------------------------------------------------------------------------- - -// find a character -int wxString::Find(wxChar ch, bool bFromEnd) const -{ - size_type idx = bFromEnd ? find_last_of(ch) : find_first_of(ch); - - return (idx == npos) ? wxNOT_FOUND : (int)idx; -} - -// find a sub-string (like strstr) -int wxString::Find(const wxChar *pszSub) const -{ - size_type idx = find(pszSub); - - return (idx == npos) ? wxNOT_FOUND : (int)idx; -} - -// ---------------------------------------------------------------------------- -// conversion to numbers -// ---------------------------------------------------------------------------- - -// the implementation of all the functions below is exactly the same so factor -// it out - -template -bool wxStringToIntType(const wxChar *start, - T *val, - int base, - F func) -{ - wxCHECK_MSG( val, false, _T("NULL output pointer") ); - wxASSERT_MSG( !base || (base > 1 && base <= 36), _T("invalid base") ); - -#ifndef __WXWINCE__ - errno = 0; -#endif - - wxChar *end; - *val = (*func)(start, &end, base); - - // return true only if scan was stopped by the terminating NUL and if the - // string was not empty to start with and no under/overflow occurred - return !*end && (end != start) -#ifndef __WXWINCE__ - && (errno != ERANGE) -#endif - ; -} - -bool wxString::ToLong(long *val, int base) const -{ - return wxStringToIntType(c_str(), val, base, wxStrtol); -} - -bool wxString::ToULong(unsigned long *val, int base) const -{ - return wxStringToIntType(c_str(), val, base, wxStrtoul); -} - -bool wxString::ToLongLong(wxLongLong_t *val, int base) const -{ -#ifdef wxHAS_STRTOLL - return wxStringToIntType(c_str(), val, base, wxStrtoll); -#else - // TODO: implement this ourselves - wxUnusedVar(val); - wxUnusedVar(base); - return false; -#endif // wxHAS_STRTOLL -} - -bool wxString::ToULongLong(wxULongLong_t *val, int base) const -{ -#ifdef wxHAS_STRTOLL - return wxStringToIntType(c_str(), val, base, wxStrtoull); -#else - // TODO: implement this ourselves - wxUnusedVar(val); - wxUnusedVar(base); - return false; -#endif -} - -bool wxString::ToDouble(double *val) const -{ - wxCHECK_MSG( val, false, _T("NULL pointer in wxString::ToDouble") ); - -#ifndef __WXWINCE__ - errno = 0; -#endif - - const wxChar *start = c_str(); - wxChar *end; - *val = wxStrtod(start, &end); - - // return true only if scan was stopped by the terminating NUL and if the - // string was not empty to start with and no under/overflow occurred - return !*end && (end != start) -#ifndef __WXWINCE__ - && (errno != ERANGE) -#endif - ; -} - -// --------------------------------------------------------------------------- -// formatted output -// --------------------------------------------------------------------------- - -/* static */ -wxString wxString::Format(const wxChar *pszFormat, ...) -{ - va_list argptr; - va_start(argptr, pszFormat); - - wxString s; - s.PrintfV(pszFormat, argptr); - - va_end(argptr); - - return s; -} - -/* static */ -wxString wxString::FormatV(const wxChar *pszFormat, va_list argptr) -{ - wxString s; - s.PrintfV(pszFormat, argptr); - return s; -} - -int wxString::Printf(const wxChar *pszFormat, ...) -{ - va_list argptr; - va_start(argptr, pszFormat); - - int iLen = PrintfV(pszFormat, argptr); - - va_end(argptr); - - return iLen; -} - -/* - Uses wxVsnprintf and places the result into the this string. - - In ANSI build, wxVsnprintf is effectively vsnprintf but in Unicode build - it is vswprintf. Due to a discrepancy between vsnprintf and vswprintf in - the ISO C99 (and thus SUSv3) standard the return value for the case of - an undersized buffer is inconsistent. For conforming vsnprintf - implementations the function must return the number of characters that - would have been printed had the buffer been large enough. For conforming - vswprintf implementations the function must return a negative number - and set errno. - - What vswprintf sets errno to is undefined but Darwin seems to set it to - EOVERFLOW. The only expected errno are EILSEQ and EINVAL. Both of - those are defined in the standard and backed up by several conformance - statements. Note that ENOMEM mentioned in the manual page does not - apply to swprintf, only wprintf and fwprintf. - - Official manual page: - http://www.opengroup.org/onlinepubs/009695399/functions/swprintf.html - - Some conformance statements (AIX, Solaris): - http://www.opengroup.org/csq/view.mhtml?RID=ibm%2FSD1%2F3 - http://www.theopengroup.org/csq/view.mhtml?norationale=1&noreferences=1&RID=Fujitsu%2FSE2%2F10 - - Since EILSEQ and EINVAL are rather common but EOVERFLOW is not and since - EILSEQ and EINVAL are specifically defined to mean the error is other than - an undersized buffer and no other errno are defined we treat those two - as meaning hard errors and everything else gets the old behavior which - is to keep looping and increasing buffer size until the function succeeds. - - In practice it's impossible to determine before compilation which behavior - may be used. The vswprintf function may have vsnprintf-like behavior or - vice-versa. Behavior detected on one release can theoretically change - with an updated release. Not to mention that configure testing for it - would require the test to be run on the host system, not the build system - which makes cross compilation difficult. Therefore, we make no assumptions - about behavior and try our best to handle every known case, including the - case where wxVsnprintf returns a negative number and fails to set errno. - - There is yet one more non-standard implementation and that is our own. - Fortunately, that can be detected at compile-time. - - On top of all that, ISO C99 explicitly defines snprintf to write a null - character to the last position of the specified buffer. That would be at - at the given buffer size minus 1. It is supposed to do this even if it - turns out that the buffer is sized too small. - - Darwin (tested on 10.5) follows the C99 behavior exactly. - - Glibc 2.6 almost follows the C99 behavior except vswprintf never sets - errno even when it fails. However, it only seems to ever fail due - to an undersized buffer. -*/ -int wxString::PrintfV(const wxChar* pszFormat, va_list argptr) -{ - int size = 1024; - - for ( ;; ) - { - // Allocate 1 more character than we tell wxVsnprintf about - // just in case it is buggy. - // FIXME: I have a feeling that the underlying function was not buggy - // and I suspect it was to fix the buf[size] = '\0' line below - wxStringBuffer tmp(*this, size + 1); - wxChar *buf = tmp; - - if ( !buf ) - { - // out of memory - return -1; - } - - // wxVsnprintf() may modify the original arg pointer, so pass it - // only a copy - va_list argptrcopy; - wxVaCopy(argptrcopy, argptr); - -#ifndef __WXWINCE__ - // Set errno to 0 to make it determinate if wxVsnprintf fails to set it. - errno = 0; -#endif - int len = wxVsnprintf(buf, size, pszFormat, argptrcopy); - va_end(argptrcopy); - - // some implementations of vsnprintf() don't NUL terminate - // the string if there is not enough space for it so - // always do it manually - // FIXME: This really seems to be the wrong and would be an off-by-one - // bug except the code above allocates an extra character. - buf[size] = _T('\0'); - - // vsnprintf() may return either -1 (traditional Unix behaviour) or the - // total number of characters which would have been written if the - // buffer were large enough (newer standards such as Unix98) - if ( len < 0 ) - { -#if wxUSE_WXVSNPRINTF - // we know that our own implementation of wxVsnprintf() returns -1 - // only for a format error - thus there's something wrong with - // the user's format string - return -1; -#else // assume that system version only returns error if not enough space -#if !defined(__WXWINCE__) && (!defined(__OS2__) || defined(__INNOTEK_LIBC__)) - if( (errno == EILSEQ) || (errno == EINVAL) ) - // If errno was set to one of the two well-known hard errors - // then fail immediately to avoid an infinite loop. - return -1; - else -#endif // __WXWINCE__ - // still not enough, as we don't know how much we need, double the - // current size of the buffer - size *= 2; -#endif // wxUSE_WXVSNPRINTF/!wxUSE_WXVSNPRINTF - } - else if ( len >= size ) - { -#if wxUSE_WXVSNPRINTF - // we know that our own implementation of wxVsnprintf() returns - // size+1 when there's not enough space but that's not the size - // of the required buffer! - size *= 2; // so we just double the current size of the buffer -#else - // some vsnprintf() implementations NUL-terminate the buffer and - // some don't in len == size case, to be safe always add 1 - // FIXME: I don't quite understand this comment. The vsnprintf - // function is specifically defined to return the number of - // characters printed not including the null terminator. - // So OF COURSE you need to add 1 to get the right buffer size. - // The following line is definitely correct, no question. - size = len + 1; -#endif - } - else // ok, there was enough space - { - break; - } - } - - // we could have overshot - Shrink(); - - return length(); -} - -// ---------------------------------------------------------------------------- -// misc other operations -// ---------------------------------------------------------------------------- - -// returns true if the string matches the pattern which may contain '*' and -// '?' metacharacters (as usual, '?' matches any character and '*' any number -// of them) -bool wxString::Matches(const wxChar *pszMask) const -{ - // I disable this code as it doesn't seem to be faster (in fact, it seems - // to be much slower) than the old, hand-written code below and using it - // here requires always linking with libregex even if the user code doesn't - // use it -#if 0 // wxUSE_REGEX - // first translate the shell-like mask into a regex - wxString pattern; - pattern.reserve(wxStrlen(pszMask)); - - pattern += _T('^'); - while ( *pszMask ) - { - switch ( *pszMask ) - { - case _T('?'): - pattern += _T('.'); - break; - - case _T('*'): - pattern += _T(".*"); - break; - - case _T('^'): - case _T('.'): - case _T('$'): - case _T('('): - case _T(')'): - case _T('|'): - case _T('+'): - case _T('\\'): - // these characters are special in a RE, quote them - // (however note that we don't quote '[' and ']' to allow - // using them for Unix shell like matching) - pattern += _T('\\'); - // fall through - - default: - pattern += *pszMask; - } - - pszMask++; - } - pattern += _T('$'); - - // and now use it - return wxRegEx(pattern, wxRE_NOSUB | wxRE_EXTENDED).Matches(c_str()); -#else // !wxUSE_REGEX - // TODO: this is, of course, awfully inefficient... - - // the char currently being checked - const wxChar *pszTxt = c_str(); - - // the last location where '*' matched - const wxChar *pszLastStarInText = NULL; - const wxChar *pszLastStarInMask = NULL; - -match: - for ( ; *pszMask != wxT('\0'); pszMask++, pszTxt++ ) { - switch ( *pszMask ) { - case wxT('?'): - if ( *pszTxt == wxT('\0') ) - return false; - - // pszTxt and pszMask will be incremented in the loop statement - - break; - - case wxT('*'): - { - // remember where we started to be able to backtrack later - pszLastStarInText = pszTxt; - pszLastStarInMask = pszMask; - - // ignore special chars immediately following this one - // (should this be an error?) - while ( *pszMask == wxT('*') || *pszMask == wxT('?') ) - pszMask++; - - // if there is nothing more, match - if ( *pszMask == wxT('\0') ) - return true; - - // are there any other metacharacters in the mask? - size_t uiLenMask; - const wxChar *pEndMask = wxStrpbrk(pszMask, wxT("*?")); - - if ( pEndMask != NULL ) { - // we have to match the string between two metachars - uiLenMask = pEndMask - pszMask; - } - else { - // we have to match the remainder of the string - uiLenMask = wxStrlen(pszMask); - } - - wxString strToMatch(pszMask, uiLenMask); - const wxChar* pMatch = wxStrstr(pszTxt, strToMatch); - if ( pMatch == NULL ) - return false; - - // -1 to compensate "++" in the loop - pszTxt = pMatch + uiLenMask - 1; - pszMask += uiLenMask - 1; - } - break; - - default: - if ( *pszMask != *pszTxt ) - return false; - break; - } - } - - // match only if nothing left - if ( *pszTxt == wxT('\0') ) - return true; - - // if we failed to match, backtrack if we can - if ( pszLastStarInText ) { - pszTxt = pszLastStarInText + 1; - pszMask = pszLastStarInMask; - - pszLastStarInText = NULL; - - // don't bother resetting pszLastStarInMask, it's unnecessary - - goto match; - } - - return false; -#endif // wxUSE_REGEX/!wxUSE_REGEX -} - -// Count the number of chars -int wxString::Freq(wxChar ch) const -{ - int count = 0; - int len = length(); - for (int i = 0; i < len; i++) - { - if (GetChar(i) == ch) - count ++; - } - return count; -} - -// convert to upper case, return the copy of the string -wxString wxString::Upper() const -{ wxString s(*this); return s.MakeUpper(); } - -// convert to lower case, return the copy of the string -wxString wxString::Lower() const { wxString s(*this); return s.MakeLower(); } - -int wxString::sprintf(const wxChar *pszFormat, ...) - { - va_list argptr; - va_start(argptr, pszFormat); - int iLen = PrintfV(pszFormat, argptr); - va_end(argptr); - return iLen; - } - -// ============================================================================ -// ArrayString -// ============================================================================ - -#include "wx/arrstr.h" - -wxArrayString::wxArrayString(size_t sz, const wxChar** a) -{ -#if !wxUSE_STL - Init(false); -#endif - for (size_t i=0; i < sz; i++) - Add(a[i]); -} - -wxArrayString::wxArrayString(size_t sz, const wxString* a) -{ -#if !wxUSE_STL - Init(false); -#endif - for (size_t i=0; i < sz; i++) - Add(a[i]); -} - -#if !wxUSE_STL - -// size increment = min(50% of current size, ARRAY_MAXSIZE_INCREMENT) -#define ARRAY_MAXSIZE_INCREMENT 4096 - -#ifndef ARRAY_DEFAULT_INITIAL_SIZE // also defined in dynarray.h -#define ARRAY_DEFAULT_INITIAL_SIZE (16) -#endif - -#define STRING(p) ((wxString *)(&(p))) - -// ctor -void wxArrayString::Init(bool autoSort) -{ - m_nSize = - m_nCount = 0; - m_pItems = (wxChar **) NULL; - m_autoSort = autoSort; -} - -// copy ctor -wxArrayString::wxArrayString(const wxArrayString& src) -{ - Init(src.m_autoSort); - - *this = src; -} - -// assignment operator -wxArrayString& wxArrayString::operator=(const wxArrayString& src) -{ - if ( m_nSize > 0 ) - Clear(); - - Copy(src); - - m_autoSort = src.m_autoSort; - - return *this; -} - -void wxArrayString::Copy(const wxArrayString& src) -{ - if ( src.m_nCount > ARRAY_DEFAULT_INITIAL_SIZE ) - Alloc(src.m_nCount); - - for ( size_t n = 0; n < src.m_nCount; n++ ) - Add(src[n]); -} - -// grow the array -void wxArrayString::Grow(size_t nIncrement) -{ - // only do it if no more place - if ( (m_nSize - m_nCount) < nIncrement ) { - // if ARRAY_DEFAULT_INITIAL_SIZE were set to 0, the initially empty would - // be never resized! - #if ARRAY_DEFAULT_INITIAL_SIZE == 0 - #error "ARRAY_DEFAULT_INITIAL_SIZE must be > 0!" - #endif - - if ( m_nSize == 0 ) { - // was empty, alloc some memory - m_nSize = ARRAY_DEFAULT_INITIAL_SIZE; - if (m_nSize < nIncrement) - m_nSize = nIncrement; - m_pItems = new wxChar *[m_nSize]; - } - else { - // otherwise when it's called for the first time, nIncrement would be 0 - // and the array would never be expanded - // add 50% but not too much - size_t ndefIncrement = m_nSize < ARRAY_DEFAULT_INITIAL_SIZE - ? ARRAY_DEFAULT_INITIAL_SIZE : m_nSize >> 1; - if ( ndefIncrement > ARRAY_MAXSIZE_INCREMENT ) - ndefIncrement = ARRAY_MAXSIZE_INCREMENT; - if ( nIncrement < ndefIncrement ) - nIncrement = ndefIncrement; - m_nSize += nIncrement; - wxChar **pNew = new wxChar *[m_nSize]; - - // copy data to new location - memcpy(pNew, m_pItems, m_nCount*sizeof(wxChar *)); - - // delete old memory (but do not release the strings!) - wxDELETEA(m_pItems); - - m_pItems = pNew; - } - } -} - -void wxArrayString::Free() -{ - for ( size_t n = 0; n < m_nCount; n++ ) { - STRING(m_pItems[n])->GetStringData()->Unlock(); - } -} - -// deletes all the strings from the list -void wxArrayString::Empty() -{ - Free(); - - m_nCount = 0; -} - -// as Empty, but also frees memory -void wxArrayString::Clear() -{ - Free(); - - m_nSize = - m_nCount = 0; - - wxDELETEA(m_pItems); -} - -// dtor -wxArrayString::~wxArrayString() -{ - Free(); - - wxDELETEA(m_pItems); -} - -void wxArrayString::reserve(size_t nSize) -{ - Alloc(nSize); -} - -// pre-allocates memory (frees the previous data!) -void wxArrayString::Alloc(size_t nSize) -{ - // only if old buffer was not big enough - if ( nSize > m_nSize ) { - wxChar **pNew = new wxChar *[nSize]; - if ( !pNew ) - return; - - memcpy(pNew, m_pItems, m_nCount*sizeof(wxChar *)); - delete [] m_pItems; - - m_pItems = pNew; - m_nSize = nSize; - } -} - -// minimizes the memory usage by freeing unused memory -void wxArrayString::Shrink() -{ - // only do it if we have some memory to free - if( m_nCount < m_nSize ) { - // allocates exactly as much memory as we need - wxChar **pNew = new wxChar *[m_nCount]; - - // copy data to new location - memcpy(pNew, m_pItems, m_nCount*sizeof(wxChar *)); - delete [] m_pItems; - m_pItems = pNew; - m_nSize = m_nCount; - } -} - -#if WXWIN_COMPATIBILITY_2_4 - -// return a wxString[] as required for some control ctors. -wxString* wxArrayString::GetStringArray() const -{ - wxString *array = 0; - - if( m_nCount > 0 ) - { - array = new wxString[m_nCount]; - for( size_t i = 0; i < m_nCount; i++ ) - array[i] = m_pItems[i]; - } - - return array; -} - -void wxArrayString::Remove(size_t nIndex, size_t nRemove) -{ - RemoveAt(nIndex, nRemove); -} - -#endif // WXWIN_COMPATIBILITY_2_4 - -// searches the array for an item (forward or backwards) -int wxArrayString::Index(const wxChar *sz, bool bCase, bool bFromEnd) const -{ - if ( m_autoSort ) { - // use binary search in the sorted array - wxASSERT_MSG( bCase && !bFromEnd, - wxT("search parameters ignored for auto sorted array") ); - - size_t i, - lo = 0, - hi = m_nCount; - int res; - while ( lo < hi ) { - i = (lo + hi)/2; - - res = wxStrcmp(sz, m_pItems[i]); - if ( res < 0 ) - hi = i; - else if ( res > 0 ) - lo = i + 1; - else - return i; - } - - return wxNOT_FOUND; - } - else { - // use linear search in unsorted array - if ( bFromEnd ) { - if ( m_nCount > 0 ) { - size_t ui = m_nCount; - do { - if ( STRING(m_pItems[--ui])->IsSameAs(sz, bCase) ) - return ui; - } - while ( ui != 0 ); - } - } - else { - for( size_t ui = 0; ui < m_nCount; ui++ ) { - if( STRING(m_pItems[ui])->IsSameAs(sz, bCase) ) - return ui; - } - } - } - - return wxNOT_FOUND; -} - -// add item at the end -size_t wxArrayString::Add(const wxString& str, size_t nInsert) -{ - if ( m_autoSort ) { - // insert the string at the correct position to keep the array sorted - size_t i, - lo = 0, - hi = m_nCount; - int res; - while ( lo < hi ) { - i = (lo + hi)/2; - - res = str.Cmp(m_pItems[i]); - if ( res < 0 ) - hi = i; - else if ( res > 0 ) - lo = i + 1; - else { - lo = hi = i; - break; - } - } - - wxASSERT_MSG( lo == hi, wxT("binary search broken") ); - - Insert(str, lo, nInsert); - - return (size_t)lo; - } - else { - wxASSERT( str.GetStringData()->IsValid() ); - - Grow(nInsert); - - for (size_t i = 0; i < nInsert; i++) - { - // the string data must not be deleted! - str.GetStringData()->Lock(); - - // just append - m_pItems[m_nCount + i] = (wxChar *)str.c_str(); // const_cast - } - size_t ret = m_nCount; - m_nCount += nInsert; - return ret; - } -} - -// add item at the given position -void wxArrayString::Insert(const wxString& str, size_t nIndex, size_t nInsert) -{ - wxASSERT( str.GetStringData()->IsValid() ); - - wxCHECK_RET( nIndex <= m_nCount, wxT("bad index in wxArrayString::Insert") ); - wxCHECK_RET( m_nCount <= m_nCount + nInsert, - wxT("array size overflow in wxArrayString::Insert") ); - - Grow(nInsert); - - memmove(&m_pItems[nIndex + nInsert], &m_pItems[nIndex], - (m_nCount - nIndex)*sizeof(wxChar *)); - - for (size_t i = 0; i < nInsert; i++) - { - str.GetStringData()->Lock(); - m_pItems[nIndex + i] = (wxChar *)str.c_str(); - } - m_nCount += nInsert; -} - -// range insert (STL 23.2.4.3) -void -wxArrayString::insert(iterator it, const_iterator first, const_iterator last) -{ - const int idx = it - begin(); - - // grow it once - Grow(last - first); - - // reset "it" since it can change inside Grow() - it = begin() + idx; - - while ( first != last ) - { - it = insert(it, *first); - - // insert returns an iterator to the last element inserted but we need - // insert the next after this one, that is before the next one - ++it; - - ++first; - } -} - -// expand the array -void wxArrayString::SetCount(size_t count) -{ - Alloc(count); - - wxString s; - while ( m_nCount < count ) - m_pItems[m_nCount++] = (wxChar *)s.c_str(); -} - -// removes item from array (by index) -void wxArrayString::RemoveAt(size_t nIndex, size_t nRemove) -{ - wxCHECK_RET( nIndex < m_nCount, wxT("bad index in wxArrayString::Remove") ); - wxCHECK_RET( nIndex + nRemove <= m_nCount, - wxT("removing too many elements in wxArrayString::Remove") ); - - // release our lock - for (size_t i = 0; i < nRemove; i++) - Item(nIndex + i).GetStringData()->Unlock(); - - memmove(&m_pItems[nIndex], &m_pItems[nIndex + nRemove], - (m_nCount - nIndex - nRemove)*sizeof(wxChar *)); - m_nCount -= nRemove; -} - -// removes item from array (by value) -void wxArrayString::Remove(const wxChar *sz) -{ - int iIndex = Index(sz); - - wxCHECK_RET( iIndex != wxNOT_FOUND, - wxT("removing inexistent element in wxArrayString::Remove") ); - - RemoveAt(iIndex); -} - -void wxArrayString::assign(const_iterator first, const_iterator last) -{ - reserve(last - first); - for(; first != last; ++first) - push_back(*first); -} - -// ---------------------------------------------------------------------------- -// sorting -// ---------------------------------------------------------------------------- - -// we can only sort one array at a time with the quick-sort based -// implementation -#if wxUSE_THREADS - // need a critical section to protect access to gs_compareFunction and - // gs_sortAscending variables - static wxCriticalSection gs_critsectStringSort; -#endif // wxUSE_THREADS - -// function to use for string comparaison -static wxArrayString::CompareFunction gs_compareFunction = NULL; - -// if we don't use the compare function, this flag tells us if we sort the -// array in ascending or descending order -static bool gs_sortAscending = true; - -// function which is called by quick sort -extern "C" int wxC_CALLING_CONV // LINKAGEMODE -wxStringCompareFunction(const void *first, const void *second) -{ - wxString *strFirst = (wxString *)first; - wxString *strSecond = (wxString *)second; - - if ( gs_compareFunction ) { - return gs_compareFunction(*strFirst, *strSecond); - } - else { - // maybe we should use wxStrcoll - int result = strFirst->Cmp(*strSecond); - - return gs_sortAscending ? result : -result; - } -} - -// sort array elements using passed comparaison function -void wxArrayString::Sort(CompareFunction compareFunction) -{ - wxCRIT_SECT_LOCKER(lockCmpFunc, gs_critsectStringSort); - - wxASSERT( !gs_compareFunction ); // must have been reset to NULL - gs_compareFunction = compareFunction; - - DoSort(); - - // reset it to NULL so that Sort(bool) will work the next time - gs_compareFunction = NULL; -} - -extern "C" -{ - typedef int (wxC_CALLING_CONV * wxStringCompareFn)(const void *first, - const void *second); -} - -void wxArrayString::Sort(CompareFunction2 compareFunction) -{ - qsort(m_pItems, m_nCount, sizeof(wxChar *), (wxStringCompareFn)compareFunction); -} - -void wxArrayString::Sort(bool reverseOrder) -{ - Sort(reverseOrder ? wxStringSortDescending : wxStringSortAscending); -} - -void wxArrayString::DoSort() -{ - wxCHECK_RET( !m_autoSort, wxT("can't use this method with sorted arrays") ); - - // just sort the pointers using qsort() - of course it only works because - // wxString() *is* a pointer to its data - qsort(m_pItems, m_nCount, sizeof(wxChar *), wxStringCompareFunction); -} - -bool wxArrayString::operator==(const wxArrayString& a) const -{ - if ( m_nCount != a.m_nCount ) - return false; - - for ( size_t n = 0; n < m_nCount; n++ ) - { - if ( Item(n) != a[n] ) - return false; - } - - return true; -} - -#endif // !wxUSE_STL - -int wxCMPFUNC_CONV wxStringSortAscending(wxString* s1, wxString* s2) -{ - return s1->Cmp(*s2); -} - -int wxCMPFUNC_CONV wxStringSortDescending(wxString* s1, wxString* s2) -{ - return -s1->Cmp(*s2); -} - -wxString* wxCArrayString::Release() -{ - wxString *r = GetStrings(); - m_strings = NULL; - return r; -} diff --git a/wxWidgets/src/common/sysopt.cpp b/wxWidgets/src/common/sysopt.cpp deleted file mode 100644 index 7a61ad01b7..0000000000 --- a/wxWidgets/src/common/sysopt.cpp +++ /dev/null @@ -1,111 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/common/sysopt.cpp -// Purpose: wxSystemOptions -// Author: Julian Smart -// Modified by: -// Created: 2001-07-10 -// RCS-ID: $Id: sysopt.cpp 39851 2006-06-27 14:33:14Z VZ $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declarations -// ============================================================================ - -// --------------------------------------------------------------------------- -// headers -// --------------------------------------------------------------------------- - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#if defined(__BORLANDC__) - #pragma hdrstop -#endif - -#if wxUSE_SYSTEM_OPTIONS - -#include "wx/sysopt.h" - -#ifndef WX_PRECOMP - #include "wx/app.h" - #include "wx/list.h" - #include "wx/string.h" - #include "wx/arrstr.h" -#endif - -// ---------------------------------------------------------------------------- -// private globals -// ---------------------------------------------------------------------------- - -static wxArrayString gs_optionNames, - gs_optionValues; - -// ============================================================================ -// wxSystemOptions implementation -// ============================================================================ - -// Option functions (arbitrary name/value mapping) -void wxSystemOptions::SetOption(const wxString& name, const wxString& value) -{ - int idx = gs_optionNames.Index(name, false); - if (idx == wxNOT_FOUND) - { - gs_optionNames.Add(name); - gs_optionValues.Add(value); - } - else - { - gs_optionNames[idx] = name; - gs_optionValues[idx] = value; - } -} - -void wxSystemOptions::SetOption(const wxString& name, int value) -{ - SetOption(name, wxString::Format(wxT("%d"), value)); -} - -wxString wxSystemOptions::GetOption(const wxString& name) -{ - wxString val; - - int idx = gs_optionNames.Index(name, false); - if ( idx != wxNOT_FOUND ) - { - val = gs_optionValues[idx]; - } - else // not set explicitely - { - // look in the environment: first for a variable named "wx_appname_name" - // which can be set to affect the behaviour or just this application - // and then for "wx_name" which can be set to change the option globally - wxString var(name); - var.Replace(_T("."), _T("_")); // '.'s not allowed in env var names - - wxString appname; - if ( wxTheApp ) - appname = wxTheApp->GetAppName(); - - if ( !appname.empty() ) - val = wxGetenv(_T("wx_") + appname + _T('_') + var); - - if ( val.empty() ) - val = wxGetenv(_T("wx_") + var); - } - - return val; -} - -int wxSystemOptions::GetOptionInt(const wxString& name) -{ - return wxAtoi(GetOption(name)); -} - -bool wxSystemOptions::HasOption(const wxString& name) -{ - return !GetOption(name).empty(); -} - -#endif // wxUSE_SYSTEM_OPTIONS diff --git a/wxWidgets/src/common/tarstrm.cpp b/wxWidgets/src/common/tarstrm.cpp deleted file mode 100644 index 5315a996c0..0000000000 --- a/wxWidgets/src/common/tarstrm.cpp +++ /dev/null @@ -1,1534 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: tarstrm.cpp -// Purpose: Streams for Tar files -// Author: Mike Wetherell -// RCS-ID: $Id: tarstrm.cpp 63302 2010-01-28 21:46:09Z MW $ -// Copyright: (c) 2004 Mike Wetherell -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_TARSTREAM - -#include "wx/tarstrm.h" - -#ifndef WX_PRECOMP - #include "wx/intl.h" - #include "wx/log.h" - #include "wx/utils.h" -#endif - -#include "wx/buffer.h" -#include "wx/datetime.h" -#include "wx/ptr_scpd.h" -#include "wx/filename.h" -#include "wx/thread.h" - -#include - -#ifdef __UNIX__ -#include -#include -#endif - - -///////////////////////////////////////////////////////////////////////////// -// constants - -enum { - TAR_NAME, - TAR_MODE, - TAR_UID, - TAR_GID, - TAR_SIZE, - TAR_MTIME, - TAR_CHKSUM, - TAR_TYPEFLAG, - TAR_LINKNAME, - TAR_MAGIC, - TAR_VERSION, - TAR_UNAME, - TAR_GNAME, - TAR_DEVMAJOR, - TAR_DEVMINOR, - TAR_PREFIX, - TAR_UNUSED, - TAR_NUMFIELDS -}; - -enum { - TAR_BLOCKSIZE = 512 -}; - -// checksum type -enum { - SUM_UNKNOWN, - SUM_UNSIGNED, - SUM_SIGNED -}; - -// type of input tar -enum { - TYPE_OLDTAR, // fields after TAR_LINKNAME are invalid - TYPE_GNUTAR, // all fields except TAR_PREFIX are valid - TYPE_USTAR // all fields are valid -}; - -// signatures -static const char *USTAR_MAGIC = "ustar"; -static const char *USTAR_VERSION = "00"; -static const char *GNU_MAGIC = "ustar "; -static const char *GNU_VERION = " "; - -IMPLEMENT_DYNAMIC_CLASS(wxTarEntry, wxArchiveEntry) -IMPLEMENT_DYNAMIC_CLASS(wxTarClassFactory, wxArchiveClassFactory) - - -///////////////////////////////////////////////////////////////////////////// -// Class factory - -static wxTarClassFactory g_wxTarClassFactory; - -wxTarClassFactory::wxTarClassFactory() -{ - if (this == &g_wxTarClassFactory) - PushFront(); -} - -const wxChar * const * -wxTarClassFactory::GetProtocols(wxStreamProtocolType type) const -{ - static const wxChar *protocols[] = { _T("tar"), NULL }; - static const wxChar *mimetypes[] = { _T("application/x-tar"), NULL }; - static const wxChar *fileexts[] = { _T(".tar"), NULL }; - static const wxChar *empty[] = { NULL }; - - switch (type) { - case wxSTREAM_PROTOCOL: return protocols; - case wxSTREAM_MIMETYPE: return mimetypes; - case wxSTREAM_FILEEXT: return fileexts; - default: return empty; - } -} - - -///////////////////////////////////////////////////////////////////////////// -// tar header block - -typedef wxFileOffset wxTarNumber; - -struct wxTarField { const wxChar *name; int pos; }; - -class wxTarHeaderBlock -{ -public: - wxTarHeaderBlock() - { memset(data, 0, sizeof(data)); } - wxTarHeaderBlock(const wxTarHeaderBlock& hb) - { memcpy(data, hb.data, sizeof(data)); } - - bool Read(wxInputStream& in); - bool Write(wxOutputStream& out); - inline bool WriteField(wxOutputStream& out, int id); - - bool IsAllZeros() const; - wxUint32 Sum(bool SignedSum = false); - wxUint32 SumField(int id); - - char *Get(int id) { return data + fields[id].pos + id; } - static size_t Len(int id) { return fields[id + 1].pos - fields[id].pos; } - static const wxChar *Name(int id) { return fields[id].name; } - static size_t Offset(int id) { return fields[id].pos; } - - bool SetOctal(int id, wxTarNumber n); - wxTarNumber GetOctal(int id); - bool SetPath(const wxString& name, wxMBConv& conv); - -private: - char data[TAR_BLOCKSIZE + TAR_NUMFIELDS]; - static const wxTarField fields[]; - static void check(); -}; - -wxDEFINE_SCOPED_PTR_TYPE(wxTarHeaderBlock) - -// A table giving the field names and offsets in a tar header block -const wxTarField wxTarHeaderBlock::fields[] = -{ - { _T("name"), 0 }, // 100 - { _T("mode"), 100 }, // 8 - { _T("uid"), 108 }, // 8 - { _T("gid"), 116 }, // 8 - { _T("size"), 124 }, // 12 - { _T("mtime"), 136 }, // 12 - { _T("chksum"), 148 }, // 8 - { _T("typeflag"), 156 }, // 1 - { _T("linkname"), 157 }, // 100 - { _T("magic"), 257 }, // 6 - { _T("version"), 263 }, // 2 - { _T("uname"), 265 }, // 32 - { _T("gname"), 297 }, // 32 - { _T("devmajor"), 329 }, // 8 - { _T("devminor"), 337 }, // 8 - { _T("prefix"), 345 }, // 155 - { _T("unused"), 500 }, // 12 - { NULL, TAR_BLOCKSIZE } -}; - -void wxTarHeaderBlock::check() -{ -#if 0 - wxCOMPILE_TIME_ASSERT( - WXSIZEOF(fields) == TAR_NUMFIELDS + 1, - Wrong_number_of_elements_in_fields_table - ); -#endif -} - -bool wxTarHeaderBlock::IsAllZeros() const -{ - const char *p = data; - for (size_t i = 0; i < sizeof(data); i++) - if (p[i]) - return false; - return true; -} - -wxUint32 wxTarHeaderBlock::Sum(bool SignedSum /*=false*/) -{ - // the chksum field itself should be blanks during the calculation - memset(Get(TAR_CHKSUM), ' ', Len(TAR_CHKSUM)); - const char *p = data; - wxUint32 n = 0; - - if (SignedSum) - for (size_t i = 0; i < sizeof(data); i++) - n += (signed char)p[i]; - else - for (size_t i = 0; i < sizeof(data); i++) - n += (unsigned char)p[i]; - - return n; -} - -wxUint32 wxTarHeaderBlock::SumField(int id) -{ - unsigned char *p = (unsigned char*)Get(id); - unsigned char *q = p + Len(id); - wxUint32 n = 0; - - while (p < q) - n += *p++; - - return n; -} - -bool wxTarHeaderBlock::Read(wxInputStream& in) -{ - bool ok = true; - - for (int id = 0; id < TAR_NUMFIELDS && ok; id++) - ok = in.Read(Get(id), Len(id)).LastRead() == Len(id); - - return ok; -} - -bool wxTarHeaderBlock::Write(wxOutputStream& out) -{ - bool ok = true; - - for (int id = 0; id < TAR_NUMFIELDS && ok; id++) - ok = WriteField(out, id); - - return ok; -} - -inline bool wxTarHeaderBlock::WriteField(wxOutputStream& out, int id) -{ - return out.Write(Get(id), Len(id)).LastWrite() == Len(id); -} - -wxTarNumber wxTarHeaderBlock::GetOctal(int id) -{ - wxTarNumber n = 0; - const char *p = Get(id); - while (*p == ' ') - p++; - while (*p >= '0' && *p < '8') - n = (n << 3) | (*p++ - '0'); - return n; -} - -bool wxTarHeaderBlock::SetOctal(int id, wxTarNumber n) -{ - // set an octal field, return true if the number fits - char *field = Get(id); - char *p = field + Len(id); - *--p = 0; - while (p > field) { - *--p = char('0' + (n & 7)); - n >>= 3; - } - return n == 0; -} - -bool wxTarHeaderBlock::SetPath(const wxString& name, wxMBConv& conv) -{ - bool badconv = false; - -#if wxUSE_UNICODE - wxCharBuffer nameBuf = name.mb_str(conv); - - // if the conversion fails make an approximation - if (!nameBuf) { - badconv = true; - size_t len = name.length(); - wxCharBuffer approx(len); - for (size_t i = 0; i < len; i++) - approx.data()[i] = name[i] & ~0x7F ? '_' : name[i]; - nameBuf = approx; - } - - const char *mbName = nameBuf; -#else - const char *mbName = name.c_str(); - (void)conv; -#endif - - bool fits; - bool notGoingToFit = false; - size_t len = strlen(mbName); - size_t maxname = Len(TAR_NAME); - size_t maxprefix = Len(TAR_PREFIX); - size_t i = 0; - size_t nexti = 0; - - for (;;) { - fits = i < maxprefix && len - i <= maxname; - - if (!fits) { - const char *p = strchr(mbName + i, '/'); - if (p) - nexti = p - mbName + 1; - if (!p || nexti - 1 > maxprefix) - notGoingToFit = true; - } - - if (fits || notGoingToFit) { - strncpy(Get(TAR_NAME), mbName + i, maxname); - if (i > 0) - strncpy(Get(TAR_PREFIX), mbName, i - 1); - break; - } - - i = nexti; - } - - return fits && !badconv; -} - - -///////////////////////////////////////////////////////////////////////////// -// Some helpers - -static wxFileOffset RoundUpSize(wxFileOffset size, int factor = 1) -{ - wxFileOffset chunk = TAR_BLOCKSIZE * factor; - return ((size + chunk - 1) / chunk) * chunk; -} - -#ifdef __UNIX__ - -static wxString wxTarUserName(int uid) -{ - struct passwd *ppw; - -#ifdef HAVE_GETPWUID_R -#if defined HAVE_SYSCONF && defined _SC_GETPW_R_SIZE_MAX - long pwsize = sysconf(_SC_GETPW_R_SIZE_MAX); - size_t bufsize(wxMin(wxMax(1024l, pwsize), 32768l)); -#else - size_t bufsize = 1024; -#endif - wxCharBuffer buf(bufsize); - struct passwd pw; - - memset(&pw, 0, sizeof(pw)); - if (getpwuid_r(uid, &pw, buf.data(), bufsize, &ppw) == 0 && pw.pw_name) - return wxString(pw.pw_name, wxConvLibc); -#else - if ((ppw = getpwuid(uid)) != NULL) - return wxString(ppw->pw_name, wxConvLibc); -#endif - return _("unknown"); -} - -static wxString wxTarGroupName(int gid) -{ - struct group *pgr; -#ifdef HAVE_GETGRGID_R -#if defined HAVE_SYSCONF && defined _SC_GETGR_R_SIZE_MAX - long grsize = sysconf(_SC_GETGR_R_SIZE_MAX); - size_t bufsize(wxMin(wxMax(1024l, grsize), 32768l)); -#else - size_t bufsize = 1024; -#endif - wxCharBuffer buf(bufsize); - struct group gr; - - memset(&gr, 0, sizeof(gr)); - if (getgrgid_r(gid, &gr, buf.data(), bufsize, &pgr) == 0 && gr.gr_name) - return wxString(gr.gr_name, wxConvLibc); -#else - if ((pgr = getgrgid(gid)) != NULL) - return wxString(pgr->gr_name, wxConvLibc); -#endif - return _("unknown"); -} - -#endif // __UNIX__ - -// Cache the user and group names since getting them can be expensive, -// get both names and ids at the same time. -// -struct wxTarUser -{ - wxTarUser(); - ~wxTarUser() { delete [] uname; delete [] gname; } - - int uid; - int gid; - - wxChar *uname; - wxChar *gname; -}; - -wxTarUser::wxTarUser() -{ -#ifdef __UNIX__ - uid = getuid(); - gid = getgid(); - wxString usr = wxTarUserName(uid); - wxString grp = wxTarGroupName(gid); -#else - uid = 0; - gid = 0; - wxString usr = wxGetUserId(); - wxString grp = _("unknown"); -#endif - - uname = new wxChar[usr.length() + 1]; - wxStrcpy(uname, usr.c_str()); - - gname = new wxChar[grp.length() + 1]; - wxStrcpy(gname, grp.c_str()); -} - -static const wxTarUser& wxGetTarUser() -{ -#if wxUSE_THREADS - static wxCriticalSection cs; - wxCriticalSectionLocker lock(cs); -#endif - static wxTarUser tu; - return tu; -} - -// ignore the size field for entry types 3, 4, 5 and 6 -// -static inline wxFileOffset GetDataSize(const wxTarEntry& entry) -{ - switch (entry.GetTypeFlag()) { - case wxTAR_CHRTYPE: - case wxTAR_BLKTYPE: - case wxTAR_DIRTYPE: - case wxTAR_FIFOTYPE: - return 0; - default: - return entry.GetSize(); - } -} - - -///////////////////////////////////////////////////////////////////////////// -// Tar Entry -// Holds all the meta-data for a file in the tar - -wxTarEntry::wxTarEntry(const wxString& name /*=wxEmptyString*/, - const wxDateTime& dt /*=wxDateTime::Now()*/, - wxFileOffset size /*=0*/) - : m_Mode(0644), - m_IsModeSet(false), - m_UserId(wxGetTarUser().uid), - m_GroupId(wxGetTarUser().gid), - m_Size(size), - m_Offset(wxInvalidOffset), - m_ModifyTime(dt), - m_TypeFlag(wxTAR_REGTYPE), - m_UserName(wxGetTarUser().uname), - m_GroupName(wxGetTarUser().gname), - m_DevMajor(~0), - m_DevMinor(~0) -{ - if (!name.empty()) - SetName(name); -} - -wxTarEntry::~wxTarEntry() -{ -} - -wxTarEntry::wxTarEntry(const wxTarEntry& e) - : wxArchiveEntry(), - m_Name(e.m_Name), - m_Mode(e.m_Mode), - m_IsModeSet(e.m_IsModeSet), - m_UserId(e.m_UserId), - m_GroupId(e.m_GroupId), - m_Size(e.m_Size), - m_Offset(e.m_Offset), - m_ModifyTime(e.m_ModifyTime), - m_AccessTime(e.m_AccessTime), - m_CreateTime(e.m_CreateTime), - m_TypeFlag(e.m_TypeFlag), - m_LinkName(e.m_LinkName), - m_UserName(e.m_UserName), - m_GroupName(e.m_GroupName), - m_DevMajor(e.m_DevMajor), - m_DevMinor(e.m_DevMinor) -{ -} - -wxTarEntry& wxTarEntry::operator=(const wxTarEntry& e) -{ - if (&e != this) { - m_Name = e.m_Name; - m_Mode = e.m_Mode; - m_IsModeSet = e.m_IsModeSet; - m_UserId = e.m_UserId; - m_GroupId = e.m_GroupId; - m_Size = e.m_Size; - m_Offset = e.m_Offset; - m_ModifyTime = e.m_ModifyTime; - m_AccessTime = e.m_AccessTime; - m_CreateTime = e.m_CreateTime; - m_TypeFlag = e.m_TypeFlag; - m_LinkName = e.m_LinkName; - m_UserName = e.m_UserName; - m_GroupName = e.m_GroupName; - m_DevMajor = e.m_DevMajor; - m_DevMinor = e.m_DevMinor; - } - return *this; -} - -wxString wxTarEntry::GetName(wxPathFormat format /*=wxPATH_NATIVE*/) const -{ - bool isDir = IsDir() && !m_Name.empty(); - - // optimisations for common (and easy) cases - switch (wxFileName::GetFormat(format)) { - case wxPATH_DOS: - { - wxString name(isDir ? m_Name + _T("\\") : m_Name); - for (size_t i = 0; i < name.length(); i++) - if (name[i] == _T('/')) - name[i] = _T('\\'); - return name; - } - - case wxPATH_UNIX: - return isDir ? m_Name + _T("/") : m_Name; - - default: - ; - } - - wxFileName fn; - - if (isDir) - fn.AssignDir(m_Name, wxPATH_UNIX); - else - fn.Assign(m_Name, wxPATH_UNIX); - - return fn.GetFullPath(format); -} - -void wxTarEntry::SetName(const wxString& name, wxPathFormat format) -{ - bool isDir; - m_Name = GetInternalName(name, format, &isDir); - SetIsDir(isDir); -} - -// Static - Internally tars and zips use forward slashes for the path -// separator, absolute paths aren't allowed, and directory names have a -// trailing slash. This function converts a path into this internal format, -// but without a trailing slash for a directory. -// -wxString wxTarEntry::GetInternalName(const wxString& name, - wxPathFormat format /*=wxPATH_NATIVE*/, - bool *pIsDir /*=NULL*/) -{ - wxString internal; - - if (wxFileName::GetFormat(format) != wxPATH_UNIX) - internal = wxFileName(name, format).GetFullPath(wxPATH_UNIX); - else - internal = name; - - bool isDir = !internal.empty() && internal.Last() == '/'; - if (pIsDir) - *pIsDir = isDir; - if (isDir) - internal.erase(internal.length() - 1); - - while (!internal.empty() && *internal.begin() == '/') - internal.erase(0, 1); - while (!internal.empty() && internal.compare(0, 2, _T("./")) == 0) - internal.erase(0, 2); - if (internal == _T(".") || internal == _T("..")) - internal = wxEmptyString; - - return internal; -} - -bool wxTarEntry::IsDir() const -{ - return m_TypeFlag == wxTAR_DIRTYPE; -} - -void wxTarEntry::SetIsDir(bool isDir) -{ - if (isDir) - m_TypeFlag = wxTAR_DIRTYPE; - else if (m_TypeFlag == wxTAR_DIRTYPE) - m_TypeFlag = wxTAR_REGTYPE; -} - -void wxTarEntry::SetIsReadOnly(bool isReadOnly) -{ - if (isReadOnly) - m_Mode &= ~0222; - else - m_Mode |= 0200; -} - -int wxTarEntry::GetMode() const -{ - if (m_IsModeSet || !IsDir()) - return m_Mode; - else - return m_Mode | 0111; - -} - -void wxTarEntry::SetMode(int mode) -{ - m_Mode = mode & 07777; - m_IsModeSet = true; -} - - -///////////////////////////////////////////////////////////////////////////// -// Input stream - -wxDECLARE_SCOPED_PTR(wxTarEntry, wxTarEntryPtr_) -wxDEFINE_SCOPED_PTR (wxTarEntry, wxTarEntryPtr_) - -wxTarInputStream::wxTarInputStream(wxInputStream& stream, - wxMBConv& conv /*=wxConvLocal*/) - : wxArchiveInputStream(stream, conv) -{ - Init(); -} - -wxTarInputStream::wxTarInputStream(wxInputStream *stream, - wxMBConv& conv /*=wxConvLocal*/) - : wxArchiveInputStream(stream, conv) -{ - Init(); -} - -void wxTarInputStream::Init() -{ - m_pos = wxInvalidOffset; - m_offset = 0; - m_size = wxInvalidOffset; - m_sumType = SUM_UNKNOWN; - m_tarType = TYPE_USTAR; - m_hdr = new wxTarHeaderBlock; - m_HeaderRecs = NULL; - m_GlobalHeaderRecs = NULL; - m_lasterror = m_parent_i_stream->GetLastError(); -} - -wxTarInputStream::~wxTarInputStream() -{ - delete m_hdr; - delete m_HeaderRecs; - delete m_GlobalHeaderRecs; -} - -wxTarEntry *wxTarInputStream::GetNextEntry() -{ - m_lasterror = ReadHeaders(); - - if (!IsOk()) - return NULL; - - wxTarEntryPtr_ entry(new wxTarEntry); - - entry->SetMode(GetHeaderNumber(TAR_MODE)); - entry->SetUserId(GetHeaderNumber(TAR_UID)); - entry->SetGroupId(GetHeaderNumber(TAR_UID)); - entry->SetSize(GetHeaderNumber(TAR_SIZE)); - - entry->SetOffset(m_offset); - - entry->SetDateTime(GetHeaderDate(_T("mtime"))); - entry->SetAccessTime(GetHeaderDate(_T("atime"))); - entry->SetCreateTime(GetHeaderDate(_T("ctime"))); - - entry->SetTypeFlag(*m_hdr->Get(TAR_TYPEFLAG)); - bool isDir = entry->IsDir(); - - entry->SetLinkName(GetHeaderString(TAR_LINKNAME)); - - if (m_tarType != TYPE_OLDTAR) { - entry->SetUserName(GetHeaderString(TAR_UNAME)); - entry->SetGroupName(GetHeaderString(TAR_GNAME)); - - entry->SetDevMajor(GetHeaderNumber(TAR_DEVMAJOR)); - entry->SetDevMinor(GetHeaderNumber(TAR_DEVMINOR)); - } - - entry->SetName(GetHeaderPath(), wxPATH_UNIX); - if (isDir) - entry->SetIsDir(); - - if (m_HeaderRecs) - m_HeaderRecs->clear(); - - m_size = GetDataSize(*entry); - m_pos = 0; - - return entry.release(); -} - -bool wxTarInputStream::OpenEntry(wxTarEntry& entry) -{ - wxFileOffset offset = entry.GetOffset(); - - if (GetLastError() != wxSTREAM_READ_ERROR - && m_parent_i_stream->IsSeekable() - && m_parent_i_stream->SeekI(offset) == offset) - { - m_offset = offset; - m_size = GetDataSize(entry); - m_pos = 0; - m_lasterror = wxSTREAM_NO_ERROR; - return true; - } else { - m_lasterror = wxSTREAM_READ_ERROR; - return false; - } -} - -bool wxTarInputStream::OpenEntry(wxArchiveEntry& entry) -{ - wxTarEntry *tarEntry = wxStaticCast(&entry, wxTarEntry); - return tarEntry ? OpenEntry(*tarEntry) : false; -} - -bool wxTarInputStream::CloseEntry() -{ - if (m_lasterror == wxSTREAM_READ_ERROR) - return false; - if (!IsOpened()) - return true; - - wxFileOffset size = RoundUpSize(m_size); - wxFileOffset remainder = size - m_pos; - - if (remainder && m_parent_i_stream->IsSeekable()) { - wxLogNull nolog; - if (m_parent_i_stream->SeekI(remainder, wxFromCurrent) - != wxInvalidOffset) - remainder = 0; - } - - if (remainder) { - const int BUFSIZE = 8192; - wxCharBuffer buf(BUFSIZE); - - while (remainder > 0 && m_parent_i_stream->IsOk()) - remainder -= m_parent_i_stream->Read( - buf.data(), wxMin(BUFSIZE, remainder)).LastRead(); - } - - m_pos = wxInvalidOffset; - m_offset += size; - m_lasterror = m_parent_i_stream->GetLastError(); - - return IsOk(); -} - -wxStreamError wxTarInputStream::ReadHeaders() -{ - if (!CloseEntry()) - return wxSTREAM_READ_ERROR; - - bool done = false; - - while (!done) { - m_hdr->Read(*m_parent_i_stream); - if (m_parent_i_stream->Eof()) - wxLogError(_("incomplete header block in tar")); - if (!*m_parent_i_stream) - return wxSTREAM_READ_ERROR; - m_offset += TAR_BLOCKSIZE; - - // an all-zero header marks the end of the tar - if (m_hdr->IsAllZeros()) - return wxSTREAM_EOF; - - // the checksum is supposed to be the unsigned sum of the header bytes, - // but there have been versions of tar that used the signed sum, so - // accept that too, but only if used throughout. - wxUint32 chksum = m_hdr->GetOctal(TAR_CHKSUM); - bool ok = false; - - if (m_sumType != SUM_SIGNED) { - ok = chksum == m_hdr->Sum(); - if (m_sumType == SUM_UNKNOWN) - m_sumType = ok ? SUM_UNSIGNED : SUM_SIGNED; - } - if (m_sumType == SUM_SIGNED) - ok = chksum == m_hdr->Sum(true); - if (!ok) { - wxLogError(_("checksum failure reading tar header block")); - return wxSTREAM_READ_ERROR; - } - - if (strcmp(m_hdr->Get(TAR_MAGIC), USTAR_MAGIC) == 0) - m_tarType = TYPE_USTAR; - else if (strcmp(m_hdr->Get(TAR_MAGIC), GNU_MAGIC) == 0 && - strcmp(m_hdr->Get(TAR_VERSION), GNU_VERION) == 0) - m_tarType = TYPE_GNUTAR; - else - m_tarType = TYPE_OLDTAR; - - if (m_tarType != TYPE_USTAR) - break; - - switch (*m_hdr->Get(TAR_TYPEFLAG)) { - case 'g': ReadExtendedHeader(m_GlobalHeaderRecs); break; - case 'x': ReadExtendedHeader(m_HeaderRecs); break; - default: done = true; - } - } - - return wxSTREAM_NO_ERROR; -} - -wxString wxTarInputStream::GetExtendedHeader(const wxString& key) const -{ - wxTarHeaderRecords::iterator it; - - // look at normal extended header records first - if (m_HeaderRecs) { - it = m_HeaderRecs->find(key); - if (it != m_HeaderRecs->end()) - return wxString(it->second.wc_str(wxConvUTF8), GetConv()); - } - - // if not found, look at the global header records - if (m_GlobalHeaderRecs) { - it = m_GlobalHeaderRecs->find(key); - if (it != m_GlobalHeaderRecs->end()) - return wxString(it->second.wc_str(wxConvUTF8), GetConv()); - } - - return wxEmptyString; -} - -wxString wxTarInputStream::GetHeaderPath() const -{ - wxString path; - - if ((path = GetExtendedHeader(_T("path"))) != wxEmptyString) - return path; - - path = wxString(m_hdr->Get(TAR_NAME), GetConv()); - if (m_tarType != TYPE_USTAR) - return path; - - const char *prefix = m_hdr->Get(TAR_PREFIX); - return *prefix ? wxString(prefix, GetConv()) + _T("/") + path : path; -} - -wxDateTime wxTarInputStream::GetHeaderDate(const wxString& key) const -{ - wxString value; - - // try extended header, stored as decimal seconds since the epoch - if ((value = GetExtendedHeader(key)) != wxEmptyString) { - wxLongLong ll; - ll.Assign(wxAtof(value) * 1000.0); - return ll; - } - - if (key == _T("mtime")) - return wxLongLong(m_hdr->GetOctal(TAR_MTIME)) * 1000L; - - return wxDateTime(); -} - -wxTarNumber wxTarInputStream::GetHeaderNumber(int id) const -{ - wxString value; - - if ((value = GetExtendedHeader(m_hdr->Name(id))) != wxEmptyString) { - wxTarNumber n = 0; - const wxChar *p = value; - while (*p == ' ') - p++; - while (isdigit(*p)) - n = n * 10 + (*p++ - '0'); - return n; - } else { - return m_hdr->GetOctal(id); - } -} - -wxString wxTarInputStream::GetHeaderString(int id) const -{ - wxString value; - - if ((value = GetExtendedHeader(m_hdr->Name(id))) != wxEmptyString) - return value; - - return wxString(m_hdr->Get(id), GetConv()); -} - -// An extended header consists of one or more records, each constructed: -// "%d %s=%s\n", , , -// is the byte length, and are UTF-8 - -bool wxTarInputStream::ReadExtendedHeader(wxTarHeaderRecords*& recs) -{ - if (!recs) - recs = new wxTarHeaderRecords; - - // round length up to a whole number of blocks - size_t len = m_hdr->GetOctal(TAR_SIZE); - size_t size = RoundUpSize(len); - - // read in the whole header since it should be small - wxCharBuffer buf(size); - size_t lastread = m_parent_i_stream->Read(buf.data(), size).LastRead(); - if (lastread < len) - len = lastread; - buf.data()[len] = 0; - m_offset += lastread; - - size_t recPos, recSize; - bool ok = true; - - for (recPos = 0; recPos < len; recPos += recSize) { - char *pRec = buf.data() + recPos; - char *p = pRec; - - // read the record size (byte count in ascii decimal) - recSize = 0; - while (isdigit((unsigned char) *p)) - recSize = recSize * 10 + *p++ - '0'; - - // validity checks - if (recPos + recSize > len) - break; - if (recSize < p - pRec + (size_t)3 || *p != ' ' - || pRec[recSize - 1] != '\012') { - ok = false; - continue; - } - - // replace the final '\n' with a nul, to terminate value - pRec[recSize - 1] = 0; - // the key is here, following the space - char *pKey = ++p; - - // look forward for the '=', the value follows - while (*p && *p != '=') - p++; - if (!*p) { - ok = false; - continue; - } - // replace the '=' with a nul, to terminate the key - *p++ = 0; - - wxString key(wxConvUTF8.cMB2WC(pKey), GetConv()); - wxString value(wxConvUTF8.cMB2WC(p), GetConv()); - - // an empty value unsets a previously given value - if (value.empty()) - recs->erase(key); - else - (*recs)[key] = value; - } - - if (!ok || recPos < len || size != lastread) { - wxLogWarning(_("invalid data in extended tar header")); - return false; - } - - return true; -} - -wxFileOffset wxTarInputStream::OnSysSeek(wxFileOffset pos, wxSeekMode mode) -{ - if (!IsOpened()) { - wxLogError(_("tar entry not open")); - m_lasterror = wxSTREAM_READ_ERROR; - } - if (!IsOk()) - return wxInvalidOffset; - - switch (mode) { - case wxFromStart: break; - case wxFromCurrent: pos += m_pos; break; - case wxFromEnd: pos += m_size; break; - } - - if (pos < 0 || m_parent_i_stream->SeekI(m_offset + pos) == wxInvalidOffset) - return wxInvalidOffset; - - m_pos = pos; - return m_pos; -} - -size_t wxTarInputStream::OnSysRead(void *buffer, size_t size) -{ - if (!IsOpened()) { - wxLogError(_("tar entry not open")); - m_lasterror = wxSTREAM_READ_ERROR; - } - if (!IsOk() || !size) - return 0; - - if (m_pos >= m_size) - size = 0; - else if (m_pos + size > m_size + (size_t)0) - size = m_size - m_pos; - - size_t lastread = m_parent_i_stream->Read(buffer, size).LastRead(); - m_pos += lastread; - - if (m_pos >= m_size) { - m_lasterror = wxSTREAM_EOF; - } else if (!m_parent_i_stream->IsOk()) { - // any other error will have been reported by the underlying stream - if (m_parent_i_stream->Eof()) - wxLogError(_("unexpected end of file")); - m_lasterror = wxSTREAM_READ_ERROR; - } - - return lastread; -} - - -///////////////////////////////////////////////////////////////////////////// -// Output stream - -wxTarOutputStream::wxTarOutputStream(wxOutputStream& stream, - wxTarFormat format /*=wxTAR_PAX*/, - wxMBConv& conv /*=wxConvLocal*/) - : wxArchiveOutputStream(stream, conv) -{ - Init(format); -} - -wxTarOutputStream::wxTarOutputStream(wxOutputStream *stream, - wxTarFormat format /*=wxTAR_PAX*/, - wxMBConv& conv /*=wxConvLocal*/) - : wxArchiveOutputStream(stream, conv) -{ - Init(format); -} - -void wxTarOutputStream::Init(wxTarFormat format) -{ - m_pos = wxInvalidOffset; - m_maxpos = wxInvalidOffset; - m_size = wxInvalidOffset; - m_headpos = wxInvalidOffset; - m_datapos = wxInvalidOffset; - m_tarstart = wxInvalidOffset; - m_tarsize = 0; - m_pax = format == wxTAR_PAX; - m_BlockingFactor = m_pax ? 10 : 20; - m_chksum = 0; - m_large = false; - m_hdr = new wxTarHeaderBlock; - m_hdr2 = NULL; - m_extendedHdr = NULL; - m_extendedSize = 0; - m_lasterror = m_parent_o_stream->GetLastError(); -} - -wxTarOutputStream::~wxTarOutputStream() -{ - if (m_tarsize) - Close(); - delete m_hdr; - delete m_hdr2; - delete [] m_extendedHdr; -} - -bool wxTarOutputStream::PutNextEntry(wxTarEntry *entry) -{ - wxTarEntryPtr_ e(entry); - - if (!CloseEntry()) - return false; - - if (!m_tarsize) { - wxLogNull nolog; - m_tarstart = m_parent_o_stream->TellO(); - } - - if (m_tarstart != wxInvalidOffset) - m_headpos = m_tarstart + m_tarsize; - - if (WriteHeaders(*e)) { - m_pos = 0; - m_maxpos = 0; - m_size = GetDataSize(*e); - if (m_tarstart != wxInvalidOffset) - m_datapos = m_tarstart + m_tarsize; - - // types that are not allowd any data - const char nodata[] = { - wxTAR_LNKTYPE, wxTAR_SYMTYPE, wxTAR_CHRTYPE, wxTAR_BLKTYPE, - wxTAR_DIRTYPE, wxTAR_FIFOTYPE, 0 - }; - int typeflag = e->GetTypeFlag(); - - // pax does now allow data for wxTAR_LNKTYPE - if (!m_pax || typeflag != wxTAR_LNKTYPE) - if (strchr(nodata, typeflag) != NULL) - CloseEntry(); - } - - return IsOk(); -} - -bool wxTarOutputStream::PutNextEntry(const wxString& name, - const wxDateTime& dt, - wxFileOffset size) -{ - return PutNextEntry(new wxTarEntry(name, dt, size)); -} - -bool wxTarOutputStream::PutNextDirEntry(const wxString& name, - const wxDateTime& dt) -{ - wxTarEntry *entry = new wxTarEntry(name, dt); - entry->SetIsDir(); - return PutNextEntry(entry); -} - -bool wxTarOutputStream::PutNextEntry(wxArchiveEntry *entry) -{ - wxTarEntry *tarEntry = wxStaticCast(entry, wxTarEntry); - if (!tarEntry) - delete entry; - return PutNextEntry(tarEntry); -} - -bool wxTarOutputStream::CopyEntry(wxTarEntry *entry, - wxTarInputStream& inputStream) -{ - if (PutNextEntry(entry)) - Write(inputStream); - return IsOk() && inputStream.Eof(); -} - -bool wxTarOutputStream::CopyEntry(wxArchiveEntry *entry, - wxArchiveInputStream& inputStream) -{ - if (PutNextEntry(entry)) - Write(inputStream); - return IsOk() && inputStream.Eof(); -} - -bool wxTarOutputStream::CloseEntry() -{ - if (!IsOpened()) - return true; - - if (m_pos < m_maxpos) { - wxASSERT(m_parent_o_stream->IsSeekable()); - m_parent_o_stream->SeekO(m_datapos + m_maxpos); - m_lasterror = m_parent_o_stream->GetLastError(); - m_pos = m_maxpos; - } - - if (IsOk()) { - wxFileOffset size = RoundUpSize(m_pos); - if (size > m_pos) { - memset(m_hdr, 0, size - m_pos); - m_parent_o_stream->Write(m_hdr, size - m_pos); - m_lasterror = m_parent_o_stream->GetLastError(); - } - m_tarsize += size; - } - - if (IsOk() && m_pos != m_size) - ModifyHeader(); - - m_pos = wxInvalidOffset; - m_maxpos = wxInvalidOffset; - m_size = wxInvalidOffset; - m_headpos = wxInvalidOffset; - m_datapos = wxInvalidOffset; - - return IsOk(); -} - -bool wxTarOutputStream::Close() -{ - if (!CloseEntry()) - return false; - - memset(m_hdr, 0, sizeof(*m_hdr)); - int count = (RoundUpSize(m_tarsize + 2 * TAR_BLOCKSIZE, m_BlockingFactor) - - m_tarsize) / TAR_BLOCKSIZE; - while (count--) - m_parent_o_stream->Write(m_hdr, TAR_BLOCKSIZE); - - m_tarsize = 0; - m_tarstart = wxInvalidOffset; - m_lasterror = m_parent_o_stream->GetLastError(); - return IsOk(); -} - -bool wxTarOutputStream::WriteHeaders(wxTarEntry& entry) -{ - memset(m_hdr, 0, sizeof(*m_hdr)); - - SetHeaderPath(entry.GetName(wxPATH_UNIX)); - - SetHeaderNumber(TAR_MODE, entry.GetMode()); - SetHeaderNumber(TAR_UID, entry.GetUserId()); - SetHeaderNumber(TAR_GID, entry.GetGroupId()); - - if (entry.GetSize() == wxInvalidOffset) - entry.SetSize(0); - m_large = !SetHeaderNumber(TAR_SIZE, entry.GetSize()); - - SetHeaderDate(_T("mtime"), entry.GetDateTime()); - if (entry.GetAccessTime().IsValid()) - SetHeaderDate(_T("atime"), entry.GetAccessTime()); - if (entry.GetCreateTime().IsValid()) - SetHeaderDate(_T("ctime"), entry.GetCreateTime()); - - *m_hdr->Get(TAR_TYPEFLAG) = char(entry.GetTypeFlag()); - - strcpy(m_hdr->Get(TAR_MAGIC), USTAR_MAGIC); - strcpy(m_hdr->Get(TAR_VERSION), USTAR_VERSION); - - SetHeaderString(TAR_LINKNAME, entry.GetLinkName()); - SetHeaderString(TAR_UNAME, entry.GetUserName()); - SetHeaderString(TAR_GNAME, entry.GetGroupName()); - - if (~entry.GetDevMajor()) - SetHeaderNumber(TAR_DEVMAJOR, entry.GetDevMajor()); - if (~entry.GetDevMinor()) - SetHeaderNumber(TAR_DEVMINOR, entry.GetDevMinor()); - - m_chksum = m_hdr->Sum(); - m_hdr->SetOctal(TAR_CHKSUM, m_chksum); - if (!m_large) - m_chksum -= m_hdr->SumField(TAR_SIZE); - - // The main header is now fully prepared so we know what extended headers - // (if any) will be needed. Output any extended headers before writing - // the main header. - if (m_extendedHdr && *m_extendedHdr) { - wxASSERT(m_pax); - // the extended headers are written to the tar as a file entry, - // so prepare a regular header block for the pseudo-file. - if (!m_hdr2) - m_hdr2 = new wxTarHeaderBlock; - memset(m_hdr2, 0, sizeof(*m_hdr2)); - - // an old tar that doesn't understand extended headers will - // extract it as a file, so give these fields reasonable values - // so that the user will have access to read and remove it. - m_hdr2->SetPath(PaxHeaderPath(_T("%d/PaxHeaders.%p/%f"), - entry.GetName(wxPATH_UNIX)), GetConv()); - m_hdr2->SetOctal(TAR_MODE, 0600); - strcpy(m_hdr2->Get(TAR_UID), m_hdr->Get(TAR_UID)); - strcpy(m_hdr2->Get(TAR_GID), m_hdr->Get(TAR_GID)); - size_t length = strlen(m_extendedHdr); - m_hdr2->SetOctal(TAR_SIZE, length); - strcpy(m_hdr2->Get(TAR_MTIME), m_hdr->Get(TAR_MTIME)); - *m_hdr2->Get(TAR_TYPEFLAG) = 'x'; - strcpy(m_hdr2->Get(TAR_MAGIC), USTAR_MAGIC); - strcpy(m_hdr2->Get(TAR_VERSION), USTAR_VERSION); - strcpy(m_hdr2->Get(TAR_UNAME), m_hdr->Get(TAR_UNAME)); - strcpy(m_hdr2->Get(TAR_GNAME), m_hdr->Get(TAR_GNAME)); - - m_hdr2->SetOctal(TAR_CHKSUM, m_hdr2->Sum()); - - m_hdr2->Write(*m_parent_o_stream); - m_tarsize += TAR_BLOCKSIZE; - - size_t rounded = RoundUpSize(length); - memset(m_extendedHdr + length, 0, rounded - length); - m_parent_o_stream->Write(m_extendedHdr, rounded); - m_tarsize += rounded; - - *m_extendedHdr = 0; - - // update m_headpos which is used to seek back to fix up the file - // length if it is not known in advance - if (m_tarstart != wxInvalidOffset) - m_headpos = m_tarstart + m_tarsize; - } - - // if don't have extended headers just report error - if (!m_badfit.empty()) { - wxASSERT(!m_pax); - wxLogWarning(_("%s did not fit the tar header for entry '%s'"), - m_badfit.c_str(), entry.GetName().c_str()); - m_badfit.clear(); - } - - m_hdr->Write(*m_parent_o_stream); - m_tarsize += TAR_BLOCKSIZE; - m_lasterror = m_parent_o_stream->GetLastError(); - - return IsOk(); -} - -wxString wxTarOutputStream::PaxHeaderPath(const wxString& format, - const wxString& path) -{ - wxString d = path.BeforeLast(_T('/')); - wxString f = path.AfterLast(_T('/')); - wxString ret; - - if (d.empty()) - d = _T("."); - - ret.reserve(format.length() + path.length() + 16); - - size_t begin = 0; - size_t end; - - for (;;) { - end = format.find('%', begin); - if (end == wxString::npos || end + 1 >= format.length()) - break; - ret << format.substr(begin, end - begin); - switch (format[end + 1]) { - case 'd': ret << d; break; - case 'f': ret << f; break; - case 'p': ret << wxGetProcessId(); break; - case '%': ret << _T("%"); break; - } - begin = end + 2; - } - - ret << format.substr(begin); - - return ret; -} - -bool wxTarOutputStream::ModifyHeader() -{ - wxFileOffset originalPos = wxInvalidOffset; - wxFileOffset sizePos = wxInvalidOffset; - - if (!m_large && m_headpos != wxInvalidOffset - && m_parent_o_stream->IsSeekable()) - { - wxLogNull nolog; - originalPos = m_parent_o_stream->TellO(); - if (originalPos != wxInvalidOffset) - sizePos = - m_parent_o_stream->SeekO(m_headpos + m_hdr->Offset(TAR_SIZE)); - } - - if (sizePos == wxInvalidOffset || !m_hdr->SetOctal(TAR_SIZE, m_pos)) { - wxLogError(_("incorrect size given for tar entry")); - m_lasterror = wxSTREAM_WRITE_ERROR; - return false; - } - - m_chksum += m_hdr->SumField(TAR_SIZE); - m_hdr->SetOctal(TAR_CHKSUM, m_chksum); - wxFileOffset sumPos = m_headpos + m_hdr->Offset(TAR_CHKSUM); - - return - m_hdr->WriteField(*m_parent_o_stream, TAR_SIZE) && - m_parent_o_stream->SeekO(sumPos) == sumPos && - m_hdr->WriteField(*m_parent_o_stream, TAR_CHKSUM) && - m_parent_o_stream->SeekO(originalPos) == originalPos; -} - -void wxTarOutputStream::SetHeaderPath(const wxString& name) -{ - if (!m_hdr->SetPath(name, GetConv()) || (m_pax && !name.IsAscii())) - SetExtendedHeader(_T("path"), name); -} - -bool wxTarOutputStream::SetHeaderNumber(int id, wxTarNumber n) -{ - if (m_hdr->SetOctal(id, n)) { - return true; - } else { - SetExtendedHeader(m_hdr->Name(id), wxLongLong(n).ToString()); - return false; - } -} - -void wxTarOutputStream::SetHeaderString(int id, const wxString& str) -{ - strncpy(m_hdr->Get(id), str.mb_str(GetConv()), m_hdr->Len(id)); - if (str.length() > m_hdr->Len(id)) - SetExtendedHeader(m_hdr->Name(id), str); -} - -void wxTarOutputStream::SetHeaderDate(const wxString& key, - const wxDateTime& datetime) -{ - wxLongLong ll = datetime.IsValid() ? datetime.GetValue() : wxLongLong(0); - wxLongLong secs = ll / 1000L; - - if (key != _T("mtime") - || !m_hdr->SetOctal(TAR_MTIME, wxTarNumber(secs.GetValue())) - || secs <= 0 || secs >= 0x7fffffff) - { - wxString str; - if (ll >= LONG_MIN && ll <= LONG_MAX) { - str.Printf(_T("%g"), ll.ToLong() / 1000.0); - } else { - str = ll.ToString(); - str.insert(str.end() - 3, '.'); - } - SetExtendedHeader(key, str); - } -} - -void wxTarOutputStream::SetExtendedHeader(const wxString& key, - const wxString& value) -{ - if (m_pax) { - const wxWX2WCbuf wide_key = key.wc_str(GetConv()); - const wxCharBuffer utf_key = wxConvUTF8.cWC2MB(wide_key); - - const wxWX2WCbuf wide_value = value.wc_str(GetConv()); - const wxCharBuffer utf_value = wxConvUTF8.cWC2MB(wide_value); - - // a small buffer to format the length field in - char buf[32]; - // length of "99=\n" - unsigned long length = strlen(utf_value) + strlen(utf_key) + 5; - sprintf(buf, "%lu", length); - // the length includes itself - size_t lenlen = strlen(buf); - if (lenlen != 2) { - length += lenlen - 2; - sprintf(buf, "%lu", length); - if (strlen(buf) > lenlen) - sprintf(buf, "%lu", ++length); - } - - // reallocate m_extendedHdr if it's not big enough - if (m_extendedSize < length) { - size_t rounded = RoundUpSize(length); - m_extendedSize <<= 1; - if (rounded > m_extendedSize) - m_extendedSize = rounded; - char *oldHdr = m_extendedHdr; - m_extendedHdr = new char[m_extendedSize]; - if (oldHdr) { - strcpy(m_extendedHdr, oldHdr); - delete oldHdr; - } else { - *m_extendedHdr = 0; - } - } - - // append the new record - char *append = strchr(m_extendedHdr, 0); - sprintf(append, "%s %s=%s\012", buf, - (const char*)utf_key, (const char*)utf_value); - } - else { - // if not pax then make a list of fields to report as errors - if (!m_badfit.empty()) - m_badfit += _T(", "); - m_badfit += key; - } -} - -void wxTarOutputStream::Sync() -{ - m_parent_o_stream->Sync(); -} - -wxFileOffset wxTarOutputStream::OnSysSeek(wxFileOffset pos, wxSeekMode mode) -{ - if (!IsOpened()) { - wxLogError(_("tar entry not open")); - m_lasterror = wxSTREAM_WRITE_ERROR; - } - if (!IsOk() || m_datapos == wxInvalidOffset) - return wxInvalidOffset; - - switch (mode) { - case wxFromStart: break; - case wxFromCurrent: pos += m_pos; break; - case wxFromEnd: pos += m_maxpos; break; - } - - if (pos < 0 || m_parent_o_stream->SeekO(m_datapos + pos) == wxInvalidOffset) - return wxInvalidOffset; - - m_pos = pos; - return m_pos; -} - -size_t wxTarOutputStream::OnSysWrite(const void *buffer, size_t size) -{ - if (!IsOpened()) { - wxLogError(_("tar entry not open")); - m_lasterror = wxSTREAM_WRITE_ERROR; - } - if (!IsOk() || !size) - return 0; - - size_t lastwrite = m_parent_o_stream->Write(buffer, size).LastWrite(); - m_pos += lastwrite; - if (m_pos > m_maxpos) - m_maxpos = m_pos; - - if (lastwrite != size) - m_lasterror = wxSTREAM_WRITE_ERROR; - - return lastwrite; -} - -#endif // wxUSE_TARSTREAM diff --git a/wxWidgets/src/common/taskbarcmn.cpp b/wxWidgets/src/common/taskbarcmn.cpp deleted file mode 100644 index def6bbdf6b..0000000000 --- a/wxWidgets/src/common/taskbarcmn.cpp +++ /dev/null @@ -1,54 +0,0 @@ -///////////////////////////////////////////////////////////////////////// -// File: src/common/taskbarcmn.cpp -// Purpose: Common parts of wxTaskBarIcon class -// Author: Julian Smart -// Modified by: -// Created: 04/04/2003 -// RCS-ID: $Id: taskbarcmn.cpp 44138 2007-01-07 19:44:14Z VZ $ -// Copyright: (c) Julian Smart, 2003 -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////// - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#ifdef wxHAS_TASK_BAR_ICON - -#ifndef WX_PRECOMP - #include "wx/app.h" - #include "wx/menu.h" -#endif - -// DLL options compatibility check: -WX_CHECK_BUILD_OPTIONS("wxAdvanced") - -#include "wx/taskbar.h" - -DEFINE_EVENT_TYPE( wxEVT_TASKBAR_MOVE ) -DEFINE_EVENT_TYPE( wxEVT_TASKBAR_LEFT_DOWN ) -DEFINE_EVENT_TYPE( wxEVT_TASKBAR_LEFT_UP ) -DEFINE_EVENT_TYPE( wxEVT_TASKBAR_RIGHT_DOWN ) -DEFINE_EVENT_TYPE( wxEVT_TASKBAR_RIGHT_UP ) -DEFINE_EVENT_TYPE( wxEVT_TASKBAR_LEFT_DCLICK ) -DEFINE_EVENT_TYPE( wxEVT_TASKBAR_RIGHT_DCLICK ) - - -BEGIN_EVENT_TABLE(wxTaskBarIconBase, wxEvtHandler) - EVT_TASKBAR_CLICK(wxTaskBarIconBase::OnRightButtonDown) -END_EVENT_TABLE() - -void wxTaskBarIconBase::OnRightButtonDown(wxTaskBarIconEvent& WXUNUSED(event)) -{ - wxMenu *menu = CreatePopupMenu(); - if (menu) - { - PopupMenu(menu); - delete menu; - } -} - -#endif // defined(wxHAS_TASK_BAR_ICON) diff --git a/wxWidgets/src/common/tbarbase.cpp b/wxWidgets/src/common/tbarbase.cpp deleted file mode 100644 index 084d17c064..0000000000 --- a/wxWidgets/src/common/tbarbase.cpp +++ /dev/null @@ -1,746 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/common/tbarbase.cpp -// Purpose: wxToolBarBase implementation -// Author: Julian Smart -// Modified by: VZ at 11.12.99 (wxScrollableToolBar split off) -// Created: 04/01/98 -// RCS-ID: $Id: tbarbase.cpp 42840 2006-10-31 13:09:08Z VZ $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_TOOLBAR - -#include "wx/toolbar.h" - -#ifndef WX_PRECOMP - #include "wx/control.h" - #include "wx/frame.h" - #include "wx/settings.h" - #include "wx/image.h" -#endif - -// ---------------------------------------------------------------------------- -// wxWidgets macros -// ---------------------------------------------------------------------------- - -BEGIN_EVENT_TABLE(wxToolBarBase, wxControl) -END_EVENT_TABLE() - -#include "wx/listimpl.cpp" - -WX_DEFINE_LIST(wxToolBarToolsList) - -// ============================================================================ -// implementation -// ============================================================================ - -// ---------------------------------------------------------------------------- -// wxToolBarToolBase -// ---------------------------------------------------------------------------- - -IMPLEMENT_DYNAMIC_CLASS(wxToolBarToolBase, wxObject) - -bool wxToolBarToolBase::Enable(bool enable) -{ - if ( m_enabled == enable ) - return false; - - m_enabled = enable; - - return true; -} - -bool wxToolBarToolBase::Toggle(bool toggle) -{ - wxASSERT_MSG( CanBeToggled(), _T("can't toggle this tool") ); - - if ( m_toggled == toggle ) - return false; - - m_toggled = toggle; - - return true; -} - -bool wxToolBarToolBase::SetToggle(bool toggle) -{ - wxItemKind kind = toggle ? wxITEM_CHECK : wxITEM_NORMAL; - if ( m_kind == kind ) - return false; - - m_kind = kind; - - return true; -} - -bool wxToolBarToolBase::SetShortHelp(const wxString& help) -{ - if ( m_shortHelpString == help ) - return false; - - m_shortHelpString = help; - - return true; -} - -bool wxToolBarToolBase::SetLongHelp(const wxString& help) -{ - if ( m_longHelpString == help ) - return false; - - m_longHelpString = help; - - return true; -} - -// ---------------------------------------------------------------------------- -// wxToolBarBase adding/deleting items -// ---------------------------------------------------------------------------- - -wxToolBarBase::wxToolBarBase() -{ - // the list owns the pointers - m_xMargin = m_yMargin = 0; - m_maxRows = m_maxCols = 0; - m_toolPacking = m_toolSeparation = 0; - m_defaultWidth = 16; - m_defaultHeight = 15; -} - -void wxToolBarBase::FixupStyle() -{ - if ( !HasFlag(wxTB_TOP | wxTB_LEFT | wxTB_RIGHT | wxTB_BOTTOM) ) - { - // this is the default - m_windowStyle |= wxTB_TOP; - } -} - -wxToolBarToolBase *wxToolBarBase::DoAddTool(int id, - const wxString& label, - const wxBitmap& bitmap, - const wxBitmap& bmpDisabled, - wxItemKind kind, - const wxString& shortHelp, - const wxString& longHelp, - wxObject *clientData, - wxCoord WXUNUSED(xPos), - wxCoord WXUNUSED(yPos)) -{ - InvalidateBestSize(); - return InsertTool(GetToolsCount(), id, label, bitmap, bmpDisabled, - kind, shortHelp, longHelp, clientData); -} - -wxToolBarToolBase *wxToolBarBase::InsertTool(size_t pos, - int id, - const wxString& label, - const wxBitmap& bitmap, - const wxBitmap& bmpDisabled, - wxItemKind kind, - const wxString& shortHelp, - const wxString& longHelp, - wxObject *clientData) -{ - wxCHECK_MSG( pos <= GetToolsCount(), (wxToolBarToolBase *)NULL, - _T("invalid position in wxToolBar::InsertTool()") ); - - wxToolBarToolBase *tool = CreateTool(id, label, bitmap, bmpDisabled, kind, - clientData, shortHelp, longHelp); - - if ( !InsertTool(pos, tool) ) - { - delete tool; - - return NULL; - } - - return tool; -} - -wxToolBarToolBase *wxToolBarBase::AddTool(wxToolBarToolBase *tool) -{ - return InsertTool(GetToolsCount(), tool); -} - -wxToolBarToolBase * -wxToolBarBase::InsertTool(size_t pos, wxToolBarToolBase *tool) -{ - wxCHECK_MSG( pos <= GetToolsCount(), (wxToolBarToolBase *)NULL, - _T("invalid position in wxToolBar::InsertTool()") ); - - if ( !tool || !DoInsertTool(pos, tool) ) - { - return NULL; - } - - m_tools.Insert(pos, tool); - - return tool; -} - -wxToolBarToolBase *wxToolBarBase::AddControl(wxControl *control) -{ - return InsertControl(GetToolsCount(), control); -} - -wxToolBarToolBase *wxToolBarBase::InsertControl(size_t pos, wxControl *control) -{ - wxCHECK_MSG( control, (wxToolBarToolBase *)NULL, - _T("toolbar: can't insert NULL control") ); - - wxCHECK_MSG( control->GetParent() == this, (wxToolBarToolBase *)NULL, - _T("control must have toolbar as parent") ); - - wxCHECK_MSG( pos <= GetToolsCount(), (wxToolBarToolBase *)NULL, - _T("invalid position in wxToolBar::InsertControl()") ); - - wxToolBarToolBase *tool = CreateTool(control); - - if ( !InsertTool(pos, tool) ) - { - delete tool; - - return NULL; - } - - return tool; -} - -wxControl *wxToolBarBase::FindControl( int id ) -{ - for ( wxToolBarToolsList::compatibility_iterator node = m_tools.GetFirst(); - node; - node = node->GetNext() ) - { - const wxToolBarToolBase * const tool = node->GetData(); - if ( tool->IsControl() ) - { - wxControl * const control = tool->GetControl(); - - if ( !control ) - { - wxFAIL_MSG( _T("NULL control in toolbar?") ); - } - else if ( control->GetId() == id ) - { - // found - return control; - } - } - } - - return NULL; -} - -wxToolBarToolBase *wxToolBarBase::AddSeparator() -{ - return InsertSeparator(GetToolsCount()); -} - -wxToolBarToolBase *wxToolBarBase::InsertSeparator(size_t pos) -{ - wxCHECK_MSG( pos <= GetToolsCount(), (wxToolBarToolBase *)NULL, - _T("invalid position in wxToolBar::InsertSeparator()") ); - - wxToolBarToolBase *tool = CreateTool(wxID_SEPARATOR, - wxEmptyString, - wxNullBitmap, wxNullBitmap, - wxITEM_SEPARATOR, (wxObject *)NULL, - wxEmptyString, wxEmptyString); - - if ( !tool || !DoInsertTool(pos, tool) ) - { - delete tool; - - return NULL; - } - - m_tools.Insert(pos, tool); - - return tool; -} - -wxToolBarToolBase *wxToolBarBase::RemoveTool(int id) -{ - size_t pos = 0; - wxToolBarToolsList::compatibility_iterator node; - for ( node = m_tools.GetFirst(); node; node = node->GetNext() ) - { - if ( node->GetData()->GetId() == id ) - break; - - pos++; - } - - if ( !node ) - { - // don't give any error messages - sometimes we might call RemoveTool() - // without knowing whether the tool is or not in the toolbar - return (wxToolBarToolBase *)NULL; - } - - wxToolBarToolBase *tool = node->GetData(); - if ( !DoDeleteTool(pos, tool) ) - { - return (wxToolBarToolBase *)NULL; - } - - m_tools.Erase(node); - - return tool; -} - -bool wxToolBarBase::DeleteToolByPos(size_t pos) -{ - wxCHECK_MSG( pos < GetToolsCount(), false, - _T("invalid position in wxToolBar::DeleteToolByPos()") ); - - wxToolBarToolsList::compatibility_iterator node = m_tools.Item(pos); - - if ( !DoDeleteTool(pos, node->GetData()) ) - { - return false; - } - - delete node->GetData(); - m_tools.Erase(node); - - return true; -} - -bool wxToolBarBase::DeleteTool(int id) -{ - size_t pos = 0; - wxToolBarToolsList::compatibility_iterator node; - for ( node = m_tools.GetFirst(); node; node = node->GetNext() ) - { - if ( node->GetData()->GetId() == id ) - break; - - pos++; - } - - if ( !node || !DoDeleteTool(pos, node->GetData()) ) - { - return false; - } - - delete node->GetData(); - m_tools.Erase(node); - - return true; -} - -wxToolBarToolBase *wxToolBarBase::FindById(int id) const -{ - wxToolBarToolBase *tool = (wxToolBarToolBase *)NULL; - - for ( wxToolBarToolsList::compatibility_iterator node = m_tools.GetFirst(); - node; - node = node->GetNext() ) - { - tool = node->GetData(); - if ( tool->GetId() == id ) - { - // found - break; - } - - tool = NULL; - } - - return tool; -} - -void wxToolBarBase::UnToggleRadioGroup(wxToolBarToolBase *tool) -{ - wxCHECK_RET( tool, _T("NULL tool in wxToolBarTool::UnToggleRadioGroup") ); - - if ( !tool->IsButton() || tool->GetKind() != wxITEM_RADIO ) - return; - - wxToolBarToolsList::compatibility_iterator node = m_tools.Find(tool); - wxCHECK_RET( node, _T("invalid tool in wxToolBarTool::UnToggleRadioGroup") ); - - wxToolBarToolsList::compatibility_iterator nodeNext = node->GetNext(); - while ( nodeNext ) - { - wxToolBarToolBase *toolNext = nodeNext->GetData(); - - if ( !toolNext->IsButton() || toolNext->GetKind() != wxITEM_RADIO ) - break; - - if ( toolNext->Toggle(false) ) - { - DoToggleTool(toolNext, false); - } - - nodeNext = nodeNext->GetNext(); - } - - wxToolBarToolsList::compatibility_iterator nodePrev = node->GetPrevious(); - while ( nodePrev ) - { - wxToolBarToolBase *toolNext = nodePrev->GetData(); - - if ( !toolNext->IsButton() || toolNext->GetKind() != wxITEM_RADIO ) - break; - - if ( toolNext->Toggle(false) ) - { - DoToggleTool(toolNext, false); - } - - nodePrev = nodePrev->GetPrevious(); - } -} - -void wxToolBarBase::ClearTools() -{ - while ( GetToolsCount() ) - { - DeleteToolByPos(0); - } -} - -bool wxToolBarBase::Realize() -{ - return true; -} - -wxToolBarBase::~wxToolBarBase() -{ - WX_CLEAR_LIST(wxToolBarToolsList, m_tools); - - // notify the frame that it doesn't have a tool bar any longer to avoid - // dangling pointers - wxFrame *frame = wxDynamicCast(GetParent(), wxFrame); - if ( frame && frame->GetToolBar() == this ) - { - frame->SetToolBar(NULL); - } -} - -// ---------------------------------------------------------------------------- -// wxToolBarBase tools state -// ---------------------------------------------------------------------------- - -void wxToolBarBase::EnableTool(int id, bool enable) -{ - wxToolBarToolBase *tool = FindById(id); - if ( tool ) - { - if ( tool->Enable(enable) ) - { - DoEnableTool(tool, enable); - } - } -} - -void wxToolBarBase::ToggleTool(int id, bool toggle) -{ - wxToolBarToolBase *tool = FindById(id); - if ( tool && tool->CanBeToggled() ) - { - if ( tool->Toggle(toggle) ) - { - UnToggleRadioGroup(tool); - DoToggleTool(tool, toggle); - } - } -} - -void wxToolBarBase::SetToggle(int id, bool toggle) -{ - wxToolBarToolBase *tool = FindById(id); - if ( tool ) - { - if ( tool->SetToggle(toggle) ) - { - DoSetToggle(tool, toggle); - } - } -} - -void wxToolBarBase::SetToolShortHelp(int id, const wxString& help) -{ - wxToolBarToolBase *tool = FindById(id); - if ( tool ) - { - (void)tool->SetShortHelp(help); - } -} - -void wxToolBarBase::SetToolLongHelp(int id, const wxString& help) -{ - wxToolBarToolBase *tool = FindById(id); - if ( tool ) - { - (void)tool->SetLongHelp(help); - } -} - -wxObject *wxToolBarBase::GetToolClientData(int id) const -{ - wxToolBarToolBase *tool = FindById(id); - - return tool ? tool->GetClientData() : (wxObject *)NULL; -} - -void wxToolBarBase::SetToolClientData(int id, wxObject *clientData) -{ - wxToolBarToolBase *tool = FindById(id); - - wxCHECK_RET( tool, _T("no such tool in wxToolBar::SetToolClientData") ); - - tool->SetClientData(clientData); -} - -int wxToolBarBase::GetToolPos(int id) const -{ - size_t pos = 0; - wxToolBarToolsList::compatibility_iterator node; - - for ( node = m_tools.GetFirst(); node; node = node->GetNext() ) - { - if ( node->GetData()->GetId() == id ) - return pos; - - pos++; - } - - return wxNOT_FOUND; -} - -bool wxToolBarBase::GetToolState(int id) const -{ - wxToolBarToolBase *tool = FindById(id); - wxCHECK_MSG( tool, false, _T("no such tool") ); - - return tool->IsToggled(); -} - -bool wxToolBarBase::GetToolEnabled(int id) const -{ - wxToolBarToolBase *tool = FindById(id); - wxCHECK_MSG( tool, false, _T("no such tool") ); - - return tool->IsEnabled(); -} - -wxString wxToolBarBase::GetToolShortHelp(int id) const -{ - wxToolBarToolBase *tool = FindById(id); - wxCHECK_MSG( tool, wxEmptyString, _T("no such tool") ); - - return tool->GetShortHelp(); -} - -wxString wxToolBarBase::GetToolLongHelp(int id) const -{ - wxToolBarToolBase *tool = FindById(id); - wxCHECK_MSG( tool, wxEmptyString, _T("no such tool") ); - - return tool->GetLongHelp(); -} - -// ---------------------------------------------------------------------------- -// wxToolBarBase geometry -// ---------------------------------------------------------------------------- - -void wxToolBarBase::SetMargins(int x, int y) -{ - m_xMargin = x; - m_yMargin = y; -} - -void wxToolBarBase::SetRows(int WXUNUSED(nRows)) -{ - // nothing -} - -// ---------------------------------------------------------------------------- -// event processing -// ---------------------------------------------------------------------------- - -// Only allow toggle if returns true -bool wxToolBarBase::OnLeftClick(int id, bool toggleDown) -{ - wxCommandEvent event(wxEVT_COMMAND_TOOL_CLICKED, id); - event.SetEventObject(this); - - // we use SetInt() to make wxCommandEvent::IsChecked() return toggleDown - event.SetInt((int)toggleDown); - - // and SetExtraLong() for backwards compatibility - event.SetExtraLong((long)toggleDown); - - // Send events to this toolbar instead (and thence up the window hierarchy) - GetEventHandler()->ProcessEvent(event); - - return true; -} - -// Call when right button down. -void wxToolBarBase::OnRightClick(int id, - long WXUNUSED(x), - long WXUNUSED(y)) -{ - wxCommandEvent event(wxEVT_COMMAND_TOOL_RCLICKED, id); - event.SetEventObject(this); - event.SetInt(id); - - GetEventHandler()->ProcessEvent(event); -} - -// Called when the mouse cursor enters a tool bitmap (no button pressed). -// Argument is wxID_ANY if mouse is exiting the toolbar. -// Note that for this event, the id of the window is used, -// and the integer parameter of wxCommandEvent is used to retrieve -// the tool id. -void wxToolBarBase::OnMouseEnter(int id) -{ - wxCommandEvent event(wxEVT_COMMAND_TOOL_ENTER, GetId()); - event.SetEventObject(this); - event.SetInt(id); - - wxFrame *frame = wxDynamicCast(GetParent(), wxFrame); - if( frame ) - { - wxString help; - wxToolBarToolBase* tool = id == wxID_ANY ? (wxToolBarToolBase*)NULL : FindById(id); - if(tool) - help = tool->GetLongHelp(); - frame->DoGiveHelp( help, id != wxID_ANY ); - } - - (void)GetEventHandler()->ProcessEvent(event); -} - -// ---------------------------------------------------------------------------- -// UI updates -// ---------------------------------------------------------------------------- - -// Do the toolbar button updates (check for EVT_UPDATE_UI handlers) -void wxToolBarBase::UpdateWindowUI(long flags) -{ - wxWindowBase::UpdateWindowUI(flags); - - // There is no sense in updating the toolbar UI - // if the parent window is about to get destroyed - wxWindow *tlw = wxGetTopLevelParent( this ); - if (tlw && wxPendingDelete.Member( tlw )) - return; - - wxEvtHandler* evtHandler = GetEventHandler() ; - - for ( wxToolBarToolsList::compatibility_iterator node = m_tools.GetFirst(); - node; - node = node->GetNext() ) - { - int id = node->GetData()->GetId(); - - wxUpdateUIEvent event(id); - event.SetEventObject(this); - - if ( evtHandler->ProcessEvent(event) ) - { - if ( event.GetSetEnabled() ) - EnableTool(id, event.GetEnabled()); - if ( event.GetSetChecked() ) - ToggleTool(id, event.GetChecked()); -#if 0 - if ( event.GetSetText() ) - // Set tooltip? -#endif // 0 - } - } -} - -#if wxUSE_IMAGE - -/* - * Make a greyed-out image suitable for disabled buttons. - * This code is adapted from wxNewBitmapButton in FL. - */ - -bool wxCreateGreyedImage(const wxImage& src, wxImage& dst) -{ - dst = src.Copy(); - - unsigned char rBg, gBg, bBg; - if ( src.HasMask() ) - { - src.GetOrFindMaskColour(&rBg, &gBg, &bBg); - dst.SetMaskColour(rBg, gBg, bBg); - } - else // assuming the pixels along the edges are of the background color - { - rBg = src.GetRed(0, 0); - gBg = src.GetGreen(0, 0); - bBg = src.GetBlue(0, 0); - } - - const wxColour colBg(rBg, gBg, bBg); - - const wxColour colDark = wxSystemSettings::GetColour(wxSYS_COLOUR_3DSHADOW); - const wxColour colLight = wxSystemSettings::GetColour(wxSYS_COLOUR_3DHIGHLIGHT); - - // Second attempt, just making things monochrome - const int width = src.GetWidth(); - const int height = src.GetHeight(); - - for ( int x = 0; x < width; x++ ) - { - for ( int y = 0; y < height; y++ ) - { - const int r = src.GetRed(x, y); - const int g = src.GetGreen(x, y); - const int b = src.GetBlue(x, y); - - if ( r == rBg && g == gBg && b == bBg ) - { - // Leave the background colour as-is - continue; - } - - // Change light things to the background colour - wxColour col; - if ( r >= (colLight.Red() - 50) && - g >= (colLight.Green() - 50) && - b >= (colLight.Blue() - 50) ) - { - col = colBg; - } - else // Change dark things to really dark - { - col = colDark; - } - - dst.SetRGB(x, y, col.Red(), col.Green(), col.Blue()); - } - } - - return true; -} - -#endif // wxUSE_IMAGE - -#endif // wxUSE_TOOLBAR diff --git a/wxWidgets/src/common/textbuf.cpp b/wxWidgets/src/common/textbuf.cpp deleted file mode 100644 index 6f97b98ca3..0000000000 --- a/wxWidgets/src/common/textbuf.cpp +++ /dev/null @@ -1,284 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: src/common/textbuf.cpp -// Purpose: implementation of wxTextBuffer class -// Created: 14.11.01 -// Author: Morten Hanssen, Vadim Zeitlin -// RCS-ID: $Id: textbuf.cpp 38570 2006-04-05 14:37:47Z VZ $ -// Copyright: (c) 1998-2001 wxWidgets team -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// headers -// ============================================================================ - -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif //__BORLANDC__ - -#ifndef WX_PRECOMP - #include "wx/string.h" - #include "wx/intl.h" - #include "wx/log.h" -#endif - -#include "wx/textbuf.h" - -// ============================================================================ -// wxTextBuffer class implementation -// ============================================================================ - -// ---------------------------------------------------------------------------- -// static methods (always compiled in) -// ---------------------------------------------------------------------------- - -// default type is the native one -// the native type under Mac OS X is: -// - Unix when compiling with the Apple Developer Tools (__UNIX__) -// - Mac when compiling with CodeWarrior (__WXMAC__) - -const wxTextFileType wxTextBuffer::typeDefault = -#if defined(__WINDOWS__) || defined(__DOS__) || defined(__PALMOS__) - wxTextFileType_Dos; -#elif defined(__UNIX__) - wxTextFileType_Unix; -#elif defined(__WXMAC__) - wxTextFileType_Mac; -#elif defined(__OS2__) - wxTextFileType_Os2; -#else - wxTextFileType_None; - #error "wxTextBuffer: unsupported platform." -#endif - -const wxChar *wxTextBuffer::GetEOL(wxTextFileType type) -{ - switch ( type ) { - default: - wxFAIL_MSG(wxT("bad buffer type in wxTextBuffer::GetEOL.")); - // fall through nevertheless - we must return something... - - case wxTextFileType_None: return wxEmptyString; - case wxTextFileType_Unix: return wxT("\n"); - case wxTextFileType_Dos: return wxT("\r\n"); - case wxTextFileType_Mac: return wxT("\r"); - } -} - -wxString wxTextBuffer::Translate(const wxString& text, wxTextFileType type) -{ - // don't do anything if there is nothing to do - if ( type == wxTextFileType_None ) - return text; - - // nor if it is empty - if ( text.empty() ) - return text; - - wxString eol = GetEOL(type), result; - - // optimization: we know that the length of the new string will be about - // the same as the length of the old one, so prealloc memory to aviod - // unnecessary relocations - result.Alloc(text.Len()); - - wxChar chLast = 0; - for ( const wxChar *pc = text.c_str(); *pc; pc++ ) - { - wxChar ch = *pc; - switch ( ch ) { - case _T('\n'): - // Dos/Unix line termination - result += eol; - chLast = 0; - break; - - case _T('\r'): - if ( chLast == _T('\r') ) { - // Mac empty line - result += eol; - } - else { - // just remember it: we don't know whether it is just "\r" - // or "\r\n" yet - chLast = _T('\r'); - } - break; - - default: - if ( chLast == _T('\r') ) { - // Mac line termination - result += eol; - - // reset chLast to avoid inserting another eol before the - // next character - chLast = 0; - } - - // add to the current line - result += ch; - } - } - - if ( chLast ) { - // trailing '\r' - result += eol; - } - - return result; -} - -#if wxUSE_TEXTBUFFER - -wxString wxTextBuffer::ms_eof; - -// ---------------------------------------------------------------------------- -// ctors & dtor -// ---------------------------------------------------------------------------- - -wxTextBuffer::wxTextBuffer(const wxString& strBufferName) - : m_strBufferName(strBufferName) -{ - m_nCurLine = 0; - m_isOpened = false; -} - -wxTextBuffer::~wxTextBuffer() -{ - // required here for Darwin -} - -// ---------------------------------------------------------------------------- -// buffer operations -// ---------------------------------------------------------------------------- - -bool wxTextBuffer::Exists() const -{ - return OnExists(); -} - -bool wxTextBuffer::Create(const wxString& strBufferName) -{ - m_strBufferName = strBufferName; - - return Create(); -} - -bool wxTextBuffer::Create() -{ - // buffer name must be either given in ctor or in Create(const wxString&) - wxASSERT( !m_strBufferName.empty() ); - - // if the buffer already exists do nothing - if ( Exists() ) return false; - - if ( !OnOpen(m_strBufferName, WriteAccess) ) - return false; - - OnClose(); - return true; -} - -bool wxTextBuffer::Open(const wxString& strBufferName, const wxMBConv& conv) -{ - m_strBufferName = strBufferName; - - return Open(conv); -} - -bool wxTextBuffer::Open(const wxMBConv& conv) -{ - // buffer name must be either given in ctor or in Open(const wxString&) - wxASSERT( !m_strBufferName.empty() ); - - // open buffer in read-only mode - if ( !OnOpen(m_strBufferName, ReadAccess) ) - return false; - - // read buffer into memory - m_isOpened = OnRead(conv); - - OnClose(); - - return m_isOpened; -} - -// analyse some lines of the buffer trying to guess it's type. -// if it fails, it assumes the native type for our platform. -wxTextFileType wxTextBuffer::GuessType() const -{ - wxASSERT( IsOpened() ); - - // scan the buffer lines - size_t nUnix = 0, // number of '\n's alone - nDos = 0, // number of '\r\n' - nMac = 0; // number of '\r's - - // we take MAX_LINES_SCAN in the beginning, middle and the end of buffer - #define MAX_LINES_SCAN (10) - size_t nCount = m_aLines.Count() / 3, - nScan = nCount > 3*MAX_LINES_SCAN ? MAX_LINES_SCAN : nCount / 3; - - #define AnalyseLine(n) \ - switch ( m_aTypes[n] ) { \ - case wxTextFileType_Unix: nUnix++; break; \ - case wxTextFileType_Dos: nDos++; break; \ - case wxTextFileType_Mac: nMac++; break; \ - default: wxFAIL_MSG(_("unknown line terminator")); \ - } - - size_t n; - for ( n = 0; n < nScan; n++ ) // the beginning - AnalyseLine(n); - for ( n = (nCount - nScan)/2; n < (nCount + nScan)/2; n++ ) - AnalyseLine(n); - for ( n = nCount - nScan; n < nCount; n++ ) - AnalyseLine(n); - - #undef AnalyseLine - - // interpret the results (FIXME far from being even 50% fool proof) - if ( nScan > 0 && nDos + nUnix + nMac == 0 ) { - // no newlines at all - wxLogWarning(_("'%s' is probably a binary buffer."), m_strBufferName.c_str()); - } - else { - #define GREATER_OF(t1, t2) n##t1 == n##t2 ? typeDefault \ - : n##t1 > n##t2 \ - ? wxTextFileType_##t1 \ - : wxTextFileType_##t2 - -#if !defined(__WATCOMC__) || wxCHECK_WATCOM_VERSION(1,4) - if ( nDos > nUnix ) - return GREATER_OF(Dos, Mac); - else if ( nDos < nUnix ) - return GREATER_OF(Unix, Mac); - else { - // nDos == nUnix - return nMac > nDos ? wxTextFileType_Mac : typeDefault; - } -#endif // __WATCOMC__ - - #undef GREATER_OF - } - - return typeDefault; -} - - -bool wxTextBuffer::Close() -{ - Clear(); - m_isOpened = false; - - return true; -} - -bool wxTextBuffer::Write(wxTextFileType typeNew, const wxMBConv& conv) -{ - return OnWrite(typeNew, conv); -} - -#endif // wxUSE_TEXTBUFFER diff --git a/wxWidgets/src/common/textcmn.cpp b/wxWidgets/src/common/textcmn.cpp deleted file mode 100644 index 952fcf9742..0000000000 --- a/wxWidgets/src/common/textcmn.cpp +++ /dev/null @@ -1,553 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: src/common/textcmn.cpp -// Purpose: implementation of platform-independent functions of wxTextCtrl -// Author: Julian Smart -// Modified by: -// Created: 13.07.99 -// RCS-ID: $Id: textcmn.cpp 62095 2009-09-24 18:20:21Z JS $ -// Copyright: (c) wxWidgets team -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declarations -// ============================================================================ - -// for compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#ifndef WX_PRECOMP - #include "wx/event.h" -#endif // WX_PRECOMP - -#if wxUSE_TEXTCTRL - -#include "wx/textctrl.h" - -#ifndef WX_PRECOMP - #include "wx/intl.h" - #include "wx/log.h" -#endif // WX_PRECOMP - -#include "wx/ffile.h" - -// ---------------------------------------------------------------------------- -// macros -// ---------------------------------------------------------------------------- - -// we don't have any objects of type wxTextCtrlBase in the program, only -// wxTextCtrl, so this cast is safe -#define TEXTCTRL(ptr) ((wxTextCtrl *)(ptr)) - -// ============================================================================ -// implementation -// ============================================================================ - -IMPLEMENT_DYNAMIC_CLASS(wxTextUrlEvent, wxCommandEvent) - -DEFINE_EVENT_TYPE(wxEVT_COMMAND_TEXT_UPDATED) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_TEXT_ENTER) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_TEXT_URL) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_TEXT_MAXLEN) - -IMPLEMENT_ABSTRACT_CLASS(wxTextCtrlBase, wxControl) - -// ---------------------------------------------------------------------------- -// style functions - not implemented here -// ---------------------------------------------------------------------------- - -wxTextAttr::wxTextAttr(const wxColour& colText, - const wxColour& colBack, - const wxFont& font, - wxTextAttrAlignment alignment) - : m_colText(colText), m_colBack(colBack), m_font(font), m_textAlignment(alignment) -{ - m_flags = 0; - m_leftIndent = 0; - m_leftSubIndent = 0; - m_rightIndent = 0; - if (m_colText.Ok()) m_flags |= wxTEXT_ATTR_TEXT_COLOUR; - if (m_colBack.Ok()) m_flags |= wxTEXT_ATTR_BACKGROUND_COLOUR; - if (m_font.Ok()) m_flags |= wxTEXT_ATTR_FONT; - if (alignment != wxTEXT_ALIGNMENT_DEFAULT) - m_flags |= wxTEXT_ATTR_ALIGNMENT; -} - -void wxTextAttr::Init() -{ - m_textAlignment = wxTEXT_ALIGNMENT_DEFAULT; - m_flags = 0; - m_leftIndent = 0; - m_leftSubIndent = 0; - m_rightIndent = 0; -} - -/* static */ -wxTextAttr wxTextAttr::Combine(const wxTextAttr& attr, - const wxTextAttr& attrDef, - const wxTextCtrlBase *text) -{ - wxFont font = attr.GetFont(); - if ( !font.Ok() ) - { - font = attrDef.GetFont(); - - if ( text && !font.Ok() ) - font = text->GetFont(); - } - - wxColour colFg = attr.GetTextColour(); - if ( !colFg.Ok() ) - { - colFg = attrDef.GetTextColour(); - - if ( text && !colFg.Ok() ) - colFg = text->GetForegroundColour(); - } - - wxColour colBg = attr.GetBackgroundColour(); - if ( !colBg.Ok() ) - { - colBg = attrDef.GetBackgroundColour(); - - if ( text && !colBg.Ok() ) - colBg = text->GetBackgroundColour(); - } - - wxTextAttr newAttr(colFg, colBg, font); - - if (attr.HasAlignment()) - newAttr.SetAlignment(attr.GetAlignment()); - else if (attrDef.HasAlignment()) - newAttr.SetAlignment(attrDef.GetAlignment()); - - if (attr.HasTabs()) - newAttr.SetTabs(attr.GetTabs()); - else if (attrDef.HasTabs()) - newAttr.SetTabs(attrDef.GetTabs()); - - if (attr.HasLeftIndent()) - newAttr.SetLeftIndent(attr.GetLeftIndent(), attr.GetLeftSubIndent()); - else if (attrDef.HasLeftIndent()) - newAttr.SetLeftIndent(attrDef.GetLeftIndent(), attr.GetLeftSubIndent()); - - if (attr.HasRightIndent()) - newAttr.SetRightIndent(attr.GetRightIndent()); - else if (attrDef.HasRightIndent()) - newAttr.SetRightIndent(attrDef.GetRightIndent()); - - return newAttr; -} - -void wxTextAttr::operator= (const wxTextAttr& attr) -{ - m_font = attr.m_font; - m_colText = attr.m_colText; - m_colBack = attr.m_colBack; - m_textAlignment = attr.m_textAlignment; - m_leftIndent = attr.m_leftIndent; - m_leftSubIndent = attr.m_leftSubIndent; - m_rightIndent = attr.m_rightIndent; - m_tabs = attr.m_tabs; - m_flags = attr.m_flags; -} - - -// apply styling to text range -bool wxTextCtrlBase::SetStyle(long WXUNUSED(start), long WXUNUSED(end), - const wxTextAttr& WXUNUSED(style)) -{ - // to be implemented in derived TextCtrl classes - return false; -} - -// get the styling at the given position -bool wxTextCtrlBase::GetStyle(long WXUNUSED(position), wxTextAttr& WXUNUSED(style)) -{ - // to be implemented in derived TextCtrl classes - return false; -} - -// change default text attributes -bool wxTextCtrlBase::SetDefaultStyle(const wxTextAttr& style) -{ - // keep the old attributes if the new style doesn't specify them unless the - // new style is empty - then reset m_defaultStyle (as there is no other way - // to do it) - if ( style.IsDefault() ) - m_defaultStyle = style; - else - m_defaultStyle = wxTextAttr::Combine(style, m_defaultStyle, this); - - return true; -} - -// get default text attributes -const wxTextAttr& wxTextCtrlBase::GetDefaultStyle() const -{ - return m_defaultStyle; -} - -// ---------------------------------------------------------------------------- -// file IO functions -// ---------------------------------------------------------------------------- - -bool wxTextCtrlBase::DoLoadFile(const wxString& filename, int WXUNUSED(fileType)) -{ -#if wxUSE_FFILE - wxFFile file(filename); - if ( file.IsOpened() ) - { - wxString text; - if ( file.ReadAll(&text) ) - { - SetValue(text); - - DiscardEdits(); - - m_filename = filename; - - return true; - } - } - - wxLogError(_("File couldn't be loaded.")); -#endif // wxUSE_FFILE - - return false; -} - -bool wxTextCtrlBase::SaveFile(const wxString& filename, int fileType) -{ - wxString filenameToUse = filename.empty() ? m_filename : filename; - if ( filenameToUse.empty() ) - { - // what kind of message to give? is it an error or a program bug? - wxLogDebug(wxT("Can't save textctrl to file without filename.")); - - return false; - } - - return DoSaveFile(filenameToUse, fileType); -} - -bool wxTextCtrlBase::DoSaveFile(const wxString& filename, int WXUNUSED(fileType)) -{ -#if wxUSE_FFILE - wxFFile file(filename, _T("w")); - if ( file.IsOpened() && file.Write(GetValue()) ) - { - // if it worked, save for future calls - m_filename = filename; - - // it's not modified any longer - DiscardEdits(); - - return true; - } -#endif // wxUSE_FFILE - - wxLogError(_("The text couldn't be saved.")); - - return false; -} - -// ---------------------------------------------------------------------------- -// stream-like insertion operator -// ---------------------------------------------------------------------------- - -wxTextCtrl& wxTextCtrlBase::operator<<(const wxString& s) -{ - AppendText(s); - return *TEXTCTRL(this); -} - -wxTextCtrl& wxTextCtrlBase::operator<<(float f) -{ - wxString str; - str.Printf(wxT("%.2f"), f); - AppendText(str); - return *TEXTCTRL(this); -} - -wxTextCtrl& wxTextCtrlBase::operator<<(double d) -{ - wxString str; - str.Printf(wxT("%.2f"), d); - AppendText(str); - return *TEXTCTRL(this); -} - -wxTextCtrl& wxTextCtrlBase::operator<<(int i) -{ - wxString str; - str.Printf(wxT("%d"), i); - AppendText(str); - return *TEXTCTRL(this); -} - -wxTextCtrl& wxTextCtrlBase::operator<<(long i) -{ - wxString str; - str.Printf(wxT("%ld"), i); - AppendText(str); - return *TEXTCTRL(this); -} - -wxTextCtrl& wxTextCtrlBase::operator<<(const wxChar c) -{ - return operator<<(wxString(c)); -} - -// ---------------------------------------------------------------------------- -// streambuf methods implementation -// ---------------------------------------------------------------------------- - -#if wxHAS_TEXT_WINDOW_STREAM - -int wxTextCtrlBase::overflow(int c) -{ - AppendText((wxChar)c); - - // return something different from EOF - return 0; -} - -#endif // wxHAS_TEXT_WINDOW_STREAM - -// ---------------------------------------------------------------------------- -// clipboard stuff -// ---------------------------------------------------------------------------- - -bool wxTextCtrlBase::CanCopy() const -{ - // can copy if there's a selection - long from, to; - GetSelection(&from, &to); - return from != to; -} - -bool wxTextCtrlBase::CanCut() const -{ - // can cut if there's a selection and if we're not read only - return CanCopy() && IsEditable(); -} - -bool wxTextCtrlBase::CanPaste() const -{ - // can paste if we are not read only - return IsEditable(); -} - -// ---------------------------------------------------------------------------- -// emulating key presses -// ---------------------------------------------------------------------------- - -#ifdef __WIN32__ -// the generic version is unused in wxMSW -bool wxTextCtrlBase::EmulateKeyPress(const wxKeyEvent& WXUNUSED(event)) -{ - return false; -} -#else // !__WIN32__ -bool wxTextCtrlBase::EmulateKeyPress(const wxKeyEvent& event) -{ - wxChar ch = 0; - int keycode = event.GetKeyCode(); - switch ( keycode ) - { - case WXK_NUMPAD0: - case WXK_NUMPAD1: - case WXK_NUMPAD2: - case WXK_NUMPAD3: - case WXK_NUMPAD4: - case WXK_NUMPAD5: - case WXK_NUMPAD6: - case WXK_NUMPAD7: - case WXK_NUMPAD8: - case WXK_NUMPAD9: - ch = (wxChar)(_T('0') + keycode - WXK_NUMPAD0); - break; - - case WXK_MULTIPLY: - case WXK_NUMPAD_MULTIPLY: - ch = _T('*'); - break; - - case WXK_ADD: - case WXK_NUMPAD_ADD: - ch = _T('+'); - break; - - case WXK_SUBTRACT: - case WXK_NUMPAD_SUBTRACT: - ch = _T('-'); - break; - - case WXK_DECIMAL: - case WXK_NUMPAD_DECIMAL: - ch = _T('.'); - break; - - case WXK_DIVIDE: - case WXK_NUMPAD_DIVIDE: - ch = _T('/'); - break; - - case WXK_DELETE: - case WXK_NUMPAD_DELETE: - // delete the character at cursor - { - const long pos = GetInsertionPoint(); - if ( pos < GetLastPosition() ) - Remove(pos, pos + 1); - } - break; - - case WXK_BACK: - // delete the character before the cursor - { - const long pos = GetInsertionPoint(); - if ( pos > 0 ) - Remove(pos - 1, pos); - } - break; - - default: -#if wxUSE_UNICODE - if ( event.GetUnicodeKey() ) - { - ch = event.GetUnicodeKey(); - } - else -#endif - if ( keycode < 256 && keycode >= 0 && wxIsprint(keycode) ) - { - // FIXME this is not going to work for non letters... - if ( !event.ShiftDown() ) - { - keycode = wxTolower(keycode); - } - - ch = (wxChar)keycode; - } - else - { - ch = _T('\0'); - } - } - - if ( ch ) - { - WriteText(ch); - - return true; - } - - return false; -} -#endif // !__WIN32__ - -// ---------------------------------------------------------------------------- -// selection and ranges -// ---------------------------------------------------------------------------- - -void wxTextCtrlBase::SelectAll() -{ - SetSelection(0, GetLastPosition()); -} - -wxString wxTextCtrlBase::GetStringSelection() const -{ - long from, to; - GetSelection(&from, &to); - - return GetRange(from, to); -} - -wxString wxTextCtrlBase::GetRange(long from, long to) const -{ - wxString sel; - if ( from < to ) - { - sel = GetValue().Mid(from, to - from); - } - - return sel; -} - -// do the window-specific processing after processing the update event -void wxTextCtrlBase::DoUpdateWindowUI(wxUpdateUIEvent& event) -{ - // call inherited, but skip the wxControl's version, and call directly the - // wxWindow's one instead, because the only reason why we are overriding this - // function is that we want to use SetValue() instead of wxControl::SetLabel() - wxWindowBase::DoUpdateWindowUI(event); - - // update text - if ( event.GetSetText() ) - { - if ( event.GetText() != GetValue() ) - SetValue(event.GetText()); - } -} - -// ---------------------------------------------------------------------------- -// hit testing -// ---------------------------------------------------------------------------- - -wxTextCtrlHitTestResult -wxTextCtrlBase::HitTest(const wxPoint& pt, wxTextCoord *x, wxTextCoord *y) const -{ - // implement in terms of the other overload as the native ports typically - // can get the position and not (x, y) pair directly (although wxUniv - // directly gets x and y -- and so overrides this method as well) - long pos; - wxTextCtrlHitTestResult rc = HitTest(pt, &pos); - - if ( rc != wxTE_HT_UNKNOWN ) - { - PositionToXY(pos, x, y); - } - - return rc; -} - -wxTextCtrlHitTestResult -wxTextCtrlBase::HitTest(const wxPoint& WXUNUSED(pt), - long * WXUNUSED(pos)) const -{ - // not implemented - return wxTE_HT_UNKNOWN; -} - -// ---------------------------------------------------------------------------- -// events -// ---------------------------------------------------------------------------- - -void wxTextCtrlBase::SendTextUpdatedEvent() -{ - wxCommandEvent event(wxEVT_COMMAND_TEXT_UPDATED, GetId()); - - // do not do this as it could be very inefficient if the text control - // contains a lot of text and we're not using ref-counted wxString - // implementation -- instead, event.GetString() will query the control for - // its current text if needed - //event.SetString(GetValue()); - - event.SetEventObject(this); - GetEventHandler()->ProcessEvent(event); -} - -#else // !wxUSE_TEXTCTRL - -// define this one even if !wxUSE_TEXTCTRL because it is also used by other -// controls (wxComboBox and wxSpinCtrl) - -DEFINE_EVENT_TYPE(wxEVT_COMMAND_TEXT_UPDATED) - -#endif // wxUSE_TEXTCTRL/!wxUSE_TEXTCTRL diff --git a/wxWidgets/src/common/textfile.cpp b/wxWidgets/src/common/textfile.cpp deleted file mode 100644 index d873e1d971..0000000000 --- a/wxWidgets/src/common/textfile.cpp +++ /dev/null @@ -1,295 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: src/common/textfile.cpp -// Purpose: implementation of wxTextFile class -// Author: Vadim Zeitlin -// Modified by: -// Created: 03.04.98 -// RCS-ID: $Id: textfile.cpp 49298 2007-10-21 18:05:49Z SC $ -// Copyright: (c) 1998 Vadim Zeitlin -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// headers -// ============================================================================ - -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif //__BORLANDC__ - -#if !wxUSE_FILE || !wxUSE_TEXTBUFFER - #undef wxUSE_TEXTFILE - #define wxUSE_TEXTFILE 0 -#endif // wxUSE_FILE - -#if wxUSE_TEXTFILE - -#ifndef WX_PRECOMP - #include "wx/string.h" - #include "wx/intl.h" - #include "wx/file.h" - #include "wx/log.h" -#endif - -#include "wx/textfile.h" -#include "wx/filename.h" -#include "wx/buffer.h" - -// ============================================================================ -// wxTextFile class implementation -// ============================================================================ - -wxTextFile::wxTextFile(const wxString& strFileName) - : wxTextBuffer(strFileName) -{ -} - - -// ---------------------------------------------------------------------------- -// file operations -// ---------------------------------------------------------------------------- - -bool wxTextFile::OnExists() const -{ - return wxFile::Exists(m_strBufferName); -} - - -bool wxTextFile::OnOpen(const wxString &strBufferName, wxTextBufferOpenMode OpenMode) -{ - wxFile::OpenMode FileOpenMode; - - switch ( OpenMode ) - { - default: - wxFAIL_MSG( _T("unknown open mode in wxTextFile::Open") ); - // fall through - - case ReadAccess : - FileOpenMode = wxFile::read; - break; - - case WriteAccess : - FileOpenMode = wxFile::write; - break; - } - - return m_file.Open(strBufferName.c_str(), FileOpenMode); -} - - -bool wxTextFile::OnClose() -{ - return m_file.Close(); -} - - -bool wxTextFile::OnRead(const wxMBConv& conv) -{ - // file should be opened - wxASSERT_MSG( m_file.IsOpened(), _T("can't read closed file") ); - - // read the entire file in memory: this is not the most efficient thing to - // do but there is no good way to avoid it in Unicode build because if we - // read the file block by block we can't convert each block to Unicode - // separately (the last multibyte char in the block might be only partially - // read and so the conversion would fail) and, as the file contents is kept - // in memory by wxTextFile anyhow, it shouldn't be a big problem to read - // the file entirely - size_t bufSize = 0, - bufPos = 0; - char block[1024]; - wxCharBuffer buf; - - // first determine if the file is seekable or not and so whether we can - // determine its length in advance - wxFileOffset fileLength; - { - wxLogNull logNull; - fileLength = m_file.Length(); - } - - // some non-seekable files under /proc under Linux pretend that they're - // seekable but always return 0; others do return an error - const bool seekable = fileLength != wxInvalidOffset && fileLength != 0; - if ( seekable ) - { - // we know the required length, so set the buffer size in advance - bufSize = fileLength; - if ( !buf.extend(bufSize - 1 /* it adds 1 internally */) ) - return false; - - // if the file is seekable, also check that we're at its beginning - wxASSERT_MSG( m_file.Tell() == 0, _T("should be at start of file") ); - } - - for ( ;; ) - { - ssize_t nRead = m_file.Read(block, WXSIZEOF(block)); - - if ( nRead == wxInvalidOffset ) - { - // read error (error message already given in wxFile::Read) - return false; - } - - if ( nRead == 0 ) - { - // if no bytes have been read, presumably this is a valid-but-empty file - if ( bufPos == 0 ) - return true; - - // otherwise we've finished reading the file - break; - } - - if ( seekable ) - { - // this shouldn't happen but don't overwrite the buffer if it does - wxCHECK_MSG( bufPos + nRead <= bufSize, false, - _T("read more than file length?") ); - } - else // !seekable - { - // for non-seekable files we have to allocate more memory on the go - if ( !buf.extend(bufPos + nRead - 1 /* it adds 1 internally */) ) - return false; - } - - // append to the buffer - memcpy(buf.data() + bufPos, block, nRead); - bufPos += nRead; - } - - if ( !seekable ) - { - bufSize = bufPos; - } - - const wxString str(buf, conv, bufPos); - - // there's no risk of this happening in ANSI build -#if wxUSE_UNICODE - if ( bufSize > 4 && str.empty() ) - { - wxLogError(_("Failed to convert file \"%s\" to Unicode."), GetName()); - return false; - } -#endif // wxUSE_UNICODE - - free(buf.release()); // we don't need this memory any more - - - // now break the buffer in lines - - // last processed character, we need to know if it was a CR or not - wxChar chLast = '\0'; - - // the beginning of the current line, changes inside the loop - wxString::const_iterator lineStart = str.begin(); - const wxString::const_iterator end = str.end(); - for ( wxString::const_iterator p = lineStart; p != end; p++ ) - { - const wxChar ch = *p; - switch ( ch ) - { - case '\n': - // could be a DOS or Unix EOL - if ( chLast == '\r' ) - { - if ( p - 1 >= lineStart ) - { - AddLine(wxString(lineStart, p - 1), wxTextFileType_Dos); - } - else - { - // there were two line endings, so add an empty line: - AddLine(wxEmptyString, wxTextFileType_Dos); - } - } - else // bare '\n', Unix style - { - AddLine(wxString(lineStart, p), wxTextFileType_Unix); - } - - lineStart = p + 1; - break; - - case '\r': - if ( chLast == '\r' ) - { - if ( p - 1 >= lineStart ) - { - AddLine(wxString(lineStart, p - 1), wxTextFileType_Mac); - } - // Mac empty line - AddLine(wxEmptyString, wxTextFileType_Mac); - lineStart = p + 1; - } - //else: we don't know what this is yet -- could be a Mac EOL or - // start of DOS EOL so wait for next char - break; - - default: - if ( chLast == '\r' ) - { - // Mac line termination - if ( p - 1 >= lineStart ) - { - AddLine(wxString(lineStart, p - 1), wxTextFileType_Mac); - } - else - { - // there were two line endings, so add an empty line: - AddLine(wxEmptyString, wxTextFileType_Mac); - } - lineStart = p; - } - } - - chLast = ch; - } - - // anything in the last line? - if ( lineStart != end ) - { - // add unterminated last line - AddLine(wxString(lineStart, end), wxTextFileType_None); - } - - return true; -} - - -bool wxTextFile::OnWrite(wxTextFileType typeNew, const wxMBConv& conv) -{ - wxFileName fn = m_strBufferName; - - // We do NOT want wxPATH_NORM_CASE here, or the case will not - // be preserved. - if ( !fn.IsAbsolute() ) - fn.Normalize(wxPATH_NORM_ENV_VARS | wxPATH_NORM_DOTS | wxPATH_NORM_TILDE | - wxPATH_NORM_ABSOLUTE | wxPATH_NORM_LONG); - - wxTempFile fileTmp(fn.GetFullPath()); - - if ( !fileTmp.IsOpened() ) { - wxLogError(_("can't write buffer '%s' to disk."), m_strBufferName.c_str()); - return false; - } - - size_t nCount = GetLineCount(); - for ( size_t n = 0; n < nCount; n++ ) { - fileTmp.Write(GetLine(n) + - GetEOL(typeNew == wxTextFileType_None ? GetLineType(n) - : typeNew), - conv); - } - - // replace the old file with this one - return fileTmp.Commit(); -} - -#endif // wxUSE_TEXTFILE diff --git a/wxWidgets/src/common/timercmn.cpp b/wxWidgets/src/common/timercmn.cpp deleted file mode 100644 index 43062b46de..0000000000 --- a/wxWidgets/src/common/timercmn.cpp +++ /dev/null @@ -1,88 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: common/timercmn.cpp -// Purpose: wxTimerBase implementation -// Author: Julian Smart, Guillermo Rodriguez, Vadim Zeitlin -// Modified by: VZ: extracted all non-wxTimer stuff in stopwatch.cpp (20.06.03) -// Created: 04/01/98 -// RCS-ID: $Id: timercmn.cpp 35650 2005-09-23 12:56:45Z MR $ -// Copyright: (c) Julian Smart -// (c) 1999 Guillermo Rodriguez -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// wxWin headers -// ---------------------------------------------------------------------------- - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_TIMER - -#ifndef WX_PRECOMP - #include "wx/timer.h" -#endif - -// ---------------------------------------------------------------------------- -// wxWin macros -// ---------------------------------------------------------------------------- - -IMPLEMENT_DYNAMIC_CLASS(wxTimerEvent, wxEvent) - -// ============================================================================ -// wxTimerBase implementation -// ============================================================================ - -wxTimerBase::~wxTimerBase() -{ - // this destructor is required for Darwin -} - -void wxTimerBase::Notify() -{ - // the base class version generates an event if it has owner - which it - // should because otherwise nobody can process timer events - wxCHECK_RET( m_owner, _T("wxTimer::Notify() should be overridden.") ); - - wxTimerEvent event(m_idTimer, m_milli); - event.SetEventObject(this); - (void)m_owner->ProcessEvent(event); -} - -bool wxTimerBase::Start(int milliseconds, bool oneShot) -{ - // under MSW timers only work when they're started from the main thread so - // let the caller know about it -#if wxUSE_THREADS - wxASSERT_MSG( wxThread::IsMain(), - _T("timer can only be started from the main thread") ); -#endif // wxUSE_THREADS - - if ( IsRunning() ) - { - // not stopping the already running timer might work for some - // platforms (no problems under MSW) but leads to mysterious crashes - // on the others (GTK), so to be on the safe side do it here - Stop(); - } - - if ( milliseconds != -1 ) - { - m_milli = milliseconds; - } - - m_oneShot = oneShot; - - return true; -} - -#endif // wxUSE_TIMER - diff --git a/wxWidgets/src/common/tokenzr.cpp b/wxWidgets/src/common/tokenzr.cpp deleted file mode 100644 index b539458f86..0000000000 --- a/wxWidgets/src/common/tokenzr.cpp +++ /dev/null @@ -1,229 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/common/tokenzr.cpp -// Purpose: String tokenizer -// Author: Guilhem Lavaux -// Modified by: Vadim Zeitlin (almost full rewrite) -// Created: 04/22/98 -// RCS-ID: $Id: tokenzr.cpp 39694 2006-06-13 11:30:40Z ABX $ -// Copyright: (c) Guilhem Lavaux -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#include "wx/tokenzr.h" - -#ifndef WX_PRECOMP - #include "wx/arrstr.h" -#endif - -// Required for wxIs... functions -#include - -// ============================================================================ -// implementation -// ============================================================================ - -// ---------------------------------------------------------------------------- -// wxStringTokenizer construction -// ---------------------------------------------------------------------------- - -wxStringTokenizer::wxStringTokenizer(const wxString& str, - const wxString& delims, - wxStringTokenizerMode mode) -{ - SetString(str, delims, mode); -} - -void wxStringTokenizer::SetString(const wxString& str, - const wxString& delims, - wxStringTokenizerMode mode) -{ - if ( mode == wxTOKEN_DEFAULT ) - { - // by default, we behave like strtok() if the delimiters are only - // whitespace characters and as wxTOKEN_RET_EMPTY otherwise (for - // whitespace delimiters, strtok() behaviour is better because we want - // to count consecutive spaces as one delimiter) - const wxChar *p; - for ( p = delims.c_str(); *p; p++ ) - { - if ( !wxIsspace(*p) ) - break; - } - - if ( *p ) - { - // not whitespace char in delims - mode = wxTOKEN_RET_EMPTY; - } - else - { - // only whitespaces - mode = wxTOKEN_STRTOK; - } - } - - m_delims = delims; - m_mode = mode; - - Reinit(str); -} - -void wxStringTokenizer::Reinit(const wxString& str) -{ - wxASSERT_MSG( IsOk(), _T("you should call SetString() first") ); - - m_string = str; - m_pos = 0; - m_lastDelim = _T('\0'); -} - -// ---------------------------------------------------------------------------- -// access to the tokens -// ---------------------------------------------------------------------------- - -// do we have more of them? -bool wxStringTokenizer::HasMoreTokens() const -{ - wxCHECK_MSG( IsOk(), false, _T("you should call SetString() first") ); - - if ( m_string.find_first_not_of(m_delims, m_pos) != wxString::npos ) - { - // there are non delimiter characters left, so we do have more tokens - return true; - } - - switch ( m_mode ) - { - case wxTOKEN_RET_EMPTY: - case wxTOKEN_RET_DELIMS: - // special hack for wxTOKEN_RET_EMPTY: we should return the initial - // empty token even if there are only delimiters after it - return m_pos == 0 && !m_string.empty(); - - case wxTOKEN_RET_EMPTY_ALL: - // special hack for wxTOKEN_RET_EMPTY_ALL: we can know if we had - // already returned the trailing empty token after the last - // delimiter by examining m_lastDelim: it is set to NUL if we run - // up to the end of the string in GetNextToken(), but if it is not - // NUL yet we still have this last token to return even if m_pos is - // already at m_string.length() - return m_pos < m_string.length() || m_lastDelim != _T('\0'); - - case wxTOKEN_INVALID: - case wxTOKEN_DEFAULT: - wxFAIL_MSG( _T("unexpected tokenizer mode") ); - // fall through - - case wxTOKEN_STRTOK: - // never return empty delimiters - break; - } - - return false; -} - -// count the number of (remaining) tokens in the string -size_t wxStringTokenizer::CountTokens() const -{ - wxCHECK_MSG( IsOk(), 0, _T("you should call SetString() first") ); - - // VZ: this function is IMHO not very useful, so it's probably not very - // important if its implementation here is not as efficient as it - // could be -- but OTOH like this we're sure to get the correct answer - // in all modes - wxStringTokenizer tkz(m_string.c_str() + m_pos, m_delims, m_mode); - - size_t count = 0; - while ( tkz.HasMoreTokens() ) - { - count++; - - (void)tkz.GetNextToken(); - } - - return count; -} - -// ---------------------------------------------------------------------------- -// token extraction -// ---------------------------------------------------------------------------- - -wxString wxStringTokenizer::GetNextToken() -{ - wxString token; - do - { - if ( !HasMoreTokens() ) - { - break; - } - - // find the end of this token - size_t pos = m_string.find_first_of(m_delims, m_pos); - - // and the start of the next one - if ( pos == wxString::npos ) - { - // no more delimiters, the token is everything till the end of - // string - token.assign(m_string, m_pos, wxString::npos); - - // skip the token - m_pos = m_string.length(); - - // it wasn't terminated - m_lastDelim = _T('\0'); - } - else // we found a delimiter at pos - { - // in wxTOKEN_RET_DELIMS mode we return the delimiter character - // with token, otherwise leave it out - size_t len = pos - m_pos; - if ( m_mode == wxTOKEN_RET_DELIMS ) - len++; - - token.assign(m_string, m_pos, len); - - // skip the token and the trailing delimiter - m_pos = pos + 1; - - m_lastDelim = m_string[pos]; - } - } - while ( !AllowEmpty() && token.empty() ); - - return token; -} - -// ---------------------------------------------------------------------------- -// public functions -// ---------------------------------------------------------------------------- - -wxArrayString wxStringTokenize(const wxString& str, - const wxString& delims, - wxStringTokenizerMode mode) -{ - wxArrayString tokens; - wxStringTokenizer tk(str, delims, mode); - while ( tk.HasMoreTokens() ) - { - tokens.Add(tk.GetNextToken()); - } - - return tokens; -} diff --git a/wxWidgets/src/common/toplvcmn.cpp b/wxWidgets/src/common/toplvcmn.cpp deleted file mode 100644 index 304dd3ca74..0000000000 --- a/wxWidgets/src/common/toplvcmn.cpp +++ /dev/null @@ -1,431 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/common/toplvcmn.cpp -// Purpose: common (for all platforms) wxTopLevelWindow functions -// Author: Julian Smart, Vadim Zeitlin -// Created: 01/02/97 -// Id: $Id: toplvcmn.cpp 53617 2008-05-17 12:56:18Z VZ $ -// Copyright: (c) 1998 Robert Roebling and Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#include "wx/toplevel.h" - -#ifndef WX_PRECOMP - #include "wx/dcclient.h" - #include "wx/app.h" -#endif // WX_PRECOMP - -#include "wx/display.h" - -// ---------------------------------------------------------------------------- -// event table -// ---------------------------------------------------------------------------- - -BEGIN_EVENT_TABLE(wxTopLevelWindowBase, wxWindow) - EVT_CLOSE(wxTopLevelWindowBase::OnCloseWindow) - EVT_SIZE(wxTopLevelWindowBase::OnSize) -END_EVENT_TABLE() - -// ============================================================================ -// implementation -// ============================================================================ - -IMPLEMENT_ABSTRACT_CLASS(wxTopLevelWindow, wxWindow) - -// ---------------------------------------------------------------------------- -// construction/destruction -// ---------------------------------------------------------------------------- - -wxTopLevelWindowBase::wxTopLevelWindowBase() -{ - // Unlike windows, top level windows are created hidden by default. - m_isShown = false; - m_winDefault = NULL; - m_winTmpDefault = NULL; -} - -wxTopLevelWindowBase::~wxTopLevelWindowBase() -{ - // don't let wxTheApp keep any stale pointers to us - if ( wxTheApp && wxTheApp->GetTopWindow() == this ) - wxTheApp->SetTopWindow(NULL); - - wxTopLevelWindows.DeleteObject(this); - - if ( IsLastBeforeExit() ) - { - // no other (important) windows left, quit the app - wxTheApp->ExitMainLoop(); - } -} - -bool wxTopLevelWindowBase::Destroy() -{ - // delayed destruction: the frame will be deleted during the next idle - // loop iteration - if ( !wxPendingDelete.Member(this) ) - wxPendingDelete.Append(this); - -#ifdef __WXMAC__ - // on mac we know that objects will always be deleted after this event - // has been handled, using Hide we avoid erratic redraws during window - // tear down - Hide(); -#else // !__WXMAC__ - // normally we want to hide the window immediately so that it doesn't get - // stuck on the screen while it's being destroyed, however we shouldn't - // hide the last visible window as then we might not get any idle events - // any more as no events will be sent to the hidden window and without idle - // events we won't prune wxPendingDelete list and the application won't - // terminate - for ( wxWindowList::const_iterator i = wxTopLevelWindows.begin(), - end = wxTopLevelWindows.end(); - i != end; - ++i ) - { - wxTopLevelWindow * const win = wx_static_cast(wxTopLevelWindow *, *i); - if ( win != this && win->IsShown() ) - { - // there remains at least one other visible TLW, we can hide this - // one - Hide(); - - break; - } - } -#endif // __WXMAC__/!__WXMAC__ - - return true; -} - -bool wxTopLevelWindowBase::IsLastBeforeExit() const -{ - // first of all, automatically exiting the app on last window close can be - // completely disabled at wxTheApp level - if ( !wxTheApp || !wxTheApp->GetExitOnFrameDelete() ) - return false; - - wxWindowList::const_iterator i; - const wxWindowList::const_iterator end = wxTopLevelWindows.end(); - - // then decide whether we should exit at all - for ( i = wxTopLevelWindows.begin(); i != end; ++i ) - { - wxTopLevelWindow * const win = wx_static_cast(wxTopLevelWindow *, *i); - if ( win->ShouldPreventAppExit() ) - { - // there remains at least one important TLW, don't exit - return false; - } - } - - // if yes, close all the other windows: this could still fail - for ( i = wxTopLevelWindows.begin(); i != end; ++i ) - { - // don't close twice the windows which are already marked for deletion - wxTopLevelWindow * const win = wx_static_cast(wxTopLevelWindow *, *i); - if ( !wxPendingDelete.Member(win) && !win->Close() ) - { - // one of the windows refused to close, don't exit - // - // NB: of course, by now some other windows could have been already - // closed but there is really nothing we can do about it as we - // have no way just to ask the window if it can close without - // forcing it to do it - return false; - } - } - - return true; -} - -// ---------------------------------------------------------------------------- -// wxTopLevelWindow geometry -// ---------------------------------------------------------------------------- - -void wxTopLevelWindowBase::SetMinSize(const wxSize& minSize) -{ - SetSizeHints( minSize.x, minSize.y, GetMaxWidth(), GetMaxHeight() ); -} - -void wxTopLevelWindowBase::SetMaxSize(const wxSize& maxSize) -{ - SetSizeHints( GetMinWidth(), GetMinHeight(), maxSize.x, maxSize.y ); -} - -// set the min/max size of the window -void wxTopLevelWindowBase::DoSetSizeHints(int minW, int minH, - int maxW, int maxH, - int WXUNUSED(incW), int WXUNUSED(incH)) -{ - // setting min width greater than max width leads to infinite loops under - // X11 and generally doesn't make any sense, so don't allow it - wxCHECK_RET( (minW == wxDefaultCoord || maxW == wxDefaultCoord || minW <= maxW) && - (minH == wxDefaultCoord || maxH == wxDefaultCoord || minH <= maxH), - _T("min width/height must be less than max width/height!") ); - - m_minWidth = minW; - m_maxWidth = maxW; - m_minHeight = minH; - m_maxHeight = maxH; -} - -void wxTopLevelWindowBase::GetRectForTopLevelChildren(int *x, int *y, int *w, int *h) -{ - GetPosition(x,y); - GetSize(w,h); -} - -/* static */ -wxSize wxTopLevelWindowBase::GetDefaultSize() -{ - wxSize size = wxGetClientDisplayRect().GetSize(); - - // create proportionally bigger windows on small screens - if ( size.x >= 1024 ) - size.x = 400; - else if ( size.x >= 800 ) - size.x = 300; - else if ( size.x >= 320 ) - size.x = 240; - - if ( size.y >= 768 ) - size.y = 250; - else if ( size.y > 200 ) - { - size.y *= 2; - size.y /= 3; - } - - return size; -} - -void wxTopLevelWindowBase::DoCentre(int dir) -{ - // on some platforms centering top level windows is impossible - // because they are always maximized by guidelines or limitations - if(IsAlwaysMaximized()) - return; - - // we need the display rect anyhow so store it first: notice that we should - // be centered on the same display as our parent window, the display of - // this window itself is not really defined yet - int nDisplay = wxDisplay::GetFromWindow(GetParent() ? GetParent() : this); - wxDisplay dpy(nDisplay == wxNOT_FOUND ? 0 : nDisplay); - const wxRect rectDisplay(dpy.GetClientArea()); - - // what should we centre this window on? - wxRect rectParent; - if ( !(dir & wxCENTRE_ON_SCREEN) && GetParent() ) - { - // centre on parent window: notice that we need screen coordinates for - // positioning this TLW - rectParent = GetParent()->GetScreenRect(); - - // if the parent is entirely off screen (happens at least with MDI - // parent frame under Mac but could happen elsewhere too if the frame - // was hidden/moved away for some reason), don't use it as otherwise - // this window wouldn't be visible at all - if ( !rectDisplay.Contains(rectParent.GetTopLeft()) && - !rectParent.Contains(rectParent.GetBottomRight()) ) - { - // this is enough to make IsEmpty() test below pass - rectParent.width = 0; - } - } - - if ( rectParent.IsEmpty() ) - { - // we were explicitely asked to centre this window on the entire screen - // or if we have no parent anyhow and so can't centre on it - rectParent = rectDisplay; - } - - // centering maximized window on screen is no-op - if((rectParent == rectDisplay) && IsMaximized()) - return; - - if ( !(dir & wxBOTH) ) - dir |= wxBOTH; // if neither is specified, center in both directions - - // the new window rect candidate - wxRect rect = GetRect().CentreIn(rectParent, dir & ~wxCENTRE_ON_SCREEN); - - // we don't want to place the window off screen if Centre() is called as - // this is (almost?) never wanted and it would be very difficult to prevent - // it from happening from the user code if we didn't check for it here - if ( !rectDisplay.Contains(rect.GetTopLeft()) ) - { - // move the window just enough to make the corner visible - int dx = rectDisplay.GetLeft() - rect.GetLeft(); - int dy = rectDisplay.GetTop() - rect.GetTop(); - rect.Offset(dx > 0 ? dx : 0, dy > 0 ? dy : 0); - } - - if ( !rectDisplay.Contains(rect.GetBottomRight()) ) - { - // do the same for this corner too - int dx = rectDisplay.GetRight() - rect.GetRight(); - int dy = rectDisplay.GetBottom() - rect.GetBottom(); - rect.Offset(dx < 0 ? dx : 0, dy < 0 ? dy : 0); - } - - // the window top left and bottom right corner are both visible now and - // although the window might still be not entirely on screen (with 2 - // staggered displays for example) we wouldn't be able to improve the - // layout much in such case, so we stop here - - // -1 could be valid coordinate here if there are several displays - SetSize(rect, wxSIZE_ALLOW_MINUS_ONE); -} - -// ---------------------------------------------------------------------------- -// wxTopLevelWindow size management: we exclude the areas taken by -// menu/status/toolbars from the client area, so the client area is what's -// really available for the frame contents -// ---------------------------------------------------------------------------- - -void wxTopLevelWindowBase::DoScreenToClient(int *x, int *y) const -{ - wxWindow::DoScreenToClient(x, y); - - // translate the wxWindow client coords to our client coords - wxPoint pt(GetClientAreaOrigin()); - if ( x ) - *x -= pt.x; - if ( y ) - *y -= pt.y; -} - -void wxTopLevelWindowBase::DoClientToScreen(int *x, int *y) const -{ - // our client area origin (0, 0) may be really something like (0, 30) for - // wxWindow if we have a toolbar, account for it before translating - wxPoint pt(GetClientAreaOrigin()); - if ( x ) - *x += pt.x; - if ( y ) - *y += pt.y; - - wxWindow::DoClientToScreen(x, y); -} - -bool wxTopLevelWindowBase::IsAlwaysMaximized() const -{ -#if defined(__SMARTPHONE__) || defined(__POCKETPC__) - return true; -#else - return false; -#endif -} - -// ---------------------------------------------------------------------------- -// event handlers -// ---------------------------------------------------------------------------- - -// default resizing behaviour - if only ONE subwindow, resize to fill the -// whole client area -void wxTopLevelWindowBase::DoLayout() -{ - // if we're using constraints or sizers - do use them - if ( GetAutoLayout() ) - { - Layout(); - } - else - { - // do we have _exactly_ one child? - wxWindow *child = (wxWindow *)NULL; - for ( wxWindowList::compatibility_iterator node = GetChildren().GetFirst(); - node; - node = node->GetNext() ) - { - wxWindow *win = node->GetData(); - - // exclude top level and managed windows (status bar isn't - // currently in the children list except under wxMac anyhow, but - // it makes no harm to test for it) - if ( !win->IsTopLevel() && !IsOneOfBars(win) ) - { - if ( child ) - { - return; // it's our second subwindow - nothing to do - } - - child = win; - } - } - - // do we have any children at all? - if ( child && child->IsShown() ) - { - // exactly one child - set it's size to fill the whole frame - int clientW, clientH; - DoGetClientSize(&clientW, &clientH); - - child->SetSize(0, 0, clientW, clientH); - } - } -} - -// The default implementation for the close window event. -void wxTopLevelWindowBase::OnCloseWindow(wxCloseEvent& WXUNUSED(event)) -{ - Destroy(); -} - -bool wxTopLevelWindowBase::SendIconizeEvent(bool iconized) -{ - wxIconizeEvent event(GetId(), iconized); - event.SetEventObject(this); - - return GetEventHandler()->ProcessEvent(event); -} - -// do the window-specific processing after processing the update event -void wxTopLevelWindowBase::DoUpdateWindowUI(wxUpdateUIEvent& event) -{ - // call inherited, but skip the wxControl's version, and call directly the - // wxWindow's one instead, because the only reason why we are overriding this - // function is that we want to use SetTitle() instead of wxControl::SetLabel() - wxWindowBase::DoUpdateWindowUI(event); - - // update title - if ( event.GetSetText() ) - { - if ( event.GetText() != GetTitle() ) - SetTitle(event.GetText()); - } -} - -void wxTopLevelWindowBase::RequestUserAttention(int WXUNUSED(flags)) -{ - // it's probably better than do nothing, isn't it? - Raise(); -} - -void wxTopLevelWindowBase::RemoveChild(wxWindowBase *child) -{ - if ( child == m_winDefault ) - m_winDefault = NULL; - - if ( child == m_winTmpDefault ) - m_winTmpDefault = NULL; - - wxWindow::RemoveChild(child); -} diff --git a/wxWidgets/src/common/treebase.cpp b/wxWidgets/src/common/treebase.cpp deleted file mode 100644 index 8613ab1d32..0000000000 --- a/wxWidgets/src/common/treebase.cpp +++ /dev/null @@ -1,239 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: treebase.cpp -// Purpose: Base wxTreeCtrl classes -// Author: Julian Smart -// Created: 01/02/97 -// Modified: -// Id: $Id: treebase.cpp 51356 2008-01-24 11:23:30Z VZ $ -// Copyright: (c) 1998 Robert Roebling, Julian Smart et al -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// ============================================================================= -// declarations -// ============================================================================= - -// ----------------------------------------------------------------------------- -// headers -// ----------------------------------------------------------------------------- - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_TREECTRL - -#include "wx/treectrl.h" -#include "wx/imaglist.h" - -// ---------------------------------------------------------------------------- -// events -// ---------------------------------------------------------------------------- - -DEFINE_EVENT_TYPE(wxEVT_COMMAND_TREE_BEGIN_DRAG) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_TREE_BEGIN_RDRAG) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_TREE_BEGIN_LABEL_EDIT) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_TREE_END_LABEL_EDIT) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_TREE_DELETE_ITEM) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_TREE_GET_INFO) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_TREE_SET_INFO) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_TREE_ITEM_EXPANDED) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_TREE_ITEM_EXPANDING) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_TREE_ITEM_COLLAPSED) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_TREE_ITEM_COLLAPSING) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_TREE_SEL_CHANGED) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_TREE_SEL_CHANGING) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_TREE_KEY_DOWN) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_TREE_ITEM_ACTIVATED) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_TREE_ITEM_RIGHT_CLICK) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_TREE_ITEM_MIDDLE_CLICK) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_TREE_END_DRAG) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_TREE_STATE_IMAGE_CLICK) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_TREE_ITEM_GETTOOLTIP) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_TREE_ITEM_MENU) - -// ---------------------------------------------------------------------------- -// Tree event -// ---------------------------------------------------------------------------- - -IMPLEMENT_ABSTRACT_CLASS(wxTreeEvent, wxNotifyEvent) - - -wxTreeEvent::wxTreeEvent(wxEventType commandType, - wxTreeCtrlBase *tree, - const wxTreeItemId& item) - : wxNotifyEvent(commandType, tree->GetId()), - m_item(item) -{ - m_editCancelled = false; - - SetEventObject(tree); - - if ( item.IsOk() ) - SetClientObject(tree->GetItemData(item)); -} - -wxTreeEvent::wxTreeEvent(wxEventType commandType, int id) - : wxNotifyEvent(commandType, id) -{ - m_itemOld = 0l; - m_editCancelled = false; -} - -wxTreeEvent::wxTreeEvent(const wxTreeEvent & event) - : wxNotifyEvent(event) -{ - m_evtKey = event.m_evtKey; - m_item = event.m_item; - m_itemOld = event.m_itemOld; - m_pointDrag = event.m_pointDrag; - m_label = event.m_label; - m_editCancelled = event.m_editCancelled; -} - -// ---------------------------------------------------------------------------- -// wxTreeCtrlBase -// ---------------------------------------------------------------------------- - -wxTreeCtrlBase::~wxTreeCtrlBase() -{ - if (m_ownsImageListNormal) - delete m_imageListNormal; - if (m_ownsImageListState) - delete m_imageListState; -} - -static void -wxGetBestTreeSize(const wxTreeCtrlBase* treeCtrl, wxTreeItemId id, wxSize& size) -{ - wxRect rect; - - if ( treeCtrl->GetBoundingRect(id, rect, true /* just the item */) ) - { - // Translate to logical position so we get the full extent -#if defined(__WXMSW__) && !defined(__WXUNIVERSAL__) - rect.x += treeCtrl->GetScrollPos(wxHORIZONTAL); - rect.y += treeCtrl->GetScrollPos(wxVERTICAL); -#endif - - size.IncTo(wxSize(rect.GetRight(), rect.GetBottom())); - } - - wxTreeItemIdValue cookie; - for ( wxTreeItemId item = treeCtrl->GetFirstChild(id, cookie); - item.IsOk(); - item = treeCtrl->GetNextChild(id, cookie) ) - { - wxGetBestTreeSize(treeCtrl, item, size); - } -} - -wxSize wxTreeCtrlBase::DoGetBestSize() const -{ - wxSize size; - - // this doesn't really compute the total bounding rectangle of all items - // but a not too bad guess of it which has the advantage of not having to - // examine all (potentially hundreds or thousands) items in the control - - if (GetQuickBestSize()) - { - for ( wxTreeItemId item = GetRootItem(); - item.IsOk(); - item = GetLastChild(item) ) - { - wxRect rect; - - // last parameter is "true" to get only the dimensions of the text - // label, we don't want to get the entire item width as it's determined - // by the current size - if ( GetBoundingRect(item, rect, true) ) - { - if ( size.x < rect.x + rect.width ) - size.x = rect.x + rect.width; - if ( size.y < rect.y + rect.height ) - size.y = rect.y + rect.height; - } - } - } - else // use precise, if potentially slow, size computation method - { - // iterate over all items recursively - wxTreeItemId idRoot = GetRootItem(); - if ( idRoot.IsOk() ) - wxGetBestTreeSize(this, idRoot, size); - } - - // need some minimal size even for empty tree - if ( !size.x || !size.y ) - size = wxControl::DoGetBestSize(); - else - { - // Add border size - size += GetWindowBorderSize(); - - CacheBestSize(size); - } - - return size; -} - -void wxTreeCtrlBase::ExpandAll() -{ - if ( IsEmpty() ) - return; - - ExpandAllChildren(GetRootItem()); -} - -void wxTreeCtrlBase::ExpandAllChildren(const wxTreeItemId& item) -{ - // expand this item first, this might result in its children being added on - // the fly - if ( item != GetRootItem() || !HasFlag(wxTR_HIDE_ROOT) ) - Expand(item); - //else: expanding hidden root item is unsupported and unnecessary - - // then (recursively) expand all the children - wxTreeItemIdValue cookie; - for ( wxTreeItemId idCurr = GetFirstChild(item, cookie); - idCurr.IsOk(); - idCurr = GetNextChild(item, cookie) ) - { - ExpandAllChildren(idCurr); - } -} - -void wxTreeCtrlBase::CollapseAll() -{ - if ( IsEmpty() ) - return; - - CollapseAllChildren(GetRootItem()); -} - -void wxTreeCtrlBase::CollapseAllChildren(const wxTreeItemId& item) -{ - // first (recursively) collapse all the children - wxTreeItemIdValue cookie; - for ( wxTreeItemId idCurr = GetFirstChild(item, cookie); - idCurr.IsOk(); - idCurr = GetNextChild(item, cookie) ) - { - CollapseAllChildren(idCurr); - } - - // then collapse this element too - Collapse(item); -} - -bool wxTreeCtrlBase::IsEmpty() const -{ - return !GetRootItem().IsOk(); -} - -#endif // wxUSE_TREECTRL - diff --git a/wxWidgets/src/common/txtstrm.cpp b/wxWidgets/src/common/txtstrm.cpp deleted file mode 100644 index 3dad170121..0000000000 --- a/wxWidgets/src/common/txtstrm.cpp +++ /dev/null @@ -1,520 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: src/common/txtstrm.cpp -// Purpose: Text stream classes -// Author: Guilhem Lavaux -// Modified by: -// Created: 28/06/98 -// RCS-ID: $Id: txtstrm.cpp 48920 2007-09-24 13:11:36Z JS $ -// Copyright: (c) Guilhem Lavaux -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_STREAMS - -#include "wx/txtstrm.h" -#include - - -// ---------------------------------------------------------------------------- -// constants -// ---------------------------------------------------------------------------- - -// Unix: "\n" -// Dos: "\r\n" -// Mac: "\r" - -// ---------------------------------------------------------------------------- -// wxTextInputStream -// ---------------------------------------------------------------------------- - -#if wxUSE_UNICODE -wxTextInputStream::wxTextInputStream(wxInputStream &s, - const wxString &sep, - const wxMBConv& conv) - : m_input(s), m_separators(sep), m_conv(conv.Clone()) -{ - memset((void*)m_lastBytes, 0, 10); -} -#else -wxTextInputStream::wxTextInputStream(wxInputStream &s, const wxString &sep) - : m_input(s), m_separators(sep) -{ - memset((void*)m_lastBytes, 0, 10); -} -#endif - -wxTextInputStream::~wxTextInputStream() -{ -#if wxUSE_UNICODE - delete m_conv; -#endif // wxUSE_UNICODE -} - -void wxTextInputStream::UngetLast() -{ - size_t byteCount = 0; - while(m_lastBytes[byteCount]) // pseudo ANSI strlen (even for Unicode!) - byteCount++; - m_input.Ungetch(m_lastBytes, byteCount); - memset((void*)m_lastBytes, 0, 10); -} - -wxChar wxTextInputStream::NextChar() -{ -#if wxUSE_UNICODE - wxChar wbuf[2]; - memset((void*)m_lastBytes, 0, 10); - for(size_t inlen = 0; inlen < 9; inlen++) - { - // actually read the next character - m_lastBytes[inlen] = m_input.GetC(); - - if(m_input.LastRead() <= 0) - return wxEOT; - - if ( m_conv->ToWChar(wbuf, WXSIZEOF(wbuf), m_lastBytes, inlen + 1) - != wxCONV_FAILED ) - return wbuf[0]; - } - // there should be no encoding which requires more than nine bytes for one character... - return wxEOT; -#else - m_lastBytes[0] = m_input.GetC(); - - if(m_input.LastRead() <= 0) - return wxEOT; - - return m_lastBytes[0]; -#endif - -} - -wxChar wxTextInputStream::NextNonSeparators() -{ - for (;;) - { - wxChar c = NextChar(); - if (c == wxEOT) return (wxChar) 0; - - if (c != wxT('\n') && - c != wxT('\r') && - !m_separators.Contains(c)) - return c; - } - -} - -bool wxTextInputStream::EatEOL(const wxChar &c) -{ - if (c == wxT('\n')) return true; // eat on UNIX - - if (c == wxT('\r')) // eat on both Mac and DOS - { - wxChar c2 = NextChar(); - if(c2 == wxEOT) return true; // end of stream reached, had enough :-) - - if (c2 != wxT('\n')) UngetLast(); // Don't eat on Mac - return true; - } - - return false; -} - -wxUint32 wxTextInputStream::Read32(int base) -{ - wxASSERT_MSG( !base || (base > 1 && base <= 36), _T("invalid base") ); - if(!m_input) return 0; - - wxString word = ReadWord(); - if(word.empty()) - return 0; - return wxStrtoul(word.c_str(), 0, base); -} - -wxUint16 wxTextInputStream::Read16(int base) -{ - return (wxUint16)Read32(base); -} - -wxUint8 wxTextInputStream::Read8(int base) -{ - return (wxUint8)Read32(base); -} - -wxInt32 wxTextInputStream::Read32S(int base) -{ - wxASSERT_MSG( !base || (base > 1 && base <= 36), _T("invalid base") ); - if(!m_input) return 0; - - wxString word = ReadWord(); - if(word.empty()) - return 0; - return wxStrtol(word.c_str(), 0, base); -} - -wxInt16 wxTextInputStream::Read16S(int base) -{ - return (wxInt16)Read32S(base); -} - -wxInt8 wxTextInputStream::Read8S(int base) -{ - return (wxInt8)Read32S(base); -} - -double wxTextInputStream::ReadDouble() -{ - if(!m_input) return 0; - wxString word = ReadWord(); - if(word.empty()) - return 0; - return wxStrtod(word.c_str(), 0); -} - -#if WXWIN_COMPATIBILITY_2_6 - -wxString wxTextInputStream::ReadString() -{ - return ReadLine(); -} - -#endif // WXWIN_COMPATIBILITY_2_6 - -wxString wxTextInputStream::ReadLine() -{ - wxString line; - - while ( !m_input.Eof() ) - { - wxChar c = NextChar(); - if(c == wxEOT) - break; - - if (EatEOL(c)) - break; - - line += c; - } - - return line; -} - -wxString wxTextInputStream::ReadWord() -{ - wxString word; - - if ( !m_input ) - return word; - - wxChar c = NextNonSeparators(); - if ( !c ) - return word; - - word += c; - - while ( !m_input.Eof() ) - { - c = NextChar(); - if(c == wxEOT) - break; - - if (m_separators.Contains(c)) - break; - - if (EatEOL(c)) - break; - - word += c; - } - - return word; -} - -wxTextInputStream& wxTextInputStream::operator>>(wxString& word) -{ - word = ReadWord(); - return *this; -} - -wxTextInputStream& wxTextInputStream::operator>>(char& c) -{ - c = m_input.GetC(); - if(m_input.LastRead() <= 0) c = 0; - - if (EatEOL(c)) - c = '\n'; - - return *this; -} - -#if wxUSE_UNICODE && wxWCHAR_T_IS_REAL_TYPE - -wxTextInputStream& wxTextInputStream::operator>>(wchar_t& wc) -{ - wc = GetChar(); - - return *this; -} - -#endif // wxUSE_UNICODE - -wxTextInputStream& wxTextInputStream::operator>>(wxInt16& i) -{ - i = (wxInt16)Read16(); - return *this; -} - -wxTextInputStream& wxTextInputStream::operator>>(wxInt32& i) -{ - i = (wxInt32)Read32(); - return *this; -} - -wxTextInputStream& wxTextInputStream::operator>>(wxUint16& i) -{ - i = Read16(); - return *this; -} - -wxTextInputStream& wxTextInputStream::operator>>(wxUint32& i) -{ - i = Read32(); - return *this; -} - -wxTextInputStream& wxTextInputStream::operator>>(double& i) -{ - i = ReadDouble(); - return *this; -} - -wxTextInputStream& wxTextInputStream::operator>>(float& f) -{ - f = (float)ReadDouble(); - return *this; -} - - - -#if wxUSE_UNICODE -wxTextOutputStream::wxTextOutputStream(wxOutputStream& s, - wxEOL mode, - const wxMBConv& conv) - : m_output(s), m_conv(conv.Clone()) -#else -wxTextOutputStream::wxTextOutputStream(wxOutputStream& s, wxEOL mode) - : m_output(s) -#endif -{ - m_mode = mode; - if (m_mode == wxEOL_NATIVE) - { -#if defined(__WXMSW__) || defined(__WXPM__) - m_mode = wxEOL_DOS; -#elif defined(__WXMAC__) && !defined(__DARWIN__) - m_mode = wxEOL_MAC; -#else - m_mode = wxEOL_UNIX; -#endif - } -} - -wxTextOutputStream::~wxTextOutputStream() -{ -#if wxUSE_UNICODE - delete m_conv; -#endif // wxUSE_UNICODE -} - -void wxTextOutputStream::SetMode(wxEOL mode) -{ - m_mode = mode; - if (m_mode == wxEOL_NATIVE) - { -#if defined(__WXMSW__) || defined(__WXPM__) - m_mode = wxEOL_DOS; -#elif defined(__WXMAC__) && !defined(__DARWIN__) - m_mode = wxEOL_MAC; -#else - m_mode = wxEOL_UNIX; -#endif - } -} - -void wxTextOutputStream::Write32(wxUint32 i) -{ - wxString str; - str.Printf(wxT("%u"), i); - - WriteString(str); -} - -void wxTextOutputStream::Write16(wxUint16 i) -{ - wxString str; - str.Printf(wxT("%u"), (unsigned)i); - - WriteString(str); -} - -void wxTextOutputStream::Write8(wxUint8 i) -{ - wxString str; - str.Printf(wxT("%u"), (unsigned)i); - - WriteString(str); -} - -void wxTextOutputStream::WriteDouble(double d) -{ - wxString str; - - str.Printf(wxT("%f"), d); - WriteString(str); -} - -void wxTextOutputStream::WriteString(const wxString& string) -{ - size_t len = string.length(); - - wxString out; - out.reserve(len); - - for ( size_t i = 0; i < len; i++ ) - { - const wxChar c = string[i]; - if ( c == wxT('\n') ) - { - switch ( m_mode ) - { - case wxEOL_DOS: - out << _T("\r\n"); - continue; - - case wxEOL_MAC: - out << _T('\r'); - continue; - - default: - wxFAIL_MSG( _T("unknown EOL mode in wxTextOutputStream") ); - // fall through - - case wxEOL_UNIX: - // don't treat '\n' specially - ; - } - } - - out << c; - } - -#if wxUSE_UNICODE - wxCharBuffer buffer = m_conv->cWC2MB(out, out.length(), &len); - m_output.Write(buffer, len); -#else - m_output.Write(out.c_str(), out.length() ); -#endif -} - -wxTextOutputStream& wxTextOutputStream::PutChar(wxChar c) -{ -#if wxUSE_UNICODE - WriteString( wxString(&c, *m_conv, 1) ); -#else - WriteString( wxString(&c, wxConvLocal, 1) ); -#endif - return *this; -} - -wxTextOutputStream& wxTextOutputStream::operator<<(const wxChar *string) -{ - WriteString( wxString(string) ); - return *this; -} - -wxTextOutputStream& wxTextOutputStream::operator<<(const wxString& string) -{ - WriteString( string ); - return *this; -} - -wxTextOutputStream& wxTextOutputStream::operator<<(char c) -{ - WriteString( wxString::FromAscii(c) ); - - return *this; -} - -#if wxUSE_UNICODE && wxWCHAR_T_IS_REAL_TYPE - -wxTextOutputStream& wxTextOutputStream::operator<<(wchar_t wc) -{ - WriteString( wxString(&wc, *m_conv, 1) ); - - return *this; -} - -#endif // wxUSE_UNICODE - -wxTextOutputStream& wxTextOutputStream::operator<<(wxInt16 c) -{ - wxString str; - str.Printf(wxT("%d"), (signed int)c); - WriteString(str); - - return *this; -} - -wxTextOutputStream& wxTextOutputStream::operator<<(wxInt32 c) -{ - wxString str; - str.Printf(wxT("%ld"), (signed long)c); - WriteString(str); - - return *this; -} - -wxTextOutputStream& wxTextOutputStream::operator<<(wxUint16 c) -{ - wxString str; - str.Printf(wxT("%u"), (unsigned int)c); - WriteString(str); - - return *this; -} - -wxTextOutputStream& wxTextOutputStream::operator<<(wxUint32 c) -{ - wxString str; - str.Printf(wxT("%lu"), (unsigned long)c); - WriteString(str); - - return *this; -} - -wxTextOutputStream &wxTextOutputStream::operator<<(double f) -{ - WriteDouble(f); - return *this; -} - -wxTextOutputStream& wxTextOutputStream::operator<<(float f) -{ - WriteDouble((double)f); - return *this; -} - -wxTextOutputStream &endl( wxTextOutputStream &stream ) -{ - return stream.PutChar(wxT('\n')); -} - -#endif - // wxUSE_STREAMS diff --git a/wxWidgets/src/common/unictabl.inc b/wxWidgets/src/common/unictabl.inc deleted file mode 100644 index d75491642c..0000000000 --- a/wxWidgets/src/common/unictabl.inc +++ /dev/null @@ -1,872 +0,0 @@ - - -/* - * This file is #included by encconv.cpp - * - * CVS-ID: $Id: unictabl.inc 40398 2006-07-31 16:28:43Z VS $ - * - * *** *** CAUTION! *** *** - * Do not modify this file by hand! It is generated by shell - * script $(WXWIN)/misc/unictabl/regenerate - * - * Parts of this file are based on tables published by Unicode, Inc. - * Original tables are freely available at - * ftp://ftp.unicode.org/Public/MAPPINGS - * - * Original copyright info as present in mapping tables follows: - * - * - * Copyright (c) 1991-1999 Unicode, Inc. All Rights reserved. - * - * This file is provided as-is by Unicode, Inc. (The Unicode Consortium). - * No claims are made as to fitness for any particular purpose. No - * warranties of any kind are expressed or implied. The recipient - * agrees to determine applicability of information provided. If this - * file has been provided on optical media by Unicode, Inc., the sole - * remedy for any claim will be exchange of defective media within 90 - * days of receipt. - * - * Unicode, Inc. hereby grants the right to freely use the information - * supplied in this file in the creation of products supporting the - * Unicode Standard, and to make copies of this file in any form for - * internal or external distribution as long as this notice remains - * attached. - */ - - - - -/* - * ISO8859_1 to Unicode recoding table - * based on file mappings/8859-1.TXT by Unicode Consortium - */ - -static const wxUint16 encoding_table__ISO8859_1[128] = { - 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, - 0x0088, 0x0089, 0x008A, 0x008B, 0x008C, 0x008D, 0x008E, 0x008F, - 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, - 0x0098, 0x0099, 0x009A, 0x009B, 0x009C, 0x009D, 0x009E, 0x009F, - 0x00A0, 0x00A1, 0x00A2, 0x00A3, 0x00A4, 0x00A5, 0x00A6, 0x00A7, - 0x00A8, 0x00A9, 0x00AA, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x00AF, - 0x00B0, 0x00B1, 0x00B2, 0x00B3, 0x00B4, 0x00B5, 0x00B6, 0x00B7, - 0x00B8, 0x00B9, 0x00BA, 0x00BB, 0x00BC, 0x00BD, 0x00BE, 0x00BF, - 0x00C0, 0x00C1, 0x00C2, 0x00C3, 0x00C4, 0x00C5, 0x00C6, 0x00C7, - 0x00C8, 0x00C9, 0x00CA, 0x00CB, 0x00CC, 0x00CD, 0x00CE, 0x00CF, - 0x00D0, 0x00D1, 0x00D2, 0x00D3, 0x00D4, 0x00D5, 0x00D6, 0x00D7, - 0x00D8, 0x00D9, 0x00DA, 0x00DB, 0x00DC, 0x00DD, 0x00DE, 0x00DF, - 0x00E0, 0x00E1, 0x00E2, 0x00E3, 0x00E4, 0x00E5, 0x00E6, 0x00E7, - 0x00E8, 0x00E9, 0x00EA, 0x00EB, 0x00EC, 0x00ED, 0x00EE, 0x00EF, - 0x00F0, 0x00F1, 0x00F2, 0x00F3, 0x00F4, 0x00F5, 0x00F6, 0x00F7, - 0x00F8, 0x00F9, 0x00FA, 0x00FB, 0x00FC, 0x00FD, 0x00FE, 0x00FF - }; - - -/* - * ISO8859_10 to Unicode recoding table - * based on file mappings/8859-10.TXT by Unicode Consortium - */ - -static const wxUint16 encoding_table__ISO8859_10[128] = { - 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, - 0x0088, 0x0089, 0x008A, 0x008B, 0x008C, 0x008D, 0x008E, 0x008F, - 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, - 0x0098, 0x0099, 0x009A, 0x009B, 0x009C, 0x009D, 0x009E, 0x009F, - 0x00A0, 0x0104, 0x0112, 0x0122, 0x012A, 0x0128, 0x0136, 0x00A7, - 0x013B, 0x0110, 0x0160, 0x0166, 0x017D, 0x00AD, 0x016A, 0x014A, - 0x00B0, 0x0105, 0x0113, 0x0123, 0x012B, 0x0129, 0x0137, 0x00B7, - 0x013C, 0x0111, 0x0161, 0x0167, 0x017E, 0x2015, 0x016B, 0x014B, - 0x0100, 0x00C1, 0x00C2, 0x00C3, 0x00C4, 0x00C5, 0x00C6, 0x012E, - 0x010C, 0x00C9, 0x0118, 0x00CB, 0x0116, 0x00CD, 0x00CE, 0x00CF, - 0x00D0, 0x0145, 0x014C, 0x00D3, 0x00D4, 0x00D5, 0x00D6, 0x0168, - 0x00D8, 0x0172, 0x00DA, 0x00DB, 0x00DC, 0x00DD, 0x00DE, 0x00DF, - 0x0101, 0x00E1, 0x00E2, 0x00E3, 0x00E4, 0x00E5, 0x00E6, 0x012F, - 0x010D, 0x00E9, 0x0119, 0x00EB, 0x0117, 0x00ED, 0x00EE, 0x00EF, - 0x00F0, 0x0146, 0x014D, 0x00F3, 0x00F4, 0x00F5, 0x00F6, 0x0169, - 0x00F8, 0x0173, 0x00FA, 0x00FB, 0x00FC, 0x00FD, 0x00FE, 0x0138 - }; - - -/* - * ISO8859_13 to Unicode recoding table - * based on file mappings/8859-13.TXT by Unicode Consortium - */ - -static const wxUint16 encoding_table__ISO8859_13[128] = { - 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, - 0x0088, 0x0089, 0x008A, 0x008B, 0x008C, 0x008D, 0x008E, 0x008F, - 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, - 0x0098, 0x0099, 0x009A, 0x009B, 0x009C, 0x009D, 0x009E, 0x009F, - 0x00A0, 0x201D, 0x00A2, 0x00A3, 0x00A4, 0x201E, 0x00A6, 0x00A7, - 0x00D8, 0x00A9, 0x0156, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x00C6, - 0x00B0, 0x00B1, 0x00B2, 0x00B3, 0x201C, 0x00B5, 0x00B6, 0x00B7, - 0x00F8, 0x00B9, 0x0157, 0x00BB, 0x00BC, 0x00BD, 0x00BE, 0x00E6, - 0x0104, 0x012E, 0x0100, 0x0106, 0x00C4, 0x00C5, 0x0118, 0x0112, - 0x010C, 0x00C9, 0x0179, 0x0116, 0x0122, 0x0136, 0x012A, 0x013B, - 0x0160, 0x0143, 0x0145, 0x00D3, 0x014C, 0x00D5, 0x00D6, 0x00D7, - 0x0172, 0x0141, 0x015A, 0x016A, 0x00DC, 0x017B, 0x017D, 0x00DF, - 0x0105, 0x012F, 0x0101, 0x0107, 0x00E4, 0x00E5, 0x0119, 0x0113, - 0x010D, 0x00E9, 0x017A, 0x0117, 0x0123, 0x0137, 0x012B, 0x013C, - 0x0161, 0x0144, 0x0146, 0x00F3, 0x014D, 0x00F5, 0x00F6, 0x00F7, - 0x0173, 0x0142, 0x015B, 0x016B, 0x00FC, 0x017C, 0x017E, 0x2019 - }; - - -/* - * ISO8859_14 to Unicode recoding table - * based on file mappings/8859-14.TXT by Unicode Consortium - */ - -static const wxUint16 encoding_table__ISO8859_14[128] = { - 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, - 0x0088, 0x0089, 0x008A, 0x008B, 0x008C, 0x008D, 0x008E, 0x008F, - 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, - 0x0098, 0x0099, 0x009A, 0x009B, 0x009C, 0x009D, 0x009E, 0x009F, - 0x00A0, 0x1E02, 0x1E03, 0x00A3, 0x010A, 0x010B, 0x1E0A, 0x00A7, - 0x1E80, 0x00A9, 0x1E82, 0x1E0B, 0x1EF2, 0x00AD, 0x00AE, 0x0178, - 0x1E1E, 0x1E1F, 0x0120, 0x0121, 0x1E40, 0x1E41, 0x00B6, 0x1E56, - 0x1E81, 0x1E57, 0x1E83, 0x1E60, 0x1EF3, 0x1E84, 0x1E85, 0x1E61, - 0x00C0, 0x00C1, 0x00C2, 0x00C3, 0x00C4, 0x00C5, 0x00C6, 0x00C7, - 0x00C8, 0x00C9, 0x00CA, 0x00CB, 0x00CC, 0x00CD, 0x00CE, 0x00CF, - 0x0174, 0x00D1, 0x00D2, 0x00D3, 0x00D4, 0x00D5, 0x00D6, 0x1E6A, - 0x00D8, 0x00D9, 0x00DA, 0x00DB, 0x00DC, 0x00DD, 0x0176, 0x00DF, - 0x00E0, 0x00E1, 0x00E2, 0x00E3, 0x00E4, 0x00E5, 0x00E6, 0x00E7, - 0x00E8, 0x00E9, 0x00EA, 0x00EB, 0x00EC, 0x00ED, 0x00EE, 0x00EF, - 0x0175, 0x00F1, 0x00F2, 0x00F3, 0x00F4, 0x00F5, 0x00F6, 0x1E6B, - 0x00F8, 0x00F9, 0x00FA, 0x00FB, 0x00FC, 0x00FD, 0x0177, 0x00FF - }; - - -/* - * ISO8859_15 to Unicode recoding table - * based on file mappings/8859-15.TXT by Unicode Consortium - */ - -static const wxUint16 encoding_table__ISO8859_15[128] = { - 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, - 0x0088, 0x0089, 0x008A, 0x008B, 0x008C, 0x008D, 0x008E, 0x008F, - 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, - 0x0098, 0x0099, 0x009A, 0x009B, 0x009C, 0x009D, 0x009E, 0x009F, - 0x00A0, 0x00A1, 0x00A2, 0x00A3, 0x20AC, 0x00A5, 0x0160, 0x00A7, - 0x0161, 0x00A9, 0x00AA, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x00AF, - 0x00B0, 0x00B1, 0x00B2, 0x00B3, 0x017D, 0x00B5, 0x00B6, 0x00B7, - 0x017E, 0x00B9, 0x00BA, 0x00BB, 0x0152, 0x0153, 0x0178, 0x00BF, - 0x00C0, 0x00C1, 0x00C2, 0x00C3, 0x00C4, 0x00C5, 0x00C6, 0x00C7, - 0x00C8, 0x00C9, 0x00CA, 0x00CB, 0x00CC, 0x00CD, 0x00CE, 0x00CF, - 0x00D0, 0x00D1, 0x00D2, 0x00D3, 0x00D4, 0x00D5, 0x00D6, 0x00D7, - 0x00D8, 0x00D9, 0x00DA, 0x00DB, 0x00DC, 0x00DD, 0x00DE, 0x00DF, - 0x00E0, 0x00E1, 0x00E2, 0x00E3, 0x00E4, 0x00E5, 0x00E6, 0x00E7, - 0x00E8, 0x00E9, 0x00EA, 0x00EB, 0x00EC, 0x00ED, 0x00EE, 0x00EF, - 0x00F0, 0x00F1, 0x00F2, 0x00F3, 0x00F4, 0x00F5, 0x00F6, 0x00F7, - 0x00F8, 0x00F9, 0x00FA, 0x00FB, 0x00FC, 0x00FD, 0x00FE, 0x00FF - }; - - -/* - * ISO8859_2 to Unicode recoding table - * based on file mappings/8859-2.TXT by Unicode Consortium - */ - -static const wxUint16 encoding_table__ISO8859_2[128] = { - 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, - 0x0088, 0x0089, 0x008A, 0x008B, 0x008C, 0x008D, 0x008E, 0x008F, - 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, - 0x0098, 0x0099, 0x009A, 0x009B, 0x009C, 0x009D, 0x009E, 0x009F, - 0x00A0, 0x0104, 0x02D8, 0x0141, 0x00A4, 0x013D, 0x015A, 0x00A7, - 0x00A8, 0x0160, 0x015E, 0x0164, 0x0179, 0x00AD, 0x017D, 0x017B, - 0x00B0, 0x0105, 0x02DB, 0x0142, 0x00B4, 0x013E, 0x015B, 0x02C7, - 0x00B8, 0x0161, 0x015F, 0x0165, 0x017A, 0x02DD, 0x017E, 0x017C, - 0x0154, 0x00C1, 0x00C2, 0x0102, 0x00C4, 0x0139, 0x0106, 0x00C7, - 0x010C, 0x00C9, 0x0118, 0x00CB, 0x011A, 0x00CD, 0x00CE, 0x010E, - 0x0110, 0x0143, 0x0147, 0x00D3, 0x00D4, 0x0150, 0x00D6, 0x00D7, - 0x0158, 0x016E, 0x00DA, 0x0170, 0x00DC, 0x00DD, 0x0162, 0x00DF, - 0x0155, 0x00E1, 0x00E2, 0x0103, 0x00E4, 0x013A, 0x0107, 0x00E7, - 0x010D, 0x00E9, 0x0119, 0x00EB, 0x011B, 0x00ED, 0x00EE, 0x010F, - 0x0111, 0x0144, 0x0148, 0x00F3, 0x00F4, 0x0151, 0x00F6, 0x00F7, - 0x0159, 0x016F, 0x00FA, 0x0171, 0x00FC, 0x00FD, 0x0163, 0x02D9 - }; - - -/* - * ISO8859_3 to Unicode recoding table - * based on file mappings/8859-3.TXT by Unicode Consortium - */ - -static const wxUint16 encoding_table__ISO8859_3[128] = { - 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, - 0x0088, 0x0089, 0x008A, 0x008B, 0x008C, 0x008D, 0x008E, 0x008F, - 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, - 0x0098, 0x0099, 0x009A, 0x009B, 0x009C, 0x009D, 0x009E, 0x009F, - 0x00A0, 0x0126, 0x02D8, 0x00A3, 0x00A4, 0x0000, 0x0124, 0x00A7, - 0x00A8, 0x0130, 0x015E, 0x011E, 0x0134, 0x00AD, 0x0000, 0x017B, - 0x00B0, 0x0127, 0x00B2, 0x00B3, 0x00B4, 0x00B5, 0x0125, 0x00B7, - 0x00B8, 0x0131, 0x015F, 0x011F, 0x0135, 0x00BD, 0x0000, 0x017C, - 0x00C0, 0x00C1, 0x00C2, 0x0000, 0x00C4, 0x010A, 0x0108, 0x00C7, - 0x00C8, 0x00C9, 0x00CA, 0x00CB, 0x00CC, 0x00CD, 0x00CE, 0x00CF, - 0x0000, 0x00D1, 0x00D2, 0x00D3, 0x00D4, 0x0120, 0x00D6, 0x00D7, - 0x011C, 0x00D9, 0x00DA, 0x00DB, 0x00DC, 0x016C, 0x015C, 0x00DF, - 0x00E0, 0x00E1, 0x00E2, 0x0000, 0x00E4, 0x010B, 0x0109, 0x00E7, - 0x00E8, 0x00E9, 0x00EA, 0x00EB, 0x00EC, 0x00ED, 0x00EE, 0x00EF, - 0x0000, 0x00F1, 0x00F2, 0x00F3, 0x00F4, 0x0121, 0x00F6, 0x00F7, - 0x011D, 0x00F9, 0x00FA, 0x00FB, 0x00FC, 0x016D, 0x015D, 0x02D9 - }; - - -/* - * ISO8859_4 to Unicode recoding table - * based on file mappings/8859-4.TXT by Unicode Consortium - */ - -static const wxUint16 encoding_table__ISO8859_4[128] = { - 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, - 0x0088, 0x0089, 0x008A, 0x008B, 0x008C, 0x008D, 0x008E, 0x008F, - 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, - 0x0098, 0x0099, 0x009A, 0x009B, 0x009C, 0x009D, 0x009E, 0x009F, - 0x00A0, 0x0104, 0x0138, 0x0156, 0x00A4, 0x0128, 0x013B, 0x00A7, - 0x00A8, 0x0160, 0x0112, 0x0122, 0x0166, 0x00AD, 0x017D, 0x00AF, - 0x00B0, 0x0105, 0x02DB, 0x0157, 0x00B4, 0x0129, 0x013C, 0x02C7, - 0x00B8, 0x0161, 0x0113, 0x0123, 0x0167, 0x014A, 0x017E, 0x014B, - 0x0100, 0x00C1, 0x00C2, 0x00C3, 0x00C4, 0x00C5, 0x00C6, 0x012E, - 0x010C, 0x00C9, 0x0118, 0x00CB, 0x0116, 0x00CD, 0x00CE, 0x012A, - 0x0110, 0x0145, 0x014C, 0x0136, 0x00D4, 0x00D5, 0x00D6, 0x00D7, - 0x00D8, 0x0172, 0x00DA, 0x00DB, 0x00DC, 0x0168, 0x016A, 0x00DF, - 0x0101, 0x00E1, 0x00E2, 0x00E3, 0x00E4, 0x00E5, 0x00E6, 0x012F, - 0x010D, 0x00E9, 0x0119, 0x00EB, 0x0117, 0x00ED, 0x00EE, 0x012B, - 0x0111, 0x0146, 0x014D, 0x0137, 0x00F4, 0x00F5, 0x00F6, 0x00F7, - 0x00F8, 0x0173, 0x00FA, 0x00FB, 0x00FC, 0x0169, 0x016B, 0x02D9 - }; - - -/* - * ISO8859_5 to Unicode recoding table - * based on file mappings/8859-5.TXT by Unicode Consortium - */ - -static const wxUint16 encoding_table__ISO8859_5[128] = { - 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, - 0x0088, 0x0089, 0x008A, 0x008B, 0x008C, 0x008D, 0x008E, 0x008F, - 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, - 0x0098, 0x0099, 0x009A, 0x009B, 0x009C, 0x009D, 0x009E, 0x009F, - 0x00A0, 0x0401, 0x0402, 0x0403, 0x0404, 0x0405, 0x0406, 0x0407, - 0x0408, 0x0409, 0x040A, 0x040B, 0x040C, 0x00AD, 0x040E, 0x040F, - 0x0410, 0x0411, 0x0412, 0x0413, 0x0414, 0x0415, 0x0416, 0x0417, - 0x0418, 0x0419, 0x041A, 0x041B, 0x041C, 0x041D, 0x041E, 0x041F, - 0x0420, 0x0421, 0x0422, 0x0423, 0x0424, 0x0425, 0x0426, 0x0427, - 0x0428, 0x0429, 0x042A, 0x042B, 0x042C, 0x042D, 0x042E, 0x042F, - 0x0430, 0x0431, 0x0432, 0x0433, 0x0434, 0x0435, 0x0436, 0x0437, - 0x0438, 0x0439, 0x043A, 0x043B, 0x043C, 0x043D, 0x043E, 0x043F, - 0x0440, 0x0441, 0x0442, 0x0443, 0x0444, 0x0445, 0x0446, 0x0447, - 0x0448, 0x0449, 0x044A, 0x044B, 0x044C, 0x044D, 0x044E, 0x044F, - 0x2116, 0x0451, 0x0452, 0x0453, 0x0454, 0x0455, 0x0456, 0x0457, - 0x0458, 0x0459, 0x045A, 0x045B, 0x045C, 0x00A7, 0x045E, 0x045F - }; - - -/* - * ISO8859_6 to Unicode recoding table - * based on file mappings/8859-6.TXT by Unicode Consortium - */ - -static const wxUint16 encoding_table__ISO8859_6[128] = { - 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, - 0x0088, 0x0089, 0x008A, 0x008B, 0x008C, 0x008D, 0x008E, 0x008F, - 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, - 0x0098, 0x0099, 0x009A, 0x009B, 0x009C, 0x009D, 0x009E, 0x009F, - 0x00A0, 0x0000, 0x0000, 0x0000, 0x00A4, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x060C, 0x00AD, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x061B, 0x0000, 0x0000, 0x0000, 0x061F, - 0x0000, 0x0621, 0x0622, 0x0623, 0x0624, 0x0625, 0x0626, 0x0627, - 0x0628, 0x0629, 0x062A, 0x062B, 0x062C, 0x062D, 0x062E, 0x062F, - 0x0630, 0x0631, 0x0632, 0x0633, 0x0634, 0x0635, 0x0636, 0x0637, - 0x0638, 0x0639, 0x063A, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0640, 0x0641, 0x0642, 0x0643, 0x0644, 0x0645, 0x0646, 0x0647, - 0x0648, 0x0649, 0x064A, 0x064B, 0x064C, 0x064D, 0x064E, 0x064F, - 0x0650, 0x0651, 0x0652, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000 - }; - - -/* - * ISO8859_7 to Unicode recoding table - * based on file mappings/8859-7.TXT by Unicode Consortium - */ - -static const wxUint16 encoding_table__ISO8859_7[128] = { - 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, - 0x0088, 0x0089, 0x008A, 0x008B, 0x008C, 0x008D, 0x008E, 0x008F, - 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, - 0x0098, 0x0099, 0x009A, 0x009B, 0x009C, 0x009D, 0x009E, 0x009F, - 0x00A0, 0x2018, 0x2019, 0x00A3, 0x0000, 0x0000, 0x00A6, 0x00A7, - 0x00A8, 0x00A9, 0x0000, 0x00AB, 0x00AC, 0x00AD, 0x0000, 0x2015, - 0x00B0, 0x00B1, 0x00B2, 0x00B3, 0x0384, 0x0385, 0x0386, 0x00B7, - 0x0388, 0x0389, 0x038A, 0x00BB, 0x038C, 0x00BD, 0x038E, 0x038F, - 0x0390, 0x0391, 0x0392, 0x0393, 0x0394, 0x0395, 0x0396, 0x0397, - 0x0398, 0x0399, 0x039A, 0x039B, 0x039C, 0x039D, 0x039E, 0x039F, - 0x03A0, 0x03A1, 0x0000, 0x03A3, 0x03A4, 0x03A5, 0x03A6, 0x03A7, - 0x03A8, 0x03A9, 0x03AA, 0x03AB, 0x03AC, 0x03AD, 0x03AE, 0x03AF, - 0x03B0, 0x03B1, 0x03B2, 0x03B3, 0x03B4, 0x03B5, 0x03B6, 0x03B7, - 0x03B8, 0x03B9, 0x03BA, 0x03BB, 0x03BC, 0x03BD, 0x03BE, 0x03BF, - 0x03C0, 0x03C1, 0x03C2, 0x03C3, 0x03C4, 0x03C5, 0x03C6, 0x03C7, - 0x03C8, 0x03C9, 0x03CA, 0x03CB, 0x03CC, 0x03CD, 0x03CE, 0x0000 - }; - - -/* - * ISO8859_8 to Unicode recoding table - * based on file mappings/8859-8.TXT by Unicode Consortium - */ - -static const wxUint16 encoding_table__ISO8859_8[128] = { - 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, - 0x0088, 0x0089, 0x008A, 0x008B, 0x008C, 0x008D, 0x008E, 0x008F, - 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, - 0x0098, 0x0099, 0x009A, 0x009B, 0x009C, 0x009D, 0x009E, 0x009F, - 0x00A0, 0x0000, 0x00A2, 0x00A3, 0x00A4, 0x00A5, 0x00A6, 0x00A7, - 0x00A8, 0x00A9, 0x00D7, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x203E, - 0x00B0, 0x00B1, 0x00B2, 0x00B3, 0x00B4, 0x00B5, 0x00B6, 0x00B7, - 0x00B8, 0x00B9, 0x00F7, 0x00BB, 0x00BC, 0x00BD, 0x00BE, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x2017, - 0x05D0, 0x05D1, 0x05D2, 0x05D3, 0x05D4, 0x05D5, 0x05D6, 0x05D7, - 0x05D8, 0x05D9, 0x05DA, 0x05DB, 0x05DC, 0x05DD, 0x05DE, 0x05DF, - 0x05E0, 0x05E1, 0x05E2, 0x05E3, 0x05E4, 0x05E5, 0x05E6, 0x05E7, - 0x05E8, 0x05E9, 0x05EA, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000 - }; - - -/* - * ISO8859_9 to Unicode recoding table - * based on file mappings/8859-9.TXT by Unicode Consortium - */ - -static const wxUint16 encoding_table__ISO8859_9[128] = { - 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, - 0x0088, 0x0089, 0x008A, 0x008B, 0x008C, 0x008D, 0x008E, 0x008F, - 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, - 0x0098, 0x0099, 0x009A, 0x009B, 0x009C, 0x009D, 0x009E, 0x009F, - 0x00A0, 0x00A1, 0x00A2, 0x00A3, 0x00A4, 0x00A5, 0x00A6, 0x00A7, - 0x00A8, 0x00A9, 0x00AA, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x00AF, - 0x00B0, 0x00B1, 0x00B2, 0x00B3, 0x00B4, 0x00B5, 0x00B6, 0x00B7, - 0x00B8, 0x00B9, 0x00BA, 0x00BB, 0x00BC, 0x00BD, 0x00BE, 0x00BF, - 0x00C0, 0x00C1, 0x00C2, 0x00C3, 0x00C4, 0x00C5, 0x00C6, 0x00C7, - 0x00C8, 0x00C9, 0x00CA, 0x00CB, 0x00CC, 0x00CD, 0x00CE, 0x00CF, - 0x011E, 0x00D1, 0x00D2, 0x00D3, 0x00D4, 0x00D5, 0x00D6, 0x00D7, - 0x00D8, 0x00D9, 0x00DA, 0x00DB, 0x00DC, 0x0130, 0x015E, 0x00DF, - 0x00E0, 0x00E1, 0x00E2, 0x00E3, 0x00E4, 0x00E5, 0x00E6, 0x00E7, - 0x00E8, 0x00E9, 0x00EA, 0x00EB, 0x00EC, 0x00ED, 0x00EE, 0x00EF, - 0x011F, 0x00F1, 0x00F2, 0x00F3, 0x00F4, 0x00F5, 0x00F6, 0x00F7, - 0x00F8, 0x00F9, 0x00FA, 0x00FB, 0x00FC, 0x0131, 0x015F, 0x00FF - }; - - -/* - * CP1250 to Unicode recoding table - * based on file mappings/CP1250.TXT by Unicode Consortium - */ - -static const wxUint16 encoding_table__CP1250[128] = { - 0x20AC, 0x0000, 0x201A, 0x0000, 0x201E, 0x2026, 0x2020, 0x2021, - 0x0000, 0x2030, 0x0160, 0x2039, 0x015A, 0x0164, 0x017D, 0x0179, - 0x0000, 0x2018, 0x2019, 0x201C, 0x201D, 0x2022, 0x2013, 0x2014, - 0x0000, 0x2122, 0x0161, 0x203A, 0x015B, 0x0165, 0x017E, 0x017A, - 0x00A0, 0x02C7, 0x02D8, 0x0141, 0x00A4, 0x0104, 0x00A6, 0x00A7, - 0x00A8, 0x00A9, 0x015E, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x017B, - 0x00B0, 0x00B1, 0x02DB, 0x0142, 0x00B4, 0x00B5, 0x00B6, 0x00B7, - 0x00B8, 0x0105, 0x015F, 0x00BB, 0x013D, 0x02DD, 0x013E, 0x017C, - 0x0154, 0x00C1, 0x00C2, 0x0102, 0x00C4, 0x0139, 0x0106, 0x00C7, - 0x010C, 0x00C9, 0x0118, 0x00CB, 0x011A, 0x00CD, 0x00CE, 0x010E, - 0x0110, 0x0143, 0x0147, 0x00D3, 0x00D4, 0x0150, 0x00D6, 0x00D7, - 0x0158, 0x016E, 0x00DA, 0x0170, 0x00DC, 0x00DD, 0x0162, 0x00DF, - 0x0155, 0x00E1, 0x00E2, 0x0103, 0x00E4, 0x013A, 0x0107, 0x00E7, - 0x010D, 0x00E9, 0x0119, 0x00EB, 0x011B, 0x00ED, 0x00EE, 0x010F, - 0x0111, 0x0144, 0x0148, 0x00F3, 0x00F4, 0x0151, 0x00F6, 0x00F7, - 0x0159, 0x016F, 0x00FA, 0x0171, 0x00FC, 0x00FD, 0x0163, 0x02D9 - }; - - -/* - * CP1251 to Unicode recoding table - * based on file mappings/CP1251.TXT by Unicode Consortium - */ - -static const wxUint16 encoding_table__CP1251[128] = { - 0x0402, 0x0403, 0x201A, 0x0453, 0x201E, 0x2026, 0x2020, 0x2021, - 0x20AC, 0x2030, 0x0409, 0x2039, 0x040A, 0x040C, 0x040B, 0x040F, - 0x0452, 0x2018, 0x2019, 0x201C, 0x201D, 0x2022, 0x2013, 0x2014, - 0x0000, 0x2122, 0x0459, 0x203A, 0x045A, 0x045C, 0x045B, 0x045F, - 0x00A0, 0x040E, 0x045E, 0x0408, 0x00A4, 0x0490, 0x00A6, 0x00A7, - 0x0401, 0x00A9, 0x0404, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x0407, - 0x00B0, 0x00B1, 0x0406, 0x0456, 0x0491, 0x00B5, 0x00B6, 0x00B7, - 0x0451, 0x2116, 0x0454, 0x00BB, 0x0458, 0x0405, 0x0455, 0x0457, - 0x0410, 0x0411, 0x0412, 0x0413, 0x0414, 0x0415, 0x0416, 0x0417, - 0x0418, 0x0419, 0x041A, 0x041B, 0x041C, 0x041D, 0x041E, 0x041F, - 0x0420, 0x0421, 0x0422, 0x0423, 0x0424, 0x0425, 0x0426, 0x0427, - 0x0428, 0x0429, 0x042A, 0x042B, 0x042C, 0x042D, 0x042E, 0x042F, - 0x0430, 0x0431, 0x0432, 0x0433, 0x0434, 0x0435, 0x0436, 0x0437, - 0x0438, 0x0439, 0x043A, 0x043B, 0x043C, 0x043D, 0x043E, 0x043F, - 0x0440, 0x0441, 0x0442, 0x0443, 0x0444, 0x0445, 0x0446, 0x0447, - 0x0448, 0x0449, 0x044A, 0x044B, 0x044C, 0x044D, 0x044E, 0x044F - }; - - -/* - * CP1252 to Unicode recoding table - * based on file mappings/CP1252.TXT by Unicode Consortium - */ - -static const wxUint16 encoding_table__CP1252[128] = { - 0x20AC, 0x0000, 0x201A, 0x0192, 0x201E, 0x2026, 0x2020, 0x2021, - 0x02C6, 0x2030, 0x0160, 0x2039, 0x0152, 0x0000, 0x017D, 0x0000, - 0x0000, 0x2018, 0x2019, 0x201C, 0x201D, 0x2022, 0x2013, 0x2014, - 0x02DC, 0x2122, 0x0161, 0x203A, 0x0153, 0x0000, 0x017E, 0x0178, - 0x00A0, 0x00A1, 0x00A2, 0x00A3, 0x00A4, 0x00A5, 0x00A6, 0x00A7, - 0x00A8, 0x00A9, 0x00AA, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x00AF, - 0x00B0, 0x00B1, 0x00B2, 0x00B3, 0x00B4, 0x00B5, 0x00B6, 0x00B7, - 0x00B8, 0x00B9, 0x00BA, 0x00BB, 0x00BC, 0x00BD, 0x00BE, 0x00BF, - 0x00C0, 0x00C1, 0x00C2, 0x00C3, 0x00C4, 0x00C5, 0x00C6, 0x00C7, - 0x00C8, 0x00C9, 0x00CA, 0x00CB, 0x00CC, 0x00CD, 0x00CE, 0x00CF, - 0x00D0, 0x00D1, 0x00D2, 0x00D3, 0x00D4, 0x00D5, 0x00D6, 0x00D7, - 0x00D8, 0x00D9, 0x00DA, 0x00DB, 0x00DC, 0x00DD, 0x00DE, 0x00DF, - 0x00E0, 0x00E1, 0x00E2, 0x00E3, 0x00E4, 0x00E5, 0x00E6, 0x00E7, - 0x00E8, 0x00E9, 0x00EA, 0x00EB, 0x00EC, 0x00ED, 0x00EE, 0x00EF, - 0x00F0, 0x00F1, 0x00F2, 0x00F3, 0x00F4, 0x00F5, 0x00F6, 0x00F7, - 0x00F8, 0x00F9, 0x00FA, 0x00FB, 0x00FC, 0x00FD, 0x00FE, 0x00FF - }; - - -/* - * CP1253 to Unicode recoding table - * based on file mappings/CP1253.TXT by Unicode Consortium - */ - -static const wxUint16 encoding_table__CP1253[128] = { - 0x20AC, 0x0000, 0x201A, 0x0192, 0x201E, 0x2026, 0x2020, 0x2021, - 0x0000, 0x2030, 0x0000, 0x2039, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x2018, 0x2019, 0x201C, 0x201D, 0x2022, 0x2013, 0x2014, - 0x0000, 0x2122, 0x0000, 0x203A, 0x0000, 0x0000, 0x0000, 0x0000, - 0x00A0, 0x0385, 0x0386, 0x00A3, 0x00A4, 0x00A5, 0x00A6, 0x00A7, - 0x00A8, 0x00A9, 0x0000, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x2015, - 0x00B0, 0x00B1, 0x00B2, 0x00B3, 0x0384, 0x00B5, 0x00B6, 0x00B7, - 0x0388, 0x0389, 0x038A, 0x00BB, 0x038C, 0x00BD, 0x038E, 0x038F, - 0x0390, 0x0391, 0x0392, 0x0393, 0x0394, 0x0395, 0x0396, 0x0397, - 0x0398, 0x0399, 0x039A, 0x039B, 0x039C, 0x039D, 0x039E, 0x039F, - 0x03A0, 0x03A1, 0x0000, 0x03A3, 0x03A4, 0x03A5, 0x03A6, 0x03A7, - 0x03A8, 0x03A9, 0x03AA, 0x03AB, 0x03AC, 0x03AD, 0x03AE, 0x03AF, - 0x03B0, 0x03B1, 0x03B2, 0x03B3, 0x03B4, 0x03B5, 0x03B6, 0x03B7, - 0x03B8, 0x03B9, 0x03BA, 0x03BB, 0x03BC, 0x03BD, 0x03BE, 0x03BF, - 0x03C0, 0x03C1, 0x03C2, 0x03C3, 0x03C4, 0x03C5, 0x03C6, 0x03C7, - 0x03C8, 0x03C9, 0x03CA, 0x03CB, 0x03CC, 0x03CD, 0x03CE, 0x0000 - }; - - -/* - * CP1254 to Unicode recoding table - * based on file mappings/CP1254.TXT by Unicode Consortium - */ - -static const wxUint16 encoding_table__CP1254[128] = { - 0x20AC, 0x0000, 0x201A, 0x0192, 0x201E, 0x2026, 0x2020, 0x2021, - 0x02C6, 0x2030, 0x0160, 0x2039, 0x0152, 0x0000, 0x0000, 0x0000, - 0x0000, 0x2018, 0x2019, 0x201C, 0x201D, 0x2022, 0x2013, 0x2014, - 0x02DC, 0x2122, 0x0161, 0x203A, 0x0153, 0x0000, 0x0000, 0x0178, - 0x00A0, 0x00A1, 0x00A2, 0x00A3, 0x00A4, 0x00A5, 0x00A6, 0x00A7, - 0x00A8, 0x00A9, 0x00AA, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x00AF, - 0x00B0, 0x00B1, 0x00B2, 0x00B3, 0x00B4, 0x00B5, 0x00B6, 0x00B7, - 0x00B8, 0x00B9, 0x00BA, 0x00BB, 0x00BC, 0x00BD, 0x00BE, 0x00BF, - 0x00C0, 0x00C1, 0x00C2, 0x00C3, 0x00C4, 0x00C5, 0x00C6, 0x00C7, - 0x00C8, 0x00C9, 0x00CA, 0x00CB, 0x00CC, 0x00CD, 0x00CE, 0x00CF, - 0x011E, 0x00D1, 0x00D2, 0x00D3, 0x00D4, 0x00D5, 0x00D6, 0x00D7, - 0x00D8, 0x00D9, 0x00DA, 0x00DB, 0x00DC, 0x0130, 0x015E, 0x00DF, - 0x00E0, 0x00E1, 0x00E2, 0x00E3, 0x00E4, 0x00E5, 0x00E6, 0x00E7, - 0x00E8, 0x00E9, 0x00EA, 0x00EB, 0x00EC, 0x00ED, 0x00EE, 0x00EF, - 0x011F, 0x00F1, 0x00F2, 0x00F3, 0x00F4, 0x00F5, 0x00F6, 0x00F7, - 0x00F8, 0x00F9, 0x00FA, 0x00FB, 0x00FC, 0x0131, 0x015F, 0x00FF - }; - - -/* - * CP1255 to Unicode recoding table - * based on file mappings/CP1255.TXT by Unicode Consortium - */ - -static const wxUint16 encoding_table__CP1255[128] = { - 0x20AC, 0x0000, 0x201A, 0x0192, 0x201E, 0x2026, 0x2020, 0x2021, - 0x02C6, 0x2030, 0x0000, 0x2039, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x2018, 0x2019, 0x201C, 0x201D, 0x2022, 0x2013, 0x2014, - 0x02DC, 0x2122, 0x0000, 0x203A, 0x0000, 0x0000, 0x0000, 0x0000, - 0x00A0, 0x00A1, 0x00A2, 0x00A3, 0x20AA, 0x00A5, 0x00A6, 0x00A7, - 0x00A8, 0x00A9, 0x00D7, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x00AF, - 0x00B0, 0x00B1, 0x00B2, 0x00B3, 0x00B4, 0x00B5, 0x00B6, 0x00B7, - 0x00B8, 0x00B9, 0x00F7, 0x00BB, 0x00BC, 0x00BD, 0x00BE, 0x00BF, - 0x05B0, 0x05B1, 0x05B2, 0x05B3, 0x05B4, 0x05B5, 0x05B6, 0x05B7, - 0x05B8, 0x05B9, 0x0000, 0x05BB, 0x05BC, 0x05BD, 0x05BE, 0x05BF, - 0x05C0, 0x05C1, 0x05C2, 0x05C3, 0x05F0, 0x05F1, 0x05F2, 0x05F3, - 0x05F4, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x05D0, 0x05D1, 0x05D2, 0x05D3, 0x05D4, 0x05D5, 0x05D6, 0x05D7, - 0x05D8, 0x05D9, 0x05DA, 0x05DB, 0x05DC, 0x05DD, 0x05DE, 0x05DF, - 0x05E0, 0x05E1, 0x05E2, 0x05E3, 0x05E4, 0x05E5, 0x05E6, 0x05E7, - 0x05E8, 0x05E9, 0x05EA, 0x0000, 0x0000, 0x200E, 0x200F, 0x0000 - }; - - -/* - * CP1256 to Unicode recoding table - * based on file mappings/CP1256.TXT by Unicode Consortium - */ - -static const wxUint16 encoding_table__CP1256[128] = { - 0x20AC, 0x067E, 0x201A, 0x0192, 0x201E, 0x2026, 0x2020, 0x2021, - 0x02C6, 0x2030, 0x0679, 0x2039, 0x0152, 0x0686, 0x0698, 0x0688, - 0x06AF, 0x2018, 0x2019, 0x201C, 0x201D, 0x2022, 0x2013, 0x2014, - 0x06A9, 0x2122, 0x0691, 0x203A, 0x0153, 0x200C, 0x200D, 0x06BA, - 0x00A0, 0x060C, 0x00A2, 0x00A3, 0x00A4, 0x00A5, 0x00A6, 0x00A7, - 0x00A8, 0x00A9, 0x06BE, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x00AF, - 0x00B0, 0x00B1, 0x00B2, 0x00B3, 0x00B4, 0x00B5, 0x00B6, 0x00B7, - 0x00B8, 0x00B9, 0x061B, 0x00BB, 0x00BC, 0x00BD, 0x00BE, 0x061F, - 0x06C1, 0x0621, 0x0622, 0x0623, 0x0624, 0x0625, 0x0626, 0x0627, - 0x0628, 0x0629, 0x062A, 0x062B, 0x062C, 0x062D, 0x062E, 0x062F, - 0x0630, 0x0631, 0x0632, 0x0633, 0x0634, 0x0635, 0x0636, 0x00D7, - 0x0637, 0x0638, 0x0639, 0x063A, 0x0640, 0x0641, 0x0642, 0x0643, - 0x00E0, 0x0644, 0x00E2, 0x0645, 0x0646, 0x0647, 0x0648, 0x00E7, - 0x00E8, 0x00E9, 0x00EA, 0x00EB, 0x0649, 0x064A, 0x00EE, 0x00EF, - 0x064B, 0x064C, 0x064D, 0x064E, 0x00F4, 0x064F, 0x0650, 0x00F7, - 0x0651, 0x00F9, 0x0652, 0x00FB, 0x00FC, 0x200E, 0x200F, 0x06D2 - }; - - -/* - * CP1257 to Unicode recoding table - * based on file mappings/CP1257.TXT by Unicode Consortium - */ - -static const wxUint16 encoding_table__CP1257[128] = { - 0x20AC, 0x0000, 0x201A, 0x0000, 0x201E, 0x2026, 0x2020, 0x2021, - 0x0000, 0x2030, 0x0000, 0x2039, 0x0000, 0x00A8, 0x02C7, 0x00B8, - 0x0000, 0x2018, 0x2019, 0x201C, 0x201D, 0x2022, 0x2013, 0x2014, - 0x0000, 0x2122, 0x0000, 0x203A, 0x0000, 0x00AF, 0x02DB, 0x0000, - 0x00A0, 0x0000, 0x00A2, 0x00A3, 0x00A4, 0x0000, 0x00A6, 0x00A7, - 0x00D8, 0x00A9, 0x0156, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x00C6, - 0x00B0, 0x00B1, 0x00B2, 0x00B3, 0x00B4, 0x00B5, 0x00B6, 0x00B7, - 0x00F8, 0x00B9, 0x0157, 0x00BB, 0x00BC, 0x00BD, 0x00BE, 0x00E6, - 0x0104, 0x012E, 0x0100, 0x0106, 0x00C4, 0x00C5, 0x0118, 0x0112, - 0x010C, 0x00C9, 0x0179, 0x0116, 0x0122, 0x0136, 0x012A, 0x013B, - 0x0160, 0x0143, 0x0145, 0x00D3, 0x014C, 0x00D5, 0x00D6, 0x00D7, - 0x0172, 0x0141, 0x015A, 0x016A, 0x00DC, 0x017B, 0x017D, 0x00DF, - 0x0105, 0x012F, 0x0101, 0x0107, 0x00E4, 0x00E5, 0x0119, 0x0113, - 0x010D, 0x00E9, 0x017A, 0x0117, 0x0123, 0x0137, 0x012B, 0x013C, - 0x0161, 0x0144, 0x0146, 0x00F3, 0x014D, 0x00F5, 0x00F6, 0x00F7, - 0x0173, 0x0142, 0x015B, 0x016B, 0x00FC, 0x017C, 0x017E, 0x02D9 - }; - - -/* - * KOI8 to Unicode recoding table - * based on file mappings/KOI8-R.TXT by Unicode Consortium - */ - -static const wxUint16 encoding_table__KOI8[128] = { - 0x2500, 0x2502, 0x250C, 0x2510, 0x2514, 0x2518, 0x251C, 0x2524, - 0x252C, 0x2534, 0x253C, 0x2580, 0x2584, 0x2588, 0x258C, 0x2590, - 0x2591, 0x2592, 0x2593, 0x2320, 0x25A0, 0x2219, 0x221A, 0x2248, - 0x2264, 0x2265, 0x00A0, 0x2321, 0x00B0, 0x00B2, 0x00B7, 0x00F7, - 0x2550, 0x2551, 0x2552, 0x0451, 0x2553, 0x2554, 0x2555, 0x2556, - 0x2557, 0x2558, 0x2559, 0x255A, 0x255B, 0x255C, 0x255D, 0x255E, - 0x255F, 0x2560, 0x2561, 0x0401, 0x2562, 0x2563, 0x2564, 0x2565, - 0x2566, 0x2567, 0x2568, 0x2569, 0x256A, 0x256B, 0x256C, 0x00A9, - 0x044E, 0x0430, 0x0431, 0x0446, 0x0434, 0x0435, 0x0444, 0x0433, - 0x0445, 0x0438, 0x0439, 0x043A, 0x043B, 0x043C, 0x043D, 0x043E, - 0x043F, 0x044F, 0x0440, 0x0441, 0x0442, 0x0443, 0x0436, 0x0432, - 0x044C, 0x044B, 0x0437, 0x0448, 0x044D, 0x0449, 0x0447, 0x044A, - 0x042E, 0x0410, 0x0411, 0x0426, 0x0414, 0x0415, 0x0424, 0x0413, - 0x0425, 0x0418, 0x0419, 0x041A, 0x041B, 0x041C, 0x041D, 0x041E, - 0x041F, 0x042F, 0x0420, 0x0421, 0x0422, 0x0423, 0x0416, 0x0412, - 0x042C, 0x042B, 0x0417, 0x0428, 0x042D, 0x0429, 0x0427, 0x042A - }; - - -/* - * KOI8_U to Unicode recoding table - * based on file mappings/KOI8-U.TXT by Unicode Consortium - */ - -static const wxUint16 encoding_table__KOI8_U[128] = { - 0x2500, 0x2502, 0x250C, 0x2510, 0x2514, 0x2518, 0x251C, 0x2524, - 0x252C, 0x2534, 0x253C, 0x2580, 0x2584, 0x2588, 0x258C, 0x2590, - 0x2591, 0x2592, 0x2593, 0x2320, 0x25A0, 0x2219, 0x221A, 0x2248, - 0x2264, 0x2265, 0x00A0, 0x2321, 0x00B0, 0x00B2, 0x00B7, 0x00F7, - 0x2550, 0x2551, 0x2552, 0x0451, 0x0454, 0x2554, 0x0456, 0x0457, - 0x2557, 0x2558, 0x2559, 0x255A, 0x255B, 0x0491, 0x255D, 0x255E, - 0x255F, 0x2560, 0x2561, 0x0401, 0x0403, 0x2563, 0x0406, 0x0407, - 0x2566, 0x2567, 0x2568, 0x2569, 0x256A, 0x0490, 0x256C, 0x00A9, - 0x044E, 0x0430, 0x0431, 0x0446, 0x0434, 0x0435, 0x0444, 0x0433, - 0x0445, 0x0438, 0x0439, 0x043A, 0x043B, 0x043C, 0x043D, 0x043E, - 0x043F, 0x044F, 0x0440, 0x0441, 0x0442, 0x0443, 0x0436, 0x0432, - 0x044C, 0x044B, 0x0437, 0x0448, 0x044D, 0x0449, 0x0447, 0x044A, - 0x042E, 0x0410, 0x0411, 0x0426, 0x0414, 0x0415, 0x0424, 0x0413, - 0x0425, 0x0418, 0x0419, 0x041A, 0x041B, 0x041C, 0x041D, 0x041E, - 0x041F, 0x042F, 0x0420, 0x0421, 0x0422, 0x0423, 0x0416, 0x0412, - 0x042C, 0x042B, 0x0417, 0x0428, 0x042D, 0x0429, 0x0427, 0x042A - }; - - - - - -/* - * - * Unicode to 7bit ASCII fallback - * (for use with wxRECODE_SUBSTITUTE recoding mode) - * - */ - -static const struct { - wxUint16 c /*code*/; - wxUint8 s /*inaccurate substitution*/; -} encoding_unicode_fallback[] = { - - {0x00AB, 0x22}, - {0x00BB, 0x22}, - {0x00C0, 0x41}, - {0x00C1, 0x41}, - {0x00C2, 0x41}, - {0x00C3, 0x41}, - {0x00C4, 0x41}, - {0x00C5, 0x41}, - {0x00C7, 0x43}, - {0x00C8, 0x45}, - {0x00C9, 0x45}, - {0x00CA, 0x45}, - {0x00CB, 0x45}, - {0x00CC, 0x49}, - {0x00CD, 0x49}, - {0x00CE, 0x49}, - {0x00CF, 0x49}, - {0x00D1, 0x4E}, - {0x00D2, 0x4F}, - {0x00D3, 0x4F}, - {0x00D4, 0x4F}, - {0x00D5, 0x4F}, - {0x00D6, 0x4F}, - {0x00D8, 0x4F}, - {0x00D9, 0x55}, - {0x00DA, 0x55}, - {0x00DB, 0x55}, - {0x00DC, 0x55}, - {0x00DD, 0x59}, - {0x00E0, 0x61}, - {0x00E1, 0x61}, - {0x00E2, 0x61}, - {0x00E3, 0x61}, - {0x00E4, 0x61}, - {0x00E5, 0x61}, - {0x00E7, 0x63}, - {0x00E8, 0x65}, - {0x00E9, 0x65}, - {0x00EA, 0x65}, - {0x00EB, 0x65}, - {0x00EC, 0x69}, - {0x00ED, 0x69}, - {0x00EE, 0x69}, - {0x00EF, 0x69}, - {0x00F1, 0x6E}, - {0x00F2, 0x6F}, - {0x00F3, 0x6F}, - {0x00F4, 0x6F}, - {0x00F5, 0x6F}, - {0x00F6, 0x6F}, - {0x00F8, 0x6F}, - {0x00F9, 0x75}, - {0x00FA, 0x75}, - {0x00FB, 0x75}, - {0x00FC, 0x75}, - {0x00FD, 0x79}, - {0x00FF, 0x79}, - {0x0100, 0x41}, - {0x0101, 0x61}, - {0x0102, 0x41}, - {0x0103, 0x61}, - {0x0104, 0x41}, - {0x0105, 0x61}, - {0x0106, 0x43}, - {0x0107, 0x63}, - {0x0108, 0x43}, - {0x0109, 0x63}, - {0x010A, 0x43}, - {0x010B, 0x63}, - {0x010C, 0x43}, - {0x010D, 0x63}, - {0x010E, 0x44}, - {0x010F, 0x64}, - {0x0110, 0x44}, - {0x0111, 0x64}, - {0x0112, 0x45}, - {0x0113, 0x65}, - {0x0116, 0x45}, - {0x0117, 0x65}, - {0x0118, 0x45}, - {0x0119, 0x65}, - {0x011A, 0x45}, - {0x011B, 0x65}, - {0x011C, 0x47}, - {0x011D, 0x67}, - {0x011E, 0x47}, - {0x011F, 0x67}, - {0x0120, 0x47}, - {0x0121, 0x67}, - {0x0122, 0x47}, - {0x0123, 0x67}, - {0x0124, 0x48}, - {0x0125, 0x68}, - {0x0126, 0x48}, - {0x0127, 0x68}, - {0x0128, 0x49}, - {0x0129, 0x69}, - {0x012A, 0x49}, - {0x012B, 0x69}, - {0x012E, 0x49}, - {0x012F, 0x69}, - {0x0130, 0x49}, - {0x0134, 0x4A}, - {0x0135, 0x6A}, - {0x0136, 0x4B}, - {0x0137, 0x6B}, - {0x0139, 0x4C}, - {0x013A, 0x6C}, - {0x013B, 0x4C}, - {0x013C, 0x6C}, - {0x013D, 0x4C}, - {0x013E, 0x6C}, - {0x0141, 0x4C}, - {0x0142, 0x6C}, - {0x0143, 0x4E}, - {0x0144, 0x6E}, - {0x0145, 0x4E}, - {0x0146, 0x6E}, - {0x0147, 0x4E}, - {0x0148, 0x6E}, - {0x014C, 0x4F}, - {0x014D, 0x6F}, - {0x0150, 0x4F}, - {0x0151, 0x6F}, - {0x0154, 0x52}, - {0x0155, 0x72}, - {0x0156, 0x52}, - {0x0157, 0x72}, - {0x0158, 0x52}, - {0x0159, 0x72}, - {0x015A, 0x53}, - {0x015B, 0x73}, - {0x015C, 0x53}, - {0x015D, 0x73}, - {0x015E, 0x53}, - {0x015F, 0x73}, - {0x0160, 0x53}, - {0x0161, 0x73}, - {0x0162, 0x54}, - {0x0163, 0x74}, - {0x0164, 0x54}, - {0x0165, 0x74}, - {0x0166, 0x54}, - {0x0167, 0x74}, - {0x0168, 0x55}, - {0x0169, 0x75}, - {0x016A, 0x55}, - {0x016B, 0x75}, - {0x016C, 0x55}, - {0x016D, 0x75}, - {0x016E, 0x55}, - {0x016F, 0x75}, - {0x0170, 0x55}, - {0x0171, 0x75}, - {0x0172, 0x55}, - {0x0173, 0x75}, - {0x0174, 0x57}, - {0x0175, 0x77}, - {0x0176, 0x59}, - {0x0177, 0x79}, - {0x0178, 0x59}, - {0x0179, 0x5A}, - {0x017A, 0x7A}, - {0x017B, 0x5A}, - {0x017C, 0x7A}, - {0x017D, 0x5A}, - {0x017E, 0x7A}, - {0x0192, 0x66}, - {0x1E02, 0x42}, - {0x1E03, 0x62}, - {0x1E0A, 0x44}, - {0x1E0B, 0x64}, - {0x1E1E, 0x46}, - {0x1E1F, 0x66}, - {0x1E40, 0x4D}, - {0x1E41, 0x6D}, - {0x1E56, 0x50}, - {0x1E57, 0x70}, - {0x1E60, 0x53}, - {0x1E61, 0x73}, - {0x1E6A, 0x54}, - {0x1E6B, 0x74}, - {0x1E80, 0x57}, - {0x1E81, 0x77}, - {0x1E82, 0x57}, - {0x1E83, 0x77}, - {0x1E84, 0x57}, - {0x1E85, 0x77}, - {0x1EF2, 0x59}, - {0x1EF3, 0x79}, - {0x2013, 0x2D}, - {0x2014, 0x2D}, - {0x2018, 0x27}, - {0x2019, 0x27}, - {0x201A, 0x27}, - {0x201C, 0x22}, - {0x201D, 0x22}, - {0x201E, 0x22}, - {0x2039, 0x27}, - {0x203A, 0x27}, - {0, 0} - }; - -static const unsigned encoding_unicode_fallback_count = 200; - - - - -/* - * - * Table of all supported encodings: - * - */ - -static const struct { - wxFontEncoding encoding; // encoding identifier - const wxUint16 *table; // 8bit to unicode table -} encodings_list[] = { - - { wxFONTENCODING_ISO8859_1, encoding_table__ISO8859_1}, - { wxFONTENCODING_ISO8859_10, encoding_table__ISO8859_10}, - { wxFONTENCODING_ISO8859_13, encoding_table__ISO8859_13}, - { wxFONTENCODING_ISO8859_14, encoding_table__ISO8859_14}, - { wxFONTENCODING_ISO8859_15, encoding_table__ISO8859_15}, - { wxFONTENCODING_ISO8859_2, encoding_table__ISO8859_2}, - { wxFONTENCODING_ISO8859_3, encoding_table__ISO8859_3}, - { wxFONTENCODING_ISO8859_4, encoding_table__ISO8859_4}, - { wxFONTENCODING_ISO8859_5, encoding_table__ISO8859_5}, - { wxFONTENCODING_ISO8859_6, encoding_table__ISO8859_6}, - { wxFONTENCODING_ISO8859_7, encoding_table__ISO8859_7}, - { wxFONTENCODING_ISO8859_8, encoding_table__ISO8859_8}, - { wxFONTENCODING_ISO8859_9, encoding_table__ISO8859_9}, - { wxFONTENCODING_CP1250, encoding_table__CP1250}, - { wxFONTENCODING_CP1251, encoding_table__CP1251}, - { wxFONTENCODING_CP1252, encoding_table__CP1252}, - { wxFONTENCODING_CP1253, encoding_table__CP1253}, - { wxFONTENCODING_CP1254, encoding_table__CP1254}, - { wxFONTENCODING_CP1255, encoding_table__CP1255}, - { wxFONTENCODING_CP1256, encoding_table__CP1256}, - { wxFONTENCODING_CP1257, encoding_table__CP1257}, - { wxFONTENCODING_KOI8, encoding_table__KOI8}, - { wxFONTENCODING_KOI8_U, encoding_table__KOI8_U}, - {wxFONTENCODING_MAX /*anything*/, NULL} - }; diff --git a/wxWidgets/src/common/uri.cpp b/wxWidgets/src/common/uri.cpp deleted file mode 100644 index 9ff50a0cc4..0000000000 --- a/wxWidgets/src/common/uri.cpp +++ /dev/null @@ -1,1295 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: uri.cpp -// Purpose: Implementation of a uri parser -// Author: Ryan Norton -// Created: 10/26/04 -// RCS-ID: $Id: uri.cpp 58728 2009-02-07 22:03:30Z VZ $ -// Copyright: (c) 2004 Ryan Norton -// Licence: wxWindows -///////////////////////////////////////////////////////////////////////////// - -// =========================================================================== -// declarations -// =========================================================================== - -// --------------------------------------------------------------------------- -// headers -// --------------------------------------------------------------------------- - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#include "wx/uri.h" - -// --------------------------------------------------------------------------- -// definitions -// --------------------------------------------------------------------------- - -IMPLEMENT_CLASS(wxURI, wxObject) - -// =========================================================================== -// implementation -// =========================================================================== - -// --------------------------------------------------------------------------- -// utilities -// --------------------------------------------------------------------------- - -// --------------------------------------------------------------------------- -// -// wxURI -// -// --------------------------------------------------------------------------- - -// --------------------------------------------------------------------------- -// Constructors -// --------------------------------------------------------------------------- - -wxURI::wxURI() : m_hostType(wxURI_REGNAME), m_fields(0) -{ -} - -wxURI::wxURI(const wxString& uri) : m_hostType(wxURI_REGNAME), m_fields(0) -{ - Create(uri); -} - -wxURI::wxURI(const wxURI& uri) : wxObject(), m_hostType(wxURI_REGNAME), m_fields(0) -{ - Assign(uri); -} - -// --------------------------------------------------------------------------- -// Destructor and cleanup -// --------------------------------------------------------------------------- - -wxURI::~wxURI() -{ - Clear(); -} - -void wxURI::Clear() -{ - m_scheme = m_userinfo = m_server = m_port = m_path = - m_query = m_fragment = wxEmptyString; - - m_hostType = wxURI_REGNAME; - - m_fields = 0; -} - -// --------------------------------------------------------------------------- -// Create -// -// This creates the URI - all we do here is call the main parsing method -// --------------------------------------------------------------------------- - -const wxChar* wxURI::Create(const wxString& uri) -{ - if (m_fields) - Clear(); - - return Parse(uri); -} - -// --------------------------------------------------------------------------- -// Escape Methods -// -// TranslateEscape unencodes a 3 character URL escape sequence -// -// Escape encodes an invalid URI character into a 3 character sequence -// -// IsEscape determines if the input string contains an escape sequence, -// if it does, then it moves the input string past the escape sequence -// -// Unescape unencodes all 3 character URL escape sequences in a wxString -// --------------------------------------------------------------------------- - -wxChar wxURI::TranslateEscape(const wxChar* s) -{ - wxASSERT_MSG( IsHex(s[0]) && IsHex(s[1]), wxT("Invalid escape sequence!")); - - return wx_truncate_cast(wxChar, (CharToHex(s[0]) << 4 ) | CharToHex(s[1])); -} - -wxString wxURI::Unescape(const wxString& uri) -{ - wxString new_uri; - - for(size_t i = 0; i < uri.length(); ++i) - { - if (uri[i] == wxT('%')) - { - new_uri += wxURI::TranslateEscape( &(uri.c_str()[i+1]) ); - i += 2; - } - else - new_uri += uri[i]; - } - - return new_uri; -} - -void wxURI::Escape(wxString& s, const wxChar& c) -{ - const wxChar* hdig = wxT("0123456789abcdef"); - s += wxT('%'); - s += hdig[(c >> 4) & 15]; - s += hdig[c & 15]; -} - -bool wxURI::IsEscape(const wxChar*& uri) -{ - // pct-encoded = "%" HEXDIG HEXDIG - if(*uri == wxT('%') && IsHex(*(uri+1)) && IsHex(*(uri+2))) - return true; - else - return false; -} - -// --------------------------------------------------------------------------- -// GetUser -// GetPassword -// -// Gets the username and password via the old URL method. -// --------------------------------------------------------------------------- -wxString wxURI::GetUser() const -{ - // if there is no colon at all, find() returns npos and this method returns - // the entire string which is correct as it means that password was omitted - return m_userinfo(0, m_userinfo.find(':')); -} - -wxString wxURI::GetPassword() const -{ - size_t posColon = m_userinfo.find(':'); - - if ( posColon == wxString::npos ) - return wxT(""); - - return m_userinfo(posColon + 1, wxString::npos); -} - -// --------------------------------------------------------------------------- -// BuildURI -// -// BuildURI() builds the entire URI into a useable -// representation, including proper identification characters such as slashes -// -// BuildUnescapedURI() does the same thing as BuildURI(), only it unescapes -// the components that accept escape sequences -// --------------------------------------------------------------------------- - -wxString wxURI::BuildURI() const -{ - wxString ret; - - if (HasScheme()) - ret = ret + m_scheme + wxT(":"); - - if (HasServer()) - { - ret += wxT("//"); - - if (HasUserInfo()) - ret = ret + m_userinfo + wxT("@"); - - ret += m_server; - - if (HasPort()) - ret = ret + wxT(":") + m_port; - } - - ret += m_path; - - if (HasQuery()) - ret = ret + wxT("?") + m_query; - - if (HasFragment()) - ret = ret + wxT("#") + m_fragment; - - return ret; -} - -wxString wxURI::BuildUnescapedURI() const -{ - wxString ret; - - if (HasScheme()) - ret = ret + m_scheme + wxT(":"); - - if (HasServer()) - { - ret += wxT("//"); - - if (HasUserInfo()) - ret = ret + wxURI::Unescape(m_userinfo) + wxT("@"); - - if (m_hostType == wxURI_REGNAME) - ret += wxURI::Unescape(m_server); - else - ret += m_server; - - if (HasPort()) - ret = ret + wxT(":") + m_port; - } - - ret += wxURI::Unescape(m_path); - - if (HasQuery()) - ret = ret + wxT("?") + wxURI::Unescape(m_query); - - if (HasFragment()) - ret = ret + wxT("#") + wxURI::Unescape(m_fragment); - - return ret; -} - -// --------------------------------------------------------------------------- -// Assignment -// --------------------------------------------------------------------------- - -wxURI& wxURI::Assign(const wxURI& uri) -{ - //assign fields - m_fields = uri.m_fields; - - //ref over components - m_scheme = uri.m_scheme; - m_userinfo = uri.m_userinfo; - m_server = uri.m_server; - m_hostType = uri.m_hostType; - m_port = uri.m_port; - m_path = uri.m_path; - m_query = uri.m_query; - m_fragment = uri.m_fragment; - - return *this; -} - -wxURI& wxURI::operator = (const wxURI& uri) -{ - return Assign(uri); -} - -wxURI& wxURI::operator = (const wxString& string) -{ - Create(string); - return *this; -} - -// --------------------------------------------------------------------------- -// Comparison -// --------------------------------------------------------------------------- - -bool wxURI::operator == (const wxURI& uri) const -{ - if (HasScheme()) - { - if(m_scheme != uri.m_scheme) - return false; - } - else if (uri.HasScheme()) - return false; - - - if (HasServer()) - { - if (HasUserInfo()) - { - if (m_userinfo != uri.m_userinfo) - return false; - } - else if (uri.HasUserInfo()) - return false; - - if (m_server != uri.m_server || - m_hostType != uri.m_hostType) - return false; - - if (HasPort()) - { - if(m_port != uri.m_port) - return false; - } - else if (uri.HasPort()) - return false; - } - else if (uri.HasServer()) - return false; - - - if (HasPath()) - { - if(m_path != uri.m_path) - return false; - } - else if (uri.HasPath()) - return false; - - if (HasQuery()) - { - if (m_query != uri.m_query) - return false; - } - else if (uri.HasQuery()) - return false; - - if (HasFragment()) - { - if (m_fragment != uri.m_fragment) - return false; - } - else if (uri.HasFragment()) - return false; - - return true; -} - -// --------------------------------------------------------------------------- -// IsReference -// -// if there is no authority or scheme, it is a reference -// --------------------------------------------------------------------------- - -bool wxURI::IsReference() const -{ return !HasScheme() || !HasServer(); } - -// --------------------------------------------------------------------------- -// Parse -// -// Master URI parsing method. Just calls the individual parsing methods -// -// URI = scheme ":" hier-part [ "?" query ] [ "#" fragment ] -// URI-reference = URI / relative -// --------------------------------------------------------------------------- - -const wxChar* wxURI::Parse(const wxChar* uri) -{ - uri = ParseScheme(uri); - uri = ParseAuthority(uri); - uri = ParsePath(uri); - uri = ParseQuery(uri); - return ParseFragment(uri); -} - -// --------------------------------------------------------------------------- -// ParseXXX -// -// Individual parsers for each URI component -// --------------------------------------------------------------------------- - -const wxChar* wxURI::ParseScheme(const wxChar* uri) -{ - wxASSERT(uri != NULL); - - //copy of the uri - used for figuring out - //length of each component - const wxChar* uricopy = uri; - - //Does the uri have a scheme (first character alpha)? - if (IsAlpha(*uri)) - { - m_scheme += *uri++; - - //scheme = ALPHA *( ALPHA / DIGIT / "+" / "-" / "." ) - while (IsAlpha(*uri) || IsDigit(*uri) || - *uri == wxT('+') || - *uri == wxT('-') || - *uri == wxT('.')) - { - m_scheme += *uri++; - } - - //valid scheme? - if (*uri == wxT(':')) - { - //mark the scheme as valid - m_fields |= wxURI_SCHEME; - - //move reference point up to input buffer - uricopy = ++uri; - } - else - //relative uri with relative path reference - m_scheme = wxEmptyString; - } -// else - //relative uri with _possible_ relative path reference - - return uricopy; -} - -const wxChar* wxURI::ParseAuthority(const wxChar* uri) -{ - // authority = [ userinfo "@" ] host [ ":" port ] - if (*uri == wxT('/') && *(uri+1) == wxT('/')) - { - //skip past the two slashes - uri += 2; - - // ############# DEVIATION FROM RFC ######################### - // Don't parse the server component for file URIs - if(m_scheme != wxT("file")) - { - //normal way - uri = ParseUserInfo(uri); - uri = ParseServer(uri); - return ParsePort(uri); - } - } - - return uri; -} - -const wxChar* wxURI::ParseUserInfo(const wxChar* uri) -{ - wxASSERT(uri != NULL); - - //copy of the uri - used for figuring out - //length of each component - const wxChar* uricopy = uri; - - // userinfo = *( unreserved / pct-encoded / sub-delims / ":" ) - while(*uri && *uri != wxT('@') && *uri != wxT('/') && *uri != wxT('#') && *uri != wxT('?')) - { - if(IsUnreserved(*uri) || - IsSubDelim(*uri) || *uri == wxT(':')) - m_userinfo += *uri++; - else if (IsEscape(uri)) - { - m_userinfo += *uri++; - m_userinfo += *uri++; - m_userinfo += *uri++; - } - else - Escape(m_userinfo, *uri++); - } - - if(*uri == wxT('@')) - { - //valid userinfo - m_fields |= wxURI_USERINFO; - - uricopy = ++uri; - } - else - m_userinfo = wxEmptyString; - - return uricopy; -} - -const wxChar* wxURI::ParseServer(const wxChar* uri) -{ - wxASSERT(uri != NULL); - - //copy of the uri - used for figuring out - //length of each component - const wxChar* uricopy = uri; - - // host = IP-literal / IPv4address / reg-name - // IP-literal = "[" ( IPv6address / IPvFuture ) "]" - if (*uri == wxT('[')) - { - ++uri; //some compilers don't support *&ing a ++* - if (ParseIPv6address(uri) && *uri == wxT(']')) - { - ++uri; - m_hostType = wxURI_IPV6ADDRESS; - - wxStringBufferLength theBuffer(m_server, uri - uricopy); - wxTmemcpy(theBuffer, uricopy, uri-uricopy); - theBuffer.SetLength(uri-uricopy); - } - else - { - uri = uricopy; - - ++uri; //some compilers don't support *&ing a ++* - if (ParseIPvFuture(uri) && *uri == wxT(']')) - { - ++uri; - m_hostType = wxURI_IPVFUTURE; - - wxStringBufferLength theBuffer(m_server, uri - uricopy); - wxTmemcpy(theBuffer, uricopy, uri-uricopy); - theBuffer.SetLength(uri-uricopy); - } - else - uri = uricopy; - } - } - else - { - if (ParseIPv4address(uri)) - { - m_hostType = wxURI_IPV4ADDRESS; - - wxStringBufferLength theBuffer(m_server, uri - uricopy); - wxTmemcpy(theBuffer, uricopy, uri-uricopy); - theBuffer.SetLength(uri-uricopy); - } - else - uri = uricopy; - } - - if(m_hostType == wxURI_REGNAME) - { - uri = uricopy; - // reg-name = *( unreserved / pct-encoded / sub-delims ) - while(*uri && *uri != wxT('/') && *uri != wxT(':') && *uri != wxT('#') && *uri != wxT('?')) - { - if(IsUnreserved(*uri) || IsSubDelim(*uri)) - m_server += *uri++; - else if (IsEscape(uri)) - { - m_server += *uri++; - m_server += *uri++; - m_server += *uri++; - } - else - Escape(m_server, *uri++); - } - } - - //mark the server as valid - m_fields |= wxURI_SERVER; - - return uri; -} - - -const wxChar* wxURI::ParsePort(const wxChar* uri) -{ - wxASSERT(uri != NULL); - - // port = *DIGIT - if(*uri == wxT(':')) - { - ++uri; - while(IsDigit(*uri)) - { - m_port += *uri++; - } - - //mark the port as valid - m_fields |= wxURI_PORT; - } - - return uri; -} - -const wxChar* wxURI::ParsePath(const wxChar* uri, bool bReference, bool bNormalize) -{ - wxASSERT(uri != NULL); - - //copy of the uri - used for figuring out - //length of each component - const wxChar* uricopy = uri; - - /// hier-part = "//" authority path-abempty - /// / path-absolute - /// / path-rootless - /// / path-empty - /// - /// relative-part = "//" authority path-abempty - /// / path-absolute - /// / path-noscheme - /// / path-empty - /// - /// path-abempty = *( "/" segment ) - /// path-absolute = "/" [ segment-nz *( "/" segment ) ] - /// path-noscheme = segment-nz-nc *( "/" segment ) - /// path-rootless = segment-nz *( "/" segment ) - /// path-empty = 0 - /// - /// segment = *pchar - /// segment-nz = 1*pchar - /// segment-nz-nc = 1*( unreserved / pct-encoded / sub-delims / "@" ) - /// ; non-zero-length segment without any colon ":" - /// - /// pchar = unreserved / pct-encoded / sub-delims / ":" / "@" - if (*uri == wxT('/')) - { - m_path += *uri++; - - while(*uri && *uri != wxT('#') && *uri != wxT('?')) - { - if( IsUnreserved(*uri) || IsSubDelim(*uri) || - *uri == wxT(':') || *uri == wxT('@') || *uri == wxT('/')) - m_path += *uri++; - else if (IsEscape(uri)) - { - m_path += *uri++; - m_path += *uri++; - m_path += *uri++; - } - else - Escape(m_path, *uri++); - } - - if (bNormalize) - { - wxStringBufferLength theBuffer(m_path, m_path.length() + 1); -#if wxUSE_STL - wxTmemcpy(theBuffer, m_path.c_str(), m_path.length()+1); -#endif - Normalize(theBuffer, true); - theBuffer.SetLength(wxStrlen(theBuffer)); - } - //mark the path as valid - m_fields |= wxURI_PATH; - } - else if(*uri) //Relative path - { - if (bReference) - { - //no colon allowed - while(*uri && *uri != wxT('#') && *uri != wxT('?')) - { - if(IsUnreserved(*uri) || IsSubDelim(*uri) || - *uri == wxT('@') || *uri == wxT('/')) - m_path += *uri++; - else if (IsEscape(uri)) - { - m_path += *uri++; - m_path += *uri++; - m_path += *uri++; - } - else - Escape(m_path, *uri++); - } - } - else - { - while(*uri && *uri != wxT('#') && *uri != wxT('?')) - { - if(IsUnreserved(*uri) || IsSubDelim(*uri) || - *uri == wxT(':') || *uri == wxT('@') || *uri == wxT('/')) - m_path += *uri++; - else if (IsEscape(uri)) - { - m_path += *uri++; - m_path += *uri++; - m_path += *uri++; - } - else - Escape(m_path, *uri++); - } - } - - if (uri != uricopy) - { - if (bNormalize) - { - wxStringBufferLength theBuffer(m_path, m_path.length() + 1); -#if wxUSE_STL - wxTmemcpy(theBuffer, m_path.c_str(), m_path.length()+1); -#endif - Normalize(theBuffer); - theBuffer.SetLength(wxStrlen(theBuffer)); - } - - //mark the path as valid - m_fields |= wxURI_PATH; - } - } - - return uri; -} - - -const wxChar* wxURI::ParseQuery(const wxChar* uri) -{ - wxASSERT(uri != NULL); - - // query = *( pchar / "/" / "?" ) - if (*uri == wxT('?')) - { - ++uri; - while(*uri && *uri != wxT('#')) - { - if (IsUnreserved(*uri) || IsSubDelim(*uri) || - *uri == wxT(':') || *uri == wxT('@') || *uri == wxT('/') || *uri == wxT('?')) - m_query += *uri++; - else if (IsEscape(uri)) - { - m_query += *uri++; - m_query += *uri++; - m_query += *uri++; - } - else - Escape(m_query, *uri++); - } - - //mark the server as valid - m_fields |= wxURI_QUERY; - } - - return uri; -} - - -const wxChar* wxURI::ParseFragment(const wxChar* uri) -{ - wxASSERT(uri != NULL); - - // fragment = *( pchar / "/" / "?" ) - if (*uri == wxT('#')) - { - ++uri; - while(*uri) - { - if (IsUnreserved(*uri) || IsSubDelim(*uri) || - *uri == wxT(':') || *uri == wxT('@') || *uri == wxT('/') || *uri == wxT('?')) - m_fragment += *uri++; - else if (IsEscape(uri)) - { - m_fragment += *uri++; - m_fragment += *uri++; - m_fragment += *uri++; - } - else - Escape(m_fragment, *uri++); - } - - //mark the server as valid - m_fields |= wxURI_FRAGMENT; - } - - return uri; -} - -// --------------------------------------------------------------------------- -// Resolve -// -// Builds missing components of this uri from a base uri -// -// A version of the algorithm outlined in the RFC is used here -// (it is shown in comments) -// -// Note that an empty URI inherits all components -// --------------------------------------------------------------------------- - -void wxURI::Resolve(const wxURI& base, int flags) -{ - wxASSERT_MSG(!base.IsReference(), - wxT("wxURI to inherit from must not be a reference!")); - - // If we arn't being strict, enable the older (pre-RFC2396) - // loophole that allows this uri to inherit other - // properties from the base uri - even if the scheme - // is defined - if ( !(flags & wxURI_STRICT) && - HasScheme() && base.HasScheme() && - m_scheme == base.m_scheme ) - { - m_fields -= wxURI_SCHEME; - } - - - // Do nothing if this is an absolute wxURI - // if defined(R.scheme) then - // T.scheme = R.scheme; - // T.authority = R.authority; - // T.path = remove_dot_segments(R.path); - // T.query = R.query; - if (HasScheme()) - { - return; - } - - //No scheme - inherit - m_scheme = base.m_scheme; - m_fields |= wxURI_SCHEME; - - // All we need to do for relative URIs with an - // authority component is just inherit the scheme - // if defined(R.authority) then - // T.authority = R.authority; - // T.path = remove_dot_segments(R.path); - // T.query = R.query; - if (HasServer()) - { - return; - } - - //No authority - inherit - if (base.HasUserInfo()) - { - m_userinfo = base.m_userinfo; - m_fields |= wxURI_USERINFO; - } - - m_server = base.m_server; - m_hostType = base.m_hostType; - m_fields |= wxURI_SERVER; - - if (base.HasPort()) - { - m_port = base.m_port; - m_fields |= wxURI_PORT; - } - - - // Simple path inheritance from base - if (!HasPath()) - { - // T.path = Base.path; - m_path = base.m_path; - m_fields |= wxURI_PATH; - - - // if defined(R.query) then - // T.query = R.query; - // else - // T.query = Base.query; - // endif; - if (!HasQuery()) - { - m_query = base.m_query; - m_fields |= wxURI_QUERY; - } - } - else - { - // if (R.path starts-with "/") then - // T.path = remove_dot_segments(R.path); - // else - // T.path = merge(Base.path, R.path); - // T.path = remove_dot_segments(T.path); - // endif; - // T.query = R.query; - if (m_path.empty() || m_path[0u] != wxT('/')) - { - //Merge paths - const wxChar* op = m_path.c_str(); - const wxChar* bp = base.m_path.c_str() + base.m_path.Length(); - - //not a ending directory? move up - if (base.m_path[0] && *(bp-1) != wxT('/')) - UpTree(base.m_path, bp); - - //normalize directories - while(*op == wxT('.') && *(op+1) == wxT('.') && - (*(op+2) == '\0' || *(op+2) == wxT('/')) ) - { - UpTree(base.m_path, bp); - - if (*(op+2) == '\0') - op += 2; - else - op += 3; - } - - m_path = base.m_path.substr(0, bp - base.m_path.c_str()) + - m_path.substr((op - m_path.c_str()), m_path.Length()); - } - } - - //T.fragment = R.fragment; -} - -// --------------------------------------------------------------------------- -// UpTree -// -// Moves a URI path up a directory -// --------------------------------------------------------------------------- - -//static -void wxURI::UpTree(const wxChar* uristart, const wxChar*& uri) -{ - if (uri != uristart && *(uri-1) == wxT('/')) - { - uri -= 2; - } - - for(;uri != uristart; --uri) - { - if (*uri == wxT('/')) - { - ++uri; - break; - } - } - - //!!!TODO:HACK!!!// - if (uri == uristart && *uri == wxT('/')) - ++uri; - //!!!// -} - -// --------------------------------------------------------------------------- -// Normalize -// -// Normalizes directories in-place -// -// I.E. ./ and . are ignored -// -// ../ and .. are removed if a directory is before it, along -// with that directory (leading .. and ../ are kept) -// --------------------------------------------------------------------------- - -//static -void wxURI::Normalize(wxChar* s, bool bIgnoreLeads) -{ - wxChar* cp = s; - wxChar* bp = s; - - if(s[0] == wxT('/')) - ++bp; - - while(*cp) - { - if (*cp == wxT('.') && (*(cp+1) == wxT('/') || *(cp+1) == '\0') - && (bp == cp || *(cp-1) == wxT('/'))) - { - //. _or_ ./ - ignore - if (*(cp+1) == '\0') - cp += 1; - else - cp += 2; - } - else if (*cp == wxT('.') && *(cp+1) == wxT('.') && - (*(cp+2) == wxT('/') || *(cp+2) == '\0') - && (bp == cp || *(cp-1) == wxT('/'))) - { - //.. _or_ ../ - go up the tree - if (s != bp) - { - UpTree((const wxChar*)bp, (const wxChar*&)s); - - if (*(cp+2) == '\0') - cp += 2; - else - cp += 3; - } - else if (!bIgnoreLeads) - - { - *bp++ = *cp++; - *bp++ = *cp++; - if (*cp) - *bp++ = *cp++; - - s = bp; - } - else - { - if (*(cp+2) == '\0') - cp += 2; - else - cp += 3; - } - } - else - *s++ = *cp++; - } - - *s = '\0'; -} - -// --------------------------------------------------------------------------- -// ParseH16 -// -// Parses 1 to 4 hex values. Returns true if the first character of the input -// string is a valid hex character. It is the caller's responsability to move -// the input string back to its original position on failure. -// --------------------------------------------------------------------------- - -bool wxURI::ParseH16(const wxChar*& uri) -{ - // h16 = 1*4HEXDIG - if(!IsHex(*++uri)) - return false; - - if(IsHex(*++uri) && IsHex(*++uri) && IsHex(*++uri)) - ++uri; - - return true; -} - -// --------------------------------------------------------------------------- -// ParseIPXXX -// -// Parses a certain version of an IP address and moves the input string past -// it. Returns true if the input string contains the proper version of an ip -// address. It is the caller's responsability to move the input string back -// to its original position on failure. -// --------------------------------------------------------------------------- - -bool wxURI::ParseIPv4address(const wxChar*& uri) -{ - //IPv4address = dec-octet "." dec-octet "." dec-octet "." dec-octet - // - //dec-octet = DIGIT ; 0-9 - // / %x31-39 DIGIT ; 10-99 - // / "1" 2DIGIT ; 100-199 - // / "2" %x30-34 DIGIT ; 200-249 - // / "25" %x30-35 ; 250-255 - size_t iIPv4 = 0; - if (IsDigit(*uri)) - { - ++iIPv4; - - - //each ip part must be between 0-255 (dupe of version in for loop) - if( IsDigit(*++uri) && IsDigit(*++uri) && - //100 or less (note !) - !( (*(uri-2) < wxT('2')) || - //240 or less - (*(uri-2) == wxT('2') && - (*(uri-1) < wxT('5') || (*(uri-1) == wxT('5') && *uri <= wxT('5'))) - ) - ) - ) - { - return false; - } - - if(IsDigit(*uri))++uri; - - //compilers should unroll this loop - for(; iIPv4 < 4; ++iIPv4) - { - if (*uri != wxT('.') || !IsDigit(*++uri)) - break; - - //each ip part must be between 0-255 - if( IsDigit(*++uri) && IsDigit(*++uri) && - //100 or less (note !) - !( (*(uri-2) < wxT('2')) || - //240 or less - (*(uri-2) == wxT('2') && - (*(uri-1) < wxT('5') || (*(uri-1) == wxT('5') && *uri <= wxT('5'))) - ) - ) - ) - { - return false; - } - if(IsDigit(*uri))++uri; - } - } - return iIPv4 == 4; -} - -bool wxURI::ParseIPv6address(const wxChar*& uri) -{ - // IPv6address = 6( h16 ":" ) ls32 - // / "::" 5( h16 ":" ) ls32 - // / [ h16 ] "::" 4( h16 ":" ) ls32 - // / [ *1( h16 ":" ) h16 ] "::" 3( h16 ":" ) ls32 - // / [ *2( h16 ":" ) h16 ] "::" 2( h16 ":" ) ls32 - // / [ *3( h16 ":" ) h16 ] "::" h16 ":" ls32 - // / [ *4( h16 ":" ) h16 ] "::" ls32 - // / [ *5( h16 ":" ) h16 ] "::" h16 - // / [ *6( h16 ":" ) h16 ] "::" - - size_t numPrefix = 0, - maxPostfix; - - bool bEndHex = false; - - for( ; numPrefix < 6; ++numPrefix) - { - if(!ParseH16(uri)) - { - --uri; - bEndHex = true; - break; - } - - if(*uri != wxT(':')) - { - break; - } - } - - if(!bEndHex && !ParseH16(uri)) - { - --uri; - - if (numPrefix) - return false; - - if (*uri == wxT(':')) - { - if (*++uri != wxT(':')) - return false; - - maxPostfix = 5; - } - else - maxPostfix = 6; - } - else - { - if (*uri != wxT(':') || *(uri+1) != wxT(':')) - { - if (numPrefix != 6) - return false; - - while (*--uri != wxT(':')) {} - ++uri; - - const wxChar* uristart = uri; - //parse ls32 - // ls32 = ( h16 ":" h16 ) / IPv4address - if (ParseH16(uri) && *uri == wxT(':') && ParseH16(uri)) - return true; - - uri = uristart; - - if (ParseIPv4address(uri)) - return true; - else - return false; - } - else - { - uri += 2; - - if (numPrefix > 3) - maxPostfix = 0; - else - maxPostfix = 4 - numPrefix; - } - } - - bool bAllowAltEnding = maxPostfix == 0; - - for(; maxPostfix != 0; --maxPostfix) - { - if(!ParseH16(uri) || *uri != wxT(':')) - return false; - } - - if(numPrefix <= 4) - { - const wxChar* uristart = uri; - //parse ls32 - // ls32 = ( h16 ":" h16 ) / IPv4address - if (ParseH16(uri) && *uri == wxT(':') && ParseH16(uri)) - return true; - - uri = uristart; - - if (ParseIPv4address(uri)) - return true; - - uri = uristart; - - if (!bAllowAltEnding) - return false; - } - - if(numPrefix <= 5 && ParseH16(uri)) - return true; - - return true; -} - -bool wxURI::ParseIPvFuture(const wxChar*& uri) -{ - // IPvFuture = "v" 1*HEXDIG "." 1*( unreserved / sub-delims / ":" ) - if (*++uri != wxT('v') || !IsHex(*++uri)) - return false; - - while (IsHex(*++uri)) {} - - if (*uri != wxT('.') || !(IsUnreserved(*++uri) || IsSubDelim(*uri) || *uri == wxT(':'))) - return false; - - while(IsUnreserved(*++uri) || IsSubDelim(*uri) || *uri == wxT(':')) {} - - return true; -} - - -// --------------------------------------------------------------------------- -// CharToHex -// -// Converts a character into a numeric hexidecimal value, or 0 if the -// passed in character is not a valid hex character -// --------------------------------------------------------------------------- - -//static -wxChar wxURI::CharToHex(const wxChar& c) -{ - if ((c >= wxT('A')) && (c <= wxT('Z'))) return wxChar(c - wxT('A') + 0x0A); - if ((c >= wxT('a')) && (c <= wxT('z'))) return wxChar(c - wxT('a') + 0x0a); - if ((c >= wxT('0')) && (c <= wxT('9'))) return wxChar(c - wxT('0') + 0x00); - - return 0; -} - -// --------------------------------------------------------------------------- -// IsXXX -// -// Returns true if the passed in character meets the criteria of the method -// --------------------------------------------------------------------------- - -//! unreserved = ALPHA / DIGIT / "-" / "." / "_" / "~" -bool wxURI::IsUnreserved (const wxChar& c) -{ return IsAlpha(c) || IsDigit(c) || - c == wxT('-') || - c == wxT('.') || - c == wxT('_') || - c == wxT('~') //tilde - ; -} - -bool wxURI::IsReserved (const wxChar& c) -{ - return IsGenDelim(c) || IsSubDelim(c); -} - -//! gen-delims = ":" / "/" / "?" / "#" / "[" / "]" / "@" -bool wxURI::IsGenDelim (const wxChar& c) -{ - return c == wxT(':') || - c == wxT('/') || - c == wxT('?') || - c == wxT('#') || - c == wxT('[') || - c == wxT(']') || - c == wxT('@'); -} - -//! sub-delims = "!" / "$" / "&" / "'" / "(" / ")" -//! / "*" / "+" / "," / ";" / "=" -bool wxURI::IsSubDelim (const wxChar& c) -{ - return c == wxT('!') || - c == wxT('$') || - c == wxT('&') || - c == wxT('\'') || - c == wxT('(') || - c == wxT(')') || - c == wxT('*') || - c == wxT('+') || - c == wxT(',') || - c == wxT(';') || - c == wxT('=') - ; -} - -bool wxURI::IsHex(const wxChar& c) -{ return IsDigit(c) || (c >= wxT('a') && c <= wxT('f')) || (c >= wxT('A') && c <= wxT('F')); } - -bool wxURI::IsAlpha(const wxChar& c) -{ return (c >= wxT('a') && c <= wxT('z')) || (c >= wxT('A') && c <= wxT('Z')); } - -bool wxURI::IsDigit(const wxChar& c) -{ return c >= wxT('0') && c <= wxT('9'); } - - -//end of uri.cpp - - - diff --git a/wxWidgets/src/common/url.cpp b/wxWidgets/src/common/url.cpp deleted file mode 100644 index 9adb482412..0000000000 --- a/wxWidgets/src/common/url.cpp +++ /dev/null @@ -1,533 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/common/url.cpp -// Purpose: URL parser -// Author: Guilhem Lavaux -// Modified by: -// Created: 20/07/1997 -// RCS-ID: $Id: url.cpp 57545 2008-12-25 17:03:20Z VZ $ -// Copyright: (c) 1997, 1998 Guilhem Lavaux -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_URL - -#include "wx/url.h" - -#ifndef WX_PRECOMP - #include "wx/list.h" - #include "wx/string.h" - #include "wx/utils.h" - #include "wx/module.h" -#endif - -#include -#include - -IMPLEMENT_CLASS(wxProtoInfo, wxObject) -IMPLEMENT_CLASS(wxURL, wxURI) - -// Protocols list -wxProtoInfo *wxURL::ms_protocols = NULL; - -// Enforce linking of protocol classes: -USE_PROTOCOL(wxFileProto) - -#if wxUSE_PROTOCOL_HTTP -USE_PROTOCOL(wxHTTP) - - wxHTTP *wxURL::ms_proxyDefault = NULL; - bool wxURL::ms_useDefaultProxy = false; -#endif - -#if wxUSE_PROTOCOL_FTP -USE_PROTOCOL(wxFTP) -#endif - -// -------------------------------------------------------------- -// -// wxURL -// -// -------------------------------------------------------------- - -// -------------------------------------------------------------- -// Construction -// -------------------------------------------------------------- - -wxURL::wxURL(const wxString& url) : wxURI(url) -{ - Init(url); - ParseURL(); -} - -wxURL::wxURL(const wxURI& url) : wxURI(url) -{ - Init(url.BuildURI()); - ParseURL(); -} - -void wxURL::Init(const wxString& url) -{ - m_protocol = NULL; - m_error = wxURL_NOERR; - m_url = url; -#if wxUSE_URL_NATIVE - m_nativeImp = CreateNativeImpObject(); -#endif - -#if wxUSE_PROTOCOL_HTTP - if ( ms_useDefaultProxy && !ms_proxyDefault ) - { - SetDefaultProxy( wxGetenv(wxT("HTTP_PROXY")) ); - - if ( !ms_proxyDefault ) - { - // don't try again - ms_useDefaultProxy = false; - } - } - - m_useProxy = ms_proxyDefault != NULL; - m_proxy = ms_proxyDefault; -#endif // wxUSE_PROTOCOL_HTTP - -} - -// -------------------------------------------------------------- -// Assignment -// -------------------------------------------------------------- - -wxURL& wxURL::operator = (const wxURI& url) -{ - wxURI::operator = (url); - Init(url.BuildURI()); - ParseURL(); - return *this; -} -wxURL& wxURL::operator = (const wxString& url) -{ - wxURI::operator = (url); - Init(url); - ParseURL(); - return *this; -} - -// -------------------------------------------------------------- -// ParseURL -// -// Builds the URL and takes care of the old protocol stuff -// -------------------------------------------------------------- - -bool wxURL::ParseURL() -{ - // If the URL was already parsed (m_protocol != NULL), pass this section. - if (!m_protocol) - { - // Clean up - CleanData(); - - // Make sure we have a protocol/scheme - if (!HasScheme()) - { - m_error = wxURL_SNTXERR; - return false; - } - - // Find and create the protocol object - if (!FetchProtocol()) - { - m_error = wxURL_NOPROTO; - return false; - } - - // Do we need a host name ? - if (m_protoinfo->m_needhost) - { - // Make sure we have one, then - if (!HasServer()) - { - m_error = wxURL_SNTXERR; - return false; - } - } - } - -#if wxUSE_PROTOCOL_HTTP - if (m_useProxy) - { - // Third, we rebuild the URL. - m_url = m_scheme + wxT(":"); - if (m_protoinfo->m_needhost) - m_url = m_url + wxT("//") + m_server; - - // We initialize specific variables. - m_protocol = m_proxy; // FIXME: we should clone the protocol - } -#endif // wxUSE_PROTOCOL_HTTP - - m_error = wxURL_NOERR; - return true; -} - -// -------------------------------------------------------------- -// Destruction/Cleanup -// -------------------------------------------------------------- - -void wxURL::CleanData() -{ -#if wxUSE_PROTOCOL_HTTP - if (!m_useProxy) -#endif // wxUSE_PROTOCOL_HTTP - if (m_protocol) - // Need to safely delete the socket (pending events) - m_protocol->Destroy(); -} - -wxURL::~wxURL() -{ - CleanData(); -#if wxUSE_PROTOCOL_HTTP - if (m_proxy && m_proxy != ms_proxyDefault) - delete m_proxy; -#endif // wxUSE_PROTOCOL_HTTP -#if wxUSE_URL_NATIVE - delete m_nativeImp; -#endif -} - -// -------------------------------------------------------------- -// FetchProtocol -// -------------------------------------------------------------- - -bool wxURL::FetchProtocol() -{ - wxProtoInfo *info = ms_protocols; - - while (info) - { - if (m_scheme == info->m_protoname) - { - if (m_port.IsNull()) - m_port = info->m_servname; - m_protoinfo = info; - m_protocol = (wxProtocol *)m_protoinfo->m_cinfo->CreateObject(); - return true; - } - info = info->next; - } - return false; -} - -// -------------------------------------------------------------- -// GetInputStream -// -------------------------------------------------------------- - -wxInputStream *wxURL::GetInputStream() -{ - if (!m_protocol) - { - m_error = wxURL_NOPROTO; - return NULL; - } - - m_error = wxURL_NOERR; - if (HasUserInfo()) - { - size_t dwPasswordPos = m_userinfo.find(':'); - - if (dwPasswordPos == wxString::npos) - m_protocol->SetUser(Unescape(m_userinfo)); - else - { - m_protocol->SetUser(Unescape(m_userinfo(0, dwPasswordPos))); - m_protocol->SetPassword(Unescape(m_userinfo(dwPasswordPos+1, m_userinfo.length() + 1))); - } - } - -#if wxUSE_URL_NATIVE - // give the native implementation to return a better stream - // such as the native WinINet functionality under MS-Windows - if (m_nativeImp) - { - wxInputStream *rc; - rc = m_nativeImp->GetInputStream(this); - if (rc != 0) - return rc; - } - // else use the standard behaviour -#endif // wxUSE_URL_NATIVE - -#if wxUSE_SOCKETS - wxIPV4address addr; - - // m_protoinfo is NULL when we use a proxy - if (!m_useProxy && m_protoinfo->m_needhost) - { - if (!addr.Hostname(m_server)) - { - m_error = wxURL_NOHOST; - return NULL; - } - - addr.Service(m_port); - - if (!m_protocol->Connect(addr, true)) // Watcom needs the 2nd arg for some reason - { - m_error = wxURL_CONNERR; - return NULL; - } - } -#endif - - wxString fullPath; - - // When we use a proxy, we have to pass the whole URL to it. - if (m_useProxy) - fullPath += m_url; - - if(m_path.empty()) - fullPath += wxT("/"); - else - fullPath += m_path; - - if (HasQuery()) - fullPath += wxT("?") + m_query; - - if (HasFragment()) - fullPath += wxT("#") + m_fragment; - - wxInputStream *the_i_stream = m_protocol->GetInputStream(fullPath); - - if (!the_i_stream) - { - m_error = wxURL_PROTOERR; - return NULL; - } - - return the_i_stream; -} - -#if wxUSE_PROTOCOL_HTTP -void wxURL::SetDefaultProxy(const wxString& url_proxy) -{ - if ( !url_proxy ) - { - if ( ms_proxyDefault ) - { - ms_proxyDefault->Close(); - delete ms_proxyDefault; - ms_proxyDefault = NULL; - } - } - else - { - wxString tmp_str = url_proxy; - int pos = tmp_str.Find(wxT(':')); - if (pos == wxNOT_FOUND) - return; - - wxString hostname = tmp_str(0, pos), - port = tmp_str(pos+1, tmp_str.length()-pos); - wxIPV4address addr; - - if (!addr.Hostname(hostname)) - return; - if (!addr.Service(port)) - return; - - if (ms_proxyDefault) - // Finally, when all is right, we connect the new proxy. - ms_proxyDefault->Close(); - else - ms_proxyDefault = new wxHTTP(); - ms_proxyDefault->Connect(addr, true); // Watcom needs the 2nd arg for some reason - } -} - -void wxURL::SetProxy(const wxString& url_proxy) -{ - if ( !url_proxy ) - { - if ( m_proxy && m_proxy != ms_proxyDefault ) - { - m_proxy->Close(); - delete m_proxy; - } - - m_useProxy = false; - } - else - { - wxString tmp_str; - wxString hostname, port; - int pos; - wxIPV4address addr; - - tmp_str = url_proxy; - pos = tmp_str.Find(wxT(':')); - // This is an invalid proxy name. - if (pos == wxNOT_FOUND) - return; - - hostname = tmp_str(0, pos); - port = tmp_str(pos+1, tmp_str.length()-pos); - - addr.Hostname(hostname); - addr.Service(port); - - // Finally, create the whole stuff. - if (m_proxy && m_proxy != ms_proxyDefault) - delete m_proxy; - m_proxy = new wxHTTP(); - m_proxy->Connect(addr, true); // Watcom needs the 2nd arg for some reason - - CleanData(); - // Reparse url. - m_useProxy = true; - ParseURL(); - } -} -#endif // wxUSE_PROTOCOL_HTTP - -// ---------------------------------------------------------------------- -// wxURLModule -// -// A module which deletes the default proxy if we created it -// ---------------------------------------------------------------------- - -#if wxUSE_SOCKETS - -class wxURLModule : public wxModule -{ -public: - wxURLModule(); - - virtual bool OnInit(); - virtual void OnExit(); - -private: - DECLARE_DYNAMIC_CLASS(wxURLModule) -}; - -IMPLEMENT_DYNAMIC_CLASS(wxURLModule, wxModule) - -wxURLModule::wxURLModule() -{ - // we must be cleaned up before wxSocketModule as otherwise deleting - // ms_proxyDefault from our OnExit() won't work (and can actually crash) - AddDependency(wxClassInfo::FindClass(_T("wxSocketModule"))); -} - -bool wxURLModule::OnInit() -{ -#if wxUSE_PROTOCOL_HTTP - // env var HTTP_PROXY contains the address of the default proxy to use if - // set, but don't try to create this proxy right now because it will slow - // down the program startup (especially if there is no DNS server - // available, in which case it may take up to 1 minute) - - if ( wxGetenv(_T("HTTP_PROXY")) ) - { - wxURL::ms_useDefaultProxy = true; - } -#endif // wxUSE_PROTOCOL_HTTP - return true; -} - -void wxURLModule::OnExit() -{ -#if wxUSE_PROTOCOL_HTTP - delete wxURL::ms_proxyDefault; - wxURL::ms_proxyDefault = NULL; -#endif // wxUSE_PROTOCOL_HTTP -} - -#endif // wxUSE_SOCKETS - -// --------------------------------------------------------------------------- -// -// wxURL Compatibility -// -// --------------------------------------------------------------------------- - -#if WXWIN_COMPATIBILITY_2_4 - -#include "wx/url.h" - -wxString wxURL::GetProtocolName() const -{ - return m_scheme; -} - -wxString wxURL::GetHostName() const -{ - return m_server; -} - -wxString wxURL::GetPath() const -{ - return m_path; -} - -//Note that this old code really doesn't convert to a URI that well and looks -//more like a dirty hack than anything else... - -wxString wxURL::ConvertToValidURI(const wxString& uri, const wxChar* delims) -{ - wxString out_str; - wxString hexa_code; - size_t i; - - for (i = 0; i < uri.Len(); i++) - { - wxChar c = uri.GetChar(i); - - if (c == wxT(' ')) - { - // GRG, Apr/2000: changed to "%20" instead of '+' - - out_str += wxT("%20"); - } - else - { - // GRG, Apr/2000: modified according to the URI definition (RFC 2396) - // - // - Alphanumeric characters are never escaped - // - Unreserved marks are never escaped - // - Delimiters must be escaped if they appear within a component - // but not if they are used to separate components. Here we have - // no clear way to distinguish between these two cases, so they - // are escaped unless they are passed in the 'delims' parameter - // (allowed delimiters). - - static const wxChar marks[] = wxT("-_.!~*()'"); - - if ( !wxIsalnum(c) && !wxStrchr(marks, c) && !wxStrchr(delims, c) ) - { - hexa_code.Printf(wxT("%%%02X"), c); - out_str += hexa_code; - } - else - { - out_str += c; - } - } - } - - return out_str; -} - -wxString wxURL::ConvertFromURI(const wxString& uri) -{ - return wxURI::Unescape(uri); -} - -#endif //WXWIN_COMPATIBILITY_2_4 - -#endif // wxUSE_URL diff --git a/wxWidgets/src/common/utilscmn.cpp b/wxWidgets/src/common/utilscmn.cpp deleted file mode 100644 index e2835b7d74..0000000000 --- a/wxWidgets/src/common/utilscmn.cpp +++ /dev/null @@ -1,1417 +0,0 @@ -// Name: src/common/utilscmn.cpp -// Purpose: Miscellaneous utility functions and classes -// Author: Julian Smart -// Modified by: -// Created: 29/01/98 -// RCS-ID: $Id: utilscmn.cpp 66917 2011-02-16 21:51:31Z JS $ -// Copyright: (c) 1998 Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -// 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/string.h" - #include "wx/utils.h" - #include "wx/intl.h" - #include "wx/log.h" - - #if wxUSE_GUI - #include "wx/window.h" - #include "wx/frame.h" - #include "wx/menu.h" - #include "wx/msgdlg.h" - #include "wx/textdlg.h" - #include "wx/textctrl.h" // for wxTE_PASSWORD - #if wxUSE_ACCEL - #include "wx/menuitem.h" - #include "wx/accel.h" - #endif // wxUSE_ACCEL - #endif // wxUSE_GUI -#endif // WX_PRECOMP - -#include "wx/apptrait.h" - -#include "wx/process.h" -#include "wx/txtstrm.h" -#include "wx/uri.h" -#include "wx/mimetype.h" -#include "wx/config.h" - -#if defined(__WXWINCE__) && wxUSE_DATETIME -#include "wx/datetime.h" -#endif - -#include -#include -#include -#include - -#if !wxONLY_WATCOM_EARLIER_THAN(1,4) - #if !(defined(_MSC_VER) && (_MSC_VER > 800)) - #include - #endif -#endif - -#if wxUSE_GUI - #include "wx/colordlg.h" - #include "wx/fontdlg.h" - #include "wx/notebook.h" - #include "wx/statusbr.h" -#endif // wxUSE_GUI - -#ifndef __WXWINCE__ -#include -#else -#include "wx/msw/wince/time.h" -#endif - -#ifdef __WXMAC__ -#include "wx/mac/private.h" -#ifndef __DARWIN__ -#include "InternetConfig.h" -#endif -#endif - -#if !defined(__MWERKS__) && !defined(__WXWINCE__) - #include - #include -#endif - -#if defined(__WXMSW__) - #include "wx/msw/private.h" - #include "wx/msw/registry.h" - #include // needed for SHELLEXECUTEINFO -#endif - -#if wxUSE_BASE - -// ---------------------------------------------------------------------------- -// common data -// ---------------------------------------------------------------------------- - -// ============================================================================ -// implementation -// ============================================================================ - -#if WXWIN_COMPATIBILITY_2_4 - -wxChar * -copystring (const wxChar *s) -{ - if (s == NULL) s = wxEmptyString; - size_t len = wxStrlen (s) + 1; - - wxChar *news = new wxChar[len]; - memcpy (news, s, len * sizeof(wxChar)); // Should be the fastest - - return news; -} - -#endif // WXWIN_COMPATIBILITY_2_4 - -// ---------------------------------------------------------------------------- -// String <-> Number conversions (deprecated) -// ---------------------------------------------------------------------------- - -#if WXWIN_COMPATIBILITY_2_4 - -WXDLLIMPEXP_DATA_BASE(const wxChar *) wxFloatToStringStr = wxT("%.2f"); -WXDLLIMPEXP_DATA_BASE(const wxChar *) wxDoubleToStringStr = wxT("%.2f"); - -void -StringToFloat (const wxChar *s, float *number) -{ - if (s && *s && number) - *number = (float) wxStrtod (s, (wxChar **) NULL); -} - -void -StringToDouble (const wxChar *s, double *number) -{ - if (s && *s && number) - *number = wxStrtod (s, (wxChar **) NULL); -} - -wxChar * -FloatToString (float number, const wxChar *fmt) -{ - static wxChar buf[256]; - - wxSprintf (buf, fmt, number); - return buf; -} - -wxChar * -DoubleToString (double number, const wxChar *fmt) -{ - static wxChar buf[256]; - - wxSprintf (buf, fmt, number); - return buf; -} - -void -StringToInt (const wxChar *s, int *number) -{ - if (s && *s && number) - *number = (int) wxStrtol (s, (wxChar **) NULL, 10); -} - -void -StringToLong (const wxChar *s, long *number) -{ - if (s && *s && number) - *number = wxStrtol (s, (wxChar **) NULL, 10); -} - -wxChar * -IntToString (int number) -{ - static wxChar buf[20]; - - wxSprintf (buf, wxT("%d"), number); - return buf; -} - -wxChar * -LongToString (long number) -{ - static wxChar buf[20]; - - wxSprintf (buf, wxT("%ld"), number); - return buf; -} - -#endif // WXWIN_COMPATIBILITY_2_4 - -// Array used in DecToHex conversion routine. -static wxChar hexArray[] = wxT("0123456789ABCDEF"); - -// Convert 2-digit hex number to decimal -int wxHexToDec(const wxString& buf) -{ - int firstDigit, secondDigit; - - if (buf.GetChar(0) >= wxT('A')) - firstDigit = buf.GetChar(0) - wxT('A') + 10; - else - firstDigit = buf.GetChar(0) - wxT('0'); - - if (buf.GetChar(1) >= wxT('A')) - secondDigit = buf.GetChar(1) - wxT('A') + 10; - else - secondDigit = buf.GetChar(1) - wxT('0'); - - return (firstDigit & 0xF) * 16 + (secondDigit & 0xF ); -} - -// Convert decimal integer to 2-character hex string -void wxDecToHex(int dec, wxChar *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; -} - -// Convert decimal integer to 2-character hex string -wxString wxDecToHex(int dec) -{ - wxChar buf[3]; - wxDecToHex(dec, buf); - return wxString(buf); -} - -// ---------------------------------------------------------------------------- -// misc functions -// ---------------------------------------------------------------------------- - -// Return the current date/time -wxString wxNow() -{ -#ifdef __WXWINCE__ -#if wxUSE_DATETIME - wxDateTime now = wxDateTime::Now(); - return now.Format(); -#else - return wxEmptyString; -#endif -#else - time_t now = time((time_t *) NULL); - char *date = ctime(&now); - date[24] = '\0'; - return wxString::FromAscii(date); -#endif -} - -void wxUsleep(unsigned long milliseconds) -{ - wxMilliSleep(milliseconds); -} - -const wxChar *wxGetInstallPrefix() -{ - wxString prefix; - - if ( wxGetEnv(wxT("WXPREFIX"), &prefix) ) - return prefix.c_str(); - -#ifdef wxINSTALL_PREFIX - return wxT(wxINSTALL_PREFIX); -#else - return wxEmptyString; -#endif -} - -wxString wxGetDataDir() -{ - wxString dir = wxGetInstallPrefix(); - dir << wxFILE_SEP_PATH << wxT("share") << wxFILE_SEP_PATH << wxT("wx"); - return dir; -} - -bool wxIsPlatformLittleEndian() -{ - // Are we little or big endian? This method is from Harbison & Steele. - union - { - long l; - char c[sizeof(long)]; - } u; - u.l = 1; - - return u.c[0] == 1; -} - - -/* - * Class to make it easier to specify platform-dependent values - */ - -wxArrayInt* wxPlatform::sm_customPlatforms = NULL; - -void wxPlatform::Copy(const wxPlatform& platform) -{ - m_longValue = platform.m_longValue; - m_doubleValue = platform.m_doubleValue; - m_stringValue = platform.m_stringValue; -} - -wxPlatform wxPlatform::If(int platform, long value) -{ - if (Is(platform)) - return wxPlatform(value); - else - return wxPlatform(); -} - -wxPlatform wxPlatform::IfNot(int platform, long value) -{ - if (!Is(platform)) - return wxPlatform(value); - else - return wxPlatform(); -} - -wxPlatform& wxPlatform::ElseIf(int platform, long value) -{ - if (Is(platform)) - m_longValue = value; - return *this; -} - -wxPlatform& wxPlatform::ElseIfNot(int platform, long value) -{ - if (!Is(platform)) - m_longValue = value; - return *this; -} - -wxPlatform wxPlatform::If(int platform, double value) -{ - if (Is(platform)) - return wxPlatform(value); - else - return wxPlatform(); -} - -wxPlatform wxPlatform::IfNot(int platform, double value) -{ - if (!Is(platform)) - return wxPlatform(value); - else - return wxPlatform(); -} - -wxPlatform& wxPlatform::ElseIf(int platform, double value) -{ - if (Is(platform)) - m_doubleValue = value; - return *this; -} - -wxPlatform& wxPlatform::ElseIfNot(int platform, double value) -{ - if (!Is(platform)) - m_doubleValue = value; - return *this; -} - -wxPlatform wxPlatform::If(int platform, const wxString& value) -{ - if (Is(platform)) - return wxPlatform(value); - else - return wxPlatform(); -} - -wxPlatform wxPlatform::IfNot(int platform, const wxString& value) -{ - if (!Is(platform)) - return wxPlatform(value); - else - return wxPlatform(); -} - -wxPlatform& wxPlatform::ElseIf(int platform, const wxString& value) -{ - if (Is(platform)) - m_stringValue = value; - return *this; -} - -wxPlatform& wxPlatform::ElseIfNot(int platform, const wxString& value) -{ - if (!Is(platform)) - m_stringValue = value; - return *this; -} - -wxPlatform& wxPlatform::Else(long value) -{ - m_longValue = value; - return *this; -} - -wxPlatform& wxPlatform::Else(double value) -{ - m_doubleValue = value; - return *this; -} - -wxPlatform& wxPlatform::Else(const wxString& value) -{ - m_stringValue = value; - return *this; -} - -void wxPlatform::AddPlatform(int platform) -{ - if (!sm_customPlatforms) - sm_customPlatforms = new wxArrayInt; - sm_customPlatforms->Add(platform); -} - -void wxPlatform::ClearPlatforms() -{ - delete sm_customPlatforms; - sm_customPlatforms = NULL; -} - -/// Function for testing current platform - -bool wxPlatform::Is(int platform) -{ -#ifdef __WXMSW__ - if (platform == wxOS_WINDOWS) - return true; -#endif -#ifdef __WXWINCE__ - if (platform == wxOS_WINDOWS_CE) - return true; -#endif - -#if 0 - -// FIXME: wxWinPocketPC and wxWinSmartPhone are unknown symbols - -#if defined(__WXWINCE__) && defined(__POCKETPC__) - if (platform == wxWinPocketPC) - return true; -#endif -#if defined(__WXWINCE__) && defined(__SMARTPHONE__) - if (platform == wxWinSmartPhone) - return true; -#endif - -#endif - -#ifdef __WXGTK__ - if (platform == wxPORT_GTK) - return true; -#endif -#ifdef __WXMAC__ - if (platform == wxPORT_MAC) - return true; -#endif -#ifdef __WXX11__ - if (platform == wxPORT_X11) - return true; -#endif -#ifdef __UNIX__ - if (platform == wxOS_UNIX) - return true; -#endif -#ifdef __WXMGL__ - if (platform == wxPORT_MGL) - return true; -#endif -#ifdef __OS2__ - if (platform == wxOS_OS2) - return true; -#endif -#ifdef __WXPM__ - if (platform == wxPORT_PM) - return true; -#endif -#ifdef __WXCOCOA__ - if (platform == wxPORT_MAC) - return true; -#endif - - if (sm_customPlatforms && sm_customPlatforms->Index(platform) != wxNOT_FOUND) - return true; - - return false; -} - -// ---------------------------------------------------------------------------- -// network and user id functions -// ---------------------------------------------------------------------------- - -// Get Full RFC822 style email address -bool wxGetEmailAddress(wxChar *address, int maxSize) -{ - wxString email = wxGetEmailAddress(); - if ( !email ) - return false; - - wxStrncpy(address, email, maxSize - 1); - address[maxSize - 1] = wxT('\0'); - - return true; -} - -wxString wxGetEmailAddress() -{ - wxString email; - - wxString host = wxGetFullHostName(); - if ( !host.empty() ) - { - wxString user = wxGetUserId(); - if ( !user.empty() ) - { - email << user << wxT('@') << host; - } - } - - return email; -} - -wxString wxGetUserId() -{ - static const int maxLoginLen = 256; // FIXME arbitrary number - - wxString buf; - bool ok = wxGetUserId(wxStringBuffer(buf, maxLoginLen), maxLoginLen); - - if ( !ok ) - buf.Empty(); - - return buf; -} - -wxString wxGetUserName() -{ - static const int maxUserNameLen = 1024; // FIXME arbitrary number - - wxString buf; - bool ok = wxGetUserName(wxStringBuffer(buf, maxUserNameLen), maxUserNameLen); - - if ( !ok ) - buf.Empty(); - - return buf; -} - -wxString wxGetHostName() -{ - static const size_t hostnameSize = 257; - - wxString buf; - bool ok = wxGetHostName(wxStringBuffer(buf, hostnameSize), hostnameSize); - - if ( !ok ) - buf.Empty(); - - return buf; -} - -wxString wxGetFullHostName() -{ - static const size_t hostnameSize = 257; - - wxString buf; - bool ok = wxGetFullHostName(wxStringBuffer(buf, hostnameSize), hostnameSize); - - if ( !ok ) - buf.Empty(); - - return buf; -} - -wxString wxGetHomeDir() -{ - wxString home; - wxGetHomeDir(&home); - - return home; -} - -#if 0 - -wxString wxGetCurrentDir() -{ - wxString dir; - size_t len = 1024; - bool ok; - do - { - ok = getcwd(dir.GetWriteBuf(len + 1), len) != NULL; - dir.UngetWriteBuf(); - - if ( !ok ) - { - if ( errno != ERANGE ) - { - wxLogSysError(_T("Failed to get current directory")); - - return wxEmptyString; - } - else - { - // buffer was too small, retry with a larger one - len *= 2; - } - } - //else: ok - } while ( !ok ); - - return dir; -} - -#endif // 0 - -// ---------------------------------------------------------------------------- -// wxExecute -// ---------------------------------------------------------------------------- - -// wxDoExecuteWithCapture() helper: reads an entire stream into one array -// -// returns true if ok, false if error -#if wxUSE_STREAMS -static bool ReadAll(wxInputStream *is, wxArrayString& output) -{ - wxCHECK_MSG( is, false, _T("NULL stream in wxExecute()?") ); - - // the stream could be already at EOF or in wxSTREAM_BROKEN_PIPE state - is->Reset(); - - wxTextInputStream tis(*is); - - for ( ;; ) - { - wxString line = tis.ReadLine(); - - // check for EOF before other errors as it's not really an error - if ( is->Eof() ) - { - // add the last, possibly incomplete, line - if ( !line.empty() ) - output.Add(line); - break; - } - - // any other error is fatal - if ( !*is ) - return false; - - output.Add(line); - } - - return true; -} -#endif // wxUSE_STREAMS - -// this is a private function because it hasn't a clean interface: the first -// array is passed by reference, the second by pointer - instead we have 2 -// public versions of wxExecute() below -static long wxDoExecuteWithCapture(const wxString& command, - wxArrayString& output, - wxArrayString* error, - int flags) -{ - // create a wxProcess which will capture the output - wxProcess *process = new wxProcess; - process->Redirect(); - - long rc = wxExecute(command, wxEXEC_SYNC | flags, process); - -#if wxUSE_STREAMS - if ( rc != -1 ) - { - if ( !ReadAll(process->GetInputStream(), output) ) - rc = -1; - - if ( error ) - { - if ( !ReadAll(process->GetErrorStream(), *error) ) - rc = -1; - } - - } -#else - wxUnusedVar(output); - wxUnusedVar(error); -#endif // wxUSE_STREAMS/!wxUSE_STREAMS - - delete process; - - return rc; -} - -long wxExecute(const wxString& command, wxArrayString& output, int flags) -{ - return wxDoExecuteWithCapture(command, output, NULL, flags); -} - -long wxExecute(const wxString& command, - wxArrayString& output, - wxArrayString& error, - int flags) -{ - return wxDoExecuteWithCapture(command, output, &error, flags); -} - -// ---------------------------------------------------------------------------- -// Launch default browser -// ---------------------------------------------------------------------------- - -#include "wx/private/browserhack28.h" - -static bool wxLaunchDefaultBrowserBaseImpl(const wxString& url, int flags); - -// Use wxLaunchDefaultBrowserBaseImpl by default -static wxLaunchDefaultBrowserImpl_t s_launchBrowserImpl = &wxLaunchDefaultBrowserBaseImpl; - -// Function the GUI library can call to provide a better implementation -WXDLLIMPEXP_BASE void wxSetLaunchDefaultBrowserImpl(wxLaunchDefaultBrowserImpl_t newImpl) -{ - s_launchBrowserImpl = newImpl!=NULL ? newImpl : &wxLaunchDefaultBrowserBaseImpl; -} - -static bool wxLaunchDefaultBrowserBaseImpl(const wxString& url, int flags) -{ - wxUnusedVar(flags); - -#if defined(__WXMSW__) - -#if wxUSE_IPC - if ( flags & wxBROWSER_NEW_WINDOW ) - { - // ShellExecuteEx() opens the URL in an existing window by default so - // we can't use it if we need a new window - wxURI uri(url); - wxRegKey key(wxRegKey::HKCR, uri.GetScheme() + _T("\\shell\\open")); - if ( !key.Exists() ) - { - // try default browser, it must be registered at least for http URLs - key.SetName(wxRegKey::HKCR, _T("http\\shell\\open")); - } - - if ( key.Exists() ) - { - wxRegKey keyDDE(key, wxT("DDEExec")); - if ( keyDDE.Exists() ) - { - // we only know the syntax of WWW_OpenURL DDE request for IE, - // optimistically assume that all other browsers are compatible - // with it - static const wxString TOPIC_OPEN_URL = wxT("WWW_OpenURL"); - wxString ddeCmd; - wxRegKey keyTopic(keyDDE, wxT("topic")); - bool ok = keyTopic.Exists() && (keyTopic.QueryDefaultValue() = TOPIC_OPEN_URL); - if ( ok ) - { - ddeCmd = keyDDE.QueryDefaultValue(); - ok = !ddeCmd.empty(); - } - - if ( ok ) - { - // for WWW_OpenURL, the index of the window to open the URL - // in is -1 (meaning "current") by default, replace it with - // 0 which means "new" (see KB article 160957) - ok = ddeCmd.Replace(wxT("-1"), wxT("0"), - false /* only first occurence */) == 1; - } - - if ( ok ) - { - // and also replace the parameters: the topic should - // contain a placeholder for the URL - ok = ddeCmd.Replace(wxT("%1"), url, false) == 1; - } - - if ( ok ) - { - // try to send it the DDE request now but ignore the errors - wxLogNull noLog; - - const wxString ddeServer = wxRegKey(keyDDE, wxT("application")).QueryDefaultValue(); - if ( wxExecuteDDE(ddeServer, TOPIC_OPEN_URL, ddeCmd) ) - return true; - - // this is not necessarily an error: maybe browser is - // simply not running, but no matter, in any case we're - // going to launch it using ShellExecuteEx() below now and - // we shouldn't try to open a new window if we open a new - // browser anyhow - } - } - } - } -#endif // wxUSE_IPC - - WinStruct sei; - sei.lpFile = url.c_str(); - sei.lpVerb = _T("open"); - sei.nShow = SW_SHOWNORMAL; - sei.fMask = SEE_MASK_FLAG_NO_UI; // we give error message ourselves - - BOOL nExecResult = ::ShellExecuteEx(&sei); - - //From MSDN for wince - //hInstApp member is only valid if the function fails, in which case it - //receives one of the following error values, which are less than or - //equal to 32. - const int nResult = (int) sei.hInstApp; - - // Firefox returns file not found for some reason, so make an exception - // for it - if ( nResult > 32 || nResult == SE_ERR_FNF || nExecResult == TRUE ) - { -#ifdef __WXDEBUG__ - // Log something if SE_ERR_FNF happens - if ( nResult == SE_ERR_FNF || nExecResult == FALSE ) - wxLogDebug(wxT("SE_ERR_FNF from ShellExecute -- maybe FireFox?")); -#endif // __WXDEBUG__ - return true; - } -#elif defined(__WXMAC__) - OSStatus err; - ICInstance inst; - long int startSel; - long int endSel; - - err = ICStart(&inst, 'STKA'); // put your app creator code here - if (err == noErr) - { -#if !TARGET_CARBON - err = ICFindConfigFile(inst, 0, NULL); -#endif - if (err == noErr) - { - ConstStr255Param hint = 0; - startSel = 0; - endSel = url.length(); - err = ICLaunchURL(inst, hint, url.fn_str(), endSel, &startSel, &endSel); - if (err != noErr) - wxLogDebug(wxT("ICLaunchURL error %d"), (int) err); - } - ICStop(inst); - return true; - } - else - { - wxLogDebug(wxT("ICStart error %d"), (int) err); - return false; - } -#else - // (non-Mac, non-MSW) - -#ifdef __UNIX__ - - // Our best best is to use xdg-open from freedesktop.org cross-desktop - // compatibility suite xdg-utils - // (see http://portland.freedesktop.org/wiki/) -- this is installed on - // most modern distributions and may be tweaked by them to handle - // distribution specifics. Only if that fails, try to find the right - // browser ourselves. - wxString path, xdg_open; - if ( wxGetEnv(_T("PATH"), &path) && - wxFindFileInPath(&xdg_open, path, _T("xdg-open")) ) - { - if ( wxExecute(xdg_open + _T(" ") + url) ) - return true; - } - - wxString desktop = wxTheApp->GetTraits()->GetDesktopEnvironment(); - - // GNOME and KDE desktops have some applications which should be always installed - // together with their main parts, which give us the - if (desktop == wxT("GNOME")) - { - wxArrayString errors; - wxArrayString output; - - // gconf will tell us the path of the application to use as browser - long res = wxExecute( wxT("gconftool-2 --get /desktop/gnome/applications/browser/exec"), - output, errors, wxEXEC_NODISABLE ); - if (res >= 0 && errors.GetCount() == 0) - { - wxString cmd = output[0]; - cmd << _T(' ') << url; - if (wxExecute(cmd)) - return true; - } - } - else if (desktop == wxT("KDE")) - { - // kfmclient directly opens the given URL - if (wxExecute(wxT("kfmclient openURL ") + url)) - return true; - } -#endif - - bool ok = false; - wxString cmd; - -#if wxUSE_MIMETYPE - wxFileType *ft = wxTheMimeTypesManager->GetFileTypeFromExtension(_T("html")); - if ( ft ) - { - wxString mt; - ft->GetMimeType(&mt); - - ok = ft->GetOpenCommand(&cmd, wxFileType::MessageParameters(url)); - delete ft; - } -#endif // wxUSE_MIMETYPE - - if ( !ok || cmd.empty() ) - { - // fallback to checking for the BROWSER environment variable - cmd = wxGetenv(wxT("BROWSER")); - if ( !cmd.empty() ) - cmd << _T(' ') << url; - } - - ok = ( !cmd.empty() && wxExecute(cmd) ); - if (ok) - return ok; - - // no file type for HTML extension - wxLogError(_T("No default application configured for HTML files.")); - -#endif // !wxUSE_MIMETYPE && !__WXMSW__ - return false; -} - -bool wxLaunchDefaultBrowser(const wxString& urlOrig, int flags) -{ - // set the scheme of url to http if it does not have one - // RR: This doesn't work if the url is just a local path - wxString url(urlOrig); - wxURI uri(url); - if ( !uri.HasScheme() ) - { - if (wxFileExists(urlOrig)) - url.Prepend( wxT("file://") ); - else - url.Prepend(wxT("http://")); - } - - if(s_launchBrowserImpl(url, flags)) - return true; - - wxLogSysError(_T("Failed to open URL \"%s\" in default browser."), - url.c_str()); - - return false; -} - -// ---------------------------------------------------------------------------- -// wxApp::Yield() wrappers for backwards compatibility -// ---------------------------------------------------------------------------- - -bool wxYield() -{ - return wxTheApp && wxTheApp->Yield(); -} - -bool wxYieldIfNeeded() -{ - return wxTheApp && wxTheApp->Yield(true); -} - -#endif // wxUSE_BASE - -// ============================================================================ -// GUI-only functions from now on -// ============================================================================ - -#if wxUSE_GUI - -// Id generation -static long wxCurrentId = 100; - -long wxNewId() -{ - // skip the part of IDs space that contains hard-coded values: - if (wxCurrentId == wxID_LOWEST) - wxCurrentId = wxID_HIGHEST + 1; - - return wxCurrentId++; -} - -long -wxGetCurrentId(void) { return wxCurrentId; } - -void -wxRegisterId (long id) -{ - if (id >= wxCurrentId) - wxCurrentId = id + 1; -} - -// ---------------------------------------------------------------------------- -// Menu accelerators related functions -// ---------------------------------------------------------------------------- - -wxChar *wxStripMenuCodes(const wxChar *in, wxChar *out) -{ -#if wxUSE_MENUS - wxString s = wxMenuItem::GetLabelFromText(in); -#else - wxString str(in); - wxString s = wxStripMenuCodes(str); -#endif // wxUSE_MENUS - if ( out ) - { - // go smash their buffer if it's not big enough - I love char * params - memcpy(out, s.c_str(), s.length() * sizeof(wxChar)); - } - else - { - // MYcopystring - for easier search... - out = new wxChar[s.length() + 1]; - wxStrcpy(out, s.c_str()); - } - - return out; -} - -wxString wxStripMenuCodes(const wxString& in, int flags) -{ - wxASSERT_MSG( flags, _T("this is useless to call without any flags") ); - - wxString out; - - size_t len = in.length(); - out.reserve(len); - - for ( size_t n = 0; n < len; n++ ) - { - wxChar ch = in[n]; - if ( (flags & wxStrip_Mnemonics) && ch == _T('&') ) - { - // skip it, it is used to introduce the accel char (or to quote - // itself in which case it should still be skipped): note that it - // can't be the last character of the string - if ( ++n == len ) - { - wxLogDebug(_T("Invalid menu string '%s'"), in.c_str()); - } - else - { - // use the next char instead - ch = in[n]; - } - } - else if ( (flags & wxStrip_Accel) && ch == _T('\t') ) - { - // everything after TAB is accel string, exit the loop - break; - } - - out += ch; - } - - return out; -} - -// ---------------------------------------------------------------------------- -// Window search functions -// ---------------------------------------------------------------------------- - -/* - * If parent is non-NULL, look through children for a label or title - * matching the specified string. If NULL, look through all top-level windows. - * - */ - -wxWindow * -wxFindWindowByLabel (const wxString& title, wxWindow * parent) -{ - return wxWindow::FindWindowByLabel( title, parent ); -} - - -/* - * If parent is non-NULL, look through children for a name - * matching the specified string. If NULL, look through all top-level windows. - * - */ - -wxWindow * -wxFindWindowByName (const wxString& name, wxWindow * parent) -{ - return wxWindow::FindWindowByName( name, parent ); -} - -// Returns menu item id or wxNOT_FOUND if none. -int -wxFindMenuItemId (wxFrame * frame, const wxString& menuString, const wxString& itemString) -{ -#if wxUSE_MENUS - wxMenuBar *menuBar = frame->GetMenuBar (); - if ( menuBar ) - return menuBar->FindMenuItem (menuString, itemString); -#endif // wxUSE_MENUS - - return wxNOT_FOUND; -} - -// Try to find the deepest child that contains 'pt'. -// We go backwards, to try to allow for controls that are spacially -// within other controls, but are still siblings (e.g. buttons within -// static boxes). Static boxes are likely to be created _before_ controls -// that sit inside them. -wxWindow* wxFindWindowAtPoint(wxWindow* win, const wxPoint& pt) -{ - if (!win->IsShown()) - return NULL; - - // Hack for wxNotebook case: at least in wxGTK, all pages - // claim to be shown, so we must only deal with the selected one. -#if wxUSE_NOTEBOOK - if (win->IsKindOf(CLASSINFO(wxNotebook))) - { - wxNotebook* nb = (wxNotebook*) win; - int sel = nb->GetSelection(); - if (sel >= 0) - { - wxWindow* child = nb->GetPage(sel); - wxWindow* foundWin = wxFindWindowAtPoint(child, pt); - if (foundWin) - return foundWin; - } - } -#endif - - wxWindowList::compatibility_iterator node = win->GetChildren().GetLast(); - while (node) - { - wxWindow* child = node->GetData(); - wxWindow* foundWin = wxFindWindowAtPoint(child, pt); - if (foundWin) - return foundWin; - node = node->GetPrevious(); - } - - wxPoint pos = win->GetPosition(); - wxSize sz = win->GetSize(); - if ( !win->IsTopLevel() && win->GetParent() ) - { - pos = win->GetParent()->ClientToScreen(pos); - } - - wxRect rect(pos, sz); - if (rect.Contains(pt)) - return win; - - return NULL; -} - -wxWindow* wxGenericFindWindowAtPoint(const wxPoint& pt) -{ - // Go backwards through the list since windows - // on top are likely to have been appended most - // recently. - wxWindowList::compatibility_iterator node = wxTopLevelWindows.GetLast(); - while (node) - { - wxWindow* win = node->GetData(); - wxWindow* found = wxFindWindowAtPoint(win, pt); - if (found) - return found; - node = node->GetPrevious(); - } - return NULL; -} - -// ---------------------------------------------------------------------------- -// GUI helpers -// ---------------------------------------------------------------------------- - -/* - * N.B. these convenience functions must be separate from msgdlgg.cpp, textdlgg.cpp - * since otherwise the generic code may be pulled in unnecessarily. - */ - -#if wxUSE_MSGDLG - -int wxMessageBox(const wxString& message, const wxString& caption, long style, - wxWindow *parent, int WXUNUSED(x), int WXUNUSED(y) ) -{ - long decorated_style = style; - - if ( ( style & ( wxICON_EXCLAMATION | wxICON_HAND | wxICON_INFORMATION | wxICON_QUESTION ) ) == 0 ) - { - decorated_style |= ( style & wxYES ) ? wxICON_QUESTION : wxICON_INFORMATION ; - } - - wxMessageDialog dialog(parent, message, caption, decorated_style); - - int ans = dialog.ShowModal(); - switch ( ans ) - { - case wxID_OK: - return wxOK; - case wxID_YES: - return wxYES; - case wxID_NO: - return wxNO; - case wxID_CANCEL: - return wxCANCEL; - } - - wxFAIL_MSG( _T("unexpected return code from wxMessageDialog") ); - - return wxCANCEL; -} - -#endif // wxUSE_MSGDLG - -#if wxUSE_TEXTDLG - -wxString wxGetTextFromUser(const wxString& message, const wxString& caption, - const wxString& defaultValue, wxWindow *parent, - wxCoord x, wxCoord y, bool centre ) -{ - wxString str; - long style = wxTextEntryDialogStyle; - - if (centre) - style |= wxCENTRE; - else - style &= ~wxCENTRE; - - wxTextEntryDialog dialog(parent, message, caption, defaultValue, style, wxPoint(x, y)); - - if (dialog.ShowModal() == wxID_OK) - { - str = dialog.GetValue(); - } - - return str; -} - -wxString wxGetPasswordFromUser(const wxString& message, - const wxString& caption, - const wxString& defaultValue, - wxWindow *parent, - wxCoord x, wxCoord y, bool centre ) -{ - wxString str; - long style = wxTextEntryDialogStyle; - - if (centre) - style |= wxCENTRE; - else - style &= ~wxCENTRE; - - wxPasswordEntryDialog dialog(parent, message, caption, defaultValue, - style, wxPoint(x, y)); - if ( dialog.ShowModal() == wxID_OK ) - { - str = dialog.GetValue(); - } - - return str; -} - -#endif // wxUSE_TEXTDLG - -#if wxUSE_COLOURDLG - -wxColour wxGetColourFromUser(wxWindow *parent, const wxColour& colInit, const wxString& caption) -{ - static wxColourData data; - data.SetChooseFull(true); - if ( colInit.Ok() ) - { - data.SetColour((wxColour &)colInit); // const_cast - } - - wxColour colRet; - wxColourDialog dialog(parent, &data); - if (!caption.empty()) - dialog.SetTitle(caption); - if ( dialog.ShowModal() == wxID_OK ) - { - colRet = dialog.GetColourData().GetColour(); - } - //else: leave it invalid - - return colRet; -} - -#endif // wxUSE_COLOURDLG - -#if wxUSE_FONTDLG - -wxFont wxGetFontFromUser(wxWindow *parent, const wxFont& fontInit, const wxString& caption) -{ - wxFontData data; - if ( fontInit.Ok() ) - { - data.SetInitialFont(fontInit); - } - - wxFont fontRet; - wxFontDialog dialog(parent, data); - if (!caption.empty()) - dialog.SetTitle(caption); - if ( dialog.ShowModal() == wxID_OK ) - { - fontRet = dialog.GetFontData().GetChosenFont(); - } - //else: leave it invalid - - return fontRet; -} - -#endif // wxUSE_FONTDLG - -// ---------------------------------------------------------------------------- -// wxSafeYield and supporting functions -// ---------------------------------------------------------------------------- - -void wxEnableTopLevelWindows(bool enable) -{ - wxWindowList::compatibility_iterator node; - for ( node = wxTopLevelWindows.GetFirst(); node; node = node->GetNext() ) - node->GetData()->Enable(enable); -} - -wxWindowDisabler::wxWindowDisabler(wxWindow *winToSkip) -{ - // remember the top level windows which were already disabled, so that we - // don't reenable them later - m_winDisabled = NULL; - - wxWindowList::compatibility_iterator node; - for ( node = wxTopLevelWindows.GetFirst(); node; node = node->GetNext() ) - { - wxWindow *winTop = node->GetData(); - if ( winTop == winToSkip ) - continue; - - // we don't need to disable the hidden or already disabled windows - if ( winTop->IsEnabled() && winTop->IsShown() ) - { - winTop->Disable(); - } - else - { - if ( !m_winDisabled ) - { - m_winDisabled = new wxWindowList; - } - - m_winDisabled->Append(winTop); - } - } -} - -wxWindowDisabler::~wxWindowDisabler() -{ - wxWindowList::compatibility_iterator node; - for ( node = wxTopLevelWindows.GetFirst(); node; node = node->GetNext() ) - { - wxWindow *winTop = node->GetData(); - if ( !m_winDisabled || !m_winDisabled->Find(winTop) ) - { - winTop->Enable(); - } - //else: had been already disabled, don't reenable - } - - delete m_winDisabled; -} - -// Yield to other apps/messages and disable user input to all windows except -// the given one -bool wxSafeYield(wxWindow *win, bool onlyIfNeeded) -{ - wxWindowDisabler wd(win); - - bool rc; - if (onlyIfNeeded) - rc = wxYieldIfNeeded(); - else - rc = wxYield(); - - return rc; -} - -// Don't synthesize KeyUp events holding down a key and producing KeyDown -// events with autorepeat. On by default and always on in wxMSW. wxGTK version -// in utilsgtk.cpp. -#ifndef __WXGTK__ -bool wxSetDetectableAutoRepeat( bool WXUNUSED(flag) ) -{ - return true; // detectable auto-repeat is the only mode MSW supports -} -#endif // !wxGTK - -#endif // wxUSE_GUI diff --git a/wxWidgets/src/common/valgen.cpp b/wxWidgets/src/common/valgen.cpp deleted file mode 100644 index b010537ce2..0000000000 --- a/wxWidgets/src/common/valgen.cpp +++ /dev/null @@ -1,591 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/common/valgen.cpp -// Purpose: wxGenericValidator class -// Author: Kevin Smith -// Modified by: -// Created: Jan 22 1999 -// RCS-ID: $Id: valgen.cpp 39463 2006-05-29 21:26:35Z ABX $ -// Copyright: (c) 1999 Kevin Smith -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_VALIDATORS - -#ifndef WX_PRECOMP - #include "wx/dynarray.h" - #include "wx/utils.h" - #include "wx/intl.h" - #include "wx/choice.h" - #include "wx/combobox.h" - #include "wx/radiobox.h" - #include "wx/radiobut.h" - #include "wx/checkbox.h" - #include "wx/scrolbar.h" - #include "wx/gauge.h" - #include "wx/stattext.h" - #include "wx/textctrl.h" - #include "wx/button.h" - #include "wx/listbox.h" - #include "wx/slider.h" - #include "wx/checklst.h" -#endif - -#include "wx/spinctrl.h" - -#if wxUSE_SPINBTN - #include "wx/spinbutt.h" -#endif -#if wxUSE_TOGGLEBTN - #include "wx/tglbtn.h" -#endif - -#include "wx/valgen.h" - -IMPLEMENT_CLASS(wxGenericValidator, wxValidator) - -wxGenericValidator::wxGenericValidator(bool *val) -{ - Initialize(); - m_pBool = val; -} - -wxGenericValidator::wxGenericValidator(int *val) -{ - Initialize(); - m_pInt = val; -} - -wxGenericValidator::wxGenericValidator(wxString *val) -{ - Initialize(); - m_pString = val; -} - -wxGenericValidator::wxGenericValidator(wxArrayInt *val) -{ - Initialize(); - m_pArrayInt = val; -} - -wxGenericValidator::wxGenericValidator(const wxGenericValidator& val) - : wxValidator() -{ - Copy(val); -} - -bool wxGenericValidator::Copy(const wxGenericValidator& val) -{ - wxValidator::Copy(val); - - m_pBool = val.m_pBool; - m_pInt = val.m_pInt; - m_pString = val.m_pString; - m_pArrayInt = val.m_pArrayInt; - - return true; -} - -// Called to transfer data to the window -bool wxGenericValidator::TransferToWindow(void) -{ - if ( !m_validatorWindow ) - return false; - - // bool controls -#if wxUSE_CHECKBOX - if (m_validatorWindow->IsKindOf(CLASSINFO(wxCheckBox)) ) - { - wxCheckBox* pControl = (wxCheckBox*) m_validatorWindow; - if (m_pBool) - { - pControl->SetValue(*m_pBool); - return true; - } - } else -#endif -#if wxUSE_RADIOBTN - if (m_validatorWindow->IsKindOf(CLASSINFO(wxRadioButton)) ) - { - wxRadioButton* pControl = (wxRadioButton*) m_validatorWindow; - if (m_pBool) - { - pControl->SetValue(*m_pBool) ; - return true; - } - } else -#endif -#if wxUSE_TOGGLEBTN - if (m_validatorWindow->IsKindOf(CLASSINFO(wxToggleButton)) ) - { - wxToggleButton * pControl = (wxToggleButton *) m_validatorWindow; - if (m_pBool) - { - pControl->SetValue(*m_pBool); - return true; - } - } else -#endif - - // int controls -#if wxUSE_GAUGE - if (m_validatorWindow->IsKindOf(CLASSINFO(wxGauge)) ) - { - wxGauge* pControl = (wxGauge*) m_validatorWindow; - if (m_pInt) - { - pControl->SetValue(*m_pInt); - return true; - } - } else -#endif -#if wxUSE_RADIOBOX - if (m_validatorWindow->IsKindOf(CLASSINFO(wxRadioBox)) ) - { - wxRadioBox* pControl = (wxRadioBox*) m_validatorWindow; - if (m_pInt) - { - pControl->SetSelection(*m_pInt) ; - return true; - } - } else -#endif -#if wxUSE_SCROLLBAR - if (m_validatorWindow->IsKindOf(CLASSINFO(wxScrollBar)) ) - { - wxScrollBar* pControl = (wxScrollBar*) m_validatorWindow; - if (m_pInt) - { - pControl->SetThumbPosition(*m_pInt) ; - return true; - } - } else -#endif -#if wxUSE_SPINCTRL && !defined(__WXMOTIF__) - if (m_validatorWindow->IsKindOf(CLASSINFO(wxSpinCtrl)) ) - { - wxSpinCtrl* pControl = (wxSpinCtrl*) m_validatorWindow; - if (m_pInt) - { - pControl->SetValue(*m_pInt); - return true; - } - } else -#endif -#if wxUSE_SPINBTN - if (m_validatorWindow->IsKindOf(CLASSINFO(wxSpinButton)) ) - { - wxSpinButton* pControl = (wxSpinButton*) m_validatorWindow; - if (m_pInt) - { - pControl->SetValue(*m_pInt) ; - return true; - } - } else -#endif -#if wxUSE_SLIDER - if (m_validatorWindow->IsKindOf(CLASSINFO(wxSlider)) ) - { - wxSlider* pControl = (wxSlider*) m_validatorWindow; - if (m_pInt) - { - pControl->SetValue(*m_pInt) ; - return true; - } - } else -#endif - - // string controls -#if wxUSE_BUTTON - if (m_validatorWindow->IsKindOf(CLASSINFO(wxButton)) ) - { - wxButton* pControl = (wxButton*) m_validatorWindow; - if (m_pString) - { - pControl->SetLabel(*m_pString) ; - return true; - } - } else -#endif -#if wxUSE_COMBOBOX - if (m_validatorWindow->IsKindOf(CLASSINFO(wxComboBox)) ) - { - wxComboBox* pControl = (wxComboBox*) m_validatorWindow; - if (m_pInt) - { - pControl->SetSelection(*m_pInt) ; - return true; - } - else if (m_pString) - { - if (pControl->FindString(* m_pString) != wxNOT_FOUND) - { - pControl->SetStringSelection(* m_pString); - } - if ((m_validatorWindow->GetWindowStyle() & wxCB_READONLY) == 0) - { - pControl->SetValue(* m_pString); - } - return true; - } - } else -#endif -#if wxUSE_CHOICE - if (m_validatorWindow->IsKindOf(CLASSINFO(wxChoice)) ) - { - wxChoice* pControl = (wxChoice*) m_validatorWindow; - if (m_pInt) - { - pControl->SetSelection(*m_pInt) ; - return true; - } - else if (m_pString) - { - if (pControl->FindString(* m_pString) != wxNOT_FOUND) - { - pControl->SetStringSelection(* m_pString); - } - return true; - } - } else -#endif -#if wxUSE_STATTEXT - if (m_validatorWindow->IsKindOf(CLASSINFO(wxStaticText)) ) - { - wxStaticText* pControl = (wxStaticText*) m_validatorWindow; - if (m_pString) - { - pControl->SetLabel(*m_pString) ; - return true; - } - } else -#endif -#if wxUSE_TEXTCTRL - if (m_validatorWindow->IsKindOf(CLASSINFO(wxTextCtrl)) ) - { - wxTextCtrl* pControl = (wxTextCtrl*) m_validatorWindow; - if (m_pString) - { - pControl->SetValue(*m_pString) ; - return true; - } - else if (m_pInt) - { - wxString str; - str.Printf(wxT("%d"), *m_pInt); - pControl->SetValue(str); - return true; - } - } else -#endif - - // array controls -#if wxUSE_CHECKLISTBOX - // NOTE: wxCheckListBox is a wxListBox, so wxCheckListBox MUST come first: - if (m_validatorWindow->IsKindOf(CLASSINFO(wxCheckListBox)) ) - { - wxCheckListBox* pControl = (wxCheckListBox*) m_validatorWindow; - if (m_pArrayInt) - { - // clear all selections - size_t i, - count = pControl->GetCount(); - for ( i = 0 ; i < count; i++ ) - pControl->Check(i, false); - - // select each item in our array - count = m_pArrayInt->GetCount(); - for ( i = 0 ; i < count; i++ ) - pControl->Check(m_pArrayInt->Item(i)); - - return true; - } - else - return false; - } else -#endif -#if wxUSE_LISTBOX - if (m_validatorWindow->IsKindOf(CLASSINFO(wxListBox)) ) - { - wxListBox* pControl = (wxListBox*) m_validatorWindow; - if (m_pArrayInt) - { - // clear all selections - size_t i, - count = pControl->GetCount(); - for ( i = 0 ; i < count; i++ ) - pControl->Deselect(i); - - // select each item in our array - count = m_pArrayInt->GetCount(); - for ( i = 0 ; i < count; i++ ) - pControl->SetSelection(m_pArrayInt->Item(i)); - - return true; - } - } else -#endif - ; // to match the last 'else' above - - // unrecognized control, or bad pointer - return false; -} - -// Called to transfer data from the window -bool wxGenericValidator::TransferFromWindow(void) -{ - if ( !m_validatorWindow ) - return false; - - // BOOL CONTROLS ************************************** -#if wxUSE_CHECKBOX - if (m_validatorWindow->IsKindOf(CLASSINFO(wxCheckBox)) ) - { - wxCheckBox* pControl = (wxCheckBox*) m_validatorWindow; - if (m_pBool) - { - *m_pBool = pControl->GetValue() ; - return true; - } - } else -#endif -#if wxUSE_RADIOBTN - if (m_validatorWindow->IsKindOf(CLASSINFO(wxRadioButton)) ) - { - wxRadioButton* pControl = (wxRadioButton*) m_validatorWindow; - if (m_pBool) - { - *m_pBool = pControl->GetValue() ; - return true; - } - } else -#endif -#if wxUSE_TOGGLEBTN - if (m_validatorWindow->IsKindOf(CLASSINFO(wxToggleButton)) ) - { - wxToggleButton *pControl = (wxToggleButton *) m_validatorWindow; - if (m_pBool) - { - *m_pBool = pControl->GetValue() ; - return true; - } - } else -#endif - - // INT CONTROLS *************************************** -#if wxUSE_GAUGE - if (m_validatorWindow->IsKindOf(CLASSINFO(wxGauge)) ) - { - wxGauge* pControl = (wxGauge*) m_validatorWindow; - if (m_pInt) - { - *m_pInt = pControl->GetValue() ; - return true; - } - } else -#endif -#if wxUSE_RADIOBOX - if (m_validatorWindow->IsKindOf(CLASSINFO(wxRadioBox)) ) - { - wxRadioBox* pControl = (wxRadioBox*) m_validatorWindow; - if (m_pInt) - { - *m_pInt = pControl->GetSelection() ; - return true; - } - } else -#endif -#if wxUSE_SCROLLBAR - if (m_validatorWindow->IsKindOf(CLASSINFO(wxScrollBar)) ) - { - wxScrollBar* pControl = (wxScrollBar*) m_validatorWindow; - if (m_pInt) - { - *m_pInt = pControl->GetThumbPosition() ; - return true; - } - } else -#endif -#if wxUSE_SPINCTRL && !defined(__WXMOTIF__) - if (m_validatorWindow->IsKindOf(CLASSINFO(wxSpinCtrl)) ) - { - wxSpinCtrl* pControl = (wxSpinCtrl*) m_validatorWindow; - if (m_pInt) - { - *m_pInt=pControl->GetValue(); - return true; - } - } else -#endif -#if wxUSE_SPINBTN - if (m_validatorWindow->IsKindOf(CLASSINFO(wxSpinButton)) ) - { - wxSpinButton* pControl = (wxSpinButton*) m_validatorWindow; - if (m_pInt) - { - *m_pInt = pControl->GetValue() ; - return true; - } - } else -#endif -#if wxUSE_SLIDER - if (m_validatorWindow->IsKindOf(CLASSINFO(wxSlider)) ) - { - wxSlider* pControl = (wxSlider*) m_validatorWindow; - if (m_pInt) - { - *m_pInt = pControl->GetValue() ; - return true; - } - } else -#endif - - // STRING CONTROLS ************************************ -#if wxUSE_BUTTON - if (m_validatorWindow->IsKindOf(CLASSINFO(wxButton)) ) - { - wxButton* pControl = (wxButton*) m_validatorWindow; - if (m_pString) - { - *m_pString = pControl->GetLabel() ; - return true; - } - } else -#endif -#if wxUSE_COMBOBOX - if (m_validatorWindow->IsKindOf(CLASSINFO(wxComboBox)) ) - { - wxComboBox* pControl = (wxComboBox*) m_validatorWindow; - if (m_pInt) - { - *m_pInt = pControl->GetSelection() ; - return true; - } - else if (m_pString) - { - if (m_validatorWindow->GetWindowStyle() & wxCB_READONLY) - *m_pString = pControl->GetStringSelection(); - else - *m_pString = pControl->GetValue(); - return true; - } - } else -#endif -#if wxUSE_CHOICE - if (m_validatorWindow->IsKindOf(CLASSINFO(wxChoice)) ) - { - wxChoice* pControl = (wxChoice*) m_validatorWindow; - if (m_pInt) - { - *m_pInt = pControl->GetSelection() ; - return true; - } - else if (m_pString) - { - *m_pString = pControl->GetStringSelection(); - return true; - } - } else -#endif -#if wxUSE_STATTEXT - if (m_validatorWindow->IsKindOf(CLASSINFO(wxStaticText)) ) - { - wxStaticText* pControl = (wxStaticText*) m_validatorWindow; - if (m_pString) - { - *m_pString = pControl->GetLabel() ; - return true; - } - } else -#endif -#if wxUSE_TEXTCTRL - if (m_validatorWindow->IsKindOf(CLASSINFO(wxTextCtrl)) ) - { - wxTextCtrl* pControl = (wxTextCtrl*) m_validatorWindow; - if (m_pString) - { - *m_pString = pControl->GetValue() ; - return true; - } - else if (m_pInt) - { - *m_pInt = wxAtoi(pControl->GetValue()); - return true; - } - } else -#endif - - // ARRAY CONTROLS ************************************* -#if wxUSE_CHECKLISTBOX - // NOTE: wxCheckListBox isa wxListBox, so wxCheckListBox MUST come first: - if (m_validatorWindow->IsKindOf(CLASSINFO(wxCheckListBox)) ) - { - wxCheckListBox* pControl = (wxCheckListBox*) m_validatorWindow; - if (m_pArrayInt) - { - // clear our array - m_pArrayInt->Clear(); - - // add each selected item to our array - size_t i, - count = pControl->GetCount(); - for ( i = 0; i < count; i++ ) - { - if (pControl->IsChecked(i)) - m_pArrayInt->Add(i); - } - - return true; - } - else - return false; - } else -#endif -#if wxUSE_LISTBOX - if (m_validatorWindow->IsKindOf(CLASSINFO(wxListBox)) ) - { - wxListBox* pControl = (wxListBox*) m_validatorWindow; - if (m_pArrayInt) - { - // clear our array - m_pArrayInt->Clear(); - - // add each selected item to our array - size_t i, - count = pControl->GetCount(); - for ( i = 0; i < count; i++ ) - { - if (pControl->IsSelected(i)) - m_pArrayInt->Add(i); - } - - return true; - } - } else -#endif - - // unrecognized control, or bad pointer - return false; - - return false; -} - -/* - Called by constructors to initialize ALL data members -*/ -void wxGenericValidator::Initialize() -{ - m_pBool = 0; - m_pInt = 0; - m_pString = 0; - m_pArrayInt = 0; -} - -#endif - // wxUSE_VALIDATORS diff --git a/wxWidgets/src/common/validate.cpp b/wxWidgets/src/common/validate.cpp deleted file mode 100644 index e01711baeb..0000000000 --- a/wxWidgets/src/common/validate.cpp +++ /dev/null @@ -1,45 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/common/validate.cpp -// Purpose: wxValidator -// Author: Julian Smart -// Modified by: -// Created: 04/01/98 -// RCS-ID: $Id: validate.cpp 39656 2006-06-09 21:21:53Z ABX $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_VALIDATORS - -#include "wx/validate.h" - -#ifndef WX_PRECOMP - #include "wx/window.h" -#endif - -const wxValidator wxDefaultValidator; - -IMPLEMENT_DYNAMIC_CLASS(wxValidator, wxEvtHandler) - -// VZ: personally, I think true would be more appropriate - these bells are -// _annoying_ -bool wxValidator::ms_isSilent = false; - -wxValidator::wxValidator() -{ - m_validatorWindow = (wxWindow *) NULL; -} - -wxValidator::~wxValidator() -{ -} - -#endif - // wxUSE_VALIDATORS diff --git a/wxWidgets/src/common/valtext.cpp b/wxWidgets/src/common/valtext.cpp deleted file mode 100644 index 6f3d8b5609..0000000000 --- a/wxWidgets/src/common/valtext.cpp +++ /dev/null @@ -1,344 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/common/valtext.cpp -// Purpose: wxTextValidator -// Author: Julian Smart -// Modified by: -// Created: 04/01/98 -// RCS-ID: $Id: valtext.cpp 39656 2006-06-09 21:21:53Z ABX $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_VALIDATORS && wxUSE_TEXTCTRL - -#include "wx/valtext.h" - -#ifndef WX_PRECOMP - #include - #include "wx/textctrl.h" - #include "wx/utils.h" - #include "wx/msgdlg.h" - #include "wx/intl.h" -#endif - -#include -#include -#include - -#ifdef __SALFORDC__ - #include -#endif - -IMPLEMENT_DYNAMIC_CLASS(wxTextValidator, wxValidator) - -BEGIN_EVENT_TABLE(wxTextValidator, wxValidator) - EVT_CHAR(wxTextValidator::OnChar) -END_EVENT_TABLE() - -static bool wxIsNumeric(const wxString& val); - -wxTextValidator::wxTextValidator(long style, wxString *val) -{ - m_validatorStyle = style; - m_stringValue = val; -/* - m_refData = new wxVTextRefData; - - M_VTEXTDATA->m_validatorStyle = style; - M_VTEXTDATA->m_stringValue = val; -*/ -} - -wxTextValidator::wxTextValidator(const wxTextValidator& val) - : wxValidator() -{ - Copy(val); -} - -bool wxTextValidator::Copy(const wxTextValidator& val) -{ - wxValidator::Copy(val); - - m_validatorStyle = val.m_validatorStyle; - m_stringValue = val.m_stringValue; - - m_includes = val.m_includes; - m_excludes = val.m_excludes; - - return true; -} - -static bool wxIsAlpha(const wxString& val) -{ - int i; - for ( i = 0; i < (int)val.length(); i++) - { - if (!wxIsalpha(val[i])) - return false; - } - return true; -} - -static bool wxIsAlphaNumeric(const wxString& val) -{ - int i; - for ( i = 0; i < (int)val.length(); i++) - { - if (!wxIsalnum(val[i])) - return false; - } - return true; -} - -// Called when the value in the window must be validated. -// This function can pop up an error message. -bool wxTextValidator::Validate(wxWindow *parent) -{ - if( !CheckValidator() ) - return false; - - wxTextCtrl *control = (wxTextCtrl *) m_validatorWindow; - - // If window is disabled, simply return - if ( !control->IsEnabled() ) - return true; - - wxString val(control->GetValue()); - - bool ok = true; - - // NB: this format string should contian exactly one '%s' - wxString errormsg; - - bool includes = (m_validatorStyle & wxFILTER_INCLUDE_LIST) != 0; - if ( includes || (m_validatorStyle & wxFILTER_EXCLUDE_LIST) ) - { - // if includes, it's only ok to have the members of the list, - // otherwise it's only ok to have non-members - ok = includes == (m_includes.Index(val) != wxNOT_FOUND); - if ( !ok ) - { - errormsg = _("'%s' is invalid"); - } - } - else if ( (m_validatorStyle & wxFILTER_ASCII) && !val.IsAscii() ) - { - ok = false; - - errormsg = _("'%s' should only contain ASCII characters."); - } - else if ( (m_validatorStyle & wxFILTER_ALPHA) && !wxIsAlpha(val) ) - { - ok = false; - - errormsg = _("'%s' should only contain alphabetic characters."); - } - else if ( (m_validatorStyle & wxFILTER_ALPHANUMERIC) && !wxIsAlphaNumeric(val)) - { - ok = false; - - errormsg = _("'%s' should only contain alphabetic or numeric characters."); - } - else if ( (m_validatorStyle & wxFILTER_NUMERIC) && !wxIsNumeric(val)) - { - ok = false; - - errormsg = _("'%s' should be numeric."); - } - else if ( (m_validatorStyle & wxFILTER_INCLUDE_CHAR_LIST) && !IsInCharIncludes(val)) - { - //it's only ok to have the members of the list - errormsg = _("'%s' is invalid"); - ok = false; - } - else if ( (m_validatorStyle & wxFILTER_EXCLUDE_CHAR_LIST) && !IsNotInCharExcludes(val)) - { - // it's only ok to have non-members of the list - errormsg = _("'%s' is invalid"); - ok = false; - } - - if ( !ok ) - { - wxASSERT_MSG( !errormsg.empty(), _T("you forgot to set errormsg") ); - - m_validatorWindow->SetFocus(); - - wxString buf; - buf.Printf(errormsg, val.c_str()); - - wxMessageBox(buf, _("Validation conflict"), - wxOK | wxICON_EXCLAMATION, parent); - } - - return ok; -} - -// Called to transfer data to the window -bool wxTextValidator::TransferToWindow(void) -{ - if( !CheckValidator() ) - return false; - - if ( m_stringValue ) - { - wxTextCtrl *control = (wxTextCtrl *) m_validatorWindow; - control->SetValue(* m_stringValue); - } - - return true; -} - -// Called to transfer data to the window -bool wxTextValidator::TransferFromWindow(void) -{ - if( !CheckValidator() ) - return false; - - if ( m_stringValue ) - { - wxTextCtrl *control = (wxTextCtrl *) m_validatorWindow; - *m_stringValue = control->GetValue(); - } - - return true; -} - -#if WXWIN_COMPATIBILITY_2_4 - -inline void wxCopyStringListToArrayString(wxArrayString& to, const wxStringList& from) -{ - to.Clear(); - - for ( wxStringList::compatibility_iterator pNode = from.GetFirst(); - pNode; - pNode = pNode->GetNext() ) - { - to.Add(pNode->GetData()); - } -} - -inline void wxCopyArrayStringToStringList(wxStringList& to, const wxArrayString& from) -{ - to.Clear(); - - for(size_t i = 0; i < from.GetCount(); ++i) - to.Add(from[i]); -} - -wxStringList& wxTextValidator::GetIncludeList() -{ - wxCopyArrayStringToStringList(m_includeList, m_includes); - return m_includeList; -} - -wxStringList& wxTextValidator::GetExcludeList() -{ - wxCopyArrayStringToStringList(m_excludeList, m_excludes); - return m_excludeList; -} - -void wxTextValidator::SetIncludeList(const wxStringList& list) -{ - wxCopyStringListToArrayString(m_includes, list); -} - -void wxTextValidator::SetExcludeList(const wxStringList& list) -{ - wxCopyStringListToArrayString(m_excludes, list); -} - -bool wxTextValidator::IsInCharIncludeList(const wxString& val) -{ - return IsInCharIncludes(val); -} - -bool wxTextValidator::IsNotInCharExcludeList(const wxString& val) -{ - return IsNotInCharExcludes(val); -} - -#endif //compat 2.4 - - -bool wxTextValidator::IsInCharIncludes(const wxString& val) -{ - size_t i; - for ( i = 0; i < val.length(); i++) - { - if (m_includes.Index((wxString) val[i]) == wxNOT_FOUND) - return false; - } - return true; -} - -bool wxTextValidator::IsNotInCharExcludes(const wxString& val) -{ - size_t i; - for ( i = 0; i < val.length(); i++) - { - if (m_excludes.Index((wxString) val[i]) != wxNOT_FOUND) - return false; - } - return true; -} - -void wxTextValidator::OnChar(wxKeyEvent& event) -{ -/* - if ( !M_VTEXTDATA ) - return; -*/ - - if ( m_validatorWindow ) - { - int keyCode = event.GetKeyCode(); - - // we don't filter special keys and Delete - if ( - !(keyCode < WXK_SPACE || keyCode == WXK_DELETE || keyCode > WXK_START) && - ( - ((m_validatorStyle & wxFILTER_INCLUDE_CHAR_LIST) && !IsInCharIncludes(wxString((wxChar) keyCode, 1))) || - ((m_validatorStyle & wxFILTER_EXCLUDE_CHAR_LIST) && !IsNotInCharExcludes(wxString((wxChar) keyCode, 1))) || - ((m_validatorStyle & wxFILTER_ASCII) && !isascii(keyCode)) || - ((m_validatorStyle & wxFILTER_ALPHA) && !wxIsalpha(keyCode)) || - ((m_validatorStyle & wxFILTER_ALPHANUMERIC) && !wxIsalnum(keyCode)) || - ((m_validatorStyle & wxFILTER_NUMERIC) && !wxIsdigit(keyCode) - && keyCode != wxT('.') && keyCode != wxT(',') && keyCode != wxT('-') && keyCode != wxT('+') && keyCode != wxT('e') && keyCode != wxT('E')) - ) - ) - { - if ( !wxValidator::IsSilent() ) - wxBell(); - - // eat message - return; - } - } - - event.Skip(); -} - -static bool wxIsNumeric(const wxString& val) -{ - int i; - for ( i = 0; i < (int)val.length(); i++) - { - // Allow for "," (French) as well as "." -- in future we should - // use wxSystemSettings or other to do better localisation - if ((!wxIsdigit(val[i])) && (val[i] != wxT('.')) && (val[i] != wxT(',')) && (val[i] != wxT('e')) && (val[i] != wxT('E')) && (val[i] != wxT('+')) && (val[i] != wxT('-'))) - return false; - } - return true; -} - - -#endif - // wxUSE_VALIDATORS && wxUSE_TEXTCTRL diff --git a/wxWidgets/src/common/variant.cpp b/wxWidgets/src/common/variant.cpp deleted file mode 100644 index eb653c0ff7..0000000000 --- a/wxWidgets/src/common/variant.cpp +++ /dev/null @@ -1,2040 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/common/variant.cpp -// Purpose: wxVariant class, container for any type -// Author: Julian Smart -// Modified by: -// Created: 10/09/98 -// RCS-ID: $Id: variant.cpp 58054 2009-01-12 17:27:53Z JMS $ -// Copyright: (c) -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// For compilers that support precompilation, includes "wx/wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#include "wx/variant.h" - -#if wxUSE_VARIANT - -#ifndef WX_PRECOMP - #include "wx/string.h" - #include "wx/math.h" - #if wxUSE_STREAMS - #include "wx/stream.h" - #endif -#endif - -#if wxUSE_STD_IOSTREAM - #if wxUSE_IOSTREAMH - #include - #else - #include - #endif -#endif - -#if defined(__MWERKS__) && __MSL__ >= 0x6000 -namespace std {} -using namespace std ; -#endif - -#if wxUSE_STREAMS - #include "wx/txtstrm.h" -#endif - -#include "wx/string.h" -#include "wx/tokenzr.h" - -IMPLEMENT_ABSTRACT_CLASS(wxVariantData, wxObject) - -wxVariant WXDLLIMPEXP_BASE wxNullVariant; - - -/* - * wxVariant - */ - -IMPLEMENT_DYNAMIC_CLASS(wxVariant, wxObject) - -wxVariant::wxVariant() -{ - m_data = (wxVariantData*) NULL; -} - -bool wxVariant::IsNull() const -{ - return (m_data == (wxVariantData*) NULL); -} - -void wxVariant::MakeNull() -{ - UnRef(); -} - -void wxVariant::Clear() -{ - m_name = wxEmptyString; -} - -wxVariant::wxVariant(const wxVariant& variant) - : wxObject() -{ - m_data = (wxVariantData*) NULL; - - if (!variant.IsNull()) - Ref(variant); - - m_name = variant.m_name; -} - -wxVariant::wxVariant(wxVariantData* data, const wxString& name) // User-defined data -{ - m_data = data; - m_name = name; -} - -wxVariant::~wxVariant() -{ - UnRef(); -} - -// Assignment -void wxVariant::operator= (const wxVariant& variant) -{ - Ref(variant); - m_name = variant.m_name; -} - -// myVariant = new wxStringVariantData("hello") -void wxVariant::operator= (wxVariantData* variantData) -{ - UnRef(); - m_data = variantData; -} - -bool wxVariant::operator== (const wxVariant& variant) const -{ - if (IsNull() || variant.IsNull()) - return (IsNull() == variant.IsNull()); - - return (GetData()->Eq(* variant.GetData())); -} - -bool wxVariant::operator!= (const wxVariant& variant) const -{ - return (!(*this == variant)); -} - - -wxString wxVariant::MakeString() const -{ - if (!IsNull()) - { - wxString str; - if (GetData()->Write(str)) - return str; - } - return wxEmptyString; -} - -void wxVariant::SetData(wxVariantData* data) -{ - UnRef(); - m_data = data; -} - -void wxVariant::Ref(const wxVariant& clone) -{ - // nothing to be done - if (m_data == clone.m_data) - return; - - // delete reference to old data - UnRef(); - - // reference new data - if ( clone.m_data ) - { - m_data = clone.m_data; - m_data->m_count++; - } -} - - -void wxVariant::UnRef() -{ - if ( m_data ) - { - wxASSERT_MSG( m_data->m_count > 0, _T("invalid ref data count") ); - - m_data->DecRef(); - m_data = NULL; - } -} - - -// Returns a string representing the type of the variant, -// e.g. "string", "bool", "list", "double", "long" -wxString wxVariant::GetType() const -{ - if (IsNull()) - return wxString(wxT("null")); - else - return GetData()->GetType(); -} - - -bool wxVariant::IsType(const wxString& type) const -{ - return (GetType() == type); -} - -bool wxVariant::IsValueKindOf(const wxClassInfo* type) const -{ - wxClassInfo* info=GetData()->GetValueClassInfo(); - return info ? info->IsKindOf(type) : false ; -} - - -// ----------------------------------------------------------------- -// wxVariantDataLong -// ----------------------------------------------------------------- - -class WXDLLIMPEXP_BASE wxVariantDataLong: public wxVariantData -{ -DECLARE_DYNAMIC_CLASS(wxVariantDataLong) -public: - wxVariantDataLong() { m_value = 0; } - wxVariantDataLong(long value) { m_value = value; } - - inline long GetValue() const { return m_value; } - inline void SetValue(long value) { m_value = value; } - - virtual bool Eq(wxVariantData& data) const; - - virtual bool Read(wxString& str); - virtual bool Write(wxString& str) const; -#if wxUSE_STD_IOSTREAM - virtual bool Read(wxSTD istream& str); - virtual bool Write(wxSTD ostream& str) const; -#endif -#if wxUSE_STREAMS - virtual bool Read(wxInputStream& str); - virtual bool Write(wxOutputStream &str) const; -#endif // wxUSE_STREAMS - - virtual wxString GetType() const { return wxT("long"); } - -protected: - long m_value; -}; - -IMPLEMENT_DYNAMIC_CLASS(wxVariantDataLong, wxVariantData) - -bool wxVariantDataLong::Eq(wxVariantData& data) const -{ - wxASSERT_MSG( (data.GetType() == wxT("long")), wxT("wxVariantDataLong::Eq: argument mismatch") ); - - wxVariantDataLong& otherData = (wxVariantDataLong&) data; - - return (otherData.m_value == m_value); -} - -#if wxUSE_STD_IOSTREAM -bool wxVariantDataLong::Write(wxSTD ostream& str) const -{ - wxString s; - Write(s); - str << (const char*) s.mb_str(); - return true; -} -#endif - -bool wxVariantDataLong::Write(wxString& str) const -{ - str.Printf(wxT("%ld"), m_value); - return true; -} - -#if wxUSE_STD_IOSTREAM -bool wxVariantDataLong::Read(wxSTD istream& str) -{ - str >> m_value; - return true; -} -#endif - -#if wxUSE_STREAMS -bool wxVariantDataLong::Write(wxOutputStream& str) const -{ - wxTextOutputStream s(str); - - s.Write32((size_t)m_value); - return true; -} - -bool wxVariantDataLong::Read(wxInputStream& str) -{ - wxTextInputStream s(str); - m_value = s.Read32(); - return true; -} -#endif // wxUSE_STREAMS - -bool wxVariantDataLong::Read(wxString& str) -{ - m_value = wxAtol((const wxChar*) str); - return true; -} - -// wxVariant - -wxVariant::wxVariant(long val, const wxString& name) -{ - m_data = new wxVariantDataLong(val); - m_name = name; -} - -wxVariant::wxVariant(int val, const wxString& name) -{ - m_data = new wxVariantDataLong((long)val); - m_name = name; -} - -wxVariant::wxVariant(short val, const wxString& name) -{ - m_data = new wxVariantDataLong((long)val); - m_name = name; -} - -bool wxVariant::operator== (long value) const -{ - long thisValue; - if (!Convert(&thisValue)) - return false; - else - return (value == thisValue); -} - -bool wxVariant::operator!= (long value) const -{ - return (!((*this) == value)); -} - -void wxVariant::operator= (long value) -{ - if (GetType() == wxT("long") && - m_data->GetRefCount() == 1) - { - ((wxVariantDataLong*)GetData())->SetValue(value); - } - else - { - UnRef(); - m_data = new wxVariantDataLong(value); - } -} - -long wxVariant::GetLong() const -{ - long value; - if (Convert(& value)) - return value; - else - { - wxFAIL_MSG(wxT("Could not convert to a long")); - return 0; - } -} - -// ----------------------------------------------------------------- -// wxVariantDoubleData -// ----------------------------------------------------------------- - -class WXDLLIMPEXP_BASE wxVariantDoubleData: public wxVariantData -{ -DECLARE_DYNAMIC_CLASS(wxVariantDoubleData) -public: - wxVariantDoubleData() { m_value = 0.0; } - wxVariantDoubleData(double value) { m_value = value; } - - inline double GetValue() const { return m_value; } - inline void SetValue(double value) { m_value = value; } - - virtual bool Eq(wxVariantData& data) const; - virtual bool Read(wxString& str); -#if wxUSE_STD_IOSTREAM - virtual bool Write(wxSTD ostream& str) const; -#endif - virtual bool Write(wxString& str) const; -#if wxUSE_STD_IOSTREAM - virtual bool Read(wxSTD istream& str); -#endif -#if wxUSE_STREAMS - virtual bool Read(wxInputStream& str); - virtual bool Write(wxOutputStream &str) const; -#endif // wxUSE_STREAMS - virtual wxString GetType() const { return wxT("double"); } - -protected: - double m_value; -}; - -IMPLEMENT_DYNAMIC_CLASS(wxVariantDoubleData, wxVariantData) - -bool wxVariantDoubleData::Eq(wxVariantData& data) const -{ - wxASSERT_MSG( (data.GetType() == wxT("double")), wxT("wxVariantDoubleData::Eq: argument mismatch") ); - - wxVariantDoubleData& otherData = (wxVariantDoubleData&) data; - - return wxIsSameDouble(otherData.m_value, m_value); -} - -#if wxUSE_STD_IOSTREAM -bool wxVariantDoubleData::Write(wxSTD ostream& str) const -{ - wxString s; - Write(s); - str << (const char*) s.mb_str(); - return true; -} -#endif - -bool wxVariantDoubleData::Write(wxString& str) const -{ - str.Printf(wxT("%.14g"), m_value); - return true; -} - -#if wxUSE_STD_IOSTREAM -bool wxVariantDoubleData::Read(wxSTD istream& str) -{ - str >> m_value; - return true; -} -#endif - -#if wxUSE_STREAMS -bool wxVariantDoubleData::Write(wxOutputStream& str) const -{ - wxTextOutputStream s(str); - s.WriteDouble((double)m_value); - return true; -} - -bool wxVariantDoubleData::Read(wxInputStream& str) -{ - wxTextInputStream s(str); - m_value = (float)s.ReadDouble(); - return true; -} -#endif // wxUSE_STREAMS - -bool wxVariantDoubleData::Read(wxString& str) -{ - m_value = wxAtof((const wxChar*) str); - return true; -} - -// wxVariant double code - -wxVariant::wxVariant(double val, const wxString& name) -{ - m_data = new wxVariantDoubleData(val); - m_name = name; -} - -bool wxVariant::operator== (double value) const -{ - double thisValue; - if (!Convert(&thisValue)) - return false; - - return wxIsSameDouble(value, thisValue); -} - -bool wxVariant::operator!= (double value) const -{ - return (!((*this) == value)); -} - -void wxVariant::operator= (double value) -{ - if (GetType() == wxT("double") && - m_data->GetRefCount() == 1) - { - ((wxVariantDoubleData*)GetData())->SetValue(value); - } - else - { - UnRef(); - m_data = new wxVariantDoubleData(value); - } -} - -double wxVariant::GetDouble() const -{ - double value; - if (Convert(& value)) - return value; - else - { - wxFAIL_MSG(wxT("Could not convert to a double number")); - return 0.0; - } -} - -// ----------------------------------------------------------------- -// wxVariantBoolData -// ----------------------------------------------------------------- - -#ifdef HAVE_BOOL - -class WXDLLIMPEXP_BASE wxVariantDataBool: public wxVariantData -{ -DECLARE_DYNAMIC_CLASS(wxVariantDataBool) -public: - wxVariantDataBool() { m_value = 0; } - wxVariantDataBool(bool value) { m_value = value; } - - inline bool GetValue() const { return m_value; } - inline void SetValue(bool value) { m_value = value; } - - virtual bool Eq(wxVariantData& data) const; -#if wxUSE_STD_IOSTREAM - virtual bool Write(wxSTD ostream& str) const; -#endif - virtual bool Write(wxString& str) const; - virtual bool Read(wxString& str); -#if wxUSE_STD_IOSTREAM - virtual bool Read(wxSTD istream& str); -#endif -#if wxUSE_STREAMS - virtual bool Read(wxInputStream& str); - virtual bool Write(wxOutputStream& str) const; -#endif // wxUSE_STREAMS - virtual wxString GetType() const { return wxT("bool"); } - -protected: - bool m_value; -}; - -IMPLEMENT_DYNAMIC_CLASS(wxVariantDataBool, wxVariantData) - -bool wxVariantDataBool::Eq(wxVariantData& data) const -{ - wxASSERT_MSG( (data.GetType() == wxT("bool")), wxT("wxVariantDataBool::Eq: argument mismatch") ); - - wxVariantDataBool& otherData = (wxVariantDataBool&) data; - - return (otherData.m_value == m_value); -} - -#if wxUSE_STD_IOSTREAM -bool wxVariantDataBool::Write(wxSTD ostream& str) const -{ - wxString s; - Write(s); - str << (const char*) s.mb_str(); - return true; -} -#endif - -bool wxVariantDataBool::Write(wxString& str) const -{ - str.Printf(wxT("%d"), (int) m_value); - return true; -} - -#if wxUSE_STD_IOSTREAM -bool wxVariantDataBool::Read(wxSTD istream& WXUNUSED(str)) -{ - wxFAIL_MSG(wxT("Unimplemented")); -// str >> (long) m_value; - return false; -} -#endif - -#if wxUSE_STREAMS -bool wxVariantDataBool::Write(wxOutputStream& str) const -{ - wxTextOutputStream s(str); - - s.Write8(m_value); - return true; -} - -bool wxVariantDataBool::Read(wxInputStream& str) -{ - wxTextInputStream s(str); - - m_value = s.Read8() != 0; - return true; -} -#endif // wxUSE_STREAMS - -bool wxVariantDataBool::Read(wxString& str) -{ - m_value = (wxAtol((const wxChar*) str) != 0); - return true; -} - -// wxVariant **** - -wxVariant::wxVariant(bool val, const wxString& name) -{ - m_data = new wxVariantDataBool(val); - m_name = name; -} - -bool wxVariant::operator== (bool value) const -{ - bool thisValue; - if (!Convert(&thisValue)) - return false; - else - return (value == thisValue); -} - -bool wxVariant::operator!= (bool value) const -{ - return (!((*this) == value)); -} - -void wxVariant::operator= (bool value) -{ - if (GetType() == wxT("bool") && - m_data->GetRefCount() == 1) - { - ((wxVariantDataBool*)GetData())->SetValue(value); - } - else - { - UnRef(); - m_data = new wxVariantDataBool(value); - } -} - -bool wxVariant::GetBool() const -{ - bool value; - if (Convert(& value)) - return value; - else - { - wxFAIL_MSG(wxT("Could not convert to a bool")); - return 0; - } -} - -#endif // HAVE_BOOL - -// ----------------------------------------------------------------- -// wxVariantDataChar -// ----------------------------------------------------------------- - -class WXDLLIMPEXP_BASE wxVariantDataChar: public wxVariantData -{ -DECLARE_DYNAMIC_CLASS(wxVariantDataChar) -public: - wxVariantDataChar() { m_value = 0; } - wxVariantDataChar(wxChar value) { m_value = value; } - - inline wxChar GetValue() const { return m_value; } - inline void SetValue(wxChar value) { m_value = value; } - - virtual bool Eq(wxVariantData& data) const; -#if wxUSE_STD_IOSTREAM - virtual bool Read(wxSTD istream& str); - virtual bool Write(wxSTD ostream& str) const; -#endif - virtual bool Read(wxString& str); - virtual bool Write(wxString& str) const; -#if wxUSE_STREAMS - virtual bool Read(wxInputStream& str); - virtual bool Write(wxOutputStream& str) const; -#endif // wxUSE_STREAMS - virtual wxString GetType() const { return wxT("char"); } - -protected: - wxChar m_value; -}; - -IMPLEMENT_DYNAMIC_CLASS(wxVariantDataChar, wxVariantData) - -bool wxVariantDataChar::Eq(wxVariantData& data) const -{ - wxASSERT_MSG( (data.GetType() == wxT("char")), wxT("wxVariantDataChar::Eq: argument mismatch") ); - - wxVariantDataChar& otherData = (wxVariantDataChar&) data; - - return (otherData.m_value == m_value); -} - -#if wxUSE_STD_IOSTREAM -bool wxVariantDataChar::Write(wxSTD ostream& str) const -{ - wxString s; - Write(s); - str << (const char*) s.mb_str(); - return true; -} -#endif - -bool wxVariantDataChar::Write(wxString& str) const -{ - str.Printf(wxT("%c"), m_value); - return true; -} - -#if wxUSE_STD_IOSTREAM -bool wxVariantDataChar::Read(wxSTD istream& WXUNUSED(str)) -{ - wxFAIL_MSG(wxT("Unimplemented")); - - return false; -} -#endif - -#if wxUSE_STREAMS -bool wxVariantDataChar::Write(wxOutputStream& str) const -{ - wxTextOutputStream s(str); - - s << m_value; - - return true; -} - -bool wxVariantDataChar::Read(wxInputStream& str) -{ - wxTextInputStream s(str); - - s >> m_value; - - return true; -} -#endif // wxUSE_STREAMS - -bool wxVariantDataChar::Read(wxString& str) -{ - m_value = str[size_t(0)]; - return true; -} - -wxVariant::wxVariant(wxChar val, const wxString& name) -{ - m_data = new wxVariantDataChar(val); - m_name = name; -} - -bool wxVariant::operator== (wxChar value) const -{ - wxChar thisValue; - if (!Convert(&thisValue)) - return false; - else - return (value == thisValue); -} - -bool wxVariant::operator!= (wxChar value) const -{ - return (!((*this) == value)); -} - -void wxVariant::operator= (wxChar value) -{ - if (GetType() == wxT("char") && - m_data->GetRefCount() == 1) - { - ((wxVariantDataChar*)GetData())->SetValue(value); - } - else - { - UnRef(); - m_data = new wxVariantDataChar(value); - } -} - -wxChar wxVariant::GetChar() const -{ - wxChar value; - if (Convert(& value)) - return value; - else - { - wxFAIL_MSG(wxT("Could not convert to a char")); - return 0; - } -} - -// ---------------------------------------------------------------------------- -// wxVariantDataString -// ---------------------------------------------------------------------------- - -class WXDLLIMPEXP_BASE wxVariantDataString: public wxVariantData -{ -DECLARE_DYNAMIC_CLASS(wxVariantDataString) -public: - wxVariantDataString() { } - wxVariantDataString(const wxString& value) { m_value = value; } - - inline wxString GetValue() const { return m_value; } - inline void SetValue(const wxString& value) { m_value = value; } - - virtual bool Eq(wxVariantData& data) const; -#if wxUSE_STD_IOSTREAM - virtual bool Write(wxSTD ostream& str) const; -#endif - virtual bool Read(wxString& str); - virtual bool Write(wxString& str) const; -#if wxUSE_STD_IOSTREAM - virtual bool Read(wxSTD istream& WXUNUSED(str)) { return false; } -#endif -#if wxUSE_STREAMS - virtual bool Read(wxInputStream& str); - virtual bool Write(wxOutputStream& str) const; -#endif // wxUSE_STREAMS - virtual wxString GetType() const { return wxT("string"); } - -protected: - wxString m_value; -}; - -bool wxVariantDataString::Eq(wxVariantData& data) const -{ - wxASSERT_MSG( (data.GetType() == wxT("string")), wxT("wxVariantDataString::Eq: argument mismatch") ); - - wxVariantDataString& otherData = (wxVariantDataString&) data; - - return (otherData.m_value == m_value); -} - -#if wxUSE_STD_IOSTREAM -bool wxVariantDataString::Write(wxSTD ostream& str) const -{ - str << (const char*) m_value.mb_str(); - return true; -} -#endif - -bool wxVariantDataString::Write(wxString& str) const -{ - str = m_value; - return true; -} - -#if wxUSE_STREAMS -bool wxVariantDataString::Write(wxOutputStream& str) const -{ - // why doesn't wxOutputStream::operator<< take "const wxString&" - wxTextOutputStream s(str); - s.WriteString(m_value); - return true; -} - -bool wxVariantDataString::Read(wxInputStream& str) -{ - wxTextInputStream s(str); - - m_value = s.ReadLine(); - return true; -} -#endif // wxUSE_STREAMS - -bool wxVariantDataString::Read(wxString& str) -{ - m_value = str; - return true; -} - -IMPLEMENT_DYNAMIC_CLASS(wxVariantDataString, wxVariantData) - -// wxVariant **** - -wxVariant::wxVariant(const wxString& val, const wxString& name) -{ - m_data = new wxVariantDataString(val); - m_name = name; -} - -wxVariant::wxVariant(const wxChar* val, const wxString& name) -{ - m_data = new wxVariantDataString(wxString(val)); - m_name = name; -} - -bool wxVariant::operator== (const wxString& value) const -{ - wxString thisValue; - if (!Convert(&thisValue)) - return false; - - return value == thisValue; -} - -bool wxVariant::operator!= (const wxString& value) const -{ - return (!((*this) == value)); -} - -void wxVariant::operator= (const wxString& value) -{ - if (GetType() == wxT("string") && - m_data->GetRefCount() == 1) - { - ((wxVariantDataString*)GetData())->SetValue(value); - } - else - { - UnRef(); - m_data = new wxVariantDataString(value); - } -} - -void wxVariant::operator= (const wxChar* value) -{ - if (GetType() == wxT("string") && - m_data->GetRefCount() == 1) - { - ((wxVariantDataString*)GetData())->SetValue(wxString(value)); - } - else - { - UnRef(); - m_data = new wxVariantDataString(wxString(value)); - } -} - -wxString wxVariant::GetString() const -{ - wxString value; - if (!Convert(& value)) - { - wxFAIL_MSG(wxT("Could not convert to a string")); - } - - return value; -} - -// ---------------------------------------------------------------------------- -// wxVariantDataWxObjectPtr -// ---------------------------------------------------------------------------- - -class wxVariantDataWxObjectPtr: public wxVariantData -{ -DECLARE_DYNAMIC_CLASS(wxVariantDataWxObjectPtr) -public: - wxVariantDataWxObjectPtr() { } - wxVariantDataWxObjectPtr(wxObject* value) { m_value = value; } - - inline wxObject* GetValue() const { return m_value; } - inline void SetValue(wxObject* value) { m_value = value; } - - virtual bool Eq(wxVariantData& data) const; -#if wxUSE_STD_IOSTREAM - virtual bool Write(wxSTD ostream& str) const; -#endif - virtual bool Write(wxString& str) const; -#if wxUSE_STD_IOSTREAM - virtual bool Read(wxSTD istream& str); -#endif - virtual bool Read(wxString& str); - virtual wxString GetType() const ; - virtual wxVariantData* Clone() { return new wxVariantDataWxObjectPtr; } - - virtual wxClassInfo* GetValueClassInfo() ; -protected: - wxObject* m_value; - - DECLARE_NO_COPY_CLASS(wxVariantDataWxObjectPtr) -}; - -IMPLEMENT_DYNAMIC_CLASS(wxVariantDataWxObjectPtr, wxVariantData) - -bool wxVariantDataWxObjectPtr::Eq(wxVariantData& data) const -{ - wxASSERT_MSG( wxIsKindOf((&data), wxVariantDataWxObjectPtr), wxT("wxVariantDataWxObjectPtr::Eq: argument mismatch") ); - - wxVariantDataWxObjectPtr& otherData = (wxVariantDataWxObjectPtr&) data; - - return (otherData.m_value == m_value); -} - -wxString wxVariantDataWxObjectPtr::GetType() const -{ - wxString returnVal(wxT("wxObject")); - if (m_value) { - returnVal = m_value->GetClassInfo()->GetClassName(); - } - return returnVal; -} - -wxClassInfo* wxVariantDataWxObjectPtr::GetValueClassInfo() -{ - wxClassInfo* returnVal=NULL; - - if (m_value) returnVal = m_value->GetClassInfo(); - - return returnVal; -} - -#if wxUSE_STD_IOSTREAM -bool wxVariantDataWxObjectPtr::Write(wxSTD ostream& str) const -{ - wxString s; - Write(s); - str << (const char*) s.mb_str(); - return true; -} -#endif - -bool wxVariantDataWxObjectPtr::Write(wxString& str) const -{ - str.Printf(wxT("%s(%p)"), GetType().c_str(), wx_static_cast(void*, m_value)); - return true; -} - -#if wxUSE_STD_IOSTREAM -bool wxVariantDataWxObjectPtr::Read(wxSTD istream& WXUNUSED(str)) -{ - // Not implemented - return false; -} -#endif - -bool wxVariantDataWxObjectPtr::Read(wxString& WXUNUSED(str)) -{ - // Not implemented - return false; -} - -// wxVariant - -wxVariant::wxVariant( wxObject* val, const wxString& name) -{ - m_data = new wxVariantDataWxObjectPtr(val); - m_name = name; -} - -bool wxVariant::operator== (wxObject* value) const -{ - return (value == ((wxVariantDataWxObjectPtr*)GetData())->GetValue()); -} - -bool wxVariant::operator!= (wxObject* value) const -{ - return (!((*this) == (wxObject*) value)); -} - -void wxVariant::operator= (wxObject* value) -{ - UnRef(); - m_data = new wxVariantDataWxObjectPtr(value); -} - -wxObject* wxVariant::GetWxObjectPtr() const -{ - wxASSERT(wxIsKindOf(GetData(), wxVariantDataWxObjectPtr)); - return (wxObject*) ((wxVariantDataWxObjectPtr*) m_data)->GetValue(); -} - -// ---------------------------------------------------------------------------- -// wxVariantDataVoidPtr -// ---------------------------------------------------------------------------- - -class wxVariantDataVoidPtr: public wxVariantData -{ -DECLARE_DYNAMIC_CLASS(wxVariantDataVoidPtr) -public: - wxVariantDataVoidPtr() { } - wxVariantDataVoidPtr(void* value) { m_value = value; } - - inline void* GetValue() const { return m_value; } - inline void SetValue(void* value) { m_value = value; } - - virtual bool Eq(wxVariantData& data) const; -#if wxUSE_STD_IOSTREAM - virtual bool Write(wxSTD ostream& str) const; -#endif - virtual bool Write(wxString& str) const; -#if wxUSE_STD_IOSTREAM - virtual bool Read(wxSTD istream& str); -#endif - virtual bool Read(wxString& str); - virtual wxString GetType() const { return wxT("void*"); } - virtual wxVariantData* Clone() { return new wxVariantDataVoidPtr; } - -protected: - void* m_value; - - DECLARE_NO_COPY_CLASS(wxVariantDataVoidPtr) -}; - -IMPLEMENT_DYNAMIC_CLASS(wxVariantDataVoidPtr, wxVariantData) - -bool wxVariantDataVoidPtr::Eq(wxVariantData& data) const -{ - wxASSERT_MSG( (data.GetType() == wxT("void*")), wxT("wxVariantDataVoidPtr::Eq: argument mismatch") ); - - wxVariantDataVoidPtr& otherData = (wxVariantDataVoidPtr&) data; - - return (otherData.m_value == m_value); -} - -#if wxUSE_STD_IOSTREAM -bool wxVariantDataVoidPtr::Write(wxSTD ostream& str) const -{ - wxString s; - Write(s); - str << (const char*) s.mb_str(); - return true; -} -#endif - -bool wxVariantDataVoidPtr::Write(wxString& str) const -{ - str.Printf(wxT("%p"), m_value); - return true; -} - -#if wxUSE_STD_IOSTREAM -bool wxVariantDataVoidPtr::Read(wxSTD istream& WXUNUSED(str)) -{ - // Not implemented - return false; -} -#endif - -bool wxVariantDataVoidPtr::Read(wxString& WXUNUSED(str)) -{ - // Not implemented - return false; -} - -// wxVariant - -wxVariant::wxVariant( void* val, const wxString& name) -{ - m_data = new wxVariantDataVoidPtr(val); - m_name = name; -} - -bool wxVariant::operator== (void* value) const -{ - return (value == ((wxVariantDataVoidPtr*)GetData())->GetValue()); -} - -bool wxVariant::operator!= (void* value) const -{ - return (!((*this) == (void*) value)); -} - -void wxVariant::operator= (void* value) -{ - if (GetType() == wxT("void*") && - m_data->GetRefCount() == 1) - { - ((wxVariantDataVoidPtr*)GetData())->SetValue(value); - } - else - { - UnRef(); - m_data = new wxVariantDataVoidPtr(value); - } -} - -void* wxVariant::GetVoidPtr() const -{ - wxASSERT( (GetType() == wxT("void*")) ); - - return (void*) ((wxVariantDataVoidPtr*) m_data)->GetValue(); -} - -// ---------------------------------------------------------------------------- -// wxVariantDataDateTime -// ---------------------------------------------------------------------------- - -#if wxUSE_DATETIME - -class wxVariantDataDateTime: public wxVariantData -{ - DECLARE_DYNAMIC_CLASS(wxVariantDataDateTime) - -public: - wxVariantDataDateTime() { } - wxVariantDataDateTime(const wxDateTime& value) { m_value = value; } -#if wxUSE_ODBC - wxVariantDataDateTime(const TIME_STRUCT* valptr) - { m_value = wxDateTime(valptr->hour, valptr->minute, valptr->second); } - wxVariantDataDateTime(const DATE_STRUCT* valptr) - { m_value = wxDateTime(valptr->day, (wxDateTime::Month) (valptr->month - 1),valptr->year); } - wxVariantDataDateTime(const TIMESTAMP_STRUCT* valptr) - { m_value = wxDateTime(valptr->day, (wxDateTime::Month) (valptr->month - 1), valptr->year, - valptr->hour, valptr->minute, valptr->second, (wxDateTime::wxDateTime_t)valptr->fraction ); } -#endif //ODBC - - inline wxDateTime GetValue() const { return m_value; } - inline void SetValue(const wxDateTime& value) { m_value = value; } - - virtual bool Eq(wxVariantData& data) const; -#if wxUSE_STD_IOSTREAM - virtual bool Write(wxSTD ostream& str) const; -#endif - virtual bool Write(wxString& str) const; -#if wxUSE_STD_IOSTREAM - virtual bool Read(wxSTD istream& str); -#endif - virtual bool Read(wxString& str); - virtual wxString GetType() const { return wxT("datetime"); } - virtual wxVariantData* Clone() { return new wxVariantDataDateTime; } - -protected: - wxDateTime m_value; -}; - - -IMPLEMENT_DYNAMIC_CLASS(wxVariantDataDateTime, wxVariantData) - -bool wxVariantDataDateTime::Eq(wxVariantData& data) const -{ - wxASSERT_MSG( (data.GetType() == wxT("datetime")), wxT("wxVariantDataDateTime::Eq: argument mismatch") ); - - wxVariantDataDateTime& otherData = (wxVariantDataDateTime&) data; - - return (otherData.m_value == m_value); -} - - -#if wxUSE_STD_IOSTREAM -bool wxVariantDataDateTime::Write(wxSTD ostream& str) const -{ - wxString value; - Write( value ); - str << value.c_str(); - return true; -} -#endif - - -bool wxVariantDataDateTime::Write(wxString& str) const -{ - if ( m_value.IsValid() ) - str = m_value.Format(); - else - str = wxT("Invalid"); - - return true; -} - - -#if wxUSE_STD_IOSTREAM -bool wxVariantDataDateTime::Read(wxSTD istream& WXUNUSED(str)) -{ - // Not implemented - return false; -} -#endif - - -bool wxVariantDataDateTime::Read(wxString& str) -{ - if ( str == wxT("Invalid") ) - { - m_value = wxInvalidDateTime; - return true; - } - - if(! m_value.ParseDateTime(str)) - return false; - return true; -} - -// wxVariant - -wxVariant::wxVariant(const wxDateTime& val, const wxString& name) // Date -{ - m_data = new wxVariantDataDateTime(val); - m_name = name; -} - -#if wxUSE_ODBC -wxVariant::wxVariant(const TIME_STRUCT* valptr, const wxString& name) // Date -{ - m_data = new wxVariantDataDateTime(valptr); - m_name = name; -} - -wxVariant::wxVariant(const TIMESTAMP_STRUCT* valptr, const wxString& name) // Date -{ - m_data = new wxVariantDataDateTime(valptr); - m_name = name; -} - -wxVariant::wxVariant(const DATE_STRUCT* valptr, const wxString& name) // Date -{ - m_data = new wxVariantDataDateTime(valptr); - m_name = name; -} -#endif // wxUSE_ODBC - -bool wxVariant::operator== (const wxDateTime& value) const -{ - wxDateTime thisValue; - if (!Convert(&thisValue)) - return false; - - return value.IsEqualTo(thisValue); -} - -bool wxVariant::operator!= (const wxDateTime& value) const -{ - return (!((*this) == value)); -} - -void wxVariant::operator= (const wxDateTime& value) -{ - if (GetType() == wxT("datetime") && - m_data->GetRefCount() == 1) - { - ((wxVariantDataDateTime*)GetData())->SetValue(value); - } - else - { - UnRef(); - m_data = new wxVariantDataDateTime(value); - } -} - -#if wxUSE_ODBC -void wxVariant::operator= (const DATE_STRUCT* value) -{ - UnRef(); - m_data = new wxVariantDataDateTime(value); -} - -void wxVariant::operator= (const TIME_STRUCT* value) -{ - UnRef(); - m_data = new wxVariantDataDateTime(value); -} - -void wxVariant::operator= (const TIMESTAMP_STRUCT* value) -{ - UnRef(); - m_data = new wxVariantDataDateTime(value); -} - -#endif // wxUSE_ODBC - -wxDateTime wxVariant::GetDateTime() const -{ - wxDateTime value; - if (!Convert(& value)) - { - wxFAIL_MSG(wxT("Could not convert to a datetime")); - } - - return value; -} - -#endif // wxUSE_DATETIME - -// ---------------------------------------------------------------------------- -// wxVariantDataArrayString -// ---------------------------------------------------------------------------- - -class wxVariantDataArrayString: public wxVariantData -{ -public: - wxVariantDataArrayString() { } - wxVariantDataArrayString(const wxArrayString& value) { m_value = value; } - - wxArrayString GetValue() const { return m_value; } - void SetValue(const wxArrayString& value) { m_value = value; } - - virtual bool Eq(wxVariantData& data) const; -#if wxUSE_STD_IOSTREAM - virtual bool Write(wxSTD ostream& str) const; -#endif - virtual bool Write(wxString& str) const; -#if wxUSE_STD_IOSTREAM - virtual bool Read(wxSTD istream& str); -#endif - virtual bool Read(wxString& str); - virtual wxString GetType() const { return wxT("arrstring"); } - virtual wxVariantData* Clone() { return new wxVariantDataArrayString; } - -protected: - wxArrayString m_value; - - DECLARE_DYNAMIC_CLASS(wxVariantDataArrayString) -}; - -IMPLEMENT_DYNAMIC_CLASS(wxVariantDataArrayString, wxVariantData) - -bool wxVariantDataArrayString::Eq(wxVariantData& data) const -{ - wxASSERT_MSG( data.GetType() == GetType(), wxT("wxVariantDataArrayString::Eq: argument mismatch") ); - - wxVariantDataArrayString& otherData = (wxVariantDataArrayString&) data; - - return otherData.m_value == m_value; -} - -#if wxUSE_STD_IOSTREAM -bool wxVariantDataArrayString::Write(wxSTD ostream& WXUNUSED(str)) const -{ - // Not implemented - return false; -} -#endif - -bool wxVariantDataArrayString::Write(wxString& str) const -{ - size_t count = m_value.GetCount(); - for ( size_t n = 0; n < count; n++ ) - { - if ( n ) - str += _T(';'); - - str += m_value[n]; - } - - return true; -} - - -#if wxUSE_STD_IOSTREAM -bool wxVariantDataArrayString::Read(wxSTD istream& WXUNUSED(str)) -{ - // Not implemented - return false; -} -#endif - - -bool wxVariantDataArrayString::Read(wxString& str) -{ - wxStringTokenizer tk(str, _T(";")); - while ( tk.HasMoreTokens() ) - { - m_value.Add(tk.GetNextToken()); - } - - return true; -} - -// wxVariant - -wxVariant::wxVariant(const wxArrayString& val, const wxString& name) // Strings -{ - m_data = new wxVariantDataArrayString(val); - m_name = name; -} - -bool wxVariant::operator==(const wxArrayString& WXUNUSED(value)) const -{ - wxFAIL_MSG( _T("TODO") ); - - return false; -} - -bool wxVariant::operator!=(const wxArrayString& value) const -{ - return !(*this == value); -} - -void wxVariant::operator=(const wxArrayString& value) -{ - if (GetType() == wxT("arrstring") && - m_data->GetRefCount() == 1) - { - ((wxVariantDataArrayString *)GetData())->SetValue(value); - } - else - { - UnRef(); - m_data = new wxVariantDataArrayString(value); - } -} - -wxArrayString wxVariant::GetArrayString() const -{ - if ( GetType() == wxT("arrstring") ) - return ((wxVariantDataArrayString *)GetData())->GetValue(); - - return wxArrayString(); -} - -// ---------------------------------------------------------------------------- -// wxVariantDataList -// ---------------------------------------------------------------------------- - -class WXDLLIMPEXP_BASE wxVariantDataList: public wxVariantData -{ -DECLARE_DYNAMIC_CLASS(wxVariantDataList) -public: - wxVariantDataList() {} - wxVariantDataList(const wxList& list); - virtual ~wxVariantDataList(); - - wxList& GetValue() { return m_value; } - void SetValue(const wxList& value) ; - - virtual bool Eq(wxVariantData& data) const; -#if wxUSE_STD_IOSTREAM - virtual bool Write(wxSTD ostream& str) const; -#endif - virtual bool Write(wxString& str) const; -#if wxUSE_STD_IOSTREAM - virtual bool Read(wxSTD istream& str); -#endif - virtual bool Read(wxString& str); - virtual wxString GetType() const { return wxT("list"); } - - void Clear(); - -protected: - wxList m_value; -}; - -IMPLEMENT_DYNAMIC_CLASS(wxVariantDataList, wxVariantData) - -wxVariantDataList::wxVariantDataList(const wxList& list) -{ - SetValue(list); -} - -wxVariantDataList::~wxVariantDataList() -{ - Clear(); -} - -void wxVariantDataList::SetValue(const wxList& value) -{ - Clear(); - wxList::compatibility_iterator node = value.GetFirst(); - while (node) - { - wxVariant* var = (wxVariant*) node->GetData(); - m_value.Append(new wxVariant(*var)); - node = node->GetNext(); - } -} - -void wxVariantDataList::Clear() -{ - wxList::compatibility_iterator node = m_value.GetFirst(); - while (node) - { - wxVariant* var = (wxVariant*) node->GetData(); - delete var; - node = node->GetNext(); - } - m_value.Clear(); -} - -bool wxVariantDataList::Eq(wxVariantData& data) const -{ - wxASSERT_MSG( (data.GetType() == wxT("list")), wxT("wxVariantDataList::Eq: argument mismatch") ); - - wxVariantDataList& listData = (wxVariantDataList&) data; - wxList::compatibility_iterator node1 = m_value.GetFirst(); - wxList::compatibility_iterator node2 = listData.GetValue().GetFirst(); - while (node1 && node2) - { - wxVariant* var1 = (wxVariant*) node1->GetData(); - wxVariant* var2 = (wxVariant*) node2->GetData(); - if ((*var1) != (*var2)) - return false; - node1 = node1->GetNext(); - node2 = node2->GetNext(); - } - if (node1 || node2) return false; - return true; -} - -#if wxUSE_STD_IOSTREAM -bool wxVariantDataList::Write(wxSTD ostream& str) const -{ - wxString s; - Write(s); - str << (const char*) s.mb_str(); - return true; -} -#endif - -bool wxVariantDataList::Write(wxString& str) const -{ - str = wxEmptyString; - wxList::compatibility_iterator node = m_value.GetFirst(); - while (node) - { - wxVariant* var = (wxVariant*) node->GetData(); - if (node != m_value.GetFirst()) - str += wxT(" "); - wxString str1; - str += var->MakeString(); - node = node->GetNext(); - } - - return true; -} - -#if wxUSE_STD_IOSTREAM -bool wxVariantDataList::Read(wxSTD istream& WXUNUSED(str)) -{ - wxFAIL_MSG(wxT("Unimplemented")); - // TODO - return false; -} -#endif - -bool wxVariantDataList::Read(wxString& WXUNUSED(str)) -{ - wxFAIL_MSG(wxT("Unimplemented")); - // TODO - return false; -} - -// wxVariant - -wxVariant::wxVariant(const wxList& val, const wxString& name) // List of variants -{ - m_data = new wxVariantDataList(val); - m_name = name; -} - -bool wxVariant::operator== (const wxList& value) const -{ - wxASSERT_MSG( (GetType() == wxT("list")), wxT("Invalid type for == operator") ); - - wxVariantDataList other(value); - return (GetData()->Eq(other)); -} - -bool wxVariant::operator!= (const wxList& value) const -{ - return (!((*this) == value)); -} - -void wxVariant::operator= (const wxList& value) -{ - if (GetType() == wxT("list") && - m_data->GetRefCount() == 1) - { - ((wxVariantDataList*)GetData())->SetValue(value); - } - else - { - UnRef(); - m_data = new wxVariantDataList(value); - } -} - -wxList& wxVariant::GetList() const -{ - wxASSERT( (GetType() == wxT("list")) ); - - return (wxList&) ((wxVariantDataList*) m_data)->GetValue(); -} - -// Make empty list -void wxVariant::NullList() -{ - SetData(new wxVariantDataList()); -} - -// Append to list -void wxVariant::Append(const wxVariant& value) -{ - wxList& list = GetList(); - - list.Append(new wxVariant(value)); -} - -// Insert at front of list -void wxVariant::Insert(const wxVariant& value) -{ - wxList& list = GetList(); - - list.Insert(new wxVariant(value)); -} - -// Returns true if the variant is a member of the list -bool wxVariant::Member(const wxVariant& value) const -{ - wxList& list = GetList(); - - wxList::compatibility_iterator node = list.GetFirst(); - while (node) - { - wxVariant* other = (wxVariant*) node->GetData(); - if (value == *other) - return true; - node = node->GetNext(); - } - return false; -} - -// Deletes the nth element of the list -bool wxVariant::Delete(size_t item) -{ - wxList& list = GetList(); - - wxASSERT_MSG( (item < list.GetCount()), wxT("Invalid index to Delete") ); - wxList::compatibility_iterator node = list.Item(item); - wxVariant* variant = (wxVariant*) node->GetData(); - delete variant; - list.Erase(node); - return true; -} - -// Clear list -void wxVariant::ClearList() -{ - if (!IsNull() && (GetType() == wxT("list"))) - { - ((wxVariantDataList*) m_data)->Clear(); - } - else - { - if (!GetType().IsSameAs(wxT("list"))) - UnRef(); - - m_data = new wxVariantDataList; - } -} - -#if WXWIN_COMPATIBILITY_2_4 - -// ---------------------------------------------------------------------------- -// wxVariantDataStringList -// ---------------------------------------------------------------------------- - -class WXDLLIMPEXP_BASE wxVariantDataStringList: public wxVariantData -{ -DECLARE_DYNAMIC_CLASS(wxVariantDataStringList) -public: - wxVariantDataStringList() {} - wxVariantDataStringList(const wxStringList& list) { m_value = list; } - - wxStringList& GetValue() const { return (wxStringList&) m_value; } - void SetValue(const wxStringList& value); - - virtual bool Eq(wxVariantData& data) const; -#if wxUSE_STD_IOSTREAM - virtual bool Write(wxSTD ostream& str) const; -#endif - virtual bool Write(wxString& str) const; -#if wxUSE_STD_IOSTREAM - virtual bool Read(wxSTD istream& str); -#endif - virtual bool Read(wxString& str); - virtual wxString GetType() const { return wxT("stringlist"); }; - -protected: - wxStringList m_value; -}; - -IMPLEMENT_DYNAMIC_CLASS(wxVariantDataStringList, wxVariantData) - -void wxVariantDataStringList::SetValue(const wxStringList& value) -{ - m_value = value; -} - -bool wxVariantDataStringList::Eq(wxVariantData& data) const -{ - wxASSERT_MSG( (data.GetType() == wxT("stringlist")), wxT("wxVariantDataStringList::Eq: argument mismatch") ); - - wxVariantDataStringList& listData = (wxVariantDataStringList&) data; - wxStringList::compatibility_iterator node1 = m_value.GetFirst(); - wxStringList::compatibility_iterator node2 = listData.GetValue().GetFirst(); - while (node1 && node2) - { - wxString str1 ( node1->GetData() ); - wxString str2 ( node2->GetData() ); - if (str1 != str2) - return false; - node1 = node1->GetNext(); - node2 = node2->GetNext(); - } - if (node1 || node2) return false; - return true; -} - -#if wxUSE_STD_IOSTREAM -bool wxVariantDataStringList::Write(wxSTD ostream& str) const -{ - wxString s; - Write(s); - str << (const char*) s.mb_str(); - return true; -} -#endif - -bool wxVariantDataStringList::Write(wxString& str) const -{ - str.Empty(); - wxStringList::compatibility_iterator node = m_value.GetFirst(); - while (node) - { - const wxChar* s = node->GetData(); - if (node != m_value.GetFirst()) - str += wxT(" "); - str += s; - node = node->GetNext(); - } - - return true; -} - -#if wxUSE_STD_IOSTREAM -bool wxVariantDataStringList::Read(wxSTD istream& WXUNUSED(str)) -{ - wxFAIL_MSG(wxT("Unimplemented")); - // TODO - return false; -} -#endif - -bool wxVariantDataStringList::Read(wxString& WXUNUSED(str)) -{ - wxFAIL_MSG(wxT("Unimplemented")); - // TODO - return false; -} - -#endif //2.4 compat - -#if WXWIN_COMPATIBILITY_2_4 - -wxVariant::wxVariant(const wxStringList& val, const wxString& name) -{ - m_data = new wxVariantDataStringList(val); - m_name = name; -} - -bool wxVariant::operator== (const wxStringList& value) const -{ - wxASSERT_MSG( (GetType() == wxT("stringlist")), wxT("Invalid type for == operator") ); - - wxVariantDataStringList other(value); - return (GetData()->Eq(other)); -} - -bool wxVariant::operator!= (const wxStringList& value) const -{ - wxASSERT_MSG( (GetType() == wxT("stringlist")), wxT("Invalid type for == operator") ); - - wxVariantDataStringList other(value); - return !(GetData()->Eq(other)); -} - -void wxVariant::operator= (const wxStringList& value) -{ - if (GetType() == wxT("stringlist") && - m_data->GetRefCount() == 1) - { - ((wxVariantDataStringList*)GetData())->SetValue(value); - } - else - { - UnRef(); - m_data = new wxVariantDataStringList(value); - } -} - -// wxVariant - -wxStringList& wxVariant::GetStringList() const -{ - wxASSERT( (GetType() == wxT("stringlist")) ); - - return (wxStringList&) ((wxVariantDataStringList*) m_data)->GetValue(); -} - -#endif - -// Treat a list variant as an array -wxVariant wxVariant::operator[] (size_t idx) const -{ -#if WXWIN_COMPATIBILITY_2_4 - wxASSERT_MSG( (GetType() == wxT("list") || GetType() == wxT("stringlist")), wxT("Invalid type for array operator") ); -#else - wxASSERT_MSG( GetType() == wxT("list"), wxT("Invalid type for array operator") ); -#endif - - if (GetType() == wxT("list")) - { - wxVariantDataList* data = (wxVariantDataList*) m_data; - wxASSERT_MSG( (idx < data->GetValue().GetCount()), wxT("Invalid index for array") ); - return * (wxVariant*) (data->GetValue().Item(idx)->GetData()); - } -#if WXWIN_COMPATIBILITY_2_4 - else if (GetType() == wxT("stringlist")) - { - wxVariantDataStringList* data = (wxVariantDataStringList*) m_data; - wxASSERT_MSG( (idx < data->GetValue().GetCount()), wxT("Invalid index for array") ); - - wxString str( (const wxChar*) (data->GetValue().Item(idx)->GetData()) ); - wxVariant variant( str ); - return variant; - } -#endif - return wxNullVariant; -} - -wxVariant& wxVariant::operator[] (size_t idx) -{ - // We can't return a reference to a variant for a string list, since the string - // is actually stored as a char*, not a variant. - - wxASSERT_MSG( (GetType() == wxT("list")), wxT("Invalid type for array operator") ); - - wxVariantDataList* data = (wxVariantDataList*) m_data; - wxASSERT_MSG( (idx < data->GetValue().GetCount()), wxT("Invalid index for array") ); - - return * (wxVariant*) (data->GetValue().Item(idx)->GetData()); -} - -// Return the number of elements in a list -size_t wxVariant::GetCount() const -{ -#if WXWIN_COMPATIBILITY_2_4 - wxASSERT_MSG( (GetType() == wxT("list") || GetType() == wxT("stringlist")), wxT("Invalid type for GetCount()") ); -#else - wxASSERT_MSG( GetType() == wxT("list"), wxT("Invalid type for GetCount()") ); -#endif - - if (GetType() == wxT("list")) - { - wxVariantDataList* data = (wxVariantDataList*) m_data; - return data->GetValue().GetCount(); - } -#if WXWIN_COMPATIBILITY_2_4 - else if (GetType() == wxT("stringlist")) - { - wxVariantDataStringList* data = (wxVariantDataStringList*) m_data; - return data->GetValue().GetCount(); - } -#endif - return 0; -} - -// ---------------------------------------------------------------------------- -// Type conversion -// ---------------------------------------------------------------------------- - -bool wxVariant::Convert(long* value) const -{ - wxString type(GetType()); - if (type == wxT("double")) - *value = (long) (((wxVariantDoubleData*)GetData())->GetValue()); - else if (type == wxT("long")) - *value = ((wxVariantDataLong*)GetData())->GetValue(); -#ifdef HAVE_BOOL - else if (type == wxT("bool")) - *value = (long) (((wxVariantDataBool*)GetData())->GetValue()); -#endif - else if (type == wxT("string")) - *value = wxAtol((const wxChar*) ((wxVariantDataString*)GetData())->GetValue()); - else - return false; - - return true; -} - -bool wxVariant::Convert(bool* value) const -{ - wxString type(GetType()); - if (type == wxT("double")) - *value = ((int) (((wxVariantDoubleData*)GetData())->GetValue()) != 0); - else if (type == wxT("long")) - *value = (((wxVariantDataLong*)GetData())->GetValue() != 0); -#ifdef HAVE_BOOL - else if (type == wxT("bool")) - *value = ((wxVariantDataBool*)GetData())->GetValue(); -#endif - else if (type == wxT("string")) - { - wxString val(((wxVariantDataString*)GetData())->GetValue()); - val.MakeLower(); - if (val == wxT("true") || val == wxT("yes") || val == wxT('1') ) - *value = true; - else if (val == wxT("false") || val == wxT("no") || val == wxT('0') ) - *value = false; - else - return false; - } - else - return false; - - return true; -} - -bool wxVariant::Convert(double* value) const -{ - wxString type(GetType()); - if (type == wxT("double")) - *value = ((wxVariantDoubleData*)GetData())->GetValue(); - else if (type == wxT("long")) - *value = (double) (((wxVariantDataLong*)GetData())->GetValue()); -#ifdef HAVE_BOOL - else if (type == wxT("bool")) - *value = (double) (((wxVariantDataBool*)GetData())->GetValue()); -#endif - else if (type == wxT("string")) - *value = (double) wxAtof((const wxChar*) ((wxVariantDataString*)GetData())->GetValue()); - else - return false; - - return true; -} - -bool wxVariant::Convert(wxChar* value) const -{ - wxString type(GetType()); - if (type == wxT("char")) - *value = ((wxVariantDataChar*)GetData())->GetValue(); - else if (type == wxT("long")) - *value = (char) (((wxVariantDataLong*)GetData())->GetValue()); -#ifdef HAVE_BOOL - else if (type == wxT("bool")) - *value = (char) (((wxVariantDataBool*)GetData())->GetValue()); -#endif - else - return false; - - return true; -} - -bool wxVariant::Convert(wxString* value) const -{ - *value = MakeString(); - return true; -} - -#if wxUSE_DATETIME -bool wxVariant::Convert(wxDateTime* value) const -{ - wxString type(GetType()); - if (type == wxT("datetime")) - { - *value = ((wxVariantDataDateTime*)GetData())->GetValue(); - return true; - } - // Fallback to string conversion - wxString val; - return Convert(&val) && - (value->ParseDateTime(val) || value->ParseDate(val) || value->ParseTime(val)); -} -#endif // wxUSE_DATETIME - -#endif // wxUSE_VARIANT diff --git a/wxWidgets/src/common/wfstream.cpp b/wxWidgets/src/common/wfstream.cpp deleted file mode 100644 index c5fe73be66..0000000000 --- a/wxWidgets/src/common/wfstream.cpp +++ /dev/null @@ -1,418 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/common/fstream.cpp -// Purpose: "File stream" classes -// Author: Julian Smart -// Modified by: -// Created: 11/07/98 -// RCS-ID: $Id: wfstream.cpp 54418 2008-06-29 01:28:43Z VZ $ -// Copyright: (c) Guilhem Lavaux -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_STREAMS - -#include "wx/wfstream.h" - -#ifndef WX_PRECOMP - #include "wx/stream.h" -#endif - -#include - -#if wxUSE_FILE - -// ---------------------------------------------------------------------------- -// wxFileInputStream -// ---------------------------------------------------------------------------- - -wxFileInputStream::wxFileInputStream(const wxString& fileName) - : wxInputStream() -{ - m_file = new wxFile(fileName, wxFile::read); - m_file_destroy = true; - if ( !m_file->IsOpened() ) - m_lasterror = wxSTREAM_READ_ERROR; -} - -wxFileInputStream::wxFileInputStream() - : wxInputStream() -{ - m_file_destroy = false; - m_file = NULL; -} - -wxFileInputStream::wxFileInputStream(wxFile& file) -{ - m_file = &file; - m_file_destroy = false; -} - -wxFileInputStream::wxFileInputStream(int fd) -{ - m_file = new wxFile(fd); - m_file_destroy = true; -} - -wxFileInputStream::~wxFileInputStream() -{ - if (m_file_destroy) - delete m_file; -} - -wxFileOffset wxFileInputStream::GetLength() const -{ - return m_file->Length(); -} - -size_t wxFileInputStream::OnSysRead(void *buffer, size_t size) -{ - ssize_t ret = m_file->Read(buffer, size); - - // NB: we can't use a switch here because HP-UX CC doesn't allow - // switching over long long (which size_t is in 64bit mode) - - if ( !ret ) - { - // nothing read, so nothing more to read - m_lasterror = wxSTREAM_EOF; - } - else if ( ret == wxInvalidOffset ) - { - m_lasterror = wxSTREAM_READ_ERROR; - ret = 0; - } - else - { - // normal case - m_lasterror = wxSTREAM_NO_ERROR; - } - - return ret; -} - -wxFileOffset wxFileInputStream::OnSysSeek(wxFileOffset pos, wxSeekMode mode) -{ - return m_file->Seek(pos, mode); -} - -wxFileOffset wxFileInputStream::OnSysTell() const -{ - return m_file->Tell(); -} - -bool wxFileInputStream::IsOk() const -{ - return (wxStreamBase::IsOk() && m_file->IsOpened()); -} - -// ---------------------------------------------------------------------------- -// wxFileOutputStream -// ---------------------------------------------------------------------------- - -wxFileOutputStream::wxFileOutputStream(const wxString& fileName) -{ - m_file = new wxFile(fileName, wxFile::write); - m_file_destroy = true; - - if (!m_file->IsOpened()) - m_lasterror = wxSTREAM_WRITE_ERROR; -} - -wxFileOutputStream::wxFileOutputStream(wxFile& file) -{ - m_file = &file; - m_file_destroy = false; -} - -wxFileOutputStream::wxFileOutputStream() - : wxOutputStream() -{ - m_file_destroy = false; - m_file = NULL; -} - -wxFileOutputStream::wxFileOutputStream(int fd) -{ - m_file = new wxFile(fd); - m_file_destroy = true; -} - -wxFileOutputStream::~wxFileOutputStream() -{ - if (m_file_destroy) - { - Sync(); - delete m_file; - } -} - -size_t wxFileOutputStream::OnSysWrite(const void *buffer, size_t size) -{ - size_t ret = m_file->Write(buffer, size); - - m_lasterror = m_file->Error() ? wxSTREAM_WRITE_ERROR : wxSTREAM_NO_ERROR; - - return ret; -} - -wxFileOffset wxFileOutputStream::OnSysTell() const -{ - return m_file->Tell(); -} - -wxFileOffset wxFileOutputStream::OnSysSeek(wxFileOffset pos, wxSeekMode mode) -{ - return m_file->Seek(pos, mode); -} - -void wxFileOutputStream::Sync() -{ - wxOutputStream::Sync(); - m_file->Flush(); -} - -wxFileOffset wxFileOutputStream::GetLength() const -{ - return m_file->Length(); -} - -bool wxFileOutputStream::IsOk() const -{ - return (wxStreamBase::IsOk() && m_file->IsOpened()); -} - -// ---------------------------------------------------------------------------- -// wxTempFileOutputStream -// ---------------------------------------------------------------------------- - -wxTempFileOutputStream::wxTempFileOutputStream(const wxString& fileName) -{ - m_file = new wxTempFile(fileName); - - if (!m_file->IsOpened()) - m_lasterror = wxSTREAM_WRITE_ERROR; -} - -wxTempFileOutputStream::~wxTempFileOutputStream() -{ - if (m_file->IsOpened()) - Discard(); - delete m_file; -} - -size_t wxTempFileOutputStream::OnSysWrite(const void *buffer, size_t size) -{ - if (IsOk() && m_file->Write(buffer, size)) - return size; - m_lasterror = wxSTREAM_WRITE_ERROR; - return 0; -} - -// ---------------------------------------------------------------------------- -// wxFileStream -// ---------------------------------------------------------------------------- - -wxFileStream::wxFileStream(const wxString& fileName) - : wxFileInputStream(), - wxFileOutputStream() -{ - wxFileOutputStream::m_file = - wxFileInputStream::m_file = new wxFile(fileName, wxFile::read_write); - - // this is a bit ugly as streams are symmetric but we still have to delete - // the file we created above exactly once so we decide to (arbitrarily) do - // it in wxFileInputStream - wxFileInputStream::m_file_destroy = true; -} - -#endif //wxUSE_FILE - -#if wxUSE_FFILE - -// ---------------------------------------------------------------------------- -// wxFFileInputStream -// ---------------------------------------------------------------------------- - -wxFFileInputStream::wxFFileInputStream(const wxString& fileName, - const wxChar *mode) - : wxInputStream() -{ - m_file = new wxFFile(fileName, mode); - m_file_destroy = true; - - if (!m_file->IsOpened()) - m_lasterror = wxSTREAM_WRITE_ERROR; -} - -wxFFileInputStream::wxFFileInputStream() - : wxInputStream() -{ - m_file = NULL; - m_file_destroy = false; -} - -wxFFileInputStream::wxFFileInputStream(wxFFile& file) -{ - m_file = &file; - m_file_destroy = false; -} - -wxFFileInputStream::wxFFileInputStream(FILE *file) -{ - m_file = new wxFFile(file); - m_file_destroy = true; -} - -wxFFileInputStream::~wxFFileInputStream() -{ - if (m_file_destroy) - delete m_file; -} - -wxFileOffset wxFFileInputStream::GetLength() const -{ - return m_file->Length(); -} - -size_t wxFFileInputStream::OnSysRead(void *buffer, size_t size) -{ - ssize_t ret = m_file->Read(buffer, size); - - // It is not safe to call Eof() if the file is not opened. - if (!m_file->IsOpened() || m_file->Eof()) - m_lasterror = wxSTREAM_EOF; - if (ret == wxInvalidOffset) - { - m_lasterror = wxSTREAM_READ_ERROR; - ret = 0; - } - - return ret; -} - -wxFileOffset wxFFileInputStream::OnSysSeek(wxFileOffset pos, wxSeekMode mode) -{ - return m_file->Seek(pos, mode) ? m_file->Tell() : wxInvalidOffset; -} - -wxFileOffset wxFFileInputStream::OnSysTell() const -{ - return m_file->Tell(); -} - -bool wxFFileInputStream::IsOk() const -{ - return (wxStreamBase::IsOk() && m_file->IsOpened()); -} - -// ---------------------------------------------------------------------------- -// wxFFileOutputStream -// ---------------------------------------------------------------------------- - -wxFFileOutputStream::wxFFileOutputStream(const wxString& fileName, - const wxChar *mode) -{ - m_file = new wxFFile(fileName, mode); - m_file_destroy = true; - - if (!m_file->IsOpened()) - { - m_lasterror = wxSTREAM_WRITE_ERROR; - } - else - { - if (m_file->Error()) - m_lasterror = wxSTREAM_WRITE_ERROR; - } -} - -wxFFileOutputStream::wxFFileOutputStream(wxFFile& file) -{ - m_file = &file; - m_file_destroy = false; -} - -wxFFileOutputStream::wxFFileOutputStream() - : wxOutputStream() -{ - m_file = NULL; - m_file_destroy = false; -} - -wxFFileOutputStream::wxFFileOutputStream(FILE *file) -{ - m_file = new wxFFile(file); - m_file_destroy = true; -} - -wxFFileOutputStream::~wxFFileOutputStream() -{ - if (m_file_destroy) - { - Sync(); - delete m_file; - } -} - -size_t wxFFileOutputStream::OnSysWrite(const void *buffer, size_t size) -{ - size_t ret = m_file->Write(buffer, size); - // It is not safe to call Error() if the file is not opened. - if (!m_file->IsOpened() || m_file->Error()) - m_lasterror = wxSTREAM_WRITE_ERROR; - else - m_lasterror = wxSTREAM_NO_ERROR; - return ret; -} - -wxFileOffset wxFFileOutputStream::OnSysTell() const -{ - return m_file->Tell(); -} - -wxFileOffset wxFFileOutputStream::OnSysSeek(wxFileOffset pos, wxSeekMode mode) -{ - return m_file->Seek(pos, mode) ? m_file->Tell() : wxInvalidOffset; -} - -void wxFFileOutputStream::Sync() -{ - wxOutputStream::Sync(); - m_file->Flush(); -} - -wxFileOffset wxFFileOutputStream::GetLength() const -{ - return m_file->Length(); -} - -bool wxFFileOutputStream::IsOk() const -{ - return (wxStreamBase::IsOk() && m_file->IsOpened()); -} - -// ---------------------------------------------------------------------------- -// wxFFileStream -// ---------------------------------------------------------------------------- - -wxFFileStream::wxFFileStream(const wxString& fileName) - : wxFFileInputStream(), - wxFFileOutputStream() -{ - wxFFileOutputStream::m_file = - wxFFileInputStream::m_file = new wxFFile(fileName, _T("w+b")); - - // see comment in wxFileStream ctor - wxFFileInputStream::m_file_destroy = true; -} - -#endif //wxUSE_FFILE - -#endif // wxUSE_STREAMS diff --git a/wxWidgets/src/common/wincmn.cpp b/wxWidgets/src/common/wincmn.cpp deleted file mode 100644 index 03394bf2bd..0000000000 --- a/wxWidgets/src/common/wincmn.cpp +++ /dev/null @@ -1,3255 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/common/window.cpp -// Purpose: common (to all ports) wxWindow functions -// Author: Julian Smart, Vadim Zeitlin -// Modified by: -// Created: 13/07/98 -// RCS-ID: $Id: wincmn.cpp 63032 2009-12-31 13:37:24Z VZ $ -// Copyright: (c) wxWidgets team -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// 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/log.h" - #include "wx/intl.h" - #include "wx/frame.h" - #include "wx/window.h" - #include "wx/control.h" - #include "wx/checkbox.h" - #include "wx/radiobut.h" - #include "wx/statbox.h" - #include "wx/textctrl.h" - #include "wx/settings.h" - #include "wx/dialog.h" - #include "wx/msgdlg.h" - #include "wx/statusbr.h" - #include "wx/toolbar.h" - #include "wx/dcclient.h" - #include "wx/scrolbar.h" - #include "wx/layout.h" - #include "wx/sizer.h" -#endif //WX_PRECOMP - -#if wxUSE_DRAG_AND_DROP - #include "wx/dnd.h" -#endif // wxUSE_DRAG_AND_DROP - -#if wxUSE_ACCESSIBILITY - #include "wx/access.h" -#endif - -#if wxUSE_HELP - #include "wx/cshelp.h" -#endif // wxUSE_HELP - -#if wxUSE_TOOLTIPS - #include "wx/tooltip.h" -#endif // wxUSE_TOOLTIPS - -#if wxUSE_CARET - #include "wx/caret.h" -#endif // wxUSE_CARET - -#if wxUSE_SYSTEM_OPTIONS - #include "wx/sysopt.h" -#endif - -// For reporting compile- and runtime version of GTK+ in the ctrl+alt+mclick dialog. -// The gtk includes don't pull any other headers in, at least not on my system - MR -#ifdef __WXGTK__ - #ifdef __WXGTK20__ - #include - #else - #include - #endif - extern const unsigned int gtk_major_version; - extern const unsigned int gtk_minor_version; - extern const unsigned int gtk_micro_version; -#endif - -#include "wx/platinfo.h" - -// Windows List -WXDLLIMPEXP_DATA_CORE(wxWindowList) wxTopLevelWindows; - -// ---------------------------------------------------------------------------- -// static data -// ---------------------------------------------------------------------------- - -#if defined(__WXPALMOS__) -int wxWindowBase::ms_lastControlId = 32767; -#elif defined(__WXPM__) -int wxWindowBase::ms_lastControlId = 2000; -#else -int wxWindowBase::ms_lastControlId = -200; -#endif - -IMPLEMENT_ABSTRACT_CLASS(wxWindowBase, wxEvtHandler) - -// ---------------------------------------------------------------------------- -// event table -// ---------------------------------------------------------------------------- - -BEGIN_EVENT_TABLE(wxWindowBase, wxEvtHandler) - EVT_SYS_COLOUR_CHANGED(wxWindowBase::OnSysColourChanged) - EVT_INIT_DIALOG(wxWindowBase::OnInitDialog) - EVT_MIDDLE_DOWN(wxWindowBase::OnMiddleClick) - -#if wxUSE_HELP - EVT_HELP(wxID_ANY, wxWindowBase::OnHelp) -#endif // wxUSE_HELP - -END_EVENT_TABLE() - -// ============================================================================ -// implementation of the common functionality of the wxWindow class -// ============================================================================ - -// ---------------------------------------------------------------------------- -// initialization -// ---------------------------------------------------------------------------- - -// the default initialization -wxWindowBase::wxWindowBase() -{ - // no window yet, no parent nor children - m_parent = (wxWindow *)NULL; - m_windowId = wxID_ANY; - - // no constraints on the minimal window size - m_minWidth = - m_maxWidth = wxDefaultCoord; - m_minHeight = - m_maxHeight = wxDefaultCoord; - - // invalidiated cache value - m_bestSizeCache = wxDefaultSize; - - // window are created enabled and visible by default - m_isShown = - m_isEnabled = true; - - // the default event handler is just this window - m_eventHandler = this; - -#if wxUSE_VALIDATORS - // no validator - m_windowValidator = (wxValidator *) NULL; -#endif // wxUSE_VALIDATORS - - // the colours/fonts are default for now, so leave m_font, - // m_backgroundColour and m_foregroundColour uninitialized and set those - m_hasBgCol = - m_hasFgCol = - m_hasFont = false; - m_inheritBgCol = - m_inheritFgCol = - m_inheritFont = false; - - // no style bits - m_exStyle = - m_windowStyle = 0; - - m_backgroundStyle = wxBG_STYLE_SYSTEM; - -#if wxUSE_CONSTRAINTS - // no constraints whatsoever - m_constraints = (wxLayoutConstraints *) NULL; - m_constraintsInvolvedIn = (wxWindowList *) NULL; -#endif // wxUSE_CONSTRAINTS - - m_windowSizer = (wxSizer *) NULL; - m_containingSizer = (wxSizer *) NULL; - m_autoLayout = false; - -#if wxUSE_DRAG_AND_DROP - m_dropTarget = (wxDropTarget *)NULL; -#endif // wxUSE_DRAG_AND_DROP - -#if wxUSE_TOOLTIPS - m_tooltip = (wxToolTip *)NULL; -#endif // wxUSE_TOOLTIPS - -#if wxUSE_CARET - m_caret = (wxCaret *)NULL; -#endif // wxUSE_CARET - -#if wxUSE_PALETTE - m_hasCustomPalette = false; -#endif // wxUSE_PALETTE - -#if wxUSE_ACCESSIBILITY - m_accessible = NULL; -#endif - - m_virtualSize = wxDefaultSize; - - m_scrollHelper = (wxScrollHelper *) NULL; - - m_minVirtualWidth = - m_maxVirtualWidth = wxDefaultCoord; - m_minVirtualHeight = - m_maxVirtualHeight = wxDefaultCoord; - - m_windowVariant = wxWINDOW_VARIANT_NORMAL; -#if wxUSE_SYSTEM_OPTIONS - if ( wxSystemOptions::HasOption(wxWINDOW_DEFAULT_VARIANT) ) - { - m_windowVariant = (wxWindowVariant) wxSystemOptions::GetOptionInt( wxWINDOW_DEFAULT_VARIANT ) ; - } -#endif - - // Whether we're using the current theme for this window (wxGTK only for now) - m_themeEnabled = false; - - // VZ: this one shouldn't exist... - m_isBeingDeleted = false; -} - -// common part of window creation process -bool wxWindowBase::CreateBase(wxWindowBase *parent, - wxWindowID id, - const wxPoint& WXUNUSED(pos), - const wxSize& WXUNUSED(size), - long style, - const wxValidator& wxVALIDATOR_PARAM(validator), - const wxString& name) -{ -#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 so warn - // the user about it - - // if you get this assert, the correct solution is to create the controls - // as siblings of the static box - wxASSERT_MSG( !parent || !wxDynamicCast(parent, wxStaticBox), - _T("wxStaticBox can't be used as a window parent!") ); -#endif // wxUSE_STATBOX - - // ids are limited to 16 bits under MSW so if you care about portability, - // it's not a good idea to use ids out of this range (and negative ids are - // reserved for wxWidgets own usage) - wxASSERT_MSG( id == wxID_ANY || (id >= 0 && id < 32767), - _T("invalid id value") ); - - // generate a new id if the user doesn't care about it - m_windowId = id == wxID_ANY ? NewControlId() : id; - - // don't use SetWindowStyleFlag() here, this function should only be called - // to change the flag after creation as it tries to reflect the changes in - // flags by updating the window dynamically and we don't need this here - m_windowStyle = style; - - SetName(name); - SetParent(parent); - -#if wxUSE_VALIDATORS - SetValidator(validator); -#endif // wxUSE_VALIDATORS - - // if the parent window has wxWS_EX_VALIDATE_RECURSIVELY set, we want to - // have it too - like this it's possible to set it only in the top level - // dialog/frame and all children will inherit it by defult - if ( parent && (parent->GetExtraStyle() & wxWS_EX_VALIDATE_RECURSIVELY) ) - { - SetExtraStyle(GetExtraStyle() | wxWS_EX_VALIDATE_RECURSIVELY); - } - - return true; -} - -bool wxWindowBase::ToggleWindowStyle(int flag) -{ - wxASSERT_MSG( flag, _T("flags with 0 value can't be toggled") ); - - bool rc; - long style = GetWindowStyleFlag(); - if ( style & flag ) - { - style &= ~flag; - rc = false; - } - else // currently off - { - style |= flag; - rc = true; - } - - SetWindowStyleFlag(style); - - return rc; -} - -// ---------------------------------------------------------------------------- -// destruction -// ---------------------------------------------------------------------------- - -// common clean up -wxWindowBase::~wxWindowBase() -{ - wxASSERT_MSG( GetCapture() != this, wxT("attempt to destroy window with mouse capture") ); - - // FIXME if these 2 cases result from programming errors in the user code - // we should probably assert here instead of silently fixing them - - // Just in case the window has been Closed, but we're then deleting - // immediately: don't leave dangling pointers. - wxPendingDelete.DeleteObject(this); - - // Just in case we've loaded a top-level window via LoadNativeDialog but - // we weren't a dialog class - wxTopLevelWindows.DeleteObject((wxWindow*)this); - - wxASSERT_MSG( GetChildren().GetCount() == 0, wxT("children not destroyed") ); - - // reset the top-level parent's default item if it is this widget - if ( m_parent ) - { - wxTopLevelWindow *tlw = wxDynamicCast(wxGetTopLevelParent((wxWindow*)this), - wxTopLevelWindow); - - if ( tlw ) - { - wxWindow* tmpDefaultItem = tlw->GetTmpDefaultItem(); - if ( tmpDefaultItem == this ) - tlw->SetTmpDefaultItem(NULL); - else if ( tmpDefaultItem ) - { - // A temporary default item masks the real default item, so - // temporarily unset the temporary default item so we can access the - // real default item. - tlw->SetTmpDefaultItem(NULL); - - if ( tlw->GetDefaultItem() == this ) - tlw->SetDefaultItem(NULL); - - // Set the temporary default item back. - tlw->SetTmpDefaultItem(tmpDefaultItem); - } - else if ( tlw->GetDefaultItem() == this ) - tlw->SetDefaultItem(NULL); - } - } - - // reset the dangling pointer our parent window may keep to us - if ( m_parent ) - { - m_parent->RemoveChild(this); - } - -#if wxUSE_CARET - delete m_caret; -#endif // wxUSE_CARET - -#if wxUSE_VALIDATORS - delete m_windowValidator; -#endif // wxUSE_VALIDATORS - -#if wxUSE_CONSTRAINTS - // Have to delete constraints/sizer FIRST otherwise sizers may try to look - // at deleted windows as they delete themselves. - DeleteRelatedConstraints(); - - if ( m_constraints ) - { - // This removes any dangling pointers to this window in other windows' - // constraintsInvolvedIn lists. - UnsetConstraints(m_constraints); - delete m_constraints; - m_constraints = NULL; - } -#endif // wxUSE_CONSTRAINTS - - if ( m_containingSizer ) - m_containingSizer->Detach( (wxWindow*)this ); - - delete m_windowSizer; - -#if wxUSE_DRAG_AND_DROP - delete m_dropTarget; -#endif // wxUSE_DRAG_AND_DROP - -#if wxUSE_TOOLTIPS - delete m_tooltip; -#endif // wxUSE_TOOLTIPS - -#if wxUSE_ACCESSIBILITY - delete m_accessible; -#endif - -#if wxUSE_HELP - // NB: this has to be called unconditionally, because we don't - // know whether this window has associated help text or not - wxHelpProvider *helpProvider = wxHelpProvider::Get(); - if ( helpProvider ) - helpProvider->RemoveHelp(this); -#endif -} - -void wxWindowBase::SendDestroyEvent() -{ - wxWindowDestroyEvent event; - event.SetEventObject(this); - event.SetId(GetId()); - GetEventHandler()->ProcessEvent(event); -} - -bool wxWindowBase::Destroy() -{ - delete this; - - return true; -} - -bool wxWindowBase::Close(bool force) -{ - wxCloseEvent event(wxEVT_CLOSE_WINDOW, m_windowId); - event.SetEventObject(this); - event.SetCanVeto(!force); - - // return false if window wasn't closed because the application vetoed the - // close event - return GetEventHandler()->ProcessEvent(event) && !event.GetVeto(); -} - -bool wxWindowBase::DestroyChildren() -{ - wxWindowList::compatibility_iterator node; - for ( ;; ) - { - // we iterate until the list becomes empty - node = GetChildren().GetFirst(); - if ( !node ) - break; - - wxWindow *child = node->GetData(); - - // note that we really want to call delete and not ->Destroy() here - // because we want to delete the child immediately, before we are - // deleted, and delayed deletion would result in problems as our (top - // level) child could outlive its parent - delete child; - - wxASSERT_MSG( !GetChildren().Find(child), - wxT("child didn't remove itself using RemoveChild()") ); - } - - return true; -} - -// ---------------------------------------------------------------------------- -// size/position related methods -// ---------------------------------------------------------------------------- - -// centre the window with respect to its parent in either (or both) directions -void wxWindowBase::DoCentre(int dir) -{ - wxCHECK_RET( !(dir & wxCENTRE_ON_SCREEN) && GetParent(), - _T("this method only implements centering child windows") ); - - SetSize(GetRect().CentreIn(GetParent()->GetClientSize(), dir)); -} - -// fits the window around the children -void wxWindowBase::Fit() -{ - if ( !GetChildren().empty() ) - { - SetSize(GetBestSize()); - } - //else: do nothing if we have no children -} - -// fits virtual size (ie. scrolled area etc.) around children -void wxWindowBase::FitInside() -{ - if ( GetChildren().GetCount() > 0 ) - { - SetVirtualSize( GetBestVirtualSize() ); - } -} - -// On Mac, scrollbars are explicitly children. -#ifdef __WXMAC__ -static bool wxHasRealChildren(const wxWindowBase* win) -{ - int realChildCount = 0; - - for ( wxWindowList::compatibility_iterator node = win->GetChildren().GetFirst(); - node; - node = node->GetNext() ) - { - wxWindow *win = node->GetData(); - if ( !win->IsTopLevel() && win->IsShown() && !win->IsKindOf(CLASSINFO(wxScrollBar))) - realChildCount ++; - } - return (realChildCount > 0); -} -#endif - -void wxWindowBase::InvalidateBestSize() -{ - m_bestSizeCache = wxDefaultSize; - - // parent's best size calculation may depend on its children's - // as long as child window we are in is not top level window itself - // (because the TLW size is never resized automatically) - // so let's invalidate it as well to be safe: - if (m_parent && !IsTopLevel()) - m_parent->InvalidateBestSize(); -} - -// return the size best suited for the current window -wxSize wxWindowBase::DoGetBestSize() const -{ - wxSize best; - - if ( m_windowSizer ) - { - // Adjust to window size, since the return value of GetWindowSizeForVirtualSize is - // expressed in window and not client size - wxSize minSize = m_windowSizer->GetMinSize(); - wxSize size(GetSize()); - wxSize clientSize(GetClientSize()); - - wxSize minWindowSize(minSize.x + size.x - clientSize.x, - minSize.y + size.y - clientSize.y); - - best = GetWindowSizeForVirtualSize(minWindowSize); - - return best; - } -#if wxUSE_CONSTRAINTS - else if ( m_constraints ) - { - wxConstCast(this, wxWindowBase)->SatisfyConstraints(); - - // our minimal acceptable size is such that all our windows fit inside - int maxX = 0, - maxY = 0; - - for ( wxWindowList::compatibility_iterator node = GetChildren().GetFirst(); - node; - node = node->GetNext() ) - { - wxLayoutConstraints *c = node->GetData()->GetConstraints(); - if ( !c ) - { - // it's not normal that we have an unconstrained child, but - // what can we do about it? - continue; - } - - int x = c->right.GetValue(), - y = c->bottom.GetValue(); - - if ( x > maxX ) - maxX = x; - - if ( y > maxY ) - maxY = y; - - // TODO: we must calculate the overlaps somehow, otherwise we - // will never return a size bigger than the current one :-( - } - - best = wxSize(maxX, maxY); - } -#endif // wxUSE_CONSTRAINTS - else if ( !GetChildren().empty() -#ifdef __WXMAC__ - && wxHasRealChildren(this) -#endif - ) - { - // our minimal acceptable size is such that all our visible child - // windows fit inside - int maxX = 0, - maxY = 0; - - for ( wxWindowList::compatibility_iterator node = GetChildren().GetFirst(); - node; - node = node->GetNext() ) - { - wxWindow *win = node->GetData(); - if ( win->IsTopLevel() - || !win->IsShown() -#if wxUSE_STATUSBAR - || wxDynamicCast(win, wxStatusBar) -#endif // wxUSE_STATUSBAR - ) - { - // dialogs and frames lie in different top level windows - - // don't deal with them here; as for the status bars, they - // don't lie in the client area at all - continue; - } - - int wx, wy, ww, wh; - win->GetPosition(&wx, &wy); - - // if the window hadn't been positioned yet, assume that it is in - // the origin - if ( wx == wxDefaultCoord ) - wx = 0; - if ( wy == wxDefaultCoord ) - wy = 0; - - win->GetSize(&ww, &wh); - if ( wx + ww > maxX ) - maxX = wx + ww; - if ( wy + wh > maxY ) - maxY = wy + wh; - } - - best = wxSize(maxX, maxY); - } - else // ! has children - { - // for a generic window there is no natural best size so, if the - // minimal size is not set, use the current size but take care to - // remember it as minimal size for the next time because our best size - // should be constant: otherwise we could get into a situation when the - // window is initially at some size, then expanded to a larger size and - // then, when the containing window is shrunk back (because our initial - // best size had been used for computing the parent min size), we can't - // be shrunk back any more because our best size is now bigger - wxSize size = GetMinSize(); - if ( !size.IsFullySpecified() ) - { - size.SetDefaults(GetSize()); - wxConstCast(this, wxWindowBase)->SetMinSize(size); - } - - // return as-is, unadjusted by the client size difference. - return size; - } - - // Add any difference between size and client size - wxSize diff = GetSize() - GetClientSize(); - best.x += wxMax(0, diff.x); - best.y += wxMax(0, diff.y); - - return best; -} - -// helper of GetWindowBorderSize(): as many ports don't implement support for -// wxSYS_BORDER/EDGE_X/Y metrics in their wxSystemSettings, use hard coded -// fallbacks in this case -static int wxGetMetricOrDefault(wxSystemMetric what) -{ - int rc = wxSystemSettings::GetMetric(what); - if ( rc == -1 ) - { - switch ( what ) - { - case wxSYS_BORDER_X: - case wxSYS_BORDER_Y: - // 2D border is by default 1 pixel wide - rc = 1; - break; - - case wxSYS_EDGE_X: - case wxSYS_EDGE_Y: - // 3D borders are by default 2 pixels - rc = 2; - break; - - default: - wxFAIL_MSG( _T("unexpected wxGetMetricOrDefault() argument") ); - rc = 0; - } - } - - return rc; -} - -wxSize wxWindowBase::GetWindowBorderSize() const -{ - wxSize size; - - switch ( GetBorder() ) - { - case wxBORDER_NONE: - // nothing to do, size is already (0, 0) - break; - - case wxBORDER_SIMPLE: - case wxBORDER_STATIC: - size.x = wxGetMetricOrDefault(wxSYS_BORDER_X); - size.y = wxGetMetricOrDefault(wxSYS_BORDER_Y); - break; - - case wxBORDER_SUNKEN: - case wxBORDER_RAISED: - size.x = wxMax(wxGetMetricOrDefault(wxSYS_EDGE_X), - wxGetMetricOrDefault(wxSYS_BORDER_X)); - size.y = wxMax(wxGetMetricOrDefault(wxSYS_EDGE_Y), - wxGetMetricOrDefault(wxSYS_BORDER_Y)); - break; - - case wxBORDER_DOUBLE: - size.x = wxGetMetricOrDefault(wxSYS_EDGE_X) + - wxGetMetricOrDefault(wxSYS_BORDER_X); - size.y = wxGetMetricOrDefault(wxSYS_EDGE_Y) + - wxGetMetricOrDefault(wxSYS_BORDER_Y); - break; - - default: - wxFAIL_MSG(_T("Unknown border style.")); - break; - } - - // we have borders on both sides - return size*2; -} - -wxSize wxWindowBase::GetEffectiveMinSize() const -{ - // merge the best size with the min size, giving priority to the min size - wxSize min = GetMinSize(); - if (min.x == wxDefaultCoord || min.y == wxDefaultCoord) - { - wxSize best = GetBestSize(); - if (min.x == wxDefaultCoord) min.x = best.x; - if (min.y == wxDefaultCoord) min.y = best.y; - } - return min; -} - - -void wxWindowBase::SetInitialSize(const wxSize& size) -{ - // Set the min size to the size passed in. This will usually either be - // wxDefaultSize or the size passed to this window's ctor/Create function. - SetMinSize(size); - - // Merge the size with the best size if needed - wxSize best = GetEffectiveMinSize(); - - // If the current size doesn't match then change it - if (GetSize() != best) - SetSize(best); -} - - -// by default the origin is not shifted -wxPoint wxWindowBase::GetClientAreaOrigin() const -{ - return wxPoint(0,0); -} - -wxSize wxWindowBase::ClientToWindowSize(const wxSize& size) const -{ - const wxSize diff(GetSize() - GetClientSize()); - - return wxSize(size.x == -1 ? -1 : size.x + diff.x, - size.y == -1 ? -1 : size.y + diff.y); -} - -wxSize wxWindowBase::WindowToClientSize(const wxSize& size) const -{ - const wxSize diff(GetSize() - GetClientSize()); - - return wxSize(size.x == -1 ? -1 : size.x - diff.x, - size.y == -1 ? -1 : size.y - diff.y); -} - -void wxWindowBase::SetWindowVariant( wxWindowVariant variant ) -{ - if ( m_windowVariant != variant ) - { - m_windowVariant = variant; - - DoSetWindowVariant(variant); - } -} - -void wxWindowBase::DoSetWindowVariant( wxWindowVariant variant ) -{ - // adjust the font height to correspond to our new variant (notice that - // we're only called if something really changed) - wxFont font = GetFont(); - int size = font.GetPointSize(); - switch ( variant ) - { - case wxWINDOW_VARIANT_NORMAL: - break; - - case wxWINDOW_VARIANT_SMALL: - size *= 3; - size /= 4; - break; - - case wxWINDOW_VARIANT_MINI: - size *= 2; - size /= 3; - break; - - case wxWINDOW_VARIANT_LARGE: - size *= 5; - size /= 4; - break; - - default: - wxFAIL_MSG(_T("unexpected window variant")); - break; - } - - font.SetPointSize(size); - SetFont(font); -} - -void wxWindowBase::DoSetSizeHints( int minW, int minH, - int maxW, int maxH, - int WXUNUSED(incW), int WXUNUSED(incH) ) -{ - wxCHECK_RET( (minW == wxDefaultCoord || maxW == wxDefaultCoord || minW <= maxW) && - (minH == wxDefaultCoord || maxH == wxDefaultCoord || minH <= maxH), - _T("min width/height must be less than max width/height!") ); - - m_minWidth = minW; - m_maxWidth = maxW; - m_minHeight = minH; - m_maxHeight = maxH; -} - - -void wxWindowBase::SetVirtualSizeHints( int minW, int minH, - int maxW, int maxH ) -{ - m_minVirtualWidth = minW; - m_maxVirtualWidth = maxW; - m_minVirtualHeight = minH; - m_maxVirtualHeight = maxH; -} - -void wxWindowBase::DoSetVirtualSize( int x, int y ) -{ - if ( m_minVirtualWidth != wxDefaultCoord && m_minVirtualWidth > x ) - x = m_minVirtualWidth; - if ( m_maxVirtualWidth != wxDefaultCoord && m_maxVirtualWidth < x ) - x = m_maxVirtualWidth; - if ( m_minVirtualHeight != wxDefaultCoord && m_minVirtualHeight > y ) - y = m_minVirtualHeight; - if ( m_maxVirtualHeight != wxDefaultCoord && m_maxVirtualHeight < y ) - y = m_maxVirtualHeight; - - m_virtualSize = wxSize(x, y); -} - -wxSize wxWindowBase::DoGetVirtualSize() const -{ - // we should use the entire client area so if it is greater than our - // virtual size, expand it to fit (otherwise if the window is big enough we - // wouldn't be using parts of it) - wxSize size = GetClientSize(); - if ( m_virtualSize.x > size.x ) - size.x = m_virtualSize.x; - - if ( m_virtualSize.y >= size.y ) - size.y = m_virtualSize.y; - - return size; -} - -void wxWindowBase::DoGetScreenPosition(int *x, int *y) const -{ - // screen position is the same as (0, 0) in client coords for non TLWs (and - // TLWs override this method) - if ( x ) - *x = 0; - if ( y ) - *y = 0; - - ClientToScreen(x, y); -} - -// ---------------------------------------------------------------------------- -// show/hide/enable/disable the window -// ---------------------------------------------------------------------------- - -bool wxWindowBase::Show(bool show) -{ - if ( show != m_isShown ) - { - m_isShown = show; - - return true; - } - else - { - return false; - } -} - -bool wxWindowBase::Enable(bool enable) -{ - if ( enable != m_isEnabled ) - { - m_isEnabled = enable; - - return true; - } - else - { - return false; - } -} - -bool wxWindowBase::IsShownOnScreen() const -{ - // A window is shown on screen if it itself is shown and so are all its - // parents. But if a window is toplevel one, then its always visible on - // screen if IsShown() returns true, even if it has a hidden parent. - return IsShown() && - (IsTopLevel() || !GetParent() || GetParent()->IsShownOnScreen()); -} - -// ---------------------------------------------------------------------------- -// RTTI -// ---------------------------------------------------------------------------- - -bool wxWindowBase::IsTopLevel() const -{ - return false; -} - -// ---------------------------------------------------------------------------- -// reparenting the window -// ---------------------------------------------------------------------------- - -void wxWindowBase::AddChild(wxWindowBase *child) -{ - wxCHECK_RET( child, wxT("can't add a NULL child") ); - - // this should never happen and it will lead to a crash later if it does - // because RemoveChild() will remove only one node from the children list - // and the other(s) one(s) will be left with dangling pointers in them - wxASSERT_MSG( !GetChildren().Find((wxWindow*)child), _T("AddChild() called twice") ); - - GetChildren().Append((wxWindow*)child); - child->SetParent(this); -} - -void wxWindowBase::RemoveChild(wxWindowBase *child) -{ - wxCHECK_RET( child, wxT("can't remove a NULL child") ); - - GetChildren().DeleteObject((wxWindow *)child); - child->SetParent(NULL); -} - -bool wxWindowBase::Reparent(wxWindowBase *newParent) -{ - wxWindow *oldParent = GetParent(); - if ( newParent == oldParent ) - { - // nothing done - return false; - } - - // unlink this window from the existing parent. - if ( oldParent ) - { - oldParent->RemoveChild(this); - } - else - { - wxTopLevelWindows.DeleteObject((wxWindow *)this); - } - - // add it to the new one - if ( newParent ) - { - newParent->AddChild(this); - } - else - { - wxTopLevelWindows.Append((wxWindow *)this); - } - - return true; -} - -// ---------------------------------------------------------------------------- -// event handler stuff -// ---------------------------------------------------------------------------- - -void wxWindowBase::PushEventHandler(wxEvtHandler *handler) -{ - wxEvtHandler *handlerOld = GetEventHandler(); - - handler->SetNextHandler(handlerOld); - - if ( handlerOld ) - GetEventHandler()->SetPreviousHandler(handler); - - SetEventHandler(handler); -} - -wxEvtHandler *wxWindowBase::PopEventHandler(bool deleteHandler) -{ - wxEvtHandler *handlerA = GetEventHandler(); - if ( handlerA ) - { - wxEvtHandler *handlerB = handlerA->GetNextHandler(); - handlerA->SetNextHandler((wxEvtHandler *)NULL); - - if ( handlerB ) - handlerB->SetPreviousHandler((wxEvtHandler *)NULL); - SetEventHandler(handlerB); - - if ( deleteHandler ) - { - delete handlerA; - handlerA = (wxEvtHandler *)NULL; - } - } - - return handlerA; -} - -bool wxWindowBase::RemoveEventHandler(wxEvtHandler *handler) -{ - wxCHECK_MSG( handler, false, _T("RemoveEventHandler(NULL) called") ); - - wxEvtHandler *handlerPrev = NULL, - *handlerCur = GetEventHandler(); - while ( handlerCur ) - { - wxEvtHandler *handlerNext = handlerCur->GetNextHandler(); - - if ( handlerCur == handler ) - { - if ( handlerPrev ) - { - handlerPrev->SetNextHandler(handlerNext); - } - else - { - SetEventHandler(handlerNext); - } - - if ( handlerNext ) - { - handlerNext->SetPreviousHandler ( handlerPrev ); - } - - handler->SetNextHandler(NULL); - handler->SetPreviousHandler(NULL); - - return true; - } - - handlerPrev = handlerCur; - handlerCur = handlerNext; - } - - wxFAIL_MSG( _T("where has the event handler gone?") ); - - return false; -} - -// ---------------------------------------------------------------------------- -// colours, fonts &c -// ---------------------------------------------------------------------------- - -void wxWindowBase::InheritAttributes() -{ - const wxWindowBase * const parent = GetParent(); - if ( !parent ) - return; - - // we only inherit attributes which had been explicitly set for the parent - // which ensures that this only happens if the user really wants it and - // not by default which wouldn't make any sense in modern GUIs where the - // controls don't all use the same fonts (nor colours) - if ( parent->m_inheritFont && !m_hasFont ) - SetFont(parent->GetFont()); - - // in addition, there is a possibility to explicitly forbid inheriting - // colours at each class level by overriding ShouldInheritColours() - if ( ShouldInheritColours() ) - { - if ( parent->m_inheritFgCol && !m_hasFgCol ) - SetForegroundColour(parent->GetForegroundColour()); - - // inheriting (solid) background colour is wrong as it totally breaks - // any kind of themed backgrounds - // - // instead, the controls should use the same background as their parent - // (ideally by not drawing it at all) -#if 0 - if ( parent->m_inheritBgCol && !m_hasBgCol ) - SetBackgroundColour(parent->GetBackgroundColour()); -#endif // 0 - } -} - -/* static */ wxVisualAttributes -wxWindowBase::GetClassDefaultAttributes(wxWindowVariant WXUNUSED(variant)) -{ - // it is important to return valid values for all attributes from here, - // GetXXX() below rely on this - wxVisualAttributes attrs; - attrs.font = wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT); - attrs.colFg = wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT); - - // On Smartphone/PocketPC, wxSYS_COLOUR_WINDOW is a better reflection of - // the usual background colour than wxSYS_COLOUR_BTNFACE. - // It's a pity that wxSYS_COLOUR_WINDOW isn't always a suitable background - // colour on other platforms. - -#if defined(__WXWINCE__) && (defined(__SMARTPHONE__) || defined(__POCKETPC__)) - attrs.colBg = wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW); -#else - attrs.colBg = wxSystemSettings::GetColour(wxSYS_COLOUR_BTNFACE); -#endif - return attrs; -} - -wxColour wxWindowBase::GetBackgroundColour() const -{ - if ( !m_backgroundColour.Ok() ) - { - wxASSERT_MSG( !m_hasBgCol, _T("we have invalid explicit bg colour?") ); - - // get our default background colour - wxColour colBg = GetDefaultAttributes().colBg; - - // we must return some valid colour to avoid redoing this every time - // and also to avoid surprizing the applications written for older - // wxWidgets versions where GetBackgroundColour() always returned - // something -- so give them something even if it doesn't make sense - // for this window (e.g. it has a themed background) - if ( !colBg.Ok() ) - colBg = GetClassDefaultAttributes().colBg; - - return colBg; - } - else - return m_backgroundColour; -} - -wxColour wxWindowBase::GetForegroundColour() const -{ - // logic is the same as above - if ( !m_hasFgCol && !m_foregroundColour.Ok() ) - { - wxASSERT_MSG( !m_hasFgCol, _T("we have invalid explicit fg colour?") ); - - wxColour colFg = GetDefaultAttributes().colFg; - - if ( !colFg.Ok() ) - colFg = GetClassDefaultAttributes().colFg; - - return colFg; - } - else - return m_foregroundColour; -} - -bool wxWindowBase::SetBackgroundColour( const wxColour &colour ) -{ - if ( colour == m_backgroundColour ) - return false; - - m_hasBgCol = colour.Ok(); - if ( m_backgroundStyle != wxBG_STYLE_CUSTOM ) - m_backgroundStyle = m_hasBgCol ? wxBG_STYLE_COLOUR : wxBG_STYLE_SYSTEM; - - m_inheritBgCol = m_hasBgCol; - m_backgroundColour = colour; - SetThemeEnabled( !m_hasBgCol && !m_foregroundColour.Ok() ); - return true; -} - -bool wxWindowBase::SetForegroundColour( const wxColour &colour ) -{ - if (colour == m_foregroundColour ) - return false; - - m_hasFgCol = colour.Ok(); - m_inheritFgCol = m_hasFgCol; - m_foregroundColour = colour; - SetThemeEnabled( !m_hasFgCol && !m_backgroundColour.Ok() ); - return true; -} - -bool wxWindowBase::SetCursor(const wxCursor& cursor) -{ - // setting an invalid cursor is ok, it means that we don't have any special - // cursor - if ( m_cursor.IsSameAs(cursor) ) - { - // no change - return false; - } - - m_cursor = cursor; - - return true; -} - -wxFont wxWindowBase::GetFont() const -{ - // logic is the same as in GetBackgroundColour() - if ( !m_font.Ok() ) - { - wxASSERT_MSG( !m_hasFont, _T("we have invalid explicit font?") ); - - wxFont font = GetDefaultAttributes().font; - if ( !font.Ok() ) - font = GetClassDefaultAttributes().font; - - return font; - } - else - return m_font; -} - -bool wxWindowBase::SetFont(const wxFont& font) -{ - if ( font == m_font ) - { - // no change - return false; - } - - m_font = font; - m_hasFont = font.Ok(); - m_inheritFont = m_hasFont; - - InvalidateBestSize(); - - return true; -} - -#if wxUSE_PALETTE - -void wxWindowBase::SetPalette(const wxPalette& pal) -{ - m_hasCustomPalette = true; - m_palette = pal; - - // VZ: can anyone explain me what do we do here? - wxWindowDC d((wxWindow *) this); - d.SetPalette(pal); -} - -wxWindow *wxWindowBase::GetAncestorWithCustomPalette() const -{ - wxWindow *win = (wxWindow *)this; - while ( win && !win->HasCustomPalette() ) - { - win = win->GetParent(); - } - - return win; -} - -#endif // wxUSE_PALETTE - -#if wxUSE_CARET -void wxWindowBase::SetCaret(wxCaret *caret) -{ - if ( m_caret ) - { - delete m_caret; - } - - m_caret = caret; - - if ( m_caret ) - { - wxASSERT_MSG( m_caret->GetWindow() == this, - wxT("caret should be created associated to this window") ); - } -} -#endif // wxUSE_CARET - -#if wxUSE_VALIDATORS -// ---------------------------------------------------------------------------- -// validators -// ---------------------------------------------------------------------------- - -void wxWindowBase::SetValidator(const wxValidator& validator) -{ - if ( m_windowValidator ) - delete m_windowValidator; - - m_windowValidator = (wxValidator *)validator.Clone(); - - if ( m_windowValidator ) - m_windowValidator->SetWindow(this); -} -#endif // wxUSE_VALIDATORS - -// ---------------------------------------------------------------------------- -// update region stuff -// ---------------------------------------------------------------------------- - -wxRect wxWindowBase::GetUpdateClientRect() const -{ - wxRegion rgnUpdate = GetUpdateRegion(); - rgnUpdate.Intersect(GetClientRect()); - wxRect rectUpdate = rgnUpdate.GetBox(); - wxPoint ptOrigin = GetClientAreaOrigin(); - rectUpdate.x -= ptOrigin.x; - rectUpdate.y -= ptOrigin.y; - - return rectUpdate; -} - -bool wxWindowBase::DoIsExposed(int x, int y) const -{ - return m_updateRegion.Contains(x, y) != wxOutRegion; -} - -bool wxWindowBase::DoIsExposed(int x, int y, int w, int h) const -{ - return m_updateRegion.Contains(x, y, w, h) != wxOutRegion; -} - -void wxWindowBase::ClearBackground() -{ - // wxGTK uses its own version, no need to add never used code -#ifndef __WXGTK__ - wxClientDC dc((wxWindow *)this); - wxBrush brush(GetBackgroundColour(), wxSOLID); - dc.SetBackground(brush); - dc.Clear(); -#endif // __WXGTK__ -} - -// ---------------------------------------------------------------------------- -// find child window by id or name -// ---------------------------------------------------------------------------- - -wxWindow *wxWindowBase::FindWindow(long id) const -{ - if ( id == m_windowId ) - return (wxWindow *)this; - - wxWindowBase *res = (wxWindow *)NULL; - wxWindowList::compatibility_iterator node; - for ( node = m_children.GetFirst(); node && !res; node = node->GetNext() ) - { - wxWindowBase *child = node->GetData(); - res = child->FindWindow( id ); - } - - return (wxWindow *)res; -} - -wxWindow *wxWindowBase::FindWindow(const wxString& name) const -{ - if ( name == m_windowName ) - return (wxWindow *)this; - - wxWindowBase *res = (wxWindow *)NULL; - wxWindowList::compatibility_iterator node; - for ( node = m_children.GetFirst(); node && !res; node = node->GetNext() ) - { - wxWindow *child = node->GetData(); - res = child->FindWindow(name); - } - - return (wxWindow *)res; -} - - -// find any window by id or name or label: If parent is non-NULL, look through -// children for a label or title matching the specified string. If NULL, look -// through all top-level windows. -// -// to avoid duplicating code we reuse the same helper function but with -// different comparators - -typedef bool (*wxFindWindowCmp)(const wxWindow *win, - const wxString& label, long id); - -static -bool wxFindWindowCmpLabels(const wxWindow *win, const wxString& label, - long WXUNUSED(id)) -{ - return win->GetLabel() == label; -} - -static -bool wxFindWindowCmpNames(const wxWindow *win, const wxString& label, - long WXUNUSED(id)) -{ - return win->GetName() == label; -} - -static -bool wxFindWindowCmpIds(const wxWindow *win, const wxString& WXUNUSED(label), - long id) -{ - return win->GetId() == id; -} - -// recursive helper for the FindWindowByXXX() functions -static -wxWindow *wxFindWindowRecursively(const wxWindow *parent, - const wxString& label, - long id, - wxFindWindowCmp cmp) -{ - if ( parent ) - { - // see if this is the one we're looking for - if ( (*cmp)(parent, label, id) ) - return (wxWindow *)parent; - - // It wasn't, so check all its children - for ( wxWindowList::compatibility_iterator node = parent->GetChildren().GetFirst(); - node; - node = node->GetNext() ) - { - // recursively check each child - wxWindow *win = (wxWindow *)node->GetData(); - wxWindow *retwin = wxFindWindowRecursively(win, label, id, cmp); - if (retwin) - return retwin; - } - } - - // Not found - return NULL; -} - -// helper for FindWindowByXXX() -static -wxWindow *wxFindWindowHelper(const wxWindow *parent, - const wxString& label, - long id, - wxFindWindowCmp cmp) -{ - if ( parent ) - { - // just check parent and all its children - return wxFindWindowRecursively(parent, label, id, cmp); - } - - // start at very top of wx's windows - for ( wxWindowList::compatibility_iterator node = wxTopLevelWindows.GetFirst(); - node; - node = node->GetNext() ) - { - // recursively check each window & its children - wxWindow *win = node->GetData(); - wxWindow *retwin = wxFindWindowRecursively(win, label, id, cmp); - if (retwin) - return retwin; - } - - return NULL; -} - -/* static */ -wxWindow * -wxWindowBase::FindWindowByLabel(const wxString& title, const wxWindow *parent) -{ - return wxFindWindowHelper(parent, title, 0, wxFindWindowCmpLabels); -} - -/* static */ -wxWindow * -wxWindowBase::FindWindowByName(const wxString& title, const wxWindow *parent) -{ - wxWindow *win = wxFindWindowHelper(parent, title, 0, wxFindWindowCmpNames); - - if ( !win ) - { - // fall back to the label - win = FindWindowByLabel(title, parent); - } - - return win; -} - -/* static */ -wxWindow * -wxWindowBase::FindWindowById( long id, const wxWindow* parent ) -{ - return wxFindWindowHelper(parent, wxEmptyString, id, wxFindWindowCmpIds); -} - -// ---------------------------------------------------------------------------- -// dialog oriented functions -// ---------------------------------------------------------------------------- - -void wxWindowBase::MakeModal(bool modal) -{ - // Disable all other windows - if ( IsTopLevel() ) - { - wxWindowList::compatibility_iterator node = wxTopLevelWindows.GetFirst(); - while (node) - { - wxWindow *win = node->GetData(); - if (win != this) - win->Enable(!modal); - - node = node->GetNext(); - } - } -} - -bool wxWindowBase::Validate() -{ -#if wxUSE_VALIDATORS - bool recurse = (GetExtraStyle() & wxWS_EX_VALIDATE_RECURSIVELY) != 0; - - wxWindowList::compatibility_iterator node; - for ( node = m_children.GetFirst(); node; node = node->GetNext() ) - { - wxWindowBase *child = node->GetData(); - wxValidator *validator = child->GetValidator(); - if ( validator && !validator->Validate((wxWindow *)this) ) - { - return false; - } - - if ( recurse && !child->Validate() ) - { - return false; - } - } -#endif // wxUSE_VALIDATORS - - return true; -} - -bool wxWindowBase::TransferDataToWindow() -{ -#if wxUSE_VALIDATORS - bool recurse = (GetExtraStyle() & wxWS_EX_VALIDATE_RECURSIVELY) != 0; - - wxWindowList::compatibility_iterator node; - for ( node = m_children.GetFirst(); node; node = node->GetNext() ) - { - wxWindowBase *child = node->GetData(); - wxValidator *validator = child->GetValidator(); - if ( validator && !validator->TransferToWindow() ) - { - wxLogWarning(_("Could not transfer data to window")); -#if wxUSE_LOG - wxLog::FlushActive(); -#endif // wxUSE_LOG - - return false; - } - - if ( recurse ) - { - if ( !child->TransferDataToWindow() ) - { - // warning already given - return false; - } - } - } -#endif // wxUSE_VALIDATORS - - return true; -} - -bool wxWindowBase::TransferDataFromWindow() -{ -#if wxUSE_VALIDATORS - bool recurse = (GetExtraStyle() & wxWS_EX_VALIDATE_RECURSIVELY) != 0; - - wxWindowList::compatibility_iterator node; - for ( node = m_children.GetFirst(); node; node = node->GetNext() ) - { - wxWindow *child = node->GetData(); - wxValidator *validator = child->GetValidator(); - if ( validator && !validator->TransferFromWindow() ) - { - // nop warning here because the application is supposed to give - // one itself - we don't know here what might have gone wrongly - - return false; - } - - if ( recurse ) - { - if ( !child->TransferDataFromWindow() ) - { - // warning already given - return false; - } - } - } -#endif // wxUSE_VALIDATORS - - return true; -} - -void wxWindowBase::InitDialog() -{ - wxInitDialogEvent event(GetId()); - event.SetEventObject( this ); - GetEventHandler()->ProcessEvent(event); -} - -// ---------------------------------------------------------------------------- -// context-sensitive help support -// ---------------------------------------------------------------------------- - -#if wxUSE_HELP - -// associate this help text with this window -void wxWindowBase::SetHelpText(const wxString& text) -{ - wxHelpProvider *helpProvider = wxHelpProvider::Get(); - if ( helpProvider ) - { - helpProvider->AddHelp(this, text); - } -} - -// associate this help text with all windows with the same id as this -// one -void wxWindowBase::SetHelpTextForId(const wxString& text) -{ - wxHelpProvider *helpProvider = wxHelpProvider::Get(); - if ( helpProvider ) - { - helpProvider->AddHelp(GetId(), text); - } -} - -// get the help string associated with this window (may be empty) -// default implementation forwards calls to the help provider -wxString -wxWindowBase::GetHelpTextAtPoint(const wxPoint & WXUNUSED(pt), - wxHelpEvent::Origin WXUNUSED(origin)) const -{ - wxString text; - wxHelpProvider *helpProvider = wxHelpProvider::Get(); - if ( helpProvider ) - { - text = helpProvider->GetHelp(this); - } - - return text; -} - -// show help for this window -void wxWindowBase::OnHelp(wxHelpEvent& event) -{ - wxHelpProvider *helpProvider = wxHelpProvider::Get(); - if ( helpProvider ) - { - wxPoint pos = event.GetPosition(); - const wxHelpEvent::Origin origin = event.GetOrigin(); - if ( origin == wxHelpEvent::Origin_Keyboard ) - { - // if the help event was generated from keyboard it shouldn't - // appear at the mouse position (which is still the only position - // associated with help event) if the mouse is far away, although - // we still do use the mouse position if it's over the window - // because we suppose the user looks approximately at the mouse - // already and so it would be more convenient than showing tooltip - // at some arbitrary position which can be quite far from it - const wxRect rectClient = GetClientRect(); - if ( !rectClient.Contains(ScreenToClient(pos)) ) - { - // position help slightly under and to the right of this window - pos = ClientToScreen(wxPoint( - 2*GetCharWidth(), - rectClient.height + GetCharHeight() - )); - } - } - - if ( helpProvider->ShowHelpAtPoint(this, pos, origin) ) - { - // skip the event.Skip() below - return; - } - } - - event.Skip(); -} - -#endif // wxUSE_HELP - -// ---------------------------------------------------------------------------- -// tooltips -// ---------------------------------------------------------------------------- - -#if wxUSE_TOOLTIPS - -void wxWindowBase::SetToolTip( const wxString &tip ) -{ - // don't create the new tooltip if we already have one - if ( m_tooltip ) - { - m_tooltip->SetTip( tip ); - } - else - { - SetToolTip( new wxToolTip( tip ) ); - } - - // setting empty tooltip text does not remove the tooltip any more - use - // SetToolTip((wxToolTip *)NULL) for this -} - -void wxWindowBase::DoSetToolTip(wxToolTip *tooltip) -{ - if ( m_tooltip != tooltip ) - { - if ( m_tooltip ) - delete m_tooltip; - - m_tooltip = tooltip; - } -} - -#endif // wxUSE_TOOLTIPS - -// ---------------------------------------------------------------------------- -// constraints and sizers -// ---------------------------------------------------------------------------- - -#if wxUSE_CONSTRAINTS - -void wxWindowBase::SetConstraints( wxLayoutConstraints *constraints ) -{ - if ( m_constraints ) - { - UnsetConstraints(m_constraints); - delete m_constraints; - } - m_constraints = constraints; - if ( m_constraints ) - { - // Make sure other windows know they're part of a 'meaningful relationship' - if ( m_constraints->left.GetOtherWindow() && (m_constraints->left.GetOtherWindow() != this) ) - m_constraints->left.GetOtherWindow()->AddConstraintReference(this); - if ( m_constraints->top.GetOtherWindow() && (m_constraints->top.GetOtherWindow() != this) ) - m_constraints->top.GetOtherWindow()->AddConstraintReference(this); - if ( m_constraints->right.GetOtherWindow() && (m_constraints->right.GetOtherWindow() != this) ) - m_constraints->right.GetOtherWindow()->AddConstraintReference(this); - if ( m_constraints->bottom.GetOtherWindow() && (m_constraints->bottom.GetOtherWindow() != this) ) - m_constraints->bottom.GetOtherWindow()->AddConstraintReference(this); - if ( m_constraints->width.GetOtherWindow() && (m_constraints->width.GetOtherWindow() != this) ) - m_constraints->width.GetOtherWindow()->AddConstraintReference(this); - if ( m_constraints->height.GetOtherWindow() && (m_constraints->height.GetOtherWindow() != this) ) - m_constraints->height.GetOtherWindow()->AddConstraintReference(this); - if ( m_constraints->centreX.GetOtherWindow() && (m_constraints->centreX.GetOtherWindow() != this) ) - m_constraints->centreX.GetOtherWindow()->AddConstraintReference(this); - if ( m_constraints->centreY.GetOtherWindow() && (m_constraints->centreY.GetOtherWindow() != this) ) - m_constraints->centreY.GetOtherWindow()->AddConstraintReference(this); - } -} - -// This removes any dangling pointers to this window in other windows' -// constraintsInvolvedIn lists. -void wxWindowBase::UnsetConstraints(wxLayoutConstraints *c) -{ - if ( c ) - { - if ( c->left.GetOtherWindow() && (c->top.GetOtherWindow() != this) ) - c->left.GetOtherWindow()->RemoveConstraintReference(this); - if ( c->top.GetOtherWindow() && (c->top.GetOtherWindow() != this) ) - c->top.GetOtherWindow()->RemoveConstraintReference(this); - if ( c->right.GetOtherWindow() && (c->right.GetOtherWindow() != this) ) - c->right.GetOtherWindow()->RemoveConstraintReference(this); - if ( c->bottom.GetOtherWindow() && (c->bottom.GetOtherWindow() != this) ) - c->bottom.GetOtherWindow()->RemoveConstraintReference(this); - if ( c->width.GetOtherWindow() && (c->width.GetOtherWindow() != this) ) - c->width.GetOtherWindow()->RemoveConstraintReference(this); - if ( c->height.GetOtherWindow() && (c->height.GetOtherWindow() != this) ) - c->height.GetOtherWindow()->RemoveConstraintReference(this); - if ( c->centreX.GetOtherWindow() && (c->centreX.GetOtherWindow() != this) ) - c->centreX.GetOtherWindow()->RemoveConstraintReference(this); - if ( c->centreY.GetOtherWindow() && (c->centreY.GetOtherWindow() != this) ) - c->centreY.GetOtherWindow()->RemoveConstraintReference(this); - } -} - -// Back-pointer to other windows we're involved with, so if we delete this -// window, we must delete any constraints we're involved with. -void wxWindowBase::AddConstraintReference(wxWindowBase *otherWin) -{ - if ( !m_constraintsInvolvedIn ) - m_constraintsInvolvedIn = new wxWindowList; - if ( !m_constraintsInvolvedIn->Find((wxWindow *)otherWin) ) - m_constraintsInvolvedIn->Append((wxWindow *)otherWin); -} - -// REMOVE back-pointer to other windows we're involved with. -void wxWindowBase::RemoveConstraintReference(wxWindowBase *otherWin) -{ - if ( m_constraintsInvolvedIn ) - m_constraintsInvolvedIn->DeleteObject((wxWindow *)otherWin); -} - -// Reset any constraints that mention this window -void wxWindowBase::DeleteRelatedConstraints() -{ - if ( m_constraintsInvolvedIn ) - { - wxWindowList::compatibility_iterator node = m_constraintsInvolvedIn->GetFirst(); - while (node) - { - wxWindow *win = node->GetData(); - wxLayoutConstraints *constr = win->GetConstraints(); - - // Reset any constraints involving this window - if ( constr ) - { - constr->left.ResetIfWin(this); - constr->top.ResetIfWin(this); - constr->right.ResetIfWin(this); - constr->bottom.ResetIfWin(this); - constr->width.ResetIfWin(this); - constr->height.ResetIfWin(this); - constr->centreX.ResetIfWin(this); - constr->centreY.ResetIfWin(this); - } - - wxWindowList::compatibility_iterator next = node->GetNext(); - m_constraintsInvolvedIn->Erase(node); - node = next; - } - - delete m_constraintsInvolvedIn; - m_constraintsInvolvedIn = (wxWindowList *) NULL; - } -} - -#endif // wxUSE_CONSTRAINTS - -void wxWindowBase::SetSizer(wxSizer *sizer, bool deleteOld) -{ - if ( sizer == m_windowSizer) - return; - - if ( m_windowSizer ) - { - m_windowSizer->SetContainingWindow(NULL); - - if ( deleteOld ) - delete m_windowSizer; - } - - m_windowSizer = sizer; - if ( m_windowSizer ) - { - m_windowSizer->SetContainingWindow((wxWindow *)this); - } - - SetAutoLayout(m_windowSizer != NULL); -} - -void wxWindowBase::SetSizerAndFit(wxSizer *sizer, bool deleteOld) -{ - SetSizer( sizer, deleteOld ); - sizer->SetSizeHints( (wxWindow*) this ); -} - - -void wxWindowBase::SetContainingSizer(wxSizer* sizer) -{ - // adding a window to a sizer twice is going to result in fatal and - // hard to debug problems later because when deleting the second - // associated wxSizerItem we're going to dereference a dangling - // pointer; so try to detect this as early as possible - wxASSERT_MSG( !sizer || m_containingSizer != sizer, - _T("Adding a window to the same sizer twice?") ); - - m_containingSizer = sizer; -} - -#if wxUSE_CONSTRAINTS - -void wxWindowBase::SatisfyConstraints() -{ - wxLayoutConstraints *constr = GetConstraints(); - bool wasOk = constr && constr->AreSatisfied(); - - ResetConstraints(); // Mark all constraints as unevaluated - - int noChanges = 1; - - // if we're a top level panel (i.e. our parent is frame/dialog), our - // own constraints will never be satisfied any more unless we do it - // here - if ( wasOk ) - { - while ( noChanges > 0 ) - { - LayoutPhase1(&noChanges); - } - } - - LayoutPhase2(&noChanges); -} - -#endif // wxUSE_CONSTRAINTS - -bool wxWindowBase::Layout() -{ - // If there is a sizer, use it instead of the constraints - if ( GetSizer() ) - { - int w = 0, h = 0; - GetVirtualSize(&w, &h); - GetSizer()->SetDimension( 0, 0, w, h ); - } -#if wxUSE_CONSTRAINTS - else - { - SatisfyConstraints(); // Find the right constraints values - SetConstraintSizes(); // Recursively set the real window sizes - } -#endif - - return true; -} - -#if wxUSE_CONSTRAINTS - -// first phase of the constraints evaluation: set our own constraints -bool wxWindowBase::LayoutPhase1(int *noChanges) -{ - wxLayoutConstraints *constr = GetConstraints(); - - return !constr || constr->SatisfyConstraints(this, noChanges); -} - -// second phase: set the constraints for our children -bool wxWindowBase::LayoutPhase2(int *noChanges) -{ - *noChanges = 0; - - // Layout children - DoPhase(1); - - // Layout grand children - DoPhase(2); - - return true; -} - -// Do a phase of evaluating child constraints -bool wxWindowBase::DoPhase(int phase) -{ - // the list containing the children for which the constraints are already - // set correctly - wxWindowList succeeded; - - // the max number of iterations we loop before concluding that we can't set - // the constraints - static const int maxIterations = 500; - - for ( int noIterations = 0; noIterations < maxIterations; noIterations++ ) - { - int noChanges = 0; - - // loop over all children setting their constraints - for ( wxWindowList::compatibility_iterator node = GetChildren().GetFirst(); - node; - node = node->GetNext() ) - { - wxWindow *child = node->GetData(); - if ( child->IsTopLevel() ) - { - // top level children are not inside our client area - continue; - } - - if ( !child->GetConstraints() || succeeded.Find(child) ) - { - // this one is either already ok or nothing we can do about it - continue; - } - - int tempNoChanges = 0; - bool success = phase == 1 ? child->LayoutPhase1(&tempNoChanges) - : child->LayoutPhase2(&tempNoChanges); - noChanges += tempNoChanges; - - if ( success ) - { - succeeded.Append(child); - } - } - - if ( !noChanges ) - { - // constraints are set - break; - } - } - - return true; -} - -void wxWindowBase::ResetConstraints() -{ - wxLayoutConstraints *constr = GetConstraints(); - if ( constr ) - { - constr->left.SetDone(false); - constr->top.SetDone(false); - constr->right.SetDone(false); - constr->bottom.SetDone(false); - constr->width.SetDone(false); - constr->height.SetDone(false); - constr->centreX.SetDone(false); - constr->centreY.SetDone(false); - } - - wxWindowList::compatibility_iterator node = GetChildren().GetFirst(); - while (node) - { - wxWindow *win = node->GetData(); - if ( !win->IsTopLevel() ) - win->ResetConstraints(); - node = node->GetNext(); - } -} - -// Need to distinguish between setting the 'fake' size for windows and sizers, -// and setting the real values. -void wxWindowBase::SetConstraintSizes(bool recurse) -{ - wxLayoutConstraints *constr = GetConstraints(); - if ( constr && constr->AreSatisfied() ) - { - int x = constr->left.GetValue(); - int y = constr->top.GetValue(); - int w = constr->width.GetValue(); - int h = constr->height.GetValue(); - - if ( (constr->width.GetRelationship() != wxAsIs ) || - (constr->height.GetRelationship() != wxAsIs) ) - { - SetSize(x, y, w, h); - } - else - { - // If we don't want to resize this window, just move it... - Move(x, y); - } - } - else if ( constr ) - { - wxLogDebug(wxT("Constraints not satisfied for %s named '%s'."), - GetClassInfo()->GetClassName(), - GetName().c_str()); - } - - if ( recurse ) - { - wxWindowList::compatibility_iterator node = GetChildren().GetFirst(); - while (node) - { - wxWindow *win = node->GetData(); - if ( !win->IsTopLevel() && win->GetConstraints() ) - win->SetConstraintSizes(); - node = node->GetNext(); - } - } -} - -// Only set the size/position of the constraint (if any) -void wxWindowBase::SetSizeConstraint(int x, int y, int w, int h) -{ - wxLayoutConstraints *constr = GetConstraints(); - if ( constr ) - { - if ( x != wxDefaultCoord ) - { - constr->left.SetValue(x); - constr->left.SetDone(true); - } - if ( y != wxDefaultCoord ) - { - constr->top.SetValue(y); - constr->top.SetDone(true); - } - if ( w != wxDefaultCoord ) - { - constr->width.SetValue(w); - constr->width.SetDone(true); - } - if ( h != wxDefaultCoord ) - { - constr->height.SetValue(h); - constr->height.SetDone(true); - } - } -} - -void wxWindowBase::MoveConstraint(int x, int y) -{ - wxLayoutConstraints *constr = GetConstraints(); - if ( constr ) - { - if ( x != wxDefaultCoord ) - { - constr->left.SetValue(x); - constr->left.SetDone(true); - } - if ( y != wxDefaultCoord ) - { - constr->top.SetValue(y); - constr->top.SetDone(true); - } - } -} - -void wxWindowBase::GetSizeConstraint(int *w, int *h) const -{ - wxLayoutConstraints *constr = GetConstraints(); - if ( constr ) - { - *w = constr->width.GetValue(); - *h = constr->height.GetValue(); - } - else - GetSize(w, h); -} - -void wxWindowBase::GetClientSizeConstraint(int *w, int *h) const -{ - wxLayoutConstraints *constr = GetConstraints(); - if ( constr ) - { - *w = constr->width.GetValue(); - *h = constr->height.GetValue(); - } - else - GetClientSize(w, h); -} - -void wxWindowBase::GetPositionConstraint(int *x, int *y) const -{ - wxLayoutConstraints *constr = GetConstraints(); - if ( constr ) - { - *x = constr->left.GetValue(); - *y = constr->top.GetValue(); - } - else - GetPosition(x, y); -} - -#endif // wxUSE_CONSTRAINTS - -void wxWindowBase::AdjustForParentClientOrigin(int& x, int& y, int sizeFlags) const -{ - // don't do it for the dialogs/frames - they float independently of their - // parent - if ( !IsTopLevel() ) - { - wxWindow *parent = GetParent(); - if ( !(sizeFlags & wxSIZE_NO_ADJUSTMENTS) && parent ) - { - wxPoint pt(parent->GetClientAreaOrigin()); - x += pt.x; - y += pt.y; - } - } -} - -// ---------------------------------------------------------------------------- -// Update UI processing -// ---------------------------------------------------------------------------- - -void wxWindowBase::UpdateWindowUI(long flags) -{ - wxUpdateUIEvent event(GetId()); - event.SetEventObject(this); - - if ( GetEventHandler()->ProcessEvent(event) ) - { - DoUpdateWindowUI(event); - } - - if (flags & wxUPDATE_UI_RECURSE) - { - wxWindowList::compatibility_iterator node = GetChildren().GetFirst(); - while (node) - { - wxWindow* child = (wxWindow*) node->GetData(); - child->UpdateWindowUI(flags); - node = node->GetNext(); - } - } -} - -// do the window-specific processing after processing the update event -void wxWindowBase::DoUpdateWindowUI(wxUpdateUIEvent& event) -{ - if ( event.GetSetEnabled() ) - Enable(event.GetEnabled()); - - if ( event.GetSetShown() ) - Show(event.GetShown()); -} - -// ---------------------------------------------------------------------------- -// dialog units translations -// ---------------------------------------------------------------------------- - -wxPoint wxWindowBase::ConvertPixelsToDialog(const wxPoint& pt) -{ - int charWidth = GetCharWidth(); - int charHeight = GetCharHeight(); - wxPoint pt2 = wxDefaultPosition; - if (pt.x != wxDefaultCoord) - pt2.x = (int) ((pt.x * 4) / charWidth); - if (pt.y != wxDefaultCoord) - pt2.y = (int) ((pt.y * 8) / charHeight); - - return pt2; -} - -wxPoint wxWindowBase::ConvertDialogToPixels(const wxPoint& pt) -{ - int charWidth = GetCharWidth(); - int charHeight = GetCharHeight(); - wxPoint pt2 = wxDefaultPosition; - if (pt.x != wxDefaultCoord) - pt2.x = (int) ((pt.x * charWidth) / 4); - if (pt.y != wxDefaultCoord) - pt2.y = (int) ((pt.y * charHeight) / 8); - - return pt2; -} - -// ---------------------------------------------------------------------------- -// event handlers -// ---------------------------------------------------------------------------- - -// propagate the colour change event to the subwindows -void wxWindowBase::OnSysColourChanged(wxSysColourChangedEvent& event) -{ - wxWindowList::compatibility_iterator node = GetChildren().GetFirst(); - while ( node ) - { - // Only propagate to non-top-level windows - wxWindow *win = node->GetData(); - if ( !win->IsTopLevel() ) - { - wxSysColourChangedEvent event2; - event.SetEventObject(win); - win->GetEventHandler()->ProcessEvent(event2); - } - - node = node->GetNext(); - } - - Refresh(); -} - -// the default action is to populate dialog with data when it's created, -// and nudge the UI into displaying itself correctly in case -// we've turned the wxUpdateUIEvents frequency down low. -void wxWindowBase::OnInitDialog( wxInitDialogEvent &WXUNUSED(event) ) -{ - TransferDataToWindow(); - - // Update the UI at this point - UpdateWindowUI(wxUPDATE_UI_RECURSE); -} - -// methods for drawing the sizers in a visible way -#ifdef __WXDEBUG__ - -static void DrawSizers(wxWindowBase *win); - -static void DrawBorder(wxWindowBase *win, const wxRect& rect, bool fill = false) -{ - wxClientDC dc((wxWindow *)win); - dc.SetPen(*wxRED_PEN); - dc.SetBrush(fill ? wxBrush(*wxRED, wxCROSSDIAG_HATCH): *wxTRANSPARENT_BRUSH); - dc.DrawRectangle(rect.Deflate(1, 1)); -} - -static void DrawSizer(wxWindowBase *win, wxSizer *sizer) -{ - const wxSizerItemList& items = sizer->GetChildren(); - for ( wxSizerItemList::const_iterator i = items.begin(), - end = items.end(); - i != end; - ++i ) - { - wxSizerItem *item = *i; - if ( item->IsSizer() ) - { - DrawBorder(win, item->GetRect().Deflate(2)); - DrawSizer(win, item->GetSizer()); - } - else if ( item->IsSpacer() ) - { - DrawBorder(win, item->GetRect().Deflate(2), true); - } - else if ( item->IsWindow() ) - { - DrawSizers(item->GetWindow()); - } - } -} - -static void DrawSizers(wxWindowBase *win) -{ - wxSizer *sizer = win->GetSizer(); - if ( sizer ) - { - DrawBorder(win, win->GetClientSize()); - DrawSizer(win, sizer); - } - else // no sizer, still recurse into the children - { - const wxWindowList& children = win->GetChildren(); - for ( wxWindowList::const_iterator i = children.begin(), - end = children.end(); - i != end; - ++i ) - { - DrawSizers(*i); - } - } -} - -#endif // __WXDEBUG__ - -// process special middle clicks -void wxWindowBase::OnMiddleClick( wxMouseEvent& event ) -{ - if ( event.ControlDown() && event.AltDown() ) - { -#ifdef __WXDEBUG__ - // Ctrl-Alt-Shift-mclick makes the sizers visible in debug builds - if ( event.ShiftDown() ) - { - DrawSizers(this); - return; - } -#endif // __WXDEBUG__ - -#if wxUSE_MSGDLG - // don't translate these strings, they're for diagnostics purposes only - wxString msg; - msg.Printf(_T("wxWidgets Library (%s port)\n") - _T("Version %d.%d.%d%s%s, compiled at %s %s\n") - _T("Runtime version of toolkit used is %d.%d.%s\n") - _T("Copyright (c) 1995-2010 wxWidgets team"), - wxPlatformInfo::Get().GetPortIdName().c_str(), - wxMAJOR_VERSION, - wxMINOR_VERSION, - wxRELEASE_NUMBER, -#if wxUSE_UNICODE - L" (Unicode)", -#else - wxEmptyString, -#endif -#ifdef __WXDEBUG__ - _T(" Debug build"), -#else - wxEmptyString, -#endif - __TDATE__, - __TTIME__, - wxPlatformInfo::Get().GetToolkitMajorVersion(), - wxPlatformInfo::Get().GetToolkitMinorVersion(), -#ifdef __WXGTK__ - wxString::Format(_T("\nThe compile-time GTK+ version is %d.%d.%d."), GTK_MAJOR_VERSION, GTK_MINOR_VERSION, GTK_MICRO_VERSION).c_str() -#else - wxEmptyString -#endif - ); - - wxMessageBox(msg, _T("wxWidgets information"), - wxICON_INFORMATION | wxOK, - (wxWindow *)this); - } - else -#endif // wxUSE_MSGDLG - { - event.Skip(); - } -} - -// ---------------------------------------------------------------------------- -// accessibility -// ---------------------------------------------------------------------------- - -#if wxUSE_ACCESSIBILITY -void wxWindowBase::SetAccessible(wxAccessible* accessible) -{ - if (m_accessible && (accessible != m_accessible)) - delete m_accessible; - m_accessible = accessible; - if (m_accessible) - m_accessible->SetWindow((wxWindow*) this); -} - -// Returns the accessible object, creating if necessary. -wxAccessible* wxWindowBase::GetOrCreateAccessible() -{ - if (!m_accessible) - m_accessible = CreateAccessible(); - return m_accessible; -} - -// Override to create a specific accessible object. -wxAccessible* wxWindowBase::CreateAccessible() -{ - return new wxWindowAccessible((wxWindow*) this); -} - -#endif - -// ---------------------------------------------------------------------------- -// list classes implementation -// ---------------------------------------------------------------------------- - -#if wxUSE_STL - -#include "wx/listimpl.cpp" -WX_DEFINE_LIST(wxWindowList) - -#else // !wxUSE_STL - -void wxWindowListNode::DeleteData() -{ - delete (wxWindow *)GetData(); -} - -#endif // wxUSE_STL/!wxUSE_STL - -// ---------------------------------------------------------------------------- -// borders -// ---------------------------------------------------------------------------- - -wxBorder wxWindowBase::GetBorder(long flags) const -{ - wxBorder border = (wxBorder)(flags & wxBORDER_MASK); - if ( border == wxBORDER_DEFAULT ) - { - border = GetDefaultBorder(); - } - - return border; -} - -wxBorder wxWindowBase::GetDefaultBorder() const -{ - return wxBORDER_NONE; -} - -// ---------------------------------------------------------------------------- -// hit testing -// ---------------------------------------------------------------------------- - -wxHitTest wxWindowBase::DoHitTest(wxCoord x, wxCoord y) const -{ - // here we just check if the point is inside the window or not - - // check the top and left border first - bool outside = x < 0 || y < 0; - if ( !outside ) - { - // check the right and bottom borders too - wxSize size = GetSize(); - outside = x >= size.x || y >= size.y; - } - - return outside ? wxHT_WINDOW_OUTSIDE : wxHT_WINDOW_INSIDE; -} - -// ---------------------------------------------------------------------------- -// mouse capture -// ---------------------------------------------------------------------------- - -struct WXDLLEXPORT wxWindowNext -{ - wxWindow *win; - wxWindowNext *next; -} *wxWindowBase::ms_winCaptureNext = NULL; -wxWindow *wxWindowBase::ms_winCaptureCurrent = NULL; -bool wxWindowBase::ms_winCaptureChanging = false; - -void wxWindowBase::CaptureMouse() -{ - wxLogTrace(_T("mousecapture"), _T("CaptureMouse(%p)"), wx_static_cast(void*, this)); - - wxASSERT_MSG( !ms_winCaptureChanging, _T("recursive CaptureMouse call?") ); - - ms_winCaptureChanging = true; - - wxWindow *winOld = GetCapture(); - if ( winOld ) - { - ((wxWindowBase*) winOld)->DoReleaseMouse(); - - // save it on stack - wxWindowNext *item = new wxWindowNext; - item->win = winOld; - item->next = ms_winCaptureNext; - ms_winCaptureNext = item; - } - //else: no mouse capture to save - - DoCaptureMouse(); - ms_winCaptureCurrent = (wxWindow*)this; - - ms_winCaptureChanging = false; -} - -void wxWindowBase::ReleaseMouse() -{ - wxLogTrace(_T("mousecapture"), _T("ReleaseMouse(%p)"), wx_static_cast(void*, this)); - - wxASSERT_MSG( !ms_winCaptureChanging, _T("recursive ReleaseMouse call?") ); - - wxASSERT_MSG( GetCapture() == this, wxT("attempt to release mouse, but this window hasn't captured it") ); - - ms_winCaptureChanging = true; - - DoReleaseMouse(); - ms_winCaptureCurrent = NULL; - - if ( ms_winCaptureNext ) - { - ((wxWindowBase*)ms_winCaptureNext->win)->DoCaptureMouse(); - ms_winCaptureCurrent = ms_winCaptureNext->win; - - wxWindowNext *item = ms_winCaptureNext; - ms_winCaptureNext = item->next; - delete item; - } - //else: stack is empty, no previous capture - - ms_winCaptureChanging = false; - - wxLogTrace(_T("mousecapture"), - (const wxChar *) _T("After ReleaseMouse() mouse is captured by %p"), - wx_static_cast(void*, GetCapture())); -} - -static void DoNotifyWindowAboutCaptureLost(wxWindow *win) -{ - wxMouseCaptureLostEvent event(win->GetId()); - event.SetEventObject(win); - if ( !win->GetEventHandler()->ProcessEvent(event) ) - { - // windows must handle this event, otherwise the app wouldn't behave - // correctly if it loses capture unexpectedly; see the discussion here: - // http://sourceforge.net/tracker/index.php?func=detail&aid=1153662&group_id=9863&atid=109863 - // http://article.gmane.org/gmane.comp.lib.wxwidgets.devel/82376 - wxFAIL_MSG( _T("window that captured the mouse didn't process wxEVT_MOUSE_CAPTURE_LOST") ); - } -} - -/* static */ -void wxWindowBase::NotifyCaptureLost() -{ - // don't do anything if capture lost was expected, i.e. resulted from - // a wx call to ReleaseMouse or CaptureMouse: - if ( ms_winCaptureChanging ) - return; - - // if the capture was lost unexpectedly, notify every window that has - // capture (on stack or current) about it and clear the stack: - - if ( ms_winCaptureCurrent ) - { - DoNotifyWindowAboutCaptureLost(ms_winCaptureCurrent); - ms_winCaptureCurrent = NULL; - } - - while ( ms_winCaptureNext ) - { - wxWindowNext *item = ms_winCaptureNext; - ms_winCaptureNext = item->next; - - DoNotifyWindowAboutCaptureLost(item->win); - - delete item; - } -} - -#if wxUSE_HOTKEY - -bool -wxWindowBase::RegisterHotKey(int WXUNUSED(hotkeyId), - int WXUNUSED(modifiers), - int WXUNUSED(keycode)) -{ - // not implemented - return false; -} - -bool wxWindowBase::UnregisterHotKey(int WXUNUSED(hotkeyId)) -{ - // not implemented - return false; -} - -#endif // wxUSE_HOTKEY - -// ---------------------------------------------------------------------------- -// event processing -// ---------------------------------------------------------------------------- - -bool wxWindowBase::TryValidator(wxEvent& wxVALIDATOR_PARAM(event)) -{ -#if wxUSE_VALIDATORS - // Can only use the validator of the window which - // is receiving the event - if ( event.GetEventObject() == this ) - { - wxValidator *validator = GetValidator(); - if ( validator && validator->ProcessEvent(event) ) - { - return true; - } - } -#endif // wxUSE_VALIDATORS - - return false; -} - -bool wxWindowBase::TryParent(wxEvent& event) -{ - // carry on up the parent-child hierarchy if the propagation count hasn't - // reached zero yet - if ( event.ShouldPropagate() ) - { - // honour the requests to stop propagation at this window: this is - // used by the dialogs, for example, to prevent processing the events - // from the dialog controls in the parent frame which rarely, if ever, - // makes sense - if ( !(GetExtraStyle() & wxWS_EX_BLOCK_EVENTS) ) - { - wxWindow *parent = GetParent(); - if ( parent && !parent->IsBeingDeleted() ) - { - wxPropagateOnce propagateOnce(event); - - return parent->GetEventHandler()->ProcessEvent(event); - } - } - } - - return wxEvtHandler::TryParent(event); -} - -// ---------------------------------------------------------------------------- -// window relationships -// ---------------------------------------------------------------------------- - -wxWindow *wxWindowBase::DoGetSibling(MoveKind order) const -{ - wxCHECK_MSG( GetParent(), NULL, - _T("GetPrev/NextSibling() don't work for TLWs!") ); - - wxWindowList& siblings = GetParent()->GetChildren(); - wxWindowList::compatibility_iterator i = siblings.Find((wxWindow *)this); - wxCHECK_MSG( i, NULL, _T("window not a child of its parent?") ); - - if ( order == MoveBefore ) - i = i->GetPrevious(); - else // MoveAfter - i = i->GetNext(); - - return i ? i->GetData() : NULL; -} - -// ---------------------------------------------------------------------------- -// keyboard navigation -// ---------------------------------------------------------------------------- - -// Navigates in the specified direction. -bool wxWindowBase::Navigate(int flags) -{ - wxNavigationKeyEvent eventNav; - eventNav.SetFlags(flags); - eventNav.SetEventObject(this); - if ( GetParent()->GetEventHandler()->ProcessEvent(eventNav) ) - { - return true; - } - return false; -} - -void wxWindowBase::DoMoveInTabOrder(wxWindow *win, MoveKind move) -{ - // check that we're not a top level window - wxCHECK_RET( GetParent(), - _T("MoveBefore/AfterInTabOrder() don't work for TLWs!") ); - - // detect the special case when we have nothing to do anyhow and when the - // code below wouldn't work - if ( win == this ) - return; - - // find the target window in the siblings list - wxWindowList& siblings = GetParent()->GetChildren(); - wxWindowList::compatibility_iterator i = siblings.Find(win); - wxCHECK_RET( i, _T("MoveBefore/AfterInTabOrder(): win is not a sibling") ); - - // unfortunately, when wxUSE_STL == 1 DetachNode() is not implemented so we - // can't just move the node around - wxWindow *self = (wxWindow *)this; - siblings.DeleteObject(self); - if ( move == MoveAfter ) - { - i = i->GetNext(); - } - - if ( i ) - { - siblings.Insert(i, self); - } - else // MoveAfter and win was the last sibling - { - siblings.Append(self); - } -} - -// ---------------------------------------------------------------------------- -// focus handling -// ---------------------------------------------------------------------------- - -/*static*/ wxWindow* wxWindowBase::FindFocus() -{ - wxWindowBase *win = DoFindFocus(); - return win ? win->GetMainWindowOfCompositeControl() : NULL; -} - -// ---------------------------------------------------------------------------- -// drag and drop -// ---------------------------------------------------------------------------- - -#if wxUSE_DRAG_AND_DROP && !defined(__WXMSW__) - -class wxDragAcceptFilesImplTarget : public wxFileDropTarget -{ -public: - wxDragAcceptFilesImplTarget(wxWindowBase *win) : m_win(win) {} - - virtual bool OnDropFiles(wxCoord x, wxCoord y, - const wxArrayString& filenames) - { - wxDropFilesEvent event(wxEVT_DROP_FILES, - filenames.size(), - wxCArrayString(filenames).Release()); - event.SetEventObject(m_win); - event.m_pos.x = x; - event.m_pos.y = y; - - return m_win->GetEventHandler()->ProcessEvent(event); - } - -private: - wxWindowBase * const m_win; - - DECLARE_NO_COPY_CLASS(wxDragAcceptFilesImplTarget) -}; - - -// Generic version of DragAcceptFiles(). It works by installing a simple -// wxFileDropTarget-to-EVT_DROP_FILES adaptor and therefore cannot be used -// together with explicit SetDropTarget() calls. -void wxWindowBase::DragAcceptFiles(bool accept) -{ - if ( accept ) - { - wxASSERT_MSG( !GetDropTarget(), - _T("cannot use DragAcceptFiles() and SetDropTarget() together") ); - SetDropTarget(new wxDragAcceptFilesImplTarget(this)); - } - else - { - SetDropTarget(NULL); - } -} - -#endif // wxUSE_DRAG_AND_DROP && !defined(__WXMSW__) - -// ---------------------------------------------------------------------------- -// global functions -// ---------------------------------------------------------------------------- - -wxWindow* wxGetTopLevelParent(wxWindow *win) -{ - while ( win && !win->IsTopLevel() ) - win = win->GetParent(); - - return win; -} - -#if wxUSE_ACCESSIBILITY -// ---------------------------------------------------------------------------- -// accessible object for windows -// ---------------------------------------------------------------------------- - -// Can return either a child object, or an integer -// representing the child element, starting from 1. -wxAccStatus wxWindowAccessible::HitTest(const wxPoint& WXUNUSED(pt), int* WXUNUSED(childId), wxAccessible** WXUNUSED(childObject)) -{ - wxASSERT( GetWindow() != NULL ); - if (!GetWindow()) - return wxACC_FAIL; - - return wxACC_NOT_IMPLEMENTED; -} - -// Returns the rectangle for this object (id = 0) or a child element (id > 0). -wxAccStatus wxWindowAccessible::GetLocation(wxRect& rect, int elementId) -{ - wxASSERT( GetWindow() != NULL ); - if (!GetWindow()) - return wxACC_FAIL; - - wxWindow* win = NULL; - if (elementId == 0) - { - win = GetWindow(); - } - else - { - if (elementId <= (int) GetWindow()->GetChildren().GetCount()) - { - win = GetWindow()->GetChildren().Item(elementId-1)->GetData(); - } - else - return wxACC_FAIL; - } - if (win) - { - rect = win->GetRect(); - if (win->GetParent() && !win->IsKindOf(CLASSINFO(wxTopLevelWindow))) - rect.SetPosition(win->GetParent()->ClientToScreen(rect.GetPosition())); - return wxACC_OK; - } - - return wxACC_NOT_IMPLEMENTED; -} - -// Navigates from fromId to toId/toObject. -wxAccStatus wxWindowAccessible::Navigate(wxNavDir navDir, int fromId, - int* WXUNUSED(toId), wxAccessible** toObject) -{ - wxASSERT( GetWindow() != NULL ); - if (!GetWindow()) - return wxACC_FAIL; - - switch (navDir) - { - case wxNAVDIR_FIRSTCHILD: - { - if (GetWindow()->GetChildren().GetCount() == 0) - return wxACC_FALSE; - wxWindow* childWindow = (wxWindow*) GetWindow()->GetChildren().GetFirst()->GetData(); - *toObject = childWindow->GetOrCreateAccessible(); - - return wxACC_OK; - } - case wxNAVDIR_LASTCHILD: - { - if (GetWindow()->GetChildren().GetCount() == 0) - return wxACC_FALSE; - wxWindow* childWindow = (wxWindow*) GetWindow()->GetChildren().GetLast()->GetData(); - *toObject = childWindow->GetOrCreateAccessible(); - - return wxACC_OK; - } - case wxNAVDIR_RIGHT: - case wxNAVDIR_DOWN: - case wxNAVDIR_NEXT: - { - wxWindowList::compatibility_iterator node = - wxWindowList::compatibility_iterator(); - if (fromId == 0) - { - // Can't navigate to sibling of this window - // if we're a top-level window. - if (!GetWindow()->GetParent()) - return wxACC_NOT_IMPLEMENTED; - - node = GetWindow()->GetParent()->GetChildren().Find(GetWindow()); - } - else - { - if (fromId <= (int) GetWindow()->GetChildren().GetCount()) - node = GetWindow()->GetChildren().Item(fromId-1); - } - - if (node && node->GetNext()) - { - wxWindow* nextWindow = node->GetNext()->GetData(); - *toObject = nextWindow->GetOrCreateAccessible(); - return wxACC_OK; - } - else - return wxACC_FALSE; - } - case wxNAVDIR_LEFT: - case wxNAVDIR_UP: - case wxNAVDIR_PREVIOUS: - { - wxWindowList::compatibility_iterator node = - wxWindowList::compatibility_iterator(); - if (fromId == 0) - { - // Can't navigate to sibling of this window - // if we're a top-level window. - if (!GetWindow()->GetParent()) - return wxACC_NOT_IMPLEMENTED; - - node = GetWindow()->GetParent()->GetChildren().Find(GetWindow()); - } - else - { - if (fromId <= (int) GetWindow()->GetChildren().GetCount()) - node = GetWindow()->GetChildren().Item(fromId-1); - } - - if (node && node->GetPrevious()) - { - wxWindow* previousWindow = node->GetPrevious()->GetData(); - *toObject = previousWindow->GetOrCreateAccessible(); - return wxACC_OK; - } - else - return wxACC_FALSE; - } - } - - return wxACC_NOT_IMPLEMENTED; -} - -// Gets the name of the specified object. -wxAccStatus wxWindowAccessible::GetName(int childId, wxString* name) -{ - wxASSERT( GetWindow() != NULL ); - if (!GetWindow()) - return wxACC_FAIL; - - wxString title; - - // If a child, leave wxWidgets to call the function on the actual - // child object. - if (childId > 0) - return wxACC_NOT_IMPLEMENTED; - - // This will eventually be replaced by specialised - // accessible classes, one for each kind of wxWidgets - // control or window. -#if wxUSE_BUTTON - if (GetWindow()->IsKindOf(CLASSINFO(wxButton))) - title = ((wxButton*) GetWindow())->GetLabel(); - else -#endif - title = GetWindow()->GetName(); - - if (!title.empty()) - { - *name = title; - return wxACC_OK; - } - else - return wxACC_NOT_IMPLEMENTED; -} - -// Gets the number of children. -wxAccStatus wxWindowAccessible::GetChildCount(int* childId) -{ - wxASSERT( GetWindow() != NULL ); - if (!GetWindow()) - return wxACC_FAIL; - - *childId = (int) GetWindow()->GetChildren().GetCount(); - return wxACC_OK; -} - -// Gets the specified child (starting from 1). -// If *child is NULL and return value is wxACC_OK, -// this means that the child is a simple element and -// not an accessible object. -wxAccStatus wxWindowAccessible::GetChild(int childId, wxAccessible** child) -{ - wxASSERT( GetWindow() != NULL ); - if (!GetWindow()) - return wxACC_FAIL; - - if (childId == 0) - { - *child = this; - return wxACC_OK; - } - - if (childId > (int) GetWindow()->GetChildren().GetCount()) - return wxACC_FAIL; - - wxWindow* childWindow = GetWindow()->GetChildren().Item(childId-1)->GetData(); - *child = childWindow->GetOrCreateAccessible(); - if (*child) - return wxACC_OK; - else - return wxACC_FAIL; -} - -// Gets the parent, or NULL. -wxAccStatus wxWindowAccessible::GetParent(wxAccessible** parent) -{ - wxASSERT( GetWindow() != NULL ); - if (!GetWindow()) - return wxACC_FAIL; - - wxWindow* parentWindow = GetWindow()->GetParent(); - if (!parentWindow) - { - *parent = NULL; - return wxACC_OK; - } - else - { - *parent = parentWindow->GetOrCreateAccessible(); - if (*parent) - return wxACC_OK; - else - return wxACC_FAIL; - } -} - -// Performs the default action. childId is 0 (the action for this object) -// or > 0 (the action for a child). -// Return wxACC_NOT_SUPPORTED if there is no default action for this -// window (e.g. an edit control). -wxAccStatus wxWindowAccessible::DoDefaultAction(int WXUNUSED(childId)) -{ - wxASSERT( GetWindow() != NULL ); - if (!GetWindow()) - return wxACC_FAIL; - - return wxACC_NOT_IMPLEMENTED; -} - -// Gets the default action for this object (0) or > 0 (the action for a child). -// Return wxACC_OK even if there is no action. actionName is the action, or the empty -// string if there is no action. -// The retrieved string describes the action that is performed on an object, -// not what the object does as a result. For example, a toolbar button that prints -// a document has a default action of "Press" rather than "Prints the current document." -wxAccStatus wxWindowAccessible::GetDefaultAction(int WXUNUSED(childId), wxString* WXUNUSED(actionName)) -{ - wxASSERT( GetWindow() != NULL ); - if (!GetWindow()) - return wxACC_FAIL; - - return wxACC_NOT_IMPLEMENTED; -} - -// Returns the description for this object or a child. -wxAccStatus wxWindowAccessible::GetDescription(int WXUNUSED(childId), wxString* description) -{ - wxASSERT( GetWindow() != NULL ); - if (!GetWindow()) - return wxACC_FAIL; - - wxString ht(GetWindow()->GetHelpTextAtPoint(wxDefaultPosition, wxHelpEvent::Origin_Keyboard)); - if (!ht.empty()) - { - *description = ht; - return wxACC_OK; - } - return wxACC_NOT_IMPLEMENTED; -} - -// Returns help text for this object or a child, similar to tooltip text. -wxAccStatus wxWindowAccessible::GetHelpText(int WXUNUSED(childId), wxString* helpText) -{ - wxASSERT( GetWindow() != NULL ); - if (!GetWindow()) - return wxACC_FAIL; - - wxString ht(GetWindow()->GetHelpTextAtPoint(wxDefaultPosition, wxHelpEvent::Origin_Keyboard)); - if (!ht.empty()) - { - *helpText = ht; - return wxACC_OK; - } - return wxACC_NOT_IMPLEMENTED; -} - -// Returns the keyboard shortcut for this object or child. -// Return e.g. ALT+K -wxAccStatus wxWindowAccessible::GetKeyboardShortcut(int WXUNUSED(childId), wxString* WXUNUSED(shortcut)) -{ - wxASSERT( GetWindow() != NULL ); - if (!GetWindow()) - return wxACC_FAIL; - - return wxACC_NOT_IMPLEMENTED; -} - -// Returns a role constant. -wxAccStatus wxWindowAccessible::GetRole(int childId, wxAccRole* role) -{ - wxASSERT( GetWindow() != NULL ); - if (!GetWindow()) - return wxACC_FAIL; - - // If a child, leave wxWidgets to call the function on the actual - // child object. - if (childId > 0) - return wxACC_NOT_IMPLEMENTED; - - if (GetWindow()->IsKindOf(CLASSINFO(wxControl))) - return wxACC_NOT_IMPLEMENTED; -#if wxUSE_STATUSBAR - if (GetWindow()->IsKindOf(CLASSINFO(wxStatusBar))) - return wxACC_NOT_IMPLEMENTED; -#endif -#if wxUSE_TOOLBAR - if (GetWindow()->IsKindOf(CLASSINFO(wxToolBar))) - return wxACC_NOT_IMPLEMENTED; -#endif - - //*role = wxROLE_SYSTEM_CLIENT; - *role = wxROLE_SYSTEM_CLIENT; - return wxACC_OK; - - #if 0 - return wxACC_NOT_IMPLEMENTED; - #endif -} - -// Returns a state constant. -wxAccStatus wxWindowAccessible::GetState(int childId, long* state) -{ - wxASSERT( GetWindow() != NULL ); - if (!GetWindow()) - return wxACC_FAIL; - - // If a child, leave wxWidgets to call the function on the actual - // child object. - if (childId > 0) - return wxACC_NOT_IMPLEMENTED; - - if (GetWindow()->IsKindOf(CLASSINFO(wxControl))) - return wxACC_NOT_IMPLEMENTED; - -#if wxUSE_STATUSBAR - if (GetWindow()->IsKindOf(CLASSINFO(wxStatusBar))) - return wxACC_NOT_IMPLEMENTED; -#endif -#if wxUSE_TOOLBAR - if (GetWindow()->IsKindOf(CLASSINFO(wxToolBar))) - return wxACC_NOT_IMPLEMENTED; -#endif - - *state = 0; - return wxACC_OK; - - #if 0 - return wxACC_NOT_IMPLEMENTED; - #endif -} - -// Returns a localized string representing the value for the object -// or child. -wxAccStatus wxWindowAccessible::GetValue(int WXUNUSED(childId), wxString* WXUNUSED(strValue)) -{ - wxASSERT( GetWindow() != NULL ); - if (!GetWindow()) - return wxACC_FAIL; - - return wxACC_NOT_IMPLEMENTED; -} - -// Selects the object or child. -wxAccStatus wxWindowAccessible::Select(int WXUNUSED(childId), wxAccSelectionFlags WXUNUSED(selectFlags)) -{ - wxASSERT( GetWindow() != NULL ); - if (!GetWindow()) - return wxACC_FAIL; - - return wxACC_NOT_IMPLEMENTED; -} - -// Gets the window with the keyboard focus. -// If childId is 0 and child is NULL, no object in -// this subhierarchy has the focus. -// If this object has the focus, child should be 'this'. -wxAccStatus wxWindowAccessible::GetFocus(int* WXUNUSED(childId), wxAccessible** WXUNUSED(child)) -{ - wxASSERT( GetWindow() != NULL ); - if (!GetWindow()) - return wxACC_FAIL; - - return wxACC_NOT_IMPLEMENTED; -} - -#if wxUSE_VARIANT -// Gets a variant representing the selected children -// of this object. -// Acceptable values: -// - a null variant (IsNull() returns true) -// - a list variant (GetType() == wxT("list") -// - an integer representing the selected child element, -// or 0 if this object is selected (GetType() == wxT("long") -// - a "void*" pointer to a wxAccessible child object -wxAccStatus wxWindowAccessible::GetSelections(wxVariant* WXUNUSED(selections)) -{ - wxASSERT( GetWindow() != NULL ); - if (!GetWindow()) - return wxACC_FAIL; - - return wxACC_NOT_IMPLEMENTED; -} -#endif // wxUSE_VARIANT - -#endif // wxUSE_ACCESSIBILITY - -// ---------------------------------------------------------------------------- -// RTL support -// ---------------------------------------------------------------------------- - -wxCoord -wxWindowBase::AdjustForLayoutDirection(wxCoord x, - wxCoord width, - wxCoord widthTotal) const -{ - if ( GetLayoutDirection() == wxLayout_RightToLeft ) - { - x = widthTotal - x - width; - } - - return x; -} - diff --git a/wxWidgets/src/common/wxchar.cpp b/wxWidgets/src/common/wxchar.cpp deleted file mode 100644 index 068a1a09e8..0000000000 --- a/wxWidgets/src/common/wxchar.cpp +++ /dev/null @@ -1,2293 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/common/wxchar.cpp -// Purpose: wxChar implementation -// Author: Ove Kaven -// Modified by: Ron Lee, Francesco Montorsi -// Created: 09/04/99 -// RCS-ID: $Id: wxchar.cpp 58994 2009-02-18 15:49:09Z FM $ -// Copyright: (c) wxWidgets copyright -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// =========================================================================== -// headers, declarations, constants -// =========================================================================== - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#include "wx/wxchar.h" - -#define _ISOC9X_SOURCE 1 // to get vsscanf() -#define _BSD_SOURCE 1 // to still get strdup() - -#include -#include -#include - -#ifndef __WXWINCE__ - #include - #include -#else - #include "wx/msw/wince/time.h" -#endif - -#ifndef WX_PRECOMP - #include "wx/string.h" - #include "wx/hash.h" - #include "wx/utils.h" // for wxMin and wxMax - #include "wx/log.h" -#endif - -#if defined(__WIN32__) && defined(wxNEED_WX_CTYPE_H) - #include - #include - #include - #include -#endif - -#if defined(__MWERKS__) && __MSL__ >= 0x6000 -namespace std {} -using namespace std ; -#endif - -#if wxUSE_WCHAR_T -size_t WXDLLEXPORT wxMB2WC(wchar_t *buf, const char *psz, size_t n) -{ - // assume that we have mbsrtowcs() too if we have wcsrtombs() -#ifdef HAVE_WCSRTOMBS - mbstate_t mbstate; - memset(&mbstate, 0, sizeof(mbstate_t)); -#endif - - if (buf) { - if (!n || !*psz) { - if (n) *buf = wxT('\0'); - return 0; - } -#ifdef HAVE_WCSRTOMBS - return mbsrtowcs(buf, &psz, n, &mbstate); -#else - return wxMbstowcs(buf, psz, n); -#endif - } - - // note that we rely on common (and required by Unix98 but unfortunately not - // C99) extension which allows to call mbs(r)towcs() with NULL output pointer - // to just get the size of the needed buffer -- this is needed as otherwise - // we have no idea about how much space we need and if the CRT doesn't - // support it (the only currently known example being Metrowerks, see - // wx/wxchar.h) we don't use its mbstowcs() at all -#ifdef HAVE_WCSRTOMBS - return mbsrtowcs((wchar_t *) NULL, &psz, 0, &mbstate); -#else - return wxMbstowcs((wchar_t *) NULL, psz, 0); -#endif -} - -size_t WXDLLEXPORT wxWC2MB(char *buf, const wchar_t *pwz, size_t n) -{ -#ifdef HAVE_WCSRTOMBS - mbstate_t mbstate; - memset(&mbstate, 0, sizeof(mbstate_t)); -#endif - - if (buf) { - if (!n || !*pwz) { - // glibc2.1 chokes on null input - if (n) *buf = '\0'; - return 0; - } -#ifdef HAVE_WCSRTOMBS - return wcsrtombs(buf, &pwz, n, &mbstate); -#else - return wxWcstombs(buf, pwz, n); -#endif - } - -#ifdef HAVE_WCSRTOMBS - return wcsrtombs((char *) NULL, &pwz, 0, &mbstate); -#else - return wxWcstombs((char *) NULL, pwz, 0); -#endif -} -#endif // wxUSE_WCHAR_T - -bool WXDLLEXPORT wxOKlibc() -{ -#if wxUSE_WCHAR_T && defined(__UNIX__) && defined(__GLIBC__) && !defined(__WINE__) - // glibc 2.0 uses UTF-8 even when it shouldn't - wchar_t res = 0; - if ((MB_CUR_MAX == 2) && - (wxMB2WC(&res, "\xdd\xa5", 1) == 1) && - (res==0x765)) { - // this is UTF-8 allright, check whether that's what we want - char *cur_locale = setlocale(LC_CTYPE, NULL); - if ((strlen(cur_locale) < 4) || - (strcasecmp(cur_locale + strlen(cur_locale) - 4, "utf8")) || - (strcasecmp(cur_locale + strlen(cur_locale) - 5, "utf-8"))) { - // nope, don't use libc conversion - return false; - } - } -#endif - return true; -} - -// ============================================================================ -// printf() functions business -// ============================================================================ - -// special test mode: define all functions below even if we don't really need -// them to be able to test them -#ifdef wxTEST_PRINTF - #undef wxFprintf - #undef wxPrintf - #undef wxSprintf - #undef wxVfprintf - #undef wxVsprintf - #undef wxVprintf - #undef wxVsnprintf_ - #undef wxSnprintf_ - - #define wxNEED_WPRINTF - - int wxVfprintf( FILE *stream, const wxChar *format, va_list argptr ); -#endif - -// ---------------------------------------------------------------------------- -// implement [v]snprintf() if the system doesn't provide a safe one -// or if the system's one does not support positional parameters -// (very useful for i18n purposes) -// ---------------------------------------------------------------------------- - -#if !defined(wxVsnprintf_) - -#if !wxUSE_WXVSNPRINTF - #error wxUSE_WXVSNPRINTF must be 1 if our wxVsnprintf_ is used -#endif - -// wxUSE_STRUTILS says our wxVsnprintf_ implementation to use or not to -// use wxStrlen and wxStrncpy functions over one-char processing loops. -// -// Some benchmarking revealed that wxUSE_STRUTILS == 1 has the following -// effects: -// -> on Windows: -// when in ANSI mode, this setting does not change almost anything -// when in Unicode mode, it gives ~ 50% of slowdown ! -// -> on Linux: -// both in ANSI and Unicode mode it gives ~ 60% of speedup ! -// -#if defined(WIN32) && wxUSE_UNICODE -#define wxUSE_STRUTILS 0 -#else -#define wxUSE_STRUTILS 1 -#endif - -// some limits of our implementation -#define wxMAX_SVNPRINTF_ARGUMENTS 64 -#define wxMAX_SVNPRINTF_FLAGBUFFER_LEN 32 -#define wxMAX_SVNPRINTF_SCRATCHBUFFER_LEN 512 - -// prefer snprintf over sprintf -#if defined(__VISUALC__) || \ - (defined(__BORLANDC__) && __BORLANDC__ >= 0x540) - #define system_sprintf(buff, max, flags, data) \ - ::_snprintf(buff, max, flags, data) -#elif defined(HAVE_SNPRINTF) - #define system_sprintf(buff, max, flags, data) \ - ::snprintf(buff, max, flags, data) -#else // NB: at least sprintf() should always be available - // since 'max' is not used in this case, wxVsnprintf() should always - // ensure that 'buff' is big enough for all common needs - // (see wxMAX_SVNPRINTF_FLAGBUFFER_LEN and wxMAX_SVNPRINTF_SCRATCHBUFFER_LEN) - #define system_sprintf(buff, max, flags, data) \ - ::sprintf(buff, flags, data) - - #define SYSTEM_SPRINTF_IS_UNSAFE -#endif - -// the conversion specifiers accepted by wxVsnprintf_ -enum wxPrintfArgType { - wxPAT_INVALID = -1, - - wxPAT_INT, // %d, %i, %o, %u, %x, %X - wxPAT_LONGINT, // %ld, etc -#ifdef wxLongLong_t - wxPAT_LONGLONGINT, // %Ld, etc -#endif - wxPAT_SIZET, // %Zd, etc - - wxPAT_DOUBLE, // %e, %E, %f, %g, %G - wxPAT_LONGDOUBLE, // %le, etc - - wxPAT_POINTER, // %p - - wxPAT_CHAR, // %hc (in ANSI mode: %c, too) - wxPAT_WCHAR, // %lc (in Unicode mode: %c, too) - - wxPAT_PCHAR, // %s (related to a char *) - wxPAT_PWCHAR, // %s (related to a wchar_t *) - - wxPAT_NINT, // %n - wxPAT_NSHORTINT, // %hn - wxPAT_NLONGINT // %ln -}; - -// an argument passed to wxVsnprintf_ -typedef union { - int pad_int; // %d, %i, %o, %u, %x, %X - long int pad_longint; // %ld, etc -#ifdef wxLongLong_t - wxLongLong_t pad_longlongint; // %Ld, etc -#endif - size_t pad_sizet; // %Zd, etc - - double pad_double; // %e, %E, %f, %g, %G - long double pad_longdouble; // %le, etc - - void *pad_pointer; // %p - - char pad_char; // %hc (in ANSI mode: %c, too) - wchar_t pad_wchar; // %lc (in Unicode mode: %c, too) - - char *pad_pchar; // %s (related to a char *) - wchar_t *pad_pwchar; // %s (related to a wchar_t *) - - int *pad_nint; // %n - short int *pad_nshortint; // %hn - long int *pad_nlongint; // %ln -} wxPrintfArg; - - -// Contains parsed data relative to a conversion specifier given to -// wxVsnprintf_ and parsed from the format string -// NOTE: in C++ there is almost no difference between struct & classes thus -// there is no performance gain by using a struct here... -class wxPrintfConvSpec -{ -public: - - // the position of the argument relative to this conversion specifier - size_t m_pos; - - // the type of this conversion specifier - wxPrintfArgType m_type; - - // the minimum and maximum width - // when one of this var is set to -1 it means: use the following argument - // in the stack as minimum/maximum width for this conversion specifier - int m_nMinWidth, m_nMaxWidth; - - // does the argument need to the be aligned to left ? - bool m_bAlignLeft; - - // pointer to the '%' of this conversion specifier in the format string - // NOTE: this points somewhere in the string given to the Parse() function - - // it's task of the caller ensure that memory is still valid ! - const wxChar *m_pArgPos; - - // pointer to the last character of this conversion specifier in the - // format string - // NOTE: this points somewhere in the string given to the Parse() function - - // it's task of the caller ensure that memory is still valid ! - const wxChar *m_pArgEnd; - - // a little buffer where formatting flags like #+\.hlqLZ are stored by Parse() - // for use in Process() - // NB: even if this buffer is used only for numeric conversion specifiers and - // thus could be safely declared as a char[] buffer, we want it to be wxChar - // so that in Unicode builds we can avoid to convert its contents to Unicode - // chars when copying it in user's buffer. - char m_szFlags[wxMAX_SVNPRINTF_FLAGBUFFER_LEN]; - - -public: - - // we don't declare this as a constructor otherwise it would be called - // automatically and we don't want this: to be optimized, wxVsnprintf_ - // calls this function only on really-used instances of this class. - void Init(); - - // Parses the first conversion specifier in the given string, which must - // begin with a '%'. Returns false if the first '%' does not introduce a - // (valid) conversion specifier and thus should be ignored. - bool Parse(const wxChar *format); - - // Process this conversion specifier and puts the result in the given - // buffer. Returns the number of characters written in 'buf' or -1 if - // there's not enough space. - int Process(wxChar *buf, size_t lenMax, wxPrintfArg *p, size_t written); - - // Loads the argument of this conversion specifier from given va_list. - bool LoadArg(wxPrintfArg *p, va_list &argptr); - -private: - // An helper function of LoadArg() which is used to handle the '*' flag - void ReplaceAsteriskWith(int w); -}; - -void wxPrintfConvSpec::Init() -{ - m_nMinWidth = 0; - m_nMaxWidth = 0xFFFF; - m_pos = 0; - m_bAlignLeft = false; - m_pArgPos = m_pArgEnd = NULL; - m_type = wxPAT_INVALID; - - // this character will never be removed from m_szFlags array and - // is important when calling sprintf() in wxPrintfConvSpec::Process() ! - m_szFlags[0] = '%'; -} - -bool wxPrintfConvSpec::Parse(const wxChar *format) -{ - bool done = false; - - // temporary parse data - size_t flagofs = 1; - bool in_prec, // true if we found the dot in some previous iteration - prec_dot; // true if the dot has been already added to m_szFlags - int ilen = 0; - - m_bAlignLeft = in_prec = prec_dot = false; - m_pArgPos = m_pArgEnd = format; - do - { -#define CHECK_PREC \ - if (in_prec && !prec_dot) \ - { \ - m_szFlags[flagofs++] = '.'; \ - prec_dot = true; \ - } - - // what follows '%'? - const wxChar ch = *(++m_pArgEnd); - switch ( ch ) - { - case wxT('\0'): - return false; // not really an argument - - case wxT('%'): - return false; // not really an argument - - case wxT('#'): - case wxT('0'): - case wxT(' '): - case wxT('+'): - case wxT('\''): - CHECK_PREC - m_szFlags[flagofs++] = char(ch); - break; - - case wxT('-'): - CHECK_PREC - m_bAlignLeft = true; - m_szFlags[flagofs++] = char(ch); - break; - - case wxT('.'): - CHECK_PREC - in_prec = true; - prec_dot = false; - m_nMaxWidth = 0; - // dot will be auto-added to m_szFlags if non-negative - // number follows - break; - - case wxT('h'): - ilen = -1; - CHECK_PREC - m_szFlags[flagofs++] = char(ch); - break; - - case wxT('l'): - // NB: it's safe to use flagofs-1 as flagofs always start from 1 - if (m_szFlags[flagofs-1] == 'l') // 'll' modifier is the same as 'L' or 'q' - ilen = 2; - else - ilen = 1; - CHECK_PREC - m_szFlags[flagofs++] = char(ch); - break; - - case wxT('q'): - case wxT('L'): - ilen = 2; - CHECK_PREC - m_szFlags[flagofs++] = char(ch); - break; -#ifdef __WXMSW__ - // under Windows we support the special '%I64' notation as longlong - // integer conversion specifier for MSVC compatibility - // (it behaves exactly as '%lli' or '%Li' or '%qi') - case wxT('I'): - if (*(m_pArgEnd+1) != wxT('6') || - *(m_pArgEnd+2) != wxT('4')) - return false; // bad format - - m_pArgEnd++; - m_pArgEnd++; - - ilen = 2; - CHECK_PREC - m_szFlags[flagofs++] = char(ch); - m_szFlags[flagofs++] = '6'; - m_szFlags[flagofs++] = '4'; - break; -#endif // __WXMSW__ - - case wxT('Z'): - ilen = 3; - CHECK_PREC - m_szFlags[flagofs++] = char(ch); - break; - - case wxT('*'): - if (in_prec) - { - CHECK_PREC - - // tell Process() to use the next argument - // in the stack as maxwidth... - m_nMaxWidth = -1; - } - else - { - // tell Process() to use the next argument - // in the stack as minwidth... - m_nMinWidth = -1; - } - - // save the * in our formatting buffer... - // will be replaced later by Process() - m_szFlags[flagofs++] = char(ch); - break; - - case wxT('1'): case wxT('2'): case wxT('3'): - case wxT('4'): case wxT('5'): case wxT('6'): - case wxT('7'): case wxT('8'): case wxT('9'): - { - int len = 0; - CHECK_PREC - while ( (*m_pArgEnd >= wxT('0')) && - (*m_pArgEnd <= wxT('9')) ) - { - m_szFlags[flagofs++] = char(*m_pArgEnd); - len = len*10 + (*m_pArgEnd - wxT('0')); - m_pArgEnd++; - } - - if (in_prec) - m_nMaxWidth = len; - else - m_nMinWidth = len; - - m_pArgEnd--; // the main loop pre-increments n again - } - break; - - case wxT('$'): // a positional parameter (e.g. %2$s) ? - { - if (m_nMinWidth <= 0) - break; // ignore this formatting flag as no - // numbers are preceding it - - // remove from m_szFlags all digits previously added - do { - flagofs--; - } while (m_szFlags[flagofs] >= '1' && - m_szFlags[flagofs] <= '9'); - - // re-adjust the offset making it point to the - // next free char of m_szFlags - flagofs++; - - m_pos = m_nMinWidth; - m_nMinWidth = 0; - } - break; - - case wxT('d'): - case wxT('i'): - case wxT('o'): - case wxT('u'): - case wxT('x'): - case wxT('X'): - CHECK_PREC - m_szFlags[flagofs++] = char(ch); - m_szFlags[flagofs] = '\0'; - if (ilen == 0) - m_type = wxPAT_INT; - else if (ilen == -1) - // NB: 'short int' value passed through '...' - // is promoted to 'int', so we have to get - // an int from stack even if we need a short - m_type = wxPAT_INT; - else if (ilen == 1) - m_type = wxPAT_LONGINT; - else if (ilen == 2) -#ifdef wxLongLong_t - m_type = wxPAT_LONGLONGINT; -#else // !wxLongLong_t - m_type = wxPAT_LONGINT; -#endif // wxLongLong_t/!wxLongLong_t - else if (ilen == 3) - m_type = wxPAT_SIZET; - done = true; - break; - - case wxT('e'): - case wxT('E'): - case wxT('f'): - case wxT('g'): - case wxT('G'): - CHECK_PREC - m_szFlags[flagofs++] = char(ch); - m_szFlags[flagofs] = '\0'; - if (ilen == 2) - m_type = wxPAT_LONGDOUBLE; - else - m_type = wxPAT_DOUBLE; - done = true; - break; - - case wxT('p'): - m_type = wxPAT_POINTER; - m_szFlags[flagofs++] = char(ch); - m_szFlags[flagofs] = '\0'; - done = true; - break; - - case wxT('c'): - m_szFlags[flagofs++] = char(ch); - m_szFlags[flagofs] = '\0'; - if (ilen == -1) - { - // in Unicode mode %hc == ANSI character - // and in ANSI mode, %hc == %c == ANSI... - m_type = wxPAT_CHAR; - } - else if (ilen == 1) - { - // in ANSI mode %lc == Unicode character - // and in Unicode mode, %lc == %c == Unicode... - m_type = wxPAT_WCHAR; - } - else - { -#if wxUSE_UNICODE - // in Unicode mode, %c == Unicode character - m_type = wxPAT_WCHAR; -#else - // in ANSI mode, %c == ANSI character - m_type = wxPAT_CHAR; -#endif - } - done = true; - break; - - case wxT('s'): - m_szFlags[flagofs++] = char(ch); - m_szFlags[flagofs] = '\0'; - if (ilen == -1) - { - // Unicode mode wx extension: we'll let %hs mean non-Unicode - // strings (when in ANSI mode, %s == %hs == ANSI string) - m_type = wxPAT_PCHAR; - } - else if (ilen == 1) - { - // in Unicode mode, %ls == %s == Unicode string - // in ANSI mode, %ls == Unicode string - m_type = wxPAT_PWCHAR; - } - else - { -#if wxUSE_UNICODE - m_type = wxPAT_PWCHAR; -#else - m_type = wxPAT_PCHAR; -#endif - } - done = true; - break; - - case wxT('n'): - m_szFlags[flagofs++] = char(ch); - m_szFlags[flagofs] = '\0'; - if (ilen == 0) - m_type = wxPAT_NINT; - else if (ilen == -1) - m_type = wxPAT_NSHORTINT; - else if (ilen >= 1) - m_type = wxPAT_NLONGINT; - done = true; - break; - - default: - // bad format, don't consider this an argument; - // leave it unchanged - return false; - } - - if (flagofs == wxMAX_SVNPRINTF_FLAGBUFFER_LEN) - { - wxLogDebug(wxT("Too many flags specified for a single conversion specifier!")); - return false; - } - } - while (!done); - - return true; // parsing was successful -} - - -void wxPrintfConvSpec::ReplaceAsteriskWith(int width) -{ - char temp[wxMAX_SVNPRINTF_FLAGBUFFER_LEN]; - - // find the first * in our flag buffer - char *pwidth = strchr(m_szFlags, '*'); - wxCHECK_RET(pwidth, _T("field width must be specified")); - - // save what follows the * (the +1 is to skip the asterisk itself!) - strcpy(temp, pwidth+1); - if (width < 0) - { - pwidth[0] = wxT('-'); - pwidth++; - } - - // replace * with the actual integer given as width -#ifndef SYSTEM_SPRINTF_IS_UNSAFE - int maxlen = (m_szFlags + wxMAX_SVNPRINTF_FLAGBUFFER_LEN - pwidth) / - sizeof(*m_szFlags); -#endif - int offset = system_sprintf(pwidth, maxlen, "%d", abs(width)); - - // restore after the expanded * what was following it - strcpy(pwidth+offset, temp); -} - -bool wxPrintfConvSpec::LoadArg(wxPrintfArg *p, va_list &argptr) -{ - // was the '*' width/precision specifier used ? - if (m_nMaxWidth == -1) - { - // take the maxwidth specifier from the stack - m_nMaxWidth = va_arg(argptr, int); - if (m_nMaxWidth < 0) - m_nMaxWidth = 0; - else - ReplaceAsteriskWith(m_nMaxWidth); - } - - if (m_nMinWidth == -1) - { - // take the minwidth specifier from the stack - m_nMinWidth = va_arg(argptr, int); - - ReplaceAsteriskWith(m_nMinWidth); - if (m_nMinWidth < 0) - { - m_bAlignLeft = !m_bAlignLeft; - m_nMinWidth = -m_nMinWidth; - } - } - - switch (m_type) { - case wxPAT_INT: - p->pad_int = va_arg(argptr, int); - break; - case wxPAT_LONGINT: - p->pad_longint = va_arg(argptr, long int); - break; -#ifdef wxLongLong_t - case wxPAT_LONGLONGINT: - p->pad_longlongint = va_arg(argptr, wxLongLong_t); - break; -#endif // wxLongLong_t - case wxPAT_SIZET: - p->pad_sizet = va_arg(argptr, size_t); - break; - case wxPAT_DOUBLE: - p->pad_double = va_arg(argptr, double); - break; - case wxPAT_LONGDOUBLE: - p->pad_longdouble = va_arg(argptr, long double); - break; - case wxPAT_POINTER: - p->pad_pointer = va_arg(argptr, void *); - break; - - case wxPAT_CHAR: - p->pad_char = (char)va_arg(argptr, int); // char is promoted to int when passed through '...' - break; - case wxPAT_WCHAR: - p->pad_wchar = (wchar_t)va_arg(argptr, int); // char is promoted to int when passed through '...' - break; - - case wxPAT_PCHAR: - p->pad_pchar = va_arg(argptr, char *); - break; - case wxPAT_PWCHAR: - p->pad_pwchar = va_arg(argptr, wchar_t *); - break; - - case wxPAT_NINT: - p->pad_nint = va_arg(argptr, int *); - break; - case wxPAT_NSHORTINT: - p->pad_nshortint = va_arg(argptr, short int *); - break; - case wxPAT_NLONGINT: - p->pad_nlongint = va_arg(argptr, long int *); - break; - - case wxPAT_INVALID: - default: - return false; - } - - return true; // loading was successful -} - -int wxPrintfConvSpec::Process(wxChar *buf, size_t lenMax, wxPrintfArg *p, size_t written) -{ - // buffer to avoid dynamic memory allocation each time for small strings; - // note that this buffer is used only to hold results of number formatting, - // %s directly writes user's string in buf, without using szScratch - char szScratch[wxMAX_SVNPRINTF_SCRATCHBUFFER_LEN]; - size_t lenScratch = 0, lenCur = 0; - -#define APPEND_CH(ch) \ - { \ - if ( lenCur == lenMax ) \ - return -1; \ - \ - buf[lenCur++] = ch; \ - } - -#define APPEND_STR(s) \ - { \ - for ( const wxChar *p = s; *p; p++ ) \ - { \ - APPEND_CH(*p); \ - } \ - } - - switch ( m_type ) - { - case wxPAT_INT: - lenScratch = system_sprintf(szScratch, wxMAX_SVNPRINTF_SCRATCHBUFFER_LEN, m_szFlags, p->pad_int); - break; - - case wxPAT_LONGINT: - lenScratch = system_sprintf(szScratch, wxMAX_SVNPRINTF_SCRATCHBUFFER_LEN, m_szFlags, p->pad_longint); - break; - -#ifdef wxLongLong_t - case wxPAT_LONGLONGINT: - lenScratch = system_sprintf(szScratch, wxMAX_SVNPRINTF_SCRATCHBUFFER_LEN, m_szFlags, p->pad_longlongint); - break; -#endif // SIZEOF_LONG_LONG - - case wxPAT_SIZET: - lenScratch = system_sprintf(szScratch, wxMAX_SVNPRINTF_SCRATCHBUFFER_LEN, m_szFlags, p->pad_sizet); - break; - - case wxPAT_LONGDOUBLE: - lenScratch = system_sprintf(szScratch, wxMAX_SVNPRINTF_SCRATCHBUFFER_LEN, m_szFlags, p->pad_longdouble); - break; - - case wxPAT_DOUBLE: - lenScratch = system_sprintf(szScratch, wxMAX_SVNPRINTF_SCRATCHBUFFER_LEN, m_szFlags, p->pad_double); - break; - - case wxPAT_POINTER: - lenScratch = system_sprintf(szScratch, wxMAX_SVNPRINTF_SCRATCHBUFFER_LEN, m_szFlags, p->pad_pointer); - break; - - case wxPAT_CHAR: - case wxPAT_WCHAR: - { - wxChar val = -#if wxUSE_UNICODE - p->pad_wchar; - - if (m_type == wxPAT_CHAR) - { - // user passed a character explicitely indicated as ANSI... - const char buf[2] = { p->pad_char, 0 }; - val = wxString(buf, wxConvLibc)[0u]; - - //wprintf(L"converting ANSI=>Unicode"); // for debug - } -#else - p->pad_char; - -#if wxUSE_WCHAR_T - if (m_type == wxPAT_WCHAR) - { - // user passed a character explicitely indicated as Unicode... - const wchar_t buf[2] = { p->pad_wchar, 0 }; - val = wxString(buf, wxConvLibc)[0u]; - - //printf("converting Unicode=>ANSI"); // for debug - } -#endif -#endif - - size_t i; - - if (!m_bAlignLeft) - for (i = 1; i < (size_t)m_nMinWidth; i++) - APPEND_CH(_T(' ')); - - APPEND_CH(val); - - if (m_bAlignLeft) - for (i = 1; i < (size_t)m_nMinWidth; i++) - APPEND_CH(_T(' ')); - } - break; - - case wxPAT_PCHAR: - case wxPAT_PWCHAR: - { - wxString s; - const wxChar *val = -#if wxUSE_UNICODE - p->pad_pwchar; - - if (m_type == wxPAT_PCHAR) - { - // user passed a string explicitely indicated as ANSI... - val = s = wxString(p->pad_pchar, wxConvLibc); - - //wprintf(L"converting ANSI=>Unicode"); // for debug - } -#else - p->pad_pchar; - -#if wxUSE_WCHAR_T - if (m_type == wxPAT_PWCHAR) - { - // user passed a string explicitely indicated as Unicode... - val = s = wxString(p->pad_pwchar, wxConvLibc); - - //printf("converting Unicode=>ANSI"); // for debug - } -#endif -#endif - int len; - - if (val) - { -#if wxUSE_STRUTILS - // at this point we are sure that m_nMaxWidth is positive or null - // (see top of wxPrintfConvSpec::LoadArg) - len = wxMin((unsigned int)m_nMaxWidth, wxStrlen(val)); -#else - for ( len = 0; val[len] && (len < m_nMaxWidth); len++ ) - ; -#endif - } - else if (m_nMaxWidth >= 6) - { - val = wxT("(null)"); - len = 6; - } - else - { - val = wxEmptyString; - len = 0; - } - - int i; - - if (!m_bAlignLeft) - { - for (i = len; i < m_nMinWidth; i++) - APPEND_CH(_T(' ')); - } - -#if wxUSE_STRUTILS - len = wxMin((unsigned int)len, lenMax-lenCur); - wxStrncpy(buf+lenCur, val, len); - lenCur += len; -#else - for (i = 0; i < len; i++) - APPEND_CH(val[i]); -#endif - - if (m_bAlignLeft) - { - for (i = len; i < m_nMinWidth; i++) - APPEND_CH(_T(' ')); - } - } - break; - - case wxPAT_NINT: - *p->pad_nint = written; - break; - - case wxPAT_NSHORTINT: - *p->pad_nshortint = (short int)written; - break; - - case wxPAT_NLONGINT: - *p->pad_nlongint = written; - break; - - case wxPAT_INVALID: - default: - return -1; - } - - // if we used system's sprintf() then we now need to append the s_szScratch - // buffer to the given one... - switch (m_type) - { - case wxPAT_INT: - case wxPAT_LONGINT: -#ifdef wxLongLong_t - case wxPAT_LONGLONGINT: -#endif - case wxPAT_SIZET: - case wxPAT_LONGDOUBLE: - case wxPAT_DOUBLE: - case wxPAT_POINTER: - wxASSERT(lenScratch < wxMAX_SVNPRINTF_SCRATCHBUFFER_LEN); -#if !wxUSE_UNICODE - { - if (lenMax < lenScratch) - { - // fill output buffer and then return -1 - wxStrncpy(buf, szScratch, lenMax); - return -1; - } - wxStrncpy(buf, szScratch, lenScratch); - lenCur += lenScratch; - } -#else - { - // Copy the char scratch to the wide output. This requires - // conversion, but we can optimise by making use of the fact - // that we are formatting numbers, this should mean only 7-bit - // ascii characters are involved. - wxChar *bufptr = buf; - const wxChar *bufend = buf + lenMax; - const char *scratchptr = szScratch; - - // Simply copy each char to a wxChar, stopping on the first - // null or non-ascii byte. Checking '(signed char)*scratchptr - // > 0' is an extra optimisation over '*scratchptr != 0 && - // isascii(*scratchptr)', though it assumes signed char is - // 8-bit 2 complement. - while ((signed char)*scratchptr > 0 && bufptr != bufend) - *bufptr++ = *scratchptr++; - - if (bufptr == bufend) - return -1; - - lenCur += bufptr - buf; - - // check if the loop stopped on a non-ascii char, if yes then - // fall back to wxMB2WX - if (*scratchptr) - { - size_t len = wxMB2WX(bufptr, scratchptr, bufend - bufptr); - - if (len && len != (size_t)(-1)) - if (bufptr[len - 1]) - return -1; - else - lenCur += len; - } - } -#endif - break; - - default: - break; // all other cases were completed previously - } - - return lenCur; -} - -// Copy chars from source to dest converting '%%' to '%'. Takes at most maxIn -// chars from source and write at most outMax chars to dest, returns the -// number of chars actually written. Does not treat null specially. -// -static int wxCopyStrWithPercents( - size_t maxOut, - wxChar *dest, - size_t maxIn, - const wxChar *source) -{ - size_t written = 0; - - if (maxIn == 0) - return 0; - - size_t i; - for ( i = 0; i < maxIn-1 && written < maxOut; source++, i++) - { - dest[written++] = *source; - if (*(source+1) == wxT('%')) - { - // skip this additional '%' character - source++; - i++; - } - } - - if (i < maxIn && written < maxOut) - // copy last character inconditionally - dest[written++] = *source; - - return written; -} - -int WXDLLEXPORT wxVsnprintf_(wxChar *buf, size_t lenMax, - const wxChar *format, va_list argptr) -{ - // useful for debugging, to understand if we are really using this function - // rather than the system implementation -#if 0 - wprintf(L"Using wxVsnprintf_\n"); -#endif - - // required memory: - wxPrintfConvSpec arg[wxMAX_SVNPRINTF_ARGUMENTS]; - wxPrintfArg argdata[wxMAX_SVNPRINTF_ARGUMENTS]; - wxPrintfConvSpec *pspec[wxMAX_SVNPRINTF_ARGUMENTS] = { NULL }; - - size_t i; - - // number of characters in the buffer so far, must be less than lenMax - size_t lenCur = 0; - - size_t nargs = 0; - const wxChar *toparse = format; - - // parse the format string - bool posarg_present = false, nonposarg_present = false; - for (; *toparse != wxT('\0'); toparse++) - { - if (*toparse == wxT('%') ) - { - arg[nargs].Init(); - - // let's see if this is a (valid) conversion specifier... - if (arg[nargs].Parse(toparse)) - { - // ...yes it is - wxPrintfConvSpec *current = &arg[nargs]; - - // make toparse point to the end of this specifier - toparse = current->m_pArgEnd; - - if (current->m_pos > 0) - { - // the positionals start from number 1... adjust the index - current->m_pos--; - posarg_present = true; - } - else - { - // not a positional argument... - current->m_pos = nargs; - nonposarg_present = true; - } - - // this conversion specifier is tied to the pos-th argument... - pspec[current->m_pos] = current; - nargs++; - - if (nargs == wxMAX_SVNPRINTF_ARGUMENTS) - { - wxLogDebug(wxT("A single call to wxVsnprintf() has more than %d arguments; ") - wxT("ignoring all remaining arguments."), wxMAX_SVNPRINTF_ARGUMENTS); - break; // cannot handle any additional conv spec - } - } - else - { - // it's safe to look in the next character of toparse as at worst - // we'll hit its \0 - if (*(toparse+1) == wxT('%')) - toparse++; // the Parse() returned false because we've found a %% - } - } - } - - if (posarg_present && nonposarg_present) - { - buf[0] = 0; - return -1; // format strings with both positional and - } // non-positional conversion specifier are unsupported !! - - // on platforms where va_list is an array type, it is necessary to make a - // copy to be able to pass it to LoadArg as a reference. - bool ok = true; - va_list ap; - wxVaCopy(ap, argptr); - - // now load arguments from stack - for (i=0; i < nargs && ok; i++) - { - // !pspec[i] means that the user forgot a positional parameter (e.g. %$1s %$3s); - // LoadArg == false means that wxPrintfConvSpec::Parse failed to set the - // conversion specifier 'type' to a valid value... - ok = pspec[i] && pspec[i]->LoadArg(&argdata[i], ap); - } - - va_end(ap); - - // something failed while loading arguments from the variable list... - // (e.g. the user repeated twice the same positional argument) - if (!ok) - { - buf[0] = 0; - return -1; - } - - // finally, process each conversion specifier with its own argument - toparse = format; - for (i=0; i < nargs; i++) - { - // copy in the output buffer the portion of the format string between - // last specifier and the current one - size_t tocopy = ( arg[i].m_pArgPos - toparse ); - - lenCur += wxCopyStrWithPercents(lenMax - lenCur, buf + lenCur, - tocopy, toparse); - if (lenCur == lenMax) - { - buf[lenMax - 1] = 0; - return lenMax+1; // not enough space in the output buffer ! - } - - // process this specifier directly in the output buffer - int n = arg[i].Process(buf+lenCur, lenMax - lenCur, &argdata[arg[i].m_pos], lenCur); - if (n == -1) - { - buf[lenMax-1] = wxT('\0'); // be sure to always NUL-terminate the string - return lenMax+1; // not enough space in the output buffer ! - } - lenCur += n; - - // the +1 is because wxPrintfConvSpec::m_pArgEnd points to the last character - // of the format specifier, but we are not interested to it... - toparse = arg[i].m_pArgEnd + 1; - } - - // copy portion of the format string after last specifier - // NOTE: toparse is pointing to the character just after the last processed - // conversion specifier - // NOTE2: the +1 is because we want to copy also the '\0' - size_t tocopy = wxStrlen(format) + 1 - ( toparse - format ) ; - - lenCur += wxCopyStrWithPercents(lenMax - lenCur, buf + lenCur, - tocopy, toparse) - 1; - if (buf[lenCur]) - { - buf[lenCur] = 0; - return lenMax+1; // not enough space in the output buffer ! - } - - // Don't do: - // wxASSERT(lenCur == wxStrlen(buf)); - // in fact if we embedded NULLs in the output buffer (using %c with a '\0') - // such check would fail - - return lenCur; -} - -#undef APPEND_CH -#undef APPEND_STR -#undef CHECK_PREC - -#else // wxVsnprintf_ is defined - -#if wxUSE_WXVSNPRINTF - #error wxUSE_WXVSNPRINTF must be 0 if our wxVsnprintf_ is not used -#endif - -#endif // !wxVsnprintf_ - -#if !defined(wxSnprintf_) -int WXDLLEXPORT wxSnprintf_(wxChar *buf, size_t len, const wxChar *format, ...) -{ - va_list argptr; - va_start(argptr, format); - - int iLen = wxVsnprintf_(buf, len, format, argptr); - - va_end(argptr); - - return iLen; -} -#endif // wxSnprintf_ - -#if defined(__DMC__) - /* Digital Mars adds count to _stprintf (C99) so convert */ - #if wxUSE_UNICODE - int wxSprintf (wchar_t * __RESTRICT s, const wchar_t * __RESTRICT format, ... ) - { - va_list arglist; - - va_start( arglist, format ); - int iLen = swprintf ( s, -1, format, arglist ); - va_end( arglist ); - return iLen ; - } - - #endif // wxUSE_UNICODE - -#endif //__DMC__ - -#if defined(__MINGW32__) && ( defined(_STLPORT_VERSION) && _STLPORT_VERSION >= 0x510 ) - /* MinGW with STLPort 5.1 has clashing defines for _stprintf so use swprintf */ - /* STLPort 5.1 defines standard (C99) vswprintf() and swprintf() that takes count. */ - int wxSprintf (wchar_t * s, const wchar_t * format, ... ) - { - va_list arglist; - - va_start( arglist, format ); - int iLen = swprintf ( s, -1, format, arglist ); - va_end( arglist ); - return iLen ; - } -#endif // MINGW32 _STLPORT_VERSION >= 0x510 - -// ---------------------------------------------------------------------------- -// implement the standard IO functions for wide char if libc doesn't have them -// ---------------------------------------------------------------------------- - -#ifdef wxNEED_FPUTS -int wxFputs(const wchar_t *ws, FILE *stream) -{ - wxCharBuffer buf(wxConvLibc.cWC2MB(ws)); - if ( !buf ) - return -1; - - // counting the number of wide characters written isn't worth the trouble, - // simply distinguish between ok and error - return fputs(buf, stream) == -1 ? -1 : 0; -} -#endif // wxNEED_FPUTS - -#ifdef wxNEED_PUTS -int wxPuts(const wxChar *ws) -{ - int rc = wxFputs(ws, stdout); - if ( rc != -1 ) - { - if ( wxFputs(L"\n", stdout) == -1 ) - return -1; - - rc++; - } - - return rc; -} -#endif // wxNEED_PUTS - -#ifdef wxNEED_PUTC -int /* not wint_t */ wxPutc(wchar_t wc, FILE *stream) -{ - wchar_t ws[2] = { wc, L'\0' }; - - return wxFputs(ws, stream); -} -#endif // wxNEED_PUTC - -// NB: we only implement va_list functions here, the ones taking ... are -// defined below for wxNEED_PRINTF_CONVERSION case anyhow and we reuse -// the definitions there to avoid duplicating them here -#ifdef wxNEED_WPRINTF - -// TODO: implement the scanf() functions -int vwscanf(const wxChar *format, va_list argptr) -{ - wxFAIL_MSG( _T("TODO") ); - - return -1; -} - -int vswscanf(const wxChar *ws, const wxChar *format, va_list argptr) -{ - // The best we can do without proper Unicode support in glibc is to - // convert the strings into MB representation and run ANSI version - // of the function. This doesn't work with %c and %s because of difference - // in size of char and wchar_t, though. - - wxCHECK_MSG( wxStrstr(format, _T("%s")) == NULL, -1, - _T("incomplete vswscanf implementation doesn't allow %s") ); - wxCHECK_MSG( wxStrstr(format, _T("%c")) == NULL, -1, - _T("incomplete vswscanf implementation doesn't allow %c") ); - - va_list argcopy; - wxVaCopy(argcopy, argptr); - return vsscanf(wxConvLibc.cWX2MB(ws), wxConvLibc.cWX2MB(format), argcopy); -} - -int vfwscanf(FILE *stream, const wxChar *format, va_list argptr) -{ - wxFAIL_MSG( _T("TODO") ); - - return -1; -} - -#define vswprintf wxVsnprintf_ - -int vfwprintf(FILE *stream, const wxChar *format, va_list argptr) -{ - wxString s; - int rc = s.PrintfV(format, argptr); - - if ( rc != -1 ) - { - // we can't do much better without Unicode support in libc... - if ( fprintf(stream, "%s", (const char*)s.mb_str() ) == -1 ) - return -1; - } - - return rc; -} - -int vwprintf(const wxChar *format, va_list argptr) -{ - return wxVfprintf(stdout, format, argptr); -} - -#endif // wxNEED_WPRINTF - -#ifdef wxNEED_PRINTF_CONVERSION - -// ---------------------------------------------------------------------------- -// wxFormatConverter: class doing the "%s" -> "%ls" conversion -// ---------------------------------------------------------------------------- - -/* - Here are the gory details. We want to follow the Windows/MS conventions, - that is to have - - In ANSI mode: - - format specifier results in - ----------------------------------- - %c, %hc, %hC char - %lc, %C, %lC wchar_t - - In Unicode mode: - - format specifier results in - ----------------------------------- - %hc, %C, %hC char - %c, %lc, %lC wchar_t - - - while on POSIX systems we have %C identical to %lc and %c always means char - (in any mode) while %lc always means wchar_t, - - So to use native functions in order to get our semantics we must do the - following translations in Unicode mode (nothing to do in ANSI mode): - - wxWidgets specifier POSIX specifier - ---------------------------------------- - - %hc, %C, %hC %c - %c %lc - - - And, of course, the same should be done for %s as well. -*/ - -class wxFormatConverter -{ -public: - wxFormatConverter(const wxChar *format); - - // notice that we only translated the string if m_fmtOrig == NULL (as set - // by CopyAllBefore()), otherwise we should simply use the original format - operator const wxChar *() const - { return m_fmtOrig ? m_fmtOrig : m_fmt.c_str(); } - -private: - // copy another character to the translated format: this function does the - // copy if we are translating but doesn't do anything at all if we don't, - // so we don't create the translated format string at all unless we really - // need to (i.e. InsertFmtChar() is called) - wxChar CopyFmtChar(wxChar ch) - { - if ( !m_fmtOrig ) - { - // we're translating, do copy - m_fmt += ch; - } - else - { - // simply increase the count which should be copied by - // CopyAllBefore() later if needed - m_nCopied++; - } - - return ch; - } - - // insert an extra character - void InsertFmtChar(wxChar ch) - { - if ( m_fmtOrig ) - { - // so far we haven't translated anything yet - CopyAllBefore(); - } - - m_fmt += ch; - } - - void CopyAllBefore() - { - wxASSERT_MSG( m_fmtOrig && m_fmt.empty(), _T("logic error") ); - - m_fmt = wxString(m_fmtOrig, m_nCopied); - - // we won't need it any longer - m_fmtOrig = NULL; - } - - static bool IsFlagChar(wxChar ch) - { - return ch == _T('-') || ch == _T('+') || - ch == _T('0') || ch == _T(' ') || ch == _T('#'); - } - - void SkipDigits(const wxChar **ptpc) - { - while ( **ptpc >= _T('0') && **ptpc <= _T('9') ) - CopyFmtChar(*(*ptpc)++); - } - - // the translated format - wxString m_fmt; - - // the original format - const wxChar *m_fmtOrig; - - // the number of characters already copied - size_t m_nCopied; -}; - -wxFormatConverter::wxFormatConverter(const wxChar *format) -{ - m_fmtOrig = format; - m_nCopied = 0; - - while ( *format ) - { - if ( CopyFmtChar(*format++) == _T('%') ) - { - // skip any flags - while ( IsFlagChar(*format) ) - CopyFmtChar(*format++); - - // and possible width - if ( *format == _T('*') ) - CopyFmtChar(*format++); - else - SkipDigits(&format); - - // precision? - if ( *format == _T('.') ) - { - CopyFmtChar(*format++); - if ( *format == _T('*') ) - CopyFmtChar(*format++); - else - SkipDigits(&format); - } - - // next we can have a size modifier - enum - { - Default, - Short, - Long - } size; - - switch ( *format ) - { - case _T('h'): - size = Short; - format++; - break; - - case _T('l'): - // "ll" has a different meaning! - if ( format[1] != _T('l') ) - { - size = Long; - format++; - break; - } - //else: fall through - - default: - size = Default; - } - - // and finally we should have the type - switch ( *format ) - { - case _T('C'): - case _T('S'): - // %C and %hC -> %c and %lC -> %lc - if ( size == Long ) - CopyFmtChar(_T('l')); - - InsertFmtChar(*format++ == _T('C') ? _T('c') : _T('s')); - break; - - case _T('c'): - case _T('s'): - // %c -> %lc but %hc stays %hc and %lc is still %lc - if ( size == Default) - InsertFmtChar(_T('l')); - // fall through - - default: - // nothing special to do - if ( size != Default ) - CopyFmtChar(*(format - 1)); - CopyFmtChar(*format++); - } - } - } -} - -#else // !wxNEED_PRINTF_CONVERSION - // no conversion necessary - #define wxFormatConverter(x) (x) -#endif // wxNEED_PRINTF_CONVERSION/!wxNEED_PRINTF_CONVERSION - -#ifdef __WXDEBUG__ -// For testing the format converter -wxString wxConvertFormat(const wxChar *format) -{ - return wxString(wxFormatConverter(format)); -} -#endif - -// ---------------------------------------------------------------------------- -// wxPrintf(), wxScanf() and relatives -// ---------------------------------------------------------------------------- - -#if defined(wxNEED_PRINTF_CONVERSION) || defined(wxNEED_WPRINTF) - -int wxScanf( const wxChar *format, ... ) -{ - va_list argptr; - va_start(argptr, format); - - int ret = vwscanf(wxFormatConverter(format), argptr ); - - va_end(argptr); - - return ret; -} - -int wxSscanf( const wxChar *str, const wxChar *format, ... ) -{ - va_list argptr; - va_start(argptr, format); - - int ret = vswscanf( str, wxFormatConverter(format), argptr ); - - va_end(argptr); - - return ret; -} - -int wxFscanf( FILE *stream, const wxChar *format, ... ) -{ - va_list argptr; - va_start(argptr, format); - int ret = vfwscanf(stream, wxFormatConverter(format), argptr); - - va_end(argptr); - - return ret; -} - -int wxPrintf( const wxChar *format, ... ) -{ - va_list argptr; - va_start(argptr, format); - - int ret = vwprintf( wxFormatConverter(format), argptr ); - - va_end(argptr); - - return ret; -} - -#ifndef wxSnprintf -int wxSnprintf( wxChar *str, size_t size, const wxChar *format, ... ) -{ - va_list argptr; - va_start(argptr, format); - - int ret = vswprintf( str, size, wxFormatConverter(format), argptr ); - - // VsnprintfTestCase reveals that glibc's implementation of vswprintf - // doesn't nul terminate on truncation. - str[size - 1] = 0; - - va_end(argptr); - - return ret; -} -#endif // wxSnprintf - -int wxSprintf( wxChar *str, const wxChar *format, ... ) -{ - va_list argptr; - va_start(argptr, format); - - // note that wxString::FormatV() uses wxVsnprintf(), not wxSprintf(), so - // it's safe to implement this one in terms of it - wxString s(wxString::FormatV(format, argptr)); - wxStrcpy(str, s); - - va_end(argptr); - - return s.length(); -} - -int wxFprintf( FILE *stream, const wxChar *format, ... ) -{ - va_list argptr; - va_start( argptr, format ); - - int ret = vfwprintf( stream, wxFormatConverter(format), argptr ); - - va_end(argptr); - - return ret; -} - -int wxVsscanf( const wxChar *str, const wxChar *format, va_list argptr ) -{ - return vswscanf( str, wxFormatConverter(format), argptr ); -} - -int wxVfprintf( FILE *stream, const wxChar *format, va_list argptr ) -{ - return vfwprintf( stream, wxFormatConverter(format), argptr ); -} - -int wxVprintf( const wxChar *format, va_list argptr ) -{ - return vwprintf( wxFormatConverter(format), argptr ); -} - -#ifndef wxVsnprintf -int wxVsnprintf( wxChar *str, size_t size, const wxChar *format, va_list argptr ) -{ - return vswprintf( str, size, wxFormatConverter(format), argptr ); -} -#endif // wxVsnprintf - -int wxVsprintf( wxChar *str, const wxChar *format, va_list argptr ) -{ - // same as for wxSprintf() - return vswprintf(str, INT_MAX / 4, wxFormatConverter(format), argptr); -} - -#endif // wxNEED_PRINTF_CONVERSION - -#if wxUSE_WCHAR_T - -// ---------------------------------------------------------------------------- -// ctype.h stuff (currently unused) -// ---------------------------------------------------------------------------- - -#if defined(__WIN32__) && defined(wxNEED_WX_CTYPE_H) -inline WORD wxMSW_ctype(wxChar ch) -{ - WORD ret; - GetStringTypeEx(LOCALE_USER_DEFAULT, CT_CTYPE1, &ch, 1, &ret); - return ret; -} - -WXDLLEXPORT int wxIsalnum(wxChar ch) { return IsCharAlphaNumeric(ch); } -WXDLLEXPORT int wxIsalpha(wxChar ch) { return IsCharAlpha(ch); } -WXDLLEXPORT int wxIscntrl(wxChar ch) { return wxMSW_ctype(ch) & C1_CNTRL; } -WXDLLEXPORT int wxIsdigit(wxChar ch) { return wxMSW_ctype(ch) & C1_DIGIT; } -WXDLLEXPORT int wxIsgraph(wxChar ch) { return wxMSW_ctype(ch) & (C1_DIGIT|C1_PUNCT|C1_ALPHA); } -WXDLLEXPORT int wxIslower(wxChar ch) { return IsCharLower(ch); } -WXDLLEXPORT int wxIsprint(wxChar ch) { return wxMSW_ctype(ch) & (C1_DIGIT|C1_SPACE|C1_PUNCT|C1_ALPHA); } -WXDLLEXPORT int wxIspunct(wxChar ch) { return wxMSW_ctype(ch) & C1_PUNCT; } -WXDLLEXPORT int wxIsspace(wxChar ch) { return wxMSW_ctype(ch) & C1_SPACE; } -WXDLLEXPORT int wxIsupper(wxChar ch) { return IsCharUpper(ch); } -WXDLLEXPORT int wxIsxdigit(wxChar ch) { return wxMSW_ctype(ch) & C1_XDIGIT; } -WXDLLEXPORT int wxTolower(wxChar ch) { return (wxChar)CharLower((LPTSTR)(ch)); } -WXDLLEXPORT int wxToupper(wxChar ch) { return (wxChar)CharUpper((LPTSTR)(ch)); } -#endif - -#ifdef wxNEED_WX_MBSTOWCS - -WXDLLEXPORT size_t wxMbstowcs (wchar_t * out, const char * in, size_t outlen) -{ - if (!out) - { - size_t outsize = 0; - while(*in++) - outsize++; - return outsize; - } - - const char* origin = in; - - while (outlen-- && *in) - { - *out++ = (wchar_t) *in++; - } - - *out = '\0'; - - return in - origin; -} - -WXDLLEXPORT size_t wxWcstombs (char * out, const wchar_t * in, size_t outlen) -{ - if (!out) - { - size_t outsize = 0; - while(*in++) - outsize++; - return outsize; - } - - const wchar_t* origin = in; - - while (outlen-- && *in) - { - *out++ = (char) *in++; - } - - *out = '\0'; - - return in - origin; -} - -#endif // wxNEED_WX_MBSTOWCS - -#if defined(wxNEED_WX_CTYPE_H) - -#include - -#define cfalnumset CFCharacterSetGetPredefined(kCFCharacterSetAlphaNumeric) -#define cfalphaset CFCharacterSetGetPredefined(kCFCharacterSetLetter) -#define cfcntrlset CFCharacterSetGetPredefined(kCFCharacterSetControl) -#define cfdigitset CFCharacterSetGetPredefined(kCFCharacterSetDecimalDigit) -//CFCharacterSetRef cfgraphset = kCFCharacterSetControl && !' ' -#define cflowerset CFCharacterSetGetPredefined(kCFCharacterSetLowercaseLetter) -//CFCharacterSetRef cfprintset = !kCFCharacterSetControl -#define cfpunctset CFCharacterSetGetPredefined(kCFCharacterSetPunctuation) -#define cfspaceset CFCharacterSetGetPredefined(kCFCharacterSetWhitespaceAndNewline) -#define cfupperset CFCharacterSetGetPredefined(kCFCharacterSetUppercaseLetter) - -WXDLLEXPORT int wxIsalnum(wxChar ch) { return CFCharacterSetIsCharacterMember(cfalnumset, ch); } -WXDLLEXPORT int wxIsalpha(wxChar ch) { return CFCharacterSetIsCharacterMember(cfalphaset, ch); } -WXDLLEXPORT int wxIscntrl(wxChar ch) { return CFCharacterSetIsCharacterMember(cfcntrlset, ch); } -WXDLLEXPORT int wxIsdigit(wxChar ch) { return CFCharacterSetIsCharacterMember(cfdigitset, ch); } -WXDLLEXPORT int wxIsgraph(wxChar ch) { return !CFCharacterSetIsCharacterMember(cfcntrlset, ch) && ch != ' '; } -WXDLLEXPORT int wxIslower(wxChar ch) { return CFCharacterSetIsCharacterMember(cflowerset, ch); } -WXDLLEXPORT int wxIsprint(wxChar ch) { return !CFCharacterSetIsCharacterMember(cfcntrlset, ch); } -WXDLLEXPORT int wxIspunct(wxChar ch) { return CFCharacterSetIsCharacterMember(cfpunctset, ch); } -WXDLLEXPORT int wxIsspace(wxChar ch) { return CFCharacterSetIsCharacterMember(cfspaceset, ch); } -WXDLLEXPORT int wxIsupper(wxChar ch) { return CFCharacterSetIsCharacterMember(cfupperset, ch); } -WXDLLEXPORT int wxIsxdigit(wxChar ch) { return wxIsdigit(ch) || (ch>='a' && ch<='f') || (ch>='A' && ch<='F'); } -WXDLLEXPORT int wxTolower(wxChar ch) { return (wxChar)tolower((char)(ch)); } -WXDLLEXPORT int wxToupper(wxChar ch) { return (wxChar)toupper((char)(ch)); } - -#endif // wxNEED_WX_CTYPE_H - -#ifndef wxStrdupA - -WXDLLEXPORT char *wxStrdupA(const char *s) -{ - return strcpy((char *)malloc(strlen(s) + 1), s); -} - -#endif // wxStrdupA - -#ifndef wxStrdupW - -WXDLLEXPORT wchar_t * wxStrdupW(const wchar_t *pwz) -{ - size_t size = (wxWcslen(pwz) + 1) * sizeof(wchar_t); - wchar_t *ret = (wchar_t *) malloc(size); - memcpy(ret, pwz, size); - return ret; -} - -#endif // wxStrdupW - -#ifndef wxStricmp -int WXDLLEXPORT wxStricmp(const wxChar *psz1, const wxChar *psz2) -{ - register wxChar c1, c2; - do { - c1 = wxTolower(*psz1++); - c2 = wxTolower(*psz2++); - } while ( c1 && (c1 == c2) ); - return c1 - c2; -} -#endif - -#ifndef wxStricmp -int WXDLLEXPORT wxStrnicmp(const wxChar *s1, const wxChar *s2, size_t n) -{ - // initialize the variables just to suppress stupid gcc warning - register wxChar c1 = 0, c2 = 0; - while (n && ((c1 = wxTolower(*s1)) == (c2 = wxTolower(*s2)) ) && c1) n--, s1++, s2++; - if (n) { - if (c1 < c2) return -1; - if (c1 > c2) return 1; - } - return 0; -} -#endif - -#ifndef wxSetlocale -WXDLLEXPORT wxWCharBuffer wxSetlocale(int category, const wxChar *locale) -{ - char *localeOld = setlocale(category, wxConvLibc.cWX2MB(locale)); - - return wxWCharBuffer(wxConvLibc.cMB2WC(localeOld)); -} -#endif - -#if wxUSE_WCHAR_T && !defined(HAVE_WCSLEN) -WXDLLEXPORT size_t wxWcslen(const wchar_t *s) -{ - size_t n = 0; - while ( *s++ ) - n++; - - return n; -} -#endif - -// ---------------------------------------------------------------------------- -// string.h functions -// ---------------------------------------------------------------------------- - -#ifdef wxNEED_WX_STRING_H - -// RN: These need to be c externed for the regex lib -#ifdef __cplusplus -extern "C" { -#endif - -WXDLLEXPORT wxChar * wxStrcat(wxChar *dest, const wxChar *src) -{ - wxChar *ret = dest; - while (*dest) dest++; - while ((*dest++ = *src++)); - return ret; -} - -WXDLLEXPORT const wxChar * wxStrchr(const wxChar *s, wxChar c) -{ - // be careful here as the terminating NUL makes part of the string - while ( *s != c ) - { - if ( !*s++ ) - return NULL; - } - - return s; -} - -WXDLLEXPORT int wxStrcmp(const wxChar *s1, const wxChar *s2) -{ - while ((*s1 == *s2) && *s1) s1++, s2++; - if ((wxUChar)*s1 < (wxUChar)*s2) return -1; - if ((wxUChar)*s1 > (wxUChar)*s2) return 1; - return 0; -} - -WXDLLEXPORT wxChar * wxStrcpy(wxChar *dest, const wxChar *src) -{ - wxChar *ret = dest; - while ((*dest++ = *src++)); - return ret; -} - -WXDLLEXPORT size_t wxStrlen_(const wxChar *s) -{ - size_t n = 0; - while ( *s++ ) - n++; - - return n; -} - - -WXDLLEXPORT wxChar * wxStrncat(wxChar *dest, const wxChar *src, size_t n) -{ - wxChar *ret = dest; - while (*dest) dest++; - while (n && (*dest++ = *src++)) n--; - return ret; -} - -WXDLLEXPORT int wxStrncmp(const wxChar *s1, const wxChar *s2, size_t n) -{ - while (n && (*s1 == *s2) && *s1) n--, s1++, s2++; - if (n) { - if ((wxUChar)*s1 < (wxUChar)*s2) return -1; - if ((wxUChar)*s1 > (wxUChar)*s2) return 1; - } - return 0; -} - -WXDLLEXPORT wxChar * wxStrncpy(wxChar *dest, const wxChar *src, size_t n) -{ - wxChar *ret = dest; - while (n && (*dest++ = *src++)) n--; - while (n) *dest++=0, n--; // the docs specify padding with zeroes - return ret; -} - -WXDLLEXPORT const wxChar * wxStrpbrk(const wxChar *s, const wxChar *accept) -{ - while (*s && !wxStrchr(accept, *s)) - s++; - - return *s ? s : NULL; -} - -WXDLLEXPORT const wxChar * wxStrrchr(const wxChar *s, wxChar c) -{ - const wxChar *ret = NULL; - do - { - if ( *s == c ) - ret = s; - s++; - } - while ( *s ); - - return ret; -} - -WXDLLEXPORT size_t wxStrspn(const wxChar *s, const wxChar *accept) -{ - size_t len = 0; - while (wxStrchr(accept, *s++)) len++; - return len; -} - -WXDLLEXPORT const wxChar *wxStrstr(const wxChar *haystack, const wxChar *needle) -{ - wxASSERT_MSG( needle != NULL, _T("NULL argument in wxStrstr") ); - - // VZ: this is not exactly the most efficient string search algorithm... - - const size_t len = wxStrlen(needle); - - while ( const wxChar *fnd = wxStrchr(haystack, *needle) ) - { - if ( !wxStrncmp(fnd, needle, len) ) - return fnd; - - haystack = fnd + 1; - } - - return NULL; -} - -#ifdef __cplusplus -} -#endif - -WXDLLEXPORT double wxStrtod(const wxChar *nptr, wxChar **endptr) -{ - const wxChar decSep( -#if wxUSE_INTL - wxLocale::GetInfo(wxLOCALE_DECIMAL_POINT, wxLOCALE_CAT_NUMBER)[0] -#else - _T('.') -#endif - ); - const wxChar *start = nptr; - - while (wxIsspace(*nptr)) nptr++; - if (*nptr == wxT('+') || *nptr == wxT('-')) nptr++; - while (wxIsdigit(*nptr)) nptr++; - if (*nptr == decSep) { - nptr++; - while (wxIsdigit(*nptr)) nptr++; - } - if (*nptr == wxT('E') || *nptr == wxT('e')) { - nptr++; - if (*nptr == wxT('+') || *nptr == wxT('-')) nptr++; - while (wxIsdigit(*nptr)) nptr++; - } - - wxString data(start, nptr-start); - const wxWX2MBbuf dat = data.mb_str(wxConvLibc); - char *rdat = wxMBSTRINGCAST dat; - double ret = strtod(dat, &rdat); - - if (endptr) *endptr = (wxChar *)(start + (rdat - (const char *)dat)); - - return ret; -} - -WXDLLEXPORT long int wxStrtol(const wxChar *nptr, wxChar **endptr, int base) -{ - const wxChar *start = nptr; - - while (wxIsspace(*nptr)) nptr++; - if (*nptr == wxT('+') || *nptr == wxT('-')) nptr++; - if (((base == 0) || (base == 16)) && - (nptr[0] == wxT('0') && nptr[1] == wxT('x'))) { - nptr += 2; - base = 16; - } - else if ((base == 0) && (nptr[0] == wxT('0'))) base = 8; - else if (base == 0) base = 10; - - while ((wxIsdigit(*nptr) && (*nptr - wxT('0') < base)) || - (wxIsalpha(*nptr) && (wxToupper(*nptr) - wxT('A') + 10 < base))) nptr++; - - wxString data(start, nptr-start); - wxWX2MBbuf dat = data.mb_str(wxConvLibc); - char *rdat = wxMBSTRINGCAST dat; - long int ret = strtol(dat, &rdat, base); - - if (endptr) *endptr = (wxChar *)(start + (rdat - (const char *)dat)); - - return ret; -} - -WXDLLEXPORT unsigned long int wxStrtoul(const wxChar *nptr, wxChar **endptr, int base) -{ - return (unsigned long int) wxStrtol(nptr, endptr, base); -} - -#endif // wxNEED_WX_STRING_H - -#ifdef wxNEED_WX_STDIO_H -WXDLLEXPORT FILE * wxFopen(const wxChar *path, const wxChar *mode) -{ - char mode_buffer[10]; - for (size_t i = 0; i < wxStrlen(mode)+1; i++) - mode_buffer[i] = (char) mode[i]; - - return fopen( wxConvFile.cWX2MB(path), mode_buffer ); -} - -WXDLLEXPORT FILE * wxFreopen(const wxChar *path, const wxChar *mode, FILE *stream) -{ - char mode_buffer[10]; - for (size_t i = 0; i < wxStrlen(mode)+1; i++) - mode_buffer[i] = (char) mode[i]; - - return freopen( wxConvFile.cWX2MB(path), mode_buffer, stream ); -} - -WXDLLEXPORT int wxRemove(const wxChar *path) -{ - return remove( wxConvFile.cWX2MB(path) ); -} - -WXDLLEXPORT int wxRename(const wxChar *oldpath, const wxChar *newpath) -{ - return rename( wxConvFile.cWX2MB(oldpath), wxConvFile.cWX2MB(newpath) ); -} -#endif - -#ifndef wxAtof -double WXDLLEXPORT wxAtof(const wxChar *psz) -{ -#ifdef __WXWINCE__ - double d; - wxString str(psz); - if (str.ToDouble(& d)) - return d; - - return 0.0; -#else - return atof(wxConvLibc.cWX2MB(psz)); -#endif -} -#endif - -#ifdef wxNEED_WX_STDLIB_H -int WXDLLEXPORT wxAtoi(const wxChar *psz) -{ - return atoi(wxConvLibc.cWX2MB(psz)); -} - -long WXDLLEXPORT wxAtol(const wxChar *psz) -{ - return atol(wxConvLibc.cWX2MB(psz)); -} - -wxChar * WXDLLEXPORT wxGetenv(const wxChar *name) -{ -#if wxUSE_UNICODE - // NB: buffer returned by getenv() is allowed to be overwritten next - // time getenv() is called, so it is OK to use static string - // buffer to hold the data. - static wxWCharBuffer value((wxChar*)NULL); - value = wxConvLibc.cMB2WX(getenv(wxConvLibc.cWX2MB(name))); - return value.data(); -#else - return getenv(name); -#endif -} -#endif // wxNEED_WX_STDLIB_H - -#ifdef wxNEED_WXSYSTEM -int WXDLLEXPORT wxSystem(const wxChar *psz) -{ - return system(wxConvLibc.cWX2MB(psz)); -} -#endif // wxNEED_WXSYSTEM - -#ifdef wxNEED_WX_TIME_H -WXDLLEXPORT size_t -wxStrftime(wxChar *s, size_t maxsize, const wxChar *fmt, const struct tm *tm) -{ - if ( !maxsize ) - return 0; - - wxCharBuffer buf(maxsize); - - wxCharBuffer bufFmt(wxConvLibc.cWX2MB(fmt)); - if ( !bufFmt ) - return 0; - - size_t ret = strftime(buf.data(), maxsize, bufFmt, tm); - if ( !ret ) - return 0; - - wxWCharBuffer wbuf = wxConvLibc.cMB2WX(buf); - if ( !wbuf ) - return 0; - - wxStrncpy(s, wbuf, maxsize); - return wxStrlen(s); -} -#endif // wxNEED_WX_TIME_H - -#ifndef wxCtime -WXDLLEXPORT wxChar *wxCtime(const time_t *timep) -{ - // normally the string is 26 chars but give one more in case some broken - // DOS compiler decides to use "\r\n" instead of "\n" at the end - static wxChar buf[27]; - - // ctime() is guaranteed to return a string containing only ASCII - // characters, as its format is always the same for any locale - wxStrncpy(buf, wxString::FromAscii(ctime(timep)), WXSIZEOF(buf)); - buf[WXSIZEOF(buf) - 1] = _T('\0'); - - return buf; -} -#endif // wxCtime - -#endif // wxUSE_WCHAR_T - -// ---------------------------------------------------------------------------- -// functions which we may need even if !wxUSE_WCHAR_T -// ---------------------------------------------------------------------------- - -#ifndef wxStrtok - -WXDLLEXPORT wxChar * wxStrtok(wxChar *psz, const wxChar *delim, wxChar **save_ptr) -{ - if (!psz) - { - psz = *save_ptr; - if ( !psz ) - return NULL; - } - - psz += wxStrspn(psz, delim); - if (!*psz) - { - *save_ptr = (wxChar *)NULL; - return (wxChar *)NULL; - } - - wxChar *ret = psz; - psz = wxStrpbrk(psz, delim); - if (!psz) - { - *save_ptr = (wxChar*)NULL; - } - else - { - *psz = wxT('\0'); - *save_ptr = psz + 1; - } - - return ret; -} - -#endif // wxStrtok - -// ---------------------------------------------------------------------------- -// missing C RTL functions -// ---------------------------------------------------------------------------- - -#ifdef wxNEED_STRDUP - -char *strdup(const char *s) -{ - char *dest = (char*) malloc( strlen( s ) + 1 ) ; - if ( dest ) - strcpy( dest , s ) ; - return dest ; -} -#endif // wxNEED_STRDUP - -#if defined(__WXWINCE__) && (_WIN32_WCE <= 211) - -void *calloc( size_t num, size_t size ) -{ - void** ptr = (void **)malloc(num * size); - memset( ptr, 0, num * size); - return ptr; -} - -#endif // __WXWINCE__ <= 211 - -#ifdef __WXWINCE__ - -int wxRemove(const wxChar *path) -{ - return ::DeleteFile(path) == 0; -} - -#endif diff --git a/wxWidgets/src/common/xpmdecod.cpp b/wxWidgets/src/common/xpmdecod.cpp deleted file mode 100644 index 3b01094c6f..0000000000 --- a/wxWidgets/src/common/xpmdecod.cpp +++ /dev/null @@ -1,833 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/common/xpmdecod.cpp -// Purpose: wxXPMDecoder -// Author: John Cristy, Vaclav Slavik -// RCS-ID: $Id: xpmdecod.cpp 54948 2008-08-03 10:54:33Z VZ $ -// Copyright: (c) John Cristy, Vaclav Slavik -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -/* - -This file is partially based on source code of ImageMagick by John Cristy. Its -license is as follows: - -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% % -% % -% % -% X X PPPP M M % -% X X P P MM MM % -% X PPPP M M M % -% X X P M M % -% X X P M M % -% % -% % -% Read/Write ImageMagick Image Format. % -% % -% % -% Software Design % -% John Cristy % -% July 1992 % -% % -% % -% Copyright (C) 2001 ImageMagick Studio, a non-profit organization dedicated % -% to making software imaging solutions freely available. % -% % -% Permission is hereby granted, free of charge, to any person obtaining a % -% copy of this software and associated documentation files ("ImageMagick"), % -% to deal in ImageMagick without restriction, including without limitation % -% the rights to use, copy, modify, merge, publish, distribute, sublicense, % -% and/or sell copies of ImageMagick, and to permit persons to whom the % -% ImageMagick is furnished to do so, subject to the following conditions: % -% % -% The above copyright notice and this permission notice shall be included in % -% all copies or substantial portions of ImageMagick. % -% % -% The software is provided "as is", without warranty of any kind, express or % -% implied, including but not limited to the warranties of merchantability, % -% fitness for a particular purpose and noninfringement. In no event shall % -% ImageMagick Studio be liable for any claim, damages or other liability, % -% whether in an action of contract, tort or otherwise, arising from, out of % -% or in connection with ImageMagick or the use or other dealings in % -% ImageMagick. % -% % -% Except as contained in this notice, the name of the ImageMagick Studio % -% shall not be used in advertising or otherwise to promote the sale, use or % -% other dealings in ImageMagick without prior written authorization from the % -% ImageMagick Studio. % -% % -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% -% -*/ - -/* - * Also contains some pieces from libxpm and its modification for win32 by - * HeDu : - * - * Copyright (C) 1989-95 GROUPE BULL - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to - * deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - * sell copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * GROUPE BULL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * Except as contained in this notice, the name of GROUPE BULL shall not be - * used in advertising or otherwise to promote the sale, use or other dealings - * in this Software without prior written authorization from GROUPE BULL. - */ - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_IMAGE && wxUSE_XPM - -#include "wx/xpmdecod.h" - -#ifndef WX_PRECOMP - #include "wx/intl.h" - #include "wx/log.h" - #include "wx/utils.h" - #include "wx/hashmap.h" - #include "wx/stream.h" - #include "wx/image.h" - #include "wx/palette.h" -#endif - -#include -#include - -#if wxUSE_STREAMS -bool wxXPMDecoder::CanRead(wxInputStream& stream) -{ - unsigned char buf[9]; - - if ( !stream.Read(buf, WXSIZEOF(buf)) ) - return false; - - stream.SeekI(-(wxFileOffset)WXSIZEOF(buf), wxFromCurrent); - - return memcmp(buf, "/* XPM */", WXSIZEOF(buf)) == 0; -} - -wxImage wxXPMDecoder::ReadFile(wxInputStream& stream) -{ - size_t length = stream.GetSize(); - wxCHECK_MSG( length != 0, wxNullImage, - wxT("Cannot read XPM from stream of unknown size") ); - - // use a smart buffer to be sure to free memory even when we return on - // error - wxCharBuffer buffer(length); - - char *xpm_buffer = (char *)buffer.data(); - if ( stream.Read(xpm_buffer, length).GetLastError() == wxSTREAM_READ_ERROR ) - return wxNullImage; - xpm_buffer[length] = '\0'; - - /* - * Remove comments from the file: - */ - char *p, *q; - for (p = xpm_buffer; *p != '\0'; p++) - { - if ( (*p == '"') || (*p == '\'') ) - { - if (*p == '"') - { - for (p++; *p != '\0'; p++) - if ( (*p == '"') && (*(p - 1) != '\\') ) - break; - } - else // *p == '\'' - { - for (p++; *p != '\0'; p++) - if ( (*p == '\'') && (*(p - 1) != '\\') ) - break; - } - if (*p == '\0') - break; - continue; - } - if ( (*p != '/') || (*(p + 1) != '*') ) - continue; - for (q = p + 2; *q != '\0'; q++) - { - if ( (*q == '*') && (*(q + 1) == '/') ) - break; - } - - // memmove allows overlaps (unlike strcpy): - size_t cpylen = strlen(q + 2) + 1; - memmove(p, q + 2, cpylen); - } - - /* - * Remove unquoted characters: - */ - size_t i = 0; - for (p = xpm_buffer; *p != '\0'; p++) - { - if ( *p != '"' ) - continue; - for (q = p + 1; *q != '\0'; q++) - if (*q == '"') - break; - strncpy(xpm_buffer + i, p + 1, q - p - 1); - i += q - p - 1; - xpm_buffer[i++] = '\n'; - p = q + 1; - } - xpm_buffer[i] = '\0'; - - /* - * Create array of lines and convert \n's to \0's: - */ - const char **xpm_lines; - size_t lines_cnt = 0; - size_t line; - - for (p = xpm_buffer; *p != '\0'; p++) - { - if ( *p == '\n' ) - lines_cnt++; - } - - if ( !lines_cnt ) - { - // this doesn't really look an XPM image - return wxNullImage; - } - - xpm_lines = new const char*[lines_cnt + 1]; - xpm_lines[0] = xpm_buffer; - line = 1; - for (p = xpm_buffer; (*p != '\0') && (line < lines_cnt); p++) - { - if ( *p == '\n' ) - { - xpm_lines[line] = p + 1; - *p = '\0'; - line++; - } - } - - xpm_lines[lines_cnt] = NULL; - - /* - * Read the image: - */ - wxImage img = ReadData(xpm_lines); - - delete[] xpm_lines; - - return img; -} -#endif // wxUSE_STREAMS - - -/*****************************************************************************\ -* rgbtab.h * -* * -* A hard coded rgb.txt. To keep it short I removed all colornames with * -* trailing numbers, Blue3 etc, except the GrayXX. Sorry Grey-lovers I prefer * -* Gray ;-). But Grey is recognized on lookups, only on save Gray will be * -* used, maybe you want to do some substitue there too. * -* * -* To save memory the RGBs are coded in one long value, as done by the RGB * -* macro. * -* * -* Developed by HeDu 3/94 (hedu@cul-ipn.uni-kiel.de) * -\*****************************************************************************/ - - -typedef struct -{ - const char *name; - wxUint32 rgb; -} rgbRecord; - -#define myRGB(r,g,b) ((wxUint32)r<<16|(wxUint32)g<<8|(wxUint32)b) - -static rgbRecord theRGBRecords[] = -{ - {"aliceblue", myRGB(240, 248, 255)}, - {"antiquewhite", myRGB(250, 235, 215)}, - {"aquamarine", myRGB(50, 191, 193)}, - {"azure", myRGB(240, 255, 255)}, - {"beige", myRGB(245, 245, 220)}, - {"bisque", myRGB(255, 228, 196)}, - {"black", myRGB(0, 0, 0)}, - {"blanchedalmond", myRGB(255, 235, 205)}, - {"blue", myRGB(0, 0, 255)}, - {"blueviolet", myRGB(138, 43, 226)}, - {"brown", myRGB(165, 42, 42)}, - {"burlywood", myRGB(222, 184, 135)}, - {"cadetblue", myRGB(95, 146, 158)}, - {"chartreuse", myRGB(127, 255, 0)}, - {"chocolate", myRGB(210, 105, 30)}, - {"coral", myRGB(255, 114, 86)}, - {"cornflowerblue", myRGB(34, 34, 152)}, - {"cornsilk", myRGB(255, 248, 220)}, - {"cyan", myRGB(0, 255, 255)}, - {"darkgoldenrod", myRGB(184, 134, 11)}, - {"darkgreen", myRGB(0, 86, 45)}, - {"darkkhaki", myRGB(189, 183, 107)}, - {"darkolivegreen", myRGB(85, 86, 47)}, - {"darkorange", myRGB(255, 140, 0)}, - {"darkorchid", myRGB(139, 32, 139)}, - {"darksalmon", myRGB(233, 150, 122)}, - {"darkseagreen", myRGB(143, 188, 143)}, - {"darkslateblue", myRGB(56, 75, 102)}, - {"darkslategray", myRGB(47, 79, 79)}, - {"darkturquoise", myRGB(0, 166, 166)}, - {"darkviolet", myRGB(148, 0, 211)}, - {"deeppink", myRGB(255, 20, 147)}, - {"deepskyblue", myRGB(0, 191, 255)}, - {"dimgray", myRGB(84, 84, 84)}, - {"dodgerblue", myRGB(30, 144, 255)}, - {"firebrick", myRGB(142, 35, 35)}, - {"floralwhite", myRGB(255, 250, 240)}, - {"forestgreen", myRGB(80, 159, 105)}, - {"gainsboro", myRGB(220, 220, 220)}, - {"ghostwhite", myRGB(248, 248, 255)}, - {"gold", myRGB(218, 170, 0)}, - {"goldenrod", myRGB(239, 223, 132)}, - {"gray", myRGB(126, 126, 126)}, - {"gray0", myRGB(0, 0, 0)}, - {"gray1", myRGB(3, 3, 3)}, - {"gray10", myRGB(26, 26, 26)}, - {"gray100", myRGB(255, 255, 255)}, - {"gray11", myRGB(28, 28, 28)}, - {"gray12", myRGB(31, 31, 31)}, - {"gray13", myRGB(33, 33, 33)}, - {"gray14", myRGB(36, 36, 36)}, - {"gray15", myRGB(38, 38, 38)}, - {"gray16", myRGB(41, 41, 41)}, - {"gray17", myRGB(43, 43, 43)}, - {"gray18", myRGB(46, 46, 46)}, - {"gray19", myRGB(48, 48, 48)}, - {"gray2", myRGB(5, 5, 5)}, - {"gray20", myRGB(51, 51, 51)}, - {"gray21", myRGB(54, 54, 54)}, - {"gray22", myRGB(56, 56, 56)}, - {"gray23", myRGB(59, 59, 59)}, - {"gray24", myRGB(61, 61, 61)}, - {"gray25", myRGB(64, 64, 64)}, - {"gray26", myRGB(66, 66, 66)}, - {"gray27", myRGB(69, 69, 69)}, - {"gray28", myRGB(71, 71, 71)}, - {"gray29", myRGB(74, 74, 74)}, - {"gray3", myRGB(8, 8, 8)}, - {"gray30", myRGB(77, 77, 77)}, - {"gray31", myRGB(79, 79, 79)}, - {"gray32", myRGB(82, 82, 82)}, - {"gray33", myRGB(84, 84, 84)}, - {"gray34", myRGB(87, 87, 87)}, - {"gray35", myRGB(89, 89, 89)}, - {"gray36", myRGB(92, 92, 92)}, - {"gray37", myRGB(94, 94, 94)}, - {"gray38", myRGB(97, 97, 97)}, - {"gray39", myRGB(99, 99, 99)}, - {"gray4", myRGB(10, 10, 10)}, - {"gray40", myRGB(102, 102, 102)}, - {"gray41", myRGB(105, 105, 105)}, - {"gray42", myRGB(107, 107, 107)}, - {"gray43", myRGB(110, 110, 110)}, - {"gray44", myRGB(112, 112, 112)}, - {"gray45", myRGB(115, 115, 115)}, - {"gray46", myRGB(117, 117, 117)}, - {"gray47", myRGB(120, 120, 120)}, - {"gray48", myRGB(122, 122, 122)}, - {"gray49", myRGB(125, 125, 125)}, - {"gray5", myRGB(13, 13, 13)}, - {"gray50", myRGB(127, 127, 127)}, - {"gray51", myRGB(130, 130, 130)}, - {"gray52", myRGB(133, 133, 133)}, - {"gray53", myRGB(135, 135, 135)}, - {"gray54", myRGB(138, 138, 138)}, - {"gray55", myRGB(140, 140, 140)}, - {"gray56", myRGB(143, 143, 143)}, - {"gray57", myRGB(145, 145, 145)}, - {"gray58", myRGB(148, 148, 148)}, - {"gray59", myRGB(150, 150, 150)}, - {"gray6", myRGB(15, 15, 15)}, - {"gray60", myRGB(153, 153, 153)}, - {"gray61", myRGB(156, 156, 156)}, - {"gray62", myRGB(158, 158, 158)}, - {"gray63", myRGB(161, 161, 161)}, - {"gray64", myRGB(163, 163, 163)}, - {"gray65", myRGB(166, 166, 166)}, - {"gray66", myRGB(168, 168, 168)}, - {"gray67", myRGB(171, 171, 171)}, - {"gray68", myRGB(173, 173, 173)}, - {"gray69", myRGB(176, 176, 176)}, - {"gray7", myRGB(18, 18, 18)}, - {"gray70", myRGB(179, 179, 179)}, - {"gray71", myRGB(181, 181, 181)}, - {"gray72", myRGB(184, 184, 184)}, - {"gray73", myRGB(186, 186, 186)}, - {"gray74", myRGB(189, 189, 189)}, - {"gray75", myRGB(191, 191, 191)}, - {"gray76", myRGB(194, 194, 194)}, - {"gray77", myRGB(196, 196, 196)}, - {"gray78", myRGB(199, 199, 199)}, - {"gray79", myRGB(201, 201, 201)}, - {"gray8", myRGB(20, 20, 20)}, - {"gray80", myRGB(204, 204, 204)}, - {"gray81", myRGB(207, 207, 207)}, - {"gray82", myRGB(209, 209, 209)}, - {"gray83", myRGB(212, 212, 212)}, - {"gray84", myRGB(214, 214, 214)}, - {"gray85", myRGB(217, 217, 217)}, - {"gray86", myRGB(219, 219, 219)}, - {"gray87", myRGB(222, 222, 222)}, - {"gray88", myRGB(224, 224, 224)}, - {"gray89", myRGB(227, 227, 227)}, - {"gray9", myRGB(23, 23, 23)}, - {"gray90", myRGB(229, 229, 229)}, - {"gray91", myRGB(232, 232, 232)}, - {"gray92", myRGB(235, 235, 235)}, - {"gray93", myRGB(237, 237, 237)}, - {"gray94", myRGB(240, 240, 240)}, - {"gray95", myRGB(242, 242, 242)}, - {"gray96", myRGB(245, 245, 245)}, - {"gray97", myRGB(247, 247, 247)}, - {"gray98", myRGB(250, 250, 250)}, - {"gray99", myRGB(252, 252, 252)}, - {"green", myRGB(0, 255, 0)}, - {"greenyellow", myRGB(173, 255, 47)}, - {"honeydew", myRGB(240, 255, 240)}, - {"hotpink", myRGB(255, 105, 180)}, - {"indianred", myRGB(107, 57, 57)}, - {"ivory", myRGB(255, 255, 240)}, - {"khaki", myRGB(179, 179, 126)}, - {"lavender", myRGB(230, 230, 250)}, - {"lavenderblush", myRGB(255, 240, 245)}, - {"lawngreen", myRGB(124, 252, 0)}, - {"lemonchiffon", myRGB(255, 250, 205)}, - {"lightblue", myRGB(176, 226, 255)}, - {"lightcoral", myRGB(240, 128, 128)}, - {"lightcyan", myRGB(224, 255, 255)}, - {"lightgoldenrod", myRGB(238, 221, 130)}, - {"lightgoldenrodyellow", myRGB(250, 250, 210)}, - {"lightgray", myRGB(168, 168, 168)}, - {"lightpink", myRGB(255, 182, 193)}, - {"lightsalmon", myRGB(255, 160, 122)}, - {"lightseagreen", myRGB(32, 178, 170)}, - {"lightskyblue", myRGB(135, 206, 250)}, - {"lightslateblue", myRGB(132, 112, 255)}, - {"lightslategray", myRGB(119, 136, 153)}, - {"lightsteelblue", myRGB(124, 152, 211)}, - {"lightyellow", myRGB(255, 255, 224)}, - {"limegreen", myRGB(0, 175, 20)}, - {"linen", myRGB(250, 240, 230)}, - {"magenta", myRGB(255, 0, 255)}, - {"maroon", myRGB(143, 0, 82)}, - {"mediumaquamarine", myRGB(0, 147, 143)}, - {"mediumblue", myRGB(50, 50, 204)}, - {"mediumforestgreen", myRGB(50, 129, 75)}, - {"mediumgoldenrod", myRGB(209, 193, 102)}, - {"mediumorchid", myRGB(189, 82, 189)}, - {"mediumpurple", myRGB(147, 112, 219)}, - {"mediumseagreen", myRGB(52, 119, 102)}, - {"mediumslateblue", myRGB(106, 106, 141)}, - {"mediumspringgreen", myRGB(35, 142, 35)}, - {"mediumturquoise", myRGB(0, 210, 210)}, - {"mediumvioletred", myRGB(213, 32, 121)}, - {"midnightblue", myRGB(47, 47, 100)}, - {"mintcream", myRGB(245, 255, 250)}, - {"mistyrose", myRGB(255, 228, 225)}, - {"moccasin", myRGB(255, 228, 181)}, - {"navajowhite", myRGB(255, 222, 173)}, - {"navy", myRGB(35, 35, 117)}, - {"navyblue", myRGB(35, 35, 117)}, - {"oldlace", myRGB(253, 245, 230)}, - {"olivedrab", myRGB(107, 142, 35)}, - {"orange", myRGB(255, 135, 0)}, - {"orangered", myRGB(255, 69, 0)}, - {"orchid", myRGB(239, 132, 239)}, - {"palegoldenrod", myRGB(238, 232, 170)}, - {"palegreen", myRGB(115, 222, 120)}, - {"paleturquoise", myRGB(175, 238, 238)}, - {"palevioletred", myRGB(219, 112, 147)}, - {"papayawhip", myRGB(255, 239, 213)}, - {"peachpuff", myRGB(255, 218, 185)}, - {"peru", myRGB(205, 133, 63)}, - {"pink", myRGB(255, 181, 197)}, - {"plum", myRGB(197, 72, 155)}, - {"powderblue", myRGB(176, 224, 230)}, - {"purple", myRGB(160, 32, 240)}, - {"red", myRGB(255, 0, 0)}, - {"rosybrown", myRGB(188, 143, 143)}, - {"royalblue", myRGB(65, 105, 225)}, - {"saddlebrown", myRGB(139, 69, 19)}, - {"salmon", myRGB(233, 150, 122)}, - {"sandybrown", myRGB(244, 164, 96)}, - {"seagreen", myRGB(82, 149, 132)}, - {"seashell", myRGB(255, 245, 238)}, - {"sienna", myRGB(150, 82, 45)}, - {"silver", myRGB(192, 192, 192)}, - {"skyblue", myRGB(114, 159, 255)}, - {"slateblue", myRGB(126, 136, 171)}, - {"slategray", myRGB(112, 128, 144)}, - {"snow", myRGB(255, 250, 250)}, - {"springgreen", myRGB(65, 172, 65)}, - {"steelblue", myRGB(84, 112, 170)}, - {"tan", myRGB(222, 184, 135)}, - {"thistle", myRGB(216, 191, 216)}, - {"tomato", myRGB(255, 99, 71)}, - {"transparent", myRGB(0, 0, 1)}, - {"turquoise", myRGB(25, 204, 223)}, - {"violet", myRGB(156, 62, 206)}, - {"violetred", myRGB(243, 62, 150)}, - {"wheat", myRGB(245, 222, 179)}, - {"white", myRGB(255, 255, 255)}, - {"whitesmoke", myRGB(245, 245, 245)}, - {"yellow", myRGB(255, 255, 0)}, - {"yellowgreen", myRGB(50, 216, 56)}, - {NULL, myRGB(0, 0, 0)} -}; -static int numTheRGBRecords = 235; - -static unsigned char ParseHexadecimal(char digit1, char digit2) -{ - unsigned char i1, i2; - - if (digit1 >= 'a') - i1 = (unsigned char)(digit1 - 'a' + 0x0A); - else if (digit1 >= 'A') - i1 = (unsigned char)(digit1 - 'A' + 0x0A); - else - i1 = (unsigned char)(digit1 - '0'); - if (digit2 >= 'a') - i2 = (unsigned char)(digit2 - 'a' + 0x0A); - else if (digit2 >= 'A') - i2 = (unsigned char)(digit2 - 'A' + 0x0A); - else - i2 = (unsigned char)(digit2 - '0'); - return (unsigned char)(0x10 * i1 + i2); -} - -static bool GetRGBFromName(const char *inname, bool *isNone, - unsigned char *r, unsigned char*g, unsigned char *b) -{ - int left, right, middle; - int cmp; - wxUint32 rgbVal; - char *name; - char *grey, *p; - - // Neither #rrggbb nor #rrrrggggbbbb are in database, we parse them directly - size_t inname_len = strlen(inname); - if ( *inname == '#' && (inname_len == 7 || inname_len == 13)) - { - size_t ofs = (inname_len == 7) ? 2 : 4; - *r = ParseHexadecimal(inname[1], inname[2]); - *g = ParseHexadecimal(inname[1*ofs+1], inname[1*ofs+2]); - *b = ParseHexadecimal(inname[2*ofs+1], inname[2*ofs+2]); - *isNone = false; - return true; - } - - name = wxStrdupA(inname); - - // theRGBRecords[] has no names with spaces, and no grey, but a - // lot of gray... - - // so first extract ' ' - while ((p = strchr(name, ' ')) != NULL) - { - while (*(p)) // till eof of string - { - *p = *(p + 1); // copy to the left - p++; - } - } - // fold to lower case - p = name; - while (*p) - { - *p = (char)tolower(*p); - p++; - } - - // substitute Grey with Gray, else rgbtab.h would have more than 100 - // 'duplicate' entries - if ( (grey = strstr(name, "grey")) != NULL ) - grey[2] = 'a'; - - // check for special 'none' colour: - bool found; - if ( strcmp(name, "none") == 0 ) - { - *isNone = true; - found = true; - } - else // not "None" - { - found = false; - - // binary search: - left = 0; - right = numTheRGBRecords - 1; - do - { - middle = (left + right) / 2; - cmp = strcmp(name, theRGBRecords[middle].name); - if ( cmp == 0 ) - { - rgbVal = theRGBRecords[middle].rgb; - *r = (unsigned char)((rgbVal >> 16) & 0xFF); - *g = (unsigned char)((rgbVal >> 8) & 0xFF); - *b = (unsigned char)((rgbVal) & 0xFF); - *isNone = false; - found = true; - break; - } - else if ( cmp < 0 ) - { - right = middle - 1; - } - else // cmp > 0 - { - left = middle + 1; - } - } while (left <= right); - } - - free(name); - - return found; -} - -static const char *ParseColor(const char *data) -{ - static const char *targets[] = - {"c ", "g ", "g4 ", "m ", "b ", "s ", NULL}; - - const char *p, *r; - const char *q; - int i; - - for (i = 0; targets[i] != NULL; i++) - { - r = data; - for (q = targets[i]; *r != '\0'; r++) - { - if ( *r != *q ) - continue; - if ( !isspace((int) (*(r - 1))) ) - continue; - p = r; - for (;;) - { - if ( *q == '\0' ) - return p; - if ( *p++ != *q++ ) - break; - } - q = targets[i]; - } - } - return NULL; -} - -struct wxXPMColourMapData -{ - wxXPMColourMapData() { R = G = B = 0; } - unsigned char R,G,B; -}; -WX_DECLARE_STRING_HASH_MAP(wxXPMColourMapData, wxXPMColourMap); - -wxImage wxXPMDecoder::ReadData(const char* const* xpm_data) -{ - wxCHECK_MSG(xpm_data, wxNullImage, wxT("NULL XPM data") ); - - wxImage img; - int count; - unsigned width, height, colors_cnt, chars_per_pixel; - size_t i, j, i_key; - wxChar key[64]; - const char *clr_def; - bool hasMask; - wxXPMColourMap clr_tbl; - wxXPMColourMap::iterator it; - wxString maskKey; - - /* - * Read hints and initialize structures: - */ - - count = sscanf(xpm_data[0], "%u %u %u %u", - &width, &height, &colors_cnt, &chars_per_pixel); - if ( count != 4 || width * height * colors_cnt == 0 ) - { - wxLogError(_("XPM: incorrect header format!")); - return wxNullImage; - } - - // VS: XPM color map this large would be insane, since XPMs are encoded with - // 92 possible values on each position, 92^64 is *way* larger space than - // 8bit RGB... - wxCHECK_MSG(chars_per_pixel < 64, wxNullImage, wxT("XPM colormaps this large not supported.")); - - if ( !img.Create(width, height) ) - return wxNullImage; - - img.SetMask(false); - key[chars_per_pixel] = wxT('\0'); - hasMask = false; - - /* - * Create colour map: - */ - wxXPMColourMapData clr_data; - for (i = 0; i < colors_cnt; i++) - { - const char *xmpColLine = xpm_data[1 + i]; - - // we must have at least " x y" after the colour index, hence +5 - if ( !xmpColLine || strlen(xmpColLine) < chars_per_pixel + 5 ) - { - wxLogError(_("XPM: incorrect colour description in line %d"), - (int)(1 + i)); - return wxNullImage; - } - - for (i_key = 0; i_key < chars_per_pixel; i_key++) - key[i_key] = (wxChar)xmpColLine[i_key]; - clr_def = ParseColor(xmpColLine + chars_per_pixel); - - if ( clr_def == NULL ) - { - wxLogError(_("XPM: malformed colour definition '%s' at line %d!"), - xmpColLine, (int)(1 + i)); - return wxNullImage; - } - - bool isNone = false; - if ( !GetRGBFromName(clr_def, &isNone, - &clr_data.R, &clr_data.G, &clr_data.B) ) - { - wxLogError(_("XPM: malformed colour definition '%s' at line %d!"), - xmpColLine, (int)(1 + i)); - return wxNullImage; - } - - if ( isNone ) - { - img.SetMask(true); - img.SetMaskColour(255, 0, 255); - clr_data.R = - clr_data.B = 255; - clr_data.G = 0; - hasMask = true; - maskKey = key; - } - - clr_tbl[key] = clr_data; - } - - /* - * Modify colour entries with RGB = (255,0,255) to (255,0,254) if - * mask colour is present (so that existing pixels with (255,0,255) - * magenta colour are not incorrectly made transparent): - */ - if (hasMask) - { - for (it = clr_tbl.begin(); it != clr_tbl.end(); ++it) - { - if (it->second.R == 255 && it->second.G == 0 && - it->second.B == 255 && - it->first != maskKey) - { - it->second.B = 254; - } - } - } - - /* - * Parse image data: - */ - - unsigned char *img_data = img.GetData(); - wxXPMColourMap::iterator entry; - wxXPMColourMap::iterator end = clr_tbl.end(); - - for (j = 0; j < height; j++) - { - for (i = 0; i < width; i++, img_data += 3) - { - const char *xpmImgLine = xpm_data[1 + colors_cnt + j]; - if ( !xpmImgLine || strlen(xpmImgLine) < width*chars_per_pixel ) - { - wxLogError(_("XPM: truncated image data at line %d!"), - (int)(1 + colors_cnt + j)); - return wxNullImage; - } - - for (i_key = 0; i_key < chars_per_pixel; i_key++) - { - key[i_key] = (wxChar)xpmImgLine[chars_per_pixel * i + i_key]; - } - - entry = clr_tbl.find(key); - if ( entry == end ) - { - wxLogError(_("XPM: Malformed pixel data!")); - - // better return right now as otherwise we risk to flood the - // user with error messages as something seems to be seriously - // wrong with the file and so we could give this message for - // each remaining pixel if we don't bail out - return wxNullImage; - } - else - { - img_data[0] = entry->second.R; - img_data[1] = entry->second.G; - img_data[2] = entry->second.B; - } - } - } - -#if wxUSE_PALETTE - unsigned char* r = new unsigned char[colors_cnt]; - unsigned char* g = new unsigned char[colors_cnt]; - unsigned char* b = new unsigned char[colors_cnt]; - - for (it = clr_tbl.begin(), i = 0; it != clr_tbl.end(); it++, i++) - { - r[i] = it->second.R; - g[i] = it->second.G; - b[i] = it->second.B; - } - wxASSERT(i == colors_cnt); - img.SetPalette(wxPalette(colors_cnt, r, g, b)); - delete[] r; - delete[] g; - delete[] b; -#endif // wxUSE_PALETTE - - return img; -} - -#endif // wxUSE_IMAGE && wxUSE_XPM diff --git a/wxWidgets/src/common/xti.cpp b/wxWidgets/src/common/xti.cpp deleted file mode 100644 index 9542896f78..0000000000 --- a/wxWidgets/src/common/xti.cpp +++ /dev/null @@ -1,767 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/common/xti.cpp -// Purpose: runtime metadata information (extended class info -// Author: Stefan Csomor -// Modified by: -// Created: 27/07/03 -// RCS-ID: $Id: xti.cpp 38857 2006-04-20 07:31:44Z ABX $ -// Copyright: (c) 1997 Julian Smart -// (c) 2003 Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_EXTENDED_RTTI - -#ifndef WX_PRECOMP - #include "wx/object.h" - #include "wx/list.h" - #include "wx/hash.h" -#endif - -#include "wx/xti.h" -#include "wx/xml/xml.h" -#include "wx/tokenzr.h" -#include - -#include "wx/beforestd.h" -#include -#include -#include -#include "wx/afterstd.h" - -using namespace std ; - -// ---------------------------------------------------------------------------- -// Enum Support -// ---------------------------------------------------------------------------- - -wxEnumData::wxEnumData( wxEnumMemberData* data ) -{ - m_members = data ; - for ( m_count = 0; m_members[m_count].m_name ; m_count++) - {} ; -} - -bool wxEnumData::HasEnumMemberValue(const wxChar *name, int *value) const -{ - int i; - for (i = 0; m_members[i].m_name ; i++ ) - { - if (!wxStrcmp(name, m_members[i].m_name)) - { - if ( value ) - *value = m_members[i].m_value; - return true ; - } - } - return false ; -} - -int wxEnumData::GetEnumMemberValue(const wxChar *name) const -{ - int i; - for (i = 0; m_members[i].m_name ; i++ ) - { - if (!wxStrcmp(name, m_members[i].m_name)) - { - return m_members[i].m_value; - } - } - return 0 ; -} - -const wxChar *wxEnumData::GetEnumMemberName(int value) const -{ - int i; - for (i = 0; m_members[i].m_name ; i++) - if (value == m_members[i].m_value) - return m_members[i].m_name; - - return wxEmptyString ; -} - -int wxEnumData::GetEnumMemberValueByIndex( int idx ) const -{ - // we should cache the count in order to avoid out-of-bounds errors - return m_members[idx].m_value ; -} - -const wxChar * wxEnumData::GetEnumMemberNameByIndex( int idx ) const -{ - // we should cache the count in order to avoid out-of-bounds errors - return m_members[idx].m_name ; -} - -// ---------------------------------------------------------------------------- -// Type Information -// ---------------------------------------------------------------------------- -// ---------------------------------------------------------------------------- -// value streaming -// ---------------------------------------------------------------------------- - -// streamer specializations -// for all built-in types - -// bool - -template<> void wxStringReadValue(const wxString &s , bool &data ) -{ - int intdata ; - wxSscanf(s, _T("%d"), &intdata ) ; - data = (bool)intdata ; -} - -template<> void wxStringWriteValue(wxString &s , const bool &data ) -{ - s = wxString::Format(_T("%d"), data ) ; -} - -// char - -template<> void wxStringReadValue(const wxString &s , char &data ) -{ - int intdata ; - wxSscanf(s, _T("%d"), &intdata ) ; - data = char(intdata) ; -} - -template<> void wxStringWriteValue(wxString &s , const char &data ) -{ - s = wxString::Format(_T("%d"), data ) ; -} - -// unsigned char - -template<> void wxStringReadValue(const wxString &s , unsigned char &data ) -{ - int intdata ; - wxSscanf(s, _T("%d"), &intdata ) ; - data = (unsigned char)(intdata) ; -} - -template<> void wxStringWriteValue(wxString &s , const unsigned char &data ) -{ - s = wxString::Format(_T("%d"), data ) ; -} - -// int - -template<> void wxStringReadValue(const wxString &s , int &data ) -{ - wxSscanf(s, _T("%d"), &data ) ; -} - -template<> void wxStringWriteValue(wxString &s , const int &data ) -{ - s = wxString::Format(_T("%d"), data ) ; -} - -// unsigned int - -template<> void wxStringReadValue(const wxString &s , unsigned int &data ) -{ - wxSscanf(s, _T("%d"), &data ) ; -} - -template<> void wxStringWriteValue(wxString &s , const unsigned int &data ) -{ - s = wxString::Format(_T("%d"), data ) ; -} - -// long - -template<> void wxStringReadValue(const wxString &s , long &data ) -{ - wxSscanf(s, _T("%ld"), &data ) ; -} - -template<> void wxStringWriteValue(wxString &s , const long &data ) -{ - s = wxString::Format(_T("%ld"), data ) ; -} - -// unsigned long - -template<> void wxStringReadValue(const wxString &s , unsigned long &data ) -{ - wxSscanf(s, _T("%ld"), &data ) ; -} - -template<> void wxStringWriteValue(wxString &s , const unsigned long &data ) -{ - s = wxString::Format(_T("%ld"), data ) ; -} - -// float - -template<> void wxStringReadValue(const wxString &s , float &data ) -{ - wxSscanf(s, _T("%f"), &data ) ; -} - -template<> void wxStringWriteValue(wxString &s , const float &data ) -{ - s = wxString::Format(_T("%f"), data ) ; -} - -// double - -template<> void wxStringReadValue(const wxString &s , double &data ) -{ - wxSscanf(s, _T("%lf"), &data ) ; -} - -template<> void wxStringWriteValue(wxString &s , const double &data ) -{ - s = wxString::Format(_T("%lf"), data ) ; -} - -// wxString - -template<> void wxStringReadValue(const wxString &s , wxString &data ) -{ - data = s ; -} - -template<> void wxStringWriteValue(wxString &s , const wxString &data ) -{ - s = data ; -} - -// built-ins -// - -#if wxUSE_FUNC_TEMPLATE_POINTER -#define wxBUILTIN_TYPE_INFO( element , type ) \ - wxBuiltInTypeInfo s_typeInfo##type(element , &wxToStringConverter , &wxFromStringConverter , typeid(type).name()) ; -#else -#define wxBUILTIN_TYPE_INFO( element , type ) \ - void _toString##element( const wxxVariant& data , wxString &result ) { wxToStringConverter(data, result); } \ - void _fromString##element( const wxString& data , wxxVariant &result ) { wxFromStringConverter(data, result); } \ - wxBuiltInTypeInfo s_typeInfo##type(element , &_toString##element , &_fromString##element , typeid(type).name()) ; -#endif - -typedef unsigned char unsigned_char; -typedef unsigned int unsigned_int; -typedef unsigned long unsigned_long; - -wxBuiltInTypeInfo s_typeInfovoid( wxT_VOID , NULL , NULL , typeid(void).name()); -wxBUILTIN_TYPE_INFO( wxT_BOOL , bool); -wxBUILTIN_TYPE_INFO( wxT_CHAR , char); -wxBUILTIN_TYPE_INFO( wxT_UCHAR , unsigned_char); -wxBUILTIN_TYPE_INFO( wxT_INT , int); -wxBUILTIN_TYPE_INFO( wxT_UINT , unsigned_int); -wxBUILTIN_TYPE_INFO( wxT_LONG , long); -wxBUILTIN_TYPE_INFO( wxT_ULONG , unsigned_long); -wxBUILTIN_TYPE_INFO( wxT_FLOAT , float); -wxBUILTIN_TYPE_INFO( wxT_DOUBLE , double); -wxBUILTIN_TYPE_INFO( wxT_STRING , wxString); - - -// this are compiler induced specialization which are never used anywhere - -wxILLEGAL_TYPE_SPECIALIZATION( char const * ) -wxILLEGAL_TYPE_SPECIALIZATION( char * ) -wxILLEGAL_TYPE_SPECIALIZATION( unsigned char * ) -wxILLEGAL_TYPE_SPECIALIZATION( int * ) -wxILLEGAL_TYPE_SPECIALIZATION( bool * ) -wxILLEGAL_TYPE_SPECIALIZATION( long * ) -wxILLEGAL_TYPE_SPECIALIZATION( wxString * ) - -wxCOLLECTION_TYPE_INFO( wxString , wxArrayString ) ; - -template<> void wxCollectionToVariantArray( wxArrayString const &theArray, wxxVariantArray &value) -{ - wxArrayCollectionToVariantArray( theArray , value ) ; -} - -wxTypeInfoMap *wxTypeInfo::ms_typeTable = NULL ; - -wxTypeInfo *wxTypeInfo::FindType(const wxChar *typeName) -{ - wxTypeInfoMap::iterator iter = ms_typeTable->find(typeName) ; - wxASSERT_MSG( iter != ms_typeTable->end() , wxT("lookup for a non-existent type-info") ) ; - return (wxTypeInfo *)iter->second; -} - -#if wxUSE_UNICODE -wxClassTypeInfo::wxClassTypeInfo( wxTypeKind kind , wxClassInfo* classInfo , converterToString_t to , converterFromString_t from , const char *name) : -wxTypeInfo( kind , to , from , name) -{ wxASSERT_MSG( kind == wxT_OBJECT_PTR || kind == wxT_OBJECT , wxT("Illegal Kind for Enum Type")) ; m_classInfo = classInfo ;} -#endif - -wxClassTypeInfo::wxClassTypeInfo( wxTypeKind kind , wxClassInfo* classInfo , converterToString_t to , converterFromString_t from , const wxString &name) : -wxTypeInfo( kind , to , from , name) -{ wxASSERT_MSG( kind == wxT_OBJECT_PTR || kind == wxT_OBJECT , wxT("Illegal Kind for Enum Type")) ; m_classInfo = classInfo ;} - -wxDelegateTypeInfo::wxDelegateTypeInfo( int eventType , wxClassInfo* eventClass , converterToString_t to , converterFromString_t from ) : -wxTypeInfo ( wxT_DELEGATE , to , from , wxEmptyString ) -{ m_eventClass = eventClass ; m_eventType = eventType ; m_lastEventType = -1 ;} - -wxDelegateTypeInfo::wxDelegateTypeInfo( int eventType , int lastEventType , wxClassInfo* eventClass , converterToString_t to , converterFromString_t from ) : -wxTypeInfo ( wxT_DELEGATE , to , from , wxEmptyString ) -{ m_eventClass = eventClass ; m_eventType = eventType ; m_lastEventType = lastEventType; } - -void wxTypeInfo::Register() -{ - if ( ms_typeTable == NULL ) - ms_typeTable = new wxTypeInfoMap() ; - - if( !m_name.empty() ) - (*ms_typeTable)[m_name] = this ; -} - -void wxTypeInfo::Unregister() -{ - if( !m_name.empty() ) - ms_typeTable->erase(m_name); -} - -// removing header dependancy on string tokenizer - -void wxSetStringToArray( const wxString &s , wxArrayString &array ) -{ - wxStringTokenizer tokenizer(s, wxT("| \t\n"), wxTOKEN_STRTOK); - wxString flag; - array.Clear() ; - while (tokenizer.HasMoreTokens()) - { - array.Add(tokenizer.GetNextToken()) ; - } -} - -// ---------------------------------------------------------------------------- -// wxClassInfo -// ---------------------------------------------------------------------------- - -wxPropertyInfo::~wxPropertyInfo() -{ - if ( this == m_itsClass->m_firstProperty ) - { - m_itsClass->m_firstProperty = m_next; - } - else - { - wxPropertyInfo *info = m_itsClass->m_firstProperty; - while (info) - { - if ( info->m_next == this ) - { - info->m_next = m_next; - break; - } - - info = info->m_next; - } - } -} - -wxHandlerInfo::~wxHandlerInfo() -{ - if ( this == m_itsClass->m_firstHandler ) - { - m_itsClass->m_firstHandler = m_next; - } - else - { - wxHandlerInfo *info = m_itsClass->m_firstHandler; - while (info) - { - if ( info->m_next == this ) - { - info->m_next = m_next; - break; - } - - info = info->m_next; - } - } -} - -const wxPropertyAccessor *wxClassInfo::FindAccessor(const wxChar *PropertyName) const -{ - const wxPropertyInfo* info = FindPropertyInfo( PropertyName ) ; - - if ( info ) - return info->GetAccessor() ; - - return NULL ; -} - -wxPropertyInfo *wxClassInfo::FindPropertyInfoInThisClass (const wxChar *PropertyName) const -{ - wxPropertyInfo* info = m_firstProperty ; - - while( info ) - { - if ( wxStrcmp( info->GetName() , PropertyName ) == 0 ) - return info ; - info = info->GetNext() ; - } - - return 0; -} - -const wxPropertyInfo *wxClassInfo::FindPropertyInfo (const wxChar *PropertyName) const -{ - const wxPropertyInfo* info = FindPropertyInfoInThisClass( PropertyName ) ; - if ( info ) - return info ; - - const wxClassInfo** parents = GetParents() ; - for ( int i = 0 ; parents[i] ; ++ i ) - { - if ( ( info = parents[i]->FindPropertyInfo( PropertyName ) ) != NULL ) - return info ; - } - - return 0; -} - -wxHandlerInfo *wxClassInfo::FindHandlerInfoInThisClass (const wxChar *PropertyName) const -{ - wxHandlerInfo* info = m_firstHandler ; - - while( info ) - { - if ( wxStrcmp( info->GetName() , PropertyName ) == 0 ) - return info ; - info = info->GetNext() ; - } - - return 0; -} - -const wxHandlerInfo *wxClassInfo::FindHandlerInfo (const wxChar *PropertyName) const -{ - const wxHandlerInfo* info = FindHandlerInfoInThisClass( PropertyName ) ; - - if ( info ) - return info ; - - const wxClassInfo** parents = GetParents() ; - for ( int i = 0 ; parents[i] ; ++ i ) - { - if ( ( info = parents[i]->FindHandlerInfo( PropertyName ) ) != NULL ) - return info ; - } - - return 0; -} - -wxObjectStreamingCallback wxClassInfo::GetStreamingCallback() const -{ - if ( m_streamingCallback ) - return m_streamingCallback ; - - wxObjectStreamingCallback retval = NULL ; - const wxClassInfo** parents = GetParents() ; - for ( int i = 0 ; parents[i] && retval == NULL ; ++ i ) - { - retval = parents[i]->GetStreamingCallback() ; - } - return retval ; -} - -bool wxClassInfo::BeforeWriteObject( const wxObject *obj, wxWriter *streamer , wxPersister *persister , wxxVariantArray &metadata) const -{ - wxObjectStreamingCallback sb = GetStreamingCallback() ; - if ( sb ) - return (*sb)(obj , streamer , persister , metadata ) ; - - return true ; -} - -void wxClassInfo::SetProperty(wxObject *object, const wxChar *propertyName, const wxxVariant &value) const -{ - const wxPropertyAccessor *accessor; - - accessor = FindAccessor(propertyName); - wxASSERT(accessor->HasSetter()); - accessor->SetProperty( object , value ) ; -} - -wxxVariant wxClassInfo::GetProperty(wxObject *object, const wxChar *propertyName) const -{ - const wxPropertyAccessor *accessor; - - accessor = FindAccessor(propertyName); - wxASSERT(accessor->HasGetter()); - wxxVariant result ; - accessor->GetProperty(object,result); - return result ; -} - -wxxVariantArray wxClassInfo::GetPropertyCollection(wxObject *object, const wxChar *propertyName) const -{ - const wxPropertyAccessor *accessor; - - accessor = FindAccessor(propertyName); - wxASSERT(accessor->HasGetter()); - wxxVariantArray result ; - accessor->GetPropertyCollection(object,result); - return result ; -} - -void wxClassInfo::AddToPropertyCollection(wxObject *object, const wxChar *propertyName , const wxxVariant& value) const -{ - const wxPropertyAccessor *accessor; - - accessor = FindAccessor(propertyName); - wxASSERT(accessor->HasAdder()); - accessor->AddToPropertyCollection( object , value ) ; -} - -// void wxClassInfo::GetProperties( wxPropertyInfoMap &map ) const -// The map parameter (the name map that is) seems something special -// to MSVC and so we use a other name. -void wxClassInfo::GetProperties( wxPropertyInfoMap &infomap ) const -{ - const wxPropertyInfo *pi = GetFirstProperty() ; - while( pi ) - { - if ( infomap.find( pi->GetName() ) == infomap.end() ) - infomap[pi->GetName()] = (wxPropertyInfo*) pi ; - - pi = pi->GetNext() ; - } - - const wxClassInfo** parents = GetParents() ; - for ( int i = 0 ; parents[i] ; ++ i ) - { - parents[i]->GetProperties( infomap ) ; - } -} - -/* -VARIANT TO OBJECT -*/ - -wxObject* wxxVariant::GetAsObject() -{ - const wxClassTypeInfo *ti = dynamic_cast( m_data->GetTypeInfo() ) ; - if ( ti ) - return ti->GetClassInfo()->VariantToInstance(*this) ; - else - return NULL ; -} - -// ---------------------------------------------------------------------------- -// wxDynamicObject support -// ---------------------------------------------------------------------------- -// -// Dynamic Objects are objects that have a real superclass instance and carry their -// own attributes in a hash map. Like this it is possible to create the objects and -// stream them, as if their class information was already available from compiled data - -struct wxDynamicObject::wxDynamicObjectInternal -{ - wxDynamicObjectInternal() {} - -#if wxUSE_UNICODE - map m_properties ; -#else - map m_properties ; -#endif -} ; - -typedef list< wxDynamicObject* > wxDynamicObjectList ; - -struct wxDynamicClassInfo::wxDynamicClassInfoInternal -{ - wxDynamicObjectList m_dynamicObjects ; -} ; - -// instantiates this object with an instance of its superclass -wxDynamicObject::wxDynamicObject(wxObject* superClassInstance, const wxDynamicClassInfo *info) -{ - m_superClassInstance = superClassInstance ; - m_classInfo = info ; - m_data = new wxDynamicObjectInternal ; -} - -wxDynamicObject::~wxDynamicObject() -{ - dynamic_cast(m_classInfo)->m_data->m_dynamicObjects.remove( this ) ; - delete m_data ; - delete m_superClassInstance ; -} - -void wxDynamicObject::SetProperty (const wxChar *propertyName, const wxxVariant &value) -{ - wxASSERT_MSG(m_classInfo->FindPropertyInfoInThisClass(propertyName),wxT("Accessing Unknown Property in a Dynamic Object") ) ; - m_data->m_properties[propertyName] = value ; -} - -wxxVariant wxDynamicObject::GetProperty (const wxChar *propertyName) const -{ - wxASSERT_MSG(m_classInfo->FindPropertyInfoInThisClass(propertyName),wxT("Accessing Unknown Property in a Dynamic Object") ) ; - return m_data->m_properties[propertyName] ; -} - -void wxDynamicObject::RemoveProperty( const wxChar *propertyName ) -{ - wxASSERT_MSG(m_classInfo->FindPropertyInfoInThisClass(propertyName),wxT("Removing Unknown Property in a Dynamic Object") ) ; - m_data->m_properties.erase( propertyName ) ; -} - -void wxDynamicObject::RenameProperty( const wxChar *oldPropertyName , const wxChar *newPropertyName ) -{ - wxASSERT_MSG(m_classInfo->FindPropertyInfoInThisClass(oldPropertyName),wxT("Renaming Unknown Property in a Dynamic Object") ) ; - wxxVariant value = m_data->m_properties[oldPropertyName] ; - m_data->m_properties.erase( oldPropertyName ) ; - m_data->m_properties[newPropertyName] = value ; -} - - -// ---------------------------------------------------------------------------- -// wxDynamiClassInfo -// ---------------------------------------------------------------------------- - -wxDynamicClassInfo::wxDynamicClassInfo( const wxChar *unitName, const wxChar *className , const wxClassInfo* superClass ) : -wxClassInfo( unitName, className , new const wxClassInfo*[2]) -{ - GetParents()[0] = superClass ; - GetParents()[1] = NULL ; - m_data = new wxDynamicClassInfoInternal ; -} - -wxDynamicClassInfo::~wxDynamicClassInfo() -{ - delete[] GetParents() ; - delete m_data ; -} - -wxObject *wxDynamicClassInfo::AllocateObject() const -{ - wxObject* parent = GetParents()[0]->AllocateObject() ; - wxDynamicObject *obj = new wxDynamicObject( parent , this ) ; - m_data->m_dynamicObjects.push_back( obj ) ; - return obj ; -} - -void wxDynamicClassInfo::Create (wxObject *object, int paramCount, wxxVariant *params) const -{ - wxDynamicObject *dynobj = dynamic_cast< wxDynamicObject *>( object ) ; - wxASSERT_MSG( dynobj , wxT("cannot call wxDynamicClassInfo::Create on an object other than wxDynamicObject") ) ; - GetParents()[0]->Create( dynobj->GetSuperClassInstance() , paramCount , params ) ; -} - -// get number of parameters for constructor -int wxDynamicClassInfo::GetCreateParamCount() const -{ - return GetParents()[0]->GetCreateParamCount() ; -} - -// get i-th constructor parameter -const wxChar* wxDynamicClassInfo::GetCreateParamName(int i) const -{ - return GetParents()[0]->GetCreateParamName( i ) ; -} - -void wxDynamicClassInfo::SetProperty(wxObject *object, const wxChar *propertyName, const wxxVariant &value) const -{ - wxDynamicObject* dynobj = dynamic_cast< wxDynamicObject * >( object ) ; - wxASSERT_MSG( dynobj , wxT("cannot call wxDynamicClassInfo::SetProperty on an object other than wxDynamicObject") ) ; - if ( FindPropertyInfoInThisClass(propertyName) ) - dynobj->SetProperty( propertyName , value ) ; - else - GetParents()[0]->SetProperty( dynobj->GetSuperClassInstance() , propertyName , value ) ; -} - -wxxVariant wxDynamicClassInfo::GetProperty(wxObject *object, const wxChar *propertyName) const -{ - wxDynamicObject* dynobj = dynamic_cast< wxDynamicObject * >( object ) ; - wxASSERT_MSG( dynobj , wxT("cannot call wxDynamicClassInfo::SetProperty on an object other than wxDynamicObject") ) ; - if ( FindPropertyInfoInThisClass(propertyName) ) - return dynobj->GetProperty( propertyName ) ; - else - return GetParents()[0]->GetProperty( dynobj->GetSuperClassInstance() , propertyName ) ; -} - -void wxDynamicClassInfo::AddProperty( const wxChar *propertyName , const wxTypeInfo* typeInfo ) -{ - new wxPropertyInfo( m_firstProperty , this , propertyName , typeInfo->GetTypeName() , new wxGenericPropertyAccessor( propertyName ) , wxxVariant() ) ; -} - -void wxDynamicClassInfo::AddHandler( const wxChar *handlerName , wxObjectEventFunction address , const wxClassInfo* eventClassInfo ) -{ - new wxHandlerInfo( m_firstHandler , this , handlerName , address , eventClassInfo ) ; -} - -// removes an existing runtime-property -void wxDynamicClassInfo::RemoveProperty( const wxChar *propertyName ) -{ - for ( wxDynamicObjectList::iterator iter = m_data->m_dynamicObjects.begin() ; iter != m_data->m_dynamicObjects.end() ; ++iter ) - (*iter)->RemoveProperty( propertyName ) ; - delete FindPropertyInfoInThisClass(propertyName) ; -} - -// removes an existing runtime-handler -void wxDynamicClassInfo::RemoveHandler( const wxChar *handlerName ) -{ - delete FindHandlerInfoInThisClass(handlerName) ; -} - -// renames an existing runtime-property -void wxDynamicClassInfo::RenameProperty( const wxChar *oldPropertyName , const wxChar *newPropertyName ) -{ - wxPropertyInfo* pi = FindPropertyInfoInThisClass(oldPropertyName) ; - wxASSERT_MSG( pi ,wxT("not existing property") ) ; - pi->m_name = newPropertyName ; - dynamic_cast(pi->GetAccessor())->RenameProperty( oldPropertyName , newPropertyName ) ; - for ( wxDynamicObjectList::iterator iter = m_data->m_dynamicObjects.begin() ; iter != m_data->m_dynamicObjects.end() ; ++iter ) - (*iter)->RenameProperty( oldPropertyName , newPropertyName ) ; -} - -// renames an existing runtime-handler -void wxDynamicClassInfo::RenameHandler( const wxChar *oldHandlerName , const wxChar *newHandlerName ) -{ - wxASSERT_MSG(FindHandlerInfoInThisClass(oldHandlerName),wxT("not existing handler") ) ; - FindHandlerInfoInThisClass(oldHandlerName)->m_name = newHandlerName ; -} - -// ---------------------------------------------------------------------------- -// wxGenericPropertyAccessor -// ---------------------------------------------------------------------------- - -struct wxGenericPropertyAccessor::wxGenericPropertyAccessorInternal -{ - char filler ; -} ; - -wxGenericPropertyAccessor::wxGenericPropertyAccessor( const wxString& propertyName ) -: wxPropertyAccessor( NULL , NULL , NULL , NULL ) -{ - m_data = new wxGenericPropertyAccessorInternal ; - m_propertyName = propertyName ; - m_getterName = wxT("Get")+propertyName ; - m_setterName = wxT("Set")+propertyName ; -} - -wxGenericPropertyAccessor::~wxGenericPropertyAccessor() -{ - delete m_data ; -} -void wxGenericPropertyAccessor::SetProperty(wxObject *object, const wxxVariant &value) const -{ - wxDynamicObject* dynobj = dynamic_cast< wxDynamicObject * >( object ) ; - wxASSERT_MSG( dynobj , wxT("cannot call wxDynamicClassInfo::SetProperty on an object other than wxDynamicObject") ) ; - dynobj->SetProperty(m_propertyName , value ) ; -} - -void wxGenericPropertyAccessor::GetProperty(const wxObject *object, wxxVariant& value) const -{ - const wxDynamicObject* dynobj = dynamic_cast< const wxDynamicObject * >( object ) ; - wxASSERT_MSG( dynobj , wxT("cannot call wxDynamicClassInfo::SetProperty on an object other than wxDynamicObject") ) ; - value = dynobj->GetProperty( m_propertyName ) ; -} - -#endif // wxUSE_EXTENDED_RTTI diff --git a/wxWidgets/src/common/xtistrm.cpp b/wxWidgets/src/common/xtistrm.cpp deleted file mode 100644 index eeb0cf4d5c..0000000000 --- a/wxWidgets/src/common/xtistrm.cpp +++ /dev/null @@ -1,847 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/common/xtistrm.cpp -// Purpose: streaming runtime metadata information -// Author: Stefan Csomor -// Modified by: -// Created: 27/07/03 -// RCS-ID: $Id: xtistrm.cpp 38939 2006-04-27 12:47:14Z ABX $ -// Copyright: (c) 2003 Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_EXTENDED_RTTI - -#include "wx/xtistrm.h" - -#ifndef WX_PRECOMP - #include "wx/object.h" - #include "wx/hash.h" - #include "wx/event.h" -#endif - -#include "wx/tokenzr.h" -#include "wx/txtstrm.h" - -#include "wx/beforestd.h" -#include -#include -#include -#include "wx/afterstd.h" - -using namespace std ; - -struct wxWriter::wxWriterInternal -{ - map< const wxObject* , int > m_writtenObjects ; - int m_nextId ; -} ; - -wxWriter::wxWriter() -{ - m_data = new wxWriterInternal ; - m_data->m_nextId = 0 ; -} - -wxWriter::~wxWriter() -{ - delete m_data ; -} - -struct wxWriter::wxWriterInternalPropertiesData -{ - char nothing ; -} ; - -void wxWriter::ClearObjectContext() -{ - delete m_data ; - m_data = new wxWriterInternal() ; - m_data->m_nextId = 0 ; -} - -void wxWriter::WriteObject(const wxObject *object, const wxClassInfo *classInfo , wxPersister *persister , const wxString &name , wxxVariantArray &metadata ) -{ - DoBeginWriteTopLevelEntry( name ) ; - WriteObject( object , classInfo , persister , false , metadata) ; - DoEndWriteTopLevelEntry( name ) ; -} - -void wxWriter::WriteObject(const wxObject *object, const wxClassInfo *classInfo , wxPersister *persister , bool isEmbedded, wxxVariantArray &metadata ) -{ - if ( !classInfo->BeforeWriteObject( object , this , persister , metadata) ) - return ; - - if ( persister->BeforeWriteObject( this , object , classInfo , metadata) ) - { - if ( object == NULL ) - DoWriteNullObject() ; - else if ( IsObjectKnown( object ) ) - DoWriteRepeatedObject( GetObjectID(object) ) ; - else - { - int oid = m_data->m_nextId++ ; - if ( !isEmbedded ) - m_data->m_writtenObjects[object] = oid ; - - // in case this object is a wxDynamicObject we also have to insert is superclass - // instance with the same id, so that object relations are streamed out correctly - const wxDynamicObject* dynobj = dynamic_cast( object ) ; - if ( !isEmbedded && dynobj ) - m_data->m_writtenObjects[dynobj->GetSuperClassInstance()] = oid ; - - DoBeginWriteObject( object , classInfo , oid , metadata ) ; - wxWriterInternalPropertiesData data ; - WriteAllProperties( object , classInfo , persister , &data ) ; - DoEndWriteObject( object , classInfo , oid ) ; - } - persister->AfterWriteObject( this ,object , classInfo ) ; - } -} - -void wxWriter::FindConnectEntry(const wxEvtHandler * evSource,const wxDelegateTypeInfo* dti, const wxObject* &sink , const wxHandlerInfo *&handler) -{ - wxList *dynamicEvents = evSource->GetDynamicEventTable() ; - - if ( dynamicEvents ) - { - wxList::compatibility_iterator node = dynamicEvents->GetFirst(); - while (node) - { - wxDynamicEventTableEntry *entry = (wxDynamicEventTableEntry*)node->GetData(); - - // find the match - if ( entry->m_fn && - (dti->GetEventType() == entry->m_eventType) && - (entry->m_id == -1 ) && - (entry->m_eventSink != NULL ) ) - { - sink = entry->m_eventSink ; - const wxClassInfo* sinkClassInfo = sink->GetClassInfo() ; - const wxHandlerInfo* sinkHandler = sinkClassInfo->GetFirstHandler() ; - while ( sinkHandler ) - { - if ( sinkHandler->GetEventFunction() == entry->m_fn ) - { - handler = sinkHandler ; - break ; - } - sinkHandler = sinkHandler->GetNext() ; - } - break ; - } - node = node->GetNext(); - } - } -} -void wxWriter::WriteAllProperties( const wxObject * obj , const wxClassInfo* ci , wxPersister *persister, wxWriterInternalPropertiesData * data ) -{ - wxPropertyInfoMap map ; - ci->GetProperties( map ) ; - for ( int i = 0 ; i < ci->GetCreateParamCount() ; ++i ) - { - wxString name = ci->GetCreateParamName(i) ; - const wxPropertyInfo* prop = map.find(name)->second ; - if ( prop ) - { - WriteOneProperty( obj , prop->GetDeclaringClass() , prop , persister , data ) ; - } - else - { - wxLogError( _("Create Parameter not found in declared RTTI Parameters") ) ; - } - map.erase( name ) ; - } - { // Extra block for broken compilers - for( wxPropertyInfoMap::iterator iter = map.begin() ; iter != map.end() ; ++iter ) - { - const wxPropertyInfo* prop = iter->second ; - if ( prop->GetFlags() & wxPROP_OBJECT_GRAPH ) - { - WriteOneProperty( obj , prop->GetDeclaringClass() , prop , persister , data ) ; - } - } - } - { // Extra block for broken compilers - for( wxPropertyInfoMap::iterator iter = map.begin() ; iter != map.end() ; ++iter ) - { - const wxPropertyInfo* prop = iter->second ; - if ( !(prop->GetFlags() & wxPROP_OBJECT_GRAPH) ) - { - WriteOneProperty( obj , prop->GetDeclaringClass() , prop , persister , data ) ; - } - } - } -} - -void wxWriter::WriteOneProperty( const wxObject *obj , const wxClassInfo* ci , const wxPropertyInfo* pi , wxPersister *persister , wxWriterInternalPropertiesData *WXUNUSED(data) ) -{ - if ( pi->GetFlags() & wxPROP_DONT_STREAM ) - return ; - - // make sure that we are picking the correct object for accessing the property - const wxDynamicObject* dynobj = dynamic_cast< const wxDynamicObject* > (obj ) ; - if ( dynobj && (dynamic_cast(ci) == NULL) ) - obj = dynobj->GetSuperClassInstance() ; - - if ( pi->GetTypeInfo()->GetKind() == wxT_COLLECTION ) - { - wxxVariantArray data ; - pi->GetAccessor()->GetPropertyCollection(obj, data) ; - const wxTypeInfo * elementType = dynamic_cast< const wxCollectionTypeInfo* >( pi->GetTypeInfo() )->GetElementType() ; - for ( size_t i = 0 ; i < data.GetCount() ; ++i ) - { - if ( i == 0 ) - DoBeginWriteProperty( pi ) ; - - DoBeginWriteElement() ; - wxxVariant value = data[i] ; - if ( persister->BeforeWriteProperty( this , obj, pi , value ) ) - { - const wxClassTypeInfo* cti = dynamic_cast< const wxClassTypeInfo* > ( elementType ) ; - if ( cti ) - { - const wxClassInfo* pci = cti->GetClassInfo() ; - wxObject *vobj = pci->VariantToInstance( value ) ; - wxxVariantArray md ; - WriteObject( vobj , (vobj ? vobj->GetClassInfo() : pci ) , persister , cti->GetKind()== wxT_OBJECT , md ) ; - } - else - { - DoWriteSimpleType( value ) ; - } - } - DoEndWriteElement() ; - if ( i == data.GetCount() - 1 ) - DoEndWriteProperty( pi ) ; - } - } - else - { - const wxDelegateTypeInfo* dti = dynamic_cast< const wxDelegateTypeInfo* > ( pi->GetTypeInfo() ) ; - if ( dti ) - { - const wxObject* sink = NULL ; - const wxHandlerInfo *handler = NULL ; - - const wxEvtHandler * evSource = dynamic_cast(obj) ; - if ( evSource ) - { - FindConnectEntry( evSource , dti , sink , handler ) ; - if ( persister->BeforeWriteDelegate( this , obj , ci , pi , sink , handler ) ) - { - if ( sink != NULL && handler != NULL ) - { - DoBeginWriteProperty( pi ) ; - if ( IsObjectKnown( sink ) ) - { - DoWriteDelegate( obj , ci , pi , sink , GetObjectID( sink ) , sink->GetClassInfo() , handler ) ; - DoEndWriteProperty( pi ) ; - } - else - { - wxLogError( _("Streaming delegates for not already streamed objects not yet supported") ) ; - } - } - } - } - else - { - wxLogError(_("Illegal Object Class (Non-wxEvtHandler) as Event Source") ) ; - } - } - else - { - wxxVariant value ; - pi->GetAccessor()->GetProperty(obj, value) ; - - // avoid streaming out void objects - if( value.IsEmpty() ) - return ; - - if ( pi->GetFlags() & wxPROP_ENUM_STORE_LONG ) - { - const wxEnumTypeInfo *eti = dynamic_cast( pi->GetTypeInfo() ) ; - if ( eti ) - { - eti->ConvertFromLong( value.wxTEMPLATED_MEMBER_CALL(Get , long) , value ) ; - } - else - { - wxLogError( _("Type must have enum - long conversion") ) ; - } - } - - // avoid streaming out default values - if ( pi->GetTypeInfo()->HasStringConverters() && !pi->GetDefaultValue().IsEmpty() ) - { - if ( value.GetAsString() == pi->GetDefaultValue().GetAsString() ) - return ; - } - - // avoid streaming out null objects - const wxClassTypeInfo* cti = dynamic_cast< const wxClassTypeInfo* > ( pi->GetTypeInfo() ) ; - - if ( cti && value.GetAsObject() == NULL ) - return ; - - if ( persister->BeforeWriteProperty( this , obj, pi , value ) ) - { - DoBeginWriteProperty( pi ) ; - if ( cti ) - { - const wxClassInfo* pci = cti->GetClassInfo() ; - wxObject *vobj = pci->VariantToInstance( value ) ; - if ( vobj && pi->GetTypeInfo()->HasStringConverters() ) - { - wxString stringValue ; - cti->ConvertToString( value , stringValue ) ; - wxxVariant convertedValue(stringValue) ; - DoWriteSimpleType( convertedValue ) ; - } - else - { - wxxVariantArray md ; - WriteObject( vobj , (vobj ? vobj->GetClassInfo() : pci ) , persister , cti->GetKind()== wxT_OBJECT , md) ; - } - } - else - { - DoWriteSimpleType( value ) ; - } - DoEndWriteProperty( pi ) ; - } - } - } -} - -int wxWriter::GetObjectID(const wxObject *obj) -{ - if ( !IsObjectKnown( obj ) ) - return wxInvalidObjectID ; - - return m_data->m_writtenObjects[obj] ; -} - -bool wxWriter::IsObjectKnown( const wxObject *obj ) -{ - return m_data->m_writtenObjects.find( obj ) != m_data->m_writtenObjects.end() ; -} - - -// ---------------------------------------------------------------------------- -// reading objects in -// ---------------------------------------------------------------------------- - -struct wxReader::wxReaderInternal -{ - map m_classInfos; -}; - -wxReader::wxReader() -{ - m_data = new wxReaderInternal; -} - -wxReader::~wxReader() -{ - delete m_data; -} - -wxClassInfo* wxReader::GetObjectClassInfo(int objectID) -{ - if ( objectID == wxNullObjectID || objectID == wxInvalidObjectID ) - { - wxLogError( _("Invalid or Null Object ID passed to GetObjectClassInfo" ) ) ; - return NULL ; - } - if ( m_data->m_classInfos.find(objectID) == m_data->m_classInfos.end() ) - { - wxLogError( _("Unknown Object passed to GetObjectClassInfo" ) ) ; - return NULL ; - } - return m_data->m_classInfos[objectID] ; -} - -void wxReader::SetObjectClassInfo(int objectID, wxClassInfo *classInfo ) -{ - if ( objectID == wxNullObjectID || objectID == wxInvalidObjectID ) - { - wxLogError( _("Invalid or Null Object ID passed to GetObjectClassInfo" ) ) ; - return ; - } - if ( m_data->m_classInfos.find(objectID) != m_data->m_classInfos.end() ) - { - wxLogError( _("Already Registered Object passed to SetObjectClassInfo" ) ) ; - return ; - } - m_data->m_classInfos[objectID] = classInfo ; -} - -bool wxReader::HasObjectClassInfo( int objectID ) -{ - if ( objectID == wxNullObjectID || objectID == wxInvalidObjectID ) - { - wxLogError( _("Invalid or Null Object ID passed to HasObjectClassInfo" ) ) ; - return NULL ; - } - return m_data->m_classInfos.find(objectID) != m_data->m_classInfos.end() ; -} - - -// ---------------------------------------------------------------------------- -// reading xml in -// ---------------------------------------------------------------------------- - -/* -Reading components has not to be extended for components -as properties are always sought by typeinfo over all levels -and create params are always toplevel class only -*/ - - -// ---------------------------------------------------------------------------- -// depersisting to memory -// ---------------------------------------------------------------------------- - -struct wxRuntimeDepersister::wxRuntimeDepersisterInternal -{ - map m_objects; - - void SetObject(int objectID, wxObject *obj ) - { - if ( m_objects.find(objectID) != m_objects.end() ) - { - wxLogError( _("Passing a already registered object to SetObject") ) ; - return ; - } - m_objects[objectID] = obj ; - } - wxObject* GetObject( int objectID ) - { - if ( objectID == wxNullObjectID ) - return NULL ; - if ( m_objects.find(objectID) == m_objects.end() ) - { - wxLogError( _("Passing an unkown object to GetObject") ) ; - return NULL ; - } - - return m_objects[objectID] ; - } -} ; - -wxRuntimeDepersister::wxRuntimeDepersister() -{ - m_data = new wxRuntimeDepersisterInternal() ; -} - -wxRuntimeDepersister::~wxRuntimeDepersister() -{ - delete m_data ; -} - -void wxRuntimeDepersister::AllocateObject(int objectID, wxClassInfo *classInfo , - wxxVariantArray &WXUNUSED(metadata)) -{ - wxObject *O; - O = classInfo->CreateObject(); - m_data->SetObject(objectID, O); -} - -void wxRuntimeDepersister::CreateObject(int objectID, - const wxClassInfo *classInfo, - int paramCount, - wxxVariant *params, - int *objectIdValues, - const wxClassInfo **objectClassInfos , - wxxVariantArray &WXUNUSED(metadata)) -{ - wxObject *o; - o = m_data->GetObject(objectID); - for ( int i = 0 ; i < paramCount ; ++i ) - { - if ( objectIdValues[i] != wxInvalidObjectID ) - { - wxObject *o; - o = m_data->GetObject(objectIdValues[i]); - // if this is a dynamic object and we are asked for another class - // than wxDynamicObject we cast it down manually. - wxDynamicObject *dyno = dynamic_cast< wxDynamicObject * > (o) ; - if ( dyno!=NULL && (objectClassInfos[i] != dyno->GetClassInfo()) ) - { - o = dyno->GetSuperClassInstance() ; - } - params[i] = objectClassInfos[i]->InstanceToVariant(o) ; - } - } - classInfo->Create(o, paramCount, params); -} - -void wxRuntimeDepersister::ConstructObject(int objectID, - const wxClassInfo *classInfo, - int paramCount, - wxxVariant *params, - int *objectIdValues, - const wxClassInfo **objectClassInfos , - wxxVariantArray &WXUNUSED(metadata)) -{ - wxObject *o; - for ( int i = 0 ; i < paramCount ; ++i ) - { - if ( objectIdValues[i] != wxInvalidObjectID ) - { - wxObject *o; - o = m_data->GetObject(objectIdValues[i]); - // if this is a dynamic object and we are asked for another class - // than wxDynamicObject we cast it down manually. - wxDynamicObject *dyno = dynamic_cast< wxDynamicObject * > (o) ; - if ( dyno!=NULL && (objectClassInfos[i] != dyno->GetClassInfo()) ) - { - o = dyno->GetSuperClassInstance() ; - } - params[i] = objectClassInfos[i]->InstanceToVariant(o) ; - } - } - o = classInfo->ConstructObject(paramCount, params); - m_data->SetObject(objectID, o); -} - - -void wxRuntimeDepersister::DestroyObject(int objectID, wxClassInfo *WXUNUSED(classInfo)) -{ - wxObject *o; - o = m_data->GetObject(objectID); - delete o ; -} - -void wxRuntimeDepersister::SetProperty(int objectID, - const wxClassInfo *classInfo, - const wxPropertyInfo* propertyInfo, - const wxxVariant &value) -{ - wxObject *o; - o = m_data->GetObject(objectID); - classInfo->SetProperty( o , propertyInfo->GetName() , value ) ; -} - -void wxRuntimeDepersister::SetPropertyAsObject(int objectID, - const wxClassInfo *classInfo, - const wxPropertyInfo* propertyInfo, - int valueObjectId) -{ - wxObject *o, *valo; - o = m_data->GetObject(objectID); - valo = m_data->GetObject(valueObjectId); - const wxClassInfo* valClassInfo = (dynamic_cast(propertyInfo->GetTypeInfo()))->GetClassInfo() ; - // if this is a dynamic object and we are asked for another class - // than wxDynamicObject we cast it down manually. - wxDynamicObject *dynvalo = dynamic_cast< wxDynamicObject * > (valo) ; - if ( dynvalo!=NULL && (valClassInfo != dynvalo->GetClassInfo()) ) - { - valo = dynvalo->GetSuperClassInstance() ; - } - - classInfo->SetProperty( o , propertyInfo->GetName() , valClassInfo->InstanceToVariant(valo) ) ; -} - -void wxRuntimeDepersister::SetConnect(int eventSourceObjectID, - const wxClassInfo *WXUNUSED(eventSourceClassInfo), - const wxPropertyInfo *delegateInfo , - const wxClassInfo *WXUNUSED(eventSinkClassInfo) , - const wxHandlerInfo* handlerInfo , - int eventSinkObjectID ) -{ - wxEvtHandler *ehsource = dynamic_cast< wxEvtHandler* >( m_data->GetObject( eventSourceObjectID ) ) ; - wxEvtHandler *ehsink = dynamic_cast< wxEvtHandler *>(m_data->GetObject(eventSinkObjectID) ) ; - - if ( ehsource && ehsink ) - { - const wxDelegateTypeInfo *delegateTypeInfo = dynamic_cast(delegateInfo->GetTypeInfo()); - if( delegateTypeInfo && delegateTypeInfo->GetLastEventType() == -1 ) - { - ehsource->Connect( -1 , delegateTypeInfo->GetEventType() , - handlerInfo->GetEventFunction() , NULL /*user data*/ , - ehsink ) ; - } - else - { - for ( wxEventType iter = delegateTypeInfo->GetEventType() ; iter <= delegateTypeInfo->GetLastEventType() ; ++iter ) - { - ehsource->Connect( -1 , iter , - handlerInfo->GetEventFunction() , NULL /*user data*/ , - ehsink ) ; - } - } - } -} - -wxObject *wxRuntimeDepersister::GetObject(int objectID) -{ - return m_data->GetObject( objectID ) ; -} - -// adds an element to a property collection -void wxRuntimeDepersister::AddToPropertyCollection( int objectID , - const wxClassInfo *classInfo, - const wxPropertyInfo* propertyInfo , - const wxxVariant &value) -{ - wxObject *o; - o = m_data->GetObject(objectID); - classInfo->AddToPropertyCollection( o , propertyInfo->GetName() , value ) ; -} - -// sets the corresponding property (value is an object) -void wxRuntimeDepersister::AddToPropertyCollectionAsObject(int objectID, - const wxClassInfo *classInfo, - const wxPropertyInfo* propertyInfo , - int valueObjectId) -{ - wxObject *o, *valo; - o = m_data->GetObject(objectID); - valo = m_data->GetObject(valueObjectId); - const wxCollectionTypeInfo * collectionTypeInfo = dynamic_cast< const wxCollectionTypeInfo * >(propertyInfo->GetTypeInfo() ) ; - const wxClassInfo* valClassInfo = (dynamic_cast(collectionTypeInfo->GetElementType()))->GetClassInfo() ; - // if this is a dynamic object and we are asked for another class - // than wxDynamicObject we cast it down manually. - wxDynamicObject *dynvalo = dynamic_cast< wxDynamicObject * > (valo) ; - if ( dynvalo!=NULL && (valClassInfo != dynvalo->GetClassInfo()) ) - { - valo = dynvalo->GetSuperClassInstance() ; - } - - classInfo->AddToPropertyCollection( o , propertyInfo->GetName() , valClassInfo->InstanceToVariant(valo) ) ; -} - -// ---------------------------------------------------------------------------- -// depersisting to code -// ---------------------------------------------------------------------------- - -struct wxCodeDepersister::wxCodeDepersisterInternal -{ -#if wxUSE_UNICODE - map m_objectNames ; -#else - map m_objectNames ; -#endif - - void SetObjectName(int objectID, const wxString &name ) - { - if ( m_objectNames.find(objectID) != m_objectNames.end() ) - { - wxLogError( _("Passing a already registered object to SetObjectName") ) ; - return ; - } - m_objectNames[objectID] = (const wxChar *)name; - } - - wxString GetObjectName( int objectID ) - { - if ( objectID == wxNullObjectID ) - return wxT("NULL") ; - - if ( m_objectNames.find(objectID) == m_objectNames.end() ) - { - wxLogError( _("Passing an unkown object to GetObject") ) ; - return wxEmptyString ; - } - return wxString( m_objectNames[objectID].c_str() ) ; - } -} ; - -wxCodeDepersister::wxCodeDepersister(wxTextOutputStream *out) -: m_fp(out) -{ - m_data = new wxCodeDepersisterInternal ; -} - -wxCodeDepersister::~wxCodeDepersister() -{ - delete m_data ; -} - -void wxCodeDepersister::AllocateObject(int objectID, wxClassInfo *classInfo , - wxxVariantArray &WXUNUSED(metadata)) -{ - wxString objectName = wxString::Format( wxT("LocalObject_%d") , objectID ) ; - m_fp->WriteString( wxString::Format( wxT("\t%s *%s = new %s;\n"), - classInfo->GetClassName(), - objectName.c_str(), - classInfo->GetClassName()) ); - m_data->SetObjectName( objectID , objectName ) ; -} - -void wxCodeDepersister::DestroyObject(int objectID, wxClassInfo *WXUNUSED(classInfo)) -{ - m_fp->WriteString( wxString::Format( wxT("\tdelete %s;\n"), - m_data->GetObjectName( objectID).c_str() ) ); -} - -wxString wxCodeDepersister::ValueAsCode( const wxxVariant ¶m ) -{ - wxString value ; - const wxTypeInfo* type = param.GetTypeInfo() ; - if ( type->GetKind() == wxT_CUSTOM ) - { - const wxCustomTypeInfo* cti = dynamic_cast(type) ; - if ( cti ) - { - value.Printf( wxT("%s(%s)"), cti->GetTypeName().c_str(),param.GetAsString().c_str() ); - } - else - { - wxLogError ( _("Internal error, illegal wxCustomTypeInfo") ) ; - } - } - else if ( type->GetKind() == wxT_STRING ) - { - value.Printf( wxT("\"%s\""),param.GetAsString().c_str() ); - } - else - { - value.Printf( wxT("%s"), param.GetAsString().c_str() ); - } - return value ; -} - -void wxCodeDepersister::CreateObject(int objectID, - const wxClassInfo *WXUNUSED(classInfo), - int paramCount, - wxxVariant *params, - int *objectIDValues, - const wxClassInfo **WXUNUSED(objectClassInfos) , - wxxVariantArray &WXUNUSED(metadata) - ) -{ - int i; - m_fp->WriteString( wxString::Format( wxT("\t%s->Create("), m_data->GetObjectName(objectID).c_str() ) ); - for (i = 0; i < paramCount; i++) - { - if ( objectIDValues[i] != wxInvalidObjectID ) - m_fp->WriteString( wxString::Format( wxT("%s"), m_data->GetObjectName( objectIDValues[i] ).c_str() ) ); - else - { - m_fp->WriteString( wxString::Format( wxT("%s"), ValueAsCode(params[i]).c_str() ) ); - } - if (i < paramCount - 1) - m_fp->WriteString( wxT(", ")); - } - m_fp->WriteString( wxT(");\n") ); -} - -void wxCodeDepersister::ConstructObject(int objectID, - const wxClassInfo *classInfo, - int paramCount, - wxxVariant *params, - int *objectIDValues, - const wxClassInfo **WXUNUSED(objectClassInfos) , - wxxVariantArray &WXUNUSED(metadata) - ) -{ - wxString objectName = wxString::Format( wxT("LocalObject_%d") , objectID ) ; - m_fp->WriteString( wxString::Format( wxT("\t%s *%s = new %s("), - classInfo->GetClassName(), - objectName.c_str(), - classInfo->GetClassName()) ); - m_data->SetObjectName( objectID , objectName ) ; - - int i; - for (i = 0; i < paramCount; i++) - { - if ( objectIDValues[i] != wxInvalidObjectID ) - m_fp->WriteString( wxString::Format( wxT("%s"), m_data->GetObjectName( objectIDValues[i] ).c_str() ) ); - else - { - m_fp->WriteString( wxString::Format( wxT("%s"), ValueAsCode(params[i]).c_str() ) ); - } - if (i < paramCount - 1) - m_fp->WriteString( wxT(", ") ); - } - m_fp->WriteString( wxT(");\n") ); -} - -void wxCodeDepersister::SetProperty(int objectID, - const wxClassInfo *WXUNUSED(classInfo), - const wxPropertyInfo* propertyInfo, - const wxxVariant &value) -{ - m_fp->WriteString( wxString::Format( wxT("\t%s->%s(%s);\n"), - m_data->GetObjectName(objectID).c_str(), - propertyInfo->GetAccessor()->GetSetterName().c_str(), - ValueAsCode(value).c_str()) ); -} - -void wxCodeDepersister::SetPropertyAsObject(int objectID, - const wxClassInfo *WXUNUSED(classInfo), - const wxPropertyInfo* propertyInfo, - int valueObjectId) -{ - if ( propertyInfo->GetTypeInfo()->GetKind() == wxT_OBJECT ) - m_fp->WriteString( wxString::Format( wxT("\t%s->%s(*%s);\n"), - m_data->GetObjectName(objectID).c_str(), - propertyInfo->GetAccessor()->GetSetterName().c_str(), - m_data->GetObjectName( valueObjectId).c_str() ) ); - else - m_fp->WriteString( wxString::Format( wxT("\t%s->%s(%s);\n"), - m_data->GetObjectName(objectID).c_str(), - propertyInfo->GetAccessor()->GetSetterName().c_str(), - m_data->GetObjectName( valueObjectId).c_str() ) ); -} - -void wxCodeDepersister::AddToPropertyCollection( int objectID , - const wxClassInfo *WXUNUSED(classInfo), - const wxPropertyInfo* propertyInfo , - const wxxVariant &value) -{ - m_fp->WriteString( wxString::Format( wxT("\t%s->%s(%s);\n"), - m_data->GetObjectName(objectID).c_str(), - propertyInfo->GetAccessor()->GetAdderName().c_str(), - ValueAsCode(value).c_str()) ); -} - -// sets the corresponding property (value is an object) -void wxCodeDepersister::AddToPropertyCollectionAsObject(int WXUNUSED(objectID), - const wxClassInfo *WXUNUSED(classInfo), - const wxPropertyInfo* WXUNUSED(propertyInfo) , - int WXUNUSED(valueObjectId)) -{ - // TODO -} - -void wxCodeDepersister::SetConnect(int eventSourceObjectID, - const wxClassInfo *WXUNUSED(eventSourceClassInfo), - const wxPropertyInfo *delegateInfo , - const wxClassInfo *eventSinkClassInfo , - const wxHandlerInfo* handlerInfo , - int eventSinkObjectID ) -{ - wxString ehsource = m_data->GetObjectName( eventSourceObjectID ) ; - wxString ehsink = m_data->GetObjectName(eventSinkObjectID) ; - wxString ehsinkClass = eventSinkClassInfo->GetClassName() ; - const wxDelegateTypeInfo *delegateTypeInfo = dynamic_cast(delegateInfo->GetTypeInfo()); - if ( delegateTypeInfo ) - { - int eventType = delegateTypeInfo->GetEventType() ; - wxString handlerName = handlerInfo->GetName() ; - - m_fp->WriteString( wxString::Format( wxT("\t%s->Connect( %s->GetId() , %d , (wxObjectEventFunction)(wxEventFunction) & %s::%s , NULL , %s ) ;") , - ehsource.c_str() , ehsource.c_str() , eventType , ehsinkClass.c_str() , handlerName.c_str() , ehsink.c_str() ) ); - } - else - { - wxLogError(_("delegate has no type info")); - } -} - -#include "wx/arrimpl.cpp" - -WX_DEFINE_OBJARRAY(wxxVariantArray); - -#endif // wxUSE_EXTENDED_RTTI diff --git a/wxWidgets/src/common/xtixml.cpp b/wxWidgets/src/common/xtixml.cpp deleted file mode 100644 index d229071cad..0000000000 --- a/wxWidgets/src/common/xtixml.cpp +++ /dev/null @@ -1,538 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/common/xtixml.cpp -// Purpose: streaming runtime metadata information -// Author: Stefan Csomor -// Modified by: -// Created: 27/07/03 -// RCS-ID: $Id: xtixml.cpp 38939 2006-04-27 12:47:14Z ABX $ -// Copyright: (c) 2003 Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_EXTENDED_RTTI - -#include "wx/xtixml.h" - -#ifndef WX_PRECOMP - #include "wx/object.h" - #include "wx/hash.h" - #include "wx/event.h" -#endif - -#include "wx/xml/xml.h" -#include "wx/tokenzr.h" -#include "wx/txtstrm.h" - -#include "wx/xtistrm.h" - -#include "wx/beforestd.h" -#include -#include -#include -#include "wx/afterstd.h" - -using namespace std ; - -// -// XML Streaming -// - -// convenience functions - -void wxXmlAddContentToNode( wxXmlNode* node , const wxString& data ) -{ - node->AddChild(new wxXmlNode(wxXML_TEXT_NODE, wxT("value"), data ) ); -} - -wxString wxXmlGetContentFromNode( wxXmlNode *node ) -{ - if ( node->GetChildren() ) - return node->GetChildren()->GetContent() ; - else - return wxEmptyString ; -} - -struct wxXmlWriter::wxXmlWriterInternal -{ - wxXmlNode *m_root ; - wxXmlNode *m_current ; - vector< wxXmlNode * > m_objectStack ; - - void Push( wxXmlNode *newCurrent ) - { - m_objectStack.push_back( m_current ) ; - m_current = newCurrent ; - } - - void Pop() - { - m_current = m_objectStack.back() ; - m_objectStack.pop_back() ; - } -} ; - -wxXmlWriter::wxXmlWriter( wxXmlNode * rootnode ) -{ - m_data = new wxXmlWriterInternal() ; - m_data->m_root = rootnode ; - m_data->m_current = rootnode ; -} - -wxXmlWriter::~wxXmlWriter() -{ - delete m_data ; -} - -void wxXmlWriter::DoBeginWriteTopLevelEntry( const wxString &name ) -{ - wxXmlNode *pnode; - pnode = new wxXmlNode(wxXML_ELEMENT_NODE, wxT("entry")); - pnode->AddProperty(wxString(wxT("name")), name); - m_data->m_current->AddChild(pnode) ; - m_data->Push( pnode ) ; -} - -void wxXmlWriter::DoEndWriteTopLevelEntry( const wxString &WXUNUSED(name) ) -{ - m_data->Pop() ; -} - -void wxXmlWriter::DoBeginWriteObject(const wxObject *WXUNUSED(object), const wxClassInfo *classInfo, int objectID , wxxVariantArray &metadata ) -{ - wxXmlNode *pnode; - pnode = new wxXmlNode(wxXML_ELEMENT_NODE, wxT("object")); - pnode->AddProperty(wxT("class"), wxString(classInfo->GetClassName())); - pnode->AddProperty(wxT("id"), wxString::Format( wxT("%d") , objectID ) ); - - for ( size_t i = 0 ; i < metadata.GetCount() ; ++i ) - { - pnode->AddProperty( metadata[i].GetName() , metadata[i].GetAsString() ) ; - } - m_data->m_current->AddChild(pnode) ; - m_data->Push( pnode ) ; -} - -// end of writing the root object -void wxXmlWriter::DoEndWriteObject(const wxObject *WXUNUSED(object), const wxClassInfo *WXUNUSED(classInfo), int WXUNUSED(objectID) ) -{ - m_data->Pop() ; -} - -// writes a property in the stream format -void wxXmlWriter::DoWriteSimpleType( wxxVariant &value ) -{ - wxXmlAddContentToNode( m_data->m_current ,value.GetAsString() ) ; -} - -void wxXmlWriter::DoBeginWriteElement() -{ - wxXmlNode *pnode; - pnode = new wxXmlNode(wxXML_ELEMENT_NODE, wxT("element") ); - m_data->m_current->AddChild(pnode) ; - m_data->Push( pnode ) ; -} - -void wxXmlWriter::DoEndWriteElement() -{ - m_data->Pop() ; -} - -void wxXmlWriter::DoBeginWriteProperty(const wxPropertyInfo *pi ) -{ - wxXmlNode *pnode; - pnode = new wxXmlNode(wxXML_ELEMENT_NODE, wxT("prop") ); - pnode->AddProperty(wxT("name"), pi->GetName() ); - m_data->m_current->AddChild(pnode) ; - m_data->Push( pnode ) ; -} - -void wxXmlWriter::DoEndWriteProperty(const wxPropertyInfo *WXUNUSED(propInfo) ) -{ - m_data->Pop() ; -} - - - -// insert an object reference to an already written object -void wxXmlWriter::DoWriteRepeatedObject( int objectID ) -{ - wxXmlNode *pnode; - pnode = new wxXmlNode(wxXML_ELEMENT_NODE, wxT("object")); - pnode->AddProperty(wxString(wxT("href")), wxString::Format( wxT("%d") , objectID ) ); - m_data->m_current->AddChild(pnode) ; -} - -// insert a null reference -void wxXmlWriter::DoWriteNullObject() -{ - wxXmlNode *pnode; - pnode = new wxXmlNode(wxXML_ELEMENT_NODE, wxT("object")); - m_data->m_current->AddChild(pnode) ; -} - -// writes a delegate in the stream format -void wxXmlWriter::DoWriteDelegate( const wxObject *WXUNUSED(object), const wxClassInfo* WXUNUSED(classInfo) , const wxPropertyInfo *WXUNUSED(pi) , - const wxObject *eventSink, int sinkObjectID , const wxClassInfo* WXUNUSED(eventSinkClassInfo) , const wxHandlerInfo* handlerInfo ) -{ - if ( eventSink != NULL && handlerInfo != NULL ) - { - wxXmlAddContentToNode( m_data->m_current ,wxString::Format(wxT("%d.%s"), sinkObjectID , handlerInfo->GetName().c_str()) ) ; - } -} - -// ---------------------------------------------------------------------------- -// reading objects in -// ---------------------------------------------------------------------------- - - - -// ---------------------------------------------------------------------------- -// reading xml in -// ---------------------------------------------------------------------------- - -/* -Reading components has not to be extended for components -as properties are always sought by typeinfo over all levels -and create params are always toplevel class only -*/ - -int wxXmlReader::ReadComponent(wxXmlNode *node, wxDepersister *callbacks) -{ - wxASSERT_MSG( callbacks , wxT("Does not support reading without a Depersistor") ) ; - wxString className; - wxClassInfo *classInfo; - - wxxVariant *createParams ; - int *createParamOids ; - const wxClassInfo** createClassInfos ; - wxXmlNode *children; - int objectID; - wxString ObjectIdString ; - - children = node->GetChildren(); - if (!children) - { - // check for a null object or href - if (node->GetPropVal(wxT("href") , &ObjectIdString ) ) - { - objectID = atoi( ObjectIdString.ToAscii() ) ; - if ( HasObjectClassInfo( objectID ) ) - { - return objectID ; - } - else - { - wxLogError( _("Forward hrefs are not supported") ) ; - return wxInvalidObjectID ; - } - } - if ( !node->GetPropVal(wxT("id") , &ObjectIdString ) ) - { - return wxNullObjectID; - } - } - if (!node->GetPropVal(wxT("class"), &className)) - { - // No class name. Eek. FIXME: error handling - return wxInvalidObjectID; - } - classInfo = wxClassInfo::FindClass(className); - if ( classInfo == NULL ) - { - wxLogError( wxString::Format(_("unknown class %s"),className ) ) ; - return wxInvalidObjectID ; - } - - if ( children != NULL && children->GetType() == wxXML_TEXT_NODE ) - { - wxLogError(_("objects cannot have XML Text Nodes") ) ; - return wxInvalidObjectID; - } - if (!node->GetPropVal(wxT("id"), &ObjectIdString)) - { - wxLogError(_("Objects must have an id attribute") ) ; - // No object id. Eek. FIXME: error handling - return wxInvalidObjectID; - } - objectID = atoi( ObjectIdString.ToAscii() ) ; - // is this object already has been streamed in, return it here - if ( HasObjectClassInfo( objectID ) ) - { - wxLogError ( wxString::Format(_("Doubly used id : %d"), objectID ) ) ; - return wxInvalidObjectID ; - } - - // new object, start with allocation - // first make the object know to our internal registry - SetObjectClassInfo( objectID , classInfo ) ; - - wxxVariantArray metadata ; - wxXmlProperty *xp = node->GetProperties() ; - while ( xp ) - { - if ( xp->GetName() != wxString(wxT("class")) && xp->GetName() != wxString(wxT("id")) ) - { - metadata.Add( new wxxVariant( xp->GetValue() , xp->GetName() ) ) ; - } - xp = xp->GetNext() ; - } - if ( !classInfo->NeedsDirectConstruction() ) - callbacks->AllocateObject(objectID, classInfo, metadata); - - // - // stream back the Create parameters first - createParams = new wxxVariant[ classInfo->GetCreateParamCount() ] ; - createParamOids = new int[classInfo->GetCreateParamCount() ] ; - createClassInfos = new const wxClassInfo*[classInfo->GetCreateParamCount() ] ; - -#if wxUSE_UNICODE - typedef map PropertyNodes ; - typedef vector PropertyNames ; -#else - typedef map PropertyNodes ; - typedef vector PropertyNames ; -#endif - PropertyNodes propertyNodes ; - PropertyNames propertyNames ; - - while( children ) - { - wxString name ; - children->GetPropVal( wxT("name") , &name ) ; - propertyNames.push_back( name.c_str() ) ; - propertyNodes[name.c_str()] = children->GetChildren() ; - children = children->GetNext() ; - } - - for ( int i = 0 ; i GetCreateParamCount() ; ++i ) - { - const wxChar* paramName = classInfo->GetCreateParamName(i) ; - PropertyNodes::iterator propiter = propertyNodes.find( paramName ) ; - const wxPropertyInfo* pi = classInfo->FindPropertyInfo( paramName ) ; - if ( pi == 0 ) - { - wxLogError( wxString::Format(_("Unkown Property %s"),paramName) ) ; - } - // if we don't have the value of a create param set in the xml - // we use the default value - if ( propiter != propertyNodes.end() ) - { - wxXmlNode* prop = propiter->second ; - if ( pi->GetTypeInfo()->IsObjectType() ) - { - createParamOids[i] = ReadComponent( prop , callbacks ) ; - createClassInfos[i] = dynamic_cast(pi->GetTypeInfo())->GetClassInfo() ; - } - else - { - createParamOids[i] = wxInvalidObjectID ; - createParams[i] = ReadValue( prop , pi->GetTypeInfo() ) ; - if( pi->GetFlags() & wxPROP_ENUM_STORE_LONG ) - { - const wxEnumTypeInfo *eti = dynamic_cast( pi->GetTypeInfo() ) ; - if ( eti ) - { - long realval ; - eti->ConvertToLong( createParams[i] , realval ) ; - createParams[i] = wxxVariant( realval ) ; - } - else - { - wxLogError( _("Type must have enum - long conversion") ) ; - } - } - createClassInfos[i] = NULL ; - } - - for ( size_t j = 0 ; j < propertyNames.size() ; ++j ) - { - if ( propertyNames[j] == paramName ) - { - propertyNames[j] = wxEmptyString ; - break ; - } - } - } - else - { - if ( pi->GetTypeInfo()->IsObjectType() ) - { - createParamOids[i] = wxNullObjectID ; - createClassInfos[i] = dynamic_cast(pi->GetTypeInfo())->GetClassInfo() ; - } - else - { - createParams[i] = pi->GetDefaultValue() ; - createParamOids[i] = wxInvalidObjectID ; - } - } - } - - // got the parameters. Call the Create method - if ( classInfo->NeedsDirectConstruction() ) - callbacks->ConstructObject(objectID, classInfo, - classInfo->GetCreateParamCount(), - createParams, createParamOids, createClassInfos, metadata ); - else - callbacks->CreateObject(objectID, classInfo, - classInfo->GetCreateParamCount(), - createParams, createParamOids, createClassInfos, metadata ); - - // now stream in the rest of the properties, in the sequence their properties were written in the xml - for ( size_t j = 0 ; j < propertyNames.size() ; ++j ) - { - if ( propertyNames[j].length() ) - { - PropertyNodes::iterator propiter = propertyNodes.find( propertyNames[j] ) ; - if ( propiter != propertyNodes.end() ) - { - wxXmlNode* prop = propiter->second ; - const wxPropertyInfo* pi = classInfo->FindPropertyInfo( propertyNames[j].c_str() ) ; - if ( pi->GetTypeInfo()->GetKind() == wxT_COLLECTION ) - { - const wxCollectionTypeInfo* collType = dynamic_cast< const wxCollectionTypeInfo* >( pi->GetTypeInfo() ) ; - const wxTypeInfo * elementType = collType->GetElementType() ; - while( prop ) - { - if ( prop->GetName() != wxT("element") ) - { - wxLogError( _("A non empty collection must consist of 'element' nodes" ) ) ; - break ; - } - wxXmlNode* elementContent = prop->GetChildren() ; - if ( elementContent ) - { - // we skip empty elements - if ( elementType->IsObjectType() ) - { - int valueId = ReadComponent( elementContent , callbacks ) ; - if ( valueId != wxInvalidObjectID ) - { - if ( pi->GetAccessor()->HasAdder() ) - callbacks->AddToPropertyCollectionAsObject( objectID , classInfo , pi , valueId ) ; - // TODO for collections we must have a notation on taking over ownership or not - if ( elementType->GetKind() == wxT_OBJECT && valueId != wxNullObjectID ) - callbacks->DestroyObject( valueId , GetObjectClassInfo( valueId ) ) ; - } - } - else - { - wxxVariant elementValue = ReadValue( elementContent , elementType ) ; - if ( pi->GetAccessor()->HasAdder() ) - callbacks->AddToPropertyCollection( objectID , classInfo ,pi , elementValue ) ; - } - } - prop = prop->GetNext() ; - } - } - else if ( pi->GetTypeInfo()->IsObjectType() ) - { - // and object can either be streamed out a string or as an object - // in case we have no node, then the object's streaming out has been vetoed - if ( prop ) - { - if ( prop->GetName() == wxT("object") ) - { - int valueId = ReadComponent( prop , callbacks ) ; - if ( valueId != wxInvalidObjectID ) - { - callbacks->SetPropertyAsObject( objectID , classInfo , pi , valueId ) ; - if ( pi->GetTypeInfo()->GetKind() == wxT_OBJECT && valueId != wxNullObjectID ) - callbacks->DestroyObject( valueId , GetObjectClassInfo( valueId ) ) ; - } - } - else - { - wxASSERT( pi->GetTypeInfo()->HasStringConverters() ) ; - wxxVariant nodeval = ReadValue( prop , pi->GetTypeInfo() ) ; - callbacks->SetProperty( objectID, classInfo ,pi , nodeval ) ; - } - } - } - else if ( pi->GetTypeInfo()->IsDelegateType() ) - { - if ( prop ) - { - wxString resstring = prop->GetContent() ; - wxInt32 pos = resstring.Find('.') ; - if ( pos != wxNOT_FOUND ) - { - int sinkOid = atol(resstring.Left(pos).ToAscii()) ; - wxString handlerName = resstring.Mid(pos+1) ; - wxClassInfo* sinkClassInfo = GetObjectClassInfo( sinkOid ) ; - - callbacks->SetConnect( objectID , classInfo , pi , sinkClassInfo , - sinkClassInfo->FindHandlerInfo(handlerName) , sinkOid ) ; - } - else - { - wxLogError( _("incorrect event handler string, missing dot") ) ; - } - } - - } - else - { - wxxVariant nodeval = ReadValue( prop , pi->GetTypeInfo() ) ; - if( pi->GetFlags() & wxPROP_ENUM_STORE_LONG ) - { - const wxEnumTypeInfo *eti = dynamic_cast( pi->GetTypeInfo() ) ; - if ( eti ) - { - long realval ; - eti->ConvertToLong( nodeval , realval ) ; - nodeval = wxxVariant( realval ) ; - } - else - { - wxLogError( _("Type must have enum - long conversion") ) ; - } - } - callbacks->SetProperty( objectID, classInfo ,pi , nodeval ) ; - } - } - } - } - - delete[] createParams ; - delete[] createParamOids ; - delete[] createClassInfos ; - - return objectID; -} - -wxxVariant wxXmlReader::ReadValue(wxXmlNode *node, - const wxTypeInfo *type ) -{ - wxString content ; - if ( node ) - content = node->GetContent() ; - wxxVariant result ; - type->ConvertFromString( content , result ) ; - return result ; -} - -int wxXmlReader::ReadObject( const wxString &name , wxDepersister *callbacks) -{ - wxXmlNode *iter = m_parent->GetChildren() ; - while ( iter ) - { - wxString entryName ; - if ( iter->GetPropVal(wxT("name"), &entryName) ) - { - if ( entryName == name ) - return ReadComponent( iter->GetChildren() , callbacks ) ; - } - iter = iter->GetNext() ; - } - return wxInvalidObjectID ; -} - -#endif // wxUSE_EXTENDED_RTTI diff --git a/wxWidgets/src/common/zipstrm.cpp b/wxWidgets/src/common/zipstrm.cpp deleted file mode 100644 index a77df8dc8e..0000000000 --- a/wxWidgets/src/common/zipstrm.cpp +++ /dev/null @@ -1,2425 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/common/zipstrm.cpp -// Purpose: Streams for Zip files -// Author: Mike Wetherell -// RCS-ID: $Id: zipstrm.cpp 51009 2008-01-03 17:11:45Z MW $ -// Copyright: (c) Mike Wetherell -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_ZIPSTREAM - -#include "wx/zipstrm.h" - -#ifndef WX_PRECOMP - #include "wx/hashmap.h" - #include "wx/intl.h" - #include "wx/log.h" - #include "wx/utils.h" -#endif - -#include "wx/datstrm.h" -#include "wx/zstream.h" -#include "wx/mstream.h" -#include "wx/ptr_scpd.h" -#include "wx/wfstream.h" -#include "zlib.h" - -// value for the 'version needed to extract' field (20 means 2.0) -enum { - VERSION_NEEDED_TO_EXTRACT = 20 -}; - -// signatures for the various records (PKxx) -enum { - CENTRAL_MAGIC = 0x02014b50, // central directory record - LOCAL_MAGIC = 0x04034b50, // local header - END_MAGIC = 0x06054b50, // end of central directory record - SUMS_MAGIC = 0x08074b50 // data descriptor (info-zip) -}; - -// unix file attributes. zip stores them in the high 16 bits of the -// 'external attributes' field, hence the extra zeros. -enum { - wxZIP_S_IFMT = 0xF0000000, - wxZIP_S_IFDIR = 0x40000000, - wxZIP_S_IFREG = 0x80000000 -}; - -// minimum sizes for the various records -enum { - CENTRAL_SIZE = 46, - LOCAL_SIZE = 30, - END_SIZE = 22, - SUMS_SIZE = 12 -}; - -// The number of bytes that must be written to an wxZipOutputStream before -// a zip entry is created. The purpose of this latency is so that -// OpenCompressor() can see a little data before deciding which compressor -// it should use. -enum { - OUTPUT_LATENCY = 4096 -}; - -// Some offsets into the local header -enum { - SUMS_OFFSET = 14 -}; - -IMPLEMENT_DYNAMIC_CLASS(wxZipEntry, wxArchiveEntry) -IMPLEMENT_DYNAMIC_CLASS(wxZipClassFactory, wxArchiveClassFactory) - - -///////////////////////////////////////////////////////////////////////////// -// Helpers - -// read a string of a given length -// -static wxString ReadString(wxInputStream& stream, wxUint16 len, wxMBConv& conv) -{ - if (len == 0) - return wxEmptyString; - -#if wxUSE_UNICODE - wxCharBuffer buf(len); - stream.Read(buf.data(), len); - wxString str(buf, conv); -#else - wxString str; - (void)conv; - { - wxStringBuffer buf(str, len); - stream.Read(buf, len); - } -#endif - - return str; -} - -// Decode a little endian wxUint32 number from a character array -// -static inline wxUint32 CrackUint32(const char *m) -{ - const unsigned char *n = (const unsigned char*)m; - return (n[3] << 24) | (n[2] << 16) | (n[1] << 8) | n[0]; -} - -// Decode a little endian wxUint16 number from a character array -// -static inline wxUint16 CrackUint16(const char *m) -{ - const unsigned char *n = (const unsigned char*)m; - return (n[1] << 8) | n[0]; -} - -// Temporarily lower the logging level in debug mode to avoid a warning -// from SeekI about seeking on a stream with data written back to it. -// -static wxFileOffset QuietSeek(wxInputStream& stream, wxFileOffset pos) -{ -#if defined(__WXDEBUG__) && wxUSE_LOG - wxLogLevel level = wxLog::GetLogLevel(); - wxLog::SetLogLevel(wxLOG_Debug - 1); - wxFileOffset result = stream.SeekI(pos); - wxLog::SetLogLevel(level); - return result; -#else - return stream.SeekI(pos); -#endif -} - - -///////////////////////////////////////////////////////////////////////////// -// Class factory - -wxZipClassFactory g_wxZipClassFactory; - -wxZipClassFactory::wxZipClassFactory() -{ - if (this == &g_wxZipClassFactory) - PushFront(); -} - -const wxChar * const * -wxZipClassFactory::GetProtocols(wxStreamProtocolType type) const -{ - static const wxChar *protocols[] = { _T("zip"), NULL }; - static const wxChar *mimetypes[] = { _T("application/zip"), NULL }; - static const wxChar *fileexts[] = { _T(".zip"), _T(".htb"), NULL }; - static const wxChar *empty[] = { NULL }; - - switch (type) { - case wxSTREAM_PROTOCOL: return protocols; - case wxSTREAM_MIMETYPE: return mimetypes; - case wxSTREAM_FILEEXT: return fileexts; - default: return empty; - } -} - - -///////////////////////////////////////////////////////////////////////////// -// Read a zip header - -class wxZipHeader -{ -public: - wxZipHeader(wxInputStream& stream, size_t size); - - inline wxUint8 Read8(); - inline wxUint16 Read16(); - inline wxUint32 Read32(); - - const char *GetData() const { return m_data; } - size_t GetSize() const { return m_size; } - operator bool() const { return m_ok; } - - size_t Seek(size_t pos) { m_pos = pos; return m_pos; } - size_t Skip(size_t size) { m_pos += size; return m_pos; } - - wxZipHeader& operator>>(wxUint8& n) { n = Read8(); return *this; } - wxZipHeader& operator>>(wxUint16& n) { n = Read16(); return *this; } - wxZipHeader& operator>>(wxUint32& n) { n = Read32(); return *this; } - -private: - char m_data[64]; - size_t m_size; - size_t m_pos; - bool m_ok; -}; - -wxZipHeader::wxZipHeader(wxInputStream& stream, size_t size) - : m_size(0), - m_pos(0), - m_ok(false) -{ - wxCHECK_RET(size <= sizeof(m_data), _T("buffer too small")); - m_size = stream.Read(m_data, size).LastRead(); - m_ok = m_size == size; -} - -inline wxUint8 wxZipHeader::Read8() -{ - wxASSERT(m_pos < m_size); - return m_data[m_pos++]; -} - -inline wxUint16 wxZipHeader::Read16() -{ - wxASSERT(m_pos + 2 <= m_size); - wxUint16 n = CrackUint16(m_data + m_pos); - m_pos += 2; - return n; -} - -inline wxUint32 wxZipHeader::Read32() -{ - wxASSERT(m_pos + 4 <= m_size); - wxUint32 n = CrackUint32(m_data + m_pos); - m_pos += 4; - return n; -} - - -///////////////////////////////////////////////////////////////////////////// -// Stored input stream -// Trival decompressor for files which are 'stored' in the zip file. - -class wxStoredInputStream : public wxFilterInputStream -{ -public: - wxStoredInputStream(wxInputStream& stream); - - void Open(wxFileOffset len) { Close(); m_len = len; } - void Close() { m_pos = 0; m_lasterror = wxSTREAM_NO_ERROR; } - - virtual char Peek() { return wxInputStream::Peek(); } - virtual wxFileOffset GetLength() const { return m_len; } - -protected: - virtual size_t OnSysRead(void *buffer, size_t size); - virtual wxFileOffset OnSysTell() const { return m_pos; } - -private: - wxFileOffset m_pos; - wxFileOffset m_len; - - DECLARE_NO_COPY_CLASS(wxStoredInputStream) -}; - -wxStoredInputStream::wxStoredInputStream(wxInputStream& stream) - : wxFilterInputStream(stream), - m_pos(0), - m_len(0) -{ -} - -size_t wxStoredInputStream::OnSysRead(void *buffer, size_t size) -{ - size_t count = wx_truncate_cast(size_t, - wxMin(size + wxFileOffset(0), m_len - m_pos + size_t(0))); - count = m_parent_i_stream->Read(buffer, count).LastRead(); - m_pos += count; - - if (count < size) - m_lasterror = m_pos == m_len ? wxSTREAM_EOF : wxSTREAM_READ_ERROR; - - return count; -} - - -///////////////////////////////////////////////////////////////////////////// -// Stored output stream -// Trival compressor for files which are 'stored' in the zip file. - -class wxStoredOutputStream : public wxFilterOutputStream -{ -public: - wxStoredOutputStream(wxOutputStream& stream) : - wxFilterOutputStream(stream), m_pos(0) { } - - bool Close() { - m_pos = 0; - m_lasterror = wxSTREAM_NO_ERROR; - return true; - } - -protected: - virtual size_t OnSysWrite(const void *buffer, size_t size); - virtual wxFileOffset OnSysTell() const { return m_pos; } - -private: - wxFileOffset m_pos; - DECLARE_NO_COPY_CLASS(wxStoredOutputStream) -}; - -size_t wxStoredOutputStream::OnSysWrite(const void *buffer, size_t size) -{ - if (!IsOk() || !size) - return 0; - size_t count = m_parent_o_stream->Write(buffer, size).LastWrite(); - if (count != size) - m_lasterror = wxSTREAM_WRITE_ERROR; - m_pos += count; - return count; -} - - -///////////////////////////////////////////////////////////////////////////// -// wxRawInputStream -// -// Used to handle the unusal case of raw copying an entry of unknown -// length. This can only happen when the zip being copied from is being -// read from a non-seekable stream, and also was original written to a -// non-seekable stream. -// -// In this case there's no option but to decompress the stream to find -// it's length, but we can still write the raw compressed data to avoid the -// compression overhead (which is the greater one). -// -// Usage is like this: -// m_rawin = new wxRawInputStream(*m_parent_i_stream); -// m_decomp = m_rawin->Open(OpenDecompressor(m_rawin->GetTee())); -// -// The wxRawInputStream owns a wxTeeInputStream object, the role of which -// is something like the unix 'tee' command; it is a transparent filter, but -// allows the data read to be read a second time via an extra method 'GetData'. -// -// The wxRawInputStream then draws data through the tee using a decompressor -// then instead of returning the decompressed data, retuns the raw data -// from wxTeeInputStream::GetData(). - -class wxTeeInputStream : public wxFilterInputStream -{ -public: - wxTeeInputStream(wxInputStream& stream); - - size_t GetCount() const { return m_end - m_start; } - size_t GetData(char *buffer, size_t size); - - void Open(); - bool Final(); - - wxInputStream& Read(void *buffer, size_t size); - -protected: - virtual size_t OnSysRead(void *buffer, size_t size); - virtual wxFileOffset OnSysTell() const { return m_pos; } - -private: - wxFileOffset m_pos; - wxMemoryBuffer m_buf; - size_t m_start; - size_t m_end; - - DECLARE_NO_COPY_CLASS(wxTeeInputStream) -}; - -wxTeeInputStream::wxTeeInputStream(wxInputStream& stream) - : wxFilterInputStream(stream), - m_pos(0), m_buf(8192), m_start(0), m_end(0) -{ -} - -void wxTeeInputStream::Open() -{ - m_pos = m_start = m_end = 0; - m_lasterror = wxSTREAM_NO_ERROR; -} - -bool wxTeeInputStream::Final() -{ - bool final = m_end == m_buf.GetDataLen(); - m_end = m_buf.GetDataLen(); - return final; -} - -wxInputStream& wxTeeInputStream::Read(void *buffer, size_t size) -{ - size_t count = wxInputStream::Read(buffer, size).LastRead(); - m_end = m_buf.GetDataLen(); - m_buf.AppendData(buffer, count); - return *this; -} - -size_t wxTeeInputStream::OnSysRead(void *buffer, size_t size) -{ - size_t count = m_parent_i_stream->Read(buffer, size).LastRead(); - if (count < size) - m_lasterror = m_parent_i_stream->GetLastError(); - return count; -} - -size_t wxTeeInputStream::GetData(char *buffer, size_t size) -{ - if (m_wbacksize) { - size_t len = m_buf.GetDataLen(); - len = len > m_wbacksize ? len - m_wbacksize : 0; - m_buf.SetDataLen(len); - if (m_end > len) { - wxFAIL; // we've already returned data that's now being ungot - m_end = len; - } - m_parent_i_stream->Reset(); - m_parent_i_stream->Ungetch(m_wback, m_wbacksize); - free(m_wback); - m_wback = NULL; - m_wbacksize = 0; - m_wbackcur = 0; - } - - if (size > GetCount()) - size = GetCount(); - if (size) { - memcpy(buffer, m_buf + m_start, size); - m_start += size; - wxASSERT(m_start <= m_end); - } - - if (m_start == m_end && m_start > 0 && m_buf.GetDataLen() > 0) { - size_t len = m_buf.GetDataLen(); - char *buf = (char*)m_buf.GetWriteBuf(len); - len -= m_end; - memmove(buf, buf + m_end, len); - m_buf.UngetWriteBuf(len); - m_start = m_end = 0; - } - - return size; -} - -class wxRawInputStream : public wxFilterInputStream -{ -public: - wxRawInputStream(wxInputStream& stream); - virtual ~wxRawInputStream() { delete m_tee; } - - wxInputStream* Open(wxInputStream *decomp); - wxInputStream& GetTee() const { return *m_tee; } - -protected: - virtual size_t OnSysRead(void *buffer, size_t size); - virtual wxFileOffset OnSysTell() const { return m_pos; } - -private: - wxFileOffset m_pos; - wxTeeInputStream *m_tee; - - enum { BUFSIZE = 8192 }; - wxCharBuffer m_dummy; - - DECLARE_NO_COPY_CLASS(wxRawInputStream) -}; - -wxRawInputStream::wxRawInputStream(wxInputStream& stream) - : wxFilterInputStream(stream), - m_pos(0), - m_tee(new wxTeeInputStream(stream)), - m_dummy(BUFSIZE) -{ -} - -wxInputStream *wxRawInputStream::Open(wxInputStream *decomp) -{ - if (decomp) { - m_parent_i_stream = decomp; - m_pos = 0; - m_lasterror = wxSTREAM_NO_ERROR; - m_tee->Open(); - return this; - } else { - return NULL; - } -} - -size_t wxRawInputStream::OnSysRead(void *buffer, size_t size) -{ - char *buf = (char*)buffer; - size_t count = 0; - - while (count < size && IsOk()) - { - while (m_parent_i_stream->IsOk() && m_tee->GetCount() == 0) - m_parent_i_stream->Read(m_dummy.data(), BUFSIZE); - - size_t n = m_tee->GetData(buf + count, size - count); - count += n; - - if (n == 0 && m_tee->Final()) - m_lasterror = m_parent_i_stream->GetLastError(); - } - - m_pos += count; - return count; -} - - -///////////////////////////////////////////////////////////////////////////// -// Zlib streams than can be reused without recreating. - -class wxZlibOutputStream2 : public wxZlibOutputStream -{ -public: - wxZlibOutputStream2(wxOutputStream& stream, int level) : - wxZlibOutputStream(stream, level, wxZLIB_NO_HEADER) { } - - bool Open(wxOutputStream& stream); - bool Close() { DoFlush(true); m_pos = wxInvalidOffset; return IsOk(); } -}; - -bool wxZlibOutputStream2::Open(wxOutputStream& stream) -{ - wxCHECK(m_pos == wxInvalidOffset, false); - - m_deflate->next_out = m_z_buffer; - m_deflate->avail_out = m_z_size; - m_pos = 0; - m_lasterror = wxSTREAM_NO_ERROR; - m_parent_o_stream = &stream; - - if (deflateReset(m_deflate) != Z_OK) { - wxLogError(_("can't re-initialize zlib deflate stream")); - m_lasterror = wxSTREAM_WRITE_ERROR; - return false; - } - - return true; -} - -class wxZlibInputStream2 : public wxZlibInputStream -{ -public: - wxZlibInputStream2(wxInputStream& stream) : - wxZlibInputStream(stream, wxZLIB_NO_HEADER) { } - - bool Open(wxInputStream& stream); -}; - -bool wxZlibInputStream2::Open(wxInputStream& stream) -{ - m_inflate->avail_in = 0; - m_pos = 0; - m_lasterror = wxSTREAM_NO_ERROR; - m_parent_i_stream = &stream; - - if (inflateReset(m_inflate) != Z_OK) { - wxLogError(_("can't re-initialize zlib inflate stream")); - m_lasterror = wxSTREAM_READ_ERROR; - return false; - } - - return true; -} - - -///////////////////////////////////////////////////////////////////////////// -// Class to hold wxZipEntry's Extra and LocalExtra fields - -class wxZipMemory -{ -public: - wxZipMemory() : m_data(NULL), m_size(0), m_capacity(0), m_ref(1) { } - - wxZipMemory *AddRef() { m_ref++; return this; } - void Release() { if (--m_ref == 0) delete this; } - - char *GetData() const { return m_data; } - size_t GetSize() const { return m_size; } - size_t GetCapacity() const { return m_capacity; } - - wxZipMemory *Unique(size_t size); - -private: - ~wxZipMemory() { delete [] m_data; } - - char *m_data; - size_t m_size; - size_t m_capacity; - int m_ref; - - wxSUPPRESS_GCC_PRIVATE_DTOR_WARNING(wxZipMemory) -}; - -wxZipMemory *wxZipMemory::Unique(size_t size) -{ - wxZipMemory *zm; - - if (m_ref > 1) { - --m_ref; - zm = new wxZipMemory; - } else { - zm = this; - } - - if (zm->m_capacity < size) { - delete [] zm->m_data; - zm->m_data = new char[size]; - zm->m_capacity = size; - } - - zm->m_size = size; - return zm; -} - -static inline wxZipMemory *AddRef(wxZipMemory *zm) -{ - if (zm) - zm->AddRef(); - return zm; -} - -static inline void Release(wxZipMemory *zm) -{ - if (zm) - zm->Release(); -} - -static void Copy(wxZipMemory*& dest, wxZipMemory *src) -{ - Release(dest); - dest = AddRef(src); -} - -static void Unique(wxZipMemory*& zm, size_t size) -{ - if (!zm && size) - zm = new wxZipMemory; - if (zm) - zm = zm->Unique(size); -} - - -///////////////////////////////////////////////////////////////////////////// -// Collection of weak references to entries - -WX_DECLARE_HASH_MAP(long, wxZipEntry*, wxIntegerHash, - wxIntegerEqual, wxOffsetZipEntryMap_); - -class wxZipWeakLinks -{ -public: - wxZipWeakLinks() : m_ref(1) { } - - void Release(const wxZipInputStream* WXUNUSED(x)) - { if (--m_ref == 0) delete this; } - void Release(wxFileOffset key) - { RemoveEntry(key); if (--m_ref == 0) delete this; } - - wxZipWeakLinks *AddEntry(wxZipEntry *entry, wxFileOffset key); - void RemoveEntry(wxFileOffset key) - { m_entries.erase(wx_truncate_cast(key_type, key)); } - wxZipEntry *GetEntry(wxFileOffset key) const; - bool IsEmpty() const { return m_entries.empty(); } - -private: - ~wxZipWeakLinks() { wxASSERT(IsEmpty()); } - - typedef wxOffsetZipEntryMap_::key_type key_type; - - int m_ref; - wxOffsetZipEntryMap_ m_entries; - - wxSUPPRESS_GCC_PRIVATE_DTOR_WARNING(wxZipWeakLinks) -}; - -wxZipWeakLinks *wxZipWeakLinks::AddEntry(wxZipEntry *entry, wxFileOffset key) -{ - m_entries[wx_truncate_cast(key_type, key)] = entry; - m_ref++; - return this; -} - -wxZipEntry *wxZipWeakLinks::GetEntry(wxFileOffset key) const -{ - wxOffsetZipEntryMap_::const_iterator it = - m_entries.find(wx_truncate_cast(key_type, key)); - return it != m_entries.end() ? it->second : NULL; -} - - -///////////////////////////////////////////////////////////////////////////// -// ZipEntry - -wxZipEntry::wxZipEntry( - const wxString& name /*=wxEmptyString*/, - const wxDateTime& dt /*=wxDateTime::Now()*/, - wxFileOffset size /*=wxInvalidOffset*/) - : - m_SystemMadeBy(wxZIP_SYSTEM_MSDOS), - m_VersionMadeBy(wxMAJOR_VERSION * 10 + wxMINOR_VERSION), - m_VersionNeeded(VERSION_NEEDED_TO_EXTRACT), - m_Flags(0), - m_Method(wxZIP_METHOD_DEFAULT), - m_DateTime(dt), - m_Crc(0), - m_CompressedSize(wxInvalidOffset), - m_Size(size), - m_Key(wxInvalidOffset), - m_Offset(wxInvalidOffset), - m_DiskStart(0), - m_InternalAttributes(0), - m_ExternalAttributes(0), - m_Extra(NULL), - m_LocalExtra(NULL), - m_zipnotifier(NULL), - m_backlink(NULL) -{ - if (!name.empty()) - SetName(name); -} - -wxZipEntry::~wxZipEntry() -{ - if (m_backlink) - m_backlink->Release(m_Key); - Release(m_Extra); - Release(m_LocalExtra); -} - -wxZipEntry::wxZipEntry(const wxZipEntry& e) - : wxArchiveEntry(e), - m_SystemMadeBy(e.m_SystemMadeBy), - m_VersionMadeBy(e.m_VersionMadeBy), - m_VersionNeeded(e.m_VersionNeeded), - m_Flags(e.m_Flags), - m_Method(e.m_Method), - m_DateTime(e.m_DateTime), - m_Crc(e.m_Crc), - m_CompressedSize(e.m_CompressedSize), - m_Size(e.m_Size), - m_Name(e.m_Name), - m_Key(e.m_Key), - m_Offset(e.m_Offset), - m_Comment(e.m_Comment), - m_DiskStart(e.m_DiskStart), - m_InternalAttributes(e.m_InternalAttributes), - m_ExternalAttributes(e.m_ExternalAttributes), - m_Extra(AddRef(e.m_Extra)), - m_LocalExtra(AddRef(e.m_LocalExtra)), - m_zipnotifier(NULL), - m_backlink(NULL) -{ -} - -wxZipEntry& wxZipEntry::operator=(const wxZipEntry& e) -{ - if (&e != this) { - m_SystemMadeBy = e.m_SystemMadeBy; - m_VersionMadeBy = e.m_VersionMadeBy; - m_VersionNeeded = e.m_VersionNeeded; - m_Flags = e.m_Flags; - m_Method = e.m_Method; - m_DateTime = e.m_DateTime; - m_Crc = e.m_Crc; - m_CompressedSize = e.m_CompressedSize; - m_Size = e.m_Size; - m_Name = e.m_Name; - m_Key = e.m_Key; - m_Offset = e.m_Offset; - m_Comment = e.m_Comment; - m_DiskStart = e.m_DiskStart; - m_InternalAttributes = e.m_InternalAttributes; - m_ExternalAttributes = e.m_ExternalAttributes; - Copy(m_Extra, e.m_Extra); - Copy(m_LocalExtra, e.m_LocalExtra); - m_zipnotifier = NULL; - if (m_backlink) { - m_backlink->Release(m_Key); - m_backlink = NULL; - } - } - return *this; -} - -wxString wxZipEntry::GetName(wxPathFormat format /*=wxPATH_NATIVE*/) const -{ - bool isDir = IsDir() && !m_Name.empty(); - - // optimisations for common (and easy) cases - switch (wxFileName::GetFormat(format)) { - case wxPATH_DOS: - { - wxString name(isDir ? m_Name + _T("\\") : m_Name); - for (size_t i = 0; i < name.length(); i++) - if (name[i] == _T('/')) - name[i] = _T('\\'); - return name; - } - - case wxPATH_UNIX: - return isDir ? m_Name + _T("/") : m_Name; - - default: - ; - } - - wxFileName fn; - - if (isDir) - fn.AssignDir(m_Name, wxPATH_UNIX); - else - fn.Assign(m_Name, wxPATH_UNIX); - - return fn.GetFullPath(format); -} - -// Static - Internally tars and zips use forward slashes for the path -// separator, absolute paths aren't allowed, and directory names have a -// trailing slash. This function converts a path into this internal format, -// but without a trailing slash for a directory. -// -wxString wxZipEntry::GetInternalName(const wxString& name, - wxPathFormat format /*=wxPATH_NATIVE*/, - bool *pIsDir /*=NULL*/) -{ - wxString internal; - - if (wxFileName::GetFormat(format) != wxPATH_UNIX) - internal = wxFileName(name, format).GetFullPath(wxPATH_UNIX); - else - internal = name; - - bool isDir = !internal.empty() && internal.Last() == '/'; - if (pIsDir) - *pIsDir = isDir; - if (isDir) - internal.erase(internal.length() - 1); - - while (!internal.empty() && *internal.begin() == '/') - internal.erase(0, 1); - while (!internal.empty() && internal.compare(0, 2, _T("./")) == 0) - internal.erase(0, 2); - if (internal == _T(".") || internal == _T("..")) - internal = wxEmptyString; - - return internal; -} - -void wxZipEntry::SetSystemMadeBy(int system) -{ - int mode = GetMode(); - bool wasUnix = IsMadeByUnix(); - - m_SystemMadeBy = (wxUint8)system; - - if (!wasUnix && IsMadeByUnix()) { - SetIsDir(IsDir()); - SetMode(mode); - } else if (wasUnix && !IsMadeByUnix()) { - m_ExternalAttributes &= 0xffff; - } -} - -void wxZipEntry::SetIsDir(bool isDir /*=true*/) -{ - if (isDir) - m_ExternalAttributes |= wxZIP_A_SUBDIR; - else - m_ExternalAttributes &= ~wxZIP_A_SUBDIR; - - if (IsMadeByUnix()) { - m_ExternalAttributes &= ~wxZIP_S_IFMT; - if (isDir) - m_ExternalAttributes |= wxZIP_S_IFDIR; - else - m_ExternalAttributes |= wxZIP_S_IFREG; - } -} - -// Return unix style permission bits -// -int wxZipEntry::GetMode() const -{ - // return unix permissions if present - if (IsMadeByUnix()) - return (m_ExternalAttributes >> 16) & 0777; - - // otherwise synthesize from the dos attribs - int mode = 0644; - if (m_ExternalAttributes & wxZIP_A_RDONLY) - mode &= ~0200; - if (m_ExternalAttributes & wxZIP_A_SUBDIR) - mode |= 0111; - - return mode; -} - -// Set unix permissions -// -void wxZipEntry::SetMode(int mode) -{ - // Set dos attrib bits to be compatible - if (mode & 0222) - m_ExternalAttributes &= ~wxZIP_A_RDONLY; - else - m_ExternalAttributes |= wxZIP_A_RDONLY; - - // set the actual unix permission bits if the system type allows - if (IsMadeByUnix()) { - m_ExternalAttributes &= ~(0777L << 16); - m_ExternalAttributes |= (mode & 0777L) << 16; - } -} - -const char *wxZipEntry::GetExtra() const -{ - return m_Extra ? m_Extra->GetData() : NULL; -} - -size_t wxZipEntry::GetExtraLen() const -{ - return m_Extra ? m_Extra->GetSize() : 0; -} - -void wxZipEntry::SetExtra(const char *extra, size_t len) -{ - Unique(m_Extra, len); - if (len) - memcpy(m_Extra->GetData(), extra, len); -} - -const char *wxZipEntry::GetLocalExtra() const -{ - return m_LocalExtra ? m_LocalExtra->GetData() : NULL; -} - -size_t wxZipEntry::GetLocalExtraLen() const -{ - return m_LocalExtra ? m_LocalExtra->GetSize() : 0; -} - -void wxZipEntry::SetLocalExtra(const char *extra, size_t len) -{ - Unique(m_LocalExtra, len); - if (len) - memcpy(m_LocalExtra->GetData(), extra, len); -} - -void wxZipEntry::SetNotifier(wxZipNotifier& notifier) -{ - wxArchiveEntry::UnsetNotifier(); - m_zipnotifier = ¬ifier; - m_zipnotifier->OnEntryUpdated(*this); -} - -void wxZipEntry::Notify() -{ - if (m_zipnotifier) - m_zipnotifier->OnEntryUpdated(*this); - else if (GetNotifier()) - GetNotifier()->OnEntryUpdated(*this); -} - -void wxZipEntry::UnsetNotifier() -{ - wxArchiveEntry::UnsetNotifier(); - m_zipnotifier = NULL; -} - -size_t wxZipEntry::ReadLocal(wxInputStream& stream, wxMBConv& conv) -{ - wxUint16 nameLen, extraLen; - wxUint32 compressedSize, size, crc; - - wxZipHeader ds(stream, LOCAL_SIZE - 4); - if (!ds) - return 0; - - ds >> m_VersionNeeded >> m_Flags >> m_Method; - SetDateTime(wxDateTime().SetFromDOS(ds.Read32())); - ds >> crc >> compressedSize >> size >> nameLen >> extraLen; - - bool sumsValid = (m_Flags & wxZIP_SUMS_FOLLOW) == 0; - - if (sumsValid || crc) - m_Crc = crc; - if ((sumsValid || compressedSize) || m_Method == wxZIP_METHOD_STORE) - m_CompressedSize = compressedSize; - if ((sumsValid || size) || m_Method == wxZIP_METHOD_STORE) - m_Size = size; - - SetName(ReadString(stream, nameLen, conv), wxPATH_UNIX); - if (stream.LastRead() != nameLen + 0u) - return 0; - - if (extraLen || GetLocalExtraLen()) { - Unique(m_LocalExtra, extraLen); - if (extraLen) { - stream.Read(m_LocalExtra->GetData(), extraLen); - if (stream.LastRead() != extraLen + 0u) - return 0; - } - } - - return LOCAL_SIZE + nameLen + extraLen; -} - -size_t wxZipEntry::WriteLocal(wxOutputStream& stream, wxMBConv& conv) const -{ - wxString unixName = GetName(wxPATH_UNIX); - const wxWX2MBbuf name_buf = conv.cWX2MB(unixName); - const char *name = name_buf; - if (!name) name = ""; - wxUint16 nameLen = wx_truncate_cast(wxUint16, strlen(name)); - - wxDataOutputStream ds(stream); - - ds << m_VersionNeeded << m_Flags << m_Method; - ds.Write32(GetDateTime().GetAsDOS()); - - ds.Write32(m_Crc); - ds.Write32(m_CompressedSize != wxInvalidOffset ? - wx_truncate_cast(wxUint32, m_CompressedSize) : 0); - ds.Write32(m_Size != wxInvalidOffset ? - wx_truncate_cast(wxUint32, m_Size) : 0); - - ds << nameLen; - wxUint16 extraLen = wx_truncate_cast(wxUint16, GetLocalExtraLen()); - ds.Write16(extraLen); - - stream.Write(name, nameLen); - if (extraLen) - stream.Write(m_LocalExtra->GetData(), extraLen); - - return LOCAL_SIZE + nameLen + extraLen; -} - -size_t wxZipEntry::ReadCentral(wxInputStream& stream, wxMBConv& conv) -{ - wxUint16 nameLen, extraLen, commentLen; - - wxZipHeader ds(stream, CENTRAL_SIZE - 4); - if (!ds) - return 0; - - ds >> m_VersionMadeBy >> m_SystemMadeBy; - - SetVersionNeeded(ds.Read16()); - SetFlags(ds.Read16()); - SetMethod(ds.Read16()); - SetDateTime(wxDateTime().SetFromDOS(ds.Read32())); - SetCrc(ds.Read32()); - SetCompressedSize(ds.Read32()); - SetSize(ds.Read32()); - - ds >> nameLen >> extraLen >> commentLen - >> m_DiskStart >> m_InternalAttributes >> m_ExternalAttributes; - SetOffset(ds.Read32()); - - SetName(ReadString(stream, nameLen, conv), wxPATH_UNIX); - if (stream.LastRead() != nameLen + 0u) - return 0; - - if (extraLen || GetExtraLen()) { - Unique(m_Extra, extraLen); - if (extraLen) { - stream.Read(m_Extra->GetData(), extraLen); - if (stream.LastRead() != extraLen + 0u) - return 0; - } - } - - if (commentLen) { - m_Comment = ReadString(stream, commentLen, conv); - if (stream.LastRead() != commentLen + 0u) - return 0; - } else { - m_Comment.clear(); - } - - return CENTRAL_SIZE + nameLen + extraLen + commentLen; -} - -size_t wxZipEntry::WriteCentral(wxOutputStream& stream, wxMBConv& conv) const -{ - wxString unixName = GetName(wxPATH_UNIX); - const wxWX2MBbuf name_buf = conv.cWX2MB(unixName); - const char *name = name_buf; - if (!name) name = ""; - wxUint16 nameLen = wx_truncate_cast(wxUint16, strlen(name)); - - const wxWX2MBbuf comment_buf = conv.cWX2MB(m_Comment); - const char *comment = comment_buf; - if (!comment) comment = ""; - wxUint16 commentLen = wx_truncate_cast(wxUint16, strlen(comment)); - - wxUint16 extraLen = wx_truncate_cast(wxUint16, GetExtraLen()); - - wxDataOutputStream ds(stream); - - ds << CENTRAL_MAGIC << m_VersionMadeBy << m_SystemMadeBy; - - ds.Write16(wx_truncate_cast(wxUint16, GetVersionNeeded())); - ds.Write16(wx_truncate_cast(wxUint16, GetFlags())); - ds.Write16(wx_truncate_cast(wxUint16, GetMethod())); - ds.Write32(GetDateTime().GetAsDOS()); - ds.Write32(GetCrc()); - ds.Write32(wx_truncate_cast(wxUint32, GetCompressedSize())); - ds.Write32(wx_truncate_cast(wxUint32, GetSize())); - ds.Write16(nameLen); - ds.Write16(extraLen); - - ds << commentLen << m_DiskStart << m_InternalAttributes - << m_ExternalAttributes << wx_truncate_cast(wxUint32, GetOffset()); - - stream.Write(name, nameLen); - if (extraLen) - stream.Write(GetExtra(), extraLen); - stream.Write(comment, commentLen); - - return CENTRAL_SIZE + nameLen + extraLen + commentLen; -} - -// Info-zip prefixes this record with a signature, but pkzip doesn't. So if -// the 1st value is the signature then it is probably an info-zip record, -// though there is a small chance that it is in fact a pkzip record which -// happens to have the signature as it's CRC. -// -size_t wxZipEntry::ReadDescriptor(wxInputStream& stream) -{ - wxZipHeader ds(stream, SUMS_SIZE); - if (!ds) - return 0; - - m_Crc = ds.Read32(); - m_CompressedSize = ds.Read32(); - m_Size = ds.Read32(); - - // if 1st value is the signature then this is probably an info-zip record - if (m_Crc == SUMS_MAGIC) - { - wxZipHeader buf(stream, 8); - wxUint32 u1 = buf.GetSize() >= 4 ? buf.Read32() : (wxUint32)LOCAL_MAGIC; - wxUint32 u2 = buf.GetSize() == 8 ? buf.Read32() : 0; - - // look for the signature of the following record to decide which - if ((u1 == LOCAL_MAGIC || u1 == CENTRAL_MAGIC) && - (u2 != LOCAL_MAGIC && u2 != CENTRAL_MAGIC)) - { - // it's a pkzip style record after all! - if (buf.GetSize() > 0) - stream.Ungetch(buf.GetData(), buf.GetSize()); - } - else - { - // it's an info-zip record as expected - if (buf.GetSize() > 4) - stream.Ungetch(buf.GetData() + 4, buf.GetSize() - 4); - m_Crc = wx_truncate_cast(wxUint32, m_CompressedSize); - m_CompressedSize = m_Size; - m_Size = u1; - return SUMS_SIZE + 4; - } - } - - return SUMS_SIZE; -} - -size_t wxZipEntry::WriteDescriptor(wxOutputStream& stream, wxUint32 crc, - wxFileOffset compressedSize, wxFileOffset size) -{ - m_Crc = crc; - m_CompressedSize = compressedSize; - m_Size = size; - - wxDataOutputStream ds(stream); - - ds.Write32(crc); - ds.Write32(wx_truncate_cast(wxUint32, compressedSize)); - ds.Write32(wx_truncate_cast(wxUint32, size)); - - return SUMS_SIZE; -} - - -///////////////////////////////////////////////////////////////////////////// -// wxZipEndRec - holds the end of central directory record - -class wxZipEndRec -{ -public: - wxZipEndRec(); - - int GetDiskNumber() const { return m_DiskNumber; } - int GetStartDisk() const { return m_StartDisk; } - int GetEntriesHere() const { return m_EntriesHere; } - int GetTotalEntries() const { return m_TotalEntries; } - wxFileOffset GetSize() const { return m_Size; } - wxFileOffset GetOffset() const { return m_Offset; } - wxString GetComment() const { return m_Comment; } - - void SetDiskNumber(int num) - { m_DiskNumber = wx_truncate_cast(wxUint16, num); } - void SetStartDisk(int num) - { m_StartDisk = wx_truncate_cast(wxUint16, num); } - void SetEntriesHere(int num) - { m_EntriesHere = wx_truncate_cast(wxUint16, num); } - void SetTotalEntries(int num) - { m_TotalEntries = wx_truncate_cast(wxUint16, num); } - void SetSize(wxFileOffset size) - { m_Size = wx_truncate_cast(wxUint32, size); } - void SetOffset(wxFileOffset offset) - { m_Offset = wx_truncate_cast(wxUint32, offset); } - void SetComment(const wxString& comment) - { m_Comment = comment; } - - bool Read(wxInputStream& stream, wxMBConv& conv); - bool Write(wxOutputStream& stream, wxMBConv& conv) const; - -private: - wxUint16 m_DiskNumber; - wxUint16 m_StartDisk; - wxUint16 m_EntriesHere; - wxUint16 m_TotalEntries; - wxUint32 m_Size; - wxUint32 m_Offset; - wxString m_Comment; -}; - -wxZipEndRec::wxZipEndRec() - : m_DiskNumber(0), - m_StartDisk(0), - m_EntriesHere(0), - m_TotalEntries(0), - m_Size(0), - m_Offset(0) -{ -} - -bool wxZipEndRec::Write(wxOutputStream& stream, wxMBConv& conv) const -{ - const wxWX2MBbuf comment_buf = conv.cWX2MB(m_Comment); - const char *comment = comment_buf; - if (!comment) comment = ""; - wxUint16 commentLen = (wxUint16)strlen(comment); - - wxDataOutputStream ds(stream); - - ds << END_MAGIC << m_DiskNumber << m_StartDisk << m_EntriesHere - << m_TotalEntries << m_Size << m_Offset << commentLen; - - stream.Write(comment, commentLen); - - return stream.IsOk(); -} - -bool wxZipEndRec::Read(wxInputStream& stream, wxMBConv& conv) -{ - wxZipHeader ds(stream, END_SIZE - 4); - if (!ds) - return false; - - wxUint16 commentLen; - - ds >> m_DiskNumber >> m_StartDisk >> m_EntriesHere - >> m_TotalEntries >> m_Size >> m_Offset >> commentLen; - - if (commentLen) { - m_Comment = ReadString(stream, commentLen, conv); - if (stream.LastRead() != commentLen + 0u) - return false; - } - - if (m_DiskNumber != 0 || m_StartDisk != 0 || - m_EntriesHere != m_TotalEntries) - wxLogWarning(_("assuming this is a multi-part zip concatenated")); - - return true; -} - - -///////////////////////////////////////////////////////////////////////////// -// A weak link from an input stream to an output stream - -class wxZipStreamLink -{ -public: - wxZipStreamLink(wxZipOutputStream *stream) : m_ref(1), m_stream(stream) { } - - wxZipStreamLink *AddRef() { m_ref++; return this; } - wxZipOutputStream *GetOutputStream() const { return m_stream; } - - void Release(class wxZipInputStream *WXUNUSED(s)) - { if (--m_ref == 0) delete this; } - void Release(class wxZipOutputStream *WXUNUSED(s)) - { m_stream = NULL; if (--m_ref == 0) delete this; } - -private: - ~wxZipStreamLink() { } - - int m_ref; - wxZipOutputStream *m_stream; - - wxSUPPRESS_GCC_PRIVATE_DTOR_WARNING(wxZipStreamLink) -}; - - -///////////////////////////////////////////////////////////////////////////// -// Input stream - -// leave the default wxZipEntryPtr free for users -wxDECLARE_SCOPED_PTR(wxZipEntry, wxZipEntryPtr_) -wxDEFINE_SCOPED_PTR (wxZipEntry, wxZipEntryPtr_) - -// constructor -// -wxZipInputStream::wxZipInputStream(wxInputStream& stream, - wxMBConv& conv /*=wxConvLocal*/) - : wxArchiveInputStream(stream, conv) -{ - Init(); -} - -wxZipInputStream::wxZipInputStream(wxInputStream *stream, - wxMBConv& conv /*=wxConvLocal*/) - : wxArchiveInputStream(stream, conv) -{ - Init(); -} - -#if WXWIN_COMPATIBILITY_2_6 && wxUSE_FFILE - -// Part of the compatibility constructor, which has been made inline to -// avoid a problem with it not being exported by mingw 3.2.3 -// -void wxZipInputStream::Init(const wxString& file) -{ - // no error messages - wxLogNull nolog; - Init(); - m_allowSeeking = true; - wxFFileInputStream *ffile; - ffile = wx_static_cast(wxFFileInputStream*, m_parent_i_stream); - wxZipEntryPtr_ entry; - - if (ffile->Ok()) { - do { - entry.reset(GetNextEntry()); - } - while (entry.get() != NULL && entry->GetInternalName() != file); - } - - if (entry.get() == NULL) - m_lasterror = wxSTREAM_READ_ERROR; -} - -wxInputStream* wxZipInputStream::OpenFile(const wxString& archive) -{ - wxLogNull nolog; - return new wxFFileInputStream(archive); -} - -#endif // WXWIN_COMPATIBILITY_2_6 && wxUSE_FFILE - -void wxZipInputStream::Init() -{ - m_store = new wxStoredInputStream(*m_parent_i_stream); - m_inflate = NULL; - m_rawin = NULL; - m_raw = false; - m_headerSize = 0; - m_decomp = NULL; - m_parentSeekable = false; - m_weaklinks = new wxZipWeakLinks; - m_streamlink = NULL; - m_offsetAdjustment = 0; - m_position = wxInvalidOffset; - m_signature = 0; - m_TotalEntries = 0; - m_lasterror = m_parent_i_stream->GetLastError(); -#if WXWIN_COMPATIBILITY_2_6 - m_allowSeeking = false; -#endif -} - -wxZipInputStream::~wxZipInputStream() -{ - CloseDecompressor(m_decomp); - - delete m_store; - delete m_inflate; - delete m_rawin; - - m_weaklinks->Release(this); - - if (m_streamlink) - m_streamlink->Release(this); -} - -wxString wxZipInputStream::GetComment() -{ - if (m_position == wxInvalidOffset) - if (!LoadEndRecord()) - return wxEmptyString; - - if (!m_parentSeekable && Eof() && m_signature) { - m_lasterror = wxSTREAM_NO_ERROR; - m_lasterror = ReadLocal(true); - } - - return m_Comment; -} - -int wxZipInputStream::GetTotalEntries() -{ - if (m_position == wxInvalidOffset) - LoadEndRecord(); - return m_TotalEntries; -} - -wxZipStreamLink *wxZipInputStream::MakeLink(wxZipOutputStream *out) -{ - wxZipStreamLink *link = NULL; - - if (!m_parentSeekable && (IsOpened() || !Eof())) { - link = new wxZipStreamLink(out); - if (m_streamlink) - m_streamlink->Release(this); - m_streamlink = link->AddRef(); - } - - return link; -} - -bool wxZipInputStream::LoadEndRecord() -{ - wxCHECK(m_position == wxInvalidOffset, false); - if (!IsOk()) - return false; - - m_position = 0; - - // First find the end-of-central-directory record. - if (!FindEndRecord()) { - // failed, so either this is a non-seekable stream (ok), or not a zip - if (m_parentSeekable) { - m_lasterror = wxSTREAM_READ_ERROR; - wxLogError(_("invalid zip file")); - return false; - } - else { - wxLogNull nolog; - wxFileOffset pos = m_parent_i_stream->TellI(); - if (pos != wxInvalidOffset) - m_offsetAdjustment = m_position = pos; - return true; - } - } - - wxZipEndRec endrec; - - // Read in the end record - wxFileOffset endPos = m_parent_i_stream->TellI() - 4; - if (!endrec.Read(*m_parent_i_stream, GetConv())) - return false; - - m_TotalEntries = endrec.GetTotalEntries(); - m_Comment = endrec.GetComment(); - - // Now find the central-directory. we have the file offset of - // the CD, so look there first. - if (m_parent_i_stream->SeekI(endrec.GetOffset()) != wxInvalidOffset && - ReadSignature() == CENTRAL_MAGIC) { - m_signature = CENTRAL_MAGIC; - m_position = endrec.GetOffset(); - m_offsetAdjustment = 0; - return true; - } - - // If it's not there, then it could be that the zip has been appended - // to a self extractor, so take the CD size (also in endrec), subtract - // it from the file offset of the end-central-directory and look there. - if (m_parent_i_stream->SeekI(endPos - endrec.GetSize()) - != wxInvalidOffset && ReadSignature() == CENTRAL_MAGIC) { - m_signature = CENTRAL_MAGIC; - m_position = endPos - endrec.GetSize(); - m_offsetAdjustment = m_position - endrec.GetOffset(); - return true; - } - - wxLogError(_("can't find central directory in zip")); - m_lasterror = wxSTREAM_READ_ERROR; - return false; -} - -// Find the end-of-central-directory record. -// If found the stream will be positioned just past the 4 signature bytes. -// -bool wxZipInputStream::FindEndRecord() -{ - if (!m_parent_i_stream->IsSeekable()) - return false; - - // usually it's 22 bytes in size and the last thing in the file - { - wxLogNull nolog; - if (m_parent_i_stream->SeekI(-END_SIZE, wxFromEnd) == wxInvalidOffset) - return false; - } - - m_parentSeekable = true; - m_signature = 0; - char magic[4]; - if (m_parent_i_stream->Read(magic, 4).LastRead() != 4) - return false; - if ((m_signature = CrackUint32(magic)) == END_MAGIC) - return true; - - // unfortunately, the record has a comment field that can be up to 65535 - // bytes in length, so if the signature not found then search backwards. - wxFileOffset pos = m_parent_i_stream->TellI(); - const int BUFSIZE = 1024; - wxCharBuffer buf(BUFSIZE); - - memcpy(buf.data(), magic, 3); - wxFileOffset minpos = wxMax(pos - 65535L, 0); - - while (pos > minpos) { - size_t len = wx_truncate_cast(size_t, - pos - wxMax(pos - (BUFSIZE - 3), minpos)); - memcpy(buf.data() + len, buf, 3); - pos -= len; - - if (m_parent_i_stream->SeekI(pos, wxFromStart) == wxInvalidOffset || - m_parent_i_stream->Read(buf.data(), len).LastRead() != len) - return false; - - char *p = buf.data() + len; - - while (p-- > buf.data()) { - if ((m_signature = CrackUint32(p)) == END_MAGIC) { - size_t remainder = buf.data() + len - p; - if (remainder > 4) - m_parent_i_stream->Ungetch(p + 4, remainder - 4); - return true; - } - } - } - - return false; -} - -wxZipEntry *wxZipInputStream::GetNextEntry() -{ - if (m_position == wxInvalidOffset) - if (!LoadEndRecord()) - return NULL; - - m_lasterror = m_parentSeekable ? ReadCentral() : ReadLocal(); - if (!IsOk()) - return NULL; - - wxZipEntryPtr_ entry(new wxZipEntry(m_entry)); - entry->m_backlink = m_weaklinks->AddEntry(entry.get(), entry->GetKey()); - return entry.release(); -} - -wxStreamError wxZipInputStream::ReadCentral() -{ - if (!AtHeader()) - CloseEntry(); - - if (m_signature == END_MAGIC) - return wxSTREAM_EOF; - - if (m_signature != CENTRAL_MAGIC) { - wxLogError(_("error reading zip central directory")); - return wxSTREAM_READ_ERROR; - } - - if (QuietSeek(*m_parent_i_stream, m_position + 4) == wxInvalidOffset) - return wxSTREAM_READ_ERROR; - - size_t size = m_entry.ReadCentral(*m_parent_i_stream, GetConv()); - if (!size) { - m_signature = 0; - return wxSTREAM_READ_ERROR; - } - - m_position += size; - m_signature = ReadSignature(); - - if (m_offsetAdjustment) - m_entry.SetOffset(m_entry.GetOffset() + m_offsetAdjustment); - m_entry.SetKey(m_entry.GetOffset()); - - return wxSTREAM_NO_ERROR; -} - -wxStreamError wxZipInputStream::ReadLocal(bool readEndRec /*=false*/) -{ - if (!AtHeader()) - CloseEntry(); - - if (!m_signature) - m_signature = ReadSignature(); - - if (m_signature == CENTRAL_MAGIC || m_signature == END_MAGIC) { - if (m_streamlink && !m_streamlink->GetOutputStream()) { - m_streamlink->Release(this); - m_streamlink = NULL; - } - } - - while (m_signature == CENTRAL_MAGIC) { - if (m_weaklinks->IsEmpty() && m_streamlink == NULL) - return wxSTREAM_EOF; - - size_t size = m_entry.ReadCentral(*m_parent_i_stream, GetConv()); - m_position += size; - m_signature = 0; - if (!size) - return wxSTREAM_READ_ERROR; - - wxZipEntry *entry = m_weaklinks->GetEntry(m_entry.GetOffset()); - if (entry) { - entry->SetSystemMadeBy(m_entry.GetSystemMadeBy()); - entry->SetVersionMadeBy(m_entry.GetVersionMadeBy()); - entry->SetComment(m_entry.GetComment()); - entry->SetDiskStart(m_entry.GetDiskStart()); - entry->SetInternalAttributes(m_entry.GetInternalAttributes()); - entry->SetExternalAttributes(m_entry.GetExternalAttributes()); - Copy(entry->m_Extra, m_entry.m_Extra); - entry->Notify(); - m_weaklinks->RemoveEntry(entry->GetOffset()); - } - - m_signature = ReadSignature(); - } - - if (m_signature == END_MAGIC) { - if (readEndRec || m_streamlink) { - wxZipEndRec endrec; - endrec.Read(*m_parent_i_stream, GetConv()); - m_Comment = endrec.GetComment(); - m_signature = 0; - if (m_streamlink) { - m_streamlink->GetOutputStream()->SetComment(endrec.GetComment()); - m_streamlink->Release(this); - m_streamlink = NULL; - } - } - return wxSTREAM_EOF; - } - - if (m_signature == LOCAL_MAGIC) { - m_headerSize = m_entry.ReadLocal(*m_parent_i_stream, GetConv()); - m_signature = 0; - m_entry.SetOffset(m_position); - m_entry.SetKey(m_position); - - if (m_headerSize) { - m_TotalEntries++; - return wxSTREAM_NO_ERROR; - } - } - - wxLogError(_("error reading zip local header")); - return wxSTREAM_READ_ERROR; -} - -wxUint32 wxZipInputStream::ReadSignature() -{ - char magic[4]; - m_parent_i_stream->Read(magic, 4); - return m_parent_i_stream->LastRead() == 4 ? CrackUint32(magic) : 0; -} - -bool wxZipInputStream::OpenEntry(wxArchiveEntry& entry) -{ - wxZipEntry *zipEntry = wxStaticCast(&entry, wxZipEntry); - return zipEntry ? OpenEntry(*zipEntry) : false; -} - -// Open an entry -// -bool wxZipInputStream::DoOpen(wxZipEntry *entry, bool raw) -{ - if (m_position == wxInvalidOffset) - if (!LoadEndRecord()) - return false; - if (m_lasterror == wxSTREAM_READ_ERROR) - return false; - if (IsOpened()) - CloseEntry(); - - m_raw = raw; - - if (entry) { - if (AfterHeader() && entry->GetKey() == m_entry.GetOffset()) - return true; - // can only open the current entry on a non-seekable stream - wxCHECK(m_parentSeekable, false); - } - - m_lasterror = wxSTREAM_READ_ERROR; - - if (entry) - m_entry = *entry; - - if (m_parentSeekable) { - if (QuietSeek(*m_parent_i_stream, m_entry.GetOffset()) - == wxInvalidOffset) - return false; - if (ReadSignature() != LOCAL_MAGIC) { - wxLogError(_("bad zipfile offset to entry")); - return false; - } - } - - if (m_parentSeekable || AtHeader()) { - m_headerSize = m_entry.ReadLocal(*m_parent_i_stream, GetConv()); - if (m_headerSize && m_parentSeekable) { - wxZipEntry *ref = m_weaklinks->GetEntry(m_entry.GetKey()); - if (ref) { - Copy(ref->m_LocalExtra, m_entry.m_LocalExtra); - ref->Notify(); - m_weaklinks->RemoveEntry(ref->GetKey()); - } - if (entry && entry != ref) { - Copy(entry->m_LocalExtra, m_entry.m_LocalExtra); - entry->Notify(); - } - } - } - - if (m_headerSize) - m_lasterror = wxSTREAM_NO_ERROR; - return IsOk(); -} - -bool wxZipInputStream::OpenDecompressor(bool raw /*=false*/) -{ - wxASSERT(AfterHeader()); - - wxFileOffset compressedSize = m_entry.GetCompressedSize(); - - if (raw) - m_raw = true; - - if (m_raw) { - if (compressedSize != wxInvalidOffset) { - m_store->Open(compressedSize); - m_decomp = m_store; - } else { - if (!m_rawin) - m_rawin = new wxRawInputStream(*m_parent_i_stream); - m_decomp = m_rawin->Open(OpenDecompressor(m_rawin->GetTee())); - } - } else { - if (compressedSize != wxInvalidOffset && - (m_entry.GetMethod() != wxZIP_METHOD_DEFLATE || - wxZlibInputStream::CanHandleGZip())) { - m_store->Open(compressedSize); - m_decomp = OpenDecompressor(*m_store); - } else { - m_decomp = OpenDecompressor(*m_parent_i_stream); - } - } - - m_crcAccumulator = crc32(0, Z_NULL, 0); - m_lasterror = m_decomp ? m_decomp->GetLastError() : wxSTREAM_READ_ERROR; - return IsOk(); -} - -// Can be overriden to add support for additional decompression methods -// -wxInputStream *wxZipInputStream::OpenDecompressor(wxInputStream& stream) -{ - switch (m_entry.GetMethod()) { - case wxZIP_METHOD_STORE: - if (m_entry.GetSize() == wxInvalidOffset) { - wxLogError(_("stored file length not in Zip header")); - break; - } - m_store->Open(m_entry.GetSize()); - return m_store; - - case wxZIP_METHOD_DEFLATE: - if (!m_inflate) - m_inflate = new wxZlibInputStream2(stream); - else - m_inflate->Open(stream); - return m_inflate; - - default: - wxLogError(_("unsupported Zip compression method")); - } - - return NULL; -} - -bool wxZipInputStream::CloseDecompressor(wxInputStream *decomp) -{ - if (decomp && decomp == m_rawin) - return CloseDecompressor(m_rawin->GetFilterInputStream()); - if (decomp != m_store && decomp != m_inflate) - delete decomp; - return true; -} - -// Closes the current entry and positions the underlying stream at the start -// of the next entry -// -bool wxZipInputStream::CloseEntry() -{ - if (AtHeader()) - return true; - if (m_lasterror == wxSTREAM_READ_ERROR) - return false; - - if (!m_parentSeekable) { - if (!IsOpened() && !OpenDecompressor(true)) - return false; - - const int BUFSIZE = 8192; - wxCharBuffer buf(BUFSIZE); - while (IsOk()) - Read(buf.data(), BUFSIZE); - - m_position += m_headerSize + m_entry.GetCompressedSize(); - } - - if (m_lasterror == wxSTREAM_EOF) - m_lasterror = wxSTREAM_NO_ERROR; - - CloseDecompressor(m_decomp); - m_decomp = NULL; - m_entry = wxZipEntry(); - m_headerSize = 0; - m_raw = false; - - return IsOk(); -} - -size_t wxZipInputStream::OnSysRead(void *buffer, size_t size) -{ - if (!IsOpened()) - if ((AtHeader() && !DoOpen()) || !OpenDecompressor()) - m_lasterror = wxSTREAM_READ_ERROR; - if (!IsOk() || !size) - return 0; - - size_t count = m_decomp->Read(buffer, size).LastRead(); - if (!m_raw) - m_crcAccumulator = crc32(m_crcAccumulator, (Byte*)buffer, count); - if (count < size) - m_lasterror = m_decomp->GetLastError(); - - if (Eof()) { - if ((m_entry.GetFlags() & wxZIP_SUMS_FOLLOW) != 0) { - m_headerSize += m_entry.ReadDescriptor(*m_parent_i_stream); - wxZipEntry *entry = m_weaklinks->GetEntry(m_entry.GetKey()); - - if (entry) { - entry->SetCrc(m_entry.GetCrc()); - entry->SetCompressedSize(m_entry.GetCompressedSize()); - entry->SetSize(m_entry.GetSize()); - entry->Notify(); - } - } - - if (!m_raw) { - m_lasterror = wxSTREAM_READ_ERROR; - - if (m_entry.GetSize() != TellI()) - wxLogError(_("reading zip stream (entry %s): bad length"), - m_entry.GetName().c_str()); - else if (m_crcAccumulator != m_entry.GetCrc()) - wxLogError(_("reading zip stream (entry %s): bad crc"), - m_entry.GetName().c_str()); - else - m_lasterror = wxSTREAM_EOF; - } - } - - return count; -} - -#if WXWIN_COMPATIBILITY_2_6 - -// Borrowed from VS's zip stream (c) 1999 Vaclav Slavik -// -wxFileOffset wxZipInputStream::OnSysSeek(wxFileOffset seek, wxSeekMode mode) -{ - // seeking works when the stream is created with the compatibility - // constructor - if (!m_allowSeeking) - return wxInvalidOffset; - if (!IsOpened()) - if ((AtHeader() && !DoOpen()) || !OpenDecompressor()) - m_lasterror = wxSTREAM_READ_ERROR; - if (!IsOk()) - return wxInvalidOffset; - - // NB: since ZIP files don't natively support seeking, we have to - // implement a brute force workaround -- reading all the data - // between current and the new position (or between beginning of - // the file and new position...) - - wxFileOffset nextpos; - wxFileOffset pos = TellI(); - - switch ( mode ) - { - case wxFromCurrent : nextpos = seek + pos; break; - case wxFromStart : nextpos = seek; break; - case wxFromEnd : nextpos = GetLength() + seek; break; - default : nextpos = pos; break; /* just to fool compiler, never happens */ - } - - wxFileOffset toskip wxDUMMY_INITIALIZE(0); - if ( nextpos >= pos ) - { - toskip = nextpos - pos; - } - else - { - wxZipEntry current(m_entry); - if (!OpenEntry(current)) - { - m_lasterror = wxSTREAM_READ_ERROR; - return pos; - } - toskip = nextpos; - } - - if ( toskip > 0 ) - { - const int BUFSIZE = 4096; - size_t sz; - char buffer[BUFSIZE]; - while ( toskip > 0 ) - { - sz = wx_truncate_cast(size_t, wxMin(toskip, BUFSIZE)); - Read(buffer, sz); - toskip -= sz; - } - } - - pos = nextpos; - return pos; -} - -#endif // WXWIN_COMPATIBILITY_2_6 - - -///////////////////////////////////////////////////////////////////////////// -// Output stream - -#include "wx/listimpl.cpp" -WX_DEFINE_LIST(wxZipEntryList_) - -wxZipOutputStream::wxZipOutputStream(wxOutputStream& stream, - int level /*=-1*/, - wxMBConv& conv /*=wxConvLocal*/) - : wxArchiveOutputStream(stream, conv) -{ - Init(level); -} - -wxZipOutputStream::wxZipOutputStream(wxOutputStream *stream, - int level /*=-1*/, - wxMBConv& conv /*=wxConvLocal*/) - : wxArchiveOutputStream(stream, conv) -{ - Init(level); -} - -void wxZipOutputStream::Init(int level) -{ - m_store = new wxStoredOutputStream(*m_parent_o_stream); - m_deflate = NULL; - m_backlink = NULL; - m_initialData = new char[OUTPUT_LATENCY]; - m_initialSize = 0; - m_pending = NULL; - m_raw = false; - m_headerOffset = 0; - m_headerSize = 0; - m_entrySize = 0; - m_comp = NULL; - m_level = level; - m_offsetAdjustment = wxInvalidOffset; -} - -wxZipOutputStream::~wxZipOutputStream() -{ - Close(); - WX_CLEAR_LIST(wxZipEntryList_, m_entries); - delete m_store; - delete m_deflate; - delete m_pending; - delete [] m_initialData; - if (m_backlink) - m_backlink->Release(this); -} - -bool wxZipOutputStream::PutNextEntry( - const wxString& name, - const wxDateTime& dt /*=wxDateTime::Now()*/, - wxFileOffset size /*=wxInvalidOffset*/) -{ - return PutNextEntry(new wxZipEntry(name, dt, size)); -} - -bool wxZipOutputStream::PutNextDirEntry( - const wxString& name, - const wxDateTime& dt /*=wxDateTime::Now()*/) -{ - wxZipEntry *entry = new wxZipEntry(name, dt); - entry->SetIsDir(); - return PutNextEntry(entry); -} - -bool wxZipOutputStream::CopyEntry(wxZipEntry *entry, - wxZipInputStream& inputStream) -{ - wxZipEntryPtr_ e(entry); - - return - inputStream.DoOpen(e.get(), true) && - DoCreate(e.release(), true) && - Write(inputStream).IsOk() && inputStream.Eof(); -} - -bool wxZipOutputStream::PutNextEntry(wxArchiveEntry *entry) -{ - wxZipEntry *zipEntry = wxStaticCast(entry, wxZipEntry); - if (!zipEntry) - delete entry; - return PutNextEntry(zipEntry); -} - -bool wxZipOutputStream::CopyEntry(wxArchiveEntry *entry, - wxArchiveInputStream& stream) -{ - wxZipEntry *zipEntry = wxStaticCast(entry, wxZipEntry); - - if (!zipEntry || !stream.OpenEntry(*zipEntry)) { - delete entry; - return false; - } - - return CopyEntry(zipEntry, wx_static_cast(wxZipInputStream&, stream)); -} - -bool wxZipOutputStream::CopyArchiveMetaData(wxZipInputStream& inputStream) -{ - m_Comment = inputStream.GetComment(); - if (m_backlink) - m_backlink->Release(this); - m_backlink = inputStream.MakeLink(this); - return true; -} - -bool wxZipOutputStream::CopyArchiveMetaData(wxArchiveInputStream& stream) -{ - return CopyArchiveMetaData(wx_static_cast(wxZipInputStream&, stream)); -} - -void wxZipOutputStream::SetLevel(int level) -{ - if (level != m_level) { - if (m_comp != m_deflate) - delete m_deflate; - m_deflate = NULL; - m_level = level; - } -} - -bool wxZipOutputStream::DoCreate(wxZipEntry *entry, bool raw /*=false*/) -{ - CloseEntry(); - - m_pending = entry; - if (!m_pending) - return false; - - // write the signature bytes right away - wxDataOutputStream ds(*m_parent_o_stream); - ds << LOCAL_MAGIC; - - // and if this is the first entry test for seekability - if (m_headerOffset == 0 && m_parent_o_stream->IsSeekable()) { -#if wxUSE_LOG - bool logging = wxLog::IsEnabled(); - wxLogNull nolog; -#endif // wxUSE_LOG - wxFileOffset here = m_parent_o_stream->TellO(); - - if (here != wxInvalidOffset && here >= 4) { - if (m_parent_o_stream->SeekO(here - 4) == here - 4) { - m_offsetAdjustment = here - 4; -#if wxUSE_LOG - wxLog::EnableLogging(logging); -#endif // wxUSE_LOG - m_parent_o_stream->SeekO(here); - } - } - } - - m_pending->SetOffset(m_headerOffset); - - m_crcAccumulator = crc32(0, Z_NULL, 0); - - if (raw) - m_raw = true; - - m_lasterror = wxSTREAM_NO_ERROR; - return true; -} - -// Can be overriden to add support for additional compression methods -// -wxOutputStream *wxZipOutputStream::OpenCompressor( - wxOutputStream& stream, - wxZipEntry& entry, - const Buffer bufs[]) -{ - if (entry.GetMethod() == wxZIP_METHOD_DEFAULT) { - if (GetLevel() == 0 - && (IsParentSeekable() - || entry.GetCompressedSize() != wxInvalidOffset - || entry.GetSize() != wxInvalidOffset)) { - entry.SetMethod(wxZIP_METHOD_STORE); - } else { - int size = 0; - for (int i = 0; bufs[i].m_data; ++i) - size += bufs[i].m_size; - entry.SetMethod(size <= 6 ? - wxZIP_METHOD_STORE : wxZIP_METHOD_DEFLATE); - } - } - - switch (entry.GetMethod()) { - case wxZIP_METHOD_STORE: - if (entry.GetCompressedSize() == wxInvalidOffset) - entry.SetCompressedSize(entry.GetSize()); - return m_store; - - case wxZIP_METHOD_DEFLATE: - { - int defbits = wxZIP_DEFLATE_NORMAL; - switch (GetLevel()) { - case 0: case 1: - defbits = wxZIP_DEFLATE_SUPERFAST; - break; - case 2: case 3: case 4: - defbits = wxZIP_DEFLATE_FAST; - break; - case 8: case 9: - defbits = wxZIP_DEFLATE_EXTRA; - break; - } - entry.SetFlags((entry.GetFlags() & ~wxZIP_DEFLATE_MASK) | - defbits | wxZIP_SUMS_FOLLOW); - - if (!m_deflate) - m_deflate = new wxZlibOutputStream2(stream, GetLevel()); - else - m_deflate->Open(stream); - - return m_deflate; - } - - default: - wxLogError(_("unsupported Zip compression method")); - } - - return NULL; -} - -bool wxZipOutputStream::CloseCompressor(wxOutputStream *comp) -{ - if (comp == m_deflate) - m_deflate->Close(); - else if (comp != m_store) - delete comp; - return true; -} - -// This is called when OUPUT_LATENCY bytes has been written to the -// wxZipOutputStream to actually create the zip entry. -// -void wxZipOutputStream::CreatePendingEntry(const void *buffer, size_t size) -{ - wxASSERT(IsOk() && m_pending && !m_comp); - wxZipEntryPtr_ spPending(m_pending); - m_pending = NULL; - - Buffer bufs[] = { - { m_initialData, m_initialSize }, - { (const char*)buffer, size }, - { NULL, 0 } - }; - - if (m_raw) - m_comp = m_store; - else - m_comp = OpenCompressor(*m_store, *spPending, - m_initialSize ? bufs : bufs + 1); - - if (IsParentSeekable() - || (spPending->m_Crc - && spPending->m_CompressedSize != wxInvalidOffset - && spPending->m_Size != wxInvalidOffset)) - spPending->m_Flags &= ~wxZIP_SUMS_FOLLOW; - else - if (spPending->m_CompressedSize != wxInvalidOffset) - spPending->m_Flags |= wxZIP_SUMS_FOLLOW; - - m_headerSize = spPending->WriteLocal(*m_parent_o_stream, GetConv()); - m_lasterror = m_parent_o_stream->GetLastError(); - - if (IsOk()) { - m_entries.push_back(spPending.release()); - OnSysWrite(m_initialData, m_initialSize); - } - - m_initialSize = 0; -} - -// This is called to write out the zip entry when Close has been called -// before OUTPUT_LATENCY bytes has been written to the wxZipOutputStream. -// -void wxZipOutputStream::CreatePendingEntry() -{ - wxASSERT(IsOk() && m_pending && !m_comp); - wxZipEntryPtr_ spPending(m_pending); - m_pending = NULL; - m_lasterror = wxSTREAM_WRITE_ERROR; - - if (!m_raw) { - // Initially compresses the data to memory, then fall back to 'store' - // if the compressor makes the data larger rather than smaller. - wxMemoryOutputStream mem; - Buffer bufs[] = { { m_initialData, m_initialSize }, { NULL, 0 } }; - wxOutputStream *comp = OpenCompressor(mem, *spPending, bufs); - - if (!comp) - return; - if (comp != m_store) { - bool ok = comp->Write(m_initialData, m_initialSize).IsOk(); - CloseCompressor(comp); - if (!ok) - return; - } - - m_entrySize = m_initialSize; - m_crcAccumulator = crc32(0, (Byte*)m_initialData, m_initialSize); - - if (mem.GetSize() > 0 && mem.GetSize() < m_initialSize) { - m_initialSize = mem.GetSize(); - mem.CopyTo(m_initialData, m_initialSize); - } else { - spPending->SetMethod(wxZIP_METHOD_STORE); - } - - spPending->SetSize(m_entrySize); - spPending->SetCrc(m_crcAccumulator); - spPending->SetCompressedSize(m_initialSize); - } - - spPending->m_Flags &= ~wxZIP_SUMS_FOLLOW; - m_headerSize = spPending->WriteLocal(*m_parent_o_stream, GetConv()); - - if (m_parent_o_stream->IsOk()) { - m_entries.push_back(spPending.release()); - m_comp = m_store; - m_store->Write(m_initialData, m_initialSize); - } - - m_initialSize = 0; - m_lasterror = m_parent_o_stream->GetLastError(); -} - -// Write the 'central directory' and the 'end-central-directory' records. -// -bool wxZipOutputStream::Close() -{ - CloseEntry(); - - if (m_lasterror == wxSTREAM_WRITE_ERROR || m_entries.size() == 0) { - wxFilterOutputStream::Close(); - return false; - } - - wxZipEndRec endrec; - - endrec.SetEntriesHere(m_entries.size()); - endrec.SetTotalEntries(m_entries.size()); - endrec.SetOffset(m_headerOffset); - endrec.SetComment(m_Comment); - - wxZipEntryList_::iterator it; - wxFileOffset size = 0; - - for (it = m_entries.begin(); it != m_entries.end(); ++it) { - size += (*it)->WriteCentral(*m_parent_o_stream, GetConv()); - delete *it; - } - m_entries.clear(); - - endrec.SetSize(size); - endrec.Write(*m_parent_o_stream, GetConv()); - - m_lasterror = m_parent_o_stream->GetLastError(); - - if (!wxFilterOutputStream::Close() || !IsOk()) - return false; - m_lasterror = wxSTREAM_EOF; - return true; -} - -// Finish writing the current entry -// -bool wxZipOutputStream::CloseEntry() -{ - if (IsOk() && m_pending) - CreatePendingEntry(); - if (!IsOk()) - return false; - if (!m_comp) - return true; - - CloseCompressor(m_comp); - m_comp = NULL; - - wxFileOffset compressedSize = m_store->TellO(); - - wxZipEntry& entry = *m_entries.back(); - - // When writing raw the crc and size can't be checked - if (m_raw) { - m_crcAccumulator = entry.GetCrc(); - m_entrySize = entry.GetSize(); - } - - // Write the sums in the trailing 'data descriptor' if necessary - if (entry.m_Flags & wxZIP_SUMS_FOLLOW) { - wxASSERT(!IsParentSeekable()); - m_headerOffset += - entry.WriteDescriptor(*m_parent_o_stream, m_crcAccumulator, - compressedSize, m_entrySize); - m_lasterror = m_parent_o_stream->GetLastError(); - } - - // If the local header didn't have the correct crc and size written to - // it then seek back and fix it - else if (m_crcAccumulator != entry.GetCrc() - || m_entrySize != entry.GetSize() - || compressedSize != entry.GetCompressedSize()) - { - if (IsParentSeekable()) { - wxFileOffset here = m_parent_o_stream->TellO(); - wxFileOffset headerOffset = m_headerOffset + m_offsetAdjustment; - m_parent_o_stream->SeekO(headerOffset + SUMS_OFFSET); - entry.WriteDescriptor(*m_parent_o_stream, m_crcAccumulator, - compressedSize, m_entrySize); - m_parent_o_stream->SeekO(here); - m_lasterror = m_parent_o_stream->GetLastError(); - } else { - m_lasterror = wxSTREAM_WRITE_ERROR; - } - } - - m_headerOffset += m_headerSize + compressedSize; - m_headerSize = 0; - m_entrySize = 0; - m_store->Close(); - m_raw = false; - - if (IsOk()) - m_lasterror = m_parent_o_stream->GetLastError(); - else - wxLogError(_("error writing zip entry '%s': bad crc or length"), - entry.GetName().c_str()); - return IsOk(); -} - -void wxZipOutputStream::Sync() -{ - if (IsOk() && m_pending) - CreatePendingEntry(NULL, 0); - if (!m_comp) - m_lasterror = wxSTREAM_WRITE_ERROR; - if (IsOk()) { - m_comp->Sync(); - m_lasterror = m_comp->GetLastError(); - } -} - -size_t wxZipOutputStream::OnSysWrite(const void *buffer, size_t size) -{ - if (IsOk() && m_pending) { - if (m_initialSize + size < OUTPUT_LATENCY) { - memcpy(m_initialData + m_initialSize, buffer, size); - m_initialSize += size; - return size; - } else { - CreatePendingEntry(buffer, size); - } - } - - if (!m_comp) - m_lasterror = wxSTREAM_WRITE_ERROR; - if (!IsOk() || !size) - return 0; - - if (m_comp->Write(buffer, size).LastWrite() != size) - m_lasterror = wxSTREAM_WRITE_ERROR; - m_crcAccumulator = crc32(m_crcAccumulator, (Byte*)buffer, size); - m_entrySize += m_comp->LastWrite(); - - return m_comp->LastWrite(); -} - -#endif // wxUSE_ZIPSTREAM diff --git a/wxWidgets/src/common/zstream.cpp b/wxWidgets/src/common/zstream.cpp deleted file mode 100644 index 8f66fce17f..0000000000 --- a/wxWidgets/src/common/zstream.cpp +++ /dev/null @@ -1,428 +0,0 @@ -////////////////////////////////////////////////////////////////////////////// -// Name: src/common/zstream.cpp -// Purpose: Compressed stream classes -// Author: Guilhem Lavaux -// Modified by: Mike Wetherell -// Created: 11/07/98 -// RCS-ID: $Id: zstream.cpp 42621 2006-10-29 16:47:20Z MW $ -// Copyright: (c) Guilhem Lavaux -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_ZLIB && wxUSE_STREAMS - -#include "wx/zstream.h" - -#ifndef WX_PRECOMP - #include "wx/intl.h" - #include "wx/log.h" - #include "wx/utils.h" -#endif - - -// normally, the compiler options should contain -I../zlib, but it is -// apparently not the case for all MSW makefiles and so, unless we use -// configure (which defines __WX_SETUP_H__) or it is explicitly overridden by -// the user (who can define wxUSE_ZLIB_H_IN_PATH), we hardcode the path here -#if defined(__WXMSW__) && !defined(__WX_SETUP_H__) && !defined(wxUSE_ZLIB_H_IN_PATH) - #include "../zlib/zlib.h" -#else - #include "zlib.h" -#endif - -enum { - ZSTREAM_BUFFER_SIZE = 16384, - ZSTREAM_GZIP = 0x10, // gzip header - ZSTREAM_AUTO = 0x20 // auto detect between gzip and zlib -}; - - -///////////////////////////////////////////////////////////////////////////// -// Zlib Class factory - -IMPLEMENT_DYNAMIC_CLASS(wxZlibClassFactory, wxFilterClassFactory) - -static wxZlibClassFactory g_wxZlibClassFactory; - -wxZlibClassFactory::wxZlibClassFactory() -{ - if (this == &g_wxZlibClassFactory) - PushFront(); -} - -const wxChar * const * -wxZlibClassFactory::GetProtocols(wxStreamProtocolType type) const -{ - static const wxChar *mimes[] = { _T("application/x-deflate"), NULL }; - static const wxChar *encs[] = { _T("deflate"), NULL }; - static const wxChar *empty[] = { NULL }; - - switch (type) { - case wxSTREAM_MIMETYPE: return mimes; - case wxSTREAM_ENCODING: return encs; - default: return empty; - } -} - - -///////////////////////////////////////////////////////////////////////////// -// Gzip Class factory - -IMPLEMENT_DYNAMIC_CLASS(wxGzipClassFactory, wxFilterClassFactory) - -static wxGzipClassFactory g_wxGzipClassFactory; - -wxGzipClassFactory::wxGzipClassFactory() -{ - if (this == &g_wxGzipClassFactory && wxZlibInputStream::CanHandleGZip()) - PushFront(); -} - -const wxChar * const * -wxGzipClassFactory::GetProtocols(wxStreamProtocolType type) const -{ - static const wxChar *protos[] = - { _T("gzip"), NULL }; - static const wxChar *mimes[] = - { _T("application/gzip"), _T("application/x-gzip"), NULL }; - static const wxChar *encs[] = - { _T("gzip"), NULL }; - static const wxChar *exts[] = - { _T(".gz"), _T(".gzip"), NULL }; - static const wxChar *empty[] = - { NULL }; - - switch (type) { - case wxSTREAM_PROTOCOL: return protos; - case wxSTREAM_MIMETYPE: return mimes; - case wxSTREAM_ENCODING: return encs; - case wxSTREAM_FILEEXT: return exts; - default: return empty; - } -} - - -////////////////////// -// wxZlibInputStream -////////////////////// - -wxZlibInputStream::wxZlibInputStream(wxInputStream& stream, int flags) - : wxFilterInputStream(stream) -{ - Init(flags); -} - -wxZlibInputStream::wxZlibInputStream(wxInputStream *stream, int flags) - : wxFilterInputStream(stream) -{ - Init(flags); -} - -void wxZlibInputStream::Init(int flags) -{ - m_inflate = NULL; - m_z_buffer = new unsigned char[ZSTREAM_BUFFER_SIZE]; - m_z_size = ZSTREAM_BUFFER_SIZE; - m_pos = 0; - -#if WXWIN_COMPATIBILITY_2_4 - // treat compatibility mode as auto - m_24compatibilty = flags == wxZLIB_24COMPATIBLE; - if (m_24compatibilty) - flags = wxZLIB_AUTO; -#endif - - // if gzip is asked for but not supported... - if ((flags == wxZLIB_GZIP || flags == wxZLIB_AUTO) && !CanHandleGZip()) { - if (flags == wxZLIB_AUTO) { - // an error will come later if the input turns out not to be a zlib - flags = wxZLIB_ZLIB; - } - else { - wxLogError(_("Gzip not supported by this version of zlib")); - m_lasterror = wxSTREAM_READ_ERROR; - return; - } - } - - if (m_z_buffer) { - m_inflate = new z_stream_s; - - if (m_inflate) { - memset(m_inflate, 0, sizeof(z_stream_s)); - - // see zlib.h for documentation on windowBits - int windowBits = MAX_WBITS; - switch (flags) { - case wxZLIB_NO_HEADER: windowBits = -MAX_WBITS; break; - case wxZLIB_ZLIB: windowBits = MAX_WBITS; break; - case wxZLIB_GZIP: windowBits = MAX_WBITS | ZSTREAM_GZIP; break; - case wxZLIB_AUTO: windowBits = MAX_WBITS | ZSTREAM_AUTO; break; - default: wxFAIL_MSG(wxT("Invalid zlib flag")); - } - - if (inflateInit2(m_inflate, windowBits) == Z_OK) - return; - } - } - - wxLogError(_("Can't initialize zlib inflate stream.")); - m_lasterror = wxSTREAM_READ_ERROR; -} - -wxZlibInputStream::~wxZlibInputStream() -{ - inflateEnd(m_inflate); - delete m_inflate; - - delete [] m_z_buffer; -} - -size_t wxZlibInputStream::OnSysRead(void *buffer, size_t size) -{ - wxASSERT_MSG(m_inflate && m_z_buffer, wxT("Inflate stream not open")); - - if (!m_inflate || !m_z_buffer) - m_lasterror = wxSTREAM_READ_ERROR; - if (!IsOk() || !size) - return 0; - - int err = Z_OK; - m_inflate->next_out = (unsigned char *)buffer; - m_inflate->avail_out = size; - - while (err == Z_OK && m_inflate->avail_out > 0) { - if (m_inflate->avail_in == 0 && m_parent_i_stream->IsOk()) { - m_parent_i_stream->Read(m_z_buffer, m_z_size); - m_inflate->next_in = m_z_buffer; - m_inflate->avail_in = m_parent_i_stream->LastRead(); - } - err = inflate(m_inflate, Z_SYNC_FLUSH); - } - - switch (err) { - case Z_OK: - break; - - case Z_STREAM_END: - if (m_inflate->avail_out) { - // Unread any data taken from past the end of the deflate stream, so that - // any additional data can be read from the underlying stream (the crc - // in a gzip for example) - if (m_inflate->avail_in) { - m_parent_i_stream->Reset(); - m_parent_i_stream->Ungetch(m_inflate->next_in, m_inflate->avail_in); - m_inflate->avail_in = 0; - } - m_lasterror = wxSTREAM_EOF; - } - break; - - case Z_BUF_ERROR: - // Indicates that zlib was expecting more data, but the parent stream - // has none. Other than Eof the error will have been already reported - // by the parent strean, - m_lasterror = wxSTREAM_READ_ERROR; - if (m_parent_i_stream->Eof()) -#if WXWIN_COMPATIBILITY_2_4 - if (m_24compatibilty) - m_lasterror = wxSTREAM_EOF; - else -#endif - wxLogError(_("Can't read inflate stream: unexpected EOF in underlying stream.")); - break; - - default: - wxString msg(m_inflate->msg, *wxConvCurrent); - if (!msg) - msg = wxString::Format(_("zlib error %d"), err); - wxLogError(_("Can't read from inflate stream: %s"), msg.c_str()); - m_lasterror = wxSTREAM_READ_ERROR; - } - - size -= m_inflate->avail_out; - m_pos += size; - return size; -} - -/* static */ bool wxZlibInputStream::CanHandleGZip() -{ - const char *dot = strchr(zlibVersion(), '.'); - int major = atoi(zlibVersion()); - int minor = dot ? atoi(dot + 1) : 0; - return major > 1 || (major == 1 && minor >= 2); -} - - -////////////////////// -// wxZlibOutputStream -////////////////////// - -wxZlibOutputStream::wxZlibOutputStream(wxOutputStream& stream, - int level, - int flags) - : wxFilterOutputStream(stream) -{ - Init(level, flags); -} - -wxZlibOutputStream::wxZlibOutputStream(wxOutputStream *stream, - int level, - int flags) - : wxFilterOutputStream(stream) -{ - Init(level, flags); -} - -void wxZlibOutputStream::Init(int level, int flags) -{ - m_deflate = NULL; - m_z_buffer = new unsigned char[ZSTREAM_BUFFER_SIZE]; - m_z_size = ZSTREAM_BUFFER_SIZE; - m_pos = 0; - - if ( level == -1 ) - { - level = Z_DEFAULT_COMPRESSION; - } - else - { - wxASSERT_MSG(level >= 0 && level <= 9, wxT("wxZlibOutputStream compression level must be between 0 and 9!")); - } - - // if gzip is asked for but not supported... - if (flags == wxZLIB_GZIP && !CanHandleGZip()) { - wxLogError(_("Gzip not supported by this version of zlib")); - m_lasterror = wxSTREAM_WRITE_ERROR; - return; - } - - if (m_z_buffer) { - m_deflate = new z_stream_s; - - if (m_deflate) { - memset(m_deflate, 0, sizeof(z_stream_s)); - m_deflate->next_out = m_z_buffer; - m_deflate->avail_out = m_z_size; - - // see zlib.h for documentation on windowBits - int windowBits = MAX_WBITS; - switch (flags) { - case wxZLIB_NO_HEADER: windowBits = -MAX_WBITS; break; - case wxZLIB_ZLIB: windowBits = MAX_WBITS; break; - case wxZLIB_GZIP: windowBits = MAX_WBITS | ZSTREAM_GZIP; break; - default: wxFAIL_MSG(wxT("Invalid zlib flag")); - } - - if (deflateInit2(m_deflate, level, Z_DEFLATED, windowBits, - 8, Z_DEFAULT_STRATEGY) == Z_OK) - return; - } - } - - wxLogError(_("Can't initialize zlib deflate stream.")); - m_lasterror = wxSTREAM_WRITE_ERROR; -} - -bool wxZlibOutputStream::Close() - { - DoFlush(true); - deflateEnd(m_deflate); - delete m_deflate; - - m_deflate = NULL; - delete[] m_z_buffer; - m_z_buffer = NULL; - - return wxFilterOutputStream::Close() && IsOk(); - } - -void wxZlibOutputStream::DoFlush(bool final) -{ - if (!m_deflate || !m_z_buffer) - m_lasterror = wxSTREAM_WRITE_ERROR; - if (!IsOk()) - return; - - int err = Z_OK; - bool done = false; - - while (err == Z_OK || err == Z_STREAM_END) { - size_t len = m_z_size - m_deflate->avail_out; - if (len) { - if (m_parent_o_stream->Write(m_z_buffer, len).LastWrite() != len) { - m_lasterror = wxSTREAM_WRITE_ERROR; - wxLogDebug(wxT("wxZlibOutputStream: Error writing to underlying stream")); - break; - } - m_deflate->next_out = m_z_buffer; - m_deflate->avail_out = m_z_size; - } - - if (done) - break; - err = deflate(m_deflate, final ? Z_FINISH : Z_FULL_FLUSH); - done = m_deflate->avail_out != 0 || err == Z_STREAM_END; - } -} - -size_t wxZlibOutputStream::OnSysWrite(const void *buffer, size_t size) -{ - wxASSERT_MSG(m_deflate && m_z_buffer, wxT("Deflate stream not open")); - - if (!m_deflate || !m_z_buffer) - { - // notice that this will make IsOk() test just below return false - m_lasterror = wxSTREAM_WRITE_ERROR; - } - - if (!IsOk() || !size) - return 0; - - int err = Z_OK; - m_deflate->next_in = (unsigned char *)buffer; - m_deflate->avail_in = size; - - while (err == Z_OK && m_deflate->avail_in > 0) { - if (m_deflate->avail_out == 0) { - m_parent_o_stream->Write(m_z_buffer, m_z_size); - if (m_parent_o_stream->LastWrite() != m_z_size) { - m_lasterror = wxSTREAM_WRITE_ERROR; - wxLogDebug(wxT("wxZlibOutputStream: Error writing to underlying stream")); - break; - } - - m_deflate->next_out = m_z_buffer; - m_deflate->avail_out = m_z_size; - } - - err = deflate(m_deflate, Z_NO_FLUSH); - } - - if (err != Z_OK) { - m_lasterror = wxSTREAM_WRITE_ERROR; - wxString msg(m_deflate->msg, *wxConvCurrent); - if (!msg) - msg = wxString::Format(_("zlib error %d"), err); - wxLogError(_("Can't write to deflate stream: %s"), msg.c_str()); - } - - size -= m_deflate->avail_in; - m_pos += size; - return size; -} - -/* static */ bool wxZlibOutputStream::CanHandleGZip() -{ - return wxZlibInputStream::CanHandleGZip(); -} - -#endif - // wxUSE_ZLIB && wxUSE_STREAMS diff --git a/wxWidgets/src/cwcopysetup.bat b/wxWidgets/src/cwcopysetup.bat deleted file mode 100644 index a918a7bfee..0000000000 --- a/wxWidgets/src/cwcopysetup.bat +++ /dev/null @@ -1,32 +0,0 @@ -if exist ..\include\wx\msw\setup.h ( - echo include\wx\msw\setup.h already exists -) else ( - copy /y ..\include\wx\msw\setup0.h ..\include\wx\msw\setup.h -) - -if exist ..\lib\cw7msw ( - echo lib\cw7msw already exists -) else ( - mkdir ..\lib\cw7msw -) - -if exist ..\lib\cw7msw\include ( - echo lib\cw7msw\include already exists -) else ( - mkdir ..\lib\cw7msw\include -) - -if exist ..\lib\cw7msw\include\wx ( - echo lib\cw7msw\include\wx already exists -) else ( - mkdir ..\lib\cw7msw\include\wx -) - -if exist ..\lib\cw7msw\include\wx\setup.h ( - echo lib\cw7msw\include\wx\setup.h already exists -) else ( - copy /y ..\include\wx\msw\setup.h ..\lib\cw7msw\include\wx\setup.h -) - -rem pause - diff --git a/wxWidgets/src/cwdcopysetup.bat b/wxWidgets/src/cwdcopysetup.bat deleted file mode 100644 index b902913964..0000000000 --- a/wxWidgets/src/cwdcopysetup.bat +++ /dev/null @@ -1,32 +0,0 @@ -if exist ..\include\wx\msw\setup.h ( - echo include\wx\msw\setup.h already exists -) else ( - copy /y ..\include\wx\msw\setup0.h ..\include\wx\msw\setup.h -) - -if exist ..\lib\cw7mswd ( - echo lib\cw7mswd already exists -) else ( - mkdir ..\lib\cw7mswd -) - -if exist ..\lib\cw7mswd\include ( - echo lib\cw7mswd\include already exists -) else ( - mkdir ..\lib\cw7mswd\include -) - -if exist ..\lib\cw7mswd\include\wx ( - echo lib\cw7mswd\include\wx already exists -) else ( - mkdir ..\lib\cw7mswd\include\wx -) - -if exist ..\lib\cw7mswd\include\wx\setup.h ( - echo lib\cw7mswd\include\wx\setup.h already exists -) else ( - copy /y ..\include\wx\msw\setup.h ..\lib\cw7mswd\include\wx\setup.h -) - -rem pause - diff --git a/wxWidgets/src/cygnus.bat b/wxWidgets/src/cygnus.bat deleted file mode 100644 index 3d1d6573a2..0000000000 --- a/wxWidgets/src/cygnus.bat +++ /dev/null @@ -1,11 +0,0 @@ -Rem This sets up the environment for Cygwin. Replace g:\gnuwin32\b20 with your -Rem Cygwin directory. -@ECHO OFF -SET MAKE_MODE=UNIX -PATH C:\WINDOWS;C:\WINDOWS\command;g:\GNUWIN32\B20\CYGWIN~1\H-I586~1\BIN;d:\wx\utils\tex2rtf\bin;g:\ast\astex;g:\ast\emtex\bin;g:\cvs;c:\bin -set BISON_SIMPLE=g:\gnuwin32\b20\cygwin-b20\share\bison.simple -set BISON_HAIRY=g:\gnuwin32\b20\cygwin-b20\share\bison.hairy - -Rem 4DOS users only... -unalias make -alias makegnu make -f makefile.g95 diff --git a/wxWidgets/src/expat/COPYING b/wxWidgets/src/expat/COPYING deleted file mode 100644 index e3ad54e969..0000000000 --- a/wxWidgets/src/expat/COPYING +++ /dev/null @@ -1,22 +0,0 @@ -Copyright (c) 1998, 1999, 2000 Thai Open Source Software Center Ltd - and Clark Cooper -Copyright (c) 2001, 2002 Expat maintainers. - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/wxWidgets/src/expat/Changes b/wxWidgets/src/expat/Changes deleted file mode 100644 index c5f75d0c8e..0000000000 --- a/wxWidgets/src/expat/Changes +++ /dev/null @@ -1,107 +0,0 @@ -Release 1.95.6 Tue Jan 28 2003 - - Added XML_FreeContentModel(). - - Added XML_MemMalloc(), XML_MemRealloc(), XML_MemFree(). - - Fixed a variety of bugs: see SF issues 615606, 616863, - 618199, 653180, 673791. - - Enhanced the regression test suite. - - Man page improvements: includes SF issue 632146. - -Release 1.95.5 Fri Sep 6 2002 - - Added XML_UseForeignDTD() for improved SAX2 support. - - Added XML_GetFeatureList(). - - Defined XML_Bool type and the values XML_TRUE and XML_FALSE. - - Use an incomplete struct instead of a void* for the parser - (may not retain). - - Fixed UTF-8 decoding bug that caused legal UTF-8 to be rejected. - - Finally fixed bug where default handler would report DTD - events that were already handled by another handler. - Initial patch contributed by Darryl Miles. - - Removed unnecessary DllMain() function that caused static - linking into a DLL to be difficult. - - Added VC++ projects for building static libraries. - - Reduced line-length for all source code and headers to be - no longer than 80 characters, to help with AS/400 support. - - Reduced memory copying during parsing (SF patch #600964). - - Fixed a variety of bugs: see SF issues 580793, 434664, - 483514, 580503, 581069, 584041, 584183, 584832, 585537, - 596555, 596678, 598352, 598944, 599715, 600479, 600971. - -Release 1.95.4 Fri Jul 12 2002 - - Added support for VMS, contributed by Craig Berry. See - vms/README.vms for more information. - - Added Mac OS (classic) support, with a makefile for MPW, - contributed by Thomas Wegner and Daryle Walker. - - Added Borland C++ Builder 5 / BCC 5.5 support, contributed - by Patrick McConnell (SF patch #538032). - - Fixed a variety of bugs: see SF issues 441449, 563184, - 564342, 566334, 566901, 569461, 570263, 575168, 579196. - - Made skippedEntityHandler conform to SAX2 (see source comment) - - Re-implemented WFC: Entity Declared from XML 1.0 spec and - added a new error "entity declared in parameter entity": - see SF bug report 569461 and SF patch 578161 - - Re-implemented section 5.1 from XML 1.0 spec: - see SF bug report 570263 and SF patch 578161 - -Release 1.95.3 Mon Jun 3 2002 - - Added a project to the MSVC workspace to create a wchar_t - version of the library; the DLLs are named libexpatw.dll. - - Changed the name of the Windows DLLs from expat.dll to - libexpat.dll; this fixes SF bug #432456. - - Added the XML_ParserReset() API function. - - Fixed XML_SetReturnNSTriplet() to work for element names. - - Made the XML_UNICODE builds usable (thanks, Karl!). - - Allow xmlwf to read from standard input. - - Install a man page for xmlwf on Unix systems. - - Fixed many bugs; see SF bug reports 231864, 461380, 464837, - 466885, 469226, 477667, 484419, 487840, 494749, 496505, - 547350. Other bugs which we can't test as easily may also - have been fixed, especially in the area of build support. - -Release 1.95.2 Fri Jul 27 2001 - - More changes to make MSVC happy with the build; add a single - workspace to support both the library and xmlwf application. - - Added a Windows installer for Windows users; includes - xmlwf.exe. - - Added compile-time constants that can be used to determine the - Expat version - - Removed a lot of GNU-specific dependencies to aide portability - among the various Unix flavors. - - Fix the UTF-8 BOM bug. - - Cleaned up warning messages for several compilers. - - Added the -Wall, -Wstrict-prototypes options for GCC. - -Release 1.95.1 Sun Oct 22 15:11:36 EDT 2000 - - Changes to get expat to build under Microsoft compiler - - Removed all aborts and instead return an UNEXPECTED_STATE error. - - Fixed a bug where a stray '%' in an entity value would cause an - abort. - - Defined XML_SetEndNamespaceDeclHandler. Thanks to Darryl Miles for - finding this oversight. - - Changed default patterns in lib/Makefile.in to fit non-GNU makes - Thanks to robin@unrated.net for reporting and providing an - account to test on. - - The reference had the wrong label for XML_SetStartNamespaceDecl. - Reported by an anonymous user. - -Release 1.95.0 Fri Sep 29 2000 - - XML_ParserCreate_MM - Allows you to set a memory management suite to replace the - standard malloc,realloc, and free. - - XML_SetReturnNSTriplet - If you turn this feature on when namespace processing is in - effect, then qualified, prefixed element and attribute names - are returned as "uri|name|prefix" where '|' is whatever - separator character is used in namespace processing. - - Merged in features from perl-expat - o XML_SetElementDeclHandler - o XML_SetAttlistDeclHandler - o XML_SetXmlDeclHandler - o XML_SetEntityDeclHandler - o StartDoctypeDeclHandler takes 3 additional parameters: - sysid, pubid, has_internal_subset - o Many paired handler setters (like XML_SetElementHandler) - now have corresponding individual handler setters - o XML_GetInputContext for getting the input context of - the current parse position. - - Added reference material - - Packaged into a distribution that builds a sharable library diff --git a/wxWidgets/src/expat/MANIFEST b/wxWidgets/src/expat/MANIFEST deleted file mode 100644 index deeaf2cfbf..0000000000 --- a/wxWidgets/src/expat/MANIFEST +++ /dev/null @@ -1,92 +0,0 @@ -Changes -COPYING -MANIFEST -Makefile.in -README -configure -configure.in -expat_config.h.in -bcb5/README.txt -bcb5/elements.bpf -bcb5/elements.bpr -bcb5/elements.mak -bcb5/expat.bpf -bcb5/expat.bpr -bcb5/expat.mak -bcb5/expat_static.bpf -bcb5/expat_static.bpr -bcb5/expat_static.mak -bcb5/expatw.bpf -bcb5/expatw.bpr -bcb5/expatw.mak -bcb5/expatw_static.bpf -bcb5/expatw_static.bpr -bcb5/expatw_static.mak -bcb5/libexpat_mtd.def -bcb5/libexpatw_mtd.def -bcb5/makefile.mak -bcb5/outline.bpf -bcb5/outline.bpr -bcb5/outline.mak -bcb5/setup.bat -bcb5/xmlwf.bpf -bcb5/xmlwf.bpr -bcb5/xmlwf.mak -conftools/PrintPath -conftools/ac_c_bigendian_cross.m4 -conftools/config.guess -conftools/config.sub -conftools/expat.m4 -conftools/install-sh -conftools/libtool.m4 -conftools/ltmain.sh -conftools/mkinstalldirs -doc/reference.html -doc/style.css -doc/valid-xhtml10.png -doc/xmlwf.1 -doc/xmlwf.sgml -examples/elements.c -examples/outline.c -lib/ascii.h -lib/asciitab.h -lib/expat.h -lib/iasciitab.h -lib/internal.h -lib/latin1tab.h -lib/nametab.h -lib/utf8tab.h -lib/xmlparse.c -lib/xmlrole.c -lib/xmlrole.h -lib/xmltok.c -lib/xmltok.h -lib/xmltok_impl.c -lib/xmltok_impl.h -lib/xmltok_ns.c -lib/winconfig.h -tests/README.txt -tests/chardata.c -tests/chardata.h -tests/runtests.c -tests/xmltest.sh -vms/descrip.mms -vms/expat_config.h -vms/README.vms -win32/expat.iss -win32/MANIFEST.txt -xmlwf/codepage.c -xmlwf/codepage.h -xmlwf/ct.c -xmlwf/filemap.h -xmlwf/readfilemap.c -xmlwf/unixfilemap.c -xmlwf/win32filemap.c -xmlwf/xmlfile.c -xmlwf/xmlfile.h -xmlwf/xmlmime.c -xmlwf/xmlmime.h -xmlwf/xmltchar.h -xmlwf/xmlurl.h -xmlwf/xmlwf.c -xmlwf/xmlwin32url.cxx diff --git a/wxWidgets/src/expat/Makefile.in b/wxWidgets/src/expat/Makefile.in deleted file mode 100644 index 4c78a6cc12..0000000000 --- a/wxWidgets/src/expat/Makefile.in +++ /dev/null @@ -1,173 +0,0 @@ -################################################################ -# Process this file with top-level configure script to produce Makefile -# -# Copyright 2000 Clark Cooper -# -# This file is part of EXPAT. -# -# EXPAT is free software; you can redistribute it and/or modify it -# under the terms of the License (based on the MIT/X license) contained -# in the file COPYING that comes with this distribution. -# -# EXPAT IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -# SOFTWARE OR THE USE OR OTHER DEALINGS IN EXPAT. -# - -SHELL = @SHELL@ - -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ -VPATH = @srcdir@ - -prefix = @prefix@ -exec_prefix = @exec_prefix@ - -bindir = @bindir@ -libdir = @libdir@ -includedir = @includedir@ -mandir = ${prefix}/man/man1 - -top_builddir = . - - -INSTALL = @INSTALL@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_DATA = @INSTALL_DATA@ -mkinstalldirs = $(SHELL) $(top_srcdir)/conftools/mkinstalldirs - -MANFILE = $(srcdir)/doc/xmlwf.1 -APIHEADER = $(srcdir)/lib/expat.h -LIBRARY = libexpat.la - - -default: buildlib xmlwf/xmlwf - -buildlib: $(LIBRARY) - -all: $(LIBRARY) xmlwf/xmlwf examples/elements examples/outline - -clean: - cd lib && rm -f $(LIBRARY) *.o *.lo && rm -rf .libs _libs - cd xmlwf && rm -f xmlwf *.o *.lo && rm -rf .libs _libs - cd examples && rm -f elements outline *.o *.lo && rm -rf .libs _libs - cd tests && rm -rf .libs runtests runtests.o chardata.o - rm -rf .libs libexpat.la - rm -f examples/core tests/core xmlwf/core - -clobber: clean - -distclean: clean - rm -f expat_config.h config.status config.log config.cache libtool - rm -f Makefile - -extraclean: distclean - rm -f expat_config.h.in configure - rm -f conftools/ltconfig conftools/ltmain.sh conftools/libtool.m4 - -check: tests/runtests - tests/runtests - -install: xmlwf/xmlwf installlib - $(mkinstalldirs) $(bindir) $(mandir) - $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) xmlwf/xmlwf $(bindir)/xmlwf - $(INSTALL_DATA) $(MANFILE) $(mandir) - -installlib: $(LIBRARY) $(APIHEADER) - $(mkinstalldirs) $(libdir) $(includedir) - $(LIBTOOL) --mode=install $(INSTALL) $(LIBRARY) $(libdir)/$(LIBRARY) - $(INSTALL_DATA) $(APIHEADER) $(includedir) - -uninstall: uninstalllib - $(LIBTOOL) --mode=uninstall rm -f $(bindir)/xmlwf - rm -f $(mandir)/xmlwf.1 - -uninstalllib: - $(LIBTOOL) --mode=uninstall rm -f $(libdir)/$(LIBRARY) - rm -f $(includedir)/$(APIHEADER) - -# for VPATH builds (invoked by configure) -mkdir-init: - @for d in lib xmlwf examples tests ; do \ - (mkdir $$d 2> /dev/null || test 1) ; \ - done - -CC = @CC@ -LIBTOOL = @LIBTOOL@ - -INCLUDES = -I$(srcdir)/lib -I. -LDFLAGS = @LDFLAGS@ -CPPFLAGS = @CPPFLAGS@ -CFLAGS = @CFLAGS@ -VSNFLAG = -version-info @LIBCURRENT@:@LIBREVISION@:@LIBAGE@ - -### autoconf this? -LTFLAGS = --silent - -COMPILE = $(CC) $(CFLAGS) $(DEFS) $(CPPFLAGS) $(INCLUDES) -LTCOMPILE = $(LIBTOOL) $(LTFLAGS) --mode=compile $(COMPILE) -LINK_LIB = $(LIBTOOL) $(LTFLAGS) --mode=link $(COMPILE) -no-undefined $(VSNFLAG) -rpath $(libdir) $(LDFLAGS) -o $@ -LINK_EXE = $(LIBTOOL) $(LTFLAGS) --mode=link $(COMPILE) $(LDFLAGS) -o $@ - -LIB_OBJS = lib/xmlparse.lo lib/xmltok.lo lib/xmlrole.lo -$(LIBRARY): $(LIB_OBJS) - $(LINK_LIB) $(LIB_OBJS) - -lib/xmlparse.lo: lib/xmlparse.c lib/expat.h lib/xmlrole.h lib/xmltok.h \ - $(top_builddir)/expat_config.h lib/internal.h - -lib/xmlrole.lo: lib/xmlrole.c lib/ascii.h lib/xmlrole.h \ - $(top_builddir)/expat_config.h lib/internal.h - -lib/xmltok.lo: lib/xmltok.c lib/xmltok_impl.c lib/xmltok_ns.c \ - lib/ascii.h lib/asciitab.h lib/iasciitab.h lib/latin1tab.h \ - lib/nametab.h lib/utf8tab.h lib/xmltok.h lib/xmltok_impl.h \ - $(top_builddir)/expat_config.h - - -XMLWF_OBJS = xmlwf/xmlwf.o xmlwf/xmlfile.o xmlwf/codepage.o xmlwf/@FILEMAP@.o -xmlwf/xmlwf.o: xmlwf/xmlwf.c -xmlwf/xmlfile.o: xmlwf/xmlfile.c -xmlwf/codepage.o: xmlwf/codepage.c -xmlwf/@FILEMAP@.o: xmlwf/@FILEMAP@.c -xmlwf/xmlwf: $(XMLWF_OBJS) $(LIBRARY) - $(LINK_EXE) $(XMLWF_OBJS) $(LIBRARY) - -examples/elements.o: examples/elements.c -examples/elements: examples/elements.o $(LIBRARY) - $(LINK_EXE) $< $(LIBRARY) - -examples/outline.o: examples/outline.c -examples/outline: examples/outline.o $(LIBRARY) - $(LINK_EXE) $< $(LIBRARY) - -tests/chardata.o: tests/chardata.c tests/chardata.h -tests/runtests.o: tests/runtests.c tests/chardata.h -tests/runtests: tests/runtests.o tests/chardata.o $(LIBRARY) - $(LINK_EXE) $^ -lcheck - -tests/xmlts.zip: - wget --output-document=tests/xmlts.zip \ - http://www.w3.org/XML/Test/xmlts20020606.zip - -tests/XML-Test-Suite: tests/xmlts.zip - cd tests && unzip -q xmlts.zip - -run-xmltest: xmlwf/xmlwf tests/XML-Test-Suite - tests/xmltest.sh - -.SUFFIXES: .c .lo .o - -.c.o: - $(COMPILE) -o $@ -c $< -.c.lo: - $(LTCOMPILE) -o $@ -c $< - -.PHONY: buildlib all \ - clean distclean extraclean maintainer-clean \ - dist distdir \ - install uninstall diff --git a/wxWidgets/src/expat/README b/wxWidgets/src/expat/README deleted file mode 100644 index 3bab5a02c4..0000000000 --- a/wxWidgets/src/expat/README +++ /dev/null @@ -1,112 +0,0 @@ - - Expat, Release 1.95.6 - -This is Expat, a C library for parsing XML, written by James Clark. -Expat is a stream-oriented XML parser. This means that you register -handlers with the parser before starting the parse. These handlers -are called when the parser discovers the associated structures in the -document being parsed. A start tag is an example of the kind of -structures for which you may register handlers. - -Windows users should use the expat_win32bin package, which includes -both precompiled libraries and executalbes, and source code for -developers. - -Expat is free software. You may copy, distribute, and modify it under -the terms of the License contained in the file COPYING distributed -with this package. This license is the same as the MIT/X Consortium -license. - -Versions of Expat that have an odd minor version (the middle number in -the release above), are development releases and should be considered -as beta software. Releases with even minor version numbers are -intended to be production grade software. - -If you are building Expat from a check-out from the CVS repository, -you need to run a script that generates the configure script using the -GNU autoconf and libtool tools. To do this, you need to have -autoconf 2.52 or newer and libtool 1.4 or newer. Run the script like -this: - - ./buildconf.sh - -Once this has been done, follow the same instructions as for building -from a source distribution. - -To build Expat from a source distribution, you first run the -configuration shell script in the top level distribution directory: - - ./configure - -There are many options which you may provide to configure (which you -can discover by running configure with the --help option). But the -one of most interest is the one that sets the installation directory. -By default, the configure script will set things up to install -libexpat into /usr/local/lib, expat.h into /usr/local/include, and -xmlwf into /usr/local/bin. If, for example, you'd prefer to install -into /home/me/mystuff/lib, /home/me/mystuff/include, and -/home/me/mystuff/bin, you can tell configure about that with: - - ./configure --prefix=/home/me/mystuff - -After running the configure script, the "make" command will build -things and "make install" will install things into their proper -location. Note that you need to have write permission into the -directories into which things will be installed. - -If you are interested in building Expat to provide document -information in UTF-16 rather than the default UTF-8, following these -instructions: - - 1. For UTF-16 output as unsigned short (and version/error - strings as char), run: - - ./configure CPPFLAGS=-DXML_UNICODE - - For UTF-16 output as wchar_t (incl. version/error strings), - run: - - ./configure CFLAGS="-g -O2 -fshort-wchar" \ - CPPFLAGS=-DXML_UNICODE_WCHAR_T - - 2. Edit the MakeFile, changing: - - LIBRARY = libexpat.la - - to: - - LIBRARY = libexpatw.la - - (Note the additional "w" in the library name.) - - 3. Run "make buildlib" (which builds the library only). - - 4. Run "make installlib" (which installs the library only). - -Note for Solaris users: The "ar" command is usually located in -"/usr/ccs/bin", which is not in the default PATH. You will need to -add this to your path for the "make" command, and probably also switch -to GNU make (the "make" found in /usr/ccs/bin does not seem to work -properly -- appearantly it does not understand .PHONY directives). If -you're using ksh or bash, use this command to build: - - PATH=/usr/ccs/bin:$PATH make - -When using Expat with a project using autoconf for configuration, you -can use the probing macro in conftools/expat.m4 to determine how to -include Expat. See the comments at the top of that file for more -information. - -A reference manual is available in the file doc/reference.html in this -distribution. - -The homepage for this project is http://www.libexpat.org/. There -are links there to connect you to the bug reports page. If you need -to report a bug when you don't have access to a browser, you may also -send a bug report by email to expat-bugs@mail.libexpat.org. - -Discussion related to the direction of future expat development takes -place on expat-discuss@mail.libexpat.org. Archives of this list and -other Expat-related lists may be found at: - - http://mail.libexpat.org/mailman-21/listinfo/ diff --git a/wxWidgets/src/expat/aclocal.m4 b/wxWidgets/src/expat/aclocal.m4 deleted file mode 100644 index 9ec879f0b6..0000000000 --- a/wxWidgets/src/expat/aclocal.m4 +++ /dev/null @@ -1,6035 +0,0 @@ -# aclocal.m4 generated automatically by aclocal 1.6.3 -*- Autoconf -*- - -# Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002 -# Free Software Foundation, Inc. -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- - -# serial 47 AC_PROG_LIBTOOL - - -# AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED) -# ----------------------------------------------------------- -# If this macro is not defined by Autoconf, define it here. -m4_ifdef([AC_PROVIDE_IFELSE], - [], - [m4_define([AC_PROVIDE_IFELSE], - [m4_ifdef([AC_PROVIDE_$1], - [$2], [$3])])]) - - -# AC_PROG_LIBTOOL -# --------------- -AC_DEFUN([AC_PROG_LIBTOOL], -[AC_REQUIRE([_AC_PROG_LIBTOOL])dnl -dnl If AC_PROG_CXX has already been expanded, run AC_LIBTOOL_CXX -dnl immediately, otherwise, hook it in at the end of AC_PROG_CXX. - AC_PROVIDE_IFELSE([AC_PROG_CXX], - [AC_LIBTOOL_CXX], - [define([AC_PROG_CXX], defn([AC_PROG_CXX])[AC_LIBTOOL_CXX - ])]) -dnl And a similar setup for Fortran 77 support - AC_PROVIDE_IFELSE([AC_PROG_F77], - [AC_LIBTOOL_F77], - [define([AC_PROG_F77], defn([AC_PROG_F77])[AC_LIBTOOL_F77 -])]) - -dnl Quote A][M_PROG_GCJ so that aclocal doesn't bring it in needlessly. -dnl If either AC_PROG_GCJ or A][M_PROG_GCJ have already been expanded, run -dnl AC_LIBTOOL_GCJ immediately, otherwise, hook it in at the end of both. - AC_PROVIDE_IFELSE([AC_PROG_GCJ], - [AC_LIBTOOL_GCJ], - [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], - [AC_LIBTOOL_GCJ], - [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ], - [AC_LIBTOOL_GCJ], - [ifdef([AC_PROG_GCJ], - [define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[AC_LIBTOOL_GCJ])]) - ifdef([A][M_PROG_GCJ], - [define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[AC_LIBTOOL_GCJ])]) - ifdef([LT_AC_PROG_GCJ], - [define([LT_AC_PROG_GCJ], - defn([LT_AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])])]) -])])# AC_PROG_LIBTOOL - - -# _AC_PROG_LIBTOOL -# ---------------- -AC_DEFUN([_AC_PROG_LIBTOOL], -[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl -AC_BEFORE([$0],[AC_LIBTOOL_CXX])dnl -AC_BEFORE([$0],[AC_LIBTOOL_F77])dnl -AC_BEFORE([$0],[AC_LIBTOOL_GCJ])dnl - -# This can be used to rebuild libtool when needed -LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh" - -# Always use our own libtool. -LIBTOOL='$(SHELL) $(top_builddir)/libtool' -AC_SUBST(LIBTOOL)dnl - -# Prevent multiple expansion -define([AC_PROG_LIBTOOL], []) -])# _AC_PROG_LIBTOOL - - -# AC_LIBTOOL_SETUP -# ---------------- -AC_DEFUN([AC_LIBTOOL_SETUP], -[AC_PREREQ(2.50)dnl -AC_REQUIRE([AC_ENABLE_SHARED])dnl -AC_REQUIRE([AC_ENABLE_STATIC])dnl -AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl -AC_REQUIRE([AC_CANONICAL_HOST])dnl -AC_REQUIRE([AC_CANONICAL_BUILD])dnl -AC_REQUIRE([AC_PROG_CC])dnl -AC_REQUIRE([AC_PROG_LD])dnl -AC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl -AC_REQUIRE([AC_PROG_NM])dnl - -AC_REQUIRE([AC_PROG_LN_S])dnl -AC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl -# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers! -AC_REQUIRE([AC_OBJEXT])dnl -AC_REQUIRE([AC_EXEEXT])dnl -dnl - -AC_LIBTOOL_SYS_MAX_CMD_LEN -AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE -AC_LIBTOOL_OBJDIR - -AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl -_LT_AC_PROG_ECHO_BACKSLASH - -case $host_os in -aix3*) - # AIX sometimes has problems with the GCC collect2 program. For some - # reason, if we set the COLLECT_NAMES environment variable, the problems - # vanish in a puff of smoke. - if test "X${COLLECT_NAMES+set}" != Xset; then - COLLECT_NAMES= - export COLLECT_NAMES - fi - ;; -esac - -# Sed substitution that helps us do robust quoting. It backslashifies -# metacharacters that are still active within double-quoted strings. -Xsed='sed -e s/^X//' -[sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g'] - -# Same as above, but do not quote variable references. -[double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g'] - -# Sed substitution to delay expansion of an escaped shell variable in a -# double_quote_subst'ed string. -delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' - -# Sed substitution to undo escaping of the cmd sep variable -unescape_variable_subst='s/\\\(${_S_}\)/\1/g' - -# Sed substitution to avoid accidental globbing in evaled expressions -no_glob_subst='s/\*/\\\*/g' - -# Constants: -rm="rm -f" - -# Global variables: -default_ofile=libtool -can_build_shared=yes - -# All known linkers require a `.a' archive for static linking (except M$VC, -# which needs '.lib'). -libext=a -ltmain="$ac_aux_dir/ltmain.sh" -ofile="$default_ofile" -with_gnu_ld="$lt_cv_prog_gnu_ld" - -AC_CHECK_TOOL(AR, ar, false) -AC_CHECK_TOOL(RANLIB, ranlib, :) -AC_CHECK_TOOL(STRIP, strip, :) - -old_CC="$CC" -old_CFLAGS="$CFLAGS" - -# Set sane defaults for various variables -test -z "$AR" && AR=ar -test -z "$AR_FLAGS" && AR_FLAGS=cru -test -z "$AS" && AS=as -test -z "$CC" && CC=cc -test -z "$LTCC" && LTCC=$CC -test -z "$DLLTOOL" && DLLTOOL=dlltool -test -z "$LD" && LD=ld -test -z "$LN_S" && LN_S="ln -s" -test -z "$MAGIC_CMD" && MAGIC_CMD=file -test -z "$NM" && NM=nm -test -z "$SED" && SED=sed -test -z "$OBJDUMP" && OBJDUMP=objdump -test -z "$RANLIB" && RANLIB=: -test -z "$STRIP" && STRIP=: -test -z "$ac_objext" && ac_objext=o - -# Determine commands to create old-style static archives. -old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs' -old_postinstall_cmds='chmod 644 $oldlib' -old_postuninstall_cmds= - -if test -n "$RANLIB"; then - case $host_os in - openbsd*) - old_postinstall_cmds="\$RANLIB -t \$oldlib\${_S_}$old_postinstall_cmds" - ;; - *) - old_postinstall_cmds="\$RANLIB \$oldlib\${_S_}$old_postinstall_cmds" - ;; - esac - old_archive_cmds="$old_archive_cmds\${_S_}\$RANLIB \$oldlib" -fi - -# Only perform the check for file, if the check method requires it -case $deplibs_check_method in -file_magic*) - if test "$file_magic_cmd" = '$MAGIC_CMD'; then - AC_PATH_MAGIC - fi - ;; -esac - -AC_PROVIDE_IFELSE([AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no) -AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL], -enable_win32_dll=yes, enable_win32_dll=no) - -AC_ARG_ENABLE([libtool-lock], - [AC_HELP_STRING([--disable-libtool-lock], - [avoid locking (might break parallel builds)])]) -test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes - -AC_ARG_WITH([pic], - [AC_HELP_STRING([--with-pic], - [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], - [pic_mode="$withval"], - [pic_mode=default]) -test -z "$pic_mode" && pic_mode=default - -# Use C for the default configuration in the libtool script -tagname= -AC_LIBTOOL_LANG_C_CONFIG -_LT_AC_TAGCONFIG -])# AC_LIBTOOL_SETUP - - -# _LT_AC_SYS_COMPILER -# ------------------- -AC_DEFUN([_LT_AC_SYS_COMPILER], -[AC_REQUIRE([AC_PROG_CC])dnl - -# If no C compiler was specified, use CC. -LTCC=${LTCC-"$CC"} - -# Allow CC to be a program name with arguments. -compiler=$CC -])# _LT_AC_SYS_COMPILER - - -# _LT_AC_SYS_LIBPATH_AIX -# ---------------------- -# Links a minimal program and checks the executable -# for the system default hardcoded library path. In most cases, -# this is /usr/lib:/lib, but when the MPI compilers are used -# the location of the communication and MPI libs are included too. -# If we don't find anything, use the default library path according -# to the aix ld manual. -AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX], -[AC_LINK_IFELSE(AC_LANG_PROGRAM,[ -aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'` -# Check for a 64-bit object if we didn't find anything. -if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'`; fi],[]) -if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi -])# _LT_AC_SYS_LIBPATH_AIX - - -# _LT_AC_SHELL_INIT(ARG) -# ---------------------- -AC_DEFUN([_LT_AC_SHELL_INIT], -[ifdef([AC_DIVERSION_NOTICE], - [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)], - [AC_DIVERT_PUSH(NOTICE)]) -$1 -AC_DIVERT_POP -])# _LT_AC_SHELL_INIT - - -# _LT_AC_PROG_ECHO_BACKSLASH -# -------------------------- -# Add some code to the start of the generated configure script which -# will find an echo command which doesn't interpret backslashes. -AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH], -[_LT_AC_SHELL_INIT([ -# Check that we are running under the correct shell. -SHELL=${CONFIG_SHELL-/bin/sh} - -case X$ECHO in -X*--fallback-echo) - # Remove one level of quotation (which was required for Make). - ECHO=`echo "$ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','` - ;; -esac - -echo=${ECHO-echo} -if test "X[$]1" = X--no-reexec; then - # Discard the --no-reexec flag, and continue. - shift -elif test "X[$]1" = X--fallback-echo; then - # Avoid inline document here, it may be left over - : -elif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then - # Yippee, $echo works! - : -else - # Restart under the correct shell. - exec $SHELL "[$]0" --no-reexec ${1+"[$]@"} -fi - -if test "X[$]1" = X--fallback-echo; then - # used as fallback echo - shift - cat </dev/null && - echo_test_string="`eval $cmd`" && - (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null - then - break - fi - done -fi - -if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && - echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - : -else - # The Solaris, AIX, and Digital Unix default echo programs unquote - # backslashes. This makes it impossible to quote backslashes using - # echo "$something" | sed 's/\\/\\\\/g' - # - # So, first we look for a working echo in the user's PATH. - - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR - for dir in $PATH /usr/ucb; do - IFS="$lt_save_ifs" - if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && - test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && - echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - echo="$dir/echo" - break - fi - done - IFS="$lt_save_ifs" - - if test "X$echo" = Xecho; then - # We didn't find a better echo, so look for alternatives. - if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' && - echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - # This shell has a builtin print -r that does the trick. - echo='print -r' - elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) && - test "X$CONFIG_SHELL" != X/bin/ksh; then - # If we have ksh, try running configure again with it. - ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} - export ORIGINAL_CONFIG_SHELL - CONFIG_SHELL=/bin/ksh - export CONFIG_SHELL - exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"} - else - # Try using printf. - echo='printf %s\n' - if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && - echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - # Cool, printf works - : - elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && - test "X$echo_testing_string" = 'X\t' && - echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL - export CONFIG_SHELL - SHELL="$CONFIG_SHELL" - export SHELL - echo="$CONFIG_SHELL [$]0 --fallback-echo" - elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && - test "X$echo_testing_string" = 'X\t' && - echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - echo="$CONFIG_SHELL [$]0 --fallback-echo" - else - # maybe with a smaller string... - prev=: - - for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do - if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null - then - break - fi - prev="$cmd" - done - - if test "$prev" != 'sed 50q "[$]0"'; then - echo_test_string=`eval $prev` - export echo_test_string - exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"} - else - # Oops. We lost completely, so just stick with echo. - echo=echo - fi - fi - fi - fi -fi -fi - -# Copy echo and quote the copy suitably for passing to libtool from -# the Makefile, instead of quoting the original, which is used later. -ECHO=$echo -if test "X$ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then - ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo" -fi - -AC_SUBST(ECHO) -])])# _LT_AC_PROG_ECHO_BACKSLASH - - -# _LT_AC_LOCK -# ----------- -AC_DEFUN([_LT_AC_LOCK], -[AC_ARG_ENABLE([libtool-lock], - [AC_HELP_STRING([--disable-libtool-lock], - [avoid locking (might break parallel builds)])]) -test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes - -# Some flags need to be propagated to the compiler or linker for good -# libtool support. -case $host in -ia64-*-hpux*) - # Find out which ABI we are using. - echo 'int i;' > conftest.$ac_ext - if AC_TRY_EVAL(ac_compile); then - case `/usr/bin/file conftest.$ac_objext` in - *ELF-32*) - HPUX_IA64_MODE="32" - ;; - *ELF-64*) - HPUX_IA64_MODE="64" - ;; - esac - fi - rm -rf conftest* - ;; -*-*-irix6*) - # Find out which ABI we are using. - echo '[#]line __oline__ "configure"' > conftest.$ac_ext - if AC_TRY_EVAL(ac_compile); then - if test "$lt_cv_prog_gnu_ld" = yes; then - case `/usr/bin/file conftest.$ac_objext` in - *32-bit*) - LD="${LD-ld} -melf32bsmip" - ;; - *N32*) - LD="${LD-ld} -melf32bmipn32" - ;; - *64-bit*) - LD="${LD-ld} -melf64bmip" - ;; - esac - else - case `/usr/bin/file conftest.$ac_objext` in - *32-bit*) - LD="${LD-ld} -32" - ;; - *N32*) - LD="${LD-ld} -n32" - ;; - *64-bit*) - LD="${LD-ld} -64" - ;; - esac - fi - fi - rm -rf conftest* - ;; - -x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*) - # Find out which ABI we are using. - echo 'int i;' > conftest.$ac_ext - if AC_TRY_EVAL(ac_compile); then - case "`/usr/bin/file conftest.o`" in - *32-bit*) - case $host in - x86_64-*linux*) - LD="${LD-ld} -m elf_i386" - ;; - ppc64-*linux*) - LD="${LD-ld} -m elf32ppclinux" - ;; - s390x-*linux*) - LD="${LD-ld} -m elf_s390" - ;; - sparc64-*linux*) - LD="${LD-ld} -m elf32_sparc" - ;; - esac - ;; - *64-bit*) - case $host in - x86_64-*linux*) - LD="${LD-ld} -m elf_x86_64" - ;; - ppc*-*linux*|powerpc*-*linux*) - LD="${LD-ld} -m elf64ppc" - ;; - s390*-*linux*) - LD="${LD-ld} -m elf64_s390" - ;; - sparc*-*linux*) - LD="${LD-ld} -m elf64_sparc" - ;; - esac - ;; - esac - fi - rm -rf conftest* - ;; - -*-*-sco3.2v5*) - # On SCO OpenServer 5, we need -belf to get full-featured binaries. - SAVE_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS -belf" - AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, - [AC_LANG_PUSH(C) - AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) - AC_LANG_POP]) - if test x"$lt_cv_cc_needs_belf" != x"yes"; then - # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf - CFLAGS="$SAVE_CFLAGS" - fi - ;; -AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL], -[*-*-cygwin* | *-*-mingw* | *-*-pw32*) - AC_CHECK_TOOL(DLLTOOL, dlltool, false) - AC_CHECK_TOOL(AS, as, false) - AC_CHECK_TOOL(OBJDUMP, objdump, false) - ;; - ]) -esac - -need_locks="$enable_libtool_lock" - -])# _LT_AC_LOCK - - -# AC_LIBTOOL_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, -# [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) -# ---------------------------------------------------------------- -# Check whether the given compiler option works -AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], -[AC_CACHE_CHECK([$1], [$2], - [$2=no - ifelse([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) - printf "$lt_simple_compile_test_code" > conftest.$ac_ext - lt_compiler_flag="$3" - # Insert the option either (1) after the last *FLAGS variable, or - # (2) before a word containing "conftest.", or (3) at the end. - # Note that $ac_compile itself does not contain backslashes and begins - # with a dollar sign (not a hyphen), so the echo should work correctly. - # The option is referenced via a variable to avoid confusing sed. - lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ - -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ - -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) - (eval "$lt_compile" 2>conftest.err) - ac_status=$? - cat conftest.err >&AS_MESSAGE_LOG_FD - echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD - if (exit $ac_status) && test -s "$ac_outfile"; then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings - if test ! -s conftest.err; then - $2=yes - fi - fi - $rm conftest* -]) - -if test x"[$]$2" = xyes; then - ifelse([$5], , :, [$5]) -else - ifelse([$6], , :, [$6]) -fi -])# AC_LIBTOOL_COMPILER_OPTION - - -# AC_LIBTOOL_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, -# [ACTION-SUCCESS], [ACTION-FAILURE]) -# ------------------------------------------------------------ -# Check whether the given compiler option works -AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], -[AC_CACHE_CHECK([$1], [$2], - [$2=no - save_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS $3" - printf "$lt_simple_link_test_code" > conftest.$ac_ext - if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings - if test -s conftest.err; then - # Append any errors to the config.log. - cat conftest.err 1>&AS_MESSAGE_LOG_FD - else - $2=yes - fi - fi - $rm conftest* - LDFLAGS="$save_LDFLAGS" -]) - -if test x"[$]$2" = xyes; then - ifelse([$4], , :, [$4]) -else - ifelse([$5], , :, [$5]) -fi -])# AC_LIBTOOL_LINKER_OPTION - - -# AC_LIBTOOL_SYS_MAX_CMD_LEN -# -------------------------- -AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], -[# find the maximum length of command line arguments -AC_MSG_CHECKING([the maximum length of command line arguments]) -AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl - i=0 - testring="ABCD" - - case $build_os in - msdosdjgpp*) - # On DJGPP, this test can blow up pretty badly due to problems in libc - # (any single argument exceeding 2000 bytes causes a buffer overrun - # during glob expansion). Even if it were fixed, the result of this - # check would be larger than it should be. - lt_cv_sys_max_cmd_len=12288; # 12K is about right - ;; - - gnu*) - # Under GNU Hurd, this test is not required because there is - # no limit to the length of command line arguments. - # Libtool will interpret -1 as no limit whatsoever - lt_cv_sys_max_cmd_len=-1; - ;; - - cygwin* | mingw*) - # On Win9x/ME, this test blows up -- it succeeds, but takes - # about 5 minutes as the teststring grows exponentially. - # Worse, since 9x/ME are not pre-emptively multitasking, - # you end up with a "frozen" computer, even though with patience - # the test eventually succeeds (with a max line length of 256k). - # Instead, let's just punt: use the minimum linelength reported by - # all of the supported platforms: 8192 (on NT/2K/XP). - lt_cv_sys_max_cmd_len=8192; - ;; - - *) - # If test is not a shell built-in, we'll probably end up computing a - # maximum length that is only half of the actual maximum length, but - # we can't tell. - while (test "X"`$CONFIG_SHELL [$]0 --fallback-echo "X$testring" 2>/dev/null` \ - = "XX$testring") >/dev/null 2>&1 && - new_result=`expr "X$testring" : ".*" 2>&1` && - lt_cv_sys_max_cmd_len=$new_result && - test $i != 17 # 1/2 MB should be enough - do - i=`expr $i + 1` - testring=$testring$testring - done - testring= - # Add a significant safety factor because C++ compilers can tack on massive - # amounts of additional arguments before passing them to the linker. - # It appears as though 1/2 is a usable value. - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` - ;; - esac -]) -if test -n $lt_cv_sys_max_cmd_len ; then - AC_MSG_RESULT($lt_cv_sys_max_cmd_len) -else - AC_MSG_RESULT(none) -fi -])# AC_LIBTOOL_SYS_MAX_CMD_LEN - - -# _LT_AC_CHECK_DLFCN -# -------------------- -AC_DEFUN([_LT_AC_CHECK_DLFCN], -[AC_CHECK_HEADERS(dlfcn.h)dnl -])# _LT_AC_CHECK_DLFCN - - -# _LT_AC_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, -# ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) -# ------------------------------------------------------------------ -AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF], -[AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl -if test "$cross_compiling" = yes; then : - [$4] -else - lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 - lt_status=$lt_dlunknown - cat > conftest.$ac_ext < -#endif - -#include - -#ifdef RTLD_GLOBAL -# define LT_DLGLOBAL RTLD_GLOBAL -#else -# ifdef DL_GLOBAL -# define LT_DLGLOBAL DL_GLOBAL -# else -# define LT_DLGLOBAL 0 -# endif -#endif - -/* We may have to define LT_DLLAZY_OR_NOW in the command line if we - find out it does not work in some platform. */ -#ifndef LT_DLLAZY_OR_NOW -# ifdef RTLD_LAZY -# define LT_DLLAZY_OR_NOW RTLD_LAZY -# else -# ifdef DL_LAZY -# define LT_DLLAZY_OR_NOW DL_LAZY -# else -# ifdef RTLD_NOW -# define LT_DLLAZY_OR_NOW RTLD_NOW -# else -# ifdef DL_NOW -# define LT_DLLAZY_OR_NOW DL_NOW -# else -# define LT_DLLAZY_OR_NOW 0 -# endif -# endif -# endif -# endif -#endif - -#ifdef __cplusplus -extern "C" void exit (int); -#endif - -void fnord() { int i=42;} -int main () -{ - void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); - int status = $lt_dlunknown; - - if (self) - { - if (dlsym (self,"fnord")) status = $lt_dlno_uscore; - else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; - /* dlclose (self); */ - } - - exit (status); -}] -EOF - if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then - (./conftest; exit; ) 2>/dev/null - lt_status=$? - case x$lt_status in - x$lt_dlno_uscore) $1 ;; - x$lt_dlneed_uscore) $2 ;; - x$lt_unknown|x*) $3 ;; - esac - else : - # compilation failed - $3 - fi -fi -rm -fr conftest* -])# _LT_AC_TRY_DLOPEN_SELF - - -# AC_LIBTOOL_DLOPEN_SELF -# ------------------- -AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], -[AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl -if test "x$enable_dlopen" != xyes; then - enable_dlopen=unknown - enable_dlopen_self=unknown - enable_dlopen_self_static=unknown -else - lt_cv_dlopen=no - lt_cv_dlopen_libs= - - case $host_os in - beos*) - lt_cv_dlopen="load_add_on" - lt_cv_dlopen_libs= - lt_cv_dlopen_self=yes - ;; - - mingw* | pw32*) - lt_cv_dlopen="LoadLibrary" - lt_cv_dlopen_libs= - ;; - - cygwin*) - lt_cv_dlopen="dlopen" - lt_cv_dlopen_libs= - ;; - - darwin*) - # if libdl is installed we need to link against it - AC_CHECK_LIB([dl], [dlopen], - [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[ - lt_cv_dlopen="dyld" - lt_cv_dlopen_libs= - lt_cv_dlopen_self=yes - ]) - ;; - - *) - AC_CHECK_FUNC([shl_load], - [lt_cv_dlopen="shl_load"], - [AC_CHECK_LIB([dld], [shl_load], - [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"], - [AC_CHECK_FUNC([dlopen], - [lt_cv_dlopen="dlopen"], - [AC_CHECK_LIB([dl], [dlopen], - [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"], - [AC_CHECK_LIB([svld], [dlopen], - [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"], - [AC_CHECK_LIB([dld], [dld_link], - [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"]) - ]) - ]) - ]) - ]) - ]) - ;; - esac - - if test "x$lt_cv_dlopen" != xno; then - enable_dlopen=yes - else - enable_dlopen=no - fi - - case $lt_cv_dlopen in - dlopen) - save_CPPFLAGS="$CPPFLAGS" - test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" - - save_LDFLAGS="$LDFLAGS" - eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" - - save_LIBS="$LIBS" - LIBS="$lt_cv_dlopen_libs $LIBS" - - AC_CACHE_CHECK([whether a program can dlopen itself], - lt_cv_dlopen_self, [dnl - _LT_AC_TRY_DLOPEN_SELF( - lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, - lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) - ]) - - if test "x$lt_cv_dlopen_self" = xyes; then - LDFLAGS="$LDFLAGS $link_static_flag" - AC_CACHE_CHECK([whether a statically linked program can dlopen itself], - lt_cv_dlopen_self_static, [dnl - _LT_AC_TRY_DLOPEN_SELF( - lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, - lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) - ]) - fi - - CPPFLAGS="$save_CPPFLAGS" - LDFLAGS="$save_LDFLAGS" - LIBS="$save_LIBS" - ;; - esac - - case $lt_cv_dlopen_self in - yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; - *) enable_dlopen_self=unknown ;; - esac - - case $lt_cv_dlopen_self_static in - yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; - *) enable_dlopen_self_static=unknown ;; - esac -fi -])# AC_LIBTOOL_DLOPEN_SELF - - -# AC_LIBTOOL_PROG_CC_C_O([TAGNAME]) -# --------------------------------- -# Check to see if options -c and -o are simultaneously supported by compiler -AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O], -[AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl -AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], - [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)], - [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no - $rm -r conftest 2>/dev/null - mkdir conftest - cd conftest - mkdir out - printf "$lt_simple_compile_test_code" > conftest.$ac_ext - - # According to Tom Tromey, Ian Lance Taylor reported there are C compilers - # that will create temporary files in the current directory regardless of - # the output directory. Thus, making CWD read-only will cause this test - # to fail, enabling locking or at least warning the user not to do parallel - # builds. - chmod -w . - - lt_compiler_flag="-o out/conftest2.$ac_objext" - # Insert the option either (1) after the last *FLAGS variable, or - # (2) before a word containing "conftest.", or (3) at the end. - # Note that $ac_compile itself does not contain backslashes and begins - # with a dollar sign (not a hyphen), so the echo should work correctly. - lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ - -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ - -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) - (eval "$lt_compile" 2>out/conftest.err) - ac_status=$? - cat out/conftest.err >&AS_MESSAGE_LOG_FD - echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD - if (exit $ac_status) && test -s out/conftest2.$ac_objext - then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings - if test ! -s out/conftest.err; then - _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes - fi - fi - chmod u+w . - $rm conftest* out/* - rmdir out - cd .. - rmdir conftest - $rm conftest* -]) -])# AC_LIBTOOL_PROG_CC_C_O - - -# AC_LIBTOOL_SYS_HARD_LINK_LOCKS([TAGNAME]) -# ----------------------------------------- -# Check to see if we can do hard links to lock some files if needed -AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], -[AC_REQUIRE([_LT_AC_LOCK])dnl - -hard_links="nottested" -if test "$_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then - # do not overwrite the value of need_locks provided by the user - AC_MSG_CHECKING([if we can lock with hard links]) - hard_links=yes - $rm conftest* - ln conftest.a conftest.b 2>/dev/null && hard_links=no - touch conftest.a - ln conftest.a conftest.b 2>&5 || hard_links=no - ln conftest.a conftest.b 2>/dev/null && hard_links=no - AC_MSG_RESULT([$hard_links]) - if test "$hard_links" = no; then - AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe]) - need_locks=warn - fi -else - need_locks=no -fi -])# AC_LIBTOOL_SYS_HARD_LINK_LOCKS - - -# AC_LIBTOOL_OBJDIR -# ----------------- -AC_DEFUN([AC_LIBTOOL_OBJDIR], -[AC_CACHE_CHECK([for objdir], [lt_cv_objdir], -[rm -f .libs 2>/dev/null -mkdir .libs 2>/dev/null -if test -d .libs; then - lt_cv_objdir=.libs -else - # MS-DOS does not allow filenames that begin with a dot. - lt_cv_objdir=_libs -fi -rmdir .libs 2>/dev/null]) -objdir=$lt_cv_objdir -])# AC_LIBTOOL_OBJDIR - - -# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH([TAGNAME]) -# ---------------------------------------------- -# Check hardcoding attributes. -AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], -[AC_MSG_CHECKING([how to hardcode library paths into programs]) -_LT_AC_TAGVAR(hardcode_action, $1)= -if test -n "$_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)" || \ - test -n "$_LT_AC_TAGVAR(runpath_var $1)" || \ - test "X$_LT_AC_TAGVAR(hardcode_automatic, $1)"="Xyes" ; then - - # We can hardcode non-existant directories. - if test "$_LT_AC_TAGVAR(hardcode_direct, $1)" != no && - # If the only mechanism to avoid hardcoding is shlibpath_var, we - # have to relink, otherwise we might link with an installed library - # when we should be linking with a yet-to-be-installed one - ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)" != no && - test "$_LT_AC_TAGVAR(hardcode_minus_L, $1)" != no; then - # Linking always hardcodes the temporary library directory. - _LT_AC_TAGVAR(hardcode_action, $1)=relink - else - # We can link without hardcoding, and we can hardcode nonexisting dirs. - _LT_AC_TAGVAR(hardcode_action, $1)=immediate - fi -else - # We cannot hardcode anything, or else we can only hardcode existing - # directories. - _LT_AC_TAGVAR(hardcode_action, $1)=unsupported -fi -AC_MSG_RESULT([$_LT_AC_TAGVAR(hardcode_action, $1)]) - -if test "$_LT_AC_TAGVAR(hardcode_action, $1)" = relink; then - # Fast installation is not supported - enable_fast_install=no -elif test "$shlibpath_overrides_runpath" = yes || - test "$enable_shared" = no; then - # Fast installation is not necessary - enable_fast_install=needless -fi -])# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH - - -# AC_LIBTOOL_SYS_LIB_STRIP -# ------------------------ -AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP], -[striplib= -old_striplib= -AC_MSG_CHECKING([whether stripping libraries is possible]) -if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then - test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" - test -z "$striplib" && striplib="$STRIP --strip-unneeded" - AC_MSG_RESULT([yes]) -else -# FIXME - insert some real tests, host_os isn't really good enough - case $host_os in - NOT-darwin*) - if test -n "$STRIP" ; then - striplib="$STRIP -x" - AC_MSG_RESULT([yes]) - else - AC_MSG_RESULT([no]) -fi - ;; - *) - AC_MSG_RESULT([no]) - ;; - esac -fi -])# AC_LIBTOOL_SYS_LIB_STRIP - - -# AC_LIBTOOL_SYS_DYNAMIC_LINKER -# ----------------------------- -# PORTME Fill in your ld.so characteristics -AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER], -[AC_MSG_CHECKING([dynamic linker characteristics]) -library_names_spec= -libname_spec='lib$name' -soname_spec= -shrext=".so" -postinstall_cmds= -postuninstall_cmds= -finish_cmds= -finish_eval= -shlibpath_var= -shlibpath_overrides_runpath=unknown -version_type=none -dynamic_linker="$host_os ld.so" -sys_lib_dlsearch_path_spec="/lib /usr/lib" -if test "$GCC" = yes; then - sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` - if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then - # if the path contains ";" then we assume it to be the separator - # otherwise default to the standard path separator (i.e. ":") - it is - # assumed that no part of a normal pathname contains ";" but that should - # okay in the real world where ";" in dirpaths is itself problematic. - sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` - else - sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` - fi -else - sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" -fi -need_lib_prefix=unknown -hardcode_into_libs=no - -# when you set need_version to no, make sure it does not cause -set_version -# flags to be left without arguments -need_version=unknown - -case $host_os in -aix3*) - version_type=linux - library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' - shlibpath_var=LIBPATH - - # AIX 3 has no versioning support, so we append a major version to the name. - soname_spec='${libname}${release}${shared_ext}$major' - ;; - -aix4* | aix5*) - version_type=linux - need_lib_prefix=no - need_version=no - hardcode_into_libs=yes - if test "$host_cpu" = ia64; then - # AIX 5 supports IA64 - library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - else - # With GCC up to 2.95.x, collect2 would create an import file - # for dependence libraries. The import file would start with - # the line `#! .'. This would cause the generated library to - # depend on `.', always an invalid library. This was fixed in - # development snapshots of GCC prior to 3.0. - case $host_os in - aix4 | aix4.[[01]] | aix4.[[01]].*) - if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' - echo ' yes ' - echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then - : - else - can_build_shared=no - fi - ;; - esac - # AIX (on Power*) has no versioning support, so currently we can not hardcode correct - # soname into executable. Probably we can add versioning support to - # collect2, so additional links can be useful in future. - if test "$aix_use_runtimelinking" = yes; then - # If using run time linking (on AIX 4.2 or later) use lib.so - # instead of lib.a to let people know that these are not - # typical AIX shared libraries. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - else - # We preserve .a as extension for shared libraries through AIX4.2 - # and later when we are not doing run time linking. - library_names_spec='${libname}${release}.a $libname.a' - soname_spec='${libname}${release}${shared_ext}$major' - fi - shlibpath_var=LIBPATH - fi - ;; - -amigaos*) - library_names_spec='$libname.ixlibrary $libname.a' - # Create ${libname}_ixlibrary.a entries in /sys/libs. - finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "(cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a)"; (cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a) || exit 1; done' - ;; - -beos*) - library_names_spec='${libname}${shared_ext}' - dynamic_linker="$host_os ld.so" - shlibpath_var=LIBRARY_PATH - ;; - -bsdi4*) - version_type=linux - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' - shlibpath_var=LD_LIBRARY_PATH - sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" - sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" - # the default ld.so.conf also contains /usr/contrib/lib and - # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow - # libtool to hard-code these into programs - ;; - -cygwin* | mingw* | pw32*) - version_type=windows - shrext=".dll" - need_version=no - need_lib_prefix=no - - case $GCC,$host_os in - yes,cygwin* | yes,mingw* | yes,pw32*) - library_names_spec='$libname.dll.a' - # DLL is installed to $(libdir)/../bin by postinstall_cmds - postinstall_cmds='base_file=`basename \${file}`${_S_} - dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`${_S_} - dldir=$destdir/`dirname \$dlpath`${_S_} - test -d \$dldir || mkdir -p \$dldir${_S_} - $install_prog $dir/$dlname \$dldir/$dlname' - postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`${_S_} - dlpath=$dir/\$dldll${_S_} - $rm \$dlpath' - shlibpath_overrides_runpath=yes - - case $host_os in - cygwin*) - # Cygwin DLLs use 'cyg' prefix rather than 'lib' - soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' - sys_lib_search_path_spec="/lib /lib/w32api /usr/lib /usr/local/lib" - ;; - mingw*) - # MinGW DLLs use traditional 'lib' prefix - soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' - sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` - if echo "$sys_lib_search_path_spec" | [grep ';[c-zC-Z]:/' >/dev/null]; then - # It is most probably a Windows format PATH printed by - # mingw gcc, but we are running on Cygwin. Gcc prints its search - # path with ; separators, and with drive letters. We can handle the - # drive letters (cygwin fileutils understands them), so leave them, - # especially as we might pass files found there to a mingw objdump, - # which wouldn't understand a cygwinified path. Ahh. - sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` - else - sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` - fi - ;; - pw32*) - # pw32 DLLs use 'pw' prefix rather than 'lib' - library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - ;; - esac - ;; - - *) - library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib' - ;; - esac - dynamic_linker='Win32 ld.exe' - # FIXME: first we should search . and the directory the executable is in - shlibpath_var=PATH - ;; - -darwin* | rhapsody*) - dynamic_linker="$host_os dyld" - version_type=darwin - need_lib_prefix=no - need_version=no - # FIXME: Relying on posixy $() will cause problems for - # cross-compilation, but unfortunately the echo tests do not - # yet detect zsh echo's removal of \ escapes. - library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext ${libname}${release}${versuffix}$shared_ext' - soname_spec='${libname}${release}${major}$shared_ext' - shlibpath_overrides_runpath=yes - shlibpath_var=DYLD_LIBRARY_PATH - shrext='$(test .$module = .yes && echo .so || echo .dylib)' - # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. - if $CC -v 2>&1 | grep 'Apple' >/dev/null ; then - sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` - fi - sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' - ;; - -dgux*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - ;; - -freebsd1*) - dynamic_linker=no - ;; - -freebsd*) - objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout` - version_type=freebsd-$objformat - case $version_type in - freebsd-elf*) - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' - need_version=no - need_lib_prefix=no - ;; - freebsd-*) - library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' - need_version=yes - ;; - esac - shlibpath_var=LD_LIBRARY_PATH - case $host_os in - freebsd2*) - shlibpath_overrides_runpath=yes - ;; - freebsd3.[01]* | freebsdelf3.[01]*) - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - *) # from 3.2 on - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - ;; - esac - ;; - -gnu*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - hardcode_into_libs=yes - ;; - -hpux9* | hpux10* | hpux11*) - # Give a soname corresponding to the major version so that dld.sl refuses to - # link against other versions. - version_type=sunos - need_lib_prefix=no - need_version=no - case "$host_cpu" in - ia64*) - shrext='.so' - hardcode_into_libs=yes - dynamic_linker="$host_os dld.so" - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - if test "X$HPUX_IA64_MODE" = X32; then - sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" - else - sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" - fi - sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec - ;; - hppa*64*) - shrext='.sl' - hardcode_into_libs=yes - dynamic_linker="$host_os dld.sl" - shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH - shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" - sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec - ;; - *) - shrext='.sl' - dynamic_linker="$host_os dld.sl" - shlibpath_var=SHLIB_PATH - shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - ;; - esac - # HP-UX runs *really* slowly unless shared libraries are mode 555. - postinstall_cmds='chmod 555 $lib' - ;; - -irix5* | irix6* | nonstopux*) - case $host_os in - nonstopux*) version_type=nonstopux ;; - *) - if test "$lt_cv_prog_gnu_ld" = yes; then - version_type=linux - else - version_type=irix - fi ;; - esac - need_lib_prefix=no - need_version=no - soname_spec='${libname}${release}${shared_ext}$major' - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' - case $host_os in - irix5* | nonstopux*) - libsuff= shlibsuff= - ;; - *) - case $LD in # libtool.m4 will add one of these switches to LD - *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") - libsuff= shlibsuff= libmagic=32-bit;; - *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") - libsuff=32 shlibsuff=N32 libmagic=N32;; - *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") - libsuff=64 shlibsuff=64 libmagic=64-bit;; - *) libsuff= shlibsuff= libmagic=never-match;; - esac - ;; - esac - shlibpath_var=LD_LIBRARY${shlibsuff}_PATH - shlibpath_overrides_runpath=no - sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" - sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" - hardcode_into_libs=yes - ;; - -# No shared lib support for Linux oldld, aout, or coff. -linux*oldld* | linux*aout* | linux*coff*) - dynamic_linker=no - ;; - -# This must be Linux ELF. -linux*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - # This implies no fast_install, which is unacceptable. - # Some rework will be needed to allow for fast_install - # before this can be enabled. - hardcode_into_libs=yes - - # We used to test for /lib/ld.so.1 and disable shared libraries on - # powerpc, because MkLinux only supported shared libraries with the - # GNU dynamic linker. Since this was broken with cross compilers, - # most powerpc-linux boxes support dynamic linking these days and - # people can always --disable-shared, the test was removed, and we - # assume the GNU/Linux dynamic linker is in use. - dynamic_linker='GNU/Linux ld.so' - ;; - -netbsd*) - version_type=sunos - need_lib_prefix=no - need_version=no - if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' - dynamic_linker='NetBSD (a.out) ld.so' - else - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - dynamic_linker='NetBSD ld.elf_so' - fi - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - -newsos6) - version_type=linux - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - ;; - -nto-qnx) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - ;; - -openbsd*) - version_type=sunos - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' - shlibpath_var=LD_LIBRARY_PATH - if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - case $host_os in - openbsd2.[[89]] | openbsd2.[[89]].*) - shlibpath_overrides_runpath=no - ;; - *) - shlibpath_overrides_runpath=yes - ;; - esac - else - shlibpath_overrides_runpath=yes - fi - ;; - -os2*) - libname_spec='$name' - shrext=".dll" - need_lib_prefix=no - library_names_spec='$libname${shared_ext} $libname.a' - dynamic_linker='OS/2 ld.exe' - shlibpath_var=LIBPATH - ;; - -osf3* | osf4* | osf5*) - version_type=osf - need_lib_prefix=no - need_version=no - soname_spec='${libname}${release}${shared_ext}$major' - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" - sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" - ;; - -sco3.2v5*) - version_type=osf - soname_spec='${libname}${release}${shared_ext}$major' - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - ;; - -solaris*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - # ldd complains unless libraries are executable - postinstall_cmds='chmod +x $lib' - ;; - -sunos4*) - version_type=sunos - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' - finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - if test "$with_gnu_ld" = yes; then - need_lib_prefix=no - fi - need_version=yes - ;; - -sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) - version_type=linux - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - case $host_vendor in - sni) - shlibpath_overrides_runpath=no - need_lib_prefix=no - export_dynamic_flag_spec='${wl}-Blargedynsym' - runpath_var=LD_RUN_PATH - ;; - siemens) - need_lib_prefix=no - ;; - motorola) - need_lib_prefix=no - need_version=no - shlibpath_overrides_runpath=no - sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' - ;; - esac - ;; - -sysv4*MP*) - if test -d /usr/nec ;then - version_type=linux - library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' - soname_spec='$libname${shared_ext}.$major' - shlibpath_var=LD_LIBRARY_PATH - fi - ;; - -uts4*) - version_type=linux - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - ;; - -*) - dynamic_linker=no - ;; -esac -AC_MSG_RESULT([$dynamic_linker]) -test "$dynamic_linker" = no && can_build_shared=no -])# AC_LIBTOOL_SYS_DYNAMIC_LINKER - - -# _LT_AC_TAGCONFIG -# ---------------- -AC_DEFUN([_LT_AC_TAGCONFIG], -[AC_ARG_WITH([tags], - [AC_HELP_STRING([--with-tags@<:@=TAGS@:>@], - [include additional configurations @<:@automatic@:>@])], - [tagnames="$withval"]) - -if test -f "$ltmain" && test -n "$tagnames"; then - if test ! -f "${ofile}"; then - AC_MSG_WARN([output file `$ofile' does not exist]) - fi - - if test -z "$LTCC"; then - eval "`$SHELL ${ofile} --config | grep '^LTCC='`" - if test -z "$LTCC"; then - AC_MSG_WARN([output file `$ofile' does not look like a libtool script]) - else - AC_MSG_WARN([using `LTCC=$LTCC', extracted from `$ofile']) - fi - fi - - # Extract list of available tagged configurations in $ofile. - # Note that this assumes the entire list is on one line. - available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'` - - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," - for tagname in $tagnames; do - IFS="$lt_save_ifs" - # Check whether tagname contains only valid characters - case `$echo "X$tagname" | $Xsed -e 's:[[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]]::g'` in - "") ;; - *) AC_MSG_ERROR([invalid tag name: $tagname]) - ;; - esac - - if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null - then - AC_MSG_ERROR([tag name \"$tagname\" already exists]) - fi - - # Update the list of available tags. - if test -n "$tagname"; then - echo appending configuration tag \"$tagname\" to $ofile - - case $tagname in - CXX) - if test -n "$CXX" && test "X$CXX" != "Xno"; then - AC_LIBTOOL_LANG_CXX_CONFIG - else - tagname="" - fi - ;; - - F77) - if test -n "$F77" && test "X$F77" != "Xno"; then - AC_LIBTOOL_LANG_F77_CONFIG - else - tagname="" - fi - ;; - - GCJ) - if test -n "$GCJ" && test "X$GCJ" != "Xno"; then - AC_LIBTOOL_LANG_GCJ_CONFIG - else - tagname="" - fi - ;; - - RC) - AC_LIBTOOL_LANG_RC_CONFIG - ;; - - *) - AC_MSG_ERROR([Unsupported tag name: $tagname]) - ;; - esac - - # Append the new tag name to the list of available tags. - if test -n "$tagname" ; then - available_tags="$available_tags $tagname" - fi - fi - done - IFS="$lt_save_ifs" - - # Now substitute the updated list of available tags. - if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then - mv "${ofile}T" "$ofile" - chmod +x "$ofile" - else - rm -f "${ofile}T" - AC_MSG_ERROR([unable to update list of available tagged configurations.]) - fi -fi -])# _LT_AC_TAGCONFIG - - -# AC_LIBTOOL_DLOPEN -# ----------------- -# enable checks for dlopen support -AC_DEFUN([AC_LIBTOOL_DLOPEN], - [AC_BEFORE([$0],[AC_LIBTOOL_SETUP]) -])# AC_LIBTOOL_DLOPEN - - -# AC_LIBTOOL_WIN32_DLL -# -------------------- -# declare package support for building win32 dll's -AC_DEFUN([AC_LIBTOOL_WIN32_DLL], -[AC_BEFORE([$0], [AC_LIBTOOL_SETUP]) -])# AC_LIBTOOL_WIN32_DLL - - -# AC_ENABLE_SHARED([DEFAULT]) -# --------------------------- -# implement the --enable-shared flag -# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. -AC_DEFUN([AC_ENABLE_SHARED], -[define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl -AC_ARG_ENABLE([shared], - [AC_HELP_STRING([--enable-shared@<:@=PKGS@:>@], - [build shared libraries @<:@default=]AC_ENABLE_SHARED_DEFAULT[@:>@])], - [p=${PACKAGE-default} - case $enableval in - yes) enable_shared=yes ;; - no) enable_shared=no ;; - *) - enable_shared=no - # Look at the argument we got. We use all the common list separators. - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," - for pkg in $enableval; do - IFS="$lt_save_ifs" - if test "X$pkg" = "X$p"; then - enable_shared=yes - fi - done - IFS="$lt_save_ifs" - ;; - esac], - [enable_shared=]AC_ENABLE_SHARED_DEFAULT) -])# AC_ENABLE_SHARED - - -# AC_DISABLE_SHARED -# ----------------- -#- set the default shared flag to --disable-shared -AC_DEFUN([AC_DISABLE_SHARED], -[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl -AC_ENABLE_SHARED(no) -])# AC_DISABLE_SHARED - - -# AC_ENABLE_STATIC([DEFAULT]) -# --------------------------- -# implement the --enable-static flag -# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. -AC_DEFUN([AC_ENABLE_STATIC], -[define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl -AC_ARG_ENABLE([static], - [AC_HELP_STRING([--enable-static@<:@=PKGS@:>@], - [build static libraries @<:@default=]AC_ENABLE_STATIC_DEFAULT[@:>@])], - [p=${PACKAGE-default} - case $enableval in - yes) enable_static=yes ;; - no) enable_static=no ;; - *) - enable_static=no - # Look at the argument we got. We use all the common list separators. - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," - for pkg in $enableval; do - IFS="$lt_save_ifs" - if test "X$pkg" = "X$p"; then - enable_static=yes - fi - done - IFS="$lt_save_ifs" - ;; - esac], - [enable_static=]AC_ENABLE_STATIC_DEFAULT) -])# AC_ENABLE_STATIC - - -# AC_DISABLE_STATIC -# ----------------- -# set the default static flag to --disable-static -AC_DEFUN([AC_DISABLE_STATIC], -[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl -AC_ENABLE_STATIC(no) -])# AC_DISABLE_STATIC - - -# AC_ENABLE_FAST_INSTALL([DEFAULT]) -# --------------------------------- -# implement the --enable-fast-install flag -# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. -AC_DEFUN([AC_ENABLE_FAST_INSTALL], -[define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl -AC_ARG_ENABLE([fast-install], - [AC_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], - [optimize for fast installation @<:@default=]AC_ENABLE_FAST_INSTALL_DEFAULT[@:>@])], - [p=${PACKAGE-default} - case $enableval in - yes) enable_fast_install=yes ;; - no) enable_fast_install=no ;; - *) - enable_fast_install=no - # Look at the argument we got. We use all the common list separators. - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," - for pkg in $enableval; do - IFS="$lt_save_ifs" - if test "X$pkg" = "X$p"; then - enable_fast_install=yes - fi - done - IFS="$lt_save_ifs" - ;; - esac], - [enable_fast_install=]AC_ENABLE_FAST_INSTALL_DEFAULT) -])# AC_ENABLE_FAST_INSTALL - - -# AC_DISABLE_FAST_INSTALL -# ----------------------- -# set the default to --disable-fast-install -AC_DEFUN([AC_DISABLE_FAST_INSTALL], -[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl -AC_ENABLE_FAST_INSTALL(no) -])# AC_DISABLE_FAST_INSTALL - - -# AC_LIBTOOL_PICMODE([MODE]) -# -------------------------- -# implement the --with-pic flag -# MODE is either `yes' or `no'. If omitted, it defaults to `both'. -AC_DEFUN([AC_LIBTOOL_PICMODE], -[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl -pic_mode=ifelse($#,1,$1,default) -])# AC_LIBTOOL_PICMODE - - -# AC_PROG_EGREP -# ------------- -# This is predefined starting with Autoconf 2.54, so this conditional -# definition can be removed once we require Autoconf 2.54 or later. -m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP], -[AC_CACHE_CHECK([for egrep], [ac_cv_prog_egrep], - [if echo a | (grep -E '(a|b)') >/dev/null 2>&1 - then ac_cv_prog_egrep='grep -E' - else ac_cv_prog_egrep='egrep' - fi]) - EGREP=$ac_cv_prog_egrep - AC_SUBST([EGREP]) -])]) - - -# AC_PATH_TOOL_PREFIX -# ------------------- -# find a file program which can recognise shared library -AC_DEFUN([AC_PATH_TOOL_PREFIX], -[AC_REQUIRE([AC_PROG_EGREP])dnl -AC_MSG_CHECKING([for $1]) -AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, -[case $MAGIC_CMD in -[[\\/*] | ?:[\\/]*]) - lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. - ;; -*) - lt_save_MAGIC_CMD="$MAGIC_CMD" - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR -dnl $ac_dummy forces splitting on constant user-supplied paths. -dnl POSIX.2 word splitting is done only on the output of word expansions, -dnl not every word. This closes a longstanding sh security hole. - ac_dummy="ifelse([$2], , $PATH, [$2])" - for ac_dir in $ac_dummy; do - IFS="$lt_save_ifs" - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$1; then - lt_cv_path_MAGIC_CMD="$ac_dir/$1" - if test -n "$file_magic_test_file"; then - case $deplibs_check_method in - "file_magic "*) - file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`" - MAGIC_CMD="$lt_cv_path_MAGIC_CMD" - if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | - $EGREP "$file_magic_regex" > /dev/null; then - : - else - cat <&2 - -*** Warning: the command libtool uses to detect shared libraries, -*** $file_magic_cmd, produces output that libtool cannot recognize. -*** The result is that libtool may fail to recognize shared libraries -*** as such. This will affect the creation of libtool libraries that -*** depend on shared libraries, but programs linked with such libtool -*** libraries will work regardless of this problem. Nevertheless, you -*** may want to report the problem to your system manager and/or to -*** bug-libtool@gnu.org - -EOF - fi ;; - esac - fi - break - fi - done - IFS="$lt_save_ifs" - MAGIC_CMD="$lt_save_MAGIC_CMD" - ;; -esac]) -MAGIC_CMD="$lt_cv_path_MAGIC_CMD" -if test -n "$MAGIC_CMD"; then - AC_MSG_RESULT($MAGIC_CMD) -else - AC_MSG_RESULT(no) -fi -])# AC_PATH_TOOL_PREFIX - - -# AC_PATH_MAGIC -# ------------- -# find a file program which can recognise a shared library -AC_DEFUN([AC_PATH_MAGIC], -[AC_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) -if test -z "$lt_cv_path_MAGIC_CMD"; then - if test -n "$ac_tool_prefix"; then - AC_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) - else - MAGIC_CMD=: - fi -fi -])# AC_PATH_MAGIC - - -# AC_PROG_LD -# ---------- -# find the path to the GNU or non-GNU linker -AC_DEFUN([AC_PROG_LD], -[AC_ARG_WITH([gnu-ld], - [AC_HELP_STRING([--with-gnu-ld], - [assume the C compiler uses GNU ld @<:@default=no@:>@])], - [test "$withval" = no || with_gnu_ld=yes], - [with_gnu_ld=no]) -AC_REQUIRE([LT_AC_PROG_SED])dnl -AC_REQUIRE([AC_PROG_CC])dnl -AC_REQUIRE([AC_CANONICAL_HOST])dnl -AC_REQUIRE([AC_CANONICAL_BUILD])dnl -ac_prog=ld -if test "$GCC" = yes; then - # Check if gcc -print-prog-name=ld gives a path. - AC_MSG_CHECKING([for ld used by $CC]) - case $host in - *-*-mingw*) - # gcc leaves a trailing carriage return which upsets mingw - ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; - *) - ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; - esac - case $ac_prog in - # Accept absolute paths. - [[\\/]]* | ?:[[\\/]]*) - re_direlt='/[[^/]][[^/]]*/\.\./' - # Canonicalize the path of ld - ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'` - while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do - ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"` - done - test -z "$LD" && LD="$ac_prog" - ;; - "") - # If it fails, then pretend we aren't using GCC. - ac_prog=ld - ;; - *) - # If it is relative, then search for the first ld in PATH. - with_gnu_ld=unknown - ;; - esac -elif test "$with_gnu_ld" = yes; then - AC_MSG_CHECKING([for GNU ld]) -else - AC_MSG_CHECKING([for non-GNU ld]) -fi -AC_CACHE_VAL(lt_cv_path_LD, -[if test -z "$LD"; then - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR - for ac_dir in $PATH; do - IFS="$lt_save_ifs" - test -z "$ac_dir" && ac_dir=. - if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then - lt_cv_path_LD="$ac_dir/$ac_prog" - # Check to see if the program is GNU ld. I'd rather use --version, - # but apparently some GNU ld's only accept -v. - # Break only if it was the GNU/non-GNU ld that we prefer. - case `"$lt_cv_path_LD" -v 2>&1 &1 /dev/null; then - case $host_cpu in - i*86 ) - # Not sure whether the presence of OpenBSD here was a mistake. - # Let's accept both of them until this is cleared up. - lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD)/i[[3-9]]86 (compact )?demand paged shared library' - lt_cv_file_magic_cmd=/usr/bin/file - lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` - ;; - esac - else - lt_cv_deplibs_check_method=pass_all - fi - ;; - -gnu*) - lt_cv_deplibs_check_method=pass_all - ;; - -hpux10.20* | hpux11*) - lt_cv_file_magic_cmd=/usr/bin/file - case "$host_cpu" in - ia64*) - lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' - lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so - ;; - hppa*64*) - [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]'] - lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl - ;; - *) - lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library' - lt_cv_file_magic_test_file=/usr/lib/libc.sl - ;; - esac - ;; - -irix5* | irix6* | nonstopux*) - case $host_os in - irix5* | nonstopux*) - # this will be overridden with pass_all, but let us keep it just in case - lt_cv_deplibs_check_method="file_magic ELF 32-bit MSB dynamic lib MIPS - version 1" - ;; - *) - case $LD in - *-32|*"-32 ") libmagic=32-bit;; - *-n32|*"-n32 ") libmagic=N32;; - *-64|*"-64 ") libmagic=64-bit;; - *) libmagic=never-match;; - esac - # this will be overridden with pass_all, but let us keep it just in case - lt_cv_deplibs_check_method="file_magic ELF ${libmagic} MSB mips-[[1234]] dynamic lib MIPS - version 1" - ;; - esac - lt_cv_file_magic_test_file=`echo /lib${libsuff}/libc.so*` - lt_cv_deplibs_check_method=pass_all - ;; - -# This must be Linux ELF. -linux*) - case $host_cpu in - alpha* | hppa* | i*86 | ia64* | m68* | mips | mipsel | powerpc* | sparc* | s390* | sh*) - lt_cv_deplibs_check_method=pass_all ;; - *) - # glibc up to 2.1.1 does not perform some relocations on ARM - lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' ;; - esac - lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so` - ;; - -netbsd*) - if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then - lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' - else - lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$' - fi - ;; - -newos6*) - lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' - lt_cv_file_magic_cmd=/usr/bin/file - lt_cv_file_magic_test_file=/usr/lib/libnls.so - ;; - -nto-qnx) - lt_cv_deplibs_check_method=unknown - ;; - -openbsd*) - lt_cv_file_magic_cmd=/usr/bin/file - lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` - if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB shared object' - else - lt_cv_deplibs_check_method='file_magic OpenBSD.* shared library' - fi - ;; - -osf3* | osf4* | osf5*) - # this will be overridden with pass_all, but let us keep it just in case - lt_cv_deplibs_check_method='file_magic COFF format alpha shared library' - lt_cv_file_magic_test_file=/shlib/libc.so - lt_cv_deplibs_check_method=pass_all - ;; - -sco3.2v5*) - lt_cv_deplibs_check_method=pass_all - ;; - -solaris*) - lt_cv_deplibs_check_method=pass_all - lt_cv_file_magic_test_file=/lib/libc.so - ;; - -sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) - case $host_vendor in - motorola) - lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]' - lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` - ;; - ncr) - lt_cv_deplibs_check_method=pass_all - ;; - sequent) - lt_cv_file_magic_cmd='/bin/file' - lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' - ;; - sni) - lt_cv_file_magic_cmd='/bin/file' - lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib" - lt_cv_file_magic_test_file=/lib/libc.so - ;; - siemens) - lt_cv_deplibs_check_method=pass_all - ;; - esac - ;; - -sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[[78]]* | unixware7* | sysv4*uw2*) - lt_cv_deplibs_check_method=pass_all - ;; -esac -]) -file_magic_cmd=$lt_cv_file_magic_cmd -deplibs_check_method=$lt_cv_deplibs_check_method -test -z "$deplibs_check_method" && deplibs_check_method=unknown -])# AC_DEPLIBS_CHECK_METHOD - - -# AC_PROG_NM -# ---------- -# find the path to a BSD-compatible name lister -AC_DEFUN([AC_PROG_NM], -[AC_CACHE_CHECK([for BSD-compatible nm], lt_cv_path_NM, -[if test -n "$NM"; then - # Let the user override the test. - lt_cv_path_NM="$NM" -else - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR - for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do - IFS="$lt_save_ifs" - test -z "$ac_dir" && ac_dir=. - tmp_nm="$ac_dir/${ac_tool_prefix}nm" - if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then - # Check to see if the nm accepts a BSD-compat flag. - # Adding the `sed 1q' prevents false positives on HP-UX, which says: - # nm: unknown option "B" ignored - # Tru64's nm complains that /dev/null is an invalid object file - case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in - */dev/null* | *'Invalid file or object type'*) - lt_cv_path_NM="$tmp_nm -B" - break - ;; - *) - case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in - */dev/null*) - lt_cv_path_NM="$tmp_nm -p" - break - ;; - *) - lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but - continue # so that we can try to find one that supports BSD flags - ;; - esac - esac - fi - done - IFS="$lt_save_ifs" - test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm -fi]) -NM="$lt_cv_path_NM" -])# AC_PROG_NM - - -# AC_CHECK_LIBM -# ------------- -# check for math library -AC_DEFUN([AC_CHECK_LIBM], -[AC_REQUIRE([AC_CANONICAL_HOST])dnl -LIBM= -case $host in -*-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*) - # These system don't have libm, or don't need it - ;; -*-ncr-sysv4.3*) - AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") - AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") - ;; -*) - AC_CHECK_LIB(m, cos, LIBM="-lm") - ;; -esac -])# AC_CHECK_LIBM - - -# AC_LIBLTDL_CONVENIENCE([DIRECTORY]) -# ----------------------------------- -# sets LIBLTDL to the link flags for the libltdl convenience library and -# LTDLINCL to the include flags for the libltdl header and adds -# --enable-ltdl-convenience to the configure arguments. Note that LIBLTDL -# and LTDLINCL are not AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called. If -# DIRECTORY is not provided, it is assumed to be `libltdl'. LIBLTDL will -# be prefixed with '${top_builddir}/' and LTDLINCL will be prefixed with -# '${top_srcdir}/' (note the single quotes!). If your package is not -# flat and you're not using automake, define top_builddir and -# top_srcdir appropriately in the Makefiles. -AC_DEFUN([AC_LIBLTDL_CONVENIENCE], -[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl - case $enable_ltdl_convenience in - no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;; - "") enable_ltdl_convenience=yes - ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;; - esac - LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la - LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl']) - # For backwards non-gettext consistent compatibility... - INCLTDL="$LTDLINCL" -])# AC_LIBLTDL_CONVENIENCE - - -# AC_LIBLTDL_INSTALLABLE([DIRECTORY]) -# ----------------------------------- -# sets LIBLTDL to the link flags for the libltdl installable library and -# LTDLINCL to the include flags for the libltdl header and adds -# --enable-ltdl-install to the configure arguments. Note that LIBLTDL -# and LTDLINCL are not AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called. If -# DIRECTORY is not provided and an installed libltdl is not found, it is -# assumed to be `libltdl'. LIBLTDL will be prefixed with '${top_builddir}/' -# and LTDLINCL will be prefixed with '${top_srcdir}/' (note the single -# quotes!). If your package is not flat and you're not using automake, -# define top_builddir and top_srcdir appropriately in the Makefiles. -# In the future, this macro may have to be called after AC_PROG_LIBTOOL. -AC_DEFUN([AC_LIBLTDL_INSTALLABLE], -[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl - AC_CHECK_LIB(ltdl, lt_dlinit, - [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no], - [if test x"$enable_ltdl_install" = xno; then - AC_MSG_WARN([libltdl not installed, but installation disabled]) - else - enable_ltdl_install=yes - fi - ]) - if test x"$enable_ltdl_install" = x"yes"; then - ac_configure_args="$ac_configure_args --enable-ltdl-install" - LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la - LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl']) - else - ac_configure_args="$ac_configure_args --enable-ltdl-install=no" - LIBLTDL="-lltdl" - LTDLINCL= - fi - # For backwards non-gettext consistent compatibility... - INCLTDL="$LTDLINCL" -])# AC_LIBLTDL_INSTALLABLE - - -# AC_LIBTOOL_CXX -# -------------- -# enable support for C++ libraries -AC_DEFUN([AC_LIBTOOL_CXX], -[AC_REQUIRE([_LT_AC_LANG_CXX]) -])# AC_LIBTOOL_CXX - - -# _LT_AC_LANG_CXX -# --------------- -AC_DEFUN([_LT_AC_LANG_CXX], -[AC_REQUIRE([AC_PROG_CXX]) -AC_REQUIRE([AC_PROG_CXXCPP]) -_LT_AC_SHELL_INIT([tagnames=`echo "$tagnames,CXX" | sed 's/^,//'`]) -])# _LT_AC_LANG_CXX - - -# AC_LIBTOOL_F77 -# -------------- -# enable support for Fortran 77 libraries -AC_DEFUN([AC_LIBTOOL_F77], -[AC_REQUIRE([_LT_AC_LANG_F77]) -])# AC_LIBTOOL_F77 - - -# _LT_AC_LANG_F77 -# --------------- -AC_DEFUN([_LT_AC_LANG_F77], -[AC_REQUIRE([AC_PROG_F77]) -_LT_AC_SHELL_INIT([tagnames=`echo "$tagnames,F77" | sed 's/^,//'`]) -])# _LT_AC_LANG_F77 - - -# AC_LIBTOOL_GCJ -# -------------- -# enable support for GCJ libraries -AC_DEFUN([AC_LIBTOOL_GCJ], -[AC_REQUIRE([_LT_AC_LANG_GCJ]) -])# AC_LIBTOOL_GCJ - - -# _LT_AC_LANG_GCJ -# --------------- -AC_DEFUN([_LT_AC_LANG_GCJ], -[AC_PROVIDE_IFELSE([AC_PROG_GCJ],[], - [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],[], - [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],[], - [ifdef([AC_PROG_GCJ],[AC_REQUIRE([AC_PROG_GCJ])], - [ifdef([A][M_PROG_GCJ],[AC_REQUIRE([A][M_PROG_GCJ])], - [AC_REQUIRE([A][C_PROG_GCJ_OR_A][M_PROG_GCJ])])])])])]) -_LT_AC_SHELL_INIT([tagnames=`echo "$tagnames,GCJ" | sed 's/^,//'`]) -])# _LT_AC_LANG_GCJ - - -# AC_LIBTOOL_RC -# -------------- -# enable support for Windows resource files -AC_DEFUN([AC_LIBTOOL_RC], -[AC_REQUIRE([LT_AC_PROG_RC]) -_LT_AC_SHELL_INIT([tagnames=`echo "$tagnames,RC" | sed 's/^,//'`]) -])# AC_LIBTOOL_RC - - -# AC_LIBTOOL_LANG_C_CONFIG -# ------------------------ -# Ensure that the configuration vars for the C compiler are -# suitably defined. Those variables are subsequently used by -# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'. -AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG], [_LT_AC_LANG_C_CONFIG]) -AC_DEFUN([_LT_AC_LANG_C_CONFIG], -[lt_save_CC="$CC" -AC_LANG_PUSH(C) - -# Source file extension for C test sources. -ac_ext=c - -# Object file extension for compiled C test sources. -objext=o -_LT_AC_TAGVAR(objext, $1)=$objext - -# Code to be used in simple compile tests -lt_simple_compile_test_code="int some_variable = 0;\n" - -# Code to be used in simple link tests -lt_simple_link_test_code='int main(){return(0);}\n' - -_LT_AC_SYS_COMPILER - -# -# Check for any special shared library compilation flags. -# -_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)= -if test "$GCC" = no; then - case $host_os in - sco3.2v5*) - _LT_AC_TAGVAR(lt_prog_cc_shlib, $1)='-belf' - ;; - esac -fi -if test -n "$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)"; then - AC_MSG_WARN([`$CC' requires `$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)' to build shared libraries]) - if echo "$old_CC $old_CFLAGS " | grep "[[ ]]$]_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)[[[ ]]" >/dev/null; then : - else - AC_MSG_WARN([add `$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)' to the CC or CFLAGS env variable and reconfigure]) - _LT_AC_TAGVAR(lt_cv_prog_cc_can_build_shared, $1)=no - fi -fi - - -# -# Check to make sure the static flag actually works. -# -AC_LIBTOOL_LINKER_OPTION([if $compiler static flag $_LT_AC_TAGVAR(lt_prog_compiler_static, $1) works], - _LT_AC_TAGVAR(lt_prog_compiler_static_works, $1), - $_LT_AC_TAGVAR(lt_prog_compiler_static, $1), - [], - [_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=]) - - -AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1) -AC_LIBTOOL_PROG_COMPILER_PIC($1) -AC_LIBTOOL_PROG_CC_C_O($1) -AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1) -AC_LIBTOOL_PROG_LD_SHLIBS($1) -AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1) -AC_LIBTOOL_SYS_LIB_STRIP -AC_LIBTOOL_SYS_DYNAMIC_LINKER($1) -AC_LIBTOOL_DLOPEN_SELF($1) - -# Report which librarie types wil actually be built -AC_MSG_CHECKING([if libtool supports shared libraries]) -AC_MSG_RESULT([$can_build_shared]) - -AC_MSG_CHECKING([whether to build shared libraries]) -test "$can_build_shared" = "no" && enable_shared=no - -# On AIX, shared libraries and static libraries use the same namespace, and -# are all built from PIC. -case "$host_os" in -aix3*) - test "$enable_shared" = yes && enable_static=no - if test -n "$RANLIB"; then - archive_cmds="$archive_cmds\${_S_}\$RANLIB \$lib" - postinstall_cmds='$RANLIB $lib' - fi - ;; - -aix4*) - if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then - test "$enable_shared" = yes && enable_static=no - fi - ;; - darwin* | rhapsody*) - if $CC -v 2>&1 | grep 'Apple' >/dev/null ; then - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no - case "$host_os" in - rhapsody* | darwin1.[[012]]) - _LT_AC_TAGVAR(allow_undefined_flag, $1)='-undefined suppress' - ;; - darwin1.* | darwin[[2-6]].*) # Darwin 1.3 on, but less than 7.0 - test -z ${LD_TWOLEVEL_NAMESPACE} && _LT_AC_TAGVAR(allow_undefined_flag, $1)='-flat_namespace -undefined suppress' - ;; - *) # Darwin 7.0 on - case "${MACOSX_DEPLOYMENT_TARGET-10.1}" in - 10.[[012]]) - test -z ${LD_TWOLEVEL_NAMESPACE} && _LT_AC_TAGVAR(allow_undefined_flag, $1)='-flat_namespace -undefined suppress' - ;; - *) # 10.3 on - if test -z ${LD_TWOLEVEL_NAMESPACE}; then - _LT_AC_TAGVAR(allow_undefined_flag, $1)='-flat_namespace -undefined suppress' - else - _LT_AC_TAGVAR(allow_undefined_flag, $1)='-undefined dynamic_lookup' - fi - ;; - esac - ;; - esac - # FIXME: Relying on posixy $() will cause problems for - # cross-compilation, but unfortunately the echo tests do not - # yet detect zsh echo's removal of \ escapes. Also zsh mangles - # `"' quotes if we put them in here... so don't! - output_verbose_link_cmd='echo' - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib $archargs $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags -install_name $rpath/$soname $verstring' - _LT_AC_TAGVAR(module_cmds, $1)='$CC -bundle $archargs $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags' - # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym${_S_}$CC -dynamiclib $archargs $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags -install_name $rpath/$soname $verstring${_S_}nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym${_S_}$CC -bundle $archargs $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags${_S_}nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - _LT_AC_TAGVAR(hardcode_direct, $1)=no - _LT_AC_TAGVAR(hardcode_automatic, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-all_load $convenience' - _LT_AC_TAGVAR(link_all_deplibs, $1)=yes - fi - ;; -esac -AC_MSG_RESULT([$enable_shared]) - -AC_MSG_CHECKING([whether to build static libraries]) -# Make sure either enable_shared or enable_static is yes. -test "$enable_shared" = yes || enable_static=yes -AC_MSG_RESULT([$enable_static]) - -AC_LIBTOOL_CONFIG($1) - -AC_LANG_POP -CC="$lt_save_CC" -])# AC_LIBTOOL_LANG_C_CONFIG - - -# AC_LIBTOOL_LANG_CXX_CONFIG -# -------------------------- -# Ensure that the configuration vars for the C compiler are -# suitably defined. Those variables are subsequently used by -# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'. -AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG], [_LT_AC_LANG_CXX_CONFIG(CXX)]) -AC_DEFUN([_LT_AC_LANG_CXX_CONFIG], -[AC_LANG_PUSH(C++) -AC_REQUIRE([AC_PROG_CXX]) -AC_REQUIRE([AC_PROG_CXXCPP]) - -_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no -_LT_AC_TAGVAR(allow_undefined_flag, $1)= -_LT_AC_TAGVAR(always_export_symbols, $1)=no -_LT_AC_TAGVAR(archive_expsym_cmds, $1)= -_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= -_LT_AC_TAGVAR(hardcode_direct, $1)=no -_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= -_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= -_LT_AC_TAGVAR(hardcode_libdir_separator, $1)= -_LT_AC_TAGVAR(hardcode_minus_L, $1)=no -_LT_AC_TAGVAR(hardcode_automatic, $1)=no -_LT_AC_TAGVAR(module_cmds, $1)= -_LT_AC_TAGVAR(module_expsym_cmds, $1)= -_LT_AC_TAGVAR(link_all_deplibs, $1)=unknown -_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds -_LT_AC_TAGVAR(no_undefined_flag, $1)= -_LT_AC_TAGVAR(whole_archive_flag_spec, $1)= -_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no - -# Dependencies to place before and after the object being linked: -_LT_AC_TAGVAR(predep_objects, $1)= -_LT_AC_TAGVAR(postdep_objects, $1)= -_LT_AC_TAGVAR(predeps, $1)= -_LT_AC_TAGVAR(postdeps, $1)= -_LT_AC_TAGVAR(compiler_lib_search_path, $1)= - -# Source file extension for C++ test sources. -ac_ext=cc - -# Object file extension for compiled C++ test sources. -objext=o -_LT_AC_TAGVAR(objext, $1)=$objext - -# Code to be used in simple compile tests -lt_simple_compile_test_code="int some_variable = 0;\n" - -# Code to be used in simple link tests -lt_simple_link_test_code='int main(int, char *[]) { return(0); }\n' - -# ltmain only uses $CC for tagged configurations so make sure $CC is set. -_LT_AC_SYS_COMPILER - -# Allow CC to be a program name with arguments. -lt_save_CC=$CC -lt_save_LD=$LD -lt_save_GCC=$GCC -GCC=$GXX -lt_save_with_gnu_ld=$with_gnu_ld -lt_save_path_LD=$lt_cv_path_LD -if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then - lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx -else - unset lt_cv_prog_gnu_ld -fi -if test -n "${lt_cv_path_LDCXX+set}"; then - lt_cv_path_LD=$lt_cv_path_LDCXX -else - unset lt_cv_path_LD -fi -test -z "${LDCXX+set}" || LD=$LDCXX -CC=${CXX-"c++"} -compiler=$CC -_LT_AC_TAGVAR(compiler, $1)=$CC -cc_basename=`$echo X"$compiler" | $Xsed -e 's%^.*/%%'` - -# We don't want -fno-exception wen compiling C++ code, so set the -# no_builtin_flag separately -if test "$GXX" = yes; then - _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' -else - _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= -fi - -if test "$GXX" = yes; then - # Set up default GNU C++ configuration - - AC_PROG_LD - - # Check if GNU C++ uses GNU ld as the underlying linker, since the - # archiving commands below assume that GNU ld is being used. - if test "$with_gnu_ld" = yes; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' - - # If archive_cmds runs LD, not CC, wlarc should be empty - # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to - # investigate it a little bit more. (MM) - wlarc='${wl}' - - # ancient GNU ld didn't support --whole-archive et. al. - if eval "`$CC -print-prog-name=ld` --help 2>&1" | \ - grep 'no-whole-archive' > /dev/null; then - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' - else - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= - fi - else - with_gnu_ld=no - wlarc= - - # A generic and very simple default shared library creation - # command for GNU C++ for the case where it uses the native - # linker, instead of GNU ld. If possible, this setting should - # overridden to take advantage of the native linker features on - # the platform it is being used on. - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' - fi - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' - -else - GXX=no - with_gnu_ld=no - wlarc= -fi - -# PORTME: fill in a description of your system's C++ link characteristics -AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) -_LT_AC_TAGVAR(ld_shlibs, $1)=yes -case $host_os in - aix3*) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - aix4* | aix5*) - if test "$host_cpu" = ia64; then - # On IA64, the linker does run time linking by default, so we don't - # have to do anything special. - aix_use_runtimelinking=no - exp_sym_flag='-Bexport' - no_entry_flag="" - else - aix_use_runtimelinking=no - - # Test if we are trying to use run time linking or normal - # AIX style linking. If -brtl is somewhere in LDFLAGS, we - # need to do runtime linking. - case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*) - for ld_flag in $LDFLAGS; do - case $ld_flag in - *-brtl*) - aix_use_runtimelinking=yes - break - ;; - esac - done - esac - - exp_sym_flag='-bexport' - no_entry_flag='-bnoentry' - fi - - # When large executables or shared objects are built, AIX ld can - # have problems creating the table of contents. If linking a library - # or program results in "error TOC overflow" add -mminimal-toc to - # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not - # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. - - _LT_AC_TAGVAR(archive_cmds, $1)='' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' - _LT_AC_TAGVAR(link_all_deplibs, $1)=yes - - if test "$GXX" = yes; then - case $host_os in aix4.[012]|aix4.[012].*) - # We only want to do this on AIX 4.2 and lower, the check - # below for broken collect2 doesn't work under 4.3+ - collect2name=`${CC} -print-prog-name=collect2` - if test -f "$collect2name" && \ - strings "$collect2name" | grep resolve_lib_name >/dev/null - then - # We have reworked collect2 - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - else - # We have old collect2 - _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported - # It fails to find uninstalled libraries when the uninstalled - # path is not listed in the libpath. Setting hardcode_minus_L - # to unsupported forces relinking - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= - fi - esac - shared_flag='-shared' - else - # not using gcc - if test "$host_cpu" = ia64; then - # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release - # chokes on -Wl,-G. The following line is correct: - shared_flag='-G' - else - if test "$aix_use_runtimelinking" = yes; then - shared_flag='${wl}-G' - else - shared_flag='${wl}-bM:SRE' - fi - fi - fi - - # It seems that -bexpall does not export symbols beginning with - # underscore (_), so it is better to generate a list of symbols to export. - _LT_AC_TAGVAR(always_export_symbols, $1)=yes - if test "$aix_use_runtimelinking" = yes; then - # Warning - without using the other runtime loading flags (-brtl), - # -berok will link without error, but may produce a broken library. - _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok' - # Determine the default libpath from the value encoded in an empty executable. - _LT_AC_SYS_LIBPATH_AIX - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" - - _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag" - else - if test "$host_cpu" = ia64; then - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' - _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs" - _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols" - else - # Determine the default libpath from the value encoded in an empty executable. - _LT_AC_SYS_LIBPATH_AIX - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" - # Warning - without using the other run time loading flags, - # -berok will link without error, but may produce a broken library. - _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' - _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' - # -bexpall does not export symbols beginning with underscore (_) - _LT_AC_TAGVAR(always_export_symbols, $1)=yes - # Exported symbols can be pulled into shared objects from archives - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=' ' - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes - # This is similar to how AIX traditionally builds it's shared libraries. - _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}\${_S_}$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' - fi - fi - ;; - chorus*) - case $cc_basename in - *) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - esac - ;; - - cygwin* | mingw* | pw32*) - # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, - # as there is no search path for DLLs. - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported - _LT_AC_TAGVAR(always_export_symbols, $1)=no - _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes - - if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' - # If the export-symbols file already is a .def file (1st line - # is EXPORTS), use it as is; otherwise, prepend... - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then - cp $export_symbols $output_objdir/$soname.def; - else - echo EXPORTS > $output_objdir/$soname.def; - cat $export_symbols >> $output_objdir/$soname.def; - fi${_S_} - $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' - else - _LT_AC_TAGVAR(ld_shlibs, $1)=no - fi - ;; - - darwin* | rhapsody*) - if $CC -v 2>&1 | grep 'Apple' >/dev/null ; then - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no - case "$host_os" in - rhapsody* | darwin1.[[012]]) - _LT_AC_TAGVAR(allow_undefined_flag, $1)='-undefined suppress' - ;; - darwin1.* | darwin[[2-6]].*) # Darwin 1.3 on, but less than 7.0 - test -z ${LD_TWOLEVEL_NAMESPACE} && _LT_AC_TAGVAR(allow_undefined_flag, $1)='-flat_namespace -undefined suppress' - ;; - *) # Darwin 7.0 on - case "${MACOSX_DEPLOYMENT_TARGET-10.1}" in - 10.[[012]]) - test -z ${LD_TWOLEVEL_NAMESPACE} && _LT_AC_TAGVAR(allow_undefined_flag, $1)='-flat_namespace -undefined suppress' - ;; - *) # 10.3 on - if test -z ${LD_TWOLEVEL_NAMESPACE}; then - _LT_AC_TAGVAR(allow_undefined_flag, $1)='-flat_namespace -undefined suppress' - else - _LT_AC_TAGVAR(allow_undefined_flag, $1)='-undefined dynamic_lookup' - fi - ;; - esac - ;; - esac - lt_int_apple_cc_single_mod=no - output_verbose_link_cmd='echo' - if $CC -dumpspecs 2>&1 | grep 'single_module' >/dev/null ; then - lt_int_apple_cc_single_mod=yes - fi - if test "X$lt_int_apple_cc_single_mod" = Xyes ; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib $archargs -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' - else - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs${_S_}$CC -dynamiclib $archargs $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring' - fi - _LT_AC_TAGVAR(module_cmds, $1)='$CC -bundle $archargs ${wl}-bind_at_load $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags' - - # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's - if test "X$lt_int_apple_cc_single_mod" = Xyes ; then - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym${_S_}$CC -dynamiclib $archargs -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring${_S_}nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - else - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym${_S_}$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs${_S_}$CC -dynamiclib $archargs $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring${_S_}nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - fi - _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym${_S_}$CC -bundle $archargs $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags${_S_}nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - _LT_AC_TAGVAR(hardcode_direct, $1)=no - _LT_AC_TAGVAR(hardcode_automatic, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-all_load $convenience' - _LT_AC_TAGVAR(link_all_deplibs, $1)=yes - fi - ;; - - dgux*) - case $cc_basename in - ec++) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - ghcx) - # Green Hills C++ Compiler - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - *) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - esac - ;; - freebsd[12]*) - # C++ shared libraries reported to be fairly broken before switch to ELF - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - freebsd-elf*) - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no - ;; - freebsd*) - # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF - # conventions - _LT_AC_TAGVAR(ld_shlibs, $1)=yes - ;; - gnu*) - ;; - hpux9*) - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, - # but as the default - # location of the library. - - case $cc_basename in - CC) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - aCC) - _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname${_S_}$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags${_S_}test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | egrep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' - ;; - *) - if test "$GXX" = yes; then - _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname${_S_}$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags${_S_}test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - else - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - fi - ;; - esac - ;; - hpux10*|hpux11*) - if test $with_gnu_ld = no; then - case "$host_cpu" in - hppa*64*) - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - ;; - ia64*) - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - ;; - *) - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' - ;; - esac - fi - case "$host_cpu" in - hppa*64*) - _LT_AC_TAGVAR(hardcode_direct, $1)=no - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - ia64*) - _LT_AC_TAGVAR(hardcode_direct, $1)=no - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, - # but as the default - # location of the library. - ;; - *) - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, - # but as the default - # location of the library. - ;; - esac - - case $cc_basename in - CC) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - aCC) - case "$host_cpu" in - hppa*64*|ia64*) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs' - ;; - *) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - esac - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' - ;; - *) - if test "$GXX" = yes; then - if test $with_gnu_ld = no; then - case "$host_cpu" in - ia64*|hppa*64*) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs' - ;; - *) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - esac - fi - else - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - fi - ;; - esac - ;; - irix5* | irix6*) - case $cc_basename in - CC) - # SGI C++ - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib' - - # Archives containing C++ object files must be created using - # "CC -ar", where "CC" is the IRIX C++ compiler. This is - # necessary to make sure instantiated templates are included - # in the archive. - _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' - ;; - *) - if test "$GXX" = yes; then - if test "$with_gnu_ld" = no; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib' - else - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib' - fi - fi - _LT_AC_TAGVAR(link_all_deplibs, $1)=yes - ;; - esac - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - ;; - linux*) - case $cc_basename in - KCC) - # Kuck and Associates, Inc. (KAI) C++ Compiler - - # KCC will only create a shared library if the output file - # ends with ".so" (or ".sl" for HP-UX), so rename the library - # to its proper name (with version) after linking. - _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | grep "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' - - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath,$libdir' - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' - - # Archives containing C++ object files must be created using - # "CC -Bstatic", where "CC" is the KAI C++ compiler. - _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' - ;; - icpc) - # Intel C++ - with_gnu_ld=yes - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' - ;; - cxx) - # Compaq C++ - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' - - runpath_var=LD_RUN_PATH - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' - ;; - esac - ;; - lynxos*) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - m88k*) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - mvs*) - case $cc_basename in - cxx) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - *) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - esac - ;; - netbsd*) - if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' - wlarc= - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - fi - # Workaround some broken pre-1.5 toolchains - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' - ;; - osf3*) - case $cc_basename in - KCC) - # Kuck and Associates, Inc. (KAI) C++ Compiler - - # KCC will only create a shared library if the output file - # ends with ".so" (or ".sl" for HP-UX), so rename the library - # to its proper name (with version) after linking. - _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' - - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - - # Archives containing C++ object files must be created using - # "CC -Bstatic", where "CC" is the KAI C++ compiler. - _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' - - ;; - RCC) - # Rational C++ 2.4.1 - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - cxx) - _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${objdir}/so_locations -o $lib' - - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' - ;; - *) - if test "$GXX" = yes && test "$with_gnu_ld" = no; then - _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib' - - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' - - else - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - fi - ;; - esac - ;; - osf4* | osf5*) - case $cc_basename in - KCC) - # Kuck and Associates, Inc. (KAI) C++ Compiler - - # KCC will only create a shared library if the output file - # ends with ".so" (or ".sl" for HP-UX), so rename the library - # to its proper name (with version) after linking. - _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' - - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - - # Archives containing C++ object files must be created using - # the KAI C++ compiler. - _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' - ;; - RCC) - # Rational C++ 2.4.1 - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - cxx) - _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done${_S_} - echo "-hidden">> $lib.exp${_S_} - $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname -Wl,-input -Wl,$lib.exp `test -n "$verstring" && echo -set_version $verstring` -update_registry $objdir/so_locations -o $lib${_S_} - $rm $lib.exp' - - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' - ;; - *) - if test "$GXX" = yes && test "$with_gnu_ld" = no; then - _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib' - - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' - - else - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - fi - ;; - esac - ;; - psos*) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - sco*) - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no - case $cc_basename in - CC) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - *) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - esac - ;; - sunos4*) - case $cc_basename in - CC) - # Sun C++ 4.x - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - lcc) - # Lucid - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - *) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - esac - ;; - solaris*) - case $cc_basename in - CC) - # Sun C++ 4.2, 5.x and Centerline C++ - _LT_AC_TAGVAR(no_undefined_flag, $1)=' -zdefs' - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -nolib -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp${_S_}cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp${_S_}$echo "local: *; };" >> $lib.exp${_S_} - $CC -G${allow_undefined_flag} -nolib ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags${_S_}$rm $lib.exp' - - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - case $host_os in - solaris2.[0-5] | solaris2.[0-5].*) ;; - *) - # The C++ compiler is used as linker so we must use $wl - # flag to pass the commands to the underlying system - # linker. - # Supported since Solaris 2.6 (maybe 2.5.1?) - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' - ;; - esac - _LT_AC_TAGVAR(link_all_deplibs, $1)=yes - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep "\-[[LR]]"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' - - # Archives containing C++ object files must be created using - # "CC -xar", where "CC" is the Sun C++ compiler. This is - # necessary to make sure instantiated templates are included - # in the archive. - _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' - ;; - gcx) - # Green Hills C++ Compiler - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' - - # The C++ compiler must be used to create the archive. - _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs' - ;; - *) - # GNU C++ compiler with Solaris linker - if test "$GXX" = yes && test "$with_gnu_ld" = no; then - _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs' - if $CC --version | grep -v '^2\.7' > /dev/null; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp${_S_}cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp${_S_}$echo "local: *; };" >> $lib.exp${_S_} - $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags${_S_}$rm $lib.exp' - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" - else - # g++ 2.7 appears to require `-G' NOT `-shared' on this - # platform. - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp${_S_}cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp${_S_}$echo "local: *; };" >> $lib.exp${_S_} - $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags${_S_}$rm $lib.exp' - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" - fi - - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir' - fi - ;; - esac - ;; - sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[[78]]* | unixware7*) - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no - ;; - tandem*) - case $cc_basename in - NCC) - # NonStop-UX NCC 3.20 - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - *) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - esac - ;; - vxworks*) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - *) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; -esac -AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)]) -test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no - -_LT_AC_TAGVAR(GCC, $1)="$GXX" -_LT_AC_TAGVAR(LD, $1)="$LD" - -AC_LIBTOOL_POSTDEP_PREDEP($1) -AC_LIBTOOL_PROG_COMPILER_PIC($1) -AC_LIBTOOL_PROG_CC_C_O($1) -AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1) -AC_LIBTOOL_PROG_LD_SHLIBS($1) -AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1) -AC_LIBTOOL_SYS_LIB_STRIP -AC_LIBTOOL_SYS_DYNAMIC_LINKER($1) -AC_LIBTOOL_DLOPEN_SELF($1) - -AC_LIBTOOL_CONFIG($1) - -AC_LANG_POP -CC=$lt_save_CC -LDCXX=$LD -LD=$lt_save_LD -GCC=$lt_save_GCC -with_gnu_ldcxx=$with_gnu_ld -with_gnu_ld=$lt_save_with_gnu_ld -lt_cv_path_LDCXX=$lt_cv_path_LD -lt_cv_path_LD=$lt_save_path_LD -lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld -lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld -])# AC_LIBTOOL_LANG_CXX_CONFIG - -# AC_LIBTOOL_POSTDEP_PREDEP([TAGNAME]) -# ------------------------ -# Figure out "hidden" library dependencies from verbose -# compiler output when linking a shared library. -# Parse the compiler output and extract the necessary -# objects, libraries and library flags. -AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP],[ -dnl we can't use the lt_simple_compile_test_code here, -dnl because it contains code intended for an executable, -dnl not a library. It's possible we should let each -dnl tag define a new lt_????_link_test_code variable, -dnl but it's only used here... -ifelse([$1],[],[cat > conftest.$ac_ext < conftest.$ac_ext < conftest.$ac_ext < conftest.$ac_ext <> "$cfgfile" -ifelse([$1], [], -[#! $SHELL - -# `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services. -# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP) -# NOTE: Changes made to this file will be lost: look at ltmain.sh. -# -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001 -# Free Software Foundation, Inc. -# -# This file is part of GNU Libtool: -# Originally by Gordon Matzigkeit , 1996 -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - -# A sed program that does not truncate output. -SED=$lt_SED - -# Sed that helps us avoid accidentally triggering echo(1) options like -n. -Xsed="$SED -e s/^X//" - -# The HP-UX ksh and POSIX shell print the target directory to stdout -# if CDPATH is set. -if test "X\${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi - -# The names of the tagged configurations supported by this script. -available_tags= - -# ### BEGIN LIBTOOL CONFIG], -[# ### BEGIN LIBTOOL TAG CONFIG: $tagname]) - -# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: - -# Set the command separator (default: ~) -_S_=\${LIBTOOL_CMD_SEP-\~} - -# Shell to use when invoking shell scripts. -SHELL=$lt_SHELL - -# Whether or not to build shared libraries. -build_libtool_libs=$enable_shared - -# Whether or not to build static libraries. -build_old_libs=$enable_static - -# Whether or not to add -lc for building shared libraries. -build_libtool_need_lc=$_LT_AC_TAGVAR(archive_cmds_need_lc, $1) - -# Whether or not to disallow shared libs when runtime libs are static -allow_libtool_libs_with_static_runtimes=$_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1) - -# Whether or not to optimize for fast installation. -fast_install=$enable_fast_install - -# The host system. -host_alias=$host_alias -host=$host - -# An echo program that does not interpret backslashes. -echo=$lt_echo - -# The archiver. -AR=$lt_AR -AR_FLAGS=$lt_AR_FLAGS - -# A C compiler. -LTCC=$lt_LTCC - -# A language-specific compiler. -CC=$lt_[]_LT_AC_TAGVAR(compiler, $1) - -# Is the compiler the GNU C compiler? -with_gcc=$_LT_AC_TAGVAR(GCC, $1) - -# An ERE matcher. -EGREP=$lt_EGREP - -# The linker used to build libraries. -LD=$lt_[]_LT_AC_TAGVAR(LD, $1) - -# Whether we need hard or soft links. -LN_S=$lt_LN_S - -# A BSD-compatible nm program. -NM=$lt_NM - -# A symbol stripping program -STRIP=$STRIP - -# Used to examine libraries when file_magic_cmd begins "file" -MAGIC_CMD=$MAGIC_CMD - -# Used on cygwin: DLL creation program. -DLLTOOL="$DLLTOOL" - -# Used on cygwin: object dumper. -OBJDUMP="$OBJDUMP" - -# Used on cygwin: assembler. -AS="$AS" - -# The name of the directory that contains temporary libtool files. -objdir=$objdir - -# How to create reloadable object files. -reload_flag=$lt_reload_flag -reload_cmds=$lt_reload_cmds - -# How to pass a linker flag through the compiler. -wl=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) - -# Object file suffix (normally "o"). -objext="$ac_objext" - -# Old archive suffix (normally "a"). -libext="$libext" - -# Shared library suffix (normally ".so"). -shrext='$shrext' - -# Executable file suffix (normally ""). -exeext="$exeext" - -# Additional compiler flags for building library objects. -pic_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) -pic_mode=$pic_mode - -# What is the maximum length of a command? -max_cmd_len=$lt_cv_sys_max_cmd_len - -# Does compiler simultaneously support -c and -o options? -compiler_c_o=$lt_[]_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1) - -# Must we lock files when doing compilation ? -need_locks=$lt_need_locks - -# Do we need the lib prefix for modules? -need_lib_prefix=$need_lib_prefix - -# Do we need a version for libraries? -need_version=$need_version - -# Whether dlopen is supported. -dlopen_support=$enable_dlopen - -# Whether dlopen of programs is supported. -dlopen_self=$enable_dlopen_self - -# Whether dlopen of statically linked programs is supported. -dlopen_self_static=$enable_dlopen_self_static - -# Compiler flag to prevent dynamic linking. -link_static_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_static, $1) - -# Compiler flag to turn off builtin functions. -no_builtin_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) - -# Compiler flag to allow reflexive dlopens. -export_dynamic_flag_spec=$lt_[]_LT_AC_TAGVAR(export_dynamic_flag_spec, $1) - -# Compiler flag to generate shared objects directly from archives. -whole_archive_flag_spec=$lt_[]_LT_AC_TAGVAR(whole_archive_flag_spec, $1) - -# Compiler flag to generate thread-safe objects. -thread_safe_flag_spec=$lt_[]_LT_AC_TAGVAR(thread_safe_flag_spec, $1) - -# Library versioning type. -version_type=$version_type - -# Format of library name prefix. -libname_spec=$lt_libname_spec - -# List of archive names. First name is the real one, the rest are links. -# The last name is the one that the linker finds with -lNAME. -library_names_spec=$lt_library_names_spec - -# The coded name of the library, if different from the real name. -soname_spec=$lt_soname_spec - -# Commands used to build and install an old-style archive. -RANLIB=$lt_RANLIB -old_archive_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_cmds, $1) -old_postinstall_cmds=$lt_old_postinstall_cmds -old_postuninstall_cmds=$lt_old_postuninstall_cmds - -# Create an old-style archive from a shared archive. -old_archive_from_new_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_new_cmds, $1) - -# Create a temporary old-style archive to link instead of a shared archive. -old_archive_from_expsyms_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) - -# Commands used to build and install a shared archive. -archive_cmds=$lt_[]_LT_AC_TAGVAR(archive_cmds, $1) -archive_expsym_cmds=$lt_[]_LT_AC_TAGVAR(archive_expsym_cmds, $1) -postinstall_cmds=$lt_postinstall_cmds -postuninstall_cmds=$lt_postuninstall_cmds - -# Commands used to build a loadable module (assumed same as above if empty) -module_cmds=$lt_[]_LT_AC_TAGVAR(module_cmds, $1) -module_expsym_cmds=$lt_[]_LT_AC_TAGVAR(module_expsym_cmds, $1) - -# Commands to strip libraries. -old_striplib=$lt_old_striplib -striplib=$lt_striplib - -# Dependencies to place before the objects being linked to create a -# shared library. -predep_objects=$lt_[]_LT_AC_TAGVAR(predep_objects, $1) - -# Dependencies to place after the objects being linked to create a -# shared library. -postdep_objects=$lt_[]_LT_AC_TAGVAR(postdep_objects, $1) - -# Dependencies to place before the objects being linked to create a -# shared library. -predeps=$lt_[]_LT_AC_TAGVAR(predeps, $1) - -# Dependencies to place after the objects being linked to create a -# shared library. -postdeps=$lt_[]_LT_AC_TAGVAR(postdeps, $1) - -# The library search path used internally by the compiler when linking -# a shared library. -compiler_lib_search_path=$lt_[]_LT_AC_TAGVAR(compiler_lib_search_path, $1) - -# Method to check whether dependent libraries are shared objects. -deplibs_check_method=$lt_deplibs_check_method - -# Command to use when deplibs_check_method == file_magic. -file_magic_cmd=$lt_file_magic_cmd - -# Flag that allows shared libraries with undefined symbols to be built. -allow_undefined_flag=$lt_[]_LT_AC_TAGVAR(allow_undefined_flag, $1) - -# Flag that forces no undefined symbols. -no_undefined_flag=$lt_[]_LT_AC_TAGVAR(no_undefined_flag, $1) - -# Commands used to finish a libtool library installation in a directory. -finish_cmds=$lt_finish_cmds - -# Same as above, but a single script fragment to be evaled but not shown. -finish_eval=$lt_finish_eval - -# Take the output of nm and produce a listing of raw symbols and C names. -global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe - -# Transform the output of nm in a proper C declaration -global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl - -# Transform the output of nm in a C name address pair -global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address - -# This is the shared library runtime path variable. -runpath_var=$runpath_var - -# This is the shared library path variable. -shlibpath_var=$shlibpath_var - -# Is shlibpath searched before the hard-coded library search path? -shlibpath_overrides_runpath=$shlibpath_overrides_runpath - -# How to hardcode a shared library path into an executable. -hardcode_action=$_LT_AC_TAGVAR(hardcode_action, $1) - -# Whether we should hardcode library paths into libraries. -hardcode_into_libs=$hardcode_into_libs - -# Flag to hardcode \$libdir into a binary during linking. -# This must work even if \$libdir does not exist. -hardcode_libdir_flag_spec=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) - -# If ld is used when linking, flag to hardcode \$libdir into -# a binary during linking. This must work even if \$libdir does -# not exist. -hardcode_libdir_flag_spec_ld=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1) - -# Whether we need a single -rpath flag with a separated argument. -hardcode_libdir_separator=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_separator, $1) - -# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the -# resulting binary. -hardcode_direct=$_LT_AC_TAGVAR(hardcode_direct, $1) - -# Set to yes if using the -LDIR flag during linking hardcodes DIR into the -# resulting binary. -hardcode_minus_L=$_LT_AC_TAGVAR(hardcode_minus_L, $1) - -# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into -# the resulting binary. -hardcode_shlibpath_var=$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1) - -# Set to yes if building a shared library automatically hardcodes DIR into the library -# and all subsequent libraries and executables linked against it. -hardcode_automatic=$_LT_AC_TAGVAR(hardcode_automatic, $1) - -# Variables whose values should be saved in libtool wrapper scripts and -# restored at relink time. -variables_saved_for_relink="$variables_saved_for_relink" - -# Whether libtool must link a program against all its dependency libraries. -link_all_deplibs=$_LT_AC_TAGVAR(link_all_deplibs, $1) - -# Compile-time system search path for libraries -sys_lib_search_path_spec=$lt_sys_lib_search_path_spec - -# Run-time system search path for libraries -sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec - -# Fix the shell variable \$srcfile for the compiler. -fix_srcfile_path="$_LT_AC_TAGVAR(fix_srcfile_path, $1)" - -# Set to yes if exported symbols are required. -always_export_symbols=$_LT_AC_TAGVAR(always_export_symbols, $1) - -# The commands to list exported symbols. -export_symbols_cmds=$lt_[]_LT_AC_TAGVAR(export_symbols_cmds, $1) - -# The commands to extract the exported symbol list from a shared archive. -extract_expsyms_cmds=$lt_extract_expsyms_cmds - -# Symbols that should not be listed in the preloaded symbols. -exclude_expsyms=$lt_[]_LT_AC_TAGVAR(exclude_expsyms, $1) - -# Symbols that must always be exported. -include_expsyms=$lt_[]_LT_AC_TAGVAR(include_expsyms, $1) - -ifelse([$1],[], -[# ### END LIBTOOL CONFIG], -[# ### END LIBTOOL TAG CONFIG: $tagname]) - -__EOF__ - -ifelse([$1],[], [ - case $host_os in - aix3*) - cat <<\EOF >> "$cfgfile" - -# AIX sometimes has problems with the GCC collect2 program. For some -# reason, if we set the COLLECT_NAMES environment variable, the problems -# vanish in a puff of smoke. -if test "X${COLLECT_NAMES+set}" != Xset; then - COLLECT_NAMES= - export COLLECT_NAMES -fi -EOF - ;; - esac - - # We use sed instead of cat because bash on DJGPP gets confused if - # if finds mixed CR/LF and LF-only lines. Since sed operates in - # text mode, it properly converts lines to CR/LF. This bash problem - # is reportedly fixed, but why not run on old versions too? - sed '$q' "$ltmain" >> "$cfgfile" || (rm -f "$cfgfile"; exit 1) - - mv -f "$cfgfile" "$ofile" || \ - (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") - chmod +x "$ofile" -]) -else - # If there is no Makefile yet, we rely on a make rule to execute - # `config.status --recheck' to rerun these tests and create the - # libtool script then. - test -f Makefile && make "$ltmain" -fi -])# AC_LIBTOOL_CONFIG - - -# AC_LIBTOOL_PROG_COMPILER_NO_RTTI([TAGNAME]) -# ------------------------------------------- -AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], -[AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl - -_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= - -if test "$GCC" = yes; then - _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' - - AC_LIBTOOL_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], - lt_cv_prog_compiler_rtti_exceptions, - [-fno-rtti -fno-exceptions], [], - [_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) -fi -])# AC_LIBTOOL_PROG_COMPILER_NO_RTTI - - -# AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE -# --------------------------------- -AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], -[AC_REQUIRE([AC_CANONICAL_HOST]) -AC_REQUIRE([AC_PROG_NM]) -AC_REQUIRE([AC_OBJEXT]) -# Check for command to grab the raw symbol name followed by C symbol from nm. -AC_MSG_CHECKING([command to parse $NM output from $compiler object]) -AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], -[ -# These are sane defaults that work on at least a few old systems. -# [They come from Ultrix. What could be older than Ultrix?!! ;)] - -# Character class describing NM global symbol codes. -symcode='[[BCDEGRST]]' - -# Regexp to match symbols that can be accessed directly from C. -sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)' - -# Transform the above into a raw symbol and a C symbol. -symxfrm='\1 \2\3 \3' - -# Transform an extracted symbol line into a proper C declaration -lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \1;/p'" - -# Transform an extracted symbol line into symbol name and symbol address -lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" - -# Define system-specific variables. -case $host_os in -aix*) - symcode='[[BCDT]]' - ;; -cygwin* | mingw* | pw32*) - symcode='[[ABCDGISTW]]' - ;; -hpux*) # Its linker distinguishes data from code symbols - if test "$host_cpu" = ia64; then - symcode='[[ABCDEGRST]]' - fi - lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" - lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" - ;; -irix* | nonstopux*) - symcode='[[BCDEGRST]]' - ;; -osf*) - symcode='[[BCDEGQRST]]' - ;; -solaris* | sysv5*) - symcode='[[BDT]]' - ;; -sysv4) - symcode='[[DFNSTU]]' - ;; -esac - -# Handle CRLF in mingw tool chain -opt_cr= -case $build_os in -mingw*) - opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp - ;; -esac - -# If we're using GNU nm, then use its standard symbol codes. -case `$NM -V 2>&1` in -*GNU* | *'with BFD'*) - symcode='[[ABCDGISTW]]' ;; -esac - -# Try without a prefix undercore, then with it. -for ac_symprfx in "" "_"; do - - # Write the raw and C identifiers. - lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*\($ac_symprfx\)$sympat$opt_cr$/$symxfrm/p'" - - # Check to see that the pipe works correctly. - pipe_works=no - - rm -f conftest* - cat > conftest.$ac_ext < $nlist) && test -s "$nlist"; then - # Try sorting and uniquifying the output. - if sort "$nlist" | uniq > "$nlist"T; then - mv -f "$nlist"T "$nlist" - else - rm -f "$nlist"T - fi - - # Make sure that we snagged all the symbols we need. - if grep ' nm_test_var$' "$nlist" >/dev/null; then - if grep ' nm_test_func$' "$nlist" >/dev/null; then - cat < conftest.$ac_ext -#ifdef __cplusplus -extern "C" { -#endif - -EOF - # Now generate the symbol file. - eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext' - - cat <> conftest.$ac_ext -#if defined (__STDC__) && __STDC__ -# define lt_ptr_t void * -#else -# define lt_ptr_t char * -# define const -#endif - -/* The mapping between symbol names and symbols. */ -const struct { - const char *name; - lt_ptr_t address; -} -lt_preloaded_symbols[[]] = -{ -EOF - $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext - cat <<\EOF >> conftest.$ac_ext - {0, (lt_ptr_t) 0} -}; - -#ifdef __cplusplus -} -#endif -EOF - # Now try linking the two files. - mv conftest.$ac_objext conftstm.$ac_objext - lt_save_LIBS="$LIBS" - lt_save_CFLAGS="$CFLAGS" - LIBS="conftstm.$ac_objext" - CFLAGS="$CFLAGS$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" - if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then - pipe_works=yes - fi - LIBS="$lt_save_LIBS" - CFLAGS="$lt_save_CFLAGS" - else - echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD - fi - else - echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD - fi - else - echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD - fi - else - echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD - cat conftest.$ac_ext >&5 - fi - rm -f conftest* conftst* - - # Do not use the global_symbol_pipe unless it works. - if test "$pipe_works" = yes; then - break - else - lt_cv_sys_global_symbol_pipe= - fi -done -]) -if test -z "$lt_cv_sys_global_symbol_pipe"; then - lt_cv_sys_global_symbol_to_cdecl= -fi -if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then - AC_MSG_RESULT(failed) -else - AC_MSG_RESULT(ok) -fi -]) # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE - - -# AC_LIBTOOL_PROG_COMPILER_PIC([TAGNAME]) -# --------------------------------------- -AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC], -[_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)= -_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= -_LT_AC_TAGVAR(lt_prog_compiler_static, $1)= - -AC_MSG_CHECKING([for $compiler option to produce PIC]) - ifelse([$1],[CXX],[ - # C++ specific cases for pic, static, wl, etc. - if test "$GXX" = yes; then - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' - - case $host_os in - aix*) - # All AIX code is PIC. - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - fi - ;; - amigaos*) - # FIXME: we need at least 68020 code to build shared libraries, but - # adding the `-m68020' flag to GCC prevents building anything better, - # like `-m68040'. - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' - ;; - beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) - # PIC is the default for these OSes. - ;; - mingw* | os2* | pw32*) - # This hack is so that the source file can tell whether it is being - # built for inclusion in a dll (and should export symbols for example). - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' - ;; - darwin* | rhapsody*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' - ;; - *djgpp*) - # DJGPP does not support shared libraries at all - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= - ;; - sysv4*MP*) - if test -d /usr/nec; then - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic - fi - ;; - hpux*) - # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but - # not for PA HP-UX. - case "$host_cpu" in - hppa*64*|ia64*) - ;; - *) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - ;; - esac - ;; - *) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - ;; - esac - else - case $host_os in - aix4* | aix5*) - # All AIX code is PIC. - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - else - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' - fi - ;; - chorus*) - case $cc_basename in - cxch68) - # Green Hills C++ Compiler - # _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" - ;; - esac - ;; - dgux*) - case $cc_basename in - ec++) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - ;; - ghcx) - # Green Hills C++ Compiler - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' - ;; - *) - ;; - esac - ;; - freebsd*) - # FreeBSD uses GNU C++ - ;; - hpux9* | hpux10* | hpux11*) - case $cc_basename in - CC) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive" - if test "$host_cpu" != ia64; then - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' - fi - ;; - aCC) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive" - case "$host_cpu" in - hppa*64*|ia64*) - # +Z the default - ;; - *) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' - ;; - esac - ;; - *) - ;; - esac - ;; - irix5* | irix6* | nonstopux*) - case $cc_basename in - CC) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - # CC pic flag -KPIC is the default. - ;; - *) - ;; - esac - ;; - linux*) - case $cc_basename in - KCC) - # KAI C++ Compiler - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - ;; - icpc) - # Intel C++ - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' - ;; - cxx) - # Compaq C++ - # Make sure the PIC flag is empty. It appears that all Alpha - # Linux and Compaq Tru64 Unix objects are PIC. - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - ;; - *) - ;; - esac - ;; - lynxos*) - ;; - m88k*) - ;; - mvs*) - case $cc_basename in - cxx) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' - ;; - *) - ;; - esac - ;; - netbsd*) - ;; - osf3* | osf4* | osf5*) - case $cc_basename in - KCC) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' - ;; - RCC) - # Rational C++ 2.4.1 - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' - ;; - cxx) - # Digital/Compaq C++ - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - # Make sure the PIC flag is empty. It appears that all Alpha - # Linux and Compaq Tru64 Unix objects are PIC. - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - ;; - *) - ;; - esac - ;; - psos*) - ;; - sco*) - case $cc_basename in - CC) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - ;; - *) - ;; - esac - ;; - solaris*) - case $cc_basename in - CC) - # Sun C++ 4.2, 5.x and Centerline C++ - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' - ;; - gcx) - # Green Hills C++ Compiler - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' - ;; - *) - ;; - esac - ;; - sunos4*) - case $cc_basename in - CC) - # Sun C++ 4.x - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - lcc) - # Lucid - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' - ;; - *) - ;; - esac - ;; - tandem*) - case $cc_basename in - NCC) - # NonStop-UX NCC 3.20 - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - ;; - *) - ;; - esac - ;; - unixware*) - ;; - vxworks*) - ;; - *) - _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no - ;; - esac - fi -], -[ - if test "$GCC" = yes; then - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' - - case $host_os in - aix*) - # All AIX code is PIC. - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - fi - ;; - - amigaos*) - # FIXME: we need at least 68020 code to build shared libraries, but - # adding the `-m68020' flag to GCC prevents building anything better, - # like `-m68040'. - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' - ;; - - beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) - # PIC is the default for these OSes. - ;; - - mingw* | pw32* | os2*) - # This hack is so that the source file can tell whether it is being - # built for inclusion in a dll (and should export symbols for example). - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' - ;; - - darwin* | rhapsody*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' - ;; - - msdosdjgpp*) - # Just because we use GCC doesn't mean we suddenly get shared libraries - # on systems that don't support them. - _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no - enable_shared=no - ;; - - sysv4*MP*) - if test -d /usr/nec; then - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic - fi - ;; - - hpux*) - # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but - # not for PA HP-UX. - case "$host_cpu" in - hppa*64*|ia64*) - # +Z the default - ;; - *) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - ;; - esac - ;; - - *) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - ;; - esac - else - # PORTME Check for flag to pass linker flags through the system compiler. - case $host_os in - aix*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - else - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' - fi - ;; - - mingw* | pw32* | os2*) - # This hack is so that the source file can tell whether it is being - # built for inclusion in a dll (and should export symbols for example). - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' - ;; - - hpux9* | hpux10* | hpux11*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but - # not for PA HP-UX. - case "$host_cpu" in - hppa*64*|ia64*) - # +Z the default - ;; - *) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' - ;; - esac - # Is there a better lt_prog_compiler_static that works with the bundled CC? - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' - ;; - - irix5* | irix6* | nonstopux*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - # PIC (with -KPIC) is the default. - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - ;; - - newsos6) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - - linux*) - case $CC in - icc|ecc) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' - ;; - ccc) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - # All Alpha code is PIC. - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - ;; - esac - ;; - - osf3* | osf4* | osf5*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - # All OSF/1 code is PIC. - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - ;; - - sco3.2v5*) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kpic' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-dn' - ;; - - solaris*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - - sunos4*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - - sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - - sysv4*MP*) - if test -d /usr/nec ;then - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - fi - ;; - - uts4*) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - - *) - _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no - ;; - esac - fi -]) -AC_MSG_RESULT([$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)]) - -# -# Check to make sure the PIC flag actually works. -# -if test -n "$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)"; then - AC_LIBTOOL_COMPILER_OPTION([if $compiler PIC flag $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) works], - _LT_AC_TAGVAR(lt_prog_compiler_pic_works, $1), - [$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])], [], - [case $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) in - "" | " "*) ;; - *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)" ;; - esac], - [_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= - _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) -fi -case "$host_os" in - # For platforms which do not support PIC, -DPIC is meaningless: - *djgpp*) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= - ;; - *) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])" - ;; -esac -]) - - -# AC_LIBTOOL_PROG_LD_SHLIBS([TAGNAME]) -# ------------------------------------ -# See if the linker supports building shared libraries. -AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS], -[AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) -ifelse([$1],[CXX],[ - _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - case $host_os in - aix4* | aix5*) - # If we're using GNU nm, then we don't want the "-C" option. - # -C means demangle to AIX nm, but means don't demangle with GNU nm - if $NM -V 2>&1 | grep 'GNU' > /dev/null; then - _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' - else - _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' - fi - ;; - pw32*) - _LT_AC_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds" - ;; - cygwin* | mingw*) - _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGS]] /s/.* \([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols' - ;; - *) - _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - ;; - esac -],[ - runpath_var= - _LT_AC_TAGVAR(allow_undefined_flag, $1)= - _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no - _LT_AC_TAGVAR(archive_cmds, $1)= - _LT_AC_TAGVAR(archive_expsym_cmds, $1)= - _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)= - _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)= - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= - _LT_AC_TAGVAR(thread_safe_flag_spec, $1)= - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= - _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= - _LT_AC_TAGVAR(hardcode_direct, $1)=no - _LT_AC_TAGVAR(hardcode_minus_L, $1)=no - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported - _LT_AC_TAGVAR(link_all_deplibs, $1)=unknown - _LT_AC_TAGVAR(hardcode_automatic, $1)=no - _LT_AC_TAGVAR(module_cmds, $1)= - _LT_AC_TAGVAR(module_expsym_cmds, $1)= - _LT_AC_TAGVAR(always_export_symbols, $1)=no - _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - # include_expsyms should be a list of space-separated symbols to be *always* - # included in the symbol list - _LT_AC_TAGVAR(include_expsyms, $1)= - # exclude_expsyms can be an extended regexp of symbols to exclude - # it will be wrapped by ` (' and `)$', so one must not match beginning or - # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', - # as well as any symbol that contains `d'. - _LT_AC_TAGVAR(exclude_expsyms, $1)="_GLOBAL_OFFSET_TABLE_" - # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out - # platforms (ab)use it in PIC code, but their linkers get confused if - # the symbol is explicitly referenced. Since portable code cannot - # rely on this symbol name, it's probably fine to never include it in - # preloaded symbol tables. - extract_expsyms_cmds= - - case $host_os in - cygwin* | mingw* | pw32*) - # FIXME: the MSVC++ port hasn't been tested in a loooong time - # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. - if test "$GCC" != yes; then - with_gnu_ld=no - fi - ;; - openbsd*) - with_gnu_ld=no - ;; - esac - - _LT_AC_TAGVAR(ld_shlibs, $1)=yes - if test "$with_gnu_ld" = yes; then - # If archive_cmds runs LD, not CC, wlarc should be empty - wlarc='${wl}' - - # See if GNU ld supports shared libraries. - case $host_os in - aix3* | aix4* | aix5*) - # On AIX/PPC, the GNU linker is very broken - if test "$host_cpu" != ia64; then - _LT_AC_TAGVAR(ld_shlibs, $1)=no - cat <&2 - -*** Warning: the GNU linker, at least up to release 2.9.1, is reported -*** to be unable to reliably create shared libraries on AIX. -*** Therefore, libtool is disabling shared libraries support. If you -*** really care for shared libraries, you may want to modify your PATH -*** so that a non-GNU linker is found, and then restart. - -EOF - fi - ;; - - amigaos*) - _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/a2ixlibrary.data${_S_}$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data${_S_}$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data${_S_}$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data${_S_}$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data${_S_}$AR $AR_FLAGS $lib $libobjs${_S_}$RANLIB $lib${_S_}(cd $output_objdir && a2ixlibrary -32)' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes - - # Samuel A. Falvo II reports - # that the semantics of dynamic libraries on AmigaOS, at least up - # to version 4, is to share data among multiple programs linked - # with the same dynamic library. Since this doesn't match the - # behavior of shared libraries on other platforms, we can't use - # them. - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - - beos*) - if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported - # Joseph Beckenbach says some releases of gcc - # support --undefined. This deserves some investigation. FIXME - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - else - _LT_AC_TAGVAR(ld_shlibs, $1)=no - fi - ;; - - cygwin* | mingw* | pw32*) - # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, - # as there is no search path for DLLs. - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported - _LT_AC_TAGVAR(always_export_symbols, $1)=no - _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes - _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGS]] /s/.* \([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols' - - if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' - # If the export-symbols file already is a .def file (1st line - # is EXPORTS), use it as is; otherwise, prepend... - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then - cp $export_symbols $output_objdir/$soname.def; - else - echo EXPORTS > $output_objdir/$soname.def; - cat $export_symbols >> $output_objdir/$soname.def; - fi${_S_} - $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' - else - ld_shlibs=no - fi - ;; - - netbsd*) - if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' - wlarc= - else - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - fi - ;; - - solaris* | sysv5*) - if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then - _LT_AC_TAGVAR(ld_shlibs, $1)=no - cat <&2 - -*** Warning: The releases 2.8.* of the GNU linker cannot reliably -*** create shared libraries on Solaris systems. Therefore, libtool -*** is disabling shared libraries support. We urge you to upgrade GNU -*** binutils to release 2.9.1 or newer. Another option is to modify -*** your PATH or compiler configuration so that the native linker is -*** used, and then restart. - -EOF - elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - else - _LT_AC_TAGVAR(ld_shlibs, $1)=no - fi - ;; - - sunos4*) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' - wlarc= - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - *) - if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - else - _LT_AC_TAGVAR(ld_shlibs, $1)=no - fi - ;; - esac - - if test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = yes; then - runpath_var=LD_RUN_PATH - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' - # ancient GNU ld didn't support --whole-archive et. al. - if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' - else - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= - fi - fi - else - # PORTME fill in a description of your system's linker (not GNU ld) - case $host_os in - aix3*) - _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported - _LT_AC_TAGVAR(always_export_symbols, $1)=yes - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE${_S_}$AR $AR_FLAGS $lib $output_objdir/$soname' - # Note: this linker hardcodes the directories in LIBPATH if there - # are no directories specified by -L. - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes - if test "$GCC" = yes && test -z "$link_static_flag"; then - # Neither direct hardcoding nor static linking is supported with a - # broken collect2. - _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported - fi - ;; - - aix4* | aix5*) - if test "$host_cpu" = ia64; then - # On IA64, the linker does run time linking by default, so we don't - # have to do anything special. - aix_use_runtimelinking=no - exp_sym_flag='-Bexport' - no_entry_flag="" - else - # If we're using GNU nm, then we don't want the "-C" option. - # -C means demangle to AIX nm, but means don't demangle with GNU nm - if $NM -V 2>&1 | grep 'GNU' > /dev/null; then - _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' - else - _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' - fi - aix_use_runtimelinking=no - - # Test if we are trying to use run time linking or normal - # AIX style linking. If -brtl is somewhere in LDFLAGS, we - # need to do runtime linking. - case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*) - for ld_flag in $LDFLAGS; do - if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then - aix_use_runtimelinking=yes - break - fi - done - esac - - exp_sym_flag='-bexport' - no_entry_flag='-bnoentry' - fi - - # When large executables or shared objects are built, AIX ld can - # have problems creating the table of contents. If linking a library - # or program results in "error TOC overflow" add -mminimal-toc to - # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not - # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. - - _LT_AC_TAGVAR(archive_cmds, $1)='' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' - _LT_AC_TAGVAR(link_all_deplibs, $1)=yes - - if test "$GCC" = yes; then - case $host_os in aix4.[012]|aix4.[012].*) - # We only want to do this on AIX 4.2 and lower, the check - # below for broken collect2 doesn't work under 4.3+ - collect2name=`${CC} -print-prog-name=collect2` - if test -f "$collect2name" && \ - strings "$collect2name" | grep resolve_lib_name >/dev/null - then - # We have reworked collect2 - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - else - # We have old collect2 - _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported - # It fails to find uninstalled libraries when the uninstalled - # path is not listed in the libpath. Setting hardcode_minus_L - # to unsupported forces relinking - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= - fi - esac - shared_flag='-shared' - else - # not using gcc - if test "$host_cpu" = ia64; then - # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release - # chokes on -Wl,-G. The following line is correct: - shared_flag='-G' - else - if test "$aix_use_runtimelinking" = yes; then - shared_flag='${wl}-G' - else - shared_flag='${wl}-bM:SRE' - fi - fi - fi - - # It seems that -bexpall does not export symbols beginning with - # underscore (_), so it is better to generate a list of symbols to export. - _LT_AC_TAGVAR(always_export_symbols, $1)=yes - if test "$aix_use_runtimelinking" = yes; then - # Warning - without using the other runtime loading flags (-brtl), - # -berok will link without error, but may produce a broken library. - _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok' - # Determine the default libpath from the value encoded in an empty executable. - _LT_AC_SYS_LIBPATH_AIX - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" - _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag" - else - if test "$host_cpu" = ia64; then - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' - _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs" - _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols" - else - # Determine the default libpath from the value encoded in an empty executable. - _LT_AC_SYS_LIBPATH_AIX - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" - # Warning - without using the other run time loading flags, - # -berok will link without error, but may produce a broken library. - _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' - _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' - # -bexpall does not export symbols beginning with underscore (_) - _LT_AC_TAGVAR(always_export_symbols, $1)=yes - # Exported symbols can be pulled into shared objects from archives - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=' ' - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes - # This is similar to how AIX traditionally builds it's shared libraries. - _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}\${_S_}$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' - fi - fi - ;; - - amigaos*) - _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/a2ixlibrary.data${_S_}$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data${_S_}$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data${_S_}$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data${_S_}$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data${_S_}$AR $AR_FLAGS $lib $libobjs${_S_}$RANLIB $lib${_S_}(cd $output_objdir && a2ixlibrary -32)' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes - # see comment about different semantics on the GNU ld section - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - - bsdi4*) - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic - ;; - - cygwin* | mingw* | pw32*) - # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. - # hardcode_libdir_flag_spec is actually meaningless, as there is - # no search path for DLLs. - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' - _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported - # Tell ltmain to make .lib files, not .a files. - libext=lib - # Tell ltmain to make .dll files, not .so files. - shrext=".dll" - # FIXME: Setting linknames here is a bad hack. - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll${_S_}linknames=' - # The linker will automatically build a .lib file if we build a DLL. - _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='true' - # FIXME: Should let the user specify the lib program. - _LT_AC_TAGVAR(old_archive_cmds, $1)='lib /OUT:$oldlib$oldobjs$old_deplibs' - fix_srcfile_path='`cygpath -w "$srcfile"`' - _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes - ;; - - darwin* | rhapsody*) - if $CC -v 2>&1 | grep 'Apple' >/dev/null ; then - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no - case "$host_os" in - rhapsody* | darwin1.[[012]]) - _LT_AC_TAGVAR(allow_undefined_flag, $1)='-undefined suppress' - ;; - darwin1.* | darwin[[2-6]].*) # Darwin 1.3 on, but less than 7.0 - test -z ${LD_TWOLEVEL_NAMESPACE} && _LT_AC_TAGVAR(allow_undefined_flag, $1)='-flat_namespace -undefined suppress' - ;; - *) # Darwin 7.0 on - case "${MACOSX_DEPLOYMENT_TARGET-10.1}" in - 10.[[012]]) - test -z ${LD_TWOLEVEL_NAMESPACE} && _LT_AC_TAGVAR(allow_undefined_flag, $1)='-flat_namespace -undefined suppress' - ;; - *) # 10.3 on - if test -z ${LD_TWOLEVEL_NAMESPACE}; then - _LT_AC_TAGVAR(allow_undefined_flag, $1)='-flat_namespace -undefined suppress' - else - _LT_AC_TAGVAR(allow_undefined_flag, $1)='-undefined dynamic_lookup' - fi - ;; - esac - ;; - esac - # FIXME: Relying on posixy $() will cause problems for - # cross-compilation, but unfortunately the echo tests do not - # yet detect zsh echo's removal of \ escapes. Also zsh mangles - # `"' quotes if we put them in here... so don't! - lt_int_apple_cc_single_mod=no - output_verbose_link_cmd='echo' - if $CC -dumpspecs 2>&1 | grep 'single_module' >/dev/null ; then - lt_int_apple_cc_single_mod=yes - fi - if test "X$lt_int_apple_cc_single_mod" = Xyes ; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib $archargs -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' - else - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs${_S_}$CC -dynamiclib $archargs $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring' - fi - _LT_AC_TAGVAR(module_cmds, $1)='$CC -bundle $archargs ${wl}-bind_at_load $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags' - # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's - if test "X$lt_int_apple_cc_single_mod" = Xyes ; then - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym${_S_}$CC -dynamiclib $archargs -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring${_S_}nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - else - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym${_S_}$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs${_S_}$CC -dynamiclib $archargs $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring${_S_}nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - fi - _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym${_S_}$CC -bundle $archargs $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags${_S_}nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - _LT_AC_TAGVAR(hardcode_direct, $1)=no - _LT_AC_TAGVAR(hardcode_automatic, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-all_load $convenience' - _LT_AC_TAGVAR(link_all_deplibs, $1)=yes - fi - ;; - - dgux*) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - freebsd1*) - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - - # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor - # support. Future versions do this automatically, but an explicit c++rt0.o - # does not break anything, and helps significantly (at the cost of a little - # extra space). - freebsd2.2*) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - # Unfortunately, older versions of FreeBSD 2 do not have this feature. - freebsd2*) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - # FreeBSD 3 and greater uses gcc -shared to do shared libraries. - freebsd*) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - hpux9*) - if test "$GCC" = yes; then - _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname${_S_}$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags${_S_}test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - else - _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname${_S_}$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags${_S_}test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - fi - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' - ;; - - hpux10* | hpux11*) - if test "$GCC" = yes -a "$with_gnu_ld" = no; then - case "$host_cpu" in - hppa*64*|ia64*) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - *) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' - ;; - esac - else - case "$host_cpu" in - hppa*64*|ia64*) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags' - ;; - *) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' - ;; - esac - fi - if test "$with_gnu_ld" = no; then - case "$host_cpu" in - hppa*64*) - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - _LT_AC_TAGVAR(hardcode_direct, $1)=no - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - ia64*) - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_AC_TAGVAR(hardcode_direct, $1)=no - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes - ;; - *) - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' - - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes - ;; - esac - fi - ;; - - irix5* | irix6* | nonstopux*) - if test "$GCC" = yes; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - else - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir' - fi - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - _LT_AC_TAGVAR(link_all_deplibs, $1)=yes - ;; - - netbsd*) - if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out - else - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF - fi - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - newsos6) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - openbsd*) - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' - else - case $host_os in - openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - ;; - *) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - ;; - esac - fi - ;; - - os2*) - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes - _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported - _LT_AC_TAGVAR(archive_cmds, $1)='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def${_S_}$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def${_S_}$echo DATA >> $output_objdir/$libname.def${_S_}$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def${_S_}$echo EXPORTS >> $output_objdir/$libname.def${_S_}emxexp $libobjs >> $output_objdir/$libname.def${_S_}$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' - _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' - ;; - - osf3*) - if test "$GCC" = yes; then - _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - else - _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - fi - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - ;; - - osf4* | osf5*) # as osf3* with the addition of -msym flag - if test "$GCC" = yes; then - _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - else - _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp${_S_} - $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib${_S_}$rm $lib.exp' - - # Both c and cxx compiler support -rpath directly - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' - fi - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - ;; - - sco3.2v5*) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' - runpath_var=LD_RUN_PATH - hardcode_runpath_var=yes - ;; - - solaris*) - _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text' - if test "$GCC" = yes; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp${_S_}cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp${_S_}$echo "local: *; };" >> $lib.exp${_S_} - $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags${_S_}$rm $lib.exp' - else - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp${_S_}cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp${_S_}$echo "local: *; };" >> $lib.exp${_S_} - $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags${_S_}$rm $lib.exp' - fi - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - case $host_os in - solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; - *) # Supported since Solaris 2.6 (maybe 2.5.1?) - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;; - esac - _LT_AC_TAGVAR(link_all_deplibs, $1)=yes - ;; - - sunos4*) - if test "x$host_vendor" = xsequent; then - # Use $CC to link under sequent, because it throws in some extra .o - # files that make .init and .fini sections work. - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' - else - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' - fi - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - sysv4) - case $host_vendor in - sni) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes # is this really true??? - ;; - siemens) - ## LD is ld it makes a PLAMLIB - ## CC just makes a GrossModule. - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' - _LT_AC_TAGVAR(hardcode_direct, $1)=no - ;; - motorola) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie - ;; - esac - runpath_var='LD_RUN_PATH' - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - sysv4.3*) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' - ;; - - sysv4*MP*) - if test -d /usr/nec; then - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - runpath_var=LD_RUN_PATH - hardcode_runpath_var=yes - _LT_AC_TAGVAR(ld_shlibs, $1)=yes - fi - ;; - - sysv4.2uw2*) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_minus_L, $1)=no - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - hardcode_runpath_var=yes - runpath_var=LD_RUN_PATH - ;; - - sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[[78]]* | unixware7*) - _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z ${wl}text' - if test "$GCC" = yes; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - else - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - fi - runpath_var='LD_RUN_PATH' - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - sysv5*) - _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text' - # $CC -shared without GNU ld will not create a library from C++ - # object files and a static libstdc++, better avoid it by now - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp${_S_}cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp${_S_}$echo "local: *; };" >> $lib.exp${_S_} - $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags${_S_}$rm $lib.exp' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - runpath_var='LD_RUN_PATH' - ;; - - uts4*) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - *) - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - esac - fi -]) -AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)]) -test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no - -variables_saved_for_relink="PATH $shlibpath_var $runpath_var" -if test "$GCC" = yes; then - variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" -fi - -# -# Do we need to explicitly link libc? -# -case "x$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)" in -x|xyes) - # Assume -lc should be added - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes - - if test "$enable_shared" = yes && test "$GCC" = yes; then - case $_LT_AC_TAGVAR(archive_cmds, $1) in - *"$_S_"*) - # FIXME: we may have to deal with multi-command sequences. - ;; - '$CC '*) - # Test whether the compiler implicitly links with -lc since on some - # systems, -lgcc has to come before -lc. If gcc already passes -lc - # to ld, don't add -lc before -lgcc. - AC_MSG_CHECKING([whether -lc should be explicitly linked in]) - $rm conftest* - printf "$lt_simple_compile_test_code" > conftest.$ac_ext - - if AC_TRY_EVAL(ac_compile) 2>conftest.err; then - soname=conftest - lib=conftest - libobjs=conftest.$ac_objext - deplibs= - wl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) - compiler_flags=-v - linker_flags=-v - verstring= - output_objdir=. - libname=conftest - lt_save_allow_undefined_flag=$_LT_AC_TAGVAR(allow_undefined_flag, $1) - _LT_AC_TAGVAR(allow_undefined_flag, $1)= - if AC_TRY_EVAL(_LT_AC_TAGVAR(archive_cmds, $1) 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) - then - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no - else - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes - fi - _LT_AC_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag - else - cat conftest.err 1>&5 - fi - $rm conftest* - AC_MSG_RESULT([$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)]) - ;; - esac - fi - ;; -esac -])# AC_LIBTOOL_PROG_LD_SHLIBS - - -# _LT_AC_FILE_LTDLL_C -# ------------------- -# Be careful that the start marker always follows a newline. -AC_DEFUN([_LT_AC_FILE_LTDLL_C], [ -# /* ltdll.c starts here */ -# #define WIN32_LEAN_AND_MEAN -# #include -# #undef WIN32_LEAN_AND_MEAN -# #include -# -# #ifndef __CYGWIN__ -# # ifdef __CYGWIN32__ -# # define __CYGWIN__ __CYGWIN32__ -# # endif -# #endif -# -# #ifdef __cplusplus -# extern "C" { -# #endif -# BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved); -# #ifdef __cplusplus -# } -# #endif -# -# #ifdef __CYGWIN__ -# #include -# DECLARE_CYGWIN_DLL( DllMain ); -# #endif -# HINSTANCE __hDllInstance_base; -# -# BOOL APIENTRY -# DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved) -# { -# __hDllInstance_base = hInst; -# return TRUE; -# } -# /* ltdll.c ends here */ -])# _LT_AC_FILE_LTDLL_C - - -# _LT_AC_TAGVAR(VARNAME, [TAGNAME]) -# --------------------------------- -AC_DEFUN([_LT_AC_TAGVAR], [ifelse([$2], [], [$1], [$1_$2])]) - - -# old names -AC_DEFUN([AM_PROG_LIBTOOL], [AC_PROG_LIBTOOL]) -AC_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) -AC_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) -AC_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) -AC_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) -AC_DEFUN([AM_PROG_LD], [AC_PROG_LD]) -AC_DEFUN([AM_PROG_NM], [AC_PROG_NM]) - -# This is just to silence aclocal about the macro not being used -ifelse([AC_DISABLE_FAST_INSTALL]) - -AC_DEFUN([LT_AC_PROG_GCJ], -[AC_CHECK_TOOL(GCJ, gcj, no) - test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2" - AC_SUBST(GCJFLAGS) -]) - -AC_DEFUN([LT_AC_PROG_RC], -[AC_CHECK_TOOL(RC, windres, no) -]) - -# NOTE: This macro has been submitted for inclusion into # -# GNU Autoconf as AC_PROG_SED. When it is available in # -# a released version of Autoconf we should remove this # -# macro and use it instead. # -# LT_AC_PROG_SED -# -------------- -# Check for a fully-functional sed program, that truncates -# as few characters as possible. Prefer GNU sed if found. -AC_DEFUN([LT_AC_PROG_SED], -[AC_MSG_CHECKING([for a sed that does not truncate output]) -AC_CACHE_VAL(lt_cv_path_SED, -[# Loop through the user's path and test for sed and gsed. -# Then use that list of sed's as ones to test for truncation. -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for lt_ac_prog in sed gsed; do - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then - lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" - fi - done - done -done -lt_ac_max=0 -lt_ac_count=0 -# Add /usr/xpg4/bin/sed as it is typically found on Solaris -# along with /bin/sed that truncates output. -for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do - test ! -f $lt_ac_sed && break - cat /dev/null > conftest.in - lt_ac_count=0 - echo $ECHO_N "0123456789$ECHO_C" >conftest.in - # Check for GNU sed and select it if it is found. - if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then - lt_cv_path_SED=$lt_ac_sed - break - fi - while true; do - cat conftest.in conftest.in >conftest.tmp - mv conftest.tmp conftest.in - cp conftest.in conftest.nl - echo >>conftest.nl - $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break - cmp -s conftest.out conftest.nl || break - # 10000 chars as input seems more than enough - test $lt_ac_count -gt 10 && break - lt_ac_count=`expr $lt_ac_count + 1` - if test $lt_ac_count -gt $lt_ac_max; then - lt_ac_max=$lt_ac_count - lt_cv_path_SED=$lt_ac_sed - fi - done -done -SED=$lt_cv_path_SED -]) -AC_MSG_RESULT([$SED]) -]) - -dnl --------------------------------------------------------------------------- -dnl Compiler detection macros by David Elliott -dnl --------------------------------------------------------------------------- - - -dnl =========================================================================== -dnl Macros to detect non-GNU compilers (MetroWerks, XLC) -dnl =========================================================================== - -dnl Based on autoconf _AC_LANG_COMPILER_GNU -AC_DEFUN([_AC_BAKEFILE_LANG_COMPILER_MWERKS], -[AC_CACHE_CHECK([whether we are using the Metrowerks _AC_LANG compiler], - [bakefile_cv_[]_AC_LANG_ABBREV[]_compiler_mwerks], - [AC_TRY_COMPILE([],[#ifndef __MWERKS__ - choke me -#endif -], - [bakefile_compiler_mwerks=yes], - [bakefile_compiler_mwerks=no]) - bakefile_cv_[]_AC_LANG_ABBREV[]_compiler_mwerks=$bakefile_compiler_mwerks - ]) -]) - -dnl Loosely based on autoconf AC_PROG_CC -dnl TODO: Maybe this should wrap the call to AC_PROG_CC and be used instead. -AC_DEFUN([AC_BAKEFILE_PROG_MWCC], -[AC_LANG_PUSH(C) -_AC_BAKEFILE_LANG_COMPILER_MWERKS -MWCC=`test $bakefile_cv_c_compiler_mwerks = yes && echo yes` -AC_LANG_POP(C) -]) - -dnl Loosely based on autoconf AC_PROG_CXX -dnl TODO: Maybe this should wrap the call to AC_PROG_CXX and be used instead. -AC_DEFUN([AC_BAKEFILE_PROG_MWCXX], -[AC_LANG_PUSH(C++) -_AC_BAKEFILE_LANG_COMPILER_MWERKS -MWCXX=`test $bakefile_cv_cxx_compiler_mwerks = yes && echo yes` -AC_LANG_POP(C++) -]) - -dnl Based on autoconf _AC_LANG_COMPILER_GNU -AC_DEFUN([_AC_BAKEFILE_LANG_COMPILER_XLC], -[AC_CACHE_CHECK([whether we are using the IBM xlC _AC_LANG compiler], - [wx_cv_[]_AC_LANG_ABBREV[]_compiler_xlc], - [AC_TRY_COMPILE([],[#ifndef __xlC__ - choke me -#endif -], - [wx_compiler_xlc=yes], - [wx_compiler_xlc=no]) - wx_cv_[]_AC_LANG_ABBREV[]_compiler_xlc=$wx_compiler_xlc - ]) -]) - -dnl Loosely based on autoconf AC_PROG_CC -AC_DEFUN([AC_BAKEFILE_PROG_XLCC], -[AC_LANG_PUSH(C) -_AC_BAKEFILE_LANG_COMPILER_XLC -XLCC=`test $wx_cv_c_compiler_xlc = yes && echo yes` -AC_LANG_POP(C) -]) - -dnl Loosely based on autoconf AC_PROG_CXX -AC_DEFUN([AC_BAKEFILE_PROG_XLCXX], -[AC_LANG_PUSH(C++) -_AC_BAKEFILE_LANG_COMPILER_XLC -XLCXX=`test $wx_cv_cxx_compiler_xlc = yes && echo yes` -AC_LANG_POP(C++) -]) - - -dnl =========================================================================== -dnl macros to detect specialty compiler options -dnl =========================================================================== - -dnl Figure out if we need to pass -ext o to compiler (MetroWerks) -AC_DEFUN([AC_BAKEFILE_METROWERKS_EXTO], -[AC_CACHE_CHECK([if the _AC_LANG compiler requires -ext o], wx_cv_[]_AC_LANG_ABBREV[]_exto, -dnl First create an empty conf test -[AC_LANG_CONFTEST([AC_LANG_PROGRAM()]) -dnl Now remove .o and .c.o or .cc.o -rm -f conftest.$ac_objext conftest.$ac_ext.o -dnl Now compile the test -AS_IF([AC_TRY_EVAL(ac_compile)], -dnl If the test succeeded look for conftest.c.o or conftest.cc.o -[for ac_file in `(ls conftest.* 2>/dev/null)`; do - case $ac_file in - conftest.$ac_ext.o) - wx_cv_[]_AC_LANG_ABBREV[]_exto="-ext o" - ;; - *) - ;; - esac -done], -[AC_MSG_FAILURE([cannot figure out if compiler needs -ext o: cannot compile]) -]) dnl AS_IF - -rm -f conftest.$ac_ext.o conftest.$ac_objext conftest.$ac_ext -]) dnl AC_CACHE_CHECK - -if test "x$wx_cv_[]_AC_LANG_ABBREV[]_exto" '!=' "x"; then - if test "[]_AC_LANG_ABBREV[]" = "c"; then - CFLAGS="$wx_cv_[]_AC_LANG_ABBREV[]_exto $CFLAGS" - fi - if test "[]_AC_LANG_ABBREV[]" = "cxx"; then - CXXFLAGS="$wx_cv_[]_AC_LANG_ABBREV[]_exto $CXXFLAGS" - fi -fi -]) dnl AC_DEFUN - - -dnl =========================================================================== -dnl Macros to do all of the compiler detections as one macro -dnl =========================================================================== -AC_DEFUN([AC_BAKEFILE_PROG_CC], -[ - AC_PROG_CC - AC_BAKEFILE_METROWERKS_EXTO - dnl By the time we find out that we need -ext o some tests have failed. - if test "x$wx_cv_c_exto" '!=' "x"; then - unset ac_cv_prog_cc_g - _AC_PROG_CC_G - fi - AC_BAKEFILE_PROG_MWCC - AC_BAKEFILE_PROG_XLCC -]) - -AC_DEFUN([AC_BAKEFILE_PROG_CXX], -[ - AC_PROG_CXX - AC_BAKEFILE_METROWERKS_EXTO - dnl By the time we find out that we need -ext o some tests have failed. - if test "x$wx_cv_cxx_exto" '!=' "x"; then - unset ac_cv_prog_cxx_g - _AC_PROG_CXX_G - fi - AC_BAKEFILE_PROG_MWCXX - AC_BAKEFILE_PROG_XLCXX -]) - - diff --git a/wxWidgets/src/expat/bcb5/README.txt b/wxWidgets/src/expat/bcb5/README.txt deleted file mode 100644 index 50ac811a57..0000000000 --- a/wxWidgets/src/expat/bcb5/README.txt +++ /dev/null @@ -1,86 +0,0 @@ - - Using a Borland compiler product - -The files in this directory support using both the free Borland command-line -compiler tools and the Borland C++ Builder IDE. The project files have been -tested with both versions 5 and 6 of the C++ Builder product. - - Using the free BCC32 command line compiler - -After downloading and installing the free C++ Builder commandline version, -perform the following steps (assuming it was installed under C:\Borland\BCC55): - -1) Add "C:\Borland\BCC55\BIN" to your path -2) Set the environment variable BCB to "C:\Borland\BCC55". -3) edit makefile.mak: enable or comment out the appropriate commands under - clean & distclean, depending on whether your OS can use deltree /y or - del /s/f/q. - -After that, you should simply cd to the bcb5 directory in your Expat directory -tree (same structure as CVS) and run "make all" or just "make". - - Naming - -The libraries have the base name "libexpat" followed optionally by an "s" -(static) or a "w" (unicode version), then an underscore and optionally -"mt" (multi-threaded) and "d" (dynamic RTL). - -To change the name of the library a project file produces, edit the project -option source (see step 1 under Unicode below) and change the name contained in -the PROJECT tag. In a make file, change the value assigned to the PROJECT -variable. Also, the LIBRARY entry in the .def file has to be changed to -correspond to the new executable name. - - - Unicode Considerations - -There are no facilities in the BCB 5 GUI to create a unicode-enabled -application. Fortunately, it is not hard to do by hand. - -1. The startup .obj system file must be changed to the unicode version. - Go to Project|Edit Option Source, and scroll down to the ALLOBJ tag. Change - c0x32.obj to c0x32w.obj. Editing this file can be quirky, but usually the - following kludge will make the change stick. Close and save the file - (CTRL-F4) then open the options dialog (CTRL-Shift-F11), then click OK on - the dialog immediately without changing anything in it. If this doesn't work, - you will have to close the project completely and edit the .bpr file by hand. - - If you are using a make file, just change the startup .obj file assigned - to the ALLOBJ variable. - -2. Add the macro define XML_UNICODE_WCHAR_T. In the GUI that goes in the options - dialog, Directories/Conditionals tab, in the Conditional define box. In a - make file, put it in the USERDEFINES variable. - -3. Of course, your code has to be written for unicode. As a start, the "main" - function is called "wmain". The tchar macros are an interesting way to - write code that can easily switch between unicode and utf-8. If these macros - are used, then simply adding the conditional define _UNICODE as well as - XML_UNICODE_WCHAR_T will bring in the unicode versions of the tchar macros. - Otherwise the utf-8 versions are used. xmlwf uses its own versions of the - tchar macros which are switched on and off by the XML_UNICODE macro, which - itself is set by the XML_UNICODE_WCHAR_T define. - - Threading - -The libexpat libraries are all built with the multi-threaded dynamic RTL's. -To create single-threaded libs, do the following: - -1. The compiler option for multi-threading must be turned off. Following the - instructions above to edit the option source, remove the -tWM option from - the CFLAG1 tag. In a make file, remove it from the CFLAG1 variable. - -2. The single threaded RTL must be called. change the RTL in the ALLLIB tag or - variable (GUI or makefile repectively) to the version without the "mt" in the - name. For example, change cw32mti.lib to cw32i.lib. - - Static RTL's - -To build the libs with static RTL's do the following, - -1. For the static expatlibs, in the Tlib tab on the options dialog, uncheck the - "Use dynamic RTL" box. For the dynamic expatlibs, in the Linker tab on the - options dialog, uncheck "Use dynamic RTL". If you are using a make file, - remove the _RTLDLL assignment to the SYSDEFINES variable, and change the RTL - to the version without an "i" in the ALLLIB variable. For example, - cw32mti.lib would become cw32mt.lib. diff --git a/wxWidgets/src/expat/bcb5/elements.bpf b/wxWidgets/src/expat/bcb5/elements.bpf deleted file mode 100644 index 5c1e878d67..0000000000 --- a/wxWidgets/src/expat/bcb5/elements.bpf +++ /dev/null @@ -1,4 +0,0 @@ -USEUNIT("..\examples\elements.c"); -USELIB("Release\libexpats_mtd.lib"); -//--------------------------------------------------------------------------- -main diff --git a/wxWidgets/src/expat/bcb5/elements.bpr b/wxWidgets/src/expat/bcb5/elements.bpr deleted file mode 100644 index c21c0f59f2..0000000000 --- a/wxWidgets/src/expat/bcb5/elements.bpr +++ /dev/null @@ -1,149 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -[Version Info] -IncludeVerInfo=0 -AutoIncBuild=0 -MajorVer=1 -MinorVer=0 -Release=0 -Build=0 -Debug=0 -PreRelease=0 -Special=0 -Private=0 -DLL=0 -Locale=1033 -CodePage=1252 - -[Version Info Keys] -CompanyName= -FileDescription= -FileVersion=1.0.0.0 -InternalName= -LegalCopyright= -LegalTrademarks= -OriginalFilename= -ProductName= -ProductVersion=1.0.0.0 -Comments= - -[HistoryLists\hlIncludePath] -Count=4 -Item0=..\examples;$(BCB)\include -Item1=$(BCB)\include -Item2=$(BCB)\include;$(BCB)\include\mfc;$(BCB)\include\atl -Item3=$(BCB)\include;$(BCB)\include\mfc;$(BCB)\include\atl; - -[HistoryLists\hlLibraryPath] -Count=8 -Item0=..\examples;$(BCB)\lib;$(RELEASELIBPATH) -Item1=..\examples;$(BCB)\lib;..\examples\$(RELEASELIBPATH) -Item2=$(BCB)\lib;$(RELEASELIBPATH) -Item3=$(BCB)\lib;$(RELEASELIBPATH);..\lib\Release-w_static -Item4=$(BCB)\lib;$(RELEASELIBPATH);..\lib\Release_static -Item5=$(BCB)\lib;$(RELEASELIBPATH);C:\src\expat\lib\Release_static -Item6=$(BCB)\lib;$(RELEASELIBPATH);$(BCB)\lib\psdk -Item7=$(BCB)\lib;$(RELEASELIBPATH);;$(BCB)\lib\psdk; - -[HistoryLists\hlDebugSourcePath] -Count=1 -Item0=$(BCB)\source\vcl - -[HistoryLists\hlConditionals] -Count=17 -Item0=WIN32;NDEBUG;_CONSOLE;XML_STATIC -Item1=WIN32;NDEBUG;_CONSOLE;_DEBUG;XML_STATIC -Item2=WIN32;NDEBUG;_CONSOLE;_DEBUG;XML_UNICODE_WCHAR_T;_UNICODE;XML_STATIC -Item3=WIN32;NDEBUG;_CONSOLE;_DEBUG;XML_UNICODE_WCHAR_T;_UNICODE -Item4=WIN32;NDEBUG;_CONSOLE;_DEBUG -Item5=WIN32;NDEBUG;_CONSOLE;XML_STATIC;_DEBUG -Item6=WIN32;NDEBUG;_CONSOLE;XML_STATIC;_DEBUG;_UNICODE -Item7=WIN32;NDEBUG;_CONSOLE;XML_STATIC;_DEBUG;XML_UNICODE_WCHAR_T -Item8=WIN32;NDEBUG;_CONSOLE;_MBCS;XML_STATIC;_DEBUG;XML_UNICODE_WCHAR_T -Item9=WIN32;NDEBUG;_CONSOLE;_UNICODE;XML_STATIC;_DEBUG;XML_UNICODE_WCHAR_T -Item10=WIN32;NDEBUG;_CONSOLE;_UNICODE;XML_STATIC;_DEBUG;XML_UNICODE -Item11=WIN32;NDEBUG;_CONSOLE;_MBCS;XML_STATIC;_DEBUG;XML_UNICODE_WCHAR_T;__WCHAR_T -Item12=WIN32;NDEBUG;_CONSOLE;_MBCS;XML_STATIC;_DEBUG;XML_UNICODE_WCHAR_T;_UNICODE -Item13=WIN32;NDEBUG;_CONSOLE;_MBCS;XML_STATIC;_DEBUG;XML_UNICODE;_UNICODE -Item14=WIN32;NDEBUG;_CONSOLE;_MBCS;XML_STATIC;_DEBUG;XML_UNICODE -Item15=WIN32;NDEBUG;_CONSOLE;_MBCS;XML_STATIC;_DEBUG -Item16=WIN32;NDEBUG;_CONSOLE;_MBCS;XML_STATIC - -[HistoryLists\hlIntOutputDir] -Count=5 -Item0=Release\obj\examples -Item1=Release\obj\elements -Item2=Release\obj\mts -Item3=..\examples\Release -Item4=Release - -[HistoryLists\hlFinalOutputDir] -Count=1 -Item0=Release\ - -[Debugging] -DebugSourceDirs= - -[Parameters] -RunParams= -HostApplication= -RemoteHost= -RemotePath= -RemoteDebug=0 - -[Compiler] -ShowInfoMsgs=0 -LinkDebugVcl=0 -LinkCGLIB=0 - -[Language] -ActiveLang= -ProjectLang= -RootDir= - - \ No newline at end of file diff --git a/wxWidgets/src/expat/bcb5/elements.mak b/wxWidgets/src/expat/bcb5/elements.mak deleted file mode 100644 index d4427fd512..0000000000 --- a/wxWidgets/src/expat/bcb5/elements.mak +++ /dev/null @@ -1,186 +0,0 @@ -# --------------------------------------------------------------------------- -!if !$d(BCB) -BCB = $(MAKEDIR)\.. -!endif - -# --------------------------------------------------------------------------- -# IDE SECTION -# --------------------------------------------------------------------------- -# The following section of the project makefile is managed by the BCB IDE. -# It is recommended to use the IDE to change any of the values in this -# section. -# --------------------------------------------------------------------------- - -VERSION = BCB.05.03 -# --------------------------------------------------------------------------- -PROJECT = Release\elements.exe -OBJFILES = Release\obj\examples\elements.obj -RESFILES = -MAINSOURCE = elements.bpf -RESDEPEN = $(RESFILES) -LIBFILES = Release\libexpats_mtd.lib -IDLFILES = -IDLGENFILES = -LIBRARIES = -PACKAGES = VCL50.bpi VCLX50.bpi bcbsmp50.bpi QRPT50.bpi VCLDB50.bpi VCLBDE50.bpi \ - ibsmp50.bpi VCLDBX50.bpi TEEUI50.bpi TEEDB50.bpi TEE50.bpi TEEQR50.bpi \ - VCLIB50.bpi bcbie50.bpi VCLIE50.bpi INETDB50.bpi INET50.bpi NMFAST50.bpi \ - dclocx50.bpi bcb2kaxserver50.bpi dclusr50.bpi -SPARELIBS = -DEFFILE = -# --------------------------------------------------------------------------- -PATHCPP = .;..\examples -PATHASM = .; -PATHPAS = .; -PATHRC = .; -DEBUGLIBPATH = $(BCB)\lib\debug -RELEASELIBPATH = $(BCB)\lib\release -USERDEFINES = WIN32;NDEBUG;_CONSOLE;XML_STATIC -SYSDEFINES = _NO_VCL;_ASSERTE;NO_STRICT;_RTLDLL -INCLUDEPATH = ..\examples;$(BCB)\include -LIBPATH = ..\examples;$(BCB)\lib;$(RELEASELIBPATH) -WARNINGS= -w-par -w-8027 -w-8026 -# --------------------------------------------------------------------------- -CFLAG1 = -O2 -X- -a8 -b -k- -vi -q -I..\lib -c -IDLCFLAGS = -I$(BCB)\include -PFLAGS = -N2Release\obj\examples -N0Release\obj\examples -$Y- -$L- -$D- -RFLAGS = /l 0x409 /d "NDEBUG" /i$(BCB)\include -AFLAGS = /mx /w2 /zn -LFLAGS = -IRelease\obj\examples -D"" -ap -Tpe -x -Gn -q -L..\LIB\RELEASE_STATIC -# --------------------------------------------------------------------------- -ALLOBJ = c0x32.obj $(OBJFILES) -ALLRES = $(RESFILES) -ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cw32mti.lib -# --------------------------------------------------------------------------- -!ifdef IDEOPTIONS - -[Version Info] -IncludeVerInfo=0 -AutoIncBuild=0 -MajorVer=1 -MinorVer=0 -Release=0 -Build=0 -Debug=0 -PreRelease=0 -Special=0 -Private=0 -DLL=0 - -[Version Info Keys] -CompanyName= -FileDescription= -FileVersion=1.0.0.0 -InternalName= -LegalCopyright= -LegalTrademarks= -OriginalFilename= -ProductName= -ProductVersion=1.0.0.0 -Comments= - -[Debugging] -DebugSourceDirs=$(BCB)\source\vcl - -!endif - - - - - -# --------------------------------------------------------------------------- -# MAKE SECTION -# --------------------------------------------------------------------------- -# This section of the project file is not used by the BCB IDE. It is for -# the benefit of building from the command-line using the MAKE utility. -# --------------------------------------------------------------------------- - -.autodepend -# --------------------------------------------------------------------------- -!if "$(USERDEFINES)" != "" -AUSERDEFINES = -d$(USERDEFINES:;= -d) -!else -AUSERDEFINES = -!endif - -!if !$d(BCC32) -BCC32 = bcc32 -!endif - -!if !$d(CPP32) -CPP32 = cpp32 -!endif - -!if !$d(DCC32) -DCC32 = dcc32 -!endif - -!if !$d(TASM32) -TASM32 = tasm32 -!endif - -!if !$d(LINKER) -LINKER = ilink32 -!endif - -!if !$d(BRCC32) -BRCC32 = brcc32 -!endif - - -# --------------------------------------------------------------------------- -!if $d(PATHCPP) -.PATH.CPP = $(PATHCPP) -.PATH.C = $(PATHCPP) -!endif - -!if $d(PATHPAS) -.PATH.PAS = $(PATHPAS) -!endif - -!if $d(PATHASM) -.PATH.ASM = $(PATHASM) -!endif - -!if $d(PATHRC) -.PATH.RC = $(PATHRC) -!endif -# --------------------------------------------------------------------------- -$(PROJECT): $(IDLGENFILES) $(OBJFILES) $(RESDEPEN) $(DEFFILE) - $(BCB)\BIN\$(LINKER) @&&! - $(LFLAGS) -L$(LIBPATH) + - $(ALLOBJ), + - $(PROJECT),, + - $(ALLLIB), + - $(DEFFILE), + - $(ALLRES) -! -# --------------------------------------------------------------------------- -.pas.hpp: - $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } - -.pas.obj: - $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } - -.cpp.obj: - $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } - -.c.obj: - $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } - -.c.i: - $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } - -.cpp.i: - $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } - -.asm.obj: - $(BCB)\BIN\$(TASM32) $(AFLAGS) -i$(INCLUDEPATH:;= -i) $(AUSERDEFINES) -d$(SYSDEFINES:;= -d) $<, $@ - -.rc.res: - $(BCB)\BIN\$(BRCC32) $(RFLAGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -fo$@ $< -# --------------------------------------------------------------------------- - - - - diff --git a/wxWidgets/src/expat/bcb5/expat.bpf b/wxWidgets/src/expat/bcb5/expat.bpf deleted file mode 100644 index 2c423283f1..0000000000 --- a/wxWidgets/src/expat/bcb5/expat.bpf +++ /dev/null @@ -1,6 +0,0 @@ -USEUNIT("..\lib\xmlparse.c"); -USEUNIT("..\lib\xmlrole.c"); -USEUNIT("..\lib\xmltok.c"); -USEDEF("libexpat_mtd.def"); -//--------------------------------------------------------------------------- -#define DllEntryPoint diff --git a/wxWidgets/src/expat/bcb5/expat.bpr b/wxWidgets/src/expat/bcb5/expat.bpr deleted file mode 100644 index 291b8cafc1..0000000000 --- a/wxWidgets/src/expat/bcb5/expat.bpr +++ /dev/null @@ -1,140 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -[Version Info] -IncludeVerInfo=0 -AutoIncBuild=0 -MajorVer=1 -MinorVer=0 -Release=0 -Build=0 -Debug=0 -PreRelease=0 -Special=0 -Private=0 -DLL=0 -Locale=1033 -CodePage=1252 - -[Version Info Keys] -CompanyName= -FileDescription= -FileVersion=1.0.0.0 -InternalName= -LegalCopyright= -LegalTrademarks= -OriginalFilename= -ProductName= -ProductVersion=1.0.0.0 -Comments= - -[HistoryLists\hlIncludePath] -Count=4 -Item0=..\lib;$(BCB)\include -Item1=$(BCB)\include -Item2=$(BCB)\include;$(BCB)\include\mfc;$(BCB)\include\atl -Item3=$(BCB)\include;$(BCB)\include\mfc;$(BCB)\include\atl; - -[HistoryLists\hlLibraryPath] -Count=5 -Item0=..\lib;$(BCB)\lib;$(RELEASELIBPATH) -Item1=..\lib;$(BCB)\lib;..\lib\$(RELEASELIBPATH) -Item2=$(BCB)\lib;$(RELEASELIBPATH) -Item3=$(BCB)\lib;$(RELEASELIBPATH);$(BCB)\lib\psdk -Item4=$(BCB)\lib;$(RELEASELIBPATH);;$(BCB)\lib\psdk; - -[HistoryLists\hlDebugSourcePath] -Count=1 -Item0=$(BCB)\source\vcl - -[HistoryLists\hlConditionals] -Count=8 -Item0=_WINDOWS;WIN32;NDEBUG;_USRDLL;COMPILED_FROM_DSP;EXPAT_EXPORTS -Item1=_WINDOWS;WIN32;NDEBUG;_DEBUG;_USRDLL;COMPILED_FROM_DSP;EXPAT_EXPORTS -Item2=WIN32;_WINDOWS;NDEBUG;_DEBUG;_USRDLL;COMPILED_FROM_DSP;EXPAT_EXPORTS -Item3=WIN32;_WINDOWS;NDEBUG;_DEBUG;_USRDLL;EXPAT_EXPORTS;COMPILED_FROM_DSP -Item4=NDEBUG;WIN32;_WINDOWS;_USRDLL;_DEBUG;EXPAT_EXPORTS;COMPILED_FROM_DSP -Item5=NDEBUG;WIN32;_WINDOWS;_USRDLL;EXPAT_EXPORTS;COMPILED_FROM_DSP;_DEBUG -Item6=NDEBUG;WIN32;_WINDOWS;_MBCS;_USRDLL;EXPAT_EXPORTS;COMPILED_FROM_DSP;_DEBUG -Item7=NDEBUG;WIN32;_WINDOWS;_MBCS;_USRDLL;EXPAT_EXPORTS;COMPILED_FROM_DSP - -[HistoryLists\hlIntOutputDir] -Count=7 -Item0=Release\obj\libexpat -Item1=Release\obj\libexpat_static -Item2=Release\obj\mtd -Item3=Release\obj\mt -Item4=Release\obj -Item5=Release -Item6=..\lib\Release - -[HistoryLists\hlFinalOutputDir] -Count=1 -Item0=Release\ - -[Debugging] -DebugSourceDirs= - -[Parameters] -RunParams= -HostApplication= -RemoteHost= -RemotePath= -RemoteDebug=0 - -[Compiler] -ShowInfoMsgs=0 -LinkDebugVcl=0 -LinkCGLIB=0 - -[Language] -ActiveLang= -ProjectLang= -RootDir= - - \ No newline at end of file diff --git a/wxWidgets/src/expat/bcb5/expat.mak b/wxWidgets/src/expat/bcb5/expat.mak deleted file mode 100644 index 68e19db31b..0000000000 --- a/wxWidgets/src/expat/bcb5/expat.mak +++ /dev/null @@ -1,187 +0,0 @@ -# --------------------------------------------------------------------------- -!if !$d(BCB) -BCB = $(MAKEDIR)\.. -!endif - -# --------------------------------------------------------------------------- -# IDE SECTION -# --------------------------------------------------------------------------- -# The following section of the project makefile is managed by the BCB IDE. -# It is recommended to use the IDE to change any of the values in this -# section. -# --------------------------------------------------------------------------- - -VERSION = BCB.05.03 -# --------------------------------------------------------------------------- -PROJECT = Release\libexpat_mtd.dll -OBJFILES = Release\obj\libexpat\xmlparse.obj Release\obj\libexpat\xmlrole.obj \ - Release\obj\libexpat\xmltok.obj -RESFILES = -MAINSOURCE = expat.bpf -RESDEPEN = $(RESFILES) -LIBFILES = -IDLFILES = -IDLGENFILES = -LIBRARIES = -PACKAGES = VCL50.bpi VCLX50.bpi bcbsmp50.bpi QRPT50.bpi VCLDB50.bpi VCLBDE50.bpi \ - ibsmp50.bpi VCLDBX50.bpi TEEUI50.bpi TEEDB50.bpi TEE50.bpi TEEQR50.bpi \ - VCLIB50.bpi bcbie50.bpi VCLIE50.bpi INETDB50.bpi INET50.bpi NMFAST50.bpi \ - dclocx50.bpi bcb2kaxserver50.bpi dclusr50.bpi -SPARELIBS = -DEFFILE = libexpat_mtd.def -# --------------------------------------------------------------------------- -PATHCPP = .;..\lib -PATHASM = .; -PATHPAS = .; -PATHRC = .; -DEBUGLIBPATH = $(BCB)\lib\debug -RELEASELIBPATH = $(BCB)\lib\release -USERDEFINES = _WINDOWS;WIN32;NDEBUG;_USRDLL;COMPILED_FROM_DSP;EXPAT_EXPORTS -SYSDEFINES = _NO_VCL;_ASSERTE;NO_STRICT;_RTLDLL -INCLUDEPATH = ..\lib;$(BCB)\include -LIBPATH = ..\lib;$(BCB)\lib;$(RELEASELIBPATH) -WARNINGS= -w-rch -w-par -w-8027 -w-8026 -w-ccc -# --------------------------------------------------------------------------- -CFLAG1 = -WD -O2 -X- -a8 -b -k- -vi -q -tWM -c -tWD -IDLCFLAGS = -I$(BCB)\include -PFLAGS = -N2Release\obj\libexpat -N0Release\obj\libexpat -$Y- -$L- -$D- -RFLAGS = /l 0x409 /d "NDEBUG" /i$(BCB)\include -AFLAGS = /mx /w2 /zn -LFLAGS = -IRelease\obj\libexpat -D"" -aa -Tpd -x -Gn -Gi -q -# --------------------------------------------------------------------------- -ALLOBJ = c0d32.obj $(OBJFILES) -ALLRES = $(RESFILES) -ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cw32mti.lib -# --------------------------------------------------------------------------- -!ifdef IDEOPTIONS - -[Version Info] -IncludeVerInfo=0 -AutoIncBuild=0 -MajorVer=1 -MinorVer=0 -Release=0 -Build=0 -Debug=0 -PreRelease=0 -Special=0 -Private=0 -DLL=0 - -[Version Info Keys] -CompanyName= -FileDescription= -FileVersion=1.0.0.0 -InternalName= -LegalCopyright= -LegalTrademarks= -OriginalFilename= -ProductName= -ProductVersion=1.0.0.0 -Comments= - -[Debugging] -DebugSourceDirs=$(BCB)\source\vcl - -!endif - - - - - -# --------------------------------------------------------------------------- -# MAKE SECTION -# --------------------------------------------------------------------------- -# This section of the project file is not used by the BCB IDE. It is for -# the benefit of building from the command-line using the MAKE utility. -# --------------------------------------------------------------------------- - -.autodepend -# --------------------------------------------------------------------------- -!if "$(USERDEFINES)" != "" -AUSERDEFINES = -d$(USERDEFINES:;= -d) -!else -AUSERDEFINES = -!endif - -!if !$d(BCC32) -BCC32 = bcc32 -!endif - -!if !$d(CPP32) -CPP32 = cpp32 -!endif - -!if !$d(DCC32) -DCC32 = dcc32 -!endif - -!if !$d(TASM32) -TASM32 = tasm32 -!endif - -!if !$d(LINKER) -LINKER = ilink32 -!endif - -!if !$d(BRCC32) -BRCC32 = brcc32 -!endif - - -# --------------------------------------------------------------------------- -!if $d(PATHCPP) -.PATH.CPP = $(PATHCPP) -.PATH.C = $(PATHCPP) -!endif - -!if $d(PATHPAS) -.PATH.PAS = $(PATHPAS) -!endif - -!if $d(PATHASM) -.PATH.ASM = $(PATHASM) -!endif - -!if $d(PATHRC) -.PATH.RC = $(PATHRC) -!endif -# --------------------------------------------------------------------------- -$(PROJECT): $(IDLGENFILES) $(OBJFILES) $(RESDEPEN) $(DEFFILE) - $(BCB)\BIN\$(LINKER) @&&! - $(LFLAGS) -L$(LIBPATH) + - $(ALLOBJ), + - $(PROJECT),, + - $(ALLLIB), + - $(DEFFILE), + - $(ALLRES) -! -# --------------------------------------------------------------------------- -.pas.hpp: - $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } - -.pas.obj: - $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } - -.cpp.obj: - $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } - -.c.obj: - $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } - -.c.i: - $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } - -.cpp.i: - $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } - -.asm.obj: - $(BCB)\BIN\$(TASM32) $(AFLAGS) -i$(INCLUDEPATH:;= -i) $(AUSERDEFINES) -d$(SYSDEFINES:;= -d) $<, $@ - -.rc.res: - $(BCB)\BIN\$(BRCC32) $(RFLAGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -fo$@ $< -# --------------------------------------------------------------------------- - - - - diff --git a/wxWidgets/src/expat/bcb5/expat_static.bpf b/wxWidgets/src/expat/bcb5/expat_static.bpf deleted file mode 100644 index 5ca458edca..0000000000 --- a/wxWidgets/src/expat/bcb5/expat_static.bpf +++ /dev/null @@ -1,5 +0,0 @@ -USEUNIT("..\lib\xmlparse.c"); -USEUNIT("..\lib\xmlrole.c"); -USEUNIT("..\lib\xmltok.c"); -//--------------------------------------------------------------------------- -#define Library diff --git a/wxWidgets/src/expat/bcb5/expat_static.bpr b/wxWidgets/src/expat/bcb5/expat_static.bpr deleted file mode 100644 index 2f6ec4d3bd..0000000000 --- a/wxWidgets/src/expat/bcb5/expat_static.bpr +++ /dev/null @@ -1,143 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -[Version Info] -IncludeVerInfo=0 -AutoIncBuild=0 -MajorVer=1 -MinorVer=0 -Release=0 -Build=0 -Debug=0 -PreRelease=0 -Special=0 -Private=0 -DLL=0 -Locale=1033 -CodePage=1252 - -[Version Info Keys] -CompanyName= -FileDescription= -FileVersion=1.0.0.0 -InternalName= -LegalCopyright= -LegalTrademarks= -OriginalFilename= -ProductName= -ProductVersion=1.0.0.0 -Comments= - -[HistoryLists\hlIncludePath] -Count=4 -Item0=..\lib;$(BCB)\include -Item1=$(BCB)\include -Item2=$(BCB)\include;$(BCB)\include\mfc;$(BCB)\include\atl -Item3=$(BCB)\include;$(BCB)\include\mfc;$(BCB)\include\atl; - -[HistoryLists\hlLibraryPath] -Count=5 -Item0=..\lib;$(BCB)\lib;$(RELEASELIBPATH) -Item1=..\lib;$(BCB)\lib;..\lib\$(RELEASELIBPATH) -Item2=$(BCB)\lib;$(RELEASELIBPATH) -Item3=$(BCB)\lib;$(RELEASELIBPATH);$(BCB)\lib\psdk -Item4=$(BCB)\lib;$(RELEASELIBPATH);;$(BCB)\lib\psdk; - -[HistoryLists\hlDebugSourcePath] -Count=1 -Item0=$(BCB)\source\vcl - -[HistoryLists\hlConditionals] -Count=7 -Item0=_WINDOWS;WIN32;NDEBUG;_LIB;COMPILED_FROM_DSP;XML_STATIC -Item1=_WINDOWS;WIN32;NDEBUG;_DEBUG;_LIB;COMPILED_FROM_DSP;XML_STATIC -Item2=WIN32;_WINDOWS;NDEBUG;_DEBUG;_LIB;COMPILED_FROM_DSP;XML_STATIC -Item3=WIN32;_WINDOWS;NDEBUG;_LIB;COMPILED_FROM_DSP;_DEBUG -Item4=WIN32;_WINDOWS;NDEBUG;_LIB;COMPILED_FROM_DSP -Item5=WIN32;_WINDOWS;NDEBUG;_LIB;COMPILED_FROM_DSP;_MBCS -Item6=WIN32;_WINDOWS;NDEBUG;_MBCS;_LIB;COMPILED_FROM_DSP - -[HistoryLists\hlIntOutputDir] -Count=6 -Item0=Release\obj\libexpat_static -Item1=Release\obj\mts -Item2=Release\obj\mt -Item3=Release -Item4=..\lib\Release_static -Item5=Release_static - -[HistoryLists\hlFinalOutputDir] -Count=3 -Item0=Release\ -Item1=Release -Item2=Release_static\ - -[HistoryLists\hlTlibPageSize] -Count=1 -Item0=0x0010 - -[Debugging] -DebugSourceDirs= - -[Parameters] -RunParams= -HostApplication= -RemoteHost= -RemotePath= -RemoteDebug=0 - -[Compiler] -ShowInfoMsgs=0 -LinkDebugVcl=0 -LinkCGLIB=0 - -[Language] -ActiveLang= -ProjectLang= -RootDir= - - \ No newline at end of file diff --git a/wxWidgets/src/expat/bcb5/expat_static.mak b/wxWidgets/src/expat/bcb5/expat_static.mak deleted file mode 100644 index 9137d3b534..0000000000 --- a/wxWidgets/src/expat/bcb5/expat_static.mak +++ /dev/null @@ -1,189 +0,0 @@ -# --------------------------------------------------------------------------- -!if !$d(BCB) -BCB = $(MAKEDIR)\.. -!endif - -# --------------------------------------------------------------------------- -# IDE SECTION -# --------------------------------------------------------------------------- -# The following section of the project makefile is managed by the BCB IDE. -# It is recommended to use the IDE to change any of the values in this -# section. -# --------------------------------------------------------------------------- - -VERSION = BCB.05.03 -# --------------------------------------------------------------------------- -PROJECT = Release\libexpats_mtd.lib -OBJFILES = Release\obj\libexpat_static\xmlparse.obj \ - Release\obj\libexpat_static\xmlrole.obj \ - Release\obj\libexpat_static\xmltok.obj -RESFILES = -MAINSOURCE = expat_static.bpf -RESDEPEN = $(RESFILES) -LIBFILES = -IDLFILES = -IDLGENFILES = -LIBRARIES = -PACKAGES = -SPARELIBS = -DEFFILE = -# --------------------------------------------------------------------------- -PATHCPP = .;..\lib -PATHASM = .; -PATHPAS = .; -PATHRC = .; -LINKER = TLib -DEBUGLIBPATH = $(BCB)\lib\debug -RELEASELIBPATH = $(BCB)\lib\release -USERDEFINES = _WINDOWS;WIN32;NDEBUG;_LIB;COMPILED_FROM_DSP;XML_STATIC -SYSDEFINES = _NO_VCL;_ASSERTE;NO_STRICT;_RTLDLL -INCLUDEPATH = ..\lib;$(BCB)\include -LIBPATH = ..\lib;$(BCB)\lib;$(RELEASELIBPATH) -WARNINGS = -w-rch -w-par -w-8027 -w-8026 -w-ccc -LISTFILE = -# --------------------------------------------------------------------------- -CFLAG1 = -O2 -X- -a8 -b -k- -vi -q -tWM -c -IDLCFLAGS = -I$(BCB)\include -PFLAGS = -N2Release\obj\libexpat_static -N0Release\obj\libexpat_static -$Y- -$L- -$D- -RFLAGS = /l 0x409 /d "NDEBUG" /i$(BCB)\include -AFLAGS = /mx /w2 /zn -LFLAGS = -# --------------------------------------------------------------------------- -ALLOBJ = $(OBJFILES) -ALLRES = $(RESFILES) -ALLLIB = $(LIBFILES) $(LIBRARIES) -# --------------------------------------------------------------------------- -!ifdef IDEOPTIONS - -[Version Info] -IncludeVerInfo=0 -AutoIncBuild=0 -MajorVer=1 -MinorVer=0 -Release=0 -Build=0 -Debug=0 -PreRelease=0 -Special=0 -Private=0 -DLL=0 - -[Version Info Keys] -CompanyName= -FileDescription= -FileVersion=1.0.0.0 -InternalName= -LegalCopyright= -LegalTrademarks= -OriginalFilename= -ProductName= -ProductVersion=1.0.0.0 -Comments= - -[Debugging] -DebugSourceDirs=$(BCB)\source\vcl - -!endif - - - - - -# --------------------------------------------------------------------------- -# MAKE SECTION -# --------------------------------------------------------------------------- -# This section of the project file is not used by the BCB IDE. It is for -# the benefit of building from the command-line using the MAKE utility. -# --------------------------------------------------------------------------- - -.autodepend -# --------------------------------------------------------------------------- -!if "$(USERDEFINES)" != "" -AUSERDEFINES = -d$(USERDEFINES:;= -d) -!else -AUSERDEFINES = -!endif - -!if !$d(BCC32) -BCC32 = bcc32 -!endif - -!if !$d(CPP32) -CPP32 = cpp32 -!endif - -!if !$d(DCC32) -DCC32 = dcc32 -!endif - -!if !$d(TASM32) -TASM32 = tasm32 -!endif - -!if !$d(LINKER) -LINKER = TLib -!endif - -!if !$d(BRCC32) -BRCC32 = brcc32 -!endif - - -# --------------------------------------------------------------------------- -!if $d(PATHCPP) -.PATH.CPP = $(PATHCPP) -.PATH.C = $(PATHCPP) -!endif - -!if $d(PATHPAS) -.PATH.PAS = $(PATHPAS) -!endif - -!if $d(PATHASM) -.PATH.ASM = $(PATHASM) -!endif - -!if $d(PATHRC) -.PATH.RC = $(PATHRC) -!endif -# --------------------------------------------------------------------------- -!if "$(LISTFILE)" == "" -COMMA = -!else -COMMA = , -!endif - -$(PROJECT): $(IDLGENFILES) $(OBJFILES) $(RESDEPEN) $(DEFFILE) - $(BCB)\BIN\$(LINKER) /u $@ @&&! - $(LFLAGS) $? $(COMMA) $(LISTFILE) - -! -# --------------------------------------------------------------------------- -.pas.hpp: - $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } - -.pas.obj: - $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } - -.cpp.obj: - $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } - -.c.obj: - $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } - -.c.i: - $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } - -.cpp.i: - $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } - -.asm.obj: - $(BCB)\BIN\$(TASM32) $(AFLAGS) -i$(INCLUDEPATH:;= -i) $(AUSERDEFINES) -d$(SYSDEFINES:;= -d) $<, $@ - -.rc.res: - $(BCB)\BIN\$(BRCC32) $(RFLAGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -fo$@ $< -# --------------------------------------------------------------------------- - - - - diff --git a/wxWidgets/src/expat/bcb5/expatw.bpf b/wxWidgets/src/expat/bcb5/expatw.bpf deleted file mode 100644 index 188a6d54ea..0000000000 --- a/wxWidgets/src/expat/bcb5/expatw.bpf +++ /dev/null @@ -1,6 +0,0 @@ -USEUNIT("..\lib\xmlparse.c"); -USEUNIT("..\lib\xmlrole.c"); -USEUNIT("..\lib\xmltok.c"); -USEDEF("libexpatw_mtd.def"); -//--------------------------------------------------------------------------- -#define DllEntryPoint diff --git a/wxWidgets/src/expat/bcb5/expatw.bpr b/wxWidgets/src/expat/bcb5/expatw.bpr deleted file mode 100644 index 9ec50010b7..0000000000 --- a/wxWidgets/src/expat/bcb5/expatw.bpr +++ /dev/null @@ -1,146 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -[Version Info] -IncludeVerInfo=0 -AutoIncBuild=0 -MajorVer=1 -MinorVer=0 -Release=0 -Build=0 -Debug=0 -PreRelease=0 -Special=0 -Private=0 -DLL=0 -Locale=1033 -CodePage=1252 - -[Version Info Keys] -CompanyName= -FileDescription= -FileVersion=1.0.0.0 -InternalName= -LegalCopyright= -LegalTrademarks= -OriginalFilename= -ProductName= -ProductVersion=1.0.0.0 -Comments= - -[HistoryLists\hlIncludePath] -Count=4 -Item0=..\lib;$(BCB)\include -Item1=$(BCB)\include -Item2=$(BCB)\include;$(BCB)\include\mfc;$(BCB)\include\atl -Item3=$(BCB)\include;$(BCB)\include\mfc;$(BCB)\include\atl; - -[HistoryLists\hlLibraryPath] -Count=5 -Item0=..\lib;$(BCB)\lib;$(RELEASELIBPATH) -Item1=..\lib;$(BCB)\lib;..\lib\$(RELEASELIBPATH) -Item2=$(BCB)\lib;$(RELEASELIBPATH) -Item3=$(BCB)\lib;$(RELEASELIBPATH);$(BCB)\lib\psdk -Item4=$(BCB)\lib;$(RELEASELIBPATH);;$(BCB)\lib\psdk; - -[HistoryLists\hlDebugSourcePath] -Count=1 -Item0=$(BCB)\source\vcl - -[HistoryLists\hlConditionals] -Count=9 -Item0=_WINDOWS;WIN32;NDEBUG;_USRDLL;COMPILED_FROM_DSP;EXPAT_EXPORTS;XML_UNICODE_WCHAR_T -Item1=_WINDOWS;WIN32;NDEBUG;_DEBUG;_USRDLL;COMPILED_FROM_DSP;EXPAT_EXPORTS;XML_UNICODE_WCHAR_T -Item2=_WINDOWS;WIN32;NDEBUG;_DEBUG;_USRDLL;EXPAT_EXPORTS;COMPILED_FROM_DSP;XML_UNICODE_WCHAR_T -Item3=NDEBUG;COMPILED_FROM_DSP;WIN32;_WINDOWS;_USRDLL;EXPAT_EXPORTS;_DEBUG;XML_UNICODE_WCHAR_T -Item4=NDEBUG;COMPILED_FROM_DSP;WIN32;_WINDOWS;_USRDLL;EXPAT_EXPORTS;XML_UNICODE_WCHAR_T;_DEBUG -Item5=NDEBUG;COMPILED_FROM_DSP;WIN32;_WINDOWS;_UNICODE;_USRDLL;EXPAT_EXPORTS;XML_UNICODE_WCHAR_T;_DEBUG -Item6=NDEBUG;COMPILED_FROM_DSP;WIN32;_WINDOWS;_UNICODE;_USRDLL;EXPAT_EXPORTS;XML_UNICODE_WCHAR_T -Item7=NDEBUG;COMPILED_FROM_DSP;WIN32;_WINDOWS;_MBCS;_USRDLL;EXPAT_EXPORTS;XML_UNICODE_WCHAR_T;XML_UNICODE -Item8=NDEBUG;COMPILED_FROM_DSP;WIN32;_WINDOWS;_MBCS;_USRDLL;EXPAT_EXPORTS;XML_UNICODE_WCHAR_T - -[HistoryLists\hlIntOutputDir] -Count=8 -Item0=Release\obj\libexpatw -Item1=Release\obj\libexpat -Item2=Release\obj\mtd -Item3=Release\obj\mt -Item4=Release_w\obj -Item5=Release-w\obj -Item6=Release-w -Item7=..\lib\Release-w - -[HistoryLists\hlFinalOutputDir] -Count=5 -Item0=Release\ -Item1=Release -Item2=Release_w\ -Item3=Release-w\ -Item4=Release-w - -[Debugging] -DebugSourceDirs= - -[Parameters] -RunParams= -HostApplication= -RemoteHost= -RemotePath= -RemoteDebug=0 - -[Compiler] -ShowInfoMsgs=0 -LinkDebugVcl=0 -LinkCGLIB=0 - -[Language] -ActiveLang= -ProjectLang= -RootDir= - - \ No newline at end of file diff --git a/wxWidgets/src/expat/bcb5/expatw.mak b/wxWidgets/src/expat/bcb5/expatw.mak deleted file mode 100644 index 97f428f4d2..0000000000 --- a/wxWidgets/src/expat/bcb5/expatw.mak +++ /dev/null @@ -1,187 +0,0 @@ -# --------------------------------------------------------------------------- -!if !$d(BCB) -BCB = $(MAKEDIR)\.. -!endif - -# --------------------------------------------------------------------------- -# IDE SECTION -# --------------------------------------------------------------------------- -# The following section of the project makefile is managed by the BCB IDE. -# It is recommended to use the IDE to change any of the values in this -# section. -# --------------------------------------------------------------------------- - -VERSION = BCB.05.03 -# --------------------------------------------------------------------------- -PROJECT = Release\libexpatw_mtd.dll -OBJFILES = Release\obj\libexpatw\xmlparse.obj Release\obj\libexpatw\xmlrole.obj \ - Release\obj\libexpatw\xmltok.obj -RESFILES = -MAINSOURCE = expatw.bpf -RESDEPEN = $(RESFILES) -LIBFILES = -IDLFILES = -IDLGENFILES = -LIBRARIES = -PACKAGES = VCL50.bpi VCLX50.bpi bcbsmp50.bpi QRPT50.bpi VCLDB50.bpi VCLBDE50.bpi \ - ibsmp50.bpi VCLDBX50.bpi TEEUI50.bpi TEEDB50.bpi TEE50.bpi TEEQR50.bpi \ - VCLIB50.bpi bcbie50.bpi VCLIE50.bpi INETDB50.bpi INET50.bpi NMFAST50.bpi \ - dclocx50.bpi bcb2kaxserver50.bpi dclusr50.bpi -SPARELIBS = -DEFFILE = libexpatw_mtd.def -# --------------------------------------------------------------------------- -PATHCPP = .;..\lib -PATHASM = .; -PATHPAS = .; -PATHRC = .; -DEBUGLIBPATH = $(BCB)\lib\debug -RELEASELIBPATH = $(BCB)\lib\release -USERDEFINES = _WINDOWS;WIN32;NDEBUG;_USRDLL;COMPILED_FROM_DSP;EXPAT_EXPORTS;XML_UNICODE_WCHAR_T -SYSDEFINES = _NO_VCL;_ASSERTE;NO_STRICT;_RTLDLL -INCLUDEPATH = ..\lib;$(BCB)\include -LIBPATH = ..\lib;$(BCB)\lib;$(RELEASELIBPATH) -WARNINGS= -w-rch -w-par -w-8027 -w-8026 -w-ccc -# --------------------------------------------------------------------------- -CFLAG1 = -WD -O2 -X- -a8 -b -k- -vi -q -tWM -c -tWD -IDLCFLAGS = -I$(BCB)\include -PFLAGS = -N2Release\obj\libexpatw -N0Release\obj\libexpatw -$Y- -$L- -$D- -RFLAGS = /l 0x409 /d "NDEBUG" /i$(BCB)\include -AFLAGS = /mx /w2 /zn -LFLAGS = -IRelease\obj\libexpatw -D"" -aa -Tpd -x -Gn -Gi -w -q -# --------------------------------------------------------------------------- -ALLOBJ = c0d32w.obj $(OBJFILES) -ALLRES = $(RESFILES) -ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cw32mti.lib -# --------------------------------------------------------------------------- -!ifdef IDEOPTIONS - -[Version Info] -IncludeVerInfo=0 -AutoIncBuild=0 -MajorVer=1 -MinorVer=0 -Release=0 -Build=0 -Debug=0 -PreRelease=0 -Special=0 -Private=0 -DLL=0 - -[Version Info Keys] -CompanyName= -FileDescription= -FileVersion=1.0.0.0 -InternalName= -LegalCopyright= -LegalTrademarks= -OriginalFilename= -ProductName= -ProductVersion=1.0.0.0 -Comments= - -[Debugging] -DebugSourceDirs=$(BCB)\source\vcl - -!endif - - - - - -# --------------------------------------------------------------------------- -# MAKE SECTION -# --------------------------------------------------------------------------- -# This section of the project file is not used by the BCB IDE. It is for -# the benefit of building from the command-line using the MAKE utility. -# --------------------------------------------------------------------------- - -.autodepend -# --------------------------------------------------------------------------- -!if "$(USERDEFINES)" != "" -AUSERDEFINES = -d$(USERDEFINES:;= -d) -!else -AUSERDEFINES = -!endif - -!if !$d(BCC32) -BCC32 = bcc32 -!endif - -!if !$d(CPP32) -CPP32 = cpp32 -!endif - -!if !$d(DCC32) -DCC32 = dcc32 -!endif - -!if !$d(TASM32) -TASM32 = tasm32 -!endif - -!if !$d(LINKER) -LINKER = ilink32 -!endif - -!if !$d(BRCC32) -BRCC32 = brcc32 -!endif - - -# --------------------------------------------------------------------------- -!if $d(PATHCPP) -.PATH.CPP = $(PATHCPP) -.PATH.C = $(PATHCPP) -!endif - -!if $d(PATHPAS) -.PATH.PAS = $(PATHPAS) -!endif - -!if $d(PATHASM) -.PATH.ASM = $(PATHASM) -!endif - -!if $d(PATHRC) -.PATH.RC = $(PATHRC) -!endif -# --------------------------------------------------------------------------- -$(PROJECT): $(IDLGENFILES) $(OBJFILES) $(RESDEPEN) $(DEFFILE) - $(BCB)\BIN\$(LINKER) @&&! - $(LFLAGS) -L$(LIBPATH) + - $(ALLOBJ), + - $(PROJECT),, + - $(ALLLIB), + - $(DEFFILE), + - $(ALLRES) -! -# --------------------------------------------------------------------------- -.pas.hpp: - $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } - -.pas.obj: - $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } - -.cpp.obj: - $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } - -.c.obj: - $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } - -.c.i: - $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } - -.cpp.i: - $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } - -.asm.obj: - $(BCB)\BIN\$(TASM32) $(AFLAGS) -i$(INCLUDEPATH:;= -i) $(AUSERDEFINES) -d$(SYSDEFINES:;= -d) $<, $@ - -.rc.res: - $(BCB)\BIN\$(BRCC32) $(RFLAGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -fo$@ $< -# --------------------------------------------------------------------------- - - - - diff --git a/wxWidgets/src/expat/bcb5/expatw_static.bpf b/wxWidgets/src/expat/bcb5/expatw_static.bpf deleted file mode 100644 index 5ca458edca..0000000000 --- a/wxWidgets/src/expat/bcb5/expatw_static.bpf +++ /dev/null @@ -1,5 +0,0 @@ -USEUNIT("..\lib\xmlparse.c"); -USEUNIT("..\lib\xmlrole.c"); -USEUNIT("..\lib\xmltok.c"); -//--------------------------------------------------------------------------- -#define Library diff --git a/wxWidgets/src/expat/bcb5/expatw_static.bpr b/wxWidgets/src/expat/bcb5/expatw_static.bpr deleted file mode 100644 index 3f12644b64..0000000000 --- a/wxWidgets/src/expat/bcb5/expatw_static.bpr +++ /dev/null @@ -1,152 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -[Version Info] -IncludeVerInfo=0 -AutoIncBuild=0 -MajorVer=1 -MinorVer=0 -Release=0 -Build=0 -Debug=0 -PreRelease=0 -Special=0 -Private=0 -DLL=0 -Locale=1033 -CodePage=1252 - -[Version Info Keys] -CompanyName= -FileDescription= -FileVersion=1.0.0.0 -InternalName= -LegalCopyright= -LegalTrademarks= -OriginalFilename= -ProductName= -ProductVersion=1.0.0.0 -Comments= - -[HistoryLists\hlIncludePath] -Count=4 -Item0=..\lib;$(BCB)\include -Item1=$(BCB)\include -Item2=$(BCB)\include;$(BCB)\include\mfc;$(BCB)\include\atl -Item3=$(BCB)\include;$(BCB)\include\mfc;$(BCB)\include\atl; - -[HistoryLists\hlLibraryPath] -Count=5 -Item0=..\lib;$(BCB)\lib;$(RELEASELIBPATH) -Item1=..\lib;$(BCB)\lib;..\lib\$(RELEASELIBPATH) -Item2=$(BCB)\lib;$(RELEASELIBPATH) -Item3=$(BCB)\lib;$(RELEASELIBPATH);$(BCB)\lib\psdk -Item4=$(BCB)\lib;$(RELEASELIBPATH);;$(BCB)\lib\psdk; - -[HistoryLists\hlDebugSourcePath] -Count=1 -Item0=$(BCB)\source\vcl - -[HistoryLists\hlConditionals] -Count=15 -Item0=_WINDOWS;WIN32;NDEBUG;_LIB;COMPILED_FROM_DSP;XML_STATIC;XML_UNICODE_WCHAR_T -Item1=_WINDOWS;WIN32;NDEBUG;_DEBUG;_LIB;COMPILED_FROM_DSP;XML_STATIC;XML_UNICODE_WCHAR_T -Item2=WIN32;_WINDOWS;NDEBUG;_DEBUG;_LIB;COMPILED_FROM_DSP;XML_STATIC;XML_UNICODE_WCHAR_T -Item3=WIN32;_WINDOWS;NDEBUG;_DEBUG;_LIB;XML_STATIC;COMPILED_FROM_DSP;XML_UNICODE_WCHAR_T -Item4=WIN32;_WINDOWS;NDEBUG;_LIB;COMPILED_FROM_DSP;_DEBUG;XML_UNICODE_WCHAR_T -Item5=WIN32;_WINDOWS;NDEBUG;_UNICODE;_LIB;COMPILED_FROM_DSP;XML_UNICODE_WCHAR_T;_DEBUG -Item6=WIN32;_WINDOWS;NDEBUG;_UNICODE;_LIB;COMPILED_FROM_DSP;XML_UNICODE_WCHAR_T;_DEBUG;__cplusplus -Item7=WIN32;_WINDOWS;NDEBUG;_UNICODE;_LIB;COMPILED_FROM_DSP;XML_UNICODE;_DEBUG -Item8=WIN32;_WINDOWS;NDEBUG;_MBCS;_LIB;COMPILED_FROM_DSP;XML_UNICODE;_DEBUG -Item9=WIN32;_WINDOWS;NDEBUG;_MBCS;_LIB;COMPILED_FROM_DSP;XML_UNICODE_WCHAR_T;_DEBUG;__WCHAR_T -Item10=WIN32;_WINDOWS;NDEBUG;_MBCS;_LIB;COMPILED_FROM_DSP;XML_UNICODE_WCHAR_T;_DEBUG;_UNICODE -Item11=WIN32;_WINDOWS;NDEBUG;_MBCS;_LIB;COMPILED_FROM_DSP;XML_UNICODE;_DEBUG;_UNICODE -Item12=WIN32;_WINDOWS;NDEBUG;_MBCS;_LIB;COMPILED_FROM_DSP;XML_UNICODE_WCHAR_T;_DEBUG -Item13=WIN32;_WINDOWS;NDEBUG;_MBCS;_LIB;COMPILED_FROM_DSP;XML_UNICODE_WCHAR_T -Item14=WIN32;_WINDOWS;NDEBUG;_MBCS;_LIB;COMPILED_FROM_DSP;XML_UNICODE_WCHAR_T;XML_UNICODE - -[HistoryLists\hlIntOutputDir] -Count=6 -Item0=Release\obj\libexpatw_static -Item1=Release\obj\libexpat_static -Item2=Release\obj\mts -Item3=Release\obj\mt -Item4=..\lib\Release-w_static -Item5=Release-w_static - -[HistoryLists\hlFinalOutputDir] -Count=3 -Item0=Release\ -Item1=Release -Item2=Release-w_static\ - -[HistoryLists\hlTlibPageSize] -Count=1 -Item0=0x0010 - -[Debugging] -DebugSourceDirs= - -[Parameters] -RunParams= -HostApplication= -RemoteHost= -RemotePath= -RemoteDebug=0 - -[Compiler] -ShowInfoMsgs=0 -LinkDebugVcl=0 -LinkCGLIB=0 - -[Language] -ActiveLang= -ProjectLang= -RootDir= - - \ No newline at end of file diff --git a/wxWidgets/src/expat/bcb5/expatw_static.mak b/wxWidgets/src/expat/bcb5/expatw_static.mak deleted file mode 100644 index 16b7e5b90e..0000000000 --- a/wxWidgets/src/expat/bcb5/expatw_static.mak +++ /dev/null @@ -1,190 +0,0 @@ -# --------------------------------------------------------------------------- -!if !$d(BCB) -BCB = $(MAKEDIR)\.. -!endif - -# --------------------------------------------------------------------------- -# IDE SECTION -# --------------------------------------------------------------------------- -# The following section of the project makefile is managed by the BCB IDE. -# It is recommended to use the IDE to change any of the values in this -# section. -# --------------------------------------------------------------------------- - -VERSION = BCB.05.03 -# --------------------------------------------------------------------------- -PROJECT = Release\libexpatws_mtd.lib -OBJFILES = Release\obj\libexpatw_static\xmlparse.obj \ - Release\obj\libexpatw_static\xmlrole.obj \ - Release\obj\libexpatw_static\xmltok.obj -RESFILES = -MAINSOURCE = expatw_static.bpf -RESDEPEN = $(RESFILES) -LIBFILES = -IDLFILES = -IDLGENFILES = -LIBRARIES = -PACKAGES = -SPARELIBS = -DEFFILE = -# --------------------------------------------------------------------------- -PATHCPP = .;..\lib -PATHASM = .; -PATHPAS = .; -PATHRC = .; -LINKER = TLib -DEBUGLIBPATH = $(BCB)\lib\debug -RELEASELIBPATH = $(BCB)\lib\release -USERDEFINES = _WINDOWS;WIN32;NDEBUG;_LIB;COMPILED_FROM_DSP;XML_STATIC;XML_UNICODE_WCHAR_T -SYSDEFINES = _NO_VCL;_ASSERTE;NO_STRICT;_RTLDLL -INCLUDEPATH = ..\lib;$(BCB)\include -LIBPATH = ..\lib;$(BCB)\lib;$(RELEASELIBPATH) -WARNINGS = -w-rch -w-par -w-8027 -w-8026 -w-ccc -LISTFILE = -# --------------------------------------------------------------------------- -CFLAG1 = -O2 -X- -a8 -b -k- -vi -q -tWM -c -IDLCFLAGS = -I$(BCB)\include -PFLAGS = -N2Release\obj\libexpatw_static -N0Release\obj\libexpatw_static -$Y- -$L- \ - -$D- -RFLAGS = /l 0x409 /d "NDEBUG" /i$(BCB)\include -AFLAGS = /mx /w2 /zn -LFLAGS = -# --------------------------------------------------------------------------- -ALLOBJ = $(OBJFILES) -ALLRES = $(RESFILES) -ALLLIB = $(LIBFILES) $(LIBRARIES) -# --------------------------------------------------------------------------- -!ifdef IDEOPTIONS - -[Version Info] -IncludeVerInfo=0 -AutoIncBuild=0 -MajorVer=1 -MinorVer=0 -Release=0 -Build=0 -Debug=0 -PreRelease=0 -Special=0 -Private=0 -DLL=0 - -[Version Info Keys] -CompanyName= -FileDescription= -FileVersion=1.0.0.0 -InternalName= -LegalCopyright= -LegalTrademarks= -OriginalFilename= -ProductName= -ProductVersion=1.0.0.0 -Comments= - -[Debugging] -DebugSourceDirs=$(BCB)\source\vcl - -!endif - - - - - -# --------------------------------------------------------------------------- -# MAKE SECTION -# --------------------------------------------------------------------------- -# This section of the project file is not used by the BCB IDE. It is for -# the benefit of building from the command-line using the MAKE utility. -# --------------------------------------------------------------------------- - -.autodepend -# --------------------------------------------------------------------------- -!if "$(USERDEFINES)" != "" -AUSERDEFINES = -d$(USERDEFINES:;= -d) -!else -AUSERDEFINES = -!endif - -!if !$d(BCC32) -BCC32 = bcc32 -!endif - -!if !$d(CPP32) -CPP32 = cpp32 -!endif - -!if !$d(DCC32) -DCC32 = dcc32 -!endif - -!if !$d(TASM32) -TASM32 = tasm32 -!endif - -!if !$d(LINKER) -LINKER = TLib -!endif - -!if !$d(BRCC32) -BRCC32 = brcc32 -!endif - - -# --------------------------------------------------------------------------- -!if $d(PATHCPP) -.PATH.CPP = $(PATHCPP) -.PATH.C = $(PATHCPP) -!endif - -!if $d(PATHPAS) -.PATH.PAS = $(PATHPAS) -!endif - -!if $d(PATHASM) -.PATH.ASM = $(PATHASM) -!endif - -!if $d(PATHRC) -.PATH.RC = $(PATHRC) -!endif -# --------------------------------------------------------------------------- -!if "$(LISTFILE)" == "" -COMMA = -!else -COMMA = , -!endif - -$(PROJECT): $(IDLGENFILES) $(OBJFILES) $(RESDEPEN) $(DEFFILE) - $(BCB)\BIN\$(LINKER) /u $@ @&&! - $(LFLAGS) $? $(COMMA) $(LISTFILE) - -! -# --------------------------------------------------------------------------- -.pas.hpp: - $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } - -.pas.obj: - $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } - -.cpp.obj: - $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } - -.c.obj: - $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } - -.c.i: - $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } - -.cpp.i: - $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } - -.asm.obj: - $(BCB)\BIN\$(TASM32) $(AFLAGS) -i$(INCLUDEPATH:;= -i) $(AUSERDEFINES) -d$(SYSDEFINES:;= -d) $<, $@ - -.rc.res: - $(BCB)\BIN\$(BRCC32) $(RFLAGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -fo$@ $< -# --------------------------------------------------------------------------- - - - - diff --git a/wxWidgets/src/expat/bcb5/libexpat_mtd.def b/wxWidgets/src/expat/bcb5/libexpat_mtd.def deleted file mode 100644 index 35ebd6b97b..0000000000 --- a/wxWidgets/src/expat/bcb5/libexpat_mtd.def +++ /dev/null @@ -1,133 +0,0 @@ -; DEF file for BCB5 -LIBRARY LIBEXPAT_MTD -DESCRIPTION "Implements an XML parser." -EXPORTS - _XML_DefaultCurrent @1 - _XML_ErrorString @2 - _XML_ExpatVersion @3 - _XML_ExpatVersionInfo @4 - _XML_ExternalEntityParserCreate @5 - _XML_GetBase @6 - _XML_GetBuffer @7 - _XML_GetCurrentByteCount @8 - _XML_GetCurrentByteIndex @9 - _XML_GetCurrentColumnNumber @10 - _XML_GetCurrentLineNumber @11 - _XML_GetErrorCode @12 - _XML_GetIdAttributeIndex @13 - _XML_GetInputContext @14 - _XML_GetSpecifiedAttributeCount @15 - _XML_Parse @16 - _XML_ParseBuffer @17 - _XML_ParserCreate @18 - _XML_ParserCreateNS @19 - _XML_ParserCreate_MM @20 - _XML_ParserFree @21 - _XML_SetAttlistDeclHandler @22 - _XML_SetBase @23 - _XML_SetCdataSectionHandler @24 - _XML_SetCharacterDataHandler @25 - _XML_SetCommentHandler @26 - _XML_SetDefaultHandler @27 - _XML_SetDefaultHandlerExpand @28 - _XML_SetDoctypeDeclHandler @29 - _XML_SetElementDeclHandler @30 - _XML_SetElementHandler @31 - _XML_SetEncoding @32 - _XML_SetEndCdataSectionHandler @33 - _XML_SetEndDoctypeDeclHandler @34 - _XML_SetEndElementHandler @35 - _XML_SetEndNamespaceDeclHandler @36 - _XML_SetEntityDeclHandler @37 - _XML_SetExternalEntityRefHandler @38 - _XML_SetExternalEntityRefHandlerArg @39 - _XML_SetNamespaceDeclHandler @40 - _XML_SetNotStandaloneHandler @41 - _XML_SetNotationDeclHandler @42 - _XML_SetParamEntityParsing @43 - _XML_SetProcessingInstructionHandler @44 - _XML_SetReturnNSTriplet @45 - _XML_SetStartCdataSectionHandler @46 - _XML_SetStartDoctypeDeclHandler @47 - _XML_SetStartElementHandler @48 - _XML_SetStartNamespaceDeclHandler @49 - _XML_SetUnknownEncodingHandler @50 - _XML_SetUnparsedEntityDeclHandler @51 - _XML_SetUserData @52 - _XML_SetXmlDeclHandler @53 - _XML_UseParserAsHandlerArg @54 -; added with version 1.95.3 - _XML_ParserReset @55 - _XML_SetSkippedEntityHandler @56 -; added with version 1.95.5 - _XML_GetFeatureList @57 - _XML_UseForeignDTD @58 -; added with version 1.95.6 - _XML_FreeContentModel @59 - _XML_MemMalloc @60 - _XML_MemRealloc @61 - _XML_MemFree @62 - -; Aliases for MS compatible names - XML_DefaultCurrent = _XML_DefaultCurrent - XML_ErrorString = _XML_ErrorString - XML_ExpatVersion = _XML_ExpatVersion - XML_ExpatVersionInfo = _XML_ExpatVersionInfo - XML_ExternalEntityParserCreate = _XML_ExternalEntityParserCreate - XML_GetBase = _XML_GetBase - XML_GetBuffer = _XML_GetBuffer - XML_GetCurrentByteCount = _XML_GetCurrentByteCount - XML_GetCurrentByteIndex = _XML_GetCurrentByteIndex - XML_GetCurrentColumnNumber = _XML_GetCurrentColumnNumber - XML_GetCurrentLineNumber = _XML_GetCurrentLineNumber - XML_GetErrorCode = _XML_GetErrorCode - XML_GetIdAttributeIndex = _XML_GetIdAttributeIndex - XML_GetInputContext = _XML_GetInputContext - XML_GetSpecifiedAttributeCount = _XML_GetSpecifiedAttributeCount - XML_Parse = _XML_Parse - XML_ParseBuffer = _XML_ParseBuffer - XML_ParserCreate = _XML_ParserCreate - XML_ParserCreateNS = _XML_ParserCreateNS - XML_ParserCreate_MM = _XML_ParserCreate_MM - XML_ParserFree = _XML_ParserFree - XML_SetAttlistDeclHandler = _XML_SetAttlistDeclHandler - XML_SetBase = _XML_SetBase - XML_SetCdataSectionHandler = _XML_SetCdataSectionHandler - XML_SetCharacterDataHandler = _XML_SetCharacterDataHandler - XML_SetCommentHandler = _XML_SetCommentHandler - XML_SetDefaultHandler = _XML_SetDefaultHandler - XML_SetDefaultHandlerExpand = _XML_SetDefaultHandlerExpand - XML_SetDoctypeDeclHandler = _XML_SetDoctypeDeclHandler - XML_SetElementDeclHandler = _XML_SetElementDeclHandler - XML_SetElementHandler = _XML_SetElementHandler - XML_SetEncoding = _XML_SetEncoding - XML_SetEndCdataSectionHandler = _XML_SetEndCdataSectionHandler - XML_SetEndDoctypeDeclHandler = _XML_SetEndDoctypeDeclHandler - XML_SetEndElementHandler = _XML_SetEndElementHandler - XML_SetEndNamespaceDeclHandler = _XML_SetEndNamespaceDeclHandler - XML_SetEntityDeclHandler = _XML_SetEntityDeclHandler - XML_SetExternalEntityRefHandler = _XML_SetExternalEntityRefHandler - XML_SetExternalEntityRefHandlerArg = _XML_SetExternalEntityRefHandlerArg - XML_SetNamespaceDeclHandler = _XML_SetNamespaceDeclHandler - XML_SetNotStandaloneHandler = _XML_SetNotStandaloneHandler - XML_SetNotationDeclHandler = _XML_SetNotationDeclHandler - XML_SetParamEntityParsing = _XML_SetParamEntityParsing - XML_SetProcessingInstructionHandler = _XML_SetProcessingInstructionHandler - XML_SetReturnNSTriplet = _XML_SetReturnNSTriplet - XML_SetStartCdataSectionHandler = _XML_SetStartCdataSectionHandler - XML_SetStartDoctypeDeclHandler = _XML_SetStartDoctypeDeclHandler - XML_SetStartElementHandler = _XML_SetStartElementHandler - XML_SetStartNamespaceDeclHandler = _XML_SetStartNamespaceDeclHandler - XML_SetUnknownEncodingHandler = _XML_SetUnknownEncodingHandler - XML_SetUnparsedEntityDeclHandler = _XML_SetUnparsedEntityDeclHandler - XML_SetUserData = _XML_SetUserData - XML_SetXmlDeclHandler = _XML_SetXmlDeclHandler - XML_UseParserAsHandlerArg = _XML_UseParserAsHandlerArg - XML_ParserReset = _XML_ParserReset - XML_SetSkippedEntityHandler = _XML_SetSkippedEntityHandler - XML_GetFeatureList = _XML_GetFeatureList - XML_UseForeignDTD = _XML_UseForeignDTD - XML_FreeContentModel = _XML_FreeContentModel - XML_MemMalloc = _XML_MemMalloc - XML_MemRealloc = _XML_MemRealloc - XML_MemFree = _XML_MemFree diff --git a/wxWidgets/src/expat/bcb5/libexpatw_mtd.def b/wxWidgets/src/expat/bcb5/libexpatw_mtd.def deleted file mode 100644 index bcb2650743..0000000000 --- a/wxWidgets/src/expat/bcb5/libexpatw_mtd.def +++ /dev/null @@ -1,133 +0,0 @@ -; DEF file for BCB5 -LIBRARY LIBEXPATW_MTD -DESCRIPTION "Implements an XML parser." -EXPORTS - _XML_DefaultCurrent @1 - _XML_ErrorString @2 - _XML_ExpatVersion @3 - _XML_ExpatVersionInfo @4 - _XML_ExternalEntityParserCreate @5 - _XML_GetBase @6 - _XML_GetBuffer @7 - _XML_GetCurrentByteCount @8 - _XML_GetCurrentByteIndex @9 - _XML_GetCurrentColumnNumber @10 - _XML_GetCurrentLineNumber @11 - _XML_GetErrorCode @12 - _XML_GetIdAttributeIndex @13 - _XML_GetInputContext @14 - _XML_GetSpecifiedAttributeCount @15 - _XML_Parse @16 - _XML_ParseBuffer @17 - _XML_ParserCreate @18 - _XML_ParserCreateNS @19 - _XML_ParserCreate_MM @20 - _XML_ParserFree @21 - _XML_SetAttlistDeclHandler @22 - _XML_SetBase @23 - _XML_SetCdataSectionHandler @24 - _XML_SetCharacterDataHandler @25 - _XML_SetCommentHandler @26 - _XML_SetDefaultHandler @27 - _XML_SetDefaultHandlerExpand @28 - _XML_SetDoctypeDeclHandler @29 - _XML_SetElementDeclHandler @30 - _XML_SetElementHandler @31 - _XML_SetEncoding @32 - _XML_SetEndCdataSectionHandler @33 - _XML_SetEndDoctypeDeclHandler @34 - _XML_SetEndElementHandler @35 - _XML_SetEndNamespaceDeclHandler @36 - _XML_SetEntityDeclHandler @37 - _XML_SetExternalEntityRefHandler @38 - _XML_SetExternalEntityRefHandlerArg @39 - _XML_SetNamespaceDeclHandler @40 - _XML_SetNotStandaloneHandler @41 - _XML_SetNotationDeclHandler @42 - _XML_SetParamEntityParsing @43 - _XML_SetProcessingInstructionHandler @44 - _XML_SetReturnNSTriplet @45 - _XML_SetStartCdataSectionHandler @46 - _XML_SetStartDoctypeDeclHandler @47 - _XML_SetStartElementHandler @48 - _XML_SetStartNamespaceDeclHandler @49 - _XML_SetUnknownEncodingHandler @50 - _XML_SetUnparsedEntityDeclHandler @51 - _XML_SetUserData @52 - _XML_SetXmlDeclHandler @53 - _XML_UseParserAsHandlerArg @54 -; added with version 1.95.3 - _XML_ParserReset @55 - _XML_SetSkippedEntityHandler @56 -; added with version 1.95.5 - _XML_GetFeatureList @57 - _XML_UseForeignDTD @58 -; added with version 1.95.6 - _XML_FreeContentModel @59 - _XML_MemMalloc @60 - _XML_MemRealloc @61 - _XML_MemFree @62 - -; Aliases for MS compatible names - XML_DefaultCurrent = _XML_DefaultCurrent - XML_ErrorString = _XML_ErrorString - XML_ExpatVersion = _XML_ExpatVersion - XML_ExpatVersionInfo = _XML_ExpatVersionInfo - XML_ExternalEntityParserCreate = _XML_ExternalEntityParserCreate - XML_GetBase = _XML_GetBase - XML_GetBuffer = _XML_GetBuffer - XML_GetCurrentByteCount = _XML_GetCurrentByteCount - XML_GetCurrentByteIndex = _XML_GetCurrentByteIndex - XML_GetCurrentColumnNumber = _XML_GetCurrentColumnNumber - XML_GetCurrentLineNumber = _XML_GetCurrentLineNumber - XML_GetErrorCode = _XML_GetErrorCode - XML_GetIdAttributeIndex = _XML_GetIdAttributeIndex - XML_GetInputContext = _XML_GetInputContext - XML_GetSpecifiedAttributeCount = _XML_GetSpecifiedAttributeCount - XML_Parse = _XML_Parse - XML_ParseBuffer = _XML_ParseBuffer - XML_ParserCreate = _XML_ParserCreate - XML_ParserCreateNS = _XML_ParserCreateNS - XML_ParserCreate_MM = _XML_ParserCreate_MM - XML_ParserFree = _XML_ParserFree - XML_SetAttlistDeclHandler = _XML_SetAttlistDeclHandler - XML_SetBase = _XML_SetBase - XML_SetCdataSectionHandler = _XML_SetCdataSectionHandler - XML_SetCharacterDataHandler = _XML_SetCharacterDataHandler - XML_SetCommentHandler = _XML_SetCommentHandler - XML_SetDefaultHandler = _XML_SetDefaultHandler - XML_SetDefaultHandlerExpand = _XML_SetDefaultHandlerExpand - XML_SetDoctypeDeclHandler = _XML_SetDoctypeDeclHandler - XML_SetElementDeclHandler = _XML_SetElementDeclHandler - XML_SetElementHandler = _XML_SetElementHandler - XML_SetEncoding = _XML_SetEncoding - XML_SetEndCdataSectionHandler = _XML_SetEndCdataSectionHandler - XML_SetEndDoctypeDeclHandler = _XML_SetEndDoctypeDeclHandler - XML_SetEndElementHandler = _XML_SetEndElementHandler - XML_SetEndNamespaceDeclHandler = _XML_SetEndNamespaceDeclHandler - XML_SetEntityDeclHandler = _XML_SetEntityDeclHandler - XML_SetExternalEntityRefHandler = _XML_SetExternalEntityRefHandler - XML_SetExternalEntityRefHandlerArg = _XML_SetExternalEntityRefHandlerArg - XML_SetNamespaceDeclHandler = _XML_SetNamespaceDeclHandler - XML_SetNotStandaloneHandler = _XML_SetNotStandaloneHandler - XML_SetNotationDeclHandler = _XML_SetNotationDeclHandler - XML_SetParamEntityParsing = _XML_SetParamEntityParsing - XML_SetProcessingInstructionHandler = _XML_SetProcessingInstructionHandler - XML_SetReturnNSTriplet = _XML_SetReturnNSTriplet - XML_SetStartCdataSectionHandler = _XML_SetStartCdataSectionHandler - XML_SetStartDoctypeDeclHandler = _XML_SetStartDoctypeDeclHandler - XML_SetStartElementHandler = _XML_SetStartElementHandler - XML_SetStartNamespaceDeclHandler = _XML_SetStartNamespaceDeclHandler - XML_SetUnknownEncodingHandler = _XML_SetUnknownEncodingHandler - XML_SetUnparsedEntityDeclHandler = _XML_SetUnparsedEntityDeclHandler - XML_SetUserData = _XML_SetUserData - XML_SetXmlDeclHandler = _XML_SetXmlDeclHandler - XML_UseParserAsHandlerArg = _XML_UseParserAsHandlerArg - XML_ParserReset = _XML_ParserReset - XML_SetSkippedEntityHandler = _XML_SetSkippedEntityHandler - XML_GetFeatureList = _XML_GetFeatureList - XML_UseForeignDTD = _XML_UseForeignDTD - XML_FreeContentModel = _XML_FreeContentModel - XML_MemMalloc = _XML_MemMalloc - XML_MemRealloc = _XML_MemRealloc - XML_MemFree = _XML_MemFree diff --git a/wxWidgets/src/expat/bcb5/makefile.mak b/wxWidgets/src/expat/bcb5/makefile.mak deleted file mode 100644 index 548815eafe..0000000000 --- a/wxWidgets/src/expat/bcb5/makefile.mak +++ /dev/null @@ -1,37 +0,0 @@ -all: setup expat expatw expat_static expatw_static elements outline xmlwf - -setup: - setup - -expat: - make -l -fexpat.mak - -expatw: - make -l -fexpatw.mak - -expat_static: - make -l -fexpat_static.mak - -expatw_static: - make -l -fexpatw_static.mak - -elements: - make -l -felements.mak - -outline: - make -l -foutline.mak - -xmlwf: - make -l -fxmlwf.mak - -clean: -# works on Win98/ME -# deltree /y release\obj -# works on WinNT/2000 - del /s/f/q release\obj - -distclean: -# works on Win98/ME -# deltree /y release\*.* -# works on WinNT/2000 - del /s/f/q release\* diff --git a/wxWidgets/src/expat/bcb5/outline.bpf b/wxWidgets/src/expat/bcb5/outline.bpf deleted file mode 100644 index 52dce83016..0000000000 --- a/wxWidgets/src/expat/bcb5/outline.bpf +++ /dev/null @@ -1,4 +0,0 @@ -USEUNIT("..\examples\outline.c"); -USELIB("Release\libexpat_mtd.lib"); -//--------------------------------------------------------------------------- -main diff --git a/wxWidgets/src/expat/bcb5/outline.bpr b/wxWidgets/src/expat/bcb5/outline.bpr deleted file mode 100644 index e0ae5cdeeb..0000000000 --- a/wxWidgets/src/expat/bcb5/outline.bpr +++ /dev/null @@ -1,132 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -[Version Info] -IncludeVerInfo=0 -AutoIncBuild=0 -MajorVer=1 -MinorVer=0 -Release=0 -Build=0 -Debug=0 -PreRelease=0 -Special=0 -Private=0 -DLL=0 -Locale=1033 -CodePage=1252 - -[Version Info Keys] -CompanyName= -FileDescription= -FileVersion=1.0.0.0 -InternalName= -LegalCopyright= -LegalTrademarks= -OriginalFilename= -ProductName= -ProductVersion=1.0.0.0 -Comments= - -[HistoryLists\hlIncludePath] -Count=3 -Item0=..\examples;$(BCB)\include -Item1=$(BCB)\include -Item2=$(BCB)\include;$(BCB)\include\mfc;$(BCB)\include\atl; - -[HistoryLists\hlLibraryPath] -Count=4 -Item0=..\examples;$(BCB)\lib;$(RELEASELIBPATH) -Item1=..\examples;$(BCB)\lib;..\examples\$(RELEASELIBPATH) -Item2=$(BCB)\lib;$(RELEASELIBPATH) -Item3=$(BCB)\lib;$(RELEASELIBPATH);;$(BCB)\lib\psdk; - -[HistoryLists\hlDebugSourcePath] -Count=1 -Item0=$(BCB)\source\vcl - -[HistoryLists\hlConditionals] -Count=6 -Item0=WIN32;NDEBUG;_CONSOLE -Item1=WIN32;NDEBUG;_CONSOLE;XML_STATIC -Item2=WIN32;NDEBUG;_CONSOLE;_DEBUG;XML_STATIC -Item3=WIN32;NDEBUG;_CONSOLE;_DEBUG;XML_UNICODE_WCHAR_T;_UNICODE;XML_STATIC -Item4=WIN32;NDEBUG;_CONSOLE;_DEBUG;XML_UNICODE_WCHAR_T;_UNICODE -Item5=WIN32;NDEBUG;_CONSOLE;_DEBUG - -[HistoryLists\hlIntOutputDir] -Count=4 -Item0=Release\obj\examples -Item1=Release\obj\outline -Item2=..\examples\Release -Item3=Release - -[HistoryLists\hlFinalOutputDir] -Count=1 -Item0=Release\ - -[Debugging] -DebugSourceDirs= - -[Parameters] -RunParams= -HostApplication= -RemoteHost= -RemotePath= -RemoteDebug=0 - -[Compiler] -ShowInfoMsgs=0 -LinkDebugVcl=0 -LinkCGLIB=0 - -[Language] -ActiveLang= -ProjectLang= -RootDir= - - \ No newline at end of file diff --git a/wxWidgets/src/expat/bcb5/outline.mak b/wxWidgets/src/expat/bcb5/outline.mak deleted file mode 100644 index 510b541f64..0000000000 --- a/wxWidgets/src/expat/bcb5/outline.mak +++ /dev/null @@ -1,186 +0,0 @@ -# --------------------------------------------------------------------------- -!if !$d(BCB) -BCB = $(MAKEDIR)\.. -!endif - -# --------------------------------------------------------------------------- -# IDE SECTION -# --------------------------------------------------------------------------- -# The following section of the project makefile is managed by the BCB IDE. -# It is recommended to use the IDE to change any of the values in this -# section. -# --------------------------------------------------------------------------- - -VERSION = BCB.05.03 -# --------------------------------------------------------------------------- -PROJECT = Release\outline.exe -OBJFILES = Release\obj\examples\outline.obj -RESFILES = -MAINSOURCE = outline.bpf -RESDEPEN = $(RESFILES) -LIBFILES = Release\libexpat_mtd.lib -IDLFILES = -IDLGENFILES = -LIBRARIES = -PACKAGES = VCL50.bpi VCLX50.bpi bcbsmp50.bpi QRPT50.bpi VCLDB50.bpi VCLBDE50.bpi \ - ibsmp50.bpi VCLDBX50.bpi TEEUI50.bpi TEEDB50.bpi TEE50.bpi TEEQR50.bpi \ - VCLIB50.bpi bcbie50.bpi VCLIE50.bpi INETDB50.bpi INET50.bpi NMFAST50.bpi \ - dclocx50.bpi bcb2kaxserver50.bpi dclusr50.bpi -SPARELIBS = -DEFFILE = -# --------------------------------------------------------------------------- -PATHCPP = .;..\examples -PATHASM = .; -PATHPAS = .; -PATHRC = .; -DEBUGLIBPATH = $(BCB)\lib\debug -RELEASELIBPATH = $(BCB)\lib\release -USERDEFINES = WIN32;NDEBUG;_CONSOLE -SYSDEFINES = _NO_VCL;_ASSERTE;NO_STRICT;_RTLDLL -INCLUDEPATH = ..\examples;$(BCB)\include -LIBPATH = ..\examples;$(BCB)\lib;$(RELEASELIBPATH) -WARNINGS= -w-par -w-8027 -w-8026 -# --------------------------------------------------------------------------- -CFLAG1 = -O2 -X- -a8 -b -k- -vi -q -tWM -I..\lib -c -IDLCFLAGS = -I$(BCB)\include -PFLAGS = -N2Release\obj\examples -N0Release\obj\examples -$Y- -$L- -$D- -RFLAGS = /l 0x409 /d "NDEBUG" /i$(BCB)\include -AFLAGS = /mx /w2 /zn -LFLAGS = -IRelease\obj\examples -D"" -ap -Tpe -x -Gn -q -# --------------------------------------------------------------------------- -ALLOBJ = c0x32.obj $(OBJFILES) -ALLRES = $(RESFILES) -ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cw32mti.lib -# --------------------------------------------------------------------------- -!ifdef IDEOPTIONS - -[Version Info] -IncludeVerInfo=0 -AutoIncBuild=0 -MajorVer=1 -MinorVer=0 -Release=0 -Build=0 -Debug=0 -PreRelease=0 -Special=0 -Private=0 -DLL=0 - -[Version Info Keys] -CompanyName= -FileDescription= -FileVersion=1.0.0.0 -InternalName= -LegalCopyright= -LegalTrademarks= -OriginalFilename= -ProductName= -ProductVersion=1.0.0.0 -Comments= - -[Debugging] -DebugSourceDirs=$(BCB)\source\vcl - -!endif - - - - - -# --------------------------------------------------------------------------- -# MAKE SECTION -# --------------------------------------------------------------------------- -# This section of the project file is not used by the BCB IDE. It is for -# the benefit of building from the command-line using the MAKE utility. -# --------------------------------------------------------------------------- - -.autodepend -# --------------------------------------------------------------------------- -!if "$(USERDEFINES)" != "" -AUSERDEFINES = -d$(USERDEFINES:;= -d) -!else -AUSERDEFINES = -!endif - -!if !$d(BCC32) -BCC32 = bcc32 -!endif - -!if !$d(CPP32) -CPP32 = cpp32 -!endif - -!if !$d(DCC32) -DCC32 = dcc32 -!endif - -!if !$d(TASM32) -TASM32 = tasm32 -!endif - -!if !$d(LINKER) -LINKER = ilink32 -!endif - -!if !$d(BRCC32) -BRCC32 = brcc32 -!endif - - -# --------------------------------------------------------------------------- -!if $d(PATHCPP) -.PATH.CPP = $(PATHCPP) -.PATH.C = $(PATHCPP) -!endif - -!if $d(PATHPAS) -.PATH.PAS = $(PATHPAS) -!endif - -!if $d(PATHASM) -.PATH.ASM = $(PATHASM) -!endif - -!if $d(PATHRC) -.PATH.RC = $(PATHRC) -!endif -# --------------------------------------------------------------------------- -$(PROJECT): $(IDLGENFILES) $(OBJFILES) $(RESDEPEN) $(DEFFILE) - $(BCB)\BIN\$(LINKER) @&&! - $(LFLAGS) -L$(LIBPATH) + - $(ALLOBJ), + - $(PROJECT),, + - $(ALLLIB), + - $(DEFFILE), + - $(ALLRES) -! -# --------------------------------------------------------------------------- -.pas.hpp: - $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } - -.pas.obj: - $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } - -.cpp.obj: - $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } - -.c.obj: - $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } - -.c.i: - $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } - -.cpp.i: - $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } - -.asm.obj: - $(BCB)\BIN\$(TASM32) $(AFLAGS) -i$(INCLUDEPATH:;= -i) $(AUSERDEFINES) -d$(SYSDEFINES:;= -d) $<, $@ - -.rc.res: - $(BCB)\BIN\$(BRCC32) $(RFLAGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -fo$@ $< -# --------------------------------------------------------------------------- - - - - diff --git a/wxWidgets/src/expat/bcb5/setup.bat b/wxWidgets/src/expat/bcb5/setup.bat deleted file mode 100644 index 6f4b573179..0000000000 --- a/wxWidgets/src/expat/bcb5/setup.bat +++ /dev/null @@ -1,9 +0,0 @@ -REM CommandInterpreter: $(COMSPEC) -if not exist .\release\nul mkdir release -if not exist .\release\obj\nul mkdir release\obj -if not exist .\release\obj\libexpat\nul mkdir release\obj\libexpat -if not exist .\release\obj\libexpatw\nul mkdir release\obj\libexpatw -if not exist .\release\obj\libexpat_static\nul mkdir release\obj\libexpat_static -if not exist .\release\obj\libexpatw_static\nul mkdir release\obj\libexpatw_static -if not exist .\release\obj\examples\nul mkdir release\obj\examples -if not exist .\release\obj\xmlwf\nul mkdir release\obj\xmlwf diff --git a/wxWidgets/src/expat/bcb5/xmlwf.bpf b/wxWidgets/src/expat/bcb5/xmlwf.bpf deleted file mode 100644 index d06208e811..0000000000 --- a/wxWidgets/src/expat/bcb5/xmlwf.bpf +++ /dev/null @@ -1,7 +0,0 @@ -USEUNIT("..\xmlwf\codepage.c"); -USEUNIT("..\xmlwf\win32filemap.c"); -USEUNIT("..\xmlwf\xmlfile.c"); -USEUNIT("..\xmlwf\xmlwf.c"); -USELIB("Release\libexpat_mtd.lib"); -//--------------------------------------------------------------------------- -main diff --git a/wxWidgets/src/expat/bcb5/xmlwf.bpr b/wxWidgets/src/expat/bcb5/xmlwf.bpr deleted file mode 100644 index d33a153876..0000000000 --- a/wxWidgets/src/expat/bcb5/xmlwf.bpr +++ /dev/null @@ -1,136 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -[Version Info] -IncludeVerInfo=0 -AutoIncBuild=0 -MajorVer=1 -MinorVer=0 -Release=0 -Build=0 -Debug=0 -PreRelease=0 -Special=0 -Private=0 -DLL=0 -Locale=1033 -CodePage=1252 - -[Version Info Keys] -CompanyName= -FileDescription= -FileVersion=1.0.0.0 -InternalName= -LegalCopyright= -LegalTrademarks= -OriginalFilename= -ProductName= -ProductVersion=1.0.0.0 -Comments= - -[HistoryLists\hlIncludePath] -Count=4 -Item0=..\xmlwf;$(BCB)\include -Item1=$(BCB)\include -Item2=$(BCB)\include;$(BCB)\include\mfc;$(BCB)\include\atl -Item3=$(BCB)\include;$(BCB)\include\mfc;$(BCB)\include\atl; - -[HistoryLists\hlLibraryPath] -Count=5 -Item0=..\xmlwf;$(BCB)\lib;$(RELEASELIBPATH) -Item1=..\xmlwf;$(BCB)\lib;..\xmlwf\$(RELEASELIBPATH) -Item2=$(BCB)\lib;$(RELEASELIBPATH) -Item3=$(BCB)\lib;$(RELEASELIBPATH);$(BCB)\lib\psdk -Item4=$(BCB)\lib;$(RELEASELIBPATH);;$(BCB)\lib\psdk; - -[HistoryLists\hlDebugSourcePath] -Count=1 -Item0=$(BCB)\source\vcl - -[HistoryLists\hlConditionals] -Count=6 -Item0=NDEBUG;WIN32;_CONSOLE;COMPILED_FROM_DSP -Item1=NDEBUG;WIN32;_CONSOLE;COMPILED_FROM_DSP;_DEBUG;XML_UNICODE_WCHAR_T;_UNICODE -Item2=NDEBUG;WIN32;_CONSOLE;COMPILED_FROM_DSP;_DEBUG;XML_UNICODE_WCHAR_T -Item3=NDEBUG;WIN32;_CONSOLE;COMPILED_FROM_DSP;_DEBUG -Item4=NDEBUG;WIN32;_CONSOLE;COMPILED_FROM_DSP;_DEBUG;_UNICODE;XML_UNICODE_WCHAR_T -Item5=NDEBUG;WIN32;_CONSOLE;COMPILED_FROM_DSP;_DEBUG;_UNICODE - -[HistoryLists\hlIntOutputDir] -Count=3 -Item0=Release\obj\xmlwf -Item1=..\xmlwf\Release -Item2=Release - -[HistoryLists\hlFinalOutputDir] -Count=3 -Item0=Release\ -Item1=Release -Item2=.\Release\ - -[Debugging] -DebugSourceDirs= - -[Parameters] -RunParams=sample.xml -HostApplication= -RemoteHost= -RemotePath= -RemoteDebug=0 - -[Compiler] -ShowInfoMsgs=0 -LinkDebugVcl=0 -LinkCGLIB=0 - -[Language] -ActiveLang= -ProjectLang= -RootDir= - - \ No newline at end of file diff --git a/wxWidgets/src/expat/bcb5/xmlwf.mak b/wxWidgets/src/expat/bcb5/xmlwf.mak deleted file mode 100644 index f74126e454..0000000000 --- a/wxWidgets/src/expat/bcb5/xmlwf.mak +++ /dev/null @@ -1,187 +0,0 @@ -# --------------------------------------------------------------------------- -!if !$d(BCB) -BCB = $(MAKEDIR)\.. -!endif - -# --------------------------------------------------------------------------- -# IDE SECTION -# --------------------------------------------------------------------------- -# The following section of the project makefile is managed by the BCB IDE. -# It is recommended to use the IDE to change any of the values in this -# section. -# --------------------------------------------------------------------------- - -VERSION = BCB.05.03 -# --------------------------------------------------------------------------- -PROJECT = Release\xmlwf.exe -OBJFILES = Release\obj\xmlwf\codepage.obj Release\obj\xmlwf\win32filemap.obj \ - Release\obj\xmlwf\xmlfile.obj Release\obj\xmlwf\xmlwf.obj -RESFILES = -MAINSOURCE = xmlwf.bpf -RESDEPEN = $(RESFILES) -LIBFILES = Release\libexpat_mtd.lib -IDLFILES = -IDLGENFILES = -LIBRARIES = -PACKAGES = VCL50.bpi VCLX50.bpi bcbsmp50.bpi QRPT50.bpi VCLDB50.bpi VCLBDE50.bpi \ - ibsmp50.bpi VCLDBX50.bpi TEEUI50.bpi TEEDB50.bpi TEE50.bpi TEEQR50.bpi \ - VCLIB50.bpi bcbie50.bpi VCLIE50.bpi INETDB50.bpi INET50.bpi NMFAST50.bpi \ - dclocx50.bpi bcb2kaxserver50.bpi dclusr50.bpi -SPARELIBS = -DEFFILE = -# --------------------------------------------------------------------------- -PATHCPP = .;..\xmlwf -PATHASM = .; -PATHPAS = .; -PATHRC = .; -DEBUGLIBPATH = $(BCB)\lib\debug -RELEASELIBPATH = $(BCB)\lib\release -USERDEFINES = NDEBUG;WIN32;_CONSOLE;COMPILED_FROM_DSP -SYSDEFINES = _NO_VCL;_ASSERTE;NO_STRICT;_RTLDLL -INCLUDEPATH = ..\xmlwf;$(BCB)\include -LIBPATH = ..\xmlwf;$(BCB)\lib;$(RELEASELIBPATH) -WARNINGS= -w-8065 -w-par -w-8027 -w-8026 -# --------------------------------------------------------------------------- -CFLAG1 = -O2 -X- -a8 -b -k- -vi -q -tWM -I..\lib -c -IDLCFLAGS = -I$(BCB)\include -PFLAGS = -N2Release\obj\xmlwf -N0Release\obj\xmlwf -$Y- -$L- -$D- -RFLAGS = /l 0x409 /d "NDEBUG" /i$(BCB)\include -AFLAGS = /mx /w2 /zn -LFLAGS = -IRelease\obj\xmlwf -D"" -ap -Tpe -x -Gn -q -# --------------------------------------------------------------------------- -ALLOBJ = c0x32.obj $(OBJFILES) -ALLRES = $(RESFILES) -ALLLIB = $(LIBFILES) $(LIBRARIES) import32.lib cw32mti.lib -# --------------------------------------------------------------------------- -!ifdef IDEOPTIONS - -[Version Info] -IncludeVerInfo=0 -AutoIncBuild=0 -MajorVer=1 -MinorVer=0 -Release=0 -Build=0 -Debug=0 -PreRelease=0 -Special=0 -Private=0 -DLL=0 - -[Version Info Keys] -CompanyName= -FileDescription= -FileVersion=1.0.0.0 -InternalName= -LegalCopyright= -LegalTrademarks= -OriginalFilename= -ProductName= -ProductVersion=1.0.0.0 -Comments= - -[Debugging] -DebugSourceDirs=$(BCB)\source\vcl - -!endif - - - - - -# --------------------------------------------------------------------------- -# MAKE SECTION -# --------------------------------------------------------------------------- -# This section of the project file is not used by the BCB IDE. It is for -# the benefit of building from the command-line using the MAKE utility. -# --------------------------------------------------------------------------- - -.autodepend -# --------------------------------------------------------------------------- -!if "$(USERDEFINES)" != "" -AUSERDEFINES = -d$(USERDEFINES:;= -d) -!else -AUSERDEFINES = -!endif - -!if !$d(BCC32) -BCC32 = bcc32 -!endif - -!if !$d(CPP32) -CPP32 = cpp32 -!endif - -!if !$d(DCC32) -DCC32 = dcc32 -!endif - -!if !$d(TASM32) -TASM32 = tasm32 -!endif - -!if !$d(LINKER) -LINKER = ilink32 -!endif - -!if !$d(BRCC32) -BRCC32 = brcc32 -!endif - - -# --------------------------------------------------------------------------- -!if $d(PATHCPP) -.PATH.CPP = $(PATHCPP) -.PATH.C = $(PATHCPP) -!endif - -!if $d(PATHPAS) -.PATH.PAS = $(PATHPAS) -!endif - -!if $d(PATHASM) -.PATH.ASM = $(PATHASM) -!endif - -!if $d(PATHRC) -.PATH.RC = $(PATHRC) -!endif -# --------------------------------------------------------------------------- -$(PROJECT): $(IDLGENFILES) $(OBJFILES) $(RESDEPEN) $(DEFFILE) - $(BCB)\BIN\$(LINKER) @&&! - $(LFLAGS) -L$(LIBPATH) + - $(ALLOBJ), + - $(PROJECT),, + - $(ALLLIB), + - $(DEFFILE), + - $(ALLRES) -! -# --------------------------------------------------------------------------- -.pas.hpp: - $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } - -.pas.obj: - $(BCB)\BIN\$(DCC32) $(PFLAGS) -U$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -O$(INCLUDEPATH) --BCB {$< } - -.cpp.obj: - $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } - -.c.obj: - $(BCB)\BIN\$(BCC32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n$(@D) {$< } - -.c.i: - $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } - -.cpp.i: - $(BCB)\BIN\$(CPP32) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -n. {$< } - -.asm.obj: - $(BCB)\BIN\$(TASM32) $(AFLAGS) -i$(INCLUDEPATH:;= -i) $(AUSERDEFINES) -d$(SYSDEFINES:;= -d) $<, $@ - -.rc.res: - $(BCB)\BIN\$(BRCC32) $(RFLAGS) -I$(INCLUDEPATH) -D$(USERDEFINES);$(SYSDEFINES) -fo$@ $< -# --------------------------------------------------------------------------- - - - - diff --git a/wxWidgets/src/expat/configure b/wxWidgets/src/expat/configure deleted file mode 100644 index 23e31ee7d4..0000000000 --- a/wxWidgets/src/expat/configure +++ /dev/null @@ -1,10129 +0,0 @@ -#! /bin/sh -# Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.57. -# -# Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002 -# Free Software Foundation, Inc. -# This configure script is free software; the Free Software Foundation -# gives unlimited permission to copy, distribute and modify it. -## --------------------- ## -## M4sh Initialization. ## -## --------------------- ## - -# Be Bourne compatible -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then - emulate sh - NULLCMD=: - # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' -elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then - set -o posix -fi - -# Support unset when possible. -if (FOO=FOO; unset FOO) >/dev/null 2>&1; then - as_unset=unset -else - as_unset=false -fi - - -# Work around bugs in pre-3.0 UWIN ksh. -$as_unset ENV MAIL MAILPATH -PS1='$ ' -PS2='> ' -PS4='+ ' - -# NLS nuisances. -for as_var in \ - LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ - LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ - LC_TELEPHONE LC_TIME -do - if (set +x; test -n "`(eval $as_var=C; export $as_var) 2>&1`"); then - eval $as_var=C; export $as_var - else - $as_unset $as_var - fi -done - -# Required to use basename. -if expr a : '\(a\)' >/dev/null 2>&1; then - as_expr=expr -else - as_expr=false -fi - -if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then - as_basename=basename -else - as_basename=false -fi - - -# Name of the executable. -as_me=`$as_basename "$0" || -$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)$' \| \ - . : '\(.\)' 2>/dev/null || -echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } - /^X\/\(\/\/\)$/{ s//\1/; q; } - /^X\/\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - - -# PATH needs CR, and LINENO needs CR and PATH. -# Avoid depending upon Character Ranges. -as_cr_letters='abcdefghijklmnopqrstuvwxyz' -as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' -as_cr_Letters=$as_cr_letters$as_cr_LETTERS -as_cr_digits='0123456789' -as_cr_alnum=$as_cr_Letters$as_cr_digits - -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - echo "#! /bin/sh" >conf$$.sh - echo "exit 0" >>conf$$.sh - chmod +x conf$$.sh - if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then - PATH_SEPARATOR=';' - else - PATH_SEPARATOR=: - fi - rm -f conf$$.sh -fi - - - as_lineno_1=$LINENO - as_lineno_2=$LINENO - as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x$as_lineno_3" = "x$as_lineno_2" || { - # Find who we are. Look in the path if we contain no path at all - # relative or not. - case $0 in - *[\\/]* ) as_myself=$0 ;; - *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break -done - - ;; - esac - # We did not find ourselves, most probably we were run as `sh COMMAND' - # in which case we are not to be found in the path. - if test "x$as_myself" = x; then - as_myself=$0 - fi - if test ! -f "$as_myself"; then - { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2 - { (exit 1); exit 1; }; } - fi - case $CONFIG_SHELL in - '') - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for as_base in sh bash ksh sh5; do - case $as_dir in - /*) - if ("$as_dir/$as_base" -c ' - as_lineno_1=$LINENO - as_lineno_2=$LINENO - as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then - $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } - $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } - CONFIG_SHELL=$as_dir/$as_base - export CONFIG_SHELL - exec "$CONFIG_SHELL" "$0" ${1+"$@"} - fi;; - esac - done -done -;; - esac - - # Create $as_me.lineno as a copy of $as_myself, but with $LINENO - # uniformly replaced by the line number. The first 'sed' inserts a - # line-number line before each line; the second 'sed' does the real - # work. The second script uses 'N' to pair each line-number line - # with the numbered line, and appends trailing '-' during - # substitution so that $LINENO is not a special case at line end. - # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the - # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) - sed '=' <$as_myself | - sed ' - N - s,$,-, - : loop - s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, - t loop - s,-$,, - s,^['$as_cr_digits']*\n,, - ' >$as_me.lineno && - chmod +x $as_me.lineno || - { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 - { (exit 1); exit 1; }; } - - # Don't try to exec as it changes $[0], causing all sort of problems - # (the dirname of $[0] is not the place where we might find the - # original and so on. Autoconf is especially sensible to this). - . ./$as_me.lineno - # Exit status is that of the last command. - exit -} - - -case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in - *c*,-n*) ECHO_N= ECHO_C=' -' ECHO_T=' ' ;; - *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; - *) ECHO_N= ECHO_C='\c' ECHO_T= ;; -esac - -if expr a : '\(a\)' >/dev/null 2>&1; then - as_expr=expr -else - as_expr=false -fi - -rm -f conf$$ conf$$.exe conf$$.file -echo >conf$$.file -if ln -s conf$$.file conf$$ 2>/dev/null; then - # We could just check for DJGPP; but this test a) works b) is more generic - # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). - if test -f conf$$.exe; then - # Don't use ln at all; we don't have any links - as_ln_s='cp -p' - else - as_ln_s='ln -s' - fi -elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln -else - as_ln_s='cp -p' -fi -rm -f conf$$ conf$$.exe conf$$.file - -if mkdir -p . 2>/dev/null; then - as_mkdir_p=: -else - as_mkdir_p=false -fi - -as_executable_p="test -f" - -# Sed expression to map a string onto a valid CPP name. -as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g" - -# Sed expression to map a string onto a valid variable name. -as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g" - - -# IFS -# We need space, tab and new line, in precisely that order. -as_nl=' -' -IFS=" $as_nl" - -# CDPATH. -$as_unset CDPATH - - -# Find the correct PATH separator. Usually this is `:', but -# DJGPP uses `;' like DOS. -if test "X${PATH_SEPARATOR+set}" != Xset; then - UNAME=${UNAME-`uname 2>/dev/null`} - case X$UNAME in - *-DOS) lt_cv_sys_path_separator=';' ;; - *) lt_cv_sys_path_separator=':' ;; - esac - PATH_SEPARATOR=$lt_cv_sys_path_separator -fi - - -# Check that we are running under the correct shell. -SHELL=${CONFIG_SHELL-/bin/sh} - -case X$ECHO in -X*--fallback-echo) - # Remove one level of quotation (which was required for Make). - ECHO=`echo "$ECHO" | sed 's,\\\\\$\\$0,'$0','` - ;; -esac - -echo=${ECHO-echo} -if test "X$1" = X--no-reexec; then - # Discard the --no-reexec flag, and continue. - shift -elif test "X$1" = X--fallback-echo; then - # Avoid inline document here, it may be left over - : -elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then - # Yippee, $echo works! - : -else - # Restart under the correct shell. - exec $SHELL "$0" --no-reexec ${1+"$@"} -fi - -if test "X$1" = X--fallback-echo; then - # used as fallback echo - shift - cat </dev/null && - echo_test_string="`eval $cmd`" && - (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null - then - break - fi - done -fi - -if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && - echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - : -else - # The Solaris, AIX, and Digital Unix default echo programs unquote - # backslashes. This makes it impossible to quote backslashes using - # echo "$something" | sed 's/\\/\\\\/g' - # - # So, first we look for a working echo in the user's PATH. - - IFS="${IFS= }"; save_ifs="$IFS"; IFS=$PATH_SEPARATOR - for dir in $PATH /usr/ucb; do - if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && - test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && - echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - echo="$dir/echo" - break - fi - done - IFS="$save_ifs" - - if test "X$echo" = Xecho; then - # We didn't find a better echo, so look for alternatives. - if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' && - echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - # This shell has a builtin print -r that does the trick. - echo='print -r' - elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) && - test "X$CONFIG_SHELL" != X/bin/ksh; then - # If we have ksh, try running configure again with it. - ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} - export ORIGINAL_CONFIG_SHELL - CONFIG_SHELL=/bin/ksh - export CONFIG_SHELL - exec $CONFIG_SHELL "$0" --no-reexec ${1+"$@"} - else - # Try using printf. - echo='printf %s\n' - if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && - echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - # Cool, printf works - : - elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` && - test "X$echo_testing_string" = 'X\t' && - echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL - export CONFIG_SHELL - SHELL="$CONFIG_SHELL" - export SHELL - echo="$CONFIG_SHELL $0 --fallback-echo" - elif echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` && - test "X$echo_testing_string" = 'X\t' && - echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - echo="$CONFIG_SHELL $0 --fallback-echo" - else - # maybe with a smaller string... - prev=: - - for cmd in 'echo test' 'sed 2q "$0"' 'sed 10q "$0"' 'sed 20q "$0"' 'sed 50q "$0"'; do - if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null - then - break - fi - prev="$cmd" - done - - if test "$prev" != 'sed 50q "$0"'; then - echo_test_string=`eval $prev` - export echo_test_string - exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "$0" ${1+"$@"} - else - # Oops. We lost completely, so just stick with echo. - echo=echo - fi - fi - fi - fi -fi -fi - -# Copy echo and quote the copy suitably for passing to libtool from -# the Makefile, instead of quoting the original, which is used later. -ECHO=$echo -if test "X$ECHO" = "X$CONFIG_SHELL $0 --fallback-echo"; then - ECHO="$CONFIG_SHELL \\\$\$0 --fallback-echo" -fi - - - -# Name of the host. -# hostname on some systems (SVR3.2, Linux) returns a bogus exit status, -# so uname gets run too. -ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` - -exec 6>&1 - -# -# Initializations. -# -ac_default_prefix=/usr/local -ac_config_libobj_dir=. -cross_compiling=no -subdirs= -MFLAGS= -MAKEFLAGS= -SHELL=${CONFIG_SHELL-/bin/sh} - -# Maximum number of lines to put in a shell here document. -# This variable seems obsolete. It should probably be removed, and -# only ac_max_sed_lines should be used. -: ${ac_max_here_lines=38} - -# Identity of this package. -PACKAGE_NAME= -PACKAGE_TARNAME= -PACKAGE_VERSION= -PACKAGE_STRING= -PACKAGE_BUGREPORT= - -ac_unique_file="expat" -ac_unique_file="Makefile.in" -# Factoring default headers for most tests. -ac_includes_default="\ -#include -#if HAVE_SYS_TYPES_H -# include -#endif -#if HAVE_SYS_STAT_H -# include -#endif -#if STDC_HEADERS -# include -# include -#else -# if HAVE_STDLIB_H -# include -# endif -#endif -#if HAVE_STRING_H -# if !STDC_HEADERS && HAVE_MEMORY_H -# include -# endif -# include -#endif -#if HAVE_STRINGS_H -# include -#endif -#if HAVE_INTTYPES_H -# include -#else -# if HAVE_STDINT_H -# include -# endif -#endif -#if HAVE_UNISTD_H -# include -#endif" - -ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT build build_cpu build_vendor build_os host host_cpu host_vendor host_os LN_S ECHO RANLIB ac_ct_RANLIB STRIP ac_ct_STRIP CPP EGREP LIBTOOL LIBCURRENT LIBREVISION LIBAGE INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA LIBOBJS FILEMAP LTLIBOBJS' -ac_subst_files='' - -# Initialize some variables set by options. -ac_init_help= -ac_init_version=false -# The variables have the same names as the options, with -# dashes changed to underlines. -cache_file=/dev/null -exec_prefix=NONE -no_create= -no_recursion= -prefix=NONE -program_prefix=NONE -program_suffix=NONE -program_transform_name=s,x,x, -silent= -site= -srcdir= -verbose= -x_includes=NONE -x_libraries=NONE - -# Installation directory options. -# These are left unexpanded so users can "make install exec_prefix=/foo" -# and all the variables that are supposed to be based on exec_prefix -# by default will actually change. -# Use braces instead of parens because sh, perl, etc. also accept them. -bindir='${exec_prefix}/bin' -sbindir='${exec_prefix}/sbin' -libexecdir='${exec_prefix}/libexec' -datadir='${prefix}/share' -sysconfdir='${prefix}/etc' -sharedstatedir='${prefix}/com' -localstatedir='${prefix}/var' -libdir='${exec_prefix}/lib' -includedir='${prefix}/include' -oldincludedir='/usr/include' -infodir='${prefix}/info' -mandir='${prefix}/man' - -ac_prev= -for ac_option -do - # If the previous option needs an argument, assign it. - if test -n "$ac_prev"; then - eval "$ac_prev=\$ac_option" - ac_prev= - continue - fi - - ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'` - - # Accept the important Cygnus configure options, so we can diagnose typos. - - case $ac_option in - - -bindir | --bindir | --bindi | --bind | --bin | --bi) - ac_prev=bindir ;; - -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) - bindir=$ac_optarg ;; - - -build | --build | --buil | --bui | --bu) - ac_prev=build_alias ;; - -build=* | --build=* | --buil=* | --bui=* | --bu=*) - build_alias=$ac_optarg ;; - - -cache-file | --cache-file | --cache-fil | --cache-fi \ - | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) - ac_prev=cache_file ;; - -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ - | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) - cache_file=$ac_optarg ;; - - --config-cache | -C) - cache_file=config.cache ;; - - -datadir | --datadir | --datadi | --datad | --data | --dat | --da) - ac_prev=datadir ;; - -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ - | --da=*) - datadir=$ac_optarg ;; - - -disable-* | --disable-*) - ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid feature name: $ac_feature" >&2 - { (exit 1); exit 1; }; } - ac_feature=`echo $ac_feature | sed 's/-/_/g'` - eval "enable_$ac_feature=no" ;; - - -enable-* | --enable-*) - ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid feature name: $ac_feature" >&2 - { (exit 1); exit 1; }; } - ac_feature=`echo $ac_feature | sed 's/-/_/g'` - case $ac_option in - *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; - *) ac_optarg=yes ;; - esac - eval "enable_$ac_feature='$ac_optarg'" ;; - - -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ - | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ - | --exec | --exe | --ex) - ac_prev=exec_prefix ;; - -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ - | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ - | --exec=* | --exe=* | --ex=*) - exec_prefix=$ac_optarg ;; - - -gas | --gas | --ga | --g) - # Obsolete; use --with-gas. - with_gas=yes ;; - - -help | --help | --hel | --he | -h) - ac_init_help=long ;; - -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) - ac_init_help=recursive ;; - -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) - ac_init_help=short ;; - - -host | --host | --hos | --ho) - ac_prev=host_alias ;; - -host=* | --host=* | --hos=* | --ho=*) - host_alias=$ac_optarg ;; - - -includedir | --includedir | --includedi | --included | --include \ - | --includ | --inclu | --incl | --inc) - ac_prev=includedir ;; - -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ - | --includ=* | --inclu=* | --incl=* | --inc=*) - includedir=$ac_optarg ;; - - -infodir | --infodir | --infodi | --infod | --info | --inf) - ac_prev=infodir ;; - -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) - infodir=$ac_optarg ;; - - -libdir | --libdir | --libdi | --libd) - ac_prev=libdir ;; - -libdir=* | --libdir=* | --libdi=* | --libd=*) - libdir=$ac_optarg ;; - - -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ - | --libexe | --libex | --libe) - ac_prev=libexecdir ;; - -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ - | --libexe=* | --libex=* | --libe=*) - libexecdir=$ac_optarg ;; - - -localstatedir | --localstatedir | --localstatedi | --localstated \ - | --localstate | --localstat | --localsta | --localst \ - | --locals | --local | --loca | --loc | --lo) - ac_prev=localstatedir ;; - -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ - | --localstate=* | --localstat=* | --localsta=* | --localst=* \ - | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) - localstatedir=$ac_optarg ;; - - -mandir | --mandir | --mandi | --mand | --man | --ma | --m) - ac_prev=mandir ;; - -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) - mandir=$ac_optarg ;; - - -nfp | --nfp | --nf) - # Obsolete; use --without-fp. - with_fp=no ;; - - -no-create | --no-create | --no-creat | --no-crea | --no-cre \ - | --no-cr | --no-c | -n) - no_create=yes ;; - - -no-recursion | --no-recursion | --no-recursio | --no-recursi \ - | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) - no_recursion=yes ;; - - -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ - | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ - | --oldin | --oldi | --old | --ol | --o) - ac_prev=oldincludedir ;; - -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ - | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ - | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) - oldincludedir=$ac_optarg ;; - - -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) - ac_prev=prefix ;; - -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) - prefix=$ac_optarg ;; - - -program-prefix | --program-prefix | --program-prefi | --program-pref \ - | --program-pre | --program-pr | --program-p) - ac_prev=program_prefix ;; - -program-prefix=* | --program-prefix=* | --program-prefi=* \ - | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) - program_prefix=$ac_optarg ;; - - -program-suffix | --program-suffix | --program-suffi | --program-suff \ - | --program-suf | --program-su | --program-s) - ac_prev=program_suffix ;; - -program-suffix=* | --program-suffix=* | --program-suffi=* \ - | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) - program_suffix=$ac_optarg ;; - - -program-transform-name | --program-transform-name \ - | --program-transform-nam | --program-transform-na \ - | --program-transform-n | --program-transform- \ - | --program-transform | --program-transfor \ - | --program-transfo | --program-transf \ - | --program-trans | --program-tran \ - | --progr-tra | --program-tr | --program-t) - ac_prev=program_transform_name ;; - -program-transform-name=* | --program-transform-name=* \ - | --program-transform-nam=* | --program-transform-na=* \ - | --program-transform-n=* | --program-transform-=* \ - | --program-transform=* | --program-transfor=* \ - | --program-transfo=* | --program-transf=* \ - | --program-trans=* | --program-tran=* \ - | --progr-tra=* | --program-tr=* | --program-t=*) - program_transform_name=$ac_optarg ;; - - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil) - silent=yes ;; - - -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) - ac_prev=sbindir ;; - -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ - | --sbi=* | --sb=*) - sbindir=$ac_optarg ;; - - -sharedstatedir | --sharedstatedir | --sharedstatedi \ - | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ - | --sharedst | --shareds | --shared | --share | --shar \ - | --sha | --sh) - ac_prev=sharedstatedir ;; - -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ - | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ - | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ - | --sha=* | --sh=*) - sharedstatedir=$ac_optarg ;; - - -site | --site | --sit) - ac_prev=site ;; - -site=* | --site=* | --sit=*) - site=$ac_optarg ;; - - -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) - ac_prev=srcdir ;; - -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) - srcdir=$ac_optarg ;; - - -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ - | --syscon | --sysco | --sysc | --sys | --sy) - ac_prev=sysconfdir ;; - -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ - | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) - sysconfdir=$ac_optarg ;; - - -target | --target | --targe | --targ | --tar | --ta | --t) - ac_prev=target_alias ;; - -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) - target_alias=$ac_optarg ;; - - -v | -verbose | --verbose | --verbos | --verbo | --verb) - verbose=yes ;; - - -version | --version | --versio | --versi | --vers | -V) - ac_init_version=: ;; - - -with-* | --with-*) - ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid package name: $ac_package" >&2 - { (exit 1); exit 1; }; } - ac_package=`echo $ac_package| sed 's/-/_/g'` - case $ac_option in - *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; - *) ac_optarg=yes ;; - esac - eval "with_$ac_package='$ac_optarg'" ;; - - -without-* | --without-*) - ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid package name: $ac_package" >&2 - { (exit 1); exit 1; }; } - ac_package=`echo $ac_package | sed 's/-/_/g'` - eval "with_$ac_package=no" ;; - - --x) - # Obsolete; use --with-x. - with_x=yes ;; - - -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ - | --x-incl | --x-inc | --x-in | --x-i) - ac_prev=x_includes ;; - -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ - | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) - x_includes=$ac_optarg ;; - - -x-libraries | --x-libraries | --x-librarie | --x-librari \ - | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) - ac_prev=x_libraries ;; - -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ - | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) - x_libraries=$ac_optarg ;; - - -*) { echo "$as_me: error: unrecognized option: $ac_option -Try \`$0 --help' for more information." >&2 - { (exit 1); exit 1; }; } - ;; - - *=*) - ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` - # Reject names that are not valid shell variable names. - expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 - { (exit 1); exit 1; }; } - ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` - eval "$ac_envvar='$ac_optarg'" - export $ac_envvar ;; - - *) - # FIXME: should be removed in autoconf 3.0. - echo "$as_me: WARNING: you should use --build, --host, --target" >&2 - expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && - echo "$as_me: WARNING: invalid host type: $ac_option" >&2 - : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} - ;; - - esac -done - -if test -n "$ac_prev"; then - ac_option=--`echo $ac_prev | sed 's/_/-/g'` - { echo "$as_me: error: missing argument to $ac_option" >&2 - { (exit 1); exit 1; }; } -fi - -# Be sure to have absolute paths. -for ac_var in exec_prefix prefix -do - eval ac_val=$`echo $ac_var` - case $ac_val in - [\\/$]* | ?:[\\/]* | NONE | '' ) ;; - *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 - { (exit 1); exit 1; }; };; - esac -done - -# Be sure to have absolute paths. -for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \ - localstatedir libdir includedir oldincludedir infodir mandir -do - eval ac_val=$`echo $ac_var` - case $ac_val in - [\\/$]* | ?:[\\/]* ) ;; - *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 - { (exit 1); exit 1; }; };; - esac -done - -# There might be people who depend on the old broken behavior: `$host' -# used to hold the argument of --host etc. -# FIXME: To remove some day. -build=$build_alias -host=$host_alias -target=$target_alias - -# FIXME: To remove some day. -if test "x$host_alias" != x; then - if test "x$build_alias" = x; then - cross_compiling=maybe - echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. - If a cross compiler is detected then cross compile mode will be used." >&2 - elif test "x$build_alias" != "x$host_alias"; then - cross_compiling=yes - fi -fi - -ac_tool_prefix= -test -n "$host_alias" && ac_tool_prefix=$host_alias- - -test "$silent" = yes && exec 6>/dev/null - - -# Find the source files, if location was not specified. -if test -z "$srcdir"; then - ac_srcdir_defaulted=yes - # Try the directory containing this script, then its parent. - ac_confdir=`(dirname "$0") 2>/dev/null || -$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$0" : 'X\(//\)[^/]' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || -echo X"$0" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - srcdir=$ac_confdir - if test ! -r $srcdir/$ac_unique_file; then - srcdir=.. - fi -else - ac_srcdir_defaulted=no -fi -if test ! -r $srcdir/$ac_unique_file; then - if test "$ac_srcdir_defaulted" = yes; then - { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2 - { (exit 1); exit 1; }; } - else - { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 - { (exit 1); exit 1; }; } - fi -fi -(cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null || - { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2 - { (exit 1); exit 1; }; } -srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'` -ac_env_build_alias_set=${build_alias+set} -ac_env_build_alias_value=$build_alias -ac_cv_env_build_alias_set=${build_alias+set} -ac_cv_env_build_alias_value=$build_alias -ac_env_host_alias_set=${host_alias+set} -ac_env_host_alias_value=$host_alias -ac_cv_env_host_alias_set=${host_alias+set} -ac_cv_env_host_alias_value=$host_alias -ac_env_target_alias_set=${target_alias+set} -ac_env_target_alias_value=$target_alias -ac_cv_env_target_alias_set=${target_alias+set} -ac_cv_env_target_alias_value=$target_alias -ac_env_CC_set=${CC+set} -ac_env_CC_value=$CC -ac_cv_env_CC_set=${CC+set} -ac_cv_env_CC_value=$CC -ac_env_CFLAGS_set=${CFLAGS+set} -ac_env_CFLAGS_value=$CFLAGS -ac_cv_env_CFLAGS_set=${CFLAGS+set} -ac_cv_env_CFLAGS_value=$CFLAGS -ac_env_LDFLAGS_set=${LDFLAGS+set} -ac_env_LDFLAGS_value=$LDFLAGS -ac_cv_env_LDFLAGS_set=${LDFLAGS+set} -ac_cv_env_LDFLAGS_value=$LDFLAGS -ac_env_CPPFLAGS_set=${CPPFLAGS+set} -ac_env_CPPFLAGS_value=$CPPFLAGS -ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set} -ac_cv_env_CPPFLAGS_value=$CPPFLAGS -ac_env_CPP_set=${CPP+set} -ac_env_CPP_value=$CPP -ac_cv_env_CPP_set=${CPP+set} -ac_cv_env_CPP_value=$CPP - -# -# Report the --help message. -# -if test "$ac_init_help" = "long"; then - # Omit some internal or obsolete options to make the list less imposing. - # This message is too long to be a string in the A/UX 3.1 sh. - cat <<_ACEOF -\`configure' configures this package to adapt to many kinds of systems. - -Usage: $0 [OPTION]... [VAR=VALUE]... - -To assign environment variables (e.g., CC, CFLAGS...), specify them as -VAR=VALUE. See below for descriptions of some of the useful variables. - -Defaults for the options are specified in brackets. - -Configuration: - -h, --help display this help and exit - --help=short display options specific to this package - --help=recursive display the short help of all the included packages - -V, --version display version information and exit - -q, --quiet, --silent do not print \`checking...' messages - --cache-file=FILE cache test results in FILE [disabled] - -C, --config-cache alias for \`--cache-file=config.cache' - -n, --no-create do not create output files - --srcdir=DIR find the sources in DIR [configure dir or \`..'] - -_ACEOF - - cat <<_ACEOF -Installation directories: - --prefix=PREFIX install architecture-independent files in PREFIX - [$ac_default_prefix] - --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX - [PREFIX] - -By default, \`make install' will install all the files in -\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify -an installation prefix other than \`$ac_default_prefix' using \`--prefix', -for instance \`--prefix=\$HOME'. - -For better control, use the options below. - -Fine tuning of the installation directories: - --bindir=DIR user executables [EPREFIX/bin] - --sbindir=DIR system admin executables [EPREFIX/sbin] - --libexecdir=DIR program executables [EPREFIX/libexec] - --datadir=DIR read-only architecture-independent data [PREFIX/share] - --sysconfdir=DIR read-only single-machine data [PREFIX/etc] - --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] - --localstatedir=DIR modifiable single-machine data [PREFIX/var] - --libdir=DIR object code libraries [EPREFIX/lib] - --includedir=DIR C header files [PREFIX/include] - --oldincludedir=DIR C header files for non-gcc [/usr/include] - --infodir=DIR info documentation [PREFIX/info] - --mandir=DIR man documentation [PREFIX/man] -_ACEOF - - cat <<\_ACEOF - -System types: - --build=BUILD configure for building on BUILD [guessed] - --host=HOST cross-compile to build programs to run on HOST [BUILD] -_ACEOF -fi - -if test -n "$ac_init_help"; then - - cat <<\_ACEOF - -Optional Features: - --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) - --enable-FEATURE[=ARG] include FEATURE [ARG=yes] - --enable-shared=PKGS build shared libraries default=yes - --enable-static=PKGS build static libraries default=yes - --enable-fast-install=PKGS optimize for fast installation default=yes - --disable-libtool-lock avoid locking (might break parallel builds) - -Optional Packages: - --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] - --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) - --with-gnu-ld assume the C compiler uses GNU ld default=no - --with-pic try to use only PIC/non-PIC objects default=use both - -Some influential environment variables: - CC C compiler command - CFLAGS C compiler flags - LDFLAGS linker flags, e.g. -L if you have libraries in a - nonstandard directory - CPPFLAGS C/C++ preprocessor flags, e.g. -I if you have - headers in a nonstandard directory - CPP C preprocessor - -Use these variables to override the choices made by `configure' or to help -it to find libraries and programs with nonstandard names/locations. - -_ACEOF -fi - -if test "$ac_init_help" = "recursive"; then - # If there are subdirs, report their specific --help. - ac_popdir=`pwd` - for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue - test -d $ac_dir || continue - ac_builddir=. - -if test "$ac_dir" != .; then - ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` - # A "../" for each directory in $ac_dir_suffix. - ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` -else - ac_dir_suffix= ac_top_builddir= -fi - -case $srcdir in - .) # No --srcdir option. We are building in place. - ac_srcdir=. - if test -z "$ac_top_builddir"; then - ac_top_srcdir=. - else - ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` - fi ;; - [\\/]* | ?:[\\/]* ) # Absolute path. - ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir ;; - *) # Relative path. - ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_builddir$srcdir ;; -esac -# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be -# absolute. -ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd` -ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd` -ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd` -ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd` - - cd $ac_dir - # Check for guested configure; otherwise get Cygnus style configure. - if test -f $ac_srcdir/configure.gnu; then - echo - $SHELL $ac_srcdir/configure.gnu --help=recursive - elif test -f $ac_srcdir/configure; then - echo - $SHELL $ac_srcdir/configure --help=recursive - elif test -f $ac_srcdir/configure.ac || - test -f $ac_srcdir/configure.in; then - echo - $ac_configure --help - else - echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 - fi - cd $ac_popdir - done -fi - -test -n "$ac_init_help" && exit 0 -if $ac_init_version; then - cat <<\_ACEOF - -Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002 -Free Software Foundation, Inc. -This configure script is free software; the Free Software Foundation -gives unlimited permission to copy, distribute and modify it. -_ACEOF - exit 0 -fi -exec 5>config.log -cat >&5 <<_ACEOF -This file contains any messages produced by compilers while -running configure, to aid debugging if configure makes a mistake. - -It was created by $as_me, which was -generated by GNU Autoconf 2.57. Invocation command line was - - $ $0 $@ - -_ACEOF -{ -cat <<_ASUNAME -## --------- ## -## Platform. ## -## --------- ## - -hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` -uname -m = `(uname -m) 2>/dev/null || echo unknown` -uname -r = `(uname -r) 2>/dev/null || echo unknown` -uname -s = `(uname -s) 2>/dev/null || echo unknown` -uname -v = `(uname -v) 2>/dev/null || echo unknown` - -/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` -/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` - -/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` -/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` -/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` -hostinfo = `(hostinfo) 2>/dev/null || echo unknown` -/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` -/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` -/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` - -_ASUNAME - -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - echo "PATH: $as_dir" -done - -} >&5 - -cat >&5 <<_ACEOF - - -## ----------- ## -## Core tests. ## -## ----------- ## - -_ACEOF - - -# Keep a trace of the command line. -# Strip out --no-create and --no-recursion so they do not pile up. -# Strip out --silent because we don't want to record it for future runs. -# Also quote any args containing shell meta-characters. -# Make two passes to allow for proper duplicate-argument suppression. -ac_configure_args= -ac_configure_args0= -ac_configure_args1= -ac_sep= -ac_must_keep_next=false -for ac_pass in 1 2 -do - for ac_arg - do - case $ac_arg in - -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil) - continue ;; - *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) - ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; - esac - case $ac_pass in - 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; - 2) - ac_configure_args1="$ac_configure_args1 '$ac_arg'" - if test $ac_must_keep_next = true; then - ac_must_keep_next=false # Got value, back to normal. - else - case $ac_arg in - *=* | --config-cache | -C | -disable-* | --disable-* \ - | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ - | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ - | -with-* | --with-* | -without-* | --without-* | --x) - case "$ac_configure_args0 " in - "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; - esac - ;; - -* ) ac_must_keep_next=true ;; - esac - fi - ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" - # Get rid of the leading space. - ac_sep=" " - ;; - esac - done -done -$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } -$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; } - -# When interrupted or exit'd, cleanup temporary files, and complete -# config.log. We remove comments because anyway the quotes in there -# would cause problems or look ugly. -# WARNING: Be sure not to use single quotes in there, as some shells, -# such as our DU 5.0 friend, will then `close' the trap. -trap 'exit_status=$? - # Save into config.log some information that might help in debugging. - { - echo - - cat <<\_ASBOX -## ---------------- ## -## Cache variables. ## -## ---------------- ## -_ASBOX - echo - # The following way of writing the cache mishandles newlines in values, -{ - (set) 2>&1 | - case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in - *ac_space=\ *) - sed -n \ - "s/'"'"'/'"'"'\\\\'"'"''"'"'/g; - s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p" - ;; - *) - sed -n \ - "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" - ;; - esac; -} - echo - - cat <<\_ASBOX -## ----------------- ## -## Output variables. ## -## ----------------- ## -_ASBOX - echo - for ac_var in $ac_subst_vars - do - eval ac_val=$`echo $ac_var` - echo "$ac_var='"'"'$ac_val'"'"'" - done | sort - echo - - if test -n "$ac_subst_files"; then - cat <<\_ASBOX -## ------------- ## -## Output files. ## -## ------------- ## -_ASBOX - echo - for ac_var in $ac_subst_files - do - eval ac_val=$`echo $ac_var` - echo "$ac_var='"'"'$ac_val'"'"'" - done | sort - echo - fi - - if test -s confdefs.h; then - cat <<\_ASBOX -## ----------- ## -## confdefs.h. ## -## ----------- ## -_ASBOX - echo - sed "/^$/d" confdefs.h | sort - echo - fi - test "$ac_signal" != 0 && - echo "$as_me: caught signal $ac_signal" - echo "$as_me: exit $exit_status" - } >&5 - rm -f core core.* *.core && - rm -rf conftest* confdefs* conf$$* $ac_clean_files && - exit $exit_status - ' 0 -for ac_signal in 1 2 13 15; do - trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal -done -ac_signal=0 - -# confdefs.h avoids OS command line length limits that DEFS can exceed. -rm -rf conftest* confdefs.h -# AIX cpp loses on an empty file, so make sure it contains at least a newline. -echo >confdefs.h - -# Predefined preprocessor variables. - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_NAME "$PACKAGE_NAME" -_ACEOF - - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_TARNAME "$PACKAGE_TARNAME" -_ACEOF - - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_VERSION "$PACKAGE_VERSION" -_ACEOF - - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_STRING "$PACKAGE_STRING" -_ACEOF - - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" -_ACEOF - - -# Let the site file select an alternate cache file if it wants to. -# Prefer explicitly selected file to automatically selected ones. -if test -z "$CONFIG_SITE"; then - if test "x$prefix" != xNONE; then - CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" - else - CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" - fi -fi -for ac_site_file in $CONFIG_SITE; do - if test -r "$ac_site_file"; then - { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 -echo "$as_me: loading site script $ac_site_file" >&6;} - sed 's/^/| /' "$ac_site_file" >&5 - . "$ac_site_file" - fi -done - -if test -r "$cache_file"; then - # Some versions of bash will fail to source /dev/null (special - # files actually), so we avoid doing that. - if test -f "$cache_file"; then - { echo "$as_me:$LINENO: loading cache $cache_file" >&5 -echo "$as_me: loading cache $cache_file" >&6;} - case $cache_file in - [\\/]* | ?:[\\/]* ) . $cache_file;; - *) . ./$cache_file;; - esac - fi -else - { echo "$as_me:$LINENO: creating cache $cache_file" >&5 -echo "$as_me: creating cache $cache_file" >&6;} - >$cache_file -fi - -# Check that the precious variables saved in the cache have kept the same -# value. -ac_cache_corrupted=false -for ac_var in `(set) 2>&1 | - sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do - eval ac_old_set=\$ac_cv_env_${ac_var}_set - eval ac_new_set=\$ac_env_${ac_var}_set - eval ac_old_val="\$ac_cv_env_${ac_var}_value" - eval ac_new_val="\$ac_env_${ac_var}_value" - case $ac_old_set,$ac_new_set in - set,) - { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 -echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} - ac_cache_corrupted=: ;; - ,set) - { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 -echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} - ac_cache_corrupted=: ;; - ,);; - *) - if test "x$ac_old_val" != "x$ac_new_val"; then - { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 -echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} - { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 -echo "$as_me: former value: $ac_old_val" >&2;} - { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 -echo "$as_me: current value: $ac_new_val" >&2;} - ac_cache_corrupted=: - fi;; - esac - # Pass precious variables to config.status. - if test "$ac_new_set" = set; then - case $ac_new_val in - *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) - ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; - *) ac_arg=$ac_var=$ac_new_val ;; - esac - case " $ac_configure_args " in - *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. - *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; - esac - fi -done -if $ac_cache_corrupted; then - { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 -echo "$as_me: error: changes in the environment can compromise the build" >&2;} - { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 -echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} - { (exit 1); exit 1; }; } -fi - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - - - - - - - - - - - - - - - - - - - - - -ac_aux_dir= -for ac_dir in conftools $srcdir/conftools; do - if test -f $ac_dir/install-sh; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install-sh -c" - break - elif test -f $ac_dir/install.sh; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install.sh -c" - break - elif test -f $ac_dir/shtool; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/shtool install -c" - break - fi -done -if test -z "$ac_aux_dir"; then - { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in conftools $srcdir/conftools" >&5 -echo "$as_me: error: cannot find install-sh or install.sh in conftools $srcdir/conftools" >&2;} - { (exit 1); exit 1; }; } -fi -ac_config_guess="$SHELL $ac_aux_dir/config.guess" -ac_config_sub="$SHELL $ac_aux_dir/config.sub" -ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure. - - - - -LIBCURRENT=4 -LIBREVISION=0 -LIBAGE=4 - - ac_config_headers="$ac_config_headers expat_config.h" - - -# libtool.m4 - Configure libtool for the host system. -*-Shell-script-*- -## Copyright 1996, 1997, 1998, 1999, 2000, 2001 -## Free Software Foundation, Inc. -## Originally by Gordon Matzigkeit , 1996 -## -## This program is free software; you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation; either version 2 of the License, or -## (at your option) any later version. -## -## This program is distributed in the hope that it will be useful, but -## WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -## General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with this program; if not, write to the Free Software -## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -## -## As a special exception to the GNU General Public License, if you -## distribute this file as part of a program that contains a -## configuration script generated by Autoconf, you may include it under -## the same distribution terms that you use for the rest of that program. - -# serial 46 AC_PROG_LIBTOOL - - - - - -# AC_LIBTOOL_HEADER_ASSERT -# ------------------------ -# AC_LIBTOOL_HEADER_ASSERT - -# _LT_AC_CHECK_DLFCN -# -------------------- -# _LT_AC_CHECK_DLFCN - -# AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE -# --------------------------------- - # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE - -# _LT_AC_LIBTOOL_SYS_PATH_SEPARATOR -# --------------------------------- -# _LT_AC_LIBTOOL_SYS_PATH_SEPARATOR - -# _LT_AC_PROG_ECHO_BACKSLASH -# -------------------------- -# Add some code to the start of the generated configure script which -# will find an echo command which doesn't interpret backslashes. -# _LT_AC_PROG_ECHO_BACKSLASH - -# _LT_AC_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, -# ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) -# ------------------------------------------------------------------ -# _LT_AC_TRY_DLOPEN_SELF - -# AC_LIBTOOL_DLOPEN_SELF -# ------------------- -# AC_LIBTOOL_DLOPEN_SELF - -# _LT_AC_LTCONFIG_HACK - -# AC_LIBTOOL_DLOPEN - enable checks for dlopen support - - -# AC_LIBTOOL_WIN32_DLL - declare package support for building win32 dll's - - -# AC_ENABLE_SHARED - implement the --enable-shared flag -# Usage: AC_ENABLE_SHARED[(DEFAULT)] -# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to -# `yes'. - - -# AC_DISABLE_SHARED - set the default shared flag to --disable-shared - - -# AC_ENABLE_STATIC - implement the --enable-static flag -# Usage: AC_ENABLE_STATIC[(DEFAULT)] -# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to -# `yes'. - - -# AC_DISABLE_STATIC - set the default static flag to --disable-static - - - -# AC_ENABLE_FAST_INSTALL - implement the --enable-fast-install flag -# Usage: AC_ENABLE_FAST_INSTALL[(DEFAULT)] -# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to -# `yes'. - - -# AC_DISABLE_FAST_INSTALL - set the default to --disable-fast-install - - -# AC_LIBTOOL_PICMODE - implement the --with-pic flag -# Usage: AC_LIBTOOL_PICMODE[(MODE)] -# Where MODE is either `yes' or `no'. If omitted, it defaults to -# `both'. - - - -# AC_PATH_TOOL_PREFIX - find a file program which can recognise shared library - - - -# AC_PATH_MAGIC - find a file program which can recognise a shared library - - - -# AC_PROG_LD - find the path to the GNU or non-GNU linker - - -# AC_PROG_LD_GNU - - - -# AC_PROG_LD_RELOAD_FLAG - find reload flag for linker -# -- PORTME Some linkers may need a different reload flag. - - -# AC_DEPLIBS_CHECK_METHOD - how to check for library dependencies -# -- PORTME fill in with the dynamic library characteristics - - - -# AC_PROG_NM - find the path to a BSD-compatible name lister - - -# AC_CHECK_LIBM - check for math library - - -# AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for -# the libltdl convenience library and INCLTDL to the include flags for -# the libltdl header and adds --enable-ltdl-convenience to the -# configure arguments. Note that LIBLTDL and INCLTDL are not -# AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called. If DIR is not -# provided, it is assumed to be `libltdl'. LIBLTDL will be prefixed -# with '${top_builddir}/' and INCLTDL will be prefixed with -# '${top_srcdir}/' (note the single quotes!). If your package is not -# flat and you're not using automake, define top_builddir and -# top_srcdir appropriately in the Makefiles. - - -# AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for -# the libltdl installable library and INCLTDL to the include flags for -# the libltdl header and adds --enable-ltdl-install to the configure -# arguments. Note that LIBLTDL and INCLTDL are not AC_SUBSTed, nor is -# AC_CONFIG_SUBDIRS called. If DIR is not provided and an installed -# libltdl is not found, it is assumed to be `libltdl'. LIBLTDL will -# be prefixed with '${top_builddir}/' and INCLTDL will be prefixed -# with '${top_srcdir}/' (note the single quotes!). If your package is -# not flat and you're not using automake, define top_builddir and -# top_srcdir appropriately in the Makefiles. -# In the future, this macro may have to be called after AC_PROG_LIBTOOL. - - -# old names - - - - - - - - -# This is just to silence aclocal about the macro not being used - - - - - - - - - ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. -set dummy ${ac_tool_prefix}gcc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_CC="${ac_tool_prefix}gcc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - -fi -if test -z "$ac_cv_prog_CC"; then - ac_ct_CC=$CC - # Extract the first word of "gcc", so it can be a program name with args. -set dummy gcc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_ac_ct_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$ac_ct_CC"; then - ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_CC="gcc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - -fi -fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -echo "${ECHO_T}$ac_ct_CC" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - - CC=$ac_ct_CC -else - CC="$ac_cv_prog_CC" -fi - -if test -z "$CC"; then - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. -set dummy ${ac_tool_prefix}cc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_CC="${ac_tool_prefix}cc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - -fi -if test -z "$ac_cv_prog_CC"; then - ac_ct_CC=$CC - # Extract the first word of "cc", so it can be a program name with args. -set dummy cc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_ac_ct_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$ac_ct_CC"; then - ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_CC="cc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - -fi -fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -echo "${ECHO_T}$ac_ct_CC" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - - CC=$ac_ct_CC -else - CC="$ac_cv_prog_CC" -fi - -fi -if test -z "$CC"; then - # Extract the first word of "cc", so it can be a program name with args. -set dummy cc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else - ac_prog_rejected=no -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then - ac_prog_rejected=yes - continue - fi - ac_cv_prog_CC="cc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - -if test $ac_prog_rejected = yes; then - # We found a bogon in the path, so make sure we never use it. - set dummy $ac_cv_prog_CC - shift - if test $# != 0; then - # We chose a different compiler from the bogus one. - # However, it has the same basename, so the bogon will be chosen - # first if we set CC to just the basename; use the full file name. - shift - ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" - fi -fi -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - -fi -if test -z "$CC"; then - if test -n "$ac_tool_prefix"; then - for ac_prog in cl - do - # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. -set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_CC="$ac_tool_prefix$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - - test -n "$CC" && break - done -fi -if test -z "$CC"; then - ac_ct_CC=$CC - for ac_prog in cl -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_ac_ct_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$ac_ct_CC"; then - ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_CC="$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - -fi -fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -echo "${ECHO_T}$ac_ct_CC" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - - test -n "$ac_ct_CC" && break -done - - CC=$ac_ct_CC -fi - -fi - - -test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH -See \`config.log' for more details." >&5 -echo "$as_me: error: no acceptable C compiler found in \$PATH -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } - -# Provide some information about the compiler. -echo "$as_me:$LINENO:" \ - "checking for C compiler version" >&5 -ac_compiler=`set X $ac_compile; echo $2` -{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 - (eval $ac_compiler --version &5) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } -{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 - (eval $ac_compiler -v &5) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } -{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 - (eval $ac_compiler -V &5) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } - -cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -ac_clean_files_save=$ac_clean_files -ac_clean_files="$ac_clean_files a.out a.exe b.out" -# Try to create an executable without -o first, disregard a.out. -# It will help us diagnose broken compilers, and finding out an intuition -# of exeext. -echo "$as_me:$LINENO: checking for C compiler default output" >&5 -echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6 -ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` -if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5 - (eval $ac_link_default) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - # Find the output, starting from the most likely. This scheme is -# not robust to junk in `.', hence go to wildcards (a.*) only as a last -# resort. - -# Be careful to initialize this variable, since it used to be cached. -# Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile. -ac_cv_exeext= -# b.out is created by i960 compilers. -for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out -do - test -f "$ac_file" || continue - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) - ;; - conftest.$ac_ext ) - # This is the source file. - ;; - [ab].out ) - # We found the default executable, but exeext='' is most - # certainly right. - break;; - *.* ) - ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - # FIXME: I believe we export ac_cv_exeext for Libtool, - # but it would be cool to find out if it's true. Does anybody - # maintain Libtool? --akim. - export ac_cv_exeext - break;; - * ) - break;; - esac -done -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -{ { echo "$as_me:$LINENO: error: C compiler cannot create executables -See \`config.log' for more details." >&5 -echo "$as_me: error: C compiler cannot create executables -See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } -fi - -ac_exeext=$ac_cv_exeext -echo "$as_me:$LINENO: result: $ac_file" >&5 -echo "${ECHO_T}$ac_file" >&6 - -# Check the compiler produces executables we can run. If not, either -# the compiler is broken, or we cross compile. -echo "$as_me:$LINENO: checking whether the C compiler works" >&5 -echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6 -# FIXME: These cross compiler hacks should be removed for Autoconf 3.0 -# If not cross compiling, check that we can run a simple program. -if test "$cross_compiling" != yes; then - if { ac_try='./$ac_file' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - cross_compiling=no - else - if test "$cross_compiling" = maybe; then - cross_compiling=yes - else - { { echo "$as_me:$LINENO: error: cannot run C compiled programs. -If you meant to cross compile, use \`--host'. -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot run C compiled programs. -If you meant to cross compile, use \`--host'. -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } - fi - fi -fi -echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 - -rm -f a.out a.exe conftest$ac_cv_exeext b.out -ac_clean_files=$ac_clean_files_save -# Check the compiler produces executables we can run. If not, either -# the compiler is broken, or we cross compile. -echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 -echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6 -echo "$as_me:$LINENO: result: $cross_compiling" >&5 -echo "${ECHO_T}$cross_compiling" >&6 - -echo "$as_me:$LINENO: checking for suffix of executables" >&5 -echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6 -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - # If both `conftest.exe' and `conftest' are `present' (well, observable) -# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will -# work properly (i.e., refer to `conftest.exe'), while it won't with -# `rm'. -for ac_file in conftest.exe conftest conftest.*; do - test -f "$ac_file" || continue - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;; - *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - export ac_cv_exeext - break;; - * ) break;; - esac -done -else - { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute suffix of executables: cannot compile and link -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } -fi - -rm -f conftest$ac_cv_exeext -echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 -echo "${ECHO_T}$ac_cv_exeext" >&6 - -rm -f conftest.$ac_ext -EXEEXT=$ac_cv_exeext -ac_exeext=$EXEEXT -echo "$as_me:$LINENO: checking for suffix of object files" >&5 -echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6 -if test "${ac_cv_objext+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.o conftest.obj -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;; - *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` - break;; - esac -done -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute suffix of object files: cannot compile -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } -fi - -rm -f conftest.$ac_cv_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 -echo "${ECHO_T}$ac_cv_objext" >&6 -OBJEXT=$ac_cv_objext -ac_objext=$OBJEXT -echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 -echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6 -if test "${ac_cv_c_compiler_gnu+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ -#ifndef __GNUC__ - choke me -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_compiler_gnu=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_compiler_gnu=no -fi -rm -f conftest.$ac_objext conftest.$ac_ext -ac_cv_c_compiler_gnu=$ac_compiler_gnu - -fi -echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 -echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6 -GCC=`test $ac_compiler_gnu = yes && echo yes` -ac_test_CFLAGS=${CFLAGS+set} -ac_save_CFLAGS=$CFLAGS -CFLAGS="-g" -echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 -echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6 -if test "${ac_cv_prog_cc_g+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_prog_cc_g=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_prog_cc_g=no -fi -rm -f conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 -echo "${ECHO_T}$ac_cv_prog_cc_g" >&6 -if test "$ac_test_CFLAGS" = set; then - CFLAGS=$ac_save_CFLAGS -elif test $ac_cv_prog_cc_g = yes; then - if test "$GCC" = yes; then - CFLAGS="-g -O2" - else - CFLAGS="-g" - fi -else - if test "$GCC" = yes; then - CFLAGS="-O2" - else - CFLAGS= - fi -fi -echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5 -echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6 -if test "${ac_cv_prog_cc_stdc+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_cv_prog_cc_stdc=no -ac_save_CC=$CC -cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#include -#include -#include -/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ -struct buf { int x; }; -FILE * (*rcsopen) (struct buf *, struct stat *, int); -static char *e (p, i) - char **p; - int i; -{ - return p[i]; -} -static char *f (char * (*g) (char **, int), char **p, ...) -{ - char *s; - va_list v; - va_start (v,p); - s = g (p, va_arg (v,int)); - va_end (v); - return s; -} -int test (int i, double x); -struct s1 {int (*f) (int a);}; -struct s2 {int (*f) (double a);}; -int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); -int argc; -char **argv; -int -main () -{ -return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; - ; - return 0; -} -_ACEOF -# Don't try gcc -ansi; that turns off useful extensions and -# breaks some systems' header files. -# AIX -qlanglvl=ansi -# Ultrix and OSF/1 -std1 -# HP-UX 10.20 and later -Ae -# HP-UX older versions -Aa -D_HPUX_SOURCE -# SVR4 -Xc -D__EXTENSIONS__ -for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" -do - CC="$ac_save_CC $ac_arg" - rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_prog_cc_stdc=$ac_arg -break -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi -rm -f conftest.$ac_objext -done -rm -f conftest.$ac_ext conftest.$ac_objext -CC=$ac_save_CC - -fi - -case "x$ac_cv_prog_cc_stdc" in - x|xno) - echo "$as_me:$LINENO: result: none needed" >&5 -echo "${ECHO_T}none needed" >&6 ;; - *) - echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5 -echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6 - CC="$CC $ac_cv_prog_cc_stdc" ;; -esac - -# Some people use a C++ compiler to compile C. Since we use `exit', -# in C++ we need to declare it. In case someone uses the same compiler -# for both compiling C and C++ we need to have the C++ compiler decide -# the declaration of exit, since it's the most demanding environment. -cat >conftest.$ac_ext <<_ACEOF -#ifndef __cplusplus - choke me -#endif -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - for ac_declaration in \ - ''\ - '#include ' \ - 'extern "C" void std::exit (int) throw (); using std::exit;' \ - 'extern "C" void std::exit (int); using std::exit;' \ - 'extern "C" void exit (int) throw ();' \ - 'extern "C" void exit (int);' \ - 'void exit (int);' -do - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -$ac_declaration -int -main () -{ -exit (42); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - : -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -continue -fi -rm -f conftest.$ac_objext conftest.$ac_ext - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_declaration -int -main () -{ -exit (42); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - break -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi -rm -f conftest.$ac_objext conftest.$ac_ext -done -rm -f conftest* -if test -n "$ac_declaration"; then - echo '#ifdef __cplusplus' >>confdefs.h - echo $ac_declaration >>confdefs.h - echo '#endif' >>confdefs.h -fi - -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi -rm -f conftest.$ac_objext conftest.$ac_ext -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - echo "$as_me:$LINENO: checking if the C compiler requires -ext o" >&5 -echo $ECHO_N "checking if the C compiler requires -ext o... $ECHO_C" >&6 -if test "${wx_cv_c_exto+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest.$ac_ext.o -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - for ac_file in `(ls conftest.* 2>/dev/null)`; do - case $ac_file in - conftest.$ac_ext.o) - wx_cv_c_exto="-ext o" - ;; - *) - ;; - esac -done -else - { { echo "$as_me:$LINENO: error: cannot figure out if compiler needs -ext o: cannot compile -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot figure out if compiler needs -ext o: cannot compile -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } - -fi - -rm -f conftest.$ac_ext.o conftest.$ac_objext conftest.$ac_ext - -fi -echo "$as_me:$LINENO: result: $wx_cv_c_exto" >&5 -echo "${ECHO_T}$wx_cv_c_exto" >&6 -if test "x$wx_cv_c_exto" '!=' "x"; then - if test "c" = "c"; then - CFLAGS="$wx_cv_c_exto $CFLAGS" - fi - if test "c" = "cxx"; then - CXXFLAGS="$wx_cv_c_exto $CXXFLAGS" - fi -fi - - if test "x$wx_cv_c_exto" '!=' "x"; then - unset ac_cv_prog_cc_g - ac_test_CFLAGS=${CFLAGS+set} -ac_save_CFLAGS=$CFLAGS -CFLAGS="-g" -echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 -echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6 -if test "${ac_cv_prog_cc_g+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_prog_cc_g=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_prog_cc_g=no -fi -rm -f conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 -echo "${ECHO_T}$ac_cv_prog_cc_g" >&6 -if test "$ac_test_CFLAGS" = set; then - CFLAGS=$ac_save_CFLAGS -elif test $ac_cv_prog_cc_g = yes; then - if test "$GCC" = yes; then - CFLAGS="-g -O2" - else - CFLAGS="-g" - fi -else - if test "$GCC" = yes; then - CFLAGS="-O2" - else - CFLAGS= - fi -fi - fi - ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - -echo "$as_me:$LINENO: checking whether we are using the Metrowerks C compiler" >&5 -echo $ECHO_N "checking whether we are using the Metrowerks C compiler... $ECHO_C" >&6 -if test "${bakefile_cv_c_compiler_mwerks+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ -#ifndef __MWERKS__ - choke me -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - bakefile_compiler_mwerks=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -bakefile_compiler_mwerks=no -fi -rm -f conftest.$ac_objext conftest.$ac_ext - bakefile_cv_c_compiler_mwerks=$bakefile_compiler_mwerks - -fi -echo "$as_me:$LINENO: result: $bakefile_cv_c_compiler_mwerks" >&5 -echo "${ECHO_T}$bakefile_cv_c_compiler_mwerks" >&6 - -MWCC=`test $bakefile_cv_c_compiler_mwerks = yes && echo yes` -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - - ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - -echo "$as_me:$LINENO: checking whether we are using the IBM xlC C compiler" >&5 -echo $ECHO_N "checking whether we are using the IBM xlC C compiler... $ECHO_C" >&6 -if test "${wx_cv_c_compiler_xlc+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ -#ifndef __xlC__ - choke me -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - wx_compiler_xlc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -wx_compiler_xlc=no -fi -rm -f conftest.$ac_objext conftest.$ac_ext - wx_cv_c_compiler_xlc=$wx_compiler_xlc - -fi -echo "$as_me:$LINENO: result: $wx_cv_c_compiler_xlc" >&5 -echo "${ECHO_T}$wx_cv_c_compiler_xlc" >&6 - -XLCC=`test $wx_cv_c_compiler_xlc = yes && echo yes` -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - - - - -# Check whether --enable-shared or --disable-shared was given. -if test "${enable_shared+set}" = set; then - enableval="$enable_shared" - p=${PACKAGE-default} -case $enableval in -yes) enable_shared=yes ;; -no) enable_shared=no ;; -*) - enable_shared=no - # Look at the argument we got. We use all the common list separators. - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:," - for pkg in $enableval; do - if test "X$pkg" = "X$p"; then - enable_shared=yes - fi - done - IFS="$ac_save_ifs" - ;; -esac -else - enable_shared=yes -fi; -# Check whether --enable-static or --disable-static was given. -if test "${enable_static+set}" = set; then - enableval="$enable_static" - p=${PACKAGE-default} -case $enableval in -yes) enable_static=yes ;; -no) enable_static=no ;; -*) - enable_static=no - # Look at the argument we got. We use all the common list separators. - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:," - for pkg in $enableval; do - if test "X$pkg" = "X$p"; then - enable_static=yes - fi - done - IFS="$ac_save_ifs" - ;; -esac -else - enable_static=yes -fi; -# Check whether --enable-fast-install or --disable-fast-install was given. -if test "${enable_fast_install+set}" = set; then - enableval="$enable_fast_install" - p=${PACKAGE-default} -case $enableval in -yes) enable_fast_install=yes ;; -no) enable_fast_install=no ;; -*) - enable_fast_install=no - # Look at the argument we got. We use all the common list separators. - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:," - for pkg in $enableval; do - if test "X$pkg" = "X$p"; then - enable_fast_install=yes - fi - done - IFS="$ac_save_ifs" - ;; -esac -else - enable_fast_install=yes -fi; -# Make sure we can run config.sub. -$ac_config_sub sun4 >/dev/null 2>&1 || - { { echo "$as_me:$LINENO: error: cannot run $ac_config_sub" >&5 -echo "$as_me: error: cannot run $ac_config_sub" >&2;} - { (exit 1); exit 1; }; } - -echo "$as_me:$LINENO: checking build system type" >&5 -echo $ECHO_N "checking build system type... $ECHO_C" >&6 -if test "${ac_cv_build+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_cv_build_alias=$build_alias -test -z "$ac_cv_build_alias" && - ac_cv_build_alias=`$ac_config_guess` -test -z "$ac_cv_build_alias" && - { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5 -echo "$as_me: error: cannot guess build type; you must specify one" >&2;} - { (exit 1); exit 1; }; } -ac_cv_build=`$ac_config_sub $ac_cv_build_alias` || - { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_build_alias failed" >&5 -echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed" >&2;} - { (exit 1); exit 1; }; } - -fi -echo "$as_me:$LINENO: result: $ac_cv_build" >&5 -echo "${ECHO_T}$ac_cv_build" >&6 -build=$ac_cv_build -build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` -build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` -build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` - - -echo "$as_me:$LINENO: checking host system type" >&5 -echo $ECHO_N "checking host system type... $ECHO_C" >&6 -if test "${ac_cv_host+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_cv_host_alias=$host_alias -test -z "$ac_cv_host_alias" && - ac_cv_host_alias=$ac_cv_build_alias -ac_cv_host=`$ac_config_sub $ac_cv_host_alias` || - { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_host_alias failed" >&5 -echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;} - { (exit 1); exit 1; }; } - -fi -echo "$as_me:$LINENO: result: $ac_cv_host" >&5 -echo "${ECHO_T}$ac_cv_host" >&6 -host=$ac_cv_host -host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` -host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` -host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` - - -# Find the correct PATH separator. Usually this is `:', but -# DJGPP uses `;' like DOS. -if test "X${PATH_SEPARATOR+set}" != Xset; then - UNAME=${UNAME-`uname 2>/dev/null`} - case X$UNAME in - *-DOS) lt_cv_sys_path_separator=';' ;; - *) lt_cv_sys_path_separator=':' ;; - esac - PATH_SEPARATOR=$lt_cv_sys_path_separator -fi - - -# Check whether --with-gnu-ld or --without-gnu-ld was given. -if test "${with_gnu_ld+set}" = set; then - withval="$with_gnu_ld" - test "$withval" = no || with_gnu_ld=yes -else - with_gnu_ld=no -fi; -ac_prog=ld -if test "$GCC" = yes; then - # Check if gcc -print-prog-name=ld gives a path. - echo "$as_me:$LINENO: checking for ld used by GCC" >&5 -echo $ECHO_N "checking for ld used by GCC... $ECHO_C" >&6 - case $host in - *-*-mingw*) - # gcc leaves a trailing carriage return which upsets mingw - ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; - *) - ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; - esac - case $ac_prog in - # Accept absolute paths. - [\\/]* | [A-Za-z]:[\\/]*) - re_direlt='/[^/][^/]*/\.\./' - # Canonicalize the path of ld - ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'` - while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do - ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"` - done - test -z "$LD" && LD="$ac_prog" - ;; - "") - # If it fails, then pretend we aren't using GCC. - ac_prog=ld - ;; - *) - # If it is relative, then search for the first ld in PATH. - with_gnu_ld=unknown - ;; - esac -elif test "$with_gnu_ld" = yes; then - echo "$as_me:$LINENO: checking for GNU ld" >&5 -echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6 -else - echo "$as_me:$LINENO: checking for non-GNU ld" >&5 -echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6 -fi -if test "${lt_cv_path_LD+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -z "$LD"; then - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=$PATH_SEPARATOR - for ac_dir in $PATH; do - test -z "$ac_dir" && ac_dir=. - if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then - lt_cv_path_LD="$ac_dir/$ac_prog" - # Check to see if the program is GNU ld. I'd rather use --version, - # but apparently some GNU ld's only accept -v. - # Break only if it was the GNU/non-GNU ld that we prefer. - if "$lt_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then - test "$with_gnu_ld" != no && break - else - test "$with_gnu_ld" != yes && break - fi - fi - done - IFS="$ac_save_ifs" -else - lt_cv_path_LD="$LD" # Let the user override the test with a path. -fi -fi - -LD="$lt_cv_path_LD" -if test -n "$LD"; then - echo "$as_me:$LINENO: result: $LD" >&5 -echo "${ECHO_T}$LD" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi -test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5 -echo "$as_me: error: no acceptable ld found in \$PATH" >&2;} - { (exit 1); exit 1; }; } -echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5 -echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6 -if test "${lt_cv_prog_gnu_ld+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - # I'd rather use --version here, but apparently some GNU ld's only accept -v. -if $LD -v 2>&1 &5; then - lt_cv_prog_gnu_ld=yes -else - lt_cv_prog_gnu_ld=no -fi -fi -echo "$as_me:$LINENO: result: $lt_cv_prog_gnu_ld" >&5 -echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6 -with_gnu_ld=$lt_cv_prog_gnu_ld - - -echo "$as_me:$LINENO: checking for $LD option to reload object files" >&5 -echo $ECHO_N "checking for $LD option to reload object files... $ECHO_C" >&6 -if test "${lt_cv_ld_reload_flag+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - lt_cv_ld_reload_flag='-r' -fi -echo "$as_me:$LINENO: result: $lt_cv_ld_reload_flag" >&5 -echo "${ECHO_T}$lt_cv_ld_reload_flag" >&6 -reload_flag=$lt_cv_ld_reload_flag -test -n "$reload_flag" && reload_flag=" $reload_flag" - -echo "$as_me:$LINENO: checking for BSD-compatible nm" >&5 -echo $ECHO_N "checking for BSD-compatible nm... $ECHO_C" >&6 -if test "${lt_cv_path_NM+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$NM"; then - # Let the user override the test. - lt_cv_path_NM="$NM" -else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=$PATH_SEPARATOR - for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do - test -z "$ac_dir" && ac_dir=. - tmp_nm=$ac_dir/${ac_tool_prefix}nm - if test -f $tmp_nm || test -f $tmp_nm$ac_exeext ; then - # Check to see if the nm accepts a BSD-compat flag. - # Adding the `sed 1q' prevents false positives on HP-UX, which says: - # nm: unknown option "B" ignored - # Tru64's nm complains that /dev/null is an invalid object file - if ($tmp_nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep '(/dev/null|Invalid file or object type)' >/dev/null; then - lt_cv_path_NM="$tmp_nm -B" - break - elif ($tmp_nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then - lt_cv_path_NM="$tmp_nm -p" - break - else - lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but - continue # so that we can try to find one that supports BSD flags - fi - fi - done - IFS="$ac_save_ifs" - test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm -fi -fi - -NM="$lt_cv_path_NM" -echo "$as_me:$LINENO: result: $NM" >&5 -echo "${ECHO_T}$NM" >&6 - -echo "$as_me:$LINENO: checking whether ln -s works" >&5 -echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6 -LN_S=$as_ln_s -if test "$LN_S" = "ln -s"; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 -else - echo "$as_me:$LINENO: result: no, using $LN_S" >&5 -echo "${ECHO_T}no, using $LN_S" >&6 -fi - -echo "$as_me:$LINENO: checking how to recognise dependant libraries" >&5 -echo $ECHO_N "checking how to recognise dependant libraries... $ECHO_C" >&6 -if test "${lt_cv_deplibs_check_method+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - lt_cv_file_magic_cmd='$MAGIC_CMD' -lt_cv_file_magic_test_file= -lt_cv_deplibs_check_method='unknown' -# Need to set the preceding variable on all platforms that support -# interlibrary dependencies. -# 'none' -- dependencies not supported. -# `unknown' -- same as none, but documents that we really don't know. -# 'pass_all' -- all dependencies passed with no checks. -# 'test_compile' -- check by making test program. -# 'file_magic [[regex]]' -- check by looking for files in library path -# which responds to the $file_magic_cmd with a given egrep regex. -# If you have `file' or equivalent on your system and you're not sure -# whether `pass_all' will *always* work, you probably want this one. - -case $host_os in -aix4* | aix5*) - lt_cv_deplibs_check_method=pass_all - ;; - -beos*) - lt_cv_deplibs_check_method=pass_all - ;; - -bsdi4*) - lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' - lt_cv_file_magic_cmd='/usr/bin/file -L' - lt_cv_file_magic_test_file=/shlib/libc.so - ;; - -cygwin* | mingw* | pw32*) - lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' - lt_cv_file_magic_cmd='$OBJDUMP -f' - ;; - -darwin* | rhapsody*) - lt_cv_deplibs_check_method='file_magic Mach-O dynamically linked shared library' - lt_cv_file_magic_cmd='/usr/bin/file -L' - case "$host_os" in - rhapsody* | darwin1.[012]) - lt_cv_file_magic_test_file=`echo /System/Library/Frameworks/System.framework/Versions/*/System | head -1` - ;; - *) # Darwin 1.3 on - lt_cv_file_magic_test_file='/usr/lib/libSystem.dylib' - ;; - esac - ;; - -freebsd*) - if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then - case $host_cpu in - i*86 ) - # Not sure whether the presence of OpenBSD here was a mistake. - # Let's accept both of them until this is cleared up. - lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD)/i[3-9]86 (compact )?demand paged shared library' - lt_cv_file_magic_cmd=/usr/bin/file - lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` - ;; - esac - else - lt_cv_deplibs_check_method=pass_all - fi - ;; - -gnu*) - lt_cv_deplibs_check_method=pass_all - ;; - -hpux10.20*|hpux11*) - lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library' - lt_cv_file_magic_cmd=/usr/bin/file - lt_cv_file_magic_test_file=/usr/lib/libc.sl - ;; - -irix5* | irix6*) - case $host_os in - irix5*) - # this will be overridden with pass_all, but let us keep it just in case - lt_cv_deplibs_check_method="file_magic ELF 32-bit MSB dynamic lib MIPS - version 1" - ;; - *) - case $LD in - *-32|*"-32 ") libmagic=32-bit;; - *-n32|*"-n32 ") libmagic=N32;; - *-64|*"-64 ") libmagic=64-bit;; - *) libmagic=never-match;; - esac - # this will be overridden with pass_all, but let us keep it just in case - lt_cv_deplibs_check_method="file_magic ELF ${libmagic} MSB mips-[1234] dynamic lib MIPS - version 1" - ;; - esac - lt_cv_file_magic_test_file=`echo /lib${libsuff}/libc.so*` - lt_cv_deplibs_check_method=pass_all - ;; - -# This must be Linux ELF. -linux-gnu*) - case $host_cpu in - alpha* | hppa* | i*86 | powerpc* | sparc* | ia64* ) - lt_cv_deplibs_check_method=pass_all ;; - *) - # glibc up to 2.1.1 does not perform some relocations on ARM - lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;; - esac - lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so` - ;; - -netbsd*) - if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then - lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$' - else - lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so$' - fi - ;; - -newos6*) - lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' - lt_cv_file_magic_cmd=/usr/bin/file - lt_cv_file_magic_test_file=/usr/lib/libnls.so - ;; - -openbsd*) - lt_cv_file_magic_cmd=/usr/bin/file - lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` - if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB shared object' - else - lt_cv_deplibs_check_method='file_magic OpenBSD.* shared library' - fi - ;; - -osf3* | osf4* | osf5*) - # this will be overridden with pass_all, but let us keep it just in case - lt_cv_deplibs_check_method='file_magic COFF format alpha shared library' - lt_cv_file_magic_test_file=/shlib/libc.so - lt_cv_deplibs_check_method=pass_all - ;; - -sco3.2v5*) - lt_cv_deplibs_check_method=pass_all - ;; - -solaris*) - lt_cv_deplibs_check_method=pass_all - lt_cv_file_magic_test_file=/lib/libc.so - ;; - -sysv5uw[78]* | sysv4*uw2*) - lt_cv_deplibs_check_method=pass_all - ;; - -sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) - case $host_vendor in - motorola) - lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' - lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` - ;; - ncr) - lt_cv_deplibs_check_method=pass_all - ;; - sequent) - lt_cv_file_magic_cmd='/bin/file' - lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' - ;; - sni) - lt_cv_file_magic_cmd='/bin/file' - lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib" - lt_cv_file_magic_test_file=/lib/libc.so - ;; - esac - ;; -esac - -fi -echo "$as_me:$LINENO: result: $lt_cv_deplibs_check_method" >&5 -echo "${ECHO_T}$lt_cv_deplibs_check_method" >&6 -file_magic_cmd=$lt_cv_file_magic_cmd -deplibs_check_method=$lt_cv_deplibs_check_method - - - - - - - -# Check for command to grab the raw symbol name followed by C symbol from nm. -echo "$as_me:$LINENO: checking command to parse $NM output" >&5 -echo $ECHO_N "checking command to parse $NM output... $ECHO_C" >&6 -if test "${lt_cv_sys_global_symbol_pipe+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - -# These are sane defaults that work on at least a few old systems. -# [They come from Ultrix. What could be older than Ultrix?!! ;)] - -# Character class describing NM global symbol codes. -symcode='[BCDEGRST]' - -# Regexp to match symbols that can be accessed directly from C. -sympat='\([_A-Za-z][_A-Za-z0-9]*\)' - -# Transform the above into a raw symbol and a C symbol. -symxfrm='\1 \2\3 \3' - -# Transform an extracted symbol line into a proper C declaration -lt_cv_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern char \1;/p'" - -# Transform an extracted symbol line into symbol name and symbol address -lt_cv_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" - -# Define system-specific variables. -case $host_os in -aix*) - symcode='[BCDT]' - ;; -cygwin* | mingw* | pw32*) - symcode='[ABCDGISTW]' - ;; -hpux*) # Its linker distinguishes data from code symbols - lt_cv_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern char \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" - lt_cv_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" - ;; -irix*) - symcode='[BCDEGRST]' - ;; -solaris* | sysv5*) - symcode='[BDT]' - ;; -sysv4) - symcode='[DFNSTU]' - ;; -esac - -# Handle CRLF in mingw tool chain -opt_cr= -case $host_os in -mingw*) - opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp - ;; -esac - -# If we're using GNU nm, then use its standard symbol codes. -if $NM -V 2>&1 | egrep '(GNU|with BFD)' > /dev/null; then - symcode='[ABCDGISTW]' -fi - -# Try without a prefix undercore, then with it. -for ac_symprfx in "" "_"; do - - # Write the raw and C identifiers. -lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*\($ac_symprfx\)$sympat$opt_cr$/$symxfrm/p'" - - # Check to see that the pipe works correctly. - pipe_works=no - rm -f conftest* - cat > conftest.$ac_ext <&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - # Now try to grab the symbols. - nlist=conftest.nm - if { (eval echo "$as_me:$LINENO: \"$NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist\"") >&5 - (eval $NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && test -s "$nlist"; then - # Try sorting and uniquifying the output. - if sort "$nlist" | uniq > "$nlist"T; then - mv -f "$nlist"T "$nlist" - else - rm -f "$nlist"T - fi - - # Make sure that we snagged all the symbols we need. - if egrep ' nm_test_var$' "$nlist" >/dev/null; then - if egrep ' nm_test_func$' "$nlist" >/dev/null; then - cat < conftest.$ac_ext -#ifdef __cplusplus -extern "C" { -#endif - -EOF - # Now generate the symbol file. - eval "$lt_cv_global_symbol_to_cdecl"' < "$nlist" >> conftest.$ac_ext' - - cat <> conftest.$ac_ext -#if defined (__STDC__) && __STDC__ -# define lt_ptr void * -#else -# define lt_ptr char * -# define const -#endif - -/* The mapping between symbol names and symbols. */ -const struct { - const char *name; - lt_ptr address; -} -lt_preloaded_symbols[] = -{ -EOF - sed "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr) \&\2},/" < "$nlist" >> conftest.$ac_ext - cat <<\EOF >> conftest.$ac_ext - {0, (lt_ptr) 0} -}; - -#ifdef __cplusplus -} -#endif -EOF - # Now try linking the two files. - mv conftest.$ac_objext conftstm.$ac_objext - save_LIBS="$LIBS" - save_CFLAGS="$CFLAGS" - LIBS="conftstm.$ac_objext" - CFLAGS="$CFLAGS$no_builtin_flag" - if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && test -s conftest; then - pipe_works=yes - fi - LIBS="$save_LIBS" - CFLAGS="$save_CFLAGS" - else - echo "cannot find nm_test_func in $nlist" >&5 - fi - else - echo "cannot find nm_test_var in $nlist" >&5 - fi - else - echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5 - fi - else - echo "$progname: failed program was:" >&5 - cat conftest.$ac_ext >&5 - fi - rm -f conftest* conftst* - - # Do not use the global_symbol_pipe unless it works. - if test "$pipe_works" = yes; then - break - else - lt_cv_sys_global_symbol_pipe= - fi -done - -fi - -global_symbol_pipe="$lt_cv_sys_global_symbol_pipe" -if test -z "$lt_cv_sys_global_symbol_pipe"; then - global_symbol_to_cdecl= - global_symbol_to_c_name_address= -else - global_symbol_to_cdecl="$lt_cv_global_symbol_to_cdecl" - global_symbol_to_c_name_address="$lt_cv_global_symbol_to_c_name_address" -fi -if test -z "$global_symbol_pipe$global_symbol_to_cdec$global_symbol_to_c_name_address"; -then - echo "$as_me:$LINENO: result: failed" >&5 -echo "${ECHO_T}failed" >&6 -else - echo "$as_me:$LINENO: result: ok" >&5 -echo "${ECHO_T}ok" >&6 -fi - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 -echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6 -# On Suns, sometimes $CPP names a directory. -if test -n "$CPP" && test -d "$CPP"; then - CPP= -fi -if test -z "$CPP"; then - if test "${ac_cv_prog_CPP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - # Double quotes because CPP needs to be expanded - for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" - do - ac_preproc_ok=false -for ac_c_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif - Syntax error -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - : -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - # Broken: fails on valid input. -continue -fi -rm -f conftest.err conftest.$ac_ext - - # OK, works on sane cases. Now check whether non-existent headers - # can be detected and how. - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - # Broken: success on invalid input. -continue -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - # Passes both tests. -ac_preproc_ok=: -break -fi -rm -f conftest.err conftest.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.err conftest.$ac_ext -if $ac_preproc_ok; then - break -fi - - done - ac_cv_prog_CPP=$CPP - -fi - CPP=$ac_cv_prog_CPP -else - ac_cv_prog_CPP=$CPP -fi -echo "$as_me:$LINENO: result: $CPP" >&5 -echo "${ECHO_T}$CPP" >&6 -ac_preproc_ok=false -for ac_c_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif - Syntax error -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - : -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - # Broken: fails on valid input. -continue -fi -rm -f conftest.err conftest.$ac_ext - - # OK, works on sane cases. Now check whether non-existent headers - # can be detected and how. - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - # Broken: success on invalid input. -continue -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - # Passes both tests. -ac_preproc_ok=: -break -fi -rm -f conftest.err conftest.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.err conftest.$ac_ext -if $ac_preproc_ok; then - : -else - { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details." >&5 -echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } -fi - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - -echo "$as_me:$LINENO: checking for egrep" >&5 -echo $ECHO_N "checking for egrep... $ECHO_C" >&6 -if test "${ac_cv_prog_egrep+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if echo a | (grep -E '(a|b)') >/dev/null 2>&1 - then ac_cv_prog_egrep='grep -E' - else ac_cv_prog_egrep='egrep' - fi -fi -echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5 -echo "${ECHO_T}$ac_cv_prog_egrep" >&6 - EGREP=$ac_cv_prog_egrep - - -echo "$as_me:$LINENO: checking for ANSI C header files" >&5 -echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 -if test "${ac_cv_header_stdc+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#include -#include -#include - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_header_stdc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_header_stdc=no -fi -rm -f conftest.$ac_objext conftest.$ac_ext - -if test $ac_cv_header_stdc = yes; then - # SunOS 4.x string.h does not declare mem*, contrary to ANSI. - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "memchr" >/dev/null 2>&1; then - : -else - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "free" >/dev/null 2>&1; then - : -else - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. - if test "$cross_compiling" = yes; then - : -else - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#if ((' ' & 0x0FF) == 0x020) -# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') -# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) -#else -# define ISLOWER(c) \ - (('a' <= (c) && (c) <= 'i') \ - || ('j' <= (c) && (c) <= 'r') \ - || ('s' <= (c) && (c) <= 'z')) -# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) -#endif - -#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) -int -main () -{ - int i; - for (i = 0; i < 256; i++) - if (XOR (islower (i), ISLOWER (i)) - || toupper (i) != TOUPPER (i)) - exit(2); - exit (0); -} -_ACEOF -rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - : -else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -ac_cv_header_stdc=no -fi -rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi -fi -fi -echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 -echo "${ECHO_T}$ac_cv_header_stdc" >&6 -if test $ac_cv_header_stdc = yes; then - -cat >>confdefs.h <<\_ACEOF -#define STDC_HEADERS 1 -_ACEOF - -fi - -# On IRIX 5.3, sys/types and inttypes.h are conflicting. - - - - - - - - - -for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ - inttypes.h stdint.h unistd.h -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default - -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - eval "$as_ac_Header=yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -eval "$as_ac_Header=no" -fi -rm -f conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - - -for ac_header in dlfcn.h -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 -else - # Is the header compilable? -echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_header_compiler=no -fi -rm -f conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 - -# Is the header present? -echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc in - yes:no ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; - no:yes ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - eval "$as_ac_Header=$ac_header_preproc" -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 - -fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - - - - -# Only perform the check for file, if the check method requires it -case $deplibs_check_method in -file_magic*) - if test "$file_magic_cmd" = '$MAGIC_CMD'; then - echo "$as_me:$LINENO: checking for ${ac_tool_prefix}file" >&5 -echo $ECHO_N "checking for ${ac_tool_prefix}file... $ECHO_C" >&6 -if test "${lt_cv_path_MAGIC_CMD+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - case $MAGIC_CMD in - /*) - lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. - ;; - ?:/*) - lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a dos path. - ;; - *) - ac_save_MAGIC_CMD="$MAGIC_CMD" - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="/usr/bin:$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/${ac_tool_prefix}file; then - lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file" - if test -n "$file_magic_test_file"; then - case $deplibs_check_method in - "file_magic "*) - file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`" - MAGIC_CMD="$lt_cv_path_MAGIC_CMD" - if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | - egrep "$file_magic_regex" > /dev/null; then - : - else - cat <&2 - -*** Warning: the command libtool uses to detect shared libraries, -*** $file_magic_cmd, produces output that libtool cannot recognize. -*** The result is that libtool may fail to recognize shared libraries -*** as such. This will affect the creation of libtool libraries that -*** depend on shared libraries, but programs linked with such libtool -*** libraries will work regardless of this problem. Nevertheless, you -*** may want to report the problem to your system manager and/or to -*** bug-libtool@gnu.org - -EOF - fi ;; - esac - fi - break - fi - done - IFS="$ac_save_ifs" - MAGIC_CMD="$ac_save_MAGIC_CMD" - ;; -esac -fi - -MAGIC_CMD="$lt_cv_path_MAGIC_CMD" -if test -n "$MAGIC_CMD"; then - echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5 -echo "${ECHO_T}$MAGIC_CMD" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - -if test -z "$lt_cv_path_MAGIC_CMD"; then - if test -n "$ac_tool_prefix"; then - echo "$as_me:$LINENO: checking for file" >&5 -echo $ECHO_N "checking for file... $ECHO_C" >&6 -if test "${lt_cv_path_MAGIC_CMD+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - case $MAGIC_CMD in - /*) - lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. - ;; - ?:/*) - lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a dos path. - ;; - *) - ac_save_MAGIC_CMD="$MAGIC_CMD" - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="/usr/bin:$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/file; then - lt_cv_path_MAGIC_CMD="$ac_dir/file" - if test -n "$file_magic_test_file"; then - case $deplibs_check_method in - "file_magic "*) - file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`" - MAGIC_CMD="$lt_cv_path_MAGIC_CMD" - if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | - egrep "$file_magic_regex" > /dev/null; then - : - else - cat <&2 - -*** Warning: the command libtool uses to detect shared libraries, -*** $file_magic_cmd, produces output that libtool cannot recognize. -*** The result is that libtool may fail to recognize shared libraries -*** as such. This will affect the creation of libtool libraries that -*** depend on shared libraries, but programs linked with such libtool -*** libraries will work regardless of this problem. Nevertheless, you -*** may want to report the problem to your system manager and/or to -*** bug-libtool@gnu.org - -EOF - fi ;; - esac - fi - break - fi - done - IFS="$ac_save_ifs" - MAGIC_CMD="$ac_save_MAGIC_CMD" - ;; -esac -fi - -MAGIC_CMD="$lt_cv_path_MAGIC_CMD" -if test -n "$MAGIC_CMD"; then - echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5 -echo "${ECHO_T}$MAGIC_CMD" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - - else - MAGIC_CMD=: - fi -fi - - fi - ;; -esac - -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. -set dummy ${ac_tool_prefix}ranlib; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_RANLIB+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$RANLIB"; then - ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - -fi -fi -RANLIB=$ac_cv_prog_RANLIB -if test -n "$RANLIB"; then - echo "$as_me:$LINENO: result: $RANLIB" >&5 -echo "${ECHO_T}$RANLIB" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - -fi -if test -z "$ac_cv_prog_RANLIB"; then - ac_ct_RANLIB=$RANLIB - # Extract the first word of "ranlib", so it can be a program name with args. -set dummy ranlib; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$ac_ct_RANLIB"; then - ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_RANLIB="ranlib" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - - test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB=":" -fi -fi -ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB -if test -n "$ac_ct_RANLIB"; then - echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 -echo "${ECHO_T}$ac_ct_RANLIB" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - - RANLIB=$ac_ct_RANLIB -else - RANLIB="$ac_cv_prog_RANLIB" -fi - -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. -set dummy ${ac_tool_prefix}strip; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_STRIP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$STRIP"; then - ac_cv_prog_STRIP="$STRIP" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_STRIP="${ac_tool_prefix}strip" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - -fi -fi -STRIP=$ac_cv_prog_STRIP -if test -n "$STRIP"; then - echo "$as_me:$LINENO: result: $STRIP" >&5 -echo "${ECHO_T}$STRIP" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - -fi -if test -z "$ac_cv_prog_STRIP"; then - ac_ct_STRIP=$STRIP - # Extract the first word of "strip", so it can be a program name with args. -set dummy strip; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$ac_ct_STRIP"; then - ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_STRIP="strip" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - - test -z "$ac_cv_prog_ac_ct_STRIP" && ac_cv_prog_ac_ct_STRIP=":" -fi -fi -ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP -if test -n "$ac_ct_STRIP"; then - echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 -echo "${ECHO_T}$ac_ct_STRIP" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - - STRIP=$ac_ct_STRIP -else - STRIP="$ac_cv_prog_STRIP" -fi - - -enable_dlopen=no -enable_win32_dll=no - -# Check whether --enable-libtool-lock or --disable-libtool-lock was given. -if test "${enable_libtool_lock+set}" = set; then - enableval="$enable_libtool_lock" - -fi; -test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes - -# Some flags need to be propagated to the compiler or linker for good -# libtool support. -case $host in -*-*-irix6*) - # Find out which ABI we are using. - echo '#line 4380 "configure"' > conftest.$ac_ext - if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - case `/usr/bin/file conftest.$ac_objext` in - *32-bit*) - LD="${LD-ld} -32" - ;; - *N32*) - LD="${LD-ld} -n32" - ;; - *64-bit*) - LD="${LD-ld} -64" - ;; - esac - fi - rm -rf conftest* - ;; - -*-*-sco3.2v5*) - # On SCO OpenServer 5, we need -belf to get full-featured binaries. - SAVE_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS -belf" - echo "$as_me:$LINENO: checking whether the C compiler needs -belf" >&5 -echo $ECHO_N "checking whether the C compiler needs -belf... $ECHO_C" >&6 -if test "${lt_cv_cc_needs_belf+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - - - ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - lt_cv_cc_needs_belf=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -lt_cv_cc_needs_belf=no -fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext - ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - -fi -echo "$as_me:$LINENO: result: $lt_cv_cc_needs_belf" >&5 -echo "${ECHO_T}$lt_cv_cc_needs_belf" >&6 - if test x"$lt_cv_cc_needs_belf" != x"yes"; then - # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf - CFLAGS="$SAVE_CFLAGS" - fi - ;; - - -esac - -# Sed substitution that helps us do robust quoting. It backslashifies -# metacharacters that are still active within double-quoted strings. -Xsed='sed -e s/^X//' -sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g' - -# Same as above, but do not quote variable references. -double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g' - -# Sed substitution to delay expansion of an escaped shell variable in a -# double_quote_subst'ed string. -delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' - -# Constants: -rm="rm -f" - -# Global variables: -default_ofile=libtool -can_build_shared=yes - -# All known linkers require a `.a' archive for static linking (except M$VC, -# which needs '.lib'). -libext=a -ltmain="$ac_aux_dir/ltmain.sh" -ofile="$default_ofile" -with_gnu_ld="$lt_cv_prog_gnu_ld" -need_locks="$enable_libtool_lock" - -old_CC="$CC" -old_CFLAGS="$CFLAGS" - -# Set sane defaults for various variables -test -z "$AR" && AR=ar -test -z "$AR_FLAGS" && AR_FLAGS=cru -test -z "$AS" && AS=as -test -z "$CC" && CC=cc -test -z "$DLLTOOL" && DLLTOOL=dlltool -test -z "$LD" && LD=ld -test -z "$LN_S" && LN_S="ln -s" -test -z "$MAGIC_CMD" && MAGIC_CMD=file -test -z "$NM" && NM=nm -test -z "$OBJDUMP" && OBJDUMP=objdump -test -z "$RANLIB" && RANLIB=: -test -z "$STRIP" && STRIP=: -test -z "$ac_objext" && ac_objext=o - -if test x"$host" != x"$build"; then - ac_tool_prefix=${host_alias}- -else - ac_tool_prefix= -fi - -# Transform linux* to *-*-linux-gnu*, to support old configure scripts. -case $host_os in -linux-gnu*) ;; -linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'` -esac - -case $host_os in -aix3*) - # AIX sometimes has problems with the GCC collect2 program. For some - # reason, if we set the COLLECT_NAMES environment variable, the problems - # vanish in a puff of smoke. - if test "X${COLLECT_NAMES+set}" != Xset; then - COLLECT_NAMES= - export COLLECT_NAMES - fi - ;; -esac - -# Determine commands to create old-style static archives. -old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs' -old_postinstall_cmds='chmod 644 $oldlib' -old_postuninstall_cmds= - -if test -n "$RANLIB"; then - case $host_os in - openbsd*) - old_postinstall_cmds="\$RANLIB -t \$oldlib~$old_postinstall_cmds" - ;; - *) - old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds" - ;; - esac - old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" -fi - -# Allow CC to be a program name with arguments. -set dummy $CC -compiler="$2" - -## FIXME: this should be a separate macro -## -echo "$as_me:$LINENO: checking for objdir" >&5 -echo $ECHO_N "checking for objdir... $ECHO_C" >&6 -rm -f .libs 2>/dev/null -mkdir .libs 2>/dev/null -if test -d .libs; then - objdir=.libs -else - # MS-DOS does not allow filenames that begin with a dot. - objdir=_libs -fi -rmdir .libs 2>/dev/null -echo "$as_me:$LINENO: result: $objdir" >&5 -echo "${ECHO_T}$objdir" >&6 -## -## END FIXME - - -## FIXME: this should be a separate macro -## - -# Check whether --with-pic or --without-pic was given. -if test "${with_pic+set}" = set; then - withval="$with_pic" - pic_mode="$withval" -else - pic_mode=default -fi; -test -z "$pic_mode" && pic_mode=default - -# We assume here that the value for lt_cv_prog_cc_pic will not be cached -# in isolation, and that seeing it set (from the cache) indicates that -# the associated values are set (in the cache) correctly too. -echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 -echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6 -if test "${lt_cv_prog_cc_pic+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - lt_cv_prog_cc_pic= - lt_cv_prog_cc_shlib= - lt_cv_prog_cc_wl= - lt_cv_prog_cc_static= - lt_cv_prog_cc_no_builtin= - lt_cv_prog_cc_can_build_shared=$can_build_shared - - if test "$GCC" = yes; then - lt_cv_prog_cc_wl='-Wl,' - lt_cv_prog_cc_static='-static' - - case $host_os in - aix*) - # Below there is a dirty hack to force normal static linking with -ldl - # The problem is because libdl dynamically linked with both libc and - # libC (AIX C++ library), which obviously doesn't included in libraries - # list by gcc. This cause undefined symbols with -static flags. - # This hack allows C programs to be linked with "-static -ldl", but - # not sure about C++ programs. - lt_cv_prog_cc_static="$lt_cv_prog_cc_static ${lt_cv_prog_cc_wl}-lC" - ;; - amigaos*) - # FIXME: we need at least 68020 code to build shared libraries, but - # adding the `-m68020' flag to GCC prevents building anything better, - # like `-m68040'. - lt_cv_prog_cc_pic='-m68020 -resident32 -malways-restore-a4' - ;; - beos* | irix5* | irix6* | osf3* | osf4* | osf5*) - # PIC is the default for these OSes. - ;; - darwin* | rhapsody*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - lt_cv_prog_cc_pic='-fno-common' - ;; - cygwin* | mingw* | pw32* | os2*) - # This hack is so that the source file can tell whether it is being - # built for inclusion in a dll (and should export symbols for example). - lt_cv_prog_cc_pic='-DDLL_EXPORT' - ;; - sysv4*MP*) - if test -d /usr/nec; then - lt_cv_prog_cc_pic=-Kconform_pic - fi - ;; - *) - lt_cv_prog_cc_pic='-fPIC' - ;; - esac - else - # PORTME Check for PIC flags for the system compiler. - case $host_os in - aix3* | aix4* | aix5*) - lt_cv_prog_cc_wl='-Wl,' - # All AIX code is PIC. - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - lt_cv_prog_cc_static='-Bstatic' - else - lt_cv_prog_cc_static='-bnso -bI:/lib/syscalls.exp' - fi - ;; - - hpux9* | hpux10* | hpux11*) - # Is there a better lt_cv_prog_cc_static that works with the bundled CC? - lt_cv_prog_cc_wl='-Wl,' - lt_cv_prog_cc_static="${lt_cv_prog_cc_wl}-a ${lt_cv_prog_cc_wl}archive" - lt_cv_prog_cc_pic='+Z' - ;; - - irix5* | irix6*) - lt_cv_prog_cc_wl='-Wl,' - lt_cv_prog_cc_static='-non_shared' - # PIC (with -KPIC) is the default. - ;; - - cygwin* | mingw* | pw32* | os2*) - # This hack is so that the source file can tell whether it is being - # built for inclusion in a dll (and should export symbols for example). - lt_cv_prog_cc_pic='-DDLL_EXPORT' - ;; - - newsos6) - lt_cv_prog_cc_pic='-KPIC' - lt_cv_prog_cc_static='-Bstatic' - ;; - - osf3* | osf4* | osf5*) - # All OSF/1 code is PIC. - lt_cv_prog_cc_wl='-Wl,' - lt_cv_prog_cc_static='-non_shared' - ;; - - sco3.2v5*) - lt_cv_prog_cc_pic='-Kpic' - lt_cv_prog_cc_static='-dn' - lt_cv_prog_cc_shlib='-belf' - ;; - - solaris*) - lt_cv_prog_cc_pic='-KPIC' - lt_cv_prog_cc_static='-Bstatic' - lt_cv_prog_cc_wl='-Wl,' - ;; - - sunos4*) - lt_cv_prog_cc_pic='-PIC' - lt_cv_prog_cc_static='-Bstatic' - lt_cv_prog_cc_wl='-Qoption ld ' - ;; - - sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) - lt_cv_prog_cc_pic='-KPIC' - lt_cv_prog_cc_static='-Bstatic' - if test "x$host_vendor" = xsni; then - lt_cv_prog_cc_wl='-LD' - else - lt_cv_prog_cc_wl='-Wl,' - fi - ;; - - uts4*) - lt_cv_prog_cc_pic='-pic' - lt_cv_prog_cc_static='-Bstatic' - ;; - - sysv4*MP*) - if test -d /usr/nec ;then - lt_cv_prog_cc_pic='-Kconform_pic' - lt_cv_prog_cc_static='-Bstatic' - fi - ;; - - *) - lt_cv_prog_cc_can_build_shared=no - ;; - esac - fi - -fi - -if test -z "$lt_cv_prog_cc_pic"; then - echo "$as_me:$LINENO: result: none" >&5 -echo "${ECHO_T}none" >&6 -else - echo "$as_me:$LINENO: result: $lt_cv_prog_cc_pic" >&5 -echo "${ECHO_T}$lt_cv_prog_cc_pic" >&6 - - # Check to make sure the pic_flag actually works. - echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_cv_prog_cc_pic works" >&5 -echo $ECHO_N "checking if $compiler PIC flag $lt_cv_prog_cc_pic works... $ECHO_C" >&6 - if test "${lt_cv_prog_cc_pic_works+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - save_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS $lt_cv_prog_cc_pic -DPIC" - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - case $host_os in - hpux9* | hpux10* | hpux11*) - # On HP-UX, both CC and GCC only warn that PIC is supported... then - # they create non-PIC objects. So, if there were any warnings, we - # assume that PIC is not supported. - if test -s conftest.err; then - lt_cv_prog_cc_pic_works=no - else - lt_cv_prog_cc_pic_works=yes - fi - ;; - *) - lt_cv_prog_cc_pic_works=yes - ;; - esac - -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - lt_cv_prog_cc_pic_works=no - -fi -rm -f conftest.$ac_objext conftest.$ac_ext - CFLAGS="$save_CFLAGS" - -fi - - - if test "X$lt_cv_prog_cc_pic_works" = Xno; then - lt_cv_prog_cc_pic= - lt_cv_prog_cc_can_build_shared=no - else - lt_cv_prog_cc_pic=" $lt_cv_prog_cc_pic" - fi - - echo "$as_me:$LINENO: result: $lt_cv_prog_cc_pic_works" >&5 -echo "${ECHO_T}$lt_cv_prog_cc_pic_works" >&6 -fi -## -## END FIXME - -# Check for any special shared library compilation flags. -if test -n "$lt_cv_prog_cc_shlib"; then - { echo "$as_me:$LINENO: WARNING: \`$CC' requires \`$lt_cv_prog_cc_shlib' to build shared libraries" >&5 -echo "$as_me: WARNING: \`$CC' requires \`$lt_cv_prog_cc_shlib' to build shared libraries" >&2;} - if echo "$old_CC $old_CFLAGS " | egrep -e "[ ]$lt_cv_prog_cc_shlib[ ]" >/dev/null; then : - else - { echo "$as_me:$LINENO: WARNING: add \`$lt_cv_prog_cc_shlib' to the CC or CFLAGS env variable and reconfigure" >&5 -echo "$as_me: WARNING: add \`$lt_cv_prog_cc_shlib' to the CC or CFLAGS env variable and reconfigure" >&2;} - lt_cv_prog_cc_can_build_shared=no - fi -fi - -## FIXME: this should be a separate macro -## -echo "$as_me:$LINENO: checking if $compiler static flag $lt_cv_prog_cc_static works" >&5 -echo $ECHO_N "checking if $compiler static flag $lt_cv_prog_cc_static works... $ECHO_C" >&6 -if test "${lt_cv_prog_cc_static_works+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - lt_cv_prog_cc_static_works=no - save_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS $lt_cv_prog_cc_static" - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - lt_cv_prog_cc_static_works=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext - LDFLAGS="$save_LDFLAGS" - -fi - - -# Belt *and* braces to stop my trousers falling down: -test "X$lt_cv_prog_cc_static_works" = Xno && lt_cv_prog_cc_static= -echo "$as_me:$LINENO: result: $lt_cv_prog_cc_static_works" >&5 -echo "${ECHO_T}$lt_cv_prog_cc_static_works" >&6 - -pic_flag="$lt_cv_prog_cc_pic" -special_shlib_compile_flags="$lt_cv_prog_cc_shlib" -wl="$lt_cv_prog_cc_wl" -link_static_flag="$lt_cv_prog_cc_static" -no_builtin_flag="$lt_cv_prog_cc_no_builtin" -can_build_shared="$lt_cv_prog_cc_can_build_shared" -## -## END FIXME - - -## FIXME: this should be a separate macro -## -# Check to see if options -o and -c are simultaneously supported by compiler -echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 -echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6 -if test "${lt_cv_compiler_c_o+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - -$rm -r conftest 2>/dev/null -mkdir conftest -cd conftest -echo "int some_variable = 0;" > conftest.$ac_ext -mkdir out -# According to Tom Tromey, Ian Lance Taylor reported there are C compilers -# that will create temporary files in the current directory regardless of -# the output directory. Thus, making CWD read-only will cause this test -# to fail, enabling locking or at least warning the user not to do parallel -# builds. -chmod -w . -save_CFLAGS="$CFLAGS" -CFLAGS="$CFLAGS -o out/conftest2.$ac_objext" -compiler_c_o=no -if { (eval echo configure:4927: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>out/conftest.err; } && test -s out/conftest2.$ac_objext; then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings - if test -s out/conftest.err; then - lt_cv_compiler_c_o=no - else - lt_cv_compiler_c_o=yes - fi -else - # Append any errors to the config.log. - cat out/conftest.err 1>&5 - lt_cv_compiler_c_o=no -fi -CFLAGS="$save_CFLAGS" -chmod u+w . -$rm conftest* out/* -rmdir out -cd .. -rmdir conftest -$rm -r conftest 2>/dev/null - -fi - -compiler_c_o=$lt_cv_compiler_c_o -echo "$as_me:$LINENO: result: $compiler_c_o" >&5 -echo "${ECHO_T}$compiler_c_o" >&6 - -if test x"$compiler_c_o" = x"yes"; then - # Check to see if we can write to a .lo - echo "$as_me:$LINENO: checking if $compiler supports -c -o file.lo" >&5 -echo $ECHO_N "checking if $compiler supports -c -o file.lo... $ECHO_C" >&6 - if test "${lt_cv_compiler_o_lo+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - - lt_cv_compiler_o_lo=no - save_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS -c -o conftest.lo" - save_objext="$ac_objext" - ac_objext=lo - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ -int some_variable = 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings - if test -s conftest.err; then - lt_cv_compiler_o_lo=no - else - lt_cv_compiler_o_lo=yes - fi - -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi -rm -f conftest.$ac_objext conftest.$ac_ext - ac_objext="$save_objext" - CFLAGS="$save_CFLAGS" - -fi - - compiler_o_lo=$lt_cv_compiler_o_lo - echo "$as_me:$LINENO: result: $compiler_o_lo" >&5 -echo "${ECHO_T}$compiler_o_lo" >&6 -else - compiler_o_lo=no -fi -## -## END FIXME - -## FIXME: this should be a separate macro -## -# Check to see if we can do hard links to lock some files if needed -hard_links="nottested" -if test "$compiler_c_o" = no && test "$need_locks" != no; then - # do not overwrite the value of need_locks provided by the user - echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 -echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6 - hard_links=yes - $rm conftest* - ln conftest.a conftest.b 2>/dev/null && hard_links=no - touch conftest.a - ln conftest.a conftest.b 2>&5 || hard_links=no - ln conftest.a conftest.b 2>/dev/null && hard_links=no - echo "$as_me:$LINENO: result: $hard_links" >&5 -echo "${ECHO_T}$hard_links" >&6 - if test "$hard_links" = no; then - { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 -echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} - need_locks=warn - fi -else - need_locks=no -fi -## -## END FIXME - -## FIXME: this should be a separate macro -## -if test "$GCC" = yes; then - # Check to see if options -fno-rtti -fno-exceptions are supported by compiler - echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 -echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6 - echo "int some_variable = 0;" > conftest.$ac_ext - save_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS -fno-rtti -fno-exceptions -c conftest.$ac_ext" - compiler_rtti_exceptions=no - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ -int some_variable = 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings - if test -s conftest.err; then - compiler_rtti_exceptions=no - else - compiler_rtti_exceptions=yes - fi - -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi -rm -f conftest.$ac_objext conftest.$ac_ext - CFLAGS="$save_CFLAGS" - echo "$as_me:$LINENO: result: $compiler_rtti_exceptions" >&5 -echo "${ECHO_T}$compiler_rtti_exceptions" >&6 - - if test "$compiler_rtti_exceptions" = "yes"; then - no_builtin_flag=' -fno-builtin -fno-rtti -fno-exceptions' - else - no_builtin_flag=' -fno-builtin' - fi -fi -## -## END FIXME - -## FIXME: this should be a separate macro -## -# See if the linker supports building shared libraries. -echo "$as_me:$LINENO: checking whether the linker ($LD) supports shared libraries" >&5 -echo $ECHO_N "checking whether the linker ($LD) supports shared libraries... $ECHO_C" >&6 - -allow_undefined_flag= -no_undefined_flag= -need_lib_prefix=unknown -need_version=unknown -# when you set need_version to no, make sure it does not cause -set_version -# flags to be left without arguments -archive_cmds= -archive_expsym_cmds= -old_archive_from_new_cmds= -old_archive_from_expsyms_cmds= -export_dynamic_flag_spec= -whole_archive_flag_spec= -thread_safe_flag_spec= -hardcode_into_libs=no -hardcode_libdir_flag_spec= -hardcode_libdir_separator= -hardcode_direct=no -hardcode_minus_L=no -hardcode_shlibpath_var=unsupported -runpath_var= -link_all_deplibs=unknown -always_export_symbols=no -export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | sed '\''s/.* //'\'' | sort | uniq > $export_symbols' -# include_expsyms should be a list of space-separated symbols to be *always* -# included in the symbol list -include_expsyms= -# exclude_expsyms can be an egrep regular expression of symbols to exclude -# it will be wrapped by ` (' and `)$', so one must not match beginning or -# end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', -# as well as any symbol that contains `d'. -exclude_expsyms="_GLOBAL_OFFSET_TABLE_" -# Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out -# platforms (ab)use it in PIC code, but their linkers get confused if -# the symbol is explicitly referenced. Since portable code cannot -# rely on this symbol name, it's probably fine to never include it in -# preloaded symbol tables. -extract_expsyms_cmds= - -case $host_os in -cygwin* | mingw* | pw32*) - # FIXME: the MSVC++ port hasn't been tested in a loooong time - # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. - if test "$GCC" != yes; then - with_gnu_ld=no - fi - ;; -openbsd*) - with_gnu_ld=no - ;; -esac - -ld_shlibs=yes -if test "$with_gnu_ld" = yes; then - # If archive_cmds runs LD, not CC, wlarc should be empty - wlarc='${wl}' - - # See if GNU ld supports shared libraries. - case $host_os in - aix3* | aix4* | aix5*) - # On AIX, the GNU linker is very broken - # Note:Check GNU linker on AIX 5-IA64 when/if it becomes available. - ld_shlibs=no - cat <&2 - -*** Warning: the GNU linker, at least up to release 2.9.1, is reported -*** to be unable to reliably create shared libraries on AIX. -*** Therefore, libtool is disabling shared libraries support. If you -*** really care for shared libraries, you may want to modify your PATH -*** so that a non-GNU linker is found, and then restart. - -EOF - ;; - - amigaos*) - archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' - hardcode_libdir_flag_spec='-L$libdir' - hardcode_minus_L=yes - - # Samuel A. Falvo II reports - # that the semantics of dynamic libraries on AmigaOS, at least up - # to version 4, is to share data among multiple programs linked - # with the same dynamic library. Since this doesn't match the - # behavior of shared libraries on other platforms, we can use - # them. - ld_shlibs=no - ;; - - beos*) - if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then - allow_undefined_flag=unsupported - # Joseph Beckenbach says some releases of gcc - # support --undefined. This deserves some investigation. FIXME - archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - else - ld_shlibs=no - fi - ;; - - cygwin* | mingw* | pw32*) - # hardcode_libdir_flag_spec is actually meaningless, as there is - # no search path for DLLs. - hardcode_libdir_flag_spec='-L$libdir' - allow_undefined_flag=unsupported - always_export_symbols=yes - - extract_expsyms_cmds='test -f $output_objdir/impgen.c || \ - sed -e "/^# \/\* impgen\.c starts here \*\//,/^# \/\* impgen.c ends here \*\// { s/^# //;s/^# *$//; p; }" -e d < $''0 > $output_objdir/impgen.c~ - test -f $output_objdir/impgen.exe || (cd $output_objdir && \ - if test "x$HOST_CC" != "x" ; then $HOST_CC -o impgen impgen.c ; \ - else $CC -o impgen impgen.c ; fi)~ - $output_objdir/impgen $dir/$soroot > $output_objdir/$soname-def' - - old_archive_from_expsyms_cmds='$DLLTOOL --as=$AS --dllname $soname --def $output_objdir/$soname-def --output-lib $output_objdir/$newlib' - - # cygwin and mingw dlls have different entry points and sets of symbols - # to exclude. - # FIXME: what about values for MSVC? - dll_entry=__cygwin_dll_entry@12 - dll_exclude_symbols=DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12~ - case $host_os in - mingw*) - # mingw values - dll_entry=_DllMainCRTStartup@12 - dll_exclude_symbols=DllMain@12,DllMainCRTStartup@12,DllEntryPoint@12~ - ;; - esac - - # mingw and cygwin differ, and it's simplest to just exclude the union - # of the two symbol sets. - dll_exclude_symbols=DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12,DllMainCRTStartup@12,DllEntryPoint@12 - - # recent cygwin and mingw systems supply a stub DllMain which the user - # can override, but on older systems we have to supply one (in ltdll.c) - if test "x$lt_cv_need_dllmain" = "xyes"; then - ltdll_obj='$output_objdir/$soname-ltdll.'"$ac_objext " - ltdll_cmds='test -f $output_objdir/$soname-ltdll.c || sed -e "/^# \/\* ltdll\.c starts here \*\//,/^# \/\* ltdll.c ends here \*\// { s/^# //; p; }" -e d < $''0 > $output_objdir/$soname-ltdll.c~ - test -f $output_objdir/$soname-ltdll.$ac_objext || (cd $output_objdir && $CC -c $soname-ltdll.c)~' - else - ltdll_obj= - ltdll_cmds= - fi - - # Extract the symbol export list from an `--export-all' def file, - # then regenerate the def file from the symbol export list, so that - # the compiled dll only exports the symbol export list. - # Be careful not to strip the DATA tag left be newer dlltools. - export_symbols_cmds="$ltdll_cmds"' - $DLLTOOL --export-all --exclude-symbols '$dll_exclude_symbols' --output-def $output_objdir/$soname-def '$ltdll_obj'$libobjs $convenience~ - sed -e "1,/EXPORTS/d" -e "s/ @ [0-9]*//" -e "s/ *;.*$//" < $output_objdir/$soname-def > $export_symbols' - - # If the export-symbols file already is a .def file (1st line - # is EXPORTS), use it as is. - # If DATA tags from a recent dlltool are present, honour them! - archive_expsym_cmds='if test "x`head -1 $export_symbols`" = xEXPORTS; then - cp $export_symbols $output_objdir/$soname-def; - else - echo EXPORTS > $output_objdir/$soname-def; - _lt_hint=1; - cat $export_symbols | while read symbol; do - set dummy \$symbol; - case \$# in - 2) echo " \$2 @ \$_lt_hint ; " >> $output_objdir/$soname-def;; - *) echo " \$2 @ \$_lt_hint \$3 ; " >> $output_objdir/$soname-def;; - esac; - _lt_hint=`expr 1 + \$_lt_hint`; - done; - fi~ - '"$ltdll_cmds"' - $CC -Wl,--base-file,$output_objdir/$soname-base '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags~ - $DLLTOOL --as=$AS --dllname $soname --exclude-symbols '$dll_exclude_symbols' --def $output_objdir/$soname-def --base-file $output_objdir/$soname-base --output-exp $output_objdir/$soname-exp~ - $CC -Wl,--base-file,$output_objdir/$soname-base $output_objdir/$soname-exp '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags~ - $DLLTOOL --as=$AS --dllname $soname --exclude-symbols '$dll_exclude_symbols' --def $output_objdir/$soname-def --base-file $output_objdir/$soname-base --output-exp $output_objdir/$soname-exp --output-lib $output_objdir/$libname.dll.a~ - $CC $output_objdir/$soname-exp '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags' - ;; - - netbsd*) - if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then - archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' - wlarc= - else - archive_cmds='$CC -shared -nodefaultlibs $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds='$CC -shared -nodefaultlibs $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - fi - ;; - - solaris* | sysv5*) - if $LD -v 2>&1 | egrep 'BFD 2\.8' > /dev/null; then - ld_shlibs=no - cat <&2 - -*** Warning: The releases 2.8.* of the GNU linker cannot reliably -*** create shared libraries on Solaris systems. Therefore, libtool -*** is disabling shared libraries support. We urge you to upgrade GNU -*** binutils to release 2.9.1 or newer. Another option is to modify -*** your PATH or compiler configuration so that the native linker is -*** used, and then restart. - -EOF - elif $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - else - ld_shlibs=no - fi - ;; - - sunos4*) - archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' - wlarc= - hardcode_direct=yes - hardcode_shlibpath_var=no - ;; - - *) - if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - else - ld_shlibs=no - fi - ;; - esac - - if test "$ld_shlibs" = yes; then - runpath_var=LD_RUN_PATH - hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir' - export_dynamic_flag_spec='${wl}--export-dynamic' - case $host_os in - cygwin* | mingw* | pw32*) - # dlltool doesn't understand --whole-archive et. al. - whole_archive_flag_spec= - ;; - *) - # ancient GNU ld didn't support --whole-archive et. al. - if $LD --help 2>&1 | egrep 'no-whole-archive' > /dev/null; then - whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' - else - whole_archive_flag_spec= - fi - ;; - esac - fi -else - # PORTME fill in a description of your system's linker (not GNU ld) - case $host_os in - aix3*) - allow_undefined_flag=unsupported - always_export_symbols=yes - archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' - # Note: this linker hardcodes the directories in LIBPATH if there - # are no directories specified by -L. - hardcode_minus_L=yes - if test "$GCC" = yes && test -z "$link_static_flag"; then - # Neither direct hardcoding nor static linking is supported with a - # broken collect2. - hardcode_direct=unsupported - fi - ;; - - aix4* | aix5*) - if test "$host_cpu" = ia64; then - # On IA64, the linker does run time linking by default, so we don't - # have to do anything special. - aix_use_runtimelinking=no - exp_sym_flag='-Bexport' - no_entry_flag="" - else - aix_use_runtimelinking=no - - # Test if we are trying to use run time linking or normal - # AIX style linking. If -brtl is somewhere in LDFLAGS, we - # need to do runtime linking. - case $host_os in aix4.[23]|aix4.[23].*|aix5*) - for ld_flag in $LDFLAGS; do - if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then - aix_use_runtimelinking=yes - break - fi - done - esac - - exp_sym_flag='-bexport' - no_entry_flag='-bnoentry' - fi - - # When large executables or shared objects are built, AIX ld can - # have problems creating the table of contents. If linking a library - # or program results in "error TOC overflow" add -mminimal-toc to - # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not - # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. - - hardcode_direct=yes - archive_cmds='' - hardcode_libdir_separator=':' - if test "$GCC" = yes; then - case $host_os in aix4.[012]|aix4.[012].*) - collect2name=`${CC} -print-prog-name=collect2` - if test -f "$collect2name" && \ - strings "$collect2name" | grep resolve_lib_name >/dev/null - then - # We have reworked collect2 - hardcode_direct=yes - else - # We have old collect2 - hardcode_direct=unsupported - # It fails to find uninstalled libraries when the uninstalled - # path is not listed in the libpath. Setting hardcode_minus_L - # to unsupported forces relinking - hardcode_minus_L=yes - hardcode_libdir_flag_spec='-L$libdir' - hardcode_libdir_separator= - fi - esac - - shared_flag='-shared' - else - # not using gcc - if test "$host_cpu" = ia64; then - shared_flag='${wl}-G' - else - if test "$aix_use_runtimelinking" = yes; then - shared_flag='${wl}-G' - else - shared_flag='${wl}-bM:SRE' - fi - fi - fi - - # It seems that -bexpall can do strange things, so it is better to - # generate a list of symbols to export. - always_export_symbols=yes - if test "$aix_use_runtimelinking" = yes; then - # Warning - without using the other runtime loading flags (-brtl), - # -berok will link without error, but may produce a broken library. - allow_undefined_flag='-berok' - hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:/usr/lib:/lib' - archive_expsym_cmds="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag" - else - if test "$host_cpu" = ia64; then - hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' - allow_undefined_flag="-z nodefs" - archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname ${wl}-h$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols" - else - hardcode_libdir_flag_spec='${wl}-bnolibpath ${wl}-blibpath:$libdir:/usr/lib:/lib' - # Warning - without using the other run time loading flags, - # -berok will link without error, but may produce a broken library. - allow_undefined_flag='${wl}-berok' - # This is a bit strange, but is similar to how AIX traditionally builds - # it's shared libraries. - archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"' ~$AR -crlo $objdir/$libname$release.a $objdir/$soname' - fi - fi - ;; - - amigaos*) - archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' - hardcode_libdir_flag_spec='-L$libdir' - hardcode_minus_L=yes - # see comment about different semantics on the GNU ld section - ld_shlibs=no - ;; - - cygwin* | mingw* | pw32*) - # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. - # hardcode_libdir_flag_spec is actually meaningless, as there is - # no search path for DLLs. - hardcode_libdir_flag_spec=' ' - allow_undefined_flag=unsupported - # Tell ltmain to make .lib files, not .a files. - libext=lib - # FIXME: Setting linknames here is a bad hack. - archive_cmds='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | sed -e '\''s/ -lc$//'\''` -link -dll~linknames=' - # The linker will automatically build a .lib file if we build a DLL. - old_archive_from_new_cmds='true' - # FIXME: Should let the user specify the lib program. - old_archive_cmds='lib /OUT:$oldlib$oldobjs$old_deplibs' - fix_srcfile_path='`cygpath -w "$srcfile"`' - ;; - - darwin* | rhapsody*) - case "$host_os" in - rhapsody* | darwin1.[012]) - allow_undefined_flag='-undefined suppress' - ;; - *) # Darwin 1.3 on - allow_undefined_flag='-flat_namespace -undefined suppress' - ;; - esac - # FIXME: Relying on posixy $() will cause problems for - # cross-compilation, but unfortunately the echo tests do not - # yet detect zsh echo's removal of \ escapes. - archive_cmds='$nonopt $(test "x$module" = xyes && echo -bundle || echo -dynamiclib) $allow_undefined_flag -o $lib $libobjs $deplibs$linker_flags -install_name $rpath/$soname $verstring' - # We need to add '_' to the symbols in $export_symbols first - #archive_expsym_cmds="$archive_cmds"' && strip -s $export_symbols' - hardcode_direct=yes - hardcode_shlibpath_var=no - whole_archive_flag_spec='-all_load $convenience' - ;; - - freebsd1*) - ld_shlibs=no - ;; - - # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor - # support. Future versions do this automatically, but an explicit c++rt0.o - # does not break anything, and helps significantly (at the cost of a little - # extra space). - freebsd2.2*) - archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' - hardcode_libdir_flag_spec='-R$libdir' - hardcode_direct=yes - hardcode_shlibpath_var=no - ;; - - # Unfortunately, older versions of FreeBSD 2 do not have this feature. - freebsd2*) - archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct=yes - hardcode_minus_L=yes - hardcode_shlibpath_var=no - ;; - - # FreeBSD 3 and greater uses gcc -shared to do shared libraries. - freebsd*) - archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' - hardcode_libdir_flag_spec='-R$libdir' - hardcode_direct=yes - hardcode_shlibpath_var=no - ;; - - hpux9* | hpux10* | hpux11*) - case $host_os in - hpux9*) archive_cmds='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' ;; - *) archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' ;; - esac - hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' - hardcode_libdir_separator=: - hardcode_direct=yes - hardcode_minus_L=yes # Not in the search PATH, but as the default - # location of the library. - export_dynamic_flag_spec='${wl}-E' - ;; - - irix5* | irix6*) - if test "$GCC" = yes; then - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - else - archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - fi - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator=: - link_all_deplibs=yes - ;; - - netbsd*) - if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then - archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out - else - archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF - fi - hardcode_libdir_flag_spec='-R$libdir' - hardcode_direct=yes - hardcode_shlibpath_var=no - ;; - - newsos6) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct=yes - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator=: - hardcode_shlibpath_var=no - ;; - - openbsd*) - hardcode_direct=yes - hardcode_shlibpath_var=no - if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec='${wl}-rpath,$libdir' - export_dynamic_flag_spec='${wl}-E' - else - case "$host_os" in - openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) - archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec='-R$libdir' - ;; - *) - archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec='${wl}-rpath,$libdir' - ;; - esac - fi - ;; - - os2*) - hardcode_libdir_flag_spec='-L$libdir' - hardcode_minus_L=yes - allow_undefined_flag=unsupported - archive_cmds='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' - old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' - ;; - - osf3*) - if test "$GCC" = yes; then - allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - else - allow_undefined_flag=' -expect_unresolved \*' - archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - fi - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator=: - ;; - - osf4* | osf5*) # as osf3* with the addition of -msym flag - if test "$GCC" = yes; then - allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' - else - allow_undefined_flag=' -expect_unresolved \*' - archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - archive_expsym_cmds='for i in `cat $export_symbols`; do printf "-exported_symbol " >> $lib.exp; echo "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ - $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib~$rm $lib.exp' - - #Both c and cxx compiler support -rpath directly - hardcode_libdir_flag_spec='-rpath $libdir' - fi - hardcode_libdir_separator=: - ;; - - sco3.2v5*) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_shlibpath_var=no - runpath_var=LD_RUN_PATH - hardcode_runpath_var=yes - export_dynamic_flag_spec='${wl}-Bexport' - ;; - - solaris*) - # gcc --version < 3.0 without binutils cannot create self contained - # shared libraries reliably, requiring libgcc.a to resolve some of - # the object symbols generated in some cases. Libraries that use - # assert need libgcc.a to resolve __eprintf, for example. Linking - # a copy of libgcc.a into every shared library to guarantee resolving - # such symbols causes other problems: According to Tim Van Holder - # , C++ libraries end up with a separate - # (to the application) exception stack for one thing. - no_undefined_flag=' -z defs' - if test "$GCC" = yes; then - case `$CC --version 2>/dev/null` in - [12].*) - cat <&2 - -*** Warning: Releases of GCC earlier than version 3.0 cannot reliably -*** create self contained shared libraries on Solaris systems, without -*** introducing a dependency on libgcc.a. Therefore, libtool is disabling -*** -no-undefined support, which will at least allow you to build shared -*** libraries. However, you may find that when you link such libraries -*** into an application without using GCC, you have to manually add -*** \`gcc --print-libgcc-file-name\` to the link command. We urge you to -*** upgrade to a newer version of GCC. Another option is to rebuild your -*** current GCC to use the GNU linker from GNU binutils 2.9.1 or newer. - -EOF - no_undefined_flag= - ;; - esac - fi - # $CC -shared without GNU ld will not create a library from C++ - # object files and a static libstdc++, better avoid it by now - archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' - archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' - hardcode_libdir_flag_spec='-R$libdir' - hardcode_shlibpath_var=no - case $host_os in - solaris2.[0-5] | solaris2.[0-5].*) ;; - *) # Supported since Solaris 2.6 (maybe 2.5.1?) - whole_archive_flag_spec='-z allextract$convenience -z defaultextract' ;; - esac - link_all_deplibs=yes - ;; - - sunos4*) - if test "x$host_vendor" = xsequent; then - # Use $CC to link under sequent, because it throws in some extra .o - # files that make .init and .fini sections work. - archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' - else - archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' - fi - hardcode_libdir_flag_spec='-L$libdir' - hardcode_direct=yes - hardcode_minus_L=yes - hardcode_shlibpath_var=no - ;; - - sysv4) - if test "x$host_vendor" = xsno; then - archive_cmds='$LD -G -Bsymbolic -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct=yes # is this really true??? - else - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct=no #Motorola manual says yes, but my tests say they lie - fi - runpath_var='LD_RUN_PATH' - hardcode_shlibpath_var=no - ;; - - sysv4.3*) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_shlibpath_var=no - export_dynamic_flag_spec='-Bexport' - ;; - - sysv5*) - no_undefined_flag=' -z text' - # $CC -shared without GNU ld will not create a library from C++ - # object files and a static libstdc++, better avoid it by now - archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' - archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' - hardcode_libdir_flag_spec= - hardcode_shlibpath_var=no - runpath_var='LD_RUN_PATH' - ;; - - uts4*) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec='-L$libdir' - hardcode_shlibpath_var=no - ;; - - dgux*) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec='-L$libdir' - hardcode_shlibpath_var=no - ;; - - sysv4*MP*) - if test -d /usr/nec; then - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_shlibpath_var=no - runpath_var=LD_RUN_PATH - hardcode_runpath_var=yes - ld_shlibs=yes - fi - ;; - - sysv4.2uw2*) - archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct=yes - hardcode_minus_L=no - hardcode_shlibpath_var=no - hardcode_runpath_var=yes - runpath_var=LD_RUN_PATH - ;; - - sysv5uw7* | unixware7*) - no_undefined_flag='${wl}-z ${wl}text' - if test "$GCC" = yes; then - archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - else - archive_cmds='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - fi - runpath_var='LD_RUN_PATH' - hardcode_shlibpath_var=no - ;; - - *) - ld_shlibs=no - ;; - esac -fi -echo "$as_me:$LINENO: result: $ld_shlibs" >&5 -echo "${ECHO_T}$ld_shlibs" >&6 -test "$ld_shlibs" = no && can_build_shared=no -## -## END FIXME - -## FIXME: this should be a separate macro -## -# Check hardcoding attributes. -echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 -echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6 -hardcode_action= -if test -n "$hardcode_libdir_flag_spec" || \ - test -n "$runpath_var"; then - - # We can hardcode non-existant directories. - if test "$hardcode_direct" != no && - # If the only mechanism to avoid hardcoding is shlibpath_var, we - # have to relink, otherwise we might link with an installed library - # when we should be linking with a yet-to-be-installed one - ## test "$hardcode_shlibpath_var" != no && - test "$hardcode_minus_L" != no; then - # Linking always hardcodes the temporary library directory. - hardcode_action=relink - else - # We can link without hardcoding, and we can hardcode nonexisting dirs. - hardcode_action=immediate - fi -else - # We cannot hardcode anything, or else we can only hardcode existing - # directories. - hardcode_action=unsupported -fi -echo "$as_me:$LINENO: result: $hardcode_action" >&5 -echo "${ECHO_T}$hardcode_action" >&6 -## -## END FIXME - -## FIXME: this should be a separate macro -## -striplib= -old_striplib= -echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5 -echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6 -if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then - test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" - test -z "$striplib" && striplib="$STRIP --strip-unneeded" - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi -## -## END FIXME - -reload_cmds='$LD$reload_flag -o $output$reload_objs' -test -z "$deplibs_check_method" && deplibs_check_method=unknown - -## FIXME: this should be a separate macro -## -# PORTME Fill in your ld.so characteristics -echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 -echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6 -library_names_spec= -libname_spec='lib$name' -soname_spec= -postinstall_cmds= -postuninstall_cmds= -finish_cmds= -finish_eval= -shlibpath_var= -shlibpath_overrides_runpath=unknown -version_type=none -dynamic_linker="$host_os ld.so" -sys_lib_dlsearch_path_spec="/lib /usr/lib" -sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" - -case $host_os in -aix3*) - version_type=linux - library_names_spec='${libname}${release}.so$versuffix $libname.a' - shlibpath_var=LIBPATH - - # AIX has no versioning support, so we append a major version to the name. - soname_spec='${libname}${release}.so$major' - ;; - -aix4* | aix5*) - version_type=linux - if test "$host_cpu" = ia64; then - # AIX 5 supports IA64 - library_names_spec='${libname}${release}.so$major ${libname}${release}.so$versuffix $libname.so' - shlibpath_var=LD_LIBRARY_PATH - else - # With GCC up to 2.95.x, collect2 would create an import file - # for dependence libraries. The import file would start with - # the line `#! .'. This would cause the generated library to - # depend on `.', always an invalid library. This was fixed in - # development snapshots of GCC prior to 3.0. - case $host_os in - aix4 | aix4.[01] | aix4.[01].*) - if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' - echo ' yes ' - echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then - : - else - can_build_shared=no - fi - ;; - esac - # AIX (on Power*) has no versioning support, so currently we can - # not hardcode correct soname into executable. Probably we can - # add versioning support to collect2, so additional links can - # be useful in future. - if test "$aix_use_runtimelinking" = yes; then - # If using run time linking (on AIX 4.2 or later) use lib.so - # instead of lib.a to let people know that these are not - # typical AIX shared libraries. - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' - else - # We preserve .a as extension for shared libraries through AIX4.2 - # and later when we are not doing run time linking. - library_names_spec='${libname}${release}.a $libname.a' - soname_spec='${libname}${release}.so$major' - fi - shlibpath_var=LIBPATH - fi - ;; - -amigaos*) - library_names_spec='$libname.ixlibrary $libname.a' - # Create ${libname}_ixlibrary.a entries in /sys/libs. - finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "(cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a)"; (cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a) || exit 1; done' - ;; - -beos*) - library_names_spec='${libname}.so' - dynamic_linker="$host_os ld.so" - shlibpath_var=LIBRARY_PATH - ;; - -bsdi4*) - version_type=linux - need_version=no - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' - soname_spec='${libname}${release}.so$major' - finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' - shlibpath_var=LD_LIBRARY_PATH - sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" - sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" - export_dynamic_flag_spec=-rdynamic - # the default ld.so.conf also contains /usr/contrib/lib and - # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow - # libtool to hard-code these into programs - ;; - -cygwin* | mingw* | pw32*) - version_type=windows - need_version=no - need_lib_prefix=no - case $GCC,$host_os in - yes,cygwin*) - library_names_spec='$libname.dll.a' - soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll' - postinstall_cmds='dlpath=`bash 2>&1 -c '\''. $dir/${file}i;echo \$dlname'\''`~ - dldir=$destdir/`dirname \$dlpath`~ - test -d \$dldir || mkdir -p \$dldir~ - $install_prog .libs/$dlname \$dldir/$dlname' - postuninstall_cmds='dldll=`bash 2>&1 -c '\''. $file; echo \$dlname'\''`~ - dlpath=$dir/\$dldll~ - $rm \$dlpath' - ;; - yes,mingw*) - library_names_spec='${libname}`echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll' - sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | sed -e "s/^libraries://" -e "s/;/ /g"` - ;; - yes,pw32*) - library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | sed -e 's/./-/g'`${versuffix}.dll' - ;; - *) - library_names_spec='${libname}`echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll $libname.lib' - ;; - esac - dynamic_linker='Win32 ld.exe' - # FIXME: first we should search . and the directory the executable is in - shlibpath_var=PATH - ;; - -darwin* | rhapsody*) - dynamic_linker="$host_os dyld" - version_type=darwin - need_lib_prefix=no - need_version=no - # FIXME: Relying on posixy $() will cause problems for - # cross-compilation, but unfortunately the echo tests do not - # yet detect zsh echo's removal of \ escapes. - library_names_spec='${libname}${release}${versuffix}.$(test .$module = .yes && echo so || echo dylib) ${libname}${release}${major}.$(test .$module = .yes && echo so || echo dylib) ${libname}.$(test .$module = .yes && echo so || echo dylib)' - soname_spec='${libname}${release}${major}.$(test .$module = .yes && echo so || echo dylib)' - shlibpath_overrides_runpath=yes - shlibpath_var=DYLD_LIBRARY_PATH - ;; - -freebsd1*) - dynamic_linker=no - ;; - -freebsd*) - objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout` - version_type=freebsd-$objformat - case $version_type in - freebsd-elf*) - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so' - need_version=no - need_lib_prefix=no - ;; - freebsd-*) - library_names_spec='${libname}${release}.so$versuffix $libname.so$versuffix' - need_version=yes - ;; - esac - shlibpath_var=LD_LIBRARY_PATH - case $host_os in - freebsd2*) - shlibpath_overrides_runpath=yes - ;; - *) - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - ;; - esac - ;; - -gnu*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so${major} ${libname}.so' - soname_spec='${libname}${release}.so$major' - shlibpath_var=LD_LIBRARY_PATH - hardcode_into_libs=yes - ;; - -hpux9* | hpux10* | hpux11*) - # Give a soname corresponding to the major version so that dld.sl refuses to - # link against other versions. - dynamic_linker="$host_os dld.sl" - version_type=sunos - need_lib_prefix=no - need_version=no - shlibpath_var=SHLIB_PATH - shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH - library_names_spec='${libname}${release}.sl$versuffix ${libname}${release}.sl$major $libname.sl' - soname_spec='${libname}${release}.sl$major' - # HP-UX runs *really* slowly unless shared libraries are mode 555. - postinstall_cmds='chmod 555 $lib' - ;; - -irix5* | irix6*) - version_type=irix - need_lib_prefix=no - need_version=no - soname_spec='${libname}${release}.so$major' - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so $libname.so' - case $host_os in - irix5*) - libsuff= shlibsuff= - ;; - *) - case $LD in # libtool.m4 will add one of these switches to LD - *-32|*"-32 ") libsuff= shlibsuff= libmagic=32-bit;; - *-n32|*"-n32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; - *-64|*"-64 ") libsuff=64 shlibsuff=64 libmagic=64-bit;; - *) libsuff= shlibsuff= libmagic=never-match;; - esac - ;; - esac - shlibpath_var=LD_LIBRARY${shlibsuff}_PATH - shlibpath_overrides_runpath=no - sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" - sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" - ;; - -# No shared lib support for Linux oldld, aout, or coff. -linux-gnuoldld* | linux-gnuaout* | linux-gnucoff*) - dynamic_linker=no - ;; - -# This must be Linux ELF. -linux-gnu*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' - soname_spec='${libname}${release}.so$major' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - # This implies no fast_install, which is unacceptable. - # Some rework will be needed to allow for fast_install - # before this can be enabled. - hardcode_into_libs=yes - - # We used to test for /lib/ld.so.1 and disable shared libraries on - # powerpc, because MkLinux only supported shared libraries with the - # GNU dynamic linker. Since this was broken with cross compilers, - # most powerpc-linux boxes support dynamic linking these days and - # people can always --disable-shared, the test was removed, and we - # assume the GNU/Linux dynamic linker is in use. - dynamic_linker='GNU/Linux ld.so' - ;; - -netbsd*) - version_type=sunos - need_lib_prefix=no - need_version=no - if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then - library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' - dynamic_linker='NetBSD (a.out) ld.so' - else - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so ${libname}.so' - soname_spec='${libname}${release}.so$major' - dynamic_linker='NetBSD ld.elf_so' - fi - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - -newsos6) - version_type=linux - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - ;; - -openbsd*) - version_type=sunos - need_lib_prefix=no - need_version=no - if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - case "$host_os" in - openbsd2.[89] | openbsd2.[89].*) - shlibpath_overrides_runpath=no - ;; - *) - shlibpath_overrides_runpath=yes - ;; - esac - else - shlibpath_overrides_runpath=yes - fi - library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' - shlibpath_var=LD_LIBRARY_PATH - ;; - -os2*) - libname_spec='$name' - need_lib_prefix=no - library_names_spec='$libname.dll $libname.a' - dynamic_linker='OS/2 ld.exe' - shlibpath_var=LIBPATH - ;; - -osf3* | osf4* | osf5*) - version_type=osf - need_version=no - soname_spec='${libname}${release}.so' - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so' - shlibpath_var=LD_LIBRARY_PATH - sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" - sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" - ;; - -sco3.2v5*) - version_type=osf - soname_spec='${libname}${release}.so$major' - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' - shlibpath_var=LD_LIBRARY_PATH - ;; - -solaris*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' - soname_spec='${libname}${release}.so$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - # ldd complains unless libraries are executable - postinstall_cmds='chmod +x $lib' - ;; - -sunos4*) - version_type=sunos - library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix' - finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - if test "$with_gnu_ld" = yes; then - need_lib_prefix=no - fi - need_version=yes - ;; - -sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) - version_type=linux - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' - soname_spec='${libname}${release}.so$major' - shlibpath_var=LD_LIBRARY_PATH - case $host_vendor in - sni) - shlibpath_overrides_runpath=no - ;; - motorola) - need_lib_prefix=no - need_version=no - shlibpath_overrides_runpath=no - sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' - ;; - esac - ;; - -uts4*) - version_type=linux - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' - soname_spec='${libname}${release}.so$major' - shlibpath_var=LD_LIBRARY_PATH - ;; - -dgux*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' - soname_spec='${libname}${release}.so$major' - shlibpath_var=LD_LIBRARY_PATH - ;; - -sysv4*MP*) - if test -d /usr/nec ;then - version_type=linux - library_names_spec='$libname.so.$versuffix $libname.so.$major $libname.so' - soname_spec='$libname.so.$major' - shlibpath_var=LD_LIBRARY_PATH - fi - ;; - -*) - dynamic_linker=no - ;; -esac -echo "$as_me:$LINENO: result: $dynamic_linker" >&5 -echo "${ECHO_T}$dynamic_linker" >&6 -test "$dynamic_linker" = no && can_build_shared=no -## -## END FIXME - -## FIXME: this should be a separate macro -## -# Report the final consequences. -echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5 -echo $ECHO_N "checking if libtool supports shared libraries... $ECHO_C" >&6 -echo "$as_me:$LINENO: result: $can_build_shared" >&5 -echo "${ECHO_T}$can_build_shared" >&6 -## -## END FIXME - -## FIXME: this should be a separate macro -## -echo "$as_me:$LINENO: checking whether to build shared libraries" >&5 -echo $ECHO_N "checking whether to build shared libraries... $ECHO_C" >&6 -test "$can_build_shared" = "no" && enable_shared=no - -# On AIX, shared libraries and static libraries use the same namespace, and -# are all built from PIC. -case "$host_os" in -aix3*) - test "$enable_shared" = yes && enable_static=no - if test -n "$RANLIB"; then - archive_cmds="$archive_cmds~\$RANLIB \$lib" - postinstall_cmds='$RANLIB $lib' - fi - ;; - -aix4*) - if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then - test "$enable_shared" = yes && enable_static=no - fi - ;; -esac -echo "$as_me:$LINENO: result: $enable_shared" >&5 -echo "${ECHO_T}$enable_shared" >&6 -## -## END FIXME - -## FIXME: this should be a separate macro -## -echo "$as_me:$LINENO: checking whether to build static libraries" >&5 -echo $ECHO_N "checking whether to build static libraries... $ECHO_C" >&6 -# Make sure either enable_shared or enable_static is yes. -test "$enable_shared" = yes || enable_static=yes -echo "$as_me:$LINENO: result: $enable_static" >&5 -echo "${ECHO_T}$enable_static" >&6 -## -## END FIXME - -if test "$hardcode_action" = relink; then - # Fast installation is not supported - enable_fast_install=no -elif test "$shlibpath_overrides_runpath" = yes || - test "$enable_shared" = no; then - # Fast installation is not necessary - enable_fast_install=needless -fi - -variables_saved_for_relink="PATH $shlibpath_var $runpath_var" -if test "$GCC" = yes; then - variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" -fi - -if test "x$enable_dlopen" != xyes; then - enable_dlopen=unknown - enable_dlopen_self=unknown - enable_dlopen_self_static=unknown -else - lt_cv_dlopen=no - lt_cv_dlopen_libs= - - case $host_os in - beos*) - lt_cv_dlopen="load_add_on" - lt_cv_dlopen_libs= - lt_cv_dlopen_self=yes - ;; - - cygwin* | mingw* | pw32*) - lt_cv_dlopen="LoadLibrary" - lt_cv_dlopen_libs= - ;; - - *) - echo "$as_me:$LINENO: checking for shl_load" >&5 -echo $ECHO_N "checking for shl_load... $ECHO_C" >&6 -if test "${ac_cv_func_shl_load+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char shl_load (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ -#ifdef __STDC__ -# include -#else -# include -#endif -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -{ -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char shl_load (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_shl_load) || defined (__stub___shl_load) -choke me -#else -char (*f) () = shl_load; -#endif -#ifdef __cplusplus -} -#endif - -int -main () -{ -return f != shl_load; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_func_shl_load=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_func_shl_load=no -fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5 -echo "${ECHO_T}$ac_cv_func_shl_load" >&6 -if test $ac_cv_func_shl_load = yes; then - lt_cv_dlopen="shl_load" -else - echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5 -echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6 -if test "${ac_cv_lib_dld_shl_load+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-ldld $LIBS" -cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char shl_load (); -int -main () -{ -shl_load (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_dld_shl_load=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_dld_shl_load=no -fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5 -echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6 -if test $ac_cv_lib_dld_shl_load = yes; then - lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld" -else - echo "$as_me:$LINENO: checking for dlopen" >&5 -echo $ECHO_N "checking for dlopen... $ECHO_C" >&6 -if test "${ac_cv_func_dlopen+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char dlopen (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ -#ifdef __STDC__ -# include -#else -# include -#endif -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -{ -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char dlopen (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_dlopen) || defined (__stub___dlopen) -choke me -#else -char (*f) () = dlopen; -#endif -#ifdef __cplusplus -} -#endif - -int -main () -{ -return f != dlopen; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_func_dlopen=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_func_dlopen=no -fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5 -echo "${ECHO_T}$ac_cv_func_dlopen" >&6 -if test $ac_cv_func_dlopen = yes; then - lt_cv_dlopen="dlopen" -else - echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 -echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6 -if test "${ac_cv_lib_dl_dlopen+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-ldl $LIBS" -cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char dlopen (); -int -main () -{ -dlopen (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_dl_dlopen=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_dl_dlopen=no -fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 -echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6 -if test $ac_cv_lib_dl_dlopen = yes; then - lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" -else - echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5 -echo $ECHO_N "checking for dlopen in -lsvld... $ECHO_C" >&6 -if test "${ac_cv_lib_svld_dlopen+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lsvld $LIBS" -cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char dlopen (); -int -main () -{ -dlopen (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_svld_dlopen=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_svld_dlopen=no -fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5 -echo "${ECHO_T}$ac_cv_lib_svld_dlopen" >&6 -if test $ac_cv_lib_svld_dlopen = yes; then - lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" -else - echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5 -echo $ECHO_N "checking for dld_link in -ldld... $ECHO_C" >&6 -if test "${ac_cv_lib_dld_dld_link+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-ldld $LIBS" -cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char dld_link (); -int -main () -{ -dld_link (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_dld_dld_link=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_dld_dld_link=no -fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5 -echo "${ECHO_T}$ac_cv_lib_dld_dld_link" >&6 -if test $ac_cv_lib_dld_dld_link = yes; then - lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld" -fi - - -fi - - -fi - - -fi - - -fi - - -fi - - ;; - esac - - if test "x$lt_cv_dlopen" != xno; then - enable_dlopen=yes - else - enable_dlopen=no - fi - - case $lt_cv_dlopen in - dlopen) - save_CPPFLAGS="$CPPFLAGS" - test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" - - save_LDFLAGS="$LDFLAGS" - eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" - - save_LIBS="$LIBS" - LIBS="$lt_cv_dlopen_libs $LIBS" - - echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5 -echo $ECHO_N "checking whether a program can dlopen itself... $ECHO_C" >&6 -if test "${lt_cv_dlopen_self+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test "$cross_compiling" = yes; then : - lt_cv_dlopen_self=cross -else - lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 - lt_status=$lt_dlunknown - cat > conftest.$ac_ext < -#endif - -#include - -#ifdef RTLD_GLOBAL -# define LT_DLGLOBAL RTLD_GLOBAL -#else -# ifdef DL_GLOBAL -# define LT_DLGLOBAL DL_GLOBAL -# else -# define LT_DLGLOBAL 0 -# endif -#endif - -/* We may have to define LT_DLLAZY_OR_NOW in the command line if we - find out it does not work in some platform. */ -#ifndef LT_DLLAZY_OR_NOW -# ifdef RTLD_LAZY -# define LT_DLLAZY_OR_NOW RTLD_LAZY -# else -# ifdef DL_LAZY -# define LT_DLLAZY_OR_NOW DL_LAZY -# else -# ifdef RTLD_NOW -# define LT_DLLAZY_OR_NOW RTLD_NOW -# else -# ifdef DL_NOW -# define LT_DLLAZY_OR_NOW DL_NOW -# else -# define LT_DLLAZY_OR_NOW 0 -# endif -# endif -# endif -# endif -#endif - -#ifdef __cplusplus -extern "C" void exit (int); -#endif - -void fnord() { int i=42;} -int main () -{ - void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); - int status = $lt_dlunknown; - - if (self) - { - if (dlsym (self,"fnord")) status = $lt_dlno_uscore; - else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; - /* dlclose (self); */ - } - - exit (status); -} -EOF - if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then - (./conftest; exit; ) 2>/dev/null - lt_status=$? - case x$lt_status in - x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; - x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; - x$lt_unknown|x*) lt_cv_dlopen_self=no ;; - esac - else : - # compilation failed - lt_cv_dlopen_self=no - fi -fi -rm -fr conftest* - - -fi -echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5 -echo "${ECHO_T}$lt_cv_dlopen_self" >&6 - - if test "x$lt_cv_dlopen_self" = xyes; then - LDFLAGS="$LDFLAGS $link_static_flag" - echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5 -echo $ECHO_N "checking whether a statically linked program can dlopen itself... $ECHO_C" >&6 -if test "${lt_cv_dlopen_self_static+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test "$cross_compiling" = yes; then : - lt_cv_dlopen_self_static=cross -else - lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 - lt_status=$lt_dlunknown - cat > conftest.$ac_ext < -#endif - -#include - -#ifdef RTLD_GLOBAL -# define LT_DLGLOBAL RTLD_GLOBAL -#else -# ifdef DL_GLOBAL -# define LT_DLGLOBAL DL_GLOBAL -# else -# define LT_DLGLOBAL 0 -# endif -#endif - -/* We may have to define LT_DLLAZY_OR_NOW in the command line if we - find out it does not work in some platform. */ -#ifndef LT_DLLAZY_OR_NOW -# ifdef RTLD_LAZY -# define LT_DLLAZY_OR_NOW RTLD_LAZY -# else -# ifdef DL_LAZY -# define LT_DLLAZY_OR_NOW DL_LAZY -# else -# ifdef RTLD_NOW -# define LT_DLLAZY_OR_NOW RTLD_NOW -# else -# ifdef DL_NOW -# define LT_DLLAZY_OR_NOW DL_NOW -# else -# define LT_DLLAZY_OR_NOW 0 -# endif -# endif -# endif -# endif -#endif - -#ifdef __cplusplus -extern "C" void exit (int); -#endif - -void fnord() { int i=42;} -int main () -{ - void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); - int status = $lt_dlunknown; - - if (self) - { - if (dlsym (self,"fnord")) status = $lt_dlno_uscore; - else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; - /* dlclose (self); */ - } - - exit (status); -} -EOF - if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then - (./conftest; exit; ) 2>/dev/null - lt_status=$? - case x$lt_status in - x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; - x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; - x$lt_unknown|x*) lt_cv_dlopen_self_static=no ;; - esac - else : - # compilation failed - lt_cv_dlopen_self_static=no - fi -fi -rm -fr conftest* - - -fi -echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5 -echo "${ECHO_T}$lt_cv_dlopen_self_static" >&6 - fi - - CPPFLAGS="$save_CPPFLAGS" - LDFLAGS="$save_LDFLAGS" - LIBS="$save_LIBS" - ;; - esac - - case $lt_cv_dlopen_self in - yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; - *) enable_dlopen_self=unknown ;; - esac - - case $lt_cv_dlopen_self_static in - yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; - *) enable_dlopen_self_static=unknown ;; - esac -fi - - -## FIXME: this should be a separate macro -## -if test "$enable_shared" = yes && test "$GCC" = yes; then - case $archive_cmds in - *'~'*) - # FIXME: we may have to deal with multi-command sequences. - ;; - '$CC '*) - # Test whether the compiler implicitly links with -lc since on some - # systems, -lgcc has to come before -lc. If gcc already passes -lc - # to ld, don't add -lc before -lgcc. - echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 -echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6 - if test "${lt_cv_archive_cmds_need_lc+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - $rm conftest* - echo 'static int dummy;' > conftest.$ac_ext - - if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - soname=conftest - lib=conftest - libobjs=conftest.$ac_objext - deplibs= - wl=$lt_cv_prog_cc_wl - compiler_flags=-v - linker_flags=-v - verstring= - output_objdir=. - libname=conftest - save_allow_undefined_flag=$allow_undefined_flag - allow_undefined_flag= - if { (eval echo "$as_me:$LINENO: \"$archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 - (eval $archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } - then - lt_cv_archive_cmds_need_lc=no - else - lt_cv_archive_cmds_need_lc=yes - fi - allow_undefined_flag=$save_allow_undefined_flag - else - cat conftest.err 1>&5 - fi -fi - - echo "$as_me:$LINENO: result: $lt_cv_archive_cmds_need_lc" >&5 -echo "${ECHO_T}$lt_cv_archive_cmds_need_lc" >&6 - ;; - esac -fi -need_lc=${lt_cv_archive_cmds_need_lc-yes} -## -## END FIXME - -## FIXME: this should be a separate macro -## -# The second clause should only fire when bootstrapping the -# libtool distribution, otherwise you forgot to ship ltmain.sh -# with your package, and you will get complaints that there are -# no rules to generate ltmain.sh. -if test -f "$ltmain"; then - : -else - # If there is no Makefile yet, we rely on a make rule to execute - # `config.status --recheck' to rerun these tests and create the - # libtool script then. - test -f Makefile && make "$ltmain" -fi - -if test -f "$ltmain"; then - trap "$rm \"${ofile}T\"; exit 1" 1 2 15 - $rm -f "${ofile}T" - - echo creating $ofile - - # Now quote all the things that may contain metacharacters while being - # careful not to overquote the AC_SUBSTed values. We take copies of the - # variables and quote the copies for generation of the libtool script. - for var in echo old_CC old_CFLAGS \ - AR AR_FLAGS CC LD LN_S NM SHELL \ - reload_flag reload_cmds wl \ - pic_flag link_static_flag no_builtin_flag export_dynamic_flag_spec \ - thread_safe_flag_spec whole_archive_flag_spec libname_spec \ - library_names_spec soname_spec \ - RANLIB old_archive_cmds old_archive_from_new_cmds old_postinstall_cmds \ - old_postuninstall_cmds archive_cmds archive_expsym_cmds postinstall_cmds \ - postuninstall_cmds extract_expsyms_cmds old_archive_from_expsyms_cmds \ - old_striplib striplib file_magic_cmd export_symbols_cmds \ - deplibs_check_method allow_undefined_flag no_undefined_flag \ - finish_cmds finish_eval global_symbol_pipe global_symbol_to_cdecl \ - global_symbol_to_c_name_address \ - hardcode_libdir_flag_spec hardcode_libdir_separator \ - sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ - compiler_c_o compiler_o_lo need_locks exclude_expsyms include_expsyms; do - - case $var in - reload_cmds | old_archive_cmds | old_archive_from_new_cmds | \ - old_postinstall_cmds | old_postuninstall_cmds | \ - export_symbols_cmds | archive_cmds | archive_expsym_cmds | \ - extract_expsyms_cmds | old_archive_from_expsyms_cmds | \ - postinstall_cmds | postuninstall_cmds | \ - finish_cmds | sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) - # Double-quote double-evaled strings. - eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" - ;; - *) - eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" - ;; - esac - done - - cat <<__EOF__ > "${ofile}T" -#! $SHELL - -# `$echo "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. -# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP) -# NOTE: Changes made to this file will be lost: look at ltmain.sh. -# -# Copyright (C) 1996-2000 Free Software Foundation, Inc. -# Originally by Gordon Matzigkeit , 1996 -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - -# Sed that helps us avoid accidentally triggering echo(1) options like -n. -Xsed="sed -e s/^X//" - -# The HP-UX ksh and POSIX shell print the target directory to stdout -# if CDPATH is set. -if test "X\${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi - -# ### BEGIN LIBTOOL CONFIG - -# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: - -# Shell to use when invoking shell scripts. -SHELL=$lt_SHELL - -# Whether or not to build shared libraries. -build_libtool_libs=$enable_shared - -# Whether or not to build static libraries. -build_old_libs=$enable_static - -# Whether or not to add -lc for building shared libraries. -build_libtool_need_lc=$need_lc - -# Whether or not to optimize for fast installation. -fast_install=$enable_fast_install - -# The host system. -host_alias=$host_alias -host=$host - -# An echo program that does not interpret backslashes. -echo=$lt_echo - -# The archiver. -AR=$lt_AR -AR_FLAGS=$lt_AR_FLAGS - -# The default C compiler. -CC=$lt_CC - -# Is the compiler the GNU C compiler? -with_gcc=$GCC - -# The linker used to build libraries. -LD=$lt_LD - -# Whether we need hard or soft links. -LN_S=$lt_LN_S - -# A BSD-compatible nm program. -NM=$lt_NM - -# A symbol stripping program -STRIP=$STRIP - -# Used to examine libraries when file_magic_cmd begins "file" -MAGIC_CMD=$MAGIC_CMD - -# Used on cygwin: DLL creation program. -DLLTOOL="$DLLTOOL" - -# Used on cygwin: object dumper. -OBJDUMP="$OBJDUMP" - -# Used on cygwin: assembler. -AS="$AS" - -# The name of the directory that contains temporary libtool files. -objdir=$objdir - -# How to create reloadable object files. -reload_flag=$lt_reload_flag -reload_cmds=$lt_reload_cmds - -# How to pass a linker flag through the compiler. -wl=$lt_wl - -# Object file suffix (normally "o"). -objext="$ac_objext" - -# Old archive suffix (normally "a"). -libext="$libext" - -# Executable file suffix (normally ""). -exeext="$exeext" - -# Additional compiler flags for building library objects. -pic_flag=$lt_pic_flag -pic_mode=$pic_mode - -# Does compiler simultaneously support -c and -o options? -compiler_c_o=$lt_compiler_c_o - -# Can we write directly to a .lo ? -compiler_o_lo=$lt_compiler_o_lo - -# Must we lock files when doing compilation ? -need_locks=$lt_need_locks - -# Do we need the lib prefix for modules? -need_lib_prefix=$need_lib_prefix - -# Do we need a version for libraries? -need_version=$need_version - -# Whether dlopen is supported. -dlopen_support=$enable_dlopen - -# Whether dlopen of programs is supported. -dlopen_self=$enable_dlopen_self - -# Whether dlopen of statically linked programs is supported. -dlopen_self_static=$enable_dlopen_self_static - -# Compiler flag to prevent dynamic linking. -link_static_flag=$lt_link_static_flag - -# Compiler flag to turn off builtin functions. -no_builtin_flag=$lt_no_builtin_flag - -# Compiler flag to allow reflexive dlopens. -export_dynamic_flag_spec=$lt_export_dynamic_flag_spec - -# Compiler flag to generate shared objects directly from archives. -whole_archive_flag_spec=$lt_whole_archive_flag_spec - -# Compiler flag to generate thread-safe objects. -thread_safe_flag_spec=$lt_thread_safe_flag_spec - -# Library versioning type. -version_type=$version_type - -# Format of library name prefix. -libname_spec=$lt_libname_spec - -# List of archive names. First name is the real one, the rest are links. -# The last name is the one that the linker finds with -lNAME. -library_names_spec=$lt_library_names_spec - -# The coded name of the library, if different from the real name. -soname_spec=$lt_soname_spec - -# Commands used to build and install an old-style archive. -RANLIB=$lt_RANLIB -old_archive_cmds=$lt_old_archive_cmds -old_postinstall_cmds=$lt_old_postinstall_cmds -old_postuninstall_cmds=$lt_old_postuninstall_cmds - -# Create an old-style archive from a shared archive. -old_archive_from_new_cmds=$lt_old_archive_from_new_cmds - -# Create a temporary old-style archive to link instead of a shared archive. -old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds - -# Commands used to build and install a shared archive. -archive_cmds=$lt_archive_cmds -archive_expsym_cmds=$lt_archive_expsym_cmds -postinstall_cmds=$lt_postinstall_cmds -postuninstall_cmds=$lt_postuninstall_cmds - -# Commands to strip libraries. -old_striplib=$lt_old_striplib -striplib=$lt_striplib - -# Method to check whether dependent libraries are shared objects. -deplibs_check_method=$lt_deplibs_check_method - -# Command to use when deplibs_check_method == file_magic. -file_magic_cmd=$lt_file_magic_cmd - -# Flag that allows shared libraries with undefined symbols to be built. -allow_undefined_flag=$lt_allow_undefined_flag - -# Flag that forces no undefined symbols. -no_undefined_flag=$lt_no_undefined_flag - -# Commands used to finish a libtool library installation in a directory. -finish_cmds=$lt_finish_cmds - -# Same as above, but a single script fragment to be evaled but not shown. -finish_eval=$lt_finish_eval - -# Take the output of nm and produce a listing of raw symbols and C names. -global_symbol_pipe=$lt_global_symbol_pipe - -# Transform the output of nm in a proper C declaration -global_symbol_to_cdecl=$lt_global_symbol_to_cdecl - -# Transform the output of nm in a C name address pair -global_symbol_to_c_name_address=$lt_global_symbol_to_c_name_address - -# This is the shared library runtime path variable. -runpath_var=$runpath_var - -# This is the shared library path variable. -shlibpath_var=$shlibpath_var - -# Is shlibpath searched before the hard-coded library search path? -shlibpath_overrides_runpath=$shlibpath_overrides_runpath - -# How to hardcode a shared library path into an executable. -hardcode_action=$hardcode_action - -# Whether we should hardcode library paths into libraries. -hardcode_into_libs=$hardcode_into_libs - -# Flag to hardcode \$libdir into a binary during linking. -# This must work even if \$libdir does not exist. -hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec - -# Whether we need a single -rpath flag with a separated argument. -hardcode_libdir_separator=$lt_hardcode_libdir_separator - -# Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the -# resulting binary. -hardcode_direct=$hardcode_direct - -# Set to yes if using the -LDIR flag during linking hardcodes DIR into the -# resulting binary. -hardcode_minus_L=$hardcode_minus_L - -# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into -# the resulting binary. -hardcode_shlibpath_var=$hardcode_shlibpath_var - -# Variables whose values should be saved in libtool wrapper scripts and -# restored at relink time. -variables_saved_for_relink="$variables_saved_for_relink" - -# Whether libtool must link a program against all its dependency libraries. -link_all_deplibs=$link_all_deplibs - -# Compile-time system search path for libraries -sys_lib_search_path_spec=$lt_sys_lib_search_path_spec - -# Run-time system search path for libraries -sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec - -# Fix the shell variable \$srcfile for the compiler. -fix_srcfile_path="$fix_srcfile_path" - -# Set to yes if exported symbols are required. -always_export_symbols=$always_export_symbols - -# The commands to list exported symbols. -export_symbols_cmds=$lt_export_symbols_cmds - -# The commands to extract the exported symbol list from a shared archive. -extract_expsyms_cmds=$lt_extract_expsyms_cmds - -# Symbols that should not be listed in the preloaded symbols. -exclude_expsyms=$lt_exclude_expsyms - -# Symbols that must always be exported. -include_expsyms=$lt_include_expsyms - -# ### END LIBTOOL CONFIG - -__EOF__ - - case $host_os in - aix3*) - cat <<\EOF >> "${ofile}T" - -# AIX sometimes has problems with the GCC collect2 program. For some -# reason, if we set the COLLECT_NAMES environment variable, the problems -# vanish in a puff of smoke. -if test "X${COLLECT_NAMES+set}" != Xset; then - COLLECT_NAMES= - export COLLECT_NAMES -fi -EOF - ;; - esac - - case $host_os in - cygwin* | mingw* | pw32* | os2*) - cat <<'EOF' >> "${ofile}T" - # This is a source program that is used to create dlls on Windows - # Don't remove nor modify the starting and closing comments -# /* ltdll.c starts here */ -# #define WIN32_LEAN_AND_MEAN -# #include -# #undef WIN32_LEAN_AND_MEAN -# #include -# -# #ifndef __CYGWIN__ -# # ifdef __CYGWIN32__ -# # define __CYGWIN__ __CYGWIN32__ -# # endif -# #endif -# -# #ifdef __cplusplus -# extern "C" { -# #endif -# BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved); -# #ifdef __cplusplus -# } -# #endif -# -# #ifdef __CYGWIN__ -# #include -# DECLARE_CYGWIN_DLL( DllMain ); -# #endif -# HINSTANCE __hDllInstance_base; -# -# BOOL APIENTRY -# DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved) -# { -# __hDllInstance_base = hInst; -# return TRUE; -# } -# /* ltdll.c ends here */ - # This is a source program that is used to create import libraries - # on Windows for dlls which lack them. Don't remove nor modify the - # starting and closing comments -# /* impgen.c starts here */ -# /* Copyright (C) 1999-2000 Free Software Foundation, Inc. -# -# This file is part of GNU libtool. -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# */ -# -# #include /* for printf() */ -# #include /* for open(), lseek(), read() */ -# #include /* for O_RDONLY, O_BINARY */ -# #include /* for strdup() */ -# -# /* O_BINARY isn't required (or even defined sometimes) under Unix */ -# #ifndef O_BINARY -# #define O_BINARY 0 -# #endif -# -# static unsigned int -# pe_get16 (fd, offset) -# int fd; -# int offset; -# { -# unsigned char b[2]; -# lseek (fd, offset, SEEK_SET); -# read (fd, b, 2); -# return b[0] + (b[1]<<8); -# } -# -# static unsigned int -# pe_get32 (fd, offset) -# int fd; -# int offset; -# { -# unsigned char b[4]; -# lseek (fd, offset, SEEK_SET); -# read (fd, b, 4); -# return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24); -# } -# -# static unsigned int -# pe_as32 (ptr) -# void *ptr; -# { -# unsigned char *b = ptr; -# return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24); -# } -# -# int -# main (argc, argv) -# int argc; -# char *argv[]; -# { -# int dll; -# unsigned long pe_header_offset, opthdr_ofs, num_entries, i; -# unsigned long export_rva, export_size, nsections, secptr, expptr; -# unsigned long name_rvas, nexp; -# unsigned char *expdata, *erva; -# char *filename, *dll_name; -# -# filename = argv[1]; -# -# dll = open(filename, O_RDONLY|O_BINARY); -# if (dll < 1) -# return 1; -# -# dll_name = filename; -# -# for (i=0; filename[i]; i++) -# if (filename[i] == '/' || filename[i] == '\\' || filename[i] == ':') -# dll_name = filename + i +1; -# -# pe_header_offset = pe_get32 (dll, 0x3c); -# opthdr_ofs = pe_header_offset + 4 + 20; -# num_entries = pe_get32 (dll, opthdr_ofs + 92); -# -# if (num_entries < 1) /* no exports */ -# return 1; -# -# export_rva = pe_get32 (dll, opthdr_ofs + 96); -# export_size = pe_get32 (dll, opthdr_ofs + 100); -# nsections = pe_get16 (dll, pe_header_offset + 4 +2); -# secptr = (pe_header_offset + 4 + 20 + -# pe_get16 (dll, pe_header_offset + 4 + 16)); -# -# expptr = 0; -# for (i = 0; i < nsections; i++) -# { -# char sname[8]; -# unsigned long secptr1 = secptr + 40 * i; -# unsigned long vaddr = pe_get32 (dll, secptr1 + 12); -# unsigned long vsize = pe_get32 (dll, secptr1 + 16); -# unsigned long fptr = pe_get32 (dll, secptr1 + 20); -# lseek(dll, secptr1, SEEK_SET); -# read(dll, sname, 8); -# if (vaddr <= export_rva && vaddr+vsize > export_rva) -# { -# expptr = fptr + (export_rva - vaddr); -# if (export_rva + export_size > vaddr + vsize) -# export_size = vsize - (export_rva - vaddr); -# break; -# } -# } -# -# expdata = (unsigned char*)malloc(export_size); -# lseek (dll, expptr, SEEK_SET); -# read (dll, expdata, export_size); -# erva = expdata - export_rva; -# -# nexp = pe_as32 (expdata+24); -# name_rvas = pe_as32 (expdata+32); -# -# printf ("EXPORTS\n"); -# for (i = 0; i> "${ofile}T" || (rm -f "${ofile}T"; exit 1) - - mv -f "${ofile}T" "$ofile" || \ - (rm -f "$ofile" && cp "${ofile}T" "$ofile" && rm -f "${ofile}T") - chmod +x "$ofile" -fi -## -## END FIXME - - - - - -# This can be used to rebuild libtool when needed -LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh" - -# Always use our own libtool. -LIBTOOL='$(SHELL) $(top_builddir)/libtool' - -# Prevent multiple expansion - - - - - - - -# Find a good install program. We prefer a C program (faster), -# so one script is as good as another. But avoid the broken or -# incompatible versions: -# SysV /etc/install, /usr/sbin/install -# SunOS /usr/etc/install -# IRIX /sbin/install -# AIX /bin/install -# AmigaOS /C/install, which installs bootblocks on floppy discs -# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag -# AFS /usr/afsws/bin/install, which mishandles nonexistent args -# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" -# ./install, which can be erroneously created by make from ./install.sh. -echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 -echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6 -if test -z "$INSTALL"; then -if test "${ac_cv_path_install+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - # Account for people who put trailing slashes in PATH elements. -case $as_dir/ in - ./ | .// | /cC/* | \ - /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ - /usr/ucb/* ) ;; - *) - # OSF1 and SCO ODT 3.0 have their own names for install. - # Don't use installbsd from OSF since it installs stuff as root - # by default. - for ac_prog in ginstall scoinst install; do - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then - if test $ac_prog = install && - grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then - # AIX install. It has an incompatible calling convention. - : - elif test $ac_prog = install && - grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then - # program-specific install script used by HP pwplus--don't use. - : - else - ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" - break 3 - fi - fi - done - done - ;; -esac -done - - -fi - if test "${ac_cv_path_install+set}" = set; then - INSTALL=$ac_cv_path_install - else - # As a last resort, use the slow shell script. We don't cache a - # path for INSTALL within a source directory, because that will - # break other packages using the cache if that directory is - # removed, or if the path is relative. - INSTALL=$ac_install_sh - fi -fi -echo "$as_me:$LINENO: result: $INSTALL" >&5 -echo "${ECHO_T}$INSTALL" >&6 - -# Use test -z because SunOS4 sh mishandles braces in ${var-val}. -# It thinks the first close brace ends the variable substitution. -test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' - -test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' - -test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' - - -if test "$GCC" = yes ; then - OLDCFLAGS="$CFLAGS -Wall -Wmissing-prototypes -Wstrict-prototypes" - CFLAGS="$OLDCFLAGS -fexceptions" - echo "$as_me:$LINENO: checking whether gcc accepts -fexceptions" >&5 -echo $ECHO_N "checking whether gcc accepts -fexceptions... $ECHO_C" >&6 - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ -(void)1 - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; CFLAGS="$OLDCFLAGS" -fi -rm -f conftest.$ac_objext conftest.$ac_ext -fi - -echo "$as_me:$LINENO: checking for ANSI C header files" >&5 -echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 -if test "${ac_cv_header_stdc+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#include -#include -#include - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_header_stdc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_header_stdc=no -fi -rm -f conftest.$ac_objext conftest.$ac_ext - -if test $ac_cv_header_stdc = yes; then - # SunOS 4.x string.h does not declare mem*, contrary to ANSI. - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "memchr" >/dev/null 2>&1; then - : -else - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "free" >/dev/null 2>&1; then - : -else - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. - if test "$cross_compiling" = yes; then - : -else - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#if ((' ' & 0x0FF) == 0x020) -# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') -# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) -#else -# define ISLOWER(c) \ - (('a' <= (c) && (c) <= 'i') \ - || ('j' <= (c) && (c) <= 'r') \ - || ('s' <= (c) && (c) <= 'z')) -# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) -#endif - -#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) -int -main () -{ - int i; - for (i = 0; i < 256; i++) - if (XOR (islower (i), ISLOWER (i)) - || toupper (i) != TOUPPER (i)) - exit(2); - exit (0); -} -_ACEOF -rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - : -else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -ac_cv_header_stdc=no -fi -rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi -fi -fi -echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 -echo "${ECHO_T}$ac_cv_header_stdc" >&6 -if test $ac_cv_header_stdc = yes; then - -cat >>confdefs.h <<\_ACEOF -#define STDC_HEADERS 1 -_ACEOF - -fi - - - -for ac_header in fcntl.h unistd.h -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 -else - # Is the header compilable? -echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_header_compiler=no -fi -rm -f conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 - -# Is the header present? -echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc in - yes:no ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; - no:yes ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - eval "$as_ac_Header=$ac_header_preproc" -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 - -fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - - -echo "$as_me:$LINENO: checking whether byte ordering is bigendian" >&5 -echo $ECHO_N "checking whether byte ordering is bigendian... $ECHO_C" >&6 -if test "${ac_cv_c_bigendian+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_cv_c_bigendian=unknown -# See if sys/param.h defines the BYTE_ORDER macro. -cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#include -int -main () -{ - -#if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN - bogus endian macros -#endif - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - # It does; now see whether it defined to BIG_ENDIAN or not. -cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#include -int -main () -{ - -#if BYTE_ORDER != BIG_ENDIAN - not big endian -#endif - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_c_bigendian=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_c_bigendian=no -fi -rm -f conftest.$ac_objext conftest.$ac_ext -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi -rm -f conftest.$ac_objext conftest.$ac_ext -if test $ac_cv_c_bigendian = unknown; then -if test "$cross_compiling" = yes; then - echo $ac_n "cross-compiling... " 2>&6 -else - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -main () { - /* Are we little or big endian? From Harbison&Steele. */ - union - { - long l; - char c[sizeof (long)]; - } u; - u.l = 1; - exit (u.c[sizeof (long) - 1] == 1); -} -_ACEOF -rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_c_bigendian=no -else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -ac_cv_c_bigendian=yes -fi -rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi -fi -fi -echo "$as_me:$LINENO: result: $ac_cv_c_bigendian" >&5 -echo "${ECHO_T}$ac_cv_c_bigendian" >&6 -if test $ac_cv_c_bigendian = unknown; then -echo "$as_me:$LINENO: checking to probe for byte ordering" >&5 -echo $ECHO_N "checking to probe for byte ordering... $ECHO_C" >&6 - -cat >conftest.c <&6 - ac_cv_c_bigendian=yes - fi - if test `grep -l LiTTleEnDian conftest.o` ; then - echo $ac_n ' little endian probe OK, ' 1>&6 - if test $ac_cv_c_bigendian = yes ; then - ac_cv_c_bigendian=unknown; - else - ac_cv_c_bigendian=no - fi - fi - echo $ac_n 'guessing bigendian ... ' >&6 - fi - fi -echo "$as_me:$LINENO: result: $ac_cv_c_bigendian" >&5 -echo "${ECHO_T}$ac_cv_c_bigendian" >&6 -fi -if test $ac_cv_c_bigendian = yes; then - -cat >>confdefs.h <<\_ACEOF -#define WORDS_BIGENDIAN 1 -_ACEOF - - BYTEORDER=4321 -else - BYTEORDER=1234 -fi - -cat >>confdefs.h <<_ACEOF -#define BYTEORDER $BYTEORDER -_ACEOF - -if test $ac_cv_c_bigendian = unknown; then - { { echo "$as_me:$LINENO: error: unknown endianess - sorry" >&5 -echo "$as_me: error: unknown endianess - sorry" >&2;} - { (exit please pre-set ac_cv_c_bigendian); exit please pre-set ac_cv_c_bigendian; }; } -fi - - -echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5 -echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6 -if test "${ac_cv_c_const+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ -/* FIXME: Include the comments suggested by Paul. */ -#ifndef __cplusplus - /* Ultrix mips cc rejects this. */ - typedef int charset[2]; - const charset x; - /* SunOS 4.1.1 cc rejects this. */ - char const *const *ccp; - char **p; - /* NEC SVR4.0.2 mips cc rejects this. */ - struct point {int x, y;}; - static struct point const zero = {0,0}; - /* AIX XL C 1.02.0.0 rejects this. - It does not let you subtract one const X* pointer from another in - an arm of an if-expression whose if-part is not a constant - expression */ - const char *g = "string"; - ccp = &g + (g ? g-g : 0); - /* HPUX 7.0 cc rejects these. */ - ++ccp; - p = (char**) ccp; - ccp = (char const *const *) p; - { /* SCO 3.2v4 cc rejects this. */ - char *t; - char const *s = 0 ? (char *) 0 : (char const *) 0; - - *t++ = 0; - } - { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ - int x[] = {25, 17}; - const int *foo = &x[0]; - ++foo; - } - { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ - typedef const int *iptr; - iptr p = 0; - ++p; - } - { /* AIX XL C 1.02.0.0 rejects this saying - "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ - struct s { int j; const int *ap[3]; }; - struct s *b; b->j = 5; - } - { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ - const int foo = 10; - } -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_c_const=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_c_const=no -fi -rm -f conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5 -echo "${ECHO_T}$ac_cv_c_const" >&6 -if test $ac_cv_c_const = no; then - -cat >>confdefs.h <<\_ACEOF -#define const -_ACEOF - -fi - -echo "$as_me:$LINENO: checking for off_t" >&5 -echo $ECHO_N "checking for off_t... $ECHO_C" >&6 -if test "${ac_cv_type_off_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -if ((off_t *) 0) - return 0; -if (sizeof (off_t)) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_type_off_t=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_type_off_t=no -fi -rm -f conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_type_off_t" >&5 -echo "${ECHO_T}$ac_cv_type_off_t" >&6 -if test $ac_cv_type_off_t = yes; then - : -else - -cat >>confdefs.h <<_ACEOF -#define off_t long -_ACEOF - -fi - -echo "$as_me:$LINENO: checking for size_t" >&5 -echo $ECHO_N "checking for size_t... $ECHO_C" >&6 -if test "${ac_cv_type_size_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -if ((size_t *) 0) - return 0; -if (sizeof (size_t)) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_type_size_t=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_type_size_t=no -fi -rm -f conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5 -echo "${ECHO_T}$ac_cv_type_size_t" >&6 -if test $ac_cv_type_size_t = yes; then - : -else - -cat >>confdefs.h <<_ACEOF -#define size_t unsigned -_ACEOF - -fi - - - -echo "$as_me:$LINENO: checking for working memcmp" >&5 -echo $ECHO_N "checking for working memcmp... $ECHO_C" >&6 -if test "${ac_cv_func_memcmp_working+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test "$cross_compiling" = yes; then - ac_cv_func_memcmp_working=no -else - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - /* Some versions of memcmp are not 8-bit clean. */ - char c0 = 0x40, c1 = 0x80, c2 = 0x81; - if (memcmp(&c0, &c2, 1) >= 0 || memcmp(&c1, &c2, 1) >= 0) - exit (1); - - /* The Next x86 OpenStep bug shows up only when comparing 16 bytes - or more and with at least one buffer not starting on a 4-byte boundary. - William Lewis provided this test program. */ - { - char foo[21]; - char bar[21]; - int i; - for (i = 0; i < 4; i++) - { - char *a = foo + i; - char *b = bar + i; - strcpy (a, "--------01111111"); - strcpy (b, "--------10000000"); - if (memcmp (a, b, 16) >= 0) - exit (1); - } - exit (0); - } - - ; - return 0; -} -_ACEOF -rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_func_memcmp_working=yes -else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -ac_cv_func_memcmp_working=no -fi -rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi -fi -echo "$as_me:$LINENO: result: $ac_cv_func_memcmp_working" >&5 -echo "${ECHO_T}$ac_cv_func_memcmp_working" >&6 -test $ac_cv_func_memcmp_working = no && LIBOBJS="$LIBOBJS memcmp.$ac_objext" - - - -for ac_header in stdlib.h unistd.h -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 -else - # Is the header compilable? -echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_header_compiler=no -fi -rm -f conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 - -# Is the header present? -echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc in - yes:no ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; - no:yes ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - eval "$as_ac_Header=$ac_header_preproc" -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 - -fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - -for ac_func in getpagesize -do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ -#ifdef __STDC__ -# include -#else -# include -#endif -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -{ -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) -choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} -#endif - -int -main () -{ -return f != $ac_func; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - eval "$as_ac_var=yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -eval "$as_ac_var=no" -fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 -if test `eval echo '${'$as_ac_var'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - -fi -done - -echo "$as_me:$LINENO: checking for working mmap" >&5 -echo $ECHO_N "checking for working mmap... $ECHO_C" >&6 -if test "${ac_cv_func_mmap_fixed_mapped+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test "$cross_compiling" = yes; then - ac_cv_func_mmap_fixed_mapped=no -else - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -/* malloc might have been renamed as rpl_malloc. */ -#undef malloc - -/* Thanks to Mike Haertel and Jim Avera for this test. - Here is a matrix of mmap possibilities: - mmap private not fixed - mmap private fixed at somewhere currently unmapped - mmap private fixed at somewhere already mapped - mmap shared not fixed - mmap shared fixed at somewhere currently unmapped - mmap shared fixed at somewhere already mapped - For private mappings, we should verify that changes cannot be read() - back from the file, nor mmap's back from the file at a different - address. (There have been systems where private was not correctly - implemented like the infamous i386 svr4.0, and systems where the - VM page cache was not coherent with the file system buffer cache - like early versions of FreeBSD and possibly contemporary NetBSD.) - For shared mappings, we should conversely verify that changes get - propagated back to all the places they're supposed to be. - - Grep wants private fixed already mapped. - The main things grep needs to know about mmap are: - * does it exist and is it safe to write into the mmap'd area - * how to use it (BSD variants) */ - -#include -#include - -#if !STDC_HEADERS && !HAVE_STDLIB_H -char *malloc (); -#endif - -/* This mess was copied from the GNU getpagesize.h. */ -#if !HAVE_GETPAGESIZE -/* Assume that all systems that can run configure have sys/param.h. */ -# if !HAVE_SYS_PARAM_H -# define HAVE_SYS_PARAM_H 1 -# endif - -# ifdef _SC_PAGESIZE -# define getpagesize() sysconf(_SC_PAGESIZE) -# else /* no _SC_PAGESIZE */ -# if HAVE_SYS_PARAM_H -# include -# ifdef EXEC_PAGESIZE -# define getpagesize() EXEC_PAGESIZE -# else /* no EXEC_PAGESIZE */ -# ifdef NBPG -# define getpagesize() NBPG * CLSIZE -# ifndef CLSIZE -# define CLSIZE 1 -# endif /* no CLSIZE */ -# else /* no NBPG */ -# ifdef NBPC -# define getpagesize() NBPC -# else /* no NBPC */ -# ifdef PAGESIZE -# define getpagesize() PAGESIZE -# endif /* PAGESIZE */ -# endif /* no NBPC */ -# endif /* no NBPG */ -# endif /* no EXEC_PAGESIZE */ -# else /* no HAVE_SYS_PARAM_H */ -# define getpagesize() 8192 /* punt totally */ -# endif /* no HAVE_SYS_PARAM_H */ -# endif /* no _SC_PAGESIZE */ - -#endif /* no HAVE_GETPAGESIZE */ - -int -main () -{ - char *data, *data2, *data3; - int i, pagesize; - int fd; - - pagesize = getpagesize (); - - /* First, make a file with some known garbage in it. */ - data = (char *) malloc (pagesize); - if (!data) - exit (1); - for (i = 0; i < pagesize; ++i) - *(data + i) = rand (); - umask (0); - fd = creat ("conftest.mmap", 0600); - if (fd < 0) - exit (1); - if (write (fd, data, pagesize) != pagesize) - exit (1); - close (fd); - - /* Next, try to mmap the file at a fixed address which already has - something else allocated at it. If we can, also make sure that - we see the same garbage. */ - fd = open ("conftest.mmap", O_RDWR); - if (fd < 0) - exit (1); - data2 = (char *) malloc (2 * pagesize); - if (!data2) - exit (1); - data2 += (pagesize - ((int) data2 & (pagesize - 1))) & (pagesize - 1); - if (data2 != mmap (data2, pagesize, PROT_READ | PROT_WRITE, - MAP_PRIVATE | MAP_FIXED, fd, 0L)) - exit (1); - for (i = 0; i < pagesize; ++i) - if (*(data + i) != *(data2 + i)) - exit (1); - - /* Finally, make sure that changes to the mapped area do not - percolate back to the file as seen by read(). (This is a bug on - some variants of i386 svr4.0.) */ - for (i = 0; i < pagesize; ++i) - *(data2 + i) = *(data2 + i) + 1; - data3 = (char *) malloc (pagesize); - if (!data3) - exit (1); - if (read (fd, data3, pagesize) != pagesize) - exit (1); - for (i = 0; i < pagesize; ++i) - if (*(data + i) != *(data3 + i)) - exit (1); - close (fd); - exit (0); -} -_ACEOF -rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_func_mmap_fixed_mapped=yes -else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -ac_cv_func_mmap_fixed_mapped=no -fi -rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi -fi -echo "$as_me:$LINENO: result: $ac_cv_func_mmap_fixed_mapped" >&5 -echo "${ECHO_T}$ac_cv_func_mmap_fixed_mapped" >&6 -if test $ac_cv_func_mmap_fixed_mapped = yes; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_MMAP 1 -_ACEOF - -fi -rm -f conftest.mmap - - -if test "$ac_cv_func_mmap_fixed_mapped" = "yes"; then - FILEMAP=unixfilemap -else - FILEMAP=readfilemap -fi - - - - -for ac_func in memmove bcopy -do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ -#ifdef __STDC__ -# include -#else -# include -#endif -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -{ -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) -choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} -#endif - -int -main () -{ -return f != $ac_func; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - eval "$as_ac_var=yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -eval "$as_ac_var=no" -fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 -if test `eval echo '${'$as_ac_var'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - -fi -done - - - -cat >>confdefs.h <<\_ACEOF -#define XML_NS 1 -_ACEOF - - -cat >>confdefs.h <<\_ACEOF -#define XML_DTD 1 -_ACEOF - - -cat >>confdefs.h <<\_ACEOF -#define XML_CONTEXT_BYTES 1024 -_ACEOF - - - ac_config_files="$ac_config_files Makefile" - -cat >confcache <<\_ACEOF -# This file is a shell script that caches the results of configure -# tests run on this system so they can be shared between configure -# scripts and configure runs, see configure's option --config-cache. -# It is not useful on other systems. If it contains results you don't -# want to keep, you may remove or edit it. -# -# config.status only pays attention to the cache file if you give it -# the --recheck option to rerun configure. -# -# `ac_cv_env_foo' variables (set or unset) will be overridden when -# loading this file, other *unset* `ac_cv_foo' will be assigned the -# following values. - -_ACEOF - -# The following way of writing the cache mishandles newlines in values, -# but we know of no workaround that is simple, portable, and efficient. -# So, don't put newlines in cache variables' values. -# Ultrix sh set writes to stderr and can't be redirected directly, -# and sets the high bit in the cache file unless we assign to the vars. -{ - (set) 2>&1 | - case `(ac_space=' '; set | grep ac_space) 2>&1` in - *ac_space=\ *) - # `set' does not quote correctly, so add quotes (double-quote - # substitution turns \\\\ into \\, and sed turns \\ into \). - sed -n \ - "s/'/'\\\\''/g; - s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" - ;; - *) - # `set' quotes correctly as required by POSIX, so do not add quotes. - sed -n \ - "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" - ;; - esac; -} | - sed ' - t clear - : clear - s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ - t end - /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ - : end' >>confcache -if diff $cache_file confcache >/dev/null 2>&1; then :; else - if test -w $cache_file; then - test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file" - cat confcache >$cache_file - else - echo "not updating unwritable cache $cache_file" - fi -fi -rm -f confcache - -test "x$prefix" = xNONE && prefix=$ac_default_prefix -# Let make expand exec_prefix. -test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' - -# VPATH may cause trouble with some makes, so we remove $(srcdir), -# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and -# trailing colons and then remove the whole line if VPATH becomes empty -# (actually we leave an empty line to preserve line numbers). -if test "x$srcdir" = x.; then - ac_vpsub='/^[ ]*VPATH[ ]*=/{ -s/:*\$(srcdir):*/:/; -s/:*\${srcdir}:*/:/; -s/:*@srcdir@:*/:/; -s/^\([^=]*=[ ]*\):*/\1/; -s/:*$//; -s/^[^=]*=[ ]*$//; -}' -fi - -DEFS=-DHAVE_CONFIG_H - -ac_libobjs= -ac_ltlibobjs= -for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue - # 1. Remove the extension, and $U if already installed. - ac_i=`echo "$ac_i" | - sed 's/\$U\././;s/\.o$//;s/\.obj$//'` - # 2. Add them. - ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext" - ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo' -done -LIBOBJS=$ac_libobjs - -LTLIBOBJS=$ac_ltlibobjs - - - -: ${CONFIG_STATUS=./config.status} -ac_clean_files_save=$ac_clean_files -ac_clean_files="$ac_clean_files $CONFIG_STATUS" -{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 -echo "$as_me: creating $CONFIG_STATUS" >&6;} -cat >$CONFIG_STATUS <<_ACEOF -#! $SHELL -# Generated by $as_me. -# Run this file to recreate the current configuration. -# Compiler output produced by configure, useful for debugging -# configure, is in config.log if it exists. - -debug=false -ac_cs_recheck=false -ac_cs_silent=false -SHELL=\${CONFIG_SHELL-$SHELL} -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF -## --------------------- ## -## M4sh Initialization. ## -## --------------------- ## - -# Be Bourne compatible -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then - emulate sh - NULLCMD=: - # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' -elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then - set -o posix -fi - -# Support unset when possible. -if (FOO=FOO; unset FOO) >/dev/null 2>&1; then - as_unset=unset -else - as_unset=false -fi - - -# Work around bugs in pre-3.0 UWIN ksh. -$as_unset ENV MAIL MAILPATH -PS1='$ ' -PS2='> ' -PS4='+ ' - -# NLS nuisances. -for as_var in \ - LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ - LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ - LC_TELEPHONE LC_TIME -do - if (set +x; test -n "`(eval $as_var=C; export $as_var) 2>&1`"); then - eval $as_var=C; export $as_var - else - $as_unset $as_var - fi -done - -# Required to use basename. -if expr a : '\(a\)' >/dev/null 2>&1; then - as_expr=expr -else - as_expr=false -fi - -if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then - as_basename=basename -else - as_basename=false -fi - - -# Name of the executable. -as_me=`$as_basename "$0" || -$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)$' \| \ - . : '\(.\)' 2>/dev/null || -echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } - /^X\/\(\/\/\)$/{ s//\1/; q; } - /^X\/\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - - -# PATH needs CR, and LINENO needs CR and PATH. -# Avoid depending upon Character Ranges. -as_cr_letters='abcdefghijklmnopqrstuvwxyz' -as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' -as_cr_Letters=$as_cr_letters$as_cr_LETTERS -as_cr_digits='0123456789' -as_cr_alnum=$as_cr_Letters$as_cr_digits - -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - echo "#! /bin/sh" >conf$$.sh - echo "exit 0" >>conf$$.sh - chmod +x conf$$.sh - if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then - PATH_SEPARATOR=';' - else - PATH_SEPARATOR=: - fi - rm -f conf$$.sh -fi - - - as_lineno_1=$LINENO - as_lineno_2=$LINENO - as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x$as_lineno_3" = "x$as_lineno_2" || { - # Find who we are. Look in the path if we contain no path at all - # relative or not. - case $0 in - *[\\/]* ) as_myself=$0 ;; - *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break -done - - ;; - esac - # We did not find ourselves, most probably we were run as `sh COMMAND' - # in which case we are not to be found in the path. - if test "x$as_myself" = x; then - as_myself=$0 - fi - if test ! -f "$as_myself"; then - { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5 -echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;} - { (exit 1); exit 1; }; } - fi - case $CONFIG_SHELL in - '') - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for as_base in sh bash ksh sh5; do - case $as_dir in - /*) - if ("$as_dir/$as_base" -c ' - as_lineno_1=$LINENO - as_lineno_2=$LINENO - as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then - $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } - $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } - CONFIG_SHELL=$as_dir/$as_base - export CONFIG_SHELL - exec "$CONFIG_SHELL" "$0" ${1+"$@"} - fi;; - esac - done -done -;; - esac - - # Create $as_me.lineno as a copy of $as_myself, but with $LINENO - # uniformly replaced by the line number. The first 'sed' inserts a - # line-number line before each line; the second 'sed' does the real - # work. The second script uses 'N' to pair each line-number line - # with the numbered line, and appends trailing '-' during - # substitution so that $LINENO is not a special case at line end. - # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the - # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) - sed '=' <$as_myself | - sed ' - N - s,$,-, - : loop - s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, - t loop - s,-$,, - s,^['$as_cr_digits']*\n,, - ' >$as_me.lineno && - chmod +x $as_me.lineno || - { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5 -echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;} - { (exit 1); exit 1; }; } - - # Don't try to exec as it changes $[0], causing all sort of problems - # (the dirname of $[0] is not the place where we might find the - # original and so on. Autoconf is especially sensible to this). - . ./$as_me.lineno - # Exit status is that of the last command. - exit -} - - -case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in - *c*,-n*) ECHO_N= ECHO_C=' -' ECHO_T=' ' ;; - *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; - *) ECHO_N= ECHO_C='\c' ECHO_T= ;; -esac - -if expr a : '\(a\)' >/dev/null 2>&1; then - as_expr=expr -else - as_expr=false -fi - -rm -f conf$$ conf$$.exe conf$$.file -echo >conf$$.file -if ln -s conf$$.file conf$$ 2>/dev/null; then - # We could just check for DJGPP; but this test a) works b) is more generic - # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). - if test -f conf$$.exe; then - # Don't use ln at all; we don't have any links - as_ln_s='cp -p' - else - as_ln_s='ln -s' - fi -elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln -else - as_ln_s='cp -p' -fi -rm -f conf$$ conf$$.exe conf$$.file - -if mkdir -p . 2>/dev/null; then - as_mkdir_p=: -else - as_mkdir_p=false -fi - -as_executable_p="test -f" - -# Sed expression to map a string onto a valid CPP name. -as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g" - -# Sed expression to map a string onto a valid variable name. -as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g" - - -# IFS -# We need space, tab and new line, in precisely that order. -as_nl=' -' -IFS=" $as_nl" - -# CDPATH. -$as_unset CDPATH - -exec 6>&1 - -# Open the log real soon, to keep \$[0] and so on meaningful, and to -# report actual input values of CONFIG_FILES etc. instead of their -# values after options handling. Logging --version etc. is OK. -exec 5>>config.log -{ - echo - sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX -## Running $as_me. ## -_ASBOX -} >&5 -cat >&5 <<_CSEOF - -This file was extended by $as_me, which was -generated by GNU Autoconf 2.57. Invocation command line was - - CONFIG_FILES = $CONFIG_FILES - CONFIG_HEADERS = $CONFIG_HEADERS - CONFIG_LINKS = $CONFIG_LINKS - CONFIG_COMMANDS = $CONFIG_COMMANDS - $ $0 $@ - -_CSEOF -echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5 -echo >&5 -_ACEOF - -# Files that config.status was made for. -if test -n "$ac_config_files"; then - echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS -fi - -if test -n "$ac_config_headers"; then - echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS -fi - -if test -n "$ac_config_links"; then - echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS -fi - -if test -n "$ac_config_commands"; then - echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS -fi - -cat >>$CONFIG_STATUS <<\_ACEOF - -ac_cs_usage="\ -\`$as_me' instantiates files from templates according to the -current configuration. - -Usage: $0 [OPTIONS] [FILE]... - - -h, --help print this help, then exit - -V, --version print version number, then exit - -q, --quiet do not print progress messages - -d, --debug don't remove temporary files - --recheck update $as_me by reconfiguring in the same conditions - --file=FILE[:TEMPLATE] - instantiate the configuration file FILE - --header=FILE[:TEMPLATE] - instantiate the configuration header FILE - -Configuration files: -$config_files - -Configuration headers: -$config_headers - -Report bugs to ." -_ACEOF - -cat >>$CONFIG_STATUS <<_ACEOF -ac_cs_version="\\ -config.status -configured by $0, generated by GNU Autoconf 2.57, - with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" - -Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001 -Free Software Foundation, Inc. -This config.status script is free software; the Free Software Foundation -gives unlimited permission to copy, distribute and modify it." -srcdir=$srcdir -INSTALL="$INSTALL" -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF -# If no file are specified by the user, then we need to provide default -# value. By we need to know if files were specified by the user. -ac_need_defaults=: -while test $# != 0 -do - case $1 in - --*=*) - ac_option=`expr "x$1" : 'x\([^=]*\)='` - ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'` - ac_shift=: - ;; - -*) - ac_option=$1 - ac_optarg=$2 - ac_shift=shift - ;; - *) # This is not an option, so the user has probably given explicit - # arguments. - ac_option=$1 - ac_need_defaults=false;; - esac - - case $ac_option in - # Handling of the options. -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF - -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) - ac_cs_recheck=: ;; - --version | --vers* | -V ) - echo "$ac_cs_version"; exit 0 ;; - --he | --h) - # Conflict between --help and --header - { { echo "$as_me:$LINENO: error: ambiguous option: $1 -Try \`$0 --help' for more information." >&5 -echo "$as_me: error: ambiguous option: $1 -Try \`$0 --help' for more information." >&2;} - { (exit 1); exit 1; }; };; - --help | --hel | -h ) - echo "$ac_cs_usage"; exit 0 ;; - --debug | --d* | -d ) - debug=: ;; - --file | --fil | --fi | --f ) - $ac_shift - CONFIG_FILES="$CONFIG_FILES $ac_optarg" - ac_need_defaults=false;; - --header | --heade | --head | --hea ) - $ac_shift - CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" - ac_need_defaults=false;; - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil | --si | --s) - ac_cs_silent=: ;; - - # This is an error. - -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1 -Try \`$0 --help' for more information." >&5 -echo "$as_me: error: unrecognized option: $1 -Try \`$0 --help' for more information." >&2;} - { (exit 1); exit 1; }; } ;; - - *) ac_config_targets="$ac_config_targets $1" ;; - - esac - shift -done - -ac_configure_extra_args= - -if $ac_cs_silent; then - exec 6>/dev/null - ac_configure_extra_args="$ac_configure_extra_args --silent" -fi - -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF -if \$ac_cs_recheck; then - echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 - exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion -fi - -_ACEOF - - - - - -cat >>$CONFIG_STATUS <<\_ACEOF -for ac_config_target in $ac_config_targets -do - case "$ac_config_target" in - # Handling of arguments. - "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; - "expat_config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS expat_config.h" ;; - *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 -echo "$as_me: error: invalid argument: $ac_config_target" >&2;} - { (exit 1); exit 1; }; };; - esac -done - -# If the user did not use the arguments to specify the items to instantiate, -# then the envvar interface is used. Set only those that are not. -# We use the long form for the default assignment because of an extremely -# bizarre bug on SunOS 4.1.3. -if $ac_need_defaults; then - test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files - test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers -fi - -# Have a temporary directory for convenience. Make it in the build tree -# simply because there is no reason to put it here, and in addition, -# creating and moving files from /tmp can sometimes cause problems. -# Create a temporary directory, and hook for its removal unless debugging. -$debug || -{ - trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0 - trap '{ (exit 1); exit 1; }' 1 2 13 15 -} - -# Create a (secure) tmp directory for tmp files. - -{ - tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` && - test -n "$tmp" && test -d "$tmp" -} || -{ - tmp=./confstat$$-$RANDOM - (umask 077 && mkdir $tmp) -} || -{ - echo "$me: cannot create a temporary directory in ." >&2 - { (exit 1); exit 1; } -} - -_ACEOF - -cat >>$CONFIG_STATUS <<_ACEOF - -# -# CONFIG_FILES section. -# - -# No need to generate the scripts if there are no CONFIG_FILES. -# This happens for instance when ./config.status config.h -if test -n "\$CONFIG_FILES"; then - # Protect against being on the right side of a sed subst in config.status. - sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g; - s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF -s,@SHELL@,$SHELL,;t t -s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t -s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t -s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t -s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t -s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t -s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t -s,@exec_prefix@,$exec_prefix,;t t -s,@prefix@,$prefix,;t t -s,@program_transform_name@,$program_transform_name,;t t -s,@bindir@,$bindir,;t t -s,@sbindir@,$sbindir,;t t -s,@libexecdir@,$libexecdir,;t t -s,@datadir@,$datadir,;t t -s,@sysconfdir@,$sysconfdir,;t t -s,@sharedstatedir@,$sharedstatedir,;t t -s,@localstatedir@,$localstatedir,;t t -s,@libdir@,$libdir,;t t -s,@includedir@,$includedir,;t t -s,@oldincludedir@,$oldincludedir,;t t -s,@infodir@,$infodir,;t t -s,@mandir@,$mandir,;t t -s,@build_alias@,$build_alias,;t t -s,@host_alias@,$host_alias,;t t -s,@target_alias@,$target_alias,;t t -s,@DEFS@,$DEFS,;t t -s,@ECHO_C@,$ECHO_C,;t t -s,@ECHO_N@,$ECHO_N,;t t -s,@ECHO_T@,$ECHO_T,;t t -s,@LIBS@,$LIBS,;t t -s,@CC@,$CC,;t t -s,@CFLAGS@,$CFLAGS,;t t -s,@LDFLAGS@,$LDFLAGS,;t t -s,@CPPFLAGS@,$CPPFLAGS,;t t -s,@ac_ct_CC@,$ac_ct_CC,;t t -s,@EXEEXT@,$EXEEXT,;t t -s,@OBJEXT@,$OBJEXT,;t t -s,@build@,$build,;t t -s,@build_cpu@,$build_cpu,;t t -s,@build_vendor@,$build_vendor,;t t -s,@build_os@,$build_os,;t t -s,@host@,$host,;t t -s,@host_cpu@,$host_cpu,;t t -s,@host_vendor@,$host_vendor,;t t -s,@host_os@,$host_os,;t t -s,@LN_S@,$LN_S,;t t -s,@ECHO@,$ECHO,;t t -s,@RANLIB@,$RANLIB,;t t -s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t -s,@STRIP@,$STRIP,;t t -s,@ac_ct_STRIP@,$ac_ct_STRIP,;t t -s,@CPP@,$CPP,;t t -s,@EGREP@,$EGREP,;t t -s,@LIBTOOL@,$LIBTOOL,;t t -s,@LIBCURRENT@,$LIBCURRENT,;t t -s,@LIBREVISION@,$LIBREVISION,;t t -s,@LIBAGE@,$LIBAGE,;t t -s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t -s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t -s,@INSTALL_DATA@,$INSTALL_DATA,;t t -s,@LIBOBJS@,$LIBOBJS,;t t -s,@FILEMAP@,$FILEMAP,;t t -s,@LTLIBOBJS@,$LTLIBOBJS,;t t -CEOF - -_ACEOF - - cat >>$CONFIG_STATUS <<\_ACEOF - # Split the substitutions into bite-sized pieces for seds with - # small command number limits, like on Digital OSF/1 and HP-UX. - ac_max_sed_lines=48 - ac_sed_frag=1 # Number of current file. - ac_beg=1 # First line for current file. - ac_end=$ac_max_sed_lines # Line after last line for current file. - ac_more_lines=: - ac_sed_cmds= - while $ac_more_lines; do - if test $ac_beg -gt 1; then - sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag - else - sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag - fi - if test ! -s $tmp/subs.frag; then - ac_more_lines=false - else - # The purpose of the label and of the branching condition is to - # speed up the sed processing (if there are no `@' at all, there - # is no need to browse any of the substitutions). - # These are the two extra sed commands mentioned above. - (echo ':t - /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed - if test -z "$ac_sed_cmds"; then - ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" - else - ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" - fi - ac_sed_frag=`expr $ac_sed_frag + 1` - ac_beg=$ac_end - ac_end=`expr $ac_end + $ac_max_sed_lines` - fi - done - if test -z "$ac_sed_cmds"; then - ac_sed_cmds=cat - fi -fi # test -n "$CONFIG_FILES" - -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF -for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue - # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". - case $ac_file in - - | *:- | *:-:* ) # input from stdin - cat >$tmp/stdin - ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` - ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; - *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` - ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; - * ) ac_file_in=$ac_file.in ;; - esac - - # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories. - ac_dir=`(dirname "$ac_file") 2>/dev/null || -$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$ac_file" : 'X\(//\)[^/]' \| \ - X"$ac_file" : 'X\(//\)$' \| \ - X"$ac_file" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || -echo X"$ac_file" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - { if $as_mkdir_p; then - mkdir -p "$ac_dir" - else - as_dir="$ac_dir" - as_dirs= - while test ! -d "$as_dir"; do - as_dirs="$as_dir $as_dirs" - as_dir=`(dirname "$as_dir") 2>/dev/null || -$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_dir" : 'X\(//\)[^/]' \| \ - X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || -echo X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - done - test ! -n "$as_dirs" || mkdir $as_dirs - fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 -echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} - { (exit 1); exit 1; }; }; } - - ac_builddir=. - -if test "$ac_dir" != .; then - ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` - # A "../" for each directory in $ac_dir_suffix. - ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` -else - ac_dir_suffix= ac_top_builddir= -fi - -case $srcdir in - .) # No --srcdir option. We are building in place. - ac_srcdir=. - if test -z "$ac_top_builddir"; then - ac_top_srcdir=. - else - ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` - fi ;; - [\\/]* | ?:[\\/]* ) # Absolute path. - ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir ;; - *) # Relative path. - ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_builddir$srcdir ;; -esac -# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be -# absolute. -ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd` -ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd` -ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd` -ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd` - - - case $INSTALL in - [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; - *) ac_INSTALL=$ac_top_builddir$INSTALL ;; - esac - - if test x"$ac_file" != x-; then - { echo "$as_me:$LINENO: creating $ac_file" >&5 -echo "$as_me: creating $ac_file" >&6;} - rm -f "$ac_file" - fi - # Let's still pretend it is `configure' which instantiates (i.e., don't - # use $as_me), people would be surprised to read: - # /* config.h. Generated by config.status. */ - if test x"$ac_file" = x-; then - configure_input= - else - configure_input="$ac_file. " - fi - configure_input=$configure_input"Generated from `echo $ac_file_in | - sed 's,.*/,,'` by configure." - - # First look for the input files in the build tree, otherwise in the - # src tree. - ac_file_inputs=`IFS=: - for f in $ac_file_in; do - case $f in - -) echo $tmp/stdin ;; - [\\/$]*) - # Absolute (can't be DOS-style, as IFS=:) - test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 -echo "$as_me: error: cannot find input file: $f" >&2;} - { (exit 1); exit 1; }; } - echo $f;; - *) # Relative - if test -f "$f"; then - # Build tree - echo $f - elif test -f "$srcdir/$f"; then - # Source tree - echo $srcdir/$f - else - # /dev/null tree - { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 -echo "$as_me: error: cannot find input file: $f" >&2;} - { (exit 1); exit 1; }; } - fi;; - esac - done` || { (exit 1); exit 1; } -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF - sed "$ac_vpsub -$extrasub -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF -:t -/@[a-zA-Z_][a-zA-Z_0-9]*@/!b -s,@configure_input@,$configure_input,;t t -s,@srcdir@,$ac_srcdir,;t t -s,@abs_srcdir@,$ac_abs_srcdir,;t t -s,@top_srcdir@,$ac_top_srcdir,;t t -s,@abs_top_srcdir@,$ac_abs_top_srcdir,;t t -s,@builddir@,$ac_builddir,;t t -s,@abs_builddir@,$ac_abs_builddir,;t t -s,@top_builddir@,$ac_top_builddir,;t t -s,@abs_top_builddir@,$ac_abs_top_builddir,;t t -s,@INSTALL@,$ac_INSTALL,;t t -" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out - rm -f $tmp/stdin - if test x"$ac_file" != x-; then - mv $tmp/out $ac_file - else - cat $tmp/out - rm -f $tmp/out - fi - -done -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF - -# -# CONFIG_HEADER section. -# - -# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where -# NAME is the cpp macro being defined and VALUE is the value it is being given. -# -# ac_d sets the value in "#define NAME VALUE" lines. -ac_dA='s,^\([ ]*\)#\([ ]*define[ ][ ]*\)' -ac_dB='[ ].*$,\1#\2' -ac_dC=' ' -ac_dD=',;t' -# ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE". -ac_uA='s,^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' -ac_uB='$,\1#\2define\3' -ac_uC=' ' -ac_uD=',;t' - -for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue - # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". - case $ac_file in - - | *:- | *:-:* ) # input from stdin - cat >$tmp/stdin - ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` - ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; - *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` - ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; - * ) ac_file_in=$ac_file.in ;; - esac - - test x"$ac_file" != x- && { echo "$as_me:$LINENO: creating $ac_file" >&5 -echo "$as_me: creating $ac_file" >&6;} - - # First look for the input files in the build tree, otherwise in the - # src tree. - ac_file_inputs=`IFS=: - for f in $ac_file_in; do - case $f in - -) echo $tmp/stdin ;; - [\\/$]*) - # Absolute (can't be DOS-style, as IFS=:) - test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 -echo "$as_me: error: cannot find input file: $f" >&2;} - { (exit 1); exit 1; }; } - echo $f;; - *) # Relative - if test -f "$f"; then - # Build tree - echo $f - elif test -f "$srcdir/$f"; then - # Source tree - echo $srcdir/$f - else - # /dev/null tree - { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 -echo "$as_me: error: cannot find input file: $f" >&2;} - { (exit 1); exit 1; }; } - fi;; - esac - done` || { (exit 1); exit 1; } - # Remove the trailing spaces. - sed 's/[ ]*$//' $ac_file_inputs >$tmp/in - -_ACEOF - -# Transform confdefs.h into two sed scripts, `conftest.defines' and -# `conftest.undefs', that substitutes the proper values into -# config.h.in to produce config.h. The first handles `#define' -# templates, and the second `#undef' templates. -# And first: Protect against being on the right side of a sed subst in -# config.status. Protect against being in an unquoted here document -# in config.status. -rm -f conftest.defines conftest.undefs -# Using a here document instead of a string reduces the quoting nightmare. -# Putting comments in sed scripts is not portable. -# -# `end' is used to avoid that the second main sed command (meant for -# 0-ary CPP macros) applies to n-ary macro definitions. -# See the Autoconf documentation for `clear'. -cat >confdef2sed.sed <<\_ACEOF -s/[\\&,]/\\&/g -s,[\\$`],\\&,g -t clear -: clear -s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*\)\(([^)]*)\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1\2${ac_dC}\3${ac_dD},gp -t end -s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp -: end -_ACEOF -# If some macros were called several times there might be several times -# the same #defines, which is useless. Nevertheless, we may not want to -# sort them, since we want the *last* AC-DEFINE to be honored. -uniq confdefs.h | sed -n -f confdef2sed.sed >conftest.defines -sed 's/ac_d/ac_u/g' conftest.defines >conftest.undefs -rm -f confdef2sed.sed - -# This sed command replaces #undef with comments. This is necessary, for -# example, in the case of _POSIX_SOURCE, which is predefined and required -# on some systems where configure will not decide to define it. -cat >>conftest.undefs <<\_ACEOF -s,^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */, -_ACEOF - -# Break up conftest.defines because some shells have a limit on the size -# of here documents, and old seds have small limits too (100 cmds). -echo ' # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS -echo ' if grep "^[ ]*#[ ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS -echo ' # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS -echo ' :' >>$CONFIG_STATUS -rm -f conftest.tail -while grep . conftest.defines >/dev/null -do - # Write a limited-size here document to $tmp/defines.sed. - echo ' cat >$tmp/defines.sed <>$CONFIG_STATUS - # Speed up: don't consider the non `#define' lines. - echo '/^[ ]*#[ ]*define/!b' >>$CONFIG_STATUS - # Work around the forget-to-reset-the-flag bug. - echo 't clr' >>$CONFIG_STATUS - echo ': clr' >>$CONFIG_STATUS - sed ${ac_max_here_lines}q conftest.defines >>$CONFIG_STATUS - echo 'CEOF - sed -f $tmp/defines.sed $tmp/in >$tmp/out - rm -f $tmp/in - mv $tmp/out $tmp/in -' >>$CONFIG_STATUS - sed 1,${ac_max_here_lines}d conftest.defines >conftest.tail - rm -f conftest.defines - mv conftest.tail conftest.defines -done -rm -f conftest.defines -echo ' fi # grep' >>$CONFIG_STATUS -echo >>$CONFIG_STATUS - -# Break up conftest.undefs because some shells have a limit on the size -# of here documents, and old seds have small limits too (100 cmds). -echo ' # Handle all the #undef templates' >>$CONFIG_STATUS -rm -f conftest.tail -while grep . conftest.undefs >/dev/null -do - # Write a limited-size here document to $tmp/undefs.sed. - echo ' cat >$tmp/undefs.sed <>$CONFIG_STATUS - # Speed up: don't consider the non `#undef' - echo '/^[ ]*#[ ]*undef/!b' >>$CONFIG_STATUS - # Work around the forget-to-reset-the-flag bug. - echo 't clr' >>$CONFIG_STATUS - echo ': clr' >>$CONFIG_STATUS - sed ${ac_max_here_lines}q conftest.undefs >>$CONFIG_STATUS - echo 'CEOF - sed -f $tmp/undefs.sed $tmp/in >$tmp/out - rm -f $tmp/in - mv $tmp/out $tmp/in -' >>$CONFIG_STATUS - sed 1,${ac_max_here_lines}d conftest.undefs >conftest.tail - rm -f conftest.undefs - mv conftest.tail conftest.undefs -done -rm -f conftest.undefs - -cat >>$CONFIG_STATUS <<\_ACEOF - # Let's still pretend it is `configure' which instantiates (i.e., don't - # use $as_me), people would be surprised to read: - # /* config.h. Generated by config.status. */ - if test x"$ac_file" = x-; then - echo "/* Generated by configure. */" >$tmp/config.h - else - echo "/* $ac_file. Generated by configure. */" >$tmp/config.h - fi - cat $tmp/in >>$tmp/config.h - rm -f $tmp/in - if test x"$ac_file" != x-; then - if diff $ac_file $tmp/config.h >/dev/null 2>&1; then - { echo "$as_me:$LINENO: $ac_file is unchanged" >&5 -echo "$as_me: $ac_file is unchanged" >&6;} - else - ac_dir=`(dirname "$ac_file") 2>/dev/null || -$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$ac_file" : 'X\(//\)[^/]' \| \ - X"$ac_file" : 'X\(//\)$' \| \ - X"$ac_file" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || -echo X"$ac_file" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - { if $as_mkdir_p; then - mkdir -p "$ac_dir" - else - as_dir="$ac_dir" - as_dirs= - while test ! -d "$as_dir"; do - as_dirs="$as_dir $as_dirs" - as_dir=`(dirname "$as_dir") 2>/dev/null || -$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_dir" : 'X\(//\)[^/]' \| \ - X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || -echo X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - done - test ! -n "$as_dirs" || mkdir $as_dirs - fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 -echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} - { (exit 1); exit 1; }; }; } - - rm -f $ac_file - mv $tmp/config.h $ac_file - fi - else - cat $tmp/config.h - rm -f $tmp/config.h - fi -done -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF - -{ (exit 0); exit 0; } -_ACEOF -chmod +x $CONFIG_STATUS -ac_clean_files=$ac_clean_files_save - - -# configure is writing to config.log, and then calls config.status. -# config.status does its own redirection, appending to config.log. -# Unfortunately, on DOS this fails, as config.log is still kept open -# by configure, so config.status won't be able to write to it; its -# output is simply discarded. So we exec the FD to /dev/null, -# effectively closing config.log, so it can be properly (re)opened and -# appended to by config.status. When coming back to configure, we -# need to make the FD available again. -if test "$no_create" != yes; then - ac_cs_success=: - ac_config_status_args= - test "$silent" = yes && - ac_config_status_args="$ac_config_status_args --quiet" - exec 5>/dev/null - $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false - exec 5>>config.log - # Use ||, not &&, to avoid exiting from the if with $? = 1, which - # would make configure fail if this is the last instruction. - $ac_cs_success || { (exit 1); exit 1; } -fi - - -abs_srcdir="`cd $srcdir && pwd`" -abs_builddir="`pwd`" -if test "$abs_srcdir" != "$abs_builddir"; then - ${MAKE:-make} mkdir-init -fi diff --git a/wxWidgets/src/expat/configure.in b/wxWidgets/src/expat/configure.in deleted file mode 100644 index 7a0bb82e8f..0000000000 --- a/wxWidgets/src/expat/configure.in +++ /dev/null @@ -1,127 +0,0 @@ -dnl configuration script for expat -dnl Process this file with autoconf to produce a configure script. -dnl -dnl Copyright 2000 Clark Cooper -dnl -dnl This file is part of EXPAT. -dnl -dnl EXPAT is free software; you can redistribute it and/or modify it -dnl under the terms of the License (based on the MIT/X license) contained -dnl in the file COPYING that comes with this distribution. -dnl - -dnl Ensure that Expat is configured with autoconf 2.52 or newer -AC_PREREQ(2.52) - -dnl Get the version number of Expat, using m4's esyscmd() command to run -dnl the command at m4-generation time. This allows us to create an m4 -dnl symbol holding the correct version number. AC_INIT() requires the -dnl version number at m4-time, rather than when ./configure is run, so -dnl all this must happen as part of m4, not as part of the shell code -dnl contained in ./configure. -dnl -dnl NOTE: esyscmd() is a GNU M4 extension. Thus, we wrap it in an appropriate -dnl test. I believe this test will work, but I don't have a place with non- -dnl GNU M4 to test it right now. -define([expat_version], ifdef([__gnu__], - [esyscmd(conftools/get-version.sh lib/expat.h)], - [1.95.x])) -AC_INIT(expat, expat_version, expat-bugs@mail.libexpat.org) -undefine([expat_version]) - -AC_CONFIG_SRCDIR(Makefile.in) -AC_CONFIG_AUX_DIR(conftools) - - -dnl -dnl Increment LIBREVISION if source code has changed at all -dnl -dnl If the API has changed, increment LIBCURRENT and set LIBREVISION to 0 -dnl -dnl If the API changes compatibly (i.e. simply adding a new function -dnl without changing or removing earlier interfaces), then increment LIBAGE. -dnl -dnl If the API changes incompatibly set LIBAGE back to 0 -dnl - -LIBCURRENT=4 -LIBREVISION=0 -LIBAGE=4 - -AC_CONFIG_HEADER(expat_config.h) - -sinclude(conftools/libtool.m4) -sinclude(conftools/ac_c_bigendian_cross.m4) - - -dnl Check for many C compilers (have to do this before libtool stuff) -AC_BAKEFILE_PROG_CC - -AC_LIBTOOL_WIN32_DLL -AC_PROG_LIBTOOL - -AC_SUBST(LIBCURRENT) -AC_SUBST(LIBREVISION) -AC_SUBST(LIBAGE) - -dnl Checks for programs. -AC_PROG_INSTALL - -if test "$GCC" = yes ; then - dnl - dnl Be careful about adding the -fexceptions option; some versions of - dnl GCC don't support it and it causes extra warnings that are only - dnl distracting; avoid. - dnl - OLDCFLAGS="$CFLAGS -Wall -Wmissing-prototypes -Wstrict-prototypes" - CFLAGS="$OLDCFLAGS -fexceptions" - AC_MSG_CHECKING(whether gcc accepts -fexceptions) - AC_TRY_COMPILE(,(void)1, - AC_MSG_RESULT(yes), - AC_MSG_RESULT(no); CFLAGS="$OLDCFLAGS") -fi - -dnl Checks for header files. -AC_HEADER_STDC -AC_CHECK_HEADERS(fcntl.h unistd.h) - -dnl Checks for typedefs, structures, and compiler characteristics. - -dnl Note: Avoid using AC_C_BIGENDIAN because it does not -dnl work in a cross compile. -AC_C_BIGENDIAN_CROSS - -AC_C_CONST -AC_TYPE_OFF_T -AC_TYPE_SIZE_T - -dnl Checks for library functions. - -AC_FUNC_MEMCMP -AC_FUNC_MMAP - -if test "$ac_cv_func_mmap_fixed_mapped" = "yes"; then - FILEMAP=unixfilemap -else - FILEMAP=readfilemap -fi -AC_SUBST(FILEMAP) - -AC_CHECK_FUNCS(memmove bcopy) - -dnl some basic configuration -AC_DEFINE([XML_NS], 1, - [Define to make XML Namespaces functionality available.]) -AC_DEFINE([XML_DTD], 1, - [Define to make parameter entity parsing functionality available.]) -AC_DEFINE([XML_CONTEXT_BYTES], 1024, - [Define to specify how much context to retain around the current parse point.]) - -AC_CONFIG_FILES(Makefile) -AC_OUTPUT - -abs_srcdir="`cd $srcdir && pwd`" -abs_builddir="`pwd`" -if test "$abs_srcdir" != "$abs_builddir"; then - ${MAKE:-make} mkdir-init -fi diff --git a/wxWidgets/src/expat/conftools/PrintPath b/wxWidgets/src/expat/conftools/PrintPath deleted file mode 100644 index 869f2aa762..0000000000 --- a/wxWidgets/src/expat/conftools/PrintPath +++ /dev/null @@ -1,116 +0,0 @@ -#!/bin/sh -# Look for program[s] somewhere in $PATH. -# -# Options: -# -s -# Do not print out full pathname. (silent) -# -pPATHNAME -# Look in PATHNAME instead of $PATH -# -# Usage: -# PrintPath [-s] [-pPATHNAME] program [program ...] -# -# Initially written by Jim Jagielski for the Apache configuration mechanism -# (with kudos to Kernighan/Pike) -# -# This script falls under the Apache License. -# See http://www.apache.org/licenses/LICENSE - -## -# Some "constants" -## -pathname=$PATH -echo="yes" - -## -# Find out what OS we are running for later on -## -os=`(uname) 2>/dev/null` - -## -# Parse command line -## -for args in $* -do - case $args in - -s ) echo="no" ;; - -p* ) pathname="`echo $args | sed 's/^..//'`" ;; - * ) programs="$programs $args" ;; - esac -done - -## -# Now we make the adjustments required for OS/2 and everyone -# else :) -# -# First of all, all OS/2 programs have the '.exe' extension. -# Next, we adjust PATH (or what was given to us as PATH) to -# be whitespace seperated directories. -# Finally, we try to determine the best flag to use for -# test/[] to look for an executable file. OS/2 just has '-r' -# but with other OSs, we do some funny stuff to check to see -# if test/[] knows about -x, which is the prefered flag. -## - -if [ "x$os" = "xOS/2" ] -then - ext=".exe" - pathname=`echo -E $pathname | - sed 's/^;/.;/ - s/;;/;.;/g - s/;$/;./ - s/;/ /g - s/\\\\/\\//g' ` - test_exec_flag="-r" -else - ext="" # No default extensions - pathname=`echo $pathname | - sed 's/^:/.:/ - s/::/:.:/g - s/:$/:./ - s/:/ /g' ` - # Here is how we test to see if test/[] can handle -x - testfile="pp.t.$$" - - cat > $testfile </dev/null`; then - test_exec_flag="-x" - else - test_exec_flag="-r" - fi - rm -f $testfile -fi - -for program in $programs -do - for path in $pathname - do - if [ $test_exec_flag $path/${program}${ext} ] && \ - [ ! -d $path/${program}${ext} ]; then - if [ "x$echo" = "xyes" ]; then - echo $path/${program}${ext} - fi - exit 0 - fi - -# Next try without extension (if one was used above) - if [ "x$ext" != "x" ]; then - if [ $test_exec_flag $path/${program} ] && \ - [ ! -d $path/${program} ]; then - if [ "x$echo" = "xyes" ]; then - echo $path/${program} - fi - exit 0 - fi - fi - done -done -exit 1 - diff --git a/wxWidgets/src/expat/conftools/ac_c_bigendian_cross.m4 b/wxWidgets/src/expat/conftools/ac_c_bigendian_cross.m4 deleted file mode 100644 index 3e06acdca7..0000000000 --- a/wxWidgets/src/expat/conftools/ac_c_bigendian_cross.m4 +++ /dev/null @@ -1,81 +0,0 @@ -dnl @synopsis AC_C_BIGENDIAN_CROSS -dnl -dnl Check endianess even when crosscompiling -dnl (partially based on the original AC_C_BIGENDIAN). -dnl -dnl The implementation will create a binary, and instead of running -dnl the binary it will be grep'ed for some symbols that will look -dnl different for different endianess of the binary. -dnl -dnl @version $Id: ac_c_bigendian_cross.m4 51550 2008-02-04 17:05:54Z VZ $ -dnl @author Guido Draheim -dnl -AC_DEFUN([AC_C_BIGENDIAN_CROSS], -[AC_CACHE_CHECK(whether byte ordering is bigendian, ac_cv_c_bigendian, -[ac_cv_c_bigendian=unknown -# See if sys/param.h defines the BYTE_ORDER macro. -AC_TRY_COMPILE([#include -#include ], [ -#if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN - bogus endian macros -#endif], [# It does; now see whether it defined to BIG_ENDIAN or not. -AC_TRY_COMPILE([#include -#include ], [ -#if BYTE_ORDER != BIG_ENDIAN - not big endian -#endif], ac_cv_c_bigendian=yes, ac_cv_c_bigendian=no)]) -if test $ac_cv_c_bigendian = unknown; then -AC_TRY_RUN([main () { - /* Are we little or big endian? From Harbison&Steele. */ - union - { - long l; - char c[sizeof (long)]; - } u; - u.l = 1; - exit (u.c[sizeof (long) - 1] == 1); -}], ac_cv_c_bigendian=no, ac_cv_c_bigendian=yes, -[ echo $ac_n "cross-compiling... " 2>&AC_FD_MSG ]) -fi]) -if test $ac_cv_c_bigendian = unknown; then -AC_MSG_CHECKING(to probe for byte ordering) -[ -cat >conftest.c <&AC_FD_MSG - ac_cv_c_bigendian=yes - fi - if test `grep -l LiTTleEnDian conftest.o` ; then - echo $ac_n ' little endian probe OK, ' 1>&AC_FD_MSG - if test $ac_cv_c_bigendian = yes ; then - ac_cv_c_bigendian=unknown; - else - ac_cv_c_bigendian=no - fi - fi - echo $ac_n 'guessing bigendian ... ' >&AC_FD_MSG - fi - fi -AC_MSG_RESULT($ac_cv_c_bigendian) -fi -if test $ac_cv_c_bigendian = yes; then - AC_DEFINE(WORDS_BIGENDIAN, 1, [whether byteorder is bigendian]) - BYTEORDER=4321 -else - BYTEORDER=1234 -fi -AC_DEFINE_UNQUOTED(BYTEORDER, $BYTEORDER, [1234 = LIL_ENDIAN, 4321 = BIGENDIAN]) -if test $ac_cv_c_bigendian = unknown; then - AC_MSG_ERROR(unknown endianess - sorry, please pre-set ac_cv_c_bigendian) -fi -]) diff --git a/wxWidgets/src/expat/conftools/config.guess b/wxWidgets/src/expat/conftools/config.guess deleted file mode 100644 index 6cfac28c85..0000000000 --- a/wxWidgets/src/expat/conftools/config.guess +++ /dev/null @@ -1,1344 +0,0 @@ -#! /bin/sh -# Attempt to guess a canonical system name. -# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002 Free Software Foundation, Inc. - -timestamp='2002-03-20' - -# This file is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - -##################################################################### -# This file contains changes for Apache, clearly marked below. -# These changes are hereby donated to the public domain. -##################################################################### - -# Originally written by Per Bothner . -# Please send patches to . Submit a context -# diff and a properly formatted ChangeLog entry. -# -# This script attempts to guess a canonical system name similar to -# config.sub. If it succeeds, it prints the system name on stdout, and -# exits with 0. Otherwise, it exits with 1. -# -# The plan is that this can be called by configure scripts if you -# don't specify an explicit build system type. - -me=`echo "$0" | sed -e 's,.*/,,'` - -usage="\ -Usage: $0 [OPTION] - -Output the configuration name of the system \`$me' is run on. - -Operation modes: - -h, --help print this help, then exit - -t, --time-stamp print date of last modification, then exit - -v, --version print version number, then exit - -Report bugs and patches to ." - -version="\ -GNU config.guess ($timestamp) - -Originally written by Per Bothner. -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 -Free Software Foundation, Inc. - -This is free software; see the source for copying conditions. There is NO -warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." - -help=" -Try \`$me --help' for more information." - -# Parse command line -while test $# -gt 0 ; do - case $1 in - --time-stamp | --time* | -t ) - echo "$timestamp" ; exit 0 ;; - --version | -v ) - echo "$version" ; exit 0 ;; - --help | --h* | -h ) - echo "$usage"; exit 0 ;; - -- ) # Stop option processing - shift; break ;; - - ) # Use stdin as input. - break ;; - -* ) - echo "$me: invalid option $1$help" >&2 - exit 1 ;; - * ) - break ;; - esac -done - -if test $# != 0; then - echo "$me: too many arguments$help" >&2 - exit 1 -fi - - -dummy=dummy-$$ -trap 'rm -f $dummy.c $dummy.o $dummy.rel $dummy; exit 1' 1 2 15 - -# CC_FOR_BUILD -- compiler used by this script. -# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still -# use `HOST_CC' if defined, but it is deprecated. - -set_cc_for_build='case $CC_FOR_BUILD,$HOST_CC,$CC in - ,,) echo "int dummy(){}" > $dummy.c ; - for c in cc gcc c89 c99 ; do - ($c $dummy.c -c -o $dummy.o) >/dev/null 2>&1 ; - if test $? = 0 ; then - CC_FOR_BUILD="$c"; break ; - fi ; - done ; - rm -f $dummy.c $dummy.o $dummy.rel ; - if test x"$CC_FOR_BUILD" = x ; then - CC_FOR_BUILD=no_compiler_found ; - fi - ;; - ,,*) CC_FOR_BUILD=$CC ;; - ,*,*) CC_FOR_BUILD=$HOST_CC ;; -esac' - -# This is needed to find uname on a Pyramid OSx when run in the BSD universe. -# (ghazi@noc.rutgers.edu 1994-08-24) -if (test -f /.attbin/uname) >/dev/null 2>&1 ; then - PATH=$PATH:/.attbin ; export PATH -fi - -UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown -UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown -UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown -UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown - -# Note: order is significant - the case branches are not exclusive. - -case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in - *:NetBSD:*:*) - # NetBSD (nbsd) targets should (where applicable) match one or - # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, - # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently - # switched to ELF, *-*-netbsd* would select the old - # object file format. This provides both forward - # compatibility and a consistent mechanism for selecting the - # object file format. - # - # Note: NetBSD doesn't particularly care about the vendor - # portion of the name. We always set it to "unknown". - sysctl="sysctl -n hw.machine_arch" - UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ - /usr/sbin/$sysctl 2>/dev/null || echo unknown)` - case "${UNAME_MACHINE_ARCH}" in - arm*) machine=arm-unknown ;; - sh3el) machine=shl-unknown ;; - sh3eb) machine=sh-unknown ;; - *) machine=${UNAME_MACHINE_ARCH}-unknown ;; - esac - # The Operating System including object format, if it has switched - # to ELF recently, or will in the future. - case "${UNAME_MACHINE_ARCH}" in - arm*|i386|m68k|ns32k|sh3*|sparc|vax) - eval $set_cc_for_build - if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ - | grep __ELF__ >/dev/null - then - # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). - # Return netbsd for either. FIX? - os=netbsd - else - os=netbsdelf - fi - ;; - *) - os=netbsd - ;; - esac - # The OS release - release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` - # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: - # contains redundant information, the shorter form: - # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. - echo "${machine}-${os}${release}" - exit 0 ;; - amiga:OpenBSD:*:*) - echo m68k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - arc:OpenBSD:*:*) - echo mipsel-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - hp300:OpenBSD:*:*) - echo m68k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - mac68k:OpenBSD:*:*) - echo m68k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - macppc:OpenBSD:*:*) - echo powerpc-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - mvme68k:OpenBSD:*:*) - echo m68k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - mvme88k:OpenBSD:*:*) - echo m88k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - mvmeppc:OpenBSD:*:*) - echo powerpc-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - pmax:OpenBSD:*:*) - echo mipsel-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - sgi:OpenBSD:*:*) - echo mipseb-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - sun3:OpenBSD:*:*) - echo m68k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - wgrisc:OpenBSD:*:*) - echo mipsel-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - *:OpenBSD:*:*) - echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - alpha:OSF1:*:*) - if test $UNAME_RELEASE = "V4.0"; then - UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` - fi - # A Vn.n version is a released version. - # A Tn.n version is a released field test version. - # A Xn.n version is an unreleased experimental baselevel. - # 1.2 uses "1.2" for uname -r. - cat <$dummy.s - .data -\$Lformat: - .byte 37,100,45,37,120,10,0 # "%d-%x\n" - - .text - .globl main - .align 4 - .ent main -main: - .frame \$30,16,\$26,0 - ldgp \$29,0(\$27) - .prologue 1 - .long 0x47e03d80 # implver \$0 - lda \$2,-1 - .long 0x47e20c21 # amask \$2,\$1 - lda \$16,\$Lformat - mov \$0,\$17 - not \$1,\$18 - jsr \$26,printf - ldgp \$29,0(\$26) - mov 0,\$16 - jsr \$26,exit - .end main -EOF - eval $set_cc_for_build - $CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null - if test "$?" = 0 ; then - case `./$dummy` in - 0-0) - UNAME_MACHINE="alpha" - ;; - 1-0) - UNAME_MACHINE="alphaev5" - ;; - 1-1) - UNAME_MACHINE="alphaev56" - ;; - 1-101) - UNAME_MACHINE="alphapca56" - ;; - 2-303) - UNAME_MACHINE="alphaev6" - ;; - 2-307) - UNAME_MACHINE="alphaev67" - ;; - 2-1307) - UNAME_MACHINE="alphaev68" - ;; - esac - fi - rm -f $dummy.s $dummy - echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - exit 0 ;; - Alpha\ *:Windows_NT*:*) - # How do we know it's Interix rather than the generic POSIX subsystem? - # Should we change UNAME_MACHINE based on the output of uname instead - # of the specific Alpha model? - echo alpha-pc-interix - exit 0 ;; - 21064:Windows_NT:50:3) - echo alpha-dec-winnt3.5 - exit 0 ;; - Amiga*:UNIX_System_V:4.0:*) - echo m68k-unknown-sysv4 - exit 0;; - *:[Aa]miga[Oo][Ss]:*:*) - echo ${UNAME_MACHINE}-unknown-amigaos - exit 0 ;; - *:[Mm]orph[Oo][Ss]:*:*) - echo ${UNAME_MACHINE}-unknown-morphos - exit 0 ;; -######################### -# Apache changes -# -# *:OS/390:*:*) -# echo i370-ibm-openedition -# exit 0 ;; - *:OS390:*:* | *:OS/390:*:*) - echo s390-ibm-os390 - exit 0 ;; - *:OS400:*:* | *:OS/400:*:*) - echo as400-ibm-os400 - exit 0 ;; - *:OS/2:*:*) - echo "i386-pc-os2_emx" - exit 0;; -# -# end Apache changes -######################### - *:OS/390:*:*) - echo i370-ibm-openedition - exit 0 ;; - arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) - echo arm-acorn-riscix${UNAME_RELEASE} - exit 0;; - SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) - echo hppa1.1-hitachi-hiuxmpp - exit 0;; - Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) - # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. - if test "`(/bin/universe) 2>/dev/null`" = att ; then - echo pyramid-pyramid-sysv3 - else - echo pyramid-pyramid-bsd - fi - exit 0 ;; - NILE*:*:*:dcosx) - echo pyramid-pyramid-svr4 - exit 0 ;; - sun4H:SunOS:5.*:*) - echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit 0 ;; - sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) - echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit 0 ;; - i86pc:SunOS:5.*:*) - echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit 0 ;; - sun4*:SunOS:6*:*) - # According to config.sub, this is the proper way to canonicalize - # SunOS6. Hard to guess exactly what SunOS6 will be like, but - # it's likely to be more like Solaris than SunOS4. - echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit 0 ;; - sun4*:SunOS:*:*) - case "`/usr/bin/arch -k`" in - Series*|S4*) - UNAME_RELEASE=`uname -v` - ;; - esac - # Japanese Language versions have a version number like `4.1.3-JL'. - echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` - exit 0 ;; - sun3*:SunOS:*:*) - echo m68k-sun-sunos${UNAME_RELEASE} - exit 0 ;; - sun*:*:4.2BSD:*) - UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` - test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 - case "`/bin/arch`" in - sun3) - echo m68k-sun-sunos${UNAME_RELEASE} - ;; - sun4) - echo sparc-sun-sunos${UNAME_RELEASE} - ;; - esac - exit 0 ;; - aushp:SunOS:*:*) - echo sparc-auspex-sunos${UNAME_RELEASE} - exit 0 ;; - # The situation for MiNT is a little confusing. The machine name - # can be virtually everything (everything which is not - # "atarist" or "atariste" at least should have a processor - # > m68000). The system name ranges from "MiNT" over "FreeMiNT" - # to the lowercase version "mint" (or "freemint"). Finally - # the system name "TOS" denotes a system which is actually not - # MiNT. But MiNT is downward compatible to TOS, so this should - # be no problem. - atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} - exit 0 ;; - atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} - exit 0 ;; - *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} - exit 0 ;; - milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) - echo m68k-milan-mint${UNAME_RELEASE} - exit 0 ;; - hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) - echo m68k-hades-mint${UNAME_RELEASE} - exit 0 ;; - *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) - echo m68k-unknown-mint${UNAME_RELEASE} - exit 0 ;; - powerpc:machten:*:*) - echo powerpc-apple-machten${UNAME_RELEASE} - exit 0 ;; - RISC*:Mach:*:*) - echo mips-dec-mach_bsd4.3 - exit 0 ;; - RISC*:ULTRIX:*:*) - echo mips-dec-ultrix${UNAME_RELEASE} - exit 0 ;; - VAX*:ULTRIX*:*:*) - echo vax-dec-ultrix${UNAME_RELEASE} - exit 0 ;; - 2020:CLIX:*:* | 2430:CLIX:*:*) - echo clipper-intergraph-clix${UNAME_RELEASE} - exit 0 ;; - mips:*:*:UMIPS | mips:*:*:RISCos) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c -#ifdef __cplusplus -#include /* for printf() prototype */ - int main (int argc, char *argv[]) { -#else - int main (argc, argv) int argc; char *argv[]; { -#endif - #if defined (host_mips) && defined (MIPSEB) - #if defined (SYSTYPE_SYSV) - printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); - #endif - #if defined (SYSTYPE_SVR4) - printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); - #endif - #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) - printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); - #endif - #endif - exit (-1); - } -EOF - $CC_FOR_BUILD $dummy.c -o $dummy \ - && ./$dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \ - && rm -f $dummy.c $dummy && exit 0 - rm -f $dummy.c $dummy - echo mips-mips-riscos${UNAME_RELEASE} - exit 0 ;; - Motorola:PowerMAX_OS:*:*) - echo powerpc-motorola-powermax - exit 0 ;; - Night_Hawk:Power_UNIX:*:*) - echo powerpc-harris-powerunix - exit 0 ;; - m88k:CX/UX:7*:*) - echo m88k-harris-cxux7 - exit 0 ;; - m88k:*:4*:R4*) - echo m88k-motorola-sysv4 - exit 0 ;; - m88k:*:3*:R3*) - echo m88k-motorola-sysv3 - exit 0 ;; - AViiON:dgux:*:*) - # DG/UX returns AViiON for all architectures - UNAME_PROCESSOR=`/usr/bin/uname -p` - if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] - then - if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ - [ ${TARGET_BINARY_INTERFACE}x = x ] - then - echo m88k-dg-dgux${UNAME_RELEASE} - else - echo m88k-dg-dguxbcs${UNAME_RELEASE} - fi - else - echo i586-dg-dgux${UNAME_RELEASE} - fi - exit 0 ;; - M88*:DolphinOS:*:*) # DolphinOS (SVR3) - echo m88k-dolphin-sysv3 - exit 0 ;; - M88*:*:R3*:*) - # Delta 88k system running SVR3 - echo m88k-motorola-sysv3 - exit 0 ;; - XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) - echo m88k-tektronix-sysv3 - exit 0 ;; - Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) - echo m68k-tektronix-bsd - exit 0 ;; - *:IRIX*:*:*) - echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` - exit 0 ;; - ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. - echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id - exit 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX ' - i*86:AIX:*:*) - echo i386-ibm-aix - exit 0 ;; - ia64:AIX:*:*) - if [ -x /usr/bin/oslevel ] ; then - IBM_REV=`/usr/bin/oslevel` - else - IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} - fi - echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} - exit 0 ;; - *:AIX:2:3) - if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #include - - main() - { - if (!__power_pc()) - exit(1); - puts("powerpc-ibm-aix3.2.5"); - exit(0); - } -EOF - $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm -f $dummy.c $dummy && exit 0 - rm -f $dummy.c $dummy - echo rs6000-ibm-aix3.2.5 - elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then - echo rs6000-ibm-aix3.2.4 - else - echo rs6000-ibm-aix3.2 - fi - exit 0 ;; - *:AIX:*:[45]) - IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` - if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then - IBM_ARCH=rs6000 - else - IBM_ARCH=powerpc - fi - if [ -x /usr/bin/oslevel ] ; then - IBM_REV=`/usr/bin/oslevel` - else - IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} - fi - echo ${IBM_ARCH}-ibm-aix${IBM_REV} - exit 0 ;; - *:AIX:*:*) - echo rs6000-ibm-aix - exit 0 ;; - ibmrt:4.4BSD:*|romp-ibm:BSD:*) - echo romp-ibm-bsd4.4 - exit 0 ;; - ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and - echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to - exit 0 ;; # report: romp-ibm BSD 4.3 - *:BOSX:*:*) - echo rs6000-bull-bosx - exit 0 ;; - DPX/2?00:B.O.S.:*:*) - echo m68k-bull-sysv3 - exit 0 ;; - 9000/[34]??:4.3bsd:1.*:*) - echo m68k-hp-bsd - exit 0 ;; - hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) - echo m68k-hp-bsd4.4 - exit 0 ;; - 9000/[34678]??:HP-UX:*:*) - HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` - case "${UNAME_MACHINE}" in - 9000/31? ) HP_ARCH=m68000 ;; - 9000/[34]?? ) HP_ARCH=m68k ;; - 9000/[678][0-9][0-9]) - if [ -x /usr/bin/getconf ]; then - sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` - sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` - case "${sc_cpu_version}" in - 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 - 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 - 532) # CPU_PA_RISC2_0 - case "${sc_kernel_bits}" in - 32) HP_ARCH="hppa2.0n" ;; - 64) HP_ARCH="hppa2.0w" ;; - '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 - esac ;; - esac - fi - if [ "${HP_ARCH}" = "" ]; then - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - - #define _HPUX_SOURCE - #include - #include - - int main () - { - #if defined(_SC_KERNEL_BITS) - long bits = sysconf(_SC_KERNEL_BITS); - #endif - long cpu = sysconf (_SC_CPU_VERSION); - - switch (cpu) - { - case CPU_PA_RISC1_0: puts ("hppa1.0"); break; - case CPU_PA_RISC1_1: puts ("hppa1.1"); break; - case CPU_PA_RISC2_0: - #if defined(_SC_KERNEL_BITS) - switch (bits) - { - case 64: puts ("hppa2.0w"); break; - case 32: puts ("hppa2.0n"); break; - default: puts ("hppa2.0"); break; - } break; - #else /* !defined(_SC_KERNEL_BITS) */ - puts ("hppa2.0"); break; - #endif - default: puts ("hppa1.0"); break; - } - exit (0); - } -EOF - (CCOPTS= $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null) && HP_ARCH=`./$dummy` - if test -z "$HP_ARCH"; then HP_ARCH=hppa; fi - rm -f $dummy.c $dummy - fi ;; - esac - echo ${HP_ARCH}-hp-hpux${HPUX_REV} - exit 0 ;; - ia64:HP-UX:*:*) - HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` - echo ia64-hp-hpux${HPUX_REV} - exit 0 ;; - 3050*:HI-UX:*:*) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #include - int - main () - { - long cpu = sysconf (_SC_CPU_VERSION); - /* The order matters, because CPU_IS_HP_MC68K erroneously returns - true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct - results, however. */ - if (CPU_IS_PA_RISC (cpu)) - { - switch (cpu) - { - case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; - case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; - case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; - default: puts ("hppa-hitachi-hiuxwe2"); break; - } - } - else if (CPU_IS_HP_MC68K (cpu)) - puts ("m68k-hitachi-hiuxwe2"); - else puts ("unknown-hitachi-hiuxwe2"); - exit (0); - } -EOF - $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm -f $dummy.c $dummy && exit 0 - rm -f $dummy.c $dummy - echo unknown-hitachi-hiuxwe2 - exit 0 ;; - 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) - echo hppa1.1-hp-bsd - exit 0 ;; - 9000/8??:4.3bsd:*:*) - echo hppa1.0-hp-bsd - exit 0 ;; - *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) - echo hppa1.0-hp-mpeix - exit 0 ;; - hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) - echo hppa1.1-hp-osf - exit 0 ;; - hp8??:OSF1:*:*) - echo hppa1.0-hp-osf - exit 0 ;; - i*86:OSF1:*:*) - if [ -x /usr/sbin/sysversion ] ; then - echo ${UNAME_MACHINE}-unknown-osf1mk - else - echo ${UNAME_MACHINE}-unknown-osf1 - fi - exit 0 ;; - parisc*:Lites*:*:*) - echo hppa1.1-hp-lites - exit 0 ;; - C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) - echo c1-convex-bsd - exit 0 ;; - C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) - if getsysinfo -f scalar_acc - then echo c32-convex-bsd - else echo c2-convex-bsd - fi - exit 0 ;; - C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) - echo c34-convex-bsd - exit 0 ;; - C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) - echo c38-convex-bsd - exit 0 ;; - C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) - echo c4-convex-bsd - exit 0 ;; - CRAY*Y-MP:*:*:*) - echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit 0 ;; - CRAY*[A-Z]90:*:*:*) - echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ - | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ - -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ - -e 's/\.[^.]*$/.X/' - exit 0 ;; - CRAY*TS:*:*:*) - echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit 0 ;; - CRAY*T3D:*:*:*) - echo alpha-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit 0 ;; - CRAY*T3E:*:*:*) - echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit 0 ;; - CRAY*SV1:*:*:*) - echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit 0 ;; - F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) - FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` - FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` - echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" - exit 0 ;; - i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) - echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} - exit 0 ;; - sparc*:BSD/OS:*:*) - echo sparc-unknown-bsdi${UNAME_RELEASE} - exit 0 ;; - *:BSD/OS:*:*) - echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} - exit 0 ;; - *:FreeBSD:*:*) - echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` - exit 0 ;; - i*:CYGWIN*:*) - echo ${UNAME_MACHINE}-pc-cygwin - exit 0 ;; - i*:MINGW*:*) - echo ${UNAME_MACHINE}-pc-mingw32 - exit 0 ;; - i*:PW*:*) - echo ${UNAME_MACHINE}-pc-pw32 - exit 0 ;; - x86:Interix*:3*) - echo i386-pc-interix3 - exit 0 ;; - i*:Windows_NT*:* | Pentium*:Windows_NT*:*) - # How do we know it's Interix rather than the generic POSIX subsystem? - # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we - # UNAME_MACHINE based on the output of uname instead of i386? - echo i386-pc-interix - exit 0 ;; - i*:UWIN*:*) - echo ${UNAME_MACHINE}-pc-uwin - exit 0 ;; - p*:CYGWIN*:*) - echo powerpcle-unknown-cygwin - exit 0 ;; - prep*:SunOS:5.*:*) - echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit 0 ;; - *:GNU:*:*) - echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` - exit 0 ;; - i*86:Minix:*:*) - echo ${UNAME_MACHINE}-pc-minix - exit 0 ;; - arm*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit 0 ;; - ia64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit 0 ;; - m68*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit 0 ;; - mips:Linux:*:*) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #undef CPU - #undef mips - #undef mipsel - #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) - CPU=mipsel - #else - #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) - CPU=mips - #else - CPU= - #endif - #endif -EOF - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=` - rm -f $dummy.c - test x"${CPU}" != x && echo "${CPU}-pc-linux-gnu" && exit 0 - ;; - ppc:Linux:*:*) - echo powerpc-unknown-linux-gnu - exit 0 ;; - ppc64:Linux:*:*) - echo powerpc64-unknown-linux-gnu - exit 0 ;; - alpha:Linux:*:*) - case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in - EV5) UNAME_MACHINE=alphaev5 ;; - EV56) UNAME_MACHINE=alphaev56 ;; - PCA56) UNAME_MACHINE=alphapca56 ;; - PCA57) UNAME_MACHINE=alphapca56 ;; - EV6) UNAME_MACHINE=alphaev6 ;; - EV67) UNAME_MACHINE=alphaev67 ;; - EV68*) UNAME_MACHINE=alphaev68 ;; - esac - objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null - if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi - echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} - exit 0 ;; - parisc:Linux:*:* | hppa:Linux:*:*) - # Look for CPU level - case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in - PA7*) echo hppa1.1-unknown-linux-gnu ;; - PA8*) echo hppa2.0-unknown-linux-gnu ;; - *) echo hppa-unknown-linux-gnu ;; - esac - exit 0 ;; - parisc64:Linux:*:* | hppa64:Linux:*:*) - echo hppa64-unknown-linux-gnu - exit 0 ;; - s390:Linux:*:* | s390x:Linux:*:*) - echo ${UNAME_MACHINE}-ibm-linux - exit 0 ;; - sh*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit 0 ;; - sparc:Linux:*:* | sparc64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit 0 ;; - x86_64:Linux:*:*) - echo x86_64-unknown-linux-gnu - exit 0 ;; - i*86:Linux:*:*) - # The BFD linker knows what the default object file format is, so - # first see if it will tell us. cd to the root directory to prevent - # problems with other programs or directories called `ld' in the path. - # Set LC_ALL=C to ensure ld outputs messages in English. - ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \ - | sed -ne '/supported targets:/!d - s/[ ][ ]*/ /g - s/.*supported targets: *// - s/ .*// - p'` - case "$ld_supported_targets" in - elf32-i386) - TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" - ;; - a.out-i386-linux) - echo "${UNAME_MACHINE}-pc-linux-gnuaout" - exit 0 ;; - coff-i386) - echo "${UNAME_MACHINE}-pc-linux-gnucoff" - exit 0 ;; - "") - # Either a pre-BFD a.out linker (linux-gnuoldld) or - # one that does not give us useful --help. - echo "${UNAME_MACHINE}-pc-linux-gnuoldld" - exit 0 ;; - esac - # Determine whether the default compiler is a.out or elf - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #include - #ifdef __ELF__ - # ifdef __GLIBC__ - # if __GLIBC__ >= 2 - LIBC=gnu - # else - LIBC=gnulibc1 - # endif - # else - LIBC=gnulibc1 - # endif - #else - #ifdef __INTEL_COMPILER - LIBC=gnu - #else - LIBC=gnuaout - #endif - #endif -EOF - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=` - rm -f $dummy.c - test x"${LIBC}" != x && echo "${UNAME_MACHINE}-pc-linux-${LIBC}" && exit 0 - test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0 - ;; - i*86:DYNIX/ptx:4*:*) - # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. - # earlier versions are messed up and put the nodename in both - # sysname and nodename. - echo i386-sequent-sysv4 - exit 0 ;; - i*86:UNIX_SV:4.2MP:2.*) - # Unixware is an offshoot of SVR4, but it has its own version - # number series starting with 2... - # I am not positive that other SVR4 systems won't match this, - # I just have to hope. -- rms. - # Use sysv4.2uw... so that sysv4* matches it. - echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} - exit 0 ;; - i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) - UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` - if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then - echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} - else - echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} - fi - exit 0 ;; - i*86:*:5:[78]*) - case `/bin/uname -X | grep "^Machine"` in - *486*) UNAME_MACHINE=i486 ;; - *Pentium) UNAME_MACHINE=i586 ;; - *Pent*|*Celeron) UNAME_MACHINE=i686 ;; - esac - echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} - exit 0 ;; - i*86:*:3.2:*) - if test -f /usr/options/cb.name; then - UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then - UNAME_REL=`(/bin/uname -X|egrep Release|sed -e 's/.*= //')` - (/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486 - (/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) \ - && UNAME_MACHINE=i586 - (/bin/uname -X|egrep '^Machine.*Pent ?II' >/dev/null) \ - && UNAME_MACHINE=i686 - (/bin/uname -X|egrep '^Machine.*Pentium Pro' >/dev/null) \ - && UNAME_MACHINE=i686 - echo ${UNAME_MACHINE}-pc-sco$UNAME_REL - else - echo ${UNAME_MACHINE}-pc-sysv32 - fi - exit 0 ;; - i*86:*DOS:*:*) - echo ${UNAME_MACHINE}-pc-msdosdjgpp - exit 0 ;; - pc:*:*:*) - # Left here for compatibility: - # uname -m prints for DJGPP always 'pc', but it prints nothing about - # the processor, so we play safe by assuming i386. - echo i386-pc-msdosdjgpp - exit 0 ;; - Intel:Mach:3*:*) - echo i386-pc-mach3 - exit 0 ;; - paragon:*:*:*) - echo i860-intel-osf1 - exit 0 ;; - i860:*:4.*:*) # i860-SVR4 - if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then - echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 - else # Add other i860-SVR4 vendors below as they are discovered. - echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 - fi - exit 0 ;; - mini*:CTIX:SYS*5:*) - # "miniframe" - echo m68010-convergent-sysv - exit 0 ;; - M68*:*:R3V[567]*:*) - test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;; - 3[34]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0) - OS_REL='' - test -r /etc/.relid \ - && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` - /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ - && echo i486-ncr-sysv4.3${OS_REL} && exit 0 - /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ - && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;; - 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) - /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ - && echo i486-ncr-sysv4 && exit 0 ;; - m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) - echo m68k-unknown-lynxos${UNAME_RELEASE} - exit 0 ;; - mc68030:UNIX_System_V:4.*:*) - echo m68k-atari-sysv4 - exit 0 ;; - i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) - echo i386-unknown-lynxos${UNAME_RELEASE} - exit 0 ;; - TSUNAMI:LynxOS:2.*:*) - echo sparc-unknown-lynxos${UNAME_RELEASE} - exit 0 ;; - rs6000:LynxOS:2.*:*) - echo rs6000-unknown-lynxos${UNAME_RELEASE} - exit 0 ;; - PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) - echo powerpc-unknown-lynxos${UNAME_RELEASE} - exit 0 ;; - SM[BE]S:UNIX_SV:*:*) - echo mips-dde-sysv${UNAME_RELEASE} - exit 0 ;; - RM*:ReliantUNIX-*:*:*) - echo mips-sni-sysv4 - exit 0 ;; - RM*:SINIX-*:*:*) - echo mips-sni-sysv4 - exit 0 ;; - *:SINIX-*:*:*) - if uname -p 2>/dev/null >/dev/null ; then - UNAME_MACHINE=`(uname -p) 2>/dev/null` - echo ${UNAME_MACHINE}-sni-sysv4 - else - echo ns32k-sni-sysv - fi - exit 0 ;; - PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort - # says - echo i586-unisys-sysv4 - exit 0 ;; - *:UNIX_System_V:4*:FTX*) - # From Gerald Hewes . - # How about differentiating between stratus architectures? -djm - echo hppa1.1-stratus-sysv4 - exit 0 ;; - *:*:*:FTX*) - # From seanf@swdc.stratus.com. - echo i860-stratus-sysv4 - exit 0 ;; - *:VOS:*:*) - # From Paul.Green@stratus.com. - echo hppa1.1-stratus-vos - exit 0 ;; - mc68*:A/UX:*:*) - echo m68k-apple-aux${UNAME_RELEASE} - exit 0 ;; - news*:NEWS-OS:6*:*) - echo mips-sony-newsos6 - exit 0 ;; - R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) - if [ -d /usr/nec ]; then - echo mips-nec-sysv${UNAME_RELEASE} - else - echo mips-unknown-sysv${UNAME_RELEASE} - fi - exit 0 ;; - BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. - echo powerpc-be-beos - exit 0 ;; - BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. - echo powerpc-apple-beos - exit 0 ;; - BePC:BeOS:*:*) # BeOS running on Intel PC compatible. - echo i586-pc-beos - exit 0 ;; - SX-4:SUPER-UX:*:*) - echo sx4-nec-superux${UNAME_RELEASE} - exit 0 ;; - SX-5:SUPER-UX:*:*) - echo sx5-nec-superux${UNAME_RELEASE} - exit 0 ;; - Power*:Rhapsody:*:*) - echo powerpc-apple-rhapsody${UNAME_RELEASE} - exit 0 ;; - *:Rhapsody:*:*) - echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} - exit 0 ;; - *:Darwin:*:*) - echo `uname -p`-apple-darwin${UNAME_RELEASE} - exit 0 ;; - *:procnto*:*:* | *:QNX:[0123456789]*:*) - UNAME_PROCESSOR=`uname -p` - if test "$UNAME_PROCESSOR" = "x86"; then - UNAME_PROCESSOR=i386 - UNAME_MACHINE=pc - fi - echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} - exit 0 ;; - *:QNX:*:4*) - echo i386-pc-qnx - exit 0 ;; - NSR-[GKLNPTVW]:NONSTOP_KERNEL:*:*) - echo nsr-tandem-nsk${UNAME_RELEASE} - exit 0 ;; - *:NonStop-UX:*:*) - echo mips-compaq-nonstopux - exit 0 ;; - BS2000:POSIX*:*:*) - echo bs2000-siemens-sysv - exit 0 ;; - DS/*:UNIX_System_V:*:*) - echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} - exit 0 ;; - *:Plan9:*:*) - # "uname -m" is not consistent, so use $cputype instead. 386 - # is converted to i386 for consistency with other x86 - # operating systems. - if test "$cputype" = "386"; then - UNAME_MACHINE=i386 - else - UNAME_MACHINE="$cputype" - fi - echo ${UNAME_MACHINE}-unknown-plan9 - exit 0 ;; - i*86:OS/2:*:*) - # If we were able to find `uname', then EMX Unix compatibility - # is probably installed. - echo ${UNAME_MACHINE}-pc-os2-emx - exit 0 ;; - *:TOPS-10:*:*) - echo pdp10-unknown-tops10 - exit 0 ;; - *:TENEX:*:*) - echo pdp10-unknown-tenex - exit 0 ;; - KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) - echo pdp10-dec-tops20 - exit 0 ;; - XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) - echo pdp10-xkl-tops20 - exit 0 ;; - *:TOPS-20:*:*) - echo pdp10-unknown-tops20 - exit 0 ;; - *:ITS:*:*) - echo pdp10-unknown-its - exit 0 ;; - i*86:XTS-300:*:STOP) - echo ${UNAME_MACHINE}-unknown-stop - exit 0 ;; - i*86:atheos:*:*) - echo ${UNAME_MACHINE}-unknown-atheos - exit 0 ;; -esac - -#echo '(No uname command or uname output not recognized.)' 1>&2 -#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 - -eval $set_cc_for_build -cat >$dummy.c < -# include -#endif -main () -{ -#if defined (sony) -#if defined (MIPSEB) - /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, - I don't know.... */ - printf ("mips-sony-bsd\n"); exit (0); -#else -#include - printf ("m68k-sony-newsos%s\n", -#ifdef NEWSOS4 - "4" -#else - "" -#endif - ); exit (0); -#endif -#endif - -#if defined (__arm) && defined (__acorn) && defined (__unix) - printf ("arm-acorn-riscix"); exit (0); -#endif - -#if defined (hp300) && !defined (hpux) - printf ("m68k-hp-bsd\n"); exit (0); -#endif - -#if defined (NeXT) -#if !defined (__ARCHITECTURE__) -#define __ARCHITECTURE__ "m68k" -#endif - int version; - version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; - if (version < 4) - printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); - else - printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); - exit (0); -#endif - -#if defined (MULTIMAX) || defined (n16) -#if defined (UMAXV) - printf ("ns32k-encore-sysv\n"); exit (0); -#else -#if defined (CMU) - printf ("ns32k-encore-mach\n"); exit (0); -#else - printf ("ns32k-encore-bsd\n"); exit (0); -#endif -#endif -#endif - -#if defined (__386BSD__) - printf ("i386-pc-bsd\n"); exit (0); -#endif - -#if defined (sequent) -#if defined (i386) - printf ("i386-sequent-dynix\n"); exit (0); -#endif -#if defined (ns32000) - printf ("ns32k-sequent-dynix\n"); exit (0); -#endif -#endif - -#if defined (_SEQUENT_) - struct utsname un; - - uname(&un); - - if (strncmp(un.version, "V2", 2) == 0) { - printf ("i386-sequent-ptx2\n"); exit (0); - } - if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ - printf ("i386-sequent-ptx1\n"); exit (0); - } - printf ("i386-sequent-ptx\n"); exit (0); - -#endif - -#if defined (vax) -# if !defined (ultrix) -# include -# if defined (BSD) -# if BSD == 43 - printf ("vax-dec-bsd4.3\n"); exit (0); -# else -# if BSD == 199006 - printf ("vax-dec-bsd4.3reno\n"); exit (0); -# else - printf ("vax-dec-bsd\n"); exit (0); -# endif -# endif -# else - printf ("vax-dec-bsd\n"); exit (0); -# endif -# else - printf ("vax-dec-ultrix\n"); exit (0); -# endif -#endif - -#if defined (alliant) && defined (i860) - printf ("i860-alliant-bsd\n"); exit (0); -#endif - - exit (1); -} -EOF - -$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy && rm -f $dummy.c $dummy && exit 0 -rm -f $dummy.c $dummy - -# Apollos put the system type in the environment. - -test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; } - -# Convex versions that predate uname can use getsysinfo(1) - -if [ -x /usr/convex/getsysinfo ] -then - case `getsysinfo -f cpu_type` in - c1*) - echo c1-convex-bsd - exit 0 ;; - c2*) - if getsysinfo -f scalar_acc - then echo c32-convex-bsd - else echo c2-convex-bsd - fi - exit 0 ;; - c34*) - echo c34-convex-bsd - exit 0 ;; - c38*) - echo c38-convex-bsd - exit 0 ;; - c4*) - echo c4-convex-bsd - exit 0 ;; - esac -fi - -cat >&2 < in order to provide the needed -information to handle your system. - -config.guess timestamp = $timestamp - -uname -m = `(uname -m) 2>/dev/null || echo unknown` -uname -r = `(uname -r) 2>/dev/null || echo unknown` -uname -s = `(uname -s) 2>/dev/null || echo unknown` -uname -v = `(uname -v) 2>/dev/null || echo unknown` - -/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` -/bin/uname -X = `(/bin/uname -X) 2>/dev/null` - -hostinfo = `(hostinfo) 2>/dev/null` -/bin/universe = `(/bin/universe) 2>/dev/null` -/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` -/bin/arch = `(/bin/arch) 2>/dev/null` -/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` -/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` - -UNAME_MACHINE = ${UNAME_MACHINE} -UNAME_RELEASE = ${UNAME_RELEASE} -UNAME_SYSTEM = ${UNAME_SYSTEM} -UNAME_VERSION = ${UNAME_VERSION} -EOF - -exit 1 - -# Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) -# time-stamp-start: "timestamp='" -# time-stamp-format: "%:y-%02m-%02d" -# time-stamp-end: "'" -# End: diff --git a/wxWidgets/src/expat/conftools/config.sub b/wxWidgets/src/expat/conftools/config.sub deleted file mode 100644 index 043d45b398..0000000000 --- a/wxWidgets/src/expat/conftools/config.sub +++ /dev/null @@ -1,1507 +0,0 @@ -#! /bin/sh -# Configuration validation subroutine script. -# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002 Free Software Foundation, Inc. - -timestamp='2002-03-07' - -# This file is (in principle) common to ALL GNU software. -# The presence of a machine in this file suggests that SOME GNU software -# can handle that machine. It does not imply ALL GNU software can. -# -# This file is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, -# Boston, MA 02111-1307, USA. - -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - -##################################################################### -# This file contains changes for Apache, clearly marked below. -# These changes are hereby donated to the public domain. -##################################################################### - -# Please send patches to . Submit a context -# diff and a properly formatted ChangeLog entry. -# -# Configuration subroutine to validate and canonicalize a configuration type. -# Supply the specified configuration type as an argument. -# If it is invalid, we print an error message on stderr and exit with code 1. -# Otherwise, we print the canonical config type on stdout and succeed. - -# This file is supposed to be the same for all GNU packages -# and recognize all the CPU types, system types and aliases -# that are meaningful with *any* GNU software. -# Each package is responsible for reporting which valid configurations -# it does not support. The user should be able to distinguish -# a failure to support a valid configuration from a meaningless -# configuration. - -# The goal of this file is to map all the various variations of a given -# machine specification into a single specification in the form: -# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM -# or in some cases, the newer four-part form: -# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM -# It is wrong to echo any other type of specification. - -me=`echo "$0" | sed -e 's,.*/,,'` - -usage="\ -Usage: $0 [OPTION] CPU-MFR-OPSYS - $0 [OPTION] ALIAS - -Canonicalize a configuration name. - -Operation modes: - -h, --help print this help, then exit - -t, --time-stamp print date of last modification, then exit - -v, --version print version number, then exit - -Report bugs and patches to ." - -version="\ -GNU config.sub ($timestamp) - -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 -Free Software Foundation, Inc. - -This is free software; see the source for copying conditions. There is NO -warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." - -help=" -Try \`$me --help' for more information." - -# Parse command line -while test $# -gt 0 ; do - case $1 in - --time-stamp | --time* | -t ) - echo "$timestamp" ; exit 0 ;; - --version | -v ) - echo "$version" ; exit 0 ;; - --help | --h* | -h ) - echo "$usage"; exit 0 ;; - -- ) # Stop option processing - shift; break ;; - - ) # Use stdin as input. - break ;; - -* ) - echo "$me: invalid option $1$help" - exit 1 ;; - - *local*) - # First pass through any local machine types. - echo $1 - exit 0;; - - * ) - break ;; - esac -done - -case $# in - 0) echo "$me: missing argument$help" >&2 - exit 1;; - 1) ;; - *) echo "$me: too many arguments$help" >&2 - exit 1;; -esac - -# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). -# Here we must recognize all the valid KERNEL-OS combinations. -maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` -case $maybe_os in - nto-qnx* | linux-gnu* | storm-chaos* | os2-emx* | windows32-* | rtmk-nova*) - os=-$maybe_os - basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` - ;; -######################## -# changes for Apache -# - tpf | os390 | vmcms) - os=-$maybe_os - basic_machine=s390; - ;; - os400) - os=-$maybe_os - basic_machine=as400; - ;; - mvs) - os=-mvs - basic_machine=i370; - ;; -# -# end Apache changes -######################## - *) - basic_machine=`echo $1 | sed 's/-[^-]*$//'` - if [ $basic_machine != $1 ] - then os=`echo $1 | sed 's/.*-/-/'` - else os=; fi - ;; -esac - -### Let's recognize common machines as not being operating systems so -### that things like config.sub decstation-3100 work. We also -### recognize some manufacturers as not being operating systems, so we -### can provide default operating systems below. -case $os in - -sun*os*) - # Prevent following clause from handling this invalid input. - ;; - -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ - -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ - -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ - -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ - -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ - -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ - -apple | -axis) - os= - basic_machine=$1 - ;; - -sim | -cisco | -oki | -wec | -winbond) - os= - basic_machine=$1 - ;; - -scout) - ;; - -wrs) - os=-vxworks - basic_machine=$1 - ;; - -chorusos*) - os=-chorusos - basic_machine=$1 - ;; - -chorusrdb) - os=-chorusrdb - basic_machine=$1 - ;; - -hiux*) - os=-hiuxwe2 - ;; - -sco5) - os=-sco3.2v5 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco4) - os=-sco3.2v4 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco3.2.[4-9]*) - os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco3.2v[4-9]*) - # Don't forget version if it is 3.2v4 or newer. - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco*) - os=-sco3.2v2 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -udk*) - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -isc) - os=-isc2.2 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -clix*) - basic_machine=clipper-intergraph - ;; - -isc*) - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -lynx*) - os=-lynxos - ;; - -ptx*) - basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` - ;; - -windowsnt*) - os=`echo $os | sed -e 's/windowsnt/winnt/'` - ;; - -psos*) - os=-psos - ;; - -mint | -mint[0-9]*) - basic_machine=m68k-atari - os=-mint - ;; -esac - -# Decode aliases for certain CPU-COMPANY combinations. -case $basic_machine in - # Recognize the basic CPU types without company name. - # Some are omitted here because they have special meanings below. - 1750a | 580 \ - | a29k \ - | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ - | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ - | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \ - | c4x | clipper \ - | d10v | d30v | dsp16xx \ - | fr30 \ - | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ - | i370 | i860 | i960 | ia64 \ - | m32r | m68000 | m68k | m88k | mcore \ - | mips | mips16 | mips64 | mips64el | mips64orion | mips64orionel \ - | mips64vr4100 | mips64vr4100el | mips64vr4300 \ - | mips64vr4300el | mips64vr5000 | mips64vr5000el \ - | mipsbe | mipseb | mipsel | mipsle | mipstx39 | mipstx39el \ - | mipsisa32 | mipsisa64 \ - | mn10200 | mn10300 \ - | ns16k | ns32k \ - | openrisc | or32 \ - | pdp10 | pdp11 | pj | pjl \ - | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ - | pyramid \ - | sh | sh[34] | sh[34]eb | shbe | shle | sh64 \ - | sparc | sparc64 | sparc86x | sparclet | sparclite | sparcv9 | sparcv9b \ - | strongarm \ - | tahoe | thumb | tic80 | tron \ - | v850 | v850e \ - | we32k \ - | x86 | xscale | xstormy16 | xtensa \ - | z8k) - basic_machine=$basic_machine-unknown - ;; - m6811 | m68hc11 | m6812 | m68hc12) - # Motorola 68HC11/12. - basic_machine=$basic_machine-unknown - os=-none - ;; - m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) - ;; - - # We use `pc' rather than `unknown' - # because (1) that's what they normally are, and - # (2) the word "unknown" tends to confuse beginning users. - i*86 | x86_64) - basic_machine=$basic_machine-pc - ;; - # Object if more than one company name word. - *-*-*) - echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 - exit 1 - ;; - # Recognize the basic CPU types with company name. - 580-* \ - | a29k-* \ - | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ - | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ - | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ - | arm-* | armbe-* | armle-* | armv*-* \ - | avr-* \ - | bs2000-* \ - | c[123]* | c30-* | [cjt]90-* | c54x-* \ - | clipper-* | cydra-* \ - | d10v-* | d30v-* \ - | elxsi-* \ - | f30[01]-* | f700-* | fr30-* | fx80-* \ - | h8300-* | h8500-* \ - | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ - | i*86-* | i860-* | i960-* | ia64-* \ - | m32r-* \ - | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ - | m88110-* | m88k-* | mcore-* \ - | mips-* | mips16-* | mips64-* | mips64el-* | mips64orion-* \ - | mips64orionel-* | mips64vr4100-* | mips64vr4100el-* \ - | mips64vr4300-* | mips64vr4300el-* | mipsbe-* | mipseb-* \ - | mipsle-* | mipsel-* | mipstx39-* | mipstx39el-* \ - | none-* | np1-* | ns16k-* | ns32k-* \ - | orion-* \ - | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ - | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ - | pyramid-* \ - | romp-* | rs6000-* \ - | sh-* | sh[34]-* | sh[34]eb-* | shbe-* | shle-* | sh64-* \ - | sparc-* | sparc64-* | sparc86x-* | sparclet-* | sparclite-* \ - | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \ - | tahoe-* | thumb-* | tic30-* | tic54x-* | tic80-* | tron-* \ - | v850-* | v850e-* | vax-* \ - | we32k-* \ - | x86-* | x86_64-* | xps100-* | xscale-* | xstormy16-* \ - | xtensa-* \ - | ymp-* \ - | z8k-*) - ;; - # Recognize the various machine names and aliases which stand - # for a CPU type and a company and sometimes even an OS. - 386bsd) - basic_machine=i386-unknown - os=-bsd - ;; - 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) - basic_machine=m68000-att - ;; - 3b*) - basic_machine=we32k-att - ;; - a29khif) - basic_machine=a29k-amd - os=-udi - ;; - adobe68k) - basic_machine=m68010-adobe - os=-scout - ;; - alliant | fx80) - basic_machine=fx80-alliant - ;; - altos | altos3068) - basic_machine=m68k-altos - ;; - am29k) - basic_machine=a29k-none - os=-bsd - ;; - amdahl) - basic_machine=580-amdahl - os=-sysv - ;; - amiga | amiga-*) - basic_machine=m68k-unknown - ;; - amigaos | amigados) - basic_machine=m68k-unknown - os=-amigaos - ;; - amigaunix | amix) - basic_machine=m68k-unknown - os=-sysv4 - ;; - apollo68) - basic_machine=m68k-apollo - os=-sysv - ;; - apollo68bsd) - basic_machine=m68k-apollo - os=-bsd - ;; - aux) - basic_machine=m68k-apple - os=-aux - ;; - balance) - basic_machine=ns32k-sequent - os=-dynix - ;; - c90) - basic_machine=c90-cray - os=-unicos - ;; - convex-c1) - basic_machine=c1-convex - os=-bsd - ;; - convex-c2) - basic_machine=c2-convex - os=-bsd - ;; - convex-c32) - basic_machine=c32-convex - os=-bsd - ;; - convex-c34) - basic_machine=c34-convex - os=-bsd - ;; - convex-c38) - basic_machine=c38-convex - os=-bsd - ;; - cray | j90) - basic_machine=j90-cray - os=-unicos - ;; - crds | unos) - basic_machine=m68k-crds - ;; - cris | cris-* | etrax*) - basic_machine=cris-axis - ;; - da30 | da30-*) - basic_machine=m68k-da30 - ;; - decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) - basic_machine=mips-dec - ;; - decsystem10* | dec10*) - basic_machine=pdp10-dec - os=-tops10 - ;; - decsystem20* | dec20*) - basic_machine=pdp10-dec - os=-tops20 - ;; - delta | 3300 | motorola-3300 | motorola-delta \ - | 3300-motorola | delta-motorola) - basic_machine=m68k-motorola - ;; - delta88) - basic_machine=m88k-motorola - os=-sysv3 - ;; - dpx20 | dpx20-*) - basic_machine=rs6000-bull - os=-bosx - ;; - dpx2* | dpx2*-bull) - basic_machine=m68k-bull - os=-sysv3 - ;; - ebmon29k) - basic_machine=a29k-amd - os=-ebmon - ;; - elxsi) - basic_machine=elxsi-elxsi - os=-bsd - ;; - encore | umax | mmax) - basic_machine=ns32k-encore - ;; - es1800 | OSE68k | ose68k | ose | OSE) - basic_machine=m68k-ericsson - os=-ose - ;; - fx2800) - basic_machine=i860-alliant - ;; - genix) - basic_machine=ns32k-ns - ;; - gmicro) - basic_machine=tron-gmicro - os=-sysv - ;; - go32) - basic_machine=i386-pc - os=-go32 - ;; - h3050r* | hiux*) - basic_machine=hppa1.1-hitachi - os=-hiuxwe2 - ;; - h8300hms) - basic_machine=h8300-hitachi - os=-hms - ;; - h8300xray) - basic_machine=h8300-hitachi - os=-xray - ;; - h8500hms) - basic_machine=h8500-hitachi - os=-hms - ;; - harris) - basic_machine=m88k-harris - os=-sysv3 - ;; - hp300-*) - basic_machine=m68k-hp - ;; - hp300bsd) - basic_machine=m68k-hp - os=-bsd - ;; - hp300hpux) - basic_machine=m68k-hp - os=-hpux - ;; - hp3k9[0-9][0-9] | hp9[0-9][0-9]) - basic_machine=hppa1.0-hp - ;; - hp9k2[0-9][0-9] | hp9k31[0-9]) - basic_machine=m68000-hp - ;; - hp9k3[2-9][0-9]) - basic_machine=m68k-hp - ;; - hp9k6[0-9][0-9] | hp6[0-9][0-9]) - basic_machine=hppa1.0-hp - ;; - hp9k7[0-79][0-9] | hp7[0-79][0-9]) - basic_machine=hppa1.1-hp - ;; - hp9k78[0-9] | hp78[0-9]) - # FIXME: really hppa2.0-hp - basic_machine=hppa1.1-hp - ;; - hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) - # FIXME: really hppa2.0-hp - basic_machine=hppa1.1-hp - ;; - hp9k8[0-9][13679] | hp8[0-9][13679]) - basic_machine=hppa1.1-hp - ;; - hp9k8[0-9][0-9] | hp8[0-9][0-9]) - basic_machine=hppa1.0-hp - ;; - hppa-next) - os=-nextstep3 - ;; - hppaosf) - basic_machine=hppa1.1-hp - os=-osf - ;; - hppro) - basic_machine=hppa1.1-hp - os=-proelf - ;; - i370-ibm* | ibm*) - basic_machine=i370-ibm - ;; -# I'm not sure what "Sysv32" means. Should this be sysv3.2? - i*86v32) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-sysv32 - ;; - i*86v4*) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-sysv4 - ;; - i*86v) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-sysv - ;; - i*86sol2) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-solaris2 - ;; - i386mach) - basic_machine=i386-mach - os=-mach - ;; - i386-vsta | vsta) - basic_machine=i386-unknown - os=-vsta - ;; - iris | iris4d) - basic_machine=mips-sgi - case $os in - -irix*) - ;; - *) - os=-irix4 - ;; - esac - ;; - isi68 | isi) - basic_machine=m68k-isi - os=-sysv - ;; - m88k-omron*) - basic_machine=m88k-omron - ;; - magnum | m3230) - basic_machine=mips-mips - os=-sysv - ;; - merlin) - basic_machine=ns32k-utek - os=-sysv - ;; - mingw32) - basic_machine=i386-pc - os=-mingw32 - ;; - miniframe) - basic_machine=m68000-convergent - ;; - *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) - basic_machine=m68k-atari - os=-mint - ;; - mips3*-*) - basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` - ;; - mips3*) - basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown - ;; - mmix*) - basic_machine=mmix-knuth - os=-mmixware - ;; - monitor) - basic_machine=m68k-rom68k - os=-coff - ;; - morphos) - basic_machine=powerpc-unknown - os=-morphos - ;; - msdos) - basic_machine=i386-pc - os=-msdos - ;; - mvs) - basic_machine=i370-ibm - os=-mvs - ;; - ncr3000) - basic_machine=i486-ncr - os=-sysv4 - ;; - netbsd386) - basic_machine=i386-unknown - os=-netbsd - ;; - netwinder) - basic_machine=armv4l-rebel - os=-linux - ;; - news | news700 | news800 | news900) - basic_machine=m68k-sony - os=-newsos - ;; - news1000) - basic_machine=m68030-sony - os=-newsos - ;; - news-3600 | risc-news) - basic_machine=mips-sony - os=-newsos - ;; - necv70) - basic_machine=v70-nec - os=-sysv - ;; - next | m*-next ) - basic_machine=m68k-next - case $os in - -nextstep* ) - ;; - -ns2*) - os=-nextstep2 - ;; - *) - os=-nextstep3 - ;; - esac - ;; - nh3000) - basic_machine=m68k-harris - os=-cxux - ;; - nh[45]000) - basic_machine=m88k-harris - os=-cxux - ;; - nindy960) - basic_machine=i960-intel - os=-nindy - ;; - mon960) - basic_machine=i960-intel - os=-mon960 - ;; - nonstopux) - basic_machine=mips-compaq - os=-nonstopux - ;; - np1) - basic_machine=np1-gould - ;; - nsr-tandem) - basic_machine=nsr-tandem - ;; - op50n-* | op60c-*) - basic_machine=hppa1.1-oki - os=-proelf - ;; - or32 | or32-*) - basic_machine=or32-unknown - os=-coff - ;; - OSE68000 | ose68000) - basic_machine=m68000-ericsson - os=-ose - ;; - os68k) - basic_machine=m68k-none - os=-os68k - ;; - pa-hitachi) - basic_machine=hppa1.1-hitachi - os=-hiuxwe2 - ;; - paragon) - basic_machine=i860-intel - os=-osf - ;; - pbd) - basic_machine=sparc-tti - ;; - pbb) - basic_machine=m68k-tti - ;; - pc532 | pc532-*) - basic_machine=ns32k-pc532 - ;; - pentium | p5 | k5 | k6 | nexgen | viac3) - basic_machine=i586-pc - ;; - pentiumpro | p6 | 6x86 | athlon) - basic_machine=i686-pc - ;; - pentiumii | pentium2) - basic_machine=i686-pc - ;; - pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) - basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - pentiumpro-* | p6-* | 6x86-* | athlon-*) - basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - pentiumii-* | pentium2-*) - basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - pn) - basic_machine=pn-gould - ;; - power) basic_machine=power-ibm - ;; - ppc) basic_machine=powerpc-unknown - ;; - ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - ppcle | powerpclittle | ppc-le | powerpc-little) - basic_machine=powerpcle-unknown - ;; - ppcle-* | powerpclittle-*) - basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - ppc64) basic_machine=powerpc64-unknown - ;; - ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - ppc64le | powerpc64little | ppc64-le | powerpc64-little) - basic_machine=powerpc64le-unknown - ;; - ppc64le-* | powerpc64little-*) - basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - ps2) - basic_machine=i386-ibm - ;; - pw32) - basic_machine=i586-unknown - os=-pw32 - ;; - rom68k) - basic_machine=m68k-rom68k - os=-coff - ;; - rm[46]00) - basic_machine=mips-siemens - ;; - rtpc | rtpc-*) - basic_machine=romp-ibm - ;; - s390 | s390-*) - basic_machine=s390-ibm - ;; - s390x | s390x-*) - basic_machine=s390x-ibm - ;; - sa29200) - basic_machine=a29k-amd - os=-udi - ;; -######################## -# changes for Apache -# - as400*) - basic_machine=as400-ibm - ;; -# -# end Apache changes -######################## - sequent) - basic_machine=i386-sequent - ;; - sh) - basic_machine=sh-hitachi - os=-hms - ;; - sparclite-wrs | simso-wrs) - basic_machine=sparclite-wrs - os=-vxworks - ;; - sps7) - basic_machine=m68k-bull - os=-sysv2 - ;; - spur) - basic_machine=spur-unknown - ;; - st2000) - basic_machine=m68k-tandem - ;; - stratus) - basic_machine=i860-stratus - os=-sysv4 - ;; - sun2) - basic_machine=m68000-sun - ;; - sun2os3) - basic_machine=m68000-sun - os=-sunos3 - ;; - sun2os4) - basic_machine=m68000-sun - os=-sunos4 - ;; - sun3os3) - basic_machine=m68k-sun - os=-sunos3 - ;; - sun3os4) - basic_machine=m68k-sun - os=-sunos4 - ;; - sun4os3) - basic_machine=sparc-sun - os=-sunos3 - ;; - sun4os4) - basic_machine=sparc-sun - os=-sunos4 - ;; - sun4sol2) - basic_machine=sparc-sun - os=-solaris2 - ;; - sun3 | sun3-*) - basic_machine=m68k-sun - ;; - sun4) - basic_machine=sparc-sun - ;; - sun386 | sun386i | roadrunner) - basic_machine=i386-sun - ;; - sv1) - basic_machine=sv1-cray - os=-unicos - ;; - symmetry) - basic_machine=i386-sequent - os=-dynix - ;; - t3d) - basic_machine=alpha-cray - os=-unicos - ;; - t3e) - basic_machine=alphaev5-cray - os=-unicos - ;; - t90) - basic_machine=t90-cray - os=-unicos - ;; - tic54x | c54x*) - basic_machine=tic54x-unknown - os=-coff - ;; - tx39) - basic_machine=mipstx39-unknown - ;; - tx39el) - basic_machine=mipstx39el-unknown - ;; - toad1) - basic_machine=pdp10-xkl - os=-tops20 - ;; - tower | tower-32) - basic_machine=m68k-ncr - ;; - udi29k) - basic_machine=a29k-amd - os=-udi - ;; - ultra3) - basic_machine=a29k-nyu - os=-sym1 - ;; - v810 | necv810) - basic_machine=v810-nec - os=-none - ;; - vaxv) - basic_machine=vax-dec - os=-sysv - ;; - vms) - basic_machine=vax-dec - os=-vms - ;; - vpp*|vx|vx-*) - basic_machine=f301-fujitsu - ;; - vxworks960) - basic_machine=i960-wrs - os=-vxworks - ;; - vxworks68) - basic_machine=m68k-wrs - os=-vxworks - ;; - vxworks29k) - basic_machine=a29k-wrs - os=-vxworks - ;; - w65*) - basic_machine=w65-wdc - os=-none - ;; - w89k-*) - basic_machine=hppa1.1-winbond - os=-proelf - ;; - windows32) - basic_machine=i386-pc - os=-windows32-msvcrt - ;; - xps | xps100) - basic_machine=xps100-honeywell - ;; - ymp) - basic_machine=ymp-cray - os=-unicos - ;; - z8k-*-coff) - basic_machine=z8k-unknown - os=-sim - ;; - none) - basic_machine=none-none - os=-none - ;; - -# Here we handle the default manufacturer of certain CPU types. It is in -# some cases the only manufacturer, in others, it is the most popular. - w89k) - basic_machine=hppa1.1-winbond - ;; - op50n) - basic_machine=hppa1.1-oki - ;; - op60c) - basic_machine=hppa1.1-oki - ;; - romp) - basic_machine=romp-ibm - ;; - rs6000) - basic_machine=rs6000-ibm - ;; - vax) - basic_machine=vax-dec - ;; - pdp10) - # there are many clones, so DEC is not a safe bet - basic_machine=pdp10-unknown - ;; - pdp11) - basic_machine=pdp11-dec - ;; - we32k) - basic_machine=we32k-att - ;; - sh3 | sh4 | sh3eb | sh4eb) - basic_machine=sh-unknown - ;; - sh64) - basic_machine=sh64-unknown - ;; - sparc | sparcv9 | sparcv9b) - basic_machine=sparc-sun - ;; - cydra) - basic_machine=cydra-cydrome - ;; - orion) - basic_machine=orion-highlevel - ;; - orion105) - basic_machine=clipper-highlevel - ;; - mac | mpw | mac-mpw) - basic_machine=m68k-apple - ;; - pmac | pmac-mpw) - basic_machine=powerpc-apple - ;; - c4x*) - basic_machine=c4x-none - os=-coff - ;; - *-unknown) - # Make sure to match an already-canonicalized machine name. - ;; - *) - echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 - exit 1 - ;; -esac - -# Here we canonicalize certain aliases for manufacturers. -case $basic_machine in - *-digital*) - basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` - ;; - *-commodore*) - basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` - ;; - *) - ;; -esac - -# Decode manufacturer-specific aliases for certain operating systems. - -if [ x"$os" != x"" ] -then -case $os in - # First match some system type aliases - # that might get confused with valid system types. - # -solaris* is a basic system type, with this one exception. - -solaris1 | -solaris1.*) - os=`echo $os | sed -e 's|solaris1|sunos4|'` - ;; - -solaris) - os=-solaris2 - ;; - -svr4*) - os=-sysv4 - ;; - -unixware*) - os=-sysv4.2uw - ;; - -gnu/linux*) - os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` - ;; -######################## -# changes for Apache -# - -os2_emx | -tpf* | -os390* | -vmcms* | -os400* ) - ;; -# -# end Apache changes -######################## - # First accept the basic system types. - # The portable systems comes first. - # Each alternative MUST END IN A *, to match a version number. - # -sysv* is not here because it comes later, after sysvr4. - -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ - | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\ - | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ - | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ - | -aos* \ - | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ - | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ - | -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \ - | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ - | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ - | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ - | -chorusos* | -chorusrdb* \ - | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ - | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \ - | -interix* | -uwin* | -rhapsody* | -darwin* | -opened* \ - | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ - | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ - | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ - | -morphos* | -superux* | -rtmk* | -rtmk-nova*) - # Remember, each alternative MUST END IN *, to match a version number. - ;; - -qnx*) - case $basic_machine in - x86-* | i*86-*) - ;; - *) - os=-nto$os - ;; - esac - ;; - -nto*) - os=-nto-qnx - ;; - -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ - | -windows* | -osx | -abug | -netware* | -os9* | -beos* \ - | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) - ;; - -mac*) - os=`echo $os | sed -e 's|mac|macos|'` - ;; - -linux*) - os=`echo $os | sed -e 's|linux|linux-gnu|'` - ;; - -sunos5*) - os=`echo $os | sed -e 's|sunos5|solaris2|'` - ;; - -sunos6*) - os=`echo $os | sed -e 's|sunos6|solaris3|'` - ;; - -opened*) - os=-openedition - ;; - -wince*) - os=-wince - ;; - -osfrose*) - os=-osfrose - ;; - -osf*) - os=-osf - ;; - -utek*) - os=-bsd - ;; - -dynix*) - os=-bsd - ;; - -acis*) - os=-aos - ;; - -atheos*) - os=-atheos - ;; - -386bsd) - os=-bsd - ;; - -ctix* | -uts*) - os=-sysv - ;; - -nova*) - os=-rtmk-nova - ;; - -ns2 ) - os=-nextstep2 - ;; - -nsk*) - os=-nsk - ;; - # Preserve the version number of sinix5. - -sinix5.*) - os=`echo $os | sed -e 's|sinix|sysv|'` - ;; - -sinix*) - os=-sysv4 - ;; - -triton*) - os=-sysv3 - ;; - -oss*) - os=-sysv3 - ;; - -svr4) - os=-sysv4 - ;; - -svr3) - os=-sysv3 - ;; - -sysvr4) - os=-sysv4 - ;; - # This must come after -sysvr4. - -sysv*) - ;; - -ose*) - os=-ose - ;; - -es1800*) - os=-ose - ;; - -xenix) - os=-xenix - ;; - -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) - os=-mint - ;; - -none) - ;; - *) - # Get rid of the `-' at the beginning of $os. - os=`echo $os | sed 's/[^-]*-//'` - echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 - exit 1 - ;; -esac -else - -# Here we handle the default operating systems that come with various machines. -# The value should be what the vendor currently ships out the door with their -# machine or put another way, the most popular os provided with the machine. - -# Note that if you're going to try to match "-MANUFACTURER" here (say, -# "-sun"), then you have to tell the case statement up towards the top -# that MANUFACTURER isn't an operating system. Otherwise, code above -# will signal an error saying that MANUFACTURER isn't an operating -# system, and we'll never get to this point. - -case $basic_machine in - *-acorn) - os=-riscix1.2 - ;; - arm*-rebel) - os=-linux - ;; - arm*-semi) - os=-aout - ;; - # This must come before the *-dec entry. - pdp10-*) - os=-tops20 - ;; - pdp11-*) - os=-none - ;; - *-dec | vax-*) - os=-ultrix4.2 - ;; - m68*-apollo) - os=-domain - ;; - i386-sun) - os=-sunos4.0.2 - ;; - m68000-sun) - os=-sunos3 - # This also exists in the configure program, but was not the - # default. - # os=-sunos4 - ;; - m68*-cisco) - os=-aout - ;; - mips*-cisco) - os=-elf - ;; - mips*-*) - os=-elf - ;; - or32-*) - os=-coff - ;; - *-tti) # must be before sparc entry or we get the wrong os. - os=-sysv3 - ;; - sparc-* | *-sun) - os=-sunos4.1.1 - ;; - *-be) - os=-beos - ;; -######################## -# changes for Apache -# -# *-ibm) -# os=-aix -# ;; -# - *-ibm) - case $basic_machine in - s390*) - os=-os390; - ;; - i370*) - os=-mvs; - ;; - as400*) - os=-os400; - ;; - *) - os=-aix - ;; - esac - ;; -# -# end Apache changes -######################## - - *-wec) - os=-proelf - ;; - *-winbond) - os=-proelf - ;; - *-oki) - os=-proelf - ;; - *-hp) - os=-hpux - ;; - *-hitachi) - os=-hiux - ;; - i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) - os=-sysv - ;; - *-cbm) - os=-amigaos - ;; - *-dg) - os=-dgux - ;; - *-dolphin) - os=-sysv3 - ;; - m68k-ccur) - os=-rtu - ;; - m88k-omron*) - os=-luna - ;; - *-next ) - os=-nextstep - ;; - *-sequent) - os=-ptx - ;; - *-crds) - os=-unos - ;; - *-ns) - os=-genix - ;; - i370-*) - os=-mvs - ;; - *-next) - os=-nextstep3 - ;; - *-gould) - os=-sysv - ;; - *-highlevel) - os=-bsd - ;; - *-encore) - os=-bsd - ;; - *-sgi) - os=-irix - ;; - *-siemens) - os=-sysv4 - ;; - *-masscomp) - os=-rtu - ;; - f30[01]-fujitsu | f700-fujitsu) - os=-uxpv - ;; - *-rom68k) - os=-coff - ;; - *-*bug) - os=-coff - ;; - *-apple) - os=-macos - ;; - *-atari*) - os=-mint - ;; - *) - os=-none - ;; -esac -fi - -# Here we handle the case where we know the os, and the CPU type, but not the -# manufacturer. We pick the logical manufacturer. -vendor=unknown -case $basic_machine in - *-unknown) - case $os in - -riscix*) - vendor=acorn - ;; - -sunos*) - vendor=sun - ;; - -aix*) - vendor=ibm - ;; - -beos*) - vendor=be - ;; - -hpux*) - vendor=hp - ;; - -mpeix*) - vendor=hp - ;; - -hiux*) - vendor=hitachi - ;; - -unos*) - vendor=crds - ;; - -dgux*) - vendor=dg - ;; - -luna*) - vendor=omron - ;; - -genix*) - vendor=ns - ;; - -mvs* | -opened*) - vendor=ibm - ;; - -ptx*) - vendor=sequent - ;; - -vxsim* | -vxworks*) - vendor=wrs - ;; - -aux*) - vendor=apple - ;; - -hms*) - vendor=hitachi - ;; - -mpw* | -macos*) - vendor=apple - ;; - -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) - vendor=atari - ;; - -vos*) - vendor=stratus - ;; - esac - basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` - ;; -esac - -echo $basic_machine$os -exit 0 - -# Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) -# time-stamp-start: "timestamp='" -# time-stamp-format: "%:y-%02m-%02d" -# time-stamp-end: "'" -# End: diff --git a/wxWidgets/src/expat/conftools/expat.m4 b/wxWidgets/src/expat/conftools/expat.m4 deleted file mode 100644 index e5d4871c9e..0000000000 --- a/wxWidgets/src/expat/conftools/expat.m4 +++ /dev/null @@ -1,43 +0,0 @@ -dnl Check if --with-expat[=PREFIX] is specified and -dnl Expat >= 1.95.0 is installed in the system. -dnl If yes, substitute EXPAT_CFLAGS, EXPAT_LIBS with regard to -dnl the specified PREFIX and set with_expat to PREFIX, or 'yes' if PREFIX -dnl has not been specified. Also HAVE_LIBEXPAT, HAVE_EXPAT_H are defined. -dnl If --with-expat has not been specified, set with_expat to 'no'. -dnl In addition, an Automake conditional EXPAT_INSTALLED is set accordingly. -dnl This is necessary to adapt a whole lot of packages that have expat -dnl bundled as a static library. -AC_DEFUN(AM_WITH_EXPAT, -[ AC_ARG_WITH(expat, - [ --with-expat=PREFIX Use system Expat library], - , with_expat=no) - - AM_CONDITIONAL(EXPAT_INSTALLED, test $with_expat != no) - - EXPAT_CFLAGS= - EXPAT_LIBS= - if test $with_expat != no; then - if test $with_expat != yes; then - EXPAT_CFLAGS="-I$with_expat/include" - EXPAT_LIBS="-L$with_expat/lib" - fi - AC_CHECK_LIB(expat, XML_ParserCreate, - [ EXPAT_LIBS="$EXPAT_LIBS -lexpat" - expat_found=yes ], - [ expat_found=no ], - "$EXPAT_LIBS") - if test $expat_found = no; then - AC_MSG_ERROR([Could not find the Expat library]) - fi - expat_save_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS $EXPAT_CFLAGS" - AC_CHECK_HEADERS(expat.h, , expat_found=no) - if test $expat_found = no; then - AC_MSG_ERROR([Could not find expat.h]) - fi - CFLAGS="$expat_save_CFLAGS" - fi - - AC_SUBST(EXPAT_CFLAGS) - AC_SUBST(EXPAT_LIBS) -]) diff --git a/wxWidgets/src/expat/conftools/install-sh b/wxWidgets/src/expat/conftools/install-sh deleted file mode 100644 index e9de23842d..0000000000 --- a/wxWidgets/src/expat/conftools/install-sh +++ /dev/null @@ -1,251 +0,0 @@ -#!/bin/sh -# -# install - install a program, script, or datafile -# This comes from X11R5 (mit/util/scripts/install.sh). -# -# Copyright 1991 by the Massachusetts Institute of Technology -# -# Permission to use, copy, modify, distribute, and sell this software and its -# documentation for any purpose is hereby granted without fee, provided that -# the above copyright notice appear in all copies and that both that -# copyright notice and this permission notice appear in supporting -# documentation, and that the name of M.I.T. not be used in advertising or -# publicity pertaining to distribution of the software without specific, -# written prior permission. M.I.T. makes no representations about the -# suitability of this software for any purpose. It is provided "as is" -# without express or implied warranty. -# -# Calling this script install-sh is preferred over install.sh, to prevent -# `make' implicit rules from creating a file called install from it -# when there is no Makefile. -# -# This script is compatible with the BSD install script, but was written -# from scratch. It can only install one file at a time, a restriction -# shared with many OS's install programs. - - -# set DOITPROG to echo to test this script - -# Don't use :- since 4.3BSD and earlier shells don't like it. -doit="${DOITPROG-}" - - -# put in absolute paths if you don't have them in your path; or use env. vars. - -mvprog="${MVPROG-mv}" -cpprog="${CPPROG-cp}" -chmodprog="${CHMODPROG-chmod}" -chownprog="${CHOWNPROG-chown}" -chgrpprog="${CHGRPPROG-chgrp}" -stripprog="${STRIPPROG-strip}" -rmprog="${RMPROG-rm}" -mkdirprog="${MKDIRPROG-mkdir}" - -transformbasename="" -transform_arg="" -instcmd="$mvprog" -chmodcmd="$chmodprog 0755" -chowncmd="" -chgrpcmd="" -stripcmd="" -rmcmd="$rmprog -f" -mvcmd="$mvprog" -src="" -dst="" -dir_arg="" - -while [ x"$1" != x ]; do - case $1 in - -c) instcmd="$cpprog" - shift - continue;; - - -d) dir_arg=true - shift - continue;; - - -m) chmodcmd="$chmodprog $2" - shift - shift - continue;; - - -o) chowncmd="$chownprog $2" - shift - shift - continue;; - - -g) chgrpcmd="$chgrpprog $2" - shift - shift - continue;; - - -s) stripcmd="$stripprog" - shift - continue;; - - -t=*) transformarg=`echo $1 | sed 's/-t=//'` - shift - continue;; - - -b=*) transformbasename=`echo $1 | sed 's/-b=//'` - shift - continue;; - - *) if [ x"$src" = x ] - then - src=$1 - else - # this colon is to work around a 386BSD /bin/sh bug - : - dst=$1 - fi - shift - continue;; - esac -done - -if [ x"$src" = x ] -then - echo "install: no input file specified" - exit 1 -else - true -fi - -if [ x"$dir_arg" != x ]; then - dst=$src - src="" - - if [ -d $dst ]; then - instcmd=: - chmodcmd="" - else - instcmd=mkdir - fi -else - -# Waiting for this to be detected by the "$instcmd $src $dsttmp" command -# might cause directories to be created, which would be especially bad -# if $src (and thus $dsttmp) contains '*'. - - if [ -f $src -o -d $src ] - then - true - else - echo "install: $src does not exist" - exit 1 - fi - - if [ x"$dst" = x ] - then - echo "install: no destination specified" - exit 1 - else - true - fi - -# If destination is a directory, append the input filename; if your system -# does not like double slashes in filenames, you may need to add some logic - - if [ -d $dst ] - then - dst="$dst"/`basename $src` - else - true - fi -fi - -## this sed command emulates the dirname command -dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` - -# Make sure that the destination directory exists. -# this part is taken from Noah Friedman's mkinstalldirs script - -# Skip lots of stat calls in the usual case. -if [ ! -d "$dstdir" ]; then -defaultIFS=' -' -IFS="${IFS-${defaultIFS}}" - -oIFS="${IFS}" -# Some sh's can't handle IFS=/ for some reason. -IFS='%' -set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'` -IFS="${oIFS}" - -pathcomp='' - -while [ $# -ne 0 ] ; do - pathcomp="${pathcomp}${1}" - shift - - if [ ! -d "${pathcomp}" ] ; - then - $mkdirprog "${pathcomp}" - else - true - fi - - pathcomp="${pathcomp}/" -done -fi - -if [ x"$dir_arg" != x ] -then - $doit $instcmd $dst && - - if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi && - if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi && - if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi && - if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi -else - -# If we're going to rename the final executable, determine the name now. - - if [ x"$transformarg" = x ] - then - dstfile=`basename $dst` - else - dstfile=`basename $dst $transformbasename | - sed $transformarg`$transformbasename - fi - -# don't allow the sed command to completely eliminate the filename - - if [ x"$dstfile" = x ] - then - dstfile=`basename $dst` - else - true - fi - -# Make a temp file name in the proper directory. - - dsttmp=$dstdir/#inst.$$# - -# Move or copy the file name to the temp name - - $doit $instcmd $src $dsttmp && - - trap "rm -f ${dsttmp}" 0 && - -# and set any options; do chmod last to preserve setuid bits - -# If any of these fail, we abort the whole thing. If we want to -# ignore errors from any of these, just make sure not to ignore -# errors from the above "$doit $instcmd $src $dsttmp" command. - - if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi && - if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi && - if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi && - if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi && - -# Now rename the file to the real destination. - - $doit $rmcmd -f $dstdir/$dstfile && - $doit $mvcmd $dsttmp $dstdir/$dstfile - -fi && - - -exit 0 diff --git a/wxWidgets/src/expat/conftools/libtool.m4 b/wxWidgets/src/expat/conftools/libtool.m4 deleted file mode 100644 index 066bf6a5ce..0000000000 --- a/wxWidgets/src/expat/conftools/libtool.m4 +++ /dev/null @@ -1,3573 +0,0 @@ -# libtool.m4 - Configure libtool for the host system. -*-Shell-script-*- -## Copyright 1996, 1997, 1998, 1999, 2000, 2001 -## Free Software Foundation, Inc. -## Originally by Gordon Matzigkeit , 1996 -## -## This program is free software; you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation; either version 2 of the License, or -## (at your option) any later version. -## -## This program is distributed in the hope that it will be useful, but -## WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -## General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with this program; if not, write to the Free Software -## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -## -## As a special exception to the GNU General Public License, if you -## distribute this file as part of a program that contains a -## configuration script generated by Autoconf, you may include it under -## the same distribution terms that you use for the rest of that program. - -# serial 46 AC_PROG_LIBTOOL - -AC_DEFUN([AC_PROG_LIBTOOL], -[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl - -# This can be used to rebuild libtool when needed -LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh" - -# Always use our own libtool. -LIBTOOL='$(SHELL) $(top_builddir)/libtool' -AC_SUBST(LIBTOOL)dnl - -# Prevent multiple expansion -define([AC_PROG_LIBTOOL], []) -]) - -AC_DEFUN([AC_LIBTOOL_SETUP], -[AC_PREREQ(2.13)dnl -AC_REQUIRE([AC_ENABLE_SHARED])dnl -AC_REQUIRE([AC_ENABLE_STATIC])dnl -AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl -AC_REQUIRE([AC_CANONICAL_HOST])dnl -AC_REQUIRE([AC_CANONICAL_BUILD])dnl -AC_REQUIRE([AC_PROG_CC])dnl -AC_REQUIRE([AC_PROG_LD])dnl -AC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl -AC_REQUIRE([AC_PROG_NM])dnl -AC_REQUIRE([AC_PROG_LN_S])dnl -AC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl -AC_REQUIRE([AC_OBJEXT])dnl -AC_REQUIRE([AC_EXEEXT])dnl -dnl - -_LT_AC_PROG_ECHO_BACKSLASH -# Only perform the check for file, if the check method requires it -case $deplibs_check_method in -file_magic*) - if test "$file_magic_cmd" = '$MAGIC_CMD'; then - AC_PATH_MAGIC - fi - ;; -esac - -AC_CHECK_TOOL(RANLIB, ranlib, :) -AC_CHECK_TOOL(STRIP, strip, :) - -ifdef([AC_PROVIDE_AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no) -ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL], -enable_win32_dll=yes, enable_win32_dll=no) - -AC_ARG_ENABLE(libtool-lock, - [ --disable-libtool-lock avoid locking (might break parallel builds)]) -test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes - -# Some flags need to be propagated to the compiler or linker for good -# libtool support. -case $host in -*-*-irix6*) - # Find out which ABI we are using. - echo '[#]line __oline__ "configure"' > conftest.$ac_ext - if AC_TRY_EVAL(ac_compile); then - case `/usr/bin/file conftest.$ac_objext` in - *32-bit*) - LD="${LD-ld} -32" - ;; - *N32*) - LD="${LD-ld} -n32" - ;; - *64-bit*) - LD="${LD-ld} -64" - ;; - esac - fi - rm -rf conftest* - ;; - -*-*-sco3.2v5*) - # On SCO OpenServer 5, we need -belf to get full-featured binaries. - SAVE_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS -belf" - AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, - [AC_LANG_SAVE - AC_LANG_C - AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) - AC_LANG_RESTORE]) - if test x"$lt_cv_cc_needs_belf" != x"yes"; then - # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf - CFLAGS="$SAVE_CFLAGS" - fi - ;; - -ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL], -[*-*-cygwin* | *-*-mingw* | *-*-pw32*) - AC_CHECK_TOOL(DLLTOOL, dlltool, false) - AC_CHECK_TOOL(AS, as, false) - AC_CHECK_TOOL(OBJDUMP, objdump, false) - - # recent cygwin and mingw systems supply a stub DllMain which the user - # can override, but on older systems we have to supply one - AC_CACHE_CHECK([if libtool should supply DllMain function], lt_cv_need_dllmain, - [AC_TRY_LINK([], - [extern int __attribute__((__stdcall__)) DllMain(void*, int, void*); - DllMain (0, 0, 0);], - [lt_cv_need_dllmain=no],[lt_cv_need_dllmain=yes])]) - - case $host/$CC in - *-*-cygwin*/gcc*-mno-cygwin*|*-*-mingw*) - # old mingw systems require "-dll" to link a DLL, while more recent ones - # require "-mdll" - SAVE_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS -mdll" - AC_CACHE_CHECK([how to link DLLs], lt_cv_cc_dll_switch, - [AC_TRY_LINK([], [], [lt_cv_cc_dll_switch=-mdll],[lt_cv_cc_dll_switch=-dll])]) - CFLAGS="$SAVE_CFLAGS" ;; - *-*-cygwin* | *-*-pw32*) - # cygwin systems need to pass --dll to the linker, and not link - # crt.o which will require a WinMain@16 definition. - lt_cv_cc_dll_switch="-Wl,--dll -nostartfiles" ;; - esac - ;; - ]) -esac - -_LT_AC_LTCONFIG_HACK - -]) - -# AC_LIBTOOL_HEADER_ASSERT -# ------------------------ -AC_DEFUN([AC_LIBTOOL_HEADER_ASSERT], -[AC_CACHE_CHECK([whether $CC supports assert without backlinking], - [lt_cv_func_assert_works], - [case $host in - *-*-solaris*) - if test "$GCC" = yes && test "$with_gnu_ld" != yes; then - case `$CC --version 2>/dev/null` in - [[12]].*) lt_cv_func_assert_works=no ;; - *) lt_cv_func_assert_works=yes ;; - esac - fi - ;; - esac]) - -if test "x$lt_cv_func_assert_works" = xyes; then - AC_CHECK_HEADERS(assert.h) -fi -])# AC_LIBTOOL_HEADER_ASSERT - -# _LT_AC_CHECK_DLFCN -# -------------------- -AC_DEFUN([_LT_AC_CHECK_DLFCN], -[AC_CHECK_HEADERS(dlfcn.h) -])# _LT_AC_CHECK_DLFCN - -# AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE -# --------------------------------- -AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], -[AC_REQUIRE([AC_CANONICAL_HOST]) -AC_REQUIRE([AC_PROG_NM]) -AC_REQUIRE([AC_OBJEXT]) -# Check for command to grab the raw symbol name followed by C symbol from nm. -AC_MSG_CHECKING([command to parse $NM output]) -AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], [dnl - -# These are sane defaults that work on at least a few old systems. -# [They come from Ultrix. What could be older than Ultrix?!! ;)] - -# Character class describing NM global symbol codes. -symcode='[[BCDEGRST]]' - -# Regexp to match symbols that can be accessed directly from C. -sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)' - -# Transform the above into a raw symbol and a C symbol. -symxfrm='\1 \2\3 \3' - -# Transform an extracted symbol line into a proper C declaration -lt_cv_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern char \1;/p'" - -# Transform an extracted symbol line into symbol name and symbol address -lt_cv_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" - -# Define system-specific variables. -case $host_os in -aix*) - symcode='[[BCDT]]' - ;; -cygwin* | mingw* | pw32*) - symcode='[[ABCDGISTW]]' - ;; -hpux*) # Its linker distinguishes data from code symbols - lt_cv_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern char \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" - lt_cv_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" - ;; -irix*) - symcode='[[BCDEGRST]]' - ;; -solaris* | sysv5*) - symcode='[[BDT]]' - ;; -sysv4) - symcode='[[DFNSTU]]' - ;; -esac - -# Handle CRLF in mingw tool chain -opt_cr= -case $host_os in -mingw*) - opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp - ;; -esac - -# If we're using GNU nm, then use its standard symbol codes. -if $NM -V 2>&1 | egrep '(GNU|with BFD)' > /dev/null; then - symcode='[[ABCDGISTW]]' -fi - -# Try without a prefix undercore, then with it. -for ac_symprfx in "" "_"; do - - # Write the raw and C identifiers. -lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*\($ac_symprfx\)$sympat$opt_cr$/$symxfrm/p'" - - # Check to see that the pipe works correctly. - pipe_works=no - rm -f conftest* - cat > conftest.$ac_ext < $nlist) && test -s "$nlist"; then - # Try sorting and uniquifying the output. - if sort "$nlist" | uniq > "$nlist"T; then - mv -f "$nlist"T "$nlist" - else - rm -f "$nlist"T - fi - - # Make sure that we snagged all the symbols we need. - if egrep ' nm_test_var$' "$nlist" >/dev/null; then - if egrep ' nm_test_func$' "$nlist" >/dev/null; then - cat < conftest.$ac_ext -#ifdef __cplusplus -extern "C" { -#endif - -EOF - # Now generate the symbol file. - eval "$lt_cv_global_symbol_to_cdecl"' < "$nlist" >> conftest.$ac_ext' - - cat <> conftest.$ac_ext -#if defined (__STDC__) && __STDC__ -# define lt_ptr void * -#else -# define lt_ptr char * -# define const -#endif - -/* The mapping between symbol names and symbols. */ -const struct { - const char *name; - lt_ptr address; -} -lt_preloaded_symbols[[]] = -{ -EOF - sed "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr) \&\2},/" < "$nlist" >> conftest.$ac_ext - cat <<\EOF >> conftest.$ac_ext - {0, (lt_ptr) 0} -}; - -#ifdef __cplusplus -} -#endif -EOF - # Now try linking the two files. - mv conftest.$ac_objext conftstm.$ac_objext - save_LIBS="$LIBS" - save_CFLAGS="$CFLAGS" - LIBS="conftstm.$ac_objext" - CFLAGS="$CFLAGS$no_builtin_flag" - if AC_TRY_EVAL(ac_link) && test -s conftest; then - pipe_works=yes - fi - LIBS="$save_LIBS" - CFLAGS="$save_CFLAGS" - else - echo "cannot find nm_test_func in $nlist" >&AC_FD_CC - fi - else - echo "cannot find nm_test_var in $nlist" >&AC_FD_CC - fi - else - echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AC_FD_CC - fi - else - echo "$progname: failed program was:" >&AC_FD_CC - cat conftest.$ac_ext >&5 - fi - rm -f conftest* conftst* - - # Do not use the global_symbol_pipe unless it works. - if test "$pipe_works" = yes; then - break - else - lt_cv_sys_global_symbol_pipe= - fi -done -]) -global_symbol_pipe="$lt_cv_sys_global_symbol_pipe" -if test -z "$lt_cv_sys_global_symbol_pipe"; then - global_symbol_to_cdecl= - global_symbol_to_c_name_address= -else - global_symbol_to_cdecl="$lt_cv_global_symbol_to_cdecl" - global_symbol_to_c_name_address="$lt_cv_global_symbol_to_c_name_address" -fi -if test -z "$global_symbol_pipe$global_symbol_to_cdec$global_symbol_to_c_name_address"; -then - AC_MSG_RESULT(failed) -else - AC_MSG_RESULT(ok) -fi -]) # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE - -# _LT_AC_LIBTOOL_SYS_PATH_SEPARATOR -# --------------------------------- -AC_DEFUN([_LT_AC_LIBTOOL_SYS_PATH_SEPARATOR], -[# Find the correct PATH separator. Usually this is `:', but -# DJGPP uses `;' like DOS. -if test "X${PATH_SEPARATOR+set}" != Xset; then - UNAME=${UNAME-`uname 2>/dev/null`} - case X$UNAME in - *-DOS) lt_cv_sys_path_separator=';' ;; - *) lt_cv_sys_path_separator=':' ;; - esac - PATH_SEPARATOR=$lt_cv_sys_path_separator -fi -])# _LT_AC_LIBTOOL_SYS_PATH_SEPARATOR - -# _LT_AC_PROG_ECHO_BACKSLASH -# -------------------------- -# Add some code to the start of the generated configure script which -# will find an echo command which doesn't interpret backslashes. -AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH], -[ifdef([AC_DIVERSION_NOTICE], [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)], - [AC_DIVERT_PUSH(NOTICE)]) -_LT_AC_LIBTOOL_SYS_PATH_SEPARATOR - -# Check that we are running under the correct shell. -SHELL=${CONFIG_SHELL-/bin/sh} - -case X$ECHO in -X*--fallback-echo) - # Remove one level of quotation (which was required for Make). - ECHO=`echo "$ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','` - ;; -esac - -echo=${ECHO-echo} -if test "X[$]1" = X--no-reexec; then - # Discard the --no-reexec flag, and continue. - shift -elif test "X[$]1" = X--fallback-echo; then - # Avoid inline document here, it may be left over - : -elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then - # Yippee, $echo works! - : -else - # Restart under the correct shell. - exec $SHELL "[$]0" --no-reexec ${1+"[$]@"} -fi - -if test "X[$]1" = X--fallback-echo; then - # used as fallback echo - shift - cat </dev/null && - echo_test_string="`eval $cmd`" && - (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null - then - break - fi - done -fi - -if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && - echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - : -else - # The Solaris, AIX, and Digital Unix default echo programs unquote - # backslashes. This makes it impossible to quote backslashes using - # echo "$something" | sed 's/\\/\\\\/g' - # - # So, first we look for a working echo in the user's PATH. - - IFS="${IFS= }"; save_ifs="$IFS"; IFS=$PATH_SEPARATOR - for dir in $PATH /usr/ucb; do - if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && - test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && - echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - echo="$dir/echo" - break - fi - done - IFS="$save_ifs" - - if test "X$echo" = Xecho; then - # We didn't find a better echo, so look for alternatives. - if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' && - echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - # This shell has a builtin print -r that does the trick. - echo='print -r' - elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) && - test "X$CONFIG_SHELL" != X/bin/ksh; then - # If we have ksh, try running configure again with it. - ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} - export ORIGINAL_CONFIG_SHELL - CONFIG_SHELL=/bin/ksh - export CONFIG_SHELL - exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"} - else - # Try using printf. - echo='printf %s\n' - if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && - echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - # Cool, printf works - : - elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && - test "X$echo_testing_string" = 'X\t' && - echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL - export CONFIG_SHELL - SHELL="$CONFIG_SHELL" - export SHELL - echo="$CONFIG_SHELL [$]0 --fallback-echo" - elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && - test "X$echo_testing_string" = 'X\t' && - echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - echo="$CONFIG_SHELL [$]0 --fallback-echo" - else - # maybe with a smaller string... - prev=: - - for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do - if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null - then - break - fi - prev="$cmd" - done - - if test "$prev" != 'sed 50q "[$]0"'; then - echo_test_string=`eval $prev` - export echo_test_string - exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"} - else - # Oops. We lost completely, so just stick with echo. - echo=echo - fi - fi - fi - fi -fi -fi - -# Copy echo and quote the copy suitably for passing to libtool from -# the Makefile, instead of quoting the original, which is used later. -ECHO=$echo -if test "X$ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then - ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo" -fi - -AC_SUBST(ECHO) -AC_DIVERT_POP -])# _LT_AC_PROG_ECHO_BACKSLASH - -# _LT_AC_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, -# ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) -# ------------------------------------------------------------------ -AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF], -[if test "$cross_compiling" = yes; then : - [$4] -else - AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl - lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 - lt_status=$lt_dlunknown - cat > conftest.$ac_ext < -#endif - -#include - -#ifdef RTLD_GLOBAL -# define LT_DLGLOBAL RTLD_GLOBAL -#else -# ifdef DL_GLOBAL -# define LT_DLGLOBAL DL_GLOBAL -# else -# define LT_DLGLOBAL 0 -# endif -#endif - -/* We may have to define LT_DLLAZY_OR_NOW in the command line if we - find out it does not work in some platform. */ -#ifndef LT_DLLAZY_OR_NOW -# ifdef RTLD_LAZY -# define LT_DLLAZY_OR_NOW RTLD_LAZY -# else -# ifdef DL_LAZY -# define LT_DLLAZY_OR_NOW DL_LAZY -# else -# ifdef RTLD_NOW -# define LT_DLLAZY_OR_NOW RTLD_NOW -# else -# ifdef DL_NOW -# define LT_DLLAZY_OR_NOW DL_NOW -# else -# define LT_DLLAZY_OR_NOW 0 -# endif -# endif -# endif -# endif -#endif - -#ifdef __cplusplus -extern "C" void exit (int); -#endif - -void fnord() { int i=42;} -int main () -{ - void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); - int status = $lt_dlunknown; - - if (self) - { - if (dlsym (self,"fnord")) status = $lt_dlno_uscore; - else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; - /* dlclose (self); */ - } - - exit (status); -}] -EOF - if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then - (./conftest; exit; ) 2>/dev/null - lt_status=$? - case x$lt_status in - x$lt_dlno_uscore) $1 ;; - x$lt_dlneed_uscore) $2 ;; - x$lt_unknown|x*) $3 ;; - esac - else : - # compilation failed - $3 - fi -fi -rm -fr conftest* -])# _LT_AC_TRY_DLOPEN_SELF - -# AC_LIBTOOL_DLOPEN_SELF -# ------------------- -AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], -[if test "x$enable_dlopen" != xyes; then - enable_dlopen=unknown - enable_dlopen_self=unknown - enable_dlopen_self_static=unknown -else - lt_cv_dlopen=no - lt_cv_dlopen_libs= - - case $host_os in - beos*) - lt_cv_dlopen="load_add_on" - lt_cv_dlopen_libs= - lt_cv_dlopen_self=yes - ;; - - cygwin* | mingw* | pw32*) - lt_cv_dlopen="LoadLibrary" - lt_cv_dlopen_libs= - ;; - - *) - AC_CHECK_FUNC([shl_load], - [lt_cv_dlopen="shl_load"], - [AC_CHECK_LIB([dld], [shl_load], - [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"], - [AC_CHECK_FUNC([dlopen], - [lt_cv_dlopen="dlopen"], - [AC_CHECK_LIB([dl], [dlopen], - [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"], - [AC_CHECK_LIB([svld], [dlopen], - [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"], - [AC_CHECK_LIB([dld], [dld_link], - [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"]) - ]) - ]) - ]) - ]) - ]) - ;; - esac - - if test "x$lt_cv_dlopen" != xno; then - enable_dlopen=yes - else - enable_dlopen=no - fi - - case $lt_cv_dlopen in - dlopen) - save_CPPFLAGS="$CPPFLAGS" - AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl - test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" - - save_LDFLAGS="$LDFLAGS" - eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" - - save_LIBS="$LIBS" - LIBS="$lt_cv_dlopen_libs $LIBS" - - AC_CACHE_CHECK([whether a program can dlopen itself], - lt_cv_dlopen_self, [dnl - _LT_AC_TRY_DLOPEN_SELF( - lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, - lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) - ]) - - if test "x$lt_cv_dlopen_self" = xyes; then - LDFLAGS="$LDFLAGS $link_static_flag" - AC_CACHE_CHECK([whether a statically linked program can dlopen itself], - lt_cv_dlopen_self_static, [dnl - _LT_AC_TRY_DLOPEN_SELF( - lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, - lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) - ]) - fi - - CPPFLAGS="$save_CPPFLAGS" - LDFLAGS="$save_LDFLAGS" - LIBS="$save_LIBS" - ;; - esac - - case $lt_cv_dlopen_self in - yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; - *) enable_dlopen_self=unknown ;; - esac - - case $lt_cv_dlopen_self_static in - yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; - *) enable_dlopen_self_static=unknown ;; - esac -fi -])# AC_LIBTOOL_DLOPEN_SELF - -AC_DEFUN([_LT_AC_LTCONFIG_HACK], -[AC_REQUIRE([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])dnl -# Sed substitution that helps us do robust quoting. It backslashifies -# metacharacters that are still active within double-quoted strings. -Xsed='sed -e s/^X//' -sed_quote_subst='s/\([[\\"\\`$\\\\]]\)/\\\1/g' - -# Same as above, but do not quote variable references. -double_quote_subst='s/\([[\\"\\`\\\\]]\)/\\\1/g' - -# Sed substitution to delay expansion of an escaped shell variable in a -# double_quote_subst'ed string. -delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' - -# Constants: -rm="rm -f" - -# Global variables: -default_ofile=libtool -can_build_shared=yes - -# All known linkers require a `.a' archive for static linking (except M$VC, -# which needs '.lib'). -libext=a -ltmain="$ac_aux_dir/ltmain.sh" -ofile="$default_ofile" -with_gnu_ld="$lt_cv_prog_gnu_ld" -need_locks="$enable_libtool_lock" - -old_CC="$CC" -old_CFLAGS="$CFLAGS" - -# Set sane defaults for various variables -test -z "$AR" && AR=ar -test -z "$AR_FLAGS" && AR_FLAGS=cru -test -z "$AS" && AS=as -test -z "$CC" && CC=cc -test -z "$DLLTOOL" && DLLTOOL=dlltool -test -z "$LD" && LD=ld -test -z "$LN_S" && LN_S="ln -s" -test -z "$MAGIC_CMD" && MAGIC_CMD=file -test -z "$NM" && NM=nm -test -z "$OBJDUMP" && OBJDUMP=objdump -test -z "$RANLIB" && RANLIB=: -test -z "$STRIP" && STRIP=: -test -z "$ac_objext" && ac_objext=o - -if test x"$host" != x"$build"; then - ac_tool_prefix=${host_alias}- -else - ac_tool_prefix= -fi - -# Transform linux* to *-*-linux-gnu*, to support old configure scripts. -case $host_os in -linux-gnu*) ;; -linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'` -esac - -case $host_os in -aix3*) - # AIX sometimes has problems with the GCC collect2 program. For some - # reason, if we set the COLLECT_NAMES environment variable, the problems - # vanish in a puff of smoke. - if test "X${COLLECT_NAMES+set}" != Xset; then - COLLECT_NAMES= - export COLLECT_NAMES - fi - ;; -esac - -# Determine commands to create old-style static archives. -old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs' -old_postinstall_cmds='chmod 644 $oldlib' -old_postuninstall_cmds= - -if test -n "$RANLIB"; then - case $host_os in - openbsd*) - old_postinstall_cmds="\$RANLIB -t \$oldlib~$old_postinstall_cmds" - ;; - *) - old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds" - ;; - esac - old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" -fi - -# Allow CC to be a program name with arguments. -set dummy $CC -compiler="[$]2" - -## FIXME: this should be a separate macro -## -AC_MSG_CHECKING([for objdir]) -rm -f .libs 2>/dev/null -mkdir .libs 2>/dev/null -if test -d .libs; then - objdir=.libs -else - # MS-DOS does not allow filenames that begin with a dot. - objdir=_libs -fi -rmdir .libs 2>/dev/null -AC_MSG_RESULT($objdir) -## -## END FIXME - - -## FIXME: this should be a separate macro -## -AC_ARG_WITH(pic, -[ --with-pic try to use only PIC/non-PIC objects [default=use both]], -pic_mode="$withval", pic_mode=default) -test -z "$pic_mode" && pic_mode=default - -# We assume here that the value for lt_cv_prog_cc_pic will not be cached -# in isolation, and that seeing it set (from the cache) indicates that -# the associated values are set (in the cache) correctly too. -AC_MSG_CHECKING([for $compiler option to produce PIC]) -AC_CACHE_VAL(lt_cv_prog_cc_pic, -[ lt_cv_prog_cc_pic= - lt_cv_prog_cc_shlib= - lt_cv_prog_cc_wl= - lt_cv_prog_cc_static= - lt_cv_prog_cc_no_builtin= - lt_cv_prog_cc_can_build_shared=$can_build_shared - - if test "$GCC" = yes; then - lt_cv_prog_cc_wl='-Wl,' - lt_cv_prog_cc_static='-static' - - case $host_os in - aix*) - # Below there is a dirty hack to force normal static linking with -ldl - # The problem is because libdl dynamically linked with both libc and - # libC (AIX C++ library), which obviously doesn't included in libraries - # list by gcc. This cause undefined symbols with -static flags. - # This hack allows C programs to be linked with "-static -ldl", but - # not sure about C++ programs. - lt_cv_prog_cc_static="$lt_cv_prog_cc_static ${lt_cv_prog_cc_wl}-lC" - ;; - amigaos*) - # FIXME: we need at least 68020 code to build shared libraries, but - # adding the `-m68020' flag to GCC prevents building anything better, - # like `-m68040'. - lt_cv_prog_cc_pic='-m68020 -resident32 -malways-restore-a4' - ;; - beos* | irix5* | irix6* | osf3* | osf4* | osf5*) - # PIC is the default for these OSes. - ;; - darwin* | rhapsody*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - lt_cv_prog_cc_pic='-fno-common' - ;; - cygwin* | mingw* | pw32* | os2*) - # This hack is so that the source file can tell whether it is being - # built for inclusion in a dll (and should export symbols for example). - lt_cv_prog_cc_pic='-DDLL_EXPORT' - ;; - sysv4*MP*) - if test -d /usr/nec; then - lt_cv_prog_cc_pic=-Kconform_pic - fi - ;; - *) - lt_cv_prog_cc_pic='-fPIC' - ;; - esac - else - # PORTME Check for PIC flags for the system compiler. - case $host_os in - aix3* | aix4* | aix5*) - lt_cv_prog_cc_wl='-Wl,' - # All AIX code is PIC. - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - lt_cv_prog_cc_static='-Bstatic' - else - lt_cv_prog_cc_static='-bnso -bI:/lib/syscalls.exp' - fi - ;; - - hpux9* | hpux10* | hpux11*) - # Is there a better lt_cv_prog_cc_static that works with the bundled CC? - lt_cv_prog_cc_wl='-Wl,' - lt_cv_prog_cc_static="${lt_cv_prog_cc_wl}-a ${lt_cv_prog_cc_wl}archive" - lt_cv_prog_cc_pic='+Z' - ;; - - irix5* | irix6*) - lt_cv_prog_cc_wl='-Wl,' - lt_cv_prog_cc_static='-non_shared' - # PIC (with -KPIC) is the default. - ;; - - cygwin* | mingw* | pw32* | os2*) - # This hack is so that the source file can tell whether it is being - # built for inclusion in a dll (and should export symbols for example). - lt_cv_prog_cc_pic='-DDLL_EXPORT' - ;; - - newsos6) - lt_cv_prog_cc_pic='-KPIC' - lt_cv_prog_cc_static='-Bstatic' - ;; - - osf3* | osf4* | osf5*) - # All OSF/1 code is PIC. - lt_cv_prog_cc_wl='-Wl,' - lt_cv_prog_cc_static='-non_shared' - ;; - - sco3.2v5*) - lt_cv_prog_cc_pic='-Kpic' - lt_cv_prog_cc_static='-dn' - lt_cv_prog_cc_shlib='-belf' - ;; - - solaris*) - lt_cv_prog_cc_pic='-KPIC' - lt_cv_prog_cc_static='-Bstatic' - lt_cv_prog_cc_wl='-Wl,' - ;; - - sunos4*) - lt_cv_prog_cc_pic='-PIC' - lt_cv_prog_cc_static='-Bstatic' - lt_cv_prog_cc_wl='-Qoption ld ' - ;; - - sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) - lt_cv_prog_cc_pic='-KPIC' - lt_cv_prog_cc_static='-Bstatic' - if test "x$host_vendor" = xsni; then - lt_cv_prog_cc_wl='-LD' - else - lt_cv_prog_cc_wl='-Wl,' - fi - ;; - - uts4*) - lt_cv_prog_cc_pic='-pic' - lt_cv_prog_cc_static='-Bstatic' - ;; - - sysv4*MP*) - if test -d /usr/nec ;then - lt_cv_prog_cc_pic='-Kconform_pic' - lt_cv_prog_cc_static='-Bstatic' - fi - ;; - - *) - lt_cv_prog_cc_can_build_shared=no - ;; - esac - fi -]) -if test -z "$lt_cv_prog_cc_pic"; then - AC_MSG_RESULT([none]) -else - AC_MSG_RESULT([$lt_cv_prog_cc_pic]) - - # Check to make sure the pic_flag actually works. - AC_MSG_CHECKING([if $compiler PIC flag $lt_cv_prog_cc_pic works]) - AC_CACHE_VAL(lt_cv_prog_cc_pic_works, [dnl - save_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS $lt_cv_prog_cc_pic -DPIC" - AC_TRY_COMPILE([], [], [dnl - case $host_os in - hpux9* | hpux10* | hpux11*) - # On HP-UX, both CC and GCC only warn that PIC is supported... then - # they create non-PIC objects. So, if there were any warnings, we - # assume that PIC is not supported. - if test -s conftest.err; then - lt_cv_prog_cc_pic_works=no - else - lt_cv_prog_cc_pic_works=yes - fi - ;; - *) - lt_cv_prog_cc_pic_works=yes - ;; - esac - ], [dnl - lt_cv_prog_cc_pic_works=no - ]) - CFLAGS="$save_CFLAGS" - ]) - - if test "X$lt_cv_prog_cc_pic_works" = Xno; then - lt_cv_prog_cc_pic= - lt_cv_prog_cc_can_build_shared=no - else - lt_cv_prog_cc_pic=" $lt_cv_prog_cc_pic" - fi - - AC_MSG_RESULT([$lt_cv_prog_cc_pic_works]) -fi -## -## END FIXME - -# Check for any special shared library compilation flags. -if test -n "$lt_cv_prog_cc_shlib"; then - AC_MSG_WARN([\`$CC' requires \`$lt_cv_prog_cc_shlib' to build shared libraries]) - if echo "$old_CC $old_CFLAGS " | egrep -e "[[ ]]$lt_cv_prog_cc_shlib[[ ]]" >/dev/null; then : - else - AC_MSG_WARN([add \`$lt_cv_prog_cc_shlib' to the CC or CFLAGS env variable and reconfigure]) - lt_cv_prog_cc_can_build_shared=no - fi -fi - -## FIXME: this should be a separate macro -## -AC_MSG_CHECKING([if $compiler static flag $lt_cv_prog_cc_static works]) -AC_CACHE_VAL([lt_cv_prog_cc_static_works], [dnl - lt_cv_prog_cc_static_works=no - save_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS $lt_cv_prog_cc_static" - AC_TRY_LINK([], [], [lt_cv_prog_cc_static_works=yes]) - LDFLAGS="$save_LDFLAGS" -]) - -# Belt *and* braces to stop my trousers falling down: -test "X$lt_cv_prog_cc_static_works" = Xno && lt_cv_prog_cc_static= -AC_MSG_RESULT([$lt_cv_prog_cc_static_works]) - -pic_flag="$lt_cv_prog_cc_pic" -special_shlib_compile_flags="$lt_cv_prog_cc_shlib" -wl="$lt_cv_prog_cc_wl" -link_static_flag="$lt_cv_prog_cc_static" -no_builtin_flag="$lt_cv_prog_cc_no_builtin" -can_build_shared="$lt_cv_prog_cc_can_build_shared" -## -## END FIXME - - -## FIXME: this should be a separate macro -## -# Check to see if options -o and -c are simultaneously supported by compiler -AC_MSG_CHECKING([if $compiler supports -c -o file.$ac_objext]) -AC_CACHE_VAL([lt_cv_compiler_c_o], [ -$rm -r conftest 2>/dev/null -mkdir conftest -cd conftest -echo "int some_variable = 0;" > conftest.$ac_ext -mkdir out -# According to Tom Tromey, Ian Lance Taylor reported there are C compilers -# that will create temporary files in the current directory regardless of -# the output directory. Thus, making CWD read-only will cause this test -# to fail, enabling locking or at least warning the user not to do parallel -# builds. -chmod -w . -save_CFLAGS="$CFLAGS" -CFLAGS="$CFLAGS -o out/conftest2.$ac_objext" -compiler_c_o=no -if { (eval echo configure:__oline__: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>out/conftest.err; } && test -s out/conftest2.$ac_objext; then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings - if test -s out/conftest.err; then - lt_cv_compiler_c_o=no - else - lt_cv_compiler_c_o=yes - fi -else - # Append any errors to the config.log. - cat out/conftest.err 1>&AC_FD_CC - lt_cv_compiler_c_o=no -fi -CFLAGS="$save_CFLAGS" -chmod u+w . -$rm conftest* out/* -rmdir out -cd .. -rmdir conftest -$rm -r conftest 2>/dev/null -]) -compiler_c_o=$lt_cv_compiler_c_o -AC_MSG_RESULT([$compiler_c_o]) - -if test x"$compiler_c_o" = x"yes"; then - # Check to see if we can write to a .lo - AC_MSG_CHECKING([if $compiler supports -c -o file.lo]) - AC_CACHE_VAL([lt_cv_compiler_o_lo], [ - lt_cv_compiler_o_lo=no - save_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS -c -o conftest.lo" - save_objext="$ac_objext" - ac_objext=lo - AC_TRY_COMPILE([], [int some_variable = 0;], [dnl - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings - if test -s conftest.err; then - lt_cv_compiler_o_lo=no - else - lt_cv_compiler_o_lo=yes - fi - ]) - ac_objext="$save_objext" - CFLAGS="$save_CFLAGS" - ]) - compiler_o_lo=$lt_cv_compiler_o_lo - AC_MSG_RESULT([$compiler_o_lo]) -else - compiler_o_lo=no -fi -## -## END FIXME - -## FIXME: this should be a separate macro -## -# Check to see if we can do hard links to lock some files if needed -hard_links="nottested" -if test "$compiler_c_o" = no && test "$need_locks" != no; then - # do not overwrite the value of need_locks provided by the user - AC_MSG_CHECKING([if we can lock with hard links]) - hard_links=yes - $rm conftest* - ln conftest.a conftest.b 2>/dev/null && hard_links=no - touch conftest.a - ln conftest.a conftest.b 2>&5 || hard_links=no - ln conftest.a conftest.b 2>/dev/null && hard_links=no - AC_MSG_RESULT([$hard_links]) - if test "$hard_links" = no; then - AC_MSG_WARN([\`$CC' does not support \`-c -o', so \`make -j' may be unsafe]) - need_locks=warn - fi -else - need_locks=no -fi -## -## END FIXME - -## FIXME: this should be a separate macro -## -if test "$GCC" = yes; then - # Check to see if options -fno-rtti -fno-exceptions are supported by compiler - AC_MSG_CHECKING([if $compiler supports -fno-rtti -fno-exceptions]) - echo "int some_variable = 0;" > conftest.$ac_ext - save_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS -fno-rtti -fno-exceptions -c conftest.$ac_ext" - compiler_rtti_exceptions=no - AC_TRY_COMPILE([], [int some_variable = 0;], [dnl - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings - if test -s conftest.err; then - compiler_rtti_exceptions=no - else - compiler_rtti_exceptions=yes - fi - ]) - CFLAGS="$save_CFLAGS" - AC_MSG_RESULT([$compiler_rtti_exceptions]) - - if test "$compiler_rtti_exceptions" = "yes"; then - no_builtin_flag=' -fno-builtin -fno-rtti -fno-exceptions' - else - no_builtin_flag=' -fno-builtin' - fi -fi -## -## END FIXME - -## FIXME: this should be a separate macro -## -# See if the linker supports building shared libraries. -AC_MSG_CHECKING([whether the linker ($LD) supports shared libraries]) - -allow_undefined_flag= -no_undefined_flag= -need_lib_prefix=unknown -need_version=unknown -# when you set need_version to no, make sure it does not cause -set_version -# flags to be left without arguments -archive_cmds= -archive_expsym_cmds= -old_archive_from_new_cmds= -old_archive_from_expsyms_cmds= -export_dynamic_flag_spec= -whole_archive_flag_spec= -thread_safe_flag_spec= -hardcode_into_libs=no -hardcode_libdir_flag_spec= -hardcode_libdir_separator= -hardcode_direct=no -hardcode_minus_L=no -hardcode_shlibpath_var=unsupported -runpath_var= -link_all_deplibs=unknown -always_export_symbols=no -export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | sed '\''s/.* //'\'' | sort | uniq > $export_symbols' -# include_expsyms should be a list of space-separated symbols to be *always* -# included in the symbol list -include_expsyms= -# exclude_expsyms can be an egrep regular expression of symbols to exclude -# it will be wrapped by ` (' and `)$', so one must not match beginning or -# end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', -# as well as any symbol that contains `d'. -exclude_expsyms="_GLOBAL_OFFSET_TABLE_" -# Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out -# platforms (ab)use it in PIC code, but their linkers get confused if -# the symbol is explicitly referenced. Since portable code cannot -# rely on this symbol name, it's probably fine to never include it in -# preloaded symbol tables. -extract_expsyms_cmds= - -case $host_os in -cygwin* | mingw* | pw32*) - # FIXME: the MSVC++ port hasn't been tested in a loooong time - # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. - if test "$GCC" != yes; then - with_gnu_ld=no - fi - ;; -openbsd*) - with_gnu_ld=no - ;; -esac - -ld_shlibs=yes -if test "$with_gnu_ld" = yes; then - # If archive_cmds runs LD, not CC, wlarc should be empty - wlarc='${wl}' - - # See if GNU ld supports shared libraries. - case $host_os in - aix3* | aix4* | aix5*) - # On AIX, the GNU linker is very broken - # Note:Check GNU linker on AIX 5-IA64 when/if it becomes available. - ld_shlibs=no - cat <&2 - -*** Warning: the GNU linker, at least up to release 2.9.1, is reported -*** to be unable to reliably create shared libraries on AIX. -*** Therefore, libtool is disabling shared libraries support. If you -*** really care for shared libraries, you may want to modify your PATH -*** so that a non-GNU linker is found, and then restart. - -EOF - ;; - - amigaos*) - archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' - hardcode_libdir_flag_spec='-L$libdir' - hardcode_minus_L=yes - - # Samuel A. Falvo II reports - # that the semantics of dynamic libraries on AmigaOS, at least up - # to version 4, is to share data among multiple programs linked - # with the same dynamic library. Since this doesn't match the - # behavior of shared libraries on other platforms, we can use - # them. - ld_shlibs=no - ;; - - beos*) - if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then - allow_undefined_flag=unsupported - # Joseph Beckenbach says some releases of gcc - # support --undefined. This deserves some investigation. FIXME - archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - else - ld_shlibs=no - fi - ;; - - cygwin* | mingw* | pw32*) - # hardcode_libdir_flag_spec is actually meaningless, as there is - # no search path for DLLs. - hardcode_libdir_flag_spec='-L$libdir' - allow_undefined_flag=unsupported - always_export_symbols=yes - - extract_expsyms_cmds='test -f $output_objdir/impgen.c || \ - sed -e "/^# \/\* impgen\.c starts here \*\//,/^# \/\* impgen.c ends here \*\// { s/^# //;s/^# *$//; p; }" -e d < $''0 > $output_objdir/impgen.c~ - test -f $output_objdir/impgen.exe || (cd $output_objdir && \ - if test "x$HOST_CC" != "x" ; then $HOST_CC -o impgen impgen.c ; \ - else $CC -o impgen impgen.c ; fi)~ - $output_objdir/impgen $dir/$soroot > $output_objdir/$soname-def' - - old_archive_from_expsyms_cmds='$DLLTOOL --as=$AS --dllname $soname --def $output_objdir/$soname-def --output-lib $output_objdir/$newlib' - - # cygwin and mingw dlls have different entry points and sets of symbols - # to exclude. - # FIXME: what about values for MSVC? - dll_entry=__cygwin_dll_entry@12 - dll_exclude_symbols=DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12~ - case $host_os in - mingw*) - # mingw values - dll_entry=_DllMainCRTStartup@12 - dll_exclude_symbols=DllMain@12,DllMainCRTStartup@12,DllEntryPoint@12~ - ;; - esac - - # mingw and cygwin differ, and it's simplest to just exclude the union - # of the two symbol sets. - dll_exclude_symbols=DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12,DllMainCRTStartup@12,DllEntryPoint@12 - - # recent cygwin and mingw systems supply a stub DllMain which the user - # can override, but on older systems we have to supply one (in ltdll.c) - if test "x$lt_cv_need_dllmain" = "xyes"; then - ltdll_obj='$output_objdir/$soname-ltdll.'"$ac_objext " - ltdll_cmds='test -f $output_objdir/$soname-ltdll.c || sed -e "/^# \/\* ltdll\.c starts here \*\//,/^# \/\* ltdll.c ends here \*\// { s/^# //; p; }" -e d < $''0 > $output_objdir/$soname-ltdll.c~ - test -f $output_objdir/$soname-ltdll.$ac_objext || (cd $output_objdir && $CC -c $soname-ltdll.c)~' - else - ltdll_obj= - ltdll_cmds= - fi - - # Extract the symbol export list from an `--export-all' def file, - # then regenerate the def file from the symbol export list, so that - # the compiled dll only exports the symbol export list. - # Be careful not to strip the DATA tag left be newer dlltools. - export_symbols_cmds="$ltdll_cmds"' - $DLLTOOL --export-all --exclude-symbols '$dll_exclude_symbols' --output-def $output_objdir/$soname-def '$ltdll_obj'$libobjs $convenience~ - sed -e "1,/EXPORTS/d" -e "s/ @ [[0-9]]*//" -e "s/ *;.*$//" < $output_objdir/$soname-def > $export_symbols' - - # If the export-symbols file already is a .def file (1st line - # is EXPORTS), use it as is. - # If DATA tags from a recent dlltool are present, honour them! - archive_expsym_cmds='if test "x`head -1 $export_symbols`" = xEXPORTS; then - cp $export_symbols $output_objdir/$soname-def; - else - echo EXPORTS > $output_objdir/$soname-def; - _lt_hint=1; - cat $export_symbols | while read symbol; do - set dummy \$symbol; - case \[$]# in - 2) echo " \[$]2 @ \$_lt_hint ; " >> $output_objdir/$soname-def;; - *) echo " \[$]2 @ \$_lt_hint \[$]3 ; " >> $output_objdir/$soname-def;; - esac; - _lt_hint=`expr 1 + \$_lt_hint`; - done; - fi~ - '"$ltdll_cmds"' - $CC -Wl,--base-file,$output_objdir/$soname-base '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags~ - $DLLTOOL --as=$AS --dllname $soname --exclude-symbols '$dll_exclude_symbols' --def $output_objdir/$soname-def --base-file $output_objdir/$soname-base --output-exp $output_objdir/$soname-exp~ - $CC -Wl,--base-file,$output_objdir/$soname-base $output_objdir/$soname-exp '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags~ - $DLLTOOL --as=$AS --dllname $soname --exclude-symbols '$dll_exclude_symbols' --def $output_objdir/$soname-def --base-file $output_objdir/$soname-base --output-exp $output_objdir/$soname-exp --output-lib $output_objdir/$libname.dll.a~ - $CC $output_objdir/$soname-exp '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags' - ;; - - netbsd*) - if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then - archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' - wlarc= - else - archive_cmds='$CC -shared -nodefaultlibs $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds='$CC -shared -nodefaultlibs $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - fi - ;; - - solaris* | sysv5*) - if $LD -v 2>&1 | egrep 'BFD 2\.8' > /dev/null; then - ld_shlibs=no - cat <&2 - -*** Warning: The releases 2.8.* of the GNU linker cannot reliably -*** create shared libraries on Solaris systems. Therefore, libtool -*** is disabling shared libraries support. We urge you to upgrade GNU -*** binutils to release 2.9.1 or newer. Another option is to modify -*** your PATH or compiler configuration so that the native linker is -*** used, and then restart. - -EOF - elif $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - else - ld_shlibs=no - fi - ;; - - sunos4*) - archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' - wlarc= - hardcode_direct=yes - hardcode_shlibpath_var=no - ;; - - *) - if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - else - ld_shlibs=no - fi - ;; - esac - - if test "$ld_shlibs" = yes; then - runpath_var=LD_RUN_PATH - hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir' - export_dynamic_flag_spec='${wl}--export-dynamic' - case $host_os in - cygwin* | mingw* | pw32*) - # dlltool doesn't understand --whole-archive et. al. - whole_archive_flag_spec= - ;; - *) - # ancient GNU ld didn't support --whole-archive et. al. - if $LD --help 2>&1 | egrep 'no-whole-archive' > /dev/null; then - whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' - else - whole_archive_flag_spec= - fi - ;; - esac - fi -else - # PORTME fill in a description of your system's linker (not GNU ld) - case $host_os in - aix3*) - allow_undefined_flag=unsupported - always_export_symbols=yes - archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' - # Note: this linker hardcodes the directories in LIBPATH if there - # are no directories specified by -L. - hardcode_minus_L=yes - if test "$GCC" = yes && test -z "$link_static_flag"; then - # Neither direct hardcoding nor static linking is supported with a - # broken collect2. - hardcode_direct=unsupported - fi - ;; - - aix4* | aix5*) - if test "$host_cpu" = ia64; then - # On IA64, the linker does run time linking by default, so we don't - # have to do anything special. - aix_use_runtimelinking=no - exp_sym_flag='-Bexport' - no_entry_flag="" - else - aix_use_runtimelinking=no - - # Test if we are trying to use run time linking or normal - # AIX style linking. If -brtl is somewhere in LDFLAGS, we - # need to do runtime linking. - case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*) - for ld_flag in $LDFLAGS; do - if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then - aix_use_runtimelinking=yes - break - fi - done - esac - - exp_sym_flag='-bexport' - no_entry_flag='-bnoentry' - fi - - # When large executables or shared objects are built, AIX ld can - # have problems creating the table of contents. If linking a library - # or program results in "error TOC overflow" add -mminimal-toc to - # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not - # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. - - hardcode_direct=yes - archive_cmds='' - hardcode_libdir_separator=':' - if test "$GCC" = yes; then - case $host_os in aix4.[[012]]|aix4.[[012]].*) - collect2name=`${CC} -print-prog-name=collect2` - if test -f "$collect2name" && \ - strings "$collect2name" | grep resolve_lib_name >/dev/null - then - # We have reworked collect2 - hardcode_direct=yes - else - # We have old collect2 - hardcode_direct=unsupported - # It fails to find uninstalled libraries when the uninstalled - # path is not listed in the libpath. Setting hardcode_minus_L - # to unsupported forces relinking - hardcode_minus_L=yes - hardcode_libdir_flag_spec='-L$libdir' - hardcode_libdir_separator= - fi - esac - - shared_flag='-shared' - else - # not using gcc - if test "$host_cpu" = ia64; then - shared_flag='${wl}-G' - else - if test "$aix_use_runtimelinking" = yes; then - shared_flag='${wl}-G' - else - shared_flag='${wl}-bM:SRE' - fi - fi - fi - - # It seems that -bexpall can do strange things, so it is better to - # generate a list of symbols to export. - always_export_symbols=yes - if test "$aix_use_runtimelinking" = yes; then - # Warning - without using the other runtime loading flags (-brtl), - # -berok will link without error, but may produce a broken library. - allow_undefined_flag='-berok' - hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:/usr/lib:/lib' - archive_expsym_cmds="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag" - else - if test "$host_cpu" = ia64; then - hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' - allow_undefined_flag="-z nodefs" - archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname ${wl}-h$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols" - else - hardcode_libdir_flag_spec='${wl}-bnolibpath ${wl}-blibpath:$libdir:/usr/lib:/lib' - # Warning - without using the other run time loading flags, - # -berok will link without error, but may produce a broken library. - allow_undefined_flag='${wl}-berok' - # This is a bit strange, but is similar to how AIX traditionally builds - # it's shared libraries. - archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"' ~$AR -crlo $objdir/$libname$release.a $objdir/$soname' - fi - fi - ;; - - amigaos*) - archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' - hardcode_libdir_flag_spec='-L$libdir' - hardcode_minus_L=yes - # see comment about different semantics on the GNU ld section - ld_shlibs=no - ;; - - cygwin* | mingw* | pw32*) - # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. - # hardcode_libdir_flag_spec is actually meaningless, as there is - # no search path for DLLs. - hardcode_libdir_flag_spec=' ' - allow_undefined_flag=unsupported - # Tell ltmain to make .lib files, not .a files. - libext=lib - # FIXME: Setting linknames here is a bad hack. - archive_cmds='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | sed -e '\''s/ -lc$//'\''` -link -dll~linknames=' - # The linker will automatically build a .lib file if we build a DLL. - old_archive_from_new_cmds='true' - # FIXME: Should let the user specify the lib program. - old_archive_cmds='lib /OUT:$oldlib$oldobjs$old_deplibs' - fix_srcfile_path='`cygpath -w "$srcfile"`' - ;; - - darwin* | rhapsody*) - case "$host_os" in - rhapsody* | darwin1.[[012]]) - allow_undefined_flag='-undefined suppress' - ;; - *) # Darwin 1.3 on - allow_undefined_flag='-flat_namespace -undefined suppress' - ;; - esac - # FIXME: Relying on posixy $() will cause problems for - # cross-compilation, but unfortunately the echo tests do not - # yet detect zsh echo's removal of \ escapes. - archive_cmds='$nonopt $(test "x$module" = xyes && echo -bundle || echo -dynamiclib) $allow_undefined_flag -o $lib $libobjs $deplibs$linker_flags -install_name $rpath/$soname $verstring' - # We need to add '_' to the symbols in $export_symbols first - #archive_expsym_cmds="$archive_cmds"' && strip -s $export_symbols' - hardcode_direct=yes - hardcode_shlibpath_var=no - whole_archive_flag_spec='-all_load $convenience' - ;; - - freebsd1*) - ld_shlibs=no - ;; - - # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor - # support. Future versions do this automatically, but an explicit c++rt0.o - # does not break anything, and helps significantly (at the cost of a little - # extra space). - freebsd2.2*) - archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' - hardcode_libdir_flag_spec='-R$libdir' - hardcode_direct=yes - hardcode_shlibpath_var=no - ;; - - # Unfortunately, older versions of FreeBSD 2 do not have this feature. - freebsd2*) - archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct=yes - hardcode_minus_L=yes - hardcode_shlibpath_var=no - ;; - - # FreeBSD 3 and greater uses gcc -shared to do shared libraries. - freebsd*) - archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' - hardcode_libdir_flag_spec='-R$libdir' - hardcode_direct=yes - hardcode_shlibpath_var=no - ;; - - hpux9* | hpux10* | hpux11*) - case $host_os in - hpux9*) archive_cmds='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' ;; - *) archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' ;; - esac - hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' - hardcode_libdir_separator=: - hardcode_direct=yes - hardcode_minus_L=yes # Not in the search PATH, but as the default - # location of the library. - export_dynamic_flag_spec='${wl}-E' - ;; - - irix5* | irix6*) - if test "$GCC" = yes; then - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - else - archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - fi - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator=: - link_all_deplibs=yes - ;; - - netbsd*) - if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then - archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out - else - archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF - fi - hardcode_libdir_flag_spec='-R$libdir' - hardcode_direct=yes - hardcode_shlibpath_var=no - ;; - - newsos6) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct=yes - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator=: - hardcode_shlibpath_var=no - ;; - - openbsd*) - hardcode_direct=yes - hardcode_shlibpath_var=no - if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec='${wl}-rpath,$libdir' - export_dynamic_flag_spec='${wl}-E' - else - case "$host_os" in - openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*) - archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec='-R$libdir' - ;; - *) - archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec='${wl}-rpath,$libdir' - ;; - esac - fi - ;; - - os2*) - hardcode_libdir_flag_spec='-L$libdir' - hardcode_minus_L=yes - allow_undefined_flag=unsupported - archive_cmds='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' - old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' - ;; - - osf3*) - if test "$GCC" = yes; then - allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - else - allow_undefined_flag=' -expect_unresolved \*' - archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - fi - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator=: - ;; - - osf4* | osf5*) # as osf3* with the addition of -msym flag - if test "$GCC" = yes; then - allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' - else - allow_undefined_flag=' -expect_unresolved \*' - archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - archive_expsym_cmds='for i in `cat $export_symbols`; do printf "-exported_symbol " >> $lib.exp; echo "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ - $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib~$rm $lib.exp' - - #Both c and cxx compiler support -rpath directly - hardcode_libdir_flag_spec='-rpath $libdir' - fi - hardcode_libdir_separator=: - ;; - - sco3.2v5*) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_shlibpath_var=no - runpath_var=LD_RUN_PATH - hardcode_runpath_var=yes - export_dynamic_flag_spec='${wl}-Bexport' - ;; - - solaris*) - # gcc --version < 3.0 without binutils cannot create self contained - # shared libraries reliably, requiring libgcc.a to resolve some of - # the object symbols generated in some cases. Libraries that use - # assert need libgcc.a to resolve __eprintf, for example. Linking - # a copy of libgcc.a into every shared library to guarantee resolving - # such symbols causes other problems: According to Tim Van Holder - # , C++ libraries end up with a separate - # (to the application) exception stack for one thing. - no_undefined_flag=' -z defs' - if test "$GCC" = yes; then - case `$CC --version 2>/dev/null` in - [[12]].*) - cat <&2 - -*** Warning: Releases of GCC earlier than version 3.0 cannot reliably -*** create self contained shared libraries on Solaris systems, without -*** introducing a dependency on libgcc.a. Therefore, libtool is disabling -*** -no-undefined support, which will at least allow you to build shared -*** libraries. However, you may find that when you link such libraries -*** into an application without using GCC, you have to manually add -*** \`gcc --print-libgcc-file-name\` to the link command. We urge you to -*** upgrade to a newer version of GCC. Another option is to rebuild your -*** current GCC to use the GNU linker from GNU binutils 2.9.1 or newer. - -EOF - no_undefined_flag= - ;; - esac - fi - # $CC -shared without GNU ld will not create a library from C++ - # object files and a static libstdc++, better avoid it by now - archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' - archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' - hardcode_libdir_flag_spec='-R$libdir' - hardcode_shlibpath_var=no - case $host_os in - solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; - *) # Supported since Solaris 2.6 (maybe 2.5.1?) - whole_archive_flag_spec='-z allextract$convenience -z defaultextract' ;; - esac - link_all_deplibs=yes - ;; - - sunos4*) - if test "x$host_vendor" = xsequent; then - # Use $CC to link under sequent, because it throws in some extra .o - # files that make .init and .fini sections work. - archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' - else - archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' - fi - hardcode_libdir_flag_spec='-L$libdir' - hardcode_direct=yes - hardcode_minus_L=yes - hardcode_shlibpath_var=no - ;; - - sysv4) - if test "x$host_vendor" = xsno; then - archive_cmds='$LD -G -Bsymbolic -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct=yes # is this really true??? - else - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct=no #Motorola manual says yes, but my tests say they lie - fi - runpath_var='LD_RUN_PATH' - hardcode_shlibpath_var=no - ;; - - sysv4.3*) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_shlibpath_var=no - export_dynamic_flag_spec='-Bexport' - ;; - - sysv5*) - no_undefined_flag=' -z text' - # $CC -shared without GNU ld will not create a library from C++ - # object files and a static libstdc++, better avoid it by now - archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' - archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' - hardcode_libdir_flag_spec= - hardcode_shlibpath_var=no - runpath_var='LD_RUN_PATH' - ;; - - uts4*) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec='-L$libdir' - hardcode_shlibpath_var=no - ;; - - dgux*) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec='-L$libdir' - hardcode_shlibpath_var=no - ;; - - sysv4*MP*) - if test -d /usr/nec; then - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_shlibpath_var=no - runpath_var=LD_RUN_PATH - hardcode_runpath_var=yes - ld_shlibs=yes - fi - ;; - - sysv4.2uw2*) - archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct=yes - hardcode_minus_L=no - hardcode_shlibpath_var=no - hardcode_runpath_var=yes - runpath_var=LD_RUN_PATH - ;; - - sysv5uw7* | unixware7*) - no_undefined_flag='${wl}-z ${wl}text' - if test "$GCC" = yes; then - archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - else - archive_cmds='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - fi - runpath_var='LD_RUN_PATH' - hardcode_shlibpath_var=no - ;; - - *) - ld_shlibs=no - ;; - esac -fi -AC_MSG_RESULT([$ld_shlibs]) -test "$ld_shlibs" = no && can_build_shared=no -## -## END FIXME - -## FIXME: this should be a separate macro -## -# Check hardcoding attributes. -AC_MSG_CHECKING([how to hardcode library paths into programs]) -hardcode_action= -if test -n "$hardcode_libdir_flag_spec" || \ - test -n "$runpath_var"; then - - # We can hardcode non-existant directories. - if test "$hardcode_direct" != no && - # If the only mechanism to avoid hardcoding is shlibpath_var, we - # have to relink, otherwise we might link with an installed library - # when we should be linking with a yet-to-be-installed one - ## test "$hardcode_shlibpath_var" != no && - test "$hardcode_minus_L" != no; then - # Linking always hardcodes the temporary library directory. - hardcode_action=relink - else - # We can link without hardcoding, and we can hardcode nonexisting dirs. - hardcode_action=immediate - fi -else - # We cannot hardcode anything, or else we can only hardcode existing - # directories. - hardcode_action=unsupported -fi -AC_MSG_RESULT([$hardcode_action]) -## -## END FIXME - -## FIXME: this should be a separate macro -## -striplib= -old_striplib= -AC_MSG_CHECKING([whether stripping libraries is possible]) -if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then - test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" - test -z "$striplib" && striplib="$STRIP --strip-unneeded" - AC_MSG_RESULT([yes]) -else - AC_MSG_RESULT([no]) -fi -## -## END FIXME - -reload_cmds='$LD$reload_flag -o $output$reload_objs' -test -z "$deplibs_check_method" && deplibs_check_method=unknown - -## FIXME: this should be a separate macro -## -# PORTME Fill in your ld.so characteristics -AC_MSG_CHECKING([dynamic linker characteristics]) -library_names_spec= -libname_spec='lib$name' -soname_spec= -postinstall_cmds= -postuninstall_cmds= -finish_cmds= -finish_eval= -shlibpath_var= -shlibpath_overrides_runpath=unknown -version_type=none -dynamic_linker="$host_os ld.so" -sys_lib_dlsearch_path_spec="/lib /usr/lib" -sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" - -case $host_os in -aix3*) - version_type=linux - library_names_spec='${libname}${release}.so$versuffix $libname.a' - shlibpath_var=LIBPATH - - # AIX has no versioning support, so we append a major version to the name. - soname_spec='${libname}${release}.so$major' - ;; - -aix4* | aix5*) - version_type=linux - if test "$host_cpu" = ia64; then - # AIX 5 supports IA64 - library_names_spec='${libname}${release}.so$major ${libname}${release}.so$versuffix $libname.so' - shlibpath_var=LD_LIBRARY_PATH - else - # With GCC up to 2.95.x, collect2 would create an import file - # for dependence libraries. The import file would start with - # the line `#! .'. This would cause the generated library to - # depend on `.', always an invalid library. This was fixed in - # development snapshots of GCC prior to 3.0. - case $host_os in - aix4 | aix4.[[01]] | aix4.[[01]].*) - if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' - echo ' yes ' - echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then - : - else - can_build_shared=no - fi - ;; - esac - # AIX (on Power*) has no versioning support, so currently we can - # not hardcode correct soname into executable. Probably we can - # add versioning support to collect2, so additional links can - # be useful in future. - if test "$aix_use_runtimelinking" = yes; then - # If using run time linking (on AIX 4.2 or later) use lib.so - # instead of lib.a to let people know that these are not - # typical AIX shared libraries. - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' - else - # We preserve .a as extension for shared libraries through AIX4.2 - # and later when we are not doing run time linking. - library_names_spec='${libname}${release}.a $libname.a' - soname_spec='${libname}${release}.so$major' - fi - shlibpath_var=LIBPATH - fi - ;; - -amigaos*) - library_names_spec='$libname.ixlibrary $libname.a' - # Create ${libname}_ixlibrary.a entries in /sys/libs. - finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "(cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a)"; (cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a) || exit 1; done' - ;; - -beos*) - library_names_spec='${libname}.so' - dynamic_linker="$host_os ld.so" - shlibpath_var=LIBRARY_PATH - ;; - -bsdi4*) - version_type=linux - need_version=no - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' - soname_spec='${libname}${release}.so$major' - finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' - shlibpath_var=LD_LIBRARY_PATH - sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" - sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" - export_dynamic_flag_spec=-rdynamic - # the default ld.so.conf also contains /usr/contrib/lib and - # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow - # libtool to hard-code these into programs - ;; - -cygwin* | mingw* | pw32*) - version_type=windows - need_version=no - need_lib_prefix=no - case $GCC,$host_os in - yes,cygwin*) - library_names_spec='$libname.dll.a' - soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | sed -e 's/[[.]]/-/g'`${versuffix}.dll' - postinstall_cmds='dlpath=`bash 2>&1 -c '\''. $dir/${file}i;echo \$dlname'\''`~ - dldir=$destdir/`dirname \$dlpath`~ - test -d \$dldir || mkdir -p \$dldir~ - $install_prog .libs/$dlname \$dldir/$dlname' - postuninstall_cmds='dldll=`bash 2>&1 -c '\''. $file; echo \$dlname'\''`~ - dlpath=$dir/\$dldll~ - $rm \$dlpath' - ;; - yes,mingw*) - library_names_spec='${libname}`echo ${release} | sed -e 's/[[.]]/-/g'`${versuffix}.dll' - sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | sed -e "s/^libraries://" -e "s/;/ /g"` - ;; - yes,pw32*) - library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll' - ;; - *) - library_names_spec='${libname}`echo ${release} | sed -e 's/[[.]]/-/g'`${versuffix}.dll $libname.lib' - ;; - esac - dynamic_linker='Win32 ld.exe' - # FIXME: first we should search . and the directory the executable is in - shlibpath_var=PATH - ;; - -darwin* | rhapsody*) - dynamic_linker="$host_os dyld" - version_type=darwin - need_lib_prefix=no - need_version=no - # FIXME: Relying on posixy $() will cause problems for - # cross-compilation, but unfortunately the echo tests do not - # yet detect zsh echo's removal of \ escapes. - library_names_spec='${libname}${release}${versuffix}.$(test .$module = .yes && echo so || echo dylib) ${libname}${release}${major}.$(test .$module = .yes && echo so || echo dylib) ${libname}.$(test .$module = .yes && echo so || echo dylib)' - soname_spec='${libname}${release}${major}.$(test .$module = .yes && echo so || echo dylib)' - shlibpath_overrides_runpath=yes - shlibpath_var=DYLD_LIBRARY_PATH - ;; - -freebsd1*) - dynamic_linker=no - ;; - -freebsd*) - objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout` - version_type=freebsd-$objformat - case $version_type in - freebsd-elf*) - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so' - need_version=no - need_lib_prefix=no - ;; - freebsd-*) - library_names_spec='${libname}${release}.so$versuffix $libname.so$versuffix' - need_version=yes - ;; - esac - shlibpath_var=LD_LIBRARY_PATH - case $host_os in - freebsd2*) - shlibpath_overrides_runpath=yes - ;; - *) - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - ;; - esac - ;; - -gnu*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so${major} ${libname}.so' - soname_spec='${libname}${release}.so$major' - shlibpath_var=LD_LIBRARY_PATH - hardcode_into_libs=yes - ;; - -hpux9* | hpux10* | hpux11*) - # Give a soname corresponding to the major version so that dld.sl refuses to - # link against other versions. - dynamic_linker="$host_os dld.sl" - version_type=sunos - need_lib_prefix=no - need_version=no - shlibpath_var=SHLIB_PATH - shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH - library_names_spec='${libname}${release}.sl$versuffix ${libname}${release}.sl$major $libname.sl' - soname_spec='${libname}${release}.sl$major' - # HP-UX runs *really* slowly unless shared libraries are mode 555. - postinstall_cmds='chmod 555 $lib' - ;; - -irix5* | irix6*) - version_type=irix - need_lib_prefix=no - need_version=no - soname_spec='${libname}${release}.so$major' - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so $libname.so' - case $host_os in - irix5*) - libsuff= shlibsuff= - ;; - *) - case $LD in # libtool.m4 will add one of these switches to LD - *-32|*"-32 ") libsuff= shlibsuff= libmagic=32-bit;; - *-n32|*"-n32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; - *-64|*"-64 ") libsuff=64 shlibsuff=64 libmagic=64-bit;; - *) libsuff= shlibsuff= libmagic=never-match;; - esac - ;; - esac - shlibpath_var=LD_LIBRARY${shlibsuff}_PATH - shlibpath_overrides_runpath=no - sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" - sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" - ;; - -# No shared lib support for Linux oldld, aout, or coff. -linux-gnuoldld* | linux-gnuaout* | linux-gnucoff*) - dynamic_linker=no - ;; - -# This must be Linux ELF. -linux-gnu*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' - soname_spec='${libname}${release}.so$major' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - # This implies no fast_install, which is unacceptable. - # Some rework will be needed to allow for fast_install - # before this can be enabled. - hardcode_into_libs=yes - - # We used to test for /lib/ld.so.1 and disable shared libraries on - # powerpc, because MkLinux only supported shared libraries with the - # GNU dynamic linker. Since this was broken with cross compilers, - # most powerpc-linux boxes support dynamic linking these days and - # people can always --disable-shared, the test was removed, and we - # assume the GNU/Linux dynamic linker is in use. - dynamic_linker='GNU/Linux ld.so' - ;; - -netbsd*) - version_type=sunos - need_lib_prefix=no - need_version=no - if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then - library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' - dynamic_linker='NetBSD (a.out) ld.so' - else - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so ${libname}.so' - soname_spec='${libname}${release}.so$major' - dynamic_linker='NetBSD ld.elf_so' - fi - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - -newsos6) - version_type=linux - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - ;; - -openbsd*) - version_type=sunos - need_lib_prefix=no - need_version=no - if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - case "$host_os" in - openbsd2.[[89]] | openbsd2.[[89]].*) - shlibpath_overrides_runpath=no - ;; - *) - shlibpath_overrides_runpath=yes - ;; - esac - else - shlibpath_overrides_runpath=yes - fi - library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' - shlibpath_var=LD_LIBRARY_PATH - ;; - -os2*) - libname_spec='$name' - need_lib_prefix=no - library_names_spec='$libname.dll $libname.a' - dynamic_linker='OS/2 ld.exe' - shlibpath_var=LIBPATH - ;; - -osf3* | osf4* | osf5*) - version_type=osf - need_version=no - soname_spec='${libname}${release}.so' - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so' - shlibpath_var=LD_LIBRARY_PATH - sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" - sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" - ;; - -sco3.2v5*) - version_type=osf - soname_spec='${libname}${release}.so$major' - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' - shlibpath_var=LD_LIBRARY_PATH - ;; - -solaris*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' - soname_spec='${libname}${release}.so$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - # ldd complains unless libraries are executable - postinstall_cmds='chmod +x $lib' - ;; - -sunos4*) - version_type=sunos - library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix' - finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - if test "$with_gnu_ld" = yes; then - need_lib_prefix=no - fi - need_version=yes - ;; - -sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) - version_type=linux - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' - soname_spec='${libname}${release}.so$major' - shlibpath_var=LD_LIBRARY_PATH - case $host_vendor in - sni) - shlibpath_overrides_runpath=no - ;; - motorola) - need_lib_prefix=no - need_version=no - shlibpath_overrides_runpath=no - sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' - ;; - esac - ;; - -uts4*) - version_type=linux - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' - soname_spec='${libname}${release}.so$major' - shlibpath_var=LD_LIBRARY_PATH - ;; - -dgux*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' - soname_spec='${libname}${release}.so$major' - shlibpath_var=LD_LIBRARY_PATH - ;; - -sysv4*MP*) - if test -d /usr/nec ;then - version_type=linux - library_names_spec='$libname.so.$versuffix $libname.so.$major $libname.so' - soname_spec='$libname.so.$major' - shlibpath_var=LD_LIBRARY_PATH - fi - ;; - -*) - dynamic_linker=no - ;; -esac -AC_MSG_RESULT([$dynamic_linker]) -test "$dynamic_linker" = no && can_build_shared=no -## -## END FIXME - -## FIXME: this should be a separate macro -## -# Report the final consequences. -AC_MSG_CHECKING([if libtool supports shared libraries]) -AC_MSG_RESULT([$can_build_shared]) -## -## END FIXME - -## FIXME: this should be a separate macro -## -AC_MSG_CHECKING([whether to build shared libraries]) -test "$can_build_shared" = "no" && enable_shared=no - -# On AIX, shared libraries and static libraries use the same namespace, and -# are all built from PIC. -case "$host_os" in -aix3*) - test "$enable_shared" = yes && enable_static=no - if test -n "$RANLIB"; then - archive_cmds="$archive_cmds~\$RANLIB \$lib" - postinstall_cmds='$RANLIB $lib' - fi - ;; - -aix4*) - if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then - test "$enable_shared" = yes && enable_static=no - fi - ;; -esac -AC_MSG_RESULT([$enable_shared]) -## -## END FIXME - -## FIXME: this should be a separate macro -## -AC_MSG_CHECKING([whether to build static libraries]) -# Make sure either enable_shared or enable_static is yes. -test "$enable_shared" = yes || enable_static=yes -AC_MSG_RESULT([$enable_static]) -## -## END FIXME - -if test "$hardcode_action" = relink; then - # Fast installation is not supported - enable_fast_install=no -elif test "$shlibpath_overrides_runpath" = yes || - test "$enable_shared" = no; then - # Fast installation is not necessary - enable_fast_install=needless -fi - -variables_saved_for_relink="PATH $shlibpath_var $runpath_var" -if test "$GCC" = yes; then - variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" -fi - -AC_LIBTOOL_DLOPEN_SELF - -## FIXME: this should be a separate macro -## -if test "$enable_shared" = yes && test "$GCC" = yes; then - case $archive_cmds in - *'~'*) - # FIXME: we may have to deal with multi-command sequences. - ;; - '$CC '*) - # Test whether the compiler implicitly links with -lc since on some - # systems, -lgcc has to come before -lc. If gcc already passes -lc - # to ld, don't add -lc before -lgcc. - AC_MSG_CHECKING([whether -lc should be explicitly linked in]) - AC_CACHE_VAL([lt_cv_archive_cmds_need_lc], - [$rm conftest* - echo 'static int dummy;' > conftest.$ac_ext - - if AC_TRY_EVAL(ac_compile); then - soname=conftest - lib=conftest - libobjs=conftest.$ac_objext - deplibs= - wl=$lt_cv_prog_cc_wl - compiler_flags=-v - linker_flags=-v - verstring= - output_objdir=. - libname=conftest - save_allow_undefined_flag=$allow_undefined_flag - allow_undefined_flag= - if AC_TRY_EVAL(archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) - then - lt_cv_archive_cmds_need_lc=no - else - lt_cv_archive_cmds_need_lc=yes - fi - allow_undefined_flag=$save_allow_undefined_flag - else - cat conftest.err 1>&5 - fi]) - AC_MSG_RESULT([$lt_cv_archive_cmds_need_lc]) - ;; - esac -fi -need_lc=${lt_cv_archive_cmds_need_lc-yes} -## -## END FIXME - -## FIXME: this should be a separate macro -## -# The second clause should only fire when bootstrapping the -# libtool distribution, otherwise you forgot to ship ltmain.sh -# with your package, and you will get complaints that there are -# no rules to generate ltmain.sh. -if test -f "$ltmain"; then - : -else - # If there is no Makefile yet, we rely on a make rule to execute - # `config.status --recheck' to rerun these tests and create the - # libtool script then. - test -f Makefile && make "$ltmain" -fi - -if test -f "$ltmain"; then - trap "$rm \"${ofile}T\"; exit 1" 1 2 15 - $rm -f "${ofile}T" - - echo creating $ofile - - # Now quote all the things that may contain metacharacters while being - # careful not to overquote the AC_SUBSTed values. We take copies of the - # variables and quote the copies for generation of the libtool script. - for var in echo old_CC old_CFLAGS \ - AR AR_FLAGS CC LD LN_S NM SHELL \ - reload_flag reload_cmds wl \ - pic_flag link_static_flag no_builtin_flag export_dynamic_flag_spec \ - thread_safe_flag_spec whole_archive_flag_spec libname_spec \ - library_names_spec soname_spec \ - RANLIB old_archive_cmds old_archive_from_new_cmds old_postinstall_cmds \ - old_postuninstall_cmds archive_cmds archive_expsym_cmds postinstall_cmds \ - postuninstall_cmds extract_expsyms_cmds old_archive_from_expsyms_cmds \ - old_striplib striplib file_magic_cmd export_symbols_cmds \ - deplibs_check_method allow_undefined_flag no_undefined_flag \ - finish_cmds finish_eval global_symbol_pipe global_symbol_to_cdecl \ - global_symbol_to_c_name_address \ - hardcode_libdir_flag_spec hardcode_libdir_separator \ - sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ - compiler_c_o compiler_o_lo need_locks exclude_expsyms include_expsyms; do - - case $var in - reload_cmds | old_archive_cmds | old_archive_from_new_cmds | \ - old_postinstall_cmds | old_postuninstall_cmds | \ - export_symbols_cmds | archive_cmds | archive_expsym_cmds | \ - extract_expsyms_cmds | old_archive_from_expsyms_cmds | \ - postinstall_cmds | postuninstall_cmds | \ - finish_cmds | sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) - # Double-quote double-evaled strings. - eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" - ;; - *) - eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" - ;; - esac - done - - cat <<__EOF__ > "${ofile}T" -#! $SHELL - -# `$echo "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. -# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP) -# NOTE: Changes made to this file will be lost: look at ltmain.sh. -# -# Copyright (C) 1996-2000 Free Software Foundation, Inc. -# Originally by Gordon Matzigkeit , 1996 -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - -# Sed that helps us avoid accidentally triggering echo(1) options like -n. -Xsed="sed -e s/^X//" - -# The HP-UX ksh and POSIX shell print the target directory to stdout -# if CDPATH is set. -if test "X\${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi - -# ### BEGIN LIBTOOL CONFIG - -# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: - -# Shell to use when invoking shell scripts. -SHELL=$lt_SHELL - -# Whether or not to build shared libraries. -build_libtool_libs=$enable_shared - -# Whether or not to build static libraries. -build_old_libs=$enable_static - -# Whether or not to add -lc for building shared libraries. -build_libtool_need_lc=$need_lc - -# Whether or not to optimize for fast installation. -fast_install=$enable_fast_install - -# The host system. -host_alias=$host_alias -host=$host - -# An echo program that does not interpret backslashes. -echo=$lt_echo - -# The archiver. -AR=$lt_AR -AR_FLAGS=$lt_AR_FLAGS - -# The default C compiler. -CC=$lt_CC - -# Is the compiler the GNU C compiler? -with_gcc=$GCC - -# The linker used to build libraries. -LD=$lt_LD - -# Whether we need hard or soft links. -LN_S=$lt_LN_S - -# A BSD-compatible nm program. -NM=$lt_NM - -# A symbol stripping program -STRIP=$STRIP - -# Used to examine libraries when file_magic_cmd begins "file" -MAGIC_CMD=$MAGIC_CMD - -# Used on cygwin: DLL creation program. -DLLTOOL="$DLLTOOL" - -# Used on cygwin: object dumper. -OBJDUMP="$OBJDUMP" - -# Used on cygwin: assembler. -AS="$AS" - -# The name of the directory that contains temporary libtool files. -objdir=$objdir - -# How to create reloadable object files. -reload_flag=$lt_reload_flag -reload_cmds=$lt_reload_cmds - -# How to pass a linker flag through the compiler. -wl=$lt_wl - -# Object file suffix (normally "o"). -objext="$ac_objext" - -# Old archive suffix (normally "a"). -libext="$libext" - -# Executable file suffix (normally ""). -exeext="$exeext" - -# Additional compiler flags for building library objects. -pic_flag=$lt_pic_flag -pic_mode=$pic_mode - -# Does compiler simultaneously support -c and -o options? -compiler_c_o=$lt_compiler_c_o - -# Can we write directly to a .lo ? -compiler_o_lo=$lt_compiler_o_lo - -# Must we lock files when doing compilation ? -need_locks=$lt_need_locks - -# Do we need the lib prefix for modules? -need_lib_prefix=$need_lib_prefix - -# Do we need a version for libraries? -need_version=$need_version - -# Whether dlopen is supported. -dlopen_support=$enable_dlopen - -# Whether dlopen of programs is supported. -dlopen_self=$enable_dlopen_self - -# Whether dlopen of statically linked programs is supported. -dlopen_self_static=$enable_dlopen_self_static - -# Compiler flag to prevent dynamic linking. -link_static_flag=$lt_link_static_flag - -# Compiler flag to turn off builtin functions. -no_builtin_flag=$lt_no_builtin_flag - -# Compiler flag to allow reflexive dlopens. -export_dynamic_flag_spec=$lt_export_dynamic_flag_spec - -# Compiler flag to generate shared objects directly from archives. -whole_archive_flag_spec=$lt_whole_archive_flag_spec - -# Compiler flag to generate thread-safe objects. -thread_safe_flag_spec=$lt_thread_safe_flag_spec - -# Library versioning type. -version_type=$version_type - -# Format of library name prefix. -libname_spec=$lt_libname_spec - -# List of archive names. First name is the real one, the rest are links. -# The last name is the one that the linker finds with -lNAME. -library_names_spec=$lt_library_names_spec - -# The coded name of the library, if different from the real name. -soname_spec=$lt_soname_spec - -# Commands used to build and install an old-style archive. -RANLIB=$lt_RANLIB -old_archive_cmds=$lt_old_archive_cmds -old_postinstall_cmds=$lt_old_postinstall_cmds -old_postuninstall_cmds=$lt_old_postuninstall_cmds - -# Create an old-style archive from a shared archive. -old_archive_from_new_cmds=$lt_old_archive_from_new_cmds - -# Create a temporary old-style archive to link instead of a shared archive. -old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds - -# Commands used to build and install a shared archive. -archive_cmds=$lt_archive_cmds -archive_expsym_cmds=$lt_archive_expsym_cmds -postinstall_cmds=$lt_postinstall_cmds -postuninstall_cmds=$lt_postuninstall_cmds - -# Commands to strip libraries. -old_striplib=$lt_old_striplib -striplib=$lt_striplib - -# Method to check whether dependent libraries are shared objects. -deplibs_check_method=$lt_deplibs_check_method - -# Command to use when deplibs_check_method == file_magic. -file_magic_cmd=$lt_file_magic_cmd - -# Flag that allows shared libraries with undefined symbols to be built. -allow_undefined_flag=$lt_allow_undefined_flag - -# Flag that forces no undefined symbols. -no_undefined_flag=$lt_no_undefined_flag - -# Commands used to finish a libtool library installation in a directory. -finish_cmds=$lt_finish_cmds - -# Same as above, but a single script fragment to be evaled but not shown. -finish_eval=$lt_finish_eval - -# Take the output of nm and produce a listing of raw symbols and C names. -global_symbol_pipe=$lt_global_symbol_pipe - -# Transform the output of nm in a proper C declaration -global_symbol_to_cdecl=$lt_global_symbol_to_cdecl - -# Transform the output of nm in a C name address pair -global_symbol_to_c_name_address=$lt_global_symbol_to_c_name_address - -# This is the shared library runtime path variable. -runpath_var=$runpath_var - -# This is the shared library path variable. -shlibpath_var=$shlibpath_var - -# Is shlibpath searched before the hard-coded library search path? -shlibpath_overrides_runpath=$shlibpath_overrides_runpath - -# How to hardcode a shared library path into an executable. -hardcode_action=$hardcode_action - -# Whether we should hardcode library paths into libraries. -hardcode_into_libs=$hardcode_into_libs - -# Flag to hardcode \$libdir into a binary during linking. -# This must work even if \$libdir does not exist. -hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec - -# Whether we need a single -rpath flag with a separated argument. -hardcode_libdir_separator=$lt_hardcode_libdir_separator - -# Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the -# resulting binary. -hardcode_direct=$hardcode_direct - -# Set to yes if using the -LDIR flag during linking hardcodes DIR into the -# resulting binary. -hardcode_minus_L=$hardcode_minus_L - -# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into -# the resulting binary. -hardcode_shlibpath_var=$hardcode_shlibpath_var - -# Variables whose values should be saved in libtool wrapper scripts and -# restored at relink time. -variables_saved_for_relink="$variables_saved_for_relink" - -# Whether libtool must link a program against all its dependency libraries. -link_all_deplibs=$link_all_deplibs - -# Compile-time system search path for libraries -sys_lib_search_path_spec=$lt_sys_lib_search_path_spec - -# Run-time system search path for libraries -sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec - -# Fix the shell variable \$srcfile for the compiler. -fix_srcfile_path="$fix_srcfile_path" - -# Set to yes if exported symbols are required. -always_export_symbols=$always_export_symbols - -# The commands to list exported symbols. -export_symbols_cmds=$lt_export_symbols_cmds - -# The commands to extract the exported symbol list from a shared archive. -extract_expsyms_cmds=$lt_extract_expsyms_cmds - -# Symbols that should not be listed in the preloaded symbols. -exclude_expsyms=$lt_exclude_expsyms - -# Symbols that must always be exported. -include_expsyms=$lt_include_expsyms - -# ### END LIBTOOL CONFIG - -__EOF__ - - case $host_os in - aix3*) - cat <<\EOF >> "${ofile}T" - -# AIX sometimes has problems with the GCC collect2 program. For some -# reason, if we set the COLLECT_NAMES environment variable, the problems -# vanish in a puff of smoke. -if test "X${COLLECT_NAMES+set}" != Xset; then - COLLECT_NAMES= - export COLLECT_NAMES -fi -EOF - ;; - esac - - case $host_os in - cygwin* | mingw* | pw32* | os2*) - cat <<'EOF' >> "${ofile}T" - # This is a source program that is used to create dlls on Windows - # Don't remove nor modify the starting and closing comments -# /* ltdll.c starts here */ -# #define WIN32_LEAN_AND_MEAN -# #include -# #undef WIN32_LEAN_AND_MEAN -# #include -# -# #ifndef __CYGWIN__ -# # ifdef __CYGWIN32__ -# # define __CYGWIN__ __CYGWIN32__ -# # endif -# #endif -# -# #ifdef __cplusplus -# extern "C" { -# #endif -# BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved); -# #ifdef __cplusplus -# } -# #endif -# -# #ifdef __CYGWIN__ -# #include -# DECLARE_CYGWIN_DLL( DllMain ); -# #endif -# HINSTANCE __hDllInstance_base; -# -# BOOL APIENTRY -# DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved) -# { -# __hDllInstance_base = hInst; -# return TRUE; -# } -# /* ltdll.c ends here */ - # This is a source program that is used to create import libraries - # on Windows for dlls which lack them. Don't remove nor modify the - # starting and closing comments -# /* impgen.c starts here */ -# /* Copyright (C) 1999-2000 Free Software Foundation, Inc. -# -# This file is part of GNU libtool. -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# */ -# -# #include /* for printf() */ -# #include /* for open(), lseek(), read() */ -# #include /* for O_RDONLY, O_BINARY */ -# #include /* for strdup() */ -# -# /* O_BINARY isn't required (or even defined sometimes) under Unix */ -# #ifndef O_BINARY -# #define O_BINARY 0 -# #endif -# -# static unsigned int -# pe_get16 (fd, offset) -# int fd; -# int offset; -# { -# unsigned char b[2]; -# lseek (fd, offset, SEEK_SET); -# read (fd, b, 2); -# return b[0] + (b[1]<<8); -# } -# -# static unsigned int -# pe_get32 (fd, offset) -# int fd; -# int offset; -# { -# unsigned char b[4]; -# lseek (fd, offset, SEEK_SET); -# read (fd, b, 4); -# return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24); -# } -# -# static unsigned int -# pe_as32 (ptr) -# void *ptr; -# { -# unsigned char *b = ptr; -# return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24); -# } -# -# int -# main (argc, argv) -# int argc; -# char *argv[]; -# { -# int dll; -# unsigned long pe_header_offset, opthdr_ofs, num_entries, i; -# unsigned long export_rva, export_size, nsections, secptr, expptr; -# unsigned long name_rvas, nexp; -# unsigned char *expdata, *erva; -# char *filename, *dll_name; -# -# filename = argv[1]; -# -# dll = open(filename, O_RDONLY|O_BINARY); -# if (dll < 1) -# return 1; -# -# dll_name = filename; -# -# for (i=0; filename[i]; i++) -# if (filename[i] == '/' || filename[i] == '\\' || filename[i] == ':') -# dll_name = filename + i +1; -# -# pe_header_offset = pe_get32 (dll, 0x3c); -# opthdr_ofs = pe_header_offset + 4 + 20; -# num_entries = pe_get32 (dll, opthdr_ofs + 92); -# -# if (num_entries < 1) /* no exports */ -# return 1; -# -# export_rva = pe_get32 (dll, opthdr_ofs + 96); -# export_size = pe_get32 (dll, opthdr_ofs + 100); -# nsections = pe_get16 (dll, pe_header_offset + 4 +2); -# secptr = (pe_header_offset + 4 + 20 + -# pe_get16 (dll, pe_header_offset + 4 + 16)); -# -# expptr = 0; -# for (i = 0; i < nsections; i++) -# { -# char sname[8]; -# unsigned long secptr1 = secptr + 40 * i; -# unsigned long vaddr = pe_get32 (dll, secptr1 + 12); -# unsigned long vsize = pe_get32 (dll, secptr1 + 16); -# unsigned long fptr = pe_get32 (dll, secptr1 + 20); -# lseek(dll, secptr1, SEEK_SET); -# read(dll, sname, 8); -# if (vaddr <= export_rva && vaddr+vsize > export_rva) -# { -# expptr = fptr + (export_rva - vaddr); -# if (export_rva + export_size > vaddr + vsize) -# export_size = vsize - (export_rva - vaddr); -# break; -# } -# } -# -# expdata = (unsigned char*)malloc(export_size); -# lseek (dll, expptr, SEEK_SET); -# read (dll, expdata, export_size); -# erva = expdata - export_rva; -# -# nexp = pe_as32 (expdata+24); -# name_rvas = pe_as32 (expdata+32); -# -# printf ("EXPORTS\n"); -# for (i = 0; i> "${ofile}T" || (rm -f "${ofile}T"; exit 1) - - mv -f "${ofile}T" "$ofile" || \ - (rm -f "$ofile" && cp "${ofile}T" "$ofile" && rm -f "${ofile}T") - chmod +x "$ofile" -fi -## -## END FIXME - -])# _LT_AC_LTCONFIG_HACK - -# AC_LIBTOOL_DLOPEN - enable checks for dlopen support -AC_DEFUN([AC_LIBTOOL_DLOPEN], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])]) - -# AC_LIBTOOL_WIN32_DLL - declare package support for building win32 dll's -AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [AC_BEFORE([$0], [AC_LIBTOOL_SETUP])]) - -# AC_ENABLE_SHARED - implement the --enable-shared flag -# Usage: AC_ENABLE_SHARED[(DEFAULT)] -# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to -# `yes'. -AC_DEFUN([AC_ENABLE_SHARED], -[define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl -AC_ARG_ENABLE(shared, -changequote(<<, >>)dnl -<< --enable-shared[=PKGS] build shared libraries [default=>>AC_ENABLE_SHARED_DEFAULT], -changequote([, ])dnl -[p=${PACKAGE-default} -case $enableval in -yes) enable_shared=yes ;; -no) enable_shared=no ;; -*) - enable_shared=no - # Look at the argument we got. We use all the common list separators. - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:," - for pkg in $enableval; do - if test "X$pkg" = "X$p"; then - enable_shared=yes - fi - done - IFS="$ac_save_ifs" - ;; -esac], -enable_shared=AC_ENABLE_SHARED_DEFAULT)dnl -]) - -# AC_DISABLE_SHARED - set the default shared flag to --disable-shared -AC_DEFUN([AC_DISABLE_SHARED], -[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl -AC_ENABLE_SHARED(no)]) - -# AC_ENABLE_STATIC - implement the --enable-static flag -# Usage: AC_ENABLE_STATIC[(DEFAULT)] -# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to -# `yes'. -AC_DEFUN([AC_ENABLE_STATIC], -[define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl -AC_ARG_ENABLE(static, -changequote(<<, >>)dnl -<< --enable-static[=PKGS] build static libraries [default=>>AC_ENABLE_STATIC_DEFAULT], -changequote([, ])dnl -[p=${PACKAGE-default} -case $enableval in -yes) enable_static=yes ;; -no) enable_static=no ;; -*) - enable_static=no - # Look at the argument we got. We use all the common list separators. - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:," - for pkg in $enableval; do - if test "X$pkg" = "X$p"; then - enable_static=yes - fi - done - IFS="$ac_save_ifs" - ;; -esac], -enable_static=AC_ENABLE_STATIC_DEFAULT)dnl -]) - -# AC_DISABLE_STATIC - set the default static flag to --disable-static -AC_DEFUN([AC_DISABLE_STATIC], -[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl -AC_ENABLE_STATIC(no)]) - - -# AC_ENABLE_FAST_INSTALL - implement the --enable-fast-install flag -# Usage: AC_ENABLE_FAST_INSTALL[(DEFAULT)] -# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to -# `yes'. -AC_DEFUN([AC_ENABLE_FAST_INSTALL], -[define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl -AC_ARG_ENABLE(fast-install, -changequote(<<, >>)dnl -<< --enable-fast-install[=PKGS] optimize for fast installation [default=>>AC_ENABLE_FAST_INSTALL_DEFAULT], -changequote([, ])dnl -[p=${PACKAGE-default} -case $enableval in -yes) enable_fast_install=yes ;; -no) enable_fast_install=no ;; -*) - enable_fast_install=no - # Look at the argument we got. We use all the common list separators. - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:," - for pkg in $enableval; do - if test "X$pkg" = "X$p"; then - enable_fast_install=yes - fi - done - IFS="$ac_save_ifs" - ;; -esac], -enable_fast_install=AC_ENABLE_FAST_INSTALL_DEFAULT)dnl -]) - -# AC_DISABLE_FAST_INSTALL - set the default to --disable-fast-install -AC_DEFUN([AC_DISABLE_FAST_INSTALL], -[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl -AC_ENABLE_FAST_INSTALL(no)]) - -# AC_LIBTOOL_PICMODE - implement the --with-pic flag -# Usage: AC_LIBTOOL_PICMODE[(MODE)] -# Where MODE is either `yes' or `no'. If omitted, it defaults to -# `both'. -AC_DEFUN([AC_LIBTOOL_PICMODE], -[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl -pic_mode=ifelse($#,1,$1,default)]) - - -# AC_PATH_TOOL_PREFIX - find a file program which can recognise shared library -AC_DEFUN([AC_PATH_TOOL_PREFIX], -[AC_MSG_CHECKING([for $1]) -AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, -[case $MAGIC_CMD in - /*) - lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. - ;; - ?:/*) - lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a dos path. - ;; - *) - ac_save_MAGIC_CMD="$MAGIC_CMD" - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" -dnl $ac_dummy forces splitting on constant user-supplied paths. -dnl POSIX.2 word splitting is done only on the output of word expansions, -dnl not every word. This closes a longstanding sh security hole. - ac_dummy="ifelse([$2], , $PATH, [$2])" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$1; then - lt_cv_path_MAGIC_CMD="$ac_dir/$1" - if test -n "$file_magic_test_file"; then - case $deplibs_check_method in - "file_magic "*) - file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`" - MAGIC_CMD="$lt_cv_path_MAGIC_CMD" - if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | - egrep "$file_magic_regex" > /dev/null; then - : - else - cat <&2 - -*** Warning: the command libtool uses to detect shared libraries, -*** $file_magic_cmd, produces output that libtool cannot recognize. -*** The result is that libtool may fail to recognize shared libraries -*** as such. This will affect the creation of libtool libraries that -*** depend on shared libraries, but programs linked with such libtool -*** libraries will work regardless of this problem. Nevertheless, you -*** may want to report the problem to your system manager and/or to -*** bug-libtool@gnu.org - -EOF - fi ;; - esac - fi - break - fi - done - IFS="$ac_save_ifs" - MAGIC_CMD="$ac_save_MAGIC_CMD" - ;; -esac]) -MAGIC_CMD="$lt_cv_path_MAGIC_CMD" -if test -n "$MAGIC_CMD"; then - AC_MSG_RESULT($MAGIC_CMD) -else - AC_MSG_RESULT(no) -fi -]) - - -# AC_PATH_MAGIC - find a file program which can recognise a shared library -AC_DEFUN([AC_PATH_MAGIC], -[AC_REQUIRE([AC_CHECK_TOOL_PREFIX])dnl -AC_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin:$PATH) -if test -z "$lt_cv_path_MAGIC_CMD"; then - if test -n "$ac_tool_prefix"; then - AC_PATH_TOOL_PREFIX(file, /usr/bin:$PATH) - else - MAGIC_CMD=: - fi -fi -]) - - -# AC_PROG_LD - find the path to the GNU or non-GNU linker -AC_DEFUN([AC_PROG_LD], -[AC_ARG_WITH(gnu-ld, -[ --with-gnu-ld assume the C compiler uses GNU ld [default=no]], -test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no) -AC_REQUIRE([AC_PROG_CC])dnl -AC_REQUIRE([AC_CANONICAL_HOST])dnl -AC_REQUIRE([AC_CANONICAL_BUILD])dnl -AC_REQUIRE([_LT_AC_LIBTOOL_SYS_PATH_SEPARATOR])dnl -ac_prog=ld -if test "$GCC" = yes; then - # Check if gcc -print-prog-name=ld gives a path. - AC_MSG_CHECKING([for ld used by GCC]) - case $host in - *-*-mingw*) - # gcc leaves a trailing carriage return which upsets mingw - ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; - *) - ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; - esac - case $ac_prog in - # Accept absolute paths. - [[\\/]]* | [[A-Za-z]]:[[\\/]]*) - re_direlt='/[[^/]][[^/]]*/\.\./' - # Canonicalize the path of ld - ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'` - while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do - ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"` - done - test -z "$LD" && LD="$ac_prog" - ;; - "") - # If it fails, then pretend we aren't using GCC. - ac_prog=ld - ;; - *) - # If it is relative, then search for the first ld in PATH. - with_gnu_ld=unknown - ;; - esac -elif test "$with_gnu_ld" = yes; then - AC_MSG_CHECKING([for GNU ld]) -else - AC_MSG_CHECKING([for non-GNU ld]) -fi -AC_CACHE_VAL(lt_cv_path_LD, -[if test -z "$LD"; then - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=$PATH_SEPARATOR - for ac_dir in $PATH; do - test -z "$ac_dir" && ac_dir=. - if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then - lt_cv_path_LD="$ac_dir/$ac_prog" - # Check to see if the program is GNU ld. I'd rather use --version, - # but apparently some GNU ld's only accept -v. - # Break only if it was the GNU/non-GNU ld that we prefer. - if "$lt_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then - test "$with_gnu_ld" != no && break - else - test "$with_gnu_ld" != yes && break - fi - fi - done - IFS="$ac_save_ifs" -else - lt_cv_path_LD="$LD" # Let the user override the test with a path. -fi]) -LD="$lt_cv_path_LD" -if test -n "$LD"; then - AC_MSG_RESULT($LD) -else - AC_MSG_RESULT(no) -fi -test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH]) -AC_PROG_LD_GNU -]) - -# AC_PROG_LD_GNU - -AC_DEFUN([AC_PROG_LD_GNU], -[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld, -[# I'd rather use --version here, but apparently some GNU ld's only accept -v. -if $LD -v 2>&1 &5; then - lt_cv_prog_gnu_ld=yes -else - lt_cv_prog_gnu_ld=no -fi]) -with_gnu_ld=$lt_cv_prog_gnu_ld -]) - -# AC_PROG_LD_RELOAD_FLAG - find reload flag for linker -# -- PORTME Some linkers may need a different reload flag. -AC_DEFUN([AC_PROG_LD_RELOAD_FLAG], -[AC_CACHE_CHECK([for $LD option to reload object files], lt_cv_ld_reload_flag, -[lt_cv_ld_reload_flag='-r']) -reload_flag=$lt_cv_ld_reload_flag -test -n "$reload_flag" && reload_flag=" $reload_flag" -]) - -# AC_DEPLIBS_CHECK_METHOD - how to check for library dependencies -# -- PORTME fill in with the dynamic library characteristics -AC_DEFUN([AC_DEPLIBS_CHECK_METHOD], -[AC_CACHE_CHECK([how to recognise dependant libraries], -lt_cv_deplibs_check_method, -[lt_cv_file_magic_cmd='$MAGIC_CMD' -lt_cv_file_magic_test_file= -lt_cv_deplibs_check_method='unknown' -# Need to set the preceding variable on all platforms that support -# interlibrary dependencies. -# 'none' -- dependencies not supported. -# `unknown' -- same as none, but documents that we really don't know. -# 'pass_all' -- all dependencies passed with no checks. -# 'test_compile' -- check by making test program. -# 'file_magic [[regex]]' -- check by looking for files in library path -# which responds to the $file_magic_cmd with a given egrep regex. -# If you have `file' or equivalent on your system and you're not sure -# whether `pass_all' will *always* work, you probably want this one. - -case $host_os in -aix4* | aix5*) - lt_cv_deplibs_check_method=pass_all - ;; - -beos*) - lt_cv_deplibs_check_method=pass_all - ;; - -bsdi4*) - lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)' - lt_cv_file_magic_cmd='/usr/bin/file -L' - lt_cv_file_magic_test_file=/shlib/libc.so - ;; - -cygwin* | mingw* | pw32*) - lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' - lt_cv_file_magic_cmd='$OBJDUMP -f' - ;; - -darwin* | rhapsody*) - lt_cv_deplibs_check_method='file_magic Mach-O dynamically linked shared library' - lt_cv_file_magic_cmd='/usr/bin/file -L' - case "$host_os" in - rhapsody* | darwin1.[[012]]) - lt_cv_file_magic_test_file=`echo /System/Library/Frameworks/System.framework/Versions/*/System | head -1` - ;; - *) # Darwin 1.3 on - lt_cv_file_magic_test_file='/usr/lib/libSystem.dylib' - ;; - esac - ;; - -freebsd*) - if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then - case $host_cpu in - i*86 ) - # Not sure whether the presence of OpenBSD here was a mistake. - # Let's accept both of them until this is cleared up. - lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD)/i[[3-9]]86 (compact )?demand paged shared library' - lt_cv_file_magic_cmd=/usr/bin/file - lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` - ;; - esac - else - lt_cv_deplibs_check_method=pass_all - fi - ;; - -gnu*) - lt_cv_deplibs_check_method=pass_all - ;; - -hpux10.20*|hpux11*) - lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library' - lt_cv_file_magic_cmd=/usr/bin/file - lt_cv_file_magic_test_file=/usr/lib/libc.sl - ;; - -irix5* | irix6*) - case $host_os in - irix5*) - # this will be overridden with pass_all, but let us keep it just in case - lt_cv_deplibs_check_method="file_magic ELF 32-bit MSB dynamic lib MIPS - version 1" - ;; - *) - case $LD in - *-32|*"-32 ") libmagic=32-bit;; - *-n32|*"-n32 ") libmagic=N32;; - *-64|*"-64 ") libmagic=64-bit;; - *) libmagic=never-match;; - esac - # this will be overridden with pass_all, but let us keep it just in case - lt_cv_deplibs_check_method="file_magic ELF ${libmagic} MSB mips-[[1234]] dynamic lib MIPS - version 1" - ;; - esac - lt_cv_file_magic_test_file=`echo /lib${libsuff}/libc.so*` - lt_cv_deplibs_check_method=pass_all - ;; - -# This must be Linux ELF. -linux-gnu*) - case $host_cpu in - alpha* | hppa* | i*86 | powerpc* | sparc* | ia64* ) - lt_cv_deplibs_check_method=pass_all ;; - *) - # glibc up to 2.1.1 does not perform some relocations on ARM - lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' ;; - esac - lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so` - ;; - -netbsd*) - if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then - lt_cv_deplibs_check_method='match_pattern /lib[[^/\.]]+\.so\.[[0-9]]+\.[[0-9]]+$' - else - lt_cv_deplibs_check_method='match_pattern /lib[[^/\.]]+\.so$' - fi - ;; - -newos6*) - lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' - lt_cv_file_magic_cmd=/usr/bin/file - lt_cv_file_magic_test_file=/usr/lib/libnls.so - ;; - -openbsd*) - lt_cv_file_magic_cmd=/usr/bin/file - lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` - if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB shared object' - else - lt_cv_deplibs_check_method='file_magic OpenBSD.* shared library' - fi - ;; - -osf3* | osf4* | osf5*) - # this will be overridden with pass_all, but let us keep it just in case - lt_cv_deplibs_check_method='file_magic COFF format alpha shared library' - lt_cv_file_magic_test_file=/shlib/libc.so - lt_cv_deplibs_check_method=pass_all - ;; - -sco3.2v5*) - lt_cv_deplibs_check_method=pass_all - ;; - -solaris*) - lt_cv_deplibs_check_method=pass_all - lt_cv_file_magic_test_file=/lib/libc.so - ;; - -sysv5uw[[78]]* | sysv4*uw2*) - lt_cv_deplibs_check_method=pass_all - ;; - -sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) - case $host_vendor in - motorola) - lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]' - lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` - ;; - ncr) - lt_cv_deplibs_check_method=pass_all - ;; - sequent) - lt_cv_file_magic_cmd='/bin/file' - lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' - ;; - sni) - lt_cv_file_magic_cmd='/bin/file' - lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib" - lt_cv_file_magic_test_file=/lib/libc.so - ;; - esac - ;; -esac -]) -file_magic_cmd=$lt_cv_file_magic_cmd -deplibs_check_method=$lt_cv_deplibs_check_method -]) - - -# AC_PROG_NM - find the path to a BSD-compatible name lister -AC_DEFUN([AC_PROG_NM], -[AC_REQUIRE([_LT_AC_LIBTOOL_SYS_PATH_SEPARATOR])dnl -AC_MSG_CHECKING([for BSD-compatible nm]) -AC_CACHE_VAL(lt_cv_path_NM, -[if test -n "$NM"; then - # Let the user override the test. - lt_cv_path_NM="$NM" -else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=$PATH_SEPARATOR - for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do - test -z "$ac_dir" && ac_dir=. - tmp_nm=$ac_dir/${ac_tool_prefix}nm - if test -f $tmp_nm || test -f $tmp_nm$ac_exeext ; then - # Check to see if the nm accepts a BSD-compat flag. - # Adding the `sed 1q' prevents false positives on HP-UX, which says: - # nm: unknown option "B" ignored - # Tru64's nm complains that /dev/null is an invalid object file - if ($tmp_nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep '(/dev/null|Invalid file or object type)' >/dev/null; then - lt_cv_path_NM="$tmp_nm -B" - break - elif ($tmp_nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then - lt_cv_path_NM="$tmp_nm -p" - break - else - lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but - continue # so that we can try to find one that supports BSD flags - fi - fi - done - IFS="$ac_save_ifs" - test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm -fi]) -NM="$lt_cv_path_NM" -AC_MSG_RESULT([$NM]) -]) - -# AC_CHECK_LIBM - check for math library -AC_DEFUN([AC_CHECK_LIBM], -[AC_REQUIRE([AC_CANONICAL_HOST])dnl -LIBM= -case $host in -*-*-beos* | *-*-cygwin* | *-*-pw32*) - # These system don't have libm - ;; -*-ncr-sysv4.3*) - AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") - AC_CHECK_LIB(m, main, LIBM="$LIBM -lm") - ;; -*) - AC_CHECK_LIB(m, main, LIBM="-lm") - ;; -esac -]) - -# AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for -# the libltdl convenience library and INCLTDL to the include flags for -# the libltdl header and adds --enable-ltdl-convenience to the -# configure arguments. Note that LIBLTDL and INCLTDL are not -# AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called. If DIR is not -# provided, it is assumed to be `libltdl'. LIBLTDL will be prefixed -# with '${top_builddir}/' and INCLTDL will be prefixed with -# '${top_srcdir}/' (note the single quotes!). If your package is not -# flat and you're not using automake, define top_builddir and -# top_srcdir appropriately in the Makefiles. -AC_DEFUN([AC_LIBLTDL_CONVENIENCE], -[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl - case $enable_ltdl_convenience in - no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;; - "") enable_ltdl_convenience=yes - ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;; - esac - LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la - INCLTDL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl']) -]) - -# AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for -# the libltdl installable library and INCLTDL to the include flags for -# the libltdl header and adds --enable-ltdl-install to the configure -# arguments. Note that LIBLTDL and INCLTDL are not AC_SUBSTed, nor is -# AC_CONFIG_SUBDIRS called. If DIR is not provided and an installed -# libltdl is not found, it is assumed to be `libltdl'. LIBLTDL will -# be prefixed with '${top_builddir}/' and INCLTDL will be prefixed -# with '${top_srcdir}/' (note the single quotes!). If your package is -# not flat and you're not using automake, define top_builddir and -# top_srcdir appropriately in the Makefiles. -# In the future, this macro may have to be called after AC_PROG_LIBTOOL. -AC_DEFUN([AC_LIBLTDL_INSTALLABLE], -[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl - AC_CHECK_LIB(ltdl, main, - [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no], - [if test x"$enable_ltdl_install" = xno; then - AC_MSG_WARN([libltdl not installed, but installation disabled]) - else - enable_ltdl_install=yes - fi - ]) - if test x"$enable_ltdl_install" = x"yes"; then - ac_configure_args="$ac_configure_args --enable-ltdl-install" - LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la - INCLTDL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl']) - else - ac_configure_args="$ac_configure_args --enable-ltdl-install=no" - LIBLTDL="-lltdl" - INCLTDL= - fi -]) - -# old names -AC_DEFUN([AM_PROG_LIBTOOL], [AC_PROG_LIBTOOL]) -AC_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) -AC_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) -AC_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) -AC_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) -AC_DEFUN([AM_PROG_LD], [AC_PROG_LD]) -AC_DEFUN([AM_PROG_NM], [AC_PROG_NM]) - -# This is just to silence aclocal about the macro not being used -ifelse([AC_DISABLE_FAST_INSTALL]) diff --git a/wxWidgets/src/expat/conftools/ltmain.sh b/wxWidgets/src/expat/conftools/ltmain.sh deleted file mode 100644 index 6e5bf3657c..0000000000 --- a/wxWidgets/src/expat/conftools/ltmain.sh +++ /dev/null @@ -1,4984 +0,0 @@ -# ltmain.sh - Provide generalized library-building support services. -# NOTE: Changing this file will not affect anything until you rerun configure. -# -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001 -# Free Software Foundation, Inc. -# Originally by Gordon Matzigkeit , 1996 -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - -# Check that we have a working $echo. -if test "X$1" = X--no-reexec; then - # Discard the --no-reexec flag, and continue. - shift -elif test "X$1" = X--fallback-echo; then - # Avoid inline document here, it may be left over - : -elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then - # Yippee, $echo works! - : -else - # Restart under the correct shell, and then maybe $echo will work. - exec $SHELL "$0" --no-reexec ${1+"$@"} -fi - -if test "X$1" = X--fallback-echo; then - # used as fallback echo - shift - cat <&2 - echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 - exit 1 -fi - -# Global variables. -mode=$default_mode -nonopt= -prev= -prevopt= -run= -show="$echo" -show_help= -execute_dlfiles= -lo2o="s/\\.lo\$/.${objext}/" -o2lo="s/\\.${objext}\$/.lo/" - -# Parse our command line options once, thoroughly. -while test $# -gt 0 -do - arg="$1" - shift - - case $arg in - -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;; - *) optarg= ;; - esac - - # If the previous option needs an argument, assign it. - if test -n "$prev"; then - case $prev in - execute_dlfiles) - execute_dlfiles="$execute_dlfiles $arg" - ;; - *) - eval "$prev=\$arg" - ;; - esac - - prev= - prevopt= - continue - fi - - # Have we seen a non-optional argument yet? - case $arg in - --help) - show_help=yes - ;; - - --version) - echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP" - exit 0 - ;; - - --config) - sed -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $0 - exit 0 - ;; - - --debug) - echo "$progname: enabling shell trace mode" - set -x - ;; - - --dry-run | -n) - run=: - ;; - - --features) - echo "host: $host" - if test "$build_libtool_libs" = yes; then - echo "enable shared libraries" - else - echo "disable shared libraries" - fi - if test "$build_old_libs" = yes; then - echo "enable static libraries" - else - echo "disable static libraries" - fi - exit 0 - ;; - - --finish) mode="finish" ;; - - --mode) prevopt="--mode" prev=mode ;; - --mode=*) mode="$optarg" ;; - - --quiet | --silent) - show=: - ;; - - -dlopen) - prevopt="-dlopen" - prev=execute_dlfiles - ;; - - -*) - $echo "$modename: unrecognized option \`$arg'" 1>&2 - $echo "$help" 1>&2 - exit 1 - ;; - - *) - nonopt="$arg" - break - ;; - esac -done - -if test -n "$prevopt"; then - $echo "$modename: option \`$prevopt' requires an argument" 1>&2 - $echo "$help" 1>&2 - exit 1 -fi - -# If this variable is set in any of the actions, the command in it -# will be execed at the end. This prevents here-documents from being -# left over by shells. -exec_cmd= - -if test -z "$show_help"; then - - # Infer the operation mode. - if test -z "$mode"; then - case $nonopt in - *cc | *++ | gcc* | *-gcc*) - mode=link - for arg - do - case $arg in - -c) - mode=compile - break - ;; - esac - done - ;; - *db | *dbx | *strace | *truss) - mode=execute - ;; - *install*|cp|mv) - mode=install - ;; - *rm) - mode=uninstall - ;; - *) - # If we have no mode, but dlfiles were specified, then do execute mode. - test -n "$execute_dlfiles" && mode=execute - - # Just use the default operation mode. - if test -z "$mode"; then - if test -n "$nonopt"; then - $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2 - else - $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2 - fi - fi - ;; - esac - fi - - # Only execute mode is allowed to have -dlopen flags. - if test -n "$execute_dlfiles" && test "$mode" != execute; then - $echo "$modename: unrecognized option \`-dlopen'" 1>&2 - $echo "$help" 1>&2 - exit 1 - fi - - # Change the help message to a mode-specific one. - generic_help="$help" - help="Try \`$modename --help --mode=$mode' for more information." - - # These modes are in order of execution frequency so that they run quickly. - case $mode in - # libtool compile mode - compile) - modename="$modename: compile" - # Get the compilation command and the source file. - base_compile= - prev= - lastarg= - srcfile="$nonopt" - suppress_output= - - user_target=no - for arg - do - case $prev in - "") ;; - xcompiler) - # Aesthetically quote the previous argument. - prev= - lastarg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` - - case $arg in - # Double-quote args containing other shell metacharacters. - # Many Bourne shells cannot handle close brackets correctly - # in scan sets, so we specify it separately. - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - arg="\"$arg\"" - ;; - esac - - # Add the previous argument to base_compile. - if test -z "$base_compile"; then - base_compile="$lastarg" - else - base_compile="$base_compile $lastarg" - fi - continue - ;; - esac - - # Accept any command-line options. - case $arg in - -o) - if test "$user_target" != "no"; then - $echo "$modename: you cannot specify \`-o' more than once" 1>&2 - exit 1 - fi - user_target=next - ;; - - -static) - build_old_libs=yes - continue - ;; - - -prefer-pic) - pic_mode=yes - continue - ;; - - -prefer-non-pic) - pic_mode=no - continue - ;; - - -Xcompiler) - prev=xcompiler - continue - ;; - - -Wc,*) - args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"` - lastarg= - save_ifs="$IFS"; IFS=',' - for arg in $args; do - IFS="$save_ifs" - - # Double-quote args containing other shell metacharacters. - # Many Bourne shells cannot handle close brackets correctly - # in scan sets, so we specify it separately. - case $arg in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - arg="\"$arg\"" - ;; - esac - lastarg="$lastarg $arg" - done - IFS="$save_ifs" - lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"` - - # Add the arguments to base_compile. - if test -z "$base_compile"; then - base_compile="$lastarg" - else - base_compile="$base_compile $lastarg" - fi - continue - ;; - esac - - case $user_target in - next) - # The next one is the -o target name - user_target=yes - continue - ;; - yes) - # We got the output file - user_target=set - libobj="$arg" - continue - ;; - esac - - # Accept the current argument as the source file. - lastarg="$srcfile" - srcfile="$arg" - - # Aesthetically quote the previous argument. - - # Backslashify any backslashes, double quotes, and dollar signs. - # These are the only characters that are still specially - # interpreted inside of double-quoted scrings. - lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"` - - # Double-quote args containing other shell metacharacters. - # Many Bourne shells cannot handle close brackets correctly - # in scan sets, so we specify it separately. - case $lastarg in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - lastarg="\"$lastarg\"" - ;; - esac - - # Add the previous argument to base_compile. - if test -z "$base_compile"; then - base_compile="$lastarg" - else - base_compile="$base_compile $lastarg" - fi - done - - case $user_target in - set) - ;; - no) - # Get the name of the library object. - libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'` - ;; - *) - $echo "$modename: you must specify a target with \`-o'" 1>&2 - exit 1 - ;; - esac - - # Recognize several different file suffixes. - # If the user specifies -o file.o, it is replaced with file.lo - xform='[cCFSfmso]' - case $libobj in - *.ada) xform=ada ;; - *.adb) xform=adb ;; - *.ads) xform=ads ;; - *.asm) xform=asm ;; - *.c++) xform=c++ ;; - *.cc) xform=cc ;; - *.cpp) xform=cpp ;; - *.cxx) xform=cxx ;; - *.f90) xform=f90 ;; - *.for) xform=for ;; - esac - - libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"` - - case $libobj in - *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;; - *) - $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2 - exit 1 - ;; - esac - - if test -z "$base_compile"; then - $echo "$modename: you must specify a compilation command" 1>&2 - $echo "$help" 1>&2 - exit 1 - fi - - # Delete any leftover library objects. - if test "$build_old_libs" = yes; then - removelist="$obj $libobj" - else - removelist="$libobj" - fi - - $run $rm $removelist - trap "$run $rm $removelist; exit 1" 1 2 15 - - # On Cygwin there's no "real" PIC flag so we must build both object types - case $host_os in - cygwin* | mingw* | pw32* | os2*) - pic_mode=default - ;; - esac - if test $pic_mode = no && test "$deplibs_check_method" != pass_all; then - # non-PIC code in shared libraries is not supported - pic_mode=default - fi - - # Calculate the filename of the output object if compiler does - # not support -o with -c - if test "$compiler_c_o" = no; then - output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext} - lockfile="$output_obj.lock" - removelist="$removelist $output_obj $lockfile" - trap "$run $rm $removelist; exit 1" 1 2 15 - else - need_locks=no - lockfile= - fi - - # Lock this critical section if it is needed - # We use this script file to make the link, it avoids creating a new file - if test "$need_locks" = yes; then - until $run ln "$0" "$lockfile" 2>/dev/null; do - $show "Waiting for $lockfile to be removed" - sleep 2 - done - elif test "$need_locks" = warn; then - if test -f "$lockfile"; then - echo "\ -*** ERROR, $lockfile exists and contains: -`cat $lockfile 2>/dev/null` - -This indicates that another process is trying to use the same -temporary object file, and libtool could not work around it because -your compiler does not support \`-c' and \`-o' together. If you -repeat this compilation, it may succeed, by chance, but you had better -avoid parallel builds (make -j) in this platform, or get a better -compiler." - - $run $rm $removelist - exit 1 - fi - echo $srcfile > "$lockfile" - fi - - if test -n "$fix_srcfile_path"; then - eval srcfile=\"$fix_srcfile_path\" - fi - - # Only build a PIC object if we are building libtool libraries. - if test "$build_libtool_libs" = yes; then - # Without this assignment, base_compile gets emptied. - fbsd_hideous_sh_bug=$base_compile - - if test "$pic_mode" != no; then - # All platforms use -DPIC, to notify preprocessed assembler code. - command="$base_compile $srcfile $pic_flag -DPIC" - else - # Don't build PIC code - command="$base_compile $srcfile" - fi - if test "$build_old_libs" = yes; then - lo_libobj="$libobj" - dir=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'` - if test "X$dir" = "X$libobj"; then - dir="$objdir" - else - dir="$dir/$objdir" - fi - libobj="$dir/"`$echo "X$libobj" | $Xsed -e 's%^.*/%%'` - - if test -d "$dir"; then - $show "$rm $libobj" - $run $rm $libobj - else - $show "$mkdir $dir" - $run $mkdir $dir - status=$? - if test $status -ne 0 && test ! -d $dir; then - exit $status - fi - fi - fi - if test "$compiler_o_lo" = yes; then - output_obj="$libobj" - command="$command -o $output_obj" - elif test "$compiler_c_o" = yes; then - output_obj="$obj" - command="$command -o $output_obj" - fi - - $run $rm "$output_obj" - $show "$command" - if $run eval "$command"; then : - else - test -n "$output_obj" && $run $rm $removelist - exit 1 - fi - - if test "$need_locks" = warn && - test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then - echo "\ -*** ERROR, $lockfile contains: -`cat $lockfile 2>/dev/null` - -but it should contain: -$srcfile - -This indicates that another process is trying to use the same -temporary object file, and libtool could not work around it because -your compiler does not support \`-c' and \`-o' together. If you -repeat this compilation, it may succeed, by chance, but you had better -avoid parallel builds (make -j) in this platform, or get a better -compiler." - - $run $rm $removelist - exit 1 - fi - - # Just move the object if needed, then go on to compile the next one - if test x"$output_obj" != x"$libobj"; then - $show "$mv $output_obj $libobj" - if $run $mv $output_obj $libobj; then : - else - error=$? - $run $rm $removelist - exit $error - fi - fi - - # If we have no pic_flag, then copy the object into place and finish. - if (test -z "$pic_flag" || test "$pic_mode" != default) && - test "$build_old_libs" = yes; then - # Rename the .lo from within objdir to obj - if test -f $obj; then - $show $rm $obj - $run $rm $obj - fi - - $show "$mv $libobj $obj" - if $run $mv $libobj $obj; then : - else - error=$? - $run $rm $removelist - exit $error - fi - - xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'` - if test "X$xdir" = "X$obj"; then - xdir="." - else - xdir="$xdir" - fi - baseobj=`$echo "X$obj" | $Xsed -e "s%.*/%%"` - libobj=`$echo "X$baseobj" | $Xsed -e "$o2lo"` - # Now arrange that obj and lo_libobj become the same file - $show "(cd $xdir && $LN_S $baseobj $libobj)" - if $run eval '(cd $xdir && $LN_S $baseobj $libobj)'; then - # Unlock the critical section if it was locked - if test "$need_locks" != no; then - $run $rm "$lockfile" - fi - exit 0 - else - error=$? - $run $rm $removelist - exit $error - fi - fi - - # Allow error messages only from the first compilation. - suppress_output=' >/dev/null 2>&1' - fi - - # Only build a position-dependent object if we build old libraries. - if test "$build_old_libs" = yes; then - if test "$pic_mode" != yes; then - # Don't build PIC code - command="$base_compile $srcfile" - else - # All platforms use -DPIC, to notify preprocessed assembler code. - command="$base_compile $srcfile $pic_flag -DPIC" - fi - if test "$compiler_c_o" = yes; then - command="$command -o $obj" - output_obj="$obj" - fi - - # Suppress compiler output if we already did a PIC compilation. - command="$command$suppress_output" - $run $rm "$output_obj" - $show "$command" - if $run eval "$command"; then : - else - $run $rm $removelist - exit 1 - fi - - if test "$need_locks" = warn && - test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then - echo "\ -*** ERROR, $lockfile contains: -`cat $lockfile 2>/dev/null` - -but it should contain: -$srcfile - -This indicates that another process is trying to use the same -temporary object file, and libtool could not work around it because -your compiler does not support \`-c' and \`-o' together. If you -repeat this compilation, it may succeed, by chance, but you had better -avoid parallel builds (make -j) in this platform, or get a better -compiler." - - $run $rm $removelist - exit 1 - fi - - # Just move the object if needed - if test x"$output_obj" != x"$obj"; then - $show "$mv $output_obj $obj" - if $run $mv $output_obj $obj; then : - else - error=$? - $run $rm $removelist - exit $error - fi - fi - - # Create an invalid libtool object if no PIC, so that we do not - # accidentally link it into a program. - if test "$build_libtool_libs" != yes; then - $show "echo timestamp > $libobj" - $run eval "echo timestamp > \$libobj" || exit $? - else - # Move the .lo from within objdir - $show "$mv $libobj $lo_libobj" - if $run $mv $libobj $lo_libobj; then : - else - error=$? - $run $rm $removelist - exit $error - fi - fi - fi - - # Unlock the critical section if it was locked - if test "$need_locks" != no; then - $run $rm "$lockfile" - fi - - exit 0 - ;; - - # libtool link mode - link | relink) - modename="$modename: link" - case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) - # It is impossible to link a dll without this setting, and - # we shouldn't force the makefile maintainer to figure out - # which system we are compiling for in order to pass an extra - # flag for every libtool invokation. - # allow_undefined=no - - # FIXME: Unfortunately, there are problems with the above when trying - # to make a dll which has undefined symbols, in which case not - # even a static library is built. For now, we need to specify - # -no-undefined on the libtool link line when we can be certain - # that all symbols are satisfied, otherwise we get a static library. - allow_undefined=yes - ;; - *) - allow_undefined=yes - ;; - esac - libtool_args="$nonopt" - compile_command="$nonopt" - finalize_command="$nonopt" - - compile_rpath= - finalize_rpath= - compile_shlibpath= - finalize_shlibpath= - convenience= - old_convenience= - deplibs= - old_deplibs= - compiler_flags= - linker_flags= - dllsearchpath= - lib_search_path=`pwd` - - avoid_version=no - dlfiles= - dlprefiles= - dlself=no - export_dynamic=no - export_symbols= - export_symbols_regex= - generated= - libobjs= - ltlibs= - module=no - no_install=no - objs= - prefer_static_libs=no - preload=no - prev= - prevarg= - release= - rpath= - xrpath= - perm_rpath= - temp_rpath= - thread_safe=no - vinfo= - - # We need to know -static, to get the right output filenames. - for arg - do - case $arg in - -all-static | -static) - if test "X$arg" = "X-all-static"; then - if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then - $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2 - fi - if test -n "$link_static_flag"; then - dlopen_self=$dlopen_self_static - fi - else - if test -z "$pic_flag" && test -n "$link_static_flag"; then - dlopen_self=$dlopen_self_static - fi - fi - build_libtool_libs=no - build_old_libs=yes - prefer_static_libs=yes - break - ;; - esac - done - - # See if our shared archives depend on static archives. - test -n "$old_archive_from_new_cmds" && build_old_libs=yes - - # Go through the arguments, transforming them on the way. - while test $# -gt 0; do - arg="$1" - shift - case $arg in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test - ;; - *) qarg=$arg ;; - esac - libtool_args="$libtool_args $qarg" - - # If the previous option needs an argument, assign it. - if test -n "$prev"; then - case $prev in - output) - compile_command="$compile_command @OUTPUT@" - finalize_command="$finalize_command @OUTPUT@" - ;; - esac - - case $prev in - dlfiles|dlprefiles) - if test "$preload" = no; then - # Add the symbol object into the linking commands. - compile_command="$compile_command @SYMFILE@" - finalize_command="$finalize_command @SYMFILE@" - preload=yes - fi - case $arg in - *.la | *.lo) ;; # We handle these cases below. - force) - if test "$dlself" = no; then - dlself=needless - export_dynamic=yes - fi - prev= - continue - ;; - self) - if test "$prev" = dlprefiles; then - dlself=yes - elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then - dlself=yes - else - dlself=needless - export_dynamic=yes - fi - prev= - continue - ;; - *) - if test "$prev" = dlfiles; then - dlfiles="$dlfiles $arg" - else - dlprefiles="$dlprefiles $arg" - fi - prev= - continue - ;; - esac - ;; - expsyms) - export_symbols="$arg" - if test ! -f "$arg"; then - $echo "$modename: symbol file \`$arg' does not exist" - exit 1 - fi - prev= - continue - ;; - expsyms_regex) - export_symbols_regex="$arg" - prev= - continue - ;; - release) - release="-$arg" - prev= - continue - ;; - rpath | xrpath) - # We need an absolute path. - case $arg in - [\\/]* | [A-Za-z]:[\\/]*) ;; - *) - $echo "$modename: only absolute run-paths are allowed" 1>&2 - exit 1 - ;; - esac - if test "$prev" = rpath; then - case "$rpath " in - *" $arg "*) ;; - *) rpath="$rpath $arg" ;; - esac - else - case "$xrpath " in - *" $arg "*) ;; - *) xrpath="$xrpath $arg" ;; - esac - fi - prev= - continue - ;; - xcompiler) - compiler_flags="$compiler_flags $qarg" - prev= - compile_command="$compile_command $qarg" - finalize_command="$finalize_command $qarg" - continue - ;; - xlinker) - linker_flags="$linker_flags $qarg" - compiler_flags="$compiler_flags $wl$qarg" - prev= - compile_command="$compile_command $wl$qarg" - finalize_command="$finalize_command $wl$qarg" - continue - ;; - *) - eval "$prev=\"\$arg\"" - prev= - continue - ;; - esac - fi # test -n $prev - - prevarg="$arg" - - case $arg in - -all-static) - if test -n "$link_static_flag"; then - compile_command="$compile_command $link_static_flag" - finalize_command="$finalize_command $link_static_flag" - fi - continue - ;; - - -allow-undefined) - # FIXME: remove this flag sometime in the future. - $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2 - continue - ;; - - -avoid-version) - avoid_version=yes - continue - ;; - - -dlopen) - prev=dlfiles - continue - ;; - - -dlpreopen) - prev=dlprefiles - continue - ;; - - -export-dynamic) - export_dynamic=yes - continue - ;; - - -export-symbols | -export-symbols-regex) - if test -n "$export_symbols" || test -n "$export_symbols_regex"; then - $echo "$modename: more than one -exported-symbols argument is not allowed" - exit 1 - fi - if test "X$arg" = "X-export-symbols"; then - prev=expsyms - else - prev=expsyms_regex - fi - continue - ;; - - # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* - # so, if we see these flags be careful not to treat them like -L - -L[A-Z][A-Z]*:*) - case $with_gcc/$host in - no/*-*-irix*) - compile_command="$compile_command $arg" - finalize_command="$finalize_command $arg" - ;; - esac - continue - ;; - - -L*) - dir=`$echo "X$arg" | $Xsed -e 's/^-L//'` - # We need an absolute path. - case $dir in - [\\/]* | [A-Za-z]:[\\/]*) ;; - *) - absdir=`cd "$dir" && pwd` - if test -z "$absdir"; then - $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2 - exit 1 - fi - dir="$absdir" - ;; - esac - case "$deplibs " in - *" -L$dir "*) ;; - *) - deplibs="$deplibs -L$dir" - lib_search_path="$lib_search_path $dir" - ;; - esac - case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) - case :$dllsearchpath: in - *":$dir:"*) ;; - *) dllsearchpath="$dllsearchpath:$dir";; - esac - ;; - esac - continue - ;; - - -l*) - if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then - case $host in - *-*-cygwin* | *-*-pw32* | *-*-beos*) - # These systems don't actually have a C or math library (as such) - continue - ;; - *-*-mingw* | *-*-os2*) - # These systems don't actually have a C library (as such) - test "X$arg" = "X-lc" && continue - ;; - *-*-openbsd*) - # Do not include libc due to us having libc/libc_r. - test "X$arg" = "X-lc" && continue - ;; - esac - elif test "X$arg" = "X-lc_r"; then - case $host in - *-*-openbsd*) - # Do not include libc_r directly, use -pthread flag. - continue - ;; - esac - fi - deplibs="$deplibs $arg" - continue - ;; - - -module) - module=yes - continue - ;; - - -no-fast-install) - fast_install=no - continue - ;; - - -no-install) - case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) - # The PATH hackery in wrapper scripts is required on Windows - # in order for the loader to find any dlls it needs. - $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2 - $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2 - fast_install=no - ;; - *) no_install=yes ;; - esac - continue - ;; - - -no-undefined) - allow_undefined=no - continue - ;; - - -o) prev=output ;; - - -release) - prev=release - continue - ;; - - -rpath) - prev=rpath - continue - ;; - - -R) - prev=xrpath - continue - ;; - - -R*) - dir=`$echo "X$arg" | $Xsed -e 's/^-R//'` - # We need an absolute path. - case $dir in - [\\/]* | [A-Za-z]:[\\/]*) ;; - *) - $echo "$modename: only absolute run-paths are allowed" 1>&2 - exit 1 - ;; - esac - case "$xrpath " in - *" $dir "*) ;; - *) xrpath="$xrpath $dir" ;; - esac - continue - ;; - - -static) - # The effects of -static are defined in a previous loop. - # We used to do the same as -all-static on platforms that - # didn't have a PIC flag, but the assumption that the effects - # would be equivalent was wrong. It would break on at least - # Digital Unix and AIX. - continue - ;; - - -thread-safe) - thread_safe=yes - continue - ;; - - -version-info) - prev=vinfo - continue - ;; - - -Wc,*) - args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'` - arg= - save_ifs="$IFS"; IFS=',' - for flag in $args; do - IFS="$save_ifs" - case $flag in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - flag="\"$flag\"" - ;; - esac - arg="$arg $wl$flag" - compiler_flags="$compiler_flags $flag" - done - IFS="$save_ifs" - arg=`$echo "X$arg" | $Xsed -e "s/^ //"` - ;; - - -Wl,*) - args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'` - arg= - save_ifs="$IFS"; IFS=',' - for flag in $args; do - IFS="$save_ifs" - case $flag in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - flag="\"$flag\"" - ;; - esac - arg="$arg $wl$flag" - compiler_flags="$compiler_flags $wl$flag" - linker_flags="$linker_flags $flag" - done - IFS="$save_ifs" - arg=`$echo "X$arg" | $Xsed -e "s/^ //"` - ;; - - -Xcompiler) - prev=xcompiler - continue - ;; - - -Xlinker) - prev=xlinker - continue - ;; - - # Some other compiler flag. - -* | +*) - # Unknown arguments in both finalize_command and compile_command need - # to be aesthetically quoted because they are evaled later. - arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` - case $arg in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - arg="\"$arg\"" - ;; - esac - ;; - - *.lo | *.$objext) - # A library or standard object. - if test "$prev" = dlfiles; then - # This file was specified with -dlopen. - if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then - dlfiles="$dlfiles $arg" - prev= - continue - else - # If libtool objects are unsupported, then we need to preload. - prev=dlprefiles - fi - fi - - if test "$prev" = dlprefiles; then - # Preload the old-style object. - dlprefiles="$dlprefiles "`$echo "X$arg" | $Xsed -e "$lo2o"` - prev= - else - case $arg in - *.lo) libobjs="$libobjs $arg" ;; - *) objs="$objs $arg" ;; - esac - fi - ;; - - *.$libext) - # An archive. - deplibs="$deplibs $arg" - old_deplibs="$old_deplibs $arg" - continue - ;; - - *.la) - # A libtool-controlled library. - - if test "$prev" = dlfiles; then - # This library was specified with -dlopen. - dlfiles="$dlfiles $arg" - prev= - elif test "$prev" = dlprefiles; then - # The library was specified with -dlpreopen. - dlprefiles="$dlprefiles $arg" - prev= - else - deplibs="$deplibs $arg" - fi - continue - ;; - - # Some other compiler argument. - *) - # Unknown arguments in both finalize_command and compile_command need - # to be aesthetically quoted because they are evaled later. - arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` - case $arg in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - arg="\"$arg\"" - ;; - esac - ;; - esac # arg - - # Now actually substitute the argument into the commands. - if test -n "$arg"; then - compile_command="$compile_command $arg" - finalize_command="$finalize_command $arg" - fi - done # argument parsing loop - - if test -n "$prev"; then - $echo "$modename: the \`$prevarg' option requires an argument" 1>&2 - $echo "$help" 1>&2 - exit 1 - fi - - if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then - eval arg=\"$export_dynamic_flag_spec\" - compile_command="$compile_command $arg" - finalize_command="$finalize_command $arg" - fi - - # calculate the name of the file, without its directory - outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'` - libobjs_save="$libobjs" - - if test -n "$shlibpath_var"; then - # get the directories listed in $shlibpath_var - eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\` - else - shlib_search_path= - fi - eval sys_lib_search_path=\"$sys_lib_search_path_spec\" - eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" - - output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'` - if test "X$output_objdir" = "X$output"; then - output_objdir="$objdir" - else - output_objdir="$output_objdir/$objdir" - fi - # Create the object directory. - if test ! -d $output_objdir; then - $show "$mkdir $output_objdir" - $run $mkdir $output_objdir - status=$? - if test $status -ne 0 && test ! -d $output_objdir; then - exit $status - fi - fi - - # Determine the type of output - case $output in - "") - $echo "$modename: you must specify an output file" 1>&2 - $echo "$help" 1>&2 - exit 1 - ;; - *.$libext) linkmode=oldlib ;; - *.lo | *.$objext) linkmode=obj ;; - *.la) linkmode=lib ;; - *) linkmode=prog ;; # Anything else should be a program. - esac - - specialdeplibs= - libs= - # Find all interdependent deplibs by searching for libraries - # that are linked more than once (e.g. -la -lb -la) - for deplib in $deplibs; do - case "$libs " in - *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; - esac - libs="$libs $deplib" - done - deplibs= - newdependency_libs= - newlib_search_path= - need_relink=no # whether we're linking any uninstalled libtool libraries - notinst_deplibs= # not-installed libtool libraries - notinst_path= # paths that contain not-installed libtool libraries - case $linkmode in - lib) - passes="conv link" - for file in $dlfiles $dlprefiles; do - case $file in - *.la) ;; - *) - $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2 - exit 1 - ;; - esac - done - ;; - prog) - compile_deplibs= - finalize_deplibs= - alldeplibs=no - newdlfiles= - newdlprefiles= - passes="conv scan dlopen dlpreopen link" - ;; - *) passes="conv" - ;; - esac - for pass in $passes; do - if test $linkmode = prog; then - # Determine which files to process - case $pass in - dlopen) - libs="$dlfiles" - save_deplibs="$deplibs" # Collect dlpreopened libraries - deplibs= - ;; - dlpreopen) libs="$dlprefiles" ;; - link) libs="$deplibs %DEPLIBS% $dependency_libs" ;; - esac - fi - for deplib in $libs; do - lib= - found=no - case $deplib in - -l*) - if test $linkmode = oldlib && test $linkmode = obj; then - $echo "$modename: warning: \`-l' is ignored for archives/objects: $deplib" 1>&2 - continue - fi - if test $pass = conv; then - deplibs="$deplib $deplibs" - continue - fi - name=`$echo "X$deplib" | $Xsed -e 's/^-l//'` - for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do - # Search the libtool library - lib="$searchdir/lib${name}.la" - if test -f "$lib"; then - found=yes - break - fi - done - if test "$found" != yes; then - # deplib doesn't seem to be a libtool library - if test "$linkmode,$pass" = "prog,link"; then - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - else - deplibs="$deplib $deplibs" - test $linkmode = lib && newdependency_libs="$deplib $newdependency_libs" - fi - continue - fi - ;; # -l - -L*) - case $linkmode in - lib) - deplibs="$deplib $deplibs" - test $pass = conv && continue - newdependency_libs="$deplib $newdependency_libs" - newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'` - ;; - prog) - if test $pass = conv; then - deplibs="$deplib $deplibs" - continue - fi - if test $pass = scan; then - deplibs="$deplib $deplibs" - newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'` - else - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - fi - ;; - *) - $echo "$modename: warning: \`-L' is ignored for archives/objects: $deplib" 1>&2 - ;; - esac # linkmode - continue - ;; # -L - -R*) - if test $pass = link; then - dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'` - # Make sure the xrpath contains only unique directories. - case "$xrpath " in - *" $dir "*) ;; - *) xrpath="$xrpath $dir" ;; - esac - fi - deplibs="$deplib $deplibs" - continue - ;; - *.la) lib="$deplib" ;; - *.$libext) - if test $pass = conv; then - deplibs="$deplib $deplibs" - continue - fi - case $linkmode in - lib) - if test "$deplibs_check_method" != pass_all; then - echo - echo "*** Warning: This library needs some functionality provided by $deplib." - echo "*** I have the capability to make that library automatically link in when" - echo "*** you link to this library. But I can only do this if you have a" - echo "*** shared version of the library, which you do not appear to have." - else - echo - echo "*** Warning: Linking the shared library $output against the" - echo "*** static library $deplib is not portable!" - deplibs="$deplib $deplibs" - fi - continue - ;; - prog) - if test $pass != link; then - deplibs="$deplib $deplibs" - else - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - fi - continue - ;; - esac # linkmode - ;; # *.$libext - *.lo | *.$objext) - if test $pass = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then - # If there is no dlopen support or we're linking statically, - # we need to preload. - newdlprefiles="$newdlprefiles $deplib" - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - else - newdlfiles="$newdlfiles $deplib" - fi - continue - ;; - %DEPLIBS%) - alldeplibs=yes - continue - ;; - esac # case $deplib - if test $found = yes || test -f "$lib"; then : - else - $echo "$modename: cannot find the library \`$lib'" 1>&2 - exit 1 - fi - - # Check to see that this really is a libtool archive. - if (sed -e '2q' $lib | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : - else - $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 - exit 1 - fi - - ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'` - test "X$ladir" = "X$lib" && ladir="." - - dlname= - dlopen= - dlpreopen= - libdir= - library_names= - old_library= - # If the library was installed with an old release of libtool, - # it will not redefine variable installed. - installed=yes - - # Read the .la file - case $lib in - */* | *\\*) . $lib ;; - *) . ./$lib ;; - esac - - if test "$linkmode,$pass" = "lib,link" || - test "$linkmode,$pass" = "prog,scan" || - { test $linkmode = oldlib && test $linkmode = obj; }; then - # Add dl[pre]opened files of deplib - test -n "$dlopen" && dlfiles="$dlfiles $dlopen" - test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen" - fi - - if test $pass = conv; then - # Only check for convenience libraries - deplibs="$lib $deplibs" - if test -z "$libdir"; then - if test -z "$old_library"; then - $echo "$modename: cannot find name of link library for \`$lib'" 1>&2 - exit 1 - fi - # It is a libtool convenience library, so add in its objects. - convenience="$convenience $ladir/$objdir/$old_library" - old_convenience="$old_convenience $ladir/$objdir/$old_library" - tmp_libs= - for deplib in $dependency_libs; do - deplibs="$deplib $deplibs" - case "$tmp_libs " in - *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; - esac - tmp_libs="$tmp_libs $deplib" - done - elif test $linkmode != prog && test $linkmode != lib; then - $echo "$modename: \`$lib' is not a convenience library" 1>&2 - exit 1 - fi - continue - fi # $pass = conv - - # Get the name of the library we link against. - linklib= - for l in $old_library $library_names; do - linklib="$l" - done - if test -z "$linklib"; then - $echo "$modename: cannot find name of link library for \`$lib'" 1>&2 - exit 1 - fi - - # This library was specified with -dlopen. - if test $pass = dlopen; then - if test -z "$libdir"; then - $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2 - exit 1 - fi - if test -z "$dlname" || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then - # If there is no dlname, no dlopen support or we're linking - # statically, we need to preload. - dlprefiles="$dlprefiles $lib" - else - newdlfiles="$newdlfiles $lib" - fi - continue - fi # $pass = dlopen - - # We need an absolute path. - case $ladir in - [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;; - *) - abs_ladir=`cd "$ladir" && pwd` - if test -z "$abs_ladir"; then - $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2 - $echo "$modename: passing it literally to the linker, although it might fail" 1>&2 - abs_ladir="$ladir" - fi - ;; - esac - laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` - - # Find the relevant object directory and library name. - if test "X$installed" = Xyes; then - if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then - $echo "$modename: warning: library \`$lib' was moved." 1>&2 - dir="$ladir" - absdir="$abs_ladir" - libdir="$abs_ladir" - else - dir="$libdir" - absdir="$libdir" - fi - else - dir="$ladir/$objdir" - absdir="$abs_ladir/$objdir" - # Remove this search path later - notinst_path="$notinst_path $abs_ladir" - fi # $installed = yes - name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` - - # This library was specified with -dlpreopen. - if test $pass = dlpreopen; then - if test -z "$libdir"; then - $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2 - exit 1 - fi - # Prefer using a static library (so that no silly _DYNAMIC symbols - # are required to link). - if test -n "$old_library"; then - newdlprefiles="$newdlprefiles $dir/$old_library" - # Otherwise, use the dlname, so that lt_dlopen finds it. - elif test -n "$dlname"; then - newdlprefiles="$newdlprefiles $dir/$dlname" - else - newdlprefiles="$newdlprefiles $dir/$linklib" - fi - fi # $pass = dlpreopen - - if test -z "$libdir"; then - # Link the convenience library - if test $linkmode = lib; then - deplibs="$dir/$old_library $deplibs" - elif test "$linkmode,$pass" = "prog,link"; then - compile_deplibs="$dir/$old_library $compile_deplibs" - finalize_deplibs="$dir/$old_library $finalize_deplibs" - else - deplibs="$lib $deplibs" - fi - continue - fi - - if test $linkmode = prog && test $pass != link; then - newlib_search_path="$newlib_search_path $ladir" - deplibs="$lib $deplibs" - - linkalldeplibs=no - if test "$link_all_deplibs" != no || test -z "$library_names" || - test "$build_libtool_libs" = no; then - linkalldeplibs=yes - fi - - tmp_libs= - for deplib in $dependency_libs; do - case $deplib in - -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test - esac - # Need to link against all dependency_libs? - if test $linkalldeplibs = yes; then - deplibs="$deplib $deplibs" - else - # Need to hardcode shared library paths - # or/and link against static libraries - newdependency_libs="$deplib $newdependency_libs" - fi - case "$tmp_libs " in - *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; - esac - tmp_libs="$tmp_libs $deplib" - done # for deplib - continue - fi # $linkmode = prog... - - link_static=no # Whether the deplib will be linked statically - if test -n "$library_names" && - { test "$prefer_static_libs" = no || test -z "$old_library"; }; then - # Link against this shared library - - if test "$linkmode,$pass" = "prog,link" || - { test $linkmode = lib && test $hardcode_into_libs = yes; }; then - # Hardcode the library path. - # Skip directories that are in the system default run-time - # search path. - case " $sys_lib_dlsearch_path " in - *" $absdir "*) ;; - *) - case "$compile_rpath " in - *" $absdir "*) ;; - *) compile_rpath="$compile_rpath $absdir" - esac - ;; - esac - case " $sys_lib_dlsearch_path " in - *" $libdir "*) ;; - *) - case "$finalize_rpath " in - *" $libdir "*) ;; - *) finalize_rpath="$finalize_rpath $libdir" - esac - ;; - esac - if test $linkmode = prog; then - # We need to hardcode the library path - if test -n "$shlibpath_var"; then - # Make sure the rpath contains only unique directories. - case "$temp_rpath " in - *" $dir "*) ;; - *" $absdir "*) ;; - *) temp_rpath="$temp_rpath $dir" ;; - esac - fi - fi - fi # $linkmode,$pass = prog,link... - - if test "$alldeplibs" = yes && - { test "$deplibs_check_method" = pass_all || - { test "$build_libtool_libs" = yes && - test -n "$library_names"; }; }; then - # We only need to search for static libraries - continue - fi - - if test "$installed" = no; then - notinst_deplibs="$notinst_deplibs $lib" - need_relink=yes - fi - - if test -n "$old_archive_from_expsyms_cmds"; then - # figure out the soname - set dummy $library_names - realname="$2" - shift; shift - libname=`eval \\$echo \"$libname_spec\"` - # use dlname if we got it. it's perfectly good, no? - if test -n "$dlname"; then - soname="$dlname" - elif test -n "$soname_spec"; then - # bleh windows - case $host in - *cygwin*) - major=`expr $current - $age` - versuffix="-$major" - ;; - esac - eval soname=\"$soname_spec\" - else - soname="$realname" - fi - - # Make a new name for the extract_expsyms_cmds to use - soroot="$soname" - soname=`echo $soroot | sed -e 's/^.*\///'` - newlib="libimp-`echo $soname | sed 's/^lib//;s/\.dll$//'`.a" - - # If the library has no export list, then create one now - if test -f "$output_objdir/$soname-def"; then : - else - $show "extracting exported symbol list from \`$soname'" - save_ifs="$IFS"; IFS='~' - eval cmds=\"$extract_expsyms_cmds\" - for cmd in $cmds; do - IFS="$save_ifs" - $show "$cmd" - $run eval "$cmd" || exit $? - done - IFS="$save_ifs" - fi - - # Create $newlib - if test -f "$output_objdir/$newlib"; then :; else - $show "generating import library for \`$soname'" - save_ifs="$IFS"; IFS='~' - eval cmds=\"$old_archive_from_expsyms_cmds\" - for cmd in $cmds; do - IFS="$save_ifs" - $show "$cmd" - $run eval "$cmd" || exit $? - done - IFS="$save_ifs" - fi - # make sure the library variables are pointing to the new library - dir=$output_objdir - linklib=$newlib - fi # test -n $old_archive_from_expsyms_cmds - - if test $linkmode = prog || test "$mode" != relink; then - add_shlibpath= - add_dir= - add= - lib_linked=yes - case $hardcode_action in - immediate | unsupported) - if test "$hardcode_direct" = no; then - add="$dir/$linklib" - elif test "$hardcode_minus_L" = no; then - case $host in - *-*-sunos*) add_shlibpath="$dir" ;; - esac - add_dir="-L$dir" - add="-l$name" - elif test "$hardcode_shlibpath_var" = no; then - add_shlibpath="$dir" - add="-l$name" - else - lib_linked=no - fi - ;; - relink) - if test "$hardcode_direct" = yes; then - add="$dir/$linklib" - elif test "$hardcode_minus_L" = yes; then - add_dir="-L$dir" - add="-l$name" - elif test "$hardcode_shlibpath_var" = yes; then - add_shlibpath="$dir" - add="-l$name" - else - lib_linked=no - fi - ;; - *) lib_linked=no ;; - esac - - if test "$lib_linked" != yes; then - $echo "$modename: configuration error: unsupported hardcode properties" - exit 1 - fi - - if test -n "$add_shlibpath"; then - case :$compile_shlibpath: in - *":$add_shlibpath:"*) ;; - *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;; - esac - fi - if test $linkmode = prog; then - test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" - test -n "$add" && compile_deplibs="$add $compile_deplibs" - else - test -n "$add_dir" && deplibs="$add_dir $deplibs" - test -n "$add" && deplibs="$add $deplibs" - if test "$hardcode_direct" != yes && \ - test "$hardcode_minus_L" != yes && \ - test "$hardcode_shlibpath_var" = yes; then - case :$finalize_shlibpath: in - *":$libdir:"*) ;; - *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; - esac - fi - fi - fi - - if test $linkmode = prog || test "$mode" = relink; then - add_shlibpath= - add_dir= - add= - # Finalize command for both is simple: just hardcode it. - if test "$hardcode_direct" = yes; then - add="$libdir/$linklib" - elif test "$hardcode_minus_L" = yes; then - add_dir="-L$libdir" - add="-l$name" - elif test "$hardcode_shlibpath_var" = yes; then - case :$finalize_shlibpath: in - *":$libdir:"*) ;; - *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; - esac - add="-l$name" - else - # We cannot seem to hardcode it, guess we'll fake it. - add_dir="-L$libdir" - add="-l$name" - fi - - if test $linkmode = prog; then - test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" - test -n "$add" && finalize_deplibs="$add $finalize_deplibs" - else - test -n "$add_dir" && deplibs="$add_dir $deplibs" - test -n "$add" && deplibs="$add $deplibs" - fi - fi - elif test $linkmode = prog; then - if test "$alldeplibs" = yes && - { test "$deplibs_check_method" = pass_all || - { test "$build_libtool_libs" = yes && - test -n "$library_names"; }; }; then - # We only need to search for static libraries - continue - fi - - # Try to link the static library - # Here we assume that one of hardcode_direct or hardcode_minus_L - # is not unsupported. This is valid on all known static and - # shared platforms. - if test "$hardcode_direct" != unsupported; then - test -n "$old_library" && linklib="$old_library" - compile_deplibs="$dir/$linklib $compile_deplibs" - finalize_deplibs="$dir/$linklib $finalize_deplibs" - else - compile_deplibs="-l$name -L$dir $compile_deplibs" - finalize_deplibs="-l$name -L$dir $finalize_deplibs" - fi - elif test "$build_libtool_libs" = yes; then - # Not a shared library - if test "$deplibs_check_method" != pass_all; then - # We're trying link a shared library against a static one - # but the system doesn't support it. - - # Just print a warning and add the library to dependency_libs so - # that the program can be linked against the static library. - echo - echo "*** Warning: This library needs some functionality provided by $lib." - echo "*** I have the capability to make that library automatically link in when" - echo "*** you link to this library. But I can only do this if you have a" - echo "*** shared version of the library, which you do not appear to have." - if test "$module" = yes; then - echo "*** Therefore, libtool will create a static module, that should work " - echo "*** as long as the dlopening application is linked with the -dlopen flag." - if test -z "$global_symbol_pipe"; then - echo - echo "*** However, this would only work if libtool was able to extract symbol" - echo "*** lists from a program, using \`nm' or equivalent, but libtool could" - echo "*** not find such a program. So, this module is probably useless." - echo "*** \`nm' from GNU binutils and a full rebuild may help." - fi - if test "$build_old_libs" = no; then - build_libtool_libs=module - build_old_libs=yes - else - build_libtool_libs=no - fi - fi - else - convenience="$convenience $dir/$old_library" - old_convenience="$old_convenience $dir/$old_library" - deplibs="$dir/$old_library $deplibs" - link_static=yes - fi - fi # link shared/static library? - - if test $linkmode = lib; then - if test -n "$dependency_libs" && - { test $hardcode_into_libs != yes || test $build_old_libs = yes || - test $link_static = yes; }; then - # Extract -R from dependency_libs - temp_deplibs= - for libdir in $dependency_libs; do - case $libdir in - -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'` - case " $xrpath " in - *" $temp_xrpath "*) ;; - *) xrpath="$xrpath $temp_xrpath";; - esac;; - *) temp_deplibs="$temp_deplibs $libdir";; - esac - done - dependency_libs="$temp_deplibs" - fi - - newlib_search_path="$newlib_search_path $absdir" - # Link against this library - test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs" - # ... and its dependency_libs - tmp_libs= - for deplib in $dependency_libs; do - newdependency_libs="$deplib $newdependency_libs" - case "$tmp_libs " in - *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; - esac - tmp_libs="$tmp_libs $deplib" - done - - if test $link_all_deplibs != no; then - # Add the search paths of all dependency libraries - for deplib in $dependency_libs; do - case $deplib in - -L*) path="$deplib" ;; - *.la) - dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'` - test "X$dir" = "X$deplib" && dir="." - # We need an absolute path. - case $dir in - [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;; - *) - absdir=`cd "$dir" && pwd` - if test -z "$absdir"; then - $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2 - absdir="$dir" - fi - ;; - esac - if grep "^installed=no" $deplib > /dev/null; then - path="-L$absdir/$objdir" - else - eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` - if test -z "$libdir"; then - $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 - exit 1 - fi - if test "$absdir" != "$libdir"; then - $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2 - fi - path="-L$absdir" - fi - ;; - *) continue ;; - esac - case " $deplibs " in - *" $path "*) ;; - *) deplibs="$deplibs $path" ;; - esac - done - fi # link_all_deplibs != no - fi # linkmode = lib - done # for deplib in $libs - if test $pass = dlpreopen; then - # Link the dlpreopened libraries before other libraries - for deplib in $save_deplibs; do - deplibs="$deplib $deplibs" - done - fi - if test $pass != dlopen; then - test $pass != scan && dependency_libs="$newdependency_libs" - if test $pass != conv; then - # Make sure lib_search_path contains only unique directories. - lib_search_path= - for dir in $newlib_search_path; do - case "$lib_search_path " in - *" $dir "*) ;; - *) lib_search_path="$lib_search_path $dir" ;; - esac - done - newlib_search_path= - fi - - if test "$linkmode,$pass" != "prog,link"; then - vars="deplibs" - else - vars="compile_deplibs finalize_deplibs" - fi - for var in $vars dependency_libs; do - # Add libraries to $var in reverse order - eval tmp_libs=\"\$$var\" - new_libs= - for deplib in $tmp_libs; do - case $deplib in - -L*) new_libs="$deplib $new_libs" ;; - *) - case " $specialdeplibs " in - *" $deplib "*) new_libs="$deplib $new_libs" ;; - *) - case " $new_libs " in - *" $deplib "*) ;; - *) new_libs="$deplib $new_libs" ;; - esac - ;; - esac - ;; - esac - done - tmp_libs= - for deplib in $new_libs; do - case $deplib in - -L*) - case " $tmp_libs " in - *" $deplib "*) ;; - *) tmp_libs="$tmp_libs $deplib" ;; - esac - ;; - *) tmp_libs="$tmp_libs $deplib" ;; - esac - done - eval $var=\"$tmp_libs\" - done # for var - fi - if test "$pass" = "conv" && - { test "$linkmode" = "lib" || test "$linkmode" = "prog"; }; then - libs="$deplibs" # reset libs - deplibs= - fi - done # for pass - if test $linkmode = prog; then - dlfiles="$newdlfiles" - dlprefiles="$newdlprefiles" - fi - - case $linkmode in - oldlib) - if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then - $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2 - fi - - if test -n "$rpath"; then - $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2 - fi - - if test -n "$xrpath"; then - $echo "$modename: warning: \`-R' is ignored for archives" 1>&2 - fi - - if test -n "$vinfo"; then - $echo "$modename: warning: \`-version-info' is ignored for archives" 1>&2 - fi - - if test -n "$release"; then - $echo "$modename: warning: \`-release' is ignored for archives" 1>&2 - fi - - if test -n "$export_symbols" || test -n "$export_symbols_regex"; then - $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2 - fi - - # Now set the variables for building old libraries. - build_libtool_libs=no - oldlibs="$output" - objs="$objs$old_deplibs" - ;; - - lib) - # Make sure we only generate libraries of the form `libNAME.la'. - case $outputname in - lib*) - name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` - eval libname=\"$libname_spec\" - ;; - *) - if test "$module" = no; then - $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2 - $echo "$help" 1>&2 - exit 1 - fi - if test "$need_lib_prefix" != no; then - # Add the "lib" prefix for modules if required - name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'` - eval libname=\"$libname_spec\" - else - libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'` - fi - ;; - esac - - if test -n "$objs"; then - if test "$deplibs_check_method" != pass_all; then - $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1 - exit 1 - else - echo - echo "*** Warning: Linking the shared library $output against the non-libtool" - echo "*** objects $objs is not portable!" - libobjs="$libobjs $objs" - fi - fi - - if test "$dlself" != no; then - $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2 - fi - - set dummy $rpath - if test $# -gt 2; then - $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2 - fi - install_libdir="$2" - - oldlibs= - if test -z "$rpath"; then - if test "$build_libtool_libs" = yes; then - # Building a libtool convenience library. - libext=al - oldlibs="$output_objdir/$libname.$libext $oldlibs" - build_libtool_libs=convenience - build_old_libs=yes - fi - - if test -n "$vinfo"; then - $echo "$modename: warning: \`-version-info' is ignored for convenience libraries" 1>&2 - fi - - if test -n "$release"; then - $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2 - fi - else - - # Parse the version information argument. - save_ifs="$IFS"; IFS=':' - set dummy $vinfo 0 0 0 - IFS="$save_ifs" - - if test -n "$8"; then - $echo "$modename: too many parameters to \`-version-info'" 1>&2 - $echo "$help" 1>&2 - exit 1 - fi - - current="$2" - revision="$3" - age="$4" - - # Check that each of the things are valid numbers. - case $current in - 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;; - *) - $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2 - $echo "$modename: \`$vinfo' is not valid version information" 1>&2 - exit 1 - ;; - esac - - case $revision in - 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;; - *) - $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2 - $echo "$modename: \`$vinfo' is not valid version information" 1>&2 - exit 1 - ;; - esac - - case $age in - 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;; - *) - $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2 - $echo "$modename: \`$vinfo' is not valid version information" 1>&2 - exit 1 - ;; - esac - - if test $age -gt $current; then - $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2 - $echo "$modename: \`$vinfo' is not valid version information" 1>&2 - exit 1 - fi - - # Calculate the version variables. - major= - versuffix= - verstring= - case $version_type in - none) ;; - - darwin) - # Like Linux, but with the current version available in - # verstring for coding it into the library header - major=.`expr $current - $age` - versuffix="$major.$age.$revision" - # Darwin ld doesn't like 0 for these options... - minor_current=`expr $current + 1` - verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" - ;; - - freebsd-aout) - major=".$current" - versuffix=".$current.$revision"; - ;; - - freebsd-elf) - major=".$current" - versuffix=".$current"; - ;; - - irix) - major=`expr $current - $age + 1` - verstring="sgi$major.$revision" - - # Add in all the interfaces that we are compatible with. - loop=$revision - while test $loop != 0; do - iface=`expr $revision - $loop` - loop=`expr $loop - 1` - verstring="sgi$major.$iface:$verstring" - done - - # Before this point, $major must not contain `.'. - major=.$major - versuffix="$major.$revision" - ;; - - linux) - major=.`expr $current - $age` - versuffix="$major.$age.$revision" - ;; - - osf) - major=`expr $current - $age` - versuffix=".$current.$age.$revision" - verstring="$current.$age.$revision" - - # Add in all the interfaces that we are compatible with. - loop=$age - while test $loop != 0; do - iface=`expr $current - $loop` - loop=`expr $loop - 1` - verstring="$verstring:${iface}.0" - done - - # Make executables depend on our current version. - verstring="$verstring:${current}.0" - ;; - - sunos) - major=".$current" - versuffix=".$current.$revision" - ;; - - windows) - # Use '-' rather than '.', since we only want one - # extension on DOS 8.3 filesystems. - major=`expr $current - $age` - versuffix="-$major" - ;; - - *) - $echo "$modename: unknown library version type \`$version_type'" 1>&2 - echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 - exit 1 - ;; - esac - - # Clear the version info if we defaulted, and they specified a release. - if test -z "$vinfo" && test -n "$release"; then - major= - verstring="0.0" - case $version_type in - darwin) - # we can't check for "0.0" in archive_cmds due to quoting - # problems, so we reset it completely - verstring="" - ;; - *) - verstring="0.0" - ;; - esac - if test "$need_version" = no; then - versuffix= - else - versuffix=".0.0" - fi - fi - - # Remove version info from name if versioning should be avoided - if test "$avoid_version" = yes && test "$need_version" = no; then - major= - versuffix= - verstring="" - fi - - # Check to see if the archive will have undefined symbols. - if test "$allow_undefined" = yes; then - if test "$allow_undefined_flag" = unsupported; then - $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2 - build_libtool_libs=no - build_old_libs=yes - fi - else - # Don't allow undefined symbols. - allow_undefined_flag="$no_undefined_flag" - fi - fi - - if test "$mode" != relink; then - # Remove our outputs. - $show "${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.*" - $run ${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.* - fi - - # Now set the variables for building old libraries. - if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then - oldlibs="$oldlibs $output_objdir/$libname.$libext" - - # Transform .lo files to .o files. - oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP` - fi - - # Eliminate all temporary directories. - for path in $notinst_path; do - lib_search_path=`echo "$lib_search_path " | sed -e 's% $path % %g'` - deplibs=`echo "$deplibs " | sed -e 's% -L$path % %g'` - dependency_libs=`echo "$dependency_libs " | sed -e 's% -L$path % %g'` - done - - if test -n "$xrpath"; then - # If the user specified any rpath flags, then add them. - temp_xrpath= - for libdir in $xrpath; do - temp_xrpath="$temp_xrpath -R$libdir" - case "$finalize_rpath " in - *" $libdir "*) ;; - *) finalize_rpath="$finalize_rpath $libdir" ;; - esac - done - if test $hardcode_into_libs != yes || test $build_old_libs = yes; then - dependency_libs="$temp_xrpath $dependency_libs" - fi - fi - - # Make sure dlfiles contains only unique files that won't be dlpreopened - old_dlfiles="$dlfiles" - dlfiles= - for lib in $old_dlfiles; do - case " $dlprefiles $dlfiles " in - *" $lib "*) ;; - *) dlfiles="$dlfiles $lib" ;; - esac - done - - # Make sure dlprefiles contains only unique files - old_dlprefiles="$dlprefiles" - dlprefiles= - for lib in $old_dlprefiles; do - case "$dlprefiles " in - *" $lib "*) ;; - *) dlprefiles="$dlprefiles $lib" ;; - esac - done - - if test "$build_libtool_libs" = yes; then - if test -n "$rpath"; then - case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*) - # these systems don't actually have a c library (as such)! - ;; - *-*-rhapsody* | *-*-darwin1.[012]) - # Rhapsody C library is in the System framework - deplibs="$deplibs -framework System" - ;; - *-*-netbsd*) - # Don't link with libc until the a.out ld.so is fixed. - ;; - *-*-openbsd*) - # Do not include libc due to us having libc/libc_r. - ;; - *) - # Add libc to deplibs on all other systems if necessary. - if test $build_libtool_need_lc = "yes"; then - deplibs="$deplibs -lc" - fi - ;; - esac - fi - - # Transform deplibs into only deplibs that can be linked in shared. - name_save=$name - libname_save=$libname - release_save=$release - versuffix_save=$versuffix - major_save=$major - # I'm not sure if I'm treating the release correctly. I think - # release should show up in the -l (ie -lgmp5) so we don't want to - # add it in twice. Is that correct? - release="" - versuffix="" - major="" - newdeplibs= - droppeddeps=no - case $deplibs_check_method in - pass_all) - # Don't check for shared/static. Everything works. - # This might be a little naive. We might want to check - # whether the library exists or not. But this is on - # osf3 & osf4 and I'm not really sure... Just - # implementing what was already the behaviour. - newdeplibs=$deplibs - ;; - test_compile) - # This code stresses the "libraries are programs" paradigm to its - # limits. Maybe even breaks it. We compile a program, linking it - # against the deplibs as a proxy for the library. Then we can check - # whether they linked in statically or dynamically with ldd. - $rm conftest.c - cat > conftest.c </dev/null` - for potent_lib in $potential_libs; do - # Follow soft links. - if ls -lLd "$potent_lib" 2>/dev/null \ - | grep " -> " >/dev/null; then - continue - fi - # The statement above tries to avoid entering an - # endless loop below, in case of cyclic links. - # We might still enter an endless loop, since a link - # loop can be closed while we follow links, - # but so what? - potlib="$potent_lib" - while test -h "$potlib" 2>/dev/null; do - potliblink=`ls -ld $potlib | sed 's/.* -> //'` - case $potliblink in - [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; - *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";; - esac - done - if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \ - | sed 10q \ - | egrep "$file_magic_regex" > /dev/null; then - newdeplibs="$newdeplibs $a_deplib" - a_deplib="" - break 2 - fi - done - done - if test -n "$a_deplib" ; then - droppeddeps=yes - echo - echo "*** Warning: This library needs some functionality provided by $a_deplib." - echo "*** I have the capability to make that library automatically link in when" - echo "*** you link to this library. But I can only do this if you have a" - echo "*** shared version of the library, which you do not appear to have." - fi - else - # Add a -L argument. - newdeplibs="$newdeplibs $a_deplib" - fi - done # Gone through all deplibs. - ;; - match_pattern*) - set dummy $deplibs_check_method - match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"` - for a_deplib in $deplibs; do - name="`expr $a_deplib : '-l\(.*\)'`" - # If $name is empty we are operating on a -L argument. - if test -n "$name" && test "$name" != "0"; then - libname=`eval \\$echo \"$libname_spec\"` - for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do - potential_libs=`ls $i/$libname[.-]* 2>/dev/null` - for potent_lib in $potential_libs; do - if eval echo \"$potent_lib\" 2>/dev/null \ - | sed 10q \ - | egrep "$match_pattern_regex" > /dev/null; then - newdeplibs="$newdeplibs $a_deplib" - a_deplib="" - break 2 - fi - done - done - if test -n "$a_deplib" ; then - droppeddeps=yes - echo - echo "*** Warning: This library needs some functionality provided by $a_deplib." - echo "*** I have the capability to make that library automatically link in when" - echo "*** you link to this library. But I can only do this if you have a" - echo "*** shared version of the library, which you do not appear to have." - fi - else - # Add a -L argument. - newdeplibs="$newdeplibs $a_deplib" - fi - done # Gone through all deplibs. - ;; - none | unknown | *) - newdeplibs="" - if $echo "X $deplibs" | $Xsed -e 's/ -lc$//' \ - -e 's/ -[LR][^ ]*//g' -e 's/[ ]//g' | - grep . >/dev/null; then - echo - if test "X$deplibs_check_method" = "Xnone"; then - echo "*** Warning: inter-library dependencies are not supported in this platform." - else - echo "*** Warning: inter-library dependencies are not known to be supported." - fi - echo "*** All declared inter-library dependencies are being dropped." - droppeddeps=yes - fi - ;; - esac - versuffix=$versuffix_save - major=$major_save - release=$release_save - libname=$libname_save - name=$name_save - - case $host in - *-*-rhapsody* | *-*-darwin1.[012]) - # On Rhapsody replace the C library is the System framework - newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'` - ;; - esac - - if test "$droppeddeps" = yes; then - if test "$module" = yes; then - echo - echo "*** Warning: libtool could not satisfy all declared inter-library" - echo "*** dependencies of module $libname. Therefore, libtool will create" - echo "*** a static module, that should work as long as the dlopening" - echo "*** application is linked with the -dlopen flag." - if test -z "$global_symbol_pipe"; then - echo - echo "*** However, this would only work if libtool was able to extract symbol" - echo "*** lists from a program, using \`nm' or equivalent, but libtool could" - echo "*** not find such a program. So, this module is probably useless." - echo "*** \`nm' from GNU binutils and a full rebuild may help." - fi - if test "$build_old_libs" = no; then - oldlibs="$output_objdir/$libname.$libext" - build_libtool_libs=module - build_old_libs=yes - else - build_libtool_libs=no - fi - else - echo "*** The inter-library dependencies that have been dropped here will be" - echo "*** automatically added whenever a program is linked with this library" - echo "*** or is declared to -dlopen it." - - if test $allow_undefined = no; then - echo - echo "*** Since this library must not contain undefined symbols," - echo "*** because either the platform does not support them or" - echo "*** it was explicitly requested with -no-undefined," - echo "*** libtool will only create a static version of it." - if test "$build_old_libs" = no; then - oldlibs="$output_objdir/$libname.$libext" - build_libtool_libs=module - build_old_libs=yes - else - build_libtool_libs=no - fi - fi - fi - fi - # Done checking deplibs! - deplibs=$newdeplibs - fi - - # All the library-specific variables (install_libdir is set above). - library_names= - old_library= - dlname= - - # Test again, we may have decided not to build it any more - if test "$build_libtool_libs" = yes; then - if test $hardcode_into_libs = yes; then - # Hardcode the library paths - hardcode_libdirs= - dep_rpath= - rpath="$finalize_rpath" - test "$mode" != relink && rpath="$compile_rpath$rpath" - for libdir in $rpath; do - if test -n "$hardcode_libdir_flag_spec"; then - if test -n "$hardcode_libdir_separator"; then - if test -z "$hardcode_libdirs"; then - hardcode_libdirs="$libdir" - else - # Just accumulate the unique libdirs. - case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in - *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) - ;; - *) - hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" - ;; - esac - fi - else - eval flag=\"$hardcode_libdir_flag_spec\" - dep_rpath="$dep_rpath $flag" - fi - elif test -n "$runpath_var"; then - case "$perm_rpath " in - *" $libdir "*) ;; - *) perm_rpath="$perm_rpath $libdir" ;; - esac - fi - done - # Substitute the hardcoded libdirs into the rpath. - if test -n "$hardcode_libdir_separator" && - test -n "$hardcode_libdirs"; then - libdir="$hardcode_libdirs" - eval dep_rpath=\"$hardcode_libdir_flag_spec\" - fi - if test -n "$runpath_var" && test -n "$perm_rpath"; then - # We should set the runpath_var. - rpath= - for dir in $perm_rpath; do - rpath="$rpath$dir:" - done - eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" - fi - test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" - fi - - shlibpath="$finalize_shlibpath" - test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath" - if test -n "$shlibpath"; then - eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" - fi - - # Get the real and link names of the library. - eval library_names=\"$library_names_spec\" - set dummy $library_names - realname="$2" - shift; shift - - if test -n "$soname_spec"; then - eval soname=\"$soname_spec\" - else - soname="$realname" - fi - test -z "$dlname" && dlname=$soname - - lib="$output_objdir/$realname" - for link - do - linknames="$linknames $link" - done - - # Ensure that we have .o objects for linkers which dislike .lo - # (e.g. aix) in case we are running --disable-static - for obj in $libobjs; do - xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'` - if test "X$xdir" = "X$obj"; then - xdir="." - else - xdir="$xdir" - fi - baseobj=`$echo "X$obj" | $Xsed -e 's%^.*/%%'` - oldobj=`$echo "X$baseobj" | $Xsed -e "$lo2o"` - if test ! -f $xdir/$oldobj; then - $show "(cd $xdir && ${LN_S} $baseobj $oldobj)" - $run eval '(cd $xdir && ${LN_S} $baseobj $oldobj)' || exit $? - fi - done - - # Use standard objects if they are pic - test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` - - # Prepare the list of exported symbols - if test -z "$export_symbols"; then - if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then - $show "generating symbol list for \`$libname.la'" - export_symbols="$output_objdir/$libname.exp" - $run $rm $export_symbols - eval cmds=\"$export_symbols_cmds\" - save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" - $show "$cmd" - $run eval "$cmd" || exit $? - done - IFS="$save_ifs" - if test -n "$export_symbols_regex"; then - $show "egrep -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\"" - $run eval 'egrep -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' - $show "$mv \"${export_symbols}T\" \"$export_symbols\"" - $run eval '$mv "${export_symbols}T" "$export_symbols"' - fi - fi - fi - - if test -n "$export_symbols" && test -n "$include_expsyms"; then - $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"' - fi - - if test -n "$convenience"; then - if test -n "$whole_archive_flag_spec"; then - eval libobjs=\"\$libobjs $whole_archive_flag_spec\" - else - gentop="$output_objdir/${outputname}x" - $show "${rm}r $gentop" - $run ${rm}r "$gentop" - $show "mkdir $gentop" - $run mkdir "$gentop" - status=$? - if test $status -ne 0 && test ! -d "$gentop"; then - exit $status - fi - generated="$generated $gentop" - - for xlib in $convenience; do - # Extract the objects. - case $xlib in - [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;; - *) xabs=`pwd`"/$xlib" ;; - esac - xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'` - xdir="$gentop/$xlib" - - $show "${rm}r $xdir" - $run ${rm}r "$xdir" - $show "mkdir $xdir" - $run mkdir "$xdir" - status=$? - if test $status -ne 0 && test ! -d "$xdir"; then - exit $status - fi - $show "(cd $xdir && $AR x $xabs)" - $run eval "(cd \$xdir && $AR x \$xabs)" || exit $? - - libobjs="$libobjs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP` - done - fi - fi - - if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then - eval flag=\"$thread_safe_flag_spec\" - linker_flags="$linker_flags $flag" - fi - - # Make a backup of the uninstalled library when relinking - if test "$mode" = relink; then - $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $? - fi - - # Do each of the archive commands. - if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then - eval cmds=\"$archive_expsym_cmds\" - else - eval cmds=\"$archive_cmds\" - fi - save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" - $show "$cmd" - $run eval "$cmd" || exit $? - done - IFS="$save_ifs" - - # Restore the uninstalled library and exit - if test "$mode" = relink; then - $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $? - exit 0 - fi - - # Create links to the real library. - for linkname in $linknames; do - if test "$realname" != "$linkname"; then - $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)" - $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $? - fi - done - - # If -module or -export-dynamic was specified, set the dlname. - if test "$module" = yes || test "$export_dynamic" = yes; then - # On all known operating systems, these are identical. - dlname="$soname" - fi - fi - ;; - - obj) - if test -n "$deplibs"; then - $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2 - fi - - if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then - $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2 - fi - - if test -n "$rpath"; then - $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2 - fi - - if test -n "$xrpath"; then - $echo "$modename: warning: \`-R' is ignored for objects" 1>&2 - fi - - if test -n "$vinfo"; then - $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2 - fi - - if test -n "$release"; then - $echo "$modename: warning: \`-release' is ignored for objects" 1>&2 - fi - - case $output in - *.lo) - if test -n "$objs$old_deplibs"; then - $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2 - exit 1 - fi - libobj="$output" - obj=`$echo "X$output" | $Xsed -e "$lo2o"` - ;; - *) - libobj= - obj="$output" - ;; - esac - - # Delete the old objects. - $run $rm $obj $libobj - - # Objects from convenience libraries. This assumes - # single-version convenience libraries. Whenever we create - # different ones for PIC/non-PIC, this we'll have to duplicate - # the extraction. - reload_conv_objs= - gentop= - # reload_cmds runs $LD directly, so let us get rid of - # -Wl from whole_archive_flag_spec - wl= - - if test -n "$convenience"; then - if test -n "$whole_archive_flag_spec"; then - eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\" - else - gentop="$output_objdir/${obj}x" - $show "${rm}r $gentop" - $run ${rm}r "$gentop" - $show "mkdir $gentop" - $run mkdir "$gentop" - status=$? - if test $status -ne 0 && test ! -d "$gentop"; then - exit $status - fi - generated="$generated $gentop" - - for xlib in $convenience; do - # Extract the objects. - case $xlib in - [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;; - *) xabs=`pwd`"/$xlib" ;; - esac - xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'` - xdir="$gentop/$xlib" - - $show "${rm}r $xdir" - $run ${rm}r "$xdir" - $show "mkdir $xdir" - $run mkdir "$xdir" - status=$? - if test $status -ne 0 && test ! -d "$xdir"; then - exit $status - fi - $show "(cd $xdir && $AR x $xabs)" - $run eval "(cd \$xdir && $AR x \$xabs)" || exit $? - - reload_conv_objs="$reload_objs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP` - done - fi - fi - - # Create the old-style object. - reload_objs="$objs$old_deplibs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test - - output="$obj" - eval cmds=\"$reload_cmds\" - save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" - $show "$cmd" - $run eval "$cmd" || exit $? - done - IFS="$save_ifs" - - # Exit if we aren't doing a library object file. - if test -z "$libobj"; then - if test -n "$gentop"; then - $show "${rm}r $gentop" - $run ${rm}r $gentop - fi - - exit 0 - fi - - if test "$build_libtool_libs" != yes; then - if test -n "$gentop"; then - $show "${rm}r $gentop" - $run ${rm}r $gentop - fi - - # Create an invalid libtool object if no PIC, so that we don't - # accidentally link it into a program. - $show "echo timestamp > $libobj" - $run eval "echo timestamp > $libobj" || exit $? - exit 0 - fi - - if test -n "$pic_flag" || test "$pic_mode" != default; then - # Only do commands if we really have different PIC objects. - reload_objs="$libobjs $reload_conv_objs" - output="$libobj" - eval cmds=\"$reload_cmds\" - save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" - $show "$cmd" - $run eval "$cmd" || exit $? - done - IFS="$save_ifs" - else - # Just create a symlink. - $show $rm $libobj - $run $rm $libobj - xdir=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'` - if test "X$xdir" = "X$libobj"; then - xdir="." - else - xdir="$xdir" - fi - baseobj=`$echo "X$libobj" | $Xsed -e 's%^.*/%%'` - oldobj=`$echo "X$baseobj" | $Xsed -e "$lo2o"` - $show "(cd $xdir && $LN_S $oldobj $baseobj)" - $run eval '(cd $xdir && $LN_S $oldobj $baseobj)' || exit $? - fi - - if test -n "$gentop"; then - $show "${rm}r $gentop" - $run ${rm}r $gentop - fi - - exit 0 - ;; - - prog) - case $host in - *cygwin*) output=`echo $output | sed -e 's,.exe$,,;s,$,.exe,'` ;; - esac - if test -n "$vinfo"; then - $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2 - fi - - if test -n "$release"; then - $echo "$modename: warning: \`-release' is ignored for programs" 1>&2 - fi - - if test "$preload" = yes; then - if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown && - test "$dlopen_self_static" = unknown; then - $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support." - fi - fi - - case $host in - *-*-rhapsody* | *-*-darwin1.[012]) - # On Rhapsody replace the C library is the System framework - compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'` - finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'` - ;; - esac - - compile_command="$compile_command $compile_deplibs" - finalize_command="$finalize_command $finalize_deplibs" - - if test -n "$rpath$xrpath"; then - # If the user specified any rpath flags, then add them. - for libdir in $rpath $xrpath; do - # This is the magic to use -rpath. - case "$finalize_rpath " in - *" $libdir "*) ;; - *) finalize_rpath="$finalize_rpath $libdir" ;; - esac - done - fi - - # Now hardcode the library paths - rpath= - hardcode_libdirs= - for libdir in $compile_rpath $finalize_rpath; do - if test -n "$hardcode_libdir_flag_spec"; then - if test -n "$hardcode_libdir_separator"; then - if test -z "$hardcode_libdirs"; then - hardcode_libdirs="$libdir" - else - # Just accumulate the unique libdirs. - case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in - *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) - ;; - *) - hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" - ;; - esac - fi - else - eval flag=\"$hardcode_libdir_flag_spec\" - rpath="$rpath $flag" - fi - elif test -n "$runpath_var"; then - case "$perm_rpath " in - *" $libdir "*) ;; - *) perm_rpath="$perm_rpath $libdir" ;; - esac - fi - case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) - case :$dllsearchpath: in - *":$libdir:"*) ;; - *) dllsearchpath="$dllsearchpath:$libdir";; - esac - ;; - esac - done - # Substitute the hardcoded libdirs into the rpath. - if test -n "$hardcode_libdir_separator" && - test -n "$hardcode_libdirs"; then - libdir="$hardcode_libdirs" - eval rpath=\" $hardcode_libdir_flag_spec\" - fi - compile_rpath="$rpath" - - rpath= - hardcode_libdirs= - for libdir in $finalize_rpath; do - if test -n "$hardcode_libdir_flag_spec"; then - if test -n "$hardcode_libdir_separator"; then - if test -z "$hardcode_libdirs"; then - hardcode_libdirs="$libdir" - else - # Just accumulate the unique libdirs. - case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in - *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) - ;; - *) - hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" - ;; - esac - fi - else - eval flag=\"$hardcode_libdir_flag_spec\" - rpath="$rpath $flag" - fi - elif test -n "$runpath_var"; then - case "$finalize_perm_rpath " in - *" $libdir "*) ;; - *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;; - esac - fi - done - # Substitute the hardcoded libdirs into the rpath. - if test -n "$hardcode_libdir_separator" && - test -n "$hardcode_libdirs"; then - libdir="$hardcode_libdirs" - eval rpath=\" $hardcode_libdir_flag_spec\" - fi - finalize_rpath="$rpath" - - if test -n "$libobjs" && test "$build_old_libs" = yes; then - # Transform all the library objects into standard objects. - compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` - finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` - fi - - dlsyms= - if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then - if test -n "$NM" && test -n "$global_symbol_pipe"; then - dlsyms="${outputname}S.c" - else - $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2 - fi - fi - - if test -n "$dlsyms"; then - case $dlsyms in - "") ;; - *.c) - # Discover the nlist of each of the dlfiles. - nlist="$output_objdir/${outputname}.nm" - - $show "$rm $nlist ${nlist}S ${nlist}T" - $run $rm "$nlist" "${nlist}S" "${nlist}T" - - # Parse the name list into a source file. - $show "creating $output_objdir/$dlsyms" - - test -z "$run" && $echo > "$output_objdir/$dlsyms" "\ -/* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */ -/* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */ - -#ifdef __cplusplus -extern \"C\" { -#endif - -/* Prevent the only kind of declaration conflicts we can make. */ -#define lt_preloaded_symbols some_other_symbol - -/* External symbol declarations for the compiler. */\ -" - - if test "$dlself" = yes; then - $show "generating symbol list for \`$output'" - - test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist" - - # Add our own program objects to the symbol list. - progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` - for arg in $progfiles; do - $show "extracting global C symbols from \`$arg'" - $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'" - done - - if test -n "$exclude_expsyms"; then - $run eval 'egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' - $run eval '$mv "$nlist"T "$nlist"' - fi - - if test -n "$export_symbols_regex"; then - $run eval 'egrep -e "$export_symbols_regex" "$nlist" > "$nlist"T' - $run eval '$mv "$nlist"T "$nlist"' - fi - - # Prepare the list of exported symbols - if test -z "$export_symbols"; then - export_symbols="$output_objdir/$output.exp" - $run $rm $export_symbols - $run eval "sed -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' - else - $run eval "sed -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"' - $run eval 'grep -f "$output_objdir/$output.exp" < "$nlist" > "$nlist"T' - $run eval 'mv "$nlist"T "$nlist"' - fi - fi - - for arg in $dlprefiles; do - $show "extracting global C symbols from \`$arg'" - name=`echo "$arg" | sed -e 's%^.*/%%'` - $run eval 'echo ": $name " >> "$nlist"' - $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'" - done - - if test -z "$run"; then - # Make sure we have at least an empty file. - test -f "$nlist" || : > "$nlist" - - if test -n "$exclude_expsyms"; then - egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T - $mv "$nlist"T "$nlist" - fi - - # Try sorting and uniquifying the output. - if grep -v "^: " < "$nlist" | sort +2 | uniq > "$nlist"S; then - : - else - grep -v "^: " < "$nlist" > "$nlist"S - fi - - if test -f "$nlist"S; then - eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"' - else - echo '/* NONE */' >> "$output_objdir/$dlsyms" - fi - - $echo >> "$output_objdir/$dlsyms" "\ - -#undef lt_preloaded_symbols - -#if defined (__STDC__) && __STDC__ -# define lt_ptr void * -#else -# define lt_ptr char * -# define const -#endif - -/* The mapping between symbol names and symbols. */ -const struct { - const char *name; - lt_ptr address; -} -lt_preloaded_symbols[] = -{\ -" - - eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms" - - $echo >> "$output_objdir/$dlsyms" "\ - {0, (lt_ptr) 0} -}; - -/* This works around a problem in FreeBSD linker */ -#ifdef FREEBSD_WORKAROUND -static const void *lt_preloaded_setup() { - return lt_preloaded_symbols; -} -#endif - -#ifdef __cplusplus -} -#endif\ -" - fi - - pic_flag_for_symtable= - case $host in - # compiling the symbol table file with pic_flag works around - # a FreeBSD bug that causes programs to crash when -lm is - # linked before any other PIC object. But we must not use - # pic_flag when linking with -static. The problem exists in - # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. - *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) - case "$compile_command " in - *" -static "*) ;; - *) pic_flag_for_symtable=" $pic_flag -DPIC -DFREEBSD_WORKAROUND";; - esac;; - *-*-hpux*) - case "$compile_command " in - *" -static "*) ;; - *) pic_flag_for_symtable=" $pic_flag -DPIC";; - esac - esac - - # Now compile the dynamic symbol file. - $show "(cd $output_objdir && $CC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")" - $run eval '(cd $output_objdir && $CC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $? - - # Clean up the generated files. - $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T" - $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T" - - # Transform the symbol file into the correct name. - compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"` - finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"` - ;; - *) - $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2 - exit 1 - ;; - esac - else - # We keep going just in case the user didn't refer to - # lt_preloaded_symbols. The linker will fail if global_symbol_pipe - # really was required. - - # Nullify the symbol file. - compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"` - finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"` - fi - - if test $need_relink = no || test "$build_libtool_libs" != yes; then - # Replace the output file specification. - compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` - link_command="$compile_command$compile_rpath" - - # We have no uninstalled library dependencies, so finalize right now. - $show "$link_command" - $run eval "$link_command" - status=$? - - # Delete the generated files. - if test -n "$dlsyms"; then - $show "$rm $output_objdir/${outputname}S.${objext}" - $run $rm "$output_objdir/${outputname}S.${objext}" - fi - - exit $status - fi - - if test -n "$shlibpath_var"; then - # We should set the shlibpath_var - rpath= - for dir in $temp_rpath; do - case $dir in - [\\/]* | [A-Za-z]:[\\/]*) - # Absolute path. - rpath="$rpath$dir:" - ;; - *) - # Relative path: add a thisdir entry. - rpath="$rpath\$thisdir/$dir:" - ;; - esac - done - temp_rpath="$rpath" - fi - - if test -n "$compile_shlibpath$finalize_shlibpath"; then - compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" - fi - if test -n "$finalize_shlibpath"; then - finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" - fi - - compile_var= - finalize_var= - if test -n "$runpath_var"; then - if test -n "$perm_rpath"; then - # We should set the runpath_var. - rpath= - for dir in $perm_rpath; do - rpath="$rpath$dir:" - done - compile_var="$runpath_var=\"$rpath\$$runpath_var\" " - fi - if test -n "$finalize_perm_rpath"; then - # We should set the runpath_var. - rpath= - for dir in $finalize_perm_rpath; do - rpath="$rpath$dir:" - done - finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " - fi - fi - - if test "$no_install" = yes; then - # We don't need to create a wrapper script. - link_command="$compile_var$compile_command$compile_rpath" - # Replace the output file specification. - link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` - # Delete the old output file. - $run $rm $output - # Link the executable and exit - $show "$link_command" - $run eval "$link_command" || exit $? - exit 0 - fi - - if test "$hardcode_action" = relink; then - # Fast installation is not supported - link_command="$compile_var$compile_command$compile_rpath" - relink_command="$finalize_var$finalize_command$finalize_rpath" - - $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2 - $echo "$modename: \`$output' will be relinked during installation" 1>&2 - else - if test "$fast_install" != no; then - link_command="$finalize_var$compile_command$finalize_rpath" - if test "$fast_install" = yes; then - relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'` - else - # fast_install is set to needless - relink_command= - fi - else - link_command="$compile_var$compile_command$compile_rpath" - relink_command="$finalize_var$finalize_command$finalize_rpath" - fi - fi - - # Replace the output file specification. - link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` - - # Delete the old output files. - $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname - - $show "$link_command" - $run eval "$link_command" || exit $? - - # Now create the wrapper script. - $show "creating $output" - - # Quote the relink command for shipping. - if test -n "$relink_command"; then - # Preserve any variables that may affect compiler behavior - for var in $variables_saved_for_relink; do - if eval test -z \"\${$var+set}\"; then - relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command" - elif eval var_value=\$$var; test -z "$var_value"; then - relink_command="$var=; export $var; $relink_command" - else - var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"` - relink_command="$var=\"$var_value\"; export $var; $relink_command" - fi - done - relink_command="cd `pwd`; $relink_command" - relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"` - fi - - # Quote $echo for shipping. - if test "X$echo" = "X$SHELL $0 --fallback-echo"; then - case $0 in - [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $0 --fallback-echo";; - *) qecho="$SHELL `pwd`/$0 --fallback-echo";; - esac - qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"` - else - qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"` - fi - - # Only actually do things if our run command is non-null. - if test -z "$run"; then - # win32 will think the script is a binary if it has - # a .exe suffix, so we strip it off here. - case $output in - *.exe) output=`echo $output|sed 's,.exe$,,'` ;; - esac - # test for cygwin because mv fails w/o .exe extensions - case $host in - *cygwin*) exeext=.exe ;; - *) exeext= ;; - esac - $rm $output - trap "$rm $output; exit 1" 1 2 15 - - $echo > $output "\ -#! $SHELL - -# $output - temporary wrapper script for $objdir/$outputname -# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP -# -# The $output program cannot be directly executed until all the libtool -# libraries that it depends on are installed. -# -# This wrapper script should never be moved out of the build directory. -# If it is, it will not operate correctly. - -# Sed substitution that helps us do robust quoting. It backslashifies -# metacharacters that are still active within double-quoted strings. -Xsed='sed -e 1s/^X//' -sed_quote_subst='$sed_quote_subst' - -# The HP-UX ksh and POSIX shell print the target directory to stdout -# if CDPATH is set. -if test \"\${CDPATH+set}\" = set; then CDPATH=:; export CDPATH; fi - -relink_command=\"$relink_command\" - -# This environment variable determines our operation mode. -if test \"\$libtool_install_magic\" = \"$magic\"; then - # install mode needs the following variable: - notinst_deplibs='$notinst_deplibs' -else - # When we are sourced in execute mode, \$file and \$echo are already set. - if test \"\$libtool_execute_magic\" != \"$magic\"; then - echo=\"$qecho\" - file=\"\$0\" - # Make sure echo works. - if test \"X\$1\" = X--no-reexec; then - # Discard the --no-reexec flag, and continue. - shift - elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then - # Yippee, \$echo works! - : - else - # Restart under the correct shell, and then maybe \$echo will work. - exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"} - fi - fi\ -" - $echo >> $output "\ - - # Find the directory that this script lives in. - thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\` - test \"x\$thisdir\" = \"x\$file\" && thisdir=. - - # Follow symbolic links until we get to the real thisdir. - file=\`ls -ld \"\$file\" | sed -n 's/.*-> //p'\` - while test -n \"\$file\"; do - destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\` - - # If there was a directory component, then change thisdir. - if test \"x\$destdir\" != \"x\$file\"; then - case \"\$destdir\" in - [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; - *) thisdir=\"\$thisdir/\$destdir\" ;; - esac - fi - - file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\` - file=\`ls -ld \"\$thisdir/\$file\" | sed -n 's/.*-> //p'\` - done - - # Try to get the absolute directory name. - absdir=\`cd \"\$thisdir\" && pwd\` - test -n \"\$absdir\" && thisdir=\"\$absdir\" -" - - if test "$fast_install" = yes; then - echo >> $output "\ - program=lt-'$outputname'$exeext - progdir=\"\$thisdir/$objdir\" - - if test ! -f \"\$progdir/\$program\" || \\ - { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | sed 1q\`; \\ - test \"X\$file\" != \"X\$progdir/\$program\"; }; then - - file=\"\$\$-\$program\" - - if test ! -d \"\$progdir\"; then - $mkdir \"\$progdir\" - else - $rm \"\$progdir/\$file\" - fi" - - echo >> $output "\ - - # relink executable if necessary - if test -n \"\$relink_command\"; then - if relink_command_output=\`eval \$relink_command 2>&1\`; then : - else - $echo \"\$relink_command_output\" >&2 - $rm \"\$progdir/\$file\" - exit 1 - fi - fi - - $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || - { $rm \"\$progdir/\$program\"; - $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; } - $rm \"\$progdir/\$file\" - fi" - else - echo >> $output "\ - program='$outputname' - progdir=\"\$thisdir/$objdir\" -" - fi - - echo >> $output "\ - - if test -f \"\$progdir/\$program\"; then" - - # Export our shlibpath_var if we have one. - if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then - $echo >> $output "\ - # Add our own library path to $shlibpath_var - $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" - - # Some systems cannot cope with colon-terminated $shlibpath_var - # The second colon is a workaround for a bug in BeOS R4 sed - $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\` - - export $shlibpath_var -" - fi - - # fixup the dll searchpath if we need to. - if test -n "$dllsearchpath"; then - $echo >> $output "\ - # Add the dll search path components to the executable PATH - PATH=$dllsearchpath:\$PATH -" - fi - - $echo >> $output "\ - if test \"\$libtool_execute_magic\" != \"$magic\"; then - # Run the actual program with our arguments. -" - case $host in - # win32 systems need to use the prog path for dll - # lookup to work - *-*-cygwin* | *-*-pw32*) - $echo >> $output "\ - exec \$progdir/\$program \${1+\"\$@\"} -" - ;; - - # Backslashes separate directories on plain windows - *-*-mingw | *-*-os2*) - $echo >> $output "\ - exec \$progdir\\\\\$program \${1+\"\$@\"} -" - ;; - - *) - $echo >> $output "\ - # Export the path to the program. - PATH=\"\$progdir:\$PATH\" - export PATH - - exec \$program \${1+\"\$@\"} -" - ;; - esac - $echo >> $output "\ - \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\" - exit 1 - fi - else - # The program doesn't exist. - \$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2 - \$echo \"This script is just a wrapper for \$program.\" 1>&2 - echo \"See the $PACKAGE documentation for more information.\" 1>&2 - exit 1 - fi -fi\ -" - chmod +x $output - fi - exit 0 - ;; - esac - - # See if we need to build an old-fashioned archive. - for oldlib in $oldlibs; do - - if test "$build_libtool_libs" = convenience; then - oldobjs="$libobjs_save" - addlibs="$convenience" - build_libtool_libs=no - else - if test "$build_libtool_libs" = module; then - oldobjs="$libobjs_save" - build_libtool_libs=no - else - oldobjs="$objs$old_deplibs "`$echo "X$libobjs_save" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP` - fi - addlibs="$old_convenience" - fi - - if test -n "$addlibs"; then - gentop="$output_objdir/${outputname}x" - $show "${rm}r $gentop" - $run ${rm}r "$gentop" - $show "mkdir $gentop" - $run mkdir "$gentop" - status=$? - if test $status -ne 0 && test ! -d "$gentop"; then - exit $status - fi - generated="$generated $gentop" - - # Add in members from convenience archives. - for xlib in $addlibs; do - # Extract the objects. - case $xlib in - [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;; - *) xabs=`pwd`"/$xlib" ;; - esac - xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'` - xdir="$gentop/$xlib" - - $show "${rm}r $xdir" - $run ${rm}r "$xdir" - $show "mkdir $xdir" - $run mkdir "$xdir" - status=$? - if test $status -ne 0 && test ! -d "$xdir"; then - exit $status - fi - $show "(cd $xdir && $AR x $xabs)" - $run eval "(cd \$xdir && $AR x \$xabs)" || exit $? - - oldobjs="$oldobjs "`find $xdir -name \*.${objext} -print -o -name \*.lo -print | $NL2SP` - done - fi - - # Do each command in the archive commands. - if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then - eval cmds=\"$old_archive_from_new_cmds\" - else - # Ensure that we have .o objects in place in case we decided - # not to build a shared library, and have fallen back to building - # static libs even though --disable-static was passed! - for oldobj in $oldobjs; do - if test ! -f $oldobj; then - xdir=`$echo "X$oldobj" | $Xsed -e 's%/[^/]*$%%'` - if test "X$xdir" = "X$oldobj"; then - xdir="." - else - xdir="$xdir" - fi - baseobj=`$echo "X$oldobj" | $Xsed -e 's%^.*/%%'` - obj=`$echo "X$baseobj" | $Xsed -e "$o2lo"` - $show "(cd $xdir && ${LN_S} $obj $baseobj)" - $run eval '(cd $xdir && ${LN_S} $obj $baseobj)' || exit $? - fi - done - - eval cmds=\"$old_archive_cmds\" - fi - save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" - $show "$cmd" - $run eval "$cmd" || exit $? - done - IFS="$save_ifs" - done - - if test -n "$generated"; then - $show "${rm}r$generated" - $run ${rm}r$generated - fi - - # Now create the libtool archive. - case $output in - *.la) - old_library= - test "$build_old_libs" = yes && old_library="$libname.$libext" - $show "creating $output" - - # Preserve any variables that may affect compiler behavior - for var in $variables_saved_for_relink; do - if eval test -z \"\${$var+set}\"; then - relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command" - elif eval var_value=\$$var; test -z "$var_value"; then - relink_command="$var=; export $var; $relink_command" - else - var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"` - relink_command="$var=\"$var_value\"; export $var; $relink_command" - fi - done - # Quote the link command for shipping. - relink_command="cd `pwd`; $SHELL $0 --mode=relink $libtool_args" - relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"` - - # Only create the output if not a dry run. - if test -z "$run"; then - for installed in no yes; do - if test "$installed" = yes; then - if test -z "$install_libdir"; then - break - fi - output="$output_objdir/$outputname"i - # Replace all uninstalled libtool libraries with the installed ones - newdependency_libs= - for deplib in $dependency_libs; do - case $deplib in - *.la) - name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'` - eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` - if test -z "$libdir"; then - $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 - exit 1 - fi - newdependency_libs="$newdependency_libs $libdir/$name" - ;; - *) newdependency_libs="$newdependency_libs $deplib" ;; - esac - done - dependency_libs="$newdependency_libs" - newdlfiles= - for lib in $dlfiles; do - name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` - eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $lib` - if test -z "$libdir"; then - $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 - exit 1 - fi - newdlfiles="$newdlfiles $libdir/$name" - done - dlfiles="$newdlfiles" - newdlprefiles= - for lib in $dlprefiles; do - name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` - eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $lib` - if test -z "$libdir"; then - $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 - exit 1 - fi - newdlprefiles="$newdlprefiles $libdir/$name" - done - dlprefiles="$newdlprefiles" - fi - $rm $output - # place dlname in correct position for cygwin - tdlname=$dlname - case $host,$output,$installed,$module,$dlname in - *cygwin*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;; - esac - $echo > $output "\ -# $outputname - a libtool library file -# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP -# -# Please DO NOT delete this file! -# It is necessary for linking the library. - -# The name that we can dlopen(3). -dlname='$tdlname' - -# Names of this library. -library_names='$library_names' - -# The name of the static archive. -old_library='$old_library' - -# Libraries that this one depends upon. -dependency_libs='$dependency_libs' - -# Version information for $libname. -current=$current -age=$age -revision=$revision - -# Is this an already installed library? -installed=$installed - -# Files to dlopen/dlpreopen -dlopen='$dlfiles' -dlpreopen='$dlprefiles' - -# Directory that this library needs to be installed in: -libdir='$install_libdir'" - if test "$installed" = no && test $need_relink = yes; then - $echo >> $output "\ -relink_command=\"$relink_command\"" - fi - done - fi - - # Do a symbolic link so that the libtool archive can be found in - # LD_LIBRARY_PATH before the program is installed. - $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)" - $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $? - ;; - esac - exit 0 - ;; - - # libtool install mode - install) - modename="$modename: install" - - # There may be an optional sh(1) argument at the beginning of - # install_prog (especially on Windows NT). - if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh || - # Allow the use of GNU shtool's install command. - $echo "X$nonopt" | $Xsed | grep shtool > /dev/null; then - # Aesthetically quote it. - arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"` - case $arg in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) - arg="\"$arg\"" - ;; - esac - install_prog="$arg " - arg="$1" - shift - else - install_prog= - arg="$nonopt" - fi - - # The real first argument should be the name of the installation program. - # Aesthetically quote it. - arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` - case $arg in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) - arg="\"$arg\"" - ;; - esac - install_prog="$install_prog$arg" - - # We need to accept at least all the BSD install flags. - dest= - files= - opts= - prev= - install_type= - isdir=no - stripme= - for arg - do - if test -n "$dest"; then - files="$files $dest" - dest="$arg" - continue - fi - - case $arg in - -d) isdir=yes ;; - -f) prev="-f" ;; - -g) prev="-g" ;; - -m) prev="-m" ;; - -o) prev="-o" ;; - -s) - stripme=" -s" - continue - ;; - -*) ;; - - *) - # If the previous option needed an argument, then skip it. - if test -n "$prev"; then - prev= - else - dest="$arg" - continue - fi - ;; - esac - - # Aesthetically quote the argument. - arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` - case $arg in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) - arg="\"$arg\"" - ;; - esac - install_prog="$install_prog $arg" - done - - if test -z "$install_prog"; then - $echo "$modename: you must specify an install program" 1>&2 - $echo "$help" 1>&2 - exit 1 - fi - - if test -n "$prev"; then - $echo "$modename: the \`$prev' option requires an argument" 1>&2 - $echo "$help" 1>&2 - exit 1 - fi - - if test -z "$files"; then - if test -z "$dest"; then - $echo "$modename: no file or destination specified" 1>&2 - else - $echo "$modename: you must specify a destination" 1>&2 - fi - $echo "$help" 1>&2 - exit 1 - fi - - # Strip any trailing slash from the destination. - dest=`$echo "X$dest" | $Xsed -e 's%/$%%'` - - # Check to see that the destination is a directory. - test -d "$dest" && isdir=yes - if test "$isdir" = yes; then - destdir="$dest" - destname= - else - destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'` - test "X$destdir" = "X$dest" && destdir=. - destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'` - - # Not a directory, so check to see that there is only one file specified. - set dummy $files - if test $# -gt 2; then - $echo "$modename: \`$dest' is not a directory" 1>&2 - $echo "$help" 1>&2 - exit 1 - fi - fi - case $destdir in - [\\/]* | [A-Za-z]:[\\/]*) ;; - *) - for file in $files; do - case $file in - *.lo) ;; - *) - $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2 - $echo "$help" 1>&2 - exit 1 - ;; - esac - done - ;; - esac - - # This variable tells wrapper scripts just to set variables rather - # than running their programs. - libtool_install_magic="$magic" - - staticlibs= - future_libdirs= - current_libdirs= - for file in $files; do - - # Do each installation. - case $file in - *.$libext) - # Do the static libraries later. - staticlibs="$staticlibs $file" - ;; - - *.la) - # Check to see that this really is a libtool archive. - if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : - else - $echo "$modename: \`$file' is not a valid libtool archive" 1>&2 - $echo "$help" 1>&2 - exit 1 - fi - - library_names= - old_library= - relink_command= - # If there is no directory component, then add one. - case $file in - */* | *\\*) . $file ;; - *) . ./$file ;; - esac - - # Add the libdir to current_libdirs if it is the destination. - if test "X$destdir" = "X$libdir"; then - case "$current_libdirs " in - *" $libdir "*) ;; - *) current_libdirs="$current_libdirs $libdir" ;; - esac - else - # Note the libdir as a future libdir. - case "$future_libdirs " in - *" $libdir "*) ;; - *) future_libdirs="$future_libdirs $libdir" ;; - esac - fi - - dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/ - test "X$dir" = "X$file/" && dir= - dir="$dir$objdir" - - if test -n "$relink_command"; then - $echo "$modename: warning: relinking \`$file'" 1>&2 - $show "$relink_command" - if $run eval "$relink_command"; then : - else - $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2 - continue - fi - fi - - # See the names of the shared library. - set dummy $library_names - if test -n "$2"; then - realname="$2" - shift - shift - - srcname="$realname" - test -n "$relink_command" && srcname="$realname"T - - # Install the shared library and build the symlinks. - $show "$install_prog $dir/$srcname $destdir/$realname" - $run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $? - if test -n "$stripme" && test -n "$striplib"; then - $show "$striplib $destdir/$realname" - $run eval "$striplib $destdir/$realname" || exit $? - fi - - if test $# -gt 0; then - # Delete the old symlinks, and create new ones. - for linkname - do - if test "$linkname" != "$realname"; then - $show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)" - $run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)" - fi - done - fi - - # Do each command in the postinstall commands. - lib="$destdir/$realname" - eval cmds=\"$postinstall_cmds\" - save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" - $show "$cmd" - $run eval "$cmd" || exit $? - done - IFS="$save_ifs" - fi - - # Install the pseudo-library for information purposes. - name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` - instname="$dir/$name"i - $show "$install_prog $instname $destdir/$name" - $run eval "$install_prog $instname $destdir/$name" || exit $? - - # Maybe install the static library, too. - test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library" - ;; - - *.lo) - # Install (i.e. copy) a libtool object. - - # Figure out destination file name, if it wasn't already specified. - if test -n "$destname"; then - destfile="$destdir/$destname" - else - destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'` - destfile="$destdir/$destfile" - fi - - # Deduce the name of the destination old-style object file. - case $destfile in - *.lo) - staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"` - ;; - *.$objext) - staticdest="$destfile" - destfile= - ;; - *) - $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2 - $echo "$help" 1>&2 - exit 1 - ;; - esac - - # Install the libtool object if requested. - if test -n "$destfile"; then - $show "$install_prog $file $destfile" - $run eval "$install_prog $file $destfile" || exit $? - fi - - # Install the old object if enabled. - if test "$build_old_libs" = yes; then - # Deduce the name of the old-style object file. - staticobj=`$echo "X$file" | $Xsed -e "$lo2o"` - - $show "$install_prog $staticobj $staticdest" - $run eval "$install_prog \$staticobj \$staticdest" || exit $? - fi - exit 0 - ;; - - *) - # Figure out destination file name, if it wasn't already specified. - if test -n "$destname"; then - destfile="$destdir/$destname" - else - destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'` - destfile="$destdir/$destfile" - fi - - # Do a test to see if this is really a libtool program. - if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then - notinst_deplibs= - relink_command= - - # If there is no directory component, then add one. - case $file in - */* | *\\*) . $file ;; - *) . ./$file ;; - esac - - # Check the variables that should have been set. - if test -z "$notinst_deplibs"; then - $echo "$modename: invalid libtool wrapper script \`$file'" 1>&2 - exit 1 - fi - - finalize=yes - for lib in $notinst_deplibs; do - # Check to see that each library is installed. - libdir= - if test -f "$lib"; then - # If there is no directory component, then add one. - case $lib in - */* | *\\*) . $lib ;; - *) . ./$lib ;; - esac - fi - libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test - if test -n "$libdir" && test ! -f "$libfile"; then - $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2 - finalize=no - fi - done - - relink_command= - # If there is no directory component, then add one. - case $file in - */* | *\\*) . $file ;; - *) . ./$file ;; - esac - - outputname= - if test "$fast_install" = no && test -n "$relink_command"; then - if test "$finalize" = yes && test -z "$run"; then - tmpdir="/tmp" - test -n "$TMPDIR" && tmpdir="$TMPDIR" - tmpdir="$tmpdir/libtool-$$" - if $mkdir -p "$tmpdir" && chmod 700 "$tmpdir"; then : - else - $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2 - continue - fi - file=`$echo "X$file" | $Xsed -e 's%^.*/%%'` - outputname="$tmpdir/$file" - # Replace the output file specification. - relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'` - - $show "$relink_command" - if $run eval "$relink_command"; then : - else - $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2 - ${rm}r "$tmpdir" - continue - fi - file="$outputname" - else - $echo "$modename: warning: cannot relink \`$file'" 1>&2 - fi - else - # Install the binary that we compiled earlier. - file=`$echo "X$file" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"` - fi - fi - - # remove .exe since cygwin /usr/bin/install will append another - # one anyways - case $install_prog,$host in - /usr/bin/install*,*cygwin*) - case $file:$destfile in - *.exe:*.exe) - # this is ok - ;; - *.exe:*) - destfile=$destfile.exe - ;; - *:*.exe) - destfile=`echo $destfile | sed -e 's,.exe$,,'` - ;; - esac - ;; - esac - $show "$install_prog$stripme $file $destfile" - $run eval "$install_prog\$stripme \$file \$destfile" || exit $? - test -n "$outputname" && ${rm}r "$tmpdir" - ;; - esac - done - - for file in $staticlibs; do - name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` - - # Set up the ranlib parameters. - oldlib="$destdir/$name" - - $show "$install_prog $file $oldlib" - $run eval "$install_prog \$file \$oldlib" || exit $? - - if test -n "$stripme" && test -n "$striplib"; then - $show "$old_striplib $oldlib" - $run eval "$old_striplib $oldlib" || exit $? - fi - - # Do each command in the postinstall commands. - eval cmds=\"$old_postinstall_cmds\" - save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" - $show "$cmd" - $run eval "$cmd" || exit $? - done - IFS="$save_ifs" - done - - if test -n "$future_libdirs"; then - $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2 - fi - - if test -n "$current_libdirs"; then - # Maybe just do a dry run. - test -n "$run" && current_libdirs=" -n$current_libdirs" - exec_cmd='$SHELL $0 --finish$current_libdirs' - else - exit 0 - fi - ;; - - # libtool finish mode - finish) - modename="$modename: finish" - libdirs="$nonopt" - admincmds= - - if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then - for dir - do - libdirs="$libdirs $dir" - done - - for libdir in $libdirs; do - if test -n "$finish_cmds"; then - # Do each command in the finish commands. - eval cmds=\"$finish_cmds\" - save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" - $show "$cmd" - $run eval "$cmd" || admincmds="$admincmds - $cmd" - done - IFS="$save_ifs" - fi - if test -n "$finish_eval"; then - # Do the single finish_eval. - eval cmds=\"$finish_eval\" - $run eval "$cmds" || admincmds="$admincmds - $cmds" - fi - done - fi - - # Exit here if they wanted silent mode. - test "$show" = ":" && exit 0 - - echo "----------------------------------------------------------------------" - echo "Libraries have been installed in:" - for libdir in $libdirs; do - echo " $libdir" - done - echo - echo "If you ever happen to want to link against installed libraries" - echo "in a given directory, LIBDIR, you must either use libtool, and" - echo "specify the full pathname of the library, or use the \`-LLIBDIR'" - echo "flag during linking and do at least one of the following:" - if test -n "$shlibpath_var"; then - echo " - add LIBDIR to the \`$shlibpath_var' environment variable" - echo " during execution" - fi - if test -n "$runpath_var"; then - echo " - add LIBDIR to the \`$runpath_var' environment variable" - echo " during linking" - fi - if test -n "$hardcode_libdir_flag_spec"; then - libdir=LIBDIR - eval flag=\"$hardcode_libdir_flag_spec\" - - echo " - use the \`$flag' linker flag" - fi - if test -n "$admincmds"; then - echo " - have your system administrator run these commands:$admincmds" - fi - if test -f /etc/ld.so.conf; then - echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'" - fi - echo - echo "See any operating system documentation about shared libraries for" - echo "more information, such as the ld(1) and ld.so(8) manual pages." - echo "----------------------------------------------------------------------" - exit 0 - ;; - - # libtool execute mode - execute) - modename="$modename: execute" - - # The first argument is the command name. - cmd="$nonopt" - if test -z "$cmd"; then - $echo "$modename: you must specify a COMMAND" 1>&2 - $echo "$help" - exit 1 - fi - - # Handle -dlopen flags immediately. - for file in $execute_dlfiles; do - if test ! -f "$file"; then - $echo "$modename: \`$file' is not a file" 1>&2 - $echo "$help" 1>&2 - exit 1 - fi - - dir= - case $file in - *.la) - # Check to see that this really is a libtool archive. - if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : - else - $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 - $echo "$help" 1>&2 - exit 1 - fi - - # Read the libtool library. - dlname= - library_names= - - # If there is no directory component, then add one. - case $file in - */* | *\\*) . $file ;; - *) . ./$file ;; - esac - - # Skip this library if it cannot be dlopened. - if test -z "$dlname"; then - # Warn if it was a shared library. - test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'" - continue - fi - - dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` - test "X$dir" = "X$file" && dir=. - - if test -f "$dir/$objdir/$dlname"; then - dir="$dir/$objdir" - else - $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2 - exit 1 - fi - ;; - - *.lo) - # Just add the directory containing the .lo file. - dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` - test "X$dir" = "X$file" && dir=. - ;; - - *) - $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2 - continue - ;; - esac - - # Get the absolute pathname. - absdir=`cd "$dir" && pwd` - test -n "$absdir" && dir="$absdir" - - # Now add the directory to shlibpath_var. - if eval "test -z \"\$$shlibpath_var\""; then - eval "$shlibpath_var=\"\$dir\"" - else - eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" - fi - done - - # This variable tells wrapper scripts just to set shlibpath_var - # rather than running their programs. - libtool_execute_magic="$magic" - - # Check if any of the arguments is a wrapper script. - args= - for file - do - case $file in - -*) ;; - *) - # Do a test to see if this is really a libtool program. - if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then - # If there is no directory component, then add one. - case $file in - */* | *\\*) . $file ;; - *) . ./$file ;; - esac - - # Transform arg to wrapped name. - file="$progdir/$program" - fi - ;; - esac - # Quote arguments (to preserve shell metacharacters). - file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"` - args="$args \"$file\"" - done - - if test -z "$run"; then - if test -n "$shlibpath_var"; then - # Export the shlibpath_var. - eval "export $shlibpath_var" - fi - - # Restore saved enviroment variables - if test "${save_LC_ALL+set}" = set; then - LC_ALL="$save_LC_ALL"; export LC_ALL - fi - if test "${save_LANG+set}" = set; then - LANG="$save_LANG"; export LANG - fi - - # Now prepare to actually exec the command. - exec_cmd='"$cmd"$args' - else - # Display what would be done. - if test -n "$shlibpath_var"; then - eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\"" - $echo "export $shlibpath_var" - fi - $echo "$cmd$args" - exit 0 - fi - ;; - - # libtool clean and uninstall mode - clean | uninstall) - modename="$modename: $mode" - rm="$nonopt" - files= - rmforce= - exit_status=0 - - # This variable tells wrapper scripts just to set variables rather - # than running their programs. - libtool_install_magic="$magic" - - for arg - do - case $arg in - -f) rm="$rm $arg"; rmforce=yes ;; - -*) rm="$rm $arg" ;; - *) files="$files $arg" ;; - esac - done - - if test -z "$rm"; then - $echo "$modename: you must specify an RM program" 1>&2 - $echo "$help" 1>&2 - exit 1 - fi - - rmdirs= - - for file in $files; do - dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` - if test "X$dir" = "X$file"; then - dir=. - objdir="$objdir" - else - objdir="$dir/$objdir" - fi - name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` - test $mode = uninstall && objdir="$dir" - - # Remember objdir for removal later, being careful to avoid duplicates - if test $mode = clean; then - case " $rmdirs " in - *" $objdir "*) ;; - *) rmdirs="$rmdirs $objdir" ;; - esac - fi - - # Don't error if the file doesn't exist and rm -f was used. - if (test -L "$file") >/dev/null 2>&1 \ - || (test -h "$file") >/dev/null 2>&1 \ - || test -f "$file"; then - : - elif test -d "$file"; then - exit_status=1 - continue - elif test "$rmforce" = yes; then - continue - fi - - rmfiles="$file" - - case $name in - *.la) - # Possibly a libtool archive, so verify it. - if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then - . $dir/$name - - # Delete the libtool libraries and symlinks. - for n in $library_names; do - rmfiles="$rmfiles $objdir/$n" - done - test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library" - test $mode = clean && rmfiles="$rmfiles $objdir/$name $objdir/${name}i" - - if test $mode = uninstall; then - if test -n "$library_names"; then - # Do each command in the postuninstall commands. - eval cmds=\"$postuninstall_cmds\" - save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" - $show "$cmd" - $run eval "$cmd" - if test $? != 0 && test "$rmforce" != yes; then - exit_status=1 - fi - done - IFS="$save_ifs" - fi - - if test -n "$old_library"; then - # Do each command in the old_postuninstall commands. - eval cmds=\"$old_postuninstall_cmds\" - save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" - $show "$cmd" - $run eval "$cmd" - if test $? != 0 && test "$rmforce" != yes; then - exit_status=1 - fi - done - IFS="$save_ifs" - fi - # FIXME: should reinstall the best remaining shared library. - fi - fi - ;; - - *.lo) - if test "$build_old_libs" = yes; then - oldobj=`$echo "X$name" | $Xsed -e "$lo2o"` - rmfiles="$rmfiles $dir/$oldobj" - fi - ;; - - *) - # Do a test to see if this is a libtool program. - if test $mode = clean && - (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then - relink_command= - . $dir/$file - - rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}" - if test "$fast_install" = yes && test -n "$relink_command"; then - rmfiles="$rmfiles $objdir/lt-$name" - fi - fi - ;; - esac - $show "$rm $rmfiles" - $run $rm $rmfiles || exit_status=1 - done - - # Try to remove the ${objdir}s in the directories where we deleted files - for dir in $rmdirs; do - if test -d "$dir"; then - $show "rmdir $dir" - $run rmdir $dir >/dev/null 2>&1 - fi - done - - exit $exit_status - ;; - - "") - $echo "$modename: you must specify a MODE" 1>&2 - $echo "$generic_help" 1>&2 - exit 1 - ;; - esac - - if test -z "$exec_cmd"; then - $echo "$modename: invalid operation mode \`$mode'" 1>&2 - $echo "$generic_help" 1>&2 - exit 1 - fi -fi # test -z "$show_help" - -if test -n "$exec_cmd"; then - eval exec $exec_cmd - exit 1 -fi - -# We need to display help for each of the modes. -case $mode in -"") $echo \ -"Usage: $modename [OPTION]... [MODE-ARG]... - -Provide generalized library-building support services. - - --config show all configuration variables - --debug enable verbose shell tracing --n, --dry-run display commands without modifying any files - --features display basic configuration information and exit - --finish same as \`--mode=finish' - --help display this help message and exit - --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS] - --quiet same as \`--silent' - --silent don't print informational messages - --version print version information - -MODE must be one of the following: - - clean remove files from the build directory - compile compile a source file into a libtool object - execute automatically set library path, then run a program - finish complete the installation of libtool libraries - install install libraries or executables - link create a library or an executable - uninstall remove libraries from an installed directory - -MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for -a more detailed description of MODE." - exit 0 - ;; - -clean) - $echo \ -"Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE... - -Remove files from the build directory. - -RM is the name of the program to use to delete files associated with each FILE -(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed -to RM. - -If FILE is a libtool library, object or program, all the files associated -with it are deleted. Otherwise, only FILE itself is deleted using RM." - ;; - -compile) - $echo \ -"Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE - -Compile a source file into a libtool library object. - -This mode accepts the following additional options: - - -o OUTPUT-FILE set the output file name to OUTPUT-FILE - -prefer-pic try to building PIC objects only - -prefer-non-pic try to building non-PIC objects only - -static always build a \`.o' file suitable for static linking - -COMPILE-COMMAND is a command to be used in creating a \`standard' object file -from the given SOURCEFILE. - -The output file name is determined by removing the directory component from -SOURCEFILE, then substituting the C source code suffix \`.c' with the -library object suffix, \`.lo'." - ;; - -execute) - $echo \ -"Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]... - -Automatically set library path, then run a program. - -This mode accepts the following additional options: - - -dlopen FILE add the directory containing FILE to the library path - -This mode sets the library path environment variable according to \`-dlopen' -flags. - -If any of the ARGS are libtool executable wrappers, then they are translated -into their corresponding uninstalled binary, and any of their required library -directories are added to the library path. - -Then, COMMAND is executed, with ARGS as arguments." - ;; - -finish) - $echo \ -"Usage: $modename [OPTION]... --mode=finish [LIBDIR]... - -Complete the installation of libtool libraries. - -Each LIBDIR is a directory that contains libtool libraries. - -The commands that this mode executes may require superuser privileges. Use -the \`--dry-run' option if you just want to see what would be executed." - ;; - -install) - $echo \ -"Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND... - -Install executables or libraries. - -INSTALL-COMMAND is the installation command. The first component should be -either the \`install' or \`cp' program. - -The rest of the components are interpreted as arguments to that command (only -BSD-compatible install options are recognized)." - ;; - -link) - $echo \ -"Usage: $modename [OPTION]... --mode=link LINK-COMMAND... - -Link object files or libraries together to form another library, or to -create an executable program. - -LINK-COMMAND is a command using the C compiler that you would use to create -a program from several object files. - -The following components of LINK-COMMAND are treated specially: - - -all-static do not do any dynamic linking at all - -avoid-version do not add a version suffix if possible - -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime - -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols - -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) - -export-symbols SYMFILE - try to export only the symbols listed in SYMFILE - -export-symbols-regex REGEX - try to export only the symbols matching REGEX - -LLIBDIR search LIBDIR for required installed libraries - -lNAME OUTPUT-FILE requires the installed library libNAME - -module build a library that can dlopened - -no-fast-install disable the fast-install mode - -no-install link a not-installable executable - -no-undefined declare that a library does not refer to external symbols - -o OUTPUT-FILE create OUTPUT-FILE from the specified objects - -release RELEASE specify package release information - -rpath LIBDIR the created library will eventually be installed in LIBDIR - -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries - -static do not do any dynamic linking of libtool libraries - -version-info CURRENT[:REVISION[:AGE]] - specify library version info [each variable defaults to 0] - -All other options (arguments beginning with \`-') are ignored. - -Every other argument is treated as a filename. Files ending in \`.la' are -treated as uninstalled libtool libraries, other files are standard or library -object files. - -If the OUTPUT-FILE ends in \`.la', then a libtool library is created, -only library objects (\`.lo' files) may be specified, and \`-rpath' is -required, except when creating a convenience library. - -If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created -using \`ar' and \`ranlib', or on Windows using \`lib'. - -If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file -is created, otherwise an executable program is created." - ;; - -uninstall) - $echo \ -"Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... - -Remove libraries from an installation directory. - -RM is the name of the program to use to delete files associated with each FILE -(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed -to RM. - -If FILE is a libtool library, all the files associated with it are deleted. -Otherwise, only FILE itself is deleted using RM." - ;; - -*) - $echo "$modename: invalid operation mode \`$mode'" 1>&2 - $echo "$help" 1>&2 - exit 1 - ;; -esac - -echo -$echo "Try \`$modename --help' for more information about other modes." - -exit 0 - -# Local Variables: -# mode:shell-script -# sh-indentation:2 -# End: diff --git a/wxWidgets/src/expat/conftools/mkinstalldirs b/wxWidgets/src/expat/conftools/mkinstalldirs deleted file mode 100644 index b0858bac84..0000000000 --- a/wxWidgets/src/expat/conftools/mkinstalldirs +++ /dev/null @@ -1,40 +0,0 @@ -#! /bin/sh -# mkinstalldirs --- make directory hierarchy -# Author: Noah Friedman -# Created: 1993-05-16 -# Public domain - -# $Id: mkinstalldirs 51550 2008-02-04 17:05:54Z VZ $ - -errstatus=0 - -for file -do - set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` - shift - - pathcomp= - for d - do - pathcomp="$pathcomp$d" - case "$pathcomp" in - -* ) pathcomp=./$pathcomp ;; - esac - - if test ! -d "$pathcomp"; then - echo "mkdir $pathcomp" - - mkdir "$pathcomp" || lasterr=$? - - if test ! -d "$pathcomp"; then - errstatus=$lasterr - fi - fi - - pathcomp="$pathcomp/" - done -done - -exit $errstatus - -# mkinstalldirs ends here diff --git a/wxWidgets/src/expat/doc/reference.html b/wxWidgets/src/expat/doc/reference.html deleted file mode 100644 index 1d94279e84..0000000000 --- a/wxWidgets/src/expat/doc/reference.html +++ /dev/null @@ -1,1896 +0,0 @@ - - - - - - Expat XML Parser - - - - - -

Expat XML Parser

- -

Expat is a library, written in C, for parsing XML documents. It's -the underlying XML parser for the open source Mozilla project, Perl's -XML::Parser, Python's xml.parsers.expat, and -other open-source XML parsers.

- -

This library is the creation of James Clark, who's also given us -groff (an nroff look-alike), Jade (an implemention of ISO's DSSSL -stylesheet language for SGML), XP (a Java XML parser package), XT (a -Java XSL engine). James was also the technical lead on the XML -Working Group at W3C that produced the XML specification.

- -

This is free software, licensed under the MIT/X Consortium license. You may download it -from the Expat home page. -

- -

The bulk of this document was originally commissioned as an article by -XML.com. They graciously allowed -Clark Cooper to retain copyright and to distribute it with Expat.

- -
-

Table of Contents

- - -
-

Overview

- -

Expat is a stream-oriented parser. You register callback (or -handler) functions with the parser and then start feeding it the -document. As the parser recognizes parts of the document, it will -call the appropriate handler for that part (if you've registered one.) -The document is fed to the parser in pieces, so you can start parsing -before you have all the document. This also allows you to parse really -huge documents that won't fit into memory.

- -

Expat can be intimidating due to the many kinds of handlers and -options you can set. But you only need to learn four functions in -order to do 90% of what you'll want to do with it:

- -
- -
XML_ParserCreate
-
Create a new parser object.
- -
XML_SetElementHandler
-
Set handlers for start and end tags.
- -
XML_SetCharacterDataHandler
-
Set handler for text.
- -
XML_Parse
-
Pass a buffer full of document to the parser
-
- -

These functions and others are described in the reference part of this document. The reference -section also describes in detail the parameters passed to the -different types of handlers.

- -

Let's look at a very simple example program that only uses 3 of the -above functions (it doesn't need to set a character handler.) The -program outline.c prints an -element outline, indenting child elements to distinguish them from the -parent element that contains them. The start handler does all the -work. It prints two indenting spaces for every level of ancestor -elements, then it prints the element and attribute -information. Finally it increments the global Depth -variable.

- -
-int Depth;
-
-void
-start(void *data, const char *el, const char **attr) {
-  int i;
-
-  for (i = 0; i < Depth; i++)
-    printf("  ");
-
-  printf("%s", el);
-
-  for (i = 0; attr[i]; i += 2) {
-    printf(" %s='%s'", attr[i], attr[i + 1]);
-  }
-
-  printf("\n");
-  Depth++;
-}  /* End of start handler */
-
- -

The end tag simply does the bookkeeping work of decrementing -Depth.

-
-void
-end(void *data, const char *el) {
-  Depth--;
-}  /* End of end handler */
-
- -

After creating the parser, the main program just has the job of -shoveling the document to the parser so that it can do its work.

- -
-

Building and Installing Expat

- -

The Expat distribution comes as a compressed (with GNU gzip) tar -file. You may download the latest version from Source Forge. After -unpacking this, cd into the directory. Then follow either the Win32 -directions or Unix directions below.

- -

Building under Win32

- -

If you're using the GNU compiler under cygwin, follow the Unix -directions in the next section. Otherwise if you have Microsoft's -Developer Studio installed, then from Windows Explorer double-click on -"expat.dsp" in the lib directory and build and install in the usual -manner.

- -

Alternatively, you may download the Win32 binary package that -contains the "expat.h" include file and a pre-built DLL.

- -

Building under Unix (or GNU)

- -

First you'll need to run the configure shell script in order to -configure the Makefiles and headers for your system.

- -

If you're happy with all the defaults that configure picks for you, -and you have permission on your system to install into /usr/local, you -can install Expat with this sequence of commands:

- -
-   ./configure
-   make
-   make install
-
- -

There are some options that you can provide to this script, but the -only one we'll mention here is the --prefix option. You -can find out all the options available by running configure with just -the --help option.

- -

By default, the configure script sets things up so that the library -gets installed in /usr/local/lib and the associated -header file in /usr/local/include. But if you were to -give the option, --prefix=/home/me/mystuff, then the -library and header would get installed in -/home/me/mystuff/lib and -/home/me/mystuff/include respectively.

- -
-

Using Expat

- -

Compiling and Linking Against Expat

- -

Unless you installed Expat in a location not expected by your -compiler and linker, all you have to do to use Expat in your programs -is to include the Expat header (#include <expat.h>) -in your files that make calls to it and to tell the linker that it -needs to link against the Expat library. On Unix systems, this would -usually be done with the -lexpat argument. Otherwise, -you'll need to tell the compiler where to look for the Expat header -and the linker where to find the Expat library. You may also need to -take steps to tell the operating system where to find this libary at -run time.

- -

On a Unix-based system, here's what a Makefile might look like when -Expat is installed in a standard location:

- -
-CC=cc
-LDFLAGS=
-LIBS= -lexpat
-xmlapp: xmlapp.o
-        $(CC) $(LDFLAGS) -o xmlapp xmlapp.o $(LIBS)
-
- -

If you installed Expat in, say, /home/me/mystuff, then -the Makefile would look like this:

- -
-CC=cc
-CFLAGS= -I/home/me/mystuff/include
-LDFLAGS=
-LIBS= -L/home/me/mystuff/lib -lexpat
-xmlapp: xmlapp.o
-        $(CC) $(LDFLAGS) -o xmlapp xmlapp.o $(LIBS)
-
- -

You'd also have to set the environment variable -LD_LIBRARY_PATH to /home/me/mystuff/lib (or -to ${LD_LIBRARY_PATH}:/home/me/mystuff/lib if -LD_LIBRARY_PATH already has some directories in it) in order to run -your application.

- -

Expat Basics

- -

As we saw in the example in the overview, the first step in parsing -an XML document with Expat is to create a parser object. There are three functions in the Expat API for creating a -parser object. However, only two of these (XML_ParserCreate and XML_ParserCreateNS) can be used for -constructing a parser for a top-level document. The object returned -by these functions is an opaque pointer (i.e. "expat.h" declares it as -void *) to data with further internal structure. In order to free the -memory associated with this object you must call XML_ParserFree. Note that if you have -provided any user data that gets stored in the -parser, then your application is responsible for freeing it prior to -calling XML_ParserFree.

- -

The objects returned by the parser creation functions are good for -parsing only one XML document or external parsed entity. If your -application needs to parse many XML documents, then it needs to create -a parser object for each one. The best way to deal with this is to -create a higher level object that contains all the default -initialization you want for your parser objects.

- -

Walking through a document hierarchy with a stream oriented parser -will require a good stack mechanism in order to keep track of current -context. For instance, to answer the simple question, "What element -does this text belong to?" requires a stack, since the parser may have -descended into other elements that are children of the current one and -has encountered this text on the way out.

- -

The things you're likely to want to keep on a stack are the -currently opened element and it's attributes. You push this -information onto the stack in the start handler and you pop it off in -the end handler.

- -

For some tasks, it is sufficient to just keep information on what -the depth of the stack is (or would be if you had one.) The outline -program shown above presents one example. Another such task would be -skipping over a complete element. When you see the start tag for the -element you want to skip, you set a skip flag and record the depth at -which the element started. When the end tag handler encounters the -same depth, the skipped element has ended and the flag may be -cleared. If you follow the convention that the root element starts at -1, then you can use the same variable for skip flag and skip -depth.

- -
-void
-init_info(Parseinfo *info) {
-  info->skip = 0;
-  info->depth = 1;
-  /* Other initializations here */
-}  /* End of init_info */
-
-void
-rawstart(void *data, const char *el, const char **attr) {
-  Parseinfo *inf = (Parseinfo *) data;
-
-  if (! inf->skip) {
-    if (should_skip(inf, el, attr)) {
-      inf->skip = inf->depth;
-    }
-    else
-      start(inf, el, attr);     /* This does rest of start handling */
-  }
-
-  inf->depth++;
-}  /* End of rawstart */
-
-void
-rawend(void *data, const char *el) {
-  Parseinfo *inf = (Parseinfo *) data;
-
-  inf->depth--;
-
-  if (! inf->skip)
-    end(inf, el);              /* This does rest of end handling */
-
-  if (inf->skip == inf->depth)
-    inf->skip = 0;
-}  /* End rawend */
-
- -

Notice in the above example the difference in how depth is -manipulated in the start and end handlers. The end tag handler should -be the mirror image of the start tag handler. This is necessary to -properly model containment. Since, in the start tag handler, we -incremented depth after the main body of start tag code, then -in the end handler, we need to manipulate it before the main -body. If we'd decided to increment it first thing in the start -handler, then we'd have had to decrement it last thing in the end -handler.

- -

Communicating between handlers

- -

In order to be able to pass information between different handlers -without using globals, you'll need to define a data structure to hold -the shared variables. You can then tell Expat (with the XML_SetUserData function) to pass a -pointer to this structure to the handlers. This is typically the first -argument received by most handlers.

- -

XML Version

- -

Expat is an XML 1.0 parser, and as such never complains based on -the value of the version pseudo-attribute in the XML -declaration, if present.

- -

If an application needs to check the version number (to support -alternate processing), it should use the XML_SetXmlDeclHandler function to -set a handler that uses the information in the XML declaration to -determine what to do. This example shows how to check that only a -version number of "1.0" is accepted:

- -
-static int wrong_version;
-static XML_Parser parser;
-
-static void
-xmldecl_handler(void            *userData,
-                const XML_Char  *version,
-                const XML_Char  *encoding,
-                int              standalone)
-{
-  static const XML_Char Version_1_0[] = {'1', '.', '0', 0};
-
-  int i;
-
-  for (i = 0; i < (sizeof(Version_1_0) / sizeof(Version_1_0[0])); ++i) {
-    if (version[i] != Version_1_0[i]) {
-      wrong_version = 1;
-      /* also clear all other handlers: */
-      XML_SetCharacterDataHandler(parser, NULL);
-      ...
-      return;
-    }
-  }
-  ...
-}
-
- -

Namespace Processing

- -

When the parser is created using the XML_ParserCreateNS, function, Expat -performs namespace processing. Under namespace processing, Expat -consumes xmlns and xmlns:... attributes, -which declare namespaces for the scope of the element in which they -occur. This means that your start handler will not see these -attributes. Your application can still be informed of these -declarations by setting namespace declaration handlers with XML_SetNamespaceDeclHandler.

- -

Element type and attribute names that belong to a given namespace -are passed to the appropriate handler in expanded form. By default -this expanded form is a concatenation of the namespace URI, the -separator character (which is the 2nd argument to XML_ParserCreateNS), and the local -name (i.e. the part after the colon). Names with undeclared prefixes -are passed through to the handlers unchanged, with the prefix and -colon still attached. Unprefixed attribute names are never expanded, -and unprefixed element names are only expanded when they are in the -scope of a default namespace.

- -

However if XML_SetReturnNSTriplet has been called with a non-zero -do_nst parameter, then the expanded form for names with -an explicit prefix is a concatenation of: URI, separator, local name, -separator, prefix.

- -

You can set handlers for the start of a namespace declaration and -for the end of a scope of a declaration with the XML_SetNamespaceDeclHandler -function. The StartNamespaceDeclHandler is called prior to the start -tag handler and the EndNamespaceDeclHandler is called before the -corresponding end tag that ends the namespace's scope. The namespace -start handler gets passed the prefix and URI for the namespace. For a -default namespace declaration (xmlns='...'), the prefix will be null. -The URI will be null for the case where the default namespace is being -unset. The namespace end handler just gets the prefix for the closing -scope.

- -

These handlers are called for each declaration. So if, for -instance, a start tag had three namespace declarations, then the -StartNamespaceDeclHandler would be called three times before the start -tag handler is called, once for each declaration.

- -

Character Encodings

- -

While XML is based on Unicode, and every XML processor is required -to recognized UTF-8 and UTF-16 (1 and 2 byte encodings of Unicode), -other encodings may be declared in XML documents or entities. For the -main document, an XML declaration may contain an encoding -declaration:

-
-<?xml version="1.0" encoding="ISO-8859-2"?>
-
- -

External parsed entities may begin with a text declaration, which -looks like an XML declaration with just an encoding declaration:

-
-<?xml encoding="Big5"?>
-
- -

With Expat, you may also specify an encoding at the time of -creating a parser. This is useful when the encoding information may -come from a source outside the document itself (like a higher level -protocol.)

- -

There are four built-in encodings -in Expat:

-
    -
  • UTF-8
  • -
  • UTF-16
  • -
  • ISO-8859-1
  • -
  • US-ASCII
  • -
- -

Anything else discovered in an encoding declaration or in the -protocol encoding specified in the parser constructor, triggers a call -to the UnknownEncodingHandler. This handler gets passed -the encoding name and a pointer to an XML_Encoding data -structure. Your handler must fill in this structure and return -XML_STATUS_OK if it knows how to deal with the -encoding. Otherwise the handler should return -XML_STATUS_ERROR. The handler also gets passed a pointer -to an optional application data structure that you may indicate when -you set the handler.

- -

Expat places restrictions on character encodings that it can -support by filling in the XML_Encoding structure. -include file:

-
    -
  1. Every ASCII character that can appear in a well-formed XML document -must be represented by a single byte, and that byte must correspond to -it's ASCII encoding (except for the characters $@\^'{}~)
  2. -
  3. Characters must be encoded in 4 bytes or less.
  4. -
  5. All characters encoded must have Unicode scalar values less than or -equal to 65535 (0xFFFF)This does not apply to the built-in support -for UTF-16 and UTF-8
  6. -
  7. No character may be encoded by more that one distinct sequence of -bytes
  8. -
- -

XML_Encoding contains an array of integers that -correspond to the 1st byte of an encoding sequence. If the value in -the array for a byte is zero or positive, then the byte is a single -byte encoding that encodes the Unicode scalar value contained in the -array. A -1 in this array indicates a malformed byte. If the value is --2, -3, or -4, then the byte is the beginning of a 2, 3, or 4 byte -sequence respectively. Multi-byte sequences are sent to the convert -function pointed at in the XML_Encoding structure. This -function should return the Unicode scalar value for the sequence or -1 -if the sequence is malformed.

- -

One pitfall that novice Expat users are likely to fall into is that -although Expat may accept input in various encodings, the strings that -it passes to the handlers are always encoded in UTF-8 or UTF-16 -(depending on how Expat was compiled). Your application is responsible -for any translation of these strings into other encodings.

- -

Handling External Entity References

- -

Expat does not read or parse external entities directly. Note that -any external DTD is a special case of an external entity. If you've -set no ExternalEntityRefHandler, then external entity -references are silently ignored. Otherwise, it calls your handler with -the information needed to read and parse the external entity.

- -

Your handler isn't actually responsible for parsing the entity, but -it is responsible for creating a subsidiary parser with XML_ExternalEntityParserCreate that will do the job. This -returns an instance of XML_Parser that has handlers and -other data structures initialized from the parent parser. You may then -use XML_Parse or XML_ParseBuffer calls against this -parser. Since external entities my refer to other external entities, -your handler should be prepared to be called recursively.

- -

Parsing DTDs

- -

In order to parse parameter entities, before starting the parse, -you must call XML_SetParamEntityParsing with one of the following -arguments:

-
-
XML_PARAM_ENTITY_PARSING_NEVER
-
Don't parse parameter entities or the external subset
-
XML_PARAM_ENTITY_PARSING_UNLESS_STANDALONE
-
Parse parameter entites and the external subset unless -standalone was set to "yes" in the XML declaration.
-
XML_PARAM_ENTITY_PARSING_ALWAYS
-
Always parse parameter entities and the external subset
-
- -

In order to read an external DTD, you also have to set an external -entity reference handler as described above.

- -
- - -

Expat Reference

- -

Parser Creation

- -
-XML_Parser
-XML_ParserCreate(const XML_Char *encoding);
-
-
-Construct a new parser. If encoding is non-null, it specifies a -character encoding to use for the document. This overrides the document -encoding declaration. There are four built-in encodings: -
    -
  • US-ASCII
  • -
  • UTF-8
  • -
  • UTF-16
  • -
  • ISO-8859-1
  • -
-Any other value will invoke a call to the UnknownEncodingHandler. -
- -
-XML_Parser
-XML_ParserCreateNS(const XML_Char *encoding,
-                   XML_Char sep);
-
-
-Constructs a new parser that has namespace processing in effect. Namespace -expanded element names and attribute names are returned as a concatenation -of the namespace URI, sep, and the local part of the name. This -means that you should pick a character for sep that can't be -part of a legal URI.
- -
-XML_Parser
-XML_ParserCreate_MM(const XML_Char *encoding,
-                    const XML_Memory_Handling_Suite *ms,
-		    const XML_Char *sep);
-
-
-typedef struct {
-  void *(*malloc_fcn)(size_t size);
-  void *(*realloc_fcn)(void *ptr, size_t size);
-  void (*free_fcn)(void *ptr);
-} XML_Memory_Handling_Suite;
-
-
-

Construct a new parser using the suite of memory handling functions -specified in ms. If ms is NULL, then use the -standard set of memory management functions. If sep is -non NULL, then namespace processing is enabled in the created parser -and the character pointed at by sep is used as the separator between -the namespace URI and the local part of the name.

-
- -
-XML_Parser
-XML_ExternalEntityParserCreate(XML_Parser p,
-                               const XML_Char *context,
-                               const XML_Char *encoding);
-
-
-Construct a new XML_Parser object for parsing an external -general entity. Context is the context argument passed in a call to a -ExternalEntityRefHandler. Other state information such as handlers, -user data, namespace processing is inherited from the parser passed as -the 1st argument. So you shouldn't need to call any of the behavior -changing functions on this parser (unless you want it to act -differently than the parent parser). -
- -
-void
-XML_ParserFree(XML_Parser p);
-
-
-Free memory used by the parser. Your application is responsible for -freeing any memory associated with user data. -
- -
-XML_Bool
-XML_ParserReset(XML_Parser p);
-
-
-Clean up the memory structures maintained by the parser so that it may -be used again. After this has been called, parser is -ready to start parsing a new document. This function may not be used -on a parser created using XML_ExternalEntityParserCreate; it will return XML_FALSE in that case. Returns -XML_TRUE on success. Your application is responsible for -dealing with any memory associated with user data. -
- -

Parsing

- -

To state the obvious: the three parsing functions XML_Parse, XML_ParseBuffer and >XML_GetBuffer must not be -called from within a handler unless they operate on a separate parser -instance, that is, one that did not call the handler. For example, it -is OK to call the parsing functions from within an -XML_ExternalEntityRefHandler, if they apply to the parser -created by XML_ExternalEntityParserCreate.

- -
-XML_Status
-XML_Parse(XML_Parser p,
-          const char *s,
-          int len,
-          int isFinal);
-
-
-enum XML_Status {
-  XML_STATUS_ERROR = 0,
-  XML_STATUS_OK = 1
-};
-
-
-Parse some more of the document. The string s is a buffer -containing part (or perhaps all) of the document. The number of bytes of s -that are part of the document is indicated by len. This means -that s doesn't have to be null terminated. It also means that -if len is larger than the number of bytes in the block of -memory that s points at, then a memory fault is likely. The -isFinal parameter informs the parser that this is the last -piece of the document. Frequently, the last piece is empty (i.e. -len is zero.) -If a parse error occurred, it returns XML_STATUS_ERROR. -Otherwise it returns XML_STATUS_OK value. -
- -
-XML_Status
-XML_ParseBuffer(XML_Parser p,
-                int len,
-                int isFinal);
-
-
-This is just like XML_Parse, -except in this case Expat provides the buffer. By obtaining the -buffer from Expat with the XML_GetBuffer function, the application can avoid double -copying of the input. -
- -
-void *
-XML_GetBuffer(XML_Parser p,
-              int len);
-
-
-Obtain a buffer of size len to read a piece of the document -into. A NULL value is returned if Expat can't allocate enough memory for -this buffer. This has to be called prior to every call to -XML_ParseBuffer. A -typical use would look like this: - -
-for (;;) {
-  int bytes_read;
-  void *buff = XML_GetBuffer(p, BUFF_SIZE);
-  if (buff == NULL) {
-    /* handle error */
-  }
-
-  bytes_read = read(docfd, buff, BUFF_SIZE);
-  if (bytes_read < 0) {
-    /* handle error */
-  }
-
-  if (! XML_ParseBuffer(p, bytes_read, bytes_read == 0)) {
-    /* handle parse error */
-  }
-
-  if (bytes_read == 0)
-    break;
-}
-
-
- -

Handler Setting

- -

Although handlers are typically set prior to parsing and left alone, an -application may choose to set or change the handler for a parsing event -while the parse is in progress. For instance, your application may choose -to ignore all text not descended from a para element. One -way it could do this is to set the character handler when a para start tag -is seen, and unset it for the corresponding end tag.

- -

A handler may be unset by providing a NULL pointer to the -appropriate handler setter. None of the handler setting functions have -a return value.

- -

Your handlers will be receiving strings in arrays of type -XML_Char. This type is defined in expat.h as char -* and contains bytes encoding UTF-8. Note that you'll receive -them in this form independent of the original encoding of the -document.

- -
-
-XML_SetStartElementHandler(XML_Parser p,
-                           XML_StartElementHandler start);
-
-
-typedef void
-(*XML_StartElementHandler)(void *userData,
-                           const XML_Char *name,
-                           const XML_Char **atts);
-
-

Set handler for start (and empty) tags. Attributes are passed to the start -handler as a pointer to a vector of char pointers. Each attribute seen in -a start (or empty) tag occupies 2 consecutive places in this vector: the -attribute name followed by the attribute value. These pairs are terminated -by a null pointer.

-

Note that an empty tag generates a call to both start and end handlers -(in that order).

-
- -
-
-XML_SetEndElementHandler(XML_Parser p,
-                         XML_EndElementHandler);
-
-
-typedef void
-(*XML_EndElementHandler)(void *userData,
-                         const XML_Char *name);
-
-

Set handler for end (and empty) tags. As noted above, an empty tag -generates a call to both start and end handlers.

-
- -
-
-XML_SetElementHandler(XML_Parser p,
-                      XML_StartElementHandler start,
-                      XML_EndElementHandler end);
-
-

Set handlers for start and end tags with one call.

-
- -
-
-XML_SetCharacterDataHandler(XML_Parser p,
-                            XML_CharacterDataHandler charhndl)
-
-
-typedef void
-(*XML_CharacterDataHandler)(void *userData,
-                            const XML_Char *s,
-                            int len);
-
-

Set a text handler. The string your handler receives -is NOT nul-terminated. You have to use the length argument -to deal with the end of the string. A single block of contiguous text -free of markup may still result in a sequence of calls to this handler. -In other words, if you're searching for a pattern in the text, it may -be split across calls to this handler.

-
- -
-
-XML_SetProcessingInstructionHandler(XML_Parser p,
-                                    XML_ProcessingInstructionHandler proc)
-
-
-typedef void
-(*XML_ProcessingInstructionHandler)(void *userData,
-                                    const XML_Char *target,
-                                    const XML_Char *data);
-
-
-

Set a handler for processing instructions. The target is the first word -in the processing instruction. The data is the rest of the characters in -it after skipping all whitespace after the initial word.

-
- -
-
-XML_SetCommentHandler(XML_Parser p,
-                      XML_CommentHandler cmnt)
-
-
-typedef void
-(*XML_CommentHandler)(void *userData,
-                      const XML_Char *data);
-
-

Set a handler for comments. The data is all text inside the comment -delimiters.

-
- -
-
-XML_SetStartCdataSectionHandler(XML_Parser p,
-                                XML_StartCdataSectionHandler start);
-
-
-typedef void
-(*XML_StartCdataSectionHandler)(void *userData);
-
-

Set a handler that gets called at the beginning of a CDATA section.

-
- -
-
-XML_SetEndCdataSectionHandler(XML_Parser p,
-                              XML_EndCdataSectionHandler end);
-
-
-typedef void
-(*XML_EndCdataSectionHandler)(void *userData);
-
-

Set a handler that gets called at the end of a CDATA section.

-
- -
-
-XML_SetCdataSectionHandler(XML_Parser p,
-                           XML_StartCdataSectionHandler start,
-                           XML_EndCdataSectionHandler end)
-
-

Sets both CDATA section handlers with one call.

-
- -
-
-XML_SetDefaultHandler(XML_Parser p,
-                      XML_DefaultHandler hndl)
-
-
-typedef void
-(*XML_DefaultHandler)(void *userData,
-                      const XML_Char *s,
-                      int len);
-
- -

Sets a handler for any characters in the document which wouldn't -otherwise be handled. This includes both data for which no handlers -can be set (like some kinds of DTD declarations) and data which could -be reported but which currently has no handler set. The characters -are passed exactly as they were present in the XML document except -that they will be encoded in UTF-8 or UTF-16. Line boundaries are not -normalized. Note that a byte order mark character is not passed to the -default handler. There are no guarantees about how characters are -divided between calls to the default handler: for example, a comment -might be split between multiple calls. Setting the handler with -this call has the side effect of turning off expansion of references -to internally defined general entities. Instead these references are -passed to the default handler.

- -

See also XML_DefaultCurrent.

-
- -
-
-XML_SetDefaultHandlerExpand(XML_Parser p,
-                            XML_DefaultHandler hndl)
-
-
-typedef void
-(*XML_DefaultHandler)(void *userData,
-                      const XML_Char *s,
-                      int len);
-
-

This sets a default handler, but doesn't inhibit the expansion of -internal entity references. The entity reference will not be passed -to the default handler.

- -

See also XML_DefaultCurrent.

-
- -
-
-XML_SetExternalEntityRefHandler(XML_Parser p,
-                                XML_ExternalEntityRefHandler hndl)
-
-
-typedef int
-(*XML_ExternalEntityRefHandler)(XML_Parser p,
-                                const XML_Char *context,
-                                const XML_Char *base,
-                                const XML_Char *systemId,
-                                const XML_Char *publicId);
-
-

Set an external entity reference handler. This handler is also -called for processing an external DTD subset if parameter entity parsing -is in effect. (See -XML_SetParamEntityParsing.)

- -

The context parameter specifies the parsing context in -the format expected by the context argument to XML_ExternalEntityParserCreate. code is -valid only until the handler returns, so if the referenced entity is -to be parsed later, it must be copied. context is NULL -only when the entity is a parameter entity, which is how one can -differentiate between general and parameter entities.

- -

The base parameter is the base to use for relative -system identifiers. It is set by XML_SetBase and may be NULL. The -publicId parameter is the public id given in the entity -declaration and may be NULL. systemId is the system -identifier specified in the entity declaration and is never NULL.

- -

There are a couple of ways in which this handler differs from -others. First, this handler returns a status indicator (an -integer). XML_STATUS_OK should be returned for successful -handling of the external entity reference. Returning -XML_STATUS_ERROR indicates failure, and causes the -calling parser to return an -XML_ERROR_EXTERNAL_ENTITY_HANDLING error.

- -

Second, instead of having the user data as its first argument, it -receives the parser that encountered the entity reference. This, along -with the context parameter, may be used as arguments to a call to -XML_ExternalEntityParserCreate. Using the returned -parser, the body of the external entity can be recursively parsed.

- -

Since this handler may be called recursively, it should not be saving -information into global or static variables.

-
- -
-XML_SetExternalEntityRefHandlerArg(XML_Parser p,
-                                   void *arg)
-
-
-

Set the argument passed to the ExternalEntityRefHandler. If -arg is not NULL, it is the new value passed to the -handler set using XML_SetExternalEntityRefHandler; if arg is -NULL, the argument passed to the handler function will be the parser -object itself.

- -

Note: -The type of arg and the type of the first argument to the -ExternalEntityRefHandler do not match. This function takes a -void * to be passed to the handler, while the handler -accepts an XML_Parser. This is a historical accident, -but will not be corrected before Expat 2.0 (at the earliest) to avoid -causing compiler warnings for code that's known to work with this -API. It is the responsibility of the application code to know the -actual type of the argument passed to the handler and to manage it -properly.

-
- -
-
-XML_SetSkippedEntityHandler(XML_Parser p,
-                            XML_SkippedEntityHandler handler)
-
-
-typedef void
-(*XML_SkippedEntityHandler)(void *userData,
-                            const XML_Char *entityName,
-                            int is_parameter_entity);
-
-

Set a skipped entity handler. This is called in two situations:

-
    -
  1. An entity reference is encountered for which no declaration - has been read and this is not an error.
  2. -
  3. An internal entity reference is read, but not expanded, because - XML_SetDefaultHandler - has been called.
  4. -
-

The is_parameter_entity argument will be non-zero for -a parameter entity and zero for a general entity.

Note: skipped -parameter entities in declarations and skipped general entities in -attribute values cannot be reported, because the event would be out of -sync with the reporting of the declarations or attribute values

-
- -
-
-XML_SetUnknownEncodingHandler(XML_Parser p,
-                              XML_UnknownEncodingHandler enchandler,
-			      void *encodingHandlerData)
-
-
-typedef int
-(*XML_UnknownEncodingHandler)(void *encodingHandlerData,
-                              const XML_Char *name,
-                              XML_Encoding *info);
-
-typedef struct {
-  int map[256];
-  void *data;
-  int (*convert)(void *data, const char *s);
-  void (*release)(void *data);
-} XML_Encoding;
-
-

Set a handler to deal with encodings other than the built in set. This should be done before -XML_Parse or XML_ParseBuffer have been called on the -given parser.

If the handler knows how to deal with an encoding -with the given name, it should fill in the info data -structure and return XML_STATUS_ERROR. Otherwise it -should return XML_STATUS_OK. The handler will be called -at most once per parsed (external) entity. The optional application -data pointer encodingHandlerData will be passed back to -the handler.

- -

The map array contains information for every possible possible leading -byte in a byte sequence. If the corresponding value is >= 0, then it's -a single byte sequence and the byte encodes that Unicode value. If the -value is -1, then that byte is invalid as the initial byte in a sequence. -If the value is -n, where n is an integer > 1, then n is the number of -bytes in the sequence and the actual conversion is accomplished by a -call to the function pointed at by convert. This function may return -1 -if the sequence itself is invalid. The convert pointer may be null if -there are only single byte codes. The data parameter passed to the convert -function is the data pointer from XML_Encoding. The -string s is NOT nul-terminated and points at the sequence of -bytes to be converted.

- -

The function pointed at by release is called by the -parser when it is finished with the encoding. It may be NULL.

-
- -
-
-XML_SetStartNamespaceDeclHandler(XML_Parser p,
-			         XML_StartNamespaceDeclHandler start);
-
-
-typedef void
-(*XML_StartNamespaceDeclHandler)(void *userData,
-                                 const XML_Char *prefix,
-                                 const XML_Char *uri);
-
-

Set a handler to be called when a namespace is declared. Namespace -declarations occur inside start tags. But the namespace declaration start -handler is called before the start tag handler for each namespace declared -in that start tag.

- -

Note: -Due to limitations of the implementation, the -StartNamespaceDeclHandler is not called unless the StartElementHandler -is also set. The specific value of the StartElementHandler is allowed -to change freely, so long as it is not NULL.

-
- -
-
-XML_SetEndNamespaceDeclHandler(XML_Parser p,
-			       XML_EndNamespaceDeclHandler end);
-
-
-typedef void
-(*XML_EndNamespaceDeclHandler)(void *userData,
-                               const XML_Char *prefix);
-
-

Set a handler to be called when leaving the scope of a namespace -declaration. This will be called, for each namespace declaration, -after the handler for the end tag of the element in which the -namespace was declared.

- -

Note: -Due to limitations of the implementation, the EndNamespaceDeclHandler -is not called unless the StartElementHandler is also set. The -specific value of the StartElementHandler is allowed to change freely, -so long as it is not NULL.

-
- -
-
-XML_SetNamespaceDeclHandler(XML_Parser p,
-                            XML_StartNamespaceDeclHandler start,
-                            XML_EndNamespaceDeclHandler end)
-
-

Sets both namespace declaration handlers with a single call.

- -

Note: -Due to limitations of the implementation, the -StartNamespaceDeclHandler and EndNamespaceDeclHandler are not called -unless the StartElementHandler is also set. The specific value of the -StartElementHandler is allowed to change freely, so long as it is not -NULL.

-
- -
-
-XML_SetXmlDeclHandler(XML_Parser p,
-		      XML_XmlDeclHandler xmldecl);
-
-
-typedef void
-(*XML_XmlDeclHandler) (void            *userData,
-                       const XML_Char  *version,
-                       const XML_Char  *encoding,
-                       int             standalone);
-
-

Sets a handler that is called for XML declarations and also for -text declarations discovered in external entities. The way to -distinguish is that the version parameter will be NULL -for text declarations. The encoding parameter may be NULL -for an XML declaration. The standalone argument will -contain -1, 0, or 1 indicating respectively that there was no -standalone parameter in the declaration, that it was given as no, or -that it was given as yes.

-
- -
-
-XML_SetStartDoctypeDeclHandler(XML_Parser p,
-			       XML_StartDoctypeDeclHandler start);
-
-
-typedef void
-(*XML_StartDoctypeDeclHandler)(void           *userData,
-                               const XML_Char *doctypeName,
-                               const XML_Char *sysid,
-                               const XML_Char *pubid,
-                               int            has_internal_subset);
-
-

Set a handler that is called at the start of a DOCTYPE declaration, -before any external or internal subset is parsed. Both sysid -and pubid may be NULL. The has_internal_subset -will be non-zero if the DOCTYPE declaration has an internal subset.

-
- -
-
-XML_SetEndDoctypeDeclHandler(XML_Parser p,
-			     XML_EndDoctypeDeclHandler end);
-
-
-typedef void
-(*XML_EndDoctypeDeclHandler)(void *userData);
-
-

Set a handler that is called at the end of a DOCTYPE declaration, -after parsing any external subset.

-
- -
-
-XML_SetDoctypeDeclHandler(XML_Parser p,
-			  XML_StartDoctypeDeclHandler start,
-			  XML_EndDoctypeDeclHandler end);
-
-

Set both doctype handlers with one call.

-
- -
-
-XML_SetElementDeclHandler(XML_Parser p,
-			  XML_ElementDeclHandler eldecl);
-
-
-typedef void
-(*XML_ElementDeclHandler)(void *userData,
-                          const XML_Char *name,
-                          XML_Content *model);
-
-
-enum XML_Content_Type {
-  XML_CTYPE_EMPTY = 1,
-  XML_CTYPE_ANY,
-  XML_CTYPE_MIXED,
-  XML_CTYPE_NAME,
-  XML_CTYPE_CHOICE,
-  XML_CTYPE_SEQ
-};
-
-enum XML_Content_Quant {
-  XML_CQUANT_NONE,
-  XML_CQUANT_OPT,
-  XML_CQUANT_REP,
-  XML_CQUANT_PLUS
-};
-
-typedef struct XML_cp XML_Content;
-
-struct XML_cp {
-  enum XML_Content_Type		type;
-  enum XML_Content_Quant	quant;
-  const XML_Char *		name;
-  unsigned int			numchildren;
-  XML_Content *			children;
-};
-
-

Sets a handler for element declarations in a DTD. The handler gets -called with the name of the element in the declaration and a pointer -to a structure that contains the element model. It is the -application's responsibility to free this data structure using -XML_FreeContentModel.

- -

The model argument is the root of a tree of -XML_Content nodes. If type equals -XML_CTYPE_EMPTY or XML_CTYPE_ANY, then -quant will be XML_CQUANT_NONE, and the other -fields will be zero or NULL. If type is -XML_CTYPE_MIXED, then quant will be -XML_CQUANT_NONE or XML_CQUANT_REP and -numchildren will contain the number of elements that are -allowed to be mixed in and children points to an array of -XML_Content structures that will all have type -XML_CTYPE_NAME with no quantification. Only the root node can be type -XML_CTYPE_EMPTY, XML_CTYPE_ANY, or -XML_CTYPE_MIXED.

- -

For type XML_CTYPE_NAME, the name field -points to the name and the numchildren and -children fields will be zero and NULL. The -quant field will indicate any quantifiers placed on the -name.

- -

Types XML_CTYPE_CHOICE and XML_CTYPE_SEQ -indicate a choice or sequence respectively. The -numchildren field indicates how many nodes in the choice -or sequence and children points to the nodes.

-
- -
-
-XML_SetAttlistDeclHandler(XML_Parser p,
-                          XML_AttlistDeclHandler attdecl);
-
-
-typedef void
-(*XML_AttlistDeclHandler) (void           *userData,
-                           const XML_Char *elname,
-                           const XML_Char *attname,
-                           const XML_Char *att_type,
-                           const XML_Char *dflt,
-                           int            isrequired);
-
-

Set a handler for attlist declarations in the DTD. This handler is -called for each attribute. So a single attlist declaration -with multiple attributes declared will generate multiple calls to this -handler. The elname parameter returns the name of the -element for which the attribute is being declared. The attribute name -is in the attname parameter. The attribute type is in the -att_type parameter. It is the string representing the -type in the declaration with whitespace removed.

- -

The dflt parameter holds the default value. It will be -NULL in the case of "#IMPLIED" or "#REQUIRED" attributes. You can -distinguish these two cases by checking the isrequired -parameter, which will be true in the case of "#REQUIRED" attributes. -Attributes which are "#FIXED" will have also have a true -isrequired, but they will have the non-NULL fixed value -in the dflt parameter.

-
- -
-
-XML_SetEntityDeclHandler(XML_Parser p,
-			 XML_EntityDeclHandler handler);
-
-
-typedef void
-(*XML_EntityDeclHandler) (void           *userData,
-                          const XML_Char *entityName,
-                          int            is_parameter_entity,
-                          const XML_Char *value,
-                          int            value_length,
-                          const XML_Char *base,
-                          const XML_Char *systemId,
-                          const XML_Char *publicId,
-                          const XML_Char *notationName);
-
-

Sets a handler that will be called for all entity declarations. -The is_parameter_entity argument will be non-zero in the -case of parameter entities and zero otherwise.

- -

For internal entities (<!ENTITY foo "bar">), -value will be non-NULL and systemId, -publicId, and notationName will all be NULL. -The value string is not NULL terminated; the length is -provided in the value_length parameter. Do not use -value_length to test for internal entities, since it is -legal to have zero-length values. Instead check for whether or not -value is NULL.

The notationName -argument will have a non-NULL value only for unparsed entity -declarations.

-
- -
-
-XML_SetUnparsedEntityDeclHandler(XML_Parser p,
-                                 XML_UnparsedEntityDeclHandler h)
-
-
-typedef void
-(*XML_UnparsedEntityDeclHandler)(void *userData,
-                                 const XML_Char *entityName,
-                                 const XML_Char *base,
-                                 const XML_Char *systemId,
-                                 const XML_Char *publicId,
-                                 const XML_Char *notationName);
-
-

Set a handler that receives declarations of unparsed entities. These -are entity declarations that have a notation (NDATA) field:

- -
-<!ENTITY logo SYSTEM "images/logo.gif" NDATA gif>
-
-

This handler is obsolete and is provided for backwards -compatibility. Use instead XML_SetEntityDeclHandler.

-
- -
-
-XML_SetNotationDeclHandler(XML_Parser p,
-                           XML_NotationDeclHandler h)
-
-
-typedef void
-(*XML_NotationDeclHandler)(void *userData,
-                           const XML_Char *notationName,
-                           const XML_Char *base,
-                           const XML_Char *systemId,
-                           const XML_Char *publicId);
-
-

Set a handler that receives notation declarations.

-
- -
-
-XML_SetNotStandaloneHandler(XML_Parser p,
-                            XML_NotStandaloneHandler h)
-
-
-typedef int 
-(*XML_NotStandaloneHandler)(void *userData);
-
-

Set a handler that is called if the document is not "standalone". -This happens when there is an external subset or a reference to a -parameter entity, but does not have standalone set to "yes" in an XML -declaration. If this handler returns XML_STATUS_ERROR, -then the parser will throw an XML_ERROR_NOT_STANDALONE -error.

-
- -

Parse position and error reporting functions

- -

These are the functions you'll want to call when the parse -functions return XML_STATUS_ERROR (a parse error has -ocurred), although the position reporting functions are useful outside -of errors. The position reported is the byte position (in the original -document or entity encoding) of the first of the sequence of -characters that generated the current event (or the error that caused -the parse functions to return XML_STATUS_ERROR.)

- -

The position reporting functions are accurate only outside of the -DTD. In other words, they usually return bogus information when -called from within a DTD declaration handler.

- -
-enum XML_Error
-XML_GetErrorCode(XML_Parser p);
-
-
-Return what type of error has occurred. -
- -
-const XML_LChar *
-XML_ErrorString(int code);
-
-
-Return a string describing the error corresponding to code. -The code should be one of the enums that can be returned from -XML_GetErrorCode. -
- -
-long
-XML_GetCurrentByteIndex(XML_Parser p);
-
-
-Return the byte offset of the position. -
- -
-int
-XML_GetCurrentLineNumber(XML_Parser p);
-
-
-Return the line number of the position. -
- -
-int
-XML_GetCurrentColumnNumber(XML_Parser p);
-
-
-Return the offset, from the beginning of the current line, of -the position. -
- -
-int
-XML_GetCurrentByteCount(XML_Parser p);
-
-
-Return the number of bytes in the current event. Returns -0 if the event is inside a reference to an internal -entity and for the end-tag event for empty element tags (the later can -be used to distinguish empty-element tags from empty elements using -separate start and end tags). -
- -
-const char *
-XML_GetInputContext(XML_Parser p,
-                    int *offset,
-                    int *size);
-
-
- -

Returns the parser's input buffer, sets the integer pointed at by -offset to the offset within this buffer of the current -parse position, and set the integer pointed at by size to -the size of the returned buffer.

- -

This should only be called from within a handler during an active -parse and the returned buffer should only be referred to from within -the handler that made the call. This input buffer contains the -untranslated bytes of the input.

- -

Only a limited amount of context is kept, so if the event -triggering a call spans over a very large amount of input, the actual -parse position may be before the beginning of the buffer.

-
- -

Miscellaneous functions

- -

The functions in this section either obtain state information from -the parser or can be used to dynamicly set parser options.

- -
-void
-XML_SetUserData(XML_Parser p,
-                void *userData);
-
-
-This sets the user data pointer that gets passed to handlers. It -overwrites any previous value for this pointer. Note that the -application is responsible for freeing the memory associated with -userData when it is finished with the parser. So if you -call this when there's already a pointer there, and you haven't freed -the memory associated with it, then you've probably just leaked -memory. -
- -
-void *
-XML_GetUserData(XML_Parser p);
-
-
-This returns the user data pointer that gets passed to handlers. -It is actually implemented as a macro. -
- -
-void
-XML_UseParserAsHandlerArg(XML_Parser p);
-
-
-After this is called, handlers receive the parser in their -userData arguments. The user data can still be obtained -using the XML_GetUserData function. -
- -
-enum XML_Status
-XML_SetBase(XML_Parser p,
-            const XML_Char *base);
-
-
-Set the base to be used for resolving relative URIs in system -identifiers. The return value is XML_STATUS_ERROR if -there's no memory to store base, otherwise it's -XML_STATUS_OK. -
- -
-const XML_Char *
-XML_GetBase(XML_Parser p);
-
-
-Return the base for resolving relative URIs. -
- -
-int
-XML_GetSpecifiedAttributeCount(XML_Parser p);
-
-
-When attributes are reported to the start handler in the atts vector, -attributes that were explicitly set in the element occur before any -attributes that receive their value from default information in an -ATTLIST declaration. This function returns the number of attributes -that were explicitly set times two, thus giving the offset in the -atts array passed to the start tag handler of the first -attribute set due to defaults. It supplies information for the last -call to a start handler. If called inside a start handler, then that -means the current call. -
- -
-int
-XML_GetIdAttributeIndex(XML_Parser p);
-
-
-Returns the index of the ID attribute passed in the atts array in the -last call to XML_StartElementHandler, or -1 if there is no ID -attribute. If called inside a start handler, then that means the -current call. -
- -
-enum XML_Status
-XML_SetEncoding(XML_Parser p,
-                const XML_Char *encoding);
-
-
-Set the encoding to be used by the parser. It is equivalent to -passing a non-null encoding argument to the parser creation functions. -It must not be called after XML_Parse or XML_ParseBuffer have been called on the given parser. -Returns XML_STATUS_OK on success or -XML_STATUS_ERROR on error. -
- -
-int
-XML_SetParamEntityParsing(XML_Parser p,
-                          enum XML_ParamEntityParsing code);
-
-
-This enables parsing of parameter entities, including the external -parameter entity that is the external DTD subset, according to -code. -The choices for code are: -
    -
  • XML_PARAM_ENTITY_PARSING_NEVER
  • -
  • XML_PARAM_ENTITY_PARSING_UNLESS_STANDALONE
  • -
  • XML_PARAM_ENTITY_PARSING_ALWAYS
  • -
-
- -
-enum XML_Error
-XML_UseForeignDTD(XML_Parser parser, XML_Bool useDTD);
-
-
-

This function allows an application to provide an external subset -for the document type declaration for documents which do not specify -an external subset of their own. For documents which specify an -external subset in their DOCTYPE declaration, the application-provided -subset will be ignored. If the document does not contain a DOCTYPE -declaration at all and useDTD is true, the -application-provided subset will be parsed, but the -startDoctypeDeclHandler and -endDoctypeDeclHandler functions, if set, will not be -called. The setting of parameter entity parsing, controlled using -XML_SetParamEntityParsing, will be honored.

- -

The application-provided external subset is read by calling the -external entity reference handler set via XML_SetExternalEntityRefHandler with both -publicId and systemId set to NULL.

- -

If this function is called after parsing has begun, it returns -XML_ERROR_CANT_CHANGE_FEATURE_ONCE_PARSING and ignores -useDTD. If called when Expat has been compiled without -DTD support, it returns -XML_ERROR_FEATURE_REQUIRES_XML_DTD. Otherwise, it -returns XML_ERROR_NONE.

-
- -
-void
-XML_SetReturnNSTriplet(XML_Parser parser,
-                       int        do_nst);
-
-
-

-This function only has an effect when using a parser created with -XML_ParserCreateNS, -i.e. when namespace processing is in effect. The do_nst -sets whether or not prefixes are returned with names qualified with a -namespace prefix. If this function is called with do_nst -non-zero, then afterwards namespace qualified names (that is qualified -with a prefix as opposed to belonging to a default namespace) are -returned as a triplet with the three parts separated by the namespace -separator specified when the parser was created. The order of -returned parts is URI, local name, and prefix.

If -do_nst is zero, then namespaces are reported in the -default manner, URI then local_name separated by the namespace -separator.

-
- -
-void
-XML_DefaultCurrent(XML_Parser parser);
-
-
-This can be called within a handler for a start element, end element, -processing instruction or character data. It causes the corresponding -markup to be passed to the default handler set by XML_SetDefaultHandler or -XML_SetDefaultHandlerExpand. It does nothing if there is -not a default handler. -
- -
-XML_LChar *
-XML_ExpatVersion();
-
-
-Return the library version as a string (e.g. "expat_1.95.1"). -
- -
-struct XML_Expat_Version
-XML_ExpatVersionInfo();
-
-
-typedef struct {
-  int major;
-  int minor;
-  int micro;
-} XML_Expat_Version;
-
-
-Return the library version information as a structure. -Some macros are also defined that support compile-time tests of the -library version: -
    -
  • XML_MAJOR_VERSION
  • -
  • XML_MINOR_VERSION
  • -
  • XML_MICRO_VERSION
  • -
-Testing these constants is currently the best way to determine if -particular parts of the Expat API are available. -
- -
-const XML_Feature *
-XML_GetFeatureList();
-
-
-enum XML_FeatureEnum {
-  XML_FEATURE_END = 0,
-  XML_FEATURE_UNICODE,
-  XML_FEATURE_UNICODE_WCHAR_T,
-  XML_FEATURE_DTD,
-  XML_FEATURE_CONTEXT_BYTES,
-  XML_FEATURE_MIN_SIZE,
-  XML_FEATURE_SIZEOF_XML_CHAR,
-  XML_FEATURE_SIZEOF_XML_LCHAR
-};
-
-typedef struct {
-  enum XML_FeatureEnum  feature;
-  XML_LChar            *name;
-  long int              value;
-} XML_Feature;
-
-
-

Returns a list of "feature" records, providing details on how -Expat was configured at compile time. Most applications should not -need to worry about this, but this information is otherwise not -available from Expat. This function allows code that does need to -check these features to do so at runtime.

- -

The return value is an array of XML_Feature, -terminated by a record with a feature of -XML_FEATURE_END and name of NULL, -identifying the feature-test macros Expat was compiled with. Since an -application that requires this kind of information needs to determine -the type of character the name points to, records for the -XML_FEATURE_SIZEOF_XML_CHAR and -XML_FEATURE_SIZEOF_XML_LCHAR will be located at the -beginning of the list, followed by XML_FEATURE_UNICODE -and XML_FEATURE_UNICODE_WCHAR_T, if they are present at -all.

- -

Some features have an associated value. If there isn't an -associated value, the value field is set to 0. At this -time, the following features have been defined to have values:

- -
-
XML_FEATURE_SIZEOF_XML_CHAR
-
The number of bytes occupied by one XML_Char - character.
-
XML_FEATURE_SIZEOF_XML_LCHAR
-
The number of bytes occupied by one XML_LChar - character.
-
XML_FEATURE_CONTEXT_BYTES
-
The maximum number of characters of context which can be - reported by XML_GetInputContext.
-
-
- -
-void
-XML_FreeContentModel(XML_Parser parser, XML_Content *model);
-
-
-Function to deallocate the model argument passed to the -XML_ElementDeclHandler callback set using XML_ElementDeclHandler. -This function should not be used for any other purpose. -
- -

The following functions allow external code to share the memory -allocator an XML_Parser has been configured to use. This -is especially useful for third-party libraries that interact with a -parser object created by application code, or heavily layered -applications. This can be essential when using dynamically loaded -libraries which use different C standard libraries (this can happen on -Windows, at least).

- -
-void *
-XML_MemMalloc(XML_Parser parser, size_t size);
-
-
-Allocate size bytes of memory using the allocator the -parser object has been configured to use. Returns a -pointer to the memory or NULL on failure. Memory allocated in this -way must be freed using XML_MemFree. -
- -
-void *
-XML_MemRealloc(XML_Parser parser, void *ptr, size_t size);
-
-
-Allocate size bytes of memory using the allocator the -parser object has been configured to use. -ptr must point to a block of memory allocated by XML_MemMalloc or -XML_MemRealloc, or be NULL. This function tries to -expand the block pointed to by ptr if possible. Returns -a pointer to the memory or NULL on failure. On success, the original -block has either been expanded or freed. On failure, the original -block has not been freed; the caller is responsible for freeing the -original block. Memory allocated in this way must be freed using -XML_MemFree. -
- -
-void
-XML_MemFree(XML_Parser parser, void *ptr);
-
-
-Free a block of memory pointed to by ptr. The block must -have been allocated by XML_MemMalloc or XML_MemRealloc, or be NULL. -
- -
-

Valid XHTML 1.0!

- - diff --git a/wxWidgets/src/expat/doc/style.css b/wxWidgets/src/expat/doc/style.css deleted file mode 100644 index 6f4886077a..0000000000 --- a/wxWidgets/src/expat/doc/style.css +++ /dev/null @@ -1,51 +0,0 @@ -body { - background-color: white -} - -.noborder { - border-width: 0px; -} - -.eg { - padding-left: 1em; - padding-top: .5em; - padding-bottom: .5em; - border: solid thin; - margin: 1em 0; - background-color: tan; - margin-left: 2em; - margin-right: 10%; -} - -.handler { - width: 100%; - border-top-width: thin; - margin-bottom: 1em; -} - -.handler p { - margin-left: 2em; -} - -.setter { - font-weight: bold; -} - -.signature { - color: navy; -} - -.fcndec { - width: 100%; - border-top-width: thin; - font-weight: bold; -} - -.fcndef { - margin-left: 2em; - margin-bottom: 2em; -} - -dd { - margin-bottom: 2em; -} diff --git a/wxWidgets/src/expat/doc/valid-xhtml10.png b/wxWidgets/src/expat/doc/valid-xhtml10.png deleted file mode 100644 index 2275ee6ea17da3a4c67a5d90c2f2105bc0d6c5a0..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2414 zcmbVNX;2f{7H-8QAWIODU~n`nVqipj2Gj;bX`?`kfGr|4qYzsVCn7@Qf~~j^Hfd)> zn-Mi2E>Q=K8%9xVQNW<`XaTj|FfKSoRA>apxQ%(Kd9SAC*VLg_1e7?aP$)DM%n^`I zg_w9A$8lBxvN)(w;HXlopcx24R9a3Y0CWn43IKF!jMlPRNCZKU8kLGf0-A(K925x! zGy#Di$fyvFM5x#60gz;9L?{3#1qet}A{3}pA|x=-#3^7qv_CIi8!Fd<575s6SJWLQ1J zFc6^@AQXxskU}jG2v7u(m=m;Gy%q;xCB1R#LGv!&%S0pQ{$~nPfoWNo$&~qD@1Mc? zuW;61?EfSS{-F-|TTEaw$^Pd44>UcfED-<(GGVgd=rs>YVu})m&2SmjRP#nY^TC#i zIRoMfEMK{Kdzfkq@ z<=3+8?`u|{6TNTco7rwQ+gMZkaZ0kSBk{(5+SN0p>)Si@M!zT1ug0B9qEFh-bQcXi zxo3XCfDZdh;@_j}Dtpw|V&2Tm^i(@iVE=UyCq!br;TflQw2%$PgTVHmx}UN`Cmh4P>C+b$TT>%9`kEIZNJu1_`{p73S$s^MM6&4OFC*OOzFXH#e2A1Vrx z-8=0f+Or%|e0h$2w}Oz!JGZ;wF3FW+a>6LNzkT%SU!N4E6B$!}+saw^MlS!CO|0G5 z@Vs^0?Snr$oi7z%yDHCUUv~kAx{549x_MKqnpn)x;?yU~q zcEv5k#WytJtY7z*-NDvVYS%O@vWHGyZWWF4+Lsx4I^j2(OyVxS56@>aXAVI61sLC06LqmCfTT^sdd; z39l!Khb39WchxuF$g^0Q+q~o&(iEU-XR3}JKXEMm?2^Ni{DbF2uFdEXJ8%Brus8AN zoJr+T^1Je)l<|FRUb@wj-8peFGoe+*&a|vMG@0TyR_0d>Km2$rzUA z-!N{_*{i3|ywA38AWmk818OsE1p(70jl8R$+D;v@wtIQ2A?>iZZoOUHJU{;J^nrp6 zf?n@b+8=Nb1r2>Om+v)xF=c z*&`?HVk-h~T~-LX8Z*9wKW_SwrX*`4#pAxVgI0gU+yq}XrN-IVq?bSG%k1Go3O!FO z9N)%ywo}-IISUHv)xu{X^|9>qqT%Oux9q1EFDMNk>eIRFN!`4}r1kJgrH(v)W$jw@ z7<19pTLen(o>ZiJpE@+Q)FaMub9_sZPy6n?s0UKoCAKiHx3~9-UO8X}tTQap7I1ILGop zxuz!TapO_#@ms@Z&0<=gAkc zaC^GD<7O~+W>MH8@vCP+FPy#7ZnWl>>@j~N~=^S=R$XZ5)N diff --git a/wxWidgets/src/expat/doc/xmlwf.1 b/wxWidgets/src/expat/doc/xmlwf.1 deleted file mode 100644 index 907d6c37b5..0000000000 --- a/wxWidgets/src/expat/doc/xmlwf.1 +++ /dev/null @@ -1,251 +0,0 @@ -.\" This manpage has been automatically generated by docbook2man -.\" from a DocBook document. This tool can be found at: -.\" -.\" Please send any bug reports, improvements, comments, patches, -.\" etc. to Steve Cheng . -.TH "XMLWF" "1" "24 January 2003" "" "" -.SH NAME -xmlwf \- Determines if an XML document is well-formed -.SH SYNOPSIS - -\fBxmlwf\fR [ \fB-s\fR] [ \fB-n\fR] [ \fB-p\fR] [ \fB-x\fR] [ \fB-e \fIencoding\fB\fR] [ \fB-w\fR] [ \fB-d \fIoutput-dir\fB\fR] [ \fB-c\fR] [ \fB-m\fR] [ \fB-r\fR] [ \fB-t\fR] [ \fB-v\fR] [ \fBfile ...\fR] - -.SH "DESCRIPTION" -.PP -\fBxmlwf\fR uses the Expat library to -determine if an XML document is well-formed. It is -non-validating. -.PP -If you do not specify any files on the command-line, and you -have a recent version of \fBxmlwf\fR, the -input file will be read from standard input. -.SH "WELL-FORMED DOCUMENTS" -.PP -A well-formed document must adhere to the -following rules: -.TP 0.2i -\(bu -The file begins with an XML declaration. For instance, -. -\fBNOTE:\fR -\fBxmlwf\fR does not currently -check for a valid XML declaration. -.TP 0.2i -\(bu -Every start tag is either empty () -or has a corresponding end tag. -.TP 0.2i -\(bu -There is exactly one root element. This element must contain -all other elements in the document. Only comments, white -space, and processing instructions may come after the close -of the root element. -.TP 0.2i -\(bu -All elements nest properly. -.TP 0.2i -\(bu -All attribute values are enclosed in quotes (either single -or double). -.PP -If the document has a DTD, and it strictly complies with that -DTD, then the document is also considered \fBvalid\fR. -\fBxmlwf\fR is a non-validating parser -- -it does not check the DTD. However, it does support -external entities (see the \fB-x\fR option). -.SH "OPTIONS" -.PP -When an option includes an argument, you may specify the argument either -separately ("\fB-d\fR output") or concatenated with the -option ("\fB-d\fRoutput"). \fBxmlwf\fR -supports both. -.TP -\fB-c\fR -If the input file is well-formed and \fBxmlwf\fR -doesn't encounter any errors, the input file is simply copied to -the output directory unchanged. -This implies no namespaces (turns off \fB-n\fR) and -requires \fB-d\fR to specify an output file. -.TP -\fB-d output-dir\fR -Specifies a directory to contain transformed -representations of the input files. -By default, \fB-d\fR outputs a canonical representation -(described below). -You can select different output formats using \fB-c\fR -and \fB-m\fR. - -The output filenames will -be exactly the same as the input filenames or "STDIN" if the input is -coming from standard input. Therefore, you must be careful that the -output file does not go into the same directory as the input -file. Otherwise, \fBxmlwf\fR will delete the -input file before it generates the output file (just like running -cat < file > file in most shells). - -Two structurally equivalent XML documents have a byte-for-byte -identical canonical XML representation. -Note that ignorable white space is considered significant and -is treated equivalently to data. -More on canonical XML can be found at -http://www.jclark.com/xml/canonxml.html . -.TP -\fB-e encoding\fR -Specifies the character encoding for the document, overriding -any document encoding declaration. \fBxmlwf\fR -supports four built-in encodings: -US-ASCII, -UTF-8, -UTF-16, and -ISO-8859-1. -Also see the \fB-w\fR option. -.TP -\fB-m\fR -Outputs some strange sort of XML file that completely -describes the the input file, including character postitions. -Requires \fB-d\fR to specify an output file. -.TP -\fB-n\fR -Turns on namespace processing. (describe namespaces) -\fB-c\fR disables namespaces. -.TP -\fB-p\fR -Tells xmlwf to process external DTDs and parameter -entities. - -Normally \fBxmlwf\fR never parses parameter -entities. \fB-p\fR tells it to always parse them. -\fB-p\fR implies \fB-x\fR. -.TP -\fB-r\fR -Normally \fBxmlwf\fR memory-maps the XML file -before parsing; this can result in faster parsing on many -platforms. -\fB-r\fR turns off memory-mapping and uses normal file -IO calls instead. -Of course, memory-mapping is automatically turned off -when reading from standard input. - -Use of memory-mapping can cause some platforms to report -substantially higher memory usage for -\fBxmlwf\fR, but this appears to be a matter of -the operating system reporting memory in a strange way; there is -not a leak in \fBxmlwf\fR. -.TP -\fB-s\fR -Prints an error if the document is not standalone. -A document is standalone if it has no external subset and no -references to parameter entities. -.TP -\fB-t\fR -Turns on timings. This tells Expat to parse the entire file, -but not perform any processing. -This gives a fairly accurate idea of the raw speed of Expat itself -without client overhead. -\fB-t\fR turns off most of the output options -(\fB-d\fR, \fB-m\fR, \fB-c\fR, -\&...). -.TP -\fB-v\fR -Prints the version of the Expat library being used, including some -information on the compile-time configuration of the library, and -then exits. -.TP -\fB-w\fR -Enables support for Windows code pages. -Normally, \fBxmlwf\fR will throw an error if it -runs across an encoding that it is not equipped to handle itself. With -\fB-w\fR, xmlwf will try to use a Windows code -page. See also \fB-e\fR. -.TP -\fB-x\fR -Turns on parsing external entities. - -Non-validating parsers are not required to resolve external -entities, or even expand entities at all. -Expat always expands internal entities (?), -but external entity parsing must be enabled explicitly. - -External entities are simply entities that obtain their -data from outside the XML file currently being parsed. - -This is an example of an internal entity: - -.nf - -.fi - -And here are some examples of external entities: - -.nf - (parsed) - (unparsed) -.fi -.TP -\fB--\fR -(Two hyphens.) -Terminates the list of options. This is only needed if a filename -starts with a hyphen. For example: - -.nf -xmlwf -- -myfile.xml -.fi - -will run \fBxmlwf\fR on the file -\fI-myfile.xml\fR. -.PP -Older versions of \fBxmlwf\fR do not support -reading from standard input. -.SH "OUTPUT" -.PP -If an input file is not well-formed, -\fBxmlwf\fR prints a single line describing -the problem to standard output. If a file is well formed, -\fBxmlwf\fR outputs nothing. -Note that the result code is \fBnot\fR set. -.SH "BUGS" -.PP -According to the W3C standard, an XML file without a -declaration at the beginning is not considered well-formed. -However, \fBxmlwf\fR allows this to pass. -.PP -\fBxmlwf\fR returns a 0 - noerr result, -even if the file is not well-formed. There is no good way for -a program to use \fBxmlwf\fR to quickly -check a file -- it must parse \fBxmlwf\fR's -standard output. -.PP -The errors should go to standard error, not standard output. -.PP -There should be a way to get \fB-d\fR to send its -output to standard output rather than forcing the user to send -it to a file. -.PP -I have no idea why anyone would want to use the -\fB-d\fR, \fB-c\fR, and -\fB-m\fR options. If someone could explain it to -me, I'd like to add this information to this manpage. -.SH "ALTERNATIVES" -.PP -Here are some XML validators on the web: - -.nf -http://www.hcrc.ed.ac.uk/~richard/xml-check.html -http://www.stg.brown.edu/service/xmlvalid/ -http://www.scripting.com/frontier5/xml/code/xmlValidator.html -http://www.xml.com/pub/a/tools/ruwf/check.html -.fi -.SH "SEE ALSO" -.PP - -.nf -The Expat home page: http://www.libexpat.org/ -The W3 XML specification: http://www.w3.org/TR/REC-xml -.fi -.SH "AUTHOR" -.PP -This manual page was written by Scott Bronson for -the Debian GNU/Linux system (but may be used by others). Permission is -granted to copy, distribute and/or modify this document under -the terms of the GNU Free Documentation -License, Version 1.1. diff --git a/wxWidgets/src/expat/doc/xmlwf.sgml b/wxWidgets/src/expat/doc/xmlwf.sgml deleted file mode 100644 index 139c95e1f1..0000000000 --- a/wxWidgets/src/expat/doc/xmlwf.sgml +++ /dev/null @@ -1,473 +0,0 @@ - manpage.1'. You may view - the manual page with: `docbook-to-man manpage.sgml | nroff -man | - less'. A typical entry in a Makefile or Makefile.am is: - -manpage.1: manpage.sgml - docbook-to-man $< > $@ - --> - - - Scott"> - Bronson"> - - December 5, 2001"> - - 1"> - bronson@rinspin.com"> - - XMLWF"> - - - Debian GNU/Linux"> - GNU"> -]> - - - -
- &dhemail; -
- - &dhfirstname; - &dhsurname; - - - 2001 - &dhusername; - - &dhdate; -
- - &dhucpackage; - - &dhsection; - - - &dhpackage; - - Determines if an XML document is well-formed - - - - &dhpackage; - - - - - - - - - - - - - - - - - - file ... - - - - - DESCRIPTION - - - &dhpackage; uses the Expat library to - determine if an XML document is well-formed. It is - non-validating. - - - - If you do not specify any files on the command-line, and you - have a recent version of &dhpackage;, the - input file will be read from standard input. - - - - - - WELL-FORMED DOCUMENTS - - - A well-formed document must adhere to the - following rules: - - - - - The file begins with an XML declaration. For instance, - <?xml version="1.0" standalone="yes"?>. - NOTE: - &dhpackage; does not currently - check for a valid XML declaration. - - - Every start tag is either empty (<tag/>) - or has a corresponding end tag. - - - There is exactly one root element. This element must contain - all other elements in the document. Only comments, white - space, and processing instructions may come after the close - of the root element. - - - All elements nest properly. - - - All attribute values are enclosed in quotes (either single - or double). - - - - - If the document has a DTD, and it strictly complies with that - DTD, then the document is also considered valid. - &dhpackage; is a non-validating parser -- - it does not check the DTD. However, it does support - external entities (see the option). - - - - - OPTIONS - - -When an option includes an argument, you may specify the argument either -separately (" output") or concatenated with the -option ("output"). &dhpackage; -supports both. - - - - - - - - - If the input file is well-formed and &dhpackage; - doesn't encounter any errors, the input file is simply copied to - the output directory unchanged. - This implies no namespaces (turns off ) and - requires to specify an output file. - - - - - - - - - Specifies a directory to contain transformed - representations of the input files. - By default, outputs a canonical representation - (described below). - You can select different output formats using - and . - - - The output filenames will - be exactly the same as the input filenames or "STDIN" if the input is - coming from standard input. Therefore, you must be careful that the - output file does not go into the same directory as the input - file. Otherwise, &dhpackage; will delete the - input file before it generates the output file (just like running - cat < file > file in most shells). - - - Two structurally equivalent XML documents have a byte-for-byte - identical canonical XML representation. - Note that ignorable white space is considered significant and - is treated equivalently to data. - More on canonical XML can be found at - http://www.jclark.com/xml/canonxml.html . - - - - - - - - - Specifies the character encoding for the document, overriding - any document encoding declaration. &dhpackage; - supports four built-in encodings: - US-ASCII, - UTF-8, - UTF-16, and - ISO-8859-1. - Also see the option. - - - - - - - - - Outputs some strange sort of XML file that completely - describes the the input file, including character postitions. - Requires to specify an output file. - - - - - - - - - Turns on namespace processing. (describe namespaces) - disables namespaces. - - - - - - - - - Tells xmlwf to process external DTDs and parameter - entities. - - - Normally &dhpackage; never parses parameter - entities. tells it to always parse them. - implies . - - - - - - - - - Normally &dhpackage; memory-maps the XML file - before parsing; this can result in faster parsing on many - platforms. - turns off memory-mapping and uses normal file - IO calls instead. - Of course, memory-mapping is automatically turned off - when reading from standard input. - - - Use of memory-mapping can cause some platforms to report - substantially higher memory usage for - &dhpackage;, but this appears to be a matter of - the operating system reporting memory in a strange way; there is - not a leak in &dhpackage;. - - - - - - - - - Prints an error if the document is not standalone. - A document is standalone if it has no external subset and no - references to parameter entities. - - - - - - - - - Turns on timings. This tells Expat to parse the entire file, - but not perform any processing. - This gives a fairly accurate idea of the raw speed of Expat itself - without client overhead. - turns off most of the output options - (, , , - ...). - - - - - - - - - Prints the version of the Expat library being used, including some - information on the compile-time configuration of the library, and - then exits. - - - - - - - - - Enables support for Windows code pages. - Normally, &dhpackage; will throw an error if it - runs across an encoding that it is not equipped to handle itself. With - , &dhpackage; will try to use a Windows code - page. See also . - - - - - - - - - Turns on parsing external entities. - - - Non-validating parsers are not required to resolve external - entities, or even expand entities at all. - Expat always expands internal entities (?), - but external entity parsing must be enabled explicitly. - - - External entities are simply entities that obtain their - data from outside the XML file currently being parsed. - - - This is an example of an internal entity: - -<!ENTITY vers '1.0.2'> - - - - And here are some examples of external entities: - - -<!ENTITY header SYSTEM "header-&vers;.xml"> (parsed) -<!ENTITY logo SYSTEM "logo.png" PNG> (unparsed) - - - - - - - - - - - (Two hyphens.) - Terminates the list of options. This is only needed if a filename - starts with a hyphen. For example: - - -&dhpackage; -- -myfile.xml - - - will run &dhpackage; on the file - -myfile.xml. - - - - - - - Older versions of &dhpackage; do not support - reading from standard input. - - - - - OUTPUT - - If an input file is not well-formed, - &dhpackage; prints a single line describing - the problem to standard output. If a file is well formed, - &dhpackage; outputs nothing. - Note that the result code is not set. - - - - - BUGS - - According to the W3C standard, an XML file without a - declaration at the beginning is not considered well-formed. - However, &dhpackage; allows this to pass. - - - &dhpackage; returns a 0 - noerr result, - even if the file is not well-formed. There is no good way for - a program to use &dhpackage; to quickly - check a file -- it must parse &dhpackage;'s - standard output. - - - The errors should go to standard error, not standard output. - - - There should be a way to get to send its - output to standard output rather than forcing the user to send - it to a file. - - - I have no idea why anyone would want to use the - , , and - options. If someone could explain it to - me, I'd like to add this information to this manpage. - - - - - ALTERNATIVES - - Here are some XML validators on the web: - - -http://www.hcrc.ed.ac.uk/~richard/xml-check.html -http://www.stg.brown.edu/service/xmlvalid/ -http://www.scripting.com/frontier5/xml/code/xmlValidator.html -http://www.xml.com/pub/a/tools/ruwf/check.html - - - - - - - SEE ALSO - - - -The Expat home page: http://www.libexpat.org/ -The W3 XML specification: http://www.w3.org/TR/REC-xml - - - - - - - AUTHOR - - This manual page was written by &dhusername; &dhemail; for - the &debian; system (but may be used by others). Permission is - granted to copy, distribute and/or modify this document under - the terms of the GNU Free Documentation - License, Version 1.1. - - -
- - diff --git a/wxWidgets/src/expat/examples/elements.c b/wxWidgets/src/expat/examples/elements.c deleted file mode 100644 index 4ed4da6a34..0000000000 --- a/wxWidgets/src/expat/examples/elements.c +++ /dev/null @@ -1,50 +0,0 @@ -/* This is simple demonstration of how to use expat. This program - reads an XML document from standard input and writes a line with - the name of each element to standard output indenting child - elements by one tab stop more than their parent element. -*/ - -#include -#include "expat.h" - -static void -startElement(void *userData, const char *name, const char **atts) -{ - int i; - int *depthPtr = userData; - for (i = 0; i < *depthPtr; i++) - putchar('\t'); - puts(name); - *depthPtr += 1; -} - -static void -endElement(void *userData, const char *name) -{ - int *depthPtr = userData; - *depthPtr -= 1; -} - -int -main(int argc, char *argv[]) -{ - char buf[BUFSIZ]; - XML_Parser parser = XML_ParserCreate(NULL); - int done; - int depth = 0; - XML_SetUserData(parser, &depth); - XML_SetElementHandler(parser, startElement, endElement); - do { - size_t len = fread(buf, 1, sizeof(buf), stdin); - done = len < sizeof(buf); - if (XML_Parse(parser, buf, len, done) == XML_STATUS_ERROR) { - fprintf(stderr, - "%s at line %d\n", - XML_ErrorString(XML_GetErrorCode(parser)), - XML_GetCurrentLineNumber(parser)); - return 1; - } - } while (!done); - XML_ParserFree(parser); - return 0; -} diff --git a/wxWidgets/src/expat/examples/outline.c b/wxWidgets/src/expat/examples/outline.c deleted file mode 100644 index 10f6d1db5b..0000000000 --- a/wxWidgets/src/expat/examples/outline.c +++ /dev/null @@ -1,90 +0,0 @@ -/***************************************************************** - * outline.c - * - * Copyright 1999, Clark Cooper - * All rights reserved. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the license contained in the - * COPYING file that comes with the expat distribution. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * Read an XML document from standard input and print an element - * outline on standard output. - */ - - -#include -#include - -#define BUFFSIZE 8192 - -char Buff[BUFFSIZE]; - -int Depth; - -static void -start(void *data, const char *el, const char **attr) -{ - int i; - - for (i = 0; i < Depth; i++) - printf(" "); - - printf("%s", el); - - for (i = 0; attr[i]; i += 2) { - printf(" %s='%s'", attr[i], attr[i + 1]); - } - - printf("\n"); - Depth++; -} - -static void -end(void *data, const char *el) -{ - Depth--; -} - -int -main(int argc, char *argv[]) -{ - XML_Parser p = XML_ParserCreate(NULL); - if (! p) { - fprintf(stderr, "Couldn't allocate memory for parser\n"); - exit(-1); - } - - XML_SetElementHandler(p, start, end); - - for (;;) { - int done; - int len; - - len = fread(Buff, 1, BUFFSIZE, stdin); - if (ferror(stdin)) { - fprintf(stderr, "Read error\n"); - exit(-1); - } - done = feof(stdin); - - if (XML_Parse(p, Buff, len, done) == XML_STATUS_ERROR) { - fprintf(stderr, "Parse error at line %d:\n%s\n", - XML_GetCurrentLineNumber(p), - XML_ErrorString(XML_GetErrorCode(p))); - exit(-1); - } - - if (done) - break; - } - return 0; -} diff --git a/wxWidgets/src/expat/expat.dsp b/wxWidgets/src/expat/expat.dsp deleted file mode 100644 index 8b7072e6bf..0000000000 --- a/wxWidgets/src/expat/expat.dsp +++ /dev/null @@ -1,110 +0,0 @@ -# Microsoft Developer Studio Project File - Name="expat" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Static Library" 0x0104 - -CFG=expat - 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 "expat.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 "expat.mak" CFG="expat - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "expat - Win32 Release" (based on "Win32 (x86) Static Library") -!MESSAGE "expat - Win32 Debug" (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)" == "expat - 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 Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /MD /w /W0 /O1 /Ob2 /I "../include" /D "WIN32" /D "_WINDOWS" /D "__WINDOWS__" /D "__WXMSW__" /D "__WIN95__" /D "__WIN32__" /D WINVER=0x0400 /D "STRICT" /D "COMPILED_FROM_DSP" /FD /c -# SUBTRACT CPP /YX /Yc /Yu -# ADD BASE RSC /l 0x809 -# ADD RSC /l 0x809 -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo /out:"..\..\lib\expat.lib" - -!ELSEIF "$(CFG)" == "expat - 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 Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /Z7 /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /MDd /w /W0 /Zi /Od /I "../include" /I ".." /D "_DEBUG" /D DEBUG=1 /D "__WXDEBUG__" /D "WIN32" /D "_WINDOWS" /D "__WINDOWS__" /D "__WXMSW__" /D "__WIN95__" /D "__WIN32__" /D WINVER=0x0400 /D "STRICT" /D "COMPILED_FROM_DSP" /FD /c -# SUBTRACT CPP /YX /Yc /Yu -# ADD BASE RSC /l 0x809 -# ADD RSC /l 0x809 -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo /out:"..\..\lib\expatd.lib" - -!ENDIF - -# Begin Target - -# Name "expat - Win32 Release" -# Name "expat - Win32 Debug" -# Begin Group "Source Files" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\lib\xmlparse.c -# End Source File -# Begin Source File - -SOURCE=.\lib\xmlrole.c -# End Source File -# Begin Source File - -SOURCE=.\lib\xmltok.c -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h" -# Begin Source File - -SOURCE=.\lib\expat.h -# End Source File -# End Group -# End Target -# End Project diff --git a/wxWidgets/src/expat/expat_config.h.in b/wxWidgets/src/expat/expat_config.h.in deleted file mode 100644 index 602048ec7c..0000000000 --- a/wxWidgets/src/expat/expat_config.h.in +++ /dev/null @@ -1,89 +0,0 @@ -/* expat_config.h.in. Generated from configure.in by autoheader. */ - -/* 1234 = LIL_ENDIAN, 4321 = BIGENDIAN */ -#undef BYTEORDER - -/* Define to 1 if you have the `bcopy' function. */ -#undef HAVE_BCOPY - -/* Define to 1 if you have the header file. */ -#undef HAVE_DLFCN_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_FCNTL_H - -/* Define to 1 if you have the `getpagesize' function. */ -#undef HAVE_GETPAGESIZE - -/* Define to 1 if you have the header file. */ -#undef HAVE_INTTYPES_H - -/* Define to 1 if you have the `memmove' function. */ -#undef HAVE_MEMMOVE - -/* Define to 1 if you have the header file. */ -#undef HAVE_MEMORY_H - -/* Define to 1 if you have a working `mmap' system call. */ -#undef HAVE_MMAP - -/* Define to 1 if you have the header file. */ -#undef HAVE_STDINT_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_STDLIB_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_STRINGS_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_STRING_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_STAT_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_TYPES_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_UNISTD_H - -/* Define to the address where bug reports for this package should be sent. */ -#undef PACKAGE_BUGREPORT - -/* Define to the full name of this package. */ -#undef PACKAGE_NAME - -/* Define to the full name and version of this package. */ -#undef PACKAGE_STRING - -/* Define to the one symbol short name of this package. */ -#undef PACKAGE_TARNAME - -/* Define to the version of this package. */ -#undef PACKAGE_VERSION - -/* Define to 1 if you have the ANSI C header files. */ -#undef STDC_HEADERS - -/* whether byteorder is bigendian */ -#undef WORDS_BIGENDIAN - -/* Define to specify how much context to retain around the current parse - point. */ -#undef XML_CONTEXT_BYTES - -/* Define to make parameter entity parsing functionality available. */ -#undef XML_DTD - -/* Define to make XML Namespaces functionality available. */ -#undef XML_NS - -/* Define to empty if `const' does not conform to ANSI C. */ -#undef const - -/* Define to `long' if does not define. */ -#undef off_t - -/* Define to `unsigned' if does not define. */ -#undef size_t diff --git a/wxWidgets/src/expat/lib/ascii.h b/wxWidgets/src/expat/lib/ascii.h deleted file mode 100644 index 337e5bb7ea..0000000000 --- a/wxWidgets/src/expat/lib/ascii.h +++ /dev/null @@ -1,85 +0,0 @@ -/* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd - See the file COPYING for copying permission. -*/ - -#define ASCII_A 0x41 -#define ASCII_B 0x42 -#define ASCII_C 0x43 -#define ASCII_D 0x44 -#define ASCII_E 0x45 -#define ASCII_F 0x46 -#define ASCII_G 0x47 -#define ASCII_H 0x48 -#define ASCII_I 0x49 -#define ASCII_J 0x4A -#define ASCII_K 0x4B -#define ASCII_L 0x4C -#define ASCII_M 0x4D -#define ASCII_N 0x4E -#define ASCII_O 0x4F -#define ASCII_P 0x50 -#define ASCII_Q 0x51 -#define ASCII_R 0x52 -#define ASCII_S 0x53 -#define ASCII_T 0x54 -#define ASCII_U 0x55 -#define ASCII_V 0x56 -#define ASCII_W 0x57 -#define ASCII_X 0x58 -#define ASCII_Y 0x59 -#define ASCII_Z 0x5A - -#define ASCII_a 0x61 -#define ASCII_b 0x62 -#define ASCII_c 0x63 -#define ASCII_d 0x64 -#define ASCII_e 0x65 -#define ASCII_f 0x66 -#define ASCII_g 0x67 -#define ASCII_h 0x68 -#define ASCII_i 0x69 -#define ASCII_j 0x6A -#define ASCII_k 0x6B -#define ASCII_l 0x6C -#define ASCII_m 0x6D -#define ASCII_n 0x6E -#define ASCII_o 0x6F -#define ASCII_p 0x70 -#define ASCII_q 0x71 -#define ASCII_r 0x72 -#define ASCII_s 0x73 -#define ASCII_t 0x74 -#define ASCII_u 0x75 -#define ASCII_v 0x76 -#define ASCII_w 0x77 -#define ASCII_x 0x78 -#define ASCII_y 0x79 -#define ASCII_z 0x7A - -#define ASCII_0 0x30 -#define ASCII_1 0x31 -#define ASCII_2 0x32 -#define ASCII_3 0x33 -#define ASCII_4 0x34 -#define ASCII_5 0x35 -#define ASCII_6 0x36 -#define ASCII_7 0x37 -#define ASCII_8 0x38 -#define ASCII_9 0x39 - -#define ASCII_TAB 0x09 -#define ASCII_SPACE 0x20 -#define ASCII_EXCL 0x21 -#define ASCII_QUOT 0x22 -#define ASCII_AMP 0x26 -#define ASCII_APOS 0x27 -#define ASCII_MINUS 0x2D -#define ASCII_PERIOD 0x2E -#define ASCII_COLON 0x3A -#define ASCII_SEMI 0x3B -#define ASCII_LT 0x3C -#define ASCII_EQUALS 0x3D -#define ASCII_GT 0x3E -#define ASCII_LSQB 0x5B -#define ASCII_RSQB 0x5D -#define ASCII_UNDERSCORE 0x5F diff --git a/wxWidgets/src/expat/lib/asciitab.h b/wxWidgets/src/expat/lib/asciitab.h deleted file mode 100644 index 79a15c28ca..0000000000 --- a/wxWidgets/src/expat/lib/asciitab.h +++ /dev/null @@ -1,36 +0,0 @@ -/* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd - See the file COPYING for copying permission. -*/ - -/* 0x00 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, -/* 0x04 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, -/* 0x08 */ BT_NONXML, BT_S, BT_LF, BT_NONXML, -/* 0x0C */ BT_NONXML, BT_CR, BT_NONXML, BT_NONXML, -/* 0x10 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, -/* 0x14 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, -/* 0x18 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, -/* 0x1C */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, -/* 0x20 */ BT_S, BT_EXCL, BT_QUOT, BT_NUM, -/* 0x24 */ BT_OTHER, BT_PERCNT, BT_AMP, BT_APOS, -/* 0x28 */ BT_LPAR, BT_RPAR, BT_AST, BT_PLUS, -/* 0x2C */ BT_COMMA, BT_MINUS, BT_NAME, BT_SOL, -/* 0x30 */ BT_DIGIT, BT_DIGIT, BT_DIGIT, BT_DIGIT, -/* 0x34 */ BT_DIGIT, BT_DIGIT, BT_DIGIT, BT_DIGIT, -/* 0x38 */ BT_DIGIT, BT_DIGIT, BT_COLON, BT_SEMI, -/* 0x3C */ BT_LT, BT_EQUALS, BT_GT, BT_QUEST, -/* 0x40 */ BT_OTHER, BT_HEX, BT_HEX, BT_HEX, -/* 0x44 */ BT_HEX, BT_HEX, BT_HEX, BT_NMSTRT, -/* 0x48 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, -/* 0x4C */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, -/* 0x50 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, -/* 0x54 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, -/* 0x58 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_LSQB, -/* 0x5C */ BT_OTHER, BT_RSQB, BT_OTHER, BT_NMSTRT, -/* 0x60 */ BT_OTHER, BT_HEX, BT_HEX, BT_HEX, -/* 0x64 */ BT_HEX, BT_HEX, BT_HEX, BT_NMSTRT, -/* 0x68 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, -/* 0x6C */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, -/* 0x70 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, -/* 0x74 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, -/* 0x78 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_OTHER, -/* 0x7C */ BT_VERBAR, BT_OTHER, BT_OTHER, BT_OTHER, diff --git a/wxWidgets/src/expat/lib/dosconfig.h b/wxWidgets/src/expat/lib/dosconfig.h deleted file mode 100644 index accde34e1f..0000000000 --- a/wxWidgets/src/expat/lib/dosconfig.h +++ /dev/null @@ -1,25 +0,0 @@ -/*================================================================ -** Copyright 2000, Clark Cooper -** All rights reserved. -** -** This is free software. You are permitted to copy, distribute, or modify -** it under the terms of the MIT/X license (contained in the COPYING file -** with this distribution.) -*/ - -#ifndef DOSCONFIG_H -#define DOSCONFIG_H - -#include -#include - -#define XML_NS 1 -#define XML_DTD 1 -#define XML_CONTEXT_BYTES 1024 - -/* we will assume all DOS platforms are little endian */ -#define BYTEORDER 1234 - -#define HAVE_BCOPY - -#endif /* ndef DOSCONFIG_H */ diff --git a/wxWidgets/src/expat/lib/expat.h b/wxWidgets/src/expat/lib/expat.h deleted file mode 100644 index 60c9597992..0000000000 --- a/wxWidgets/src/expat/lib/expat.h +++ /dev/null @@ -1,918 +0,0 @@ -/* Copyright (c) 1998, 1999, 2000 Thai Open Source Software Center Ltd - See the file COPYING for copying permission. -*/ - -#ifndef XmlParse_INCLUDED -#define XmlParse_INCLUDED 1 - -#ifdef __VMS -/* 0 1 2 3 0 1 2 3 - 1234567890123456789012345678901 1234567890123456789012345678901 */ -#define XML_SetProcessingInstructionHandler XML_SetProcessingInstrHandler -#define XML_SetUnparsedEntityDeclHandler XML_SetUnparsedEntDeclHandler -#define XML_SetStartNamespaceDeclHandler XML_SetStartNamespcDeclHandler -#define XML_SetExternalEntityRefHandlerArg XML_SetExternalEntRefHandlerArg -#endif - -#include - -#ifndef XMLPARSEAPI -#define XMLPARSEAPI(type) type -#endif /* not defined XMLPARSEAPI */ - -#ifdef __cplusplus -extern "C" { -#endif - -#ifdef XML_UNICODE_WCHAR_T -#define XML_UNICODE -#endif - -struct XML_ParserStruct; -typedef struct XML_ParserStruct *XML_Parser; - -#ifdef XML_UNICODE /* Information is UTF-16 encoded. */ -#ifdef XML_UNICODE_WCHAR_T -typedef wchar_t XML_Char; -typedef wchar_t XML_LChar; -#else -typedef unsigned short XML_Char; -typedef char XML_LChar; -#endif /* XML_UNICODE_WCHAR_T */ -#else /* Information is UTF-8 encoded. */ -typedef char XML_Char; -typedef char XML_LChar; -#endif /* XML_UNICODE */ - -/* Should this be defined using stdbool.h when C99 is available? */ -typedef unsigned char XML_Bool; -#define XML_TRUE ((XML_Bool) 1) -#define XML_FALSE ((XML_Bool) 0) - -enum XML_Error { - XML_ERROR_NONE, - XML_ERROR_NO_MEMORY, - XML_ERROR_SYNTAX, - XML_ERROR_NO_ELEMENTS, - XML_ERROR_INVALID_TOKEN, - XML_ERROR_UNCLOSED_TOKEN, - XML_ERROR_PARTIAL_CHAR, - XML_ERROR_TAG_MISMATCH, - XML_ERROR_DUPLICATE_ATTRIBUTE, - XML_ERROR_JUNK_AFTER_DOC_ELEMENT, - XML_ERROR_PARAM_ENTITY_REF, - XML_ERROR_UNDEFINED_ENTITY, - XML_ERROR_RECURSIVE_ENTITY_REF, - XML_ERROR_ASYNC_ENTITY, - XML_ERROR_BAD_CHAR_REF, - XML_ERROR_BINARY_ENTITY_REF, - XML_ERROR_ATTRIBUTE_EXTERNAL_ENTITY_REF, - XML_ERROR_MISPLACED_XML_PI, - XML_ERROR_UNKNOWN_ENCODING, - XML_ERROR_INCORRECT_ENCODING, - XML_ERROR_UNCLOSED_CDATA_SECTION, - XML_ERROR_EXTERNAL_ENTITY_HANDLING, - XML_ERROR_NOT_STANDALONE, - XML_ERROR_UNEXPECTED_STATE, - XML_ERROR_ENTITY_DECLARED_IN_PE, - XML_ERROR_FEATURE_REQUIRES_XML_DTD, - XML_ERROR_CANT_CHANGE_FEATURE_ONCE_PARSING -}; - -enum XML_Content_Type { - XML_CTYPE_EMPTY = 1, - XML_CTYPE_ANY, - XML_CTYPE_MIXED, - XML_CTYPE_NAME, - XML_CTYPE_CHOICE, - XML_CTYPE_SEQ -}; - -enum XML_Content_Quant { - XML_CQUANT_NONE, - XML_CQUANT_OPT, - XML_CQUANT_REP, - XML_CQUANT_PLUS -}; - -/* Parses some input. Returns XML_STATUS_ERROR if a fatal error is - detected. The last call to XML_Parse must have isFinal true; len - may be zero for this call (or any other). - - The XML_Status enum gives the possible return values for the - XML_Parse and XML_ParseBuffer functions. Though the return values - for these functions has always been described as a Boolean value, - the implementation, at least for the 1.95.x series, has always - returned exactly one of these values. The preprocessor #defines - are included so this stanza can be added to code that still needs - to support older versions of Expat 1.95.x: - - #ifndef XML_STATUS_OK - #define XML_STATUS_OK 1 - #define XML_STATUS_ERROR 0 - #endif - - Otherwise, the #define hackery is quite ugly and would have been dropped. -*/ -enum XML_Status { - XML_STATUS_ERROR = 0, -#define XML_STATUS_ERROR XML_STATUS_ERROR - XML_STATUS_OK = 1 -#define XML_STATUS_OK XML_STATUS_OK -}; - -/* If type == XML_CTYPE_EMPTY or XML_CTYPE_ANY, then quant will be - XML_CQUANT_NONE, and the other fields will be zero or NULL. - If type == XML_CTYPE_MIXED, then quant will be NONE or REP and - numchildren will contain number of elements that may be mixed in - and children point to an array of XML_Content cells that will be - all of XML_CTYPE_NAME type with no quantification. - - If type == XML_CTYPE_NAME, then the name points to the name, and - the numchildren field will be zero and children will be NULL. The - quant fields indicates any quantifiers placed on the name. - - CHOICE and SEQ will have name NULL, the number of children in - numchildren and children will point, recursively, to an array - of XML_Content cells. - - The EMPTY, ANY, and MIXED types will only occur at top level. -*/ - -typedef struct XML_cp XML_Content; - -struct XML_cp { - enum XML_Content_Type type; - enum XML_Content_Quant quant; - XML_Char * name; - unsigned int numchildren; - XML_Content * children; -}; - - -/* This is called for an element declaration. See above for - description of the model argument. It's the caller's responsibility - to free model when finished with it. -*/ -typedef void (*XML_ElementDeclHandler) (void *userData, - const XML_Char *name, - XML_Content *model); - -XMLPARSEAPI(void) -XML_SetElementDeclHandler(XML_Parser parser, - XML_ElementDeclHandler eldecl); - -/* The Attlist declaration handler is called for *each* attribute. So - a single Attlist declaration with multiple attributes declared will - generate multiple calls to this handler. The "default" parameter - may be NULL in the case of the "#IMPLIED" or "#REQUIRED" - keyword. The "isrequired" parameter will be true and the default - value will be NULL in the case of "#REQUIRED". If "isrequired" is - true and default is non-NULL, then this is a "#FIXED" default. -*/ -typedef void (*XML_AttlistDeclHandler) (void *userData, - const XML_Char *elname, - const XML_Char *attname, - const XML_Char *att_type, - const XML_Char *dflt, - int isrequired); - -XMLPARSEAPI(void) -XML_SetAttlistDeclHandler(XML_Parser parser, - XML_AttlistDeclHandler attdecl); - -/* The XML declaration handler is called for *both* XML declarations - and text declarations. The way to distinguish is that the version - parameter will be NULL for text declarations. The encoding - parameter may be NULL for XML declarations. The standalone - parameter will be -1, 0, or 1 indicating respectively that there - was no standalone parameter in the declaration, that it was given - as no, or that it was given as yes. -*/ -typedef void (*XML_XmlDeclHandler) (void *userData, - const XML_Char *version, - const XML_Char *encoding, - int standalone); - -XMLPARSEAPI(void) -XML_SetXmlDeclHandler(XML_Parser parser, - XML_XmlDeclHandler xmldecl); - - -typedef struct { - void *(*malloc_fcn)(size_t size); - void *(*realloc_fcn)(void *ptr, size_t size); - void (*free_fcn)(void *ptr); -} XML_Memory_Handling_Suite; - -/* Constructs a new parser; encoding is the encoding specified by the - external protocol or NULL if there is none specified. -*/ -XMLPARSEAPI(XML_Parser) -XML_ParserCreate(const XML_Char *encoding); - -/* Constructs a new parser and namespace processor. Element type - names and attribute names that belong to a namespace will be - expanded; unprefixed attribute names are never expanded; unprefixed - element type names are expanded only if there is a default - namespace. The expanded name is the concatenation of the namespace - URI, the namespace separator character, and the local part of the - name. If the namespace separator is '\0' then the namespace URI - and the local part will be concatenated without any separator. - When a namespace is not declared, the name and prefix will be - passed through without expansion. -*/ -XMLPARSEAPI(XML_Parser) -XML_ParserCreateNS(const XML_Char *encoding, XML_Char namespaceSeparator); - - -/* Constructs a new parser using the memory management suite referred to - by memsuite. If memsuite is NULL, then use the standard library memory - suite. If namespaceSeparator is non-NULL it creates a parser with - namespace processing as described above. The character pointed at - will serve as the namespace separator. - - All further memory operations used for the created parser will come from - the given suite. -*/ -XMLPARSEAPI(XML_Parser) -XML_ParserCreate_MM(const XML_Char *encoding, - const XML_Memory_Handling_Suite *memsuite, - const XML_Char *namespaceSeparator); - -/* Prepare a parser object to be re-used. This is particularly - valuable when memory allocation overhead is disproportionatly high, - such as when a large number of small documnents need to be parsed. - All handlers are cleared from the parser, except for the - unknownEncodingHandler. The parser's external state is re-initialized - except for the values of ns and ns_triplets. - - Added in Expat 1.95.3. -*/ -XMLPARSEAPI(XML_Bool) -XML_ParserReset(XML_Parser parser, const XML_Char *encoding); - -/* atts is array of name/value pairs, terminated by 0; - names and values are 0 terminated. -*/ -typedef void (*XML_StartElementHandler)(void *userData, - const XML_Char *name, - const XML_Char **atts); - -typedef void (*XML_EndElementHandler)(void *userData, - const XML_Char *name); - - -/* s is not 0 terminated. */ -typedef void (*XML_CharacterDataHandler)(void *userData, - const XML_Char *s, - int len); - -/* target and data are 0 terminated */ -typedef void (*XML_ProcessingInstructionHandler)(void *userData, - const XML_Char *target, - const XML_Char *data); - -/* data is 0 terminated */ -typedef void (*XML_CommentHandler)(void *userData, const XML_Char *data); - -typedef void (*XML_StartCdataSectionHandler)(void *userData); -typedef void (*XML_EndCdataSectionHandler)(void *userData); - -/* This is called for any characters in the XML document for which - there is no applicable handler. This includes both characters that - are part of markup which is of a kind that is not reported - (comments, markup declarations), or characters that are part of a - construct which could be reported but for which no handler has been - supplied. The characters are passed exactly as they were in the XML - document except that they will be encoded in UTF-8 or UTF-16. - Line boundaries are not normalized. Note that a byte order mark - character is not passed to the default handler. There are no - guarantees about how characters are divided between calls to the - default handler: for example, a comment might be split between - multiple calls. -*/ -typedef void (*XML_DefaultHandler)(void *userData, - const XML_Char *s, - int len); - -/* This is called for the start of the DOCTYPE declaration, before - any DTD or internal subset is parsed. -*/ -typedef void (*XML_StartDoctypeDeclHandler)(void *userData, - const XML_Char *doctypeName, - const XML_Char *sysid, - const XML_Char *pubid, - int has_internal_subset); - -/* This is called for the start of the DOCTYPE declaration when the - closing > is encountered, but after processing any external - subset. -*/ -typedef void (*XML_EndDoctypeDeclHandler)(void *userData); - -/* This is called for entity declarations. The is_parameter_entity - argument will be non-zero if the entity is a parameter entity, zero - otherwise. - - For internal entities (), value will - be non-NULL and systemId, publicID, and notationName will be NULL. - The value string is NOT nul-terminated; the length is provided in - the value_length argument. Since it is legal to have zero-length - values, do not use this argument to test for internal entities. - - For external entities, value will be NULL and systemId will be - non-NULL. The publicId argument will be NULL unless a public - identifier was provided. The notationName argument will have a - non-NULL value only for unparsed entity declarations. - - Note that is_parameter_entity can't be changed to XML_Bool, since - that would break binary compatibility. -*/ -typedef void (*XML_EntityDeclHandler) (void *userData, - const XML_Char *entityName, - int is_parameter_entity, - const XML_Char *value, - int value_length, - const XML_Char *base, - const XML_Char *systemId, - const XML_Char *publicId, - const XML_Char *notationName); - -XMLPARSEAPI(void) -XML_SetEntityDeclHandler(XML_Parser parser, - XML_EntityDeclHandler handler); - -/* OBSOLETE -- OBSOLETE -- OBSOLETE - This handler has been superceded by the EntityDeclHandler above. - It is provided here for backward compatibility. - - This is called for a declaration of an unparsed (NDATA) entity. - The base argument is whatever was set by XML_SetBase. The - entityName, systemId and notationName arguments will never be - NULL. The other arguments may be. -*/ -typedef void (*XML_UnparsedEntityDeclHandler)(void *userData, - const XML_Char *entityName, - const XML_Char *base, - const XML_Char *systemId, - const XML_Char *publicId, - const XML_Char *notationName); - -/* This is called for a declaration of notation. The base argument is - whatever was set by XML_SetBase. The notationName will never be - NULL. The other arguments can be. -*/ -typedef void (*XML_NotationDeclHandler)(void *userData, - const XML_Char *notationName, - const XML_Char *base, - const XML_Char *systemId, - const XML_Char *publicId); - -/* When namespace processing is enabled, these are called once for - each namespace declaration. The call to the start and end element - handlers occur between the calls to the start and end namespace - declaration handlers. For an xmlns attribute, prefix will be - NULL. For an xmlns="" attribute, uri will be NULL. -*/ -typedef void (*XML_StartNamespaceDeclHandler)(void *userData, - const XML_Char *prefix, - const XML_Char *uri); - -typedef void (*XML_EndNamespaceDeclHandler)(void *userData, - const XML_Char *prefix); - -/* This is called if the document is not standalone, that is, it has an - external subset or a reference to a parameter entity, but does not - have standalone="yes". If this handler returns XML_STATUS_ERROR, - then processing will not continue, and the parser will return a - XML_ERROR_NOT_STANDALONE error. - If parameter entity parsing is enabled, then in addition to the - conditions above this handler will only be called if the referenced - entity was actually read. -*/ -typedef int (*XML_NotStandaloneHandler)(void *userData); - -/* This is called for a reference to an external parsed general - entity. The referenced entity is not automatically parsed. The - application can parse it immediately or later using - XML_ExternalEntityParserCreate. - - The parser argument is the parser parsing the entity containing the - reference; it can be passed as the parser argument to - XML_ExternalEntityParserCreate. The systemId argument is the - system identifier as specified in the entity declaration; it will - not be NULL. - - The base argument is the system identifier that should be used as - the base for resolving systemId if systemId was relative; this is - set by XML_SetBase; it may be NULL. - - The publicId argument is the public identifier as specified in the - entity declaration, or NULL if none was specified; the whitespace - in the public identifier will have been normalized as required by - the XML spec. - - The context argument specifies the parsing context in the format - expected by the context argument to XML_ExternalEntityParserCreate; - context is valid only until the handler returns, so if the - referenced entity is to be parsed later, it must be copied. - context is NULL only when the entity is a parameter entity. - - The handler should return XML_STATUS_ERROR if processing should not - continue because of a fatal error in the handling of the external - entity. In this case the calling parser will return an - XML_ERROR_EXTERNAL_ENTITY_HANDLING error. - - Note that unlike other handlers the first argument is the parser, - not userData. -*/ -typedef int (*XML_ExternalEntityRefHandler)(XML_Parser parser, - const XML_Char *context, - const XML_Char *base, - const XML_Char *systemId, - const XML_Char *publicId); - -/* This is called in two situations: - 1) An entity reference is encountered for which no declaration - has been read *and* this is not an error. - 2) An internal entity reference is read, but not expanded, because - XML_SetDefaultHandler has been called. - Note: skipped parameter entities in declarations and skipped general - entities in attribute values cannot be reported, because - the event would be out of sync with the reporting of the - declarations or attribute values -*/ -typedef void (*XML_SkippedEntityHandler)(void *userData, - const XML_Char *entityName, - int is_parameter_entity); - -/* This structure is filled in by the XML_UnknownEncodingHandler to - provide information to the parser about encodings that are unknown - to the parser. - - The map[b] member gives information about byte sequences whose - first byte is b. - - If map[b] is c where c is >= 0, then b by itself encodes the - Unicode scalar value c. - - If map[b] is -1, then the byte sequence is malformed. - - If map[b] is -n, where n >= 2, then b is the first byte of an - n-byte sequence that encodes a single Unicode scalar value. - - The data member will be passed as the first argument to the convert - function. - - The convert function is used to convert multibyte sequences; s will - point to a n-byte sequence where map[(unsigned char)*s] == -n. The - convert function must return the Unicode scalar value represented - by this byte sequence or -1 if the byte sequence is malformed. - - The convert function may be NULL if the encoding is a single-byte - encoding, that is if map[b] >= -1 for all bytes b. - - When the parser is finished with the encoding, then if release is - not NULL, it will call release passing it the data member; once - release has been called, the convert function will not be called - again. - - Expat places certain restrictions on the encodings that are supported - using this mechanism. - - 1. Every ASCII character that can appear in a well-formed XML document, - other than the characters - - $@\^`{}~ - - must be represented by a single byte, and that byte must be the - same byte that represents that character in ASCII. - - 2. No character may require more than 4 bytes to encode. - - 3. All characters encoded must have Unicode scalar values <= - 0xFFFF, (i.e., characters that would be encoded by surrogates in - UTF-16 are not allowed). Note that this restriction doesn't - apply to the built-in support for UTF-8 and UTF-16. - - 4. No Unicode character may be encoded by more than one distinct - sequence of bytes. -*/ -typedef struct { - int map[256]; - void *data; - int (*convert)(void *data, const char *s); - void (*release)(void *data); -} XML_Encoding; - -/* This is called for an encoding that is unknown to the parser. - - The encodingHandlerData argument is that which was passed as the - second argument to XML_SetUnknownEncodingHandler. - - The name argument gives the name of the encoding as specified in - the encoding declaration. - - If the callback can provide information about the encoding, it must - fill in the XML_Encoding structure, and return XML_STATUS_OK. - Otherwise it must return XML_STATUS_ERROR. - - If info does not describe a suitable encoding, then the parser will - return an XML_UNKNOWN_ENCODING error. -*/ -typedef int (*XML_UnknownEncodingHandler)(void *encodingHandlerData, - const XML_Char *name, - XML_Encoding *info); - -XMLPARSEAPI(void) -XML_SetElementHandler(XML_Parser parser, - XML_StartElementHandler start, - XML_EndElementHandler end); - -XMLPARSEAPI(void) -XML_SetStartElementHandler(XML_Parser, XML_StartElementHandler); - -XMLPARSEAPI(void) -XML_SetEndElementHandler(XML_Parser, XML_EndElementHandler); - -XMLPARSEAPI(void) -XML_SetCharacterDataHandler(XML_Parser parser, - XML_CharacterDataHandler handler); - -XMLPARSEAPI(void) -XML_SetProcessingInstructionHandler(XML_Parser parser, - XML_ProcessingInstructionHandler handler); -XMLPARSEAPI(void) -XML_SetCommentHandler(XML_Parser parser, - XML_CommentHandler handler); - -XMLPARSEAPI(void) -XML_SetCdataSectionHandler(XML_Parser parser, - XML_StartCdataSectionHandler start, - XML_EndCdataSectionHandler end); - -XMLPARSEAPI(void) -XML_SetStartCdataSectionHandler(XML_Parser parser, - XML_StartCdataSectionHandler start); - -XMLPARSEAPI(void) -XML_SetEndCdataSectionHandler(XML_Parser parser, - XML_EndCdataSectionHandler end); - -/* This sets the default handler and also inhibits expansion of - internal entities. These entity references will be passed to the - default handler, or to the skipped entity handler, if one is set. -*/ -XMLPARSEAPI(void) -XML_SetDefaultHandler(XML_Parser parser, - XML_DefaultHandler handler); - -/* This sets the default handler but does not inhibit expansion of - internal entities. The entity reference will not be passed to the - default handler. -*/ -XMLPARSEAPI(void) -XML_SetDefaultHandlerExpand(XML_Parser parser, - XML_DefaultHandler handler); - -XMLPARSEAPI(void) -XML_SetDoctypeDeclHandler(XML_Parser parser, - XML_StartDoctypeDeclHandler start, - XML_EndDoctypeDeclHandler end); - -XMLPARSEAPI(void) -XML_SetStartDoctypeDeclHandler(XML_Parser parser, - XML_StartDoctypeDeclHandler start); - -XMLPARSEAPI(void) -XML_SetEndDoctypeDeclHandler(XML_Parser parser, - XML_EndDoctypeDeclHandler end); - -XMLPARSEAPI(void) -XML_SetUnparsedEntityDeclHandler(XML_Parser parser, - XML_UnparsedEntityDeclHandler handler); - -XMLPARSEAPI(void) -XML_SetNotationDeclHandler(XML_Parser parser, - XML_NotationDeclHandler handler); - -XMLPARSEAPI(void) -XML_SetNamespaceDeclHandler(XML_Parser parser, - XML_StartNamespaceDeclHandler start, - XML_EndNamespaceDeclHandler end); - -XMLPARSEAPI(void) -XML_SetStartNamespaceDeclHandler(XML_Parser parser, - XML_StartNamespaceDeclHandler start); - -XMLPARSEAPI(void) -XML_SetEndNamespaceDeclHandler(XML_Parser parser, - XML_EndNamespaceDeclHandler end); - -XMLPARSEAPI(void) -XML_SetNotStandaloneHandler(XML_Parser parser, - XML_NotStandaloneHandler handler); - -XMLPARSEAPI(void) -XML_SetExternalEntityRefHandler(XML_Parser parser, - XML_ExternalEntityRefHandler handler); - -/* If a non-NULL value for arg is specified here, then it will be - passed as the first argument to the external entity ref handler - instead of the parser object. -*/ -XMLPARSEAPI(void) -XML_SetExternalEntityRefHandlerArg(XML_Parser, void *arg); - -XMLPARSEAPI(void) -XML_SetSkippedEntityHandler(XML_Parser parser, - XML_SkippedEntityHandler handler); - -XMLPARSEAPI(void) -XML_SetUnknownEncodingHandler(XML_Parser parser, - XML_UnknownEncodingHandler handler, - void *encodingHandlerData); - -/* This can be called within a handler for a start element, end - element, processing instruction or character data. It causes the - corresponding markup to be passed to the default handler. -*/ -XMLPARSEAPI(void) -XML_DefaultCurrent(XML_Parser parser); - -/* If do_nst is non-zero, and namespace processing is in effect, and - a name has a prefix (i.e. an explicit namespace qualifier) then - that name is returned as a triplet in a single string separated by - the separator character specified when the parser was created: URI - + sep + local_name + sep + prefix. - - If do_nst is zero, then namespace information is returned in the - default manner (URI + sep + local_name) whether or not the name - has a prefix. - - Note: Calling XML_SetReturnNSTriplet after XML_Parse or - XML_ParseBuffer has no effect. -*/ - -XMLPARSEAPI(void) -XML_SetReturnNSTriplet(XML_Parser parser, int do_nst); - -/* This value is passed as the userData argument to callbacks. */ -XMLPARSEAPI(void) -XML_SetUserData(XML_Parser parser, void *userData); - -/* Returns the last value set by XML_SetUserData or NULL. */ -#define XML_GetUserData(parser) (*(void **)(parser)) - -/* This is equivalent to supplying an encoding argument to - XML_ParserCreate. On success XML_SetEncoding returns non-zero, - zero otherwise. - Note: Calling XML_SetEncoding after XML_Parse or XML_ParseBuffer - has no effect and returns XML_STATUS_ERROR. -*/ -XMLPARSEAPI(enum XML_Status) -XML_SetEncoding(XML_Parser parser, const XML_Char *encoding); - -/* If this function is called, then the parser will be passed as the - first argument to callbacks instead of userData. The userData will - still be accessible using XML_GetUserData. -*/ -XMLPARSEAPI(void) -XML_UseParserAsHandlerArg(XML_Parser parser); - -/* If useDTD == XML_TRUE is passed to this function, then the parser - will assume that there is an external subset, even if none is - specified in the document. In such a case the parser will call the - externalEntityRefHandler with a value of NULL for the systemId - argument (the publicId and context arguments will be NULL as well). - Note: If this function is called, then this must be done before - the first call to XML_Parse or XML_ParseBuffer, since it will - have no effect after that. Returns - XML_ERROR_CANT_CHANGE_FEATURE_ONCE_PARSING. - Note: If the document does not have a DOCTYPE declaration at all, - then startDoctypeDeclHandler and endDoctypeDeclHandler will not - be called, despite an external subset being parsed. - Note: If XML_DTD is not defined when Expat is compiled, returns - XML_ERROR_FEATURE_REQUIRES_XML_DTD. -*/ -XMLPARSEAPI(enum XML_Error) -XML_UseForeignDTD(XML_Parser parser, XML_Bool useDTD); - - -/* Sets the base to be used for resolving relative URIs in system - identifiers in declarations. Resolving relative identifiers is - left to the application: this value will be passed through as the - base argument to the XML_ExternalEntityRefHandler, - XML_NotationDeclHandler and XML_UnparsedEntityDeclHandler. The base - argument will be copied. Returns XML_STATUS_ERROR if out of memory, - XML_STATUS_OK otherwise. -*/ -XMLPARSEAPI(enum XML_Status) -XML_SetBase(XML_Parser parser, const XML_Char *base); - -XMLPARSEAPI(const XML_Char *) -XML_GetBase(XML_Parser parser); - -/* Returns the number of the attribute/value pairs passed in last call - to the XML_StartElementHandler that were specified in the start-tag - rather than defaulted. Each attribute/value pair counts as 2; thus - this correspondds to an index into the atts array passed to the - XML_StartElementHandler. -*/ -XMLPARSEAPI(int) -XML_GetSpecifiedAttributeCount(XML_Parser parser); - -/* Returns the index of the ID attribute passed in the last call to - XML_StartElementHandler, or -1 if there is no ID attribute. Each - attribute/value pair counts as 2; thus this correspondds to an - index into the atts array passed to the XML_StartElementHandler. -*/ -XMLPARSEAPI(int) -XML_GetIdAttributeIndex(XML_Parser parser); - -XMLPARSEAPI(enum XML_Status) -XML_Parse(XML_Parser parser, const char *s, int len, int isFinal); - -XMLPARSEAPI(void *) -XML_GetBuffer(XML_Parser parser, int len); - -XMLPARSEAPI(enum XML_Status) -XML_ParseBuffer(XML_Parser parser, int len, int isFinal); - -/* Creates an XML_Parser object that can parse an external general - entity; context is a '\0'-terminated string specifying the parse - context; encoding is a '\0'-terminated string giving the name of - the externally specified encoding, or NULL if there is no - externally specified encoding. The context string consists of a - sequence of tokens separated by formfeeds (\f); a token consisting - of a name specifies that the general entity of the name is open; a - token of the form prefix=uri specifies the namespace for a - particular prefix; a token of the form =uri specifies the default - namespace. This can be called at any point after the first call to - an ExternalEntityRefHandler so longer as the parser has not yet - been freed. The new parser is completely independent and may - safely be used in a separate thread. The handlers and userData are - initialized from the parser argument. Returns NULL if out of memory. - Otherwise returns a new XML_Parser object. -*/ -XMLPARSEAPI(XML_Parser) -XML_ExternalEntityParserCreate(XML_Parser parser, - const XML_Char *context, - const XML_Char *encoding); - -enum XML_ParamEntityParsing { - XML_PARAM_ENTITY_PARSING_NEVER, - XML_PARAM_ENTITY_PARSING_UNLESS_STANDALONE, - XML_PARAM_ENTITY_PARSING_ALWAYS -}; - -/* Controls parsing of parameter entities (including the external DTD - subset). If parsing of parameter entities is enabled, then - references to external parameter entities (including the external - DTD subset) will be passed to the handler set with - XML_SetExternalEntityRefHandler. The context passed will be 0. - - Unlike external general entities, external parameter entities can - only be parsed synchronously. If the external parameter entity is - to be parsed, it must be parsed during the call to the external - entity ref handler: the complete sequence of - XML_ExternalEntityParserCreate, XML_Parse/XML_ParseBuffer and - XML_ParserFree calls must be made during this call. After - XML_ExternalEntityParserCreate has been called to create the parser - for the external parameter entity (context must be 0 for this - call), it is illegal to make any calls on the old parser until - XML_ParserFree has been called on the newly created parser. - If the library has been compiled without support for parameter - entity parsing (ie without XML_DTD being defined), then - XML_SetParamEntityParsing will return 0 if parsing of parameter - entities is requested; otherwise it will return non-zero. - Note: If XML_SetParamEntityParsing is called after XML_Parse or - XML_ParseBuffer, then it has no effect and will always return 0. -*/ -XMLPARSEAPI(int) -XML_SetParamEntityParsing(XML_Parser parser, - enum XML_ParamEntityParsing parsing); - -/* If XML_Parse or XML_ParseBuffer have returned XML_STATUS_ERROR, then - XML_GetErrorCode returns information about the error. -*/ -XMLPARSEAPI(enum XML_Error) -XML_GetErrorCode(XML_Parser parser); - -/* These functions return information about the current parse - location. They may be called from any callback called to report - some parse event; in this case the location is the location of - the first of the sequence of characters that generated the event. - - They may also be called after returning from a call to XML_Parse - or XML_ParseBuffer. If the return value is XML_STATUS_ERROR then - the location is the location of the character at which the error - was detected; otherwise the location is the location of the last - parse event, as described above. -*/ -XMLPARSEAPI(int) XML_GetCurrentLineNumber(XML_Parser parser); -XMLPARSEAPI(int) XML_GetCurrentColumnNumber(XML_Parser parser); -XMLPARSEAPI(long) XML_GetCurrentByteIndex(XML_Parser parser); - -/* Return the number of bytes in the current event. - Returns 0 if the event is in an internal entity. -*/ -XMLPARSEAPI(int) -XML_GetCurrentByteCount(XML_Parser parser); - -/* If XML_CONTEXT_BYTES is defined, returns the input buffer, sets - the integer pointed to by offset to the offset within this buffer - of the current parse position, and sets the integer pointed to by size - to the size of this buffer (the number of input bytes). Otherwise - returns a NULL pointer. Also returns a NULL pointer if a parse isn't - active. - - NOTE: The character pointer returned should not be used outside - the handler that makes the call. -*/ -XMLPARSEAPI(const char *) -XML_GetInputContext(XML_Parser parser, - int *offset, - int *size); - -/* For backwards compatibility with previous versions. */ -#define XML_GetErrorLineNumber XML_GetCurrentLineNumber -#define XML_GetErrorColumnNumber XML_GetCurrentColumnNumber -#define XML_GetErrorByteIndex XML_GetCurrentByteIndex - -/* Frees the content model passed to the element declaration handler */ -XMLPARSEAPI(void) -XML_FreeContentModel(XML_Parser parser, XML_Content *model); - -/* Exposing the memory handling functions used in Expat */ -XMLPARSEAPI(void *) -XML_MemMalloc(XML_Parser parser, size_t size); - -XMLPARSEAPI(void *) -XML_MemRealloc(XML_Parser parser, void *ptr, size_t size); - -XMLPARSEAPI(void) -XML_MemFree(XML_Parser parser, void *ptr); - -/* Frees memory used by the parser. */ -XMLPARSEAPI(void) -XML_ParserFree(XML_Parser parser); - -/* Returns a string describing the error. */ -XMLPARSEAPI(const XML_LChar *) -XML_ErrorString(enum XML_Error code); - -/* Return a string containing the version number of this expat */ -XMLPARSEAPI(const XML_LChar *) -XML_ExpatVersion(void); - -typedef struct { - int major; - int minor; - int micro; -} XML_Expat_Version; - -/* Return an XML_Expat_Version structure containing numeric version - number information for this version of expat. -*/ -XMLPARSEAPI(XML_Expat_Version) -XML_ExpatVersionInfo(void); - -/* Added in Expat 1.95.5. */ -enum XML_FeatureEnum { - XML_FEATURE_END = 0, - XML_FEATURE_UNICODE, - XML_FEATURE_UNICODE_WCHAR_T, - XML_FEATURE_DTD, - XML_FEATURE_CONTEXT_BYTES, - XML_FEATURE_MIN_SIZE, - XML_FEATURE_SIZEOF_XML_CHAR, - XML_FEATURE_SIZEOF_XML_LCHAR - /* Additional features must be added to the end of this enum. */ -}; - -typedef struct { - enum XML_FeatureEnum feature; - const XML_LChar *name; - long int value; -} XML_Feature; - -XMLPARSEAPI(const XML_Feature *) -XML_GetFeatureList(void); - - -/* Expat follows the GNU/Linux convention of odd number minor version for - beta/development releases and even number minor version for stable - releases. Micro is bumped with each release, and set to 0 with each - change to major or minor version. -*/ -#define XML_MAJOR_VERSION 1 -#define XML_MINOR_VERSION 95 -#define XML_MICRO_VERSION 6 - -#ifdef __cplusplus -} -#endif - -#endif /* not XmlParse_INCLUDED */ diff --git a/wxWidgets/src/expat/lib/iasciitab.h b/wxWidgets/src/expat/lib/iasciitab.h deleted file mode 100644 index 24a1d5ccc9..0000000000 --- a/wxWidgets/src/expat/lib/iasciitab.h +++ /dev/null @@ -1,37 +0,0 @@ -/* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd - See the file COPYING for copying permission. -*/ - -/* Like asciitab.h, except that 0xD has code BT_S rather than BT_CR */ -/* 0x00 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, -/* 0x04 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, -/* 0x08 */ BT_NONXML, BT_S, BT_LF, BT_NONXML, -/* 0x0C */ BT_NONXML, BT_S, BT_NONXML, BT_NONXML, -/* 0x10 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, -/* 0x14 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, -/* 0x18 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, -/* 0x1C */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, -/* 0x20 */ BT_S, BT_EXCL, BT_QUOT, BT_NUM, -/* 0x24 */ BT_OTHER, BT_PERCNT, BT_AMP, BT_APOS, -/* 0x28 */ BT_LPAR, BT_RPAR, BT_AST, BT_PLUS, -/* 0x2C */ BT_COMMA, BT_MINUS, BT_NAME, BT_SOL, -/* 0x30 */ BT_DIGIT, BT_DIGIT, BT_DIGIT, BT_DIGIT, -/* 0x34 */ BT_DIGIT, BT_DIGIT, BT_DIGIT, BT_DIGIT, -/* 0x38 */ BT_DIGIT, BT_DIGIT, BT_COLON, BT_SEMI, -/* 0x3C */ BT_LT, BT_EQUALS, BT_GT, BT_QUEST, -/* 0x40 */ BT_OTHER, BT_HEX, BT_HEX, BT_HEX, -/* 0x44 */ BT_HEX, BT_HEX, BT_HEX, BT_NMSTRT, -/* 0x48 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, -/* 0x4C */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, -/* 0x50 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, -/* 0x54 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, -/* 0x58 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_LSQB, -/* 0x5C */ BT_OTHER, BT_RSQB, BT_OTHER, BT_NMSTRT, -/* 0x60 */ BT_OTHER, BT_HEX, BT_HEX, BT_HEX, -/* 0x64 */ BT_HEX, BT_HEX, BT_HEX, BT_NMSTRT, -/* 0x68 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, -/* 0x6C */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, -/* 0x70 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, -/* 0x74 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, -/* 0x78 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_OTHER, -/* 0x7C */ BT_VERBAR, BT_OTHER, BT_OTHER, BT_OTHER, diff --git a/wxWidgets/src/expat/lib/internal.h b/wxWidgets/src/expat/lib/internal.h deleted file mode 100644 index edcc7afce1..0000000000 --- a/wxWidgets/src/expat/lib/internal.h +++ /dev/null @@ -1,77 +0,0 @@ -/* internal.h - - Internal definitions used by Expat. This is not needed to compile - client code. - - The following calling convention macros are defined for frequently - called functions: - - FASTCALL - Used for those internal functions that have a simple - body and a low number of arguments and local variables. - - PTRCALL - Used for functions called though function pointers. - - PTRFASTCALL - Like PTRCALL, but for low number of arguments. - - inline - Used for selected internal functions for which inlining - may improve performance on some platforms. - - Note: Use of these macros is based on judgement, not hard rules, - and therefore subject to change. -*/ - -#ifdef FASTCALL -#undef FASTCALL -#endif - -#if defined(__GNUC__) && defined(__i386__) -/* Instability reported with egcs on a RedHat Linux 7.3. - Let's comment it out: - #define FASTCALL __attribute__((stdcall, regparm(3))) - and let's try this: -*/ -#define FASTCALL __attribute__((regparm(3))) -#define PTRCALL -#define PTRFASTCALL __attribute__((regparm(3))) - -#elif defined(WIN32) -/* Using __fastcall seems to have an unexpected negative effect under - MS VC++, especially for function pointers, so we won't use it for - now on that platform. It may be reconsidered for a future release - if it can be made more effective. - Likely reason: __fastcall on Windows is like stdcall, therefore - the compiler cannot perform stack optimizations for call clusters. -*/ -#define FASTCALL -#define PTRCALL -#define PTRFASTCALL - -#endif - -#ifndef FASTCALL -#define FASTCALL -#endif - -#ifndef PTRCALL -#define PTRCALL -#endif - -#ifndef PTRFASTCALL -#define PTRFASTCALL -#endif - -#ifndef XML_MIN_SIZE -#if !defined(__cplusplus) && !defined(inline) -#ifdef __GNUC__ -#define inline __inline -#endif /* __GNUC__ */ -#endif -#endif /* XML_MIN_SIZE */ - -#ifdef __cplusplus -#define inline inline -#else -#ifndef inline -#define inline -#endif -#endif diff --git a/wxWidgets/src/expat/lib/latin1tab.h b/wxWidgets/src/expat/lib/latin1tab.h deleted file mode 100644 index 53c25d76b2..0000000000 --- a/wxWidgets/src/expat/lib/latin1tab.h +++ /dev/null @@ -1,36 +0,0 @@ -/* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd - See the file COPYING for copying permission. -*/ - -/* 0x80 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, -/* 0x84 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, -/* 0x88 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, -/* 0x8C */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, -/* 0x90 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, -/* 0x94 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, -/* 0x98 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, -/* 0x9C */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, -/* 0xA0 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, -/* 0xA4 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, -/* 0xA8 */ BT_OTHER, BT_OTHER, BT_NMSTRT, BT_OTHER, -/* 0xAC */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, -/* 0xB0 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, -/* 0xB4 */ BT_OTHER, BT_NMSTRT, BT_OTHER, BT_NAME, -/* 0xB8 */ BT_OTHER, BT_OTHER, BT_NMSTRT, BT_OTHER, -/* 0xBC */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, -/* 0xC0 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, -/* 0xC4 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, -/* 0xC8 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, -/* 0xCC */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, -/* 0xD0 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, -/* 0xD4 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_OTHER, -/* 0xD8 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, -/* 0xDC */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, -/* 0xE0 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, -/* 0xE4 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, -/* 0xE8 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, -/* 0xEC */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, -/* 0xF0 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, -/* 0xF4 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_OTHER, -/* 0xF8 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, -/* 0xFC */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, diff --git a/wxWidgets/src/expat/lib/macconfig.h b/wxWidgets/src/expat/lib/macconfig.h deleted file mode 100644 index 3c5eb541a1..0000000000 --- a/wxWidgets/src/expat/lib/macconfig.h +++ /dev/null @@ -1,104 +0,0 @@ -/*================================================================ -** Copyright 2000, Clark Cooper -** All rights reserved. -** -** This is free software. You are permitted to copy, distribute, or modify -** it under the terms of the MIT/X license (contained in the COPYING file -** with this distribution.) -** -*/ - -#ifndef MACCONFIG_H -#define MACCONFIG_H - - -/* 1234 = LIL_ENDIAN, 4321 = BIGENDIAN */ -#define BYTEORDER 4321 - -/* Define to 1 if you have the `bcopy' function. */ -#undef HAVE_BCOPY - -/* Define to 1 if you have the header file. */ -#undef HAVE_DLFCN_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_FCNTL_H - -/* Define to 1 if you have the `getpagesize' function. */ -#undef HAVE_GETPAGESIZE - -/* Define to 1 if you have the header file. */ -#undef HAVE_INTTYPES_H - -/* Define to 1 if you have the `memmove' function. */ -#define HAVE_MEMMOVE - -/* Define to 1 if you have the header file. */ -#undef HAVE_MEMORY_H - -/* Define to 1 if you have a working `mmap' system call. */ -#undef HAVE_MMAP - -/* Define to 1 if you have the header file. */ -#undef HAVE_STDINT_H - -/* Define to 1 if you have the header file. */ -#define HAVE_STDLIB_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_STRINGS_H - -/* Define to 1 if you have the header file. */ -#define HAVE_STRING_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_STAT_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_TYPES_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_UNISTD_H - -/* Define to the address where bug reports for this package should be sent. */ -#undef PACKAGE_BUGREPORT - -/* Define to the full name of this package. */ -#undef PACKAGE_NAME - -/* Define to the full name and version of this package. */ -#undef PACKAGE_STRING - -/* Define to the one symbol short name of this package. */ -#undef PACKAGE_TARNAME - -/* Define to the version of this package. */ -#undef PACKAGE_VERSION - -/* Define to 1 if you have the ANSI C header files. */ -#define STDC_HEADERS - -/* whether byteorder is bigendian */ -#define WORDS_BIGENDIAN - -/* Define to specify how much context to retain around the current parse - point. */ -#undef XML_CONTEXT_BYTES - -/* Define to make parameter entity parsing functionality available. */ -#define XML_DTD - -/* Define to make XML Namespaces functionality available. */ -#define XML_NS - -/* Define to empty if `const' does not conform to ANSI C. */ -#undef const - -/* Define to `long' if does not define. */ -#define off_t long - -/* Define to `unsigned' if does not define. */ -#undef size_t - - -#endif /* ifndef MACCONFIG_H */ diff --git a/wxWidgets/src/expat/lib/nametab.h b/wxWidgets/src/expat/lib/nametab.h deleted file mode 100644 index b05e62c77a..0000000000 --- a/wxWidgets/src/expat/lib/nametab.h +++ /dev/null @@ -1,150 +0,0 @@ -static const unsigned namingBitmap[] = { -0x00000000, 0x00000000, 0x00000000, 0x00000000, -0x00000000, 0x00000000, 0x00000000, 0x00000000, -0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, -0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, -0x00000000, 0x04000000, 0x87FFFFFE, 0x07FFFFFE, -0x00000000, 0x00000000, 0xFF7FFFFF, 0xFF7FFFFF, -0xFFFFFFFF, 0x7FF3FFFF, 0xFFFFFDFE, 0x7FFFFFFF, -0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFE00F, 0xFC31FFFF, -0x00FFFFFF, 0x00000000, 0xFFFF0000, 0xFFFFFFFF, -0xFFFFFFFF, 0xF80001FF, 0x00000003, 0x00000000, -0x00000000, 0x00000000, 0x00000000, 0x00000000, -0xFFFFD740, 0xFFFFFFFB, 0x547F7FFF, 0x000FFFFD, -0xFFFFDFFE, 0xFFFFFFFF, 0xDFFEFFFF, 0xFFFFFFFF, -0xFFFF0003, 0xFFFFFFFF, 0xFFFF199F, 0x033FCFFF, -0x00000000, 0xFFFE0000, 0x027FFFFF, 0xFFFFFFFE, -0x0000007F, 0x00000000, 0xFFFF0000, 0x000707FF, -0x00000000, 0x07FFFFFE, 0x000007FE, 0xFFFE0000, -0xFFFFFFFF, 0x7CFFFFFF, 0x002F7FFF, 0x00000060, -0xFFFFFFE0, 0x23FFFFFF, 0xFF000000, 0x00000003, -0xFFF99FE0, 0x03C5FDFF, 0xB0000000, 0x00030003, -0xFFF987E0, 0x036DFDFF, 0x5E000000, 0x001C0000, -0xFFFBAFE0, 0x23EDFDFF, 0x00000000, 0x00000001, -0xFFF99FE0, 0x23CDFDFF, 0xB0000000, 0x00000003, -0xD63DC7E0, 0x03BFC718, 0x00000000, 0x00000000, -0xFFFDDFE0, 0x03EFFDFF, 0x00000000, 0x00000003, -0xFFFDDFE0, 0x03EFFDFF, 0x40000000, 0x00000003, -0xFFFDDFE0, 0x03FFFDFF, 0x00000000, 0x00000003, -0x00000000, 0x00000000, 0x00000000, 0x00000000, -0xFFFFFFFE, 0x000D7FFF, 0x0000003F, 0x00000000, -0xFEF02596, 0x200D6CAE, 0x0000001F, 0x00000000, -0x00000000, 0x00000000, 0xFFFFFEFF, 0x000003FF, -0x00000000, 0x00000000, 0x00000000, 0x00000000, -0x00000000, 0x00000000, 0x00000000, 0x00000000, -0x00000000, 0xFFFFFFFF, 0xFFFF003F, 0x007FFFFF, -0x0007DAED, 0x50000000, 0x82315001, 0x002C62AB, -0x40000000, 0xF580C900, 0x00000007, 0x02010800, -0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, -0x0FFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0x03FFFFFF, -0x3F3FFFFF, 0xFFFFFFFF, 0xAAFF3F3F, 0x3FFFFFFF, -0xFFFFFFFF, 0x5FDFFFFF, 0x0FCF1FDC, 0x1FDC1FFF, -0x00000000, 0x00004C40, 0x00000000, 0x00000000, -0x00000007, 0x00000000, 0x00000000, 0x00000000, -0x00000080, 0x000003FE, 0xFFFFFFFE, 0xFFFFFFFF, -0x001FFFFF, 0xFFFFFFFE, 0xFFFFFFFF, 0x07FFFFFF, -0xFFFFFFE0, 0x00001FFF, 0x00000000, 0x00000000, -0x00000000, 0x00000000, 0x00000000, 0x00000000, -0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, -0xFFFFFFFF, 0x0000003F, 0x00000000, 0x00000000, -0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, -0xFFFFFFFF, 0x0000000F, 0x00000000, 0x00000000, -0x00000000, 0x07FF6000, 0x87FFFFFE, 0x07FFFFFE, -0x00000000, 0x00800000, 0xFF7FFFFF, 0xFF7FFFFF, -0x00FFFFFF, 0x00000000, 0xFFFF0000, 0xFFFFFFFF, -0xFFFFFFFF, 0xF80001FF, 0x00030003, 0x00000000, -0xFFFFFFFF, 0xFFFFFFFF, 0x0000003F, 0x00000003, -0xFFFFD7C0, 0xFFFFFFFB, 0x547F7FFF, 0x000FFFFD, -0xFFFFDFFE, 0xFFFFFFFF, 0xDFFEFFFF, 0xFFFFFFFF, -0xFFFF007B, 0xFFFFFFFF, 0xFFFF199F, 0x033FCFFF, -0x00000000, 0xFFFE0000, 0x027FFFFF, 0xFFFFFFFE, -0xFFFE007F, 0xBBFFFFFB, 0xFFFF0016, 0x000707FF, -0x00000000, 0x07FFFFFE, 0x0007FFFF, 0xFFFF03FF, -0xFFFFFFFF, 0x7CFFFFFF, 0xFFEF7FFF, 0x03FF3DFF, -0xFFFFFFEE, 0xF3FFFFFF, 0xFF1E3FFF, 0x0000FFCF, -0xFFF99FEE, 0xD3C5FDFF, 0xB080399F, 0x0003FFCF, -0xFFF987E4, 0xD36DFDFF, 0x5E003987, 0x001FFFC0, -0xFFFBAFEE, 0xF3EDFDFF, 0x00003BBF, 0x0000FFC1, -0xFFF99FEE, 0xF3CDFDFF, 0xB0C0398F, 0x0000FFC3, -0xD63DC7EC, 0xC3BFC718, 0x00803DC7, 0x0000FF80, -0xFFFDDFEE, 0xC3EFFDFF, 0x00603DDF, 0x0000FFC3, -0xFFFDDFEC, 0xC3EFFDFF, 0x40603DDF, 0x0000FFC3, -0xFFFDDFEC, 0xC3FFFDFF, 0x00803DCF, 0x0000FFC3, -0x00000000, 0x00000000, 0x00000000, 0x00000000, -0xFFFFFFFE, 0x07FF7FFF, 0x03FF7FFF, 0x00000000, -0xFEF02596, 0x3BFF6CAE, 0x03FF3F5F, 0x00000000, -0x03000000, 0xC2A003FF, 0xFFFFFEFF, 0xFFFE03FF, -0xFEBF0FDF, 0x02FE3FFF, 0x00000000, 0x00000000, -0x00000000, 0x00000000, 0x00000000, 0x00000000, -0x00000000, 0x00000000, 0x1FFF0000, 0x00000002, -0x000000A0, 0x003EFFFE, 0xFFFFFFFE, 0xFFFFFFFF, -0x661FFFFF, 0xFFFFFFFE, 0xFFFFFFFF, 0x77FFFFFF, -}; -static const unsigned char nmstrtPages[] = { -0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x00, -0x00, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, -0x10, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x12, 0x13, -0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x15, 0x16, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, -0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, -0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, -0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, -0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, -0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, -0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, -0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, -0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, -0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, -0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x17, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, -0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, -0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, -0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, -0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, -0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x18, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -}; -static const unsigned char namePages[] = { -0x19, 0x03, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x00, -0x00, 0x1F, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, -0x10, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x12, 0x13, -0x26, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x27, 0x16, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, -0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, -0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, -0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, -0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, -0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, -0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, -0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, -0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, -0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, -0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x17, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, -0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, -0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, -0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, -0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, -0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x18, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -}; diff --git a/wxWidgets/src/expat/lib/os2config.h b/wxWidgets/src/expat/lib/os2config.h deleted file mode 100644 index ff04d06fc6..0000000000 --- a/wxWidgets/src/expat/lib/os2config.h +++ /dev/null @@ -1,26 +0,0 @@ -/*================================================================ -** Copyright 2000, Clark Cooper -** All rights reserved. -** -** This is free software. You are permitted to copy, distribute, or modify -** it under the terms of the MIT/X license (contained in the COPYING file -** with this distribution.) -*/ - -#ifndef OS2CONFIG_H -#define OS2CONFIG_H - -#include -#include - -#define XML_NS 1 -#define XML_DTD 1 -#define XML_CONTEXT_BYTES 1024 - -/* we will assume all OS2 platforms are little endian */ -#define BYTEORDER 1234 - -/* OS2 has memmove() available. */ -#define HAVE_MEMMOVE - -#endif /* ndef OS2CONFIG_H */ diff --git a/wxWidgets/src/expat/lib/utf8tab.h b/wxWidgets/src/expat/lib/utf8tab.h deleted file mode 100644 index 7bb3e77603..0000000000 --- a/wxWidgets/src/expat/lib/utf8tab.h +++ /dev/null @@ -1,37 +0,0 @@ -/* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd - See the file COPYING for copying permission. -*/ - - -/* 0x80 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, -/* 0x84 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, -/* 0x88 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, -/* 0x8C */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, -/* 0x90 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, -/* 0x94 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, -/* 0x98 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, -/* 0x9C */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, -/* 0xA0 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, -/* 0xA4 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, -/* 0xA8 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, -/* 0xAC */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, -/* 0xB0 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, -/* 0xB4 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, -/* 0xB8 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, -/* 0xBC */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, -/* 0xC0 */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2, -/* 0xC4 */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2, -/* 0xC8 */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2, -/* 0xCC */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2, -/* 0xD0 */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2, -/* 0xD4 */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2, -/* 0xD8 */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2, -/* 0xDC */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2, -/* 0xE0 */ BT_LEAD3, BT_LEAD3, BT_LEAD3, BT_LEAD3, -/* 0xE4 */ BT_LEAD3, BT_LEAD3, BT_LEAD3, BT_LEAD3, -/* 0xE8 */ BT_LEAD3, BT_LEAD3, BT_LEAD3, BT_LEAD3, -/* 0xEC */ BT_LEAD3, BT_LEAD3, BT_LEAD3, BT_LEAD3, -/* 0xF0 */ BT_LEAD4, BT_LEAD4, BT_LEAD4, BT_LEAD4, -/* 0xF4 */ BT_LEAD4, BT_NONXML, BT_NONXML, BT_NONXML, -/* 0xF8 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, -/* 0xFC */ BT_NONXML, BT_NONXML, BT_MALFORM, BT_MALFORM, diff --git a/wxWidgets/src/expat/lib/winconfig.h b/wxWidgets/src/expat/lib/winconfig.h deleted file mode 100644 index c1b791d62d..0000000000 --- a/wxWidgets/src/expat/lib/winconfig.h +++ /dev/null @@ -1,30 +0,0 @@ -/*================================================================ -** Copyright 2000, Clark Cooper -** All rights reserved. -** -** This is free software. You are permitted to copy, distribute, or modify -** it under the terms of the MIT/X license (contained in the COPYING file -** with this distribution.) -*/ - -#ifndef WINCONFIG_H -#define WINCONFIG_H - -#define WIN32_LEAN_AND_MEAN -#include -#undef WIN32_LEAN_AND_MEAN - -#include -#include - -#define XML_NS 1 -#define XML_DTD 1 -#define XML_CONTEXT_BYTES 1024 - -/* we will assume all Windows platforms are little endian */ -#define BYTEORDER 1234 - -/* Windows has memmove() available. */ -#define HAVE_MEMMOVE - -#endif /* ndef WINCONFIG_H */ diff --git a/wxWidgets/src/expat/lib/xmlparse.c b/wxWidgets/src/expat/lib/xmlparse.c deleted file mode 100644 index 7dbabe8124..0000000000 --- a/wxWidgets/src/expat/lib/xmlparse.c +++ /dev/null @@ -1,5711 +0,0 @@ -/* Copyright (c) 1998, 1999, 2000 Thai Open Source Software Center Ltd - See the file COPYING for copying permission. -*/ - -#include -#include /* memset(), memcpy() */ - -#ifdef COMPILED_FROM_DSP - -#include "winconfig.h" -#include "expat.h" - -#elif defined(OS2_32) - -#include "os2config.h" -#include "expat.h" - -#elif defined(__MSDOS__) - -#include "dosconfig.h" -#include "expat.h" - -#elif defined(MACOS_CLASSIC) - -#include "macconfig.h" -#include "expat.h" - -#else - -#include "expat_config.h" - -#ifdef __declspec -#define XMLPARSEAPI(type) type __cdecl -#endif - -#include "expat.h" - -#ifdef __declspec -#undef XMLPARSEAPI -#endif -#endif /* ndef COMPILED_FROM_DSP */ - -#ifdef XML_UNICODE -#define XML_ENCODE_MAX XML_UTF16_ENCODE_MAX -#define XmlConvert XmlUtf16Convert -#define XmlGetInternalEncoding XmlGetUtf16InternalEncoding -#define XmlGetInternalEncodingNS XmlGetUtf16InternalEncodingNS -#define XmlEncode XmlUtf16Encode -#define MUST_CONVERT(enc, s) (!(enc)->isUtf16 || (((unsigned long)s) & 1)) -typedef unsigned short ICHAR; -#else -#define XML_ENCODE_MAX XML_UTF8_ENCODE_MAX -#define XmlConvert XmlUtf8Convert -#define XmlGetInternalEncoding XmlGetUtf8InternalEncoding -#define XmlGetInternalEncodingNS XmlGetUtf8InternalEncodingNS -#define XmlEncode XmlUtf8Encode -#define MUST_CONVERT(enc, s) (!(enc)->isUtf8) -typedef char ICHAR; -#endif - - -#ifndef XML_NS - -#define XmlInitEncodingNS XmlInitEncoding -#define XmlInitUnknownEncodingNS XmlInitUnknownEncoding -#undef XmlGetInternalEncodingNS -#define XmlGetInternalEncodingNS XmlGetInternalEncoding -#define XmlParseXmlDeclNS XmlParseXmlDecl - -#endif - -#ifdef XML_UNICODE - -#ifdef XML_UNICODE_WCHAR_T -#define XML_T(x) (const wchar_t)x -#define XML_L(x) L ## x -#else -#define XML_T(x) (const unsigned short)x -#define XML_L(x) x -#endif - -#else - -#define XML_T(x) x -#define XML_L(x) x - -#endif - -/* Round up n to be a multiple of sz, where sz is a power of 2. */ -#define ROUND_UP(n, sz) (((n) + ((sz) - 1)) & ~((sz) - 1)) - -/* Handle the case where memmove() doesn't exist. */ -#ifndef HAVE_MEMMOVE -#ifdef HAVE_BCOPY -#define memmove(d,s,l) bcopy((s),(d),(l)) -#else -#error memmove does not exist on this platform, nor is a substitute available -#endif /* HAVE_BCOPY */ -#endif /* HAVE_MEMMOVE */ - -#include "internal.h" -#include "xmltok.h" -#include "xmlrole.h" - -typedef const XML_Char *KEY; - -typedef struct { - KEY name; -} NAMED; - -typedef struct { - NAMED **v; - size_t size; - size_t used; - size_t usedLim; - const XML_Memory_Handling_Suite *mem; -} HASH_TABLE; - -typedef struct { - NAMED **p; - NAMED **end; -} HASH_TABLE_ITER; - -#define INIT_TAG_BUF_SIZE 32 /* must be a multiple of sizeof(XML_Char) */ -#define INIT_DATA_BUF_SIZE 1024 -#define INIT_ATTS_SIZE 16 -#define INIT_BLOCK_SIZE 1024 -#define INIT_BUFFER_SIZE 1024 - -#define EXPAND_SPARE 24 - -typedef struct binding { - struct prefix *prefix; - struct binding *nextTagBinding; - struct binding *prevPrefixBinding; - const struct attribute_id *attId; - XML_Char *uri; - int uriLen; - int uriAlloc; -} BINDING; - -typedef struct prefix { - const XML_Char *name; - BINDING *binding; -} PREFIX; - -typedef struct { - const XML_Char *str; - const XML_Char *localPart; - const XML_Char *prefix; - int strLen; - int uriLen; - int prefixLen; -} TAG_NAME; - -/* TAG represents an open element. - The name of the element is stored in both the document and API - encodings. The memory buffer 'buf' is a separately-allocated - memory area which stores the name. During the XML_Parse()/ - XMLParseBuffer() when the element is open, the memory for the 'raw' - version of the name (in the document encoding) is shared with the - document buffer. If the element is open across calls to - XML_Parse()/XML_ParseBuffer(), the buffer is re-allocated to - contain the 'raw' name as well. - - A parser re-uses these structures, maintaining a list of allocated - TAG objects in a free list. -*/ -typedef struct tag { - struct tag *parent; /* parent of this element */ - const char *rawName; /* tagName in the original encoding */ - int rawNameLength; - TAG_NAME name; /* tagName in the API encoding */ - char *buf; /* buffer for name components */ - char *bufEnd; /* end of the buffer */ - BINDING *bindings; -} TAG; - -typedef struct { - const XML_Char *name; - const XML_Char *textPtr; - int textLen; - const XML_Char *systemId; - const XML_Char *base; - const XML_Char *publicId; - const XML_Char *notation; - XML_Bool open; - XML_Bool is_param; - XML_Bool is_internal; /* true if declared in internal subset outside PE */ -} ENTITY; - -typedef struct { - enum XML_Content_Type type; - enum XML_Content_Quant quant; - const XML_Char * name; - int firstchild; - int lastchild; - int childcnt; - int nextsib; -} CONTENT_SCAFFOLD; - -#define INIT_SCAFFOLD_ELEMENTS 32 - -typedef struct block { - struct block *next; - int size; - XML_Char s[1]; -} BLOCK; - -typedef struct { - BLOCK *blocks; - BLOCK *freeBlocks; - const XML_Char *end; - XML_Char *ptr; - XML_Char *start; - const XML_Memory_Handling_Suite *mem; -} STRING_POOL; - -/* The XML_Char before the name is used to determine whether - an attribute has been specified. */ -typedef struct attribute_id { - XML_Char *name; - PREFIX *prefix; - XML_Bool maybeTokenized; - XML_Bool xmlns; -} ATTRIBUTE_ID; - -typedef struct { - const ATTRIBUTE_ID *id; - XML_Bool isCdata; - const XML_Char *value; -} DEFAULT_ATTRIBUTE; - -typedef struct { - const XML_Char *name; - PREFIX *prefix; - const ATTRIBUTE_ID *idAtt; - int nDefaultAtts; - int allocDefaultAtts; - DEFAULT_ATTRIBUTE *defaultAtts; -} ELEMENT_TYPE; - -typedef struct { - HASH_TABLE generalEntities; - HASH_TABLE elementTypes; - HASH_TABLE attributeIds; - HASH_TABLE prefixes; - STRING_POOL pool; - STRING_POOL entityValuePool; - /* false once a parameter entity reference has been skipped */ - XML_Bool keepProcessing; - /* true once an internal or external PE reference has been encountered; - this includes the reference to an external subset */ - XML_Bool hasParamEntityRefs; - XML_Bool standalone; -#ifdef XML_DTD - /* indicates if external PE has been read */ - XML_Bool paramEntityRead; - HASH_TABLE paramEntities; -#endif /* XML_DTD */ - PREFIX defaultPrefix; - /* === scaffolding for building content model === */ - XML_Bool in_eldecl; - CONTENT_SCAFFOLD *scaffold; - unsigned contentStringLen; - unsigned scaffSize; - unsigned scaffCount; - int scaffLevel; - int *scaffIndex; -} DTD; - -typedef struct open_internal_entity { - const char *internalEventPtr; - const char *internalEventEndPtr; - struct open_internal_entity *next; - ENTITY *entity; -} OPEN_INTERNAL_ENTITY; - -typedef enum XML_Error PTRCALL Processor(XML_Parser parser, - const char *start, - const char *end, - const char **endPtr); - -static Processor prologProcessor; -static Processor prologInitProcessor; -static Processor contentProcessor; -static Processor cdataSectionProcessor; -#ifdef XML_DTD -static Processor ignoreSectionProcessor; -static Processor externalParEntProcessor; -static Processor externalParEntInitProcessor; -static Processor entityValueProcessor; -static Processor entityValueInitProcessor; -#endif /* XML_DTD */ -static Processor epilogProcessor; -static Processor errorProcessor; -static Processor externalEntityInitProcessor; -static Processor externalEntityInitProcessor2; -static Processor externalEntityInitProcessor3; -static Processor externalEntityContentProcessor; - -static enum XML_Error -handleUnknownEncoding(XML_Parser parser, const XML_Char *encodingName); -static enum XML_Error -processXmlDecl(XML_Parser parser, int isGeneralTextEntity, - const char *, const char *); -static enum XML_Error -initializeEncoding(XML_Parser parser); -static enum XML_Error -doProlog(XML_Parser parser, const ENCODING *enc, const char *s, - const char *end, int tok, const char *next, const char **nextPtr); -static enum XML_Error -processInternalParamEntity(XML_Parser parser, ENTITY *entity); -static enum XML_Error -doContent(XML_Parser parser, int startTagLevel, const ENCODING *enc, - const char *start, const char *end, const char **endPtr); -static enum XML_Error -doCdataSection(XML_Parser parser, const ENCODING *, const char **startPtr, - const char *end, const char **nextPtr); -#ifdef XML_DTD -static enum XML_Error -doIgnoreSection(XML_Parser parser, const ENCODING *, const char **startPtr, - const char *end, const char **nextPtr); -#endif /* XML_DTD */ - -static enum XML_Error -storeAtts(XML_Parser parser, const ENCODING *, const char *s, - TAG_NAME *tagNamePtr, BINDING **bindingsPtr); -static enum XML_Error -addBinding(XML_Parser parser, PREFIX *prefix, const ATTRIBUTE_ID *attId, - const XML_Char *uri, BINDING **bindingsPtr); -static int -defineAttribute(ELEMENT_TYPE *type, ATTRIBUTE_ID *, - XML_Bool isCdata, XML_Bool isId, const XML_Char *dfltValue, - XML_Parser parser); -static enum XML_Error -storeAttributeValue(XML_Parser parser, const ENCODING *, XML_Bool isCdata, - const char *, const char *, STRING_POOL *); -static enum XML_Error -appendAttributeValue(XML_Parser parser, const ENCODING *, XML_Bool isCdata, - const char *, const char *, STRING_POOL *); -static ATTRIBUTE_ID * -getAttributeId(XML_Parser parser, const ENCODING *enc, const char *start, - const char *end); -static int -setElementTypePrefix(XML_Parser parser, ELEMENT_TYPE *); -static enum XML_Error -storeEntityValue(XML_Parser parser, const ENCODING *enc, const char *start, - const char *end); -static int -reportProcessingInstruction(XML_Parser parser, const ENCODING *enc, - const char *start, const char *end); -static int -reportComment(XML_Parser parser, const ENCODING *enc, const char *start, - const char *end); -static void -reportDefault(XML_Parser parser, const ENCODING *enc, const char *start, - const char *end); - -static const XML_Char * getContext(XML_Parser parser); -static XML_Bool -setContext(XML_Parser parser, const XML_Char *context); - -static void FASTCALL normalizePublicId(XML_Char *s); - -static DTD * dtdCreate(const XML_Memory_Handling_Suite *ms); -/* do not call if parentParser != NULL */ -static void dtdReset(DTD *p, const XML_Memory_Handling_Suite *ms); -static void -dtdDestroy(DTD *p, XML_Bool isDocEntity, const XML_Memory_Handling_Suite *ms); -static int -dtdCopy(DTD *newDtd, const DTD *oldDtd, const XML_Memory_Handling_Suite *ms); -static int -copyEntityTable(HASH_TABLE *, STRING_POOL *, const HASH_TABLE *); - -static NAMED * -lookup(HASH_TABLE *table, KEY name, size_t createSize); -static void FASTCALL -hashTableInit(HASH_TABLE *, const XML_Memory_Handling_Suite *ms); -static void FASTCALL hashTableClear(HASH_TABLE *); -static void FASTCALL hashTableDestroy(HASH_TABLE *); -static void FASTCALL -hashTableIterInit(HASH_TABLE_ITER *, const HASH_TABLE *); -static NAMED * FASTCALL hashTableIterNext(HASH_TABLE_ITER *); - -static void FASTCALL -poolInit(STRING_POOL *, const XML_Memory_Handling_Suite *ms); -static void FASTCALL poolClear(STRING_POOL *); -static void FASTCALL poolDestroy(STRING_POOL *); -static XML_Char * -poolAppend(STRING_POOL *pool, const ENCODING *enc, - const char *ptr, const char *end); -static XML_Char * -poolStoreString(STRING_POOL *pool, const ENCODING *enc, - const char *ptr, const char *end); -static XML_Bool FASTCALL poolGrow(STRING_POOL *pool); -static const XML_Char * FASTCALL -poolCopyString(STRING_POOL *pool, const XML_Char *s); -static const XML_Char * -poolCopyStringN(STRING_POOL *pool, const XML_Char *s, int n); -static const XML_Char * FASTCALL -poolAppendString(STRING_POOL *pool, const XML_Char *s); - -static int FASTCALL nextScaffoldPart(XML_Parser parser); -static XML_Content * build_model(XML_Parser parser); -static ELEMENT_TYPE * -getElementType(XML_Parser parser, const ENCODING *enc, - const char *ptr, const char *end); - -static XML_Parser -parserCreate(const XML_Char *encodingName, - const XML_Memory_Handling_Suite *memsuite, - const XML_Char *nameSep, - DTD *dtd); -static void -parserInit(XML_Parser parser, const XML_Char *encodingName); - -#define poolStart(pool) ((pool)->start) -#define poolEnd(pool) ((pool)->ptr) -#define poolLength(pool) ((pool)->ptr - (pool)->start) -#define poolChop(pool) ((void)--(pool->ptr)) -#define poolLastChar(pool) (((pool)->ptr)[-1]) -#define poolDiscard(pool) ((pool)->ptr = (pool)->start) -#define poolFinish(pool) ((pool)->start = (pool)->ptr) -#define poolAppendChar(pool, c) \ - (((pool)->ptr == (pool)->end && !poolGrow(pool)) \ - ? 0 \ - : ((*((pool)->ptr)++ = c), 1)) - -struct XML_ParserStruct { - /* The first member must be userData so that the XML_GetUserData - macro works. */ - void *m_userData; - void *m_handlerArg; - char *m_buffer; - const XML_Memory_Handling_Suite m_mem; - /* first character to be parsed */ - const char *m_bufferPtr; - /* past last character to be parsed */ - char *m_bufferEnd; - /* allocated end of buffer */ - const char *m_bufferLim; - long m_parseEndByteIndex; - const char *m_parseEndPtr; - XML_Char *m_dataBuf; - XML_Char *m_dataBufEnd; - XML_StartElementHandler m_startElementHandler; - XML_EndElementHandler m_endElementHandler; - XML_CharacterDataHandler m_characterDataHandler; - XML_ProcessingInstructionHandler m_processingInstructionHandler; - XML_CommentHandler m_commentHandler; - XML_StartCdataSectionHandler m_startCdataSectionHandler; - XML_EndCdataSectionHandler m_endCdataSectionHandler; - XML_DefaultHandler m_defaultHandler; - XML_StartDoctypeDeclHandler m_startDoctypeDeclHandler; - XML_EndDoctypeDeclHandler m_endDoctypeDeclHandler; - XML_UnparsedEntityDeclHandler m_unparsedEntityDeclHandler; - XML_NotationDeclHandler m_notationDeclHandler; - XML_StartNamespaceDeclHandler m_startNamespaceDeclHandler; - XML_EndNamespaceDeclHandler m_endNamespaceDeclHandler; - XML_NotStandaloneHandler m_notStandaloneHandler; - XML_ExternalEntityRefHandler m_externalEntityRefHandler; - XML_Parser m_externalEntityRefHandlerArg; - XML_SkippedEntityHandler m_skippedEntityHandler; - XML_UnknownEncodingHandler m_unknownEncodingHandler; - XML_ElementDeclHandler m_elementDeclHandler; - XML_AttlistDeclHandler m_attlistDeclHandler; - XML_EntityDeclHandler m_entityDeclHandler; - XML_XmlDeclHandler m_xmlDeclHandler; - const ENCODING *m_encoding; - INIT_ENCODING m_initEncoding; - const ENCODING *m_internalEncoding; - const XML_Char *m_protocolEncodingName; - XML_Bool m_ns; - XML_Bool m_ns_triplets; - void *m_unknownEncodingMem; - void *m_unknownEncodingData; - void *m_unknownEncodingHandlerData; - void (*m_unknownEncodingRelease)(void *); - PROLOG_STATE m_prologState; - Processor *m_processor; - enum XML_Error m_errorCode; - const char *m_eventPtr; - const char *m_eventEndPtr; - const char *m_positionPtr; - OPEN_INTERNAL_ENTITY *m_openInternalEntities; - XML_Bool m_defaultExpandInternalEntities; - int m_tagLevel; - ENTITY *m_declEntity; - const XML_Char *m_doctypeName; - const XML_Char *m_doctypeSysid; - const XML_Char *m_doctypePubid; - const XML_Char *m_declAttributeType; - const XML_Char *m_declNotationName; - const XML_Char *m_declNotationPublicId; - ELEMENT_TYPE *m_declElementType; - ATTRIBUTE_ID *m_declAttributeId; - XML_Bool m_declAttributeIsCdata; - XML_Bool m_declAttributeIsId; - DTD *m_dtd; - const XML_Char *m_curBase; - TAG *m_tagStack; - TAG *m_freeTagList; - BINDING *m_inheritedBindings; - BINDING *m_freeBindingList; - int m_attsSize; - int m_nSpecifiedAtts; - int m_idAttIndex; - ATTRIBUTE *m_atts; - POSITION m_position; - STRING_POOL m_tempPool; - STRING_POOL m_temp2Pool; - char *m_groupConnector; - unsigned m_groupSize; - XML_Char m_namespaceSeparator; - XML_Parser m_parentParser; -#ifdef XML_DTD - XML_Bool m_isParamEntity; - XML_Bool m_useForeignDTD; - enum XML_ParamEntityParsing m_paramEntityParsing; -#endif -}; - -#define MALLOC(s) (parser->m_mem.malloc_fcn((s))) -#define REALLOC(p,s) (parser->m_mem.realloc_fcn((p),(s))) -#define FREE(p) (parser->m_mem.free_fcn((p))) - -#define userData (parser->m_userData) -#define handlerArg (parser->m_handlerArg) -#define startElementHandler (parser->m_startElementHandler) -#define endElementHandler (parser->m_endElementHandler) -#define characterDataHandler (parser->m_characterDataHandler) -#define processingInstructionHandler \ - (parser->m_processingInstructionHandler) -#define commentHandler (parser->m_commentHandler) -#define startCdataSectionHandler \ - (parser->m_startCdataSectionHandler) -#define endCdataSectionHandler (parser->m_endCdataSectionHandler) -#define defaultHandler (parser->m_defaultHandler) -#define startDoctypeDeclHandler (parser->m_startDoctypeDeclHandler) -#define endDoctypeDeclHandler (parser->m_endDoctypeDeclHandler) -#define unparsedEntityDeclHandler \ - (parser->m_unparsedEntityDeclHandler) -#define notationDeclHandler (parser->m_notationDeclHandler) -#define startNamespaceDeclHandler \ - (parser->m_startNamespaceDeclHandler) -#define endNamespaceDeclHandler (parser->m_endNamespaceDeclHandler) -#define notStandaloneHandler (parser->m_notStandaloneHandler) -#define externalEntityRefHandler \ - (parser->m_externalEntityRefHandler) -#define externalEntityRefHandlerArg \ - (parser->m_externalEntityRefHandlerArg) -#define internalEntityRefHandler \ - (parser->m_internalEntityRefHandler) -#define skippedEntityHandler (parser->m_skippedEntityHandler) -#define unknownEncodingHandler (parser->m_unknownEncodingHandler) -#define elementDeclHandler (parser->m_elementDeclHandler) -#define attlistDeclHandler (parser->m_attlistDeclHandler) -#define entityDeclHandler (parser->m_entityDeclHandler) -#define xmlDeclHandler (parser->m_xmlDeclHandler) -#define encoding (parser->m_encoding) -#define initEncoding (parser->m_initEncoding) -#define internalEncoding (parser->m_internalEncoding) -#define unknownEncodingMem (parser->m_unknownEncodingMem) -#define unknownEncodingData (parser->m_unknownEncodingData) -#define unknownEncodingHandlerData \ - (parser->m_unknownEncodingHandlerData) -#define unknownEncodingRelease (parser->m_unknownEncodingRelease) -#define protocolEncodingName (parser->m_protocolEncodingName) -#define ns (parser->m_ns) -#define ns_triplets (parser->m_ns_triplets) -#define prologState (parser->m_prologState) -#define processor (parser->m_processor) -#define errorCode (parser->m_errorCode) -#define eventPtr (parser->m_eventPtr) -#define eventEndPtr (parser->m_eventEndPtr) -#define positionPtr (parser->m_positionPtr) -#define position (parser->m_position) -#define openInternalEntities (parser->m_openInternalEntities) -#define defaultExpandInternalEntities \ - (parser->m_defaultExpandInternalEntities) -#define tagLevel (parser->m_tagLevel) -#define buffer (parser->m_buffer) -#define bufferPtr (parser->m_bufferPtr) -#define bufferEnd (parser->m_bufferEnd) -#define parseEndByteIndex (parser->m_parseEndByteIndex) -#define parseEndPtr (parser->m_parseEndPtr) -#define bufferLim (parser->m_bufferLim) -#define dataBuf (parser->m_dataBuf) -#define dataBufEnd (parser->m_dataBufEnd) -#define _dtd (parser->m_dtd) -#define curBase (parser->m_curBase) -#define declEntity (parser->m_declEntity) -#define doctypeName (parser->m_doctypeName) -#define doctypeSysid (parser->m_doctypeSysid) -#define doctypePubid (parser->m_doctypePubid) -#define declAttributeType (parser->m_declAttributeType) -#define declNotationName (parser->m_declNotationName) -#define declNotationPublicId (parser->m_declNotationPublicId) -#define declElementType (parser->m_declElementType) -#define declAttributeId (parser->m_declAttributeId) -#define declAttributeIsCdata (parser->m_declAttributeIsCdata) -#define declAttributeIsId (parser->m_declAttributeIsId) -#define freeTagList (parser->m_freeTagList) -#define freeBindingList (parser->m_freeBindingList) -#define inheritedBindings (parser->m_inheritedBindings) -#define tagStack (parser->m_tagStack) -#define atts (parser->m_atts) -#define attsSize (parser->m_attsSize) -#define nSpecifiedAtts (parser->m_nSpecifiedAtts) -#define idAttIndex (parser->m_idAttIndex) -#define tempPool (parser->m_tempPool) -#define temp2Pool (parser->m_temp2Pool) -#define groupConnector (parser->m_groupConnector) -#define groupSize (parser->m_groupSize) -#define namespaceSeparator (parser->m_namespaceSeparator) -#define parentParser (parser->m_parentParser) -#ifdef XML_DTD -#define isParamEntity (parser->m_isParamEntity) -#define useForeignDTD (parser->m_useForeignDTD) -#define paramEntityParsing (parser->m_paramEntityParsing) -#endif /* XML_DTD */ - -#define parsing \ - (parentParser \ - ? \ - (isParamEntity \ - ? \ - (processor != externalParEntInitProcessor) \ - : \ - (processor != externalEntityInitProcessor)) \ - : \ - (processor != prologInitProcessor)) - -XML_Parser -XML_ParserCreate(const XML_Char *encodingName) -{ - return XML_ParserCreate_MM(encodingName, NULL, NULL); -} - -XML_Parser -XML_ParserCreateNS(const XML_Char *encodingName, XML_Char nsSep) -{ - XML_Char tmp[2]; - *tmp = nsSep; - return XML_ParserCreate_MM(encodingName, NULL, tmp); -} - -static const XML_Char implicitContext[] = { - 'x', 'm', 'l', '=', 'h', 't', 't', 'p', ':', '/', '/', - 'w', 'w', 'w', '.', 'w', '3', '.', 'o', 'r', 'g', '/', - 'X', 'M', 'L', '/', '1', '9', '9', '8', '/', - 'n', 'a', 'm', 'e', 's', 'p', 'a', 'c', 'e', '\0' -}; - -XML_Parser -XML_ParserCreate_MM(const XML_Char *encodingName, - const XML_Memory_Handling_Suite *memsuite, - const XML_Char *nameSep) -{ - XML_Parser parser = parserCreate(encodingName, memsuite, nameSep, NULL); - if (parser != NULL && ns) { - /* implicit context only set for root parser, since child - parsers (i.e. external entity parsers) will inherit it - */ - if (!setContext(parser, implicitContext)) { - XML_ParserFree(parser); - return NULL; - } - } - return parser; -} - -static XML_Parser -parserCreate(const XML_Char *encodingName, - const XML_Memory_Handling_Suite *memsuite, - const XML_Char *nameSep, - DTD *dtd) -{ - XML_Parser parser; - - if (memsuite) { - XML_Memory_Handling_Suite *mtemp; - parser = (XML_Parser) - memsuite->malloc_fcn(sizeof(struct XML_ParserStruct)); - if (parser != NULL) { - mtemp = (XML_Memory_Handling_Suite *)&(parser->m_mem); - mtemp->malloc_fcn = memsuite->malloc_fcn; - mtemp->realloc_fcn = memsuite->realloc_fcn; - mtemp->free_fcn = memsuite->free_fcn; - } - } - else { - XML_Memory_Handling_Suite *mtemp; - parser = (XML_Parser)malloc(sizeof(struct XML_ParserStruct)); - if (parser != NULL) { - mtemp = (XML_Memory_Handling_Suite *)&(parser->m_mem); - mtemp->malloc_fcn = malloc; - mtemp->realloc_fcn = realloc; - mtemp->free_fcn = free; - } - } - - if (!parser) - return parser; - - buffer = NULL; - bufferLim = NULL; - - attsSize = INIT_ATTS_SIZE; - atts = (ATTRIBUTE *)MALLOC(attsSize * sizeof(ATTRIBUTE)); - if (atts == NULL) { - FREE(parser); - return NULL; - } - dataBuf = (XML_Char *)MALLOC(INIT_DATA_BUF_SIZE * sizeof(XML_Char)); - if (dataBuf == NULL) { - FREE(atts); - FREE(parser); - return NULL; - } - dataBufEnd = dataBuf + INIT_DATA_BUF_SIZE; - - if (dtd) - _dtd = dtd; - else { - _dtd = dtdCreate(&parser->m_mem); - if (_dtd == NULL) { - FREE(dataBuf); - FREE(atts); - FREE(parser); - return NULL; - } - } - - freeBindingList = NULL; - freeTagList = NULL; - - groupSize = 0; - groupConnector = NULL; - - unknownEncodingHandler = NULL; - unknownEncodingHandlerData = NULL; - - namespaceSeparator = '!'; - ns = XML_FALSE; - ns_triplets = XML_FALSE; - - poolInit(&tempPool, &(parser->m_mem)); - poolInit(&temp2Pool, &(parser->m_mem)); - parserInit(parser, encodingName); - - if (encodingName && !protocolEncodingName) { - XML_ParserFree(parser); - return NULL; - } - - if (nameSep) { - ns = XML_TRUE; - internalEncoding = XmlGetInternalEncodingNS(); - namespaceSeparator = *nameSep; - } - else { - internalEncoding = XmlGetInternalEncoding(); - } - - return parser; -} - -static void -parserInit(XML_Parser parser, const XML_Char *encodingName) -{ - processor = prologInitProcessor; - XmlPrologStateInit(&prologState); - protocolEncodingName = (encodingName != NULL - ? poolCopyString(&tempPool, encodingName) - : NULL); - curBase = NULL; - XmlInitEncoding(&initEncoding, &encoding, 0); - userData = NULL; - handlerArg = NULL; - startElementHandler = NULL; - endElementHandler = NULL; - characterDataHandler = NULL; - processingInstructionHandler = NULL; - commentHandler = NULL; - startCdataSectionHandler = NULL; - endCdataSectionHandler = NULL; - defaultHandler = NULL; - startDoctypeDeclHandler = NULL; - endDoctypeDeclHandler = NULL; - unparsedEntityDeclHandler = NULL; - notationDeclHandler = NULL; - startNamespaceDeclHandler = NULL; - endNamespaceDeclHandler = NULL; - notStandaloneHandler = NULL; - externalEntityRefHandler = NULL; - externalEntityRefHandlerArg = parser; - skippedEntityHandler = NULL; - elementDeclHandler = NULL; - attlistDeclHandler = NULL; - entityDeclHandler = NULL; - xmlDeclHandler = NULL; - bufferPtr = buffer; - bufferEnd = buffer; - parseEndByteIndex = 0; - parseEndPtr = NULL; - declElementType = NULL; - declAttributeId = NULL; - declEntity = NULL; - doctypeName = NULL; - doctypeSysid = NULL; - doctypePubid = NULL; - declAttributeType = NULL; - declNotationName = NULL; - declNotationPublicId = NULL; - declAttributeIsCdata = XML_FALSE; - declAttributeIsId = XML_FALSE; - memset(&position, 0, sizeof(POSITION)); - errorCode = XML_ERROR_NONE; - eventPtr = NULL; - eventEndPtr = NULL; - positionPtr = NULL; - openInternalEntities = 0; - defaultExpandInternalEntities = XML_TRUE; - tagLevel = 0; - tagStack = NULL; - inheritedBindings = NULL; - nSpecifiedAtts = 0; - unknownEncodingMem = NULL; - unknownEncodingRelease = NULL; - unknownEncodingData = NULL; - parentParser = NULL; -#ifdef XML_DTD - isParamEntity = XML_FALSE; - useForeignDTD = XML_FALSE; - paramEntityParsing = XML_PARAM_ENTITY_PARSING_NEVER; -#endif -} - -/* moves list of bindings to freeBindingList */ -static void FASTCALL -moveToFreeBindingList(XML_Parser parser, BINDING *bindings) -{ - while (bindings) { - BINDING *b = bindings; - bindings = bindings->nextTagBinding; - b->nextTagBinding = freeBindingList; - freeBindingList = b; - } -} - -XML_Bool -XML_ParserReset(XML_Parser parser, const XML_Char *encodingName) -{ - TAG *tStk; - if (parentParser) - return XML_FALSE; - /* move tagStack to freeTagList */ - tStk = tagStack; - while (tStk) { - TAG *tag = tStk; - tStk = tStk->parent; - tag->parent = freeTagList; - moveToFreeBindingList(parser, tag->bindings); - tag->bindings = NULL; - freeTagList = tag; - } - moveToFreeBindingList(parser, inheritedBindings); - if (unknownEncodingMem) - FREE(unknownEncodingMem); - if (unknownEncodingRelease) - unknownEncodingRelease(unknownEncodingData); - poolClear(&tempPool); - poolClear(&temp2Pool); - parserInit(parser, encodingName); - dtdReset(_dtd, &parser->m_mem); - return setContext(parser, implicitContext); -} - -enum XML_Status -XML_SetEncoding(XML_Parser parser, const XML_Char *encodingName) -{ - /* Block after XML_Parse()/XML_ParseBuffer() has been called. - XXX There's no way for the caller to determine which of the - XXX possible error cases caused the XML_STATUS_ERROR return. - */ - if (parsing) - return XML_STATUS_ERROR; - if (encodingName == NULL) - protocolEncodingName = NULL; - else { - protocolEncodingName = poolCopyString(&tempPool, encodingName); - if (!protocolEncodingName) - return XML_STATUS_ERROR; - } - return XML_STATUS_OK; -} - -XML_Parser -XML_ExternalEntityParserCreate(XML_Parser oldParser, - const XML_Char *context, - const XML_Char *encodingName) -{ - XML_Parser parser = oldParser; - DTD *newDtd = NULL; - DTD *oldDtd = _dtd; - XML_StartElementHandler oldStartElementHandler = startElementHandler; - XML_EndElementHandler oldEndElementHandler = endElementHandler; - XML_CharacterDataHandler oldCharacterDataHandler = characterDataHandler; - XML_ProcessingInstructionHandler oldProcessingInstructionHandler - = processingInstructionHandler; - XML_CommentHandler oldCommentHandler = commentHandler; - XML_StartCdataSectionHandler oldStartCdataSectionHandler - = startCdataSectionHandler; - XML_EndCdataSectionHandler oldEndCdataSectionHandler - = endCdataSectionHandler; - XML_DefaultHandler oldDefaultHandler = defaultHandler; - XML_UnparsedEntityDeclHandler oldUnparsedEntityDeclHandler - = unparsedEntityDeclHandler; - XML_NotationDeclHandler oldNotationDeclHandler = notationDeclHandler; - XML_StartNamespaceDeclHandler oldStartNamespaceDeclHandler - = startNamespaceDeclHandler; - XML_EndNamespaceDeclHandler oldEndNamespaceDeclHandler - = endNamespaceDeclHandler; - XML_NotStandaloneHandler oldNotStandaloneHandler = notStandaloneHandler; - XML_ExternalEntityRefHandler oldExternalEntityRefHandler - = externalEntityRefHandler; - XML_SkippedEntityHandler oldSkippedEntityHandler = skippedEntityHandler; - XML_UnknownEncodingHandler oldUnknownEncodingHandler - = unknownEncodingHandler; - XML_ElementDeclHandler oldElementDeclHandler = elementDeclHandler; - XML_AttlistDeclHandler oldAttlistDeclHandler = attlistDeclHandler; - XML_EntityDeclHandler oldEntityDeclHandler = entityDeclHandler; - XML_XmlDeclHandler oldXmlDeclHandler = xmlDeclHandler; - ELEMENT_TYPE * oldDeclElementType = declElementType; - - void *oldUserData = userData; - void *oldHandlerArg = handlerArg; - XML_Bool oldDefaultExpandInternalEntities = defaultExpandInternalEntities; - XML_Parser oldExternalEntityRefHandlerArg = externalEntityRefHandlerArg; -#ifdef XML_DTD - enum XML_ParamEntityParsing oldParamEntityParsing = paramEntityParsing; - int oldInEntityValue = prologState.inEntityValue; -#endif - XML_Bool oldns_triplets = ns_triplets; - -#ifdef XML_DTD - if (!context) - newDtd = oldDtd; -#endif /* XML_DTD */ - - /* Note that the magical uses of the pre-processor to make field - access look more like C++ require that `parser' be overwritten - here. This makes this function more painful to follow than it - would be otherwise. - */ - if (ns) { - XML_Char tmp[2]; - *tmp = namespaceSeparator; - parser = parserCreate(encodingName, &parser->m_mem, tmp, newDtd); - } - else { - parser = parserCreate(encodingName, &parser->m_mem, NULL, newDtd); - } - - if (!parser) - return NULL; - - startElementHandler = oldStartElementHandler; - endElementHandler = oldEndElementHandler; - characterDataHandler = oldCharacterDataHandler; - processingInstructionHandler = oldProcessingInstructionHandler; - commentHandler = oldCommentHandler; - startCdataSectionHandler = oldStartCdataSectionHandler; - endCdataSectionHandler = oldEndCdataSectionHandler; - defaultHandler = oldDefaultHandler; - unparsedEntityDeclHandler = oldUnparsedEntityDeclHandler; - notationDeclHandler = oldNotationDeclHandler; - startNamespaceDeclHandler = oldStartNamespaceDeclHandler; - endNamespaceDeclHandler = oldEndNamespaceDeclHandler; - notStandaloneHandler = oldNotStandaloneHandler; - externalEntityRefHandler = oldExternalEntityRefHandler; - skippedEntityHandler = oldSkippedEntityHandler; - unknownEncodingHandler = oldUnknownEncodingHandler; - elementDeclHandler = oldElementDeclHandler; - attlistDeclHandler = oldAttlistDeclHandler; - entityDeclHandler = oldEntityDeclHandler; - xmlDeclHandler = oldXmlDeclHandler; - declElementType = oldDeclElementType; - userData = oldUserData; - if (oldUserData == oldHandlerArg) - handlerArg = userData; - else - handlerArg = parser; - if (oldExternalEntityRefHandlerArg != oldParser) - externalEntityRefHandlerArg = oldExternalEntityRefHandlerArg; - defaultExpandInternalEntities = oldDefaultExpandInternalEntities; - ns_triplets = oldns_triplets; - parentParser = oldParser; -#ifdef XML_DTD - paramEntityParsing = oldParamEntityParsing; - prologState.inEntityValue = oldInEntityValue; - if (context) { -#endif /* XML_DTD */ - if (!dtdCopy(_dtd, oldDtd, &parser->m_mem) - || !setContext(parser, context)) { - XML_ParserFree(parser); - return NULL; - } - processor = externalEntityInitProcessor; -#ifdef XML_DTD - } - else { - /* The DTD instance referenced by _dtd is shared between the document's - root parser and external PE parsers, therefore one does not need to - call setContext. In addition, one also *must* not call setContext, - because this would overwrite existing prefix->binding pointers in - _dtd with ones that get destroyed with the external PE parser. - This would leave those prefixes with dangling pointers. - */ - isParamEntity = XML_TRUE; - XmlPrologStateInitExternalEntity(&prologState); - processor = externalParEntInitProcessor; - } -#endif /* XML_DTD */ - return parser; -} - -static void FASTCALL -destroyBindings(BINDING *bindings, XML_Parser parser) -{ - for (;;) { - BINDING *b = bindings; - if (!b) - break; - bindings = b->nextTagBinding; - FREE(b->uri); - FREE(b); - } -} - -void -XML_ParserFree(XML_Parser parser) -{ - for (;;) { - TAG *p; - if (tagStack == NULL) { - if (freeTagList == NULL) - break; - tagStack = freeTagList; - freeTagList = NULL; - } - p = tagStack; - tagStack = tagStack->parent; - FREE(p->buf); - destroyBindings(p->bindings, parser); - FREE(p); - } - destroyBindings(freeBindingList, parser); - destroyBindings(inheritedBindings, parser); - poolDestroy(&tempPool); - poolDestroy(&temp2Pool); -#ifdef XML_DTD - /* external parameter entity parsers share the DTD structure - parser->m_dtd with the root parser, so we must not destroy it - */ - if (!isParamEntity && _dtd) -#else - if (_dtd) -#endif /* XML_DTD */ - dtdDestroy(_dtd, (XML_Bool)!parentParser, &parser->m_mem); - FREE((void *)atts); - if (groupConnector) - FREE(groupConnector); - if (buffer) - FREE(buffer); - FREE(dataBuf); - if (unknownEncodingMem) - FREE(unknownEncodingMem); - if (unknownEncodingRelease) - unknownEncodingRelease(unknownEncodingData); - FREE(parser); -} - -void -XML_UseParserAsHandlerArg(XML_Parser parser) -{ - handlerArg = parser; -} - -enum XML_Error -XML_UseForeignDTD(XML_Parser parser, XML_Bool useDTD) -{ -#ifdef XML_DTD - /* block after XML_Parse()/XML_ParseBuffer() has been called */ - if (parsing) - return XML_ERROR_CANT_CHANGE_FEATURE_ONCE_PARSING; - useForeignDTD = useDTD; - return XML_ERROR_NONE; -#else - return XML_ERROR_FEATURE_REQUIRES_XML_DTD; -#endif -} - -void -XML_SetReturnNSTriplet(XML_Parser parser, int do_nst) -{ - /* block after XML_Parse()/XML_ParseBuffer() has been called */ - if (parsing) - return; - ns_triplets = do_nst ? XML_TRUE : XML_FALSE; -} - -void -XML_SetUserData(XML_Parser parser, void *p) -{ - if (handlerArg == userData) - handlerArg = userData = p; - else - userData = p; -} - -enum XML_Status -XML_SetBase(XML_Parser parser, const XML_Char *p) -{ - if (p) { - p = poolCopyString(&_dtd->pool, p); - if (!p) - return XML_STATUS_ERROR; - curBase = p; - } - else - curBase = NULL; - return XML_STATUS_OK; -} - -const XML_Char * -XML_GetBase(XML_Parser parser) -{ - return curBase; -} - -int -XML_GetSpecifiedAttributeCount(XML_Parser parser) -{ - return nSpecifiedAtts; -} - -int -XML_GetIdAttributeIndex(XML_Parser parser) -{ - return idAttIndex; -} - -void -XML_SetElementHandler(XML_Parser parser, - XML_StartElementHandler start, - XML_EndElementHandler end) -{ - startElementHandler = start; - endElementHandler = end; -} - -void -XML_SetStartElementHandler(XML_Parser parser, - XML_StartElementHandler start) { - startElementHandler = start; -} - -void -XML_SetEndElementHandler(XML_Parser parser, - XML_EndElementHandler end) { - endElementHandler = end; -} - -void -XML_SetCharacterDataHandler(XML_Parser parser, - XML_CharacterDataHandler handler) -{ - characterDataHandler = handler; -} - -void -XML_SetProcessingInstructionHandler(XML_Parser parser, - XML_ProcessingInstructionHandler handler) -{ - processingInstructionHandler = handler; -} - -void -XML_SetCommentHandler(XML_Parser parser, - XML_CommentHandler handler) -{ - commentHandler = handler; -} - -void -XML_SetCdataSectionHandler(XML_Parser parser, - XML_StartCdataSectionHandler start, - XML_EndCdataSectionHandler end) -{ - startCdataSectionHandler = start; - endCdataSectionHandler = end; -} - -void -XML_SetStartCdataSectionHandler(XML_Parser parser, - XML_StartCdataSectionHandler start) { - startCdataSectionHandler = start; -} - -void -XML_SetEndCdataSectionHandler(XML_Parser parser, - XML_EndCdataSectionHandler end) { - endCdataSectionHandler = end; -} - -void -XML_SetDefaultHandler(XML_Parser parser, - XML_DefaultHandler handler) -{ - defaultHandler = handler; - defaultExpandInternalEntities = XML_FALSE; -} - -void -XML_SetDefaultHandlerExpand(XML_Parser parser, - XML_DefaultHandler handler) -{ - defaultHandler = handler; - defaultExpandInternalEntities = XML_TRUE; -} - -void -XML_SetDoctypeDeclHandler(XML_Parser parser, - XML_StartDoctypeDeclHandler start, - XML_EndDoctypeDeclHandler end) -{ - startDoctypeDeclHandler = start; - endDoctypeDeclHandler = end; -} - -void -XML_SetStartDoctypeDeclHandler(XML_Parser parser, - XML_StartDoctypeDeclHandler start) { - startDoctypeDeclHandler = start; -} - -void -XML_SetEndDoctypeDeclHandler(XML_Parser parser, - XML_EndDoctypeDeclHandler end) { - endDoctypeDeclHandler = end; -} - -void -XML_SetUnparsedEntityDeclHandler(XML_Parser parser, - XML_UnparsedEntityDeclHandler handler) -{ - unparsedEntityDeclHandler = handler; -} - -void -XML_SetNotationDeclHandler(XML_Parser parser, - XML_NotationDeclHandler handler) -{ - notationDeclHandler = handler; -} - -void -XML_SetNamespaceDeclHandler(XML_Parser parser, - XML_StartNamespaceDeclHandler start, - XML_EndNamespaceDeclHandler end) -{ - startNamespaceDeclHandler = start; - endNamespaceDeclHandler = end; -} - -void -XML_SetStartNamespaceDeclHandler(XML_Parser parser, - XML_StartNamespaceDeclHandler start) { - startNamespaceDeclHandler = start; -} - -void -XML_SetEndNamespaceDeclHandler(XML_Parser parser, - XML_EndNamespaceDeclHandler end) { - endNamespaceDeclHandler = end; -} - -void -XML_SetNotStandaloneHandler(XML_Parser parser, - XML_NotStandaloneHandler handler) -{ - notStandaloneHandler = handler; -} - -void -XML_SetExternalEntityRefHandler(XML_Parser parser, - XML_ExternalEntityRefHandler handler) -{ - externalEntityRefHandler = handler; -} - -void -XML_SetExternalEntityRefHandlerArg(XML_Parser parser, void *arg) -{ - if (arg) - externalEntityRefHandlerArg = (XML_Parser)arg; - else - externalEntityRefHandlerArg = parser; -} - -void -XML_SetSkippedEntityHandler(XML_Parser parser, - XML_SkippedEntityHandler handler) -{ - skippedEntityHandler = handler; -} - -void -XML_SetUnknownEncodingHandler(XML_Parser parser, - XML_UnknownEncodingHandler handler, - void *data) -{ - unknownEncodingHandler = handler; - unknownEncodingHandlerData = data; -} - -void -XML_SetElementDeclHandler(XML_Parser parser, - XML_ElementDeclHandler eldecl) -{ - elementDeclHandler = eldecl; -} - -void -XML_SetAttlistDeclHandler(XML_Parser parser, - XML_AttlistDeclHandler attdecl) -{ - attlistDeclHandler = attdecl; -} - -void -XML_SetEntityDeclHandler(XML_Parser parser, - XML_EntityDeclHandler handler) -{ - entityDeclHandler = handler; -} - -void -XML_SetXmlDeclHandler(XML_Parser parser, - XML_XmlDeclHandler handler) { - xmlDeclHandler = handler; -} - -int -XML_SetParamEntityParsing(XML_Parser parser, - enum XML_ParamEntityParsing peParsing) -{ - /* block after XML_Parse()/XML_ParseBuffer() has been called */ - if (parsing) - return 0; -#ifdef XML_DTD - paramEntityParsing = peParsing; - return 1; -#else - return peParsing == XML_PARAM_ENTITY_PARSING_NEVER; -#endif -} - -enum XML_Status -XML_Parse(XML_Parser parser, const char *s, int len, int isFinal) -{ - if (len == 0) { - if (!isFinal) - return XML_STATUS_OK; - positionPtr = bufferPtr; - errorCode = processor(parser, bufferPtr, parseEndPtr = bufferEnd, 0); - if (errorCode == XML_ERROR_NONE) - return XML_STATUS_OK; - eventEndPtr = eventPtr; - processor = errorProcessor; - return XML_STATUS_ERROR; - } -#ifndef XML_CONTEXT_BYTES - else if (bufferPtr == bufferEnd) { - const char *end; - int nLeftOver; - parseEndByteIndex += len; - positionPtr = s; - if (isFinal) { - errorCode = processor(parser, s, parseEndPtr = s + len, 0); - if (errorCode == XML_ERROR_NONE) - return XML_STATUS_OK; - eventEndPtr = eventPtr; - processor = errorProcessor; - return XML_STATUS_ERROR; - } - errorCode = processor(parser, s, parseEndPtr = s + len, &end); - if (errorCode != XML_ERROR_NONE) { - eventEndPtr = eventPtr; - processor = errorProcessor; - return XML_STATUS_ERROR; - } - XmlUpdatePosition(encoding, positionPtr, end, &position); - positionPtr = end; - nLeftOver = s + len - end; - if (nLeftOver) { - if (buffer == NULL || nLeftOver > bufferLim - buffer) { - /* FIXME avoid integer overflow */ - char *temp; - temp = (buffer == NULL - ? (char *)MALLOC(len * 2) - : (char *)REALLOC(buffer, len * 2)); - if (temp == NULL) { - errorCode = XML_ERROR_NO_MEMORY; - return XML_STATUS_ERROR; - } - buffer = temp; - if (!buffer) { - errorCode = XML_ERROR_NO_MEMORY; - eventPtr = eventEndPtr = NULL; - processor = errorProcessor; - return XML_STATUS_ERROR; - } - bufferLim = buffer + len * 2; - } - memcpy(buffer, end, nLeftOver); - bufferPtr = buffer; - bufferEnd = buffer + nLeftOver; - } - return XML_STATUS_OK; - } -#endif /* not defined XML_CONTEXT_BYTES */ - else { - void *buff = XML_GetBuffer(parser, len); - if (buff == NULL) - return XML_STATUS_ERROR; - else { - memcpy(buff, s, len); - return XML_ParseBuffer(parser, len, isFinal); - } - } -} - -enum XML_Status -XML_ParseBuffer(XML_Parser parser, int len, int isFinal) -{ - const char *start = bufferPtr; - positionPtr = start; - bufferEnd += len; - parseEndByteIndex += len; - errorCode = processor(parser, start, parseEndPtr = bufferEnd, - isFinal ? (const char **)NULL : &bufferPtr); - if (errorCode == XML_ERROR_NONE) { - if (!isFinal) { - XmlUpdatePosition(encoding, positionPtr, bufferPtr, &position); - positionPtr = bufferPtr; - } - return XML_STATUS_OK; - } - else { - eventEndPtr = eventPtr; - processor = errorProcessor; - return XML_STATUS_ERROR; - } -} - -void * -XML_GetBuffer(XML_Parser parser, int len) -{ - if (len > bufferLim - bufferEnd) { - /* FIXME avoid integer overflow */ - int neededSize = len + (bufferEnd - bufferPtr); -#ifdef XML_CONTEXT_BYTES - int keep = bufferPtr - buffer; - - if (keep > XML_CONTEXT_BYTES) - keep = XML_CONTEXT_BYTES; - neededSize += keep; -#endif /* defined XML_CONTEXT_BYTES */ - if (neededSize <= bufferLim - buffer) { -#ifdef XML_CONTEXT_BYTES - if (keep < bufferPtr - buffer) { - int offset = (bufferPtr - buffer) - keep; - memmove(buffer, &buffer[offset], bufferEnd - bufferPtr + keep); - bufferEnd -= offset; - bufferPtr -= offset; - } -#else - memmove(buffer, bufferPtr, bufferEnd - bufferPtr); - bufferEnd = buffer + (bufferEnd - bufferPtr); - bufferPtr = buffer; -#endif /* not defined XML_CONTEXT_BYTES */ - } - else { - char *newBuf; - int bufferSize = bufferLim - bufferPtr; - if (bufferSize == 0) - bufferSize = INIT_BUFFER_SIZE; - do { - bufferSize *= 2; - } while (bufferSize < neededSize); - newBuf = (char *)MALLOC(bufferSize); - if (newBuf == 0) { - errorCode = XML_ERROR_NO_MEMORY; - return NULL; - } - bufferLim = newBuf + bufferSize; -#ifdef XML_CONTEXT_BYTES - if (bufferPtr) { - int keep = bufferPtr - buffer; - if (keep > XML_CONTEXT_BYTES) - keep = XML_CONTEXT_BYTES; - memcpy(newBuf, &bufferPtr[-keep], bufferEnd - bufferPtr + keep); - FREE(buffer); - buffer = newBuf; - bufferEnd = buffer + (bufferEnd - bufferPtr) + keep; - bufferPtr = buffer + keep; - } - else { - bufferEnd = newBuf + (bufferEnd - bufferPtr); - bufferPtr = buffer = newBuf; - } -#else - if (bufferPtr) { - memcpy(newBuf, bufferPtr, bufferEnd - bufferPtr); - FREE(buffer); - } - bufferEnd = newBuf + (bufferEnd - bufferPtr); - bufferPtr = buffer = newBuf; -#endif /* not defined XML_CONTEXT_BYTES */ - } - } - return bufferEnd; -} - -enum XML_Error -XML_GetErrorCode(XML_Parser parser) -{ - return errorCode; -} - -long -XML_GetCurrentByteIndex(XML_Parser parser) -{ - if (eventPtr) - return parseEndByteIndex - (parseEndPtr - eventPtr); - return -1; -} - -int -XML_GetCurrentByteCount(XML_Parser parser) -{ - if (eventEndPtr && eventPtr) - return eventEndPtr - eventPtr; - return 0; -} - -const char * -XML_GetInputContext(XML_Parser parser, int *offset, int *size) -{ -#ifdef XML_CONTEXT_BYTES - if (eventPtr && buffer) { - *offset = eventPtr - buffer; - *size = bufferEnd - buffer; - return buffer; - } -#endif /* defined XML_CONTEXT_BYTES */ - return (char *) 0; -} - -int -XML_GetCurrentLineNumber(XML_Parser parser) -{ - if (eventPtr) { - XmlUpdatePosition(encoding, positionPtr, eventPtr, &position); - positionPtr = eventPtr; - } - return position.lineNumber + 1; -} - -int -XML_GetCurrentColumnNumber(XML_Parser parser) -{ - if (eventPtr) { - XmlUpdatePosition(encoding, positionPtr, eventPtr, &position); - positionPtr = eventPtr; - } - return position.columnNumber; -} - -void -XML_FreeContentModel(XML_Parser parser, XML_Content *model) -{ - FREE(model); -} - -void * -XML_MemMalloc(XML_Parser parser, size_t size) -{ - return MALLOC(size); -} - -void * -XML_MemRealloc(XML_Parser parser, void *ptr, size_t size) -{ - return REALLOC(ptr, size); -} - -void -XML_MemFree(XML_Parser parser, void *ptr) -{ - FREE(ptr); -} - -void -XML_DefaultCurrent(XML_Parser parser) -{ - if (defaultHandler) { - if (openInternalEntities) - reportDefault(parser, - internalEncoding, - openInternalEntities->internalEventPtr, - openInternalEntities->internalEventEndPtr); - else - reportDefault(parser, encoding, eventPtr, eventEndPtr); - } -} - -const XML_LChar * -XML_ErrorString(enum XML_Error code) -{ - static const XML_LChar *message[] = { - 0, - XML_L("out of memory"), - XML_L("syntax error"), - XML_L("no element found"), - XML_L("not well-formed (invalid token)"), - XML_L("unclosed token"), - XML_L("partial character"), - XML_L("mismatched tag"), - XML_L("duplicate attribute"), - XML_L("junk after document element"), - XML_L("illegal parameter entity reference"), - XML_L("undefined entity"), - XML_L("recursive entity reference"), - XML_L("asynchronous entity"), - XML_L("reference to invalid character number"), - XML_L("reference to binary entity"), - XML_L("reference to external entity in attribute"), - XML_L("xml declaration not at start of external entity"), - XML_L("unknown encoding"), - XML_L("encoding specified in XML declaration is incorrect"), - XML_L("unclosed CDATA section"), - XML_L("error in processing external entity reference"), - XML_L("document is not standalone"), - XML_L("unexpected parser state - please send a bug report"), - XML_L("entity declared in parameter entity"), - XML_L("requested feature requires XML_DTD support in Expat"), - XML_L("cannot change setting once parsing has begun") - }; - if (code > 0 && code < sizeof(message)/sizeof(message[0])) - return message[code]; - return NULL; -} - -const XML_LChar * -XML_ExpatVersion(void) { - - /* V1 is used to string-ize the version number. However, it would - string-ize the actual version macro *names* unless we get them - substituted before being passed to V1. CPP is defined to expand - a macro, then rescan for more expansions. Thus, we use V2 to expand - the version macros, then CPP will expand the resulting V1() macro - with the correct numerals. */ - /* ### I'm assuming cpp is portable in this respect... */ - -#define V1(a,b,c) XML_L(#a)XML_L(".")XML_L(#b)XML_L(".")XML_L(#c) -#define V2(a,b,c) XML_L("expat_")V1(a,b,c) - - return V2(XML_MAJOR_VERSION, XML_MINOR_VERSION, XML_MICRO_VERSION); - -#undef V1 -#undef V2 -} - -XML_Expat_Version -XML_ExpatVersionInfo(void) -{ - XML_Expat_Version version; - - version.major = XML_MAJOR_VERSION; - version.minor = XML_MINOR_VERSION; - version.micro = XML_MICRO_VERSION; - - return version; -} - -const XML_Feature * -XML_GetFeatureList(void) -{ - static XML_Feature features[] = { - {XML_FEATURE_SIZEOF_XML_CHAR, XML_L("sizeof(XML_Char)")}, - {XML_FEATURE_SIZEOF_XML_LCHAR, XML_L("sizeof(XML_LChar)")}, -#ifdef XML_UNICODE - {XML_FEATURE_UNICODE, XML_L("XML_UNICODE")}, -#endif -#ifdef XML_UNICODE_WCHAR_T - {XML_FEATURE_UNICODE_WCHAR_T, XML_L("XML_UNICODE_WCHAR_T")}, -#endif -#ifdef XML_DTD - {XML_FEATURE_DTD, XML_L("XML_DTD")}, -#endif -#ifdef XML_CONTEXT_BYTES - {XML_FEATURE_CONTEXT_BYTES, XML_L("XML_CONTEXT_BYTES"), - XML_CONTEXT_BYTES}, -#endif -#ifdef XML_MIN_SIZE - {XML_FEATURE_MIN_SIZE, XML_L("XML_MIN_SIZE")}, -#endif - {XML_FEATURE_END, NULL} - }; - - features[0].value = sizeof(XML_Char); - features[1].value = sizeof(XML_LChar); - return features; -} - -/* Initially tag->rawName always points into the parse buffer; - for those TAG instances opened while the current parse buffer was - processed, and not yet closed, we need to store tag->rawName in a more - permanent location, since the parse buffer is about to be discarded. -*/ -static XML_Bool -storeRawNames(XML_Parser parser) -{ - TAG *tag = tagStack; - while (tag) { - int bufSize; - int nameLen = sizeof(XML_Char) * (tag->name.strLen + 1); - char *rawNameBuf = tag->buf + nameLen; - /* Stop if already stored. Since tagStack is a stack, we can stop - at the first entry that has already been copied; everything - below it in the stack is already been accounted for in a - previous call to this function. - */ - if (tag->rawName == rawNameBuf) - break; - /* For re-use purposes we need to ensure that the - size of tag->buf is a multiple of sizeof(XML_Char). - */ - bufSize = nameLen + ROUND_UP(tag->rawNameLength, sizeof(XML_Char)); - if (bufSize > tag->bufEnd - tag->buf) { - char *temp = (char *)REALLOC(tag->buf, bufSize); - if (temp == NULL) - return XML_FALSE; - /* if tag->name.str points to tag->buf (only when namespace - processing is off) then we have to update it - */ - if (tag->name.str == (XML_Char *)tag->buf) - tag->name.str = (XML_Char *)temp; - /* if tag->name.localPart is set (when namespace processing is on) - then update it as well, since it will always point into tag->buf - */ - if (tag->name.localPart) - tag->name.localPart = (XML_Char *)temp + (tag->name.localPart - - (XML_Char *)tag->buf); - tag->buf = temp; - tag->bufEnd = temp + bufSize; - rawNameBuf = temp + nameLen; - } - memcpy(rawNameBuf, tag->rawName, tag->rawNameLength); - tag->rawName = rawNameBuf; - tag = tag->parent; - } - return XML_TRUE; -} - -static enum XML_Error PTRCALL -contentProcessor(XML_Parser parser, - const char *start, - const char *end, - const char **endPtr) -{ - enum XML_Error result = - doContent(parser, 0, encoding, start, end, endPtr); - if (result != XML_ERROR_NONE) - return result; - if (!storeRawNames(parser)) - return XML_ERROR_NO_MEMORY; - return result; -} - -static enum XML_Error PTRCALL -externalEntityInitProcessor(XML_Parser parser, - const char *start, - const char *end, - const char **endPtr) -{ - enum XML_Error result = initializeEncoding(parser); - if (result != XML_ERROR_NONE) - return result; - processor = externalEntityInitProcessor2; - return externalEntityInitProcessor2(parser, start, end, endPtr); -} - -static enum XML_Error PTRCALL -externalEntityInitProcessor2(XML_Parser parser, - const char *start, - const char *end, - const char **endPtr) -{ - const char *next = start; /* XmlContentTok doesn't always set the last arg */ - int tok = XmlContentTok(encoding, start, end, &next); - switch (tok) { - case XML_TOK_BOM: - /* If we are at the end of the buffer, this would cause the next stage, - i.e. externalEntityInitProcessor3, to pass control directly to - doContent (by detecting XML_TOK_NONE) without processing any xml text - declaration - causing the error XML_ERROR_MISPLACED_XML_PI in doContent. - */ - if (next == end && endPtr) { - *endPtr = next; - return XML_ERROR_NONE; - } - start = next; - break; - case XML_TOK_PARTIAL: - if (endPtr) { - *endPtr = start; - return XML_ERROR_NONE; - } - eventPtr = start; - return XML_ERROR_UNCLOSED_TOKEN; - case XML_TOK_PARTIAL_CHAR: - if (endPtr) { - *endPtr = start; - return XML_ERROR_NONE; - } - eventPtr = start; - return XML_ERROR_PARTIAL_CHAR; - } - processor = externalEntityInitProcessor3; - return externalEntityInitProcessor3(parser, start, end, endPtr); -} - -static enum XML_Error PTRCALL -externalEntityInitProcessor3(XML_Parser parser, - const char *start, - const char *end, - const char **endPtr) -{ - const char *next = start; /* XmlContentTok doesn't always set the last arg */ - int tok = XmlContentTok(encoding, start, end, &next); - switch (tok) { - case XML_TOK_XML_DECL: - { - enum XML_Error result = processXmlDecl(parser, 1, start, next); - if (result != XML_ERROR_NONE) - return result; - start = next; - } - break; - case XML_TOK_PARTIAL: - if (endPtr) { - *endPtr = start; - return XML_ERROR_NONE; - } - eventPtr = start; - return XML_ERROR_UNCLOSED_TOKEN; - case XML_TOK_PARTIAL_CHAR: - if (endPtr) { - *endPtr = start; - return XML_ERROR_NONE; - } - eventPtr = start; - return XML_ERROR_PARTIAL_CHAR; - } - processor = externalEntityContentProcessor; - tagLevel = 1; - return externalEntityContentProcessor(parser, start, end, endPtr); -} - -static enum XML_Error PTRCALL -externalEntityContentProcessor(XML_Parser parser, - const char *start, - const char *end, - const char **endPtr) -{ - enum XML_Error result = - doContent(parser, 1, encoding, start, end, endPtr); - if (result != XML_ERROR_NONE) - return result; - if (!storeRawNames(parser)) - return XML_ERROR_NO_MEMORY; - return result; -} - -static enum XML_Error -doContent(XML_Parser parser, - int startTagLevel, - const ENCODING *enc, - const char *s, - const char *end, - const char **nextPtr) -{ - DTD * const dtd = _dtd; /* save one level of indirection */ - const char **eventPP; - const char **eventEndPP; - if (enc == encoding) { - eventPP = &eventPtr; - eventEndPP = &eventEndPtr; - } - else { - eventPP = &(openInternalEntities->internalEventPtr); - eventEndPP = &(openInternalEntities->internalEventEndPtr); - } - *eventPP = s; - for (;;) { - const char *next = s; /* XmlContentTok doesn't always set the last arg */ - int tok = XmlContentTok(enc, s, end, &next); - *eventEndPP = next; - switch (tok) { - case XML_TOK_TRAILING_CR: - if (nextPtr) { - *nextPtr = s; - return XML_ERROR_NONE; - } - *eventEndPP = end; - if (characterDataHandler) { - XML_Char c = 0xA; - characterDataHandler(handlerArg, &c, 1); - } - else if (defaultHandler) - reportDefault(parser, enc, s, end); - if (startTagLevel == 0) - return XML_ERROR_NO_ELEMENTS; - if (tagLevel != startTagLevel) - return XML_ERROR_ASYNC_ENTITY; - return XML_ERROR_NONE; - case XML_TOK_NONE: - if (nextPtr) { - *nextPtr = s; - return XML_ERROR_NONE; - } - if (startTagLevel > 0) { - if (tagLevel != startTagLevel) - return XML_ERROR_ASYNC_ENTITY; - return XML_ERROR_NONE; - } - return XML_ERROR_NO_ELEMENTS; - case XML_TOK_INVALID: - *eventPP = next; - return XML_ERROR_INVALID_TOKEN; - case XML_TOK_PARTIAL: - if (nextPtr) { - *nextPtr = s; - return XML_ERROR_NONE; - } - return XML_ERROR_UNCLOSED_TOKEN; - case XML_TOK_PARTIAL_CHAR: - if (nextPtr) { - *nextPtr = s; - return XML_ERROR_NONE; - } - return XML_ERROR_PARTIAL_CHAR; - case XML_TOK_ENTITY_REF: - { - const XML_Char *name; - ENTITY *entity; - XML_Char ch = (XML_Char) XmlPredefinedEntityName(enc, - s + enc->minBytesPerChar, - next - enc->minBytesPerChar); - if (ch) { - if (characterDataHandler) - characterDataHandler(handlerArg, &ch, 1); - else if (defaultHandler) - reportDefault(parser, enc, s, next); - break; - } - name = poolStoreString(&dtd->pool, enc, - s + enc->minBytesPerChar, - next - enc->minBytesPerChar); - if (!name) - return XML_ERROR_NO_MEMORY; - entity = (ENTITY *)lookup(&dtd->generalEntities, name, 0); - poolDiscard(&dtd->pool); - /* First, determine if a check for an existing declaration is needed; - if yes, check that the entity exists, and that it is internal, - otherwise call the skipped entity or default handler. - */ - if (!dtd->hasParamEntityRefs || dtd->standalone) { - if (!entity) - return XML_ERROR_UNDEFINED_ENTITY; - else if (!entity->is_internal) - return XML_ERROR_ENTITY_DECLARED_IN_PE; - } - else if (!entity) { - if (skippedEntityHandler) - skippedEntityHandler(handlerArg, name, 0); - else if (defaultHandler) - reportDefault(parser, enc, s, next); - break; - } - if (entity->open) - return XML_ERROR_RECURSIVE_ENTITY_REF; - if (entity->notation) - return XML_ERROR_BINARY_ENTITY_REF; - if (entity->textPtr) { - enum XML_Error result; - OPEN_INTERNAL_ENTITY openEntity; - if (!defaultExpandInternalEntities) { - if (skippedEntityHandler) - skippedEntityHandler(handlerArg, entity->name, 0); - else if (defaultHandler) - reportDefault(parser, enc, s, next); - break; - } - entity->open = XML_TRUE; - openEntity.next = openInternalEntities; - openInternalEntities = &openEntity; - openEntity.entity = entity; - openEntity.internalEventPtr = NULL; - openEntity.internalEventEndPtr = NULL; - result = doContent(parser, - tagLevel, - internalEncoding, - (char *)entity->textPtr, - (char *)(entity->textPtr + entity->textLen), - 0); - entity->open = XML_FALSE; - openInternalEntities = openEntity.next; - if (result) - return result; - } - else if (externalEntityRefHandler) { - const XML_Char *context; - entity->open = XML_TRUE; - context = getContext(parser); - entity->open = XML_FALSE; - if (!context) - return XML_ERROR_NO_MEMORY; - if (!externalEntityRefHandler((XML_Parser)externalEntityRefHandlerArg, - context, - entity->base, - entity->systemId, - entity->publicId)) - return XML_ERROR_EXTERNAL_ENTITY_HANDLING; - poolDiscard(&tempPool); - } - else if (defaultHandler) - reportDefault(parser, enc, s, next); - break; - } - case XML_TOK_START_TAG_NO_ATTS: - /* fall through */ - case XML_TOK_START_TAG_WITH_ATTS: - { - TAG *tag; - enum XML_Error result; - XML_Char *toPtr; - if (freeTagList) { - tag = freeTagList; - freeTagList = freeTagList->parent; - } - else { - tag = (TAG *)MALLOC(sizeof(TAG)); - if (!tag) - return XML_ERROR_NO_MEMORY; - tag->buf = (char *)MALLOC(INIT_TAG_BUF_SIZE); - if (!tag->buf) { - FREE(tag); - return XML_ERROR_NO_MEMORY; - } - tag->bufEnd = tag->buf + INIT_TAG_BUF_SIZE; - } - tag->bindings = NULL; - tag->parent = tagStack; - tagStack = tag; - tag->name.localPart = NULL; - tag->name.prefix = NULL; - tag->rawName = s + enc->minBytesPerChar; - tag->rawNameLength = XmlNameLength(enc, tag->rawName); - ++tagLevel; - { - const char *rawNameEnd = tag->rawName + tag->rawNameLength; - const char *fromPtr = tag->rawName; - toPtr = (XML_Char *)tag->buf; - for (;;) { - int bufSize; - int convLen; - XmlConvert(enc, - &fromPtr, rawNameEnd, - (ICHAR **)&toPtr, (ICHAR *)tag->bufEnd - 1); - convLen = toPtr - (XML_Char *)tag->buf; - if (fromPtr == rawNameEnd) { - tag->name.strLen = convLen; - break; - } - bufSize = (tag->bufEnd - tag->buf) << 1; - { - char *temp = (char *)REALLOC(tag->buf, bufSize); - if (temp == NULL) - return XML_ERROR_NO_MEMORY; - tag->buf = temp; - tag->bufEnd = temp + bufSize; - toPtr = (XML_Char *)temp + convLen; - } - } - } - tag->name.str = (XML_Char *)tag->buf; - *toPtr = XML_T('\0'); - result = storeAtts(parser, enc, s, &(tag->name), &(tag->bindings)); - if (result) - return result; - if (startElementHandler) - startElementHandler(handlerArg, tag->name.str, - (const XML_Char **)atts); - else if (defaultHandler) - reportDefault(parser, enc, s, next); - poolClear(&tempPool); - break; - } - case XML_TOK_EMPTY_ELEMENT_NO_ATTS: - /* fall through */ - case XML_TOK_EMPTY_ELEMENT_WITH_ATTS: - { - const char *rawName = s + enc->minBytesPerChar; - enum XML_Error result; - BINDING *bindings = NULL; - XML_Bool noElmHandlers = XML_TRUE; - TAG_NAME name; - name.str = poolStoreString(&tempPool, enc, rawName, - rawName + XmlNameLength(enc, rawName)); - if (!name.str) - return XML_ERROR_NO_MEMORY; - poolFinish(&tempPool); - result = storeAtts(parser, enc, s, &name, &bindings); - if (result) - return result; - poolFinish(&tempPool); - if (startElementHandler) { - startElementHandler(handlerArg, name.str, (const XML_Char **)atts); - noElmHandlers = XML_FALSE; - } - if (endElementHandler) { - if (startElementHandler) - *eventPP = *eventEndPP; - endElementHandler(handlerArg, name.str); - noElmHandlers = XML_FALSE; - } - if (noElmHandlers && defaultHandler) - reportDefault(parser, enc, s, next); - poolClear(&tempPool); - while (bindings) { - BINDING *b = bindings; - if (endNamespaceDeclHandler) - endNamespaceDeclHandler(handlerArg, b->prefix->name); - bindings = bindings->nextTagBinding; - b->nextTagBinding = freeBindingList; - freeBindingList = b; - b->prefix->binding = b->prevPrefixBinding; - } - } - if (tagLevel == 0) - return epilogProcessor(parser, next, end, nextPtr); - break; - case XML_TOK_END_TAG: - if (tagLevel == startTagLevel) - return XML_ERROR_ASYNC_ENTITY; - else { - int len; - const char *rawName; - TAG *tag = tagStack; - tagStack = tag->parent; - tag->parent = freeTagList; - freeTagList = tag; - rawName = s + enc->minBytesPerChar*2; - len = XmlNameLength(enc, rawName); - if (len != tag->rawNameLength - || memcmp(tag->rawName, rawName, len) != 0) { - *eventPP = rawName; - return XML_ERROR_TAG_MISMATCH; - } - --tagLevel; - if (endElementHandler) { - const XML_Char *localPart; - const XML_Char *prefix; - XML_Char *uri; - localPart = tag->name.localPart; - if (ns && localPart) { - /* localPart and prefix may have been overwritten in - tag->name.str, since this points to the binding->uri - buffer which gets re-used; so we have to add them again - */ - uri = (XML_Char *)tag->name.str + tag->name.uriLen; - /* don't need to check for space - already done in storeAtts() */ - while (*localPart) *uri++ = *localPart++; - prefix = (XML_Char *)tag->name.prefix; - if (ns_triplets && prefix) { - *uri++ = namespaceSeparator; - while (*prefix) *uri++ = *prefix++; - } - *uri = XML_T('\0'); - } - endElementHandler(handlerArg, tag->name.str); - } - else if (defaultHandler) - reportDefault(parser, enc, s, next); - while (tag->bindings) { - BINDING *b = tag->bindings; - if (endNamespaceDeclHandler) - endNamespaceDeclHandler(handlerArg, b->prefix->name); - tag->bindings = tag->bindings->nextTagBinding; - b->nextTagBinding = freeBindingList; - freeBindingList = b; - b->prefix->binding = b->prevPrefixBinding; - } - if (tagLevel == 0) - return epilogProcessor(parser, next, end, nextPtr); - } - break; - case XML_TOK_CHAR_REF: - { - int n = XmlCharRefNumber(enc, s); - if (n < 0) - return XML_ERROR_BAD_CHAR_REF; - if (characterDataHandler) { - XML_Char buf[XML_ENCODE_MAX]; - characterDataHandler(handlerArg, buf, XmlEncode(n, (ICHAR *)buf)); - } - else if (defaultHandler) - reportDefault(parser, enc, s, next); - } - break; - case XML_TOK_XML_DECL: - return XML_ERROR_MISPLACED_XML_PI; - case XML_TOK_DATA_NEWLINE: - if (characterDataHandler) { - XML_Char c = 0xA; - characterDataHandler(handlerArg, &c, 1); - } - else if (defaultHandler) - reportDefault(parser, enc, s, next); - break; - case XML_TOK_CDATA_SECT_OPEN: - { - enum XML_Error result; - if (startCdataSectionHandler) - startCdataSectionHandler(handlerArg); -#if 0 - /* Suppose you doing a transformation on a document that involves - changing only the character data. You set up a defaultHandler - and a characterDataHandler. The defaultHandler simply copies - characters through. The characterDataHandler does the - transformation and writes the characters out escaping them as - necessary. This case will fail to work if we leave out the - following two lines (because & and < inside CDATA sections will - be incorrectly escaped). - - However, now we have a start/endCdataSectionHandler, so it seems - easier to let the user deal with this. - */ - else if (characterDataHandler) - characterDataHandler(handlerArg, dataBuf, 0); -#endif - else if (defaultHandler) - reportDefault(parser, enc, s, next); - result = doCdataSection(parser, enc, &next, end, nextPtr); - if (!next) { - processor = cdataSectionProcessor; - return result; - } - } - break; - case XML_TOK_TRAILING_RSQB: - if (nextPtr) { - *nextPtr = s; - return XML_ERROR_NONE; - } - if (characterDataHandler) { - if (MUST_CONVERT(enc, s)) { - ICHAR *dataPtr = (ICHAR *)dataBuf; - XmlConvert(enc, &s, end, &dataPtr, (ICHAR *)dataBufEnd); - characterDataHandler(handlerArg, dataBuf, - dataPtr - (ICHAR *)dataBuf); - } - else - characterDataHandler(handlerArg, - (XML_Char *)s, - (XML_Char *)end - (XML_Char *)s); - } - else if (defaultHandler) - reportDefault(parser, enc, s, end); - if (startTagLevel == 0) { - *eventPP = end; - return XML_ERROR_NO_ELEMENTS; - } - if (tagLevel != startTagLevel) { - *eventPP = end; - return XML_ERROR_ASYNC_ENTITY; - } - return XML_ERROR_NONE; - case XML_TOK_DATA_CHARS: - if (characterDataHandler) { - if (MUST_CONVERT(enc, s)) { - for (;;) { - ICHAR *dataPtr = (ICHAR *)dataBuf; - XmlConvert(enc, &s, next, &dataPtr, (ICHAR *)dataBufEnd); - *eventEndPP = s; - characterDataHandler(handlerArg, dataBuf, - dataPtr - (ICHAR *)dataBuf); - if (s == next) - break; - *eventPP = s; - } - } - else - characterDataHandler(handlerArg, - (XML_Char *)s, - (XML_Char *)next - (XML_Char *)s); - } - else if (defaultHandler) - reportDefault(parser, enc, s, next); - break; - case XML_TOK_PI: - if (!reportProcessingInstruction(parser, enc, s, next)) - return XML_ERROR_NO_MEMORY; - break; - case XML_TOK_COMMENT: - if (!reportComment(parser, enc, s, next)) - return XML_ERROR_NO_MEMORY; - break; - default: - if (defaultHandler) - reportDefault(parser, enc, s, next); - break; - } - *eventPP = s = next; - } - /* not reached */ -} - -/* Precondition: all arguments must be non-NULL; - Purpose: - - normalize attributes - - check attributes for well-formedness - - generate namespace aware attribute names (URI, prefix) - - build list of attributes for startElementHandler - - default attributes - - process namespace declarations (check and report them) - - generate namespace aware element name (URI, prefix) -*/ -static enum XML_Error -storeAtts(XML_Parser parser, const ENCODING *enc, - const char *attStr, TAG_NAME *tagNamePtr, - BINDING **bindingsPtr) -{ - DTD * const dtd = _dtd; /* save one level of indirection */ - ELEMENT_TYPE *elementType = NULL; - int nDefaultAtts = 0; - const XML_Char **appAtts; /* the attribute list for the application */ - int attIndex = 0; - int prefixLen; - int i; - int n; - XML_Char *uri; - int nPrefixes = 0; - BINDING *binding; - const XML_Char *localPart; - - /* lookup the element type name */ - elementType = (ELEMENT_TYPE *)lookup(&dtd->elementTypes, tagNamePtr->str,0); - if (!elementType) { - const XML_Char *name = poolCopyString(&dtd->pool, tagNamePtr->str); - if (!name) - return XML_ERROR_NO_MEMORY; - elementType = (ELEMENT_TYPE *)lookup(&dtd->elementTypes, name, - sizeof(ELEMENT_TYPE)); - if (!elementType) - return XML_ERROR_NO_MEMORY; - if (ns && !setElementTypePrefix(parser, elementType)) - return XML_ERROR_NO_MEMORY; - } - nDefaultAtts = elementType->nDefaultAtts; - - /* get the attributes from the tokenizer */ - n = XmlGetAttributes(enc, attStr, attsSize, atts); - if (n + nDefaultAtts > attsSize) { - int oldAttsSize = attsSize; - ATTRIBUTE *temp; - attsSize = n + nDefaultAtts + INIT_ATTS_SIZE; - temp = (ATTRIBUTE *)REALLOC((void *)atts, attsSize * sizeof(ATTRIBUTE)); - if (temp == NULL) - return XML_ERROR_NO_MEMORY; - atts = temp; - if (n > oldAttsSize) - XmlGetAttributes(enc, attStr, n, atts); - } - - appAtts = (const XML_Char **)atts; - for (i = 0; i < n; i++) { - /* add the name and value to the attribute list */ - ATTRIBUTE_ID *attId = getAttributeId(parser, enc, atts[i].name, - atts[i].name - + XmlNameLength(enc, atts[i].name)); - if (!attId) - return XML_ERROR_NO_MEMORY; - /* detect duplicate attributes */ - if ((attId->name)[-1]) { - if (enc == encoding) - eventPtr = atts[i].name; - return XML_ERROR_DUPLICATE_ATTRIBUTE; - } - (attId->name)[-1] = 1; - appAtts[attIndex++] = attId->name; - if (!atts[i].normalized) { - enum XML_Error result; - XML_Bool isCdata = XML_TRUE; - - /* figure out whether declared as other than CDATA */ - if (attId->maybeTokenized) { - int j; - for (j = 0; j < nDefaultAtts; j++) { - if (attId == elementType->defaultAtts[j].id) { - isCdata = elementType->defaultAtts[j].isCdata; - break; - } - } - } - - /* normalize the attribute value */ - result = storeAttributeValue(parser, enc, isCdata, - atts[i].valuePtr, atts[i].valueEnd, - &tempPool); - if (result) - return result; - appAtts[attIndex] = poolStart(&tempPool); - poolFinish(&tempPool); - } - else { - /* the value did not need normalizing */ - appAtts[attIndex] = poolStoreString(&tempPool, enc, atts[i].valuePtr, - atts[i].valueEnd); - if (appAtts[attIndex] == 0) - return XML_ERROR_NO_MEMORY; - poolFinish(&tempPool); - } - /* handle prefixed attribute names */ - if (attId->prefix) { - if (attId->xmlns) { - /* deal with namespace declarations here */ - enum XML_Error result = addBinding(parser, attId->prefix, attId, - appAtts[attIndex], bindingsPtr); - if (result) - return result; - --attIndex; - } - else { - /* deal with other prefixed names later */ - attIndex++; - nPrefixes++; - (attId->name)[-1] = 2; - } - } - else - attIndex++; - } - - /* set-up for XML_GetSpecifiedAttributeCount and XML_GetIdAttributeIndex */ - nSpecifiedAtts = attIndex; - if (elementType->idAtt && (elementType->idAtt->name)[-1]) { - for (i = 0; i < attIndex; i += 2) - if (appAtts[i] == elementType->idAtt->name) { - idAttIndex = i; - break; - } - } - else - idAttIndex = -1; - - /* do attribute defaulting */ - for (i = 0; i < nDefaultAtts; i++) { - const DEFAULT_ATTRIBUTE *da = elementType->defaultAtts + i; - if (!(da->id->name)[-1] && da->value) { - if (da->id->prefix) { - if (da->id->xmlns) { - enum XML_Error result = addBinding(parser, da->id->prefix, da->id, - da->value, bindingsPtr); - if (result) - return result; - } - else { - (da->id->name)[-1] = 2; - nPrefixes++; - appAtts[attIndex++] = da->id->name; - appAtts[attIndex++] = da->value; - } - } - else { - (da->id->name)[-1] = 1; - appAtts[attIndex++] = da->id->name; - appAtts[attIndex++] = da->value; - } - } - } - appAtts[attIndex] = 0; - - i = 0; - if (nPrefixes) { - /* expand prefixed attribute names */ - for (; i < attIndex; i += 2) { - if (appAtts[i][-1] == 2) { - ATTRIBUTE_ID *id; - ((XML_Char *)(appAtts[i]))[-1] = 0; - id = (ATTRIBUTE_ID *)lookup(&dtd->attributeIds, appAtts[i], 0); - if (id->prefix->binding) { - int j; - const BINDING *b = id->prefix->binding; - const XML_Char *s = appAtts[i]; - for (j = 0; j < b->uriLen; j++) { - if (!poolAppendChar(&tempPool, b->uri[j])) - return XML_ERROR_NO_MEMORY; - } - while (*s++ != XML_T(':')) - ; - do { - if (!poolAppendChar(&tempPool, *s)) - return XML_ERROR_NO_MEMORY; - } while (*s++); - if (ns_triplets) { - tempPool.ptr[-1] = namespaceSeparator; - s = b->prefix->name; - do { - if (!poolAppendChar(&tempPool, *s)) - return XML_ERROR_NO_MEMORY; - } while (*s++); - } - - appAtts[i] = poolStart(&tempPool); - poolFinish(&tempPool); - } - if (!--nPrefixes) - break; - } - else - ((XML_Char *)(appAtts[i]))[-1] = 0; - } - } - /* clear the flags that say whether attributes were specified */ - for (; i < attIndex; i += 2) - ((XML_Char *)(appAtts[i]))[-1] = 0; - for (binding = *bindingsPtr; binding; binding = binding->nextTagBinding) - binding->attId->name[-1] = 0; - - /* expand the element type name */ - if (elementType->prefix) { - binding = elementType->prefix->binding; - if (!binding) - return XML_ERROR_NONE; - localPart = tagNamePtr->str; - while (*localPart++ != XML_T(':')) - ; - } - else if (dtd->defaultPrefix.binding) { - binding = dtd->defaultPrefix.binding; - localPart = tagNamePtr->str; - } - else - return XML_ERROR_NONE; - prefixLen = 0; - if (ns && ns_triplets && binding->prefix->name) { - for (; binding->prefix->name[prefixLen++];) - ; - } - tagNamePtr->localPart = localPart; - tagNamePtr->uriLen = binding->uriLen; - tagNamePtr->prefix = binding->prefix->name; - tagNamePtr->prefixLen = prefixLen; - for (i = 0; localPart[i++];) - ; - n = i + binding->uriLen + prefixLen; - if (n > binding->uriAlloc) { - TAG *p; - uri = (XML_Char *)MALLOC((n + EXPAND_SPARE) * sizeof(XML_Char)); - if (!uri) - return XML_ERROR_NO_MEMORY; - binding->uriAlloc = n + EXPAND_SPARE; - memcpy(uri, binding->uri, binding->uriLen * sizeof(XML_Char)); - for (p = tagStack; p; p = p->parent) - if (p->name.str == binding->uri) - p->name.str = uri; - FREE(binding->uri); - binding->uri = uri; - } - uri = binding->uri + binding->uriLen; - memcpy(uri, localPart, i * sizeof(XML_Char)); - if (prefixLen) { - uri = uri + (i - 1); - if (namespaceSeparator) { *(uri) = namespaceSeparator; } - memcpy(uri + 1, binding->prefix->name, prefixLen * sizeof(XML_Char)); - } - tagNamePtr->str = binding->uri; - return XML_ERROR_NONE; -} - -/* addBinding() overwrites the value of prefix->binding without checking. - Therefore one must keep track of the old value outside of addBinding(). -*/ -static enum XML_Error -addBinding(XML_Parser parser, PREFIX *prefix, const ATTRIBUTE_ID *attId, - const XML_Char *uri, BINDING **bindingsPtr) -{ - BINDING *b; - int len; - - /* empty string is only valid when there is no prefix per XML NS 1.0 */ - if (*uri == XML_T('\0') && prefix->name) - return XML_ERROR_SYNTAX; - - for (len = 0; uri[len]; len++) - ; - if (namespaceSeparator) - len++; - if (freeBindingList) { - b = freeBindingList; - if (len > b->uriAlloc) { - XML_Char *temp = (XML_Char *)REALLOC(b->uri, - sizeof(XML_Char) * (len + EXPAND_SPARE)); - if (temp == NULL) - return XML_ERROR_NO_MEMORY; - b->uri = temp; - b->uriAlloc = len + EXPAND_SPARE; - } - freeBindingList = b->nextTagBinding; - } - else { - b = (BINDING *)MALLOC(sizeof(BINDING)); - if (!b) - return XML_ERROR_NO_MEMORY; - b->uri = (XML_Char *)MALLOC(sizeof(XML_Char) * (len + EXPAND_SPARE)); - if (!b->uri) { - FREE(b); - return XML_ERROR_NO_MEMORY; - } - b->uriAlloc = len + EXPAND_SPARE; - } - b->uriLen = len; - memcpy(b->uri, uri, len * sizeof(XML_Char)); - if (namespaceSeparator) - b->uri[len - 1] = namespaceSeparator; - b->prefix = prefix; - b->attId = attId; - b->prevPrefixBinding = prefix->binding; - if (*uri == XML_T('\0') && prefix == &_dtd->defaultPrefix) - prefix->binding = NULL; - else - prefix->binding = b; - b->nextTagBinding = *bindingsPtr; - *bindingsPtr = b; - if (startNamespaceDeclHandler) - startNamespaceDeclHandler(handlerArg, prefix->name, - prefix->binding ? uri : 0); - return XML_ERROR_NONE; -} - -/* The idea here is to avoid using stack for each CDATA section when - the whole file is parsed with one call. -*/ -static enum XML_Error PTRCALL -cdataSectionProcessor(XML_Parser parser, - const char *start, - const char *end, - const char **endPtr) -{ - enum XML_Error result = doCdataSection(parser, encoding, &start, - end, endPtr); - if (start) { - if (parentParser) { /* we are parsing an external entity */ - processor = externalEntityContentProcessor; - return externalEntityContentProcessor(parser, start, end, endPtr); - } - else { - processor = contentProcessor; - return contentProcessor(parser, start, end, endPtr); - } - } - return result; -} - -/* startPtr gets set to non-null is the section is closed, and to null if - the section is not yet closed. -*/ -static enum XML_Error -doCdataSection(XML_Parser parser, - const ENCODING *enc, - const char **startPtr, - const char *end, - const char **nextPtr) -{ - const char *s = *startPtr; - const char **eventPP; - const char **eventEndPP; - if (enc == encoding) { - eventPP = &eventPtr; - *eventPP = s; - eventEndPP = &eventEndPtr; - } - else { - eventPP = &(openInternalEntities->internalEventPtr); - eventEndPP = &(openInternalEntities->internalEventEndPtr); - } - *eventPP = s; - *startPtr = NULL; - for (;;) { - const char *next; - int tok = XmlCdataSectionTok(enc, s, end, &next); - *eventEndPP = next; - switch (tok) { - case XML_TOK_CDATA_SECT_CLOSE: - if (endCdataSectionHandler) - endCdataSectionHandler(handlerArg); -#if 0 - /* see comment under XML_TOK_CDATA_SECT_OPEN */ - else if (characterDataHandler) - characterDataHandler(handlerArg, dataBuf, 0); -#endif - else if (defaultHandler) - reportDefault(parser, enc, s, next); - *startPtr = next; - return XML_ERROR_NONE; - case XML_TOK_DATA_NEWLINE: - if (characterDataHandler) { - XML_Char c = 0xA; - characterDataHandler(handlerArg, &c, 1); - } - else if (defaultHandler) - reportDefault(parser, enc, s, next); - break; - case XML_TOK_DATA_CHARS: - if (characterDataHandler) { - if (MUST_CONVERT(enc, s)) { - for (;;) { - ICHAR *dataPtr = (ICHAR *)dataBuf; - XmlConvert(enc, &s, next, &dataPtr, (ICHAR *)dataBufEnd); - *eventEndPP = next; - characterDataHandler(handlerArg, dataBuf, - dataPtr - (ICHAR *)dataBuf); - if (s == next) - break; - *eventPP = s; - } - } - else - characterDataHandler(handlerArg, - (XML_Char *)s, - (XML_Char *)next - (XML_Char *)s); - } - else if (defaultHandler) - reportDefault(parser, enc, s, next); - break; - case XML_TOK_INVALID: - *eventPP = next; - return XML_ERROR_INVALID_TOKEN; - case XML_TOK_PARTIAL_CHAR: - if (nextPtr) { - *nextPtr = s; - return XML_ERROR_NONE; - } - return XML_ERROR_PARTIAL_CHAR; - case XML_TOK_PARTIAL: - case XML_TOK_NONE: - if (nextPtr) { - *nextPtr = s; - return XML_ERROR_NONE; - } - return XML_ERROR_UNCLOSED_CDATA_SECTION; - default: - *eventPP = next; - return XML_ERROR_UNEXPECTED_STATE; - } - *eventPP = s = next; - } - /* not reached */ -} - -#ifdef XML_DTD - -/* The idea here is to avoid using stack for each IGNORE section when - the whole file is parsed with one call. -*/ -static enum XML_Error PTRCALL -ignoreSectionProcessor(XML_Parser parser, - const char *start, - const char *end, - const char **endPtr) -{ - enum XML_Error result = doIgnoreSection(parser, encoding, &start, - end, endPtr); - if (start) { - processor = prologProcessor; - return prologProcessor(parser, start, end, endPtr); - } - return result; -} - -/* startPtr gets set to non-null is the section is closed, and to null - if the section is not yet closed. -*/ -static enum XML_Error -doIgnoreSection(XML_Parser parser, - const ENCODING *enc, - const char **startPtr, - const char *end, - const char **nextPtr) -{ - const char *next; - int tok; - const char *s = *startPtr; - const char **eventPP; - const char **eventEndPP; - if (enc == encoding) { - eventPP = &eventPtr; - *eventPP = s; - eventEndPP = &eventEndPtr; - } - else { - eventPP = &(openInternalEntities->internalEventPtr); - eventEndPP = &(openInternalEntities->internalEventEndPtr); - } - *eventPP = s; - *startPtr = NULL; - tok = XmlIgnoreSectionTok(enc, s, end, &next); - *eventEndPP = next; - switch (tok) { - case XML_TOK_IGNORE_SECT: - if (defaultHandler) - reportDefault(parser, enc, s, next); - *startPtr = next; - return XML_ERROR_NONE; - case XML_TOK_INVALID: - *eventPP = next; - return XML_ERROR_INVALID_TOKEN; - case XML_TOK_PARTIAL_CHAR: - if (nextPtr) { - *nextPtr = s; - return XML_ERROR_NONE; - } - return XML_ERROR_PARTIAL_CHAR; - case XML_TOK_PARTIAL: - case XML_TOK_NONE: - if (nextPtr) { - *nextPtr = s; - return XML_ERROR_NONE; - } - return XML_ERROR_SYNTAX; /* XML_ERROR_UNCLOSED_IGNORE_SECTION */ - default: - *eventPP = next; - return XML_ERROR_UNEXPECTED_STATE; - } - /* not reached */ -} - -#endif /* XML_DTD */ - -static enum XML_Error -initializeEncoding(XML_Parser parser) -{ - const char *s; -#ifdef XML_UNICODE - char encodingBuf[128]; - if (!protocolEncodingName) - s = NULL; - else { - int i; - for (i = 0; protocolEncodingName[i]; i++) { - if (i == sizeof(encodingBuf) - 1 - || (protocolEncodingName[i] & ~0x7f) != 0) { - encodingBuf[0] = '\0'; - break; - } - encodingBuf[i] = (char)protocolEncodingName[i]; - } - encodingBuf[i] = '\0'; - s = encodingBuf; - } -#else - s = protocolEncodingName; -#endif - if ((ns ? XmlInitEncodingNS : XmlInitEncoding)(&initEncoding, &encoding, s)) - return XML_ERROR_NONE; - return handleUnknownEncoding(parser, protocolEncodingName); -} - -static enum XML_Error -processXmlDecl(XML_Parser parser, int isGeneralTextEntity, - const char *s, const char *next) -{ - const char *encodingName = NULL; - const XML_Char *storedEncName = NULL; - const ENCODING *newEncoding = NULL; - const char *version = NULL; - const char *versionend; - const XML_Char *storedversion = NULL; - int standalone = -1; - if (!(ns - ? XmlParseXmlDeclNS - : XmlParseXmlDecl)(isGeneralTextEntity, - encoding, - s, - next, - &eventPtr, - &version, - &versionend, - &encodingName, - &newEncoding, - &standalone)) - return XML_ERROR_SYNTAX; - if (!isGeneralTextEntity && standalone == 1) { - _dtd->standalone = XML_TRUE; -#ifdef XML_DTD - if (paramEntityParsing == XML_PARAM_ENTITY_PARSING_UNLESS_STANDALONE) - paramEntityParsing = XML_PARAM_ENTITY_PARSING_NEVER; -#endif /* XML_DTD */ - } - if (xmlDeclHandler) { - if (encodingName != NULL) { - storedEncName = poolStoreString(&temp2Pool, - encoding, - encodingName, - encodingName - + XmlNameLength(encoding, encodingName)); - if (!storedEncName) - return XML_ERROR_NO_MEMORY; - poolFinish(&temp2Pool); - } - if (version) { - storedversion = poolStoreString(&temp2Pool, - encoding, - version, - versionend - encoding->minBytesPerChar); - if (!storedversion) - return XML_ERROR_NO_MEMORY; - } - xmlDeclHandler(handlerArg, storedversion, storedEncName, standalone); - } - else if (defaultHandler) - reportDefault(parser, encoding, s, next); - if (protocolEncodingName == NULL) { - if (newEncoding) { - if (newEncoding->minBytesPerChar != encoding->minBytesPerChar) { - eventPtr = encodingName; - return XML_ERROR_INCORRECT_ENCODING; - } - encoding = newEncoding; - } - else if (encodingName) { - enum XML_Error result; - if (!storedEncName) { - storedEncName = poolStoreString( - &temp2Pool, encoding, encodingName, - encodingName + XmlNameLength(encoding, encodingName)); - if (!storedEncName) - return XML_ERROR_NO_MEMORY; - } - result = handleUnknownEncoding(parser, storedEncName); - poolClear(&temp2Pool); - if (result == XML_ERROR_UNKNOWN_ENCODING) - eventPtr = encodingName; - return result; - } - } - - if (storedEncName || storedversion) - poolClear(&temp2Pool); - - return XML_ERROR_NONE; -} - -static enum XML_Error -handleUnknownEncoding(XML_Parser parser, const XML_Char *encodingName) -{ - if (unknownEncodingHandler) { - XML_Encoding info; - int i; - for (i = 0; i < 256; i++) - info.map[i] = -1; - info.convert = NULL; - info.data = NULL; - info.release = NULL; - if (unknownEncodingHandler(unknownEncodingHandlerData, encodingName, - &info)) { - ENCODING *enc; - unknownEncodingMem = MALLOC(XmlSizeOfUnknownEncoding()); - if (!unknownEncodingMem) { - if (info.release) - info.release(info.data); - return XML_ERROR_NO_MEMORY; - } - enc = (ns - ? XmlInitUnknownEncodingNS - : XmlInitUnknownEncoding)(unknownEncodingMem, - info.map, - info.convert, - info.data); - if (enc) { - unknownEncodingData = info.data; - unknownEncodingRelease = info.release; - encoding = enc; - return XML_ERROR_NONE; - } - } - if (info.release != NULL) - info.release(info.data); - } - return XML_ERROR_UNKNOWN_ENCODING; -} - -static enum XML_Error PTRCALL -prologInitProcessor(XML_Parser parser, - const char *s, - const char *end, - const char **nextPtr) -{ - enum XML_Error result = initializeEncoding(parser); - if (result != XML_ERROR_NONE) - return result; - processor = prologProcessor; - return prologProcessor(parser, s, end, nextPtr); -} - -#ifdef XML_DTD - -static enum XML_Error PTRCALL -externalParEntInitProcessor(XML_Parser parser, - const char *s, - const char *end, - const char **nextPtr) -{ - enum XML_Error result = initializeEncoding(parser); - if (result != XML_ERROR_NONE) - return result; - - /* we know now that XML_Parse(Buffer) has been called, - so we consider the external parameter entity read */ - _dtd->paramEntityRead = XML_TRUE; - - if (prologState.inEntityValue) { - processor = entityValueInitProcessor; - return entityValueInitProcessor(parser, s, end, nextPtr); - } - else { - processor = externalParEntProcessor; - return externalParEntProcessor(parser, s, end, nextPtr); - } -} - -static enum XML_Error PTRCALL -entityValueInitProcessor(XML_Parser parser, - const char *s, - const char *end, - const char **nextPtr) -{ - const char *start = s; - const char *next = s; - int tok; - - for (;;) { - tok = XmlPrologTok(encoding, start, end, &next); - if (tok <= 0) { - if (nextPtr != 0 && tok != XML_TOK_INVALID) { - *nextPtr = s; - return XML_ERROR_NONE; - } - switch (tok) { - case XML_TOK_INVALID: - return XML_ERROR_INVALID_TOKEN; - case XML_TOK_PARTIAL: - return XML_ERROR_UNCLOSED_TOKEN; - case XML_TOK_PARTIAL_CHAR: - return XML_ERROR_PARTIAL_CHAR; - case XML_TOK_NONE: /* start == end */ - default: - break; - } - return storeEntityValue(parser, encoding, s, end); - } - else if (tok == XML_TOK_XML_DECL) { - enum XML_Error result = processXmlDecl(parser, 0, start, next); - if (result != XML_ERROR_NONE) - return result; - if (nextPtr) *nextPtr = next; - /* stop scanning for text declaration - we found one */ - processor = entityValueProcessor; - return entityValueProcessor(parser, next, end, nextPtr); - } - /* If we are at the end of the buffer, this would cause XmlPrologTok to - return XML_TOK_NONE on the next call, which would then cause the - function to exit with *nextPtr set to s - that is what we want for other - tokens, but not for the BOM - we would rather like to skip it; - then, when this routine is entered the next time, XmlPrologTok will - return XML_TOK_INVALID, since the BOM is still in the buffer - */ - else if (tok == XML_TOK_BOM && next == end && nextPtr) { - *nextPtr = next; - return XML_ERROR_NONE; - } - start = next; - } -} - -static enum XML_Error PTRCALL -externalParEntProcessor(XML_Parser parser, - const char *s, - const char *end, - const char **nextPtr) -{ - const char *start = s; - const char *next = s; - int tok; - - tok = XmlPrologTok(encoding, start, end, &next); - if (tok <= 0) { - if (nextPtr != 0 && tok != XML_TOK_INVALID) { - *nextPtr = s; - return XML_ERROR_NONE; - } - switch (tok) { - case XML_TOK_INVALID: - return XML_ERROR_INVALID_TOKEN; - case XML_TOK_PARTIAL: - return XML_ERROR_UNCLOSED_TOKEN; - case XML_TOK_PARTIAL_CHAR: - return XML_ERROR_PARTIAL_CHAR; - case XML_TOK_NONE: /* start == end */ - default: - break; - } - } - /* This would cause the next stage, i.e. doProlog to be passed XML_TOK_BOM. - However, when parsing an external subset, doProlog will not accept a BOM - as valid, and report a syntax error, so we have to skip the BOM - */ - else if (tok == XML_TOK_BOM) { - s = next; - tok = XmlPrologTok(encoding, s, end, &next); - } - - processor = prologProcessor; - return doProlog(parser, encoding, s, end, tok, next, nextPtr); -} - -static enum XML_Error PTRCALL -entityValueProcessor(XML_Parser parser, - const char *s, - const char *end, - const char **nextPtr) -{ - const char *start = s; - const char *next = s; - const ENCODING *enc = encoding; - int tok; - - for (;;) { - tok = XmlPrologTok(enc, start, end, &next); - if (tok <= 0) { - if (nextPtr != 0 && tok != XML_TOK_INVALID) { - *nextPtr = s; - return XML_ERROR_NONE; - } - switch (tok) { - case XML_TOK_INVALID: - return XML_ERROR_INVALID_TOKEN; - case XML_TOK_PARTIAL: - return XML_ERROR_UNCLOSED_TOKEN; - case XML_TOK_PARTIAL_CHAR: - return XML_ERROR_PARTIAL_CHAR; - case XML_TOK_NONE: /* start == end */ - default: - break; - } - return storeEntityValue(parser, enc, s, end); - } - start = next; - } -} - -#endif /* XML_DTD */ - -static enum XML_Error PTRCALL -prologProcessor(XML_Parser parser, - const char *s, - const char *end, - const char **nextPtr) -{ - const char *next = s; - int tok = XmlPrologTok(encoding, s, end, &next); - return doProlog(parser, encoding, s, end, tok, next, nextPtr); -} - -static enum XML_Error -doProlog(XML_Parser parser, - const ENCODING *enc, - const char *s, - const char *end, - int tok, - const char *next, - const char **nextPtr) -{ -#ifdef XML_DTD - static const XML_Char externalSubsetName[] = { '#' , '\0' }; -#endif /* XML_DTD */ - static const XML_Char atypeCDATA[] = { 'C', 'D', 'A', 'T', 'A', '\0' }; - static const XML_Char atypeID[] = { 'I', 'D', '\0' }; - static const XML_Char atypeIDREF[] = { 'I', 'D', 'R', 'E', 'F', '\0' }; - static const XML_Char atypeIDREFS[] = { 'I', 'D', 'R', 'E', 'F', 'S', '\0' }; - static const XML_Char atypeENTITY[] = { 'E', 'N', 'T', 'I', 'T', 'Y', '\0' }; - static const XML_Char atypeENTITIES[] = - { 'E', 'N', 'T', 'I', 'T', 'I', 'E', 'S', '\0' }; - static const XML_Char atypeNMTOKEN[] = { - 'N', 'M', 'T', 'O', 'K', 'E', 'N', '\0' }; - static const XML_Char atypeNMTOKENS[] = { - 'N', 'M', 'T', 'O', 'K', 'E', 'N', 'S', '\0' }; - static const XML_Char notationPrefix[] = { - 'N', 'O', 'T', 'A', 'T', 'I', 'O', 'N', '(', '\0' }; - static const XML_Char enumValueSep[] = { '|', '\0' }; - static const XML_Char enumValueStart[] = { '(', '\0' }; - - DTD * const dtd = _dtd; /* save one level of indirection */ - - const char **eventPP; - const char **eventEndPP; - enum XML_Content_Quant quant; - - if (enc == encoding) { - eventPP = &eventPtr; - eventEndPP = &eventEndPtr; - } - else { - eventPP = &(openInternalEntities->internalEventPtr); - eventEndPP = &(openInternalEntities->internalEventEndPtr); - } - for (;;) { - int role; - XML_Bool handleDefault = XML_TRUE; - *eventPP = s; - *eventEndPP = next; - if (tok <= 0) { - if (nextPtr != 0 && tok != XML_TOK_INVALID) { - *nextPtr = s; - return XML_ERROR_NONE; - } - switch (tok) { - case XML_TOK_INVALID: - *eventPP = next; - return XML_ERROR_INVALID_TOKEN; - case XML_TOK_PARTIAL: - return XML_ERROR_UNCLOSED_TOKEN; - case XML_TOK_PARTIAL_CHAR: - return XML_ERROR_PARTIAL_CHAR; - case XML_TOK_NONE: -#ifdef XML_DTD - if (enc != encoding) - return XML_ERROR_NONE; - if (isParamEntity) { - if (XmlTokenRole(&prologState, XML_TOK_NONE, end, end, enc) - == XML_ROLE_ERROR) - return XML_ERROR_SYNTAX; - return XML_ERROR_NONE; - } -#endif /* XML_DTD */ - return XML_ERROR_NO_ELEMENTS; - default: - tok = -tok; - next = end; - break; - } - } - role = XmlTokenRole(&prologState, tok, s, next, enc); - switch (role) { - case XML_ROLE_XML_DECL: - { - enum XML_Error result = processXmlDecl(parser, 0, s, next); - if (result != XML_ERROR_NONE) - return result; - enc = encoding; - handleDefault = XML_FALSE; - } - break; - case XML_ROLE_DOCTYPE_NAME: - if (startDoctypeDeclHandler) { - doctypeName = poolStoreString(&tempPool, enc, s, next); - if (!doctypeName) - return XML_ERROR_NO_MEMORY; - poolFinish(&tempPool); - doctypePubid = NULL; - handleDefault = XML_FALSE; - } - doctypeSysid = NULL; /* always initialize to NULL */ - break; - case XML_ROLE_DOCTYPE_INTERNAL_SUBSET: - if (startDoctypeDeclHandler) { - startDoctypeDeclHandler(handlerArg, doctypeName, doctypeSysid, - doctypePubid, 1); - doctypeName = NULL; - poolClear(&tempPool); - handleDefault = XML_FALSE; - } - break; -#ifdef XML_DTD - case XML_ROLE_TEXT_DECL: - { - enum XML_Error result = processXmlDecl(parser, 1, s, next); - if (result != XML_ERROR_NONE) - return result; - enc = encoding; - handleDefault = XML_FALSE; - } - break; -#endif /* XML_DTD */ - case XML_ROLE_DOCTYPE_PUBLIC_ID: -#ifdef XML_DTD - useForeignDTD = XML_FALSE; -#endif /* XML_DTD */ - dtd->hasParamEntityRefs = XML_TRUE; - if (startDoctypeDeclHandler) { - doctypePubid = poolStoreString(&tempPool, enc, - s + enc->minBytesPerChar, - next - enc->minBytesPerChar); - if (!doctypePubid) - return XML_ERROR_NO_MEMORY; - poolFinish(&tempPool); - handleDefault = XML_FALSE; - } -#ifdef XML_DTD - declEntity = (ENTITY *)lookup(&dtd->paramEntities, - externalSubsetName, - sizeof(ENTITY)); - if (!declEntity) - return XML_ERROR_NO_MEMORY; -#endif /* XML_DTD */ - /* fall through */ - case XML_ROLE_ENTITY_PUBLIC_ID: - if (!XmlIsPublicId(enc, s, next, eventPP)) - return XML_ERROR_SYNTAX; - if (dtd->keepProcessing && declEntity) { - XML_Char *tem = poolStoreString(&dtd->pool, - enc, - s + enc->minBytesPerChar, - next - enc->minBytesPerChar); - if (!tem) - return XML_ERROR_NO_MEMORY; - normalizePublicId(tem); - declEntity->publicId = tem; - poolFinish(&dtd->pool); - if (entityDeclHandler) - handleDefault = XML_FALSE; - } - break; - case XML_ROLE_DOCTYPE_CLOSE: - if (doctypeName) { - startDoctypeDeclHandler(handlerArg, doctypeName, - doctypeSysid, doctypePubid, 0); - poolClear(&tempPool); - handleDefault = XML_FALSE; - } - /* doctypeSysid will be non-NULL in the case of a previous - XML_ROLE_DOCTYPE_SYSTEM_ID, even if startDoctypeDeclHandler - was not set, indicating an external subset - */ -#ifdef XML_DTD - if (doctypeSysid || useForeignDTD) { - dtd->hasParamEntityRefs = XML_TRUE; /* when docTypeSysid == NULL */ - if (paramEntityParsing && externalEntityRefHandler) { - ENTITY *entity = (ENTITY *)lookup(&dtd->paramEntities, - externalSubsetName, - sizeof(ENTITY)); - if (!entity) - return XML_ERROR_NO_MEMORY; - if (useForeignDTD) - entity->base = curBase; - dtd->paramEntityRead = XML_FALSE; - if (!externalEntityRefHandler(externalEntityRefHandlerArg, - 0, - entity->base, - entity->systemId, - entity->publicId)) - return XML_ERROR_EXTERNAL_ENTITY_HANDLING; - if (dtd->paramEntityRead && - !dtd->standalone && - notStandaloneHandler && - !notStandaloneHandler(handlerArg)) - return XML_ERROR_NOT_STANDALONE; - /* end of DTD - no need to update dtd->keepProcessing */ - } - useForeignDTD = XML_FALSE; - } -#endif /* XML_DTD */ - if (endDoctypeDeclHandler) { - endDoctypeDeclHandler(handlerArg); - handleDefault = XML_FALSE; - } - break; - case XML_ROLE_INSTANCE_START: -#ifdef XML_DTD - /* if there is no DOCTYPE declaration then now is the - last chance to read the foreign DTD - */ - if (useForeignDTD) { - dtd->hasParamEntityRefs = XML_TRUE; - if (paramEntityParsing && externalEntityRefHandler) { - ENTITY *entity = (ENTITY *)lookup(&dtd->paramEntities, - externalSubsetName, - sizeof(ENTITY)); - if (!entity) - return XML_ERROR_NO_MEMORY; - entity->base = curBase; - dtd->paramEntityRead = XML_FALSE; - if (!externalEntityRefHandler(externalEntityRefHandlerArg, - 0, - entity->base, - entity->systemId, - entity->publicId)) - return XML_ERROR_EXTERNAL_ENTITY_HANDLING; - if (dtd->paramEntityRead && - !dtd->standalone && - notStandaloneHandler && - !notStandaloneHandler(handlerArg)) - return XML_ERROR_NOT_STANDALONE; - /* end of DTD - no need to update dtd->keepProcessing */ - } - } -#endif /* XML_DTD */ - processor = contentProcessor; - return contentProcessor(parser, s, end, nextPtr); - case XML_ROLE_ATTLIST_ELEMENT_NAME: - declElementType = getElementType(parser, enc, s, next); - if (!declElementType) - return XML_ERROR_NO_MEMORY; - goto checkAttListDeclHandler; - case XML_ROLE_ATTRIBUTE_NAME: - declAttributeId = getAttributeId(parser, enc, s, next); - if (!declAttributeId) - return XML_ERROR_NO_MEMORY; - declAttributeIsCdata = XML_FALSE; - declAttributeType = NULL; - declAttributeIsId = XML_FALSE; - goto checkAttListDeclHandler; - case XML_ROLE_ATTRIBUTE_TYPE_CDATA: - declAttributeIsCdata = XML_TRUE; - declAttributeType = atypeCDATA; - goto checkAttListDeclHandler; - case XML_ROLE_ATTRIBUTE_TYPE_ID: - declAttributeIsId = XML_TRUE; - declAttributeType = atypeID; - goto checkAttListDeclHandler; - case XML_ROLE_ATTRIBUTE_TYPE_IDREF: - declAttributeType = atypeIDREF; - goto checkAttListDeclHandler; - case XML_ROLE_ATTRIBUTE_TYPE_IDREFS: - declAttributeType = atypeIDREFS; - goto checkAttListDeclHandler; - case XML_ROLE_ATTRIBUTE_TYPE_ENTITY: - declAttributeType = atypeENTITY; - goto checkAttListDeclHandler; - case XML_ROLE_ATTRIBUTE_TYPE_ENTITIES: - declAttributeType = atypeENTITIES; - goto checkAttListDeclHandler; - case XML_ROLE_ATTRIBUTE_TYPE_NMTOKEN: - declAttributeType = atypeNMTOKEN; - goto checkAttListDeclHandler; - case XML_ROLE_ATTRIBUTE_TYPE_NMTOKENS: - declAttributeType = atypeNMTOKENS; - checkAttListDeclHandler: - if (dtd->keepProcessing && attlistDeclHandler) - handleDefault = XML_FALSE; - break; - case XML_ROLE_ATTRIBUTE_ENUM_VALUE: - case XML_ROLE_ATTRIBUTE_NOTATION_VALUE: - if (dtd->keepProcessing && attlistDeclHandler) { - const XML_Char *prefix; - if (declAttributeType) { - prefix = enumValueSep; - } - else { - prefix = (role == XML_ROLE_ATTRIBUTE_NOTATION_VALUE - ? notationPrefix - : enumValueStart); - } - if (!poolAppendString(&tempPool, prefix)) - return XML_ERROR_NO_MEMORY; - if (!poolAppend(&tempPool, enc, s, next)) - return XML_ERROR_NO_MEMORY; - declAttributeType = tempPool.start; - handleDefault = XML_FALSE; - } - break; - case XML_ROLE_IMPLIED_ATTRIBUTE_VALUE: - case XML_ROLE_REQUIRED_ATTRIBUTE_VALUE: - if (dtd->keepProcessing) { - if (!defineAttribute(declElementType, declAttributeId, - declAttributeIsCdata, declAttributeIsId, 0, - parser)) - return XML_ERROR_NO_MEMORY; - if (attlistDeclHandler && declAttributeType) { - if (*declAttributeType == XML_T('(') - || (*declAttributeType == XML_T('N') - && declAttributeType[1] == XML_T('O'))) { - /* Enumerated or Notation type */ - if (!poolAppendChar(&tempPool, XML_T(')')) - || !poolAppendChar(&tempPool, XML_T('\0'))) - return XML_ERROR_NO_MEMORY; - declAttributeType = tempPool.start; - poolFinish(&tempPool); - } - *eventEndPP = s; - attlistDeclHandler(handlerArg, declElementType->name, - declAttributeId->name, declAttributeType, - 0, role == XML_ROLE_REQUIRED_ATTRIBUTE_VALUE); - poolClear(&tempPool); - handleDefault = XML_FALSE; - } - } - break; - case XML_ROLE_DEFAULT_ATTRIBUTE_VALUE: - case XML_ROLE_FIXED_ATTRIBUTE_VALUE: - if (dtd->keepProcessing) { - const XML_Char *attVal; - enum XML_Error result - = storeAttributeValue(parser, enc, declAttributeIsCdata, - s + enc->minBytesPerChar, - next - enc->minBytesPerChar, - &dtd->pool); - if (result) - return result; - attVal = poolStart(&dtd->pool); - poolFinish(&dtd->pool); - /* ID attributes aren't allowed to have a default */ - if (!defineAttribute(declElementType, declAttributeId, - declAttributeIsCdata, XML_FALSE, attVal, parser)) - return XML_ERROR_NO_MEMORY; - if (attlistDeclHandler && declAttributeType) { - if (*declAttributeType == XML_T('(') - || (*declAttributeType == XML_T('N') - && declAttributeType[1] == XML_T('O'))) { - /* Enumerated or Notation type */ - if (!poolAppendChar(&tempPool, XML_T(')')) - || !poolAppendChar(&tempPool, XML_T('\0'))) - return XML_ERROR_NO_MEMORY; - declAttributeType = tempPool.start; - poolFinish(&tempPool); - } - *eventEndPP = s; - attlistDeclHandler(handlerArg, declElementType->name, - declAttributeId->name, declAttributeType, - attVal, - role == XML_ROLE_FIXED_ATTRIBUTE_VALUE); - poolClear(&tempPool); - handleDefault = XML_FALSE; - } - } - break; - case XML_ROLE_ENTITY_VALUE: - if (dtd->keepProcessing) { - enum XML_Error result = storeEntityValue(parser, enc, - s + enc->minBytesPerChar, - next - enc->minBytesPerChar); - if (declEntity) { - declEntity->textPtr = poolStart(&dtd->entityValuePool); - declEntity->textLen = poolLength(&dtd->entityValuePool); - poolFinish(&dtd->entityValuePool); - if (entityDeclHandler) { - *eventEndPP = s; - entityDeclHandler(handlerArg, - declEntity->name, - declEntity->is_param, - declEntity->textPtr, - declEntity->textLen, - curBase, 0, 0, 0); - handleDefault = XML_FALSE; - } - } - else - poolDiscard(&dtd->entityValuePool); - if (result != XML_ERROR_NONE) - return result; - } - break; - case XML_ROLE_DOCTYPE_SYSTEM_ID: -#ifdef XML_DTD - useForeignDTD = XML_FALSE; -#endif /* XML_DTD */ - dtd->hasParamEntityRefs = XML_TRUE; - if (startDoctypeDeclHandler) { - doctypeSysid = poolStoreString(&tempPool, enc, - s + enc->minBytesPerChar, - next - enc->minBytesPerChar); - if (doctypeSysid == NULL) - return XML_ERROR_NO_MEMORY; - poolFinish(&tempPool); - handleDefault = XML_FALSE; - } -#ifdef XML_DTD - else - /* use externalSubsetName to make doctypeSysid non-NULL - for the case where no startDoctypeDeclHandler is set */ - doctypeSysid = externalSubsetName; -#endif /* XML_DTD */ - if (!dtd->standalone -#ifdef XML_DTD - && !paramEntityParsing -#endif /* XML_DTD */ - && notStandaloneHandler - && !notStandaloneHandler(handlerArg)) - return XML_ERROR_NOT_STANDALONE; -#ifndef XML_DTD - break; -#else /* XML_DTD */ - if (!declEntity) { - declEntity = (ENTITY *)lookup(&dtd->paramEntities, - externalSubsetName, - sizeof(ENTITY)); - if (!declEntity) - return XML_ERROR_NO_MEMORY; - declEntity->publicId = NULL; - } - /* fall through */ -#endif /* XML_DTD */ - case XML_ROLE_ENTITY_SYSTEM_ID: - if (dtd->keepProcessing && declEntity) { - declEntity->systemId = poolStoreString(&dtd->pool, enc, - s + enc->minBytesPerChar, - next - enc->minBytesPerChar); - if (!declEntity->systemId) - return XML_ERROR_NO_MEMORY; - declEntity->base = curBase; - poolFinish(&dtd->pool); - if (entityDeclHandler) - handleDefault = XML_FALSE; - } - break; - case XML_ROLE_ENTITY_COMPLETE: - if (dtd->keepProcessing && declEntity && entityDeclHandler) { - *eventEndPP = s; - entityDeclHandler(handlerArg, - declEntity->name, - declEntity->is_param, - 0,0, - declEntity->base, - declEntity->systemId, - declEntity->publicId, - 0); - handleDefault = XML_FALSE; - } - break; - case XML_ROLE_ENTITY_NOTATION_NAME: - if (dtd->keepProcessing && declEntity) { - declEntity->notation = poolStoreString(&dtd->pool, enc, s, next); - if (!declEntity->notation) - return XML_ERROR_NO_MEMORY; - poolFinish(&dtd->pool); - if (unparsedEntityDeclHandler) { - *eventEndPP = s; - unparsedEntityDeclHandler(handlerArg, - declEntity->name, - declEntity->base, - declEntity->systemId, - declEntity->publicId, - declEntity->notation); - handleDefault = XML_FALSE; - } - else if (entityDeclHandler) { - *eventEndPP = s; - entityDeclHandler(handlerArg, - declEntity->name, - 0,0,0, - declEntity->base, - declEntity->systemId, - declEntity->publicId, - declEntity->notation); - handleDefault = XML_FALSE; - } - } - break; - case XML_ROLE_GENERAL_ENTITY_NAME: - { - if (XmlPredefinedEntityName(enc, s, next)) { - declEntity = NULL; - break; - } - if (dtd->keepProcessing) { - const XML_Char *name = poolStoreString(&dtd->pool, enc, s, next); - if (!name) - return XML_ERROR_NO_MEMORY; - declEntity = (ENTITY *)lookup(&dtd->generalEntities, name, - sizeof(ENTITY)); - if (!declEntity) - return XML_ERROR_NO_MEMORY; - if (declEntity->name != name) { - poolDiscard(&dtd->pool); - declEntity = NULL; - } - else { - poolFinish(&dtd->pool); - declEntity->publicId = NULL; - declEntity->is_param = XML_FALSE; - /* if we have a parent parser or are reading an internal parameter - entity, then the entity declaration is not considered "internal" - */ - declEntity->is_internal = !(parentParser || openInternalEntities); - if (entityDeclHandler) - handleDefault = XML_FALSE; - } - } - else { - poolDiscard(&dtd->pool); - declEntity = NULL; - } - } - break; - case XML_ROLE_PARAM_ENTITY_NAME: -#ifdef XML_DTD - if (dtd->keepProcessing) { - const XML_Char *name = poolStoreString(&dtd->pool, enc, s, next); - if (!name) - return XML_ERROR_NO_MEMORY; - declEntity = (ENTITY *)lookup(&dtd->paramEntities, - name, sizeof(ENTITY)); - if (!declEntity) - return XML_ERROR_NO_MEMORY; - if (declEntity->name != name) { - poolDiscard(&dtd->pool); - declEntity = NULL; - } - else { - poolFinish(&dtd->pool); - declEntity->publicId = NULL; - declEntity->is_param = XML_TRUE; - /* if we have a parent parser or are reading an internal parameter - entity, then the entity declaration is not considered "internal" - */ - declEntity->is_internal = !(parentParser || openInternalEntities); - if (entityDeclHandler) - handleDefault = XML_FALSE; - } - } - else { - poolDiscard(&dtd->pool); - declEntity = NULL; - } -#else /* not XML_DTD */ - declEntity = NULL; -#endif /* XML_DTD */ - break; - case XML_ROLE_NOTATION_NAME: - declNotationPublicId = NULL; - declNotationName = NULL; - if (notationDeclHandler) { - declNotationName = poolStoreString(&tempPool, enc, s, next); - if (!declNotationName) - return XML_ERROR_NO_MEMORY; - poolFinish(&tempPool); - handleDefault = XML_FALSE; - } - break; - case XML_ROLE_NOTATION_PUBLIC_ID: - if (!XmlIsPublicId(enc, s, next, eventPP)) - return XML_ERROR_SYNTAX; - if (declNotationName) { /* means notationDeclHandler != NULL */ - XML_Char *tem = poolStoreString(&tempPool, - enc, - s + enc->minBytesPerChar, - next - enc->minBytesPerChar); - if (!tem) - return XML_ERROR_NO_MEMORY; - normalizePublicId(tem); - declNotationPublicId = tem; - poolFinish(&tempPool); - handleDefault = XML_FALSE; - } - break; - case XML_ROLE_NOTATION_SYSTEM_ID: - if (declNotationName && notationDeclHandler) { - const XML_Char *systemId - = poolStoreString(&tempPool, enc, - s + enc->minBytesPerChar, - next - enc->minBytesPerChar); - if (!systemId) - return XML_ERROR_NO_MEMORY; - *eventEndPP = s; - notationDeclHandler(handlerArg, - declNotationName, - curBase, - systemId, - declNotationPublicId); - handleDefault = XML_FALSE; - } - poolClear(&tempPool); - break; - case XML_ROLE_NOTATION_NO_SYSTEM_ID: - if (declNotationPublicId && notationDeclHandler) { - *eventEndPP = s; - notationDeclHandler(handlerArg, - declNotationName, - curBase, - 0, - declNotationPublicId); - handleDefault = XML_FALSE; - } - poolClear(&tempPool); - break; - case XML_ROLE_ERROR: - switch (tok) { - case XML_TOK_PARAM_ENTITY_REF: - return XML_ERROR_PARAM_ENTITY_REF; - case XML_TOK_XML_DECL: - return XML_ERROR_MISPLACED_XML_PI; - default: - return XML_ERROR_SYNTAX; - } -#ifdef XML_DTD - case XML_ROLE_IGNORE_SECT: - { - enum XML_Error result; - if (defaultHandler) - reportDefault(parser, enc, s, next); - handleDefault = XML_FALSE; - result = doIgnoreSection(parser, enc, &next, end, nextPtr); - if (!next) { - processor = ignoreSectionProcessor; - return result; - } - } - break; -#endif /* XML_DTD */ - case XML_ROLE_GROUP_OPEN: - if (prologState.level >= groupSize) { - if (groupSize) { - char *temp = (char *)REALLOC(groupConnector, groupSize *= 2); - if (temp == NULL) - return XML_ERROR_NO_MEMORY; - groupConnector = temp; - if (dtd->scaffIndex) { - int *temp = (int *)REALLOC(dtd->scaffIndex, - groupSize * sizeof(int)); - if (temp == NULL) - return XML_ERROR_NO_MEMORY; - dtd->scaffIndex = temp; - } - } - else { - groupConnector = (char *)MALLOC(groupSize = 32); - if (!groupConnector) - return XML_ERROR_NO_MEMORY; - } - } - groupConnector[prologState.level] = 0; - if (dtd->in_eldecl) { - int myindex = nextScaffoldPart(parser); - if (myindex < 0) - return XML_ERROR_NO_MEMORY; - dtd->scaffIndex[dtd->scaffLevel] = myindex; - dtd->scaffLevel++; - dtd->scaffold[myindex].type = XML_CTYPE_SEQ; - if (elementDeclHandler) - handleDefault = XML_FALSE; - } - break; - case XML_ROLE_GROUP_SEQUENCE: - if (groupConnector[prologState.level] == '|') - return XML_ERROR_SYNTAX; - groupConnector[prologState.level] = ','; - if (dtd->in_eldecl && elementDeclHandler) - handleDefault = XML_FALSE; - break; - case XML_ROLE_GROUP_CHOICE: - if (groupConnector[prologState.level] == ',') - return XML_ERROR_SYNTAX; - if (dtd->in_eldecl - && !groupConnector[prologState.level] - && (dtd->scaffold[dtd->scaffIndex[dtd->scaffLevel - 1]].type - != XML_CTYPE_MIXED) - ) { - dtd->scaffold[dtd->scaffIndex[dtd->scaffLevel - 1]].type - = XML_CTYPE_CHOICE; - if (elementDeclHandler) - handleDefault = XML_FALSE; - } - groupConnector[prologState.level] = '|'; - break; - case XML_ROLE_PARAM_ENTITY_REF: -#ifdef XML_DTD - case XML_ROLE_INNER_PARAM_ENTITY_REF: - /* PE references in internal subset are - not allowed within declarations */ - if (prologState.documentEntity && - role == XML_ROLE_INNER_PARAM_ENTITY_REF) - return XML_ERROR_PARAM_ENTITY_REF; - dtd->hasParamEntityRefs = XML_TRUE; - if (!paramEntityParsing) - dtd->keepProcessing = dtd->standalone; - else { - const XML_Char *name; - ENTITY *entity; - name = poolStoreString(&dtd->pool, enc, - s + enc->minBytesPerChar, - next - enc->minBytesPerChar); - if (!name) - return XML_ERROR_NO_MEMORY; - entity = (ENTITY *)lookup(&dtd->paramEntities, name, 0); - poolDiscard(&dtd->pool); - /* first, determine if a check for an existing declaration is needed; - if yes, check that the entity exists, and that it is internal, - otherwise call the skipped entity handler - */ - if (prologState.documentEntity && - (dtd->standalone - ? !openInternalEntities - : !dtd->hasParamEntityRefs)) { - if (!entity) - return XML_ERROR_UNDEFINED_ENTITY; - else if (!entity->is_internal) - return XML_ERROR_ENTITY_DECLARED_IN_PE; - } - else if (!entity) { - dtd->keepProcessing = dtd->standalone; - /* cannot report skipped entities in declarations */ - if ((role == XML_ROLE_PARAM_ENTITY_REF) && skippedEntityHandler) { - skippedEntityHandler(handlerArg, name, 1); - handleDefault = XML_FALSE; - } - break; - } - if (entity->open) - return XML_ERROR_RECURSIVE_ENTITY_REF; - if (entity->textPtr) { - enum XML_Error result; - result = processInternalParamEntity(parser, entity); - if (result != XML_ERROR_NONE) - return result; - handleDefault = XML_FALSE; - break; - } - if (externalEntityRefHandler) { - dtd->paramEntityRead = XML_FALSE; - entity->open = XML_TRUE; - if (!externalEntityRefHandler(externalEntityRefHandlerArg, - 0, - entity->base, - entity->systemId, - entity->publicId)) { - entity->open = XML_FALSE; - return XML_ERROR_EXTERNAL_ENTITY_HANDLING; - } - entity->open = XML_FALSE; - handleDefault = XML_FALSE; - if (!dtd->paramEntityRead) { - dtd->keepProcessing = dtd->standalone; - break; - } - } - else { - dtd->keepProcessing = dtd->standalone; - break; - } - } -#endif /* XML_DTD */ - if (!dtd->standalone && - notStandaloneHandler && - !notStandaloneHandler(handlerArg)) - return XML_ERROR_NOT_STANDALONE; - break; - - /* Element declaration stuff */ - - case XML_ROLE_ELEMENT_NAME: - if (elementDeclHandler) { - declElementType = getElementType(parser, enc, s, next); - if (!declElementType) - return XML_ERROR_NO_MEMORY; - dtd->scaffLevel = 0; - dtd->scaffCount = 0; - dtd->in_eldecl = XML_TRUE; - handleDefault = XML_FALSE; - } - break; - - case XML_ROLE_CONTENT_ANY: - case XML_ROLE_CONTENT_EMPTY: - if (dtd->in_eldecl) { - if (elementDeclHandler) { - XML_Content * content = (XML_Content *) MALLOC(sizeof(XML_Content)); - if (!content) - return XML_ERROR_NO_MEMORY; - content->quant = XML_CQUANT_NONE; - content->name = NULL; - content->numchildren = 0; - content->children = NULL; - content->type = ((role == XML_ROLE_CONTENT_ANY) ? - XML_CTYPE_ANY : - XML_CTYPE_EMPTY); - *eventEndPP = s; - elementDeclHandler(handlerArg, declElementType->name, content); - handleDefault = XML_FALSE; - } - dtd->in_eldecl = XML_FALSE; - } - break; - - case XML_ROLE_CONTENT_PCDATA: - if (dtd->in_eldecl) { - dtd->scaffold[dtd->scaffIndex[dtd->scaffLevel - 1]].type - = XML_CTYPE_MIXED; - if (elementDeclHandler) - handleDefault = XML_FALSE; - } - break; - - case XML_ROLE_CONTENT_ELEMENT: - quant = XML_CQUANT_NONE; - goto elementContent; - case XML_ROLE_CONTENT_ELEMENT_OPT: - quant = XML_CQUANT_OPT; - goto elementContent; - case XML_ROLE_CONTENT_ELEMENT_REP: - quant = XML_CQUANT_REP; - goto elementContent; - case XML_ROLE_CONTENT_ELEMENT_PLUS: - quant = XML_CQUANT_PLUS; - elementContent: - if (dtd->in_eldecl) { - ELEMENT_TYPE *el; - const XML_Char *name; - int nameLen; - const char *nxt = (quant == XML_CQUANT_NONE - ? next - : next - enc->minBytesPerChar); - int myindex = nextScaffoldPart(parser); - if (myindex < 0) - return XML_ERROR_NO_MEMORY; - dtd->scaffold[myindex].type = XML_CTYPE_NAME; - dtd->scaffold[myindex].quant = quant; - el = getElementType(parser, enc, s, nxt); - if (!el) - return XML_ERROR_NO_MEMORY; - name = el->name; - dtd->scaffold[myindex].name = name; - nameLen = 0; - for (; name[nameLen++]; ) - ; - dtd->contentStringLen += nameLen; - if (elementDeclHandler) - handleDefault = XML_FALSE; - } - break; - - case XML_ROLE_GROUP_CLOSE: - quant = XML_CQUANT_NONE; - goto closeGroup; - case XML_ROLE_GROUP_CLOSE_OPT: - quant = XML_CQUANT_OPT; - goto closeGroup; - case XML_ROLE_GROUP_CLOSE_REP: - quant = XML_CQUANT_REP; - goto closeGroup; - case XML_ROLE_GROUP_CLOSE_PLUS: - quant = XML_CQUANT_PLUS; - closeGroup: - if (dtd->in_eldecl) { - if (elementDeclHandler) - handleDefault = XML_FALSE; - dtd->scaffLevel--; - dtd->scaffold[dtd->scaffIndex[dtd->scaffLevel]].quant = quant; - if (dtd->scaffLevel == 0) { - if (!handleDefault) { - XML_Content *model = build_model(parser); - if (!model) - return XML_ERROR_NO_MEMORY; - *eventEndPP = s; - elementDeclHandler(handlerArg, declElementType->name, model); - } - dtd->in_eldecl = XML_FALSE; - dtd->contentStringLen = 0; - } - } - break; - /* End element declaration stuff */ - - case XML_ROLE_PI: - if (!reportProcessingInstruction(parser, enc, s, next)) - return XML_ERROR_NO_MEMORY; - handleDefault = XML_FALSE; - break; - case XML_ROLE_COMMENT: - if (!reportComment(parser, enc, s, next)) - return XML_ERROR_NO_MEMORY; - handleDefault = XML_FALSE; - break; - case XML_ROLE_NONE: - switch (tok) { - case XML_TOK_BOM: - handleDefault = XML_FALSE; - break; - } - break; - case XML_ROLE_DOCTYPE_NONE: - if (startDoctypeDeclHandler) - handleDefault = XML_FALSE; - break; - case XML_ROLE_ENTITY_NONE: - if (dtd->keepProcessing && entityDeclHandler) - handleDefault = XML_FALSE; - break; - case XML_ROLE_NOTATION_NONE: - if (notationDeclHandler) - handleDefault = XML_FALSE; - break; - case XML_ROLE_ATTLIST_NONE: - if (dtd->keepProcessing && attlistDeclHandler) - handleDefault = XML_FALSE; - break; - case XML_ROLE_ELEMENT_NONE: - if (elementDeclHandler) - handleDefault = XML_FALSE; - break; - } /* end of big switch */ - - if (handleDefault && defaultHandler) - reportDefault(parser, enc, s, next); - - s = next; - tok = XmlPrologTok(enc, s, end, &next); - } - /* not reached */ -} - -static enum XML_Error PTRCALL -epilogProcessor(XML_Parser parser, - const char *s, - const char *end, - const char **nextPtr) -{ - processor = epilogProcessor; - eventPtr = s; - for (;;) { - const char *next = NULL; - int tok = XmlPrologTok(encoding, s, end, &next); - eventEndPtr = next; - switch (tok) { - /* report partial linebreak - it might be the last token */ - case -XML_TOK_PROLOG_S: - if (defaultHandler) { - eventEndPtr = next; - reportDefault(parser, encoding, s, next); - } - if (nextPtr) - *nextPtr = next; - return XML_ERROR_NONE; - case XML_TOK_NONE: - if (nextPtr) - *nextPtr = s; - return XML_ERROR_NONE; - case XML_TOK_PROLOG_S: - if (defaultHandler) - reportDefault(parser, encoding, s, next); - break; - case XML_TOK_PI: - if (!reportProcessingInstruction(parser, encoding, s, next)) - return XML_ERROR_NO_MEMORY; - break; - case XML_TOK_COMMENT: - if (!reportComment(parser, encoding, s, next)) - return XML_ERROR_NO_MEMORY; - break; - case XML_TOK_INVALID: - eventPtr = next; - return XML_ERROR_INVALID_TOKEN; - case XML_TOK_PARTIAL: - if (nextPtr) { - *nextPtr = s; - return XML_ERROR_NONE; - } - return XML_ERROR_UNCLOSED_TOKEN; - case XML_TOK_PARTIAL_CHAR: - if (nextPtr) { - *nextPtr = s; - return XML_ERROR_NONE; - } - return XML_ERROR_PARTIAL_CHAR; - default: - return XML_ERROR_JUNK_AFTER_DOC_ELEMENT; - } - eventPtr = s = next; - } -} - -#ifdef XML_DTD - -static enum XML_Error -processInternalParamEntity(XML_Parser parser, ENTITY *entity) -{ - const char *s, *end, *next; - int tok; - enum XML_Error result; - OPEN_INTERNAL_ENTITY openEntity; - entity->open = XML_TRUE; - openEntity.next = openInternalEntities; - openInternalEntities = &openEntity; - openEntity.entity = entity; - openEntity.internalEventPtr = NULL; - openEntity.internalEventEndPtr = NULL; - s = (char *)entity->textPtr; - end = (char *)(entity->textPtr + entity->textLen); - tok = XmlPrologTok(internalEncoding, s, end, &next); - result = doProlog(parser, internalEncoding, s, end, tok, next, 0); - entity->open = XML_FALSE; - openInternalEntities = openEntity.next; - return result; -} - -#endif /* XML_DTD */ - -static enum XML_Error PTRCALL -errorProcessor(XML_Parser parser, - const char *s, - const char *end, - const char **nextPtr) -{ - return errorCode; -} - -static enum XML_Error -storeAttributeValue(XML_Parser parser, const ENCODING *enc, XML_Bool isCdata, - const char *ptr, const char *end, - STRING_POOL *pool) -{ - enum XML_Error result = appendAttributeValue(parser, enc, isCdata, ptr, - end, pool); - if (result) - return result; - if (!isCdata && poolLength(pool) && poolLastChar(pool) == 0x20) - poolChop(pool); - if (!poolAppendChar(pool, XML_T('\0'))) - return XML_ERROR_NO_MEMORY; - return XML_ERROR_NONE; -} - -static enum XML_Error -appendAttributeValue(XML_Parser parser, const ENCODING *enc, XML_Bool isCdata, - const char *ptr, const char *end, - STRING_POOL *pool) -{ - DTD * const dtd = _dtd; /* save one level of indirection */ - for (;;) { - const char *next; - int tok = XmlAttributeValueTok(enc, ptr, end, &next); - switch (tok) { - case XML_TOK_NONE: - return XML_ERROR_NONE; - case XML_TOK_INVALID: - if (enc == encoding) - eventPtr = next; - return XML_ERROR_INVALID_TOKEN; - case XML_TOK_PARTIAL: - if (enc == encoding) - eventPtr = ptr; - return XML_ERROR_INVALID_TOKEN; - case XML_TOK_CHAR_REF: - { - XML_Char buf[XML_ENCODE_MAX]; - int i; - int n = XmlCharRefNumber(enc, ptr); - if (n < 0) { - if (enc == encoding) - eventPtr = ptr; - return XML_ERROR_BAD_CHAR_REF; - } - if (!isCdata - && n == 0x20 /* space */ - && (poolLength(pool) == 0 || poolLastChar(pool) == 0x20)) - break; - n = XmlEncode(n, (ICHAR *)buf); - if (!n) { - if (enc == encoding) - eventPtr = ptr; - return XML_ERROR_BAD_CHAR_REF; - } - for (i = 0; i < n; i++) { - if (!poolAppendChar(pool, buf[i])) - return XML_ERROR_NO_MEMORY; - } - } - break; - case XML_TOK_DATA_CHARS: - if (!poolAppend(pool, enc, ptr, next)) - return XML_ERROR_NO_MEMORY; - break; - case XML_TOK_TRAILING_CR: - next = ptr + enc->minBytesPerChar; - /* fall through */ - case XML_TOK_ATTRIBUTE_VALUE_S: - case XML_TOK_DATA_NEWLINE: - if (!isCdata && (poolLength(pool) == 0 || poolLastChar(pool) == 0x20)) - break; - if (!poolAppendChar(pool, 0x20)) - return XML_ERROR_NO_MEMORY; - break; - case XML_TOK_ENTITY_REF: - { - const XML_Char *name; - ENTITY *entity; - char checkEntityDecl; - XML_Char ch = (XML_Char) XmlPredefinedEntityName(enc, - ptr + enc->minBytesPerChar, - next - enc->minBytesPerChar); - if (ch) { - if (!poolAppendChar(pool, ch)) - return XML_ERROR_NO_MEMORY; - break; - } - name = poolStoreString(&temp2Pool, enc, - ptr + enc->minBytesPerChar, - next - enc->minBytesPerChar); - if (!name) - return XML_ERROR_NO_MEMORY; - entity = (ENTITY *)lookup(&dtd->generalEntities, name, 0); - poolDiscard(&temp2Pool); - /* first, determine if a check for an existing declaration is needed; - if yes, check that the entity exists, and that it is internal, - otherwise call the default handler (if called from content) - */ - if (pool == &dtd->pool) /* are we called from prolog? */ - checkEntityDecl = -#ifdef XML_DTD - prologState.documentEntity && -#endif /* XML_DTD */ - (dtd->standalone - ? !openInternalEntities - : !dtd->hasParamEntityRefs); - else /* if (pool == &tempPool): we are called from content */ - checkEntityDecl = !dtd->hasParamEntityRefs || dtd->standalone; - if (checkEntityDecl) { - if (!entity) - return XML_ERROR_UNDEFINED_ENTITY; - else if (!entity->is_internal) - return XML_ERROR_ENTITY_DECLARED_IN_PE; - } - else if (!entity) { - /* cannot report skipped entity here - see comments on - skippedEntityHandler - if (skippedEntityHandler) - skippedEntityHandler(handlerArg, name, 0); - */ - if ((pool == &tempPool) && defaultHandler) - reportDefault(parser, enc, ptr, next); - break; - } - if (entity->open) { - if (enc == encoding) - eventPtr = ptr; - return XML_ERROR_RECURSIVE_ENTITY_REF; - } - if (entity->notation) { - if (enc == encoding) - eventPtr = ptr; - return XML_ERROR_BINARY_ENTITY_REF; - } - if (!entity->textPtr) { - if (enc == encoding) - eventPtr = ptr; - return XML_ERROR_ATTRIBUTE_EXTERNAL_ENTITY_REF; - } - else { - enum XML_Error result; - const XML_Char *textEnd = entity->textPtr + entity->textLen; - entity->open = XML_TRUE; - result = appendAttributeValue(parser, internalEncoding, isCdata, - (char *)entity->textPtr, - (char *)textEnd, pool); - entity->open = XML_FALSE; - if (result) - return result; - } - } - break; - default: - if (enc == encoding) - eventPtr = ptr; - return XML_ERROR_UNEXPECTED_STATE; - } - ptr = next; - } - /* not reached */ -} - -static enum XML_Error -storeEntityValue(XML_Parser parser, - const ENCODING *enc, - const char *entityTextPtr, - const char *entityTextEnd) -{ - DTD * const dtd = _dtd; /* save one level of indirection */ - STRING_POOL *pool = &(dtd->entityValuePool); - enum XML_Error result = XML_ERROR_NONE; -#ifdef XML_DTD - int oldInEntityValue = prologState.inEntityValue; - prologState.inEntityValue = 1; -#endif /* XML_DTD */ - /* never return Null for the value argument in EntityDeclHandler, - since this would indicate an external entity; therefore we - have to make sure that entityValuePool.start is not null */ - if (!pool->blocks) { - if (!poolGrow(pool)) - return XML_ERROR_NO_MEMORY; - } - - for (;;) { - const char *next; - int tok = XmlEntityValueTok(enc, entityTextPtr, entityTextEnd, &next); - switch (tok) { - case XML_TOK_PARAM_ENTITY_REF: -#ifdef XML_DTD - if (isParamEntity || enc != encoding) { - const XML_Char *name; - ENTITY *entity; - name = poolStoreString(&tempPool, enc, - entityTextPtr + enc->minBytesPerChar, - next - enc->minBytesPerChar); - if (!name) { - result = XML_ERROR_NO_MEMORY; - goto endEntityValue; - } - entity = (ENTITY *)lookup(&dtd->paramEntities, name, 0); - poolDiscard(&tempPool); - if (!entity) { - /* not a well-formedness error - see XML 1.0: WFC Entity Declared */ - /* cannot report skipped entity here - see comments on - skippedEntityHandler - if (skippedEntityHandler) - skippedEntityHandler(handlerArg, name, 0); - */ - dtd->keepProcessing = dtd->standalone; - goto endEntityValue; - } - if (entity->open) { - if (enc == encoding) - eventPtr = entityTextPtr; - result = XML_ERROR_RECURSIVE_ENTITY_REF; - goto endEntityValue; - } - if (entity->systemId) { - if (externalEntityRefHandler) { - dtd->paramEntityRead = XML_FALSE; - entity->open = XML_TRUE; - if (!externalEntityRefHandler(externalEntityRefHandlerArg, - 0, - entity->base, - entity->systemId, - entity->publicId)) { - entity->open = XML_FALSE; - result = XML_ERROR_EXTERNAL_ENTITY_HANDLING; - goto endEntityValue; - } - entity->open = XML_FALSE; - if (!dtd->paramEntityRead) - dtd->keepProcessing = dtd->standalone; - } - else - dtd->keepProcessing = dtd->standalone; - } - else { - entity->open = XML_TRUE; - result = storeEntityValue(parser, - internalEncoding, - (char *)entity->textPtr, - (char *)(entity->textPtr - + entity->textLen)); - entity->open = XML_FALSE; - if (result) - goto endEntityValue; - } - break; - } -#endif /* XML_DTD */ - /* in the internal subset, PE references are not legal - within markup declarations, e.g entity values in this case */ - eventPtr = entityTextPtr; - result = XML_ERROR_PARAM_ENTITY_REF; - goto endEntityValue; - case XML_TOK_NONE: - result = XML_ERROR_NONE; - goto endEntityValue; - case XML_TOK_ENTITY_REF: - case XML_TOK_DATA_CHARS: - if (!poolAppend(pool, enc, entityTextPtr, next)) { - result = XML_ERROR_NO_MEMORY; - goto endEntityValue; - } - break; - case XML_TOK_TRAILING_CR: - next = entityTextPtr + enc->minBytesPerChar; - /* fall through */ - case XML_TOK_DATA_NEWLINE: - if (pool->end == pool->ptr && !poolGrow(pool)) { - result = XML_ERROR_NO_MEMORY; - goto endEntityValue; - } - *(pool->ptr)++ = 0xA; - break; - case XML_TOK_CHAR_REF: - { - XML_Char buf[XML_ENCODE_MAX]; - int i; - int n = XmlCharRefNumber(enc, entityTextPtr); - if (n < 0) { - if (enc == encoding) - eventPtr = entityTextPtr; - result = XML_ERROR_BAD_CHAR_REF; - goto endEntityValue; - } - n = XmlEncode(n, (ICHAR *)buf); - if (!n) { - if (enc == encoding) - eventPtr = entityTextPtr; - result = XML_ERROR_BAD_CHAR_REF; - goto endEntityValue; - } - for (i = 0; i < n; i++) { - if (pool->end == pool->ptr && !poolGrow(pool)) { - result = XML_ERROR_NO_MEMORY; - goto endEntityValue; - } - *(pool->ptr)++ = buf[i]; - } - } - break; - case XML_TOK_PARTIAL: - if (enc == encoding) - eventPtr = entityTextPtr; - result = XML_ERROR_INVALID_TOKEN; - goto endEntityValue; - case XML_TOK_INVALID: - if (enc == encoding) - eventPtr = next; - result = XML_ERROR_INVALID_TOKEN; - goto endEntityValue; - default: - if (enc == encoding) - eventPtr = entityTextPtr; - result = XML_ERROR_UNEXPECTED_STATE; - goto endEntityValue; - } - entityTextPtr = next; - } -endEntityValue: -#ifdef XML_DTD - prologState.inEntityValue = oldInEntityValue; -#endif /* XML_DTD */ - return result; -} - -static void FASTCALL -normalizeLines(XML_Char *s) -{ - XML_Char *p; - for (;; s++) { - if (*s == XML_T('\0')) - return; - if (*s == 0xD) - break; - } - p = s; - do { - if (*s == 0xD) { - *p++ = 0xA; - if (*++s == 0xA) - s++; - } - else - *p++ = *s++; - } while (*s); - *p = XML_T('\0'); -} - -static int -reportProcessingInstruction(XML_Parser parser, const ENCODING *enc, - const char *start, const char *end) -{ - const XML_Char *target; - XML_Char *data; - const char *tem; - if (!processingInstructionHandler) { - if (defaultHandler) - reportDefault(parser, enc, start, end); - return 1; - } - start += enc->minBytesPerChar * 2; - tem = start + XmlNameLength(enc, start); - target = poolStoreString(&tempPool, enc, start, tem); - if (!target) - return 0; - poolFinish(&tempPool); - data = poolStoreString(&tempPool, enc, - XmlSkipS(enc, tem), - end - enc->minBytesPerChar*2); - if (!data) - return 0; - normalizeLines(data); - processingInstructionHandler(handlerArg, target, data); - poolClear(&tempPool); - return 1; -} - -static int -reportComment(XML_Parser parser, const ENCODING *enc, - const char *start, const char *end) -{ - XML_Char *data; - if (!commentHandler) { - if (defaultHandler) - reportDefault(parser, enc, start, end); - return 1; - } - data = poolStoreString(&tempPool, - enc, - start + enc->minBytesPerChar * 4, - end - enc->minBytesPerChar * 3); - if (!data) - return 0; - normalizeLines(data); - commentHandler(handlerArg, data); - poolClear(&tempPool); - return 1; -} - -static void -reportDefault(XML_Parser parser, const ENCODING *enc, - const char *s, const char *end) -{ - if (MUST_CONVERT(enc, s)) { - const char **eventPP; - const char **eventEndPP; - if (enc == encoding) { - eventPP = &eventPtr; - eventEndPP = &eventEndPtr; - } - else { - eventPP = &(openInternalEntities->internalEventPtr); - eventEndPP = &(openInternalEntities->internalEventEndPtr); - } - do { - ICHAR *dataPtr = (ICHAR *)dataBuf; - XmlConvert(enc, &s, end, &dataPtr, (ICHAR *)dataBufEnd); - *eventEndPP = s; - defaultHandler(handlerArg, dataBuf, dataPtr - (ICHAR *)dataBuf); - *eventPP = s; - } while (s != end); - } - else - defaultHandler(handlerArg, (XML_Char *)s, (XML_Char *)end - (XML_Char *)s); -} - - -static int -defineAttribute(ELEMENT_TYPE *type, ATTRIBUTE_ID *attId, XML_Bool isCdata, - XML_Bool isId, const XML_Char *value, XML_Parser parser) -{ - DEFAULT_ATTRIBUTE *att; - if (value || isId) { - /* The handling of default attributes gets messed up if we have - a default which duplicates a non-default. */ - int i; - for (i = 0; i < type->nDefaultAtts; i++) - if (attId == type->defaultAtts[i].id) - return 1; - if (isId && !type->idAtt && !attId->xmlns) - type->idAtt = attId; - } - if (type->nDefaultAtts == type->allocDefaultAtts) { - if (type->allocDefaultAtts == 0) { - type->allocDefaultAtts = 8; - type->defaultAtts = (DEFAULT_ATTRIBUTE *)MALLOC(type->allocDefaultAtts - * sizeof(DEFAULT_ATTRIBUTE)); - if (!type->defaultAtts) - return 0; - } - else { - DEFAULT_ATTRIBUTE *temp; - int count = type->allocDefaultAtts * 2; - temp = (DEFAULT_ATTRIBUTE *) - REALLOC(type->defaultAtts, (count * sizeof(DEFAULT_ATTRIBUTE))); - if (temp == NULL) - return 0; - type->allocDefaultAtts = count; - type->defaultAtts = temp; - } - } - att = type->defaultAtts + type->nDefaultAtts; - att->id = attId; - att->value = value; - att->isCdata = isCdata; - if (!isCdata) - attId->maybeTokenized = XML_TRUE; - type->nDefaultAtts += 1; - return 1; -} - -static int -setElementTypePrefix(XML_Parser parser, ELEMENT_TYPE *elementType) -{ - DTD * const dtd = _dtd; /* save one level of indirection */ - const XML_Char *name; - for (name = elementType->name; *name; name++) { - if (*name == XML_T(':')) { - PREFIX *prefix; - const XML_Char *s; - for (s = elementType->name; s != name; s++) { - if (!poolAppendChar(&dtd->pool, *s)) - return 0; - } - if (!poolAppendChar(&dtd->pool, XML_T('\0'))) - return 0; - prefix = (PREFIX *)lookup(&dtd->prefixes, poolStart(&dtd->pool), - sizeof(PREFIX)); - if (!prefix) - return 0; - if (prefix->name == poolStart(&dtd->pool)) - poolFinish(&dtd->pool); - else - poolDiscard(&dtd->pool); - elementType->prefix = prefix; - - } - } - return 1; -} - -static ATTRIBUTE_ID * -getAttributeId(XML_Parser parser, const ENCODING *enc, - const char *start, const char *end) -{ - DTD * const dtd = _dtd; /* save one level of indirection */ - ATTRIBUTE_ID *id; - const XML_Char *name; - if (!poolAppendChar(&dtd->pool, XML_T('\0'))) - return NULL; - name = poolStoreString(&dtd->pool, enc, start, end); - if (!name) - return NULL; - ++name; - id = (ATTRIBUTE_ID *)lookup(&dtd->attributeIds, name, sizeof(ATTRIBUTE_ID)); - if (!id) - return NULL; - if (id->name != name) - poolDiscard(&dtd->pool); - else { - poolFinish(&dtd->pool); - if (!ns) - ; - else if (name[0] == XML_T('x') - && name[1] == XML_T('m') - && name[2] == XML_T('l') - && name[3] == XML_T('n') - && name[4] == XML_T('s') - && (name[5] == XML_T('\0') || name[5] == XML_T(':'))) { - if (name[5] == XML_T('\0')) - id->prefix = &dtd->defaultPrefix; - else - id->prefix = (PREFIX *)lookup(&dtd->prefixes, name + 6, sizeof(PREFIX)); - id->xmlns = XML_TRUE; - } - else { - int i; - for (i = 0; name[i]; i++) { - if (name[i] == XML_T(':')) { - int j; - for (j = 0; j < i; j++) { - if (!poolAppendChar(&dtd->pool, name[j])) - return NULL; - } - if (!poolAppendChar(&dtd->pool, XML_T('\0'))) - return NULL; - id->prefix = (PREFIX *)lookup(&dtd->prefixes, poolStart(&dtd->pool), - sizeof(PREFIX)); - if (id->prefix->name == poolStart(&dtd->pool)) - poolFinish(&dtd->pool); - else - poolDiscard(&dtd->pool); - break; - } - } - } - } - return id; -} - -#define CONTEXT_SEP XML_T('\f') - -static const XML_Char * -getContext(XML_Parser parser) -{ - DTD * const dtd = _dtd; /* save one level of indirection */ - HASH_TABLE_ITER iter; - XML_Bool needSep = XML_FALSE; - - if (dtd->defaultPrefix.binding) { - int i; - int len; - if (!poolAppendChar(&tempPool, XML_T('='))) - return NULL; - len = dtd->defaultPrefix.binding->uriLen; - if (namespaceSeparator != XML_T('\0')) - len--; - for (i = 0; i < len; i++) - if (!poolAppendChar(&tempPool, dtd->defaultPrefix.binding->uri[i])) - return NULL; - needSep = XML_TRUE; - } - - hashTableIterInit(&iter, &(dtd->prefixes)); - for (;;) { - int i; - int len; - const XML_Char *s; - PREFIX *prefix = (PREFIX *)hashTableIterNext(&iter); - if (!prefix) - break; - if (!prefix->binding) - continue; - if (needSep && !poolAppendChar(&tempPool, CONTEXT_SEP)) - return NULL; - for (s = prefix->name; *s; s++) - if (!poolAppendChar(&tempPool, *s)) - return NULL; - if (!poolAppendChar(&tempPool, XML_T('='))) - return NULL; - len = prefix->binding->uriLen; - if (namespaceSeparator != XML_T('\0')) - len--; - for (i = 0; i < len; i++) - if (!poolAppendChar(&tempPool, prefix->binding->uri[i])) - return NULL; - needSep = XML_TRUE; - } - - - hashTableIterInit(&iter, &(dtd->generalEntities)); - for (;;) { - const XML_Char *s; - ENTITY *e = (ENTITY *)hashTableIterNext(&iter); - if (!e) - break; - if (!e->open) - continue; - if (needSep && !poolAppendChar(&tempPool, CONTEXT_SEP)) - return NULL; - for (s = e->name; *s; s++) - if (!poolAppendChar(&tempPool, *s)) - return 0; - needSep = XML_TRUE; - } - - if (!poolAppendChar(&tempPool, XML_T('\0'))) - return NULL; - return tempPool.start; -} - -static XML_Bool -setContext(XML_Parser parser, const XML_Char *context) -{ - DTD * const dtd = _dtd; /* save one level of indirection */ - const XML_Char *s = context; - - while (*context != XML_T('\0')) { - if (*s == CONTEXT_SEP || *s == XML_T('\0')) { - ENTITY *e; - if (!poolAppendChar(&tempPool, XML_T('\0'))) - return XML_FALSE; - e = (ENTITY *)lookup(&dtd->generalEntities, poolStart(&tempPool), 0); - if (e) - e->open = XML_TRUE; - if (*s != XML_T('\0')) - s++; - context = s; - poolDiscard(&tempPool); - } - else if (*s == XML_T('=')) { - PREFIX *prefix; - if (poolLength(&tempPool) == 0) - prefix = &dtd->defaultPrefix; - else { - if (!poolAppendChar(&tempPool, XML_T('\0'))) - return XML_FALSE; - prefix = (PREFIX *)lookup(&dtd->prefixes, poolStart(&tempPool), - sizeof(PREFIX)); - if (!prefix) - return XML_FALSE; - if (prefix->name == poolStart(&tempPool)) { - prefix->name = poolCopyString(&dtd->pool, prefix->name); - if (!prefix->name) - return XML_FALSE; - } - poolDiscard(&tempPool); - } - for (context = s + 1; - *context != CONTEXT_SEP && *context != XML_T('\0'); - context++) - if (!poolAppendChar(&tempPool, *context)) - return XML_FALSE; - if (!poolAppendChar(&tempPool, XML_T('\0'))) - return XML_FALSE; - if (addBinding(parser, prefix, 0, poolStart(&tempPool), - &inheritedBindings) != XML_ERROR_NONE) - return XML_FALSE; - poolDiscard(&tempPool); - if (*context != XML_T('\0')) - ++context; - s = context; - } - else { - if (!poolAppendChar(&tempPool, *s)) - return XML_FALSE; - s++; - } - } - return XML_TRUE; -} - -static void FASTCALL -normalizePublicId(XML_Char *publicId) -{ - XML_Char *p = publicId; - XML_Char *s; - for (s = publicId; *s; s++) { - switch (*s) { - case 0x20: - case 0xD: - case 0xA: - if (p != publicId && p[-1] != 0x20) - *p++ = 0x20; - break; - default: - *p++ = *s; - } - } - if (p != publicId && p[-1] == 0x20) - --p; - *p = XML_T('\0'); -} - -static DTD * -dtdCreate(const XML_Memory_Handling_Suite *ms) -{ - DTD *p = (DTD *)ms->malloc_fcn(sizeof(DTD)); - if (p == NULL) - return p; - poolInit(&(p->pool), ms); -#ifdef XML_DTD - poolInit(&(p->entityValuePool), ms); -#endif /* XML_DTD */ - hashTableInit(&(p->generalEntities), ms); - hashTableInit(&(p->elementTypes), ms); - hashTableInit(&(p->attributeIds), ms); - hashTableInit(&(p->prefixes), ms); -#ifdef XML_DTD - p->paramEntityRead = XML_FALSE; - hashTableInit(&(p->paramEntities), ms); -#endif /* XML_DTD */ - p->defaultPrefix.name = NULL; - p->defaultPrefix.binding = NULL; - - p->in_eldecl = XML_FALSE; - p->scaffIndex = NULL; - p->scaffold = NULL; - p->scaffLevel = 0; - p->scaffSize = 0; - p->scaffCount = 0; - p->contentStringLen = 0; - - p->keepProcessing = XML_TRUE; - p->hasParamEntityRefs = XML_FALSE; - p->standalone = XML_FALSE; - return p; -} - -static void -dtdReset(DTD *p, const XML_Memory_Handling_Suite *ms) -{ - HASH_TABLE_ITER iter; - hashTableIterInit(&iter, &(p->elementTypes)); - for (;;) { - ELEMENT_TYPE *e = (ELEMENT_TYPE *)hashTableIterNext(&iter); - if (!e) - break; - if (e->allocDefaultAtts != 0) - ms->free_fcn(e->defaultAtts); - } - hashTableClear(&(p->generalEntities)); -#ifdef XML_DTD - p->paramEntityRead = XML_FALSE; - hashTableClear(&(p->paramEntities)); -#endif /* XML_DTD */ - hashTableClear(&(p->elementTypes)); - hashTableClear(&(p->attributeIds)); - hashTableClear(&(p->prefixes)); - poolClear(&(p->pool)); -#ifdef XML_DTD - poolClear(&(p->entityValuePool)); -#endif /* XML_DTD */ - p->defaultPrefix.name = NULL; - p->defaultPrefix.binding = NULL; - - p->in_eldecl = XML_FALSE; - if (p->scaffIndex) { - ms->free_fcn(p->scaffIndex); - p->scaffIndex = NULL; - } - if (p->scaffold) { - ms->free_fcn(p->scaffold); - p->scaffold = NULL; - } - p->scaffLevel = 0; - p->scaffSize = 0; - p->scaffCount = 0; - p->contentStringLen = 0; - - p->keepProcessing = XML_TRUE; - p->hasParamEntityRefs = XML_FALSE; - p->standalone = XML_FALSE; -} - -static void -dtdDestroy(DTD *p, XML_Bool isDocEntity, const XML_Memory_Handling_Suite *ms) -{ - HASH_TABLE_ITER iter; - hashTableIterInit(&iter, &(p->elementTypes)); - for (;;) { - ELEMENT_TYPE *e = (ELEMENT_TYPE *)hashTableIterNext(&iter); - if (!e) - break; - if (e->allocDefaultAtts != 0) - ms->free_fcn(e->defaultAtts); - } - hashTableDestroy(&(p->generalEntities)); -#ifdef XML_DTD - hashTableDestroy(&(p->paramEntities)); -#endif /* XML_DTD */ - hashTableDestroy(&(p->elementTypes)); - hashTableDestroy(&(p->attributeIds)); - hashTableDestroy(&(p->prefixes)); - poolDestroy(&(p->pool)); -#ifdef XML_DTD - poolDestroy(&(p->entityValuePool)); -#endif /* XML_DTD */ - if (isDocEntity) { - if (p->scaffIndex) - ms->free_fcn(p->scaffIndex); - if (p->scaffold) - ms->free_fcn(p->scaffold); - } - ms->free_fcn(p); -} - -/* Do a deep copy of the DTD. Return 0 for out of memory, non-zero otherwise. - The new DTD has already been initialized. -*/ -static int -dtdCopy(DTD *newDtd, const DTD *oldDtd, const XML_Memory_Handling_Suite *ms) -{ - HASH_TABLE_ITER iter; - - /* Copy the prefix table. */ - - hashTableIterInit(&iter, &(oldDtd->prefixes)); - for (;;) { - const XML_Char *name; - const PREFIX *oldP = (PREFIX *)hashTableIterNext(&iter); - if (!oldP) - break; - name = poolCopyString(&(newDtd->pool), oldP->name); - if (!name) - return 0; - if (!lookup(&(newDtd->prefixes), name, sizeof(PREFIX))) - return 0; - } - - hashTableIterInit(&iter, &(oldDtd->attributeIds)); - - /* Copy the attribute id table. */ - - for (;;) { - ATTRIBUTE_ID *newA; - const XML_Char *name; - const ATTRIBUTE_ID *oldA = (ATTRIBUTE_ID *)hashTableIterNext(&iter); - - if (!oldA) - break; - /* Remember to allocate the scratch byte before the name. */ - if (!poolAppendChar(&(newDtd->pool), XML_T('\0'))) - return 0; - name = poolCopyString(&(newDtd->pool), oldA->name); - if (!name) - return 0; - ++name; - newA = (ATTRIBUTE_ID *)lookup(&(newDtd->attributeIds), name, - sizeof(ATTRIBUTE_ID)); - if (!newA) - return 0; - newA->maybeTokenized = oldA->maybeTokenized; - if (oldA->prefix) { - newA->xmlns = oldA->xmlns; - if (oldA->prefix == &oldDtd->defaultPrefix) - newA->prefix = &newDtd->defaultPrefix; - else - newA->prefix = (PREFIX *)lookup(&(newDtd->prefixes), - oldA->prefix->name, 0); - } - } - - /* Copy the element type table. */ - - hashTableIterInit(&iter, &(oldDtd->elementTypes)); - - for (;;) { - int i; - ELEMENT_TYPE *newE; - const XML_Char *name; - const ELEMENT_TYPE *oldE = (ELEMENT_TYPE *)hashTableIterNext(&iter); - if (!oldE) - break; - name = poolCopyString(&(newDtd->pool), oldE->name); - if (!name) - return 0; - newE = (ELEMENT_TYPE *)lookup(&(newDtd->elementTypes), name, - sizeof(ELEMENT_TYPE)); - if (!newE) - return 0; - if (oldE->nDefaultAtts) { - newE->defaultAtts = (DEFAULT_ATTRIBUTE *) - ms->malloc_fcn(oldE->nDefaultAtts * sizeof(DEFAULT_ATTRIBUTE)); - if (!newE->defaultAtts) { - ms->free_fcn(newE); - return 0; - } - } - if (oldE->idAtt) - newE->idAtt = (ATTRIBUTE_ID *) - lookup(&(newDtd->attributeIds), oldE->idAtt->name, 0); - newE->allocDefaultAtts = newE->nDefaultAtts = oldE->nDefaultAtts; - if (oldE->prefix) - newE->prefix = (PREFIX *)lookup(&(newDtd->prefixes), - oldE->prefix->name, 0); - for (i = 0; i < newE->nDefaultAtts; i++) { - newE->defaultAtts[i].id = (ATTRIBUTE_ID *) - lookup(&(newDtd->attributeIds), oldE->defaultAtts[i].id->name, 0); - newE->defaultAtts[i].isCdata = oldE->defaultAtts[i].isCdata; - if (oldE->defaultAtts[i].value) { - newE->defaultAtts[i].value - = poolCopyString(&(newDtd->pool), oldE->defaultAtts[i].value); - if (!newE->defaultAtts[i].value) - return 0; - } - else - newE->defaultAtts[i].value = NULL; - } - } - - /* Copy the entity tables. */ - if (!copyEntityTable(&(newDtd->generalEntities), - &(newDtd->pool), - &(oldDtd->generalEntities))) - return 0; - -#ifdef XML_DTD - if (!copyEntityTable(&(newDtd->paramEntities), - &(newDtd->pool), - &(oldDtd->paramEntities))) - return 0; - newDtd->paramEntityRead = oldDtd->paramEntityRead; -#endif /* XML_DTD */ - - newDtd->keepProcessing = oldDtd->keepProcessing; - newDtd->hasParamEntityRefs = oldDtd->hasParamEntityRefs; - newDtd->standalone = oldDtd->standalone; - - /* Don't want deep copying for scaffolding */ - newDtd->in_eldecl = oldDtd->in_eldecl; - newDtd->scaffold = oldDtd->scaffold; - newDtd->contentStringLen = oldDtd->contentStringLen; - newDtd->scaffSize = oldDtd->scaffSize; - newDtd->scaffLevel = oldDtd->scaffLevel; - newDtd->scaffIndex = oldDtd->scaffIndex; - - return 1; -} /* End dtdCopy */ - -static int -copyEntityTable(HASH_TABLE *newTable, - STRING_POOL *newPool, - const HASH_TABLE *oldTable) -{ - HASH_TABLE_ITER iter; - const XML_Char *cachedOldBase = NULL; - const XML_Char *cachedNewBase = NULL; - - hashTableIterInit(&iter, oldTable); - - for (;;) { - ENTITY *newE; - const XML_Char *name; - const ENTITY *oldE = (ENTITY *)hashTableIterNext(&iter); - if (!oldE) - break; - name = poolCopyString(newPool, oldE->name); - if (!name) - return 0; - newE = (ENTITY *)lookup(newTable, name, sizeof(ENTITY)); - if (!newE) - return 0; - if (oldE->systemId) { - const XML_Char *tem = poolCopyString(newPool, oldE->systemId); - if (!tem) - return 0; - newE->systemId = tem; - if (oldE->base) { - if (oldE->base == cachedOldBase) - newE->base = cachedNewBase; - else { - cachedOldBase = oldE->base; - tem = poolCopyString(newPool, cachedOldBase); - if (!tem) - return 0; - cachedNewBase = newE->base = tem; - } - } - if (oldE->publicId) { - tem = poolCopyString(newPool, oldE->publicId); - if (!tem) - return 0; - newE->publicId = tem; - } - } - else { - const XML_Char *tem = poolCopyStringN(newPool, oldE->textPtr, - oldE->textLen); - if (!tem) - return 0; - newE->textPtr = tem; - newE->textLen = oldE->textLen; - } - if (oldE->notation) { - const XML_Char *tem = poolCopyString(newPool, oldE->notation); - if (!tem) - return 0; - newE->notation = tem; - } - newE->is_param = oldE->is_param; - newE->is_internal = oldE->is_internal; - } - return 1; -} - -#define INIT_SIZE 64 - -static int FASTCALL -keyeq(KEY s1, KEY s2) -{ - for (; *s1 == *s2; s1++, s2++) - if (*s1 == 0) - return 1; - return 0; -} - -static unsigned long FASTCALL -hash(KEY s) -{ - unsigned long h = 0; - while (*s) - h = (h << 5) + h + (unsigned char)*s++; - return h; -} - -static NAMED * -lookup(HASH_TABLE *table, KEY name, size_t createSize) -{ - size_t i; - if (table->size == 0) { - size_t tsize; - - if (!createSize) - return NULL; - tsize = INIT_SIZE * sizeof(NAMED *); - table->v = (NAMED **)table->mem->malloc_fcn(tsize); - if (!table->v) - return NULL; - memset(table->v, 0, tsize); - table->size = INIT_SIZE; - table->usedLim = INIT_SIZE / 2; - i = hash(name) & (table->size - 1); - } - else { - unsigned long h = hash(name); - for (i = h & (table->size - 1); - table->v[i]; - i == 0 ? i = table->size - 1 : --i) { - if (keyeq(name, table->v[i]->name)) - return table->v[i]; - } - if (!createSize) - return NULL; - if (table->used == table->usedLim) { - /* check for overflow */ - size_t newSize = table->size * 2; - size_t tsize = newSize * sizeof(NAMED *); - NAMED **newV = (NAMED **)table->mem->malloc_fcn(tsize); - if (!newV) - return NULL; - memset(newV, 0, tsize); - for (i = 0; i < table->size; i++) - if (table->v[i]) { - size_t j; - for (j = hash(table->v[i]->name) & (newSize - 1); - newV[j]; - j == 0 ? j = newSize - 1 : --j) - ; - newV[j] = table->v[i]; - } - table->mem->free_fcn(table->v); - table->v = newV; - table->size = newSize; - table->usedLim = newSize/2; - for (i = h & (table->size - 1); - table->v[i]; - i == 0 ? i = table->size - 1 : --i) - ; - } - } - table->v[i] = (NAMED *)table->mem->malloc_fcn(createSize); - if (!table->v[i]) - return NULL; - memset(table->v[i], 0, createSize); - table->v[i]->name = name; - (table->used)++; - return table->v[i]; -} - -static void FASTCALL -hashTableClear(HASH_TABLE *table) -{ - size_t i; - for (i = 0; i < table->size; i++) { - NAMED *p = table->v[i]; - if (p) { - table->mem->free_fcn(p); - table->v[i] = NULL; - } - } - table->usedLim = table->size / 2; - table->used = 0; -} - -static void FASTCALL -hashTableDestroy(HASH_TABLE *table) -{ - size_t i; - for (i = 0; i < table->size; i++) { - NAMED *p = table->v[i]; - if (p) - table->mem->free_fcn(p); - } - if (table->v) - table->mem->free_fcn(table->v); -} - -static void FASTCALL -hashTableInit(HASH_TABLE *p, const XML_Memory_Handling_Suite *ms) -{ - p->size = 0; - p->usedLim = 0; - p->used = 0; - p->v = NULL; - p->mem = ms; -} - -static void FASTCALL -hashTableIterInit(HASH_TABLE_ITER *iter, const HASH_TABLE *table) -{ - iter->p = table->v; - iter->end = iter->p + table->size; -} - -static NAMED * FASTCALL -hashTableIterNext(HASH_TABLE_ITER *iter) -{ - while (iter->p != iter->end) { - NAMED *tem = *(iter->p)++; - if (tem) - return tem; - } - return NULL; -} - -static void FASTCALL -poolInit(STRING_POOL *pool, const XML_Memory_Handling_Suite *ms) -{ - pool->blocks = NULL; - pool->freeBlocks = NULL; - pool->start = NULL; - pool->ptr = NULL; - pool->end = NULL; - pool->mem = ms; -} - -static void FASTCALL -poolClear(STRING_POOL *pool) -{ - if (!pool->freeBlocks) - pool->freeBlocks = pool->blocks; - else { - BLOCK *p = pool->blocks; - while (p) { - BLOCK *tem = p->next; - p->next = pool->freeBlocks; - pool->freeBlocks = p; - p = tem; - } - } - pool->blocks = NULL; - pool->start = NULL; - pool->ptr = NULL; - pool->end = NULL; -} - -static void FASTCALL -poolDestroy(STRING_POOL *pool) -{ - BLOCK *p = pool->blocks; - while (p) { - BLOCK *tem = p->next; - pool->mem->free_fcn(p); - p = tem; - } - p = pool->freeBlocks; - while (p) { - BLOCK *tem = p->next; - pool->mem->free_fcn(p); - p = tem; - } -} - -static XML_Char * -poolAppend(STRING_POOL *pool, const ENCODING *enc, - const char *ptr, const char *end) -{ - if (!pool->ptr && !poolGrow(pool)) - return NULL; - for (;;) { - XmlConvert(enc, &ptr, end, (ICHAR **)&(pool->ptr), (ICHAR *)pool->end); - if (ptr == end) - break; - if (!poolGrow(pool)) - return NULL; - } - return pool->start; -} - -static const XML_Char * FASTCALL -poolCopyString(STRING_POOL *pool, const XML_Char *s) -{ - do { - if (!poolAppendChar(pool, *s)) - return NULL; - } while (*s++); - s = pool->start; - poolFinish(pool); - return s; -} - -static const XML_Char * -poolCopyStringN(STRING_POOL *pool, const XML_Char *s, int n) -{ - if (!pool->ptr && !poolGrow(pool)) - return NULL; - for (; n > 0; --n, s++) { - if (!poolAppendChar(pool, *s)) - return NULL; - } - s = pool->start; - poolFinish(pool); - return s; -} - -static const XML_Char * FASTCALL -poolAppendString(STRING_POOL *pool, const XML_Char *s) -{ - while (*s) { - if (!poolAppendChar(pool, *s)) - return NULL; - s++; - } - return pool->start; -} - -static XML_Char * -poolStoreString(STRING_POOL *pool, const ENCODING *enc, - const char *ptr, const char *end) -{ - if (!poolAppend(pool, enc, ptr, end)) - return NULL; - if (pool->ptr == pool->end && !poolGrow(pool)) - return NULL; - *(pool->ptr)++ = 0; - return pool->start; -} - -static XML_Bool FASTCALL -poolGrow(STRING_POOL *pool) -{ - if (pool->freeBlocks) { - if (pool->start == 0) { - pool->blocks = pool->freeBlocks; - pool->freeBlocks = pool->freeBlocks->next; - pool->blocks->next = NULL; - pool->start = pool->blocks->s; - pool->end = pool->start + pool->blocks->size; - pool->ptr = pool->start; - return XML_TRUE; - } - if (pool->end - pool->start < pool->freeBlocks->size) { - BLOCK *tem = pool->freeBlocks->next; - pool->freeBlocks->next = pool->blocks; - pool->blocks = pool->freeBlocks; - pool->freeBlocks = tem; - memcpy(pool->blocks->s, pool->start, - (pool->end - pool->start) * sizeof(XML_Char)); - pool->ptr = pool->blocks->s + (pool->ptr - pool->start); - pool->start = pool->blocks->s; - pool->end = pool->start + pool->blocks->size; - return XML_TRUE; - } - } - if (pool->blocks && pool->start == pool->blocks->s) { - int blockSize = (pool->end - pool->start)*2; - pool->blocks = (BLOCK *) - pool->mem->realloc_fcn(pool->blocks, - (offsetof(BLOCK, s) - + blockSize * sizeof(XML_Char))); - if (pool->blocks == NULL) - return XML_FALSE; - pool->blocks->size = blockSize; - pool->ptr = pool->blocks->s + (pool->ptr - pool->start); - pool->start = pool->blocks->s; - pool->end = pool->start + blockSize; - } - else { - BLOCK *tem; - int blockSize = pool->end - pool->start; - if (blockSize < INIT_BLOCK_SIZE) - blockSize = INIT_BLOCK_SIZE; - else - blockSize *= 2; - tem = (BLOCK *)pool->mem->malloc_fcn(offsetof(BLOCK, s) - + blockSize * sizeof(XML_Char)); - if (!tem) - return XML_FALSE; - tem->size = blockSize; - tem->next = pool->blocks; - pool->blocks = tem; - if (pool->ptr != pool->start) - memcpy(tem->s, pool->start, - (pool->ptr - pool->start) * sizeof(XML_Char)); - pool->ptr = tem->s + (pool->ptr - pool->start); - pool->start = tem->s; - pool->end = tem->s + blockSize; - } - return XML_TRUE; -} - -static int FASTCALL -nextScaffoldPart(XML_Parser parser) -{ - DTD * const dtd = _dtd; /* save one level of indirection */ - CONTENT_SCAFFOLD * me; - int next; - - if (!dtd->scaffIndex) { - dtd->scaffIndex = (int *)MALLOC(groupSize * sizeof(int)); - if (!dtd->scaffIndex) - return -1; - dtd->scaffIndex[0] = 0; - } - - if (dtd->scaffCount >= dtd->scaffSize) { - CONTENT_SCAFFOLD *temp; - if (dtd->scaffold) { - temp = (CONTENT_SCAFFOLD *) - REALLOC(dtd->scaffold, dtd->scaffSize * 2 * sizeof(CONTENT_SCAFFOLD)); - if (temp == NULL) - return -1; - dtd->scaffSize *= 2; - } - else { - temp = (CONTENT_SCAFFOLD *)MALLOC(INIT_SCAFFOLD_ELEMENTS - * sizeof(CONTENT_SCAFFOLD)); - if (temp == NULL) - return -1; - dtd->scaffSize = INIT_SCAFFOLD_ELEMENTS; - } - dtd->scaffold = temp; - } - next = dtd->scaffCount++; - me = &dtd->scaffold[next]; - if (dtd->scaffLevel) { - CONTENT_SCAFFOLD *parent = &dtd->scaffold[dtd->scaffIndex[dtd->scaffLevel-1]]; - if (parent->lastchild) { - dtd->scaffold[parent->lastchild].nextsib = next; - } - if (!parent->childcnt) - parent->firstchild = next; - parent->lastchild = next; - parent->childcnt++; - } - me->firstchild = me->lastchild = me->childcnt = me->nextsib = 0; - return next; -} - -static void -build_node(XML_Parser parser, - int src_node, - XML_Content *dest, - XML_Content **contpos, - XML_Char **strpos) -{ - DTD * const dtd = _dtd; /* save one level of indirection */ - dest->type = dtd->scaffold[src_node].type; - dest->quant = dtd->scaffold[src_node].quant; - if (dest->type == XML_CTYPE_NAME) { - const XML_Char *src; - dest->name = *strpos; - src = dtd->scaffold[src_node].name; - for (;;) { - *(*strpos)++ = *src; - if (!*src) - break; - src++; - } - dest->numchildren = 0; - dest->children = NULL; - } - else { - unsigned int i; - int cn; - dest->numchildren = dtd->scaffold[src_node].childcnt; - dest->children = *contpos; - *contpos += dest->numchildren; - for (i = 0, cn = dtd->scaffold[src_node].firstchild; - i < dest->numchildren; - i++, cn = dtd->scaffold[cn].nextsib) { - build_node(parser, cn, &(dest->children[i]), contpos, strpos); - } - dest->name = NULL; - } -} - -static XML_Content * -build_model (XML_Parser parser) -{ - DTD * const dtd = _dtd; /* save one level of indirection */ - XML_Content *ret; - XML_Content *cpos; - XML_Char * str; - int allocsize = (dtd->scaffCount * sizeof(XML_Content) - + (dtd->contentStringLen * sizeof(XML_Char))); - - ret = (XML_Content *)MALLOC(allocsize); - if (!ret) - return NULL; - - str = (XML_Char *) (&ret[dtd->scaffCount]); - cpos = &ret[1]; - - build_node(parser, 0, ret, &cpos, &str); - return ret; -} - -static ELEMENT_TYPE * -getElementType(XML_Parser parser, - const ENCODING *enc, - const char *ptr, - const char *end) -{ - DTD * const dtd = _dtd; /* save one level of indirection */ - const XML_Char *name = poolStoreString(&dtd->pool, enc, ptr, end); - ELEMENT_TYPE *ret; - - if (!name) - return NULL; - ret = (ELEMENT_TYPE *) lookup(&dtd->elementTypes, name, sizeof(ELEMENT_TYPE)); - if (!ret) - return NULL; - if (ret->name != name) - poolDiscard(&dtd->pool); - else { - poolFinish(&dtd->pool); - if (!setElementTypePrefix(parser, ret)) - return NULL; - } - return ret; -} diff --git a/wxWidgets/src/expat/lib/xmlrole.c b/wxWidgets/src/expat/lib/xmlrole.c deleted file mode 100644 index 79d12d53aa..0000000000 --- a/wxWidgets/src/expat/lib/xmlrole.c +++ /dev/null @@ -1,1325 +0,0 @@ -/* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd - See the file COPYING for copying permission. -*/ - -#ifdef COMPILED_FROM_DSP -#include "winconfig.h" -#elif defined(OS2_32) -#include "os2config.h" -#elif defined(__MSDOS__) -#include "dosconfig.h" -#elif defined(MACOS_CLASSIC) -#include "macconfig.h" -#else -#include "expat_config.h" -#endif /* ndef COMPILED_FROM_DSP */ - -#include "internal.h" -#include "xmlrole.h" -#include "ascii.h" - -/* Doesn't check: - - that ,| are not mixed in a model group - content of literals - -*/ - -static const char KW_ANY[] = { - ASCII_A, ASCII_N, ASCII_Y, '\0' }; -static const char KW_ATTLIST[] = { - ASCII_A, ASCII_T, ASCII_T, ASCII_L, ASCII_I, ASCII_S, ASCII_T, '\0' }; -static const char KW_CDATA[] = { - ASCII_C, ASCII_D, ASCII_A, ASCII_T, ASCII_A, '\0' }; -static const char KW_DOCTYPE[] = { - ASCII_D, ASCII_O, ASCII_C, ASCII_T, ASCII_Y, ASCII_P, ASCII_E, '\0' }; -static const char KW_ELEMENT[] = { - ASCII_E, ASCII_L, ASCII_E, ASCII_M, ASCII_E, ASCII_N, ASCII_T, '\0' }; -static const char KW_EMPTY[] = { - ASCII_E, ASCII_M, ASCII_P, ASCII_T, ASCII_Y, '\0' }; -static const char KW_ENTITIES[] = { - ASCII_E, ASCII_N, ASCII_T, ASCII_I, ASCII_T, ASCII_I, ASCII_E, ASCII_S, - '\0' }; -static const char KW_ENTITY[] = { - ASCII_E, ASCII_N, ASCII_T, ASCII_I, ASCII_T, ASCII_Y, '\0' }; -static const char KW_FIXED[] = { - ASCII_F, ASCII_I, ASCII_X, ASCII_E, ASCII_D, '\0' }; -static const char KW_ID[] = { - ASCII_I, ASCII_D, '\0' }; -static const char KW_IDREF[] = { - ASCII_I, ASCII_D, ASCII_R, ASCII_E, ASCII_F, '\0' }; -static const char KW_IDREFS[] = { - ASCII_I, ASCII_D, ASCII_R, ASCII_E, ASCII_F, ASCII_S, '\0' }; -static const char KW_IGNORE[] = { - ASCII_I, ASCII_G, ASCII_N, ASCII_O, ASCII_R, ASCII_E, '\0' }; -static const char KW_IMPLIED[] = { - ASCII_I, ASCII_M, ASCII_P, ASCII_L, ASCII_I, ASCII_E, ASCII_D, '\0' }; -static const char KW_INCLUDE[] = { - ASCII_I, ASCII_N, ASCII_C, ASCII_L, ASCII_U, ASCII_D, ASCII_E, '\0' }; -static const char KW_NDATA[] = { - ASCII_N, ASCII_D, ASCII_A, ASCII_T, ASCII_A, '\0' }; -static const char KW_NMTOKEN[] = { - ASCII_N, ASCII_M, ASCII_T, ASCII_O, ASCII_K, ASCII_E, ASCII_N, '\0' }; -static const char KW_NMTOKENS[] = { - ASCII_N, ASCII_M, ASCII_T, ASCII_O, ASCII_K, ASCII_E, ASCII_N, ASCII_S, - '\0' }; -static const char KW_NOTATION[] = - { ASCII_N, ASCII_O, ASCII_T, ASCII_A, ASCII_T, ASCII_I, ASCII_O, ASCII_N, - '\0' }; -static const char KW_PCDATA[] = { - ASCII_P, ASCII_C, ASCII_D, ASCII_A, ASCII_T, ASCII_A, '\0' }; -static const char KW_PUBLIC[] = { - ASCII_P, ASCII_U, ASCII_B, ASCII_L, ASCII_I, ASCII_C, '\0' }; -static const char KW_REQUIRED[] = { - ASCII_R, ASCII_E, ASCII_Q, ASCII_U, ASCII_I, ASCII_R, ASCII_E, ASCII_D, - '\0' }; -static const char KW_SYSTEM[] = { - ASCII_S, ASCII_Y, ASCII_S, ASCII_T, ASCII_E, ASCII_M, '\0' }; - -#ifndef MIN_BYTES_PER_CHAR -#define MIN_BYTES_PER_CHAR(enc) ((enc)->minBytesPerChar) -#endif - -#ifdef XML_DTD -#define setTopLevel(state) \ - ((state)->handler = ((state)->documentEntity \ - ? internalSubset \ - : externalSubset1)) -#else /* not XML_DTD */ -#define setTopLevel(state) ((state)->handler = internalSubset) -#endif /* not XML_DTD */ - -typedef int PTRCALL PROLOG_HANDLER(PROLOG_STATE *state, - int tok, - const char *ptr, - const char *end, - const ENCODING *enc); - -static PROLOG_HANDLER - prolog0, prolog1, prolog2, - doctype0, doctype1, doctype2, doctype3, doctype4, doctype5, - internalSubset, - entity0, entity1, entity2, entity3, entity4, entity5, entity6, - entity7, entity8, entity9, entity10, - notation0, notation1, notation2, notation3, notation4, - attlist0, attlist1, attlist2, attlist3, attlist4, attlist5, attlist6, - attlist7, attlist8, attlist9, - element0, element1, element2, element3, element4, element5, element6, - element7, -#ifdef XML_DTD - externalSubset0, externalSubset1, - condSect0, condSect1, condSect2, -#endif /* XML_DTD */ - declClose, - error; - -static int FASTCALL common(PROLOG_STATE *state, int tok); - -static int PTRCALL -prolog0(PROLOG_STATE *state, - int tok, - const char *ptr, - const char *end, - const ENCODING *enc) -{ - switch (tok) { - case XML_TOK_PROLOG_S: - state->handler = prolog1; - return XML_ROLE_NONE; - case XML_TOK_XML_DECL: - state->handler = prolog1; - return XML_ROLE_XML_DECL; - case XML_TOK_PI: - state->handler = prolog1; - return XML_ROLE_PI; - case XML_TOK_COMMENT: - state->handler = prolog1; - return XML_ROLE_COMMENT; - case XML_TOK_BOM: - return XML_ROLE_NONE; - case XML_TOK_DECL_OPEN: - if (!XmlNameMatchesAscii(enc, - ptr + 2 * MIN_BYTES_PER_CHAR(enc), - end, - KW_DOCTYPE)) - break; - state->handler = doctype0; - return XML_ROLE_DOCTYPE_NONE; - case XML_TOK_INSTANCE_START: - state->handler = error; - return XML_ROLE_INSTANCE_START; - } - return common(state, tok); -} - -static int PTRCALL -prolog1(PROLOG_STATE *state, - int tok, - const char *ptr, - const char *end, - const ENCODING *enc) -{ - switch (tok) { - case XML_TOK_PROLOG_S: - return XML_ROLE_NONE; - case XML_TOK_PI: - return XML_ROLE_PI; - case XML_TOK_COMMENT: - return XML_ROLE_COMMENT; - case XML_TOK_BOM: - return XML_ROLE_NONE; - case XML_TOK_DECL_OPEN: - if (!XmlNameMatchesAscii(enc, - ptr + 2 * MIN_BYTES_PER_CHAR(enc), - end, - KW_DOCTYPE)) - break; - state->handler = doctype0; - return XML_ROLE_DOCTYPE_NONE; - case XML_TOK_INSTANCE_START: - state->handler = error; - return XML_ROLE_INSTANCE_START; - } - return common(state, tok); -} - -static int PTRCALL -prolog2(PROLOG_STATE *state, - int tok, - const char *ptr, - const char *end, - const ENCODING *enc) -{ - switch (tok) { - case XML_TOK_PROLOG_S: - return XML_ROLE_NONE; - case XML_TOK_PI: - return XML_ROLE_PI; - case XML_TOK_COMMENT: - return XML_ROLE_COMMENT; - case XML_TOK_INSTANCE_START: - state->handler = error; - return XML_ROLE_INSTANCE_START; - } - return common(state, tok); -} - -static int PTRCALL -doctype0(PROLOG_STATE *state, - int tok, - const char *ptr, - const char *end, - const ENCODING *enc) -{ - switch (tok) { - case XML_TOK_PROLOG_S: - return XML_ROLE_DOCTYPE_NONE; - case XML_TOK_NAME: - case XML_TOK_PREFIXED_NAME: - state->handler = doctype1; - return XML_ROLE_DOCTYPE_NAME; - } - return common(state, tok); -} - -static int PTRCALL -doctype1(PROLOG_STATE *state, - int tok, - const char *ptr, - const char *end, - const ENCODING *enc) -{ - switch (tok) { - case XML_TOK_PROLOG_S: - return XML_ROLE_DOCTYPE_NONE; - case XML_TOK_OPEN_BRACKET: - state->handler = internalSubset; - return XML_ROLE_DOCTYPE_INTERNAL_SUBSET; - case XML_TOK_DECL_CLOSE: - state->handler = prolog2; - return XML_ROLE_DOCTYPE_CLOSE; - case XML_TOK_NAME: - if (XmlNameMatchesAscii(enc, ptr, end, KW_SYSTEM)) { - state->handler = doctype3; - return XML_ROLE_DOCTYPE_NONE; - } - if (XmlNameMatchesAscii(enc, ptr, end, KW_PUBLIC)) { - state->handler = doctype2; - return XML_ROLE_DOCTYPE_NONE; - } - break; - } - return common(state, tok); -} - -static int PTRCALL -doctype2(PROLOG_STATE *state, - int tok, - const char *ptr, - const char *end, - const ENCODING *enc) -{ - switch (tok) { - case XML_TOK_PROLOG_S: - return XML_ROLE_DOCTYPE_NONE; - case XML_TOK_LITERAL: - state->handler = doctype3; - return XML_ROLE_DOCTYPE_PUBLIC_ID; - } - return common(state, tok); -} - -static int PTRCALL -doctype3(PROLOG_STATE *state, - int tok, - const char *ptr, - const char *end, - const ENCODING *enc) -{ - switch (tok) { - case XML_TOK_PROLOG_S: - return XML_ROLE_DOCTYPE_NONE; - case XML_TOK_LITERAL: - state->handler = doctype4; - return XML_ROLE_DOCTYPE_SYSTEM_ID; - } - return common(state, tok); -} - -static int PTRCALL -doctype4(PROLOG_STATE *state, - int tok, - const char *ptr, - const char *end, - const ENCODING *enc) -{ - switch (tok) { - case XML_TOK_PROLOG_S: - return XML_ROLE_DOCTYPE_NONE; - case XML_TOK_OPEN_BRACKET: - state->handler = internalSubset; - return XML_ROLE_DOCTYPE_INTERNAL_SUBSET; - case XML_TOK_DECL_CLOSE: - state->handler = prolog2; - return XML_ROLE_DOCTYPE_CLOSE; - } - return common(state, tok); -} - -static int PTRCALL -doctype5(PROLOG_STATE *state, - int tok, - const char *ptr, - const char *end, - const ENCODING *enc) -{ - switch (tok) { - case XML_TOK_PROLOG_S: - return XML_ROLE_DOCTYPE_NONE; - case XML_TOK_DECL_CLOSE: - state->handler = prolog2; - return XML_ROLE_DOCTYPE_CLOSE; - } - return common(state, tok); -} - -static int PTRCALL -internalSubset(PROLOG_STATE *state, - int tok, - const char *ptr, - const char *end, - const ENCODING *enc) -{ - switch (tok) { - case XML_TOK_PROLOG_S: - return XML_ROLE_NONE; - case XML_TOK_DECL_OPEN: - if (XmlNameMatchesAscii(enc, - ptr + 2 * MIN_BYTES_PER_CHAR(enc), - end, - KW_ENTITY)) { - state->handler = entity0; - return XML_ROLE_ENTITY_NONE; - } - if (XmlNameMatchesAscii(enc, - ptr + 2 * MIN_BYTES_PER_CHAR(enc), - end, - KW_ATTLIST)) { - state->handler = attlist0; - return XML_ROLE_ATTLIST_NONE; - } - if (XmlNameMatchesAscii(enc, - ptr + 2 * MIN_BYTES_PER_CHAR(enc), - end, - KW_ELEMENT)) { - state->handler = element0; - return XML_ROLE_ELEMENT_NONE; - } - if (XmlNameMatchesAscii(enc, - ptr + 2 * MIN_BYTES_PER_CHAR(enc), - end, - KW_NOTATION)) { - state->handler = notation0; - return XML_ROLE_NOTATION_NONE; - } - break; - case XML_TOK_PI: - return XML_ROLE_PI; - case XML_TOK_COMMENT: - return XML_ROLE_COMMENT; - case XML_TOK_PARAM_ENTITY_REF: - return XML_ROLE_PARAM_ENTITY_REF; - case XML_TOK_CLOSE_BRACKET: - state->handler = doctype5; - return XML_ROLE_DOCTYPE_NONE; - } - return common(state, tok); -} - -#ifdef XML_DTD - -static int PTRCALL -externalSubset0(PROLOG_STATE *state, - int tok, - const char *ptr, - const char *end, - const ENCODING *enc) -{ - state->handler = externalSubset1; - if (tok == XML_TOK_XML_DECL) - return XML_ROLE_TEXT_DECL; - return externalSubset1(state, tok, ptr, end, enc); -} - -static int PTRCALL -externalSubset1(PROLOG_STATE *state, - int tok, - const char *ptr, - const char *end, - const ENCODING *enc) -{ - switch (tok) { - case XML_TOK_COND_SECT_OPEN: - state->handler = condSect0; - return XML_ROLE_NONE; - case XML_TOK_COND_SECT_CLOSE: - if (state->includeLevel == 0) - break; - state->includeLevel -= 1; - return XML_ROLE_NONE; - case XML_TOK_PROLOG_S: - return XML_ROLE_NONE; - case XML_TOK_CLOSE_BRACKET: - break; - case XML_TOK_NONE: - if (state->includeLevel) - break; - return XML_ROLE_NONE; - default: - return internalSubset(state, tok, ptr, end, enc); - } - return common(state, tok); -} - -#endif /* XML_DTD */ - -static int PTRCALL -entity0(PROLOG_STATE *state, - int tok, - const char *ptr, - const char *end, - const ENCODING *enc) -{ - switch (tok) { - case XML_TOK_PROLOG_S: - return XML_ROLE_ENTITY_NONE; - case XML_TOK_PERCENT: - state->handler = entity1; - return XML_ROLE_ENTITY_NONE; - case XML_TOK_NAME: - state->handler = entity2; - return XML_ROLE_GENERAL_ENTITY_NAME; - } - return common(state, tok); -} - -static int PTRCALL -entity1(PROLOG_STATE *state, - int tok, - const char *ptr, - const char *end, - const ENCODING *enc) -{ - switch (tok) { - case XML_TOK_PROLOG_S: - return XML_ROLE_ENTITY_NONE; - case XML_TOK_NAME: - state->handler = entity7; - return XML_ROLE_PARAM_ENTITY_NAME; - } - return common(state, tok); -} - -static int PTRCALL -entity2(PROLOG_STATE *state, - int tok, - const char *ptr, - const char *end, - const ENCODING *enc) -{ - switch (tok) { - case XML_TOK_PROLOG_S: - return XML_ROLE_ENTITY_NONE; - case XML_TOK_NAME: - if (XmlNameMatchesAscii(enc, ptr, end, KW_SYSTEM)) { - state->handler = entity4; - return XML_ROLE_ENTITY_NONE; - } - if (XmlNameMatchesAscii(enc, ptr, end, KW_PUBLIC)) { - state->handler = entity3; - return XML_ROLE_ENTITY_NONE; - } - break; - case XML_TOK_LITERAL: - state->handler = declClose; - state->role_none = XML_ROLE_ENTITY_NONE; - return XML_ROLE_ENTITY_VALUE; - } - return common(state, tok); -} - -static int PTRCALL -entity3(PROLOG_STATE *state, - int tok, - const char *ptr, - const char *end, - const ENCODING *enc) -{ - switch (tok) { - case XML_TOK_PROLOG_S: - return XML_ROLE_ENTITY_NONE; - case XML_TOK_LITERAL: - state->handler = entity4; - return XML_ROLE_ENTITY_PUBLIC_ID; - } - return common(state, tok); -} - -static int PTRCALL -entity4(PROLOG_STATE *state, - int tok, - const char *ptr, - const char *end, - const ENCODING *enc) -{ - switch (tok) { - case XML_TOK_PROLOG_S: - return XML_ROLE_ENTITY_NONE; - case XML_TOK_LITERAL: - state->handler = entity5; - return XML_ROLE_ENTITY_SYSTEM_ID; - } - return common(state, tok); -} - -static int PTRCALL -entity5(PROLOG_STATE *state, - int tok, - const char *ptr, - const char *end, - const ENCODING *enc) -{ - switch (tok) { - case XML_TOK_PROLOG_S: - return XML_ROLE_ENTITY_NONE; - case XML_TOK_DECL_CLOSE: - setTopLevel(state); - return XML_ROLE_ENTITY_COMPLETE; - case XML_TOK_NAME: - if (XmlNameMatchesAscii(enc, ptr, end, KW_NDATA)) { - state->handler = entity6; - return XML_ROLE_ENTITY_NONE; - } - break; - } - return common(state, tok); -} - -static int PTRCALL -entity6(PROLOG_STATE *state, - int tok, - const char *ptr, - const char *end, - const ENCODING *enc) -{ - switch (tok) { - case XML_TOK_PROLOG_S: - return XML_ROLE_ENTITY_NONE; - case XML_TOK_NAME: - state->handler = declClose; - state->role_none = XML_ROLE_ENTITY_NONE; - return XML_ROLE_ENTITY_NOTATION_NAME; - } - return common(state, tok); -} - -static int PTRCALL -entity7(PROLOG_STATE *state, - int tok, - const char *ptr, - const char *end, - const ENCODING *enc) -{ - switch (tok) { - case XML_TOK_PROLOG_S: - return XML_ROLE_ENTITY_NONE; - case XML_TOK_NAME: - if (XmlNameMatchesAscii(enc, ptr, end, KW_SYSTEM)) { - state->handler = entity9; - return XML_ROLE_ENTITY_NONE; - } - if (XmlNameMatchesAscii(enc, ptr, end, KW_PUBLIC)) { - state->handler = entity8; - return XML_ROLE_ENTITY_NONE; - } - break; - case XML_TOK_LITERAL: - state->handler = declClose; - state->role_none = XML_ROLE_ENTITY_NONE; - return XML_ROLE_ENTITY_VALUE; - } - return common(state, tok); -} - -static int PTRCALL -entity8(PROLOG_STATE *state, - int tok, - const char *ptr, - const char *end, - const ENCODING *enc) -{ - switch (tok) { - case XML_TOK_PROLOG_S: - return XML_ROLE_ENTITY_NONE; - case XML_TOK_LITERAL: - state->handler = entity9; - return XML_ROLE_ENTITY_PUBLIC_ID; - } - return common(state, tok); -} - -static int PTRCALL -entity9(PROLOG_STATE *state, - int tok, - const char *ptr, - const char *end, - const ENCODING *enc) -{ - switch (tok) { - case XML_TOK_PROLOG_S: - return XML_ROLE_ENTITY_NONE; - case XML_TOK_LITERAL: - state->handler = entity10; - return XML_ROLE_ENTITY_SYSTEM_ID; - } - return common(state, tok); -} - -static int PTRCALL -entity10(PROLOG_STATE *state, - int tok, - const char *ptr, - const char *end, - const ENCODING *enc) -{ - switch (tok) { - case XML_TOK_PROLOG_S: - return XML_ROLE_ENTITY_NONE; - case XML_TOK_DECL_CLOSE: - setTopLevel(state); - return XML_ROLE_ENTITY_COMPLETE; - } - return common(state, tok); -} - -static int PTRCALL -notation0(PROLOG_STATE *state, - int tok, - const char *ptr, - const char *end, - const ENCODING *enc) -{ - switch (tok) { - case XML_TOK_PROLOG_S: - return XML_ROLE_NOTATION_NONE; - case XML_TOK_NAME: - state->handler = notation1; - return XML_ROLE_NOTATION_NAME; - } - return common(state, tok); -} - -static int PTRCALL -notation1(PROLOG_STATE *state, - int tok, - const char *ptr, - const char *end, - const ENCODING *enc) -{ - switch (tok) { - case XML_TOK_PROLOG_S: - return XML_ROLE_NOTATION_NONE; - case XML_TOK_NAME: - if (XmlNameMatchesAscii(enc, ptr, end, KW_SYSTEM)) { - state->handler = notation3; - return XML_ROLE_NOTATION_NONE; - } - if (XmlNameMatchesAscii(enc, ptr, end, KW_PUBLIC)) { - state->handler = notation2; - return XML_ROLE_NOTATION_NONE; - } - break; - } - return common(state, tok); -} - -static int PTRCALL -notation2(PROLOG_STATE *state, - int tok, - const char *ptr, - const char *end, - const ENCODING *enc) -{ - switch (tok) { - case XML_TOK_PROLOG_S: - return XML_ROLE_NOTATION_NONE; - case XML_TOK_LITERAL: - state->handler = notation4; - return XML_ROLE_NOTATION_PUBLIC_ID; - } - return common(state, tok); -} - -static int PTRCALL -notation3(PROLOG_STATE *state, - int tok, - const char *ptr, - const char *end, - const ENCODING *enc) -{ - switch (tok) { - case XML_TOK_PROLOG_S: - return XML_ROLE_NOTATION_NONE; - case XML_TOK_LITERAL: - state->handler = declClose; - state->role_none = XML_ROLE_NOTATION_NONE; - return XML_ROLE_NOTATION_SYSTEM_ID; - } - return common(state, tok); -} - -static int PTRCALL -notation4(PROLOG_STATE *state, - int tok, - const char *ptr, - const char *end, - const ENCODING *enc) -{ - switch (tok) { - case XML_TOK_PROLOG_S: - return XML_ROLE_NOTATION_NONE; - case XML_TOK_LITERAL: - state->handler = declClose; - state->role_none = XML_ROLE_NOTATION_NONE; - return XML_ROLE_NOTATION_SYSTEM_ID; - case XML_TOK_DECL_CLOSE: - setTopLevel(state); - return XML_ROLE_NOTATION_NO_SYSTEM_ID; - } - return common(state, tok); -} - -static int PTRCALL -attlist0(PROLOG_STATE *state, - int tok, - const char *ptr, - const char *end, - const ENCODING *enc) -{ - switch (tok) { - case XML_TOK_PROLOG_S: - return XML_ROLE_ATTLIST_NONE; - case XML_TOK_NAME: - case XML_TOK_PREFIXED_NAME: - state->handler = attlist1; - return XML_ROLE_ATTLIST_ELEMENT_NAME; - } - return common(state, tok); -} - -static int PTRCALL -attlist1(PROLOG_STATE *state, - int tok, - const char *ptr, - const char *end, - const ENCODING *enc) -{ - switch (tok) { - case XML_TOK_PROLOG_S: - return XML_ROLE_ATTLIST_NONE; - case XML_TOK_DECL_CLOSE: - setTopLevel(state); - return XML_ROLE_ATTLIST_NONE; - case XML_TOK_NAME: - case XML_TOK_PREFIXED_NAME: - state->handler = attlist2; - return XML_ROLE_ATTRIBUTE_NAME; - } - return common(state, tok); -} - -static int PTRCALL -attlist2(PROLOG_STATE *state, - int tok, - const char *ptr, - const char *end, - const ENCODING *enc) -{ - switch (tok) { - case XML_TOK_PROLOG_S: - return XML_ROLE_ATTLIST_NONE; - case XML_TOK_NAME: - { - static const char *types[] = { - KW_CDATA, - KW_ID, - KW_IDREF, - KW_IDREFS, - KW_ENTITY, - KW_ENTITIES, - KW_NMTOKEN, - KW_NMTOKENS, - }; - int i; - for (i = 0; i < (int)(sizeof(types)/sizeof(types[0])); i++) - if (XmlNameMatchesAscii(enc, ptr, end, types[i])) { - state->handler = attlist8; - return XML_ROLE_ATTRIBUTE_TYPE_CDATA + i; - } - } - if (XmlNameMatchesAscii(enc, ptr, end, KW_NOTATION)) { - state->handler = attlist5; - return XML_ROLE_ATTLIST_NONE; - } - break; - case XML_TOK_OPEN_PAREN: - state->handler = attlist3; - return XML_ROLE_ATTLIST_NONE; - } - return common(state, tok); -} - -static int PTRCALL -attlist3(PROLOG_STATE *state, - int tok, - const char *ptr, - const char *end, - const ENCODING *enc) -{ - switch (tok) { - case XML_TOK_PROLOG_S: - return XML_ROLE_ATTLIST_NONE; - case XML_TOK_NMTOKEN: - case XML_TOK_NAME: - case XML_TOK_PREFIXED_NAME: - state->handler = attlist4; - return XML_ROLE_ATTRIBUTE_ENUM_VALUE; - } - return common(state, tok); -} - -static int PTRCALL -attlist4(PROLOG_STATE *state, - int tok, - const char *ptr, - const char *end, - const ENCODING *enc) -{ - switch (tok) { - case XML_TOK_PROLOG_S: - return XML_ROLE_ATTLIST_NONE; - case XML_TOK_CLOSE_PAREN: - state->handler = attlist8; - return XML_ROLE_ATTLIST_NONE; - case XML_TOK_OR: - state->handler = attlist3; - return XML_ROLE_ATTLIST_NONE; - } - return common(state, tok); -} - -static int PTRCALL -attlist5(PROLOG_STATE *state, - int tok, - const char *ptr, - const char *end, - const ENCODING *enc) -{ - switch (tok) { - case XML_TOK_PROLOG_S: - return XML_ROLE_ATTLIST_NONE; - case XML_TOK_OPEN_PAREN: - state->handler = attlist6; - return XML_ROLE_ATTLIST_NONE; - } - return common(state, tok); -} - -static int PTRCALL -attlist6(PROLOG_STATE *state, - int tok, - const char *ptr, - const char *end, - const ENCODING *enc) -{ - switch (tok) { - case XML_TOK_PROLOG_S: - return XML_ROLE_ATTLIST_NONE; - case XML_TOK_NAME: - state->handler = attlist7; - return XML_ROLE_ATTRIBUTE_NOTATION_VALUE; - } - return common(state, tok); -} - -static int PTRCALL -attlist7(PROLOG_STATE *state, - int tok, - const char *ptr, - const char *end, - const ENCODING *enc) -{ - switch (tok) { - case XML_TOK_PROLOG_S: - return XML_ROLE_ATTLIST_NONE; - case XML_TOK_CLOSE_PAREN: - state->handler = attlist8; - return XML_ROLE_ATTLIST_NONE; - case XML_TOK_OR: - state->handler = attlist6; - return XML_ROLE_ATTLIST_NONE; - } - return common(state, tok); -} - -/* default value */ -static int PTRCALL -attlist8(PROLOG_STATE *state, - int tok, - const char *ptr, - const char *end, - const ENCODING *enc) -{ - switch (tok) { - case XML_TOK_PROLOG_S: - return XML_ROLE_ATTLIST_NONE; - case XML_TOK_POUND_NAME: - if (XmlNameMatchesAscii(enc, - ptr + MIN_BYTES_PER_CHAR(enc), - end, - KW_IMPLIED)) { - state->handler = attlist1; - return XML_ROLE_IMPLIED_ATTRIBUTE_VALUE; - } - if (XmlNameMatchesAscii(enc, - ptr + MIN_BYTES_PER_CHAR(enc), - end, - KW_REQUIRED)) { - state->handler = attlist1; - return XML_ROLE_REQUIRED_ATTRIBUTE_VALUE; - } - if (XmlNameMatchesAscii(enc, - ptr + MIN_BYTES_PER_CHAR(enc), - end, - KW_FIXED)) { - state->handler = attlist9; - return XML_ROLE_ATTLIST_NONE; - } - break; - case XML_TOK_LITERAL: - state->handler = attlist1; - return XML_ROLE_DEFAULT_ATTRIBUTE_VALUE; - } - return common(state, tok); -} - -static int PTRCALL -attlist9(PROLOG_STATE *state, - int tok, - const char *ptr, - const char *end, - const ENCODING *enc) -{ - switch (tok) { - case XML_TOK_PROLOG_S: - return XML_ROLE_ATTLIST_NONE; - case XML_TOK_LITERAL: - state->handler = attlist1; - return XML_ROLE_FIXED_ATTRIBUTE_VALUE; - } - return common(state, tok); -} - -static int PTRCALL -element0(PROLOG_STATE *state, - int tok, - const char *ptr, - const char *end, - const ENCODING *enc) -{ - switch (tok) { - case XML_TOK_PROLOG_S: - return XML_ROLE_ELEMENT_NONE; - case XML_TOK_NAME: - case XML_TOK_PREFIXED_NAME: - state->handler = element1; - return XML_ROLE_ELEMENT_NAME; - } - return common(state, tok); -} - -static int PTRCALL -element1(PROLOG_STATE *state, - int tok, - const char *ptr, - const char *end, - const ENCODING *enc) -{ - switch (tok) { - case XML_TOK_PROLOG_S: - return XML_ROLE_ELEMENT_NONE; - case XML_TOK_NAME: - if (XmlNameMatchesAscii(enc, ptr, end, KW_EMPTY)) { - state->handler = declClose; - state->role_none = XML_ROLE_ELEMENT_NONE; - return XML_ROLE_CONTENT_EMPTY; - } - if (XmlNameMatchesAscii(enc, ptr, end, KW_ANY)) { - state->handler = declClose; - state->role_none = XML_ROLE_ELEMENT_NONE; - return XML_ROLE_CONTENT_ANY; - } - break; - case XML_TOK_OPEN_PAREN: - state->handler = element2; - state->level = 1; - return XML_ROLE_GROUP_OPEN; - } - return common(state, tok); -} - -static int PTRCALL -element2(PROLOG_STATE *state, - int tok, - const char *ptr, - const char *end, - const ENCODING *enc) -{ - switch (tok) { - case XML_TOK_PROLOG_S: - return XML_ROLE_ELEMENT_NONE; - case XML_TOK_POUND_NAME: - if (XmlNameMatchesAscii(enc, - ptr + MIN_BYTES_PER_CHAR(enc), - end, - KW_PCDATA)) { - state->handler = element3; - return XML_ROLE_CONTENT_PCDATA; - } - break; - case XML_TOK_OPEN_PAREN: - state->level = 2; - state->handler = element6; - return XML_ROLE_GROUP_OPEN; - case XML_TOK_NAME: - case XML_TOK_PREFIXED_NAME: - state->handler = element7; - return XML_ROLE_CONTENT_ELEMENT; - case XML_TOK_NAME_QUESTION: - state->handler = element7; - return XML_ROLE_CONTENT_ELEMENT_OPT; - case XML_TOK_NAME_ASTERISK: - state->handler = element7; - return XML_ROLE_CONTENT_ELEMENT_REP; - case XML_TOK_NAME_PLUS: - state->handler = element7; - return XML_ROLE_CONTENT_ELEMENT_PLUS; - } - return common(state, tok); -} - -static int PTRCALL -element3(PROLOG_STATE *state, - int tok, - const char *ptr, - const char *end, - const ENCODING *enc) -{ - switch (tok) { - case XML_TOK_PROLOG_S: - return XML_ROLE_ELEMENT_NONE; - case XML_TOK_CLOSE_PAREN: - state->handler = declClose; - state->role_none = XML_ROLE_ELEMENT_NONE; - return XML_ROLE_GROUP_CLOSE; - case XML_TOK_CLOSE_PAREN_ASTERISK: - state->handler = declClose; - state->role_none = XML_ROLE_ELEMENT_NONE; - return XML_ROLE_GROUP_CLOSE_REP; - case XML_TOK_OR: - state->handler = element4; - return XML_ROLE_ELEMENT_NONE; - } - return common(state, tok); -} - -static int PTRCALL -element4(PROLOG_STATE *state, - int tok, - const char *ptr, - const char *end, - const ENCODING *enc) -{ - switch (tok) { - case XML_TOK_PROLOG_S: - return XML_ROLE_ELEMENT_NONE; - case XML_TOK_NAME: - case XML_TOK_PREFIXED_NAME: - state->handler = element5; - return XML_ROLE_CONTENT_ELEMENT; - } - return common(state, tok); -} - -static int PTRCALL -element5(PROLOG_STATE *state, - int tok, - const char *ptr, - const char *end, - const ENCODING *enc) -{ - switch (tok) { - case XML_TOK_PROLOG_S: - return XML_ROLE_ELEMENT_NONE; - case XML_TOK_CLOSE_PAREN_ASTERISK: - state->handler = declClose; - state->role_none = XML_ROLE_ELEMENT_NONE; - return XML_ROLE_GROUP_CLOSE_REP; - case XML_TOK_OR: - state->handler = element4; - return XML_ROLE_ELEMENT_NONE; - } - return common(state, tok); -} - -static int PTRCALL -element6(PROLOG_STATE *state, - int tok, - const char *ptr, - const char *end, - const ENCODING *enc) -{ - switch (tok) { - case XML_TOK_PROLOG_S: - return XML_ROLE_ELEMENT_NONE; - case XML_TOK_OPEN_PAREN: - state->level += 1; - return XML_ROLE_GROUP_OPEN; - case XML_TOK_NAME: - case XML_TOK_PREFIXED_NAME: - state->handler = element7; - return XML_ROLE_CONTENT_ELEMENT; - case XML_TOK_NAME_QUESTION: - state->handler = element7; - return XML_ROLE_CONTENT_ELEMENT_OPT; - case XML_TOK_NAME_ASTERISK: - state->handler = element7; - return XML_ROLE_CONTENT_ELEMENT_REP; - case XML_TOK_NAME_PLUS: - state->handler = element7; - return XML_ROLE_CONTENT_ELEMENT_PLUS; - } - return common(state, tok); -} - -static int PTRCALL -element7(PROLOG_STATE *state, - int tok, - const char *ptr, - const char *end, - const ENCODING *enc) -{ - switch (tok) { - case XML_TOK_PROLOG_S: - return XML_ROLE_ELEMENT_NONE; - case XML_TOK_CLOSE_PAREN: - state->level -= 1; - if (state->level == 0) { - state->handler = declClose; - state->role_none = XML_ROLE_ELEMENT_NONE; - } - return XML_ROLE_GROUP_CLOSE; - case XML_TOK_CLOSE_PAREN_ASTERISK: - state->level -= 1; - if (state->level == 0) { - state->handler = declClose; - state->role_none = XML_ROLE_ELEMENT_NONE; - } - return XML_ROLE_GROUP_CLOSE_REP; - case XML_TOK_CLOSE_PAREN_QUESTION: - state->level -= 1; - if (state->level == 0) { - state->handler = declClose; - state->role_none = XML_ROLE_ELEMENT_NONE; - } - return XML_ROLE_GROUP_CLOSE_OPT; - case XML_TOK_CLOSE_PAREN_PLUS: - state->level -= 1; - if (state->level == 0) { - state->handler = declClose; - state->role_none = XML_ROLE_ELEMENT_NONE; - } - return XML_ROLE_GROUP_CLOSE_PLUS; - case XML_TOK_COMMA: - state->handler = element6; - return XML_ROLE_GROUP_SEQUENCE; - case XML_TOK_OR: - state->handler = element6; - return XML_ROLE_GROUP_CHOICE; - } - return common(state, tok); -} - -#ifdef XML_DTD - -static int PTRCALL -condSect0(PROLOG_STATE *state, - int tok, - const char *ptr, - const char *end, - const ENCODING *enc) -{ - switch (tok) { - case XML_TOK_PROLOG_S: - return XML_ROLE_NONE; - case XML_TOK_NAME: - if (XmlNameMatchesAscii(enc, ptr, end, KW_INCLUDE)) { - state->handler = condSect1; - return XML_ROLE_NONE; - } - if (XmlNameMatchesAscii(enc, ptr, end, KW_IGNORE)) { - state->handler = condSect2; - return XML_ROLE_NONE; - } - break; - } - return common(state, tok); -} - -static int PTRCALL -condSect1(PROLOG_STATE *state, - int tok, - const char *ptr, - const char *end, - const ENCODING *enc) -{ - switch (tok) { - case XML_TOK_PROLOG_S: - return XML_ROLE_NONE; - case XML_TOK_OPEN_BRACKET: - state->handler = externalSubset1; - state->includeLevel += 1; - return XML_ROLE_NONE; - } - return common(state, tok); -} - -static int PTRCALL -condSect2(PROLOG_STATE *state, - int tok, - const char *ptr, - const char *end, - const ENCODING *enc) -{ - switch (tok) { - case XML_TOK_PROLOG_S: - return XML_ROLE_NONE; - case XML_TOK_OPEN_BRACKET: - state->handler = externalSubset1; - return XML_ROLE_IGNORE_SECT; - } - return common(state, tok); -} - -#endif /* XML_DTD */ - -static int PTRCALL -declClose(PROLOG_STATE *state, - int tok, - const char *ptr, - const char *end, - const ENCODING *enc) -{ - switch (tok) { - case XML_TOK_PROLOG_S: - return state->role_none; - case XML_TOK_DECL_CLOSE: - setTopLevel(state); - return state->role_none; - } - return common(state, tok); -} - -static int PTRCALL -error(PROLOG_STATE *state, - int tok, - const char *ptr, - const char *end, - const ENCODING *enc) -{ - return XML_ROLE_NONE; -} - -static int FASTCALL -common(PROLOG_STATE *state, int tok) -{ -#ifdef XML_DTD - if (!state->documentEntity && tok == XML_TOK_PARAM_ENTITY_REF) - return XML_ROLE_INNER_PARAM_ENTITY_REF; -#endif - state->handler = error; - return XML_ROLE_ERROR; -} - -void -XmlPrologStateInit(PROLOG_STATE *state) -{ - state->handler = prolog0; -#ifdef XML_DTD - state->documentEntity = 1; - state->includeLevel = 0; - state->inEntityValue = 0; -#endif /* XML_DTD */ -} - -#ifdef XML_DTD - -void -XmlPrologStateInitExternalEntity(PROLOG_STATE *state) -{ - state->handler = externalSubset0; - state->documentEntity = 0; - state->includeLevel = 0; -} - -#endif /* XML_DTD */ diff --git a/wxWidgets/src/expat/lib/xmlrole.h b/wxWidgets/src/expat/lib/xmlrole.h deleted file mode 100644 index 4dd9f06f97..0000000000 --- a/wxWidgets/src/expat/lib/xmlrole.h +++ /dev/null @@ -1,114 +0,0 @@ -/* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd - See the file COPYING for copying permission. -*/ - -#ifndef XmlRole_INCLUDED -#define XmlRole_INCLUDED 1 - -#ifdef __VMS -/* 0 1 2 3 0 1 2 3 - 1234567890123456789012345678901 1234567890123456789012345678901 */ -#define XmlPrologStateInitExternalEntity XmlPrologStateInitExternalEnt -#endif - -#include "xmltok.h" - -#ifdef __cplusplus -extern "C" { -#endif - -enum { - XML_ROLE_ERROR = -1, - XML_ROLE_NONE = 0, - XML_ROLE_XML_DECL, - XML_ROLE_INSTANCE_START, - XML_ROLE_DOCTYPE_NONE, - XML_ROLE_DOCTYPE_NAME, - XML_ROLE_DOCTYPE_SYSTEM_ID, - XML_ROLE_DOCTYPE_PUBLIC_ID, - XML_ROLE_DOCTYPE_INTERNAL_SUBSET, - XML_ROLE_DOCTYPE_CLOSE, - XML_ROLE_GENERAL_ENTITY_NAME, - XML_ROLE_PARAM_ENTITY_NAME, - XML_ROLE_ENTITY_NONE, - XML_ROLE_ENTITY_VALUE, - XML_ROLE_ENTITY_SYSTEM_ID, - XML_ROLE_ENTITY_PUBLIC_ID, - XML_ROLE_ENTITY_COMPLETE, - XML_ROLE_ENTITY_NOTATION_NAME, - XML_ROLE_NOTATION_NONE, - XML_ROLE_NOTATION_NAME, - XML_ROLE_NOTATION_SYSTEM_ID, - XML_ROLE_NOTATION_NO_SYSTEM_ID, - XML_ROLE_NOTATION_PUBLIC_ID, - XML_ROLE_ATTRIBUTE_NAME, - XML_ROLE_ATTRIBUTE_TYPE_CDATA, - XML_ROLE_ATTRIBUTE_TYPE_ID, - XML_ROLE_ATTRIBUTE_TYPE_IDREF, - XML_ROLE_ATTRIBUTE_TYPE_IDREFS, - XML_ROLE_ATTRIBUTE_TYPE_ENTITY, - XML_ROLE_ATTRIBUTE_TYPE_ENTITIES, - XML_ROLE_ATTRIBUTE_TYPE_NMTOKEN, - XML_ROLE_ATTRIBUTE_TYPE_NMTOKENS, - XML_ROLE_ATTRIBUTE_ENUM_VALUE, - XML_ROLE_ATTRIBUTE_NOTATION_VALUE, - XML_ROLE_ATTLIST_NONE, - XML_ROLE_ATTLIST_ELEMENT_NAME, - XML_ROLE_IMPLIED_ATTRIBUTE_VALUE, - XML_ROLE_REQUIRED_ATTRIBUTE_VALUE, - XML_ROLE_DEFAULT_ATTRIBUTE_VALUE, - XML_ROLE_FIXED_ATTRIBUTE_VALUE, - XML_ROLE_ELEMENT_NONE, - XML_ROLE_ELEMENT_NAME, - XML_ROLE_CONTENT_ANY, - XML_ROLE_CONTENT_EMPTY, - XML_ROLE_CONTENT_PCDATA, - XML_ROLE_GROUP_OPEN, - XML_ROLE_GROUP_CLOSE, - XML_ROLE_GROUP_CLOSE_REP, - XML_ROLE_GROUP_CLOSE_OPT, - XML_ROLE_GROUP_CLOSE_PLUS, - XML_ROLE_GROUP_CHOICE, - XML_ROLE_GROUP_SEQUENCE, - XML_ROLE_CONTENT_ELEMENT, - XML_ROLE_CONTENT_ELEMENT_REP, - XML_ROLE_CONTENT_ELEMENT_OPT, - XML_ROLE_CONTENT_ELEMENT_PLUS, - XML_ROLE_PI, - XML_ROLE_COMMENT, -#ifdef XML_DTD - XML_ROLE_TEXT_DECL, - XML_ROLE_IGNORE_SECT, - XML_ROLE_INNER_PARAM_ENTITY_REF, -#endif /* XML_DTD */ - XML_ROLE_PARAM_ENTITY_REF -}; - -typedef struct prolog_state { - int (PTRCALL *handler) (struct prolog_state *state, - int tok, - const char *ptr, - const char *end, - const ENCODING *enc); - unsigned level; - int role_none; -#ifdef XML_DTD - unsigned includeLevel; - int documentEntity; - int inEntityValue; -#endif /* XML_DTD */ -} PROLOG_STATE; - -void XmlPrologStateInit(PROLOG_STATE *); -#ifdef XML_DTD -void XmlPrologStateInitExternalEntity(PROLOG_STATE *); -#endif /* XML_DTD */ - -#define XmlTokenRole(state, tok, ptr, end, enc) \ - (((state)->handler)(state, tok, ptr, end, enc)) - -#ifdef __cplusplus -} -#endif - -#endif /* not XmlRole_INCLUDED */ diff --git a/wxWidgets/src/expat/lib/xmltok.c b/wxWidgets/src/expat/lib/xmltok.c deleted file mode 100644 index 9ed6d0333d..0000000000 --- a/wxWidgets/src/expat/lib/xmltok.c +++ /dev/null @@ -1,1636 +0,0 @@ -/* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd - See the file COPYING for copying permission. -*/ - -#ifdef COMPILED_FROM_DSP -#include "winconfig.h" -#elif defined(OS2_32) -#include "os2config.h" -#elif defined(__MSDOS__) -#include "dosconfig.h" -#elif defined(MACOS_CLASSIC) -#include "macconfig.h" -#else -#include "expat_config.h" -#endif /* ndef COMPILED_FROM_DSP */ - -#include "internal.h" -#include "xmltok.h" -#include "nametab.h" - -#ifdef XML_DTD -#define IGNORE_SECTION_TOK_VTABLE , PREFIX(ignoreSectionTok) -#else -#define IGNORE_SECTION_TOK_VTABLE /* as nothing */ -#endif - -#define VTABLE1 \ - { PREFIX(prologTok), PREFIX(contentTok), \ - PREFIX(cdataSectionTok) IGNORE_SECTION_TOK_VTABLE }, \ - { PREFIX(attributeValueTok), PREFIX(entityValueTok) }, \ - PREFIX(sameName), \ - PREFIX(nameMatchesAscii), \ - PREFIX(nameLength), \ - PREFIX(skipS), \ - PREFIX(getAtts), \ - PREFIX(charRefNumber), \ - PREFIX(predefinedEntityName), \ - PREFIX(updatePosition), \ - PREFIX(isPublicId) - -#define VTABLE VTABLE1, PREFIX(toUtf8), PREFIX(toUtf16) - -#define UCS2_GET_NAMING(pages, hi, lo) \ - (namingBitmap[(pages[hi] << 3) + ((lo) >> 5)] & (1 << ((lo) & 0x1F))) - -/* A 2 byte UTF-8 representation splits the characters 11 bits between - the bottom 5 and 6 bits of the bytes. We need 8 bits to index into - pages, 3 bits to add to that index and 5 bits to generate the mask. -*/ -#define UTF8_GET_NAMING2(pages, byte) \ - (namingBitmap[((pages)[(((byte)[0]) >> 2) & 7] << 3) \ - + ((((byte)[0]) & 3) << 1) \ - + ((((byte)[1]) >> 5) & 1)] \ - & (1 << (((byte)[1]) & 0x1F))) - -/* A 3 byte UTF-8 representation splits the characters 16 bits between - the bottom 4, 6 and 6 bits of the bytes. We need 8 bits to index - into pages, 3 bits to add to that index and 5 bits to generate the - mask. -*/ -#define UTF8_GET_NAMING3(pages, byte) \ - (namingBitmap[((pages)[((((byte)[0]) & 0xF) << 4) \ - + ((((byte)[1]) >> 2) & 0xF)] \ - << 3) \ - + ((((byte)[1]) & 3) << 1) \ - + ((((byte)[2]) >> 5) & 1)] \ - & (1 << (((byte)[2]) & 0x1F))) - -#define UTF8_GET_NAMING(pages, p, n) \ - ((n) == 2 \ - ? UTF8_GET_NAMING2(pages, (const unsigned char *)(p)) \ - : ((n) == 3 \ - ? UTF8_GET_NAMING3(pages, (const unsigned char *)(p)) \ - : 0)) - -/* Detection of invalid UTF-8 sequences is based on Table 3.1B - of Unicode 3.2: http://www.unicode.org/unicode/reports/tr28/ - with the additional restriction of not allowing the Unicode - code points 0xFFFF and 0xFFFE (sequences EF,BF,BF and EF,BF,BE). - Implementation details: - (A & 0x80) == 0 means A < 0x80 - and - (A & 0xC0) == 0xC0 means A > 0xBF -*/ - -#define UTF8_INVALID2(p) \ - ((*p) < 0xC2 || ((p)[1] & 0x80) == 0 || ((p)[1] & 0xC0) == 0xC0) - -#define UTF8_INVALID3(p) \ - (((p)[2] & 0x80) == 0 \ - || \ - ((*p) == 0xEF && (p)[1] == 0xBF \ - ? \ - (p)[2] > 0xBD \ - : \ - ((p)[2] & 0xC0) == 0xC0) \ - || \ - ((*p) == 0xE0 \ - ? \ - (p)[1] < 0xA0 || ((p)[1] & 0xC0) == 0xC0 \ - : \ - ((p)[1] & 0x80) == 0 \ - || \ - ((*p) == 0xED ? (p)[1] > 0x9F : ((p)[1] & 0xC0) == 0xC0))) - -#define UTF8_INVALID4(p) \ - (((p)[3] & 0x80) == 0 || ((p)[3] & 0xC0) == 0xC0 \ - || \ - ((p)[2] & 0x80) == 0 || ((p)[2] & 0xC0) == 0xC0 \ - || \ - ((*p) == 0xF0 \ - ? \ - (p)[1] < 0x90 || ((p)[1] & 0xC0) == 0xC0 \ - : \ - ((p)[1] & 0x80) == 0 \ - || \ - ((*p) == 0xF4 ? (p)[1] > 0x8F : ((p)[1] & 0xC0) == 0xC0))) - -static int PTRFASTCALL -isNever(const ENCODING *enc, const char *p) -{ - return 0; -} - -static int PTRFASTCALL -utf8_isName2(const ENCODING *enc, const char *p) -{ - return UTF8_GET_NAMING2(namePages, (const unsigned char *)p); -} - -static int PTRFASTCALL -utf8_isName3(const ENCODING *enc, const char *p) -{ - return UTF8_GET_NAMING3(namePages, (const unsigned char *)p); -} - -#define utf8_isName4 isNever - -static int PTRFASTCALL -utf8_isNmstrt2(const ENCODING *enc, const char *p) -{ - return UTF8_GET_NAMING2(nmstrtPages, (const unsigned char *)p); -} - -static int PTRFASTCALL -utf8_isNmstrt3(const ENCODING *enc, const char *p) -{ - return UTF8_GET_NAMING3(nmstrtPages, (const unsigned char *)p); -} - -#define utf8_isNmstrt4 isNever - -static int PTRFASTCALL -utf8_isInvalid2(const ENCODING *enc, const char *p) -{ - return UTF8_INVALID2((const unsigned char *)p); -} - -static int PTRFASTCALL -utf8_isInvalid3(const ENCODING *enc, const char *p) -{ - return UTF8_INVALID3((const unsigned char *)p); -} - -static int PTRFASTCALL -utf8_isInvalid4(const ENCODING *enc, const char *p) -{ - return UTF8_INVALID4((const unsigned char *)p); -} - -struct normal_encoding { - ENCODING enc; - unsigned char type[256]; -#ifdef XML_MIN_SIZE - int (PTRFASTCALL *byteType)(const ENCODING *, const char *); - int (PTRFASTCALL *isNameMin)(const ENCODING *, const char *); - int (PTRFASTCALL *isNmstrtMin)(const ENCODING *, const char *); - int (PTRFASTCALL *byteToAscii)(const ENCODING *, const char *); - int (PTRCALL *charMatches)(const ENCODING *, const char *, int); -#endif /* XML_MIN_SIZE */ - int (PTRFASTCALL *isName2)(const ENCODING *, const char *); - int (PTRFASTCALL *isName3)(const ENCODING *, const char *); - int (PTRFASTCALL *isName4)(const ENCODING *, const char *); - int (PTRFASTCALL *isNmstrt2)(const ENCODING *, const char *); - int (PTRFASTCALL *isNmstrt3)(const ENCODING *, const char *); - int (PTRFASTCALL *isNmstrt4)(const ENCODING *, const char *); - int (PTRFASTCALL *isInvalid2)(const ENCODING *, const char *); - int (PTRFASTCALL *isInvalid3)(const ENCODING *, const char *); - int (PTRFASTCALL *isInvalid4)(const ENCODING *, const char *); -}; - -#define AS_NORMAL_ENCODING(enc) ((const struct normal_encoding *) (enc)) - -#ifdef XML_MIN_SIZE - -#define STANDARD_VTABLE(E) \ - E ## byteType, \ - E ## isNameMin, \ - E ## isNmstrtMin, \ - E ## byteToAscii, \ - E ## charMatches, - -#else - -#define STANDARD_VTABLE(E) /* as nothing */ - -#endif - -#define NORMAL_VTABLE(E) \ - E ## isName2, \ - E ## isName3, \ - E ## isName4, \ - E ## isNmstrt2, \ - E ## isNmstrt3, \ - E ## isNmstrt4, \ - E ## isInvalid2, \ - E ## isInvalid3, \ - E ## isInvalid4 - -static int FASTCALL checkCharRefNumber(int); - -#include "xmltok_impl.h" -#include "ascii.h" - -#ifdef XML_MIN_SIZE -#define sb_isNameMin isNever -#define sb_isNmstrtMin isNever -#endif - -#ifdef XML_MIN_SIZE -#define MINBPC(enc) ((enc)->minBytesPerChar) -#else -/* minimum bytes per character */ -#define MINBPC(enc) 1 -#endif - -#define SB_BYTE_TYPE(enc, p) \ - (((struct normal_encoding *)(enc))->type[(unsigned char)*(p)]) - -#ifdef XML_MIN_SIZE -static int PTRFASTCALL -sb_byteType(const ENCODING *enc, const char *p) -{ - return SB_BYTE_TYPE(enc, p); -} -#define BYTE_TYPE(enc, p) \ - (AS_NORMAL_ENCODING(enc)->byteType(enc, p)) -#else -#define BYTE_TYPE(enc, p) SB_BYTE_TYPE(enc, p) -#endif - -#ifdef XML_MIN_SIZE -#define BYTE_TO_ASCII(enc, p) \ - (AS_NORMAL_ENCODING(enc)->byteToAscii(enc, p)) -static int PTRFASTCALL -sb_byteToAscii(const ENCODING *enc, const char *p) -{ - return *p; -} -#else -#define BYTE_TO_ASCII(enc, p) (*(p)) -#endif - -#define IS_NAME_CHAR(enc, p, n) \ - (AS_NORMAL_ENCODING(enc)->isName ## n(enc, p)) -#define IS_NMSTRT_CHAR(enc, p, n) \ - (AS_NORMAL_ENCODING(enc)->isNmstrt ## n(enc, p)) -#define IS_INVALID_CHAR(enc, p, n) \ - (AS_NORMAL_ENCODING(enc)->isInvalid ## n(enc, p)) - -#ifdef XML_MIN_SIZE -#define IS_NAME_CHAR_MINBPC(enc, p) \ - (AS_NORMAL_ENCODING(enc)->isNameMin(enc, p)) -#define IS_NMSTRT_CHAR_MINBPC(enc, p) \ - (AS_NORMAL_ENCODING(enc)->isNmstrtMin(enc, p)) -#else -#define IS_NAME_CHAR_MINBPC(enc, p) (0) -#define IS_NMSTRT_CHAR_MINBPC(enc, p) (0) -#endif - -#ifdef XML_MIN_SIZE -#define CHAR_MATCHES(enc, p, c) \ - (AS_NORMAL_ENCODING(enc)->charMatches(enc, p, c)) -static int PTRCALL -sb_charMatches(const ENCODING *enc, const char *p, int c) -{ - return *p == c; -} -#else -/* c is an ASCII character */ -#define CHAR_MATCHES(enc, p, c) (*(p) == c) -#endif - -#define PREFIX(ident) normal_ ## ident -#include "xmltok_impl.c" - -#undef MINBPC -#undef BYTE_TYPE -#undef BYTE_TO_ASCII -#undef CHAR_MATCHES -#undef IS_NAME_CHAR -#undef IS_NAME_CHAR_MINBPC -#undef IS_NMSTRT_CHAR -#undef IS_NMSTRT_CHAR_MINBPC -#undef IS_INVALID_CHAR - -enum { /* UTF8_cvalN is value of masked first byte of N byte sequence */ - UTF8_cval1 = 0x00, - UTF8_cval2 = 0xc0, - UTF8_cval3 = 0xe0, - UTF8_cval4 = 0xf0 -}; - -static void PTRCALL -utf8_toUtf8(const ENCODING *enc, - const char **fromP, const char *fromLim, - char **toP, const char *toLim) -{ - char *to; - const char *from; - if (fromLim - *fromP > toLim - *toP) { - /* Avoid copying partial characters. */ - for (fromLim = *fromP + (toLim - *toP); fromLim > *fromP; fromLim--) - if (((unsigned char)fromLim[-1] & 0xc0) != 0x80) - break; - } - for (to = *toP, from = *fromP; from != fromLim; from++, to++) - *to = *from; - *fromP = from; - *toP = to; -} - -static void PTRCALL -utf8_toUtf16(const ENCODING *enc, - const char **fromP, const char *fromLim, - unsigned short **toP, const unsigned short *toLim) -{ - unsigned short *to = *toP; - const char *from = *fromP; - while (from != fromLim && to != toLim) { - switch (((struct normal_encoding *)enc)->type[(unsigned char)*from]) { - case BT_LEAD2: - *to++ = (unsigned short)(((from[0] & 0x1f) << 6) | (from[1] & 0x3f)); - from += 2; - break; - case BT_LEAD3: - *to++ = (unsigned short)(((from[0] & 0xf) << 12) - | ((from[1] & 0x3f) << 6) | (from[2] & 0x3f)); - from += 3; - break; - case BT_LEAD4: - { - unsigned long n; - if (to + 1 == toLim) - goto after; - n = ((from[0] & 0x7) << 18) | ((from[1] & 0x3f) << 12) - | ((from[2] & 0x3f) << 6) | (from[3] & 0x3f); - n -= 0x10000; - to[0] = (unsigned short)((n >> 10) | 0xD800); - to[1] = (unsigned short)((n & 0x3FF) | 0xDC00); - to += 2; - from += 4; - } - break; - default: - *to++ = *from++; - break; - } - } -after: - *fromP = from; - *toP = to; -} - -#ifdef XML_NS -static const struct normal_encoding utf8_encoding_ns = { - { VTABLE1, utf8_toUtf8, utf8_toUtf16, 1, 1, 0 }, - { -#include "asciitab.h" -#include "utf8tab.h" - }, - STANDARD_VTABLE(sb_) NORMAL_VTABLE(utf8_) -}; -#endif - -static const struct normal_encoding utf8_encoding = { - { VTABLE1, utf8_toUtf8, utf8_toUtf16, 1, 1, 0 }, - { -#define BT_COLON BT_NMSTRT -#include "asciitab.h" -#undef BT_COLON -#include "utf8tab.h" - }, - STANDARD_VTABLE(sb_) NORMAL_VTABLE(utf8_) -}; - -#ifdef XML_NS - -static const struct normal_encoding internal_utf8_encoding_ns = { - { VTABLE1, utf8_toUtf8, utf8_toUtf16, 1, 1, 0 }, - { -#include "iasciitab.h" -#include "utf8tab.h" - }, - STANDARD_VTABLE(sb_) NORMAL_VTABLE(utf8_) -}; - -#endif - -static const struct normal_encoding internal_utf8_encoding = { - { VTABLE1, utf8_toUtf8, utf8_toUtf16, 1, 1, 0 }, - { -#define BT_COLON BT_NMSTRT -#include "iasciitab.h" -#undef BT_COLON -#include "utf8tab.h" - }, - STANDARD_VTABLE(sb_) NORMAL_VTABLE(utf8_) -}; - -static void PTRCALL -latin1_toUtf8(const ENCODING *enc, - const char **fromP, const char *fromLim, - char **toP, const char *toLim) -{ - for (;;) { - unsigned char c; - if (*fromP == fromLim) - break; - c = (unsigned char)**fromP; - if (c & 0x80) { - if (toLim - *toP < 2) - break; - *(*toP)++ = (char)((c >> 6) | UTF8_cval2); - *(*toP)++ = (char)((c & 0x3f) | 0x80); - (*fromP)++; - } - else { - if (*toP == toLim) - break; - *(*toP)++ = *(*fromP)++; - } - } -} - -static void PTRCALL -latin1_toUtf16(const ENCODING *enc, - const char **fromP, const char *fromLim, - unsigned short **toP, const unsigned short *toLim) -{ - while (*fromP != fromLim && *toP != toLim) - *(*toP)++ = (unsigned char)*(*fromP)++; -} - -#ifdef XML_NS - -static const struct normal_encoding latin1_encoding_ns = { - { VTABLE1, latin1_toUtf8, latin1_toUtf16, 1, 0, 0 }, - { -#include "asciitab.h" -#include "latin1tab.h" - }, - STANDARD_VTABLE(sb_) -}; - -#endif - -static const struct normal_encoding latin1_encoding = { - { VTABLE1, latin1_toUtf8, latin1_toUtf16, 1, 0, 0 }, - { -#define BT_COLON BT_NMSTRT -#include "asciitab.h" -#undef BT_COLON -#include "latin1tab.h" - }, - STANDARD_VTABLE(sb_) -}; - -static void PTRCALL -ascii_toUtf8(const ENCODING *enc, - const char **fromP, const char *fromLim, - char **toP, const char *toLim) -{ - while (*fromP != fromLim && *toP != toLim) - *(*toP)++ = *(*fromP)++; -} - -#ifdef XML_NS - -static const struct normal_encoding ascii_encoding_ns = { - { VTABLE1, ascii_toUtf8, latin1_toUtf16, 1, 1, 0 }, - { -#include "asciitab.h" -/* BT_NONXML == 0 */ - }, - STANDARD_VTABLE(sb_) -}; - -#endif - -static const struct normal_encoding ascii_encoding = { - { VTABLE1, ascii_toUtf8, latin1_toUtf16, 1, 1, 0 }, - { -#define BT_COLON BT_NMSTRT -#include "asciitab.h" -#undef BT_COLON -/* BT_NONXML == 0 */ - }, - STANDARD_VTABLE(sb_) -}; - -static int PTRFASTCALL -unicode_byte_type(char hi, char lo) -{ - switch ((unsigned char)hi) { - case 0xD8: case 0xD9: case 0xDA: case 0xDB: - return BT_LEAD4; - case 0xDC: case 0xDD: case 0xDE: case 0xDF: - return BT_TRAIL; - case 0xFF: - switch ((unsigned char)lo) { - case 0xFF: - case 0xFE: - return BT_NONXML; - } - break; - } - return BT_NONASCII; -} - -#define DEFINE_UTF16_TO_UTF8(E) \ -static void PTRCALL \ -E ## toUtf8(const ENCODING *enc, \ - const char **fromP, const char *fromLim, \ - char **toP, const char *toLim) \ -{ \ - const char *from; \ - for (from = *fromP; from != fromLim; from += 2) { \ - int plane; \ - unsigned char lo2; \ - unsigned char lo = GET_LO(from); \ - unsigned char hi = GET_HI(from); \ - switch (hi) { \ - case 0: \ - if (lo < 0x80) { \ - if (*toP == toLim) { \ - *fromP = from; \ - return; \ - } \ - *(*toP)++ = lo; \ - break; \ - } \ - /* fall through */ \ - case 0x1: case 0x2: case 0x3: \ - case 0x4: case 0x5: case 0x6: case 0x7: \ - if (toLim - *toP < 2) { \ - *fromP = from; \ - return; \ - } \ - *(*toP)++ = ((lo >> 6) | (hi << 2) | UTF8_cval2); \ - *(*toP)++ = ((lo & 0x3f) | 0x80); \ - break; \ - default: \ - if (toLim - *toP < 3) { \ - *fromP = from; \ - return; \ - } \ - /* 16 bits divided 4, 6, 6 amongst 3 bytes */ \ - *(*toP)++ = ((hi >> 4) | UTF8_cval3); \ - *(*toP)++ = (((hi & 0xf) << 2) | (lo >> 6) | 0x80); \ - *(*toP)++ = ((lo & 0x3f) | 0x80); \ - break; \ - case 0xD8: case 0xD9: case 0xDA: case 0xDB: \ - if (toLim - *toP < 4) { \ - *fromP = from; \ - return; \ - } \ - plane = (((hi & 0x3) << 2) | ((lo >> 6) & 0x3)) + 1; \ - *(*toP)++ = ((plane >> 2) | UTF8_cval4); \ - *(*toP)++ = (((lo >> 2) & 0xF) | ((plane & 0x3) << 4) | 0x80); \ - from += 2; \ - lo2 = GET_LO(from); \ - *(*toP)++ = (((lo & 0x3) << 4) \ - | ((GET_HI(from) & 0x3) << 2) \ - | (lo2 >> 6) \ - | 0x80); \ - *(*toP)++ = ((lo2 & 0x3f) | 0x80); \ - break; \ - } \ - } \ - *fromP = from; \ -} - -#define DEFINE_UTF16_TO_UTF16(E) \ -static void PTRCALL \ -E ## toUtf16(const ENCODING *enc, \ - const char **fromP, const char *fromLim, \ - unsigned short **toP, const unsigned short *toLim) \ -{ \ - /* Avoid copying first half only of surrogate */ \ - if (fromLim - *fromP > ((toLim - *toP) << 1) \ - && (GET_HI(fromLim - 2) & 0xF8) == 0xD8) \ - fromLim -= 2; \ - for (; *fromP != fromLim && *toP != toLim; *fromP += 2) \ - *(*toP)++ = (GET_HI(*fromP) << 8) | GET_LO(*fromP); \ -} - -#define SET2(ptr, ch) \ - (((ptr)[0] = ((ch) & 0xff)), ((ptr)[1] = ((ch) >> 8))) -#define GET_LO(ptr) ((unsigned char)(ptr)[0]) -#define GET_HI(ptr) ((unsigned char)(ptr)[1]) - -DEFINE_UTF16_TO_UTF8(little2_) -DEFINE_UTF16_TO_UTF16(little2_) - -#undef SET2 -#undef GET_LO -#undef GET_HI - -#define SET2(ptr, ch) \ - (((ptr)[0] = ((ch) >> 8)), ((ptr)[1] = ((ch) & 0xFF))) -#define GET_LO(ptr) ((unsigned char)(ptr)[1]) -#define GET_HI(ptr) ((unsigned char)(ptr)[0]) - -DEFINE_UTF16_TO_UTF8(big2_) -DEFINE_UTF16_TO_UTF16(big2_) - -#undef SET2 -#undef GET_LO -#undef GET_HI - -#define LITTLE2_BYTE_TYPE(enc, p) \ - ((p)[1] == 0 \ - ? ((struct normal_encoding *)(enc))->type[(unsigned char)*(p)] \ - : unicode_byte_type((p)[1], (p)[0])) -#define LITTLE2_BYTE_TO_ASCII(enc, p) ((p)[1] == 0 ? (p)[0] : -1) -#define LITTLE2_CHAR_MATCHES(enc, p, c) ((p)[1] == 0 && (p)[0] == c) -#define LITTLE2_IS_NAME_CHAR_MINBPC(enc, p) \ - UCS2_GET_NAMING(namePages, (unsigned char)p[1], (unsigned char)p[0]) -#define LITTLE2_IS_NMSTRT_CHAR_MINBPC(enc, p) \ - UCS2_GET_NAMING(nmstrtPages, (unsigned char)p[1], (unsigned char)p[0]) - -#ifdef XML_MIN_SIZE - -static int PTRFASTCALL -little2_byteType(const ENCODING *enc, const char *p) -{ - return LITTLE2_BYTE_TYPE(enc, p); -} - -static int PTRFASTCALL -little2_byteToAscii(const ENCODING *enc, const char *p) -{ - return LITTLE2_BYTE_TO_ASCII(enc, p); -} - -static int PTRCALL -little2_charMatches(const ENCODING *enc, const char *p, int c) -{ - return LITTLE2_CHAR_MATCHES(enc, p, c); -} - -static int PTRFASTCALL -little2_isNameMin(const ENCODING *enc, const char *p) -{ - return LITTLE2_IS_NAME_CHAR_MINBPC(enc, p); -} - -static int PTRFASTCALL -little2_isNmstrtMin(const ENCODING *enc, const char *p) -{ - return LITTLE2_IS_NMSTRT_CHAR_MINBPC(enc, p); -} - -#undef VTABLE -#define VTABLE VTABLE1, little2_toUtf8, little2_toUtf16 - -#else /* not XML_MIN_SIZE */ - -#undef PREFIX -#define PREFIX(ident) little2_ ## ident -#define MINBPC(enc) 2 -/* CHAR_MATCHES is guaranteed to have MINBPC bytes available. */ -#define BYTE_TYPE(enc, p) LITTLE2_BYTE_TYPE(enc, p) -#define BYTE_TO_ASCII(enc, p) LITTLE2_BYTE_TO_ASCII(enc, p) -#define CHAR_MATCHES(enc, p, c) LITTLE2_CHAR_MATCHES(enc, p, c) -#define IS_NAME_CHAR(enc, p, n) 0 -#define IS_NAME_CHAR_MINBPC(enc, p) LITTLE2_IS_NAME_CHAR_MINBPC(enc, p) -#define IS_NMSTRT_CHAR(enc, p, n) (0) -#define IS_NMSTRT_CHAR_MINBPC(enc, p) LITTLE2_IS_NMSTRT_CHAR_MINBPC(enc, p) - -#include "xmltok_impl.c" - -#undef MINBPC -#undef BYTE_TYPE -#undef BYTE_TO_ASCII -#undef CHAR_MATCHES -#undef IS_NAME_CHAR -#undef IS_NAME_CHAR_MINBPC -#undef IS_NMSTRT_CHAR -#undef IS_NMSTRT_CHAR_MINBPC -#undef IS_INVALID_CHAR - -#endif /* not XML_MIN_SIZE */ - -#ifdef XML_NS - -static const struct normal_encoding little2_encoding_ns = { - { VTABLE, 2, 0, -#if BYTEORDER == 1234 - 1 -#else - 0 -#endif - }, - { -#include "asciitab.h" -#include "latin1tab.h" - }, - STANDARD_VTABLE(little2_) -}; - -#endif - -static const struct normal_encoding little2_encoding = { - { VTABLE, 2, 0, -#if BYTEORDER == 1234 - 1 -#else - 0 -#endif - }, - { -#define BT_COLON BT_NMSTRT -#include "asciitab.h" -#undef BT_COLON -#include "latin1tab.h" - }, - STANDARD_VTABLE(little2_) -}; - -#if BYTEORDER != 4321 - -#ifdef XML_NS - -static const struct normal_encoding internal_little2_encoding_ns = { - { VTABLE, 2, 0, 1 }, - { -#include "iasciitab.h" -#include "latin1tab.h" - }, - STANDARD_VTABLE(little2_) -}; - -#endif - -static const struct normal_encoding internal_little2_encoding = { - { VTABLE, 2, 0, 1 }, - { -#define BT_COLON BT_NMSTRT -#include "iasciitab.h" -#undef BT_COLON -#include "latin1tab.h" - }, - STANDARD_VTABLE(little2_) -}; - -#endif - - -#define BIG2_BYTE_TYPE(enc, p) \ - ((p)[0] == 0 \ - ? ((struct normal_encoding *)(enc))->type[(unsigned char)(p)[1]] \ - : unicode_byte_type((p)[0], (p)[1])) -#define BIG2_BYTE_TO_ASCII(enc, p) ((p)[0] == 0 ? (p)[1] : -1) -#define BIG2_CHAR_MATCHES(enc, p, c) ((p)[0] == 0 && (p)[1] == c) -#define BIG2_IS_NAME_CHAR_MINBPC(enc, p) \ - UCS2_GET_NAMING(namePages, (unsigned char)p[0], (unsigned char)p[1]) -#define BIG2_IS_NMSTRT_CHAR_MINBPC(enc, p) \ - UCS2_GET_NAMING(nmstrtPages, (unsigned char)p[0], (unsigned char)p[1]) - -#ifdef XML_MIN_SIZE - -static int PTRFASTCALL -big2_byteType(const ENCODING *enc, const char *p) -{ - return BIG2_BYTE_TYPE(enc, p); -} - -static int PTRFASTCALL -big2_byteToAscii(const ENCODING *enc, const char *p) -{ - return BIG2_BYTE_TO_ASCII(enc, p); -} - -static int PTRCALL -big2_charMatches(const ENCODING *enc, const char *p, int c) -{ - return BIG2_CHAR_MATCHES(enc, p, c); -} - -static int PTRFASTCALL -big2_isNameMin(const ENCODING *enc, const char *p) -{ - return BIG2_IS_NAME_CHAR_MINBPC(enc, p); -} - -static int PTRFASTCALL -big2_isNmstrtMin(const ENCODING *enc, const char *p) -{ - return BIG2_IS_NMSTRT_CHAR_MINBPC(enc, p); -} - -#undef VTABLE -#define VTABLE VTABLE1, big2_toUtf8, big2_toUtf16 - -#else /* not XML_MIN_SIZE */ - -#undef PREFIX -#define PREFIX(ident) big2_ ## ident -#define MINBPC(enc) 2 -/* CHAR_MATCHES is guaranteed to have MINBPC bytes available. */ -#define BYTE_TYPE(enc, p) BIG2_BYTE_TYPE(enc, p) -#define BYTE_TO_ASCII(enc, p) BIG2_BYTE_TO_ASCII(enc, p) -#define CHAR_MATCHES(enc, p, c) BIG2_CHAR_MATCHES(enc, p, c) -#define IS_NAME_CHAR(enc, p, n) 0 -#define IS_NAME_CHAR_MINBPC(enc, p) BIG2_IS_NAME_CHAR_MINBPC(enc, p) -#define IS_NMSTRT_CHAR(enc, p, n) (0) -#define IS_NMSTRT_CHAR_MINBPC(enc, p) BIG2_IS_NMSTRT_CHAR_MINBPC(enc, p) - -#include "xmltok_impl.c" - -#undef MINBPC -#undef BYTE_TYPE -#undef BYTE_TO_ASCII -#undef CHAR_MATCHES -#undef IS_NAME_CHAR -#undef IS_NAME_CHAR_MINBPC -#undef IS_NMSTRT_CHAR -#undef IS_NMSTRT_CHAR_MINBPC -#undef IS_INVALID_CHAR - -#endif /* not XML_MIN_SIZE */ - -#ifdef XML_NS - -static const struct normal_encoding big2_encoding_ns = { - { VTABLE, 2, 0, -#if BYTEORDER == 4321 - 1 -#else - 0 -#endif - }, - { -#include "asciitab.h" -#include "latin1tab.h" - }, - STANDARD_VTABLE(big2_) -}; - -#endif - -static const struct normal_encoding big2_encoding = { - { VTABLE, 2, 0, -#if BYTEORDER == 4321 - 1 -#else - 0 -#endif - }, - { -#define BT_COLON BT_NMSTRT -#include "asciitab.h" -#undef BT_COLON -#include "latin1tab.h" - }, - STANDARD_VTABLE(big2_) -}; - -#if BYTEORDER != 1234 - -#ifdef XML_NS - -static const struct normal_encoding internal_big2_encoding_ns = { - { VTABLE, 2, 0, 1 }, - { -#include "iasciitab.h" -#include "latin1tab.h" - }, - STANDARD_VTABLE(big2_) -}; - -#endif - -static const struct normal_encoding internal_big2_encoding = { - { VTABLE, 2, 0, 1 }, - { -#define BT_COLON BT_NMSTRT -#include "iasciitab.h" -#undef BT_COLON -#include "latin1tab.h" - }, - STANDARD_VTABLE(big2_) -}; - -#endif - -#undef PREFIX - -static int FASTCALL -streqci(const char *s1, const char *s2) -{ - for (;;) { - char c1 = *s1++; - char c2 = *s2++; - if (ASCII_a <= c1 && c1 <= ASCII_z) - c1 += ASCII_A - ASCII_a; - if (ASCII_a <= c2 && c2 <= ASCII_z) - c2 += ASCII_A - ASCII_a; - if (c1 != c2) - return 0; - if (!c1) - break; - } - return 1; -} - -static void PTRCALL -initUpdatePosition(const ENCODING *enc, const char *ptr, - const char *end, POSITION *pos) -{ - normal_updatePosition(&utf8_encoding.enc, ptr, end, pos); -} - -static int -toAscii(const ENCODING *enc, const char *ptr, const char *end) -{ - char buf[1]; - char *p = buf; - XmlUtf8Convert(enc, &ptr, end, &p, p + 1); - if (p == buf) - return -1; - else - return buf[0]; -} - -static int FASTCALL -isSpace(int c) -{ - switch (c) { - case 0x20: - case 0xD: - case 0xA: - case 0x9: - return 1; - } - return 0; -} - -/* Return 1 if there's just optional white space or there's an S - followed by name=val. -*/ -static int -parsePseudoAttribute(const ENCODING *enc, - const char *ptr, - const char *end, - const char **namePtr, - const char **nameEndPtr, - const char **valPtr, - const char **nextTokPtr) -{ - int c; - char open; - if (ptr == end) { - *namePtr = NULL; - return 1; - } - if (!isSpace(toAscii(enc, ptr, end))) { - *nextTokPtr = ptr; - return 0; - } - do { - ptr += enc->minBytesPerChar; - } while (isSpace(toAscii(enc, ptr, end))); - if (ptr == end) { - *namePtr = NULL; - return 1; - } - *namePtr = ptr; - for (;;) { - c = toAscii(enc, ptr, end); - if (c == -1) { - *nextTokPtr = ptr; - return 0; - } - if (c == ASCII_EQUALS) { - *nameEndPtr = ptr; - break; - } - if (isSpace(c)) { - *nameEndPtr = ptr; - do { - ptr += enc->minBytesPerChar; - } while (isSpace(c = toAscii(enc, ptr, end))); - if (c != ASCII_EQUALS) { - *nextTokPtr = ptr; - return 0; - } - break; - } - ptr += enc->minBytesPerChar; - } - if (ptr == *namePtr) { - *nextTokPtr = ptr; - return 0; - } - ptr += enc->minBytesPerChar; - c = toAscii(enc, ptr, end); - while (isSpace(c)) { - ptr += enc->minBytesPerChar; - c = toAscii(enc, ptr, end); - } - if (c != ASCII_QUOT && c != ASCII_APOS) { - *nextTokPtr = ptr; - return 0; - } - open = (char)c; - ptr += enc->minBytesPerChar; - *valPtr = ptr; - for (;; ptr += enc->minBytesPerChar) { - c = toAscii(enc, ptr, end); - if (c == open) - break; - if (!(ASCII_a <= c && c <= ASCII_z) - && !(ASCII_A <= c && c <= ASCII_Z) - && !(ASCII_0 <= c && c <= ASCII_9) - && c != ASCII_PERIOD - && c != ASCII_MINUS - && c != ASCII_UNDERSCORE) { - *nextTokPtr = ptr; - return 0; - } - } - *nextTokPtr = ptr + enc->minBytesPerChar; - return 1; -} - -static const char KW_version[] = { - ASCII_v, ASCII_e, ASCII_r, ASCII_s, ASCII_i, ASCII_o, ASCII_n, '\0' -}; - -static const char KW_encoding[] = { - ASCII_e, ASCII_n, ASCII_c, ASCII_o, ASCII_d, ASCII_i, ASCII_n, ASCII_g, '\0' -}; - -static const char KW_standalone[] = { - ASCII_s, ASCII_t, ASCII_a, ASCII_n, ASCII_d, ASCII_a, ASCII_l, ASCII_o, - ASCII_n, ASCII_e, '\0' -}; - -static const char KW_yes[] = { - ASCII_y, ASCII_e, ASCII_s, '\0' -}; - -static const char KW_no[] = { - ASCII_n, ASCII_o, '\0' -}; - -static int -doParseXmlDecl(const ENCODING *(*encodingFinder)(const ENCODING *, - const char *, - const char *), - int isGeneralTextEntity, - const ENCODING *enc, - const char *ptr, - const char *end, - const char **badPtr, - const char **versionPtr, - const char **versionEndPtr, - const char **encodingName, - const ENCODING **encoding, - int *standalone) -{ - const char *val = NULL; - const char *name = NULL; - const char *nameEnd = NULL; - ptr += 5 * enc->minBytesPerChar; - end -= 2 * enc->minBytesPerChar; - if (!parsePseudoAttribute(enc, ptr, end, &name, &nameEnd, &val, &ptr) - || !name) { - *badPtr = ptr; - return 0; - } - if (!XmlNameMatchesAscii(enc, name, nameEnd, KW_version)) { - if (!isGeneralTextEntity) { - *badPtr = name; - return 0; - } - } - else { - if (versionPtr) - *versionPtr = val; - if (versionEndPtr) - *versionEndPtr = ptr; - if (!parsePseudoAttribute(enc, ptr, end, &name, &nameEnd, &val, &ptr)) { - *badPtr = ptr; - return 0; - } - if (!name) { - if (isGeneralTextEntity) { - /* a TextDecl must have an EncodingDecl */ - *badPtr = ptr; - return 0; - } - return 1; - } - } - if (XmlNameMatchesAscii(enc, name, nameEnd, KW_encoding)) { - int c = toAscii(enc, val, end); - if (!(ASCII_a <= c && c <= ASCII_z) && !(ASCII_A <= c && c <= ASCII_Z)) { - *badPtr = val; - return 0; - } - if (encodingName) - *encodingName = val; - if (encoding) - *encoding = encodingFinder(enc, val, ptr - enc->minBytesPerChar); - if (!parsePseudoAttribute(enc, ptr, end, &name, &nameEnd, &val, &ptr)) { - *badPtr = ptr; - return 0; - } - if (!name) - return 1; - } - if (!XmlNameMatchesAscii(enc, name, nameEnd, KW_standalone) - || isGeneralTextEntity) { - *badPtr = name; - return 0; - } - if (XmlNameMatchesAscii(enc, val, ptr - enc->minBytesPerChar, KW_yes)) { - if (standalone) - *standalone = 1; - } - else if (XmlNameMatchesAscii(enc, val, ptr - enc->minBytesPerChar, KW_no)) { - if (standalone) - *standalone = 0; - } - else { - *badPtr = val; - return 0; - } - while (isSpace(toAscii(enc, ptr, end))) - ptr += enc->minBytesPerChar; - if (ptr != end) { - *badPtr = ptr; - return 0; - } - return 1; -} - -static int FASTCALL -checkCharRefNumber(int result) -{ - switch (result >> 8) { - case 0xD8: case 0xD9: case 0xDA: case 0xDB: - case 0xDC: case 0xDD: case 0xDE: case 0xDF: - return -1; - case 0: - if (latin1_encoding.type[result] == BT_NONXML) - return -1; - break; - case 0xFF: - if (result == 0xFFFE || result == 0xFFFF) - return -1; - break; - } - return result; -} - -int FASTCALL -XmlUtf8Encode(int c, char *buf) -{ - enum { - /* minN is minimum legal resulting value for N byte sequence */ - min2 = 0x80, - min3 = 0x800, - min4 = 0x10000 - }; - - if (c < 0) - return 0; - if (c < min2) { - buf[0] = (char)(c | UTF8_cval1); - return 1; - } - if (c < min3) { - buf[0] = (char)((c >> 6) | UTF8_cval2); - buf[1] = (char)((c & 0x3f) | 0x80); - return 2; - } - if (c < min4) { - buf[0] = (char)((c >> 12) | UTF8_cval3); - buf[1] = (char)(((c >> 6) & 0x3f) | 0x80); - buf[2] = (char)((c & 0x3f) | 0x80); - return 3; - } - if (c < 0x110000) { - buf[0] = (char)((c >> 18) | UTF8_cval4); - buf[1] = (char)(((c >> 12) & 0x3f) | 0x80); - buf[2] = (char)(((c >> 6) & 0x3f) | 0x80); - buf[3] = (char)((c & 0x3f) | 0x80); - return 4; - } - return 0; -} - -int FASTCALL -XmlUtf16Encode(int charNum, unsigned short *buf) -{ - if (charNum < 0) - return 0; - if (charNum < 0x10000) { - buf[0] = (unsigned short)charNum; - return 1; - } - if (charNum < 0x110000) { - charNum -= 0x10000; - buf[0] = (unsigned short)((charNum >> 10) + 0xD800); - buf[1] = (unsigned short)((charNum & 0x3FF) + 0xDC00); - return 2; - } - return 0; -} - -struct unknown_encoding { - struct normal_encoding normal; - int (*convert)(void *userData, const char *p); - void *userData; - unsigned short utf16[256]; - char utf8[256][4]; -}; - -#define AS_UNKNOWN_ENCODING(enc) ((const struct unknown_encoding *) (enc)) - -int -XmlSizeOfUnknownEncoding(void) -{ - return sizeof(struct unknown_encoding); -} - -static int PTRFASTCALL -unknown_isName(const ENCODING *enc, const char *p) -{ - const struct unknown_encoding *uenc = AS_UNKNOWN_ENCODING(enc); - int c = uenc->convert(uenc->userData, p); - if (c & ~0xFFFF) - return 0; - return UCS2_GET_NAMING(namePages, c >> 8, c & 0xFF); -} - -static int PTRFASTCALL -unknown_isNmstrt(const ENCODING *enc, const char *p) -{ - const struct unknown_encoding *uenc = AS_UNKNOWN_ENCODING(enc); - int c = uenc->convert(uenc->userData, p); - if (c & ~0xFFFF) - return 0; - return UCS2_GET_NAMING(nmstrtPages, c >> 8, c & 0xFF); -} - -static int PTRFASTCALL -unknown_isInvalid(const ENCODING *enc, const char *p) -{ - const struct unknown_encoding *uenc = AS_UNKNOWN_ENCODING(enc); - int c = uenc->convert(uenc->userData, p); - return (c & ~0xFFFF) || checkCharRefNumber(c) < 0; -} - -static void PTRCALL -unknown_toUtf8(const ENCODING *enc, - const char **fromP, const char *fromLim, - char **toP, const char *toLim) -{ - const struct unknown_encoding *uenc = AS_UNKNOWN_ENCODING(enc); - char buf[XML_UTF8_ENCODE_MAX]; - for (;;) { - const char *utf8; - int n; - if (*fromP == fromLim) - break; - utf8 = uenc->utf8[(unsigned char)**fromP]; - n = *utf8++; - if (n == 0) { - int c = uenc->convert(uenc->userData, *fromP); - n = XmlUtf8Encode(c, buf); - if (n > toLim - *toP) - break; - utf8 = buf; - *fromP += (AS_NORMAL_ENCODING(enc)->type[(unsigned char)**fromP] - - (BT_LEAD2 - 2)); - } - else { - if (n > toLim - *toP) - break; - (*fromP)++; - } - do { - *(*toP)++ = *utf8++; - } while (--n != 0); - } -} - -static void PTRCALL -unknown_toUtf16(const ENCODING *enc, - const char **fromP, const char *fromLim, - unsigned short **toP, const unsigned short *toLim) -{ - const struct unknown_encoding *uenc = AS_UNKNOWN_ENCODING(enc); - while (*fromP != fromLim && *toP != toLim) { - unsigned short c = uenc->utf16[(unsigned char)**fromP]; - if (c == 0) { - c = (unsigned short) - uenc->convert(uenc->userData, *fromP); - *fromP += (AS_NORMAL_ENCODING(enc)->type[(unsigned char)**fromP] - - (BT_LEAD2 - 2)); - } - else - (*fromP)++; - *(*toP)++ = c; - } -} - -ENCODING * -XmlInitUnknownEncoding(void *mem, - int *table, - CONVERTER convert, - void *userData) -{ - int i; - struct unknown_encoding *e = (struct unknown_encoding *)mem; - for (i = 0; i < (int)sizeof(struct normal_encoding); i++) - ((char *)mem)[i] = ((char *)&latin1_encoding)[i]; - for (i = 0; i < 128; i++) - if (latin1_encoding.type[i] != BT_OTHER - && latin1_encoding.type[i] != BT_NONXML - && table[i] != i) - return 0; - for (i = 0; i < 256; i++) { - int c = table[i]; - if (c == -1) { - e->normal.type[i] = BT_MALFORM; - /* This shouldn't really get used. */ - e->utf16[i] = 0xFFFF; - e->utf8[i][0] = 1; - e->utf8[i][1] = 0; - } - else if (c < 0) { - if (c < -4) - return 0; - e->normal.type[i] = (unsigned char)(BT_LEAD2 - (c + 2)); - e->utf8[i][0] = 0; - e->utf16[i] = 0; - } - else if (c < 0x80) { - if (latin1_encoding.type[c] != BT_OTHER - && latin1_encoding.type[c] != BT_NONXML - && c != i) - return 0; - e->normal.type[i] = latin1_encoding.type[c]; - e->utf8[i][0] = 1; - e->utf8[i][1] = (char)c; - e->utf16[i] = (unsigned short)(c == 0 ? 0xFFFF : c); - } - else if (checkCharRefNumber(c) < 0) { - e->normal.type[i] = BT_NONXML; - /* This shouldn't really get used. */ - e->utf16[i] = 0xFFFF; - e->utf8[i][0] = 1; - e->utf8[i][1] = 0; - } - else { - if (c > 0xFFFF) - return 0; - if (UCS2_GET_NAMING(nmstrtPages, c >> 8, c & 0xff)) - e->normal.type[i] = BT_NMSTRT; - else if (UCS2_GET_NAMING(namePages, c >> 8, c & 0xff)) - e->normal.type[i] = BT_NAME; - else - e->normal.type[i] = BT_OTHER; - e->utf8[i][0] = (char)XmlUtf8Encode(c, e->utf8[i] + 1); - e->utf16[i] = (unsigned short)c; - } - } - e->userData = userData; - e->convert = convert; - if (convert) { - e->normal.isName2 = unknown_isName; - e->normal.isName3 = unknown_isName; - e->normal.isName4 = unknown_isName; - e->normal.isNmstrt2 = unknown_isNmstrt; - e->normal.isNmstrt3 = unknown_isNmstrt; - e->normal.isNmstrt4 = unknown_isNmstrt; - e->normal.isInvalid2 = unknown_isInvalid; - e->normal.isInvalid3 = unknown_isInvalid; - e->normal.isInvalid4 = unknown_isInvalid; - } - e->normal.enc.utf8Convert = unknown_toUtf8; - e->normal.enc.utf16Convert = unknown_toUtf16; - return &(e->normal.enc); -} - -/* If this enumeration is changed, getEncodingIndex and encodings -must also be changed. */ -enum { - UNKNOWN_ENC = -1, - ISO_8859_1_ENC = 0, - US_ASCII_ENC, - UTF_8_ENC, - UTF_16_ENC, - UTF_16BE_ENC, - UTF_16LE_ENC, - /* must match encodingNames up to here */ - NO_ENC -}; - -static const char KW_ISO_8859_1[] = { - ASCII_I, ASCII_S, ASCII_O, ASCII_MINUS, ASCII_8, ASCII_8, ASCII_5, ASCII_9, - ASCII_MINUS, ASCII_1, '\0' -}; -static const char KW_US_ASCII[] = { - ASCII_U, ASCII_S, ASCII_MINUS, ASCII_A, ASCII_S, ASCII_C, ASCII_I, ASCII_I, - '\0' -}; -static const char KW_UTF_8[] = { - ASCII_U, ASCII_T, ASCII_F, ASCII_MINUS, ASCII_8, '\0' -}; -static const char KW_UTF_16[] = { - ASCII_U, ASCII_T, ASCII_F, ASCII_MINUS, ASCII_1, ASCII_6, '\0' -}; -static const char KW_UTF_16BE[] = { - ASCII_U, ASCII_T, ASCII_F, ASCII_MINUS, ASCII_1, ASCII_6, ASCII_B, ASCII_E, - '\0' -}; -static const char KW_UTF_16LE[] = { - ASCII_U, ASCII_T, ASCII_F, ASCII_MINUS, ASCII_1, ASCII_6, ASCII_L, ASCII_E, - '\0' -}; - -static int FASTCALL -getEncodingIndex(const char *name) -{ - static const char *encodingNames[] = { - KW_ISO_8859_1, - KW_US_ASCII, - KW_UTF_8, - KW_UTF_16, - KW_UTF_16BE, - KW_UTF_16LE, - }; - int i; - if (name == NULL) - return NO_ENC; - for (i = 0; i < (int)(sizeof(encodingNames)/sizeof(encodingNames[0])); i++) - if (streqci(name, encodingNames[i])) - return i; - return UNKNOWN_ENC; -} - -/* For binary compatibility, we store the index of the encoding - specified at initialization in the isUtf16 member. -*/ - -#define INIT_ENC_INDEX(enc) ((int)(enc)->initEnc.isUtf16) -#define SET_INIT_ENC_INDEX(enc, i) ((enc)->initEnc.isUtf16 = (char)i) - -/* This is what detects the encoding. encodingTable maps from - encoding indices to encodings; INIT_ENC_INDEX(enc) is the index of - the external (protocol) specified encoding; state is - XML_CONTENT_STATE if we're parsing an external text entity, and - XML_PROLOG_STATE otherwise. -*/ - - -static int -initScan(const ENCODING **encodingTable, - const INIT_ENCODING *enc, - int state, - const char *ptr, - const char *end, - const char **nextTokPtr) -{ - const ENCODING **encPtr; - - if (ptr == end) - return XML_TOK_NONE; - encPtr = enc->encPtr; - if (ptr + 1 == end) { - /* only a single byte available for auto-detection */ -#ifndef XML_DTD /* FIXME */ - /* a well-formed document entity must have more than one byte */ - if (state != XML_CONTENT_STATE) - return XML_TOK_PARTIAL; -#endif - /* so we're parsing an external text entity... */ - /* if UTF-16 was externally specified, then we need at least 2 bytes */ - switch (INIT_ENC_INDEX(enc)) { - case UTF_16_ENC: - case UTF_16LE_ENC: - case UTF_16BE_ENC: - return XML_TOK_PARTIAL; - } - switch ((unsigned char)*ptr) { - case 0xFE: - case 0xFF: - case 0xEF: /* possibly first byte of UTF-8 BOM */ - if (INIT_ENC_INDEX(enc) == ISO_8859_1_ENC - && state == XML_CONTENT_STATE) - break; - /* fall through */ - case 0x00: - case 0x3C: - return XML_TOK_PARTIAL; - } - } - else { - switch (((unsigned char)ptr[0] << 8) | (unsigned char)ptr[1]) { - case 0xFEFF: - if (INIT_ENC_INDEX(enc) == ISO_8859_1_ENC - && state == XML_CONTENT_STATE) - break; - *nextTokPtr = ptr + 2; - *encPtr = encodingTable[UTF_16BE_ENC]; - return XML_TOK_BOM; - /* 00 3C is handled in the default case */ - case 0x3C00: - if ((INIT_ENC_INDEX(enc) == UTF_16BE_ENC - || INIT_ENC_INDEX(enc) == UTF_16_ENC) - && state == XML_CONTENT_STATE) - break; - *encPtr = encodingTable[UTF_16LE_ENC]; - return XmlTok(*encPtr, state, ptr, end, nextTokPtr); - case 0xFFFE: - if (INIT_ENC_INDEX(enc) == ISO_8859_1_ENC - && state == XML_CONTENT_STATE) - break; - *nextTokPtr = ptr + 2; - *encPtr = encodingTable[UTF_16LE_ENC]; - return XML_TOK_BOM; - case 0xEFBB: - /* Maybe a UTF-8 BOM (EF BB BF) */ - /* If there's an explicitly specified (external) encoding - of ISO-8859-1 or some flavour of UTF-16 - and this is an external text entity, - don't look for the BOM, - because it might be a legal data. - */ - if (state == XML_CONTENT_STATE) { - int e = INIT_ENC_INDEX(enc); - if (e == ISO_8859_1_ENC || e == UTF_16BE_ENC - || e == UTF_16LE_ENC || e == UTF_16_ENC) - break; - } - if (ptr + 2 == end) - return XML_TOK_PARTIAL; - if ((unsigned char)ptr[2] == 0xBF) { - *nextTokPtr = ptr + 3; - *encPtr = encodingTable[UTF_8_ENC]; - return XML_TOK_BOM; - } - break; - default: - if (ptr[0] == '\0') { - /* 0 isn't a legal data character. Furthermore a document - entity can only start with ASCII characters. So the only - way this can fail to be big-endian UTF-16 if it it's an - external parsed general entity that's labelled as - UTF-16LE. - */ - if (state == XML_CONTENT_STATE && INIT_ENC_INDEX(enc) == UTF_16LE_ENC) - break; - *encPtr = encodingTable[UTF_16BE_ENC]; - return XmlTok(*encPtr, state, ptr, end, nextTokPtr); - } - else if (ptr[1] == '\0') { - /* We could recover here in the case: - - parsing an external entity - - second byte is 0 - - no externally specified encoding - - no encoding declaration - by assuming UTF-16LE. But we don't, because this would mean when - presented just with a single byte, we couldn't reliably determine - whether we needed further bytes. - */ - if (state == XML_CONTENT_STATE) - break; - *encPtr = encodingTable[UTF_16LE_ENC]; - return XmlTok(*encPtr, state, ptr, end, nextTokPtr); - } - break; - } - } - *encPtr = encodingTable[INIT_ENC_INDEX(enc)]; - return XmlTok(*encPtr, state, ptr, end, nextTokPtr); -} - - -#define NS(x) x -#define ns(x) x -#include "xmltok_ns.c" -#undef NS -#undef ns - -#ifdef XML_NS - -#define NS(x) x ## NS -#define ns(x) x ## _ns - -#include "xmltok_ns.c" - -#undef NS -#undef ns - -ENCODING * -XmlInitUnknownEncodingNS(void *mem, - int *table, - CONVERTER convert, - void *userData) -{ - ENCODING *enc = XmlInitUnknownEncoding(mem, table, convert, userData); - if (enc) - ((struct normal_encoding *)enc)->type[ASCII_COLON] = BT_COLON; - return enc; -} - -#endif /* XML_NS */ diff --git a/wxWidgets/src/expat/lib/xmltok.h b/wxWidgets/src/expat/lib/xmltok.h deleted file mode 100644 index 3d776be71f..0000000000 --- a/wxWidgets/src/expat/lib/xmltok.h +++ /dev/null @@ -1,315 +0,0 @@ -/* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd - See the file COPYING for copying permission. -*/ - -#ifndef XmlTok_INCLUDED -#define XmlTok_INCLUDED 1 - -#ifdef __cplusplus -extern "C" { -#endif - -/* The following token may be returned by XmlContentTok */ -#define XML_TOK_TRAILING_RSQB -5 /* ] or ]] at the end of the scan; might be - start of illegal ]]> sequence */ -/* The following tokens may be returned by both XmlPrologTok and - XmlContentTok. -*/ -#define XML_TOK_NONE -4 /* The string to be scanned is empty */ -#define XML_TOK_TRAILING_CR -3 /* A CR at the end of the scan; - might be part of CRLF sequence */ -#define XML_TOK_PARTIAL_CHAR -2 /* only part of a multibyte sequence */ -#define XML_TOK_PARTIAL -1 /* only part of a token */ -#define XML_TOK_INVALID 0 - -/* The following tokens are returned by XmlContentTok; some are also - returned by XmlAttributeValueTok, XmlEntityTok, XmlCdataSectionTok. -*/ -#define XML_TOK_START_TAG_WITH_ATTS 1 -#define XML_TOK_START_TAG_NO_ATTS 2 -#define XML_TOK_EMPTY_ELEMENT_WITH_ATTS 3 /* empty element tag */ -#define XML_TOK_EMPTY_ELEMENT_NO_ATTS 4 -#define XML_TOK_END_TAG 5 -#define XML_TOK_DATA_CHARS 6 -#define XML_TOK_DATA_NEWLINE 7 -#define XML_TOK_CDATA_SECT_OPEN 8 -#define XML_TOK_ENTITY_REF 9 -#define XML_TOK_CHAR_REF 10 /* numeric character reference */ - -/* The following tokens may be returned by both XmlPrologTok and - XmlContentTok. -*/ -#define XML_TOK_PI 11 /* processing instruction */ -#define XML_TOK_XML_DECL 12 /* XML decl or text decl */ -#define XML_TOK_COMMENT 13 -#define XML_TOK_BOM 14 /* Byte order mark */ - -/* The following tokens are returned only by XmlPrologTok */ -#define XML_TOK_PROLOG_S 15 -#define XML_TOK_DECL_OPEN 16 /* */ -#define XML_TOK_NAME 18 -#define XML_TOK_NMTOKEN 19 -#define XML_TOK_POUND_NAME 20 /* #name */ -#define XML_TOK_OR 21 /* | */ -#define XML_TOK_PERCENT 22 -#define XML_TOK_OPEN_PAREN 23 -#define XML_TOK_CLOSE_PAREN 24 -#define XML_TOK_OPEN_BRACKET 25 -#define XML_TOK_CLOSE_BRACKET 26 -#define XML_TOK_LITERAL 27 -#define XML_TOK_PARAM_ENTITY_REF 28 -#define XML_TOK_INSTANCE_START 29 - -/* The following occur only in element type declarations */ -#define XML_TOK_NAME_QUESTION 30 /* name? */ -#define XML_TOK_NAME_ASTERISK 31 /* name* */ -#define XML_TOK_NAME_PLUS 32 /* name+ */ -#define XML_TOK_COND_SECT_OPEN 33 /* */ -#define XML_TOK_CLOSE_PAREN_QUESTION 35 /* )? */ -#define XML_TOK_CLOSE_PAREN_ASTERISK 36 /* )* */ -#define XML_TOK_CLOSE_PAREN_PLUS 37 /* )+ */ -#define XML_TOK_COMMA 38 - -/* The following token is returned only by XmlAttributeValueTok */ -#define XML_TOK_ATTRIBUTE_VALUE_S 39 - -/* The following token is returned only by XmlCdataSectionTok */ -#define XML_TOK_CDATA_SECT_CLOSE 40 - -/* With namespace processing this is returned by XmlPrologTok for a - name with a colon. -*/ -#define XML_TOK_PREFIXED_NAME 41 - -#ifdef XML_DTD -#define XML_TOK_IGNORE_SECT 42 -#endif /* XML_DTD */ - -#ifdef XML_DTD -#define XML_N_STATES 4 -#else /* not XML_DTD */ -#define XML_N_STATES 3 -#endif /* not XML_DTD */ - -#define XML_PROLOG_STATE 0 -#define XML_CONTENT_STATE 1 -#define XML_CDATA_SECTION_STATE 2 -#ifdef XML_DTD -#define XML_IGNORE_SECTION_STATE 3 -#endif /* XML_DTD */ - -#define XML_N_LITERAL_TYPES 2 -#define XML_ATTRIBUTE_VALUE_LITERAL 0 -#define XML_ENTITY_VALUE_LITERAL 1 - -/* The size of the buffer passed to XmlUtf8Encode must be at least this. */ -#define XML_UTF8_ENCODE_MAX 4 -/* The size of the buffer passed to XmlUtf16Encode must be at least this. */ -#define XML_UTF16_ENCODE_MAX 2 - -typedef struct position { - /* first line and first column are 0 not 1 */ - unsigned long lineNumber; - unsigned long columnNumber; -} POSITION; - -typedef struct { - const char *name; - const char *valuePtr; - const char *valueEnd; - char normalized; -} ATTRIBUTE; - -struct encoding; -typedef struct encoding ENCODING; - -typedef int (PTRCALL *SCANNER)(const ENCODING *, - const char *, - const char *, - const char **); - -struct encoding { - SCANNER scanners[XML_N_STATES]; - SCANNER literalScanners[XML_N_LITERAL_TYPES]; - int (PTRCALL *sameName)(const ENCODING *, - const char *, - const char *); - int (PTRCALL *nameMatchesAscii)(const ENCODING *, - const char *, - const char *, - const char *); - int (PTRFASTCALL *nameLength)(const ENCODING *, const char *); - const char *(PTRFASTCALL *skipS)(const ENCODING *, const char *); - int (PTRCALL *getAtts)(const ENCODING *enc, - const char *ptr, - int attsMax, - ATTRIBUTE *atts); - int (PTRFASTCALL *charRefNumber)(const ENCODING *enc, const char *ptr); - int (PTRCALL *predefinedEntityName)(const ENCODING *, - const char *, - const char *); - void (PTRCALL *updatePosition)(const ENCODING *, - const char *ptr, - const char *end, - POSITION *); - int (PTRCALL *isPublicId)(const ENCODING *enc, - const char *ptr, - const char *end, - const char **badPtr); - void (PTRCALL *utf8Convert)(const ENCODING *enc, - const char **fromP, - const char *fromLim, - char **toP, - const char *toLim); - void (PTRCALL *utf16Convert)(const ENCODING *enc, - const char **fromP, - const char *fromLim, - unsigned short **toP, - const unsigned short *toLim); - int minBytesPerChar; - char isUtf8; - char isUtf16; -}; - -/* Scan the string starting at ptr until the end of the next complete - token, but do not scan past eptr. Return an integer giving the - type of token. - - Return XML_TOK_NONE when ptr == eptr; nextTokPtr will not be set. - - Return XML_TOK_PARTIAL when the string does not contain a complete - token; nextTokPtr will not be set. - - Return XML_TOK_INVALID when the string does not start a valid - token; nextTokPtr will be set to point to the character which made - the token invalid. - - Otherwise the string starts with a valid token; nextTokPtr will be - set to point to the character following the end of that token. - - Each data character counts as a single token, but adjacent data - characters may be returned together. Similarly for characters in - the prolog outside literals, comments and processing instructions. -*/ - - -#define XmlTok(enc, state, ptr, end, nextTokPtr) \ - (((enc)->scanners[state])(enc, ptr, end, nextTokPtr)) - -#define XmlPrologTok(enc, ptr, end, nextTokPtr) \ - XmlTok(enc, XML_PROLOG_STATE, ptr, end, nextTokPtr) - -#define XmlContentTok(enc, ptr, end, nextTokPtr) \ - XmlTok(enc, XML_CONTENT_STATE, ptr, end, nextTokPtr) - -#define XmlCdataSectionTok(enc, ptr, end, nextTokPtr) \ - XmlTok(enc, XML_CDATA_SECTION_STATE, ptr, end, nextTokPtr) - -#ifdef XML_DTD - -#define XmlIgnoreSectionTok(enc, ptr, end, nextTokPtr) \ - XmlTok(enc, XML_IGNORE_SECTION_STATE, ptr, end, nextTokPtr) - -#endif /* XML_DTD */ - -/* This is used for performing a 2nd-level tokenization on the content - of a literal that has already been returned by XmlTok. -*/ -#define XmlLiteralTok(enc, literalType, ptr, end, nextTokPtr) \ - (((enc)->literalScanners[literalType])(enc, ptr, end, nextTokPtr)) - -#define XmlAttributeValueTok(enc, ptr, end, nextTokPtr) \ - XmlLiteralTok(enc, XML_ATTRIBUTE_VALUE_LITERAL, ptr, end, nextTokPtr) - -#define XmlEntityValueTok(enc, ptr, end, nextTokPtr) \ - XmlLiteralTok(enc, XML_ENTITY_VALUE_LITERAL, ptr, end, nextTokPtr) - -#define XmlSameName(enc, ptr1, ptr2) (((enc)->sameName)(enc, ptr1, ptr2)) - -#define XmlNameMatchesAscii(enc, ptr1, end1, ptr2) \ - (((enc)->nameMatchesAscii)(enc, ptr1, end1, ptr2)) - -#define XmlNameLength(enc, ptr) \ - (((enc)->nameLength)(enc, ptr)) - -#define XmlSkipS(enc, ptr) \ - (((enc)->skipS)(enc, ptr)) - -#define XmlGetAttributes(enc, ptr, attsMax, atts) \ - (((enc)->getAtts)(enc, ptr, attsMax, atts)) - -#define XmlCharRefNumber(enc, ptr) \ - (((enc)->charRefNumber)(enc, ptr)) - -#define XmlPredefinedEntityName(enc, ptr, end) \ - (((enc)->predefinedEntityName)(enc, ptr, end)) - -#define XmlUpdatePosition(enc, ptr, end, pos) \ - (((enc)->updatePosition)(enc, ptr, end, pos)) - -#define XmlIsPublicId(enc, ptr, end, badPtr) \ - (((enc)->isPublicId)(enc, ptr, end, badPtr)) - -#define XmlUtf8Convert(enc, fromP, fromLim, toP, toLim) \ - (((enc)->utf8Convert)(enc, fromP, fromLim, toP, toLim)) - -#define XmlUtf16Convert(enc, fromP, fromLim, toP, toLim) \ - (((enc)->utf16Convert)(enc, fromP, fromLim, toP, toLim)) - -typedef struct { - ENCODING initEnc; - const ENCODING **encPtr; -} INIT_ENCODING; - -int XmlParseXmlDecl(int isGeneralTextEntity, - const ENCODING *enc, - const char *ptr, - const char *end, - const char **badPtr, - const char **versionPtr, - const char **versionEndPtr, - const char **encodingNamePtr, - const ENCODING **namedEncodingPtr, - int *standalonePtr); - -int XmlInitEncoding(INIT_ENCODING *, const ENCODING **, const char *name); -const ENCODING *XmlGetUtf8InternalEncoding(void); -const ENCODING *XmlGetUtf16InternalEncoding(void); -int FASTCALL XmlUtf8Encode(int charNumber, char *buf); -int FASTCALL XmlUtf16Encode(int charNumber, unsigned short *buf); -int XmlSizeOfUnknownEncoding(void); - -typedef int (*CONVERTER)(void *userData, const char *p); - -ENCODING * -XmlInitUnknownEncoding(void *mem, - int *table, - CONVERTER convert, - void *userData); - -int XmlParseXmlDeclNS(int isGeneralTextEntity, - const ENCODING *enc, - const char *ptr, - const char *end, - const char **badPtr, - const char **versionPtr, - const char **versionEndPtr, - const char **encodingNamePtr, - const ENCODING **namedEncodingPtr, - int *standalonePtr); - -int XmlInitEncodingNS(INIT_ENCODING *, const ENCODING **, const char *name); -const ENCODING *XmlGetUtf8InternalEncodingNS(void); -const ENCODING *XmlGetUtf16InternalEncodingNS(void); -ENCODING * -XmlInitUnknownEncodingNS(void *mem, - int *table, - CONVERTER convert, - void *userData); -#ifdef __cplusplus -} -#endif - -#endif /* not XmlTok_INCLUDED */ diff --git a/wxWidgets/src/expat/lib/xmltok_impl.c b/wxWidgets/src/expat/lib/xmltok_impl.c deleted file mode 100644 index 84a3267927..0000000000 --- a/wxWidgets/src/expat/lib/xmltok_impl.c +++ /dev/null @@ -1,1779 +0,0 @@ -/* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd - See the file COPYING for copying permission. -*/ - -#ifndef IS_INVALID_CHAR -#define IS_INVALID_CHAR(enc, ptr, n) (0) -#endif - -#define INVALID_LEAD_CASE(n, ptr, nextTokPtr) \ - case BT_LEAD ## n: \ - if (end - ptr < n) \ - return XML_TOK_PARTIAL_CHAR; \ - if (IS_INVALID_CHAR(enc, ptr, n)) { \ - *(nextTokPtr) = (ptr); \ - return XML_TOK_INVALID; \ - } \ - ptr += n; \ - break; - -#define INVALID_CASES(ptr, nextTokPtr) \ - INVALID_LEAD_CASE(2, ptr, nextTokPtr) \ - INVALID_LEAD_CASE(3, ptr, nextTokPtr) \ - INVALID_LEAD_CASE(4, ptr, nextTokPtr) \ - case BT_NONXML: \ - case BT_MALFORM: \ - case BT_TRAIL: \ - *(nextTokPtr) = (ptr); \ - return XML_TOK_INVALID; - -#define CHECK_NAME_CASE(n, enc, ptr, end, nextTokPtr) \ - case BT_LEAD ## n: \ - if (end - ptr < n) \ - return XML_TOK_PARTIAL_CHAR; \ - if (!IS_NAME_CHAR(enc, ptr, n)) { \ - *nextTokPtr = ptr; \ - return XML_TOK_INVALID; \ - } \ - ptr += n; \ - break; - -#define CHECK_NAME_CASES(enc, ptr, end, nextTokPtr) \ - case BT_NONASCII: \ - if (!IS_NAME_CHAR_MINBPC(enc, ptr)) { \ - *nextTokPtr = ptr; \ - return XML_TOK_INVALID; \ - } \ - case BT_NMSTRT: \ - case BT_HEX: \ - case BT_DIGIT: \ - case BT_NAME: \ - case BT_MINUS: \ - ptr += MINBPC(enc); \ - break; \ - CHECK_NAME_CASE(2, enc, ptr, end, nextTokPtr) \ - CHECK_NAME_CASE(3, enc, ptr, end, nextTokPtr) \ - CHECK_NAME_CASE(4, enc, ptr, end, nextTokPtr) - -#define CHECK_NMSTRT_CASE(n, enc, ptr, end, nextTokPtr) \ - case BT_LEAD ## n: \ - if (end - ptr < n) \ - return XML_TOK_PARTIAL_CHAR; \ - if (!IS_NMSTRT_CHAR(enc, ptr, n)) { \ - *nextTokPtr = ptr; \ - return XML_TOK_INVALID; \ - } \ - ptr += n; \ - break; - -#define CHECK_NMSTRT_CASES(enc, ptr, end, nextTokPtr) \ - case BT_NONASCII: \ - if (!IS_NMSTRT_CHAR_MINBPC(enc, ptr)) { \ - *nextTokPtr = ptr; \ - return XML_TOK_INVALID; \ - } \ - case BT_NMSTRT: \ - case BT_HEX: \ - ptr += MINBPC(enc); \ - break; \ - CHECK_NMSTRT_CASE(2, enc, ptr, end, nextTokPtr) \ - CHECK_NMSTRT_CASE(3, enc, ptr, end, nextTokPtr) \ - CHECK_NMSTRT_CASE(4, enc, ptr, end, nextTokPtr) - -#ifndef PREFIX -#define PREFIX(ident) ident -#endif - -/* ptr points to character following " */ - switch (BYTE_TYPE(enc, ptr + MINBPC(enc))) { - case BT_S: case BT_CR: case BT_LF: case BT_PERCNT: - *nextTokPtr = ptr; - return XML_TOK_INVALID; - } - /* fall through */ - case BT_S: case BT_CR: case BT_LF: - *nextTokPtr = ptr; - return XML_TOK_DECL_OPEN; - case BT_NMSTRT: - case BT_HEX: - ptr += MINBPC(enc); - break; - default: - *nextTokPtr = ptr; - return XML_TOK_INVALID; - } - } - return XML_TOK_PARTIAL; -} - -static int PTRCALL -PREFIX(checkPiTarget)(const ENCODING *enc, const char *ptr, - const char *end, int *tokPtr) -{ - int upper = 0; - *tokPtr = XML_TOK_PI; - if (end - ptr != MINBPC(enc)*3) - return 1; - switch (BYTE_TO_ASCII(enc, ptr)) { - case ASCII_x: - break; - case ASCII_X: - upper = 1; - break; - default: - return 1; - } - ptr += MINBPC(enc); - switch (BYTE_TO_ASCII(enc, ptr)) { - case ASCII_m: - break; - case ASCII_M: - upper = 1; - break; - default: - return 1; - } - ptr += MINBPC(enc); - switch (BYTE_TO_ASCII(enc, ptr)) { - case ASCII_l: - break; - case ASCII_L: - upper = 1; - break; - default: - return 1; - } - if (upper) - return 0; - *tokPtr = XML_TOK_XML_DECL; - return 1; -} - -/* ptr points to character following " 1) { - size_t n = end - ptr; - if (n & (MINBPC(enc) - 1)) { - n &= ~(MINBPC(enc) - 1); - if (n == 0) - return XML_TOK_PARTIAL; - end = ptr + n; - } - } - switch (BYTE_TYPE(enc, ptr)) { - case BT_RSQB: - ptr += MINBPC(enc); - if (ptr == end) - return XML_TOK_PARTIAL; - if (!CHAR_MATCHES(enc, ptr, ASCII_RSQB)) - break; - ptr += MINBPC(enc); - if (ptr == end) - return XML_TOK_PARTIAL; - if (!CHAR_MATCHES(enc, ptr, ASCII_GT)) { - ptr -= MINBPC(enc); - break; - } - *nextTokPtr = ptr + MINBPC(enc); - return XML_TOK_CDATA_SECT_CLOSE; - case BT_CR: - ptr += MINBPC(enc); - if (ptr == end) - return XML_TOK_PARTIAL; - if (BYTE_TYPE(enc, ptr) == BT_LF) - ptr += MINBPC(enc); - *nextTokPtr = ptr; - return XML_TOK_DATA_NEWLINE; - case BT_LF: - *nextTokPtr = ptr + MINBPC(enc); - return XML_TOK_DATA_NEWLINE; - INVALID_CASES(ptr, nextTokPtr) - default: - ptr += MINBPC(enc); - break; - } - while (ptr != end) { - switch (BYTE_TYPE(enc, ptr)) { -#define LEAD_CASE(n) \ - case BT_LEAD ## n: \ - if (end - ptr < n || IS_INVALID_CHAR(enc, ptr, n)) { \ - *nextTokPtr = ptr; \ - return XML_TOK_DATA_CHARS; \ - } \ - ptr += n; \ - break; - LEAD_CASE(2) LEAD_CASE(3) LEAD_CASE(4) -#undef LEAD_CASE - case BT_NONXML: - case BT_MALFORM: - case BT_TRAIL: - case BT_CR: - case BT_LF: - case BT_RSQB: - *nextTokPtr = ptr; - return XML_TOK_DATA_CHARS; - default: - ptr += MINBPC(enc); - break; - } - } - *nextTokPtr = ptr; - return XML_TOK_DATA_CHARS; -} - -/* ptr points to character following " 1) { - size_t n = end - ptr; - if (n & (MINBPC(enc) - 1)) { - n &= ~(MINBPC(enc) - 1); - if (n == 0) - return XML_TOK_PARTIAL; - end = ptr + n; - } - } - switch (BYTE_TYPE(enc, ptr)) { - case BT_LT: - return PREFIX(scanLt)(enc, ptr + MINBPC(enc), end, nextTokPtr); - case BT_AMP: - return PREFIX(scanRef)(enc, ptr + MINBPC(enc), end, nextTokPtr); - case BT_CR: - ptr += MINBPC(enc); - if (ptr == end) - return XML_TOK_TRAILING_CR; - if (BYTE_TYPE(enc, ptr) == BT_LF) - ptr += MINBPC(enc); - *nextTokPtr = ptr; - return XML_TOK_DATA_NEWLINE; - case BT_LF: - *nextTokPtr = ptr + MINBPC(enc); - return XML_TOK_DATA_NEWLINE; - case BT_RSQB: - ptr += MINBPC(enc); - if (ptr == end) - return XML_TOK_TRAILING_RSQB; - if (!CHAR_MATCHES(enc, ptr, ASCII_RSQB)) - break; - ptr += MINBPC(enc); - if (ptr == end) - return XML_TOK_TRAILING_RSQB; - if (!CHAR_MATCHES(enc, ptr, ASCII_GT)) { - ptr -= MINBPC(enc); - break; - } - *nextTokPtr = ptr; - return XML_TOK_INVALID; - INVALID_CASES(ptr, nextTokPtr) - default: - ptr += MINBPC(enc); - break; - } - while (ptr != end) { - switch (BYTE_TYPE(enc, ptr)) { -#define LEAD_CASE(n) \ - case BT_LEAD ## n: \ - if (end - ptr < n || IS_INVALID_CHAR(enc, ptr, n)) { \ - *nextTokPtr = ptr; \ - return XML_TOK_DATA_CHARS; \ - } \ - ptr += n; \ - break; - LEAD_CASE(2) LEAD_CASE(3) LEAD_CASE(4) -#undef LEAD_CASE - case BT_RSQB: - if (ptr + MINBPC(enc) != end) { - if (!CHAR_MATCHES(enc, ptr + MINBPC(enc), ASCII_RSQB)) { - ptr += MINBPC(enc); - break; - } - if (ptr + 2*MINBPC(enc) != end) { - if (!CHAR_MATCHES(enc, ptr + 2*MINBPC(enc), ASCII_GT)) { - ptr += MINBPC(enc); - break; - } - *nextTokPtr = ptr + 2*MINBPC(enc); - return XML_TOK_INVALID; - } - } - /* fall through */ - case BT_AMP: - case BT_LT: - case BT_NONXML: - case BT_MALFORM: - case BT_TRAIL: - case BT_CR: - case BT_LF: - *nextTokPtr = ptr; - return XML_TOK_DATA_CHARS; - default: - ptr += MINBPC(enc); - break; - } - } - *nextTokPtr = ptr; - return XML_TOK_DATA_CHARS; -} - -/* ptr points to character following "%" */ - -static int PTRCALL -PREFIX(scanPercent)(const ENCODING *enc, const char *ptr, const char *end, - const char **nextTokPtr) -{ - if (ptr == end) - return XML_TOK_PARTIAL; - switch (BYTE_TYPE(enc, ptr)) { - CHECK_NMSTRT_CASES(enc, ptr, end, nextTokPtr) - case BT_S: case BT_LF: case BT_CR: case BT_PERCNT: - *nextTokPtr = ptr; - return XML_TOK_PERCENT; - default: - *nextTokPtr = ptr; - return XML_TOK_INVALID; - } - while (ptr != end) { - switch (BYTE_TYPE(enc, ptr)) { - CHECK_NAME_CASES(enc, ptr, end, nextTokPtr) - case BT_SEMI: - *nextTokPtr = ptr + MINBPC(enc); - return XML_TOK_PARAM_ENTITY_REF; - default: - *nextTokPtr = ptr; - return XML_TOK_INVALID; - } - } - return XML_TOK_PARTIAL; -} - -static int PTRCALL -PREFIX(scanPoundName)(const ENCODING *enc, const char *ptr, const char *end, - const char **nextTokPtr) -{ - if (ptr == end) - return XML_TOK_PARTIAL; - switch (BYTE_TYPE(enc, ptr)) { - CHECK_NMSTRT_CASES(enc, ptr, end, nextTokPtr) - default: - *nextTokPtr = ptr; - return XML_TOK_INVALID; - } - while (ptr != end) { - switch (BYTE_TYPE(enc, ptr)) { - CHECK_NAME_CASES(enc, ptr, end, nextTokPtr) - case BT_CR: case BT_LF: case BT_S: - case BT_RPAR: case BT_GT: case BT_PERCNT: case BT_VERBAR: - *nextTokPtr = ptr; - return XML_TOK_POUND_NAME; - default: - *nextTokPtr = ptr; - return XML_TOK_INVALID; - } - } - return -XML_TOK_POUND_NAME; -} - -static int PTRCALL -PREFIX(scanLit)(int open, const ENCODING *enc, - const char *ptr, const char *end, - const char **nextTokPtr) -{ - while (ptr != end) { - int t = BYTE_TYPE(enc, ptr); - switch (t) { - INVALID_CASES(ptr, nextTokPtr) - case BT_QUOT: - case BT_APOS: - ptr += MINBPC(enc); - if (t != open) - break; - if (ptr == end) - return -XML_TOK_LITERAL; - *nextTokPtr = ptr; - switch (BYTE_TYPE(enc, ptr)) { - case BT_S: case BT_CR: case BT_LF: - case BT_GT: case BT_PERCNT: case BT_LSQB: - return XML_TOK_LITERAL; - default: - return XML_TOK_INVALID; - } - default: - ptr += MINBPC(enc); - break; - } - } - return XML_TOK_PARTIAL; -} - -static int PTRCALL -PREFIX(prologTok)(const ENCODING *enc, const char *ptr, const char *end, - const char **nextTokPtr) -{ - int tok; - if (ptr == end) - return XML_TOK_NONE; - if (MINBPC(enc) > 1) { - size_t n = end - ptr; - if (n & (MINBPC(enc) - 1)) { - n &= ~(MINBPC(enc) - 1); - if (n == 0) - return XML_TOK_PARTIAL; - end = ptr + n; - } - } - switch (BYTE_TYPE(enc, ptr)) { - case BT_QUOT: - return PREFIX(scanLit)(BT_QUOT, enc, ptr + MINBPC(enc), end, nextTokPtr); - case BT_APOS: - return PREFIX(scanLit)(BT_APOS, enc, ptr + MINBPC(enc), end, nextTokPtr); - case BT_LT: - { - ptr += MINBPC(enc); - if (ptr == end) - return XML_TOK_PARTIAL; - switch (BYTE_TYPE(enc, ptr)) { - case BT_EXCL: - return PREFIX(scanDecl)(enc, ptr + MINBPC(enc), end, nextTokPtr); - case BT_QUEST: - return PREFIX(scanPi)(enc, ptr + MINBPC(enc), end, nextTokPtr); - case BT_NMSTRT: - case BT_HEX: - case BT_NONASCII: - case BT_LEAD2: - case BT_LEAD3: - case BT_LEAD4: - *nextTokPtr = ptr - MINBPC(enc); - return XML_TOK_INSTANCE_START; - } - *nextTokPtr = ptr; - return XML_TOK_INVALID; - } - case BT_CR: - if (ptr + MINBPC(enc) == end) { - *nextTokPtr = end; - /* indicate that this might be part of a CR/LF pair */ - return -XML_TOK_PROLOG_S; - } - /* fall through */ - case BT_S: case BT_LF: - for (;;) { - ptr += MINBPC(enc); - if (ptr == end) - break; - switch (BYTE_TYPE(enc, ptr)) { - case BT_S: case BT_LF: - break; - case BT_CR: - /* don't split CR/LF pair */ - if (ptr + MINBPC(enc) != end) - break; - /* fall through */ - default: - *nextTokPtr = ptr; - return XML_TOK_PROLOG_S; - } - } - *nextTokPtr = ptr; - return XML_TOK_PROLOG_S; - case BT_PERCNT: - return PREFIX(scanPercent)(enc, ptr + MINBPC(enc), end, nextTokPtr); - case BT_COMMA: - *nextTokPtr = ptr + MINBPC(enc); - return XML_TOK_COMMA; - case BT_LSQB: - *nextTokPtr = ptr + MINBPC(enc); - return XML_TOK_OPEN_BRACKET; - case BT_RSQB: - ptr += MINBPC(enc); - if (ptr == end) - return -XML_TOK_CLOSE_BRACKET; - if (CHAR_MATCHES(enc, ptr, ASCII_RSQB)) { - if (ptr + MINBPC(enc) == end) - return XML_TOK_PARTIAL; - if (CHAR_MATCHES(enc, ptr + MINBPC(enc), ASCII_GT)) { - *nextTokPtr = ptr + 2*MINBPC(enc); - return XML_TOK_COND_SECT_CLOSE; - } - } - *nextTokPtr = ptr; - return XML_TOK_CLOSE_BRACKET; - case BT_LPAR: - *nextTokPtr = ptr + MINBPC(enc); - return XML_TOK_OPEN_PAREN; - case BT_RPAR: - ptr += MINBPC(enc); - if (ptr == end) - return -XML_TOK_CLOSE_PAREN; - switch (BYTE_TYPE(enc, ptr)) { - case BT_AST: - *nextTokPtr = ptr + MINBPC(enc); - return XML_TOK_CLOSE_PAREN_ASTERISK; - case BT_QUEST: - *nextTokPtr = ptr + MINBPC(enc); - return XML_TOK_CLOSE_PAREN_QUESTION; - case BT_PLUS: - *nextTokPtr = ptr + MINBPC(enc); - return XML_TOK_CLOSE_PAREN_PLUS; - case BT_CR: case BT_LF: case BT_S: - case BT_GT: case BT_COMMA: case BT_VERBAR: - case BT_RPAR: - *nextTokPtr = ptr; - return XML_TOK_CLOSE_PAREN; - } - *nextTokPtr = ptr; - return XML_TOK_INVALID; - case BT_VERBAR: - *nextTokPtr = ptr + MINBPC(enc); - return XML_TOK_OR; - case BT_GT: - *nextTokPtr = ptr + MINBPC(enc); - return XML_TOK_DECL_CLOSE; - case BT_NUM: - return PREFIX(scanPoundName)(enc, ptr + MINBPC(enc), end, nextTokPtr); -#define LEAD_CASE(n) \ - case BT_LEAD ## n: \ - if (end - ptr < n) \ - return XML_TOK_PARTIAL_CHAR; \ - if (IS_NMSTRT_CHAR(enc, ptr, n)) { \ - ptr += n; \ - tok = XML_TOK_NAME; \ - break; \ - } \ - if (IS_NAME_CHAR(enc, ptr, n)) { \ - ptr += n; \ - tok = XML_TOK_NMTOKEN; \ - break; \ - } \ - *nextTokPtr = ptr; \ - return XML_TOK_INVALID; - LEAD_CASE(2) LEAD_CASE(3) LEAD_CASE(4) -#undef LEAD_CASE - case BT_NMSTRT: - case BT_HEX: - tok = XML_TOK_NAME; - ptr += MINBPC(enc); - break; - case BT_DIGIT: - case BT_NAME: - case BT_MINUS: -#ifdef XML_NS - case BT_COLON: -#endif - tok = XML_TOK_NMTOKEN; - ptr += MINBPC(enc); - break; - case BT_NONASCII: - if (IS_NMSTRT_CHAR_MINBPC(enc, ptr)) { - ptr += MINBPC(enc); - tok = XML_TOK_NAME; - break; - } - if (IS_NAME_CHAR_MINBPC(enc, ptr)) { - ptr += MINBPC(enc); - tok = XML_TOK_NMTOKEN; - break; - } - /* fall through */ - default: - *nextTokPtr = ptr; - return XML_TOK_INVALID; - } - while (ptr != end) { - switch (BYTE_TYPE(enc, ptr)) { - CHECK_NAME_CASES(enc, ptr, end, nextTokPtr) - case BT_GT: case BT_RPAR: case BT_COMMA: - case BT_VERBAR: case BT_LSQB: case BT_PERCNT: - case BT_S: case BT_CR: case BT_LF: - *nextTokPtr = ptr; - return tok; -#ifdef XML_NS - case BT_COLON: - ptr += MINBPC(enc); - switch (tok) { - case XML_TOK_NAME: - if (ptr == end) - return XML_TOK_PARTIAL; - tok = XML_TOK_PREFIXED_NAME; - switch (BYTE_TYPE(enc, ptr)) { - CHECK_NAME_CASES(enc, ptr, end, nextTokPtr) - default: - tok = XML_TOK_NMTOKEN; - break; - } - break; - case XML_TOK_PREFIXED_NAME: - tok = XML_TOK_NMTOKEN; - break; - } - break; -#endif - case BT_PLUS: - if (tok == XML_TOK_NMTOKEN) { - *nextTokPtr = ptr; - return XML_TOK_INVALID; - } - *nextTokPtr = ptr + MINBPC(enc); - return XML_TOK_NAME_PLUS; - case BT_AST: - if (tok == XML_TOK_NMTOKEN) { - *nextTokPtr = ptr; - return XML_TOK_INVALID; - } - *nextTokPtr = ptr + MINBPC(enc); - return XML_TOK_NAME_ASTERISK; - case BT_QUEST: - if (tok == XML_TOK_NMTOKEN) { - *nextTokPtr = ptr; - return XML_TOK_INVALID; - } - *nextTokPtr = ptr + MINBPC(enc); - return XML_TOK_NAME_QUESTION; - default: - *nextTokPtr = ptr; - return XML_TOK_INVALID; - } - } - return -tok; -} - -static int PTRCALL -PREFIX(attributeValueTok)(const ENCODING *enc, const char *ptr, - const char *end, const char **nextTokPtr) -{ - const char *start; - if (ptr == end) - return XML_TOK_NONE; - start = ptr; - while (ptr != end) { - switch (BYTE_TYPE(enc, ptr)) { -#define LEAD_CASE(n) \ - case BT_LEAD ## n: ptr += n; break; - LEAD_CASE(2) LEAD_CASE(3) LEAD_CASE(4) -#undef LEAD_CASE - case BT_AMP: - if (ptr == start) - return PREFIX(scanRef)(enc, ptr + MINBPC(enc), end, nextTokPtr); - *nextTokPtr = ptr; - return XML_TOK_DATA_CHARS; - case BT_LT: - /* this is for inside entity references */ - *nextTokPtr = ptr; - return XML_TOK_INVALID; - case BT_LF: - if (ptr == start) { - *nextTokPtr = ptr + MINBPC(enc); - return XML_TOK_DATA_NEWLINE; - } - *nextTokPtr = ptr; - return XML_TOK_DATA_CHARS; - case BT_CR: - if (ptr == start) { - ptr += MINBPC(enc); - if (ptr == end) - return XML_TOK_TRAILING_CR; - if (BYTE_TYPE(enc, ptr) == BT_LF) - ptr += MINBPC(enc); - *nextTokPtr = ptr; - return XML_TOK_DATA_NEWLINE; - } - *nextTokPtr = ptr; - return XML_TOK_DATA_CHARS; - case BT_S: - if (ptr == start) { - *nextTokPtr = ptr + MINBPC(enc); - return XML_TOK_ATTRIBUTE_VALUE_S; - } - *nextTokPtr = ptr; - return XML_TOK_DATA_CHARS; - default: - ptr += MINBPC(enc); - break; - } - } - *nextTokPtr = ptr; - return XML_TOK_DATA_CHARS; -} - -static int PTRCALL -PREFIX(entityValueTok)(const ENCODING *enc, const char *ptr, - const char *end, const char **nextTokPtr) -{ - const char *start; - if (ptr == end) - return XML_TOK_NONE; - start = ptr; - while (ptr != end) { - switch (BYTE_TYPE(enc, ptr)) { -#define LEAD_CASE(n) \ - case BT_LEAD ## n: ptr += n; break; - LEAD_CASE(2) LEAD_CASE(3) LEAD_CASE(4) -#undef LEAD_CASE - case BT_AMP: - if (ptr == start) - return PREFIX(scanRef)(enc, ptr + MINBPC(enc), end, nextTokPtr); - *nextTokPtr = ptr; - return XML_TOK_DATA_CHARS; - case BT_PERCNT: - if (ptr == start) { - int tok = PREFIX(scanPercent)(enc, ptr + MINBPC(enc), - end, nextTokPtr); - return (tok == XML_TOK_PERCENT) ? XML_TOK_INVALID : tok; - } - *nextTokPtr = ptr; - return XML_TOK_DATA_CHARS; - case BT_LF: - if (ptr == start) { - *nextTokPtr = ptr + MINBPC(enc); - return XML_TOK_DATA_NEWLINE; - } - *nextTokPtr = ptr; - return XML_TOK_DATA_CHARS; - case BT_CR: - if (ptr == start) { - ptr += MINBPC(enc); - if (ptr == end) - return XML_TOK_TRAILING_CR; - if (BYTE_TYPE(enc, ptr) == BT_LF) - ptr += MINBPC(enc); - *nextTokPtr = ptr; - return XML_TOK_DATA_NEWLINE; - } - *nextTokPtr = ptr; - return XML_TOK_DATA_CHARS; - default: - ptr += MINBPC(enc); - break; - } - } - *nextTokPtr = ptr; - return XML_TOK_DATA_CHARS; -} - -#ifdef XML_DTD - -static int PTRCALL -PREFIX(ignoreSectionTok)(const ENCODING *enc, const char *ptr, - const char *end, const char **nextTokPtr) -{ - int level = 0; - if (MINBPC(enc) > 1) { - size_t n = end - ptr; - if (n & (MINBPC(enc) - 1)) { - n &= ~(MINBPC(enc) - 1); - end = ptr + n; - } - } - while (ptr != end) { - switch (BYTE_TYPE(enc, ptr)) { - INVALID_CASES(ptr, nextTokPtr) - case BT_LT: - if ((ptr += MINBPC(enc)) == end) - return XML_TOK_PARTIAL; - if (CHAR_MATCHES(enc, ptr, ASCII_EXCL)) { - if ((ptr += MINBPC(enc)) == end) - return XML_TOK_PARTIAL; - if (CHAR_MATCHES(enc, ptr, ASCII_LSQB)) { - ++level; - ptr += MINBPC(enc); - } - } - break; - case BT_RSQB: - if ((ptr += MINBPC(enc)) == end) - return XML_TOK_PARTIAL; - if (CHAR_MATCHES(enc, ptr, ASCII_RSQB)) { - if ((ptr += MINBPC(enc)) == end) - return XML_TOK_PARTIAL; - if (CHAR_MATCHES(enc, ptr, ASCII_GT)) { - ptr += MINBPC(enc); - if (level == 0) { - *nextTokPtr = ptr; - return XML_TOK_IGNORE_SECT; - } - --level; - } - } - break; - default: - ptr += MINBPC(enc); - break; - } - } - return XML_TOK_PARTIAL; -} - -#endif /* XML_DTD */ - -static int PTRCALL -PREFIX(isPublicId)(const ENCODING *enc, const char *ptr, const char *end, - const char **badPtr) -{ - ptr += MINBPC(enc); - end -= MINBPC(enc); - for (; ptr != end; ptr += MINBPC(enc)) { - switch (BYTE_TYPE(enc, ptr)) { - case BT_DIGIT: - case BT_HEX: - case BT_MINUS: - case BT_APOS: - case BT_LPAR: - case BT_RPAR: - case BT_PLUS: - case BT_COMMA: - case BT_SOL: - case BT_EQUALS: - case BT_QUEST: - case BT_CR: - case BT_LF: - case BT_SEMI: - case BT_EXCL: - case BT_AST: - case BT_PERCNT: - case BT_NUM: -#ifdef XML_NS - case BT_COLON: -#endif - break; - case BT_S: - if (CHAR_MATCHES(enc, ptr, ASCII_TAB)) { - *badPtr = ptr; - return 0; - } - break; - case BT_NAME: - case BT_NMSTRT: - if (!(BYTE_TO_ASCII(enc, ptr) & ~0x7f)) - break; - default: - switch (BYTE_TO_ASCII(enc, ptr)) { - case 0x24: /* $ */ - case 0x40: /* @ */ - break; - default: - *badPtr = ptr; - return 0; - } - break; - } - } - return 1; -} - -/* This must only be called for a well-formed start-tag or empty - element tag. Returns the number of attributes. Pointers to the - first attsMax attributes are stored in atts. -*/ - -static int PTRCALL -PREFIX(getAtts)(const ENCODING *enc, const char *ptr, - int attsMax, ATTRIBUTE *atts) -{ - enum { other, inName, inValue } state = inName; - int nAtts = 0; - int open = 0; /* defined when state == inValue; - initialization just to shut up compilers */ - - for (ptr += MINBPC(enc);; ptr += MINBPC(enc)) { - switch (BYTE_TYPE(enc, ptr)) { -#define START_NAME \ - if (state == other) { \ - if (nAtts < attsMax) { \ - atts[nAtts].name = ptr; \ - atts[nAtts].normalized = 1; \ - } \ - state = inName; \ - } -#define LEAD_CASE(n) \ - case BT_LEAD ## n: START_NAME ptr += (n - MINBPC(enc)); break; - LEAD_CASE(2) LEAD_CASE(3) LEAD_CASE(4) -#undef LEAD_CASE - case BT_NONASCII: - case BT_NMSTRT: - case BT_HEX: - START_NAME - break; -#undef START_NAME - case BT_QUOT: - if (state != inValue) { - if (nAtts < attsMax) - atts[nAtts].valuePtr = ptr + MINBPC(enc); - state = inValue; - open = BT_QUOT; - } - else if (open == BT_QUOT) { - state = other; - if (nAtts < attsMax) - atts[nAtts].valueEnd = ptr; - nAtts++; - } - break; - case BT_APOS: - if (state != inValue) { - if (nAtts < attsMax) - atts[nAtts].valuePtr = ptr + MINBPC(enc); - state = inValue; - open = BT_APOS; - } - else if (open == BT_APOS) { - state = other; - if (nAtts < attsMax) - atts[nAtts].valueEnd = ptr; - nAtts++; - } - break; - case BT_AMP: - if (nAtts < attsMax) - atts[nAtts].normalized = 0; - break; - case BT_S: - if (state == inName) - state = other; - else if (state == inValue - && nAtts < attsMax - && atts[nAtts].normalized - && (ptr == atts[nAtts].valuePtr - || BYTE_TO_ASCII(enc, ptr) != ASCII_SPACE - || BYTE_TO_ASCII(enc, ptr + MINBPC(enc)) == ASCII_SPACE - || BYTE_TYPE(enc, ptr + MINBPC(enc)) == open)) - atts[nAtts].normalized = 0; - break; - case BT_CR: case BT_LF: - /* This case ensures that the first attribute name is counted - Apart from that we could just change state on the quote. */ - if (state == inName) - state = other; - else if (state == inValue && nAtts < attsMax) - atts[nAtts].normalized = 0; - break; - case BT_GT: - case BT_SOL: - if (state != inValue) - return nAtts; - break; - default: - break; - } - } - /* not reached */ -} - -static int PTRFASTCALL -PREFIX(charRefNumber)(const ENCODING *enc, const char *ptr) -{ - int result = 0; - /* skip &# */ - ptr += 2*MINBPC(enc); - if (CHAR_MATCHES(enc, ptr, ASCII_x)) { - for (ptr += MINBPC(enc); - !CHAR_MATCHES(enc, ptr, ASCII_SEMI); - ptr += MINBPC(enc)) { - int c = BYTE_TO_ASCII(enc, ptr); - switch (c) { - case ASCII_0: case ASCII_1: case ASCII_2: case ASCII_3: case ASCII_4: - case ASCII_5: case ASCII_6: case ASCII_7: case ASCII_8: case ASCII_9: - result <<= 4; - result |= (c - ASCII_0); - break; - case ASCII_A: case ASCII_B: case ASCII_C: - case ASCII_D: case ASCII_E: case ASCII_F: - result <<= 4; - result += 10 + (c - ASCII_A); - break; - case ASCII_a: case ASCII_b: case ASCII_c: - case ASCII_d: case ASCII_e: case ASCII_f: - result <<= 4; - result += 10 + (c - ASCII_a); - break; - } - if (result >= 0x110000) - return -1; - } - } - else { - for (; !CHAR_MATCHES(enc, ptr, ASCII_SEMI); ptr += MINBPC(enc)) { - int c = BYTE_TO_ASCII(enc, ptr); - result *= 10; - result += (c - ASCII_0); - if (result >= 0x110000) - return -1; - } - } - return checkCharRefNumber(result); -} - -static int PTRCALL -PREFIX(predefinedEntityName)(const ENCODING *enc, const char *ptr, - const char *end) -{ - switch ((end - ptr)/MINBPC(enc)) { - case 2: - if (CHAR_MATCHES(enc, ptr + MINBPC(enc), ASCII_t)) { - switch (BYTE_TO_ASCII(enc, ptr)) { - case ASCII_l: - return ASCII_LT; - case ASCII_g: - return ASCII_GT; - } - } - break; - case 3: - if (CHAR_MATCHES(enc, ptr, ASCII_a)) { - ptr += MINBPC(enc); - if (CHAR_MATCHES(enc, ptr, ASCII_m)) { - ptr += MINBPC(enc); - if (CHAR_MATCHES(enc, ptr, ASCII_p)) - return ASCII_AMP; - } - } - break; - case 4: - switch (BYTE_TO_ASCII(enc, ptr)) { - case ASCII_q: - ptr += MINBPC(enc); - if (CHAR_MATCHES(enc, ptr, ASCII_u)) { - ptr += MINBPC(enc); - if (CHAR_MATCHES(enc, ptr, ASCII_o)) { - ptr += MINBPC(enc); - if (CHAR_MATCHES(enc, ptr, ASCII_t)) - return ASCII_QUOT; - } - } - break; - case ASCII_a: - ptr += MINBPC(enc); - if (CHAR_MATCHES(enc, ptr, ASCII_p)) { - ptr += MINBPC(enc); - if (CHAR_MATCHES(enc, ptr, ASCII_o)) { - ptr += MINBPC(enc); - if (CHAR_MATCHES(enc, ptr, ASCII_s)) - return ASCII_APOS; - } - } - break; - } - } - return 0; -} - -static int PTRCALL -PREFIX(sameName)(const ENCODING *enc, const char *ptr1, const char *ptr2) -{ - for (;;) { - switch (BYTE_TYPE(enc, ptr1)) { -#define LEAD_CASE(n) \ - case BT_LEAD ## n: \ - if (*ptr1++ != *ptr2++) \ - return 0; - LEAD_CASE(4) LEAD_CASE(3) LEAD_CASE(2) -#undef LEAD_CASE - /* fall through */ - if (*ptr1++ != *ptr2++) - return 0; - break; - case BT_NONASCII: - case BT_NMSTRT: -#ifdef XML_NS - case BT_COLON: -#endif - case BT_HEX: - case BT_DIGIT: - case BT_NAME: - case BT_MINUS: - if (*ptr2++ != *ptr1++) - return 0; - if (MINBPC(enc) > 1) { - if (*ptr2++ != *ptr1++) - return 0; - if (MINBPC(enc) > 2) { - if (*ptr2++ != *ptr1++) - return 0; - if (MINBPC(enc) > 3) { - if (*ptr2++ != *ptr1++) - return 0; - } - } - } - break; - default: - if (MINBPC(enc) == 1 && *ptr1 == *ptr2) - return 1; - switch (BYTE_TYPE(enc, ptr2)) { - case BT_LEAD2: - case BT_LEAD3: - case BT_LEAD4: - case BT_NONASCII: - case BT_NMSTRT: -#ifdef XML_NS - case BT_COLON: -#endif - case BT_HEX: - case BT_DIGIT: - case BT_NAME: - case BT_MINUS: - return 0; - default: - return 1; - } - } - } - /* not reached */ -} - -static int PTRCALL -PREFIX(nameMatchesAscii)(const ENCODING *enc, const char *ptr1, - const char *end1, const char *ptr2) -{ - for (; *ptr2; ptr1 += MINBPC(enc), ptr2++) { - if (ptr1 == end1) - return 0; - if (!CHAR_MATCHES(enc, ptr1, *ptr2)) - return 0; - } - return ptr1 == end1; -} - -static int PTRFASTCALL -PREFIX(nameLength)(const ENCODING *enc, const char *ptr) -{ - const char *start = ptr; - for (;;) { - switch (BYTE_TYPE(enc, ptr)) { -#define LEAD_CASE(n) \ - case BT_LEAD ## n: ptr += n; break; - LEAD_CASE(2) LEAD_CASE(3) LEAD_CASE(4) -#undef LEAD_CASE - case BT_NONASCII: - case BT_NMSTRT: -#ifdef XML_NS - case BT_COLON: -#endif - case BT_HEX: - case BT_DIGIT: - case BT_NAME: - case BT_MINUS: - ptr += MINBPC(enc); - break; - default: - return ptr - start; - } - } -} - -static const char * PTRFASTCALL -PREFIX(skipS)(const ENCODING *enc, const char *ptr) -{ - for (;;) { - switch (BYTE_TYPE(enc, ptr)) { - case BT_LF: - case BT_CR: - case BT_S: - ptr += MINBPC(enc); - break; - default: - return ptr; - } - } -} - -static void PTRCALL -PREFIX(updatePosition)(const ENCODING *enc, - const char *ptr, - const char *end, - POSITION *pos) -{ - while (ptr != end) { - switch (BYTE_TYPE(enc, ptr)) { -#define LEAD_CASE(n) \ - case BT_LEAD ## n: \ - ptr += n; \ - break; - LEAD_CASE(2) LEAD_CASE(3) LEAD_CASE(4) -#undef LEAD_CASE - case BT_LF: - pos->columnNumber = (unsigned)-1; - pos->lineNumber++; - ptr += MINBPC(enc); - break; - case BT_CR: - pos->lineNumber++; - ptr += MINBPC(enc); - if (ptr != end && BYTE_TYPE(enc, ptr) == BT_LF) - ptr += MINBPC(enc); - pos->columnNumber = (unsigned)-1; - break; - default: - ptr += MINBPC(enc); - break; - } - pos->columnNumber++; - } -} - -#undef DO_LEAD_CASE -#undef MULTIBYTE_CASES -#undef INVALID_CASES -#undef CHECK_NAME_CASE -#undef CHECK_NAME_CASES -#undef CHECK_NMSTRT_CASE -#undef CHECK_NMSTRT_CASES - diff --git a/wxWidgets/src/expat/lib/xmltok_impl.h b/wxWidgets/src/expat/lib/xmltok_impl.h deleted file mode 100644 index da0ea60a65..0000000000 --- a/wxWidgets/src/expat/lib/xmltok_impl.h +++ /dev/null @@ -1,46 +0,0 @@ -/* -Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd -See the file COPYING for copying permission. -*/ - -enum { - BT_NONXML, - BT_MALFORM, - BT_LT, - BT_AMP, - BT_RSQB, - BT_LEAD2, - BT_LEAD3, - BT_LEAD4, - BT_TRAIL, - BT_CR, - BT_LF, - BT_GT, - BT_QUOT, - BT_APOS, - BT_EQUALS, - BT_QUEST, - BT_EXCL, - BT_SOL, - BT_SEMI, - BT_NUM, - BT_LSQB, - BT_S, - BT_NMSTRT, - BT_COLON, - BT_HEX, - BT_DIGIT, - BT_NAME, - BT_MINUS, - BT_OTHER, /* known not to be a name or name start character */ - BT_NONASCII, /* might be a name or name start character */ - BT_PERCNT, - BT_LPAR, - BT_RPAR, - BT_AST, - BT_PLUS, - BT_COMMA, - BT_VERBAR -}; - -#include diff --git a/wxWidgets/src/expat/lib/xmltok_ns.c b/wxWidgets/src/expat/lib/xmltok_ns.c deleted file mode 100644 index 5610eb95ba..0000000000 --- a/wxWidgets/src/expat/lib/xmltok_ns.c +++ /dev/null @@ -1,106 +0,0 @@ -const ENCODING * -NS(XmlGetUtf8InternalEncoding)(void) -{ - return &ns(internal_utf8_encoding).enc; -} - -const ENCODING * -NS(XmlGetUtf16InternalEncoding)(void) -{ -#if BYTEORDER == 1234 - return &ns(internal_little2_encoding).enc; -#elif BYTEORDER == 4321 - return &ns(internal_big2_encoding).enc; -#else - const short n = 1; - return (*(const char *)&n - ? &ns(internal_little2_encoding).enc - : &ns(internal_big2_encoding).enc); -#endif -} - -static const ENCODING *NS(encodings)[] = { - &ns(latin1_encoding).enc, - &ns(ascii_encoding).enc, - &ns(utf8_encoding).enc, - &ns(big2_encoding).enc, - &ns(big2_encoding).enc, - &ns(little2_encoding).enc, - &ns(utf8_encoding).enc /* NO_ENC */ -}; - -static int PTRCALL -NS(initScanProlog)(const ENCODING *enc, const char *ptr, const char *end, - const char **nextTokPtr) -{ - return initScan(NS(encodings), (const INIT_ENCODING *)enc, - XML_PROLOG_STATE, ptr, end, nextTokPtr); -} - -static int PTRCALL -NS(initScanContent)(const ENCODING *enc, const char *ptr, const char *end, - const char **nextTokPtr) -{ - return initScan(NS(encodings), (const INIT_ENCODING *)enc, - XML_CONTENT_STATE, ptr, end, nextTokPtr); -} - -int -NS(XmlInitEncoding)(INIT_ENCODING *p, const ENCODING **encPtr, - const char *name) -{ - int i = getEncodingIndex(name); - if (i == UNKNOWN_ENC) - return 0; - SET_INIT_ENC_INDEX(p, i); - p->initEnc.scanners[XML_PROLOG_STATE] = NS(initScanProlog); - p->initEnc.scanners[XML_CONTENT_STATE] = NS(initScanContent); - p->initEnc.updatePosition = initUpdatePosition; - p->encPtr = encPtr; - *encPtr = &(p->initEnc); - return 1; -} - -static const ENCODING * -NS(findEncoding)(const ENCODING *enc, const char *ptr, const char *end) -{ -#define ENCODING_MAX 128 - char buf[ENCODING_MAX]; - char *p = buf; - int i; - XmlUtf8Convert(enc, &ptr, end, &p, p + ENCODING_MAX - 1); - if (ptr != end) - return 0; - *p = 0; - if (streqci(buf, KW_UTF_16) && enc->minBytesPerChar == 2) - return enc; - i = getEncodingIndex(buf); - if (i == UNKNOWN_ENC) - return 0; - return NS(encodings)[i]; -} - -int -NS(XmlParseXmlDecl)(int isGeneralTextEntity, - const ENCODING *enc, - const char *ptr, - const char *end, - const char **badPtr, - const char **versionPtr, - const char **versionEndPtr, - const char **encodingName, - const ENCODING **encoding, - int *standalone) -{ - return doParseXmlDecl(NS(findEncoding), - isGeneralTextEntity, - enc, - ptr, - end, - badPtr, - versionPtr, - versionEndPtr, - encodingName, - encoding, - standalone); -} diff --git a/wxWidgets/src/expat/vms/README.vms b/wxWidgets/src/expat/vms/README.vms deleted file mode 100644 index 3dd2ca73fe..0000000000 --- a/wxWidgets/src/expat/vms/README.vms +++ /dev/null @@ -1,23 +0,0 @@ -4-jun-2002 Craig A. Berry - Added rudimentary build procedures for - OpenVMS based on work by Martin Vorlaender. - - -You'll need MMS or its freeware equivalent MMK. Just go to the -top-level directory and type - -$ MMS/DESCRIPTION=[.vms] - - or - -$ MMK/DESCRIPTION=[.vms] - -You'll end up with the object library expat.olb. For now, installation -consists merely of copying the object library, include files, and -documentation to a suitable location. - -To-do list: - - -- create a shareable image - -- build and run the tests and build the xmlwf utility - -- create an install target diff --git a/wxWidgets/src/expat/vms/descrip.mms b/wxWidgets/src/expat/vms/descrip.mms deleted file mode 100644 index 9e5d2ad872..0000000000 --- a/wxWidgets/src/expat/vms/descrip.mms +++ /dev/null @@ -1,69 +0,0 @@ -# Bare bones description file (Makefile) for OpenVMS - -PACKAGE = expat -VERSION = 1.95.3 -EXPAT_MAJOR_VERSION=1 -EXPAT_MINOR_VERSION=95 -EXPAT_EDIT=3 - -O = .obj -OLB = .olb - -LIBRARY = expat$(OLB) -LIBDIR = [.lib] -SOURCES = $(LIBDIR)xmlparse.c $(LIBDIR)xmltok.c $(LIBDIR)xmlrole.c -OBJECTS = xmlparse$(O) xmltok$(O) xmlrole$(O) - -TEMPLATES = xmltok_impl.c xmltok_ns.c -APIHEADER = $(LIBDIR)expat.h -HEADERS = $(LIBDIR)ascii.h $(LIBDIR)iasciitab.h $(LIBDIR)utf8tab.h $(LIBDIR)xmltok.h \ - $(LIBDIR)asciitab.h $(LIBDIR)latin1tab.h \ - $(LIBDIR)nametab.h $(LIBDIR)xmldef.h $(LIBDIR)xmlrole.h $(LIBDIR)xmltok_impl.h - -CONFIG_HEADER = expat_config.h -INCLUDES = /INCLUDE=([],[.lib]) -DEFS = /DEFINE=(PACKAGE="""$(PACKAGE)""",VERSION="""$(PACKAGE)_$(VERSION)""") -LIBREVISION = 0 -LIBCURRENT = 1 -LIBAGE = 0 -# -COMPILE = $(CC) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) -# -# DISTFILES = $(DIST_COMMON) $(SOURCES) $(TEMPLATES) $(APIHEADER) $(HEADERS) -# -# TAR = gtar -# GZIP_ENV = --best -# -.FIRST : - IF F$SEARCH("$(LIBRARY)") .EQS. "" THEN $(LIBR) /CREATE /OBJECT $(LIBRARY) - -all : $(LIBRARY) - -.SUFFIXES : -.SUFFIXES : $(OLB) $(O) .C .H - -.c$(O) : - $(COMPILE) $(MMS$SOURCE) - -$(O)$(OLB) : - @ IF F$SEARCH("$(MMS$TARGET)") .EQS. "" - - THEN LIBRARY/CREATE/LOG $(MMS$TARGET) - @ LIBRARY /REPLACE /LOG $(MMS$TARGET) $(MMS$SOURCE) - -clean : - DELETE $(LIBRARY);*,*$(O);* - -$(LIBRARY) : $(LIBRARY)( $(OBJECTS) ) - $(LIBR) /COMPRESS $(MMS$TARGET) - -$(CONFIG_HEADER) : [.vms]expat_config.h - COPY/LOG $(MMS$SOURCE) $(MMS$TARGET) - -xmlparse$(O) : $(LIBDIR)xmlparse.c $(LIBDIR)expat.h $(LIBDIR)xmlrole.h $(LIBDIR)xmltok.h $(CONFIG_HEADER) - -xmlrole$(O) : $(LIBDIR)xmlrole.c $(LIBDIR)ascii.h $(LIBDIR)xmlrole.h $(CONFIG_HEADER) - -xmltok$(O) : $(LIBDIR)xmltok.c $(LIBDIR)xmltok_impl.c $(LIBDIR)xmltok_ns.c \ - $(LIBDIR)ascii.h $(LIBDIR)asciitab.h $(LIBDIR)iasciitab.h $(LIBDIR)latin1tab.h \ - $(LIBDIR)nametab.h $(LIBDIR)utf8tab.h $(LIBDIR)xmltok.h $(LIBDIR)xmltok_impl.h $(CONFIG_HEADER) - diff --git a/wxWidgets/src/expat/vms/expat_config.h b/wxWidgets/src/expat/vms/expat_config.h deleted file mode 100644 index b7da6eeaab..0000000000 --- a/wxWidgets/src/expat/vms/expat_config.h +++ /dev/null @@ -1,61 +0,0 @@ -/* Copyright 2000, Clark Cooper - All rights reserved. - - This is free software. You are permitted to copy, distribute, or modify - it under the terms of the MIT/X license (contained in the COPYING file - with this distribution.) -*/ - -/* Define to empty if the keyword does not work. */ -#undef const - -/* Define if you have a working `mmap' system call. */ -#undef HAVE_MMAP - -/* Define to `long' if doesn't define. */ -#undef off_t - -/* Define to `unsigned' if doesn't define. */ -#undef size_t - -/* Define if you have the ANSI C header files. */ -#define STDC_HEADERS 1 - -/* Define if your processor stores words with the most significant - byte first (like Motorola and SPARC, unlike Intel and VAX). */ -#undef WORDS_BIGENDIAN - -/* Define if you have the bcopy function. */ -#undef HAVE_BCOPY - -/* Define if you have the getpagesize function. */ -#undef HAVE_GETPAGESIZE - -/* Define if you have the memmove function. */ -#define HAVE_MEMMOVE 1 - -/* Define if you have the header file. */ -#undef HAVE_FCNTL_H - -/* Define if you have the header file. */ -#define HAVE_UNISTD_H 1 - -#define XML_NS -#define XML_DTD - -#ifdef WORDS_BIGENDIAN -#define XML_BYTE_ORDER 21 -#else -#define XML_BYTE_ORDER 12 -#endif - -#define XML_CONTEXT_BYTES 1024 - -#ifndef HAVE_MEMMOVE -#ifdef HAVE_BCOPY -#define memmove(d,s,l) bcopy((s),(d),(l)) -#else -#define memmove(d,s,l) ;punting on memmove; -#endif - -#endif diff --git a/wxWidgets/src/expat/win32/MANIFEST.txt b/wxWidgets/src/expat/win32/MANIFEST.txt deleted file mode 100644 index 66b780ed34..0000000000 --- a/wxWidgets/src/expat/win32/MANIFEST.txt +++ /dev/null @@ -1,29 +0,0 @@ - Overview of the Expat distribution - -The Expat distribution creates several subdirectories on your system. -Some of these directories contain components of interest to all Expat -users, and some contain material of interest to developers who wish to -use Expat in their applications. In the list below, is the -directory you specified to the installer. - - Directory Contents - -------------------------------------------------------------------- - \ The XML well-formedness checker and some general - information files. - - \Doc\ API documentation for developers. - - \Libs\ Pre-compiled dynamic libraries for developers. - - \StaticLibs\ Pre-compiled static libraries for developers. - - \Source\ Source code, which may interest some developers, - including a workspace for Microsft Visual C++. - The source code includes the parser, the well- - formedness checker, and a couple of small sample - applications. - - \Source\bcb5\ Project files for Borland C++ Builder 5 and BCC - 5.5. - - \Unistall\ The uninstaller and its data files. diff --git a/wxWidgets/src/expat/win32/expat.iss b/wxWidgets/src/expat/win32/expat.iss deleted file mode 100644 index 1ad7398cc9..0000000000 --- a/wxWidgets/src/expat/win32/expat.iss +++ /dev/null @@ -1,61 +0,0 @@ -; Basic setup script for the Inno Setep installer builder. For more -; information on the free installer builder, see www.jrsoftware.org. -; -; This script was contributed by Tim Peters. -; The current version is used with Inno Setup 2.0.19. - -[Setup] -AppName=expat -AppId=expat -AppVersion=1.95.6 -AppVerName=expat 1.95.6 -AppCopyright=Copyright © 1998-2002 Thai Open Source Software Center, Clark Cooper, and the Expat maintainers -DefaultDirName={sd}\Expat-1.95.6 -AppPublisher=The Expat Developers -AppPublisherURL=http://www.libexpat.org/ -AppSupportURL=http://www.libexpat.org/ -AppUpdatesURL=http://www.libexpat.org/ -UninstallDisplayName=Expat XML Parser (version 1.95.6) -UninstallFilesDir={app}\Uninstall - -Compression=bzip/9 -SourceDir=.. -OutputDir=win32 -DisableStartupPrompt=yes -AllowNoIcons=yes -DisableProgramGroupPage=yes -DisableReadyPage=yes - -[Files] -CopyMode: alwaysoverwrite; Source: xmlwf\Release\*.exe; DestDir: "{app}" -CopyMode: alwaysoverwrite; Source: win32\MANIFEST.txt; DestDir: "{app}" -CopyMode: alwaysoverwrite; Source: Changes; DestDir: "{app}"; DestName: Changes.txt -CopyMode: alwaysoverwrite; Source: COPYING; DestDir: "{app}"; DestName: COPYING.txt -CopyMode: alwaysoverwrite; Source: README; DestDir: "{app}"; DestName: README.txt -CopyMode: alwaysoverwrite; Source: doc\*.html; DestDir: "{app}\Doc" -CopyMode: alwaysoverwrite; Source: doc\*.css; DestDir: "{app}\Doc" -CopyMode: alwaysoverwrite; Source: doc\*.png; DestDir: "{app}\Doc" -CopyMode: alwaysoverwrite; Source: lib\Release\*.dll; DestDir: "{app}\Libs" -CopyMode: alwaysoverwrite; Source: lib\Release\*.lib; DestDir: "{app}\Libs" -CopyMode: alwaysoverwrite; Source: lib\Release-w\*.dll; DestDir: "{app}\Libs" -CopyMode: alwaysoverwrite; Source: lib\Release-w\*.lib; DestDir: "{app}\Libs" -CopyMode: alwaysoverwrite; Source: lib\Release_static\*.lib; DestDir: "{app}\StaticLibs" -CopyMode: alwaysoverwrite; Source: lib\Release-w_static\*.lib; DestDir: "{app}\StaticLibs" -CopyMode: alwaysoverwrite; Source: expat.dsw; DestDir: "{app}\Source" -CopyMode: alwaysoverwrite; Source: bcb5\*.*; DestDir: "{app}\Source\bcb5" -CopyMode: alwaysoverwrite; Source: lib\*.c; DestDir: "{app}\Source\lib" -CopyMode: alwaysoverwrite; Source: lib\*.h; DestDir: "{app}\Source\lib" -CopyMode: alwaysoverwrite; Source: lib\*.def; DestDir: "{app}\Source\lib" -CopyMode: alwaysoverwrite; Source: lib\*.dsp; DestDir: "{app}\Source\lib" -CopyMode: alwaysoverwrite; Source: examples\*.c; DestDir: "{app}\Source\examples" -CopyMode: alwaysoverwrite; Source: examples\*.dsp; DestDir: "{app}\Source\examples" -CopyMode: alwaysoverwrite; Source: tests\*.c; DestDir: "{app}\Source\tests" -CopyMode: alwaysoverwrite; Source: tests\*.h; DestDir: "{app}\Source\tests" -CopyMode: alwaysoverwrite; Source: tests\README.txt; DestDir: "{app}\Source\tests" -CopyMode: alwaysoverwrite; Source: xmlwf\*.c*; DestDir: "{app}\Source\xmlwf" -CopyMode: alwaysoverwrite; Source: xmlwf\*.h; DestDir: "{app}\Source\xmlwf" -CopyMode: alwaysoverwrite; Source: xmlwf\*.dsp; DestDir: "{app}\Source\xmlwf" - -[Messages] -WelcomeLabel1=Welcome to the Expat XML Parser Setup Wizard -WelcomeLabel2=This will install [name/ver] on your computer.%n%nExpat is an XML parser with a C-language API, and is primarily made available to allow developers to build applications which use XML using a portable API and fast implementation.%n%nIt is strongly recommended that you close all other applications you have running before continuing. This will help prevent any conflicts during the installation process. diff --git a/wxWidgets/src/expat/xmlwf/codepage.c b/wxWidgets/src/expat/xmlwf/codepage.c deleted file mode 100644 index b8fdb7a6c9..0000000000 --- a/wxWidgets/src/expat/xmlwf/codepage.c +++ /dev/null @@ -1,68 +0,0 @@ -/* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd - See the file COPYING for copying permission. -*/ - -#include "codepage.h" - -#ifdef WIN32 -#define STRICT 1 -#define WIN32_LEAN_AND_MEAN 1 - -#include - -int -codepageMap(int cp, int *map) -{ - int i; - CPINFO info; - if (!GetCPInfo(cp, &info) || info.MaxCharSize > 2) - return 0; - for (i = 0; i < 256; i++) - map[i] = -1; - if (info.MaxCharSize > 1) { - for (i = 0; i < MAX_LEADBYTES; i++) { - int j, lim; - if (info.LeadByte[i] == 0 && info.LeadByte[i + 1] == 0) - break; - lim = info.LeadByte[i + 1]; - for (j = info.LeadByte[i]; j < lim; j++) - map[j] = -2; - } - } - for (i = 0; i < 256; i++) { - if (map[i] == -1) { - char c = (char)i; - unsigned short n; - if (MultiByteToWideChar(cp, MB_PRECOMPOSED|MB_ERR_INVALID_CHARS, - &c, 1, &n, 1) == 1) - map[i] = n; - } - } - return 1; -} - -int -codepageConvert(int cp, const char *p) -{ - unsigned short c; - if (MultiByteToWideChar(cp, MB_PRECOMPOSED|MB_ERR_INVALID_CHARS, - p, 2, &c, 1) == 1) - return c; - return -1; -} - -#else /* not WIN32 */ - -int -codepageMap(int cp, int *map) -{ - return 0; -} - -int -codepageConvert(int cp, const char *p) -{ - return -1; -} - -#endif /* not WIN32 */ diff --git a/wxWidgets/src/expat/xmlwf/codepage.h b/wxWidgets/src/expat/xmlwf/codepage.h deleted file mode 100644 index 6a4df68883..0000000000 --- a/wxWidgets/src/expat/xmlwf/codepage.h +++ /dev/null @@ -1,6 +0,0 @@ -/* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd - See the file COPYING for copying permission. -*/ - -int codepageMap(int cp, int *map); -int codepageConvert(int cp, const char *p); diff --git a/wxWidgets/src/expat/xmlwf/ct.c b/wxWidgets/src/expat/xmlwf/ct.c deleted file mode 100644 index 95903a3450..0000000000 --- a/wxWidgets/src/expat/xmlwf/ct.c +++ /dev/null @@ -1,147 +0,0 @@ -#define CHARSET_MAX 41 - -static const char * -getTok(const char **pp) -{ - enum { inAtom, inString, init, inComment }; - int state = init; - const char *tokStart = 0; - for (;;) { - switch (**pp) { - case '\0': - return 0; - case ' ': - case '\r': - case '\t': - case '\n': - if (state == inAtom) - return tokStart; - break; - case '(': - if (state == inAtom) - return tokStart; - if (state != inString) - state++; - break; - case ')': - if (state > init) - --state; - else if (state != inString) - return 0; - break; - case ';': - case '/': - case '=': - if (state == inAtom) - return tokStart; - if (state == init) - return (*pp)++; - break; - case '\\': - ++*pp; - if (**pp == '\0') - return 0; - break; - case '"': - switch (state) { - case inString: - ++*pp; - return tokStart; - case inAtom: - return tokStart; - case init: - tokStart = *pp; - state = inString; - break; - } - break; - default: - if (state == init) { - tokStart = *pp; - state = inAtom; - } - break; - } - ++*pp; - } - /* not reached */ -} - -/* key must be lowercase ASCII */ - -static int -matchkey(const char *start, const char *end, const char *key) -{ - if (!start) - return 0; - for (; start != end; start++, key++) - if (*start != *key && *start != 'A' + (*key - 'a')) - return 0; - return *key == '\0'; -} - -void -getXMLCharset(const char *buf, char *charset) -{ - const char *next, *p; - - charset[0] = '\0'; - next = buf; - p = getTok(&next); - if (matchkey(p, next, "text")) - strcpy(charset, "us-ascii"); - else if (!matchkey(p, next, "application")) - return; - p = getTok(&next); - if (!p || *p != '/') - return; - p = getTok(&next); - if (matchkey(p, next, "xml")) - isXml = 1; - p = getTok(&next); - while (p) { - if (*p == ';') { - p = getTok(&next); - if (matchkey(p, next, "charset")) { - p = getTok(&next); - if (p && *p == '=') { - p = getTok(&next); - if (p) { - char *s = charset; - if (*p == '"') { - while (++p != next - 1) { - if (*p == '\\') - ++p; - if (s == charset + CHARSET_MAX - 1) { - charset[0] = '\0'; - break; - } - *s++ = *p; - } - *s++ = '\0'; - } - else { - if (next - p > CHARSET_MAX - 1) - break; - while (p != next) - *s++ = *p++; - *s = 0; - break; - } - } - } - } - } - else - p = getTok(&next); - } -} - -int -main(int argc, char **argv) -{ - char buf[CHARSET_MAX]; - getXMLCharset(argv[1], buf); - printf("charset = \"%s\"\n", buf); - return 0; -} diff --git a/wxWidgets/src/expat/xmlwf/filemap.h b/wxWidgets/src/expat/xmlwf/filemap.h deleted file mode 100644 index 814edec252..0000000000 --- a/wxWidgets/src/expat/xmlwf/filemap.h +++ /dev/null @@ -1,17 +0,0 @@ -/* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd - See the file COPYING for copying permission. -*/ - -#include - -#ifdef XML_UNICODE -int filemap(const wchar_t *name, - void (*processor)(const void *, size_t, - const wchar_t *, void *arg), - void *arg); -#else -int filemap(const char *name, - void (*processor)(const void *, size_t, - const char *, void *arg), - void *arg); -#endif diff --git a/wxWidgets/src/expat/xmlwf/readfilemap.c b/wxWidgets/src/expat/xmlwf/readfilemap.c deleted file mode 100644 index 64c69850c2..0000000000 --- a/wxWidgets/src/expat/xmlwf/readfilemap.c +++ /dev/null @@ -1,78 +0,0 @@ -/* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd - See the file COPYING for copying permission. -*/ - -#include -#include -#include -#include -#include - -#ifndef S_ISREG -#ifndef S_IFREG -#define S_IFREG _S_IFREG -#endif -#ifndef S_IFMT -#define S_IFMT _S_IFMT -#endif -#define S_ISREG(m) (((m) & S_IFMT) == S_IFREG) -#endif /* not S_ISREG */ - -#ifndef O_BINARY -#ifdef _O_BINARY -#define O_BINARY _O_BINARY -#else -#define O_BINARY 0 -#endif -#endif - -#include "filemap.h" - -int -filemap(const char *name, - void (*processor)(const void *, size_t, const char *, void *arg), - void *arg) -{ - size_t nbytes; - int fd; - int n; - struct stat sb; - void *p; - - fd = open(name, O_RDONLY|O_BINARY); - if (fd < 0) { - perror(name); - return 0; - } - if (fstat(fd, &sb) < 0) { - perror(name); - return 0; - } - if (!S_ISREG(sb.st_mode)) { - fprintf(stderr, "%s: not a regular file\n", name); - return 0; - } - nbytes = sb.st_size; - p = malloc(nbytes); - if (!p) { - fprintf(stderr, "%s: out of memory\n", name); - return 0; - } - n = read(fd, p, nbytes); - if (n < 0) { - perror(name); - free(p); - close(fd); - return 0; - } - if (n != nbytes) { - fprintf(stderr, "%s: read unexpected number of bytes\n", name); - free(p); - close(fd); - return 0; - } - processor(p, nbytes, name, arg); - free(p); - close(fd); - return 1; -} diff --git a/wxWidgets/src/expat/xmlwf/unixfilemap.c b/wxWidgets/src/expat/xmlwf/unixfilemap.c deleted file mode 100644 index 22048c82ed..0000000000 --- a/wxWidgets/src/expat/xmlwf/unixfilemap.c +++ /dev/null @@ -1,58 +0,0 @@ -/* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd - See the file COPYING for copying permission. -*/ - -#include -#include -#include -#include -#include -#include -#include -#include - -#ifndef MAP_FILE -#define MAP_FILE 0 -#endif - -#include "filemap.h" - -int -filemap(const char *name, - void (*processor)(const void *, size_t, const char *, void *arg), - void *arg) -{ - int fd; - size_t nbytes; - struct stat sb; - void *p; - - fd = open(name, O_RDONLY); - if (fd < 0) { - perror(name); - return 0; - } - if (fstat(fd, &sb) < 0) { - perror(name); - close(fd); - return 0; - } - if (!S_ISREG(sb.st_mode)) { - close(fd); - fprintf(stderr, "%s: not a regular file\n", name); - return 0; - } - - nbytes = sb.st_size; - p = (void *)mmap((caddr_t)0, (size_t)nbytes, PROT_READ, - MAP_FILE|MAP_PRIVATE, fd, (off_t)0); - if (p == (void *)-1) { - perror(name); - close(fd); - return 0; - } - processor(p, nbytes, name, arg); - munmap((caddr_t)p, nbytes); - close(fd); - return 1; -} diff --git a/wxWidgets/src/expat/xmlwf/win32filemap.c b/wxWidgets/src/expat/xmlwf/win32filemap.c deleted file mode 100644 index 41dc35b614..0000000000 --- a/wxWidgets/src/expat/xmlwf/win32filemap.c +++ /dev/null @@ -1,96 +0,0 @@ -/* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd - See the file COPYING for copying permission. -*/ - -#define STRICT 1 -#define WIN32_LEAN_AND_MEAN 1 - -#ifdef XML_UNICODE_WCHAR_T -#ifndef XML_UNICODE -#define XML_UNICODE -#endif -#endif - -#ifdef XML_UNICODE -#define UNICODE -#define _UNICODE -#endif /* XML_UNICODE */ -#include -#include -#include -#include "filemap.h" - -static void win32perror(const TCHAR *); - -int -filemap(const TCHAR *name, - void (*processor)(const void *, size_t, const TCHAR *, void *arg), - void *arg) -{ - HANDLE f; - HANDLE m; - DWORD size; - DWORD sizeHi; - void *p; - - f = CreateFile(name, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, - FILE_FLAG_SEQUENTIAL_SCAN, NULL); - if (f == INVALID_HANDLE_VALUE) { - win32perror(name); - return 0; - } - size = GetFileSize(f, &sizeHi); - if (size == (DWORD)-1) { - win32perror(name); - return 0; - } - if (sizeHi) { - _ftprintf(stderr, _T("%s: bigger than 2Gb\n"), name); - return 0; - } - /* CreateFileMapping barfs on zero length files */ - if (size == 0) { - static const char c = '\0'; - processor(&c, 0, name, arg); - CloseHandle(f); - return 1; - } - m = CreateFileMapping(f, NULL, PAGE_READONLY, 0, 0, NULL); - if (m == NULL) { - win32perror(name); - CloseHandle(f); - return 0; - } - p = MapViewOfFile(m, FILE_MAP_READ, 0, 0, 0); - if (p == NULL) { - win32perror(name); - CloseHandle(m); - CloseHandle(f); - return 0; - } - processor(p, size, name, arg); - UnmapViewOfFile(p); - CloseHandle(m); - CloseHandle(f); - return 1; -} - -static void -win32perror(const TCHAR *s) -{ - LPVOID buf; - if (FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER - | FORMAT_MESSAGE_FROM_SYSTEM, - NULL, - GetLastError(), - MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), - (LPTSTR) &buf, - 0, - NULL)) { - _ftprintf(stderr, _T("%s: %s"), s, buf); - fflush(stderr); - LocalFree(buf); - } - else - _ftprintf(stderr, _T("%s: unknown Windows error\n"), s); -} diff --git a/wxWidgets/src/expat/xmlwf/xmlfile.c b/wxWidgets/src/expat/xmlwf/xmlfile.c deleted file mode 100644 index 690be52304..0000000000 --- a/wxWidgets/src/expat/xmlwf/xmlfile.c +++ /dev/null @@ -1,231 +0,0 @@ -/* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd - See the file COPYING for copying permission. -*/ - -#include -#include -#include -#include -#include -#ifdef COMPILED_FROM_DSP -#include "winconfig.h" -#else -#include "expat_config.h" -#endif -#include "expat.h" -#include "xmlfile.h" -#include "xmltchar.h" -#include "filemap.h" - -#ifdef _MSC_VER -#include -#endif - -#ifdef HAVE_UNISTD_H -#include -#endif - -#ifndef O_BINARY -#ifdef _O_BINARY -#define O_BINARY _O_BINARY -#else -#define O_BINARY 0 -#endif -#endif - -#ifdef _DEBUG -#define READ_SIZE 16 -#else -#define READ_SIZE (1024*8) -#endif - - -typedef struct { - XML_Parser parser; - int *retPtr; -} PROCESS_ARGS; - -static void -reportError(XML_Parser parser, const XML_Char *filename) -{ - int code = XML_GetErrorCode(parser); - const XML_Char *message = XML_ErrorString(code); - if (message) - ftprintf(stdout, T("%s:%d:%d: %s\n"), - filename, - XML_GetErrorLineNumber(parser), - XML_GetErrorColumnNumber(parser), - message); - else - ftprintf(stderr, T("%s: (unknown message %d)\n"), filename, code); -} - -static void -processFile(const void *data, size_t size, - const XML_Char *filename, void *args) -{ - XML_Parser parser = ((PROCESS_ARGS *)args)->parser; - int *retPtr = ((PROCESS_ARGS *)args)->retPtr; - if (XML_Parse(parser, data, size, 1) == XML_STATUS_ERROR) { - reportError(parser, filename); - *retPtr = 0; - } - else - *retPtr = 1; -} - -#ifdef WIN32 - -static int -isAsciiLetter(XML_Char c) -{ - return (T('a') <= c && c <= T('z')) || (T('A') <= c && c <= T('Z')); -} - -#endif /* WIN32 */ - -static const XML_Char * -resolveSystemId(const XML_Char *base, const XML_Char *systemId, - XML_Char **toFree) -{ - XML_Char *s; - *toFree = 0; - if (!base - || *systemId == T('/') -#ifdef WIN32 - || *systemId == T('\\') - || (isAsciiLetter(systemId[0]) && systemId[1] == T(':')) -#endif - ) - return systemId; - *toFree = (XML_Char *)malloc((tcslen(base) + tcslen(systemId) + 2) - * sizeof(XML_Char)); - if (!*toFree) - return systemId; - tcscpy(*toFree, base); - s = *toFree; - if (tcsrchr(s, T('/'))) - s = tcsrchr(s, T('/')) + 1; -#ifdef WIN32 - if (tcsrchr(s, T('\\'))) - s = tcsrchr(s, T('\\')) + 1; -#endif - tcscpy(s, systemId); - return *toFree; -} - -static int -externalEntityRefFilemap(XML_Parser parser, - const XML_Char *context, - const XML_Char *base, - const XML_Char *systemId, - const XML_Char *publicId) -{ - int result; - XML_Char *s; - const XML_Char *filename; - XML_Parser entParser = XML_ExternalEntityParserCreate(parser, context, 0); - PROCESS_ARGS args; - args.retPtr = &result; - args.parser = entParser; - filename = resolveSystemId(base, systemId, &s); - XML_SetBase(entParser, filename); - if (!filemap(filename, processFile, &args)) - result = 0; - free(s); - XML_ParserFree(entParser); - return result; -} - -static int -processStream(const XML_Char *filename, XML_Parser parser) -{ - /* passing NULL for filename means read intput from stdin */ - int fd = 0; /* 0 is the fileno for stdin */ - - if (filename != NULL) { - fd = topen(filename, O_BINARY|O_RDONLY); - if (fd < 0) { - tperror(filename); - return 0; - } - } - for (;;) { - int nread; - char *buf = XML_GetBuffer(parser, READ_SIZE); - if (!buf) { - if (filename != NULL) - close(fd); - ftprintf(stderr, T("%s: out of memory\n"), - filename != NULL ? filename : "xmlwf"); - return 0; - } - nread = read(fd, buf, READ_SIZE); - if (nread < 0) { - tperror(filename != NULL ? filename : "STDIN"); - if (filename != NULL) - close(fd); - return 0; - } - if (XML_ParseBuffer(parser, nread, nread == 0) == XML_STATUS_ERROR) { - reportError(parser, filename != NULL ? filename : "STDIN"); - if (filename != NULL) - close(fd); - return 0; - } - if (nread == 0) { - if (filename != NULL) - close(fd); - break;; - } - } - return 1; -} - -static int -externalEntityRefStream(XML_Parser parser, - const XML_Char *context, - const XML_Char *base, - const XML_Char *systemId, - const XML_Char *publicId) -{ - XML_Char *s; - const XML_Char *filename; - int ret; - XML_Parser entParser = XML_ExternalEntityParserCreate(parser, context, 0); - filename = resolveSystemId(base, systemId, &s); - XML_SetBase(entParser, filename); - ret = processStream(filename, entParser); - free(s); - XML_ParserFree(entParser); - return ret; -} - -int -XML_ProcessFile(XML_Parser parser, - const XML_Char *filename, - unsigned flags) -{ - int result; - - if (!XML_SetBase(parser, filename)) { - ftprintf(stderr, T("%s: out of memory"), filename); - exit(1); - } - - if (flags & XML_EXTERNAL_ENTITIES) - XML_SetExternalEntityRefHandler(parser, - (flags & XML_MAP_FILE) - ? externalEntityRefFilemap - : externalEntityRefStream); - if (flags & XML_MAP_FILE) { - PROCESS_ARGS args; - args.retPtr = &result; - args.parser = parser; - if (!filemap(filename, processFile, &args)) - result = 0; - } - else - result = processStream(filename, parser); - return result; -} diff --git a/wxWidgets/src/expat/xmlwf/xmlfile.h b/wxWidgets/src/expat/xmlwf/xmlfile.h deleted file mode 100644 index d053365e34..0000000000 --- a/wxWidgets/src/expat/xmlwf/xmlfile.h +++ /dev/null @@ -1,10 +0,0 @@ -/* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd - See the file COPYING for copying permission. -*/ - -#define XML_MAP_FILE 01 -#define XML_EXTERNAL_ENTITIES 02 - -extern int XML_ProcessFile(XML_Parser parser, - const XML_Char *filename, - unsigned flags); diff --git a/wxWidgets/src/expat/xmlwf/xmlmime.c b/wxWidgets/src/expat/xmlwf/xmlmime.c deleted file mode 100644 index 56a0e7f40e..0000000000 --- a/wxWidgets/src/expat/xmlwf/xmlmime.c +++ /dev/null @@ -1,163 +0,0 @@ -#include -#include "xmlmime.h" - -static const char * -getTok(const char **pp) -{ - /* inComment means one level of nesting; inComment+1 means two levels etc */ - enum { inAtom, inString, init, inComment }; - int state = init; - const char *tokStart = 0; - for (;;) { - switch (**pp) { - case '\0': - if (state == inAtom) - return tokStart; - return 0; - case ' ': - case '\r': - case '\t': - case '\n': - if (state == inAtom) - return tokStart; - break; - case '(': - if (state == inAtom) - return tokStart; - if (state != inString) - state++; - break; - case ')': - if (state > init) - --state; - else if (state != inString) - return 0; - break; - case ';': - case '/': - case '=': - if (state == inAtom) - return tokStart; - if (state == init) - return (*pp)++; - break; - case '\\': - ++*pp; - if (**pp == '\0') - return 0; - break; - case '"': - switch (state) { - case inString: - ++*pp; - return tokStart; - case inAtom: - return tokStart; - case init: - tokStart = *pp; - state = inString; - break; - } - break; - default: - if (state == init) { - tokStart = *pp; - state = inAtom; - } - break; - } - ++*pp; - } - /* not reached */ -} - -/* key must be lowercase ASCII */ - -static int -matchkey(const char *start, const char *end, const char *key) -{ - if (!start) - return 0; - for (; start != end; start++, key++) - if (*start != *key && *start != 'A' + (*key - 'a')) - return 0; - return *key == '\0'; -} - -void -getXMLCharset(const char *buf, char *charset) -{ - const char *next, *p; - - charset[0] = '\0'; - next = buf; - p = getTok(&next); - if (matchkey(p, next, "text")) - strcpy(charset, "us-ascii"); - else if (!matchkey(p, next, "application")) - return; - p = getTok(&next); - if (!p || *p != '/') - return; - p = getTok(&next); -#if 0 - if (!matchkey(p, next, "xml") && charset[0] == '\0') - return; -#endif - p = getTok(&next); - while (p) { - if (*p == ';') { - p = getTok(&next); - if (matchkey(p, next, "charset")) { - p = getTok(&next); - if (p && *p == '=') { - p = getTok(&next); - if (p) { - char *s = charset; - if (*p == '"') { - while (++p != next - 1) { - if (*p == '\\') - ++p; - if (s == charset + CHARSET_MAX - 1) { - charset[0] = '\0'; - break; - } - *s++ = *p; - } - *s++ = '\0'; - } - else { - if (next - p > CHARSET_MAX - 1) - break; - while (p != next) - *s++ = *p++; - *s = 0; - break; - } - } - } - break; - } - } - else - p = getTok(&next); - } -} - -#ifdef TEST - -#include - -int -main(int argc, char *argv[]) -{ - char buf[CHARSET_MAX]; - if (argc <= 1) - return 1; - printf("%s\n", argv[1]); - getXMLCharset(argv[1], buf); - printf("charset=\"%s\"\n", buf); - return 0; -} - -#endif /* TEST */ diff --git a/wxWidgets/src/expat/xmlwf/xmlmime.h b/wxWidgets/src/expat/xmlwf/xmlmime.h deleted file mode 100644 index bf0356df0d..0000000000 --- a/wxWidgets/src/expat/xmlwf/xmlmime.h +++ /dev/null @@ -1,19 +0,0 @@ -#ifdef __cplusplus -extern "C" { -#endif - -/* Registered charset names are at most 40 characters long. */ - -#define CHARSET_MAX 41 - -/* Figure out the charset to use from the ContentType. - buf contains the body of the header field (the part after "Content-Type:"). - charset gets the charset to use. It must be at least CHARSET_MAX chars - long. charset will be empty if the default charset should be used. -*/ - -void getXMLCharset(const char *buf, char *charset); - -#ifdef __cplusplus -} -#endif diff --git a/wxWidgets/src/expat/xmlwf/xmltchar.h b/wxWidgets/src/expat/xmlwf/xmltchar.h deleted file mode 100644 index 1088575512..0000000000 --- a/wxWidgets/src/expat/xmlwf/xmltchar.h +++ /dev/null @@ -1,36 +0,0 @@ -#ifdef XML_UNICODE -#ifndef XML_UNICODE_WCHAR_T -#error xmlwf requires a 16-bit Unicode-compatible wchar_t -#endif -#define T(x) L ## x -#define ftprintf fwprintf -#define tfopen _wfopen -#define fputts fputws -#define puttc putwc -#define tcscmp wcscmp -#define tcscpy wcscpy -#define tcscat wcscat -#define tcschr wcschr -#define tcsrchr wcsrchr -#define tcslen wcslen -#define tperror _wperror -#define topen _wopen -#define tmain wmain -#define tremove _wremove -#else /* not XML_UNICODE */ -#define T(x) x -#define ftprintf fprintf -#define tfopen fopen -#define fputts fputs -#define puttc putc -#define tcscmp strcmp -#define tcscpy strcpy -#define tcscat strcat -#define tcschr strchr -#define tcsrchr strrchr -#define tcslen strlen -#define tperror perror -#define topen open -#define tmain main -#define tremove remove -#endif /* not XML_UNICODE */ diff --git a/wxWidgets/src/expat/xmlwf/xmlurl.h b/wxWidgets/src/expat/xmlwf/xmlurl.h deleted file mode 100644 index d329913ac8..0000000000 --- a/wxWidgets/src/expat/xmlwf/xmlurl.h +++ /dev/null @@ -1,13 +0,0 @@ -#ifdef __cplusplus -extern "C" { -#endif - -int XML_URLInit(); -void XML_URLUninit(); -int XML_ProcessURL(XML_Parser parser, - const XML_Char *url, - unsigned flags); - -#ifdef __cplusplus -} -#endif diff --git a/wxWidgets/src/expat/xmlwf/xmlwf.c b/wxWidgets/src/expat/xmlwf/xmlwf.c deleted file mode 100644 index 8a8056e552..0000000000 --- a/wxWidgets/src/expat/xmlwf/xmlwf.c +++ /dev/null @@ -1,842 +0,0 @@ -/* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd - See the file COPYING for copying permission. -*/ - -#include -#include -#include -#include - -#include "expat.h" -#include "codepage.h" -#include "xmlfile.h" -#include "xmltchar.h" - -#ifdef _MSC_VER -#include -#endif - -/* This ensures proper sorting. */ - -#define NSSEP T('\001') - -static void -characterData(void *userData, const XML_Char *s, int len) -{ - FILE *fp = userData; - for (; len > 0; --len, ++s) { - switch (*s) { - case T('&'): - fputts(T("&"), fp); - break; - case T('<'): - fputts(T("<"), fp); - break; - case T('>'): - fputts(T(">"), fp); - break; -#ifdef W3C14N - case 13: - fputts(T(" "), fp); - break; -#else - case T('"'): - fputts(T("""), fp); - break; - case 9: - case 10: - case 13: - ftprintf(fp, T("&#%d;"), *s); - break; -#endif - default: - puttc(*s, fp); - break; - } - } -} - -static void -attributeValue(FILE *fp, const XML_Char *s) -{ - puttc(T('='), fp); - puttc(T('"'), fp); - for (;;) { - switch (*s) { - case 0: - case NSSEP: - puttc(T('"'), fp); - return; - case T('&'): - fputts(T("&"), fp); - break; - case T('<'): - fputts(T("<"), fp); - break; - case T('"'): - fputts(T("""), fp); - break; -#ifdef W3C14N - case 9: - fputts(T(" "), fp); - break; - case 10: - fputts(T(" "), fp); - break; - case 13: - fputts(T(" "), fp); - break; -#else - case T('>'): - fputts(T(">"), fp); - break; - case 9: - case 10: - case 13: - ftprintf(fp, T("&#%d;"), *s); - break; -#endif - default: - puttc(*s, fp); - break; - } - s++; - } -} - -/* Lexicographically comparing UTF-8 encoded attribute values, -is equivalent to lexicographically comparing based on the character number. */ - -static int -attcmp(const void *att1, const void *att2) -{ - return tcscmp(*(const XML_Char **)att1, *(const XML_Char **)att2); -} - -static void -startElement(void *userData, const XML_Char *name, const XML_Char **atts) -{ - int nAtts; - const XML_Char **p; - FILE *fp = userData; - puttc(T('<'), fp); - fputts(name, fp); - - p = atts; - while (*p) - ++p; - nAtts = (p - atts) >> 1; - if (nAtts > 1) - qsort((void *)atts, nAtts, sizeof(XML_Char *) * 2, attcmp); - while (*atts) { - puttc(T(' '), fp); - fputts(*atts++, fp); - attributeValue(fp, *atts); - atts++; - } - puttc(T('>'), fp); -} - -static void -endElement(void *userData, const XML_Char *name) -{ - FILE *fp = userData; - puttc(T('<'), fp); - puttc(T('/'), fp); - fputts(name, fp); - puttc(T('>'), fp); -} - -static int -nsattcmp(const void *p1, const void *p2) -{ - const XML_Char *att1 = *(const XML_Char **)p1; - const XML_Char *att2 = *(const XML_Char **)p2; - int sep1 = (tcsrchr(att1, NSSEP) != 0); - int sep2 = (tcsrchr(att1, NSSEP) != 0); - if (sep1 != sep2) - return sep1 - sep2; - return tcscmp(att1, att2); -} - -static void -startElementNS(void *userData, const XML_Char *name, const XML_Char **atts) -{ - int nAtts; - int nsi; - const XML_Char **p; - FILE *fp = userData; - const XML_Char *sep; - puttc(T('<'), fp); - - sep = tcsrchr(name, NSSEP); - if (sep) { - fputts(T("n1:"), fp); - fputts(sep + 1, fp); - fputts(T(" xmlns:n1"), fp); - attributeValue(fp, name); - nsi = 2; - } - else { - fputts(name, fp); - nsi = 1; - } - - p = atts; - while (*p) - ++p; - nAtts = (p - atts) >> 1; - if (nAtts > 1) - qsort((void *)atts, nAtts, sizeof(XML_Char *) * 2, nsattcmp); - while (*atts) { - name = *atts++; - sep = tcsrchr(name, NSSEP); - puttc(T(' '), fp); - if (sep) { - ftprintf(fp, T("n%d:"), nsi); - fputts(sep + 1, fp); - } - else - fputts(name, fp); - attributeValue(fp, *atts); - if (sep) { - ftprintf(fp, T(" xmlns:n%d"), nsi++); - attributeValue(fp, name); - } - atts++; - } - puttc(T('>'), fp); -} - -static void -endElementNS(void *userData, const XML_Char *name) -{ - FILE *fp = userData; - const XML_Char *sep; - puttc(T('<'), fp); - puttc(T('/'), fp); - sep = tcsrchr(name, NSSEP); - if (sep) { - fputts(T("n1:"), fp); - fputts(sep + 1, fp); - } - else - fputts(name, fp); - puttc(T('>'), fp); -} - -#ifndef W3C14N - -static void -processingInstruction(void *userData, const XML_Char *target, - const XML_Char *data) -{ - FILE *fp = userData; - puttc(T('<'), fp); - puttc(T('?'), fp); - fputts(target, fp); - puttc(T(' '), fp); - fputts(data, fp); - puttc(T('?'), fp); - puttc(T('>'), fp); -} - -#endif /* not W3C14N */ - -static void -defaultCharacterData(void *userData, const XML_Char *s, int len) -{ - XML_DefaultCurrent((XML_Parser) userData); -} - -static void -defaultStartElement(void *userData, const XML_Char *name, - const XML_Char **atts) -{ - XML_DefaultCurrent((XML_Parser) userData); -} - -static void -defaultEndElement(void *userData, const XML_Char *name) -{ - XML_DefaultCurrent((XML_Parser) userData); -} - -static void -defaultProcessingInstruction(void *userData, const XML_Char *target, - const XML_Char *data) -{ - XML_DefaultCurrent((XML_Parser) userData); -} - -static void -nopCharacterData(void *userData, const XML_Char *s, int len) -{ -} - -static void -nopStartElement(void *userData, const XML_Char *name, const XML_Char **atts) -{ -} - -static void -nopEndElement(void *userData, const XML_Char *name) -{ -} - -static void -nopProcessingInstruction(void *userData, const XML_Char *target, - const XML_Char *data) -{ -} - -static void -markup(void *userData, const XML_Char *s, int len) -{ - FILE *fp = XML_GetUserData((XML_Parser) userData); - for (; len > 0; --len, ++s) - puttc(*s, fp); -} - -static void -metaLocation(XML_Parser parser) -{ - const XML_Char *uri = XML_GetBase(parser); - if (uri) - ftprintf(XML_GetUserData(parser), T(" uri=\"%s\""), uri); - ftprintf(XML_GetUserData(parser), - T(" byte=\"%ld\" nbytes=\"%d\" line=\"%d\" col=\"%d\""), - XML_GetCurrentByteIndex(parser), - XML_GetCurrentByteCount(parser), - XML_GetCurrentLineNumber(parser), - XML_GetCurrentColumnNumber(parser)); -} - -static void -metaStartDocument(void *userData) -{ - fputts(T("\n"), XML_GetUserData((XML_Parser) userData)); -} - -static void -metaEndDocument(void *userData) -{ - fputts(T("\n"), XML_GetUserData((XML_Parser) userData)); -} - -static void -metaStartElement(void *userData, const XML_Char *name, - const XML_Char **atts) -{ - XML_Parser parser = (XML_Parser) userData; - FILE *fp = XML_GetUserData(parser); - const XML_Char **specifiedAttsEnd - = atts + XML_GetSpecifiedAttributeCount(parser); - const XML_Char **idAttPtr; - int idAttIndex = XML_GetIdAttributeIndex(parser); - if (idAttIndex < 0) - idAttPtr = 0; - else - idAttPtr = atts + idAttIndex; - - ftprintf(fp, T("\n"), fp); - do { - ftprintf(fp, T("= specifiedAttsEnd) - fputts(T("\" defaulted=\"yes\"/>\n"), fp); - else if (atts == idAttPtr) - fputts(T("\" id=\"yes\"/>\n"), fp); - else - fputts(T("\"/>\n"), fp); - } while (*(atts += 2)); - fputts(T("\n"), fp); - } - else - fputts(T("/>\n"), fp); -} - -static void -metaEndElement(void *userData, const XML_Char *name) -{ - XML_Parser parser = (XML_Parser) userData; - FILE *fp = XML_GetUserData(parser); - ftprintf(fp, T("\n"), fp); -} - -static void -metaProcessingInstruction(void *userData, const XML_Char *target, - const XML_Char *data) -{ - XML_Parser parser = (XML_Parser) userData; - FILE *fp = XML_GetUserData(parser); - ftprintf(fp, T("\n"), fp); -} - -static void -metaComment(void *userData, const XML_Char *data) -{ - XML_Parser parser = (XML_Parser) userData; - FILE *fp = XML_GetUserData(parser); - fputts(T("\n"), fp); -} - -static void -metaStartCdataSection(void *userData) -{ - XML_Parser parser = (XML_Parser) userData; - FILE *fp = XML_GetUserData(parser); - fputts(T("\n"), fp); -} - -static void -metaEndCdataSection(void *userData) -{ - XML_Parser parser = (XML_Parser) userData; - FILE *fp = XML_GetUserData(parser); - fputts(T("\n"), fp); -} - -static void -metaCharacterData(void *userData, const XML_Char *s, int len) -{ - XML_Parser parser = (XML_Parser) userData; - FILE *fp = XML_GetUserData(parser); - fputts(T("\n"), fp); -} - -static void -metaStartDoctypeDecl(void *userData, - const XML_Char *doctypeName, - const XML_Char *sysid, - const XML_Char *pubid, - int has_internal_subset) -{ - XML_Parser parser = (XML_Parser) userData; - FILE *fp = XML_GetUserData(parser); - ftprintf(fp, T("\n"), fp); -} - -static void -metaEndDoctypeDecl(void *userData) -{ - XML_Parser parser = (XML_Parser) userData; - FILE *fp = XML_GetUserData(parser); - fputts(T("\n"), fp); -} - -static void -metaNotationDecl(void *userData, - const XML_Char *notationName, - const XML_Char *base, - const XML_Char *systemId, - const XML_Char *publicId) -{ - XML_Parser parser = (XML_Parser) userData; - FILE *fp = XML_GetUserData(parser); - ftprintf(fp, T("\n"), fp); -} - - -static void -metaEntityDecl(void *userData, - const XML_Char *entityName, - int is_param, - const XML_Char *value, - int value_length, - const XML_Char *base, - const XML_Char *systemId, - const XML_Char *publicId, - const XML_Char *notationName) -{ - XML_Parser parser = (XML_Parser) userData; - FILE *fp = XML_GetUserData(parser); - - if (value) { - ftprintf(fp, T("'), fp); - characterData(fp, value, value_length); - fputts(T("\n"), fp); - } - else if (notationName) { - ftprintf(fp, T("\n"), fp); - } - else { - ftprintf(fp, T("\n"), fp); - } -} - -static void -metaStartNamespaceDecl(void *userData, - const XML_Char *prefix, - const XML_Char *uri) -{ - XML_Parser parser = (XML_Parser) userData; - FILE *fp = XML_GetUserData(parser); - fputts(T("\n"), fp); - } - else - fputts(T("/>\n"), fp); -} - -static void -metaEndNamespaceDecl(void *userData, const XML_Char *prefix) -{ - XML_Parser parser = (XML_Parser) userData; - FILE *fp = XML_GetUserData(parser); - if (!prefix) - fputts(T("\n"), fp); - else - ftprintf(fp, T("\n"), prefix); -} - -static int -unknownEncodingConvert(void *data, const char *p) -{ - return codepageConvert(*(int *)data, p); -} - -static int -unknownEncoding(void *userData, const XML_Char *name, XML_Encoding *info) -{ - int cp; - static const XML_Char prefixL[] = T("windows-"); - static const XML_Char prefixU[] = T("WINDOWS-"); - int i; - - for (i = 0; prefixU[i]; i++) - if (name[i] != prefixU[i] && name[i] != prefixL[i]) - return 0; - - cp = 0; - for (; name[i]; i++) { - static const XML_Char digits[] = T("0123456789"); - const XML_Char *s = tcschr(digits, name[i]); - if (!s) - return 0; - cp *= 10; - cp += s - digits; - if (cp >= 0x10000) - return 0; - } - if (!codepageMap(cp, info->map)) - return 0; - info->convert = unknownEncodingConvert; - /* We could just cast the code page integer to a void *, - and avoid the use of release. */ - info->release = free; - info->data = malloc(sizeof(int)); - if (!info->data) - return 0; - *(int *)info->data = cp; - return 1; -} - -static int -notStandalone(void *userData) -{ - return 0; -} - -static void -showVersion(XML_Char *prog) -{ - XML_Char *s = prog; - XML_Char ch; - const XML_Feature *features = XML_GetFeatureList(); - while ((ch = *s) != 0) { - if (ch == '/' -#ifdef WIN32 - || ch == '\\' -#endif - ) - prog = s + 1; - ++s; - } - ftprintf(stdout, T("%s using %s\n"), prog, XML_ExpatVersion()); - if (features != NULL && features[0].feature != XML_FEATURE_END) { - int i = 1; - ftprintf(stdout, T("%s"), features[0].name); - if (features[0].value) - ftprintf(stdout, T("=%ld"), features[0].value); - while (features[i].feature != XML_FEATURE_END) { - ftprintf(stdout, T(", %s"), features[i].name); - if (features[i].value) - ftprintf(stdout, T("=%ld"), features[i].value); - ++i; - } - ftprintf(stdout, T("\n")); - } -} - -static void -usage(const XML_Char *prog, int rc) -{ - ftprintf(stderr, - T("usage: %s [-n] [-p] [-r] [-s] [-w] [-x] [-d output-dir] " - "[-e encoding] file ...\n"), prog); - exit(rc); -} - -int -tmain(int argc, XML_Char **argv) -{ - int i, j; - const XML_Char *outputDir = NULL; - const XML_Char *encoding = NULL; - unsigned processFlags = XML_MAP_FILE; - int windowsCodePages = 0; - int outputType = 0; - int useNamespaces = 0; - int requireStandalone = 0; - int paramEntityParsing = XML_PARAM_ENTITY_PARSING_NEVER; - int useStdin = 0; - -#ifdef _MSC_VER - _CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF|_CRTDBG_LEAK_CHECK_DF); -#endif - - i = 1; - j = 0; - while (i < argc) { - if (j == 0) { - if (argv[i][0] != T('-')) - break; - if (argv[i][1] == T('-') && argv[i][2] == T('\0')) { - i++; - break; - } - j++; - } - switch (argv[i][j]) { - case T('r'): - processFlags &= ~XML_MAP_FILE; - j++; - break; - case T('s'): - requireStandalone = 1; - j++; - break; - case T('n'): - useNamespaces = 1; - j++; - break; - case T('p'): - paramEntityParsing = XML_PARAM_ENTITY_PARSING_ALWAYS; - /* fall through */ - case T('x'): - processFlags |= XML_EXTERNAL_ENTITIES; - j++; - break; - case T('w'): - windowsCodePages = 1; - j++; - break; - case T('m'): - outputType = 'm'; - j++; - break; - case T('c'): - outputType = 'c'; - useNamespaces = 0; - j++; - break; - case T('t'): - outputType = 't'; - j++; - break; - case T('d'): - if (argv[i][j + 1] == T('\0')) { - if (++i == argc) - usage(argv[0], 2); - outputDir = argv[i]; - } - else - outputDir = argv[i] + j + 1; - i++; - j = 0; - break; - case T('e'): - if (argv[i][j + 1] == T('\0')) { - if (++i == argc) - usage(argv[0], 2); - encoding = argv[i]; - } - else - encoding = argv[i] + j + 1; - i++; - j = 0; - break; - case T('h'): - usage(argv[0], 0); - return 0; - case T('v'): - showVersion(argv[0]); - return 0; - case T('\0'): - if (j > 1) { - i++; - j = 0; - break; - } - /* fall through */ - default: - usage(argv[0], 2); - } - } - if (i == argc) { - useStdin = 1; - processFlags &= ~XML_MAP_FILE; - i--; - } - for (; i < argc; i++) { - FILE *fp = 0; - XML_Char *outName = 0; - int result; - XML_Parser parser; - if (useNamespaces) - parser = XML_ParserCreateNS(encoding, NSSEP); - else - parser = XML_ParserCreate(encoding); - if (requireStandalone) - XML_SetNotStandaloneHandler(parser, notStandalone); - XML_SetParamEntityParsing(parser, paramEntityParsing); - if (outputType == 't') { - /* This is for doing timings; this gives a more realistic estimate of - the parsing time. */ - outputDir = 0; - XML_SetElementHandler(parser, nopStartElement, nopEndElement); - XML_SetCharacterDataHandler(parser, nopCharacterData); - XML_SetProcessingInstructionHandler(parser, nopProcessingInstruction); - } - else if (outputDir) { - const XML_Char *file = useStdin ? T("STDIN") : argv[i]; - if (tcsrchr(file, T('/'))) - file = tcsrchr(file, T('/')) + 1; -#ifdef WIN32 - if (tcsrchr(file, T('\\'))) - file = tcsrchr(file, T('\\')) + 1; -#endif - outName = malloc((tcslen(outputDir) + tcslen(file) + 2) - * sizeof(XML_Char)); - tcscpy(outName, outputDir); - tcscat(outName, T("/")); - tcscat(outName, file); - fp = tfopen(outName, T("wb")); - if (!fp) { - tperror(outName); - exit(1); - } - setvbuf(fp, NULL, _IOFBF, 16384); -#ifdef XML_UNICODE - puttc(0xFEFF, fp); -#endif - XML_SetUserData(parser, fp); - switch (outputType) { - case 'm': - XML_UseParserAsHandlerArg(parser); - XML_SetElementHandler(parser, metaStartElement, metaEndElement); - XML_SetProcessingInstructionHandler(parser, metaProcessingInstruction); - XML_SetCommentHandler(parser, metaComment); - XML_SetCdataSectionHandler(parser, metaStartCdataSection, - metaEndCdataSection); - XML_SetCharacterDataHandler(parser, metaCharacterData); - XML_SetDoctypeDeclHandler(parser, metaStartDoctypeDecl, - metaEndDoctypeDecl); - XML_SetEntityDeclHandler(parser, metaEntityDecl); - XML_SetNotationDeclHandler(parser, metaNotationDecl); - XML_SetNamespaceDeclHandler(parser, metaStartNamespaceDecl, - metaEndNamespaceDecl); - metaStartDocument(parser); - break; - case 'c': - XML_UseParserAsHandlerArg(parser); - XML_SetDefaultHandler(parser, markup); - XML_SetElementHandler(parser, defaultStartElement, defaultEndElement); - XML_SetCharacterDataHandler(parser, defaultCharacterData); - XML_SetProcessingInstructionHandler(parser, - defaultProcessingInstruction); - break; - default: - if (useNamespaces) - XML_SetElementHandler(parser, startElementNS, endElementNS); - else - XML_SetElementHandler(parser, startElement, endElement); - XML_SetCharacterDataHandler(parser, characterData); -#ifndef W3C14N - XML_SetProcessingInstructionHandler(parser, processingInstruction); -#endif /* not W3C14N */ - break; - } - } - if (windowsCodePages) - XML_SetUnknownEncodingHandler(parser, unknownEncoding, 0); - result = XML_ProcessFile(parser, useStdin ? NULL : argv[i], processFlags); - if (outputDir) { - if (outputType == 'm') - metaEndDocument(parser); - fclose(fp); - if (!result) - tremove(outName); - free(outName); - } - XML_ParserFree(parser); - } - return 0; -} diff --git a/wxWidgets/src/expat/xmlwf/xmlwin32url.cxx b/wxWidgets/src/expat/xmlwf/xmlwin32url.cxx deleted file mode 100644 index bbfcce22c9..0000000000 --- a/wxWidgets/src/expat/xmlwf/xmlwin32url.cxx +++ /dev/null @@ -1,395 +0,0 @@ -#include "expat.h" -#ifdef XML_UNICODE -#define UNICODE -#endif -#include -#include -#include -#include -#include -#include "xmlurl.h" -#include "xmlmime.h" - -static int -processURL(XML_Parser parser, IMoniker *baseMoniker, const XML_Char *url); - -typedef void (*StopHandler)(void *, HRESULT); - -class Callback : public IBindStatusCallback { -public: - // IUnknown methods - STDMETHODIMP QueryInterface(REFIID,void **); - STDMETHODIMP_(ULONG) AddRef(); - STDMETHODIMP_(ULONG) Release(); - // IBindStatusCallback methods - STDMETHODIMP OnStartBinding(DWORD, IBinding *); - STDMETHODIMP GetPriority(LONG *); - STDMETHODIMP OnLowResource(DWORD); - STDMETHODIMP OnProgress(ULONG, ULONG, ULONG, LPCWSTR); - STDMETHODIMP OnStopBinding(HRESULT, LPCWSTR); - STDMETHODIMP GetBindInfo(DWORD *, BINDINFO *); - STDMETHODIMP OnDataAvailable(DWORD, DWORD, FORMATETC *, STGMEDIUM *); - STDMETHODIMP OnObjectAvailable(REFIID, IUnknown *); - Callback(XML_Parser, IMoniker *, StopHandler, void *); - ~Callback(); - int externalEntityRef(const XML_Char *context, - const XML_Char *systemId, const XML_Char *publicId); -private: - XML_Parser parser_; - IMoniker *baseMoniker_; - DWORD totalRead_; - ULONG ref_; - IBinding *pBinding_; - StopHandler stopHandler_; - void *stopArg_; -}; - -STDMETHODIMP_(ULONG) -Callback::AddRef() -{ - return ref_++; -} - -STDMETHODIMP_(ULONG) -Callback::Release() -{ - if (--ref_ == 0) { - delete this; - return 0; - } - return ref_; -} - -STDMETHODIMP -Callback::QueryInterface(REFIID riid, void** ppv) -{ - if (IsEqualGUID(riid, IID_IUnknown)) - *ppv = (IUnknown *)this; - else if (IsEqualGUID(riid, IID_IBindStatusCallback)) - *ppv = (IBindStatusCallback *)this; - else - return E_NOINTERFACE; - ((LPUNKNOWN)*ppv)->AddRef(); - return S_OK; -} - -STDMETHODIMP -Callback::OnStartBinding(DWORD, IBinding* pBinding) -{ - pBinding_ = pBinding; - pBinding->AddRef(); - return S_OK; -} - -STDMETHODIMP -Callback::GetPriority(LONG *) -{ - return E_NOTIMPL; -} - -STDMETHODIMP -Callback::OnLowResource(DWORD) -{ - return E_NOTIMPL; -} - -STDMETHODIMP -Callback::OnProgress(ULONG, ULONG, ULONG, LPCWSTR) -{ - return S_OK; -} - -STDMETHODIMP -Callback::OnStopBinding(HRESULT hr, LPCWSTR szError) -{ - if (pBinding_) { - pBinding_->Release(); - pBinding_ = 0; - } - if (baseMoniker_) { - baseMoniker_->Release(); - baseMoniker_ = 0; - } - stopHandler_(stopArg_, hr); - return S_OK; -} - -STDMETHODIMP -Callback::GetBindInfo(DWORD* pgrfBINDF, BINDINFO* pbindinfo) -{ - *pgrfBINDF = BINDF_ASYNCHRONOUS; - return S_OK; -} - -static void -reportError(XML_Parser parser) -{ - int code = XML_GetErrorCode(parser); - const XML_Char *message = XML_ErrorString(code); - if (message) - _ftprintf(stderr, _T("%s:%d:%ld: %s\n"), - XML_GetBase(parser), - XML_GetErrorLineNumber(parser), - XML_GetErrorColumnNumber(parser), - message); - else - _ftprintf(stderr, _T("%s: (unknown message %d)\n"), - XML_GetBase(parser), code); -} - -STDMETHODIMP -Callback::OnDataAvailable(DWORD grfBSCF, - DWORD dwSize, - FORMATETC *pfmtetc, - STGMEDIUM* pstgmed) -{ - if (grfBSCF & BSCF_FIRSTDATANOTIFICATION) { - IWinInetHttpInfo *hp; - HRESULT hr = pBinding_->QueryInterface(IID_IWinInetHttpInfo, - (void **)&hp); - if (SUCCEEDED(hr)) { - char contentType[1024]; - DWORD bufSize = sizeof(contentType); - DWORD flags = 0; - contentType[0] = 0; - hr = hp->QueryInfo(HTTP_QUERY_CONTENT_TYPE, contentType, - &bufSize, 0, NULL); - if (SUCCEEDED(hr)) { - char charset[CHARSET_MAX]; - getXMLCharset(contentType, charset); - if (charset[0]) { -#ifdef XML_UNICODE - XML_Char wcharset[CHARSET_MAX]; - XML_Char *p1 = wcharset; - const char *p2 = charset; - while ((*p1++ = (unsigned char)*p2++) != 0) - ; - XML_SetEncoding(parser_, wcharset); -#else - XML_SetEncoding(parser_, charset); -#endif - } - } - hp->Release(); - } - } - if (!parser_) - return E_ABORT; - if (pstgmed->tymed == TYMED_ISTREAM) { - while (totalRead_ < dwSize) { -#define READ_MAX (64*1024) - DWORD nToRead = dwSize - totalRead_; - if (nToRead > READ_MAX) - nToRead = READ_MAX; - void *buf = XML_GetBuffer(parser_, nToRead); - if (!buf) { - _ftprintf(stderr, _T("out of memory\n")); - return E_ABORT; - } - DWORD nRead; - HRESULT hr = pstgmed->pstm->Read(buf, nToRead, &nRead); - if (SUCCEEDED(hr)) { - totalRead_ += nRead; - if (!XML_ParseBuffer(parser_, - nRead, - (grfBSCF & BSCF_LASTDATANOTIFICATION) != 0 - && totalRead_ == dwSize)) { - reportError(parser_); - return E_ABORT; - } - } - } - } - return S_OK; -} - -STDMETHODIMP -Callback::OnObjectAvailable(REFIID, IUnknown *) -{ - return S_OK; -} - -int -Callback::externalEntityRef(const XML_Char *context, - const XML_Char *systemId, - const XML_Char *publicId) -{ - XML_Parser entParser = XML_ExternalEntityParserCreate(parser_, context, 0); - XML_SetBase(entParser, systemId); - int ret = processURL(entParser, baseMoniker_, systemId); - XML_ParserFree(entParser); - return ret; -} - -Callback::Callback(XML_Parser parser, IMoniker *baseMoniker, - StopHandler stopHandler, void *stopArg) -: parser_(parser), - baseMoniker_(baseMoniker), - ref_(0), - pBinding_(0), - totalRead_(0), - stopHandler_(stopHandler), - stopArg_(stopArg) -{ - if (baseMoniker_) - baseMoniker_->AddRef(); -} - -Callback::~Callback() -{ - if (pBinding_) - pBinding_->Release(); - if (baseMoniker_) - baseMoniker_->Release(); -} - -static int -externalEntityRef(void *arg, - const XML_Char *context, - const XML_Char *base, - const XML_Char *systemId, - const XML_Char *publicId) -{ - return ((Callback *)arg)->externalEntityRef(context, systemId, publicId); -} - - -static HRESULT -openStream(XML_Parser parser, - IMoniker *baseMoniker, - const XML_Char *uri, - StopHandler stopHandler, void *stopArg) -{ - if (!XML_SetBase(parser, uri)) - return E_OUTOFMEMORY; - HRESULT hr; - IMoniker *m; -#ifdef XML_UNICODE - hr = CreateURLMoniker(0, uri, &m); -#else - LPWSTR uriw = new wchar_t[strlen(uri) + 1]; - for (int i = 0;; i++) { - uriw[i] = uri[i]; - if (uriw[i] == 0) - break; - } - hr = CreateURLMoniker(baseMoniker, uriw, &m); - delete [] uriw; -#endif - if (FAILED(hr)) - return hr; - IBindStatusCallback *cb = new Callback(parser, m, stopHandler, stopArg); - XML_SetExternalEntityRefHandler(parser, externalEntityRef); - XML_SetExternalEntityRefHandlerArg(parser, cb); - cb->AddRef(); - IBindCtx *b; - if (FAILED(hr = CreateAsyncBindCtx(0, cb, 0, &b))) { - cb->Release(); - m->Release(); - return hr; - } - cb->Release(); - IStream *pStream; - hr = m->BindToStorage(b, 0, IID_IStream, (void **)&pStream); - if (SUCCEEDED(hr)) { - if (pStream) - pStream->Release(); - } - if (hr == MK_S_ASYNCHRONOUS) - hr = S_OK; - m->Release(); - b->Release(); - return hr; -} - -struct QuitInfo { - const XML_Char *url; - HRESULT hr; - int stop; -}; - -static void -winPerror(const XML_Char *url, HRESULT hr) -{ - LPVOID buf; - if (FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER - | FORMAT_MESSAGE_FROM_HMODULE, - GetModuleHandleA("urlmon.dll"), - hr, - MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), - (LPTSTR) &buf, - 0, - NULL) - || FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER - | FORMAT_MESSAGE_FROM_SYSTEM, - 0, - hr, - MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), - (LPTSTR) &buf, - 0, - NULL)) { - /* The system error messages seem to end with a newline. */ - _ftprintf(stderr, _T("%s: %s"), url, buf); - fflush(stderr); - LocalFree(buf); - } - else - _ftprintf(stderr, _T("%s: error %x\n"), url, hr); -} - -static void -threadQuit(void *p, HRESULT hr) -{ - QuitInfo *qi = (QuitInfo *)p; - qi->hr = hr; - qi->stop = 1; -} - -extern "C" -int -XML_URLInit(void) -{ - return SUCCEEDED(CoInitialize(0)); -} - -extern "C" -void -XML_URLUninit(void) -{ - CoUninitialize(); -} - -static int -processURL(XML_Parser parser, IMoniker *baseMoniker, - const XML_Char *url) -{ - QuitInfo qi; - qi.stop = 0; - qi.url = url; - - XML_SetBase(parser, url); - HRESULT hr = openStream(parser, baseMoniker, url, threadQuit, &qi); - if (FAILED(hr)) { - winPerror(url, hr); - return 0; - } - else if (FAILED(qi.hr)) { - winPerror(url, qi.hr); - return 0; - } - MSG msg; - while (!qi.stop && GetMessage (&msg, NULL, 0, 0)) { - TranslateMessage (&msg); - DispatchMessage (&msg); - } - return 1; -} - -extern "C" -int -XML_ProcessURL(XML_Parser parser, - const XML_Char *url, - unsigned flags) -{ - return processURL(parser, 0, url); -} diff --git a/wxWidgets/src/generic/aboutdlgg.cpp b/wxWidgets/src/generic/aboutdlgg.cpp deleted file mode 100644 index e99bb39198..0000000000 --- a/wxWidgets/src/generic/aboutdlgg.cpp +++ /dev/null @@ -1,258 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: src/generic/aboutdlgg.cpp -// Purpose: implements wxGenericAboutBox() function -// Author: Vadim Zeitlin -// Created: 2006-10-08 -// RCS-ID: $Id: aboutdlgg.cpp 58761 2009-02-08 14:55:44Z VZ $ -// Copyright: (c) 2006 Vadim Zeitlin -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -// for compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_ABOUTDLG - -#ifndef WX_PRECOMP - #include "wx/sizer.h" - #include "wx/statbmp.h" - #include "wx/stattext.h" - #include "wx/button.h" -#endif //WX_PRECOMP - -#include "wx/aboutdlg.h" -#include "wx/generic/aboutdlgg.h" - -#include "wx/hyperlink.h" -#include "wx/collpane.h" - -// ============================================================================ -// implementation -// ============================================================================ - -// helper function: returns all array elements in a single comma-separated and -// newline-terminated string -static wxString AllAsString(const wxArrayString& a) -{ - wxString s; - const size_t count = a.size(); - s.reserve(20*count); - for ( size_t n = 0; n < count; n++ ) - { - s << a[n] << (n == count - 1 ? _T("\n") : _T(", ")); - } - - return s; -} - -// ---------------------------------------------------------------------------- -// wxAboutDialogInfo -// ---------------------------------------------------------------------------- - -wxString wxAboutDialogInfo::GetDescriptionAndCredits() const -{ - wxString s = GetDescription(); - if ( !s.empty() ) - s << _T('\n'); - - if ( HasDevelopers() ) - s << _T('\n') << _("Developed by ") << AllAsString(GetDevelopers()); - - if ( HasDocWriters() ) - s << _T('\n') << _("Documentation by ") << AllAsString(GetDocWriters()); - - if ( HasArtists() ) - s << _T('\n') << _("Graphics art by ") << AllAsString(GetArtists()); - - if ( HasTranslators() ) - s << _T('\n') << _("Translations by ") << AllAsString(GetTranslators()); - - return s; -} - -wxIcon wxAboutDialogInfo::GetIcon() const -{ - wxIcon icon = m_icon; - if ( !icon.Ok() && wxTheApp ) - { - const wxTopLevelWindow * const - tlw = wxDynamicCast(wxTheApp->GetTopWindow(), wxTopLevelWindow); - if ( tlw ) - icon = tlw->GetIcon(); - } - - return icon; -} - -wxString wxAboutDialogInfo::GetCopyrightToDisplay() const -{ - wxString ret = m_copyright; - -#if wxUSE_UNICODE - const wxString copyrightSign = wxString::FromUTF8("\xc2\xa9"); - ret.Replace(_T("(c)"), copyrightSign); - ret.Replace(_T("(C)"), copyrightSign); -#endif // wxUSE_UNICODE - - return ret; -} - -// ---------------------------------------------------------------------------- -// wxGenericAboutDialog -// ---------------------------------------------------------------------------- - -bool wxGenericAboutDialog::Create(const wxAboutDialogInfo& info) -{ - // TODO: should we use main frame as parent by default here? - if ( !wxDialog::Create(NULL, wxID_ANY, _("About ") + info.GetName(), - wxDefaultPosition, wxDefaultSize, wxRESIZE_BORDER|wxDEFAULT_DIALOG_STYLE) ) - return false; - - m_sizerText = new wxBoxSizer(wxVERTICAL); - wxString nameAndVersion = info.GetName(); - if ( info.HasVersion() ) - nameAndVersion << _T(' ') << info.GetVersion(); - wxStaticText *label = new wxStaticText(this, wxID_ANY, nameAndVersion); - wxFont fontBig(*wxNORMAL_FONT); - fontBig.SetPointSize(fontBig.GetPointSize() + 2); - fontBig.SetWeight(wxFONTWEIGHT_BOLD); - label->SetFont(fontBig); - - m_sizerText->Add(label, wxSizerFlags().Centre().Border()); - m_sizerText->AddSpacer(5); - - AddText(info.GetCopyrightToDisplay()); - AddText(info.GetDescription()); - - if ( info.HasWebSite() ) - { -#if wxUSE_HYPERLINKCTRL - AddControl(new wxHyperlinkCtrl(this, wxID_ANY, - info.GetWebSiteDescription(), - info.GetWebSiteURL())); -#else - AddText(info.GetWebSiteURL()); -#endif // wxUSE_HYPERLINKCTRL/!wxUSE_HYPERLINKCTRL - } - -#if wxUSE_COLLPANE - if ( info.HasLicence() ) - AddCollapsiblePane(_("License"), info.GetLicence()); - - if ( info.HasDevelopers() ) - AddCollapsiblePane(_("Developers"), - AllAsString(info.GetDevelopers())); - - if ( info.HasDocWriters() ) - AddCollapsiblePane(_("Documentation writers"), - AllAsString(info.GetDocWriters())); - - if ( info.HasArtists() ) - AddCollapsiblePane(_("Artists"), - AllAsString(info.GetArtists())); - - if ( info.HasTranslators() ) - AddCollapsiblePane(_("Translators"), - AllAsString(info.GetTranslators())); -#endif // wxUSE_COLLPANE - - DoAddCustomControls(); - - - wxSizer *sizerIconAndText = new wxBoxSizer(wxHORIZONTAL); -#if wxUSE_STATBMP - wxIcon icon = info.GetIcon(); - if ( icon.Ok() ) - { - sizerIconAndText->Add(new wxStaticBitmap(this, wxID_ANY, icon), - wxSizerFlags().Border(wxRIGHT)); - } -#endif // wxUSE_STATBMP - sizerIconAndText->Add(m_sizerText, wxSizerFlags(1).Expand()); - - wxSizer *sizerTop = new wxBoxSizer(wxVERTICAL); - sizerTop->Add(sizerIconAndText, wxSizerFlags(1).Expand().Border()); - - wxSizer *sizerBtns = CreateButtonSizer(wxOK); - if ( sizerBtns ) - { - sizerTop->Add(sizerBtns, wxSizerFlags().Expand().Border()); - } - - SetSizerAndFit(sizerTop); - - CentreOnScreen(); - - return true; -} - -void wxGenericAboutDialog::AddControl(wxWindow *win, const wxSizerFlags& flags) -{ - wxCHECK_RET( m_sizerText, _T("can only be called after Create()") ); - wxASSERT_MSG( win, _T("can't add NULL window to about dialog") ); - - m_sizerText->Add(win, flags); -} - -void wxGenericAboutDialog::AddControl(wxWindow *win) -{ - AddControl(win, wxSizerFlags().Border(wxDOWN).Centre()); -} - -void wxGenericAboutDialog::AddText(const wxString& text) -{ - if ( !text.empty() ) - AddControl(new wxStaticText(this, wxID_ANY, text)); -} - -void wxGenericAboutDialog::AddCollapsiblePane(const wxString& title, - const wxString& text) -{ - wxCollapsiblePane *pane = new wxCollapsiblePane(this, wxID_ANY, title); - wxStaticText *txt = new wxStaticText(pane->GetPane(), wxID_ANY, text, - wxDefaultPosition, wxDefaultSize, - wxALIGN_CENTRE); - - // don't make the text unreasonably wide - static const int maxWidth = wxGetDisplaySize().x/3; - txt->Wrap(maxWidth); - - // NB: all the wxCollapsiblePanes must be added with a null proportion value - m_sizerText->Add(pane, wxSizerFlags(0).Expand().Border(wxBOTTOM)); -} - -// ---------------------------------------------------------------------------- -// public functions -// ---------------------------------------------------------------------------- - -void wxGenericAboutBox(const wxAboutDialogInfo& info) -{ - wxGenericAboutDialog dlg(info); - dlg.ShowModal(); -} - -// currently wxAboutBox is implemented natively only under these platforms, for -// the others we provide a generic fallback here -#if !defined(__WXMSW__) && !defined(__WXMAC__) && !defined(__WXGTK26__) - -void wxAboutBox(const wxAboutDialogInfo& info) -{ - wxGenericAboutBox(info); -} - -#endif // platforms without native about dialog - - -#endif // wxUSE_ABOUTDLG diff --git a/wxWidgets/src/generic/accel.cpp b/wxWidgets/src/generic/accel.cpp deleted file mode 100644 index 4153453444..0000000000 --- a/wxWidgets/src/generic/accel.cpp +++ /dev/null @@ -1,220 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: src/generic/accel.cpp -// Purpose: generic implementation of wxAcceleratorTable class -// Author: Robert Roebling -// Modified: VZ pn 31.05.01: use typed lists, Unicode cleanup, Add/Remove -// Id: $Id: accel.cpp 41751 2006-10-08 21:56:55Z VZ $ -// Copyright: (c) 1998 Robert Roebling -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_ACCEL - -#ifndef WX_PRECOMP - #include "wx/list.h" - #include "wx/event.h" -#endif // WX_PRECOMP - -#include "wx/accel.h" - -#include - -// ---------------------------------------------------------------------------- -// 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 wxAccelRefData : public wxObjectRefData -{ -public: - wxAccelRefData() - { - } - - wxAccelRefData(const wxAccelRefData& data) - : wxObjectRefData() - { - m_accels = data.m_accels; - } - - virtual ~wxAccelRefData() - { - WX_CLEAR_LIST(wxAccelList, m_accels); - } - - wxAccelList m_accels; -}; - -// macro which can be used to access wxAccelRefData from wxAcceleratorTable -#define M_ACCELDATA ((wxAccelRefData *)m_refData) - - -// ============================================================================ -// implementation -// ============================================================================ - -// ---------------------------------------------------------------------------- -// wxAcceleratorTable ctors -// ---------------------------------------------------------------------------- - -IMPLEMENT_DYNAMIC_CLASS(wxAcceleratorTable, wxObject) - -wxAcceleratorTable::wxAcceleratorTable() -{ -} - -wxAcceleratorTable::wxAcceleratorTable(int n, const wxAcceleratorEntry entries[]) -{ - m_refData = new wxAccelRefData; - - for ( int i = 0; i < n; i++ ) - { - const wxAcceleratorEntry& entry = entries[i]; - - int keycode = entry.GetKeyCode(); - if ( isascii(keycode) ) - keycode = toupper(keycode); - - M_ACCELDATA->m_accels.Append(new wxAcceleratorEntry(entry.GetFlags(), - keycode, - entry.GetCommand())); - } -} - -wxAcceleratorTable::~wxAcceleratorTable() -{ -} - -bool wxAcceleratorTable::IsOk() const -{ - return m_refData != NULL; -} - -// ---------------------------------------------------------------------------- -// wxAcceleratorTable updating -// ---------------------------------------------------------------------------- - -void wxAcceleratorTable::Add(const wxAcceleratorEntry& entry) -{ - AllocExclusive(); - - if ( !m_refData ) - { - m_refData = new wxAccelRefData; - } - - M_ACCELDATA->m_accels.Append(new wxAcceleratorEntry(entry)); -} - -void wxAcceleratorTable::Remove(const wxAcceleratorEntry& entry) -{ - AllocExclusive(); - - wxAccelList::compatibility_iterator node = M_ACCELDATA->m_accels.GetFirst(); - while ( node ) - { - const wxAcceleratorEntry *entryCur = node->GetData(); - - // given entry contains only the information of the accelerator key - // because it was set that way during creation so do not use the - // comparison operator which also checks the command field - if ((entryCur->GetKeyCode() == entry.GetKeyCode()) && - (entryCur->GetFlags() == entry.GetFlags())) - { - delete node->GetData(); - M_ACCELDATA->m_accels.Erase(node); - - return; - } - - node = node->GetNext(); - } - - wxFAIL_MSG(_T("deleting inexistent accel from wxAcceleratorTable")); -} - -// ---------------------------------------------------------------------------- -// wxAcceleratorTable: find a command for the given key press -// ---------------------------------------------------------------------------- - -const wxAcceleratorEntry * -wxAcceleratorTable::GetEntry(const wxKeyEvent& event) const -{ - if ( !Ok() ) - { - // not an error, the accel table is just empty - return NULL; - } - - wxAccelList::compatibility_iterator node = M_ACCELDATA->m_accels.GetFirst(); - while ( node ) - { - const wxAcceleratorEntry *entry = node->GetData(); - - // is the key the same? - if ( event.m_keyCode == entry->GetKeyCode() ) - { - int flags = entry->GetFlags(); - - // now check flags - if ( (((flags & wxACCEL_CTRL) != 0) == event.ControlDown()) && - (((flags & wxACCEL_SHIFT) != 0) == event.ShiftDown()) && - (((flags & wxACCEL_ALT) != 0) == event.AltDown()) ) - { - return entry; - } - } - - node = node->GetNext(); - } - - return NULL; -} - -wxMenuItem *wxAcceleratorTable::GetMenuItem(const wxKeyEvent& event) const -{ - const wxAcceleratorEntry *entry = GetEntry(event); - - return entry ? entry->GetMenuItem() : NULL; -} - -int wxAcceleratorTable::GetCommand(const wxKeyEvent& event) const -{ - const wxAcceleratorEntry *entry = GetEntry(event); - - return entry ? entry->GetCommand() : -1; -} - -wxObjectRefData *wxAcceleratorTable::CreateRefData() const -{ - return new wxAccelRefData; -} - -wxObjectRefData *wxAcceleratorTable::CloneRefData(const wxObjectRefData *data) const -{ - return new wxAccelRefData(*(wxAccelRefData *)data); -} - -#endif // wxUSE_ACCEL diff --git a/wxWidgets/src/generic/animateg.cpp b/wxWidgets/src/generic/animateg.cpp deleted file mode 100644 index 9f4447a622..0000000000 --- a/wxWidgets/src/generic/animateg.cpp +++ /dev/null @@ -1,690 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: animateg.cpp -// Purpose: wxAnimation and wxAnimationCtrl -// Author: Julian Smart and Guillermo Rodriguez Garcia -// Modified by: Francesco Montorsi -// Created: 13/8/99 -// RCS-ID: $Id: animateg.cpp 48085 2007-08-15 11:36:50Z VZ $ -// Copyright: (c) Julian Smart and Guillermo Rodriguez Garcia -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif //__BORLANDC__ - -#if wxUSE_ANIMATIONCTRL && (!defined(__WXGTK20__) || defined(__WXUNIVERSAL__)) - -#include "wx/animate.h" - -#ifndef WX_PRECOMP - #include "wx/log.h" - #include "wx/image.h" - #include "wx/dcmemory.h" - #include "wx/dcclient.h" - #include "wx/module.h" -#endif - -#include "wx/wfstream.h" -#include "wx/gifdecod.h" -#include "wx/anidecod.h" - -#include "wx/listimpl.cpp" -WX_DEFINE_LIST(wxAnimationDecoderList) - -wxAnimationDecoderList wxAnimation::sm_handlers; - - -// ---------------------------------------------------------------------------- -// wxAnimation -// ---------------------------------------------------------------------------- - -IMPLEMENT_DYNAMIC_CLASS(wxAnimation, wxAnimationBase) -#define M_ANIMDATA wx_static_cast(wxAnimationDecoder*, m_refData) - -wxSize wxAnimation::GetSize() const -{ - wxCHECK_MSG( IsOk(), wxDefaultSize, wxT("invalid animation") ); - - return M_ANIMDATA->GetAnimationSize(); -} - -unsigned int wxAnimation::GetFrameCount() const -{ - wxCHECK_MSG( IsOk(), 0, wxT("invalid animation") ); - - return M_ANIMDATA->GetFrameCount(); -} - -wxImage wxAnimation::GetFrame(unsigned int i) const -{ - wxCHECK_MSG( IsOk(), wxNullImage, wxT("invalid animation") ); - - wxImage ret; - if (!M_ANIMDATA->ConvertToImage(i, &ret)) - return wxNullImage; - return ret; -} - -int wxAnimation::GetDelay(unsigned int i) const -{ - wxCHECK_MSG( IsOk(), 0, wxT("invalid animation") ); - - return M_ANIMDATA->GetDelay(i); -} - -wxPoint wxAnimation::GetFramePosition(unsigned int frame) const -{ - wxCHECK_MSG( IsOk(), wxDefaultPosition, wxT("invalid animation") ); - - return M_ANIMDATA->GetFramePosition(frame); -} - -wxSize wxAnimation::GetFrameSize(unsigned int frame) const -{ - wxCHECK_MSG( IsOk(), wxDefaultSize, wxT("invalid animation") ); - - return M_ANIMDATA->GetFrameSize(frame); -} - -wxAnimationDisposal wxAnimation::GetDisposalMethod(unsigned int frame) const -{ - wxCHECK_MSG( IsOk(), wxANIM_UNSPECIFIED, wxT("invalid animation") ); - - return M_ANIMDATA->GetDisposalMethod(frame); -} - -wxColour wxAnimation::GetTransparentColour(unsigned int frame) const -{ - wxCHECK_MSG( IsOk(), wxNullColour, wxT("invalid animation") ); - - return M_ANIMDATA->GetTransparentColour(frame); -} - -wxColour wxAnimation::GetBackgroundColour() const -{ - wxCHECK_MSG( IsOk(), wxNullColour, wxT("invalid animation") ); - - return M_ANIMDATA->GetBackgroundColour(); -} - -bool wxAnimation::LoadFile(const wxString& filename, wxAnimationType type) -{ - wxFileInputStream stream(filename); - if ( !stream.IsOk() ) - return false; - - return Load(stream, type); -} - -bool wxAnimation::Load(wxInputStream &stream, wxAnimationType type) -{ - UnRef(); - - const wxAnimationDecoder *handler; - if ( type == wxANIMATION_TYPE_ANY ) - { - for ( wxAnimationDecoderList::compatibility_iterator node = sm_handlers.GetFirst(); - node; node = node->GetNext() ) - { - handler=(const wxAnimationDecoder*)node->GetData(); - - if ( handler->CanRead(stream) ) - { - // do a copy of the handler from the static list which we will own - // as our reference data - m_refData = handler->Clone(); - return M_ANIMDATA->Load(stream); - } - - } - - wxLogWarning( _("No handler found for animation type.") ); - return false; - } - - handler = FindHandler(type); - - // do a copy of the handler from the static list which we will own - // as our reference data - m_refData = handler->Clone(); - - if (handler == NULL) - { - wxLogWarning( _("No animation handler for type %ld defined."), type ); - - return false; - } - - if (stream.IsSeekable() && !M_ANIMDATA->CanRead(stream)) - { - wxLogError(_("Animation file is not of type %ld."), type); - return false; - } - else - return M_ANIMDATA->Load(stream); -} - - -// ---------------------------------------------------------------------------- -// animation decoders -// ---------------------------------------------------------------------------- - -void wxAnimation::AddHandler( wxAnimationDecoder *handler ) -{ - // Check for an existing handler of the type being added. - if (FindHandler( handler->GetType() ) == 0) - { - sm_handlers.Append( handler ); - } - else - { - // This is not documented behaviour, merely the simplest 'fix' - // for preventing duplicate additions. If someone ever has - // a good reason to add and remove duplicate handlers (and they - // may) we should probably refcount the duplicates. - - wxLogDebug( _T("Adding duplicate animation handler for '%d' type"), - handler->GetType() ); - delete handler; - } -} - -void wxAnimation::InsertHandler( wxAnimationDecoder *handler ) -{ - // Check for an existing handler of the type being added. - if (FindHandler( handler->GetType() ) == 0) - { - sm_handlers.Insert( handler ); - } - else - { - // see AddHandler for additional comments. - wxLogDebug( _T("Inserting duplicate animation handler for '%d' type"), - handler->GetType() ); - delete handler; - } -} - -const wxAnimationDecoder *wxAnimation::FindHandler( wxAnimationType animType ) -{ - wxAnimationDecoderList::compatibility_iterator node = sm_handlers.GetFirst(); - while (node) - { - const wxAnimationDecoder *handler = (const wxAnimationDecoder *)node->GetData(); - if (handler->GetType() == animType) return handler; - node = node->GetNext(); - } - return 0; -} - -void wxAnimation::InitStandardHandlers() -{ -#if wxUSE_GIF - AddHandler(new wxGIFDecoder); -#endif // wxUSE_GIF -#if wxUSE_ICO_CUR - AddHandler(new wxANIDecoder); -#endif // wxUSE_ICO_CUR -} - -void wxAnimation::CleanUpHandlers() -{ - wxAnimationDecoderList::compatibility_iterator node = sm_handlers.GetFirst(); - while (node) - { - wxAnimationDecoder *handler = (wxAnimationDecoder *)node->GetData(); - wxAnimationDecoderList::compatibility_iterator next = node->GetNext(); - delete handler; - node = next; - } - - sm_handlers.Clear(); -} - - -// A module to allow wxAnimation initialization/cleanup -// without calling these functions from app.cpp or from -// the user's application. - -class wxAnimationModule: public wxModule -{ -DECLARE_DYNAMIC_CLASS(wxAnimationModule) -public: - wxAnimationModule() {} - bool OnInit() { wxAnimation::InitStandardHandlers(); return true; } - void OnExit() { wxAnimation::CleanUpHandlers(); } -}; - -IMPLEMENT_DYNAMIC_CLASS(wxAnimationModule, wxModule) - - -// ---------------------------------------------------------------------------- -// wxAnimationCtrl -// ---------------------------------------------------------------------------- - -IMPLEMENT_CLASS(wxAnimationCtrl, wxAnimationCtrlBase) -BEGIN_EVENT_TABLE(wxAnimationCtrl, wxAnimationCtrlBase) - EVT_PAINT(wxAnimationCtrl::OnPaint) - EVT_SIZE(wxAnimationCtrl::OnSize) - EVT_TIMER(wxID_ANY, wxAnimationCtrl::OnTimer) -END_EVENT_TABLE() - -void wxAnimationCtrl::Init() -{ - m_currentFrame = 0; - m_looped = false; - m_isPlaying = false; - - // use the window background colour by default to be consistent - // with the GTK+ native version - m_useWinBackgroundColour = true; -} - -bool wxAnimationCtrl::Create(wxWindow *parent, wxWindowID id, - const wxAnimation& animation, const wxPoint& pos, - const wxSize& size, long style, const wxString& name) -{ - m_timer.SetOwner(this); - - if (!base_type::Create(parent, id, pos, size, style, wxDefaultValidator, name)) - return false; - - // by default we get the same background colour of our parent - SetBackgroundColour(parent->GetBackgroundColour()); - - SetAnimation(animation); - - return true; -} - -wxAnimationCtrl::~wxAnimationCtrl() -{ - Stop(); -} - -bool wxAnimationCtrl::LoadFile(const wxString& filename, wxAnimationType type) -{ - wxAnimation anim; - if (!anim.LoadFile(filename, type) || - !anim.IsOk()) - return false; - - SetAnimation(anim); - return true; -} - -wxSize wxAnimationCtrl::DoGetBestSize() const -{ - if (m_animation.IsOk() && !this->HasFlag(wxAC_NO_AUTORESIZE)) - return m_animation.GetSize(); - - return wxSize(100, 100); -} - -void wxAnimationCtrl::SetAnimation(const wxAnimation& animation) -{ - if (IsPlaying()) - Stop(); - - // set new animation even if it's wxNullAnimation - m_animation = animation; - if (!m_animation.IsOk()) - { - DisplayStaticImage(); - return; - } - - if (m_animation.GetBackgroundColour() == wxNullColour) - SetUseWindowBackgroundColour(); - if (!this->HasFlag(wxAC_NO_AUTORESIZE)) - FitToAnimation(); - - DisplayStaticImage(); -} - -void wxAnimationCtrl::SetInactiveBitmap(const wxBitmap &bmp) -{ - // if the bitmap has an associated mask, we need to set our background to - // the colour of our parent otherwise when calling DrawCurrentFrame() - // (which uses the bitmap's mask), our background colour would be used for - // transparent areas - and that's not what we want (at least for - // consistency with the GTK version) - if ( bmp.GetMask() != NULL && GetParent() != NULL ) - SetBackgroundColour(GetParent()->GetBackgroundColour()); - - wxAnimationCtrlBase::SetInactiveBitmap(bmp); -} - -void wxAnimationCtrl::FitToAnimation() -{ - SetSize(m_animation.GetSize()); -} - -bool wxAnimationCtrl::SetBackgroundColour(const wxColour& colour) -{ - if ( !wxWindow::SetBackgroundColour(colour) ) - return false; - - // if not playing, then this change must be seen immediately (unless - // there's an inactive bitmap set which has higher priority than bg colour) - if ( !IsPlaying() ) - DisplayStaticImage(); - - return true; -} - - -// ---------------------------------------------------------------------------- -// wxAnimationCtrl - stop/play methods -// ---------------------------------------------------------------------------- - -void wxAnimationCtrl::Stop() -{ - m_timer.Stop(); - m_isPlaying = false; - - // reset frame counter - m_currentFrame = 0; - - DisplayStaticImage(); -} - -bool wxAnimationCtrl::Play(bool looped) -{ - if (!m_animation.IsOk()) - return false; - - m_looped = looped; - m_currentFrame = 0; - - if (!RebuildBackingStoreUpToFrame(0)) - return false; - - m_isPlaying = true; - - // do a ClearBackground() to avoid that e.g. the custom static bitmap which - // was eventually shown previously remains partially drawn - ClearBackground(); - - // DrawCurrentFrame() will use our updated backing store - wxClientDC clientDC(this); - DrawCurrentFrame(clientDC); - - // start the timer - int delay = m_animation.GetDelay(0); - if (delay == 0) - delay = 1; // 0 is invalid timeout for wxTimer. - m_timer.Start(delay, true); - - return true; -} - - - -// ---------------------------------------------------------------------------- -// wxAnimationCtrl - rendering methods -// ---------------------------------------------------------------------------- - -bool wxAnimationCtrl::RebuildBackingStoreUpToFrame(unsigned int frame) -{ - // if we've not created the backing store yet or it's too - // small, then recreate it - wxSize sz = m_animation.GetSize(), - winsz = GetClientSize(); - int w = wxMin(sz.GetWidth(), winsz.GetWidth()); - int h = wxMin(sz.GetHeight(), winsz.GetHeight()); - - if ( !m_backingStore.IsOk() || - m_backingStore.GetWidth() < w || m_backingStore.GetHeight() < h ) - { - if (!m_backingStore.Create(w, h)) - return false; - } - - wxMemoryDC dc; - dc.SelectObject(m_backingStore); - - // Draw the background - DisposeToBackground(dc); - - // Draw all intermediate frames that haven't been removed from the animation - for (unsigned int i = 0; i < frame; i++) - { - if (m_animation.GetDisposalMethod(i) == wxANIM_DONOTREMOVE || - m_animation.GetDisposalMethod(i) == wxANIM_UNSPECIFIED) - { - DrawFrame(dc, i); - } - else if (m_animation.GetDisposalMethod(i) == wxANIM_TOBACKGROUND) - DisposeToBackground(dc, m_animation.GetFramePosition(i), - m_animation.GetFrameSize(i)); - } - - // finally draw this frame - DrawFrame(dc, frame); - dc.SelectObject(wxNullBitmap); - - return true; -} - -void wxAnimationCtrl::IncrementalUpdateBackingStore() -{ - wxMemoryDC dc; - dc.SelectObject(m_backingStore); - - // OPTIMIZATION: - // since wxAnimationCtrl can only play animations forward, without skipping - // frames, we can be sure that m_backingStore contains the m_currentFrame-1 - // frame and thus we just need to dispose the m_currentFrame-1 frame and - // render the m_currentFrame-th one. - - if (m_currentFrame == 0) - { - // before drawing the first frame always dispose to bg colour - DisposeToBackground(dc); - } - else - { - switch (m_animation.GetDisposalMethod(m_currentFrame-1)) - { - case wxANIM_TOBACKGROUND: - DisposeToBackground(dc, m_animation.GetFramePosition(m_currentFrame-1), - m_animation.GetFrameSize(m_currentFrame-1)); - break; - - case wxANIM_TOPREVIOUS: - // this disposal should never be used too often. - // E.g. GIF specification explicitely say to keep the usage of this - // disposal limited to the minimum. - // In fact it may require a lot of time to restore - if (m_currentFrame == 1) - { - // if 0-th frame disposal is to restore to previous frame, - // the best we can do is to restore to background - DisposeToBackground(dc); - } - else - if (!RebuildBackingStoreUpToFrame(m_currentFrame-2)) - Stop(); - break; - - case wxANIM_DONOTREMOVE: - case wxANIM_UNSPECIFIED: - break; - } - } - - // now just draw the current frame on the top of the backing store - DrawFrame(dc, m_currentFrame); - dc.SelectObject(wxNullBitmap); -} - -void wxAnimationCtrl::DisplayStaticImage() -{ - wxASSERT(!IsPlaying()); - - // m_bmpStaticReal will be updated only if necessary... - UpdateStaticImage(); - - if (m_bmpStaticReal.IsOk()) - { - // copy the inactive bitmap in the backing store - // eventually using the mask if the static bitmap has one - if ( m_bmpStaticReal.GetMask() ) - { - wxMemoryDC temp; - temp.SelectObject(m_backingStore); - DisposeToBackground(temp); - temp.DrawBitmap(m_bmpStaticReal, 0, 0, true /* use mask */); - } - else - m_backingStore = m_bmpStaticReal; - } - else - { - // put in the backing store the first frame of the animation - if (!m_animation.IsOk() || - !RebuildBackingStoreUpToFrame(0)) - { - m_animation = wxNullAnimation; - DisposeToBackground(); - } - } - - Refresh(); -} - -void wxAnimationCtrl::DrawFrame(wxDC &dc, unsigned int frame) -{ - // PERFORMANCE NOTE: - // this draw stuff is not as fast as possible: the wxAnimationDecoder - // needs first to convert from its internal format to wxImage RGB24; - // the wxImage is then converted as a wxBitmap and finally blitted. - // If wxAnimationDecoder had a function to convert directly from its - // internal format to a port-specific wxBitmap, it would be somewhat faster. - wxBitmap bmp(m_animation.GetFrame(frame)); - dc.DrawBitmap(bmp, m_animation.GetFramePosition(frame), - true /* use mask */); -} - -void wxAnimationCtrl::DrawCurrentFrame(wxDC& dc) -{ - wxASSERT( m_backingStore.IsOk() ); - - // m_backingStore always contains the current frame - dc.DrawBitmap(m_backingStore, 0, 0, true /* use mask in case it's present */); -} - -void wxAnimationCtrl::DisposeToBackground() -{ - // clear the backing store - wxMemoryDC dc; - dc.SelectObject(m_backingStore); - if ( dc.IsOk() ) - DisposeToBackground(dc); -} - -void wxAnimationCtrl::DisposeToBackground(wxDC& dc) -{ - wxColour col = IsUsingWindowBackgroundColour() - ? GetBackgroundColour() - : m_animation.GetBackgroundColour(); - - wxBrush brush(col); - dc.SetBackground(brush); - dc.Clear(); -} - -void wxAnimationCtrl::DisposeToBackground(wxDC& dc, const wxPoint &pos, const wxSize &sz) -{ - wxColour col = IsUsingWindowBackgroundColour() - ? GetBackgroundColour() - : m_animation.GetBackgroundColour(); - wxBrush brush(col); - dc.SetBrush(brush); // SetBrush and not SetBackground !! - dc.SetPen(*wxTRANSPARENT_PEN); - dc.DrawRectangle(pos, sz); -} - -// ---------------------------------------------------------------------------- -// wxAnimationCtrl - event handlers -// ---------------------------------------------------------------------------- - -void wxAnimationCtrl::OnPaint(wxPaintEvent& WXUNUSED(event)) -{ - // VERY IMPORTANT: the wxPaintDC *must* be created in any case - wxPaintDC dc(this); - - if ( m_backingStore.IsOk() ) - { - // NOTE: we draw the bitmap explicitely ignoring the mask (if any); - // i.e. we don't want to combine the backing store with the - // possibly wrong preexisting contents of the window! - dc.DrawBitmap(m_backingStore, 0, 0, false /* no mask */); - } - else - { - // m_animation is not valid and thus we don't have a valid backing store... - // clear then our area to the background colour - DisposeToBackground(dc); - } -} - -void wxAnimationCtrl::OnTimer(wxTimerEvent &WXUNUSED(event)) -{ - m_currentFrame++; - if (m_currentFrame == m_animation.GetFrameCount()) - { - // Should a non-looped animation display the last frame? - if (!m_looped) - { - Stop(); - return; - } - else - m_currentFrame = 0; // let's restart - } - - IncrementalUpdateBackingStore(); - - wxClientDC dc(this); - DrawCurrentFrame(dc); - -#ifdef __WXMAC__ - // without this, the animation currently doesn't redraw under Mac - Refresh(); -#endif // __WXMAC__ - - // Set the timer for the next frame - int delay = m_animation.GetDelay(m_currentFrame); - if (delay == 0) - delay = 1; // 0 is invalid timeout for wxTimer. - m_timer.Start(delay, true); -} - -void wxAnimationCtrl::OnSize(wxSizeEvent &WXUNUSED(event)) -{ - // NB: resizing an animation control may take a lot of time - // for big animations as the backing store must be - // extended and rebuilt. Try to avoid it e.g. using - // a null proportion value for your wxAnimationCtrls - // when using them inside sizers. - if (m_animation.IsOk()) - { - // be careful to change the backing store *only* if we are - // playing the animation as otherwise we may be displaying - // the inactive bitmap and overwriting the backing store - // with the last played frame is wrong in this case - if (IsPlaying()) - { - if (!RebuildBackingStoreUpToFrame(m_currentFrame)) - Stop(); // in case we are playing - } - } -} - -#endif // wxUSE_ANIMATIONCTRL - diff --git a/wxWidgets/src/generic/bmpcboxg.cpp b/wxWidgets/src/generic/bmpcboxg.cpp deleted file mode 100644 index 9a71ec9a1a..0000000000 --- a/wxWidgets/src/generic/bmpcboxg.cpp +++ /dev/null @@ -1,477 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/generic/bmpcboxg.cpp -// Purpose: wxBitmapComboBox -// Author: Jaakko Salli -// Modified by: -// Created: Aug-31-2006 -// RCS-ID: $Id: bmpcboxg.cpp 44665 2007-03-07 23:29:03Z VZ $ -// Copyright: (c) 2005 Jaakko Salli -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_BITMAPCOMBOBOX - -#include "wx/bmpcbox.h" - -#if defined(wxGENERIC_BITMAPCOMBOBOX) - -#ifndef WX_PRECOMP - #include "wx/log.h" -#endif - -#include "wx/odcombo.h" -#include "wx/settings.h" -#include "wx/dc.h" - -#if wxUSE_IMAGE - #include "wx/image.h" -#endif - - -const wxChar wxBitmapComboBoxNameStr[] = wxT("bitmapComboBox"); - - -// These macros allow wxArrayPtrVoid to be used in more convenient manner -#define GetBitmapPtr(n) ((wxBitmap*)m_bitmaps[n]) - - -#define IMAGE_SPACING_RIGHT 4 // Space left of image - -#define IMAGE_SPACING_LEFT 4 // Space right of image, left of text - -#define IMAGE_SPACING_VERTICAL 2 // Space top and bottom of image - -#define IMAGE_SPACING_CTRL_VERTICAL 7 // Spacing used in control size calculation - -#define EXTRA_FONT_HEIGHT 0 // Add to increase min. height of list items - - -// ============================================================================ -// implementation -// ============================================================================ - - -BEGIN_EVENT_TABLE(wxBitmapComboBox, wxOwnerDrawnComboBox) - EVT_SIZE(wxBitmapComboBox::OnSize) -END_EVENT_TABLE() - - -IMPLEMENT_DYNAMIC_CLASS(wxBitmapComboBox, wxOwnerDrawnComboBox) - -void wxBitmapComboBox::Init() -{ - m_fontHeight = 0; - m_imgAreaWidth = 0; - m_inResize = false; -} - -wxBitmapComboBox::wxBitmapComboBox(wxWindow *parent, - wxWindowID id, - const wxString& value, - const wxPoint& pos, - const wxSize& size, - const wxArrayString& choices, - long style, - const wxValidator& validator, - const wxString& name) - : wxOwnerDrawnComboBox(), - wxBitmapComboBoxBase() -{ - Init(); - - Create(parent,id,value,pos,size,choices,style,validator,name); -} - -bool wxBitmapComboBox::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) -{ - if ( !wxOwnerDrawnComboBox::Create(parent, id, value, - pos, size, - choices, style, - validator, name) ) - { - return false; - } - - PostCreate(); - - return true; -} - -bool wxBitmapComboBox::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 ( !wxOwnerDrawnComboBox::Create(parent, id, value, - pos, size, n, - choices, style, - validator, name) ) - { - return false; - } - - PostCreate(); - - return true; -} - -void wxBitmapComboBox::PostCreate() -{ - m_fontHeight = GetCharHeight() + EXTRA_FONT_HEIGHT; - - while ( m_bitmaps.GetCount() < GetCount() ) - m_bitmaps.Add( new wxBitmap() ); -} - -wxBitmapComboBox::~wxBitmapComboBox() -{ - Clear(); -} - -// ---------------------------------------------------------------------------- -// Item manipulation -// ---------------------------------------------------------------------------- - -void wxBitmapComboBox::SetItemBitmap(unsigned int n, const wxBitmap& bitmap) -{ - wxCHECK_RET( n < GetCount(), wxT("invalid item index") ); - OnAddBitmap(bitmap); - *GetBitmapPtr(n) = bitmap; - - if ( (int)n == GetSelection() ) - Refresh(); -} - -wxBitmap wxBitmapComboBox::GetItemBitmap(unsigned int n) const -{ - wxCHECK_MSG( n < GetCount(), wxNullBitmap, wxT("invalid item index") ); - return *GetBitmapPtr(n); -} - -int wxBitmapComboBox::Insert(const wxString& item, const wxBitmap& bitmap, - unsigned int pos, void *clientData) -{ - int n = DoInsertWithImage(item, bitmap, pos); - if ( n != wxNOT_FOUND ) - SetClientData(n, clientData); - - return n; -} - -int wxBitmapComboBox::Insert(const wxString& item, const wxBitmap& bitmap, - unsigned int pos, wxClientData *clientData) -{ - int n = DoInsertWithImage(item, bitmap, pos); - if ( n != wxNOT_FOUND ) - SetClientObject(n, clientData); - - return n; -} - -bool wxBitmapComboBox::OnAddBitmap(const wxBitmap& bitmap) -{ - if ( bitmap.Ok() ) - { - int width = bitmap.GetWidth(); - int height = bitmap.GetHeight(); - - if ( m_usedImgSize.x <= 0 ) - { - // - // If size not yet determined, get it from this image. - m_usedImgSize.x = width; - m_usedImgSize.y = height; - - InvalidateBestSize(); - wxSize newSz = GetBestSize(); - wxSize sz = GetSize(); - if ( newSz.y > sz.y ) - SetSize(sz.x, newSz.y); - else - DetermineIndent(); - } - - wxCHECK_MSG(width == m_usedImgSize.x && height == m_usedImgSize.y, - false, - wxT("you can only add images of same size")); - } - - return true; -} - -bool wxBitmapComboBox::DoInsertBitmap(const wxBitmap& bitmap, unsigned int pos) -{ - if ( !OnAddBitmap(bitmap) ) - return false; - - // NB: We must try to set the image before DoInsert or - // DoAppend because OnMeasureItem might be called - // before it returns. - m_bitmaps.Insert( new wxBitmap(bitmap), pos); - - return true; -} - -int wxBitmapComboBox::DoAppendWithImage(const wxString& item, const wxBitmap& image) -{ - unsigned int pos = m_bitmaps.size(); - - if ( !DoInsertBitmap(image, pos) ) - return wxNOT_FOUND; - - int index = wxOwnerDrawnComboBox::DoAppend(item); - - if ( index < 0 ) - index = m_bitmaps.size(); - - // Need to re-check the index incase DoAppend sorted - if ( (unsigned int) index != pos ) - { - wxBitmap* bmp = GetBitmapPtr(pos); - m_bitmaps.RemoveAt(pos); - m_bitmaps.Insert(bmp, index); - } - - return index; -} - -int wxBitmapComboBox::DoInsertWithImage(const wxString& item, - const wxBitmap& image, - unsigned int pos) -{ - wxCHECK_MSG( IsValidInsert(pos), wxNOT_FOUND, wxT("invalid item index") ); - - if ( !DoInsertBitmap(image, pos) ) - return wxNOT_FOUND; - - return wxOwnerDrawnComboBox::DoInsert(item, pos); -} - -int wxBitmapComboBox::DoAppend(const wxString& item) -{ - return DoAppendWithImage(item, wxNullBitmap); -} - -int wxBitmapComboBox::DoInsert(const wxString& item, unsigned int pos) -{ - return DoInsertWithImage(item, wxNullBitmap, pos); -} - -void wxBitmapComboBox::Clear() -{ - wxOwnerDrawnComboBox::Clear(); - - unsigned int i; - - for ( i=0; i 0 ) - { - indent = m_usedImgSize.x + IMAGE_SPACING_LEFT + IMAGE_SPACING_RIGHT; - m_imgAreaWidth = indent; - - indent -= 3; - } - - SetCustomPaintWidth(indent); -} - -void wxBitmapComboBox::OnSize(wxSizeEvent& event) -{ - // Prevent infinite looping - if ( !m_inResize ) - { - m_inResize = true; - DetermineIndent(); - m_inResize = false; - } - - event.Skip(); -} - -wxSize wxBitmapComboBox::DoGetBestSize() const -{ - wxSize sz = wxOwnerDrawnComboBox::DoGetBestSize(); - - // Scale control to match height of highest image. - int h2 = m_usedImgSize.y + IMAGE_SPACING_CTRL_VERTICAL; - - if ( h2 > sz.y ) - sz.y = h2; - - CacheBestSize(sz); - return sz; -} - -// ---------------------------------------------------------------------------- -// wxBitmapComboBox miscellaneous -// ---------------------------------------------------------------------------- - -bool wxBitmapComboBox::SetFont(const wxFont& font) -{ - bool res = wxOwnerDrawnComboBox::SetFont(font); - m_fontHeight = GetCharHeight() + EXTRA_FONT_HEIGHT; - return res; -} - -// ---------------------------------------------------------------------------- -// wxBitmapComboBox item drawing and measuring -// ---------------------------------------------------------------------------- - -void wxBitmapComboBox::OnDrawBackground(wxDC& dc, - const wxRect& rect, - int item, - int flags) const -{ - if ( GetCustomPaintWidth() == 0 || - !(flags & wxODCB_PAINTING_SELECTED) || - item < 0 ) - { - wxOwnerDrawnComboBox::OnDrawBackground(dc, rect, item, flags); - return; - } - - // - // Just paint simple selection background under where is text - // (ie. emulate what MSW image choice does). - // - - int xPos = 0; // Starting x of selection rectangle - const int vSizeDec = 1; // Vertical size reduction of selection rectangle edges - - xPos = GetCustomPaintWidth() + 2; - - wxCoord x, y; - GetTextExtent(GetString(item), &x, &y, 0, 0); - - dc.SetTextForeground(wxSystemSettings::GetColour(wxSYS_COLOUR_HIGHLIGHTTEXT)); - - wxColour selCol = wxSystemSettings::GetColour(wxSYS_COLOUR_HIGHLIGHT); - dc.SetPen(selCol); - dc.SetBrush(selCol); - dc.DrawRectangle(rect.x+xPos, - rect.y+vSizeDec, - x + 4, - rect.height-(vSizeDec*2)); -} - -void wxBitmapComboBox::OnDrawItem(wxDC& dc, - const wxRect& rect, - int item, - int flags) const -{ - wxString text; - int imgAreaWidth = m_imgAreaWidth; - bool drawText; - - if ( imgAreaWidth == 0 ) - { - wxOwnerDrawnComboBox::OnDrawItem(dc, rect, item, flags); - return; - } - - if ( flags & wxODCB_PAINTING_CONTROL ) - { - text = GetValue(); - if ( HasFlag(wxCB_READONLY) ) - drawText = true; - else - drawText = false; - } - else - { - text = GetString(item); - drawText = true; - } - - const wxBitmap& bmp = *GetBitmapPtr(item); - if ( bmp.Ok() ) - { - wxCoord w = bmp.GetWidth(); - wxCoord h = bmp.GetHeight(); - - // Draw the image centered - dc.DrawBitmap(bmp, - rect.x + (m_usedImgSize.x-w)/2 + IMAGE_SPACING_LEFT, - rect.y + (rect.height-h)/2, - true); - } - - if ( drawText ) - dc.DrawText(GetString(item), - rect.x + imgAreaWidth + 1, - rect.y + (rect.height-dc.GetCharHeight())/2); -} - -wxCoord wxBitmapComboBox::OnMeasureItem(size_t WXUNUSED(item)) const -{ - int imgHeightArea = m_usedImgSize.y + 2; - return imgHeightArea > m_fontHeight ? imgHeightArea : m_fontHeight; -} - -wxCoord wxBitmapComboBox::OnMeasureItemWidth(size_t item) const -{ - wxCoord x, y; - GetTextExtent(GetString(item), &x, &y, 0, 0); - x += m_imgAreaWidth; - return x; -} - -#endif // defined(wxGENERIC_BITMAPCOMBOBOX) - -#endif // wxUSE_BITMAPCOMBOBOX diff --git a/wxWidgets/src/generic/busyinfo.cpp b/wxWidgets/src/generic/busyinfo.cpp deleted file mode 100644 index e57736122d..0000000000 --- a/wxWidgets/src/generic/busyinfo.cpp +++ /dev/null @@ -1,135 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/generic/busyinfo.cpp -// Purpose: Information window when app is busy -// Author: Vaclav Slavik -// Copyright: (c) 1999 Vaclav Slavik -// RCS-ID: $Id: busyinfo.cpp 44898 2007-03-18 20:39:13Z VZ $ -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ -#pragma hdrstop -#endif - -#if wxUSE_BUSYINFO - -// for all others, include the necessary headers -#ifndef WX_PRECOMP - #include "wx/frame.h" - #include "wx/stattext.h" - #include "wx/panel.h" - #include "wx/utils.h" -#endif - -#include "wx/busyinfo.h" - -class WXDLLEXPORT wxInfoFrame : public wxFrame -{ -public: - wxInfoFrame(wxWindow *parent, const wxString& message); - -private: - DECLARE_NO_COPY_CLASS(wxInfoFrame) -}; - - -wxInfoFrame::wxInfoFrame(wxWindow *parent, const wxString& message) - : wxFrame(parent, wxID_ANY, wxT("Busy"), - wxDefaultPosition, wxDefaultSize, -#if defined(__WXX11__) - wxRESIZE_BORDER -#else - wxSIMPLE_BORDER -#endif - | wxFRAME_TOOL_WINDOW) -{ - wxPanel *panel = new wxPanel( this ); - wxStaticText *text = new wxStaticText(panel, wxID_ANY, message); - - panel->SetCursor(*wxHOURGLASS_CURSOR); - text->SetCursor(*wxHOURGLASS_CURSOR); - - // make the frame of at least the standard size (400*80) but big enough - // for the text we show - wxSize sizeText = text->GetBestSize(); -#ifdef __WXPM__ - int nX = 0; - int nY = 0; - int nWidth = 0; - int nHeight = 0; - int nParentHeight = parent->GetClientSize().y; - int nParentWidth = parent->GetClientSize().x; - int nColor; - - SetBackgroundColour(wxT("WHITE")); - nColor = (LONG)GetBackgroundColour().GetPixel(); - - ::WinSetPresParam( GetHwnd() - ,PP_BACKGROUNDCOLOR - ,sizeof(LONG) - ,(PVOID)&nColor - ); - panel->SetBackgroundColour(wxT("WHITE")); - nColor = (LONG)panel->GetBackgroundColour().GetPixel(); - - ::WinSetPresParam( GetHwndOf(panel) - ,PP_BACKGROUNDCOLOR - ,sizeof(LONG) - ,(PVOID)&nColor - ); - nWidth = wxMax(sizeText.x, 340) + 60; - nHeight = wxMax(sizeText.y, 40) + 40; - nX = (nParentWidth - nWidth) / 2; - nY = (nParentHeight / 2) - (nHeight / 2); - nY = nParentHeight - (nY + nHeight); - ::WinSetWindowPos( m_hFrame - ,HWND_TOP - ,nX - ,nY - ,nWidth - ,nHeight - ,SWP_SIZE | SWP_MOVE | SWP_ACTIVATE - ); - text->SetBackgroundColour(wxT("WHITE")); - nColor = (LONG)text->GetBackgroundColour().GetPixel(); - - ::WinSetPresParam( GetHwndOf(text) - ,PP_BACKGROUNDCOLOR - ,sizeof(LONG) - ,(PVOID)&nColor - ); - text->Center(wxBOTH); -#else - SetClientSize(wxMax(sizeText.x, 340) + 60, wxMax(sizeText.y, 40) + 40); - - // need to size the panel correctly first so that text->Centre() works - panel->SetSize(GetClientSize()); - - text->Centre(wxBOTH); - Centre(wxBOTH); -#endif -} - -wxBusyInfo::wxBusyInfo(const wxString& message, wxWindow *parent) -{ - m_InfoFrame = new wxInfoFrame( parent, message); - if ( parent && parent->HasFlag(wxSTAY_ON_TOP) ) - { - // we must have this flag to be in front of our parent if it has it - m_InfoFrame->SetWindowStyleFlag(wxSTAY_ON_TOP); - } - - m_InfoFrame->Show(true); - m_InfoFrame->Refresh(); - m_InfoFrame->Update(); -} - -wxBusyInfo::~wxBusyInfo() -{ - m_InfoFrame->Show(false); - m_InfoFrame->Close(); -} - -#endif // wxUSE_BUSYINFO diff --git a/wxWidgets/src/generic/buttonbar.cpp b/wxWidgets/src/generic/buttonbar.cpp deleted file mode 100644 index f85918ba5d..0000000000 --- a/wxWidgets/src/generic/buttonbar.cpp +++ /dev/null @@ -1,555 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/generic/buttonbar.cpp -// Purpose: wxButtonToolBar implementation -// Author: Julian Smart, after Robert Roebling, Vadim Zeitlin, SciTech -// Modified by: -// Created: 2006-04-13 -// Id: $Id: buttonbar.cpp 42816 2006-10-31 08:50:17Z RD $ -// Copyright: (c) Julian Smart, Robert Roebling, Vadim Zeitlin, -// SciTech Software, Inc. -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -// Currently, only for Mac as a toolbar replacement. -#if defined(__WXMAC__) && wxUSE_TOOLBAR && wxUSE_BMPBUTTON - -#include "wx/generic/buttonbar.h" - -#ifndef WX_PRECOMP - #include "wx/utils.h" - #include "wx/app.h" - #include "wx/log.h" - #include "wx/frame.h" - #include "wx/dcclient.h" - #include "wx/settings.h" - #include "wx/image.h" -#endif - -// ---------------------------------------------------------------------------- -// wxButtonToolBarTool: our implementation of wxToolBarToolBase -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxButtonToolBarTool : public wxToolBarToolBase -{ -public: - wxButtonToolBarTool(wxButtonToolBar *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) - { - m_x = m_y = wxDefaultCoord; - m_width = - m_height = 0; - - m_button = NULL; - } - - wxButtonToolBarTool(wxButtonToolBar *tbar, wxControl *control) - : wxToolBarToolBase(tbar, control) - { - m_x = m_y = wxDefaultCoord; - m_width = - m_height = 0; - m_button = NULL; - } - - wxBitmapButton* GetButton() const { return m_button; } - void SetButton(wxBitmapButton* button) { m_button = button; } - -public: - // the tool position (for controls) - wxCoord m_x; - wxCoord m_y; - wxCoord m_width; - wxCoord m_height; - -private: - // the control representing the button - wxBitmapButton* m_button; -}; - -// ============================================================================ -// wxButtonToolBar implementation -// ============================================================================ - -IMPLEMENT_DYNAMIC_CLASS(wxButtonToolBar, wxControl) - -BEGIN_EVENT_TABLE(wxButtonToolBar, wxControl) - EVT_BUTTON(wxID_ANY, wxButtonToolBar::OnCommand) - EVT_PAINT(wxButtonToolBar::OnPaint) - EVT_LEFT_UP(wxButtonToolBar::OnLeftUp) -END_EVENT_TABLE() - -// ---------------------------------------------------------------------------- -// wxButtonToolBar creation -// ---------------------------------------------------------------------------- - -void wxButtonToolBar::Init() -{ - // no tools yet - m_needsLayout = false; - - // unknown widths for the tools and separators - m_widthSeparator = wxDefaultCoord; - - m_maxWidth = m_maxHeight = 0; - - m_labelMargin = 2; - m_labelHeight = 0; - - SetMargins(8, 2); - SetToolPacking(8); -} - -bool wxButtonToolBar::Create(wxWindow *parent, - wxWindowID id, - const wxPoint& pos, - const wxSize& size, - long style, - const wxString& name) -{ - if ( !wxToolBarBase::Create(parent, id, pos, size, style, - wxDefaultValidator, name) ) - { - return false; - } - - // wxColour lightBackground(244, 244, 244); - - wxFont font(wxSMALL_FONT->GetPointSize(), wxNORMAL_FONT->GetFamily(), wxNORMAL_FONT->GetStyle(), wxNORMAL); - SetFont(font); - - // Calculate the label height if necessary - if (GetWindowStyle() & wxTB_TEXT) - { - wxClientDC dc(this); - dc.SetFont(font); - int w, h; - dc.GetTextExtent(wxT("X"), & w, & h); - m_labelHeight = h; - } - return true; -} - -wxButtonToolBar::~wxButtonToolBar() -{ -} - -// ---------------------------------------------------------------------------- -// wxButtonToolBar tool-related methods -// ---------------------------------------------------------------------------- - -wxToolBarToolBase *wxButtonToolBar::FindToolForPosition(wxCoord x, wxCoord y) const -{ - // check the "other" direction first: it must be inside the toolbar or we - // don't risk finding anything - if ( IsVertical() ) - { - if ( x < 0 || x > m_maxWidth ) - return NULL; - - // we always use x, even for a vertical toolbar, this makes the code - // below simpler - x = y; - } - else // horizontal - { - if ( y < 0 || y > m_maxHeight ) - return NULL; - } - - for ( wxToolBarToolsList::compatibility_iterator node = m_tools.GetFirst(); - node; - node = node->GetNext() ) - { - wxButtonToolBarTool *tool = (wxButtonToolBarTool*) node->GetData(); - wxRect rectTool = GetToolRect(tool); - - wxCoord startTool, endTool; - GetRectLimits(rectTool, &startTool, &endTool); - - if ( x >= startTool && x <= endTool ) - { - // don't return the separators from here, they don't accept any - // input anyhow - return tool->IsSeparator() ? NULL : tool; - } - } - - return NULL; -} - -void wxButtonToolBar::GetRectLimits(const wxRect& rect, - wxCoord *start, - wxCoord *end) const -{ - wxCHECK_RET( start && end, _T("NULL pointer in GetRectLimits") ); - - if ( IsVertical() ) - { - *start = rect.GetTop(); - *end = rect.GetBottom(); - } - else // horizontal - { - *start = rect.GetLeft(); - *end = rect.GetRight(); - } -} - - -void wxButtonToolBar::SetToolShortHelp(int id, const wxString& help) -{ - wxToolBarToolBase *tool = FindById(id); - - wxCHECK_RET( tool, _T("SetToolShortHelp: no such tool") ); - - // TODO: set tooltip/short help - tool->SetShortHelp(help); -} - -bool wxButtonToolBar::DoInsertTool(size_t WXUNUSED(pos), - wxToolBarToolBase * WXUNUSED(tool)) -{ - return true; -} - -bool wxButtonToolBar::DoDeleteTool(size_t WXUNUSED(pos), - wxToolBarToolBase * WXUNUSED(tool)) -{ - // TODO - return true; -} - -void wxButtonToolBar::DoEnableTool(wxToolBarToolBase *WXUNUSED(tool), bool WXUNUSED(enable)) -{ - // TODO -} - -void wxButtonToolBar::DoToggleTool(wxToolBarToolBase *WXUNUSED(tool), bool WXUNUSED(toggle)) -{ - // TODO -} - -void wxButtonToolBar::DoSetToggle(wxToolBarToolBase *WXUNUSED(tool), bool WXUNUSED(toggle)) -{ - // TODO -} - -wxToolBarToolBase *wxButtonToolBar::CreateTool(int id, - const wxString& label, - const wxBitmap& bmpNormal, - const wxBitmap& bmpDisabled, - wxItemKind kind, - wxObject *clientData, - const wxString& shortHelp, - const wxString& longHelp) -{ - return new wxButtonToolBarTool(this, id, label, bmpNormal, bmpDisabled, kind, - clientData, shortHelp, longHelp); -} - -wxToolBarToolBase *wxButtonToolBar::CreateTool(wxControl *control) -{ - return new wxButtonToolBarTool(this, control); -} - -// ---------------------------------------------------------------------------- -// wxButtonToolBar geometry -// ---------------------------------------------------------------------------- - -wxRect wxButtonToolBar::GetToolRect(wxToolBarToolBase *toolBase) const -{ - const wxButtonToolBarTool *tool = (wxButtonToolBarTool *)toolBase; - - wxRect rect; - - wxCHECK_MSG( tool, rect, _T("GetToolRect: NULL tool") ); - - // ensure that we always have the valid tool position - if ( m_needsLayout ) - { - wxConstCast(this, wxButtonToolBar)->DoLayout(); - } - - rect.x = tool->m_x - (m_toolPacking/2); - rect.y = tool->m_y; - - if ( IsVertical() ) - { - if (tool->IsButton()) - { - rect.width = m_defaultWidth; - rect.height = m_defaultHeight; - if (tool->GetButton()) - rect.SetSize(wxSize(tool->m_width, tool->m_height)); - } - else if (tool->IsSeparator()) - { - rect.width = m_defaultWidth; - rect.height = m_widthSeparator; - } - else // control - { - rect.width = tool->m_width; - rect.height = tool->m_height; - } - } - else // horizontal - { - if (tool->IsButton()) - { - rect.width = m_defaultWidth; - rect.height = m_defaultHeight; - if (tool->GetButton()) - rect.SetSize(wxSize(tool->m_width, tool->m_height)); - } - else if (tool->IsSeparator()) - { - rect.width = m_widthSeparator; - rect.height = m_defaultHeight; - } - else // control - { - rect.width = tool->m_width; - rect.height = tool->m_height; - } - } - - rect.width += m_toolPacking; - - return rect; -} - -bool wxButtonToolBar::Realize() -{ - if ( !wxToolBarBase::Realize() ) - return false; - - m_needsLayout = true; - DoLayout(); - - SetInitialSize(wxSize(m_maxWidth, m_maxHeight)); - - return true; -} - -void wxButtonToolBar::DoLayout() -{ - m_needsLayout = false; - - wxCoord x = m_xMargin, - y = m_yMargin; - - int maxHeight = 0; - - const wxCoord widthTool = IsVertical() ? m_defaultHeight : m_defaultWidth; - wxCoord margin = IsVertical() ? m_xMargin : m_yMargin; - wxCoord *pCur = IsVertical() ? &y : &x; - - // calculate the positions of all elements - for ( wxToolBarToolsList::compatibility_iterator node = m_tools.GetFirst(); - node; - node = node->GetNext() ) - { - wxButtonToolBarTool *tool = (wxButtonToolBarTool *) node->GetData(); - - tool->m_x = x; - tool->m_y = y; - - if (tool->IsButton()) - { - if (!tool->GetButton()) - { - wxBitmapButton* bmpButton = new wxBitmapButton(this, tool->GetId(), tool->GetNormalBitmap(), wxPoint(tool->m_x, tool->m_y), wxDefaultSize, - wxBU_AUTODRAW|wxBORDER_NONE); - if (!tool->GetShortHelp().empty()) - bmpButton->SetLabel(tool->GetShortHelp()); - - tool->SetButton(bmpButton); - } - else - { - tool->GetButton()->Move(wxPoint(tool->m_x, tool->m_y)); - } - - int w = widthTool; - if (tool->GetButton()) - { - wxSize sz = tool->GetButton()->GetSize(); - w = sz.x; - - if (m_labelHeight > 0) - { - sz.y += (m_labelHeight + m_labelMargin); - - if (!tool->GetShortHelp().empty()) - { - wxClientDC dc(this); - dc.SetFont(GetFont()); - int tw, th; - dc.GetTextExtent(tool->GetShortHelp(), & tw, & th); - - // If the label is bigger than the icon, the label width - // becomes the new tool width, and we need to centre the - // the bitmap in this box. - if (tw > sz.x) - { - int newX = int(tool->m_x + (tw - sz.x)/2.0); - tool->GetButton()->Move(newX, tool->m_y); - sz.x = tw; - } - } - } - - maxHeight = wxMax(maxHeight, sz.y); - - tool->m_width = sz.x; - tool->m_height = sz.y; - w = sz.x; - } - - *pCur += (w + GetToolPacking()); - } - else if (tool->IsSeparator()) - { - *pCur += m_widthSeparator; - } - else if (!IsVertical()) // horizontal control - { - wxControl *control = tool->GetControl(); - wxSize size = control->GetSize(); - tool->m_y += (m_defaultHeight - size.y)/2; - tool->m_width = size.x; - tool->m_height = size.y; - - *pCur += tool->m_width; - - maxHeight = wxMax(maxHeight, size.y); - } - *pCur += margin; - } - - // calculate the total toolbar size - m_maxWidth = x + 2*m_xMargin; - m_maxHeight = maxHeight + 2*m_yMargin; - - if ((GetWindowStyle() & wxTB_NODIVIDER) == 0) - m_maxHeight += 2; - -} - -wxSize wxButtonToolBar::DoGetBestClientSize() const -{ - return wxSize(m_maxWidth, m_maxHeight); -} - -// receives button commands -void wxButtonToolBar::OnCommand(wxCommandEvent& event) -{ - wxButtonToolBarTool* tool = (wxButtonToolBarTool*) FindById(event.GetId()); - if (!tool) - { - event.Skip(); - return; - } - - if (tool->CanBeToggled()) - tool->Toggle(tool->IsToggled()); - - // TODO: handle toggle items - OnLeftClick(event.GetId(), false); - - if (tool->GetKind() == wxITEM_RADIO) - UnToggleRadioGroup(tool); - - if (tool->CanBeToggled()) - Refresh(); -} - -// paints a border -void wxButtonToolBar::OnPaint(wxPaintEvent& event) -{ - wxPaintDC dc(this); - - dc.SetFont(GetFont()); - dc.SetBackgroundMode(wxTRANSPARENT); - - for ( wxToolBarToolsList::compatibility_iterator node = m_tools.GetFirst(); - node; - node = node->GetNext() ) - { - wxButtonToolBarTool *tool = (wxButtonToolBarTool*) node->GetData(); - wxRect rectTool = GetToolRect(tool); - if (tool->IsToggled()) - { - wxRect backgroundRect = rectTool; - backgroundRect.y = -1; backgroundRect.height = GetClientSize().y + 1; - wxBrush brush(wxColour(219, 219, 219)); - wxPen pen(wxColour(159, 159, 159)); - dc.SetBrush(brush); - dc.SetPen(pen); - dc.DrawRectangle(backgroundRect); - } - - if (m_labelHeight > 0 && !tool->GetShortHelp().empty()) - { - int tw, th; - dc.GetTextExtent(tool->GetShortHelp(), & tw, & th); - - int x = tool->m_x; - dc.DrawText(tool->GetShortHelp(), x, tool->m_y + tool->GetButton()->GetSize().y + m_labelMargin); - } - } - - if ((GetWindowStyle() & wxTB_NODIVIDER) == 0) - { - wxPen pen(wxColour(159, 159, 159)); - dc.SetPen(pen); - int x1 = 0; - int y1 = GetClientSize().y-1; - int x2 = GetClientSize().x; - int y2 = y1; - dc.DrawLine(x1, y1, x2, y2); - } -} - -// detects mouse clicks outside buttons -void wxButtonToolBar::OnLeftUp(wxMouseEvent& event) -{ - if (m_labelHeight > 0) - { - wxButtonToolBarTool* tool = (wxButtonToolBarTool*) FindToolForPosition(event.GetX(), event.GetY()); - if (tool && tool->GetButton() && (event.GetY() > (tool->m_y + tool->GetButton()->GetSize().y))) - { - wxCommandEvent event(wxEVT_COMMAND_BUTTON_CLICKED, tool->GetId()); - event.SetEventObject(tool->GetButton()); - if (!ProcessEvent(event)) - event.Skip(); - } - } -} - -#endif // wxUSE_TOOLBAR && wxUSE_BMPBUTTON diff --git a/wxWidgets/src/generic/calctrl.cpp b/wxWidgets/src/generic/calctrl.cpp deleted file mode 100644 index 44cb11a91d..0000000000 --- a/wxWidgets/src/generic/calctrl.cpp +++ /dev/null @@ -1,1838 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: src/generic/calctrl.cpp -// Purpose: implementation fo the generic wxCalendarCtrl -// Author: Vadim Zeitlin -// Modified by: -// Created: 29.12.99 -// RCS-ID: $Id: calctrl.cpp 53987 2008-06-05 15:48:55Z VZ $ -// Copyright: (c) 1999 Vadim Zeitlin -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#ifndef WX_PRECOMP - #include "wx/dcclient.h" - #include "wx/settings.h" - #include "wx/brush.h" - #include "wx/combobox.h" - #include "wx/listbox.h" - #include "wx/stattext.h" - #include "wx/textctrl.h" -#endif //WX_PRECOMP - -#if wxUSE_CALENDARCTRL - -#include "wx/spinctrl.h" - -// if wxDatePickerCtrl code doesn't define the date event, do it here as we -// need it as well -#if !wxUSE_DATEPICKCTRL - #define _WX_DEFINE_DATE_EVENTS_ -#endif - -#include "wx/calctrl.h" - -#define DEBUG_PAINT 0 - -// ---------------------------------------------------------------------------- -// wxWin macros -// ---------------------------------------------------------------------------- - -BEGIN_EVENT_TABLE(wxCalendarCtrl, wxControl) - EVT_PAINT(wxCalendarCtrl::OnPaint) - - EVT_CHAR(wxCalendarCtrl::OnChar) - - EVT_LEFT_DOWN(wxCalendarCtrl::OnClick) - EVT_LEFT_DCLICK(wxCalendarCtrl::OnDClick) - - EVT_SYS_COLOUR_CHANGED(wxCalendarCtrl::OnSysColourChanged) -END_EVENT_TABLE() - -#if wxUSE_EXTENDED_RTTI -WX_DEFINE_FLAGS( wxCalendarCtrlStyle ) - -wxBEGIN_FLAGS( wxCalendarCtrlStyle ) - // new style border flags, we put them first to - // use them for streaming out - wxFLAGS_MEMBER(wxBORDER_SIMPLE) - wxFLAGS_MEMBER(wxBORDER_SUNKEN) - wxFLAGS_MEMBER(wxBORDER_DOUBLE) - wxFLAGS_MEMBER(wxBORDER_RAISED) - wxFLAGS_MEMBER(wxBORDER_STATIC) - wxFLAGS_MEMBER(wxBORDER_NONE) - - // old style border flags - wxFLAGS_MEMBER(wxSIMPLE_BORDER) - wxFLAGS_MEMBER(wxSUNKEN_BORDER) - wxFLAGS_MEMBER(wxDOUBLE_BORDER) - wxFLAGS_MEMBER(wxRAISED_BORDER) - wxFLAGS_MEMBER(wxSTATIC_BORDER) - wxFLAGS_MEMBER(wxBORDER) - - // standard window styles - wxFLAGS_MEMBER(wxTAB_TRAVERSAL) - wxFLAGS_MEMBER(wxCLIP_CHILDREN) - wxFLAGS_MEMBER(wxTRANSPARENT_WINDOW) - wxFLAGS_MEMBER(wxWANTS_CHARS) - wxFLAGS_MEMBER(wxFULL_REPAINT_ON_RESIZE) - wxFLAGS_MEMBER(wxALWAYS_SHOW_SB ) - wxFLAGS_MEMBER(wxVSCROLL) - wxFLAGS_MEMBER(wxHSCROLL) - - wxFLAGS_MEMBER(wxCAL_SUNDAY_FIRST) - wxFLAGS_MEMBER(wxCAL_MONDAY_FIRST) - wxFLAGS_MEMBER(wxCAL_SHOW_HOLIDAYS) - wxFLAGS_MEMBER(wxCAL_NO_YEAR_CHANGE) - wxFLAGS_MEMBER(wxCAL_NO_MONTH_CHANGE) - wxFLAGS_MEMBER(wxCAL_SEQUENTIAL_MONTH_SELECTION) - wxFLAGS_MEMBER(wxCAL_SHOW_SURROUNDING_WEEKS) - -wxEND_FLAGS( wxCalendarCtrlStyle ) - -IMPLEMENT_DYNAMIC_CLASS_XTI(wxCalendarCtrl, wxControl,"wx/calctrl.h") - -wxBEGIN_PROPERTIES_TABLE(wxCalendarCtrl) - wxEVENT_RANGE_PROPERTY( Updated , wxEVT_CALENDAR_SEL_CHANGED , wxEVT_CALENDAR_WEEKDAY_CLICKED , wxCalendarEvent ) - wxHIDE_PROPERTY( Children ) - wxPROPERTY( Date,wxDateTime, SetDate , GetDate, , 0 /*flags*/ , wxT("Helpstring") , wxT("group")) - wxPROPERTY_FLAGS( WindowStyle , wxCalendarCtrlStyle , long , SetWindowStyleFlag , GetWindowStyleFlag , , 0 /*flags*/ , wxT("Helpstring") , wxT("group")) // style -wxEND_PROPERTIES_TABLE() - -wxBEGIN_HANDLERS_TABLE(wxCalendarCtrl) -wxEND_HANDLERS_TABLE() - -wxCONSTRUCTOR_6( wxCalendarCtrl , wxWindow* , Parent , wxWindowID , Id , wxDateTime , Date , wxPoint , Position , wxSize , Size , long , WindowStyle ) -#else -IMPLEMENT_DYNAMIC_CLASS(wxCalendarCtrl, wxControl) -#endif -IMPLEMENT_DYNAMIC_CLASS(wxCalendarEvent, wxDateEvent) - -// ---------------------------------------------------------------------------- -// events -// ---------------------------------------------------------------------------- - -DEFINE_EVENT_TYPE(wxEVT_CALENDAR_SEL_CHANGED) -DEFINE_EVENT_TYPE(wxEVT_CALENDAR_DAY_CHANGED) -DEFINE_EVENT_TYPE(wxEVT_CALENDAR_MONTH_CHANGED) -DEFINE_EVENT_TYPE(wxEVT_CALENDAR_YEAR_CHANGED) -DEFINE_EVENT_TYPE(wxEVT_CALENDAR_DOUBLECLICKED) -DEFINE_EVENT_TYPE(wxEVT_CALENDAR_WEEKDAY_CLICKED) - -// ============================================================================ -// implementation -// ============================================================================ - -// ---------------------------------------------------------------------------- -// wxCalendarCtrl -// ---------------------------------------------------------------------------- - -wxCalendarCtrl::wxCalendarCtrl(wxWindow *parent, - wxWindowID id, - const wxDateTime& date, - const wxPoint& pos, - const wxSize& size, - long style, - const wxString& name) -{ - Init(); - - (void)Create(parent, id, date, pos, size, style, name); -} - -void wxCalendarCtrl::Init() -{ - m_comboMonth = NULL; - m_spinYear = NULL; - m_staticYear = NULL; - m_staticMonth = NULL; - - m_userChangedYear = false; - - m_widthCol = - m_heightRow = 0; - - wxDateTime::WeekDay wd; - for ( wd = wxDateTime::Sun; wd < wxDateTime::Inv_WeekDay; wxNextWDay(wd) ) - { - m_weekdays[wd] = wxDateTime::GetWeekDayName(wd, wxDateTime::Name_Abbr); - } - - for ( size_t n = 0; n < WXSIZEOF(m_attrs); n++ ) - { - m_attrs[n] = NULL; - } - - InitColours(); -} - -void wxCalendarCtrl::InitColours() -{ - m_colHighlightFg = wxSystemSettings::GetColour(wxSYS_COLOUR_HIGHLIGHTTEXT); - m_colHighlightBg = wxSystemSettings::GetColour(wxSYS_COLOUR_HIGHLIGHT); - m_colBackground = wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW); - m_colSorrounding = wxSystemSettings::GetColour(wxSYS_COLOUR_GRAYTEXT); - - m_colHolidayFg = *wxRED; - // don't set m_colHolidayBg - by default, same as our bg colour - - m_colHeaderFg = *wxBLUE; - m_colHeaderBg = *wxLIGHT_GREY; -} - -bool wxCalendarCtrl::Create(wxWindow *parent, - wxWindowID id, - const wxDateTime& date, - const wxPoint& pos, - const wxSize& size, - long style, - const wxString& name) -{ - if ( !wxControl::Create(parent, id, pos, size, - style | wxCLIP_CHILDREN | wxWANTS_CHARS | wxFULL_REPAINT_ON_RESIZE, - wxDefaultValidator, name) ) - { - return false; - } - - // needed to get the arrow keys normally used for the dialog navigation - SetWindowStyle(style | wxWANTS_CHARS); - - m_date = date.IsValid() ? date : wxDateTime::Today(); - - m_lowdate = wxDefaultDateTime; - m_highdate = wxDefaultDateTime; - - if ( !HasFlag(wxCAL_SEQUENTIAL_MONTH_SELECTION) ) - { - CreateYearSpinCtrl(); - m_staticYear = new wxStaticText(GetParent(), wxID_ANY, m_date.Format(_T("%Y")), - wxDefaultPosition, wxDefaultSize, - wxALIGN_CENTRE); - - CreateMonthComboBox(); - m_staticMonth = new wxStaticText(GetParent(), wxID_ANY, m_date.Format(_T("%B")), - wxDefaultPosition, wxDefaultSize, - wxALIGN_CENTRE); - } - - ShowCurrentControls(); - - // we need to set the position as well because the main control position - // is not the same as the one specified in pos if we have the controls - // above it - SetInitialSize(size); - SetPosition(pos); - - // Since we don't paint the whole background make sure that the platform - // will use the right one. - SetBackgroundColour(m_colBackground); - - SetHolidayAttrs(); - - return true; -} - -wxCalendarCtrl::~wxCalendarCtrl() -{ - for ( size_t n = 0; n < WXSIZEOF(m_attrs); n++ ) - { - delete m_attrs[n]; - } - - if ( !HasFlag(wxCAL_SEQUENTIAL_MONTH_SELECTION) ) - { - delete m_comboMonth; - delete m_staticMonth; - delete m_spinYear; - delete m_staticYear; - } -} - -void wxCalendarCtrl::SetWindowStyleFlag(long style) -{ - // changing this style doesn't work because the controls are not - // created/shown/hidden accordingly - wxASSERT_MSG( (style & wxCAL_SEQUENTIAL_MONTH_SELECTION) == - (m_windowStyle & wxCAL_SEQUENTIAL_MONTH_SELECTION), - _T("wxCAL_SEQUENTIAL_MONTH_SELECTION can't be changed after creation") ); - - wxControl::SetWindowStyleFlag(style); -} - -// ---------------------------------------------------------------------------- -// Create the wxComboBox and wxSpinCtrl -// ---------------------------------------------------------------------------- - -void wxCalendarCtrl::CreateMonthComboBox() -{ - m_comboMonth = new wxComboBox(GetParent(), wxID_ANY, - wxEmptyString, - wxDefaultPosition, - wxDefaultSize, - 0, NULL, - wxCB_READONLY | wxCLIP_SIBLINGS); - - wxDateTime::Month m; - for ( m = wxDateTime::Jan; m < wxDateTime::Inv_Month; wxNextMonth(m) ) - { - m_comboMonth->Append(wxDateTime::GetMonthName(m)); - } - - m_comboMonth->SetSelection(GetDate().GetMonth()); - m_comboMonth->SetSize(wxDefaultCoord, - wxDefaultCoord, - wxDefaultCoord, - wxDefaultCoord, - wxSIZE_AUTO_WIDTH|wxSIZE_AUTO_HEIGHT); - - m_comboMonth->Connect(m_comboMonth->GetId(), wxEVT_COMMAND_COMBOBOX_SELECTED, - wxCommandEventHandler(wxCalendarCtrl::OnMonthChange), - NULL, this); -} - -void wxCalendarCtrl::CreateYearSpinCtrl() -{ - m_spinYear = new wxSpinCtrl(GetParent(), wxID_ANY, - GetDate().Format(_T("%Y")), - wxDefaultPosition, - wxDefaultSize, - wxSP_ARROW_KEYS | wxCLIP_SIBLINGS, - -4300, 10000, GetDate().GetYear()); - - m_spinYear->Connect(m_spinYear->GetId(), wxEVT_COMMAND_TEXT_UPDATED, - wxCommandEventHandler(wxCalendarCtrl::OnYearTextChange), - NULL, this); - - m_spinYear->Connect(m_spinYear->GetId(), wxEVT_COMMAND_SPINCTRL_UPDATED, - wxCommandEventHandler(wxCalendarCtrl::OnYearChange), - NULL, this); -} - -// ---------------------------------------------------------------------------- -// forward wxWin functions to subcontrols -// ---------------------------------------------------------------------------- - -bool wxCalendarCtrl::Destroy() -{ - if ( m_staticYear ) - m_staticYear->Destroy(); - if ( m_spinYear ) - m_spinYear->Destroy(); - if ( m_comboMonth ) - m_comboMonth->Destroy(); - if ( m_staticMonth ) - m_staticMonth->Destroy(); - - m_staticYear = NULL; - m_spinYear = NULL; - m_comboMonth = NULL; - m_staticMonth = NULL; - - return wxControl::Destroy(); -} - -bool wxCalendarCtrl::Show(bool show) -{ - if ( !wxControl::Show(show) ) - { - return false; - } - - if ( !(GetWindowStyle() & wxCAL_SEQUENTIAL_MONTH_SELECTION) ) - { - if ( GetMonthControl() ) - { - GetMonthControl()->Show(show); - GetYearControl()->Show(show); - } - } - - return true; -} - -bool wxCalendarCtrl::Enable(bool enable) -{ - if ( !wxControl::Enable(enable) ) - { - return false; - } - - if ( !(GetWindowStyle() & wxCAL_SEQUENTIAL_MONTH_SELECTION) ) - { - GetMonthControl()->Enable(enable); - GetYearControl()->Enable(enable); - } - - return true; -} - -// ---------------------------------------------------------------------------- -// enable/disable month/year controls -// ---------------------------------------------------------------------------- - -void wxCalendarCtrl::ShowCurrentControls() -{ - if ( !HasFlag(wxCAL_SEQUENTIAL_MONTH_SELECTION) ) - { - if ( AllowMonthChange() ) - { - m_comboMonth->Show(); - m_staticMonth->Hide(); - - if ( AllowYearChange() ) - { - m_spinYear->Show(); - m_staticYear->Hide(); - - // skip the rest - return; - } - } - else - { - m_comboMonth->Hide(); - m_staticMonth->Show(); - } - - // year change not allowed here - m_spinYear->Hide(); - m_staticYear->Show(); - } - //else: these controls are not even created, don't show/hide them -} - -wxControl *wxCalendarCtrl::GetMonthControl() const -{ - return AllowMonthChange() ? (wxControl *)m_comboMonth : (wxControl *)m_staticMonth; -} - -wxControl *wxCalendarCtrl::GetYearControl() const -{ - return AllowYearChange() ? (wxControl *)m_spinYear : (wxControl *)m_staticYear; -} - -void wxCalendarCtrl::EnableYearChange(bool enable) -{ - if ( enable != AllowYearChange() ) - { - long style = GetWindowStyle(); - if ( enable ) - style &= ~wxCAL_NO_YEAR_CHANGE; - else - style |= wxCAL_NO_YEAR_CHANGE; - SetWindowStyle(style); - - ShowCurrentControls(); - if ( GetWindowStyle() & wxCAL_SEQUENTIAL_MONTH_SELECTION ) - { - Refresh(); - } - } -} - -void wxCalendarCtrl::EnableMonthChange(bool enable) -{ - if ( enable != AllowMonthChange() ) - { - long style = GetWindowStyle(); - if ( enable ) - style &= ~wxCAL_NO_MONTH_CHANGE; - else - style |= wxCAL_NO_MONTH_CHANGE; - SetWindowStyle(style); - - ShowCurrentControls(); - if ( GetWindowStyle() & wxCAL_SEQUENTIAL_MONTH_SELECTION ) - { - Refresh(); - } - } -} - -// ---------------------------------------------------------------------------- -// changing date -// ---------------------------------------------------------------------------- - -bool wxCalendarCtrl::SetDate(const wxDateTime& date) -{ - bool retval = true; - - bool sameMonth = m_date.GetMonth() == date.GetMonth(), - sameYear = m_date.GetYear() == date.GetYear(); - - if ( IsDateInRange(date) ) - { - if ( sameMonth && sameYear ) - { - // just change the day - ChangeDay(date); - } - else - { - if ( AllowMonthChange() && (AllowYearChange() || sameYear) ) - { - // change everything - m_date = date; - - if ( !(GetWindowStyle() & wxCAL_SEQUENTIAL_MONTH_SELECTION) ) - { - // update the controls - m_comboMonth->SetSelection(m_date.GetMonth()); - - if ( AllowYearChange() ) - { - if ( !m_userChangedYear ) - m_spinYear->SetValue(m_date.Format(_T("%Y"))); - } - } - - // as the month changed, holidays did too - SetHolidayAttrs(); - - // update the calendar - Refresh(); - } - else - { - // forbidden - retval = false; - } - } - } - - m_userChangedYear = false; - - return retval; -} - -void wxCalendarCtrl::ChangeDay(const wxDateTime& date) -{ - if ( m_date != date ) - { - // we need to refresh the row containing the old date and the one - // containing the new one - wxDateTime dateOld = m_date; - m_date = date; - - RefreshDate(dateOld); - - // if the date is in the same row, it was already drawn correctly - if ( GetWeek(m_date) != GetWeek(dateOld) ) - { - RefreshDate(m_date); - } - } -} - -void wxCalendarCtrl::SetDateAndNotify(const wxDateTime& date) -{ - wxDateTime::Tm tm1 = m_date.GetTm(), - tm2 = date.GetTm(); - - wxEventType type; - if ( tm1.year != tm2.year ) - type = wxEVT_CALENDAR_YEAR_CHANGED; - else if ( tm1.mon != tm2.mon ) - type = wxEVT_CALENDAR_MONTH_CHANGED; - else if ( tm1.mday != tm2.mday ) - type = wxEVT_CALENDAR_DAY_CHANGED; - else - return; - - if ( SetDate(date) ) - { - GenerateEvents(type, wxEVT_CALENDAR_SEL_CHANGED); - } -} - -// ---------------------------------------------------------------------------- -// date range -// ---------------------------------------------------------------------------- - -bool wxCalendarCtrl::SetLowerDateLimit(const wxDateTime& date /* = wxDefaultDateTime */) -{ - bool retval = true; - - if ( !(date.IsValid()) || ( ( m_highdate.IsValid() ) ? ( date <= m_highdate ) : true ) ) - { - m_lowdate = date; - } - else - { - retval = false; - } - - return retval; -} - -bool wxCalendarCtrl::SetUpperDateLimit(const wxDateTime& date /* = wxDefaultDateTime */) -{ - bool retval = true; - - if ( !(date.IsValid()) || ( ( m_lowdate.IsValid() ) ? ( date >= m_lowdate ) : true ) ) - { - m_highdate = date; - } - else - { - retval = false; - } - - return retval; -} - -bool wxCalendarCtrl::SetDateRange(const wxDateTime& lowerdate /* = wxDefaultDateTime */, const wxDateTime& upperdate /* = wxDefaultDateTime */) -{ - bool retval = true; - - if ( - ( !( lowerdate.IsValid() ) || ( ( upperdate.IsValid() ) ? ( lowerdate <= upperdate ) : true ) ) && - ( !( upperdate.IsValid() ) || ( ( lowerdate.IsValid() ) ? ( upperdate >= lowerdate ) : true ) ) ) - { - m_lowdate = lowerdate; - m_highdate = upperdate; - } - else - { - retval = false; - } - - return retval; -} - -// ---------------------------------------------------------------------------- -// date helpers -// ---------------------------------------------------------------------------- - -wxDateTime wxCalendarCtrl::GetStartDate() const -{ - wxDateTime::Tm tm = m_date.GetTm(); - - wxDateTime date = wxDateTime(1, tm.mon, tm.year); - - // rewind back - date.SetToPrevWeekDay(GetWindowStyle() & wxCAL_MONDAY_FIRST - ? wxDateTime::Mon : wxDateTime::Sun); - - if ( GetWindowStyle() & wxCAL_SHOW_SURROUNDING_WEEKS ) - { - // We want to offset the calendar if we start on the first.. - if ( date.GetDay() == 1 ) - { - date -= wxDateSpan::Week(); - } - } - - return date; -} - -bool wxCalendarCtrl::IsDateShown(const wxDateTime& date) const -{ - if ( !(GetWindowStyle() & wxCAL_SHOW_SURROUNDING_WEEKS) ) - { - return date.GetMonth() == m_date.GetMonth(); - } - else - { - return true; - } -} - -bool wxCalendarCtrl::IsDateInRange(const wxDateTime& date) const -{ - // Check if the given date is in the range specified - return ( ( ( m_lowdate.IsValid() ) ? ( date >= m_lowdate ) : true ) - && ( ( m_highdate.IsValid() ) ? ( date <= m_highdate ) : true ) ); -} - -bool wxCalendarCtrl::ChangeYear(wxDateTime* target) const -{ - bool retval = false; - - if ( !(IsDateInRange(*target)) ) - { - if ( target->GetYear() < m_date.GetYear() ) - { - if ( target->GetYear() >= GetLowerDateLimit().GetYear() ) - { - *target = GetLowerDateLimit(); - retval = true; - } - else - { - *target = m_date; - } - } - else - { - if ( target->GetYear() <= GetUpperDateLimit().GetYear() ) - { - *target = GetUpperDateLimit(); - retval = true; - } - else - { - *target = m_date; - } - } - } - else - { - retval = true; - } - - return retval; -} - -bool wxCalendarCtrl::ChangeMonth(wxDateTime* target) const -{ - bool retval = true; - - if ( !(IsDateInRange(*target)) ) - { - retval = false; - - if ( target->GetMonth() < m_date.GetMonth() ) - { - *target = GetLowerDateLimit(); - } - else - { - *target = GetUpperDateLimit(); - } - } - - return retval; -} - -size_t wxCalendarCtrl::GetWeek(const wxDateTime& date) const -{ - size_t retval = date.GetWeekOfMonth(GetWindowStyle() & wxCAL_MONDAY_FIRST - ? wxDateTime::Monday_First - : wxDateTime::Sunday_First); - - if ( (GetWindowStyle() & wxCAL_SHOW_SURROUNDING_WEEKS) ) - { - // we need to offset an extra week if we "start" on the 1st of the month - wxDateTime::Tm tm = date.GetTm(); - - wxDateTime datetest = wxDateTime(1, tm.mon, tm.year); - - // rewind back - datetest.SetToPrevWeekDay(GetWindowStyle() & wxCAL_MONDAY_FIRST - ? wxDateTime::Mon : wxDateTime::Sun); - - if ( datetest.GetDay() == 1 ) - { - retval += 1; - } - } - - return retval; -} - -// ---------------------------------------------------------------------------- -// size management -// ---------------------------------------------------------------------------- - -// this is a composite control and it must arrange its parts each time its -// size or position changes: the combobox and spinctrl are along the top of -// the available area and the calendar takes up therest of the space - -// the static controls are supposed to be always smaller than combo/spin so we -// always use the latter for size calculations and position the static to take -// the same space - -// the constants used for the layout -#define VERT_MARGIN 5 // distance between combo and calendar -#ifdef __WXMAC__ -#define HORZ_MARGIN 5 // spin -#else -#define HORZ_MARGIN 15 // spin -#endif -wxSize wxCalendarCtrl::DoGetBestSize() const -{ - // calc the size of the calendar - ((wxCalendarCtrl *)this)->RecalcGeometry(); // const_cast - - wxCoord width = 7*m_widthCol, - height = 7*m_heightRow + m_rowOffset + VERT_MARGIN; - - if ( !HasFlag(wxCAL_SEQUENTIAL_MONTH_SELECTION) ) - { - // the combobox doesn't report its height correctly (it returns the - // height including the drop down list) so don't use it - height += m_spinYear->GetBestSize().y; - - - wxCoord w2 = m_comboMonth->GetBestSize().x + HORZ_MARGIN + GetCharWidth()*6; - if (width < w2) - width = w2; - } - - if ( !HasFlag(wxBORDER_NONE) ) - { - // the border would clip the last line otherwise - height += 6; - width += 4; - } - - wxSize best(width, height); - CacheBestSize(best); - return best; -} - -void wxCalendarCtrl::DoSetSize(int x, int y, - int width, int height, - int sizeFlags) -{ - wxControl::DoSetSize(x, y, width, height, sizeFlags); -} - -void wxCalendarCtrl::DoMoveWindow(int x, int y, int width, int height) -{ - int yDiff; - - if ( !HasFlag(wxCAL_SEQUENTIAL_MONTH_SELECTION) && m_staticMonth ) - { - wxSize sizeCombo = m_comboMonth->GetEffectiveMinSize(); - wxSize sizeStatic = m_staticMonth->GetSize(); - wxSize sizeSpin = m_spinYear->GetSize(); - - // wxMSW sometimes reports the wrong combo height, - // so on this platform we'll use the spin control - // height instead. -#ifdef __WXMSW__ - int maxHeight = sizeSpin.y; - int requiredSpinHeight = -1; -#else - int maxHeight = sizeCombo.y; - int requiredSpinHeight = sizeCombo.y; -#endif - int dy = (maxHeight - sizeStatic.y) / 2; - m_comboMonth->Move(x, y); - m_staticMonth->SetSize(x, y + dy, sizeCombo.x, -1, sizeStatic.y); - - int xDiff = sizeCombo.x + HORZ_MARGIN; - - m_spinYear->SetSize(x + xDiff, y, width - xDiff, requiredSpinHeight); - m_staticYear->SetSize(x + xDiff, y + dy, width - xDiff, sizeStatic.y); - - yDiff = wxMax(sizeSpin.y, maxHeight) + VERT_MARGIN; - } - else // no controls on the top - { - yDiff = 0; - } - - wxControl::DoMoveWindow(x, y + yDiff, width, height - yDiff); -} - -void wxCalendarCtrl::DoGetPosition(int *x, int *y) const -{ - wxControl::DoGetPosition(x, y); -#ifndef __WXPM__ - if ( !HasFlag(wxCAL_SEQUENTIAL_MONTH_SELECTION) && GetMonthControl() ) - { - // our real top corner is not in this position - if ( y ) - { - *y -= GetMonthControl()->GetSize().y + VERT_MARGIN; - } - } -#endif -} - -void wxCalendarCtrl::DoGetSize(int *width, int *height) const -{ - wxControl::DoGetSize(width, height); -#ifndef __WXPM__ - if ( !HasFlag(wxCAL_SEQUENTIAL_MONTH_SELECTION) ) - { - // our real height is bigger - if ( height && GetMonthControl()) - { - *height += GetMonthControl()->GetSize().y + VERT_MARGIN; - } - } -#endif -} - -void wxCalendarCtrl::RecalcGeometry() -{ - wxClientDC dc(this); - - dc.SetFont(GetFont()); - - // determine the column width (weekday names are not necessarily wider - // than the numbers (in some languages), so let's not assume that they are) - m_widthCol = 0; - for ( int day = 10; day <= 31; day++) - { - wxCoord width; - dc.GetTextExtent(wxString::Format(wxT("%d"), day), &width, &m_heightRow); - if ( width > m_widthCol ) - { - // 1.5 times the width gives nice margins even if the weekday - // names are short - m_widthCol = width+width/2; - } - } - wxDateTime::WeekDay wd; - for ( wd = wxDateTime::Sun; wd < wxDateTime::Inv_WeekDay; wxNextWDay(wd) ) - { - wxCoord width; - dc.GetTextExtent(m_weekdays[wd], &width, &m_heightRow); - if ( width > m_widthCol ) - { - m_widthCol = width; - } - } - - // leave some margins - m_widthCol += 2; - m_heightRow += 2; - - m_rowOffset = HasFlag(wxCAL_SEQUENTIAL_MONTH_SELECTION) ? m_heightRow : 0; // conditional in relation to style -} - -// ---------------------------------------------------------------------------- -// drawing -// ---------------------------------------------------------------------------- - -void wxCalendarCtrl::OnPaint(wxPaintEvent& WXUNUSED(event)) -{ - wxPaintDC dc(this); - - dc.SetFont(GetFont()); - - RecalcGeometry(); - -#if DEBUG_PAINT - wxLogDebug("--- starting to paint, selection: %s, week %u\n", - m_date.Format("%a %d-%m-%Y %H:%M:%S").c_str(), - GetWeek(m_date)); -#endif - - wxCoord y = 0; - wxCoord x0 = wxMax( (GetSize().x - m_widthCol*7) /2 , 0 ); - - if ( HasFlag(wxCAL_SEQUENTIAL_MONTH_SELECTION) ) - { - // draw the sequential month-selector - - dc.SetBackgroundMode(wxTRANSPARENT); - dc.SetTextForeground(*wxBLACK); - dc.SetBrush(wxBrush(m_colHeaderBg, wxSOLID)); - dc.SetPen(wxPen(m_colHeaderBg, 1, wxSOLID)); - dc.DrawRectangle(0, y, GetClientSize().x, m_heightRow); - - // Get extent of month-name + year - wxCoord monthw, monthh; - wxString headertext = m_date.Format(wxT("%B %Y")); - dc.GetTextExtent(headertext, &monthw, &monthh); - - // draw month-name centered above weekdays - wxCoord monthx = ((m_widthCol * 7) - monthw) / 2 + x0; - wxCoord monthy = ((m_heightRow - monthh) / 2) + y; - dc.DrawText(headertext, monthx, monthy); - - // calculate the "month-arrows" - wxPoint leftarrow[3]; - wxPoint rightarrow[3]; - - int arrowheight = monthh / 2; - - leftarrow[0] = wxPoint(0, arrowheight / 2); - leftarrow[1] = wxPoint(arrowheight / 2, 0); - leftarrow[2] = wxPoint(arrowheight / 2, arrowheight - 1); - - rightarrow[0] = wxPoint(0,0); - rightarrow[1] = wxPoint(arrowheight / 2, arrowheight / 2); - rightarrow[2] = wxPoint(0, arrowheight - 1); - - // draw the "month-arrows" - - wxCoord arrowy = (m_heightRow - arrowheight) / 2; - wxCoord larrowx = (m_widthCol - (arrowheight / 2)) / 2 + x0; - wxCoord rarrowx = ((m_widthCol - (arrowheight / 2)) / 2) + m_widthCol*6 + x0; - m_leftArrowRect = m_rightArrowRect = wxRect(0,0,0,0); - - if ( AllowMonthChange() ) - { - wxDateTime ldpm = wxDateTime(1,m_date.GetMonth(), m_date.GetYear()) - wxDateSpan::Day(); // last day prev month - // Check if range permits change - if ( IsDateInRange(ldpm) && ( ( ldpm.GetYear() == m_date.GetYear() ) ? true : AllowYearChange() ) ) - { - m_leftArrowRect = wxRect(larrowx - 3, arrowy - 3, (arrowheight / 2) + 8, (arrowheight + 6)); - dc.SetBrush(*wxBLACK_BRUSH); - dc.SetPen(*wxBLACK_PEN); - dc.DrawPolygon(3, leftarrow, larrowx , arrowy, wxWINDING_RULE); - dc.SetBrush(*wxTRANSPARENT_BRUSH); - dc.DrawRectangle(m_leftArrowRect); - } - wxDateTime fdnm = wxDateTime(1,m_date.GetMonth(), m_date.GetYear()) + wxDateSpan::Month(); // first day next month - if ( IsDateInRange(fdnm) && ( ( fdnm.GetYear() == m_date.GetYear() ) ? true : AllowYearChange() ) ) - { - m_rightArrowRect = wxRect(rarrowx - 4, arrowy - 3, (arrowheight / 2) + 8, (arrowheight + 6)); - dc.SetBrush(*wxBLACK_BRUSH); - dc.SetPen(*wxBLACK_PEN); - dc.DrawPolygon(3, rightarrow, rarrowx , arrowy, wxWINDING_RULE); - dc.SetBrush(*wxTRANSPARENT_BRUSH); - dc.DrawRectangle(m_rightArrowRect); - } - } - - y += m_heightRow; - } - - // first draw the week days - if ( IsExposed(x0, y, x0 + 7*m_widthCol, m_heightRow) ) - { -#if DEBUG_PAINT - wxLogDebug("painting the header"); -#endif - - dc.SetBackgroundMode(wxTRANSPARENT); - dc.SetTextForeground(m_colHeaderFg); - dc.SetBrush(wxBrush(m_colHeaderBg, wxSOLID)); - dc.SetPen(wxPen(m_colHeaderBg, 1, wxSOLID)); - dc.DrawRectangle(0, y, GetClientSize().x, m_heightRow); - - bool startOnMonday = (GetWindowStyle() & wxCAL_MONDAY_FIRST) != 0; - for ( int wd = 0; wd < 7; wd++ ) - { - size_t n; - if ( startOnMonday ) - n = wd == 6 ? 0 : wd + 1; - else - n = wd; - wxCoord dayw, dayh; - dc.GetTextExtent(m_weekdays[n], &dayw, &dayh); - dc.DrawText(m_weekdays[n], x0 + (wd*m_widthCol) + ((m_widthCol- dayw) / 2), y); // center the day-name - } - } - - // then the calendar itself - dc.SetTextForeground(*wxBLACK); - //dc.SetFont(*wxNORMAL_FONT); - - y += m_heightRow; - wxDateTime date = GetStartDate(); - -#if DEBUG_PAINT - wxLogDebug("starting calendar from %s\n", - date.Format("%a %d-%m-%Y %H:%M:%S").c_str()); -#endif - - dc.SetBackgroundMode(wxSOLID); - for ( size_t nWeek = 1; nWeek <= 6; nWeek++, y += m_heightRow ) - { - // if the update region doesn't intersect this row, don't paint it - if ( !IsExposed(x0, y, x0 + 7*m_widthCol, m_heightRow - 1) ) - { - date += wxDateSpan::Week(); - - continue; - } - -#if DEBUG_PAINT - wxLogDebug("painting week %d at y = %d\n", nWeek, y); -#endif - - for ( int wd = 0; wd < 7; wd++ ) - { - dc.SetTextBackground(m_colBackground); - if ( IsDateShown(date) ) - { - // don't use wxDate::Format() which prepends 0s - unsigned int day = date.GetDay(); - wxString dayStr = wxString::Format(_T("%u"), day); - wxCoord width; - dc.GetTextExtent(dayStr, &width, (wxCoord *)NULL); - - bool changedColours = false, - changedFont = false; - - bool isSel = false; - wxCalendarDateAttr *attr = NULL; - - if ( date.GetMonth() != m_date.GetMonth() || !IsDateInRange(date) ) - { - // surrounding week or out-of-range - // draw "disabled" - dc.SetTextForeground(m_colSorrounding); - changedColours = true; - } - else - { - isSel = date.IsSameDate(m_date); - attr = m_attrs[day - 1]; - - if ( isSel ) - { - dc.SetTextForeground(m_colHighlightFg); - dc.SetTextBackground(m_colHighlightBg); - - changedColours = true; - } - else if ( attr ) - { - wxColour colFg, colBg; - - if ( attr->IsHoliday() ) - { - colFg = m_colHolidayFg; - colBg = m_colHolidayBg; - } - else - { - colFg = attr->GetTextColour(); - colBg = attr->GetBackgroundColour(); - } - - if ( colFg.Ok() ) - { - dc.SetTextForeground(colFg); - changedColours = true; - } - - if ( colBg.Ok() ) - { - dc.SetTextBackground(colBg); - changedColours = true; - } - - if ( attr->HasFont() ) - { - dc.SetFont(attr->GetFont()); - changedFont = true; - } - } - } - - wxCoord x = wd*m_widthCol + (m_widthCol - width) / 2 + x0; - dc.DrawText(dayStr, x, y + 1); - - if ( !isSel && attr && attr->HasBorder() ) - { - wxColour colBorder; - if ( attr->HasBorderColour() ) - { - colBorder = attr->GetBorderColour(); - } - else - { - colBorder = GetForegroundColour(); - } - - wxPen pen(colBorder, 1, wxSOLID); - dc.SetPen(pen); - dc.SetBrush(*wxTRANSPARENT_BRUSH); - - switch ( attr->GetBorder() ) - { - case wxCAL_BORDER_SQUARE: - dc.DrawRectangle(x - 2, y, - width + 4, m_heightRow); - break; - - case wxCAL_BORDER_ROUND: - dc.DrawEllipse(x - 2, y, - width + 4, m_heightRow); - break; - - default: - wxFAIL_MSG(_T("unknown border type")); - } - } - - if ( changedColours ) - { - dc.SetTextForeground(GetForegroundColour()); - dc.SetTextBackground(GetBackgroundColour()); - } - - if ( changedFont ) - { - dc.SetFont(GetFont()); - } - } - //else: just don't draw it - - date += wxDateSpan::Day(); - } - } - - // Greying out out-of-range background - bool showSurrounding = (GetWindowStyle() & wxCAL_SHOW_SURROUNDING_WEEKS) != 0; - - date = ( showSurrounding ) ? GetStartDate() : wxDateTime(1, m_date.GetMonth(), m_date.GetYear()); - if ( !IsDateInRange(date) ) - { - wxDateTime firstOOR = GetLowerDateLimit() - wxDateSpan::Day(); // first out-of-range - - wxBrush oorbrush = *wxLIGHT_GREY_BRUSH; - oorbrush.SetStyle(wxFDIAGONAL_HATCH); - - HighlightRange(&dc, date, firstOOR, wxTRANSPARENT_PEN, &oorbrush); - } - - date = ( showSurrounding ) ? GetStartDate() + wxDateSpan::Weeks(6) - wxDateSpan::Day() : wxDateTime().SetToLastMonthDay(m_date.GetMonth(), m_date.GetYear()); - if ( !IsDateInRange(date) ) - { - wxDateTime firstOOR = GetUpperDateLimit() + wxDateSpan::Day(); // first out-of-range - - wxBrush oorbrush = *wxLIGHT_GREY_BRUSH; - oorbrush.SetStyle(wxFDIAGONAL_HATCH); - - HighlightRange(&dc, firstOOR, date, wxTRANSPARENT_PEN, &oorbrush); - } - -#if DEBUG_PAINT - wxLogDebug("+++ finished painting"); -#endif -} - -void wxCalendarCtrl::RefreshDate(const wxDateTime& date) -{ - RecalcGeometry(); - - wxRect rect; - - // always refresh the whole row at once because our OnPaint() will draw - // the whole row anyhow - and this allows the small optimisation in - // OnClick() below to work - rect.x = wxMax( (GetSize().x - m_widthCol*7) /2 , 0 ); - - rect.y = (m_heightRow * GetWeek(date)) + m_rowOffset; - - rect.width = 7*m_widthCol; - rect.height = m_heightRow; - -#ifdef __WXMSW__ - // VZ: for some reason, the selected date seems to occupy more space under - // MSW - this is probably some bug in the font size calculations, but I - // don't know where exactly. This fix is ugly and leads to more - // refreshes than really needed, but without it the selected days - // leaves even more ugly underscores on screen. - rect.Inflate(0, 1); -#endif // MSW - -#if DEBUG_PAINT - wxLogDebug("*** refreshing week %d at (%d, %d)-(%d, %d)\n", - GetWeek(date), - rect.x, rect.y, - rect.x + rect.width, rect.y + rect.height); -#endif - - Refresh(true, &rect); -} - -void wxCalendarCtrl::HighlightRange(wxPaintDC* pDC, const wxDateTime& fromdate, const wxDateTime& todate, const wxPen* pPen, const wxBrush* pBrush) -{ - // Highlights the given range using pen and brush - // Does nothing if todate < fromdate - - -#if DEBUG_PAINT - wxLogDebug("+++ HighlightRange: (%s) - (%s) +++", fromdate.Format("%d %m %Y"), todate.Format("%d %m %Y")); -#endif - - if ( todate >= fromdate ) - { - // do stuff - // date-coordinates - int fd, fw; - int td, tw; - - // implicit: both dates must be currently shown - checked by GetDateCoord - if ( GetDateCoord(fromdate, &fd, &fw) && GetDateCoord(todate, &td, &tw) ) - { -#if DEBUG_PAINT - wxLogDebug("Highlight range: (%i, %i) - (%i, %i)", fd, fw, td, tw); -#endif - if ( ( (tw - fw) == 1 ) && ( td < fd ) ) - { - // special case: interval 7 days or less not in same week - // split in two separate intervals - wxDateTime tfd = fromdate + wxDateSpan::Days(7-fd); - wxDateTime ftd = tfd + wxDateSpan::Day(); -#if DEBUG_PAINT - wxLogDebug("Highlight: Separate segments"); -#endif - // draw separately - HighlightRange(pDC, fromdate, tfd, pPen, pBrush); - HighlightRange(pDC, ftd, todate, pPen, pBrush); - } - else - { - int numpoints; - wxPoint corners[8]; // potentially 8 corners in polygon - wxCoord x0 = wxMax( (GetSize().x - m_widthCol*7) /2 , 0 ); - - if ( fw == tw ) - { - // simple case: same week - numpoints = 4; - corners[0] = wxPoint(x0 + (fd - 1) * m_widthCol, (fw * m_heightRow) + m_rowOffset); - corners[1] = wxPoint(x0 + (fd - 1) * m_widthCol, ((fw + 1 ) * m_heightRow) + m_rowOffset); - corners[2] = wxPoint(x0 + td * m_widthCol, ((tw + 1) * m_heightRow) + m_rowOffset); - corners[3] = wxPoint(x0 + td * m_widthCol, (tw * m_heightRow) + m_rowOffset); - } - else - { - int cidx = 0; - // "complex" polygon - corners[cidx] = wxPoint(x0 + (fd - 1) * m_widthCol, (fw * m_heightRow) + m_rowOffset); cidx++; - - if ( fd > 1 ) - { - corners[cidx] = wxPoint(x0 + (fd - 1) * m_widthCol, ((fw + 1) * m_heightRow) + m_rowOffset); cidx++; - corners[cidx] = wxPoint(x0, ((fw + 1) * m_heightRow) + m_rowOffset); cidx++; - } - - corners[cidx] = wxPoint(x0, ((tw + 1) * m_heightRow) + m_rowOffset); cidx++; - corners[cidx] = wxPoint(x0 + td * m_widthCol, ((tw + 1) * m_heightRow) + m_rowOffset); cidx++; - - if ( td < 7 ) - { - corners[cidx] = wxPoint(x0 + td * m_widthCol, (tw * m_heightRow) + m_rowOffset); cidx++; - corners[cidx] = wxPoint(x0 + 7 * m_widthCol, (tw * m_heightRow) + m_rowOffset); cidx++; - } - - corners[cidx] = wxPoint(x0 + 7 * m_widthCol, (fw * m_heightRow) + m_rowOffset); cidx++; - - numpoints = cidx; - } - - // draw the polygon - pDC->SetBrush(*pBrush); - pDC->SetPen(*pPen); - pDC->DrawPolygon(numpoints, corners); - } - } - } - // else do nothing -#if DEBUG_PAINT - wxLogDebug("--- HighlightRange ---"); -#endif -} - -bool wxCalendarCtrl::GetDateCoord(const wxDateTime& date, int *day, int *week) const -{ - bool retval = true; - -#if DEBUG_PAINT - wxLogDebug("+++ GetDateCoord: (%s) +++", date.Format("%d %m %Y")); -#endif - - if ( IsDateShown(date) ) - { - bool startOnMonday = ( GetWindowStyle() & wxCAL_MONDAY_FIRST ) != 0; - - // Find day - *day = date.GetWeekDay(); - - if ( *day == 0 ) // sunday - { - *day = ( startOnMonday ) ? 7 : 1; - } - else - { - *day += ( startOnMonday ) ? 0 : 1; - } - - int targetmonth = date.GetMonth() + (12 * date.GetYear()); - int thismonth = m_date.GetMonth() + (12 * m_date.GetYear()); - - // Find week - if ( targetmonth == thismonth ) - { - *week = GetWeek(date); - } - else - { - if ( targetmonth < thismonth ) - { - *week = 1; // trivial - } - else // targetmonth > thismonth - { - wxDateTime ldcm; - int lastweek; - int lastday; - - // get the datecoord of the last day in the month currently shown -#if DEBUG_PAINT - wxLogDebug(" +++ LDOM +++"); -#endif - GetDateCoord(ldcm.SetToLastMonthDay(m_date.GetMonth(), m_date.GetYear()), &lastday, &lastweek); -#if DEBUG_PAINT - wxLogDebug(" --- LDOM ---"); -#endif - - wxTimeSpan span = date - ldcm; - - int daysfromlast = span.GetDays(); -#if DEBUG_PAINT - wxLogDebug("daysfromlast: %i", daysfromlast); -#endif - if ( daysfromlast + lastday > 7 ) // past week boundary - { - int wholeweeks = (daysfromlast / 7); - *week = wholeweeks + lastweek; - if ( (daysfromlast - (7 * wholeweeks) + lastday) > 7 ) - { - *week += 1; - } - } - else - { - *week = lastweek; - } - } - } - } - else - { - *day = -1; - *week = -1; - retval = false; - } - -#if DEBUG_PAINT - wxLogDebug("--- GetDateCoord: (%s) = (%i, %i) ---", date.Format("%d %m %Y"), *day, *week); -#endif - - return retval; -} - -// ---------------------------------------------------------------------------- -// mouse handling -// ---------------------------------------------------------------------------- - -void wxCalendarCtrl::OnDClick(wxMouseEvent& event) -{ - if ( HitTest(event.GetPosition()) != wxCAL_HITTEST_DAY ) - { - event.Skip(); - } - else - { - GenerateEvent(wxEVT_CALENDAR_DOUBLECLICKED); - } -} - -void wxCalendarCtrl::OnClick(wxMouseEvent& event) -{ - wxDateTime date; - wxDateTime::WeekDay wday; - switch ( HitTest(event.GetPosition(), &date, &wday) ) - { - case wxCAL_HITTEST_DAY: - if ( IsDateInRange(date) ) - { - ChangeDay(date); - - GenerateEvents(wxEVT_CALENDAR_DAY_CHANGED, - wxEVT_CALENDAR_SEL_CHANGED); - } - break; - - case wxCAL_HITTEST_HEADER: - { - wxCalendarEvent eventWd(this, wxEVT_CALENDAR_WEEKDAY_CLICKED); - eventWd.m_wday = wday; - (void)GetEventHandler()->ProcessEvent(eventWd); - } - break; - - case wxCAL_HITTEST_DECMONTH: - case wxCAL_HITTEST_INCMONTH: - case wxCAL_HITTEST_SURROUNDING_WEEK: - SetDateAndNotify(date); // we probably only want to refresh the control. No notification.. (maybe as an option?) - break; - - default: - wxFAIL_MSG(_T("unknown hittest code")); - // fall through - - case wxCAL_HITTEST_NOWHERE: - event.Skip(); - break; - } - - // as we don't (always) skip the message, we're not going to receive the - // focus on click by default if we don't do it ourselves - SetFocus(); -} - -wxCalendarHitTestResult wxCalendarCtrl::HitTest(const wxPoint& pos, - wxDateTime *date, - wxDateTime::WeekDay *wd) -{ - RecalcGeometry(); - - // the position where the calendar really begins - wxCoord x0 = wxMax((GetSize().x - m_widthCol*7)/2, 0); - - if ( HasFlag(wxCAL_SEQUENTIAL_MONTH_SELECTION) ) - { - // Header: month - - // we need to find out if the hit is on left arrow, on month or on right arrow - // left arrow? - if ( m_leftArrowRect.Contains(pos) ) - { - if ( date ) - { - if ( IsDateInRange(m_date - wxDateSpan::Month()) ) - { - *date = m_date - wxDateSpan::Month(); - } - else - { - *date = GetLowerDateLimit(); - } - } - - return wxCAL_HITTEST_DECMONTH; - } - - if ( m_rightArrowRect.Contains(pos) ) - { - if ( date ) - { - if ( IsDateInRange(m_date + wxDateSpan::Month()) ) - { - *date = m_date + wxDateSpan::Month(); - } - else - { - *date = GetUpperDateLimit(); - } - } - - return wxCAL_HITTEST_INCMONTH; - } - - } - - // header: week days - int wday = (pos.x - x0) / m_widthCol; - if ( pos.y < (m_heightRow + m_rowOffset) ) - { - if ( pos.y > m_rowOffset ) - { - if ( wd ) - { - if ( GetWindowStyle() & wxCAL_MONDAY_FIRST ) - { - wday = wday == 6 ? 0 : wday + 1; - } - - *wd = (wxDateTime::WeekDay)wday; - } - - return wxCAL_HITTEST_HEADER; - } - else - { - return wxCAL_HITTEST_NOWHERE; - } - } - - int week = (pos.y - (m_heightRow + m_rowOffset)) / m_heightRow; - if ( week >= 6 || wday >= 7 ) - { - return wxCAL_HITTEST_NOWHERE; - } - - wxDateTime dt = GetStartDate() + wxDateSpan::Days(7*week + wday); - - if ( IsDateShown(dt) ) - { - if ( date ) - *date = dt; - - if ( dt.GetMonth() == m_date.GetMonth() ) - { - - return wxCAL_HITTEST_DAY; - } - else - { - return wxCAL_HITTEST_SURROUNDING_WEEK; - } - } - else - { - return wxCAL_HITTEST_NOWHERE; - } -} - -// ---------------------------------------------------------------------------- -// subcontrols events handling -// ---------------------------------------------------------------------------- - -void wxCalendarCtrl::OnMonthChange(wxCommandEvent& event) -{ - wxDateTime::Tm tm = m_date.GetTm(); - - wxDateTime::Month mon = (wxDateTime::Month)event.GetInt(); - if ( tm.mday > wxDateTime::GetNumberOfDays(mon, tm.year) ) - { - tm.mday = wxDateTime::GetNumberOfDays(mon, tm.year); - } - - wxDateTime target = wxDateTime(tm.mday, mon, tm.year); - - ChangeMonth(&target); - SetDateAndNotify(target); -} - -void wxCalendarCtrl::OnYearChange(wxCommandEvent& event) -{ - int year = (int)event.GetInt(); - if ( year == INT_MIN ) - { - // invalid year in the spin control, ignore it - return; - } - - wxDateTime::Tm tm = m_date.GetTm(); - - if ( tm.mday > wxDateTime::GetNumberOfDays(tm.mon, year) ) - { - tm.mday = wxDateTime::GetNumberOfDays(tm.mon, year); - } - - wxDateTime target = wxDateTime(tm.mday, tm.mon, year); - - if ( ChangeYear(&target) ) - { - SetDateAndNotify(target); - } - else - { - // In this case we don't want to change the date. That would put us - // inside the same year but a strange number of months forward/back.. - m_spinYear->SetValue(target.GetYear()); - } -} - -void wxCalendarCtrl::OnYearTextChange(wxCommandEvent& event) -{ - SetUserChangedYear(); - OnYearChange(event); -} - -// Responds to colour changes, and passes event on to children. -void wxCalendarCtrl::OnSysColourChanged(wxSysColourChangedEvent& event) -{ - // reinit colours - InitColours(); - - // Propagate the event to the children - wxControl::OnSysColourChanged(event); - - // Redraw control area - SetBackgroundColour(m_colBackground); - Refresh(); -} - -// ---------------------------------------------------------------------------- -// keyboard interface -// ---------------------------------------------------------------------------- - -void wxCalendarCtrl::OnChar(wxKeyEvent& event) -{ - wxDateTime target; - switch ( event.GetKeyCode() ) - { - case _T('+'): - case WXK_ADD: - target = m_date + wxDateSpan::Year(); - if ( ChangeYear(&target) ) - { - SetDateAndNotify(target); - } - break; - - case _T('-'): - case WXK_SUBTRACT: - target = m_date - wxDateSpan::Year(); - if ( ChangeYear(&target) ) - { - SetDateAndNotify(target); - } - break; - - case WXK_PAGEUP: - target = m_date - wxDateSpan::Month(); - ChangeMonth(&target); - SetDateAndNotify(target); // always - break; - - case WXK_PAGEDOWN: - target = m_date + wxDateSpan::Month(); - ChangeMonth(&target); - SetDateAndNotify(target); // always - break; - - case WXK_RIGHT: - if ( event.ControlDown() ) - { - target = wxDateTime(m_date).SetToNextWeekDay( - GetWindowStyle() & wxCAL_MONDAY_FIRST - ? wxDateTime::Sun : wxDateTime::Sat); - if ( !IsDateInRange(target) ) - { - target = GetUpperDateLimit(); - } - SetDateAndNotify(target); - } - else - SetDateAndNotify(m_date + wxDateSpan::Day()); - break; - - case WXK_LEFT: - if ( event.ControlDown() ) - { - target = wxDateTime(m_date).SetToPrevWeekDay( - GetWindowStyle() & wxCAL_MONDAY_FIRST - ? wxDateTime::Mon : wxDateTime::Sun); - if ( !IsDateInRange(target) ) - { - target = GetLowerDateLimit(); - } - SetDateAndNotify(target); - } - else - SetDateAndNotify(m_date - wxDateSpan::Day()); - break; - - case WXK_UP: - SetDateAndNotify(m_date - wxDateSpan::Week()); - break; - - case WXK_DOWN: - SetDateAndNotify(m_date + wxDateSpan::Week()); - break; - - case WXK_HOME: - if ( event.ControlDown() ) - SetDateAndNotify(wxDateTime::Today()); - else - SetDateAndNotify(wxDateTime(1, m_date.GetMonth(), m_date.GetYear())); - break; - - case WXK_END: - SetDateAndNotify(wxDateTime(m_date).SetToLastMonthDay()); - break; - - case WXK_RETURN: - GenerateEvent(wxEVT_CALENDAR_DOUBLECLICKED); - break; - - default: - event.Skip(); - } -} - -// ---------------------------------------------------------------------------- -// holidays handling -// ---------------------------------------------------------------------------- - -void wxCalendarCtrl::EnableHolidayDisplay(bool display) -{ - long style = GetWindowStyle(); - if ( display ) - style |= wxCAL_SHOW_HOLIDAYS; - else - style &= ~wxCAL_SHOW_HOLIDAYS; - - SetWindowStyle(style); - - if ( display ) - SetHolidayAttrs(); - else - ResetHolidayAttrs(); - - Refresh(); -} - -void wxCalendarCtrl::SetHolidayAttrs() -{ - if ( GetWindowStyle() & wxCAL_SHOW_HOLIDAYS ) - { - ResetHolidayAttrs(); - - wxDateTime::Tm tm = m_date.GetTm(); - wxDateTime dtStart(1, tm.mon, tm.year), - dtEnd = dtStart.GetLastMonthDay(); - - wxDateTimeArray hol; - wxDateTimeHolidayAuthority::GetHolidaysInRange(dtStart, dtEnd, hol); - - size_t count = hol.GetCount(); - for ( size_t n = 0; n < count; n++ ) - { - SetHoliday(hol[n].GetDay()); - } - } -} - -void wxCalendarCtrl::SetHoliday(size_t day) -{ - wxCHECK_RET( day > 0 && day < 32, _T("invalid day in SetHoliday") ); - - wxCalendarDateAttr *attr = GetAttr(day); - if ( !attr ) - { - attr = new wxCalendarDateAttr; - } - - attr->SetHoliday(true); - - // can't use SetAttr() because it would delete this pointer - m_attrs[day - 1] = attr; -} - -void wxCalendarCtrl::ResetHolidayAttrs() -{ - for ( size_t day = 0; day < 31; day++ ) - { - if ( m_attrs[day] ) - { - m_attrs[day]->SetHoliday(false); - } - } -} - - -//static -wxVisualAttributes -wxCalendarCtrl::GetClassDefaultAttributes(wxWindowVariant variant) -{ - // Use the same color scheme as wxListBox - return wxListBox::GetClassDefaultAttributes(variant); -} - -#endif // wxUSE_CALENDARCTRL diff --git a/wxWidgets/src/generic/caret.cpp b/wxWidgets/src/generic/caret.cpp deleted file mode 100644 index e51fee59ac..0000000000 --- a/wxWidgets/src/generic/caret.cpp +++ /dev/null @@ -1,310 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: generic/caret.cpp -// Purpose: generic wxCaret class implementation -// Author: Vadim Zeitlin (original code by Robert Roebling) -// Modified by: -// Created: 25.05.99 -// RCS-ID: $Id: caret.cpp 55170 2008-08-22 10:34:32Z JS $ -// Copyright: (c) wxWidgets team -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_CARET - -#ifndef WX_PRECOMP - #include "wx/window.h" - #include "wx/dcclient.h" - #include "wx/dcmemory.h" -#endif //WX_PRECOMP - -#include "wx/caret.h" - -// ---------------------------------------------------------------------------- -// global variables for this module -// ---------------------------------------------------------------------------- - -// the blink time (common to all carets for MSW compatibility) -static int gs_blinkTime = 500; // in milliseconds - -// ============================================================================ -// implementation -// ============================================================================ - -// ---------------------------------------------------------------------------- -// timer stuff -// ---------------------------------------------------------------------------- - -wxCaretTimer::wxCaretTimer(wxCaret *caret) -{ - m_caret = caret; -} - -void wxCaretTimer::Notify() -{ - m_caret->OnTimer(); -} - -void wxCaret::OnTimer() -{ - // don't blink the caret when we don't have the focus - if ( m_hasFocus ) - Blink(); -} - -// ---------------------------------------------------------------------------- -// wxCaret static functions and data -// ---------------------------------------------------------------------------- - -int wxCaretBase::GetBlinkTime() -{ - return gs_blinkTime; -} - -void wxCaretBase::SetBlinkTime(int milliseconds) -{ - gs_blinkTime = milliseconds; -} - -// ---------------------------------------------------------------------------- -// initialization and destruction -// ---------------------------------------------------------------------------- - -void wxCaret::InitGeneric() -{ - m_hasFocus = true; - m_blinkedOut = true; -#ifndef wxHAS_CARET_USING_OVERLAYS - m_xOld = - m_yOld = -1; - m_bmpUnderCaret.Create(m_width, m_height); -#endif -} - -wxCaret::~wxCaret() -{ - if ( IsVisible() ) - { - // stop blinking - if ( m_timer.IsRunning() ) - m_timer.Stop(); - } -} - -// ---------------------------------------------------------------------------- -// showing/hiding/moving the caret (base class interface) -// ---------------------------------------------------------------------------- - -void wxCaret::DoShow() -{ - int blinkTime = GetBlinkTime(); - if ( blinkTime ) - m_timer.Start(blinkTime); - - if ( m_blinkedOut ) - Blink(); -} - -void wxCaret::DoHide() -{ - m_timer.Stop(); - - if ( !m_blinkedOut ) - { - Blink(); - } -} - -void wxCaret::DoMove() -{ -#ifdef wxHAS_CARET_USING_OVERLAYS - m_overlay.Reset(); -#endif - if ( IsVisible() ) - { - if ( !m_blinkedOut ) - { - // hide it right now and it will be shown the next time it blinks - Blink(); - - // but if the caret is not blinking, we should blink it back into - // visibility manually - if ( !m_timer.IsRunning() ) - Blink(); - } - } - //else: will be shown at the correct location when it is shown -} - -void wxCaret::DoSize() -{ - int countVisible = m_countVisible; - if (countVisible > 0) - { - m_countVisible = 0; - DoHide(); - } -#ifdef wxHAS_CARET_USING_OVERLAYS - m_overlay.Reset(); -#else - // Change bitmap size - m_bmpUnderCaret = wxBitmap(m_width, m_height); -#endif - if (countVisible > 0) - { - m_countVisible = countVisible; - DoShow(); - } -} - -// ---------------------------------------------------------------------------- -// handling the focus -// ---------------------------------------------------------------------------- - -void wxCaret::OnSetFocus() -{ - m_hasFocus = true; - - if ( IsVisible() ) - Refresh(); -} - -void wxCaret::OnKillFocus() -{ - m_hasFocus = false; - - if ( IsVisible() ) - { - // the caret must be shown - otherwise, if it is hidden now, it will - // stay so until the focus doesn't return because it won't blink any - // more - - // hide it first if it isn't hidden ... - if ( !m_blinkedOut ) - Blink(); - - // .. and show it in the new style - Blink(); - } -} - -// ---------------------------------------------------------------------------- -// drawing the caret -// ---------------------------------------------------------------------------- - -void wxCaret::Blink() -{ - m_blinkedOut = !m_blinkedOut; - - Refresh(); -} - -void wxCaret::Refresh() -{ - wxClientDC dcWin(GetWindow()); -// this is the new code, switch to 0 if this gives problems -#ifdef wxHAS_CARET_USING_OVERLAYS - wxDCOverlay dcOverlay( m_overlay, &dcWin, m_x, m_y, m_width , m_height ); - if ( m_blinkedOut ) - { - dcOverlay.Clear(); - } - else - { - DoDraw( &dcWin ); - } -#else - wxMemoryDC dcMem; - dcMem.SelectObject(m_bmpUnderCaret); - if ( m_blinkedOut ) - { - // restore the old image - dcWin.Blit(m_xOld, m_yOld, m_width, m_height, - &dcMem, 0, 0); - m_xOld = - m_yOld = -1; - } - else - { - if ( m_xOld == -1 && m_yOld == -1 ) - { - // save the part we're going to overdraw - - int x = m_x, - y = m_y; -#if defined(__WXGTK__) && !defined(__WX_DC_BLIT_FIXED__) - wxPoint pt = dcWin.GetDeviceOrigin(); - x += pt.x; - y += pt.y; -#endif // broken wxGTK wxDC::Blit - dcMem.Blit(0, 0, m_width, m_height, - &dcWin, x, y); - - m_xOld = m_x; - m_yOld = m_y; - } - //else: we already saved the image below the caret, don't do it any - // more - - // and draw the caret there - DoDraw(&dcWin); - } -#endif -} - -void wxCaret::DoDraw(wxDC *dc) -{ -#if defined(__WXGTK__) || defined(__WXMAC__) - wxClientDC* clientDC = wxDynamicCast(dc, wxClientDC); - if (clientDC) - { - wxPen pen(*wxBLACK_PEN); - wxBrush brush(*wxBLACK_BRUSH); -#ifdef __WXGTK__ - wxWindow* win = clientDC->m_owner; -#else - wxWindow* win = clientDC->GetWindow(); -#endif - if (win) - { - wxColour backgroundColour(win->GetBackgroundColour()); - if (backgroundColour.Red() < 100 && - backgroundColour.Green() < 100 && - backgroundColour.Blue() < 100) - { - pen = *wxWHITE_PEN; - brush = *wxWHITE_BRUSH; - } - } - dc->SetPen( pen ); - dc->SetBrush(m_hasFocus ? brush : *wxTRANSPARENT_BRUSH); - } - else -#endif - { - dc->SetBrush(*(m_hasFocus ? wxBLACK_BRUSH : wxTRANSPARENT_BRUSH)); - dc->SetPen(*wxBLACK_PEN); - } - - // VZ: unfortunately, the rectangle comes out a pixel smaller when this is - // done under wxGTK - no idea why - //dc->SetLogicalFunction(wxINVERT); - - dc->DrawRectangle(m_x, m_y, m_width, m_height); -} - -#endif // wxUSE_CARET diff --git a/wxWidgets/src/generic/choicbkg.cpp b/wxWidgets/src/generic/choicbkg.cpp deleted file mode 100644 index f39524ca8b..0000000000 --- a/wxWidgets/src/generic/choicbkg.cpp +++ /dev/null @@ -1,332 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: src/generic/choicbkg.cpp -// Purpose: generic implementation of wxChoicebook -// Author: Vadim Zeitlin -// Modified by: Wlodzimierz ABX Skiba from generic/listbkg.cpp -// Created: 15.09.04 -// RCS-ID: $Id: choicbkg.cpp 58355 2009-01-24 14:12:59Z VZ $ -// Copyright: (c) Vadim Zeitlin, Wlodzimierz Skiba -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_CHOICEBOOK - -#include "wx/choicebk.h" - -#ifndef WX_PRECOMP - #include "wx/settings.h" - #include "wx/choice.h" - #include "wx/sizer.h" -#endif - -#include "wx/imaglist.h" - -// ---------------------------------------------------------------------------- -// various wxWidgets macros -// ---------------------------------------------------------------------------- - -// check that the page index is valid -#define IS_VALID_PAGE(nPage) ((nPage) < GetPageCount()) - -// ---------------------------------------------------------------------------- -// event table -// ---------------------------------------------------------------------------- - -IMPLEMENT_DYNAMIC_CLASS(wxChoicebook, wxBookCtrlBase) -IMPLEMENT_DYNAMIC_CLASS(wxChoicebookEvent, wxNotifyEvent) - -#if !WXWIN_COMPATIBILITY_EVENT_TYPES -const wxEventType wxEVT_COMMAND_CHOICEBOOK_PAGE_CHANGING = wxNewEventType(); -const wxEventType wxEVT_COMMAND_CHOICEBOOK_PAGE_CHANGED = wxNewEventType(); -#endif - -BEGIN_EVENT_TABLE(wxChoicebook, wxBookCtrlBase) - EVT_CHOICE(wxID_ANY, wxChoicebook::OnChoiceSelected) -END_EVENT_TABLE() - -// ============================================================================ -// wxChoicebook implementation -// ============================================================================ - -// ---------------------------------------------------------------------------- -// wxChoicebook creation -// ---------------------------------------------------------------------------- - -void wxChoicebook::Init() -{ - m_selection = wxNOT_FOUND; -} - -bool -wxChoicebook::Create(wxWindow *parent, - wxWindowID id, - const wxPoint& pos, - const wxSize& size, - long style, - const wxString& name) -{ - if ( (style & wxBK_ALIGN_MASK) == wxBK_DEFAULT ) - { - style |= wxBK_TOP; - } - - // no border for this control, it doesn't look nice together with - // wxChoice border - style &= ~wxBORDER_MASK; - style |= wxBORDER_NONE; - - if ( !wxControl::Create(parent, id, pos, size, style, - wxDefaultValidator, name) ) - return false; - - m_bookctrl = new wxChoice - ( - this, - wxID_ANY, - wxDefaultPosition, - wxDefaultSize - ); - - wxSizer* mainSizer = new wxBoxSizer(IsVertical() ? wxVERTICAL : wxHORIZONTAL); - - if (style & wxBK_RIGHT || style & wxBK_BOTTOM) - mainSizer->Add(0, 0, 1, wxEXPAND, 0); - - m_controlSizer = new wxBoxSizer(IsVertical() ? wxHORIZONTAL : wxVERTICAL); - m_controlSizer->Add(m_bookctrl, 1, (IsVertical() ? wxALIGN_CENTRE_VERTICAL : wxALIGN_CENTRE) |wxGROW, 0); - mainSizer->Add(m_controlSizer, 0, (IsVertical() ? (int) wxGROW : (int) wxALIGN_CENTRE_VERTICAL)|wxALL, m_controlMargin); - SetSizer(mainSizer); - return true; -} - -// ---------------------------------------------------------------------------- -// wxChoicebook geometry management -// ---------------------------------------------------------------------------- - -wxSize wxChoicebook::GetControllerSize() const -{ - const wxSize sizeClient = GetClientSize(), - sizeChoice = m_controlSizer->CalcMin(); - - wxSize size; - if ( IsVertical() ) - { - size.x = sizeClient.x; - size.y = sizeChoice.y; - } - else // left/right aligned - { - size.x = sizeChoice.x; - size.y = sizeClient.y; - } - - return size; -} - -wxSize wxChoicebook::CalcSizeFromPage(const wxSize& sizePage) const -{ - // we need to add the size of the choice control and the border between - const wxSize sizeChoice = GetControllerSize(); - - wxSize size = sizePage; - if ( IsVertical() ) - { - if ( sizeChoice.x > sizePage.x ) - size.x = sizeChoice.x; - size.y += sizeChoice.y + GetInternalBorder(); - } - else // left/right aligned - { - size.x += sizeChoice.x + GetInternalBorder(); - if ( sizeChoice.y > sizePage.y ) - size.y = sizeChoice.y; - } - - return size; -} - - -// ---------------------------------------------------------------------------- -// accessing the pages -// ---------------------------------------------------------------------------- - -bool wxChoicebook::SetPageText(size_t n, const wxString& strText) -{ - GetChoiceCtrl()->SetString(n, strText); - - return true; -} - -wxString wxChoicebook::GetPageText(size_t n) const -{ - return GetChoiceCtrl()->GetString(n); -} - -int wxChoicebook::GetPageImage(size_t WXUNUSED(n)) const -{ - wxFAIL_MSG( _T("wxChoicebook::GetPageImage() not implemented") ); - - return wxNOT_FOUND; -} - -bool wxChoicebook::SetPageImage(size_t WXUNUSED(n), int WXUNUSED(imageId)) -{ - wxFAIL_MSG( _T("wxChoicebook::SetPageImage() not implemented") ); - - return false; -} - -// ---------------------------------------------------------------------------- -// image list stuff -// ---------------------------------------------------------------------------- - -void wxChoicebook::SetImageList(wxImageList *imageList) -{ - // TODO: can be implemented in form of static bitmap near choice control - - wxBookCtrlBase::SetImageList(imageList); -} - -// ---------------------------------------------------------------------------- -// selection -// ---------------------------------------------------------------------------- - -int wxChoicebook::GetSelection() const -{ - return m_selection; -} - -wxBookCtrlBaseEvent* wxChoicebook::CreatePageChangingEvent() const -{ - return new wxChoicebookEvent(wxEVT_COMMAND_CHOICEBOOK_PAGE_CHANGING, m_windowId); -} - -void wxChoicebook::MakeChangedEvent(wxBookCtrlBaseEvent &event) -{ - event.SetEventType(wxEVT_COMMAND_CHOICEBOOK_PAGE_CHANGED); -} - -// ---------------------------------------------------------------------------- -// adding/removing the pages -// ---------------------------------------------------------------------------- - -bool -wxChoicebook::InsertPage(size_t n, - wxWindow *page, - const wxString& text, - bool bSelect, - int imageId) -{ - if ( !wxBookCtrlBase::InsertPage(n, page, text, bSelect, imageId) ) - return false; - - GetChoiceCtrl()->Insert(text, n); - - // if the inserted page is before the selected one, we must update the - // index of the selected page - if ( int(n) <= m_selection ) - { - // one extra page added - m_selection++; - GetChoiceCtrl()->Select(m_selection); - } - - // some page should be selected: either this one or the first one if there - // is still no selection - int selNew = wxNOT_FOUND; - if ( bSelect ) - selNew = n; - else if ( m_selection == wxNOT_FOUND ) - selNew = 0; - - if ( selNew != m_selection ) - page->Hide(); - - if ( selNew != wxNOT_FOUND ) - SetSelection(selNew); - - return true; -} - -wxWindow *wxChoicebook::DoRemovePage(size_t page) -{ - const size_t page_count = GetPageCount(); - wxWindow *win = wxBookCtrlBase::DoRemovePage(page); - - if ( win ) - { - GetChoiceCtrl()->Delete(page); - - if (m_selection >= (int)page) - { - // force new sel valid if possible - int sel = m_selection - 1; - if (page_count == 1) - sel = wxNOT_FOUND; - else if ((page_count == 2) || (sel == -1)) - sel = 0; - - // force sel invalid if deleting current page - don't try to hide it - m_selection = (m_selection == (int)page) ? wxNOT_FOUND : m_selection - 1; - - if ((sel != wxNOT_FOUND) && (sel != m_selection)) - SetSelection(sel); - } - } - - return win; -} - - -bool wxChoicebook::DeleteAllPages() -{ - m_selection = wxNOT_FOUND; - GetChoiceCtrl()->Clear(); - return wxBookCtrlBase::DeleteAllPages(); -} - -// ---------------------------------------------------------------------------- -// wxChoicebook events -// ---------------------------------------------------------------------------- - -void wxChoicebook::OnChoiceSelected(wxCommandEvent& eventChoice) -{ - if ( eventChoice.GetEventObject() != m_bookctrl ) - { - eventChoice.Skip(); - return; - } - - const int selNew = eventChoice.GetSelection(); - - if ( selNew == m_selection ) - { - // this event can only come from our own Select(m_selection) below - // which we call when the page change is vetoed, so we should simply - // ignore it - return; - } - - SetSelection(selNew); - - // change wasn't allowed, return to previous state - if (m_selection != selNew) - GetChoiceCtrl()->Select(m_selection); -} - -#endif // wxUSE_CHOICEBOOK diff --git a/wxWidgets/src/generic/choicdgg.cpp b/wxWidgets/src/generic/choicdgg.cpp deleted file mode 100644 index 264b2288ed..0000000000 --- a/wxWidgets/src/generic/choicdgg.cpp +++ /dev/null @@ -1,556 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/generic/choicdgg.cpp -// Purpose: Choice dialogs -// Author: Julian Smart -// Modified by: 03.11.00: VZ to add wxArrayString and multiple sel functions -// Created: 04/01/98 -// RCS-ID: $Id: choicdgg.cpp 44620 2007-03-06 09:56:43Z JS $ -// Copyright: (c) wxWidgets team -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_CHOICEDLG - -#ifndef WX_PRECOMP - #include - #include "wx/utils.h" - #include "wx/dialog.h" - #include "wx/button.h" - #include "wx/listbox.h" - #include "wx/checklst.h" - #include "wx/stattext.h" - #include "wx/intl.h" - #include "wx/sizer.h" - #include "wx/arrstr.h" -#endif - -#include "wx/statline.h" -#include "wx/settings.h" -#include "wx/generic/choicdgg.h" - -// ---------------------------------------------------------------------------- -// constants -// ---------------------------------------------------------------------------- - -#define wxID_LISTBOX 3000 - -// ---------------------------------------------------------------------------- -// private functions -// ---------------------------------------------------------------------------- - -// convert wxArrayString into a wxString[] which must be delete[]d by caller -static int ConvertWXArrayToC(const wxArrayString& aChoices, wxString **choices); - -// ============================================================================ -// implementation -// ============================================================================ - -// ---------------------------------------------------------------------------- -// helpers -// ---------------------------------------------------------------------------- - -int ConvertWXArrayToC(const wxArrayString& aChoices, wxString **choices) -{ - int n = aChoices.GetCount(); - *choices = new wxString[n]; - - for ( int i = 0; i < n; i++ ) - { - (*choices)[i] = aChoices[i]; - } - - return n; -} - -// ---------------------------------------------------------------------------- -// wrapper functions -// ---------------------------------------------------------------------------- - -wxString wxGetSingleChoice( const wxString& message, - const wxString& caption, - int n, const wxString *choices, - wxWindow *parent, - int WXUNUSED(x), int WXUNUSED(y), - bool WXUNUSED(centre), - int WXUNUSED(width), int WXUNUSED(height) ) -{ - wxSingleChoiceDialog dialog(parent, message, caption, n, choices); - wxString choice; - if ( dialog.ShowModal() == wxID_OK ) - choice = dialog.GetStringSelection(); - - return choice; -} - -wxString wxGetSingleChoice( const wxString& message, - const wxString& caption, - const wxArrayString& aChoices, - wxWindow *parent, - int x, int y, - bool centre, - int width, int height) -{ - wxString *choices; - int n = ConvertWXArrayToC(aChoices, &choices); - wxString res = wxGetSingleChoice(message, caption, n, choices, parent, - x, y, centre, width, height); - delete [] choices; - - return res; -} - -int wxGetSingleChoiceIndex( const wxString& message, - const wxString& caption, - int n, const wxString *choices, - wxWindow *parent, - int WXUNUSED(x), int WXUNUSED(y), - bool WXUNUSED(centre), - int WXUNUSED(width), int WXUNUSED(height) ) -{ - wxSingleChoiceDialog dialog(parent, message, caption, n, choices); - int choice; - if ( dialog.ShowModal() == wxID_OK ) - choice = dialog.GetSelection(); - else - choice = -1; - - return choice; -} - -int wxGetSingleChoiceIndex( const wxString& message, - const wxString& caption, - const wxArrayString& aChoices, - wxWindow *parent, - int x, int y, - bool centre, - int width, int height) -{ - wxString *choices; - int n = ConvertWXArrayToC(aChoices, &choices); - int res = wxGetSingleChoiceIndex(message, caption, n, choices, parent, - x, y, centre, width, height); - delete [] choices; - - return res; -} - -void *wxGetSingleChoiceData( const wxString& message, - const wxString& caption, - int n, const wxString *choices, - void **client_data, - wxWindow *parent, - int WXUNUSED(x), int WXUNUSED(y), - bool WXUNUSED(centre), - int WXUNUSED(width), int WXUNUSED(height) ) -{ - wxSingleChoiceDialog dialog(parent, message, caption, n, choices, - (char **)client_data); - void *data; - if ( dialog.ShowModal() == wxID_OK ) - data = dialog.GetSelectionClientData(); - else - data = NULL; - - return data; -} - -void *wxGetSingleChoiceData( const wxString& message, - const wxString& caption, - const wxArrayString& aChoices, - void **client_data, - wxWindow *parent, - int x, int y, - bool centre, - int width, int height) -{ - wxString *choices; - int n = ConvertWXArrayToC(aChoices, &choices); - void *res = wxGetSingleChoiceData(message, caption, n, choices, - client_data, parent, - x, y, centre, width, height); - delete [] choices; - - return res; -} - -size_t wxGetMultipleChoices(wxArrayInt& selections, - const wxString& message, - const wxString& caption, - int n, const wxString *choices, - wxWindow *parent, - int WXUNUSED(x), int WXUNUSED(y), - bool WXUNUSED(centre), - int WXUNUSED(width), int WXUNUSED(height)) -{ - wxMultiChoiceDialog dialog(parent, message, caption, n, choices); - - // call this even if selections array is empty and this then (correctly) - // deselects the first item which is selected by default - dialog.SetSelections(selections); - - if ( dialog.ShowModal() == wxID_OK ) - selections = dialog.GetSelections(); - else - selections.Empty(); - - return selections.GetCount(); -} - -size_t wxGetMultipleChoices(wxArrayInt& selections, - const wxString& message, - const wxString& caption, - const wxArrayString& aChoices, - wxWindow *parent, - int x, int y, - bool centre, - int width, int height) -{ - wxString *choices; - int n = ConvertWXArrayToC(aChoices, &choices); - size_t res = wxGetMultipleChoices(selections, message, caption, - n, choices, parent, - x, y, centre, width, height); - delete [] choices; - - return res; -} - -// ---------------------------------------------------------------------------- -// wxAnyChoiceDialog -// ---------------------------------------------------------------------------- - -bool wxAnyChoiceDialog::Create(wxWindow *parent, - const wxString& message, - const wxString& caption, - int n, const wxString *choices, - long styleDlg, - const wxPoint& pos, - long styleLbox) -{ -#ifdef __WXMAC__ - // FIXME: why?? - if ( !wxDialog::Create(parent, wxID_ANY, caption, pos, wxDefaultSize, styleDlg & (~wxCANCEL) ) ) - return false; -#else - if ( !wxDialog::Create(parent, wxID_ANY, caption, pos, wxDefaultSize, styleDlg) ) - return false; -#endif - - wxBoxSizer *topsizer = new wxBoxSizer( wxVERTICAL ); - - // 1) text message - topsizer-> - Add(CreateTextSizer(message), wxSizerFlags().Expand().TripleBorder()); - - // 2) list box - m_listbox = CreateList(n, choices, styleLbox); - - if ( n > 0 ) - m_listbox->SetSelection(0); - - topsizer-> - Add(m_listbox, wxSizerFlags().Expand().Proportion(1).TripleBorder(wxLEFT | wxRIGHT)); - - // 3) buttons if any - wxSizer * - buttonSizer = CreateSeparatedButtonSizer(styleDlg & ButtonSizerFlags); - if ( buttonSizer ) - { - topsizer->Add(buttonSizer, wxSizerFlags().Expand().DoubleBorder()); - } - - SetSizer( topsizer ); - - topsizer->SetSizeHints( this ); - topsizer->Fit( this ); - - if ( styleDlg & wxCENTRE ) - Centre(wxBOTH); - - m_listbox->SetFocus(); - - return true; -} - -bool wxAnyChoiceDialog::Create(wxWindow *parent, - const wxString& message, - const wxString& caption, - const wxArrayString& choices, - long styleDlg, - const wxPoint& pos, - long styleLbox) -{ - wxCArrayString chs(choices); - return Create(parent, message, caption, chs.GetCount(), chs.GetStrings(), - styleDlg, pos, styleLbox); -} - -wxListBoxBase *wxAnyChoiceDialog::CreateList(int n, const wxString *choices, long styleLbox) -{ - wxSize size = wxDefaultSize; - if (wxSystemSettings::GetScreenType() > wxSYS_SCREEN_PDA) - size = wxSize(300, 200); - return new wxListBox( this, wxID_LISTBOX, - wxDefaultPosition, size, - n, choices, - styleLbox ); -} - -// ---------------------------------------------------------------------------- -// wxSingleChoiceDialog -// ---------------------------------------------------------------------------- - -BEGIN_EVENT_TABLE(wxSingleChoiceDialog, wxDialog) - EVT_BUTTON(wxID_OK, wxSingleChoiceDialog::OnOK) -#ifndef __SMARTPHONE__ - EVT_LISTBOX_DCLICK(wxID_LISTBOX, wxSingleChoiceDialog::OnListBoxDClick) -#endif -#ifdef __WXWINCE__ - EVT_JOY_BUTTON_DOWN(wxSingleChoiceDialog::OnJoystickButtonDown) -#endif -END_EVENT_TABLE() - -IMPLEMENT_DYNAMIC_CLASS(wxSingleChoiceDialog, wxDialog) - -wxSingleChoiceDialog::wxSingleChoiceDialog(wxWindow *parent, - const wxString& message, - const wxString& caption, - int n, - const wxString *choices, - char **clientData, - long style, - const wxPoint& WXUNUSED(pos)) -{ - Create(parent, message, caption, n, choices, clientData, style); -} - -wxSingleChoiceDialog::wxSingleChoiceDialog(wxWindow *parent, - const wxString& message, - const wxString& caption, - const wxArrayString& choices, - char **clientData, - long style, - const wxPoint& WXUNUSED(pos)) -{ - Create(parent, message, caption, choices, clientData, style); -} - -bool wxSingleChoiceDialog::Create( wxWindow *parent, - const wxString& message, - const wxString& caption, - int n, - const wxString *choices, - char **clientData, - long style, - const wxPoint& pos ) -{ - if ( !wxAnyChoiceDialog::Create(parent, message, caption, - n, choices, - style, pos) ) - return false; - - m_selection = n > 0 ? 0 : -1; - - if (clientData) - { - for (int i = 0; i < n; i++) - m_listbox->SetClientData(i, clientData[i]); - } - - return true; -} - -bool wxSingleChoiceDialog::Create( wxWindow *parent, - const wxString& message, - const wxString& caption, - const wxArrayString& choices, - char **clientData, - long style, - const wxPoint& pos ) -{ - wxCArrayString chs(choices); - return Create( parent, message, caption, chs.GetCount(), chs.GetStrings(), - clientData, style, pos ); -} - -// Set the selection -void wxSingleChoiceDialog::SetSelection(int sel) -{ - m_listbox->SetSelection(sel); - m_selection = sel; -} - -void wxSingleChoiceDialog::OnOK(wxCommandEvent& WXUNUSED(event)) -{ - DoChoice(); -} - -#ifndef __SMARTPHONE__ -void wxSingleChoiceDialog::OnListBoxDClick(wxCommandEvent& WXUNUSED(event)) -{ - DoChoice(); -} -#endif - -#ifdef __WXWINCE__ -void wxSingleChoiceDialog::OnJoystickButtonDown(wxJoystickEvent& WXUNUSED(event)) -{ - DoChoice(); -} -#endif - -void wxSingleChoiceDialog::DoChoice() -{ - m_selection = m_listbox->GetSelection(); - m_stringSelection = m_listbox->GetStringSelection(); - - if ( m_listbox->HasClientUntypedData() ) - SetClientData(m_listbox->GetClientData(m_selection)); - - EndModal(wxID_OK); -} - -// ---------------------------------------------------------------------------- -// wxMultiChoiceDialog -// ---------------------------------------------------------------------------- - -IMPLEMENT_DYNAMIC_CLASS(wxMultiChoiceDialog, wxDialog) - -bool wxMultiChoiceDialog::Create( wxWindow *parent, - const wxString& message, - const wxString& caption, - int n, - const wxString *choices, - long style, - const wxPoint& pos ) -{ - long styleLbox; -#if wxUSE_CHECKLISTBOX - styleLbox = wxLB_ALWAYS_SB; -#else - styleLbox = wxLB_ALWAYS_SB | wxLB_EXTENDED; -#endif - - if ( !wxAnyChoiceDialog::Create(parent, message, caption, - n, choices, - style, pos, - styleLbox) ) - return false; - - return true; -} - -bool wxMultiChoiceDialog::Create( wxWindow *parent, - const wxString& message, - const wxString& caption, - const wxArrayString& choices, - long style, - const wxPoint& pos ) -{ - wxCArrayString chs(choices); - return Create( parent, message, caption, chs.GetCount(), - chs.GetStrings(), style, pos ); -} - -void wxMultiChoiceDialog::SetSelections(const wxArrayInt& selections) -{ -#if wxUSE_CHECKLISTBOX - wxCheckListBox* checkListBox = wxDynamicCast(m_listbox, wxCheckListBox); - if (checkListBox) - { - // first clear all currently selected items - size_t n, - count = checkListBox->GetCount(); - for ( n = 0; n < count; ++n ) - { - if (checkListBox->IsChecked(n)) - checkListBox->Check(n, false); - } - - // now select the ones which should be selected - count = selections.GetCount(); - for ( n = 0; n < count; n++ ) - { - checkListBox->Check(selections[n]); - } - - return; - } -#endif - - // first clear all currently selected items - size_t n, - count = m_listbox->GetCount(); - for ( n = 0; n < count; ++n ) - { - m_listbox->Deselect(n); - } - - // now select the ones which should be selected - count = selections.GetCount(); - for ( n = 0; n < count; n++ ) - { - m_listbox->Select(selections[n]); - } -} - -bool wxMultiChoiceDialog::TransferDataFromWindow() -{ - m_selections.Empty(); - -#if wxUSE_CHECKLISTBOX - wxCheckListBox* checkListBox = wxDynamicCast(m_listbox, wxCheckListBox); - if (checkListBox) - { - size_t count = checkListBox->GetCount(); - for ( size_t n = 0; n < count; n++ ) - { - if ( checkListBox->IsChecked(n) ) - m_selections.Add(n); - } - return true; - } -#endif - - size_t count = m_listbox->GetCount(); - for ( size_t n = 0; n < count; n++ ) - { - if ( m_listbox->IsSelected(n) ) - m_selections.Add(n); - } - - return true; -} - -#if wxUSE_CHECKLISTBOX - -wxListBoxBase *wxMultiChoiceDialog::CreateList(int n, const wxString *choices, long styleLbox) -{ - wxSize size = wxDefaultSize; - if (wxSystemSettings::GetScreenType() > wxSYS_SCREEN_PDA) - size = wxSize(300, 200); - - return new wxCheckListBox( this, wxID_LISTBOX, - wxDefaultPosition, size, - n, choices, - styleLbox ); -} - -#endif // wxUSE_CHECKLISTBOX - -#endif // wxUSE_CHOICEDLG diff --git a/wxWidgets/src/generic/clrpickerg.cpp b/wxWidgets/src/generic/clrpickerg.cpp deleted file mode 100644 index 9d9fa387a0..0000000000 --- a/wxWidgets/src/generic/clrpickerg.cpp +++ /dev/null @@ -1,188 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: src/generic/clrpickerg.cpp -// Purpose: wxGenericColourButton class implementation -// Author: Francesco Montorsi (readapted code written by Vadim Zeitlin) -// Modified by: -// Created: 15/04/2006 -// RCS-ID: $Id: clrpickerg.cpp 58967 2009-02-17 13:31:28Z SC $ -// Copyright: (c) Vadim Zeitlin, Francesco Montorsi -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_COLOURPICKERCTRL - -#include "wx/clrpicker.h" - -#include "wx/colordlg.h" - - -// ============================================================================ -// implementation -// ============================================================================ - -wxColourData wxGenericColourButton::ms_data; -IMPLEMENT_DYNAMIC_CLASS(wxGenericColourButton, wxCLRBTN_BASE_CLASS) - -// ---------------------------------------------------------------------------- -// wxGenericColourButton -// ---------------------------------------------------------------------------- - -bool wxGenericColourButton::Create( wxWindow *parent, wxWindowID id, - const wxColour &col, const wxPoint &pos, - const wxSize &size, long style, - const wxValidator& validator, const wxString &name) -{ - // create this button -#if wxCLRBTN_USES_BMP_BUTTON - wxBitmap empty(1,1); - if (!wxBitmapButton::Create( parent, id, empty, pos, - size, style, validator, name )) -#else - if (!wxButton::Create( parent, id, wxEmptyString, pos, - size, style, validator, name )) -#endif - { - wxFAIL_MSG( wxT("wxGenericColourButton creation failed") ); - return false; - } - - // and handle user clicks on it - Connect(GetId(), wxEVT_COMMAND_BUTTON_CLICKED, - wxCommandEventHandler(wxGenericColourButton::OnButtonClick), - NULL, this); - - m_colour = col; - UpdateColour(); - InitColourData(); - - return true; -} - -void wxGenericColourButton::InitColourData() -{ - ms_data.SetChooseFull(true); - unsigned char grey = 0; - for (int i = 0; i < 16; i++, grey += 16) - { - // fill with grey tones the custom colors palette - wxColour colour(grey, grey, grey); - ms_data.SetCustomColour(i, colour); - } -} - -void wxGenericColourButton::OnButtonClick(wxCommandEvent& WXUNUSED(ev)) -{ - // update the wxColouData to be shown in the the dialog - ms_data.SetColour(m_colour); - - // create the colour dialog and display it - wxColourDialog dlg(this, &ms_data); - if (dlg.ShowModal() == wxID_OK) - { - ms_data = dlg.GetColourData(); - SetColour(ms_data.GetColour()); - - // fire an event - wxColourPickerEvent event(this, GetId(), m_colour); - GetEventHandler()->ProcessEvent(event); - } -} - -void wxGenericColourButton::UpdateColour() -{ - if ( !m_colour.Ok() ) - { -#if wxCLRBTN_USES_BMP_BUTTON - wxBitmap empty(1,1); - SetBitmapLabel(empty); -#else - if ( HasFlag(wxCLRP_SHOW_LABEL) ) - SetLabel(wxEmptyString); -#endif - return; - } - - // some combinations of the fg/bg colours may be unreadable, so we invert - // the colour to make sure fg colour is different enough from m_colour - wxColour colFg(~m_colour.Red(), ~m_colour.Green(), ~m_colour.Blue()); - -#if wxCLRBTN_USES_BMP_BUTTON - wxSize sz = GetSize(); - sz.x -= 2*GetMarginX(); - sz.y -= 2*GetMarginY(); - - wxPoint topleft; - - if ( sz.x < 1 ) - sz.x = 1; - else - if ( sz.y < 1 ) - sz.y = 1; - - wxBitmap bmp(sz.x, sz.y); - { - wxMemoryDC memdc(bmp); - memdc.SetPen(colFg); - memdc.SetBrush(m_colour); - memdc.DrawRectangle(topleft,sz); - if ( HasFlag(wxCLRP_SHOW_LABEL) ) - { - int x, y, leading, desc; - wxString label = m_colour.GetAsString(wxC2S_HTML_SYNTAX); - memdc.GetTextExtent(label,&x,&y,&desc,&leading); - if ( x <= sz.x && y <= sz.y ) - { - topleft.x += (sz.x-x)/2; - topleft.y += (sz.y-y)/2; - memdc.SetTextForeground(colFg); - memdc.DrawText(label,topleft); - } - } - } - SetBitmapLabel(bmp); -#else - SetForegroundColour(colFg); - SetBackgroundColour(m_colour); - - if ( HasFlag(wxCLRP_SHOW_LABEL) ) - SetLabel(m_colour.GetAsString(wxC2S_HTML_SYNTAX)); -#endif -} - -wxSize wxGenericColourButton::DoGetBestSize() const -{ - wxSize sz(wxButton::DoGetBestSize()); - if ( HasFlag(wxCLRP_SHOW_LABEL) ) - { -#if wxCLRBTN_USES_BMP_BUTTON - int x, y, leading, desc; - wxString label = m_colour.GetAsString(wxC2S_HTML_SYNTAX); - wxClientDC dc(const_cast(this)); - dc.GetTextExtent(label,&x,&y,&desc,&leading); - sz.x = sz.y+x; -#endif - return sz; - } - - // if we have no label, then make this button a square - // (like e.g. native GTK version of this control) - sz.SetWidth(sz.GetHeight()); - return sz; -} - -#endif // wxUSE_COLOURPICKERCTRL diff --git a/wxWidgets/src/generic/collpaneg.cpp b/wxWidgets/src/generic/collpaneg.cpp deleted file mode 100644 index 7dee8f18f0..0000000000 --- a/wxWidgets/src/generic/collpaneg.cpp +++ /dev/null @@ -1,307 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/generic/collpaneg.cpp -// Purpose: wxGenericCollapsiblePane -// Author: Francesco Montorsi -// Modified By: -// Created: 8/10/2006 -// Id: $Id: collpaneg.cpp 43371 2006-11-12 21:38:49Z VZ $ -// Copyright: (c) Francesco Montorsi -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" -#include "wx/defs.h" - -#if wxUSE_COLLPANE && wxUSE_BUTTON && wxUSE_STATLINE - -#include "wx/collpane.h" - -#ifndef WX_PRECOMP - #include "wx/toplevel.h" - #include "wx/button.h" - #include "wx/sizer.h" - #include "wx/panel.h" -#endif // !WX_PRECOMP - -#include "wx/statline.h" - -// ---------------------------------------------------------------------------- -// constants -// ---------------------------------------------------------------------------- - -// ============================================================================ -// implementation -// ============================================================================ - -const wxChar wxCollapsiblePaneNameStr[] = wxT("collapsiblePane"); - -//----------------------------------------------------------------------------- -// wxGenericCollapsiblePane -//----------------------------------------------------------------------------- - -DEFINE_EVENT_TYPE(wxEVT_COMMAND_COLLPANE_CHANGED) -IMPLEMENT_DYNAMIC_CLASS(wxGenericCollapsiblePane, wxControl) -IMPLEMENT_DYNAMIC_CLASS(wxCollapsiblePaneEvent, wxCommandEvent) - -BEGIN_EVENT_TABLE(wxGenericCollapsiblePane, wxControl) - EVT_BUTTON(wxID_ANY, wxGenericCollapsiblePane::OnButton) - EVT_SIZE(wxGenericCollapsiblePane::OnSize) -END_EVENT_TABLE() - - -bool wxGenericCollapsiblePane::Create(wxWindow *parent, - wxWindowID id, - const wxString& label, - const wxPoint& pos, - const wxSize& size, - long style, - const wxValidator& val, - const wxString& name) -{ - if ( !wxControl::Create(parent, id, pos, size, style, val, name) ) - return false; - - m_strLabel = label; - - // create children and lay them out using a wxBoxSizer - // (so that we automatically get RTL features) - m_pButton = new wxButton(this, wxID_ANY, GetBtnLabel(), wxPoint(0, 0), - wxDefaultSize, wxBU_EXACTFIT); - m_pStaticLine = new wxStaticLine(this, wxID_ANY); -#ifdef __WXMAC__ - // on Mac we put the static libe above the button - m_sz = new wxBoxSizer(wxVERTICAL); - m_sz->Add(m_pStaticLine, 0, wxALL|wxGROW, GetBorder()); - m_sz->Add(m_pButton, 0, wxLEFT|wxRIGHT|wxBOTTOM, GetBorder()); -#else - // on other platforms we put the static line and the button horizontally - m_sz = new wxBoxSizer(wxHORIZONTAL); - m_sz->Add(m_pButton, 0, wxLEFT|wxTOP|wxBOTTOM, GetBorder()); - m_sz->Add(m_pStaticLine, 1, wxALIGN_CENTER|wxLEFT|wxRIGHT, GetBorder()); -#endif - - // FIXME: at least under wxCE and wxGTK1 the background is black if we don't do - // this, no idea why... -#if defined(__WXWINCE__) || (defined(__WXGTK__) && !defined(__WXGTK20__)) - SetBackgroundColour(parent->GetBackgroundColour()); -#endif - - // do not set sz as our sizers since we handle the pane window without using sizers - m_pPane = new wxPanel(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, - wxTAB_TRAVERSAL|wxNO_BORDER); - - // start as collapsed: - m_pPane->Hide(); - - return true; -} - -wxGenericCollapsiblePane::~wxGenericCollapsiblePane() -{ - if (m_pButton && m_pStaticLine && m_sz) - { - m_pButton->SetContainingSizer(NULL); - m_pStaticLine->SetContainingSizer(NULL); - - // our sizer is not deleted automatically since we didn't use SetSizer()! - wxDELETE(m_sz); - } -} - -wxSize wxGenericCollapsiblePane::DoGetBestSize() const -{ - // NB: do not use GetSize() but rather GetMinSize() - wxSize sz = m_sz->GetMinSize(); - - // when expanded, we need more vertical space - if ( IsExpanded() ) - { - sz.SetWidth(wxMax( sz.GetWidth(), m_pPane->GetBestSize().x )); - sz.SetHeight(sz.y + GetBorder() + m_pPane->GetBestSize().y); - } - - return sz; -} - -wxString wxGenericCollapsiblePane::GetBtnLabel() const -{ - return m_strLabel + (IsCollapsed() ? wxT(" >>") : wxT(" <<")); -} - -void wxGenericCollapsiblePane::OnStateChange(const wxSize& sz) -{ - // minimal size has priority over the best size so set here our min size - SetMinSize(sz); - SetSize(sz); - - if (this->HasFlag(wxCP_NO_TLW_RESIZE)) - { - // the user asked to explicitely handle the resizing itself... - return; - } - - - // - // NB: the following block of code has been accurately designed to - // as much flicker-free as possible; be careful when modifying it! - // - - wxTopLevelWindow * - top = wxDynamicCast(wxGetTopLevelParent(this), wxTopLevelWindow); - if ( top ) - { - // NB: don't Layout() the 'top' window as its size has not been correctly - // updated yet and we don't want to do an initial Layout() with the old - // size immediately followed by a SetClientSize/Fit call for the new - // size; that would provoke flickering! - - if (top->GetSizer()) -#ifdef __WXGTK__ - // FIXME: the SetSizeHints() call would be required also for GTK+ for - // the expanded->collapsed transition. Unfortunately if we - // enable this line, then the GTK+ top window won't always be - // resized by the SetClientSize() call below! As a side effect - // of this dirty fix, the minimal size for the pane window is - // not set in GTK+ and the user can hide it shrinking the "top" - // window... - if (IsCollapsed()) -#endif - top->GetSizer()->SetSizeHints(top); - - - // we shouldn't attempt to resize a maximized window, whatever happens - if ( !top->IsMaximized() ) - { - if ( IsCollapsed() ) - { - // expanded -> collapsed transition - if (top->GetSizer()) - { - // we have just set the size hints... - wxSize sz = top->GetSizer()->CalcMin(); - - // use SetClientSize() and not SetSize() otherwise the size for - // e.g. a wxFrame with a menubar wouldn't be correctly set - top->SetClientSize(sz); - } - else - top->Layout(); - } - else - { - // collapsed -> expanded transition - - // force our parent to "fit", i.e. expand so that it can honour - // our minimal size - top->Fit(); - } - } - } -} - -void wxGenericCollapsiblePane::Collapse(bool collapse) -{ - // optimization - if ( IsCollapsed() == collapse ) - return; - - // update our state - m_pPane->Show(!collapse); - - // update button label - // NB: this must be done after updating our "state" - m_pButton->SetLabel(GetBtnLabel()); - - OnStateChange(GetBestSize()); -} - -void wxGenericCollapsiblePane::SetLabel(const wxString &label) -{ - m_strLabel = label; - m_pButton->SetLabel(GetBtnLabel()); - m_pButton->SetInitialSize(); - - Layout(); -} - -bool wxGenericCollapsiblePane::Layout() -{ - if (!m_pButton || !m_pStaticLine || !m_pPane || !m_sz) - return false; // we need to complete the creation first! - - wxSize oursz(GetSize()); - - // move & resize the button and the static line - m_sz->SetDimension(0, 0, oursz.GetWidth(), m_sz->GetMinSize().GetHeight()); - m_sz->Layout(); - - if ( IsExpanded() ) - { - // move & resize the container window - int yoffset = m_sz->GetSize().GetHeight() + GetBorder(); - m_pPane->SetSize(0, yoffset, - oursz.x, oursz.y - yoffset); - - // this is very important to make the pane window layout show correctly - m_pPane->Layout(); - } - - return true; -} - -int wxGenericCollapsiblePane::GetBorder() const -{ -#if defined( __WXMAC__ ) - return 6; -#elif defined(__WXGTK20__) - return 3; -#elif defined(__WXMSW__) - wxASSERT(m_pButton); - return m_pButton->ConvertDialogToPixels(wxSize(2, 0)).x; -#else - return 5; -#endif -} - - - -//----------------------------------------------------------------------------- -// wxGenericCollapsiblePane - event handlers -//----------------------------------------------------------------------------- - -void wxGenericCollapsiblePane::OnButton(wxCommandEvent& event) -{ - if ( event.GetEventObject() != m_pButton ) - { - event.Skip(); - return; - } - - Collapse(!IsCollapsed()); - - // this change was generated by the user - send the event - wxCollapsiblePaneEvent ev(this, GetId(), IsCollapsed()); - GetEventHandler()->ProcessEvent(ev); -} - -void wxGenericCollapsiblePane::OnSize(wxSizeEvent& WXUNUSED(event)) -{ -#if 0 // for debug only - wxClientDC dc(this); - dc.SetPen(*wxBLACK_PEN); - dc.SetBrush(*wxTRANSPARENT_BRUSH); - dc.DrawRectangle(wxPoint(0,0), GetSize()); - dc.SetPen(*wxRED_PEN); - dc.DrawRectangle(wxPoint(0,0), GetBestSize()); -#endif - - Layout(); -} - -#endif // wxUSE_COLLPANE && wxUSE_BUTTON && wxUSE_STATLINE diff --git a/wxWidgets/src/generic/colour.cpp b/wxWidgets/src/generic/colour.cpp deleted file mode 100644 index 85d67ceed7..0000000000 --- a/wxWidgets/src/generic/colour.cpp +++ /dev/null @@ -1,72 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/generic/colour.cpp -// Purpose: wxColour class -// Author: Julian Smart -// Modified by: -// Created: 01/02/97 -// RCS-ID: $Id: colour.cpp 41123 2006-09-10 02:00:24Z VZ $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#include "wx/colour.h" - -#ifndef WX_PRECOMP - #include "wx/gdicmn.h" -#endif - -IMPLEMENT_DYNAMIC_CLASS(wxColour, wxObject) - -// Colour - -void wxColour::Init() -{ - m_red = - m_blue = - m_green = 0; - m_alpha = wxALPHA_OPAQUE; - m_isInit = false; -} - -wxColour::wxColour() -{ - Init(); -} - -wxColour::wxColour(const wxColour& col) -{ - *this = col; -} - -wxColour& wxColour::operator=(const wxColour& col) -{ - m_red = col.m_red; - m_green = col.m_green; - m_blue = col.m_blue; - m_alpha = col.m_alpha; - m_isInit = col.m_isInit; - return *this; -} - -wxColour::~wxColour() -{ -} - -void wxColour::InitRGBA(unsigned char r, - unsigned char g, - unsigned char b, - unsigned char a) -{ - m_red = r; - m_green = g; - m_blue = b; - m_alpha = a; - m_isInit = true; -} diff --git a/wxWidgets/src/generic/colrdlgg.cpp b/wxWidgets/src/generic/colrdlgg.cpp deleted file mode 100644 index 2474949358..0000000000 --- a/wxWidgets/src/generic/colrdlgg.cpp +++ /dev/null @@ -1,586 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/generic/colrdlgg.cpp -// Purpose: Choice dialogs -// Author: Julian Smart -// Modified by: -// Created: 04/01/98 -// RCS-ID: $Id: colrdlgg.cpp 41838 2006-10-09 21:08:45Z VZ $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_COLOURDLG && (!defined(__WXGTK20__) || defined(__WXUNIVERSAL__)) - -#ifndef WX_PRECOMP - #include "wx/utils.h" - #include "wx/intl.h" - #include "wx/dialog.h" - #include "wx/listbox.h" - #include "wx/button.h" - #include "wx/stattext.h" - #include "wx/layout.h" - #include "wx/dcclient.h" - #include "wx/sizer.h" - #include "wx/slider.h" -#endif - -#if wxUSE_STATLINE - #include "wx/statline.h" -#endif - -#include "wx/generic/colrdlgg.h" - -IMPLEMENT_DYNAMIC_CLASS(wxGenericColourDialog, wxDialog) - -BEGIN_EVENT_TABLE(wxGenericColourDialog, wxDialog) - EVT_BUTTON(wxID_ADD_CUSTOM, wxGenericColourDialog::OnAddCustom) -#if wxUSE_SLIDER - EVT_SLIDER(wxID_RED_SLIDER, wxGenericColourDialog::OnRedSlider) - EVT_SLIDER(wxID_GREEN_SLIDER, wxGenericColourDialog::OnGreenSlider) - EVT_SLIDER(wxID_BLUE_SLIDER, wxGenericColourDialog::OnBlueSlider) -#endif - EVT_PAINT(wxGenericColourDialog::OnPaint) - EVT_MOUSE_EVENTS(wxGenericColourDialog::OnMouseEvent) - EVT_CLOSE(wxGenericColourDialog::OnCloseWindow) -END_EVENT_TABLE() - - -/* - * Generic wxColourDialog - */ - -// don't change the number of elements (48) in this array, the code below is -// hardcoded to use it -static const wxChar *wxColourDialogNames[] = -{ - wxT("ORANGE"), - wxT("GOLDENROD"), - wxT("WHEAT"), - wxT("SPRING GREEN"), - wxT("SKY BLUE"), - wxT("SLATE BLUE"), - wxT("MEDIUM VIOLET RED"), - wxT("PURPLE"), - - wxT("RED"), - wxT("YELLOW"), - wxT("MEDIUM SPRING GREEN"), - wxT("PALE GREEN"), - wxT("CYAN"), - wxT("LIGHT STEEL BLUE"), - wxT("ORCHID"), - wxT("LIGHT MAGENTA"), - - wxT("BROWN"), - wxT("YELLOW"), - wxT("GREEN"), - wxT("CADET BLUE"), - wxT("MEDIUM BLUE"), - wxT("MAGENTA"), - wxT("MAROON"), - wxT("ORANGE RED"), - - wxT("FIREBRICK"), - wxT("CORAL"), - wxT("FOREST GREEN"), - wxT("AQUAMARINE"), - wxT("BLUE"), - wxT("NAVY"), - wxT("THISTLE"), - wxT("MEDIUM VIOLET RED"), - - wxT("INDIAN RED"), - wxT("GOLD"), - wxT("MEDIUM SEA GREEN"), - wxT("MEDIUM BLUE"), - wxT("MIDNIGHT BLUE"), - wxT("GREY"), - wxT("PURPLE"), - wxT("KHAKI"), - - wxT("BLACK"), - wxT("MEDIUM FOREST GREEN"), - wxT("KHAKI"), - wxT("DARK GREY"), - wxT("SEA GREEN"), - wxT("LIGHT GREY"), - wxT("MEDIUM SLATE BLUE"), - wxT("WHITE") -}; - -wxGenericColourDialog::wxGenericColourDialog() -{ - dialogParent = NULL; - whichKind = 1; - colourSelection = -1; -} - -wxGenericColourDialog::wxGenericColourDialog(wxWindow *parent, - wxColourData *data) -{ - whichKind = 1; - colourSelection = -1; - Create(parent, data); -} - -wxGenericColourDialog::~wxGenericColourDialog() -{ -} - -void wxGenericColourDialog::OnCloseWindow(wxCloseEvent& WXUNUSED(event)) -{ - EndModal(wxID_CANCEL); -} - -bool wxGenericColourDialog::Create(wxWindow *parent, wxColourData *data) -{ - if ( !wxDialog::Create(parent, wxID_ANY, _("Choose colour"), - wxPoint(0,0), wxSize(900, 900)) ) - return false; - - dialogParent = parent; - - if (data) - colourData = *data; - - InitializeColours(); - CalculateMeasurements(); - CreateWidgets(); - - return true; -} - -int wxGenericColourDialog::ShowModal() -{ - return wxDialog::ShowModal(); -} - - -// Internal functions -void wxGenericColourDialog::OnMouseEvent(wxMouseEvent& event) -{ - if (event.ButtonDown(1)) - { - int x = (int)event.GetX(); - int y = (int)event.GetY(); - -#ifdef __WXPM__ - // Handle OS/2's reverse coordinate system and account for the dialog title - int nClientHeight; - - GetClientSize(NULL, &nClientHeight); - y = (nClientHeight - y) + 20; -#endif - if ((x >= standardColoursRect.x && x <= (standardColoursRect.x + standardColoursRect.width)) && - (y >= standardColoursRect.y && y <= (standardColoursRect.y + standardColoursRect.height))) - { - int selX = (int)(x - standardColoursRect.x)/(smallRectangleSize.x + gridSpacing); - int selY = (int)(y - standardColoursRect.y)/(smallRectangleSize.y + gridSpacing); - int ptr = (int)(selX + selY*8); - OnBasicColourClick(ptr); - } - else if ((x >= customColoursRect.x && x <= (customColoursRect.x + customColoursRect.width)) && - (y >= customColoursRect.y && y <= (customColoursRect.y + customColoursRect.height))) - { - int selX = (int)(x - customColoursRect.x)/(smallRectangleSize.x + gridSpacing); - int selY = (int)(y - customColoursRect.y)/(smallRectangleSize.y + gridSpacing); - int ptr = (int)(selX + selY*8); - OnCustomColourClick(ptr); - } - else - event.Skip(); - } - else - event.Skip(); -} - -void wxGenericColourDialog::OnPaint(wxPaintEvent& event) -{ -#if !defined(__WXMOTIF__) && !defined(__WXPM__) && !defined(__WXCOCOA__) - wxDialog::OnPaint(event); -#else - wxUnusedVar(event); -#endif - - wxPaintDC dc(this); - - PaintBasicColours(dc); - PaintCustomColours(dc); - PaintCustomColour(dc); - PaintHighlight(dc, true); -} - -void wxGenericColourDialog::CalculateMeasurements() -{ - smallRectangleSize.x = 18; - smallRectangleSize.y = 14; - customRectangleSize.x = 40; - customRectangleSize.y = 40; - - gridSpacing = 6; - sectionSpacing = 15; - - standardColoursRect.x = 10; -#ifdef __WXPM__ - standardColoursRect.y = 15 + 20; /* OS/2 needs to account for dialog titlebar */ -#else - standardColoursRect.y = 15; -#endif - standardColoursRect.width = (8*smallRectangleSize.x) + (7*gridSpacing); - standardColoursRect.height = (6*smallRectangleSize.y) + (5*gridSpacing); - - customColoursRect.x = standardColoursRect.x; - customColoursRect.y = standardColoursRect.y + standardColoursRect.height + 20; - customColoursRect.width = (8*smallRectangleSize.x) + (7*gridSpacing); - customColoursRect.height = (2*smallRectangleSize.y) + (1*gridSpacing); - - singleCustomColourRect.x = customColoursRect.width + customColoursRect.x + sectionSpacing; - singleCustomColourRect.y = 80; - singleCustomColourRect.width = customRectangleSize.x; - singleCustomColourRect.height = customRectangleSize.y; - - okButtonX = 10; - customButtonX = singleCustomColourRect.x ; - buttonY = customColoursRect.y + customColoursRect.height + 10; -} - -void wxGenericColourDialog::CreateWidgets() -{ - wxBeginBusyCursor(); - - wxBoxSizer *topSizer = new wxBoxSizer( wxVERTICAL ); - - const int sliderHeight = 160; - - // first sliders -#if wxUSE_SLIDER - const int sliderX = singleCustomColourRect.x + singleCustomColourRect.width + sectionSpacing; - - redSlider = new wxSlider(this, wxID_RED_SLIDER, colourData.m_dataColour.Red(), 0, 255, - wxDefaultPosition, wxSize(wxDefaultCoord, sliderHeight), wxSL_VERTICAL|wxSL_LABELS|wxSL_INVERSE); - greenSlider = new wxSlider(this, wxID_GREEN_SLIDER, colourData.m_dataColour.Green(), 0, 255, - wxDefaultPosition, wxSize(wxDefaultCoord, sliderHeight), wxSL_VERTICAL|wxSL_LABELS|wxSL_INVERSE); - blueSlider = new wxSlider(this, wxID_BLUE_SLIDER, colourData.m_dataColour.Blue(), 0, 255, - wxDefaultPosition, wxSize(wxDefaultCoord, sliderHeight), wxSL_VERTICAL|wxSL_LABELS|wxSL_INVERSE); - - wxBoxSizer *sliderSizer = new wxBoxSizer( wxHORIZONTAL ); - - sliderSizer->Add(sliderX, sliderHeight ); - - wxSizerFlags flagsRight; - flagsRight.Align(wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL).DoubleBorder(); - - sliderSizer->Add(redSlider, flagsRight); - sliderSizer->Add(greenSlider,flagsRight); - sliderSizer->Add(blueSlider,flagsRight); - - topSizer->Add(sliderSizer, wxSizerFlags().Centre().DoubleBorder()); -#else - topSizer->Add(1, sliderHeight, wxSizerFlags(1).Centre().TripleBorder()); -#endif // wxUSE_SLIDER - - // then the custom button - topSizer->Add(new wxButton(this, wxID_ADD_CUSTOM, - _("Add to custom colours") ), - wxSizerFlags().DoubleHorzBorder()); - - // then the standard buttons - wxSizer *buttonsizer = CreateSeparatedButtonSizer(wxOK | wxCANCEL); - if ( buttonsizer ) - { - topSizer->Add(buttonsizer, wxSizerFlags().Expand().DoubleBorder()); - } - - SetAutoLayout( true ); - SetSizer( topSizer ); - - topSizer->SetSizeHints( this ); - topSizer->Fit( this ); - - Centre( wxBOTH ); - - wxEndBusyCursor(); -} - -void wxGenericColourDialog::InitializeColours(void) -{ - size_t i; - - for (i = 0; i < WXSIZEOF(wxColourDialogNames); i++) - { - wxColour col = wxTheColourDatabase->Find(wxColourDialogNames[i]); - if (col.Ok()) - standardColours[i].Set(col.Red(), col.Green(), col.Blue()); - else - standardColours[i].Set(0, 0, 0); - } - - for (i = 0; i < WXSIZEOF(customColours); i++) - { - wxColour c = colourData.GetCustomColour(i); - if (c.Ok()) - customColours[i] = colourData.GetCustomColour(i); - else - customColours[i] = wxColour(255, 255, 255); - } - - wxColour curr = colourData.GetColour(); - if ( curr.Ok() ) - { - bool initColourFound = false; - - for (i = 0; i < WXSIZEOF(wxColourDialogNames); i++) - { - if ( standardColours[i] == curr && !initColourFound ) - { - whichKind = 1; - colourSelection = i; - initColourFound = true; - break; - } - } - if ( !initColourFound ) - { - for ( i = 0; i < WXSIZEOF(customColours); i++ ) - { - if ( customColours[i] == curr ) - { - whichKind = 2; - colourSelection = i; - break; - } - } - } - colourData.m_dataColour.Set( curr.Red(), curr.Green(), curr.Blue() ); - } - else - { - whichKind = 1; - colourSelection = 0; - colourData.m_dataColour.Set( 0, 0, 0 ); - } -} - -void wxGenericColourDialog::PaintBasicColours(wxDC& dc) -{ - int i; - for (i = 0; i < 6; i++) - { - int j; - for (j = 0; j < 8; j++) - { - int ptr = i*8 + j; - - int x = (j*(smallRectangleSize.x+gridSpacing) + standardColoursRect.x); - int y = (i*(smallRectangleSize.y+gridSpacing) + standardColoursRect.y); - - dc.SetPen(*wxBLACK_PEN); - wxBrush brush(standardColours[ptr], wxSOLID); - dc.SetBrush(brush); - - dc.DrawRectangle( x, y, smallRectangleSize.x, smallRectangleSize.y); - } - } -} - -void wxGenericColourDialog::PaintCustomColours(wxDC& dc) -{ - int i; - for (i = 0; i < 2; i++) - { - int j; - for (j = 0; j < 8; j++) - { - int ptr = i*8 + j; - - int x = (j*(smallRectangleSize.x+gridSpacing)) + customColoursRect.x; - int y = (i*(smallRectangleSize.y+gridSpacing)) + customColoursRect.y; - - dc.SetPen(*wxBLACK_PEN); - - wxBrush brush(customColours[ptr], wxSOLID); - dc.SetBrush(brush); - - dc.DrawRectangle( x, y, smallRectangleSize.x, smallRectangleSize.y); - } - } -} - -void wxGenericColourDialog::PaintHighlight(wxDC& dc, bool draw) -{ - if ( colourSelection < 0 ) - return; - - // Number of pixels bigger than the standard rectangle size - // for drawing a highlight - int deltaX = 2; - int deltaY = 2; - - if (whichKind == 1) - { - // Standard colours - int y = (int)(colourSelection / 8); - int x = (int)(colourSelection - (y*8)); - - x = (x*(smallRectangleSize.x + gridSpacing) + standardColoursRect.x) - deltaX; - y = (y*(smallRectangleSize.y + gridSpacing) + standardColoursRect.y) - deltaY; - - if (draw) - dc.SetPen(*wxBLACK_PEN); - else - dc.SetPen(*wxLIGHT_GREY_PEN); - - dc.SetBrush(*wxTRANSPARENT_BRUSH); - dc.DrawRectangle( x, y, (smallRectangleSize.x + (2*deltaX)), (smallRectangleSize.y + (2*deltaY))); - } - else - { - // User-defined colours - int y = (int)(colourSelection / 8); - int x = (int)(colourSelection - (y*8)); - - x = (x*(smallRectangleSize.x + gridSpacing) + customColoursRect.x) - deltaX; - y = (y*(smallRectangleSize.y + gridSpacing) + customColoursRect.y) - deltaY; - - if (draw) - dc.SetPen(*wxBLACK_PEN); - else - dc.SetPen(*wxLIGHT_GREY_PEN); - - dc.SetBrush(*wxTRANSPARENT_BRUSH); - dc.DrawRectangle( x, y, (smallRectangleSize.x + (2*deltaX)), (smallRectangleSize.y + (2*deltaY))); - } -} - -void wxGenericColourDialog::PaintCustomColour(wxDC& dc) -{ - dc.SetPen(*wxBLACK_PEN); - - wxBrush *brush = new wxBrush(colourData.m_dataColour, wxSOLID); - dc.SetBrush(*brush); - - dc.DrawRectangle( singleCustomColourRect.x, singleCustomColourRect.y, - customRectangleSize.x, customRectangleSize.y); - - dc.SetBrush(wxNullBrush); - delete brush; -} - -void wxGenericColourDialog::OnBasicColourClick(int which) -{ - wxClientDC dc(this); - - PaintHighlight(dc, false); - whichKind = 1; - colourSelection = which; - -#if wxUSE_SLIDER - redSlider->SetValue( standardColours[colourSelection].Red() ); - greenSlider->SetValue( standardColours[colourSelection].Green() ); - blueSlider->SetValue( standardColours[colourSelection].Blue() ); -#endif // wxUSE_SLIDER - - colourData.m_dataColour.Set(standardColours[colourSelection].Red(), - standardColours[colourSelection].Green(), - standardColours[colourSelection].Blue()); - - PaintCustomColour(dc); - PaintHighlight(dc, true); -} - -void wxGenericColourDialog::OnCustomColourClick(int which) -{ - wxClientDC dc(this); - PaintHighlight(dc, false); - whichKind = 2; - colourSelection = which; - -#if wxUSE_SLIDER - redSlider->SetValue( customColours[colourSelection].Red() ); - greenSlider->SetValue( customColours[colourSelection].Green() ); - blueSlider->SetValue( customColours[colourSelection].Blue() ); -#endif // wxUSE_SLIDER - - colourData.m_dataColour.Set(customColours[colourSelection].Red(), - customColours[colourSelection].Green(), - customColours[colourSelection].Blue()); - - PaintCustomColour(dc); - PaintHighlight(dc, true); -} - -/* -void wxGenericColourDialog::OnOk(void) -{ - Show(false); -} - -void wxGenericColourDialog::OnCancel(void) -{ - colourDialogCancelled = true; - Show(false); -} -*/ - -void wxGenericColourDialog::OnAddCustom(wxCommandEvent& WXUNUSED(event)) -{ - wxClientDC dc(this); - if (whichKind != 2) - { - PaintHighlight(dc, false); - whichKind = 2; - colourSelection = 0; - PaintHighlight(dc, true); - } - - customColours[colourSelection].Set(colourData.m_dataColour.Red(), - colourData.m_dataColour.Green(), - colourData.m_dataColour.Blue()); - - colourData.SetCustomColour(colourSelection, customColours[colourSelection]); - - PaintCustomColours(dc); -} - -#if wxUSE_SLIDER - -void wxGenericColourDialog::OnRedSlider(wxCommandEvent& WXUNUSED(event)) -{ - if (!redSlider) - return; - - wxClientDC dc(this); - colourData.m_dataColour.Set((unsigned char)redSlider->GetValue(), colourData.m_dataColour.Green(), colourData.m_dataColour.Blue()); - PaintCustomColour(dc); -} - -void wxGenericColourDialog::OnGreenSlider(wxCommandEvent& WXUNUSED(event)) -{ - if (!greenSlider) - return; - - wxClientDC dc(this); - colourData.m_dataColour.Set(colourData.m_dataColour.Red(), (unsigned char)greenSlider->GetValue(), colourData.m_dataColour.Blue()); - PaintCustomColour(dc); -} - -void wxGenericColourDialog::OnBlueSlider(wxCommandEvent& WXUNUSED(event)) -{ - if (!blueSlider) - return; - - wxClientDC dc(this); - colourData.m_dataColour.Set(colourData.m_dataColour.Red(), colourData.m_dataColour.Green(), (unsigned char)blueSlider->GetValue()); - PaintCustomColour(dc); -} - -#endif // wxUSE_SLIDER - -#endif // wxUSE_COLOURDLG && !defined(__WXGTK20__) diff --git a/wxWidgets/src/generic/combog.cpp b/wxWidgets/src/generic/combog.cpp deleted file mode 100644 index f867397dbc..0000000000 --- a/wxWidgets/src/generic/combog.cpp +++ /dev/null @@ -1,489 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/generic/combog.cpp -// Purpose: Generic wxComboCtrl -// Author: Jaakko Salli -// Modified by: -// Created: Apr-30-2006 -// RCS-ID: $Id: combog.cpp 67178 2011-03-13 09:32:19Z JMS $ -// Copyright: (c) 2005 Jaakko Salli -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_COMBOCTRL - -#include "wx/combo.h" - -#ifndef WX_PRECOMP - #include "wx/log.h" - #include "wx/combobox.h" - #include "wx/dcclient.h" - #include "wx/settings.h" -#endif - -#include "wx/dcbuffer.h" - -// ---------------------------------------------------------------------------- -// Some constant adjustments to make the generic more bearable - -#if defined(__WXUNIVERSAL__) - -#define TEXTCTRLXADJUST 0 // position adjustment for wxTextCtrl, with zero indent -#define TEXTCTRLYADJUST 0 -#define TEXTXADJUST 0 // how much is read-only text's x adjusted -#define DEFAULT_DROPBUTTON_WIDTH 19 - -#elif defined(__WXMSW__) - -#define TEXTCTRLXADJUST 2 // position adjustment for wxTextCtrl, with zero indent -#define TEXTCTRLYADJUST 3 -#define TEXTXADJUST 0 // how much is read-only text's x adjusted -#define DEFAULT_DROPBUTTON_WIDTH 17 - -#elif defined(__WXGTK__) - -#define TEXTCTRLXADJUST -1 // position adjustment for wxTextCtrl, with zero indent -#define TEXTCTRLYADJUST 0 -#define TEXTXADJUST 1 // how much is read-only text's x adjusted -#define DEFAULT_DROPBUTTON_WIDTH 23 - -#elif defined(__WXMAC__) - -#define TEXTCTRLXADJUST 0 // position adjustment for wxTextCtrl, with zero indent -#define TEXTCTRLYADJUST 0 -#define TEXTXADJUST 0 // how much is read-only text's x adjusted -#define DEFAULT_DROPBUTTON_WIDTH 22 - -#else - -#define TEXTCTRLXADJUST 0 // position adjustment for wxTextCtrl, with zero indent -#define TEXTCTRLYADJUST 0 -#define TEXTXADJUST 0 // how much is read-only text's x adjusted -#define DEFAULT_DROPBUTTON_WIDTH 19 - -#endif - - -// ============================================================================ -// implementation -// ============================================================================ - -// Only implement if no native or it wasn't fully featured -#ifndef wxCOMBOCONTROL_FULLY_FEATURED - - -// ---------------------------------------------------------------------------- -// wxGenericComboCtrl -// ---------------------------------------------------------------------------- - -BEGIN_EVENT_TABLE(wxGenericComboCtrl, wxComboCtrlBase) - EVT_PAINT(wxGenericComboCtrl::OnPaintEvent) - EVT_MOUSE_EVENTS(wxGenericComboCtrl::OnMouseEvent) -END_EVENT_TABLE() - - -IMPLEMENT_DYNAMIC_CLASS(wxGenericComboCtrl, wxComboCtrlBase) - -void wxGenericComboCtrl::Init() -{ -} - -bool wxGenericComboCtrl::Create(wxWindow *parent, - wxWindowID id, - const wxString& value, - const wxPoint& pos, - const wxSize& size, - long style, - const wxValidator& validator, - const wxString& name) -{ - // - // Note that technically we only support 'default' border and wxNO_BORDER. - long border = style & wxBORDER_MASK; - int tcBorder = wxNO_BORDER; - -#if defined(__WXUNIVERSAL__) - if ( !border ) - border = wxBORDER_SIMPLE; -#elif defined(__WXMSW__) - if ( !border ) - // For XP, have 1-width custom border, for older version use sunken - /*if ( wxUxThemeEngine::GetIfActive() ) - { - border = wxBORDER_NONE; - m_widthCustomBorder = 1; - } - else*/ - border = wxBORDER_SUNKEN; -#else - - // - // Generic version is optimized for wxGTK - // - - #define UNRELIABLE_TEXTCTRL_BORDER - - if ( !border ) - { - if ( style & wxCB_READONLY ) - { - m_widthCustomBorder = 1; - } - else - { - m_widthCustomBorder = 0; - tcBorder = 0; - } - } - else - { - // Have textctrl instead use the border given. - tcBorder = border; - } - - // Because we are going to have button outside the border, - // let's use wxBORDER_NONE for the whole control. - border = wxBORDER_NONE; - - Customize( wxCC_BUTTON_OUTSIDE_BORDER | - wxCC_NO_TEXT_AUTO_SELECT ); - -#endif - - style = (style & ~(wxBORDER_MASK)) | border; - if ( style & wxCC_STD_BUTTON ) - m_iFlags |= wxCC_POPUP_ON_MOUSE_UP; - - // create main window - if ( !wxComboCtrlBase::Create(parent, - id, - value, - pos, - size, - style | wxFULL_REPAINT_ON_RESIZE, - wxDefaultValidator, - name) ) - return false; - - // Create textctrl, if necessary - CreateTextCtrl( tcBorder, validator ); - - // Add keyboard input handlers for main control and textctrl - InstallInputHandlers(); - - // Set background - SetBackgroundStyle( wxBG_STYLE_CUSTOM ); // for double-buffering - - // SetInitialSize should be called last - SetInitialSize(size); - - return true; -} - -wxGenericComboCtrl::~wxGenericComboCtrl() -{ -} - -void wxGenericComboCtrl::OnResize() -{ - - // Recalculates button and textctrl areas - CalculateAreas(DEFAULT_DROPBUTTON_WIDTH); - -#if 0 - // Move separate button control, if any, to correct position - if ( m_btn ) - { - wxSize sz = GetClientSize(); - m_btn->SetSize( m_btnArea.x + m_btnSpacingX, - (sz.y-m_btnSize.y)/2, - m_btnSize.x, - m_btnSize.y ); - } -#endif - - // Move textctrl, if any, accordingly - PositionTextCtrl( TEXTCTRLXADJUST, TEXTCTRLYADJUST ); -} - -void wxGenericComboCtrl::OnPaintEvent( wxPaintEvent& WXUNUSED(event) ) -{ - wxSize sz = GetClientSize(); - wxAutoBufferedPaintDC dc(this); - - const wxRect& rectb = m_btnArea; - wxRect rect = m_tcArea; - - // artificial simple border - if ( m_widthCustomBorder ) - { - int customBorder = m_widthCustomBorder; - - // Set border colour - wxPen pen1( wxSystemSettings::GetColour(wxSYS_COLOUR_GRAYTEXT), - customBorder, - wxSOLID ); - dc.SetPen( pen1 ); - - // area around both controls - wxRect rect2(0,0,sz.x,sz.y); - if ( m_iFlags & wxCC_IFLAG_BUTTON_OUTSIDE ) - { - rect2 = m_tcArea; - if ( customBorder == 1 ) - { - rect2.Inflate(1); - } - else - { - #ifdef __WXGTK__ - rect2.x -= 1; - rect2.y -= 1; - #else - rect2.x -= customBorder; - rect2.y -= customBorder; - #endif - rect2.width += 1 + customBorder; - rect2.height += 1 + customBorder; - } - } - - dc.SetBrush( *wxTRANSPARENT_BRUSH ); - dc.DrawRectangle(rect2); - } - -#if defined(__WXMAC__) || defined(__WXGTK__) // see note in OnThemeChange - wxColour winCol = wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW); -#else - wxColour winCol = GetBackgroundColour(); -#endif - dc.SetBrush(winCol); - dc.SetPen(winCol); - - //wxLogDebug(wxT("hei: %i tcy: %i tchei: %i"),GetClientSize().y,m_tcArea.y,m_tcArea.height); - //wxLogDebug(wxT("btnx: %i tcx: %i tcwid: %i"),m_btnArea.x,m_tcArea.x,m_tcArea.width); - - // clear main background - dc.DrawRectangle(rect); - - if ( !m_btn ) - { - #ifdef __WXGTK__ - // Under GTK+ this avoids drawing the button background with wrong - // colour - DrawButton(dc,rectb,0); - #else - // Standard button rendering - DrawButton(dc,rectb); - #endif - } - - // paint required portion on the control - if ( (!m_text || m_widthCustomPaint) ) - { - wxASSERT( m_widthCustomPaint >= 0 ); - - // this is intentionally here to allow drawed rectangle's - // right edge to be hidden - if ( m_text ) - rect.width = m_widthCustomPaint; - - dc.SetFont( GetFont() ); - - dc.SetClippingRegion(rect); - if ( m_popupInterface ) - m_popupInterface->PaintComboControl(dc,rect); - else - wxComboPopup::DefaultPaintComboControl(this,dc,rect); - } -} - -void wxGenericComboCtrl::OnMouseEvent( wxMouseEvent& event ) -{ - int mx = event.m_x; - bool isOnButtonArea = m_btnArea.Contains(mx,event.m_y); - int handlerFlags = isOnButtonArea ? wxCC_MF_ON_BUTTON : 0; - - if ( PreprocessMouseEvent(event,handlerFlags) ) - return; - - const bool ctrlIsButton = wxPlatformIs(wxOS_WINDOWS); - - if ( ctrlIsButton && - (m_windowStyle & (wxCC_SPECIAL_DCLICK|wxCB_READONLY)) == wxCB_READONLY ) - { - // if no textctrl and no special double-click, then the entire control acts - // as a button - handlerFlags |= wxCC_MF_ON_BUTTON; - if ( HandleButtonMouseEvent(event,handlerFlags) ) - return; - } - else - { - if ( isOnButtonArea || HasCapture() || - (m_widthCustomPaint && mx < (m_tcArea.x+m_widthCustomPaint)) ) - { - handlerFlags |= wxCC_MF_ON_CLICK_AREA; - - if ( HandleButtonMouseEvent(event,handlerFlags) ) - return; - } - else if ( m_btnState ) - { - // otherwise need to clear the hover status - m_btnState = 0; - RefreshRect(m_btnArea); - } - } - - // - // This will handle left_down and left_dclick events outside button in a Windows/GTK-like manner. - // See header file for further information on this method. - HandleNormalMouseEvent(event); - -} - -void wxGenericComboCtrl::SetCustomPaintWidth( int width ) -{ -#ifdef UNRELIABLE_TEXTCTRL_BORDER - // - // If starting/stopping to show an image in front - // of a writable text-field, then re-create textctrl - // with different kind of border (because we can't - // assume that textctrl fully supports wxNO_BORDER). - // - wxTextCtrl* tc = GetTextCtrl(); - - if ( tc && (m_iFlags & wxCC_BUTTON_OUTSIDE_BORDER) ) - { - int borderType = tc->GetWindowStyle() & wxBORDER_MASK; - int tcCreateStyle = -1; - - if ( width > 0 ) - { - // Re-create textctrl with no border - if ( borderType != wxNO_BORDER ) - { - m_widthCustomBorder = 1; - tcCreateStyle = wxNO_BORDER; - } - } - else if ( width == 0 ) - { - // Re-create textctrl with normal border - if ( borderType == wxNO_BORDER ) - { - m_widthCustomBorder = 0; - tcCreateStyle = 0; - } - } - - // Common textctrl re-creation code - if ( tcCreateStyle != -1 ) - { - tc->RemoveEventHandler(m_textEvtHandler); - delete m_textEvtHandler; - -#if wxUSE_VALIDATORS - wxValidator* pValidator = tc->GetValidator(); - if ( pValidator ) - { - pValidator = (wxValidator*) pValidator->Clone(); - CreateTextCtrl( tcCreateStyle, *pValidator ); - delete pValidator; - } - else -#endif - { - CreateTextCtrl( tcCreateStyle, wxDefaultValidator ); - } - - InstallInputHandlers(); - } - } -#endif // UNRELIABLE_TEXTCTRL_BORDER - - wxComboCtrlBase::SetCustomPaintWidth( width ); -} - -bool wxGenericComboCtrl::IsKeyPopupToggle(const wxKeyEvent& event) const -{ - int keycode = event.GetKeyCode(); - bool isPopupShown = IsPopupShown(); - - // This code is AFAIK appropriate for wxGTK. - - if ( isPopupShown ) - { - if ( keycode == WXK_ESCAPE || - ( keycode == WXK_UP && event.AltDown() ) ) - return true; - } - else - { - if ( keycode == WXK_DOWN && event.AltDown() ) - return true; - } - - return false; -} - -#ifdef __WXUNIVERSAL__ - -bool wxGenericComboCtrl::PerformAction(const wxControlAction& action, - long numArg, - const wxString& strArg) -{ - bool processed = false; - if ( action == wxACTION_COMBOBOX_POPUP ) - { - if ( !IsPopupShown() ) - { - ShowPopup(); - - processed = true; - } - } - else if ( action == wxACTION_COMBOBOX_DISMISS ) - { - if ( IsPopupShown() ) - { - HidePopup(); - - processed = true; - } - } - - if ( !processed ) - { - // pass along - return wxControl::PerformAction(action, numArg, strArg); - } - - return true; -} - -#endif // __WXUNIVERSAL__ - -// If native wxComboCtrl was not defined, then prepare a simple -// front-end so that wxRTTI works as expected. -#ifndef _WX_COMBOCONTROL_H_ -IMPLEMENT_DYNAMIC_CLASS(wxComboCtrl, wxGenericComboCtrl) -#endif - -#endif // !wxCOMBOCONTROL_FULLY_FEATURED - -#endif // wxUSE_COMBOCTRL diff --git a/wxWidgets/src/generic/datavgen.cpp b/wxWidgets/src/generic/datavgen.cpp deleted file mode 100644 index 1a009bb114..0000000000 --- a/wxWidgets/src/generic/datavgen.cpp +++ /dev/null @@ -1,1911 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/generic/datavgen.cpp -// Purpose: wxDataViewCtrl generic implementation -// Author: Robert Roebling -// Id: $Id: datavgen.cpp 45498 2007-04-16 13:03:05Z VZ $ -// Copyright: (c) 1998 Robert Roebling -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_DATAVIEWCTRL - -#include "wx/dataview.h" - -#ifdef wxUSE_GENERICDATAVIEWCTRL - -#ifndef WX_PRECOMP - #ifdef __WXMSW__ - #include "wx/msw/wrapwin.h" - #endif - #include "wx/sizer.h" - #include "wx/log.h" - #include "wx/dcclient.h" - #include "wx/timer.h" - #include "wx/settings.h" - #include "wx/msgdlg.h" -#endif - -#include "wx/stockitem.h" -#include "wx/calctrl.h" -#include "wx/popupwin.h" -#include "wx/renderer.h" -#include "wx/dcbuffer.h" -#include "wx/icon.h" - -//----------------------------------------------------------------------------- -// classes -//----------------------------------------------------------------------------- - -class wxDataViewCtrl; - -//----------------------------------------------------------------------------- -// wxDataViewHeaderWindow -//----------------------------------------------------------------------------- - -class wxDataViewHeaderWindow: public wxWindow -{ -public: - wxDataViewHeaderWindow( wxDataViewCtrl *parent, - wxWindowID id, - const wxPoint &pos = wxDefaultPosition, - const wxSize &size = wxDefaultSize, - const wxString &name = wxT("wxdataviewctrlheaderwindow") ); - virtual ~wxDataViewHeaderWindow(); - - void SetOwner( wxDataViewCtrl* owner ) { m_owner = owner; } - wxDataViewCtrl *GetOwner() { return m_owner; } - - void OnPaint( wxPaintEvent &event ); - void OnMouse( wxMouseEvent &event ); - void OnSetFocus( wxFocusEvent &event ); - -private: - wxDataViewCtrl *m_owner; - wxCursor *m_resizeCursor; - -private: - DECLARE_DYNAMIC_CLASS(wxDataViewHeaderWindow) - DECLARE_EVENT_TABLE() -}; - -//----------------------------------------------------------------------------- -// wxDataViewRenameTimer -//----------------------------------------------------------------------------- - -class wxDataViewRenameTimer: public wxTimer -{ -private: - wxDataViewMainWindow *m_owner; - -public: - wxDataViewRenameTimer( wxDataViewMainWindow *owner ); - void Notify(); -}; - -//----------------------------------------------------------------------------- -// wxDataViewTextCtrlWrapper: wraps a wxTextCtrl for inline editing -//----------------------------------------------------------------------------- - -class wxDataViewTextCtrlWrapper : public wxEvtHandler -{ -public: - // NB: text must be a valid object but not Create()d yet - wxDataViewTextCtrlWrapper( wxDataViewMainWindow *owner, - wxTextCtrl *text, - wxDataViewListModel *model, - unsigned int col, unsigned int row, - wxRect cellLabel ); - - wxTextCtrl *GetText() const { return m_text; } - - void AcceptChangesAndFinish(); - -protected: - void OnChar( wxKeyEvent &event ); - void OnKeyUp( wxKeyEvent &event ); - void OnKillFocus( wxFocusEvent &event ); - - bool AcceptChanges(); - void Finish(); - -private: - wxDataViewMainWindow *m_owner; - wxTextCtrl *m_text; - wxString m_startValue; - wxDataViewListModel *m_model; - unsigned int m_col; - unsigned int m_row; - bool m_finished; - bool m_aboutToFinish; - - DECLARE_EVENT_TABLE() -}; - -//----------------------------------------------------------------------------- -// wxDataViewMainWindow -//----------------------------------------------------------------------------- - -WX_DEFINE_SORTED_USER_EXPORTED_ARRAY_SIZE_T(unsigned int, wxDataViewSelection, WXDLLIMPEXP_ADV); - -class wxDataViewMainWindow: public wxWindow -{ -public: - wxDataViewMainWindow( wxDataViewCtrl *parent, - wxWindowID id, - const wxPoint &pos = wxDefaultPosition, - const wxSize &size = wxDefaultSize, - const wxString &name = wxT("wxdataviewctrlmainwindow") ); - virtual ~wxDataViewMainWindow(); - - // notifications from wxDataViewListModel - bool RowAppended(); - bool RowPrepended(); - bool RowInserted( unsigned int before ); - bool RowDeleted( unsigned int row ); - bool RowChanged( unsigned int row ); - bool ValueChanged( unsigned int col, unsigned int row ); - bool RowsReordered( unsigned int *new_order ); - bool Cleared(); - - void SetOwner( wxDataViewCtrl* owner ) { m_owner = owner; } - wxDataViewCtrl *GetOwner() { return m_owner; } - - void OnPaint( wxPaintEvent &event ); - void OnArrowChar(unsigned int newCurrent, const wxKeyEvent& event); - void OnChar( wxKeyEvent &event ); - void OnMouse( wxMouseEvent &event ); - void OnSetFocus( wxFocusEvent &event ); - void OnKillFocus( wxFocusEvent &event ); - - void UpdateDisplay(); - void RecalculateDisplay(); - void OnInternalIdle(); - - void OnRenameTimer(); - void FinishEditing( wxTextCtrl *text ); - - void ScrollWindow( int dx, int dy, const wxRect *rect ); - - bool HasCurrentRow() { return m_currentRow != (unsigned int)-1; } - void ChangeCurrentRow( unsigned int row ); - - bool IsSingleSel() const { return !GetParent()->HasFlag(wxDV_MULTIPLE); } - bool IsEmpty() { return GetRowCount() == 0; } - - int GetCountPerPage(); - int GetEndOfLastCol(); - unsigned int GetFirstVisibleRow(); - unsigned int GetLastVisibleRow(); - unsigned int GetRowCount(); - - void SelectAllRows( bool on ); - void SelectRow( unsigned int row, bool on ); - void SelectRows( unsigned int from, unsigned int to, bool on ); - void ReverseRowSelection( unsigned int row ); - bool IsRowSelected( unsigned int row ); - - void RefreshRow( unsigned int row ); - void RefreshRows( unsigned int from, unsigned int to ); - void RefreshRowsAfter( unsigned int firstRow ); - -private: - wxDataViewCtrl *m_owner; - int m_lineHeight; - bool m_dirty; - - wxDataViewColumn *m_currentCol; - unsigned int m_currentRow; - wxDataViewSelection m_selection; - - wxDataViewRenameTimer *m_renameTimer; - wxDataViewTextCtrlWrapper *m_textctrlWrapper; - bool m_lastOnSame; - - bool m_hasFocus; - - int m_dragCount; - wxPoint m_dragStart; - - // for double click logic - unsigned int m_lineLastClicked, - m_lineBeforeLastClicked, - m_lineSelectSingleOnUp; - -private: - DECLARE_DYNAMIC_CLASS(wxDataViewMainWindow) - DECLARE_EVENT_TABLE() -}; - -// --------------------------------------------------------- -// wxGenericDataViewListModelNotifier -// --------------------------------------------------------- - -class wxGenericDataViewListModelNotifier: public wxDataViewListModelNotifier -{ -public: - wxGenericDataViewListModelNotifier( wxDataViewMainWindow *mainWindow ) - { m_mainWindow = mainWindow; } - - virtual bool RowAppended() - { return m_mainWindow->RowAppended(); } - virtual bool RowPrepended() - { return m_mainWindow->RowPrepended(); } - virtual bool RowInserted( unsigned int before ) - { return m_mainWindow->RowInserted( before ); } - virtual bool RowDeleted( unsigned int row ) - { return m_mainWindow->RowDeleted( row ); } - virtual bool RowChanged( unsigned int row ) - { return m_mainWindow->RowChanged( row ); } - virtual bool ValueChanged( unsigned int col, unsigned int row ) - { return m_mainWindow->ValueChanged( col, row ); } - virtual bool RowsReordered( unsigned int *new_order ) - { return m_mainWindow->RowsReordered( new_order ); } - virtual bool Cleared() - { return m_mainWindow->Cleared(); } - - wxDataViewMainWindow *m_mainWindow; -}; - -// --------------------------------------------------------- -// wxDataViewRenderer -// --------------------------------------------------------- - -IMPLEMENT_ABSTRACT_CLASS(wxDataViewRenderer, wxDataViewRendererBase) - -wxDataViewRenderer::wxDataViewRenderer( const wxString &varianttype, wxDataViewCellMode mode ) : - wxDataViewRendererBase( varianttype, mode ) -{ - m_dc = NULL; -} - -wxDataViewRenderer::~wxDataViewRenderer() -{ - if (m_dc) - delete m_dc; -} - -wxDC *wxDataViewRenderer::GetDC() -{ - if (m_dc == NULL) - { - if (GetOwner() == NULL) - return NULL; - if (GetOwner()->GetOwner() == NULL) - return NULL; - m_dc = new wxClientDC( GetOwner()->GetOwner() ); - } - - return m_dc; -} - -// --------------------------------------------------------- -// wxDataViewCustomRenderer -// --------------------------------------------------------- - -IMPLEMENT_ABSTRACT_CLASS(wxDataViewCustomRenderer, wxDataViewRenderer) - -wxDataViewCustomRenderer::wxDataViewCustomRenderer( const wxString &varianttype, - wxDataViewCellMode mode ) : - wxDataViewRenderer( varianttype, mode ) -{ -} - -// --------------------------------------------------------- -// wxDataViewTextRenderer -// --------------------------------------------------------- - -IMPLEMENT_CLASS(wxDataViewTextRenderer, wxDataViewCustomRenderer) - -wxDataViewTextRenderer::wxDataViewTextRenderer( const wxString &varianttype, wxDataViewCellMode mode ) : - wxDataViewCustomRenderer( varianttype, mode ) -{ -} - -bool wxDataViewTextRenderer::SetValue( const wxVariant &value ) -{ - m_text = value.GetString(); - - return true; -} - -bool wxDataViewTextRenderer::GetValue( wxVariant& WXUNUSED(value) ) -{ - return false; -} - -bool wxDataViewTextRenderer::Render( wxRect cell, wxDC *dc, int WXUNUSED(state) ) -{ - dc->DrawText( m_text, cell.x, cell.y ); - - return true; -} - -wxSize wxDataViewTextRenderer::GetSize() -{ - return wxSize(80,20); -} - -// --------------------------------------------------------- -// wxDataViewBitmapRenderer -// --------------------------------------------------------- - -IMPLEMENT_CLASS(wxDataViewBitmapRenderer, wxDataViewCustomRenderer) - -wxDataViewBitmapRenderer::wxDataViewBitmapRenderer( const wxString &varianttype, wxDataViewCellMode mode ) : - wxDataViewCustomRenderer( varianttype, mode ) -{ -} - -bool wxDataViewBitmapRenderer::SetValue( const wxVariant &value ) -{ - if (value.GetType() == wxT("wxBitmap")) - m_bitmap << value; - if (value.GetType() == wxT("wxIcon")) - m_icon << value; - - return true; -} - -bool wxDataViewBitmapRenderer::GetValue( wxVariant& WXUNUSED(value) ) -{ - return false; -} - -bool wxDataViewBitmapRenderer::Render( wxRect cell, wxDC *dc, int WXUNUSED(state) ) -{ - if (m_bitmap.Ok()) - dc->DrawBitmap( m_bitmap, cell.x, cell.y ); - else if (m_icon.Ok()) - dc->DrawIcon( m_icon, cell.x, cell.y ); - - return true; -} - -wxSize wxDataViewBitmapRenderer::GetSize() -{ - if (m_bitmap.Ok()) - return wxSize( m_bitmap.GetWidth(), m_bitmap.GetHeight() ); - else if (m_icon.Ok()) - return wxSize( m_icon.GetWidth(), m_icon.GetHeight() ); - - return wxSize(16,16); -} - -// --------------------------------------------------------- -// wxDataViewToggleRenderer -// --------------------------------------------------------- - -IMPLEMENT_ABSTRACT_CLASS(wxDataViewToggleRenderer, wxDataViewCustomRenderer) - -wxDataViewToggleRenderer::wxDataViewToggleRenderer( const wxString &varianttype, - wxDataViewCellMode mode ) : - wxDataViewCustomRenderer( varianttype, mode ) -{ - m_toggle = false; -} - -bool wxDataViewToggleRenderer::SetValue( const wxVariant &value ) -{ - m_toggle = value.GetBool(); - - return true; -} - -bool wxDataViewToggleRenderer::GetValue( wxVariant &WXUNUSED(value) ) -{ - return false; -} - -bool wxDataViewToggleRenderer::Render( wxRect cell, wxDC *dc, int WXUNUSED(state) ) -{ - // User wxRenderer here - - wxRect rect; - rect.x = cell.x + cell.width/2 - 10; - rect.width = 20; - rect.y = cell.y + cell.height/2 - 10; - rect.height = 20; - - int flags = 0; - if (m_toggle) - flags |= wxCONTROL_CHECKED; - if (GetMode() != wxDATAVIEW_CELL_ACTIVATABLE) - flags |= wxCONTROL_DISABLED; - - wxRendererNative::Get().DrawCheckBox( - GetOwner()->GetOwner(), - *dc, - rect, - flags ); - - return true; -} - -bool wxDataViewToggleRenderer::Activate( wxRect WXUNUSED(cell), wxDataViewListModel *model, unsigned int col, unsigned int row ) -{ - bool value = !m_toggle; - wxVariant variant = value; - model->SetValue( variant, col, row ); - model->ValueChanged( col, row ); - return true; -} - -wxSize wxDataViewToggleRenderer::GetSize() -{ - return wxSize(20,20); -} - -// --------------------------------------------------------- -// wxDataViewProgressRenderer -// --------------------------------------------------------- - -IMPLEMENT_ABSTRACT_CLASS(wxDataViewProgressRenderer, wxDataViewCustomRenderer) - -wxDataViewProgressRenderer::wxDataViewProgressRenderer( const wxString &label, - const wxString &varianttype, wxDataViewCellMode mode ) : - wxDataViewCustomRenderer( varianttype, mode ) -{ - m_label = label; - m_value = 0; -} - -wxDataViewProgressRenderer::~wxDataViewProgressRenderer() -{ -} - -bool wxDataViewProgressRenderer::SetValue( const wxVariant &value ) -{ - m_value = (long) value; - - if (m_value < 0) m_value = 0; - if (m_value > 100) m_value = 100; - - return true; -} - -bool wxDataViewProgressRenderer::Render( wxRect cell, wxDC *dc, int WXUNUSED(state) ) -{ - double pct = (double)m_value / 100.0; - wxRect bar = cell; - bar.width = (int)(cell.width * pct); - dc->SetPen( *wxTRANSPARENT_PEN ); - dc->SetBrush( *wxBLUE_BRUSH ); - dc->DrawRectangle( bar ); - - dc->SetBrush( *wxTRANSPARENT_BRUSH ); - dc->SetPen( *wxBLACK_PEN ); - dc->DrawRectangle( cell ); - - return true; -} - -wxSize wxDataViewProgressRenderer::GetSize() -{ - return wxSize(40,12); -} - -// --------------------------------------------------------- -// wxDataViewDateRenderer -// --------------------------------------------------------- - -#define wxUSE_DATE_RENDERER_POPUP (wxUSE_CALENDARCTRL && wxUSE_POPUPWIN) - -#if wxUSE_DATE_RENDERER_POPUP - -class wxDataViewDateRendererPopupTransient: public wxPopupTransientWindow -{ -public: - wxDataViewDateRendererPopupTransient( wxWindow* parent, wxDateTime *value, - wxDataViewListModel *model, unsigned int col, unsigned int row ) : - wxPopupTransientWindow( parent, wxBORDER_SIMPLE ) - { - m_model = model; - m_col = col; - m_row = row; - m_cal = new wxCalendarCtrl( this, wxID_ANY, *value ); - wxBoxSizer *sizer = new wxBoxSizer( wxHORIZONTAL ); - sizer->Add( m_cal, 1, wxGROW ); - SetSizer( sizer ); - sizer->Fit( this ); - } - - void OnCalendar( wxCalendarEvent &event ); - - wxCalendarCtrl *m_cal; - wxDataViewListModel *m_model; - unsigned int m_col; - unsigned int m_row; - -protected: - virtual void OnDismiss() - { - } - -private: - DECLARE_EVENT_TABLE() -}; - -BEGIN_EVENT_TABLE(wxDataViewDateRendererPopupTransient,wxPopupTransientWindow) - EVT_CALENDAR( wxID_ANY, wxDataViewDateRendererPopupTransient::OnCalendar ) -END_EVENT_TABLE() - -void wxDataViewDateRendererPopupTransient::OnCalendar( wxCalendarEvent &event ) -{ - wxDateTime date = event.GetDate(); - wxVariant value = date; - m_model->SetValue( value, m_col, m_row ); - m_model->ValueChanged( m_col, m_row ); - DismissAndNotify(); -} - -#endif // wxUSE_DATE_RENDERER_POPUP - -IMPLEMENT_ABSTRACT_CLASS(wxDataViewDateRenderer, wxDataViewCustomRenderer) - -wxDataViewDateRenderer::wxDataViewDateRenderer( const wxString &varianttype, - wxDataViewCellMode mode ) : - wxDataViewCustomRenderer( varianttype, mode ) -{ -} - -bool wxDataViewDateRenderer::SetValue( const wxVariant &value ) -{ - m_date = value.GetDateTime(); - - return true; -} - -bool wxDataViewDateRenderer::Render( wxRect cell, wxDC *dc, int WXUNUSED(state) ) -{ - dc->SetFont( GetOwner()->GetOwner()->GetFont() ); - wxString tmp = m_date.FormatDate(); - dc->DrawText( tmp, cell.x, cell.y ); - - return true; -} - -wxSize wxDataViewDateRenderer::GetSize() -{ - wxDataViewCtrl* view = GetOwner()->GetOwner(); - wxString tmp = m_date.FormatDate(); - wxCoord x,y,d; - view->GetTextExtent( tmp, &x, &y, &d ); - return wxSize(x,y+d); -} - -bool wxDataViewDateRenderer::Activate( wxRect WXUNUSED(cell), wxDataViewListModel *model, unsigned int col, unsigned int row ) -{ - wxVariant variant; - model->GetValue( variant, col, row ); - wxDateTime value = variant.GetDateTime(); - -#if wxUSE_DATE_RENDERER_POPUP - wxDataViewDateRendererPopupTransient *popup = new wxDataViewDateRendererPopupTransient( - GetOwner()->GetOwner()->GetParent(), &value, model, col, row ); - wxPoint pos = wxGetMousePosition(); - popup->Move( pos ); - popup->Layout(); - popup->Popup( popup->m_cal ); -#else // !wxUSE_DATE_RENDERER_POPUP - wxMessageBox(value.Format()); -#endif // wxUSE_DATE_RENDERER_POPUP/!wxUSE_DATE_RENDERER_POPUP - return true; -} - -// --------------------------------------------------------- -// wxDataViewColumn -// --------------------------------------------------------- - -IMPLEMENT_ABSTRACT_CLASS(wxDataViewColumn, wxDataViewColumnBase) - -wxDataViewColumn::wxDataViewColumn( const wxString &title, wxDataViewRenderer *cell, unsigned int model_column, - int width, int flags ) : - wxDataViewColumnBase( title, cell, model_column, width, flags ) -{ - m_width = width; - if (m_width < 0) - m_width = 80; -} - -wxDataViewColumn::wxDataViewColumn( const wxBitmap &bitmap, wxDataViewRenderer *cell, unsigned int model_column, - int width, int flags ) : - wxDataViewColumnBase( bitmap, cell, model_column, width, flags ) -{ - m_width = width; - if (m_width < 0) - m_width = 30; -} - -void wxDataViewColumn::SetAlignment( wxAlignment WXUNUSED(align) ) -{ - // TODO -} - -void wxDataViewColumn::SetSortable( bool WXUNUSED(sortable) ) -{ - // TODO -} - -bool wxDataViewColumn::GetSortable() -{ - // TODO - return false; -} - -void wxDataViewColumn::SetSortOrder( bool WXUNUSED(ascending) ) -{ - // TODO -} - -bool wxDataViewColumn::IsSortOrderAscending() -{ - // TODO - return true; -} - - -wxDataViewColumn::~wxDataViewColumn() -{ -} - -void wxDataViewColumn::SetTitle( const wxString &title ) -{ - wxDataViewColumnBase::SetTitle( title ); - -} - -void wxDataViewColumn::SetBitmap( const wxBitmap &bitmap ) -{ - wxDataViewColumnBase::SetBitmap( bitmap ); - -} - -int wxDataViewColumn::GetWidth() -{ - return m_width; -} - -//----------------------------------------------------------------------------- -// wxDataViewHeaderWindow -//----------------------------------------------------------------------------- - -IMPLEMENT_ABSTRACT_CLASS(wxDataViewHeaderWindow, wxWindow) - -BEGIN_EVENT_TABLE(wxDataViewHeaderWindow,wxWindow) - EVT_PAINT (wxDataViewHeaderWindow::OnPaint) - EVT_MOUSE_EVENTS (wxDataViewHeaderWindow::OnMouse) - EVT_SET_FOCUS (wxDataViewHeaderWindow::OnSetFocus) -END_EVENT_TABLE() - -wxDataViewHeaderWindow::wxDataViewHeaderWindow( wxDataViewCtrl *parent, wxWindowID id, - const wxPoint &pos, const wxSize &size, const wxString &name ) : - wxWindow( parent, id, pos, size, 0, name ) -{ - SetOwner( parent ); - - m_resizeCursor = new wxCursor( wxCURSOR_SIZEWE ); - - wxVisualAttributes attr = wxPanel::GetClassDefaultAttributes(); - SetBackgroundStyle( wxBG_STYLE_CUSTOM ); - SetOwnForegroundColour( attr.colFg ); - SetOwnBackgroundColour( attr.colBg ); - if (!m_hasFont) - SetOwnFont( attr.font ); -} - -wxDataViewHeaderWindow::~wxDataViewHeaderWindow() -{ - delete m_resizeCursor; -} - -void wxDataViewHeaderWindow::OnPaint( wxPaintEvent &WXUNUSED(event) ) -{ - int w, h; - GetClientSize( &w, &h ); - - wxAutoBufferedPaintDC dc( this ); - - dc.SetBackground(GetBackgroundColour()); - dc.Clear(); - - int xpix; - m_owner->GetScrollPixelsPerUnit( &xpix, NULL ); - - int x; - m_owner->GetViewStart( &x, NULL ); - - // account for the horz scrollbar offset - dc.SetDeviceOrigin( -x * xpix, 0 ); - - dc.SetFont( GetFont() ); - - unsigned int cols = GetOwner()->GetNumberOfColumns(); - unsigned int i; - int xpos = 0; - for (i = 0; i < cols; i++) - { - wxDataViewColumn *col = GetOwner()->GetColumn( i ); - int width = col->GetWidth(); - - int cw = width; - int ch = h; - - wxRendererNative::Get().DrawHeaderButton - ( - this, - dc, - wxRect(xpos, 0, cw, ch-1), - m_parent->IsEnabled() ? 0 - : (int)wxCONTROL_DISABLED - ); - - dc.DrawText( col->GetTitle(), xpos+3, 3 ); - - xpos += width; - } -} - -void wxDataViewHeaderWindow::OnMouse( wxMouseEvent &WXUNUSED(event) ) -{ -} - -void wxDataViewHeaderWindow::OnSetFocus( wxFocusEvent &event ) -{ - GetParent()->SetFocus(); - event.Skip(); -} - -//----------------------------------------------------------------------------- -// wxDataViewRenameTimer -//----------------------------------------------------------------------------- - -wxDataViewRenameTimer::wxDataViewRenameTimer( wxDataViewMainWindow *owner ) -{ - m_owner = owner; -} - -void wxDataViewRenameTimer::Notify() -{ - m_owner->OnRenameTimer(); -} - -//----------------------------------------------------------------------------- -// wxDataViewTextCtrlWrapper: wraps a wxTextCtrl for inline editing -//----------------------------------------------------------------------------- - -BEGIN_EVENT_TABLE(wxDataViewTextCtrlWrapper, wxEvtHandler) - EVT_CHAR (wxDataViewTextCtrlWrapper::OnChar) - EVT_KEY_UP (wxDataViewTextCtrlWrapper::OnKeyUp) - EVT_KILL_FOCUS (wxDataViewTextCtrlWrapper::OnKillFocus) -END_EVENT_TABLE() - -wxDataViewTextCtrlWrapper::wxDataViewTextCtrlWrapper( - wxDataViewMainWindow *owner, - wxTextCtrl *text, - wxDataViewListModel *model, - unsigned int col, unsigned int row, - wxRect rectLabel ) -{ - m_owner = owner; - m_model = model; - m_row = row; - m_col = col; - m_text = text; - - m_finished = false; - m_aboutToFinish = false; - - wxVariant value; - model->GetValue( value, col, row ); - m_startValue = value.GetString(); - - m_owner->GetOwner()->CalcScrolledPosition( - rectLabel.x, rectLabel.y, &rectLabel.x, &rectLabel.y ); - - m_text->Create( owner, wxID_ANY, m_startValue, - wxPoint(rectLabel.x-2,rectLabel.y-2), - wxSize(rectLabel.width+7,rectLabel.height+4) ); - m_text->SetFocus(); - - m_text->PushEventHandler(this); -} - -void wxDataViewTextCtrlWrapper::AcceptChangesAndFinish() -{ - m_aboutToFinish = true; - - // Notify the owner about the changes - AcceptChanges(); - - // Even if vetoed, close the control (consistent with MSW) - Finish(); -} - -void wxDataViewTextCtrlWrapper::OnChar( wxKeyEvent &event ) -{ - switch ( event.m_keyCode ) - { - case WXK_RETURN: - AcceptChangesAndFinish(); - break; - - case WXK_ESCAPE: - // m_owner->OnRenameCancelled( m_itemEdited ); - Finish(); - break; - - default: - event.Skip(); - } -} - -void wxDataViewTextCtrlWrapper::OnKeyUp( wxKeyEvent &event ) -{ - if (m_finished) - { - event.Skip(); - return; - } - - // auto-grow the textctrl - wxSize parentSize = m_owner->GetSize(); - wxPoint myPos = m_text->GetPosition(); - wxSize mySize = m_text->GetSize(); - int sx, sy; - m_text->GetTextExtent(m_text->GetValue() + _T("MM"), &sx, &sy); - if (myPos.x + sx > parentSize.x) - sx = parentSize.x - myPos.x; - if (mySize.x > sx) - sx = mySize.x; - m_text->SetSize(sx, wxDefaultCoord); - - event.Skip(); -} - -void wxDataViewTextCtrlWrapper::OnKillFocus( wxFocusEvent &event ) -{ - if ( !m_finished && !m_aboutToFinish ) - { - AcceptChanges(); - //if ( !AcceptChanges() ) - // m_owner->OnRenameCancelled( m_itemEdited ); - - Finish(); - } - - // We must let the native text control handle focus - event.Skip(); -} - -bool wxDataViewTextCtrlWrapper::AcceptChanges() -{ - const wxString value = m_text->GetValue(); - - if ( value == m_startValue ) - // nothing changed, always accept - return true; - -// if ( !m_owner->OnRenameAccept(m_itemEdited, value) ) - // vetoed by the user -// return false; - - // accepted, do rename the item - wxVariant variant; - variant = value; - m_model->SetValue( variant, m_col, m_row ); - m_model->ValueChanged( m_col, m_row ); - - return true; -} - -void wxDataViewTextCtrlWrapper::Finish() -{ - if ( !m_finished ) - { - m_finished = true; - - m_text->RemoveEventHandler(this); - m_owner->FinishEditing(m_text); - - // delete later - wxPendingDelete.Append( this ); - } -} - -//----------------------------------------------------------------------------- -// wxDataViewMainWindow -//----------------------------------------------------------------------------- - -int LINKAGEMODE wxDataViewSelectionCmp( unsigned int row1, unsigned int row2 ) -{ - if (row1 > row2) return 1; - if (row1 == row2) return 0; - return -1; -} - - -IMPLEMENT_ABSTRACT_CLASS(wxDataViewMainWindow, wxWindow) - -BEGIN_EVENT_TABLE(wxDataViewMainWindow,wxWindow) - EVT_PAINT (wxDataViewMainWindow::OnPaint) - EVT_MOUSE_EVENTS (wxDataViewMainWindow::OnMouse) - EVT_SET_FOCUS (wxDataViewMainWindow::OnSetFocus) - EVT_KILL_FOCUS (wxDataViewMainWindow::OnKillFocus) - EVT_CHAR (wxDataViewMainWindow::OnChar) -END_EVENT_TABLE() - -wxDataViewMainWindow::wxDataViewMainWindow( wxDataViewCtrl *parent, wxWindowID id, - const wxPoint &pos, const wxSize &size, const wxString &name ) : - wxWindow( parent, id, pos, size, wxWANTS_CHARS, name ), - m_selection( wxDataViewSelectionCmp ) - -{ - SetOwner( parent ); - - m_lastOnSame = false; - m_renameTimer = new wxDataViewRenameTimer( this ); - m_textctrlWrapper = NULL; - - // TODO: user better initial values/nothing selected - m_currentCol = NULL; - m_currentRow = 0; - - // TODO: we need to calculate this smartly - m_lineHeight = 20; - - m_dragCount = 0; - m_dragStart = wxPoint(0,0); - m_lineLastClicked = (unsigned int) -1; - m_lineBeforeLastClicked = (unsigned int) -1; - m_lineSelectSingleOnUp = (unsigned int) -1; - - m_hasFocus = false; - - SetBackgroundStyle( wxBG_STYLE_CUSTOM ); - SetBackgroundColour( *wxWHITE ); - - UpdateDisplay(); -} - -wxDataViewMainWindow::~wxDataViewMainWindow() -{ - delete m_renameTimer; -} - -void wxDataViewMainWindow::OnRenameTimer() -{ - // We have to call this here because changes may just have - // been made and no screen update taken place. - if ( m_dirty ) - wxSafeYield(); - - - int xpos = 0; - unsigned int cols = GetOwner()->GetNumberOfColumns(); - unsigned int i; - for (i = 0; i < cols; i++) - { - wxDataViewColumn *c = GetOwner()->GetColumn( i ); - if (c == m_currentCol) - break; - xpos += c->GetWidth(); - } - wxRect labelRect( xpos, m_currentRow * m_lineHeight, m_currentCol->GetWidth(), m_lineHeight ); - - wxClassInfo *textControlClass = CLASSINFO(wxTextCtrl); - - wxTextCtrl * const text = (wxTextCtrl *)textControlClass->CreateObject(); - m_textctrlWrapper = new wxDataViewTextCtrlWrapper(this, text, GetOwner()->GetModel(), - m_currentCol->GetModelColumn(), m_currentRow, labelRect ); -} - -void wxDataViewMainWindow::FinishEditing( wxTextCtrl *text ) -{ - delete text; - m_textctrlWrapper = NULL; - SetFocus(); - // SetFocusIgnoringChildren(); -} - -bool wxDataViewMainWindow::RowAppended() -{ - return false; -} - -bool wxDataViewMainWindow::RowPrepended() -{ - return false; -} - -bool wxDataViewMainWindow::RowInserted( unsigned int WXUNUSED(before) ) -{ - return false; -} - -bool wxDataViewMainWindow::RowDeleted( unsigned int WXUNUSED(row) ) -{ - return false; -} - -bool wxDataViewMainWindow::RowChanged( unsigned int WXUNUSED(row) ) -{ - return false; -} - -bool wxDataViewMainWindow::ValueChanged( unsigned int WXUNUSED(col), unsigned int row ) -{ - wxRect rect( 0, row*m_lineHeight, 10000, m_lineHeight ); - m_owner->CalcScrolledPosition( rect.x, rect.y, &rect.x, &rect.y ); - Refresh( true, &rect ); - - return true; -} - -bool wxDataViewMainWindow::RowsReordered( unsigned int *WXUNUSED(new_order) ) -{ - Refresh(); - - return true; -} - -bool wxDataViewMainWindow::Cleared() -{ - return false; -} - -void wxDataViewMainWindow::UpdateDisplay() -{ - m_dirty = true; -} - -void wxDataViewMainWindow::OnInternalIdle() -{ - wxWindow::OnInternalIdle(); - - if (m_dirty) - { - RecalculateDisplay(); - m_dirty = false; - } -} - -void wxDataViewMainWindow::RecalculateDisplay() -{ - wxDataViewListModel *model = GetOwner()->GetModel(); - if (!model) - { - Refresh(); - return; - } - - int width = 0; - unsigned int cols = GetOwner()->GetNumberOfColumns(); - unsigned int i; - for (i = 0; i < cols; i++) - { - wxDataViewColumn *col = GetOwner()->GetColumn( i ); - width += col->GetWidth(); - } - - int height = model->GetNumberOfRows() * m_lineHeight; - - SetVirtualSize( width, height ); - GetOwner()->SetScrollRate( 10, m_lineHeight ); - - Refresh(); -} - -void wxDataViewMainWindow::ScrollWindow( int dx, int dy, const wxRect *rect ) -{ - wxWindow::ScrollWindow( dx, dy, rect ); - GetOwner()->m_headerArea->ScrollWindow( dx, 0 ); -} - -void wxDataViewMainWindow::OnPaint( wxPaintEvent &WXUNUSED(event) ) -{ - wxAutoBufferedPaintDC dc( this ); - - dc.SetBackground(GetBackgroundColour()); - dc.Clear(); - - GetOwner()->PrepareDC( dc ); - - dc.SetFont( GetFont() ); - - wxRect update = GetUpdateRegion().GetBox(); - m_owner->CalcUnscrolledPosition( update.x, update.y, &update.x, &update.y ); - - wxDataViewListModel *model = GetOwner()->GetModel(); - - unsigned int item_start = wxMax( 0, (update.y / m_lineHeight) ); - unsigned int item_count = wxMin( (int)(((update.y + update.height) / m_lineHeight) - item_start + 1), - (int)(model->GetNumberOfRows()-item_start) ); - - - - unsigned int item; - for (item = item_start; item < item_start+item_count; item++) - { - if (m_selection.Index( item ) != wxNOT_FOUND) - { - int flags = wxCONTROL_SELECTED; - if (item == m_currentRow) - flags |= wxCONTROL_CURRENT; - if (m_hasFocus) - flags |= wxCONTROL_FOCUSED; - wxRect rect( 0, item*m_lineHeight+1, GetEndOfLastCol(), m_lineHeight-2 ); - wxRendererNative::Get().DrawItemSelectionRect - ( - this, - dc, - rect, - flags - ); - } - else - { - if (item == m_currentRow) - { - int flags = wxCONTROL_CURRENT; - if (m_hasFocus) - flags |= wxCONTROL_FOCUSED; // should have no effect - wxRect rect( 0, item*m_lineHeight+1, GetEndOfLastCol(), m_lineHeight-2 ); - wxRendererNative::Get().DrawItemSelectionRect - ( - this, - dc, - rect, - flags - ); - - } - } - } - - wxRect cell_rect; - cell_rect.x = 0; - cell_rect.height = m_lineHeight; - unsigned int cols = GetOwner()->GetNumberOfColumns(); - unsigned int i; - for (i = 0; i < cols; i++) - { - wxDataViewColumn *col = GetOwner()->GetColumn( i ); - wxDataViewRenderer *cell = col->GetRenderer(); - cell_rect.width = col->GetWidth(); - - for (item = item_start; item < item_start+item_count; item++) - { - cell_rect.y = item*m_lineHeight; - wxVariant value; - model->GetValue( value, col->GetModelColumn(), item ); - cell->SetValue( value ); - wxSize size = cell->GetSize(); - // cannot be bigger than allocated space - size.x = wxMin( size.x, cell_rect.width ); - size.y = wxMin( size.y, cell_rect.height ); - // TODO: check for left/right/centre alignment here - wxRect item_rect; - // for now: centre - item_rect.x = cell_rect.x + (cell_rect.width / 2) - (size.x / 2); - item_rect.y = cell_rect.y + (cell_rect.height / 2) - (size.y / 2); - - item_rect.width = size.x; - item_rect.height= size.y; - - int state = 0; - if (item == m_currentRow) - state |= wxDATAVIEW_CELL_SELECTED; - cell->Render( item_rect, &dc, state ); - } - - cell_rect.x += cell_rect.width; - } -} - -int wxDataViewMainWindow::GetCountPerPage() -{ - wxSize size = GetClientSize(); - return size.y / m_lineHeight; -} - -int wxDataViewMainWindow::GetEndOfLastCol() -{ - int width = 0; - unsigned int i; - for (i = 0; i < GetOwner()->GetNumberOfColumns(); i++) - { - wxDataViewColumn *c = GetOwner()->GetColumn( i ); - width += c->GetWidth(); - } - return width; -} - -unsigned int wxDataViewMainWindow::GetFirstVisibleRow() -{ - int x = 0; - int y = 0; - m_owner->CalcUnscrolledPosition( x, y, &x, &y ); - - return y / m_lineHeight; -} - -unsigned int wxDataViewMainWindow::GetLastVisibleRow() -{ - wxSize client_size = GetClientSize(); - m_owner->CalcUnscrolledPosition( client_size.x, client_size.y, &client_size.x, &client_size.y ); - - return wxMin( GetRowCount()-1, ((unsigned)client_size.y/m_lineHeight)+1 ); -} - -unsigned int wxDataViewMainWindow::GetRowCount() -{ - return GetOwner()->GetModel()->GetNumberOfRows(); -} - -void wxDataViewMainWindow::ChangeCurrentRow( unsigned int row ) -{ - m_currentRow = row; - - // send event -} - -void wxDataViewMainWindow::SelectAllRows( bool on ) -{ - if (IsEmpty()) - return; - - if (on) - { - m_selection.Clear(); - for (unsigned int i = 0; i < GetRowCount(); i++) - m_selection.Add( i ); - Refresh(); - } - else - { - unsigned int first_visible = GetFirstVisibleRow(); - unsigned int last_visible = GetLastVisibleRow(); - unsigned int i; - for (i = 0; i < m_selection.GetCount(); i++) - { - unsigned int row = m_selection[i]; - if ((row >= first_visible) && (row <= last_visible)) - RefreshRow( row ); - } - m_selection.Clear(); - } -} - -void wxDataViewMainWindow::SelectRow( unsigned int row, bool on ) -{ - if (m_selection.Index( row ) == wxNOT_FOUND) - { - if (on) - { - m_selection.Add( row ); - RefreshRow( row ); - } - } - else - { - if (!on) - { - m_selection.Remove( row ); - RefreshRow( row ); - } - } -} - -void wxDataViewMainWindow::SelectRows( unsigned int from, unsigned int to, bool on ) -{ - if (from > to) - { - unsigned int tmp = from; - from = to; - to = tmp; - } - - unsigned int i; - for (i = from; i <= to; i++) - { - if (m_selection.Index( i ) == wxNOT_FOUND) - { - if (on) - m_selection.Add( i ); - } - else - { - if (!on) - m_selection.Remove( i ); - } - } - RefreshRows( from, to ); -} - -void wxDataViewMainWindow::ReverseRowSelection( unsigned int row ) -{ - if (m_selection.Index( row ) == wxNOT_FOUND) - m_selection.Add( row ); - else - m_selection.Remove( row ); - RefreshRow( row ); -} - -bool wxDataViewMainWindow::IsRowSelected( unsigned int row ) -{ - return (m_selection.Index( row ) != wxNOT_FOUND); -} - -void wxDataViewMainWindow::RefreshRow( unsigned int row ) -{ - wxRect rect( 0, row*m_lineHeight, GetEndOfLastCol(), m_lineHeight ); - m_owner->CalcScrolledPosition( rect.x, rect.y, &rect.x, &rect.y ); - - wxSize client_size = GetClientSize(); - wxRect client_rect( 0, 0, client_size.x, client_size.y ); - wxRect intersect_rect = client_rect.Intersect( rect ); - if (intersect_rect.width > 0) - Refresh( true, &intersect_rect ); -} - -void wxDataViewMainWindow::RefreshRows( unsigned int from, unsigned int to ) -{ - if (from > to) - { - unsigned int tmp = to; - to = from; - from = tmp; - } - - wxRect rect( 0, from*m_lineHeight, GetEndOfLastCol(), (to-from+1) * m_lineHeight ); - m_owner->CalcScrolledPosition( rect.x, rect.y, &rect.x, &rect.y ); - - wxSize client_size = GetClientSize(); - wxRect client_rect( 0, 0, client_size.x, client_size.y ); - wxRect intersect_rect = client_rect.Intersect( rect ); - if (intersect_rect.width > 0) - Refresh( true, &intersect_rect ); -} - -void wxDataViewMainWindow::RefreshRowsAfter( unsigned int firstRow ) -{ - unsigned int count = GetRowCount(); - if (firstRow > count) - return; - - wxRect rect( 0, firstRow*m_lineHeight, GetEndOfLastCol(), count * m_lineHeight ); - m_owner->CalcScrolledPosition( rect.x, rect.y, &rect.x, &rect.y ); - - wxSize client_size = GetClientSize(); - wxRect client_rect( 0, 0, client_size.x, client_size.y ); - wxRect intersect_rect = client_rect.Intersect( rect ); - if (intersect_rect.width > 0) - Refresh( true, &intersect_rect ); -} - -void wxDataViewMainWindow::OnArrowChar(unsigned int newCurrent, const wxKeyEvent& event) -{ - wxCHECK_RET( newCurrent < GetRowCount(), - _T("invalid item index in OnArrowChar()") ); - - // if there is no selection, we cannot move it anywhere - if (!HasCurrentRow()) - return; - - unsigned int oldCurrent = m_currentRow; - - // in single selection we just ignore Shift as we can't select several - // items anyhow - if ( event.ShiftDown() && !IsSingleSel() ) - { - RefreshRow( oldCurrent ); - - ChangeCurrentRow( newCurrent ); - - // select all the items between the old and the new one - if ( oldCurrent > newCurrent ) - { - newCurrent = oldCurrent; - oldCurrent = m_currentRow; - } - - SelectRows( oldCurrent, newCurrent, true ); - } - else // !shift - { - RefreshRow( oldCurrent ); - - // all previously selected items are unselected unless ctrl is held - if ( !event.ControlDown() ) - SelectAllRows(false); - - ChangeCurrentRow( newCurrent ); - - if ( !event.ControlDown() ) - SelectRow( m_currentRow, true ); - else - RefreshRow( m_currentRow ); - } - - // MoveToFocus(); -} - -void wxDataViewMainWindow::OnChar( wxKeyEvent &event ) -{ - if (event.GetKeyCode() == WXK_TAB) - { - wxNavigationKeyEvent nevent; - nevent.SetWindowChange( event.ControlDown() ); - nevent.SetDirection( !event.ShiftDown() ); - nevent.SetEventObject( GetParent()->GetParent() ); - nevent.SetCurrentFocus( m_parent ); - if (GetParent()->GetParent()->GetEventHandler()->ProcessEvent( nevent )) - return; - } - - // no item -> nothing to do - if (!HasCurrentRow()) - { - event.Skip(); - return; - } - - // don't use m_linesPerPage directly as it might not be computed yet - const int pageSize = GetCountPerPage(); - wxCHECK_RET( pageSize, _T("should have non zero page size") ); - - switch ( event.GetKeyCode() ) - { - case WXK_UP: - if ( m_currentRow > 0 ) - OnArrowChar( m_currentRow - 1, event ); - break; - - case WXK_DOWN: - if ( m_currentRow < GetRowCount() - 1 ) - OnArrowChar( m_currentRow + 1, event ); - break; - - case WXK_END: - if (!IsEmpty()) - OnArrowChar( GetRowCount() - 1, event ); - break; - - case WXK_HOME: - if (!IsEmpty()) - OnArrowChar( 0, event ); - break; - - case WXK_PAGEUP: - { - int steps = pageSize - 1; - int index = m_currentRow - steps; - if (index < 0) - index = 0; - - OnArrowChar( index, event ); - } - break; - - case WXK_PAGEDOWN: - { - int steps = pageSize - 1; - unsigned int index = m_currentRow + steps; - unsigned int count = GetRowCount(); - if ( index >= count ) - index = count - 1; - - OnArrowChar( index, event ); - } - break; - - default: - event.Skip(); - } -} - -void wxDataViewMainWindow::OnMouse( wxMouseEvent &event ) -{ - if (event.GetEventType() == wxEVT_MOUSEWHEEL) - { - // let the base handle mouse wheel events. - event.Skip(); - return; - } - - int x = event.GetX(); - int y = event.GetY(); - m_owner->CalcUnscrolledPosition( x, y, &x, &y ); - - wxDataViewColumn *col = NULL; - - int xpos = 0; - unsigned int cols = GetOwner()->GetNumberOfColumns(); - unsigned int i; - for (i = 0; i < cols; i++) - { - wxDataViewColumn *c = GetOwner()->GetColumn( i ); - if (x < xpos + c->GetWidth()) - { - col = c; - break; - } - xpos += c->GetWidth(); - } - if (!col) - return; - wxDataViewRenderer *cell = col->GetRenderer(); - - unsigned int current = y / m_lineHeight; - - if ((current > GetRowCount()) || (x > GetEndOfLastCol())) - { - // Unselect all if below the last row ? - return; - } - - wxDataViewListModel *model = GetOwner()->GetModel(); - - if (event.Dragging()) - { - if (m_dragCount == 0) - { - // we have to report the raw, physical coords as we want to be - // able to call HitTest(event.m_pointDrag) from the user code to - // get the item being dragged - m_dragStart = event.GetPosition(); - } - - m_dragCount++; - - if (m_dragCount != 3) - return; - - if (event.LeftIsDown()) - { - // Notify cell about drag - } - return; - } - else - { - m_dragCount = 0; - } - - bool forceClick = false; - - if (event.ButtonDClick()) - { - m_renameTimer->Stop(); - m_lastOnSame = false; - } - - if (event.LeftDClick()) - { - if ( current == m_lineLastClicked ) - { - if (cell->GetMode() == wxDATAVIEW_CELL_ACTIVATABLE) - { - wxVariant value; - model->GetValue( value, col->GetModelColumn(), current ); - cell->SetValue( value ); - wxRect cell_rect( xpos, current * m_lineHeight, col->GetWidth(), m_lineHeight ); - cell->Activate( cell_rect, model, col->GetModelColumn(), current ); - } - return; - } - else - { - // The first click was on another item, so don't interpret this as - // a double click, but as a simple click instead - forceClick = true; - } - } - - if (event.LeftUp()) - { - if (m_lineSelectSingleOnUp != (unsigned int)-1) - { - // select single line - SelectAllRows( false ); - SelectRow( m_lineSelectSingleOnUp, true ); - } - - if (m_lastOnSame) - { - if ((col == m_currentCol) && (current == m_currentRow) && - (cell->GetMode() == wxDATAVIEW_CELL_EDITABLE) ) - { - m_renameTimer->Start( 100, true ); - } - } - - m_lastOnSame = false; - m_lineSelectSingleOnUp = (unsigned int)-1; - } - else - { - // This is necessary, because after a DnD operation in - // from and to ourself, the up event is swallowed by the - // DnD code. So on next non-up event (which means here and - // now) m_lineSelectSingleOnUp should be reset. - m_lineSelectSingleOnUp = (unsigned int)-1; - } - - if (event.RightDown()) - { - m_lineBeforeLastClicked = m_lineLastClicked; - m_lineLastClicked = current; - - // If the item is already selected, do not update the selection. - // Multi-selections should not be cleared if a selected item is clicked. - if (!IsRowSelected(current)) - { - SelectAllRows(false); - ChangeCurrentRow(current); - SelectRow(m_currentRow,true); - } - - // notify cell about right click - // cell->... - - // Allow generation of context menu event - event.Skip(); - } - else if (event.MiddleDown()) - { - // notify cell about middle click - // cell->... - } - if (event.LeftDown() || forceClick) - { -#ifdef __WXMSW__ - SetFocus(); -#endif - - m_lineBeforeLastClicked = m_lineLastClicked; - m_lineLastClicked = current; - - unsigned int oldCurrentRow = m_currentRow; - bool oldWasSelected = IsRowSelected(m_currentRow); - - bool cmdModifierDown = event.CmdDown(); - if ( IsSingleSel() || !(cmdModifierDown || event.ShiftDown()) ) - { - if ( IsSingleSel() || !IsRowSelected(current) ) - { - SelectAllRows( false ); - - ChangeCurrentRow(current); - - SelectRow(m_currentRow,true); - } - else // multi sel & current is highlighted & no mod keys - { - m_lineSelectSingleOnUp = current; - ChangeCurrentRow(current); // change focus - } - } - else // multi sel & either ctrl or shift is down - { - if (cmdModifierDown) - { - ChangeCurrentRow(current); - - ReverseRowSelection(m_currentRow); - } - else if (event.ShiftDown()) - { - ChangeCurrentRow(current); - - unsigned int lineFrom = oldCurrentRow, - lineTo = current; - - if ( lineTo < lineFrom ) - { - lineTo = lineFrom; - lineFrom = m_currentRow; - } - - SelectRows(lineFrom, lineTo, true); - } - else // !ctrl, !shift - { - // test in the enclosing if should make it impossible - wxFAIL_MSG( _T("how did we get here?") ); - } - } - - if (m_currentRow != oldCurrentRow) - RefreshRow( oldCurrentRow ); - - wxDataViewColumn *oldCurrentCol = m_currentCol; - - // Update selection here... - m_currentCol = col; - - m_lastOnSame = !forceClick && ((col == oldCurrentCol) && (current == oldCurrentRow)) && oldWasSelected; - } -} - -void wxDataViewMainWindow::OnSetFocus( wxFocusEvent &event ) -{ - m_hasFocus = true; - - if (HasCurrentRow()) - Refresh(); - - event.Skip(); -} - -void wxDataViewMainWindow::OnKillFocus( wxFocusEvent &event ) -{ - m_hasFocus = false; - - if (HasCurrentRow()) - Refresh(); - - event.Skip(); -} - -//----------------------------------------------------------------------------- -// wxDataViewCtrl -//----------------------------------------------------------------------------- - -IMPLEMENT_DYNAMIC_CLASS(wxDataViewCtrl, wxDataViewCtrlBase) - -BEGIN_EVENT_TABLE(wxDataViewCtrl, wxDataViewCtrlBase) - EVT_SIZE(wxDataViewCtrl::OnSize) -END_EVENT_TABLE() - -wxDataViewCtrl::~wxDataViewCtrl() -{ - if (m_notifier) - GetModel()->RemoveNotifier( m_notifier ); -} - -void wxDataViewCtrl::Init() -{ - m_notifier = NULL; -} - -bool wxDataViewCtrl::Create(wxWindow *parent, wxWindowID id, - const wxPoint& pos, const wxSize& size, - long style, const wxValidator& validator ) -{ - if (!wxControl::Create( parent, id, pos, size, style | wxScrolledWindowStyle|wxSUNKEN_BORDER, validator)) - return false; - - Init(); - -#ifdef __WXMAC__ - MacSetClipChildren( true ) ; -#endif - - m_clientArea = new wxDataViewMainWindow( this, wxID_ANY ); -#ifdef __WXMSW__ - m_headerArea = new wxDataViewHeaderWindow( this, wxID_ANY, wxDefaultPosition, wxSize(wxDefaultCoord,22) ); -#else - m_headerArea = new wxDataViewHeaderWindow( this, wxID_ANY, wxDefaultPosition, wxSize(wxDefaultCoord,25) ); -#endif - - SetTargetWindow( m_clientArea ); - - wxBoxSizer *sizer = new wxBoxSizer( wxVERTICAL ); - sizer->Add( m_headerArea, 0, wxGROW ); - sizer->Add( m_clientArea, 1, wxGROW ); - SetSizer( sizer ); - - return true; -} - -#ifdef __WXMSW__ -WXLRESULT wxDataViewCtrl::MSWWindowProc(WXUINT nMsg, - WXWPARAM wParam, - WXLPARAM lParam) -{ - WXLRESULT rc = wxDataViewCtrlBase::MSWWindowProc(nMsg, wParam, lParam); - -#ifndef __WXWINCE__ - // we need to process arrows ourselves for scrolling - if ( nMsg == WM_GETDLGCODE ) - { - rc |= DLGC_WANTARROWS; - } -#endif - - return rc; -} -#endif - -void wxDataViewCtrl::OnSize( wxSizeEvent &WXUNUSED(event) ) -{ - // We need to override OnSize so that our scrolled - // window a) does call Layout() to use sizers for - // positioning the controls but b) does not query - // the sizer for their size and use that for setting - // the scrollable area as set that ourselves by - // calling SetScrollbar() further down. - - Layout(); - - AdjustScrollbars(); -} - -bool wxDataViewCtrl::AssociateModel( wxDataViewListModel *model ) -{ - if (!wxDataViewCtrlBase::AssociateModel( model )) - return false; - - m_notifier = new wxGenericDataViewListModelNotifier( m_clientArea ); - - model->AddNotifier( m_notifier ); - - m_clientArea->UpdateDisplay(); - - return true; -} - -bool wxDataViewCtrl::AppendColumn( wxDataViewColumn *col ) -{ - if (!wxDataViewCtrlBase::AppendColumn(col)) - return false; - - m_clientArea->UpdateDisplay(); - - return true; -} - -void wxDataViewCtrl::SetSelection( int WXUNUSED(row) ) -{ - // FIXME - TODO -} - -void wxDataViewCtrl::SetSelectionRange( unsigned int WXUNUSED(from), unsigned int WXUNUSED(to) ) -{ - // FIXME - TODO -} - -void wxDataViewCtrl::SetSelections( const wxArrayInt& WXUNUSED(aSelections) ) -{ - // FIXME - TODO -} - -void wxDataViewCtrl::Unselect( unsigned int WXUNUSED(row) ) -{ - // FIXME - TODO -} - -bool wxDataViewCtrl::IsSelected( unsigned int WXUNUSED(row) ) const -{ - // FIXME - TODO - - return false; -} - -int wxDataViewCtrl::GetSelection() const -{ - // FIXME - TODO - - return -1; -} - -int wxDataViewCtrl::GetSelections(wxArrayInt& WXUNUSED(aSelections) ) const -{ - // FIXME - TODO - - return 0; -} - -#endif - // !wxUSE_GENERICDATAVIEWCTRL - -#endif - // wxUSE_DATAVIEWCTRL diff --git a/wxWidgets/src/generic/datectlg.cpp b/wxWidgets/src/generic/datectlg.cpp deleted file mode 100644 index 1554d29142..0000000000 --- a/wxWidgets/src/generic/datectlg.cpp +++ /dev/null @@ -1,545 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/generic/datectlg.cpp -// Purpose: generic wxDatePickerCtrlGeneric implementation -// Author: Andreas Pflug -// Modified by: -// Created: 2005-01-19 -// RCS-ID: $Id: datectlg.cpp 54407 2008-06-28 18:58:07Z VZ $ -// Copyright: (c) 2005 Andreas Pflug -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_DATEPICKCTRL - -#include "wx/datectrl.h" - -// use this version if we're explicitly requested to do it or if it's the only -// one we have -#if !defined(wxHAS_NATIVE_DATEPICKCTRL) || \ - (defined(wxUSE_DATEPICKCTRL_GENERIC) && wxUSE_DATEPICKCTRL_GENERIC) - -#ifndef WX_PRECOMP - #include "wx/dialog.h" - #include "wx/dcmemory.h" - #include "wx/panel.h" - #include "wx/textctrl.h" - #include "wx/valtext.h" -#endif - -#ifdef wxHAS_NATIVE_DATEPICKCTRL - // this header is not included from wx/datectrl.h if we have a native - // version, but we do need it here - #include "wx/generic/datectrl.h" -#else - // we need to define _WX_DEFINE_DATE_EVENTS_ before including wx/dateevt.h to - // define the event types we use if we're the only date picker control version - // being compiled -- otherwise it's defined in the native version implementation - #define _WX_DEFINE_DATE_EVENTS_ -#endif - -#include "wx/dateevt.h" - -#include "wx/calctrl.h" -#include "wx/combo.h" - -// ---------------------------------------------------------------------------- -// constants -// ---------------------------------------------------------------------------- - -#if defined(__WXMSW__) - #define CALBORDER 0 -#else - #define CALBORDER 4 -#endif - -// ---------------------------------------------------------------------------- -// global variables -// ---------------------------------------------------------------------------- - - -// ---------------------------------------------------------------------------- -// local classes -// ---------------------------------------------------------------------------- - -class wxCalendarComboPopup : public wxCalendarCtrl, - public wxComboPopup -{ -public: - - wxCalendarComboPopup() : wxCalendarCtrl(), - wxComboPopup() - { - } - - virtual void Init() - { - } - - // NB: Don't create lazily since it didn't work that way before - // wxComboCtrl was used, and changing behaviour would almost - // certainly introduce new bugs. - virtual bool Create(wxWindow* parent) - { - if ( !wxCalendarCtrl::Create(parent, wxID_ANY, wxDefaultDateTime, - wxPoint(0, 0), wxDefaultSize, - wxCAL_SHOW_HOLIDAYS | wxBORDER_SUNKEN) ) - return false; - - wxWindow *yearControl = wxCalendarCtrl::GetYearControl(); - - wxClientDC dc(yearControl); - dc.SetFont(yearControl->GetFont()); - wxCoord width, dummy; - dc.GetTextExtent(wxT("2000"), &width, &dummy); - width += ConvertDialogToPixels(wxSize(20, 0)).x; - - wxSize calSize = wxCalendarCtrl::GetBestSize(); - wxSize yearSize = yearControl->GetSize(); - yearSize.x = width; - - wxPoint yearPosition = yearControl->GetPosition(); - - SetFormat(wxT("%x")); - - width = yearPosition.x + yearSize.x+2+CALBORDER/2; - if (width < calSize.x-4) - width = calSize.x-4; - - int calPos = (width-calSize.x)/2; - if (calPos == -1) - { - calPos = 0; - width += 2; - } - wxCalendarCtrl::SetSize(calPos, 0, calSize.x, calSize.y); - yearControl->SetSize(width-yearSize.x-CALBORDER/2, yearPosition.y, - yearSize.x, yearSize.y); - wxCalendarCtrl::GetMonthControl()->Move(0, 0); - - m_useSize.x = width+CALBORDER/2; - m_useSize.y = calSize.y-2+CALBORDER; - - wxWindow* tx = m_combo->GetTextCtrl(); - if ( !tx ) - tx = m_combo; - - tx->Connect(wxEVT_KILL_FOCUS, - wxFocusEventHandler(wxCalendarComboPopup::OnKillTextFocus), - NULL, this); - - return true; - } - - virtual wxSize GetAdjustedSize(int WXUNUSED(minWidth), - int WXUNUSED(prefHeight), - int WXUNUSED(maxHeight)) - { - return m_useSize; - } - - virtual wxWindow *GetControl() { return this; } - - void SetDateValue(const wxDateTime& date) - { - if ( date.IsValid() ) - { - m_combo->SetText(date.Format(m_format)); - SetDate(date); - } - else // invalid date - { - wxASSERT_MSG( HasDPFlag(wxDP_ALLOWNONE), - _T("this control must have a valid date") ); - - m_combo->SetText(wxEmptyString); - } - } - - bool IsTextEmpty() const - { - return m_combo->GetTextCtrl()->IsEmpty(); - } - - bool ParseDateTime(const wxString& s, wxDateTime* pDt) - { - wxASSERT(pDt); - - if ( !s.empty() ) - { - pDt->ParseFormat(s, m_format); - if ( !pDt->IsValid() ) - return false; - } - - return true; - } - - void SendDateEvent(const wxDateTime& dt) - { - // - // Sends both wxCalendarEvent and wxDateEvent - wxWindow* datePicker = m_combo->GetParent(); - - wxCalendarEvent cev((wxCalendarCtrl*) this, wxEVT_CALENDAR_SEL_CHANGED); - cev.SetEventObject(datePicker); - cev.SetId(datePicker->GetId()); - cev.SetDate(dt); - datePicker->GetEventHandler()->ProcessEvent(cev); - - wxDateEvent event(datePicker, dt, wxEVT_DATE_CHANGED); - datePicker->GetEventHandler()->ProcessEvent(event); - } - -private: - - void OnCalKey(wxKeyEvent & ev) - { - if (ev.GetKeyCode() == WXK_ESCAPE && !ev.HasModifiers()) - Dismiss(); - else - ev.Skip(); - } - - void OnSelChange(wxCalendarEvent &ev) - { - m_combo->SetText(GetDate().Format(m_format)); - - if ( ev.GetEventType() == wxEVT_CALENDAR_DOUBLECLICKED ) - { - Dismiss(); - } - - SendDateEvent(GetDate()); - } - - void OnKillTextFocus(wxFocusEvent &ev) - { - ev.Skip(); - - const wxDateTime& dtOld = GetDate(); - - wxDateTime dt; - wxString value = m_combo->GetValue(); - if ( !ParseDateTime(value, &dt) ) - { - if ( !HasDPFlag(wxDP_ALLOWNONE) ) - dt = dtOld; - } - - m_combo->SetText(GetStringValueFor(dt)); - - if ( !dt.IsValid() && HasDPFlag(wxDP_ALLOWNONE) ) - return; - - // notify that we had to change the date after validation - if ( (dt.IsValid() && (!dtOld.IsValid() || dt != dtOld)) || - (!dt.IsValid() && dtOld.IsValid()) ) - { - SetDate(dt); - SendDateEvent(dt); - } - } - - bool HasDPFlag(int flag) - { - return m_combo->GetParent()->HasFlag(flag); - } - - bool SetFormat(const wxChar *fmt) - { - m_format.clear(); - - wxDateTime dt; - dt.ParseFormat(wxT("2003-10-13"), wxT("%Y-%m-%d")); - wxString str(dt.Format(fmt)); - - const wxChar *p = str.c_str(); - while ( *p ) - { - int n=wxAtoi(p); - if (n == dt.GetDay()) - { - m_format.Append(wxT("%d")); - p += 2; - } - else if (n == (int)dt.GetMonth()+1) - { - m_format.Append(wxT("%m")); - p += 2; - } - else if (n == dt.GetYear()) - { - m_format.Append(wxT("%Y")); - p += 4; - } - else if (n == (dt.GetYear() % 100)) - { - if ( HasDPFlag(wxDP_SHOWCENTURY) ) - m_format.Append(wxT("%Y")); - else - m_format.Append(wxT("%y")); - p += 2; - } - else - m_format.Append(*p++); - } - - if ( m_combo ) - { - wxArrayString allowedChars; - for ( wxChar c = _T('0'); c <= _T('9'); c++ ) - allowedChars.Add(wxString(c, 1)); - - const wxChar *p2 = m_format.c_str(); - while ( *p2 ) - { - if ( *p2 == '%') - p2 += 2; - else - allowedChars.Add(wxString(*p2++, 1)); - } - - #if wxUSE_VALIDATORS - wxTextValidator tv(wxFILTER_INCLUDE_CHAR_LIST); - tv.SetIncludes(allowedChars); - m_combo->SetValidator(tv); - #endif - - if ( GetDate().IsValid() ) - m_combo->SetText(GetDate().Format(m_format)); - } - - return true; - } - - virtual void SetStringValue(const wxString& s) - { - wxDateTime dt; - if ( !s.empty() && ParseDateTime(s, &dt) ) - SetDate(dt); - //else: keep the old value - } - - virtual wxString GetStringValue() const - { - return GetStringValueFor(GetDate()); - } - -private: - // returns either the given date representation using the current format or - // an empty string if it's invalid - wxString GetStringValueFor(const wxDateTime& dt) const - { - wxString val; - if ( dt.IsValid() ) - val = dt.Format(m_format); - - return val; - } - - wxSize m_useSize; - wxString m_format; - - DECLARE_EVENT_TABLE() -}; - - -BEGIN_EVENT_TABLE(wxCalendarComboPopup, wxCalendarCtrl) - EVT_KEY_DOWN(wxCalendarComboPopup::OnCalKey) - EVT_CALENDAR_SEL_CHANGED(wxID_ANY, wxCalendarComboPopup::OnSelChange) - EVT_CALENDAR_DAY(wxID_ANY, wxCalendarComboPopup::OnSelChange) - EVT_CALENDAR_MONTH(wxID_ANY, wxCalendarComboPopup::OnSelChange) - EVT_CALENDAR_YEAR(wxID_ANY, wxCalendarComboPopup::OnSelChange) - EVT_CALENDAR(wxID_ANY, wxCalendarComboPopup::OnSelChange) -END_EVENT_TABLE() - - -// ============================================================================ -// wxDatePickerCtrlGeneric implementation -// ============================================================================ - -BEGIN_EVENT_TABLE(wxDatePickerCtrlGeneric, wxDatePickerCtrlBase) - EVT_TEXT(wxID_ANY, wxDatePickerCtrlGeneric::OnText) - EVT_SIZE(wxDatePickerCtrlGeneric::OnSize) - EVT_SET_FOCUS(wxDatePickerCtrlGeneric::OnFocus) -END_EVENT_TABLE() - -#ifndef wxHAS_NATIVE_DATEPICKCTRL - IMPLEMENT_DYNAMIC_CLASS(wxDatePickerCtrl, wxControl) -#endif - -// ---------------------------------------------------------------------------- -// creation -// ---------------------------------------------------------------------------- - -bool wxDatePickerCtrlGeneric::Create(wxWindow *parent, - wxWindowID id, - const wxDateTime& date, - const wxPoint& pos, - const wxSize& size, - long style, - const wxValidator& validator, - const wxString& name) -{ - wxASSERT_MSG( !(style & wxDP_SPIN), - _T("wxDP_SPIN style not supported, use wxDP_DEFAULT") ); - - if ( !wxControl::Create(parent, id, pos, size, - style | wxCLIP_CHILDREN | wxWANTS_CHARS | wxBORDER_NONE, - validator, name) ) - { - return false; - } - - InheritAttributes(); - - m_combo = new wxComboCtrl(this, -1, wxEmptyString, - wxDefaultPosition, wxDefaultSize); - - m_combo->SetCtrlMainWnd(this); - - m_popup = new wxCalendarComboPopup(); - m_cal = m_popup; - -#if defined(__WXMSW__) - // without this keyboard navigation in month control doesn't work - m_combo->UseAltPopupWindow(); -#endif - m_combo->SetPopupControl(m_popup); - - m_popup->SetDateValue(date.IsValid() ? date : wxDateTime::Today()); - - SetInitialSize(size); - - return true; -} - - -void wxDatePickerCtrlGeneric::Init() -{ - m_combo = NULL; - m_popup = NULL; - m_cal = NULL; -} - -wxDatePickerCtrlGeneric::~wxDatePickerCtrlGeneric() -{ -} - -bool wxDatePickerCtrlGeneric::Destroy() -{ - if ( m_combo ) - m_combo->Destroy(); - - m_combo = NULL; - m_popup = NULL; - m_cal = NULL; - - return wxControl::Destroy(); -} - -// ---------------------------------------------------------------------------- -// overridden base class methods -// ---------------------------------------------------------------------------- - -wxSize wxDatePickerCtrlGeneric::DoGetBestSize() const -{ - return m_combo->GetBestSize(); -} - -// ---------------------------------------------------------------------------- -// wxDatePickerCtrlGeneric API -// ---------------------------------------------------------------------------- - -bool -wxDatePickerCtrlGeneric::SetDateRange(const wxDateTime& lowerdate, - const wxDateTime& upperdate) -{ - return m_popup->SetDateRange(lowerdate, upperdate); -} - - -wxDateTime wxDatePickerCtrlGeneric::GetValue() const -{ - if ( HasFlag(wxDP_ALLOWNONE) && m_popup->IsTextEmpty() ) - return wxInvalidDateTime; - return m_popup->GetDate(); -} - - -void wxDatePickerCtrlGeneric::SetValue(const wxDateTime& date) -{ - m_popup->SetDateValue(date); -} - - -bool wxDatePickerCtrlGeneric::GetRange(wxDateTime *dt1, wxDateTime *dt2) const -{ - if (dt1) - *dt1 = m_popup->GetLowerDateLimit(); - if (dt2) - *dt2 = m_popup->GetUpperDateLimit(); - return true; -} - - -void -wxDatePickerCtrlGeneric::SetRange(const wxDateTime &dt1, const wxDateTime &dt2) -{ - m_popup->SetDateRange(dt1, dt2); -} - -// ---------------------------------------------------------------------------- -// event handlers -// ---------------------------------------------------------------------------- - - -void wxDatePickerCtrlGeneric::OnSize(wxSizeEvent& event) -{ - if ( m_combo ) - m_combo->SetSize(GetClientSize()); - - event.Skip(); -} - - -void wxDatePickerCtrlGeneric::OnText(wxCommandEvent &ev) -{ - ev.SetEventObject(this); - ev.SetId(GetId()); - GetParent()->ProcessEvent(ev); - - // We'll create an additional event if the date is valid. - // If the date isn't valid, the user's probably in the middle of typing - wxDateTime dt; - if ( !m_popup->ParseDateTime(m_combo->GetValue(), &dt) ) - return; - - m_popup->SendDateEvent(dt); -} - - -void wxDatePickerCtrlGeneric::OnFocus(wxFocusEvent& WXUNUSED(event)) -{ - m_combo->SetFocus(); -} - - -#endif // wxUSE_DATEPICKCTRL_GENERIC - -#endif // wxUSE_DATEPICKCTRL - diff --git a/wxWidgets/src/generic/dbgrptg.cpp b/wxWidgets/src/generic/dbgrptg.cpp deleted file mode 100644 index 85d45d5a23..0000000000 --- a/wxWidgets/src/generic/dbgrptg.cpp +++ /dev/null @@ -1,525 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: src/generic/dbgrptg.cpp -// Purpose: implementation of wxDebugReportPreviewStd -// Author: Vadim Zeitlin, Andrej Putrin -// Modified by: -// Created: 2005-01-21 -// RCS-ID: $Id: dbgrptg.cpp 61631 2009-08-09 15:55:56Z JS $ -// Copyright: (c) 2005 Vadim Zeitlin -// License: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_DEBUGREPORT && wxUSE_XML - -#include "wx/debugrpt.h" - -#ifndef WX_PRECOMP - #include "wx/sizer.h" - #include "wx/checklst.h" - #include "wx/textctrl.h" - #include "wx/intl.h" - #include "wx/stattext.h" - #include "wx/filedlg.h" - #include "wx/valtext.h" - #include "wx/button.h" -#endif // WX_PRECOMP - -#include "wx/filename.h" -#include "wx/ffile.h" -#include "wx/mimetype.h" - -#include "wx/statline.h" - -#ifdef __WXMSW__ - #include "wx/evtloop.h" // for SetCriticalWindow() -#endif // __WXMSW__ - -// ---------------------------------------------------------------------------- -// wxDumpPreviewDlg: simple class for showing ASCII preview of dump files -// ---------------------------------------------------------------------------- - -class wxDumpPreviewDlg : public wxDialog -{ -public: - wxDumpPreviewDlg(wxWindow *parent, - const wxString& title, - const wxString& text); - -private: - // the text we show - wxTextCtrl *m_text; - - DECLARE_NO_COPY_CLASS(wxDumpPreviewDlg) -}; - -wxDumpPreviewDlg::wxDumpPreviewDlg(wxWindow *parent, - const wxString& title, - const wxString& text) - : wxDialog(parent, wxID_ANY, title, - wxDefaultPosition, wxDefaultSize, - wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER) -{ - // create controls - // --------------- - - // use wxTE_RICH2 style to avoid 64kB limit under MSW and display big files - // faster than with wxTE_RICH - m_text = new wxTextCtrl(this, wxID_ANY, wxEmptyString, - wxPoint(0, 0), wxDefaultSize, - wxTE_MULTILINE | - wxTE_READONLY | - wxTE_NOHIDESEL | - wxTE_RICH2); - m_text->SetValue(text); - - // use fixed-width font - m_text->SetFont(wxFont(12, wxFONTFAMILY_TELETYPE, - wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL)); - - wxButton *btnClose = new wxButton(this, wxID_CANCEL, _("Close")); - - - // layout them - // ----------- - - wxSizer *sizerTop = new wxBoxSizer(wxVERTICAL), - *sizerBtns = new wxBoxSizer(wxHORIZONTAL); - - sizerBtns->Add(btnClose, 0, 0, 1); - - sizerTop->Add(m_text, 1, wxEXPAND); - sizerTop->Add(sizerBtns, 0, wxALIGN_RIGHT | wxTOP | wxBOTTOM | wxRIGHT, 1); - - // set the sizer &c - // ---------------- - - // make the text window bigger to show more contents of the file - sizerTop->SetItemMinSize(m_text, 600, 300); - SetSizer(sizerTop); - - Layout(); - Fit(); - - m_text->SetFocus(); -} - -// ---------------------------------------------------------------------------- -// wxDumpOpenExternalDlg: choose a command for opening the given file -// ---------------------------------------------------------------------------- - -class wxDumpOpenExternalDlg : public wxDialog -{ -public: - wxDumpOpenExternalDlg(wxWindow *parent, const wxFileName& filename); - - // return the command chosed by user to open this file - const wxString& GetCommand() const { return m_command; } - - wxString m_command; - -private: - -#if wxUSE_FILEDLG - void OnBrowse(wxCommandEvent& event); -#endif // wxUSE_FILEDLG - - DECLARE_EVENT_TABLE() - DECLARE_NO_COPY_CLASS(wxDumpOpenExternalDlg) -}; - -BEGIN_EVENT_TABLE(wxDumpOpenExternalDlg, wxDialog) - -#if wxUSE_FILEDLG - EVT_BUTTON(wxID_MORE, wxDumpOpenExternalDlg::OnBrowse) -#endif - -END_EVENT_TABLE() - - -wxDumpOpenExternalDlg::wxDumpOpenExternalDlg(wxWindow *parent, - const wxFileName& filename) - : wxDialog(parent, - wxID_ANY, - wxString::Format - ( - _("Open file \"%s\""), - filename.GetFullPath().c_str() - )) -{ - // create controls - // --------------- - - wxSizer *sizerTop = new wxBoxSizer(wxVERTICAL); - sizerTop->Add(new wxStaticText(this, wxID_ANY, - wxString::Format - ( - _("Enter command to open file \"%s\":"), - filename.GetFullName().c_str() - )), - wxSizerFlags().Border()); - - wxSizer *sizerH = new wxBoxSizer(wxHORIZONTAL); - - wxTextCtrl *command = new wxTextCtrl - ( - this, - wxID_ANY, - wxEmptyString, - wxDefaultPosition, - wxSize(250, wxDefaultCoord), - 0 -#if wxUSE_VALIDATORS - ,wxTextValidator(wxFILTER_NONE, &m_command) -#endif - ); - sizerH->Add(command, - wxSizerFlags(1).Align(wxALIGN_CENTER_VERTICAL)); - -#if wxUSE_FILEDLG - - wxButton *browse = new wxButton(this, wxID_MORE, wxT(">>"), - wxDefaultPosition, wxDefaultSize, - wxBU_EXACTFIT); - sizerH->Add(browse, - wxSizerFlags(0).Align(wxALIGN_CENTER_VERTICAL). Border(wxLEFT)); - -#endif // wxUSE_FILEDLG - - sizerTop->Add(sizerH, wxSizerFlags(0).Expand().Border()); - - sizerTop->Add(new wxStaticLine(this), wxSizerFlags().Expand().Border()); - - sizerTop->Add(CreateStdDialogButtonSizer(wxOK | wxCANCEL), - wxSizerFlags().Align(wxALIGN_RIGHT).Border()); - - // set the sizer &c - // ---------------- - - SetSizer(sizerTop); - - Layout(); - Fit(); - - command->SetFocus(); -} - -#if wxUSE_FILEDLG - -void wxDumpOpenExternalDlg::OnBrowse(wxCommandEvent& ) -{ - wxFileName fname(m_command); - wxFileDialog dlg(this, - wxFileSelectorPromptStr, - fname.GetPathWithSep(), - fname.GetFullName() -#ifdef __WXMSW__ - , _("Executable files (*.exe)|*.exe|All files (*.*)|*.*||") -#endif // __WXMSW__ - ); - if ( dlg.ShowModal() == wxID_OK ) - { - m_command = dlg.GetPath(); - TransferDataToWindow(); - } -} - -#endif // wxUSE_FILEDLG - -// ---------------------------------------------------------------------------- -// wxDebugReportDialog: class showing debug report to the user -// ---------------------------------------------------------------------------- - -class wxDebugReportDialog : public wxDialog -{ -public: - wxDebugReportDialog(wxDebugReport& dbgrpt); - - virtual bool TransferDataToWindow(); - virtual bool TransferDataFromWindow(); - -private: - void OnView(wxCommandEvent& ); - void OnViewUpdate(wxUpdateUIEvent& ); - void OnOpen(wxCommandEvent& ); - - - // small helper: add wxEXPAND and wxALL flags - static wxSizerFlags SizerFlags(int proportion) - { - return wxSizerFlags(proportion).Expand().Border(); - } - - - wxDebugReport& m_dbgrpt; - - wxCheckListBox *m_checklst; - wxTextCtrl *m_notes; - - wxArrayString m_files; - - DECLARE_EVENT_TABLE() - DECLARE_NO_COPY_CLASS(wxDebugReportDialog) -}; - -// ============================================================================ -// wxDebugReportDialog implementation -// ============================================================================ - -BEGIN_EVENT_TABLE(wxDebugReportDialog, wxDialog) - EVT_BUTTON(wxID_VIEW_DETAILS, wxDebugReportDialog::OnView) - EVT_UPDATE_UI(wxID_VIEW_DETAILS, wxDebugReportDialog::OnViewUpdate) - EVT_BUTTON(wxID_OPEN, wxDebugReportDialog::OnOpen) - EVT_UPDATE_UI(wxID_OPEN, wxDebugReportDialog::OnViewUpdate) -END_EVENT_TABLE() - - -// ---------------------------------------------------------------------------- -// construction -// ---------------------------------------------------------------------------- - -wxDebugReportDialog::wxDebugReportDialog(wxDebugReport& dbgrpt) - : wxDialog(NULL, wxID_ANY, - wxString::Format(_("Debug report \"%s\""), - dbgrpt.GetReportName().c_str()), - wxDefaultPosition, - wxDefaultSize, - wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER), - m_dbgrpt(dbgrpt) -{ - // upper part of the dialog: explanatory message - wxString msg; - wxString debugDir = dbgrpt.GetDirectory(); - - // The temporary directory can be the short form on Windows; - // normalize it for the benefit of users. -#ifdef __WXMSW__ - wxFileName debugDirFilename(debugDir, wxEmptyString); - debugDirFilename.Normalize(wxPATH_NORM_LONG); - debugDir = debugDirFilename.GetPath(); -#endif - msg << _("A debug report has been generated in the directory\n") - << _T('\n') - << _T(" \"") << debugDir << _T("\"\n") - << _T('\n') - << _("The report contains the files listed below. If any of these files contain private information,\nplease uncheck them and they will be removed from the report.\n") - << _T('\n') - << _("If you wish to suppress this debug report completely, please choose the \"Cancel\" button,\nbut be warned that it may hinder improving the program, so if\nat all possible please do continue with the report generation.\n") - << _T('\n') - << _(" Thank you and we're sorry for the inconvenience!\n") - << _T("\n\n"); // just some white space to separate from other stuff - - const wxSizerFlags flagsFixed(SizerFlags(0)); - const wxSizerFlags flagsExpand(SizerFlags(1)); - const wxSizerFlags flagsExpand2(SizerFlags(2)); - - wxSizer *sizerPreview = - new wxStaticBoxSizer(wxVERTICAL, this, _("&Debug report preview:")); - sizerPreview->Add(CreateTextSizer(msg), SizerFlags(0).Centre()); - - // ... and the list of files in this debug report with buttons to view them - wxSizer *sizerFileBtns = new wxBoxSizer(wxVERTICAL); - sizerFileBtns->AddStretchSpacer(1); - sizerFileBtns->Add(new wxButton(this, wxID_VIEW_DETAILS, _("&View...")), - wxSizerFlags().Border(wxBOTTOM)); - sizerFileBtns->Add(new wxButton(this, wxID_OPEN, _("&Open...")), - wxSizerFlags().Border(wxTOP)); - sizerFileBtns->AddStretchSpacer(1); - - m_checklst = new wxCheckListBox(this, wxID_ANY); - - wxSizer *sizerFiles = new wxBoxSizer(wxHORIZONTAL); - sizerFiles->Add(m_checklst, flagsExpand); - sizerFiles->Add(sizerFileBtns, flagsFixed); - - sizerPreview->Add(sizerFiles, flagsExpand2); - - - // lower part of the dialog: notes field - wxSizer *sizerNotes = new wxStaticBoxSizer(wxVERTICAL, this, _("&Notes:")); - - msg = _("If you have any additional information pertaining to this bug\nreport, please enter it here and it will be joined to it:"); - - m_notes = new wxTextCtrl(this, wxID_ANY, wxEmptyString, - wxDefaultPosition, wxDefaultSize, - wxTE_MULTILINE); - - sizerNotes->Add(CreateTextSizer(msg), flagsFixed); - sizerNotes->Add(m_notes, flagsExpand); - - - wxSizer *sizerTop = new wxBoxSizer(wxVERTICAL); - sizerTop->Add(sizerPreview, flagsExpand2); - sizerTop->AddSpacer(5); - sizerTop->Add(sizerNotes, flagsExpand); - sizerTop->Add(CreateStdDialogButtonSizer(wxOK | wxCANCEL), flagsFixed); - - SetSizerAndFit(sizerTop); - Layout(); - CentreOnScreen(); -} - -// ---------------------------------------------------------------------------- -// data exchange -// ---------------------------------------------------------------------------- - -bool wxDebugReportDialog::TransferDataToWindow() -{ - // all files are included in the report by default - const size_t count = m_dbgrpt.GetFilesCount(); - for ( size_t n = 0; n < count; n++ ) - { - wxString name, - desc; - if ( m_dbgrpt.GetFile(n, &name, &desc) ) - { - m_checklst->Append(name + _T(" (") + desc + _T(')')); - m_checklst->Check(n); - - m_files.Add(name); - } - } - - return true; -} - -bool wxDebugReportDialog::TransferDataFromWindow() -{ - // any unchecked files should be removed from the report - const size_t count = m_checklst->GetCount(); - for ( size_t n = 0; n < count; n++ ) - { - if ( !m_checklst->IsChecked(n) ) - { - m_dbgrpt.RemoveFile(m_files[n]); - } - } - - // if the user entered any notes, add them to the report - const wxString notes = m_notes->GetValue(); - if ( !notes.empty() ) - { - // for now filename fixed, could make it configurable in the future... - m_dbgrpt.AddText(_T("notes.txt"), notes, _T("user notes")); - } - - return true; -} - -// ---------------------------------------------------------------------------- -// event handlers -// ---------------------------------------------------------------------------- - -void wxDebugReportDialog::OnView(wxCommandEvent& ) -{ - const int sel = m_checklst->GetSelection(); - wxCHECK_RET( sel != wxNOT_FOUND, _T("invalid selection in OnView()") ); - - wxFileName fn(m_dbgrpt.GetDirectory(), m_files[sel]); - wxString str; - - wxFFile file(fn.GetFullPath()); - if ( file.IsOpened() && file.ReadAll(&str) ) - { - wxDumpPreviewDlg dlg(this, m_files[sel], str); - dlg.ShowModal(); - } -} - -void wxDebugReportDialog::OnOpen(wxCommandEvent& ) -{ - const int sel = m_checklst->GetSelection(); - wxCHECK_RET( sel != wxNOT_FOUND, _T("invalid selection in OnOpen()") ); - - wxFileName fn(m_dbgrpt.GetDirectory(), m_files[sel]); - - // try to get the command to open this kind of files ourselves - wxString command; -#if wxUSE_MIMETYPE - wxFileType * - ft = wxTheMimeTypesManager->GetFileTypeFromExtension(fn.GetExt()); - if ( ft ) - { - command = ft->GetOpenCommand(fn.GetFullPath()); - delete ft; - } -#endif // wxUSE_MIMETYPE - - // if we couldn't, ask the user - if ( command.empty() ) - { - wxDumpOpenExternalDlg dlg(this, fn); - if ( dlg.ShowModal() == wxID_OK ) - { - // get the command chosen by the user and append file name to it - - // if we don't have place marker for file name in the command... - wxString cmd = dlg.GetCommand(); - if ( !cmd.empty() ) - { -#if wxUSE_MIMETYPE - if ( cmd.find(_T('%')) != wxString::npos ) - { - command = wxFileType::ExpandCommand(cmd, fn.GetFullPath()); - } - else // no %s nor %1 -#endif // wxUSE_MIMETYPE - { - // append the file name to the end - command << cmd << _T(" \"") << fn.GetFullPath() << _T('"'); - } - } - } - } - - if ( !command.empty() ) - ::wxExecute(command); -} - -void wxDebugReportDialog::OnViewUpdate(wxUpdateUIEvent& event) -{ - int sel = m_checklst->GetSelection(); - if (sel >= 0) - { - wxFileName fn(m_dbgrpt.GetDirectory(), m_files[sel]); - event.Enable(fn.FileExists()); - } - else - event.Enable(false); -} - - -// ============================================================================ -// wxDebugReportPreviewStd implementation -// ============================================================================ - -bool wxDebugReportPreviewStd::Show(wxDebugReport& dbgrpt) const -{ - if ( !dbgrpt.GetFilesCount() ) - return false; - - wxDebugReportDialog dlg(dbgrpt); - -#ifdef __WXMSW__ - // before entering the event loop (from ShowModal()), block the event - // handling for all other windows as this could result in more crashes - wxEventLoop::SetCriticalWindow(&dlg); -#endif // __WXMSW__ - - return dlg.ShowModal() == wxID_OK && dbgrpt.GetFilesCount() != 0; -} - -#endif // wxUSE_DEBUGREPORT && wxUSE_XML diff --git a/wxWidgets/src/generic/dcpsg.cpp b/wxWidgets/src/generic/dcpsg.cpp deleted file mode 100644 index e2eadde151..0000000000 --- a/wxWidgets/src/generic/dcpsg.cpp +++ /dev/null @@ -1,2262 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/generic/dcpsg.cpp -// Purpose: Generic wxPostScriptDC implementation -// Author: Julian Smart, Robert Roebling, Markus Holzhem -// Modified by: -// Created: 04/01/98 -// RCS-ID: $Id: dcpsg.cpp 55927 2008-09-28 09:12:16Z VS $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_PRINTING_ARCHITECTURE && wxUSE_POSTSCRIPT - -#include "wx/generic/dcpsg.h" - -#ifndef WX_PRECOMP - #include "wx/intl.h" - #include "wx/log.h" - #include "wx/utils.h" - #include "wx/dcmemory.h" - #include "wx/math.h" - #include "wx/image.h" - #include "wx/icon.h" -#endif // WX_PRECOMP - -#include "wx/prntbase.h" -#include "wx/generic/prntdlgg.h" -#include "wx/paper.h" -#include "wx/filefn.h" -#include "wx/stdpaths.h" - -WXDLLIMPEXP_DATA_CORE(int) wxPageNumber; - -#ifdef __WXMSW__ - -#ifdef DrawText -#undef DrawText -#endif - -#ifdef StartDoc -#undef StartDoc -#endif - -#ifdef GetCharWidth -#undef GetCharWidth -#endif - -#ifdef FindWindow -#undef FindWindow -#endif - -#endif - -//----------------------------------------------------------------------------- -// start and end of document/page -//----------------------------------------------------------------------------- - -static const char *wxPostScriptHeaderConicTo = "\ -/conicto {\n\ - /to_y exch def\n\ - /to_x exch def\n\ - /conic_cntrl_y exch def\n\ - /conic_cntrl_x exch def\n\ - currentpoint\n\ - /p0_y exch def\n\ - /p0_x exch def\n\ - /p1_x p0_x conic_cntrl_x p0_x sub 2 3 div mul add def\n\ - /p1_y p0_y conic_cntrl_y p0_y sub 2 3 div mul add def\n\ - /p2_x p1_x to_x p0_x sub 1 3 div mul add def\n\ - /p2_y p1_y to_y p0_y sub 1 3 div mul add def\n\ - p1_x p1_y p2_x p2_y to_x to_y curveto\n\ -} bind def\n\ -"; - -static const char *wxPostScriptHeaderEllipse = "\ -/ellipsedict 8 dict def\n\ -ellipsedict /mtrx matrix put\n\ -/ellipse {\n\ - ellipsedict begin\n\ - /endangle exch def\n\ - /startangle exch def\n\ - /yrad exch def\n\ - /xrad exch def\n\ - /y exch def\n\ - /x exch def\n\ - /savematrix mtrx currentmatrix def\n\ - x y translate\n\ - xrad yrad scale\n\ - 0 0 1 startangle endangle arc\n\ - savematrix setmatrix\n\ - end\n\ - } def\n\ -"; - -static const char *wxPostScriptHeaderEllipticArc= "\ -/ellipticarcdict 8 dict def\n\ -ellipticarcdict /mtrx matrix put\n\ -/ellipticarc\n\ -{ ellipticarcdict begin\n\ - /do_fill exch def\n\ - /endangle exch def\n\ - /startangle exch def\n\ - /yrad exch def\n\ - /xrad exch def \n\ - /y exch def\n\ - /x exch def\n\ - /savematrix mtrx currentmatrix def\n\ - x y translate\n\ - xrad yrad scale\n\ - do_fill { 0 0 moveto } if\n\ - 0 0 1 startangle endangle arc\n\ - savematrix setmatrix\n\ - do_fill { fill }{ stroke } ifelse\n\ - end\n\ -} def\n"; - -static const char *wxPostScriptHeaderSpline = "\ -/DrawSplineSection {\n\ - /y3 exch def\n\ - /x3 exch def\n\ - /y2 exch def\n\ - /x2 exch def\n\ - /y1 exch def\n\ - /x1 exch def\n\ - /xa x1 x2 x1 sub 0.666667 mul add def\n\ - /ya y1 y2 y1 sub 0.666667 mul add def\n\ - /xb x3 x2 x3 sub 0.666667 mul add def\n\ - /yb y3 y2 y3 sub 0.666667 mul add def\n\ - x1 y1 lineto\n\ - xa ya xb yb x3 y3 curveto\n\ - } def\n\ -"; - -static const char *wxPostScriptHeaderColourImage = "\ -% define 'colorimage' if it isn't defined\n\ -% ('colortogray' and 'mergeprocs' come from xwd2ps\n\ -% via xgrab)\n\ -/colorimage where % do we know about 'colorimage'?\n\ - { pop } % yes: pop off the 'dict' returned\n\ - { % no: define one\n\ - /colortogray { % define an RGB->I function\n\ - /rgbdata exch store % call input 'rgbdata'\n\ - rgbdata length 3 idiv\n\ - /npixls exch store\n\ - /rgbindx 0 store\n\ - 0 1 npixls 1 sub {\n\ - grays exch\n\ - rgbdata rgbindx get 20 mul % Red\n\ - rgbdata rgbindx 1 add get 32 mul % Green\n\ - rgbdata rgbindx 2 add get 12 mul % Blue\n\ - add add 64 idiv % I = .5G + .31R + .18B\n\ - put\n\ - /rgbindx rgbindx 3 add store\n\ - } for\n\ - grays 0 npixls getinterval\n\ - } bind def\n\ -\n\ - % Utility procedure for colorimage operator.\n\ - % This procedure takes two procedures off the\n\ - % stack and merges them into a single procedure.\n\ -\n\ - /mergeprocs { % def\n\ - dup length\n\ - 3 -1 roll\n\ - dup\n\ - length\n\ - dup\n\ - 5 1 roll\n\ - 3 -1 roll\n\ - add\n\ - array cvx\n\ - dup\n\ - 3 -1 roll\n\ - 0 exch\n\ - putinterval\n\ - dup\n\ - 4 2 roll\n\ - putinterval\n\ - } bind def\n\ -\n\ - /colorimage { % def\n\ - pop pop % remove 'false 3' operands\n\ - {colortogray} mergeprocs\n\ - image\n\ - } bind def\n\ - } ifelse % end of 'false' case\n\ -"; - -static char wxPostScriptHeaderReencodeISO1[] = - "\n/reencodeISO {\n" -"dup dup findfont dup length dict begin\n" -"{ 1 index /FID ne { def }{ pop pop } ifelse } forall\n" -"/Encoding ISOLatin1Encoding def\n" -"currentdict end definefont\n" -"} def\n" -"/ISOLatin1Encoding [\n" -"/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef\n" -"/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef\n" -"/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef\n" -"/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef\n" -"/space/exclam/quotedbl/numbersign/dollar/percent/ampersand/quoteright\n" -"/parenleft/parenright/asterisk/plus/comma/minus/period/slash\n" -"/zero/one/two/three/four/five/six/seven/eight/nine/colon/semicolon\n" -"/less/equal/greater/question/at/A/B/C/D/E/F/G/H/I/J/K/L/M/N\n" -"/O/P/Q/R/S/T/U/V/W/X/Y/Z/bracketleft/backslash/bracketright\n" -"/asciicircum/underscore/quoteleft/a/b/c/d/e/f/g/h/i/j/k/l/m\n" -"/n/o/p/q/r/s/t/u/v/w/x/y/z/braceleft/bar/braceright/asciitilde\n" -"/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef\n" -"/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef\n" -"/.notdef/dotlessi/grave/acute/circumflex/tilde/macron/breve\n" -"/dotaccent/dieresis/.notdef/ring/cedilla/.notdef/hungarumlaut\n"; - -static char wxPostScriptHeaderReencodeISO2[] = -"/ogonek/caron/space/exclamdown/cent/sterling/currency/yen/brokenbar\n" -"/section/dieresis/copyright/ordfeminine/guillemotleft/logicalnot\n" -"/hyphen/registered/macron/degree/plusminus/twosuperior/threesuperior\n" -"/acute/mu/paragraph/periodcentered/cedilla/onesuperior/ordmasculine\n" -"/guillemotright/onequarter/onehalf/threequarters/questiondown\n" -"/Agrave/Aacute/Acircumflex/Atilde/Adieresis/Aring/AE/Ccedilla\n" -"/Egrave/Eacute/Ecircumflex/Edieresis/Igrave/Iacute/Icircumflex\n" -"/Idieresis/Eth/Ntilde/Ograve/Oacute/Ocircumflex/Otilde/Odieresis\n" -"/multiply/Oslash/Ugrave/Uacute/Ucircumflex/Udieresis/Yacute\n" -"/Thorn/germandbls/agrave/aacute/acircumflex/atilde/adieresis\n" -"/aring/ae/ccedilla/egrave/eacute/ecircumflex/edieresis/igrave\n" -"/iacute/icircumflex/idieresis/eth/ntilde/ograve/oacute/ocircumflex\n" -"/otilde/odieresis/divide/oslash/ugrave/uacute/ucircumflex/udieresis\n" -"/yacute/thorn/ydieresis\n" - "] def\n\n"; - -//------------------------------------------------------------------------------- -// wxPostScriptDC -//------------------------------------------------------------------------------- - -IMPLEMENT_DYNAMIC_CLASS(wxPostScriptDC, wxDC) - -float wxPostScriptDC::ms_PSScaleFactor = 1.0; - -void wxPostScriptDC::SetResolution(int ppi) -{ - ms_PSScaleFactor = (float)ppi / 72.0; -} - -int wxPostScriptDC::GetResolution() -{ - return (int)(ms_PSScaleFactor * 72.0); -} - -//------------------------------------------------------------------------------- - -wxPostScriptDC::wxPostScriptDC () -{ - m_pstream = (FILE*) NULL; - - m_currentRed = 0; - m_currentGreen = 0; - m_currentBlue = 0; - - m_pageNumber = 0; - - m_clipping = false; - - m_underlinePosition = 0.0; - m_underlineThickness = 0.0; - - m_signX = 1; // default x-axis left to right - m_signY = -1; // default y-axis bottom up -> top down -} - -wxPostScriptDC::wxPostScriptDC (const wxPrintData& printData) -{ - m_pstream = (FILE*) NULL; - - m_currentRed = 0; - m_currentGreen = 0; - m_currentBlue = 0; - - m_pageNumber = 0; - - m_clipping = false; - - m_underlinePosition = 0.0; - m_underlineThickness = 0.0; - - m_signX = 1; // default x-axis left to right - m_signY = -1; // default y-axis bottom up -> top down - - m_printData = printData; - - m_ok = true; -} - -wxPostScriptDC::~wxPostScriptDC () -{ - if (m_pstream) - { - fclose( m_pstream ); - m_pstream = (FILE*) NULL; - } -} - -bool wxPostScriptDC::IsOk() const -{ - return m_ok; -} - -void wxPostScriptDC::DoSetClippingRegion (wxCoord x, wxCoord y, wxCoord w, wxCoord h) -{ - wxCHECK_RET( m_ok , wxT("invalid postscript dc") ); - - if (m_clipping) DestroyClippingRegion(); - - wxDC::DoSetClippingRegion(x, y, w, h); - - m_clipping = true; - - PsPrintf( wxT("gsave\n newpath\n") - wxT("%d %d moveto\n") - wxT("%d %d lineto\n") - wxT("%d %d lineto\n") - wxT("%d %d lineto\n") - wxT("closepath clip newpath\n"), - LogicalToDeviceX(x), LogicalToDeviceY(y), - LogicalToDeviceX(x+w), LogicalToDeviceY(y), - LogicalToDeviceX(x+w), LogicalToDeviceY(y+h), - LogicalToDeviceX(x), LogicalToDeviceY(y+h) ); -} - - -void wxPostScriptDC::DestroyClippingRegion() -{ - wxCHECK_RET( m_ok , wxT("invalid postscript dc") ); - - if (m_clipping) - { - m_clipping = false; - PsPrint( "grestore\n" ); - } - - wxDC::DestroyClippingRegion(); -} - -void wxPostScriptDC::Clear() -{ - // This should fail silently to avoid unnecessary - // asserts - // wxFAIL_MSG( wxT("wxPostScriptDC::Clear not implemented.") ); -} - -bool wxPostScriptDC::DoFloodFill (wxCoord WXUNUSED(x), wxCoord WXUNUSED(y), const wxColour &WXUNUSED(col), int WXUNUSED(style)) -{ - wxFAIL_MSG( wxT("wxPostScriptDC::FloodFill not implemented.") ); - return false; -} - -bool wxPostScriptDC::DoGetPixel (wxCoord WXUNUSED(x), wxCoord WXUNUSED(y), wxColour * WXUNUSED(col)) const -{ - wxFAIL_MSG( wxT("wxPostScriptDC::GetPixel not implemented.") ); - return false; -} - -void wxPostScriptDC::DoCrossHair (wxCoord WXUNUSED(x), wxCoord WXUNUSED(y)) -{ - wxFAIL_MSG( wxT("wxPostScriptDC::CrossHair not implemented.") ); -} - -void wxPostScriptDC::DoDrawLine (wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2) -{ - wxCHECK_RET( m_ok, wxT("invalid postscript dc") ); - - if (m_pen.GetStyle() == wxTRANSPARENT) return; - - SetPen( m_pen ); - - PsPrintf( wxT("newpath\n") - wxT("%d %d moveto\n") - wxT("%d %d lineto\n") - wxT("stroke\n"), - LogicalToDeviceX(x1), LogicalToDeviceY(y1), - LogicalToDeviceX(x2), LogicalToDeviceY (y2) ); - - CalcBoundingBox( x1, y1 ); - CalcBoundingBox( x2, y2 ); -} - -#define RAD2DEG 57.29577951308 - -void wxPostScriptDC::DoDrawArc (wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2, wxCoord xc, wxCoord yc) -{ - wxCHECK_RET( m_ok, wxT("invalid postscript dc") ); - - wxCoord dx = x1 - xc; - wxCoord dy = y1 - yc; - wxCoord radius = (wxCoord) sqrt( (double)(dx*dx+dy*dy) ); - double alpha1, alpha2; - - if (x1 == x2 && y1 == y2) - { - alpha1 = 0.0; - alpha2 = 360.0; - } - else if ( wxIsNullDouble(radius) ) - { - alpha1 = - alpha2 = 0.0; - } - else - { - alpha1 = (x1 - xc == 0) ? - (y1 - yc < 0) ? 90.0 : -90.0 : - -atan2(double(y1-yc), double(x1-xc)) * RAD2DEG; - alpha2 = (x2 - xc == 0) ? - (y2 - yc < 0) ? 90.0 : -90.0 : - -atan2(double(y2-yc), double(x2-xc)) * RAD2DEG; - } - while (alpha1 <= 0) alpha1 += 360; - while (alpha2 <= 0) alpha2 += 360; // adjust angles to be between - while (alpha1 > 360) alpha1 -= 360; // 0 and 360 degree - while (alpha2 > 360) alpha2 -= 360; - - if (m_brush.GetStyle() != wxTRANSPARENT) - { - SetBrush( m_brush ); - - PsPrintf( wxT("newpath\n") - wxT("%d %d %d %d %d %d ellipse\n") - wxT("%d %d lineto\n") - wxT("closepath\n") - wxT("fill\n"), - LogicalToDeviceX(xc), LogicalToDeviceY(yc), LogicalToDeviceXRel(radius), LogicalToDeviceYRel(radius), (wxCoord)alpha1, (wxCoord) alpha2, - LogicalToDeviceX(xc), LogicalToDeviceY(yc) ); - - CalcBoundingBox( xc-radius, yc-radius ); - CalcBoundingBox( xc+radius, yc+radius ); - } - - if (m_pen.GetStyle() != wxTRANSPARENT) - { - SetPen( m_pen ); - - PsPrintf( wxT("newpath\n") - wxT("%d %d %d %d %d %d ellipse\n") - wxT("%d %d lineto\n") - wxT("closepath\n") - wxT("stroke\n"), - LogicalToDeviceX(xc), LogicalToDeviceY(yc), LogicalToDeviceXRel(radius), LogicalToDeviceYRel(radius), (wxCoord)alpha1, (wxCoord) alpha2, - LogicalToDeviceX(xc), LogicalToDeviceY(yc) ); - - CalcBoundingBox( xc-radius, yc-radius ); - CalcBoundingBox( xc+radius, yc+radius ); - } -} - -void wxPostScriptDC::DoDrawEllipticArc(wxCoord x,wxCoord y,wxCoord w,wxCoord h,double sa,double ea) -{ - wxCHECK_RET( m_ok, wxT("invalid postscript dc") ); - - if ( sa >= 360 || sa <= -360 ) - sa -= int(sa/360)*360; - if ( ea >= 360 || ea <=- 360 ) - ea -= int(ea/360)*360; - if ( sa < 0 ) - sa += 360; - if ( ea < 0 ) - ea += 360; - - if ( wxIsSameDouble(sa, ea) ) - { - DrawEllipse(x,y,w,h); - return; - } - - if (m_brush.GetStyle () != wxTRANSPARENT) - { - SetBrush( m_brush ); - - PsPrintf( wxT("newpath\n") - wxT("%d %d %d %d %d %d true ellipticarc\n"), - LogicalToDeviceX(x+w/2), LogicalToDeviceY(y+h/2), - LogicalToDeviceXRel(w/2), LogicalToDeviceYRel(h/2), - (wxCoord)sa, (wxCoord)ea ); - - CalcBoundingBox( x ,y ); - CalcBoundingBox( x+w, y+h ); - } - - if (m_pen.GetStyle () != wxTRANSPARENT) - { - SetPen( m_pen ); - - PsPrintf( wxT("newpath\n") - wxT("%d %d %d %d %d %d false ellipticarc\n"), - LogicalToDeviceX(x+w/2), LogicalToDeviceY(y+h/2), - LogicalToDeviceXRel(w/2), LogicalToDeviceYRel(h/2), - (wxCoord)sa, (wxCoord)ea ); - - CalcBoundingBox( x ,y ); - CalcBoundingBox( x+w, y+h ); - } -} - -void wxPostScriptDC::DoDrawPoint (wxCoord x, wxCoord y) -{ - wxCHECK_RET( m_ok, wxT("invalid postscript dc") ); - - if (m_pen.GetStyle() == wxTRANSPARENT) return; - - SetPen (m_pen); - - PsPrintf( wxT("newpath\n") - wxT("%d %d moveto\n") - wxT("%d %d lineto\n") - wxT("stroke\n"), - LogicalToDeviceX(x), LogicalToDeviceY(y), - LogicalToDeviceX(x+1), LogicalToDeviceY(y) ); - - CalcBoundingBox( x, y ); -} - -void wxPostScriptDC::DoDrawPolygon (int n, wxPoint points[], wxCoord xoffset, wxCoord yoffset, int fillStyle) -{ - wxCHECK_RET( m_ok, wxT("invalid postscript dc") ); - - if (n <= 0) return; - - if (m_brush.GetStyle () != wxTRANSPARENT) - { - SetBrush( m_brush ); - - PsPrint( "newpath\n" ); - - wxCoord xx = LogicalToDeviceX(points[0].x + xoffset); - wxCoord yy = LogicalToDeviceY(points[0].y + yoffset); - - PsPrintf( wxT("%d %d moveto\n"), xx, yy ); - - CalcBoundingBox( points[0].x + xoffset, points[0].y + yoffset ); - - for (int i = 1; i < n; i++) - { - xx = LogicalToDeviceX(points[i].x + xoffset); - yy = LogicalToDeviceY(points[i].y + yoffset); - - PsPrintf( wxT("%d %d lineto\n"), xx, yy ); - - CalcBoundingBox( points[i].x + xoffset, points[i].y + yoffset); - } - - PsPrint( (fillStyle == wxODDEVEN_RULE ? "eofill\n" : "fill\n") ); - } - - if (m_pen.GetStyle () != wxTRANSPARENT) - { - SetPen( m_pen ); - - PsPrint( "newpath\n" ); - - wxCoord xx = LogicalToDeviceX(points[0].x + xoffset); - wxCoord yy = LogicalToDeviceY(points[0].y + yoffset); - - PsPrintf( wxT("%d %d moveto\n"), xx, yy ); - - CalcBoundingBox( points[0].x + xoffset, points[0].y + yoffset ); - - for (int i = 1; i < n; i++) - { - xx = LogicalToDeviceX(points[i].x + xoffset); - yy = LogicalToDeviceY(points[i].y + yoffset); - - PsPrintf( wxT("%d %d lineto\n"), xx, yy ); - - CalcBoundingBox( points[i].x + xoffset, points[i].y + yoffset); - } - - PsPrint( "closepath\n" ); - PsPrint( "stroke\n" ); - } -} - -void wxPostScriptDC::DoDrawPolyPolygon (int n, int count[], wxPoint points[], wxCoord xoffset, wxCoord yoffset, int fillStyle) -{ - wxCHECK_RET( m_ok, wxT("invalid postscript dc") ); - - if (n <= 0) return; - - if (m_brush.GetStyle () != wxTRANSPARENT) - { - SetBrush( m_brush ); - - PsPrint( "newpath\n" ); - - int ofs = 0; - for (int i = 0; i < n; ofs += count[i++]) - { - wxCoord xx = LogicalToDeviceX(points[ofs].x + xoffset); - wxCoord yy = LogicalToDeviceY(points[ofs].y + yoffset); - - PsPrintf( wxT("%d %d moveto\n"), xx, yy ); - - CalcBoundingBox( points[ofs].x + xoffset, points[ofs].y + yoffset ); - - for (int j = 1; j < count[i]; j++) - { - xx = LogicalToDeviceX(points[ofs+j].x + xoffset); - yy = LogicalToDeviceY(points[ofs+j].y + yoffset); - - PsPrintf( wxT("%d %d lineto\n"), xx, yy ); - - CalcBoundingBox( points[ofs+j].x + xoffset, points[ofs+j].y + yoffset); - } - } - PsPrint( (fillStyle == wxODDEVEN_RULE ? "eofill\n" : "fill\n") ); - } - - if (m_pen.GetStyle () != wxTRANSPARENT) - { - SetPen( m_pen ); - - PsPrint( "newpath\n" ); - - int ofs = 0; - for (int i = 0; i < n; ofs += count[i++]) - { - wxCoord xx = LogicalToDeviceX(points[ofs].x + xoffset); - wxCoord yy = LogicalToDeviceY(points[ofs].y + yoffset); - - PsPrintf( wxT("%d %d moveto\n"), xx, yy ); - - CalcBoundingBox( points[ofs].x + xoffset, points[ofs].y + yoffset ); - - for (int j = 1; j < count[i]; j++) - { - xx = LogicalToDeviceX(points[ofs+j].x + xoffset); - yy = LogicalToDeviceY(points[ofs+j].y + yoffset); - - PsPrintf( wxT("%d %d lineto\n"), xx, yy ); - - CalcBoundingBox( points[ofs+j].x + xoffset, points[ofs+j].y + yoffset); - } - } - PsPrint( "closepath\n" ); - PsPrint( "stroke\n" ); - } -} - -void wxPostScriptDC::DoDrawLines (int n, wxPoint points[], wxCoord xoffset, wxCoord yoffset) -{ - wxCHECK_RET( m_ok, wxT("invalid postscript dc") ); - - if (m_pen.GetStyle() == wxTRANSPARENT) return; - - if (n <= 0) return; - - SetPen (m_pen); - - int i; - for ( i =0; i= 128 ) - { - /* Cope with character codes > 127 */ - PsPrintf( wxT("\\%o"), c); - } - else - { - PsPrint(c); - } - } - - PsPrint( ") show\n" ); - - if (m_font.GetUnderlined()) - { - wxCoord uy = (wxCoord)(y + size - m_underlinePosition); - char buffer[100]; - - sprintf( buffer, - "gsave\n" - "%d %d moveto\n" - "%f setlinewidth\n" - "%d %d lineto\n" - "stroke\n" - "grestore\n", - LogicalToDeviceX(x), LogicalToDeviceY(uy), - m_underlineThickness, - LogicalToDeviceX(x + text_w), LogicalToDeviceY(uy) ); - for (i = 0; i < 100; i++) - if (buffer[i] == ',') buffer[i] = '.'; - PsPrint( buffer ); - } - - CalcBoundingBox( x, y ); - CalcBoundingBox( x + size * text.length() * 2/3 , y ); -} - -void wxPostScriptDC::DoDrawRotatedText( const wxString& text, wxCoord x, wxCoord y, double angle ) -{ - if ( wxIsNullDouble(angle) ) - { - DoDrawText(text, x, y); - return; - } - - wxCHECK_RET( m_ok, wxT("invalid postscript dc") ); - - SetFont( m_font ); - - if (m_textForegroundColour.Ok()) - { - unsigned char red = m_textForegroundColour.Red(); - unsigned char blue = m_textForegroundColour.Blue(); - unsigned char green = m_textForegroundColour.Green(); - - if (!m_colour) - { - // Anything not white is black - if (! (red == (unsigned char) 255 && - blue == (unsigned char) 255 && - green == (unsigned char) 255)) - { - red = (unsigned char) 0; - green = (unsigned char) 0; - blue = (unsigned char) 0; - } - } - - // maybe setgray here ? - if (!(red == m_currentRed && green == m_currentGreen && blue == m_currentBlue)) - { - double redPS = (double)(red) / 255.0; - double bluePS = (double)(blue) / 255.0; - double greenPS = (double)(green) / 255.0; - - char buffer[100]; - sprintf( buffer, - "%.8f %.8f %.8f setrgbcolor\n", - redPS, greenPS, bluePS ); - for (int i = 0; i < 100; i++) - if (buffer[i] == ',') buffer[i] = '.'; - PsPrint( buffer ); - - m_currentRed = red; - m_currentBlue = blue; - m_currentGreen = green; - } - } - - int size = m_font.GetPointSize(); - - PsPrintf( wxT("%d %d moveto\n"), - LogicalToDeviceX(x), LogicalToDeviceY(y)); - - char buffer[100]; - sprintf(buffer, "%.8f rotate\n", angle); - size_t i; - for (i = 0; i < 100; i++) - { - if (buffer[i] == ',') buffer[i] = '.'; - } - PsPrint( buffer); - - PsPrint( "(" ); - const wxWX2MBbuf textbuf = text.mb_str(); - size_t len = strlen(textbuf); - for (i = 0; i < len; i++) - { - int c = (unsigned char) textbuf[i]; - if (c == ')' || c == '(' || c == '\\') - { - /* Cope with special characters */ - PsPrint( "\\" ); - PsPrint(c); - } - else if ( c >= 128 ) - { - /* Cope with character codes > 127 */ - PsPrintf( wxT("\\%o"), c); - } - else - { - PsPrint(c); - } - } - - PsPrint( ") show\n" ); - - sprintf( buffer, "%.8f rotate\n", -angle ); - for (i = 0; i < 100; i++) - { - if (buffer[i] == ',') buffer[i] = '.'; - } - PsPrint( buffer ); - - if (m_font.GetUnderlined()) - { - wxCoord uy = (wxCoord)(y + size - m_underlinePosition); - wxCoord w, h; - GetTextExtent(text, &w, &h); - - sprintf( buffer, - "gsave\n" - "%d %d moveto\n" - "%f setlinewidth\n" - "%d %d lineto\n" - "stroke\n" - "grestore\n", - LogicalToDeviceX(x), LogicalToDeviceY(uy), - m_underlineThickness, - LogicalToDeviceX(x + w), LogicalToDeviceY(uy) ); - for (i = 0; i < 100; i++) - { - if (buffer[i] == ',') buffer[i] = '.'; - } - PsPrint( buffer ); - } - - CalcBoundingBox( x, y ); - CalcBoundingBox( x + size * text.length() * 2/3 , y ); -} - -void wxPostScriptDC::SetBackground (const wxBrush& brush) -{ - m_backgroundBrush = brush; -} - -void wxPostScriptDC::SetLogicalFunction (int WXUNUSED(function)) -{ - wxFAIL_MSG( wxT("wxPostScriptDC::SetLogicalFunction not implemented.") ); -} - -#if wxUSE_SPLINES -void wxPostScriptDC::DoDrawSpline( wxList *points ) -{ - wxCHECK_RET( m_ok, wxT("invalid postscript dc") ); - - SetPen( m_pen ); - - // a and b are not used - //double a, b; - double c, d, x1, y1, x2, y2, x3, y3; - wxPoint *p, *q; - - wxList::compatibility_iterator node = points->GetFirst(); - p = (wxPoint *)node->GetData(); - x1 = p->x; - y1 = p->y; - - node = node->GetNext(); - p = (wxPoint *)node->GetData(); - c = p->x; - d = p->y; - x3 = - #if 0 - a = - #endif - (double)(x1 + c) / 2; - y3 = - #if 0 - b = - #endif - (double)(y1 + d) / 2; - - PsPrintf( wxT("newpath\n") - wxT("%d %d moveto\n") - wxT("%d %d lineto\n"), - LogicalToDeviceX((wxCoord)x1), LogicalToDeviceY((wxCoord)y1), - LogicalToDeviceX((wxCoord)x3), LogicalToDeviceY((wxCoord)y3) ); - - CalcBoundingBox( (wxCoord)x1, (wxCoord)y1 ); - CalcBoundingBox( (wxCoord)x3, (wxCoord)y3 ); - - node = node->GetNext(); - while (node) - { - q = (wxPoint *)node->GetData(); - - x1 = x3; - y1 = y3; - x2 = c; - y2 = d; - c = q->x; - d = q->y; - x3 = (double)(x2 + c) / 2; - y3 = (double)(y2 + d) / 2; - - PsPrintf( wxT("%d %d %d %d %d %d DrawSplineSection\n"), - LogicalToDeviceX((wxCoord)x1), LogicalToDeviceY((wxCoord)y1), - LogicalToDeviceX((wxCoord)x2), LogicalToDeviceY((wxCoord)y2), - LogicalToDeviceX((wxCoord)x3), LogicalToDeviceY((wxCoord)y3) ); - - CalcBoundingBox( (wxCoord)x1, (wxCoord)y1 ); - CalcBoundingBox( (wxCoord)x3, (wxCoord)y3 ); - - node = node->GetNext(); - } - - /* - At this point, (x2,y2) and (c,d) are the position of the - next-to-last and last point respectively, in the point list - */ - - PsPrintf( wxT("%d %d lineto\n") - wxT("stroke\n"), - LogicalToDeviceX((wxCoord)c), LogicalToDeviceY((wxCoord)d) ); -} -#endif // wxUSE_SPLINES - -wxCoord wxPostScriptDC::GetCharWidth() const -{ - // Chris Breeze: reasonable approximation using wxMODERN/Courier - return (wxCoord) (GetCharHeight() * 72.0 / 120.0); -} - - -void wxPostScriptDC::SetAxisOrientation( bool xLeftRight, bool yBottomUp ) -{ - wxCHECK_RET( m_ok, wxT("invalid postscript dc") ); - - m_signX = (xLeftRight ? 1 : -1); - m_signY = (yBottomUp ? 1 : -1); - - ComputeScaleAndOrigin(); -} - -void wxPostScriptDC::SetDeviceOrigin( wxCoord x, wxCoord y ) -{ - wxCHECK_RET( m_ok, wxT("invalid postscript dc") ); - - int h = 0; - int w = 0; - GetSize( &w, &h ); - - wxDC::SetDeviceOrigin( x, h-y ); -} - -void wxPostScriptDC::DoGetSize(int* width, int* height) const -{ - wxPaperSize id = m_printData.GetPaperId(); - - wxPrintPaperType *paper = wxThePrintPaperDatabase->FindPaperType(id); - - if (!paper) paper = wxThePrintPaperDatabase->FindPaperType(wxPAPER_A4); - - int w = 595; - int h = 842; - if (paper) - { - w = paper->GetSizeDeviceUnits().x; - h = paper->GetSizeDeviceUnits().y; - } - - if (m_printData.GetOrientation() == wxLANDSCAPE) - { - int tmp = w; - w = h; - h = tmp; - } - - if (width) *width = (int)(w * ms_PSScaleFactor); - if (height) *height = (int)(h * ms_PSScaleFactor); -} - -void wxPostScriptDC::DoGetSizeMM(int *width, int *height) const -{ - wxPaperSize id = m_printData.GetPaperId(); - - wxPrintPaperType *paper = wxThePrintPaperDatabase->FindPaperType(id); - - if (!paper) paper = wxThePrintPaperDatabase->FindPaperType(wxPAPER_A4); - - int w = 210; - int h = 297; - if (paper) - { - w = paper->GetWidth() / 10; - h = paper->GetHeight() / 10; - } - - if (m_printData.GetOrientation() == wxLANDSCAPE) - { - int tmp = w; - w = h; - h = tmp; - } - - if (width) *width = w; - if (height) *height = h; -} - -// Resolution in pixels per logical inch -wxSize wxPostScriptDC::GetPPI(void) const -{ - return wxSize((int)(72 * ms_PSScaleFactor), - (int)(72 * ms_PSScaleFactor)); -} - - -bool wxPostScriptDC::StartDoc( const wxString& message ) -{ - wxCHECK_MSG( m_ok, false, wxT("invalid postscript dc") ); - - if (m_printData.GetPrintMode() != wxPRINT_MODE_STREAM ) - { - if (m_printData.GetFilename() == wxEmptyString) - { - wxString filename = wxGetTempFileName( wxT("ps") ); - m_printData.SetFilename(filename); - } - - m_pstream = wxFopen( m_printData.GetFilename(), wxT("w+") ); - - if (!m_pstream) - { - wxLogError( _("Cannot open file for PostScript printing!")); - m_ok = false; - return false; - } - } - - m_ok = true; - m_title = message; - - PsPrint( "%!PS-Adobe-2.0\n" ); - PsPrint( "%%Creator: wxWidgets PostScript renderer\n" ); - PsPrintf( wxT("%%%%CreationDate: %s\n"), wxNow().c_str() ); - if (m_printData.GetOrientation() == wxLANDSCAPE) - PsPrint( "%%Orientation: Landscape\n" ); - else - PsPrint( "%%Orientation: Portrait\n" ); - - // PsPrintf( wxT("%%%%Pages: %d\n"), (wxPageNumber - 1) ); - - const wxChar *paper; - switch (m_printData.GetPaperId()) - { - case wxPAPER_LETTER: paper = wxT("Letter"); break; // Letter: paper ""; 8 1/2 by 11 inches - case wxPAPER_LEGAL: paper = wxT("Legal"); break; // Legal, 8 1/2 by 14 inches - case wxPAPER_A4: paper = wxT("A4"); break; // A4 Sheet, 210 by 297 millimeters - case wxPAPER_TABLOID: paper = wxT("Tabloid"); break; // Tabloid, 11 by 17 inches - case wxPAPER_LEDGER: paper = wxT("Ledger"); break; // Ledger, 17 by 11 inches - case wxPAPER_STATEMENT: paper = wxT("Statement"); break; // Statement, 5 1/2 by 8 1/2 inches - case wxPAPER_EXECUTIVE: paper = wxT("Executive"); break; // Executive, 7 1/4 by 10 1/2 inches - case wxPAPER_A3: paper = wxT("A3"); break; // A3 sheet, 297 by 420 millimeters - case wxPAPER_A5: paper = wxT("A5"); break; // A5 sheet, 148 by 210 millimeters - case wxPAPER_B4: paper = wxT("B4"); break; // B4 sheet, 250 by 354 millimeters - case wxPAPER_B5: paper = wxT("B5"); break; // B5 sheet, 182-by-257-millimeter paper - case wxPAPER_FOLIO: paper = wxT("Folio"); break; // Folio, 8-1/2-by-13-inch paper - case wxPAPER_QUARTO: paper = wxT("Quaro"); break; // Quarto, 215-by-275-millimeter paper - case wxPAPER_10X14: paper = wxT("10x14"); break; // 10-by-14-inch sheet - default: paper = wxT("A4"); - } - PsPrintf( wxT("%%%%DocumentPaperSizes: %s\n"), paper ); - PsPrint( "%%EndComments\n\n" ); - - PsPrint( "%%BeginProlog\n" ); - PsPrint( wxPostScriptHeaderConicTo ); - PsPrint( wxPostScriptHeaderEllipse ); - PsPrint( wxPostScriptHeaderEllipticArc ); - PsPrint( wxPostScriptHeaderColourImage ); - PsPrint( wxPostScriptHeaderReencodeISO1 ); - PsPrint( wxPostScriptHeaderReencodeISO2 ); - if (wxPostScriptHeaderSpline) - PsPrint( wxPostScriptHeaderSpline ); - PsPrint( "%%EndProlog\n" ); - - SetBrush( *wxBLACK_BRUSH ); - SetPen( *wxBLACK_PEN ); - SetBackground( *wxWHITE_BRUSH ); - SetTextForeground( *wxBLACK ); - - // set origin according to paper size - SetDeviceOrigin( 0,0 ); - - wxPageNumber = 1; - m_pageNumber = 1; - return true; -} - -void wxPostScriptDC::EndDoc () -{ - wxCHECK_RET( m_ok, wxT("invalid postscript dc") ); - - if (m_clipping) - { - m_clipping = false; - PsPrint( "grestore\n" ); - } - - if ( m_pstream ) { - fclose( m_pstream ); - m_pstream = (FILE *) NULL; - } - -#if 0 - // THE FOLLOWING HAS BEEN CONTRIBUTED BY Andy Fyfe - wxCoord wx_printer_translate_x, wx_printer_translate_y; - double wx_printer_scale_x, wx_printer_scale_y; - - wx_printer_translate_x = (wxCoord)m_printData.GetPrinterTranslateX(); - wx_printer_translate_y = (wxCoord)m_printData.GetPrinterTranslateY(); - - wx_printer_scale_x = m_printData.GetPrinterScaleX(); - wx_printer_scale_y = m_printData.GetPrinterScaleY(); - - // Compute the bounding box. Note that it is in the default user - // coordinate system, thus we have to convert the values. - wxCoord minX = (wxCoord) LogicalToDeviceX(m_minX); - wxCoord minY = (wxCoord) LogicalToDeviceY(m_minY); - wxCoord maxX = (wxCoord) LogicalToDeviceX(m_maxX); - wxCoord maxY = (wxCoord) LogicalToDeviceY(m_maxY); - - // LOG2DEV may have changed the minimum to maximum vice versa - if ( minX > maxX ) { wxCoord tmp = minX; minX = maxX; maxX = tmp; } - if ( minY > maxY ) { wxCoord tmp = minY; minY = maxY; maxY = tmp; } - - // account for used scaling (boundingbox is before scaling in ps-file) - double scale_x = m_printData.GetPrinterScaleX() / ms_PSScaleFactor; - double scale_y = m_printData.GetPrinterScaleY() / ms_PSScaleFactor; - - wxCoord llx, lly, urx, ury; - llx = (wxCoord) ((minX+wx_printer_translate_x)*scale_x); - lly = (wxCoord) ((minY+wx_printer_translate_y)*scale_y); - urx = (wxCoord) ((maxX+wx_printer_translate_x)*scale_x); - ury = (wxCoord) ((maxY+wx_printer_translate_y)*scale_y); - // (end of bounding box computation) - - - // If we're landscape, our sense of "x" and "y" is reversed. - if (m_printData.GetOrientation() == wxLANDSCAPE) - { - wxCoord tmp; - tmp = llx; llx = lly; lly = tmp; - tmp = urx; urx = ury; ury = tmp; - - // We need either the two lines that follow, or we need to subtract - // min_x from real_translate_y, which is commented out below. - llx = llx - (wxCoord)(m_minX*wx_printer_scale_y); - urx = urx - (wxCoord)(m_minX*wx_printer_scale_y); - } - - // The Adobe specifications call for integers; we round as to make - // the bounding larger. - PsPrintf( wxT("%%%%BoundingBox: %d %d %d %d\n"), - (wxCoord)floor((double)llx), (wxCoord)floor((double)lly), - (wxCoord)ceil((double)urx), (wxCoord)ceil((double)ury) ); - - // To check the correctness of the bounding box, postscript commands - // to draw a box corresponding to the bounding box are generated below. - // But since we typically don't want to print such a box, the postscript - // commands are generated within comments. These lines appear before any - // adjustment of scale, rotation, or translation, and hence are in the - // default user coordinates. - PsPrint( "% newpath\n" ); - PsPrintf( wxT("%% %d %d moveto\n"), llx, lly ); - PsPrintf( wxT("%% %d %d lineto\n"), urx, lly ); - PsPrintf( wxT("%% %d %d lineto\n"), urx, ury ); - PsPrintf( wxT("%% %d %d lineto closepath stroke\n"), llx, ury ); -#endif - -#ifndef __WXMSW__ - wxPostScriptPrintNativeData *data = - (wxPostScriptPrintNativeData *) m_printData.GetNativeData(); - - if (m_ok && (m_printData.GetPrintMode() == wxPRINT_MODE_PRINTER)) - { - wxString command; - command += data->GetPrinterCommand(); - command += wxT(" "); - command += data->GetPrinterOptions(); - command += wxT(" "); - command += m_printData.GetFilename(); - - wxExecute( command, true ); - wxRemoveFile( m_printData.GetFilename() ); - } -#endif -} - -void wxPostScriptDC::StartPage() -{ - wxCHECK_RET( m_ok, wxT("invalid postscript dc") ); - - PsPrintf( wxT("%%%%Page: %d\n"), wxPageNumber++ ); - - // What is this one supposed to do? RR. -// *m_pstream << "matrix currentmatrix\n"; - - // Added by Chris Breeze - - // Each page starts with an "initgraphics" which resets the - // transformation and so we need to reset the origin - // (and rotate the page for landscape printing) - - // Output scaling - wxCoord translate_x, translate_y; - double scale_x, scale_y; - - wxPostScriptPrintNativeData *data = - (wxPostScriptPrintNativeData *) m_printData.GetNativeData(); - - translate_x = (wxCoord)data->GetPrinterTranslateX(); - translate_y = (wxCoord)data->GetPrinterTranslateY(); - - scale_x = data->GetPrinterScaleX(); - scale_y = data->GetPrinterScaleY(); - - if (m_printData.GetOrientation() == wxLANDSCAPE) - { - int h; - GetSize( (int*) NULL, &h ); - translate_y -= h; - PsPrint( "90 rotate\n" ); - // I copied this one from a PostScript tutorial, but to no avail. RR. - // PsPrint( "90 rotate llx neg ury nef translate\n" ); - } - - char buffer[100]; - sprintf( buffer, "%.8f %.8f scale\n", scale_x / ms_PSScaleFactor, - scale_y / ms_PSScaleFactor); - for (int i = 0; i < 100; i++) - if (buffer[i] == ',') buffer[i] = '.'; - PsPrint( buffer ); - - PsPrintf( wxT("%d %d translate\n"), translate_x, translate_y ); -} - -void wxPostScriptDC::EndPage () -{ - wxCHECK_RET( m_ok , wxT("invalid postscript dc") ); - - PsPrint( "showpage\n" ); -} - -bool wxPostScriptDC::DoBlit( wxCoord xdest, wxCoord ydest, - wxCoord fwidth, wxCoord fheight, - wxDC *source, - wxCoord xsrc, wxCoord ysrc, - int rop, bool WXUNUSED(useMask), wxCoord WXUNUSED(xsrcMask), wxCoord WXUNUSED(ysrcMask) ) -{ - wxCHECK_MSG( m_ok, false, wxT("invalid postscript dc") ); - - wxCHECK_MSG( source, false, wxT("invalid source dc") ); - - /* blit into a bitmap */ - wxBitmap bitmap( (int)fwidth, (int)fheight ); - wxMemoryDC memDC; - memDC.SelectObject(bitmap); - memDC.Blit(0, 0, fwidth, fheight, source, xsrc, ysrc, rop); /* TODO: Blit transparently? */ - memDC.SelectObject(wxNullBitmap); - - /* draw bitmap. scaling and positioning is done there */ - DrawBitmap( bitmap, xdest, ydest ); - - return true; -} - -wxCoord wxPostScriptDC::GetCharHeight() const -{ - if (m_font.Ok()) - return m_font.GetPointSize(); - else - return 12; -} - -void wxPostScriptDC::DoGetTextExtent(const wxString& string, - wxCoord *x, wxCoord *y, - wxCoord *descent, wxCoord *externalLeading, - wxFont *theFont ) const -{ - wxFont *fontToUse = theFont; - - if (!fontToUse) fontToUse = (wxFont*) &m_font; - - const float fontSize = - fontToUse->GetPointSize() * GetFontPointSizeAdjustment(72.0); - - if (string.empty()) - { - if (x) (*x) = 0; - if (y) (*y) = 0; - if (descent) (*descent) = 0; - if (externalLeading) (*externalLeading) = 0; - return; - } - - // GTK 2.0 - - const wxWX2MBbuf strbuf = string.mb_str(); - -#if !wxUSE_AFM_FOR_POSTSCRIPT - /* Provide a VERY rough estimate (avoid using it). - * Produces accurate results for mono-spaced font - * such as Courier (aka wxMODERN) */ - - if ( x ) - *x = strlen (strbuf) * fontSize * 72.0 / 120.0; - if ( y ) - *y = (wxCoord) (fontSize * 1.32); /* allow for descender */ - if (descent) *descent = 0; - if (externalLeading) *externalLeading = 0; -#else - - /* method for calculating string widths in postscript: - / read in the AFM (adobe font metrics) file for the - / actual font, parse it and extract the character widths - / and also the descender. this may be improved, but for now - / it works well. the AFM file is only read in if the - / font is changed. this may be chached in the future. - / calls to GetTextExtent with the font unchanged are rather - / efficient!!! - / - / for each font and style used there is an AFM file necessary. - / currently i have only files for the roman font family. - / I try to get files for the other ones! - / - / CAVE: the size of the string is currently always calculated - / in 'points' (1/72 of an inch). this should later on be - / changed to depend on the mapping mode. - / CAVE: the path to the AFM files must be set before calling this - / function. this is usually done by a call like the following: - / wxSetAFMPath("d:\\wxw161\\afm\\"); - / - / example: - / - / wxPostScriptDC dc(NULL, true); - / if (dc.Ok()){ - / wxSetAFMPath("d:\\wxw161\\afm\\"); - / dc.StartDoc("Test"); - / dc.StartPage(); - / wxCoord w,h; - / dc.SetFont(new wxFont(10, wxROMAN, wxNORMAL, wxNORMAL)); - / dc.GetTextExtent("Hallo",&w,&h); - / dc.EndPage(); - / dc.EndDoc(); - / } - / - / by steve (stefan.hammes@urz.uni-heidelberg.de) - / created: 10.09.94 - / updated: 14.05.95 */ - - /* these static vars are for storing the state between calls */ - static int lastFamily= INT_MIN; - static int lastSize= INT_MIN; - static int lastStyle= INT_MIN; - static int lastWeight= INT_MIN; - static int lastDescender = INT_MIN; - static int lastWidths[256]; /* widths of the characters */ - - double UnderlinePosition = 0.0; - double UnderlineThickness = 0.0; - - // Get actual parameters - int Family = fontToUse->GetFamily(); - int Size = fontToUse->GetPointSize(); - int Style = fontToUse->GetStyle(); - int Weight = fontToUse->GetWeight(); - - // If we have another font, read the font-metrics - if (Family!=lastFamily || Size!=lastSize || Style!=lastStyle || Weight!=lastWeight) - { - // Store actual values - lastFamily = Family; - lastSize = Size; - lastStyle = Style; - lastWeight = Weight; - - const wxChar *name; - - switch (Family) - { - case wxMODERN: - case wxTELETYPE: - { - if ((Style == wxITALIC) && (Weight == wxBOLD)) name = wxT("CourBoO.afm"); - else if ((Style != wxITALIC) && (Weight == wxBOLD)) name = wxT("CourBo.afm"); - else if ((Style == wxITALIC) && (Weight != wxBOLD)) name = wxT("CourO.afm"); - else name = wxT("Cour.afm"); - break; - } - case wxROMAN: - { - if ((Style == wxITALIC) && (Weight == wxBOLD)) name = wxT("TimesBoO.afm"); - else if ((Style != wxITALIC) && (Weight == wxBOLD)) name = wxT("TimesBo.afm"); - else if ((Style == wxITALIC) && (Weight != wxBOLD)) name = wxT("TimesO.afm"); - else name = wxT("TimesRo.afm"); - break; - } - case wxSCRIPT: - { - name = wxT("Zapf.afm"); - break; - } - case wxSWISS: - default: - { - if ((Style == wxITALIC) && (Weight == wxBOLD)) name = wxT("HelvBoO.afm"); - else if ((Style != wxITALIC) && (Weight == wxBOLD)) name = wxT("HelvBo.afm"); - else if ((Style == wxITALIC) && (Weight != wxBOLD)) name = wxT("HelvO.afm"); - else name = wxT("Helv.afm"); - break; - } - } - - FILE *afmFile = NULL; - - // Get the directory of the AFM files - wxString afmName; - - // VZ: I don't know if the cast always works under Unix but it clearly - // never does under Windows where the pointer is - // wxWindowsPrintNativeData and so calling GetFontMetricPath() on - // it just crashes -#ifndef __WIN32__ - wxPostScriptPrintNativeData *data = - wxDynamicCast(m_printData.GetNativeData(), wxPostScriptPrintNativeData); - - if (data && !data->GetFontMetricPath().empty()) - { - afmName = data->GetFontMetricPath(); - afmName << wxFILE_SEP_PATH << name; - } -#endif // __WIN32__ - - if ( !afmName.empty() ) - afmFile = wxFopen(afmName, wxT("r")); - - if ( !afmFile ) - { -#if defined(__UNIX__) && !defined(__VMS__) - afmName = wxGetDataDir(); -#else // !__UNIX__ - afmName = wxStandardPaths::Get().GetDataDir(); -#endif // __UNIX__/!__UNIX__ - - afmName << wxFILE_SEP_PATH -#if defined(__LINUX__) || defined(__FREEBSD__) - << wxT("gs_afm") << wxFILE_SEP_PATH -#else - << wxT("afm") << wxFILE_SEP_PATH -#endif - << name; - afmFile = wxFopen(afmName,wxT("r")); - } - - /* 2. open and process the file - / a short explanation of the AFM format: - / we have for each character a line, which gives its size - / e.g.: - / - / C 63 ; WX 444 ; N question ; B 49 -14 395 676 ; - / - / that means, we have a character with ascii code 63, and width - / (444/1000 * fontSize) points. - / the other data is ignored for now! - / - / when the font has changed, we read in the right AFM file and store the - / character widths in an array, which is processed below (see point 3.). */ - if (afmFile==NULL) - { - wxLogDebug( wxT("GetTextExtent: can't open AFM file '%s'"), afmName.c_str() ); - wxLogDebug( wxT(" using approximate values")); - for (int i=0; i<256; i++) lastWidths[i] = 500; /* an approximate value */ - lastDescender = -150; /* dito. */ - } - else - { - /* init the widths array */ - for(int i=0; i<256; i++) lastWidths[i] = INT_MIN; - /* some variables for holding parts of a line */ - char cString[10], semiString[10], WXString[10]; - char descString[20]; - char upString[30], utString[30]; - char encString[50]; - char line[256]; - int ascii,cWidth; - /* read in the file and parse it */ - while(fgets(line,sizeof(line),afmFile)!=NULL) - { - /* A.) check for descender definition */ - if (strncmp(line,"Descender",9)==0) - { - if ((sscanf(line,"%s%d",descString,&lastDescender)!=2) || - (strcmp(descString,"Descender")!=0)) - { - wxLogDebug( wxT("AFM-file '%s': line '%s' has error (bad descender)"), afmName.c_str(),line ); - } - } - /* JC 1.) check for UnderlinePosition */ - else if(strncmp(line,"UnderlinePosition",17)==0) - { - if ((sscanf(line,"%s%lf",upString,&UnderlinePosition)!=2) || - (strcmp(upString,"UnderlinePosition")!=0)) - { - wxLogDebug( wxT("AFM-file '%s': line '%s' has error (bad UnderlinePosition)"), afmName.c_str(), line ); - } - } - /* JC 2.) check for UnderlineThickness */ - else if(strncmp(line,"UnderlineThickness",18)==0) - { - if ((sscanf(line,"%s%lf",utString,&UnderlineThickness)!=2) || - (strcmp(utString,"UnderlineThickness")!=0)) - { - wxLogDebug( wxT("AFM-file '%s': line '%s' has error (bad UnderlineThickness)"), afmName.c_str(), line ); - } - } - /* JC 3.) check for EncodingScheme */ - else if(strncmp(line,"EncodingScheme",14)==0) - { - if ((sscanf(line,"%s%s",utString,encString)!=2) || - (strcmp(utString,"EncodingScheme")!=0)) - { - wxLogDebug( wxT("AFM-file '%s': line '%s' has error (bad EncodingScheme)"), afmName.c_str(), line ); - } - else if (strncmp(encString, "AdobeStandardEncoding", 21)) - { - wxLogDebug( wxT("AFM-file '%s': line '%s' has error (unsupported EncodingScheme %s)"), - afmName.c_str(),line, encString); - } - } - /* B.) check for char-width */ - else if(strncmp(line,"C ",2)==0) - { - if (sscanf(line,"%s%d%s%s%d",cString,&ascii,semiString,WXString,&cWidth)!=5) - { - wxLogDebug(wxT("AFM-file '%s': line '%s' has an error (bad character width)"),afmName.c_str(),line); - } - if(strcmp(cString,"C")!=0 || strcmp(semiString,";")!=0 || strcmp(WXString,"WX")!=0) - { - wxLogDebug(wxT("AFM-file '%s': line '%s' has a format error"),afmName.c_str(),line); - } - /* printf(" char '%c'=%d has width '%d'\n",ascii,ascii,cWidth); */ - if (ascii>=0 && ascii<256) - { - lastWidths[ascii] = cWidth; /* store width */ - } - else - { - /* MATTHEW: this happens a lot; don't print an error */ - /* wxLogDebug("AFM-file '%s': ASCII value %d out of range",afmName.c_str(),ascii); */ - } - } - /* C.) ignore other entries. */ - } - fclose(afmFile); - } - /* hack to compute correct values for german 'Umlaute' - / the correct way would be to map the character names - / like 'adieresis' to corresp. positions of ISOEnc and read - / these values from AFM files, too. Maybe later ... */ - - // NB: casts to int are needed to suppress gcc 3.3 warnings - lastWidths[196] = lastWidths[(int)'A']; // U+00C4 A Umlaute - lastWidths[228] = lastWidths[(int)'a']; // U+00E4 a Umlaute - lastWidths[214] = lastWidths[(int)'O']; // U+00D6 O Umlaute - lastWidths[246] = lastWidths[(int)'o']; // U+00F6 o Umlaute - lastWidths[220] = lastWidths[(int)'U']; // U+00DC U Umlaute - lastWidths[252] = lastWidths[(int)'u']; // U+00FC u Umlaute - lastWidths[223] = lastWidths[(int)251]; // U+00DF eszett (scharfes s) - - /* JC: calculate UnderlineThickness/UnderlinePosition */ - - // VS: dirty, but is there any better solution? - double *pt; - pt = (double*) &m_underlinePosition; - *pt = LogicalToDeviceYRel((wxCoord)(UnderlinePosition * fontSize)) / 1000.0f; - pt = (double*) &m_underlineThickness; - *pt = LogicalToDeviceYRel((wxCoord)(UnderlineThickness * fontSize)) / 1000.0f; - - } - - - /* 3. now the font metrics are read in, calc size this - / is done by adding the widths of the characters in the - / string. they are given in 1/1000 of the size! */ - - long sum=0; - float height=fontSize; /* by default */ - unsigned char *p; - for(p=(unsigned char *)wxMBSTRINGCAST strbuf; *p; p++) - { - if(lastWidths[*p]== INT_MIN) - { - wxLogDebug(wxT("GetTextExtent: undefined width for character '%c' (%d)"), *p,*p); - sum += lastWidths[(unsigned char)' ']; /* assume space */ - } - else - { - sum += lastWidths[*p]; - } - } - - double widthSum = sum; - widthSum *= fontSize; - widthSum /= 1000.0F; - - /* add descender to height (it is usually a negative value) */ - //if (lastDescender != INT_MIN) - //{ - // height += (wxCoord)(((-lastDescender)/1000.0F) * Size); /* MATTHEW: forgot scale */ - //} - // - commented by V. Slavik - height already contains descender in it - // (judging from few experiments) - - /* return size values */ - if ( x ) - *x = (wxCoord)widthSum; - if ( y ) - *y = (wxCoord)height; - - /* return other parameters */ - if (descent) - { - if(lastDescender!=INT_MIN) - { - *descent = (wxCoord)(((-lastDescender)/1000.0F) * fontSize); /* MATTHEW: forgot scale */ - } - else - { - *descent = 0; - } - } - - /* currently no idea how to calculate this! */ - if (externalLeading) *externalLeading = 0; -#endif - // Use AFM -} - -// print postscript datas via required method (file, stream) -void wxPostScriptDC::PsPrintf( const wxChar* fmt, ... ) -{ - va_list argptr; - va_start(argptr, fmt); - - PsPrint( wxString::FormatV( fmt, argptr ).c_str() ); -} - -void wxPostScriptDC::PsPrint( const char* psdata ) -{ - wxPostScriptPrintNativeData *data = - (wxPostScriptPrintNativeData *) m_printData.GetNativeData(); - - switch (m_printData.GetPrintMode()) - { -#if wxUSE_STREAMS - // append to output stream - case wxPRINT_MODE_STREAM: - { - wxOutputStream* outputstream = data->GetOutputStream(); - wxCHECK_RET( outputstream, wxT("invalid outputstream") ); - outputstream->Write( psdata, strlen( psdata ) ); - } - break; -#endif // wxUSE_STREAMS - - // save data into file - default: - wxCHECK_RET( m_pstream, wxT("invalid postscript dc") ); - fwrite( psdata, 1, strlen( psdata ), m_pstream ); - } -} - -void wxPostScriptDC::PsPrint( int ch ) -{ - wxPostScriptPrintNativeData *data = - (wxPostScriptPrintNativeData *) m_printData.GetNativeData(); - - switch (m_printData.GetPrintMode()) - { -#if wxUSE_STREAMS - // append to output stream - case wxPRINT_MODE_STREAM: - { - wxOutputStream* outputstream = data->GetOutputStream(); - wxCHECK_RET( outputstream, wxT("invalid outputstream") ); - outputstream->PutC( (char)ch ); - } - break; -#endif // wxUSE_STREAMS - - // save data into file - default: - wxCHECK_RET( m_pstream, wxT("invalid postscript dc") ); - fputc( ch, m_pstream ); - } -} - -#endif // wxUSE_PRINTING_ARCHITECTURE && wxUSE_POSTSCRIPT - -// vi:sts=4:sw=4:et diff --git a/wxWidgets/src/generic/descrip.mms b/wxWidgets/src/generic/descrip.mms deleted file mode 100644 index 742fc28c50..0000000000 --- a/wxWidgets/src/generic/descrip.mms +++ /dev/null @@ -1,276 +0,0 @@ -#***************************************************************************** -# * -# Make file for VMS * -# Author : J.Jansen (joukj@hrem.nano.tudelft.nl) * -# Date : 31 October 2006 * -# * -#***************************************************************************** -.first - define wx [--.include.wx] - -.ifdef __WXMOTIF__ -CXX_DEFINE = /define=(__WXMOTIF__=1)/name=(as_is,short)\ - /assume=(nostdnew,noglobal_array_new) -CC_DEFINE = /define=(__WXMOTIF__=1)/name=(as_is,short) -.else -.ifdef __WXGTK__ -CXX_DEFINE = /define=(__WXGTK__=1)/float=ieee/name=(as_is,short)/ieee=denorm\ - /assume=(nostdnew,noglobal_array_new) -CC_DEFINE = /define=(__WXGTK__=1)/float=ieee/name=(as_is,short)/ieee=denorm -.else -.ifdef __WXX11__ -CXX_DEFINE = /define=(__WXX11__=1,__WXUNIVERSAL__==1)/float=ieee\ - /name=(as_is,short)/assume=(nostdnew,noglobal_array_new) -CC_DEFINE = /define=(__WXX11__=1,__WXUNIVERSAL__==1)/float=ieee\ - /name=(as_is,short) -.else -.ifdef __WXGTK2__ -CXX_DEFINE = /define=(__WXGTK__=1,VMS_GTK2==1)/float=ieee\ - /name=(as_is,short)/assume=(nostdnew,noglobal_array_new) -CC_DEFINE = /define=(__WX_GTK__=1,VMS_GTK2==1)/float=ieee\ - /name=(as_is,short) -.else -CXX_DEFINE = -CC_DEFINE = -.endif -.endif -.endif -.endif - -.suffixes : .cpp - -.cpp.obj : - cxx $(CXXFLAGS)$(CXX_DEFINE) $(MMS$TARGET_NAME).cpp -.c.obj : - cc $(CFLAGS)$(CC_DEFINE) $(MMS$TARGET_NAME).c - -OBJECTS = \ - aboutdlgg.obj,\ - animateg.obj,\ - busyinfo.obj,\ - calctrl.obj,\ - caret.obj,\ - choicbkg.obj,\ - choicdgg.obj,\ - colrdlgg.obj,\ - clrpickerg.obj,\ - datectlg.obj,\ - dcpsg.obj,\ - dirctrlg.obj,\ - dirdlgg.obj,\ - fdrepdlg.obj,\ - fontdlgg.obj,\ - fontpickerg.obj,\ - grid.obj,\ - gridctrl.obj,\ - gridsel.obj,\ - helpext.obj,\ - htmllbox.obj,\ - imaglist.obj,\ - laywin.obj,\ - listbkg.obj,\ - listctrl.obj,\ - logg.obj,\ - msgdlgg.obj,\ - numdlgg.obj,\ - odcombo.obj,\ - panelg.obj,\ - printps.obj,\ - prntdlgg.obj,\ - propdlg.obj,\ - progdlgg.obj,\ - renderg.obj,\ - sashwin.obj,\ - scrlwing.obj,\ - selstore.obj,\ - splitter.obj,\ - tabg.obj,\ - textdlgg.obj,\ - tipdlg.obj,\ - tipwin.obj,\ - toolbkg.obj,\ - treebkg.obj,\ - treectlg.obj,\ - wizard.obj,\ - hyperlink.obj,\ - filepickerg.obj,\ - bmpcboxg.obj - -SOURCES = \ - aboutdlgg.cpp,\ - accel.cpp,\ - animateg.cpp,\ - busyinfo.cpp,\ - calctrl.cpp,\ - caret.cpp,\ - choicbkg.cpp,\ - choicdgg.cpp,\ - collpaneg.cpp,\ - colrdlgg.cpp,\ - clrpickerg.cpp,\ - datectlg.cpp,\ - dcpsg.cpp,\ - dirctrlg.cpp,\ - dirdlgg.cpp,\ - filedlgg.cpp,\ - fdrepdlg.cpp,\ - fontdlgg.cpp,\ - fontpickerg.cpp,\ - grid.cpp,\ - gridctrl.cpp,\ - gridsel.cpp,\ - helpext.cpp,\ - htmllbox.cpp,\ - imaglist.cpp,\ - laywin.cpp,\ - listbkg.cpp,\ - listctrl.cpp,\ - logg.cpp,\ - msgdlgg.cpp,\ - notebook.cpp,\ - numdlgg.cpp,\ - odcombo.cpp,\ - paletteg.cpp,\ - panelg.cpp,\ - printps.cpp,\ - prntdlgg.cpp,\ - propdlg.cpp,\ - progdlgg.cpp,\ - renderg.cpp,\ - sashwin.cpp,\ - selstore.cpp,\ - splitter.cpp,\ - statline.cpp,\ - statusbr.cpp,\ - tabg.cpp,\ - textdlgg.cpp,\ - tipdlg.cpp,\ - tipwin.cpp,\ - toolbkg.cpp,\ - treebkg.cpp,\ - treectlg.cpp,\ - wizard.cpp,\ - dragimgg.cpp,\ - fdrepdlg.cpp,\ - htmllbox.cpp,\ - listbkg.cpp,\ - mdig.cpp,\ - scrlwing.cpp,\ - spinctlg.cpp,\ - splash.cpp,\ - timer.cpp,\ - vlbox.cpp,\ - hyperlink.cpp,\ - filepickerg.cpp,\ - vscroll.cpp,\ - icon.cpp,bmpcboxg.cpp - -.ifdef __WXMOTIF__ -OBJECTS0=,statusbr.obj,statline.obj,notebook.obj,spinctlg.obj,collpaneg.obj,\ - combog.obj -.else -.ifdef __WXX11__ -OBJECTS0=,accel.obj,filedlgg.obj,dragimgg.obj,fdrepdlg.obj,htmllbox.obj,\ - listbkg.obj,mdig.obj,spinctlg.obj,splash.obj,timer.obj,\ - vlbox.obj,vscroll.obj,combog.obj,icon.obj,collpaneg.obj -.else -.ifdef __WXGTK__ -OBJECTS0=,accel.obj,statusbr.obj,filedlgg.obj,paletteg.obj,vlbox.obj,\ - vscroll.obj,combog.obj,icon.obj,collpaneg.obj -.else -OBJECTS0=,accel.obj,statusbr.obj,filedlgg.obj,paletteg.obj,vlbox.obj,\ - vscroll.obj,combog.obj,icon.obj -.endif -.endif -.endif - -all : $(SOURCES) - $(MMS)$(MMSQUALIFIERS) $(OBJECTS)$(OBJECTS0) -.ifdef __WXMOTIF__ - library/crea [--.lib]libwx_motif.olb $(OBJECTS)$(OBJECTS0) -.else -.ifdef __WXGTK__ - library/crea [--.lib]libwx_gtk.olb $(OBJECTS)$(OBJECTS0) -.else -.ifdef __WXGTK2__ - library/crea [--.lib]libwx_gtk2.olb $(OBJECTS)$(OBJECTS0) -.else -.ifdef __WXX11__ - library/crea [--.lib]libwx_x11_univ.olb $(OBJECTS)$(OBJECTS0) -.endif -.endif -.endif -.endif - -aboutdlgg.obj : aboutdlgg.cpp -accel.obj : accel.cpp -animateg.obj : animateg.cpp -busyinfo.obj : busyinfo.cpp -calctrl.obj : calctrl.cpp -caret.obj : caret.cpp -choicdgg.obj : choicdgg.cpp -clrpickerg.obj : clrpickerg.cpp -collpaneg.obj : collpaneg.cpp -colrdlgg.obj : colrdlgg.cpp -datectlg.obj : datectlg.cpp -dcpsg.obj : dcpsg.cpp -dirctrlg.obj : dirctrlg.cpp -dirdlgg.obj : dirdlgg.cpp -filedlgg.obj : filedlgg.cpp -fontdlgg.obj : fontdlgg.cpp -fdrepdlg.obj : fdrepdlg.cpp -grid.obj : grid.cpp -gridctrl.obj : gridctrl.cpp -gridsel.obj : gridsel.cpp -helpext.obj : helpext.cpp -htmllbox.obj : htmllbox.cpp -icon.obj : icon.cpp -imaglist.obj : imaglist.cpp -laywin.obj : laywin.cpp -listctrl.obj : listctrl.cpp -logg.obj : logg.cpp -msgdlgg.obj : msgdlgg.cpp -notebook.obj : notebook.cpp -numdlgg.obj : numdlgg.cpp -odcombo.obj : odcombo.cpp -paletteg.obj : paletteg.cpp -panelg.obj : panelg.cpp -printps.obj : printps.cpp -prntdlgg.obj : prntdlgg.cpp -progdlgg.obj : progdlgg.cpp -propdlg.obj : propdlg.cpp -scrlwing.obj : scrlwing.cpp -spinctlg.obj : spinctlg.cpp -renderg.obj : renderg.cpp -sashwin.obj : sashwin.cpp -selstore.obj : selstore.cpp -splitter.obj : splitter.cpp -statline.obj : statline.cpp -statusbr.obj : statusbr.cpp -tabg.obj : tabg.cpp -textdlgg.obj : textdlgg.cpp -tipdlg.obj : tipdlg.cpp -tipwin.obj : tipwin.cpp -treectlg.obj : treectlg.cpp -wizard.obj : wizard.cpp -dragimgg.obj : dragimgg.cpp -fdrepdlg.obj : fdrepdlg.cpp -htmllbox.obj : htmllbox.cpp -listbkg.obj : listbkg.cpp -mdig.obj : mdig.cpp -scrlwing.obj : scrlwing.cpp -spinctlg.obj : spinctlg.cpp -splash.obj : splash.cpp -timer.obj : timer.cpp -vlbox.obj : vlbox.cpp -vscroll.obj : vscroll.cpp - cxx $(CXXFLAGS)$(CXX_DEFINE)/nowarn vscroll.cpp -listbkg.obj : listbkg.cpp -choicbkg.obj : choicbkg.cpp -toolbkg.obj : toolbkg.cpp -treebkg.obj : treebkg.cpp -combog.obj : combog.cpp -fontpickerg.obj : fontpickerg.cpp -hyperlink.obj : hyperlink.cpp -filepickerg.obj : filepickerg.cpp -bmpcboxg.obj : bmpcboxg.cpp diff --git a/wxWidgets/src/generic/dirctrlg.cpp b/wxWidgets/src/generic/dirctrlg.cpp deleted file mode 100644 index 481c5629a6..0000000000 --- a/wxWidgets/src/generic/dirctrlg.cpp +++ /dev/null @@ -1,1700 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/generic/dirctrlg.cpp -// Purpose: wxGenericDirCtrl -// Author: Harm van der Heijden, Robert Roebling, Julian Smart -// Modified by: -// Created: 12/12/98 -// RCS-ID: $Id: dirctrlg.cpp 62093 2009-09-24 17:04:10Z JS $ -// Copyright: (c) Harm van der Heijden, Robert Roebling and Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_DIRDLG || wxUSE_FILEDLG - -#include "wx/generic/dirctrlg.h" - -#ifndef WX_PRECOMP - #include "wx/hash.h" - #include "wx/intl.h" - #include "wx/log.h" - #include "wx/utils.h" - #include "wx/button.h" - #include "wx/icon.h" - #include "wx/settings.h" - #include "wx/msgdlg.h" - #include "wx/cmndata.h" - #include "wx/choice.h" - #include "wx/textctrl.h" - #include "wx/layout.h" - #include "wx/sizer.h" - #include "wx/textdlg.h" - #include "wx/gdicmn.h" - #include "wx/image.h" - #include "wx/module.h" -#endif - -#include "wx/filefn.h" -#include "wx/imaglist.h" -#include "wx/tokenzr.h" -#include "wx/dir.h" -#include "wx/artprov.h" -#include "wx/mimetype.h" - -#if wxUSE_STATLINE - #include "wx/statline.h" -#endif - -#if defined(__WXMAC__) - #include "wx/mac/private.h" // includes mac headers -#endif - -#ifdef __WXMSW__ -#include -#include "wx/msw/winundef.h" - -// FIXME - Mingw32 1.0 has both _getdrive() and _chdrive(). For now, let's assume -// older releases don't, but it should be verified and the checks modified -// accordingly. -#if !defined(__GNUWIN32__) || (defined(__MINGW32_MAJOR_VERSION) && __MINGW32_MAJOR_VERSION >= 1) -#if !defined(__WXWINCE__) - #include -#endif - #include - #include -#endif - -#endif - -#if defined(__OS2__) || defined(__DOS__) - #ifdef __OS2__ - #define INCL_BASE - #include - #ifndef __EMX__ - #include - #endif - #include - #include - #endif - extern bool wxIsDriveAvailable(const wxString& dirName); -#endif // __OS2__ - -#if defined(__WXMAC__) - #include "MoreFilesX.h" -#endif - -#ifdef __BORLANDC__ - #include "dos.h" -#endif - -// If compiled under Windows, this macro can cause problems -#ifdef GetFirstChild -#undef GetFirstChild -#endif - -// ---------------------------------------------------------------------------- -// wxGetAvailableDrives, for WINDOWS, DOS, OS2, MAC, UNIX (returns "/") -// ---------------------------------------------------------------------------- - -size_t wxGetAvailableDrives(wxArrayString &paths, wxArrayString &names, wxArrayInt &icon_ids) -{ -#if defined(__WINDOWS__) || defined(__DOS__) || defined(__OS2__) - -#ifdef __WXWINCE__ - // No logical drives; return "\" - paths.Add(wxT("\\")); - names.Add(wxT("\\")); - icon_ids.Add(wxFileIconsTable::computer); -#elif defined(__WIN32__) - wxChar driveBuffer[256]; - size_t n = (size_t) GetLogicalDriveStrings(255, driveBuffer); - size_t i = 0; - while (i < n) - { - wxString path, name; - path.Printf(wxT("%c:\\"), driveBuffer[i]); - name.Printf(wxT("%c:"), driveBuffer[i]); - - // Do not use GetVolumeInformation to further decorate the - // name, since it can cause severe delays on network drives. - - int imageId; - int driveType = ::GetDriveType(path); - switch (driveType) - { - case DRIVE_REMOVABLE: - if (path == wxT("a:\\") || path == wxT("b:\\")) - imageId = wxFileIconsTable::floppy; - else - imageId = wxFileIconsTable::removeable; - break; - case DRIVE_CDROM: - imageId = wxFileIconsTable::cdrom; - break; - case DRIVE_REMOTE: - case DRIVE_FIXED: - default: - imageId = wxFileIconsTable::drive; - break; - } - - paths.Add(path); - names.Add(name); - icon_ids.Add(imageId); - - while (driveBuffer[i] != wxT('\0')) - i ++; - i ++; - if (driveBuffer[i] == wxT('\0')) - break; - } -#elif defined(__OS2__) - APIRET rc; - ULONG ulDriveNum = 0; - ULONG ulDriveMap = 0; - rc = ::DosQueryCurrentDisk(&ulDriveNum, &ulDriveMap); - if ( rc == 0) - { - size_t i = 0; - while (i < 26) - { - if (ulDriveMap & ( 1 << i )) - { - wxString path, name; - path.Printf(wxT("%c:\\"), 'A' + i); - name.Printf(wxT("%c:"), 'A' + i); - - // Note: If _filesys is unsupported by some compilers, - // we can always replace it by DosQueryFSAttach - char filesysname[20]; -#ifdef __WATCOMC__ - ULONG cbBuffer = sizeof(filesysname); - PFSQBUFFER2 pfsqBuffer = (PFSQBUFFER2)filesysname; - APIRET rc = ::DosQueryFSAttach(name.fn_str(),0,FSAIL_QUERYNAME,pfsqBuffer,&cbBuffer); - if (rc != NO_ERROR) - { - filesysname[0] = '\0'; - } -#else - _filesys(name.fn_str(), filesysname, sizeof(filesysname)); -#endif - /* FAT, LAN, HPFS, CDFS, NFS */ - int imageId; - if (path == wxT("A:\\") || path == wxT("B:\\")) - imageId = wxFileIconsTable::floppy; - else if (!strcmp(filesysname, "CDFS")) - imageId = wxFileIconsTable::cdrom; - else if (!strcmp(filesysname, "LAN") || - !strcmp(filesysname, "NFS")) - imageId = wxFileIconsTable::drive; - else - imageId = wxFileIconsTable::drive; - paths.Add(path); - names.Add(name); - icon_ids.Add(imageId); - } - i ++; - } - } -#else // !__WIN32__, !__OS2__ - int drive; - - /* If we can switch to the drive, it exists. */ - for( drive = 1; drive <= 26; drive++ ) - { - wxString path, name; - path.Printf(wxT("%c:\\"), (char) (drive + 'a' - 1)); - name.Printf(wxT("%c:"), (char) (drive + 'A' - 1)); - - if (wxIsDriveAvailable(path)) - { - paths.Add(path); - names.Add(name); - icon_ids.Add((drive <= 2) ? wxFileIconsTable::floppy : wxFileIconsTable::drive); - } - } -#endif // __WIN32__/!__WIN32__ - -#elif defined(__WXMAC__) - - ItemCount volumeIndex = 1; - OSErr err = noErr ; - - while( noErr == err ) - { - HFSUniStr255 volumeName ; - FSRef fsRef ; - FSVolumeInfo volumeInfo ; - err = FSGetVolumeInfo(0, volumeIndex, NULL, kFSVolInfoFlags , &volumeInfo , &volumeName, &fsRef); - if( noErr == err ) - { - wxString path = wxMacFSRefToPath( &fsRef ) ; - wxString name = wxMacHFSUniStrToString( &volumeName ) ; - - if ( (volumeInfo.flags & kFSVolFlagSoftwareLockedMask) || (volumeInfo.flags & kFSVolFlagHardwareLockedMask) ) - { - icon_ids.Add(wxFileIconsTable::cdrom); - } - else - { - icon_ids.Add(wxFileIconsTable::drive); - } - // todo other removable - - paths.Add(path); - names.Add(name); - volumeIndex++ ; - } - } - -#elif defined(__UNIX__) - paths.Add(wxT("/")); - names.Add(wxT("/")); - icon_ids.Add(wxFileIconsTable::computer); -#else - #error "Unsupported platform in wxGenericDirCtrl!" -#endif - wxASSERT_MSG( (paths.GetCount() == names.GetCount()), wxT("The number of paths and their human readable names should be equal in number.")); - wxASSERT_MSG( (paths.GetCount() == icon_ids.GetCount()), wxT("Wrong number of icons for available drives.")); - return paths.GetCount(); -} - -// ---------------------------------------------------------------------------- -// wxIsDriveAvailable -// ---------------------------------------------------------------------------- - -#if defined(__DOS__) - -bool wxIsDriveAvailable(const wxString& dirName) -{ - // FIXME_MGL - this method leads to hang up under Watcom for some reason -#ifdef __WATCOMC__ - wxUnusedVar(dirName); -#else - if ( dirName.length() == 3 && dirName[1u] == wxT(':') ) - { - wxString dirNameLower(dirName.Lower()); - // VS: always return true for removable media, since Win95 doesn't - // like it when MS-DOS app accesses empty floppy drive - return (dirNameLower[0u] == wxT('a') || - dirNameLower[0u] == wxT('b') || - wxDirExists(dirNameLower)); - } - else -#endif - return true; -} - -#elif defined(__WINDOWS__) || defined(__OS2__) - -int setdrive(int WXUNUSED_IN_WINCE(drive)) -{ -#ifdef __WXWINCE__ - return 0; -#elif defined(__GNUWIN32__) && \ - (defined(__MINGW32_MAJOR_VERSION) && __MINGW32_MAJOR_VERSION >= 1) - return _chdrive(drive); -#else - wxChar newdrive[4]; - - if (drive < 1 || drive > 31) - return -1; - newdrive[0] = (wxChar)(wxT('A') + drive - 1); - newdrive[1] = wxT(':'); -#ifdef __OS2__ - newdrive[2] = wxT('\\'); - newdrive[3] = wxT('\0'); -#else - newdrive[2] = wxT('\0'); -#endif -#if defined(__WXMSW__) - if (::SetCurrentDirectory(newdrive)) -#else - // VA doesn't know what LPSTR is and has its own set - if (!DosSetCurrentDir((PSZ)newdrive)) -#endif - return 0; - else - return -1; -#endif // !GNUWIN32 -} - -bool wxIsDriveAvailable(const wxString& WXUNUSED_IN_WINCE(dirName)) -{ -#ifdef __WXWINCE__ - return false; -#else -#ifdef __WIN32__ - UINT errorMode = SetErrorMode(SEM_FAILCRITICALERRORS | SEM_NOOPENFILEERRORBOX); -#endif - bool success = true; - - // Check if this is a root directory and if so, - // whether the drive is available. - if (dirName.length() == 3 && dirName[(size_t)1] == wxT(':')) - { - wxString dirNameLower(dirName.Lower()); -#if defined(__GNUWIN32__) && !(defined(__MINGW32_MAJOR_VERSION) && __MINGW32_MAJOR_VERSION >= 1) - success = wxDirExists(dirNameLower); -#else - #if defined(__OS2__) - // Avoid changing to drive since no media may be inserted. - if (dirNameLower[(size_t)0] == 'a' || dirNameLower[(size_t)0] == 'b') - return success; - #endif - int currentDrive = _getdrive(); - int thisDrive = (int) (dirNameLower[(size_t)0] - 'a' + 1) ; - int err = setdrive( thisDrive ) ; - setdrive( currentDrive ); - - if (err == -1) - { - success = false; - } -#endif - } -#ifdef __WIN32__ - (void) SetErrorMode(errorMode); -#endif - - return success; -#endif -} -#endif // __WINDOWS__ || __OS2__ - -#endif // wxUSE_DIRDLG || wxUSE_FILEDLG - - - -#if wxUSE_DIRDLG - -// Function which is called by quick sort. We want to override the default wxArrayString behaviour, -// and sort regardless of case. -static int wxCMPFUNC_CONV wxDirCtrlStringCompareFunction(const wxString& strFirst, const wxString& strSecond) -{ - return strFirst.CmpNoCase(strSecond); -} - -//----------------------------------------------------------------------------- -// wxDirItemData -//----------------------------------------------------------------------------- - -wxDirItemData::wxDirItemData(const wxString& path, const wxString& name, - bool isDir) -{ - m_path = path; - m_name = name; - /* Insert logic to detect hidden files here - * In UnixLand we just check whether the first char is a dot - * For FileNameFromPath read LastDirNameInThisPath ;-) */ - // m_isHidden = (bool)(wxFileNameFromPath(*m_path)[0] == '.'); - m_isHidden = false; - m_isExpanded = false; - m_isDir = isDir; -} - -void wxDirItemData::SetNewDirName(const wxString& path) -{ - m_path = path; - m_name = wxFileNameFromPath(path); -} - -bool wxDirItemData::HasSubDirs() const -{ - if (m_path.empty()) - return false; - - wxDir dir; - { - wxLogNull nolog; - if ( !dir.Open(m_path) ) - return false; - } - - return dir.HasSubDirs(); -} - -bool wxDirItemData::HasFiles(const wxString& WXUNUSED(spec)) const -{ - if (m_path.empty()) - return false; - - wxDir dir; - { - wxLogNull nolog; - if ( !dir.Open(m_path) ) - return false; - } - - return dir.HasFiles(); -} - -//----------------------------------------------------------------------------- -// wxGenericDirCtrl -//----------------------------------------------------------------------------- - - -#if wxUSE_EXTENDED_RTTI -WX_DEFINE_FLAGS( wxGenericDirCtrlStyle ) - -wxBEGIN_FLAGS( wxGenericDirCtrlStyle ) - // new style border flags, we put them first to - // use them for streaming out - wxFLAGS_MEMBER(wxBORDER_SIMPLE) - wxFLAGS_MEMBER(wxBORDER_SUNKEN) - wxFLAGS_MEMBER(wxBORDER_DOUBLE) - wxFLAGS_MEMBER(wxBORDER_RAISED) - wxFLAGS_MEMBER(wxBORDER_STATIC) - wxFLAGS_MEMBER(wxBORDER_NONE) - - // old style border flags - wxFLAGS_MEMBER(wxSIMPLE_BORDER) - wxFLAGS_MEMBER(wxSUNKEN_BORDER) - wxFLAGS_MEMBER(wxDOUBLE_BORDER) - wxFLAGS_MEMBER(wxRAISED_BORDER) - wxFLAGS_MEMBER(wxSTATIC_BORDER) - wxFLAGS_MEMBER(wxBORDER) - - // standard window styles - wxFLAGS_MEMBER(wxTAB_TRAVERSAL) - wxFLAGS_MEMBER(wxCLIP_CHILDREN) - wxFLAGS_MEMBER(wxTRANSPARENT_WINDOW) - wxFLAGS_MEMBER(wxWANTS_CHARS) - wxFLAGS_MEMBER(wxFULL_REPAINT_ON_RESIZE) - wxFLAGS_MEMBER(wxALWAYS_SHOW_SB ) - wxFLAGS_MEMBER(wxVSCROLL) - wxFLAGS_MEMBER(wxHSCROLL) - - wxFLAGS_MEMBER(wxDIRCTRL_DIR_ONLY) - wxFLAGS_MEMBER(wxDIRCTRL_3D_INTERNAL) - wxFLAGS_MEMBER(wxDIRCTRL_SELECT_FIRST) - wxFLAGS_MEMBER(wxDIRCTRL_SHOW_FILTERS) - -wxEND_FLAGS( wxGenericDirCtrlStyle ) - -IMPLEMENT_DYNAMIC_CLASS_XTI(wxGenericDirCtrl, wxControl,"wx/dirctrl.h") - -wxBEGIN_PROPERTIES_TABLE(wxGenericDirCtrl) - wxHIDE_PROPERTY( Children ) - wxPROPERTY( DefaultPath , wxString , SetDefaultPath , GetDefaultPath , EMPTY_MACROVALUE , 0 /*flags*/ , wxT("Helpstring") , wxT("group")) - wxPROPERTY( Filter , wxString , SetFilter , GetFilter , EMPTY_MACROVALUE , 0 /*flags*/ , wxT("Helpstring") , wxT("group") ) - wxPROPERTY( DefaultFilter , int , SetFilterIndex, GetFilterIndex, EMPTY_MACROVALUE , 0 /*flags*/ , wxT("Helpstring") , wxT("group") ) - wxPROPERTY_FLAGS( WindowStyle, wxGenericDirCtrlStyle, long, SetWindowStyleFlag, GetWindowStyleFlag, EMPTY_MACROVALUE , 0, wxT("Helpstring"), wxT("group") ) -wxEND_PROPERTIES_TABLE() - -wxBEGIN_HANDLERS_TABLE(wxGenericDirCtrl) -wxEND_HANDLERS_TABLE() - -wxCONSTRUCTOR_8( wxGenericDirCtrl , wxWindow* , Parent , wxWindowID , Id , wxString , DefaultPath , - wxPoint , Position , wxSize , Size , long , WindowStyle , wxString , Filter , int , DefaultFilter ) -#else -IMPLEMENT_DYNAMIC_CLASS(wxGenericDirCtrl, wxControl) -#endif - -BEGIN_EVENT_TABLE(wxGenericDirCtrl, wxControl) - EVT_TREE_ITEM_EXPANDING (wxID_TREECTRL, wxGenericDirCtrl::OnExpandItem) - EVT_TREE_ITEM_COLLAPSED (wxID_TREECTRL, wxGenericDirCtrl::OnCollapseItem) - EVT_TREE_BEGIN_LABEL_EDIT (wxID_TREECTRL, wxGenericDirCtrl::OnBeginEditItem) - EVT_TREE_END_LABEL_EDIT (wxID_TREECTRL, wxGenericDirCtrl::OnEndEditItem) - EVT_SIZE (wxGenericDirCtrl::OnSize) -END_EVENT_TABLE() - -wxGenericDirCtrl::wxGenericDirCtrl(void) -{ - Init(); -} - -void wxGenericDirCtrl::ExpandRoot() -{ - ExpandDir(m_rootId); // automatically expand first level - - // Expand and select the default path - if (!m_defaultPath.empty()) - { - ExpandPath(m_defaultPath); - } -#ifdef __UNIX__ - else - { - // On Unix, there's only one node under the (hidden) root node. It - // represents the / path, so the user would always have to expand it; - // let's do it ourselves - ExpandPath( wxT("/") ); - } -#endif -} - -bool wxGenericDirCtrl::Create(wxWindow *parent, - const wxWindowID id, - const wxString& dir, - const wxPoint& pos, - const wxSize& size, - long style, - const wxString& filter, - int defaultFilter, - const wxString& name) -{ - if (!wxControl::Create(parent, id, pos, size, style, wxDefaultValidator, name)) - return false; - - SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE)); - SetForegroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT)); - - Init(); - - long treeStyle = wxTR_HAS_BUTTONS; - - // On Windows CE, if you hide the root, you get a crash when - // attempting to access data for children of the root item. -#ifndef __WXWINCE__ - treeStyle |= wxTR_HIDE_ROOT; -#endif - -#ifdef __WXGTK20__ - treeStyle |= wxTR_NO_LINES; -#endif - - if (style & wxDIRCTRL_EDIT_LABELS) - treeStyle |= wxTR_EDIT_LABELS; - - if ((style & wxDIRCTRL_3D_INTERNAL) == 0) - treeStyle |= wxNO_BORDER; - else - treeStyle |= wxBORDER_SUNKEN; - - long filterStyle = 0; - if ((style & wxDIRCTRL_3D_INTERNAL) == 0) - filterStyle |= wxNO_BORDER; - else - filterStyle |= wxBORDER_SUNKEN; - - m_treeCtrl = CreateTreeCtrl(this, wxID_TREECTRL, - wxPoint(0,0), GetClientSize(), treeStyle); - - if (!filter.empty() && (style & wxDIRCTRL_SHOW_FILTERS)) - m_filterListCtrl = new wxDirFilterListCtrl(this, wxID_FILTERLISTCTRL, wxDefaultPosition, wxDefaultSize, filterStyle); - - m_defaultPath = dir; - m_filter = filter; - - if (m_filter.empty()) -#ifdef __UNIX__ - m_filter = wxT("*"); -#else - m_filter = wxT("*.*"); -#endif - - SetFilterIndex(defaultFilter); - - if (m_filterListCtrl) - m_filterListCtrl->FillFilterList(filter, defaultFilter); - - m_treeCtrl->SetImageList(wxTheFileIconsTable->GetSmallImageList()); - - m_showHidden = false; - wxDirItemData* rootData = new wxDirItemData(wxEmptyString, wxEmptyString, true); - - wxString rootName; - -#if defined(__WINDOWS__) || defined(__OS2__) || defined(__DOS__) - rootName = _("Computer"); -#else - rootName = _("Sections"); -#endif - - m_rootId = m_treeCtrl->AddRoot( rootName, 3, -1, rootData); - m_treeCtrl->SetItemHasChildren(m_rootId); - - ExpandRoot(); - - SetInitialSize(size); - DoResize(); - - return true; -} - -wxGenericDirCtrl::~wxGenericDirCtrl() -{ -} - -void wxGenericDirCtrl::Init() -{ - m_showHidden = false; - m_currentFilter = 0; - m_currentFilterStr = wxEmptyString; // Default: any file - m_treeCtrl = NULL; - m_filterListCtrl = NULL; -} - -wxTreeCtrl* wxGenericDirCtrl::CreateTreeCtrl(wxWindow *parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long treeStyle) -{ - return new wxTreeCtrl(parent, id, pos, size, treeStyle); -} - -void wxGenericDirCtrl::ShowHidden( bool show ) -{ - m_showHidden = show; - - wxString path = GetPath(); - ReCreateTree(); - SetPath(path); -} - -const wxTreeItemId -wxGenericDirCtrl::AddSection(const wxString& path, const wxString& name, int imageId) -{ - wxDirItemData *dir_item = new wxDirItemData(path,name,true); - - wxTreeItemId id = AppendItem( m_rootId, name, imageId, -1, dir_item); - - m_treeCtrl->SetItemHasChildren(id); - - return id; -} - -void wxGenericDirCtrl::SetupSections() -{ - wxArrayString paths, names; - wxArrayInt icons; - - size_t n, count = wxGetAvailableDrives(paths, names, icons); - -#ifdef __WXGTK20__ - wxString home = wxGetHomeDir(); - AddSection( home, _("Home directory"), 1); - home += wxT("/Desktop"); - AddSection( home, _("Desktop"), 1); -#endif - - for (n = 0; n < count; n++) - AddSection(paths[n], names[n], icons[n]); -} - -void wxGenericDirCtrl::OnBeginEditItem(wxTreeEvent &event) -{ - // don't rename the main entry "Sections" - if (event.GetItem() == m_rootId) - { - event.Veto(); - return; - } - - // don't rename the individual sections - if (m_treeCtrl->GetItemParent( event.GetItem() ) == m_rootId) - { - event.Veto(); - return; - } -} - -void wxGenericDirCtrl::OnEndEditItem(wxTreeEvent &event) -{ - if (event.IsEditCancelled()) - return; - - if ((event.GetLabel().empty()) || - (event.GetLabel() == wxT(".")) || - (event.GetLabel() == wxT("..")) || - (event.GetLabel().Find(wxT('/')) != wxNOT_FOUND) || - (event.GetLabel().Find(wxT('\\')) != wxNOT_FOUND) || - (event.GetLabel().Find(wxT('|')) != wxNOT_FOUND)) - { - wxMessageDialog dialog(this, _("Illegal directory name."), _("Error"), wxOK | wxICON_ERROR ); - dialog.ShowModal(); - event.Veto(); - return; - } - - wxTreeItemId id = event.GetItem(); - wxDirItemData *data = (wxDirItemData*)m_treeCtrl->GetItemData( id ); - wxASSERT( data ); - - wxString new_name( wxPathOnly( data->m_path ) ); - new_name += wxString(wxFILE_SEP_PATH); - new_name += event.GetLabel(); - - wxLogNull log; - - if (wxFileExists(new_name)) - { - wxMessageDialog dialog(this, _("File name exists already."), _("Error"), wxOK | wxICON_ERROR ); - dialog.ShowModal(); - event.Veto(); - } - - if (wxRenameFile(data->m_path,new_name)) - { - data->SetNewDirName( new_name ); - } - else - { - wxMessageDialog dialog(this, _("Operation not permitted."), _("Error"), wxOK | wxICON_ERROR ); - dialog.ShowModal(); - event.Veto(); - } -} - -void wxGenericDirCtrl::OnExpandItem(wxTreeEvent &event) -{ - wxTreeItemId parentId = event.GetItem(); - - // VS: this is needed because the event handler is called from wxTreeCtrl - // ctor when wxTR_HIDE_ROOT was specified - - if (!m_rootId.IsOk()) - - m_rootId = m_treeCtrl->GetRootItem(); - - ExpandDir(parentId); -} - -void wxGenericDirCtrl::OnCollapseItem(wxTreeEvent &event ) -{ - CollapseDir(event.GetItem()); -} - -void wxGenericDirCtrl::CollapseDir(wxTreeItemId parentId) -{ - wxTreeItemId child; - - wxDirItemData *data = (wxDirItemData *) m_treeCtrl->GetItemData(parentId); - if (!data->m_isExpanded) - return; - - data->m_isExpanded = false; - - m_treeCtrl->Freeze(); - if (parentId != m_treeCtrl->GetRootItem()) - m_treeCtrl->CollapseAndReset(parentId); - m_treeCtrl->DeleteChildren(parentId); - m_treeCtrl->Thaw(); -} - -void wxGenericDirCtrl::ExpandDir(wxTreeItemId parentId) -{ - wxDirItemData *data = (wxDirItemData *) m_treeCtrl->GetItemData(parentId); - - if (data->m_isExpanded) - return; - - data->m_isExpanded = true; - - if (parentId == m_treeCtrl->GetRootItem()) - { - SetupSections(); - return; - } - - wxASSERT(data); - - wxString search,path,filename; - - wxString dirName(data->m_path); - -#if (defined(__WINDOWS__) && !defined(__WXWINCE__)) || defined(__DOS__) || defined(__OS2__) - // Check if this is a root directory and if so, - // whether the drive is avaiable. - if (!wxIsDriveAvailable(dirName)) - { - data->m_isExpanded = false; - //wxMessageBox(wxT("Sorry, this drive is not available.")); - return; - } -#endif - - // This may take a longish time. Go to busy cursor - wxBusyCursor busy; - -#if defined(__WINDOWS__) || defined(__DOS__) || defined(__OS2__) - if (dirName.Last() == ':') - dirName += wxString(wxFILE_SEP_PATH); -#endif - - wxArrayString dirs; - wxArrayString filenames; - - wxDir d; - wxString eachFilename; - - wxLogNull log; - d.Open(dirName); - - if (d.IsOpened()) - { - int style = wxDIR_DIRS; - if (m_showHidden) style |= wxDIR_HIDDEN; - if (d.GetFirst(& eachFilename, wxEmptyString, style)) - { - do - { - if ((eachFilename != wxT(".")) && (eachFilename != wxT(".."))) - { - dirs.Add(eachFilename); - } - } - while (d.GetNext(&eachFilename)); - } - } - dirs.Sort(wxDirCtrlStringCompareFunction); - - // Now do the filenames -- but only if we're allowed to - if ((GetWindowStyle() & wxDIRCTRL_DIR_ONLY) == 0) - { - d.Open(dirName); - - if (d.IsOpened()) - { - int style = wxDIR_FILES; - if (m_showHidden) style |= wxDIR_HIDDEN; - // Process each filter (ex: "JPEG Files (*.jpg;*.jpeg)|*.jpg;*.jpeg") - wxStringTokenizer strTok; - wxString curFilter; - strTok.SetString(m_currentFilterStr,wxT(";")); - while(strTok.HasMoreTokens()) - { - curFilter = strTok.GetNextToken(); - if (d.GetFirst(& eachFilename, curFilter, style)) - { - do - { - if ((eachFilename != wxT(".")) && (eachFilename != wxT(".."))) - { - filenames.Add(eachFilename); - } - } - while (d.GetNext(& eachFilename)); - } - } - } - filenames.Sort(wxDirCtrlStringCompareFunction); - } - - // Add the sorted dirs - size_t i; - for (i = 0; i < dirs.Count(); i++) - { - eachFilename = dirs[i]; - path = dirName; - if (!wxEndsWithPathSeparator(path)) - path += wxString(wxFILE_SEP_PATH); - path += eachFilename; - - wxDirItemData *dir_item = new wxDirItemData(path,eachFilename,true); - wxTreeItemId id = AppendItem( parentId, eachFilename, - wxFileIconsTable::folder, -1, dir_item); - m_treeCtrl->SetItemImage( id, wxFileIconsTable::folder_open, - wxTreeItemIcon_Expanded ); - - // Has this got any children? If so, make it expandable. - // (There are two situations when a dir has children: either it - // has subdirectories or it contains files that weren't filtered - // out. The latter only applies to dirctrl with files.) - if ( dir_item->HasSubDirs() || - (((GetWindowStyle() & wxDIRCTRL_DIR_ONLY) == 0) && - dir_item->HasFiles(m_currentFilterStr)) ) - { - m_treeCtrl->SetItemHasChildren(id); - } - } - - // Add the sorted filenames - if ((GetWindowStyle() & wxDIRCTRL_DIR_ONLY) == 0) - { - for (i = 0; i < filenames.Count(); i++) - { - eachFilename = filenames[i]; - path = dirName; - if (!wxEndsWithPathSeparator(path)) - path += wxString(wxFILE_SEP_PATH); - path += eachFilename; - //path = dirName + wxString(wxT("/")) + eachFilename; - wxDirItemData *dir_item = new wxDirItemData(path,eachFilename,false); - int image_id = wxFileIconsTable::file; - if (eachFilename.Find(wxT('.')) != wxNOT_FOUND) - image_id = wxTheFileIconsTable->GetIconID(eachFilename.AfterLast(wxT('.'))); - (void) AppendItem( parentId, eachFilename, image_id, -1, dir_item); - } - } -} - -void wxGenericDirCtrl::ReCreateTree() -{ - CollapseDir(m_treeCtrl->GetRootItem()); - ExpandRoot(); -} - -void wxGenericDirCtrl::CollapseTree() -{ - wxTreeItemIdValue cookie; - wxTreeItemId child = m_treeCtrl->GetFirstChild(m_rootId, cookie); - while (child.IsOk()) - { - CollapseDir(child); - child = m_treeCtrl->GetNextChild(m_rootId, cookie); - } -} - -// Find the child that matches the first part of 'path'. -// E.g. if a child path is "/usr" and 'path' is "/usr/include" -// then the child for /usr is returned. -wxTreeItemId wxGenericDirCtrl::FindChild(wxTreeItemId parentId, const wxString& path, bool& done) -{ - wxString path2(path); - - // Make sure all separators are as per the current platform - path2.Replace(wxT("\\"), wxString(wxFILE_SEP_PATH)); - path2.Replace(wxT("/"), wxString(wxFILE_SEP_PATH)); - - // Append a separator to foil bogus substring matching - path2 += wxString(wxFILE_SEP_PATH); - - // In MSW or PM, case is not significant -#if defined(__WINDOWS__) || defined(__DOS__) || defined(__OS2__) - path2.MakeLower(); -#endif - - wxTreeItemIdValue cookie; - wxTreeItemId childId = m_treeCtrl->GetFirstChild(parentId, cookie); - while (childId.IsOk()) - { - wxDirItemData* data = (wxDirItemData*) m_treeCtrl->GetItemData(childId); - - if (data && !data->m_path.empty()) - { - wxString childPath(data->m_path); - if (!wxEndsWithPathSeparator(childPath)) - childPath += wxString(wxFILE_SEP_PATH); - - // In MSW and PM, case is not significant -#if defined(__WINDOWS__) || defined(__DOS__) || defined(__OS2__) - childPath.MakeLower(); -#endif - - if (childPath.length() <= path2.length()) - { - wxString path3 = path2.Mid(0, childPath.length()); - if (childPath == path3) - { - if (path3.length() == path2.length()) - done = true; - else - done = false; - return childId; - } - } - } - - childId = m_treeCtrl->GetNextChild(parentId, cookie); - } - wxTreeItemId invalid; - return invalid; -} - -// Try to expand as much of the given path as possible, -// and select the given tree item. -bool wxGenericDirCtrl::ExpandPath(const wxString& path) -{ - bool done = false; - wxTreeItemId id = FindChild(m_rootId, path, done); - wxTreeItemId lastId = id; // The last non-zero id - while (id.IsOk() && !done) - { - ExpandDir(id); - - id = FindChild(id, path, done); - if (id.IsOk()) - lastId = id; - } - if (!lastId.IsOk()) - return false; - - wxDirItemData *data = (wxDirItemData *) m_treeCtrl->GetItemData(lastId); - if (data->m_isDir) - { - m_treeCtrl->Expand(lastId); - } - if ((GetWindowStyle() & wxDIRCTRL_SELECT_FIRST) && data->m_isDir) - { - // Find the first file in this directory - wxTreeItemIdValue cookie; - wxTreeItemId childId = m_treeCtrl->GetFirstChild(lastId, cookie); - bool selectedChild = false; - while (childId.IsOk()) - { - data = (wxDirItemData*) m_treeCtrl->GetItemData(childId); - - if (data && data->m_path != wxEmptyString && !data->m_isDir) - { - m_treeCtrl->SelectItem(childId); - m_treeCtrl->EnsureVisible(childId); - selectedChild = true; - break; - } - childId = m_treeCtrl->GetNextChild(lastId, cookie); - } - if (!selectedChild) - { - m_treeCtrl->SelectItem(lastId); - m_treeCtrl->EnsureVisible(lastId); - } - } - else - { - m_treeCtrl->SelectItem(lastId); - m_treeCtrl->EnsureVisible(lastId); - } - - return true; -} - - -bool wxGenericDirCtrl::CollapsePath(const wxString& path) -{ - bool done = false; - wxTreeItemId id = FindChild(m_rootId, path, done); - wxTreeItemId lastId = id; // The last non-zero id - - while ( id.IsOk() && !done ) - { - CollapseDir(id); - - id = FindChild(id, path, done); - - if ( id.IsOk() ) - lastId = id; - } - - if ( !lastId.IsOk() ) - return false; - - m_treeCtrl->SelectItem(lastId); - m_treeCtrl->EnsureVisible(lastId); - - return true; -} - - -wxString wxGenericDirCtrl::GetPath() const -{ - wxTreeItemId id = m_treeCtrl->GetSelection(); - if (id) - { - wxDirItemData* data = (wxDirItemData*) m_treeCtrl->GetItemData(id); - return data->m_path; - } - else - return wxEmptyString; -} - -wxString wxGenericDirCtrl::GetFilePath() const -{ - wxTreeItemId id = m_treeCtrl->GetSelection(); - if (id) - { - wxDirItemData* data = (wxDirItemData*) m_treeCtrl->GetItemData(id); - if (data->m_isDir) - return wxEmptyString; - else - return data->m_path; - } - else - return wxEmptyString; -} - -void wxGenericDirCtrl::SetPath(const wxString& path) -{ - m_defaultPath = path; - if (m_rootId) - ExpandPath(path); -} - -// Not used -#if 0 -void wxGenericDirCtrl::FindChildFiles(wxTreeItemId id, int dirFlags, wxArrayString& filenames) -{ - wxDirItemData *data = (wxDirItemData *) m_treeCtrl->GetItemData(id); - - // This may take a longish time. Go to busy cursor - wxBusyCursor busy; - - wxASSERT(data); - - wxString search,path,filename; - - wxString dirName(data->m_path); - -#if defined(__WXMSW__) || defined(__OS2__) - if (dirName.Last() == ':') - dirName += wxString(wxFILE_SEP_PATH); -#endif - - wxDir d; - wxString eachFilename; - - wxLogNull log; - d.Open(dirName); - - if (d.IsOpened()) - { - if (d.GetFirst(& eachFilename, m_currentFilterStr, dirFlags)) - { - do - { - if ((eachFilename != wxT(".")) && (eachFilename != wxT(".."))) - { - filenames.Add(eachFilename); - } - } - while (d.GetNext(& eachFilename)) ; - } - } -} -#endif - -void wxGenericDirCtrl::SetFilterIndex(int n) -{ - m_currentFilter = n; - - wxString f, d; - if (ExtractWildcard(m_filter, n, f, d)) - m_currentFilterStr = f; - else -#ifdef __UNIX__ - m_currentFilterStr = wxT("*"); -#else - m_currentFilterStr = wxT("*.*"); -#endif -} - -void wxGenericDirCtrl::SetFilter(const wxString& filter) -{ - m_filter = filter; - - wxString f, d; - if (ExtractWildcard(m_filter, m_currentFilter, f, d)) - m_currentFilterStr = f; - else -#ifdef __UNIX__ - m_currentFilterStr = wxT("*"); -#else - m_currentFilterStr = wxT("*.*"); -#endif - - // current filter index is meaningless after filter change, set it to zero - SetFilterIndex(0); - if (m_filterListCtrl) - m_filterListCtrl->FillFilterList(m_filter, 0); -} - -// Extract description and actual filter from overall filter string -bool wxGenericDirCtrl::ExtractWildcard(const wxString& filterStr, int n, wxString& filter, wxString& description) -{ - wxArrayString filters, descriptions; - int count = wxParseCommonDialogsFilter(filterStr, descriptions, filters); - if (count > 0 && n < count) - { - filter = filters[n]; - description = descriptions[n]; - return true; - } - - return false; -} - -#if WXWIN_COMPATIBILITY_2_4 -// Parses the global filter, returning the number of filters. -// Returns 0 if none or if there's a problem. -// filterStr is in the form: "All files (*.*)|*.*|JPEG Files (*.jpeg)|*.jpg" -int wxGenericDirCtrl::ParseFilter(const wxString& filterStr, wxArrayString& filters, wxArrayString& descriptions) -{ - return wxParseCommonDialogsFilter(filterStr, descriptions, filters ); -} -#endif // WXWIN_COMPATIBILITY_2_4 - -void wxGenericDirCtrl::DoResize() -{ - wxSize sz = GetClientSize(); - int verticalSpacing = 3; - if (m_treeCtrl) - { - wxSize filterSz ; - if (m_filterListCtrl) - { - filterSz = m_filterListCtrl->GetSize(); - sz.y -= (filterSz.y + verticalSpacing); - } - m_treeCtrl->SetSize(0, 0, sz.x, sz.y); - if (m_filterListCtrl) - { - m_filterListCtrl->SetSize(0, sz.y + verticalSpacing, sz.x, filterSz.y); - // Don't know why, but this needs refreshing after a resize (wxMSW) - m_filterListCtrl->Refresh(); - } - } -} - - -void wxGenericDirCtrl::OnSize(wxSizeEvent& WXUNUSED(event)) -{ - DoResize(); -} - -wxTreeItemId wxGenericDirCtrl::AppendItem (const wxTreeItemId & parent, - const wxString & text, - int image, int selectedImage, - wxTreeItemData * data) -{ - wxTreeCtrl *treeCtrl = GetTreeCtrl (); - - wxASSERT (treeCtrl); - - if (treeCtrl) - { - return treeCtrl->AppendItem (parent, text, image, selectedImage, data); - } - else - { - return wxTreeItemId(); - } -} - - -//----------------------------------------------------------------------------- -// wxDirFilterListCtrl -//----------------------------------------------------------------------------- - -IMPLEMENT_CLASS(wxDirFilterListCtrl, wxChoice) - -BEGIN_EVENT_TABLE(wxDirFilterListCtrl, wxChoice) - EVT_CHOICE(wxID_ANY, wxDirFilterListCtrl::OnSelFilter) -END_EVENT_TABLE() - -bool wxDirFilterListCtrl::Create(wxGenericDirCtrl* parent, const wxWindowID id, - const wxPoint& pos, - const wxSize& size, - long style) -{ - m_dirCtrl = parent; - return wxChoice::Create(parent, id, pos, size, 0, NULL, style); -} - -void wxDirFilterListCtrl::Init() -{ - m_dirCtrl = NULL; -} - -void wxDirFilterListCtrl::OnSelFilter(wxCommandEvent& WXUNUSED(event)) -{ - int sel = GetSelection(); - - wxString currentPath = m_dirCtrl->GetPath(); - - m_dirCtrl->SetFilterIndex(sel); - - // If the filter has changed, the view is out of date, so - // collapse the tree. - m_dirCtrl->ReCreateTree(); - - // Try to restore the selection, or at least the directory - m_dirCtrl->ExpandPath(currentPath); -} - -void wxDirFilterListCtrl::FillFilterList(const wxString& filter, int defaultFilter) -{ - Clear(); - wxArrayString descriptions, filters; - size_t n = (size_t) wxParseCommonDialogsFilter(filter, descriptions, filters); - - if (n > 0 && defaultFilter < (int) n) - { - for (size_t i = 0; i < n; i++) - Append(descriptions[i]); - SetSelection(defaultFilter); - } -} -#endif // wxUSE_DIRDLG - -#if wxUSE_DIRDLG || wxUSE_FILEDLG - -// ---------------------------------------------------------------------------- -// wxFileIconsTable icons -// ---------------------------------------------------------------------------- - -#ifndef __WXGTK24__ -/* Computer (c) Julian Smart */ -static const char * file_icons_tbl_computer_xpm[] = { -/* columns rows colors chars-per-pixel */ -"16 16 42 1", -"r c #4E7FD0", -"$ c #7198D9", -"; c #DCE6F6", -"q c #FFFFFF", -"u c #4A7CCE", -"# c #779DDB", -"w c #95B2E3", -"y c #7FA2DD", -"f c #3263B4", -"= c #EAF0FA", -"< c #B1C7EB", -"% c #6992D7", -"9 c #D9E4F5", -"o c #9BB7E5", -"6 c #F7F9FD", -", c #BED0EE", -"3 c #F0F5FC", -"1 c #A8C0E8", -" c None", -"0 c #FDFEFF", -"4 c #C4D5F0", -"@ c #81A4DD", -"e c #4377CD", -"- c #E2EAF8", -"i c #9FB9E5", -"> c #CCDAF2", -"+ c #89A9DF", -"s c #5584D1", -"t c #5D89D3", -": c #D2DFF4", -"5 c #FAFCFE", -"2 c #F5F8FD", -"8 c #DFE8F7", -"& c #5E8AD4", -"X c #638ED5", -"a c #CEDCF2", -"p c #90AFE2", -"d c #2F5DA9", -"* c #5282D0", -"7 c #E5EDF9", -". c #A2BCE6", -"O c #8CACE0", -/* pixels */ -" ", -" .XXXXXXXXXXX ", -" oXO++@#$%&*X ", -" oX=-;:>,<1%X ", -" oX23=-;:4,$X ", -" oX5633789:@X ", -" oX05623=78+X ", -" oXqq05623=OX ", -" oX,,,,,<<<$X ", -" wXXXXXXXXXXe ", -" XrtX%$$y@+O,, ", -" uyiiiiiiiii@< ", -" ouiiiiiiiiiipAdd(wxArtProvider::GetBitmap(wxART_FOLDER, - wxART_CMN_DIALOG, - wxSize(16, 16))); - // folder_open - m_smallImageList->Add(wxArtProvider::GetBitmap(wxART_FOLDER_OPEN, - wxART_CMN_DIALOG, - wxSize(16, 16))); - // computer -#ifdef __WXGTK24__ - // GTK24 uses this icon in the file open dialog - m_smallImageList->Add(wxArtProvider::GetBitmap(wxART_HARDDISK, - wxART_CMN_DIALOG, - wxSize(16, 16))); -#else - m_smallImageList->Add(wxIcon(file_icons_tbl_computer_xpm)); -#endif - // drive - m_smallImageList->Add(wxArtProvider::GetBitmap(wxART_HARDDISK, - wxART_CMN_DIALOG, - wxSize(16, 16))); - // cdrom - m_smallImageList->Add(wxArtProvider::GetBitmap(wxART_CDROM, - wxART_CMN_DIALOG, - wxSize(16, 16))); - // floppy - m_smallImageList->Add(wxArtProvider::GetBitmap(wxART_FLOPPY, - wxART_CMN_DIALOG, - wxSize(16, 16))); - // removeable - m_smallImageList->Add(wxArtProvider::GetBitmap(wxART_REMOVABLE, - wxART_CMN_DIALOG, - wxSize(16, 16))); - // file - m_smallImageList->Add(wxArtProvider::GetBitmap(wxART_NORMAL_FILE, - wxART_CMN_DIALOG, - wxSize(16, 16))); - // executable - if (GetIconID(wxEmptyString, _T("application/x-executable")) == file) - { - m_smallImageList->Add(wxArtProvider::GetBitmap(wxART_EXECUTABLE_FILE, - wxART_CMN_DIALOG, - wxSize(16, 16))); - delete m_HashTable->Get(_T("exe")); - m_HashTable->Delete(_T("exe")); - m_HashTable->Put(_T("exe"), new wxFileIconEntry(executable)); - } - /* else put into list by GetIconID - (KDE defines application/x-executable for *.exe and has nice icon) - */ -} - -wxImageList *wxFileIconsTable::GetSmallImageList() -{ - if (!m_smallImageList) - Create(); - - return m_smallImageList; -} - -#if wxUSE_MIMETYPE && wxUSE_IMAGE && (!defined(__WXMSW__) || wxUSE_WXDIB) -// VS: we don't need this function w/o wxMimeTypesManager because we'll only have -// one icon and we won't resize it - -static wxBitmap CreateAntialiasedBitmap(const wxImage& img) -{ - const unsigned int size = 16; - - wxImage smallimg (size, size); - unsigned char *p1, *p2, *ps; - unsigned char mr = img.GetMaskRed(), - mg = img.GetMaskGreen(), - mb = img.GetMaskBlue(); - - unsigned x, y; - unsigned sr, sg, sb, smask; - - p1 = img.GetData(), p2 = img.GetData() + 3 * size*2, ps = smallimg.GetData(); - smallimg.SetMaskColour(mr, mr, mr); - - for (y = 0; y < size; y++) - { - for (x = 0; x < size; x++) - { - sr = sg = sb = smask = 0; - if (p1[0] != mr || p1[1] != mg || p1[2] != mb) - sr += p1[0], sg += p1[1], sb += p1[2]; - else smask++; - p1 += 3; - if (p1[0] != mr || p1[1] != mg || p1[2] != mb) - sr += p1[0], sg += p1[1], sb += p1[2]; - else smask++; - p1 += 3; - if (p2[0] != mr || p2[1] != mg || p2[2] != mb) - sr += p2[0], sg += p2[1], sb += p2[2]; - else smask++; - p2 += 3; - if (p2[0] != mr || p2[1] != mg || p2[2] != mb) - sr += p2[0], sg += p2[1], sb += p2[2]; - else smask++; - p2 += 3; - - if (smask > 2) - ps[0] = ps[1] = ps[2] = mr; - else - { - ps[0] = (unsigned char)(sr >> 2); - ps[1] = (unsigned char)(sg >> 2); - ps[2] = (unsigned char)(sb >> 2); - } - ps += 3; - } - p1 += size*2 * 3, p2 += size*2 * 3; - } - - return wxBitmap(smallimg); -} - -// This function is currently not unused anymore -#if 0 -// finds empty borders and return non-empty area of image: -static wxImage CutEmptyBorders(const wxImage& img) -{ - unsigned char mr = img.GetMaskRed(), - mg = img.GetMaskGreen(), - mb = img.GetMaskBlue(); - unsigned char *dt = img.GetData(), *dttmp; - unsigned w = img.GetWidth(), h = img.GetHeight(); - - unsigned top, bottom, left, right, i; - bool empt; - -#define MK_DTTMP(x,y) dttmp = dt + ((x + y * w) * 3) -#define NOEMPTY_PIX(empt) if (dttmp[0] != mr || dttmp[1] != mg || dttmp[2] != mb) {empt = false; break;} - - for (empt = true, top = 0; empt && top < h; top++) - { - MK_DTTMP(0, top); - for (i = 0; i < w; i++, dttmp+=3) - NOEMPTY_PIX(empt) - } - for (empt = true, bottom = h-1; empt && bottom > top; bottom--) - { - MK_DTTMP(0, bottom); - for (i = 0; i < w; i++, dttmp+=3) - NOEMPTY_PIX(empt) - } - for (empt = true, left = 0; empt && left < w; left++) - { - MK_DTTMP(left, 0); - for (i = 0; i < h; i++, dttmp+=3*w) - NOEMPTY_PIX(empt) - } - for (empt = true, right = w-1; empt && right > left; right--) - { - MK_DTTMP(right, 0); - for (i = 0; i < h; i++, dttmp+=3*w) - NOEMPTY_PIX(empt) - } - top--, left--, bottom++, right++; - - return img.GetSubImage(wxRect(left, top, right - left + 1, bottom - top + 1)); -} -#endif // #if 0 - -#endif // wxUSE_MIMETYPE - -int wxFileIconsTable::GetIconID(const wxString& extension, const wxString& mime) -{ - if (!m_smallImageList) - Create(); - -#if wxUSE_MIMETYPE - if (!extension.empty()) - { - wxFileIconEntry *entry = (wxFileIconEntry*) m_HashTable->Get(extension); - if (entry) return (entry -> id); - } - - wxFileType *ft = (mime.empty()) ? - wxTheMimeTypesManager -> GetFileTypeFromExtension(extension) : - wxTheMimeTypesManager -> GetFileTypeFromMimeType(mime); - - wxIconLocation iconLoc; - wxIcon ic; - - { - wxLogNull logNull; - if ( ft && ft->GetIcon(&iconLoc) ) - { - ic = wxIcon( iconLoc ); - } - } - - delete ft; - - if ( !ic.Ok() ) - { - int newid = file; - m_HashTable->Put(extension, new wxFileIconEntry(newid)); - return newid; - } - - wxBitmap bmp; - bmp.CopyFromIcon(ic); - - if ( !bmp.Ok() ) - { - int newid = file; - m_HashTable->Put(extension, new wxFileIconEntry(newid)); - return newid; - } - - const unsigned int size = 16; - - int id = m_smallImageList->GetImageCount(); - if ((bmp.GetWidth() == (int) size) && (bmp.GetHeight() == (int) size)) - { - m_smallImageList->Add(bmp); - } -#if wxUSE_IMAGE && (!defined(__WXMSW__) || wxUSE_WXDIB) - else - { - wxImage img = bmp.ConvertToImage(); - - if ((img.GetWidth() != size*2) || (img.GetHeight() != size*2)) -// m_smallImageList->Add(CreateAntialiasedBitmap(CutEmptyBorders(img).Rescale(size*2, size*2))); - m_smallImageList->Add(CreateAntialiasedBitmap(img.Rescale(size*2, size*2))); - else - m_smallImageList->Add(CreateAntialiasedBitmap(img)); - } -#endif // wxUSE_IMAGE - - m_HashTable->Put(extension, new wxFileIconEntry(id)); - return id; - -#else // !wxUSE_MIMETYPE - - wxUnusedVar(mime); - if (extension == wxT("exe")) - return executable; - else - return file; -#endif // wxUSE_MIMETYPE/!wxUSE_MIMETYPE -} - -#endif // wxUSE_DIRDLG || wxUSE_FILEDLG diff --git a/wxWidgets/src/generic/dirdlgg.cpp b/wxWidgets/src/generic/dirdlgg.cpp deleted file mode 100644 index 49fb67f9ca..0000000000 --- a/wxWidgets/src/generic/dirdlgg.cpp +++ /dev/null @@ -1,369 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/generic/dirdlg.cpp -// Purpose: wxDirDialog -// Author: Harm van der Heijden, Robert Roebling & Julian Smart -// Modified by: -// Created: 12/12/98 -// RCS-ID: $Id: dirdlgg.cpp 41838 2006-10-09 21:08:45Z VZ $ -// Copyright: (c) Harm van der Heijden, Robert Roebling, Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_DIRDLG - -#ifndef WX_PRECOMP - #include "wx/textctrl.h" - #include "wx/button.h" - #include "wx/checkbox.h" - #include "wx/sizer.h" - #include "wx/intl.h" - #include "wx/log.h" - #include "wx/msgdlg.h" - #include "wx/bmpbuttn.h" -#endif - -#include "wx/statline.h" -#include "wx/dirctrl.h" -#include "wx/generic/dirdlgg.h" -#include "wx/artprov.h" - -// ---------------------------------------------------------------------------- -// constants -// ---------------------------------------------------------------------------- - -static const int ID_DIRCTRL = 1000; -static const int ID_TEXTCTRL = 1001; -static const int ID_NEW = 1004; -static const int ID_SHOW_HIDDEN = 1005; -static const int ID_GO_HOME = 1006; - -//----------------------------------------------------------------------------- -// wxGenericDirDialog -//----------------------------------------------------------------------------- - -IMPLEMENT_DYNAMIC_CLASS(wxGenericDirDialog, wxDialog) - -BEGIN_EVENT_TABLE(wxGenericDirDialog, wxDialog) - EVT_CLOSE (wxGenericDirDialog::OnCloseWindow) - EVT_BUTTON (wxID_OK, wxGenericDirDialog::OnOK) - EVT_BUTTON (ID_NEW, wxGenericDirDialog::OnNew) - EVT_BUTTON (ID_GO_HOME, wxGenericDirDialog::OnGoHome) - EVT_TREE_KEY_DOWN (wxID_ANY, wxGenericDirDialog::OnTreeKeyDown) - EVT_TREE_SEL_CHANGED (wxID_ANY, wxGenericDirDialog::OnTreeSelected) - EVT_TEXT_ENTER (ID_TEXTCTRL, wxGenericDirDialog::OnOK) - EVT_CHECKBOX (ID_SHOW_HIDDEN, wxGenericDirDialog::OnShowHidden) -END_EVENT_TABLE() - -wxGenericDirDialog::wxGenericDirDialog(wxWindow* parent, const wxString& title, - const wxString& defaultPath, long style, - const wxPoint& pos, const wxSize& sz, - const wxString& name) -{ - Create(parent, title, defaultPath, style, pos, sz, name); -} - -bool wxGenericDirDialog::Create(wxWindow* parent, - const wxString& title, - const wxString& defaultPath, long style, - const wxPoint& pos, - const wxSize& sz, - const wxString& name) -{ - wxBusyCursor cursor; - - if (!wxDirDialogBase::Create(parent, title, defaultPath, style, pos, sz, name)) - return false; - - m_path = defaultPath; - if (m_path == wxT("~")) - wxGetHomeDir(&m_path); - if (m_path == wxT(".")) - m_path = wxGetCwd(); - - wxBoxSizer *topsizer = new wxBoxSizer( wxVERTICAL ); - - // smartphones does not support or do not waste space for wxButtons -#if defined(__SMARTPHONE__) - - wxMenu *dirMenu = new wxMenu; - dirMenu->Append(ID_GO_HOME, _("Home")); - - if (!HasFlag(wxDD_DIR_MUST_EXIST)) - { - dirMenu->Append(ID_NEW, _("New directory")); - } - - dirMenu->AppendCheckItem(ID_SHOW_HIDDEN, _("Show hidden directories")); - dirMenu->AppendSeparator(); - dirMenu->Append(wxID_CANCEL, _("Cancel")); - -#else - - // 0) 'New' and 'Home' Buttons - wxSizer* buttonsizer = new wxBoxSizer( wxHORIZONTAL ); - - // VS: 'Home directory' concept is unknown to MS-DOS -#if !defined(__DOS__) - wxBitmapButton* homeButton = - new wxBitmapButton(this, ID_GO_HOME, - wxArtProvider::GetBitmap(wxART_GO_HOME, wxART_BUTTON)); - buttonsizer->Add( homeButton, 0, wxLEFT|wxRIGHT, 10 ); -#endif - - // I'm not convinced we need a New button, and we tend to get annoying - // accidental-editing with label editing enabled. - if (!HasFlag(wxDD_DIR_MUST_EXIST)) - { - wxBitmapButton* newButton = - new wxBitmapButton(this, ID_NEW, - wxArtProvider::GetBitmap(wxART_NEW_DIR, wxART_BUTTON)); - buttonsizer->Add( newButton, 0, wxRIGHT, 10 ); -#if wxUSE_TOOLTIPS - newButton->SetToolTip(_("Create new directory")); -#endif - } - -#if wxUSE_TOOLTIPS - homeButton->SetToolTip(_("Go to home directory")); -#endif - - topsizer->Add( buttonsizer, 0, wxTOP | wxALIGN_RIGHT, 10 ); - -#endif // __SMARTPHONE__/!__SMARTPHONE__ - - // 1) dir ctrl - m_dirCtrl = NULL; // this is necessary, event handler called from - // wxGenericDirCtrl would crash otherwise! - long dirStyle = wxDIRCTRL_DIR_ONLY | wxDEFAULT_CONTROL_BORDER; - -#ifdef __WXMSW__ - if (!HasFlag(wxDD_DIR_MUST_EXIST)) - { - // Only under Windows do we need the wxTR_EDIT_LABEL tree control style - // before we can call EditLabel (required for "New directory") - dirStyle |= wxDIRCTRL_EDIT_LABELS; - } -#endif - - m_dirCtrl = new wxGenericDirCtrl(this, ID_DIRCTRL, - m_path, wxDefaultPosition, - wxSize(300, 200), - dirStyle); - - wxSizerFlags flagsBorder2; - flagsBorder2.DoubleBorder(wxTOP | wxLEFT | wxRIGHT); - - topsizer->Add(m_dirCtrl, wxSizerFlags(flagsBorder2).Proportion(1).Expand()); - -#ifndef __SMARTPHONE__ - // Make the an option depending on a flag? - wxCheckBox * - check = new wxCheckBox(this, ID_SHOW_HIDDEN, _("Show &hidden directories")); - topsizer->Add(check, wxSizerFlags(flagsBorder2).Right()); -#endif // !__SMARTPHONE__ - - // 2) text ctrl - m_input = new wxTextCtrl( this, ID_TEXTCTRL, m_path, wxDefaultPosition ); - topsizer->Add(m_input, wxSizerFlags(flagsBorder2).Expand()); - - // 3) buttons if any - wxSizer *buttonSizer = CreateSeparatedButtonSizer(wxOK | wxCANCEL); - if ( buttonSizer ) - { - topsizer->Add(buttonSizer, wxSizerFlags().Expand().DoubleBorder()); - } - -#ifdef __SMARTPHONE__ - // overwrite menu set by CreateSeparatedButtonSizer() call above - SetRightMenu(wxID_ANY, _("Options"), dirMenu); -#endif - - m_input->SetFocus(); - - SetAutoLayout( true ); - SetSizer( topsizer ); - - topsizer->SetSizeHints( this ); - topsizer->Fit( this ); - - Centre( wxBOTH ); - - return true; -} - -void wxGenericDirDialog::EndModal(int retCode) -{ - // before proceeding, change the current working directory if user asked so - if (retCode == wxID_OK && HasFlag(wxDD_CHANGE_DIR)) - wxSetWorkingDirectory(m_path); - - wxDialog::EndModal(retCode); -} - -void wxGenericDirDialog::OnCloseWindow(wxCloseEvent& WXUNUSED(event)) -{ - EndModal(wxID_CANCEL); -} - -void wxGenericDirDialog::OnOK(wxCommandEvent& WXUNUSED(event)) -{ - m_path = m_input->GetValue(); - - // Does the path exist? (User may have typed anything in m_input) - if (wxDirExists(m_path)) - { - // OK, path exists, we're done. - EndModal(wxID_OK); - return; - } - - // Interact with user, find out if the dir is a typo or to be created - wxString msg; - msg.Printf(_("The directory '%s' does not exist\nCreate it now?"), - m_path.c_str()); - wxMessageDialog dialog(this, msg, _("Directory does not exist"), - wxYES_NO | wxICON_WARNING); - - if ( dialog.ShowModal() == wxID_YES ) - { - // Okay, let's make it - wxLogNull log; - if (wxMkdir(m_path)) - { - // The new dir was created okay. - EndModal(wxID_OK); - return; - } - else - { - // Trouble... - msg.Printf(_("Failed to create directory '%s'\n(Do you have the required permissions?)"), - m_path.c_str()); - wxMessageDialog errmsg(this, msg, _("Error creating directory"), wxOK | wxICON_ERROR); - errmsg.ShowModal(); - // We still don't have a valid dir. Back to the main dialog. - } - } - // User has answered NO to create dir. -} - -void wxGenericDirDialog::SetPath(const wxString& path) -{ - m_dirCtrl->SetPath(path); - m_path = path; -} - -wxString wxGenericDirDialog::GetPath(void) const -{ - return m_path; -} - -int wxGenericDirDialog::ShowModal() -{ - m_input->SetValue( m_path ); - return wxDialog::ShowModal(); -} - -void wxGenericDirDialog::OnTreeSelected( wxTreeEvent &event ) -{ - if (!m_dirCtrl) - return; - - wxTreeItemId item = event.GetItem(); - - wxDirItemData *data = NULL; - - if(item.IsOk()) - data = (wxDirItemData*)m_dirCtrl->GetTreeCtrl()->GetItemData(item); - - if (data) - m_input->SetValue( data->m_path ); -} - -void wxGenericDirDialog::OnTreeKeyDown( wxTreeEvent &WXUNUSED(event) ) -{ - if (!m_dirCtrl) - return; - - wxDirItemData *data = (wxDirItemData*)m_dirCtrl->GetTreeCtrl()->GetItemData(m_dirCtrl->GetTreeCtrl()->GetSelection()); - if (data) - m_input->SetValue( data->m_path ); -} - -void wxGenericDirDialog::OnShowHidden( wxCommandEvent& event ) -{ - if (!m_dirCtrl) - return; - - m_dirCtrl->ShowHidden( event.GetInt() != 0 ); -} - -void wxGenericDirDialog::OnNew( wxCommandEvent& WXUNUSED(event) ) -{ - wxTreeItemId id = m_dirCtrl->GetTreeCtrl()->GetSelection(); - if ((id == m_dirCtrl->GetTreeCtrl()->GetRootItem()) || - (m_dirCtrl->GetTreeCtrl()->GetItemParent(id) == m_dirCtrl->GetTreeCtrl()->GetRootItem())) - { - wxMessageDialog msg(this, _("You cannot add a new directory to this section."), - _("Create directory"), wxOK | wxICON_INFORMATION ); - msg.ShowModal(); - return; - } - - wxTreeItemId parent = id ; // m_dirCtrl->GetTreeCtrl()->GetItemParent( id ); - wxDirItemData *data = (wxDirItemData*)m_dirCtrl->GetTreeCtrl()->GetItemData( parent ); - wxASSERT( data ); - - wxString new_name( _("NewName") ); - wxString path( data->m_path ); - if (!wxEndsWithPathSeparator(path)) - path += wxFILE_SEP_PATH; - path += new_name; - if (wxDirExists(path)) - { - // try NewName0, NewName1 etc. - int i = 0; - do { - new_name = _("NewName"); - wxString num; - num.Printf( wxT("%d"), i ); - new_name += num; - - path = data->m_path; - if (!wxEndsWithPathSeparator(path)) - path += wxFILE_SEP_PATH; - path += new_name; - i++; - } while (wxDirExists(path)); - } - - wxLogNull log; - if (!wxMkdir(path)) - { - wxMessageDialog dialog(this, _("Operation not permitted."), _("Error"), wxOK | wxICON_ERROR ); - dialog.ShowModal(); - return; - } - - wxDirItemData *new_data = new wxDirItemData( path, new_name, true ); - - // TODO: THIS CODE DOESN'T WORK YET. We need to avoid duplication of the first child - // of the parent. - wxTreeItemId new_id = m_dirCtrl->GetTreeCtrl()->AppendItem( parent, new_name, 0, 0, new_data ); - m_dirCtrl->GetTreeCtrl()->EnsureVisible( new_id ); - m_dirCtrl->GetTreeCtrl()->EditLabel( new_id ); -} - -void wxGenericDirDialog::OnGoHome(wxCommandEvent& WXUNUSED(event)) -{ - SetPath(wxGetUserHome()); -} - -#endif // wxUSE_DIRDLG diff --git a/wxWidgets/src/generic/dragimgg.cpp b/wxWidgets/src/generic/dragimgg.cpp deleted file mode 100644 index b915c1bd2f..0000000000 --- a/wxWidgets/src/generic/dragimgg.cpp +++ /dev/null @@ -1,574 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/generic/dragimgg.cpp -// Purpose: Generic wxDragImage implementation -// Author: Julian Smart -// Modified by: -// Created: 29/2/2000 -// RCS-ID: $Id: dragimgg.cpp 42397 2006-10-25 12:12:56Z VS $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_DRAGIMAGE - -#ifndef WX_PRECOMP - #include - #include "wx/window.h" - #include "wx/frame.h" - #include "wx/dcclient.h" - #include "wx/dcscreen.h" - #include "wx/dcmemory.h" - #include "wx/settings.h" - #include "wx/intl.h" - #include "wx/log.h" - #include "wx/image.h" -#endif - -#define wxUSE_IMAGE_IN_DRAGIMAGE 1 - -#include "wx/generic/dragimgg.h" - -// ---------------------------------------------------------------------------- -// macros -// ---------------------------------------------------------------------------- - -IMPLEMENT_DYNAMIC_CLASS(wxGenericDragImage, wxObject) - -// ============================================================================ -// implementation -// ============================================================================ - -// ---------------------------------------------------------------------------- -// wxGenericDragImage ctors/dtor -// ---------------------------------------------------------------------------- - -wxGenericDragImage::~wxGenericDragImage() -{ - if (m_windowDC) - { - delete m_windowDC; - } -} - -void wxGenericDragImage::Init() -{ - m_isDirty = false; - m_isShown = false; - m_windowDC = (wxDC*) NULL; - m_window = (wxWindow*) NULL; - m_fullScreen = false; -#ifdef wxHAS_NATIVE_OVERLAY - m_dcOverlay = NULL; -#else - m_pBackingBitmap = (wxBitmap*) NULL; -#endif -} - -#if WXWIN_COMPATIBILITY_2_6 -wxGenericDragImage::wxGenericDragImage(const wxCursor& cursor, const wxPoint& WXUNUSED(cursorHotspot)) -{ - Init(); - Create(cursor); -} - -wxGenericDragImage::wxGenericDragImage(const wxBitmap& image, const wxCursor& cursor, const wxPoint& WXUNUSED(cursorHotspot)) -{ - Init(); - - Create(image, cursor); -} - -wxGenericDragImage::wxGenericDragImage(const wxIcon& image, const wxCursor& cursor, const wxPoint& WXUNUSED(cursorHotspot)) -{ - Init(); - - Create(image, cursor); -} - -wxGenericDragImage::wxGenericDragImage(const wxString& str, const wxCursor& cursor, const wxPoint& WXUNUSED(cursorHotspot)) -{ - Init(); - - Create(str, cursor); -} - -bool wxGenericDragImage::Create(const wxCursor& cursor, const wxPoint& WXUNUSED(cursorHotspot)) -{ - return Create(cursor); -} - -bool wxGenericDragImage::Create(const wxBitmap& image, const wxCursor& cursor, const wxPoint& WXUNUSED(cursorHotspot)) -{ - return Create(image, cursor); -} - -bool wxGenericDragImage::Create(const wxIcon& image, const wxCursor& cursor, const wxPoint& WXUNUSED(cursorHotspot)) -{ - return Create(image, cursor); -} - -bool wxGenericDragImage::Create(const wxString& str, const wxCursor& cursor, const wxPoint& WXUNUSED(cursorHotspot)) -{ - return Create(str, cursor); -} -#endif // WXWIN_COMPATIBILITY_2_6 - -// Attributes -//////////////////////////////////////////////////////////////////////////// - - -// Operations -//////////////////////////////////////////////////////////////////////////// - -// Create a drag image with a virtual image (need to override DoDrawImage, GetImageRect) -bool wxGenericDragImage::Create(const wxCursor& cursor) -{ - m_cursor = cursor; - - return true; -} - -// Create a drag image from a bitmap and optional cursor -bool wxGenericDragImage::Create(const wxBitmap& image, const wxCursor& cursor) -{ - // We don't have to combine the cursor explicitly since we simply show the cursor - // as we drag. This currently will only work within one window. - - m_cursor = cursor; - m_bitmap = image; - - return true ; -} - -// Create a drag image from an icon and optional cursor -bool wxGenericDragImage::Create(const wxIcon& image, const wxCursor& cursor) -{ - // We don't have to combine the cursor explicitly since we simply show the cursor - // as we drag. This currently will only work within one window. - - m_cursor = cursor; - m_icon = image; - - return true ; -} - -// Create a drag image from a string and optional cursor -bool wxGenericDragImage::Create(const wxString& str, const wxCursor& cursor) -{ - wxFont font(wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT)); - - long w = 0, h = 0; - wxScreenDC dc; - dc.SetFont(font); - dc.GetTextExtent(str, & w, & h); - dc.SetFont(wxNullFont); - - wxMemoryDC dc2; - - // Sometimes GetTextExtent isn't accurate enough, so make it longer - wxBitmap bitmap((int) ((w+2) * 1.5), (int) h+2); - dc2.SelectObject(bitmap); - - dc2.SetFont(font); - dc2.SetBackground(* wxWHITE_BRUSH); - dc2.Clear(); - dc2.SetBackgroundMode(wxTRANSPARENT); - dc2.SetTextForeground(* wxLIGHT_GREY); - dc2.DrawText(str, 0, 0); - dc2.DrawText(str, 1, 0); - dc2.DrawText(str, 2, 0); - dc2.DrawText(str, 1, 1); - dc2.DrawText(str, 2, 1); - dc2.DrawText(str, 1, 2); - dc2.DrawText(str, 2, 2); - - dc2.SetTextForeground(* wxBLACK); - dc2.DrawText(str, 1, 1); - - dc2.SelectObject(wxNullBitmap); - -#if wxUSE_IMAGE_IN_DRAGIMAGE && (!defined(__WXMSW__) || wxUSE_WXDIB) - // Make the bitmap masked - wxImage image = bitmap.ConvertToImage(); - image.SetMaskColour(255, 255, 255); - bitmap = wxBitmap(image); -#endif - - return Create(bitmap, cursor); -} - -#if wxUSE_TREECTRL -// Create a drag image for the given tree control item -bool wxGenericDragImage::Create(const wxTreeCtrl& treeCtrl, wxTreeItemId& id) -{ - wxString str = treeCtrl.GetItemText(id); - return Create(str); -} -#endif - -#if wxUSE_LISTCTRL -// Create a drag image for the given list control item -bool wxGenericDragImage::Create(const wxListCtrl& listCtrl, long id) -{ - wxString str = listCtrl.GetItemText(id); - return Create(str); -} -#endif - -// Begin drag -bool wxGenericDragImage::BeginDrag(const wxPoint& hotspot, - wxWindow* window, - bool fullScreen, - wxRect* rect) -{ - wxASSERT_MSG( (window != 0), wxT("Window must not be null in BeginDrag.")); - - // The image should be offset by this amount - m_offset = hotspot; - m_window = window; - m_fullScreen = fullScreen; - - if (rect) - m_boundingRect = * rect; - - m_isDirty = false; - m_isDirty = false; - - if (window) - { - window->CaptureMouse(); - - if (m_cursor.Ok()) - { - m_oldCursor = window->GetCursor(); - window->SetCursor(m_cursor); - } - } - - // Make a copy of the window so we can repair damage done as the image is - // dragged. - - wxSize clientSize; - wxPoint pt; - if (!m_fullScreen) - { - clientSize = window->GetClientSize(); - m_boundingRect.x = 0; m_boundingRect.y = 0; - m_boundingRect.width = clientSize.x; m_boundingRect.height = clientSize.y; - } - else - { - int w, h; - wxDisplaySize(& w, & h); - clientSize.x = w; clientSize.y = h; - if (rect) - { - pt.x = m_boundingRect.x; pt.y = m_boundingRect.y; - clientSize.x = m_boundingRect.width; clientSize.y = m_boundingRect.height; - } - else - { - m_boundingRect.x = 0; m_boundingRect.y = 0; - m_boundingRect.width = w; m_boundingRect.height = h; - } - } - -#ifndef wxHAS_NATIVE_OVERLAY - wxBitmap* backing = (m_pBackingBitmap ? m_pBackingBitmap : (wxBitmap*) & m_backingBitmap); - - if (!backing->Ok() || (backing->GetWidth() < clientSize.x || backing->GetHeight() < clientSize.y)) - (*backing) = wxBitmap(clientSize.x, clientSize.y); -#endif // !wxHAS_NATIVE_OVERLAY - - if (!m_fullScreen) - { - m_windowDC = new wxClientDC(window); - } - else - { - m_windowDC = new wxScreenDC; - -#if 0 - // Use m_boundingRect to limit the area considered. - ((wxScreenDC*) m_windowDC)->StartDrawingOnTop(rect); -#endif - - m_windowDC->SetClippingRegion(m_boundingRect.x, m_boundingRect.y, - m_boundingRect.width, m_boundingRect.height); - } - - return true; -} - -// Begin drag. hotspot is the location of the drag position relative to the upper-left -// corner of the image. This is full screen only. fullScreenRect gives the -// position of the window on the screen, to restrict the drag to. -bool wxGenericDragImage::BeginDrag(const wxPoint& hotspot, wxWindow* window, wxWindow* fullScreenRect) -{ - wxRect rect; - - int x = fullScreenRect->GetPosition().x; - int y = fullScreenRect->GetPosition().y; - - wxSize sz = fullScreenRect->GetSize(); - - if (fullScreenRect->GetParent() && !fullScreenRect->IsKindOf(CLASSINFO(wxFrame))) - fullScreenRect->GetParent()->ClientToScreen(& x, & y); - - rect.x = x; rect.y = y; - rect.width = sz.x; rect.height = sz.y; - - return BeginDrag(hotspot, window, true, & rect); -} - -// End drag -bool wxGenericDragImage::EndDrag() -{ - if (m_window) - { -#ifdef __WXMSW__ - // Under Windows we can be pretty sure this test will give - // the correct results - if (wxWindow::GetCapture() == m_window) -#endif - m_window->ReleaseMouse(); - - if (m_cursor.Ok() && m_oldCursor.Ok()) - { - m_window->SetCursor(m_oldCursor); - } - } - - if (m_windowDC) - { -#ifdef wxHAS_NATIVE_OVERLAY - m_overlay.Reset(); -#else - m_windowDC->DestroyClippingRegion(); -#endif - delete m_windowDC; - m_windowDC = (wxDC*) NULL; - } - -#ifndef wxHAS_NATIVE_OVERLAY - m_repairBitmap = wxNullBitmap; -#endif - - return true; -} - -// Move the image: call from OnMouseMove. Pt is in window client coordinates if window -// is non-NULL, or in screen coordinates if NULL. -bool wxGenericDragImage::Move(const wxPoint& pt) -{ - wxASSERT_MSG( (m_windowDC != (wxDC*) NULL), wxT("No window DC in wxGenericDragImage::Move()") ); - - wxPoint pt2(pt); - if (m_fullScreen) - pt2 = m_window->ClientToScreen(pt); - - // Erase at old position, then show at the current position - wxPoint oldPos = m_position; - - bool eraseOldImage = (m_isDirty && m_isShown); - - if (m_isShown) - RedrawImage(oldPos - m_offset, pt2 - m_offset, eraseOldImage, true); - - m_position = pt2; - - if (m_isShown) - m_isDirty = true; - - return true; -} - -bool wxGenericDragImage::Show() -{ - wxASSERT_MSG( (m_windowDC != (wxDC*) NULL), wxT("No window DC in wxGenericDragImage::Show()") ); - - // Show at the current position - - if (!m_isShown) - { - // This is where we restore the backing bitmap, in case - // something has changed on the window. - -#ifndef wxHAS_NATIVE_OVERLAY - wxBitmap* backing = (m_pBackingBitmap ? m_pBackingBitmap : (wxBitmap*) & m_backingBitmap); - wxMemoryDC memDC; - memDC.SelectObject(* backing); - - UpdateBackingFromWindow(* m_windowDC, memDC, m_boundingRect, wxRect(0, 0, m_boundingRect.width, m_boundingRect.height)); - - //memDC.Blit(0, 0, m_boundingRect.width, m_boundingRect.height, m_windowDC, m_boundingRect.x, m_boundingRect.y); - memDC.SelectObject(wxNullBitmap); -#endif // !wxHAS_NATIVE_OVERLAY - - RedrawImage(m_position - m_offset, m_position - m_offset, false, true); - } - - m_isShown = true; - m_isDirty = true; - - return true; -} - -bool wxGenericDragImage::UpdateBackingFromWindow(wxDC& windowDC, wxMemoryDC& destDC, - const wxRect& sourceRect, const wxRect& destRect) const -{ - return destDC.Blit(destRect.x, destRect.y, destRect.width, destRect.height, & windowDC, - sourceRect.x, sourceRect.y); -} - -bool wxGenericDragImage::Hide() -{ - wxASSERT_MSG( (m_windowDC != (wxDC*) NULL), wxT("No window DC in wxGenericDragImage::Hide()") ); - - // Repair the old position - - if (m_isShown && m_isDirty) - { - RedrawImage(m_position - m_offset, m_position - m_offset, true, false); - } - - m_isShown = false; - m_isDirty = false; - - return true; -} - -// More efficient: erase and redraw simultaneously if possible -bool wxGenericDragImage::RedrawImage(const wxPoint& oldPos, const wxPoint& newPos, - bool eraseOld, bool drawNew) -{ - if (!m_windowDC) - return false; - -#ifdef wxHAS_NATIVE_OVERLAY - wxDCOverlay dcoverlay( m_overlay, (wxWindowDC*) m_windowDC ) ; - if ( eraseOld ) - dcoverlay.Clear() ; - if (drawNew) - DoDrawImage(*m_windowDC, newPos); -#else // !wxHAS_NATIVE_OVERLAY - wxBitmap* backing = (m_pBackingBitmap ? m_pBackingBitmap : (wxBitmap*) & m_backingBitmap); - if (!backing->Ok()) - return false; - - wxRect oldRect(GetImageRect(oldPos)); - wxRect newRect(GetImageRect(newPos)); - - wxRect fullRect; - - // Full rect: the combination of both rects - if (eraseOld && drawNew) - { - int oldRight = oldRect.GetRight(); - int oldBottom = oldRect.GetBottom(); - int newRight = newRect.GetRight(); - int newBottom = newRect.GetBottom(); - - wxPoint topLeft = wxPoint(wxMin(oldPos.x, newPos.x), wxMin(oldPos.y, newPos.y)); - wxPoint bottomRight = wxPoint(wxMax(oldRight, newRight), wxMax(oldBottom, newBottom)); - - fullRect.x = topLeft.x; fullRect.y = topLeft.y; - fullRect.SetRight(bottomRight.x); - fullRect.SetBottom(bottomRight.y); - } - else if (eraseOld) - fullRect = oldRect; - else if (drawNew) - fullRect = newRect; - - // Make the bitmap bigger than it need be, so we don't - // keep reallocating all the time. - int excess = 50; - - if (!m_repairBitmap.Ok() || (m_repairBitmap.GetWidth() < fullRect.GetWidth() || m_repairBitmap.GetHeight() < fullRect.GetHeight())) - { - m_repairBitmap = wxBitmap(fullRect.GetWidth() + excess, fullRect.GetHeight() + excess); - } - - wxMemoryDC memDC; - memDC.SelectObject(* backing); - - wxMemoryDC memDCTemp; - memDCTemp.SelectObject(m_repairBitmap); - - // Draw the backing bitmap onto the repair bitmap. - // If full-screen, we may have specified the rect on the - // screen that we're using for our backing bitmap. - // So subtract this when we're blitting from the backing bitmap - // (translate from screen to backing-bitmap coords). - - memDCTemp.Blit(0, 0, fullRect.GetWidth(), fullRect.GetHeight(), & memDC, fullRect.x - m_boundingRect.x, fullRect.y - m_boundingRect.y); - - // If drawing, draw the image onto the mem DC - if (drawNew) - { - wxPoint pos(newPos.x - fullRect.x, newPos.y - fullRect.y) ; - DoDrawImage(memDCTemp, pos); - } - - // Now blit to the window - // Finally, blit the temp mem DC to the window. - m_windowDC->Blit(fullRect.x, fullRect.y, fullRect.width, fullRect.height, & memDCTemp, 0, 0); - - memDCTemp.SelectObject(wxNullBitmap); - memDC.SelectObject(wxNullBitmap); -#endif // wxHAS_NATIVE_OVERLAY/!wxHAS_NATIVE_OVERLAY - - return true; -} - -// Override this if you are using a virtual image (drawing your own image) -bool wxGenericDragImage::DoDrawImage(wxDC& dc, const wxPoint& pos) const -{ - if (m_bitmap.Ok()) - { - dc.DrawBitmap(m_bitmap, pos.x, pos.y, (m_bitmap.GetMask() != 0)); - return true; - } - else if (m_icon.Ok()) - { - dc.DrawIcon(m_icon, pos.x, pos.y); - return true; - } - else - return false; -} - -// Override this if you are using a virtual image (drawing your own image) -wxRect wxGenericDragImage::GetImageRect(const wxPoint& pos) const -{ - if (m_bitmap.Ok()) - { - return wxRect(pos.x, pos.y, m_bitmap.GetWidth(), m_bitmap.GetHeight()); - } - else if (m_icon.Ok()) - { - return wxRect(pos.x, pos.y, m_icon.GetWidth(), m_icon.GetHeight()); - } - else - { - return wxRect(pos.x, pos.y, 0, 0); - } -} - -#endif // wxUSE_DRAGIMAGE diff --git a/wxWidgets/src/generic/fdrepdlg.cpp b/wxWidgets/src/generic/fdrepdlg.cpp deleted file mode 100644 index 797ac68cbb..0000000000 --- a/wxWidgets/src/generic/fdrepdlg.cpp +++ /dev/null @@ -1,291 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/generic/fdrepgg.cpp -// Purpose: Find/Replace dialogs -// Author: Markus Greither and Vadim Zeitlin -// Modified by: -// Created: 05/25/01 -// RCS-ID: -// Copyright: (c) wxWidgets team -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_FINDREPLDLG - -#ifndef WX_PRECOMP - #include "wx/intl.h" - #include "wx/log.h" - - #include "wx/sizer.h" - - #include "wx/button.h" - #include "wx/checkbox.h" - #include "wx/radiobox.h" - #include "wx/stattext.h" - #include "wx/textctrl.h" - #include "wx/settings.h" -#endif - -#include "wx/fdrepdlg.h" - -// ---------------------------------------------------------------------------- -// constants -// ---------------------------------------------------------------------------- - -// ============================================================================ -// implementation -// ============================================================================ - -IMPLEMENT_DYNAMIC_CLASS(wxGenericFindReplaceDialog, wxDialog) - -BEGIN_EVENT_TABLE(wxGenericFindReplaceDialog, wxDialog) - EVT_BUTTON(wxID_FIND, wxGenericFindReplaceDialog::OnFind) - EVT_BUTTON(wxID_REPLACE, wxGenericFindReplaceDialog::OnReplace) - EVT_BUTTON(wxID_REPLACE_ALL, wxGenericFindReplaceDialog::OnReplaceAll) - EVT_BUTTON(wxID_CANCEL, wxGenericFindReplaceDialog::OnCancel) - - EVT_UPDATE_UI(wxID_FIND, wxGenericFindReplaceDialog::OnUpdateFindUI) - EVT_UPDATE_UI(wxID_REPLACE, wxGenericFindReplaceDialog::OnUpdateFindUI) - EVT_UPDATE_UI(wxID_REPLACE_ALL, wxGenericFindReplaceDialog::OnUpdateFindUI) - - EVT_CLOSE(wxGenericFindReplaceDialog::OnCloseWindow) -END_EVENT_TABLE() - -// ---------------------------------------------------------------------------- -// wxGenericFindReplaceDialog -// ---------------------------------------------------------------------------- - -void wxGenericFindReplaceDialog::Init() -{ - m_FindReplaceData = NULL; - - m_chkWord = - m_chkCase = NULL; - - m_radioDir = NULL; - - m_textFind = - m_textRepl = NULL; -} - -bool wxGenericFindReplaceDialog::Create(wxWindow *parent, - wxFindReplaceData *data, - const wxString& title, - int style) -{ - if ( !wxDialog::Create(parent, wxID_ANY, title, - wxDefaultPosition, wxDefaultSize, - wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER - | style) ) - { - return false; - } - - SetData(data); - - wxCHECK_MSG( m_FindReplaceData, false, - _T("can't create dialog without data") ); - - bool isPda = (wxSystemSettings::GetScreenType() <= wxSYS_SCREEN_PDA); - - wxBoxSizer *leftsizer = new wxBoxSizer( wxVERTICAL ); - - // 3 columns because there is a spacer in the middle - wxFlexGridSizer *sizer2Col = new wxFlexGridSizer(3); - sizer2Col->AddGrowableCol(2); - - sizer2Col->Add(new wxStaticText(this, wxID_ANY, _("Search for:"), - wxDefaultPosition, wxSize(80, wxDefaultCoord)), - 0, - wxALIGN_CENTRE_VERTICAL | wxALIGN_RIGHT); - - sizer2Col->Add(10, 0); - - m_textFind = new wxTextCtrl(this, wxID_ANY, m_FindReplaceData->GetFindString()); - sizer2Col->Add(m_textFind, 1, wxALIGN_CENTRE_VERTICAL | wxEXPAND); - - if ( style & wxFR_REPLACEDIALOG ) - { - sizer2Col->Add(new wxStaticText(this, wxID_ANY, _("Replace with:"), - wxDefaultPosition, wxSize(80, wxDefaultCoord)), - 0, - wxALIGN_CENTRE_VERTICAL | - wxALIGN_RIGHT | wxTOP, 5); - - sizer2Col->Add(isPda ? 2 : 10, 0); - - m_textRepl = new wxTextCtrl(this, wxID_ANY, - m_FindReplaceData->GetReplaceString()); - sizer2Col->Add(m_textRepl, 1, - wxALIGN_CENTRE_VERTICAL | wxEXPAND | wxTOP, 5); - } - - leftsizer->Add(sizer2Col, 0, wxEXPAND | wxALL, 5); - - wxBoxSizer *optsizer = new wxBoxSizer( isPda ? wxVERTICAL : wxHORIZONTAL ); - - wxBoxSizer *chksizer = new wxBoxSizer( wxVERTICAL); - - m_chkWord = new wxCheckBox(this, wxID_ANY, _("Whole word")); - chksizer->Add(m_chkWord, 0, wxALL, 3); - - m_chkCase = new wxCheckBox(this, wxID_ANY, _("Match case")); - chksizer->Add(m_chkCase, 0, wxALL, 3); - - optsizer->Add(chksizer, 0, wxALL, 10); - - static const wxString searchDirections[] = {_("Up"), _("Down")}; - int majorDimension = 0; - int rbStyle ; - if (isPda) - rbStyle = wxRA_SPECIFY_ROWS; - else - rbStyle = wxRA_SPECIFY_COLS; - - m_radioDir = new wxRadioBox(this, wxID_ANY, _("Search direction"), - wxDefaultPosition, wxDefaultSize, - WXSIZEOF(searchDirections), searchDirections, - majorDimension, rbStyle); - - optsizer->Add(m_radioDir, 0, wxALL, isPda ? 5 : 10); - - leftsizer->Add(optsizer); - - wxBoxSizer *bttnsizer = new wxBoxSizer(wxVERTICAL); - - wxButton* btn = new wxButton(this, wxID_FIND); - btn->SetDefault(); - bttnsizer->Add(btn, 0, wxALL, 3); - - bttnsizer->Add(new wxButton(this, wxID_CANCEL), 0, wxALL, 3); - - if ( style & wxFR_REPLACEDIALOG ) - { - bttnsizer->Add(new wxButton(this, wxID_REPLACE, _("&Replace")), - 0, wxALL, 3); - - bttnsizer->Add(new wxButton(this, wxID_REPLACE_ALL, _("Replace &all")), - 0, wxALL, 3); - } - - wxBoxSizer *topsizer = new wxBoxSizer( wxHORIZONTAL ); - - topsizer->Add(leftsizer, 1, wxALL, isPda ? 0 : 5); - topsizer->Add(bttnsizer, 0, wxALL, isPda ? 0 : 5); - - int flags = m_FindReplaceData->GetFlags(); - - if ( flags & wxFR_MATCHCASE ) - m_chkCase->SetValue(true); - - if ( flags & wxFR_WHOLEWORD ) - m_chkWord->SetValue(true); - - m_radioDir->SetSelection( flags & wxFR_DOWN ); - - if ( style & wxFR_NOMATCHCASE ) - m_chkCase->Enable(false); - - if ( style & wxFR_NOWHOLEWORD ) - m_chkWord->Enable(false); - - if ( style & wxFR_NOUPDOWN) - m_radioDir->Enable(false); - - SetAutoLayout( true ); - SetSizer( topsizer ); - - topsizer->SetSizeHints( this ); - topsizer->Fit( this ); - - Centre( wxBOTH ); - - m_textFind->SetFocus(); - - return true; -} - -// ---------------------------------------------------------------------------- -// send the notification event -// ---------------------------------------------------------------------------- - -void wxGenericFindReplaceDialog::SendEvent(const wxEventType& evtType) -{ - wxFindDialogEvent event(evtType, GetId()); - event.SetEventObject(this); - event.SetFindString(m_textFind->GetValue()); - if ( HasFlag(wxFR_REPLACEDIALOG) ) - { - event.SetReplaceString(m_textRepl->GetValue()); - } - - int flags = 0; - - if ( m_chkCase->GetValue() ) - flags |= wxFR_MATCHCASE; - - if ( m_chkWord->GetValue() ) - flags |= wxFR_WHOLEWORD; - - if ( !m_radioDir || m_radioDir->GetSelection() == 1 ) - { - flags |= wxFR_DOWN; - } - - event.SetFlags(flags); - - wxFindReplaceDialogBase::Send(event); -} - -// ---------------------------------------------------------------------------- -// event handlers -// ---------------------------------------------------------------------------- - -void wxGenericFindReplaceDialog::OnFind(wxCommandEvent& WXUNUSED(event)) -{ - SendEvent(wxEVT_COMMAND_FIND_NEXT); -} - -void wxGenericFindReplaceDialog::OnReplace(wxCommandEvent& WXUNUSED(event)) -{ - SendEvent(wxEVT_COMMAND_FIND_REPLACE); -} - -void wxGenericFindReplaceDialog::OnReplaceAll(wxCommandEvent& WXUNUSED(event)) -{ - SendEvent(wxEVT_COMMAND_FIND_REPLACE_ALL); -} - -void wxGenericFindReplaceDialog::OnCancel(wxCommandEvent& WXUNUSED(event)) -{ - SendEvent(wxEVT_COMMAND_FIND_CLOSE); - - Show(false); -} - -void wxGenericFindReplaceDialog::OnUpdateFindUI(wxUpdateUIEvent &event) -{ - // we can't search for empty strings - event.Enable( !m_textFind->GetValue().empty() ); -} - -void wxGenericFindReplaceDialog::OnCloseWindow(wxCloseEvent &) -{ - SendEvent(wxEVT_COMMAND_FIND_CLOSE); -} - -#endif // wxUSE_FINDREPLDLG diff --git a/wxWidgets/src/generic/filedlgg.cpp b/wxWidgets/src/generic/filedlgg.cpp deleted file mode 100644 index 3b4b8a28f4..0000000000 --- a/wxWidgets/src/generic/filedlgg.cpp +++ /dev/null @@ -1,1645 +0,0 @@ -////////////////////////////////////////////////////////////////////////////// -// Name: src/generic/filedlgg.cpp -// Purpose: wxGenericFileDialog -// Author: Robert Roebling -// Modified by: -// Created: 12/12/98 -// RCS-ID: $Id: filedlgg.cpp 45836 2007-05-05 17:13:30Z PC $ -// Copyright: (c) Robert Roebling -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_FILEDLG - -// NOTE : it probably also supports MAC, untested -#if !defined(__UNIX__) && !defined(__DOS__) && !defined(__WIN32__) && !defined(__OS2__) -#error wxGenericFileDialog currently only supports Unix, win32 and DOS -#endif - -#ifndef WX_PRECOMP - #ifdef __WXMSW__ - #include "wx/msw/wrapwin.h" - #endif - #include "wx/hash.h" - #include "wx/intl.h" - #include "wx/settings.h" - #include "wx/log.h" - #include "wx/msgdlg.h" - #include "wx/bmpbuttn.h" - #include "wx/checkbox.h" - #include "wx/choice.h" - #include "wx/stattext.h" - #include "wx/textctrl.h" - #include "wx/sizer.h" - #include "wx/filedlg.h" // wxFD_OPEN, wxFD_SAVE... -#endif - -#include "wx/longlong.h" -#include "wx/tokenzr.h" -#include "wx/config.h" -#include "wx/imaglist.h" -#include "wx/dir.h" -#include "wx/artprov.h" -#include "wx/filefn.h" -#include "wx/file.h" // for wxS_IXXX constants only -#include "wx/generic/filedlgg.h" -#include "wx/generic/dirctrlg.h" // for wxFileIconsTable - -#if wxUSE_TOOLTIPS - #include "wx/tooltip.h" -#endif - -#ifndef __WXWINCE__ - #include - #include -#endif - -#ifdef __UNIX__ - #include - #include - #ifndef __VMS - # include - #endif -#endif - -#ifdef __WINDOWS__ - #include "wx/msw/mslu.h" -#endif - -#ifdef __WATCOMC__ - #include -#endif - -#ifndef __WXWINCE__ -#include -#endif - -#if defined(__UNIX__) || defined(__DOS__) -#include -#endif - -// ---------------------------------------------------------------------------- -// private functions -// ---------------------------------------------------------------------------- - -static -int wxCALLBACK wxFileDataNameCompare( long data1, long data2, long sortOrder) -{ - wxFileData *fd1 = (wxFileData *)wxUIntToPtr(data1); - wxFileData *fd2 = (wxFileData *)wxUIntToPtr(data2); - - if (fd1->GetFileName() == wxT("..")) - return -sortOrder; - if (fd2->GetFileName() == wxT("..")) - return sortOrder; - if (fd1->IsDir() && !fd2->IsDir()) - return -sortOrder; - if (fd2->IsDir() && !fd1->IsDir()) - return sortOrder; - - return sortOrder*wxStrcmp( fd1->GetFileName(), fd2->GetFileName() ); -} - -static -int wxCALLBACK wxFileDataSizeCompare(long data1, long data2, long sortOrder) -{ - wxFileData *fd1 = (wxFileData *)wxUIntToPtr(data1); - wxFileData *fd2 = (wxFileData *)wxUIntToPtr(data2); - - if (fd1->GetFileName() == wxT("..")) - return -sortOrder; - if (fd2->GetFileName() == wxT("..")) - return sortOrder; - if (fd1->IsDir() && !fd2->IsDir()) - return -sortOrder; - if (fd2->IsDir() && !fd1->IsDir()) - return sortOrder; - if (fd1->IsLink() && !fd2->IsLink()) - return -sortOrder; - if (fd2->IsLink() && !fd1->IsLink()) - return sortOrder; - - return fd1->GetSize() > fd2->GetSize() ? sortOrder : -sortOrder; -} - -static -int wxCALLBACK wxFileDataTypeCompare(long data1, long data2, long sortOrder) -{ - wxFileData *fd1 = (wxFileData *)wxUIntToPtr(data1); - wxFileData *fd2 = (wxFileData *)wxUIntToPtr(data2); - - if (fd1->GetFileName() == wxT("..")) - return -sortOrder; - if (fd2->GetFileName() == wxT("..")) - return sortOrder; - if (fd1->IsDir() && !fd2->IsDir()) - return -sortOrder; - if (fd2->IsDir() && !fd1->IsDir()) - return sortOrder; - if (fd1->IsLink() && !fd2->IsLink()) - return -sortOrder; - if (fd2->IsLink() && !fd1->IsLink()) - return sortOrder; - - return sortOrder*wxStrcmp( fd1->GetFileType(), fd2->GetFileType() ); -} - -static -int wxCALLBACK wxFileDataTimeCompare(long data1, long data2, long sortOrder) -{ - wxFileData *fd1 = (wxFileData *)wxUIntToPtr(data1); - wxFileData *fd2 = (wxFileData *)wxUIntToPtr(data2); - - if (fd1->GetFileName() == wxT("..")) - return -sortOrder; - if (fd2->GetFileName() == wxT("..")) - return sortOrder; - if (fd1->IsDir() && !fd2->IsDir()) - return -sortOrder; - if (fd2->IsDir() && !fd1->IsDir()) - return sortOrder; - - return fd1->GetDateTime().IsLaterThan(fd2->GetDateTime()) ? sortOrder : -sortOrder; -} - -#if defined(__WXWINCE__) -#define IsTopMostDir(dir) (dir == wxT("\\") || dir == wxT("/")) -#elif (defined(__DOS__) || defined(__WINDOWS__) || defined (__OS2__)) -#define IsTopMostDir(dir) (dir.empty()) -#else -#define IsTopMostDir(dir) (dir == wxT("/")) -#endif - -// defined in src/generic/dirctrlg.cpp -extern size_t wxGetAvailableDrives(wxArrayString &paths, wxArrayString &names, wxArrayInt &icon_ids); - -//----------------------------------------------------------------------------- -// wxFileData -//----------------------------------------------------------------------------- - -wxFileData::wxFileData( const wxString &filePath, const wxString &fileName, fileType type, int image_id ) -{ - Init(); - m_fileName = fileName; - m_filePath = filePath; - m_type = type; - m_image = image_id; - - ReadData(); -} - -void wxFileData::Init() -{ - m_size = 0; - m_type = wxFileData::is_file; - m_image = wxFileIconsTable::file; -} - -void wxFileData::Copy( const wxFileData& fileData ) -{ - m_fileName = fileData.GetFileName(); - m_filePath = fileData.GetFilePath(); - m_size = fileData.GetSize(); - m_dateTime = fileData.GetDateTime(); - m_permissions = fileData.GetPermissions(); - m_type = fileData.GetType(); - m_image = fileData.GetImageId(); -} - -void wxFileData::ReadData() -{ - if (IsDrive()) - { - m_size = 0; - return; - } - -#if defined(__DOS__) || (defined(__WINDOWS__) && !defined(__WXWINCE__)) || defined(__OS2__) - // c:\.. is a drive don't stat it - if ((m_fileName == wxT("..")) && (m_filePath.length() <= 5)) - { - m_type = is_drive; - m_size = 0; - return; - } -#endif // __DOS__ || __WINDOWS__ - -#ifdef __WXWINCE__ - - // WinCE - - DWORD fileAttribs = GetFileAttributes(m_filePath.fn_str()); - m_type |= (fileAttribs & FILE_ATTRIBUTE_DIRECTORY) != 0 ? is_dir : 0; - - wxString p, f, ext; - wxSplitPath(m_filePath, & p, & f, & ext); - if (wxStricmp(ext, wxT("exe")) == 0) - m_type |= is_exe; - - // Find out size - m_size = 0; - HANDLE fileHandle = CreateFile(m_filePath.fn_str(), - GENERIC_READ, - FILE_SHARE_READ, - NULL, - OPEN_EXISTING, - FILE_ATTRIBUTE_NORMAL, - NULL); - - if (fileHandle != INVALID_HANDLE_VALUE) - { - m_size = GetFileSize(fileHandle, 0); - CloseHandle(fileHandle); - } - - m_dateTime = wxFileModificationTime(m_filePath); - -#else - - // OTHER PLATFORMS - - wxStructStat buff; - -#if defined(__UNIX__) && (!defined( __OS2__ ) && !defined(__VMS)) - lstat( m_filePath.fn_str(), &buff ); - m_type |= S_ISLNK( buff.st_mode ) != 0 ? is_link : 0; -#else // no lstat() - // only translate to file charset if we don't go by our - // wxStat implementation -#ifndef wxNEED_WX_UNISTD_H - wxStat( m_filePath.fn_str() , &buff ); -#else - wxStat( m_filePath, &buff ); -#endif -#endif - - m_type |= (buff.st_mode & S_IFDIR) != 0 ? is_dir : 0; - m_type |= (buff.st_mode & wxS_IXUSR) != 0 ? is_exe : 0; - - m_size = buff.st_size; - - m_dateTime = buff.st_mtime; -#endif - // __WXWINCE__ - -#if defined(__UNIX__) - m_permissions.Printf(_T("%c%c%c%c%c%c%c%c%c"), - buff.st_mode & wxS_IRUSR ? _T('r') : _T('-'), - buff.st_mode & wxS_IWUSR ? _T('w') : _T('-'), - buff.st_mode & wxS_IXUSR ? _T('x') : _T('-'), - buff.st_mode & wxS_IRGRP ? _T('r') : _T('-'), - buff.st_mode & wxS_IWGRP ? _T('w') : _T('-'), - buff.st_mode & wxS_IXGRP ? _T('x') : _T('-'), - buff.st_mode & wxS_IROTH ? _T('r') : _T('-'), - buff.st_mode & wxS_IWOTH ? _T('w') : _T('-'), - buff.st_mode & wxS_IXOTH ? _T('x') : _T('-')); -#elif defined(__WIN32__) - DWORD attribs = ::GetFileAttributes(m_filePath.c_str()); - if (attribs != (DWORD)-1) - { - m_permissions.Printf(_T("%c%c%c%c"), - attribs & FILE_ATTRIBUTE_ARCHIVE ? _T('A') : _T(' '), - attribs & FILE_ATTRIBUTE_READONLY ? _T('R') : _T(' '), - attribs & FILE_ATTRIBUTE_HIDDEN ? _T('H') : _T(' '), - attribs & FILE_ATTRIBUTE_SYSTEM ? _T('S') : _T(' ')); - } -#endif - - // try to get a better icon - if (m_image == wxFileIconsTable::file) - { - if (m_fileName.Find(wxT('.'), true) != wxNOT_FOUND) - { - m_image = wxTheFileIconsTable->GetIconID( m_fileName.AfterLast(wxT('.'))); - } else if (IsExe()) - { - m_image = wxFileIconsTable::executable; - } - } -} - -wxString wxFileData::GetFileType() const -{ - if (IsDir()) - return _(""); - else if (IsLink()) - return _(""); - else if (IsDrive()) - return _(""); - else if (m_fileName.Find(wxT('.'), true) != wxNOT_FOUND) - return m_fileName.AfterLast(wxT('.')); - - return wxEmptyString; -} - -wxString wxFileData::GetModificationTime() const -{ - // want time as 01:02 so they line up nicely, no %r in WIN32 - return m_dateTime.FormatDate() + wxT(" ") + m_dateTime.Format(wxT("%I:%M:%S %p")); -} - -wxString wxFileData::GetHint() const -{ - wxString s = m_filePath; - s += wxT(" "); - - if (IsDir()) - s += _(""); - else if (IsLink()) - s += _(""); - else if (IsDrive()) - s += _(""); - else // plain file - s += wxString::Format(wxPLURAL("%ld byte", "%ld bytes", m_size), - wxLongLong(m_size).ToString().c_str()); - - s += wxT(' '); - - if ( !IsDrive() ) - { - s << GetModificationTime() - << wxT(" ") - << m_permissions; - } - - return s; -} - -wxString wxFileData::GetEntry( fileListFieldType num ) const -{ - wxString s; - switch ( num ) - { - case FileList_Name: - s = m_fileName; - break; - - case FileList_Size: - if (!IsDir() && !IsLink() && !IsDrive()) - s = wxLongLong(m_size).ToString(); - break; - - case FileList_Type: - s = GetFileType(); - break; - - case FileList_Time: - if (!IsDrive()) - s = GetModificationTime(); - break; - -#if defined(__UNIX__) || defined(__WIN32__) - case FileList_Perm: - s = m_permissions; - break; -#endif // defined(__UNIX__) || defined(__WIN32__) - - default: - wxFAIL_MSG( _T("unexpected field in wxFileData::GetEntry()") ); - } - - return s; -} - -void wxFileData::SetNewName( const wxString &filePath, const wxString &fileName ) -{ - m_fileName = fileName; - m_filePath = filePath; -} - -void wxFileData::MakeItem( wxListItem &item ) -{ - item.m_text = m_fileName; - item.ClearAttributes(); - if (IsExe()) - item.SetTextColour(*wxRED); - if (IsDir()) - item.SetTextColour(*wxBLUE); - - item.m_image = m_image; - - if (IsLink()) - { - wxColour dg = wxTheColourDatabase->Find( _T("MEDIUM GREY") ); - if ( dg.Ok() ) - item.SetTextColour(dg); - } - item.m_data = wxPtrToUInt(this); -} - -//----------------------------------------------------------------------------- -// wxFileCtrl -//----------------------------------------------------------------------------- - -static bool ignoreChanges = false; - -IMPLEMENT_DYNAMIC_CLASS(wxFileCtrl,wxListCtrl) - -BEGIN_EVENT_TABLE(wxFileCtrl,wxListCtrl) - EVT_LIST_DELETE_ITEM(wxID_ANY, wxFileCtrl::OnListDeleteItem) - EVT_LIST_DELETE_ALL_ITEMS(wxID_ANY, wxFileCtrl::OnListDeleteAllItems) - EVT_LIST_END_LABEL_EDIT(wxID_ANY, wxFileCtrl::OnListEndLabelEdit) - EVT_LIST_COL_CLICK(wxID_ANY, wxFileCtrl::OnListColClick) -END_EVENT_TABLE() - - -wxFileCtrl::wxFileCtrl() -{ - m_showHidden = false; - m_sort_foward = 1; - m_sort_field = wxFileData::FileList_Name; -} - -wxFileCtrl::wxFileCtrl(wxWindow *win, - wxWindowID id, - const wxString& wild, - bool showHidden, - const wxPoint& pos, - const wxSize& size, - long style, - const wxValidator &validator, - const wxString &name) - : wxListCtrl(win, id, pos, size, style, validator, name), - m_wild(wild) -{ - wxImageList *imageList = wxTheFileIconsTable->GetSmallImageList(); - - SetImageList( imageList, wxIMAGE_LIST_SMALL ); - - m_showHidden = showHidden; - - m_sort_foward = 1; - m_sort_field = wxFileData::FileList_Name; - - m_dirName = wxT("*"); - - if (style & wxLC_REPORT) - ChangeToReportMode(); -} - -void wxFileCtrl::ChangeToListMode() -{ - ClearAll(); - SetSingleStyle( wxLC_LIST ); - UpdateFiles(); -} - -void wxFileCtrl::ChangeToReportMode() -{ - ClearAll(); - SetSingleStyle( wxLC_REPORT ); - - // do this since WIN32 does mm/dd/yy UNIX does mm/dd/yyyy - // don't hardcode since mm/dd is dd/mm elsewhere - int w, h; - wxDateTime dt(22, wxDateTime::Dec, 2002, 22, 22, 22); - wxString txt = dt.FormatDate() + wxT("22") + dt.Format(wxT("%I:%M:%S %p")); - GetTextExtent(txt, &w, &h); - - InsertColumn( 0, _("Name"), wxLIST_FORMAT_LEFT, w ); - InsertColumn( 1, _("Size"), wxLIST_FORMAT_LEFT, w/2 ); - InsertColumn( 2, _("Type"), wxLIST_FORMAT_LEFT, w/2 ); - InsertColumn( 3, _("Modified"), wxLIST_FORMAT_LEFT, w ); -#if defined(__UNIX__) - GetTextExtent(wxT("Permissions 2"), &w, &h); - InsertColumn( 4, _("Permissions"), wxLIST_FORMAT_LEFT, w ); -#elif defined(__WIN32__) - GetTextExtent(wxT("Attributes 2"), &w, &h); - InsertColumn( 4, _("Attributes"), wxLIST_FORMAT_LEFT, w ); -#endif - - UpdateFiles(); -} - -void wxFileCtrl::ChangeToSmallIconMode() -{ - ClearAll(); - SetSingleStyle( wxLC_SMALL_ICON ); - UpdateFiles(); -} - -void wxFileCtrl::ShowHidden( bool show ) -{ - m_showHidden = show; - UpdateFiles(); -} - -long wxFileCtrl::Add( wxFileData *fd, wxListItem &item ) -{ - long ret = -1; - item.m_mask = wxLIST_MASK_TEXT + wxLIST_MASK_DATA + wxLIST_MASK_IMAGE; - fd->MakeItem( item ); - long my_style = GetWindowStyleFlag(); - if (my_style & wxLC_REPORT) - { - ret = InsertItem( item ); - for (int i = 1; i < wxFileData::FileList_Max; i++) - SetItem( item.m_itemId, i, fd->GetEntry((wxFileData::fileListFieldType)i) ); - } - else if ((my_style & wxLC_LIST) || (my_style & wxLC_SMALL_ICON)) - { - ret = InsertItem( item ); - } - return ret; -} - -void wxFileCtrl::UpdateItem(const wxListItem &item) -{ - wxFileData *fd = (wxFileData*)GetItemData(item); - wxCHECK_RET(fd, wxT("invalid filedata")); - - fd->ReadData(); - - SetItemText(item, fd->GetFileName()); - SetItemImage(item, fd->GetImageId()); - - if (GetWindowStyleFlag() & wxLC_REPORT) - { - for (int i = 1; i < wxFileData::FileList_Max; i++) - SetItem( item.m_itemId, i, fd->GetEntry((wxFileData::fileListFieldType)i) ); - } -} - -void wxFileCtrl::UpdateFiles() -{ - // don't do anything before ShowModal() call which sets m_dirName - if ( m_dirName == wxT("*") ) - return; - - wxBusyCursor bcur; // this may take a while... - - DeleteAllItems(); - - wxListItem item; - item.m_itemId = 0; - item.m_col = 0; - -#if (defined(__WINDOWS__) || defined(__DOS__) || defined(__WXMAC__) || defined(__OS2__)) && !defined(__WXWINCE__) - if ( IsTopMostDir(m_dirName) ) - { - wxArrayString names, paths; - wxArrayInt icons; - size_t n, count = wxGetAvailableDrives(paths, names, icons); - - for (n=0; nGetFilePath() ) ); - new_name += wxFILE_SEP_PATH; - new_name += event.GetLabel(); - - wxLogNull log; - - if (wxFileExists(new_name)) - { - wxMessageDialog dialog(this, _("File name exists already."), _("Error"), wxOK | wxICON_ERROR ); - dialog.ShowModal(); - event.Veto(); - } - - if (wxRenameFile(fd->GetFilePath(),new_name)) - { - fd->SetNewName( new_name, event.GetLabel() ); - - ignoreChanges = true; - SetItemState( event.GetItem(), wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED ); - ignoreChanges = false; - - UpdateItem( event.GetItem() ); - EnsureVisible( event.GetItem() ); - } - else - { - wxMessageDialog dialog(this, _("Operation not permitted."), _("Error"), wxOK | wxICON_ERROR ); - dialog.ShowModal(); - event.Veto(); - } -} - -void wxFileCtrl::OnListColClick( wxListEvent &event ) -{ - int col = event.GetColumn(); - - switch (col) - { - case wxFileData::FileList_Name : - case wxFileData::FileList_Size : - case wxFileData::FileList_Type : - case wxFileData::FileList_Time : break; - default : return; - } - - if ((wxFileData::fileListFieldType)col == m_sort_field) - m_sort_foward = !m_sort_foward; - else - m_sort_field = (wxFileData::fileListFieldType)col; - - SortItems(m_sort_field, m_sort_foward); -} - -void wxFileCtrl::SortItems(wxFileData::fileListFieldType field, bool forward) -{ - m_sort_field = field; - m_sort_foward = forward; - const long sort_dir = forward ? 1 : -1; - - switch (m_sort_field) - { - case wxFileData::FileList_Size : - wxListCtrl::SortItems(wxFileDataSizeCompare, sort_dir); - break; - - case wxFileData::FileList_Type : - wxListCtrl::SortItems(wxFileDataTypeCompare, sort_dir); - break; - - case wxFileData::FileList_Time : - wxListCtrl::SortItems(wxFileDataTimeCompare, sort_dir); - break; - - case wxFileData::FileList_Name : - default : - wxListCtrl::SortItems(wxFileDataNameCompare, sort_dir); - break; - } -} - -wxFileCtrl::~wxFileCtrl() -{ - // Normally the data are freed via an EVT_LIST_DELETE_ALL_ITEMS event and - // wxFileCtrl::OnListDeleteAllItems. But if the event is generated after - // the destruction of the wxFileCtrl we need to free any data here: - FreeAllItemsData(); -} - -//----------------------------------------------------------------------------- -// wxGenericFileDialog -//----------------------------------------------------------------------------- - -#define ID_LIST_MODE (wxID_FILEDLGG ) -#define ID_REPORT_MODE (wxID_FILEDLGG + 1) -#define ID_UP_DIR (wxID_FILEDLGG + 5) -#define ID_PARENT_DIR (wxID_FILEDLGG + 6) -#define ID_NEW_DIR (wxID_FILEDLGG + 7) -#define ID_CHOICE (wxID_FILEDLGG + 8) -#define ID_TEXT (wxID_FILEDLGG + 9) -#define ID_LIST_CTRL (wxID_FILEDLGG + 10) -#define ID_CHECK (wxID_FILEDLGG + 12) - -IMPLEMENT_DYNAMIC_CLASS(wxGenericFileDialog, wxFileDialogBase) - -BEGIN_EVENT_TABLE(wxGenericFileDialog,wxDialog) - EVT_BUTTON(ID_LIST_MODE, wxGenericFileDialog::OnList) - EVT_BUTTON(ID_REPORT_MODE, wxGenericFileDialog::OnReport) - EVT_BUTTON(ID_UP_DIR, wxGenericFileDialog::OnUp) - EVT_BUTTON(ID_PARENT_DIR, wxGenericFileDialog::OnHome) - EVT_BUTTON(ID_NEW_DIR, wxGenericFileDialog::OnNew) - EVT_BUTTON(wxID_OK, wxGenericFileDialog::OnListOk) - EVT_LIST_ITEM_SELECTED(ID_LIST_CTRL, wxGenericFileDialog::OnSelected) - EVT_LIST_ITEM_ACTIVATED(ID_LIST_CTRL, wxGenericFileDialog::OnActivated) - EVT_CHOICE(ID_CHOICE,wxGenericFileDialog::OnChoiceFilter) - EVT_TEXT_ENTER(ID_TEXT,wxGenericFileDialog::OnTextEnter) - EVT_TEXT(ID_TEXT,wxGenericFileDialog::OnTextChange) - EVT_CHECKBOX(ID_CHECK,wxGenericFileDialog::OnCheck) -END_EVENT_TABLE() - -long wxGenericFileDialog::ms_lastViewStyle = wxLC_LIST; -bool wxGenericFileDialog::ms_lastShowHidden = false; - -void wxGenericFileDialog::Init() -{ - m_bypassGenericImpl = false; - - m_choice = NULL; - m_text = NULL; - m_list = NULL; - m_check = NULL; - m_static = NULL; - m_upDirButton = NULL; - m_newDirButton = NULL; -} - -wxGenericFileDialog::wxGenericFileDialog(wxWindow *parent, - const wxString& message, - const wxString& defaultDir, - const wxString& defaultFile, - const wxString& wildCard, - long style, - const wxPoint& pos, - const wxSize& sz, - const wxString& name, - bool bypassGenericImpl ) : wxFileDialogBase() -{ - Init(); - Create( parent, message, defaultDir, defaultFile, wildCard, style, pos, sz, name, bypassGenericImpl ); -} - -bool wxGenericFileDialog::Create( wxWindow *parent, - const wxString& message, - const wxString& defaultDir, - const wxString& defaultFile, - const wxString& wildCard, - long style, - const wxPoint& pos, - const wxSize& sz, - const wxString& name, - bool bypassGenericImpl ) -{ - m_bypassGenericImpl = bypassGenericImpl; - - if (!wxFileDialogBase::Create(parent, message, defaultDir, defaultFile, - wildCard, style, pos, sz, name)) - { - return false; - } - - if (m_bypassGenericImpl) - return true; - - if (!wxDialog::Create( parent, wxID_ANY, message, pos, sz, - wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER | style, name - )) - { - return false; - } - - ignoreChanges = true; - -#if wxUSE_CONFIG - if (wxConfig::Get(false)) - { - wxConfig::Get()->Read(wxT("/wxWindows/wxFileDialog/ViewStyle"), - &ms_lastViewStyle); - wxConfig::Get()->Read(wxT("/wxWindows/wxFileDialog/ShowHidden"), - &ms_lastShowHidden); - } -#endif - - if ((m_dir.empty()) || (m_dir == wxT("."))) - { - m_dir = wxGetCwd(); - if (m_dir.empty()) - m_dir = wxFILE_SEP_PATH; - } - - size_t len = m_dir.length(); - if ((len > 1) && (wxEndsWithPathSeparator(m_dir))) - m_dir.Remove( len-1, 1 ); - - m_path = m_dir; - m_path += wxFILE_SEP_PATH; - m_path += defaultFile; - m_filterExtension = wxEmptyString; - - // layout - - bool is_pda = (wxSystemSettings::GetScreenType() <= wxSYS_SCREEN_PDA); - - wxBoxSizer *mainsizer = new wxBoxSizer( wxVERTICAL ); - - wxBoxSizer *buttonsizer = new wxBoxSizer( wxHORIZONTAL ); - - wxBitmapButton *but; - - but = new wxBitmapButton(this, ID_LIST_MODE, - wxArtProvider::GetBitmap(wxART_LIST_VIEW, wxART_BUTTON)); -#if wxUSE_TOOLTIPS - but->SetToolTip( _("View files as a list view") ); -#endif - buttonsizer->Add( but, 0, wxALL, 5 ); - - but = new wxBitmapButton(this, ID_REPORT_MODE, - wxArtProvider::GetBitmap(wxART_REPORT_VIEW, wxART_BUTTON)); -#if wxUSE_TOOLTIPS - but->SetToolTip( _("View files as a detailed view") ); -#endif - buttonsizer->Add( but, 0, wxALL, 5 ); - - buttonsizer->Add( 30, 5, 1 ); - - m_upDirButton = new wxBitmapButton(this, ID_UP_DIR, - wxArtProvider::GetBitmap(wxART_GO_DIR_UP, wxART_BUTTON)); -#if wxUSE_TOOLTIPS - m_upDirButton->SetToolTip( _("Go to parent directory") ); -#endif - buttonsizer->Add( m_upDirButton, 0, wxALL, 5 ); - -#ifndef __DOS__ // VS: Home directory is meaningless in MS-DOS... - but = new wxBitmapButton(this, ID_PARENT_DIR, - wxArtProvider::GetBitmap(wxART_GO_HOME, wxART_BUTTON)); -#if wxUSE_TOOLTIPS - but->SetToolTip( _("Go to home directory") ); -#endif - buttonsizer->Add( but, 0, wxALL, 5); - - buttonsizer->Add( 20, 20 ); -#endif //!__DOS__ - - m_newDirButton = new wxBitmapButton(this, ID_NEW_DIR, - wxArtProvider::GetBitmap(wxART_NEW_DIR, wxART_BUTTON)); -#if wxUSE_TOOLTIPS - m_newDirButton->SetToolTip( _("Create new directory") ); -#endif - buttonsizer->Add( m_newDirButton, 0, wxALL, 5 ); - - if (is_pda) - mainsizer->Add( buttonsizer, 0, wxALL | wxEXPAND, 0 ); - else - mainsizer->Add( buttonsizer, 0, wxALL | wxEXPAND, 5 ); - - wxBoxSizer *staticsizer = new wxBoxSizer( wxHORIZONTAL ); - if (is_pda) - staticsizer->Add( new wxStaticText( this, wxID_ANY, _("Current directory:") ), 0, wxRIGHT, 10 ); - m_static = new wxStaticText( this, wxID_ANY, m_dir ); - staticsizer->Add( m_static, 1 ); - mainsizer->Add( staticsizer, 0, wxEXPAND | wxLEFT|wxRIGHT|wxBOTTOM, 10 ); - - long style2 = ms_lastViewStyle; - if ( !HasFdFlag(wxFD_MULTIPLE) ) - style2 |= wxLC_SINGLE_SEL; - -#ifdef __WXWINCE__ - style2 |= wxSIMPLE_BORDER; -#else - style2 |= wxSUNKEN_BORDER; -#endif - - m_list = new wxFileCtrl( this, ID_LIST_CTRL, - wxEmptyString, ms_lastShowHidden, - wxDefaultPosition, wxSize(540,200), - style2); - - m_text = new wxTextCtrl(this, ID_TEXT, m_fileName, - wxDefaultPosition, wxDefaultSize, - wxTE_PROCESS_ENTER); - m_choice = new wxChoice(this, ID_CHOICE); - - if (is_pda) - { - // PDAs have a different screen layout - mainsizer->Add(m_list, wxSizerFlags(1).Expand().HorzBorder()); - - wxBoxSizer *textsizer = new wxBoxSizer(wxHORIZONTAL); - textsizer->Add(m_text, wxSizerFlags(1).Centre().Border()); - mainsizer->Add(textsizer, wxSizerFlags().Expand()); - - m_check = NULL; - textsizer->Add(m_choice, wxSizerFlags(1).Centre().Border()); - - wxSizer *bsizer = CreateButtonSizer(wxOK | wxCANCEL); - if ( bsizer ) - mainsizer->Add(bsizer, wxSizerFlags().Expand().Border()); - } - else // !is_pda - { - mainsizer->Add(m_list, wxSizerFlags(1).Expand().DoubleHorzBorder()); - - wxBoxSizer *textsizer = new wxBoxSizer(wxHORIZONTAL); - textsizer->Add(m_text, wxSizerFlags(1).Centre(). - DoubleBorder(wxLEFT | wxRIGHT | wxTOP)); - textsizer->Add(new wxButton(this, wxID_OK), wxSizerFlags().Centre(). - DoubleBorder(wxLEFT | wxRIGHT | wxTOP)); - mainsizer->Add(textsizer, wxSizerFlags().Expand()); - - wxSizerFlags flagsCentre; - flagsCentre.Centre().DoubleBorder(); - - wxBoxSizer *choicesizer = new wxBoxSizer(wxHORIZONTAL); - choicesizer->Add(m_choice, wxSizerFlags(flagsCentre).Proportion(1)); - - m_check = new wxCheckBox(this, ID_CHECK, _("Show &hidden files")); - m_check->SetValue(ms_lastShowHidden); - - choicesizer->Add(m_check, flagsCentre); - choicesizer->Add(new wxButton(this, wxID_CANCEL), flagsCentre); - mainsizer->Add(choicesizer, wxSizerFlags().Expand()); - } - - SetWildcard(wildCard); - - SetAutoLayout( true ); - SetSizer( mainsizer ); - - if (!is_pda) - { - mainsizer->Fit( this ); - mainsizer->SetSizeHints( this ); - - Centre( wxBOTH ); - } - - m_text->SetFocus(); - - ignoreChanges = false; - - return true; -} - -wxGenericFileDialog::~wxGenericFileDialog() -{ - ignoreChanges = true; - - if (!m_bypassGenericImpl) - { -#if wxUSE_CONFIG - if (wxConfig::Get(false)) - { - wxConfig::Get()->Write(wxT("/wxWindows/wxFileDialog/ViewStyle"), - ms_lastViewStyle); - wxConfig::Get()->Write(wxT("/wxWindows/wxFileDialog/ShowHidden"), - ms_lastShowHidden); - } -#endif - - const int count = m_choice->GetCount(); - for ( int i = 0; i < count; i++ ) - { - delete (wxString *)m_choice->GetClientData(i); - } - } -} - -int wxGenericFileDialog::ShowModal() -{ - ignoreChanges = true; - - m_list->GoToDir(m_dir); - UpdateControls(); - m_text->SetValue(m_fileName); - - ignoreChanges = false; - - return wxDialog::ShowModal(); -} - -bool wxGenericFileDialog::Show( bool show ) -{ - // Called by ShowModal, so don't repeate the update -#ifndef __WIN32__ - if (show) - { - m_list->GoToDir(m_dir); - UpdateControls(); - m_text->SetValue(m_fileName); - } -#endif - - return wxDialog::Show( show ); -} - -void wxGenericFileDialog::DoSetFilterIndex(int filterindex) -{ - wxString *str = (wxString*) m_choice->GetClientData( filterindex ); - m_list->SetWild( *str ); - m_filterIndex = filterindex; - if ( str->Left(2) == wxT("*.") ) - { - m_filterExtension = str->Mid(1); - if (m_filterExtension == _T(".*")) - m_filterExtension.clear(); - } - else - { - m_filterExtension.clear(); - } -} - -void wxGenericFileDialog::SetWildcard(const wxString& wildCard) -{ - wxFileDialogBase::SetWildcard(wildCard); - - wxArrayString wildDescriptions, wildFilters; - const size_t count = wxParseCommonDialogsFilter(m_wildCard, - wildDescriptions, - wildFilters); - wxCHECK_RET( count, wxT("wxFileDialog: bad wildcard string") ); - - const size_t countOld = m_choice->GetCount(); - size_t n; - for ( n = 0; n < countOld; n++ ) - { - delete (wxString *)m_choice->GetClientData(n); - } - - for ( n = 0; n < count; n++ ) - { - m_choice->Append( wildDescriptions[n], new wxString( wildFilters[n] ) ); - } - - SetFilterIndex( 0 ); -} - -void wxGenericFileDialog::SetFilterIndex( int filterindex ) -{ - m_choice->SetSelection( filterindex ); - - DoSetFilterIndex(filterindex); -} - -void wxGenericFileDialog::OnChoiceFilter( wxCommandEvent &event ) -{ - DoSetFilterIndex((int)event.GetInt()); -} - -void wxGenericFileDialog::OnCheck( wxCommandEvent &event ) -{ - m_list->ShowHidden( (ms_lastShowHidden = event.GetInt() != 0) ); -} - -void wxGenericFileDialog::OnActivated( wxListEvent &event ) -{ - HandleAction( event.m_item.m_text ); -} - -void wxGenericFileDialog::OnTextEnter( wxCommandEvent &WXUNUSED(event) ) -{ - HandleAction( m_text->GetValue() ); -} - -void wxGenericFileDialog::OnTextChange( wxCommandEvent &WXUNUSED(event) ) -{ - if (!ignoreChanges) - { - // Clear selections. Otherwise when the user types in a value they may - // not get the file whose name they typed. - if (m_list->GetSelectedItemCount() > 0) - { - long item = m_list->GetNextItem(-1, wxLIST_NEXT_ALL, - wxLIST_STATE_SELECTED); - while ( item != -1 ) - { - m_list->SetItemState(item,0, wxLIST_STATE_SELECTED); - item = m_list->GetNextItem(item, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED); - } - } - } -} - -void wxGenericFileDialog::OnSelected( wxListEvent &event ) -{ - static bool inSelected = false; - - if (inSelected) - return; - - inSelected = true; - wxString filename( event.m_item.m_text ); - -#ifdef __WXWINCE__ - // No double-click on most WinCE devices, so do action immediately. - HandleAction( filename ); -#else - if (filename == wxT("..")) - { - inSelected = false; - return; - } - - wxString dir = m_list->GetDir(); - if (!IsTopMostDir(dir)) - dir += wxFILE_SEP_PATH; - dir += filename; - if (wxDirExists(dir)) - { - inSelected = false; - return; - } - - ignoreChanges = true; - m_text->SetValue( filename ); - ignoreChanges = false; -#endif - inSelected = false; -} - -void wxGenericFileDialog::HandleAction( const wxString &fn ) -{ - if (ignoreChanges) - return; - - wxString filename( fn ); - if (filename.empty()) - { -#ifdef __WXWINCE__ - EndModal(wxID_CANCEL); -#endif - return; - } - if (filename == wxT(".")) return; - - wxString dir = m_list->GetDir(); - - // "some/place/" means they want to chdir not try to load "place" - bool want_dir = filename.Last() == wxFILE_SEP_PATH; - if (want_dir) - filename = filename.RemoveLast(); - - if (filename == wxT("..")) - { - ignoreChanges = true; - m_list->GoToParentDir(); - m_list->SetFocus(); - UpdateControls(); - ignoreChanges = false; - return; - } - -#ifdef __UNIX__ - if (filename == wxT("~")) - { - ignoreChanges = true; - m_list->GoToHomeDir(); - m_list->SetFocus(); - UpdateControls(); - ignoreChanges = false; - return; - } - - if (filename.BeforeFirst(wxT('/')) == wxT("~")) - { - filename = wxString(wxGetUserHome()) + filename.Remove(0, 1); - } -#endif // __UNIX__ - - if (!HasFdFlag(wxFD_SAVE)) - { - if ((filename.Find(wxT('*')) != wxNOT_FOUND) || - (filename.Find(wxT('?')) != wxNOT_FOUND)) - { - if (filename.Find(wxFILE_SEP_PATH) != wxNOT_FOUND) - { - wxMessageBox(_("Illegal file specification."), _("Error"), wxOK | wxICON_ERROR ); - return; - } - m_list->SetWild( filename ); - return; - } - } - - if (!IsTopMostDir(dir)) - dir += wxFILE_SEP_PATH; - if (!wxIsAbsolutePath(filename)) - { - dir += filename; - filename = dir; - } - - if (wxDirExists(filename)) - { - ignoreChanges = true; - m_list->GoToDir( filename ); - UpdateControls(); - ignoreChanges = false; - return; - } - - // they really wanted a dir, but it doesn't exist - if (want_dir) - { - wxMessageBox(_("Directory doesn't exist."), _("Error"), - wxOK | wxICON_ERROR ); - return; - } - - // append the default extension to the filename if it doesn't have any - // - // VZ: the logic of testing for !wxFileExists() only for the open file - // dialog is not entirely clear to me, why don't we allow saving to a - // file without extension as well? - if ( !HasFdFlag(wxFD_OPEN) || !wxFileExists(filename) ) - { - filename = AppendExtension(filename, m_filterExtension); - } - - // check that the file [doesn't] exist if necessary - if ( HasFdFlag(wxFD_SAVE) && HasFdFlag(wxFD_OVERWRITE_PROMPT) && - wxFileExists( filename ) ) - { - wxString msg; - msg.Printf( _("File '%s' already exists, do you really want to overwrite it?"), filename.c_str() ); - - if (wxMessageBox(msg, _("Confirm"), wxYES_NO) != wxYES) - return; - } - else if ( HasFdFlag(wxFD_OPEN) && HasFdFlag(wxFD_FILE_MUST_EXIST) && - !wxFileExists(filename) ) - { - wxMessageBox(_("Please choose an existing file."), _("Error"), - wxOK | wxICON_ERROR ); - return; - } - - SetPath( filename ); - - // change to the directory where the user went if asked - if ( HasFdFlag(wxFD_CHANGE_DIR) ) - { - wxString cwd; - wxSplitPath(filename, &cwd, NULL, NULL); - - if ( cwd != wxGetCwd() ) - { - wxSetWorkingDirectory(cwd); - } - } - - EndModal(wxID_OK); -} - -void wxGenericFileDialog::OnListOk( wxCommandEvent &WXUNUSED(event) ) -{ - HandleAction( m_text->GetValue() ); -} - -void wxGenericFileDialog::OnList( wxCommandEvent &WXUNUSED(event) ) -{ - ignoreChanges = true; - m_list->ChangeToListMode(); - ms_lastViewStyle = wxLC_LIST; - m_list->SetFocus(); - ignoreChanges = false; -} - -void wxGenericFileDialog::OnReport( wxCommandEvent &WXUNUSED(event) ) -{ - ignoreChanges = true; - m_list->ChangeToReportMode(); - ms_lastViewStyle = wxLC_REPORT; - m_list->SetFocus(); - ignoreChanges = false; -} - -void wxGenericFileDialog::OnUp( wxCommandEvent &WXUNUSED(event) ) -{ - ignoreChanges = true; - m_list->GoToParentDir(); - m_list->SetFocus(); - UpdateControls(); - ignoreChanges = false; -} - -void wxGenericFileDialog::OnHome( wxCommandEvent &WXUNUSED(event) ) -{ - ignoreChanges = true; - m_list->GoToHomeDir(); - m_list->SetFocus(); - UpdateControls(); - ignoreChanges = false; -} - -void wxGenericFileDialog::OnNew( wxCommandEvent &WXUNUSED(event) ) -{ - ignoreChanges = true; - - m_list->MakeDir(); - - ignoreChanges = false; -} - -void wxGenericFileDialog::SetPath( const wxString& path ) -{ - // not only set the full path but also update filename and dir - m_path = path; - -#ifdef __WXWINCE__ - if (m_path.empty()) - m_path = wxFILE_SEP_PATH; -#endif - - if ( !path.empty() ) - { - wxString ext; - wxSplitPath(path, &m_dir, &m_fileName, &ext); - if (!ext.empty()) - { - m_fileName += wxT("."); - m_fileName += ext; - } - } -} - -void wxGenericFileDialog::GetPaths( wxArrayString& paths ) const -{ - paths.Empty(); - if (m_list->GetSelectedItemCount() == 0) - { - paths.Add( GetPath() ); - return; - } - - paths.Alloc( m_list->GetSelectedItemCount() ); - - wxString dir = m_list->GetDir(); -#ifdef __UNIX__ - if (dir != wxT("/")) -#endif -#ifdef __WXWINCE__ - if (dir != wxT("/") && dir != wxT("\\")) -#endif - dir += wxFILE_SEP_PATH; - - wxListItem item; - item.m_mask = wxLIST_MASK_TEXT; - - item.m_itemId = m_list->GetNextItem( -1, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED ); - while ( item.m_itemId != -1 ) - { - m_list->GetItem( item ); - paths.Add( dir + item.m_text ); - item.m_itemId = m_list->GetNextItem( item.m_itemId, - wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED ); - } -} - -void wxGenericFileDialog::GetFilenames(wxArrayString& files) const -{ - files.Empty(); - if (m_list->GetSelectedItemCount() == 0) - { - files.Add( GetFilename() ); - return; - } - files.Alloc( m_list->GetSelectedItemCount() ); - - wxListItem item; - item.m_mask = wxLIST_MASK_TEXT; - - item.m_itemId = m_list->GetNextItem( -1, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED ); - while ( item.m_itemId != -1 ) - { - m_list->GetItem( item ); - files.Add( item.m_text ); - item.m_itemId = m_list->GetNextItem( item.m_itemId, - wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED ); - } -} - -void wxGenericFileDialog::UpdateControls() -{ - wxString dir = m_list->GetDir(); - m_static->SetLabel(dir); - - bool enable = !IsTopMostDir(dir); - m_upDirButton->Enable(enable); - -#if defined(__DOS__) || defined(__WINDOWS__) || defined(__OS2__) - m_newDirButton->Enable(enable); -#endif // defined(__DOS__) || defined(__WINDOWS__) || defined(__OS2__) -} - -#ifdef wxUSE_GENERIC_FILEDIALOG - -IMPLEMENT_DYNAMIC_CLASS(wxFileDialog, wxGenericFileDialog) - -#endif // wxUSE_GENERIC_FILEDIALOG - -#endif // wxUSE_FILEDLG diff --git a/wxWidgets/src/generic/filepickerg.cpp b/wxWidgets/src/generic/filepickerg.cpp deleted file mode 100644 index cfac7f4760..0000000000 --- a/wxWidgets/src/generic/filepickerg.cpp +++ /dev/null @@ -1,86 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: src/generic/filepickerg.cpp -// Purpose: wxGenericFileDirButton class implementation -// Author: Francesco Montorsi -// Modified by: -// Created: 15/04/2006 -// RCS-ID: $Id: filepickerg.cpp 52835 2008-03-26 15:49:08Z JS $ -// Copyright: (c) Francesco Montorsi -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_FILEPICKERCTRL || wxUSE_DIRPICKERCTRL - -#include "wx/filepicker.h" - - -// ============================================================================ -// implementation -// ============================================================================ - -IMPLEMENT_DYNAMIC_CLASS(wxGenericFileButton, wxButton) -IMPLEMENT_DYNAMIC_CLASS(wxGenericDirButton, wxButton) - -// ---------------------------------------------------------------------------- -// wxGenericFileButton -// ---------------------------------------------------------------------------- - -bool wxGenericFileDirButton::Create( wxWindow *parent, wxWindowID id, - const wxString &label, const wxString &path, - const wxString &message, const wxString &wildcard, - const wxPoint &pos, const wxSize &size, long style, - const wxValidator& validator, const wxString &name) -{ - // create this button - if (!wxButton::Create(parent, id, label, pos, size, style, - validator, name)) - { - wxFAIL_MSG( wxT("wxGenericFileButton creation failed") ); - return false; - } - - // and handle user clicks on it - Connect(GetId(), wxEVT_COMMAND_BUTTON_CLICKED, - wxCommandEventHandler(wxGenericFileDirButton::OnButtonClick), - NULL, this); - - // create the dialog associated with this button - m_path = path; - m_message = message; - m_wildcard = wildcard; - - return true; -} - -void wxGenericFileDirButton::OnButtonClick(wxCommandEvent& WXUNUSED(ev)) -{ - wxDialog *p = CreateDialog(); - if (p->ShowModal() == wxID_OK) - { - // save updated path in m_path - UpdatePathFromDialog(p); - - // fire an event - wxFileDirPickerEvent event(GetEventType(), this, GetId(), m_path); - GetEventHandler()->ProcessEvent(event); - } - - wxDELETE(p); -} - -#endif // wxUSE_FILEPICKERCTRL || wxUSE_DIRPICKERCTRL diff --git a/wxWidgets/src/generic/fontdlgg.cpp b/wxWidgets/src/generic/fontdlgg.cpp deleted file mode 100644 index fddcbbf7e6..0000000000 --- a/wxWidgets/src/generic/fontdlgg.cpp +++ /dev/null @@ -1,623 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/generic/fontdlgg.cpp -// Purpose: Generic font dialog -// Author: Julian Smart -// Modified by: -// Created: 04/01/98 -// RCS-ID: $Id: fontdlgg.cpp 39627 2006-06-08 06:57:39Z ABX $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ -#pragma hdrstop -#endif - -#if wxUSE_FONTDLG && (!defined(__WXGTK__) || defined(__WXGPE__) || defined(__WXUNIVERSAL__)) - -#ifndef WX_PRECOMP - #include - #include "wx/utils.h" - #include "wx/dialog.h" - #include "wx/listbox.h" - #include "wx/button.h" - #include "wx/stattext.h" - #include "wx/layout.h" - #include "wx/dcclient.h" - #include "wx/choice.h" - #include "wx/checkbox.h" - #include "wx/intl.h" - #include "wx/settings.h" - #include "wx/cmndata.h" - #include "wx/sizer.h" -#endif - -#include -#include - -#include "wx/fontdlg.h" -#include "wx/generic/fontdlgg.h" - -#if USE_SPINCTRL_FOR_POINT_SIZE -#include "wx/spinctrl.h" -#endif - -//----------------------------------------------------------------------------- -// helper class - wxFontPreviewer -//----------------------------------------------------------------------------- - -class WXDLLEXPORT wxFontPreviewer : public wxWindow -{ -public: - wxFontPreviewer(wxWindow *parent, const wxSize& sz = wxDefaultSize) : wxWindow(parent, wxID_ANY, wxDefaultPosition, sz) - { - } - -private: - void OnPaint(wxPaintEvent& event); - DECLARE_EVENT_TABLE() -}; - -BEGIN_EVENT_TABLE(wxFontPreviewer, wxWindow) - EVT_PAINT(wxFontPreviewer::OnPaint) -END_EVENT_TABLE() - -void wxFontPreviewer::OnPaint(wxPaintEvent& WXUNUSED(event)) -{ - wxPaintDC dc(this); - - wxSize size = GetSize(); - wxFont font = GetFont(); - - dc.SetPen(*wxBLACK_PEN); - dc.SetBrush(*wxWHITE_BRUSH); - dc.DrawRectangle(0, 0, size.x, size.y); - - if ( font.Ok() ) - { - dc.SetFont(font); - // Calculate vertical centre - long w = 0, h = 0; - dc.GetTextExtent( wxT("X"), &w, &h); - dc.SetTextForeground(GetForegroundColour()); - dc.SetClippingRegion(2, 2, size.x-4, size.y-4); - dc.DrawText(_("ABCDEFGabcdefg12345"), - 10, size.y/2 - h/2); - dc.DestroyClippingRegion(); - } -} - -//----------------------------------------------------------------------------- -// wxGenericFontDialog -//----------------------------------------------------------------------------- - -IMPLEMENT_DYNAMIC_CLASS(wxGenericFontDialog, wxDialog) - -BEGIN_EVENT_TABLE(wxGenericFontDialog, wxDialog) - EVT_CHECKBOX(wxID_FONT_UNDERLINE, wxGenericFontDialog::OnChangeFont) - EVT_CHOICE(wxID_FONT_STYLE, wxGenericFontDialog::OnChangeFont) - EVT_CHOICE(wxID_FONT_WEIGHT, wxGenericFontDialog::OnChangeFont) - EVT_CHOICE(wxID_FONT_FAMILY, wxGenericFontDialog::OnChangeFont) - EVT_CHOICE(wxID_FONT_COLOUR, wxGenericFontDialog::OnChangeFont) -#if USE_SPINCTRL_FOR_POINT_SIZE - EVT_SPINCTRL(wxID_FONT_SIZE, wxGenericFontDialog::OnChangeSize) - EVT_TEXT(wxID_FONT_SIZE, wxGenericFontDialog::OnChangeFont) -#else - EVT_CHOICE(wxID_FONT_SIZE, wxGenericFontDialog::OnChangeFont) -#endif - EVT_CLOSE(wxGenericFontDialog::OnCloseWindow) -END_EVENT_TABLE() - - -#define NUM_COLS 48 -static wxString wxColourDialogNames[NUM_COLS]={wxT("ORANGE"), - wxT("GOLDENROD"), - wxT("WHEAT"), - wxT("SPRING GREEN"), - wxT("SKY BLUE"), - wxT("SLATE BLUE"), - wxT("MEDIUM VIOLET RED"), - wxT("PURPLE"), - - wxT("RED"), - wxT("YELLOW"), - wxT("MEDIUM SPRING GREEN"), - wxT("PALE GREEN"), - wxT("CYAN"), - wxT("LIGHT STEEL BLUE"), - wxT("ORCHID"), - wxT("LIGHT MAGENTA"), - - wxT("BROWN"), - wxT("YELLOW"), - wxT("GREEN"), - wxT("CADET BLUE"), - wxT("MEDIUM BLUE"), - wxT("MAGENTA"), - wxT("MAROON"), - wxT("ORANGE RED"), - - wxT("FIREBRICK"), - wxT("CORAL"), - wxT("FOREST GREEN"), - wxT("AQUARAMINE"), - wxT("BLUE"), - wxT("NAVY"), - wxT("THISTLE"), - wxT("MEDIUM VIOLET RED"), - - wxT("INDIAN RED"), - wxT("GOLD"), - wxT("MEDIUM SEA GREEN"), - wxT("MEDIUM BLUE"), - wxT("MIDNIGHT BLUE"), - wxT("GREY"), - wxT("PURPLE"), - wxT("KHAKI"), - - wxT("BLACK"), - wxT("MEDIUM FOREST GREEN"), - wxT("KHAKI"), - wxT("DARK GREY"), - wxT("SEA GREEN"), - wxT("LIGHT GREY"), - wxT("MEDIUM SLATE BLUE"), - wxT("WHITE") - }; - -/* - * Generic wxFontDialog - */ - -void wxGenericFontDialog::Init() -{ - m_useEvents = false; - m_previewer = NULL; - Create( m_parent ) ; -} - -wxGenericFontDialog::~wxGenericFontDialog() -{ -} - -void wxGenericFontDialog::OnCloseWindow(wxCloseEvent& WXUNUSED(event)) -{ - EndModal(wxID_CANCEL); -} - -bool wxGenericFontDialog::DoCreate(wxWindow *parent) -{ - if ( !wxDialog::Create( parent , wxID_ANY , _T("Choose Font") , wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE, - _T("fontdialog") ) ) - { - wxFAIL_MSG( wxT("wxFontDialog creation failed") ); - return false; - } - - InitializeFont(); - CreateWidgets(); - - // sets initial font in preview area - DoChangeFont(); - - return true; -} - -int wxGenericFontDialog::ShowModal() -{ - int ret = wxDialog::ShowModal(); - - if (ret != wxID_CANCEL) - { - m_fontData.m_chosenFont = m_dialogFont; - } - - return ret; -} - -// This should be application-settable -static bool ShowToolTips() { return false; } - -void wxGenericFontDialog::CreateWidgets() -{ - wxString *families = new wxString[6], - *styles = new wxString[3], - *weights = new wxString[3]; - families[0] = _("Roman"); - families[1] = _("Decorative"); - families[2] = _("Modern"); - families[3] = _("Script"); - families[4] = _("Swiss" ); - families[5] = _("Teletype" ); - styles[0] = _("Normal"); - styles[1] = _("Italic"); - styles[2] = _("Slant"); - weights[0] = _("Normal"); - weights[1] = _("Light"); - weights[2] = _("Bold"); - -#if !USE_SPINCTRL_FOR_POINT_SIZE - wxString *pointSizes = new wxString[40]; - int i; - for ( i = 0; i < 40; i++) - { - wxChar buf[5]; - wxSprintf(buf, wxT("%d"), i + 1); - pointSizes[i] = buf; - } -#endif - - // layout - - bool is_pda = (wxSystemSettings::GetScreenType() <= wxSYS_SCREEN_PDA); - int noCols, noRows; - if (is_pda) - { - noCols = 2; noRows = 3; - } - else - { - noCols = 3; noRows = 2; - } - - wxBoxSizer* itemBoxSizer2 = new wxBoxSizer(wxVERTICAL); - this->SetSizer(itemBoxSizer2); - this->SetAutoLayout(true); - - wxBoxSizer* itemBoxSizer3 = new wxBoxSizer(wxVERTICAL); - itemBoxSizer2->Add(itemBoxSizer3, 1, wxGROW|wxALL, 5); - - wxFlexGridSizer* itemGridSizer4 = new wxFlexGridSizer(noRows, noCols, 0, 0); - itemBoxSizer3->Add(itemGridSizer4, 0, wxGROW, 5); - - wxBoxSizer* itemBoxSizer5 = new wxBoxSizer(wxVERTICAL); - itemGridSizer4->Add(itemBoxSizer5, 0, wxALIGN_CENTER_HORIZONTAL|wxGROW, 5); - wxStaticText* itemStaticText6 = new wxStaticText( this, wxID_STATIC, _("&Font family:"), wxDefaultPosition, wxDefaultSize, 0 ); - itemBoxSizer5->Add(itemStaticText6, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP|wxADJUST_MINSIZE, 5); - - wxChoice* itemChoice7 = new wxChoice( this, wxID_FONT_FAMILY, wxDefaultPosition, wxDefaultSize, 5, families, 0 ); - itemChoice7->SetHelpText(_("The font family.")); - if (ShowToolTips()) - itemChoice7->SetToolTip(_("The font family.")); - itemBoxSizer5->Add(itemChoice7, 0, wxALIGN_LEFT|wxALL, 5); - - wxBoxSizer* itemBoxSizer8 = new wxBoxSizer(wxVERTICAL); - itemGridSizer4->Add(itemBoxSizer8, 0, wxALIGN_CENTER_HORIZONTAL|wxGROW, 5); - wxStaticText* itemStaticText9 = new wxStaticText( this, wxID_STATIC, _("&Style:"), wxDefaultPosition, wxDefaultSize, 0 ); - itemBoxSizer8->Add(itemStaticText9, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP|wxADJUST_MINSIZE, 5); - - wxChoice* itemChoice10 = new wxChoice( this, wxID_FONT_STYLE, wxDefaultPosition, wxDefaultSize, 3, styles, 0 ); - itemChoice10->SetHelpText(_("The font style.")); - if (ShowToolTips()) - itemChoice10->SetToolTip(_("The font style.")); - itemBoxSizer8->Add(itemChoice10, 0, wxALIGN_LEFT|wxALL, 5); - - wxBoxSizer* itemBoxSizer11 = new wxBoxSizer(wxVERTICAL); - itemGridSizer4->Add(itemBoxSizer11, 0, wxALIGN_CENTER_HORIZONTAL|wxGROW, 5); - wxStaticText* itemStaticText12 = new wxStaticText( this, wxID_STATIC, _("&Weight:"), wxDefaultPosition, wxDefaultSize, 0 ); - itemBoxSizer11->Add(itemStaticText12, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP|wxADJUST_MINSIZE, 5); - - wxChoice* itemChoice13 = new wxChoice( this, wxID_FONT_WEIGHT, wxDefaultPosition, wxDefaultSize, 3, weights, 0 ); - itemChoice13->SetHelpText(_("The font weight.")); - if (ShowToolTips()) - itemChoice13->SetToolTip(_("The font weight.")); - itemBoxSizer11->Add(itemChoice13, 0, wxALIGN_LEFT|wxALL, 5); - - wxBoxSizer* itemBoxSizer14 = new wxBoxSizer(wxVERTICAL); - itemGridSizer4->Add(itemBoxSizer14, 0, wxALIGN_CENTER_HORIZONTAL|wxGROW, 5); - if (m_fontData.GetEnableEffects()) - { - wxStaticText* itemStaticText15 = new wxStaticText( this, wxID_STATIC, _("C&olour:"), wxDefaultPosition, wxDefaultSize, 0 ); - itemBoxSizer14->Add(itemStaticText15, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP|wxADJUST_MINSIZE, 5); - - wxSize colourSize = wxDefaultSize; - if (is_pda) - colourSize.x = 100; - - wxChoice* itemChoice16 = new wxChoice( this, wxID_FONT_COLOUR, wxDefaultPosition, colourSize, NUM_COLS, wxColourDialogNames, 0 ); - itemChoice16->SetHelpText(_("The font colour.")); - if (ShowToolTips()) - itemChoice16->SetToolTip(_("The font colour.")); - itemBoxSizer14->Add(itemChoice16, 0, wxALIGN_LEFT|wxALL, 5); - } - - wxBoxSizer* itemBoxSizer17 = new wxBoxSizer(wxVERTICAL); - itemGridSizer4->Add(itemBoxSizer17, 0, wxALIGN_CENTER_HORIZONTAL|wxGROW, 5); - wxStaticText* itemStaticText18 = new wxStaticText( this, wxID_STATIC, _("&Point size:"), wxDefaultPosition, wxDefaultSize, 0 ); - itemBoxSizer17->Add(itemStaticText18, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP|wxADJUST_MINSIZE, 5); - -#if USE_SPINCTRL_FOR_POINT_SIZE - wxSpinCtrl* spinCtrl = new wxSpinCtrl(this, wxID_FONT_SIZE, wxT("12"), wxDefaultPosition, wxSize(80, wxDefaultCoord), wxSP_ARROW_KEYS, 1, 500, 12); - spinCtrl->SetHelpText(_("The font point size.")); - if (ShowToolTips()) - spinCtrl->SetToolTip(_("The font point size.")); - - itemBoxSizer17->Add(spinCtrl, 0, wxALIGN_LEFT|wxALL, 5); -#else - wxChoice* itemChoice19 = new wxChoice( this, wxID_FONT_SIZE, wxDefaultPosition, wxDefaultSize, 40, pointSizes, 0 ); - itemChoice19->SetHelpText(_("The font point size.")); - if (ShowToolTips()) - itemChoice19->SetToolTip(_("The font point size.")); - itemBoxSizer17->Add(itemChoice19, 0, wxALIGN_LEFT|wxALL, 5); -#endif - - if (m_fontData.GetEnableEffects()) - { - wxBoxSizer* itemBoxSizer20 = new wxBoxSizer(wxVERTICAL); - itemGridSizer4->Add(itemBoxSizer20, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5); - wxCheckBox* itemCheckBox21 = new wxCheckBox( this, wxID_FONT_UNDERLINE, _("&Underline"), wxDefaultPosition, wxDefaultSize, 0 ); - itemCheckBox21->SetValue(false); - itemCheckBox21->SetHelpText(_("Whether the font is underlined.")); - if (ShowToolTips()) - itemCheckBox21->SetToolTip(_("Whether the font is underlined.")); - itemBoxSizer20->Add(itemCheckBox21, 0, wxALIGN_LEFT|wxALL, 5); - } - - if (!is_pda) - itemBoxSizer3->Add(5, 5, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5); - - wxStaticText* itemStaticText23 = new wxStaticText( this, wxID_STATIC, _("Preview:"), wxDefaultPosition, wxDefaultSize, 0 ); - itemBoxSizer3->Add(itemStaticText23, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP|wxADJUST_MINSIZE, 5); - - wxFontPreviewer* itemWindow24 = new wxFontPreviewer( this ); - m_previewer = itemWindow24; - itemWindow24->SetHelpText(_("Shows the font preview.")); - if (ShowToolTips()) - itemWindow24->SetToolTip(_("Shows the font preview.")); - itemBoxSizer3->Add(itemWindow24, 1, wxGROW|wxALL, 5); - - wxBoxSizer* itemBoxSizer25 = new wxBoxSizer(wxHORIZONTAL); - itemBoxSizer3->Add(itemBoxSizer25, 0, wxGROW, 5); - itemBoxSizer25->Add(5, 5, 1, wxGROW|wxALL, 5); - -#ifdef __WXMAC__ - wxButton* itemButton28 = new wxButton( this, wxID_CANCEL, _("&Cancel"), wxDefaultPosition, wxDefaultSize, 0 ); - if (ShowToolTips()) - itemButton28->SetToolTip(_("Click to cancel the font selection.")); - itemBoxSizer25->Add(itemButton28, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); - - wxButton* itemButton27 = new wxButton( this, wxID_OK, _("&OK"), wxDefaultPosition, wxDefaultSize, 0 ); - itemButton27->SetDefault(); - itemButton27->SetHelpText(_("Click to confirm the font selection.")); - if (ShowToolTips()) - itemButton27->SetToolTip(_("Click to confirm the font selection.")); - itemBoxSizer25->Add(itemButton27, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); -#else - wxButton* itemButton27 = new wxButton( this, wxID_OK, _("&OK"), wxDefaultPosition, wxDefaultSize, 0 ); - itemButton27->SetDefault(); - itemButton27->SetHelpText(_("Click to confirm the font selection.")); - if (ShowToolTips()) - itemButton27->SetToolTip(_("Click to confirm the font selection.")); - itemBoxSizer25->Add(itemButton27, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); - - wxButton* itemButton28 = new wxButton( this, wxID_CANCEL, _("&Cancel"), wxDefaultPosition, wxDefaultSize, 0 ); - if (ShowToolTips()) - itemButton28->SetToolTip(_("Click to cancel the font selection.")); - itemBoxSizer25->Add(itemButton28, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); -#endif - - m_familyChoice = (wxChoice*) FindWindow(wxID_FONT_FAMILY); - m_styleChoice = (wxChoice*) FindWindow(wxID_FONT_STYLE); - m_weightChoice = (wxChoice*) FindWindow(wxID_FONT_WEIGHT); - m_colourChoice = (wxChoice*) FindWindow(wxID_FONT_COLOUR); - m_underLineCheckBox = (wxCheckBox*) FindWindow(wxID_FONT_UNDERLINE); - - m_familyChoice->SetStringSelection( wxFontFamilyIntToString(m_dialogFont.GetFamily()) ); - m_styleChoice->SetStringSelection(wxFontStyleIntToString(m_dialogFont.GetStyle())); - m_weightChoice->SetStringSelection(wxFontWeightIntToString(m_dialogFont.GetWeight())); - - if (m_colourChoice) - { - wxString name(wxTheColourDatabase->FindName(m_fontData.GetColour())); - if (name.length()) - m_colourChoice->SetStringSelection(name); - else - m_colourChoice->SetStringSelection(wxT("BLACK")); - } - - if (m_underLineCheckBox) - { - m_underLineCheckBox->SetValue(m_dialogFont.GetUnderlined()); - } - -#if USE_SPINCTRL_FOR_POINT_SIZE - spinCtrl->SetValue(m_dialogFont.GetPointSize()); -#else - m_pointSizeChoice = (wxChoice*) FindWindow(wxID_FONT_SIZE); - m_pointSizeChoice->SetSelection(m_dialogFont.GetPointSize()-1); -#endif - - GetSizer()->SetItemMinSize(m_previewer, is_pda ? 100 : 430, is_pda ? 40 : 100); - GetSizer()->SetSizeHints(this); - GetSizer()->Fit(this); - - Centre(wxBOTH); - - delete[] families; - delete[] styles; - delete[] weights; -#if !USE_SPINCTRL_FOR_POINT_SIZE - delete[] pointSizes; -#endif - - // Don't block events any more - m_useEvents = true; - -} - -void wxGenericFontDialog::InitializeFont() -{ - int fontFamily = wxSWISS; - int fontWeight = wxNORMAL; - int fontStyle = wxNORMAL; - int fontSize = 12; - bool fontUnderline = false; - - if (m_fontData.m_initialFont.Ok()) - { - fontFamily = m_fontData.m_initialFont.GetFamily(); - fontWeight = m_fontData.m_initialFont.GetWeight(); - fontStyle = m_fontData.m_initialFont.GetStyle(); - fontSize = m_fontData.m_initialFont.GetPointSize(); - fontUnderline = m_fontData.m_initialFont.GetUnderlined(); - } - - m_dialogFont = wxFont(fontSize, fontFamily, fontStyle, - fontWeight, fontUnderline); - - if (m_previewer) - m_previewer->SetFont(m_dialogFont); -} - -void wxGenericFontDialog::OnChangeFont(wxCommandEvent& WXUNUSED(event)) -{ - DoChangeFont(); -} - -void wxGenericFontDialog::DoChangeFont() -{ - if (!m_useEvents) return; - - int fontFamily = wxFontFamilyStringToInt(WXSTRINGCAST m_familyChoice->GetStringSelection()); - int fontWeight = wxFontWeightStringToInt(WXSTRINGCAST m_weightChoice->GetStringSelection()); - int fontStyle = wxFontStyleStringToInt(WXSTRINGCAST m_styleChoice->GetStringSelection()); -#if USE_SPINCTRL_FOR_POINT_SIZE - wxSpinCtrl* fontSizeCtrl = wxDynamicCast(FindWindow(wxID_FONT_SIZE), wxSpinCtrl); - int fontSize = fontSizeCtrl->GetValue(); -#else - int fontSize = wxAtoi(m_pointSizeChoice->GetStringSelection()); -#endif - - // Start with previous underline setting, we want to retain it even if we can't edit it - // m_dialogFont is always initialized because of the call to InitializeFont - int fontUnderline = m_dialogFont.GetUnderlined(); - - if (m_underLineCheckBox) - { - fontUnderline = m_underLineCheckBox->GetValue(); - } - - m_dialogFont = wxFont(fontSize, fontFamily, fontStyle, fontWeight, (fontUnderline != 0)); - m_previewer->SetFont(m_dialogFont); - - if ( m_colourChoice ) - { - if ( !m_colourChoice->GetStringSelection().empty() ) - { - wxColour col = wxTheColourDatabase->Find(m_colourChoice->GetStringSelection()); - if (col.Ok()) - { - m_fontData.m_fontColour = col; - } - } - } - // Update color here so that we can also use the color originally passed in - // (EnableEffects may be false) - if (m_fontData.m_fontColour.Ok()) - m_previewer->SetForegroundColour(m_fontData.m_fontColour); - - m_previewer->Refresh(); -} - -#if USE_SPINCTRL_FOR_POINT_SIZE -void wxGenericFontDialog::OnChangeSize(wxSpinEvent& WXUNUSED(event)) -{ - DoChangeFont(); -} -#endif - -const wxChar *wxFontWeightIntToString(int weight) -{ - switch (weight) - { - case wxLIGHT: - return wxT("Light"); - case wxBOLD: - return wxT("Bold"); - case wxNORMAL: - default: - return wxT("Normal"); - } -} - -const wxChar *wxFontStyleIntToString(int style) -{ - switch (style) - { - case wxITALIC: - return wxT("Italic"); - case wxSLANT: - return wxT("Slant"); - case wxNORMAL: - default: - return wxT("Normal"); - } -} - -const wxChar *wxFontFamilyIntToString(int family) -{ - switch (family) - { - case wxROMAN: - return wxT("Roman"); - case wxDECORATIVE: - return wxT("Decorative"); - case wxMODERN: - return wxT("Modern"); - case wxSCRIPT: - return wxT("Script"); - case wxTELETYPE: - return wxT("Teletype"); - case wxSWISS: - default: - return wxT("Swiss"); - } -} - -int wxFontFamilyStringToInt(wxChar *family) -{ - if (!family) - return wxSWISS; - - if (wxStrcmp(family, wxT("Roman")) == 0) - return wxROMAN; - else if (wxStrcmp(family, wxT("Decorative")) == 0) - return wxDECORATIVE; - else if (wxStrcmp(family, wxT("Modern")) == 0) - return wxMODERN; - else if (wxStrcmp(family, wxT("Script")) == 0) - return wxSCRIPT; - else if (wxStrcmp(family, wxT("Teletype")) == 0) - return wxTELETYPE; - else return wxSWISS; -} - -int wxFontStyleStringToInt(wxChar *style) -{ - if (!style) - return wxNORMAL; - if (wxStrcmp(style, wxT("Italic")) == 0) - return wxITALIC; - else if (wxStrcmp(style, wxT("Slant")) == 0) - return wxSLANT; - else - return wxNORMAL; -} - -int wxFontWeightStringToInt(wxChar *weight) -{ - if (!weight) - return wxNORMAL; - if (wxStrcmp(weight, wxT("Bold")) == 0) - return wxBOLD; - else if (wxStrcmp(weight, wxT("Light")) == 0) - return wxLIGHT; - else - return wxNORMAL; -} - -#endif - // wxUSE_FONTDLG diff --git a/wxWidgets/src/generic/fontpickerg.cpp b/wxWidgets/src/generic/fontpickerg.cpp deleted file mode 100644 index 7c42f54657..0000000000 --- a/wxWidgets/src/generic/fontpickerg.cpp +++ /dev/null @@ -1,120 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: src/generic/fontpickerg.cpp -// Purpose: wxGenericFontButton class implementation -// Author: Francesco Montorsi -// Modified by: -// Created: 15/04/2006 -// RCS-ID: $Id: fontpickerg.cpp 52835 2008-03-26 15:49:08Z JS $ -// Copyright: (c) Francesco Montorsi -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_FONTPICKERCTRL - -#include "wx/fontpicker.h" - -#include "wx/fontdlg.h" - - -// ============================================================================ -// implementation -// ============================================================================ - -wxFontData wxGenericFontButton::ms_data; -IMPLEMENT_DYNAMIC_CLASS(wxGenericFontButton, wxButton) - -// ---------------------------------------------------------------------------- -// wxGenericFontButton -// ---------------------------------------------------------------------------- - -bool wxGenericFontButton::Create( wxWindow *parent, wxWindowID id, - const wxFont &initial, const wxPoint &pos, - const wxSize &size, long style, - const wxValidator& validator, const wxString &name) -{ - wxString label = (style & wxFNTP_FONTDESC_AS_LABEL) ? - wxEmptyString : // label will be updated by UpdateFont - wxT("Choose font"); - - // create this button - if (!wxButton::Create( parent, id, label, pos, - size, style, validator, name )) - { - wxFAIL_MSG( wxT("wxGenericFontButton creation failed") ); - return false; - } - - // and handle user clicks on it - Connect(GetId(), wxEVT_COMMAND_BUTTON_CLICKED, - wxCommandEventHandler(wxGenericFontButton::OnButtonClick), - NULL, this); - - m_selectedFont = initial.IsOk() ? initial : *wxNORMAL_FONT; - UpdateFont(); - InitFontData(); - - return true; -} - -void wxGenericFontButton::InitFontData() -{ - ms_data.SetAllowSymbols(true); - ms_data.SetColour(*wxBLACK); - ms_data.EnableEffects(true); -} - -void wxGenericFontButton::OnButtonClick(wxCommandEvent& WXUNUSED(ev)) -{ - // update the wxFontData to be shown in the the dialog - ms_data.SetInitialFont(m_selectedFont); - - // create the font dialog and display it - wxFontDialog dlg(this, ms_data); - if (dlg.ShowModal() == wxID_OK) - { - ms_data = dlg.GetFontData(); - SetSelectedFont(ms_data.GetChosenFont()); - - // fire an event - wxFontPickerEvent event(this, GetId(), m_selectedFont); - GetEventHandler()->ProcessEvent(event); - } -} - -void wxGenericFontButton::UpdateFont() -{ - if ( !m_selectedFont.Ok() ) - return; - - SetForegroundColour(ms_data.GetColour()); - - if (HasFlag(wxFNTP_USEFONT_FOR_LABEL)) - { - // use currently selected font for the label... - wxButton::SetFont(m_selectedFont); - } - - if (HasFlag(wxFNTP_FONTDESC_AS_LABEL)) - { - SetLabel(wxString::Format(wxT("%s, %d"), - m_selectedFont.GetFaceName().c_str(), - m_selectedFont.GetPointSize())); - } -} - -#endif // wxUSE_FONTPICKERCTRL diff --git a/wxWidgets/src/generic/graphicc.cpp b/wxWidgets/src/generic/graphicc.cpp deleted file mode 100644 index 34b4d2f09b..0000000000 --- a/wxWidgets/src/generic/graphicc.cpp +++ /dev/null @@ -1,1615 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/generic/graphicc.cpp -// Purpose: cairo device context class -// Author: Stefan Csomor -// Modified by: -// Created: 2006-10-03 -// RCS-ID: $Id: graphicc.cpp 66928 2011-02-16 23:31:13Z JS $ -// Copyright: (c) 2006 Stefan Csomor -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ -#pragma hdrstop -#endif - -#if wxUSE_GRAPHICS_CONTEXT - -#ifndef WX_PRECOMP -#include "wx/image.h" -#include "wx/window.h" -#include "wx/dc.h" -#include "wx/utils.h" -#include "wx/dialog.h" -#include "wx/app.h" -#include "wx/bitmap.h" -#include "wx/dcmemory.h" -#include "wx/log.h" -#include "wx/icon.h" -#include "wx/dcprint.h" -#include "wx/module.h" -#endif - -#ifdef __WXGTK__ -#include "wx/gtk/win_gtk.h" -#endif - -#include "wx/graphics.h" -#include "wx/rawbmp.h" - -#if wxUSE_CAIRO - -//----------------------------------------------------------------------------- -// constants -//----------------------------------------------------------------------------- - -const double RAD2DEG = 180.0 / M_PI; - -//----------------------------------------------------------------------------- -// 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; -} -static inline double RadToDeg(double deg) -{ - return (deg * 180.0) / M_PI; -} - -//----------------------------------------------------------------------------- -// device context implementation -// -// more and more of the dc functionality should be implemented by calling -// the appropricate wxCairoContext, but we will have to do that step by step -// also coordinate conversions should be moved to native matrix ops -//----------------------------------------------------------------------------- - -// we always stock two context states, one at entry, to be able to preserve the -// state we were called with, the other one after changing to HI Graphics orientation -// (this one is used for getting back clippings etc) - -//----------------------------------------------------------------------------- -// wxGraphicsPath implementation -//----------------------------------------------------------------------------- - -// TODO remove this dependency (gdiplus needs the macros) - -#ifndef max -#define max(a,b) (((a) > (b)) ? (a) : (b)) -#endif - -#ifndef min -#define min(a,b) (((a) < (b)) ? (a) : (b)) -#endif - -#include -#ifdef __WXMSW__ -#include -#endif - -#ifdef __WXGTK__ -#include -#endif - -class WXDLLIMPEXP_CORE wxCairoPathData : public wxGraphicsPathData -{ -public : - wxCairoPathData(wxGraphicsRenderer* renderer, cairo_t* path = NULL); - ~wxCairoPathData(); - - virtual wxGraphicsObjectRefData *Clone() const; - - // - // These are the path primitives from which everything else can be constructed - // - - // begins a new subpath at (x,y) - virtual void MoveToPoint( wxDouble x, wxDouble y ); - - // adds a straight line from the current point to (x,y) - virtual void AddLineToPoint( wxDouble x, wxDouble y ); - - // adds a cubic Bezier curve from the current point, using two control points and an end point - virtual void AddCurveToPoint( wxDouble cx1, wxDouble cy1, wxDouble cx2, wxDouble cy2, wxDouble x, wxDouble y ); - - - // adds an arc of a circle centering at (x,y) with radius (r) from startAngle to endAngle - virtual void AddArc( wxDouble x, wxDouble y, wxDouble r, wxDouble startAngle, wxDouble endAngle, bool clockwise ) ; - - // gets the last point of the current path, (0,0) if not yet set - virtual void GetCurrentPoint( wxDouble* x, wxDouble* y) const; - - // adds another path - virtual void AddPath( const wxGraphicsPathData* path ); - - // closes the current sub-path - virtual void CloseSubpath(); - - // - // These are convenience functions which - if not available natively will be assembled - // using the primitives from above - // - - /* - - // appends a rectangle as a new closed subpath - virtual void AddRectangle( wxDouble x, wxDouble y, wxDouble w, wxDouble h ) ; - // appends an ellipsis as a new closed subpath fitting the passed rectangle - virtual void AddEllipsis( wxDouble x, wxDouble y, wxDouble w , wxDouble h ) ; - - // draws a an arc to two tangents connecting (current) to (x1,y1) and (x1,y1) to (x2,y2), also a straight line from (current) to (x1,y1) - virtual void AddArcToPoint( wxDouble x1, wxDouble y1 , wxDouble x2, wxDouble y2, wxDouble r ) ; - */ - - // returns the native path - virtual void * GetNativePath() const ; - - // give the native path returned by GetNativePath() back (there might be some deallocations necessary) - virtual void UnGetNativePath(void *p) const; - - // transforms each point of this path by the matrix - virtual void Transform( const wxGraphicsMatrixData* matrix ) ; - - // gets the bounding box enclosing all points (possibly including control points) - virtual void GetBox(wxDouble *x, wxDouble *y, wxDouble *w, wxDouble *h) const; - - virtual bool Contains( wxDouble x, wxDouble y, int fillStyle = wxWINDING_RULE) const; - -private : - cairo_t* m_pathContext; -}; - -class WXDLLIMPEXP_CORE wxCairoMatrixData : public wxGraphicsMatrixData -{ -public : - wxCairoMatrixData(wxGraphicsRenderer* renderer, const cairo_matrix_t* matrix = NULL ) ; - virtual ~wxCairoMatrixData() ; - - virtual wxGraphicsObjectRefData *Clone() const ; - - // concatenates the matrix - virtual void Concat( const wxGraphicsMatrixData *t ); - - // sets the matrix to the respective values - virtual void Set(wxDouble a=1.0, wxDouble b=0.0, wxDouble c=0.0, wxDouble d=1.0, - wxDouble tx=0.0, wxDouble ty=0.0); - - // gets the component valuess of the matrix - virtual void Get(wxDouble* a=NULL, wxDouble* b=NULL, wxDouble* c=NULL, - wxDouble* d=NULL, wxDouble* tx=NULL, wxDouble* ty=NULL) const; - - // makes this the inverse matrix - virtual void Invert(); - - // returns true if the elements of the transformation matrix are equal ? - virtual bool IsEqual( const wxGraphicsMatrixData* t) const ; - - // return true if this is the identity matrix - virtual bool IsIdentity() const; - - // - // transformation - // - - // add the translation to this matrix - virtual void Translate( wxDouble dx , wxDouble dy ); - - // add the scale to this matrix - virtual void Scale( wxDouble xScale , wxDouble yScale ); - - // add the rotation to this matrix (radians) - virtual void Rotate( wxDouble angle ); - - // - // apply the transforms - // - - // applies that matrix to the point - virtual void TransformPoint( wxDouble *x, wxDouble *y ) const; - - // applies the matrix except for translations - virtual void TransformDistance( wxDouble *dx, wxDouble *dy ) const; - - // returns the native representation - virtual void * GetNativeMatrix() const; -private: - cairo_matrix_t m_matrix ; -} ; - -class WXDLLIMPEXP_CORE wxCairoPenData : public wxGraphicsObjectRefData -{ -public: - wxCairoPenData( wxGraphicsRenderer* renderer, const wxPen &pen ); - ~wxCairoPenData(); - - void Init(); - - virtual void Apply( wxGraphicsContext* context ); - virtual wxDouble GetWidth() { return m_width; } - -private : - double m_width; - - double m_red; - double m_green; - double m_blue; - double m_alpha; - - cairo_line_cap_t m_cap; - cairo_line_join_t m_join; - - int m_count; - const double *m_lengths; - double *m_userLengths; - - wxPen m_pen; -}; - -class WXDLLIMPEXP_CORE wxCairoBrushData : public wxGraphicsObjectRefData -{ -public: - wxCairoBrushData( wxGraphicsRenderer* renderer ); - wxCairoBrushData( wxGraphicsRenderer* renderer, const wxBrush &brush ); - ~wxCairoBrushData (); - - virtual void Apply( wxGraphicsContext* context ); - void CreateLinearGradientBrush( wxDouble x1, wxDouble y1, wxDouble x2, wxDouble y2, - const wxColour&c1, const wxColour&c2 ); - void CreateRadialGradientBrush( wxDouble xo, wxDouble yo, wxDouble xc, wxDouble yc, wxDouble radius, - const wxColour &oColor, const wxColour &cColor ); - -protected: - virtual void Init(); - -private : - double m_red; - double m_green; - double m_blue; - double m_alpha; - - cairo_pattern_t* m_brushPattern; -}; - -class wxCairoFontData : public wxGraphicsObjectRefData -{ -public: - wxCairoFontData( wxGraphicsRenderer* renderer, const wxFont &font, const wxColour& col ); - ~wxCairoFontData(); - - virtual void Apply( wxGraphicsContext* context ); -private : - wxCharBuffer m_fontName; - double m_size; - cairo_font_slant_t m_slant; - cairo_font_weight_t m_weight; - double m_red; - double m_green; - double m_blue; - double m_alpha; -}; - -class wxCairoBitmapData : public wxGraphicsObjectRefData -{ -public: - wxCairoBitmapData( wxGraphicsRenderer* renderer, const wxBitmap& bmp ); - ~wxCairoBitmapData(); - - virtual cairo_surface_t* GetCairoSurface() { return m_surface; } - virtual cairo_pattern_t* GetCairoPattern() { return m_pattern; } - virtual wxSize GetSize() { return wxSize(m_width, m_height); } -private : - cairo_surface_t* m_surface; - cairo_pattern_t* m_pattern; - int m_width; - int m_height; - unsigned char* m_buffer; -}; - -class WXDLLIMPEXP_CORE wxCairoContext : public wxGraphicsContext -{ - DECLARE_NO_COPY_CLASS(wxCairoContext) - -public: - wxCairoContext( wxGraphicsRenderer* renderer, const wxWindowDC& dc ); -#ifdef __WXMSW__ - wxCairoContext( wxGraphicsRenderer* renderer, HDC context ); -#endif -#ifdef __WXGTK__ - wxCairoContext( wxGraphicsRenderer* renderer, GdkDrawable *drawable ); -#endif - wxCairoContext( wxGraphicsRenderer* renderer, cairo_t *context ); - wxCairoContext( wxGraphicsRenderer* renderer, wxWindow *window); - wxCairoContext(); - virtual ~wxCairoContext(); - - virtual void Clip( const wxRegion ®ion ); - - // clips drawings to the rect - virtual void Clip( wxDouble x, wxDouble y, wxDouble w, wxDouble h ); - - // resets the clipping to original extent - virtual void ResetClip(); - - virtual void * GetNativeContext(); - - virtual void StrokePath( const wxGraphicsPath& p ); - virtual void FillPath( const wxGraphicsPath& p , int fillStyle = wxWINDING_RULE ); - - virtual void Translate( wxDouble dx , wxDouble dy ); - virtual void Scale( wxDouble xScale , wxDouble yScale ); - virtual void Rotate( wxDouble angle ); - - // concatenates this transform with the current transform of this context - virtual void ConcatTransform( const wxGraphicsMatrix& matrix ); - - // sets the transform of this context - virtual void SetTransform( const wxGraphicsMatrix& matrix ); - - // gets the matrix of this context - virtual wxGraphicsMatrix GetTransform() const; - - void DrawGraphicsBitmapInternal( const wxGraphicsBitmap &bmp, wxDouble x, wxDouble y, wxDouble w, wxDouble h ); - virtual void DrawBitmap( const wxBitmap &bmp, wxDouble x, wxDouble y, wxDouble w, wxDouble h ); - virtual void DrawIcon( const wxIcon &icon, wxDouble x, wxDouble y, wxDouble w, wxDouble h ); - virtual void PushState(); - virtual void PopState(); - - virtual void DrawText( const wxString &str, wxDouble x, wxDouble y); - virtual void GetTextExtent( const wxString &str, wxDouble *width, wxDouble *height, - wxDouble *descent, wxDouble *externalLeading ) const; - virtual void GetPartialTextExtents(const wxString& text, wxArrayDouble& widths) const; - -private: - cairo_t* m_context; -#ifdef __WXMSW__ - cairo_surface_t* m_mswSurface; -#endif -}; - -//----------------------------------------------------------------------------- -// wxCairoPenData implementation -//----------------------------------------------------------------------------- - -wxCairoPenData::~wxCairoPenData() -{ - delete[] m_userLengths; -} - -void wxCairoPenData::Init() -{ - m_lengths = NULL; - m_userLengths = NULL; - m_width = 0; - m_count = 0; -} - -wxCairoPenData::wxCairoPenData( wxGraphicsRenderer* renderer, const wxPen &pen ) -: wxGraphicsObjectRefData(renderer) -{ - Init(); - m_pen = pen; - m_width = m_pen.GetWidth(); - if (m_width <= 0.0) - m_width = 0.1; - - m_red = m_pen.GetColour().Red()/255.0; - m_green = m_pen.GetColour().Green()/255.0; - m_blue = m_pen.GetColour().Blue()/255.0; - m_alpha = m_pen.GetColour().Alpha()/255.0; - - switch ( m_pen.GetCap() ) - { - case wxCAP_ROUND : - m_cap = CAIRO_LINE_CAP_ROUND; - break; - - case wxCAP_PROJECTING : - m_cap = CAIRO_LINE_CAP_SQUARE; - break; - - case wxCAP_BUTT : - m_cap = CAIRO_LINE_CAP_BUTT; - break; - - default : - m_cap = CAIRO_LINE_CAP_BUTT; - break; - } - - switch ( m_pen.GetJoin() ) - { - case wxJOIN_BEVEL : - m_join = CAIRO_LINE_JOIN_BEVEL; - break; - - case wxJOIN_MITER : - m_join = CAIRO_LINE_JOIN_MITER; - break; - - case wxJOIN_ROUND : - m_join = CAIRO_LINE_JOIN_ROUND; - break; - - default : - m_join = CAIRO_LINE_JOIN_MITER; - break; - } - - const double dashUnit = m_width < 1.0 ? 1.0 : m_width; - const double dotted[] = - { - dashUnit , dashUnit + 2.0 - }; - static const double short_dashed[] = - { - 9.0 , 6.0 - }; - static const double dashed[] = - { - 19.0 , 9.0 - }; - static const double dotted_dashed[] = - { - 9.0 , 6.0 , 3.0 , 3.0 - }; - - switch ( m_pen.GetStyle() ) - { - case wxSOLID : - break; - - case wxDOT : - m_count = WXSIZEOF(dotted); - m_userLengths = new double[ m_count ] ; - memcpy( m_userLengths, dotted, sizeof(dotted) ); - m_lengths = m_userLengths; - break; - - case wxLONG_DASH : - m_lengths = dotted ; - m_count = WXSIZEOF(dashed); - break; - - case wxSHORT_DASH : - m_lengths = dotted ; - m_count = WXSIZEOF(short_dashed); - break; - - case wxDOT_DASH : - m_lengths = dotted ; - m_count = WXSIZEOF(dotted_dashed); - break; - - case wxUSER_DASH : - { - wxDash *wxdashes ; - m_count = m_pen.GetDashes( &wxdashes ) ; - if ((wxdashes != NULL) && (m_count > 0)) - { - m_userLengths = new double[m_count] ; - for ( int i = 0 ; i < m_count ; ++i ) - { - m_userLengths[i] = wxdashes[i] * dashUnit ; - - if ( i % 2 == 1 && m_userLengths[i] < dashUnit + 2.0 ) - m_userLengths[i] = dashUnit + 2.0 ; - else if ( i % 2 == 0 && m_userLengths[i] < dashUnit ) - m_userLengths[i] = dashUnit ; - } - } - m_lengths = m_userLengths ; - } - break; - case wxSTIPPLE : - { - /* - wxBitmap* bmp = pen.GetStipple(); - if ( bmp && bmp->Ok() ) - { - wxDELETE( m_penImage ); - wxDELETE( m_penBrush ); - m_penImage = Bitmap::FromHBITMAP((HBITMAP)bmp->GetHBITMAP(),(HPALETTE)bmp->GetPalette()->GetHPALETTE()); - m_penBrush = new TextureBrush(m_penImage); - m_pen->SetBrush( m_penBrush ); - } - */ - } - break; - default : - if ( m_pen.GetStyle() >= wxFIRST_HATCH && m_pen.GetStyle() <= wxLAST_HATCH ) - { - /* - wxDELETE( m_penBrush ); - HatchStyle style = HatchStyleHorizontal; - switch( pen.GetStyle() ) - { - case wxBDIAGONAL_HATCH : - style = HatchStyleBackwardDiagonal; - break ; - case wxCROSSDIAG_HATCH : - style = HatchStyleDiagonalCross; - break ; - case wxFDIAGONAL_HATCH : - style = HatchStyleForwardDiagonal; - break ; - case wxCROSS_HATCH : - style = HatchStyleCross; - break ; - case wxHORIZONTAL_HATCH : - style = HatchStyleHorizontal; - break ; - case wxVERTICAL_HATCH : - style = HatchStyleVertical; - break ; - - } - m_penBrush = new HatchBrush(style,Color( pen.GetColour().Alpha() , pen.GetColour().Red() , - pen.GetColour().Green() , pen.GetColour().Blue() ), Color.Transparent ); - m_pen->SetBrush( m_penBrush ) - */ - } - break; - } -} - -void wxCairoPenData::Apply( wxGraphicsContext* context ) -{ - cairo_t * ctext = (cairo_t*) context->GetNativeContext(); - cairo_set_line_width(ctext,m_width); - cairo_set_source_rgba(ctext,m_red,m_green, m_blue,m_alpha); - cairo_set_line_cap(ctext,m_cap); - cairo_set_line_join(ctext,m_join); - cairo_set_dash(ctext,(double*)m_lengths,m_count,0.0); -} - -//----------------------------------------------------------------------------- -// wxCairoBrushData implementation -//----------------------------------------------------------------------------- - -wxCairoBrushData::wxCairoBrushData( wxGraphicsRenderer* renderer ) - : wxGraphicsObjectRefData( renderer ) -{ - Init(); -} - -wxCairoBrushData::wxCairoBrushData( wxGraphicsRenderer* renderer, const wxBrush &brush ) - : wxGraphicsObjectRefData(renderer) -{ - Init(); - - m_red = brush.GetColour().Red()/255.0; - m_green = brush.GetColour().Green()/255.0; - m_blue = brush.GetColour().Blue()/255.0; - m_alpha = brush.GetColour().Alpha()/255.0; - /* - if ( brush.GetStyle() == wxSOLID) - { - m_brush = new SolidBrush( Color( brush.GetColour().Alpha() , brush.GetColour().Red() , - brush.GetColour().Green() , brush.GetColour().Blue() ) ); - } - else if ( brush.IsHatch() ) - { - HatchStyle style = HatchStyleHorizontal; - switch( brush.GetStyle() ) - { - case wxBDIAGONAL_HATCH : - style = HatchStyleBackwardDiagonal; - break ; - case wxCROSSDIAG_HATCH : - style = HatchStyleDiagonalCross; - break ; - case wxFDIAGONAL_HATCH : - style = HatchStyleForwardDiagonal; - break ; - case wxCROSS_HATCH : - style = HatchStyleCross; - break ; - case wxHORIZONTAL_HATCH : - style = HatchStyleHorizontal; - break ; - case wxVERTICAL_HATCH : - style = HatchStyleVertical; - break ; - - } - m_brush = new HatchBrush(style,Color( brush.GetColour().Alpha() , brush.GetColour().Red() , - brush.GetColour().Green() , brush.GetColour().Blue() ), Color.Transparent ); - } - else - { - wxBitmap* bmp = brush.GetStipple(); - if ( bmp && bmp->Ok() ) - { - wxDELETE( m_brushImage ); - m_brushImage = Bitmap::FromHBITMAP((HBITMAP)bmp->GetHBITMAP(),(HPALETTE)bmp->GetPalette()->GetHPALETTE()); - m_brush = new TextureBrush(m_brushImage); - } - } - */ -} - -wxCairoBrushData::~wxCairoBrushData () -{ - if (m_brushPattern) - cairo_pattern_destroy(m_brushPattern); -} - -void wxCairoBrushData::Apply( wxGraphicsContext* context ) -{ - cairo_t * ctext = (cairo_t*) context->GetNativeContext(); - if ( m_brushPattern ) - { - cairo_set_source(ctext,m_brushPattern); - } - else - { - cairo_set_source_rgba(ctext,m_red,m_green, m_blue,m_alpha); - } -} - -void wxCairoBrushData::CreateLinearGradientBrush( wxDouble x1, wxDouble y1, wxDouble x2, wxDouble y2, - const wxColour&c1, const wxColour&c2 ) -{ - m_brushPattern = cairo_pattern_create_linear(x1,y1,x2,y2); - cairo_pattern_add_color_stop_rgba(m_brushPattern,0.0,c1.Red()/255.0, - c1.Green()/255.0, c1.Blue()/255.0,c1.Alpha()/255.0); - cairo_pattern_add_color_stop_rgba(m_brushPattern,1.0,c2.Red()/255.0, - c2.Green()/255.0, c2.Blue()/255.0,c2.Alpha()/255.0); - wxASSERT_MSG(cairo_pattern_status(m_brushPattern) == CAIRO_STATUS_SUCCESS, wxT("Couldn't create cairo pattern")); -} - -void wxCairoBrushData::CreateRadialGradientBrush( wxDouble xo, wxDouble yo, wxDouble xc, wxDouble yc, wxDouble radius, - const wxColour &oColor, const wxColour &cColor ) -{ - m_brushPattern = cairo_pattern_create_radial(xo,yo,0.0,xc,yc,radius); - cairo_pattern_add_color_stop_rgba(m_brushPattern,0.0,oColor.Red()/255.0, - oColor.Green()/255.0, oColor.Blue()/255.0,oColor.Alpha()/255.0); - cairo_pattern_add_color_stop_rgba(m_brushPattern,1.0,cColor.Red()/255.0, - cColor.Green()/255.0, cColor.Blue()/255.0,cColor.Alpha()/255.0); - wxASSERT_MSG(cairo_pattern_status(m_brushPattern) == CAIRO_STATUS_SUCCESS, wxT("Couldn't create cairo pattern")); -} - -void wxCairoBrushData::Init() -{ - m_brushPattern = NULL; -} - -//----------------------------------------------------------------------------- -// wxCairoFontData implementation -//----------------------------------------------------------------------------- - -wxCairoFontData::wxCairoFontData( wxGraphicsRenderer* renderer, const wxFont &font, - const wxColour& col ) : wxGraphicsObjectRefData(renderer) -{ - m_red = col.Red()/255.0; - m_green = col.Green()/255.0; - m_blue = col.Blue()/255.0; - m_alpha = col.Alpha()/255.0; - - m_size = font.GetPointSize(); - m_fontName = font.GetFaceName().mb_str(wxConvUTF8); - m_slant = font.GetStyle() == wxFONTSTYLE_ITALIC ? CAIRO_FONT_SLANT_ITALIC:CAIRO_FONT_SLANT_NORMAL; - m_weight = font.GetWeight() == wxFONTWEIGHT_BOLD ? CAIRO_FONT_WEIGHT_BOLD:CAIRO_FONT_WEIGHT_NORMAL; -} - -wxCairoFontData::~wxCairoFontData() -{ -} - -void wxCairoFontData::Apply( wxGraphicsContext* context ) -{ - cairo_t * ctext = (cairo_t*) context->GetNativeContext(); - cairo_set_source_rgba(ctext,m_red,m_green, m_blue,m_alpha); - cairo_select_font_face(ctext,m_fontName,m_slant,m_weight); - cairo_set_font_size(ctext,m_size); - // TODO UNDERLINE - // TODO FIX SIZE -} - -//----------------------------------------------------------------------------- -// wxCairoPathData implementation -//----------------------------------------------------------------------------- - -wxCairoPathData::wxCairoPathData( wxGraphicsRenderer* renderer, cairo_t* pathcontext) - : wxGraphicsPathData(renderer) -{ - if (pathcontext) - { - m_pathContext = pathcontext; - } - else - { - cairo_surface_t* surface = cairo_image_surface_create(CAIRO_FORMAT_ARGB32,1,1); - m_pathContext = cairo_create(surface); - cairo_surface_destroy (surface); - } -} - -wxCairoPathData::~wxCairoPathData() -{ - cairo_destroy(m_pathContext); -} - -wxGraphicsObjectRefData *wxCairoPathData::Clone() const -{ - cairo_surface_t* surface = cairo_image_surface_create(CAIRO_FORMAT_ARGB32,1,1); - cairo_t* pathcontext = cairo_create(surface); - cairo_surface_destroy (surface); - - cairo_path_t* path = cairo_copy_path(m_pathContext); - cairo_append_path(pathcontext, path); - cairo_path_destroy(path); - return new wxCairoPathData( GetRenderer() ,pathcontext); -} - - -void* wxCairoPathData::GetNativePath() const -{ - return cairo_copy_path(m_pathContext) ; -} - -void wxCairoPathData::UnGetNativePath(void *p) const -{ - cairo_path_destroy((cairo_path_t*)p); -} - -// -// The Primitives -// - -void wxCairoPathData::MoveToPoint( wxDouble x , wxDouble y ) -{ - cairo_move_to(m_pathContext,x,y); -} - -void wxCairoPathData::AddLineToPoint( wxDouble x , wxDouble y ) -{ - cairo_line_to(m_pathContext,x,y); -} - -void wxCairoPathData::AddPath( const wxGraphicsPathData* path ) -{ - cairo_path_t* p = (cairo_path_t*)path->GetNativePath(); - cairo_append_path(m_pathContext, p); - UnGetNativePath(p); -} - -void wxCairoPathData::CloseSubpath() -{ - cairo_close_path(m_pathContext); -} - -void wxCairoPathData::AddCurveToPoint( wxDouble cx1, wxDouble cy1, wxDouble cx2, wxDouble cy2, wxDouble x, wxDouble y ) -{ - cairo_curve_to(m_pathContext,cx1,cy1,cx2,cy2,x,y); -} - -// gets the last point of the current path, (0,0) if not yet set -void wxCairoPathData::GetCurrentPoint( wxDouble* x, wxDouble* y) const -{ - double dx,dy; - cairo_get_current_point(m_pathContext,&dx,&dy); - if (x) - *x = dx; - if (y) - *y = dy; -} - -void wxCairoPathData::AddArc( wxDouble x, wxDouble y, wxDouble r, double startAngle, double endAngle, bool clockwise ) -{ - // as clockwise means positive in our system (y pointing downwards) - // TODO make this interpretation dependent of the - // real device trans - if ( clockwise||(endAngle-startAngle)>=2*M_PI) - cairo_arc(m_pathContext,x,y,r,startAngle,endAngle); - else - cairo_arc_negative(m_pathContext,x,y,r,startAngle,endAngle); -} - -// transforms each point of this path by the matrix -void wxCairoPathData::Transform( const wxGraphicsMatrixData* matrix ) -{ - // as we don't have a true path object, we have to apply the inverse - // matrix to the context - cairo_matrix_t m = *((cairo_matrix_t*) matrix->GetNativeMatrix()); - cairo_matrix_invert( &m ); - cairo_transform(m_pathContext,&m); -} - -// gets the bounding box enclosing all points (possibly including control points) -void wxCairoPathData::GetBox(wxDouble *x, wxDouble *y, wxDouble *w, wxDouble *h) const -{ - double x1,y1,x2,y2; - - cairo_stroke_extents( m_pathContext, &x1, &y1, &x2, &y2 ); - if ( x2 < x1 ) - { - *x = x2; - *w = x1-x2; - } - else - { - *x = x1; - *w = x2-x1; - } - - if( y2 < y1 ) - { - *y = y2; - *h = y1-y2; - } - else - { - *y = y1; - *h = y2-y1; - } -} - -bool wxCairoPathData::Contains( wxDouble x, wxDouble y, int fillStyle ) const -{ - return cairo_in_stroke( m_pathContext, x, y) != 0; -} - -//----------------------------------------------------------------------------- -// wxCairoMatrixData implementation -//----------------------------------------------------------------------------- - -wxCairoMatrixData::wxCairoMatrixData(wxGraphicsRenderer* renderer, const cairo_matrix_t* matrix ) - : wxGraphicsMatrixData(renderer) -{ - if ( matrix ) - m_matrix = *matrix; -} - -wxCairoMatrixData::~wxCairoMatrixData() -{ - // nothing to do -} - -wxGraphicsObjectRefData *wxCairoMatrixData::Clone() const -{ - return new wxCairoMatrixData(GetRenderer(),&m_matrix); -} - -// concatenates the matrix -void wxCairoMatrixData::Concat( const wxGraphicsMatrixData *t ) -{ - cairo_matrix_multiply( &m_matrix, &m_matrix, (cairo_matrix_t*) t->GetNativeMatrix()); -} - -// sets the matrix to the respective values -void wxCairoMatrixData::Set(wxDouble a, wxDouble b, wxDouble c, wxDouble d, - wxDouble tx, wxDouble ty) -{ - cairo_matrix_init( &m_matrix, a, b, c, d, tx, ty); -} - -// gets the component valuess of the matrix -void wxCairoMatrixData::Get(wxDouble* a, wxDouble* b, wxDouble* c, - wxDouble* d, wxDouble* tx, wxDouble* ty) const -{ - if (a) *a = m_matrix.xx; - if (b) *b = m_matrix.yx; - if (c) *c = m_matrix.xy; - if (d) *d = m_matrix.yy; - if (tx) *tx= m_matrix.x0; - if (ty) *ty= m_matrix.y0; -} - -// makes this the inverse matrix -void wxCairoMatrixData::Invert() -{ - cairo_matrix_invert( &m_matrix ); -} - -// returns true if the elements of the transformation matrix are equal ? -bool wxCairoMatrixData::IsEqual( const wxGraphicsMatrixData* t) const -{ - const cairo_matrix_t* tm = (cairo_matrix_t*) t->GetNativeMatrix(); - return ( - m_matrix.xx == tm->xx && - m_matrix.yx == tm->yx && - m_matrix.xy == tm->xy && - m_matrix.yy == tm->yy && - m_matrix.x0 == tm->x0 && - m_matrix.y0 == tm->y0 ) ; -} - -// return true if this is the identity matrix -bool wxCairoMatrixData::IsIdentity() const -{ - return ( m_matrix.xx == 1 && m_matrix.yy == 1 && - m_matrix.yx == 0 && m_matrix.xy == 0 && m_matrix.x0 == 0 && m_matrix.y0 == 0); -} - -// -// transformation -// - -// add the translation to this matrix -void wxCairoMatrixData::Translate( wxDouble dx , wxDouble dy ) -{ - cairo_matrix_translate( &m_matrix, dx, dy) ; -} - -// add the scale to this matrix -void wxCairoMatrixData::Scale( wxDouble xScale , wxDouble yScale ) -{ - cairo_matrix_scale( &m_matrix, xScale, yScale) ; -} - -// add the rotation to this matrix (radians) -void wxCairoMatrixData::Rotate( wxDouble angle ) -{ - cairo_matrix_rotate( &m_matrix, angle) ; -} - -// -// apply the transforms -// - -// applies that matrix to the point -void wxCairoMatrixData::TransformPoint( wxDouble *x, wxDouble *y ) const -{ - double lx = *x, ly = *y ; - cairo_matrix_transform_point( &m_matrix, &lx, &ly); - *x = lx; - *y = ly; -} - -// applies the matrix except for translations -void wxCairoMatrixData::TransformDistance( wxDouble *dx, wxDouble *dy ) const -{ - double lx = *dx, ly = *dy ; - cairo_matrix_transform_distance( &m_matrix, &lx, &ly); - *dx = lx; - *dy = ly; -} - -// returns the native representation -void * wxCairoMatrixData::GetNativeMatrix() const -{ - return (void*) &m_matrix; -} - -//----------------------------------------------------------------------------- -// wxCairoBitmap implementation -//----------------------------------------------------------------------------- - -wxCairoBitmapData::wxCairoBitmapData( wxGraphicsRenderer* renderer, const wxBitmap& bmp ) : wxGraphicsObjectRefData( renderer ) -{ - wxCHECK_RET( bmp.IsOk(), wxT("Invalid bitmap in wxCairoContext::DrawBitmap")); - - int bw = m_width = bmp.GetWidth(); - int bh = m_height = bmp.GetHeight(); - wxBitmap bmpSource = bmp; // we need a non-const instance - m_buffer = new unsigned char[bw*bh*4]; - wxUint32* data = (wxUint32*)m_buffer; - - // Create a surface object and copy the bitmap pixel data to it. if the - // image has alpha (or a mask represented as alpha) then we'll use a - // different format and iterator than if it doesn't... - if (bmpSource.HasAlpha() || bmpSource.GetMask()) - { - m_surface = cairo_image_surface_create_for_data( - m_buffer, CAIRO_FORMAT_ARGB32, bw, bh, bw*4); - wxAlphaPixelData pixData(bmpSource, wxPoint(0,0), wxSize(bw, bh)); - wxCHECK_RET( pixData, wxT("Failed to gain raw access to bitmap data.")); - - wxAlphaPixelData::Iterator p(pixData); - for (int y=0; ym_wxwindow; - - // Some controls don't have m_wxwindow - like wxStaticBox, but the user - // code should still be able to create wxClientDCs for them, so we will - // use the parent window here then. - if ( !widget ) - { - window = window->GetParent(); - widget = window->m_wxwindow; - } - - wxASSERT_MSG( widget, wxT("wxCairoContext needs a widget") ); - - GtkPizza *pizza = GTK_PIZZA( widget ); - GdkDrawable* drawable = pizza->bin_window; - m_context = gdk_cairo_create( drawable ) ; -#endif -#ifdef __WXMSW__ - m_mswSurface = cairo_win32_surface_create((HDC)window->GetHandle()); - m_context = cairo_create(m_mswSurface); -#endif - PushState(); - PushState(); -} - -wxCairoContext::~wxCairoContext() -{ - if ( m_context ) - { - PopState(); - PopState(); - cairo_destroy(m_context); - } -#ifdef __WXMSW__ - if ( m_mswSurface ) - cairo_surface_destroy(m_mswSurface); -#endif -} - - -void wxCairoContext::Clip( const wxRegion& region ) -{ - // Create a path with all the rectangles in the region - wxGraphicsPath path = GetRenderer()->CreatePath(); - wxRegionIterator ri(region); - while (ri) - { - path.AddRectangle(ri.GetX(), ri.GetY(), ri.GetW(), ri.GetH()); - ri++; - } - - // Put it in the context - cairo_path_t* cp = (cairo_path_t*) path.GetNativePath() ; - cairo_append_path(m_context, cp); - - // clip to that path - cairo_clip(m_context); - path.UnGetNativePath(cp); -} - -void wxCairoContext::Clip( wxDouble x, wxDouble y, wxDouble w, wxDouble h ) -{ - // Create a path with this rectangle - wxGraphicsPath path = GetRenderer()->CreatePath(); - path.AddRectangle(x,y,w,h); - - // Put it in the context - cairo_path_t* cp = (cairo_path_t*) path.GetNativePath() ; - cairo_append_path(m_context, cp); - - // clip to that path - cairo_clip(m_context); - path.UnGetNativePath(cp); -} - -void wxCairoContext::ResetClip() -{ - cairo_reset_clip(m_context); -} - - -void wxCairoContext::StrokePath( const wxGraphicsPath& path ) -{ - if ( !m_pen.IsNull() ) - { - cairo_path_t* cp = (cairo_path_t*) path.GetNativePath() ; - cairo_append_path(m_context,cp); - ((wxCairoPenData*)m_pen.GetRefData())->Apply(this); - cairo_stroke(m_context); - path.UnGetNativePath(cp); - } -} - -void wxCairoContext::FillPath( const wxGraphicsPath& path , int fillStyle ) -{ - if ( !m_brush.IsNull() ) - { - cairo_path_t* cp = (cairo_path_t*) path.GetNativePath() ; - cairo_append_path(m_context,cp); - ((wxCairoBrushData*)m_brush.GetRefData())->Apply(this); - cairo_set_fill_rule(m_context,fillStyle==wxODDEVEN_RULE ? CAIRO_FILL_RULE_EVEN_ODD : CAIRO_FILL_RULE_WINDING); - cairo_fill(m_context); - path.UnGetNativePath(cp); - } -} - -void wxCairoContext::Rotate( wxDouble angle ) -{ - cairo_rotate(m_context,angle); -} - -void wxCairoContext::Translate( wxDouble dx , wxDouble dy ) -{ - cairo_translate(m_context,dx,dy); -} - -void wxCairoContext::Scale( wxDouble xScale , wxDouble yScale ) -{ - cairo_scale(m_context,xScale,yScale); -} - -// concatenates this transform with the current transform of this context -void wxCairoContext::ConcatTransform( const wxGraphicsMatrix& matrix ) -{ - cairo_transform(m_context,(const cairo_matrix_t *) matrix.GetNativeMatrix()); -} - -// sets the transform of this context -void wxCairoContext::SetTransform( const wxGraphicsMatrix& matrix ) -{ - cairo_set_matrix(m_context,(const cairo_matrix_t*) matrix.GetNativeMatrix()); -} - -// gets the matrix of this context -wxGraphicsMatrix wxCairoContext::GetTransform() const -{ - wxGraphicsMatrix matrix = CreateMatrix(); - cairo_get_matrix(m_context,(cairo_matrix_t*) matrix.GetNativeMatrix()); - return matrix; -} - - - -void wxCairoContext::PushState() -{ - cairo_save(m_context); -} - -void wxCairoContext::PopState() -{ - cairo_restore(m_context); -} - -void wxGraphicsContext::DrawGraphicsBitmap(const wxGraphicsBitmap &bmp, wxDouble x, wxDouble y, wxDouble w, wxDouble h) -{ - static_cast(this)->DrawGraphicsBitmapInternal(bmp, x, y, w, h); -} - -void wxCairoContext::DrawBitmap( const wxBitmap &bmp, wxDouble x, wxDouble y, wxDouble w, wxDouble h ) -{ - wxGraphicsBitmap bitmap = GetRenderer()->CreateBitmap(bmp); - DrawGraphicsBitmapInternal(bitmap, x, y, w, h); -} - -void wxCairoContext::DrawGraphicsBitmapInternal(const wxGraphicsBitmap &bmp, wxDouble x, wxDouble y, wxDouble w, wxDouble h ) -{ - wxCairoBitmapData* data = static_cast(bmp.GetRefData()); - cairo_pattern_t* pattern = data->GetCairoPattern(); - wxSize size = data->GetSize(); - PushState(); - - // prepare to draw the image - cairo_translate(m_context, x, y); - // In case we're scaling the image by using a width and height different - // than the bitmap's size create a pattern transformation on the surface and - // draw the transformed pattern. - wxDouble scaleX = w / size.GetWidth(); - wxDouble scaleY = h / size.GetHeight(); - cairo_scale(m_context, scaleX, scaleY); - cairo_set_source(m_context, pattern); - // use the original size here since the context is scaled already... - cairo_rectangle(m_context, 0, 0, size.GetWidth(), size.GetHeight()); - // fill the rectangle using the pattern - cairo_fill(m_context); - - // clean up - PopState(); -} - -void wxCairoContext::DrawIcon( const wxIcon &icon, wxDouble x, wxDouble y, wxDouble w, wxDouble h ) -{ - // An icon is a bitmap on wxGTK, so do this the easy way. When we want to - // start using the Cairo backend on other platforms then we may need to - // fiddle with this... - DrawBitmap(icon, x, y, w, h); -} - - -void wxCairoContext::DrawText( const wxString &str, wxDouble x, wxDouble y ) -{ - wxCHECK_RET( !m_font.IsNull(), wxT("wxCairoContext::DrawText - no valid font set") ); - - if ( str.empty()) - return; - - ((wxCairoFontData*)m_font.GetRefData())->Apply(this); - - // Cairo's x,y for drawing text is at the baseline, so we need to adjust - // the position we move to by the ascent. - cairo_font_extents_t fe; - cairo_font_extents(m_context, &fe); - cairo_move_to(m_context, x, y+fe.ascent); - - const wxWX2MBbuf buf(str.mb_str(wxConvUTF8)); - cairo_show_text(m_context,buf); -} - -void wxCairoContext::GetTextExtent( const wxString &str, wxDouble *width, wxDouble *height, - wxDouble *descent, wxDouble *externalLeading ) const -{ - wxCHECK_RET( !m_font.IsNull(), wxT("wxCairoContext::GetTextExtent - no valid font set") ); - - if ( str.empty()) - return; - - ((wxCairoFontData*)m_font.GetRefData())->Apply((wxCairoContext*)this); - - if (width) - { - const wxWX2MBbuf buf(str.mb_str(wxConvUTF8)); - cairo_text_extents_t te; - cairo_text_extents(m_context, buf, &te); - *width = te.width; - } - - if (height || descent || externalLeading) - { - cairo_font_extents_t fe; - cairo_font_extents(m_context, &fe); - - if (height) - *height = fe.height; - if ( descent ) - *descent = fe.descent; - if ( externalLeading ) - *externalLeading = wxMax(0, fe.height - (fe.ascent + fe.descent)); - } -} - -void wxCairoContext::GetPartialTextExtents(const wxString& text, wxArrayDouble& widths) const -{ - widths.Empty(); - widths.Add(0, text.length()); - - wxCHECK_RET( !m_font.IsNull(), wxT("wxCairoContext::GetPartialTextExtents - no valid font set") ); - - if (text.empty()) - return; - - // TODO -} - -void * wxCairoContext::GetNativeContext() -{ - return m_context; -} - -//----------------------------------------------------------------------------- -// wxCairoRenderer declaration -//----------------------------------------------------------------------------- - -class WXDLLIMPEXP_CORE wxCairoRenderer : public wxGraphicsRenderer -{ -public : - wxCairoRenderer() {} - - virtual ~wxCairoRenderer() {} - - // Context - - virtual wxGraphicsContext * CreateContext( const wxWindowDC& dc); - -#ifdef __WXMSW__ - virtual wxGraphicsContext * CreateContext( const wxMemoryDC& dc); -#endif - - virtual wxGraphicsContext * CreateContextFromNativeContext( void * context ); - - virtual wxGraphicsContext * CreateContextFromNativeWindow( void * window ); - - virtual wxGraphicsContext * CreateContext( wxWindow* window ); - - virtual wxGraphicsContext * CreateMeasuringContext(); - - // Path - - virtual wxGraphicsPath CreatePath(); - - // Matrix - - virtual wxGraphicsMatrix CreateMatrix( wxDouble a=1.0, wxDouble b=0.0, wxDouble c=0.0, wxDouble d=1.0, - wxDouble tx=0.0, wxDouble ty=0.0); - - - virtual wxGraphicsPen CreatePen(const wxPen& pen) ; - - virtual wxGraphicsBrush CreateBrush(const wxBrush& brush ) ; - - // sets the brush to a linear gradient, starting at (x1,y1) with color c1 to (x2,y2) with color c2 - virtual wxGraphicsBrush CreateLinearGradientBrush( wxDouble x1, wxDouble y1, wxDouble x2, wxDouble y2, - const wxColour&c1, const wxColour&c2) ; - - // sets the brush to a radial gradient originating at (xo,yc) with color oColor and ends on a circle around (xc,yc) - // with radius r and color cColor - virtual wxGraphicsBrush CreateRadialGradientBrush( wxDouble xo, wxDouble yo, wxDouble xc, wxDouble yc, wxDouble radius, - const wxColour &oColor, const wxColour &cColor) ; - - // sets the font - virtual wxGraphicsFont CreateFont( const wxFont &font , const wxColour &col = *wxBLACK ) ; - - wxGraphicsBitmap CreateBitmap( const wxBitmap &bitmap ) ; - -private : - DECLARE_DYNAMIC_CLASS_NO_COPY(wxCairoRenderer) -} ; - -//----------------------------------------------------------------------------- -// wxCairoRenderer implementation -//----------------------------------------------------------------------------- - -IMPLEMENT_DYNAMIC_CLASS(wxCairoRenderer,wxGraphicsRenderer) - -static wxCairoRenderer gs_cairoGraphicsRenderer; - -#ifdef __WXGTK__ -wxGraphicsRenderer* wxGraphicsRenderer::GetDefaultRenderer() -{ - return &gs_cairoGraphicsRenderer; -} -#endif - -wxGraphicsContext * wxCairoRenderer::CreateContext( const wxWindowDC& dc) -{ - return new wxCairoContext(this,dc); -} - -#ifdef __WXMSW__ -wxGraphicsContext * wxCairoRenderer::CreateContext( const wxMemoryDC& dc) -{ - return NULL; -} -#endif - -wxGraphicsContext * wxCairoRenderer::CreateContextFromNativeContext( void * context ) -{ -#if __WXMSW__ - return new wxCairoContext(this,(HDC)context); -#endif -#if __WXGTK__ - return new wxCairoContext(this,(cairo_t*)context); -#endif -} - - -wxGraphicsContext * wxCairoRenderer::CreateContextFromNativeWindow( void * window ) -{ -#ifdef __WXGTK__ - return new wxCairoContext(this,(GdkDrawable*)window); -#else - return NULL; -#endif -} - -wxGraphicsContext * wxCairoRenderer::CreateMeasuringContext() -{ -#ifdef __WXGTK__ - return CreateContextFromNativeWindow(gdk_get_default_root_window()); -#endif - return NULL; - // TODO -} - -wxGraphicsContext * wxCairoRenderer::CreateContext( wxWindow* window ) -{ - return new wxCairoContext(this, window ); -} - -// Path - -wxGraphicsPath wxCairoRenderer::CreatePath() -{ - wxGraphicsPath path; - path.SetRefData( new wxCairoPathData(this) ); - return path; -} - - -// Matrix - -wxGraphicsMatrix wxCairoRenderer::CreateMatrix( wxDouble a, wxDouble b, wxDouble c, wxDouble d, - wxDouble tx, wxDouble ty) - -{ - wxGraphicsMatrix m; - wxCairoMatrixData* data = new wxCairoMatrixData( this ); - data->Set( a,b,c,d,tx,ty ) ; - m.SetRefData(data); - return m; -} - -wxGraphicsPen wxCairoRenderer::CreatePen(const wxPen& pen) -{ - if ( !pen.Ok() || pen.GetStyle() == wxTRANSPARENT ) - return wxNullGraphicsPen; - else - { - wxGraphicsPen p; - p.SetRefData(new wxCairoPenData( this, pen )); - return p; - } -} - -wxGraphicsBrush wxCairoRenderer::CreateBrush(const wxBrush& brush ) -{ - if ( !brush.Ok() || brush.GetStyle() == wxTRANSPARENT ) - return wxNullGraphicsBrush; - else - { - wxGraphicsBrush p; - p.SetRefData(new wxCairoBrushData( this, brush )); - return p; - } -} - -// sets the brush to a linear gradient, starting at (x1,y1) with color c1 to (x2,y2) with color c2 -wxGraphicsBrush wxCairoRenderer::CreateLinearGradientBrush( wxDouble x1, wxDouble y1, wxDouble x2, wxDouble y2, - const wxColour&c1, const wxColour&c2) -{ - wxGraphicsBrush p; - wxCairoBrushData* d = new wxCairoBrushData( this ); - d->CreateLinearGradientBrush(x1, y1, x2, y2, c1, c2); - p.SetRefData(d); - return p; -} - -// sets the brush to a radial gradient originating at (xo,yc) with color oColor and ends on a circle around (xc,yc) -// with radius r and color cColor -wxGraphicsBrush wxCairoRenderer::CreateRadialGradientBrush( wxDouble xo, wxDouble yo, wxDouble xc, wxDouble yc, wxDouble radius, - const wxColour &oColor, const wxColour &cColor) -{ - wxGraphicsBrush p; - wxCairoBrushData* d = new wxCairoBrushData( this ); - d->CreateRadialGradientBrush(xo,yo,xc,yc,radius,oColor,cColor); - p.SetRefData(d); - return p; -} - -// sets the font -wxGraphicsFont wxCairoRenderer::CreateFont( const wxFont &font , const wxColour &col ) -{ - if ( font.Ok() ) - { - wxGraphicsFont p; - p.SetRefData(new wxCairoFontData( this , font, col )); - return p; - } - else - return wxNullGraphicsFont; -} - -wxGraphicsBitmap wxGraphicsRenderer::CreateBitmap( const wxBitmap& bmp ) -{ - if ( bmp.Ok() ) - { - wxGraphicsBitmap p; - p.SetRefData(new wxCairoBitmapData( this , bmp )); - return p; - } - else - return wxNullGraphicsBitmap; -} - -#endif // wxUSE_CAIRO - -wxGraphicsRenderer* wxGraphicsRenderer::GetCairoRenderer() -{ -#if wxUSE_CAIRO - return &gs_cairoGraphicsRenderer; -#else - return NULL; -#endif -} - -#endif // wxUSE_GRAPHICS_CONTEXT diff --git a/wxWidgets/src/generic/grid.cpp b/wxWidgets/src/generic/grid.cpp deleted file mode 100644 index efc86374bb..0000000000 --- a/wxWidgets/src/generic/grid.cpp +++ /dev/null @@ -1,11472 +0,0 @@ -/////////////////////////////////////////////////////////////////////////// -// Name: src/generic/grid.cpp -// Purpose: wxGrid and related classes -// Author: Michael Bedward (based on code by Julian Smart, Robin Dunn) -// Modified by: Robin Dunn, Vadim Zeitlin, Santiago Palacios -// Created: 1/08/1999 -// RCS-ID: $Id: grid.cpp 66945 2011-02-17 15:01:48Z JS $ -// Copyright: (c) Michael Bedward (mbedward@ozemail.com.au) -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// For compilers that support precompilation, includes "wx/wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_GRID - -#include "wx/grid.h" - -#ifndef WX_PRECOMP - #include "wx/utils.h" - #include "wx/dcclient.h" - #include "wx/settings.h" - #include "wx/log.h" - #include "wx/textctrl.h" - #include "wx/checkbox.h" - #include "wx/combobox.h" - #include "wx/valtext.h" - #include "wx/intl.h" - #include "wx/math.h" - #include "wx/listbox.h" -#endif - -#include "wx/textfile.h" -#include "wx/spinctrl.h" -#include "wx/tokenzr.h" -#include "wx/renderer.h" - -#include "wx/generic/gridsel.h" - -const wxChar wxGridNameStr[] = wxT("grid"); - -#if defined(__WXMOTIF__) - #define WXUNUSED_MOTIF(identifier) WXUNUSED(identifier) -#else - #define WXUNUSED_MOTIF(identifier) identifier -#endif - -#if defined(__WXGTK__) - #define WXUNUSED_GTK(identifier) WXUNUSED(identifier) -#else - #define WXUNUSED_GTK(identifier) identifier -#endif - -// Required for wxIs... functions -#include - -// ---------------------------------------------------------------------------- -// array classes -// ---------------------------------------------------------------------------- - -WX_DEFINE_ARRAY_WITH_DECL_PTR(wxGridCellAttr *, wxArrayAttrs, - class WXDLLIMPEXP_ADV); - -struct wxGridCellWithAttr -{ - wxGridCellWithAttr(int row, int col, wxGridCellAttr *attr_) - : coords(row, col), attr(attr_) - { - wxASSERT( attr ); - } - - wxGridCellWithAttr(const wxGridCellWithAttr& other) - : coords(other.coords), - attr(other.attr) - { - attr->IncRef(); - } - - wxGridCellWithAttr& operator=(const wxGridCellWithAttr& other) - { - coords = other.coords; - if (attr != other.attr) - { - attr->DecRef(); - attr = other.attr; - attr->IncRef(); - } - return *this; - } - - void ChangeAttr(wxGridCellAttr * new_attr) - { - if (attr != new_attr) - { - // "Delete" (i.e. DecRef) the old attribute. - attr->DecRef(); - attr = new_attr; - // Take ownership of the new attribute, i.e. no IncRef. - } - } - - ~wxGridCellWithAttr() - { - attr->DecRef(); - } - - wxGridCellCoords coords; - wxGridCellAttr *attr; -}; - -WX_DECLARE_OBJARRAY_WITH_DECL(wxGridCellWithAttr, wxGridCellWithAttrArray, - class WXDLLIMPEXP_ADV); - -#include "wx/arrimpl.cpp" - -WX_DEFINE_OBJARRAY(wxGridCellCoordsArray) -WX_DEFINE_OBJARRAY(wxGridCellWithAttrArray) - -// ---------------------------------------------------------------------------- -// events -// ---------------------------------------------------------------------------- - -DEFINE_EVENT_TYPE(wxEVT_GRID_CELL_LEFT_CLICK) -DEFINE_EVENT_TYPE(wxEVT_GRID_CELL_RIGHT_CLICK) -DEFINE_EVENT_TYPE(wxEVT_GRID_CELL_LEFT_DCLICK) -DEFINE_EVENT_TYPE(wxEVT_GRID_CELL_RIGHT_DCLICK) -DEFINE_EVENT_TYPE(wxEVT_GRID_CELL_BEGIN_DRAG) -DEFINE_EVENT_TYPE(wxEVT_GRID_LABEL_LEFT_CLICK) -DEFINE_EVENT_TYPE(wxEVT_GRID_LABEL_RIGHT_CLICK) -DEFINE_EVENT_TYPE(wxEVT_GRID_LABEL_LEFT_DCLICK) -DEFINE_EVENT_TYPE(wxEVT_GRID_LABEL_RIGHT_DCLICK) -DEFINE_EVENT_TYPE(wxEVT_GRID_ROW_SIZE) -DEFINE_EVENT_TYPE(wxEVT_GRID_COL_SIZE) -DEFINE_EVENT_TYPE(wxEVT_GRID_COL_MOVE) -DEFINE_EVENT_TYPE(wxEVT_GRID_RANGE_SELECT) -DEFINE_EVENT_TYPE(wxEVT_GRID_CELL_CHANGE) -DEFINE_EVENT_TYPE(wxEVT_GRID_SELECT_CELL) -DEFINE_EVENT_TYPE(wxEVT_GRID_EDITOR_SHOWN) -DEFINE_EVENT_TYPE(wxEVT_GRID_EDITOR_HIDDEN) -DEFINE_EVENT_TYPE(wxEVT_GRID_EDITOR_CREATED) - -// ---------------------------------------------------------------------------- -// private classes -// ---------------------------------------------------------------------------- - -// common base class for various grid subwindows -class WXDLLIMPEXP_ADV wxGridSubwindow : public wxWindow -{ -public: - wxGridSubwindow() { m_owner = NULL; } - wxGridSubwindow(wxGrid *owner, - wxWindowID id, - const wxPoint& pos, - const wxSize& size, - int additionalStyle = 0, - const wxString& name = wxPanelNameStr) - : wxWindow(owner, id, pos, size, - wxWANTS_CHARS | wxBORDER_NONE | additionalStyle, - name) - { - m_owner = owner; - } - - wxGrid *GetOwner() { return m_owner; } - -protected: - void OnMouseCaptureLost(wxMouseCaptureLostEvent& event); - - wxGrid *m_owner; - - DECLARE_EVENT_TABLE() - DECLARE_NO_COPY_CLASS(wxGridSubwindow) -}; - -class WXDLLIMPEXP_ADV wxGridRowLabelWindow : public wxGridSubwindow -{ -public: - wxGridRowLabelWindow() { } - wxGridRowLabelWindow( wxGrid *parent, wxWindowID id, - const wxPoint &pos, const wxSize &size ); - - virtual bool AcceptsFocus() const { return false; } - -private: - void OnPaint( wxPaintEvent& event ); - void OnMouseEvent( wxMouseEvent& event ); - void OnMouseWheel( wxMouseEvent& event ); - void OnKeyDown( wxKeyEvent& event ); - void OnKeyUp( wxKeyEvent& ); - void OnChar( wxKeyEvent& ); - - DECLARE_DYNAMIC_CLASS(wxGridRowLabelWindow) - DECLARE_EVENT_TABLE() - DECLARE_NO_COPY_CLASS(wxGridRowLabelWindow) -}; - - -class WXDLLIMPEXP_ADV wxGridColLabelWindow : public wxGridSubwindow -{ -public: - wxGridColLabelWindow() { } - wxGridColLabelWindow( wxGrid *parent, wxWindowID id, - const wxPoint &pos, const wxSize &size ); - - virtual bool AcceptsFocus() const { return false; } - -private: - void OnPaint( wxPaintEvent& event ); - void OnMouseEvent( wxMouseEvent& event ); - void OnMouseWheel( wxMouseEvent& event ); - void OnKeyDown( wxKeyEvent& event ); - void OnKeyUp( wxKeyEvent& ); - void OnChar( wxKeyEvent& ); - - DECLARE_DYNAMIC_CLASS(wxGridColLabelWindow) - DECLARE_EVENT_TABLE() - DECLARE_NO_COPY_CLASS(wxGridColLabelWindow) -}; - - -class WXDLLIMPEXP_ADV wxGridCornerLabelWindow : public wxGridSubwindow -{ -public: - wxGridCornerLabelWindow() { } - wxGridCornerLabelWindow( wxGrid *parent, wxWindowID id, - const wxPoint &pos, const wxSize &size ); - - virtual bool AcceptsFocus() const { return false; } - -private: - void OnMouseEvent( wxMouseEvent& event ); - void OnMouseWheel( wxMouseEvent& event ); - void OnKeyDown( wxKeyEvent& event ); - void OnKeyUp( wxKeyEvent& ); - void OnChar( wxKeyEvent& ); - void OnPaint( wxPaintEvent& event ); - - DECLARE_DYNAMIC_CLASS(wxGridCornerLabelWindow) - DECLARE_EVENT_TABLE() - DECLARE_NO_COPY_CLASS(wxGridCornerLabelWindow) -}; - -class WXDLLIMPEXP_ADV wxGridWindow : public wxGridSubwindow -{ -public: - wxGridWindow() - { - m_rowLabelWin = NULL; - m_colLabelWin = NULL; - } - - wxGridWindow( wxGrid *parent, - wxGridRowLabelWindow *rowLblWin, - wxGridColLabelWindow *colLblWin, - wxWindowID id, const wxPoint &pos, const wxSize &size ); - - void ScrollWindow( int dx, int dy, const wxRect *rect ); - -private: - wxGridRowLabelWindow *m_rowLabelWin; - wxGridColLabelWindow *m_colLabelWin; - - void OnPaint( wxPaintEvent &event ); - void OnMouseWheel( wxMouseEvent& event ); - void OnMouseEvent( wxMouseEvent& event ); - void OnKeyDown( wxKeyEvent& ); - void OnKeyUp( wxKeyEvent& ); - void OnChar( wxKeyEvent& ); - void OnEraseBackground( wxEraseEvent& ); - void OnFocus( wxFocusEvent& ); - - DECLARE_DYNAMIC_CLASS(wxGridWindow) - DECLARE_EVENT_TABLE() - DECLARE_NO_COPY_CLASS(wxGridWindow) -}; - - -class wxGridCellEditorEvtHandler : public wxEvtHandler -{ -public: - wxGridCellEditorEvtHandler(wxGrid* grid, wxGridCellEditor* editor) - : m_grid(grid), - m_editor(editor), - m_inSetFocus(false) - { - } - - void OnKillFocus(wxFocusEvent& event); - void OnKeyDown(wxKeyEvent& event); - void OnChar(wxKeyEvent& event); - - void SetInSetFocus(bool inSetFocus) { m_inSetFocus = inSetFocus; } - -private: - wxGrid *m_grid; - wxGridCellEditor *m_editor; - - // Work around the fact that a focus kill event can be sent to - // a combobox within a set focus event. - bool m_inSetFocus; - - DECLARE_EVENT_TABLE() - DECLARE_DYNAMIC_CLASS(wxGridCellEditorEvtHandler) - DECLARE_NO_COPY_CLASS(wxGridCellEditorEvtHandler) -}; - - -IMPLEMENT_ABSTRACT_CLASS(wxGridCellEditorEvtHandler, wxEvtHandler) - -BEGIN_EVENT_TABLE( wxGridCellEditorEvtHandler, wxEvtHandler ) - EVT_KILL_FOCUS( wxGridCellEditorEvtHandler::OnKillFocus ) - EVT_KEY_DOWN( wxGridCellEditorEvtHandler::OnKeyDown ) - EVT_CHAR( wxGridCellEditorEvtHandler::OnChar ) -END_EVENT_TABLE() - - -// ---------------------------------------------------------------------------- -// the internal data representation used by wxGridCellAttrProvider -// ---------------------------------------------------------------------------- - -// this class stores attributes set for cells -class WXDLLIMPEXP_ADV wxGridCellAttrData -{ -public: - void SetAttr(wxGridCellAttr *attr, int row, int col); - wxGridCellAttr *GetAttr(int row, int col) const; - void UpdateAttrRows( size_t pos, int numRows ); - void UpdateAttrCols( size_t pos, int numCols ); - -private: - // searches for the attr for given cell, returns wxNOT_FOUND if not found - int FindIndex(int row, int col) const; - - wxGridCellWithAttrArray m_attrs; -}; - -// this class stores attributes set for rows or columns -class WXDLLIMPEXP_ADV wxGridRowOrColAttrData -{ -public: - // empty ctor to suppress warnings - wxGridRowOrColAttrData() {} - ~wxGridRowOrColAttrData(); - - void SetAttr(wxGridCellAttr *attr, int rowOrCol); - wxGridCellAttr *GetAttr(int rowOrCol) const; - void UpdateAttrRowsOrCols( size_t pos, int numRowsOrCols ); - -private: - wxArrayInt m_rowsOrCols; - wxArrayAttrs m_attrs; -}; - -// NB: this is just a wrapper around 3 objects: one which stores cell -// attributes, and 2 others for row/col ones -class WXDLLIMPEXP_ADV wxGridCellAttrProviderData -{ -public: - wxGridCellAttrData m_cellAttrs; - wxGridRowOrColAttrData m_rowAttrs, - m_colAttrs; -}; - - -// ---------------------------------------------------------------------------- -// data structures used for the data type registry -// ---------------------------------------------------------------------------- - -struct wxGridDataTypeInfo -{ - wxGridDataTypeInfo(const wxString& typeName, - wxGridCellRenderer* renderer, - wxGridCellEditor* editor) - : m_typeName(typeName), m_renderer(renderer), m_editor(editor) - {} - - ~wxGridDataTypeInfo() - { - wxSafeDecRef(m_renderer); - wxSafeDecRef(m_editor); - } - - wxString m_typeName; - wxGridCellRenderer* m_renderer; - wxGridCellEditor* m_editor; - - DECLARE_NO_COPY_CLASS(wxGridDataTypeInfo) -}; - - -WX_DEFINE_ARRAY_WITH_DECL_PTR(wxGridDataTypeInfo*, wxGridDataTypeInfoArray, - class WXDLLIMPEXP_ADV); - - -class WXDLLIMPEXP_ADV wxGridTypeRegistry -{ -public: - wxGridTypeRegistry() {} - ~wxGridTypeRegistry(); - - void RegisterDataType(const wxString& typeName, - wxGridCellRenderer* renderer, - wxGridCellEditor* editor); - - // find one of already registered data types - int FindRegisteredDataType(const wxString& typeName); - - // try to FindRegisteredDataType(), if this fails and typeName is one of - // standard typenames, register it and return its index - int FindDataType(const wxString& typeName); - - // try to FindDataType(), if it fails see if it is not one of already - // registered data types with some params in which case clone the - // registered data type and set params for it - int FindOrCloneDataType(const wxString& typeName); - - wxGridCellRenderer* GetRenderer(int index); - wxGridCellEditor* GetEditor(int index); - -private: - wxGridDataTypeInfoArray m_typeinfo; -}; - - -// ---------------------------------------------------------------------------- -// conditional compilation -// ---------------------------------------------------------------------------- - -#ifndef WXGRID_DRAW_LINES -#define WXGRID_DRAW_LINES 1 -#endif - -// ---------------------------------------------------------------------------- -// globals -// ---------------------------------------------------------------------------- - -//#define DEBUG_ATTR_CACHE -#ifdef DEBUG_ATTR_CACHE - static size_t gs_nAttrCacheHits = 0; - static size_t gs_nAttrCacheMisses = 0; -#endif - -// ---------------------------------------------------------------------------- -// constants -// ---------------------------------------------------------------------------- - -wxGridCellCoords wxGridNoCellCoords( -1, -1 ); -wxRect wxGridNoCellRect( -1, -1, -1, -1 ); - -// scroll line size -// TODO: this doesn't work at all, grid cells have different sizes and approx -// calculations don't work as because of the size mismatch scrollbars -// sometimes fail to be shown when they should be or vice versa -// -// The scroll bars may be a little flakey once in a while, but that is -// surely much less horrible than having scroll lines of only 1!!! -// -- Robin -// -// Well, it's still seriously broken so it might be better but needs -// fixing anyhow -// -- Vadim -static const size_t GRID_SCROLL_LINE_X = 15; // 1; -static const size_t GRID_SCROLL_LINE_Y = GRID_SCROLL_LINE_X; - -// the size of hash tables used a bit everywhere (the max number of elements -// in these hash tables is the number of rows/columns) -static const int GRID_HASH_SIZE = 100; - -#if 0 -// ---------------------------------------------------------------------------- -// private functions -// ---------------------------------------------------------------------------- - -static inline int GetScrollX(int x) -{ - return (x + GRID_SCROLL_LINE_X - 1) / GRID_SCROLL_LINE_X; -} - -static inline int GetScrollY(int y) -{ - return (y + GRID_SCROLL_LINE_Y - 1) / GRID_SCROLL_LINE_Y; -} -#endif - -// ============================================================================ -// implementation -// ============================================================================ - -// ---------------------------------------------------------------------------- -// wxGridCellEditor -// ---------------------------------------------------------------------------- - -wxGridCellEditor::wxGridCellEditor() -{ - m_control = NULL; - m_attr = NULL; -} - -wxGridCellEditor::~wxGridCellEditor() -{ - Destroy(); -} - -void wxGridCellEditor::Create(wxWindow* WXUNUSED(parent), - wxWindowID WXUNUSED(id), - wxEvtHandler* evtHandler) -{ - if ( evtHandler ) - m_control->PushEventHandler(evtHandler); -} - -void wxGridCellEditor::PaintBackground(const wxRect& rectCell, - wxGridCellAttr *attr) -{ - // erase the background because we might not fill the cell - wxClientDC dc(m_control->GetParent()); - wxGridWindow* gridWindow = wxDynamicCast(m_control->GetParent(), wxGridWindow); - if (gridWindow) - gridWindow->GetOwner()->PrepareDC(dc); - - dc.SetPen(*wxTRANSPARENT_PEN); - dc.SetBrush(wxBrush(attr->GetBackgroundColour(), wxSOLID)); - dc.DrawRectangle(rectCell); - - // redraw the control we just painted over - m_control->Refresh(); -} - -void wxGridCellEditor::Destroy() -{ - if (m_control) - { - m_control->PopEventHandler( true /* delete it*/ ); - - m_control->Destroy(); - m_control = NULL; - } -} - -void wxGridCellEditor::Show(bool show, wxGridCellAttr *attr) -{ - wxASSERT_MSG(m_control, wxT("The wxGridCellEditor must be created first!")); - - m_control->Show(show); - - if ( show ) - { - // set the colours/fonts if we have any - if ( attr ) - { - m_colFgOld = m_control->GetForegroundColour(); - m_control->SetForegroundColour(attr->GetTextColour()); - - m_colBgOld = m_control->GetBackgroundColour(); - m_control->SetBackgroundColour(attr->GetBackgroundColour()); - -// Workaround for GTK+1 font setting problem on some platforms -#if !defined(__WXGTK__) || defined(__WXGTK20__) - m_fontOld = m_control->GetFont(); - m_control->SetFont(attr->GetFont()); -#endif - - // can't do anything more in the base class version, the other - // attributes may only be used by the derived classes - } - } - else - { - // restore the standard colours fonts - if ( m_colFgOld.Ok() ) - { - m_control->SetForegroundColour(m_colFgOld); - m_colFgOld = wxNullColour; - } - - if ( m_colBgOld.Ok() ) - { - m_control->SetBackgroundColour(m_colBgOld); - m_colBgOld = wxNullColour; - } - -// Workaround for GTK+1 font setting problem on some platforms -#if !defined(__WXGTK__) || defined(__WXGTK20__) - if ( m_fontOld.Ok() ) - { - m_control->SetFont(m_fontOld); - m_fontOld = wxNullFont; - } -#endif - } -} - -void wxGridCellEditor::SetSize(const wxRect& rect) -{ - wxASSERT_MSG(m_control, wxT("The wxGridCellEditor must be created first!")); - - m_control->SetSize(rect, wxSIZE_ALLOW_MINUS_ONE); -} - -void wxGridCellEditor::HandleReturn(wxKeyEvent& event) -{ - event.Skip(); -} - -bool wxGridCellEditor::IsAcceptedKey(wxKeyEvent& event) -{ - bool ctrl = event.ControlDown(); - bool alt = event.AltDown(); - -#ifdef __WXMAC__ - // On the Mac the Alt key is more like shift and is used for entry of - // valid characters, so check for Ctrl and Meta instead. - alt = event.MetaDown(); -#endif - - // Assume it's not a valid char if ctrl or alt is down, but if both are - // down then it may be because of an AltGr key combination, so let them - // through in that case. - if ((ctrl || alt) && !(ctrl && alt)) - return false; - - int key = 0; - bool keyOk = true; - -#ifdef __WXGTK20__ - // If it's a F-Key or other special key then it shouldn't start the - // editor. - if (event.GetKeyCode() >= WXK_START) - return false; -#endif -#if wxUSE_UNICODE - // if the unicode key code is not really a unicode character (it may - // be a function key or etc., the platforms appear to always give us a - // small value in this case) then fallback to the ASCII key code but - // don't do anything for function keys or etc. - key = event.GetUnicodeKey(); - if (key <= 127) - { - key = event.GetKeyCode(); - keyOk = (key <= 127); - } -#else - key = event.GetKeyCode(); - keyOk = (key <= 255); -#endif - - return keyOk; -} - -void wxGridCellEditor::StartingKey(wxKeyEvent& event) -{ - event.Skip(); -} - -void wxGridCellEditor::StartingClick() -{ -} - -#if wxUSE_TEXTCTRL - -// ---------------------------------------------------------------------------- -// wxGridCellTextEditor -// ---------------------------------------------------------------------------- - -wxGridCellTextEditor::wxGridCellTextEditor() -{ - m_maxChars = 0; -} - -void wxGridCellTextEditor::Create(wxWindow* parent, - wxWindowID id, - wxEvtHandler* evtHandler) -{ - m_control = new wxTextCtrl(parent, id, wxEmptyString, - wxDefaultPosition, wxDefaultSize -#if defined(__WXMSW__) - , - wxTE_PROCESS_ENTER | - wxTE_PROCESS_TAB | - wxTE_AUTO_SCROLL | - wxNO_BORDER -#endif - ); - - // set max length allowed in the textctrl, if the parameter was set - if (m_maxChars != 0) - { - ((wxTextCtrl*)m_control)->SetMaxLength(m_maxChars); - } - - wxGridCellEditor::Create(parent, id, evtHandler); -} - -void wxGridCellTextEditor::PaintBackground(const wxRect& WXUNUSED(rectCell), - wxGridCellAttr * WXUNUSED(attr)) -{ - // as we fill the entire client area, - // don't do anything here to minimize flicker -} - -void wxGridCellTextEditor::SetSize(const wxRect& rectOrig) -{ - wxRect rect(rectOrig); - - // Make the edit control large enough to allow for internal margins - // - // TODO: remove this if the text ctrl sizing is improved esp. for unix - // -#if defined(__WXGTK__) - if (rect.x != 0) - { - rect.x += 1; - rect.y += 1; - rect.width -= 1; - rect.height -= 1; - } -#elif defined(__WXMSW__) - if ( rect.x == 0 ) - rect.x += 2; - else - rect.x += 3; - - if ( rect.y == 0 ) - rect.y += 2; - else - rect.y += 3; - - rect.width -= 2; - rect.height -= 2; -#else - int extra_x = ( rect.x > 2 ) ? 2 : 1; - int extra_y = ( rect.y > 2 ) ? 2 : 1; - - #if defined(__WXMOTIF__) - extra_x *= 2; - extra_y *= 2; - #endif - - rect.SetLeft( wxMax(0, rect.x - extra_x) ); - rect.SetTop( wxMax(0, rect.y - extra_y) ); - rect.SetRight( rect.GetRight() + 2 * extra_x ); - rect.SetBottom( rect.GetBottom() + 2 * extra_y ); -#endif - - wxGridCellEditor::SetSize(rect); -} - -void wxGridCellTextEditor::BeginEdit(int row, int col, wxGrid* grid) -{ - wxASSERT_MSG(m_control, wxT("The wxGridCellEditor must be created first!")); - - m_startValue = grid->GetTable()->GetValue(row, col); - - DoBeginEdit(m_startValue); -} - -void wxGridCellTextEditor::DoBeginEdit(const wxString& startValue) -{ - Text()->SetValue(startValue); - Text()->SetInsertionPointEnd(); - Text()->SetSelection(-1, -1); - Text()->SetFocus(); -} - -bool wxGridCellTextEditor::EndEdit(int row, int col, wxGrid* grid) -{ - wxASSERT_MSG(m_control, wxT("The wxGridCellEditor must be created first!")); - - bool changed = false; - wxString value = Text()->GetValue(); - if (value != m_startValue) - changed = true; - - if (changed) - grid->GetTable()->SetValue(row, col, value); - - m_startValue = wxEmptyString; - - // No point in setting the text of the hidden control - //Text()->SetValue(m_startValue); - - return changed; -} - -void wxGridCellTextEditor::Reset() -{ - wxASSERT_MSG(m_control, wxT("The wxGridCellEditor must be created first!")); - - DoReset(m_startValue); -} - -void wxGridCellTextEditor::DoReset(const wxString& startValue) -{ - Text()->SetValue(startValue); - Text()->SetInsertionPointEnd(); -} - -bool wxGridCellTextEditor::IsAcceptedKey(wxKeyEvent& event) -{ - return wxGridCellEditor::IsAcceptedKey(event); -} - -void wxGridCellTextEditor::StartingKey(wxKeyEvent& event) -{ - // Since this is now happening in the EVT_CHAR event EmulateKeyPress is no - // longer an appropriate way to get the character into the text control. - // Do it ourselves instead. We know that if we get this far that we have - // a valid character, so not a whole lot of testing needs to be done. - - wxTextCtrl* tc = Text(); - wxChar ch; - long pos; - -#if wxUSE_UNICODE - ch = event.GetUnicodeKey(); - if (ch <= 127) - ch = (wxChar)event.GetKeyCode(); -#else - ch = (wxChar)event.GetKeyCode(); -#endif - - switch (ch) - { - case WXK_DELETE: - // delete the character at the cursor - pos = tc->GetInsertionPoint(); - if (pos < tc->GetLastPosition()) - tc->Remove(pos, pos + 1); - break; - - case WXK_BACK: - // delete the character before the cursor - pos = tc->GetInsertionPoint(); - if (pos > 0) - tc->Remove(pos - 1, pos); - break; - - default: - tc->WriteText(ch); - break; - } -} - -void wxGridCellTextEditor::HandleReturn( wxKeyEvent& - WXUNUSED_GTK(WXUNUSED_MOTIF(event)) ) -{ -#if defined(__WXMOTIF__) || defined(__WXGTK__) - // wxMotif needs a little extra help... - size_t pos = (size_t)( Text()->GetInsertionPoint() ); - wxString s( Text()->GetValue() ); - s = s.Left(pos) + wxT("\n") + s.Mid(pos); - Text()->SetValue(s); - Text()->SetInsertionPoint( pos ); -#else - // the other ports can handle a Return key press - // - event.Skip(); -#endif -} - -void wxGridCellTextEditor::SetParameters(const wxString& params) -{ - if ( !params ) - { - // reset to default - m_maxChars = 0; - } - else - { - long tmp; - if ( params.ToLong(&tmp) ) - { - m_maxChars = (size_t)tmp; - } - else - { - wxLogDebug( _T("Invalid wxGridCellTextEditor parameter string '%s' ignored"), params.c_str() ); - } - } -} - -// return the value in the text control -wxString wxGridCellTextEditor::GetValue() const -{ - return Text()->GetValue(); -} - -// ---------------------------------------------------------------------------- -// wxGridCellNumberEditor -// ---------------------------------------------------------------------------- - -wxGridCellNumberEditor::wxGridCellNumberEditor(int min, int max) -{ - m_min = min; - m_max = max; -} - -void wxGridCellNumberEditor::Create(wxWindow* parent, - wxWindowID id, - wxEvtHandler* evtHandler) -{ -#if wxUSE_SPINCTRL - if ( HasRange() ) - { - // create a spin ctrl - m_control = new wxSpinCtrl(parent, wxID_ANY, wxEmptyString, - wxDefaultPosition, wxDefaultSize, - wxSP_ARROW_KEYS, - m_min, m_max); - - wxGridCellEditor::Create(parent, id, evtHandler); - } - else -#endif - { - // just a text control - wxGridCellTextEditor::Create(parent, id, evtHandler); - -#if wxUSE_VALIDATORS - Text()->SetValidator(wxTextValidator(wxFILTER_NUMERIC)); -#endif - } -} - -void wxGridCellNumberEditor::BeginEdit(int row, int col, wxGrid* grid) -{ - // first get the value - wxGridTableBase *table = grid->GetTable(); - if ( table->CanGetValueAs(row, col, wxGRID_VALUE_NUMBER) ) - { - m_valueOld = table->GetValueAsLong(row, col); - } - else - { - m_valueOld = 0; - wxString sValue = table->GetValue(row, col); - if (! sValue.ToLong(&m_valueOld) && ! sValue.empty()) - { - wxFAIL_MSG( _T("this cell doesn't have numeric value") ); - return; - } - } - -#if wxUSE_SPINCTRL - if ( HasRange() ) - { - Spin()->SetValue((int)m_valueOld); - Spin()->SetFocus(); - } - else -#endif - { - DoBeginEdit(GetString()); - } -} - -bool wxGridCellNumberEditor::EndEdit(int row, int col, - wxGrid* grid) -{ - long value = 0; - wxString text; - -#if wxUSE_SPINCTRL - if ( HasRange() ) - { - value = Spin()->GetValue(); - if ( value == m_valueOld ) - return false; - - text.Printf(wxT("%ld"), value); - } - else // using unconstrained input -#endif // wxUSE_SPINCTRL - { - const wxString textOld(grid->GetCellValue(row, col)); - text = Text()->GetValue(); - if ( text.empty() ) - { - if ( textOld.empty() ) - return false; - } - else // non-empty text now (maybe 0) - { - if ( !text.ToLong(&value) ) - return false; - - // if value == m_valueOld == 0 but old text was "" and new one is - // "0" something still did change - if ( value == m_valueOld && (value || !textOld.empty()) ) - return false; - } - } - - wxGridTableBase * const table = grid->GetTable(); - if ( table->CanSetValueAs(row, col, wxGRID_VALUE_NUMBER) ) - table->SetValueAsLong(row, col, value); - else - table->SetValue(row, col, text); - - return true; -} - -void wxGridCellNumberEditor::Reset() -{ -#if wxUSE_SPINCTRL - if ( HasRange() ) - { - Spin()->SetValue((int)m_valueOld); - } - else -#endif - { - DoReset(GetString()); - } -} - -bool wxGridCellNumberEditor::IsAcceptedKey(wxKeyEvent& event) -{ - if ( wxGridCellEditor::IsAcceptedKey(event) ) - { - int keycode = event.GetKeyCode(); - if ( (keycode < 128) && - (wxIsdigit(keycode) || keycode == '+' || keycode == '-')) - { - return true; - } - } - - return false; -} - -void wxGridCellNumberEditor::StartingKey(wxKeyEvent& event) -{ - int keycode = event.GetKeyCode(); - if ( !HasRange() ) - { - if ( wxIsdigit(keycode) || keycode == '+' || keycode == '-') - { - wxGridCellTextEditor::StartingKey(event); - - // skip Skip() below - return; - } - } -#if wxUSE_SPINCTRL - else - { - if ( wxIsdigit(keycode) ) - { - wxSpinCtrl* spin = (wxSpinCtrl*)m_control; - spin->SetValue(keycode - '0'); - spin->SetSelection(1,1); - return; - } - } -#endif - - event.Skip(); -} - -void wxGridCellNumberEditor::SetParameters(const wxString& params) -{ - if ( !params ) - { - // reset to default - m_min = - m_max = -1; - } - else - { - long tmp; - if ( params.BeforeFirst(_T(',')).ToLong(&tmp) ) - { - m_min = (int)tmp; - - if ( params.AfterFirst(_T(',')).ToLong(&tmp) ) - { - m_max = (int)tmp; - - // skip the error message below - return; - } - } - - wxLogDebug(_T("Invalid wxGridCellNumberEditor parameter string '%s' ignored"), params.c_str()); - } -} - -// return the value in the spin control if it is there (the text control otherwise) -wxString wxGridCellNumberEditor::GetValue() const -{ - wxString s; - -#if wxUSE_SPINCTRL - if ( HasRange() ) - { - long value = Spin()->GetValue(); - s.Printf(wxT("%ld"), value); - } - else -#endif - { - s = Text()->GetValue(); - } - - return s; -} - -// ---------------------------------------------------------------------------- -// wxGridCellFloatEditor -// ---------------------------------------------------------------------------- - -wxGridCellFloatEditor::wxGridCellFloatEditor(int width, int precision) -{ - m_width = width; - m_precision = precision; -} - -void wxGridCellFloatEditor::Create(wxWindow* parent, - wxWindowID id, - wxEvtHandler* evtHandler) -{ - wxGridCellTextEditor::Create(parent, id, evtHandler); - -#if wxUSE_VALIDATORS - Text()->SetValidator(wxTextValidator(wxFILTER_NUMERIC)); -#endif -} - -void wxGridCellFloatEditor::BeginEdit(int row, int col, wxGrid* grid) -{ - // first get the value - wxGridTableBase * const table = grid->GetTable(); - if ( table->CanGetValueAs(row, col, wxGRID_VALUE_FLOAT) ) - { - m_valueOld = table->GetValueAsDouble(row, col); - } - else - { - m_valueOld = 0.0; - - const wxString value = table->GetValue(row, col); - if ( !value.empty() ) - { - if ( !value.ToDouble(&m_valueOld) ) - { - wxFAIL_MSG( _T("this cell doesn't have float value") ); - return; - } - } - } - - DoBeginEdit(GetString()); -} - -bool wxGridCellFloatEditor::EndEdit(int row, int col, wxGrid* grid) -{ - const wxString text(Text()->GetValue()), - textOld(grid->GetCellValue(row, col)); - - double value; - if ( !text.empty() ) - { - if ( !text.ToDouble(&value) ) - return false; - } - else // new value is empty string - { - if ( textOld.empty() ) - return false; // nothing changed - - value = 0.; - } - - // the test for empty strings ensures that we don't skip the value setting - // when "" is replaced by "0" or vice versa as "" numeric value is also 0. - if ( wxIsSameDouble(value, m_valueOld) && !text.empty() && !textOld.empty() ) - return false; // nothing changed - - wxGridTableBase * const table = grid->GetTable(); - - if ( table->CanSetValueAs(row, col, wxGRID_VALUE_FLOAT) ) - table->SetValueAsDouble(row, col, value); - else - table->SetValue(row, col, text); - - return true; -} - -void wxGridCellFloatEditor::Reset() -{ - DoReset(GetString()); -} - -void wxGridCellFloatEditor::StartingKey(wxKeyEvent& event) -{ - int keycode = event.GetKeyCode(); - char tmpbuf[2]; - tmpbuf[0] = (char) keycode; - tmpbuf[1] = '\0'; - wxString strbuf(tmpbuf, *wxConvCurrent); - -#if wxUSE_INTL - bool is_decimal_point = ( strbuf == - wxLocale::GetInfo(wxLOCALE_DECIMAL_POINT, wxLOCALE_CAT_NUMBER) ); -#else - bool is_decimal_point = ( strbuf == _T(".") ); -#endif - - if ( wxIsdigit(keycode) || keycode == '+' || keycode == '-' - || is_decimal_point ) - { - wxGridCellTextEditor::StartingKey(event); - - // skip Skip() below - return; - } - - event.Skip(); -} - -void wxGridCellFloatEditor::SetParameters(const wxString& params) -{ - if ( !params ) - { - // reset to default - m_width = - m_precision = -1; - } - else - { - long tmp; - if ( params.BeforeFirst(_T(',')).ToLong(&tmp) ) - { - m_width = (int)tmp; - - if ( params.AfterFirst(_T(',')).ToLong(&tmp) ) - { - m_precision = (int)tmp; - - // skip the error message below - return; - } - } - - wxLogDebug(_T("Invalid wxGridCellFloatEditor parameter string '%s' ignored"), params.c_str()); - } -} - -wxString wxGridCellFloatEditor::GetString() const -{ - wxString fmt; - if ( m_precision == -1 && m_width != -1) - { - // default precision - fmt.Printf(_T("%%%d.f"), m_width); - } - else if ( m_precision != -1 && m_width == -1) - { - // default width - fmt.Printf(_T("%%.%df"), m_precision); - } - else if ( m_precision != -1 && m_width != -1 ) - { - fmt.Printf(_T("%%%d.%df"), m_width, m_precision); - } - else - { - // default width/precision - fmt = _T("%f"); - } - - return wxString::Format(fmt, m_valueOld); -} - -bool wxGridCellFloatEditor::IsAcceptedKey(wxKeyEvent& event) -{ - if ( wxGridCellEditor::IsAcceptedKey(event) ) - { - const int keycode = event.GetKeyCode(); - if ( isascii(keycode) ) - { - char tmpbuf[2]; - tmpbuf[0] = (char) keycode; - tmpbuf[1] = '\0'; - wxString strbuf(tmpbuf, *wxConvCurrent); - -#if wxUSE_INTL - const wxString decimalPoint = - wxLocale::GetInfo(wxLOCALE_DECIMAL_POINT, wxLOCALE_CAT_NUMBER); -#else - const wxString decimalPoint(_T('.')); -#endif - - // accept digits, 'e' as in '1e+6', also '-', '+', and '.' - if ( wxIsdigit(keycode) || - tolower(keycode) == 'e' || - keycode == decimalPoint || - keycode == '+' || - keycode == '-' ) - { - return true; - } - } - } - - return false; -} - -#endif // wxUSE_TEXTCTRL - -#if wxUSE_CHECKBOX - -// ---------------------------------------------------------------------------- -// wxGridCellBoolEditor -// ---------------------------------------------------------------------------- - -// the default values for GetValue() -wxString wxGridCellBoolEditor::ms_stringValues[2] = { _T(""), _T("1") }; - -void wxGridCellBoolEditor::Create(wxWindow* parent, - wxWindowID id, - wxEvtHandler* evtHandler) -{ - m_control = new wxCheckBox(parent, id, wxEmptyString, - wxDefaultPosition, wxDefaultSize, - wxNO_BORDER); - - wxGridCellEditor::Create(parent, id, evtHandler); -} - -void wxGridCellBoolEditor::SetSize(const wxRect& r) -{ - bool resize = false; - wxSize size = m_control->GetSize(); - wxCoord minSize = wxMin(r.width, r.height); - - // check if the checkbox is not too big/small for this cell - wxSize sizeBest = m_control->GetBestSize(); - if ( !(size == sizeBest) ) - { - // reset to default size if it had been made smaller - size = sizeBest; - - resize = true; - } - - if ( size.x >= minSize || size.y >= minSize ) - { - // leave 1 pixel margin - size.x = size.y = minSize - 2; - - resize = true; - } - - if ( resize ) - { - m_control->SetSize(size); - } - - // position it in the centre of the rectangle (TODO: support alignment?) - -#if defined(__WXGTK__) || defined (__WXMOTIF__) - // the checkbox without label still has some space to the right in wxGTK, - // so shift it to the right - size.x -= 8; -#elif defined(__WXMSW__) - // here too, but in other way - size.x += 1; - size.y -= 2; -#endif - - int hAlign = wxALIGN_CENTRE; - int vAlign = wxALIGN_CENTRE; - if (GetCellAttr()) - GetCellAttr()->GetAlignment(& hAlign, & vAlign); - - int x = 0, y = 0; - if (hAlign == wxALIGN_LEFT) - { - x = r.x + 2; - -#ifdef __WXMSW__ - x += 2; -#endif - - y = r.y + r.height / 2 - size.y / 2; - } - else if (hAlign == wxALIGN_RIGHT) - { - x = r.x + r.width - size.x - 2; - y = r.y + r.height / 2 - size.y / 2; - } - else if (hAlign == wxALIGN_CENTRE) - { - x = r.x + r.width / 2 - size.x / 2; - y = r.y + r.height / 2 - size.y / 2; - } - - m_control->Move(x, y); -} - -void wxGridCellBoolEditor::Show(bool show, wxGridCellAttr *attr) -{ - m_control->Show(show); - - if ( show ) - { - wxColour colBg = attr ? attr->GetBackgroundColour() : *wxLIGHT_GREY; - CBox()->SetBackgroundColour(colBg); - } -} - -void wxGridCellBoolEditor::BeginEdit(int row, int col, wxGrid* grid) -{ - wxASSERT_MSG(m_control, - wxT("The wxGridCellEditor must be created first!")); - - if (grid->GetTable()->CanGetValueAs(row, col, wxGRID_VALUE_BOOL)) - { - m_startValue = grid->GetTable()->GetValueAsBool(row, col); - } - else - { - wxString cellval( grid->GetTable()->GetValue(row, col) ); - - if ( cellval == ms_stringValues[false] ) - m_startValue = false; - else if ( cellval == ms_stringValues[true] ) - m_startValue = true; - else - { - // do not try to be smart here and convert it to true or false - // because we'll still overwrite it with something different and - // this risks to be very surprising for the user code, let them - // know about it - wxFAIL_MSG( _T("invalid value for a cell with bool editor!") ); - } - } - - CBox()->SetValue(m_startValue); - CBox()->SetFocus(); -} - -bool wxGridCellBoolEditor::EndEdit(int row, int col, - wxGrid* grid) -{ - wxASSERT_MSG(m_control, - wxT("The wxGridCellEditor must be created first!")); - - bool changed = false; - bool value = CBox()->GetValue(); - if ( value != m_startValue ) - changed = true; - - if ( changed ) - { - wxGridTableBase * const table = grid->GetTable(); - if ( table->CanGetValueAs(row, col, wxGRID_VALUE_BOOL) ) - table->SetValueAsBool(row, col, value); - else - table->SetValue(row, col, GetValue()); - } - - return changed; -} - -void wxGridCellBoolEditor::Reset() -{ - wxASSERT_MSG(m_control, - wxT("The wxGridCellEditor must be created first!")); - - CBox()->SetValue(m_startValue); -} - -void wxGridCellBoolEditor::StartingClick() -{ - CBox()->SetValue(!CBox()->GetValue()); -} - -bool wxGridCellBoolEditor::IsAcceptedKey(wxKeyEvent& event) -{ - if ( wxGridCellEditor::IsAcceptedKey(event) ) - { - int keycode = event.GetKeyCode(); - switch ( keycode ) - { - case WXK_SPACE: - case '+': - case '-': - return true; - } - } - - return false; -} - -void wxGridCellBoolEditor::StartingKey(wxKeyEvent& event) -{ - int keycode = event.GetKeyCode(); - switch ( keycode ) - { - case WXK_SPACE: - CBox()->SetValue(!CBox()->GetValue()); - break; - - case '+': - CBox()->SetValue(true); - break; - - case '-': - CBox()->SetValue(false); - break; - } -} - -wxString wxGridCellBoolEditor::GetValue() const -{ - return ms_stringValues[CBox()->GetValue()]; -} - -/* static */ void -wxGridCellBoolEditor::UseStringValues(const wxString& valueTrue, - const wxString& valueFalse) -{ - ms_stringValues[false] = valueFalse; - ms_stringValues[true] = valueTrue; -} - -/* static */ bool -wxGridCellBoolEditor::IsTrueValue(const wxString& value) -{ - return value == ms_stringValues[true]; -} - -#endif // wxUSE_CHECKBOX - -#if wxUSE_COMBOBOX - -// ---------------------------------------------------------------------------- -// wxGridCellChoiceEditor -// ---------------------------------------------------------------------------- - -wxGridCellChoiceEditor::wxGridCellChoiceEditor(const wxArrayString& choices, - bool allowOthers) - : m_choices(choices), - m_allowOthers(allowOthers) { } - -wxGridCellChoiceEditor::wxGridCellChoiceEditor(size_t count, - const wxString choices[], - bool allowOthers) - : m_allowOthers(allowOthers) -{ - if ( count ) - { - m_choices.Alloc(count); - for ( size_t n = 0; n < count; n++ ) - { - m_choices.Add(choices[n]); - } - } -} - -wxGridCellEditor *wxGridCellChoiceEditor::Clone() const -{ - wxGridCellChoiceEditor *editor = new wxGridCellChoiceEditor; - editor->m_allowOthers = m_allowOthers; - editor->m_choices = m_choices; - - return editor; -} - -void wxGridCellChoiceEditor::Create(wxWindow* parent, - wxWindowID id, - wxEvtHandler* evtHandler) -{ - int style = wxTE_PROCESS_ENTER | - wxTE_PROCESS_TAB | - wxBORDER_NONE; - - if ( !m_allowOthers ) - style |= wxCB_READONLY; - - m_control = new wxComboBox(parent, id, wxEmptyString, - wxDefaultPosition, wxDefaultSize, - m_choices, - style); - - wxGridCellEditor::Create(parent, id, evtHandler); -} - -void wxGridCellChoiceEditor::PaintBackground(const wxRect& rectCell, - wxGridCellAttr * attr) -{ - // as we fill the entire client area, don't do anything here to minimize - // flicker - - // TODO: It doesn't actually fill the client area since the height of a - // combo always defaults to the standard. Until someone has time to - // figure out the right rectangle to paint, just do it the normal way. - wxGridCellEditor::PaintBackground(rectCell, attr); -} - -void wxGridCellChoiceEditor::BeginEdit(int row, int col, wxGrid* grid) -{ - wxASSERT_MSG(m_control, - wxT("The wxGridCellEditor must be created first!")); - - wxGridCellEditorEvtHandler* evtHandler = NULL; - if (m_control) - evtHandler = wxDynamicCast(m_control->GetEventHandler(), wxGridCellEditorEvtHandler); - - // Don't immediately end if we get a kill focus event within BeginEdit - if (evtHandler) - evtHandler->SetInSetFocus(true); - - m_startValue = grid->GetTable()->GetValue(row, col); - - if (m_allowOthers) - { - Combo()->SetValue(m_startValue); - } - else - { - // find the right position, or default to the first if not found - int pos = Combo()->FindString(m_startValue); - if (pos == wxNOT_FOUND) - pos = 0; - Combo()->SetSelection(pos); - } - - Combo()->SetInsertionPointEnd(); - Combo()->SetFocus(); - - if (evtHandler) - { - // When dropping down the menu, a kill focus event - // happens after this point, so we can't reset the flag yet. -#if !defined(__WXGTK20__) - evtHandler->SetInSetFocus(false); -#endif - } -} - -bool wxGridCellChoiceEditor::EndEdit(int row, int col, - wxGrid* grid) -{ - wxString value = Combo()->GetValue(); - if ( value == m_startValue ) - return false; - - grid->GetTable()->SetValue(row, col, value); - - return true; -} - -void wxGridCellChoiceEditor::Reset() -{ - Combo()->SetValue(m_startValue); - Combo()->SetInsertionPointEnd(); -} - -void wxGridCellChoiceEditor::SetParameters(const wxString& params) -{ - if ( !params ) - { - // what can we do? - return; - } - - m_choices.Empty(); - - wxStringTokenizer tk(params, _T(',')); - while ( tk.HasMoreTokens() ) - { - m_choices.Add(tk.GetNextToken()); - } -} - -// return the value in the text control -wxString wxGridCellChoiceEditor::GetValue() const -{ - return Combo()->GetValue(); -} - -#endif // wxUSE_COMBOBOX - -// ---------------------------------------------------------------------------- -// wxGridCellEditorEvtHandler -// ---------------------------------------------------------------------------- - -void wxGridCellEditorEvtHandler::OnKillFocus(wxFocusEvent& event) -{ - // Don't disable the cell if we're just starting to edit it - if (m_inSetFocus) - return; - - // accept changes - m_grid->DisableCellEditControl(); - - event.Skip(); -} - -void wxGridCellEditorEvtHandler::OnKeyDown(wxKeyEvent& event) -{ - switch ( event.GetKeyCode() ) - { - case WXK_ESCAPE: - m_editor->Reset(); - m_grid->DisableCellEditControl(); - break; - - case WXK_TAB: - m_grid->GetEventHandler()->ProcessEvent( event ); - break; - - case WXK_RETURN: - case WXK_NUMPAD_ENTER: - if (!m_grid->GetEventHandler()->ProcessEvent(event)) - m_editor->HandleReturn(event); - break; - - default: - event.Skip(); - break; - } -} - -void wxGridCellEditorEvtHandler::OnChar(wxKeyEvent& event) -{ - int row = m_grid->GetGridCursorRow(); - int col = m_grid->GetGridCursorCol(); - wxRect rect = m_grid->CellToRect( row, col ); - int cw, ch; - m_grid->GetGridWindow()->GetClientSize( &cw, &ch ); - - // if cell width is smaller than grid client area, cell is wholly visible - bool wholeCellVisible = (rect.GetWidth() < cw); - - switch ( event.GetKeyCode() ) - { - case WXK_ESCAPE: - case WXK_TAB: - case WXK_RETURN: - case WXK_NUMPAD_ENTER: - break; - - case WXK_HOME: - { - if ( wholeCellVisible ) - { - // no special processing needed... - event.Skip(); - break; - } - - // do special processing for partly visible cell... - - // get the widths of all cells previous to this one - int colXPos = 0; - for ( int i = 0; i < col; i++ ) - { - colXPos += m_grid->GetColSize(i); - } - - int xUnit = 1, yUnit = 1; - m_grid->GetScrollPixelsPerUnit(&xUnit, &yUnit); - if (col != 0) - { - m_grid->Scroll(colXPos / xUnit - 1, m_grid->GetScrollPos(wxVERTICAL)); - } - else - { - m_grid->Scroll(colXPos / xUnit, m_grid->GetScrollPos(wxVERTICAL)); - } - event.Skip(); - break; - } - - case WXK_END: - { - if ( wholeCellVisible ) - { - // no special processing needed... - event.Skip(); - break; - } - - // do special processing for partly visible cell... - - int textWidth = 0; - wxString value = m_grid->GetCellValue(row, col); - if ( wxEmptyString != value ) - { - // get width of cell CONTENTS (text) - int y; - wxFont font = m_grid->GetCellFont(row, col); - m_grid->GetTextExtent(value, &textWidth, &y, NULL, NULL, &font); - - // try to RIGHT align the text by scrolling - int client_right = m_grid->GetGridWindow()->GetClientSize().GetWidth(); - - // (m_grid->GetScrollLineX()*2) is a factor for not scrolling to far, - // otherwise the last part of the cell content might be hidden below the scroll bar - // FIXME: maybe there is a more suitable correction? - textWidth -= (client_right - (m_grid->GetScrollLineX() * 2)); - if ( textWidth < 0 ) - { - textWidth = 0; - } - } - - // get the widths of all cells previous to this one - int colXPos = 0; - for ( int i = 0; i < col; i++ ) - { - colXPos += m_grid->GetColSize(i); - } - - // and add the (modified) text width of the cell contents - // as we'd like to see the last part of the cell contents - colXPos += textWidth; - - int xUnit = 1, yUnit = 1; - m_grid->GetScrollPixelsPerUnit(&xUnit, &yUnit); - m_grid->Scroll(colXPos / xUnit - 1, m_grid->GetScrollPos(wxVERTICAL)); - event.Skip(); - break; - } - - default: - event.Skip(); - break; - } -} - -// ---------------------------------------------------------------------------- -// wxGridCellWorker is an (almost) empty common base class for -// wxGridCellRenderer and wxGridCellEditor managing ref counting -// ---------------------------------------------------------------------------- - -void wxGridCellWorker::SetParameters(const wxString& WXUNUSED(params)) -{ - // nothing to do -} - -wxGridCellWorker::~wxGridCellWorker() -{ -} - -// ============================================================================ -// renderer classes -// ============================================================================ - -// ---------------------------------------------------------------------------- -// wxGridCellRenderer -// ---------------------------------------------------------------------------- - -void wxGridCellRenderer::Draw(wxGrid& grid, - wxGridCellAttr& attr, - wxDC& dc, - const wxRect& rect, - int WXUNUSED(row), int WXUNUSED(col), - bool isSelected) -{ - dc.SetBackgroundMode( wxSOLID ); - - // grey out fields if the grid is disabled - if ( grid.IsEnabled() ) - { - if ( isSelected ) - { - wxColour clr; - if ( wxWindow::FindFocus() == grid.GetGridWindow() ) - clr = grid.GetSelectionBackground(); - else - clr = wxSystemSettings::GetColour(wxSYS_COLOUR_BTNSHADOW); - dc.SetBrush( wxBrush(clr, wxSOLID) ); - } - else - { - dc.SetBrush( wxBrush(attr.GetBackgroundColour(), wxSOLID) ); - } - } - else - { - dc.SetBrush(wxBrush(wxSystemSettings::GetColour(wxSYS_COLOUR_BTNFACE), wxSOLID)); - } - - dc.SetPen( *wxTRANSPARENT_PEN ); - dc.DrawRectangle(rect); -} - -// ---------------------------------------------------------------------------- -// wxGridCellStringRenderer -// ---------------------------------------------------------------------------- - -void wxGridCellStringRenderer::SetTextColoursAndFont(const wxGrid& grid, - const wxGridCellAttr& attr, - wxDC& dc, - bool isSelected) -{ - dc.SetBackgroundMode( wxTRANSPARENT ); - - // TODO some special colours for attr.IsReadOnly() case? - - // different coloured text when the grid is disabled - if ( grid.IsEnabled() ) - { - if ( isSelected ) - { - wxColour clr; - if ( wxWindow::FindFocus() == - wx_const_cast(wxGrid&, grid).GetGridWindow() ) - clr = grid.GetSelectionBackground(); - else - clr = wxSystemSettings::GetColour(wxSYS_COLOUR_BTNSHADOW); - dc.SetTextBackground( clr ); - dc.SetTextForeground( grid.GetSelectionForeground() ); - } - else - { - dc.SetTextBackground( attr.GetBackgroundColour() ); - dc.SetTextForeground( attr.GetTextColour() ); - } - } - else - { - dc.SetTextBackground(wxSystemSettings::GetColour(wxSYS_COLOUR_BTNFACE)); - dc.SetTextForeground(wxSystemSettings::GetColour(wxSYS_COLOUR_GRAYTEXT)); - } - - dc.SetFont( attr.GetFont() ); -} - -wxSize wxGridCellStringRenderer::DoGetBestSize(const wxGridCellAttr& attr, - wxDC& dc, - const wxString& text) -{ - wxCoord x = 0, y = 0, max_x = 0; - dc.SetFont(attr.GetFont()); - wxStringTokenizer tk(text, _T('\n')); - while ( tk.HasMoreTokens() ) - { - dc.GetTextExtent(tk.GetNextToken(), &x, &y); - max_x = wxMax(max_x, x); - } - - y *= 1 + text.Freq(wxT('\n')); // multiply by the number of lines. - - return wxSize(max_x, y); -} - -wxSize wxGridCellStringRenderer::GetBestSize(wxGrid& grid, - wxGridCellAttr& attr, - wxDC& dc, - int row, int col) -{ - return DoGetBestSize(attr, dc, grid.GetCellValue(row, col)); -} - -void wxGridCellStringRenderer::Draw(wxGrid& grid, - wxGridCellAttr& attr, - wxDC& dc, - const wxRect& rectCell, - int row, int col, - bool isSelected) -{ - wxRect rect = rectCell; - rect.Inflate(-1); - - // erase only this cells background, overflow cells should have been erased - wxGridCellRenderer::Draw(grid, attr, dc, rectCell, row, col, isSelected); - - int hAlign, vAlign; - attr.GetAlignment(&hAlign, &vAlign); - - int overflowCols = 0; - - if (attr.GetOverflow()) - { - int cols = grid.GetNumberCols(); - int best_width = GetBestSize(grid,attr,dc,row,col).GetWidth(); - int cell_rows, cell_cols; - attr.GetSize( &cell_rows, &cell_cols ); // shouldn't get here if <= 0 - if ((best_width > rectCell.width) && (col < cols) && grid.GetTable()) - { - int i, c_cols, c_rows; - for (i = col+cell_cols; i < cols; i++) - { - bool is_empty = true; - for (int j=row; j < row + cell_rows; j++) - { - // check w/ anchor cell for multicell block - grid.GetCellSize(j, i, &c_rows, &c_cols); - if (c_rows > 0) - c_rows = 0; - if (!grid.GetTable()->IsEmptyCell(j + c_rows, i)) - { - is_empty = false; - break; - } - } - - if (is_empty) - { - rect.width += grid.GetColSize(i); - } - else - { - i--; - break; - } - - if (rect.width >= best_width) - break; - } - - overflowCols = i - col - cell_cols + 1; - if (overflowCols >= cols) - overflowCols = cols - 1; - } - - if (overflowCols > 0) // redraw overflow cells w/ proper hilight - { - hAlign = wxALIGN_LEFT; // if oveflowed then it's left aligned - wxRect clip = rect; - clip.x += rectCell.width; - // draw each overflow cell individually - int col_end = col + cell_cols + overflowCols; - if (col_end >= grid.GetNumberCols()) - col_end = grid.GetNumberCols() - 1; - for (int i = col + cell_cols; i <= col_end; i++) - { - clip.width = grid.GetColSize(i) - 1; - dc.DestroyClippingRegion(); - dc.SetClippingRegion(clip); - - SetTextColoursAndFont(grid, attr, dc, - grid.IsInSelection(row,i)); - - grid.DrawTextRectangle(dc, grid.GetCellValue(row, col), - rect, hAlign, vAlign); - clip.x += grid.GetColSize(i) - 1; - } - - rect = rectCell; - rect.Inflate(-1); - rect.width++; - dc.DestroyClippingRegion(); - } - } - - // now we only have to draw the text - SetTextColoursAndFont(grid, attr, dc, isSelected); - - grid.DrawTextRectangle(dc, grid.GetCellValue(row, col), - rect, hAlign, vAlign); -} - -// ---------------------------------------------------------------------------- -// wxGridCellNumberRenderer -// ---------------------------------------------------------------------------- - -wxString wxGridCellNumberRenderer::GetString(const wxGrid& grid, int row, int col) -{ - wxGridTableBase *table = grid.GetTable(); - wxString text; - if ( table->CanGetValueAs(row, col, wxGRID_VALUE_NUMBER) ) - { - text.Printf(_T("%ld"), table->GetValueAsLong(row, col)); - } - else - { - text = table->GetValue(row, col); - } - - return text; -} - -void wxGridCellNumberRenderer::Draw(wxGrid& grid, - wxGridCellAttr& attr, - wxDC& dc, - const wxRect& rectCell, - int row, int col, - bool isSelected) -{ - wxGridCellRenderer::Draw(grid, attr, dc, rectCell, row, col, isSelected); - - SetTextColoursAndFont(grid, attr, dc, isSelected); - - // draw the text right aligned by default - int hAlign, vAlign; - attr.GetAlignment(&hAlign, &vAlign); - hAlign = wxALIGN_RIGHT; - - wxRect rect = rectCell; - rect.Inflate(-1); - - grid.DrawTextRectangle(dc, GetString(grid, row, col), rect, hAlign, vAlign); -} - -wxSize wxGridCellNumberRenderer::GetBestSize(wxGrid& grid, - wxGridCellAttr& attr, - wxDC& dc, - int row, int col) -{ - return DoGetBestSize(attr, dc, GetString(grid, row, col)); -} - -// ---------------------------------------------------------------------------- -// wxGridCellFloatRenderer -// ---------------------------------------------------------------------------- - -wxGridCellFloatRenderer::wxGridCellFloatRenderer(int width, int precision) -{ - SetWidth(width); - SetPrecision(precision); -} - -wxGridCellRenderer *wxGridCellFloatRenderer::Clone() const -{ - wxGridCellFloatRenderer *renderer = new wxGridCellFloatRenderer; - renderer->m_width = m_width; - renderer->m_precision = m_precision; - renderer->m_format = m_format; - - return renderer; -} - -wxString wxGridCellFloatRenderer::GetString(const wxGrid& grid, int row, int col) -{ - wxGridTableBase *table = grid.GetTable(); - - bool hasDouble; - double val; - wxString text; - if ( table->CanGetValueAs(row, col, wxGRID_VALUE_FLOAT) ) - { - val = table->GetValueAsDouble(row, col); - hasDouble = true; - } - else - { - text = table->GetValue(row, col); - hasDouble = text.ToDouble(&val); - } - - if ( hasDouble ) - { - if ( !m_format ) - { - if ( m_width == -1 ) - { - if ( m_precision == -1 ) - { - // default width/precision - m_format = _T("%f"); - } - else - { - m_format.Printf(_T("%%.%df"), m_precision); - } - } - else if ( m_precision == -1 ) - { - // default precision - m_format.Printf(_T("%%%d.f"), m_width); - } - else - { - m_format.Printf(_T("%%%d.%df"), m_width, m_precision); - } - } - - text.Printf(m_format, val); - - } - //else: text already contains the string - - return text; -} - -void wxGridCellFloatRenderer::Draw(wxGrid& grid, - wxGridCellAttr& attr, - wxDC& dc, - const wxRect& rectCell, - int row, int col, - bool isSelected) -{ - wxGridCellRenderer::Draw(grid, attr, dc, rectCell, row, col, isSelected); - - SetTextColoursAndFont(grid, attr, dc, isSelected); - - // draw the text right aligned by default - int hAlign, vAlign; - attr.GetAlignment(&hAlign, &vAlign); - hAlign = wxALIGN_RIGHT; - - wxRect rect = rectCell; - rect.Inflate(-1); - - grid.DrawTextRectangle(dc, GetString(grid, row, col), rect, hAlign, vAlign); -} - -wxSize wxGridCellFloatRenderer::GetBestSize(wxGrid& grid, - wxGridCellAttr& attr, - wxDC& dc, - int row, int col) -{ - return DoGetBestSize(attr, dc, GetString(grid, row, col)); -} - -void wxGridCellFloatRenderer::SetParameters(const wxString& params) -{ - if ( !params ) - { - // reset to defaults - SetWidth(-1); - SetPrecision(-1); - } - else - { - wxString tmp = params.BeforeFirst(_T(',')); - if ( !tmp.empty() ) - { - long width; - if ( tmp.ToLong(&width) ) - { - SetWidth((int)width); - } - else - { - wxLogDebug(_T("Invalid wxGridCellFloatRenderer width parameter string '%s ignored"), params.c_str()); - } - } - - tmp = params.AfterFirst(_T(',')); - if ( !tmp.empty() ) - { - long precision; - if ( tmp.ToLong(&precision) ) - { - SetPrecision((int)precision); - } - else - { - wxLogDebug(_T("Invalid wxGridCellFloatRenderer precision parameter string '%s ignored"), params.c_str()); - } - } - } -} - -// ---------------------------------------------------------------------------- -// wxGridCellBoolRenderer -// ---------------------------------------------------------------------------- - -wxSize wxGridCellBoolRenderer::ms_sizeCheckMark; - -// FIXME these checkbox size calculations are really ugly... - -// between checkmark and box -static const wxCoord wxGRID_CHECKMARK_MARGIN = 2; - -wxSize wxGridCellBoolRenderer::GetBestSize(wxGrid& grid, - wxGridCellAttr& WXUNUSED(attr), - wxDC& WXUNUSED(dc), - int WXUNUSED(row), - int WXUNUSED(col)) -{ - // compute it only once (no locks for MT safeness in GUI thread...) - if ( !ms_sizeCheckMark.x ) - { - // get checkbox size - wxCheckBox *checkbox = new wxCheckBox(&grid, wxID_ANY, wxEmptyString); - wxSize size = checkbox->GetBestSize(); - wxCoord checkSize = size.y + 2 * wxGRID_CHECKMARK_MARGIN; - - // FIXME wxGTK::wxCheckBox::GetBestSize() gives "wrong" result -#if defined(__WXGTK__) || defined(__WXMOTIF__) - checkSize -= size.y / 2; -#endif - - delete checkbox; - - ms_sizeCheckMark.x = ms_sizeCheckMark.y = checkSize; - } - - return ms_sizeCheckMark; -} - -void wxGridCellBoolRenderer::Draw(wxGrid& grid, - wxGridCellAttr& attr, - wxDC& dc, - const wxRect& rect, - int row, int col, - bool isSelected) -{ - wxGridCellRenderer::Draw(grid, attr, dc, rect, row, col, isSelected); - - // draw a check mark in the centre (ignoring alignment - TODO) - wxSize size = GetBestSize(grid, attr, dc, row, col); - - // don't draw outside the cell - wxCoord minSize = wxMin(rect.width, rect.height); - if ( size.x >= minSize || size.y >= minSize ) - { - // and even leave (at least) 1 pixel margin - size.x = size.y = minSize - 2; - } - - // draw a border around checkmark - int vAlign, hAlign; - attr.GetAlignment(&hAlign, &vAlign); - - wxRect rectBorder; - if (hAlign == wxALIGN_CENTRE) - { - rectBorder.x = rect.x + rect.width / 2 - size.x / 2; - rectBorder.y = rect.y + rect.height / 2 - size.y / 2; - rectBorder.width = size.x; - rectBorder.height = size.y; - } - else if (hAlign == wxALIGN_LEFT) - { - rectBorder.x = rect.x + 2; - rectBorder.y = rect.y + rect.height / 2 - size.y / 2; - rectBorder.width = size.x; - rectBorder.height = size.y; - } - else if (hAlign == wxALIGN_RIGHT) - { - rectBorder.x = rect.x + rect.width - size.x - 2; - rectBorder.y = rect.y + rect.height / 2 - size.y / 2; - rectBorder.width = size.x; - rectBorder.height = size.y; - } - - bool value; - if ( grid.GetTable()->CanGetValueAs(row, col, wxGRID_VALUE_BOOL) ) - { - value = grid.GetTable()->GetValueAsBool(row, col); - } - else - { - wxString cellval( grid.GetTable()->GetValue(row, col) ); - value = wxGridCellBoolEditor::IsTrueValue(cellval); - } - - if ( value ) - { - wxRect rectMark = rectBorder; - -#ifdef __WXMSW__ - // MSW DrawCheckMark() is weird (and should probably be changed...) - rectMark.Inflate(-wxGRID_CHECKMARK_MARGIN / 2); - rectMark.x++; - rectMark.y++; -#else - rectMark.Inflate(-wxGRID_CHECKMARK_MARGIN); -#endif - - dc.SetTextForeground(attr.GetTextColour()); - dc.DrawCheckMark(rectMark); - } - - dc.SetBrush(*wxTRANSPARENT_BRUSH); - dc.SetPen(wxPen(attr.GetTextColour(), 1, wxSOLID)); - dc.DrawRectangle(rectBorder); -} - -// ---------------------------------------------------------------------------- -// wxGridCellAttr -// ---------------------------------------------------------------------------- - -void wxGridCellAttr::Init(wxGridCellAttr *attrDefault) -{ - m_nRef = 1; - - m_isReadOnly = Unset; - - m_renderer = NULL; - m_editor = NULL; - - m_attrkind = wxGridCellAttr::Cell; - - m_sizeRows = m_sizeCols = 1; - m_overflow = UnsetOverflow; - - SetDefAttr(attrDefault); -} - -wxGridCellAttr *wxGridCellAttr::Clone() const -{ - wxGridCellAttr *attr = new wxGridCellAttr(m_defGridAttr); - - if ( HasTextColour() ) - attr->SetTextColour(GetTextColour()); - if ( HasBackgroundColour() ) - attr->SetBackgroundColour(GetBackgroundColour()); - if ( HasFont() ) - attr->SetFont(GetFont()); - if ( HasAlignment() ) - attr->SetAlignment(m_hAlign, m_vAlign); - - attr->SetSize( m_sizeRows, m_sizeCols ); - - if ( m_renderer ) - { - attr->SetRenderer(m_renderer); - m_renderer->IncRef(); - } - if ( m_editor ) - { - attr->SetEditor(m_editor); - m_editor->IncRef(); - } - - if ( IsReadOnly() ) - attr->SetReadOnly(); - - attr->SetOverflow( m_overflow == Overflow ); - attr->SetKind( m_attrkind ); - - return attr; -} - -void wxGridCellAttr::MergeWith(wxGridCellAttr *mergefrom) -{ - if ( !HasTextColour() && mergefrom->HasTextColour() ) - SetTextColour(mergefrom->GetTextColour()); - if ( !HasBackgroundColour() && mergefrom->HasBackgroundColour() ) - SetBackgroundColour(mergefrom->GetBackgroundColour()); - if ( !HasFont() && mergefrom->HasFont() ) - SetFont(mergefrom->GetFont()); - if ( !HasAlignment() && mergefrom->HasAlignment() ) - { - int hAlign, vAlign; - mergefrom->GetAlignment( &hAlign, &vAlign); - SetAlignment(hAlign, vAlign); - } - if ( !HasSize() && mergefrom->HasSize() ) - mergefrom->GetSize( &m_sizeRows, &m_sizeCols ); - - // Directly access member functions as GetRender/Editor don't just return - // m_renderer/m_editor - // - // Maybe add support for merge of Render and Editor? - if (!HasRenderer() && mergefrom->HasRenderer() ) - { - m_renderer = mergefrom->m_renderer; - m_renderer->IncRef(); - } - if ( !HasEditor() && mergefrom->HasEditor() ) - { - m_editor = mergefrom->m_editor; - m_editor->IncRef(); - } - if ( !HasReadWriteMode() && mergefrom->HasReadWriteMode() ) - SetReadOnly(mergefrom->IsReadOnly()); - - if (!HasOverflowMode() && mergefrom->HasOverflowMode() ) - SetOverflow(mergefrom->GetOverflow()); - - SetDefAttr(mergefrom->m_defGridAttr); -} - -void wxGridCellAttr::SetSize(int num_rows, int num_cols) -{ - // The size of a cell is normally 1,1 - - // If this cell is larger (2,2) then this is the top left cell - // the other cells that will be covered (lower right cells) must be - // set to negative or zero values such that - // row + num_rows of the covered cell points to the larger cell (this cell) - // same goes for the col + num_cols. - - // Size of 0,0 is NOT valid, neither is <=0 and any positive value - - wxASSERT_MSG( (!((num_rows > 0) && (num_cols <= 0)) || - !((num_rows <= 0) && (num_cols > 0)) || - !((num_rows == 0) && (num_cols == 0))), - wxT("wxGridCellAttr::SetSize only takes two postive values or negative/zero values")); - - m_sizeRows = num_rows; - m_sizeCols = num_cols; -} - -const wxColour& wxGridCellAttr::GetTextColour() const -{ - if (HasTextColour()) - { - return m_colText; - } - else if (m_defGridAttr && m_defGridAttr != this) - { - return m_defGridAttr->GetTextColour(); - } - else - { - wxFAIL_MSG(wxT("Missing default cell attribute")); - return wxNullColour; - } -} - -const wxColour& wxGridCellAttr::GetBackgroundColour() const -{ - if (HasBackgroundColour()) - { - return m_colBack; - } - else if (m_defGridAttr && m_defGridAttr != this) - { - return m_defGridAttr->GetBackgroundColour(); - } - else - { - wxFAIL_MSG(wxT("Missing default cell attribute")); - return wxNullColour; - } -} - -const wxFont& wxGridCellAttr::GetFont() const -{ - if (HasFont()) - { - return m_font; - } - else if (m_defGridAttr && m_defGridAttr != this) - { - return m_defGridAttr->GetFont(); - } - else - { - wxFAIL_MSG(wxT("Missing default cell attribute")); - return wxNullFont; - } -} - -void wxGridCellAttr::GetAlignment(int *hAlign, int *vAlign) const -{ - if (HasAlignment()) - { - if ( hAlign ) - *hAlign = m_hAlign; - if ( vAlign ) - *vAlign = m_vAlign; - } - else if (m_defGridAttr && m_defGridAttr != this) - { - m_defGridAttr->GetAlignment(hAlign, vAlign); - } - else - { - wxFAIL_MSG(wxT("Missing default cell attribute")); - } -} - -void wxGridCellAttr::GetSize( int *num_rows, int *num_cols ) const -{ - if ( num_rows ) - *num_rows = m_sizeRows; - if ( num_cols ) - *num_cols = m_sizeCols; -} - -// GetRenderer and GetEditor use a slightly different decision path about -// which attribute to use. If a non-default attr object has one then it is -// used, otherwise the default editor or renderer is fetched from the grid and -// used. It should be the default for the data type of the cell. If it is -// NULL (because the table has a type that the grid does not have in its -// registry), then the grid's default editor or renderer is used. - -wxGridCellRenderer* wxGridCellAttr::GetRenderer(wxGrid* grid, int row, int col) const -{ - wxGridCellRenderer *renderer = NULL; - - if ( m_renderer && this != m_defGridAttr ) - { - // use the cells renderer if it has one - renderer = m_renderer; - renderer->IncRef(); - } - else // no non-default cell renderer - { - // get default renderer for the data type - if ( grid ) - { - // GetDefaultRendererForCell() will do IncRef() for us - renderer = grid->GetDefaultRendererForCell(row, col); - } - - if ( renderer == NULL ) - { - if ( (m_defGridAttr != NULL) && (m_defGridAttr != this) ) - { - // if we still don't have one then use the grid default - // (no need for IncRef() here neither) - renderer = m_defGridAttr->GetRenderer(NULL, 0, 0); - } - else // default grid attr - { - // use m_renderer which we had decided not to use initially - renderer = m_renderer; - if ( renderer ) - renderer->IncRef(); - } - } - } - - // we're supposed to always find something - wxASSERT_MSG(renderer, wxT("Missing default cell renderer")); - - return renderer; -} - -// same as above, except for s/renderer/editor/g -wxGridCellEditor* wxGridCellAttr::GetEditor(wxGrid* grid, int row, int col) const -{ - wxGridCellEditor *editor = NULL; - - if ( m_editor && this != m_defGridAttr ) - { - // use the cells editor if it has one - editor = m_editor; - editor->IncRef(); - } - else // no non default cell editor - { - // get default editor for the data type - if ( grid ) - { - // GetDefaultEditorForCell() will do IncRef() for us - editor = grid->GetDefaultEditorForCell(row, col); - } - - if ( editor == NULL ) - { - if ( (m_defGridAttr != NULL) && (m_defGridAttr != this) ) - { - // if we still don't have one then use the grid default - // (no need for IncRef() here neither) - editor = m_defGridAttr->GetEditor(NULL, 0, 0); - } - else // default grid attr - { - // use m_editor which we had decided not to use initially - editor = m_editor; - if ( editor ) - editor->IncRef(); - } - } - } - - // we're supposed to always find something - wxASSERT_MSG(editor, wxT("Missing default cell editor")); - - return editor; -} - -// ---------------------------------------------------------------------------- -// wxGridCellAttrData -// ---------------------------------------------------------------------------- - -void wxGridCellAttrData::SetAttr(wxGridCellAttr *attr, int row, int col) -{ - // Note: contrary to wxGridRowOrColAttrData::SetAttr, we must not - // touch attribute's reference counting explicitly, since this - // is managed by class wxGridCellWithAttr - int n = FindIndex(row, col); - if ( n == wxNOT_FOUND ) - { - if ( attr ) - { - // add the attribute - m_attrs.Add(new wxGridCellWithAttr(row, col, attr)); - } - //else: nothing to do - } - else // we already have an attribute for this cell - { - if ( attr ) - { - // change the attribute - m_attrs[(size_t)n].ChangeAttr(attr); - } - else - { - // remove this attribute - m_attrs.RemoveAt((size_t)n); - } - } -} - -wxGridCellAttr *wxGridCellAttrData::GetAttr(int row, int col) const -{ - wxGridCellAttr *attr = (wxGridCellAttr *)NULL; - - int n = FindIndex(row, col); - if ( n != wxNOT_FOUND ) - { - attr = m_attrs[(size_t)n].attr; - attr->IncRef(); - } - - return attr; -} - -void wxGridCellAttrData::UpdateAttrRows( size_t pos, int numRows ) -{ - size_t count = m_attrs.GetCount(); - for ( size_t n = 0; n < count; n++ ) - { - wxGridCellCoords& coords = m_attrs[n].coords; - wxCoord row = coords.GetRow(); - if ((size_t)row >= pos) - { - if (numRows > 0) - { - // If rows inserted, include row counter where necessary - coords.SetRow(row + numRows); - } - else if (numRows < 0) - { - // If rows deleted ... - if ((size_t)row >= pos - numRows) - { - // ...either decrement row counter (if row still exists)... - coords.SetRow(row + numRows); - } - else - { - // ...or remove the attribute - m_attrs.RemoveAt(n); - n--; - count--; - } - } - } - } -} - -void wxGridCellAttrData::UpdateAttrCols( size_t pos, int numCols ) -{ - size_t count = m_attrs.GetCount(); - for ( size_t n = 0; n < count; n++ ) - { - wxGridCellCoords& coords = m_attrs[n].coords; - wxCoord col = coords.GetCol(); - if ( (size_t)col >= pos ) - { - if ( numCols > 0 ) - { - // If rows inserted, include row counter where necessary - coords.SetCol(col + numCols); - } - else if (numCols < 0) - { - // If rows deleted ... - if ((size_t)col >= pos - numCols) - { - // ...either decrement row counter (if row still exists)... - coords.SetCol(col + numCols); - } - else - { - // ...or remove the attribute - m_attrs.RemoveAt(n); - n--; - count--; - } - } - } - } -} - -int wxGridCellAttrData::FindIndex(int row, int col) const -{ - size_t count = m_attrs.GetCount(); - for ( size_t n = 0; n < count; n++ ) - { - const wxGridCellCoords& coords = m_attrs[n].coords; - if ( (coords.GetRow() == row) && (coords.GetCol() == col) ) - { - return n; - } - } - - return wxNOT_FOUND; -} - -// ---------------------------------------------------------------------------- -// wxGridRowOrColAttrData -// ---------------------------------------------------------------------------- - -wxGridRowOrColAttrData::~wxGridRowOrColAttrData() -{ - size_t count = m_attrs.Count(); - for ( size_t n = 0; n < count; n++ ) - { - m_attrs[n]->DecRef(); - } -} - -wxGridCellAttr *wxGridRowOrColAttrData::GetAttr(int rowOrCol) const -{ - wxGridCellAttr *attr = (wxGridCellAttr *)NULL; - - int n = m_rowsOrCols.Index(rowOrCol); - if ( n != wxNOT_FOUND ) - { - attr = m_attrs[(size_t)n]; - attr->IncRef(); - } - - return attr; -} - -void wxGridRowOrColAttrData::SetAttr(wxGridCellAttr *attr, int rowOrCol) -{ - int i = m_rowsOrCols.Index(rowOrCol); - if ( i == wxNOT_FOUND ) - { - if ( attr ) - { - // store the new attribute, taking its ownership - m_rowsOrCols.Add(rowOrCol); - m_attrs.Add(attr); - } - // nothing to remove - } - else // we have an attribute for this row or column - { - size_t n = (size_t)i; - - // notice that this code works correctly even when the old attribute is - // the same as the new one: as we own of it, we must call DecRef() on - // it in any case and this won't result in destruction of the new - // attribute if it's the same as old one because it must have ref count - // of at least 2 to be passed to us while we keep a reference to it too - m_attrs[n]->DecRef(); - - if ( attr ) - { - // replace the attribute with the new one - m_attrs[n] = attr; - } - else // remove the attribute - { - m_rowsOrCols.RemoveAt(n); - m_attrs.RemoveAt(n); - } - } -} - -void wxGridRowOrColAttrData::UpdateAttrRowsOrCols( size_t pos, int numRowsOrCols ) -{ - size_t count = m_attrs.GetCount(); - for ( size_t n = 0; n < count; n++ ) - { - int & rowOrCol = m_rowsOrCols[n]; - if ( (size_t)rowOrCol >= pos ) - { - if ( numRowsOrCols > 0 ) - { - // If rows inserted, include row counter where necessary - rowOrCol += numRowsOrCols; - } - else if ( numRowsOrCols < 0) - { - // If rows deleted, either decrement row counter (if row still exists) - if ((size_t)rowOrCol >= pos - numRowsOrCols) - rowOrCol += numRowsOrCols; - else - { - m_rowsOrCols.RemoveAt(n); - m_attrs[n]->DecRef(); - m_attrs.RemoveAt(n); - n--; - count--; - } - } - } - } -} - -// ---------------------------------------------------------------------------- -// wxGridCellAttrProvider -// ---------------------------------------------------------------------------- - -wxGridCellAttrProvider::wxGridCellAttrProvider() -{ - m_data = (wxGridCellAttrProviderData *)NULL; -} - -wxGridCellAttrProvider::~wxGridCellAttrProvider() -{ - delete m_data; -} - -void wxGridCellAttrProvider::InitData() -{ - m_data = new wxGridCellAttrProviderData; -} - -wxGridCellAttr *wxGridCellAttrProvider::GetAttr(int row, int col, - wxGridCellAttr::wxAttrKind kind ) const -{ - wxGridCellAttr *attr = (wxGridCellAttr *)NULL; - if ( m_data ) - { - switch (kind) - { - case (wxGridCellAttr::Any): - // Get cached merge attributes. - // Currently not used as no cache implemented as not mutable - // attr = m_data->m_mergeAttr.GetAttr(row, col); - if (!attr) - { - // Basically implement old version. - // Also check merge cache, so we don't have to re-merge every time.. - wxGridCellAttr *attrcell = m_data->m_cellAttrs.GetAttr(row, col); - wxGridCellAttr *attrrow = m_data->m_rowAttrs.GetAttr(row); - wxGridCellAttr *attrcol = m_data->m_colAttrs.GetAttr(col); - - if ((attrcell != attrrow) && (attrrow != attrcol) && (attrcell != attrcol)) - { - // Two or more are non NULL - attr = new wxGridCellAttr; - attr->SetKind(wxGridCellAttr::Merged); - - // Order is important.. - if (attrcell) - { - attr->MergeWith(attrcell); - attrcell->DecRef(); - } - if (attrcol) - { - attr->MergeWith(attrcol); - attrcol->DecRef(); - } - if (attrrow) - { - attr->MergeWith(attrrow); - attrrow->DecRef(); - } - - // store merge attr if cache implemented - //attr->IncRef(); - //m_data->m_mergeAttr.SetAttr(attr, row, col); - } - else - { - // one or none is non null return it or null. - if (attrrow) - attr = attrrow; - if (attrcol) - { - if (attr) - attr->DecRef(); - attr = attrcol; - } - if (attrcell) - { - if (attr) - attr->DecRef(); - attr = attrcell; - } - } - } - break; - - case (wxGridCellAttr::Cell): - attr = m_data->m_cellAttrs.GetAttr(row, col); - break; - - case (wxGridCellAttr::Col): - attr = m_data->m_colAttrs.GetAttr(col); - break; - - case (wxGridCellAttr::Row): - attr = m_data->m_rowAttrs.GetAttr(row); - break; - - default: - // unused as yet... - // (wxGridCellAttr::Default): - // (wxGridCellAttr::Merged): - break; - } - } - - return attr; -} - -void wxGridCellAttrProvider::SetAttr(wxGridCellAttr *attr, - int row, int col) -{ - if ( !m_data ) - InitData(); - - m_data->m_cellAttrs.SetAttr(attr, row, col); -} - -void wxGridCellAttrProvider::SetRowAttr(wxGridCellAttr *attr, int row) -{ - if ( !m_data ) - InitData(); - - m_data->m_rowAttrs.SetAttr(attr, row); -} - -void wxGridCellAttrProvider::SetColAttr(wxGridCellAttr *attr, int col) -{ - if ( !m_data ) - InitData(); - - m_data->m_colAttrs.SetAttr(attr, col); -} - -void wxGridCellAttrProvider::UpdateAttrRows( size_t pos, int numRows ) -{ - if ( m_data ) - { - m_data->m_cellAttrs.UpdateAttrRows( pos, numRows ); - - m_data->m_rowAttrs.UpdateAttrRowsOrCols( pos, numRows ); - } -} - -void wxGridCellAttrProvider::UpdateAttrCols( size_t pos, int numCols ) -{ - if ( m_data ) - { - m_data->m_cellAttrs.UpdateAttrCols( pos, numCols ); - - m_data->m_colAttrs.UpdateAttrRowsOrCols( pos, numCols ); - } -} - -// ---------------------------------------------------------------------------- -// wxGridTypeRegistry -// ---------------------------------------------------------------------------- - -wxGridTypeRegistry::~wxGridTypeRegistry() -{ - size_t count = m_typeinfo.Count(); - for ( size_t i = 0; i < count; i++ ) - delete m_typeinfo[i]; -} - -void wxGridTypeRegistry::RegisterDataType(const wxString& typeName, - wxGridCellRenderer* renderer, - wxGridCellEditor* editor) -{ - wxGridDataTypeInfo* info = new wxGridDataTypeInfo(typeName, renderer, editor); - - // is it already registered? - int loc = FindRegisteredDataType(typeName); - if ( loc != wxNOT_FOUND ) - { - delete m_typeinfo[loc]; - m_typeinfo[loc] = info; - } - else - { - m_typeinfo.Add(info); - } -} - -int wxGridTypeRegistry::FindRegisteredDataType(const wxString& typeName) -{ - size_t count = m_typeinfo.GetCount(); - for ( size_t i = 0; i < count; i++ ) - { - if ( typeName == m_typeinfo[i]->m_typeName ) - { - return i; - } - } - - return wxNOT_FOUND; -} - -int wxGridTypeRegistry::FindDataType(const wxString& typeName) -{ - int index = FindRegisteredDataType(typeName); - if ( index == wxNOT_FOUND ) - { - // check whether this is one of the standard ones, in which case - // register it "on the fly" -#if wxUSE_TEXTCTRL - if ( typeName == wxGRID_VALUE_STRING ) - { - RegisterDataType(wxGRID_VALUE_STRING, - new wxGridCellStringRenderer, - new wxGridCellTextEditor); - } - else -#endif // wxUSE_TEXTCTRL -#if wxUSE_CHECKBOX - if ( typeName == wxGRID_VALUE_BOOL ) - { - RegisterDataType(wxGRID_VALUE_BOOL, - new wxGridCellBoolRenderer, - new wxGridCellBoolEditor); - } - else -#endif // wxUSE_CHECKBOX -#if wxUSE_TEXTCTRL - if ( typeName == wxGRID_VALUE_NUMBER ) - { - RegisterDataType(wxGRID_VALUE_NUMBER, - new wxGridCellNumberRenderer, - new wxGridCellNumberEditor); - } - else if ( typeName == wxGRID_VALUE_FLOAT ) - { - RegisterDataType(wxGRID_VALUE_FLOAT, - new wxGridCellFloatRenderer, - new wxGridCellFloatEditor); - } - else -#endif // wxUSE_TEXTCTRL -#if wxUSE_COMBOBOX - if ( typeName == wxGRID_VALUE_CHOICE ) - { - RegisterDataType(wxGRID_VALUE_CHOICE, - new wxGridCellStringRenderer, - new wxGridCellChoiceEditor); - } - else -#endif // wxUSE_COMBOBOX - { - return wxNOT_FOUND; - } - - // we get here only if just added the entry for this type, so return - // the last index - index = m_typeinfo.GetCount() - 1; - } - - return index; -} - -int wxGridTypeRegistry::FindOrCloneDataType(const wxString& typeName) -{ - int index = FindDataType(typeName); - if ( index == wxNOT_FOUND ) - { - // the first part of the typename is the "real" type, anything after ':' - // are the parameters for the renderer - index = FindDataType(typeName.BeforeFirst(_T(':'))); - if ( index == wxNOT_FOUND ) - { - return wxNOT_FOUND; - } - - wxGridCellRenderer *renderer = GetRenderer(index); - wxGridCellRenderer *rendererOld = renderer; - renderer = renderer->Clone(); - rendererOld->DecRef(); - - wxGridCellEditor *editor = GetEditor(index); - wxGridCellEditor *editorOld = editor; - editor = editor->Clone(); - editorOld->DecRef(); - - // do it even if there are no parameters to reset them to defaults - wxString params = typeName.AfterFirst(_T(':')); - renderer->SetParameters(params); - editor->SetParameters(params); - - // register the new typename - RegisterDataType(typeName, renderer, editor); - - // we just registered it, it's the last one - index = m_typeinfo.GetCount() - 1; - } - - return index; -} - -wxGridCellRenderer* wxGridTypeRegistry::GetRenderer(int index) -{ - wxGridCellRenderer* renderer = m_typeinfo[index]->m_renderer; - if (renderer) - renderer->IncRef(); - - return renderer; -} - -wxGridCellEditor* wxGridTypeRegistry::GetEditor(int index) -{ - wxGridCellEditor* editor = m_typeinfo[index]->m_editor; - if (editor) - editor->IncRef(); - - return editor; -} - -// ---------------------------------------------------------------------------- -// wxGridTableBase -// ---------------------------------------------------------------------------- - -IMPLEMENT_ABSTRACT_CLASS( wxGridTableBase, wxObject ) - -wxGridTableBase::wxGridTableBase() -{ - m_view = (wxGrid *) NULL; - m_attrProvider = (wxGridCellAttrProvider *) NULL; -} - -wxGridTableBase::~wxGridTableBase() -{ - delete m_attrProvider; -} - -void wxGridTableBase::SetAttrProvider(wxGridCellAttrProvider *attrProvider) -{ - delete m_attrProvider; - m_attrProvider = attrProvider; -} - -bool wxGridTableBase::CanHaveAttributes() -{ - if ( ! GetAttrProvider() ) - { - // use the default attr provider by default - SetAttrProvider(new wxGridCellAttrProvider); - } - - return true; -} - -wxGridCellAttr *wxGridTableBase::GetAttr(int row, int col, wxGridCellAttr::wxAttrKind kind) -{ - if ( m_attrProvider ) - return m_attrProvider->GetAttr(row, col, kind); - else - return (wxGridCellAttr *)NULL; -} - -void wxGridTableBase::SetAttr(wxGridCellAttr* attr, int row, int col) -{ - if ( m_attrProvider ) - { - if ( attr ) - attr->SetKind(wxGridCellAttr::Cell); - m_attrProvider->SetAttr(attr, row, col); - } - else - { - // as we take ownership of the pointer and don't store it, we must - // free it now - wxSafeDecRef(attr); - } -} - -void wxGridTableBase::SetRowAttr(wxGridCellAttr *attr, int row) -{ - if ( m_attrProvider ) - { - attr->SetKind(wxGridCellAttr::Row); - m_attrProvider->SetRowAttr(attr, row); - } - else - { - // as we take ownership of the pointer and don't store it, we must - // free it now - wxSafeDecRef(attr); - } -} - -void wxGridTableBase::SetColAttr(wxGridCellAttr *attr, int col) -{ - if ( m_attrProvider ) - { - attr->SetKind(wxGridCellAttr::Col); - m_attrProvider->SetColAttr(attr, col); - } - else - { - // as we take ownership of the pointer and don't store it, we must - // free it now - wxSafeDecRef(attr); - } -} - -bool wxGridTableBase::InsertRows( size_t WXUNUSED(pos), - size_t WXUNUSED(numRows) ) -{ - wxFAIL_MSG( wxT("Called grid table class function InsertRows\nbut your derived table class does not override this function") ); - - return false; -} - -bool wxGridTableBase::AppendRows( size_t WXUNUSED(numRows) ) -{ - wxFAIL_MSG( wxT("Called grid table class function AppendRows\nbut your derived table class does not override this function")); - - return false; -} - -bool wxGridTableBase::DeleteRows( size_t WXUNUSED(pos), - size_t WXUNUSED(numRows) ) -{ - wxFAIL_MSG( wxT("Called grid table class function DeleteRows\nbut your derived table class does not override this function")); - - return false; -} - -bool wxGridTableBase::InsertCols( size_t WXUNUSED(pos), - size_t WXUNUSED(numCols) ) -{ - wxFAIL_MSG( wxT("Called grid table class function InsertCols\nbut your derived table class does not override this function")); - - return false; -} - -bool wxGridTableBase::AppendCols( size_t WXUNUSED(numCols) ) -{ - wxFAIL_MSG(wxT("Called grid table class function AppendCols\nbut your derived table class does not override this function")); - - return false; -} - -bool wxGridTableBase::DeleteCols( size_t WXUNUSED(pos), - size_t WXUNUSED(numCols) ) -{ - wxFAIL_MSG( wxT("Called grid table class function DeleteCols\nbut your derived table class does not override this function")); - - return false; -} - -wxString wxGridTableBase::GetRowLabelValue( int row ) -{ - wxString s; - - // RD: Starting the rows at zero confuses users, - // no matter how much it makes sense to us geeks. - s << row + 1; - - return s; -} - -wxString wxGridTableBase::GetColLabelValue( int col ) -{ - // default col labels are: - // cols 0 to 25 : A-Z - // cols 26 to 675 : AA-ZZ - // etc. - - wxString s; - unsigned int i, n; - for ( n = 1; ; n++ ) - { - s += (wxChar) (_T('A') + (wxChar)(col % 26)); - col = col / 26 - 1; - if ( col < 0 ) - break; - } - - // reverse the string... - wxString s2; - for ( i = 0; i < n; i++ ) - { - s2 += s[n - i - 1]; - } - - return s2; -} - -wxString wxGridTableBase::GetTypeName( int WXUNUSED(row), int WXUNUSED(col) ) -{ - return wxGRID_VALUE_STRING; -} - -bool wxGridTableBase::CanGetValueAs( int WXUNUSED(row), int WXUNUSED(col), - const wxString& typeName ) -{ - return typeName == wxGRID_VALUE_STRING; -} - -bool wxGridTableBase::CanSetValueAs( int row, int col, const wxString& typeName ) -{ - return CanGetValueAs(row, col, typeName); -} - -long wxGridTableBase::GetValueAsLong( int WXUNUSED(row), int WXUNUSED(col) ) -{ - return 0; -} - -double wxGridTableBase::GetValueAsDouble( int WXUNUSED(row), int WXUNUSED(col) ) -{ - return 0.0; -} - -bool wxGridTableBase::GetValueAsBool( int WXUNUSED(row), int WXUNUSED(col) ) -{ - return false; -} - -void wxGridTableBase::SetValueAsLong( int WXUNUSED(row), int WXUNUSED(col), - long WXUNUSED(value) ) -{ -} - -void wxGridTableBase::SetValueAsDouble( int WXUNUSED(row), int WXUNUSED(col), - double WXUNUSED(value) ) -{ -} - -void wxGridTableBase::SetValueAsBool( int WXUNUSED(row), int WXUNUSED(col), - bool WXUNUSED(value) ) -{ -} - -void* wxGridTableBase::GetValueAsCustom( int WXUNUSED(row), int WXUNUSED(col), - const wxString& WXUNUSED(typeName) ) -{ - return NULL; -} - -void wxGridTableBase::SetValueAsCustom( int WXUNUSED(row), int WXUNUSED(col), - const wxString& WXUNUSED(typeName), - void* WXUNUSED(value) ) -{ -} - -////////////////////////////////////////////////////////////////////// -// -// Message class for the grid table to send requests and notifications -// to the grid view -// - -wxGridTableMessage::wxGridTableMessage() -{ - m_table = (wxGridTableBase *) NULL; - m_id = -1; - m_comInt1 = -1; - m_comInt2 = -1; -} - -wxGridTableMessage::wxGridTableMessage( wxGridTableBase *table, int id, - int commandInt1, int commandInt2 ) -{ - m_table = table; - m_id = id; - m_comInt1 = commandInt1; - m_comInt2 = commandInt2; -} - -////////////////////////////////////////////////////////////////////// -// -// A basic grid table for string data. An object of this class will -// created by wxGrid if you don't specify an alternative table class. -// - -WX_DEFINE_OBJARRAY(wxGridStringArray) - -IMPLEMENT_DYNAMIC_CLASS( wxGridStringTable, wxGridTableBase ) - -wxGridStringTable::wxGridStringTable() - : wxGridTableBase() -{ -} - -wxGridStringTable::wxGridStringTable( int numRows, int numCols ) - : wxGridTableBase() -{ - m_data.Alloc( numRows ); - - wxArrayString sa; - sa.Alloc( numCols ); - sa.Add( wxEmptyString, numCols ); - - m_data.Add( sa, numRows ); -} - -wxGridStringTable::~wxGridStringTable() -{ -} - -int wxGridStringTable::GetNumberRows() -{ - return m_data.GetCount(); -} - -int wxGridStringTable::GetNumberCols() -{ - if ( m_data.GetCount() > 0 ) - return m_data[0].GetCount(); - else - return 0; -} - -wxString wxGridStringTable::GetValue( int row, int col ) -{ - wxCHECK_MSG( (row < GetNumberRows()) && (col < GetNumberCols()), - wxEmptyString, - _T("invalid row or column index in wxGridStringTable") ); - - return m_data[row][col]; -} - -void wxGridStringTable::SetValue( int row, int col, const wxString& value ) -{ - wxCHECK_RET( (row < GetNumberRows()) && (col < GetNumberCols()), - _T("invalid row or column index in wxGridStringTable") ); - - m_data[row][col] = value; -} - -bool wxGridStringTable::IsEmptyCell( int row, int col ) -{ - wxCHECK_MSG( (row < GetNumberRows()) && (col < GetNumberCols()), - true, - _T("invalid row or column index in wxGridStringTable") ); - - return (m_data[row][col] == wxEmptyString); -} - -void wxGridStringTable::Clear() -{ - int row, col; - int numRows, numCols; - - numRows = m_data.GetCount(); - if ( numRows > 0 ) - { - numCols = m_data[0].GetCount(); - - for ( row = 0; row < numRows; row++ ) - { - for ( col = 0; col < numCols; col++ ) - { - m_data[row][col] = wxEmptyString; - } - } - } -} - -bool wxGridStringTable::InsertRows( size_t pos, size_t numRows ) -{ - size_t curNumRows = m_data.GetCount(); - size_t curNumCols = ( curNumRows > 0 ? m_data[0].GetCount() : - ( GetView() ? GetView()->GetNumberCols() : 0 ) ); - - if ( pos >= curNumRows ) - { - return AppendRows( numRows ); - } - - wxArrayString sa; - sa.Alloc( curNumCols ); - sa.Add( wxEmptyString, curNumCols ); - m_data.Insert( sa, pos, numRows ); - - if ( GetView() ) - { - wxGridTableMessage msg( this, - wxGRIDTABLE_NOTIFY_ROWS_INSERTED, - pos, - numRows ); - - GetView()->ProcessTableMessage( msg ); - } - - return true; -} - -bool wxGridStringTable::AppendRows( size_t numRows ) -{ - size_t curNumRows = m_data.GetCount(); - size_t curNumCols = ( curNumRows > 0 - ? m_data[0].GetCount() - : ( GetView() ? GetView()->GetNumberCols() : 0 ) ); - - wxArrayString sa; - if ( curNumCols > 0 ) - { - sa.Alloc( curNumCols ); - sa.Add( wxEmptyString, curNumCols ); - } - - m_data.Add( sa, numRows ); - - if ( GetView() ) - { - wxGridTableMessage msg( this, - wxGRIDTABLE_NOTIFY_ROWS_APPENDED, - numRows ); - - GetView()->ProcessTableMessage( msg ); - } - - return true; -} - -bool wxGridStringTable::DeleteRows( size_t pos, size_t numRows ) -{ - size_t curNumRows = m_data.GetCount(); - - if ( pos >= curNumRows ) - { - wxFAIL_MSG( wxString::Format - ( - wxT("Called wxGridStringTable::DeleteRows(pos=%lu, N=%lu)\nPos value is invalid for present table with %lu rows"), - (unsigned long)pos, - (unsigned long)numRows, - (unsigned long)curNumRows - ) ); - - return false; - } - - if ( numRows > curNumRows - pos ) - { - numRows = curNumRows - pos; - } - - if ( numRows >= curNumRows ) - { - m_data.Clear(); - } - else - { - m_data.RemoveAt( pos, numRows ); - } - - if ( GetView() ) - { - wxGridTableMessage msg( this, - wxGRIDTABLE_NOTIFY_ROWS_DELETED, - pos, - numRows ); - - GetView()->ProcessTableMessage( msg ); - } - - return true; -} - -bool wxGridStringTable::InsertCols( size_t pos, size_t numCols ) -{ - size_t row, col; - - size_t curNumRows = m_data.GetCount(); - size_t curNumCols = ( curNumRows > 0 - ? m_data[0].GetCount() - : ( GetView() ? GetView()->GetNumberCols() : 0 ) ); - - if ( pos >= curNumCols ) - { - return AppendCols( numCols ); - } - - if ( !m_colLabels.IsEmpty() ) - { - m_colLabels.Insert( wxEmptyString, pos, numCols ); - - size_t i; - for ( i = pos; i < pos + numCols; i++ ) - m_colLabels[i] = wxGridTableBase::GetColLabelValue( i ); - } - - for ( row = 0; row < curNumRows; row++ ) - { - for ( col = pos; col < pos + numCols; col++ ) - { - m_data[row].Insert( wxEmptyString, col ); - } - } - - if ( GetView() ) - { - wxGridTableMessage msg( this, - wxGRIDTABLE_NOTIFY_COLS_INSERTED, - pos, - numCols ); - - GetView()->ProcessTableMessage( msg ); - } - - return true; -} - -bool wxGridStringTable::AppendCols( size_t numCols ) -{ - size_t row; - - size_t curNumRows = m_data.GetCount(); - -#if 0 - if ( !curNumRows ) - { - // TODO: something better than this ? - // - wxFAIL_MSG( wxT("Unable to append cols to a grid table with no rows.\nCall AppendRows() first") ); - return false; - } -#endif - - for ( row = 0; row < curNumRows; row++ ) - { - m_data[row].Add( wxEmptyString, numCols ); - } - - if ( GetView() ) - { - wxGridTableMessage msg( this, - wxGRIDTABLE_NOTIFY_COLS_APPENDED, - numCols ); - - GetView()->ProcessTableMessage( msg ); - } - - return true; -} - -bool wxGridStringTable::DeleteCols( size_t pos, size_t numCols ) -{ - size_t row; - - size_t curNumRows = m_data.GetCount(); - size_t curNumCols = ( curNumRows > 0 ? m_data[0].GetCount() : - ( GetView() ? GetView()->GetNumberCols() : 0 ) ); - - if ( pos >= curNumCols ) - { - wxFAIL_MSG( wxString::Format - ( - wxT("Called wxGridStringTable::DeleteCols(pos=%lu, N=%lu)\nPos value is invalid for present table with %lu cols"), - (unsigned long)pos, - (unsigned long)numCols, - (unsigned long)curNumCols - ) ); - return false; - } - - int colID; - if ( GetView() ) - colID = GetView()->GetColAt( pos ); - else - colID = pos; - - if ( numCols > curNumCols - colID ) - { - numCols = curNumCols - colID; - } - - if ( !m_colLabels.IsEmpty() ) - { - // m_colLabels stores just as many elements as it needs, e.g. if only - // the label of the first column had been set it would have only one - // element and not numCols, so account for it - int nToRm = m_colLabels.size() - colID; - if ( nToRm > 0 ) - m_colLabels.RemoveAt( colID, nToRm ); - } - - for ( row = 0; row < curNumRows; row++ ) - { - if ( numCols >= curNumCols ) - { - m_data[row].Clear(); - } - else - { - m_data[row].RemoveAt( colID, numCols ); - } - } - - if ( GetView() ) - { - wxGridTableMessage msg( this, - wxGRIDTABLE_NOTIFY_COLS_DELETED, - pos, - numCols ); - - GetView()->ProcessTableMessage( msg ); - } - - return true; -} - -wxString wxGridStringTable::GetRowLabelValue( int row ) -{ - if ( row > (int)(m_rowLabels.GetCount()) - 1 ) - { - // using default label - // - return wxGridTableBase::GetRowLabelValue( row ); - } - else - { - return m_rowLabels[row]; - } -} - -wxString wxGridStringTable::GetColLabelValue( int col ) -{ - if ( col > (int)(m_colLabels.GetCount()) - 1 ) - { - // using default label - // - return wxGridTableBase::GetColLabelValue( col ); - } - else - { - return m_colLabels[col]; - } -} - -void wxGridStringTable::SetRowLabelValue( int row, const wxString& value ) -{ - if ( row > (int)(m_rowLabels.GetCount()) - 1 ) - { - int n = m_rowLabels.GetCount(); - int i; - - for ( i = n; i <= row; i++ ) - { - m_rowLabels.Add( wxGridTableBase::GetRowLabelValue(i) ); - } - } - - m_rowLabels[row] = value; -} - -void wxGridStringTable::SetColLabelValue( int col, const wxString& value ) -{ - if ( col > (int)(m_colLabels.GetCount()) - 1 ) - { - int n = m_colLabels.GetCount(); - int i; - - for ( i = n; i <= col; i++ ) - { - m_colLabels.Add( wxGridTableBase::GetColLabelValue(i) ); - } - } - - m_colLabels[col] = value; -} - - -////////////////////////////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////// - -BEGIN_EVENT_TABLE(wxGridSubwindow, wxWindow) - EVT_MOUSE_CAPTURE_LOST(wxGridSubwindow::OnMouseCaptureLost) -END_EVENT_TABLE() - -void wxGridSubwindow::OnMouseCaptureLost(wxMouseCaptureLostEvent& WXUNUSED(event)) -{ - m_owner->CancelMouseCapture(); -} - -IMPLEMENT_DYNAMIC_CLASS( wxGridRowLabelWindow, wxWindow ) - -BEGIN_EVENT_TABLE( wxGridRowLabelWindow, wxGridSubwindow ) - EVT_PAINT( wxGridRowLabelWindow::OnPaint ) - EVT_MOUSEWHEEL( wxGridRowLabelWindow::OnMouseWheel ) - EVT_MOUSE_EVENTS( wxGridRowLabelWindow::OnMouseEvent ) - EVT_KEY_DOWN( wxGridRowLabelWindow::OnKeyDown ) - EVT_KEY_UP( wxGridRowLabelWindow::OnKeyUp ) - EVT_CHAR( wxGridRowLabelWindow::OnChar ) -END_EVENT_TABLE() - -wxGridRowLabelWindow::wxGridRowLabelWindow( wxGrid *parent, - wxWindowID id, - const wxPoint &pos, const wxSize &size ) - : wxGridSubwindow(parent, id, pos, size) -{ - m_owner = parent; -} - -void wxGridRowLabelWindow::OnPaint( wxPaintEvent& WXUNUSED(event) ) -{ - wxPaintDC dc(this); - - // NO - don't do this because it will set both the x and y origin - // coords to match the parent scrolled window and we just want to - // set the y coord - MB - // - // m_owner->PrepareDC( dc ); - - int x, y; - m_owner->CalcUnscrolledPosition( 0, 0, &x, &y ); - wxPoint pt = dc.GetDeviceOrigin(); - dc.SetDeviceOrigin( pt.x, pt.y-y ); - - wxArrayInt rows = m_owner->CalcRowLabelsExposed( GetUpdateRegion() ); - m_owner->DrawRowLabels( dc, rows ); -} - -void wxGridRowLabelWindow::OnMouseEvent( wxMouseEvent& event ) -{ - m_owner->ProcessRowLabelMouseEvent( event ); -} - -void wxGridRowLabelWindow::OnMouseWheel( wxMouseEvent& event ) -{ - m_owner->GetEventHandler()->ProcessEvent( event ); -} - -// This seems to be required for wxMotif otherwise the mouse -// cursor must be in the cell edit control to get key events -// -void wxGridRowLabelWindow::OnKeyDown( wxKeyEvent& event ) -{ - if ( !m_owner->GetEventHandler()->ProcessEvent( event ) ) - event.Skip(); -} - -void wxGridRowLabelWindow::OnKeyUp( wxKeyEvent& event ) -{ - if ( !m_owner->GetEventHandler()->ProcessEvent( event ) ) - event.Skip(); -} - -void wxGridRowLabelWindow::OnChar( wxKeyEvent& event ) -{ - if ( !m_owner->GetEventHandler()->ProcessEvent( event ) ) - event.Skip(); -} - -////////////////////////////////////////////////////////////////////// - -IMPLEMENT_DYNAMIC_CLASS( wxGridColLabelWindow, wxWindow ) - -BEGIN_EVENT_TABLE( wxGridColLabelWindow, wxGridSubwindow ) - EVT_PAINT( wxGridColLabelWindow::OnPaint ) - EVT_MOUSEWHEEL( wxGridColLabelWindow::OnMouseWheel ) - EVT_MOUSE_EVENTS( wxGridColLabelWindow::OnMouseEvent ) - EVT_KEY_DOWN( wxGridColLabelWindow::OnKeyDown ) - EVT_KEY_UP( wxGridColLabelWindow::OnKeyUp ) - EVT_CHAR( wxGridColLabelWindow::OnChar ) -END_EVENT_TABLE() - -wxGridColLabelWindow::wxGridColLabelWindow( wxGrid *parent, - wxWindowID id, - const wxPoint &pos, const wxSize &size ) - : wxGridSubwindow(parent, id, pos, size) -{ - m_owner = parent; -} - -void wxGridColLabelWindow::OnPaint( wxPaintEvent& WXUNUSED(event) ) -{ - wxPaintDC dc(this); - - // NO - don't do this because it will set both the x and y origin - // coords to match the parent scrolled window and we just want to - // set the x coord - MB - // - // m_owner->PrepareDC( dc ); - - int x, y; - m_owner->CalcUnscrolledPosition( 0, 0, &x, &y ); - wxPoint pt = dc.GetDeviceOrigin(); - if (GetLayoutDirection() == wxLayout_RightToLeft) - dc.SetDeviceOrigin( pt.x+x, pt.y ); - else - dc.SetDeviceOrigin( pt.x-x, pt.y ); - - wxArrayInt cols = m_owner->CalcColLabelsExposed( GetUpdateRegion() ); - m_owner->DrawColLabels( dc, cols ); -} - -void wxGridColLabelWindow::OnMouseEvent( wxMouseEvent& event ) -{ - m_owner->ProcessColLabelMouseEvent( event ); -} - -void wxGridColLabelWindow::OnMouseWheel( wxMouseEvent& event ) -{ - m_owner->GetEventHandler()->ProcessEvent( event ); -} - -// This seems to be required for wxMotif otherwise the mouse -// cursor must be in the cell edit control to get key events -// -void wxGridColLabelWindow::OnKeyDown( wxKeyEvent& event ) -{ - if ( !m_owner->GetEventHandler()->ProcessEvent( event ) ) - event.Skip(); -} - -void wxGridColLabelWindow::OnKeyUp( wxKeyEvent& event ) -{ - if ( !m_owner->GetEventHandler()->ProcessEvent( event ) ) - event.Skip(); -} - -void wxGridColLabelWindow::OnChar( wxKeyEvent& event ) -{ - if ( !m_owner->GetEventHandler()->ProcessEvent( event ) ) - event.Skip(); -} - -////////////////////////////////////////////////////////////////////// - -IMPLEMENT_DYNAMIC_CLASS( wxGridCornerLabelWindow, wxWindow ) - -BEGIN_EVENT_TABLE( wxGridCornerLabelWindow, wxGridSubwindow ) - EVT_MOUSEWHEEL( wxGridCornerLabelWindow::OnMouseWheel ) - EVT_MOUSE_EVENTS( wxGridCornerLabelWindow::OnMouseEvent ) - EVT_PAINT( wxGridCornerLabelWindow::OnPaint ) - EVT_KEY_DOWN( wxGridCornerLabelWindow::OnKeyDown ) - EVT_KEY_UP( wxGridCornerLabelWindow::OnKeyUp ) - EVT_CHAR( wxGridCornerLabelWindow::OnChar ) -END_EVENT_TABLE() - -wxGridCornerLabelWindow::wxGridCornerLabelWindow( wxGrid *parent, - wxWindowID id, - const wxPoint &pos, const wxSize &size ) - : wxGridSubwindow(parent, id, pos, size) -{ - m_owner = parent; -} - -void wxGridCornerLabelWindow::OnPaint( wxPaintEvent& WXUNUSED(event) ) -{ - wxPaintDC dc(this); - - int client_height = 0; - int client_width = 0; - GetClientSize( &client_width, &client_height ); - - // VZ: any reason for this ifdef? (FIXME) -#if 0 -def __WXGTK__ - wxRect rect; - rect.SetX( 1 ); - rect.SetY( 1 ); - rect.SetWidth( client_width - 2 ); - rect.SetHeight( client_height - 2 ); - - wxRendererNative::Get().DrawHeaderButton( this, dc, rect, 0 ); -#else // !__WXGTK__ - dc.SetPen( wxPen(wxSystemSettings::GetColour(wxSYS_COLOUR_3DSHADOW), 1, wxSOLID) ); - dc.DrawLine( client_width - 1, client_height - 1, client_width - 1, 0 ); - dc.DrawLine( client_width - 1, client_height - 1, 0, client_height - 1 ); - dc.DrawLine( 0, 0, client_width, 0 ); - dc.DrawLine( 0, 0, 0, client_height ); - - dc.SetPen( *wxWHITE_PEN ); - dc.DrawLine( 1, 1, client_width - 1, 1 ); - dc.DrawLine( 1, 1, 1, client_height - 1 ); -#endif -} - -void wxGridCornerLabelWindow::OnMouseEvent( wxMouseEvent& event ) -{ - m_owner->ProcessCornerLabelMouseEvent( event ); -} - -void wxGridCornerLabelWindow::OnMouseWheel( wxMouseEvent& event ) -{ - m_owner->GetEventHandler()->ProcessEvent(event); -} - -// This seems to be required for wxMotif otherwise the mouse -// cursor must be in the cell edit control to get key events -// -void wxGridCornerLabelWindow::OnKeyDown( wxKeyEvent& event ) -{ - if ( !m_owner->GetEventHandler()->ProcessEvent( event ) ) - event.Skip(); -} - -void wxGridCornerLabelWindow::OnKeyUp( wxKeyEvent& event ) -{ - if ( !m_owner->GetEventHandler()->ProcessEvent( event ) ) - event.Skip(); -} - -void wxGridCornerLabelWindow::OnChar( wxKeyEvent& event ) -{ - if ( !m_owner->GetEventHandler()->ProcessEvent( event ) ) - event.Skip(); -} - -////////////////////////////////////////////////////////////////////// - -IMPLEMENT_DYNAMIC_CLASS( wxGridWindow, wxWindow ) - -BEGIN_EVENT_TABLE( wxGridWindow, wxGridSubwindow ) - EVT_PAINT( wxGridWindow::OnPaint ) - EVT_MOUSEWHEEL( wxGridWindow::OnMouseWheel ) - EVT_MOUSE_EVENTS( wxGridWindow::OnMouseEvent ) - EVT_KEY_DOWN( wxGridWindow::OnKeyDown ) - EVT_KEY_UP( wxGridWindow::OnKeyUp ) - EVT_CHAR( wxGridWindow::OnChar ) - EVT_SET_FOCUS( wxGridWindow::OnFocus ) - EVT_KILL_FOCUS( wxGridWindow::OnFocus ) - EVT_ERASE_BACKGROUND( wxGridWindow::OnEraseBackground ) -END_EVENT_TABLE() - -wxGridWindow::wxGridWindow( wxGrid *parent, - wxGridRowLabelWindow *rowLblWin, - wxGridColLabelWindow *colLblWin, - wxWindowID id, - const wxPoint &pos, - const wxSize &size ) - : wxGridSubwindow(parent, id, pos, size, - wxCLIP_CHILDREN, wxT("grid window") ) -{ - m_owner = parent; - m_rowLabelWin = rowLblWin; - m_colLabelWin = colLblWin; -} - -void wxGridWindow::OnPaint( wxPaintEvent &WXUNUSED(event) ) -{ - wxPaintDC dc( this ); - m_owner->PrepareDC( dc ); - wxRegion reg = GetUpdateRegion(); - wxGridCellCoordsArray dirtyCells = m_owner->CalcCellsExposed( reg ); - m_owner->DrawGridCellArea( dc, dirtyCells ); - -#if WXGRID_DRAW_LINES - m_owner->DrawAllGridLines( dc, reg ); -#endif - - m_owner->DrawGridSpace( dc ); - m_owner->DrawHighlight( dc, dirtyCells ); -} - -void wxGridWindow::ScrollWindow( int dx, int dy, const wxRect *rect ) -{ - wxWindow::ScrollWindow( dx, dy, rect ); - m_rowLabelWin->ScrollWindow( 0, dy, rect ); - m_colLabelWin->ScrollWindow( dx, 0, rect ); -} - -void wxGridWindow::OnMouseEvent( wxMouseEvent& event ) -{ - if (event.ButtonDown(wxMOUSE_BTN_LEFT) && FindFocus() != this) - SetFocus(); - - m_owner->ProcessGridCellMouseEvent( event ); -} - -void wxGridWindow::OnMouseWheel( wxMouseEvent& event ) -{ - m_owner->GetEventHandler()->ProcessEvent( event ); -} - -// This seems to be required for wxMotif/wxGTK otherwise the mouse -// cursor must be in the cell edit control to get key events -// -void wxGridWindow::OnKeyDown( wxKeyEvent& event ) -{ - if ( !m_owner->GetEventHandler()->ProcessEvent( event ) ) - event.Skip(); -} - -void wxGridWindow::OnKeyUp( wxKeyEvent& event ) -{ - if ( !m_owner->GetEventHandler()->ProcessEvent( event ) ) - event.Skip(); -} - -void wxGridWindow::OnChar( wxKeyEvent& event ) -{ - if ( !m_owner->GetEventHandler()->ProcessEvent( event ) ) - event.Skip(); -} - -void wxGridWindow::OnEraseBackground( wxEraseEvent& WXUNUSED(event) ) -{ -} - -void wxGridWindow::OnFocus(wxFocusEvent& event) -{ - // current cell cursor {dis,re}appears on focus change: - wxRect cursor = m_owner->CellToRect(m_owner->GetGridCursorRow(), - m_owner->GetGridCursorCol()); - Refresh(true, &cursor); - - // and if we have any selection, it has to be repainted, because it - // uses different colour when the grid is not focused: - if ( m_owner->IsSelection() ) - { - Refresh(); - } - else - { - // NB: Note that this code is in "else" branch only because the other - // branch refreshes everything and so there's no point in calling - // Refresh() again, *not* because it should only be done if - // !IsSelection(). If the above code is ever optimized to refresh - // only selected area, this needs to be moved out of the "else" - // branch so that it's always executed. - - // current cell cursor {dis,re}appears on focus change: - const wxGridCellCoords cursorCoords(m_owner->GetGridCursorRow(), - m_owner->GetGridCursorCol()); - const wxRect cursor = - m_owner->BlockToDeviceRect(cursorCoords, cursorCoords); - Refresh(true, &cursor); - } - - if ( !m_owner->GetEventHandler()->ProcessEvent( event ) ) - event.Skip(); -} - -////////////////////////////////////////////////////////////////////// - -// Internal Helper function for computing row or column from some -// (unscrolled) coordinate value, using either -// m_defaultRowHeight/m_defaultColWidth or binary search on array -// of m_rowBottoms/m_ColRights to speed up the search! - -// Internal helper macros for simpler use of that function - -static int CoordToRowOrCol(int coord, int defaultDist, int minDist, - const wxArrayInt& BorderArray, int nMax, - bool clipToMinMax); - -#define internalXToCol(x) XToCol(x, true) -#define internalYToRow(y) CoordToRowOrCol(y, m_defaultRowHeight, \ - m_minAcceptableRowHeight, \ - m_rowBottoms, m_numRows, true) - -///////////////////////////////////////////////////////////////////// - -#if wxUSE_EXTENDED_RTTI -WX_DEFINE_FLAGS( wxGridStyle ) - -wxBEGIN_FLAGS( wxGridStyle ) - // new style border flags, we put them first to - // use them for streaming out - wxFLAGS_MEMBER(wxBORDER_SIMPLE) - wxFLAGS_MEMBER(wxBORDER_SUNKEN) - wxFLAGS_MEMBER(wxBORDER_DOUBLE) - wxFLAGS_MEMBER(wxBORDER_RAISED) - wxFLAGS_MEMBER(wxBORDER_STATIC) - wxFLAGS_MEMBER(wxBORDER_NONE) - - // old style border flags - wxFLAGS_MEMBER(wxSIMPLE_BORDER) - wxFLAGS_MEMBER(wxSUNKEN_BORDER) - wxFLAGS_MEMBER(wxDOUBLE_BORDER) - wxFLAGS_MEMBER(wxRAISED_BORDER) - wxFLAGS_MEMBER(wxSTATIC_BORDER) - wxFLAGS_MEMBER(wxBORDER) - - // standard window styles - wxFLAGS_MEMBER(wxTAB_TRAVERSAL) - wxFLAGS_MEMBER(wxCLIP_CHILDREN) - wxFLAGS_MEMBER(wxTRANSPARENT_WINDOW) - wxFLAGS_MEMBER(wxWANTS_CHARS) - wxFLAGS_MEMBER(wxFULL_REPAINT_ON_RESIZE) - wxFLAGS_MEMBER(wxALWAYS_SHOW_SB) - wxFLAGS_MEMBER(wxVSCROLL) - wxFLAGS_MEMBER(wxHSCROLL) - -wxEND_FLAGS( wxGridStyle ) - -IMPLEMENT_DYNAMIC_CLASS_XTI(wxGrid, wxScrolledWindow,"wx/grid.h") - -wxBEGIN_PROPERTIES_TABLE(wxGrid) - wxHIDE_PROPERTY( Children ) - wxPROPERTY_FLAGS( WindowStyle , wxGridStyle , long , SetWindowStyleFlag , GetWindowStyleFlag , EMPTY_MACROVALUE, 0 /*flags*/ , wxT("Helpstring") , wxT("group")) // style -wxEND_PROPERTIES_TABLE() - -wxBEGIN_HANDLERS_TABLE(wxGrid) -wxEND_HANDLERS_TABLE() - -wxCONSTRUCTOR_5( wxGrid , wxWindow* , Parent , wxWindowID , Id , wxPoint , Position , wxSize , Size , long , WindowStyle ) - -/* - TODO : Expose more information of a list's layout, etc. via appropriate objects (e.g., NotebookPageInfo) -*/ -#else -IMPLEMENT_DYNAMIC_CLASS( wxGrid, wxScrolledWindow ) -#endif - -BEGIN_EVENT_TABLE( wxGrid, wxScrolledWindow ) - EVT_PAINT( wxGrid::OnPaint ) - EVT_SIZE( wxGrid::OnSize ) - EVT_KEY_DOWN( wxGrid::OnKeyDown ) - EVT_KEY_UP( wxGrid::OnKeyUp ) - EVT_CHAR ( wxGrid::OnChar ) - EVT_ERASE_BACKGROUND( wxGrid::OnEraseBackground ) -END_EVENT_TABLE() - -wxGrid::wxGrid() -{ - // in order to make sure that a size event is not - // trigerred in a unfinished state - m_cornerLabelWin = NULL; - m_rowLabelWin = NULL; - m_colLabelWin = NULL; - m_gridWin = NULL; -} - -wxGrid::wxGrid( wxWindow *parent, - wxWindowID id, - const wxPoint& pos, - const wxSize& size, - long style, - const wxString& name ) - : wxScrolledWindow( parent, id, pos, size, (style | wxWANTS_CHARS), name ), - m_colMinWidths(GRID_HASH_SIZE), - m_rowMinHeights(GRID_HASH_SIZE) -{ - Create(); - SetInitialSize(size); -} - -bool wxGrid::Create(wxWindow *parent, wxWindowID id, - const wxPoint& pos, const wxSize& size, - long style, const wxString& name) -{ - if (!wxScrolledWindow::Create(parent, id, pos, size, - style | wxWANTS_CHARS, name)) - return false; - - m_colMinWidths = wxLongToLongHashMap(GRID_HASH_SIZE); - m_rowMinHeights = wxLongToLongHashMap(GRID_HASH_SIZE); - - Create(); - SetInitialSize(size); - CalcDimensions(); - - return true; -} - -wxGrid::~wxGrid() -{ - if ( m_winCapture && m_winCapture->HasCapture() ) - m_winCapture->ReleaseMouse(); - - // Ensure that the editor control is destroyed before the grid is, - // otherwise we crash later when the editor tries to do something with the - // half destroyed grid - HideCellEditControl(); - - // Must do this or ~wxScrollHelper will pop the wrong event handler - SetTargetWindow(this); - ClearAttrCache(); - wxSafeDecRef(m_defaultCellAttr); - -#ifdef DEBUG_ATTR_CACHE - size_t total = gs_nAttrCacheHits + gs_nAttrCacheMisses; - wxPrintf(_T("wxGrid attribute cache statistics: " - "total: %u, hits: %u (%u%%)\n"), - total, gs_nAttrCacheHits, - total ? (gs_nAttrCacheHits*100) / total : 0); -#endif - - // if we own the table, just delete it, otherwise at least don't leave it - // with dangling view pointer - if ( m_ownTable ) - delete m_table; - else if ( m_table && m_table->GetView() == this ) - m_table->SetView(NULL); - - delete m_typeRegistry; - delete m_selection; -} - -// -// ----- internal init and update functions -// - -// NOTE: If using the default visual attributes works everywhere then this can -// be removed as well as the #else cases below. -#define _USE_VISATTR 0 - -void wxGrid::Create() -{ - // set to true by CreateGrid - m_created = false; - - // create the type registry - m_typeRegistry = new wxGridTypeRegistry; - m_selection = NULL; - - m_table = (wxGridTableBase *) NULL; - m_ownTable = false; - - m_cellEditCtrlEnabled = false; - - m_defaultCellAttr = new wxGridCellAttr(); - - // Set default cell attributes - m_defaultCellAttr->SetDefAttr(m_defaultCellAttr); - m_defaultCellAttr->SetKind(wxGridCellAttr::Default); - m_defaultCellAttr->SetFont(GetFont()); - m_defaultCellAttr->SetAlignment(wxALIGN_LEFT, wxALIGN_TOP); - m_defaultCellAttr->SetRenderer(new wxGridCellStringRenderer); - m_defaultCellAttr->SetEditor(new wxGridCellTextEditor); - -#if _USE_VISATTR - wxVisualAttributes gva = wxListBox::GetClassDefaultAttributes(); - wxVisualAttributes lva = wxPanel::GetClassDefaultAttributes(); - - m_defaultCellAttr->SetTextColour(gva.colFg); - m_defaultCellAttr->SetBackgroundColour(gva.colBg); - -#else - m_defaultCellAttr->SetTextColour( - wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT)); - m_defaultCellAttr->SetBackgroundColour( - wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW)); -#endif - - m_numRows = 0; - m_numCols = 0; - m_currentCellCoords = wxGridNoCellCoords; - - m_rowLabelWidth = WXGRID_DEFAULT_ROW_LABEL_WIDTH; - m_colLabelHeight = WXGRID_DEFAULT_COL_LABEL_HEIGHT; - - // subwindow components that make up the wxGrid - m_rowLabelWin = new wxGridRowLabelWindow( this, - wxID_ANY, - wxDefaultPosition, - wxDefaultSize ); - - m_colLabelWin = new wxGridColLabelWindow( this, - wxID_ANY, - wxDefaultPosition, - wxDefaultSize ); - - m_cornerLabelWin = new wxGridCornerLabelWindow( this, - wxID_ANY, - wxDefaultPosition, - wxDefaultSize ); - - m_gridWin = new wxGridWindow( this, - m_rowLabelWin, - m_colLabelWin, - wxID_ANY, - wxDefaultPosition, - wxDefaultSize ); - - SetTargetWindow( m_gridWin ); - -#if _USE_VISATTR - wxColour gfg = gva.colFg; - wxColour gbg = gva.colBg; - wxColour lfg = lva.colFg; - wxColour lbg = lva.colBg; -#else - wxColour gfg = wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOWTEXT ); - wxColour gbg = wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOW ); - wxColour lfg = wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOWTEXT ); - wxColour lbg = wxSystemSettings::GetColour( wxSYS_COLOUR_BTNFACE ); -#endif - - m_cornerLabelWin->SetOwnForegroundColour(lfg); - m_cornerLabelWin->SetOwnBackgroundColour(lbg); - m_rowLabelWin->SetOwnForegroundColour(lfg); - m_rowLabelWin->SetOwnBackgroundColour(lbg); - m_colLabelWin->SetOwnForegroundColour(lfg); - m_colLabelWin->SetOwnBackgroundColour(lbg); - - m_gridWin->SetOwnForegroundColour(gfg); - m_gridWin->SetOwnBackgroundColour(gbg); - - Init(); -} - -bool wxGrid::CreateGrid( int numRows, int numCols, - wxGrid::wxGridSelectionModes selmode ) -{ - wxCHECK_MSG( !m_created, - false, - wxT("wxGrid::CreateGrid or wxGrid::SetTable called more than once") ); - - m_numRows = numRows; - m_numCols = numCols; - - m_table = new wxGridStringTable( m_numRows, m_numCols ); - m_table->SetView( this ); - m_ownTable = true; - m_selection = new wxGridSelection( this, selmode ); - - CalcDimensions(); - - m_created = true; - - return m_created; -} - -void wxGrid::SetSelectionMode(wxGrid::wxGridSelectionModes selmode) -{ - wxCHECK_RET( m_created, - wxT("Called wxGrid::SetSelectionMode() before calling CreateGrid()") ); - - m_selection->SetSelectionMode( selmode ); -} - -wxGrid::wxGridSelectionModes wxGrid::GetSelectionMode() const -{ - wxCHECK_MSG( m_created, wxGrid::wxGridSelectCells, - wxT("Called wxGrid::GetSelectionMode() before calling CreateGrid()") ); - - return m_selection->GetSelectionMode(); -} - -bool wxGrid::SetTable( wxGridTableBase *table, bool takeOwnership, - wxGrid::wxGridSelectionModes selmode ) -{ - bool checkSelection = false; - if ( m_created ) - { - // stop all processing - m_created = false; - - if (m_table) - { - m_table->SetView(0); - if( m_ownTable ) - delete m_table; - m_table = NULL; - } - - delete m_selection; - m_selection = NULL; - - m_ownTable = false; - m_numRows = 0; - m_numCols = 0; - checkSelection = true; - - // kill row and column size arrays - m_colWidths.Empty(); - m_colRights.Empty(); - m_rowHeights.Empty(); - m_rowBottoms.Empty(); - } - - if (table) - { - m_numRows = table->GetNumberRows(); - m_numCols = table->GetNumberCols(); - - m_table = table; - m_table->SetView( this ); - m_ownTable = takeOwnership; - m_selection = new wxGridSelection( this, selmode ); - if (checkSelection) - { - // If the newly set table is smaller than the - // original one current cell and selection regions - // might be invalid, - m_selectingKeyboard = wxGridNoCellCoords; - m_currentCellCoords = - wxGridCellCoords(wxMin(m_numRows, m_currentCellCoords.GetRow()), - wxMin(m_numCols, m_currentCellCoords.GetCol())); - if (m_selectingTopLeft.GetRow() >= m_numRows || - m_selectingTopLeft.GetCol() >= m_numCols) - { - m_selectingTopLeft = wxGridNoCellCoords; - m_selectingBottomRight = wxGridNoCellCoords; - } - else - m_selectingBottomRight = - wxGridCellCoords(wxMin(m_numRows, - m_selectingBottomRight.GetRow()), - wxMin(m_numCols, - m_selectingBottomRight.GetCol())); - } - CalcDimensions(); - - m_created = true; - } - - return m_created; -} - -void wxGrid::Init() -{ - m_rowLabelWidth = WXGRID_DEFAULT_ROW_LABEL_WIDTH; - m_colLabelHeight = WXGRID_DEFAULT_COL_LABEL_HEIGHT; - - if ( m_rowLabelWin ) - { - m_labelBackgroundColour = m_rowLabelWin->GetBackgroundColour(); - } - else - { - m_labelBackgroundColour = *wxWHITE; - } - - m_labelTextColour = *wxBLACK; - - // init attr cache - m_attrCache.row = -1; - m_attrCache.col = -1; - m_attrCache.attr = NULL; - - // TODO: something better than this ? - // - m_labelFont = this->GetFont(); - m_labelFont.SetWeight( wxBOLD ); - - m_rowLabelHorizAlign = wxALIGN_CENTRE; - m_rowLabelVertAlign = wxALIGN_CENTRE; - - m_colLabelHorizAlign = wxALIGN_CENTRE; - m_colLabelVertAlign = wxALIGN_CENTRE; - m_colLabelTextOrientation = wxHORIZONTAL; - - m_defaultColWidth = WXGRID_DEFAULT_COL_WIDTH; - m_defaultRowHeight = m_gridWin->GetCharHeight(); - - m_minAcceptableColWidth = WXGRID_MIN_COL_WIDTH; - m_minAcceptableRowHeight = WXGRID_MIN_ROW_HEIGHT; - -#if defined(__WXMOTIF__) || defined(__WXGTK__) // see also text ctrl sizing in ShowCellEditControl() - m_defaultRowHeight += 8; -#else - m_defaultRowHeight += 4; -#endif - - m_gridLineColour = wxColour( 192,192,192 ); - m_gridLinesEnabled = true; - m_cellHighlightColour = *wxBLACK; - m_cellHighlightPenWidth = 2; - m_cellHighlightROPenWidth = 1; - - m_canDragColMove = false; - - m_cursorMode = WXGRID_CURSOR_SELECT_CELL; - m_winCapture = (wxWindow *)NULL; - m_canDragRowSize = true; - m_canDragColSize = true; - m_canDragGridSize = true; - m_canDragCell = false; - m_dragLastPos = -1; - m_dragRowOrCol = -1; - m_isDragging = false; - m_startDragPos = wxDefaultPosition; - - m_waitForSlowClick = false; - - m_rowResizeCursor = wxCursor( wxCURSOR_SIZENS ); - m_colResizeCursor = wxCursor( wxCURSOR_SIZEWE ); - - m_currentCellCoords = wxGridNoCellCoords; - - m_batchCount = 0; // used by ClearSelection() so init before calling it - ClearSelection(); - - m_selectionBackground = wxSystemSettings::GetColour(wxSYS_COLOUR_HIGHLIGHT); - m_selectionForeground = wxSystemSettings::GetColour(wxSYS_COLOUR_HIGHLIGHTTEXT); - - m_editable = true; // default for whole grid - - m_inOnKeyDown = false; - - m_extraWidth = - m_extraHeight = 0; - - m_scrollLineX = GRID_SCROLL_LINE_X; - m_scrollLineY = GRID_SCROLL_LINE_Y; -} - -// ---------------------------------------------------------------------------- -// the idea is to call these functions only when necessary because they create -// quite big arrays which eat memory mostly unnecessary - in particular, if -// default widths/heights are used for all rows/columns, we may not use these -// arrays at all -// -// with some extra code, it should be possible to only store the widths/heights -// different from default ones (resulting in space savings for huge grids) but -// this is not done currently -// ---------------------------------------------------------------------------- - -void wxGrid::InitRowHeights() -{ - m_rowHeights.Empty(); - m_rowBottoms.Empty(); - - m_rowHeights.Alloc( m_numRows ); - m_rowBottoms.Alloc( m_numRows ); - - m_rowHeights.Add( m_defaultRowHeight, m_numRows ); - - int rowBottom = 0; - for ( int i = 0; i < m_numRows; i++ ) - { - rowBottom += m_defaultRowHeight; - m_rowBottoms.Add( rowBottom ); - } -} - -void wxGrid::InitColWidths() -{ - m_colWidths.Empty(); - m_colRights.Empty(); - - m_colWidths.Alloc( m_numCols ); - m_colRights.Alloc( m_numCols ); - - m_colWidths.Add( m_defaultColWidth, m_numCols ); - - int colRight = 0; - for ( int i = 0; i < m_numCols; i++ ) - { - colRight = ( GetColPos( i ) + 1 ) * m_defaultColWidth; - m_colRights.Add( colRight ); - } -} - -int wxGrid::GetColWidth(int col) const -{ - return m_colWidths.IsEmpty() ? m_defaultColWidth : m_colWidths[col]; -} - -int wxGrid::GetColLeft(int col) const -{ - return m_colRights.IsEmpty() ? GetColPos( col ) * m_defaultColWidth - : m_colRights[col] - m_colWidths[col]; -} - -int wxGrid::GetColRight(int col) const -{ - return m_colRights.IsEmpty() ? (GetColPos( col ) + 1) * m_defaultColWidth - : m_colRights[col]; -} - -int wxGrid::GetRowHeight(int row) const -{ - return m_rowHeights.IsEmpty() ? m_defaultRowHeight : m_rowHeights[row]; -} - -int wxGrid::GetRowTop(int row) const -{ - return m_rowBottoms.IsEmpty() ? row * m_defaultRowHeight - : m_rowBottoms[row] - m_rowHeights[row]; -} - -int wxGrid::GetRowBottom(int row) const -{ - return m_rowBottoms.IsEmpty() ? (row + 1) * m_defaultRowHeight - : m_rowBottoms[row]; -} - -void wxGrid::CalcDimensions() -{ - // compute the size of the scrollable area - int w = m_numCols > 0 ? GetColRight(GetColAt(m_numCols - 1)) : 0; - int h = m_numRows > 0 ? GetRowBottom(m_numRows - 1) : 0; - - w += m_extraWidth; - h += m_extraHeight; - - // take into account editor if shown - if ( IsCellEditControlShown() ) - { - int w2, h2; - int r = m_currentCellCoords.GetRow(); - int c = m_currentCellCoords.GetCol(); - int x = GetColLeft(c); - int y = GetRowTop(r); - - // how big is the editor - wxGridCellAttr* attr = GetCellAttr(r, c); - wxGridCellEditor* editor = attr->GetEditor(this, r, c); - editor->GetControl()->GetSize(&w2, &h2); - w2 += x; - h2 += y; - if ( w2 > w ) - w = w2; - if ( h2 > h ) - h = h2; - editor->DecRef(); - attr->DecRef(); - } - - // preserve (more or less) the previous position - int x, y; - GetViewStart( &x, &y ); - - // ensure the position is valid for the new scroll ranges - if ( x >= w ) - x = wxMax( w - 1, 0 ); - if ( y >= h ) - y = wxMax( h - 1, 0 ); - - // do set scrollbar parameters - SetScrollbars( m_scrollLineX, m_scrollLineY, - GetScrollX(w), GetScrollY(h), - x, y, - GetBatchCount() != 0); - - // if our OnSize() hadn't been called (it would if we have scrollbars), we - // still must reposition the children - CalcWindowSizes(); -} - -void wxGrid::CalcWindowSizes() -{ - // escape if the window is has not been fully created yet - - if ( m_cornerLabelWin == NULL ) - return; - - int cw, ch; - GetClientSize( &cw, &ch ); - - // this block of code tries to work around the following problem: the grid - // could have been just resized to have enough space to show the full grid - // window contents without the scrollbars, but its client size could be - // not big enough because the grid has the scrollbars right now and so the - // scrollbars would remain even though we don't need them any more - // - // to prevent this from happening, check if we have enough space for - // everything without the scrollbars and explicitly disable them then - wxSize size = GetSize() - GetWindowBorderSize(); - if ( size != wxSize(cw, ch) ) - { - // check if we have enough space for grid window after accounting for - // the fixed size elements - size.x -= m_rowLabelWidth; - size.y -= m_colLabelHeight; - - const wxSize vsize = m_gridWin->GetVirtualSize(); - - if ( size.x >= vsize.x && size.y >= vsize.y ) - { - // yes, we do, so remove the scrollbars and use the new client size - // (which should be the same as full window size - borders now) - SetScrollbars(0, 0, 0, 0); - GetClientSize(&cw, &ch); - } - } - - // the grid may be too small to have enough space for the labels yet, don't - // size the windows to negative sizes in this case - int gw = cw - m_rowLabelWidth; - int gh = ch - m_colLabelHeight; - if (gw < 0) - gw = 0; - if (gh < 0) - gh = 0; - - if ( m_cornerLabelWin && m_cornerLabelWin->IsShown() ) - m_cornerLabelWin->SetSize( 0, 0, m_rowLabelWidth, m_colLabelHeight ); - - if ( m_colLabelWin && m_colLabelWin->IsShown() ) - m_colLabelWin->SetSize( m_rowLabelWidth, 0, gw, m_colLabelHeight ); - - if ( m_rowLabelWin && m_rowLabelWin->IsShown() ) - m_rowLabelWin->SetSize( 0, m_colLabelHeight, m_rowLabelWidth, gh ); - - if ( m_gridWin && m_gridWin->IsShown() ) - m_gridWin->SetSize( m_rowLabelWidth, m_colLabelHeight, gw, gh ); -} - -// this is called when the grid table sends a message -// to indicate that it has been redimensioned -// -bool wxGrid::Redimension( wxGridTableMessage& msg ) -{ - int i; - bool result = false; - - // Clear the attribute cache as the attribute might refer to a different - // cell than stored in the cache after adding/removing rows/columns. - ClearAttrCache(); - - // By the same reasoning, the editor should be dismissed if columns are - // added or removed. And for consistency, it should IMHO always be - // removed, not only if the cell "underneath" it actually changes. - // For now, I intentionally do not save the editor's content as the - // cell it might want to save that stuff to might no longer exist. - HideCellEditControl(); - -#if 0 - // if we were using the default widths/heights so far, we must change them - // now - if ( m_colWidths.IsEmpty() ) - { - InitColWidths(); - } - - if ( m_rowHeights.IsEmpty() ) - { - InitRowHeights(); - } -#endif - - switch ( msg.GetId() ) - { - case wxGRIDTABLE_NOTIFY_ROWS_INSERTED: - { - size_t pos = msg.GetCommandInt(); - int numRows = msg.GetCommandInt2(); - - m_numRows += numRows; - - if ( !m_rowHeights.IsEmpty() ) - { - m_rowHeights.Insert( m_defaultRowHeight, pos, numRows ); - m_rowBottoms.Insert( 0, pos, numRows ); - - int bottom = 0; - if ( pos > 0 ) - bottom = m_rowBottoms[pos - 1]; - - for ( i = pos; i < m_numRows; i++ ) - { - bottom += m_rowHeights[i]; - m_rowBottoms[i] = bottom; - } - } - - if ( m_currentCellCoords == wxGridNoCellCoords ) - { - // if we have just inserted cols into an empty grid the current - // cell will be undefined... - // - SetCurrentCell( 0, 0 ); - } - - if ( m_selection ) - m_selection->UpdateRows( pos, numRows ); - wxGridCellAttrProvider * attrProvider = m_table->GetAttrProvider(); - if (attrProvider) - attrProvider->UpdateAttrRows( pos, numRows ); - - if ( !GetBatchCount() ) - { - CalcDimensions(); - m_rowLabelWin->Refresh(); - } - } - result = true; - break; - - case wxGRIDTABLE_NOTIFY_ROWS_APPENDED: - { - int numRows = msg.GetCommandInt(); - int oldNumRows = m_numRows; - m_numRows += numRows; - - if ( !m_rowHeights.IsEmpty() ) - { - m_rowHeights.Add( m_defaultRowHeight, numRows ); - m_rowBottoms.Add( 0, numRows ); - - int bottom = 0; - if ( oldNumRows > 0 ) - bottom = m_rowBottoms[oldNumRows - 1]; - - for ( i = oldNumRows; i < m_numRows; i++ ) - { - bottom += m_rowHeights[i]; - m_rowBottoms[i] = bottom; - } - } - - if ( m_currentCellCoords == wxGridNoCellCoords ) - { - // if we have just inserted cols into an empty grid the current - // cell will be undefined... - // - SetCurrentCell( 0, 0 ); - } - - if ( !GetBatchCount() ) - { - CalcDimensions(); - m_rowLabelWin->Refresh(); - } - } - result = true; - break; - - case wxGRIDTABLE_NOTIFY_ROWS_DELETED: - { - size_t pos = msg.GetCommandInt(); - int numRows = msg.GetCommandInt2(); - m_numRows -= numRows; - - if ( !m_rowHeights.IsEmpty() ) - { - m_rowHeights.RemoveAt( pos, numRows ); - m_rowBottoms.RemoveAt( pos, numRows ); - - int h = 0; - for ( i = 0; i < m_numRows; i++ ) - { - h += m_rowHeights[i]; - m_rowBottoms[i] = h; - } - } - - if ( !m_numRows ) - { - m_currentCellCoords = wxGridNoCellCoords; - } - else - { - if ( m_currentCellCoords.GetRow() >= m_numRows ) - m_currentCellCoords.Set( 0, 0 ); - } - - if ( m_selection ) - m_selection->UpdateRows( pos, -((int)numRows) ); - wxGridCellAttrProvider * attrProvider = m_table->GetAttrProvider(); - if (attrProvider) - { - attrProvider->UpdateAttrRows( pos, -((int)numRows) ); - -// ifdef'd out following patch from Paul Gammans -#if 0 - // No need to touch column attributes, unless we - // removed _all_ rows, in this case, we remove - // all column attributes. - // I hate to do this here, but the - // needed data is not available inside UpdateAttrRows. - if ( !GetNumberRows() ) - attrProvider->UpdateAttrCols( 0, -GetNumberCols() ); -#endif - } - - if ( !GetBatchCount() ) - { - CalcDimensions(); - m_rowLabelWin->Refresh(); - } - } - result = true; - break; - - case wxGRIDTABLE_NOTIFY_COLS_INSERTED: - { - size_t pos = msg.GetCommandInt(); - int numCols = msg.GetCommandInt2(); - m_numCols += numCols; - - if ( !m_colAt.IsEmpty() ) - { - //Shift the column IDs - int i; - for ( i = 0; i < m_numCols - numCols; i++ ) - { - if ( m_colAt[i] >= (int)pos ) - m_colAt[i] += numCols; - } - - m_colAt.Insert( pos, pos, numCols ); - - //Set the new columns' positions - for ( i = pos + 1; i < (int)pos + numCols; i++ ) - { - m_colAt[i] = i; - } - } - - if ( !m_colWidths.IsEmpty() ) - { - m_colWidths.Insert( m_defaultColWidth, pos, numCols ); - m_colRights.Insert( 0, pos, numCols ); - - int right = 0; - if ( pos > 0 ) - right = m_colRights[GetColAt( pos - 1 )]; - - int colPos; - for ( colPos = pos; colPos < m_numCols; colPos++ ) - { - i = GetColAt( colPos ); - - right += m_colWidths[i]; - m_colRights[i] = right; - } - } - - if ( m_currentCellCoords == wxGridNoCellCoords ) - { - // if we have just inserted cols into an empty grid the current - // cell will be undefined... - // - SetCurrentCell( 0, 0 ); - } - - if ( m_selection ) - m_selection->UpdateCols( pos, numCols ); - wxGridCellAttrProvider * attrProvider = m_table->GetAttrProvider(); - if (attrProvider) - attrProvider->UpdateAttrCols( pos, numCols ); - if ( !GetBatchCount() ) - { - CalcDimensions(); - m_colLabelWin->Refresh(); - } - } - result = true; - break; - - case wxGRIDTABLE_NOTIFY_COLS_APPENDED: - { - int numCols = msg.GetCommandInt(); - int oldNumCols = m_numCols; - m_numCols += numCols; - - if ( !m_colAt.IsEmpty() ) - { - m_colAt.Add( 0, numCols ); - - //Set the new columns' positions - int i; - for ( i = oldNumCols; i < m_numCols; i++ ) - { - m_colAt[i] = i; - } - } - - if ( !m_colWidths.IsEmpty() ) - { - m_colWidths.Add( m_defaultColWidth, numCols ); - m_colRights.Add( 0, numCols ); - - int right = 0; - if ( oldNumCols > 0 ) - right = m_colRights[GetColAt( oldNumCols - 1 )]; - - int colPos; - for ( colPos = oldNumCols; colPos < m_numCols; colPos++ ) - { - i = GetColAt( colPos ); - - right += m_colWidths[i]; - m_colRights[i] = right; - } - } - - if ( m_currentCellCoords == wxGridNoCellCoords ) - { - // if we have just inserted cols into an empty grid the current - // cell will be undefined... - // - SetCurrentCell( 0, 0 ); - } - if ( !GetBatchCount() ) - { - CalcDimensions(); - m_colLabelWin->Refresh(); - } - } - result = true; - break; - - case wxGRIDTABLE_NOTIFY_COLS_DELETED: - { - size_t pos = msg.GetCommandInt(); - int numCols = msg.GetCommandInt2(); - m_numCols -= numCols; - - if ( !m_colAt.IsEmpty() ) - { - int colID = GetColAt( pos ); - - m_colAt.RemoveAt( pos, numCols ); - - //Shift the column IDs - int colPos; - for ( colPos = 0; colPos < m_numCols; colPos++ ) - { - if ( m_colAt[colPos] > colID ) - m_colAt[colPos] -= numCols; - } - } - - if ( !m_colWidths.IsEmpty() ) - { - m_colWidths.RemoveAt( pos, numCols ); - m_colRights.RemoveAt( pos, numCols ); - - int w = 0; - int colPos; - for ( colPos = 0; colPos < m_numCols; colPos++ ) - { - i = GetColAt( colPos ); - - w += m_colWidths[i]; - m_colRights[i] = w; - } - } - - if ( !m_numCols ) - { - m_currentCellCoords = wxGridNoCellCoords; - } - else - { - if ( m_currentCellCoords.GetCol() >= m_numCols ) - m_currentCellCoords.Set( 0, 0 ); - } - - if ( m_selection ) - m_selection->UpdateCols( pos, -((int)numCols) ); - wxGridCellAttrProvider * attrProvider = m_table->GetAttrProvider(); - if (attrProvider) - { - attrProvider->UpdateAttrCols( pos, -((int)numCols) ); - -// ifdef'd out following patch from Paul Gammans -#if 0 - // No need to touch row attributes, unless we - // removed _all_ columns, in this case, we remove - // all row attributes. - // I hate to do this here, but the - // needed data is not available inside UpdateAttrCols. - if ( !GetNumberCols() ) - attrProvider->UpdateAttrRows( 0, -GetNumberRows() ); -#endif - } - - if ( !GetBatchCount() ) - { - CalcDimensions(); - m_colLabelWin->Refresh(); - } - } - result = true; - break; - } - - if (result && !GetBatchCount() ) - m_gridWin->Refresh(); - - return result; -} - -wxArrayInt wxGrid::CalcRowLabelsExposed( const wxRegion& reg ) -{ - wxRegionIterator iter( reg ); - wxRect r; - - wxArrayInt rowlabels; - - int top, bottom; - while ( iter ) - { - r = iter.GetRect(); - - // TODO: remove this when we can... - // There is a bug in wxMotif that gives garbage update - // rectangles if you jump-scroll a long way by clicking the - // scrollbar with middle button. This is a work-around - // -#if defined(__WXMOTIF__) - int cw, ch; - m_gridWin->GetClientSize( &cw, &ch ); - if ( r.GetTop() > ch ) - r.SetTop( 0 ); - r.SetBottom( wxMin( r.GetBottom(), ch ) ); -#endif - - // logical bounds of update region - // - int dummy; - CalcUnscrolledPosition( 0, r.GetTop(), &dummy, &top ); - CalcUnscrolledPosition( 0, r.GetBottom(), &dummy, &bottom ); - - // find the row labels within these bounds - // - int row; - for ( row = internalYToRow(top); row < m_numRows; row++ ) - { - if ( GetRowBottom(row) < top ) - continue; - - if ( GetRowTop(row) > bottom ) - break; - - rowlabels.Add( row ); - } - - ++iter; - } - - return rowlabels; -} - -wxArrayInt wxGrid::CalcColLabelsExposed( const wxRegion& reg ) -{ - wxRegionIterator iter( reg ); - wxRect r; - - wxArrayInt colLabels; - - int left, right; - while ( iter ) - { - r = iter.GetRect(); - - // TODO: remove this when we can... - // There is a bug in wxMotif that gives garbage update - // rectangles if you jump-scroll a long way by clicking the - // scrollbar with middle button. This is a work-around - // -#if defined(__WXMOTIF__) - int cw, ch; - m_gridWin->GetClientSize( &cw, &ch ); - if ( r.GetLeft() > cw ) - r.SetLeft( 0 ); - r.SetRight( wxMin( r.GetRight(), cw ) ); -#endif - - // logical bounds of update region - // - int dummy; - CalcUnscrolledPosition( r.GetLeft(), 0, &left, &dummy ); - CalcUnscrolledPosition( r.GetRight(), 0, &right, &dummy ); - - // find the cells within these bounds - // - int col; - int colPos; - for ( colPos = GetColPos( internalXToCol(left) ); colPos < m_numCols; colPos++ ) - { - col = GetColAt( colPos ); - - if ( GetColRight(col) < left ) - continue; - - if ( GetColLeft(col) > right ) - break; - - colLabels.Add( col ); - } - - ++iter; - } - - return colLabels; -} - -wxGridCellCoordsArray wxGrid::CalcCellsExposed( const wxRegion& reg ) -{ - wxRegionIterator iter( reg ); - wxRect r; - - wxGridCellCoordsArray cellsExposed; - - int left, top, right, bottom; - while ( iter ) - { - r = iter.GetRect(); - - // TODO: remove this when we can... - // There is a bug in wxMotif that gives garbage update - // rectangles if you jump-scroll a long way by clicking the - // scrollbar with middle button. This is a work-around - // -#if defined(__WXMOTIF__) - int cw, ch; - m_gridWin->GetClientSize( &cw, &ch ); - if ( r.GetTop() > ch ) r.SetTop( 0 ); - if ( r.GetLeft() > cw ) r.SetLeft( 0 ); - r.SetRight( wxMin( r.GetRight(), cw ) ); - r.SetBottom( wxMin( r.GetBottom(), ch ) ); -#endif - - // logical bounds of update region - // - CalcUnscrolledPosition( r.GetLeft(), r.GetTop(), &left, &top ); - CalcUnscrolledPosition( r.GetRight(), r.GetBottom(), &right, &bottom ); - - // find the cells within these bounds - // - int row, col; - for ( row = internalYToRow(top); row < m_numRows; row++ ) - { - if ( GetRowBottom(row) <= top ) - continue; - - if ( GetRowTop(row) > bottom ) - break; - - int colPos; - for ( colPos = GetColPos( internalXToCol(left) ); colPos < m_numCols; colPos++ ) - { - col = GetColAt( colPos ); - - if ( GetColRight(col) <= left ) - continue; - - if ( GetColLeft(col) > right ) - break; - - cellsExposed.Add( wxGridCellCoords( row, col ) ); - } - } - - ++iter; - } - - return cellsExposed; -} - - -void wxGrid::ProcessRowLabelMouseEvent( wxMouseEvent& event ) -{ - int x, y, row; - wxPoint pos( event.GetPosition() ); - CalcUnscrolledPosition( pos.x, pos.y, &x, &y ); - - if ( event.Dragging() ) - { - if (!m_isDragging) - { - m_isDragging = true; - m_rowLabelWin->CaptureMouse(); - } - - if ( event.LeftIsDown() ) - { - switch ( m_cursorMode ) - { - case WXGRID_CURSOR_RESIZE_ROW: - { - int cw, ch, left, dummy; - m_gridWin->GetClientSize( &cw, &ch ); - CalcUnscrolledPosition( 0, 0, &left, &dummy ); - - wxClientDC dc( m_gridWin ); - PrepareDC( dc ); - y = wxMax( y, - GetRowTop(m_dragRowOrCol) + - GetRowMinimalHeight(m_dragRowOrCol) ); - dc.SetLogicalFunction(wxINVERT); - if ( m_dragLastPos >= 0 ) - { - dc.DrawLine( left, m_dragLastPos, left+cw, m_dragLastPos ); - } - dc.DrawLine( left, y, left+cw, y ); - m_dragLastPos = y; - } - break; - - case WXGRID_CURSOR_SELECT_ROW: - { - if ( (row = YToRow( y )) >= 0 ) - { - if ( m_selection ) - { - m_selection->SelectRow( row, - event.ControlDown(), - event.ShiftDown(), - event.AltDown(), - event.MetaDown() ); - } - } - } - break; - - // default label to suppress warnings about "enumeration value - // 'xxx' not handled in switch - default: - break; - } - } - return; - } - - if ( m_isDragging && (event.Entering() || event.Leaving()) ) - return; - - if (m_isDragging) - { - if (m_rowLabelWin->HasCapture()) - m_rowLabelWin->ReleaseMouse(); - m_isDragging = false; - } - - // ------------ Entering or leaving the window - // - if ( event.Entering() || event.Leaving() ) - { - ChangeCursorMode(WXGRID_CURSOR_SELECT_CELL, m_rowLabelWin); - } - - // ------------ Left button pressed - // - else if ( event.LeftDown() ) - { - // don't send a label click event for a hit on the - // edge of the row label - this is probably the user - // wanting to resize the row - // - if ( YToEdgeOfRow(y) < 0 ) - { - row = YToRow(y); - if ( row >= 0 && - !SendEvent( wxEVT_GRID_LABEL_LEFT_CLICK, row, -1, event ) ) - { - if ( !event.ShiftDown() && !event.CmdDown() ) - ClearSelection(); - if ( m_selection ) - { - if ( event.ShiftDown() ) - { - m_selection->SelectBlock( m_currentCellCoords.GetRow(), - 0, - row, - GetNumberCols() - 1, - event.ControlDown(), - event.ShiftDown(), - event.AltDown(), - event.MetaDown() ); - } - else - { - m_selection->SelectRow( row, - event.ControlDown(), - event.ShiftDown(), - event.AltDown(), - event.MetaDown() ); - } - } - - ChangeCursorMode(WXGRID_CURSOR_SELECT_ROW, m_rowLabelWin); - } - } - else - { - // starting to drag-resize a row - if ( CanDragRowSize() ) - ChangeCursorMode(WXGRID_CURSOR_RESIZE_ROW, m_rowLabelWin); - } - } - - // ------------ Left double click - // - else if (event.LeftDClick() ) - { - row = YToEdgeOfRow(y); - if ( row < 0 ) - { - row = YToRow(y); - if ( row >=0 && - !SendEvent( wxEVT_GRID_LABEL_LEFT_DCLICK, row, -1, event ) ) - { - // no default action at the moment - } - } - else - { - // adjust row height depending on label text - AutoSizeRowLabelSize( row ); - - ChangeCursorMode(WXGRID_CURSOR_SELECT_CELL, m_colLabelWin); - m_dragLastPos = -1; - } - } - - // ------------ Left button released - // - else if ( event.LeftUp() ) - { - if ( m_cursorMode == WXGRID_CURSOR_RESIZE_ROW ) - { - DoEndDragResizeRow(); - - // Note: we are ending the event *after* doing - // default processing in this case - // - SendEvent( wxEVT_GRID_ROW_SIZE, m_dragRowOrCol, -1, event ); - } - - ChangeCursorMode(WXGRID_CURSOR_SELECT_CELL, m_rowLabelWin); - m_dragLastPos = -1; - } - - // ------------ Right button down - // - else if ( event.RightDown() ) - { - row = YToRow(y); - if ( row >=0 && - !SendEvent( wxEVT_GRID_LABEL_RIGHT_CLICK, row, -1, event ) ) - { - // no default action at the moment - } - } - - // ------------ Right double click - // - else if ( event.RightDClick() ) - { - row = YToRow(y); - if ( row >= 0 && - !SendEvent( wxEVT_GRID_LABEL_RIGHT_DCLICK, row, -1, event ) ) - { - // no default action at the moment - } - } - - // ------------ No buttons down and mouse moving - // - else if ( event.Moving() ) - { - m_dragRowOrCol = YToEdgeOfRow( y ); - if ( m_dragRowOrCol >= 0 ) - { - if ( m_cursorMode == WXGRID_CURSOR_SELECT_CELL ) - { - // don't capture the mouse yet - if ( CanDragRowSize() ) - ChangeCursorMode(WXGRID_CURSOR_RESIZE_ROW, m_rowLabelWin, false); - } - } - else if ( m_cursorMode != WXGRID_CURSOR_SELECT_CELL ) - { - ChangeCursorMode(WXGRID_CURSOR_SELECT_CELL, m_rowLabelWin, false); - } - } -} - -void wxGrid::ProcessColLabelMouseEvent( wxMouseEvent& event ) -{ - int x, y, col; - wxPoint pos( event.GetPosition() ); - CalcUnscrolledPosition( pos.x, pos.y, &x, &y ); - - if ( event.Dragging() ) - { - if (!m_isDragging) - { - m_isDragging = true; - m_colLabelWin->CaptureMouse(); - - if ( m_cursorMode == WXGRID_CURSOR_MOVE_COL ) - m_dragRowOrCol = XToCol( x ); - } - - if ( event.LeftIsDown() ) - { - switch ( m_cursorMode ) - { - case WXGRID_CURSOR_RESIZE_COL: - { - int cw, ch, dummy, top; - m_gridWin->GetClientSize( &cw, &ch ); - CalcUnscrolledPosition( 0, 0, &dummy, &top ); - - wxClientDC dc( m_gridWin ); - PrepareDC( dc ); - - x = wxMax( x, GetColLeft(m_dragRowOrCol) + - GetColMinimalWidth(m_dragRowOrCol)); - dc.SetLogicalFunction(wxINVERT); - if ( m_dragLastPos >= 0 ) - { - dc.DrawLine( m_dragLastPos, top, m_dragLastPos, top + ch ); - } - dc.DrawLine( x, top, x, top + ch ); - m_dragLastPos = x; - } - break; - - case WXGRID_CURSOR_SELECT_COL: - { - if ( (col = XToCol( x )) >= 0 ) - { - if ( m_selection ) - { - m_selection->SelectCol( col, - event.ControlDown(), - event.ShiftDown(), - event.AltDown(), - event.MetaDown() ); - } - } - } - break; - - case WXGRID_CURSOR_MOVE_COL: - { - if ( x < 0 ) - m_moveToCol = GetColAt( 0 ); - else - m_moveToCol = XToCol( x ); - - int markerX; - - if ( m_moveToCol < 0 ) - markerX = GetColRight( GetColAt( m_numCols - 1 ) ); - else - markerX = GetColLeft( m_moveToCol ); - - if ( markerX != m_dragLastPos ) - { - wxClientDC dc( m_colLabelWin ); - DoPrepareDC(dc); - - int cw, ch; - m_colLabelWin->GetClientSize( &cw, &ch ); - - markerX++; - - //Clean up the last indicator - if ( m_dragLastPos >= 0 ) - { - wxPen pen( m_colLabelWin->GetBackgroundColour(), 2 ); - dc.SetPen(pen); - dc.DrawLine( m_dragLastPos + 1, 0, m_dragLastPos + 1, ch ); - dc.SetPen(wxNullPen); - - if ( XToCol( m_dragLastPos ) != -1 ) - DrawColLabel( dc, XToCol( m_dragLastPos ) ); - } - - //Moving to the same place? Don't draw a marker - if ( (m_moveToCol == m_dragRowOrCol) - || (GetColPos( m_moveToCol ) == GetColPos( m_dragRowOrCol ) + 1) - || (m_moveToCol < 0 && m_dragRowOrCol == GetColAt( m_numCols - 1 ))) - { - m_dragLastPos = -1; - return; - } - - //Draw the marker - wxPen pen( *wxBLUE, 2 ); - dc.SetPen(pen); - - dc.DrawLine( markerX, 0, markerX, ch ); - - dc.SetPen(wxNullPen); - - m_dragLastPos = markerX - 1; - } - } - break; - - // default label to suppress warnings about "enumeration value - // 'xxx' not handled in switch - default: - break; - } - } - return; - } - - if ( m_isDragging && (event.Entering() || event.Leaving()) ) - return; - - if (m_isDragging) - { - if (m_colLabelWin->HasCapture()) - m_colLabelWin->ReleaseMouse(); - m_isDragging = false; - } - - // ------------ Entering or leaving the window - // - if ( event.Entering() || event.Leaving() ) - { - ChangeCursorMode(WXGRID_CURSOR_SELECT_CELL, m_colLabelWin); - } - - // ------------ Left button pressed - // - else if ( event.LeftDown() ) - { - // don't send a label click event for a hit on the - // edge of the col label - this is probably the user - // wanting to resize the col - // - if ( XToEdgeOfCol(x) < 0 ) - { - col = XToCol(x); - if ( col >= 0 && - !SendEvent( wxEVT_GRID_LABEL_LEFT_CLICK, -1, col, event ) ) - { - if ( m_canDragColMove ) - { - //Show button as pressed - wxClientDC dc( m_colLabelWin ); - int colLeft = GetColLeft( col ); - int colRight = GetColRight( col ) - 1; - dc.SetPen( wxPen( m_colLabelWin->GetBackgroundColour(), 1 ) ); - dc.DrawLine( colLeft, 1, colLeft, m_colLabelHeight-1 ); - dc.DrawLine( colLeft, 1, colRight, 1 ); - - ChangeCursorMode(WXGRID_CURSOR_MOVE_COL, m_colLabelWin); - } - else - { - if ( !event.ShiftDown() && !event.CmdDown() ) - ClearSelection(); - if ( m_selection ) - { - if ( event.ShiftDown() ) - { - m_selection->SelectBlock( 0, - m_currentCellCoords.GetCol(), - GetNumberRows() - 1, col, - event.ControlDown(), - event.ShiftDown(), - event.AltDown(), - event.MetaDown() ); - } - else - { - m_selection->SelectCol( col, - event.ControlDown(), - event.ShiftDown(), - event.AltDown(), - event.MetaDown() ); - } - } - - ChangeCursorMode(WXGRID_CURSOR_SELECT_COL, m_colLabelWin); - } - } - } - else - { - // starting to drag-resize a col - // - if ( CanDragColSize() ) - ChangeCursorMode(WXGRID_CURSOR_RESIZE_COL, m_colLabelWin); - } - } - - // ------------ Left double click - // - if ( event.LeftDClick() ) - { - col = XToEdgeOfCol(x); - if ( col < 0 ) - { - col = XToCol(x); - if ( col >= 0 && - ! SendEvent( wxEVT_GRID_LABEL_LEFT_DCLICK, -1, col, event ) ) - { - // no default action at the moment - } - } - else - { - // adjust column width depending on label text - AutoSizeColLabelSize( col ); - - ChangeCursorMode(WXGRID_CURSOR_SELECT_CELL, m_colLabelWin); - m_dragLastPos = -1; - } - } - - // ------------ Left button released - // - else if ( event.LeftUp() ) - { - switch ( m_cursorMode ) - { - case WXGRID_CURSOR_RESIZE_COL: - DoEndDragResizeCol(); - - // Note: we are ending the event *after* doing - // default processing in this case - // - SendEvent( wxEVT_GRID_COL_SIZE, -1, m_dragRowOrCol, event ); - break; - - case WXGRID_CURSOR_MOVE_COL: - DoEndDragMoveCol(); - - SendEvent( wxEVT_GRID_COL_MOVE, -1, m_dragRowOrCol, event ); - break; - - case WXGRID_CURSOR_SELECT_COL: - case WXGRID_CURSOR_SELECT_CELL: - case WXGRID_CURSOR_RESIZE_ROW: - case WXGRID_CURSOR_SELECT_ROW: - // nothing to do (?) - break; - } - - ChangeCursorMode(WXGRID_CURSOR_SELECT_CELL, m_colLabelWin); - m_dragLastPos = -1; - } - - // ------------ Right button down - // - else if ( event.RightDown() ) - { - col = XToCol(x); - if ( col >= 0 && - !SendEvent( wxEVT_GRID_LABEL_RIGHT_CLICK, -1, col, event ) ) - { - // no default action at the moment - } - } - - // ------------ Right double click - // - else if ( event.RightDClick() ) - { - col = XToCol(x); - if ( col >= 0 && - !SendEvent( wxEVT_GRID_LABEL_RIGHT_DCLICK, -1, col, event ) ) - { - // no default action at the moment - } - } - - // ------------ No buttons down and mouse moving - // - else if ( event.Moving() ) - { - m_dragRowOrCol = XToEdgeOfCol( x ); - if ( m_dragRowOrCol >= 0 ) - { - if ( m_cursorMode == WXGRID_CURSOR_SELECT_CELL ) - { - // don't capture the cursor yet - if ( CanDragColSize() ) - ChangeCursorMode(WXGRID_CURSOR_RESIZE_COL, m_colLabelWin, false); - } - } - else if ( m_cursorMode != WXGRID_CURSOR_SELECT_CELL ) - { - ChangeCursorMode(WXGRID_CURSOR_SELECT_CELL, m_colLabelWin, false); - } - } -} - -void wxGrid::ProcessCornerLabelMouseEvent( wxMouseEvent& event ) -{ - if ( event.LeftDown() ) - { - // indicate corner label by having both row and - // col args == -1 - // - if ( !SendEvent( wxEVT_GRID_LABEL_LEFT_CLICK, -1, -1, event ) ) - { - SelectAll(); - } - } - else if ( event.LeftDClick() ) - { - SendEvent( wxEVT_GRID_LABEL_LEFT_DCLICK, -1, -1, event ); - } - else if ( event.RightDown() ) - { - if ( !SendEvent( wxEVT_GRID_LABEL_RIGHT_CLICK, -1, -1, event ) ) - { - // no default action at the moment - } - } - else if ( event.RightDClick() ) - { - if ( !SendEvent( wxEVT_GRID_LABEL_RIGHT_DCLICK, -1, -1, event ) ) - { - // no default action at the moment - } - } -} - -void wxGrid::CancelMouseCapture() -{ - // cancel operation currently in progress, whatever it is - if ( m_winCapture ) - { - m_isDragging = false; - m_cursorMode = WXGRID_CURSOR_SELECT_CELL; - m_winCapture->SetCursor( *wxSTANDARD_CURSOR ); - m_winCapture = NULL; - - // remove traces of whatever we drew on screen - Refresh(); - } -} - -void wxGrid::ChangeCursorMode(CursorMode mode, - wxWindow *win, - bool captureMouse) -{ -#ifdef __WXDEBUG__ - static const wxChar *cursorModes[] = - { - _T("SELECT_CELL"), - _T("RESIZE_ROW"), - _T("RESIZE_COL"), - _T("SELECT_ROW"), - _T("SELECT_COL"), - _T("MOVE_COL"), - }; - - wxLogTrace(_T("grid"), - _T("wxGrid cursor mode (mouse capture for %s): %s -> %s"), - win == m_colLabelWin ? _T("colLabelWin") - : win ? _T("rowLabelWin") - : _T("gridWin"), - cursorModes[m_cursorMode], cursorModes[mode]); -#endif - - if ( mode == m_cursorMode && - win == m_winCapture && - captureMouse == (m_winCapture != NULL)) - return; - - if ( !win ) - { - // by default use the grid itself - win = m_gridWin; - } - - if ( m_winCapture ) - { - if (m_winCapture->HasCapture()) - m_winCapture->ReleaseMouse(); - m_winCapture = (wxWindow *)NULL; - } - - m_cursorMode = mode; - - switch ( m_cursorMode ) - { - case WXGRID_CURSOR_RESIZE_ROW: - win->SetCursor( m_rowResizeCursor ); - break; - - case WXGRID_CURSOR_RESIZE_COL: - win->SetCursor( m_colResizeCursor ); - break; - - case WXGRID_CURSOR_MOVE_COL: - win->SetCursor( wxCursor(wxCURSOR_HAND) ); - break; - - default: - win->SetCursor( *wxSTANDARD_CURSOR ); - break; - } - - // we need to capture mouse when resizing - bool resize = m_cursorMode == WXGRID_CURSOR_RESIZE_ROW || - m_cursorMode == WXGRID_CURSOR_RESIZE_COL; - - if ( captureMouse && resize ) - { - win->CaptureMouse(); - m_winCapture = win; - } -} - -void wxGrid::ProcessGridCellMouseEvent( wxMouseEvent& event ) -{ - int x, y; - wxPoint pos( event.GetPosition() ); - CalcUnscrolledPosition( pos.x, pos.y, &x, &y ); - - wxGridCellCoords coords; - XYToCell( x, y, coords ); - - int cell_rows, cell_cols; - bool isFirstDrag = !m_isDragging; - GetCellSize( coords.GetRow(), coords.GetCol(), &cell_rows, &cell_cols ); - if ((cell_rows < 0) || (cell_cols < 0)) - { - coords.SetRow(coords.GetRow() + cell_rows); - coords.SetCol(coords.GetCol() + cell_cols); - } - - if ( event.Dragging() ) - { - //wxLogDebug("pos(%d, %d) coords(%d, %d)", pos.x, pos.y, coords.GetRow(), coords.GetCol()); - - // Don't start doing anything until the mouse has been dragged at - // least 3 pixels in any direction... - if (! m_isDragging) - { - if (m_startDragPos == wxDefaultPosition) - { - m_startDragPos = pos; - return; - } - if (abs(m_startDragPos.x - pos.x) < 4 && abs(m_startDragPos.y - pos.y) < 4) - return; - } - - m_isDragging = true; - if ( m_cursorMode == WXGRID_CURSOR_SELECT_CELL ) - { - // Hide the edit control, so it - // won't interfere with drag-shrinking. - if ( IsCellEditControlShown() ) - { - HideCellEditControl(); - SaveEditControlValue(); - } - - if ( coords != wxGridNoCellCoords ) - { - if ( event.CmdDown() ) - { - if ( m_selectingKeyboard == wxGridNoCellCoords) - m_selectingKeyboard = coords; - HighlightBlock( m_selectingKeyboard, coords ); - } - else if ( CanDragCell() ) - { - if ( isFirstDrag ) - { - if ( m_selectingKeyboard == wxGridNoCellCoords) - m_selectingKeyboard = coords; - - SendEvent( wxEVT_GRID_CELL_BEGIN_DRAG, - coords.GetRow(), - coords.GetCol(), - event ); - return; - } - } - else - { - if ( !IsSelection() ) - { - HighlightBlock( coords, coords ); - } - else - { - HighlightBlock( m_currentCellCoords, coords ); - } - } - - if (! IsVisible(coords)) - { - MakeCellVisible(coords); - // TODO: need to introduce a delay or something here. The - // scrolling is way to fast, at least on MSW - also on GTK. - } - } - // Have we captured the mouse yet? - if (! m_winCapture) - { - m_winCapture = m_gridWin; - m_winCapture->CaptureMouse(); - } - - - } - else if ( event.LeftIsDown() && - m_cursorMode == WXGRID_CURSOR_RESIZE_ROW ) - { - int cw, ch, left, dummy; - m_gridWin->GetClientSize( &cw, &ch ); - CalcUnscrolledPosition( 0, 0, &left, &dummy ); - - wxClientDC dc( m_gridWin ); - PrepareDC( dc ); - y = wxMax( y, GetRowTop(m_dragRowOrCol) + - GetRowMinimalHeight(m_dragRowOrCol) ); - dc.SetLogicalFunction(wxINVERT); - if ( m_dragLastPos >= 0 ) - { - dc.DrawLine( left, m_dragLastPos, left+cw, m_dragLastPos ); - } - dc.DrawLine( left, y, left+cw, y ); - m_dragLastPos = y; - } - else if ( event.LeftIsDown() && - m_cursorMode == WXGRID_CURSOR_RESIZE_COL ) - { - int cw, ch, dummy, top; - m_gridWin->GetClientSize( &cw, &ch ); - CalcUnscrolledPosition( 0, 0, &dummy, &top ); - - wxClientDC dc( m_gridWin ); - PrepareDC( dc ); - x = wxMax( x, GetColLeft(m_dragRowOrCol) + - GetColMinimalWidth(m_dragRowOrCol) ); - dc.SetLogicalFunction(wxINVERT); - if ( m_dragLastPos >= 0 ) - { - dc.DrawLine( m_dragLastPos, top, m_dragLastPos, top + ch ); - } - dc.DrawLine( x, top, x, top + ch ); - m_dragLastPos = x; - } - - return; - } - - m_isDragging = false; - m_startDragPos = wxDefaultPosition; - - // VZ: if we do this, the mode is reset to WXGRID_CURSOR_SELECT_CELL - // immediately after it becomes WXGRID_CURSOR_RESIZE_ROW/COL under - // wxGTK -#if 0 - if ( event.Entering() || event.Leaving() ) - { - ChangeCursorMode(WXGRID_CURSOR_SELECT_CELL); - m_gridWin->SetCursor( *wxSTANDARD_CURSOR ); - } - else -#endif // 0 - - // ------------ Left button pressed - // - if ( event.LeftDown() && coords != wxGridNoCellCoords ) - { - if ( !SendEvent( wxEVT_GRID_CELL_LEFT_CLICK, - coords.GetRow(), - coords.GetCol(), - event ) ) - { - if ( !event.CmdDown() ) - ClearSelection(); - if ( event.ShiftDown() ) - { - if ( m_selection ) - { - m_selection->SelectBlock( m_currentCellCoords.GetRow(), - m_currentCellCoords.GetCol(), - coords.GetRow(), - coords.GetCol(), - event.ControlDown(), - event.ShiftDown(), - event.AltDown(), - event.MetaDown() ); - } - } - else if ( XToEdgeOfCol(x) < 0 && - YToEdgeOfRow(y) < 0 ) - { - DisableCellEditControl(); - MakeCellVisible( coords ); - - if ( event.CmdDown() ) - { - if ( m_selection ) - { - m_selection->ToggleCellSelection( coords.GetRow(), - coords.GetCol(), - event.ControlDown(), - event.ShiftDown(), - event.AltDown(), - event.MetaDown() ); - } - m_selectingTopLeft = wxGridNoCellCoords; - m_selectingBottomRight = wxGridNoCellCoords; - m_selectingKeyboard = coords; - } - else - { - m_waitForSlowClick = m_currentCellCoords == coords && coords != wxGridNoCellCoords; - SetCurrentCell( coords ); - if ( m_selection ) - { - if ( m_selection->GetSelectionMode() != - wxGrid::wxGridSelectCells ) - { - HighlightBlock( coords, coords ); - } - } - } - } - } - } - - // ------------ Left double click - // - else if ( event.LeftDClick() && coords != wxGridNoCellCoords ) - { - DisableCellEditControl(); - - if ( XToEdgeOfCol(x) < 0 && YToEdgeOfRow(y) < 0 ) - { - if ( !SendEvent( wxEVT_GRID_CELL_LEFT_DCLICK, - coords.GetRow(), - coords.GetCol(), - event ) ) - { - // we want double click to select a cell and start editing - // (i.e. to behave in same way as sequence of two slow clicks): - m_waitForSlowClick = true; - } - } - } - - // ------------ Left button released - // - else if ( event.LeftUp() ) - { - if ( m_cursorMode == WXGRID_CURSOR_SELECT_CELL ) - { - if (m_winCapture) - { - if (m_winCapture->HasCapture()) - m_winCapture->ReleaseMouse(); - m_winCapture = NULL; - } - - if ( coords == m_currentCellCoords && m_waitForSlowClick && CanEnableCellControl() ) - { - ClearSelection(); - EnableCellEditControl(); - - wxGridCellAttr *attr = GetCellAttr(coords); - wxGridCellEditor *editor = attr->GetEditor(this, coords.GetRow(), coords.GetCol()); - editor->StartingClick(); - editor->DecRef(); - attr->DecRef(); - - m_waitForSlowClick = false; - } - else if ( m_selectingTopLeft != wxGridNoCellCoords && - m_selectingBottomRight != wxGridNoCellCoords ) - { - if ( m_selection ) - { - m_selection->SelectBlock( m_selectingTopLeft.GetRow(), - m_selectingTopLeft.GetCol(), - m_selectingBottomRight.GetRow(), - m_selectingBottomRight.GetCol(), - event.ControlDown(), - event.ShiftDown(), - event.AltDown(), - event.MetaDown() ); - } - - m_selectingTopLeft = wxGridNoCellCoords; - m_selectingBottomRight = wxGridNoCellCoords; - - // Show the edit control, if it has been hidden for - // drag-shrinking. - ShowCellEditControl(); - } - } - else if ( m_cursorMode == WXGRID_CURSOR_RESIZE_ROW ) - { - ChangeCursorMode(WXGRID_CURSOR_SELECT_CELL); - DoEndDragResizeRow(); - - // Note: we are ending the event *after* doing - // default processing in this case - // - SendEvent( wxEVT_GRID_ROW_SIZE, m_dragRowOrCol, -1, event ); - } - else if ( m_cursorMode == WXGRID_CURSOR_RESIZE_COL ) - { - ChangeCursorMode(WXGRID_CURSOR_SELECT_CELL); - DoEndDragResizeCol(); - - // Note: we are ending the event *after* doing - // default processing in this case - // - SendEvent( wxEVT_GRID_COL_SIZE, -1, m_dragRowOrCol, event ); - } - - m_dragLastPos = -1; - } - - // ------------ Right button down - // - else if ( event.RightDown() && coords != wxGridNoCellCoords ) - { - DisableCellEditControl(); - if ( !SendEvent( wxEVT_GRID_CELL_RIGHT_CLICK, - coords.GetRow(), - coords.GetCol(), - event ) ) - { - // no default action at the moment - } - } - - // ------------ Right double click - // - else if ( event.RightDClick() && coords != wxGridNoCellCoords ) - { - DisableCellEditControl(); - if ( !SendEvent( wxEVT_GRID_CELL_RIGHT_DCLICK, - coords.GetRow(), - coords.GetCol(), - event ) ) - { - // no default action at the moment - } - } - - // ------------ Moving and no button action - // - else if ( event.Moving() && !event.IsButton() ) - { - if ( coords.GetRow() < 0 || coords.GetCol() < 0 ) - { - // out of grid cell area - ChangeCursorMode(WXGRID_CURSOR_SELECT_CELL); - return; - } - - int dragRow = YToEdgeOfRow( y ); - int dragCol = XToEdgeOfCol( x ); - - // Dragging on the corner of a cell to resize in both - // directions is not implemented yet... - // - if ( dragRow >= 0 && dragCol >= 0 ) - { - ChangeCursorMode(WXGRID_CURSOR_SELECT_CELL); - return; - } - - if ( dragRow >= 0 ) - { - m_dragRowOrCol = dragRow; - - if ( m_cursorMode == WXGRID_CURSOR_SELECT_CELL ) - { - if ( CanDragRowSize() && CanDragGridSize() ) - ChangeCursorMode(WXGRID_CURSOR_RESIZE_ROW, NULL, false); - } - } - else if ( dragCol >= 0 ) - { - m_dragRowOrCol = dragCol; - - if ( m_cursorMode == WXGRID_CURSOR_SELECT_CELL ) - { - if ( CanDragColSize() && CanDragGridSize() ) - ChangeCursorMode(WXGRID_CURSOR_RESIZE_COL, NULL, false); - } - } - else // Neither on a row or col edge - { - if ( m_cursorMode != WXGRID_CURSOR_SELECT_CELL ) - { - ChangeCursorMode(WXGRID_CURSOR_SELECT_CELL); - } - } - } -} - -void wxGrid::DoEndDragResizeRow() -{ - if ( m_dragLastPos >= 0 ) - { - // erase the last line and resize the row - // - int cw, ch, left, dummy; - m_gridWin->GetClientSize( &cw, &ch ); - CalcUnscrolledPosition( 0, 0, &left, &dummy ); - - wxClientDC dc( m_gridWin ); - PrepareDC( dc ); - dc.SetLogicalFunction( wxINVERT ); - dc.DrawLine( left, m_dragLastPos, left + cw, m_dragLastPos ); - HideCellEditControl(); - SaveEditControlValue(); - - int rowTop = GetRowTop(m_dragRowOrCol); - SetRowSize( m_dragRowOrCol, - wxMax( m_dragLastPos - rowTop, m_minAcceptableRowHeight ) ); - - if ( !GetBatchCount() ) - { - // Only needed to get the correct rect.y: - wxRect rect ( CellToRect( m_dragRowOrCol, 0 ) ); - rect.x = 0; - CalcScrolledPosition(0, rect.y, &dummy, &rect.y); - rect.width = m_rowLabelWidth; - rect.height = ch - rect.y; - m_rowLabelWin->Refresh( true, &rect ); - rect.width = cw; - - // if there is a multicell block, paint all of it - if (m_table) - { - int i, cell_rows, cell_cols, subtract_rows = 0; - int leftCol = XToCol(left); - int rightCol = internalXToCol(left + cw); - if (leftCol >= 0) - { - for (i=leftCol; iRefresh( false, &rect ); - } - - ShowCellEditControl(); - } -} - - -void wxGrid::DoEndDragResizeCol() -{ - if ( m_dragLastPos >= 0 ) - { - // erase the last line and resize the col - // - int cw, ch, dummy, top; - m_gridWin->GetClientSize( &cw, &ch ); - CalcUnscrolledPosition( 0, 0, &dummy, &top ); - - wxClientDC dc( m_gridWin ); - PrepareDC( dc ); - dc.SetLogicalFunction( wxINVERT ); - dc.DrawLine( m_dragLastPos, top, m_dragLastPos, top + ch ); - HideCellEditControl(); - SaveEditControlValue(); - - int colLeft = GetColLeft(m_dragRowOrCol); - SetColSize( m_dragRowOrCol, - wxMax( m_dragLastPos - colLeft, - GetColMinimalWidth(m_dragRowOrCol) ) ); - - if ( !GetBatchCount() ) - { - // Only needed to get the correct rect.x: - wxRect rect ( CellToRect( 0, m_dragRowOrCol ) ); - rect.y = 0; - CalcScrolledPosition(rect.x, 0, &rect.x, &dummy); - rect.width = cw - rect.x; - rect.height = m_colLabelHeight; - m_colLabelWin->Refresh( true, &rect ); - rect.height = ch; - - // if there is a multicell block, paint all of it - if (m_table) - { - int i, cell_rows, cell_cols, subtract_cols = 0; - int topRow = YToRow(top); - int bottomRow = internalYToRow(top + cw); - if (topRow >= 0) - { - for (i=topRow; iRefresh( false, &rect ); - } - - ShowCellEditControl(); - } -} - -void wxGrid::DoEndDragMoveCol() -{ - //The user clicked on the column but didn't actually drag - if ( m_dragLastPos < 0 ) - { - m_colLabelWin->Refresh(); //Do this to "unpress" the column - return; - } - - int newPos; - if ( m_moveToCol == -1 ) - newPos = m_numCols - 1; - else - { - newPos = GetColPos( m_moveToCol ); - if ( newPos > GetColPos( m_dragRowOrCol ) ) - newPos--; - } - - SetColPos( m_dragRowOrCol, newPos ); -} - -void wxGrid::SetColPos( int colID, int newPos ) -{ - if ( m_colAt.IsEmpty() ) - { - m_colAt.Alloc( m_numCols ); - - int i; - for ( i = 0; i < m_numCols; i++ ) - { - m_colAt.Add( i ); - } - } - - int oldPos = GetColPos( colID ); - - //Reshuffle the m_colAt array - if ( newPos > oldPos ) - { - int i; - for ( i = oldPos; i < newPos; i++ ) - { - m_colAt[i] = m_colAt[i+1]; - } - } - else - { - int i; - for ( i = oldPos; i > newPos; i-- ) - { - m_colAt[i] = m_colAt[i-1]; - } - } - - m_colAt[newPos] = colID; - - //Recalculate the column rights - if ( !m_colWidths.IsEmpty() ) - { - int colRight = 0; - int colPos; - for ( colPos = 0; colPos < m_numCols; colPos++ ) - { - int colID = GetColAt( colPos ); - - colRight += m_colWidths[colID]; - m_colRights[colID] = colRight; - } - } - - m_colLabelWin->Refresh(); - m_gridWin->Refresh(); -} - - - -void wxGrid::EnableDragColMove( bool enable ) -{ - if ( m_canDragColMove == enable ) - return; - - m_canDragColMove = enable; - - if ( !m_canDragColMove ) - { - m_colAt.Clear(); - - //Recalculate the column rights - if ( !m_colWidths.IsEmpty() ) - { - int colRight = 0; - int colPos; - for ( colPos = 0; colPos < m_numCols; colPos++ ) - { - colRight += m_colWidths[colPos]; - m_colRights[colPos] = colRight; - } - } - - m_colLabelWin->Refresh(); - m_gridWin->Refresh(); - } -} - - -// -// ------ interaction with data model -// -bool wxGrid::ProcessTableMessage( wxGridTableMessage& msg ) -{ - switch ( msg.GetId() ) - { - case wxGRIDTABLE_REQUEST_VIEW_GET_VALUES: - return GetModelValues(); - - case wxGRIDTABLE_REQUEST_VIEW_SEND_VALUES: - return SetModelValues(); - - case wxGRIDTABLE_NOTIFY_ROWS_INSERTED: - case wxGRIDTABLE_NOTIFY_ROWS_APPENDED: - case wxGRIDTABLE_NOTIFY_ROWS_DELETED: - case wxGRIDTABLE_NOTIFY_COLS_INSERTED: - case wxGRIDTABLE_NOTIFY_COLS_APPENDED: - case wxGRIDTABLE_NOTIFY_COLS_DELETED: - return Redimension( msg ); - - default: - return false; - } -} - -// The behaviour of this function depends on the grid table class -// Clear() function. For the default wxGridStringTable class the -// behavious is to replace all cell contents with wxEmptyString but -// not to change the number of rows or cols. -// -void wxGrid::ClearGrid() -{ - if ( m_table ) - { - if (IsCellEditControlEnabled()) - DisableCellEditControl(); - - m_table->Clear(); - if (!GetBatchCount()) - m_gridWin->Refresh(); - } -} - -bool wxGrid::InsertRows( int pos, int numRows, bool WXUNUSED(updateLabels) ) -{ - // TODO: something with updateLabels flag - - if ( !m_created ) - { - wxFAIL_MSG( wxT("Called wxGrid::InsertRows() before calling CreateGrid()") ); - return false; - } - - if ( m_table ) - { - if (IsCellEditControlEnabled()) - DisableCellEditControl(); - - bool done = m_table->InsertRows( pos, numRows ); - return done; - - // the table will have sent the results of the insert row - // operation to this view object as a grid table message - } - - return false; -} - -bool wxGrid::AppendRows( int numRows, bool WXUNUSED(updateLabels) ) -{ - // TODO: something with updateLabels flag - - if ( !m_created ) - { - wxFAIL_MSG( wxT("Called wxGrid::AppendRows() before calling CreateGrid()") ); - return false; - } - - if ( m_table ) - { - bool done = m_table && m_table->AppendRows( numRows ); - return done; - - // the table will have sent the results of the append row - // operation to this view object as a grid table message - } - - return false; -} - -bool wxGrid::DeleteRows( int pos, int numRows, bool WXUNUSED(updateLabels) ) -{ - // TODO: something with updateLabels flag - - if ( !m_created ) - { - wxFAIL_MSG( wxT("Called wxGrid::DeleteRows() before calling CreateGrid()") ); - return false; - } - - if ( m_table ) - { - if (IsCellEditControlEnabled()) - DisableCellEditControl(); - - bool done = m_table->DeleteRows( pos, numRows ); - return done; - // the table will have sent the results of the delete row - // operation to this view object as a grid table message - } - - return false; -} - -bool wxGrid::InsertCols( int pos, int numCols, bool WXUNUSED(updateLabels) ) -{ - // TODO: something with updateLabels flag - - if ( !m_created ) - { - wxFAIL_MSG( wxT("Called wxGrid::InsertCols() before calling CreateGrid()") ); - return false; - } - - if ( m_table ) - { - if (IsCellEditControlEnabled()) - DisableCellEditControl(); - - bool done = m_table->InsertCols( pos, numCols ); - return done; - // the table will have sent the results of the insert col - // operation to this view object as a grid table message - } - - return false; -} - -bool wxGrid::AppendCols( int numCols, bool WXUNUSED(updateLabels) ) -{ - // TODO: something with updateLabels flag - - if ( !m_created ) - { - wxFAIL_MSG( wxT("Called wxGrid::AppendCols() before calling CreateGrid()") ); - return false; - } - - if ( m_table ) - { - bool done = m_table->AppendCols( numCols ); - return done; - // the table will have sent the results of the append col - // operation to this view object as a grid table message - } - - return false; -} - -bool wxGrid::DeleteCols( int pos, int numCols, bool WXUNUSED(updateLabels) ) -{ - // TODO: something with updateLabels flag - - if ( !m_created ) - { - wxFAIL_MSG( wxT("Called wxGrid::DeleteCols() before calling CreateGrid()") ); - return false; - } - - if ( m_table ) - { - if (IsCellEditControlEnabled()) - DisableCellEditControl(); - - bool done = m_table->DeleteCols( pos, numCols ); - return done; - // the table will have sent the results of the delete col - // operation to this view object as a grid table message - } - - return false; -} - -// -// ----- event handlers -// - -// Generate a grid event based on a mouse event and -// return the result of ProcessEvent() -// -int wxGrid::SendEvent( const wxEventType type, - int row, int col, - wxMouseEvent& mouseEv ) -{ - bool claimed, vetoed; - - if ( type == wxEVT_GRID_ROW_SIZE || type == wxEVT_GRID_COL_SIZE ) - { - int rowOrCol = (row == -1 ? col : row); - - wxGridSizeEvent gridEvt( GetId(), - type, - this, - rowOrCol, - mouseEv.GetX() + GetRowLabelSize(), - mouseEv.GetY() + GetColLabelSize(), - mouseEv.ControlDown(), - mouseEv.ShiftDown(), - mouseEv.AltDown(), - mouseEv.MetaDown() ); - - claimed = GetEventHandler()->ProcessEvent(gridEvt); - vetoed = !gridEvt.IsAllowed(); - } - else if ( type == wxEVT_GRID_RANGE_SELECT ) - { - // Right now, it should _never_ end up here! - wxGridRangeSelectEvent gridEvt( GetId(), - type, - this, - m_selectingTopLeft, - m_selectingBottomRight, - true, - mouseEv.ControlDown(), - mouseEv.ShiftDown(), - mouseEv.AltDown(), - mouseEv.MetaDown() ); - - claimed = GetEventHandler()->ProcessEvent(gridEvt); - vetoed = !gridEvt.IsAllowed(); - } - else if ( type == wxEVT_GRID_LABEL_LEFT_CLICK || - type == wxEVT_GRID_LABEL_LEFT_DCLICK || - type == wxEVT_GRID_LABEL_RIGHT_CLICK || - type == wxEVT_GRID_LABEL_RIGHT_DCLICK ) - { - wxPoint pos = mouseEv.GetPosition(); - - if ( mouseEv.GetEventObject() == GetGridRowLabelWindow() ) - pos.y += GetColLabelSize(); - if ( mouseEv.GetEventObject() == GetGridColLabelWindow() ) - pos.x += GetRowLabelSize(); - - wxGridEvent gridEvt( GetId(), - type, - this, - row, col, - pos.x, - pos.y, - false, - mouseEv.ControlDown(), - mouseEv.ShiftDown(), - mouseEv.AltDown(), - mouseEv.MetaDown() ); - claimed = GetEventHandler()->ProcessEvent(gridEvt); - vetoed = !gridEvt.IsAllowed(); - } - else - { - wxGridEvent gridEvt( GetId(), - type, - this, - row, col, - mouseEv.GetX() + GetRowLabelSize(), - mouseEv.GetY() + GetColLabelSize(), - false, - mouseEv.ControlDown(), - mouseEv.ShiftDown(), - mouseEv.AltDown(), - mouseEv.MetaDown() ); - claimed = GetEventHandler()->ProcessEvent(gridEvt); - vetoed = !gridEvt.IsAllowed(); - } - - // A Veto'd event may not be `claimed' so test this first - if (vetoed) - return -1; - - return claimed ? 1 : 0; -} - -// Generate a grid event of specified type and return the result -// of ProcessEvent(). -// -int wxGrid::SendEvent( const wxEventType type, - int row, int col ) -{ - bool claimed, vetoed; - - if ( type == wxEVT_GRID_ROW_SIZE || type == wxEVT_GRID_COL_SIZE ) - { - int rowOrCol = (row == -1 ? col : row); - - wxGridSizeEvent gridEvt( GetId(), type, this, rowOrCol ); - - claimed = GetEventHandler()->ProcessEvent(gridEvt); - vetoed = !gridEvt.IsAllowed(); - } - else - { - wxGridEvent gridEvt( GetId(), type, this, row, col ); - - claimed = GetEventHandler()->ProcessEvent(gridEvt); - vetoed = !gridEvt.IsAllowed(); - } - - // A Veto'd event may not be `claimed' so test this first - if (vetoed) - return -1; - - return claimed ? 1 : 0; -} - -void wxGrid::OnPaint( wxPaintEvent& WXUNUSED(event) ) -{ - // needed to prevent zillions of paint events on MSW - wxPaintDC dc(this); -} - -void wxGrid::Refresh(bool eraseb, const wxRect* rect) -{ - // Don't do anything if between Begin/EndBatch... - // EndBatch() will do all this on the last nested one anyway. - if (! GetBatchCount()) - { - // Refresh to get correct scrolled position: - wxScrolledWindow::Refresh(eraseb, rect); - - if (rect) - { - int rect_x, rect_y, rectWidth, rectHeight; - int width_label, width_cell, height_label, height_cell; - int x, y; - - // Copy rectangle can get scroll offsets.. - rect_x = rect->GetX(); - rect_y = rect->GetY(); - rectWidth = rect->GetWidth(); - rectHeight = rect->GetHeight(); - - width_label = m_rowLabelWidth - rect_x; - if (width_label > rectWidth) - width_label = rectWidth; - - height_label = m_colLabelHeight - rect_y; - if (height_label > rectHeight) - height_label = rectHeight; - - if (rect_x > m_rowLabelWidth) - { - x = rect_x - m_rowLabelWidth; - width_cell = rectWidth; - } - else - { - x = 0; - width_cell = rectWidth - (m_rowLabelWidth - rect_x); - } - - if (rect_y > m_colLabelHeight) - { - y = rect_y - m_colLabelHeight; - height_cell = rectHeight; - } - else - { - y = 0; - height_cell = rectHeight - (m_colLabelHeight - rect_y); - } - - // Paint corner label part intersecting rect. - if ( width_label > 0 && height_label > 0 ) - { - wxRect anotherrect(rect_x, rect_y, width_label, height_label); - m_cornerLabelWin->Refresh(eraseb, &anotherrect); - } - - // Paint col labels part intersecting rect. - if ( width_cell > 0 && height_label > 0 ) - { - wxRect anotherrect(x, rect_y, width_cell, height_label); - m_colLabelWin->Refresh(eraseb, &anotherrect); - } - - // Paint row labels part intersecting rect. - if ( width_label > 0 && height_cell > 0 ) - { - wxRect anotherrect(rect_x, y, width_label, height_cell); - m_rowLabelWin->Refresh(eraseb, &anotherrect); - } - - // Paint cell area part intersecting rect. - if ( width_cell > 0 && height_cell > 0 ) - { - wxRect anotherrect(x, y, width_cell, height_cell); - m_gridWin->Refresh(eraseb, &anotherrect); - } - } - else - { - m_cornerLabelWin->Refresh(eraseb, NULL); - m_colLabelWin->Refresh(eraseb, NULL); - m_rowLabelWin->Refresh(eraseb, NULL); - m_gridWin->Refresh(eraseb, NULL); - } - } -} - -void wxGrid::OnSize( wxSizeEvent& WXUNUSED(event) ) -{ - if (m_targetWindow != this) // check whether initialisation has been done - { - // update our children window positions and scrollbars - CalcDimensions(); - } -} - -void wxGrid::OnKeyDown( wxKeyEvent& event ) -{ - if ( m_inOnKeyDown ) - { - // shouldn't be here - we are going round in circles... - // - wxFAIL_MSG( wxT("wxGrid::OnKeyDown called while already active") ); - } - - m_inOnKeyDown = true; - - // propagate the event up and see if it gets processed - wxWindow *parent = GetParent(); - wxKeyEvent keyEvt( event ); - keyEvt.SetEventObject( parent ); - - if ( !parent->GetEventHandler()->ProcessEvent( keyEvt ) ) - { - if (GetLayoutDirection() == wxLayout_RightToLeft) - { - if (event.GetKeyCode() == WXK_RIGHT) - event.m_keyCode = WXK_LEFT; - else if (event.GetKeyCode() == WXK_LEFT) - event.m_keyCode = WXK_RIGHT; - } - - // try local handlers - switch ( event.GetKeyCode() ) - { - case WXK_UP: - if ( event.ControlDown() ) - MoveCursorUpBlock( event.ShiftDown() ); - else - MoveCursorUp( event.ShiftDown() ); - break; - - case WXK_DOWN: - if ( event.ControlDown() ) - MoveCursorDownBlock( event.ShiftDown() ); - else - MoveCursorDown( event.ShiftDown() ); - break; - - case WXK_LEFT: - if ( event.ControlDown() ) - MoveCursorLeftBlock( event.ShiftDown() ); - else - MoveCursorLeft( event.ShiftDown() ); - break; - - case WXK_RIGHT: - if ( event.ControlDown() ) - MoveCursorRightBlock( event.ShiftDown() ); - else - MoveCursorRight( event.ShiftDown() ); - break; - - case WXK_RETURN: - case WXK_NUMPAD_ENTER: - if ( event.ControlDown() ) - { - event.Skip(); // to let the edit control have the return - } - else - { - if ( GetGridCursorRow() < GetNumberRows()-1 ) - { - MoveCursorDown( event.ShiftDown() ); - } - else - { - // at the bottom of a column - DisableCellEditControl(); - } - } - break; - - case WXK_ESCAPE: - ClearSelection(); - break; - - case WXK_TAB: - if (event.ShiftDown()) - { - if ( GetGridCursorCol() > 0 ) - { - MoveCursorLeft( false ); - } - else - { - // at left of grid - DisableCellEditControl(); - } - } - else - { - if ( GetGridCursorCol() < GetNumberCols() - 1 ) - { - MoveCursorRight( false ); - } - else - { - // at right of grid - DisableCellEditControl(); - } - } - break; - - case WXK_HOME: - if ( event.ControlDown() ) - { - MakeCellVisible( 0, 0 ); - SetCurrentCell( 0, 0 ); - } - else - { - event.Skip(); - } - break; - - case WXK_END: - if ( event.ControlDown() ) - { - MakeCellVisible( m_numRows - 1, m_numCols - 1 ); - SetCurrentCell( m_numRows - 1, m_numCols - 1 ); - } - else - { - event.Skip(); - } - break; - - case WXK_PAGEUP: - MovePageUp(); - break; - - case WXK_PAGEDOWN: - MovePageDown(); - break; - - case WXK_SPACE: - if ( event.ControlDown() ) - { - if ( m_selection ) - { - m_selection->ToggleCellSelection( - m_currentCellCoords.GetRow(), - m_currentCellCoords.GetCol(), - event.ControlDown(), - event.ShiftDown(), - event.AltDown(), - event.MetaDown() ); - } - break; - } - - if ( !IsEditable() ) - MoveCursorRight( false ); - else - event.Skip(); - break; - - default: - event.Skip(); - break; - } - } - - m_inOnKeyDown = false; -} - -void wxGrid::OnKeyUp( wxKeyEvent& event ) -{ - // try local handlers - // - if ( event.GetKeyCode() == WXK_SHIFT ) - { - if ( m_selectingTopLeft != wxGridNoCellCoords && - m_selectingBottomRight != wxGridNoCellCoords ) - { - if ( m_selection ) - { - m_selection->SelectBlock( - m_selectingTopLeft.GetRow(), - m_selectingTopLeft.GetCol(), - m_selectingBottomRight.GetRow(), - m_selectingBottomRight.GetCol(), - event.ControlDown(), - true, - event.AltDown(), - event.MetaDown() ); - } - } - - m_selectingTopLeft = wxGridNoCellCoords; - m_selectingBottomRight = wxGridNoCellCoords; - m_selectingKeyboard = wxGridNoCellCoords; - } -} - -void wxGrid::OnChar( wxKeyEvent& event ) -{ - // is it possible to edit the current cell at all? - if ( !IsCellEditControlEnabled() && CanEnableCellControl() ) - { - // yes, now check whether the cells editor accepts the key - int row = m_currentCellCoords.GetRow(); - int col = m_currentCellCoords.GetCol(); - wxGridCellAttr *attr = GetCellAttr(row, col); - wxGridCellEditor *editor = attr->GetEditor(this, row, col); - - // is special and will always start editing, for - // other keys - ask the editor itself - if ( (event.GetKeyCode() == WXK_F2 && !event.HasModifiers()) - || editor->IsAcceptedKey(event) ) - { - // ensure cell is visble - MakeCellVisible(row, col); - EnableCellEditControl(); - - // a problem can arise if the cell is not completely - // visible (even after calling MakeCellVisible the - // control is not created and calling StartingKey will - // crash the app - if ( event.GetKeyCode() != WXK_F2 && editor->IsCreated() && m_cellEditCtrlEnabled ) - editor->StartingKey(event); - } - else - { - event.Skip(); - } - - editor->DecRef(); - attr->DecRef(); - } - else - { - event.Skip(); - } -} - -void wxGrid::OnEraseBackground(wxEraseEvent&) -{ -} - -void wxGrid::SetCurrentCell( const wxGridCellCoords& coords ) -{ - if ( SendEvent( wxEVT_GRID_SELECT_CELL, coords.GetRow(), coords.GetCol() ) ) - { - // the event has been intercepted - do nothing - return; - } - -#if !(defined(__WXMAC__) && wxMAC_USE_CORE_GRAPHICS) - wxClientDC dc( m_gridWin ); - PrepareDC( dc ); -#endif - - if ( m_currentCellCoords != wxGridNoCellCoords ) - { - DisableCellEditControl(); - - if ( IsVisible( m_currentCellCoords, false ) ) - { - wxRect r; - r = BlockToDeviceRect( m_currentCellCoords, m_currentCellCoords ); - if ( !m_gridLinesEnabled ) - { - r.x--; - r.y--; - r.width++; - r.height++; - } - - wxGridCellCoordsArray cells = CalcCellsExposed( r ); - - // Otherwise refresh redraws the highlight! - m_currentCellCoords = coords; - -#if defined(__WXMAC__) && wxMAC_USE_CORE_GRAPHICS - m_gridWin->Refresh(true /*, & r */); -#else - DrawGridCellArea( dc, cells ); - DrawAllGridLines( dc, r ); -#endif - } - } - - m_currentCellCoords = coords; - - wxGridCellAttr *attr = GetCellAttr( coords ); -#if !(defined(__WXMAC__) && wxMAC_USE_CORE_GRAPHICS) - DrawCellHighlight( dc, attr ); -#endif - attr->DecRef(); -} - -void wxGrid::HighlightBlock( int topRow, int leftCol, int bottomRow, int rightCol ) -{ - int temp; - wxGridCellCoords updateTopLeft, updateBottomRight; - - if ( m_selection ) - { - if ( m_selection->GetSelectionMode() == wxGrid::wxGridSelectRows ) - { - leftCol = 0; - rightCol = GetNumberCols() - 1; - } - else if ( m_selection->GetSelectionMode() == wxGrid::wxGridSelectColumns ) - { - topRow = 0; - bottomRow = GetNumberRows() - 1; - } - } - - if ( topRow > bottomRow ) - { - temp = topRow; - topRow = bottomRow; - bottomRow = temp; - } - - if ( leftCol > rightCol ) - { - temp = leftCol; - leftCol = rightCol; - rightCol = temp; - } - - updateTopLeft = wxGridCellCoords( topRow, leftCol ); - updateBottomRight = wxGridCellCoords( bottomRow, rightCol ); - - // First the case that we selected a completely new area - if ( m_selectingTopLeft == wxGridNoCellCoords || - m_selectingBottomRight == wxGridNoCellCoords ) - { - wxRect rect; - rect = BlockToDeviceRect( wxGridCellCoords ( topRow, leftCol ), - wxGridCellCoords ( bottomRow, rightCol ) ); - m_gridWin->Refresh( false, &rect ); - } - - // Now handle changing an existing selection area. - else if ( m_selectingTopLeft != updateTopLeft || - m_selectingBottomRight != updateBottomRight ) - { - // Compute two optimal update rectangles: - // Either one rectangle is a real subset of the - // other, or they are (almost) disjoint! - wxRect rect[4]; - bool need_refresh[4]; - need_refresh[0] = - need_refresh[1] = - need_refresh[2] = - need_refresh[3] = false; - int i; - - // Store intermediate values - wxCoord oldLeft = m_selectingTopLeft.GetCol(); - wxCoord oldTop = m_selectingTopLeft.GetRow(); - wxCoord oldRight = m_selectingBottomRight.GetCol(); - wxCoord oldBottom = m_selectingBottomRight.GetRow(); - - // Determine the outer/inner coordinates. - if (oldLeft > leftCol) - { - temp = oldLeft; - oldLeft = leftCol; - leftCol = temp; - } - if (oldTop > topRow ) - { - temp = oldTop; - oldTop = topRow; - topRow = temp; - } - if (oldRight < rightCol ) - { - temp = oldRight; - oldRight = rightCol; - rightCol = temp; - } - if (oldBottom < bottomRow) - { - temp = oldBottom; - oldBottom = bottomRow; - bottomRow = temp; - } - - // Now, either the stuff marked old is the outer - // rectangle or we don't have a situation where one - // is contained in the other. - - if ( oldLeft < leftCol ) - { - // Refresh the newly selected or deselected - // area to the left of the old or new selection. - need_refresh[0] = true; - rect[0] = BlockToDeviceRect( - wxGridCellCoords( oldTop, oldLeft ), - wxGridCellCoords( oldBottom, leftCol - 1 ) ); - } - - if ( oldTop < topRow ) - { - // Refresh the newly selected or deselected - // area above the old or new selection. - need_refresh[1] = true; - rect[1] = BlockToDeviceRect( - wxGridCellCoords( oldTop, leftCol ), - wxGridCellCoords( topRow - 1, rightCol ) ); - } - - if ( oldRight > rightCol ) - { - // Refresh the newly selected or deselected - // area to the right of the old or new selection. - need_refresh[2] = true; - rect[2] = BlockToDeviceRect( - wxGridCellCoords( oldTop, rightCol + 1 ), - wxGridCellCoords( oldBottom, oldRight ) ); - } - - if ( oldBottom > bottomRow ) - { - // Refresh the newly selected or deselected - // area below the old or new selection. - need_refresh[3] = true; - rect[3] = BlockToDeviceRect( - wxGridCellCoords( bottomRow + 1, leftCol ), - wxGridCellCoords( oldBottom, rightCol ) ); - } - - // various Refresh() calls - for (i = 0; i < 4; i++ ) - if ( need_refresh[i] && rect[i] != wxGridNoCellRect ) - m_gridWin->Refresh( false, &(rect[i]) ); - } - - // change selection - m_selectingTopLeft = updateTopLeft; - m_selectingBottomRight = updateBottomRight; -} - -// -// ------ functions to get/send data (see also public functions) -// - -bool wxGrid::GetModelValues() -{ - // Hide the editor, so it won't hide a changed value. - HideCellEditControl(); - - if ( m_table ) - { - // all we need to do is repaint the grid - // - m_gridWin->Refresh(); - return true; - } - - return false; -} - -bool wxGrid::SetModelValues() -{ - int row, col; - - // Disable the editor, so it won't hide a changed value. - // Do we also want to save the current value of the editor first? - // I think so ... - DisableCellEditControl(); - - if ( m_table ) - { - for ( row = 0; row < m_numRows; row++ ) - { - for ( col = 0; col < m_numCols; col++ ) - { - m_table->SetValue( row, col, GetCellValue(row, col) ); - } - } - - return true; - } - - return false; -} - -// Note - this function only draws cells that are in the list of -// exposed cells (usually set from the update region by -// CalcExposedCells) -// -void wxGrid::DrawGridCellArea( wxDC& dc, const wxGridCellCoordsArray& cells ) -{ - if ( !m_numRows || !m_numCols ) - return; - - int i, numCells = cells.GetCount(); - int row, col, cell_rows, cell_cols; - wxGridCellCoordsArray redrawCells; - - for ( i = numCells - 1; i >= 0; i-- ) - { - row = cells[i].GetRow(); - col = cells[i].GetCol(); - GetCellSize( row, col, &cell_rows, &cell_cols ); - - // If this cell is part of a multicell block, find owner for repaint - if ( cell_rows <= 0 || cell_cols <= 0 ) - { - wxGridCellCoords cell( row + cell_rows, col + cell_cols ); - bool marked = false; - for ( int j = 0; j < numCells; j++ ) - { - if ( cell == cells[j] ) - { - marked = true; - break; - } - } - - if (!marked) - { - int count = redrawCells.GetCount(); - for (int j = 0; j < count; j++) - { - if ( cell == redrawCells[j] ) - { - marked = true; - break; - } - } - - if (!marked) - redrawCells.Add( cell ); - } - - // don't bother drawing this cell - continue; - } - - // If this cell is empty, find cell to left that might want to overflow - if (m_table && m_table->IsEmptyCell(row, col)) - { - for ( int l = 0; l < cell_rows; l++ ) - { - // find a cell in this row to leave already marked for repaint - int left = col; - for (int k = 0; k < int(redrawCells.GetCount()); k++) - if ((redrawCells[k].GetCol() < left) && - (redrawCells[k].GetRow() == row)) - { - left = redrawCells[k].GetCol(); - } - - if (left == col) - left = 0; // oh well - - for (int j = col - 1; j >= left; j--) - { - if (!m_table->IsEmptyCell(row + l, j)) - { - if (GetCellOverflow(row + l, j)) - { - wxGridCellCoords cell(row + l, j); - bool marked = false; - - for (int k = 0; k < numCells; k++) - { - if ( cell == cells[k] ) - { - marked = true; - break; - } - } - - if (!marked) - { - int count = redrawCells.GetCount(); - for (int k = 0; k < count; k++) - { - if ( cell == redrawCells[k] ) - { - marked = true; - break; - } - } - if (!marked) - redrawCells.Add( cell ); - } - } - break; - } - } - } - } - - DrawCell( dc, cells[i] ); - } - - numCells = redrawCells.GetCount(); - - for ( i = numCells - 1; i >= 0; i-- ) - { - DrawCell( dc, redrawCells[i] ); - } -} - -void wxGrid::DrawGridSpace( wxDC& dc ) -{ - int cw, ch; - m_gridWin->GetClientSize( &cw, &ch ); - - int right, bottom; - CalcUnscrolledPosition( cw, ch, &right, &bottom ); - - int rightCol = m_numCols > 0 ? GetColRight(GetColAt( m_numCols - 1 )) : 0; - int bottomRow = m_numRows > 0 ? GetRowBottom(m_numRows - 1) : 0; - - if ( right > rightCol || bottom > bottomRow ) - { - int left, top; - CalcUnscrolledPosition( 0, 0, &left, &top ); - - dc.SetBrush( wxBrush(GetDefaultCellBackgroundColour(), wxSOLID) ); - dc.SetPen( *wxTRANSPARENT_PEN ); - - if ( right > rightCol ) - { - dc.DrawRectangle( rightCol, top, right - rightCol, ch ); - } - - if ( bottom > bottomRow ) - { - dc.DrawRectangle( left, bottomRow, cw, bottom - bottomRow ); - } - } -} - -void wxGrid::DrawCell( wxDC& dc, const wxGridCellCoords& coords ) -{ - int row = coords.GetRow(); - int col = coords.GetCol(); - - if ( GetColWidth(col) <= 0 || GetRowHeight(row) <= 0 ) - return; - - // we draw the cell border ourselves -#if !WXGRID_DRAW_LINES - if ( m_gridLinesEnabled ) - DrawCellBorder( dc, coords ); -#endif - - wxGridCellAttr* attr = GetCellAttr(row, col); - - bool isCurrent = coords == m_currentCellCoords; - - wxRect rect = CellToRect( row, col ); - - // if the editor is shown, we should use it and not the renderer - // Note: However, only if it is really _shown_, i.e. not hidden! - if ( isCurrent && IsCellEditControlShown() ) - { - // NB: this "#if..." is temporary and fixes a problem where the - // edit control is erased by this code after being rendered. - // On wxMac (QD build only), the cell editor is a wxTextCntl and is rendered - // implicitly, causing this out-of order render. -#if !defined(__WXMAC__) - wxGridCellEditor *editor = attr->GetEditor(this, row, col); - editor->PaintBackground(rect, attr); - editor->DecRef(); -#endif - } - else - { - // but all the rest is drawn by the cell renderer and hence may be customized - wxGridCellRenderer *renderer = attr->GetRenderer(this, row, col); - renderer->Draw(*this, *attr, dc, rect, row, col, IsInSelection(coords)); - renderer->DecRef(); - } - - attr->DecRef(); -} - -void wxGrid::DrawCellHighlight( wxDC& dc, const wxGridCellAttr *attr ) -{ - // don't show highlight when the grid doesn't have focus - if ( wxWindow::FindFocus() != m_gridWin ) - return; - - int row = m_currentCellCoords.GetRow(); - int col = m_currentCellCoords.GetCol(); - - if ( GetColWidth(col) <= 0 || GetRowHeight(row) <= 0 ) - return; - - wxRect rect = CellToRect(row, col); - - // hmmm... what could we do here to show that the cell is disabled? - // for now, I just draw a thinner border than for the other ones, but - // it doesn't look really good - - int penWidth = attr->IsReadOnly() ? m_cellHighlightROPenWidth : m_cellHighlightPenWidth; - - if (penWidth > 0) - { - // The center of the drawn line is where the position/width/height of - // the rectangle is actually at (on wxMSW at least), so the - // size of the rectangle is reduced to compensate for the thickness of - // the line. If this is too strange on non-wxMSW platforms then - // please #ifdef this appropriately. - rect.x += penWidth / 2; - rect.y += penWidth / 2; - rect.width -= penWidth - 1; - rect.height -= penWidth - 1; - - // Now draw the rectangle - // use the cellHighlightColour if the cell is inside a selection, this - // will ensure the cell is always visible. - dc.SetPen(wxPen(IsInSelection(row,col) ? m_selectionForeground : m_cellHighlightColour, penWidth, wxSOLID)); - dc.SetBrush(*wxTRANSPARENT_BRUSH); - dc.DrawRectangle(rect); - } - -#if 0 - // VZ: my experiments with 3D borders... - - // how to properly set colours for arbitrary bg? - wxCoord x1 = rect.x, - y1 = rect.y, - x2 = rect.x + rect.width - 1, - y2 = rect.y + rect.height - 1; - - dc.SetPen(*wxWHITE_PEN); - dc.DrawLine(x1, y1, x2, y1); - dc.DrawLine(x1, y1, x1, y2); - - dc.DrawLine(x1 + 1, y2 - 1, x2 - 1, y2 - 1); - dc.DrawLine(x2 - 1, y1 + 1, x2 - 1, y2); - - dc.SetPen(*wxBLACK_PEN); - dc.DrawLine(x1, y2, x2, y2); - dc.DrawLine(x2, y1, x2, y2 + 1); -#endif -} - -wxPen wxGrid::GetDefaultGridLinePen() -{ - return wxPen(GetGridLineColour(), 1, wxSOLID); -} - -wxPen wxGrid::GetRowGridLinePen(int WXUNUSED(row)) -{ - return GetDefaultGridLinePen(); -} - -wxPen wxGrid::GetColGridLinePen(int WXUNUSED(col)) -{ - return GetDefaultGridLinePen(); -} - -void wxGrid::DrawCellBorder( wxDC& dc, const wxGridCellCoords& coords ) -{ - int row = coords.GetRow(); - int col = coords.GetCol(); - if ( GetColWidth(col) <= 0 || GetRowHeight(row) <= 0 ) - return; - - - wxRect rect = CellToRect( row, col ); - - // right hand border - dc.SetPen( GetColGridLinePen(col) ); - dc.DrawLine( rect.x + rect.width, rect.y, - rect.x + rect.width, rect.y + rect.height + 1 ); - - // bottom border - dc.SetPen( GetRowGridLinePen(row) ); - dc.DrawLine( rect.x, rect.y + rect.height, - rect.x + rect.width, rect.y + rect.height); -} - -void wxGrid::DrawHighlight(wxDC& dc, const wxGridCellCoordsArray& cells) -{ - // This if block was previously in wxGrid::OnPaint but that doesn't - // seem to get called under wxGTK - MB - // - if ( m_currentCellCoords == wxGridNoCellCoords && - m_numRows && m_numCols ) - { - m_currentCellCoords.Set(0, 0); - } - - if ( IsCellEditControlShown() ) - { - // don't show highlight when the edit control is shown - return; - } - - // if the active cell was repainted, repaint its highlight too because it - // might have been damaged by the grid lines - size_t count = cells.GetCount(); - for ( size_t n = 0; n < count; n++ ) - { - wxGridCellCoords cell = cells[n]; - - // If we are using attributes, then we may have just exposed another - // cell in a partially-visible merged cluster of cells. If the "anchor" - // (upper left) cell of this merged cluster is the cell indicated by - // m_currentCellCoords, then we need to refresh the cell highlight even - // though the "anchor" itself is not part of our update segment. - if ( CanHaveAttributes() ) - { - int rows = 0, - cols = 0; - GetCellSize(cell.GetRow(), cell.GetCol(), &rows, &cols); - - if ( rows < 0 ) - cell.SetRow(cell.GetRow() + rows); - - if ( cols < 0 ) - cell.SetCol(cell.GetCol() + cols); - } - - if ( cell == m_currentCellCoords ) - { - wxGridCellAttr* attr = GetCellAttr(m_currentCellCoords); - DrawCellHighlight(dc, attr); - attr->DecRef(); - - break; - } - } -} - -// TODO: remove this ??? -// This is used to redraw all grid lines e.g. when the grid line colour -// has been changed -// -void wxGrid::DrawAllGridLines( wxDC& dc, const wxRegion & WXUNUSED(reg) ) -{ -#if !WXGRID_DRAW_LINES - return; -#endif - - if ( !m_gridLinesEnabled || !m_numRows || !m_numCols ) - return; - - int top, bottom, left, right; - -#if 0 //#ifndef __WXGTK__ - if (reg.IsEmpty()) - { - int cw, ch; - m_gridWin->GetClientSize(&cw, &ch); - - // virtual coords of visible area - // - CalcUnscrolledPosition( 0, 0, &left, &top ); - CalcUnscrolledPosition( cw, ch, &right, &bottom ); - } - else - { - wxCoord x, y, w, h; - reg.GetBox(x, y, w, h); - CalcUnscrolledPosition( x, y, &left, &top ); - CalcUnscrolledPosition( x + w, y + h, &right, &bottom ); - } -#else - int cw, ch; - m_gridWin->GetClientSize(&cw, &ch); - CalcUnscrolledPosition( 0, 0, &left, &top ); - CalcUnscrolledPosition( cw, ch, &right, &bottom ); -#endif - - // avoid drawing grid lines past the last row and col - // - right = wxMin( right, GetColRight(GetColAt( m_numCols - 1 )) ); - bottom = wxMin( bottom, GetRowBottom(m_numRows - 1) ); - - // no gridlines inside multicells, clip them out - int leftCol = GetColPos( internalXToCol(left) ); - int topRow = internalYToRow(top); - int rightCol = GetColPos( internalXToCol(right) ); - int bottomRow = internalYToRow(bottom); - -#if !defined(__WXMAC__) || wxMAC_USE_CORE_GRAPHICS - wxRegion clippedcells(0, 0, cw, ch); - - int i, j, cell_rows, cell_cols; - wxRect rect; - - for (j=topRow; j<=bottomRow; j++) - { - int colPos; - for (colPos=leftCol; colPos<=rightCol; colPos++) - { - i = GetColAt( colPos ); - - GetCellSize( j, i, &cell_rows, &cell_cols ); - if ((cell_rows > 1) || (cell_cols > 1)) - { - rect = CellToRect(j,i); - CalcScrolledPosition( rect.x, rect.y, &rect.x, &rect.y ); - clippedcells.Subtract(rect); - } - else if ((cell_rows < 0) || (cell_cols < 0)) - { - rect = CellToRect(j + cell_rows, i + cell_cols); - CalcScrolledPosition( rect.x, rect.y, &rect.x, &rect.y ); - clippedcells.Subtract(rect); - } - } - } -#else - wxRegion clippedcells( left, top, right - left, bottom - top ); - - int i, j, cell_rows, cell_cols; - wxRect rect; - - for (j=topRow; j<=bottomRow; j++) - { - for (i=leftCol; i<=rightCol; i++) - { - GetCellSize( j, i, &cell_rows, &cell_cols ); - if ((cell_rows > 1) || (cell_cols > 1)) - { - rect = CellToRect(j, i); - clippedcells.Subtract(rect); - } - else if ((cell_rows < 0) || (cell_cols < 0)) - { - rect = CellToRect(j + cell_rows, i + cell_cols); - clippedcells.Subtract(rect); - } - } - } -#endif - - dc.SetClippingRegion( clippedcells ); - - - // horizontal grid lines - // - // already declared above - int i; - for ( i = internalYToRow(top); i < m_numRows; i++ ) - { - int bot = GetRowBottom(i) - 1; - - if ( bot > bottom ) - { - break; - } - - if ( bot >= top ) - { - dc.SetPen( GetRowGridLinePen(i) ); - dc.DrawLine( left, bot, right, bot ); - } - } - - // vertical grid lines - // - int colPos; - for ( colPos = leftCol; colPos < m_numCols; colPos++ ) - { - i = GetColAt( colPos ); - - int colRight = GetColRight(i); -#ifdef __WXGTK__ - if (GetLayoutDirection() != wxLayout_RightToLeft) -#endif - colRight--; - - if ( colRight > right ) - { - break; - } - - if ( colRight >= left ) - { - dc.SetPen( GetColGridLinePen(i) ); - dc.DrawLine( colRight, top, colRight, bottom ); - } - } - - dc.DestroyClippingRegion(); -} - -void wxGrid::DrawRowLabels( wxDC& dc, const wxArrayInt& rows) -{ - if ( !m_numRows ) - return; - - size_t i; - size_t numLabels = rows.GetCount(); - - for ( i = 0; i < numLabels; i++ ) - { - DrawRowLabel( dc, rows[i] ); - } -} - -void wxGrid::DrawRowLabel( wxDC& dc, int row ) -{ - if ( GetRowHeight(row) <= 0 || m_rowLabelWidth <= 0 ) - return; - - wxRect rect; - -#if 0 -def __WXGTK20__ - rect.SetX( 1 ); - rect.SetY( GetRowTop(row) + 1 ); - rect.SetWidth( m_rowLabelWidth - 2 ); - rect.SetHeight( GetRowHeight(row) - 2 ); - - CalcScrolledPosition( 0, rect.y, NULL, &rect.y ); - - wxWindowDC *win_dc = (wxWindowDC*) &dc; - - wxRendererNative::Get().DrawHeaderButton( win_dc->m_owner, dc, rect, 0 ); -#else - int rowTop = GetRowTop(row), - rowBottom = GetRowBottom(row) - 1; - - dc.SetPen( wxPen(wxSystemSettings::GetColour(wxSYS_COLOUR_3DSHADOW), 1, wxSOLID) ); - dc.DrawLine( m_rowLabelWidth - 1, rowTop, m_rowLabelWidth - 1, rowBottom ); - dc.DrawLine( 0, rowTop, 0, rowBottom ); - dc.DrawLine( 0, rowBottom, m_rowLabelWidth, rowBottom ); - - dc.SetPen( *wxWHITE_PEN ); - dc.DrawLine( 1, rowTop, 1, rowBottom ); - dc.DrawLine( 1, rowTop, m_rowLabelWidth - 1, rowTop ); -#endif - - dc.SetBackgroundMode( wxTRANSPARENT ); - dc.SetTextForeground( GetLabelTextColour() ); - dc.SetFont( GetLabelFont() ); - - int hAlign, vAlign; - GetRowLabelAlignment( &hAlign, &vAlign ); - - rect.SetX( 2 ); - rect.SetY( GetRowTop(row) + 2 ); - rect.SetWidth( m_rowLabelWidth - 4 ); - rect.SetHeight( GetRowHeight(row) - 4 ); - DrawTextRectangle( dc, GetRowLabelValue( row ), rect, hAlign, vAlign ); -} - -void wxGrid::DrawColLabels( wxDC& dc,const wxArrayInt& cols ) -{ - if ( !m_numCols ) - return; - - size_t i; - size_t numLabels = cols.GetCount(); - - for ( i = 0; i < numLabels; i++ ) - { - DrawColLabel( dc, cols[i] ); - } -} - -void wxGrid::DrawColLabel( wxDC& dc, int col ) -{ - if ( GetColWidth(col) <= 0 || m_colLabelHeight <= 0 ) - return; - - int colLeft = GetColLeft(col); - - wxRect rect; - -#if 0 -def __WXGTK20__ - rect.SetX( colLeft + 1 ); - rect.SetY( 1 ); - rect.SetWidth( GetColWidth(col) - 2 ); - rect.SetHeight( m_colLabelHeight - 2 ); - - wxWindowDC *win_dc = (wxWindowDC*) &dc; - - wxRendererNative::Get().DrawHeaderButton( win_dc->m_owner, dc, rect, 0 ); -#else - int colRight = GetColRight(col) - 1; - - dc.SetPen( wxPen(wxSystemSettings::GetColour(wxSYS_COLOUR_3DSHADOW), 1, wxSOLID) ); - dc.DrawLine( colRight, 0, colRight, m_colLabelHeight - 1 ); - dc.DrawLine( colLeft, 0, colRight, 0 ); - dc.DrawLine( colLeft, m_colLabelHeight - 1, - colRight + 1, m_colLabelHeight - 1 ); - - dc.SetPen( *wxWHITE_PEN ); - dc.DrawLine( colLeft, 1, colLeft, m_colLabelHeight - 1 ); - dc.DrawLine( colLeft, 1, colRight, 1 ); -#endif - - dc.SetBackgroundMode( wxTRANSPARENT ); - dc.SetTextForeground( GetLabelTextColour() ); - dc.SetFont( GetLabelFont() ); - - int hAlign, vAlign, orient; - GetColLabelAlignment( &hAlign, &vAlign ); - orient = GetColLabelTextOrientation(); - - rect.SetX( colLeft + 2 ); - rect.SetY( 2 ); - rect.SetWidth( GetColWidth(col) - 4 ); - rect.SetHeight( m_colLabelHeight - 4 ); - DrawTextRectangle( dc, GetColLabelValue( col ), rect, hAlign, vAlign, orient ); -} - -void wxGrid::DrawTextRectangle( wxDC& dc, - const wxString& value, - const wxRect& rect, - int horizAlign, - int vertAlign, - int textOrientation ) -{ - wxArrayString lines; - - StringToLines( value, lines ); - - // Forward to new API. - DrawTextRectangle( dc, - lines, - rect, - horizAlign, - vertAlign, - textOrientation ); -} - -// VZ: this should be replaced with wxDC::DrawLabel() to which we just have to -// add textOrientation support -void wxGrid::DrawTextRectangle(wxDC& dc, - const wxArrayString& lines, - const wxRect& rect, - int horizAlign, - int vertAlign, - int textOrientation) -{ - if ( lines.empty() ) - return; - - wxDCClipper clip(dc, rect); - - long textWidth, - textHeight; - - if ( textOrientation == wxHORIZONTAL ) - GetTextBoxSize( dc, lines, &textWidth, &textHeight ); - else - GetTextBoxSize( dc, lines, &textHeight, &textWidth ); - - int x = 0, - y = 0; - switch ( vertAlign ) - { - case wxALIGN_BOTTOM: - if ( textOrientation == wxHORIZONTAL ) - y = rect.y + (rect.height - textHeight - 1); - else - x = rect.x + rect.width - textWidth; - break; - - case wxALIGN_CENTRE: - if ( textOrientation == wxHORIZONTAL ) - y = rect.y + ((rect.height - textHeight) / 2); - else - x = rect.x + ((rect.width - textWidth) / 2); - break; - - case wxALIGN_TOP: - default: - if ( textOrientation == wxHORIZONTAL ) - y = rect.y + 1; - else - x = rect.x + 1; - break; - } - - // Align each line of a multi-line label - size_t nLines = lines.GetCount(); - for ( size_t l = 0; l < nLines; l++ ) - { - const wxString& line = lines[l]; - - if ( line.empty() ) - { - *(textOrientation == wxHORIZONTAL ? &y : &x) += dc.GetCharHeight(); - continue; - } - - long lineWidth = 0, - lineHeight = 0; - dc.GetTextExtent(line, &lineWidth, &lineHeight); - - switch ( horizAlign ) - { - case wxALIGN_RIGHT: - if ( textOrientation == wxHORIZONTAL ) - x = rect.x + (rect.width - lineWidth - 1); - else - y = rect.y + lineWidth + 1; - break; - - case wxALIGN_CENTRE: - if ( textOrientation == wxHORIZONTAL ) - x = rect.x + ((rect.width - lineWidth) / 2); - else - y = rect.y + rect.height - ((rect.height - lineWidth) / 2); - break; - - case wxALIGN_LEFT: - default: - if ( textOrientation == wxHORIZONTAL ) - x = rect.x + 1; - else - y = rect.y + rect.height - 1; - break; - } - - if ( textOrientation == wxHORIZONTAL ) - { - dc.DrawText( line, x, y ); - y += lineHeight; - } - else - { - dc.DrawRotatedText( line, x, y, 90.0 ); - x += lineHeight; - } - } -} - -// Split multi-line text up into an array of strings. -// Any existing contents of the string array are preserved. -// -void wxGrid::StringToLines( const wxString& value, wxArrayString& lines ) -{ - int startPos = 0; - int pos; - wxString eol = wxTextFile::GetEOL( wxTextFileType_Unix ); - wxString tVal = wxTextFile::Translate( value, wxTextFileType_Unix ); - - while ( startPos < (int)tVal.length() ) - { - pos = tVal.Mid(startPos).Find( eol ); - if ( pos < 0 ) - { - break; - } - else if ( pos == 0 ) - { - lines.Add( wxEmptyString ); - } - else - { - lines.Add( tVal.Mid(startPos, pos) ); - } - - startPos += pos + 1; - } - - if ( startPos < (int)tVal.length() ) - { - lines.Add( tVal.Mid( startPos ) ); - } -} - -void wxGrid::GetTextBoxSize( const wxDC& dc, - const wxArrayString& lines, - long *width, long *height ) -{ - long w = 0; - long h = 0; - long lineW = 0, lineH = 0; - - size_t i; - for ( i = 0; i < lines.GetCount(); i++ ) - { - dc.GetTextExtent( lines[i], &lineW, &lineH ); - w = wxMax( w, lineW ); - h += lineH; - } - - *width = w; - *height = h; -} - -// -// ------ Batch processing. -// -void wxGrid::EndBatch() -{ - if ( m_batchCount > 0 ) - { - m_batchCount--; - if ( !m_batchCount ) - { - CalcDimensions(); - m_rowLabelWin->Refresh(); - m_colLabelWin->Refresh(); - m_cornerLabelWin->Refresh(); - m_gridWin->Refresh(); - } - } -} - -// Use this, rather than wxWindow::Refresh(), to force an immediate -// repainting of the grid. Has no effect if you are already inside a -// BeginBatch / EndBatch block. -// -void wxGrid::ForceRefresh() -{ - BeginBatch(); - EndBatch(); -} - -bool wxGrid::Enable(bool enable) -{ - if ( !wxScrolledWindow::Enable(enable) ) - return false; - - // redraw in the new state - m_gridWin->Refresh(); - - return true; -} - -// -// ------ Edit control functions -// - -void wxGrid::EnableEditing( bool edit ) -{ - // TODO: improve this ? - // - if ( edit != m_editable ) - { - if (!edit) - EnableCellEditControl(edit); - m_editable = edit; - } -} - -void wxGrid::EnableCellEditControl( bool enable ) -{ - if (! m_editable) - return; - - if ( enable != m_cellEditCtrlEnabled ) - { - if ( enable ) - { - if (SendEvent( wxEVT_GRID_EDITOR_SHOWN) <0) - return; - - // this should be checked by the caller! - wxASSERT_MSG( CanEnableCellControl(), _T("can't enable editing for this cell!") ); - - // do it before ShowCellEditControl() - m_cellEditCtrlEnabled = enable; - - ShowCellEditControl(); - } - else - { - //FIXME:add veto support - SendEvent( wxEVT_GRID_EDITOR_HIDDEN ); - - HideCellEditControl(); - SaveEditControlValue(); - - // do it after HideCellEditControl() - m_cellEditCtrlEnabled = enable; - } - } -} - -bool wxGrid::IsCurrentCellReadOnly() const -{ - // const_cast - wxGridCellAttr* attr = ((wxGrid *)this)->GetCellAttr(m_currentCellCoords); - bool readonly = attr->IsReadOnly(); - attr->DecRef(); - - return readonly; -} - -bool wxGrid::CanEnableCellControl() const -{ - return m_editable && (m_currentCellCoords != wxGridNoCellCoords) && - !IsCurrentCellReadOnly(); -} - -bool wxGrid::IsCellEditControlEnabled() const -{ - // the cell edit control might be disable for all cells or just for the - // current one if it's read only - return m_cellEditCtrlEnabled ? !IsCurrentCellReadOnly() : false; -} - -bool wxGrid::IsCellEditControlShown() const -{ - bool isShown = false; - - if ( m_cellEditCtrlEnabled ) - { - int row = m_currentCellCoords.GetRow(); - int col = m_currentCellCoords.GetCol(); - wxGridCellAttr* attr = GetCellAttr(row, col); - wxGridCellEditor* editor = attr->GetEditor((wxGrid*) this, row, col); - attr->DecRef(); - - if ( editor ) - { - if ( editor->IsCreated() ) - { - isShown = editor->GetControl()->IsShown(); - } - - editor->DecRef(); - } - } - - return isShown; -} - -void wxGrid::ShowCellEditControl() -{ - if ( IsCellEditControlEnabled() ) - { - if ( !IsVisible( m_currentCellCoords, false ) ) - { - m_cellEditCtrlEnabled = false; - return; - } - else - { - wxRect rect = CellToRect( m_currentCellCoords ); - int row = m_currentCellCoords.GetRow(); - int col = m_currentCellCoords.GetCol(); - - // if this is part of a multicell, find owner (topleft) - int cell_rows, cell_cols; - GetCellSize( row, col, &cell_rows, &cell_cols ); - if ( cell_rows <= 0 || cell_cols <= 0 ) - { - row += cell_rows; - col += cell_cols; - m_currentCellCoords.SetRow( row ); - m_currentCellCoords.SetCol( col ); - } - - // erase the highlight and the cell contents because the editor - // might not cover the entire cell - wxClientDC dc( m_gridWin ); - PrepareDC( dc ); - wxGridCellAttr* attr = GetCellAttr(row, col); - dc.SetBrush(wxBrush(attr->GetBackgroundColour(), wxSOLID)); - dc.SetPen(*wxTRANSPARENT_PEN); - dc.DrawRectangle(rect); - - // convert to scrolled coords - CalcScrolledPosition( rect.x, rect.y, &rect.x, &rect.y ); - - int nXMove = 0; - if (rect.x < 0) - nXMove = rect.x; - - // cell is shifted by one pixel - // However, don't allow x or y to become negative - // since the SetSize() method interprets that as - // "don't change." - if (rect.x > 0) - rect.x--; - if (rect.y > 0) - rect.y--; - - wxGridCellEditor* editor = attr->GetEditor(this, row, col); - if ( !editor->IsCreated() ) - { - editor->Create(m_gridWin, wxID_ANY, - new wxGridCellEditorEvtHandler(this, editor)); - - wxGridEditorCreatedEvent evt(GetId(), - wxEVT_GRID_EDITOR_CREATED, - this, - row, - col, - editor->GetControl()); - GetEventHandler()->ProcessEvent(evt); - } - - // resize editor to overflow into righthand cells if allowed - int maxWidth = rect.width; - wxString value = GetCellValue(row, col); - if ( (value != wxEmptyString) && (attr->GetOverflow()) ) - { - int y; - GetTextExtent(value, &maxWidth, &y, NULL, NULL, &attr->GetFont()); - if (maxWidth < rect.width) - maxWidth = rect.width; - } - - int client_right = m_gridWin->GetClientSize().GetWidth(); - if (rect.x + maxWidth > client_right) - maxWidth = client_right - rect.x; - - if ((maxWidth > rect.width) && (col < m_numCols) && m_table) - { - GetCellSize( row, col, &cell_rows, &cell_cols ); - // may have changed earlier - for (int i = col + cell_cols; i < m_numCols; i++) - { - int c_rows, c_cols; - GetCellSize( row, i, &c_rows, &c_cols ); - - // looks weird going over a multicell - if (m_table->IsEmptyCell( row, i ) && - (rect.width < maxWidth) && (c_rows == 1)) - { - rect.width += GetColWidth( i ); - } - else - break; - } - - if (rect.GetRight() > client_right) - rect.SetRight( client_right - 1 ); - } - - editor->SetCellAttr( attr ); - editor->SetSize( rect ); - if (nXMove != 0) - editor->GetControl()->Move( - editor->GetControl()->GetPosition().x + nXMove, - editor->GetControl()->GetPosition().y ); - editor->Show( true, attr ); - -#ifdef __WXGTK20__ - int px, py; - GetViewStart(& px, & py); -#endif - - // recalc dimensions in case we need to - // expand the scrolled window to account for editor - CalcDimensions(); - - editor->BeginEdit(row, col, this); - editor->SetCellAttr(NULL); - - editor->DecRef(); - attr->DecRef(); - -#ifdef __WXGTK20__ - // On GTK+, erroneous scrolling to the old control - // position can happen when the grid window gets a - // focus event and this is processed by wxScrollHelper. - // This line resets the scroll position. - Scroll(px, py); -#endif - } - } -} - -void wxGrid::HideCellEditControl() -{ - if ( IsCellEditControlEnabled() ) - { - int row = m_currentCellCoords.GetRow(); - int col = m_currentCellCoords.GetCol(); - - wxGridCellAttr *attr = GetCellAttr(row, col); - wxGridCellEditor *editor = attr->GetEditor(this, row, col); - const bool - editorHadFocus = wxWindow::FindFocus() == editor->GetControl(); - editor->Show( false ); - editor->DecRef(); - attr->DecRef(); - - // return the focus to the grid itself if the editor had it - // - // note that we must not do this unconditionally to avoid stealing - // focus from the window which just received it if we are hiding the - // editor precisely because we lost focus - if ( editorHadFocus ) - m_gridWin->SetFocus(); - - // refresh whole row to the right - wxRect rect( CellToRect(row, col) ); - CalcScrolledPosition(rect.x, rect.y, &rect.x, &rect.y ); - rect.width = m_gridWin->GetClientSize().GetWidth() - rect.x; - -#ifdef __WXMAC__ - // ensure that the pixels under the focus ring get refreshed as well - rect.Inflate(10, 10); -#endif - - m_gridWin->Refresh( false, &rect ); - } -} - -void wxGrid::SaveEditControlValue() -{ - if ( IsCellEditControlEnabled() ) - { - int row = m_currentCellCoords.GetRow(); - int col = m_currentCellCoords.GetCol(); - - wxString oldval = GetCellValue(row, col); - - wxGridCellAttr* attr = GetCellAttr(row, col); - wxGridCellEditor* editor = attr->GetEditor(this, row, col); - bool changed = editor->EndEdit(row, col, this); - - editor->DecRef(); - attr->DecRef(); - - if (changed) - { - if ( SendEvent( wxEVT_GRID_CELL_CHANGE, - m_currentCellCoords.GetRow(), - m_currentCellCoords.GetCol() ) < 0 ) - { - // Event has been vetoed, set the data back. - SetCellValue(row, col, oldval); - } - } - } -} - -// -// ------ Grid location functions -// Note that all of these functions work with the logical coordinates of -// grid cells and labels so you will need to convert from device -// coordinates for mouse events etc. -// - -void wxGrid::XYToCell( int x, int y, wxGridCellCoords& coords ) -{ - int row = YToRow(y); - int col = XToCol(x); - - if ( row == -1 || col == -1 ) - { - coords = wxGridNoCellCoords; - } - else - { - coords.Set( row, col ); - } -} - -// Internal Helper function for computing row or column from some -// (unscrolled) coordinate value, using either -// m_defaultRowHeight/m_defaultColWidth or binary search on array -// of m_rowBottoms/m_ColRights to speed up the search! - -static int CoordToRowOrCol(int coord, int defaultDist, int minDist, - const wxArrayInt& BorderArray, int nMax, - bool clipToMinMax) -{ - if (coord < 0) - return clipToMinMax && (nMax > 0) ? 0 : -1; - - if (!defaultDist) - defaultDist = 1; - - size_t i_max = coord / defaultDist, - i_min = 0; - - if (BorderArray.IsEmpty()) - { - if ((int) i_max < nMax) - return i_max; - return clipToMinMax ? nMax - 1 : -1; - } - - if ( i_max >= BorderArray.GetCount()) - { - i_max = BorderArray.GetCount() - 1; - } - else - { - if ( coord >= BorderArray[i_max]) - { - i_min = i_max; - if (minDist) - i_max = coord / minDist; - else - i_max = BorderArray.GetCount() - 1; - } - - if ( i_max >= BorderArray.GetCount()) - i_max = BorderArray.GetCount() - 1; - } - - if ( coord >= BorderArray[i_max]) - return clipToMinMax ? (int)i_max : -1; - if ( coord < BorderArray[0] ) - return 0; - - while ( i_max - i_min > 0 ) - { - wxCHECK_MSG(BorderArray[i_min] <= coord && coord < BorderArray[i_max], - 0, _T("wxGrid: internal error in CoordToRowOrCol")); - if (coord >= BorderArray[ i_max - 1]) - return i_max; - else - i_max--; - int median = i_min + (i_max - i_min + 1) / 2; - if (coord < BorderArray[median]) - i_max = median; - else - i_min = median; - } - - return i_max; -} - -int wxGrid::YToRow( int y ) -{ - return CoordToRowOrCol(y, m_defaultRowHeight, - m_minAcceptableRowHeight, m_rowBottoms, m_numRows, false); -} - -int wxGrid::XToCol( int x, bool clipToMinMax ) -{ - if (x < 0) - return clipToMinMax && (m_numCols > 0) ? GetColAt( 0 ) : -1; - - if (!m_defaultColWidth) - m_defaultColWidth = 1; - - int maxPos = x / m_defaultColWidth; - int minPos = 0; - - if (m_colRights.IsEmpty()) - { - if(maxPos < m_numCols) - return GetColAt( maxPos ); - return clipToMinMax ? GetColAt( m_numCols - 1 ) : -1; - } - - if ( maxPos >= m_numCols) - maxPos = m_numCols - 1; - else - { - if ( x >= m_colRights[GetColAt( maxPos )]) - { - minPos = maxPos; - if (m_minAcceptableColWidth) - maxPos = x / m_minAcceptableColWidth; - else - maxPos = m_numCols - 1; - } - if ( maxPos >= m_numCols) - maxPos = m_numCols - 1; - } - - //X is beyond the last column - if ( x >= m_colRights[GetColAt( maxPos )]) - return clipToMinMax ? GetColAt( maxPos ) : -1; - - //X is before the first column - if ( x < m_colRights[GetColAt( 0 )] ) - return GetColAt( 0 ); - - //Perform a binary search - while ( maxPos - minPos > 0 ) - { - wxCHECK_MSG(m_colRights[GetColAt( minPos )] <= x && x < m_colRights[GetColAt( maxPos )], - 0, _T("wxGrid: internal error in XToCol")); - - if (x >= m_colRights[GetColAt( maxPos - 1 )]) - return GetColAt( maxPos ); - else - maxPos--; - int median = minPos + (maxPos - minPos + 1) / 2; - if (x < m_colRights[GetColAt( median )]) - maxPos = median; - else - minPos = median; - } - return GetColAt( maxPos ); -} - -// return the row number that that the y coord is near -// the edge of, or -1 if not near an edge. -// coords can only possibly be near an edge if -// (a) the row/column is large enough to still allow for an "inner" area -// that is _not_ nead the edge (i.e., if the height/width is smaller -// than WXGRID_LABEL_EDGE_ZONE, coords are _never_ considered to be -// near the edge). -// and -// (b) resizing rows/columns (the thing for which edge detection is -// relevant at all) is enabled. -// -int wxGrid::YToEdgeOfRow( int y ) -{ - int i; - i = internalYToRow(y); - - if ( GetRowHeight(i) > WXGRID_LABEL_EDGE_ZONE && CanDragRowSize() ) - { - // We know that we are in row i, test whether we are - // close enough to lower or upper border, respectively. - if ( abs(GetRowBottom(i) - y) < WXGRID_LABEL_EDGE_ZONE ) - return i; - else if ( i > 0 && y - GetRowTop(i) < WXGRID_LABEL_EDGE_ZONE ) - return i - 1; - } - - return -1; -} - -// return the col number that that the x coord is near the edge of, or -// -1 if not near an edge -// See comment at YToEdgeOfRow for conditions on edge detection. -// -int wxGrid::XToEdgeOfCol( int x ) -{ - int i; - i = internalXToCol(x); - - if ( GetColWidth(i) > WXGRID_LABEL_EDGE_ZONE && CanDragColSize() ) - { - // We know that we are in column i; test whether we are - // close enough to right or left border, respectively. - if ( abs(GetColRight(i) - x) < WXGRID_LABEL_EDGE_ZONE ) - return i; - else if ( i > 0 && x - GetColLeft(i) < WXGRID_LABEL_EDGE_ZONE ) - return i - 1; - } - - return -1; -} - -wxRect wxGrid::CellToRect( int row, int col ) -{ - wxRect rect( -1, -1, -1, -1 ); - - if ( row >= 0 && row < m_numRows && - col >= 0 && col < m_numCols ) - { - int i, cell_rows, cell_cols; - rect.width = rect.height = 0; - GetCellSize( row, col, &cell_rows, &cell_cols ); - // if negative then find multicell owner - if (cell_rows < 0) - row += cell_rows; - if (cell_cols < 0) - col += cell_cols; - GetCellSize( row, col, &cell_rows, &cell_cols ); - - rect.x = GetColLeft(col); - rect.y = GetRowTop(row); - for (i=col; i < col + cell_cols; i++) - rect.width += GetColWidth(i); - for (i=row; i < row + cell_rows; i++) - rect.height += GetRowHeight(i); - } - - // if grid lines are enabled, then the area of the cell is a bit smaller - if (m_gridLinesEnabled) - { - rect.width -= 1; - rect.height -= 1; - } - - return rect; -} - -bool wxGrid::IsVisible( int row, int col, bool wholeCellVisible ) -{ - // get the cell rectangle in logical coords - // - wxRect r( CellToRect( row, col ) ); - - // convert to device coords - // - int left, top, right, bottom; - CalcScrolledPosition( r.GetLeft(), r.GetTop(), &left, &top ); - CalcScrolledPosition( r.GetRight(), r.GetBottom(), &right, &bottom ); - - // check against the client area of the grid window - int cw, ch; - m_gridWin->GetClientSize( &cw, &ch ); - - if ( wholeCellVisible ) - { - // is the cell wholly visible ? - return ( left >= 0 && right <= cw && - top >= 0 && bottom <= ch ); - } - else - { - // is the cell partly visible ? - // - return ( ((left >= 0 && left < cw) || (right > 0 && right <= cw)) && - ((top >= 0 && top < ch) || (bottom > 0 && bottom <= ch)) ); - } -} - -// make the specified cell location visible by doing a minimal amount -// of scrolling -// -void wxGrid::MakeCellVisible( int row, int col ) -{ - int i; - int xpos = -1, ypos = -1; - - if ( row >= 0 && row < m_numRows && - col >= 0 && col < m_numCols ) - { - // get the cell rectangle in logical coords - wxRect r( CellToRect( row, col ) ); - - // convert to device coords - int left, top, right, bottom; - CalcScrolledPosition( r.GetLeft(), r.GetTop(), &left, &top ); - CalcScrolledPosition( r.GetRight(), r.GetBottom(), &right, &bottom ); - - int cw, ch; - m_gridWin->GetClientSize( &cw, &ch ); - - if ( top < 0 ) - { - ypos = r.GetTop(); - } - else if ( bottom > ch ) - { - int h = r.GetHeight(); - ypos = r.GetTop(); - for ( i = row - 1; i >= 0; i-- ) - { - int rowHeight = GetRowHeight(i); - if ( h + rowHeight > ch ) - break; - - h += rowHeight; - ypos -= rowHeight; - } - - // we divide it later by GRID_SCROLL_LINE, make sure that we don't - // have rounding errors (this is important, because if we do, - // we might not scroll at all and some cells won't be redrawn) - // - // Sometimes GRID_SCROLL_LINE / 2 is not enough, - // so just add a full scroll unit... - ypos += m_scrollLineY; - } - - // special handling for wide cells - show always left part of the cell! - // Otherwise, e.g. when stepping from row to row, it would jump between - // left and right part of the cell on every step! -// if ( left < 0 ) - if ( left < 0 || (right - left) >= cw ) - { - xpos = r.GetLeft(); - } - else if ( right > cw ) - { - // position the view so that the cell is on the right - int x0, y0; - CalcUnscrolledPosition(0, 0, &x0, &y0); - xpos = x0 + (right - cw); - - // see comment for ypos above - xpos += m_scrollLineX; - } - - if ( xpos != -1 || ypos != -1 ) - { - if ( xpos != -1 ) - xpos /= m_scrollLineX; - if ( ypos != -1 ) - ypos /= m_scrollLineY; - Scroll( xpos, ypos ); - AdjustScrollbars(); - } - } -} - -// -// ------ Grid cursor movement functions -// - -bool wxGrid::MoveCursorUp( bool expandSelection ) -{ - if ( m_currentCellCoords != wxGridNoCellCoords && - m_currentCellCoords.GetRow() >= 0 ) - { - if ( expandSelection ) - { - if ( m_selectingKeyboard == wxGridNoCellCoords ) - m_selectingKeyboard = m_currentCellCoords; - if ( m_selectingKeyboard.GetRow() > 0 ) - { - m_selectingKeyboard.SetRow( m_selectingKeyboard.GetRow() - 1 ); - MakeCellVisible( m_selectingKeyboard.GetRow(), - m_selectingKeyboard.GetCol() ); - HighlightBlock( m_currentCellCoords, m_selectingKeyboard ); - } - } - else if ( m_currentCellCoords.GetRow() > 0 ) - { - int row = m_currentCellCoords.GetRow() - 1; - int col = m_currentCellCoords.GetCol(); - ClearSelection(); - MakeCellVisible( row, col ); - SetCurrentCell( row, col ); - } - else - return false; - - return true; - } - - return false; -} - -bool wxGrid::MoveCursorDown( bool expandSelection ) -{ - if ( m_currentCellCoords != wxGridNoCellCoords && - m_currentCellCoords.GetRow() < m_numRows ) - { - if ( expandSelection ) - { - if ( m_selectingKeyboard == wxGridNoCellCoords ) - m_selectingKeyboard = m_currentCellCoords; - if ( m_selectingKeyboard.GetRow() < m_numRows - 1 ) - { - m_selectingKeyboard.SetRow( m_selectingKeyboard.GetRow() + 1 ); - MakeCellVisible( m_selectingKeyboard.GetRow(), - m_selectingKeyboard.GetCol() ); - HighlightBlock( m_currentCellCoords, m_selectingKeyboard ); - } - } - else if ( m_currentCellCoords.GetRow() < m_numRows - 1 ) - { - int row = m_currentCellCoords.GetRow() + 1; - int col = m_currentCellCoords.GetCol(); - ClearSelection(); - MakeCellVisible( row, col ); - SetCurrentCell( row, col ); - } - else - return false; - - return true; - } - - return false; -} - -bool wxGrid::MoveCursorLeft( bool expandSelection ) -{ - if ( m_currentCellCoords != wxGridNoCellCoords && - m_currentCellCoords.GetCol() >= 0 ) - { - if ( expandSelection ) - { - if ( m_selectingKeyboard == wxGridNoCellCoords ) - m_selectingKeyboard = m_currentCellCoords; - if ( m_selectingKeyboard.GetCol() > 0 ) - { - m_selectingKeyboard.SetCol( m_selectingKeyboard.GetCol() - 1 ); - MakeCellVisible( m_selectingKeyboard.GetRow(), - m_selectingKeyboard.GetCol() ); - HighlightBlock( m_currentCellCoords, m_selectingKeyboard ); - } - } - else if ( GetColPos( m_currentCellCoords.GetCol() ) > 0 ) - { - int row = m_currentCellCoords.GetRow(); - int col = GetColAt( GetColPos( m_currentCellCoords.GetCol() ) - 1 ); - ClearSelection(); - - MakeCellVisible( row, col ); - SetCurrentCell( row, col ); - } - else - return false; - - return true; - } - - return false; -} - -bool wxGrid::MoveCursorRight( bool expandSelection ) -{ - if ( m_currentCellCoords != wxGridNoCellCoords && - m_currentCellCoords.GetCol() < m_numCols ) - { - if ( expandSelection ) - { - if ( m_selectingKeyboard == wxGridNoCellCoords ) - m_selectingKeyboard = m_currentCellCoords; - if ( m_selectingKeyboard.GetCol() < m_numCols - 1 ) - { - m_selectingKeyboard.SetCol( m_selectingKeyboard.GetCol() + 1 ); - MakeCellVisible( m_selectingKeyboard.GetRow(), - m_selectingKeyboard.GetCol() ); - HighlightBlock( m_currentCellCoords, m_selectingKeyboard ); - } - } - else if ( GetColPos( m_currentCellCoords.GetCol() ) < m_numCols - 1 ) - { - int row = m_currentCellCoords.GetRow(); - int col = GetColAt( GetColPos( m_currentCellCoords.GetCol() ) + 1 ); - ClearSelection(); - - MakeCellVisible( row, col ); - SetCurrentCell( row, col ); - } - else - return false; - - return true; - } - - return false; -} - -bool wxGrid::MovePageUp() -{ - if ( m_currentCellCoords == wxGridNoCellCoords ) - return false; - - int row = m_currentCellCoords.GetRow(); - if ( row > 0 ) - { - int cw, ch; - m_gridWin->GetClientSize( &cw, &ch ); - - int y = GetRowTop(row); - int newRow = internalYToRow( y - ch + 1 ); - - if ( newRow == row ) - { - // row > 0, so newRow can never be less than 0 here. - newRow = row - 1; - } - - MakeCellVisible( newRow, m_currentCellCoords.GetCol() ); - SetCurrentCell( newRow, m_currentCellCoords.GetCol() ); - - return true; - } - - return false; -} - -bool wxGrid::MovePageDown() -{ - if ( m_currentCellCoords == wxGridNoCellCoords ) - return false; - - int row = m_currentCellCoords.GetRow(); - if ( (row + 1) < m_numRows ) - { - int cw, ch; - m_gridWin->GetClientSize( &cw, &ch ); - - int y = GetRowTop(row); - int newRow = internalYToRow( y + ch ); - if ( newRow == row ) - { - // row < m_numRows, so newRow can't overflow here. - newRow = row + 1; - } - - MakeCellVisible( newRow, m_currentCellCoords.GetCol() ); - SetCurrentCell( newRow, m_currentCellCoords.GetCol() ); - - return true; - } - - return false; -} - -bool wxGrid::MoveCursorUpBlock( bool expandSelection ) -{ - if ( m_table && - m_currentCellCoords != wxGridNoCellCoords && - m_currentCellCoords.GetRow() > 0 ) - { - int row = m_currentCellCoords.GetRow(); - int col = m_currentCellCoords.GetCol(); - - if ( m_table->IsEmptyCell(row, col) ) - { - // starting in an empty cell: find the next block of - // non-empty cells - // - while ( row > 0 ) - { - row--; - if ( !(m_table->IsEmptyCell(row, col)) ) - break; - } - } - else if ( m_table->IsEmptyCell(row - 1, col) ) - { - // starting at the top of a block: find the next block - // - row--; - while ( row > 0 ) - { - row--; - if ( !(m_table->IsEmptyCell(row, col)) ) - break; - } - } - else - { - // starting within a block: find the top of the block - // - while ( row > 0 ) - { - row--; - if ( m_table->IsEmptyCell(row, col) ) - { - row++; - break; - } - } - } - - MakeCellVisible( row, col ); - if ( expandSelection ) - { - m_selectingKeyboard = wxGridCellCoords( row, col ); - HighlightBlock( m_currentCellCoords, m_selectingKeyboard ); - } - else - { - ClearSelection(); - SetCurrentCell( row, col ); - } - - return true; - } - - return false; -} - -bool wxGrid::MoveCursorDownBlock( bool expandSelection ) -{ - if ( m_table && - m_currentCellCoords != wxGridNoCellCoords && - m_currentCellCoords.GetRow() < m_numRows - 1 ) - { - int row = m_currentCellCoords.GetRow(); - int col = m_currentCellCoords.GetCol(); - - if ( m_table->IsEmptyCell(row, col) ) - { - // starting in an empty cell: find the next block of - // non-empty cells - // - while ( row < m_numRows - 1 ) - { - row++; - if ( !(m_table->IsEmptyCell(row, col)) ) - break; - } - } - else if ( m_table->IsEmptyCell(row + 1, col) ) - { - // starting at the bottom of a block: find the next block - // - row++; - while ( row < m_numRows - 1 ) - { - row++; - if ( !(m_table->IsEmptyCell(row, col)) ) - break; - } - } - else - { - // starting within a block: find the bottom of the block - // - while ( row < m_numRows - 1 ) - { - row++; - if ( m_table->IsEmptyCell(row, col) ) - { - row--; - break; - } - } - } - - MakeCellVisible( row, col ); - if ( expandSelection ) - { - m_selectingKeyboard = wxGridCellCoords( row, col ); - HighlightBlock( m_currentCellCoords, m_selectingKeyboard ); - } - else - { - ClearSelection(); - SetCurrentCell( row, col ); - } - - return true; - } - - return false; -} - -bool wxGrid::MoveCursorLeftBlock( bool expandSelection ) -{ - if ( m_table && - m_currentCellCoords != wxGridNoCellCoords && - m_currentCellCoords.GetCol() > 0 ) - { - int row = m_currentCellCoords.GetRow(); - int col = m_currentCellCoords.GetCol(); - - if ( m_table->IsEmptyCell(row, col) ) - { - // starting in an empty cell: find the next block of - // non-empty cells - // - while ( col > 0 ) - { - col--; - if ( !(m_table->IsEmptyCell(row, col)) ) - break; - } - } - else if ( m_table->IsEmptyCell(row, col - 1) ) - { - // starting at the left of a block: find the next block - // - col--; - while ( col > 0 ) - { - col--; - if ( !(m_table->IsEmptyCell(row, col)) ) - break; - } - } - else - { - // starting within a block: find the left of the block - // - while ( col > 0 ) - { - col--; - if ( m_table->IsEmptyCell(row, col) ) - { - col++; - break; - } - } - } - - MakeCellVisible( row, col ); - if ( expandSelection ) - { - m_selectingKeyboard = wxGridCellCoords( row, col ); - HighlightBlock( m_currentCellCoords, m_selectingKeyboard ); - } - else - { - ClearSelection(); - SetCurrentCell( row, col ); - } - - return true; - } - - return false; -} - -bool wxGrid::MoveCursorRightBlock( bool expandSelection ) -{ - if ( m_table && - m_currentCellCoords != wxGridNoCellCoords && - m_currentCellCoords.GetCol() < m_numCols - 1 ) - { - int row = m_currentCellCoords.GetRow(); - int col = m_currentCellCoords.GetCol(); - - if ( m_table->IsEmptyCell(row, col) ) - { - // starting in an empty cell: find the next block of - // non-empty cells - // - while ( col < m_numCols - 1 ) - { - col++; - if ( !(m_table->IsEmptyCell(row, col)) ) - break; - } - } - else if ( m_table->IsEmptyCell(row, col + 1) ) - { - // starting at the right of a block: find the next block - // - col++; - while ( col < m_numCols - 1 ) - { - col++; - if ( !(m_table->IsEmptyCell(row, col)) ) - break; - } - } - else - { - // starting within a block: find the right of the block - // - while ( col < m_numCols - 1 ) - { - col++; - if ( m_table->IsEmptyCell(row, col) ) - { - col--; - break; - } - } - } - - MakeCellVisible( row, col ); - if ( expandSelection ) - { - m_selectingKeyboard = wxGridCellCoords( row, col ); - HighlightBlock( m_currentCellCoords, m_selectingKeyboard ); - } - else - { - ClearSelection(); - SetCurrentCell( row, col ); - } - - return true; - } - - return false; -} - -// -// ------ Label values and formatting -// - -void wxGrid::GetRowLabelAlignment( int *horiz, int *vert ) -{ - if ( horiz ) - *horiz = m_rowLabelHorizAlign; - if ( vert ) - *vert = m_rowLabelVertAlign; -} - -void wxGrid::GetColLabelAlignment( int *horiz, int *vert ) -{ - if ( horiz ) - *horiz = m_colLabelHorizAlign; - if ( vert ) - *vert = m_colLabelVertAlign; -} - -int wxGrid::GetColLabelTextOrientation() -{ - return m_colLabelTextOrientation; -} - -wxString wxGrid::GetRowLabelValue( int row ) -{ - if ( m_table ) - { - return m_table->GetRowLabelValue( row ); - } - else - { - wxString s; - s << row; - return s; - } -} - -wxString wxGrid::GetColLabelValue( int col ) -{ - if ( m_table ) - { - return m_table->GetColLabelValue( col ); - } - else - { - wxString s; - s << col; - return s; - } -} - -void wxGrid::SetRowLabelSize( int width ) -{ - wxASSERT( width >= 0 || width == wxGRID_AUTOSIZE ); - - if ( width == wxGRID_AUTOSIZE ) - { - width = CalcColOrRowLabelAreaMinSize(false/*row*/); - } - - if ( width != m_rowLabelWidth ) - { - if ( width == 0 ) - { - m_rowLabelWin->Show( false ); - m_cornerLabelWin->Show( false ); - } - else if ( m_rowLabelWidth == 0 ) - { - m_rowLabelWin->Show( true ); - if ( m_colLabelHeight > 0 ) - m_cornerLabelWin->Show( true ); - } - - m_rowLabelWidth = width; - CalcWindowSizes(); - wxScrolledWindow::Refresh( true ); - } -} - -void wxGrid::SetColLabelSize( int height ) -{ - wxASSERT( height >=0 || height == wxGRID_AUTOSIZE ); - - if ( height == wxGRID_AUTOSIZE ) - { - height = CalcColOrRowLabelAreaMinSize(true/*column*/); - } - - if ( height != m_colLabelHeight ) - { - if ( height == 0 ) - { - m_colLabelWin->Show( false ); - m_cornerLabelWin->Show( false ); - } - else if ( m_colLabelHeight == 0 ) - { - m_colLabelWin->Show( true ); - if ( m_rowLabelWidth > 0 ) - m_cornerLabelWin->Show( true ); - } - - m_colLabelHeight = height; - CalcWindowSizes(); - wxScrolledWindow::Refresh( true ); - } -} - -void wxGrid::SetLabelBackgroundColour( const wxColour& colour ) -{ - if ( m_labelBackgroundColour != colour ) - { - m_labelBackgroundColour = colour; - m_rowLabelWin->SetBackgroundColour( colour ); - m_colLabelWin->SetBackgroundColour( colour ); - m_cornerLabelWin->SetBackgroundColour( colour ); - - if ( !GetBatchCount() ) - { - m_rowLabelWin->Refresh(); - m_colLabelWin->Refresh(); - m_cornerLabelWin->Refresh(); - } - } -} - -void wxGrid::SetLabelTextColour( const wxColour& colour ) -{ - if ( m_labelTextColour != colour ) - { - m_labelTextColour = colour; - if ( !GetBatchCount() ) - { - m_rowLabelWin->Refresh(); - m_colLabelWin->Refresh(); - } - } -} - -void wxGrid::SetLabelFont( const wxFont& font ) -{ - m_labelFont = font; - if ( !GetBatchCount() ) - { - m_rowLabelWin->Refresh(); - m_colLabelWin->Refresh(); - } -} - -void wxGrid::SetRowLabelAlignment( int horiz, int vert ) -{ - // allow old (incorrect) defs to be used - switch ( horiz ) - { - case wxLEFT: horiz = wxALIGN_LEFT; break; - case wxRIGHT: horiz = wxALIGN_RIGHT; break; - case wxCENTRE: horiz = wxALIGN_CENTRE; break; - } - - switch ( vert ) - { - case wxTOP: vert = wxALIGN_TOP; break; - case wxBOTTOM: vert = wxALIGN_BOTTOM; break; - case wxCENTRE: vert = wxALIGN_CENTRE; break; - } - - if ( horiz == wxALIGN_LEFT || horiz == wxALIGN_CENTRE || horiz == wxALIGN_RIGHT ) - { - m_rowLabelHorizAlign = horiz; - } - - if ( vert == wxALIGN_TOP || vert == wxALIGN_CENTRE || vert == wxALIGN_BOTTOM ) - { - m_rowLabelVertAlign = vert; - } - - if ( !GetBatchCount() ) - { - m_rowLabelWin->Refresh(); - } -} - -void wxGrid::SetColLabelAlignment( int horiz, int vert ) -{ - // allow old (incorrect) defs to be used - switch ( horiz ) - { - case wxLEFT: horiz = wxALIGN_LEFT; break; - case wxRIGHT: horiz = wxALIGN_RIGHT; break; - case wxCENTRE: horiz = wxALIGN_CENTRE; break; - } - - switch ( vert ) - { - case wxTOP: vert = wxALIGN_TOP; break; - case wxBOTTOM: vert = wxALIGN_BOTTOM; break; - case wxCENTRE: vert = wxALIGN_CENTRE; break; - } - - if ( horiz == wxALIGN_LEFT || horiz == wxALIGN_CENTRE || horiz == wxALIGN_RIGHT ) - { - m_colLabelHorizAlign = horiz; - } - - if ( vert == wxALIGN_TOP || vert == wxALIGN_CENTRE || vert == wxALIGN_BOTTOM ) - { - m_colLabelVertAlign = vert; - } - - if ( !GetBatchCount() ) - { - m_colLabelWin->Refresh(); - } -} - -// Note: under MSW, the default column label font must be changed because it -// does not support vertical printing -// -// Example: wxFont font(9, wxSWISS, wxNORMAL, wxBOLD); -// pGrid->SetLabelFont(font); -// pGrid->SetColLabelTextOrientation(wxVERTICAL); -// -void wxGrid::SetColLabelTextOrientation( int textOrientation ) -{ - if ( textOrientation == wxHORIZONTAL || textOrientation == wxVERTICAL ) - m_colLabelTextOrientation = textOrientation; - - if ( !GetBatchCount() ) - m_colLabelWin->Refresh(); -} - -void wxGrid::SetRowLabelValue( int row, const wxString& s ) -{ - if ( m_table ) - { - m_table->SetRowLabelValue( row, s ); - if ( !GetBatchCount() ) - { - wxRect rect = CellToRect( row, 0 ); - if ( rect.height > 0 ) - { - CalcScrolledPosition(0, rect.y, &rect.x, &rect.y); - rect.x = 0; - rect.width = m_rowLabelWidth; - m_rowLabelWin->Refresh( true, &rect ); - } - } - } -} - -void wxGrid::SetColLabelValue( int col, const wxString& s ) -{ - if ( m_table ) - { - m_table->SetColLabelValue( col, s ); - if ( !GetBatchCount() ) - { - wxRect rect = CellToRect( 0, col ); - if ( rect.width > 0 ) - { - CalcScrolledPosition(rect.x, 0, &rect.x, &rect.y); - rect.y = 0; - rect.height = m_colLabelHeight; - m_colLabelWin->Refresh( true, &rect ); - } - } - } -} - -void wxGrid::SetGridLineColour( const wxColour& colour ) -{ - if ( m_gridLineColour != colour ) - { - m_gridLineColour = colour; - - wxClientDC dc( m_gridWin ); - PrepareDC( dc ); - DrawAllGridLines( dc, wxRegion() ); - } -} - -void wxGrid::SetCellHighlightColour( const wxColour& colour ) -{ - if ( m_cellHighlightColour != colour ) - { - m_cellHighlightColour = colour; - - wxClientDC dc( m_gridWin ); - PrepareDC( dc ); - wxGridCellAttr* attr = GetCellAttr(m_currentCellCoords); - DrawCellHighlight(dc, attr); - attr->DecRef(); - } -} - -void wxGrid::SetCellHighlightPenWidth(int width) -{ - if (m_cellHighlightPenWidth != width) - { - m_cellHighlightPenWidth = width; - - // Just redrawing the cell highlight is not enough since that won't - // make any visible change if the the thickness is getting smaller. - int row = m_currentCellCoords.GetRow(); - int col = m_currentCellCoords.GetCol(); - if ( row == -1 || col == -1 || GetColWidth(col) <= 0 || GetRowHeight(row) <= 0 ) - return; - - wxRect rect = CellToRect(row, col); - m_gridWin->Refresh(true, &rect); - } -} - -void wxGrid::SetCellHighlightROPenWidth(int width) -{ - if (m_cellHighlightROPenWidth != width) - { - m_cellHighlightROPenWidth = width; - - // Just redrawing the cell highlight is not enough since that won't - // make any visible change if the the thickness is getting smaller. - int row = m_currentCellCoords.GetRow(); - int col = m_currentCellCoords.GetCol(); - if ( row == -1 || col == -1 || - GetColWidth(col) <= 0 || GetRowHeight(row) <= 0 ) - return; - - wxRect rect = CellToRect(row, col); - m_gridWin->Refresh(true, &rect); - } -} - -void wxGrid::EnableGridLines( bool enable ) -{ - if ( enable != m_gridLinesEnabled ) - { - m_gridLinesEnabled = enable; - - if ( !GetBatchCount() ) - { - if ( enable ) - { - wxClientDC dc( m_gridWin ); - PrepareDC( dc ); - DrawAllGridLines( dc, wxRegion() ); - } - else - { - m_gridWin->Refresh(); - } - } - } -} - -int wxGrid::GetDefaultRowSize() -{ - return m_defaultRowHeight; -} - -int wxGrid::GetRowSize( int row ) -{ - wxCHECK_MSG( row >= 0 && row < m_numRows, 0, _T("invalid row index") ); - - return GetRowHeight(row); -} - -int wxGrid::GetDefaultColSize() -{ - return m_defaultColWidth; -} - -int wxGrid::GetColSize( int col ) -{ - wxCHECK_MSG( col >= 0 && col < m_numCols, 0, _T("invalid column index") ); - - return GetColWidth(col); -} - -// ============================================================================ -// access to the grid attributes: each of them has a default value in the grid -// itself and may be overidden on a per-cell basis -// ============================================================================ - -// ---------------------------------------------------------------------------- -// setting default attributes -// ---------------------------------------------------------------------------- - -void wxGrid::SetDefaultCellBackgroundColour( const wxColour& col ) -{ - m_defaultCellAttr->SetBackgroundColour(col); -#ifdef __WXGTK__ - m_gridWin->SetBackgroundColour(col); -#endif -} - -void wxGrid::SetDefaultCellTextColour( const wxColour& col ) -{ - m_defaultCellAttr->SetTextColour(col); -} - -void wxGrid::SetDefaultCellAlignment( int horiz, int vert ) -{ - m_defaultCellAttr->SetAlignment(horiz, vert); -} - -void wxGrid::SetDefaultCellOverflow( bool allow ) -{ - m_defaultCellAttr->SetOverflow(allow); -} - -void wxGrid::SetDefaultCellFont( const wxFont& font ) -{ - m_defaultCellAttr->SetFont(font); -} - -// For editors and renderers the type registry takes precedence over the -// default attr, so we need to register the new editor/renderer for the string -// data type in order to make setting a default editor/renderer appear to -// work correctly. - -void wxGrid::SetDefaultRenderer(wxGridCellRenderer *renderer) -{ - RegisterDataType(wxGRID_VALUE_STRING, - renderer, - GetDefaultEditorForType(wxGRID_VALUE_STRING)); -} - -void wxGrid::SetDefaultEditor(wxGridCellEditor *editor) -{ - RegisterDataType(wxGRID_VALUE_STRING, - GetDefaultRendererForType(wxGRID_VALUE_STRING), - editor); -} - -// ---------------------------------------------------------------------------- -// access to the default attrbiutes -// ---------------------------------------------------------------------------- - -wxColour wxGrid::GetDefaultCellBackgroundColour() -{ - return m_defaultCellAttr->GetBackgroundColour(); -} - -wxColour wxGrid::GetDefaultCellTextColour() -{ - return m_defaultCellAttr->GetTextColour(); -} - -wxFont wxGrid::GetDefaultCellFont() -{ - return m_defaultCellAttr->GetFont(); -} - -void wxGrid::GetDefaultCellAlignment( int *horiz, int *vert ) -{ - m_defaultCellAttr->GetAlignment(horiz, vert); -} - -bool wxGrid::GetDefaultCellOverflow() -{ - return m_defaultCellAttr->GetOverflow(); -} - -wxGridCellRenderer *wxGrid::GetDefaultRenderer() const -{ - return m_defaultCellAttr->GetRenderer(NULL, 0, 0); -} - -wxGridCellEditor *wxGrid::GetDefaultEditor() const -{ - return m_defaultCellAttr->GetEditor(NULL, 0, 0); -} - -// ---------------------------------------------------------------------------- -// access to cell attributes -// ---------------------------------------------------------------------------- - -wxColour wxGrid::GetCellBackgroundColour(int row, int col) -{ - wxGridCellAttr *attr = GetCellAttr(row, col); - wxColour colour = attr->GetBackgroundColour(); - attr->DecRef(); - - return colour; -} - -wxColour wxGrid::GetCellTextColour( int row, int col ) -{ - wxGridCellAttr *attr = GetCellAttr(row, col); - wxColour colour = attr->GetTextColour(); - attr->DecRef(); - - return colour; -} - -wxFont wxGrid::GetCellFont( int row, int col ) -{ - wxGridCellAttr *attr = GetCellAttr(row, col); - wxFont font = attr->GetFont(); - attr->DecRef(); - - return font; -} - -void wxGrid::GetCellAlignment( int row, int col, int *horiz, int *vert ) -{ - wxGridCellAttr *attr = GetCellAttr(row, col); - attr->GetAlignment(horiz, vert); - attr->DecRef(); -} - -bool wxGrid::GetCellOverflow( int row, int col ) -{ - wxGridCellAttr *attr = GetCellAttr(row, col); - bool allow = attr->GetOverflow(); - attr->DecRef(); - - return allow; -} - -void wxGrid::GetCellSize( int row, int col, int *num_rows, int *num_cols ) -{ - wxGridCellAttr *attr = GetCellAttr(row, col); - attr->GetSize( num_rows, num_cols ); - attr->DecRef(); -} - -wxGridCellRenderer* wxGrid::GetCellRenderer(int row, int col) -{ - wxGridCellAttr* attr = GetCellAttr(row, col); - wxGridCellRenderer* renderer = attr->GetRenderer(this, row, col); - attr->DecRef(); - - return renderer; -} - -wxGridCellEditor* wxGrid::GetCellEditor(int row, int col) -{ - wxGridCellAttr* attr = GetCellAttr(row, col); - wxGridCellEditor* editor = attr->GetEditor(this, row, col); - attr->DecRef(); - - return editor; -} - -bool wxGrid::IsReadOnly(int row, int col) const -{ - wxGridCellAttr* attr = GetCellAttr(row, col); - bool isReadOnly = attr->IsReadOnly(); - attr->DecRef(); - - return isReadOnly; -} - -// ---------------------------------------------------------------------------- -// attribute support: cache, automatic provider creation, ... -// ---------------------------------------------------------------------------- - -bool wxGrid::CanHaveAttributes() -{ - if ( !m_table ) - { - return false; - } - - return m_table->CanHaveAttributes(); -} - -void wxGrid::ClearAttrCache() -{ - if ( m_attrCache.row != -1 ) - { - wxGridCellAttr *oldAttr = m_attrCache.attr; - m_attrCache.attr = NULL; - m_attrCache.row = -1; - // wxSafeDecRec(...) might cause event processing that accesses - // the cached attribute, if one exists (e.g. by deleting the - // editor stored within the attribute). Therefore it is important - // to invalidate the cache before calling wxSafeDecRef! - wxSafeDecRef(oldAttr); - } -} - -void wxGrid::CacheAttr(int row, int col, wxGridCellAttr *attr) const -{ - if ( attr != NULL ) - { - wxGrid *self = (wxGrid *)this; // const_cast - - self->ClearAttrCache(); - self->m_attrCache.row = row; - self->m_attrCache.col = col; - self->m_attrCache.attr = attr; - wxSafeIncRef(attr); - } -} - -bool wxGrid::LookupAttr(int row, int col, wxGridCellAttr **attr) const -{ - if ( row == m_attrCache.row && col == m_attrCache.col ) - { - *attr = m_attrCache.attr; - wxSafeIncRef(m_attrCache.attr); - -#ifdef DEBUG_ATTR_CACHE - gs_nAttrCacheHits++; -#endif - - return true; - } - else - { -#ifdef DEBUG_ATTR_CACHE - gs_nAttrCacheMisses++; -#endif - - return false; - } -} - -wxGridCellAttr *wxGrid::GetCellAttr(int row, int col) const -{ - wxGridCellAttr *attr = NULL; - // Additional test to avoid looking at the cache e.g. for - // wxNoCellCoords, as this will confuse memory management. - if ( row >= 0 ) - { - if ( !LookupAttr(row, col, &attr) ) - { - attr = m_table ? m_table->GetAttr(row, col, wxGridCellAttr::Any) - : (wxGridCellAttr *)NULL; - CacheAttr(row, col, attr); - } - } - - if (attr) - { - attr->SetDefAttr(m_defaultCellAttr); - } - else - { - attr = m_defaultCellAttr; - attr->IncRef(); - } - - return attr; -} - -wxGridCellAttr *wxGrid::GetOrCreateCellAttr(int row, int col) const -{ - wxGridCellAttr *attr = (wxGridCellAttr *)NULL; - bool canHave = ((wxGrid*)this)->CanHaveAttributes(); - - wxCHECK_MSG( canHave, attr, _T("Cell attributes not allowed")); - wxCHECK_MSG( m_table, attr, _T("must have a table") ); - - attr = m_table->GetAttr(row, col, wxGridCellAttr::Cell); - if ( !attr ) - { - attr = new wxGridCellAttr(m_defaultCellAttr); - - // artificially inc the ref count to match DecRef() in caller - attr->IncRef(); - m_table->SetAttr(attr, row, col); - } - - return attr; -} - -// ---------------------------------------------------------------------------- -// setting column attributes (wrappers around SetColAttr) -// ---------------------------------------------------------------------------- - -void wxGrid::SetColFormatBool(int col) -{ - SetColFormatCustom(col, wxGRID_VALUE_BOOL); -} - -void wxGrid::SetColFormatNumber(int col) -{ - SetColFormatCustom(col, wxGRID_VALUE_NUMBER); -} - -void wxGrid::SetColFormatFloat(int col, int width, int precision) -{ - wxString typeName = wxGRID_VALUE_FLOAT; - if ( (width != -1) || (precision != -1) ) - { - typeName << _T(':') << width << _T(',') << precision; - } - - SetColFormatCustom(col, typeName); -} - -void wxGrid::SetColFormatCustom(int col, const wxString& typeName) -{ - wxGridCellAttr *attr = m_table->GetAttr(-1, col, wxGridCellAttr::Col ); - if (!attr) - attr = new wxGridCellAttr; - wxGridCellRenderer *renderer = GetDefaultRendererForType(typeName); - attr->SetRenderer(renderer); - - SetColAttr(col, attr); - -} - -// ---------------------------------------------------------------------------- -// setting cell attributes: this is forwarded to the table -// ---------------------------------------------------------------------------- - -void wxGrid::SetAttr(int row, int col, wxGridCellAttr *attr) -{ - if ( CanHaveAttributes() ) - { - m_table->SetAttr(attr, row, col); - ClearAttrCache(); - } - else - { - wxSafeDecRef(attr); - } -} - -void wxGrid::SetRowAttr(int row, wxGridCellAttr *attr) -{ - if ( CanHaveAttributes() ) - { - m_table->SetRowAttr(attr, row); - ClearAttrCache(); - } - else - { - wxSafeDecRef(attr); - } -} - -void wxGrid::SetColAttr(int col, wxGridCellAttr *attr) -{ - if ( CanHaveAttributes() ) - { - m_table->SetColAttr(attr, col); - ClearAttrCache(); - } - else - { - wxSafeDecRef(attr); - } -} - -void wxGrid::SetCellBackgroundColour( int row, int col, const wxColour& colour ) -{ - if ( CanHaveAttributes() ) - { - wxGridCellAttr *attr = GetOrCreateCellAttr(row, col); - attr->SetBackgroundColour(colour); - attr->DecRef(); - } -} - -void wxGrid::SetCellTextColour( int row, int col, const wxColour& colour ) -{ - if ( CanHaveAttributes() ) - { - wxGridCellAttr *attr = GetOrCreateCellAttr(row, col); - attr->SetTextColour(colour); - attr->DecRef(); - } -} - -void wxGrid::SetCellFont( int row, int col, const wxFont& font ) -{ - if ( CanHaveAttributes() ) - { - wxGridCellAttr *attr = GetOrCreateCellAttr(row, col); - attr->SetFont(font); - attr->DecRef(); - } -} - -void wxGrid::SetCellAlignment( int row, int col, int horiz, int vert ) -{ - if ( CanHaveAttributes() ) - { - wxGridCellAttr *attr = GetOrCreateCellAttr(row, col); - attr->SetAlignment(horiz, vert); - attr->DecRef(); - } -} - -void wxGrid::SetCellOverflow( int row, int col, bool allow ) -{ - if ( CanHaveAttributes() ) - { - wxGridCellAttr *attr = GetOrCreateCellAttr(row, col); - attr->SetOverflow(allow); - attr->DecRef(); - } -} - -void wxGrid::SetCellSize( int row, int col, int num_rows, int num_cols ) -{ - if ( CanHaveAttributes() ) - { - int cell_rows, cell_cols; - - wxGridCellAttr *attr = GetOrCreateCellAttr(row, col); - attr->GetSize(&cell_rows, &cell_cols); - attr->SetSize(num_rows, num_cols); - attr->DecRef(); - - // Cannot set the size of a cell to 0 or negative values - // While it is perfectly legal to do that, this function cannot - // handle all the possibilies, do it by hand by getting the CellAttr. - // You can only set the size of a cell to 1,1 or greater with this fn - wxASSERT_MSG( !((cell_rows < 1) || (cell_cols < 1)), - wxT("wxGrid::SetCellSize setting cell size that is already part of another cell")); - wxASSERT_MSG( !((num_rows < 1) || (num_cols < 1)), - wxT("wxGrid::SetCellSize setting cell size to < 1")); - - // if this was already a multicell then "turn off" the other cells first - if ((cell_rows > 1) || (cell_cols > 1)) - { - int i, j; - for (j=row; j < row + cell_rows; j++) - { - for (i=col; i < col + cell_cols; i++) - { - if ((i != col) || (j != row)) - { - wxGridCellAttr *attr_stub = GetOrCreateCellAttr(j, i); - attr_stub->SetSize( 1, 1 ); - attr_stub->DecRef(); - } - } - } - } - - // mark the cells that will be covered by this cell to - // negative or zero values to point back at this cell - if (((num_rows > 1) || (num_cols > 1)) && (num_rows >= 1) && (num_cols >= 1)) - { - int i, j; - for (j=row; j < row + num_rows; j++) - { - for (i=col; i < col + num_cols; i++) - { - if ((i != col) || (j != row)) - { - wxGridCellAttr *attr_stub = GetOrCreateCellAttr(j, i); - attr_stub->SetSize( row - j, col - i ); - attr_stub->DecRef(); - } - } - } - } - } -} - -void wxGrid::SetCellRenderer(int row, int col, wxGridCellRenderer *renderer) -{ - if ( CanHaveAttributes() ) - { - wxGridCellAttr *attr = GetOrCreateCellAttr(row, col); - attr->SetRenderer(renderer); - attr->DecRef(); - } -} - -void wxGrid::SetCellEditor(int row, int col, wxGridCellEditor* editor) -{ - if ( CanHaveAttributes() ) - { - wxGridCellAttr *attr = GetOrCreateCellAttr(row, col); - attr->SetEditor(editor); - attr->DecRef(); - } -} - -void wxGrid::SetReadOnly(int row, int col, bool isReadOnly) -{ - if ( CanHaveAttributes() ) - { - wxGridCellAttr *attr = GetOrCreateCellAttr(row, col); - attr->SetReadOnly(isReadOnly); - attr->DecRef(); - } -} - -// ---------------------------------------------------------------------------- -// Data type registration -// ---------------------------------------------------------------------------- - -void wxGrid::RegisterDataType(const wxString& typeName, - wxGridCellRenderer* renderer, - wxGridCellEditor* editor) -{ - m_typeRegistry->RegisterDataType(typeName, renderer, editor); -} - - -wxGridCellEditor * wxGrid::GetDefaultEditorForCell(int row, int col) const -{ - wxString typeName = m_table->GetTypeName(row, col); - return GetDefaultEditorForType(typeName); -} - -wxGridCellRenderer * wxGrid::GetDefaultRendererForCell(int row, int col) const -{ - wxString typeName = m_table->GetTypeName(row, col); - return GetDefaultRendererForType(typeName); -} - -wxGridCellEditor * wxGrid::GetDefaultEditorForType(const wxString& typeName) const -{ - int index = m_typeRegistry->FindOrCloneDataType(typeName); - if ( index == wxNOT_FOUND ) - { - wxString errStr; - - errStr.Printf(wxT("Unknown data type name [%s]"), typeName.c_str()); - wxFAIL_MSG(errStr.c_str()); - - return NULL; - } - - return m_typeRegistry->GetEditor(index); -} - -wxGridCellRenderer * wxGrid::GetDefaultRendererForType(const wxString& typeName) const -{ - int index = m_typeRegistry->FindOrCloneDataType(typeName); - if ( index == wxNOT_FOUND ) - { - wxString errStr; - - errStr.Printf(wxT("Unknown data type name [%s]"), typeName.c_str()); - wxFAIL_MSG(errStr.c_str()); - - return NULL; - } - - return m_typeRegistry->GetRenderer(index); -} - -// ---------------------------------------------------------------------------- -// row/col size -// ---------------------------------------------------------------------------- - -void wxGrid::EnableDragRowSize( bool enable ) -{ - m_canDragRowSize = enable; -} - -void wxGrid::EnableDragColSize( bool enable ) -{ - m_canDragColSize = enable; -} - -void wxGrid::EnableDragGridSize( bool enable ) -{ - m_canDragGridSize = enable; -} - -void wxGrid::EnableDragCell( bool enable ) -{ - m_canDragCell = enable; -} - -void wxGrid::SetDefaultRowSize( int height, bool resizeExistingRows ) -{ - m_defaultRowHeight = wxMax( height, m_minAcceptableRowHeight ); - - if ( resizeExistingRows ) - { - // since we are resizing all rows to the default row size, - // we can simply clear the row heights and row bottoms - // arrays (which also allows us to take advantage of - // some speed optimisations) - m_rowHeights.Empty(); - m_rowBottoms.Empty(); - if ( !GetBatchCount() ) - CalcDimensions(); - } -} - -void wxGrid::SetRowSize( int row, int height ) -{ - wxCHECK_RET( row >= 0 && row < m_numRows, _T("invalid row index") ); - - // if < 0 then calculate new height from label - if ( height < 0 ) - { - long w, h; - wxArrayString lines; - wxClientDC dc(m_rowLabelWin); - dc.SetFont(GetLabelFont()); - StringToLines(GetRowLabelValue( row ), lines); - GetTextBoxSize( dc, lines, &w, &h ); - //check that it is not less than the minimal height - height = wxMax(h, GetRowMinimalAcceptableHeight()); - } - - // See comment in SetColSize - if ( height < GetRowMinimalAcceptableHeight()) - return; - - if ( m_rowHeights.IsEmpty() ) - { - // need to really create the array - InitRowHeights(); - } - - int h = wxMax( 0, height ); - int diff = h - m_rowHeights[row]; - - m_rowHeights[row] = h; - for ( int i = row; i < m_numRows; i++ ) - { - m_rowBottoms[i] += diff; - } - - if ( !GetBatchCount() ) - CalcDimensions(); -} - -void wxGrid::SetDefaultColSize( int width, bool resizeExistingCols ) -{ - m_defaultColWidth = wxMax( width, m_minAcceptableColWidth ); - - if ( resizeExistingCols ) - { - // since we are resizing all columns to the default column size, - // we can simply clear the col widths and col rights - // arrays (which also allows us to take advantage of - // some speed optimisations) - m_colWidths.Empty(); - m_colRights.Empty(); - if ( !GetBatchCount() ) - CalcDimensions(); - } -} - -void wxGrid::SetColSize( int col, int width ) -{ - wxCHECK_RET( col >= 0 && col < m_numCols, _T("invalid column index") ); - - // if < 0 then calculate new width from label - if ( width < 0 ) - { - long w, h; - wxArrayString lines; - wxClientDC dc(m_colLabelWin); - dc.SetFont(GetLabelFont()); - StringToLines(GetColLabelValue(col), lines); - if ( GetColLabelTextOrientation() == wxHORIZONTAL ) - GetTextBoxSize( dc, lines, &w, &h ); - else - GetTextBoxSize( dc, lines, &h, &w ); - width = w + 6; - //check that it is not less than the minimal width - width = wxMax(width, GetColMinimalAcceptableWidth()); - } - - // should we check that it's bigger than GetColMinimalWidth(col) here? - // (VZ) - // No, because it is reasonable to assume the library user know's - // what he is doing. However we should test against the weaker - // constraint of minimalAcceptableWidth, as this breaks rendering - // - // This test then fixes sf.net bug #645734 - - if ( width < GetColMinimalAcceptableWidth() ) - return; - - if ( m_colWidths.IsEmpty() ) - { - // need to really create the array - InitColWidths(); - } - - int w = wxMax( 0, width ); - int diff = w - m_colWidths[col]; - m_colWidths[col] = w; - - for ( int colPos = GetColPos(col); colPos < m_numCols; colPos++ ) - { - m_colRights[GetColAt(colPos)] += diff; - } - - if ( !GetBatchCount() ) - CalcDimensions(); -} - -void wxGrid::SetColMinimalWidth( int col, int width ) -{ - if (width > GetColMinimalAcceptableWidth()) - { - wxLongToLongHashMap::key_type key = (wxLongToLongHashMap::key_type)col; - m_colMinWidths[key] = width; - } -} - -void wxGrid::SetRowMinimalHeight( int row, int width ) -{ - if (width > GetRowMinimalAcceptableHeight()) - { - wxLongToLongHashMap::key_type key = (wxLongToLongHashMap::key_type)row; - m_rowMinHeights[key] = width; - } -} - -int wxGrid::GetColMinimalWidth(int col) const -{ - wxLongToLongHashMap::key_type key = (wxLongToLongHashMap::key_type)col; - wxLongToLongHashMap::const_iterator it = m_colMinWidths.find(key); - - return it != m_colMinWidths.end() ? (int)it->second : m_minAcceptableColWidth; -} - -int wxGrid::GetRowMinimalHeight(int row) const -{ - wxLongToLongHashMap::key_type key = (wxLongToLongHashMap::key_type)row; - wxLongToLongHashMap::const_iterator it = m_rowMinHeights.find(key); - - return it != m_rowMinHeights.end() ? (int)it->second : m_minAcceptableRowHeight; -} - -void wxGrid::SetColMinimalAcceptableWidth( int width ) -{ - // We do allow a width of 0 since this gives us - // an easy way to temporarily hiding columns. - if ( width >= 0 ) - m_minAcceptableColWidth = width; -} - -void wxGrid::SetRowMinimalAcceptableHeight( int height ) -{ - // We do allow a height of 0 since this gives us - // an easy way to temporarily hiding rows. - if ( height >= 0 ) - m_minAcceptableRowHeight = height; -} - -int wxGrid::GetColMinimalAcceptableWidth() const -{ - return m_minAcceptableColWidth; -} - -int wxGrid::GetRowMinimalAcceptableHeight() const -{ - return m_minAcceptableRowHeight; -} - -// ---------------------------------------------------------------------------- -// auto sizing -// ---------------------------------------------------------------------------- - -void wxGrid::AutoSizeColOrRow( int colOrRow, bool setAsMin, bool column ) -{ - wxClientDC dc(m_gridWin); - - // cancel editing of cell - HideCellEditControl(); - SaveEditControlValue(); - - // init both of them to avoid compiler warnings, even if we only need one - int row = -1, - col = -1; - if ( column ) - col = colOrRow; - else - row = colOrRow; - - wxCoord extent, extentMax = 0; - int max = column ? m_numRows : m_numCols; - for ( int rowOrCol = 0; rowOrCol < max; rowOrCol++ ) - { - if ( column ) - row = rowOrCol; - else - col = rowOrCol; - - wxGridCellAttr *attr = GetCellAttr(row, col); - wxGridCellRenderer *renderer = attr->GetRenderer(this, row, col); - if ( renderer ) - { - wxSize size = renderer->GetBestSize(*this, *attr, dc, row, col); - extent = column ? size.x : size.y; - if ( extent > extentMax ) - extentMax = extent; - - renderer->DecRef(); - } - - attr->DecRef(); - } - - // now also compare with the column label extent - wxCoord w, h; - dc.SetFont( GetLabelFont() ); - - if ( column ) - { - dc.GetMultiLineTextExtent( GetColLabelValue(col), &w, &h ); - if ( GetColLabelTextOrientation() == wxVERTICAL ) - w = h; - } - else - dc.GetMultiLineTextExtent( GetRowLabelValue(row), &w, &h ); - - extent = column ? w : h; - if ( extent > extentMax ) - extentMax = extent; - - if ( !extentMax ) - { - // empty column - give default extent (notice that if extentMax is less - // than default extent but != 0, it's OK) - extentMax = column ? m_defaultColWidth : m_defaultRowHeight; - } - else - { - if ( column ) - // leave some space around text - extentMax += 10; - else - extentMax += 6; - } - - if ( column ) - { - // Ensure automatic width is not less than minimal width. See the - // comment in SetColSize() for explanation of why this isn't done - // in SetColSize(). - if ( !setAsMin ) - extentMax = wxMax(extentMax, GetColMinimalWidth(col)); - - SetColSize( col, extentMax ); - if ( !GetBatchCount() ) - { - int cw, ch, dummy; - m_gridWin->GetClientSize( &cw, &ch ); - wxRect rect ( CellToRect( 0, col ) ); - rect.y = 0; - CalcScrolledPosition(rect.x, 0, &rect.x, &dummy); - rect.width = cw - rect.x; - rect.height = m_colLabelHeight; - m_colLabelWin->Refresh( true, &rect ); - } - } - else - { - // Ensure automatic width is not less than minimal height. See the - // comment in SetColSize() for explanation of why this isn't done - // in SetRowSize(). - if ( !setAsMin ) - extentMax = wxMax(extentMax, GetRowMinimalHeight(row)); - - SetRowSize(row, extentMax); - if ( !GetBatchCount() ) - { - int cw, ch, dummy; - m_gridWin->GetClientSize( &cw, &ch ); - wxRect rect( CellToRect( row, 0 ) ); - rect.x = 0; - CalcScrolledPosition(0, rect.y, &dummy, &rect.y); - rect.width = m_rowLabelWidth; - rect.height = ch - rect.y; - m_rowLabelWin->Refresh( true, &rect ); - } - } - - if ( setAsMin ) - { - if ( column ) - SetColMinimalWidth(col, extentMax); - else - SetRowMinimalHeight(row, extentMax); - } -} - -wxCoord wxGrid::CalcColOrRowLabelAreaMinSize(bool column) -{ - // calculate size for the rows or columns? - const bool calcRows = !column; - - wxClientDC dc(calcRows ? GetGridRowLabelWindow() - : GetGridColLabelWindow()); - dc.SetFont(GetLabelFont()); - - // which dimension should we take into account for calculations? - // - // for columns, the text can be only horizontal so it's easy but for rows - // we also have to take into account the text orientation - const bool - useWidth = calcRows || (GetColLabelTextOrientation() == wxVERTICAL); - - wxArrayString lines; - wxCoord extentMax = 0; - - const int numRowsOrCols = calcRows ? m_numRows : m_numCols; - for ( int rowOrCol = 0; rowOrCol < numRowsOrCols; rowOrCol++ ) - { - lines.Clear(); - // NB: extra parentheses needed to avoid bcc 5.82 compilation errors - StringToLines((calcRows ? GetRowLabelValue(rowOrCol) - : GetColLabelValue(rowOrCol)), - lines); - - long w, h; - GetTextBoxSize(dc, lines, &w, &h); - - const wxCoord extent = useWidth ? w : h; - if ( extent > extentMax ) - extentMax = extent; - } - - if ( !extentMax ) - { - // empty column - give default extent (notice that if extentMax is less - // than default extent but != 0, it's OK) - extentMax = calcRows ? GetDefaultRowLabelSize() - : GetDefaultColLabelSize(); - } - - // leave some space around text (taken from AutoSizeColOrRow) - if ( calcRows ) - extentMax += 10; - else - extentMax += 6; - - return extentMax; -} - -int wxGrid::SetOrCalcColumnSizes(bool calcOnly, bool setAsMin) -{ - int width = m_rowLabelWidth; - - if ( !calcOnly ) - BeginBatch(); - - for ( int col = 0; col < m_numCols; col++ ) - { - if ( !calcOnly ) - AutoSizeColumn(col, setAsMin); - - width += GetColWidth(col); - } - - if ( !calcOnly ) - EndBatch(); - - return width; -} - -int wxGrid::SetOrCalcRowSizes(bool calcOnly, bool setAsMin) -{ - int height = m_colLabelHeight; - - if ( !calcOnly ) - BeginBatch(); - - for ( int row = 0; row < m_numRows; row++ ) - { - if ( !calcOnly ) - AutoSizeRow(row, setAsMin); - - height += GetRowHeight(row); - } - - if ( !calcOnly ) - EndBatch(); - - return height; -} - -void wxGrid::AutoSize() -{ - BeginBatch(); - - // we need to round up the size of the scrollable area to a multiple of - // scroll step to ensure that we don't get the scrollbars when we're sized - // exactly to fit our contents - wxSize size(SetOrCalcColumnSizes(false) - m_rowLabelWidth + m_extraWidth, - SetOrCalcRowSizes(false) - m_colLabelHeight + m_extraHeight); - wxSize sizeFit(GetScrollX(size.x) * GetScrollLineX(), - GetScrollY(size.y) * GetScrollLineY()); - - // distribute the extra space between the columns/rows to avoid having - // extra white space - wxCoord diff = sizeFit.x - size.x; - if ( diff && m_numCols ) - { - // try to resize the columns uniformly - wxCoord diffPerCol = diff / m_numCols; - if ( diffPerCol ) - { - for ( int col = 0; col < m_numCols; col++ ) - { - SetColSize(col, GetColWidth(col) + diffPerCol); - } - } - - // add remaining amount to the last columns - diff -= diffPerCol * m_numCols; - if ( diff ) - { - for ( int col = m_numCols - 1; col >= m_numCols - diff; col-- ) - { - SetColSize(col, GetColWidth(col) + 1); - } - } - } - - // same for rows - diff = sizeFit.y - size.y; - if ( diff && m_numRows ) - { - // try to resize the columns uniformly - wxCoord diffPerRow = diff / m_numRows; - if ( diffPerRow ) - { - for ( int row = 0; row < m_numRows; row++ ) - { - SetRowSize(row, GetRowHeight(row) + diffPerRow); - } - } - - // add remaining amount to the last rows - diff -= diffPerRow * m_numRows; - if ( diff ) - { - for ( int row = m_numRows - 1; row >= m_numRows - diff; row-- ) - { - SetRowSize(row, GetRowHeight(row) + 1); - } - } - } - - // we know that we're not going to have scrollbars so disable them now to - // avoid trouble in SetClientSize() which can otherwise set the correct - // client size but also leave space for (not needed any more) scrollbars - SetScrollbars(0, 0, 0, 0, 0, 0, true); - SetClientSize(sizeFit.x + m_rowLabelWidth, sizeFit.y + m_colLabelHeight); - - EndBatch(); -} - -void wxGrid::AutoSizeRowLabelSize( int row ) -{ - // Hide the edit control, so it - // won't interfere with drag-shrinking. - if ( IsCellEditControlShown() ) - { - HideCellEditControl(); - SaveEditControlValue(); - } - - // autosize row height depending on label text - SetRowSize(row, -1); - ForceRefresh(); -} - -void wxGrid::AutoSizeColLabelSize( int col ) -{ - // Hide the edit control, so it - // won't interfere with drag-shrinking. - if ( IsCellEditControlShown() ) - { - HideCellEditControl(); - SaveEditControlValue(); - } - - // autosize column width depending on label text - SetColSize(col, -1); - ForceRefresh(); -} - -wxSize wxGrid::DoGetBestSize() const -{ - wxGrid *self = (wxGrid *)this; // const_cast - - // we do the same as in AutoSize() here with the exception that we don't - // change the column/row sizes, only calculate them - wxSize size(self->SetOrCalcColumnSizes(true) - m_rowLabelWidth + m_extraWidth, - self->SetOrCalcRowSizes(true) - m_colLabelHeight + m_extraHeight); - wxSize sizeFit(GetScrollX(size.x) * GetScrollLineX(), - GetScrollY(size.y) * GetScrollLineY()); - - // NOTE: This size should be cached, but first we need to add calls to - // InvalidateBestSize everywhere that could change the results of this - // calculation. - // CacheBestSize(size); - - return wxSize(sizeFit.x + m_rowLabelWidth, sizeFit.y + m_colLabelHeight) - + GetWindowBorderSize(); -} - -void wxGrid::Fit() -{ - AutoSize(); -} - -wxPen& wxGrid::GetDividerPen() const -{ - return wxNullPen; -} - -// ---------------------------------------------------------------------------- -// cell value accessor functions -// ---------------------------------------------------------------------------- - -void wxGrid::SetCellValue( int row, int col, const wxString& s ) -{ - if ( m_table ) - { - m_table->SetValue( row, col, s ); - if ( !GetBatchCount() ) - { - int dummy; - wxRect rect( CellToRect( row, col ) ); - rect.x = 0; - rect.width = m_gridWin->GetClientSize().GetWidth(); - CalcScrolledPosition(0, rect.y, &dummy, &rect.y); - m_gridWin->Refresh( false, &rect ); - } - - if ( m_currentCellCoords.GetRow() == row && - m_currentCellCoords.GetCol() == col && - IsCellEditControlShown()) - // Note: If we are using IsCellEditControlEnabled, - // this interacts badly with calling SetCellValue from - // an EVT_GRID_CELL_CHANGE handler. - { - HideCellEditControl(); - ShowCellEditControl(); // will reread data from table - } - } -} - -// ---------------------------------------------------------------------------- -// block, row and column selection -// ---------------------------------------------------------------------------- - -void wxGrid::SelectRow( int row, bool addToSelected ) -{ - if ( IsSelection() && !addToSelected ) - ClearSelection(); - - if ( m_selection ) - m_selection->SelectRow( row, false, addToSelected ); -} - -void wxGrid::SelectCol( int col, bool addToSelected ) -{ - if ( IsSelection() && !addToSelected ) - ClearSelection(); - - if ( m_selection ) - m_selection->SelectCol( col, false, addToSelected ); -} - -void wxGrid::SelectBlock( int topRow, int leftCol, int bottomRow, int rightCol, - bool addToSelected ) -{ - if ( IsSelection() && !addToSelected ) - ClearSelection(); - - if ( m_selection ) - m_selection->SelectBlock( topRow, leftCol, bottomRow, rightCol, - false, addToSelected ); -} - -void wxGrid::SelectAll() -{ - if ( m_numRows > 0 && m_numCols > 0 ) - { - if ( m_selection ) - m_selection->SelectBlock( 0, 0, m_numRows - 1, m_numCols - 1 ); - } -} - -// ---------------------------------------------------------------------------- -// cell, row and col deselection -// ---------------------------------------------------------------------------- - -void wxGrid::DeselectRow( int row ) -{ - if ( !m_selection ) - return; - - if ( m_selection->GetSelectionMode() == wxGrid::wxGridSelectRows ) - { - if ( m_selection->IsInSelection(row, 0 ) ) - m_selection->ToggleCellSelection(row, 0); - } - else - { - int nCols = GetNumberCols(); - for ( int i = 0; i < nCols; i++ ) - { - if ( m_selection->IsInSelection(row, i ) ) - m_selection->ToggleCellSelection(row, i); - } - } -} - -void wxGrid::DeselectCol( int col ) -{ - if ( !m_selection ) - return; - - if ( m_selection->GetSelectionMode() == wxGrid::wxGridSelectColumns ) - { - if ( m_selection->IsInSelection(0, col ) ) - m_selection->ToggleCellSelection(0, col); - } - else - { - int nRows = GetNumberRows(); - for ( int i = 0; i < nRows; i++ ) - { - if ( m_selection->IsInSelection(i, col ) ) - m_selection->ToggleCellSelection(i, col); - } - } -} - -void wxGrid::DeselectCell( int row, int col ) -{ - if ( m_selection && m_selection->IsInSelection(row, col) ) - m_selection->ToggleCellSelection(row, col); -} - -bool wxGrid::IsSelection() -{ - return ( m_selection && (m_selection->IsSelection() || - ( m_selectingTopLeft != wxGridNoCellCoords && - m_selectingBottomRight != wxGridNoCellCoords) ) ); -} - -bool wxGrid::IsInSelection( int row, int col ) const -{ - return ( m_selection && (m_selection->IsInSelection( row, col ) || - ( row >= m_selectingTopLeft.GetRow() && - col >= m_selectingTopLeft.GetCol() && - row <= m_selectingBottomRight.GetRow() && - col <= m_selectingBottomRight.GetCol() )) ); -} - -wxGridCellCoordsArray wxGrid::GetSelectedCells() const -{ - if (!m_selection) - { - wxGridCellCoordsArray a; - return a; - } - - return m_selection->m_cellSelection; -} - -wxGridCellCoordsArray wxGrid::GetSelectionBlockTopLeft() const -{ - if (!m_selection) - { - wxGridCellCoordsArray a; - return a; - } - - return m_selection->m_blockSelectionTopLeft; -} - -wxGridCellCoordsArray wxGrid::GetSelectionBlockBottomRight() const -{ - if (!m_selection) - { - wxGridCellCoordsArray a; - return a; - } - - return m_selection->m_blockSelectionBottomRight; -} - -wxArrayInt wxGrid::GetSelectedRows() const -{ - if (!m_selection) - { - wxArrayInt a; - return a; - } - - return m_selection->m_rowSelection; -} - -wxArrayInt wxGrid::GetSelectedCols() const -{ - if (!m_selection) - { - wxArrayInt a; - return a; - } - - return m_selection->m_colSelection; -} - -void wxGrid::ClearSelection() -{ - wxRect r1 = BlockToDeviceRect( m_selectingTopLeft, m_selectingBottomRight); - wxRect r2 = BlockToDeviceRect( m_currentCellCoords, m_selectingKeyboard ); - m_selectingTopLeft = - m_selectingBottomRight = - m_selectingKeyboard = wxGridNoCellCoords; - Refresh( false, &r1 ); - Refresh( false, &r2 ); - if ( m_selection ) - m_selection->ClearSelection(); -} - -// This function returns the rectangle that encloses the given block -// in device coords clipped to the client size of the grid window. -// -wxRect wxGrid::BlockToDeviceRect( const wxGridCellCoords& topLeft, - const wxGridCellCoords& bottomRight ) -{ - wxRect resultRect; - wxRect tempCellRect = CellToRect(topLeft); - if ( tempCellRect != wxGridNoCellRect ) - { - resultRect = tempCellRect; - } - else - { - resultRect = wxRect(0, 0, 0, 0); - } - - tempCellRect = CellToRect(bottomRight); - if ( tempCellRect != wxGridNoCellRect ) - { - resultRect += tempCellRect; - } - else - { - // If both inputs were "wxGridNoCellRect," then there's nothing to do. - return wxGridNoCellRect; - } - - // Ensure that left/right and top/bottom pairs are in order. - int left = resultRect.GetLeft(); - int top = resultRect.GetTop(); - int right = resultRect.GetRight(); - int bottom = resultRect.GetBottom(); - - int leftCol = topLeft.GetCol(); - int topRow = topLeft.GetRow(); - int rightCol = bottomRight.GetCol(); - int bottomRow = bottomRight.GetRow(); - - if (left > right) - { - int tmp = left; - left = right; - right = tmp; - - tmp = leftCol; - leftCol = rightCol; - rightCol = tmp; - } - - if (top > bottom) - { - int tmp = top; - top = bottom; - bottom = tmp; - - tmp = topRow; - topRow = bottomRow; - bottomRow = tmp; - } - - // The following loop is ONLY necessary to detect and handle merged cells. - int cw, ch; - m_gridWin->GetClientSize( &cw, &ch ); - - // Get the origin coordinates: notice that they will be negative if the - // grid is scrolled downwards/to the right. - int gridOriginX = 0; - int gridOriginY = 0; - CalcScrolledPosition(gridOriginX, gridOriginY, &gridOriginX, &gridOriginY); - - int onScreenLeftmostCol = internalXToCol(-gridOriginX); - int onScreenUppermostRow = internalYToRow(-gridOriginY); - - int onScreenRightmostCol = internalXToCol(-gridOriginX + cw); - int onScreenBottommostRow = internalYToRow(-gridOriginY + ch); - - // Bound our loop so that we only examine the portion of the selected block - // that is shown on screen. Therefore, we compare the Top-Left block values - // to the Top-Left screen values, and the Bottom-Right block values to the - // Bottom-Right screen values, choosing appropriately. - const int visibleTopRow = wxMax(topRow, onScreenUppermostRow); - const int visibleBottomRow = wxMin(bottomRow, onScreenBottommostRow); - const int visibleLeftCol = wxMax(leftCol, onScreenLeftmostCol); - const int visibleRightCol = wxMin(rightCol, onScreenRightmostCol); - - for ( int j = visibleTopRow; j <= visibleBottomRow; j++ ) - { - for ( int i = visibleLeftCol; i <= visibleRightCol; i++ ) - { - if ( (j == visibleTopRow) || (j == visibleBottomRow) || - (i == visibleLeftCol) || (i == visibleRightCol) ) - { - tempCellRect = CellToRect( j, i ); - - if (tempCellRect.x < left) - left = tempCellRect.x; - if (tempCellRect.y < top) - top = tempCellRect.y; - if (tempCellRect.x + tempCellRect.width > right) - right = tempCellRect.x + tempCellRect.width; - if (tempCellRect.y + tempCellRect.height > bottom) - bottom = tempCellRect.y + tempCellRect.height; - } - else - { - i = visibleRightCol; // jump over inner cells. - } - } - } - - // Convert to scrolled coords - CalcScrolledPosition( left, top, &left, &top ); - CalcScrolledPosition( right, bottom, &right, &bottom ); - - if (right < 0 || bottom < 0 || left > cw || top > ch) - return wxRect(0,0,0,0); - - resultRect.SetLeft( wxMax(0, left) ); - resultRect.SetTop( wxMax(0, top) ); - resultRect.SetRight( wxMin(cw, right) ); - resultRect.SetBottom( wxMin(ch, bottom) ); - - return resultRect; -} - -// ---------------------------------------------------------------------------- -// grid event classes -// ---------------------------------------------------------------------------- - -IMPLEMENT_DYNAMIC_CLASS( wxGridEvent, wxNotifyEvent ) - -wxGridEvent::wxGridEvent( int id, wxEventType type, wxObject* obj, - int row, int col, int x, int y, bool sel, - bool control, bool shift, bool alt, bool meta ) - : wxNotifyEvent( type, id ) -{ - m_row = row; - m_col = col; - m_x = x; - m_y = y; - m_selecting = sel; - m_control = control; - m_shift = shift; - m_alt = alt; - m_meta = meta; - - SetEventObject(obj); -} - - -IMPLEMENT_DYNAMIC_CLASS( wxGridSizeEvent, wxNotifyEvent ) - -wxGridSizeEvent::wxGridSizeEvent( int id, wxEventType type, wxObject* obj, - int rowOrCol, int x, int y, - bool control, bool shift, bool alt, bool meta ) - : wxNotifyEvent( type, id ) -{ - m_rowOrCol = rowOrCol; - m_x = x; - m_y = y; - m_control = control; - m_shift = shift; - m_alt = alt; - m_meta = meta; - - SetEventObject(obj); -} - - -IMPLEMENT_DYNAMIC_CLASS( wxGridRangeSelectEvent, wxNotifyEvent ) - -wxGridRangeSelectEvent::wxGridRangeSelectEvent(int id, wxEventType type, wxObject* obj, - const wxGridCellCoords& topLeft, - const wxGridCellCoords& bottomRight, - bool sel, bool control, - bool shift, bool alt, bool meta ) - : wxNotifyEvent( type, id ) -{ - m_topLeft = topLeft; - m_bottomRight = bottomRight; - m_selecting = sel; - m_control = control; - m_shift = shift; - m_alt = alt; - m_meta = meta; - - SetEventObject(obj); -} - - -IMPLEMENT_DYNAMIC_CLASS(wxGridEditorCreatedEvent, wxCommandEvent) - -wxGridEditorCreatedEvent::wxGridEditorCreatedEvent(int id, wxEventType type, - wxObject* obj, int row, - int col, wxControl* ctrl) - : wxCommandEvent(type, id) -{ - SetEventObject(obj); - m_row = row; - m_col = col; - m_ctrl = ctrl; -} - -#endif // wxUSE_GRID diff --git a/wxWidgets/src/generic/gridctrl.cpp b/wxWidgets/src/generic/gridctrl.cpp deleted file mode 100644 index 9af7ad8d65..0000000000 --- a/wxWidgets/src/generic/gridctrl.cpp +++ /dev/null @@ -1,418 +0,0 @@ -/////////////////////////////////////////////////////////////////////////// -// Name: generic/gridctrl.cpp -// Purpose: wxGrid controls -// Author: Paul Gammans, Roger Gammans -// Modified by: -// Created: 11/04/2001 -// RCS-ID: $Id: gridctrl.cpp 59121 2009-02-25 00:09:23Z VZ $ -// Copyright: (c) The Computer Surgery (paul@compsurg.co.uk) -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_GRID - -#include "wx/generic/gridctrl.h" - -#ifndef WX_PRECOMP - #include "wx/textctrl.h" - #include "wx/dc.h" - #include "wx/combobox.h" -#endif // WX_PRECOMP - -#include "wx/tokenzr.h" - -// ---------------------------------------------------------------------------- -// wxGridCellDateTimeRenderer -// ---------------------------------------------------------------------------- - -#if wxUSE_DATETIME - -// Enables a grid cell to display a formatted date and or time - -wxGridCellDateTimeRenderer::wxGridCellDateTimeRenderer(const wxString& outformat, const wxString& informat) -{ - m_iformat = informat; - m_oformat = outformat; - m_tz = wxDateTime::Local; - m_dateDef = wxDefaultDateTime; -} - -wxGridCellRenderer *wxGridCellDateTimeRenderer::Clone() const -{ - wxGridCellDateTimeRenderer *renderer = new wxGridCellDateTimeRenderer; - renderer->m_iformat = m_iformat; - renderer->m_oformat = m_oformat; - renderer->m_dateDef = m_dateDef; - renderer->m_tz = m_tz; - - return renderer; -} - -wxString wxGridCellDateTimeRenderer::GetString(const wxGrid& grid, int row, int col) -{ - wxGridTableBase *table = grid.GetTable(); - - bool hasDatetime = false; - wxDateTime val; - wxString text; - if ( table->CanGetValueAs(row, col, wxGRID_VALUE_DATETIME) ) - { - void * tempval = table->GetValueAsCustom(row, col,wxGRID_VALUE_DATETIME); - - if (tempval){ - val = *((wxDateTime *)tempval); - hasDatetime = true; - delete (wxDateTime *)tempval; - } - - } - - if (!hasDatetime ) - { - text = table->GetValue(row, col); - hasDatetime = (val.ParseFormat( text, m_iformat, m_dateDef ) != (wxChar *)NULL) ; - } - - if ( hasDatetime ) - text = val.Format(m_oformat, m_tz ); - - //If we faild to parse string just show what we where given? - return text; -} - -void wxGridCellDateTimeRenderer::Draw(wxGrid& grid, - wxGridCellAttr& attr, - wxDC& dc, - const wxRect& rectCell, - int row, int col, - bool isSelected) -{ - wxGridCellRenderer::Draw(grid, attr, dc, rectCell, row, col, isSelected); - - SetTextColoursAndFont(grid, attr, dc, isSelected); - - // draw the text right aligned by default - int hAlign, vAlign; - attr.GetAlignment(&hAlign, &vAlign); - hAlign = wxRIGHT; - - wxRect rect = rectCell; - rect.Inflate(-1); - - grid.DrawTextRectangle(dc, GetString(grid, row, col), rect, hAlign, vAlign); -} - -wxSize wxGridCellDateTimeRenderer::GetBestSize(wxGrid& grid, - wxGridCellAttr& attr, - wxDC& dc, - int row, int col) -{ - return DoGetBestSize(attr, dc, GetString(grid, row, col)); -} - -void wxGridCellDateTimeRenderer::SetParameters(const wxString& params) -{ - if (!params.empty()) - m_oformat=params; -} - -#endif // wxUSE_DATETIME - -// ---------------------------------------------------------------------------- -// wxGridCellChoiceNumberRenderer -// ---------------------------------------------------------------------------- -// Renders a number as a textual equivalent. -// eg data in cell is 0,1,2 ... n the cell could be rendered as "John","Fred"..."Bob" - - -wxGridCellEnumRenderer::wxGridCellEnumRenderer(const wxString& choices) -{ - if (!choices.empty()) - SetParameters(choices); -} - -wxGridCellRenderer *wxGridCellEnumRenderer::Clone() const -{ - wxGridCellEnumRenderer *renderer = new wxGridCellEnumRenderer; - renderer->m_choices = m_choices; - return renderer; -} - -wxString wxGridCellEnumRenderer::GetString(const wxGrid& grid, int row, int col) -{ - wxGridTableBase *table = grid.GetTable(); - wxString text; - if ( table->CanGetValueAs(row, col, wxGRID_VALUE_NUMBER) ) - { - int choiceno = table->GetValueAsLong(row, col); - text.Printf(_T("%s"), m_choices[ choiceno ].c_str() ); - } - else - { - text = table->GetValue(row, col); - } - - - //If we faild to parse string just show what we where given? - return text; -} - -void wxGridCellEnumRenderer::Draw(wxGrid& grid, - wxGridCellAttr& attr, - wxDC& dc, - const wxRect& rectCell, - int row, int col, - bool isSelected) -{ - wxGridCellRenderer::Draw(grid, attr, dc, rectCell, row, col, isSelected); - - SetTextColoursAndFont(grid, attr, dc, isSelected); - - // draw the text right aligned by default - int hAlign, vAlign; - attr.GetAlignment(&hAlign, &vAlign); - hAlign = wxRIGHT; - - wxRect rect = rectCell; - rect.Inflate(-1); - - grid.DrawTextRectangle(dc, GetString(grid, row, col), rect, hAlign, vAlign); -} - -wxSize wxGridCellEnumRenderer::GetBestSize(wxGrid& grid, - wxGridCellAttr& attr, - wxDC& dc, - int row, int col) -{ - return DoGetBestSize(attr, dc, GetString(grid, row, col)); -} - -void wxGridCellEnumRenderer::SetParameters(const wxString& params) -{ - if ( !params ) - { - // what can we do? - return; - } - - m_choices.Empty(); - - wxStringTokenizer tk(params, _T(',')); - while ( tk.HasMoreTokens() ) - { - m_choices.Add(tk.GetNextToken()); - } -} - -#if wxUSE_COMBOBOX - -// ---------------------------------------------------------------------------- -// wxGridCellEnumEditor -// ---------------------------------------------------------------------------- - -// A cell editor which displays an enum number as a textual equivalent. eg -// data in cell is 0,1,2 ... n the cell could be displayed as -// "John","Fred"..."Bob" in the combo choice box - -wxGridCellEnumEditor::wxGridCellEnumEditor(const wxString& choices) - :wxGridCellChoiceEditor() -{ - m_startint = -1; - - if (!choices.empty()) - SetParameters(choices); -} - -wxGridCellEditor *wxGridCellEnumEditor::Clone() const -{ - wxGridCellEnumEditor *editor = new wxGridCellEnumEditor(); - editor->m_startint = m_startint; - return editor; -} - -void wxGridCellEnumEditor::BeginEdit(int row, int col, wxGrid* grid) -{ - wxASSERT_MSG(m_control, - wxT("The wxGridCellEnumEditor must be Created first!")); - - wxGridTableBase *table = grid->GetTable(); - - if ( table->CanGetValueAs(row, col, wxGRID_VALUE_NUMBER) ) - { - m_startint = table->GetValueAsLong(row, col); - } - else - { - wxString startValue = table->GetValue(row, col); - if (startValue.IsNumber() && !startValue.empty()) - { - startValue.ToLong(&m_startint); - } - else - { - m_startint=-1; - } - } - - Combo()->SetSelection(m_startint); - Combo()->SetInsertionPointEnd(); - Combo()->SetFocus(); - -} - -bool wxGridCellEnumEditor::EndEdit(int row, int col, wxGrid* grid) -{ - int pos = Combo()->GetSelection(); - bool changed = (pos != m_startint); - if (changed) - { - if (grid->GetTable()->CanSetValueAs(row, col, wxGRID_VALUE_NUMBER)) - grid->GetTable()->SetValueAsLong(row, col, pos); - else - grid->GetTable()->SetValue(row, col,wxString::Format(wxT("%i"),pos)); - } - - return changed; -} - -#endif // wxUSE_COMBOBOX - -// ---------------------------------------------------------------------------- -// wxGridCellAutoWrapStringEditor -// ---------------------------------------------------------------------------- - -void -wxGridCellAutoWrapStringEditor::Create(wxWindow* parent, - wxWindowID id, - wxEvtHandler* evtHandler) -{ - m_control = new wxTextCtrl(parent, id, wxEmptyString, - wxDefaultPosition, wxDefaultSize, - wxTE_MULTILINE | wxTE_RICH); - - - wxGridCellEditor::Create(parent, id, evtHandler); -} - -void -wxGridCellAutoWrapStringRenderer::Draw(wxGrid& grid, - wxGridCellAttr& attr, - wxDC& dc, - const wxRect& rectCell, - int row, int col, - bool isSelected) { - - - wxGridCellRenderer::Draw(grid, attr, dc, rectCell, row, col, isSelected); - - // now we only have to draw the text - SetTextColoursAndFont(grid, attr, dc, isSelected); - - int horizAlign, vertAlign; - attr.GetAlignment(&horizAlign, &vertAlign); - - wxRect rect = rectCell; - rect.Inflate(-1); - - grid.DrawTextRectangle(dc, GetTextLines(grid,dc,attr,rect,row,col), - rect, horizAlign, vertAlign); -} - - -wxArrayString -wxGridCellAutoWrapStringRenderer::GetTextLines(wxGrid& grid, - wxDC& dc, - const wxGridCellAttr& attr, - const wxRect& rect, - int row, int col) -{ - wxString data = grid.GetCellValue(row, col); - - wxArrayString lines; - dc.SetFont(attr.GetFont()); - - //Taken from wxGrid again! - wxCoord x = 0, y = 0, curr_x = 0; - wxCoord max_x = rect.GetWidth(); - - dc.SetFont(attr.GetFont()); - wxStringTokenizer tk(data , _T(" \n\t\r")); - wxString thisline = wxEmptyString; - - while ( tk.HasMoreTokens() ) - { - wxString tok = tk.GetNextToken(); - //FIXME: this causes us to print an extra unnecesary - // space at the end of the line. But it - // is invisible , simplifies the size calculation - // and ensures tokens are separated in the display - tok += _T(" "); - - dc.GetTextExtent(tok, &x, &y); - if ( curr_x + x > max_x) - { - if ( curr_x == 0 ) - { - // this means that a single token is wider than the maximal - // width -- still use it as is as we need to show at least the - // part of it which fits - lines.Add(tok); - } - else - { - lines.Add(thisline); - thisline = tok; - curr_x = x; - } - } - else - { - thisline+= tok; - curr_x += x; - } - } - //Add last line - lines.Add( wxString(thisline) ); - - return lines; -} - - -wxSize -wxGridCellAutoWrapStringRenderer::GetBestSize(wxGrid& grid, - wxGridCellAttr& attr, - wxDC& dc, - int row, int col) -{ - wxCoord x,y, height , width = grid.GetColSize(col) -20; - // for width, subtract 20 because ColSize includes a magin of 10 pixels - // that we do not want here and because we always start with an increment - // by 10 in the loop below. - int count = 250; //Limit iterations.. - - wxRect rect(0,0,width,10); - - // M is a nice large character 'y' gives descender!. - dc.GetTextExtent(wxT("My"), &x, &y); - - do - { - width+=10; - rect.SetWidth(width); - height = y * (wx_truncate_cast(wxCoord, GetTextLines(grid,dc,attr,rect,row,col).GetCount())); - count--; - // Search for a shape no taller than the golden ratio. - } while (count && (width < (height*1.68)) ); - - - return wxSize(width,height); -} - -#endif // wxUSE_GRID - diff --git a/wxWidgets/src/generic/gridsel.cpp b/wxWidgets/src/generic/gridsel.cpp deleted file mode 100644 index 13ee80a6c7..0000000000 --- a/wxWidgets/src/generic/gridsel.cpp +++ /dev/null @@ -1,1177 +0,0 @@ -/////////////////////////////////////////////////////////////////////////// -// Name: src/generic/gridsel.cpp -// Purpose: wxGridSelection -// Author: Stefan Neis -// Modified by: -// Created: 20/02/1999 -// RCS-ID: $Id: gridsel.cpp 38788 2006-04-18 08:11:26Z ABX $ -// Copyright: (c) Stefan Neis (Stefan.Neis@t-online.de) -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// For compilers that support precompilation, includes "wx/wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -#if wxUSE_GRID - -#include "wx/generic/gridsel.h" - - -// Some explanation for the members of the class: -// m_cellSelection stores individual selected cells -// -- this is only used if m_selectionMode == wxGridSelectCells -// m_blockSelectionTopLeft and m_blockSelectionBottomRight -// store the upper left and lower right corner of selected Blocks -// m_rowSelection and m_colSelection store individual selected -// rows and columns; maybe those are superfluous and should be -// treated as blocks? - -wxGridSelection::wxGridSelection( wxGrid * grid, - wxGrid::wxGridSelectionModes sel ) -{ - m_grid = grid; - m_selectionMode = sel; -} - -bool wxGridSelection::IsSelection() -{ - return ( m_cellSelection.GetCount() || m_blockSelectionTopLeft.GetCount() || - m_rowSelection.GetCount() || m_colSelection.GetCount() ); -} - -bool wxGridSelection::IsInSelection( int row, int col ) -{ - size_t count; - - // First check whether the given cell is individually selected - // (if m_selectionMode is wxGridSelectCells). - if ( m_selectionMode == wxGrid::wxGridSelectCells ) - { - count = m_cellSelection.GetCount(); - for ( size_t n = 0; n < count; n++ ) - { - wxGridCellCoords& coords = m_cellSelection[n]; - if ( row == coords.GetRow() && col == coords.GetCol() ) - return true; - } - } - - // Now check whether the given cell is - // contained in one of the selected blocks. - count = m_blockSelectionTopLeft.GetCount(); - for ( size_t n = 0; n < count; n++ ) - { - wxGridCellCoords& coords1 = m_blockSelectionTopLeft[n]; - wxGridCellCoords& coords2 = m_blockSelectionBottomRight[n]; - if ( BlockContainsCell(coords1.GetRow(), coords1.GetCol(), - coords2.GetRow(), coords2.GetCol(), - row, col ) ) - return true; - } - - // Now check whether the given cell is - // contained in one of the selected rows - // (unless we are in column selection mode). - if ( m_selectionMode != wxGrid::wxGridSelectColumns ) - { - count = m_rowSelection.GetCount(); - for ( size_t n = 0; n < count; n++ ) - { - if ( row == m_rowSelection[n] ) - return true; - } - } - - // Now check whether the given cell is - // contained in one of the selected columns - // (unless we are in row selection mode). - if ( m_selectionMode != wxGrid::wxGridSelectRows ) - { - count = m_colSelection.GetCount(); - for ( size_t n = 0; n < count; n++ ) - { - if ( col == m_colSelection[n] ) - return true; - } - } - - return false; -} - -// Change the selection mode -void wxGridSelection::SetSelectionMode( wxGrid::wxGridSelectionModes selmode ) -{ - // if selection mode is unchanged return immediately - if (selmode == m_selectionMode) - return; - - if ( m_selectionMode != wxGrid::wxGridSelectCells ) - { - // if changing form row to column selection - // or vice versa, clear the selection. - if ( selmode != wxGrid::wxGridSelectCells ) - ClearSelection(); - - m_selectionMode = selmode; - } - else - { - // if changing from cell selection to something else, - // promote selected cells/blocks to whole rows/columns. - size_t n; - while ( ( n = m_cellSelection.GetCount() ) > 0 ) - { - n--; - wxGridCellCoords& coords = m_cellSelection[n]; - int row = coords.GetRow(); - int col = coords.GetCol(); - m_cellSelection.RemoveAt(n); - if (selmode == wxGrid::wxGridSelectRows) - SelectRow( row ); - else // selmode == wxGridSelectColumns) - SelectCol( col ); - } - - // Note that m_blockSelectionTopLeft's size may be changing! - for (n = 0; n < m_blockSelectionTopLeft.GetCount(); n++) - { - wxGridCellCoords& coords = m_blockSelectionTopLeft[n]; - int topRow = coords.GetRow(); - int leftCol = coords.GetCol(); - coords = m_blockSelectionBottomRight[n]; - int bottomRow = coords.GetRow(); - int rightCol = coords.GetCol(); - - if (selmode == wxGrid::wxGridSelectRows) - { - if (leftCol != 0 || rightCol != m_grid->GetNumberCols() - 1 ) - { - m_blockSelectionTopLeft.RemoveAt(n); - m_blockSelectionBottomRight.RemoveAt(n); - SelectBlock( topRow, 0, - bottomRow, m_grid->GetNumberCols() - 1, - false, false, false, false, false ); - } - } - else // selmode == wxGridSelectColumns) - { - if (topRow != 0 || bottomRow != m_grid->GetNumberRows() - 1 ) - { - m_blockSelectionTopLeft.RemoveAt(n); - m_blockSelectionBottomRight.RemoveAt(n); - SelectBlock( 0, leftCol, - m_grid->GetNumberRows() - 1, rightCol, - false, false, false, false, false ); - } - } - } - - m_selectionMode = selmode; - } -} - -void wxGridSelection::SelectRow( int row, - bool ControlDown, bool ShiftDown, - bool AltDown, bool MetaDown ) -{ - if ( m_selectionMode == wxGrid::wxGridSelectColumns ) - return; - - size_t count, n; - - // Remove single cells contained in newly selected block. - if ( m_selectionMode == wxGrid::wxGridSelectCells ) - { - count = m_cellSelection.GetCount(); - for ( n = 0; n < count; n++ ) - { - wxGridCellCoords& coords = m_cellSelection[n]; - if ( BlockContainsCell( row, 0, row, m_grid->GetNumberCols() - 1, - coords.GetRow(), coords.GetCol() ) ) - { - m_cellSelection.RemoveAt(n); - n--; - count--; - } - } - } - - // Simplify list of selected blocks (if possible) - count = m_blockSelectionTopLeft.GetCount(); - bool done = false; - - for ( n = 0; n < count; n++ ) - { - wxGridCellCoords& coords1 = m_blockSelectionTopLeft[n]; - wxGridCellCoords& coords2 = m_blockSelectionBottomRight[n]; - - // Remove block if it is a subset of the row - if ( coords1.GetRow() == row && row == coords2.GetRow() ) - { - m_blockSelectionTopLeft.RemoveAt(n); - m_blockSelectionBottomRight.RemoveAt(n); - n--; - count--; - } - else if ( coords1.GetCol() == 0 && - coords2.GetCol() == m_grid->GetNumberCols() - 1 ) - { - // silently return, if row is contained in block - if ( coords1.GetRow() <= row && row <= coords2.GetRow() ) - return; - // expand block, if it touched row - else if ( coords1.GetRow() == row + 1) - { - coords1.SetRow(row); - done = true; - } - else if ( coords2.GetRow() == row - 1) - { - coords2.SetRow(row); - done = true; - } - } - } - - // Unless we successfully handled the row, - // check whether row is already selected. - if ( !done ) - { - count = m_rowSelection.GetCount(); - for ( n = 0; n < count; n++ ) - { - if ( row == m_rowSelection[n] ) - return; - } - - // Add row to selection - m_rowSelection.Add(row); - } - - // Update View: - if ( !m_grid->GetBatchCount() ) - { - wxRect r = m_grid->BlockToDeviceRect( wxGridCellCoords( row, 0 ), - wxGridCellCoords( row, m_grid->GetNumberCols() - 1 ) ); - ((wxWindow *)m_grid->m_gridWin)->Refresh( false, &r ); - } - - // Send Event - wxGridRangeSelectEvent gridEvt( m_grid->GetId(), - wxEVT_GRID_RANGE_SELECT, - m_grid, - wxGridCellCoords( row, 0 ), - wxGridCellCoords( row, m_grid->GetNumberCols() - 1 ), - true, - ControlDown, ShiftDown, - AltDown, MetaDown ); - - m_grid->GetEventHandler()->ProcessEvent( gridEvt ); -} - -void wxGridSelection::SelectCol( int col, - bool ControlDown, bool ShiftDown, - bool AltDown, bool MetaDown ) -{ - if ( m_selectionMode == wxGrid::wxGridSelectRows ) - return; - size_t count, n; - - // Remove single cells contained in newly selected block. - if ( m_selectionMode == wxGrid::wxGridSelectCells ) - { - count = m_cellSelection.GetCount(); - for ( n = 0; n < count; n++ ) - { - wxGridCellCoords& coords = m_cellSelection[n]; - if ( BlockContainsCell( 0, col, m_grid->GetNumberRows() - 1, col, - coords.GetRow(), coords.GetCol() ) ) - { - m_cellSelection.RemoveAt(n); - n--; - count--; - } - } - } - - // Simplify list of selected blocks (if possible) - count = m_blockSelectionTopLeft.GetCount(); - bool done = false; - for ( n = 0; n < count; n++ ) - { - wxGridCellCoords& coords1 = m_blockSelectionTopLeft[n]; - wxGridCellCoords& coords2 = m_blockSelectionBottomRight[n]; - - // Remove block if it is a subset of the column - if ( coords1.GetCol() == col && col == coords2.GetCol() ) - { - m_blockSelectionTopLeft.RemoveAt(n); - m_blockSelectionBottomRight.RemoveAt(n); - n--; - count--; - } - else if ( coords1.GetRow() == 0 && - coords2.GetRow() == m_grid->GetNumberRows() - 1 ) - { - // silently return, if row is contained in block - if ( coords1.GetCol() <= col && col <= coords2.GetCol() ) - return; - // expand block, if it touched col - else if ( coords1.GetCol() == col + 1) - { - coords1.SetCol(col); - done = true; - } - else if ( coords2.GetCol() == col - 1) - { - coords2.SetCol(col); - done = true; - } - } - } - - // Unless we successfully handled the column, - // Check whether col is already selected. - if ( !done ) - { - count = m_colSelection.GetCount(); - for ( n = 0; n < count; n++ ) - { - if ( col == m_colSelection[n] ) - return; - } - - // Add col to selection - m_colSelection.Add(col); - } - - // Update View: - if ( !m_grid->GetBatchCount() ) - { - wxRect r = m_grid->BlockToDeviceRect( wxGridCellCoords( 0, col ), - wxGridCellCoords( m_grid->GetNumberRows() - 1, col ) ); - ((wxWindow *)m_grid->m_gridWin)->Refresh( false, &r ); - } - - // Send Event - wxGridRangeSelectEvent gridEvt( m_grid->GetId(), - wxEVT_GRID_RANGE_SELECT, - m_grid, - wxGridCellCoords( 0, col ), - wxGridCellCoords( m_grid->GetNumberRows() - 1, col ), - true, - ControlDown, ShiftDown, - AltDown, MetaDown ); - - m_grid->GetEventHandler()->ProcessEvent( gridEvt ); -} - -void wxGridSelection::SelectBlock( int topRow, int leftCol, - int bottomRow, int rightCol, - bool ControlDown, bool ShiftDown, - bool AltDown, bool MetaDown, - bool sendEvent ) -{ - // Fix the coordinates of the block if needed. - if ( m_selectionMode == wxGrid::wxGridSelectRows ) - { - leftCol = 0; - rightCol = m_grid->GetNumberCols() - 1; - } - else if ( m_selectionMode == wxGrid::wxGridSelectColumns ) - { - topRow = 0; - bottomRow = m_grid->GetNumberRows() - 1; - } - - if ( topRow > bottomRow ) - { - int temp = topRow; - topRow = bottomRow; - bottomRow = temp; - } - - if ( leftCol > rightCol ) - { - int temp = leftCol; - leftCol = rightCol; - rightCol = temp; - } - - // Handle single cell selection in SelectCell. - // (MB: added check for selection mode here to prevent - // crashes if, for example, we are select rows and the - // grid only has 1 col) - if ( m_selectionMode == wxGrid::wxGridSelectCells && - topRow == bottomRow && leftCol == rightCol ) - { - SelectCell( topRow, leftCol, ControlDown, ShiftDown, - AltDown, MetaDown, sendEvent ); - } - - size_t count, n; - - // Remove single cells contained in newly selected block. - if ( m_selectionMode == wxGrid::wxGridSelectCells ) - { - count = m_cellSelection.GetCount(); - for ( n = 0; n < count; n++ ) - { - wxGridCellCoords& coords = m_cellSelection[n]; - if ( BlockContainsCell( topRow, leftCol, bottomRow, rightCol, - coords.GetRow(), coords.GetCol() ) ) - { - m_cellSelection.RemoveAt(n); - n--; - count--; - } - } - } - - // If a block containing the selection is already selected, return, - // if a block contained in the selection is found, remove it. - - count = m_blockSelectionTopLeft.GetCount(); - for ( n = 0; n < count; n++ ) - { - wxGridCellCoords& coords1 = m_blockSelectionTopLeft[n]; - wxGridCellCoords& coords2 = m_blockSelectionBottomRight[n]; - - switch ( BlockContain( coords1.GetRow(), coords1.GetCol(), - coords2.GetRow(), coords2.GetCol(), - topRow, leftCol, bottomRow, rightCol ) ) - { - case 1: - return; - - case -1: - m_blockSelectionTopLeft.RemoveAt(n); - m_blockSelectionBottomRight.RemoveAt(n); - n--; - count--; - break; - - default: - break; - } - } - - // If a row containing the selection is already selected, return, - // if a row contained in newly selected block is found, remove it. - if ( m_selectionMode != wxGrid::wxGridSelectColumns ) - { - count = m_rowSelection.GetCount(); - for ( n = 0; n < count; n++ ) - { - switch ( BlockContain( m_rowSelection[n], 0, - m_rowSelection[n], m_grid->GetNumberCols() - 1, - topRow, leftCol, bottomRow, rightCol ) ) - { - case 1: - return; - - case -1: - m_rowSelection.RemoveAt(n); - n--; - count--; - break; - - default: - break; - } - } - } - - if ( m_selectionMode != wxGrid::wxGridSelectRows ) - { - count = m_colSelection.GetCount(); - for ( n = 0; n < count; n++ ) - { - switch ( BlockContain( 0, m_colSelection[n], - m_grid->GetNumberRows() - 1, m_colSelection[n], - topRow, leftCol, bottomRow, rightCol ) ) - { - case 1: - return; - - case -1: - m_colSelection.RemoveAt(n); - n--; - count--; - break; - - default: - break; - } - } - } - - m_blockSelectionTopLeft.Add( wxGridCellCoords( topRow, leftCol ) ); - m_blockSelectionBottomRight.Add( wxGridCellCoords( bottomRow, rightCol ) ); - - // Update View: - if ( !m_grid->GetBatchCount() ) - { - wxRect r = m_grid->BlockToDeviceRect( wxGridCellCoords( topRow, leftCol ), - wxGridCellCoords( bottomRow, rightCol ) ); - ((wxWindow *)m_grid->m_gridWin)->Refresh( false, &r ); - } - - // Send Event, if not disabled. - if ( sendEvent ) - { - wxGridRangeSelectEvent gridEvt( m_grid->GetId(), - wxEVT_GRID_RANGE_SELECT, - m_grid, - wxGridCellCoords( topRow, leftCol ), - wxGridCellCoords( bottomRow, rightCol ), - true, - ControlDown, ShiftDown, - AltDown, MetaDown ); - m_grid->GetEventHandler()->ProcessEvent( gridEvt ); - } -} - -void wxGridSelection::SelectCell( int row, int col, - bool ControlDown, bool ShiftDown, - bool AltDown, bool MetaDown, - bool sendEvent ) -{ - if ( m_selectionMode == wxGrid::wxGridSelectRows ) - { - SelectBlock(row, 0, row, m_grid->GetNumberCols() - 1, - ControlDown, ShiftDown, AltDown, MetaDown, sendEvent); - - return; - } - else if ( m_selectionMode == wxGrid::wxGridSelectColumns ) - { - SelectBlock(0, col, m_grid->GetNumberRows() - 1, col, - ControlDown, ShiftDown, AltDown, MetaDown, sendEvent); - - return; - } - else if ( IsInSelection ( row, col ) ) - return; - - m_cellSelection.Add( wxGridCellCoords( row, col ) ); - - // Update View: - if ( !m_grid->GetBatchCount() ) - { - wxRect r = m_grid->BlockToDeviceRect( - wxGridCellCoords( row, col ), - wxGridCellCoords( row, col ) ); - ((wxWindow *)m_grid->m_gridWin)->Refresh( false, &r ); - } - - // Send event - if (sendEvent) - { - wxGridRangeSelectEvent gridEvt( m_grid->GetId(), - wxEVT_GRID_RANGE_SELECT, - m_grid, - wxGridCellCoords( row, col ), - wxGridCellCoords( row, col ), - true, - ControlDown, ShiftDown, - AltDown, MetaDown ); - m_grid->GetEventHandler()->ProcessEvent( gridEvt ); - } -} - -void wxGridSelection::ToggleCellSelection( int row, int col, - bool ControlDown, bool ShiftDown, - bool AltDown, bool MetaDown ) -{ - // if the cell is not selected, select it - if ( !IsInSelection ( row, col ) ) - { - SelectCell( row, col, ControlDown, ShiftDown, AltDown, MetaDown ); - - return; - } - - // otherwise deselect it. This can be simple or more or - // less difficult, depending on how the cell is selected. - size_t count, n; - - // The simplest case: The cell is contained in m_cellSelection - // Then it can't be contained in rows/cols/block (since those - // would remove the cell from m_cellSelection on creation), so - // we just have to remove it from m_cellSelection. - - if ( m_selectionMode == wxGrid::wxGridSelectCells ) - { - count = m_cellSelection.GetCount(); - for ( n = 0; n < count; n++ ) - { - const wxGridCellCoords& sel = m_cellSelection[n]; - if ( row == sel.GetRow() && col == sel.GetCol() ) - { - wxGridCellCoords coords = m_cellSelection[n]; - m_cellSelection.RemoveAt(n); - if ( !m_grid->GetBatchCount() ) - { - wxRect r = m_grid->BlockToDeviceRect( coords, coords ); - ((wxWindow *)m_grid->m_gridWin)->Refresh( false, &r ); - } - - // Send event - wxGridRangeSelectEvent gridEvt( m_grid->GetId(), - wxEVT_GRID_RANGE_SELECT, - m_grid, - wxGridCellCoords( row, col ), - wxGridCellCoords( row, col ), - false, - ControlDown, ShiftDown, - AltDown, MetaDown ); - m_grid->GetEventHandler()->ProcessEvent( gridEvt ); - - return; - } - } - } - - // The most difficult case: The cell is member of one or even several - // blocks. Split each such block in up to 4 new parts, that don't - // contain the cell to be selected, like this: - // |---------------------------| - // | | - // | part 1 | - // | | - // |---------------------------| - // | part 3 |x| part 4 | - // |---------------------------| - // | | - // | part 2 | - // | | - // |---------------------------| - // (The x marks the newly deselected cell). - // Note: in row selection mode, we only need part1 and part2; - // in column selection mode, we only need part 3 and part4, - // which are expanded to whole columns automatically! - - count = m_blockSelectionTopLeft.GetCount(); - for ( n = 0; n < count; n++ ) - { - wxGridCellCoords& coords1 = m_blockSelectionTopLeft[n]; - wxGridCellCoords& coords2 = m_blockSelectionBottomRight[n]; - int topRow = coords1.GetRow(); - int leftCol = coords1.GetCol(); - int bottomRow = coords2.GetRow(); - int rightCol = coords2.GetCol(); - - if ( BlockContainsCell( topRow, leftCol, bottomRow, rightCol, row, col ) ) - { - // remove the block - m_blockSelectionTopLeft.RemoveAt(n); - m_blockSelectionBottomRight.RemoveAt(n); - n--; - count--; - - // add up to 4 smaller blocks and set update region - if ( m_selectionMode != wxGrid::wxGridSelectColumns ) - { - if ( topRow < row ) - SelectBlock( topRow, leftCol, row - 1, rightCol, - false, false, false, false, false ); - if ( bottomRow > row ) - SelectBlock( row + 1, leftCol, bottomRow, rightCol, - false, false, false, false, false ); - } - - if ( m_selectionMode != wxGrid::wxGridSelectRows ) - { - if ( leftCol < col ) - SelectBlock( row, leftCol, row, col - 1, - false, false, false, false, false ); - if ( rightCol > col ) - SelectBlock( row, col + 1, row, rightCol, - false, false, false, false, false ); - } - } - } - - // remove a cell from a row, adding up to two new blocks - if ( m_selectionMode != wxGrid::wxGridSelectColumns ) - { - count = m_rowSelection.GetCount(); - for ( n = 0; n < count; n++ ) - { - if ( m_rowSelection[n] == row ) - { - m_rowSelection.RemoveAt(n); - n--; - count--; - - if (m_selectionMode == wxGrid::wxGridSelectCells) - { - if ( col > 0 ) - SelectBlock( row, 0, row, col - 1, - false, false, false, false, false ); - if ( col < m_grid->GetNumberCols() - 1 ) - SelectBlock( row, col + 1, - row, m_grid->GetNumberCols() - 1, - false, false, false, false, false ); - } - } - } - } - - // remove a cell from a column, adding up to two new blocks - if ( m_selectionMode != wxGrid::wxGridSelectRows ) - { - count = m_colSelection.GetCount(); - for ( n = 0; n < count; n++ ) - { - if ( m_colSelection[n] == col ) - { - m_colSelection.RemoveAt(n); - n--; - count--; - - if (m_selectionMode == wxGrid::wxGridSelectCells) - { - if ( row > 0 ) - SelectBlock( 0, col, row - 1, col, - false, false, false, false, false ); - if ( row < m_grid->GetNumberRows() - 1 ) - SelectBlock( row + 1, col, - m_grid->GetNumberRows() - 1, col, - false, false, false, false, false ); - } - } - } - } - - // Refresh the screen and send the event; according to m_selectionMode, - // we need to either update only the cell, or the whole row/column. - wxRect r; - switch (m_selectionMode) - { - case wxGrid::wxGridSelectCells: - { - if ( !m_grid->GetBatchCount() ) - { - r = m_grid->BlockToDeviceRect( - wxGridCellCoords( row, col ), - wxGridCellCoords( row, col ) ); - ((wxWindow *)m_grid->m_gridWin)->Refresh( false, &r ); - } - - wxGridRangeSelectEvent gridEvt( m_grid->GetId(), - wxEVT_GRID_RANGE_SELECT, - m_grid, - wxGridCellCoords( row, col ), - wxGridCellCoords( row, col ), - false, - ControlDown, ShiftDown, - AltDown, MetaDown ); - m_grid->GetEventHandler()->ProcessEvent( gridEvt ); - } - break; - - case wxGrid::wxGridSelectRows: - { - if ( !m_grid->GetBatchCount() ) - { - r = m_grid->BlockToDeviceRect( - wxGridCellCoords( row, 0 ), - wxGridCellCoords( row, m_grid->GetNumberCols() - 1 ) ); - ((wxWindow *)m_grid->m_gridWin)->Refresh( false, &r ); - } - - wxGridRangeSelectEvent gridEvt( m_grid->GetId(), - wxEVT_GRID_RANGE_SELECT, - m_grid, - wxGridCellCoords( row, 0 ), - wxGridCellCoords( row, m_grid->GetNumberCols() - 1 ), - false, - ControlDown, ShiftDown, - AltDown, MetaDown ); - m_grid->GetEventHandler()->ProcessEvent( gridEvt ); - } - break; - - case wxGrid::wxGridSelectColumns: - { - if ( !m_grid->GetBatchCount() ) - { - r = m_grid->BlockToDeviceRect( - wxGridCellCoords( 0, col ), - wxGridCellCoords( m_grid->GetNumberRows() - 1, col ) ); - ((wxWindow *)m_grid->m_gridWin)->Refresh( false, &r ); - } - - wxGridRangeSelectEvent gridEvt( m_grid->GetId(), - wxEVT_GRID_RANGE_SELECT, - m_grid, - wxGridCellCoords( 0, col ), - wxGridCellCoords( m_grid->GetNumberRows() - 1, col ), - false, - ControlDown, ShiftDown, - AltDown, MetaDown ); - m_grid->GetEventHandler()->ProcessEvent( gridEvt ); - } - break; - - default: - break; - } -} - -void wxGridSelection::ClearSelection() -{ - size_t n; - wxRect r; - wxGridCellCoords coords1, coords2; - - // deselect all individual cells and update the screen - if ( m_selectionMode == wxGrid::wxGridSelectCells ) - { - while ( ( n = m_cellSelection.GetCount() ) > 0) - { - n--; - coords1 = m_cellSelection[n]; - m_cellSelection.RemoveAt(n); - if ( !m_grid->GetBatchCount() ) - { - r = m_grid->BlockToDeviceRect( coords1, coords1 ); - ((wxWindow *)m_grid->m_gridWin)->Refresh( false, &r ); - -#ifdef __WXMAC__ - ((wxWindow *)m_grid->m_gridWin)->Update(); -#endif - } - } - } - - // deselect all blocks and update the screen - while ( ( n = m_blockSelectionTopLeft.GetCount() ) > 0) - { - n--; - coords1 = m_blockSelectionTopLeft[n]; - coords2 = m_blockSelectionBottomRight[n]; - m_blockSelectionTopLeft.RemoveAt(n); - m_blockSelectionBottomRight.RemoveAt(n); - if ( !m_grid->GetBatchCount() ) - { - r = m_grid->BlockToDeviceRect( coords1, coords2 ); - ((wxWindow *)m_grid->m_gridWin)->Refresh( false, &r ); - -#ifdef __WXMAC__ - ((wxWindow *)m_grid->m_gridWin)->Update(); -#endif - } - } - - // deselect all rows and update the screen - if ( m_selectionMode != wxGrid::wxGridSelectColumns ) - { - while ( ( n = m_rowSelection.GetCount() ) > 0) - { - n--; - int row = m_rowSelection[n]; - m_rowSelection.RemoveAt(n); - if ( !m_grid->GetBatchCount() ) - { - r = m_grid->BlockToDeviceRect( wxGridCellCoords( row, 0 ), - wxGridCellCoords( row, m_grid->GetNumberCols() - 1 ) ); - ((wxWindow *)m_grid->m_gridWin)->Refresh( false, &r ); - -#ifdef __WXMAC__ - ((wxWindow *)m_grid->m_gridWin)->Update(); -#endif - } - } - } - - // deselect all columns and update the screen - if ( m_selectionMode != wxGrid::wxGridSelectRows ) - { - while ( ( n = m_colSelection.GetCount() ) > 0) - { - n--; - int col = m_colSelection[n]; - m_colSelection.RemoveAt(n); - if ( !m_grid->GetBatchCount() ) - { - r = m_grid->BlockToDeviceRect( wxGridCellCoords( 0, col ), - wxGridCellCoords( m_grid->GetNumberRows() - 1, col ) ); - ((wxWindow *)m_grid->m_gridWin)->Refresh( false, &r ); - -#ifdef __WXMAC__ - ((wxWindow *)m_grid->m_gridWin)->Update(); -#endif - } - } - } - - // One deselection event, indicating deselection of _all_ cells. - // (No finer grained events for each of the smaller regions - // deselected above!) - wxGridRangeSelectEvent gridEvt( m_grid->GetId(), - wxEVT_GRID_RANGE_SELECT, - m_grid, - wxGridCellCoords( 0, 0 ), - wxGridCellCoords( - m_grid->GetNumberRows() - 1, - m_grid->GetNumberCols() - 1 ), - false ); - - m_grid->GetEventHandler()->ProcessEvent(gridEvt); -} - - -void wxGridSelection::UpdateRows( size_t pos, int numRows ) -{ - size_t count = m_cellSelection.GetCount(); - size_t n; - for ( n = 0; n < count; n++ ) - { - wxGridCellCoords& coords = m_cellSelection[n]; - wxCoord row = coords.GetRow(); - if ((size_t)row >= pos) - { - if (numRows > 0) - { - // If rows inserted, increase row counter where necessary - coords.SetRow(row + numRows); - } - else if (numRows < 0) - { - // If rows deleted ... - if ((size_t)row >= pos - numRows) - { - // ...either decrement row counter (if row still exists)... - coords.SetRow(row + numRows); - } - else - { - // ...or remove the attribute - m_cellSelection.RemoveAt(n); - n--; - count--; - } - } - } - } - - count = m_blockSelectionTopLeft.GetCount(); - for ( n = 0; n < count; n++ ) - { - wxGridCellCoords& coords1 = m_blockSelectionTopLeft[n]; - wxGridCellCoords& coords2 = m_blockSelectionBottomRight[n]; - wxCoord row1 = coords1.GetRow(); - wxCoord row2 = coords2.GetRow(); - - if ((size_t)row2 >= pos) - { - if (numRows > 0) - { - // If rows inserted, increase row counter where necessary - coords2.SetRow( row2 + numRows ); - if ((size_t)row1 >= pos) - coords1.SetRow( row1 + numRows ); - } - else if (numRows < 0) - { - // If rows deleted ... - if ((size_t)row2 >= pos - numRows) - { - // ...either decrement row counter (if row still exists)... - coords2.SetRow( row2 + numRows ); - if ((size_t)row1 >= pos) - coords1.SetRow( wxMax(row1 + numRows, (int)pos) ); - - } - else - { - if ((size_t)row1 >= pos) - { - // ...or remove the attribute - m_blockSelectionTopLeft.RemoveAt(n); - m_blockSelectionBottomRight.RemoveAt(n); - n--; - count--; - } - else - coords2.SetRow( pos ); - } - } - } - } - - count = m_rowSelection.GetCount(); - for ( n = 0; n < count; n++ ) - { - int rowOrCol_ = m_rowSelection[n]; - - if ((size_t) rowOrCol_ >= pos) - { - if ( numRows > 0 ) - { - m_rowSelection[n] += numRows; - } - else if ( numRows < 0 ) - { - if ((size_t)rowOrCol_ >= (pos - numRows)) - m_rowSelection[n] += numRows; - else - { - m_rowSelection.RemoveAt( n ); - n--; - count--; - } - } - } - } - // No need to touch selected columns, unless we removed _all_ - // rows, in this case, we remove all columns from the selection. - - if ( !m_grid->GetNumberRows() ) - m_colSelection.Clear(); -} - - -void wxGridSelection::UpdateCols( size_t pos, int numCols ) -{ - size_t count = m_cellSelection.GetCount(); - size_t n; - - for ( n = 0; n < count; n++ ) - { - wxGridCellCoords& coords = m_cellSelection[n]; - wxCoord col = coords.GetCol(); - if ((size_t)col >= pos) - { - if (numCols > 0) - { - // If rows inserted, increase row counter where necessary - coords.SetCol(col + numCols); - } - else if (numCols < 0) - { - // If rows deleted ... - if ((size_t)col >= pos - numCols) - { - // ...either decrement row counter (if row still exists)... - coords.SetCol(col + numCols); - } - else - { - // ...or remove the attribute - m_cellSelection.RemoveAt(n); - n--; - count--; - } - } - } - } - - count = m_blockSelectionTopLeft.GetCount(); - for ( n = 0; n < count; n++ ) - { - wxGridCellCoords& coords1 = m_blockSelectionTopLeft[n]; - wxGridCellCoords& coords2 = m_blockSelectionBottomRight[n]; - wxCoord col1 = coords1.GetCol(); - wxCoord col2 = coords2.GetCol(); - - if ((size_t)col2 >= pos) - { - if (numCols > 0) - { - // If rows inserted, increase row counter where necessary - coords2.SetCol(col2 + numCols); - if ((size_t)col1 >= pos) - coords1.SetCol(col1 + numCols); - } - else if (numCols < 0) - { - // If cols deleted ... - if ((size_t)col2 >= pos - numCols) - { - // ...either decrement col counter (if col still exists)... - coords2.SetCol(col2 + numCols); - if ( (size_t) col1 >= pos) - coords1.SetCol( wxMax(col1 + numCols, (int)pos) ); - - } - else - { - if ((size_t)col1 >= pos) - { - // ...or remove the attribute - m_blockSelectionTopLeft.RemoveAt(n); - m_blockSelectionBottomRight.RemoveAt(n); - n--; - count--; - } - else - coords2.SetCol(pos); - } - } - } - } - - count = m_colSelection.GetCount(); - for ( n = 0; n < count; n++ ) - { - int rowOrCol = m_colSelection[n]; - - if ((size_t)rowOrCol >= pos) - { - if ( numCols > 0 ) - m_colSelection[n] += numCols; - else if ( numCols < 0 ) - { - if ((size_t)rowOrCol >= (pos - numCols)) - m_colSelection[n] += numCols; - else - { - m_colSelection.RemoveAt( n ); - n--; - count--; - } - } - } - } - - // No need to touch selected rows, unless we removed _all_ - // columns, in this case, we remove all rows from the selection. - if ( !m_grid->GetNumberCols() ) - m_rowSelection.Clear(); -} - -int wxGridSelection::BlockContain( int topRow1, int leftCol1, - int bottomRow1, int rightCol1, - int topRow2, int leftCol2, - int bottomRow2, int rightCol2 ) -// returns 1, if Block1 contains Block2, -// -1, if Block2 contains Block1, -// 0, otherwise -{ - if ( topRow1 <= topRow2 && bottomRow2 <= bottomRow1 && - leftCol1 <= leftCol2 && rightCol2 <= rightCol1 ) - return 1; - else if ( topRow2 <= topRow1 && bottomRow1 <= bottomRow2 && - leftCol2 <= leftCol1 && rightCol1 <= rightCol2 ) - return -1; - - return 0; -} - -#endif diff --git a/wxWidgets/src/generic/helpext.cpp b/wxWidgets/src/generic/helpext.cpp deleted file mode 100644 index f01de9073d..0000000000 --- a/wxWidgets/src/generic/helpext.cpp +++ /dev/null @@ -1,485 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/generic/helpext.cpp -// Purpose: an external help controller for wxWidgets -// Author: Karsten Ballueder -// Modified by: -// Created: 04/01/98 -// RCS-ID: $Id: helpext.cpp 38857 2006-04-20 07:31:44Z ABX $ -// Copyright: (c) Karsten Ballueder -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_HELP && !defined(__WXWINCE__) && (!defined(__WXMAC__) || defined(__WXMAC_OSX__)) - -#ifndef WX_PRECOMP - #include "wx/list.h" - #include "wx/string.h" - #include "wx/utils.h" - #include "wx/intl.h" - #include "wx/msgdlg.h" - #include "wx/choicdlg.h" - #include "wx/log.h" -#endif - -#include "wx/filename.h" -#include "wx/textfile.h" -#include "wx/generic/helpext.h" - -#include -#include -#include - -#if !defined(__WINDOWS__) && !defined(__OS2__) - #include -#endif - -#ifdef __WINDOWS__ -#include "wx/msw/mslu.h" -#endif - -#ifdef __WXMSW__ -#include -#include "wx/msw/winundef.h" -#endif - -// ---------------------------------------------------------------------------- -// constants -// ---------------------------------------------------------------------------- - -/// Name for map file. -#define WXEXTHELP_MAPFILE _T("wxhelp.map") - -/// Character introducing comments/documentation field in map file. -#define WXEXTHELP_COMMENTCHAR ';' - -#define CONTENTS_ID 0 - -IMPLEMENT_CLASS(wxExtHelpController, wxHelpControllerBase) - -/// Name of environment variable to set help browser. -#define WXEXTHELP_ENVVAR_BROWSER wxT("WX_HELPBROWSER") -/// Is browser a netscape browser? -#define WXEXTHELP_ENVVAR_BROWSERISNETSCAPE wxT("WX_HELPBROWSER_NS") - -/** - This class implements help via an external browser. - It requires the name of a directory containing the documentation - and a file mapping numerical Section numbers to relative URLS. -*/ - -wxExtHelpController::wxExtHelpController(wxWindow* parentWindow) - : wxHelpControllerBase(parentWindow) -{ - m_MapList = NULL; - m_NumOfEntries = 0; - m_BrowserIsNetscape = false; - - wxChar *browser = wxGetenv(WXEXTHELP_ENVVAR_BROWSER); - if (browser) - { - m_BrowserName = browser; - browser = wxGetenv(WXEXTHELP_ENVVAR_BROWSERISNETSCAPE); - m_BrowserIsNetscape = browser && (wxAtoi(browser) != 0); - } -} - -wxExtHelpController::~wxExtHelpController() -{ - DeleteList(); -} - -void wxExtHelpController::SetBrowser(const wxString& browsername, bool isNetscape) -{ - m_BrowserName = browsername; - m_BrowserIsNetscape = isNetscape; -} - -// Set viewer: new, generic name for SetBrowser -void wxExtHelpController::SetViewer(const wxString& viewer, long flags) -{ - SetBrowser(viewer, (flags & wxHELP_NETSCAPE) != 0); -} - -bool wxExtHelpController::DisplayHelp(const wxString &relativeURL) -{ - // construct hte URL to open -- it's just a file - wxString url(_T("file://") + m_helpDir); - url << wxFILE_SEP_PATH << relativeURL; - - // use the explicit browser program if specified - if ( !m_BrowserName.empty() ) - { - if ( m_BrowserIsNetscape ) - { - wxString command; - command << m_BrowserName - << wxT(" -remote openURL(") << url << wxT(')'); - if ( wxExecute(command, wxEXEC_SYNC) != -1 ) - return true; - } - - if ( wxExecute(m_BrowserName + _T(' ') + url, wxEXEC_SYNC) != -1 ) - return true; - } - //else: either no browser explicitly specified or we failed to open it - - // just use default browser - return wxLaunchDefaultBrowser(url); -} - -class wxExtHelpMapEntry : public wxObject -{ -public: - int id; - wxString url; - wxString doc; - wxExtHelpMapEntry(int iid, wxString const &iurl, wxString const &idoc) - { id = iid; url = iurl; doc = idoc; } -}; - -void wxExtHelpController::DeleteList() -{ - if (m_MapList) - { - wxList::compatibility_iterator node = m_MapList->GetFirst(); - while (node) - { - delete (wxExtHelpMapEntry *)node->GetData(); - m_MapList->Erase(node); - node = m_MapList->GetFirst(); - } - - delete m_MapList; - m_MapList = (wxList*) NULL; - } -} - -// This must be called to tell the controller where to find the documentation. -// @param file - NOT a filename, but a directory name. -// @return true on success -bool wxExtHelpController::Initialize(const wxString& file) -{ - return LoadFile(file); -} - -bool wxExtHelpController::ParseMapFileLine(const wxString& line) -{ - const wxChar *p = line.c_str(); - - // skip whitespace - while ( isascii(*p) && isspace(*p) ) - p++; - - // skip empty lines and comments - if ( *p == _T('\0') || *p == WXEXTHELP_COMMENTCHAR ) - return true; - - // the line is of the form "num url" so we must have an integer now - wxChar *end; - const unsigned long id = wxStrtoul(p, &end, 0); - - if ( end == p ) - return false; - - p = end; - while ( isascii(*p) && isspace(*p) ) - p++; - - // next should be the URL - wxString url; - url.reserve(line.length()); - while ( isascii(*p) && !isspace(*p) ) - url += *p++; - - while ( isascii(*p) && isspace(*p) ) - p++; - - // and finally the optional description of the entry after comment - wxString doc; - if ( *p == WXEXTHELP_COMMENTCHAR ) - { - p++; - while ( isascii(*p) && isspace(*p) ) - p++; - doc = p; - } - - m_MapList->Append(new wxExtHelpMapEntry(id, url, doc)); - m_NumOfEntries++; - - return true; -} - -// file is a misnomer as it's the name of the base help directory -bool wxExtHelpController::LoadFile(const wxString& file) -{ - wxFileName helpDir(wxFileName::DirName(file)); - helpDir.MakeAbsolute(); - - bool dirExists = false; - -#if wxUSE_INTL - // If a locale is set, look in file/localename, i.e. If passed - // "/usr/local/myapp/help" and the current wxLocale is set to be "de", then - // look in "/usr/local/myapp/help/de/" first and fall back to - // "/usr/local/myapp/help" if that doesn't exist. - const wxLocale * const loc = wxGetLocale(); - if ( loc ) - { - wxString locName = loc->GetName(); - - // the locale is in general of the form xx_YY.zzzz, try the full firm - // first and then also more general ones - wxFileName helpDirLoc(helpDir); - helpDirLoc.AppendDir(locName); - dirExists = helpDirLoc.DirExists(); - - if ( ! dirExists ) - { - // try without encoding - const wxString locNameWithoutEncoding = locName.BeforeLast(_T('.')); - if ( !locNameWithoutEncoding.empty() ) - { - helpDirLoc = helpDir; - helpDirLoc.AppendDir(locNameWithoutEncoding); - dirExists = helpDirLoc.DirExists(); - } - } - - if ( !dirExists ) - { - // try without country part - wxString locNameWithoutCountry = locName.BeforeLast(_T('_')); - if ( !locNameWithoutCountry.empty() ) - { - helpDirLoc = helpDir; - helpDirLoc.AppendDir(locNameWithoutCountry); - dirExists = helpDirLoc.DirExists(); - } - } - - if ( dirExists ) - helpDir = helpDirLoc; - } -#endif // wxUSE_INTL - - if ( ! dirExists && !helpDir.DirExists() ) - { - wxLogError(_("Help directory \"%s\" not found."), - helpDir.GetFullPath().c_str()); - return false; - } - - const wxFileName mapFile(helpDir.GetFullPath(), WXEXTHELP_MAPFILE); - if ( ! mapFile.FileExists() ) - { - wxLogError(_("Help file \"%s\" not found."), - mapFile.GetFullPath().c_str()); - return false; - } - - DeleteList(); - m_MapList = new wxList; - m_NumOfEntries = 0; - - wxTextFile input; - if ( !input.Open(mapFile.GetFullPath()) ) - return false; - - for ( wxString& line = input.GetFirstLine(); - !input.Eof(); - line = input.GetNextLine() ) - { - if ( !ParseMapFileLine(line) ) - { - wxLogWarning(_("Line %lu of map file \"%s\" has invalid syntax, skipped."), - (unsigned long)input.GetCurrentLine(), - mapFile.GetFullPath().c_str()); - } - } - - if ( !m_NumOfEntries ) - { - wxLogError(_("No valid mappings found in the file \"%s\"."), - mapFile.GetFullPath().c_str()); - return false; - } - - m_helpDir = helpDir.GetFullPath(); // now it's valid - return true; -} - - -bool wxExtHelpController::DisplayContents() -{ - if (! m_NumOfEntries) - return false; - - wxString contents; - wxList::compatibility_iterator node = m_MapList->GetFirst(); - wxExtHelpMapEntry *entry; - while (node) - { - entry = (wxExtHelpMapEntry *)node->GetData(); - if (entry->id == CONTENTS_ID) - { - contents = entry->url; - break; - } - - node = node->GetNext(); - } - - bool rc = false; - wxString file; - file << m_helpDir << wxFILE_SEP_PATH << contents; - if (file.Contains(wxT('#'))) - file = file.BeforeLast(wxT('#')); - if (contents.length() && wxFileExists(file)) - rc = DisplaySection(CONTENTS_ID); - - // if not found, open homemade toc: - return rc ? true : KeywordSearch(wxEmptyString); -} - -bool wxExtHelpController::DisplaySection(int sectionNo) -{ - if (! m_NumOfEntries) - return false; - - wxBusyCursor b; // display a busy cursor - wxList::compatibility_iterator node = m_MapList->GetFirst(); - wxExtHelpMapEntry *entry; - while (node) - { - entry = (wxExtHelpMapEntry *)node->GetData(); - if (entry->id == sectionNo) - return DisplayHelp(entry->url); - node = node->GetNext(); - } - - return false; -} - -bool wxExtHelpController::DisplaySection(const wxString& section) -{ - bool isFilename = (section.Find(wxT(".htm")) != -1); - - if (isFilename) - return DisplayHelp(section); - else - return KeywordSearch(section); -} - -bool wxExtHelpController::DisplayBlock(long blockNo) -{ - return DisplaySection((int)blockNo); -} - -bool wxExtHelpController::KeywordSearch(const wxString& k, - wxHelpSearchMode WXUNUSED(mode)) -{ - if (! m_NumOfEntries) - return false; - - wxString *choices = new wxString[m_NumOfEntries]; - wxString *urls = new wxString[m_NumOfEntries]; - - int idx = 0; - bool rc = false; - bool showAll = k.empty(); - - wxList::compatibility_iterator node = m_MapList->GetFirst(); - - { - // display a busy cursor - wxBusyCursor b; - wxString compA, compB; - wxExtHelpMapEntry *entry; - - // we compare case insensitive - if (! showAll) - { - compA = k; - compA.LowerCase(); - } - - while (node) - { - entry = (wxExtHelpMapEntry *)node->GetData(); - compB = entry->doc; - - bool testTarget = ! compB.empty(); - if (testTarget && ! showAll) - { - compB.LowerCase(); - testTarget = compB.Contains(compA); - } - - if (testTarget) - { - urls[idx] = entry->url; - // doesn't work: - // choices[idx] = (**i).doc.Contains((**i).doc.Before(WXEXTHELP_COMMENTCHAR)); - //if (choices[idx].empty()) // didn't contain the ';' - // choices[idx] = (**i).doc; - choices[idx] = wxEmptyString; - for (int j=0; ; j++) - { - wxChar targetChar = entry->doc.c_str()[j]; - if ((targetChar == 0) || (targetChar == WXEXTHELP_COMMENTCHAR)) - break; - - choices[idx] << targetChar; - } - - idx++; - } - - node = node->GetNext(); - } - } - - switch (idx) - { - case 0: - wxMessageBox(_("No entries found.")); - break; - - case 1: - rc = DisplayHelp(urls[0]); - break; - - default: - idx = wxGetSingleChoiceIndex( - showAll ? _("Help Index") : _("Relevant entries:"), - showAll ? _("Help Index") : _("Entries found"), - idx, choices); - if (idx >= 0) - rc = DisplayHelp(urls[idx]); - break; - } - - delete [] urls; - delete [] choices; - - return rc; -} - - -bool wxExtHelpController::Quit() -{ - return true; -} - -void wxExtHelpController::OnQuit() -{ -} - -#endif // wxUSE_HELP diff --git a/wxWidgets/src/generic/htmllbox.cpp b/wxWidgets/src/generic/htmllbox.cpp deleted file mode 100644 index 0ffc71eea2..0000000000 --- a/wxWidgets/src/generic/htmllbox.cpp +++ /dev/null @@ -1,682 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: generic/htmllbox.cpp -// Purpose: implementation of wxHtmlListBox -// Author: Vadim Zeitlin -// Modified by: -// Created: 31.05.03 -// RCS-ID: $Id: htmllbox.cpp 44026 2006-12-21 18:24:27Z VS $ -// 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/dcclient.h" -#endif //WX_PRECOMP - -#if wxUSE_HTML - -#include "wx/htmllbox.h" - -#include "wx/html/htmlcell.h" -#include "wx/html/winpars.h" - -// this hack forces the linker to always link in m_* files -#include "wx/html/forcelnk.h" -FORCE_WXHTML_MODULES() - -// ---------------------------------------------------------------------------- -// constants -// ---------------------------------------------------------------------------- - -// small border always added to the cells: -static const wxCoord CELL_BORDER = 2; - -const wxChar wxHtmlListBoxNameStr[] = wxT("htmlListBox"); -const wxChar wxSimpleHtmlListBoxNameStr[] = wxT("simpleHtmlListBox"); - -// ============================================================================ -// private classes -// ============================================================================ - -// ---------------------------------------------------------------------------- -// wxHtmlListBoxCache -// ---------------------------------------------------------------------------- - -// this class is used by wxHtmlListBox to cache the parsed representation of -// the items to avoid doing it anew each time an item must be drawn -class wxHtmlListBoxCache -{ -private: - // invalidate a single item, used by Clear() and InvalidateRange() - void InvalidateItem(size_t n) - { - m_items[n] = (size_t)-1; - delete m_cells[n]; - m_cells[n] = NULL; - } - -public: - wxHtmlListBoxCache() - { - for ( size_t n = 0; n < SIZE; n++ ) - { - m_items[n] = (size_t)-1; - m_cells[n] = NULL; - } - - m_next = 0; - } - - ~wxHtmlListBoxCache() - { - for ( size_t n = 0; n < SIZE; n++ ) - { - delete m_cells[n]; - } - } - - // completely invalidate the cache - void Clear() - { - for ( size_t n = 0; n < SIZE; n++ ) - { - InvalidateItem(n); - } - } - - // return the cached cell for this index or NULL if none - wxHtmlCell *Get(size_t item) const - { - for ( size_t n = 0; n < SIZE; n++ ) - { - if ( m_items[n] == item ) - return m_cells[n]; - } - - return NULL; - } - - // returns true if we already have this item cached - bool Has(size_t item) const { return Get(item) != NULL; } - - // ensure that the item is cached - void Store(size_t item, wxHtmlCell *cell) - { - delete m_cells[m_next]; - m_cells[m_next] = cell; - m_items[m_next] = item; - - // advance to the next item wrapping around if there are no more - if ( ++m_next == SIZE ) - m_next = 0; - } - - // forget the cached value of the item(s) between the given ones (inclusive) - void InvalidateRange(size_t from, size_t to) - { - for ( size_t n = 0; n < SIZE; n++ ) - { - if ( m_items[n] >= from && m_items[n] <= to ) - { - InvalidateItem(n); - } - } - } - -private: - // the max number of the items we cache - enum { SIZE = 50 }; - - // the index of the LRU (oldest) cell - size_t m_next; - - // the parsed representation of the cached item or NULL - wxHtmlCell *m_cells[SIZE]; - - // the index of the currently cached item (only valid if m_cells != NULL) - size_t m_items[SIZE]; -}; - -// ---------------------------------------------------------------------------- -// wxHtmlListBoxStyle -// ---------------------------------------------------------------------------- - -// just forward wxDefaultHtmlRenderingStyle callbacks to the main class so that -// they could be overridden by the user code -class wxHtmlListBoxStyle : public wxDefaultHtmlRenderingStyle -{ -public: - wxHtmlListBoxStyle(const wxHtmlListBox& hlbox) : m_hlbox(hlbox) { } - - virtual wxColour GetSelectedTextColour(const wxColour& colFg) - { - return m_hlbox.GetSelectedTextColour(colFg); - } - - virtual wxColour GetSelectedTextBgColour(const wxColour& colBg) - { - return m_hlbox.GetSelectedTextBgColour(colBg); - } - -private: - const wxHtmlListBox& m_hlbox; - - DECLARE_NO_COPY_CLASS(wxHtmlListBoxStyle) -}; - -// ---------------------------------------------------------------------------- -// event tables -// ---------------------------------------------------------------------------- - -BEGIN_EVENT_TABLE(wxHtmlListBox, wxVListBox) - EVT_SIZE(wxHtmlListBox::OnSize) - EVT_MOTION(wxHtmlListBox::OnMouseMove) - EVT_LEFT_DOWN(wxHtmlListBox::OnLeftDown) -END_EVENT_TABLE() - -// ============================================================================ -// implementation -// ============================================================================ - -IMPLEMENT_ABSTRACT_CLASS(wxHtmlListBox, wxVListBox) - - -// ---------------------------------------------------------------------------- -// wxHtmlListBox creation -// ---------------------------------------------------------------------------- - -wxHtmlListBox::wxHtmlListBox() - : wxHtmlWindowMouseHelper(this) -{ - Init(); -} - -// normal constructor which calls Create() internally -wxHtmlListBox::wxHtmlListBox(wxWindow *parent, - wxWindowID id, - const wxPoint& pos, - const wxSize& size, - long style, - const wxString& name) - : wxHtmlWindowMouseHelper(this) -{ - Init(); - - (void)Create(parent, id, pos, size, style, name); -} - -void wxHtmlListBox::Init() -{ - m_htmlParser = NULL; - m_htmlRendStyle = new wxHtmlListBoxStyle(*this); - m_cache = new wxHtmlListBoxCache; -} - -bool wxHtmlListBox::Create(wxWindow *parent, - wxWindowID id, - const wxPoint& pos, - const wxSize& size, - long style, - const wxString& name) -{ - return wxVListBox::Create(parent, id, pos, size, style, name); -} - -wxHtmlListBox::~wxHtmlListBox() -{ - delete m_cache; - - if ( m_htmlParser ) - { - delete m_htmlParser->GetDC(); - delete m_htmlParser; - } - - delete m_htmlRendStyle; -} - -// ---------------------------------------------------------------------------- -// wxHtmlListBox appearance -// ---------------------------------------------------------------------------- - -wxColour wxHtmlListBox::GetSelectedTextColour(const wxColour& colFg) const -{ - return m_htmlRendStyle-> - wxDefaultHtmlRenderingStyle::GetSelectedTextColour(colFg); -} - -wxColour -wxHtmlListBox::GetSelectedTextBgColour(const wxColour& WXUNUSED(colBg)) const -{ - return GetSelectionBackground(); -} - -// ---------------------------------------------------------------------------- -// wxHtmlListBox items markup -// ---------------------------------------------------------------------------- - -wxString wxHtmlListBox::OnGetItemMarkup(size_t n) const -{ - // we don't even need to wrap the value returned by OnGetItem() inside - // "" and "" because wxHTML can parse it even - // without these tags - return OnGetItem(n); -} - -// ---------------------------------------------------------------------------- -// wxHtmlListBox cache handling -// ---------------------------------------------------------------------------- - -void wxHtmlListBox::CacheItem(size_t n) const -{ - if ( !m_cache->Has(n) ) - { - if ( !m_htmlParser ) - { - wxHtmlListBox *self = wxConstCast(this, wxHtmlListBox); - - self->m_htmlParser = new wxHtmlWinParser(self); - m_htmlParser->SetDC(new wxClientDC(self)); - m_htmlParser->SetFS(&self->m_filesystem); -#if !wxUSE_UNICODE - if (GetFont().Ok()) - m_htmlParser->SetInputEncoding(GetFont().GetEncoding()); -#endif - // use system's default GUI font by default: - m_htmlParser->SetStandardFonts(); - } - - wxHtmlContainerCell *cell = (wxHtmlContainerCell *)m_htmlParser-> - Parse(OnGetItemMarkup(n)); - wxCHECK_RET( cell, _T("wxHtmlParser::Parse() returned NULL?") ); - - // set the cell's ID to item's index so that CellCoordsToPhysical() - // can quickly find the item: - cell->SetId(wxString::Format(_T("%lu"), (unsigned long)n)); - - cell->Layout(GetClientSize().x - 2*GetMargins().x); - - m_cache->Store(n, cell); - } -} - -void wxHtmlListBox::OnSize(wxSizeEvent& event) -{ - // we need to relayout all the cached cells - m_cache->Clear(); - - event.Skip(); -} - -void wxHtmlListBox::RefreshLine(size_t line) -{ - m_cache->InvalidateRange(line, line); - - wxVListBox::RefreshLine(line); -} - -void wxHtmlListBox::RefreshLines(size_t from, size_t to) -{ - m_cache->InvalidateRange(from, to); - - wxVListBox::RefreshLines(from, to); -} - -void wxHtmlListBox::RefreshAll() -{ - m_cache->Clear(); - - wxVListBox::RefreshAll(); -} - -void wxHtmlListBox::SetItemCount(size_t count) -{ - // the items are going to change, forget the old ones - m_cache->Clear(); - - wxVListBox::SetItemCount(count); -} - -// ---------------------------------------------------------------------------- -// wxHtmlListBox implementation of wxVListBox pure virtuals -// ---------------------------------------------------------------------------- - -void wxHtmlListBox::OnDrawItem(wxDC& dc, const wxRect& rect, size_t n) const -{ - CacheItem(n); - - wxHtmlCell *cell = m_cache->Get(n); - wxCHECK_RET( cell, _T("this cell should be cached!") ); - - wxHtmlRenderingInfo htmlRendInfo; - - // draw the selected cell in selected state - if ( IsSelected(n) ) - { - wxHtmlSelection htmlSel; - htmlSel.Set(wxPoint(0,0), cell, wxPoint(INT_MAX, INT_MAX), cell); - htmlRendInfo.SetSelection(&htmlSel); - if ( m_htmlRendStyle ) - htmlRendInfo.SetStyle(m_htmlRendStyle); - htmlRendInfo.GetState().SetSelectionState(wxHTML_SEL_IN); - } - - // note that we can't stop drawing exactly at the window boundary as then - // even the visible cells part could be not drawn, so always draw the - // entire cell - cell->Draw(dc, - rect.x + CELL_BORDER, rect.y + CELL_BORDER, - 0, INT_MAX, htmlRendInfo); -} - -wxCoord wxHtmlListBox::OnMeasureItem(size_t n) const -{ - CacheItem(n); - - wxHtmlCell *cell = m_cache->Get(n); - wxCHECK_MSG( cell, 0, _T("this cell should be cached!") ); - - return cell->GetHeight() + cell->GetDescent() + 4; -} - -// ---------------------------------------------------------------------------- -// wxHtmlListBox implementation of wxHtmlListBoxWinInterface -// ---------------------------------------------------------------------------- - -void wxHtmlListBox::SetHTMLWindowTitle(const wxString& WXUNUSED(title)) -{ - // nothing to do -} - -void wxHtmlListBox::OnHTMLLinkClicked(const wxHtmlLinkInfo& link) -{ - OnLinkClicked(GetItemForCell(link.GetHtmlCell()), link); -} - -void wxHtmlListBox::OnLinkClicked(size_t WXUNUSED(n), - const wxHtmlLinkInfo& link) -{ - wxHtmlLinkEvent event(GetId(), link); - GetEventHandler()->ProcessEvent(event); -} - -wxHtmlOpeningStatus -wxHtmlListBox::OnHTMLOpeningURL(wxHtmlURLType WXUNUSED(type), - const wxString& WXUNUSED(url), - wxString *WXUNUSED(redirect)) const -{ - return wxHTML_OPEN; -} - -wxPoint wxHtmlListBox::HTMLCoordsToWindow(wxHtmlCell *cell, - const wxPoint& pos) const -{ - return CellCoordsToPhysical(pos, cell); -} - -wxWindow* wxHtmlListBox::GetHTMLWindow() { return this; } - -wxColour wxHtmlListBox::GetHTMLBackgroundColour() const -{ - return GetBackgroundColour(); -} - -void wxHtmlListBox::SetHTMLBackgroundColour(const wxColour& WXUNUSED(clr)) -{ - // nothing to do -} - -void wxHtmlListBox::SetHTMLBackgroundImage(const wxBitmap& WXUNUSED(bmpBg)) -{ - // nothing to do -} - -void wxHtmlListBox::SetHTMLStatusText(const wxString& WXUNUSED(text)) -{ - // nothing to do -} - -wxCursor wxHtmlListBox::GetHTMLCursor(HTMLCursor type) const -{ - // we don't want to show text selection cursor in listboxes - if (type == HTMLCursor_Text) - return wxHtmlWindow::GetDefaultHTMLCursor(HTMLCursor_Default); - - // in all other cases, use the same cursor as wxHtmlWindow: - return wxHtmlWindow::GetDefaultHTMLCursor(type); -} - -// ---------------------------------------------------------------------------- -// wxHtmlListBox handling of HTML links -// ---------------------------------------------------------------------------- - -wxPoint wxHtmlListBox::GetRootCellCoords(size_t n) const -{ - wxPoint pos(CELL_BORDER, CELL_BORDER); - pos += GetMargins(); - pos.y += GetLinesHeight(GetFirstVisibleLine(), n); - return pos; -} - -bool wxHtmlListBox::PhysicalCoordsToCell(wxPoint& pos, wxHtmlCell*& cell) const -{ - int n = HitTest(pos); - if ( n == wxNOT_FOUND ) - return false; - - // convert mouse coordinates to coords relative to item's wxHtmlCell: - pos -= GetRootCellCoords(n); - - CacheItem(n); - cell = m_cache->Get(n); - - return true; -} - -size_t wxHtmlListBox::GetItemForCell(const wxHtmlCell *cell) const -{ - wxCHECK_MSG( cell, 0, _T("no cell") ); - - cell = cell->GetRootCell(); - - wxCHECK_MSG( cell, 0, _T("no root cell") ); - - // the cell's ID contains item index, see CacheItem(): - unsigned long n; - if ( !cell->GetId().ToULong(&n) ) - { - wxFAIL_MSG( _T("unexpected root cell's ID") ); - return 0; - } - - return n; -} - -wxPoint -wxHtmlListBox::CellCoordsToPhysical(const wxPoint& pos, wxHtmlCell *cell) const -{ - return pos + GetRootCellCoords(GetItemForCell(cell)); -} - -void wxHtmlListBox::OnInternalIdle() -{ - wxVListBox::OnInternalIdle(); - - if ( wxHtmlWindowMouseHelper::DidMouseMove() ) - { - wxPoint pos = ScreenToClient(wxGetMousePosition()); - wxHtmlCell *cell; - - if ( !PhysicalCoordsToCell(pos, cell) ) - return; - - wxHtmlWindowMouseHelper::HandleIdle(cell, pos); - } -} - -void wxHtmlListBox::OnMouseMove(wxMouseEvent& event) -{ - wxHtmlWindowMouseHelper::HandleMouseMoved(); - event.Skip(); -} - -void wxHtmlListBox::OnLeftDown(wxMouseEvent& event) -{ - wxPoint pos = event.GetPosition(); - wxHtmlCell *cell; - - if ( !PhysicalCoordsToCell(pos, cell) ) - { - event.Skip(); - return; - } - - if ( !wxHtmlWindowMouseHelper::HandleMouseClick(cell, pos, event) ) - { - // no link was clicked, so let the listbox code handle the click (e.g. - // by selecting another item in the list): - event.Skip(); - } -} - - -// ---------------------------------------------------------------------------- -// wxSimpleHtmlListBox -// ---------------------------------------------------------------------------- - -bool wxSimpleHtmlListBox::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 (!wxHtmlListBox::Create(parent, id, pos, size, style, name)) - return false; - -#if wxUSE_VALIDATORS - SetValidator(validator); -#endif - for (int i=0; iIsFrozen()) - RefreshAll(); -} - -#endif // wxUSE_HTML diff --git a/wxWidgets/src/generic/hyperlink.cpp b/wxWidgets/src/generic/hyperlink.cpp deleted file mode 100644 index e117242a1d..0000000000 --- a/wxWidgets/src/generic/hyperlink.cpp +++ /dev/null @@ -1,285 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/generic/hyperlink.cpp -// Purpose: Hyperlink control -// Author: David Norris , Otto Wyss -// Modified by: Ryan Norton, Francesco Montorsi -// Created: 04/02/2005 -// RCS-ID: $Id: hyperlink.cpp 62092 2009-09-24 16:46:50Z JS $ -// Copyright: (c) 2005 David Norris -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declarations -// ============================================================================ - -//--------------------------------------------------------------------------- -// Pre-compiled header stuff -//--------------------------------------------------------------------------- - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_HYPERLINKCTRL - -//--------------------------------------------------------------------------- -// Includes -//--------------------------------------------------------------------------- - -#include "wx/hyperlink.h" - -#ifndef WX_PRECOMP - #include "wx/utils.h" // for wxLaunchDefaultBrowser - #include "wx/dcclient.h" - #include "wx/menu.h" - #include "wx/log.h" - #include "wx/dataobj.h" -#endif - -#include "wx/clipbrd.h" - -// ============================================================================ -// implementation -// ============================================================================ - -IMPLEMENT_DYNAMIC_CLASS(wxHyperlinkCtrl, wxControl) -IMPLEMENT_DYNAMIC_CLASS(wxHyperlinkEvent, wxCommandEvent) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_HYPERLINK) - -// reserved for internal use only -#define wxHYPERLINKCTRL_POPUP_COPY_ID 16384 - -const wxChar wxHyperlinkCtrlNameStr[] = wxT("hyperlink"); - -// ---------------------------------------------------------------------------- -// wxHyperlinkCtrl -// ---------------------------------------------------------------------------- - -BEGIN_EVENT_TABLE(wxHyperlinkCtrl, wxControl) - EVT_PAINT(wxHyperlinkCtrl::OnPaint) - EVT_LEFT_DOWN(wxHyperlinkCtrl::OnLeftDown) - EVT_LEFT_UP(wxHyperlinkCtrl::OnLeftUp) - EVT_RIGHT_UP(wxHyperlinkCtrl::OnRightUp) - EVT_MOTION(wxHyperlinkCtrl::OnMotion) - EVT_LEAVE_WINDOW(wxHyperlinkCtrl::OnLeaveWindow) - EVT_SIZE(wxHyperlinkCtrl::OnSize) - - // for the context menu - EVT_MENU(wxHYPERLINKCTRL_POPUP_COPY_ID, wxHyperlinkCtrl::OnPopUpCopy) -END_EVENT_TABLE() - -bool wxHyperlinkCtrl::Create(wxWindow *parent, wxWindowID id, - const wxString& label, const wxString& url, const wxPoint& pos, - const wxSize& size, long style, const wxString& name) -{ - wxASSERT_MSG(!url.empty() || !label.empty(), - wxT("Both URL and label are empty ?")); - -#ifdef __WXDEBUG__ - int alignment = (int)((style & wxHL_ALIGN_LEFT) != 0) + - (int)((style & wxHL_ALIGN_CENTRE) != 0) + - (int)((style & wxHL_ALIGN_RIGHT) != 0); - wxASSERT_MSG(alignment == 1, - wxT("Specify exactly one align flag!")); -#endif - - if (!wxControl::Create(parent, id, pos, size, style, wxDefaultValidator, name)) - return false; - - // set to non empty strings both the url and the label - if(url.empty()) - SetURL(label); - else - SetURL(url); - - if(label.empty()) - SetLabel(url); - else - SetLabel(label); - - m_rollover = false; - m_clicking = false; - m_visited = false; - - // colours - m_normalColour = *wxBLUE; - m_hoverColour = *wxRED; - m_visitedColour = wxColour(wxT("#551a8b")); - SetForegroundColour(m_normalColour); - - // by default the font of an hyperlink control is underlined - wxFont f = GetFont(); - f.SetUnderlined(true); - SetFont(f); - - SetInitialSize(size); - - return true; -} - -wxSize wxHyperlinkCtrl::DoGetBestSize() const -{ - int w, h; - - wxClientDC dc((wxWindow *)this); - dc.SetFont(GetFont()); - dc.GetTextExtent(GetLabel(), &w, &h); - - wxSize best(w, h); - CacheBestSize(best); - return best; -} - - -void wxHyperlinkCtrl::SetNormalColour(const wxColour &colour) -{ - m_normalColour = colour; - if (!m_visited) - { - SetForegroundColour(m_normalColour); - Refresh(); - } -} - -void wxHyperlinkCtrl::SetVisitedColour(const wxColour &colour) -{ - m_visitedColour = colour; - if (m_visited) - { - SetForegroundColour(m_visitedColour); - Refresh(); - } -} - -void wxHyperlinkCtrl::DoContextMenu(const wxPoint &pos) -{ - wxMenu *menuPopUp = new wxMenu(wxEmptyString, wxMENU_TEAROFF); - menuPopUp->Append(wxHYPERLINKCTRL_POPUP_COPY_ID, _("&Copy URL")); - PopupMenu( menuPopUp, pos ); - delete menuPopUp; -} - -wxRect wxHyperlinkCtrl::GetLabelRect() const -{ - // our best size is always the size of the label without borders - wxSize c(GetClientSize()), b(GetBestSize()); - wxPoint offset; - - // the label is always centered vertically - offset.y = (c.GetHeight()-b.GetHeight())/2; - - if (HasFlag(wxHL_ALIGN_CENTRE)) - offset.x = (c.GetWidth()-b.GetWidth())/2; - else if (HasFlag(wxHL_ALIGN_RIGHT)) - offset.x = c.GetWidth()-b.GetWidth(); - else if (HasFlag(wxHL_ALIGN_LEFT)) - offset.x = 0; - return wxRect(offset, b); -} - - - -// ---------------------------------------------------------------------------- -// wxHyperlinkCtrl - event handlers -// ---------------------------------------------------------------------------- - -void wxHyperlinkCtrl::OnPaint(wxPaintEvent& WXUNUSED(event)) -{ - wxPaintDC dc(this); - dc.SetFont(GetFont()); - dc.SetTextForeground(GetForegroundColour()); - dc.SetTextBackground(GetBackgroundColour()); - - dc.DrawText(GetLabel(), GetLabelRect().GetTopLeft()); -} - -void wxHyperlinkCtrl::OnLeftDown(wxMouseEvent& event) -{ - // the left click must start from the hyperlink rect - m_clicking = GetLabelRect().Contains(event.GetPosition()); -} - -void wxHyperlinkCtrl::OnLeftUp(wxMouseEvent& event) -{ - // the click must be started and ended in the hyperlink rect - if (!m_clicking || !GetLabelRect().Contains(event.GetPosition())) - return; - - SetForegroundColour(m_visitedColour); - m_visited = true; - m_clicking = false; - - // send the event - wxHyperlinkEvent linkEvent(this, GetId(), m_url); - if (!GetEventHandler()->ProcessEvent(linkEvent)) // was the event skipped ? - if (!wxLaunchDefaultBrowser(m_url)) - wxLogWarning(wxT("Could not launch the default browser with url '%s' !"), m_url.c_str()); -} - -void wxHyperlinkCtrl::OnRightUp(wxMouseEvent& event) -{ - if( GetWindowStyle() & wxHL_CONTEXTMENU ) - if ( GetLabelRect().Contains(event.GetPosition()) ) - DoContextMenu(wxPoint(event.m_x, event.m_y)); -} - -void wxHyperlinkCtrl::OnMotion(wxMouseEvent& event) -{ - wxRect textrc = GetLabelRect(); - - if (textrc.Contains(event.GetPosition())) - { - SetCursor(wxCursor(wxCURSOR_HAND)); - SetForegroundColour(m_hoverColour); - m_rollover = true; - Refresh(); - } - else if (m_rollover) - { - SetCursor(*wxSTANDARD_CURSOR); - SetForegroundColour(!m_visited ? m_normalColour : m_visitedColour); - m_rollover = false; - Refresh(); - } -} - -void wxHyperlinkCtrl::OnLeaveWindow(wxMouseEvent& WXUNUSED(event) ) -{ - // NB: when the label rect and the client size rect have the same - // height this function is indispensable to remove the "rollover" - // effect as the OnMotion() event handler could not be called - // in that case moving the mouse out of the label vertically... - - if (m_rollover) - { - SetCursor(*wxSTANDARD_CURSOR); - SetForegroundColour(!m_visited ? m_normalColour : m_visitedColour); - m_rollover = false; - Refresh(); - } -} - -void wxHyperlinkCtrl::OnPopUpCopy( wxCommandEvent& WXUNUSED(event) ) -{ -#if wxUSE_CLIPBOARD - if (!wxTheClipboard->Open()) - return; - - wxTextDataObject *data = new wxTextDataObject( m_url ); - wxTheClipboard->SetData( data ); - wxTheClipboard->Close(); -#endif // wxUSE_CLIPBOARD -} - -void wxHyperlinkCtrl::OnSize(wxSizeEvent& WXUNUSED(event)) -{ - // update the position of the label in the screen respecting - // the selected align flag - Refresh(); -} - -#endif // wxUSE_HYPERLINKCTRL diff --git a/wxWidgets/src/generic/icon.cpp b/wxWidgets/src/generic/icon.cpp deleted file mode 100644 index d86a1d4843..0000000000 --- a/wxWidgets/src/generic/icon.cpp +++ /dev/null @@ -1,45 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/generic/icon.cpp -// Purpose: wxIcon implementation for ports where it's same as wxBitmap -// Author: Julian Smart -// Modified by: -// Created: 17/09/98 -// RCS-ID: $Id: icon.cpp 40531 2006-08-09 17:59:30Z VS $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// for compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#include "wx/icon.h" - -//----------------------------------------------------------------------------- -// wxIcon -//----------------------------------------------------------------------------- - -IMPLEMENT_DYNAMIC_CLASS(wxIcon, wxBitmap) - -wxIcon::wxIcon( const char **bits, int WXUNUSED(width), int WXUNUSED(height) ) : - wxBitmap( bits ) -{ -} - -wxIcon::wxIcon( char **bits, int WXUNUSED(width), int WXUNUSED(height) ) : - wxBitmap( bits ) -{ -} - -wxIcon::wxIcon() : wxBitmap() -{ -} - -void wxIcon::CopyFromBitmap(const wxBitmap& bmp) -{ - wxIcon *icon = (wxIcon*)(&bmp); - *this = *icon; -} diff --git a/wxWidgets/src/generic/imaglist.cpp b/wxWidgets/src/generic/imaglist.cpp deleted file mode 100644 index 1200441795..0000000000 --- a/wxWidgets/src/generic/imaglist.cpp +++ /dev/null @@ -1,278 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/generic/imaglist.cpp -// Purpose: -// Author: Robert Roebling -// Id: $Id: imaglist.cpp 58031 2009-01-12 05:39:04Z PC $ -// Copyright: (c) 1998 Robert Roebling -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_IMAGLIST && !defined(wxHAS_NATIVE_IMAGELIST) - -#ifndef __WXPALMOS__ - -#include "wx/imaglist.h" - -#ifndef WX_PRECOMP - #include "wx/dc.h" - #include "wx/icon.h" - #include "wx/image.h" -#endif - -//----------------------------------------------------------------------------- -// wxImageList -//----------------------------------------------------------------------------- - -IMPLEMENT_DYNAMIC_CLASS(wxGenericImageList, wxObject) -IMPLEMENT_DYNAMIC_CLASS(wxImageList, wxGenericImageList) - -wxGenericImageList::wxGenericImageList( int width, int height, bool mask, int initialCount ) -{ - (void)Create(width, height, mask, initialCount); -} - -wxGenericImageList::~wxGenericImageList() -{ - (void)RemoveAll(); -} - -int wxGenericImageList::GetImageCount() const -{ - return m_images.GetCount(); -} - -bool wxGenericImageList::Create( int width, int height, bool WXUNUSED(mask), int WXUNUSED(initialCount) ) -{ - m_width = width; - m_height = height; - - return Create(); -} - -bool wxGenericImageList::Create() -{ - return true; -} - -int wxGenericImageList::Add( const wxBitmap &bitmap ) -{ - wxASSERT_MSG( (bitmap.GetWidth() >= m_width && bitmap.GetHeight() == m_height) - || (m_width == 0 && m_height == 0), - _T("invalid bitmap size in wxImageList: this might work ") - _T("on this platform but definitely won't under Windows.") ); - - const int index = int(m_images.GetCount()); - - if (bitmap.IsKindOf(CLASSINFO(wxIcon))) - { - m_images.Append( new wxIcon( (const wxIcon&) bitmap ) ); - } - else - { - // Mimic behavior of Windows ImageList_Add that automatically breaks up the added - // bitmap into sub-images of the correct size - if (m_width > 0 && bitmap.GetWidth() > m_width && bitmap.GetHeight() >= m_height) - { - int numImages = bitmap.GetWidth() / m_width; - for (int subIndex = 0; subIndex < numImages; subIndex++) - { - wxRect rect(m_width * subIndex, 0, m_width, m_height); - wxBitmap tmpBmp = bitmap.GetSubBitmap(rect); - m_images.Append( new wxBitmap(tmpBmp) ); - } - } - else - { - m_images.Append( new wxBitmap(bitmap) ); - } - } - - if (m_width == 0 && m_height == 0) - { - m_width = bitmap.GetWidth(); - m_height = bitmap.GetHeight(); - } - - return index; -} - -int wxGenericImageList::Add( const wxBitmap& bitmap, const wxBitmap& mask ) -{ - wxBitmap bmp(bitmap); - if (mask.Ok()) - bmp.SetMask(new wxMask(mask)); - return Add(bmp); -} - -int wxGenericImageList::Add( const wxBitmap& bitmap, const wxColour& maskColour ) -{ - wxImage img = bitmap.ConvertToImage(); - img.SetMaskColour(maskColour.Red(), maskColour.Green(), maskColour.Blue()); - return Add(wxBitmap(img)); -} - -const wxBitmap *wxGenericImageList::GetBitmapPtr( int index ) const -{ - wxList::compatibility_iterator node = m_images.Item( index ); - - wxCHECK_MSG( node, (wxBitmap *) NULL, wxT("wrong index in image list") ); - - return (wxBitmap*)node->GetData(); -} - -// Get the bitmap -wxBitmap wxGenericImageList::GetBitmap(int index) const -{ - const wxBitmap* bmp = GetBitmapPtr(index); - if (bmp) - return *bmp; - else - return wxNullBitmap; -} - -// Get the icon -wxIcon wxGenericImageList::GetIcon(int index) const -{ - const wxBitmap* bmp = GetBitmapPtr(index); - if (bmp) - { - wxIcon icon; - icon.CopyFromBitmap(*bmp); - return icon; - } - else - return wxNullIcon; -} - -bool wxGenericImageList::Replace( int index, const wxBitmap &bitmap ) -{ - wxList::compatibility_iterator node = m_images.Item( index ); - - wxCHECK_MSG( node, false, wxT("wrong index in image list") ); - - wxBitmap* newBitmap = (bitmap.IsKindOf(CLASSINFO(wxIcon))) ? - #if defined(__VISAGECPP__) - //just can't do this in VisualAge now, with all this new Bitmap-Icon stuff - //so construct it from a bitmap object until I can figure this nonsense out. (DW) - new wxBitmap(bitmap) - #else - new wxBitmap( (const wxIcon&) bitmap ) - #endif - : new wxBitmap(bitmap) ; - - if (index == (int) m_images.GetCount() - 1) - { - delete node->GetData(); - m_images.Erase( node ); - m_images.Append( newBitmap ); - } - else - { - wxList::compatibility_iterator next = node->GetNext(); - delete node->GetData(); - m_images.Erase( node ); - m_images.Insert( next, newBitmap ); - } - - return true; -} - -bool wxGenericImageList::Replace( int index, const wxBitmap &bitmap, const wxBitmap &mask ) -{ - wxList::compatibility_iterator node = m_images.Item( index ); - - wxCHECK_MSG( node, false, wxT("wrong index in image list") ); - - wxBitmap* newBitmap = (bitmap.IsKindOf(CLASSINFO(wxIcon))) ? - #if defined(__VISAGECPP__) - //just can't do this in VisualAge now, with all this new Bitmap-Icon stuff - //so construct it from a bitmap object until I can figure this nonsense out. (DW) - new wxBitmap(bitmap) - #else - new wxBitmap( (const wxIcon&) bitmap ) - #endif - : new wxBitmap(bitmap) ; - - if (index == (int) m_images.GetCount() - 1) - { - delete node->GetData(); - m_images.Erase( node ); - m_images.Append( newBitmap ); - } - else - { - wxList::compatibility_iterator next = node->GetNext(); - delete node->GetData(); - m_images.Erase( node ); - m_images.Insert( next, newBitmap ); - } - - if (mask.Ok()) - newBitmap->SetMask(new wxMask(mask)); - - return true; -} - -bool wxGenericImageList::Remove( int index ) -{ - wxList::compatibility_iterator node = m_images.Item( index ); - - wxCHECK_MSG( node, false, wxT("wrong index in image list") ); - - delete node->GetData(); - m_images.Erase( node ); - - return true; -} - -bool wxGenericImageList::RemoveAll() -{ - WX_CLEAR_LIST(wxList, m_images); - m_images.Clear(); - - return true; -} - -bool wxGenericImageList::GetSize( int index, int &width, int &height ) const -{ - width = 0; - height = 0; - - wxList::compatibility_iterator node = m_images.Item( index ); - - wxCHECK_MSG( node, false, wxT("wrong index in image list") ); - - wxBitmap *bm = (wxBitmap*)node->GetData(); - width = bm->GetWidth(); - height = bm->GetHeight(); - - return true; -} - -bool wxGenericImageList::Draw( int index, wxDC &dc, int x, int y, - int flags, bool WXUNUSED(solidBackground) ) -{ - wxList::compatibility_iterator node = m_images.Item( index ); - - wxCHECK_MSG( node, false, wxT("wrong index in image list") ); - - wxBitmap *bm = (wxBitmap*)node->GetData(); - - if (bm->IsKindOf(CLASSINFO(wxIcon))) - dc.DrawIcon( * ((wxIcon*) bm), x, y); - else - dc.DrawBitmap( *bm, x, y, (flags & wxIMAGELIST_DRAW_TRANSPARENT) > 0 ); - - return true; -} - -#endif // __WXPALMOS__ - -#endif // wxUSE_IMAGLIST diff --git a/wxWidgets/src/generic/laywin.cpp b/wxWidgets/src/generic/laywin.cpp deleted file mode 100644 index bebc89d469..0000000000 --- a/wxWidgets/src/generic/laywin.cpp +++ /dev/null @@ -1,341 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: laywin.cpp -// Purpose: Implements a simple layout algorithm, plus -// wxSashLayoutWindow which is an example of a window with -// layout-awareness (via event handlers). This is suited to -// IDE-style window layout. -// Author: Julian Smart -// Modified by: -// Created: 04/01/98 -// RCS-ID: $Id: laywin.cpp 35688 2005-09-25 19:59:19Z VZ $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// For compilers that support precompilation, includes "wx/wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ -#pragma hdrstop -#endif - -#ifndef WX_PRECOMP - #include "wx/frame.h" - #include "wx/mdi.h" -#endif - -#include "wx/laywin.h" - -IMPLEMENT_DYNAMIC_CLASS(wxQueryLayoutInfoEvent, wxEvent) -IMPLEMENT_DYNAMIC_CLASS(wxCalculateLayoutEvent, wxEvent) - -DEFINE_EVENT_TYPE(wxEVT_QUERY_LAYOUT_INFO) -DEFINE_EVENT_TYPE(wxEVT_CALCULATE_LAYOUT) - -#if wxUSE_SASH -IMPLEMENT_CLASS(wxSashLayoutWindow, wxSashWindow) - -BEGIN_EVENT_TABLE(wxSashLayoutWindow, wxSashWindow) - EVT_CALCULATE_LAYOUT(wxSashLayoutWindow::OnCalculateLayout) - EVT_QUERY_LAYOUT_INFO(wxSashLayoutWindow::OnQueryLayoutInfo) -END_EVENT_TABLE() - -bool wxSashLayoutWindow::Create(wxWindow *parent, wxWindowID id, const wxPoint& pos, - const wxSize& size, long style, const wxString& name) -{ - return wxSashWindow::Create(parent, id, pos, size, style, name); -} - -void wxSashLayoutWindow::Init() -{ - m_orientation = wxLAYOUT_HORIZONTAL; - m_alignment = wxLAYOUT_TOP; -#ifdef __WXMAC__ - MacSetClipChildren( true ) ; -#endif -} - -// This is the function that wxLayoutAlgorithm calls to ascertain the window -// dimensions. -void wxSashLayoutWindow::OnQueryLayoutInfo(wxQueryLayoutInfoEvent& event) -{ - // int flags = event.GetFlags(); - int requestedLength = event.GetRequestedLength(); - - event.SetOrientation(m_orientation); - event.SetAlignment(m_alignment); - - if (m_orientation == wxLAYOUT_HORIZONTAL) - event.SetSize(wxSize(requestedLength, m_defaultSize.y)); - else - event.SetSize(wxSize(m_defaultSize.x, requestedLength)); -} - -// Called by parent to allow window to take a bit out of the -// client rectangle, and size itself if not in wxLAYOUT_QUERY mode. - -void wxSashLayoutWindow::OnCalculateLayout(wxCalculateLayoutEvent& event) -{ - wxRect clientSize(event.GetRect()); - - int flags = event.GetFlags(); - - if (!IsShown()) - return; - - // Let's assume that all windows stretch the full extent of the window in - // the direction of that window orientation. This will work for non-docking toolbars, - // and the status bar. Note that the windows have to have been created in a certain - // order to work, else you might get a left-aligned window going to the bottom - // of the window, and the status bar appearing to the right of it. The - // status bar would have to be created after or before the toolbar(s). - - wxRect thisRect; - - // Try to stretch - int length = (GetOrientation() == wxLAYOUT_HORIZONTAL) ? clientSize.width : clientSize.height; - wxLayoutOrientation orient = GetOrientation(); - - // We assume that a window that says it's horizontal, wants to be stretched in that - // direction. Is this distinction too fine? Do we assume that any horizontal - // window needs to be stretched in that direction? Possibly. - int whichDimension = (GetOrientation() == wxLAYOUT_HORIZONTAL) ? wxLAYOUT_LENGTH_X : wxLAYOUT_LENGTH_Y; - - wxQueryLayoutInfoEvent infoEvent(GetId()); - infoEvent.SetEventObject(this); - infoEvent.SetRequestedLength(length); - infoEvent.SetFlags(orient | whichDimension); - - if (!GetEventHandler()->ProcessEvent(infoEvent)) - return; - - wxSize sz = infoEvent.GetSize(); - - if (sz.x == 0 && sz.y == 0) // Assume it's invisible - return; - - // Now we know the size it wants to be. We wish to decide where to place it, i.e. - // how it's aligned. - switch (GetAlignment()) - { - case wxLAYOUT_TOP: - { - thisRect.x = clientSize.x; thisRect.y = clientSize.y; - thisRect.width = sz.x; thisRect.height = sz.y; - clientSize.y += thisRect.height; - clientSize.height -= thisRect.height; - break; - } - case wxLAYOUT_LEFT: - { - thisRect.x = clientSize.x; thisRect.y = clientSize.y; - thisRect.width = sz.x; thisRect.height = sz.y; - clientSize.x += thisRect.width; - clientSize.width -= thisRect.width; - break; - } - case wxLAYOUT_RIGHT: - { - thisRect.x = clientSize.x + (clientSize.width - sz.x); thisRect.y = clientSize.y; - thisRect.width = sz.x; thisRect.height = sz.y; - clientSize.width -= thisRect.width; - break; - } - case wxLAYOUT_BOTTOM: - { - thisRect.x = clientSize.x; thisRect.y = clientSize.y + (clientSize.height - sz.y); - thisRect.width = sz.x; thisRect.height = sz.y; - clientSize.height -= thisRect.height; - break; - } - case wxLAYOUT_NONE: - { - break; - } - - } - - if ((flags & wxLAYOUT_QUERY) == 0) - { - // If not in query mode, resize the window. - // TODO: add wxRect& form to wxWindow::SetSize - wxSize sz2 = GetSize(); - wxPoint pos = GetPosition(); - SetSize(thisRect.x, thisRect.y, thisRect.width, thisRect.height); - - // Make sure the sash is erased when the window is resized - if ((pos.x != thisRect.x || pos.y != thisRect.y || sz2.x != thisRect.width || sz2.y != thisRect.height) && - (GetSashVisible(wxSASH_TOP) || GetSashVisible(wxSASH_RIGHT) || GetSashVisible(wxSASH_BOTTOM) || GetSashVisible(wxSASH_LEFT))) - Refresh(true); - - } - - event.SetRect(clientSize); -} -#endif // wxUSE_SASH - -/* - * wxLayoutAlgorithm - */ - -#if wxUSE_MDI_ARCHITECTURE - -// Lays out windows for an MDI frame. The MDI client area gets what's left -// over. -bool wxLayoutAlgorithm::LayoutMDIFrame(wxMDIParentFrame* frame, wxRect* r) -{ - int cw, ch; - frame->GetClientSize(& cw, & ch); - - wxRect rect(0, 0, cw, ch); - if (r) - rect = * r; - - wxCalculateLayoutEvent event; - event.SetRect(rect); - - wxWindowList::compatibility_iterator node = frame->GetChildren().GetFirst(); - while (node) - { - wxWindow* win = node->GetData(); - - event.SetId(win->GetId()); - event.SetEventObject(win); - event.SetFlags(0); // ?? - - win->GetEventHandler()->ProcessEvent(event); - - node = node->GetNext(); - } - - wxWindow* clientWindow = frame->GetClientWindow(); - - rect = event.GetRect(); - - clientWindow->SetSize(rect.x, rect.y, rect.width, rect.height); - - return true; -} - -#endif // wxUSE_MDI_ARCHITECTURE - -bool wxLayoutAlgorithm::LayoutFrame(wxFrame* frame, wxWindow* mainWindow) -{ - return LayoutWindow(frame, mainWindow); -} - -// Layout algorithm for any window. mainWindow gets what's left over. -bool wxLayoutAlgorithm::LayoutWindow(wxWindow* parent, wxWindow* mainWindow) -{ - // Test if the parent is a sash window, and if so, - // reduce the available space to allow space for any active edges. - - int leftMargin = 0, rightMargin = 0, topMargin = 0, bottomMargin = 0; -#if wxUSE_SASH - if (parent->IsKindOf(CLASSINFO(wxSashWindow))) - { - wxSashWindow* sashWindow = (wxSashWindow*) parent; - - leftMargin = sashWindow->GetExtraBorderSize(); - rightMargin = sashWindow->GetExtraBorderSize(); - topMargin = sashWindow->GetExtraBorderSize(); - bottomMargin = sashWindow->GetExtraBorderSize(); - - if (sashWindow->GetSashVisible(wxSASH_LEFT)) - leftMargin += sashWindow->GetDefaultBorderSize(); - if (sashWindow->GetSashVisible(wxSASH_RIGHT)) - rightMargin += sashWindow->GetDefaultBorderSize(); - if (sashWindow->GetSashVisible(wxSASH_TOP)) - topMargin += sashWindow->GetDefaultBorderSize(); - if (sashWindow->GetSashVisible(wxSASH_BOTTOM)) - bottomMargin += sashWindow->GetDefaultBorderSize(); - } -#endif // wxUSE_SASH - - int cw, ch; - parent->GetClientSize(& cw, & ch); - - wxRect rect(leftMargin, topMargin, cw - leftMargin - rightMargin, ch - topMargin - bottomMargin); - - wxCalculateLayoutEvent event; - event.SetRect(rect); - - // Find the last layout-aware window, so we can make it fill all remaining - // space. - wxWindow *lastAwareWindow = NULL; - wxWindowList::compatibility_iterator node = parent->GetChildren().GetFirst(); - - while (node) - { - wxWindow* win = node->GetData(); - - if (win->IsShown()) - { - wxCalculateLayoutEvent tempEvent(win->GetId()); - tempEvent.SetEventObject(win); - tempEvent.SetFlags(wxLAYOUT_QUERY); - tempEvent.SetRect(event.GetRect()); - if (win->GetEventHandler()->ProcessEvent(tempEvent)) - lastAwareWindow = win; - } - - node = node->GetNext(); - } - - // Now do a dummy run to see if we have any space left for the final window (fail if not) - node = parent->GetChildren().GetFirst(); - while (node) - { - wxWindow* win = node->GetData(); - - // If mainWindow is NULL and we're at the last window, - // skip this, because we'll simply make it fit the remaining space. - if (win->IsShown() && (win != mainWindow) && (mainWindow != NULL || win != lastAwareWindow)) - { - event.SetId(win->GetId()); - event.SetEventObject(win); - event.SetFlags(wxLAYOUT_QUERY); - - win->GetEventHandler()->ProcessEvent(event); - } - - node = node->GetNext(); - } - - if (event.GetRect().GetWidth() < 0 || event.GetRect().GetHeight() < 0) - return false; - - event.SetRect(rect); - - node = parent->GetChildren().GetFirst(); - while (node) - { - wxWindow* win = node->GetData(); - - // If mainWindow is NULL and we're at the last window, - // skip this, because we'll simply make it fit the remaining space. - if (win->IsShown() && (win != mainWindow) && (mainWindow != NULL || win != lastAwareWindow)) - { - event.SetId(win->GetId()); - event.SetEventObject(win); - event.SetFlags(0); // ?? - - win->GetEventHandler()->ProcessEvent(event); - } - - node = node->GetNext(); - } - - rect = event.GetRect(); - - if (mainWindow) - mainWindow->SetSize(rect.x, rect.y, wxMax(0, rect.width), wxMax(0, rect.height)); - else if (lastAwareWindow) - { - // Fit the remaining space - lastAwareWindow->SetSize(rect.x, rect.y, wxMax(0, rect.width), wxMax(0, rect.height)); - } - - return true; -} - diff --git a/wxWidgets/src/generic/listbkg.cpp b/wxWidgets/src/generic/listbkg.cpp deleted file mode 100644 index ef95d2652b..0000000000 --- a/wxWidgets/src/generic/listbkg.cpp +++ /dev/null @@ -1,416 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: src/generic/listbkg.cpp -// Purpose: generic implementation of wxListbook -// Author: Vadim Zeitlin -// Modified by: -// Created: 19.08.03 -// RCS-ID: $Id: listbkg.cpp 48783 2007-09-19 11:24:38Z RR $ -// Copyright: (c) 2003 Vadim Zeitlin -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_LISTBOOK - -#include "wx/listbook.h" - -#ifndef WX_PRECOMP - #include "wx/settings.h" -#endif - -#include "wx/listctrl.h" -#include "wx/statline.h" -#include "wx/imaglist.h" - -// ---------------------------------------------------------------------------- -// various wxWidgets macros -// ---------------------------------------------------------------------------- - -// check that the page index is valid -#define IS_VALID_PAGE(nPage) ((nPage) < GetPageCount()) - -// ---------------------------------------------------------------------------- -// event table -// ---------------------------------------------------------------------------- - -IMPLEMENT_DYNAMIC_CLASS(wxListbook, wxBookCtrlBase) -IMPLEMENT_DYNAMIC_CLASS(wxListbookEvent, wxNotifyEvent) - -#if !WXWIN_COMPATIBILITY_EVENT_TYPES -const wxEventType wxEVT_COMMAND_LISTBOOK_PAGE_CHANGING = wxNewEventType(); -const wxEventType wxEVT_COMMAND_LISTBOOK_PAGE_CHANGED = wxNewEventType(); -#endif - -BEGIN_EVENT_TABLE(wxListbook, wxBookCtrlBase) - EVT_SIZE(wxListbook::OnSize) - EVT_LIST_ITEM_SELECTED(wxID_ANY, wxListbook::OnListSelected) -END_EVENT_TABLE() - -// ============================================================================ -// wxListbook implementation -// ============================================================================ - -// ---------------------------------------------------------------------------- -// wxListbook creation -// ---------------------------------------------------------------------------- - -void wxListbook::Init() -{ - m_selection = wxNOT_FOUND; -} - -bool -wxListbook::Create(wxWindow *parent, - wxWindowID id, - const wxPoint& pos, - const wxSize& size, - long style, - const wxString& name) -{ - if ( (style & wxBK_ALIGN_MASK) == wxBK_DEFAULT ) - { -#ifdef __WXMAC__ - style |= wxBK_TOP; -#else // !__WXMAC__ - style |= wxBK_LEFT; -#endif // __WXMAC__/!__WXMAC__ - } - - // no border for this control, it doesn't look nice together with - // wxListCtrl border - style &= ~wxBORDER_MASK; - style |= wxBORDER_NONE; - - if ( !wxControl::Create(parent, id, pos, size, style, - wxDefaultValidator, name) ) - return false; - - m_bookctrl = new wxListView - ( - this, - wxID_ANY, - wxDefaultPosition, - wxDefaultSize, - wxLC_ICON | wxLC_SINGLE_SEL | - (IsVertical() ? wxLC_ALIGN_LEFT : wxLC_ALIGN_TOP) - ); - -#ifdef __WXMSW__ - // On XP with themes enabled the GetViewRect used in GetControllerSize() to - // determine the space needed for the list view will incorrectly return - // (0,0,0,0) the first time. So send a pending event so OnSize will be - // called again after the window is ready to go. Technically we don't - // need to do this on non-XP windows, but if things are already sized - // correctly then nothing changes and so there is no harm. - wxSizeEvent evt; - GetEventHandler()->AddPendingEvent(evt); -#endif - return true; -} - -// ---------------------------------------------------------------------------- -// wxListbook geometry management -// ---------------------------------------------------------------------------- - -wxSize wxListbook::GetControllerSize() const -{ - const wxSize sizeClient = GetClientSize(), - sizeBorder = m_bookctrl->GetSize() - m_bookctrl->GetClientSize(), - sizeList = GetListView()->GetViewRect().GetSize() + sizeBorder; - - wxSize size; - - if ( IsVertical() ) - { - size.x = sizeClient.x; - size.y = sizeList.y; - } - else // left/right aligned - { - size.x = sizeList.x; - size.y = sizeClient.y; - } - - return size; -} - -void wxListbook::OnSize(wxSizeEvent& event) -{ - // arrange the icons before calling SetClientSize(), otherwise it wouldn't - // account for the scrollbars the list control might need and, at least - // under MSW, we'd finish with an ugly looking list control with both - // vertical and horizontal scrollbar (with one of them being added because - // the other one is not accounted for in client size computations) - wxListView *list = GetListView(); - if (list) list->Arrange(); - wxBookCtrlBase::OnSize(event); -} - -int wxListbook::HitTest(const wxPoint& pt, long *flags) const -{ - int pagePos = wxNOT_FOUND; - - if ( flags ) - *flags = wxBK_HITTEST_NOWHERE; - - // convert from listbook control coordinates to list control coordinates - const wxListView * const list = GetListView(); - const wxPoint listPt = list->ScreenToClient(ClientToScreen(pt)); - - // is the point inside list control? - if ( wxRect(list->GetSize()).Contains(listPt) ) - { - int flagsList; - pagePos = list->HitTest(listPt, flagsList); - - if ( flags ) - { - if ( pagePos != wxNOT_FOUND ) - *flags = 0; - - if ( flagsList & (wxLIST_HITTEST_ONITEMICON | - wxLIST_HITTEST_ONITEMSTATEICON ) ) - *flags |= wxBK_HITTEST_ONICON; - - if ( flagsList & wxLIST_HITTEST_ONITEMLABEL ) - *flags |= wxBK_HITTEST_ONLABEL; - } - } - else // not over list control at all - { - if ( flags && GetPageRect().Contains(pt) ) - *flags |= wxBK_HITTEST_ONPAGE; - } - - return pagePos; -} - -wxSize wxListbook::CalcSizeFromPage(const wxSize& sizePage) const -{ - // we need to add the size of the list control and the border between - const wxSize sizeList = GetControllerSize(); - - wxSize size = sizePage; - if ( IsVertical() ) - { - size.y += sizeList.y + GetInternalBorder(); - } - else // left/right aligned - { - size.x += sizeList.x + GetInternalBorder(); - } - - return size; -} - - -// ---------------------------------------------------------------------------- -// accessing the pages -// ---------------------------------------------------------------------------- - -bool wxListbook::SetPageText(size_t n, const wxString& strText) -{ - GetListView()->SetItemText(n, strText); - - return true; -} - -wxString wxListbook::GetPageText(size_t n) const -{ - return GetListView()->GetItemText(n); -} - -int wxListbook::GetPageImage(size_t WXUNUSED(n)) const -{ - wxFAIL_MSG( _T("wxListbook::GetPageImage() not implemented") ); - - return wxNOT_FOUND; -} - -bool wxListbook::SetPageImage(size_t n, int imageId) -{ - return GetListView()->SetItemImage(n, imageId); -} - -// ---------------------------------------------------------------------------- -// image list stuff -// ---------------------------------------------------------------------------- - -void wxListbook::SetImageList(wxImageList *imageList) -{ - GetListView()->SetImageList(imageList, wxIMAGE_LIST_NORMAL); - - wxBookCtrlBase::SetImageList(imageList); -} - -// ---------------------------------------------------------------------------- -// selection -// ---------------------------------------------------------------------------- - -void wxListbook::UpdateSelectedPage(size_t newsel) -{ - m_selection = newsel; - GetListView()->Select(newsel); - GetListView()->Focus(newsel); -} - -int wxListbook::GetSelection() const -{ - return m_selection; -} - -wxBookCtrlBaseEvent* wxListbook::CreatePageChangingEvent() const -{ - return new wxListbookEvent(wxEVT_COMMAND_LISTBOOK_PAGE_CHANGING, m_windowId); -} - -void wxListbook::MakeChangedEvent(wxBookCtrlBaseEvent &event) -{ - event.SetEventType(wxEVT_COMMAND_LISTBOOK_PAGE_CHANGED); -} - - -// ---------------------------------------------------------------------------- -// adding/removing the pages -// ---------------------------------------------------------------------------- - -bool -wxListbook::InsertPage(size_t n, - wxWindow *page, - const wxString& text, - bool bSelect, - int imageId) -{ - if ( !wxBookCtrlBase::InsertPage(n, page, text, bSelect, imageId) ) - return false; - - GetListView()->InsertItem(n, text, imageId); - - // if the inserted page is before the selected one, we must update the - // index of the selected page - if ( int(n) <= m_selection ) - { - // one extra page added - m_selection++; - GetListView()->Select(m_selection); - GetListView()->Focus(m_selection); - } - - // some page should be selected: either this one or the first one if there - // is still no selection - int selNew = -1; - if ( bSelect ) - selNew = n; - else if ( m_selection == -1 ) - selNew = 0; - - if ( selNew != m_selection ) - page->Hide(); - - if ( selNew != -1 ) - SetSelection(selNew); - - wxSizeEvent sz(GetSize(), GetId()); - GetEventHandler()->ProcessEvent(sz); - - return true; -} - -wxWindow *wxListbook::DoRemovePage(size_t page) -{ - const size_t page_count = GetPageCount(); - wxWindow *win = wxBookCtrlBase::DoRemovePage(page); - - if ( win ) - { - GetListView()->DeleteItem(page); - - if (m_selection >= (int)page) - { - // force new sel valid if possible - int sel = m_selection - 1; - if (page_count == 1) - sel = wxNOT_FOUND; - else if ((page_count == 2) || (sel == -1)) - sel = 0; - - // force sel invalid if deleting current page - don't try to hide it - m_selection = (m_selection == (int)page) ? wxNOT_FOUND : m_selection - 1; - - if ((sel != wxNOT_FOUND) && (sel != m_selection)) - SetSelection(sel); - } - - GetListView()->Arrange(); - if (GetPageCount() == 0) - { - wxSizeEvent sz(GetSize(), GetId()); - ProcessEvent(sz); - } - } - - return win; -} - - -bool wxListbook::DeleteAllPages() -{ - GetListView()->DeleteAllItems(); - if (!wxBookCtrlBase::DeleteAllPages()) - return false; - - m_selection = -1; - - wxSizeEvent sz(GetSize(), GetId()); - ProcessEvent(sz); - - return true; -} - -// ---------------------------------------------------------------------------- -// wxListbook events -// ---------------------------------------------------------------------------- - -void wxListbook::OnListSelected(wxListEvent& eventList) -{ - if ( eventList.GetEventObject() != m_bookctrl ) - { - eventList.Skip(); - return; - } - - const int selNew = eventList.GetIndex(); - - if ( selNew == m_selection ) - { - // this event can only come from our own Select(m_selection) below - // which we call when the page change is vetoed, so we should simply - // ignore it - return; - } - - SetSelection(selNew); - - // change wasn't allowed, return to previous state - if (m_selection != selNew) - { - GetListView()->Select(m_selection); - GetListView()->Focus(m_selection); - } -} - -#endif // wxUSE_LISTBOOK diff --git a/wxWidgets/src/generic/listctrl.cpp b/wxWidgets/src/generic/listctrl.cpp deleted file mode 100644 index 65fb9b9ec5..0000000000 --- a/wxWidgets/src/generic/listctrl.cpp +++ /dev/null @@ -1,5976 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/generic/listctrl.cpp -// Purpose: generic implementation of wxListCtrl -// Author: Robert Roebling -// Vadim Zeitlin (virtual list control support) -// Id: $Id: listctrl.cpp 67017 2011-02-25 09:37:28Z JS $ -// Copyright: (c) 1998 Robert Roebling -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// TODO -// -// 1. we need to implement searching/sorting for virtual controls somehow -// 2. when changing selection the lines are refreshed twice - - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_LISTCTRL - -#include "wx/listctrl.h" - -#if (!defined(__WXMSW__) || defined(__WXUNIVERSAL__)) && (!defined(__WXMAC__)|| defined(__WXUNIVERSAL__)) - // if we have a native version, its implementation file does all this - IMPLEMENT_DYNAMIC_CLASS(wxListItem, wxObject) - IMPLEMENT_DYNAMIC_CLASS(wxListView, wxListCtrl) - IMPLEMENT_DYNAMIC_CLASS(wxListEvent, wxNotifyEvent) - - IMPLEMENT_DYNAMIC_CLASS(wxListCtrl, wxGenericListCtrl) -#endif - -#ifndef WX_PRECOMP - #include "wx/scrolwin.h" - #include "wx/timer.h" - #include "wx/settings.h" - #include "wx/dynarray.h" - #include "wx/dcclient.h" - #include "wx/dcscreen.h" - #include "wx/math.h" -#endif - -#include "wx/imaglist.h" -#include "wx/selstore.h" -#include "wx/renderer.h" - -#ifdef __WXMAC__ - #include "wx/mac/private.h" -#endif - - -// NOTE: If using the wxListBox visual attributes works everywhere then this can -// be removed, as well as the #else case below. -#define _USE_VISATTR 0 - - -// ---------------------------------------------------------------------------- -// constants -// ---------------------------------------------------------------------------- - -// // the height of the header window (FIXME: should depend on its font!) -// static const int HEADER_HEIGHT = 23; - -static const int SCROLL_UNIT_X = 15; - -// the spacing between the lines (in report mode) -static const int LINE_SPACING = 0; - -// extra margins around the text label -#ifdef __WXGTK__ -static const int EXTRA_WIDTH = 6; -#else -static const int EXTRA_WIDTH = 4; -#endif -static const int EXTRA_HEIGHT = 4; - -// margin between the window and the items -static const int EXTRA_BORDER_X = 2; -static const int EXTRA_BORDER_Y = 2; - -// offset for the header window -static const int HEADER_OFFSET_X = 0; -static const int HEADER_OFFSET_Y = 0; - -// margin between rows of icons in [small] icon view -static const int MARGIN_BETWEEN_ROWS = 6; - -// when autosizing the columns, add some slack -static const int AUTOSIZE_COL_MARGIN = 10; - -// default width for the header columns -static const int WIDTH_COL_DEFAULT = 80; - -// the space between the image and the text in the report mode -static const int IMAGE_MARGIN_IN_REPORT_MODE = 5; - -// the space between the image and the text in the report mode in header -static const int HEADER_IMAGE_MARGIN_IN_REPORT_MODE = 2; - -// ============================================================================ -// private classes -// ============================================================================ - -//----------------------------------------------------------------------------- -// wxColWidthInfo (internal) -//----------------------------------------------------------------------------- - -struct wxColWidthInfo -{ - int nMaxWidth; - bool bNeedsUpdate; // only set to true when an item whose - // width == nMaxWidth is removed - - wxColWidthInfo(int w = 0, bool needsUpdate = false) - { - nMaxWidth = w; - bNeedsUpdate = needsUpdate; - } -}; - -WX_DEFINE_ARRAY_PTR(wxColWidthInfo *, ColWidthArray); - -//----------------------------------------------------------------------------- -// wxListItemData (internal) -//----------------------------------------------------------------------------- - -class wxListItemData -{ -public: - wxListItemData(wxListMainWindow *owner); - ~wxListItemData(); - - void SetItem( const wxListItem &info ); - void SetImage( int image ) { m_image = image; } - void SetData( wxUIntPtr data ) { m_data = data; } - void SetPosition( int x, int y ); - void SetSize( int width, int height ); - - bool HasText() const { return !m_text.empty(); } - const wxString& GetText() const { return m_text; } - void SetText(const wxString& text) { m_text = text; } - - // we can't use empty string for measuring the string width/height, so - // always return something - wxString GetTextForMeasuring() const - { - wxString s = GetText(); - if ( s.empty() ) - s = _T('H'); - - return s; - } - - bool IsHit( int x, int y ) const; - - int GetX() const; - int GetY() const; - int GetWidth() const; - int GetHeight() const; - - int GetImage() const { return m_image; } - bool HasImage() const { return GetImage() != -1; } - - void GetItem( wxListItem &info ) const; - - void SetAttr(wxListItemAttr *attr) { m_attr = attr; } - wxListItemAttr *GetAttr() const { return m_attr; } - -public: - // the item image or -1 - int m_image; - - // user data associated with the item - wxUIntPtr m_data; - - // the item coordinates are not used in report mode; instead this pointer is - // NULL and the owner window is used to retrieve the item position and size - wxRect *m_rect; - - // the list ctrl we are in - wxListMainWindow *m_owner; - - // custom attributes or NULL - wxListItemAttr *m_attr; - -protected: - // common part of all ctors - void Init(); - - wxString m_text; -}; - -//----------------------------------------------------------------------------- -// wxListHeaderData (internal) -//----------------------------------------------------------------------------- - -class wxListHeaderData : public wxObject -{ -public: - wxListHeaderData(); - wxListHeaderData( const wxListItem &info ); - void SetItem( const wxListItem &item ); - void SetPosition( int x, int y ); - void SetWidth( int w ); - void SetState( int state ); - void SetFormat( int format ); - void SetHeight( int h ); - bool HasImage() const; - - bool HasText() const { return !m_text.empty(); } - const wxString& GetText() const { return m_text; } - void SetText(const wxString& text) { m_text = text; } - - void GetItem( wxListItem &item ); - - bool IsHit( int x, int y ) const; - int GetImage() const; - int GetWidth() const; - int GetFormat() const; - int GetState() const; - -protected: - long m_mask; - int m_image; - wxString m_text; - int m_format; - int m_width; - int m_xpos, - m_ypos; - int m_height; - int m_state; - -private: - void Init(); -}; - -//----------------------------------------------------------------------------- -// wxListLineData (internal) -//----------------------------------------------------------------------------- - -WX_DECLARE_EXPORTED_LIST(wxListItemData, wxListItemDataList); -#include "wx/listimpl.cpp" -WX_DEFINE_LIST(wxListItemDataList) - -class wxListLineData -{ -public: - // the list of subitems: only may have more than one item in report mode - wxListItemDataList m_items; - - // this is not used in report view - struct GeometryInfo - { - // total item rect - wxRect m_rectAll; - - // label only - wxRect m_rectLabel; - - // icon only - wxRect m_rectIcon; - - // the part to be highlighted - wxRect m_rectHighlight; - - // extend all our rects to be centered inside the one of given width - void ExtendWidth(wxCoord w) - { - wxASSERT_MSG( m_rectAll.width <= w, - _T("width can only be increased") ); - - m_rectAll.width = w; - m_rectLabel.x = m_rectAll.x + (w - m_rectLabel.width) / 2; - m_rectIcon.x = m_rectAll.x + (w - m_rectIcon.width) / 2; - m_rectHighlight.x = m_rectAll.x + (w - m_rectHighlight.width) / 2; - } - } - *m_gi; - - // is this item selected? [NB: not used in virtual mode] - bool m_highlighted; - - // back pointer to the list ctrl - wxListMainWindow *m_owner; - -public: - wxListLineData(wxListMainWindow *owner); - - ~wxListLineData() - { - WX_CLEAR_LIST(wxListItemDataList, m_items); - delete m_gi; - } - - // are we in report mode? - inline bool InReportView() const; - - // are we in virtual report mode? - inline bool IsVirtual() const; - - // these 2 methods shouldn't be called for report view controls, in that - // case we determine our position/size ourselves - - // calculate the size of the line - void CalculateSize( wxDC *dc, int spacing ); - - // remember the position this line appears at - void SetPosition( int x, int y, int spacing ); - - // wxListCtrl API - - void SetImage( int image ) { SetImage(0, image); } - int GetImage() const { return GetImage(0); } - void SetImage( int index, int image ); - int GetImage( int index ) const; - - bool HasImage() const { return GetImage() != -1; } - bool HasText() const { return !GetText(0).empty(); } - - void SetItem( int index, const wxListItem &info ); - void GetItem( int index, wxListItem &info ); - - wxString GetText(int index) const; - void SetText( int index, const wxString& s ); - - wxListItemAttr *GetAttr() const; - void SetAttr(wxListItemAttr *attr); - - // return true if the highlighting really changed - bool Highlight( bool on ); - - void ReverseHighlight(); - - bool IsHighlighted() const - { - wxASSERT_MSG( !IsVirtual(), _T("unexpected call to IsHighlighted") ); - - return m_highlighted; - } - - // draw the line on the given DC in icon/list mode - void Draw( wxDC *dc ); - - // the same in report mode - void DrawInReportMode( wxDC *dc, - const wxRect& rect, - const wxRect& rectHL, - bool highlighted ); - -private: - // set the line to contain num items (only can be > 1 in report mode) - void InitItems( int num ); - - // get the mode (i.e. style) of the list control - inline int GetMode() const; - - // prepare the DC for drawing with these item's attributes, return true if - // we need to draw the items background to highlight it, false otherwise - bool SetAttributes(wxDC *dc, - const wxListItemAttr *attr, - bool highlight); - - // draw the text on the DC with the correct justification; also add an - // ellipsis if the text is too large to fit in the current width - void DrawTextFormatted(wxDC *dc, - const wxString &text, - int col, - int x, - int yMid, // this is middle, not top, of the text - int width); -}; - -WX_DECLARE_EXPORTED_OBJARRAY(wxListLineData, wxListLineDataArray); -#include "wx/arrimpl.cpp" -WX_DEFINE_OBJARRAY(wxListLineDataArray) - -//----------------------------------------------------------------------------- -// wxListHeaderWindow (internal) -//----------------------------------------------------------------------------- - -class wxListHeaderWindow : public wxWindow -{ -protected: - wxListMainWindow *m_owner; - const wxCursor *m_currentCursor; - wxCursor *m_resizeCursor; - bool m_isDragging; - - // column being resized or -1 - int m_column; - - // divider line position in logical (unscrolled) coords - int m_currentX; - - // minimal position beyond which the divider line - // can't be dragged in logical coords - int m_minX; - -public: - wxListHeaderWindow(); - - wxListHeaderWindow( wxWindow *win, - wxWindowID id, - wxListMainWindow *owner, - const wxPoint &pos = wxDefaultPosition, - const wxSize &size = wxDefaultSize, - long style = 0, - const wxString &name = wxT("wxlistctrlcolumntitles") ); - - virtual ~wxListHeaderWindow(); - - void DrawCurrent(); - void AdjustDC( wxDC& dc ); - - void OnPaint( wxPaintEvent &event ); - void OnMouse( wxMouseEvent &event ); - void OnSetFocus( wxFocusEvent &event ); - - // needs refresh - bool m_dirty; - -private: - // common part of all ctors - void Init(); - - // generate and process the list event of the given type, return true if - // it wasn't vetoed, i.e. if we should proceed - bool SendListEvent(wxEventType type, const wxPoint& pos); - - DECLARE_DYNAMIC_CLASS(wxListHeaderWindow) - DECLARE_EVENT_TABLE() -}; - -//----------------------------------------------------------------------------- -// wxListRenameTimer (internal) -//----------------------------------------------------------------------------- - -class wxListRenameTimer: public wxTimer -{ -private: - wxListMainWindow *m_owner; - -public: - wxListRenameTimer( wxListMainWindow *owner ); - void Notify(); -}; - -//----------------------------------------------------------------------------- -// wxListTextCtrlWrapper: wraps a wxTextCtrl to make it work for inline editing -//----------------------------------------------------------------------------- - -class wxListTextCtrlWrapper : public wxEvtHandler -{ -public: - // NB: text must be a valid object but not Create()d yet - wxListTextCtrlWrapper(wxListMainWindow *owner, - wxTextCtrl *text, - size_t itemEdit); - - wxTextCtrl *GetText() const { return m_text; } - - void AcceptChangesAndFinish(); - -protected: - void OnChar( wxKeyEvent &event ); - void OnKeyUp( wxKeyEvent &event ); - void OnKillFocus( wxFocusEvent &event ); - - bool AcceptChanges(); - void Finish(); - -private: - wxListMainWindow *m_owner; - wxTextCtrl *m_text; - wxString m_startValue; - size_t m_itemEdited; - bool m_finished; - bool m_aboutToFinish; - - DECLARE_EVENT_TABLE() -}; - -//----------------------------------------------------------------------------- -// wxListMainWindow (internal) -//----------------------------------------------------------------------------- - -WX_DECLARE_EXPORTED_LIST(wxListHeaderData, wxListHeaderDataList); -#include "wx/listimpl.cpp" -WX_DEFINE_LIST(wxListHeaderDataList) - -class wxListMainWindow : public wxScrolledWindow -{ -public: - wxListMainWindow(); - wxListMainWindow( wxWindow *parent, - wxWindowID id, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = 0, - const wxString &name = _T("listctrlmainwindow") ); - - virtual ~wxListMainWindow(); - - bool HasFlag(int flag) const { return m_parent->HasFlag(flag); } - - // return true if this is a virtual list control - bool IsVirtual() const { return HasFlag(wxLC_VIRTUAL); } - - // return true if the control is in report mode - bool InReportView() const { return HasFlag(wxLC_REPORT); } - - // return true if we are in single selection mode, false if multi sel - bool IsSingleSel() const { return HasFlag(wxLC_SINGLE_SEL); } - - // do we have a header window? - bool HasHeader() const - { return InReportView() && !HasFlag(wxLC_NO_HEADER); } - - void HighlightAll( bool on ); - - // all these functions only do something if the line is currently visible - - // change the line "selected" state, return true if it really changed - bool HighlightLine( size_t line, bool highlight = true); - - // as HighlightLine() but do it for the range of lines: this is incredibly - // more efficient for virtual list controls! - // - // NB: unlike HighlightLine() this one does refresh the lines on screen - void HighlightLines( size_t lineFrom, size_t lineTo, bool on = true ); - - // toggle the line state and refresh it - void ReverseHighlight( size_t line ) - { HighlightLine(line, !IsHighlighted(line)); RefreshLine(line); } - - // return true if the line is highlighted - bool IsHighlighted(size_t line) const; - - // refresh one or several lines at once - void RefreshLine( size_t line ); - void RefreshLines( size_t lineFrom, size_t lineTo ); - - // refresh all selected items - void RefreshSelected(); - - // refresh all lines below the given one: the difference with - // RefreshLines() is that the index here might not be a valid one (happens - // when the last line is deleted) - void RefreshAfter( size_t lineFrom ); - - // the methods which are forwarded to wxListLineData itself in list/icon - // modes but are here because the lines don't store their positions in the - // report mode - - // get the bound rect for the entire line - wxRect GetLineRect(size_t line) const; - - // get the bound rect of the label - wxRect GetLineLabelRect(size_t line) const; - - // get the bound rect of the items icon (only may be called if we do have - // an icon!) - wxRect GetLineIconRect(size_t line) const; - - // get the rect to be highlighted when the item has focus - wxRect GetLineHighlightRect(size_t line) const; - - // get the size of the total line rect - wxSize GetLineSize(size_t line) const - { return GetLineRect(line).GetSize(); } - - // return the hit code for the corresponding position (in this line) - long HitTestLine(size_t line, int x, int y) const; - - // bring the selected item into view, scrolling to it if necessary - void MoveToItem(size_t item); - - bool ScrollList( int WXUNUSED(dx), int dy ); - - // bring the current item into view - void MoveToFocus() { MoveToItem(m_current); } - - // start editing the label of the given item - wxTextCtrl *EditLabel(long item, - wxClassInfo* textControlClass = CLASSINFO(wxTextCtrl)); - wxTextCtrl *GetEditControl() const - { - return m_textctrlWrapper ? m_textctrlWrapper->GetText() : NULL; - } - - void FinishEditing(wxTextCtrl *text) - { - delete text; - m_textctrlWrapper = NULL; - SetFocusIgnoringChildren(); - } - - // suspend/resume redrawing the control - void Freeze(); - void Thaw(); - - void OnRenameTimer(); - bool OnRenameAccept(size_t itemEdit, const wxString& value); - void OnRenameCancelled(size_t itemEdit); - - void OnMouse( wxMouseEvent &event ); - - // called to switch the selection from the current item to newCurrent, - void OnArrowChar( size_t newCurrent, const wxKeyEvent& event ); - - void OnChar( wxKeyEvent &event ); - void OnKeyDown( wxKeyEvent &event ); - void OnKeyUp( wxKeyEvent &event ); - void OnSetFocus( wxFocusEvent &event ); - void OnKillFocus( wxFocusEvent &event ); - void OnScroll( wxScrollWinEvent& event ); - - void OnPaint( wxPaintEvent &event ); - - void OnChildFocus(wxChildFocusEvent& event); - - void DrawImage( int index, wxDC *dc, int x, int y ); - void GetImageSize( int index, int &width, int &height ) const; - int GetTextLength( const wxString &s ) const; - - void SetImageList( wxImageList *imageList, int which ); - void SetItemSpacing( int spacing, bool isSmall = false ); - int GetItemSpacing( bool isSmall = false ); - - void SetColumn( int col, wxListItem &item ); - void SetColumnWidth( int col, int width ); - void GetColumn( int col, wxListItem &item ) const; - int GetColumnWidth( int col ) const; - int GetColumnCount() const { return m_columns.GetCount(); } - - // returns the sum of the heights of all columns - int GetHeaderWidth() const; - - int GetCountPerPage() const; - - void SetItem( wxListItem &item ); - void GetItem( wxListItem &item ) const; - void SetItemState( long item, long state, long stateMask ); - void SetItemStateAll( long state, long stateMask ); - int GetItemState( long item, long stateMask ) const; - void GetItemRect( long index, wxRect &rect ) const; - wxRect GetViewRect() const; - bool GetItemPosition( long item, wxPoint& pos ) const; - int GetSelectedItemCount() const; - - wxString GetItemText(long item) const - { - wxListItem info; - info.m_mask = wxLIST_MASK_TEXT; - info.m_itemId = item; - GetItem( info ); - return info.m_text; - } - - void SetItemText(long item, const wxString& value) - { - wxListItem info; - info.m_mask = wxLIST_MASK_TEXT; - info.m_itemId = item; - info.m_text = value; - SetItem( info ); - } - - // set the scrollbars and update the positions of the items - void RecalculatePositions(bool noRefresh = false); - - // refresh the window and the header - void RefreshAll(); - - long GetNextItem( long item, int geometry, int state ) const; - void DeleteItem( long index ); - void DeleteAllItems(); - void DeleteColumn( int col ); - void DeleteEverything(); - void EnsureVisible( long index ); - long FindItem( long start, const wxString& str, bool partial = false ); - long FindItem( long start, wxUIntPtr data); - long FindItem( const wxPoint& pt ); - long HitTest( int x, int y, int &flags ) const; - void InsertItem( wxListItem &item ); - void InsertColumn( long col, wxListItem &item ); - int GetItemWidthWithImage(wxListItem * item); - void SortItems( wxListCtrlCompare fn, long data ); - - size_t GetItemCount() const; - bool IsEmpty() const { return GetItemCount() == 0; } - void SetItemCount(long count); - - // change the current (== focused) item, send a notification event - void ChangeCurrent(size_t current); - void ResetCurrent() { ChangeCurrent((size_t)-1); } - bool HasCurrent() const { return m_current != (size_t)-1; } - - // send out a wxListEvent - void SendNotify( size_t line, - wxEventType command, - const wxPoint& point = wxDefaultPosition ); - - // override base class virtual to reset m_lineHeight when the font changes - virtual bool SetFont(const wxFont& font) - { - if ( !wxScrolledWindow::SetFont(font) ) - return false; - - m_lineHeight = 0; - - return true; - } - - // these are for wxListLineData usage only - - // get the backpointer to the list ctrl - wxGenericListCtrl *GetListCtrl() const - { - return wxStaticCast(GetParent(), wxGenericListCtrl); - } - - // get the height of all lines (assuming they all do have the same height) - wxCoord GetLineHeight() const; - - // get the y position of the given line (only for report view) - wxCoord GetLineY(size_t line) const; - - // get the brush to use for the item highlighting - wxBrush *GetHighlightBrush() const - { - return m_hasFocus ? m_highlightBrush : m_highlightUnfocusedBrush; - } - - bool HasFocus() const - { - return m_hasFocus; - } - -//protected: - // the array of all line objects for a non virtual list control (for the - // virtual list control we only ever use m_lines[0]) - wxListLineDataArray m_lines; - - // the list of column objects - wxListHeaderDataList m_columns; - - // currently focused item or -1 - size_t m_current; - - // the number of lines per page - int m_linesPerPage; - - // this flag is set when something which should result in the window - // redrawing happens (i.e. an item was added or deleted, or its appearance - // changed) and OnPaint() doesn't redraw the window while it is set which - // allows to minimize the number of repaintings when a lot of items are - // being added. The real repainting occurs only after the next OnIdle() - // call - bool m_dirty; - - wxColour *m_highlightColour; - wxImageList *m_small_image_list; - wxImageList *m_normal_image_list; - int m_small_spacing; - int m_normal_spacing; - bool m_hasFocus; - - bool m_lastOnSame; - wxTimer *m_renameTimer; - bool m_isCreated; - int m_dragCount; - wxPoint m_dragStart; - ColWidthArray m_aColWidths; - - // for double click logic - size_t m_lineLastClicked, - m_lineBeforeLastClicked, - m_lineSelectSingleOnUp; - -protected: - wxWindow *GetMainWindowOfCompositeControl() { return GetParent(); } - - // the total count of items in a virtual list control - size_t m_countVirt; - - // the object maintaining the items selection state, only used in virtual - // controls - wxSelectionStore m_selStore; - - // common part of all ctors - void Init(); - - // get the line data for the given index - wxListLineData *GetLine(size_t n) const - { - wxASSERT_MSG( n != (size_t)-1, _T("invalid line index") ); - - if ( IsVirtual() ) - { - wxConstCast(this, wxListMainWindow)->CacheLineData(n); - n = 0; - } - - return &m_lines[n]; - } - - // get a dummy line which can be used for geometry calculations and such: - // you must use GetLine() if you want to really draw the line - wxListLineData *GetDummyLine() const; - - // cache the line data of the n-th line in m_lines[0] - void CacheLineData(size_t line); - - // get the range of visible lines - void GetVisibleLinesRange(size_t *from, size_t *to); - - // force us to recalculate the range of visible lines - void ResetVisibleLinesRange() { m_lineFrom = (size_t)-1; } - - // get the colour to be used for drawing the rules - wxColour GetRuleColour() const - { - return wxSystemSettings::GetColour(wxSYS_COLOUR_3DLIGHT); - } - -private: - // initialize the current item if needed - void UpdateCurrent(); - - // delete all items but don't refresh: called from dtor - void DoDeleteAllItems(); - - // the height of one line using the current font - wxCoord m_lineHeight; - - // the total header width or 0 if not calculated yet - wxCoord m_headerWidth; - - // the first and last lines being shown on screen right now (inclusive), - // both may be -1 if they must be calculated so never access them directly: - // use GetVisibleLinesRange() above instead - size_t m_lineFrom, - m_lineTo; - - // the brushes to use for item highlighting when we do/don't have focus - wxBrush *m_highlightBrush, - *m_highlightUnfocusedBrush; - - // if this is > 0, the control is frozen and doesn't redraw itself - size_t m_freezeCount; - - // wrapper around the text control currently used for in place editing or - // NULL if no item is being edited - wxListTextCtrlWrapper *m_textctrlWrapper; - - - DECLARE_DYNAMIC_CLASS(wxListMainWindow) - DECLARE_EVENT_TABLE() - - friend class wxGenericListCtrl; -}; - - -wxListItemData::~wxListItemData() -{ - // in the virtual list control the attributes are managed by the main - // program, so don't delete them - if ( !m_owner->IsVirtual() ) - delete m_attr; - - delete m_rect; -} - -void wxListItemData::Init() -{ - m_image = -1; - m_data = 0; - - m_attr = NULL; -} - -wxListItemData::wxListItemData(wxListMainWindow *owner) -{ - Init(); - - m_owner = owner; - - if ( owner->InReportView() ) - m_rect = NULL; - else - m_rect = new wxRect; -} - -void wxListItemData::SetItem( const wxListItem &info ) -{ - if ( info.m_mask & wxLIST_MASK_TEXT ) - SetText(info.m_text); - if ( info.m_mask & wxLIST_MASK_IMAGE ) - m_image = info.m_image; - if ( info.m_mask & wxLIST_MASK_DATA ) - m_data = info.m_data; - - if ( info.HasAttributes() ) - { - if ( m_attr ) - m_attr->AssignFrom(*info.GetAttributes()); - else - m_attr = new wxListItemAttr(*info.GetAttributes()); - } - - if ( m_rect ) - { - m_rect->x = - m_rect->y = - m_rect->height = 0; - m_rect->width = info.m_width; - } -} - -void wxListItemData::SetPosition( int x, int y ) -{ - wxCHECK_RET( m_rect, _T("unexpected SetPosition() call") ); - - m_rect->x = x; - m_rect->y = y; -} - -void wxListItemData::SetSize( int width, int height ) -{ - wxCHECK_RET( m_rect, _T("unexpected SetSize() call") ); - - if ( width != -1 ) - m_rect->width = width; - if ( height != -1 ) - m_rect->height = height; -} - -bool wxListItemData::IsHit( int x, int y ) const -{ - wxCHECK_MSG( m_rect, false, _T("can't be called in this mode") ); - - return wxRect(GetX(), GetY(), GetWidth(), GetHeight()).Contains(x, y); -} - -int wxListItemData::GetX() const -{ - wxCHECK_MSG( m_rect, 0, _T("can't be called in this mode") ); - - return m_rect->x; -} - -int wxListItemData::GetY() const -{ - wxCHECK_MSG( m_rect, 0, _T("can't be called in this mode") ); - - return m_rect->y; -} - -int wxListItemData::GetWidth() const -{ - wxCHECK_MSG( m_rect, 0, _T("can't be called in this mode") ); - - return m_rect->width; -} - -int wxListItemData::GetHeight() const -{ - wxCHECK_MSG( m_rect, 0, _T("can't be called in this mode") ); - - return m_rect->height; -} - -void wxListItemData::GetItem( wxListItem &info ) const -{ - long mask = info.m_mask; - if ( !mask ) - // by default, get everything for backwards compatibility - mask = -1; - - if ( mask & wxLIST_MASK_TEXT ) - info.m_text = m_text; - if ( mask & wxLIST_MASK_IMAGE ) - info.m_image = m_image; - if ( mask & wxLIST_MASK_DATA ) - info.m_data = m_data; - - if ( m_attr ) - { - if ( m_attr->HasTextColour() ) - info.SetTextColour(m_attr->GetTextColour()); - if ( m_attr->HasBackgroundColour() ) - info.SetBackgroundColour(m_attr->GetBackgroundColour()); - if ( m_attr->HasFont() ) - info.SetFont(m_attr->GetFont()); - } -} - -//----------------------------------------------------------------------------- -// wxListHeaderData -//----------------------------------------------------------------------------- - -void wxListHeaderData::Init() -{ - m_mask = 0; - m_image = -1; - m_format = 0; - m_width = 0; - m_xpos = 0; - m_ypos = 0; - m_height = 0; - m_state = 0; -} - -wxListHeaderData::wxListHeaderData() -{ - Init(); -} - -wxListHeaderData::wxListHeaderData( const wxListItem &item ) -{ - Init(); - - SetItem( item ); -} - -void wxListHeaderData::SetItem( const wxListItem &item ) -{ - m_mask = item.m_mask; - - if ( m_mask & wxLIST_MASK_TEXT ) - m_text = item.m_text; - - if ( m_mask & wxLIST_MASK_IMAGE ) - m_image = item.m_image; - - if ( m_mask & wxLIST_MASK_FORMAT ) - m_format = item.m_format; - - if ( m_mask & wxLIST_MASK_WIDTH ) - SetWidth(item.m_width); - - if ( m_mask & wxLIST_MASK_STATE ) - SetState(item.m_state); -} - -void wxListHeaderData::SetPosition( int x, int y ) -{ - m_xpos = x; - m_ypos = y; -} - -void wxListHeaderData::SetHeight( int h ) -{ - m_height = h; -} - -void wxListHeaderData::SetWidth( int w ) -{ - m_width = w < 0 ? WIDTH_COL_DEFAULT : w; -} - -void wxListHeaderData::SetState( int flag ) -{ - m_state = flag; -} - -void wxListHeaderData::SetFormat( int format ) -{ - m_format = format; -} - -bool wxListHeaderData::HasImage() const -{ - return m_image != -1; -} - -bool wxListHeaderData::IsHit( int x, int y ) const -{ - return ((x >= m_xpos) && (x <= m_xpos+m_width) && (y >= m_ypos) && (y <= m_ypos+m_height)); -} - -void wxListHeaderData::GetItem( wxListItem& item ) -{ - item.m_mask = m_mask; - item.m_text = m_text; - item.m_image = m_image; - item.m_format = m_format; - item.m_width = m_width; - item.m_state = m_state; -} - -int wxListHeaderData::GetImage() const -{ - return m_image; -} - -int wxListHeaderData::GetWidth() const -{ - return m_width; -} - -int wxListHeaderData::GetFormat() const -{ - return m_format; -} - -int wxListHeaderData::GetState() const -{ - return m_state; -} - -//----------------------------------------------------------------------------- -// wxListLineData -//----------------------------------------------------------------------------- - -inline int wxListLineData::GetMode() const -{ - return m_owner->GetListCtrl()->GetWindowStyleFlag() & wxLC_MASK_TYPE; -} - -inline bool wxListLineData::InReportView() const -{ - return m_owner->HasFlag(wxLC_REPORT); -} - -inline bool wxListLineData::IsVirtual() const -{ - return m_owner->IsVirtual(); -} - -wxListLineData::wxListLineData( wxListMainWindow *owner ) -{ - m_owner = owner; - - if ( InReportView() ) - m_gi = NULL; - else // !report - m_gi = new GeometryInfo; - - m_highlighted = false; - - InitItems( GetMode() == wxLC_REPORT ? m_owner->GetColumnCount() : 1 ); -} - -void wxListLineData::CalculateSize( wxDC *dc, int spacing ) -{ - wxListItemDataList::compatibility_iterator node = m_items.GetFirst(); - wxCHECK_RET( node, _T("no subitems at all??") ); - - wxListItemData *item = node->GetData(); - - wxString s; - wxCoord lw, lh; - - switch ( GetMode() ) - { - case wxLC_ICON: - case wxLC_SMALL_ICON: - m_gi->m_rectAll.width = spacing; - - s = item->GetText(); - - if ( s.empty() ) - { - lh = - m_gi->m_rectLabel.width = - m_gi->m_rectLabel.height = 0; - } - else // has label - { - dc->GetTextExtent( s, &lw, &lh ); - lw += EXTRA_WIDTH; - lh += EXTRA_HEIGHT; - - m_gi->m_rectAll.height = spacing + lh; - if (lw > spacing) - m_gi->m_rectAll.width = lw; - - m_gi->m_rectLabel.width = lw; - m_gi->m_rectLabel.height = lh; - } - - if (item->HasImage()) - { - int w, h; - m_owner->GetImageSize( item->GetImage(), w, h ); - m_gi->m_rectIcon.width = w + 8; - m_gi->m_rectIcon.height = h + 8; - - if ( m_gi->m_rectIcon.width > m_gi->m_rectAll.width ) - m_gi->m_rectAll.width = m_gi->m_rectIcon.width; - if ( m_gi->m_rectIcon.height + lh > m_gi->m_rectAll.height - 4 ) - m_gi->m_rectAll.height = m_gi->m_rectIcon.height + lh + 4; - } - - if ( item->HasText() ) - { - m_gi->m_rectHighlight.width = m_gi->m_rectLabel.width; - m_gi->m_rectHighlight.height = m_gi->m_rectLabel.height; - } - else // no text, highlight the icon - { - m_gi->m_rectHighlight.width = m_gi->m_rectIcon.width; - m_gi->m_rectHighlight.height = m_gi->m_rectIcon.height; - } - break; - - case wxLC_LIST: - s = item->GetTextForMeasuring(); - - dc->GetTextExtent( s, &lw, &lh ); - lw += EXTRA_WIDTH; - lh += EXTRA_HEIGHT; - - m_gi->m_rectLabel.width = lw; - m_gi->m_rectLabel.height = lh; - - m_gi->m_rectAll.width = lw; - m_gi->m_rectAll.height = lh; - - if (item->HasImage()) - { - int w, h; - m_owner->GetImageSize( item->GetImage(), w, h ); - m_gi->m_rectIcon.width = w; - m_gi->m_rectIcon.height = h; - - m_gi->m_rectAll.width += 4 + w; - if (h > m_gi->m_rectAll.height) - m_gi->m_rectAll.height = h; - } - - m_gi->m_rectHighlight.width = m_gi->m_rectAll.width; - m_gi->m_rectHighlight.height = m_gi->m_rectAll.height; - break; - - case wxLC_REPORT: - wxFAIL_MSG( _T("unexpected call to SetSize") ); - break; - - default: - wxFAIL_MSG( _T("unknown mode") ); - break; - } -} - -void wxListLineData::SetPosition( int x, int y, int spacing ) -{ - wxListItemDataList::compatibility_iterator node = m_items.GetFirst(); - wxCHECK_RET( node, _T("no subitems at all??") ); - - wxListItemData *item = node->GetData(); - - switch ( GetMode() ) - { - case wxLC_ICON: - case wxLC_SMALL_ICON: - m_gi->m_rectAll.x = x; - m_gi->m_rectAll.y = y; - - if ( item->HasImage() ) - { - m_gi->m_rectIcon.x = m_gi->m_rectAll.x + 4 + - (m_gi->m_rectAll.width - m_gi->m_rectIcon.width) / 2; - m_gi->m_rectIcon.y = m_gi->m_rectAll.y + 4; - } - - if ( item->HasText() ) - { - if (m_gi->m_rectAll.width > spacing) - m_gi->m_rectLabel.x = m_gi->m_rectAll.x + (EXTRA_WIDTH/2); - else - m_gi->m_rectLabel.x = m_gi->m_rectAll.x + (EXTRA_WIDTH/2) + (spacing / 2) - (m_gi->m_rectLabel.width / 2); - m_gi->m_rectLabel.y = m_gi->m_rectAll.y + m_gi->m_rectAll.height + 2 - m_gi->m_rectLabel.height; - m_gi->m_rectHighlight.x = m_gi->m_rectLabel.x - 2; - m_gi->m_rectHighlight.y = m_gi->m_rectLabel.y - 2; - } - else // no text, highlight the icon - { - m_gi->m_rectHighlight.x = m_gi->m_rectIcon.x - 4; - m_gi->m_rectHighlight.y = m_gi->m_rectIcon.y - 4; - } - break; - - case wxLC_LIST: - m_gi->m_rectAll.x = x; - m_gi->m_rectAll.y = y; - - m_gi->m_rectHighlight.x = m_gi->m_rectAll.x; - m_gi->m_rectHighlight.y = m_gi->m_rectAll.y; - m_gi->m_rectLabel.y = m_gi->m_rectAll.y + 2; - - if (item->HasImage()) - { - m_gi->m_rectIcon.x = m_gi->m_rectAll.x + 2; - m_gi->m_rectIcon.y = m_gi->m_rectAll.y + 2; - m_gi->m_rectLabel.x = m_gi->m_rectAll.x + 4 + (EXTRA_WIDTH/2) + m_gi->m_rectIcon.width; - } - else - { - m_gi->m_rectLabel.x = m_gi->m_rectAll.x + (EXTRA_WIDTH/2); - } - break; - - case wxLC_REPORT: - wxFAIL_MSG( _T("unexpected call to SetPosition") ); - break; - - default: - wxFAIL_MSG( _T("unknown mode") ); - break; - } -} - -void wxListLineData::InitItems( int num ) -{ - for (int i = 0; i < num; i++) - m_items.Append( new wxListItemData(m_owner) ); -} - -void wxListLineData::SetItem( int index, const wxListItem &info ) -{ - wxListItemDataList::compatibility_iterator node = m_items.Item( index ); - wxCHECK_RET( node, _T("invalid column index in SetItem") ); - - wxListItemData *item = node->GetData(); - item->SetItem( info ); -} - -void wxListLineData::GetItem( int index, wxListItem &info ) -{ - wxListItemDataList::compatibility_iterator node = m_items.Item( index ); - if (node) - { - wxListItemData *item = node->GetData(); - item->GetItem( info ); - } -} - -wxString wxListLineData::GetText(int index) const -{ - wxString s; - - wxListItemDataList::compatibility_iterator node = m_items.Item( index ); - if (node) - { - wxListItemData *item = node->GetData(); - s = item->GetText(); - } - - return s; -} - -void wxListLineData::SetText( int index, const wxString& s ) -{ - wxListItemDataList::compatibility_iterator node = m_items.Item( index ); - if (node) - { - wxListItemData *item = node->GetData(); - item->SetText( s ); - } -} - -void wxListLineData::SetImage( int index, int image ) -{ - wxListItemDataList::compatibility_iterator node = m_items.Item( index ); - wxCHECK_RET( node, _T("invalid column index in SetImage()") ); - - wxListItemData *item = node->GetData(); - item->SetImage(image); -} - -int wxListLineData::GetImage( int index ) const -{ - wxListItemDataList::compatibility_iterator node = m_items.Item( index ); - wxCHECK_MSG( node, -1, _T("invalid column index in GetImage()") ); - - wxListItemData *item = node->GetData(); - return item->GetImage(); -} - -wxListItemAttr *wxListLineData::GetAttr() const -{ - wxListItemDataList::compatibility_iterator node = m_items.GetFirst(); - wxCHECK_MSG( node, NULL, _T("invalid column index in GetAttr()") ); - - wxListItemData *item = node->GetData(); - return item->GetAttr(); -} - -void wxListLineData::SetAttr(wxListItemAttr *attr) -{ - wxListItemDataList::compatibility_iterator node = m_items.GetFirst(); - wxCHECK_RET( node, _T("invalid column index in SetAttr()") ); - - wxListItemData *item = node->GetData(); - item->SetAttr(attr); -} - -bool wxListLineData::SetAttributes(wxDC *dc, - const wxListItemAttr *attr, - bool highlighted) -{ - wxWindow *listctrl = m_owner->GetParent(); - - // fg colour - - // don't use foreground colour for drawing highlighted items - this might - // make them completely invisible (and there is no way to do bit - // arithmetics on wxColour, unfortunately) - wxColour colText; - if ( highlighted ) -#ifdef __WXMAC__ - { - if (m_owner->HasFocus() -#ifdef __WXMAC__ - && IsControlActive( (ControlRef)m_owner->GetHandle() ) -#endif - ) - colText = *wxWHITE; - else - colText = *wxBLACK; - } -#else - { - if (m_owner->HasFocus()) - colText = wxSystemSettings::GetColour(wxSYS_COLOUR_HIGHLIGHTTEXT); - else - colText = wxSystemSettings::GetColour(wxSYS_COLOUR_LISTBOXHIGHLIGHTTEXT); - } -#endif - else if ( attr && attr->HasTextColour() ) - colText = attr->GetTextColour(); - else - colText = listctrl->GetForegroundColour(); - - dc->SetTextForeground(colText); - - // font - wxFont font; - if ( attr && attr->HasFont() ) - font = attr->GetFont(); - else - font = listctrl->GetFont(); - - dc->SetFont(font); - - // bg colour - bool hasBgCol = attr && attr->HasBackgroundColour(); - if ( highlighted || hasBgCol ) - { - if ( highlighted ) - dc->SetBrush( *m_owner->GetHighlightBrush() ); - else - dc->SetBrush(wxBrush(attr->GetBackgroundColour(), wxSOLID)); - - dc->SetPen( *wxTRANSPARENT_PEN ); - - return true; - } - - return false; -} - -void wxListLineData::Draw( wxDC *dc ) -{ - wxListItemDataList::compatibility_iterator node = m_items.GetFirst(); - wxCHECK_RET( node, _T("no subitems at all??") ); - - bool highlighted = IsHighlighted(); - - wxListItemAttr *attr = GetAttr(); - - if ( SetAttributes(dc, attr, highlighted) ) -#if ( !defined(__WXGTK20__) && !defined(__WXMAC__) ) - { - dc->DrawRectangle( m_gi->m_rectHighlight ); - } -#else - { - if (highlighted) - { - int flags = wxCONTROL_SELECTED; - if (m_owner->HasFocus() -#ifdef __WXMAC__ - && IsControlActive( (ControlRef)m_owner->GetHandle() ) -#endif - ) - flags |= wxCONTROL_FOCUSED; - wxRendererNative::Get().DrawItemSelectionRect( m_owner, *dc, m_gi->m_rectHighlight, flags ); - - } - else - { - dc->DrawRectangle( m_gi->m_rectHighlight ); - } - } -#endif - - // just for debugging to better see where the items are -#if 0 - dc->SetPen(*wxRED_PEN); - dc->SetBrush(*wxTRANSPARENT_BRUSH); - dc->DrawRectangle( m_gi->m_rectAll ); - dc->SetPen(*wxGREEN_PEN); - dc->DrawRectangle( m_gi->m_rectIcon ); -#endif - - wxListItemData *item = node->GetData(); - if (item->HasImage()) - { - // centre the image inside our rectangle, this looks nicer when items - // ae aligned in a row - const wxRect& rectIcon = m_gi->m_rectIcon; - - m_owner->DrawImage(item->GetImage(), dc, rectIcon.x, rectIcon.y); - } - - if (item->HasText()) - { - const wxRect& rectLabel = m_gi->m_rectLabel; - - wxDCClipper clipper(*dc, rectLabel); - dc->DrawText(item->GetText(), rectLabel.x, rectLabel.y); - } -} - -void wxListLineData::DrawInReportMode( wxDC *dc, - const wxRect& rect, - const wxRect& rectHL, - bool highlighted ) -{ - // TODO: later we should support setting different attributes for - // different columns - to do it, just add "col" argument to - // GetAttr() and move these lines into the loop below - wxListItemAttr *attr = GetAttr(); - if ( SetAttributes(dc, attr, highlighted) ) -#if ( !defined(__WXGTK20__) && !defined(__WXMAC__) ) - { - dc->DrawRectangle( rectHL ); - } -#else - { - if (highlighted) - { - int flags = wxCONTROL_SELECTED; - if (m_owner->HasFocus() -#ifdef __WXMAC__ - && IsControlActive( (ControlRef)m_owner->GetHandle() ) -#endif - ) - flags |= wxCONTROL_FOCUSED; - wxRendererNative::Get().DrawItemSelectionRect( m_owner, *dc, rectHL, flags ); - } - else - { - dc->DrawRectangle( rectHL ); - } - } -#endif - - wxCoord x = rect.x + HEADER_OFFSET_X, - yMid = rect.y + rect.height/2; -#ifdef __WXGTK__ - // This probably needs to be done - // on all platforms as the icons - // otherwise nearly touch the border - x += 2; -#endif - - size_t col = 0; - for ( wxListItemDataList::compatibility_iterator node = m_items.GetFirst(); - node; - node = node->GetNext(), col++ ) - { - wxListItemData *item = node->GetData(); - - int width = m_owner->GetColumnWidth(col); - int xOld = x; - x += width; - - if ( item->HasImage() ) - { - int ix, iy; - m_owner->GetImageSize( item->GetImage(), ix, iy ); - m_owner->DrawImage( item->GetImage(), dc, xOld, yMid - iy/2 ); - - ix += IMAGE_MARGIN_IN_REPORT_MODE; - - xOld += ix; - width -= ix; - } - - if ( item->HasText() ) - DrawTextFormatted(dc, item->GetText(), col, xOld, yMid, width - 8); - } -} - -void wxListLineData::DrawTextFormatted(wxDC *dc, - const wxString& textOrig, - int col, - int x, - int yMid, - int width) -{ - // we don't support displaying multiple lines currently (and neither does - // wxMSW FWIW) so just merge all the lines - wxString text(textOrig); - text.Replace(_T("\n"), _T(" ")); - - wxCoord w, h; - dc->GetTextExtent(text, &w, &h); - - const wxCoord y = yMid - (h + 1)/2; - - wxDCClipper clipper(*dc, x, y, width, h); - - // determine if the string can fit inside the current width - if (w <= width) - { - // it can, draw it using the items alignment - wxListItem item; - m_owner->GetColumn(col, item); - switch ( item.GetAlign() ) - { - case wxLIST_FORMAT_LEFT: - // nothing to do - break; - - case wxLIST_FORMAT_RIGHT: - x += width - w; - break; - - case wxLIST_FORMAT_CENTER: - x += (width - w) / 2; - break; - - default: - wxFAIL_MSG( _T("unknown list item format") ); - break; - } - - dc->DrawText(text, x, y); - } - else // otherwise, truncate and add an ellipsis if possible - { - // determine the base width - wxString ellipsis(wxT("...")); - wxCoord base_w; - dc->GetTextExtent(ellipsis, &base_w, &h); - - // continue until we have enough space or only one character left - wxCoord w_c, h_c; - size_t len = text.length(); - wxString drawntext = text.Left(len); - while (len > 1) - { - dc->GetTextExtent(drawntext.Last(), &w_c, &h_c); - drawntext.RemoveLast(); - len--; - w -= w_c; - if (w + base_w <= width) - break; - } - - // if still not enough space, remove ellipsis characters - while (ellipsis.length() > 0 && w + base_w > width) - { - ellipsis = ellipsis.Left(ellipsis.length() - 1); - dc->GetTextExtent(ellipsis, &base_w, &h); - } - - // now draw the text - dc->DrawText(drawntext, x, y); - dc->DrawText(ellipsis, x + w, y); - } -} - -bool wxListLineData::Highlight( bool on ) -{ - wxCHECK_MSG( !IsVirtual(), false, _T("unexpected call to Highlight") ); - - if ( on == m_highlighted ) - return false; - - m_highlighted = on; - - return true; -} - -void wxListLineData::ReverseHighlight( void ) -{ - Highlight(!IsHighlighted()); -} - -//----------------------------------------------------------------------------- -// wxListHeaderWindow -//----------------------------------------------------------------------------- - -IMPLEMENT_DYNAMIC_CLASS(wxListHeaderWindow,wxWindow) - -BEGIN_EVENT_TABLE(wxListHeaderWindow,wxWindow) - EVT_PAINT (wxListHeaderWindow::OnPaint) - EVT_MOUSE_EVENTS (wxListHeaderWindow::OnMouse) - EVT_SET_FOCUS (wxListHeaderWindow::OnSetFocus) -END_EVENT_TABLE() - -void wxListHeaderWindow::Init() -{ - m_currentCursor = (wxCursor *) NULL; - m_isDragging = false; - m_dirty = false; -} - -wxListHeaderWindow::wxListHeaderWindow() -{ - Init(); - - m_owner = (wxListMainWindow *) NULL; - m_resizeCursor = (wxCursor *) NULL; -} - -wxListHeaderWindow::wxListHeaderWindow( wxWindow *win, - wxWindowID id, - wxListMainWindow *owner, - const wxPoint& pos, - const wxSize& size, - long style, - const wxString &name ) - : wxWindow( win, id, pos, size, style, name ) -{ - Init(); - - m_owner = owner; - m_resizeCursor = new wxCursor( wxCURSOR_SIZEWE ); - -#if _USE_VISATTR - wxVisualAttributes attr = wxPanel::GetClassDefaultAttributes(); - SetOwnForegroundColour( attr.colFg ); - SetOwnBackgroundColour( attr.colBg ); - if (!m_hasFont) - SetOwnFont( attr.font ); -#else - SetOwnForegroundColour( wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT)); - SetOwnBackgroundColour( wxSystemSettings::GetColour(wxSYS_COLOUR_BTNFACE)); - if (!m_hasFont) - SetOwnFont( wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT )); -#endif -} - -wxListHeaderWindow::~wxListHeaderWindow() -{ - delete m_resizeCursor; -} - -#ifdef __WXUNIVERSAL__ -#include "wx/univ/renderer.h" -#include "wx/univ/theme.h" -#endif - -// shift the DC origin to match the position of the main window horz -// scrollbar: this allows us to always use logical coords -void wxListHeaderWindow::AdjustDC(wxDC& dc) -{ - int xpix; - m_owner->GetScrollPixelsPerUnit( &xpix, NULL ); - - int view_start; - m_owner->GetViewStart( &view_start, NULL ); - - - int org_x = 0; - int org_y = 0; - dc.GetDeviceOrigin( &org_x, &org_y ); - - // account for the horz scrollbar offset -#ifdef __WXGTK__ - if (GetLayoutDirection() == wxLayout_RightToLeft) - { - // Maybe we just have to check for m_signX - // in the DC, but I leave the #ifdef __WXGTK__ - // for now - dc.SetDeviceOrigin( org_x + (view_start * xpix), org_y ); - } - else -#endif - dc.SetDeviceOrigin( org_x - (view_start * xpix), org_y ); -} - -void wxListHeaderWindow::OnPaint( wxPaintEvent &WXUNUSED(event) ) -{ - wxPaintDC dc( this ); - - PrepareDC( dc ); - AdjustDC( dc ); - - dc.SetFont( GetFont() ); - - // width and height of the entire header window - int w, h; - GetClientSize( &w, &h ); - m_owner->CalcUnscrolledPosition(w, 0, &w, NULL); - - dc.SetBackgroundMode(wxTRANSPARENT); - dc.SetTextForeground(GetForegroundColour()); - - int x = HEADER_OFFSET_X; - int numColumns = m_owner->GetColumnCount(); - wxListItem item; - for ( int i = 0; i < numColumns && x < w; i++ ) - { - m_owner->GetColumn( i, item ); - int wCol = item.m_width; - - int cw = wCol; - int ch = h; - - int flags = 0; - if (!m_parent->IsEnabled()) - flags |= wxCONTROL_DISABLED; - -// NB: The code below is not really Mac-specific, but since we are close -// to 2.8 release and I don't have time to test on other platforms, I -// defined this only for wxMac. If this behavior is desired on -// other platforms, please go ahead and revise or remove the #ifdef. -#ifdef __WXMAC__ - if ( !m_owner->IsVirtual() && (item.m_mask & wxLIST_MASK_STATE) && - (item.m_state & wxLIST_STATE_SELECTED) ) - flags |= wxCONTROL_SELECTED; -#endif - - wxRendererNative::Get().DrawHeaderButton - ( - this, - dc, - wxRect(x, HEADER_OFFSET_Y, cw, ch), - flags - ); - - // see if we have enough space for the column label - - // for this we need the width of the text - wxCoord wLabel; - wxCoord hLabel; - dc.GetTextExtent(item.GetText(), &wLabel, &hLabel); - wLabel += 2 * EXTRA_WIDTH; - - // and the width of the icon, if any - int ix = 0, iy = 0; // init them just to suppress the compiler warnings - const int image = item.m_image; - wxImageList *imageList; - if ( image != -1 ) - { - imageList = m_owner->m_small_image_list; - if ( imageList ) - { - imageList->GetSize(image, ix, iy); - wLabel += ix + HEADER_IMAGE_MARGIN_IN_REPORT_MODE; - } - } - else - { - imageList = NULL; - } - - // ignore alignment if there is not enough space anyhow - int xAligned; - switch ( wLabel < cw ? item.GetAlign() : wxLIST_FORMAT_LEFT ) - { - default: - wxFAIL_MSG( _T("unknown list item format") ); - // fall through - - case wxLIST_FORMAT_LEFT: - xAligned = x; - break; - - case wxLIST_FORMAT_RIGHT: - xAligned = x + cw - wLabel; - break; - - case wxLIST_FORMAT_CENTER: - xAligned = x + (cw - wLabel) / 2; - break; - } - - // draw the text and image clipping them so that they - // don't overwrite the column boundary - wxDCClipper clipper(dc, x, HEADER_OFFSET_Y, cw, h ); - - // if we have an image, draw it on the right of the label - if ( imageList ) - { - imageList->Draw - ( - image, - dc, - xAligned + wLabel - ix - HEADER_IMAGE_MARGIN_IN_REPORT_MODE, - HEADER_OFFSET_Y + (h - 4 - iy)/2, - wxIMAGELIST_DRAW_TRANSPARENT - ); - } - - dc.DrawText( item.GetText(), - xAligned + EXTRA_WIDTH, h / 2 - hLabel / 2 ); //HEADER_OFFSET_Y + EXTRA_HEIGHT ); - - x += wCol; - } - - // Fill in what's missing to the right of the columns, otherwise we will - // leave an unpainted area when columns are removed (and it looks better) - if ( x < w ) - { - wxRendererNative::Get().DrawHeaderButton - ( - this, - dc, - wxRect(x, HEADER_OFFSET_Y, w - x, h), - 0 - ); - } -} - -void wxListHeaderWindow::DrawCurrent() -{ -#if 1 - m_owner->SetColumnWidth( m_column, m_currentX - m_minX ); -#else - int x1 = m_currentX; - int y1 = 0; - m_owner->ClientToScreen( &x1, &y1 ); - - int x2 = m_currentX; - int y2 = 0; - m_owner->GetClientSize( NULL, &y2 ); - m_owner->ClientToScreen( &x2, &y2 ); - - wxScreenDC dc; - dc.SetLogicalFunction( wxINVERT ); - dc.SetPen( wxPen( *wxBLACK, 2, wxSOLID ) ); - dc.SetBrush( *wxTRANSPARENT_BRUSH ); - - AdjustDC(dc); - - dc.DrawLine( x1, y1, x2, y2 ); - - dc.SetLogicalFunction( wxCOPY ); - - dc.SetPen( wxNullPen ); - dc.SetBrush( wxNullBrush ); -#endif -} - -void wxListHeaderWindow::OnMouse( wxMouseEvent &event ) -{ - // we want to work with logical coords - int x; - m_owner->CalcUnscrolledPosition(event.GetX(), 0, &x, NULL); - int y = event.GetY(); - - if (m_isDragging) - { - SendListEvent(wxEVT_COMMAND_LIST_COL_DRAGGING, event.GetPosition()); - - // we don't draw the line beyond our window, but we allow dragging it - // there - int w = 0; - GetClientSize( &w, NULL ); - m_owner->CalcUnscrolledPosition(w, 0, &w, NULL); - w -= 6; - - // erase the line if it was drawn - if ( m_currentX < w ) - DrawCurrent(); - - if (event.ButtonUp()) - { - ReleaseMouse(); - m_isDragging = false; - m_dirty = true; - m_owner->SetColumnWidth( m_column, m_currentX - m_minX ); - SendListEvent(wxEVT_COMMAND_LIST_COL_END_DRAG, event.GetPosition()); - } - else - { - if (x > m_minX + 7) - m_currentX = x; - else - m_currentX = m_minX + 7; - - // draw in the new location - if ( m_currentX < w ) - DrawCurrent(); - } - } - else // not dragging - { - m_minX = 0; - bool hit_border = false; - - // end of the current column - int xpos = 0; - - // find the column where this event occurred - int col, - countCol = m_owner->GetColumnCount(); - for (col = 0; col < countCol; col++) - { - xpos += m_owner->GetColumnWidth( col ); - m_column = col; - - if ( (abs(x-xpos) < 3) && (y < 22) ) - { - // near the column border - hit_border = true; - break; - } - - if ( x < xpos ) - { - // inside the column - break; - } - - m_minX = xpos; - } - - if ( col == countCol ) - m_column = -1; - - if (event.LeftDown() || event.RightUp()) - { - if (hit_border && event.LeftDown()) - { - if ( SendListEvent(wxEVT_COMMAND_LIST_COL_BEGIN_DRAG, - event.GetPosition()) ) - { - m_isDragging = true; - m_currentX = x; - CaptureMouse(); - DrawCurrent(); - } - //else: column resizing was vetoed by the user code - } - else // click on a column - { - // record the selected state of the columns - if (event.LeftDown()) - { - for (int i=0; i < m_owner->GetColumnCount(); i++) - { - wxListItem colItem; - m_owner->GetColumn(i, colItem); - long state = colItem.GetState(); - if (i == m_column) - colItem.SetState(state | wxLIST_STATE_SELECTED); - else - colItem.SetState(state & ~wxLIST_STATE_SELECTED); - m_owner->SetColumn(i, colItem); - } - } - - SendListEvent( event.LeftDown() - ? wxEVT_COMMAND_LIST_COL_CLICK - : wxEVT_COMMAND_LIST_COL_RIGHT_CLICK, - event.GetPosition()); - } - } - else if (event.Moving()) - { - bool setCursor; - if (hit_border) - { - setCursor = m_currentCursor == wxSTANDARD_CURSOR; - m_currentCursor = m_resizeCursor; - } - else - { - setCursor = m_currentCursor != wxSTANDARD_CURSOR; - m_currentCursor = wxSTANDARD_CURSOR; - } - - if ( setCursor ) - SetCursor(*m_currentCursor); - } - } -} - -void wxListHeaderWindow::OnSetFocus( wxFocusEvent &WXUNUSED(event) ) -{ - m_owner->SetFocus(); - m_owner->Update(); -} - -bool wxListHeaderWindow::SendListEvent(wxEventType type, const wxPoint& pos) -{ - wxWindow *parent = GetParent(); - wxListEvent le( type, parent->GetId() ); - le.SetEventObject( parent ); - le.m_pointDrag = pos; - - // the position should be relative to the parent window, not - // this one for compatibility with MSW and common sense: the - // user code doesn't know anything at all about this header - // window, so why should it get positions relative to it? - le.m_pointDrag.y -= GetSize().y; - - le.m_col = m_column; - return !parent->GetEventHandler()->ProcessEvent( le ) || le.IsAllowed(); -} - -//----------------------------------------------------------------------------- -// wxListRenameTimer (internal) -//----------------------------------------------------------------------------- - -wxListRenameTimer::wxListRenameTimer( wxListMainWindow *owner ) -{ - m_owner = owner; -} - -void wxListRenameTimer::Notify() -{ - m_owner->OnRenameTimer(); -} - -//----------------------------------------------------------------------------- -// wxListTextCtrlWrapper (internal) -//----------------------------------------------------------------------------- - -BEGIN_EVENT_TABLE(wxListTextCtrlWrapper, wxEvtHandler) - EVT_CHAR (wxListTextCtrlWrapper::OnChar) - EVT_KEY_UP (wxListTextCtrlWrapper::OnKeyUp) - EVT_KILL_FOCUS (wxListTextCtrlWrapper::OnKillFocus) -END_EVENT_TABLE() - -wxListTextCtrlWrapper::wxListTextCtrlWrapper(wxListMainWindow *owner, - wxTextCtrl *text, - size_t itemEdit) - : m_startValue(owner->GetItemText(itemEdit)), - m_itemEdited(itemEdit) -{ - m_owner = owner; - m_text = text; - m_finished = false; - m_aboutToFinish = false; - - wxRect rectLabel = owner->GetLineLabelRect(itemEdit); - - m_owner->CalcScrolledPosition(rectLabel.x, rectLabel.y, - &rectLabel.x, &rectLabel.y); - - m_text->Create(owner, wxID_ANY, m_startValue, - wxPoint(rectLabel.x-4,rectLabel.y-4), - wxSize(rectLabel.width+11,rectLabel.height+8)); - m_text->SetFocus(); - - m_text->PushEventHandler(this); -} - -void wxListTextCtrlWrapper::Finish() -{ - if ( !m_finished ) - { - m_finished = true; - - m_text->RemoveEventHandler(this); - m_owner->FinishEditing(m_text); - - wxPendingDelete.Append( this ); - } -} - -bool wxListTextCtrlWrapper::AcceptChanges() -{ - const wxString value = m_text->GetValue(); - - // notice that we should always call OnRenameAccept() to generate the "end - // label editing" event, even if the user hasn't really changed anything - if ( !m_owner->OnRenameAccept(m_itemEdited, value) ) - { - // vetoed by the user - return false; - } - - // accepted, do rename the item (unless nothing changed) - if ( value != m_startValue ) - m_owner->SetItemText(m_itemEdited, value); - - return true; -} - -void wxListTextCtrlWrapper::AcceptChangesAndFinish() -{ - m_aboutToFinish = true; - - // Notify the owner about the changes - AcceptChanges(); - - // Even if vetoed, close the control (consistent with MSW) - Finish(); -} - -void wxListTextCtrlWrapper::OnChar( wxKeyEvent &event ) -{ - switch ( event.m_keyCode ) - { - case WXK_RETURN: - AcceptChangesAndFinish(); - break; - - case WXK_ESCAPE: - m_owner->OnRenameCancelled( m_itemEdited ); - Finish(); - break; - - default: - event.Skip(); - } -} - -void wxListTextCtrlWrapper::OnKeyUp( wxKeyEvent &event ) -{ - if (m_finished) - { - event.Skip(); - return; - } - - // auto-grow the textctrl: - wxSize parentSize = m_owner->GetSize(); - wxPoint myPos = m_text->GetPosition(); - wxSize mySize = m_text->GetSize(); - int sx, sy; - m_text->GetTextExtent(m_text->GetValue() + _T("MM"), &sx, &sy); - if (myPos.x + sx > parentSize.x) - sx = parentSize.x - myPos.x; - if (mySize.x > sx) - sx = mySize.x; - m_text->SetSize(sx, wxDefaultCoord); - - event.Skip(); -} - -void wxListTextCtrlWrapper::OnKillFocus( wxFocusEvent &event ) -{ - if ( !m_finished && !m_aboutToFinish ) - { - if ( !AcceptChanges() ) - m_owner->OnRenameCancelled( m_itemEdited ); - - Finish(); - } - - // We must let the native text control handle focus - event.Skip(); -} - -//----------------------------------------------------------------------------- -// wxListMainWindow -//----------------------------------------------------------------------------- - -IMPLEMENT_DYNAMIC_CLASS(wxListMainWindow,wxScrolledWindow) - -BEGIN_EVENT_TABLE(wxListMainWindow,wxScrolledWindow) - EVT_PAINT (wxListMainWindow::OnPaint) - EVT_MOUSE_EVENTS (wxListMainWindow::OnMouse) - EVT_CHAR (wxListMainWindow::OnChar) - EVT_KEY_DOWN (wxListMainWindow::OnKeyDown) - EVT_KEY_UP (wxListMainWindow::OnKeyUp) - EVT_SET_FOCUS (wxListMainWindow::OnSetFocus) - EVT_KILL_FOCUS (wxListMainWindow::OnKillFocus) - EVT_SCROLLWIN (wxListMainWindow::OnScroll) - EVT_CHILD_FOCUS (wxListMainWindow::OnChildFocus) -END_EVENT_TABLE() - -void wxListMainWindow::Init() -{ - m_dirty = true; - m_countVirt = 0; - m_lineFrom = - m_lineTo = (size_t)-1; - m_linesPerPage = 0; - - m_headerWidth = - m_lineHeight = 0; - - m_small_image_list = (wxImageList *) NULL; - m_normal_image_list = (wxImageList *) NULL; - - m_small_spacing = 30; - m_normal_spacing = 40; - - m_hasFocus = false; - m_dragCount = 0; - m_isCreated = false; - - m_lastOnSame = false; - m_renameTimer = new wxListRenameTimer( this ); - m_textctrlWrapper = NULL; - - m_current = - m_lineLastClicked = - m_lineSelectSingleOnUp = - m_lineBeforeLastClicked = (size_t)-1; - - m_freezeCount = 0; -} - -wxListMainWindow::wxListMainWindow() -{ - Init(); - - m_highlightBrush = - m_highlightUnfocusedBrush = (wxBrush *) NULL; -} - -wxListMainWindow::wxListMainWindow( wxWindow *parent, - wxWindowID id, - const wxPoint& pos, - const wxSize& size, - long style, - const wxString &name ) - : wxScrolledWindow( parent, id, pos, size, - style | wxHSCROLL | wxVSCROLL, name ) -{ - Init(); - - m_highlightBrush = new wxBrush - ( - wxSystemSettings::GetColour - ( - wxSYS_COLOUR_HIGHLIGHT - ), - wxSOLID - ); - - m_highlightUnfocusedBrush = new wxBrush - ( - wxSystemSettings::GetColour - ( - wxSYS_COLOUR_BTNSHADOW - ), - wxSOLID - ); - - SetScrollbars( 0, 0, 0, 0, 0, 0 ); - - wxVisualAttributes attr = wxGenericListCtrl::GetClassDefaultAttributes(); - SetOwnForegroundColour( attr.colFg ); - SetOwnBackgroundColour( attr.colBg ); - if (!m_hasFont) - SetOwnFont( attr.font ); -} - -wxListMainWindow::~wxListMainWindow() -{ - DoDeleteAllItems(); - WX_CLEAR_LIST(wxListHeaderDataList, m_columns); - WX_CLEAR_ARRAY(m_aColWidths); - - delete m_highlightBrush; - delete m_highlightUnfocusedBrush; - delete m_renameTimer; -} - -void wxListMainWindow::CacheLineData(size_t line) -{ - wxGenericListCtrl *listctrl = GetListCtrl(); - - wxListLineData *ld = GetDummyLine(); - - size_t countCol = GetColumnCount(); - for ( size_t col = 0; col < countCol; col++ ) - { - ld->SetText(col, listctrl->OnGetItemText(line, col)); - ld->SetImage(col, listctrl->OnGetItemColumnImage(line, col)); - } - - ld->SetAttr(listctrl->OnGetItemAttr(line)); -} - -wxListLineData *wxListMainWindow::GetDummyLine() const -{ - wxASSERT_MSG( !IsEmpty(), _T("invalid line index") ); - wxASSERT_MSG( IsVirtual(), _T("GetDummyLine() shouldn't be called") ); - - wxListMainWindow *self = wxConstCast(this, wxListMainWindow); - - // we need to recreate the dummy line if the number of columns in the - // control changed as it would have the incorrect number of fields - // otherwise - if ( !m_lines.IsEmpty() && - m_lines[0].m_items.GetCount() != (size_t)GetColumnCount() ) - { - self->m_lines.Clear(); - } - - if ( m_lines.IsEmpty() ) - { - wxListLineData *line = new wxListLineData(self); - self->m_lines.Add(line); - - // don't waste extra memory -- there never going to be anything - // else/more in this array - self->m_lines.Shrink(); - } - - return &m_lines[0]; -} - -// ---------------------------------------------------------------------------- -// line geometry (report mode only) -// ---------------------------------------------------------------------------- - -wxCoord wxListMainWindow::GetLineHeight() const -{ - // we cache the line height as calling GetTextExtent() is slow - if ( !m_lineHeight ) - { - wxListMainWindow *self = wxConstCast(this, wxListMainWindow); - - wxClientDC dc( self ); - dc.SetFont( GetFont() ); - - wxCoord y; - dc.GetTextExtent(_T("H"), NULL, &y); - - if ( m_small_image_list && m_small_image_list->GetImageCount() ) - { - int iw = 0, ih = 0; - m_small_image_list->GetSize(0, iw, ih); - y = wxMax(y, ih); - } - - y += EXTRA_HEIGHT; - self->m_lineHeight = y + LINE_SPACING; - } - - return m_lineHeight; -} - -wxCoord wxListMainWindow::GetLineY(size_t line) const -{ - wxASSERT_MSG( InReportView(), _T("only works in report mode") ); - - return LINE_SPACING + line * GetLineHeight(); -} - -wxRect wxListMainWindow::GetLineRect(size_t line) const -{ - if ( !InReportView() ) - return GetLine(line)->m_gi->m_rectAll; - - wxRect rect; - rect.x = HEADER_OFFSET_X; - rect.y = GetLineY(line); - rect.width = GetHeaderWidth(); - rect.height = GetLineHeight(); - - return rect; -} - -wxRect wxListMainWindow::GetLineLabelRect(size_t line) const -{ - if ( !InReportView() ) - return GetLine(line)->m_gi->m_rectLabel; - - int image_x = 0; - wxListLineData *data = GetLine(line); - wxListItemDataList::compatibility_iterator node = data->m_items.GetFirst(); - if (node) - { - wxListItemData *item = node->GetData(); - if ( item->HasImage() ) - { - int ix, iy; - GetImageSize( item->GetImage(), ix, iy ); - image_x = 3 + ix + IMAGE_MARGIN_IN_REPORT_MODE; - } - } - - wxRect rect; - rect.x = image_x + HEADER_OFFSET_X; - rect.y = GetLineY(line); - rect.width = GetColumnWidth(0) - image_x; - rect.height = GetLineHeight(); - - return rect; -} - -wxRect wxListMainWindow::GetLineIconRect(size_t line) const -{ - if ( !InReportView() ) - return GetLine(line)->m_gi->m_rectIcon; - - wxListLineData *ld = GetLine(line); - wxASSERT_MSG( ld->HasImage(), _T("should have an image") ); - - wxRect rect; - rect.x = HEADER_OFFSET_X; - rect.y = GetLineY(line); - GetImageSize(ld->GetImage(), rect.width, rect.height); - - return rect; -} - -wxRect wxListMainWindow::GetLineHighlightRect(size_t line) const -{ - return InReportView() ? GetLineRect(line) - : GetLine(line)->m_gi->m_rectHighlight; -} - -long wxListMainWindow::HitTestLine(size_t line, int x, int y) const -{ - wxASSERT_MSG( line < GetItemCount(), _T("invalid line in HitTestLine") ); - - wxListLineData *ld = GetLine(line); - - if ( ld->HasImage() && GetLineIconRect(line).Contains(x, y) ) - return wxLIST_HITTEST_ONITEMICON; - - // VS: Testing for "ld->HasText() || InReportView()" instead of - // "ld->HasText()" is needed to make empty lines in report view - // possible - if ( ld->HasText() || InReportView() ) - { - wxRect rect = InReportView() ? GetLineRect(line) - : GetLineLabelRect(line); - - if ( rect.Contains(x, y) ) - return wxLIST_HITTEST_ONITEMLABEL; - } - - return 0; -} - -// ---------------------------------------------------------------------------- -// highlight (selection) handling -// ---------------------------------------------------------------------------- - -bool wxListMainWindow::IsHighlighted(size_t line) const -{ - if ( IsVirtual() ) - { - return m_selStore.IsSelected(line); - } - else // !virtual - { - wxListLineData *ld = GetLine(line); - wxCHECK_MSG( ld, false, _T("invalid index in IsHighlighted") ); - - return ld->IsHighlighted(); - } -} - -void wxListMainWindow::HighlightLines( size_t lineFrom, - size_t lineTo, - bool highlight ) -{ - if ( IsVirtual() ) - { - wxArrayInt linesChanged; - if ( !m_selStore.SelectRange(lineFrom, lineTo, highlight, - &linesChanged) ) - { - // meny items changed state, refresh everything - RefreshLines(lineFrom, lineTo); - } - else // only a few items changed state, refresh only them - { - size_t count = linesChanged.GetCount(); - for ( size_t n = 0; n < count; n++ ) - { - RefreshLine(linesChanged[n]); - } - } - } - else // iterate over all items in non report view - { - for ( size_t line = lineFrom; line <= lineTo; line++ ) - { - if ( HighlightLine(line, highlight) ) - RefreshLine(line); - } - } -} - -bool wxListMainWindow::HighlightLine( size_t line, bool highlight ) -{ - bool changed; - - if ( IsVirtual() ) - { - changed = m_selStore.SelectItem(line, highlight); - } - else // !virtual - { - wxListLineData *ld = GetLine(line); - wxCHECK_MSG( ld, false, _T("invalid index in HighlightLine") ); - - changed = ld->Highlight(highlight); - } - - if ( changed ) - { - SendNotify( line, highlight ? wxEVT_COMMAND_LIST_ITEM_SELECTED - : wxEVT_COMMAND_LIST_ITEM_DESELECTED ); - } - - return changed; -} - -void wxListMainWindow::RefreshLine( size_t line ) -{ - if ( InReportView() ) - { - size_t visibleFrom, visibleTo; - GetVisibleLinesRange(&visibleFrom, &visibleTo); - - if ( line < visibleFrom || line > visibleTo ) - return; - } - - wxRect rect = GetLineRect(line); - - CalcScrolledPosition( rect.x, rect.y, &rect.x, &rect.y ); - RefreshRect( rect ); -} - -void wxListMainWindow::RefreshLines( size_t lineFrom, size_t lineTo ) -{ - // we suppose that they are ordered by caller - wxASSERT_MSG( lineFrom <= lineTo, _T("indices in disorder") ); - - wxASSERT_MSG( lineTo < GetItemCount(), _T("invalid line range") ); - - if ( InReportView() ) - { - size_t visibleFrom, visibleTo; - GetVisibleLinesRange(&visibleFrom, &visibleTo); - - if ( lineFrom < visibleFrom ) - lineFrom = visibleFrom; - if ( lineTo > visibleTo ) - lineTo = visibleTo; - - wxRect rect; - rect.x = 0; - rect.y = GetLineY(lineFrom); - rect.width = GetClientSize().x; - rect.height = GetLineY(lineTo) - rect.y + GetLineHeight(); - - CalcScrolledPosition( rect.x, rect.y, &rect.x, &rect.y ); - RefreshRect( rect ); - } - else // !report - { - // TODO: this should be optimized... - for ( size_t line = lineFrom; line <= lineTo; line++ ) - { - RefreshLine(line); - } - } -} - -void wxListMainWindow::RefreshAfter( size_t lineFrom ) -{ - if ( InReportView() ) - { - size_t visibleFrom, visibleTo; - GetVisibleLinesRange(&visibleFrom, &visibleTo); - - if ( lineFrom < visibleFrom ) - lineFrom = visibleFrom; - else if ( lineFrom > visibleTo ) - return; - - wxRect rect; - rect.x = 0; - rect.y = GetLineY(lineFrom); - CalcScrolledPosition( rect.x, rect.y, &rect.x, &rect.y ); - - wxSize size = GetClientSize(); - rect.width = size.x; - - // refresh till the bottom of the window - rect.height = size.y - rect.y; - - RefreshRect( rect ); - } - else // !report - { - // TODO: how to do it more efficiently? - m_dirty = true; - } -} - -void wxListMainWindow::RefreshSelected() -{ - if ( IsEmpty() ) - return; - - size_t from, to; - if ( InReportView() ) - { - GetVisibleLinesRange(&from, &to); - } - else // !virtual - { - from = 0; - to = GetItemCount() - 1; - } - - if ( HasCurrent() && m_current >= from && m_current <= to ) - RefreshLine(m_current); - - for ( size_t line = from; line <= to; line++ ) - { - // NB: the test works as expected even if m_current == -1 - if ( line != m_current && IsHighlighted(line) ) - RefreshLine(line); - } -} - -void wxListMainWindow::Freeze() -{ - m_freezeCount++; -} - -void wxListMainWindow::Thaw() -{ - wxCHECK_RET( m_freezeCount > 0, _T("thawing unfrozen list control?") ); - - if ( --m_freezeCount == 0 ) - { - if (m_dirty) - RecalculatePositions(); - else - Refresh(); - } -} - -void wxListMainWindow::OnPaint( wxPaintEvent &WXUNUSED(event) ) -{ - // Note: a wxPaintDC must be constructed even if no drawing is - // done (a Windows requirement). - wxPaintDC dc( this ); - - if ( IsEmpty() || m_freezeCount ) - // nothing to draw or not the moment to draw it - return; - - if ( m_dirty ) - // delay the repainting until we calculate all the items positions - return; - - PrepareDC( dc ); - - int dev_x, dev_y; - CalcScrolledPosition( 0, 0, &dev_x, &dev_y ); - - dc.SetFont( GetFont() ); - - if ( InReportView() ) - { - int lineHeight = GetLineHeight(); - - size_t visibleFrom, visibleTo; - GetVisibleLinesRange(&visibleFrom, &visibleTo); - - wxRect rectLine; - int xOrig = dc.LogicalToDeviceX( 0 ); - int yOrig = dc.LogicalToDeviceY( 0 ); - - // tell the caller cache to cache the data - if ( IsVirtual() ) - { - wxListEvent evCache(wxEVT_COMMAND_LIST_CACHE_HINT, - GetParent()->GetId()); - evCache.SetEventObject( GetParent() ); - evCache.m_oldItemIndex = visibleFrom; - evCache.m_itemIndex = visibleTo; - GetParent()->GetEventHandler()->ProcessEvent( evCache ); - } - - for ( size_t line = visibleFrom; line <= visibleTo; line++ ) - { - rectLine = GetLineRect(line); - - - if ( !IsExposed(rectLine.x + xOrig, rectLine.y + yOrig, - rectLine.width, rectLine.height) ) - { - // don't redraw unaffected lines to avoid flicker - continue; - } - - GetLine(line)->DrawInReportMode( &dc, - rectLine, - GetLineHighlightRect(line), - IsHighlighted(line) ); - } - - if ( HasFlag(wxLC_HRULES) ) - { - wxPen pen(GetRuleColour(), 1, wxSOLID); - wxSize clientSize = GetClientSize(); - - size_t i = visibleFrom; - if (i == 0) i = 1; // Don't draw the first one - for ( ; i <= visibleTo; i++ ) - { - dc.SetPen(pen); - dc.SetBrush( *wxTRANSPARENT_BRUSH ); - dc.DrawLine(0 - dev_x, i * lineHeight, - clientSize.x - dev_x, i * lineHeight); - } - - // Draw last horizontal rule - if ( visibleTo == GetItemCount() - 1 ) - { - dc.SetPen( pen ); - dc.SetBrush( *wxTRANSPARENT_BRUSH ); - dc.DrawLine(0 - dev_x, (m_lineTo + 1) * lineHeight, - clientSize.x - dev_x , (m_lineTo + 1) * lineHeight ); - } - } - - // Draw vertical rules if required - if ( HasFlag(wxLC_VRULES) && !IsEmpty() ) - { - wxPen pen(GetRuleColour(), 1, wxSOLID); - wxRect firstItemRect, lastItemRect; - - GetItemRect(visibleFrom, firstItemRect); - GetItemRect(visibleTo, lastItemRect); - int x = firstItemRect.GetX(); - dc.SetPen(pen); - dc.SetBrush(* wxTRANSPARENT_BRUSH); - - for (int col = 0; col < GetColumnCount(); col++) - { - int colWidth = GetColumnWidth(col); - x += colWidth; - int x_pos = x - dev_x; - if (col < GetColumnCount()-1) x_pos -= 2; - dc.DrawLine(x_pos, firstItemRect.GetY() - 1 - dev_y, - x_pos, lastItemRect.GetBottom() + 1 - dev_y); - } - } - } - else // !report - { - size_t count = GetItemCount(); - for ( size_t i = 0; i < count; i++ ) - { - GetLine(i)->Draw( &dc ); - } - } - -#ifndef __WXMAC__ - // Don't draw rect outline under Mac at all. - if ( HasCurrent() ) - { - if ( m_hasFocus ) - { - wxRect rect( GetLineHighlightRect( m_current ) ); -#ifndef __WXGTK20__ - dc.SetPen( *wxBLACK_PEN ); - dc.SetBrush( *wxTRANSPARENT_BRUSH ); - dc.DrawRectangle( rect ); -#else - wxRendererNative::Get().DrawItemSelectionRect( this, dc, rect, wxCONTROL_CURRENT|wxCONTROL_FOCUSED ); - -#endif - } - } -#endif -} - -void wxListMainWindow::HighlightAll( bool on ) -{ - if ( IsSingleSel() ) - { - wxASSERT_MSG( !on, _T("can't do this in a single selection control") ); - - // we just have one item to turn off - if ( HasCurrent() && IsHighlighted(m_current) ) - { - HighlightLine(m_current, false); - RefreshLine(m_current); - } - } - else // multi selection - { - if ( !IsEmpty() ) - HighlightLines(0, GetItemCount() - 1, on); - } -} - -void wxListMainWindow::OnChildFocus(wxChildFocusEvent& WXUNUSED(event)) -{ - // Do nothing here. This prevents the default handler in wxScrolledWindow - // from needlessly scrolling the window when the edit control is - // dismissed. See ticket #9563. -} - -void wxListMainWindow::SendNotify( size_t line, - wxEventType command, - const wxPoint& point ) -{ - wxListEvent le( command, GetParent()->GetId() ); - le.SetEventObject( GetParent() ); - - le.m_itemIndex = line; - - // set only for events which have position - if ( point != wxDefaultPosition ) - le.m_pointDrag = point; - - // don't try to get the line info for virtual list controls: the main - // program has it anyhow and if we did it would result in accessing all - // the lines, even those which are not visible now and this is precisely - // what we're trying to avoid - if ( !IsVirtual() ) - { - if ( line != (size_t)-1 ) - { - GetLine(line)->GetItem( 0, le.m_item ); - } - //else: this happens for wxEVT_COMMAND_LIST_ITEM_FOCUSED event - } - //else: there may be no more such item - - GetParent()->GetEventHandler()->ProcessEvent( le ); -} - -void wxListMainWindow::ChangeCurrent(size_t current) -{ - m_current = current; - - // as the current item changed, we shouldn't start editing it when the - // "slow click" timer expires as the click happened on another item - if ( m_renameTimer->IsRunning() ) - m_renameTimer->Stop(); - - SendNotify(current, wxEVT_COMMAND_LIST_ITEM_FOCUSED); -} - -wxTextCtrl *wxListMainWindow::EditLabel(long item, wxClassInfo* textControlClass) -{ - wxCHECK_MSG( (item >= 0) && ((size_t)item < GetItemCount()), NULL, - wxT("wrong index in wxGenericListCtrl::EditLabel()") ); - - wxASSERT_MSG( textControlClass->IsKindOf(CLASSINFO(wxTextCtrl)), - wxT("EditLabel() needs a text control") ); - - size_t itemEdit = (size_t)item; - - wxListEvent le( wxEVT_COMMAND_LIST_BEGIN_LABEL_EDIT, GetParent()->GetId() ); - le.SetEventObject( GetParent() ); - le.m_itemIndex = item; - wxListLineData *data = GetLine(itemEdit); - wxCHECK_MSG( data, NULL, _T("invalid index in EditLabel()") ); - data->GetItem( 0, le.m_item ); - - if ( GetParent()->GetEventHandler()->ProcessEvent( le ) && !le.IsAllowed() ) - { - // vetoed by user code - return NULL; - } - - // We have to call this here because the label in question might just have - // been added and no screen update taken place. - if ( m_dirty ) - { - wxSafeYield(); - - // Pending events dispatched by wxSafeYield might have changed the item - // count - if ( (size_t)item >= GetItemCount() ) - return NULL; - } - - wxTextCtrl * const text = (wxTextCtrl *)textControlClass->CreateObject(); - m_textctrlWrapper = new wxListTextCtrlWrapper(this, text, item); - return m_textctrlWrapper->GetText(); -} - -void wxListMainWindow::OnRenameTimer() -{ - wxCHECK_RET( HasCurrent(), wxT("unexpected rename timer") ); - - EditLabel( m_current ); -} - -bool wxListMainWindow::OnRenameAccept(size_t itemEdit, const wxString& value) -{ - wxListEvent le( wxEVT_COMMAND_LIST_END_LABEL_EDIT, GetParent()->GetId() ); - le.SetEventObject( GetParent() ); - le.m_itemIndex = itemEdit; - - wxListLineData *data = GetLine(itemEdit); - - wxCHECK_MSG( data, false, _T("invalid index in OnRenameAccept()") ); - - data->GetItem( 0, le.m_item ); - le.m_item.m_text = value; - return !GetParent()->GetEventHandler()->ProcessEvent( le ) || - le.IsAllowed(); -} - -void wxListMainWindow::OnRenameCancelled(size_t itemEdit) -{ - // let owner know that the edit was cancelled - wxListEvent le( wxEVT_COMMAND_LIST_END_LABEL_EDIT, GetParent()->GetId() ); - - le.SetEditCanceled(true); - - le.SetEventObject( GetParent() ); - le.m_itemIndex = itemEdit; - - wxListLineData *data = GetLine(itemEdit); - wxCHECK_RET( data, _T("invalid index in OnRenameCancelled()") ); - - data->GetItem( 0, le.m_item ); - GetEventHandler()->ProcessEvent( le ); -} - -void wxListMainWindow::OnMouse( wxMouseEvent &event ) -{ - -#ifdef __WXMAC__ - // On wxMac we can't depend on the EVT_KILL_FOCUS event to properly - // shutdown the edit control when the mouse is clicked elsewhere on the - // listctrl because the order of events is different (or something like - // that), so explicitly end the edit if it is active. - if ( event.LeftDown() && m_textctrlWrapper ) - m_textctrlWrapper->AcceptChangesAndFinish(); -#endif // __WXMAC__ - - if ( event.LeftDown() ) - SetFocusIgnoringChildren(); - - event.SetEventObject( GetParent() ); - if ( GetParent()->GetEventHandler()->ProcessEvent( event) ) - return; - - if (event.GetEventType() == wxEVT_MOUSEWHEEL) - { - // let the base handle mouse wheel events. - event.Skip(); - return; - } - - if ( !HasCurrent() || IsEmpty() ) - { - if (event.RightDown()) - { - SendNotify( (size_t)-1, wxEVT_COMMAND_LIST_ITEM_RIGHT_CLICK, event.GetPosition() ); - // Allow generation of context menu event - event.Skip(); - } - return; - } - - if (m_dirty) - return; - - if ( !(event.Dragging() || event.ButtonDown() || event.LeftUp() || - event.ButtonDClick()) ) - return; - - int x = event.GetX(); - int y = event.GetY(); - CalcUnscrolledPosition( x, y, &x, &y ); - - // where did we hit it (if we did)? - long hitResult = 0; - - size_t count = GetItemCount(), - current; - - if ( InReportView() ) - { - current = y / GetLineHeight(); - if ( current < count ) - hitResult = HitTestLine(current, x, y); - } - else // !report - { - // TODO: optimize it too! this is less simple than for report view but - // enumerating all items is still not a way to do it!! - for ( current = 0; current < count; current++ ) - { - hitResult = HitTestLine(current, x, y); - if ( hitResult ) - break; - } - } - - if (event.Dragging()) - { - if (m_dragCount == 0) - { - // we have to report the raw, physical coords as we want to be - // able to call HitTest(event.m_pointDrag) from the user code to - // get the item being dragged - m_dragStart = event.GetPosition(); - } - - m_dragCount++; - - if (m_dragCount != 3) - return; - - int command = event.RightIsDown() ? wxEVT_COMMAND_LIST_BEGIN_RDRAG - : wxEVT_COMMAND_LIST_BEGIN_DRAG; - - wxListEvent le( command, GetParent()->GetId() ); - le.SetEventObject( GetParent() ); - le.m_itemIndex = m_lineLastClicked; - le.m_pointDrag = m_dragStart; - GetParent()->GetEventHandler()->ProcessEvent( le ); - - return; - } - else - { - m_dragCount = 0; - } - - if ( !hitResult ) - { - // outside of any item - if (event.RightDown()) - { - SendNotify( (size_t) -1, wxEVT_COMMAND_LIST_ITEM_RIGHT_CLICK, event.GetPosition() ); - - wxContextMenuEvent evtCtx( - wxEVT_CONTEXT_MENU, - GetParent()->GetId(), - ClientToScreen(event.GetPosition())); - evtCtx.SetEventObject(GetParent()); - GetParent()->GetEventHandler()->ProcessEvent(evtCtx); - } - else - { - // reset the selection and bail out - HighlightAll(false); - } - - return; - } - - bool forceClick = false; - if (event.ButtonDClick()) - { - if ( m_renameTimer->IsRunning() ) - m_renameTimer->Stop(); - - m_lastOnSame = false; - - if ( current == m_lineLastClicked ) - { - SendNotify( current, wxEVT_COMMAND_LIST_ITEM_ACTIVATED ); - - return; - } - else - { - // The first click was on another item, so don't interpret this as - // a double click, but as a simple click instead - forceClick = true; - } - } - - if (event.LeftUp()) - { - if (m_lineSelectSingleOnUp != (size_t)-1) - { - // select single line - HighlightAll( false ); - ReverseHighlight(m_lineSelectSingleOnUp); - } - - if (m_lastOnSame) - { - if ((current == m_current) && - (hitResult == wxLIST_HITTEST_ONITEMLABEL) && - HasFlag(wxLC_EDIT_LABELS) ) - { - if (InReportView()) - { - wxRect label = GetLineLabelRect( current ); - if (label.Contains( x, y )) - m_renameTimer->Start( 250, true ); - - } - else - m_renameTimer->Start( 250, true ); - } - } - - m_lastOnSame = false; - m_lineSelectSingleOnUp = (size_t)-1; - } - else - { - // This is necessary, because after a DnD operation in - // from and to ourself, the up event is swallowed by the - // DnD code. So on next non-up event (which means here and - // now) m_lineSelectSingleOnUp should be reset. - m_lineSelectSingleOnUp = (size_t)-1; - } - if (event.RightDown()) - { - m_lineBeforeLastClicked = m_lineLastClicked; - m_lineLastClicked = current; - - // If the item is already selected, do not update the selection. - // Multi-selections should not be cleared if a selected item is clicked. - if (!IsHighlighted(current)) - { - HighlightAll(false); - ChangeCurrent(current); - ReverseHighlight(m_current); - } - - SendNotify( current, wxEVT_COMMAND_LIST_ITEM_RIGHT_CLICK, event.GetPosition() ); - - wxContextMenuEvent evtCtx( - wxEVT_CONTEXT_MENU, - GetParent()->GetId(), - ClientToScreen(event.GetPosition())); - evtCtx.SetEventObject(GetParent()); - GetParent()->GetEventHandler()->ProcessEvent(evtCtx); - } - else if (event.MiddleDown()) - { - SendNotify( current, wxEVT_COMMAND_LIST_ITEM_MIDDLE_CLICK ); - } - else if ( event.LeftDown() || forceClick ) - { - m_lineBeforeLastClicked = m_lineLastClicked; - m_lineLastClicked = current; - - size_t oldCurrent = m_current; - bool oldWasSelected = IsHighlighted(m_current); - - bool cmdModifierDown = event.CmdDown(); - if ( IsSingleSel() || !(cmdModifierDown || event.ShiftDown()) ) - { - if ( IsSingleSel() || !IsHighlighted(current) ) - { - HighlightAll( false ); - - ChangeCurrent(current); - - ReverseHighlight(m_current); - } - else // multi sel & current is highlighted & no mod keys - { - m_lineSelectSingleOnUp = current; - ChangeCurrent(current); // change focus - } - } - else // multi sel & either ctrl or shift is down - { - if (cmdModifierDown) - { - ChangeCurrent(current); - - ReverseHighlight(m_current); - } - else if (event.ShiftDown()) - { - ChangeCurrent(current); - - size_t lineFrom = oldCurrent, - lineTo = current; - - if ( lineTo < lineFrom ) - { - lineTo = lineFrom; - lineFrom = m_current; - } - - HighlightLines(lineFrom, lineTo); - } - else // !ctrl, !shift - { - // test in the enclosing if should make it impossible - wxFAIL_MSG( _T("how did we get here?") ); - } - } - - if (m_current != oldCurrent) - RefreshLine( oldCurrent ); - - // forceClick is only set if the previous click was on another item - m_lastOnSame = !forceClick && (m_current == oldCurrent) && oldWasSelected; - } -} - -void wxListMainWindow::MoveToItem(size_t item) -{ - if ( item == (size_t)-1 ) - return; - - wxRect rect = GetLineRect(item); - - int client_w, client_h; - GetClientSize( &client_w, &client_h ); - - const int hLine = GetLineHeight(); - - int view_x = SCROLL_UNIT_X * GetScrollPos( wxHORIZONTAL ); - int view_y = hLine * GetScrollPos( wxVERTICAL ); - - if ( InReportView() ) - { - // the next we need the range of lines shown it might be different, - // so recalculate it - ResetVisibleLinesRange(); - - if (rect.y < view_y) - Scroll( -1, rect.y / hLine ); - if (rect.y + rect.height + 5 > view_y + client_h) - Scroll( -1, (rect.y + rect.height - client_h + hLine) / hLine ); - -#ifdef __WXMAC__ - // At least on Mac the visible lines value will get reset inside of - // Scroll *before* it actually scrolls the window because of the - // Update() that happens there, so it will still have the wrong value. - // So let's reset it again and wait for it to be recalculated in the - // next paint event. I would expect this problem to show up in wxGTK - // too but couldn't duplicate it there. Perhaps the order of events - // is different... --Robin - ResetVisibleLinesRange(); -#endif - } - else // !report - { - int sx = -1, - sy = -1; - - if (rect.x-view_x < 5) - sx = (rect.x - 5) / SCROLL_UNIT_X; - if (rect.x + rect.width - 5 > view_x + client_w) - sx = (rect.x + rect.width - client_w + SCROLL_UNIT_X) / SCROLL_UNIT_X; - - if (rect.y-view_y < 5) - sy = (rect.y - 5) / hLine; - if (rect.y + rect.height - 5 > view_y + client_h) - sy = (rect.y + rect.height - client_h + hLine) / hLine; - - Scroll(sx, sy); - } -} - -bool wxListMainWindow::ScrollList(int WXUNUSED(dx), int dy) -{ - if ( !InReportView() ) - { - // TODO: this should work in all views but is not implemented now - return false; - } - - size_t top, bottom; - GetVisibleLinesRange(&top, &bottom); - - if ( bottom == (size_t)-1 ) - return 0; - - ResetVisibleLinesRange(); - - int hLine = GetLineHeight(); - - Scroll(-1, top + dy / hLine); - -#ifdef __WXMAC__ - // see comment in MoveToItem() for why we do this - ResetVisibleLinesRange(); -#endif - - return true; -} - -// ---------------------------------------------------------------------------- -// keyboard handling -// ---------------------------------------------------------------------------- - -void wxListMainWindow::OnArrowChar(size_t newCurrent, const wxKeyEvent& event) -{ - wxCHECK_RET( newCurrent < (size_t)GetItemCount(), - _T("invalid item index in OnArrowChar()") ); - - size_t oldCurrent = m_current; - - // in single selection we just ignore Shift as we can't select several - // items anyhow - if ( event.ShiftDown() && !IsSingleSel() ) - { - ChangeCurrent(newCurrent); - - // refresh the old focus to remove it - RefreshLine( oldCurrent ); - - // select all the items between the old and the new one - if ( oldCurrent > newCurrent ) - { - newCurrent = oldCurrent; - oldCurrent = m_current; - } - - HighlightLines(oldCurrent, newCurrent); - } - else // !shift - { - // all previously selected items are unselected unless ctrl is held - // in a multiselection control - if ( !event.ControlDown() || IsSingleSel() ) - HighlightAll(false); - - ChangeCurrent(newCurrent); - - // refresh the old focus to remove it - RefreshLine( oldCurrent ); - - // in single selection mode we must always have a selected item - if ( !event.ControlDown() || IsSingleSel() ) - HighlightLine( m_current, true ); - } - - RefreshLine( m_current ); - - MoveToFocus(); -} - -void wxListMainWindow::OnKeyDown( wxKeyEvent &event ) -{ - wxWindow *parent = GetParent(); - - // propagate the key event upwards - wxKeyEvent ke(event); - if (parent->GetEventHandler()->ProcessEvent( ke )) - return; - - event.Skip(); -} - -void wxListMainWindow::OnKeyUp( wxKeyEvent &event ) -{ - wxWindow *parent = GetParent(); - - // propagate the key event upwards - wxKeyEvent ke(event); - ke.SetEventObject( parent ); - if (parent->GetEventHandler()->ProcessEvent( ke )) - return; - - event.Skip(); -} - -void wxListMainWindow::OnChar( wxKeyEvent &event ) -{ - wxWindow *parent = GetParent(); - - // send a list_key event up - if ( HasCurrent() ) - { - wxListEvent le( wxEVT_COMMAND_LIST_KEY_DOWN, GetParent()->GetId() ); - le.m_itemIndex = m_current; - GetLine(m_current)->GetItem( 0, le.m_item ); - le.m_code = event.GetKeyCode(); - le.SetEventObject( parent ); - parent->GetEventHandler()->ProcessEvent( le ); - } - - // propagate the char event upwards - wxKeyEvent ke(event); - if (parent->GetEventHandler()->ProcessEvent( ke )) - return; - - if (event.GetKeyCode() == WXK_TAB) - { - wxNavigationKeyEvent nevent; - nevent.SetWindowChange( event.ControlDown() ); - nevent.SetDirection( !event.ShiftDown() ); - nevent.SetEventObject( GetParent()->GetParent() ); - nevent.SetCurrentFocus( m_parent ); - if (GetParent()->GetParent()->GetEventHandler()->ProcessEvent( nevent )) - return; - } - - // no item -> nothing to do - if (!HasCurrent()) - { - event.Skip(); - return; - } - - // don't use m_linesPerPage directly as it might not be computed yet - const int pageSize = GetCountPerPage(); - wxCHECK_RET( pageSize, _T("should have non zero page size") ); - - if (GetLayoutDirection() == wxLayout_RightToLeft) - { - if (event.GetKeyCode() == WXK_RIGHT) - event.m_keyCode = WXK_LEFT; - else if (event.GetKeyCode() == WXK_LEFT) - event.m_keyCode = WXK_RIGHT; - } - - switch ( event.GetKeyCode() ) - { - case WXK_UP: - if ( m_current > 0 ) - OnArrowChar( m_current - 1, event ); - break; - - case WXK_DOWN: - if ( m_current < (size_t)GetItemCount() - 1 ) - OnArrowChar( m_current + 1, event ); - break; - - case WXK_END: - if (!IsEmpty()) - OnArrowChar( GetItemCount() - 1, event ); - break; - - case WXK_HOME: - if (!IsEmpty()) - OnArrowChar( 0, event ); - break; - - case WXK_PAGEUP: - { - int steps = InReportView() ? pageSize - 1 - : m_current % pageSize; - - int index = m_current - steps; - if (index < 0) - index = 0; - - OnArrowChar( index, event ); - } - break; - - case WXK_PAGEDOWN: - { - int steps = InReportView() - ? pageSize - 1 - : pageSize - (m_current % pageSize) - 1; - - size_t index = m_current + steps; - size_t count = GetItemCount(); - if ( index >= count ) - index = count - 1; - - OnArrowChar( index, event ); - } - break; - - case WXK_LEFT: - if ( !InReportView() ) - { - int index = m_current - pageSize; - if (index < 0) - index = 0; - - OnArrowChar( index, event ); - } - break; - - case WXK_RIGHT: - if ( !InReportView() ) - { - size_t index = m_current + pageSize; - - size_t count = GetItemCount(); - if ( index >= count ) - index = count - 1; - - OnArrowChar( index, event ); - } - break; - - case WXK_SPACE: - if ( IsSingleSel() ) - { - if ( event.ControlDown() ) - { - ReverseHighlight(m_current); - } - else // normal space press - { - SendNotify( m_current, wxEVT_COMMAND_LIST_ITEM_ACTIVATED ); - } - } - else // multiple selection - { - ReverseHighlight(m_current); - } - break; - - case WXK_RETURN: - case WXK_EXECUTE: - SendNotify( m_current, wxEVT_COMMAND_LIST_ITEM_ACTIVATED ); - break; - - default: - event.Skip(); - } -} - -// ---------------------------------------------------------------------------- -// focus handling -// ---------------------------------------------------------------------------- - -void wxListMainWindow::OnSetFocus( wxFocusEvent &WXUNUSED(event) ) -{ - if ( GetParent() ) - { - wxFocusEvent event( wxEVT_SET_FOCUS, GetParent()->GetId() ); - event.SetEventObject( GetParent() ); - if ( GetParent()->GetEventHandler()->ProcessEvent( event) ) - return; - } - - // wxGTK sends us EVT_SET_FOCUS events even if we had never got - // EVT_KILL_FOCUS before which means that we finish by redrawing the items - // which are already drawn correctly resulting in horrible flicker - avoid - // it - if ( !m_hasFocus ) - { - m_hasFocus = true; - - RefreshSelected(); - } -} - -void wxListMainWindow::OnKillFocus( wxFocusEvent &WXUNUSED(event) ) -{ - if ( GetParent() ) - { - wxFocusEvent event( wxEVT_KILL_FOCUS, GetParent()->GetId() ); - event.SetEventObject( GetParent() ); - if ( GetParent()->GetEventHandler()->ProcessEvent( event) ) - return; - } - - m_hasFocus = false; - RefreshSelected(); -} - -void wxListMainWindow::DrawImage( int index, wxDC *dc, int x, int y ) -{ - if ( HasFlag(wxLC_ICON) && (m_normal_image_list)) - { - m_normal_image_list->Draw( index, *dc, x, y, wxIMAGELIST_DRAW_TRANSPARENT ); - } - else if ( HasFlag(wxLC_SMALL_ICON) && (m_small_image_list)) - { - m_small_image_list->Draw( index, *dc, x, y, wxIMAGELIST_DRAW_TRANSPARENT ); - } - else if ( HasFlag(wxLC_LIST) && (m_small_image_list)) - { - m_small_image_list->Draw( index, *dc, x, y, wxIMAGELIST_DRAW_TRANSPARENT ); - } - else if ( InReportView() && (m_small_image_list)) - { - m_small_image_list->Draw( index, *dc, x, y, wxIMAGELIST_DRAW_TRANSPARENT ); - } -} - -void wxListMainWindow::GetImageSize( int index, int &width, int &height ) const -{ - if ( HasFlag(wxLC_ICON) && m_normal_image_list ) - { - m_normal_image_list->GetSize( index, width, height ); - } - else if ( HasFlag(wxLC_SMALL_ICON) && m_small_image_list ) - { - m_small_image_list->GetSize( index, width, height ); - } - else if ( HasFlag(wxLC_LIST) && m_small_image_list ) - { - m_small_image_list->GetSize( index, width, height ); - } - else if ( InReportView() && m_small_image_list ) - { - m_small_image_list->GetSize( index, width, height ); - } - else - { - width = - height = 0; - } -} - -int wxListMainWindow::GetTextLength( const wxString &s ) const -{ - wxClientDC dc( wxConstCast(this, wxListMainWindow) ); - dc.SetFont( GetFont() ); - - wxCoord lw; - dc.GetTextExtent( s, &lw, NULL ); - - return lw + AUTOSIZE_COL_MARGIN; -} - -void wxListMainWindow::SetImageList( wxImageList *imageList, int which ) -{ - m_dirty = true; - - // calc the spacing from the icon size - int width = 0, height = 0; - - if ((imageList) && (imageList->GetImageCount()) ) - imageList->GetSize(0, width, height); - - if (which == wxIMAGE_LIST_NORMAL) - { - m_normal_image_list = imageList; - m_normal_spacing = width + 8; - } - - if (which == wxIMAGE_LIST_SMALL) - { - m_small_image_list = imageList; - m_small_spacing = width + 14; - m_lineHeight = 0; // ensure that the line height will be recalc'd - } -} - -void wxListMainWindow::SetItemSpacing( int spacing, bool isSmall ) -{ - m_dirty = true; - if (isSmall) - m_small_spacing = spacing; - else - m_normal_spacing = spacing; -} - -int wxListMainWindow::GetItemSpacing( bool isSmall ) -{ - return isSmall ? m_small_spacing : m_normal_spacing; -} - -// ---------------------------------------------------------------------------- -// columns -// ---------------------------------------------------------------------------- - -void wxListMainWindow::SetColumn( int col, wxListItem &item ) -{ - wxListHeaderDataList::compatibility_iterator node = m_columns.Item( col ); - - wxCHECK_RET( node, _T("invalid column index in SetColumn") ); - - if ( item.m_width == wxLIST_AUTOSIZE_USEHEADER ) - item.m_width = GetTextLength( item.m_text ); - - wxListHeaderData *column = node->GetData(); - column->SetItem( item ); - - wxListHeaderWindow *headerWin = GetListCtrl()->m_headerWin; - if ( headerWin ) - headerWin->m_dirty = true; - - m_dirty = true; - - // invalidate it as it has to be recalculated - m_headerWidth = 0; -} - -void wxListMainWindow::SetColumnWidth( int col, int width ) -{ - wxCHECK_RET( col >= 0 && col < GetColumnCount(), - _T("invalid column index") ); - - wxCHECK_RET( InReportView(), - _T("SetColumnWidth() can only be called in report mode.") ); - - m_dirty = true; - wxListHeaderWindow *headerWin = GetListCtrl()->m_headerWin; - if ( headerWin ) - headerWin->m_dirty = true; - - wxListHeaderDataList::compatibility_iterator node = m_columns.Item( col ); - wxCHECK_RET( node, _T("no column?") ); - - wxListHeaderData *column = node->GetData(); - - size_t count = GetItemCount(); - - if (width == wxLIST_AUTOSIZE_USEHEADER) - { - width = GetTextLength(column->GetText()); - width += 2*EXTRA_WIDTH; - - // check for column header's image availability - const int image = column->GetImage(); - if ( image != -1 ) - { - if ( m_small_image_list ) - { - int ix = 0, iy = 0; - m_small_image_list->GetSize(image, ix, iy); - width += ix + HEADER_IMAGE_MARGIN_IN_REPORT_MODE; - } - } - } - else if ( width == wxLIST_AUTOSIZE ) - { - if ( IsVirtual() ) - { - // TODO: determine the max width somehow... - width = WIDTH_COL_DEFAULT; - } - else // !virtual - { - wxClientDC dc(this); - dc.SetFont( GetFont() ); - - int max = AUTOSIZE_COL_MARGIN; - - // if the cached column width isn't valid then recalculate it - if (m_aColWidths.Item(col)->bNeedsUpdate) - { - for (size_t i = 0; i < count; i++) - { - wxListLineData *line = GetLine( i ); - wxListItemDataList::compatibility_iterator n = line->m_items.Item( col ); - - wxCHECK_RET( n, _T("no subitem?") ); - - wxListItemData *itemData = n->GetData(); - wxListItem item; - - itemData->GetItem(item); - int itemWidth = GetItemWidthWithImage(&item); - if (itemWidth > max) - max = itemWidth; - } - - m_aColWidths.Item(col)->bNeedsUpdate = false; - m_aColWidths.Item(col)->nMaxWidth = max; - } - - max = m_aColWidths.Item(col)->nMaxWidth; - width = max + AUTOSIZE_COL_MARGIN; - } - } - - column->SetWidth( width ); - - // invalidate it as it has to be recalculated - m_headerWidth = 0; -} - -int wxListMainWindow::GetHeaderWidth() const -{ - if ( !m_headerWidth ) - { - wxListMainWindow *self = wxConstCast(this, wxListMainWindow); - - size_t count = GetColumnCount(); - for ( size_t col = 0; col < count; col++ ) - { - self->m_headerWidth += GetColumnWidth(col); - } - } - - return m_headerWidth; -} - -void wxListMainWindow::GetColumn( int col, wxListItem &item ) const -{ - wxListHeaderDataList::compatibility_iterator node = m_columns.Item( col ); - wxCHECK_RET( node, _T("invalid column index in GetColumn") ); - - wxListHeaderData *column = node->GetData(); - column->GetItem( item ); -} - -int wxListMainWindow::GetColumnWidth( int col ) const -{ - wxListHeaderDataList::compatibility_iterator node = m_columns.Item( col ); - wxCHECK_MSG( node, 0, _T("invalid column index") ); - - wxListHeaderData *column = node->GetData(); - return column->GetWidth(); -} - -// ---------------------------------------------------------------------------- -// item state -// ---------------------------------------------------------------------------- - -void wxListMainWindow::SetItem( wxListItem &item ) -{ - long id = item.m_itemId; - wxCHECK_RET( id >= 0 && (size_t)id < GetItemCount(), - _T("invalid item index in SetItem") ); - - if ( !IsVirtual() ) - { - wxListLineData *line = GetLine((size_t)id); - line->SetItem( item.m_col, item ); - - // Set item state if user wants - if ( item.m_mask & wxLIST_MASK_STATE ) - SetItemState( item.m_itemId, item.m_state, item.m_state ); - - if (InReportView()) - { - // update the Max Width Cache if needed - int width = GetItemWidthWithImage(&item); - - if (width > m_aColWidths.Item(item.m_col)->nMaxWidth) - m_aColWidths.Item(item.m_col)->nMaxWidth = width; - } - } - - // update the item on screen - wxRect rectItem; - GetItemRect(id, rectItem); - RefreshRect(rectItem); -} - -void wxListMainWindow::SetItemStateAll(long state, long stateMask) -{ - if ( IsEmpty() ) - return; - - // first deal with selection - if ( stateMask & wxLIST_STATE_SELECTED ) - { - // set/clear select state - if ( IsVirtual() ) - { - // optimized version for virtual listctrl. - m_selStore.SelectRange(0, GetItemCount() - 1, state == wxLIST_STATE_SELECTED); - Refresh(); - } - else if ( state & wxLIST_STATE_SELECTED ) - { - const long count = GetItemCount(); - for( long i = 0; i < count; i++ ) - { - SetItemState( i, wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED ); - } - - } - else - { - // clear for non virtual (somewhat optimized by using GetNextItem()) - long i = -1; - while ( (i = GetNextItem(i, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED)) != -1 ) - { - SetItemState( i, 0, wxLIST_STATE_SELECTED ); - } - } - } - - if ( HasCurrent() && (state == 0) && (stateMask & wxLIST_STATE_FOCUSED) ) - { - // unfocus all: only one item can be focussed, so clearing focus for - // all items is simply clearing focus of the focussed item. - SetItemState(m_current, state, stateMask); - } - //(setting focus to all items makes no sense, so it is not handled here.) -} - -void wxListMainWindow::SetItemState( long litem, long state, long stateMask ) -{ - if ( litem == -1 ) - { - SetItemStateAll(state, stateMask); - return; - } - - wxCHECK_RET( litem >= 0 && (size_t)litem < GetItemCount(), - _T("invalid list ctrl item index in SetItem") ); - - size_t oldCurrent = m_current; - size_t item = (size_t)litem; // safe because of the check above - - // do we need to change the focus? - if ( stateMask & wxLIST_STATE_FOCUSED ) - { - if ( state & wxLIST_STATE_FOCUSED ) - { - // don't do anything if this item is already focused - if ( item != m_current ) - { - ChangeCurrent(item); - - if ( oldCurrent != (size_t)-1 ) - { - if ( IsSingleSel() ) - { - HighlightLine(oldCurrent, false); - } - - RefreshLine(oldCurrent); - } - - RefreshLine( m_current ); - } - } - else // unfocus - { - // don't do anything if this item is not focused - if ( item == m_current ) - { - ResetCurrent(); - - if ( IsSingleSel() ) - { - // we must unselect the old current item as well or we - // might end up with more than one selected item in a - // single selection control - HighlightLine(oldCurrent, false); - } - - RefreshLine( oldCurrent ); - } - } - } - - // do we need to change the selection state? - if ( stateMask & wxLIST_STATE_SELECTED ) - { - bool on = (state & wxLIST_STATE_SELECTED) != 0; - - if ( IsSingleSel() ) - { - if ( on ) - { - // selecting the item also makes it the focused one in the - // single sel mode - if ( m_current != item ) - { - ChangeCurrent(item); - - if ( oldCurrent != (size_t)-1 ) - { - HighlightLine( oldCurrent, false ); - RefreshLine( oldCurrent ); - } - } - } - else // off - { - // only the current item may be selected anyhow - if ( item != m_current ) - return; - } - } - - if ( HighlightLine(item, on) ) - { - RefreshLine(item); - } - } -} - -int wxListMainWindow::GetItemState( long item, long stateMask ) const -{ - wxCHECK_MSG( item >= 0 && (size_t)item < GetItemCount(), 0, - _T("invalid list ctrl item index in GetItemState()") ); - - int ret = wxLIST_STATE_DONTCARE; - - if ( stateMask & wxLIST_STATE_FOCUSED ) - { - if ( (size_t)item == m_current ) - ret |= wxLIST_STATE_FOCUSED; - } - - if ( stateMask & wxLIST_STATE_SELECTED ) - { - if ( IsHighlighted(item) ) - ret |= wxLIST_STATE_SELECTED; - } - - return ret; -} - -void wxListMainWindow::GetItem( wxListItem &item ) const -{ - wxCHECK_RET( item.m_itemId >= 0 && (size_t)item.m_itemId < GetItemCount(), - _T("invalid item index in GetItem") ); - - wxListLineData *line = GetLine((size_t)item.m_itemId); - line->GetItem( item.m_col, item ); - - // Get item state if user wants it - if ( item.m_mask & wxLIST_MASK_STATE ) - item.m_state = GetItemState( item.m_itemId, wxLIST_STATE_SELECTED | - wxLIST_STATE_FOCUSED ); -} - -// ---------------------------------------------------------------------------- -// item count -// ---------------------------------------------------------------------------- - -size_t wxListMainWindow::GetItemCount() const -{ - return IsVirtual() ? m_countVirt : m_lines.GetCount(); -} - -void wxListMainWindow::SetItemCount(long count) -{ - m_selStore.SetItemCount(count); - m_countVirt = count; - - ResetVisibleLinesRange(); - - // scrollbars must be reset - m_dirty = true; -} - -int wxListMainWindow::GetSelectedItemCount() const -{ - // deal with the quick case first - if ( IsSingleSel() ) - return HasCurrent() ? IsHighlighted(m_current) : false; - - // virtual controls remmebers all its selections itself - if ( IsVirtual() ) - return m_selStore.GetSelectedCount(); - - // TODO: we probably should maintain the number of items selected even for - // non virtual controls as enumerating all lines is really slow... - size_t countSel = 0; - size_t count = GetItemCount(); - for ( size_t line = 0; line < count; line++ ) - { - if ( GetLine(line)->IsHighlighted() ) - countSel++; - } - - return countSel; -} - -// ---------------------------------------------------------------------------- -// item position/size -// ---------------------------------------------------------------------------- - -wxRect wxListMainWindow::GetViewRect() const -{ - wxASSERT_MSG( !HasFlag(wxLC_REPORT | wxLC_LIST), - _T("wxListCtrl::GetViewRect() only works in icon mode") ); - - // we need to find the longest/tallest label - wxCoord xMax = 0, yMax = 0; - const int count = GetItemCount(); - if ( count ) - { - for ( int i = 0; i < count; i++ ) - { - // we need logical, not physical, coordinates here, so use - // GetLineRect() instead of GetItemRect() - wxRect r = GetLineRect(i); - - wxCoord x = r.GetRight(), - y = r.GetBottom(); - - if ( x > xMax ) - xMax = x; - if ( y > yMax ) - yMax = y; - } - } - - // some fudge needed to make it look prettier - xMax += 2 * EXTRA_BORDER_X; - yMax += 2 * EXTRA_BORDER_Y; - - // account for the scrollbars if necessary - const wxSize sizeAll = GetClientSize(); - if ( xMax > sizeAll.x ) - yMax += wxSystemSettings::GetMetric(wxSYS_HSCROLL_Y); - if ( yMax > sizeAll.y ) - xMax += wxSystemSettings::GetMetric(wxSYS_VSCROLL_X); - - return wxRect(0, 0, xMax, yMax); -} - -void wxListMainWindow::GetItemRect( long index, wxRect &rect ) const -{ - wxCHECK_RET( index >= 0 && (size_t)index < GetItemCount(), - _T("invalid index in GetItemRect") ); - - // ensure that we're laid out, otherwise we could return nonsense - if ( m_dirty ) - { - wxConstCast(this, wxListMainWindow)-> - RecalculatePositions(true /* no refresh */); - } - - rect = GetLineRect((size_t)index); - - CalcScrolledPosition(rect.x, rect.y, &rect.x, &rect.y); -} - -bool wxListMainWindow::GetItemPosition(long item, wxPoint& pos) const -{ - wxRect rect; - GetItemRect(item, rect); - - pos.x = rect.x; - pos.y = rect.y; - - return true; -} - -// ---------------------------------------------------------------------------- -// geometry calculation -// ---------------------------------------------------------------------------- - -void wxListMainWindow::RecalculatePositions(bool noRefresh) -{ - const int lineHeight = GetLineHeight(); - - wxClientDC dc( this ); - dc.SetFont( GetFont() ); - - const size_t count = GetItemCount(); - - int iconSpacing; - if ( HasFlag(wxLC_ICON) && m_normal_image_list ) - iconSpacing = m_normal_spacing; - else if ( HasFlag(wxLC_SMALL_ICON) && m_small_image_list ) - iconSpacing = m_small_spacing; - else - iconSpacing = 0; - - // Note that we do not call GetClientSize() here but - // GetSize() and subtract the border size for sunken - // borders manually. This is technically incorrect, - // but we need to know the client area's size WITHOUT - // scrollbars here. Since we don't know if there are - // any scrollbars, we use GetSize() instead. Another - // solution would be to call SetScrollbars() here to - // remove the scrollbars and call GetClientSize() then, - // but this might result in flicker and - worse - will - // reset the scrollbars to 0 which is not good at all - // if you resize a dialog/window, but don't want to - // reset the window scrolling. RR. - // Furthermore, we actually do NOT subtract the border - // width as 2 pixels is just the extra space which we - // need around the actual content in the window. Other- - // wise the text would e.g. touch the upper border. RR. - int clientWidth, - clientHeight; - GetSize( &clientWidth, &clientHeight ); - - if ( InReportView() ) - { - // all lines have the same height and we scroll one line per step - int entireHeight = count * lineHeight + LINE_SPACING; - - m_linesPerPage = clientHeight / lineHeight; - - ResetVisibleLinesRange(); - - SetScrollbars( SCROLL_UNIT_X, lineHeight, - GetHeaderWidth() / SCROLL_UNIT_X, - (entireHeight + lineHeight - 1) / lineHeight, - GetScrollPos(wxHORIZONTAL), - GetScrollPos(wxVERTICAL), - true ); - } - else // !report - { - // we have 3 different layout strategies: either layout all items - // horizontally/vertically (wxLC_ALIGN_XXX styles explicitly given) or - // to arrange them in top to bottom, left to right (don't ask me why - // not the other way round...) order - if ( HasFlag(wxLC_ALIGN_LEFT | wxLC_ALIGN_TOP) ) - { - int x = EXTRA_BORDER_X; - int y = EXTRA_BORDER_Y; - - wxCoord widthMax = 0; - - size_t i; - for ( i = 0; i < count; i++ ) - { - wxListLineData *line = GetLine(i); - line->CalculateSize( &dc, iconSpacing ); - line->SetPosition( x, y, iconSpacing ); - - wxSize sizeLine = GetLineSize(i); - - if ( HasFlag(wxLC_ALIGN_TOP) ) - { - if ( sizeLine.x > widthMax ) - widthMax = sizeLine.x; - - y += sizeLine.y; - } - else // wxLC_ALIGN_LEFT - { - x += sizeLine.x + MARGIN_BETWEEN_ROWS; - } - } - - if ( HasFlag(wxLC_ALIGN_TOP) ) - { - // traverse the items again and tweak their sizes so that they are - // all the same in a row - for ( i = 0; i < count; i++ ) - { - wxListLineData *line = GetLine(i); - line->m_gi->ExtendWidth(widthMax); - } - } - - SetScrollbars - ( - SCROLL_UNIT_X, - lineHeight, - (x + SCROLL_UNIT_X) / SCROLL_UNIT_X, - (y + lineHeight) / lineHeight, - GetScrollPos( wxHORIZONTAL ), - GetScrollPos( wxVERTICAL ), - true - ); - } - else // "flowed" arrangement, the most complicated case - { - // at first we try without any scrollbars, if the items don't fit into - // the window, we recalculate after subtracting the space taken by the - // scrollbar - - int entireWidth = 0; - - for (int tries = 0; tries < 2; tries++) - { - entireWidth = 2 * EXTRA_BORDER_X; - - if (tries == 1) - { - // Now we have decided that the items do not fit into the - // client area, so we need a scrollbar - entireWidth += SCROLL_UNIT_X; - } - - int x = EXTRA_BORDER_X; - int y = EXTRA_BORDER_Y; - int maxWidthInThisRow = 0; - - m_linesPerPage = 0; - int currentlyVisibleLines = 0; - - for (size_t i = 0; i < count; i++) - { - currentlyVisibleLines++; - wxListLineData *line = GetLine( i ); - line->CalculateSize( &dc, iconSpacing ); - line->SetPosition( x, y, iconSpacing ); - - wxSize sizeLine = GetLineSize( i ); - - if ( maxWidthInThisRow < sizeLine.x ) - maxWidthInThisRow = sizeLine.x; - - y += sizeLine.y; - if (currentlyVisibleLines > m_linesPerPage) - m_linesPerPage = currentlyVisibleLines; - - if ( y + sizeLine.y >= clientHeight ) - { - currentlyVisibleLines = 0; - y = EXTRA_BORDER_Y; - maxWidthInThisRow += MARGIN_BETWEEN_ROWS; - x += maxWidthInThisRow; - entireWidth += maxWidthInThisRow; - maxWidthInThisRow = 0; - } - - // We have reached the last item. - if ( i == count - 1 ) - entireWidth += maxWidthInThisRow; - - if ( (tries == 0) && - (entireWidth + SCROLL_UNIT_X > clientWidth) ) - { - clientHeight -= wxSystemSettings:: - GetMetric(wxSYS_HSCROLL_Y); - m_linesPerPage = 0; - break; - } - - if ( i == count - 1 ) - tries = 1; // Everything fits, no second try required. - } - } - - SetScrollbars - ( - SCROLL_UNIT_X, - lineHeight, - (entireWidth + SCROLL_UNIT_X) / SCROLL_UNIT_X, - 0, - GetScrollPos( wxHORIZONTAL ), - 0, - true - ); - } - } - - if ( !noRefresh ) - { - // FIXME: why should we call it from here? - UpdateCurrent(); - - RefreshAll(); - } -} - -void wxListMainWindow::RefreshAll() -{ - m_dirty = false; - Refresh(); - - wxListHeaderWindow *headerWin = GetListCtrl()->m_headerWin; - if ( headerWin && headerWin->m_dirty ) - { - headerWin->m_dirty = false; - headerWin->Refresh(); - } -} - -void wxListMainWindow::UpdateCurrent() -{ - if ( !HasCurrent() && !IsEmpty() ) - ChangeCurrent(0); -} - -long wxListMainWindow::GetNextItem( long item, - int WXUNUSED(geometry), - int state ) const -{ - long ret = item, - max = GetItemCount(); - wxCHECK_MSG( (ret == -1) || (ret < max), -1, - _T("invalid listctrl index in GetNextItem()") ); - - // notice that we start with the next item (or the first one if item == -1) - // and this is intentional to allow writing a simple loop to iterate over - // all selected items - ret++; - if ( ret == max ) - // this is not an error because the index was OK initially, - // just no such item - return -1; - - if ( !state ) - // any will do - return (size_t)ret; - - size_t count = GetItemCount(); - for ( size_t line = (size_t)ret; line < count; line++ ) - { - if ( (state & wxLIST_STATE_FOCUSED) && (line == m_current) ) - return line; - - if ( (state & wxLIST_STATE_SELECTED) && IsHighlighted(line) ) - return line; - } - - return -1; -} - -// ---------------------------------------------------------------------------- -// deleting stuff -// ---------------------------------------------------------------------------- - -void wxListMainWindow::DeleteItem( long lindex ) -{ - size_t count = GetItemCount(); - - wxCHECK_RET( (lindex >= 0) && ((size_t)lindex < count), - _T("invalid item index in DeleteItem") ); - - size_t index = (size_t)lindex; - - // we don't need to adjust the index for the previous items - if ( HasCurrent() && m_current >= index ) - { - // if the current item is being deleted, we want the next one to - // become selected - unless there is no next one - so don't adjust - // m_current in this case - if ( m_current != index || m_current == count - 1 ) - m_current--; - } - - if ( InReportView() ) - { - // mark the Column Max Width cache as dirty if the items in the line - // we're deleting contain the Max Column Width - wxListLineData * const line = GetLine(index); - wxListItemDataList::compatibility_iterator n; - wxListItemData *itemData; - wxListItem item; - int itemWidth; - - for (size_t i = 0; i < m_columns.GetCount(); i++) - { - n = line->m_items.Item( i ); - itemData = n->GetData(); - itemData->GetItem(item); - - itemWidth = GetItemWidthWithImage(&item); - - if (itemWidth >= m_aColWidths.Item(i)->nMaxWidth) - m_aColWidths.Item(i)->bNeedsUpdate = true; - } - - ResetVisibleLinesRange(); - } - - SendNotify( index, wxEVT_COMMAND_LIST_DELETE_ITEM, wxDefaultPosition ); - - if ( IsVirtual() ) - { - m_countVirt--; - m_selStore.OnItemDelete(index); - } - else - { - m_lines.RemoveAt( index ); - } - - // we need to refresh the (vert) scrollbar as the number of items changed - m_dirty = true; - - RefreshAfter(index); -} - -void wxListMainWindow::DeleteColumn( int col ) -{ - wxListHeaderDataList::compatibility_iterator node = m_columns.Item( col ); - - wxCHECK_RET( node, wxT("invalid column index in DeleteColumn()") ); - - m_dirty = true; - delete node->GetData(); - m_columns.Erase( node ); - - if ( !IsVirtual() ) - { - // update all the items - for ( size_t i = 0; i < m_lines.GetCount(); i++ ) - { - wxListLineData * const line = GetLine(i); - wxListItemDataList::compatibility_iterator n = line->m_items.Item( col ); - delete n->GetData(); - line->m_items.Erase(n); - } - } - - if ( InReportView() ) // we only cache max widths when in Report View - { - delete m_aColWidths.Item(col); - m_aColWidths.RemoveAt(col); - } - - // invalidate it as it has to be recalculated - m_headerWidth = 0; -} - -void wxListMainWindow::DoDeleteAllItems() -{ - if ( IsEmpty() ) - // nothing to do - in particular, don't send the event - return; - - ResetCurrent(); - - // to make the deletion of all items faster, we don't send the - // notifications for each item deletion in this case but only one event - // for all of them: this is compatible with wxMSW and documented in - // DeleteAllItems() description - - wxListEvent event( wxEVT_COMMAND_LIST_DELETE_ALL_ITEMS, GetParent()->GetId() ); - event.SetEventObject( GetParent() ); - GetParent()->GetEventHandler()->ProcessEvent( event ); - - if ( IsVirtual() ) - { - m_countVirt = 0; - m_selStore.Clear(); - } - - if ( InReportView() ) - { - ResetVisibleLinesRange(); - for (size_t i = 0; i < m_aColWidths.GetCount(); i++) - { - m_aColWidths.Item(i)->bNeedsUpdate = true; - } - } - - m_lines.Clear(); -} - -void wxListMainWindow::DeleteAllItems() -{ - DoDeleteAllItems(); - - RecalculatePositions(); -} - -void wxListMainWindow::DeleteEverything() -{ - WX_CLEAR_LIST(wxListHeaderDataList, m_columns); - WX_CLEAR_ARRAY(m_aColWidths); - - DeleteAllItems(); -} - -// ---------------------------------------------------------------------------- -// scanning for an item -// ---------------------------------------------------------------------------- - -void wxListMainWindow::EnsureVisible( long index ) -{ - wxCHECK_RET( index >= 0 && (size_t)index < GetItemCount(), - _T("invalid index in EnsureVisible") ); - - // We have to call this here because the label in question might just have - // been added and its position is not known yet - if ( m_dirty ) - RecalculatePositions(true /* no refresh */); - - MoveToItem((size_t)index); -} - -long wxListMainWindow::FindItem(long start, const wxString& str, bool partial ) -{ - if (str.empty()) - return wxNOT_FOUND; - - long pos = start; - wxString str_upper = str.Upper(); - if (pos < 0) - pos = 0; - - size_t count = GetItemCount(); - for ( size_t i = (size_t)pos; i < count; i++ ) - { - wxListLineData *line = GetLine(i); - wxString line_upper = line->GetText(0).Upper(); - if (!partial) - { - if (line_upper == str_upper ) - return i; - } - else - { - if (line_upper.find(str_upper) == 0) - return i; - } - } - - return wxNOT_FOUND; -} - -long wxListMainWindow::FindItem(long start, wxUIntPtr data) -{ - long pos = start; - if (pos < 0) - pos = 0; - - size_t count = GetItemCount(); - for (size_t i = (size_t)pos; i < count; i++) - { - wxListLineData *line = GetLine(i); - wxListItem item; - line->GetItem( 0, item ); - if (item.m_data == data) - return i; - } - - return wxNOT_FOUND; -} - -long wxListMainWindow::FindItem( const wxPoint& pt ) -{ - size_t topItem; - GetVisibleLinesRange( &topItem, NULL ); - - wxPoint p; - GetItemPosition( GetItemCount() - 1, p ); - if ( p.y == 0 ) - return topItem; - - long id = (long)floor( pt.y * double(GetItemCount() - topItem - 1) / p.y + topItem ); - if ( id >= 0 && id < (long)GetItemCount() ) - return id; - - return wxNOT_FOUND; -} - -long wxListMainWindow::HitTest( int x, int y, int &flags ) const -{ - CalcUnscrolledPosition( x, y, &x, &y ); - - size_t count = GetItemCount(); - - if ( InReportView() ) - { - size_t current = y / GetLineHeight(); - if ( current < count ) - { - flags = HitTestLine(current, x, y); - if ( flags ) - return current; - } - } - else // !report - { - // TODO: optimize it too! this is less simple than for report view but - // enumerating all items is still not a way to do it!! - for ( size_t current = 0; current < count; current++ ) - { - flags = HitTestLine(current, x, y); - if ( flags ) - return current; - } - } - - return wxNOT_FOUND; -} - -// ---------------------------------------------------------------------------- -// adding stuff -// ---------------------------------------------------------------------------- - -void wxListMainWindow::InsertItem( wxListItem &item ) -{ - wxASSERT_MSG( !IsVirtual(), _T("can't be used with virtual control") ); - - int count = GetItemCount(); - wxCHECK_RET( item.m_itemId >= 0, _T("invalid item index") ); - - if (item.m_itemId > count) - item.m_itemId = count; - - size_t id = item.m_itemId; - - m_dirty = true; - - if ( InReportView() ) - { - ResetVisibleLinesRange(); - - // calculate the width of the item and adjust the max column width - wxColWidthInfo *pWidthInfo = m_aColWidths.Item(item.GetColumn()); - int width = GetItemWidthWithImage(&item); - item.SetWidth(width); - if (width > pWidthInfo->nMaxWidth) - pWidthInfo->nMaxWidth = width; - } - - wxListLineData *line = new wxListLineData(this); - - line->SetItem( item.m_col, item ); - - m_lines.Insert( line, id ); - - m_dirty = true; - - // If an item is selected at or below the point of insertion, we need to - // increment the member variables because the current row's index has gone - // up by one - if ( HasCurrent() && m_current >= id ) - m_current++; - - SendNotify(id, wxEVT_COMMAND_LIST_INSERT_ITEM); - - RefreshLines(id, GetItemCount() - 1); -} - -void wxListMainWindow::InsertColumn( long col, wxListItem &item ) -{ - m_dirty = true; - if ( InReportView() ) - { - if (item.m_width == wxLIST_AUTOSIZE_USEHEADER) - item.m_width = GetTextLength( item.m_text ); - - wxListHeaderData *column = new wxListHeaderData( item ); - wxColWidthInfo *colWidthInfo = new wxColWidthInfo(); - - bool insert = (col >= 0) && ((size_t)col < m_columns.GetCount()); - if ( insert ) - { - wxListHeaderDataList::compatibility_iterator - node = m_columns.Item( col ); - m_columns.Insert( node, column ); - m_aColWidths.Insert( colWidthInfo, col ); - } - else - { - m_columns.Append( column ); - m_aColWidths.Add( colWidthInfo ); - } - - if ( !IsVirtual() ) - { - // update all the items - for ( size_t i = 0; i < m_lines.GetCount(); i++ ) - { - wxListLineData * const line = GetLine(i); - wxListItemData * const data = new wxListItemData(this); - if ( insert ) - line->m_items.Insert(col, data); - else - line->m_items.Append(data); - } - } - - // invalidate it as it has to be recalculated - m_headerWidth = 0; - } -} - -int wxListMainWindow::GetItemWidthWithImage(wxListItem * item) -{ - int width = 0; - wxClientDC dc(this); - - dc.SetFont( GetFont() ); - - if (item->GetImage() != -1) - { - int ix, iy; - GetImageSize( item->GetImage(), ix, iy ); - width += ix + 5; - } - - if (!item->GetText().empty()) - { - wxCoord w; - dc.GetTextExtent( item->GetText(), &w, NULL ); - width += w; - } - - return width; -} - -// ---------------------------------------------------------------------------- -// sorting -// ---------------------------------------------------------------------------- - -wxListCtrlCompare list_ctrl_compare_func_2; -long list_ctrl_compare_data; - -int LINKAGEMODE list_ctrl_compare_func_1( wxListLineData **arg1, wxListLineData **arg2 ) -{ - wxListLineData *line1 = *arg1; - wxListLineData *line2 = *arg2; - wxListItem item; - line1->GetItem( 0, item ); - wxUIntPtr data1 = item.m_data; - line2->GetItem( 0, item ); - wxUIntPtr data2 = item.m_data; - return list_ctrl_compare_func_2( data1, data2, list_ctrl_compare_data ); -} - -void wxListMainWindow::SortItems( wxListCtrlCompare fn, long data ) -{ - // selections won't make sense any more after sorting the items so reset - // them - HighlightAll(false); - ResetCurrent(); - - list_ctrl_compare_func_2 = fn; - list_ctrl_compare_data = data; - m_lines.Sort( list_ctrl_compare_func_1 ); - m_dirty = true; -} - -// ---------------------------------------------------------------------------- -// scrolling -// ---------------------------------------------------------------------------- - -void wxListMainWindow::OnScroll(wxScrollWinEvent& event) -{ - // FIXME -#if ( defined(__WXGTK__) || defined(__WXMAC__) ) && !defined(__WXUNIVERSAL__) - wxScrolledWindow::OnScroll(event); -#else - HandleOnScroll( event ); -#endif - - // update our idea of which lines are shown when we redraw the window the - // next time - ResetVisibleLinesRange(); - - if ( event.GetOrientation() == wxHORIZONTAL && HasHeader() ) - { - wxGenericListCtrl* lc = GetListCtrl(); - wxCHECK_RET( lc, _T("no listctrl window?") ); - - lc->m_headerWin->Refresh(); - lc->m_headerWin->Update(); - } -} - -int wxListMainWindow::GetCountPerPage() const -{ - if ( !m_linesPerPage ) - { - wxConstCast(this, wxListMainWindow)-> - m_linesPerPage = GetClientSize().y / GetLineHeight(); - } - - return m_linesPerPage; -} - -void wxListMainWindow::GetVisibleLinesRange(size_t *from, size_t *to) -{ - wxASSERT_MSG( InReportView(), _T("this is for report mode only") ); - - if ( m_lineFrom == (size_t)-1 ) - { - size_t count = GetItemCount(); - if ( count ) - { - m_lineFrom = GetScrollPos(wxVERTICAL); - - // this may happen if SetScrollbars() hadn't been called yet - if ( m_lineFrom >= count ) - m_lineFrom = count - 1; - - // we redraw one extra line but this is needed to make the redrawing - // logic work when there is a fractional number of lines on screen - m_lineTo = m_lineFrom + m_linesPerPage; - if ( m_lineTo >= count ) - m_lineTo = count - 1; - } - else // empty control - { - m_lineFrom = 0; - m_lineTo = (size_t)-1; - } - } - - wxASSERT_MSG( IsEmpty() || - (m_lineFrom <= m_lineTo && m_lineTo < GetItemCount()), - _T("GetVisibleLinesRange() returns incorrect result") ); - - if ( from ) - *from = m_lineFrom; - if ( to ) - *to = m_lineTo; -} - -// ------------------------------------------------------------------------------------- -// wxGenericListCtrl -// ------------------------------------------------------------------------------------- - -IMPLEMENT_DYNAMIC_CLASS(wxGenericListCtrl, wxControl) - -BEGIN_EVENT_TABLE(wxGenericListCtrl,wxControl) - EVT_SIZE(wxGenericListCtrl::OnSize) -END_EVENT_TABLE() - -wxGenericListCtrl::wxGenericListCtrl() -{ - m_imageListNormal = (wxImageList *) NULL; - m_imageListSmall = (wxImageList *) NULL; - m_imageListState = (wxImageList *) NULL; - - m_ownsImageListNormal = - m_ownsImageListSmall = - m_ownsImageListState = false; - - m_mainWin = (wxListMainWindow*) NULL; - m_headerWin = (wxListHeaderWindow*) NULL; - m_headerHeight = 0; -} - -wxGenericListCtrl::~wxGenericListCtrl() -{ - if (m_ownsImageListNormal) - delete m_imageListNormal; - if (m_ownsImageListSmall) - delete m_imageListSmall; - if (m_ownsImageListState) - delete m_imageListState; -} - -void wxGenericListCtrl::CalculateAndSetHeaderHeight() -{ - if ( m_headerWin ) - { -#ifdef __WXMAC__ - SInt32 h; - GetThemeMetric( kThemeMetricListHeaderHeight, &h ); -#else - // we use 'g' to get the descent, too - int w, h, d; - m_headerWin->GetTextExtent(wxT("Hg"), &w, &h, &d); - h += d + 2 * HEADER_OFFSET_Y + EXTRA_HEIGHT; -#endif - - // only update if changed - if ( h != m_headerHeight ) - { - m_headerHeight = h; - - if ( HasHeader() ) - ResizeReportView(true); - else //why is this needed if it doesn't have a header? - m_headerWin->SetSize(m_headerWin->GetSize().x, m_headerHeight); - } - } -} - -void wxGenericListCtrl::CreateHeaderWindow() -{ - m_headerWin = new wxListHeaderWindow - ( - this, wxID_ANY, m_mainWin, - wxPoint(0,0), - wxSize(GetClientSize().x, m_headerHeight), - wxTAB_TRAVERSAL - ); - CalculateAndSetHeaderHeight(); -} - -bool wxGenericListCtrl::Create(wxWindow *parent, - wxWindowID id, - const wxPoint &pos, - const wxSize &size, - long style, - const wxValidator &validator, - const wxString &name) -{ - m_imageListNormal = - m_imageListSmall = - m_imageListState = (wxImageList *) NULL; - m_ownsImageListNormal = - m_ownsImageListSmall = - m_ownsImageListState = false; - - m_mainWin = (wxListMainWindow*) NULL; - m_headerWin = (wxListHeaderWindow*) NULL; - - m_headerHeight = 0; - - if ( !(style & wxLC_MASK_TYPE) ) - { - style = style | wxLC_LIST; - } - - // add more styles here that should only appear - // in the main window - unsigned long only_main_window_style = wxALWAYS_SHOW_SB; - - if ( !wxControl::Create( parent, id, pos, size, style & ~only_main_window_style, validator, name ) ) - return false; - - // don't create the inner window with the border - style &= ~wxBORDER_MASK; - - m_mainWin = new wxListMainWindow( this, wxID_ANY, wxPoint(0, 0), size, style ); - -#ifdef __WXMAC_CARBON__ - // Human Interface Guidelines ask us for a special font in this case - if ( GetWindowVariant() == wxWINDOW_VARIANT_NORMAL ) - { - wxFont font; - font.MacCreateThemeFont( kThemeViewsFont ); - SetFont( font ); - } -#endif - - if ( InReportView() ) - { - CreateHeaderWindow(); - -#ifdef __WXMAC_CARBON__ - if (m_headerWin) - { - wxFont font; - font.MacCreateThemeFont( kThemeSmallSystemFont ); - m_headerWin->SetFont( font ); - CalculateAndSetHeaderHeight(); - } -#endif - - if ( HasFlag(wxLC_NO_HEADER) ) - // VZ: why do we create it at all then? - m_headerWin->Show( false ); - } - - SetInitialSize(size); - - return true; -} - -void wxGenericListCtrl::SetSingleStyle( long style, bool add ) -{ - wxASSERT_MSG( !(style & wxLC_VIRTUAL), - _T("wxLC_VIRTUAL can't be [un]set") ); - - long flag = GetWindowStyle(); - - if (add) - { - if (style & wxLC_MASK_TYPE) - flag &= ~(wxLC_MASK_TYPE | wxLC_VIRTUAL); - if (style & wxLC_MASK_ALIGN) - flag &= ~wxLC_MASK_ALIGN; - if (style & wxLC_MASK_SORT) - flag &= ~wxLC_MASK_SORT; - } - - if (add) - flag |= style; - else - flag &= ~style; - - // some styles can be set without recreating everything (as happens in - // SetWindowStyleFlag() which calls wxListMainWindow::DeleteEverything()) - if ( !(style & ~(wxLC_HRULES | wxLC_VRULES)) ) - { - Refresh(); - wxWindow::SetWindowStyleFlag(flag); - } - else - { - SetWindowStyleFlag( flag ); - } -} - -void wxGenericListCtrl::SetWindowStyleFlag( long flag ) -{ - if (m_mainWin) - { - m_mainWin->DeleteEverything(); - - // has the header visibility changed? - bool hasHeader = HasHeader(); - bool willHaveHeader = (flag & wxLC_REPORT) && !(flag & wxLC_NO_HEADER); - - if ( hasHeader != willHaveHeader ) - { - // toggle it - if ( hasHeader ) - { - if ( m_headerWin ) - { - // don't delete, just hide, as we can reuse it later - m_headerWin->Show(false); - } - //else: nothing to do - } - else // must show header - { - if (!m_headerWin) - { - CreateHeaderWindow(); - } - else // already have it, just show - { - m_headerWin->Show( true ); - } - } - - ResizeReportView(willHaveHeader); - } - } - - wxWindow::SetWindowStyleFlag( flag ); -} - -bool wxGenericListCtrl::GetColumn(int col, wxListItem &item) const -{ - m_mainWin->GetColumn( col, item ); - return true; -} - -bool wxGenericListCtrl::SetColumn( int col, wxListItem& item ) -{ - m_mainWin->SetColumn( col, item ); - return true; -} - -int wxGenericListCtrl::GetColumnWidth( int col ) const -{ - return m_mainWin->GetColumnWidth( col ); -} - -bool wxGenericListCtrl::SetColumnWidth( int col, int width ) -{ - m_mainWin->SetColumnWidth( col, width ); - return true; -} - -int wxGenericListCtrl::GetCountPerPage() const -{ - return m_mainWin->GetCountPerPage(); // different from Windows ? -} - -bool wxGenericListCtrl::GetItem( wxListItem &info ) const -{ - m_mainWin->GetItem( info ); - return true; -} - -bool wxGenericListCtrl::SetItem( wxListItem &info ) -{ - m_mainWin->SetItem( info ); - return true; -} - -long wxGenericListCtrl::SetItem( long index, int col, const wxString& label, int imageId ) -{ - wxListItem info; - info.m_text = label; - info.m_mask = wxLIST_MASK_TEXT; - info.m_itemId = index; - info.m_col = col; - if ( imageId > -1 ) - { - info.m_image = imageId; - info.m_mask |= wxLIST_MASK_IMAGE; - } - - m_mainWin->SetItem(info); - return true; -} - -int wxGenericListCtrl::GetItemState( long item, long stateMask ) const -{ - return m_mainWin->GetItemState( item, stateMask ); -} - -bool wxGenericListCtrl::SetItemState( long item, long state, long stateMask ) -{ - m_mainWin->SetItemState( item, state, stateMask ); - return true; -} - -bool -wxGenericListCtrl::SetItemImage( long item, int image, int WXUNUSED(selImage) ) -{ - return SetItemColumnImage(item, 0, image); -} - -bool -wxGenericListCtrl::SetItemColumnImage( long item, long column, int image ) -{ - wxListItem info; - info.m_image = image; - info.m_mask = wxLIST_MASK_IMAGE; - info.m_itemId = item; - info.m_col = column; - m_mainWin->SetItem( info ); - return true; -} - -wxString wxGenericListCtrl::GetItemText( long item ) const -{ - return m_mainWin->GetItemText(item); -} - -void wxGenericListCtrl::SetItemText( long item, const wxString& str ) -{ - m_mainWin->SetItemText(item, str); -} - -wxUIntPtr wxGenericListCtrl::GetItemData( long item ) const -{ - wxListItem info; - info.m_mask = wxLIST_MASK_DATA; - info.m_itemId = item; - m_mainWin->GetItem( info ); - return info.m_data; -} - -bool wxGenericListCtrl::SetItemPtrData( long item, wxUIntPtr data ) -{ - wxListItem info; - info.m_mask = wxLIST_MASK_DATA; - info.m_itemId = item; - info.m_data = data; - m_mainWin->SetItem( info ); - return true; -} - -bool wxGenericListCtrl::SetItemData(long item, long data) -{ - return SetItemPtrData(item, data); -} - -wxRect wxGenericListCtrl::GetViewRect() const -{ - return m_mainWin->GetViewRect(); -} - -bool wxGenericListCtrl::GetItemRect( long item, wxRect &rect, int WXUNUSED(code) ) const -{ - m_mainWin->GetItemRect( item, rect ); - if ( m_mainWin->HasHeader() ) - rect.y += m_headerHeight + 1; - return true; -} - -bool wxGenericListCtrl::GetItemPosition( long item, wxPoint& pos ) const -{ - m_mainWin->GetItemPosition( item, pos ); - return true; -} - -bool wxGenericListCtrl::SetItemPosition( long WXUNUSED(item), const wxPoint& WXUNUSED(pos) ) -{ - return 0; -} - -int wxGenericListCtrl::GetItemCount() const -{ - return m_mainWin->GetItemCount(); -} - -int wxGenericListCtrl::GetColumnCount() const -{ - return m_mainWin->GetColumnCount(); -} - -void wxGenericListCtrl::SetItemSpacing( int spacing, bool isSmall ) -{ - m_mainWin->SetItemSpacing( spacing, isSmall ); -} - -wxSize wxGenericListCtrl::GetItemSpacing() const -{ - const int spacing = m_mainWin->GetItemSpacing(HasFlag(wxLC_SMALL_ICON)); - - return wxSize(spacing, spacing); -} - -#if WXWIN_COMPATIBILITY_2_6 -int wxGenericListCtrl::GetItemSpacing( bool isSmall ) const -{ - return m_mainWin->GetItemSpacing( isSmall ); -} -#endif // WXWIN_COMPATIBILITY_2_6 - -void wxGenericListCtrl::SetItemTextColour( long item, const wxColour &col ) -{ - wxListItem info; - info.m_itemId = item; - info.SetTextColour( col ); - m_mainWin->SetItem( info ); -} - -wxColour wxGenericListCtrl::GetItemTextColour( long item ) const -{ - wxListItem info; - info.m_itemId = item; - m_mainWin->GetItem( info ); - return info.GetTextColour(); -} - -void wxGenericListCtrl::SetItemBackgroundColour( long item, const wxColour &col ) -{ - wxListItem info; - info.m_itemId = item; - info.SetBackgroundColour( col ); - m_mainWin->SetItem( info ); -} - -wxColour wxGenericListCtrl::GetItemBackgroundColour( long item ) const -{ - wxListItem info; - info.m_itemId = item; - m_mainWin->GetItem( info ); - return info.GetBackgroundColour(); -} - -int wxGenericListCtrl::GetScrollPos( int orient ) const -{ - return m_mainWin->GetScrollPos( orient ); -} - -void wxGenericListCtrl::SetScrollPos( int orient, int pos, bool refresh ) -{ - m_mainWin->SetScrollPos( orient, pos, refresh ); -} - -void wxGenericListCtrl::SetItemFont( long item, const wxFont &f ) -{ - wxListItem info; - info.m_itemId = item; - info.SetFont( f ); - m_mainWin->SetItem( info ); -} - -wxFont wxGenericListCtrl::GetItemFont( long item ) const -{ - wxListItem info; - info.m_itemId = item; - m_mainWin->GetItem( info ); - return info.GetFont(); -} - -int wxGenericListCtrl::GetSelectedItemCount() const -{ - return m_mainWin->GetSelectedItemCount(); -} - -wxColour wxGenericListCtrl::GetTextColour() const -{ - return GetForegroundColour(); -} - -void wxGenericListCtrl::SetTextColour(const wxColour& col) -{ - SetForegroundColour(col); -} - -long wxGenericListCtrl::GetTopItem() const -{ - size_t top; - m_mainWin->GetVisibleLinesRange(&top, NULL); - return (long)top; -} - -long wxGenericListCtrl::GetNextItem( long item, int geom, int state ) const -{ - return m_mainWin->GetNextItem( item, geom, state ); -} - -wxImageList *wxGenericListCtrl::GetImageList(int which) const -{ - if (which == wxIMAGE_LIST_NORMAL) - return m_imageListNormal; - else if (which == wxIMAGE_LIST_SMALL) - return m_imageListSmall; - else if (which == wxIMAGE_LIST_STATE) - return m_imageListState; - - return (wxImageList *) NULL; -} - -void wxGenericListCtrl::SetImageList( wxImageList *imageList, int which ) -{ - if ( which == wxIMAGE_LIST_NORMAL ) - { - if (m_ownsImageListNormal) - delete m_imageListNormal; - m_imageListNormal = imageList; - m_ownsImageListNormal = false; - } - else if ( which == wxIMAGE_LIST_SMALL ) - { - if (m_ownsImageListSmall) - delete m_imageListSmall; - m_imageListSmall = imageList; - m_ownsImageListSmall = false; - } - else if ( which == wxIMAGE_LIST_STATE ) - { - if (m_ownsImageListState) - delete m_imageListState; - m_imageListState = imageList; - m_ownsImageListState = false; - } - - m_mainWin->SetImageList( imageList, which ); -} - -void wxGenericListCtrl::AssignImageList(wxImageList *imageList, int which) -{ - SetImageList(imageList, which); - if ( which == wxIMAGE_LIST_NORMAL ) - m_ownsImageListNormal = true; - else if ( which == wxIMAGE_LIST_SMALL ) - m_ownsImageListSmall = true; - else if ( which == wxIMAGE_LIST_STATE ) - m_ownsImageListState = true; -} - -bool wxGenericListCtrl::Arrange( int WXUNUSED(flag) ) -{ - return 0; -} - -bool wxGenericListCtrl::DeleteItem( long item ) -{ - m_mainWin->DeleteItem( item ); - return true; -} - -bool wxGenericListCtrl::DeleteAllItems() -{ - m_mainWin->DeleteAllItems(); - return true; -} - -bool wxGenericListCtrl::DeleteAllColumns() -{ - size_t count = m_mainWin->m_columns.GetCount(); - for ( size_t n = 0; n < count; n++ ) - DeleteColumn( 0 ); - return true; -} - -void wxGenericListCtrl::ClearAll() -{ - m_mainWin->DeleteEverything(); -} - -bool wxGenericListCtrl::DeleteColumn( int col ) -{ - m_mainWin->DeleteColumn( col ); - - // if we don't have the header any longer, we need to relayout the window - if ( !GetColumnCount() ) - ResizeReportView(false /* no header */); - return true; -} - -wxTextCtrl *wxGenericListCtrl::EditLabel(long item, - wxClassInfo* textControlClass) -{ - return m_mainWin->EditLabel( item, textControlClass ); -} - -wxTextCtrl *wxGenericListCtrl::GetEditControl() const -{ - return m_mainWin->GetEditControl(); -} - -bool wxGenericListCtrl::EnsureVisible( long item ) -{ - m_mainWin->EnsureVisible( item ); - return true; -} - -long wxGenericListCtrl::FindItem( long start, const wxString& str, bool partial ) -{ - return m_mainWin->FindItem( start, str, partial ); -} - -long wxGenericListCtrl::FindItem( long start, wxUIntPtr data ) -{ - return m_mainWin->FindItem( start, data ); -} - -long wxGenericListCtrl::FindItem( long WXUNUSED(start), const wxPoint& pt, - int WXUNUSED(direction)) -{ - return m_mainWin->FindItem( pt ); -} - -// TODO: sub item hit testing -long wxGenericListCtrl::HitTest(const wxPoint& point, int& flags, long *) const -{ - return m_mainWin->HitTest( (int)point.x, (int)point.y, flags ); -} - -long wxGenericListCtrl::InsertItem( wxListItem& info ) -{ - m_mainWin->InsertItem( info ); - return info.m_itemId; -} - -long wxGenericListCtrl::InsertItem( long index, const wxString &label ) -{ - wxListItem info; - info.m_text = label; - info.m_mask = wxLIST_MASK_TEXT; - info.m_itemId = index; - return InsertItem( info ); -} - -long wxGenericListCtrl::InsertItem( long index, int imageIndex ) -{ - wxListItem info; - info.m_mask = wxLIST_MASK_IMAGE; - info.m_image = imageIndex; - info.m_itemId = index; - return InsertItem( info ); -} - -long wxGenericListCtrl::InsertItem( long index, const wxString &label, int imageIndex ) -{ - wxListItem info; - info.m_text = label; - info.m_image = imageIndex; - info.m_mask = wxLIST_MASK_TEXT | wxLIST_MASK_IMAGE; - info.m_itemId = index; - return InsertItem( info ); -} - -long wxGenericListCtrl::InsertColumn( long col, wxListItem &item ) -{ - wxCHECK_MSG( m_headerWin, -1, _T("can't add column in non report mode") ); - - m_mainWin->InsertColumn( col, item ); - - // if we hadn't had a header before but have one now - // then we need to relayout the window - if ( GetColumnCount() == 1 && m_mainWin->HasHeader() ) - ResizeReportView(true /* have header */); - - m_headerWin->Refresh(); - - return 0; -} - -long wxGenericListCtrl::InsertColumn( long col, const wxString &heading, - int format, int width ) -{ - wxListItem item; - item.m_mask = wxLIST_MASK_TEXT | wxLIST_MASK_FORMAT; - item.m_text = heading; - if (width >= -2) - { - item.m_mask |= wxLIST_MASK_WIDTH; - item.m_width = width; - } - - item.m_format = format; - - return InsertColumn( col, item ); -} - -bool wxGenericListCtrl::ScrollList( int dx, int dy ) -{ - return m_mainWin->ScrollList(dx, 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 wxGenericListCtrl::SortItems( wxListCtrlCompare fn, long data ) -{ - m_mainWin->SortItems( fn, data ); - return true; -} - -// ---------------------------------------------------------------------------- -// event handlers -// ---------------------------------------------------------------------------- - -void wxGenericListCtrl::OnSize(wxSizeEvent& WXUNUSED(event)) -{ - if ( !m_mainWin ) - return; - - ResizeReportView(m_mainWin->HasHeader()); - m_mainWin->RecalculatePositions(); -} - -void wxGenericListCtrl::ResizeReportView(bool showHeader) -{ - int cw, ch; - GetClientSize( &cw, &ch ); - - if ( showHeader ) - { - m_headerWin->SetSize( 0, 0, cw, m_headerHeight ); - if(ch > m_headerHeight) - m_mainWin->SetSize( 0, m_headerHeight + 1, - cw, ch - m_headerHeight - 1 ); - else - m_mainWin->SetSize( 0, m_headerHeight + 1, - cw, 0); - } - else // no header window - { - m_mainWin->SetSize( 0, 0, cw, ch ); - } -} - -void wxGenericListCtrl::OnInternalIdle() -{ - wxWindow::OnInternalIdle(); - - // do it only if needed - if ( !m_mainWin->m_dirty ) - return; - - m_mainWin->RecalculatePositions(); -} - -// ---------------------------------------------------------------------------- -// font/colours -// ---------------------------------------------------------------------------- - -bool wxGenericListCtrl::SetBackgroundColour( const wxColour &colour ) -{ - if (m_mainWin) - { - m_mainWin->SetBackgroundColour( colour ); - m_mainWin->m_dirty = true; - } - - return true; -} - -bool wxGenericListCtrl::SetForegroundColour( const wxColour &colour ) -{ - if ( !wxWindow::SetForegroundColour( colour ) ) - return false; - - if (m_mainWin) - { - m_mainWin->SetForegroundColour( colour ); - m_mainWin->m_dirty = true; - } - - if (m_headerWin) - m_headerWin->SetForegroundColour( colour ); - - return true; -} - -bool wxGenericListCtrl::SetFont( const wxFont &font ) -{ - if ( !wxWindow::SetFont( font ) ) - return false; - - if (m_mainWin) - { - m_mainWin->SetFont( font ); - m_mainWin->m_dirty = true; - } - - if (m_headerWin) - { - m_headerWin->SetFont( font ); - CalculateAndSetHeaderHeight(); - } - - Refresh(); - - return true; -} - -// static -wxVisualAttributes -wxGenericListCtrl::GetClassDefaultAttributes(wxWindowVariant variant) -{ -#if _USE_VISATTR - // Use the same color scheme as wxListBox - return wxListBox::GetClassDefaultAttributes(variant); -#else - wxUnusedVar(variant); - wxVisualAttributes attr; - attr.colFg = wxSystemSettings::GetColour(wxSYS_COLOUR_LISTBOXTEXT); - attr.colBg = wxSystemSettings::GetColour(wxSYS_COLOUR_LISTBOX); - attr.font = wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT); - return attr; -#endif -} - -// ---------------------------------------------------------------------------- -// methods forwarded to m_mainWin -// ---------------------------------------------------------------------------- - -#if wxUSE_DRAG_AND_DROP - -void wxGenericListCtrl::SetDropTarget( wxDropTarget *dropTarget ) -{ - m_mainWin->SetDropTarget( dropTarget ); -} - -wxDropTarget *wxGenericListCtrl::GetDropTarget() const -{ - return m_mainWin->GetDropTarget(); -} - -#endif - -bool wxGenericListCtrl::SetCursor( const wxCursor &cursor ) -{ - return m_mainWin ? m_mainWin->wxWindow::SetCursor(cursor) : false; -} - -wxColour wxGenericListCtrl::GetBackgroundColour() const -{ - return m_mainWin ? m_mainWin->GetBackgroundColour() : wxColour(); -} - -wxColour wxGenericListCtrl::GetForegroundColour() const -{ - return m_mainWin ? m_mainWin->GetForegroundColour() : wxColour(); -} - -bool wxGenericListCtrl::DoPopupMenu( wxMenu *menu, int x, int y ) -{ -#if wxUSE_MENUS - return m_mainWin->PopupMenu( menu, x, y ); -#else - return false; -#endif -} - -void wxGenericListCtrl::DoClientToScreen( int *x, int *y ) const -{ - m_mainWin->DoClientToScreen(x, y); -} - -void wxGenericListCtrl::DoScreenToClient( int *x, int *y ) const -{ - m_mainWin->DoScreenToClient(x, y); -} - -void wxGenericListCtrl::SetFocus() -{ - // The test in window.cpp fails as we are a composite - // window, so it checks against "this", but not m_mainWin. - if ( DoFindFocus() != this ) - m_mainWin->SetFocus(); -} - -wxSize wxGenericListCtrl::DoGetBestSize() const -{ - // Something is better than nothing... - // 100x80 is what the MSW version will get from the default - // wxControl::DoGetBestSize - return wxSize(100, 80); -} - -// ---------------------------------------------------------------------------- -// virtual list control support -// ---------------------------------------------------------------------------- - -wxString wxGenericListCtrl::OnGetItemText(long WXUNUSED(item), long WXUNUSED(col)) const -{ - // this is a pure virtual function, in fact - which is not really pure - // because the controls which are not virtual don't need to implement it - wxFAIL_MSG( _T("wxGenericListCtrl::OnGetItemText not supposed to be called") ); - - return wxEmptyString; -} - -int wxGenericListCtrl::OnGetItemImage(long WXUNUSED(item)) const -{ - wxCHECK_MSG(!GetImageList(wxIMAGE_LIST_SMALL), - -1, - wxT("List control has an image list, OnGetItemImage or OnGetItemColumnImage should be overridden.")); - return -1; -} - -int wxGenericListCtrl::OnGetItemColumnImage(long item, long column) const -{ - if (!column) - return OnGetItemImage(item); - - return -1; -} - -wxListItemAttr * -wxGenericListCtrl::OnGetItemAttr(long WXUNUSED_UNLESS_DEBUG(item)) const -{ - wxASSERT_MSG( item >= 0 && item < GetItemCount(), - _T("invalid item index in OnGetItemAttr()") ); - - // no attributes by default - return NULL; -} - -void wxGenericListCtrl::SetItemCount(long count) -{ - wxASSERT_MSG( IsVirtual(), _T("this is for virtual controls only") ); - - m_mainWin->SetItemCount(count); -} - -void wxGenericListCtrl::RefreshItem(long item) -{ - m_mainWin->RefreshLine(item); -} - -void wxGenericListCtrl::RefreshItems(long itemFrom, long itemTo) -{ - m_mainWin->RefreshLines(itemFrom, itemTo); -} - -// Generic wxListCtrl is more or less a container for two other -// windows which drawings are done upon. These are namely -// 'm_headerWin' and 'm_mainWin'. -// Here we override 'virtual wxWindow::Refresh()' to mimic the -// behaviour wxListCtrl has under wxMSW. -// -void wxGenericListCtrl::Refresh(bool eraseBackground, const wxRect *rect) -{ - if (!rect) - { - // The easy case, no rectangle specified. - if (m_headerWin) - m_headerWin->Refresh(eraseBackground); - - if (m_mainWin) - m_mainWin->Refresh(eraseBackground); - } - else - { - // Refresh the header window - if (m_headerWin) - { - wxRect rectHeader = m_headerWin->GetRect(); - rectHeader.Intersect(*rect); - if (rectHeader.GetWidth() && rectHeader.GetHeight()) - { - int x, y; - m_headerWin->GetPosition(&x, &y); - rectHeader.Offset(-x, -y); - m_headerWin->Refresh(eraseBackground, &rectHeader); - } - } - - // Refresh the main window - if (m_mainWin) - { - wxRect rectMain = m_mainWin->GetRect(); - rectMain.Intersect(*rect); - if (rectMain.GetWidth() && rectMain.GetHeight()) - { - int x, y; - m_mainWin->GetPosition(&x, &y); - rectMain.Offset(-x, -y); - m_mainWin->Refresh(eraseBackground, &rectMain); - } - } - } -} - -void wxGenericListCtrl::Update() -{ - if (m_mainWin && m_mainWin->m_dirty) - m_mainWin->RecalculatePositions(); - - wxControl::Update(); -} - -void wxGenericListCtrl::Freeze() -{ - m_mainWin->Freeze(); -} - -void wxGenericListCtrl::Thaw() -{ - m_mainWin->Thaw(); -} - -#endif // wxUSE_LISTCTRL diff --git a/wxWidgets/src/generic/logg.cpp b/wxWidgets/src/generic/logg.cpp deleted file mode 100644 index 4cd133e9b4..0000000000 --- a/wxWidgets/src/generic/logg.cpp +++ /dev/null @@ -1,1229 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/generic/logg.cpp -// Purpose: wxLog-derived classes which need GUI support (the rest is in -// src/common/log.cpp) -// Author: Vadim Zeitlin -// Modified by: -// Created: 20.09.99 (extracted from src/common/log.cpp) -// RCS-ID: $Id: logg.cpp 43078 2006-11-04 23:46:02Z VZ $ -// Copyright: (c) 1998 Vadim Zeitlin -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -// 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/button.h" - #include "wx/intl.h" - #include "wx/log.h" - #include "wx/menu.h" - #include "wx/frame.h" - #include "wx/filedlg.h" - #include "wx/msgdlg.h" - #include "wx/textctrl.h" - #include "wx/sizer.h" - #include "wx/statbmp.h" - #include "wx/settings.h" -#endif // WX_PRECOMP - -#if wxUSE_LOGGUI || wxUSE_LOGWINDOW - -#include "wx/file.h" -#include "wx/textfile.h" -#include "wx/statline.h" -#include "wx/artprov.h" - -#ifdef __WXMSW__ - // for OutputDebugString() - #include "wx/msw/private.h" -#endif // Windows - -#ifdef __WXPM__ - #include -#endif - -#if wxUSE_LOG_DIALOG - #include "wx/listctrl.h" - #include "wx/imaglist.h" - #include "wx/image.h" -#endif // wxUSE_LOG_DIALOG/!wxUSE_LOG_DIALOG - -#if defined(__MWERKS__) && wxUSE_UNICODE - #include -#endif - -#include "wx/datetime.h" - -// the suffix we add to the button to show that the dialog can be expanded -#define EXPAND_SUFFIX _T(" >>") - -// ---------------------------------------------------------------------------- -// private classes -// ---------------------------------------------------------------------------- - -#if wxUSE_LOG_DIALOG - -// this function is a wrapper around strftime(3) -// allows to exclude the usage of wxDateTime -static wxString TimeStamp(const wxChar *format, time_t t) -{ -#if wxUSE_DATETIME - wxChar buf[4096]; - struct tm tm; - if ( !wxStrftime(buf, WXSIZEOF(buf), format, wxLocaltime_r(&t, &tm)) ) - { - // buffer is too small? - wxFAIL_MSG(_T("strftime() failed")); - } - return wxString(buf); -#else // !wxUSE_DATETIME - return wxEmptyString; -#endif // wxUSE_DATETIME/!wxUSE_DATETIME -} - - -class wxLogDialog : public wxDialog -{ -public: - wxLogDialog(wxWindow *parent, - const wxArrayString& messages, - const wxArrayInt& severity, - const wxArrayLong& timess, - const wxString& caption, - long style); - virtual ~wxLogDialog(); - - // event handlers - void OnOk(wxCommandEvent& event); - void OnDetails(wxCommandEvent& event); -#if wxUSE_FILE - void OnSave(wxCommandEvent& event); -#endif // wxUSE_FILE - void OnListSelect(wxListEvent& event); - -private: - // create controls needed for the details display - void CreateDetailsControls(); - - // the data for the listctrl - wxArrayString m_messages; - wxArrayInt m_severity; - wxArrayLong m_times; - - // the "toggle" button and its state -#ifndef __SMARTPHONE__ - wxButton *m_btnDetails; -#endif - bool m_showingDetails; - - // the controls which are not shown initially (but only when details - // button is pressed) - wxListCtrl *m_listctrl; -#ifndef __SMARTPHONE__ -#if wxUSE_STATLINE - wxStaticLine *m_statline; -#endif // wxUSE_STATLINE -#if wxUSE_FILE - wxButton *m_btnSave; -#endif // wxUSE_FILE -#endif // __SMARTPHONE__ - - // the translated "Details" string - static wxString ms_details; - - DECLARE_EVENT_TABLE() - DECLARE_NO_COPY_CLASS(wxLogDialog) -}; - -BEGIN_EVENT_TABLE(wxLogDialog, wxDialog) - EVT_BUTTON(wxID_OK, wxLogDialog::OnOk) - EVT_BUTTON(wxID_MORE, wxLogDialog::OnDetails) -#if wxUSE_FILE - EVT_BUTTON(wxID_SAVE, wxLogDialog::OnSave) -#endif // wxUSE_FILE - EVT_LIST_ITEM_SELECTED(wxID_ANY, wxLogDialog::OnListSelect) -END_EVENT_TABLE() - -#endif // wxUSE_LOG_DIALOG - -// ---------------------------------------------------------------------------- -// private functions -// ---------------------------------------------------------------------------- - -#if wxUSE_FILE && wxUSE_FILEDLG - -// pass an uninitialized file object, the function will ask the user for the -// filename and try to open it, returns true on success (file was opened), -// false if file couldn't be opened/created and -1 if the file selection -// dialog was cancelled -static int OpenLogFile(wxFile& file, wxString *filename = NULL, wxWindow *parent = NULL); - -#endif // wxUSE_FILE - -// ---------------------------------------------------------------------------- -// global variables -// ---------------------------------------------------------------------------- - -// we use a global variable to store the frame pointer for wxLogStatus - bad, -// but it's the easiest way -static wxFrame *gs_pFrame = NULL; // FIXME MT-unsafe - -// ============================================================================ -// implementation -// ============================================================================ - -// ---------------------------------------------------------------------------- -// global functions -// ---------------------------------------------------------------------------- - -// accepts an additional argument which tells to which frame the output should -// be directed -void wxVLogStatus(wxFrame *pFrame, const wxChar *szFormat, va_list argptr) -{ - wxString msg; - - wxLog *pLog = wxLog::GetActiveTarget(); - if ( pLog != NULL ) { - msg.PrintfV(szFormat, argptr); - - wxASSERT( gs_pFrame == NULL ); // should be reset! - gs_pFrame = pFrame; -#ifdef __WXWINCE__ - wxLog::OnLog(wxLOG_Status, msg, 0); -#else - wxLog::OnLog(wxLOG_Status, msg, time(NULL)); -#endif - gs_pFrame = (wxFrame *) NULL; - } -} - -void wxLogStatus(wxFrame *pFrame, const wxChar *szFormat, ...) -{ - va_list argptr; - va_start(argptr, szFormat); - wxVLogStatus(pFrame, szFormat, argptr); - va_end(argptr); -} - -// ---------------------------------------------------------------------------- -// wxLogGui implementation (FIXME MT-unsafe) -// ---------------------------------------------------------------------------- - -#if wxUSE_LOGGUI - -wxLogGui::wxLogGui() -{ - Clear(); -} - -void wxLogGui::Clear() -{ - m_bErrors = - m_bWarnings = - m_bHasMessages = false; - - m_aMessages.Empty(); - m_aSeverity.Empty(); - m_aTimes.Empty(); -} - -void wxLogGui::Flush() -{ - if ( !m_bHasMessages ) - return; - - // do it right now to block any new calls to Flush() while we're here - m_bHasMessages = false; - - unsigned repeatCount = 0; - if ( wxLog::GetRepetitionCounting() ) - { - repeatCount = wxLog::DoLogNumberOfRepeats(); - } - - wxString appName = wxTheApp->GetAppName(); - if ( !appName.empty() ) - appName[0u] = (wxChar)wxToupper(appName[0u]); - - long style; - wxString titleFormat; - if ( m_bErrors ) { - titleFormat = _("%s Error"); - style = wxICON_STOP; - } - else if ( m_bWarnings ) { - titleFormat = _("%s Warning"); - style = wxICON_EXCLAMATION; - } - else { - titleFormat = _("%s Information"); - style = wxICON_INFORMATION; - } - - wxString title; - title.Printf(titleFormat, appName.c_str()); - - size_t nMsgCount = m_aMessages.Count(); - - // avoid showing other log dialogs until we're done with the dialog we're - // showing right now: nested modal dialogs make for really bad UI! - Suspend(); - - wxString str; - if ( nMsgCount == 1 ) - { - str = m_aMessages[0]; - } - else // more than one message - { -#if wxUSE_LOG_DIALOG - - if ( repeatCount > 0 ) - m_aMessages[nMsgCount-1] += wxString::Format(wxT(" (%s)"), m_aMessages[nMsgCount-2].c_str()); - wxLogDialog dlg(NULL, - m_aMessages, m_aSeverity, m_aTimes, - title, style); - - // clear the message list before showing the dialog because while it's - // shown some new messages may appear - Clear(); - - (void)dlg.ShowModal(); -#else // !wxUSE_LOG_DIALOG - // concatenate all strings (but not too many to not overfill the msg box) - size_t nLines = 0; - - // start from the most recent message - for ( size_t n = nMsgCount; n > 0; n-- ) { - // for Windows strings longer than this value are wrapped (NT 4.0) - const size_t nMsgLineWidth = 156; - - nLines += (m_aMessages[n - 1].Len() + nMsgLineWidth - 1) / nMsgLineWidth; - - if ( nLines > 25 ) // don't put too many lines in message box - break; - - str << m_aMessages[n - 1] << wxT("\n"); - } -#endif // wxUSE_LOG_DIALOG/!wxUSE_LOG_DIALOG - } - - // this catches both cases of 1 message with wxUSE_LOG_DIALOG and any - // situation without it - if ( !str.empty() ) - { - wxMessageBox(str, title, wxOK | style); - - // no undisplayed messages whatsoever - Clear(); - } - - // allow flushing the logs again - Resume(); -} - -// log all kinds of messages -void wxLogGui::DoLog(wxLogLevel level, const wxChar *szString, time_t t) -{ - switch ( level ) { - case wxLOG_Info: - if ( GetVerbose() ) - case wxLOG_Message: - { - m_aMessages.Add(szString); - m_aSeverity.Add(wxLOG_Message); - m_aTimes.Add((long)t); - m_bHasMessages = true; - } - break; - - case wxLOG_Status: -#if wxUSE_STATUSBAR - { - // find the top window and set it's status text if it has any - wxFrame *pFrame = gs_pFrame; - if ( pFrame == NULL ) { - wxWindow *pWin = wxTheApp->GetTopWindow(); - if ( pWin != NULL && pWin->IsKindOf(CLASSINFO(wxFrame)) ) { - pFrame = (wxFrame *)pWin; - } - } - - if ( pFrame && pFrame->GetStatusBar() ) - pFrame->SetStatusText(szString); - } -#endif // wxUSE_STATUSBAR - break; - - case wxLOG_Trace: - case wxLOG_Debug: - #ifdef __WXDEBUG__ - { - wxString str; - TimeStamp(&str); - str += szString; - - #if defined(__WXMSW__) && !defined(__WXMICROWIN__) - // don't prepend debug/trace here: it goes to the - // debug window anyhow - str += wxT("\r\n"); - OutputDebugString(str); - #else - // send them to stderr - wxFprintf(stderr, wxT("[%s] %s\n"), - level == wxLOG_Trace ? wxT("Trace") - : wxT("Debug"), - str.c_str()); - fflush(stderr); - #endif - } - #endif // __WXDEBUG__ - - break; - - case wxLOG_FatalError: - // show this one immediately - wxMessageBox(szString, _("Fatal error"), wxICON_HAND); - wxExit(); - break; - - case wxLOG_Error: - if ( !m_bErrors ) { -#if !wxUSE_LOG_DIALOG - // discard earlier informational messages if this is the 1st - // error because they might not make sense any more and showing - // them in a message box might be confusing - m_aMessages.Empty(); - m_aSeverity.Empty(); - m_aTimes.Empty(); -#endif // wxUSE_LOG_DIALOG - m_bErrors = true; - } - // fall through - - case wxLOG_Warning: - if ( !m_bErrors ) { - // for the warning we don't discard the info messages - m_bWarnings = true; - } - - m_aMessages.Add(szString); - m_aSeverity.Add((int)level); - m_aTimes.Add((long)t); - m_bHasMessages = true; - break; - } -} - -#endif // wxUSE_LOGGUI - -// ---------------------------------------------------------------------------- -// wxLogWindow and wxLogFrame implementation -// ---------------------------------------------------------------------------- - -#if wxUSE_LOGWINDOW - -// log frame class -// --------------- -class wxLogFrame : public wxFrame -{ -public: - // ctor & dtor - wxLogFrame(wxWindow *pParent, wxLogWindow *log, const wxChar *szTitle); - virtual ~wxLogFrame(); - - // menu callbacks - void OnClose(wxCommandEvent& event); - void OnCloseWindow(wxCloseEvent& event); -#if wxUSE_FILE - void OnSave (wxCommandEvent& event); -#endif // wxUSE_FILE - void OnClear(wxCommandEvent& event); - - // accessors - wxTextCtrl *TextCtrl() const { return m_pTextCtrl; } - -private: - // use standard ids for our commands! - enum - { - Menu_Close = wxID_CLOSE, - Menu_Save = wxID_SAVE, - Menu_Clear = wxID_CLEAR - }; - - // common part of OnClose() and OnCloseWindow() - void DoClose(); - - wxTextCtrl *m_pTextCtrl; - wxLogWindow *m_log; - - DECLARE_EVENT_TABLE() - DECLARE_NO_COPY_CLASS(wxLogFrame) -}; - -BEGIN_EVENT_TABLE(wxLogFrame, wxFrame) - // wxLogWindow menu events - EVT_MENU(Menu_Close, wxLogFrame::OnClose) -#if wxUSE_FILE - EVT_MENU(Menu_Save, wxLogFrame::OnSave) -#endif // wxUSE_FILE - EVT_MENU(Menu_Clear, wxLogFrame::OnClear) - - EVT_CLOSE(wxLogFrame::OnCloseWindow) -END_EVENT_TABLE() - -wxLogFrame::wxLogFrame(wxWindow *pParent, wxLogWindow *log, const wxChar *szTitle) - : wxFrame(pParent, wxID_ANY, szTitle) -{ - m_log = log; - - m_pTextCtrl = new wxTextCtrl(this, wxID_ANY, wxEmptyString, wxDefaultPosition, - wxDefaultSize, - wxTE_MULTILINE | - wxHSCROLL | - // needed for Win32 to avoid 65Kb limit but it doesn't work well - // when using RichEdit 2.0 which we always do in the Unicode build -#if !wxUSE_UNICODE - wxTE_RICH | -#endif // !wxUSE_UNICODE - wxTE_READONLY); - -#if wxUSE_MENUS - // create menu - wxMenuBar *pMenuBar = new wxMenuBar; - wxMenu *pMenu = new wxMenu; -#if wxUSE_FILE - pMenu->Append(Menu_Save, _("&Save..."), _("Save log contents to file")); -#endif // wxUSE_FILE - pMenu->Append(Menu_Clear, _("C&lear"), _("Clear the log contents")); - pMenu->AppendSeparator(); - pMenu->Append(Menu_Close, _("&Close"), _("Close this window")); - pMenuBar->Append(pMenu, _("&Log")); - SetMenuBar(pMenuBar); -#endif // wxUSE_MENUS - -#if wxUSE_STATUSBAR - // status bar for menu prompts - CreateStatusBar(); -#endif // wxUSE_STATUSBAR - - m_log->OnFrameCreate(this); -} - -void wxLogFrame::DoClose() -{ - if ( m_log->OnFrameClose(this) ) - { - // instead of closing just hide the window to be able to Show() it - // later - Show(false); - } -} - -void wxLogFrame::OnClose(wxCommandEvent& WXUNUSED(event)) -{ - DoClose(); -} - -void wxLogFrame::OnCloseWindow(wxCloseEvent& WXUNUSED(event)) -{ - DoClose(); -} - -#if wxUSE_FILE -void wxLogFrame::OnSave(wxCommandEvent& WXUNUSED(event)) -{ -#if wxUSE_FILEDLG - wxString filename; - wxFile file; - int rc = OpenLogFile(file, &filename, this); - if ( rc == -1 ) - { - // cancelled - return; - } - - bool bOk = rc != 0; - - // retrieve text and save it - // ------------------------- - int nLines = m_pTextCtrl->GetNumberOfLines(); - for ( int nLine = 0; bOk && nLine < nLines; nLine++ ) { - bOk = file.Write(m_pTextCtrl->GetLineText(nLine) + - wxTextFile::GetEOL()); - } - - if ( bOk ) - bOk = file.Close(); - - if ( !bOk ) { - wxLogError(_("Can't save log contents to file.")); - } - else { - wxLogStatus(this, _("Log saved to the file '%s'."), filename.c_str()); - } -#endif -} -#endif // wxUSE_FILE - -void wxLogFrame::OnClear(wxCommandEvent& WXUNUSED(event)) -{ - m_pTextCtrl->Clear(); -} - -wxLogFrame::~wxLogFrame() -{ - m_log->OnFrameDelete(this); -} - -// wxLogWindow -// ----------- - -wxLogWindow::wxLogWindow(wxWindow *pParent, - const wxChar *szTitle, - bool bShow, - bool bDoPass) -{ - PassMessages(bDoPass); - - m_pLogFrame = new wxLogFrame(pParent, this, szTitle); - - if ( bShow ) - m_pLogFrame->Show(); -} - -void wxLogWindow::Show(bool bShow) -{ - m_pLogFrame->Show(bShow); -} - -void wxLogWindow::DoLog(wxLogLevel level, const wxChar *szString, time_t t) -{ - // first let the previous logger show it - wxLogPassThrough::DoLog(level, szString, t); - - if ( m_pLogFrame ) { - switch ( level ) { - case wxLOG_Status: - // by default, these messages are ignored by wxLog, so process - // them ourselves - if ( !wxIsEmpty(szString) ) - { - wxString str; - str << _("Status: ") << szString; - DoLogString(str, t); - } - break; - - // don't put trace messages in the text window for 2 reasons: - // 1) there are too many of them - // 2) they may provoke other trace messages thus sending a program - // into an infinite loop - case wxLOG_Trace: - break; - - default: - // and this will format it nicely and call our DoLogString() - wxLog::DoLog(level, szString, t); - } - } -} - -void wxLogWindow::DoLogString(const wxChar *szString, time_t WXUNUSED(t)) -{ - // put the text into our window - wxTextCtrl *pText = m_pLogFrame->TextCtrl(); - - // remove selection (WriteText is in fact ReplaceSelection) -#ifdef __WXMSW__ - wxTextPos nLen = pText->GetLastPosition(); - pText->SetSelection(nLen, nLen); -#endif // Windows - - wxString msg; - TimeStamp(&msg); - msg << szString << wxT('\n'); - - pText->AppendText(msg); - - // TODO ensure that the line can be seen -} - -wxFrame *wxLogWindow::GetFrame() const -{ - return m_pLogFrame; -} - -void wxLogWindow::OnFrameCreate(wxFrame * WXUNUSED(frame)) -{ -} - -bool wxLogWindow::OnFrameClose(wxFrame * WXUNUSED(frame)) -{ - // allow to close - return true; -} - -void wxLogWindow::OnFrameDelete(wxFrame * WXUNUSED(frame)) -{ - m_pLogFrame = (wxLogFrame *)NULL; -} - -wxLogWindow::~wxLogWindow() -{ - // may be NULL if log frame already auto destroyed itself - delete m_pLogFrame; -} - -#endif // wxUSE_LOGWINDOW - -// ---------------------------------------------------------------------------- -// wxLogDialog -// ---------------------------------------------------------------------------- - -#if wxUSE_LOG_DIALOG - -#ifndef __SMARTPHONE__ -static const size_t MARGIN = 10; -#else -static const size_t MARGIN = 0; -#endif - -wxString wxLogDialog::ms_details; - -wxLogDialog::wxLogDialog(wxWindow *parent, - const wxArrayString& messages, - const wxArrayInt& severity, - const wxArrayLong& times, - const wxString& caption, - long style) - : wxDialog(parent, wxID_ANY, caption, - wxDefaultPosition, wxDefaultSize, - wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER) -{ - if ( ms_details.empty() ) - { - // ensure that we won't loop here if wxGetTranslation() - // happens to pop up a Log message while translating this :-) - ms_details = wxTRANSLATE("&Details"); - ms_details = wxGetTranslation(ms_details); -#ifdef __SMARTPHONE__ - ms_details = wxStripMenuCodes(ms_details); -#endif - } - - size_t count = messages.GetCount(); - m_messages.Alloc(count); - m_severity.Alloc(count); - m_times.Alloc(count); - - for ( size_t n = 0; n < count; n++ ) - { - wxString msg = messages[n]; - msg.Replace(wxT("\n"), wxT(" ")); - m_messages.Add(msg); - m_severity.Add(severity[n]); - m_times.Add(times[n]); - } - - m_showingDetails = false; // not initially - m_listctrl = (wxListCtrl *)NULL; - -#ifndef __SMARTPHONE__ - -#if wxUSE_STATLINE - m_statline = (wxStaticLine *)NULL; -#endif // wxUSE_STATLINE - -#if wxUSE_FILE - m_btnSave = (wxButton *)NULL; -#endif // wxUSE_FILE - -#endif // __SMARTPHONE__ - - bool isPda = (wxSystemSettings::GetScreenType() <= wxSYS_SCREEN_PDA); - - // create the controls which are always shown and layout them: we use - // sizers even though our window is not resizeable to calculate the size of - // the dialog properly - wxBoxSizer *sizerTop = new wxBoxSizer(wxVERTICAL); -#ifndef __SMARTPHONE__ - wxBoxSizer *sizerButtons = new wxBoxSizer(isPda ? wxHORIZONTAL : wxVERTICAL); -#endif - wxBoxSizer *sizerAll = new wxBoxSizer(isPda ? wxVERTICAL : wxHORIZONTAL); - -#ifdef __SMARTPHONE__ - SetLeftMenu(wxID_OK); - SetRightMenu(wxID_MORE, ms_details + EXPAND_SUFFIX); -#else - wxButton *btnOk = new wxButton(this, wxID_OK); - sizerButtons->Add(btnOk, 0, isPda ? wxCENTRE : wxCENTRE|wxBOTTOM, MARGIN/2); - m_btnDetails = new wxButton(this, wxID_MORE, ms_details + EXPAND_SUFFIX); - sizerButtons->Add(m_btnDetails, 0, isPda ? wxCENTRE|wxLEFT : wxCENTRE | wxTOP, MARGIN/2 - 1); -#endif - - wxBitmap bitmap; - switch ( style & wxICON_MASK ) - { - case wxICON_ERROR: - bitmap = wxArtProvider::GetBitmap(wxART_ERROR, wxART_MESSAGE_BOX); -#ifdef __WXPM__ - bitmap.SetId(wxICON_SMALL_ERROR); -#endif - break; - - case wxICON_INFORMATION: - bitmap = wxArtProvider::GetBitmap(wxART_INFORMATION, wxART_MESSAGE_BOX); -#ifdef __WXPM__ - bitmap.SetId(wxICON_SMALL_INFO); -#endif - break; - - case wxICON_WARNING: - bitmap = wxArtProvider::GetBitmap(wxART_WARNING, wxART_MESSAGE_BOX); -#ifdef __WXPM__ - bitmap.SetId(wxICON_SMALL_WARNING); -#endif - break; - - default: - wxFAIL_MSG(_T("incorrect log style")); - } - - if (!isPda) - sizerAll->Add(new wxStaticBitmap(this, wxID_ANY, bitmap), 0, - wxALIGN_CENTRE_VERTICAL); - - const wxString& message = messages.Last(); - sizerAll->Add(CreateTextSizer(message), 1, - wxALIGN_CENTRE_VERTICAL | wxLEFT | wxRIGHT, MARGIN); -#ifndef __SMARTPHONE__ - sizerAll->Add(sizerButtons, 0, isPda ? wxCENTRE|wxTOP|wxBOTTOM : (wxALIGN_RIGHT | wxLEFT), MARGIN); -#endif - - sizerTop->Add(sizerAll, 0, wxALL | wxEXPAND, MARGIN); - - SetSizer(sizerTop); - - // see comments in OnDetails() - // - // Note: Doing this, this way, triggered a nasty bug in - // wxTopLevelWindowGTK::GtkOnSize which took -1 literally once - // either of maxWidth or maxHeight was set. This symptom has been - // fixed there, but it is a problem that remains as long as we allow - // unchecked access to the internal size members. We really need to - // encapuslate window sizes more cleanly and make it clear when -1 will - // be substituted and when it will not. - - wxSize size = sizerTop->Fit(this); - m_maxHeight = size.y; - SetSizeHints(size.x, size.y, m_maxWidth, m_maxHeight); - -#ifndef __SMARTPHONE__ - btnOk->SetFocus(); -#endif - - Centre(); - - if (isPda) - { - // Move up the screen so that when we expand the dialog, - // there's enough space. - Move(wxPoint(GetPosition().x, GetPosition().y / 2)); - } -} - -void wxLogDialog::CreateDetailsControls() -{ -#ifndef __SMARTPHONE__ - // create the save button and separator line if possible -#if wxUSE_FILE - m_btnSave = new wxButton(this, wxID_SAVE); -#endif // wxUSE_FILE - -#if wxUSE_STATLINE - m_statline = new wxStaticLine(this, wxID_ANY); -#endif // wxUSE_STATLINE - -#endif // __SMARTPHONE__ - - // create the list ctrl now - m_listctrl = new wxListCtrl(this, wxID_ANY, - wxDefaultPosition, wxDefaultSize, - wxSUNKEN_BORDER | - wxLC_REPORT | - wxLC_NO_HEADER | - wxLC_SINGLE_SEL); -#ifdef __WXWINCE__ - // This maks a big aesthetic difference on WinCE but I - // don't want to risk problems on other platforms - m_listctrl->Hide(); -#endif - - // no need to translate these strings as they're not shown to the - // user anyhow (we use wxLC_NO_HEADER style) - m_listctrl->InsertColumn(0, _T("Message")); - m_listctrl->InsertColumn(1, _T("Time")); - - // prepare the imagelist - static const int ICON_SIZE = 16; - wxImageList *imageList = new wxImageList(ICON_SIZE, ICON_SIZE); - - // order should be the same as in the switch below! - static const wxChar* icons[] = - { - wxART_ERROR, - wxART_WARNING, - wxART_INFORMATION - }; - - bool loadedIcons = true; - - for ( size_t icon = 0; icon < WXSIZEOF(icons); icon++ ) - { - wxBitmap bmp = wxArtProvider::GetBitmap(icons[icon], wxART_MESSAGE_BOX, - wxSize(ICON_SIZE, ICON_SIZE)); - - // This may very well fail if there are insufficient colours available. - // Degrade gracefully. - if ( !bmp.Ok() ) - { - loadedIcons = false; - - break; - } - - imageList->Add(bmp); - } - - m_listctrl->SetImageList(imageList, wxIMAGE_LIST_SMALL); - - // and fill it - wxString fmt = wxLog::GetTimestamp(); - if ( !fmt ) - { - // default format - fmt = _T("%c"); - } - - size_t count = m_messages.GetCount(); - for ( size_t n = 0; n < count; n++ ) - { - int image; - - if ( loadedIcons ) - { - switch ( m_severity[n] ) - { - case wxLOG_Error: - image = 0; - break; - - case wxLOG_Warning: - image = 1; - break; - - default: - image = 2; - } - } - else // failed to load images - { - image = -1; - } - - m_listctrl->InsertItem(n, m_messages[n], image); - m_listctrl->SetItem(n, 1, TimeStamp(fmt, (time_t)m_times[n])); - } - - // let the columns size themselves - m_listctrl->SetColumnWidth(0, wxLIST_AUTOSIZE); - m_listctrl->SetColumnWidth(1, wxLIST_AUTOSIZE); - - // calculate an approximately nice height for the listctrl - int height = GetCharHeight()*(count + 4); - - // but check that the dialog won't fall fown from the screen - // - // we use GetMinHeight() to get the height of the dialog part without the - // details and we consider that the "Save" button below and the separator - // line (and the margins around it) take about as much, hence double it - int heightMax = wxGetDisplaySize().y - GetPosition().y - 2*GetMinHeight(); - - // we should leave a margin - heightMax *= 9; - heightMax /= 10; - - m_listctrl->SetSize(wxDefaultCoord, wxMin(height, heightMax)); -} - -void wxLogDialog::OnListSelect(wxListEvent& event) -{ - // we can't just disable the control because this looks ugly under Windows - // (wrong bg colour, no scrolling...), but we still want to disable - // selecting items - it makes no sense here - m_listctrl->SetItemState(event.GetIndex(), 0, wxLIST_STATE_SELECTED); -} - -void wxLogDialog::OnOk(wxCommandEvent& WXUNUSED(event)) -{ - EndModal(wxID_OK); -} - -#if wxUSE_FILE - -void wxLogDialog::OnSave(wxCommandEvent& WXUNUSED(event)) -{ -#if wxUSE_FILEDLG - wxFile file; - int rc = OpenLogFile(file, NULL, this); - if ( rc == -1 ) - { - // cancelled - return; - } - - bool ok = rc != 0; - - wxString fmt = wxLog::GetTimestamp(); - if ( !fmt ) - { - // default format - fmt = _T("%c"); - } - - size_t count = m_messages.GetCount(); - for ( size_t n = 0; ok && (n < count); n++ ) - { - wxString line; - line << TimeStamp(fmt, (time_t)m_times[n]) - << _T(": ") - << m_messages[n] - << wxTextFile::GetEOL(); - - ok = file.Write(line); - } - - if ( ok ) - ok = file.Close(); - - if ( !ok ) - wxLogError(_("Can't save log contents to file.")); -#endif // wxUSE_FILEDLG -} - -#endif // wxUSE_FILE - -void wxLogDialog::OnDetails(wxCommandEvent& WXUNUSED(event)) -{ - wxSizer *sizer = GetSizer(); - - if ( m_showingDetails ) - { -#ifdef __SMARTPHONE__ - SetRightMenu(wxID_MORE, ms_details + EXPAND_SUFFIX); -#else - m_btnDetails->SetLabel(ms_details + EXPAND_SUFFIX); -#endif - - sizer->Detach( m_listctrl ); - -#ifndef __SMARTPHONE__ - -#if wxUSE_STATLINE - sizer->Detach( m_statline ); -#endif // wxUSE_STATLINE - -#if wxUSE_FILE - sizer->Detach( m_btnSave ); -#endif // wxUSE_FILE - -#endif // __SMARTPHONE__ - } - else // show details now - { -#ifdef __SMARTPHONE__ - SetRightMenu(wxID_MORE, wxString(_T("<< ")) + ms_details); -#else - m_btnDetails->SetLabel(wxString(_T("<< ")) + ms_details); -#endif - - if ( !m_listctrl ) - { - CreateDetailsControls(); - } - -#if wxUSE_STATLINE && !defined(__SMARTPHONE__) - bool isPda = (wxSystemSettings::GetScreenType() <= wxSYS_SCREEN_PDA); - if (!isPda) - sizer->Add(m_statline, 0, wxEXPAND | (wxALL & ~wxTOP), MARGIN); -#endif // wxUSE_STATLINE - - sizer->Add(m_listctrl, 1, wxEXPAND | (wxALL & ~wxTOP), MARGIN); - - // VZ: this doesn't work as this becomes the initial (and not only - // minimal) listctrl height as well - why? -#if 0 - // allow the user to make the dialog shorter than its initial height - - // without this it wouldn't work as the list ctrl would have been - // incompressible - sizer->SetItemMinSize(m_listctrl, 100, 3*GetCharHeight()); -#endif // 0 - -#if wxUSE_FILE && !defined(__SMARTPHONE__) - sizer->Add(m_btnSave, 0, wxALIGN_RIGHT | (wxALL & ~wxTOP), MARGIN); -#endif // wxUSE_FILE - } - - m_showingDetails = !m_showingDetails; - - // in any case, our size changed - relayout everything and set new hints - // --------------------------------------------------------------------- - - // we have to reset min size constraints or Fit() would never reduce the - // dialog size when collapsing it and we have to reset max constraint - // because it wouldn't expand it otherwise - - m_minHeight = - m_maxHeight = -1; - - // wxSizer::FitSize() is private, otherwise we might use it directly... - wxSize sizeTotal = GetSize(), - sizeClient = GetClientSize(); - - wxSize size = sizer->GetMinSize(); - size.x += sizeTotal.x - sizeClient.x; - size.y += sizeTotal.y - sizeClient.y; - - // we don't want to allow expanding the dialog in vertical direction as - // this would show the "hidden" details but we can resize the dialog - // vertically while the details are shown - if ( !m_showingDetails ) - m_maxHeight = size.y; - - SetSizeHints(size.x, size.y, m_maxWidth, m_maxHeight); - -#ifdef __WXWINCE__ - if (m_showingDetails) - m_listctrl->Show(); -#endif - - // don't change the width when expanding/collapsing - SetSize(wxDefaultCoord, size.y); - -#ifdef __WXGTK__ - // VS: this is necessary in order to force frame redraw under - // WindowMaker or fvwm2 (and probably other broken WMs). - // Otherwise, detailed list wouldn't be displayed. - Show(); -#endif // wxGTK -} - -wxLogDialog::~wxLogDialog() -{ - if ( m_listctrl ) - { - delete m_listctrl->GetImageList(wxIMAGE_LIST_SMALL); - } -} - -#endif // wxUSE_LOG_DIALOG - -#if wxUSE_FILE && wxUSE_FILEDLG - -// pass an uninitialized file object, the function will ask the user for the -// filename and try to open it, returns true on success (file was opened), -// false if file couldn't be opened/created and -1 if the file selection -// dialog was cancelled -static int OpenLogFile(wxFile& file, wxString *pFilename, wxWindow *parent) -{ - // get the file name - // ----------------- - wxString filename = wxSaveFileSelector(wxT("log"), wxT("txt"), wxT("log.txt"), parent); - if ( !filename ) { - // cancelled - return -1; - } - - // open file - // --------- - bool bOk wxDUMMY_INITIALIZE(false); - if ( wxFile::Exists(filename) ) { - bool bAppend = false; - wxString strMsg; - strMsg.Printf(_("Append log to file '%s' (choosing [No] will overwrite it)?"), - filename.c_str()); - switch ( wxMessageBox(strMsg, _("Question"), - wxICON_QUESTION | wxYES_NO | wxCANCEL) ) { - case wxYES: - bAppend = true; - break; - - case wxNO: - bAppend = false; - break; - - case wxCANCEL: - return -1; - - default: - wxFAIL_MSG(_("invalid message box return value")); - } - - if ( bAppend ) { - bOk = file.Open(filename, wxFile::write_append); - } - else { - bOk = file.Create(filename, true /* overwrite */); - } - } - else { - bOk = file.Create(filename); - } - - if ( pFilename ) - *pFilename = filename; - - return bOk; -} - -#endif // wxUSE_FILE - -#endif // !(wxUSE_LOGGUI || wxUSE_LOGWINDOW) - -#if wxUSE_LOG && wxUSE_TEXTCTRL - -// ---------------------------------------------------------------------------- -// wxLogTextCtrl implementation -// ---------------------------------------------------------------------------- - -wxLogTextCtrl::wxLogTextCtrl(wxTextCtrl *pTextCtrl) -{ - m_pTextCtrl = pTextCtrl; -} - -void wxLogTextCtrl::DoLogString(const wxChar *szString, time_t WXUNUSED(t)) -{ - wxString msg; - TimeStamp(&msg); - - msg << szString << wxT('\n'); - m_pTextCtrl->AppendText(msg); -} - -#endif // wxUSE_LOG && wxUSE_TEXTCTRL diff --git a/wxWidgets/src/generic/mask.cpp b/wxWidgets/src/generic/mask.cpp deleted file mode 100644 index 69d6cfaf74..0000000000 --- a/wxWidgets/src/generic/mask.cpp +++ /dev/null @@ -1,76 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: src/generic/mask.cpp -// Purpose: generic wxMask implementation -// Author: Vadim Zeitlin -// Created: 2006-09-28 -// RCS-ID: $Id: mask.cpp 41495 2006-09-28 23:02:39Z VZ $ -// Copyright: (c) 2006 Vadim Zeitlin -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -// for compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#ifndef WX_PRECOMP - #include "wx/bitmap.h" - #include "wx/image.h" -#endif // WX_PRECOMP - -#if wxUSE_GENERIC_MASK - -// ============================================================================ -// wxMask implementation -// ============================================================================ - -IMPLEMENT_DYNAMIC_CLASS(wxMask, wxObject) - -void wxMask::FreeData() -{ - m_bitmap = wxNullBitmap; -} - -bool wxMask::InitFromColour(const wxBitmap& bitmap, const wxColour& colour) -{ -#if wxUSE_IMAGE - const wxColour clr(bitmap.QuantizeColour(colour)); - - wxImage imgSrc(bitmap.ConvertToImage()); - imgSrc.SetMask(false); - wxImage image(imgSrc.ConvertToMono(clr.Red(), clr.Green(), clr.Blue())); - if ( !image.Ok() ) - return false; - - m_bitmap = wxBitmap(image, 1); - - return m_bitmap.Ok(); -#else // !wxUSE_IMAGE - wxUnusedVar(bitmap); - wxUnusedVar(colour); - - return false; -#endif // wxUSE_IMAGE/!wxUSE_IMAGE -} - -bool wxMask::InitFromMonoBitmap(const wxBitmap& bitmap) -{ - wxCHECK_MSG( bitmap.Ok(), false, wxT("Invalid bitmap") ); - wxCHECK_MSG( bitmap.GetDepth() == 1, false, wxT("Cannot create mask from colour bitmap") ); - - m_bitmap = bitmap; - - return true; -} - -#endif // wxUSE_GENERIC_MASK diff --git a/wxWidgets/src/generic/mdig.cpp b/wxWidgets/src/generic/mdig.cpp deleted file mode 100644 index e0b1b7dfbd..0000000000 --- a/wxWidgets/src/generic/mdig.cpp +++ /dev/null @@ -1,820 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/generic/mdig.cpp -// Purpose: Generic MDI (Multiple Document Interface) classes -// Author: Hans Van Leemputten -// Modified by: -// Created: 29/07/2002 -// RCS-ID: $Id: mdig.cpp 41069 2006-09-08 14:38:49Z VS $ -// Copyright: (c) Hans Van Leemputten -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// =========================================================================== -// declarations -// =========================================================================== - -// --------------------------------------------------------------------------- -// headers -// --------------------------------------------------------------------------- - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_MDI - -#include "wx/generic/mdig.h" - -#ifndef WX_PRECOMP - #include "wx/panel.h" - #include "wx/menu.h" - #include "wx/intl.h" - #include "wx/log.h" -#endif //WX_PRECOMP - -#include "wx/stockitem.h" - -enum MDI_MENU_ID -{ - wxWINDOWCLOSE = 4001, - wxWINDOWCLOSEALL, - wxWINDOWNEXT, - wxWINDOWPREV -}; - -//----------------------------------------------------------------------------- -// wxGenericMDIParentFrame -//----------------------------------------------------------------------------- - -IMPLEMENT_DYNAMIC_CLASS(wxGenericMDIParentFrame, wxFrame) - -BEGIN_EVENT_TABLE(wxGenericMDIParentFrame, wxFrame) -#if wxUSE_MENUS - EVT_MENU (wxID_ANY, wxGenericMDIParentFrame::DoHandleMenu) -#endif -END_EVENT_TABLE() - -wxGenericMDIParentFrame::wxGenericMDIParentFrame() -{ - Init(); -} - -wxGenericMDIParentFrame::wxGenericMDIParentFrame(wxWindow *parent, - wxWindowID id, - const wxString& title, - const wxPoint& pos, - const wxSize& size, - long style, - const wxString& name) -{ - Init(); - - (void)Create(parent, id, title, pos, size, style, name); -} - -wxGenericMDIParentFrame::~wxGenericMDIParentFrame() -{ - // Make sure the client window is destructed before the menu bars are! - wxDELETE(m_pClientWindow); - -#if wxUSE_MENUS - if (m_pMyMenuBar) - { - delete m_pMyMenuBar; - m_pMyMenuBar = (wxMenuBar *) NULL; - } - - RemoveWindowMenu(GetMenuBar()); - - if (m_pWindowMenu) - { - delete m_pWindowMenu; - m_pWindowMenu = (wxMenu*) NULL; - } -#endif // wxUSE_MENUS -} - -bool wxGenericMDIParentFrame::Create(wxWindow *parent, - wxWindowID id, - const wxString& title, - const wxPoint& pos, - const wxSize& size, - long style, - const wxString& name) -{ - // this style can be used to prevent a window from having the standard MDI - // "Window" menu - if ( !(style & wxFRAME_NO_WINDOW_MENU) ) - { -#if wxUSE_MENUS - m_pWindowMenu = new wxMenu; - - m_pWindowMenu->Append(wxWINDOWCLOSE, _("Cl&ose")); - m_pWindowMenu->Append(wxWINDOWCLOSEALL, _("Close All")); - m_pWindowMenu->AppendSeparator(); - m_pWindowMenu->Append(wxWINDOWNEXT, _("&Next")); - m_pWindowMenu->Append(wxWINDOWPREV, _("&Previous")); -#endif // wxUSE_MENUS - } - - wxFrame::Create( parent, id, title, pos, size, style, name ); - - OnCreateClient(); - - return true; -} - -#if wxUSE_MENUS -void wxGenericMDIParentFrame::SetWindowMenu(wxMenu* pMenu) -{ - // Replace the window menu from the currently loaded menu bar. - wxMenuBar *pMenuBar = GetMenuBar(); - - if (m_pWindowMenu) - { - RemoveWindowMenu(pMenuBar); - - wxDELETE(m_pWindowMenu); - } - - if (pMenu) - { - m_pWindowMenu = pMenu; - - AddWindowMenu(pMenuBar); - } -} - -void wxGenericMDIParentFrame::SetMenuBar(wxMenuBar *pMenuBar) -{ - // Remove the Window menu from the old menu bar - RemoveWindowMenu(GetMenuBar()); - // Add the Window menu to the new menu bar. - AddWindowMenu(pMenuBar); - - wxFrame::SetMenuBar(pMenuBar); -} -#endif // wxUSE_MENUS - -void wxGenericMDIParentFrame::SetChildMenuBar(wxGenericMDIChildFrame *pChild) -{ -#if wxUSE_MENUS - if (pChild == (wxGenericMDIChildFrame *) NULL) - { - // No Child, set Our menu bar back. - SetMenuBar(m_pMyMenuBar); - - // Make sure we know our menu bar is in use - m_pMyMenuBar = (wxMenuBar*) NULL; - } - else - { - if (pChild->GetMenuBar() == (wxMenuBar*) NULL) - return; - - // Do we need to save the current bar? - if (m_pMyMenuBar == NULL) - m_pMyMenuBar = GetMenuBar(); - - SetMenuBar(pChild->GetMenuBar()); - } -#endif // wxUSE_MENUS -} - -bool wxGenericMDIParentFrame::ProcessEvent(wxEvent& event) -{ - /* - * Redirect events to active child first. - */ - - // Stops the same event being processed repeatedly - static wxEventType inEvent = wxEVT_NULL; - if (inEvent == event.GetEventType()) - return false; - - inEvent = event.GetEventType(); - - // Let the active child (if any) process the event first. - bool res = false; - if (m_pActiveChild && event.IsKindOf(CLASSINFO(wxCommandEvent)) -#if 0 - /* This is sure to not give problems... */ - && (event.GetEventType() == wxEVT_COMMAND_MENU_SELECTED || - event.GetEventType() == wxEVT_UPDATE_UI ) -#else - /* This was tested on wxMSW and worked... */ - && event.GetEventObject() != m_pClientWindow - && !(event.GetEventType() == wxEVT_ACTIVATE || - event.GetEventType() == wxEVT_SET_FOCUS || - event.GetEventType() == wxEVT_KILL_FOCUS || - event.GetEventType() == wxEVT_CHILD_FOCUS || - event.GetEventType() == wxEVT_COMMAND_SET_FOCUS || - event.GetEventType() == wxEVT_COMMAND_KILL_FOCUS ) -#endif - ) - { - res = m_pActiveChild->GetEventHandler()->ProcessEvent(event); - } - - // If the event was not handled this frame will handle it! - if (!res) - { - res = GetEventHandler()->wxEvtHandler::ProcessEvent(event); - } - - inEvent = wxEVT_NULL; - - return res; -} - -wxGenericMDIChildFrame *wxGenericMDIParentFrame::GetActiveChild() const -{ - return m_pActiveChild; -} - -void wxGenericMDIParentFrame::SetActiveChild(wxGenericMDIChildFrame* pChildFrame) -{ - m_pActiveChild = pChildFrame; -} - -wxGenericMDIClientWindow *wxGenericMDIParentFrame::GetClientWindow() const -{ - return m_pClientWindow; -} - -wxGenericMDIClientWindow *wxGenericMDIParentFrame::OnCreateClient() -{ -#if wxUSE_GENERIC_MDI_AS_NATIVE - m_pClientWindow = new wxMDIClientWindow( this ); -#else - m_pClientWindow = new wxGenericMDIClientWindow( this ); -#endif - return m_pClientWindow; -} - -void wxGenericMDIParentFrame::ActivateNext() -{ - if (m_pClientWindow && m_pClientWindow->GetSelection() != -1) - { - size_t active = m_pClientWindow->GetSelection() + 1; - if (active >= m_pClientWindow->GetPageCount()) - active = 0; - - m_pClientWindow->SetSelection(active); - } -} - -void wxGenericMDIParentFrame::ActivatePrevious() -{ - if (m_pClientWindow && m_pClientWindow->GetSelection() != -1) - { - int active = m_pClientWindow->GetSelection() - 1; - if (active < 0) - active = m_pClientWindow->GetPageCount() - 1; - - m_pClientWindow->SetSelection(active); - } -} - -void wxGenericMDIParentFrame::Init() -{ - m_pClientWindow = (wxGenericMDIClientWindow *) NULL; - m_pActiveChild = (wxGenericMDIChildFrame *) NULL; -#if wxUSE_MENUS - m_pWindowMenu = (wxMenu *) NULL; - m_pMyMenuBar = (wxMenuBar*) NULL; -#endif // wxUSE_MENUS -} - -#if wxUSE_MENUS -void wxGenericMDIParentFrame::RemoveWindowMenu(wxMenuBar *pMenuBar) -{ - if (pMenuBar && m_pWindowMenu) - { - // Remove old window menu - int pos = pMenuBar->FindMenu(_("&Window")); - if (pos != wxNOT_FOUND) - { - wxASSERT(m_pWindowMenu == pMenuBar->GetMenu(pos)); // DBG:: We're going to delete the wrong menu!!! - pMenuBar->Remove(pos); - } - } -} - -void wxGenericMDIParentFrame::AddWindowMenu(wxMenuBar *pMenuBar) -{ - if (pMenuBar && m_pWindowMenu) - { - int pos = pMenuBar->FindMenu(wxGetStockLabel(wxID_HELP,false)); - if (pos == wxNOT_FOUND) - { - pMenuBar->Append(m_pWindowMenu, _("&Window")); - } - else - { - pMenuBar->Insert(pos, m_pWindowMenu, _("&Window")); - } - } -} - -void wxGenericMDIParentFrame::DoHandleMenu(wxCommandEvent &event) -{ - switch (event.GetId()) - { - case wxWINDOWCLOSE: - if (m_pActiveChild) - { - m_pActiveChild->Close(); - } - break; - case wxWINDOWCLOSEALL: - { -#if 0 // code is only needed if next #if is set to 0! - wxGenericMDIChildFrame *pFirstActiveChild = m_pActiveChild; -#endif - while (m_pActiveChild) - { - if (!m_pActiveChild->Close()) - { - return; // We failed... - } - else - { -#if 1 // What's best? Delayed deleting or immediate deleting? - delete m_pActiveChild; - m_pActiveChild = NULL; -#else - ActivateNext(); - - if (pFirstActiveChild == m_pActiveChild) - return; // We've called Close on all items, no need to continue. -#endif - } - } - } - break; - case wxWINDOWNEXT: - ActivateNext(); - break; - case wxWINDOWPREV: - ActivatePrevious(); - break; - default : - event.Skip(); - } -} -#endif // wxUSE_MENUS - -void wxGenericMDIParentFrame::DoGetClientSize(int *width, int *height) const -{ - wxFrame::DoGetClientSize( width, height ); -} - - -//----------------------------------------------------------------------------- -// wxGenericMDIChildFrame -//----------------------------------------------------------------------------- - -IMPLEMENT_DYNAMIC_CLASS(wxGenericMDIChildFrame, wxPanel) - -BEGIN_EVENT_TABLE(wxGenericMDIChildFrame, wxPanel) - EVT_MENU_HIGHLIGHT_ALL(wxGenericMDIChildFrame::OnMenuHighlight) - EVT_ACTIVATE(wxGenericMDIChildFrame::OnActivate) - - EVT_CLOSE(wxGenericMDIChildFrame::OnCloseWindow) - EVT_SIZE(wxGenericMDIChildFrame::OnSize) -END_EVENT_TABLE() - -wxGenericMDIChildFrame::wxGenericMDIChildFrame() -{ - Init(); -} - -wxGenericMDIChildFrame::wxGenericMDIChildFrame( wxGenericMDIParentFrame *parent, - wxWindowID id, const wxString& title, - const wxPoint& WXUNUSED(pos), const wxSize& size, - long style, const wxString& name ) -{ - Init(); - - Create( parent, id, title, wxDefaultPosition, size, style, name ); -} - -wxGenericMDIChildFrame::~wxGenericMDIChildFrame() -{ - wxGenericMDIParentFrame *pParentFrame = GetMDIParentFrame(); - - if (pParentFrame != NULL) - { - bool bActive = false; - if (pParentFrame->GetActiveChild() == this) - { - pParentFrame->SetActiveChild((wxGenericMDIChildFrame*) NULL); - pParentFrame->SetChildMenuBar((wxGenericMDIChildFrame*) NULL); - bActive = true; - } - - wxGenericMDIClientWindow *pClientWindow = pParentFrame->GetClientWindow(); - - // Remove page if still there - size_t pos; - for (pos = 0; pos < pClientWindow->GetPageCount(); pos++) - { - if (pClientWindow->GetPage(pos) == this) - { - if (pClientWindow->RemovePage(pos)) - pClientWindow->Refresh(); - break; - } - } - - if (bActive) - { - // Set the new selection to the a remaining page - if (pClientWindow->GetPageCount() > pos) - { - pClientWindow->SetSelection(pos); - } - else - { - if ((int)pClientWindow->GetPageCount() - 1 >= 0) - pClientWindow->SetSelection(pClientWindow->GetPageCount() - 1); - } - } - } - -#if wxUSE_MENUS - wxDELETE(m_pMenuBar); -#endif // wxUSE_MENUS -} - -bool wxGenericMDIChildFrame::Create( wxGenericMDIParentFrame *parent, - wxWindowID id, const wxString& title, - const wxPoint& WXUNUSED(pos), const wxSize& size, - long style, const wxString& name ) -{ - wxGenericMDIClientWindow* pClientWindow = parent->GetClientWindow(); - - wxASSERT_MSG((pClientWindow != (wxWindow*) NULL), wxT("Missing MDI client window.") ); - - wxPanel::Create(pClientWindow, id, wxDefaultPosition, size, style, name); - - SetMDIParentFrame(parent); - - // This is the currently active child - parent->SetActiveChild(this); - - m_Title = title; - - pClientWindow->AddPage(this, title, true); - ApplyMDIChildFrameRect(); // Ok confirme the size change! - pClientWindow->Refresh(); - - return true; -} - -#if wxUSE_MENUS -void wxGenericMDIChildFrame::SetMenuBar( wxMenuBar *menu_bar ) -{ - wxMenuBar *pOldMenuBar = m_pMenuBar; - m_pMenuBar = menu_bar; - - if (m_pMenuBar) - { - wxGenericMDIParentFrame *pParentFrame = GetMDIParentFrame(); - - if (pParentFrame != NULL) - { - m_pMenuBar->SetParent(pParentFrame); - - if (pParentFrame->GetActiveChild() == this) - { - // Replace current menu bars - if (pOldMenuBar) - pParentFrame->SetChildMenuBar((wxGenericMDIChildFrame*) NULL); - pParentFrame->SetChildMenuBar((wxGenericMDIChildFrame*) this); - } - } - } -} - -wxMenuBar *wxGenericMDIChildFrame::GetMenuBar() const -{ - return m_pMenuBar; -} -#endif // wxUSE_MENUS - -void wxGenericMDIChildFrame::SetTitle(const wxString& title) -{ - m_Title = title; - - wxGenericMDIParentFrame *pParentFrame = GetMDIParentFrame(); - - if (pParentFrame != NULL) - { - wxGenericMDIClientWindow * pClientWindow = pParentFrame->GetClientWindow(); - - if (pClientWindow != NULL) - { - size_t pos; - for (pos = 0; pos < pClientWindow->GetPageCount(); pos++) - { - if (pClientWindow->GetPage(pos) == this) - { - pClientWindow->SetPageText(pos, m_Title); - break; - } - } - } - } -} - -wxString wxGenericMDIChildFrame::GetTitle() const -{ - return m_Title; -} - -void wxGenericMDIChildFrame::Activate() -{ - wxGenericMDIParentFrame *pParentFrame = GetMDIParentFrame(); - - if (pParentFrame != NULL) - { - wxGenericMDIClientWindow * pClientWindow = pParentFrame->GetClientWindow(); - - if (pClientWindow != NULL) - { - size_t pos; - for (pos = 0; pos < pClientWindow->GetPageCount(); pos++) - { - if (pClientWindow->GetPage(pos) == this) - { - pClientWindow->SetSelection(pos); - break; - } - } - } - } -} - -void wxGenericMDIChildFrame::OnMenuHighlight(wxMenuEvent& event) -{ -#if wxUSE_STATUSBAR - if ( m_pMDIParentFrame) - { - // we don't have any help text for this item, - // but may be the MDI frame does? - m_pMDIParentFrame->OnMenuHighlight(event); - } -#else - wxUnusedVar(event); -#endif // wxUSE_STATUSBAR -} - -void wxGenericMDIChildFrame::OnActivate(wxActivateEvent& WXUNUSED(event)) -{ - // Do mothing. -} - -/*** Copied from top level..! ***/ -// default resizing behaviour - if only ONE subwindow, resize to fill the -// whole client area -void wxGenericMDIChildFrame::OnSize(wxSizeEvent& WXUNUSED(event)) -{ - // if we're using constraints or sizers - do use them - if ( GetAutoLayout() ) - { - Layout(); - } - else - { - // do we have _exactly_ one child? - wxWindow *child = (wxWindow *)NULL; - for ( wxWindowList::compatibility_iterator node = GetChildren().GetFirst(); - node; - node = node->GetNext() ) - { - wxWindow *win = node->GetData(); - - // exclude top level and managed windows (status bar isn't - // currently in the children list except under wxMac anyhow, but - // it makes no harm to test for it) - if ( !win->IsTopLevel() /*&& !IsOneOfBars(win)*/ ) - { - if ( child ) - { - return; // it's our second subwindow - nothing to do - } - - child = win; - } - } - - // do we have any children at all? - if ( child ) - { - // exactly one child - set it's size to fill the whole frame - int clientW, clientH; - DoGetClientSize(&clientW, &clientH); - - // for whatever reasons, wxGTK wants to have a small offset - it - // probably looks better with it? -#ifdef __WXGTK__ - static const int ofs = 1; -#else - static const int ofs = 0; -#endif - - child->SetSize(ofs, ofs, clientW - 2*ofs, clientH - 2*ofs); - } - } -} - -/*** Copied from top level..! ***/ -// The default implementation for the close window event. -void wxGenericMDIChildFrame::OnCloseWindow(wxCloseEvent& WXUNUSED(event)) -{ - Destroy(); -} - -void wxGenericMDIChildFrame::SetMDIParentFrame(wxGenericMDIParentFrame* parentFrame) -{ - m_pMDIParentFrame = parentFrame; -} - -wxGenericMDIParentFrame* wxGenericMDIChildFrame::GetMDIParentFrame() const -{ - return m_pMDIParentFrame; -} - -void wxGenericMDIChildFrame::Init() -{ - m_pMDIParentFrame = (wxGenericMDIParentFrame *) NULL; -#if wxUSE_MENUS - m_pMenuBar = (wxMenuBar *) NULL; -#endif // wxUSE_MENUS -} - -void wxGenericMDIChildFrame::DoMoveWindow(int x, int y, int width, int height) -{ - m_MDIRect = wxRect(x, y, width, height); -} - -void wxGenericMDIChildFrame::ApplyMDIChildFrameRect() -{ - wxPanel::DoMoveWindow(m_MDIRect.x, m_MDIRect.y, m_MDIRect.width, m_MDIRect.height); -} - -//----------------------------------------------------------------------------- -// wxGenericMDIClientWindow -//----------------------------------------------------------------------------- - -#define wxID_NOTEBOOK_CLIENT_AREA wxID_HIGHEST + 100 - -IMPLEMENT_DYNAMIC_CLASS(wxGenericMDIClientWindow, wxNotebook) - -BEGIN_EVENT_TABLE(wxGenericMDIClientWindow, wxNotebook) - EVT_NOTEBOOK_PAGE_CHANGED(wxID_NOTEBOOK_CLIENT_AREA, wxGenericMDIClientWindow::OnPageChanged) - EVT_SIZE(wxGenericMDIClientWindow::OnSize) -END_EVENT_TABLE() - - -wxGenericMDIClientWindow::wxGenericMDIClientWindow() -{ -} - -wxGenericMDIClientWindow::wxGenericMDIClientWindow( wxGenericMDIParentFrame *parent, long style ) -{ - CreateClient( parent, style ); -} - -wxGenericMDIClientWindow::~wxGenericMDIClientWindow() -{ - DestroyChildren(); -} - -bool wxGenericMDIClientWindow::CreateClient( wxGenericMDIParentFrame *parent, long style ) -{ - SetWindowStyleFlag(style); - - bool success = wxNotebook::Create(parent, wxID_NOTEBOOK_CLIENT_AREA, wxPoint(0,0), wxSize(100, 100), 0); - if (success) - { - /* - wxFont font(10, wxSWISS, wxNORMAL, wxNORMAL); - wxFont selFont(10, wxSWISS, wxNORMAL, wxBOLD); - GetTabView()->SetTabFont(font); - GetTabView()->SetSelectedTabFont(selFont); - GetTabView()->SetTabSize(120, 18); - GetTabView()->SetTabSelectionHeight(20); - */ - return true; - } - else - return false; -} - -int wxGenericMDIClientWindow::SetSelection(size_t nPage) -{ - int oldSelection = wxNotebook::SetSelection(nPage); - -#if !defined(__WXMSW__) // No need to do this for wxMSW as wxNotebook::SetSelection() - // will already cause this to be done! - // Handle the page change. - PageChanged(oldSelection, nPage); -#endif - - return oldSelection; -} - -void wxGenericMDIClientWindow::PageChanged(int OldSelection, int newSelection) -{ - // Don't do to much work, only when something realy should change! - if (OldSelection == newSelection) - return; - // Again check if we realy need to do this... - if (newSelection != -1) - { - wxGenericMDIChildFrame* child = (wxGenericMDIChildFrame *)GetPage(newSelection); - - if (child->GetMDIParentFrame()->GetActiveChild() == child) - return; - } - - // Notify old active child that it has been deactivated - if (OldSelection != -1) - { - wxGenericMDIChildFrame* oldChild = (wxGenericMDIChildFrame *)GetPage(OldSelection); - if (oldChild) - { - wxActivateEvent event(wxEVT_ACTIVATE, false, oldChild->GetId()); - event.SetEventObject( oldChild ); - oldChild->GetEventHandler()->ProcessEvent(event); - } - } - - // Notify new active child that it has been activated - if (newSelection != -1) - { - wxGenericMDIChildFrame* activeChild = (wxGenericMDIChildFrame *)GetPage(newSelection); - if (activeChild) - { - wxActivateEvent event(wxEVT_ACTIVATE, true, activeChild->GetId()); - event.SetEventObject( activeChild ); - activeChild->GetEventHandler()->ProcessEvent(event); - - if (activeChild->GetMDIParentFrame()) - { - activeChild->GetMDIParentFrame()->SetActiveChild(activeChild); - activeChild->GetMDIParentFrame()->SetChildMenuBar(activeChild); - } - } - } -} - -void wxGenericMDIClientWindow::OnPageChanged(wxNotebookEvent& event) -{ - PageChanged(event.GetOldSelection(), event.GetSelection()); - - event.Skip(); -} - -void wxGenericMDIClientWindow::OnSize(wxSizeEvent& event) -{ - wxNotebook::OnSize(event); - - size_t pos; - for (pos = 0; pos < GetPageCount(); pos++) - { - ((wxGenericMDIChildFrame *)GetPage(pos))->ApplyMDIChildFrameRect(); - } -} - - -/* - * Define normal wxMDI classes based on wxGenericMDI - */ - -#if wxUSE_GENERIC_MDI_AS_NATIVE - -wxMDIChildFrame * wxMDIParentFrame::GetActiveChild() const - { - wxGenericMDIChildFrame *pGFrame = wxGenericMDIParentFrame::GetActiveChild(); - wxMDIChildFrame *pFrame = wxDynamicCast(pGFrame, wxMDIChildFrame); - - wxASSERT_MSG(!(pFrame == NULL && pGFrame != NULL), wxT("Active frame is class not derived from wxMDIChildFrame!")); - - return pFrame; - } - -IMPLEMENT_DYNAMIC_CLASS(wxMDIParentFrame, wxGenericMDIParentFrame) -IMPLEMENT_DYNAMIC_CLASS(wxMDIChildFrame, wxGenericMDIChildFrame) -IMPLEMENT_DYNAMIC_CLASS(wxMDIClientWindow, wxGenericMDIClientWindow) - -#endif // wxUSE_GENERIC_MDI_AS_NATIVE - -#endif // wxUSE_MDI - diff --git a/wxWidgets/src/generic/msgdlgg.cpp b/wxWidgets/src/generic/msgdlgg.cpp deleted file mode 100644 index 74407e14bd..0000000000 --- a/wxWidgets/src/generic/msgdlgg.cpp +++ /dev/null @@ -1,159 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/generic/msgdlgg.cpp -// Purpose: wxGenericMessageDialog -// Author: Julian Smart, Robert Roebling -// Modified by: -// Created: 04/01/98 -// RCS-ID: $Id: msgdlgg.cpp 41838 2006-10-09 21:08:45Z VZ $ -// Copyright: (c) Julian Smart and Robert Roebling -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ -#pragma hdrstop -#endif - -#if wxUSE_MSGDLG && (!defined(__WXGTK20__) || defined(__WXUNIVERSAL__) || defined(__WXGPE__)) - -#ifndef WX_PRECOMP - #include "wx/utils.h" - #include "wx/dialog.h" - #include "wx/button.h" - #include "wx/stattext.h" - #include "wx/statbmp.h" - #include "wx/layout.h" - #include "wx/intl.h" - #include "wx/icon.h" - #include "wx/sizer.h" - #include "wx/app.h" - #include "wx/settings.h" -#endif - -#include -#include - -#define __WX_COMPILING_MSGDLGG_CPP__ 1 -#include "wx/msgdlg.h" -#include "wx/artprov.h" - -#if wxUSE_STATLINE - #include "wx/statline.h" -#endif - -// ---------------------------------------------------------------------------- -// icons -// ---------------------------------------------------------------------------- - -BEGIN_EVENT_TABLE(wxGenericMessageDialog, wxDialog) - EVT_BUTTON(wxID_YES, wxGenericMessageDialog::OnYes) - EVT_BUTTON(wxID_NO, wxGenericMessageDialog::OnNo) - EVT_BUTTON(wxID_CANCEL, wxGenericMessageDialog::OnCancel) -END_EVENT_TABLE() - -IMPLEMENT_CLASS(wxGenericMessageDialog, wxDialog) - -wxGenericMessageDialog::wxGenericMessageDialog( wxWindow *parent, - const wxString& message, - const wxString& caption, - long style, - const wxPoint& pos) - : wxDialog( parent, wxID_ANY, caption, pos, wxDefaultSize, wxDEFAULT_DIALOG_STYLE ) -{ - SetMessageDialogStyle(style); - - bool is_pda = (wxSystemSettings::GetScreenType() <= wxSYS_SCREEN_PDA); - - wxBoxSizer *topsizer = new wxBoxSizer( wxVERTICAL ); - - wxBoxSizer *icon_text = new wxBoxSizer( wxHORIZONTAL ); - -#if wxUSE_STATBMP - // 1) icon - if (style & wxICON_MASK) - { - wxBitmap bitmap; - switch ( style & wxICON_MASK ) - { - default: - wxFAIL_MSG(_T("incorrect log style")); - // fall through - - case wxICON_ERROR: - bitmap = wxArtProvider::GetIcon(wxART_ERROR, wxART_MESSAGE_BOX); - break; - - case wxICON_INFORMATION: - bitmap = wxArtProvider::GetIcon(wxART_INFORMATION, wxART_MESSAGE_BOX); - break; - - case wxICON_WARNING: - bitmap = wxArtProvider::GetIcon(wxART_WARNING, wxART_MESSAGE_BOX); - break; - - case wxICON_QUESTION: - bitmap = wxArtProvider::GetIcon(wxART_QUESTION, wxART_MESSAGE_BOX); - break; - } - wxStaticBitmap *icon = new wxStaticBitmap(this, wxID_ANY, bitmap); - if (is_pda) - topsizer->Add( icon, 0, wxTOP|wxLEFT|wxRIGHT | wxALIGN_LEFT, 10 ); - else - icon_text->Add( icon, 0, wxCENTER ); - } -#endif // wxUSE_STATBMP - -#if wxUSE_STATTEXT - // 2) text - icon_text->Add( CreateTextSizer( message ), 0, wxALIGN_CENTER | wxLEFT, 10 ); - - topsizer->Add( icon_text, 1, wxCENTER | wxLEFT|wxRIGHT|wxTOP, 10 ); -#endif // wxUSE_STATTEXT - - // 3) buttons - int center_flag = wxEXPAND; - if (style & wxYES_NO) - center_flag = wxALIGN_CENTRE; - wxSizer *sizerBtn = CreateSeparatedButtonSizer(style & ButtonSizerFlags); - if ( sizerBtn ) - topsizer->Add(sizerBtn, 0, center_flag | wxALL, 10 ); - - SetAutoLayout( true ); - SetSizer( topsizer ); - - topsizer->SetSizeHints( this ); - topsizer->Fit( this ); - wxSize size( GetSize() ); - if (size.x < size.y*3/2) - { - size.x = size.y*3/2; - SetSize( size ); - } - - Centre( wxBOTH | wxCENTER_FRAME); -} - -void wxGenericMessageDialog::OnYes(wxCommandEvent& WXUNUSED(event)) -{ - EndModal( wxID_YES ); -} - -void wxGenericMessageDialog::OnNo(wxCommandEvent& WXUNUSED(event)) -{ - EndModal( wxID_NO ); -} - -void wxGenericMessageDialog::OnCancel(wxCommandEvent& WXUNUSED(event)) -{ - // Allow cancellation via ESC/Close button except if - // only YES and NO are specified. - const long style = GetMessageDialogStyle(); - if ( (style & wxYES_NO) != wxYES_NO || (style & wxCANCEL) ) - { - EndModal( wxID_CANCEL ); - } -} - -#endif // wxUSE_MSGDLG && !defined(__WXGTK20__) diff --git a/wxWidgets/src/generic/notebook.cpp b/wxWidgets/src/generic/notebook.cpp deleted file mode 100644 index 3abb733d88..0000000000 --- a/wxWidgets/src/generic/notebook.cpp +++ /dev/null @@ -1,762 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: src/generic/notebook.cpp -// Purpose: generic implementation of wxNotebook -// Author: Julian Smart -// Modified by: -// Created: 17/09/98 -// RCS-ID: $Id: notebook.cpp 50855 2007-12-20 10:51:33Z JS $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_NOTEBOOK - -#include "wx/notebook.h" - -#ifndef WX_PRECOMP - #include "wx/string.h" - #include "wx/log.h" - #include "wx/dcclient.h" - #include "wx/settings.h" -#endif - -#include "wx/imaglist.h" -#include "wx/generic/tabg.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, wxBookCtrlBase) - EVT_NOTEBOOK_PAGE_CHANGED(wxID_ANY, wxNotebook::OnSelChange) - EVT_SIZE(wxNotebook::OnSize) - EVT_PAINT(wxNotebook::OnPaint) - EVT_MOUSE_EVENTS(wxNotebook::OnMouseEvent) - EVT_SET_FOCUS(wxNotebook::OnSetFocus) - EVT_NAVIGATION_KEY(wxNotebook::OnNavigationKey) -END_EVENT_TABLE() - -IMPLEMENT_DYNAMIC_CLASS(wxNotebook, wxBookCtrlBase) -IMPLEMENT_DYNAMIC_CLASS(wxNotebookEvent, wxCommandEvent) - -// ============================================================================ -// implementation -// ============================================================================ - -// ============================================================================ -// Private class -// ============================================================================ - -WX_DECLARE_HASH_MAP(int, wxNotebookPage*, wxIntegerHash, wxIntegerEqual, - wxIntToNotebookPageHashMap); - -WX_DECLARE_HASH_MAP(wxNotebookPage*, int, wxPointerHash, wxPointerEqual, - wxNotebookPageToIntHashMap); - -// This reuses wxTabView to draw the tabs. -class WXDLLEXPORT wxNotebookTabView: public wxTabView -{ -DECLARE_DYNAMIC_CLASS(wxNotebookTabView) -public: - wxNotebookTabView(wxNotebook* notebook, long style = wxTAB_STYLE_DRAW_BOX | wxTAB_STYLE_COLOUR_INTERIOR); - virtual ~wxNotebookTabView(void); - - // Called when a tab is activated - virtual void OnTabActivate(int activateId, int deactivateId); - // Allows vetoing - virtual bool OnTabPreActivate(int activateId, int deactivateId); - - // map integer ids used by wxTabView to wxNotebookPage pointers - int GetId(wxNotebookPage *page); - wxNotebookPage *GetPage(int id) { return m_idToPage[id]; } - -protected: - wxNotebook* m_notebook; - -private: - wxIntToNotebookPageHashMap m_idToPage; - wxNotebookPageToIntHashMap m_pageToId; - int m_nextid; -}; - -static int GetPageId(wxTabView *tabview, wxNotebookPage *page) -{ - return wx_static_cast(wxNotebookTabView*, tabview)->GetId(page); -} - -// ---------------------------------------------------------------------------- -// wxNotebook construction -// ---------------------------------------------------------------------------- - -// common part of all ctors -void wxNotebook::Init() -{ - m_tabView = (wxNotebookTabView*) NULL; - 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) -{ - // base init - SetName(name); - - if ( (style & wxBK_ALIGN_MASK) == wxBK_DEFAULT ) - style |= wxBK_TOP; - - m_windowId = id == wxID_ANY ? NewControlId() : id; - - if (!wxControl::Create(parent, id, pos, size, style|wxNO_BORDER, wxDefaultValidator, name)) - return false; - - SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE)); - - SetTabView(new wxNotebookTabView(this)); - - return true; -} - -// dtor -wxNotebook::~wxNotebook() -{ - delete m_tabView; -} - -// ---------------------------------------------------------------------------- -// wxNotebook accessors -// ---------------------------------------------------------------------------- -int wxNotebook::GetRowCount() const -{ - // TODO - return 0; -} - -int wxNotebook::SetSelection(size_t nPage) -{ - wxASSERT( IS_VALID_PAGE(nPage) ); - - wxNotebookPage* pPage = GetPage(nPage); - - m_tabView->SetTabSelection(GetPageId(m_tabView, pPage)); - - // TODO - return 0; -} - -int wxNotebook::ChangeSelection(size_t nPage) -{ - // FIXME: currently it does generate events too - return SetSelection(nPage); -} - -#if 0 -void wxNotebook::AdvanceSelection(bool bForward) -{ - int nSel = GetSelection(); - int nMax = GetPageCount() - 1; - if ( bForward ) - SetSelection(nSel == nMax ? 0 : nSel + 1); - else - SetSelection(nSel == 0 ? nMax : nSel - 1); -} -#endif - -bool wxNotebook::SetPageText(size_t nPage, const wxString& strText) -{ - wxASSERT( IS_VALID_PAGE(nPage) ); - - wxNotebookPage* page = GetPage(nPage); - if (page) - { - m_tabView->SetTabText(GetPageId(m_tabView, page), strText); - Refresh(); - return true; - } - - return false; -} - -wxString wxNotebook::GetPageText(size_t nPage) const -{ - wxASSERT( IS_VALID_PAGE(nPage) ); - - wxNotebookPage* page = ((wxNotebook*)this)->GetPage(nPage); - if (page) - return m_tabView->GetTabText(GetPageId(m_tabView, page)); - else - return wxEmptyString; -} - -int wxNotebook::GetPageImage(size_t WXUNUSED_UNLESS_DEBUG(nPage)) const -{ - wxASSERT( IS_VALID_PAGE(nPage) ); - - // TODO - return 0; -} - -bool wxNotebook::SetPageImage(size_t WXUNUSED_UNLESS_DEBUG(nPage), - int WXUNUSED(nImage)) -{ - wxASSERT( IS_VALID_PAGE(nPage) ); - - // TODO - return false; -} - -// set the size (the same for all pages) -void wxNotebook::SetPageSize(const wxSize& WXUNUSED(size)) -{ - // TODO -} - -// set the padding between tabs (in pixels) -void wxNotebook::SetPadding(const wxSize& WXUNUSED(padding)) -{ - // TODO -} - -// set the size of the tabs for wxNB_FIXEDWIDTH controls -void wxNotebook::SetTabSize(const wxSize& WXUNUSED(sz)) -{ - // TODO -} - -// ---------------------------------------------------------------------------- -// wxNotebook operations -// ---------------------------------------------------------------------------- - -// remove one page from the notebook and delete it -bool wxNotebook::DeletePage(size_t nPage) -{ - wxCHECK( IS_VALID_PAGE(nPage), false ); - - if (m_nSelection != -1) - { - m_pages[m_nSelection]->Show(false); - m_pages[m_nSelection]->Lower(); - } - - wxNotebookPage* pPage = GetPage(nPage); - - m_tabView->RemoveTab(GetPageId(m_tabView, pPage)); - - m_pages.Remove(pPage); - delete pPage; - - if (m_pages.GetCount() == 0) - { - m_nSelection = -1; - m_tabView->SetTabSelection(-1, false); - } - else if (m_nSelection > -1) - { - m_nSelection = -1; - - m_tabView->SetTabSelection(GetPageId(m_tabView, GetPage(0)), false); - - if (m_nSelection != 0) - ChangePage(-1, 0); - } - - RefreshLayout(false); - - return true; -} - -bool wxNotebook::DeletePage(wxNotebookPage* page) -{ - int pagePos = FindPagePosition(page); - if (pagePos > -1) - return DeletePage(pagePos); - else - return false; -} - -bool wxNotebook::RemovePage(size_t nPage) -{ - return DoRemovePage(nPage) != NULL; -} - -// remove one page from the notebook -wxWindow* wxNotebook::DoRemovePage(size_t nPage) -{ - wxCHECK( IS_VALID_PAGE(nPage), NULL ); - - m_pages[nPage]->Show(false); - // m_pages[nPage]->Lower(); - - wxNotebookPage* pPage = GetPage(nPage); - - m_tabView->RemoveTab(GetPageId(m_tabView, pPage)); - - m_pages.Remove(pPage); - - if (m_pages.GetCount() == 0) - { - m_nSelection = -1; - m_tabView->SetTabSelection(-1, true); - } - else if (m_nSelection > -1) - { - // Only change the selection if the page we - // deleted was the selection. - if (nPage == (size_t)m_nSelection) - { - m_nSelection = -1; - // Select the first tab. Generates a ChangePage. - m_tabView->SetTabSelection(0, true); - } - else - { - // We must adjust which tab we think is selected. - // If greater than the page we deleted, it must be moved down - // a notch. - if (size_t(m_nSelection) > nPage) - m_nSelection -- ; - } - } - - RefreshLayout(false); - - return pPage; -} - -bool wxNotebook::RemovePage(wxNotebookPage* page) -{ - int pagePos = FindPagePosition(page); - if (pagePos > -1) - return RemovePage(pagePos); - else - return false; -} - -// Find the position of the wxNotebookPage, -1 if not found. -int wxNotebook::FindPagePosition(wxNotebookPage* page) const -{ - size_t nPageCount = GetPageCount(); - size_t nPage; - for ( nPage = 0; nPage < nPageCount; nPage++ ) - if (m_pages[nPage] == page) - return nPage; - return -1; -} - -// remove all pages -bool wxNotebook::DeleteAllPages() -{ - m_tabView->ClearTabs(true); - - size_t nPageCount = GetPageCount(); - size_t nPage; - for ( nPage = 0; nPage < nPageCount; nPage++ ) - delete m_pages[nPage]; - - m_pages.Clear(); - - 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 WXUNUSED(imageId)) -{ - wxASSERT( pPage != NULL ); - wxCHECK( IS_VALID_PAGE(nPage) || nPage == GetPageCount(), false ); - - m_tabView->AddTab(GetPageId(m_tabView, pPage), strText); - - if (!bSelect) - pPage->Show(false); - - // save the pointer to the page - m_pages.Insert(pPage, nPage); - - if (bSelect) - { - // This will cause ChangePage to be called, via OnSelPage - - m_tabView->SetTabSelection(GetPageId(m_tabView, pPage), true); - } - - // some page must be selected: either this one or the first one if there is - // still no selection - if ( m_nSelection == -1 ) - ChangePage(-1, 0); - - RefreshLayout(false); - - return true; -} - -// ---------------------------------------------------------------------------- -// 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) -{ - static bool s_bFirstTime = true; - if ( s_bFirstTime ) { - // TODO: any first-time-size processing. - s_bFirstTime = false; - } - - RefreshLayout(); - - // Processing continues to next OnSize - event.Skip(); -} - -// This was supposed to cure the non-display of the notebook -// until the user resizes the window. -// What's going on? -void wxNotebook::OnInternalIdle() -{ - wxWindow::OnInternalIdle(); - -#if 0 - static bool s_bFirstTime = true; - if ( s_bFirstTime ) { - /* - wxSize sz(GetSize()); - sz.x ++; - SetSize(sz); - sz.x --; - SetSize(sz); - */ - - /* - wxSize sz(GetSize()); - wxSizeEvent sizeEvent(sz, GetId()); - sizeEvent.SetEventObject(this); - GetEventHandler()->ProcessEvent(sizeEvent); - Refresh(); - */ - s_bFirstTime = false; - } -#endif -} - -// Implementation: calculate the layout of the view rect -// and resize the children if required -bool wxNotebook::RefreshLayout(bool force) -{ - if (m_tabView) - { - wxRect oldRect = m_tabView->GetViewRect(); - - int cw, ch; - GetClientSize(& cw, & ch); - - int tabHeight = m_tabView->GetTotalTabHeight(); - wxRect rect; - rect.x = 4; - rect.y = tabHeight + 4; - rect.width = cw - 8; - rect.height = ch - 4 - rect.y ; - - m_tabView->SetViewRect(rect); - - m_tabView->LayoutTabs(); - - // Need to do it a 2nd time to get the tab height with - // the new view width, since changing the view width changes the - // tab layout. - tabHeight = m_tabView->GetTotalTabHeight(); - rect.x = 4; - rect.y = tabHeight + 4; - rect.width = cw - 8; - rect.height = ch - 4 - rect.y ; - - m_tabView->SetViewRect(rect); - - m_tabView->LayoutTabs(); - - if (!force && (rect == oldRect)) - return false; - - // fit the notebook page to the tab control's display area - - size_t nCount = m_pages.Count(); - for ( size_t nPage = 0; nPage < nCount; nPage++ ) { - wxNotebookPage *pPage = m_pages[nPage]; - wxRect clientRect = GetAvailableClientSize(); - if (pPage->IsShown()) - { - pPage->SetSize(clientRect.x, clientRect.y, clientRect.width, clientRect.height); - if ( pPage->GetAutoLayout() ) - pPage->Layout(); - } - } - Refresh(); - } - return true; -} - -void wxNotebook::OnSelChange(wxNotebookEvent& event) -{ - // is it our tab control? - if ( event.GetEventObject() == this ) - { - if (event.GetSelection() != m_nSelection) - 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 { - // pass to the parent - if ( GetParent() ) { - event.SetCurrentFocus(this); - GetParent()->ProcessEvent(event); - } - } -} - -// ---------------------------------------------------------------------------- -// wxNotebook base class virtuals -// ---------------------------------------------------------------------------- - -// override these 2 functions to do nothing: everything is done in OnSize - -void wxNotebook::SetConstraintSizes(bool /* recurse */) -{ - // don't set the sizes of the pages - their correct size is not yet known - wxControl::SetConstraintSizes(false); -} - -bool wxNotebook::DoPhase(int /* nPhase */) -{ - return true; -} - -void wxNotebook::Command(wxCommandEvent& WXUNUSED(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) -{ - // cout << "ChangePage: " << nOldSel << ", " << nSel << "\n"; - wxASSERT( nOldSel != nSel ); // impossible - - if ( nOldSel != -1 ) { - m_pages[nOldSel]->Show(false); - m_pages[nOldSel]->Lower(); - } - - wxNotebookPage *pPage = m_pages[nSel]; - - wxRect clientRect = GetAvailableClientSize(); - pPage->SetSize(clientRect.x, clientRect.y, clientRect.width, clientRect.height); - - Refresh(); - - pPage->Show(true); - pPage->Raise(); - pPage->SetFocus(); - - m_nSelection = nSel; -} - -void wxNotebook::OnMouseEvent(wxMouseEvent& event) -{ - if (m_tabView) - m_tabView->OnEvent(event); -} - -void wxNotebook::OnPaint(wxPaintEvent& WXUNUSED(event) ) -{ - wxPaintDC dc(this); - if (m_tabView) - m_tabView->Draw(dc); -} - -wxSize wxNotebook::CalcSizeFromPage(const wxSize& sizePage) const -{ - // MBN: since the total tab height is really a function of the - // width, this should really call - // GetTotalTabHeightPretendingWidthIs(), but the current - // implementation will suffice, provided the wxNotebook has been - // created with a sensible initial width. - return wxSize( sizePage.x + 12, - sizePage.y + m_tabView->GetTotalTabHeight() + 6 + 4 ); -} - -wxRect wxNotebook::GetAvailableClientSize() -{ - int cw, ch; - GetClientSize(& cw, & ch); - - int tabHeight = m_tabView->GetTotalTabHeight(); - - // TODO: these margins should be configurable. - wxRect rect; - rect.x = 6; - rect.y = tabHeight + 6; - rect.width = cw - 12; - rect.height = ch - 4 - rect.y ; - - return rect; -} - -/* - * wxNotebookTabView - */ - -IMPLEMENT_CLASS(wxNotebookTabView, wxTabView) - -wxNotebookTabView::wxNotebookTabView(wxNotebook *notebook, long style) - : wxTabView(style), m_nextid(1) -{ - m_notebook = notebook; - - m_notebook->SetTabView(this); - - SetWindow(m_notebook); -} - -wxNotebookTabView::~wxNotebookTabView(void) -{ -} - -int wxNotebookTabView::GetId(wxNotebookPage *page) -{ - int& id = m_pageToId[page]; - - if (!id) - { - id = m_nextid++; - m_idToPage[id] = page; - } - - return id; -} - -// Called when a tab is activated -void wxNotebookTabView::OnTabActivate(int activateId, int deactivateId) -{ - if (!m_notebook) - return; - - wxNotebookEvent event(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED, m_notebook->GetId()); - - // Translate from wxTabView's ids (which aren't position-dependent) - // to wxNotebook's (which are). - wxNotebookPage* pActive = GetPage(activateId); - wxNotebookPage* pDeactive = GetPage(deactivateId); - - int activatePos = m_notebook->FindPagePosition(pActive); - int deactivatePos = m_notebook->FindPagePosition(pDeactive); - - event.SetEventObject(m_notebook); - event.SetSelection(activatePos); - event.SetOldSelection(deactivatePos); - m_notebook->GetEventHandler()->ProcessEvent(event); -} - -// Allows Vetoing -bool wxNotebookTabView::OnTabPreActivate(int activateId, int deactivateId) -{ - bool retval = true; - - if (m_notebook) - { - wxNotebookEvent event(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING, m_notebook->GetId()); - - // Translate from wxTabView's ids (which aren't position-dependent) - // to wxNotebook's (which are). - wxNotebookPage* pActive = GetPage(activateId); - wxNotebookPage* pDeactive = GetPage(deactivateId); - - int activatePos = m_notebook->FindPagePosition(pActive); - int deactivatePos = m_notebook->FindPagePosition(pDeactive); - - event.SetEventObject(m_notebook); - event.SetSelection(activatePos); - event.SetOldSelection(deactivatePos); - if (m_notebook->GetEventHandler()->ProcessEvent(event)) - { - retval = event.IsAllowed(); - } - } - return retval; -} - -#endif // wxUSE_NOTEBOOK diff --git a/wxWidgets/src/generic/numdlgg.cpp b/wxWidgets/src/generic/numdlgg.cpp deleted file mode 100644 index 1d16bf9c9c..0000000000 --- a/wxWidgets/src/generic/numdlgg.cpp +++ /dev/null @@ -1,181 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/generic/numdlgg.cpp -// Purpose: wxGetNumberFromUser implementation -// Author: Vadim Zeitlin -// Modified by: -// Created: 23.07.99 -// RCS-ID: $Id: numdlgg.cpp 54861 2008-07-30 21:53:26Z VZ $ -// Copyright: (c) Vadim Zeitlin -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_NUMBERDLG - -#ifndef WX_PRECOMP - #include - - #include "wx/utils.h" - #include "wx/dialog.h" - #include "wx/button.h" - #include "wx/stattext.h" - #include "wx/textctrl.h" - #include "wx/intl.h" - #include "wx/sizer.h" -#endif - -#if wxUSE_STATLINE - #include "wx/statline.h" -#endif - -#if wxUSE_SPINCTRL -#include "wx/spinctrl.h" -#endif - -// this is where wxGetNumberFromUser() is declared -#include "wx/numdlg.h" - -#if !wxUSE_SPINCTRL - // wxTextCtrl will do instead of wxSpinCtrl if we don't have it - #define wxSpinCtrl wxTextCtrl -#endif - -// ============================================================================ -// implementation -// ============================================================================ - -// ---------------------------------------------------------------------------- -// wxNumberEntryDialog -// ---------------------------------------------------------------------------- - -BEGIN_EVENT_TABLE(wxNumberEntryDialog, wxDialog) - EVT_BUTTON(wxID_OK, wxNumberEntryDialog::OnOK) - EVT_BUTTON(wxID_CANCEL, wxNumberEntryDialog::OnCancel) -END_EVENT_TABLE() - -IMPLEMENT_CLASS(wxNumberEntryDialog, wxDialog) - -wxNumberEntryDialog::wxNumberEntryDialog(wxWindow *parent, - const wxString& message, - const wxString& prompt, - const wxString& caption, - long value, - long min, - long max, - const wxPoint& pos) - : wxDialog(parent, wxID_ANY, caption, - pos, wxDefaultSize) -{ - m_value = value; - m_max = max; - m_min = min; - - wxBeginBusyCursor(); - - wxBoxSizer *topsizer = new wxBoxSizer( wxVERTICAL ); -#if wxUSE_STATTEXT - // 1) text message - topsizer->Add( CreateTextSizer( message ), 0, wxALL, 10 ); -#endif - - // 2) prompt and text ctrl - wxBoxSizer *inputsizer = new wxBoxSizer( wxHORIZONTAL ); - -#if wxUSE_STATTEXT - // prompt if any - if (!prompt.empty()) - inputsizer->Add( new wxStaticText( this, wxID_ANY, prompt ), 0, wxCENTER | wxLEFT, 10 ); -#endif - - // spin ctrl - wxString valStr; - valStr.Printf(wxT("%ld"), m_value); - m_spinctrl = new wxSpinCtrl(this, wxID_ANY, valStr, wxDefaultPosition, wxSize( 140, wxDefaultCoord ), wxSP_ARROW_KEYS, (int)m_min, (int)m_max, (int)m_value); - inputsizer->Add( m_spinctrl, 1, wxCENTER | wxLEFT | wxRIGHT, 10 ); - // add both - topsizer->Add( inputsizer, 0, wxEXPAND | wxLEFT|wxRIGHT, 5 ); - - // 3) buttons if any - wxSizer *buttonSizer = CreateSeparatedButtonSizer(wxOK | wxCANCEL); - if ( buttonSizer ) - { - topsizer->Add(buttonSizer, wxSizerFlags().Expand().DoubleBorder()); - } - - SetSizer( topsizer ); - SetAutoLayout( true ); - - topsizer->SetSizeHints( this ); - topsizer->Fit( this ); - - Centre( wxBOTH ); - - m_spinctrl->SetSelection(-1, -1); - m_spinctrl->SetFocus(); - - wxEndBusyCursor(); -} - -void wxNumberEntryDialog::OnOK(wxCommandEvent& WXUNUSED(event)) -{ -#if !wxUSE_SPINCTRL - wxString tmp = m_spinctrl->GetValue(); - if ( wxSscanf(tmp, _T("%ld"), &m_value) != 1 ) - EndModal(wxID_CANCEL); - else -#else - m_value = m_spinctrl->GetValue(); -#endif - if ( m_value < m_min || m_value > m_max ) - { - // not a number or out of range - m_value = -1; - EndModal(wxID_CANCEL); - } - - EndModal(wxID_OK); -} - -void wxNumberEntryDialog::OnCancel(wxCommandEvent& WXUNUSED(event)) -{ - EndModal(wxID_CANCEL); -} - -// ---------------------------------------------------------------------------- -// global functions -// ---------------------------------------------------------------------------- - -// wxGetTextFromUser is in utilscmn.cpp - -long wxGetNumberFromUser(const wxString& msg, - const wxString& prompt, - const wxString& title, - long value, - long min, - long max, - wxWindow *parent, - const wxPoint& pos) -{ - wxNumberEntryDialog dialog(parent, msg, prompt, title, - value, min, max, pos); - if (dialog.ShowModal() == wxID_OK) - return dialog.GetValue(); - - return -1; -} - -#endif // wxUSE_NUMBERDLG diff --git a/wxWidgets/src/generic/odcombo.cpp b/wxWidgets/src/generic/odcombo.cpp deleted file mode 100644 index 32facdeb17..0000000000 --- a/wxWidgets/src/generic/odcombo.cpp +++ /dev/null @@ -1,1126 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/generic/odcombo.cpp -// Purpose: wxOwnerDrawnComboBox, wxVListBoxComboPopup -// Author: Jaakko Salli -// Modified by: -// Created: Apr-30-2006 -// RCS-ID: $Id: odcombo.cpp 64259 2010-05-09 10:48:37Z JMS $ -// Copyright: (c) 2005 Jaakko Salli -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_ODCOMBOBOX - -#include "wx/odcombo.h" - -#ifndef WX_PRECOMP - #include "wx/log.h" - #include "wx/combobox.h" - #include "wx/dcclient.h" - #include "wx/settings.h" - #include "wx/dialog.h" -#endif - -#include "wx/combo.h" - -// ============================================================================ -// implementation -// ============================================================================ - -// time in milliseconds before partial completion buffer drops -#define wxODCB_PARTIAL_COMPLETION_TIME 1000 - -// ---------------------------------------------------------------------------- -// wxVListBoxComboPopup is a wxVListBox customized to act as a popup control -// -// ---------------------------------------------------------------------------- - - -BEGIN_EVENT_TABLE(wxVListBoxComboPopup, wxVListBox) - EVT_MOTION(wxVListBoxComboPopup::OnMouseMove) - EVT_KEY_DOWN(wxVListBoxComboPopup::OnKey) - EVT_LEFT_UP(wxVListBoxComboPopup::OnLeftClick) -END_EVENT_TABLE() - - -void wxVListBoxComboPopup::Init() -{ - m_widestWidth = 0; - m_widestItem = -1; - m_widthsDirty = false; - m_findWidest = false; - m_itemHeight = 0; - m_value = -1; - m_itemHover = -1; - m_clientDataItemsType = wxClientData_None; - m_partialCompletionString = wxEmptyString; -} - -bool wxVListBoxComboPopup::Create(wxWindow* parent) -{ - if ( !wxVListBox::Create(parent, - wxID_ANY, - wxDefaultPosition, - wxDefaultSize, - wxBORDER_SIMPLE | wxLB_INT_HEIGHT | wxWANTS_CHARS) ) - return false; - - m_useFont = m_combo->GetFont(); - - wxVListBox::SetItemCount(m_strings.GetCount()); - - // TODO: Move this to SetFont - m_itemHeight = GetCharHeight() + 0; - - return true; -} - -wxVListBoxComboPopup::~wxVListBoxComboPopup() -{ - Clear(); -} - -#ifdef __WXMSW__ - -void wxVListBoxComboPopup::SetFocus() -{ - // Suppress SetFocus() warning by simply not calling it. This combo popup - // has already been designed with the assumption that SetFocus() may not - // do anything useful, so it really doesn't need to be called. -} - -#endif // __WXMSW__ - -bool wxVListBoxComboPopup::LazyCreate() -{ - // NB: There is a bug with wxVListBox that can be avoided by creating - // it later (bug causes empty space to be shown if initial selection - // is at the end of a list longer than the control can show at once). - return true; -} - -// paint the control itself -void wxVListBoxComboPopup::PaintComboControl( wxDC& dc, const wxRect& rect ) -{ - if ( !(m_combo->GetWindowStyle() & wxODCB_STD_CONTROL_PAINT) ) - { - int flags = wxODCB_PAINTING_CONTROL; - - if ( m_combo->ShouldDrawFocus() ) - flags |= wxODCB_PAINTING_SELECTED; - - OnDrawBg(dc, rect, m_value, flags); - - if ( m_value >= 0 ) - { - OnDrawItem(dc,rect,m_value,flags); - return; - } - } - - wxComboPopup::PaintComboControl(dc,rect); -} - -void wxVListBoxComboPopup::OnDrawItem(wxDC& dc, const wxRect& rect, size_t n) const -{ - // TODO: Maybe this code could be moved to wxVListBox::OnPaint? - dc.SetFont(m_useFont); - - int flags = 0; - - // Set correct text colour for selected items - if ( wxVListBox::GetSelection() == (int) n ) - { - dc.SetTextForeground( wxSystemSettings::GetColour(wxSYS_COLOUR_HIGHLIGHTTEXT) ); - flags |= wxODCB_PAINTING_SELECTED; - } - else - { - dc.SetTextForeground( wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT) ); - } - - OnDrawItem(dc,rect,(int)n,flags); -} - -wxCoord wxVListBoxComboPopup::OnMeasureItem(size_t n) const -{ - wxOwnerDrawnComboBox* combo = (wxOwnerDrawnComboBox*) m_combo; - - wxASSERT_MSG( combo->IsKindOf(CLASSINFO(wxOwnerDrawnComboBox)), - wxT("you must subclass wxVListBoxComboPopup for drawing and measuring methods") ); - - wxCoord h = combo->OnMeasureItem(n); - if ( h < 0 ) - h = m_itemHeight; - return h; -} - -wxCoord wxVListBoxComboPopup::OnMeasureItemWidth(size_t n) const -{ - wxOwnerDrawnComboBox* combo = (wxOwnerDrawnComboBox*) m_combo; - - wxASSERT_MSG( combo->IsKindOf(CLASSINFO(wxOwnerDrawnComboBox)), - wxT("you must subclass wxVListBoxComboPopup for drawing and measuring methods") ); - - return combo->OnMeasureItemWidth(n); -} - -void wxVListBoxComboPopup::OnDrawBg( wxDC& dc, - const wxRect& rect, - int item, - int flags ) const -{ - wxOwnerDrawnComboBox* combo = (wxOwnerDrawnComboBox*) m_combo; - - wxASSERT_MSG( combo->IsKindOf(CLASSINFO(wxOwnerDrawnComboBox)), - wxT("you must subclass wxVListBoxComboPopup for drawing and measuring methods") ); - - if ( IsCurrent((size_t)item) && !(flags & wxODCB_PAINTING_CONTROL) ) - flags |= wxODCB_PAINTING_SELECTED; - - combo->OnDrawBackground(dc,rect,item,flags); -} - -void wxVListBoxComboPopup::OnDrawBackground(wxDC& dc, const wxRect& rect, size_t n) const -{ - OnDrawBg(dc,rect,(int)n,0); -} - -// This is called from wxVListBoxComboPopup::OnDrawItem, with text colour and font prepared -void wxVListBoxComboPopup::OnDrawItem( wxDC& dc, const wxRect& rect, int item, int flags ) const -{ - wxOwnerDrawnComboBox* combo = (wxOwnerDrawnComboBox*) m_combo; - - wxASSERT_MSG( combo->IsKindOf(CLASSINFO(wxOwnerDrawnComboBox)), - wxT("you must subclass wxVListBoxComboPopup for drawing and measuring methods") ); - - combo->OnDrawItem(dc,rect,item,flags); -} - -void wxVListBoxComboPopup::DismissWithEvent() -{ - StopPartialCompletion(); - - int selection = wxVListBox::GetSelection(); - - Dismiss(); - - wxString valStr; - if ( selection != wxNOT_FOUND ) - valStr = m_strings[selection]; - else - valStr = wxEmptyString; - - m_value = selection; - - if ( valStr != m_combo->GetValue() ) - m_combo->SetValueWithEvent(valStr); - - SendComboBoxEvent(selection); -} - -void wxVListBoxComboPopup::SendComboBoxEvent( int selection ) -{ - wxCommandEvent evt(wxEVT_COMMAND_COMBOBOX_SELECTED,m_combo->GetId()); - - evt.SetEventObject(m_combo); - - evt.SetInt(selection); - - // Set client data, if any - if ( selection >= 0 && (int)m_clientDatas.GetCount() > selection ) - { - void* clientData = m_clientDatas[selection]; - if ( m_clientDataItemsType == wxClientData_Object ) - evt.SetClientObject((wxClientData*)clientData); - else - evt.SetClientData(clientData); - } - - m_combo->GetEventHandler()->AddPendingEvent(evt); -} - -// returns true if key was consumed -bool wxVListBoxComboPopup::HandleKey( int keycode, bool saturate, wxChar unicode ) -{ - const int itemCount = GetCount(); - - // keys do nothing in the empty control and returning immediately avoids - // using invalid indices below - if ( !itemCount ) - return false; - - int value = m_value; - int comboStyle = m_combo->GetWindowStyle(); - - // this is the character equivalent of the code - wxChar keychar = 0; - if ( keycode < WXK_START ) - { -#if wxUSE_UNICODE - if ( unicode > 0 ) - { - if ( wxIsprint(unicode) ) - keychar = unicode; - } - else -#else - wxUnusedVar(unicode); -#endif - if ( wxIsprint(keycode) ) - { - keychar = (wxChar) keycode; - } - } - - if ( keycode == WXK_DOWN || keycode == WXK_RIGHT ) - { - value++; - StopPartialCompletion(); - } - else if ( keycode == WXK_UP || keycode == WXK_LEFT ) - { - value--; - StopPartialCompletion(); - } - else if ( keycode == WXK_PAGEDOWN ) - { - value+=10; - StopPartialCompletion(); - } - else if ( keycode == WXK_PAGEUP ) - { - value-=10; - StopPartialCompletion(); - } - else if ( keychar && (comboStyle & wxCB_READONLY) ) - { - // Try partial completion - - // find the new partial completion string -#if wxUSE_TIMER - if (m_partialCompletionTimer.IsRunning()) - m_partialCompletionString+=wxString(keychar); - else -#endif // wxUSE_TIMER - m_partialCompletionString=wxString(keychar); - - // now search through the values to see if this is found - int found = -1; - unsigned int length=m_partialCompletionString.length(); - int i; - for (i=0; i= length) && (! m_partialCompletionString.CmpNoCase(item.Left(length)))) - { - found=i; - break; - } - } - - if (found<0) - { - StopPartialCompletion(); - ::wxBell(); - return true; // to stop the first value being set - } - else - { - value=i; -#if wxUSE_TIMER - m_partialCompletionTimer.Start(wxODCB_PARTIAL_COMPLETION_TIME, true); -#endif // wxUSE_TIMER - } - } - else - return false; - - if ( saturate ) - { - if ( value >= itemCount ) - value = itemCount - 1; - else if ( value < 0 ) - value = 0; - } - else - { - if ( value >= itemCount ) - value -= itemCount; - else if ( value < 0 ) - value += itemCount; - } - - if ( value == m_value ) - // Even if value was same, don't skip the event - // (good for consistency) - return true; - - m_value = value; - - if ( value >= 0 ) - m_combo->SetValue(m_strings[value]); - - SendComboBoxEvent(m_value); - - return true; -} - -// stop partial completion -void wxVListBoxComboPopup::StopPartialCompletion() -{ - m_partialCompletionString = wxEmptyString; -#if wxUSE_TIMER - m_partialCompletionTimer.Stop(); -#endif // wxUSE_TIMER -} - -void wxVListBoxComboPopup::OnComboDoubleClick() -{ - // Cycle on dclick (disable saturation to allow true cycling). - if ( !::wxGetKeyState(WXK_SHIFT) ) - HandleKey(WXK_DOWN,false); - else - HandleKey(WXK_UP,false); -} - -void wxVListBoxComboPopup::OnComboKeyEvent( wxKeyEvent& event ) -{ - // Saturated key movement on - if ( !HandleKey(event.GetKeyCode(),true, -#if wxUSE_UNICODE - event.GetUnicodeKey() -#else - 0 -#endif - ) ) - event.Skip(); -} - -void wxVListBoxComboPopup::OnPopup() -{ - // *must* set value after size is set (this is because of a vlbox bug) - wxVListBox::SetSelection(m_value); -} - -void wxVListBoxComboPopup::OnMouseMove(wxMouseEvent& event) -{ - event.Skip(); - - // Move selection to cursor if it is inside the popup - - int y = event.GetPosition().y; - int fromBottom = GetClientSize().y - y; - - // Since in any case we need to find out if the last item is only - // partially visible, we might just as well replicate the HitTest - // loop here. - const size_t lineMax = GetVisibleEnd(); - for ( size_t line = GetVisibleBegin(); line < lineMax; line++ ) - { - y -= OnGetLineHeight(line); - if ( y < 0 ) - { - // Only change selection if item is fully visible - if ( (y + fromBottom) >= 0 ) - { - wxVListBox::SetSelection((int)line); - return; - } - } - } -} - -void wxVListBoxComboPopup::OnLeftClick(wxMouseEvent& WXUNUSED(event)) -{ - DismissWithEvent(); -} - -void wxVListBoxComboPopup::OnKey(wxKeyEvent& event) -{ - // Hide popup if certain key or key combination was pressed - if ( m_combo->IsKeyPopupToggle(event) ) - { - StopPartialCompletion(); - Dismiss(); - } - else if ( event.AltDown() ) - { - // On both wxGTK and wxMSW, pressing Alt down seems to - // completely freeze things in popup (ie. arrow keys and - // enter won't work). - return; - } - // Select item if ENTER is pressed - else if ( event.GetKeyCode() == WXK_RETURN || event.GetKeyCode() == WXK_NUMPAD_ENTER ) - { - DismissWithEvent(); - } - else - { - int comboStyle = m_combo->GetWindowStyle(); - int keycode = event.GetKeyCode(); - // Process partial completion key codes here, but not the arrow keys as the base class will do that for us - if ((comboStyle & wxCB_READONLY) && - (keycode >= WXK_SPACE) && (keycode <=255) && (keycode != WXK_DELETE) && wxIsprint(keycode)) - { - OnComboKeyEvent(event); - SetSelection(m_value); // ensure the highlight bar moves - } - else - event.Skip(); - } -} - -void wxVListBoxComboPopup::Insert( const wxString& item, int pos ) -{ - // Need to change selection? - wxString strValue; - if ( !(m_combo->GetWindowStyle() & wxCB_READONLY) && - m_combo->GetValue() == item ) - { - m_value = pos; - } - - m_strings.Insert(item,pos); - m_widths.Insert(-1,pos); - m_widthsDirty = true; - - if ( IsCreated() ) - wxVListBox::SetItemCount( wxVListBox::GetItemCount()+1 ); -} - -int wxVListBoxComboPopup::Append(const wxString& item) -{ - int pos = (int)m_strings.GetCount(); - - if ( m_combo->GetWindowStyle() & wxCB_SORT ) - { - // Find position - // TODO: Could be optimized with binary search - wxArrayString strings = m_strings; - unsigned int i; - - for ( i=0; i n ) - return m_clientDatas[n]; - - return NULL; -} - -void wxVListBoxComboPopup::Delete( unsigned int item ) -{ - // Remove client data, if set - if ( m_clientDatas.GetCount() ) - { - if ( m_clientDataItemsType == wxClientData_Object ) - delete (wxClientData*) m_clientDatas[item]; - - m_clientDatas.RemoveAt(item); - } - - m_strings.RemoveAt(item); - m_widths.RemoveAt(item); - - if ( (int)item == m_widestItem ) - m_findWidest = true; - - int sel = GetSelection(); - - if ( IsCreated() ) - wxVListBox::SetItemCount( wxVListBox::GetItemCount()-1 ); - - // Fix selection - if ( (int)item < sel ) - SetSelection(sel-1); - else if ( (int)item == sel ) - SetSelection(wxNOT_FOUND); -} - -int wxVListBoxComboPopup::FindString(const wxString& s, bool bCase) const -{ - return m_strings.Index(s, bCase); -} - -unsigned int wxVListBoxComboPopup::GetCount() const -{ - return m_strings.GetCount(); -} - -wxString wxVListBoxComboPopup::GetString( int item ) const -{ - return m_strings[item]; -} - -void wxVListBoxComboPopup::SetString( int item, const wxString& str ) -{ - m_strings[item] = str; - ItemWidthChanged(item); -} - -wxString wxVListBoxComboPopup::GetStringValue() const -{ - if ( m_value >= 0 ) - return m_strings[m_value]; - return wxEmptyString; -} - -void wxVListBoxComboPopup::SetSelection( int item ) -{ - wxCHECK_RET( item == wxNOT_FOUND || ((unsigned int)item < GetCount()), - wxT("invalid index in wxVListBoxComboPopup::SetSelection") ); - - m_value = item; - - if ( IsCreated() ) - wxVListBox::SetSelection(item); -} - -int wxVListBoxComboPopup::GetSelection() const -{ - return m_value; -} - -void wxVListBoxComboPopup::SetStringValue( const wxString& value ) -{ - int index = m_strings.Index(value); - - if ( index >= 0 && index < (int)wxVListBox::GetItemCount() ) - { - m_value = index; - wxVListBox::SetSelection(index); - } -} - -void wxVListBoxComboPopup::CalcWidths() -{ - bool doFindWidest = m_findWidest; - - // Measure items with dirty width. - if ( m_widthsDirty ) - { - unsigned int i; - unsigned int n = m_widths.GetCount(); - int dirtyHandled = 0; - wxArrayInt& widths = m_widths; - - // I think using wxDC::GetTextExtent is faster than - // wxWindow::GetTextExtent (assuming same dc is used - // for all calls, as we do here). - wxClientDC dc(m_combo); - dc.SetFont(m_useFont); - - for ( i=0; i= m_widestWidth ) - { - m_widestWidth = x; - m_widestItem = (int)i; - } - else if ( (int)i == m_widestItem ) - { - // Width of previously widest item has been decreased, so - // we'll have to check all to find current widest item. - doFindWidest = true; - } - - dirtyHandled++; - } - } - - m_widthsDirty = false; - } - - if ( doFindWidest ) - { - unsigned int i; - unsigned int n = m_widths.GetCount(); - - int bestWidth = -1; - int bestIndex = -1; - - for ( i=0; i bestWidth ) - { - bestIndex = (int)i; - bestWidth = w; - } - } - - m_widestWidth = bestWidth; - m_widestItem = bestIndex; - - m_findWidest = false; - } -} - -wxSize wxVListBoxComboPopup::GetAdjustedSize( int minWidth, int prefHeight, int maxHeight ) -{ - int height = 250; - - maxHeight -= 2; // Must take borders into account - - if ( m_strings.GetCount() ) - { - if ( prefHeight > 0 ) - height = prefHeight; - - if ( height > maxHeight ) - height = maxHeight; - - int totalHeight = GetTotalHeight(); // + 3; - -#if defined(__WXMAC__) - // Take borders into account, or there will be scrollbars even for one or two items. - totalHeight += 2; -#endif - if ( height >= totalHeight ) - { - height = totalHeight; - } - else - { - // Adjust height to a multiple of the height of the first item - // NB: Calculations that take variable height into account - // are unnecessary. - int fih = GetLineHeight(0); - height -= height % fih; - } - } - else - height = 50; - - CalcWidths(); - - // Take scrollbar into account in width calculations - int widestWidth = m_widestWidth + wxSystemSettings::GetMetric(wxSYS_VSCROLL_X); - return wxSize(minWidth > widestWidth ? minWidth : widestWidth, - height+2); -} - -//void wxVListBoxComboPopup::Populate( int n, const wxString choices[] ) -void wxVListBoxComboPopup::Populate( const wxArrayString& choices ) -{ - int i; - - int n = choices.GetCount(); - - for ( i=0; iGetWindowStyle() & wxCB_SORT ) - m_strings.Sort(); - - // Find initial selection - wxString strValue = m_combo->GetValue(); - if ( strValue.length() ) - m_value = m_strings.Index(strValue); -} - -// ---------------------------------------------------------------------------- -// wxOwnerDrawnComboBox -// ---------------------------------------------------------------------------- - - -BEGIN_EVENT_TABLE(wxOwnerDrawnComboBox, wxComboCtrl) -END_EVENT_TABLE() - - -IMPLEMENT_DYNAMIC_CLASS2(wxOwnerDrawnComboBox, wxComboCtrl, wxControlWithItems) - -void wxOwnerDrawnComboBox::Init() -{ -} - -bool wxOwnerDrawnComboBox::Create(wxWindow *parent, - wxWindowID id, - const wxString& value, - const wxPoint& pos, - const wxSize& size, - long style, - const wxValidator& validator, - const wxString& name) -{ - return wxComboCtrl::Create(parent,id,value,pos,size,style,validator,name); -} - -wxOwnerDrawnComboBox::wxOwnerDrawnComboBox(wxWindow *parent, - wxWindowID id, - const wxString& value, - const wxPoint& pos, - const wxSize& size, - const wxArrayString& choices, - long style, - const wxValidator& validator, - const wxString& name) - : wxComboCtrl() -{ - Init(); - - Create(parent,id,value,pos,size,choices,style, validator, name); -} - -bool wxOwnerDrawnComboBox::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) -{ - m_initChs = choices; - //wxCArrayString chs(choices); - - //return Create(parent, id, value, pos, size, chs.GetCount(), - // chs.GetStrings(), style, validator, name); - return Create(parent, id, value, pos, size, 0, - NULL, style, validator, name); -} - -bool wxOwnerDrawnComboBox::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 ( !Create(parent, id, value, pos, size, style, - validator, name) ) - { - return false; - } - - int i; - for ( i=0; iClearClientDatas(); -} - -void wxOwnerDrawnComboBox::DoSetPopupControl(wxComboPopup* popup) -{ - if ( !popup ) - { - popup = new wxVListBoxComboPopup(); - } - - wxComboCtrl::DoSetPopupControl(popup); - - wxASSERT(popup); - - // Add initial choices to the wxVListBox - if ( !GetVListBoxComboPopup()->GetCount() ) - { - GetVListBoxComboPopup()->Populate(m_initChs); - m_initChs.Clear(); - } -} - -// ---------------------------------------------------------------------------- -// wxOwnerDrawnComboBox item manipulation methods -// ---------------------------------------------------------------------------- - -void wxOwnerDrawnComboBox::Clear() -{ - EnsurePopupControl(); - - GetVListBoxComboPopup()->Clear(); - - SetValue(wxEmptyString); -} - -void wxOwnerDrawnComboBox::Delete(unsigned int n) -{ - wxCHECK_RET( IsValid(n), _T("invalid index in wxOwnerDrawnComboBox::Delete") ); - - if ( GetSelection() == (int) n ) - SetValue(wxEmptyString); - - GetVListBoxComboPopup()->Delete(n); -} - -unsigned int wxOwnerDrawnComboBox::GetCount() const -{ - if ( !m_popupInterface ) - return m_initChs.GetCount(); - - return GetVListBoxComboPopup()->GetCount(); -} - -wxString wxOwnerDrawnComboBox::GetString(unsigned int n) const -{ - wxCHECK_MSG( IsValid(n), wxEmptyString, _T("invalid index in wxOwnerDrawnComboBox::GetString") ); - - if ( !m_popupInterface ) - return m_initChs.Item(n); - - return GetVListBoxComboPopup()->GetString(n); -} - -void wxOwnerDrawnComboBox::SetString(unsigned int n, const wxString& s) -{ - EnsurePopupControl(); - - wxCHECK_RET( IsValid(n), _T("invalid index in wxOwnerDrawnComboBox::SetString") ); - - GetVListBoxComboPopup()->SetString(n,s); -} - -int wxOwnerDrawnComboBox::FindString(const wxString& s, bool bCase) const -{ - if ( !m_popupInterface ) - return m_initChs.Index(s, bCase); - - return GetVListBoxComboPopup()->FindString(s, bCase); -} - -void wxOwnerDrawnComboBox::Select(int n) -{ - EnsurePopupControl(); - - wxCHECK_RET( (n == wxNOT_FOUND) || IsValid(n), _T("invalid index in wxOwnerDrawnComboBox::Select") ); - - GetVListBoxComboPopup()->SetSelection(n); - - wxString str; - if ( n >= 0 ) - str = GetVListBoxComboPopup()->GetString(n); - - // Refresh text portion in control - if ( m_text ) - m_text->SetValue( str ); - else - m_valueString = str; - - Refresh(); -} - -int wxOwnerDrawnComboBox::GetSelection() const -{ - if ( !m_popupInterface ) - return m_initChs.Index(m_valueString); - - return GetVListBoxComboPopup()->GetSelection(); -} - -int wxOwnerDrawnComboBox::DoAppend(const wxString& item) -{ - EnsurePopupControl(); - wxASSERT(m_popupInterface); - - return GetVListBoxComboPopup()->Append(item); -} - -int wxOwnerDrawnComboBox::DoInsert(const wxString& item, unsigned int pos) -{ - EnsurePopupControl(); - - wxCHECK_MSG(!(GetWindowStyle() & wxCB_SORT), -1, wxT("can't insert into sorted list")); - wxCHECK_MSG(IsValidInsert(pos), -1, wxT("invalid index")); - - GetVListBoxComboPopup()->Insert(item,pos); - - return pos; -} - -void wxOwnerDrawnComboBox::DoSetItemClientData(unsigned int n, void* clientData) -{ - EnsurePopupControl(); - - GetVListBoxComboPopup()->SetItemClientData(n,clientData,m_clientDataItemsType); -} - -void* wxOwnerDrawnComboBox::DoGetItemClientData(unsigned int n) const -{ - if ( !m_popupInterface ) - return NULL; - - return GetVListBoxComboPopup()->GetItemClientData(n); -} - -void wxOwnerDrawnComboBox::DoSetItemClientObject(unsigned int n, wxClientData* clientData) -{ - DoSetItemClientData(n, (void*) clientData); -} - -wxClientData* wxOwnerDrawnComboBox::DoGetItemClientObject(unsigned int n) const -{ - return (wxClientData*) DoGetItemClientData(n); -} - -// ---------------------------------------------------------------------------- -// wxOwnerDrawnComboBox item drawing and measuring default implementations -// ---------------------------------------------------------------------------- - -void wxOwnerDrawnComboBox::OnDrawItem( wxDC& dc, - const wxRect& rect, - int item, - int flags ) const -{ - if ( flags & wxODCB_PAINTING_CONTROL ) - { - dc.DrawText( GetValue(), - rect.x + GetTextIndent(), - (rect.height-dc.GetCharHeight())/2 + rect.y ); - } - else - { - dc.DrawText( GetVListBoxComboPopup()->GetString(item), rect.x + 2, rect.y ); - } -} - -wxCoord wxOwnerDrawnComboBox::OnMeasureItem( size_t WXUNUSED(item) ) const -{ - return -1; -} - -wxCoord wxOwnerDrawnComboBox::OnMeasureItemWidth( size_t WXUNUSED(item) ) const -{ - return -1; -} - -void wxOwnerDrawnComboBox::OnDrawBackground(wxDC& dc, - const wxRect& rect, - int WXUNUSED(item), - int flags) const -{ - // We need only to explicitly draw background for items - // that should have selected background. Also, call PrepareBackground - // always when painting the control so that clipping is done properly. - - if ( (flags & wxODCB_PAINTING_SELECTED) || - ((flags & wxODCB_PAINTING_CONTROL) && HasFlag(wxCB_READONLY)) ) - { - int bgFlags = wxCONTROL_SELECTED; - - if ( !(flags & wxODCB_PAINTING_CONTROL) ) - bgFlags |= wxCONTROL_ISSUBMENU; - - PrepareBackground(dc, rect, bgFlags); - } -} - -#endif // wxUSE_ODCOMBOBOX diff --git a/wxWidgets/src/generic/paletteg.cpp b/wxWidgets/src/generic/paletteg.cpp deleted file mode 100644 index 5696e20f87..0000000000 --- a/wxWidgets/src/generic/paletteg.cpp +++ /dev/null @@ -1,145 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/generic/paletteg.cpp -// Purpose: -// Author: Robert Roebling -// Created: 01/02/97 -// RCS-ID: $Id: paletteg.cpp 42752 2006-10-30 19:26:48Z VZ $ -// Copyright: (c) 1998 Robert Roebling and Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#if defined(__BORLANDC__) - #pragma hdrstop -#endif - -#if wxUSE_PALETTE - -#include "wx/palette.h" - -//----------------------------------------------------------------------------- -// wxPalette -//----------------------------------------------------------------------------- - -struct wxPaletteEntry -{ - unsigned char red, green, blue; -}; - -class wxPaletteRefData: public wxObjectRefData -{ - public: - - wxPaletteRefData(void); - virtual ~wxPaletteRefData(void); - - int m_count; - wxPaletteEntry *m_entries; -}; - -wxPaletteRefData::wxPaletteRefData() -{ - m_count = 0; - m_entries = NULL; -} - -wxPaletteRefData::~wxPaletteRefData() -{ - delete[] m_entries; -} - -//----------------------------------------------------------------------------- - -#define M_PALETTEDATA ((wxPaletteRefData *)m_refData) - -IMPLEMENT_DYNAMIC_CLASS(wxPalette,wxGDIObject) - -wxPalette::wxPalette() -{ - m_refData = NULL; -} - -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::IsOk() const -{ - return (m_refData != NULL); -} - -int wxPalette::GetColoursCount() const -{ - if (m_refData) - return M_PALETTEDATA->m_count; - - return 0; -} - -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_entries = new wxPaletteEntry[n]; - - wxPaletteEntry *e = M_PALETTEDATA->m_entries; - for (int i = 0; i < n; i++, e++) - { - e->red = red[i]; - e->green = green[i]; - e->blue = blue[i]; - } - - return true; -} - -int wxPalette::GetPixel( unsigned char red, - unsigned char green, - unsigned char blue ) const -{ - if (!m_refData) return wxNOT_FOUND; - - int closest = 0; - double d,distance = 1000.0; // max. dist is 256 - - wxPaletteEntry *e = M_PALETTEDATA->m_entries; - for (int i = 0; i < M_PALETTEDATA->m_count; i++, e++) - { - if ((d = 0.299 * abs(red - e->red) + - 0.587 * abs(green - e->green) + - 0.114 * abs(blue - e->blue)) < distance) { - distance = d; - closest = i; - } - } - return closest; -} - -bool wxPalette::GetRGB(int pixel, - unsigned char *red, - unsigned char *green, - unsigned char *blue) const -{ - if (!m_refData) return false; - if (pixel >= M_PALETTEDATA->m_count) return false; - - wxPaletteEntry& p = M_PALETTEDATA->m_entries[pixel]; - if (red) *red = p.red; - if (green) *green = p.green; - if (blue) *blue = p.blue; - return true; -} - -#endif // wxUSE_PALETTE diff --git a/wxWidgets/src/generic/panelg.cpp b/wxWidgets/src/generic/panelg.cpp deleted file mode 100644 index cd4dbee65c..0000000000 --- a/wxWidgets/src/generic/panelg.cpp +++ /dev/null @@ -1,180 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/generic/panelg.cpp -// Purpose: wxPanel and the keyboard handling code -// Author: Julian Smart, Robert Roebling, Vadim Zeitlin -// Modified by: -// Created: 04/01/98 -// RCS-ID: $Id: panelg.cpp 40307 2006-07-25 01:31:13Z VZ $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#ifndef WX_PRECOMP - #include "wx/object.h" - #include "wx/font.h" - #include "wx/colour.h" - #include "wx/settings.h" - #include "wx/log.h" - #include "wx/panel.h" - #include "wx/containr.h" -#endif - -// ---------------------------------------------------------------------------- -// wxWin macros -// ---------------------------------------------------------------------------- - -#if wxUSE_EXTENDED_RTTI -WX_DEFINE_FLAGS( wxPanelStyle ) - -wxBEGIN_FLAGS( wxPanelStyle ) - // new style border flags, we put them first to - // use them for streaming out - wxFLAGS_MEMBER(wxBORDER_SIMPLE) - wxFLAGS_MEMBER(wxBORDER_SUNKEN) - wxFLAGS_MEMBER(wxBORDER_DOUBLE) - wxFLAGS_MEMBER(wxBORDER_RAISED) - wxFLAGS_MEMBER(wxBORDER_STATIC) - wxFLAGS_MEMBER(wxBORDER_NONE) - - // old style border flags - wxFLAGS_MEMBER(wxSIMPLE_BORDER) - wxFLAGS_MEMBER(wxSUNKEN_BORDER) - wxFLAGS_MEMBER(wxDOUBLE_BORDER) - wxFLAGS_MEMBER(wxRAISED_BORDER) - wxFLAGS_MEMBER(wxSTATIC_BORDER) - wxFLAGS_MEMBER(wxBORDER) - - // standard window styles - wxFLAGS_MEMBER(wxTAB_TRAVERSAL) - wxFLAGS_MEMBER(wxCLIP_CHILDREN) - wxFLAGS_MEMBER(wxTRANSPARENT_WINDOW) - wxFLAGS_MEMBER(wxWANTS_CHARS) - wxFLAGS_MEMBER(wxFULL_REPAINT_ON_RESIZE) - wxFLAGS_MEMBER(wxALWAYS_SHOW_SB ) - wxFLAGS_MEMBER(wxVSCROLL) - wxFLAGS_MEMBER(wxHSCROLL) - -wxEND_FLAGS( wxPanelStyle ) - -IMPLEMENT_DYNAMIC_CLASS_XTI(wxPanel, wxWindow,"wx/panel.h") - -wxBEGIN_PROPERTIES_TABLE(wxPanel) - wxPROPERTY_FLAGS( WindowStyle , wxPanelStyle , long , SetWindowStyleFlag , GetWindowStyleFlag , EMPTY_MACROVALUE, 0 /*flags*/ , wxT("Helpstring") , wxT("group")) // style -// style wxTAB_TRAVERSAL -wxEND_PROPERTIES_TABLE() - -wxBEGIN_HANDLERS_TABLE(wxPanel) -wxEND_HANDLERS_TABLE() - -wxCONSTRUCTOR_5( wxPanel , wxWindow* , Parent , wxWindowID , Id , wxPoint , Position , wxSize , Size , long , WindowStyle ) - -#else -IMPLEMENT_DYNAMIC_CLASS(wxPanel, wxWindow) -#endif - -BEGIN_EVENT_TABLE(wxPanel, wxWindow) - EVT_SIZE(wxPanel::OnSize) - - WX_EVENT_TABLE_CONTROL_CONTAINER(wxPanel) -END_EVENT_TABLE() - -// ============================================================================ -// implementation -// ============================================================================ - -WX_DELEGATE_TO_CONTROL_CONTAINER(wxPanel, wxWindow) - -// ---------------------------------------------------------------------------- -// wxPanel creation -// ---------------------------------------------------------------------------- - -void wxPanel::Init() -{ - m_container.SetContainerWindow(this); -} - -bool wxPanel::Create(wxWindow *parent, wxWindowID id, - const wxPoint& pos, - const wxSize& size, - long style, - const wxString& name) -{ - if ( !wxWindow::Create(parent, id, pos, size, style, name) ) - return false; - - // so that non-solid background renders correctly under GTK+: - SetThemeEnabled(true); - -#if defined(__WXWINCE__) && (defined(__POCKETPC__) || defined(__SMARTPHONE__)) - // Required to get solid control backgrounds under WinCE - SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW)); -#endif - - return true; -} - -wxPanel::~wxPanel() -{ -} - -void wxPanel::InitDialog() -{ - wxInitDialogEvent event(GetId()); - event.SetEventObject(this); - GetEventHandler()->ProcessEvent(event); -} - -// ---------------------------------------------------------------------------- -// event handlers -// ---------------------------------------------------------------------------- - -void wxPanel::OnSize(wxSizeEvent& event) -{ - if (GetAutoLayout()) - Layout(); -#if wxUSE_CONSTRAINTS -#if defined(__WXPM__) && 0 - else - { - // Need to properly move child windows under OS/2 - - PSWP pWinSwp = GetSwp(); - - if (pWinSwp->cx == 0 && pWinSwp->cy == 0 && pWinSwp->fl == 0) - { - // Uninitialized - - ::WinQueryWindowPos(GetHWND(), pWinSwp); - } - else - { - SWP vSwp; - int nYDiff; - - ::WinQueryWindowPos(GetHWND(), &vSwp); - nYDiff = pWinSwp->cy - vSwp.cy; - MoveChildren(nYDiff); - pWinSwp->cx = vSwp.cx; - pWinSwp->cy = vSwp.cy; - } - } -#endif -#endif // wxUSE_CONSTRAINTS - - event.Skip(); -} diff --git a/wxWidgets/src/generic/printps.cpp b/wxWidgets/src/generic/printps.cpp deleted file mode 100644 index 4da2161d04..0000000000 --- a/wxWidgets/src/generic/printps.cpp +++ /dev/null @@ -1,370 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/generic/printps.cpp -// Purpose: Postscript print/preview framework -// Author: Julian Smart -// Modified by: -// Created: 04/01/98 -// RCS-ID: $Id: printps.cpp 42522 2006-10-27 13:07:40Z JS $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -#if wxUSE_PRINTING_ARCHITECTURE && wxUSE_POSTSCRIPT && (!defined(__WXMSW__) || wxUSE_POSTSCRIPT_ARCHITECTURE_IN_MSW) - -#ifndef WX_PRECOMP - #include "wx/utils.h" - #include "wx/dc.h" - #include "wx/app.h" - #include "wx/msgdlg.h" - #include "wx/intl.h" - #include "wx/progdlg.h" - #include "wx/log.h" - #include "wx/dcprint.h" -#endif - -#include "wx/generic/printps.h" -#include "wx/printdlg.h" -#include "wx/generic/prntdlgg.h" -#include "wx/generic/progdlgg.h" -#include "wx/paper.h" - -#include - -// ---------------------------------------------------------------------------- -// wxWin macros -// ---------------------------------------------------------------------------- - - IMPLEMENT_DYNAMIC_CLASS(wxPostScriptPrinter, wxPrinterBase) - IMPLEMENT_CLASS(wxPostScriptPrintPreview, wxPrintPreviewBase) - -// ============================================================================ -// implementation -// ============================================================================ - -// ---------------------------------------------------------------------------- -// Printer -// ---------------------------------------------------------------------------- - -wxPostScriptPrinter::wxPostScriptPrinter(wxPrintDialogData *data) - : wxPrinterBase(data) -{ -} - -wxPostScriptPrinter::~wxPostScriptPrinter() -{ -} - -bool wxPostScriptPrinter::Print(wxWindow *parent, wxPrintout *printout, bool prompt) -{ - sm_abortIt = false; - sm_abortWindow = (wxWindow *) NULL; - - if (!printout) - { - sm_lastError = wxPRINTER_ERROR; - 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; - if (prompt) - { - dc = PrintDialog(parent); - if (!dc) - return false; - } - else - { - dc = new wxPostScriptDC(GetPrintDialogData().GetPrintData()); - } - - // May have pressed cancel. - if (!dc || !dc->Ok()) - { - if (dc) delete dc; - sm_lastError = wxPRINTER_ERROR; - return false; - } - - wxSize ScreenPixels = wxGetDisplaySize(); - wxSize ScreenMM = wxGetDisplaySizeMM(); - - printout->SetPPIScreen( (int) ((ScreenPixels.GetWidth() * 25.4) / ScreenMM.GetWidth()), - (int) ((ScreenPixels.GetHeight() * 25.4) / ScreenMM.GetHeight()) ); - printout->SetPPIPrinter( wxPostScriptDC::GetResolution(), - wxPostScriptDC::GetResolution() ); - - // Set printout parameters - printout->SetDC(dc); - - int w, h; - dc->GetSize(&w, &h); - printout->SetPageSizePixels((int)w, (int)h); - printout->SetPaperRectPixels(wxRect(0, 0, w, h)); - int mw, mh; - dc->GetSizeMM(&mw, &mh); - printout->SetPageSizeMM((int)mw, (int)mh); - - // 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) - { - sm_lastError = wxPRINTER_ERROR; - 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); - - if (m_printDialogData.GetFromPage() < minPage) - m_printDialogData.SetFromPage( minPage ); - if (m_printDialogData.GetToPage() > maxPage) - m_printDialogData.SetToPage( maxPage ); - - int - pagesPerCopy = m_printDialogData.GetToPage()-m_printDialogData.GetFromPage()+1, - totalPages = pagesPerCopy * m_printDialogData.GetNoCopies(), - printedPages = 0; - // Open the progress bar dialog - wxProgressDialog *progressDialog = new wxProgressDialog ( - printout->GetTitle(), - _("Printing..."), - totalPages, - parent, - wxPD_CAN_ABORT|wxPD_AUTO_HIDE|wxPD_APP_MODAL); - - printout->OnBeginPrinting(); - - sm_lastError = wxPRINTER_NO_ERROR; - - bool keepGoing = true; - - int copyCount; - for (copyCount = 1; copyCount <= m_printDialogData.GetNoCopies(); copyCount ++) - { - if (!printout->OnBeginDocument(m_printDialogData.GetFromPage(), m_printDialogData.GetToPage())) - { - wxEndBusyCursor(); - wxLogError(_("Could not start printing.")); - sm_lastError = wxPRINTER_ERROR; - break; - } - if (sm_abortIt) - { - sm_lastError = wxPRINTER_CANCELLED; - break; - } - - int pn; - for (pn = m_printDialogData.GetFromPage(); keepGoing && (pn <= m_printDialogData.GetToPage()) && printout->HasPage(pn); - pn++) - { - if (sm_abortIt) - { - keepGoing = false; - sm_lastError = wxPRINTER_CANCELLED; - break; - } - else - { - wxString msg; - msg.Printf(_("Printing page %d..."), printedPages+1); - if(progressDialog->Update(printedPages++, msg)) - { - dc->StartPage(); - printout->OnPrintPage(pn); - dc->EndPage(); - } - else - { - sm_abortIt = true; - sm_lastError = wxPRINTER_CANCELLED; - keepGoing = false; - } - } - wxYield(); - } - printout->OnEndDocument(); - } - - printout->OnEndPrinting(); - delete progressDialog; - - wxEndBusyCursor(); - - delete dc; - - return (sm_lastError == wxPRINTER_NO_ERROR); -} - -wxDC* wxPostScriptPrinter::PrintDialog(wxWindow *parent) -{ - wxDC* dc = (wxDC*) NULL; - - wxGenericPrintDialog dialog( parent, &m_printDialogData ); - if (dialog.ShowModal() == wxID_OK) - { - dc = dialog.GetPrintDC(); - m_printDialogData = dialog.GetPrintDialogData(); - - if (dc == NULL) - sm_lastError = wxPRINTER_ERROR; - else - sm_lastError = wxPRINTER_NO_ERROR; - } - else - sm_lastError = wxPRINTER_CANCELLED; - - return dc; -} - -bool wxPostScriptPrinter::Setup(wxWindow *WXUNUSED(parent)) -{ -#if 0 - wxGenericPrintDialog* dialog = new wxGenericPrintDialog(parent, & m_printDialogData); - dialog->GetPrintDialogData().SetSetupDialog(true); - - int ret = dialog->ShowModal(); - - if (ret == wxID_OK) - { - m_printDialogData = dialog->GetPrintDialogData(); - } - - dialog->Destroy(); - - return (ret == wxID_OK); -#endif - - return false; -} - -// ---------------------------------------------------------------------------- -// Print preview -// ---------------------------------------------------------------------------- - -void wxPostScriptPrintPreview::Init(wxPrintout * WXUNUSED(printout), - wxPrintout * WXUNUSED(printoutForPrinting)) -{ - // Have to call it here since base constructor can't call it - DetermineScaling(); -} - -wxPostScriptPrintPreview::wxPostScriptPrintPreview(wxPrintout *printout, - wxPrintout *printoutForPrinting, - wxPrintDialogData *data) - : wxPrintPreviewBase(printout, printoutForPrinting, data) -{ - Init(printout, printoutForPrinting); -} - -wxPostScriptPrintPreview::wxPostScriptPrintPreview(wxPrintout *printout, - wxPrintout *printoutForPrinting, - wxPrintData *data) - : wxPrintPreviewBase(printout, printoutForPrinting, data) -{ - Init(printout, printoutForPrinting); -} - -wxPostScriptPrintPreview::~wxPostScriptPrintPreview() -{ -} - -bool wxPostScriptPrintPreview::Print(bool interactive) -{ - if (!m_printPrintout) - return false; - - // Assume that on Unix, the preview may use the PostScript - // (generic) version, but printing using the native system is required. - // TODO: make a generic print preview class from which wxPostScriptPrintPreview - // is derived. -#ifdef __UNIX__ - wxPrinter printer(& m_printDialogData); -#else - wxPostScriptPrinter printer(& m_printDialogData); -#endif - return printer.Print(m_previewFrame, m_printPrintout, interactive); -} - -void wxPostScriptPrintPreview::DetermineScaling() -{ - wxPaperSize paperType = m_printDialogData.GetPrintData().GetPaperId(); - if (paperType == wxPAPER_NONE) - paperType = wxPAPER_NONE; - - wxPrintPaperType *paper = wxThePrintPaperDatabase->FindPaperType(paperType); - if (!paper) - paper = wxThePrintPaperDatabase->FindPaperType(wxPAPER_A4); - - if (paper) - { - wxSize ScreenPixels = wxGetDisplaySize(); - wxSize ScreenMM = wxGetDisplaySizeMM(); - - m_previewPrintout->SetPPIScreen( (int) ((ScreenPixels.GetWidth() * 25.4) / ScreenMM.GetWidth()), - (int) ((ScreenPixels.GetHeight() * 25.4) / ScreenMM.GetHeight()) ); - m_previewPrintout->SetPPIPrinter(wxPostScriptDC::GetResolution(), wxPostScriptDC::GetResolution()); - - wxSize sizeDevUnits(paper->GetSizeDeviceUnits()); - sizeDevUnits.x = (wxCoord)((float)sizeDevUnits.x * wxPostScriptDC::GetResolution() / 72.0); - sizeDevUnits.y = (wxCoord)((float)sizeDevUnits.y * wxPostScriptDC::GetResolution() / 72.0); - wxSize sizeTenthsMM(paper->GetSize()); - wxSize sizeMM(sizeTenthsMM.x / 10, sizeTenthsMM.y / 10); - - // If in landscape mode, we need to swap the width and height. - if ( m_printDialogData.GetPrintData().GetOrientation() == wxLANDSCAPE ) - { - m_pageWidth = sizeDevUnits.y; - m_pageHeight = sizeDevUnits.x; - m_previewPrintout->SetPageSizeMM(sizeMM.y, sizeMM.x); - } - else - { - m_pageWidth = sizeDevUnits.x; - m_pageHeight = sizeDevUnits.y; - m_previewPrintout->SetPageSizeMM(sizeMM.x, sizeMM.y); - } - m_previewPrintout->SetPageSizePixels(m_pageWidth, m_pageHeight); - m_previewPrintout->SetPaperRectPixels(wxRect(0, 0, m_pageWidth, m_pageHeight)); - - // At 100%, the page should look about page-size on the screen. - m_previewScaleX = (float)0.8 * 72.0 / (float)wxPostScriptDC::GetResolution(); - m_previewScaleY = m_previewScaleX; - } -} - -#endif diff --git a/wxWidgets/src/generic/prntdlgg.cpp b/wxWidgets/src/generic/prntdlgg.cpp deleted file mode 100644 index a6b0a03b07..0000000000 --- a/wxWidgets/src/generic/prntdlgg.cpp +++ /dev/null @@ -1,1102 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/generic/prntdlgg.cpp -// Purpose: Generic print dialogs -// Author: Julian Smart -// Modified by: -// Created: 04/01/98 -// RCS-ID: $Id: prntdlgg.cpp 55256 2008-08-25 14:39:11Z VZ $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_PRINTING_ARCHITECTURE && (!defined(__WXMSW__) || wxUSE_POSTSCRIPT_ARCHITECTURE_IN_MSW) - -#include "wx/generic/prntdlgg.h" - -#ifndef WX_PRECOMP - #include "wx/utils.h" - #include "wx/dc.h" - #include "wx/stattext.h" - #include "wx/statbox.h" - #include "wx/button.h" - #include "wx/checkbox.h" - #include "wx/textctrl.h" - #include "wx/radiobox.h" - #include "wx/filedlg.h" - #include "wx/combobox.h" - #include "wx/intl.h" - #include "wx/sizer.h" - #include "wx/cmndata.h" -#endif - -#if wxUSE_STATLINE - #include "wx/statline.h" -#endif - -#if wxUSE_POSTSCRIPT - #include "wx/generic/dcpsg.h" -#endif - -#include "wx/prntbase.h" -#include "wx/printdlg.h" -#include "wx/paper.h" -#include "wx/filename.h" -#include "wx/tokenzr.h" -#include "wx/imaglist.h" - -#include -#include - -#ifndef __WXUNIVERSAL__ - -#if wxUSE_LIBGNOMEPRINT - #include "wx/link.h" - wxFORCE_LINK_MODULE(gnome_print) -#endif - -#endif // !__WXUNIVERSAL__ - -// ---------------------------------------------------------------------------- -// global vars -// ---------------------------------------------------------------------------- - -extern wxPrintPaperDatabase *wxThePrintPaperDatabase; - -#if wxUSE_POSTSCRIPT - -//---------------------------------------------------------------------------- -// wxPostScriptNativeData -//---------------------------------------------------------------------------- - -IMPLEMENT_CLASS(wxPostScriptPrintNativeData, wxPrintNativeDataBase) - -wxPostScriptPrintNativeData::wxPostScriptPrintNativeData() -{ - m_previewCommand = wxEmptyString; -#ifdef __VMS__ - m_printerCommand = wxT("print"); - m_printerOptions = wxT("/nonotify/queue=psqueue"); - m_afmPath = wxT("sys$ps_font_metrics:"); -#endif - -#ifdef __WXMSW__ - m_printerCommand = wxT("print"); - m_printerOptions = wxEmptyString; - m_afmPath = wxT("c:\\windows\\system\\"); -#endif - -#if !defined(__VMS__) && !defined(__WXMSW__) - m_printerCommand = wxT("lpr"); - m_printerOptions = wxEmptyString; - m_afmPath = wxEmptyString; -#endif - - m_printerScaleX = 1.0; - m_printerScaleY = 1.0; - m_printerTranslateX = 0; - m_printerTranslateY = 0; -} - -wxPostScriptPrintNativeData::~wxPostScriptPrintNativeData() -{ -} - -bool wxPostScriptPrintNativeData::TransferTo( wxPrintData &WXUNUSED(data) ) -{ - return true; -} - -bool wxPostScriptPrintNativeData::TransferFrom( const wxPrintData &WXUNUSED(data) ) -{ - return true; -} - -// ---------------------------------------------------------------------------- -// Generic print dialog for non-Windows printing use. -// ---------------------------------------------------------------------------- - -IMPLEMENT_CLASS(wxGenericPrintDialog, wxPrintDialogBase) - -BEGIN_EVENT_TABLE(wxGenericPrintDialog, wxPrintDialogBase) - EVT_BUTTON(wxID_OK, wxGenericPrintDialog::OnOK) - EVT_BUTTON(wxPRINTID_SETUP, wxGenericPrintDialog::OnSetup) - EVT_RADIOBOX(wxPRINTID_RANGE, wxGenericPrintDialog::OnRange) -END_EVENT_TABLE() - -wxGenericPrintDialog::wxGenericPrintDialog(wxWindow *parent, - wxPrintDialogData* data) - : wxPrintDialogBase(parent, wxID_ANY, _("Print"), - wxPoint(0,0), wxSize(600, 600), - wxDEFAULT_DIALOG_STYLE | - wxTAB_TRAVERSAL) -{ - if ( data ) - m_printDialogData = *data; - - Init(parent); -} - -wxGenericPrintDialog::wxGenericPrintDialog(wxWindow *parent, - wxPrintData* data) - : wxPrintDialogBase(parent, wxID_ANY, _("Print"), - wxPoint(0,0), wxSize(600, 600), - wxDEFAULT_DIALOG_STYLE | - wxTAB_TRAVERSAL) -{ - if ( data ) - m_printDialogData = *data; - - Init(parent); -} - -void wxGenericPrintDialog::Init(wxWindow * WXUNUSED(parent)) -{ - // wxDialog::Create(parent, wxID_ANY, _("Print"), wxPoint(0,0), wxSize(600, 600), - // wxDEFAULT_DIALOG_STYLE | wxTAB_TRAVERSAL); - - wxBoxSizer *mainsizer = new wxBoxSizer( wxVERTICAL ); - - // 1) top row - - wxPrintFactory* factory = wxPrintFactory::GetFactory(); - - wxStaticBoxSizer *topsizer = new wxStaticBoxSizer( - new wxStaticBox( this, wxID_ANY, _( "Printer options" ) ), wxHORIZONTAL ); - wxFlexGridSizer *flex = new wxFlexGridSizer( 2 ); - flex->AddGrowableCol( 1 ); - topsizer->Add( flex, 1, wxGROW ); - - m_printToFileCheckBox = new wxCheckBox( this, wxPRINTID_PRINTTOFILE, _("Print to File") ); - flex->Add( m_printToFileCheckBox, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); - - m_setupButton = new wxButton(this, wxPRINTID_SETUP, _("Setup...") ); - flex->Add( m_setupButton, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL, 5 ); - - if (!factory->HasPrintSetupDialog()) - m_setupButton->Enable( false ); - - if (factory->HasPrinterLine()) - { - flex->Add( new wxStaticText( this, wxID_ANY, _("Printer:") ), - 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); - flex->Add( new wxStaticText( this, wxID_ANY, factory->CreatePrinterLine() ), - 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); - } - - if (factory->HasStatusLine()) - { - flex->Add( new wxStaticText( this, wxID_ANY, _("Status:") ), - 0, wxALIGN_CENTER_VERTICAL|(wxALL-wxTOP), 5 ); - flex->Add( new wxStaticText( this, wxID_ANY, factory->CreateStatusLine() ), - 0, wxALIGN_CENTER_VERTICAL|(wxALL-wxTOP), 5 ); - } - - mainsizer->Add( topsizer, 0, wxLEFT|wxTOP|wxRIGHT|wxGROW, 10 ); - - // 2) middle row with radio box - - wxString *choices = new wxString[2]; - choices[0] = _("All"); - choices[1] = _("Pages"); - - m_fromText = (wxTextCtrl*)NULL; - m_toText = (wxTextCtrl*)NULL; - m_rangeRadioBox = (wxRadioBox *)NULL; - - if (m_printDialogData.GetFromPage() != 0) - { - m_rangeRadioBox = new wxRadioBox(this, wxPRINTID_RANGE, _("Print Range"), - wxDefaultPosition, wxDefaultSize, - 2, choices, - 1, wxRA_VERTICAL); - m_rangeRadioBox->SetSelection(1); - - mainsizer->Add( m_rangeRadioBox, 0, wxLEFT|wxTOP|wxRIGHT, 10 ); - } - - // 3) bottom row - - wxBoxSizer *bottomsizer = new wxBoxSizer( wxHORIZONTAL ); - - if (m_printDialogData.GetFromPage() != 0) - { - bottomsizer->Add( new wxStaticText(this, wxPRINTID_STATIC, _("From:") ), 0, wxCENTER|wxALL, 5 ); - m_fromText = new wxTextCtrl(this, wxPRINTID_FROM, wxEmptyString, wxDefaultPosition, wxSize(40, wxDefaultCoord)); - bottomsizer->Add( m_fromText, 1, wxCENTER|wxRIGHT, 10 ); - - bottomsizer->Add( new wxStaticText(this, wxPRINTID_STATIC, _("To:") ), 0, wxCENTER|wxALL, 5); - m_toText = new wxTextCtrl(this, wxPRINTID_TO, wxEmptyString, wxDefaultPosition, wxSize(40, wxDefaultCoord)); - bottomsizer->Add( m_toText, 1, wxCENTER|wxRIGHT, 10 ); - } - - bottomsizer->Add( new wxStaticText(this, wxPRINTID_STATIC, _("Copies:") ), 0, wxCENTER|wxALL, 5 ); - m_noCopiesText = new wxTextCtrl(this, wxPRINTID_COPIES, wxEmptyString, wxPoint(252, 130), wxSize(40, wxDefaultCoord)); - bottomsizer->Add( m_noCopiesText, 1, wxCENTER|wxRIGHT, 10 ); - - mainsizer->Add( bottomsizer, 0, wxTOP|wxLEFT|wxRIGHT, 12 ); - - // 4) buttons - - wxSizer *sizerBtn = CreateSeparatedButtonSizer( wxOK|wxCANCEL); - if ( sizerBtn ) - mainsizer->Add(sizerBtn, 0, wxEXPAND|wxALL, 10 ); - - SetAutoLayout( true ); - SetSizer( mainsizer ); - - mainsizer->Fit( this ); - Centre(wxBOTH); - - // Calls wxWindow::OnInitDialog and then wxGenericPrintDialog::TransferDataToWindow - InitDialog(); - delete[] choices; -} - -int wxGenericPrintDialog::ShowModal() -{ - return wxDialog::ShowModal(); -} - -wxGenericPrintDialog::~wxGenericPrintDialog() -{ -} - -void wxGenericPrintDialog::OnOK(wxCommandEvent& WXUNUSED(event)) -{ - TransferDataFromWindow(); - - // An empty 'to' field signals printing just the - // 'from' page. - if (m_printDialogData.GetToPage() < 1) - m_printDialogData.SetToPage(m_printDialogData.GetFromPage()); - - // There are some interactions between the global setup data - // and the standard print dialog. The global printing 'mode' - // is determined by whether the user checks Print to file - // or not. - if (m_printDialogData.GetPrintToFile()) - { - m_printDialogData.GetPrintData().SetPrintMode(wxPRINT_MODE_FILE); - - wxFileName fname( m_printDialogData.GetPrintData().GetFilename() ); - - wxFileDialog dialog( this, _("PostScript file"), - fname.GetPath(), fname.GetFullName(), wxT("*.ps"), wxFD_SAVE | wxFD_OVERWRITE_PROMPT ); - if (dialog.ShowModal() != wxID_OK) return; - - m_printDialogData.GetPrintData().SetFilename( dialog.GetPath() ); - } - else - { - m_printDialogData.GetPrintData().SetPrintMode(wxPRINT_MODE_PRINTER); - } - - EndModal(wxID_OK); -} - -void wxGenericPrintDialog::OnRange(wxCommandEvent& event) -{ - if (!m_fromText) return; - - if (event.GetInt() == 0) - { - m_fromText->Enable(false); - m_toText->Enable(false); - } - else if (event.GetInt() == 1) - { - m_fromText->Enable(true); - m_toText->Enable(true); - } -} - -void wxGenericPrintDialog::OnSetup(wxCommandEvent& WXUNUSED(event)) -{ - wxPrintFactory* factory = wxPrintFactory::GetFactory(); - - if (factory->HasPrintSetupDialog()) - { - // The print setup dialog should change the - // print data in-place if not cancelled. - wxDialog *dialog = factory->CreatePrintSetupDialog( this, &m_printDialogData.GetPrintData() ); - dialog->ShowModal(); - dialog->Destroy(); - } -} - -bool wxGenericPrintDialog::TransferDataToWindow() -{ - if(m_printDialogData.GetFromPage() != 0) - { - if(m_fromText) - { - if (m_printDialogData.GetEnablePageNumbers()) - { - m_fromText->Enable(true); - m_toText->Enable(true); - if (m_printDialogData.GetFromPage() > 0) - m_fromText->SetValue(wxString::Format(_T("%d"), m_printDialogData.GetFromPage())); - if (m_printDialogData.GetToPage() > 0) - m_toText->SetValue(wxString::Format(_T("%d"), m_printDialogData.GetToPage())); - if(m_rangeRadioBox) - { - if (m_printDialogData.GetAllPages() || m_printDialogData.GetFromPage() == 0) - m_rangeRadioBox->SetSelection(0); - else - m_rangeRadioBox->SetSelection(1); - } - } - else - { - m_fromText->Enable(false); - m_toText->Enable(false); - if(m_rangeRadioBox) - { - m_rangeRadioBox->SetSelection(0); - m_rangeRadioBox->wxRadioBox::Enable(1, false); - } - } - } - } - m_noCopiesText->SetValue( - wxString::Format(_T("%d"), m_printDialogData.GetNoCopies())); - - m_printToFileCheckBox->SetValue(m_printDialogData.GetPrintToFile()); - m_printToFileCheckBox->Enable(m_printDialogData.GetEnablePrintToFile()); - return true; -} - -bool wxGenericPrintDialog::TransferDataFromWindow() -{ - long res = 0; - if(m_printDialogData.GetFromPage() != -1) - { - if (m_printDialogData.GetEnablePageNumbers()) - { - if(m_fromText) - { - wxString value = m_fromText->GetValue(); - if (value.ToLong( &res )) - m_printDialogData.SetFromPage( res ); - } - if(m_toText) - { - wxString value = m_toText->GetValue(); - if (value.ToLong( &res )) - m_printDialogData.SetToPage( res ); - } - } - if(m_rangeRadioBox) - { - if (m_rangeRadioBox->GetSelection() == 0) - { - m_printDialogData.SetAllPages(true); - - // This means all pages, more or less - m_printDialogData.SetFromPage(1); - m_printDialogData.SetToPage(32000); - } - else - m_printDialogData.SetAllPages(false); - } - } - else - { // continuous printing - m_printDialogData.SetFromPage(1); - m_printDialogData.SetToPage(32000); - } - - wxString value = m_noCopiesText->GetValue(); - if (value.ToLong( &res )) - m_printDialogData.SetNoCopies( res ); - - m_printDialogData.SetPrintToFile(m_printToFileCheckBox->GetValue()); - - return true; -} - -wxDC *wxGenericPrintDialog::GetPrintDC() -{ - return new wxPostScriptDC(GetPrintDialogData().GetPrintData()); -} - -// ---------------------------------------------------------------------------- -// Generic print setup dialog -// ---------------------------------------------------------------------------- - -IMPLEMENT_CLASS(wxGenericPrintSetupDialog, wxDialog) - -BEGIN_EVENT_TABLE(wxGenericPrintSetupDialog, wxDialog) - EVT_LIST_ITEM_ACTIVATED(wxPRINTID_PRINTER, wxGenericPrintSetupDialog::OnPrinter) -END_EVENT_TABLE() - -wxGenericPrintSetupDialog::wxGenericPrintSetupDialog(wxWindow *parent, wxPrintData* data): -wxDialog(parent, wxID_ANY, _("Print Setup"), wxPoint(0,0), wxSize(600, 600), wxDEFAULT_DIALOG_STYLE|wxTAB_TRAVERSAL) -{ - Init(data); -} - -/* XPM */ -static const char * check_xpm[] = { -/* width height ncolors chars_per_pixel */ -"16 16 3 1", -/* colors */ -" s None c None", -"X c #000000", -". c #808080", -/* pixels */ -" ", -" ", -" ", -" .. ", -" XX ", -" XX. ", -" .XX ", -" XX ", -" X XX. ", -" XX .XX ", -" XX XX ", -" XXXX. ", -" XX. ", -" . ", -" ", -" " -}; - - -void wxGenericPrintSetupDialog::Init(wxPrintData* data) -{ - if ( data ) - m_printData = *data; - - m_targetData = data; - - wxBoxSizer *main_sizer = new wxBoxSizer( wxVERTICAL ); - - // printer selection - - wxStaticBoxSizer *printer_sizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Printer") ), wxVERTICAL ); - main_sizer->Add( printer_sizer, 0, wxALL|wxGROW, 10 ); - - m_printerListCtrl = new wxListCtrl( this, wxPRINTID_PRINTER, - wxDefaultPosition, wxSize(wxDefaultCoord,100), wxLC_REPORT|wxLC_SINGLE_SEL|wxSUNKEN_BORDER ); - wxImageList *image_list = new wxImageList; - image_list->Add( wxBitmap(check_xpm) ); - m_printerListCtrl->AssignImageList( image_list, wxIMAGE_LIST_SMALL ); - - m_printerListCtrl->InsertColumn( 0, wxT(" "), wxLIST_FORMAT_LEFT, 20 ); - m_printerListCtrl->InsertColumn( 1, wxT("Printer"), wxLIST_FORMAT_LEFT, 150 ); - m_printerListCtrl->InsertColumn( 2, wxT("Device"), wxLIST_FORMAT_LEFT, 150 ); - m_printerListCtrl->InsertColumn( 3, wxT("Status"), wxLIST_FORMAT_LEFT, 80 ); - - wxListItem item; - item.SetMask( wxLIST_MASK_TEXT ); - item.SetColumn( 1 ); - item.SetText( _("Default printer") ); - item.SetId( m_printerListCtrl->InsertItem( item ) ); - - if (data->GetPrinterName().empty()) - { - wxListItem item2; - item2.SetId( item.GetId() ); - item2.SetMask( wxLIST_MASK_IMAGE ); - item2.SetImage( 0 ); - m_printerListCtrl->SetItem( item2 ); - // also select item - m_printerListCtrl->SetItemState( item.GetId(), wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED ); - } - - item.SetId( 1+ item.GetId() ); - - wxArrayString errors; - wxArrayString output; - long res = wxExecute( wxT("lpstat -v"), output, errors, wxEXEC_NODISABLE ); - if (res >= 0 && errors.GetCount() == 0) - { - size_t i; - for (i = 0; i < output.GetCount(); i++) - { - wxStringTokenizer tok( output[i], wxT(" ") ); - wxString tmp = tok.GetNextToken(); // "device" - if (tmp != wxT("device")) - break; // the lpstat syntax must have changed. - tmp = tok.GetNextToken(); // "for" - if (tmp != wxT("for")) - break; // the lpstat syntax must have changed. - tmp = tok.GetNextToken(); // "hp_deskjet930c:" - if (tmp[tmp.length()-1] == wxT(':')) - tmp.Remove(tmp.length()-1,1); - wxString name = tmp; - item.SetText( name ); - item.SetId( m_printerListCtrl->InsertItem( item ) ); - tmp = tok.GetNextToken(); // "parallel:/dev/lp0" - item.SetColumn( 2 ); - item.SetText( tmp ); - m_printerListCtrl->SetItem( item ); - if (data->GetPrinterName() == name) - { - wxListItem item2; - item2.SetId( item.GetId() ); - item2.SetMask( wxLIST_MASK_IMAGE ); - item2.SetImage( 0 ); - m_printerListCtrl->SetItem( item2 ); - // also select item - m_printerListCtrl->SetItemState( item.GetId(), wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED ); - } - - wxString command = wxT("lpstat -p "); - command += name; - wxArrayString errors2; - wxArrayString output2; - res = wxExecute( command, output2, errors2, wxEXEC_NODISABLE ); - if (res >= 0 && errors2.GetCount() == 0 && output2.GetCount() > 0) - { - tmp = output2[0]; // "printer hp_deskjet930c is idle. enable since ..." - int pos = tmp.Find( wxT('.') ); - if (pos != wxNOT_FOUND) - tmp.Remove( (size_t)pos, tmp.length()-(size_t)pos ); - wxStringTokenizer tok2( tmp, wxT(" ") ); - tmp = tok2.GetNextToken(); // "printer" - tmp = tok2.GetNextToken(); // "hp_deskjet930c" - tmp = wxEmptyString; - while (tok2.HasMoreTokens()) - { - tmp += tok2.GetNextToken(); - tmp += wxT(" "); - } - item.SetColumn( 3 ); - item.SetText( tmp ); - m_printerListCtrl->SetItem( item ); - } - - item.SetColumn( 1 ); - item.SetId( 1+ item.GetId() ); - } - } - - - printer_sizer->Add( m_printerListCtrl, 0, wxALL|wxGROW, 5 ); - - wxBoxSizer *item1 = new wxBoxSizer( wxHORIZONTAL ); - main_sizer->Add( item1, 0, wxALL, 5 ); - - // printer options (on the left) - - wxBoxSizer *item2 = new wxBoxSizer( wxVERTICAL ); - - wxStaticBox *item4 = new wxStaticBox( this, wxPRINTID_STATIC, _("Paper size") ); - wxStaticBoxSizer *item3 = new wxStaticBoxSizer( item4, wxVERTICAL ); - - m_paperTypeChoice = CreatePaperTypeChoice(); - item3->Add( m_paperTypeChoice, 0, wxALIGN_CENTER|wxALL, 5 ); - - item2->Add( item3, 0, wxALIGN_CENTER|wxALL, 5 ); - - wxString strs6[] = - { - _("Portrait"), - _("Landscape") - }; - m_orientationRadioBox= new wxRadioBox( this, wxPRINTID_ORIENTATION, _("Orientation"), wxDefaultPosition, wxDefaultSize, 2, strs6, 1, wxRA_SPECIFY_ROWS ); - item2->Add( m_orientationRadioBox, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5 ); - - wxStaticBox *item8 = new wxStaticBox( this, wxID_ANY, _("Options") ); - wxStaticBoxSizer *item7 = new wxStaticBoxSizer( item8, wxHORIZONTAL ); - - m_colourCheckBox = new wxCheckBox( this, wxPRINTID_PRINTCOLOUR, _("Print in colour") ); - item7->Add( m_colourCheckBox, 0, wxALIGN_CENTER|wxALL, 5 ); - - item2->Add( item7, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5 ); - - item1->Add( item2, 0, wxALIGN_CENTER_HORIZONTAL, 5 ); - - // spooling options (on the right) - - wxStaticBox *item11 = new wxStaticBox( this, wxID_ANY, _("Print spooling") ); - wxStaticBoxSizer *item10 = new wxStaticBoxSizer( item11, wxVERTICAL ); - - wxStaticText *item12 = new wxStaticText( this, wxID_ANY, _("Printer command:") ); - item10->Add( item12, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); - - wxBoxSizer *item13 = new wxBoxSizer( wxHORIZONTAL ); - - item13->Add( 20, 20, 0, wxALIGN_CENTER|wxALL, 5 ); - - m_printerCommandText = new wxTextCtrl( this, wxPRINTID_COMMAND, wxEmptyString, wxDefaultPosition, wxSize(160,wxDefaultCoord) ); - item13->Add( m_printerCommandText, 0, wxALIGN_CENTER|wxALL, 5 ); - - item10->Add( item13, 0, wxALIGN_CENTER|wxALL, 0 ); - - wxStaticText *item15 = new wxStaticText( this, wxID_ANY, _("Printer options:") ); - item10->Add( item15, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); - - wxBoxSizer *item16 = new wxBoxSizer( wxHORIZONTAL ); - - item16->Add( 20, 20, 0, wxALIGN_CENTER|wxALL, 5 ); - - m_printerOptionsText = new wxTextCtrl( this, wxPRINTID_OPTIONS, wxEmptyString, wxDefaultPosition, wxSize(160,wxDefaultCoord) ); - item16->Add( m_printerOptionsText, 0, wxALIGN_CENTER|wxALL, 5 ); - - item10->Add( item16, 0, wxALIGN_CENTER|wxALL, 0 ); - - item1->Add( item10, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5 ); - - -#if wxUSE_STATLINE - // static line - main_sizer->Add( new wxStaticLine( this, wxID_ANY ), 0, wxEXPAND | wxLEFT|wxRIGHT|wxTOP, 10 ); -#endif - - // buttons - - main_sizer->Add( CreateButtonSizer( wxOK|wxCANCEL), 0, wxEXPAND|wxALL, 10 ); - - SetAutoLayout( true ); - SetSizer( main_sizer ); - - main_sizer->Fit( this ); - Centre(wxBOTH); - - - Fit(); - Centre(wxBOTH); - - InitDialog(); -} - -wxGenericPrintSetupDialog::~wxGenericPrintSetupDialog() -{ -} - -void wxGenericPrintSetupDialog::OnPrinter(wxListEvent& event) -{ - // Delete check mark - for (long item = 0; item < m_printerListCtrl->GetItemCount(); item++) - m_printerListCtrl->SetItemImage( item, -1 ); - - m_printerListCtrl->SetItemImage( event.GetIndex(), 0 ); - - if (event.GetIndex() == 0) - { - m_printerCommandText->SetValue( wxT("lpr") ); - } - else - { - wxListItem li; - li.SetColumn( 1 ); - li.SetMask( wxLIST_MASK_TEXT ); - li.SetId( event.GetIndex() ); - m_printerListCtrl->GetItem( li ); - m_printerCommandText->SetValue( _T("lpr -P") + li.GetText() ); - } -} - -bool wxGenericPrintSetupDialog::TransferDataToWindow() -{ - wxPostScriptPrintNativeData *data = - (wxPostScriptPrintNativeData *) m_printData.GetNativeData(); - - if (m_printerCommandText && data->GetPrinterCommand()) - m_printerCommandText->SetValue(data->GetPrinterCommand()); - if (m_printerOptionsText && data->GetPrinterOptions()) - m_printerOptionsText->SetValue(data->GetPrinterOptions()); - if (m_colourCheckBox) - m_colourCheckBox->SetValue(m_printData.GetColour()); - - if (m_orientationRadioBox) - { - if (m_printData.GetOrientation() == wxPORTRAIT) - m_orientationRadioBox->SetSelection(0); - else - m_orientationRadioBox->SetSelection(1); - } - return true; -} - -bool wxGenericPrintSetupDialog::TransferDataFromWindow() -{ - wxPostScriptPrintNativeData *data = - (wxPostScriptPrintNativeData *) m_printData.GetNativeData(); - - // find selected printer - long id = m_printerListCtrl->GetNextItem( -1, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED ); - if (id == 0) - { - m_printData.SetPrinterName( wxEmptyString ); - } - else - { - wxListItem item; - item.SetId( id ); - item.SetMask( wxLIST_MASK_TEXT ); - item.SetColumn( 1 ); - m_printerListCtrl->GetItem( item ); - m_printData.SetPrinterName( item.GetText() ); - } - - if (m_printerCommandText) - data->SetPrinterCommand(m_printerCommandText->GetValue()); - if (m_printerOptionsText) - data->SetPrinterOptions(m_printerOptionsText->GetValue()); - if (m_colourCheckBox) - m_printData.SetColour(m_colourCheckBox->GetValue()); - if (m_orientationRadioBox) - { - int sel = m_orientationRadioBox->GetSelection(); - if (sel == 0) - m_printData.SetOrientation(wxPORTRAIT); - else - m_printData.SetOrientation(wxLANDSCAPE); - } - if (m_paperTypeChoice) - { - int selectedItem = m_paperTypeChoice->GetSelection(); - if (selectedItem != -1) - { - wxPrintPaperType *paper = wxThePrintPaperDatabase->Item(selectedItem); - if (paper != NULL) - m_printData.SetPaperId( paper->GetId()); - } - } - - if (m_targetData) - *m_targetData = m_printData; - - return true; -} - -wxComboBox *wxGenericPrintSetupDialog::CreatePaperTypeChoice() -{ - size_t n = wxThePrintPaperDatabase->GetCount(); - wxString *choices = new wxString [n]; - size_t sel = 0; - - for (size_t i = 0; i < n; i++) - { - wxPrintPaperType *paper = wxThePrintPaperDatabase->Item(i); - choices[i] = paper->GetName(); - if (m_printData.GetPaperId() == paper->GetId()) - sel = i; - } - - int width = 250; - - wxComboBox *choice = new wxComboBox( this, - wxPRINTID_PAPERSIZE, - _("Paper Size"), - wxDefaultPosition, - wxSize(width, wxDefaultCoord), - n, choices ); - - delete[] choices; - - choice->SetSelection(sel); - return choice; -} - -#endif // wxUSE_POSTSCRIPT - -// ---------------------------------------------------------------------------- -// Generic page setup dialog -// ---------------------------------------------------------------------------- - -IMPLEMENT_CLASS(wxGenericPageSetupDialog, wxPageSetupDialogBase) - -BEGIN_EVENT_TABLE(wxGenericPageSetupDialog, wxPageSetupDialogBase) - EVT_BUTTON(wxPRINTID_SETUP, wxGenericPageSetupDialog::OnPrinter) -END_EVENT_TABLE() - -wxGenericPageSetupDialog::wxGenericPageSetupDialog( wxWindow *parent, - wxPageSetupDialogData* data) - : wxPageSetupDialogBase( parent, - wxID_ANY, - _("Page Setup"), - wxPoint(0,0), - wxSize(600, 600), - wxDEFAULT_DIALOG_STYLE|wxTAB_TRAVERSAL ) -{ - if (data) - m_pageData = *data; - - int textWidth = 80; - - wxBoxSizer *mainsizer = new wxBoxSizer( wxVERTICAL ); - - // 1) top - wxStaticBoxSizer *topsizer = new wxStaticBoxSizer( - new wxStaticBox(this,wxPRINTID_STATIC, _("Paper size")), wxHORIZONTAL ); - - size_t n = wxThePrintPaperDatabase->GetCount(); - wxString *choices = new wxString [n]; - - for (size_t i = 0; i < n; i++) - { - wxPrintPaperType *paper = wxThePrintPaperDatabase->Item(i); - choices[i] = paper->GetName(); - } - - m_paperTypeChoice = new wxComboBox( this, - wxPRINTID_PAPERSIZE, - _("Paper Size"), - wxDefaultPosition, - wxSize(300, wxDefaultCoord), - n, choices ); - topsizer->Add( m_paperTypeChoice, 1, wxEXPAND|wxALL, 5 ); -// m_paperTypeChoice->SetSelection(sel); - - mainsizer->Add( topsizer, 0, wxTOP|wxLEFT|wxRIGHT | wxEXPAND, 10 ); - - // 2) middle sizer with radio box - - wxString *choices2 = new wxString[2]; - choices2[0] = _("Portrait"); - choices2[1] = _("Landscape"); - m_orientationRadioBox = new wxRadioBox(this, wxPRINTID_ORIENTATION, _("Orientation"), - wxDefaultPosition, wxDefaultSize, 2, choices2, 2); - m_orientationRadioBox->SetSelection(0); - - mainsizer->Add( m_orientationRadioBox, 0, wxTOP|wxLEFT|wxRIGHT, 10 ); - - // 3) margins - - wxBoxSizer *table = new wxBoxSizer( wxHORIZONTAL ); - - wxBoxSizer *column1 = new wxBoxSizer( wxVERTICAL ); - column1->Add( new wxStaticText(this, wxPRINTID_STATIC, _("Left margin (mm):")),1,wxALL|wxALIGN_RIGHT,5 ); - column1->Add( new wxStaticText(this, wxPRINTID_STATIC, _("Top margin (mm):")),1,wxALL|wxALIGN_RIGHT,5 ); - table->Add( column1, 0, wxALL | wxEXPAND, 5 ); - - wxBoxSizer *column2 = new wxBoxSizer( wxVERTICAL ); - m_marginLeftText = new wxTextCtrl(this, wxPRINTID_LEFTMARGIN, wxEmptyString, wxDefaultPosition, wxSize(textWidth, wxDefaultCoord)); - m_marginTopText = new wxTextCtrl(this, wxPRINTID_TOPMARGIN, wxEmptyString, wxDefaultPosition, wxSize(textWidth, wxDefaultCoord)); - column2->Add( m_marginLeftText, 1, wxALL, 5 ); - column2->Add( m_marginTopText, 1, wxALL, 5 ); - table->Add( column2, 0, wxRIGHT|wxTOP|wxBOTTOM | wxEXPAND, 5 ); - - wxBoxSizer *column3 = new wxBoxSizer( wxVERTICAL ); - column3->Add( new wxStaticText(this, wxPRINTID_STATIC, _("Right margin (mm):")),1,wxALL|wxALIGN_RIGHT,5 ); - column3->Add( new wxStaticText(this, wxPRINTID_STATIC, _("Bottom margin (mm):")),1,wxALL|wxALIGN_RIGHT,5 ); - table->Add( column3, 0, wxALL | wxEXPAND, 5 ); - - wxBoxSizer *column4 = new wxBoxSizer( wxVERTICAL ); - m_marginRightText = new wxTextCtrl(this, wxPRINTID_RIGHTMARGIN, wxEmptyString, wxDefaultPosition, wxSize(textWidth, wxDefaultCoord)); - m_marginBottomText = new wxTextCtrl(this, wxPRINTID_BOTTOMMARGIN, wxEmptyString, wxDefaultPosition, wxSize(textWidth, wxDefaultCoord)); - column4->Add( m_marginRightText, 1, wxALL, 5 ); - column4->Add( m_marginBottomText, 1, wxALL, 5 ); - table->Add( column4, 0, wxRIGHT|wxTOP|wxBOTTOM | wxEXPAND, 5 ); - - mainsizer->Add( table, 0 ); - -#if wxUSE_STATLINE - // 5) static line - mainsizer->Add( new wxStaticLine( this, wxID_ANY ), 0, wxEXPAND | wxLEFT|wxRIGHT|wxTOP, 10 ); -#endif - - // 6) buttons - - wxSizer* buttonsizer = CreateButtonSizer( wxOK|wxCANCEL); - - if (wxPrintFactory::GetFactory()->HasPrintSetupDialog()) - { - m_printerButton = new wxButton(this, wxPRINTID_SETUP, _("Printer...") ); - buttonsizer->Add( m_printerButton, 0, wxLEFT|wxRIGHT, 10 ); - if ( !m_pageData.GetEnablePrinter() ) - m_printerButton->Enable(false); - } - else - { - m_printerButton = NULL; - } - - // if (m_printData.GetEnableHelp()) - // wxButton *helpButton = new wxButton(this, (wxFunction)wxGenericPageSetupHelpProc, _("Help"), wxDefaultCoord, wxDefaultCoord, buttonWidth, buttonHeight); - mainsizer->Add( buttonsizer, 0, wxEXPAND|wxALL, 10 ); - - - SetAutoLayout( true ); - SetSizer( mainsizer ); - - mainsizer->Fit( this ); - Centre(wxBOTH); - - InitDialog(); - - delete[] choices; - delete [] choices2; -} - -wxGenericPageSetupDialog::~wxGenericPageSetupDialog() -{ -} - -wxPageSetupDialogData& wxGenericPageSetupDialog::GetPageSetupDialogData() -{ - return m_pageData; -} - -bool wxGenericPageSetupDialog::TransferDataToWindow() -{ - if (m_marginLeftText) - m_marginLeftText->SetValue(wxString::Format(wxT("%d"), m_pageData.GetMarginTopLeft().x)); - if (m_marginTopText) - m_marginTopText->SetValue(wxString::Format(wxT("%d"), m_pageData.GetMarginTopLeft().y)); - if (m_marginRightText) - m_marginRightText->SetValue(wxString::Format(wxT("%d"), m_pageData.GetMarginBottomRight().x)); - if (m_marginBottomText) - m_marginBottomText->SetValue(wxString::Format(wxT("%d"), m_pageData.GetMarginBottomRight().y)); - - if (m_orientationRadioBox) - { - if (m_pageData.GetPrintData().GetOrientation() == wxPORTRAIT) - m_orientationRadioBox->SetSelection(0); - else - m_orientationRadioBox->SetSelection(1); - } - - // Find the paper type from either the current paper size in the wxPageSetupDialogData, or - // failing that, the id in the wxPrintData object. - - wxPrintPaperType* type = wxThePrintPaperDatabase->FindPaperType( - wxSize(m_pageData.GetPaperSize().x * 10, m_pageData.GetPaperSize().y * 10)); - - if (!type && m_pageData.GetPrintData().GetPaperId() != wxPAPER_NONE) - type = wxThePrintPaperDatabase->FindPaperType(m_pageData.GetPrintData().GetPaperId()); - - if (type) - { - m_paperTypeChoice->SetStringSelection(type->GetName()); - } - - return true; -} - -bool wxGenericPageSetupDialog::TransferDataFromWindow() -{ - if (m_marginLeftText && m_marginTopText) - { - int left = wxAtoi( m_marginLeftText->GetValue().c_str() ); - int top = wxAtoi( m_marginTopText->GetValue().c_str() ); - m_pageData.SetMarginTopLeft( wxPoint(left,top) ); - } - if (m_marginRightText && m_marginBottomText) - { - int right = wxAtoi( m_marginRightText->GetValue().c_str() ); - int bottom = wxAtoi( m_marginBottomText->GetValue().c_str() ); - m_pageData.SetMarginBottomRight( wxPoint(right,bottom) ); - } - - if (m_orientationRadioBox) - { - int sel = m_orientationRadioBox->GetSelection(); - if (sel == 0) - { - m_pageData.GetPrintData().SetOrientation(wxPORTRAIT); - } - else - { - m_pageData.GetPrintData().SetOrientation(wxLANDSCAPE); - } - } - - if (m_paperTypeChoice) - { - int selectedItem = m_paperTypeChoice->GetSelection(); - if (selectedItem != -1) - { - wxPrintPaperType *paper = wxThePrintPaperDatabase->Item(selectedItem); - if ( paper ) - { - m_pageData.SetPaperSize(wxSize(paper->GetWidth()/10, paper->GetHeight()/10)); - m_pageData.GetPrintData().SetPaperId(paper->GetId()); - } - } - } - - return true; -} - -wxComboBox *wxGenericPageSetupDialog::CreatePaperTypeChoice(int *x, int *y) -{ -/* - if (!wxThePrintPaperDatabase) - { - wxThePrintPaperDatabase = new wxPrintPaperDatabase; - wxThePrintPaperDatabase->CreateDatabase(); - } -*/ - - size_t n = wxThePrintPaperDatabase->GetCount(); - wxString *choices = new wxString [n]; - - for (size_t i = 0; i < n; i++) - { - wxPrintPaperType *paper = wxThePrintPaperDatabase->Item(i); - choices[i] = paper->GetName(); - } - - (void) new wxStaticText(this, wxPRINTID_STATIC, _("Paper size"), wxPoint(*x, *y)); - *y += 25; - - wxComboBox *choice = new wxComboBox( this, - wxPRINTID_PAPERSIZE, - _("Paper Size"), - wxPoint(*x, *y), - wxSize(300, wxDefaultCoord), - n, choices ); - *y += 35; - delete[] choices; - -// choice->SetSelection(sel); - return choice; -} - -void wxGenericPageSetupDialog::OnPrinter(wxCommandEvent& WXUNUSED(event)) -{ - // We no longer query GetPrintMode, so we can eliminate the need - // to call SetPrintMode. - // This has the limitation that we can't explicitly call the PostScript - // print setup dialog from the generic Page Setup dialog under Windows, - // but since this choice would only happen when trying to do PostScript - // printing under Windows (and only in 16-bit Windows which - // doesn't have a Windows-specific page setup dialog) it's worth it. - - // First save the current settings, so the wxPrintData object is up to date. - TransferDataFromWindow(); - - // Transfer the current print settings from this dialog to the page setup dialog. - -#if 0 - // Use print factory later - - wxPrintDialogData data; - data = GetPageSetupData().GetPrintData(); - data.SetSetupDialog(true); - wxPrintDialog printDialog(this, & data); - printDialog.ShowModal(); - - // Transfer the page setup print settings from the page dialog to this dialog again, in case - // the page setup dialog changed something. - GetPageSetupData().GetPrintData() = printDialog.GetPrintDialogData().GetPrintData(); - GetPageSetupData().CalculatePaperSizeFromId(); // Make sure page size reflects the id in wxPrintData - - // Now update the dialog in case the page setup dialog changed some of our settings. - TransferDataToWindow(); -#endif -} - -#endif diff --git a/wxWidgets/src/generic/progdlgg.cpp b/wxWidgets/src/generic/progdlgg.cpp deleted file mode 100644 index 9920b4ce34..0000000000 --- a/wxWidgets/src/generic/progdlgg.cpp +++ /dev/null @@ -1,673 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/generic/progdlgg.cpp -// Purpose: wxProgressDialog class -// Author: Karsten Ballueder -// Modified by: -// Created: 09.05.1999 -// RCS-ID: $Id: progdlgg.cpp 50711 2007-12-15 02:57:58Z VZ $ -// Copyright: (c) Karsten Ballueder -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_PROGRESSDLG - -#ifndef WX_PRECOMP - #include "wx/utils.h" - #include "wx/frame.h" - #include "wx/button.h" - #include "wx/stattext.h" - #include "wx/sizer.h" - #include "wx/event.h" - #include "wx/gauge.h" - #include "wx/intl.h" - #include "wx/dcclient.h" - #include "wx/timer.h" - #include "wx/settings.h" -#endif - -#include "wx/progdlg.h" - -// --------------------------------------------------------------------------- -// macros -// --------------------------------------------------------------------------- - -/* Macro for avoiding #ifdefs when value have to be different depending on size of - device we display on - take it from something like wxDesktopPolicy in the future - */ - -#if defined(__SMARTPHONE__) - #define wxLARGESMALL(large,small) small -#else - #define wxLARGESMALL(large,small) large -#endif - -// ---------------------------------------------------------------------------- -// constants -// ---------------------------------------------------------------------------- - -#define LAYOUT_MARGIN wxLARGESMALL(8,2) - -static const int wxID_SKIP = 32000; // whatever - -// ---------------------------------------------------------------------------- -// private functions -// ---------------------------------------------------------------------------- - -// update the label to show the given time (in seconds) -static void SetTimeLabel(unsigned long val, wxStaticText *label); - -// ---------------------------------------------------------------------------- -// event tables -// ---------------------------------------------------------------------------- - -BEGIN_EVENT_TABLE(wxProgressDialog, wxDialog) - EVT_BUTTON(wxID_CANCEL, wxProgressDialog::OnCancel) - EVT_BUTTON(wxID_SKIP, wxProgressDialog::OnSkip) - - EVT_CLOSE(wxProgressDialog::OnClose) -END_EVENT_TABLE() - -IMPLEMENT_CLASS(wxProgressDialog, wxDialog) - -// ============================================================================ -// wxProgressDialog implementation -// ============================================================================ - -// ---------------------------------------------------------------------------- -// wxProgressDialog creation -// ---------------------------------------------------------------------------- - -wxProgressDialog::wxProgressDialog(wxString const &title, - wxString const &message, - int maximum, - wxWindow *parent, - int style) - : wxDialog(parent, wxID_ANY, title), - m_skip(false), - m_delay(3), - m_hasAbortButton(false), - m_hasSkipButton(false) -{ - // we may disappear at any moment, let the others know about it - SetExtraStyle(GetExtraStyle() | wxWS_EX_TRANSIENT); - m_windowStyle |= style; - - m_hasAbortButton = (style & wxPD_CAN_ABORT) != 0; - m_hasSkipButton = (style & wxPD_CAN_SKIP) != 0; - - bool isPda = (wxSystemSettings::GetScreenType() <= wxSYS_SCREEN_PDA); - -#if defined(__WXMSW__) && !defined(__WXUNIVERSAL__) - // we have to remove the "Close" button from the title bar then as it is - // confusing to have it - it doesn't work anyhow - // - // FIXME: should probably have a (extended?) window style for this - if ( !m_hasAbortButton ) - { - EnableCloseButton(false); - } -#endif // wxMSW - -#if defined(__SMARTPHONE__) - SetLeftMenu(); -#endif - - m_state = m_hasAbortButton ? Continue : Uncancelable; - m_maximum = maximum; - -#if defined(__WXMSW__) || defined(__WXPM__) - // we can't have values > 65,536 in the progress control under Windows, so - // scale everything down - m_factor = m_maximum / 65536 + 1; - m_maximum /= m_factor; -#endif // __WXMSW__ - - m_parentTop = wxGetTopLevelParent(parent); - - wxClientDC dc(this); - dc.SetFont(wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT)); - long widthText = 0; - dc.GetTextExtent(message, &widthText, NULL, NULL, NULL, NULL); - - wxBoxSizer *sizer = new wxBoxSizer(wxVERTICAL); - - m_msg = new wxStaticText(this, wxID_ANY, message); - sizer->Add(m_msg, 0, wxLEFT | wxTOP, 2*LAYOUT_MARGIN); - - wxSize sizeDlg, - sizeLabel = m_msg->GetSize(); - sizeDlg.y = 2*LAYOUT_MARGIN + sizeLabel.y; - - if ( maximum > 0 ) - { - int gauge_style = wxGA_HORIZONTAL; - if ( ( style & wxPD_SMOOTH ) == wxPD_SMOOTH ) - gauge_style |= wxGA_SMOOTH; - m_gauge = new wxGauge(this, wxID_ANY, m_maximum, - wxDefaultPosition, wxDefaultSize, - gauge_style ); - - sizer->Add(m_gauge, 0, wxLEFT | wxRIGHT | wxTOP | wxEXPAND, 2*LAYOUT_MARGIN); - m_gauge->SetValue(0); - - wxSize sizeGauge = m_gauge->GetSize(); - sizeDlg.y += 2*LAYOUT_MARGIN + sizeGauge.y; - } - else - m_gauge = (wxGauge *)NULL; - - // create the estimated/remaining/total time zones if requested - m_elapsed = m_estimated = m_remaining = (wxStaticText*)NULL; - m_display_estimated = m_last_timeupdate = m_break = 0; - m_ctdelay = 0; - - // if we are going to have at least one label, remember it in this var - wxStaticText *label = NULL; - - // also count how many labels we really have - size_t nTimeLabels = 0; - - if ( style & wxPD_ELAPSED_TIME ) - { - nTimeLabels++; - - label = - m_elapsed = CreateLabel(_("Elapsed time : "), sizer); - } - - if ( style & wxPD_ESTIMATED_TIME ) - { - nTimeLabels++; - - label = - m_estimated = CreateLabel(_("Estimated time : "), sizer); - } - - if ( style & wxPD_REMAINING_TIME ) - { - nTimeLabels++; - - label = - m_remaining = CreateLabel(_("Remaining time : "), sizer); - } - - if ( nTimeLabels > 0 ) - { - // set it to the current time - m_timeStart = wxGetCurrentTime(); - sizeDlg.y += nTimeLabels * (label->GetSize().y + LAYOUT_MARGIN); - } - -#if defined(__SMARTPHONE__) - if ( m_hasSkipButton ) - SetRightMenu(wxID_SKIP, _("Skip")); - if ( m_hasAbortButton ) - SetLeftMenu(wxID_CANCEL); -#else - m_btnAbort = m_btnSkip = (wxButton *)NULL; - bool sizeDlgModified = false; - wxBoxSizer *buttonSizer = new wxBoxSizer(wxHORIZONTAL); - - const int sizerFlags = -#if defined(__WXMSW__) || defined(__WXPM__) - wxALIGN_RIGHT | wxALL -#else // !MSW - wxALIGN_CENTER_HORIZONTAL | wxBOTTOM | wxTOP -#endif // MSW/!MSW - ; - - if ( m_hasSkipButton ) - { - m_btnSkip = new wxButton(this, wxID_SKIP, _("Skip")); - - // Windows dialogs usually have buttons in the lower right corner - buttonSizer->Add(m_btnSkip, 0, sizerFlags, LAYOUT_MARGIN); - sizeDlg.y += 2*LAYOUT_MARGIN + wxButton::GetDefaultSize().y; - sizeDlgModified = true; - } - - if ( m_hasAbortButton ) - { - m_btnAbort = new wxButton(this, wxID_CANCEL); - - // Windows dialogs usually have buttons in the lower right corner - buttonSizer->Add(m_btnAbort, 0, sizerFlags, LAYOUT_MARGIN); - if(!sizeDlgModified) - sizeDlg.y += 2*LAYOUT_MARGIN + wxButton::GetDefaultSize().y; - } - - sizer->Add(buttonSizer, 0, sizerFlags, LAYOUT_MARGIN ); -#endif // __SMARTPHONE__/!__SMARTPHONE__ - - SetSizerAndFit(sizer); - - if (!isPda) - { - sizeDlg.y += 2*LAYOUT_MARGIN; - - // try to make the dialog not square but rectangular of reasonable width - sizeDlg.x = (wxCoord)wxMax(3*widthText/2, 4*sizeDlg.y/3); - SetClientSize(sizeDlg); - } - - Centre(wxCENTER_FRAME | wxBOTH); - - if ( style & wxPD_APP_MODAL ) - { - m_winDisabler = new wxWindowDisabler(this); - } - else - { - if ( m_parentTop ) - m_parentTop->Disable(); - m_winDisabler = NULL; - } - - Show(); - Enable(); - - // this one can be initialized even if the others are unknown for now - // - // NB: do it after calling Layout() to keep the labels correctly aligned - if ( m_elapsed ) - { - SetTimeLabel(0, m_elapsed); - } - - Update(); -} - -wxStaticText *wxProgressDialog::CreateLabel(const wxString& text, - wxSizer *sizer) -{ - wxBoxSizer *locsizer = new wxBoxSizer(wxLARGESMALL(wxHORIZONTAL,wxVERTICAL)); - - wxStaticText *dummy = new wxStaticText(this, wxID_ANY, text); - wxStaticText *label = new wxStaticText(this, wxID_ANY, _("unknown")); - - // select placement most native or nice on target GUI -#if defined(__SMARTPHONE__) - // label and time to the left in two rows - locsizer->Add(dummy, 1, wxALIGN_LEFT); - locsizer->Add(label, 1, wxALIGN_LEFT); - sizer->Add(locsizer, 0, wxALIGN_LEFT | wxTOP | wxLEFT, LAYOUT_MARGIN); -#elif defined(__WXMSW__) || defined(__WXPM__) || defined(__WXMAC__) || defined(__WXGTK20__) - // label and time centered in one row - locsizer->Add(dummy, 1, wxLARGESMALL(wxALIGN_RIGHT,wxALIGN_LEFT)); - locsizer->Add(label, 1, wxALIGN_LEFT | wxLEFT, LAYOUT_MARGIN); - sizer->Add(locsizer, 0, wxALIGN_CENTER_HORIZONTAL | wxTOP, LAYOUT_MARGIN); -#else - // label and time to the right in one row - sizer->Add(locsizer, 0, wxALIGN_RIGHT | wxRIGHT | wxTOP, LAYOUT_MARGIN); - locsizer->Add(dummy); - locsizer->Add(label, 0, wxLEFT, LAYOUT_MARGIN); -#endif - - return label; -} - -// ---------------------------------------------------------------------------- -// wxProgressDialog operations -// ---------------------------------------------------------------------------- - -bool -wxProgressDialog::Update(int value, const wxString& newmsg, bool *skip) -{ - wxASSERT_MSG( value == -1 || m_gauge, wxT("cannot update non existent dialog") ); - -#ifdef __WXMSW__ - value /= m_factor; -#endif // __WXMSW__ - - wxASSERT_MSG( value <= m_maximum, wxT("invalid progress value") ); - - if ( m_gauge ) - m_gauge->SetValue(value); - - UpdateMessage(newmsg); - - if ( (m_elapsed || m_remaining || m_estimated) && (value != 0) ) - { - unsigned long elapsed = wxGetCurrentTime() - m_timeStart; - if ( m_last_timeupdate < elapsed - || value == m_maximum - ) - { - m_last_timeupdate = elapsed; - unsigned long estimated = m_break + - (unsigned long)(( (double) (elapsed-m_break) * m_maximum ) / ((double)value)) ; - if ( estimated > m_display_estimated - && m_ctdelay >= 0 - ) - { - ++m_ctdelay; - } - else if ( estimated < m_display_estimated - && m_ctdelay <= 0 - ) - { - --m_ctdelay; - } - else - { - m_ctdelay = 0; - } - if ( m_ctdelay >= m_delay // enough confirmations for a higher value - || m_ctdelay <= (m_delay*-1) // enough confirmations for a lower value - || value == m_maximum // to stay consistent - || elapsed > m_display_estimated // to stay consistent - || ( elapsed > 0 && elapsed < 4 ) // additional updates in the beginning - ) - { - m_display_estimated = estimated; - m_ctdelay = 0; - } - } - - long display_remaining = m_display_estimated - elapsed; - if ( display_remaining < 0 ) - { - display_remaining = 0; - } - - SetTimeLabel(elapsed, m_elapsed); - SetTimeLabel(m_display_estimated, m_estimated); - SetTimeLabel(display_remaining, m_remaining); - } - - if ( value == m_maximum ) - { - if ( m_state == Finished ) - { - // ignore multiple calls to Update(m_maximum): it may sometimes be - // troublesome to ensure that Update() is not called twice with the - // same value (e.g. because of the rounding errors) and if we don't - // return now we're going to generate asserts below - return true; - } - - // so that we return true below and that out [Cancel] handler knew what - // to do - m_state = Finished; - if( !(GetWindowStyle() & wxPD_AUTO_HIDE) ) - { - EnableClose(); - DisableSkip(); -#if defined(__WXMSW__) && !defined(__WXUNIVERSAL__) - EnableCloseButton(); -#endif // __WXMSW__ - - if ( newmsg.empty() ) - { - // also provide the finishing message if the application didn't - m_msg->SetLabel(_("Done.")); - } - - wxYieldIfNeeded() ; - - (void)ShowModal(); - } - else // auto hide - { - // reenable other windows before hiding this one because otherwise - // Windows wouldn't give the focus back to the window which had - // been previously focused because it would still be disabled - ReenableOtherWindows(); - - Hide(); - } - } - else // not at maximum yet - { - return DoAfterUpdate(skip); - } - - // update the display in case yielding above didn't do it - Update(); - - return m_state != Canceled; -} - -bool wxProgressDialog::Pulse(const wxString& newmsg, bool *skip) -{ - wxASSERT_MSG( m_gauge, wxT("cannot update non existent dialog") ); - - // show a bit of progress - m_gauge->Pulse(); - - UpdateMessage(newmsg); - - if (m_elapsed || m_remaining || m_estimated) - { - unsigned long elapsed = wxGetCurrentTime() - m_timeStart; - - SetTimeLabel(elapsed, m_elapsed); - SetTimeLabel((unsigned long)-1, m_estimated); - SetTimeLabel((unsigned long)-1, m_remaining); - } - - return DoAfterUpdate(skip); -} - -bool wxProgressDialog::DoAfterUpdate(bool *skip) -{ - // we have to yield because not only we want to update the display but - // also to process the clicks on the cancel and skip buttons - wxYieldIfNeeded(); - - Update(); - - if ( m_skip && skip && !*skip ) - { - *skip = true; - m_skip = false; - EnableSkip(); - } - - return m_state != Canceled; -} - -void wxProgressDialog::Resume() -{ - m_state = Continue; - m_ctdelay = m_delay; // force an update of the elapsed/estimated/remaining time - m_break += wxGetCurrentTime()-m_timeStop; - - EnableAbort(); - EnableSkip(); - m_skip = false; -} - -bool wxProgressDialog::Show( bool show ) -{ - // reenable other windows before hiding this one because otherwise - // Windows wouldn't give the focus back to the window which had - // been previously focused because it would still be disabled - if(!show) - ReenableOtherWindows(); - - return wxDialog::Show(show); -} - -// ---------------------------------------------------------------------------- -// event handlers -// ---------------------------------------------------------------------------- - -void wxProgressDialog::OnCancel(wxCommandEvent& event) -{ - if ( m_state == Finished ) - { - // this means that the count down is already finished and we're being - // shown as a modal dialog - so just let the default handler do the job - event.Skip(); - } - else - { - // request to cancel was received, the next time Update() is called we - // will handle it - m_state = Canceled; - - // update the buttons state immediately so that the user knows that the - // request has been noticed - DisableAbort(); - DisableSkip(); - - // save the time when the dialog was stopped - m_timeStop = wxGetCurrentTime(); - } -} - -void wxProgressDialog::OnSkip(wxCommandEvent& WXUNUSED(event)) -{ - DisableSkip(); - m_skip = true; -} - -void wxProgressDialog::OnClose(wxCloseEvent& event) -{ - if ( m_state == Uncancelable ) - { - // can't close this dialog - event.Veto(); - } - else if ( m_state == Finished ) - { - // let the default handler close the window as we already terminated - event.Skip(); - } - else - { - // next Update() will notice it - m_state = Canceled; - DisableAbort(); - DisableSkip(); - - m_timeStop = wxGetCurrentTime(); - } -} - -// ---------------------------------------------------------------------------- -// destruction -// ---------------------------------------------------------------------------- - -wxProgressDialog::~wxProgressDialog() -{ - // normally this should have been already done, but just in case - ReenableOtherWindows(); -} - -void wxProgressDialog::ReenableOtherWindows() -{ - if ( GetWindowStyle() & wxPD_APP_MODAL ) - { - delete m_winDisabler; - m_winDisabler = (wxWindowDisabler *)NULL; - } - else - { - if ( m_parentTop ) - m_parentTop->Enable(); - } -} - -// ---------------------------------------------------------------------------- -// private functions -// ---------------------------------------------------------------------------- - -static void SetTimeLabel(unsigned long val, wxStaticText *label) -{ - if ( label ) - { - wxString s; - - if (val != (unsigned long)-1) - { - unsigned long hours = val / 3600; - unsigned long minutes = (val % 3600) / 60; - unsigned long seconds = val % 60; - s.Printf(wxT("%lu:%02lu:%02lu"), hours, minutes, seconds); - } - else - { - s = _("Unknown"); - } - - if ( s != label->GetLabel() ) - label->SetLabel(s); - } -} - -void wxProgressDialog::EnableSkip(bool enable) -{ - if(m_hasSkipButton) - { -#ifdef __SMARTPHONE__ - if(enable) - SetRightMenu(wxID_SKIP, _("Skip")); - else - SetRightMenu(); -#else - if(m_btnSkip) - m_btnSkip->Enable(enable); -#endif - } -} - -void wxProgressDialog::EnableAbort(bool enable) -{ - if(m_hasAbortButton) - { -#ifdef __SMARTPHONE__ - if(enable) - SetLeftMenu(wxID_CANCEL); // stock buttons makes Cancel label - else - SetLeftMenu(); -#else - if(m_btnAbort) - m_btnAbort->Enable(enable); -#endif - } -} - -void wxProgressDialog::EnableClose() -{ - if(m_hasAbortButton) - { -#ifdef __SMARTPHONE__ - SetLeftMenu(wxID_CANCEL, _("Close")); -#else - if(m_btnAbort) - { - m_btnAbort->Enable(); - m_btnAbort->SetLabel(_("Close")); - } -#endif - } -} - -void wxProgressDialog::UpdateMessage(const wxString &newmsg) -{ - if ( !newmsg.empty() && newmsg != m_msg->GetLabel() ) - { - m_msg->SetLabel(newmsg); - - wxYieldIfNeeded() ; - } -} - -#endif // wxUSE_PROGRESSDLG diff --git a/wxWidgets/src/generic/propdlg.cpp b/wxWidgets/src/generic/propdlg.cpp deleted file mode 100644 index a994449b4f..0000000000 --- a/wxWidgets/src/generic/propdlg.cpp +++ /dev/null @@ -1,226 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/generic/propdlg.cpp -// Purpose: wxPropertySheetDialog -// Author: Julian Smart -// Modified by: -// Created: 2005-03-12 -// RCS-ID: $Id: propdlg.cpp 41838 2006-10-09 21:08:45Z VZ $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_BOOKCTRL - -#ifndef WX_PRECOMP - #include "wx/button.h" - #include "wx/sizer.h" - #include "wx/intl.h" - #include "wx/log.h" - #include "wx/msgdlg.h" -#endif - -#include "wx/bookctrl.h" - -#if wxUSE_NOTEBOOK -#include "wx/notebook.h" -#endif -#if wxUSE_CHOICEBOOK -#include "wx/choicebk.h" -#endif -#if wxUSE_TOOLBOOK -#include "wx/toolbook.h" -#endif -#if wxUSE_LISTBOOK -#include "wx/listbook.h" -#endif -#if wxUSE_TREEBOOK -#include "wx/treebook.h" -#endif - -#include "wx/generic/propdlg.h" -#include "wx/sysopt.h" - -//----------------------------------------------------------------------------- -// wxPropertySheetDialog -//----------------------------------------------------------------------------- - -IMPLEMENT_DYNAMIC_CLASS(wxPropertySheetDialog, wxDialog) - -BEGIN_EVENT_TABLE(wxPropertySheetDialog, wxDialog) - EVT_ACTIVATE(wxPropertySheetDialog::OnActivate) - EVT_IDLE(wxPropertySheetDialog::OnIdle) -END_EVENT_TABLE() - -bool wxPropertySheetDialog::Create(wxWindow* parent, wxWindowID id, const wxString& title, - const wxPoint& pos, const wxSize& sz, long style, - const wxString& name) -{ - if (!wxDialog::Create(parent, id, title, pos, sz, style|wxCLIP_CHILDREN, name)) - return false; - - wxBoxSizer *topSizer = new wxBoxSizer( wxVERTICAL ); - SetSizer(topSizer); - - // This gives more space around the edges - m_innerSizer = new wxBoxSizer( wxVERTICAL ); - -#if defined(__SMARTPHONE__) || defined(__POCKETPC__) - m_sheetOuterBorder = 0; -#endif - topSizer->Add(m_innerSizer, 1, wxGROW|wxALL, m_sheetOuterBorder); - - m_bookCtrl = CreateBookCtrl(); - AddBookCtrl(m_innerSizer); - - return true; -} - -void wxPropertySheetDialog::Init() -{ - m_sheetStyle = wxPROPSHEET_DEFAULT; - m_innerSizer = NULL; - m_bookCtrl = NULL; - m_sheetOuterBorder = 2; - m_sheetInnerBorder = 5; -} - -// Layout the dialog, to be called after pages have been created -void wxPropertySheetDialog::LayoutDialog(int centreFlags) -{ -#if !defined(__SMARTPHONE__) && !defined(__POCKETPC__) - GetSizer()->Fit(this); - GetSizer()->SetSizeHints(this); - if (centreFlags) - Centre(centreFlags); -#else - wxUnusedVar(centreFlags); -#endif -#if defined(__SMARTPHONE__) - if (m_bookCtrl) - m_bookCtrl->SetFocus(); -#endif -} - -// Creates the buttons, if any -void wxPropertySheetDialog::CreateButtons(int flags) -{ -#ifdef __POCKETPC__ - // keep system option status - const wxChar *optionName = wxT("wince.dialog.real-ok-cancel"); - const int status = wxSystemOptions::GetOptionInt(optionName); - wxSystemOptions::SetOption(optionName,0); -#endif - - wxSizer *buttonSizer = CreateButtonSizer( flags & ButtonSizerFlags ); - if( buttonSizer ) - { - m_innerSizer->Add( buttonSizer, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxLEFT|wxRIGHT, 2); - m_innerSizer->AddSpacer(2); - } - -#ifdef __POCKETPC__ - // restore system option - wxSystemOptions::SetOption(optionName,status); -#endif -} - -// Creates the book control -wxBookCtrlBase* wxPropertySheetDialog::CreateBookCtrl() -{ - int style = wxCLIP_CHILDREN | wxBK_DEFAULT; - - wxBookCtrlBase* bookCtrl = NULL; - -#if wxUSE_NOTEBOOK - if (GetSheetStyle() & wxPROPSHEET_NOTEBOOK) - bookCtrl = new wxNotebook(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, style ); -#endif -#if wxUSE_CHOICEBOOK - if (GetSheetStyle() & wxPROPSHEET_CHOICEBOOK) - bookCtrl = new wxChoicebook(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, style ); -#endif -#if wxUSE_TOOLBOOK -#if defined(__WXMAC__) && wxUSE_TOOLBAR && wxUSE_BMPBUTTON - if (GetSheetStyle() & wxPROPSHEET_BUTTONTOOLBOOK) - bookCtrl = new wxToolbook(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, style|wxBK_BUTTONBAR ); - else -#endif - if ((GetSheetStyle() & wxPROPSHEET_TOOLBOOK) || (GetSheetStyle() & wxPROPSHEET_BUTTONTOOLBOOK)) - bookCtrl = new wxToolbook(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, style ); -#endif -#if wxUSE_LISTBOOK - if (GetSheetStyle() & wxPROPSHEET_LISTBOOK) - bookCtrl = new wxListbook(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, style ); -#endif -#if wxUSE_TREEBOOK - if (GetSheetStyle() & wxPROPSHEET_TREEBOOK) - bookCtrl = new wxTreebook(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, style ); -#endif - if (!bookCtrl) - bookCtrl = new wxBookCtrl(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, style ); - - if (GetSheetStyle() & wxPROPSHEET_SHRINKTOFIT) - bookCtrl->SetFitToCurrentPage(true); - - return bookCtrl; -} - -// Adds the book control to the inner sizer. -void wxPropertySheetDialog::AddBookCtrl(wxSizer* sizer) -{ -#if defined(__POCKETPC__) && wxUSE_NOTEBOOK - // The book control has to be sized larger than the dialog because of a border bug - // in WinCE - int borderSize = -2; - sizer->Add( m_bookCtrl, 1, wxGROW|wxALIGN_CENTER_VERTICAL|wxLEFT|wxTOP|wxRIGHT, borderSize ); -#else - sizer->Add( m_bookCtrl, 1, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, m_sheetInnerBorder ); -#endif -} - -void wxPropertySheetDialog::OnActivate(wxActivateEvent& event) -{ -#if defined(__SMARTPHONE__) - // Attempt to focus the choice control: not yet working, but might - // be a step in the right direction. OnActivate overrides the default - // handler in toplevel.cpp that sets the focus for the first child of - // of the dialog (the choicebook). - if (event.GetActive()) - { - wxChoicebook* choiceBook = wxDynamicCast(GetBookCtrl(), wxChoicebook); - if (choiceBook) - choiceBook->SetFocus(); - } - else -#endif - event.Skip(); -} - -// Resize dialog if necessary -void wxPropertySheetDialog::OnIdle(wxIdleEvent& event) -{ - event.Skip(); - - if ((GetSheetStyle() & wxPROPSHEET_SHRINKTOFIT) && GetBookCtrl()) - { - int sel = GetBookCtrl()->GetSelection(); - if (sel != -1 && sel != m_selectedPage) - { - GetBookCtrl()->InvalidateBestSize(); - InvalidateBestSize(); - SetSizeHints(-1, -1, -1, -1); - - m_selectedPage = sel; - LayoutDialog(0); - } - } -} - -#endif // wxUSE_BOOKCTRL diff --git a/wxWidgets/src/generic/regiong.cpp b/wxWidgets/src/generic/regiong.cpp deleted file mode 100644 index 4d1a057ac7..0000000000 --- a/wxWidgets/src/generic/regiong.cpp +++ /dev/null @@ -1,1919 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/generic/region.cpp -// Purpose: generic wxRegion class -// Author: David Elliott -// Modified by: -// Created: 2004/04/12 -// RCS-ID: $Id: regiong.cpp 41444 2006-09-25 18:18:26Z VZ $ -// Copyright: (c) 2004 David Elliott -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#include "wx/region.h" - -#ifndef WX_PRECOMP - #include "wx/utils.h" -#endif - -// ======================================================================== -// Classes to interface with X.org code -// ======================================================================== - -typedef struct Box -{ - wxCoord x1, x2, y1, y2; -} Box, BOX, BoxRec, *BoxPtr; - -typedef struct REGION *Region; - -struct REGION -{ -public: - // Default constructor initializes nothing - REGION() {} - - REGION(const wxRect& rect) - { - rects = &extents; - numRects = 1; - extents.x1 = rect.x; - extents.y1 = rect.y; - extents.x2 = rect.x + rect.width; - extents.y2 = rect.y + rect.height; - size = 1; - } - - BoxPtr GetBox(int i) - { - return i < numRects ? rects + i : NULL; - } - - // X.org methods - static bool XClipBox( - Region r, - wxRect *rect); - static bool XOffsetRegion( - register Region pRegion, - register int x, - register int y); - static bool XIntersectRegion( - Region reg1, - Region reg2, /* source regions */ - register Region newReg); /* destination Region */ - static bool XUnionRegion( - Region reg1, - Region reg2, /* source regions */ - Region newReg); /* destination Region */ - static bool XSubtractRegion( - Region regM, - Region regS, - register Region regD); - static bool XXorRegion(Region sra, Region srb, Region dr); - static bool XEmptyRegion( - Region r); - static bool XEqualRegion(Region r1, Region r2); - static bool XPointInRegion( - Region pRegion, - int x, int y); - static wxRegionContain XRectInRegion( - register Region region, - int rx, int ry, - unsigned int rwidth, unsigned int rheight); - -protected: - static Region XCreateRegion(void); - static void miSetExtents ( - Region pReg); - static bool XDestroyRegion(Region r); - static int miIntersectO ( - register Region pReg, - register BoxPtr r1, - BoxPtr r1End, - register BoxPtr r2, - BoxPtr r2End, - wxCoord y1, - wxCoord y2); - static void miRegionCopy( - register Region dstrgn, - register Region rgn); - static int miCoalesce( - register Region pReg, /* Region to coalesce */ - int prevStart, /* Index of start of previous band */ - int curStart); /* Index of start of current band */ - static void miRegionOp( - register Region newReg, /* Place to store result */ - Region reg1, /* First region in operation */ - Region reg2, /* 2d region in operation */ - int (*overlapFunc)( - register Region pReg, - register BoxPtr r1, - BoxPtr r1End, - register BoxPtr r2, - BoxPtr r2End, - wxCoord y1, - wxCoord y2), /* Function to call for over- - * lapping bands */ - int (*nonOverlap1Func)( - register Region pReg, - register BoxPtr r, - BoxPtr rEnd, - register wxCoord y1, - register wxCoord y2), /* Function to call for non- - * overlapping bands in region - * 1 */ - int (*nonOverlap2Func)( - register Region pReg, - register BoxPtr r, - BoxPtr rEnd, - register wxCoord y1, - register wxCoord y2)); /* Function to call for non- - * overlapping bands in region - * 2 */ - static int miUnionNonO ( - register Region pReg, - register BoxPtr r, - BoxPtr rEnd, - register wxCoord y1, - register wxCoord y2); - static int miUnionO ( - register Region pReg, - register BoxPtr r1, - BoxPtr r1End, - register BoxPtr r2, - BoxPtr r2End, - register wxCoord y1, - register wxCoord y2); - static int miSubtractNonO1 ( - register Region pReg, - register BoxPtr r, - BoxPtr rEnd, - register wxCoord y1, - register wxCoord y2); - static int miSubtractO ( - register Region pReg, - register BoxPtr r1, - BoxPtr r1End, - register BoxPtr r2, - BoxPtr r2End, - register wxCoord y1, - register wxCoord y2); -protected: - long size; - long numRects; - Box *rects; - Box extents; -}; - -// ======================================================================== -// wxRegionRefData -// ======================================================================== - -class wxRegionRefData : public wxObjectRefData, - public REGION -{ -public: - wxRegionRefData() - : wxObjectRefData(), - REGION() - { - size = 1; - numRects = 0; - rects = ( BOX * )malloc( (unsigned) sizeof( BOX )); - extents.x1 = 0; - extents.x2 = 0; - extents.y1 = 0; - extents.y2 = 0; - } - - wxRegionRefData(const wxPoint& topLeft, const wxPoint& bottomRight) - : wxObjectRefData(), - REGION() - { - rects = (BOX*)malloc(sizeof(BOX)); - size = 1; - numRects = 1; - extents.x1 = topLeft.x; - extents.y1 = topLeft.y; - extents.x2 = bottomRight.x; - extents.y2 = bottomRight.y; - *rects = extents; - } - - wxRegionRefData(const wxRect& rect) - : wxObjectRefData(), - REGION(rect) - { - rects = (BOX*)malloc(sizeof(BOX)); - *rects = extents; - } - - wxRegionRefData(const wxRegionRefData& refData) - : wxObjectRefData(), - REGION() - { - size = refData.size; - numRects = refData.numRects; - rects = (Box*)malloc(numRects*sizeof(Box)); - memcpy(rects, refData.rects, numRects*sizeof(Box)); - extents = refData.extents; - } - - virtual ~wxRegionRefData() - { - free(rects); - } - -private: - // Don't allow this - wxRegionRefData(const REGION&); -}; - -// ======================================================================== -// wxRegionGeneric -// ======================================================================== -//IMPLEMENT_DYNAMIC_CLASS(wxRegionGeneric, wxGDIObject) - -#define M_REGIONDATA ((wxRegionRefData *)m_refData) -#define M_REGIONDATA_OF(rgn) ((wxRegionRefData *)(rgn.m_refData)) - -// ---------------------------------------------------------------------------- -// wxRegionGeneric construction -// ---------------------------------------------------------------------------- - -wxRegionGeneric::wxRegionGeneric() -{ -} - -wxRegionGeneric::~wxRegionGeneric() -{ -} - -wxRegionGeneric::wxRegionGeneric(wxCoord x, wxCoord y, wxCoord w, wxCoord h) -{ - m_refData = new wxRegionRefData(wxRect(x,y,w,h)); -} - -wxRegionGeneric::wxRegionGeneric(const wxRect& rect) -{ - m_refData = new wxRegionRefData(rect); -} - -wxRegionGeneric::wxRegionGeneric(const wxPoint& topLeft, const wxPoint& bottomRight) -{ - m_refData = new wxRegionRefData(topLeft, bottomRight); -} - -void wxRegionGeneric::Clear() -{ - UnRef(); -} - -wxObjectRefData *wxRegionGeneric::CreateRefData() const -{ - return new wxRegionRefData; -} - -wxObjectRefData *wxRegionGeneric::CloneRefData(const wxObjectRefData *data) const -{ - return new wxRegionRefData(*(wxRegionRefData *)data); -} - -bool wxRegionGeneric::DoIsEqual(const wxRegion& region) const -{ - return REGION::XEqualRegion(M_REGIONDATA,M_REGIONDATA_OF(region)); -} - -bool wxRegionGeneric::DoGetBox(wxCoord& x, wxCoord& y, wxCoord&w, wxCoord &h) const -{ - if ( !m_refData ) - return false; - - wxRect rect; - REGION::XClipBox(M_REGIONDATA,&rect); - x = rect.x; - y = rect.y; - w = rect.width; - h = rect.height; - return true; -} - -// ---------------------------------------------------------------------------- -// wxRegionGeneric operations -// ---------------------------------------------------------------------------- - -bool wxRegionGeneric::DoUnionWithRect(const wxRect& rect) -{ - if ( rect.IsEmpty() ) - { - // nothing to do - return true; - } - - AllocExclusive(); - REGION region(rect); - return REGION::XUnionRegion(®ion,M_REGIONDATA,M_REGIONDATA); -} - -bool wxRegionGeneric::DoUnionWithRegion(const wxRegion& region) -{ - AllocExclusive(); - return REGION::XUnionRegion(M_REGIONDATA_OF(region),M_REGIONDATA,M_REGIONDATA); -} - -bool wxRegionGeneric::DoIntersect(const wxRegion& region) -{ - AllocExclusive(); - return REGION::XIntersectRegion(M_REGIONDATA_OF(region),M_REGIONDATA,M_REGIONDATA); -} - -bool wxRegionGeneric::DoSubtract(const wxRegion& region) -{ - if ( region.IsEmpty() ) - { - // nothing to do - return true; - } - - return REGION::XSubtractRegion(M_REGIONDATA_OF(region),M_REGIONDATA,M_REGIONDATA); -} - -bool wxRegionGeneric::DoXor(const wxRegion& region) -{ - AllocExclusive(); - return REGION::XXorRegion(M_REGIONDATA_OF(region),M_REGIONDATA,M_REGIONDATA); -} - -bool wxRegionGeneric::DoOffset(wxCoord x, wxCoord y) -{ - AllocExclusive(); - return REGION::XOffsetRegion(M_REGIONDATA, x, y); -} - -// ---------------------------------------------------------------------------- -// wxRegionGeneric comparison -// ---------------------------------------------------------------------------- - -bool wxRegionGeneric::IsEmpty() const -{ - wxASSERT(m_refData); - return REGION::XEmptyRegion(M_REGIONDATA); -} - -// Does the region contain the point (x,y)? -wxRegionContain wxRegionGeneric::DoContainsPoint(wxCoord x, wxCoord y) const -{ - wxASSERT(m_refData); - return REGION::XPointInRegion(M_REGIONDATA,x,y) ? wxInRegion : wxOutRegion; -} - -// Does the region contain the rectangle rect? -wxRegionContain wxRegionGeneric::DoContainsRect(const wxRect& rect) const -{ - wxASSERT(m_refData); - return REGION::XRectInRegion(M_REGIONDATA,rect.x,rect.y,rect.width,rect.height); -} - -// ======================================================================== -// wxRegionIteratorGeneric -// ======================================================================== -//IMPLEMENT_DYNAMIC_CLASS(wxRegionIteratorGeneric,wxObject) - -wxRegionIteratorGeneric::wxRegionIteratorGeneric() -{ - m_current = 0; -} - -wxRegionIteratorGeneric::wxRegionIteratorGeneric(const wxRegionGeneric& region) -: m_region(region) -{ - m_current = 0; -} - -wxRegionIteratorGeneric::wxRegionIteratorGeneric(const wxRegionIteratorGeneric& iterator) -: m_region(iterator.m_region) -{ - m_current = iterator.m_current; -} - -void wxRegionIteratorGeneric::Reset(const wxRegionGeneric& region) -{ - m_region = region; - m_current = 0; -} - -bool wxRegionIteratorGeneric::HaveRects() const -{ - return M_REGIONDATA_OF(m_region)->GetBox(m_current); -} - -wxRegionIteratorGeneric& wxRegionIteratorGeneric::operator++() -{ - ++m_current; - return *this; -} - -wxRegionIteratorGeneric wxRegionIteratorGeneric::operator++(int) -{ - wxRegionIteratorGeneric copy(*this); - ++*this; - return copy; -} - -wxRect wxRegionIteratorGeneric::GetRect() const -{ - wxASSERT(m_region.m_refData); - const Box *box = M_REGIONDATA_OF(m_region)->GetBox(m_current); - wxASSERT(box); - return wxRect - ( box->x1 - , box->y1 - , box->x2 - box->x1 - , box->y2 - box->y1 - ); -} - -long wxRegionIteratorGeneric::GetX() const -{ - wxASSERT(m_region.m_refData); - const Box *box = M_REGIONDATA_OF(m_region)->GetBox(m_current); - wxASSERT(box); - return box->x1; -} - -long wxRegionIteratorGeneric::GetY() const -{ - wxASSERT(m_region.m_refData); - const Box *box = M_REGIONDATA_OF(m_region)->GetBox(m_current); - wxASSERT(box); - return box->y1; -} - -long wxRegionIteratorGeneric::GetW() const -{ - wxASSERT(m_region.m_refData); - const Box *box = M_REGIONDATA_OF(m_region)->GetBox(m_current); - wxASSERT(box); - return box->x2 - box->x1; -} - -long wxRegionIteratorGeneric::GetH() const -{ - wxASSERT(m_region.m_refData); - const Box *box = M_REGIONDATA_OF(m_region)->GetBox(m_current); - wxASSERT(box); - return box->y2 - box->y1; -} - -wxRegionIteratorGeneric::~wxRegionIteratorGeneric() -{ -} - - -// ======================================================================== -// The guts (from X.org) -// ======================================================================== - -/************************************************************************ - -Copyright 1987, 1988, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - -Copyright 1987, 1988 by Digital Equipment Corporation, Maynard, Massachusetts. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Digital not be -used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. - -DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING -ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL -DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR -ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -************************************************************************/ - -/* 1 if two BOXs overlap. - * 0 if two BOXs do not overlap. - * Remember, x2 and y2 are not in the region - */ -#define EXTENTCHECK(r1, r2) \ - ((r1)->x2 > (r2)->x1 && \ - (r1)->x1 < (r2)->x2 && \ - (r1)->y2 > (r2)->y1 && \ - (r1)->y1 < (r2)->y2) - -/* - * Check to see if there is enough memory in the present region. - */ -#define MEMCHECK(reg, rect, firstrect){\ - if ((reg)->numRects >= ((reg)->size - 1)){\ - (firstrect) = (BOX *) realloc \ - ((char *)(firstrect), (unsigned) (2 * (sizeof(BOX)) * ((reg)->size)));\ - if ((firstrect) == 0)\ - return(0);\ - (reg)->size *= 2;\ - (rect) = &(firstrect)[(reg)->numRects];\ - }\ - } - -#define EMPTY_REGION(pReg) pReg->numRects = 0 - -#define REGION_NOT_EMPTY(pReg) pReg->numRects - -#define INBOX(r, x, y) \ - ( ( ((r).x2 > x)) && \ - ( ((r).x1 <= x)) && \ - ( ((r).y2 > y)) && \ - ( ((r).y1 <= y)) ) - -/* - * The functions in this file implement the Region abstraction, similar to one - * used in the X11 sample server. A Region is simply an area, as the name - * implies, and is implemented as a "y-x-banded" array of rectangles. To - * explain: Each Region is made up of a certain number of rectangles sorted - * by y coordinate first, and then by x coordinate. - * - * Furthermore, the rectangles are banded such that every rectangle with a - * given upper-left y coordinate (y1) will have the same lower-right y - * coordinate (y2) and vice versa. If a rectangle has scanlines in a band, it - * will span the entire vertical distance of the band. This means that some - * areas that could be merged into a taller rectangle will be represented as - * several shorter rectangles to account for shorter rectangles to its left - * or right but within its "vertical scope". - * - * An added constraint on the rectangles is that they must cover as much - * horizontal area as possible. E.g. no two rectangles in a band are allowed - * to touch. - * - * Whenever possible, bands will be merged together to cover a greater vertical - * distance (and thus reduce the number of rectangles). Two bands can be merged - * only if the bottom of one touches the top of the other and they have - * rectangles in the same places (of the same width, of course). This maintains - * the y-x-banding that's so nice to have... - */ - -/* Create a new empty region */ -Region REGION::XCreateRegion(void) -{ - Region temp = new REGION; - - if (!temp) - return (Region) NULL; - - temp->rects = ( BOX * )malloc( (unsigned) sizeof( BOX )); - - if (!temp->rects) - { - free((char *) temp); - return (Region) NULL; - } - temp->numRects = 0; - temp->extents.x1 = 0; - temp->extents.y1 = 0; - temp->extents.x2 = 0; - temp->extents.y2 = 0; - temp->size = 1; - return( temp ); -} - -bool REGION::XClipBox(Region r, wxRect *rect) -{ - rect->x = r->extents.x1; - rect->y = r->extents.y1; - rect->width = r->extents.x2 - r->extents.x1; - rect->height = r->extents.y2 - r->extents.y1; - return true; -} - -/*- - *----------------------------------------------------------------------- - * miSetExtents -- - * Reset the extents of a region to what they should be. Called by - * miSubtract and miIntersect b/c they can't figure it out along the - * way or do so easily, as miUnion can. - * - * Results: - * None. - * - * Side Effects: - * The region's 'extents' structure is overwritten. - * - *----------------------------------------------------------------------- - */ -void REGION:: -miSetExtents (Region pReg) -{ - register BoxPtr pBox, - pBoxEnd, - pExtents; - - if (pReg->numRects == 0) - { - pReg->extents.x1 = 0; - pReg->extents.y1 = 0; - pReg->extents.x2 = 0; - pReg->extents.y2 = 0; - return; - } - - pExtents = &pReg->extents; - pBox = pReg->rects; - pBoxEnd = &pBox[pReg->numRects - 1]; - - /* - * Since pBox is the first rectangle in the region, it must have the - * smallest y1 and since pBoxEnd is the last rectangle in the region, - * it must have the largest y2, because of banding. Initialize x1 and - * x2 from pBox and pBoxEnd, resp., as good things to initialize them - * to... - */ - pExtents->x1 = pBox->x1; - pExtents->y1 = pBox->y1; - pExtents->x2 = pBoxEnd->x2; - pExtents->y2 = pBoxEnd->y2; - - assert(pExtents->y1 < pExtents->y2); - while (pBox <= pBoxEnd) - { - if (pBox->x1 < pExtents->x1) - { - pExtents->x1 = pBox->x1; - } - if (pBox->x2 > pExtents->x2) - { - pExtents->x2 = pBox->x2; - } - pBox++; - } - assert(pExtents->x1 < pExtents->x2); -} - -bool REGION:: -XDestroyRegion( - Region r) -{ - free( (char *) r->rects ); - delete r; - return true; -} - -/* TranslateRegion(pRegion, x, y) - translates in place - added by raymond -*/ - -bool REGION:: -XOffsetRegion( - register Region pRegion, - register int x, - register int y) -{ - register int nbox; - register BOX *pbox; - - pbox = pRegion->rects; - nbox = pRegion->numRects; - - while(nbox--) - { - pbox->x1 += x; - pbox->x2 += x; - pbox->y1 += y; - pbox->y2 += y; - pbox++; - } - pRegion->extents.x1 += x; - pRegion->extents.x2 += x; - pRegion->extents.y1 += y; - pRegion->extents.y2 += y; - return 1; -} - -/*====================================================================== - * Region Intersection - *====================================================================*/ -/*- - *----------------------------------------------------------------------- - * miIntersectO -- - * Handle an overlapping band for miIntersect. - * - * Results: - * None. - * - * Side Effects: - * Rectangles may be added to the region. - * - *----------------------------------------------------------------------- - */ -/* static void*/ -int REGION:: -miIntersectO ( - register Region pReg, - register BoxPtr r1, - BoxPtr r1End, - register BoxPtr r2, - BoxPtr r2End, - wxCoord y1, - wxCoord y2) -{ - register wxCoord x1; - register wxCoord x2; - register BoxPtr pNextRect; - - pNextRect = &pReg->rects[pReg->numRects]; - - while ((r1 != r1End) && (r2 != r2End)) - { - x1 = wxMax(r1->x1,r2->x1); - x2 = wxMin(r1->x2,r2->x2); - - /* - * If there's any overlap between the two rectangles, add that - * overlap to the new region. - * There's no need to check for subsumption because the only way - * such a need could arise is if some region has two rectangles - * right next to each other. Since that should never happen... - */ - if (x1 < x2) - { - assert(y1rects); - pNextRect->x1 = x1; - pNextRect->y1 = y1; - pNextRect->x2 = x2; - pNextRect->y2 = y2; - pReg->numRects += 1; - pNextRect++; - assert(pReg->numRects <= pReg->size); - } - - /* - * Need to advance the pointers. Shift the one that extends - * to the right the least, since the other still has a chance to - * overlap with that region's next rectangle, if you see what I mean. - */ - if (r1->x2 < r2->x2) - { - r1++; - } - else if (r2->x2 < r1->x2) - { - r2++; - } - else - { - r1++; - r2++; - } - } - return 0; /* lint */ -} - -bool REGION:: -XIntersectRegion( - Region reg1, - Region reg2, /* source regions */ - register Region newReg) /* destination Region */ -{ - /* check for trivial reject */ - if ( (!(reg1->numRects)) || (!(reg2->numRects)) || - (!EXTENTCHECK(®1->extents, ®2->extents))) - newReg->numRects = 0; - else - miRegionOp (newReg, reg1, reg2, - miIntersectO, NULL, NULL); - - /* - * Can't alter newReg's extents before we call miRegionOp because - * it might be one of the source regions and miRegionOp depends - * on the extents of those regions being the same. Besides, this - * way there's no checking against rectangles that will be nuked - * due to coalescing, so we have to examine fewer rectangles. - */ - miSetExtents(newReg); - return 1; -} - -void REGION:: -miRegionCopy( - register Region dstrgn, - register Region rgn) - -{ - if (dstrgn != rgn) /* don't want to copy to itself */ - { - if (dstrgn->size < rgn->numRects) - { - if (dstrgn->rects) - { - BOX *prevRects = dstrgn->rects; - - dstrgn->rects = (BOX *) - realloc((char *) dstrgn->rects, - (unsigned) rgn->numRects * (sizeof(BOX))); - if (!dstrgn->rects) - { - free(prevRects); - return; - } - } - dstrgn->size = rgn->numRects; - } - dstrgn->numRects = rgn->numRects; - dstrgn->extents.x1 = rgn->extents.x1; - dstrgn->extents.y1 = rgn->extents.y1; - dstrgn->extents.x2 = rgn->extents.x2; - dstrgn->extents.y2 = rgn->extents.y2; - - memcpy((char *) dstrgn->rects, (char *) rgn->rects, - (int) (rgn->numRects * sizeof(BOX))); - } -} - -/*====================================================================== - * Generic Region Operator - *====================================================================*/ - -/*- - *----------------------------------------------------------------------- - * miCoalesce -- - * Attempt to merge the boxes in the current band with those in the - * previous one. Used only by miRegionOp. - * - * Results: - * The new index for the previous band. - * - * Side Effects: - * If coalescing takes place: - * - rectangles in the previous band will have their y2 fields - * altered. - * - pReg->numRects will be decreased. - * - *----------------------------------------------------------------------- - */ -/* static int*/ -int REGION:: -miCoalesce( - register Region pReg, /* Region to coalesce */ - int prevStart, /* Index of start of previous band */ - int curStart) /* Index of start of current band */ -{ - register BoxPtr pPrevBox; /* Current box in previous band */ - register BoxPtr pCurBox; /* Current box in current band */ - register BoxPtr pRegEnd; /* End of region */ - int curNumRects; /* Number of rectangles in current - * band */ - int prevNumRects; /* Number of rectangles in previous - * band */ - int bandY1; /* Y1 coordinate for current band */ - - pRegEnd = &pReg->rects[pReg->numRects]; - - pPrevBox = &pReg->rects[prevStart]; - prevNumRects = curStart - prevStart; - - /* - * Figure out how many rectangles are in the current band. Have to do - * this because multiple bands could have been added in miRegionOp - * at the end when one region has been exhausted. - */ - pCurBox = &pReg->rects[curStart]; - bandY1 = pCurBox->y1; - for (curNumRects = 0; - (pCurBox != pRegEnd) && (pCurBox->y1 == bandY1); - curNumRects++) - { - pCurBox++; - } - - if (pCurBox != pRegEnd) - { - /* - * If more than one band was added, we have to find the start - * of the last band added so the next coalescing job can start - * at the right place... (given when multiple bands are added, - * this may be pointless -- see above). - */ - pRegEnd--; - while (pRegEnd[-1].y1 == pRegEnd->y1) - { - pRegEnd--; - } - curStart = pRegEnd - pReg->rects; - pRegEnd = pReg->rects + pReg->numRects; - } - - if ((curNumRects == prevNumRects) && (curNumRects != 0)) - { - pCurBox -= curNumRects; - /* - * The bands may only be coalesced if the bottom of the previous - * matches the top scanline of the current. - */ - if (pPrevBox->y2 == pCurBox->y1) - { - /* - * Make sure the bands have boxes in the same places. This - * assumes that boxes have been added in such a way that they - * cover the most area possible. I.e. two boxes in a band must - * have some horizontal space between them. - */ - do - { - if ((pPrevBox->x1 != pCurBox->x1) || - (pPrevBox->x2 != pCurBox->x2)) - { - /* - * The bands don't line up so they can't be coalesced. - */ - return (curStart); - } - pPrevBox++; - pCurBox++; - prevNumRects -= 1; - } while (prevNumRects != 0); - - pReg->numRects -= curNumRects; - pCurBox -= curNumRects; - pPrevBox -= curNumRects; - - /* - * The bands may be merged, so set the bottom y of each box - * in the previous band to that of the corresponding box in - * the current band. - */ - do - { - pPrevBox->y2 = pCurBox->y2; - pPrevBox++; - pCurBox++; - curNumRects -= 1; - } while (curNumRects != 0); - - /* - * If only one band was added to the region, we have to backup - * curStart to the start of the previous band. - * - * If more than one band was added to the region, copy the - * other bands down. The assumption here is that the other bands - * came from the same region as the current one and no further - * coalescing can be done on them since it's all been done - * already... curStart is already in the right place. - */ - if (pCurBox == pRegEnd) - { - curStart = prevStart; - } - else - { - do - { - *pPrevBox++ = *pCurBox++; - } while (pCurBox != pRegEnd); - } - - } - } - return (curStart); -} - -/*- - *----------------------------------------------------------------------- - * miRegionOp -- - * Apply an operation to two regions. Called by miUnion, miInverse, - * miSubtract, miIntersect... - * - * Results: - * None. - * - * Side Effects: - * The new region is overwritten. - * - * Notes: - * The idea behind this function is to view the two regions as sets. - * Together they cover a rectangle of area that this function divides - * into horizontal bands where points are covered only by one region - * or by both. For the first case, the nonOverlapFunc is called with - * each the band and the band's upper and lower extents. For the - * second, the overlapFunc is called to process the entire band. It - * is responsible for clipping the rectangles in the band, though - * this function provides the boundaries. - * At the end of each band, the new region is coalesced, if possible, - * to reduce the number of rectangles in the region. - * - *----------------------------------------------------------------------- - */ -/* static void*/ -void REGION:: -miRegionOp( - register Region newReg, /* Place to store result */ - Region reg1, /* First region in operation */ - Region reg2, /* 2d region in operation */ - int (*overlapFunc)( - register Region pReg, - register BoxPtr r1, - BoxPtr r1End, - register BoxPtr r2, - BoxPtr r2End, - wxCoord y1, - wxCoord y2), /* Function to call for over- - * lapping bands */ - int (*nonOverlap1Func)( - register Region pReg, - register BoxPtr r, - BoxPtr rEnd, - register wxCoord y1, - register wxCoord y2), /* Function to call for non- - * overlapping bands in region - * 1 */ - int (*nonOverlap2Func)( - register Region pReg, - register BoxPtr r, - BoxPtr rEnd, - register wxCoord y1, - register wxCoord y2)) /* Function to call for non- - * overlapping bands in region - * 2 */ -{ - register BoxPtr r1; /* Pointer into first region */ - register BoxPtr r2; /* Pointer into 2d region */ - BoxPtr r1End; /* End of 1st region */ - BoxPtr r2End; /* End of 2d region */ - register wxCoord ybot; /* Bottom of intersection */ - register wxCoord ytop; /* Top of intersection */ - BoxPtr oldRects; /* Old rects for newReg */ - int prevBand; /* Index of start of - * previous band in newReg */ - int curBand; /* Index of start of current - * band in newReg */ - register BoxPtr r1BandEnd; /* End of current band in r1 */ - register BoxPtr r2BandEnd; /* End of current band in r2 */ - wxCoord top; /* Top of non-overlapping - * band */ - wxCoord bot; /* Bottom of non-overlapping - * band */ - - /* - * Initialization: - * set r1, r2, r1End and r2End appropriately, preserve the important - * parts of the destination region until the end in case it's one of - * the two source regions, then mark the "new" region empty, allocating - * another array of rectangles for it to use. - */ - r1 = reg1->rects; - r2 = reg2->rects; - r1End = r1 + reg1->numRects; - r2End = r2 + reg2->numRects; - - oldRects = newReg->rects; - - EMPTY_REGION(newReg); - - /* - * Allocate a reasonable number of rectangles for the new region. The idea - * is to allocate enough so the individual functions don't need to - * reallocate and copy the array, which is time consuming, yet we don't - * have to worry about using too much memory. I hope to be able to - * nuke the realloc() at the end of this function eventually. - */ - newReg->size = wxMax(reg1->numRects,reg2->numRects) * 2; - - newReg->rects = (BoxPtr)malloc((unsigned) (sizeof(BoxRec) * newReg->size)); - - if (!newReg->rects) - { - newReg->size = 0; - return; - } - - /* - * Initialize ybot and ytop. - * In the upcoming loop, ybot and ytop serve different functions depending - * on whether the band being handled is an overlapping or non-overlapping - * band. - * In the case of a non-overlapping band (only one of the regions - * has points in the band), ybot is the bottom of the most recent - * intersection and thus clips the top of the rectangles in that band. - * ytop is the top of the next intersection between the two regions and - * serves to clip the bottom of the rectangles in the current band. - * For an overlapping band (where the two regions intersect), ytop clips - * the top of the rectangles of both regions and ybot clips the bottoms. - */ - if (reg1->extents.y1 < reg2->extents.y1) - ybot = reg1->extents.y1; - else - ybot = reg2->extents.y1; - - /* - * prevBand serves to mark the start of the previous band so rectangles - * can be coalesced into larger rectangles. qv. miCoalesce, above. - * In the beginning, there is no previous band, so prevBand == curBand - * (curBand is set later on, of course, but the first band will always - * start at index 0). prevBand and curBand must be indices because of - * the possible expansion, and resultant moving, of the new region's - * array of rectangles. - */ - prevBand = 0; - - do - { - curBand = newReg->numRects; - - /* - * This algorithm proceeds one source-band (as opposed to a - * destination band, which is determined by where the two regions - * intersect) at a time. r1BandEnd and r2BandEnd serve to mark the - * rectangle after the last one in the current band for their - * respective regions. - */ - r1BandEnd = r1; - while ((r1BandEnd != r1End) && (r1BandEnd->y1 == r1->y1)) - { - r1BandEnd++; - } - - r2BandEnd = r2; - while ((r2BandEnd != r2End) && (r2BandEnd->y1 == r2->y1)) - { - r2BandEnd++; - } - - /* - * First handle the band that doesn't intersect, if any. - * - * Note that attention is restricted to one band in the - * non-intersecting region at once, so if a region has n - * bands between the current position and the next place it overlaps - * the other, this entire loop will be passed through n times. - */ - if (r1->y1 < r2->y1) - { - top = wxMax(r1->y1,ybot); - bot = wxMin(r1->y2,r2->y1); - - if ((top != bot) && (nonOverlap1Func != NULL)) - { - (* nonOverlap1Func) (newReg, r1, r1BandEnd, top, bot); - } - - ytop = r2->y1; - } - else if (r2->y1 < r1->y1) - { - top = wxMax(r2->y1,ybot); - bot = wxMin(r2->y2,r1->y1); - - if ((top != bot) && (nonOverlap2Func != NULL)) - { - (* nonOverlap2Func) (newReg, r2, r2BandEnd, top, bot); - } - - ytop = r1->y1; - } - else - { - ytop = r1->y1; - } - - /* - * If any rectangles got added to the region, try and coalesce them - * with rectangles from the previous band. Note we could just do - * this test in miCoalesce, but some machines incur a not - * inconsiderable cost for function calls, so... - */ - if (newReg->numRects != curBand) - { - prevBand = miCoalesce (newReg, prevBand, curBand); - } - - /* - * Now see if we've hit an intersecting band. The two bands only - * intersect if ybot > ytop - */ - ybot = wxMin(r1->y2, r2->y2); - curBand = newReg->numRects; - if (ybot > ytop) - { - (* overlapFunc) (newReg, r1, r1BandEnd, r2, r2BandEnd, ytop, ybot); - - } - - if (newReg->numRects != curBand) - { - prevBand = miCoalesce (newReg, prevBand, curBand); - } - - /* - * If we've finished with a band (y2 == ybot) we skip forward - * in the region to the next band. - */ - if (r1->y2 == ybot) - { - r1 = r1BandEnd; - } - if (r2->y2 == ybot) - { - r2 = r2BandEnd; - } - } while ((r1 != r1End) && (r2 != r2End)); - - /* - * Deal with whichever region still has rectangles left. - */ - curBand = newReg->numRects; - if (r1 != r1End) - { - if (nonOverlap1Func != NULL) - { - do - { - r1BandEnd = r1; - while ((r1BandEnd < r1End) && (r1BandEnd->y1 == r1->y1)) - { - r1BandEnd++; - } - (* nonOverlap1Func) (newReg, r1, r1BandEnd, - wxMax(r1->y1,ybot), r1->y2); - r1 = r1BandEnd; - } while (r1 != r1End); - } - } - else if ((r2 != r2End) && (nonOverlap2Func != NULL)) - { - do - { - r2BandEnd = r2; - while ((r2BandEnd < r2End) && (r2BandEnd->y1 == r2->y1)) - { - r2BandEnd++; - } - (* nonOverlap2Func) (newReg, r2, r2BandEnd, - wxMax(r2->y1,ybot), r2->y2); - r2 = r2BandEnd; - } while (r2 != r2End); - } - - if (newReg->numRects != curBand) - { - (void) miCoalesce (newReg, prevBand, curBand); - } - - /* - * A bit of cleanup. To keep regions from growing without bound, - * we shrink the array of rectangles to match the new number of - * rectangles in the region. This never goes to 0, however... - * - * Only do this stuff if the number of rectangles allocated is more than - * twice the number of rectangles in the region (a simple optimization...). - */ - if (newReg->numRects < (newReg->size >> 1)) - { - if (REGION_NOT_EMPTY(newReg)) - { - BoxPtr prev_rects = newReg->rects; - newReg->size = newReg->numRects; - newReg->rects = (BoxPtr) realloc ((char *) newReg->rects, - (unsigned) (sizeof(BoxRec) * newReg->size)); - if (! newReg->rects) - newReg->rects = prev_rects; - } - else - { - /* - * No point in doing the extra work involved in an realloc if - * the region is empty - */ - newReg->size = 1; - free((char *) newReg->rects); - newReg->rects = (BoxPtr) malloc(sizeof(BoxRec)); - } - } - free ((char *) oldRects); - return; -} - -/*====================================================================== - * Region Union - *====================================================================*/ - -/*- - *----------------------------------------------------------------------- - * miUnionNonO -- - * Handle a non-overlapping band for the union operation. Just - * Adds the rectangles into the region. Doesn't have to check for - * subsumption or anything. - * - * Results: - * None. - * - * Side Effects: - * pReg->numRects is incremented and the final rectangles overwritten - * with the rectangles we're passed. - * - *----------------------------------------------------------------------- - */ -/* static void*/ -int REGION:: -miUnionNonO ( - register Region pReg, - register BoxPtr r, - BoxPtr rEnd, - register wxCoord y1, - register wxCoord y2) -{ - register BoxPtr pNextRect; - - pNextRect = &pReg->rects[pReg->numRects]; - - assert(y1 < y2); - - while (r != rEnd) - { - assert(r->x1 < r->x2); - MEMCHECK(pReg, pNextRect, pReg->rects); - pNextRect->x1 = r->x1; - pNextRect->y1 = y1; - pNextRect->x2 = r->x2; - pNextRect->y2 = y2; - pReg->numRects += 1; - pNextRect++; - - assert(pReg->numRects<=pReg->size); - r++; - } - return 0; /* lint */ -} - - -/*- - *----------------------------------------------------------------------- - * miUnionO -- - * Handle an overlapping band for the union operation. Picks the - * left-most rectangle each time and merges it into the region. - * - * Results: - * None. - * - * Side Effects: - * Rectangles are overwritten in pReg->rects and pReg->numRects will - * be changed. - * - *----------------------------------------------------------------------- - */ - -/* static void*/ -int REGION:: -miUnionO ( - register Region pReg, - register BoxPtr r1, - BoxPtr r1End, - register BoxPtr r2, - BoxPtr r2End, - register wxCoord y1, - register wxCoord y2) -{ - register BoxPtr pNextRect; - - pNextRect = &pReg->rects[pReg->numRects]; - -#define MERGERECT(r) \ - if ((pReg->numRects != 0) && \ - (pNextRect[-1].y1 == y1) && \ - (pNextRect[-1].y2 == y2) && \ - (pNextRect[-1].x2 >= r->x1)) \ - { \ - if (pNextRect[-1].x2 < r->x2) \ - { \ - pNextRect[-1].x2 = r->x2; \ - assert(pNextRect[-1].x1rects); \ - pNextRect->y1 = y1; \ - pNextRect->y2 = y2; \ - pNextRect->x1 = r->x1; \ - pNextRect->x2 = r->x2; \ - pReg->numRects += 1; \ - pNextRect += 1; \ - } \ - assert(pReg->numRects<=pReg->size);\ - r++; - - assert (y1x1 < r2->x1) - { - MERGERECT(r1); - } - else - { - MERGERECT(r2); - } - } - - if (r1 != r1End) - { - do - { - MERGERECT(r1); - } while (r1 != r1End); - } - else while (r2 != r2End) - { - MERGERECT(r2); - } - return 0; /* lint */ -} - -bool REGION:: -XUnionRegion( - Region reg1, - Region reg2, /* source regions */ - Region newReg) /* destination Region */ -{ - /* checks all the simple cases */ - - /* - * Region 1 and 2 are the same or region 1 is empty - */ - if ( (reg1 == reg2) || (!(reg1->numRects)) ) - { - if (newReg != reg2) - miRegionCopy(newReg, reg2); - return 1; - } - - /* - * if nothing to union (region 2 empty) - */ - if (!(reg2->numRects)) - { - if (newReg != reg1) - miRegionCopy(newReg, reg1); - return 1; - } - - /* - * Region 1 completely subsumes region 2 - */ - if ((reg1->numRects == 1) && - (reg1->extents.x1 <= reg2->extents.x1) && - (reg1->extents.y1 <= reg2->extents.y1) && - (reg1->extents.x2 >= reg2->extents.x2) && - (reg1->extents.y2 >= reg2->extents.y2)) - { - if (newReg != reg1) - miRegionCopy(newReg, reg1); - return 1; - } - - /* - * Region 2 completely subsumes region 1 - */ - if ((reg2->numRects == 1) && - (reg2->extents.x1 <= reg1->extents.x1) && - (reg2->extents.y1 <= reg1->extents.y1) && - (reg2->extents.x2 >= reg1->extents.x2) && - (reg2->extents.y2 >= reg1->extents.y2)) - { - if (newReg != reg2) - miRegionCopy(newReg, reg2); - return 1; - } - - miRegionOp (newReg, reg1, reg2, miUnionO, - miUnionNonO, miUnionNonO); - - newReg->extents.x1 = wxMin(reg1->extents.x1, reg2->extents.x1); - newReg->extents.y1 = wxMin(reg1->extents.y1, reg2->extents.y1); - newReg->extents.x2 = wxMax(reg1->extents.x2, reg2->extents.x2); - newReg->extents.y2 = wxMax(reg1->extents.y2, reg2->extents.y2); - - return 1; -} - -/*====================================================================== - * Region Subtraction - *====================================================================*/ - -/*- - *----------------------------------------------------------------------- - * miSubtractNonO -- - * Deal with non-overlapping band for subtraction. Any parts from - * region 2 we discard. Anything from region 1 we add to the region. - * - * Results: - * None. - * - * Side Effects: - * pReg may be affected. - * - *----------------------------------------------------------------------- - */ -/* static void*/ -int REGION:: -miSubtractNonO1 ( - register Region pReg, - register BoxPtr r, - BoxPtr rEnd, - register wxCoord y1, - register wxCoord y2) -{ - register BoxPtr pNextRect; - - pNextRect = &pReg->rects[pReg->numRects]; - - assert(y1x1x2); - MEMCHECK(pReg, pNextRect, pReg->rects); - pNextRect->x1 = r->x1; - pNextRect->y1 = y1; - pNextRect->x2 = r->x2; - pNextRect->y2 = y2; - pReg->numRects += 1; - pNextRect++; - - assert(pReg->numRects <= pReg->size); - - r++; - } - return 0; /* lint */ -} - -/*- - *----------------------------------------------------------------------- - * miSubtractO -- - * Overlapping band subtraction. x1 is the left-most point not yet - * checked. - * - * Results: - * None. - * - * Side Effects: - * pReg may have rectangles added to it. - * - *----------------------------------------------------------------------- - */ -/* static void*/ -int REGION:: -miSubtractO ( - register Region pReg, - register BoxPtr r1, - BoxPtr r1End, - register BoxPtr r2, - BoxPtr r2End, - register wxCoord y1, - register wxCoord y2) -{ - register BoxPtr pNextRect; - register int x1; - - x1 = r1->x1; - - assert(y1rects[pReg->numRects]; - - while ((r1 != r1End) && (r2 != r2End)) - { - if (r2->x2 <= x1) - { - /* - * Subtrahend missed the boat: go to next subtrahend. - */ - r2++; - } - else if (r2->x1 <= x1) - { - /* - * Subtrahend preceeds minuend: nuke left edge of minuend. - */ - x1 = r2->x2; - if (x1 >= r1->x2) - { - /* - * Minuend completely covered: advance to next minuend and - * reset left fence to edge of new minuend. - */ - r1++; - if (r1 != r1End) - x1 = r1->x1; - } - else - { - /* - * Subtrahend now used up since it doesn't extend beyond - * minuend - */ - r2++; - } - } - else if (r2->x1 < r1->x2) - { - /* - * Left part of subtrahend covers part of minuend: add uncovered - * part of minuend to region and skip to next subtrahend. - */ - assert(x1x1); - MEMCHECK(pReg, pNextRect, pReg->rects); - pNextRect->x1 = x1; - pNextRect->y1 = y1; - pNextRect->x2 = r2->x1; - pNextRect->y2 = y2; - pReg->numRects += 1; - pNextRect++; - - assert(pReg->numRects<=pReg->size); - - x1 = r2->x2; - if (x1 >= r1->x2) - { - /* - * Minuend used up: advance to new... - */ - r1++; - if (r1 != r1End) - x1 = r1->x1; - } - else - { - /* - * Subtrahend used up - */ - r2++; - } - } - else - { - /* - * Minuend used up: add any remaining piece before advancing. - */ - if (r1->x2 > x1) - { - MEMCHECK(pReg, pNextRect, pReg->rects); - pNextRect->x1 = x1; - pNextRect->y1 = y1; - pNextRect->x2 = r1->x2; - pNextRect->y2 = y2; - pReg->numRects += 1; - pNextRect++; - assert(pReg->numRects<=pReg->size); - } - r1++; - if (r1 != r1End) - x1 = r1->x1; - } - } - - /* - * Add remaining minuend rectangles to region. - */ - while (r1 != r1End) - { - assert(x1x2); - MEMCHECK(pReg, pNextRect, pReg->rects); - pNextRect->x1 = x1; - pNextRect->y1 = y1; - pNextRect->x2 = r1->x2; - pNextRect->y2 = y2; - pReg->numRects += 1; - pNextRect++; - - assert(pReg->numRects<=pReg->size); - - r1++; - if (r1 != r1End) - { - x1 = r1->x1; - } - } - return 0; /* lint */ -} - -/*- - *----------------------------------------------------------------------- - * miSubtract -- - * Subtract regS from regM and leave the result in regD. - * S stands for subtrahend, M for minuend and D for difference. - * - * Results: - * true. - * - * Side Effects: - * regD is overwritten. - * - *----------------------------------------------------------------------- - */ - -bool REGION::XSubtractRegion(Region regM, Region regS, register Region regD) -{ - /* check for trivial reject */ - if ( (!(regM->numRects)) || (!(regS->numRects)) || - (!EXTENTCHECK(®M->extents, ®S->extents)) ) - { - miRegionCopy(regD, regM); - return true; - } - - miRegionOp (regD, regM, regS, miSubtractO, - miSubtractNonO1, NULL); - - /* - * Can't alter newReg's extents before we call miRegionOp because - * it might be one of the source regions and miRegionOp depends - * on the extents of those regions being the unaltered. Besides, this - * way there's no checking against rectangles that will be nuked - * due to coalescing, so we have to examine fewer rectangles. - */ - miSetExtents (regD); - return true; -} - -bool REGION::XXorRegion(Region sra, Region srb, Region dr) -{ - Region tra = XCreateRegion(); - - wxCHECK_MSG( tra, false, wxT("region not created") ); - - Region trb = XCreateRegion(); - - wxCHECK_MSG( trb, false, wxT("region not created") ); - - (void) XSubtractRegion(sra,srb,tra); - (void) XSubtractRegion(srb,sra,trb); - (void) XUnionRegion(tra,trb,dr); - XDestroyRegion(tra); - XDestroyRegion(trb); - return 0; -} - -/* - * Check to see if the region is empty. Assumes a region is passed - * as a parameter - */ -bool REGION::XEmptyRegion(Region r) -{ - if( r->numRects == 0 ) return true; - else return false; -} - -/* - * Check to see if two regions are equal - */ -bool REGION::XEqualRegion(Region r1, Region r2) -{ - int i; - - if( r1->numRects != r2->numRects ) return false; - else if( r1->numRects == 0 ) return true; - else if ( r1->extents.x1 != r2->extents.x1 ) return false; - else if ( r1->extents.x2 != r2->extents.x2 ) return false; - else if ( r1->extents.y1 != r2->extents.y1 ) return false; - else if ( r1->extents.y2 != r2->extents.y2 ) return false; - else for( i=0; i < r1->numRects; i++ ) { - if ( r1->rects[i].x1 != r2->rects[i].x1 ) return false; - else if ( r1->rects[i].x2 != r2->rects[i].x2 ) return false; - else if ( r1->rects[i].y1 != r2->rects[i].y1 ) return false; - else if ( r1->rects[i].y2 != r2->rects[i].y2 ) return false; - } - return true; -} - -bool REGION::XPointInRegion(Region pRegion, int x, int y) -{ - int i; - - if (pRegion->numRects == 0) - return false; - if (!INBOX(pRegion->extents, x, y)) - return false; - for (i=0; inumRects; i++) - { - if (INBOX (pRegion->rects[i], x, y)) - return true; - } - return false; -} - -wxRegionContain REGION::XRectInRegion(register Region region, - int rx, int ry, - unsigned int rwidth, - unsigned int rheight) -{ - register BoxPtr pbox; - register BoxPtr pboxEnd; - Box rect; - register BoxPtr prect = ▭ - int partIn, partOut; - - prect->x1 = rx; - prect->y1 = ry; - prect->x2 = rwidth + rx; - prect->y2 = rheight + ry; - - /* this is (just) a useful optimization */ - if ((region->numRects == 0) || !EXTENTCHECK(®ion->extents, prect)) - return(wxOutRegion); - - partOut = false; - partIn = false; - - /* can stop when both partOut and partIn are true, or we reach prect->y2 */ - for (pbox = region->rects, pboxEnd = pbox + region->numRects; - pbox < pboxEnd; - pbox++) - { - - if (pbox->y2 <= ry) - continue; /* getting up to speed or skipping remainder of band */ - - if (pbox->y1 > ry) - { - partOut = true; /* missed part of rectangle above */ - if (partIn || (pbox->y1 >= prect->y2)) - break; - ry = pbox->y1; /* x guaranteed to be == prect->x1 */ - } - - if (pbox->x2 <= rx) - continue; /* not far enough over yet */ - - if (pbox->x1 > rx) - { - partOut = true; /* missed part of rectangle to left */ - if (partIn) - break; - } - - if (pbox->x1 < prect->x2) - { - partIn = true; /* definitely overlap */ - if (partOut) - break; - } - - if (pbox->x2 >= prect->x2) - { - ry = pbox->y2; /* finished with this band */ - if (ry >= prect->y2) - break; - rx = prect->x1; /* reset x out to left again */ - } else - { - /* - * Because boxes in a band are maximal width, if the first box - * to overlap the rectangle doesn't completely cover it in that - * band, the rectangle must be partially out, since some of it - * will be uncovered in that band. partIn will have been set true - * by now... - */ - break; - } - - } - - return(partIn ? ((ry < prect->y2) ? wxPartRegion : wxInRegion) : - wxOutRegion); -} diff --git a/wxWidgets/src/generic/renderg.cpp b/wxWidgets/src/generic/renderg.cpp deleted file mode 100644 index 710facd0c3..0000000000 --- a/wxWidgets/src/generic/renderg.cpp +++ /dev/null @@ -1,678 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: src/generic/renderg.cpp -// Purpose: generic implementation of wxRendererNative (for any platform) -// Author: Vadim Zeitlin -// Modified by: -// Created: 20.07.2003 -// RCS-ID: $Id: renderg.cpp 45498 2007-04-16 13:03:05Z VZ $ -// 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 - -#include "wx/renderer.h" - -#ifndef WX_PRECOMP - #include "wx/string.h" - #include "wx/dc.h" - #include "wx/settings.h" - #include "wx/gdicmn.h" - #include "wx/module.h" -#endif //WX_PRECOMP - -#include "wx/splitter.h" -#include "wx/dcmirror.h" - -// ---------------------------------------------------------------------------- -// wxRendererGeneric: our wxRendererNative implementation -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxRendererGeneric : public wxRendererNative -{ -public: - wxRendererGeneric(); - - virtual int DrawHeaderButton(wxWindow *win, - wxDC& dc, - const wxRect& rect, - int flags = 0, - wxHeaderSortIconType sortArrow = wxHDR_SORT_ICON_NONE, - wxHeaderButtonParams* params = NULL); - - virtual int DrawHeaderButtonContents(wxWindow *win, - wxDC& dc, - const wxRect& rect, - int flags = 0, - wxHeaderSortIconType sortArrow = wxHDR_SORT_ICON_NONE, - wxHeaderButtonParams* params = NULL); - - virtual int GetHeaderButtonHeight(wxWindow *win); - - virtual void DrawTreeItemButton(wxWindow *win, - wxDC& dc, - const wxRect& rect, - int flags = 0); - - virtual void DrawSplitterBorder(wxWindow *win, - wxDC& dc, - const wxRect& rect, - int flags = 0); - - virtual void DrawSplitterSash(wxWindow *win, - wxDC& dc, - const wxSize& size, - wxCoord position, - wxOrientation orient, - int flags = 0); - - virtual void DrawComboBoxDropButton(wxWindow *win, - wxDC& dc, - const wxRect& rect, - int flags = 0); - - virtual void DrawDropArrow(wxWindow *win, - wxDC& dc, - const wxRect& rect, - int flags = 0); - - virtual void DrawCheckBox(wxWindow *win, - wxDC& dc, - const wxRect& rect, - int flags = 0); - - virtual void DrawPushButton(wxWindow *win, - wxDC& dc, - const wxRect& rect, - int flags = 0); - - virtual void DrawItemSelectionRect(wxWindow *win, - wxDC& dc, - const wxRect& rect, - int flags = 0); - - virtual wxSplitterRenderParams GetSplitterParams(const wxWindow *win); - - virtual wxRendererVersion GetVersion() const - { - return wxRendererVersion(wxRendererVersion::Current_Version, - wxRendererVersion::Current_Age); - } - - - // Cleanup by deleting standard renderer - static void Cleanup(); - - // Get the generic object - static wxRendererGeneric* DoGetGeneric(); - -protected: - // draw the rectange using the first pen for the left and top sides and - // the second one for the bottom and right ones - void DrawShadedRect(wxDC& dc, wxRect *rect, - const wxPen& pen1, const wxPen& pen2); - - // the standard pens - wxPen m_penBlack, - m_penDarkGrey, - m_penLightGrey, - m_penHighlight; - - static wxRendererGeneric* sm_rendererGeneric; -}; - -// ============================================================================ -// wxRendererGeneric implementation -// ============================================================================ - -// Get the generic object -wxRendererGeneric* wxRendererGeneric::DoGetGeneric() -{ - if (!sm_rendererGeneric) - sm_rendererGeneric = new wxRendererGeneric; - return sm_rendererGeneric; -} - -// ---------------------------------------------------------------------------- -// wxRendererGeneric creation -// ---------------------------------------------------------------------------- - -/* static */ -wxRendererNative& wxRendererNative::GetGeneric() -{ - return * wxRendererGeneric::DoGetGeneric(); -} - -void wxRendererGeneric::Cleanup() -{ - if (sm_rendererGeneric) - delete sm_rendererGeneric; - - sm_rendererGeneric = NULL; -} - -wxRendererGeneric* wxRendererGeneric::sm_rendererGeneric = NULL; - -wxRendererGeneric::wxRendererGeneric() - : m_penBlack(wxSystemSettings::GetColour(wxSYS_COLOUR_3DDKSHADOW)), - m_penDarkGrey(wxSystemSettings::GetColour(wxSYS_COLOUR_3DSHADOW)), - m_penLightGrey(wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE)), - m_penHighlight(wxSystemSettings::GetColour(wxSYS_COLOUR_3DHIGHLIGHT)) -{ -} - -// ---------------------------------------------------------------------------- -// wxRendererGeneric helpers -// ---------------------------------------------------------------------------- - -void -wxRendererGeneric::DrawShadedRect(wxDC& dc, - wxRect *rect, - const wxPen& pen1, - const wxPen& pen2) -{ - // draw the rectangle - dc.SetPen(pen1); - dc.DrawLine(rect->GetLeft(), rect->GetTop(), - rect->GetLeft(), rect->GetBottom()); - dc.DrawLine(rect->GetLeft() + 1, rect->GetTop(), - rect->GetRight(), rect->GetTop()); - dc.SetPen(pen2); - dc.DrawLine(rect->GetRight(), rect->GetTop(), - rect->GetRight(), rect->GetBottom()); - dc.DrawLine(rect->GetLeft(), rect->GetBottom(), - rect->GetRight() + 1, rect->GetBottom()); - - // adjust the rect - rect->Inflate(-1); -} - -// ---------------------------------------------------------------------------- -// tree/list ctrl drawing -// ---------------------------------------------------------------------------- - -int -wxRendererGeneric::DrawHeaderButton(wxWindow* win, - wxDC& dc, - const wxRect& rect, - int flags, - wxHeaderSortIconType sortArrow, - wxHeaderButtonParams* params) -{ - const int CORNER = 1; - - const wxCoord x = rect.x, - y = rect.y, - w = rect.width, - h = rect.height; - - dc.SetBrush(wxBrush(wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE))); - dc.SetPen(*wxTRANSPARENT_PEN); - dc.DrawRectangle(rect); - - dc.SetBrush(*wxTRANSPARENT_BRUSH); - - dc.SetPen(m_penBlack); - dc.DrawLine( x+w-CORNER+1, y, x+w, y+h ); // right (outer) - dc.DrawRectangle( x, y+h, w+1, 1 ); // bottom (outer) - - dc.SetPen(m_penDarkGrey); - 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(m_penHighlight); - 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 ); - - return DrawHeaderButtonContents(win, dc, rect, flags, sortArrow, params); -} - - -int -wxRendererGeneric::DrawHeaderButtonContents(wxWindow *win, - wxDC& dc, - const wxRect& rect, - int flags, - wxHeaderSortIconType sortArrow, - wxHeaderButtonParams* params) -{ - int labelWidth = 0; - - // Mark this item as selected. For the generic version we'll just draw an - // underline - if ( flags & wxCONTROL_SELECTED ) - { - // draw a line at the bottom of the header button, overlaying the - // native hot-tracking line (on XP) - const int penwidth = 3; - int y = rect.y + rect.height + 1 - penwidth; - wxColour c = (params && params->m_selectionColour.Ok()) ? - params->m_selectionColour : wxColour(0x66, 0x66, 0x66); - wxPen pen(c, penwidth); - pen.SetCap(wxCAP_BUTT); - dc.SetPen(pen); - dc.DrawLine(rect.x, y, rect.x + rect.width, y); - } - - // Draw an up or down arrow - int arrowSpace = 0; - if (sortArrow != wxHDR_SORT_ICON_NONE ) - { - wxRect ar = rect; - - // make a rect for the arrow - ar.height = 4; - ar.width = 8; - ar.y += (rect.height - ar.height)/2; - ar.x = ar.x + rect.width - 3*ar.width/2; - arrowSpace = 3*ar.width/2; // space to preserve when drawing the label - - wxPoint triPt[3]; - if ( sortArrow & wxHDR_SORT_ICON_UP ) - { - triPt[0].x = ar.width / 2; - triPt[0].y = 0; - triPt[1].x = ar.width; - triPt[1].y = ar.height; - triPt[2].x = 0; - triPt[2].y = ar.height; - } - else - { - triPt[0].x = 0; - triPt[0].y = 0; - triPt[1].x = ar.width; - triPt[1].y = 0; - triPt[2].x = ar.width / 2; - triPt[2].y = ar.height; - } - - wxColour c = (params && params->m_arrowColour.Ok()) ? - params->m_arrowColour : wxSystemSettings::GetColour(wxSYS_COLOUR_3DSHADOW); - dc.SetPen(wxPen(c)); - dc.SetBrush(wxBrush(c)); - dc.DrawPolygon( 3, triPt, ar.x, ar.y); - } - labelWidth += arrowSpace; - - const int margin = 5; // number of pixels to reserve on either side of the label - int bmpWidth = 0; - int txtEnd = 0; - - if ( params && params->m_labelBitmap.Ok() ) - bmpWidth = params->m_labelBitmap.GetWidth() + 2; - - labelWidth += bmpWidth + 2*margin; - - // Draw a label if one is given - if ( params && !params->m_labelText.empty() ) - { - wxFont font = params->m_labelFont.Ok() ? - params->m_labelFont : win->GetFont(); - wxColour clr = params->m_labelColour.Ok() ? - params->m_labelColour : win->GetForegroundColour(); - - wxString label( params->m_labelText ); - - dc.SetFont(font); - dc.SetTextForeground(clr); - dc.SetBackgroundMode(wxTRANSPARENT); - - int tw, th, td, x, y; - dc.GetTextExtent( label, &tw, &th, &td); - labelWidth += tw; - y = rect.y + wxMax(0, (rect.height - (th+td)) / 2); - - // truncate and add an ellipsis (...) if the text is too wide. - int targetWidth = rect.width - arrowSpace - bmpWidth - 2*margin; - if ( tw > targetWidth ) - { - int ellipsisWidth; - dc.GetTextExtent( wxT("..."), &ellipsisWidth, NULL); - do { - label.Truncate( label.length() - 1 ); - dc.GetTextExtent( label, &tw, &th); - } while (tw + ellipsisWidth > targetWidth && label.length() ); - label.append( wxT("...") ); - tw += ellipsisWidth; - } - - switch (params->m_labelAlignment) - { - default: - case wxALIGN_LEFT: - x = rect.x + margin; - break; - case wxALIGN_CENTER: - x = rect.x + wxMax(0, (rect.width - arrowSpace - tw - bmpWidth)/2); - break; - case wxALIGN_RIGHT: - x = rect.x + wxMax(0, rect.width - arrowSpace - margin - tw - bmpWidth); - break; - } - - dc.DrawText(label, x, y); - txtEnd = x + tw + 2; - } - - // draw the bitmap if there is one - if ( params && params->m_labelBitmap.Ok() ) - { - int w, h, x, y; - w = params->m_labelBitmap.GetWidth(); - h = params->m_labelBitmap.GetHeight(); - - y = rect.y + wxMax(1, (rect.height - h) / 2); - - // if there is a text label, then put the bitmap at the end of the label - if ( txtEnd != 0 ) - { - x = txtEnd; - } - // otherwise use the alignment flags - else - { - switch (params->m_labelAlignment) - { - default: - case wxALIGN_LEFT: - x = rect.x + margin; - break; - case wxALIGN_CENTER: - x = rect.x + wxMax(1, (rect.width - arrowSpace - w)/2); - break; - case wxALIGN_RIGHT: - x = rect.x + wxMax(1, rect.width - arrowSpace - margin - w); - break; - } - } - dc.DrawBitmap(params->m_labelBitmap, x, y, true); - } - return labelWidth; -} - - -int wxRendererGeneric::GetHeaderButtonHeight(wxWindow *win) -{ - // Copied and adapted from src/generic/listctrl.cpp - const int HEADER_OFFSET_Y = 1; - const int EXTRA_HEIGHT = 4; - - int w=0, h=14, d=0; - if (win) - win->GetTextExtent(wxT("Hg"), &w, &h, &d); - - return h + d + 2 * HEADER_OFFSET_Y + EXTRA_HEIGHT; -} - - -// draw the plus or minus sign -void -wxRendererGeneric::DrawTreeItemButton(wxWindow * WXUNUSED(win), - wxDC& dc, - const wxRect& rect, - int flags) -{ - // store settings - wxDCPenChanger penChanger(dc, *wxGREY_PEN); - wxDCBrushChanger brushChanger(dc, *wxWHITE_BRUSH); - - dc.DrawRectangle(rect); - - // black lines - const wxCoord xMiddle = rect.x + rect.width/2; - const wxCoord yMiddle = rect.y + rect.height/2; - - // half of the length of the horz lines in "-" and "+" - const wxCoord halfWidth = rect.width/2 - 2; - dc.SetPen(*wxBLACK_PEN); - dc.DrawLine(xMiddle - halfWidth, yMiddle, - xMiddle + halfWidth + 1, yMiddle); - - if ( !(flags & wxCONTROL_EXPANDED) ) - { - // turn "-" into "+" - const wxCoord halfHeight = rect.height/2 - 2; - dc.DrawLine(xMiddle, yMiddle - halfHeight, - xMiddle, yMiddle + halfHeight + 1); - } -} - -// ---------------------------------------------------------------------------- -// sash drawing -// ---------------------------------------------------------------------------- - -wxSplitterRenderParams -wxRendererGeneric::GetSplitterParams(const wxWindow *win) -{ - // see below - wxCoord sashWidth, - border; - - if ( win->HasFlag(wxSP_3DSASH) ) - sashWidth = 7; - else if ( win->HasFlag(wxSP_NOSASH) ) - sashWidth = 0; - else // no 3D effect - sashWidth = 3; - - if ( win->HasFlag(wxSP_3DBORDER) ) - border = 2; - else // no 3D effect - border = 0; - - return wxSplitterRenderParams(sashWidth, border, false); -} - -void -wxRendererGeneric::DrawSplitterBorder(wxWindow *win, - wxDC& dc, - const wxRect& rectOrig, - int WXUNUSED(falgs)) -{ - if ( win->HasFlag(wxSP_3DBORDER) ) - { - wxRect rect = rectOrig; - DrawShadedRect(dc, &rect, m_penDarkGrey, m_penHighlight); - DrawShadedRect(dc, &rect, m_penBlack, m_penLightGrey); - } -} - -void -wxRendererGeneric::DrawSplitterSash(wxWindow *win, - wxDC& dcReal, - const wxSize& sizeReal, - wxCoord position, - wxOrientation orient, - int WXUNUSED(flags)) -{ - // to avoid duplicating the same code for horizontal and vertical sashes, - // simply mirror the DC instead if needed (i.e. if horz splitter) - wxMirrorDC dc(dcReal, orient != wxVERTICAL); - wxSize size = dc.Reflect(sizeReal); - - - // we draw a Win32-like grey sash with possible 3D border here: - // - // ---- this is position - // / - // v - // dWGGGDd - // GWGGGDB - // GWGGGDB where G is light grey (face) - // GWGGGDB W white (light) - // GWGGGDB D dark grey (shadow) - // GWGGGDB B black (dark shadow) - // GWGGGDB - // GWGGGDB and lower letters are our border (already drawn) - // GWGGGDB - // wWGGGDd - // - // only the middle 3 columns are drawn unless wxSP_3D is specified - - const wxCoord h = size.y; - wxCoord offset = 0; - - // If we're drawing the border, draw the sash 3d lines shorter - if ( win->HasFlag(wxSP_3DBORDER) ) - { - offset = 1; - } - - dc.SetPen(*wxTRANSPARENT_PEN); - dc.SetBrush(wxBrush(wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE))); - - if ( win->HasFlag(wxSP_3DSASH) ) - { - // Draw the 3D sash - dc.DrawRectangle(position + 2, 0, 3, h); - - dc.SetPen(m_penLightGrey); - dc.DrawLine(position, offset, position, h - offset); - - dc.SetPen(m_penHighlight); - dc.DrawLine(position + 1, 0, position + 1, h); - - dc.SetPen(m_penDarkGrey); - dc.DrawLine(position + 5, 0, position + 5, h); - - dc.SetPen(m_penBlack); - dc.DrawLine(position + 6, offset, position + 6, h - offset); - } - else - { - // Draw a flat sash - dc.DrawRectangle(position, 0, 3, h); - } -} - -// ---------------------------------------------------------------------------- -// button drawing -// ---------------------------------------------------------------------------- - -void -wxRendererGeneric::DrawComboBoxDropButton(wxWindow *win, - wxDC& dc, - const wxRect& rect, - int flags) -{ - DrawPushButton(win,dc,rect,flags); - DrawDropArrow(win,dc,rect,flags); -} - -void -wxRendererGeneric::DrawDropArrow(wxWindow *win, - wxDC& dc, - const wxRect& rect, - int WXUNUSED(flags)) -{ - // This generic implementation should be good - // enough for Windows platforms (including XP). - - int arrowHalf = rect.width/5; - int rectMid = rect.width / 2; - int arrowTopY = (rect.height/2) - (arrowHalf/2); - - // This should always result in arrow with odd width. - wxPoint pt[] = - { - wxPoint(rectMid - arrowHalf, arrowTopY), - wxPoint(rectMid + arrowHalf, arrowTopY), - wxPoint(rectMid, arrowTopY + arrowHalf) - }; - dc.SetBrush(wxBrush(win->GetForegroundColour())); - dc.SetPen(wxPen(win->GetForegroundColour())); - dc.DrawPolygon(WXSIZEOF(pt), pt, rect.x, rect.y); -} - -void -wxRendererGeneric::DrawCheckBox(wxWindow *WXUNUSED(win), - wxDC& dc, - const wxRect& rect, - int flags) -{ - dc.SetPen(*(flags & wxCONTROL_DISABLED ? wxGREY_PEN : wxBLACK_PEN)); - dc.SetBrush( *wxTRANSPARENT_BRUSH ); - dc.DrawRectangle(rect); - - if ( flags & wxCONTROL_CHECKED ) - { - dc.DrawCheckMark(rect.Deflate(2, 2)); - } -} - -void -wxRendererGeneric::DrawPushButton(wxWindow *win, - wxDC& dc, - const wxRect& rect, - int flags) -{ - // Don't try anything too fancy. It'll just turn out looking - // out-of-place on most platforms. - wxColour bgCol = flags & wxCONTROL_DISABLED ? - wxSystemSettings::GetColour(wxSYS_COLOUR_BTNFACE) : - win->GetBackgroundColour(); - dc.SetBrush(wxBrush(bgCol)); - dc.SetPen(wxPen(bgCol)); - dc.DrawRectangle(rect); -} - -void -wxRendererGeneric::DrawItemSelectionRect(wxWindow * WXUNUSED(win), - wxDC& dc, - const wxRect& rect, - int flags) -{ - wxBrush brush; - if ( flags & wxCONTROL_SELECTED ) - { - if ( flags & wxCONTROL_FOCUSED ) - { - brush = wxBrush(wxSystemSettings::GetColour(wxSYS_COLOUR_HIGHLIGHT)); - } - else // !focused - { - brush = wxBrush(wxSystemSettings::GetColour(wxSYS_COLOUR_BTNSHADOW)); - } - } - else // !selected - { - brush = *wxTRANSPARENT_BRUSH; - } - - dc.SetBrush(brush); - dc.SetPen(flags & wxCONTROL_CURRENT ? *wxBLACK_PEN : *wxTRANSPARENT_PEN); - - dc.DrawRectangle( rect ); -} - - -// ---------------------------------------------------------------------------- -// A module to allow cleanup of generic renderer. -// ---------------------------------------------------------------------------- - -class wxGenericRendererModule: public wxModule -{ -DECLARE_DYNAMIC_CLASS(wxGenericRendererModule) -public: - wxGenericRendererModule() {} - bool OnInit() { return true; } - void OnExit() { wxRendererGeneric::Cleanup(); } -}; - -IMPLEMENT_DYNAMIC_CLASS(wxGenericRendererModule, wxModule) diff --git a/wxWidgets/src/generic/sashwin.cpp b/wxWidgets/src/generic/sashwin.cpp deleted file mode 100644 index 2d7dbf3f84..0000000000 --- a/wxWidgets/src/generic/sashwin.cpp +++ /dev/null @@ -1,708 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/generic/sashwin.cpp -// Purpose: wxSashWindow implementation. A sash window has an optional -// sash on each edge, allowing it to be dragged. An event -// is generated when the sash is released. -// Author: Julian Smart -// Modified by: -// Created: 01/02/97 -// RCS-ID: $Id: sashwin.cpp 51249 2008-01-16 13:50:23Z JS $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_SASH - -#include "wx/sashwin.h" - -#ifndef WX_PRECOMP - #include "wx/dialog.h" - #include "wx/frame.h" - #include "wx/settings.h" - #include "wx/dcclient.h" - #include "wx/dcscreen.h" - #include "wx/math.h" -#endif - -#include - -#include "wx/laywin.h" - -DEFINE_EVENT_TYPE(wxEVT_SASH_DRAGGED) - -IMPLEMENT_DYNAMIC_CLASS(wxSashWindow, wxWindow) -IMPLEMENT_DYNAMIC_CLASS(wxSashEvent, wxCommandEvent) - -BEGIN_EVENT_TABLE(wxSashWindow, wxWindow) - EVT_PAINT(wxSashWindow::OnPaint) - EVT_SIZE(wxSashWindow::OnSize) - EVT_MOUSE_EVENTS(wxSashWindow::OnMouseEvent) -#if defined( __WXMSW__ ) || defined( __WXMAC__) - EVT_SET_CURSOR(wxSashWindow::OnSetCursor) -#endif // __WXMSW__ || __WXMAC__ - -END_EVENT_TABLE() - -bool wxSashWindow::Create(wxWindow *parent, wxWindowID id, const wxPoint& pos, - const wxSize& size, long style, const wxString& name) -{ - return wxWindow::Create(parent, id, pos, size, style, name); -} - -wxSashWindow::~wxSashWindow() -{ - delete m_sashCursorWE; - delete m_sashCursorNS; -} - -void wxSashWindow::Init() -{ - m_draggingEdge = wxSASH_NONE; - m_dragMode = wxSASH_DRAG_NONE; - m_oldX = 0; - m_oldY = 0; - m_firstX = 0; - m_firstY = 0; - m_borderSize = 3; - m_extraBorderSize = 0; - m_minimumPaneSizeX = 0; - m_minimumPaneSizeY = 0; - m_maximumPaneSizeX = 10000; - m_maximumPaneSizeY = 10000; - m_sashCursorWE = new wxCursor(wxCURSOR_SIZEWE); - m_sashCursorNS = new wxCursor(wxCURSOR_SIZENS); - m_mouseCaptured = false; - m_currentCursor = NULL; - - // Eventually, we'll respond to colour change messages - InitColours(); -} - -void wxSashWindow::OnPaint(wxPaintEvent& WXUNUSED(event)) -{ - wxPaintDC dc(this); - - DrawBorders(dc); - DrawSashes(dc); -} - -void wxSashWindow::OnMouseEvent(wxMouseEvent& event) -{ - wxCoord x = 0, y = 0; - event.GetPosition(&x, &y); - - wxSashEdgePosition sashHit = SashHitTest(x, y); - - if (event.LeftDown()) - { - CaptureMouse(); - m_mouseCaptured = true; - - if ( sashHit != wxSASH_NONE ) - { - // Required for X to specify that - // that we wish to draw on top of all windows - // - and we optimise by specifying the area - // for creating the overlap window. - // Find the first frame or dialog and use this to specify - // the area to draw on. - wxWindow* parent = this; - - while (parent && !parent->IsKindOf(CLASSINFO(wxDialog)) && - !parent->IsKindOf(CLASSINFO(wxFrame))) - parent = parent->GetParent(); - - wxScreenDC::StartDrawingOnTop(parent); - - // We don't say we're dragging yet; we leave that - // decision for the Dragging() branch, to ensure - // the user has dragged a little bit. - m_dragMode = wxSASH_DRAG_LEFT_DOWN; - m_draggingEdge = sashHit; - m_firstX = x; - m_firstY = y; - - if ( (sashHit == wxSASH_LEFT) || (sashHit == wxSASH_RIGHT) ) - { - if (m_currentCursor != m_sashCursorWE) - { - SetCursor(*m_sashCursorWE); - } - m_currentCursor = m_sashCursorWE; - } - else - { - if (m_currentCursor != m_sashCursorNS) - { - SetCursor(*m_sashCursorNS); - } - m_currentCursor = m_sashCursorNS; - } - } - } - else if ( event.LeftUp() && m_dragMode == wxSASH_DRAG_LEFT_DOWN ) - { - // Wasn't a proper drag - if (m_mouseCaptured) - ReleaseMouse(); - m_mouseCaptured = false; - - wxScreenDC::EndDrawingOnTop(); - m_dragMode = wxSASH_DRAG_NONE; - m_draggingEdge = wxSASH_NONE; - } - else if (event.LeftUp() && m_dragMode == wxSASH_DRAG_DRAGGING) - { - // We can stop dragging now and see what we've got. - m_dragMode = wxSASH_DRAG_NONE; - if (m_mouseCaptured) - ReleaseMouse(); - m_mouseCaptured = false; - - // Erase old tracker - DrawSashTracker(m_draggingEdge, m_oldX, m_oldY); - - // End drawing on top (frees the window used for drawing - // over the screen) - wxScreenDC::EndDrawingOnTop(); - - int w, h; - GetSize(&w, &h); - int xp, yp; - GetPosition(&xp, &yp); - - wxSashEdgePosition edge = m_draggingEdge; - m_draggingEdge = wxSASH_NONE; - - wxRect dragRect; - wxSashDragStatus status = wxSASH_STATUS_OK; - - // the new height and width of the window - if -1, it didn't change - int newHeight = wxDefaultCoord, - newWidth = wxDefaultCoord; - - // NB: x and y may be negative and they're relative to the sash window - // upper left corner, while xp and yp are expressed in the parent - // window system of coordinates, so adjust them! After this - // adjustment, all coordinates are relative to the parent window. - y += yp; - x += xp; - - switch (edge) - { - case wxSASH_TOP: - if ( y > yp + h ) - { - // top sash shouldn't get below the bottom one - status = wxSASH_STATUS_OUT_OF_RANGE; - } - else - { - newHeight = h - (y - yp); - } - break; - - case wxSASH_BOTTOM: - if ( y < yp ) - { - // bottom sash shouldn't get above the top one - status = wxSASH_STATUS_OUT_OF_RANGE; - } - else - { - newHeight = y - yp; - } - break; - - case wxSASH_LEFT: - if ( x > xp + w ) - { - // left sash shouldn't get beyond the right one - status = wxSASH_STATUS_OUT_OF_RANGE; - } - else - { - newWidth = w - (x - xp); - } - break; - - case wxSASH_RIGHT: - if ( x < xp ) - { - // and the right sash, finally, shouldn't be beyond the - // left one - status = wxSASH_STATUS_OUT_OF_RANGE; - } - else - { - newWidth = x - xp; - } - break; - - case wxSASH_NONE: - // can this happen at all? - break; - } - - if ( newHeight == wxDefaultCoord ) - { - // didn't change - newHeight = h; - } - else - { - // make sure it's in m_minimumPaneSizeY..m_maximumPaneSizeY range - newHeight = wxMax(newHeight, m_minimumPaneSizeY); - newHeight = wxMin(newHeight, m_maximumPaneSizeY); - } - - if ( newWidth == wxDefaultCoord ) - { - // didn't change - newWidth = w; - } - else - { - // make sure it's in m_minimumPaneSizeY..m_maximumPaneSizeY range - newWidth = wxMax(newWidth, m_minimumPaneSizeX); - newWidth = wxMin(newWidth, m_maximumPaneSizeX); - } - - dragRect = wxRect(x, y, newWidth, newHeight); - - wxSashEvent eventSash(GetId(), edge); - eventSash.SetEventObject(this); - eventSash.SetDragStatus(status); - eventSash.SetDragRect(dragRect); - GetEventHandler()->ProcessEvent(eventSash); - } - else if ( event.LeftUp() ) - { - if (m_mouseCaptured) - ReleaseMouse(); - m_mouseCaptured = false; - } - else if ((event.Moving() || event.Leaving()) && !event.Dragging()) - { - // Just change the cursor if required - if ( sashHit != wxSASH_NONE ) - { - if ( (sashHit == wxSASH_LEFT) || (sashHit == wxSASH_RIGHT) ) - { - if (m_currentCursor != m_sashCursorWE) - { - SetCursor(*m_sashCursorWE); - } - m_currentCursor = m_sashCursorWE; - } - else - { - if (m_currentCursor != m_sashCursorNS) - { - SetCursor(*m_sashCursorNS); - } - m_currentCursor = m_sashCursorNS; - } - } - else - { - SetCursor(wxNullCursor); - m_currentCursor = NULL; - } - } - else if ( event.Dragging() && - ((m_dragMode == wxSASH_DRAG_DRAGGING) || - (m_dragMode == wxSASH_DRAG_LEFT_DOWN)) ) - { - if ( (m_draggingEdge == wxSASH_LEFT) || (m_draggingEdge == wxSASH_RIGHT) ) - { - if (m_currentCursor != m_sashCursorWE) - { - SetCursor(*m_sashCursorWE); - } - m_currentCursor = m_sashCursorWE; - } - else - { - if (m_currentCursor != m_sashCursorNS) - { - SetCursor(*m_sashCursorNS); - } - m_currentCursor = m_sashCursorNS; - } - - if (m_dragMode == wxSASH_DRAG_LEFT_DOWN) - { - m_dragMode = wxSASH_DRAG_DRAGGING; - DrawSashTracker(m_draggingEdge, x, y); - } - else - { - if ( m_dragMode == wxSASH_DRAG_DRAGGING ) - { - // Erase old tracker - DrawSashTracker(m_draggingEdge, m_oldX, m_oldY); - - // Draw new one - DrawSashTracker(m_draggingEdge, x, y); - } - } - m_oldX = x; - m_oldY = y; - } - else if ( event.LeftDClick() ) - { - // Nothing - } - else - { - } -} - -void wxSashWindow::OnSize(wxSizeEvent& WXUNUSED(event)) -{ - SizeWindows(); -} - -wxSashEdgePosition wxSashWindow::SashHitTest(int x, int y, int WXUNUSED(tolerance)) -{ - int cx, cy; - GetClientSize(& cx, & cy); - - int i; - for (i = 0; i < 4; i++) - { - wxSashEdge& edge = m_sashes[i]; - wxSashEdgePosition position = (wxSashEdgePosition) i ; - - if (edge.m_show) - { - switch (position) - { - case wxSASH_TOP: - { - if (y >= 0 && y <= GetEdgeMargin(position)) - return wxSASH_TOP; - break; - } - case wxSASH_RIGHT: - { - if ((x >= cx - GetEdgeMargin(position)) && (x <= cx)) - return wxSASH_RIGHT; - break; - } - case wxSASH_BOTTOM: - { - if ((y >= cy - GetEdgeMargin(position)) && (y <= cy)) - return wxSASH_BOTTOM; - break; - } - case wxSASH_LEFT: - { - if ((x <= GetEdgeMargin(position)) && (x >= 0)) - return wxSASH_LEFT; - break; - } - case wxSASH_NONE: - { - break; - } - } - } - } - return wxSASH_NONE; -} - -// Draw 3D effect borders -void wxSashWindow::DrawBorders(wxDC& dc) -{ - int w, h; - GetClientSize(&w, &h); - - wxPen mediumShadowPen(m_mediumShadowColour, 1, wxSOLID); - wxPen darkShadowPen(m_darkShadowColour, 1, wxSOLID); - wxPen lightShadowPen(m_lightShadowColour, 1, wxSOLID); - wxPen hilightPen(m_hilightColour, 1, wxSOLID); - - if ( GetWindowStyleFlag() & wxSW_3DBORDER ) - { - dc.SetPen(mediumShadowPen); - dc.DrawLine(0, 0, w-1, 0); - dc.DrawLine(0, 0, 0, h - 1); - - dc.SetPen(darkShadowPen); - dc.DrawLine(1, 1, w-2, 1); - dc.DrawLine(1, 1, 1, h-2); - - dc.SetPen(hilightPen); - dc.DrawLine(0, h-1, w-1, h-1); - dc.DrawLine(w-1, 0, w-1, h); // Surely the maximum y pos. should be h - 1. - /// Anyway, h is required for MSW. - - dc.SetPen(lightShadowPen); - dc.DrawLine(w-2, 1, w-2, h-2); // Right hand side - dc.DrawLine(1, h-2, w-1, h-2); // Bottom - } - else if ( GetWindowStyleFlag() & wxSW_BORDER ) - { - dc.SetBrush(*wxTRANSPARENT_BRUSH); - dc.SetPen(*wxBLACK_PEN); - dc.DrawRectangle(0, 0, w-1, h-1); - } - - dc.SetPen(wxNullPen); - dc.SetBrush(wxNullBrush); -} - -void wxSashWindow::DrawSashes(wxDC& dc) -{ - int i; - for (i = 0; i < 4; i++) - if (m_sashes[i].m_show) - DrawSash((wxSashEdgePosition) i, dc); -} - -// Draw the sash -void wxSashWindow::DrawSash(wxSashEdgePosition edge, wxDC& dc) -{ - int w, h; - GetClientSize(&w, &h); - - wxPen facePen(m_faceColour, 1, wxSOLID); - wxBrush faceBrush(m_faceColour, wxSOLID); - wxPen mediumShadowPen(m_mediumShadowColour, 1, wxSOLID); - wxPen darkShadowPen(m_darkShadowColour, 1, wxSOLID); - wxPen lightShadowPen(m_lightShadowColour, 1, wxSOLID); - wxPen hilightPen(m_hilightColour, 1, wxSOLID); - wxColour blackClr(0, 0, 0); - wxColour whiteClr(255, 255, 255); - wxPen blackPen(blackClr, 1, wxSOLID); - wxPen whitePen(whiteClr, 1, wxSOLID); - - if ( edge == wxSASH_LEFT || edge == wxSASH_RIGHT ) - { - int sashPosition = (edge == wxSASH_LEFT) ? 0 : ( w - GetEdgeMargin(edge) ); - - dc.SetPen(facePen); - dc.SetBrush(faceBrush); - dc.DrawRectangle(sashPosition, 0, GetEdgeMargin(edge), h); - - if (GetWindowStyleFlag() & wxSW_3DSASH) - { - if (edge == wxSASH_LEFT) - { - // Draw a dark grey line on the left to indicate that the - // sash is raised - dc.SetPen(mediumShadowPen); - dc.DrawLine(GetEdgeMargin(edge), 0, GetEdgeMargin(edge), h); - } - else - { - // Draw a highlight line on the right to indicate that the - // sash is raised - dc.SetPen(hilightPen); - dc.DrawLine(w - GetEdgeMargin(edge), 0, w - GetEdgeMargin(edge), h); - } - } - } - else // top or bottom - { - int sashPosition = (edge == wxSASH_TOP) ? 0 : ( h - GetEdgeMargin(edge) ); - - dc.SetPen(facePen); - dc.SetBrush(faceBrush); - dc.DrawRectangle(0, sashPosition, w, GetEdgeMargin(edge)); - - if (GetWindowStyleFlag() & wxSW_3DSASH) - { - if (edge == wxSASH_BOTTOM) - { - // Draw a highlight line on the bottom to indicate that the - // sash is raised - dc.SetPen(hilightPen); - dc.DrawLine(0, h - GetEdgeMargin(edge), w, h - GetEdgeMargin(edge)); - } - else - { - // Draw a drak grey line on the top to indicate that the - // sash is raised - dc.SetPen(mediumShadowPen); - dc.DrawLine(1, GetEdgeMargin(edge), w-1, GetEdgeMargin(edge)); - } - } - } - - dc.SetPen(wxNullPen); - dc.SetBrush(wxNullBrush); -} - -// Draw the sash tracker (for whilst moving the sash) -void wxSashWindow::DrawSashTracker(wxSashEdgePosition edge, int x, int y) -{ - int w, h; - GetClientSize(&w, &h); - - wxScreenDC screenDC; - int x1, y1; - int x2, y2; - - if ( edge == wxSASH_LEFT || edge == wxSASH_RIGHT ) - { - x1 = x; y1 = 2; - x2 = x; y2 = h-2; - - if ( (edge == wxSASH_LEFT) && (x1 > w) ) - { - x1 = w; x2 = w; - } - else if ( (edge == wxSASH_RIGHT) && (x1 < 0) ) - { - x1 = 0; x2 = 0; - } - } - else - { - x1 = 2; y1 = y; - x2 = w-2; y2 = y; - - if ( (edge == wxSASH_TOP) && (y1 > h) ) - { - y1 = h; - y2 = h; - } - else if ( (edge == wxSASH_BOTTOM) && (y1 < 0) ) - { - y1 = 0; - y2 = 0; - } - } - - ClientToScreen(&x1, &y1); - ClientToScreen(&x2, &y2); - - wxPen sashTrackerPen(*wxBLACK, 2, wxSOLID); - - screenDC.SetLogicalFunction(wxINVERT); - screenDC.SetPen(sashTrackerPen); - screenDC.SetBrush(*wxTRANSPARENT_BRUSH); - - screenDC.DrawLine(x1, y1, x2, y2); - - screenDC.SetLogicalFunction(wxCOPY); - - screenDC.SetPen(wxNullPen); - screenDC.SetBrush(wxNullBrush); -} - -// Position and size subwindows. -// Note that the border size applies to each subwindow, not -// including the edges next to the sash. -void wxSashWindow::SizeWindows() -{ - int cw, ch; - GetClientSize(&cw, &ch); - - if (GetChildren().GetCount() == 1) - { - wxWindow* child = GetChildren().GetFirst()->GetData(); - - int x = 0; - int y = 0; - int width = cw; - int height = ch; - - // Top - if (m_sashes[0].m_show) - { - y = m_borderSize; - height -= m_borderSize; - } - y += m_extraBorderSize; - - // Left - if (m_sashes[3].m_show) - { - x = m_borderSize; - width -= m_borderSize; - } - x += m_extraBorderSize; - - // Right - if (m_sashes[1].m_show) - { - width -= m_borderSize; - } - width -= 2*m_extraBorderSize; - - // Bottom - if (m_sashes[2].m_show) - { - height -= m_borderSize; - } - height -= 2*m_extraBorderSize; - - child->SetSize(x, y, width, height); - } - else if (GetChildren().GetCount() > 1) - { - // Perhaps multiple children are themselves sash windows. - // TODO: this doesn't really work because the subwindows sizes/positions - // must be set to leave a gap for the parent's sash (hit-test and decorations). - // Perhaps we can allow for this within LayoutWindow, testing whether the parent - // is a sash window, and if so, allowing some space for the edges. - wxLayoutAlgorithm layout; - layout.LayoutWindow(this); - } - - wxClientDC dc(this); - DrawBorders(dc); - DrawSashes(dc); -} - -// Initialize colours -void wxSashWindow::InitColours() -{ - // Shadow colours - m_faceColour = wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE); - m_mediumShadowColour = wxSystemSettings::GetColour(wxSYS_COLOUR_3DSHADOW); - m_darkShadowColour = wxSystemSettings::GetColour(wxSYS_COLOUR_3DDKSHADOW); - m_lightShadowColour = wxSystemSettings::GetColour(wxSYS_COLOUR_3DLIGHT); - m_hilightColour = wxSystemSettings::GetColour(wxSYS_COLOUR_3DHILIGHT); -} - -void wxSashWindow::SetSashVisible(wxSashEdgePosition edge, bool sash) -{ - m_sashes[edge].m_show = sash; - if (sash) - m_sashes[edge].m_margin = m_borderSize; - else - m_sashes[edge].m_margin = 0; -} - -#if defined( __WXMSW__ ) || defined( __WXMAC__) - -// this is currently called (and needed) under MSW only... -void wxSashWindow::OnSetCursor(wxSetCursorEvent& event) -{ - // if we don't do it, the resizing cursor might be set for child window: - // and like this we explicitly say that our cursor should not be used for - // children windows which overlap us - - if ( SashHitTest(event.GetX(), event.GetY()) != wxSASH_NONE) - { - // default processing is ok - event.Skip(); - } - //else: do nothing, in particular, don't call Skip() -} - -#endif // __WXMSW__ || __WXMAC__ - -#endif // wxUSE_SASH diff --git a/wxWidgets/src/generic/scrlwing.cpp b/wxWidgets/src/generic/scrlwing.cpp deleted file mode 100644 index 2ecc8d5533..0000000000 --- a/wxWidgets/src/generic/scrlwing.cpp +++ /dev/null @@ -1,1542 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/generic/scrlwing.cpp -// Purpose: wxScrolledWindow implementation -// Author: Julian Smart -// Modified by: Vadim Zeitlin on 31.08.00: wxScrollHelper allows to implement. -// Ron Lee on 10.4.02: virtual size / auto scrollbars et al. -// Created: 01/02/97 -// RCS-ID: $Id: scrlwing.cpp 60600 2009-05-12 10:33:49Z VZ $ -// Copyright: (c) wxWidgets team -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#include "wx/scrolwin.h" - -#ifndef WX_PRECOMP - #include "wx/utils.h" - #include "wx/panel.h" - #include "wx/dcclient.h" - #if wxUSE_TIMER - #include "wx/timer.h" - #endif - #include "wx/sizer.h" - #include "wx/settings.h" -#endif - -#ifdef __WXMAC__ -#include "wx/scrolbar.h" -#endif - -#include "wx/recguard.h" - -#ifdef __WXMSW__ - #include // for DLGC_WANTARROWS - #include "wx/msw/winundef.h" -#endif - -#ifdef __WXMOTIF__ -// For wxRETAINED implementation -#ifdef __VMS__ //VMS's Xm.h is not (yet) compatible with C++ - //This code switches off the compiler warnings -# pragma message disable nosimpint -#endif -#include -#ifdef __VMS__ -# pragma message enable nosimpint -#endif -#endif - -/* - TODO PROPERTIES - style wxHSCROLL | wxVSCROLL -*/ - -// ---------------------------------------------------------------------------- -// wxScrollHelperEvtHandler: intercept the events from the window and forward -// them to wxScrollHelper -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxScrollHelperEvtHandler : public wxEvtHandler -{ -public: - wxScrollHelperEvtHandler(wxScrollHelper *scrollHelper) - { - m_scrollHelper = scrollHelper; - } - - virtual bool ProcessEvent(wxEvent& event); - - void ResetDrawnFlag() { m_hasDrawnWindow = false; } - -private: - wxScrollHelper *m_scrollHelper; - - bool m_hasDrawnWindow; - - DECLARE_NO_COPY_CLASS(wxScrollHelperEvtHandler) -}; - -#if wxUSE_TIMER -// ---------------------------------------------------------------------------- -// wxAutoScrollTimer: the timer used to generate a stream of scroll events when -// a captured mouse is held outside the window -// ---------------------------------------------------------------------------- - -class wxAutoScrollTimer : public wxTimer -{ -public: - wxAutoScrollTimer(wxWindow *winToScroll, wxScrollHelper *scroll, - wxEventType eventTypeToSend, - int pos, int orient); - - virtual void Notify(); - -private: - wxWindow *m_win; - wxScrollHelper *m_scrollHelper; - wxEventType m_eventType; - int m_pos, - m_orient; - - DECLARE_NO_COPY_CLASS(wxAutoScrollTimer) -}; - -// ============================================================================ -// implementation -// ============================================================================ - -// ---------------------------------------------------------------------------- -// wxAutoScrollTimer -// ---------------------------------------------------------------------------- - -wxAutoScrollTimer::wxAutoScrollTimer(wxWindow *winToScroll, - wxScrollHelper *scroll, - wxEventType eventTypeToSend, - int pos, int orient) -{ - m_win = winToScroll; - m_scrollHelper = scroll; - m_eventType = eventTypeToSend; - m_pos = pos; - m_orient = orient; -} - -void wxAutoScrollTimer::Notify() -{ - // only do all this as long as the window is capturing the mouse - if ( wxWindow::GetCapture() != m_win ) - { - Stop(); - } - else // we still capture the mouse, continue generating events - { - // first scroll the window if we are allowed to do it - wxScrollWinEvent event1(m_eventType, m_pos, m_orient); - event1.SetEventObject(m_win); - if ( m_scrollHelper->SendAutoScrollEvents(event1) && - m_win->GetEventHandler()->ProcessEvent(event1) ) - { - // and then send a pseudo mouse-move event to refresh the selection - wxMouseEvent event2(wxEVT_MOTION); - wxGetMousePosition(&event2.m_x, &event2.m_y); - - // the mouse event coordinates should be client, not screen as - // returned by wxGetMousePosition - wxWindow *parentTop = m_win; - while ( parentTop->GetParent() ) - parentTop = parentTop->GetParent(); - wxPoint ptOrig = parentTop->GetPosition(); - event2.m_x -= ptOrig.x; - event2.m_y -= ptOrig.y; - - event2.SetEventObject(m_win); - - // FIXME: we don't fill in the other members - ok? - - m_win->GetEventHandler()->ProcessEvent(event2); - } - else // can't scroll further, stop - { - Stop(); - } - } -} -#endif - -// ---------------------------------------------------------------------------- -// wxScrollHelperEvtHandler -// ---------------------------------------------------------------------------- - -bool wxScrollHelperEvtHandler::ProcessEvent(wxEvent& event) -{ - wxEventType evType = event.GetEventType(); - - // the explanation of wxEVT_PAINT processing hack: for historic reasons - // there are 2 ways to process this event in classes deriving from - // wxScrolledWindow. The user code may - // - // 1. override wxScrolledWindow::OnDraw(dc) - // 2. define its own OnPaint() handler - // - // In addition, in wxUniversal wxWindow defines OnPaint() itself and - // always processes the draw event, so we can't just try the window - // OnPaint() first and call our HandleOnPaint() if it doesn't process it - // (the latter would never be called in wxUniversal). - // - // So the solution is to have a flag telling us whether the user code drew - // anything in the window. We set it to true here but reset it to false in - // wxScrolledWindow::OnPaint() handler (which wouldn't be called if the - // user code defined OnPaint() in the derived class) - m_hasDrawnWindow = true; - - // pass it on to the real handler - bool processed = wxEvtHandler::ProcessEvent(event); - - // always process the size events ourselves, even if the user code handles - // them as well, as we need to AdjustScrollbars() - // - // NB: it is important to do it after processing the event in the normal - // way as HandleOnSize() may generate a wxEVT_SIZE itself if the - // scrollbar[s] (dis)appear and it should be seen by the user code - // after this one - if ( evType == wxEVT_SIZE ) - { - m_scrollHelper->HandleOnSize((wxSizeEvent &)event); - - return true; - } - - if ( processed ) - { - // normally, nothing more to do here - except if it was a paint event - // which wasn't really processed, then we'll try to call our - // OnDraw() below (from HandleOnPaint) - if ( m_hasDrawnWindow || event.IsCommandEvent() ) - { - return true; - } - } - - // reset the skipped flag to false as it might have been set to true in - // ProcessEvent() above - event.Skip(false); - - if ( evType == wxEVT_PAINT ) - { - m_scrollHelper->HandleOnPaint((wxPaintEvent &)event); - return true; - } - - if ( evType == wxEVT_CHILD_FOCUS ) - { - m_scrollHelper->HandleOnChildFocus((wxChildFocusEvent &)event); - return true; - } - - if ( evType == wxEVT_SCROLLWIN_TOP || - evType == wxEVT_SCROLLWIN_BOTTOM || - evType == wxEVT_SCROLLWIN_LINEUP || - evType == wxEVT_SCROLLWIN_LINEDOWN || - evType == wxEVT_SCROLLWIN_PAGEUP || - evType == wxEVT_SCROLLWIN_PAGEDOWN || - evType == wxEVT_SCROLLWIN_THUMBTRACK || - evType == wxEVT_SCROLLWIN_THUMBRELEASE ) - { - m_scrollHelper->HandleOnScroll((wxScrollWinEvent &)event); - return !event.GetSkipped(); - } - - if ( evType == wxEVT_ENTER_WINDOW ) - { - m_scrollHelper->HandleOnMouseEnter((wxMouseEvent &)event); - } - else if ( evType == wxEVT_LEAVE_WINDOW ) - { - m_scrollHelper->HandleOnMouseLeave((wxMouseEvent &)event); - } -#if wxUSE_MOUSEWHEEL - else if ( evType == wxEVT_MOUSEWHEEL ) - { - m_scrollHelper->HandleOnMouseWheel((wxMouseEvent &)event); - return true; - } -#endif // wxUSE_MOUSEWHEEL - else if ( evType == wxEVT_CHAR ) - { - m_scrollHelper->HandleOnChar((wxKeyEvent &)event); - return !event.GetSkipped(); - } - - return false; -} - -// ---------------------------------------------------------------------------- -// wxScrollHelper construction -// ---------------------------------------------------------------------------- - -wxScrollHelper::wxScrollHelper(wxWindow *win) -{ - wxASSERT_MSG( win, _T("associated window can't be NULL in wxScrollHelper") ); - - m_xScrollPixelsPerLine = - m_yScrollPixelsPerLine = - m_xScrollPosition = - m_yScrollPosition = - m_xScrollLines = - m_yScrollLines = - m_xScrollLinesPerPage = - m_yScrollLinesPerPage = 0; - - m_xScrollingEnabled = - m_yScrollingEnabled = true; - - m_scaleX = - m_scaleY = 1.0; -#if wxUSE_MOUSEWHEEL - m_wheelRotation = 0; -#endif - - m_win = - m_targetWindow = (wxWindow *)NULL; - - m_timerAutoScroll = (wxTimer *)NULL; - - m_handler = NULL; - - m_win = win; - - m_win->SetScrollHelper( this ); - - // by default, the associated window is also the target window - DoSetTargetWindow(win); -} - -wxScrollHelper::~wxScrollHelper() -{ - StopAutoScrolling(); - - DeleteEvtHandler(); -} - -// ---------------------------------------------------------------------------- -// setting scrolling parameters -// ---------------------------------------------------------------------------- - -void wxScrollHelper::SetScrollbars(int pixelsPerUnitX, - int pixelsPerUnitY, - int noUnitsX, - int noUnitsY, - int xPos, - int yPos, - bool noRefresh) -{ - int xpos, ypos; - - CalcUnscrolledPosition(xPos, yPos, &xpos, &ypos); - bool do_refresh = - ( - (noUnitsX != 0 && m_xScrollLines == 0) || - (noUnitsX < m_xScrollLines && xpos > pixelsPerUnitX * noUnitsX) || - - (noUnitsY != 0 && m_yScrollLines == 0) || - (noUnitsY < m_yScrollLines && ypos > pixelsPerUnitY * noUnitsY) || - (xPos != m_xScrollPosition) || - (yPos != m_yScrollPosition) - ); - - m_xScrollPixelsPerLine = pixelsPerUnitX; - m_yScrollPixelsPerLine = pixelsPerUnitY; - m_xScrollPosition = xPos; - m_yScrollPosition = yPos; - - int w = noUnitsX * pixelsPerUnitX; - int h = noUnitsY * pixelsPerUnitY; - - // For better backward compatibility we set persisting limits - // here not just the size. It makes SetScrollbars 'sticky' - // emulating the old non-autoscroll behaviour. - // m_targetWindow->SetVirtualSizeHints( w, h ); - - // The above should arguably be deprecated, this however we still need. - - // take care not to set 0 virtual size, 0 means that we don't have any - // scrollbars and hence we should use the real size instead of the virtual - // one which is indicated by using wxDefaultCoord - m_targetWindow->SetVirtualSize( w ? w : wxDefaultCoord, - h ? h : wxDefaultCoord); - - if (do_refresh && !noRefresh) - m_targetWindow->Refresh(true, GetScrollRect()); - -#ifndef __WXUNIVERSAL__ - // If the target is not the same as the window with the scrollbars, - // then we need to update the scrollbars here, since they won't have - // been updated by SetVirtualSize(). - if ( m_targetWindow != m_win ) -#endif // !__WXUNIVERSAL__ - { - AdjustScrollbars(); - } -#ifndef __WXUNIVERSAL__ - else - { - // otherwise this has been done by AdjustScrollbars, above - } -#endif // !__WXUNIVERSAL__ -} - -// ---------------------------------------------------------------------------- -// [target] window handling -// ---------------------------------------------------------------------------- - -void wxScrollHelper::DeleteEvtHandler() -{ - // search for m_handler in the handler list - if ( m_win && m_handler ) - { - if ( m_win->RemoveEventHandler(m_handler) ) - { - delete m_handler; - } - //else: something is very wrong, so better [maybe] leak memory than - // risk a crash because of double deletion - - m_handler = NULL; - } -} - -void wxScrollHelper::DoSetTargetWindow(wxWindow *target) -{ - m_targetWindow = target; -#ifdef __WXMAC__ - target->MacSetClipChildren( true ) ; -#endif - - // install the event handler which will intercept the events we're - // interested in (but only do it for our real window, not the target window - // which we scroll - we don't need to hijack its events) - if ( m_targetWindow == m_win ) - { - // if we already have a handler, delete it first - DeleteEvtHandler(); - - m_handler = new wxScrollHelperEvtHandler(this); - m_targetWindow->PushEventHandler(m_handler); - } -} - -void wxScrollHelper::SetTargetWindow(wxWindow *target) -{ - wxCHECK_RET( target, wxT("target window must not be NULL") ); - - if ( target == m_targetWindow ) - return; - - DoSetTargetWindow(target); -} - -wxWindow *wxScrollHelper::GetTargetWindow() const -{ - return m_targetWindow; -} - -// ---------------------------------------------------------------------------- -// scrolling implementation itself -// ---------------------------------------------------------------------------- - -void wxScrollHelper::HandleOnScroll(wxScrollWinEvent& event) -{ - int nScrollInc = CalcScrollInc(event); - if ( nScrollInc == 0 ) - { - // can't scroll further - event.Skip(); - - return; - } - - bool needsRefresh = false; - - int dx = 0, - dy = 0; - int orient = event.GetOrientation(); - if (orient == wxHORIZONTAL) - { - if ( m_xScrollingEnabled ) - { - dx = -m_xScrollPixelsPerLine * nScrollInc; - } - else - { - needsRefresh = true; - } - } - else - { - if ( m_yScrollingEnabled ) - { - dy = -m_yScrollPixelsPerLine * nScrollInc; - } - else - { - needsRefresh = true; - } - } - - if ( !needsRefresh ) - { - // flush all pending repaints before we change m_{x,y}ScrollPosition, as - // otherwise invalidated area could be updated incorrectly later when - // ScrollWindow() makes sure they're repainted before scrolling them -#ifdef __WXMAC__ - // wxWindowMac is taking care of making sure the update area is correctly - // set up, while not forcing an immediate redraw -#else - m_targetWindow->Update(); -#endif - } - - if (orient == wxHORIZONTAL) - { - m_xScrollPosition += nScrollInc; - m_win->SetScrollPos(wxHORIZONTAL, m_xScrollPosition); - } - else - { - m_yScrollPosition += nScrollInc; - m_win->SetScrollPos(wxVERTICAL, m_yScrollPosition); - } - - if ( needsRefresh ) - { - m_targetWindow->Refresh(true, GetScrollRect()); - } - else - { - m_targetWindow->ScrollWindow(dx, dy, GetScrollRect()); - } -} - -int wxScrollHelper::CalcScrollInc(wxScrollWinEvent& event) -{ - int pos = event.GetPosition(); - int orient = event.GetOrientation(); - - int nScrollInc = 0; - if (event.GetEventType() == wxEVT_SCROLLWIN_TOP) - { - if (orient == wxHORIZONTAL) - nScrollInc = - m_xScrollPosition; - else - nScrollInc = - m_yScrollPosition; - } else - if (event.GetEventType() == wxEVT_SCROLLWIN_BOTTOM) - { - if (orient == wxHORIZONTAL) - nScrollInc = m_xScrollLines - m_xScrollPosition; - else - nScrollInc = m_yScrollLines - m_yScrollPosition; - } else - if (event.GetEventType() == wxEVT_SCROLLWIN_LINEUP) - { - nScrollInc = -1; - } else - if (event.GetEventType() == wxEVT_SCROLLWIN_LINEDOWN) - { - nScrollInc = 1; - } else - if (event.GetEventType() == wxEVT_SCROLLWIN_PAGEUP) - { - if (orient == wxHORIZONTAL) - nScrollInc = -GetScrollPageSize(wxHORIZONTAL); - else - nScrollInc = -GetScrollPageSize(wxVERTICAL); - } else - if (event.GetEventType() == wxEVT_SCROLLWIN_PAGEDOWN) - { - if (orient == wxHORIZONTAL) - nScrollInc = GetScrollPageSize(wxHORIZONTAL); - else - nScrollInc = GetScrollPageSize(wxVERTICAL); - } else - if ((event.GetEventType() == wxEVT_SCROLLWIN_THUMBTRACK) || - (event.GetEventType() == wxEVT_SCROLLWIN_THUMBRELEASE)) - { - if (orient == wxHORIZONTAL) - nScrollInc = pos - m_xScrollPosition; - else - nScrollInc = pos - m_yScrollPosition; - } - - if (orient == wxHORIZONTAL) - { - if (m_xScrollPixelsPerLine > 0) - { - if ( m_xScrollPosition + nScrollInc < 0 ) - { - // As -ve as we can go - nScrollInc = -m_xScrollPosition; - } - else // check for the other bound - { - const int posMax = m_xScrollLines - m_xScrollLinesPerPage; - if ( m_xScrollPosition + nScrollInc > posMax ) - { - // As +ve as we can go - nScrollInc = posMax - m_xScrollPosition; - } - } - } - else - m_targetWindow->Refresh(true, GetScrollRect()); - } - else - { - if ( m_yScrollPixelsPerLine > 0 ) - { - if ( m_yScrollPosition + nScrollInc < 0 ) - { - // As -ve as we can go - nScrollInc = -m_yScrollPosition; - } - else // check for the other bound - { - const int posMax = m_yScrollLines - m_yScrollLinesPerPage; - if ( m_yScrollPosition + nScrollInc > posMax ) - { - // As +ve as we can go - nScrollInc = posMax - m_yScrollPosition; - } - } - } - else - { - // VZ: why do we do this? (FIXME) - m_targetWindow->Refresh(true, GetScrollRect()); - } - } - - return nScrollInc; -} - -// Adjust the scrollbars - new version. -void wxScrollHelper::AdjustScrollbars() -{ - static wxRecursionGuardFlag s_flagReentrancy; - wxRecursionGuard guard(s_flagReentrancy); - if ( guard.IsInside() ) - { - // don't reenter AdjustScrollbars() while another call to - // AdjustScrollbars() is in progress because this may lead to calling - // ScrollWindow() twice and this can really happen under MSW if - // SetScrollbar() call below adds or removes the scrollbar which - // changes the window size and hence results in another - // AdjustScrollbars() call - return; - } - - int w = 0, h = 0; - int oldw, oldh; - - int oldXScroll = m_xScrollPosition; - int oldYScroll = m_yScrollPosition; - - // VZ: at least under Windows this loop is useless because when scrollbars - // [dis]appear we get a WM_SIZE resulting in another call to - // AdjustScrollbars() anyhow. As it doesn't seem to do any harm I leave - // it here for now but it would be better to ensure that all ports - // generate EVT_SIZE when scrollbars [dis]appear, emulating it if - // necessary, and remove it later - // JACS: Stop potential infinite loop by limiting number of iterations - int iterationCount = 0; - const int iterationMax = 5; - do - { - iterationCount ++; - - GetTargetSize(&w, 0); - - // scroll lines per page: if 0, no scrolling is needed - int linesPerPage; - - if ( m_xScrollPixelsPerLine == 0 ) - { - // scrolling is disabled - m_xScrollLines = 0; - m_xScrollPosition = 0; - linesPerPage = 0; - } - else // might need scrolling - { - // Round up integer division to catch any "leftover" client space. - const int wVirt = m_targetWindow->GetVirtualSize().GetWidth(); - m_xScrollLines = (wVirt + m_xScrollPixelsPerLine - 1) / m_xScrollPixelsPerLine; - - // Calculate page size i.e. number of scroll units you get on the - // current client window. - linesPerPage = w / m_xScrollPixelsPerLine; - - // Special case. When client and virtual size are very close but - // the client is big enough, kill scrollbar. - if ((linesPerPage < m_xScrollLines) && (w >= wVirt)) ++linesPerPage; - - if (linesPerPage >= m_xScrollLines) - { - // we're big enough to not need scrolling - linesPerPage = - m_xScrollLines = - m_xScrollPosition = 0; - } - else // we do need a scrollbar - { - if ( linesPerPage < 1 ) - linesPerPage = 1; - - // Correct position if greater than extent of canvas minus - // the visible portion of it or if below zero - const int posMax = m_xScrollLines - linesPerPage; - if ( m_xScrollPosition > posMax ) - m_xScrollPosition = posMax; - else if ( m_xScrollPosition < 0 ) - m_xScrollPosition = 0; - } - } - - m_win->SetScrollbar(wxHORIZONTAL, m_xScrollPosition, - linesPerPage, m_xScrollLines); - - // The amount by which we scroll when paging - SetScrollPageSize(wxHORIZONTAL, linesPerPage); - - GetTargetSize(0, &h); - - if ( m_yScrollPixelsPerLine == 0 ) - { - // scrolling is disabled - m_yScrollLines = 0; - m_yScrollPosition = 0; - linesPerPage = 0; - } - else // might need scrolling - { - // Round up integer division to catch any "leftover" client space. - const int hVirt = m_targetWindow->GetVirtualSize().GetHeight(); - m_yScrollLines = ( hVirt + m_yScrollPixelsPerLine - 1 ) / m_yScrollPixelsPerLine; - - // Calculate page size i.e. number of scroll units you get on the - // current client window. - linesPerPage = h / m_yScrollPixelsPerLine; - - // Special case. When client and virtual size are very close but - // the client is big enough, kill scrollbar. - if ((linesPerPage < m_yScrollLines) && (h >= hVirt)) ++linesPerPage; - - if (linesPerPage >= m_yScrollLines) - { - // we're big enough to not need scrolling - linesPerPage = - m_yScrollLines = - m_yScrollPosition = 0; - } - else // we do need a scrollbar - { - if ( linesPerPage < 1 ) - linesPerPage = 1; - - // Correct position if greater than extent of canvas minus - // the visible portion of it or if below zero - const int posMax = m_yScrollLines - linesPerPage; - if ( m_yScrollPosition > posMax ) - m_yScrollPosition = posMax; - else if ( m_yScrollPosition < 0 ) - m_yScrollPosition = 0; - } - } - - m_win->SetScrollbar(wxVERTICAL, m_yScrollPosition, - linesPerPage, m_yScrollLines); - - // The amount by which we scroll when paging - SetScrollPageSize(wxVERTICAL, linesPerPage); - - - // If a scrollbar (dis)appeared as a result of this, adjust them again. - oldw = w; - oldh = h; - - GetTargetSize( &w, &h ); - } while ( (w != oldw || h != oldh) && (iterationCount < iterationMax) ); - -#ifdef __WXMOTIF__ - // Sorry, some Motif-specific code to implement a backing pixmap - // for the wxRETAINED style. Implementing a backing store can't - // be entirely generic because it relies on the wxWindowDC implementation - // to duplicate X drawing calls for the backing pixmap. - - if ( m_targetWindow->GetWindowStyle() & wxRETAINED ) - { - Display* dpy = XtDisplay((Widget)m_targetWindow->GetMainWidget()); - - int totalPixelWidth = m_xScrollLines * m_xScrollPixelsPerLine; - int totalPixelHeight = m_yScrollLines * m_yScrollPixelsPerLine; - if (m_targetWindow->GetBackingPixmap() && - !((m_targetWindow->GetPixmapWidth() == totalPixelWidth) && - (m_targetWindow->GetPixmapHeight() == totalPixelHeight))) - { - XFreePixmap (dpy, (Pixmap) m_targetWindow->GetBackingPixmap()); - m_targetWindow->SetBackingPixmap((WXPixmap) 0); - } - - if (!m_targetWindow->GetBackingPixmap() && - (m_xScrollLines != 0) && (m_yScrollLines != 0)) - { - int depth = wxDisplayDepth(); - m_targetWindow->SetPixmapWidth(totalPixelWidth); - m_targetWindow->SetPixmapHeight(totalPixelHeight); - m_targetWindow->SetBackingPixmap((WXPixmap) XCreatePixmap (dpy, RootWindow (dpy, DefaultScreen (dpy)), - m_targetWindow->GetPixmapWidth(), m_targetWindow->GetPixmapHeight(), depth)); - } - - } -#endif // Motif - - if (oldXScroll != m_xScrollPosition) - { - if (m_xScrollingEnabled) - m_targetWindow->ScrollWindow( m_xScrollPixelsPerLine * (oldXScroll - m_xScrollPosition), 0, - GetScrollRect() ); - else - m_targetWindow->Refresh(true, GetScrollRect()); - } - - if (oldYScroll != m_yScrollPosition) - { - if (m_yScrollingEnabled) - m_targetWindow->ScrollWindow( 0, m_yScrollPixelsPerLine * (oldYScroll-m_yScrollPosition), - GetScrollRect() ); - else - m_targetWindow->Refresh(true, GetScrollRect()); - } -} - -void wxScrollHelper::DoPrepareDC(wxDC& dc) -{ - wxPoint pt = dc.GetDeviceOrigin(); -#ifdef __WXGTK__ - // It may actually be correct to always query - // the m_sign from the DC here, but I leve the - // #ifdef GTK for now. - if (m_win->GetLayoutDirection() == wxLayout_RightToLeft) - dc.SetDeviceOrigin( pt.x + m_xScrollPosition * m_xScrollPixelsPerLine, - pt.y - m_yScrollPosition * m_yScrollPixelsPerLine ); - else -#endif - dc.SetDeviceOrigin( pt.x - m_xScrollPosition * m_xScrollPixelsPerLine, - pt.y - m_yScrollPosition * m_yScrollPixelsPerLine ); - dc.SetUserScale( m_scaleX, m_scaleY ); -} - -void wxScrollHelper::SetScrollRate( int xstep, int ystep ) -{ - int old_x = m_xScrollPixelsPerLine * m_xScrollPosition; - int old_y = m_yScrollPixelsPerLine * m_yScrollPosition; - - m_xScrollPixelsPerLine = xstep; - m_yScrollPixelsPerLine = ystep; - - int new_x = m_xScrollPixelsPerLine * m_xScrollPosition; - int new_y = m_yScrollPixelsPerLine * m_yScrollPosition; - - m_win->SetScrollPos( wxHORIZONTAL, m_xScrollPosition ); - m_win->SetScrollPos( wxVERTICAL, m_yScrollPosition ); - m_targetWindow->ScrollWindow( old_x - new_x, old_y - new_y ); - - AdjustScrollbars(); -} - -void wxScrollHelper::GetScrollPixelsPerUnit (int *x_unit, int *y_unit) const -{ - if ( x_unit ) - *x_unit = m_xScrollPixelsPerLine; - if ( y_unit ) - *y_unit = m_yScrollPixelsPerLine; -} - - -int wxScrollHelper::GetScrollLines( int orient ) const -{ - if ( orient == wxHORIZONTAL ) - return m_xScrollLines; - else - return m_yScrollLines; -} - -int wxScrollHelper::GetScrollPageSize(int orient) const -{ - if ( orient == wxHORIZONTAL ) - return m_xScrollLinesPerPage; - else - return m_yScrollLinesPerPage; -} - -void wxScrollHelper::SetScrollPageSize(int orient, int pageSize) -{ - if ( orient == wxHORIZONTAL ) - m_xScrollLinesPerPage = pageSize; - else - m_yScrollLinesPerPage = pageSize; -} - -/* - * Scroll to given position (scroll position, not pixel position) - */ -void wxScrollHelper::Scroll( int x_pos, int y_pos ) -{ - if (!m_targetWindow) - return; - - if (((x_pos == -1) || (x_pos == m_xScrollPosition)) && - ((y_pos == -1) || (y_pos == m_yScrollPosition))) return; - - int w = 0, h = 0; - GetTargetSize(&w, &h); - - // compute new position: - int new_x = m_xScrollPosition; - int new_y = m_yScrollPosition; - - if ((x_pos != -1) && (m_xScrollPixelsPerLine)) - { - new_x = x_pos; - - // Calculate page size i.e. number of scroll units you get on the - // current client window - int noPagePositions = w/m_xScrollPixelsPerLine; - if (noPagePositions < 1) noPagePositions = 1; - - // Correct position if greater than extent of canvas minus - // the visible portion of it or if below zero - new_x = wxMin( m_xScrollLines-noPagePositions, new_x ); - new_x = wxMax( 0, new_x ); - } - if ((y_pos != -1) && (m_yScrollPixelsPerLine)) - { - new_y = y_pos; - - // Calculate page size i.e. number of scroll units you get on the - // current client window - int noPagePositions = h/m_yScrollPixelsPerLine; - if (noPagePositions < 1) noPagePositions = 1; - - // Correct position if greater than extent of canvas minus - // the visible portion of it or if below zero - new_y = wxMin( m_yScrollLines-noPagePositions, new_y ); - new_y = wxMax( 0, new_y ); - } - - if ( new_x == m_xScrollPosition && new_y == m_yScrollPosition ) - return; // nothing to do, the position didn't change - - // flush all pending repaints before we change m_{x,y}ScrollPosition, as - // otherwise invalidated area could be updated incorrectly later when - // ScrollWindow() makes sure they're repainted before scrolling them - m_targetWindow->Update(); - - // update the position and scroll the window now: - if (m_xScrollPosition != new_x) - { - int old_x = m_xScrollPosition; - m_xScrollPosition = new_x; - m_win->SetScrollPos( wxHORIZONTAL, new_x ); - m_targetWindow->ScrollWindow( (old_x-new_x)*m_xScrollPixelsPerLine, 0, - GetScrollRect() ); - } - - if (m_yScrollPosition != new_y) - { - int old_y = m_yScrollPosition; - m_yScrollPosition = new_y; - m_win->SetScrollPos( wxVERTICAL, new_y ); - m_targetWindow->ScrollWindow( 0, (old_y-new_y)*m_yScrollPixelsPerLine, - GetScrollRect() ); - } -} - -void wxScrollHelper::EnableScrolling (bool x_scroll, bool y_scroll) -{ - m_xScrollingEnabled = x_scroll; - m_yScrollingEnabled = y_scroll; -} - -// Where the current view starts from -void wxScrollHelper::GetViewStart (int *x, int *y) const -{ - if ( x ) - *x = m_xScrollPosition; - if ( y ) - *y = m_yScrollPosition; -} - -void wxScrollHelper::DoCalcScrolledPosition(int x, int y, int *xx, int *yy) const -{ - if ( xx ) - *xx = x - m_xScrollPosition * m_xScrollPixelsPerLine; - if ( yy ) - *yy = y - m_yScrollPosition * m_yScrollPixelsPerLine; -} - -void wxScrollHelper::DoCalcUnscrolledPosition(int x, int y, int *xx, int *yy) const -{ - if ( xx ) - *xx = x + m_xScrollPosition * m_xScrollPixelsPerLine; - if ( yy ) - *yy = y + m_yScrollPosition * m_yScrollPixelsPerLine; -} - -// ---------------------------------------------------------------------------- -// geometry -// ---------------------------------------------------------------------------- - -bool wxScrollHelper::ScrollLayout() -{ - if ( m_win->GetSizer() && m_targetWindow == m_win ) - { - // If we're the scroll target, take into account the - // virtual size and scrolled position of the window. - - int x = 0, y = 0, w = 0, h = 0; - CalcScrolledPosition(0,0, &x,&y); - m_win->GetVirtualSize(&w, &h); - m_win->GetSizer()->SetDimension(x, y, w, h); - return true; - } - - // fall back to default for LayoutConstraints - return m_win->wxWindow::Layout(); -} - -void wxScrollHelper::ScrollDoSetVirtualSize(int x, int y) -{ - m_win->wxWindow::DoSetVirtualSize( x, y ); - AdjustScrollbars(); - - if (m_win->GetAutoLayout()) - m_win->Layout(); -} - -// wxWindow's GetBestVirtualSize returns the actual window size, -// whereas we want to return the virtual size -wxSize wxScrollHelper::ScrollGetBestVirtualSize() const -{ - wxSize clientSize(m_win->GetClientSize()); - if ( m_win->GetSizer() ) - clientSize.IncTo(m_win->GetSizer()->CalcMin()); - - return clientSize; -} - -// return the window best size from the given best virtual size -wxSize -wxScrollHelper::ScrollGetWindowSizeForVirtualSize(const wxSize& size) const -{ - // Only use the content to set the window size in the direction - // where there's no scrolling; otherwise we're going to get a huge - // window in the direction in which scrolling is enabled - int ppuX, ppuY; - GetScrollPixelsPerUnit(&ppuX, &ppuY); - - wxSize minSize = m_win->GetMinSize(); - - wxSize best(size); - if (ppuX > 0) - best.x = minSize.x + wxSystemSettings::GetMetric(wxSYS_VSCROLL_X); - if (ppuY > 0) - best.y = minSize.y + wxSystemSettings::GetMetric(wxSYS_HSCROLL_Y); - - return best; -} - -// ---------------------------------------------------------------------------- -// event handlers -// ---------------------------------------------------------------------------- - -// Default OnSize resets scrollbars, if any -void wxScrollHelper::HandleOnSize(wxSizeEvent& WXUNUSED(event)) -{ - if ( m_targetWindow->GetAutoLayout() ) - { - wxSize size = m_targetWindow->GetBestVirtualSize(); - - // This will call ::Layout() and ::AdjustScrollbars() - m_win->SetVirtualSize( size ); - } - else - { - AdjustScrollbars(); - } -} - -// This calls OnDraw, having adjusted the origin according to the current -// scroll position -void wxScrollHelper::HandleOnPaint(wxPaintEvent& WXUNUSED(event)) -{ - // don't use m_targetWindow here, this is always called for ourselves - wxPaintDC dc(m_win); - DoPrepareDC(dc); - - OnDraw(dc); -} - -// kbd handling: notice that we use OnChar() and not OnKeyDown() for -// compatibility here - if we used OnKeyDown(), the programs which process -// arrows themselves in their OnChar() would never get the message and like -// this they always have the priority -void wxScrollHelper::HandleOnChar(wxKeyEvent& event) -{ - int stx = 0, sty = 0, // view origin - szx = 0, szy = 0, // view size (total) - clix = 0, cliy = 0; // view size (on screen) - - GetViewStart(&stx, &sty); - GetTargetSize(&clix, &cliy); - m_targetWindow->GetVirtualSize(&szx, &szy); - - if( m_xScrollPixelsPerLine ) - { - clix /= m_xScrollPixelsPerLine; - szx /= m_xScrollPixelsPerLine; - } - else - { - clix = 0; - szx = -1; - } - if( m_yScrollPixelsPerLine ) - { - cliy /= m_yScrollPixelsPerLine; - szy /= m_yScrollPixelsPerLine; - } - else - { - cliy = 0; - szy = -1; - } - - int xScrollOld = m_xScrollPosition, - yScrollOld = m_yScrollPosition; - - int dsty; - switch ( event.GetKeyCode() ) - { - case WXK_PAGEUP: - dsty = sty - (5 * cliy / 6); - Scroll(-1, (dsty == -1) ? 0 : dsty); - break; - - case WXK_PAGEDOWN: - Scroll(-1, sty + (5 * cliy / 6)); - break; - - case WXK_HOME: - Scroll(0, event.ControlDown() ? 0 : -1); - break; - - case WXK_END: - Scroll(szx - clix, event.ControlDown() ? szy - cliy : -1); - break; - - case WXK_UP: - Scroll(-1, sty - 1); - break; - - case WXK_DOWN: - Scroll(-1, sty + 1); - break; - - case WXK_LEFT: - Scroll(stx - 1, -1); - break; - - case WXK_RIGHT: - Scroll(stx + 1, -1); - break; - - default: - // not for us - event.Skip(); - } - - if ( m_xScrollPosition != xScrollOld ) - { - wxScrollWinEvent event(wxEVT_SCROLLWIN_THUMBTRACK, m_xScrollPosition, - wxHORIZONTAL); - event.SetEventObject(m_win); - m_win->GetEventHandler()->ProcessEvent(event); - } - - if ( m_yScrollPosition != yScrollOld ) - { - wxScrollWinEvent event(wxEVT_SCROLLWIN_THUMBTRACK, m_yScrollPosition, - wxVERTICAL); - event.SetEventObject(m_win); - m_win->GetEventHandler()->ProcessEvent(event); - } -} - -// ---------------------------------------------------------------------------- -// autoscroll stuff: these functions deal with sending fake scroll events when -// a captured mouse is being held outside the window -// ---------------------------------------------------------------------------- - -bool wxScrollHelper::SendAutoScrollEvents(wxScrollWinEvent& event) const -{ - // only send the event if the window is scrollable in this direction - wxWindow *win = (wxWindow *)event.GetEventObject(); - return win->HasScrollbar(event.GetOrientation()); -} - -void wxScrollHelper::StopAutoScrolling() -{ -#if wxUSE_TIMER - if ( m_timerAutoScroll ) - { - delete m_timerAutoScroll; - m_timerAutoScroll = (wxTimer *)NULL; - } -#endif -} - -void wxScrollHelper::HandleOnMouseEnter(wxMouseEvent& event) -{ - StopAutoScrolling(); - - event.Skip(); -} - -void wxScrollHelper::HandleOnMouseLeave(wxMouseEvent& event) -{ - // don't prevent the usual processing of the event from taking place - event.Skip(); - - // when a captured mouse leave a scrolled window we start generate - // scrolling events to allow, for example, extending selection beyond the - // visible area in some controls - if ( wxWindow::GetCapture() == m_targetWindow ) - { - // where is the mouse leaving? - int pos, orient; - wxPoint pt = event.GetPosition(); - if ( pt.x < 0 ) - { - orient = wxHORIZONTAL; - pos = 0; - } - else if ( pt.y < 0 ) - { - orient = wxVERTICAL; - pos = 0; - } - else // we're lower or to the right of the window - { - wxSize size = m_targetWindow->GetClientSize(); - if ( pt.x > size.x ) - { - orient = wxHORIZONTAL; - pos = m_xScrollLines; - } - else if ( pt.y > size.y ) - { - orient = wxVERTICAL; - pos = m_yScrollLines; - } - else // this should be impossible - { - // but seems to happen sometimes under wxMSW - maybe it's a bug - // there but for now just ignore it - - //wxFAIL_MSG( _T("can't understand where has mouse gone") ); - - return; - } - } - - // only start the auto scroll timer if the window can be scrolled in - // this direction - if ( !m_targetWindow->HasScrollbar(orient) ) - return; - -#if wxUSE_TIMER - delete m_timerAutoScroll; - m_timerAutoScroll = new wxAutoScrollTimer - ( - m_targetWindow, this, - pos == 0 ? wxEVT_SCROLLWIN_LINEUP - : wxEVT_SCROLLWIN_LINEDOWN, - pos, - orient - ); - m_timerAutoScroll->Start(50); // FIXME: make configurable -#else - wxUnusedVar(pos); -#endif - } -} - -#if wxUSE_MOUSEWHEEL - -void wxScrollHelper::HandleOnMouseWheel(wxMouseEvent& event) -{ - m_wheelRotation += event.GetWheelRotation(); - int lines = m_wheelRotation / event.GetWheelDelta(); - m_wheelRotation -= lines * event.GetWheelDelta(); - - if (lines != 0) - { - - wxScrollWinEvent newEvent; - - newEvent.SetPosition(0); - newEvent.SetOrientation(wxVERTICAL); - newEvent.SetEventObject(m_win); - - if (event.IsPageScroll()) - { - if (lines > 0) - newEvent.SetEventType(wxEVT_SCROLLWIN_PAGEUP); - else - newEvent.SetEventType(wxEVT_SCROLLWIN_PAGEDOWN); - - m_win->GetEventHandler()->ProcessEvent(newEvent); - } - else - { - lines *= event.GetLinesPerAction(); - if (lines > 0) - newEvent.SetEventType(wxEVT_SCROLLWIN_LINEUP); - else - newEvent.SetEventType(wxEVT_SCROLLWIN_LINEDOWN); - - int times = abs(lines); - for (; times > 0; times--) - m_win->GetEventHandler()->ProcessEvent(newEvent); - } - } -} - -#endif // wxUSE_MOUSEWHEEL - -void wxScrollHelper::HandleOnChildFocus(wxChildFocusEvent& event) -{ - // this event should be processed by all windows in parenthood chain, - // e.g. so that nested wxScrolledWindows work correctly - event.Skip(); - - // find the immediate child under which the window receiving focus is: - wxWindow *win = event.GetWindow(); - - if ( win == m_targetWindow ) - return; // nothing to do - -#ifdef __WXMAC__ - if (wxDynamicCast(win, wxScrollBar)) - return; -#endif - - // Fixing ticket: http://trac.wxwidgets.org/ticket/9563 - // When a child inside a wxControlContainer receives a focus, the - // wxControlContainer generates an artificial wxChildFocusEvent for - // itself, telling its parent that 'it' received the focus. The effect is - // that this->HandleOnChildFocus is called twice, first with the - // artificial wxChildFocusEvent and then with the original event. We need - // to ignore the artificial event here or otherwise HandleOnChildFocus - // would first scroll the target window to make the entire - // wxControlContainer visible and immediately afterwards scroll the target - // window again to make the child widget visible. This leads to ugly - // flickering when using nested wxPanels/wxScrolledWindows. - // - // Ignore this event if 'win' is derived from wxControlContainer AND its - // parent is the m_targetWindow AND 'win' is not actually reciving the - // focus (win != FindFocus). TODO: This affects all wxControlContainer - // objects, but wxControlContainer is not part of the wxWidgets RTTI and - // so wxDynamicCast(win, wxControlContainer) does not compile. Find a way - // to determine if 'win' derives from wxControlContainer. Until then, - // testing if 'win' derives from wxPanel will probably get >90% of all - // cases. - - wxWindow *actual_focus=wxWindow::FindFocus(); - if (win != actual_focus && - wxDynamicCast(win, wxPanel) != 0 && - win->GetParent() == m_targetWindow) - // if win is a wxPanel and receives the focus, it should not be - // scrolled into view - return; - - const wxRect viewRect(m_targetWindow->GetClientRect()); - - // For composite controls such as wxComboCtrl we should try to fit the - // entire control inside the visible area of the target window, not just - // the focused child of the control. Otherwise we'd make only the textctrl - // part of a wxComboCtrl visible and the button would still be outside the - // scrolled area. But do so only if the parent fits *entirely* inside the - // scrolled window. In other situations, such as nested wxPanel or - // wxScrolledWindows, the parent might be way to big to fit inside the - // scrolled window. If that is the case, then make only the focused window - // visible - if ( win->GetParent() != m_targetWindow) - { - wxWindow *parent=win->GetParent(); - wxSize parent_size=parent->GetSize(); - if (parent_size.GetWidth() <= viewRect.GetWidth() && - parent_size.GetHeight() <= viewRect.GetHeight()) - // make the immediate parent visible instead of the focused control - win=parent; - } - - // make win position relative to the m_targetWindow viewing area instead of - // its parent - const wxRect - winRect(m_targetWindow->ScreenToClient(win->GetScreenPosition()), - win->GetSize()); - - // check if it's fully visible - if ( viewRect.Contains(winRect) ) - { - // it is, nothing to do - return; - } - - // check if we can make it fully visible: this is only possible if it's not - // larger than our view area - if ( winRect.GetWidth() > viewRect.GetWidth() || - winRect.GetHeight() > viewRect.GetHeight() ) - { - // we can't make it fit so avoid scrolling it at all, this is only - // going to be confusing and not helpful - return; - } - - - // do make the window fit inside the view area by scrolling to it - int stepx, stepy; - GetScrollPixelsPerUnit(&stepx, &stepy); - - int startx, starty; - GetViewStart(&startx, &starty); - - // first in vertical direction: - if ( stepy > 0 ) - { - int diff = 0; - - if ( winRect.GetTop() < 0 ) - { - diff = winRect.GetTop(); - } - else if ( winRect.GetBottom() > viewRect.GetHeight() ) - { - diff = winRect.GetBottom() - viewRect.GetHeight() + 1; - // round up to next scroll step if we can't get exact position, - // so that the window is fully visible: - diff += stepy - 1; - } - - starty = (starty * stepy + diff) / stepy; - } - - // then horizontal: - if ( stepx > 0 ) - { - int diff = 0; - - if ( winRect.GetLeft() < 0 ) - { - diff = winRect.GetLeft(); - } - else if ( winRect.GetRight() > viewRect.GetWidth() ) - { - diff = winRect.GetRight() - viewRect.GetWidth() + 1; - // round up to next scroll step if we can't get exact position, - // so that the window is fully visible: - diff += stepx - 1; - } - - startx = (startx * stepx + diff) / stepx; - } - - Scroll(startx, starty); -} - -// ---------------------------------------------------------------------------- -// wxScrolledWindow implementation -// ---------------------------------------------------------------------------- - -IMPLEMENT_DYNAMIC_CLASS(wxScrolledWindow, wxPanel) - -BEGIN_EVENT_TABLE(wxScrolledWindow, wxPanel) - EVT_PAINT(wxScrolledWindow::OnPaint) -END_EVENT_TABLE() - -bool wxScrolledWindow::Create(wxWindow *parent, - wxWindowID id, - const wxPoint& pos, - const wxSize& size, - long style, - const wxString& name) -{ - m_targetWindow = this; -#ifdef __WXMAC__ - MacSetClipChildren( true ) ; -#endif - - bool ok = wxPanel::Create(parent, id, pos, size, style|wxHSCROLL|wxVSCROLL, name); - - return ok; -} - -wxScrolledWindow::~wxScrolledWindow() -{ -} - -void wxScrolledWindow::OnPaint(wxPaintEvent& event) -{ - // the user code didn't really draw the window if we got here, so set this - // flag to try to call OnDraw() later - m_handler->ResetDrawnFlag(); - - event.Skip(); -} - -#ifdef __WXMSW__ -WXLRESULT wxScrolledWindow::MSWWindowProc(WXUINT nMsg, - WXWPARAM wParam, - WXLPARAM lParam) -{ - WXLRESULT rc = wxPanel::MSWWindowProc(nMsg, wParam, lParam); - -#ifndef __WXWINCE__ - // we need to process arrows ourselves for scrolling - if ( nMsg == WM_GETDLGCODE ) - { - rc |= DLGC_WANTARROWS; - } -#endif - - return rc; -} - -#endif // __WXMSW__ diff --git a/wxWidgets/src/generic/selstore.cpp b/wxWidgets/src/generic/selstore.cpp deleted file mode 100644 index 2fbfc7b691..0000000000 --- a/wxWidgets/src/generic/selstore.cpp +++ /dev/null @@ -1,216 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: generic/selstore.cpp -// Purpose: wxSelectionStore implementation -// Author: Vadim Zeitlin -// Modified by: -// Created: 08.06.03 (extracted from src/generic/listctrl.cpp) -// RCS-ID: $Id: selstore.cpp 27853 2004-06-17 16:22:36Z ABX $ -// Copyright: (c) 2000-2003 Vadim Zeitlin -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#include "wx/selstore.h" - -// ============================================================================ -// wxSelectionStore -// ============================================================================ - -// ---------------------------------------------------------------------------- -// tests -// ---------------------------------------------------------------------------- - -bool wxSelectionStore::IsSelected(size_t item) const -{ - bool isSel = m_itemsSel.Index(item) != wxNOT_FOUND; - - // if the default state is to be selected, being in m_itemsSel means that - // the item is not selected, so we have to inverse the logic - return m_defaultState ? !isSel : isSel; -} - -// ---------------------------------------------------------------------------- -// Select*() -// ---------------------------------------------------------------------------- - -bool wxSelectionStore::SelectItem(size_t item, bool select) -{ - // search for the item ourselves as like this we get the index where to - // insert it later if needed, so we do only one search in the array instead - // of two (adding item to a sorted array requires a search) - size_t index = m_itemsSel.IndexForInsert(item); - bool isSel = index < m_itemsSel.GetCount() && m_itemsSel[index] == item; - - if ( select != m_defaultState ) - { - if ( !isSel ) - { - m_itemsSel.AddAt(item, index); - - return true; - } - } - else // reset to default state - { - if ( isSel ) - { - m_itemsSel.RemoveAt(index); - return true; - } - } - - return false; -} - -bool wxSelectionStore::SelectRange(size_t itemFrom, size_t itemTo, - bool select, - wxArrayInt *itemsChanged) -{ - // 100 is hardcoded but it shouldn't matter much: the important thing is - // that we don't refresh everything when really few (e.g. 1 or 2) items - // change state - static const size_t MANY_ITEMS = 100; - - wxASSERT_MSG( itemFrom <= itemTo, _T("should be in order") ); - - // are we going to have more [un]selected items than the other ones? - if ( itemTo - itemFrom > m_count/2 ) - { - if ( select != m_defaultState ) - { - // the default state now becomes the same as 'select' - m_defaultState = select; - - // so all the old selections (which had state select) shouldn't be - // selected any more, but all the other ones should - wxSelectedIndices selOld = m_itemsSel; - m_itemsSel.Empty(); - - // TODO: it should be possible to optimize the searches a bit - // knowing the possible range - - size_t item; - for ( item = 0; item < itemFrom; item++ ) - { - if ( selOld.Index(item) == wxNOT_FOUND ) - m_itemsSel.Add(item); - } - - for ( item = itemTo + 1; item < m_count; item++ ) - { - if ( selOld.Index(item) == wxNOT_FOUND ) - m_itemsSel.Add(item); - } - - // many items (> half) changed state - itemsChanged = NULL; - } - else // select == m_defaultState - { - // get the inclusive range of items between itemFrom and itemTo - size_t count = m_itemsSel.GetCount(), - start = m_itemsSel.IndexForInsert(itemFrom), - end = m_itemsSel.IndexForInsert(itemTo); - - if ( start == count || m_itemsSel[start] < itemFrom ) - { - start++; - } - - if ( end == count || m_itemsSel[end] > itemTo ) - { - end--; - } - - if ( start <= end ) - { - // delete all of them (from end to avoid changing indices) - for ( int i = end; i >= (int)start; i-- ) - { - if ( itemsChanged ) - { - if ( itemsChanged->GetCount() > MANY_ITEMS ) - { - // stop counting (see comment below) - itemsChanged = NULL; - } - else - { - itemsChanged->Add(m_itemsSel[i]); - } - } - - m_itemsSel.RemoveAt(i); - } - } - } - } - else // "few" items change state - { - if ( itemsChanged ) - { - itemsChanged->Empty(); - } - - // just add the items to the selection - for ( size_t item = itemFrom; item <= itemTo; item++ ) - { - if ( SelectItem(item, select) && itemsChanged ) - { - itemsChanged->Add(item); - - if ( itemsChanged->GetCount() > MANY_ITEMS ) - { - // stop counting them, we'll just eat gobs of memory - // for nothing at all - faster to refresh everything in - // this case - itemsChanged = NULL; - } - } - } - } - - // we set it to NULL if there are many items changing state - return itemsChanged != NULL; -} - -// ---------------------------------------------------------------------------- -// callbacks -// ---------------------------------------------------------------------------- - -void wxSelectionStore::OnItemDelete(size_t item) -{ - size_t count = m_itemsSel.GetCount(), - i = m_itemsSel.IndexForInsert(item); - - if ( i < count && m_itemsSel[i] == item ) - { - // this item itself was in m_itemsSel, remove it from there - m_itemsSel.RemoveAt(i); - - count--; - } - - // and adjust the index of all which follow it - while ( i < count ) - { - // all following elements must be greater than the one we deleted - wxASSERT_MSG( m_itemsSel[i] > item, _T("logic error") ); - - m_itemsSel[i++]--; - } -} - diff --git a/wxWidgets/src/generic/spinctlg.cpp b/wxWidgets/src/generic/spinctlg.cpp deleted file mode 100644 index 68562ffb9a..0000000000 --- a/wxWidgets/src/generic/spinctlg.cpp +++ /dev/null @@ -1,391 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: src/generic/spinctlg.cpp -// Purpose: implements wxSpinCtrl as a composite control -// Author: Vadim Zeitlin -// Modified by: -// Created: 29.01.01 -// RCS-ID: $Id: spinctlg.cpp 52582 2008-03-17 13:46:31Z VZ $ -// Copyright: (c) 2001 Vadim Zeitlin -// License: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -// There are port-specific versions for MSW, GTK, OS/2 and Mac, so exclude the -// contents of this file in those cases -#if !(defined(__WXMSW__) || defined(__WXGTK__) || defined(__WXPM__) || \ - defined(__WXMAC__)) || defined(__WXUNIVERSAL__) - -#ifndef WX_PRECOMP - #include "wx/textctrl.h" -#endif //WX_PRECOMP - -#if wxUSE_SPINCTRL - -#include "wx/spinbutt.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->GetParent(), wxID_ANY, value) - { - m_spin = spin; - - // remove the default minsize, the spinctrl will have one instead - SetSizeHints(wxDefaultCoord,wxDefaultCoord); - } - -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(wxID_ANY, wxSpinCtrlText::OnTextChange) -END_EVENT_TABLE() - -// ---------------------------------------------------------------------------- -// wxSpinCtrlButton: spin button used by spin control -// ---------------------------------------------------------------------------- - -class wxSpinCtrlButton : public wxSpinButton -{ -public: - wxSpinCtrlButton(wxSpinCtrl *spin, int style) - : wxSpinButton(spin->GetParent()) - { - m_spin = spin; - - SetWindowStyle(style | wxSP_VERTICAL); - - // remove the default minsize, the spinctrl will have one instead - SetSizeHints(wxDefaultCoord,wxDefaultCoord); - } - -protected: - void OnSpinButton(wxSpinEvent& eventSpin) - { - 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); - - eventSpin.Skip(); - } - -private: - wxSpinCtrl *m_spin; - - DECLARE_EVENT_TABLE() -}; - -BEGIN_EVENT_TABLE(wxSpinCtrlButton, wxSpinButton) - EVT_SPIN(wxID_ANY, 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; - } - - m_text = new wxSpinCtrlText(this, value); - m_btn = new wxSpinCtrlButton(this, style); - - m_btn->SetRange(min, max); - m_btn->SetValue(initial); - SetInitialSize(size); - Move(pos); - - // have to disable this window to avoid interfering it with message - // processing to the text and the button... but pretend it is enabled to - // make IsEnabled() return true - wxControl::Enable(false); // don't use non virtual Disable() here! - m_isEnabled = true; - - // we don't even need to show this window itself - and not doing it avoids - // that it overwrites the text control - wxControl::Show(false); - m_isShown = true; - 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(x, y, wText, height); - m_btn->SetSize(x + wText + MARGIN, y, wxDefaultCoord, height); -} - -// ---------------------------------------------------------------------------- -// operations forwarded to the subcontrols -// ---------------------------------------------------------------------------- - -bool wxSpinCtrl::Enable(bool enable) -{ - if ( !wxControl::Enable(enable) ) - return false; - - m_btn->Enable(enable); - m_text->Enable(enable); - - return true; -} - -bool wxSpinCtrl::Show(bool show) -{ - if ( !wxControl::Show(show) ) - return false; - - // under GTK Show() is called the first time before we are fully - // constructed - if ( m_btn ) - { - m_btn->Show(show); - m_text->Show(show); - } - - return true; -} - -bool wxSpinCtrl::Reparent(wxWindow *newParent) -{ - if ( m_btn ) - { - m_btn->Reparent(newParent); - m_text->Reparent(newParent); - } - - 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. - -#ifdef __WXCOCOA__ - /* It's sort of a hack to do this from here but the idea is that if the - user has clicked on us, which is the main reason this method is called, - then focus probably ought to go to the text control since clicking on - a text control usually gives it focus. - - However, if the focus is already on us (i.e. the user has turned on - the ability to tab to controls) then we don't want to drop focus. - So we only set focus if we would steal it away from a different - control, not if we would steal it away from ourself. - */ - wxWindow *currentFocusedWindow = wxWindow::FindFocus(); - if(currentFocusedWindow != this && currentFocusedWindow != m_text) - m_text->SetFocus(); -#endif -} - -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) -{ - wxCHECK_RET( m_text, _T("invalid call to wxSpinCtrl::SetSelection") ); - - m_text->SetSelection(from, to); -} - -#endif // wxUSE_SPINCTRL -#endif // !wxPort-with-native-spinctrl diff --git a/wxWidgets/src/generic/splash.cpp b/wxWidgets/src/generic/splash.cpp deleted file mode 100644 index 9f7eef61df..0000000000 --- a/wxWidgets/src/generic/splash.cpp +++ /dev/null @@ -1,202 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/generic/splash.cpp -// Purpose: wxSplashScreen class -// Author: Julian Smart -// Modified by: -// Created: 28/6/2000 -// RCS-ID: $Id: splash.cpp 58746 2009-02-08 09:16:50Z VZ $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// For compilers that support precompilation, includes "wx/wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_SPLASH - -#ifdef __WXGTK20__ - #include -#endif - -#include "wx/splash.h" - -#ifndef WX_PRECOMP - #include "wx/dcmemory.h" - #include "wx/dcclient.h" -#endif - -/* - * wxSplashScreen - */ - -#define wxSPLASH_TIMER_ID 9999 - -IMPLEMENT_DYNAMIC_CLASS(wxSplashScreen, wxFrame) - -BEGIN_EVENT_TABLE(wxSplashScreen, wxFrame) - EVT_TIMER(wxSPLASH_TIMER_ID, wxSplashScreen::OnNotify) - EVT_CLOSE(wxSplashScreen::OnCloseWindow) -END_EVENT_TABLE() - -/* Note that unless we pass a non-default size to the frame, SetClientSize - * won't work properly under Windows, and the splash screen frame is sized - * slightly too small. - */ - -wxSplashScreen::wxSplashScreen(const wxBitmap& bitmap, long splashStyle, int milliseconds, wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style): - wxFrame(parent, id, wxEmptyString, wxPoint(0,0), wxSize(100, 100), style) -{ - // At least for GTK+ 2.0, this hint is not available. -#if defined(__WXGTK20__) -#if GTK_CHECK_VERSION(2,2,0) - gtk_window_set_type_hint(GTK_WINDOW(m_widget), - GDK_WINDOW_TYPE_HINT_SPLASHSCREEN); -#endif -#endif - - m_window = NULL; - m_splashStyle = splashStyle; - m_milliseconds = milliseconds; - - m_window = new wxSplashScreenWindow(bitmap, this, wxID_ANY, pos, size, wxNO_BORDER); - - SetClientSize(bitmap.GetWidth(), bitmap.GetHeight()); - - if (m_splashStyle & wxSPLASH_CENTRE_ON_PARENT) - CentreOnParent(); - else if (m_splashStyle & wxSPLASH_CENTRE_ON_SCREEN) - CentreOnScreen(); - - if (m_splashStyle & wxSPLASH_TIMEOUT) - { - m_timer.SetOwner(this, wxSPLASH_TIMER_ID); - m_timer.Start(milliseconds, true); - } - - Show(true); - m_window->SetFocus(); -#if defined( __WXMSW__ ) || defined(__WXMAC__) - Update(); // Without this, you see a blank screen for an instant -#else - wxYieldIfNeeded(); // Should eliminate this -#endif -} - -wxSplashScreen::~wxSplashScreen() -{ - m_timer.Stop(); -} - -void wxSplashScreen::OnNotify(wxTimerEvent& WXUNUSED(event)) -{ - Close(true); -} - -void wxSplashScreen::OnCloseWindow(wxCloseEvent& WXUNUSED(event)) -{ - m_timer.Stop(); - this->Destroy(); -} - -/* - * wxSplashScreenWindow - */ - -BEGIN_EVENT_TABLE(wxSplashScreenWindow, wxWindow) -#ifdef __WXGTK__ - EVT_PAINT(wxSplashScreenWindow::OnPaint) -#endif - EVT_ERASE_BACKGROUND(wxSplashScreenWindow::OnEraseBackground) - EVT_CHAR(wxSplashScreenWindow::OnChar) - EVT_MOUSE_EVENTS(wxSplashScreenWindow::OnMouseEvent) -END_EVENT_TABLE() - -wxSplashScreenWindow::wxSplashScreenWindow(const wxBitmap& bitmap, wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style): - wxWindow(parent, id, pos, size, style) -{ - m_bitmap = bitmap; - -#if !defined(__WXGTK__) && wxUSE_PALETTE - bool hiColour = (wxDisplayDepth() >= 16) ; - - if (bitmap.GetPalette() && !hiColour) - { - SetPalette(* bitmap.GetPalette()); - } -#endif - -} - -// VZ: why don't we do it under wxGTK? -#if !defined(__WXGTK__) && wxUSE_PALETTE - #define USE_PALETTE_IN_SPLASH -#endif - -static void wxDrawSplashBitmap(wxDC& dc, const wxBitmap& bitmap, int WXUNUSED(x), int WXUNUSED(y)) -{ - wxMemoryDC dcMem; - -#ifdef USE_PALETTE_IN_SPLASH - bool hiColour = (wxDisplayDepth() >= 16) ; - - if (bitmap.GetPalette() && !hiColour) - { - dcMem.SetPalette(* bitmap.GetPalette()); - } -#endif // USE_PALETTE_IN_SPLASH - - dcMem.SelectObjectAsSource(bitmap); - dc.Blit(0, 0, bitmap.GetWidth(), bitmap.GetHeight(), &dcMem, 0, 0, wxCOPY, - true /* use mask */); - dcMem.SelectObject(wxNullBitmap); - -#ifdef USE_PALETTE_IN_SPLASH - if (bitmap.GetPalette() && !hiColour) - { - dcMem.SetPalette(wxNullPalette); - } -#endif // USE_PALETTE_IN_SPLASH -} - -void wxSplashScreenWindow::OnPaint(wxPaintEvent& WXUNUSED(event)) -{ - wxPaintDC dc(this); - if (m_bitmap.Ok()) - wxDrawSplashBitmap(dc, m_bitmap, 0, 0); -} - -void wxSplashScreenWindow::OnEraseBackground(wxEraseEvent& event) -{ - if (event.GetDC()) - { - if (m_bitmap.Ok()) - { - wxDrawSplashBitmap(* event.GetDC(), m_bitmap, 0, 0); - } - } - else - { - wxClientDC dc(this); - if (m_bitmap.Ok()) - { - wxDrawSplashBitmap(dc, m_bitmap, 0, 0); - } - } -} - -void wxSplashScreenWindow::OnMouseEvent(wxMouseEvent& event) -{ - if (event.LeftDown() || event.RightDown()) - GetParent()->Close(true); -} - -void wxSplashScreenWindow::OnChar(wxKeyEvent& WXUNUSED(event)) -{ - GetParent()->Close(true); -} - -#endif // wxUSE_SPLASH diff --git a/wxWidgets/src/generic/splitter.cpp b/wxWidgets/src/generic/splitter.cpp deleted file mode 100644 index 9cda9e3627..0000000000 --- a/wxWidgets/src/generic/splitter.cpp +++ /dev/null @@ -1,1064 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/generic/splitter.cpp -// Purpose: wxSplitterWindow implementation -// Author: Julian Smart -// Modified by: -// Created: 01/02/97 -// RCS-ID: $Id: splitter.cpp 60837 2009-05-31 13:13:07Z VZ $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_SPLITTER - -#include "wx/splitter.h" - -#ifndef WX_PRECOMP - #include "wx/string.h" - #include "wx/utils.h" - #include "wx/log.h" - - #include "wx/dcclient.h" - #include "wx/dcscreen.h" - - #include "wx/window.h" - #include "wx/dialog.h" - #include "wx/frame.h" - - #include "wx/settings.h" -#endif - -#include "wx/renderer.h" - -#include - -DEFINE_EVENT_TYPE(wxEVT_COMMAND_SPLITTER_SASH_POS_CHANGED) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_SPLITTER_SASH_POS_CHANGING) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_SPLITTER_DOUBLECLICKED) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_SPLITTER_UNSPLIT) - -IMPLEMENT_DYNAMIC_CLASS(wxSplitterWindow, wxWindow) - -/* - TODO PROPERTIES - style wxSP_3D - sashpos (long , 0 ) - minsize (long -1 ) - object, object_ref - orientation -*/ - -IMPLEMENT_DYNAMIC_CLASS(wxSplitterEvent, wxNotifyEvent) - -BEGIN_EVENT_TABLE(wxSplitterWindow, wxWindow) - EVT_PAINT(wxSplitterWindow::OnPaint) - EVT_SIZE(wxSplitterWindow::OnSize) - EVT_MOUSE_EVENTS(wxSplitterWindow::OnMouseEvent) - -#if defined( __WXMSW__ ) || defined( __WXMAC__) - EVT_SET_CURSOR(wxSplitterWindow::OnSetCursor) -#endif // wxMSW - - WX_EVENT_TABLE_CONTROL_CONTAINER(wxSplitterWindow) -END_EVENT_TABLE() - -WX_DELEGATE_TO_CONTROL_CONTAINER(wxSplitterWindow, wxWindow) - -bool wxSplitterWindow::Create(wxWindow *parent, wxWindowID id, - const wxPoint& pos, - const wxSize& size, - long style, - const wxString& name) -{ - // allow TABbing from one window to the other - style |= wxTAB_TRAVERSAL; - - // we draw our border ourselves to blend the sash with it - style &= ~wxBORDER_MASK; - style |= wxBORDER_NONE; - -#if defined(__WXMAC__) && wxMAC_USE_CORE_GRAPHICS - // CoreGraphics can't paint sash feedback - style |= wxSP_LIVE_UPDATE; -#endif - - if ( !wxWindow::Create(parent, id, pos, size, style, name) ) - return false; - - if (size.x >= 0) - m_lastSize.x = size.x; - if (size.y >= 0) - m_lastSize.y = size.y; - - m_permitUnsplitAlways = (style & wxSP_PERMIT_UNSPLIT) != 0; - - // FIXME: with this line the background is not erased at all under GTK1, - // so temporary avoid it there -#if !defined(__WXGTK__) || defined(__WXGTK20__) - // don't erase the splitter background, it's pointless as we overwrite it - // anyhow - SetBackgroundStyle(wxBG_STYLE_CUSTOM); -#endif - - return true; -} - -void wxSplitterWindow::Init() -{ - m_container.SetContainerWindow(this); - - m_splitMode = wxSPLIT_VERTICAL; - m_permitUnsplitAlways = true; - m_windowOne = (wxWindow *) NULL; - m_windowTwo = (wxWindow *) NULL; - m_dragMode = wxSPLIT_DRAG_NONE; - m_oldX = 0; - m_oldY = 0; - m_firstX = 0; - m_firstY = 0; - m_sashPosition = m_requestedSashPosition = 0; - m_sashGravity = 0.0; - m_sashSize = -1; // -1 means use the native sash size - m_lastSize = wxSize(0,0); - m_checkRequestedSashPosition = false; - m_minimumPaneSize = 0; - m_sashCursorWE = wxCursor(wxCURSOR_SIZEWE); - m_sashCursorNS = wxCursor(wxCURSOR_SIZENS); - m_sashTrackerPen = new wxPen(*wxBLACK, 2, wxSOLID); - - m_needUpdating = false; - m_isHot = false; -} - -wxSplitterWindow::~wxSplitterWindow() -{ - delete m_sashTrackerPen; -} - -// ---------------------------------------------------------------------------- -// entering/leaving sash -// ---------------------------------------------------------------------------- - -void wxSplitterWindow::RedrawIfHotSensitive(bool isHot) -{ - if ( wxRendererNative::Get().GetSplitterParams(this).isHotSensitive ) - { - m_isHot = isHot; - - wxClientDC dc(this); - DrawSash(dc); - } - //else: we don't change our appearance, don't redraw to avoid flicker -} - -void wxSplitterWindow::OnEnterSash() -{ - SetResizeCursor(); - - RedrawIfHotSensitive(true); -} - -void wxSplitterWindow::OnLeaveSash() -{ - SetCursor(*wxSTANDARD_CURSOR); - - RedrawIfHotSensitive(false); -} - -void wxSplitterWindow::SetResizeCursor() -{ - SetCursor(m_splitMode == wxSPLIT_VERTICAL ? m_sashCursorWE - : m_sashCursorNS); -} - -// ---------------------------------------------------------------------------- -// other event handlers -// ---------------------------------------------------------------------------- - -void wxSplitterWindow::OnPaint(wxPaintEvent& WXUNUSED(event)) -{ - wxPaintDC dc(this); - - DrawSash(dc); -} - -void wxSplitterWindow::OnInternalIdle() -{ - wxWindow::OnInternalIdle(); - - // if this is the first idle time after a sash position has potentially - // been set, allow SizeWindows to check for a requested size. - if (!m_checkRequestedSashPosition) - { - m_checkRequestedSashPosition = true; - SizeWindows(); - return; // it won't needUpdating in this case - } - - if (m_needUpdating) - SizeWindows(); -} - -void wxSplitterWindow::OnMouseEvent(wxMouseEvent& event) -{ - int x = (int)event.GetX(), - y = (int)event.GetY(); - - if ( GetWindowStyle() & wxSP_NOSASH ) - { - event.Skip(); - return; - } - - // with wxSP_LIVE_UPDATE style the splitter windows are always resized - // following the mouse movement while it drags the sash, without it we only - // draw the sash at the new position but only resize the windows when the - // dragging is finished -#if defined( __WXMAC__ ) && defined(TARGET_API_MAC_OSX) && TARGET_API_MAC_OSX == 1 - bool isLive = true ; // FIXME: why? -#else - bool isLive = HasFlag(wxSP_LIVE_UPDATE); -#endif - if (event.LeftDown()) - { - if ( SashHitTest(x, y) ) - { - // Start the drag now - m_dragMode = wxSPLIT_DRAG_DRAGGING; - - // Capture mouse and set the cursor - CaptureMouse(); - SetResizeCursor(); - - if ( !isLive ) - { - // remember the initial sash position and draw the initial - // shadow sash - m_sashPositionCurrent = m_sashPosition; - - DrawSashTracker(x, y); - } - - m_oldX = x; - m_oldY = y; - - SetResizeCursor(); - return; - } - } - else if (event.LeftUp() && m_dragMode == wxSPLIT_DRAG_DRAGGING) - { - // We can stop dragging now and see what we've got. - m_dragMode = wxSPLIT_DRAG_NONE; - - // Release mouse and unset the cursor - ReleaseMouse(); - SetCursor(* wxSTANDARD_CURSOR); - - // exit if unsplit after doubleclick - if ( !IsSplit() ) - { - return; - } - - // Erase old tracker - if ( !isLive ) - { - DrawSashTracker(m_oldX, m_oldY); - } - - // the position of the click doesn't exactly correspond to - // m_sashPosition, rather it changes it by the distance by which the - // mouse has moved - int diff = m_splitMode == wxSPLIT_VERTICAL ? x - m_oldX : y - m_oldY; - - int posSashOld = isLive ? m_sashPosition : m_sashPositionCurrent; - int posSashNew = OnSashPositionChanging(posSashOld + diff); - if ( posSashNew == -1 ) - { - // change not allowed - return; - } - - if ( m_permitUnsplitAlways || m_minimumPaneSize == 0 ) - { - // Deal with possible unsplit scenarios - if ( posSashNew == 0 ) - { - // We remove the first window from the view - wxWindow *removedWindow = m_windowOne; - m_windowOne = m_windowTwo; - m_windowTwo = (wxWindow *) NULL; - OnUnsplit(removedWindow); - wxSplitterEvent eventUnsplit(wxEVT_COMMAND_SPLITTER_UNSPLIT, this); - eventUnsplit.m_data.win = removedWindow; - (void)DoSendEvent(eventUnsplit); - SetSashPositionAndNotify(0); - } - else if ( posSashNew == GetWindowSize() ) - { - // We remove the second window from the view - wxWindow *removedWindow = m_windowTwo; - m_windowTwo = (wxWindow *) NULL; - OnUnsplit(removedWindow); - wxSplitterEvent eventUnsplit(wxEVT_COMMAND_SPLITTER_UNSPLIT, this); - eventUnsplit.m_data.win = removedWindow; - (void)DoSendEvent(eventUnsplit); - SetSashPositionAndNotify(0); - } - else - { - SetSashPositionAndNotify(posSashNew); - } - } - else - { - SetSashPositionAndNotify(posSashNew); - } - - SizeWindows(); - } // left up && dragging - else if ((event.Moving() || event.Leaving() || event.Entering()) && (m_dragMode == wxSPLIT_DRAG_NONE)) - { - if ( event.Leaving() || !SashHitTest(x, y) ) - OnLeaveSash(); - else - OnEnterSash(); - } - else if (event.Dragging() && (m_dragMode == wxSPLIT_DRAG_DRAGGING)) - { - int diff = m_splitMode == wxSPLIT_VERTICAL ? x - m_oldX : y - m_oldY; - if ( !diff ) - { - // nothing to do, mouse didn't really move far enough - return; - } - - int posSashOld = isLive ? m_sashPosition : m_sashPositionCurrent; - int posSashNew = OnSashPositionChanging(posSashOld + diff); - if ( posSashNew == -1 ) - { - // change not allowed - return; - } - - if ( posSashNew == m_sashPosition ) - return; - - // Erase old tracker - if ( !isLive ) - { - DrawSashTracker(m_oldX, m_oldY); - } - - if (m_splitMode == wxSPLIT_VERTICAL) - x = posSashNew; - else - y = posSashNew; - - // Remember old positions - m_oldX = x; - m_oldY = y; - -#ifdef __WXMSW__ - // As we captured the mouse, we may get the mouse events from outside - // our window - for example, negative values in x, y. This has a weird - // consequence under MSW where we use unsigned values sometimes and - // signed ones other times: the coordinates turn as big positive - // numbers and so the sash is drawn on the *right* side of the window - // instead of the left (or bottom instead of top). Correct this. - if ( (short)m_oldX < 0 ) - m_oldX = 0; - if ( (short)m_oldY < 0 ) - m_oldY = 0; -#endif // __WXMSW__ - - // Draw new one - if ( !isLive ) - { - m_sashPositionCurrent = posSashNew; - - DrawSashTracker(m_oldX, m_oldY); - } - else - { - DoSetSashPosition(posSashNew); - m_needUpdating = true; - } - } - else if ( event.LeftDClick() && m_windowTwo ) - { - OnDoubleClickSash(x, y); - } - else - { - event.Skip(); - } -} - -void wxSplitterWindow::OnSize(wxSizeEvent& event) -{ - // only process this message if we're not iconized - otherwise iconizing - // and restoring a window containing the splitter has a funny side effect - // of changing the splitter position! - wxWindow *parent = wxGetTopLevelParent(this); - bool iconized; - - wxTopLevelWindow *winTop = wxDynamicCast(parent, wxTopLevelWindow); - if ( winTop ) - { - iconized = winTop->IsIconized(); - } - else - { - wxFAIL_MSG(wxT("should have a top level parent!")); - - iconized = false; - } - - if ( iconized ) - { - m_lastSize = wxSize(0,0); - - event.Skip(); - - return; - } - - if ( m_windowTwo ) - { - int w, h; - GetClientSize(&w, &h); - - int size = m_splitMode == wxSPLIT_VERTICAL ? w : h; - - int old_size = m_splitMode == wxSPLIT_VERTICAL ? m_lastSize.x : m_lastSize.y; - if ( old_size != 0 ) - { - int delta = (int) ( (size - old_size)*m_sashGravity ); - if ( delta != 0 ) - { - int newPosition = m_sashPosition + delta; - if( newPosition < m_minimumPaneSize ) - newPosition = m_minimumPaneSize; - SetSashPositionAndNotify(newPosition); - } - } - - if ( m_sashPosition >= size - 5 ) - SetSashPositionAndNotify(wxMax(10, size - 40)); - m_lastSize = wxSize(w,h); - } - - SizeWindows(); -} - -void wxSplitterWindow::SetSashGravity(double gravity) -{ - wxCHECK_RET( gravity >= 0. && gravity <= 1., - _T("invalid gravity value") ); - - m_sashGravity = gravity; -} - -bool wxSplitterWindow::SashHitTest(int x, int y, int tolerance) -{ - if ( m_windowTwo == NULL || m_sashPosition == 0) - return false; // No sash - - int z = m_splitMode == wxSPLIT_VERTICAL ? x : y; - int hitMin = m_sashPosition - tolerance; - int hitMax = m_sashPosition + GetSashSize() + tolerance; - - return z >= hitMin && z <= hitMax; -} - -int wxSplitterWindow::GetSashSize() const -{ - return m_sashSize > -1 ? m_sashSize : wxRendererNative::Get().GetSplitterParams(this).widthSash; -} - -int wxSplitterWindow::GetBorderSize() const -{ - return wxRendererNative::Get().GetSplitterParams(this).border; -} - -// Draw the sash -void wxSplitterWindow::DrawSash(wxDC& dc) -{ - if (HasFlag(wxSP_3DBORDER)) - wxRendererNative::Get().DrawSplitterBorder - ( - this, - dc, - GetClientRect() - ); - - // don't draw sash if we're not split - if ( m_sashPosition == 0 || !m_windowTwo ) - return; - - // nor if we're configured to not show it - if ( HasFlag(wxSP_NOSASH) ) - return; - - wxRendererNative::Get().DrawSplitterSash - ( - this, - dc, - GetClientSize(), - m_sashPosition, - m_splitMode == wxSPLIT_VERTICAL ? wxVERTICAL - : wxHORIZONTAL, - m_isHot ? (int)wxCONTROL_CURRENT : 0 - ); -} - -// Draw the sash tracker (for whilst moving the sash) -void wxSplitterWindow::DrawSashTracker(int x, int y) -{ - int w, h; - GetClientSize(&w, &h); - - wxScreenDC screenDC; - int x1, y1; - int x2, y2; - - if ( m_splitMode == wxSPLIT_VERTICAL ) - { - x1 = x; y1 = 2; - x2 = x; y2 = h-2; - - if ( x1 > w ) - { - x1 = w; x2 = w; - } - else if ( x1 < 0 ) - { - x1 = 0; x2 = 0; - } - } - else - { - x1 = 2; y1 = y; - x2 = w-2; y2 = y; - - if ( y1 > h ) - { - y1 = h; - y2 = h; - } - else if ( y1 < 0 ) - { - y1 = 0; - y2 = 0; - } - } - - ClientToScreen(&x1, &y1); - ClientToScreen(&x2, &y2); - - screenDC.SetLogicalFunction(wxINVERT); - screenDC.SetPen(*m_sashTrackerPen); - screenDC.SetBrush(*wxTRANSPARENT_BRUSH); - - screenDC.DrawLine(x1, y1, x2, y2); - - screenDC.SetLogicalFunction(wxCOPY); -} - -int wxSplitterWindow::GetWindowSize() const -{ - wxSize size = GetClientSize(); - - return m_splitMode == wxSPLIT_VERTICAL ? size.x : size.y; -} - -int wxSplitterWindow::AdjustSashPosition(int sashPos) const -{ - wxWindow *win; - - win = GetWindow1(); - if ( win ) - { - // the window shouldn't be smaller than its own minimal size nor - // smaller than the minimual pane size specified for this splitter - int minSize = m_splitMode == wxSPLIT_VERTICAL ? win->GetMinWidth() - : win->GetMinHeight(); - - if ( minSize == -1 || m_minimumPaneSize > minSize ) - minSize = m_minimumPaneSize; - - minSize += GetBorderSize(); - - if ( sashPos < minSize ) - sashPos = minSize; - } - - win = GetWindow2(); - if ( win ) - { - int minSize = m_splitMode == wxSPLIT_VERTICAL ? win->GetMinWidth() - : win->GetMinHeight(); - - if ( minSize == -1 || m_minimumPaneSize > minSize ) - minSize = m_minimumPaneSize; - - int maxSize = GetWindowSize() - minSize - GetBorderSize() - GetSashSize(); - if ( maxSize > 0 && sashPos > maxSize && maxSize >= m_minimumPaneSize) - sashPos = maxSize; - } - - return sashPos; -} - -bool wxSplitterWindow::DoSetSashPosition(int sashPos) -{ - int newSashPosition = AdjustSashPosition(sashPos); - - if ( newSashPosition == m_sashPosition ) - return false; - - m_sashPosition = newSashPosition; - - return true; -} - -void wxSplitterWindow::SetSashPositionAndNotify(int sashPos) -{ - // we must reset the request here, otherwise the sash would be stuck at - // old position if the user attempted to move the sash after invalid - // (e.g. smaller than minsize) sash position was requested using - // SetSashPosition(): - m_requestedSashPosition = INT_MAX; - - // note that we must send the event in any case, i.e. even if the sash - // position hasn't changed and DoSetSashPosition() returns false because we - // must generate a CHANGED event at the end of resizing - DoSetSashPosition(sashPos); - - wxSplitterEvent event(wxEVT_COMMAND_SPLITTER_SASH_POS_CHANGED, this); - event.m_data.pos = m_sashPosition; - - (void)DoSendEvent(event); -} - -// Position and size subwindows. -// Note that the border size applies to each subwindow, not -// including the edges next to the sash. -void wxSplitterWindow::SizeWindows() -{ - // check if we have delayed setting the real sash position - if ( m_checkRequestedSashPosition && m_requestedSashPosition != INT_MAX ) - { - int newSashPosition = ConvertSashPosition(m_requestedSashPosition); - if ( newSashPosition != m_sashPosition ) - { - DoSetSashPosition(newSashPosition); - } - - if ( newSashPosition <= m_sashPosition - && newSashPosition >= m_sashPosition - GetBorderSize() ) - { - // don't update it any more - m_requestedSashPosition = INT_MAX; - } - } - - int w, h; - GetClientSize(&w, &h); - - if ( GetWindow1() && !GetWindow2() ) - { - GetWindow1()->SetSize(GetBorderSize(), GetBorderSize(), - w - 2*GetBorderSize(), h - 2*GetBorderSize()); - } - else if ( GetWindow1() && GetWindow2() ) - { - const int border = GetBorderSize(), - sash = GetSashSize(); - - int size1 = GetSashPosition() - border, - size2 = GetSashPosition() + sash; - - int x2, y2, w1, h1, w2, h2; - if ( GetSplitMode() == wxSPLIT_VERTICAL ) - { - w1 = size1; - w2 = w - 2*border - sash - w1; - if (w2 < 0) - w2 = 0; - h2 = h - 2*border; - if (h2 < 0) - h2 = 0; - h1 = h2; - x2 = size2; - y2 = border; - } - else // horz splitter - { - w2 = w - 2*border; - if (w2 < 0) - w2 = 0; - w1 = w2; - h1 = size1; - h2 = h - 2*border - sash - h1; - if (h2 < 0) - h2 = 0; - x2 = border; - y2 = size2; - } - - GetWindow2()->SetSize(x2, y2, w2, h2); - GetWindow1()->SetSize(border, border, w1, h1); - } - - wxClientDC dc(this); - DrawSash(dc); - - SetNeedUpdating(false); -} - -// Set pane for unsplit window -void wxSplitterWindow::Initialize(wxWindow *window) -{ - wxASSERT_MSG( (!window || (window && window->GetParent() == this)), - _T("windows in the splitter should have it as parent!") ); - - if (window && !window->IsShown()) - window->Show(); - - m_windowOne = window; - m_windowTwo = (wxWindow *) NULL; - DoSetSashPosition(0); -} - -// Associates the given window with window 2, drawing the appropriate sash -// and changing the split mode. -// Does nothing and returns false if the window is already split. -bool wxSplitterWindow::DoSplit(wxSplitMode mode, - wxWindow *window1, wxWindow *window2, - int sashPosition) -{ - if ( IsSplit() ) - return false; - - wxCHECK_MSG( window1 && window2, false, - _T("can not split with NULL window(s)") ); - - wxCHECK_MSG( window1->GetParent() == this && window2->GetParent() == this, false, - _T("windows in the splitter should have it as parent!") ); - - if (! window1->IsShown()) - window1->Show(); - if (! window2->IsShown()) - window2->Show(); - - m_splitMode = mode; - m_windowOne = window1; - m_windowTwo = window2; - - // remember the sash position we want to set for later if we can't set it - // right now (e.g. because the window is too small) - m_requestedSashPosition = sashPosition; - m_checkRequestedSashPosition = false; - - DoSetSashPosition(ConvertSashPosition(sashPosition)); - - SizeWindows(); - - return true; -} - -int wxSplitterWindow::ConvertSashPosition(int sashPosition) const -{ - if ( sashPosition > 0 ) - { - return sashPosition; - } - else if ( sashPosition < 0 ) - { - // It's negative so adding is subtracting - return GetWindowSize() + sashPosition; - } - else // sashPosition == 0 - { - // default, put it in the centre - return GetWindowSize() / 2; - } -} - -// Remove the specified (or second) window from the view -// Doesn't actually delete the window. -bool wxSplitterWindow::Unsplit(wxWindow *toRemove) -{ - if ( ! IsSplit() ) - return false; - - wxWindow *win; - if ( toRemove == NULL || toRemove == m_windowTwo) - { - win = m_windowTwo ; - m_windowTwo = (wxWindow *) NULL; - } - else if ( toRemove == m_windowOne ) - { - win = m_windowOne ; - m_windowOne = m_windowTwo; - m_windowTwo = (wxWindow *) NULL; - } - else - { - wxFAIL_MSG(wxT("splitter: attempt to remove a non-existent window")); - - return false; - } - - OnUnsplit(win); - DoSetSashPosition(0); - SizeWindows(); - - return true; -} - -// Replace a window with another one -bool wxSplitterWindow::ReplaceWindow(wxWindow *winOld, wxWindow *winNew) -{ - wxCHECK_MSG( winOld, false, wxT("use one of Split() functions instead") ); - wxCHECK_MSG( winNew, false, wxT("use Unsplit() functions instead") ); - - if ( winOld == m_windowTwo ) - { - m_windowTwo = winNew; - } - else if ( winOld == m_windowOne ) - { - m_windowOne = winNew; - } - else - { - wxFAIL_MSG(wxT("splitter: attempt to replace a non-existent window")); - - return false; - } - - SizeWindows(); - - return true; -} - -void wxSplitterWindow::SetMinimumPaneSize(int min) -{ - m_minimumPaneSize = min; - int pos = m_requestedSashPosition != INT_MAX ? m_requestedSashPosition : m_sashPosition; - SetSashPosition(pos); // re-check limits -} - -void wxSplitterWindow::SetSashPosition(int position, bool redraw) -{ - // remember the sash position we want to set for later if we can't set it - // right now (e.g. because the window is too small) - m_requestedSashPosition = position; - m_checkRequestedSashPosition = false; - - DoSetSashPosition(ConvertSashPosition(position)); - - if ( redraw ) - { - SizeWindows(); - } -} - -// Make sure the child window sizes are updated. This is useful -// for reducing flicker by updating the sizes before a -// window is shown, if you know the overall size is correct. -void wxSplitterWindow::UpdateSize() -{ - m_checkRequestedSashPosition = true; - SizeWindows(); - m_checkRequestedSashPosition = false; -} - -bool wxSplitterWindow::DoSendEvent(wxSplitterEvent& event) -{ - return !GetEventHandler()->ProcessEvent(event) || event.IsAllowed(); -} - -wxSize wxSplitterWindow::DoGetBestSize() const -{ - // get best sizes of subwindows - wxSize size1, size2; - if ( m_windowOne ) - size1 = m_windowOne->GetEffectiveMinSize(); - if ( m_windowTwo ) - size2 = m_windowTwo->GetEffectiveMinSize(); - - // sum them - // - // pSash points to the size component to which sash size must be added - int *pSash; - wxSize sizeBest; - if ( m_splitMode == wxSPLIT_VERTICAL ) - { - sizeBest.y = wxMax(size1.y, size2.y); - sizeBest.x = wxMax(size1.x, m_minimumPaneSize) + - wxMax(size2.x, m_minimumPaneSize); - - pSash = &sizeBest.x; - } - else // wxSPLIT_HORIZONTAL - { - sizeBest.x = wxMax(size1.x, size2.x); - sizeBest.y = wxMax(size1.y, m_minimumPaneSize) + - wxMax(size2.y, m_minimumPaneSize); - - pSash = &sizeBest.y; - } - - // account for the sash if the window is actually split - if ( m_windowOne && m_windowTwo ) - *pSash += GetSashSize(); - - // account for the border too - int border = 2*GetBorderSize(); - sizeBest.x += border; - sizeBest.y += border; - - return sizeBest; -} - -// --------------------------------------------------------------------------- -// wxSplitterWindow virtual functions: they now just generate the events -// --------------------------------------------------------------------------- - -bool wxSplitterWindow::OnSashPositionChange(int WXUNUSED(newSashPosition)) -{ - // always allow by default - return true; -} - -int wxSplitterWindow::OnSashPositionChanging(int newSashPosition) -{ - // If within UNSPLIT_THRESHOLD from edge, set to edge to cause closure. - const int UNSPLIT_THRESHOLD = 4; - - // first of all, check if OnSashPositionChange() doesn't forbid this change - if ( !OnSashPositionChange(newSashPosition) ) - { - // it does - return -1; - } - - // Obtain relevant window dimension for bottom / right threshold check - int window_size = GetWindowSize(); - - bool unsplit_scenario = false; - if ( m_permitUnsplitAlways || m_minimumPaneSize == 0 ) - { - // Do edge detection if unsplit premitted - if ( newSashPosition <= UNSPLIT_THRESHOLD ) - { - // threshold top / left check - newSashPosition = 0; - unsplit_scenario = true; - } - if ( newSashPosition >= window_size - UNSPLIT_THRESHOLD ) - { - // threshold bottom/right check - newSashPosition = window_size; - unsplit_scenario = true; - } - } - - if ( !unsplit_scenario ) - { - // If resultant pane would be too small, enlarge it - newSashPosition = AdjustSashPosition(newSashPosition); - } - - // If the result is out of bounds it means minimum size is too big, - // so split window in half as best compromise. - if ( newSashPosition < 0 || newSashPosition > window_size ) - newSashPosition = window_size / 2; - - // now let the event handler have it - // - // FIXME: shouldn't we do it before the adjustments above so as to ensure - // that the sash position is always reasonable? - wxSplitterEvent event(wxEVT_COMMAND_SPLITTER_SASH_POS_CHANGING, this); - event.m_data.pos = newSashPosition; - - if ( !DoSendEvent(event) ) - { - // the event handler vetoed the change - newSashPosition = -1; - } - else - { - // it could have been changed by it - newSashPosition = event.GetSashPosition(); - } - - return newSashPosition; -} - -// Called when the sash is double-clicked. The default behaviour is to remove -// the sash if the minimum pane size is zero. -void wxSplitterWindow::OnDoubleClickSash(int x, int y) -{ - wxCHECK_RET(m_windowTwo, wxT("splitter: no window to remove")); - - // new code should handle events instead of using the virtual functions - wxSplitterEvent event(wxEVT_COMMAND_SPLITTER_DOUBLECLICKED, this); - event.m_data.pt.x = x; - event.m_data.pt.y = y; - if ( DoSendEvent(event) ) - { - if ( GetMinimumPaneSize() == 0 || m_permitUnsplitAlways ) - { - wxWindow* win = m_windowTwo; - if ( Unsplit(win) ) - { - wxSplitterEvent unsplitEvent(wxEVT_COMMAND_SPLITTER_UNSPLIT, this); - unsplitEvent.m_data.win = win; - (void)DoSendEvent(unsplitEvent); - } - } - } - //else: blocked by user -} - -void wxSplitterWindow::OnUnsplit(wxWindow *winRemoved) -{ - // call this before calling the event handler which may delete the window - winRemoved->Show(false); -} - -#if defined( __WXMSW__ ) || defined( __WXMAC__) - -// this is currently called (and needed) under MSW only... -void wxSplitterWindow::OnSetCursor(wxSetCursorEvent& event) -{ - // if we don't do it, the resizing cursor might be set for child window: - // and like this we explicitly say that our cursor should not be used for - // children windows which overlap us - - if ( SashHitTest(event.GetX(), event.GetY(), 0) ) - { - // default processing is ok - event.Skip(); - } - //else: do nothing, in particular, don't call Skip() -} - -#endif // wxMSW || wxMac - -#endif // wxUSE_SPLITTER - diff --git a/wxWidgets/src/generic/srchctlg.cpp b/wxWidgets/src/generic/srchctlg.cpp deleted file mode 100644 index 67fd932b8d..0000000000 --- a/wxWidgets/src/generic/srchctlg.cpp +++ /dev/null @@ -1,1216 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: src/generic/srchctlg.cpp -// Purpose: implements wxSearchCtrl as a composite control -// Author: Vince Harron -// Created: 2006-02-19 -// RCS-ID: $Id: srchctlg.cpp 47962 2007-08-08 12:38:13Z JS $ -// Copyright: Vince Harron -// License: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_SEARCHCTRL - -#include "wx/srchctrl.h" - -#ifndef WX_PRECOMP - #include "wx/button.h" - #include "wx/dcclient.h" - #include "wx/menu.h" - #include "wx/dcmemory.h" -#endif //WX_PRECOMP - -#if !wxUSE_NATIVE_SEARCH_CONTROL - -#include "wx/image.h" - -#define WXMAX(a,b) ((a)>(b)?(a):(b)) - -// ---------------------------------------------------------------------------- -// constants -// ---------------------------------------------------------------------------- - -// the margin between the text control and the search/cancel buttons -static const wxCoord MARGIN = 2; - -// border around all controls to compensate for wxSIMPLE_BORDER -#if defined(__WXMSW__) -static const wxCoord BORDER = 0; -static const wxCoord ICON_MARGIN = 2; -static const wxCoord ICON_OFFSET = 2; -#else -static const wxCoord BORDER = 2; -static const wxCoord ICON_MARGIN = 0; -static const wxCoord ICON_OFFSET = 0; -#endif - -// ---------------------------------------------------------------------------- -// TODO: These functions or something like them should probably be made -// public. There are similar functions in src/aui/dockart.cpp... - -static double wxBlendColour(double fg, double bg, double alpha) -{ - double result = bg + (alpha * (fg - bg)); - if (result < 0.0) - result = 0.0; - if (result > 255) - result = 255; - return result; -} - -static wxColor wxStepColour(const wxColor& c, int ialpha) -{ - if (ialpha == 100) - return c; - - double r = c.Red(), g = c.Green(), b = c.Blue(); - double bg; - - // ialpha is 0..200 where 0 is completely black - // and 200 is completely white and 100 is the same - // convert that to normal alpha 0.0 - 1.0 - ialpha = wxMin(ialpha, 200); - ialpha = wxMax(ialpha, 0); - double alpha = ((double)(ialpha - 100.0))/100.0; - - if (ialpha > 100) - { - // blend with white - bg = 255.0; - alpha = 1.0 - alpha; // 0 = transparent fg; 1 = opaque fg - } - else - { - // blend with black - bg = 0.0; - alpha = 1.0 + alpha; // 0 = transparent fg; 1 = opaque fg - } - - r = wxBlendColour(r, bg, alpha); - g = wxBlendColour(g, bg, alpha); - b = wxBlendColour(b, bg, alpha); - - return wxColour((unsigned char)r, (unsigned char)g, (unsigned char)b); -} - -#define LIGHT_STEP 160 - -// ---------------------------------------------------------------------------- -// wxSearchTextCtrl: text control used by search control -// ---------------------------------------------------------------------------- - -class wxSearchTextCtrl : public wxTextCtrl -{ -public: - wxSearchTextCtrl(wxSearchCtrl *search, const wxString& value, int style) - : wxTextCtrl(search, wxID_ANY, value, wxDefaultPosition, wxDefaultSize, - style | wxNO_BORDER) - { - m_search = search; - m_defaultFG = GetForegroundColour(); - - // remove the default minsize, the searchctrl will have one instead - SetSizeHints(wxDefaultCoord,wxDefaultCoord); - } - - void SetDescriptiveText(const wxString& text) - { - if ( GetValue() == m_descriptiveText ) - { - ChangeValue(wxEmptyString); - } - - m_descriptiveText = text; - } - - wxString GetDescriptiveText() const - { - return m_descriptiveText; - } - -protected: - void OnText(wxCommandEvent& eventText) - { - wxCommandEvent event(eventText); - event.SetEventObject(m_search); - event.SetId(m_search->GetId()); - - m_search->GetEventHandler()->ProcessEvent(event); - } - - void OnTextUrl(wxTextUrlEvent& eventText) - { - // copy constructor is disabled for some reason? - //wxTextUrlEvent event(eventText); - wxTextUrlEvent event( - m_search->GetId(), - eventText.GetMouseEvent(), - eventText.GetURLStart(), - eventText.GetURLEnd() - ); - event.SetEventObject(m_search); - - m_search->GetEventHandler()->ProcessEvent(event); - } - - void OnIdle(wxIdleEvent& WXUNUSED(event)) - { - if ( IsEmpty() && !(wxWindow::FindFocus() == this) ) - { - ChangeValue(m_descriptiveText); - SetInsertionPoint(0); - SetForegroundColour(wxStepColour(m_defaultFG, LIGHT_STEP)); - } - } - - void OnFocus(wxFocusEvent& event) - { - event.Skip(); - if ( GetValue() == m_descriptiveText ) - { - ChangeValue(wxEmptyString); - SetForegroundColour(m_defaultFG); - } - } - -private: - wxSearchCtrl* m_search; - wxString m_descriptiveText; - wxColour m_defaultFG; - - DECLARE_EVENT_TABLE() -}; - -BEGIN_EVENT_TABLE(wxSearchTextCtrl, wxTextCtrl) - EVT_TEXT(wxID_ANY, wxSearchTextCtrl::OnText) - EVT_TEXT_ENTER(wxID_ANY, wxSearchTextCtrl::OnText) - EVT_TEXT_URL(wxID_ANY, wxSearchTextCtrl::OnTextUrl) - EVT_TEXT_MAXLEN(wxID_ANY, wxSearchTextCtrl::OnText) - EVT_IDLE(wxSearchTextCtrl::OnIdle) - EVT_SET_FOCUS(wxSearchTextCtrl::OnFocus) -END_EVENT_TABLE() - -// ---------------------------------------------------------------------------- -// wxSearchButton: search button used by search control -// ---------------------------------------------------------------------------- - -class wxSearchButton : public wxControl -{ -public: - wxSearchButton(wxSearchCtrl *search, int eventType, const wxBitmap& bmp) - : wxControl(search, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxNO_BORDER), - m_search(search), - m_eventType(eventType), - m_bmp(bmp) - { } - - void SetBitmapLabel(const wxBitmap& label) { m_bmp = label; } - - -protected: - wxSize DoGetBestSize() const - { - return wxSize(m_bmp.GetWidth(), m_bmp.GetHeight()); - } - - void OnLeftUp(wxMouseEvent&) - { - wxCommandEvent event(m_eventType, m_search->GetId()); - event.SetEventObject(m_search); - - GetEventHandler()->ProcessEvent(event); - - m_search->SetFocus(); - -#if wxUSE_MENUS - if ( m_eventType == wxEVT_COMMAND_SEARCHCTRL_SEARCH_BTN ) - { - // this happens automatically, just like on Mac OS X - m_search->PopupSearchMenu(); - } -#endif // wxUSE_MENUS - } - - void OnPaint(wxPaintEvent&) - { - wxPaintDC dc(this); - dc.DrawBitmap(m_bmp, 0,0, true); - } - - -private: - wxSearchCtrl *m_search; - wxEventType m_eventType; - wxBitmap m_bmp; - - DECLARE_EVENT_TABLE() -}; - -BEGIN_EVENT_TABLE(wxSearchButton, wxControl) - EVT_LEFT_UP(wxSearchButton::OnLeftUp) - EVT_PAINT(wxSearchButton::OnPaint) -END_EVENT_TABLE() - -BEGIN_EVENT_TABLE(wxSearchCtrl, wxSearchCtrlBase) - EVT_SEARCHCTRL_SEARCH_BTN(wxID_ANY, wxSearchCtrl::OnSearchButton) - EVT_SET_FOCUS(wxSearchCtrl::OnSetFocus) - EVT_SIZE(wxSearchCtrl::OnSize) -END_EVENT_TABLE() - -IMPLEMENT_DYNAMIC_CLASS(wxSearchCtrl, wxSearchCtrlBase) - -// ============================================================================ -// implementation -// ============================================================================ - -// ---------------------------------------------------------------------------- -// wxSearchCtrl creation -// ---------------------------------------------------------------------------- - -// creation -// -------- - -wxSearchCtrl::wxSearchCtrl() -{ - Init(); -} - -wxSearchCtrl::wxSearchCtrl(wxWindow *parent, wxWindowID id, - const wxString& value, - const wxPoint& pos, - const wxSize& size, - long style, - const wxValidator& validator, - const wxString& name) -{ - Init(); - - Create(parent, id, value, pos, size, style, validator, name); -} - -void wxSearchCtrl::Init() -{ - m_text = NULL; - m_searchButton = NULL; - m_cancelButton = NULL; -#if wxUSE_MENUS - m_menu = NULL; -#endif // wxUSE_MENUS - - m_searchButtonVisible = true; - m_cancelButtonVisible = false; - - m_searchBitmapUser = false; - m_cancelBitmapUser = false; -#if wxUSE_MENUS - m_searchMenuBitmapUser = false; -#endif // wxUSE_MENUS -} - -bool wxSearchCtrl::Create(wxWindow *parent, wxWindowID id, - const wxString& value, - const wxPoint& pos, - const wxSize& size, - long style, - const wxValidator& validator, - const wxString& name) -{ - int borderStyle = wxBORDER_SIMPLE; - -#if defined(__WXMSW__) - borderStyle = GetThemedBorderStyle(); - if (borderStyle == wxBORDER_SUNKEN) - borderStyle = wxBORDER_SIMPLE; -#elif defined(__WXGTK__) - borderStyle = wxBORDER_SUNKEN; -#endif - - if ( !wxTextCtrlBase::Create(parent, id, pos, size, borderStyle | (style & ~wxBORDER_MASK), validator, name) ) - { - return false; - } - - m_text = new wxSearchTextCtrl(this, value, style & ~wxBORDER_MASK); - m_text->SetDescriptiveText(_("Search")); - - wxSize sizeText = m_text->GetBestSize(); - - m_searchButton = new wxSearchButton(this,wxEVT_COMMAND_SEARCHCTRL_SEARCH_BTN,m_searchBitmap); - m_cancelButton = new wxSearchButton(this,wxEVT_COMMAND_SEARCHCTRL_CANCEL_BTN,m_cancelBitmap); - - SetForegroundColour( m_text->GetForegroundColour() ); - m_searchButton->SetForegroundColour( m_text->GetForegroundColour() ); - m_cancelButton->SetForegroundColour( m_text->GetForegroundColour() ); - - SetBackgroundColour( m_text->GetBackgroundColour() ); - m_searchButton->SetBackgroundColour( m_text->GetBackgroundColour() ); - m_cancelButton->SetBackgroundColour( m_text->GetBackgroundColour() ); - - RecalcBitmaps(); - - SetInitialSize(size); - Move(pos); - return true; -} - -wxSearchCtrl::~wxSearchCtrl() -{ - delete m_text; - delete m_searchButton; - delete m_cancelButton; -#if wxUSE_MENUS - delete m_menu; -#endif // wxUSE_MENUS -} - - -// search control specific interfaces -#if wxUSE_MENUS - -void wxSearchCtrl::SetMenu( wxMenu* menu ) -{ - if ( menu == m_menu ) - { - // no change - return; - } - bool hadMenu = (m_menu != NULL); - delete m_menu; - m_menu = menu; - - if ( m_menu && !hadMenu ) - { - m_searchButton->SetBitmapLabel(m_searchMenuBitmap); - m_searchButton->Refresh(); - } - else if ( !m_menu && hadMenu ) - { - m_searchButton->SetBitmapLabel(m_searchBitmap); - if ( m_searchButtonVisible ) - { - m_searchButton->Refresh(); - } - } - wxRect rect = GetRect(); - LayoutControls(0, 0, rect.GetWidth(), rect.GetHeight()); -} - -wxMenu* wxSearchCtrl::GetMenu() -{ - return m_menu; -} - -#endif // wxUSE_MENUS - -void wxSearchCtrl::ShowSearchButton( bool show ) -{ - if ( m_searchButtonVisible == show ) - { - // no change - return; - } - m_searchButtonVisible = show; - if ( m_searchButtonVisible ) - { - RecalcBitmaps(); - } - - wxRect rect = GetRect(); - LayoutControls(0, 0, rect.GetWidth(), rect.GetHeight()); -} - -bool wxSearchCtrl::IsSearchButtonVisible() const -{ - return m_searchButtonVisible; -} - - -void wxSearchCtrl::ShowCancelButton( bool show ) -{ - if ( m_cancelButtonVisible == show ) - { - // no change - return; - } - m_cancelButtonVisible = show; - - wxRect rect = GetRect(); - LayoutControls(0, 0, rect.GetWidth(), rect.GetHeight()); -} - -bool wxSearchCtrl::IsCancelButtonVisible() const -{ - return m_cancelButtonVisible; -} - -void wxSearchCtrl::SetDescriptiveText(const wxString& text) -{ - m_text->SetDescriptiveText(text); -} - -wxString wxSearchCtrl::GetDescriptiveText() const -{ - return m_text->GetDescriptiveText(); -} - -// ---------------------------------------------------------------------------- -// geometry -// ---------------------------------------------------------------------------- - -wxSize wxSearchCtrl::DoGetBestSize() const -{ - wxSize sizeText = m_text->GetBestSize(); - wxSize sizeSearch(0,0); - wxSize sizeCancel(0,0); - int searchMargin = 0; - int cancelMargin = 0; - if ( m_searchButtonVisible || HasMenu() ) - { - sizeSearch = m_searchButton->GetBestSize(); - searchMargin = MARGIN; - } - if ( m_cancelButtonVisible ) - { - sizeCancel = m_cancelButton->GetBestSize(); - cancelMargin = MARGIN; - } - - int horizontalBorder = 1 + ( sizeText.y - sizeText.y * 14 / 21 ) / 2; - - // buttons are square and equal to the height of the text control - int height = sizeText.y; - return wxSize(sizeSearch.x + searchMargin + sizeText.x + cancelMargin + sizeCancel.x + 2*horizontalBorder, - height + 2*BORDER); -} - -void wxSearchCtrl::DoMoveWindow(int x, int y, int width, int height) -{ - wxSearchCtrlBase::DoMoveWindow(x, y, width, height); - - LayoutControls(0, 0, width, height); -} - -void wxSearchCtrl::LayoutControls(int x, int y, int width, int height) -{ - if ( !m_text ) - return; - - wxSize sizeText = m_text->GetBestSize(); - // make room for the search menu & clear button - int horizontalBorder = ( sizeText.y - sizeText.y * 14 / 21 ) / 2; - x += horizontalBorder; - y += BORDER; - width -= horizontalBorder*2; - height -= BORDER*2; - - wxSize sizeSearch(0,0); - wxSize sizeCancel(0,0); - int searchMargin = 0; - int cancelMargin = 0; - if ( m_searchButtonVisible || HasMenu() ) - { - sizeSearch = m_searchButton->GetBestSize(); - searchMargin = MARGIN; - } - if ( m_cancelButtonVisible ) - { - sizeCancel = m_cancelButton->GetBestSize(); - cancelMargin = MARGIN; - } - m_searchButton->Show( m_searchButtonVisible || HasMenu() ); - m_cancelButton->Show( m_cancelButtonVisible ); - - if ( sizeSearch.x + sizeCancel.x > width ) - { - sizeSearch.x = width/2; - sizeCancel.x = width/2; - searchMargin = 0; - cancelMargin = 0; - } - wxCoord textWidth = width - sizeSearch.x - sizeCancel.x - searchMargin - cancelMargin - 1; - - // position the subcontrols inside the client area - - m_searchButton->SetSize(x, y + ICON_OFFSET - 1, sizeSearch.x, height); - m_text->SetSize( x + sizeSearch.x + searchMargin, - y + ICON_OFFSET - BORDER, - textWidth, - height); - m_cancelButton->SetSize(x + sizeSearch.x + searchMargin + textWidth + cancelMargin, - y + ICON_OFFSET - 1, sizeCancel.x, height); -} - - -// accessors -// --------- - -wxString wxSearchCtrl::GetValue() const -{ - wxString value = m_text->GetValue(); - if (value == m_text->GetDescriptiveText()) - return wxEmptyString; - else - return value; -} -void wxSearchCtrl::SetValue(const wxString& value) -{ - m_text->SetValue(value); -} - -wxString wxSearchCtrl::GetRange(long from, long to) const -{ - return m_text->GetRange(from, to); -} - -int wxSearchCtrl::GetLineLength(long lineNo) const -{ - return m_text->GetLineLength(lineNo); -} -wxString wxSearchCtrl::GetLineText(long lineNo) const -{ - return m_text->GetLineText(lineNo); -} -int wxSearchCtrl::GetNumberOfLines() const -{ - return m_text->GetNumberOfLines(); -} - -bool wxSearchCtrl::IsModified() const -{ - return m_text->IsModified(); -} -bool wxSearchCtrl::IsEditable() const -{ - return m_text->IsEditable(); -} - -// more readable flag testing methods -bool wxSearchCtrl::IsSingleLine() const -{ - return m_text->IsSingleLine(); -} -bool wxSearchCtrl::IsMultiLine() const -{ - return m_text->IsMultiLine(); -} - -// If the return values from and to are the same, there is no selection. -void wxSearchCtrl::GetSelection(long* from, long* to) const -{ - m_text->GetSelection(from, to); -} - -wxString wxSearchCtrl::GetStringSelection() const -{ - return m_text->GetStringSelection(); -} - -// operations -// ---------- - -// editing -void wxSearchCtrl::Clear() -{ - m_text->Clear(); -} -void wxSearchCtrl::Replace(long from, long to, const wxString& value) -{ - m_text->Replace(from, to, value); -} -void wxSearchCtrl::Remove(long from, long to) -{ - m_text->Remove(from, to); -} - -// load/save the controls contents from/to the file -bool wxSearchCtrl::LoadFile(const wxString& file) -{ - return m_text->LoadFile(file); -} -bool wxSearchCtrl::SaveFile(const wxString& file) -{ - return m_text->SaveFile(file); -} - -// sets/clears the dirty flag -void wxSearchCtrl::MarkDirty() -{ - m_text->MarkDirty(); -} -void wxSearchCtrl::DiscardEdits() -{ - m_text->DiscardEdits(); -} - -// set the max number of characters which may be entered in a single line -// text control -void wxSearchCtrl::SetMaxLength(unsigned long len) -{ - m_text->SetMaxLength(len); -} - -// writing text inserts it at the current position, appending always -// inserts it at the end -void wxSearchCtrl::WriteText(const wxString& text) -{ - m_text->WriteText(text); -} -void wxSearchCtrl::AppendText(const wxString& text) -{ - m_text->AppendText(text); -} - -// insert the character which would have resulted from this key event, -// return true if anything has been inserted -bool wxSearchCtrl::EmulateKeyPress(const wxKeyEvent& event) -{ - return m_text->EmulateKeyPress(event); -} - -// 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 -bool wxSearchCtrl::SetStyle(long start, long end, const wxTextAttr& style) -{ - return m_text->SetStyle(start, end, style); -} -bool wxSearchCtrl::GetStyle(long position, wxTextAttr& style) -{ - return m_text->GetStyle(position, style); -} -bool wxSearchCtrl::SetDefaultStyle(const wxTextAttr& style) -{ - return m_text->SetDefaultStyle(style); -} -const wxTextAttr& wxSearchCtrl::GetDefaultStyle() const -{ - return m_text->GetDefaultStyle(); -} - -// 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. -long wxSearchCtrl::XYToPosition(long x, long y) const -{ - return m_text->XYToPosition(x, y); -} -bool wxSearchCtrl::PositionToXY(long pos, long *x, long *y) const -{ - return m_text->PositionToXY(pos, x, y); -} - -void wxSearchCtrl::ShowPosition(long pos) -{ - m_text->ShowPosition(pos); -} - -// find the character at position given in pixels -// -// NB: pt is in device coords (not adjusted for the client area origin nor -// scrolling) -wxTextCtrlHitTestResult wxSearchCtrl::HitTest(const wxPoint& pt, long *pos) const -{ - return m_text->HitTest(pt, pos); -} -wxTextCtrlHitTestResult wxSearchCtrl::HitTest(const wxPoint& pt, - wxTextCoord *col, - wxTextCoord *row) const -{ - return m_text->HitTest(pt, col, row); -} - -// Clipboard operations -void wxSearchCtrl::Copy() -{ - m_text->Copy(); -} -void wxSearchCtrl::Cut() -{ - m_text->Cut(); -} -void wxSearchCtrl::Paste() -{ - m_text->Paste(); -} - -bool wxSearchCtrl::CanCopy() const -{ - return m_text->CanCopy(); -} -bool wxSearchCtrl::CanCut() const -{ - return m_text->CanCut(); -} -bool wxSearchCtrl::CanPaste() const -{ - return m_text->CanPaste(); -} - -// Undo/redo -void wxSearchCtrl::Undo() -{ - m_text->Undo(); -} -void wxSearchCtrl::Redo() -{ - m_text->Redo(); -} - -bool wxSearchCtrl::CanUndo() const -{ - return m_text->CanUndo(); -} -bool wxSearchCtrl::CanRedo() const -{ - return m_text->CanRedo(); -} - -// Insertion point -void wxSearchCtrl::SetInsertionPoint(long pos) -{ - m_text->SetInsertionPoint(pos); -} -void wxSearchCtrl::SetInsertionPointEnd() -{ - m_text->SetInsertionPointEnd(); -} -long wxSearchCtrl::GetInsertionPoint() const -{ - return m_text->GetInsertionPoint(); -} -wxTextPos wxSearchCtrl::GetLastPosition() const -{ - return m_text->GetLastPosition(); -} - -void wxSearchCtrl::SetSelection(long from, long to) -{ - m_text->SetSelection(from, to); -} -void wxSearchCtrl::SelectAll() -{ - m_text->SelectAll(); -} - -void wxSearchCtrl::SetEditable(bool editable) -{ - m_text->SetEditable(editable); -} - -bool wxSearchCtrl::SetFont(const wxFont& font) -{ - bool result = wxSearchCtrlBase::SetFont(font); - if ( result && m_text ) - { - result = m_text->SetFont(font); - } - RecalcBitmaps(); - return result; -} - -// search control generic only -void wxSearchCtrl::SetSearchBitmap( const wxBitmap& bitmap ) -{ - m_searchBitmap = bitmap; - m_searchBitmapUser = bitmap.Ok(); - if ( m_searchBitmapUser ) - { - if ( m_searchButton && !HasMenu() ) - { - m_searchButton->SetBitmapLabel( m_searchBitmap ); - } - } - else - { - // the user bitmap was just cleared, generate one - RecalcBitmaps(); - } -} - -#if wxUSE_MENUS - -void wxSearchCtrl::SetSearchMenuBitmap( const wxBitmap& bitmap ) -{ - m_searchMenuBitmap = bitmap; - m_searchMenuBitmapUser = bitmap.Ok(); - if ( m_searchMenuBitmapUser ) - { - if ( m_searchButton && m_menu ) - { - m_searchButton->SetBitmapLabel( m_searchMenuBitmap ); - } - } - else - { - // the user bitmap was just cleared, generate one - RecalcBitmaps(); - } -} - -#endif // wxUSE_MENUS - -void wxSearchCtrl::SetCancelBitmap( const wxBitmap& bitmap ) -{ - m_cancelBitmap = bitmap; - m_cancelBitmapUser = bitmap.Ok(); - if ( m_cancelBitmapUser ) - { - if ( m_cancelButton ) - { - m_cancelButton->SetBitmapLabel( m_cancelBitmap ); - } - } - else - { - // the user bitmap was just cleared, generate one - RecalcBitmaps(); - } -} - -#if 0 - -// override streambuf method -#if wxHAS_TEXT_WINDOW_STREAM -int overflow(int i); -#endif // wxHAS_TEXT_WINDOW_STREAM - -// stream-like insertion operators: these are always available, whether we -// were, or not, compiled with streambuf support -wxTextCtrl& operator<<(const wxString& s); -wxTextCtrl& operator<<(int i); -wxTextCtrl& operator<<(long i); -wxTextCtrl& operator<<(float f); -wxTextCtrl& operator<<(double d); -wxTextCtrl& operator<<(const wxChar c); -#endif - -void wxSearchCtrl::DoSetValue(const wxString& value, int flags) -{ - m_text->ChangeValue( value ); - if ( flags & SetValue_SendEvent ) - SendTextUpdatedEvent(); -} - -// do the window-specific processing after processing the update event -void wxSearchCtrl::DoUpdateWindowUI(wxUpdateUIEvent& event) -{ - wxSearchCtrlBase::DoUpdateWindowUI(event); -} - -bool wxSearchCtrl::ShouldInheritColours() const -{ - return true; -} - -// icons are rendered at 3-8 times larger than necessary and downscaled for -// antialiasing -static int GetMultiplier() -{ -#ifdef __WXWINCE__ - // speed up bitmap generation by using a small bitmap - return 3; -#else - int depth = ::wxDisplayDepth(); - - if ( depth >= 24 ) - { - return 8; - } - return 6; -#endif -} - -wxBitmap wxSearchCtrl::RenderSearchBitmap( int x, int y, bool renderDrop ) -{ - wxColour bg = GetBackgroundColour(); - wxColour fg = wxStepColour(GetForegroundColour(), LIGHT_STEP-20); - - //=============================================================================== - // begin drawing code - //=============================================================================== - // image stats - - // force width:height ratio - if ( 14*x > y*20 ) - { - // x is too big - x = y*20/14; - } - else - { - // y is too big - y = x*14/20; - } - - // glass 11x11, top left corner - // handle (9,9)-(13,13) - // drop (13,16)-(19,6)-(16,9) - - int multiplier = GetMultiplier(); - int penWidth = multiplier * 2; - - penWidth = penWidth * x / 20; - - wxBitmap bitmap( multiplier*x, multiplier*y ); - wxMemoryDC mem; - mem.SelectObject(bitmap); - - // clear background - mem.SetBrush( wxBrush(bg) ); - mem.SetPen( wxPen(bg) ); - mem.DrawRectangle(0,0,bitmap.GetWidth(),bitmap.GetHeight()); - - // draw drop glass - mem.SetBrush( wxBrush(fg) ); - mem.SetPen( wxPen(fg) ); - int glassBase = 5 * x / 20; - int glassFactor = 2*glassBase + 1; - int radius = multiplier*glassFactor/2; - mem.DrawCircle(radius,radius,radius); - mem.SetBrush( wxBrush(bg) ); - mem.SetPen( wxPen(bg) ); - mem.DrawCircle(radius,radius,radius-penWidth); - - // draw handle - int lineStart = radius + (radius-penWidth/2) * 707 / 1000; // 707 / 1000 = 0.707 = 1/sqrt(2); - - mem.SetPen( wxPen(fg) ); - mem.SetBrush( wxBrush(fg) ); - int handleCornerShift = penWidth * 707 / 1000 / 2; // 707 / 1000 = 0.707 = 1/sqrt(2); - handleCornerShift = WXMAX( handleCornerShift, 1 ); - int handleBase = 4 * x / 20; - int handleLength = 2*handleBase+1; - wxPoint handlePolygon[] = - { - wxPoint(-handleCornerShift,+handleCornerShift), - wxPoint(+handleCornerShift,-handleCornerShift), - wxPoint(multiplier*handleLength/2+handleCornerShift,multiplier*handleLength/2-handleCornerShift), - wxPoint(multiplier*handleLength/2-handleCornerShift,multiplier*handleLength/2+handleCornerShift), - }; - mem.DrawPolygon(WXSIZEOF(handlePolygon),handlePolygon,lineStart,lineStart); - - // draw drop triangle - int triangleX = 13 * x / 20; - int triangleY = 5 * x / 20; - int triangleBase = 3 * x / 20; - int triangleFactor = triangleBase*2+1; - if ( renderDrop ) - { - wxPoint dropPolygon[] = - { - wxPoint(multiplier*0,multiplier*0), // triangle left - wxPoint(multiplier*triangleFactor-1,multiplier*0), // triangle right - wxPoint(multiplier*triangleFactor/2,multiplier*triangleFactor/2), // triangle bottom - }; - mem.DrawPolygon(WXSIZEOF(dropPolygon),dropPolygon,multiplier*triangleX,multiplier*triangleY); - } - mem.SelectObject(wxNullBitmap); - - //=============================================================================== - // end drawing code - //=============================================================================== - - if ( multiplier != 1 ) - { - wxImage image = bitmap.ConvertToImage(); - image.Rescale(x,y); - bitmap = wxBitmap( image ); - } - if ( !renderDrop ) - { - // Trim the edge where the arrow would have gone - bitmap = bitmap.GetSubBitmap(wxRect(0,0, y,y)); - } - - return bitmap; -} - -wxBitmap wxSearchCtrl::RenderCancelBitmap( int x, int y ) -{ - wxColour bg = GetBackgroundColour(); - wxColour fg = wxStepColour(GetForegroundColour(), LIGHT_STEP); - - //=============================================================================== - // begin drawing code - //=============================================================================== - // image stats - - // total size 14x14 - // force 1:1 ratio - if ( x > y ) - { - // x is too big - x = y; - } - else - { - // y is too big - y = x; - } - - // 14x14 circle - // cross line starts (4,4)-(10,10) - // drop (13,16)-(19,6)-(16,9) - - int multiplier = GetMultiplier(); - - int penWidth = multiplier * x / 14; - - wxBitmap bitmap( multiplier*x, multiplier*y ); - wxMemoryDC mem; - mem.SelectObject(bitmap); - - // clear background - mem.SetBrush( wxBrush(bg) ); - mem.SetPen( wxPen(bg) ); - mem.DrawRectangle(0,0,bitmap.GetWidth(),bitmap.GetHeight()); - - // draw drop glass - mem.SetBrush( wxBrush(fg) ); - mem.SetPen( wxPen(fg) ); - int radius = multiplier*x/2; - mem.DrawCircle(radius,radius,radius); - - // draw cross - int lineStartBase = 4 * x / 14; - int lineLength = x - 2*lineStartBase; - - mem.SetPen( wxPen(bg) ); - mem.SetBrush( wxBrush(bg) ); - int handleCornerShift = penWidth/2; - handleCornerShift = WXMAX( handleCornerShift, 1 ); - wxPoint handlePolygon[] = - { - wxPoint(-handleCornerShift,+handleCornerShift), - wxPoint(+handleCornerShift,-handleCornerShift), - wxPoint(multiplier*lineLength+handleCornerShift,multiplier*lineLength-handleCornerShift), - wxPoint(multiplier*lineLength-handleCornerShift,multiplier*lineLength+handleCornerShift), - }; - mem.DrawPolygon(WXSIZEOF(handlePolygon),handlePolygon,multiplier*lineStartBase,multiplier*lineStartBase); - wxPoint handlePolygon2[] = - { - wxPoint(+handleCornerShift,+handleCornerShift), - wxPoint(-handleCornerShift,-handleCornerShift), - wxPoint(multiplier*lineLength-handleCornerShift,-multiplier*lineLength-handleCornerShift), - wxPoint(multiplier*lineLength+handleCornerShift,-multiplier*lineLength+handleCornerShift), - }; - mem.DrawPolygon(WXSIZEOF(handlePolygon2),handlePolygon2,multiplier*lineStartBase,multiplier*(x-lineStartBase)); - - //=============================================================================== - // end drawing code - //=============================================================================== - - if ( multiplier != 1 ) - { - wxImage image = bitmap.ConvertToImage(); - image.Rescale(x,y); - bitmap = wxBitmap( image ); - } - - return bitmap; -} - -void wxSearchCtrl::RecalcBitmaps() -{ - if ( !m_text ) - { - return; - } - wxSize sizeText = m_text->GetBestSize(); - - int bitmapHeight = sizeText.y - 2 * ICON_MARGIN; - int bitmapWidth = sizeText.y * 20 / 14; - - if ( !m_searchBitmapUser ) - { - if ( - !m_searchBitmap.Ok() || - m_searchBitmap.GetHeight() != bitmapHeight || - m_searchBitmap.GetWidth() != bitmapWidth - ) - { - m_searchBitmap = RenderSearchBitmap(bitmapWidth,bitmapHeight,false); - if ( !HasMenu() ) - { - m_searchButton->SetBitmapLabel(m_searchBitmap); - } - } - // else this bitmap was set by user, don't alter - } - -#if wxUSE_MENUS - if ( !m_searchMenuBitmapUser ) - { - if ( - !m_searchMenuBitmap.Ok() || - m_searchMenuBitmap.GetHeight() != bitmapHeight || - m_searchMenuBitmap.GetWidth() != bitmapWidth - ) - { - m_searchMenuBitmap = RenderSearchBitmap(bitmapWidth,bitmapHeight,true); - if ( m_menu ) - { - m_searchButton->SetBitmapLabel(m_searchMenuBitmap); - } - } - // else this bitmap was set by user, don't alter - } -#endif // wxUSE_MENUS - - if ( !m_cancelBitmapUser ) - { - if ( - !m_cancelBitmap.Ok() || - m_cancelBitmap.GetHeight() != bitmapHeight || - m_cancelBitmap.GetWidth() != bitmapHeight - ) - { - m_cancelBitmap = RenderCancelBitmap(bitmapHeight-BORDER-1,bitmapHeight-BORDER-1); // square - m_cancelButton->SetBitmapLabel(m_cancelBitmap); - } - // else this bitmap was set by user, don't alter - } -} - -void wxSearchCtrl::OnSearchButton( wxCommandEvent& event ) -{ - event.Skip(); -} - -void wxSearchCtrl::OnSetFocus( wxFocusEvent& /*event*/ ) -{ - if ( m_text ) - { - m_text->SetFocus(); - } -} - -void wxSearchCtrl::OnSize( wxSizeEvent& WXUNUSED(event) ) -{ - int width, height; - GetSize(&width, &height); - LayoutControls(0, 0, width, height); -} - -#if wxUSE_MENUS - -void wxSearchCtrl::PopupSearchMenu() -{ - if ( m_menu ) - { - wxSize size = GetSize(); - PopupMenu( m_menu, 0, size.y ); - } -} - -#endif // wxUSE_MENUS - -#endif // !wxUSE_NATIVE_SEARCH_CONTROL - -#endif // wxUSE_SEARCHCTRL diff --git a/wxWidgets/src/generic/statline.cpp b/wxWidgets/src/generic/statline.cpp deleted file mode 100644 index b65b89c399..0000000000 --- a/wxWidgets/src/generic/statline.cpp +++ /dev/null @@ -1,88 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/generic/statline.cpp -// Purpose: a generic wxStaticLine class -// Author: Vadim Zeitlin -// Created: 28.06.99 -// Version: $Id: statline.cpp 39487 2006-05-31 18:27:51Z ABX $ -// Copyright: (c) 1998 Vadim Zeitlin -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -#include "wx/wxprec.h" - -// For compilers that support precompilation, includes "wx.h". - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_STATLINE - -#include "wx/statline.h" - -#ifndef WX_PRECOMP - #include "wx/statbox.h" -#endif - -// ============================================================================ -// 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) -{ - m_statbox = NULL; - - 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, wxEmptyString, pos, sizeReal, style, name); - - return true; -} - -wxStaticLine::~wxStaticLine() -{ - delete m_statbox; -} - -WXWidget wxStaticLine::GetMainWidget() const -{ - return m_statbox->GetMainWidget(); -} - -void wxStaticLine::DoSetSize(int x, int y, int width, int height, int sizeFlags) -{ - m_statbox->SetSize(x, y, width, height, sizeFlags); -} - -void wxStaticLine::DoMoveWindow(int x, int y, int width, int height) -{ - m_statbox->SetSize(x, y, width, height); -} - -#endif - // wxUSE_STATLINE diff --git a/wxWidgets/src/generic/statusbr.cpp b/wxWidgets/src/generic/statusbr.cpp deleted file mode 100644 index c88b82b734..0000000000 --- a/wxWidgets/src/generic/statusbr.cpp +++ /dev/null @@ -1,488 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/generic/statusbr.cpp -// Purpose: wxStatusBarGeneric class implementation -// Author: Julian Smart -// Modified by: -// Created: 01/02/97 -// RCS-ID: $Id: statusbr.cpp 57542 2008-12-25 13:03:24Z VZ $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_STATUSBAR - -#include "wx/statusbr.h" - -#ifndef WX_PRECOMP - #include "wx/settings.h" - #include "wx/dcclient.h" -#endif - -#ifdef __WXGTK20__ - #include - #include "wx/gtk/win_gtk.h" -#endif - -// we only have to do it here when we use wxStatusBarGeneric in addition to the -// standard wxStatusBar class, if wxStatusBarGeneric is the same as -// wxStatusBar, then the corresponding IMPLEMENT_DYNAMIC_CLASS is already in -// common/statbar.cpp -#if defined(__WXMAC__) || \ - (defined(wxUSE_NATIVE_STATUSBAR) && wxUSE_NATIVE_STATUSBAR) - #include "wx/generic/statusbr.h" - - IMPLEMENT_DYNAMIC_CLASS(wxStatusBarGeneric, wxWindow) -#endif // wxUSE_NATIVE_STATUSBAR - -BEGIN_EVENT_TABLE(wxStatusBarGeneric, wxWindow) - EVT_PAINT(wxStatusBarGeneric::OnPaint) - EVT_LEFT_DOWN(wxStatusBarGeneric::OnLeftDown) - EVT_RIGHT_DOWN(wxStatusBarGeneric::OnRightDown) - EVT_SYS_COLOUR_CHANGED(wxStatusBarGeneric::OnSysColourChanged) -END_EVENT_TABLE() - -// Default status border dimensions -#define wxTHICK_LINE_BORDER 2 - -void wxStatusBarGeneric::Init() -{ - m_borderX = wxTHICK_LINE_BORDER; - m_borderY = wxTHICK_LINE_BORDER; -} - -wxStatusBarGeneric::~wxStatusBarGeneric() -{ -} - -bool wxStatusBarGeneric::Create(wxWindow *parent, - wxWindowID id, - long style, - const wxString& name) -{ - style |= wxTAB_TRAVERSAL | wxFULL_REPAINT_ON_RESIZE; - if ( !wxWindow::Create(parent, id, - wxDefaultPosition, wxDefaultSize, - style, name) ) - return false; - - // The status bar should have a themed background - SetThemeEnabled( true ); - - InitColours(); - -#ifdef __WXPM__ - SetFont(*wxSMALL_FONT); -#endif - - wxCoord y; - { - // Set the height according to the font and the border size - wxClientDC dc(this); - dc.SetFont(GetFont()); - - dc.GetTextExtent(_T("X"), NULL, &y ); - } - int height = (int)( (11*y)/10 + 2*GetBorderY()); - - SetSize(wxDefaultCoord, wxDefaultCoord, wxDefaultCoord, height); - - SetFieldsCount(1); - - return true; -} - - -wxSize wxStatusBarGeneric::DoGetBestSize() const -{ - int width, height; - - // best width is the width of the parent - GetParent()->GetClientSize(&width, NULL); - - // best height is as calculated above in Create - wxClientDC dc((wxWindow*)this); - dc.SetFont(GetFont()); - wxCoord y; - dc.GetTextExtent(_T("X"), NULL, &y ); - height = (int)( (11*y)/10 + 2*GetBorderY()); - - return wxSize(width, height); -} - -void wxStatusBarGeneric::SetFieldsCount(int number, const int *widths) -{ - wxASSERT_MSG( number >= 0, _T("negative number of fields in wxStatusBar?") ); - - int i; - for(i = m_nFields; i < number; ++i) - m_statusStrings.Add( wxEmptyString ); - - for (i = m_nFields - 1; i >= number; --i) - m_statusStrings.RemoveAt(i); - - // forget the old cached pixel widths - m_widthsAbs.Empty(); - - wxStatusBarBase::SetFieldsCount(number, widths); - - wxASSERT_MSG( m_nFields == (int)m_statusStrings.GetCount(), - _T("This really should never happen, can we do away with m_nFields here?") ); -} - -void wxStatusBarGeneric::SetStatusText(const wxString& text, int number) -{ - wxCHECK_RET( (number >= 0) && (number < m_nFields), - _T("invalid status bar field index") ); - - wxString oldText = m_statusStrings[number]; - if (oldText != text) - { - m_statusStrings[number] = text; - - wxRect rect; - GetFieldRect(number, rect); - - Refresh(true, &rect); - - // it's common to show some text in the status bar before starting a - // relatively lengthy operation, ensure that the text is shown to the - // user immediately and not after the lengthy operation end - Update(); - } -} - -wxString wxStatusBarGeneric::GetStatusText(int n) const -{ - wxCHECK_MSG( (n >= 0) && (n < m_nFields), wxEmptyString, - _T("invalid status bar field index") ); - - return m_statusStrings[n]; -} - -void wxStatusBarGeneric::SetStatusWidths(int n, const int widths_field[]) -{ - // only set status widths, when n == number of statuswindows - wxCHECK_RET( n == m_nFields, _T("status bar field count mismatch") ); - - // delete the old widths in any case - this function may be used to reset - // the widths to the default (all equal) - // MBN: this is incompatible with at least wxMSW and wxMAC and not - // documented, but let's keep it for now - ReinitWidths(); - - // forget the old cached pixel widths - m_widthsAbs.Empty(); - - if ( !widths_field ) - { - // not an error, see the comment above - Refresh(); - return; - } - - wxStatusBarBase::SetStatusWidths(n, widths_field); -} - -void wxStatusBarGeneric::OnPaint(wxPaintEvent& WXUNUSED(event) ) -{ - wxPaintDC dc(this); - - dc.SetTextForeground(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT)); -#ifdef __WXGTK20__ - // Draw grip first - if (HasFlag( wxST_SIZEGRIP )) - { - int width, height; - GetClientSize(&width, &height); - - if (GetLayoutDirection() == wxLayout_RightToLeft) - { - gtk_paint_resize_grip( m_widget->style, - GTK_PIZZA(m_wxwindow)->bin_window, - (GtkStateType) GTK_WIDGET_STATE (m_widget), - NULL, - m_widget, - "statusbar", - GDK_WINDOW_EDGE_SOUTH_WEST, - 2, 2, height-2, height-4 ); - } - else - { - gtk_paint_resize_grip( m_widget->style, - GTK_PIZZA(m_wxwindow)->bin_window, - (GtkStateType) GTK_WIDGET_STATE (m_widget), - NULL, - m_widget, - "statusbar", - GDK_WINDOW_EDGE_SOUTH_EAST, - width-height-2, 2, height-2, height-4 ); - } - } -#endif - - if (GetFont().Ok()) - dc.SetFont(GetFont()); - - dc.SetBackgroundMode(wxTRANSPARENT); - -#ifdef __WXPM__ - wxColour vColor; - - vColor = wxSystemSettings::GetColour(wxSYS_COLOUR_MENUBAR); - ::WinFillRect(dc.m_hPS, &dc.m_vRclPaint, vColor.GetPixel()); -#endif - - for (int i = 0; i < m_nFields; i ++) - DrawField(dc, i); -} - -void wxStatusBarGeneric::DrawFieldText(wxDC& dc, int i) -{ - int leftMargin = 2; - - wxRect rect; - GetFieldRect(i, rect); - - wxString text(GetStatusText(i)); - - long x = 0, y = 0; - - dc.GetTextExtent(text, &x, &y); - - int xpos = rect.x + leftMargin; - int ypos = (int) (((rect.height - y) / 2 ) + rect.y + 0.5) ; - -#if defined( __WXGTK__ ) || defined(__WXMAC__) - xpos++; - ypos++; -#endif - - dc.SetClippingRegion(rect.x, rect.y, rect.width, rect.height); - - dc.DrawText(text, xpos, ypos); - - dc.DestroyClippingRegion(); -} - -void wxStatusBarGeneric::DrawField(wxDC& dc, int i) -{ - wxRect rect; - GetFieldRect(i, rect); - - int style = wxSB_NORMAL; - if (m_statusStyles) - style = m_statusStyles[i]; - - if (style != wxSB_FLAT) - { - // Draw border - // For wxSB_NORMAL: - // Have grey background, plus 3-d border - - // One black rectangle. - // Inside this, left and top sides - dark grey. Bottom and right - - // white. - // Reverse it for wxSB_RAISED - - dc.SetPen((style == wxSB_RAISED) ? m_mediumShadowPen : m_hilightPen); - - #ifndef __WXPM__ - - // Right and bottom lines - dc.DrawLine(rect.x + rect.width, rect.y, - rect.x + rect.width, rect.y + rect.height); - dc.DrawLine(rect.x + rect.width, rect.y + rect.height, - rect.x, rect.y + rect.height); - - dc.SetPen((style == wxSB_RAISED) ? m_hilightPen : m_mediumShadowPen); - - // Left and top lines - dc.DrawLine(rect.x, rect.y + rect.height, - rect.x, rect.y); - dc.DrawLine(rect.x, rect.y, - rect.x + rect.width, rect.y); - #else - - dc.DrawLine(rect.x + rect.width, rect.height + 2, - rect.x, rect.height + 2); - dc.DrawLine(rect.x + rect.width, rect.y, - rect.x + rect.width, rect.y + rect.height); - - dc.SetPen((style == wxSB_RAISED) ? m_hilightPen : m_mediumShadowPen); - dc.DrawLine(rect.x, rect.y, - rect.x + rect.width, rect.y); - dc.DrawLine(rect.x, rect.y + rect.height, - rect.x, rect.y); - -#endif - } - - DrawFieldText(dc, i); -} - - // Get the position and size of the field's internal bounding rectangle -bool wxStatusBarGeneric::GetFieldRect(int n, wxRect& rect) const -{ - wxCHECK_MSG( (n >= 0) && (n < m_nFields), false, - _T("invalid status bar field index") ); - - // FIXME: workarounds for OS/2 bugs have nothing to do here (VZ) - int width, height; -#ifdef __WXPM__ - GetSize(&width, &height); -#else - GetClientSize(&width, &height); -#endif - - // we cache m_widthsAbs between calls and recompute it if client - // width has changed (or when it is initially empty) - if ( m_widthsAbs.IsEmpty() || (m_lastClientWidth != width) ) - { - wxConstCast(this, wxStatusBarGeneric)-> - m_widthsAbs = CalculateAbsWidths(width); - // remember last width for which we have recomputed the widths in pixels - wxConstCast(this, wxStatusBarGeneric)-> - m_lastClientWidth = width; - } - - rect.x = 0; - for ( int i = 0; i < n; i++ ) - { - rect.x += m_widthsAbs[i]; - } - - rect.x += m_borderX; - rect.y = m_borderY; - - rect.width = m_widthsAbs[n] - 2*m_borderX; - rect.height = height - 2*m_borderY; - - return true; -} - -// Initialize colours -void wxStatusBarGeneric::InitColours() -{ -#if defined(__WXPM__) - m_mediumShadowPen = wxPen(wxColour(127, 127, 127), 1, wxSOLID); - m_hilightPen = *wxWHITE_PEN; - - SetBackgroundColour(*wxLIGHT_GREY); - SetForegroundColour(*wxBLACK); -#else // !__WXPM__ - m_mediumShadowPen = wxPen(wxSystemSettings::GetColour(wxSYS_COLOUR_3DSHADOW)); - m_hilightPen = wxPen(wxSystemSettings::GetColour(wxSYS_COLOUR_3DHILIGHT)); -#endif // __WXPM__/!__WXPM__ -} - -// Responds to colour changes, and passes event on to children. -void wxStatusBarGeneric::OnSysColourChanged(wxSysColourChangedEvent& event) -{ - InitColours(); - - // Propagate the event to the non-top-level children - wxWindow::OnSysColourChanged(event); -} - -void wxStatusBarGeneric::SetMinHeight(int height) -{ - // check that this min height is not less than minimal height for the - // current font - wxClientDC dc(this); - wxCoord y; - dc.GetTextExtent( wxT("X"), NULL, &y ); - - if ( height > (11*y)/10 ) - { - SetSize(wxDefaultCoord, wxDefaultCoord, wxDefaultCoord, height + 2*m_borderY); - } -} - -void wxStatusBarGeneric::OnLeftDown(wxMouseEvent& event) -{ -#ifdef __WXGTK20__ - int width, height; - GetClientSize(&width, &height); - - if (HasFlag( wxST_SIZEGRIP ) && (event.GetX() > width-height)) - { - GtkWidget *ancestor = gtk_widget_get_toplevel( m_widget ); - - if (!GTK_IS_WINDOW (ancestor)) - return; - - GdkWindow *source = GTK_PIZZA(m_wxwindow)->bin_window; - - int org_x = 0; - int org_y = 0; - gdk_window_get_origin( source, &org_x, &org_y ); - - if (GetLayoutDirection() == wxLayout_RightToLeft) - { - gtk_window_begin_resize_drag (GTK_WINDOW (ancestor), - GDK_WINDOW_EDGE_SOUTH_WEST, - 1, - org_x - event.GetX() + GetSize().x , - org_y + event.GetY(), - 0); - } - else - { - gtk_window_begin_resize_drag (GTK_WINDOW (ancestor), - GDK_WINDOW_EDGE_SOUTH_EAST, - 1, - org_x + event.GetX(), - org_y + event.GetY(), - 0); - } - } - else - { - event.Skip( true ); - } -#else - event.Skip( true ); -#endif -} - -void wxStatusBarGeneric::OnRightDown(wxMouseEvent& event) -{ -#ifdef __WXGTK20__ - int width, height; - GetClientSize(&width, &height); - - if (HasFlag( wxST_SIZEGRIP ) && (event.GetX() > width-height)) - { - GtkWidget *ancestor = gtk_widget_get_toplevel( m_widget ); - - if (!GTK_IS_WINDOW (ancestor)) - return; - - GdkWindow *source = GTK_PIZZA(m_wxwindow)->bin_window; - - int org_x = 0; - int org_y = 0; - gdk_window_get_origin( source, &org_x, &org_y ); - - gtk_window_begin_move_drag (GTK_WINDOW (ancestor), - 2, - org_x + event.GetX(), - org_y + event.GetY(), - 0); - } - else - { - event.Skip( true ); - } -#else - event.Skip( true ); -#endif -} - -#endif // wxUSE_STATUSBAR diff --git a/wxWidgets/src/generic/tabg.cpp b/wxWidgets/src/generic/tabg.cpp deleted file mode 100644 index 52ea16840f..0000000000 --- a/wxWidgets/src/generic/tabg.cpp +++ /dev/null @@ -1,1290 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/generic/tabg.cpp -// Purpose: Generic tabbed dialogs -// Author: Julian Smart -// Modified by: -// Created: 01/02/97 -// RCS-ID: $Id: tabg.cpp 39745 2006-06-15 17:58:49Z ABX $ -// Copyright: (c) -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_TAB_DIALOG - -#ifndef WX_PRECOMP - #include "wx/settings.h" - #include "wx/intl.h" - #include "wx/dcclient.h" - #include "wx/math.h" -#endif - -#include -#include -#include - -#include "wx/tab.h" -#include "wx/listimpl.cpp" - -WX_DEFINE_LIST(wxTabLayerList) - -// not defined: use old, square tab implementation (fills in tabs) -// defined: use new, rounded tab implementation (doesn't colour in tabs) -// #define wxUSE_NEW_METHOD - -IMPLEMENT_DYNAMIC_CLASS(wxTabControl, wxObject) - -// IMPLEMENT_DYNAMIC_CLASS(wxTabLayer, wxList) - -wxTabControl::wxTabControl(wxTabView *v) -{ - m_view = v; - m_isSelected = false; - m_offsetX = 0; - m_offsetY = 0; - m_width = 0; - m_height = 0; - m_id = 0; - m_rowPosition = 0; - m_colPosition = 0; -} - -wxTabControl::~wxTabControl(void) -{ -} - -void wxTabControl::OnDraw(wxDC& dc, bool lastInRow) -{ - // Old, but in some ways better (drawing opaque tabs) -#ifndef wxUSE_NEW_METHOD - if (!m_view) - return; - - // Top-left of tab view area - int viewX = m_view->GetViewRect().x; - int viewY = m_view->GetViewRect().y; - - // Top-left of tab control - int tabX = GetX() + viewX; - int tabY = GetY() + viewY; - int tabHeightInc = 0; - if (m_isSelected) - { - tabHeightInc = (m_view->GetTabSelectionHeight() - m_view->GetTabHeight()); - tabY -= tabHeightInc; - } - - dc.SetPen(*wxTRANSPARENT_PEN); - - // Draw grey background - if (m_view->GetTabStyle() & wxTAB_STYLE_COLOUR_INTERIOR) - { - dc.SetBrush(*m_view->GetBackgroundBrush()); - - // Add 1 because the pen is transparent. Under Motif, may be different. -#ifdef __WXMOTIF__ - dc.DrawRectangle(tabX, tabY, (GetWidth()+1), (GetHeight() + tabHeightInc)); -#else - dc.DrawRectangle(tabX, tabY, (GetWidth()+1), (GetHeight() + 1 + tabHeightInc)); -#endif - } - - // Draw highlight and shadow - dc.SetPen(*m_view->GetHighlightPen()); - - // Calculate the top of the tab beneath. It's the height of the tab, MINUS - // a bit if the tab below happens to be selected. Check. - wxTabControl *tabBeneath = NULL; - int subtractThis = 0; - if (GetColPosition() > 0) - tabBeneath = m_view->FindTabControlForPosition(GetColPosition() - 1, GetRowPosition()); - if (tabBeneath && tabBeneath->IsSelected()) - subtractThis = (m_view->GetTabSelectionHeight() - m_view->GetTabHeight()); - - // Vertical highlight: if first tab, draw to bottom of view - if (tabX == m_view->GetViewRect().x && (m_view->GetTabStyle() & wxTAB_STYLE_DRAW_BOX)) - dc.DrawLine(tabX, tabY, tabX, (m_view->GetViewRect().y + m_view->GetViewRect().height)); - else if (tabX == m_view->GetViewRect().x) - // Not box drawing, just to top of view. - dc.DrawLine(tabX, tabY, tabX, (m_view->GetViewRect().y)); - else - dc.DrawLine(tabX, tabY, tabX, (tabY + GetHeight() + tabHeightInc - subtractThis)); - - dc.DrawLine(tabX, tabY, (tabX + GetWidth()), tabY); - dc.SetPen(*m_view->GetShadowPen()); - - // Test if we're outside the right-hand edge of the view area - if (((tabX + GetWidth()) >= m_view->GetViewRect().x + m_view->GetViewRect().width) && (m_view->GetTabStyle() & wxTAB_STYLE_DRAW_BOX)) - { - int bottomY = m_view->GetViewRect().y + m_view->GetViewRect().height + GetY() + m_view->GetTabHeight() + m_view->GetTopMargin(); - // Add a tab height since we wish to draw to the bottom of the view. - dc.DrawLine((tabX + GetWidth()), tabY, - (tabX + GetWidth()), bottomY); - - // Calculate the far-right of the view, since we don't wish to - // draw inside that - int rightOfView = m_view->GetViewRect().x + m_view->GetViewRect().width + 1; - - // Draw the horizontal bit to connect to the view rectangle - dc.DrawLine((wxMax((tabX + GetWidth() - m_view->GetHorizontalTabOffset()), rightOfView)), (bottomY-1), - (tabX + GetWidth()), (bottomY-1)); - - // Draw black line to emphasize shadow - dc.SetPen(*wxBLACK_PEN); - dc.DrawLine((tabX + GetWidth() + 1), (tabY+1), - (tabX + GetWidth() + 1), bottomY); - - // Draw the horizontal bit to connect to the view rectangle - dc.DrawLine((wxMax((tabX + GetWidth() - m_view->GetHorizontalTabOffset()), rightOfView)), (bottomY), - (tabX + GetWidth() + 1), (bottomY)); - } - else - { - if (lastInRow) - { - // 25/5/97 UNLESS it's less than the max number of positions in this row - - int topY = m_view->GetViewRect().y - m_view->GetTopMargin(); - - int maxPositions = ((wxTabLayer *)m_view->GetLayers().Item(0)->GetData())->GetCount(); - - // Only down to the bottom of the tab, not to the top of the view - if ( GetRowPosition() < (maxPositions - 1) ) - topY = tabY + GetHeight() + tabHeightInc; - -#ifdef __WXMOTIF__ - topY -= 1; -#endif - - // Shadow - dc.DrawLine((tabX + GetWidth()), tabY, (tabX + GetWidth()), topY); - // Draw black line to emphasize shadow - dc.SetPen(*wxBLACK_PEN); - dc.DrawLine((tabX + GetWidth() + 1), (tabY+1), (tabX + GetWidth() + 1), - topY); - } - else - { - // Calculate the top of the tab beneath. It's the height of the tab, MINUS - // a bit if the tab below (and next col along) happens to be selected. Check. - wxTabControl *tabBeneath = NULL; - int subtractThis = 0; - if (GetColPosition() > 0) - tabBeneath = m_view->FindTabControlForPosition(GetColPosition() - 1, GetRowPosition() + 1); - if (tabBeneath && tabBeneath->IsSelected()) - subtractThis = (m_view->GetTabSelectionHeight() - m_view->GetTabHeight()); - -#ifdef __WXMOTIF__ - subtractThis += 1; -#endif - - // Draw only to next tab down. - dc.DrawLine((tabX + GetWidth()), tabY, - (tabX + GetWidth()), (tabY + GetHeight() + tabHeightInc - subtractThis)); - - // Draw black line to emphasize shadow - dc.SetPen(*wxBLACK_PEN); - dc.DrawLine((tabX + GetWidth() + 1), (tabY+1), (tabX + GetWidth() + 1), - (tabY + GetHeight() + tabHeightInc - subtractThis)); - } - } - - // Draw centered text - int textY = tabY + m_view->GetVerticalTabTextSpacing() + tabHeightInc; - - if (m_isSelected) - dc.SetFont(* m_view->GetSelectedTabFont()); - else - dc.SetFont(* GetFont()); - - wxColour col(m_view->GetTextColour()); - dc.SetTextForeground(col); - dc.SetBackgroundMode(wxTRANSPARENT); - long textWidth, textHeight; - dc.GetTextExtent(GetLabel(), &textWidth, &textHeight); - - int textX = (int)(tabX + (GetWidth() - textWidth)/2.0); - if (textX < (tabX + 2)) - textX = (tabX + 2); - - dc.SetClippingRegion(tabX, tabY, GetWidth(), GetHeight()); - dc.DrawText(GetLabel(), textX, textY); - dc.DestroyClippingRegion(); - - if (m_isSelected) - { - dc.SetPen(*m_view->GetHighlightPen()); - - // Draw white highlight from the tab's left side to the left hand edge of the view - dc.DrawLine(m_view->GetViewRect().x, (tabY + GetHeight() + tabHeightInc), - tabX, (tabY + GetHeight() + tabHeightInc)); - - // Draw white highlight from the tab's right side to the right hand edge of the view - dc.DrawLine((tabX + GetWidth()), (tabY + GetHeight() + tabHeightInc), - m_view->GetViewRect().x + m_view->GetViewRect().width, (tabY + GetHeight() + tabHeightInc)); - } -#else - // New HEL version with rounder tabs - - if (!m_view) return; - - int tabInc = 0; - if (m_isSelected) - { - tabInc = m_view->GetTabSelectionHeight() - m_view->GetTabHeight(); - } - int tabLeft = GetX() + m_view->GetViewRect().x; - int tabTop = GetY() + m_view->GetViewRect().y - tabInc; - int tabRight = tabLeft + m_view->GetTabWidth(); - int left = m_view->GetViewRect().x; - int top = tabTop + m_view->GetTabHeight() + tabInc; - int right = left + m_view->GetViewRect().width; - int bottom = top + m_view->GetViewRect().height; - - if (m_isSelected) - { - // TAB is selected - draw TAB and the View's full outline - - dc.SetPen(*(m_view->GetHighlightPen())); - wxPoint pnts[10]; - int n = 0; - pnts[n].x = left; pnts[n++].y = bottom; - pnts[n].x = left; pnts[n++].y = top; - pnts[n].x = tabLeft; pnts[n++].y = top; - pnts[n].x = tabLeft; pnts[n++].y = tabTop + 2; - pnts[n].x = tabLeft + 2; pnts[n++].y = tabTop; - pnts[n].x = tabRight - 1; pnts[n++].y = tabTop; - dc.DrawLines(n, pnts); - if (!lastInRow) - { - dc.DrawLine( - (tabRight + 2), - top, - right, - top - ); - } - - dc.SetPen(*(m_view->GetShadowPen())); - dc.DrawLine( - tabRight, - tabTop + 2, - tabRight, - top - ); - dc.DrawLine( - right, - top, - right, - bottom - ); - dc.DrawLine( - right, - bottom, - left, - bottom - ); - - dc.SetPen(*wxBLACK_PEN); - dc.DrawPoint( - tabRight, - tabTop + 1 - ); - dc.DrawPoint( - tabRight + 1, - tabTop + 2 - ); - if (lastInRow) - { - dc.DrawLine( - tabRight + 1, - bottom, - tabRight + 1, - tabTop + 1 - ); - } - else - { - dc.DrawLine( - tabRight + 1, - tabTop + 2, - tabRight + 1, - top - ); - dc.DrawLine( - right + 1, - top, - right + 1, - bottom + 1 - ); - } - dc.DrawLine( - right + 1, - bottom + 1, - left + 1, - bottom + 1 - ); - } - else - { - // TAB is not selected - just draw TAB outline and RH edge - // if the TAB is the last in the row - - int maxPositions = ((wxTabLayer*)m_view->GetLayers().Item(0)->GetData())->GetCount(); - wxTabControl* tabBelow = 0; - wxTabControl* tabBelowRight = 0; - if (GetColPosition() > 0) - { - tabBelow = m_view->FindTabControlForPosition( - GetColPosition() - 1, - GetRowPosition() - ); - } - if (!lastInRow && GetColPosition() > 0) - { - tabBelowRight = m_view->FindTabControlForPosition( - GetColPosition() - 1, - GetRowPosition() + 1 - ); - } - - float raisedTop = top - m_view->GetTabSelectionHeight() + - m_view->GetTabHeight(); - - dc.SetPen(*(m_view->GetHighlightPen())); - wxPoint pnts[10]; - int n = 0; - - pnts[n].x = tabLeft; - - if (tabBelow && tabBelow->IsSelected()) - { - pnts[n++].y = (long)raisedTop; - } - else - { - pnts[n++].y = top; - } - pnts[n].x = tabLeft; pnts[n++].y = tabTop + 2; - pnts[n].x = tabLeft + 2; pnts[n++].y = tabTop; - pnts[n].x = tabRight - 1; pnts[n++].y = tabTop; - dc.DrawLines(n, pnts); - - dc.SetPen(*(m_view->GetShadowPen())); - if (GetRowPosition() >= maxPositions - 1) - { - dc.DrawLine( - tabRight, - (tabTop + 2), - tabRight, - bottom - ); - dc.DrawLine( - tabRight, - bottom, - (tabRight - m_view->GetHorizontalTabOffset()), - bottom - ); - } - else - { - if (tabBelowRight && tabBelowRight->IsSelected()) - { - dc.DrawLine( - tabRight, - (long)raisedTop, - tabRight, - tabTop + 1 - ); - } - else - { - dc.DrawLine( - tabRight, - top - 1, - tabRight, - tabTop + 1 - ); - } - } - - dc.SetPen(*wxBLACK_PEN); - dc.DrawPoint( - tabRight, - tabTop + 1 - ); - dc.DrawPoint( - tabRight + 1, - tabTop + 2 - ); - if (GetRowPosition() >= maxPositions - 1) - { - // draw right hand edge to bottom of view - dc.DrawLine( - tabRight + 1, - bottom + 1, - tabRight + 1, - tabTop + 2 - ); - dc.DrawLine( - tabRight + 1, - bottom + 1, - (tabRight - m_view->GetHorizontalTabOffset()), - bottom + 1 - ); - } - else - { - // draw right hand edge of TAB - if (tabBelowRight && tabBelowRight->IsSelected()) - { - dc.DrawLine( - tabRight + 1, - (long)(raisedTop - 1), - tabRight + 1, - tabTop + 2 - ); - } - else - { - dc.DrawLine( - tabRight + 1, - top - 1, - tabRight + 1, - tabTop + 2 - ); - } - } - } - - // Draw centered text - dc.SetPen(*wxBLACK_PEN); - if (m_isSelected) - { - dc.SetFont(*(m_view->GetSelectedTabFont())); - } - else - { - dc.SetFont(*(GetFont())); - } - - wxColour col(m_view->GetTextColour()); - dc.SetTextForeground(col); - dc.SetBackgroundMode(wxTRANSPARENT); - long textWidth, textHeight; - dc.GetTextExtent(GetLabel(), &textWidth, &textHeight); - - float textX = (tabLeft + tabRight - textWidth) / 2; - float textY = (tabInc + tabTop + m_view->GetVerticalTabTextSpacing()); - - dc.DrawText(GetLabel(), (long)textX, (long)textY); -#endif -} - -bool wxTabControl::HitTest(int x, int y) const -{ - // Top-left of tab control - int tabX1 = GetX() + m_view->GetViewRect().x; - int tabY1 = GetY() + m_view->GetViewRect().y; - - // Bottom-right - int tabX2 = tabX1 + GetWidth(); - int tabY2 = tabY1 + GetHeight(); - - if (x >= tabX1 && y >= tabY1 && x <= tabX2 && y <= tabY2) - return true; - else - return false; -} - -IMPLEMENT_DYNAMIC_CLASS(wxTabView, wxObject) - -wxTabView::wxTabView(long style) -{ - m_noTabs = 0; - m_tabStyle = style; - m_tabSelection = -1; - m_tabHeight = 20; - m_tabSelectionHeight = m_tabHeight + 2; - m_tabWidth = 80; - m_tabHorizontalOffset = 10; - m_tabHorizontalSpacing = 2; - m_tabVerticalTextSpacing = 3; - m_topMargin = 5; - m_tabViewRect.x = 20; - m_tabViewRect.y = 20; - m_tabViewRect.width = 300; - m_tabViewRect.x = 300; - m_highlightColour = *wxWHITE; - m_shadowColour = wxColour(128, 128, 128); - m_backgroundColour = wxSystemSettings::GetColour(wxSYS_COLOUR_BTNFACE); - m_textColour = *wxBLACK; - m_highlightPen = wxWHITE_PEN; - m_shadowPen = wxGREY_PEN; - SetBackgroundColour(m_backgroundColour); - m_tabFont = wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT); - m_tabSelectedFont = wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT); - m_window = (wxWindow *) NULL; -} - -wxTabView::~wxTabView() -{ - ClearTabs(true); -} - -// Automatically positions tabs -// TODO: this should just add the tab to a list, and then -// a layout function (e.g. Realize) should be called when all tabs have been added. -// The view rect could easily change as the view window is resized. -wxTabControl *wxTabView::AddTab(int id, const wxString& label, wxTabControl *existingTab) -{ - // First, find which layer we should be adding to. - wxTabLayerList::compatibility_iterator node = m_layers.GetLast(); - if (!node) - { - wxTabLayer *newLayer = new wxTabLayer; - node = m_layers.Append(newLayer); - } - // Check if adding another tab control would go off the - // right-hand edge of the layer. - wxTabLayer *tabLayer = (wxTabLayer *)node->GetData(); - wxList::compatibility_iterator lastTabNode = tabLayer->GetLast(); - if (lastTabNode) - { - wxTabControl *lastTab = (wxTabControl *)lastTabNode->GetData(); - // Start another layer (row). - // Tricky choice: can't just check if will be overlapping the edge, because - // this happens anyway for 2nd and subsequent rows. - // Should check this for 1st row, and then subsequent rows should not exceed 1st - // in length. - if (((tabLayer == m_layers.GetFirst()->GetData()) && ((lastTab->GetX() + 2*lastTab->GetWidth() + GetHorizontalTabSpacing()) - > GetViewRect().width)) || - ((tabLayer != m_layers.GetFirst()->GetData()) && (tabLayer->GetCount() == ((wxTabLayer *)m_layers.GetFirst()->GetData())->GetCount()))) - { - tabLayer = new wxTabLayer; - m_layers.Append(tabLayer); - lastTabNode = wxList::compatibility_iterator(); - } - } - int layer = m_layers.GetCount() - 1; - - wxTabControl *tabControl = existingTab; - if (!existingTab) - tabControl = OnCreateTabControl(); - tabControl->SetRowPosition(tabLayer->GetCount()); - tabControl->SetColPosition(layer); - - wxTabControl *lastTab = (wxTabControl *) NULL; - if (lastTabNode) - lastTab = (wxTabControl *)lastTabNode->GetData(); - - // Top of new tab - int verticalOffset = (- GetTopMargin()) - ((layer+1)*GetTabHeight()); - // Offset from view top-left - int horizontalOffset = 0; - if (!lastTab) - horizontalOffset = layer*GetHorizontalTabOffset(); - else - horizontalOffset = lastTab->GetX() + GetTabWidth() + GetHorizontalTabSpacing(); - - tabControl->SetPosition(horizontalOffset, verticalOffset); - tabControl->SetSize(GetTabWidth(), GetTabHeight()); - tabControl->SetId(id); - tabControl->SetLabel(label); - tabControl->SetFont(* GetTabFont()); - - tabLayer->Append(tabControl); - m_noTabs ++; - - return tabControl; -} - -// Remove the tab without deleting the window -bool wxTabView::RemoveTab(int id) -{ - wxTabLayerList::compatibility_iterator layerNode = m_layers.GetFirst(); - while (layerNode) - { - wxTabLayer *layer = (wxTabLayer *)layerNode->GetData(); - wxList::compatibility_iterator tabNode = layer->GetFirst(); - while (tabNode) - { - wxTabControl *tab = (wxTabControl *)tabNode->GetData(); - if (tab->GetId() == id) - { - if (id == m_tabSelection) - m_tabSelection = -1; - delete tab; - layer->Erase(tabNode); - m_noTabs --; - - // The layout has changed - LayoutTabs(); - return true; - } - tabNode = tabNode->GetNext(); - } - layerNode = layerNode->GetNext(); - } - return false; -} - -bool wxTabView::SetTabText(int id, const wxString& label) -{ - wxTabControl* control = FindTabControlForId(id); - if (!control) - return false; - control->SetLabel(label); - return true; -} - -wxString wxTabView::GetTabText(int id) const -{ - wxTabControl* control = FindTabControlForId(id); - if (!control) - return wxEmptyString; - else - return control->GetLabel(); -} - -// Returns the total height of the tabs component -- this may be several -// times the height of a tab, if there are several tab layers (rows). -int wxTabView::GetTotalTabHeight() -{ - int minY = 0; - - wxTabLayerList::compatibility_iterator layerNode = m_layers.GetFirst(); - while (layerNode) - { - wxTabLayer *layer = (wxTabLayer *)layerNode->GetData(); - wxList::compatibility_iterator tabNode = layer->GetFirst(); - while (tabNode) - { - wxTabControl *tab = (wxTabControl *)tabNode->GetData(); - - if (tab->GetY() < minY) - minY = tab->GetY(); - - tabNode = tabNode->GetNext(); - } - layerNode = layerNode->GetNext(); - } - - return - minY; -} - -void wxTabView::ClearTabs(bool deleteTabs) -{ - wxTabLayerList::compatibility_iterator layerNode = m_layers.GetFirst(); - while (layerNode) - { - wxTabLayer *layer = (wxTabLayer *)layerNode->GetData(); - wxList::compatibility_iterator tabNode = layer->GetFirst(); - while (tabNode) - { - wxTabControl *tab = (wxTabControl *)tabNode->GetData(); - if (deleteTabs) - delete tab; - wxList::compatibility_iterator next = tabNode->GetNext(); - layer->Erase(tabNode); - tabNode = next; - } - wxTabLayerList::compatibility_iterator nextLayerNode = layerNode->GetNext(); - delete layer; - m_layers.Erase(layerNode); - layerNode = nextLayerNode; - } - m_noTabs = 0; - m_tabSelection = -1; -} - - -// Layout tabs (optional, e.g. if resizing window) -void wxTabView::LayoutTabs(void) -{ - // Make a list of the tab controls, deleting the wxTabLayers. - wxList controls; - - wxTabLayerList::compatibility_iterator layerNode = m_layers.GetFirst(); - while (layerNode) - { - wxTabLayer *layer = (wxTabLayer *)layerNode->GetData(); - wxList::compatibility_iterator tabNode = layer->GetFirst(); - while (tabNode) - { - wxTabControl *tab = (wxTabControl *)tabNode->GetData(); - controls.Append(tab); - wxList::compatibility_iterator next = tabNode->GetNext(); - layer->Erase(tabNode); - tabNode = next; - } - wxTabLayerList::compatibility_iterator nextLayerNode = layerNode->GetNext(); - delete layer; - m_layers.Erase(layerNode); - layerNode = nextLayerNode; - } - - wxTabControl *lastTab = (wxTabControl *) NULL; - - wxTabLayer *currentLayer = new wxTabLayer; - m_layers.Append(currentLayer); - - wxList::compatibility_iterator node = controls.GetFirst(); - while (node) - { - wxTabControl *tabControl = (wxTabControl *)node->GetData(); - if (lastTab) - { - // Start another layer (row). - // Tricky choice: can't just check if will be overlapping the edge, because - // this happens anyway for 2nd and subsequent rows. - // Should check this for 1st row, and then subsequent rows should not exceed 1st - // in length. - if (((currentLayer == m_layers.GetFirst()->GetData()) && ((lastTab->GetX() + 2*lastTab->GetWidth() + GetHorizontalTabSpacing()) - > GetViewRect().width)) || - ((currentLayer != m_layers.GetFirst()->GetData()) && (currentLayer->GetCount() == ((wxTabLayer *)m_layers.GetFirst()->GetData())->GetCount()))) - { - currentLayer = new wxTabLayer; - m_layers.Append(currentLayer); - lastTab = (wxTabControl *) NULL; - } - } - - int layer = m_layers.GetCount() - 1; - - tabControl->SetRowPosition(currentLayer->GetCount()); - tabControl->SetColPosition(layer); - - // Top of new tab - int verticalOffset = (- GetTopMargin()) - ((layer+1)*GetTabHeight()); - // Offset from view top-left - int horizontalOffset = 0; - if (!lastTab) - horizontalOffset = layer*GetHorizontalTabOffset(); - else - horizontalOffset = lastTab->GetX() + GetTabWidth() + GetHorizontalTabSpacing(); - - tabControl->SetPosition(horizontalOffset, verticalOffset); - tabControl->SetSize(GetTabWidth(), GetTabHeight()); - - currentLayer->Append(tabControl); - lastTab = tabControl; - - node = node->GetNext(); - } - - // Move the selected tab to the bottom - wxTabControl *control = FindTabControlForId(m_tabSelection); - if (control) - MoveSelectionTab(control); - -} - -// Draw all tabs -void wxTabView::Draw(wxDC& dc) -{ - // Don't draw anything if there are no tabs. - if (GetNumberOfTabs() == 0) - return; - - // Draw top margin area (beneath tabs and above view area) - if (GetTabStyle() & wxTAB_STYLE_COLOUR_INTERIOR) - { - dc.SetPen(*wxTRANSPARENT_PEN); - dc.SetBrush(*GetBackgroundBrush()); - - // Add 1 because the pen is transparent. Under Motif, may be different. - dc.DrawRectangle( - m_tabViewRect.x, - (m_tabViewRect.y - m_topMargin), - (m_tabViewRect.width + 1), - (m_topMargin + 1) - ); - } - - // Draw layers in reverse order - wxTabLayerList::compatibility_iterator node = m_layers.GetLast(); - while (node) - { - wxTabLayer *layer = (wxTabLayer *)node->GetData(); - wxList::compatibility_iterator node2 = layer->GetFirst(); - while (node2) - { - wxTabControl *control = (wxTabControl *)node2->GetData(); - control->OnDraw(dc, (!node2->GetNext())); - node2 = node2->GetNext(); - } - - node = node->GetPrevious(); - } - - -#ifndef wxUSE_NEW_METHOD - if (GetTabStyle() & wxTAB_STYLE_DRAW_BOX) - { - dc.SetPen(* GetShadowPen()); - - // Draw bottom line - dc.DrawLine( - (GetViewRect().x + 1), - (GetViewRect().y + GetViewRect().height), - (GetViewRect().x + GetViewRect().width + 1), - (GetViewRect().y + GetViewRect().height) - ); - - // Draw right line - dc.DrawLine( - (GetViewRect().x + GetViewRect().width), - (GetViewRect().y - GetTopMargin() + 1), - (GetViewRect().x + GetViewRect().width), - (GetViewRect().y + GetViewRect().height) - ); - - dc.SetPen(* wxBLACK_PEN); - - // Draw bottom line - dc.DrawLine( - (GetViewRect().x), - (GetViewRect().y + GetViewRect().height + 1), -#if defined(__WXMOTIF__) - (GetViewRect().x + GetViewRect().width + 1), -#else - (GetViewRect().x + GetViewRect().width + 2), -#endif - - (GetViewRect().y + GetViewRect().height + 1) - ); - - // Draw right line - dc.DrawLine( - (GetViewRect().x + GetViewRect().width + 1), - (GetViewRect().y - GetTopMargin()), - (GetViewRect().x + GetViewRect().width + 1), - (GetViewRect().y + GetViewRect().height + 1) - ); - } -#endif -} - -// Process mouse event, return false if we didn't process it -bool wxTabView::OnEvent(wxMouseEvent& event) -{ - if (!event.LeftDown()) - return false; - - wxCoord x, y; - event.GetPosition(&x, &y); - - wxTabControl *hitControl = (wxTabControl *) NULL; - - wxTabLayerList::compatibility_iterator node = m_layers.GetFirst(); - while (node) - { - wxTabLayer *layer = (wxTabLayer *)node->GetData(); - wxList::compatibility_iterator node2 = layer->GetFirst(); - while (node2) - { - wxTabControl *control = (wxTabControl *)node2->GetData(); - if (control->HitTest((int)x, (int)y)) - { - hitControl = control; - node = wxTabLayerList::compatibility_iterator(); - node2 = wxList::compatibility_iterator(); - } - else - node2 = node2->GetNext(); - } - - if (node) - node = node->GetNext(); - } - - if (!hitControl) - return false; - - wxTabControl *currentTab = FindTabControlForId(m_tabSelection); - - if (hitControl == currentTab) - return false; - - ChangeTab(hitControl); - - return true; -} - -bool wxTabView::ChangeTab(wxTabControl *control) -{ - wxTabControl *currentTab = FindTabControlForId(m_tabSelection); - int oldTab = -1; - if (currentTab) - oldTab = currentTab->GetId(); - - if (control == currentTab) - return true; - - if (m_layers.GetCount() == 0) - return false; - - if (!OnTabPreActivate(control->GetId(), oldTab)) - return false; - - // Move the tab to the bottom - MoveSelectionTab(control); - - if (currentTab) - currentTab->SetSelected(false); - - control->SetSelected(true); - m_tabSelection = control->GetId(); - - OnTabActivate(control->GetId(), oldTab); - - // Leave window refresh for the implementing window - - return true; -} - -// Move the selected tab to the bottom layer, if necessary, -// without calling app activation code -bool wxTabView::MoveSelectionTab(wxTabControl *control) -{ - if (m_layers.GetCount() == 0) - return false; - - wxTabLayer *firstLayer = (wxTabLayer *)m_layers.GetFirst()->GetData(); - - // Find what column this tab is at, so we can swap with the one at the bottom. - // If we're on the bottom layer, then no need to swap. - if (!firstLayer->Member(control)) - { - // Do a swap - int col = 0; - wxList::compatibility_iterator thisNode = FindTabNodeAndColumn(control, &col); - if (!thisNode) - return false; - wxList::compatibility_iterator otherNode = firstLayer->Item(col); - if (!otherNode) - return false; - - // If this is already in the bottom layer, return now - if (otherNode == thisNode) - return true; - - wxTabControl *otherTab = (wxTabControl *)otherNode->GetData(); - - // We now have pointers to the tab to be changed to, - // and the tab on the first layer. Swap tab structures and - // position details. - - int thisX = control->GetX(); - int thisY = control->GetY(); - int thisColPos = control->GetColPosition(); - int otherX = otherTab->GetX(); - int otherY = otherTab->GetY(); - int otherColPos = otherTab->GetColPosition(); - - control->SetPosition(otherX, otherY); - control->SetColPosition(otherColPos); - otherTab->SetPosition(thisX, thisY); - otherTab->SetColPosition(thisColPos); - - // Swap the data for the nodes - thisNode->SetData(otherTab); - otherNode->SetData(control); - } - return true; -} - -// Called when a tab is activated -void wxTabView::OnTabActivate(int /*activateId*/, int /*deactivateId*/) -{ -} - -void wxTabView::SetHighlightColour(const wxColour& col) -{ - m_highlightColour = col; - m_highlightPen = wxThePenList->FindOrCreatePen(col, 1, wxSOLID); -} - -void wxTabView::SetShadowColour(const wxColour& col) -{ - m_shadowColour = col; - m_shadowPen = wxThePenList->FindOrCreatePen(col, 1, wxSOLID); -} - -void wxTabView::SetBackgroundColour(const wxColour& col) -{ - m_backgroundColour = col; - m_backgroundPen = wxThePenList->FindOrCreatePen(col, 1, wxSOLID); - m_backgroundBrush = wxTheBrushList->FindOrCreateBrush(col, wxSOLID); -} - -// this may be called with sel = zero (which doesn't match any page) -// when wxMotif deletes a page -// so return the first tab... - -void wxTabView::SetTabSelection(int sel, bool activateTool) -{ - if ( sel==m_tabSelection ) - return; - - int oldSel = m_tabSelection; - wxTabControl *control = FindTabControlForId(sel); - if (sel == 0) sel=control->GetId(); - wxTabControl *oldControl = FindTabControlForId(m_tabSelection); - - if (!OnTabPreActivate(sel, oldSel)) - return; - - if (control) - control->SetSelected((sel != -1)); // TODO ?? - else if (sel != -1) - { - wxFAIL_MSG(_("Could not find tab for id")); - return; - } - - if (oldControl) - oldControl->SetSelected(false); - - m_tabSelection = sel; - - if (control) - MoveSelectionTab(control); - - if (activateTool) - OnTabActivate(sel, oldSel); -} - -// Find tab control for id -// this may be called with zero (which doesn't match any page) -// so return the first control... -wxTabControl *wxTabView::FindTabControlForId(int id) const -{ - wxTabLayerList::compatibility_iterator node1 = m_layers.GetFirst(); - while (node1) - { - wxTabLayer *layer = (wxTabLayer *)node1->GetData(); - wxList::compatibility_iterator node2 = layer->GetFirst(); - while (node2) - { - wxTabControl *control = (wxTabControl *)node2->GetData(); - if (control->GetId() == id || id == 0) - return control; - node2 = node2->GetNext(); - } - node1 = node1->GetNext(); - } - return (wxTabControl *) NULL; -} - -// Find tab control for layer, position (starting from zero) -wxTabControl *wxTabView::FindTabControlForPosition(int layer, int position) const -{ - wxTabLayerList::compatibility_iterator node1 = m_layers.Item(layer); - if (!node1) - return (wxTabControl *) NULL; - wxTabLayer *tabLayer = (wxTabLayer *)node1->GetData(); - wxList::compatibility_iterator node2 = tabLayer->Item(position); - if (!node2) - return (wxTabControl *) NULL; - return (wxTabControl *)node2->GetData(); -} - -// Find the node and the column at which this control is positioned. -wxList::compatibility_iterator wxTabView::FindTabNodeAndColumn(wxTabControl *control, int *col) const -{ - wxTabLayerList::compatibility_iterator node1 = m_layers.GetFirst(); - while (node1) - { - wxTabLayer *layer = (wxTabLayer *)node1->GetData(); - int c = 0; - wxList::compatibility_iterator node2 = layer->GetFirst(); - while (node2) - { - wxTabControl *cnt = (wxTabControl *)node2->GetData(); - if (cnt == control) - { - *col = c; - return node2; - } - node2 = node2->GetNext(); - c ++; - } - node1 = node1->GetNext(); - } - return wxList::compatibility_iterator(); -} - -int wxTabView::CalculateTabWidth(int noTabs, bool adjustView) -{ - m_tabWidth = (int)((m_tabViewRect.width - ((noTabs - 1)*GetHorizontalTabSpacing()))/noTabs); - if (adjustView) - { - m_tabViewRect.width = noTabs*m_tabWidth + ((noTabs-1)*GetHorizontalTabSpacing()); - } - return m_tabWidth; -} - -/* - * wxTabbedDialog - */ - -IMPLEMENT_CLASS(wxTabbedDialog, wxDialog) - -BEGIN_EVENT_TABLE(wxTabbedDialog, wxDialog) - EVT_CLOSE(wxTabbedDialog::OnCloseWindow) - EVT_MOUSE_EVENTS(wxTabbedDialog::OnMouseEvent) - EVT_PAINT(wxTabbedDialog::OnPaint) -END_EVENT_TABLE() - -wxTabbedDialog::wxTabbedDialog(wxWindow *parent, wxWindowID id, - const wxString& title, - const wxPoint& pos, const wxSize& size, - long windowStyle, const wxString& name): - wxDialog(parent, id, title, pos, size, windowStyle, name) -{ - m_tabView = (wxTabView *) NULL; -} - -wxTabbedDialog::~wxTabbedDialog(void) -{ - if (m_tabView) - delete m_tabView; -} - -void wxTabbedDialog::OnCloseWindow(wxCloseEvent& WXUNUSED(event) ) -{ - Destroy(); -} - -void wxTabbedDialog::OnMouseEvent(wxMouseEvent& event ) -{ - if (m_tabView) - m_tabView->OnEvent(event); -} - -void wxTabbedDialog::OnPaint(wxPaintEvent& WXUNUSED(event) ) -{ - wxPaintDC dc(this); - if (m_tabView) - m_tabView->Draw(dc); -} - -/* - * wxTabbedPanel - */ - -IMPLEMENT_CLASS(wxTabbedPanel, wxPanel) - -BEGIN_EVENT_TABLE(wxTabbedPanel, wxPanel) - EVT_MOUSE_EVENTS(wxTabbedPanel::OnMouseEvent) - EVT_PAINT(wxTabbedPanel::OnPaint) -END_EVENT_TABLE() - -wxTabbedPanel::wxTabbedPanel(wxWindow *parent, wxWindowID id, const wxPoint& pos, - const wxSize& size, long windowStyle, const wxString& name): - wxPanel(parent, id, pos, size, windowStyle, name) -{ - m_tabView = (wxTabView *) NULL; -} - -wxTabbedPanel::~wxTabbedPanel(void) -{ - delete m_tabView; -} - -void wxTabbedPanel::OnMouseEvent(wxMouseEvent& event) -{ - if (m_tabView) - m_tabView->OnEvent(event); -} - -void wxTabbedPanel::OnPaint(wxPaintEvent& WXUNUSED(event) ) -{ - wxPaintDC dc(this); - if (m_tabView) - m_tabView->Draw(dc); -} - -/* - * wxPanelTabView - */ - -IMPLEMENT_CLASS(wxPanelTabView, wxTabView) - -wxPanelTabView::wxPanelTabView(wxPanel *pan, long style) - : wxTabView(style) -{ - m_panel = pan; - m_currentWindow = (wxWindow *) NULL; - - if (m_panel->IsKindOf(CLASSINFO(wxTabbedDialog))) - ((wxTabbedDialog *)m_panel)->SetTabView(this); - else if (m_panel->IsKindOf(CLASSINFO(wxTabbedPanel))) - ((wxTabbedPanel *)m_panel)->SetTabView(this); - - SetWindow(m_panel); -} - -wxPanelTabView::~wxPanelTabView(void) -{ - ClearWindows(true); -} - -// Called when a tab is activated -void wxPanelTabView::OnTabActivate(int activateId, int deactivateId) -{ - if (!m_panel) - return; - - wxWindow *oldWindow = ((deactivateId == -1) ? 0 : GetTabWindow(deactivateId)); - wxWindow *newWindow = GetTabWindow(activateId); - - if (oldWindow) - oldWindow->Show(false); - if (newWindow) - newWindow->Show(true); - - m_panel->Refresh(); -} - - -void wxPanelTabView::AddTabWindow(int id, wxWindow *window) -{ - wxASSERT(m_tabWindows.find(id) == m_tabWindows.end()); - m_tabWindows[id] = window; - window->Show(false); -} - -wxWindow *wxPanelTabView::GetTabWindow(int id) const -{ - wxIntToWindowHashMap::const_iterator it = m_tabWindows.find(id); - return it == m_tabWindows.end() ? NULL : it->second; -} - -void wxPanelTabView::ClearWindows(bool deleteWindows) -{ - if (deleteWindows) - WX_CLEAR_HASH_MAP(wxIntToWindowHashMap, m_tabWindows); - m_tabWindows.clear(); -} - -void wxPanelTabView::ShowWindowForTab(int id) -{ - wxWindow *newWindow = GetTabWindow(id); - if (newWindow == m_currentWindow) - return; - if (m_currentWindow) - m_currentWindow->Show(false); - newWindow->Show(true); - newWindow->Refresh(); -} - -#endif // wxUSE_TAB_DIALOG diff --git a/wxWidgets/src/generic/textdlgg.cpp b/wxWidgets/src/generic/textdlgg.cpp deleted file mode 100644 index c4de4b03d5..0000000000 --- a/wxWidgets/src/generic/textdlgg.cpp +++ /dev/null @@ -1,185 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/generic/textdlgg.cpp -// Purpose: wxTextEntryDialog -// Author: Julian Smart -// Modified by: -// Created: 04/01/98 -// RCS-ID: $Id: textdlgg.cpp 41838 2006-10-09 21:08:45Z VZ $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_TEXTDLG - -#include "wx/generic/textdlgg.h" - -#ifndef WX_PRECOMP - #include "wx/utils.h" - #include "wx/dialog.h" - #include "wx/button.h" - #include "wx/stattext.h" - #include "wx/textctrl.h" - #include "wx/intl.h" - #include "wx/sizer.h" -#endif - -#if wxUSE_STATLINE - #include "wx/statline.h" -#endif - -const wxChar wxGetTextFromUserPromptStr[] = wxT("Input Text"); -const wxChar wxGetPasswordFromUserPromptStr[] = wxT("Enter Password"); - -// ---------------------------------------------------------------------------- -// constants -// ---------------------------------------------------------------------------- - -static const int wxID_TEXT = 3000; - -// ============================================================================ -// implementation -// ============================================================================ - -// ---------------------------------------------------------------------------- -// wxTextEntryDialog -// ---------------------------------------------------------------------------- - -BEGIN_EVENT_TABLE(wxTextEntryDialog, wxDialog) - EVT_BUTTON(wxID_OK, wxTextEntryDialog::OnOK) -END_EVENT_TABLE() - -IMPLEMENT_CLASS(wxTextEntryDialog, wxDialog) - -wxTextEntryDialog::wxTextEntryDialog(wxWindow *parent, - const wxString& message, - const wxString& caption, - const wxString& value, - long style, - const wxPoint& pos) - : wxDialog(parent, wxID_ANY, caption, pos, wxDefaultSize, - wxDEFAULT_DIALOG_STYLE), - m_value(value) -{ - m_dialogStyle = style; - m_value = value; - - wxBeginBusyCursor(); - - wxBoxSizer *topsizer = new wxBoxSizer( wxVERTICAL ); - - wxSizerFlags flagsBorder2; - flagsBorder2.DoubleBorder(); - -#if wxUSE_STATTEXT - // 1) text message - topsizer->Add(CreateTextSizer(message), flagsBorder2); -#endif - - // 2) text ctrl - m_textctrl = new wxTextCtrl(this, wxID_TEXT, value, - wxDefaultPosition, wxSize(300, wxDefaultCoord), - style & ~wxTextEntryDialogStyle); - - topsizer->Add(m_textctrl, - wxSizerFlags(style & wxTE_MULTILINE ? 1 : 0). - Expand(). - TripleBorder(wxLEFT | wxRIGHT)); - -#if wxUSE_VALIDATORS - wxTextValidator validator( wxFILTER_NONE, &m_value ); - m_textctrl->SetValidator( validator ); -#endif // wxUSE_VALIDATORS - - // 3) buttons if any - wxSizer *buttonSizer = CreateSeparatedButtonSizer(style & ButtonSizerFlags); - if ( buttonSizer ) - { - topsizer->Add(buttonSizer, wxSizerFlags(flagsBorder2).Expand()); - } - - SetAutoLayout( true ); - SetSizer( topsizer ); - - topsizer->SetSizeHints( this ); - topsizer->Fit( this ); - - if ( style & wxCENTRE ) - Centre( wxBOTH ); - - m_textctrl->SetSelection(-1, -1); - m_textctrl->SetFocus(); - - wxEndBusyCursor(); -} - -void wxTextEntryDialog::OnOK(wxCommandEvent& WXUNUSED(event) ) -{ -#if wxUSE_VALIDATORS - if( Validate() && TransferDataFromWindow() ) - { - EndModal( wxID_OK ); - } -#else - m_value = m_textctrl->GetValue(); - - EndModal(wxID_OK); -#endif - // wxUSE_VALIDATORS -} - -void wxTextEntryDialog::SetValue(const wxString& val) -{ - m_value = val; - - m_textctrl->SetValue(val); -} - -#if wxUSE_VALIDATORS -void wxTextEntryDialog::SetTextValidator( long style ) -{ - wxTextValidator validator( style, &m_value ); - m_textctrl->SetValidator( validator ); -} - -void wxTextEntryDialog::SetTextValidator( const wxTextValidator& validator ) -{ - m_textctrl->SetValidator( validator ); -} - -#endif - // wxUSE_VALIDATORS - -// ---------------------------------------------------------------------------- -// wxPasswordEntryDialog -// ---------------------------------------------------------------------------- - -IMPLEMENT_CLASS(wxPasswordEntryDialog, wxTextEntryDialog) - -wxPasswordEntryDialog::wxPasswordEntryDialog(wxWindow *parent, - const wxString& message, - const wxString& caption, - const wxString& value, - long style, - const wxPoint& pos) - : wxTextEntryDialog(parent, message, caption, value, - style | wxTE_PASSWORD, pos) -{ - // Only change from wxTextEntryDialog is the password style -} - -#endif // wxUSE_TEXTDLG diff --git a/wxWidgets/src/generic/timer.cpp b/wxWidgets/src/generic/timer.cpp deleted file mode 100644 index 706ed092cd..0000000000 --- a/wxWidgets/src/generic/timer.cpp +++ /dev/null @@ -1,283 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/generic/timer.cpp -// Purpose: wxTimer implementation -// Author: Vaclav Slavik -// Id: $Id: timer.cpp 40943 2006-08-31 19:31:43Z ABX $ -// Copyright: (c) Vaclav Slavik -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -// ---------------------------------------------------------------------------- -// NB: when using generic wxTimer implementation in your port, you *must* call -// wxTimer::NotifyTimers() often enough. The ideal place for this -// is in wxEventLoop::Dispatch(). -// ---------------------------------------------------------------------------- - -#if wxUSE_TIMER - -#include "wx/timer.h" - -#ifndef WX_PRECOMP - #include "wx/log.h" - #include "wx/module.h" -#endif - -// ---------------------------------------------------------------------------- -// Time input function -// ---------------------------------------------------------------------------- - -#ifdef __WXMGL__ - // We take advantage of wxMGL's _EVT_getTicks because it is faster - // (especially under MS-DOS!) and more precise than wxGetLocalTimeMillis - // if we are unlucky and the latter combines information from two sources. - #include "wx/mgl/private.h" - extern "C" ulong _EVT_getTicks(); - #define GetMillisecondsTime _EVT_getTicks - - typedef ulong wxTimerTick_t; - - #define wxTimerTickFmtSpec _T("lu") - #define wxTimerTickPrintfArg(tt) (tt) - - #ifdef __DOS__ - // Under DOS the MGL timer has a 24hr period, so consider the 12 hours - // before y to be 'less' and the the 12 hours after 'greater' modulo - // 24 hours. - inline bool wxTickGreaterEqual(wxTimerTick_t x, wxTimerTick_t y) - { - // _EVT_getTicks wraps at 1573040 * 55 - const wxTimerTick_t modulus = 1573040 * 55; - return (2 * modulus + x - y) % modulus < modulus / 2; - } - #else - // If wxTimerTick_t is 32-bits then it'll wrap in around 50 days. So - // let the 25 days before y be 'less' and 25 days after be 'greater'. - inline bool wxTickGreaterEqual(wxTimerTick_t x, wxTimerTick_t y) - { - // This code assumes wxTimerTick_t is an unsigned type. - // Set half_modulus with top bit set and the rest zeros. - const wxTimerTick_t half_modulus = ~((~(wxTimerTick_t)0) >> 1); - return x - y < half_modulus; - } - #endif -#else // !__WXMGL__ - #define GetMillisecondsTime wxGetLocalTimeMillis - - typedef wxLongLong wxTimerTick_t; - - #if wxUSE_LONGLONG_WX - #define wxTimerTickFmtSpec wxLongLongFmtSpec _T("d") - #define wxTimerTickPrintfArg(tt) (tt.GetValue()) - #else // using native wxLongLong - #define wxTimerTickFmtSpec _T("s") - #define wxTimerTickPrintfArg(tt) (tt.ToString().c_str()) - #endif // wx/native long long - - inline bool wxTickGreaterEqual(wxTimerTick_t x, wxTimerTick_t y) - { - return x >= y; - } -#endif // __WXMGL__/!__WXMGL__ - -// ---------------------------------------------------------------------------- -// helper structures and wxTimerScheduler -// ---------------------------------------------------------------------------- - -class wxTimerDesc -{ -public: - wxTimerDesc(wxTimer *t) : - timer(t), running(false), next(NULL), prev(NULL), - shotTime(0), deleteFlag(NULL) {} - - wxTimer *timer; - bool running; - wxTimerDesc *next, *prev; - wxTimerTick_t shotTime; - volatile bool *deleteFlag; // see comment in ~wxTimer -}; - -class wxTimerScheduler -{ -public: - wxTimerScheduler() : m_timers(NULL) {} - - void QueueTimer(wxTimerDesc *desc, wxTimerTick_t when = 0); - void RemoveTimer(wxTimerDesc *desc); - void NotifyTimers(); - -private: - wxTimerDesc *m_timers; -}; - -void wxTimerScheduler::QueueTimer(wxTimerDesc *desc, wxTimerTick_t when) -{ - if ( desc->running ) - return; // already scheduled - - if ( when == 0 ) - when = GetMillisecondsTime() + desc->timer->GetInterval(); - desc->shotTime = when; - desc->running = true; - - wxLogTrace( wxT("timer"), - wxT("queued timer %p at tick %") wxTimerTickFmtSpec, - desc->timer, wxTimerTickPrintfArg(when)); - - if ( m_timers ) - { - wxTimerDesc *d = m_timers; - while ( d->next && d->next->shotTime < when ) d = d->next; - desc->next = d->next; - desc->prev = d; - if ( d->next ) - d->next->prev = desc; - d->next = desc; - } - else - { - m_timers = desc; - desc->prev = desc->next = NULL; - } -} - -void wxTimerScheduler::RemoveTimer(wxTimerDesc *desc) -{ - desc->running = false; - if ( desc == m_timers ) - m_timers = desc->next; - if ( desc->prev ) - desc->prev->next = desc->next; - if ( desc->next ) - desc->next->prev = desc->prev; - desc->prev = desc->next = NULL; -} - -void wxTimerScheduler::NotifyTimers() -{ - if ( m_timers ) - { - bool oneShot; - volatile bool timerDeleted; - wxTimerTick_t now = GetMillisecondsTime(); - - for ( wxTimerDesc *desc = m_timers; desc; desc = desc->next ) - { - if ( desc->running && wxTickGreaterEqual(now, desc->shotTime) ) - { - oneShot = desc->timer->IsOneShot(); - RemoveTimer(desc); - - timerDeleted = false; - desc->deleteFlag = &timerDeleted; - desc->timer->Notify(); - - if ( !timerDeleted ) - { - wxLogTrace( wxT("timer"), - wxT("notified timer %p sheduled for %") - wxTimerTickFmtSpec, - desc->timer, - wxTimerTickPrintfArg(desc->shotTime) ); - - desc->deleteFlag = NULL; - if ( !oneShot ) - QueueTimer(desc, now + desc->timer->GetInterval()); - } - else - { - desc = m_timers; - if (!desc) - break; - } - } - } - } -} - - -// ---------------------------------------------------------------------------- -// wxTimer -// ---------------------------------------------------------------------------- - -IMPLEMENT_ABSTRACT_CLASS(wxTimer, wxEvtHandler) - -wxTimerScheduler *gs_scheduler = NULL; - -void wxTimer::Init() -{ - if ( !gs_scheduler ) - gs_scheduler = new wxTimerScheduler; - m_desc = new wxTimerDesc(this); -} - -wxTimer::~wxTimer() -{ - wxLogTrace( wxT("timer"), wxT("destroying timer %p..."), this); - if ( IsRunning() ) - Stop(); - - // NB: this is a hack: wxTimerScheduler must have some way of knowing - // that wxTimer object was deleted under its hands -- this may - // happen if somebody is really nasty and deletes the timer - // from wxTimer::Notify() - if ( m_desc->deleteFlag != NULL ) - *m_desc->deleteFlag = true; - - delete m_desc; - wxLogTrace( wxT("timer"), wxT(" ...done destroying timer %p..."), this); -} - -bool wxTimer::IsRunning() const -{ - return m_desc->running; -} - -bool wxTimer::Start(int millisecs, bool oneShot) -{ - wxLogTrace( wxT("timer"), wxT("started timer %p: %i ms, oneshot=%i"), - this, millisecs, oneShot); - - if ( !wxTimerBase::Start(millisecs, oneShot) ) - return false; - - gs_scheduler->QueueTimer(m_desc); - return true; -} - -void wxTimer::Stop() -{ - if ( !m_desc->running ) return; - - gs_scheduler->RemoveTimer(m_desc); -} - -/*static*/ void wxTimer::NotifyTimers() -{ - if ( gs_scheduler ) - gs_scheduler->NotifyTimers(); -} - - - -// A module to deallocate memory properly: -class wxTimerModule: public wxModule -{ -DECLARE_DYNAMIC_CLASS(wxTimerModule) -public: - wxTimerModule() {} - bool OnInit() { return true; } - void OnExit() { delete gs_scheduler; gs_scheduler = NULL; } -}; - -IMPLEMENT_DYNAMIC_CLASS(wxTimerModule, wxModule) - - -#endif //wxUSE_TIMER diff --git a/wxWidgets/src/generic/tipdlg.cpp b/wxWidgets/src/generic/tipdlg.cpp deleted file mode 100644 index a64fee3a14..0000000000 --- a/wxWidgets/src/generic/tipdlg.cpp +++ /dev/null @@ -1,347 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: src/generic/tipdlg.cpp -// Purpose: implementation of wxTipDialog -// Author: Vadim Zeitlin -// Modified by: -// Created: 28.06.99 -// RCS-ID: $Id: tipdlg.cpp 52000 2008-02-22 18:37:18Z VS $ -// Copyright: (c) Vadim Zeitlin -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_STARTUP_TIPS - -#ifndef WX_PRECOMP - #include "wx/button.h" - #include "wx/checkbox.h" - #include "wx/statbox.h" - #include "wx/dialog.h" - #include "wx/icon.h" - #include "wx/intl.h" - #include "wx/textctrl.h" - #include "wx/statbmp.h" - #include "wx/stattext.h" - #include "wx/sizer.h" - #include "wx/settings.h" -#endif // WX_PRECOMP - -#include "wx/statline.h" -#include "wx/artprov.h" - -#include "wx/tipdlg.h" - -// ---------------------------------------------------------------------------- -// constants -// ---------------------------------------------------------------------------- - -static const int wxID_NEXT_TIP = 32000; // whatever - -// --------------------------------------------------------------------------- -// macros -// --------------------------------------------------------------------------- - -/* Macro for avoiding #ifdefs when value have to be different depending on size of - device we display on - take it from something like wxDesktopPolicy in the future - */ - -#if defined(__SMARTPHONE__) - #define wxLARGESMALL(large,small) small -#else - #define wxLARGESMALL(large,small) large -#endif - -// ---------------------------------------------------------------------------- -// private classes -// ---------------------------------------------------------------------------- - -// an implementation which takes the tips from the text file - each line -// represents a tip -class WXDLLIMPEXP_ADV wxFileTipProvider : public wxTipProvider -{ -public: - wxFileTipProvider(const wxString& filename, size_t currentTip); - - virtual wxString GetTip(); - -private: - wxTextFile m_textfile; - - DECLARE_NO_COPY_CLASS(wxFileTipProvider) -}; - -#ifdef __WIN32__ -// TODO an implementation which takes the tips from the given registry key -class WXDLLIMPEXP_ADV wxRegTipProvider : public wxTipProvider -{ -public: - wxRegTipProvider(const wxString& keyname); - - virtual wxString GetTip(); -}; - -// Empty implementation for now to keep the linker happy -wxString wxRegTipProvider::GetTip() -{ - return wxEmptyString; -} - -#endif // __WIN32__ - -// the dialog we show in wxShowTip() -class WXDLLIMPEXP_ADV wxTipDialog : public wxDialog -{ -public: - wxTipDialog(wxWindow *parent, - wxTipProvider *tipProvider, - bool showAtStartup); - - // the tip dialog has "Show tips on startup" checkbox - return true if it - // was checked (or wasn't unchecked) - bool ShowTipsOnStartup() const { return m_checkbox->GetValue(); } - - // sets the (next) tip text - void SetTipText() { m_text->SetValue(m_tipProvider->GetTip()); } - - // "Next" button handler - void OnNextTip(wxCommandEvent& WXUNUSED(event)) { SetTipText(); } - -private: - wxTipProvider *m_tipProvider; - - wxTextCtrl *m_text; - wxCheckBox *m_checkbox; - - DECLARE_EVENT_TABLE() - DECLARE_NO_COPY_CLASS(wxTipDialog) -}; - -// ============================================================================ -// implementation -// ============================================================================ - -// ---------------------------------------------------------------------------- -// wxFileTipProvider -// ---------------------------------------------------------------------------- - -wxFileTipProvider::wxFileTipProvider(const wxString& filename, - size_t currentTip) - : wxTipProvider(currentTip), m_textfile(filename) -{ - m_textfile.Open(); -} - -wxString wxFileTipProvider::GetTip() -{ - size_t count = m_textfile.GetLineCount(); - if ( !count ) - { - return _("Tips not available, sorry!"); - } - - wxString tip; - - // Comments start with a # symbol. - // Loop reading lines until get the first one that isn't a comment. - // The max number of loop executions is the number of lines in the - // textfile so that can't go into an eternal loop in the [oddball] - // case of a comment-only tips file, or the developer has vetoed - // them all via PreprecessTip(). - for ( size_t i=0; i < count; i++ ) - { - // The current tip may be at the last line of the textfile, (or - // past it, if the number of lines in the textfile changed, such - // as changing to a different textfile, with less tips). So check - // to see at last line of text file, (or past it)... - if ( m_currentTip >= count ) - { - // .. and if so, wrap back to line 0. - m_currentTip = 0; - } - - // Read the tip, and increment the current tip counter. - tip = m_textfile.GetLine(m_currentTip++); - - // Allow a derived class's overrided virtual to modify the tip - // now if so desired. - tip = PreprocessTip(tip); - - // Break if tip isn't a comment, and isn't an empty string - // (or only stray space characters). - if ( !tip.StartsWith(wxT("#")) && (tip.Trim() != wxEmptyString) ) - { - break; - } - } - - // If tip starts with '_(', then it is a gettext string of format - // _("My \"global\" tip text") so first strip off the leading '_("'... - if ( tip.StartsWith(wxT("_(\"" ), &tip)) - { - //...and strip off the trailing '")'... - tip = tip.BeforeLast(wxT('\"')); - // ...and replace escaped quotes - tip.Replace(wxT("\\\""), wxT("\"")); - - // and translate it as requested - tip = wxGetTranslation(tip); - } - - return tip; -} - -// ---------------------------------------------------------------------------- -// wxTipDialog -// ---------------------------------------------------------------------------- - -BEGIN_EVENT_TABLE(wxTipDialog, wxDialog) - EVT_BUTTON(wxID_NEXT_TIP, wxTipDialog::OnNextTip) -END_EVENT_TABLE() - -wxTipDialog::wxTipDialog(wxWindow *parent, - wxTipProvider *tipProvider, - bool showAtStartup) - : wxDialog(parent, wxID_ANY, _("Tip of the Day"), - wxDefaultPosition, wxDefaultSize, - wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER - ) -{ - m_tipProvider = tipProvider; - bool isPda = (wxSystemSettings::GetScreenType() <= wxSYS_SCREEN_PDA); - - // 1) create all controls in tab order - - wxStaticText *text = new wxStaticText(this, wxID_ANY, _("Did you know...")); - - if (!isPda) - { - wxFont font = text->GetFont(); - font.SetPointSize(int(1.6 * font.GetPointSize())); - font.SetWeight(wxFONTWEIGHT_BOLD); - text->SetFont(font); - } - - m_text = new wxTextCtrl(this, wxID_ANY, wxEmptyString, - wxDefaultPosition, wxSize(200, 160), - wxTE_MULTILINE | - wxTE_READONLY | - wxTE_NO_VSCROLL | - wxTE_RICH2 | // a hack to get rid of vert scrollbar - wxDEFAULT_CONTROL_BORDER - ); -#if defined(__WXMSW__) - m_text->SetFont(wxFont(12, wxSWISS, wxNORMAL, wxNORMAL)); -#endif - -//#if defined(__WXPM__) - // - // The only way to get icons into an OS/2 static bitmap control - // -// wxBitmap vBitmap; - -// vBitmap.SetId(wxICON_TIP); // OS/2 specific bitmap method--OS/2 wxBitmaps all have an ID. -// // and for StatBmp's under OS/2 it MUST be a valid resource ID. -// -// wxStaticBitmap* bmp = new wxStaticBitmap(this, wxID_ANY, vBitmap); -// -//#else - - wxIcon icon = wxArtProvider::GetIcon(wxART_TIP, wxART_CMN_DIALOG); - wxStaticBitmap *bmp = new wxStaticBitmap(this, wxID_ANY, icon); - -//#endif - - m_checkbox = new wxCheckBox(this, wxID_ANY, _("&Show tips at startup")); - m_checkbox->SetValue(showAtStartup); - m_checkbox->SetFocus(); - - // smart phones does not support or do not waste space for wxButtons -#ifndef __SMARTPHONE__ - wxButton *btnNext = new wxButton(this, wxID_NEXT_TIP, _("&Next Tip")); -#endif - - // smart phones does not support or do not waste space for wxButtons -#ifndef __SMARTPHONE__ - wxButton *btnClose = new wxButton(this, wxID_CLOSE); - SetAffirmativeId(wxID_CLOSE); -#endif - - - // 2) put them in boxes - - wxBoxSizer *topsizer = new wxBoxSizer( wxVERTICAL ); - - wxBoxSizer *icon_text = new wxBoxSizer( wxHORIZONTAL ); - icon_text->Add( bmp, 0, wxCENTER ); - icon_text->Add( text, 1, wxCENTER | wxLEFT, wxLARGESMALL(20,0) ); - topsizer->Add( icon_text, 0, wxEXPAND | wxALL, wxLARGESMALL(10,0) ); - - topsizer->Add( m_text, 1, wxEXPAND | wxLEFT|wxRIGHT, wxLARGESMALL(10,0) ); - - wxBoxSizer *bottom = new wxBoxSizer( wxHORIZONTAL ); - if (isPda) - topsizer->Add( m_checkbox, 0, wxCENTER|wxTOP ); - else - bottom->Add( m_checkbox, 0, wxCENTER ); - - // smart phones does not support or do not waste space for wxButtons -#ifdef __SMARTPHONE__ - SetRightMenu(wxID_NEXT_TIP, _("Next")); - SetLeftMenu(wxID_CLOSE); -#else - if (!isPda) - bottom->Add( 10,10,1 ); - bottom->Add( btnNext, 0, wxCENTER | wxLEFT, wxLARGESMALL(10,0) ); - bottom->Add( btnClose, 0, wxCENTER | wxLEFT, wxLARGESMALL(10,0) ); -#endif - - if (isPda) - topsizer->Add( bottom, 0, wxCENTER | wxALL, 5 ); - else - topsizer->Add( bottom, 0, wxEXPAND | wxALL, wxLARGESMALL(10,0) ); - - SetTipText(); - - SetSizer( topsizer ); - - topsizer->SetSizeHints( this ); - topsizer->Fit( this ); - - Centre(wxBOTH | wxCENTER_FRAME); -} - -// ---------------------------------------------------------------------------- -// our public interface -// ---------------------------------------------------------------------------- - -wxTipProvider *wxCreateFileTipProvider(const wxString& filename, - size_t currentTip) -{ - return new wxFileTipProvider(filename, currentTip); -} - -bool wxShowTip(wxWindow *parent, - wxTipProvider *tipProvider, - bool showAtStartup) -{ - wxTipDialog dlg(parent, tipProvider, showAtStartup); - dlg.ShowModal(); - - return dlg.ShowTipsOnStartup(); -} - -#endif // wxUSE_STARTUP_TIPS diff --git a/wxWidgets/src/generic/tipwin.cpp b/wxWidgets/src/generic/tipwin.cpp deleted file mode 100644 index b24bcf8ef8..0000000000 --- a/wxWidgets/src/generic/tipwin.cpp +++ /dev/null @@ -1,380 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: src/generic/tipwin.cpp -// Purpose: implementation of wxTipWindow -// Author: Vadim Zeitlin -// Modified by: -// Created: 10.09.00 -// RCS-ID: $Id: tipwin.cpp 43033 2006-11-04 13:31:10Z VZ $ -// Copyright: (c) 2000 Vadim Zeitlin -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -// For compilers that support precompilation, includes "wx/wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_TIPWINDOW - -#include "wx/tipwin.h" - -#ifndef WX_PRECOMP - #include "wx/dcclient.h" - #include "wx/timer.h" - #include "wx/settings.h" -#endif // WX_PRECOMP - -// ---------------------------------------------------------------------------- -// constants -// ---------------------------------------------------------------------------- - -static const wxCoord TEXT_MARGIN_X = 3; -static const wxCoord TEXT_MARGIN_Y = 3; - -// ---------------------------------------------------------------------------- -// wxTipWindowView -// ---------------------------------------------------------------------------- - -// Viewer window to put in the frame -class WXDLLEXPORT wxTipWindowView : public wxWindow -{ -public: - wxTipWindowView(wxWindow *parent); - - // event handlers - void OnPaint(wxPaintEvent& event); - void OnMouseClick(wxMouseEvent& event); - void OnMouseMove(wxMouseEvent& event); - -#if !wxUSE_POPUPWIN - void OnKillFocus(wxFocusEvent& event); -#endif // wxUSE_POPUPWIN - - // calculate the client rect we need to display the text - void Adjust(const wxString& text, wxCoord maxLength); - -private: - wxTipWindow* m_parent; - -#if !wxUSE_POPUPWIN - long m_creationTime; -#endif // !wxUSE_POPUPWIN - - DECLARE_EVENT_TABLE() - DECLARE_NO_COPY_CLASS(wxTipWindowView) -}; - -// ============================================================================ -// implementation -// ============================================================================ - -// ---------------------------------------------------------------------------- -// event tables -// ---------------------------------------------------------------------------- - -BEGIN_EVENT_TABLE(wxTipWindow, wxTipWindowBase) - EVT_LEFT_DOWN(wxTipWindow::OnMouseClick) - EVT_RIGHT_DOWN(wxTipWindow::OnMouseClick) - EVT_MIDDLE_DOWN(wxTipWindow::OnMouseClick) - -#if !wxUSE_POPUPWIN - EVT_KILL_FOCUS(wxTipWindow::OnKillFocus) - EVT_ACTIVATE(wxTipWindow::OnActivate) -#endif // !wxUSE_POPUPWIN -END_EVENT_TABLE() - -BEGIN_EVENT_TABLE(wxTipWindowView, wxWindow) - EVT_PAINT(wxTipWindowView::OnPaint) - - EVT_LEFT_DOWN(wxTipWindowView::OnMouseClick) - EVT_RIGHT_DOWN(wxTipWindowView::OnMouseClick) - EVT_MIDDLE_DOWN(wxTipWindowView::OnMouseClick) - - EVT_MOTION(wxTipWindowView::OnMouseMove) - -#if !wxUSE_POPUPWIN - EVT_KILL_FOCUS(wxTipWindowView::OnKillFocus) -#endif // !wxUSE_POPUPWIN -END_EVENT_TABLE() - -// ---------------------------------------------------------------------------- -// wxTipWindow -// ---------------------------------------------------------------------------- - -wxTipWindow::wxTipWindow(wxWindow *parent, - const wxString& text, - wxCoord maxLength, - wxTipWindow** windowPtr, - wxRect *rectBounds) -#if wxUSE_POPUPWIN - : wxPopupTransientWindow(parent) -#else - : wxFrame(parent, wxID_ANY, wxEmptyString, - wxDefaultPosition, wxDefaultSize, - wxNO_BORDER | wxFRAME_NO_TASKBAR ) -#endif -{ - SetTipWindowPtr(windowPtr); - if ( rectBounds ) - { - SetBoundingRect(*rectBounds); - } - - // set colours - SetForegroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_INFOTEXT)); - SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_INFOBK)); - - // set size, position and show it - m_view = new wxTipWindowView(this); - m_view->Adjust(text, maxLength); - m_view->SetFocus(); - - int x, y; - wxGetMousePosition(&x, &y); - - // we want to show the tip below the mouse, not over it - // - // NB: the reason we use "/ 2" here is that we don't know where the current - // cursors hot spot is... it would be nice if we could find this out - // though - y += wxSystemSettings::GetMetric(wxSYS_CURSOR_Y) / 2; - -#if wxUSE_POPUPWIN - Position(wxPoint(x, y), wxSize(0,0)); - Popup(m_view); - #ifdef __WXGTK__ - m_view->CaptureMouse(); - #endif -#else - Move(x, y); - Show(true); -#endif -} - -wxTipWindow::~wxTipWindow() -{ - if ( m_windowPtr ) - { - *m_windowPtr = NULL; - } - #ifdef wxUSE_POPUPWIN - #ifdef __WXGTK__ - if ( m_view->HasCapture() ) - m_view->ReleaseMouse(); - #endif - #endif -} - -void wxTipWindow::OnMouseClick(wxMouseEvent& WXUNUSED(event)) -{ - Close(); -} - -#if wxUSE_POPUPWIN - -void wxTipWindow::OnDismiss() -{ - Close(); -} - -#else // !wxUSE_POPUPWIN - -void wxTipWindow::OnActivate(wxActivateEvent& event) -{ - if (!event.GetActive()) - Close(); -} - -void wxTipWindow::OnKillFocus(wxFocusEvent& WXUNUSED(event)) -{ - // Under Windows at least, we will get this immediately - // because when the view window is focussed, the - // tip window goes out of focus. -#ifdef __WXGTK__ - Close(); -#endif -} - -#endif // wxUSE_POPUPWIN // !wxUSE_POPUPWIN - -void wxTipWindow::SetBoundingRect(const wxRect& rectBound) -{ - m_rectBound = rectBound; -} - -void wxTipWindow::Close() -{ - if ( m_windowPtr ) - { - *m_windowPtr = NULL; - m_windowPtr = NULL; - } - -#if wxUSE_POPUPWIN - Show(false); - #ifdef __WXGTK__ - if ( m_view->HasCapture() ) - m_view->ReleaseMouse(); - #endif - Destroy(); -#else - wxFrame::Close(); -#endif -} - -// ---------------------------------------------------------------------------- -// wxTipWindowView -// ---------------------------------------------------------------------------- - -wxTipWindowView::wxTipWindowView(wxWindow *parent) - : wxWindow(parent, wxID_ANY, - wxDefaultPosition, wxDefaultSize, - wxNO_BORDER) -{ - // set colours - SetForegroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_INFOTEXT)); - SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_INFOBK)); - -#if !wxUSE_POPUPWIN - m_creationTime = wxGetLocalTime(); -#endif // !wxUSE_POPUPWIN - - m_parent = (wxTipWindow*)parent; -} - -void wxTipWindowView::Adjust(const wxString& text, wxCoord maxLength) -{ - wxClientDC dc(this); - dc.SetFont(GetFont()); - - // calculate the length: we want each line be no longer than maxLength - // pixels and we only break lines at words boundary - wxString current; - wxCoord height, width, - widthMax = 0; - m_parent->m_heightLine = 0; - - bool breakLine = false; - for ( const wxChar *p = text.c_str(); ; p++ ) - { - if ( *p == _T('\n') || *p == _T('\0') ) - { - dc.GetTextExtent(current, &width, &height); - if ( width > widthMax ) - widthMax = width; - - if ( height > m_parent->m_heightLine ) - m_parent->m_heightLine = height; - - m_parent->m_textLines.Add(current); - - if ( !*p ) - { - // end of text - break; - } - - current.clear(); - breakLine = false; - } - else if ( breakLine && (*p == _T(' ') || *p == _T('\t')) ) - { - // word boundary - break the line here - m_parent->m_textLines.Add(current); - current.clear(); - breakLine = false; - } - else // line goes on - { - current += *p; - dc.GetTextExtent(current, &width, &height); - if ( width > maxLength ) - breakLine = true; - - if ( width > widthMax ) - widthMax = width; - - if ( height > m_parent->m_heightLine ) - m_parent->m_heightLine = height; - } - } - - // take into account the border size and the margins - width = 2*(TEXT_MARGIN_X + 1) + widthMax; - height = 2*(TEXT_MARGIN_Y + 1) + wx_truncate_cast(wxCoord, m_parent->m_textLines.GetCount())*m_parent->m_heightLine; - m_parent->SetClientSize(width, height); - SetSize(0, 0, width, height); -} - -void wxTipWindowView::OnPaint(wxPaintEvent& WXUNUSED(event)) -{ - wxPaintDC dc(this); - - wxRect rect; - wxSize size = GetClientSize(); - rect.width = size.x; - rect.height = size.y; - - // first filll the background - dc.SetBrush(wxBrush(GetBackgroundColour(), wxSOLID)); - dc.SetPen( wxPen(GetForegroundColour(), 1, wxSOLID) ); - dc.DrawRectangle(rect); - - // and then draw the text line by line - dc.SetTextBackground(GetBackgroundColour()); - dc.SetTextForeground(GetForegroundColour()); - dc.SetFont(GetFont()); - - wxPoint pt; - pt.x = TEXT_MARGIN_X; - pt.y = TEXT_MARGIN_Y; - size_t count = m_parent->m_textLines.GetCount(); - for ( size_t n = 0; n < count; n++ ) - { - dc.DrawText(m_parent->m_textLines[n], pt); - - pt.y += m_parent->m_heightLine; - } -} - -void wxTipWindowView::OnMouseClick(wxMouseEvent& WXUNUSED(event)) -{ - m_parent->Close(); -} - -void wxTipWindowView::OnMouseMove(wxMouseEvent& event) -{ - const wxRect& rectBound = m_parent->m_rectBound; - - if ( rectBound.width && - !rectBound.Contains(ClientToScreen(event.GetPosition())) ) - { - // mouse left the bounding rect, disappear - m_parent->Close(); - } - else - { - event.Skip(); - } -} - -#if !wxUSE_POPUPWIN -void wxTipWindowView::OnKillFocus(wxFocusEvent& WXUNUSED(event)) -{ - // Workaround the kill focus event happening just after creation in wxGTK - if (wxGetLocalTime() > m_creationTime + 1) - m_parent->Close(); -} -#endif // !wxUSE_POPUPWIN - -#endif // wxUSE_TIPWINDOW diff --git a/wxWidgets/src/generic/toolbkg.cpp b/wxWidgets/src/generic/toolbkg.cpp deleted file mode 100644 index 36a2afaf2a..0000000000 --- a/wxWidgets/src/generic/toolbkg.cpp +++ /dev/null @@ -1,442 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: src/generic/toolbkg.cpp -// Purpose: generic implementation of wxToolbook -// Author: Julian Smart -// Modified by: -// Created: 2006-01-29 -// RCS-ID: $Id: toolbkg.cpp 44271 2007-01-21 00:52:05Z VZ $ -// Copyright: (c) 2006 Julian Smart -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_TOOLBOOK - -#ifndef WX_PRECOMP - #include "wx/icon.h" - #include "wx/settings.h" - #include "wx/toolbar.h" -#endif - -#include "wx/imaglist.h" -#include "wx/sysopt.h" -#include "wx/toolbook.h" - -#if defined(__WXMAC__) && wxUSE_TOOLBAR && wxUSE_BMPBUTTON -#include "wx/generic/buttonbar.h" -#endif - -// ---------------------------------------------------------------------------- -// various wxWidgets macros -// ---------------------------------------------------------------------------- - -// check that the page index is valid -#define IS_VALID_PAGE(nPage) ((nPage) < GetPageCount()) - -// ---------------------------------------------------------------------------- -// event table -// ---------------------------------------------------------------------------- - -IMPLEMENT_DYNAMIC_CLASS(wxToolbook, wxBookCtrlBase) -IMPLEMENT_DYNAMIC_CLASS(wxToolbookEvent, wxNotifyEvent) - -#if !WXWIN_COMPATIBILITY_EVENT_TYPES -const wxEventType wxEVT_COMMAND_TOOLBOOK_PAGE_CHANGING = wxNewEventType(); -const wxEventType wxEVT_COMMAND_TOOLBOOK_PAGE_CHANGED = wxNewEventType(); -#endif - -BEGIN_EVENT_TABLE(wxToolbook, wxBookCtrlBase) - EVT_SIZE(wxToolbook::OnSize) - EVT_TOOL_RANGE(1, 50, wxToolbook::OnToolSelected) - EVT_IDLE(wxToolbook::OnIdle) -END_EVENT_TABLE() - -// ============================================================================ -// wxToolbook implementation -// ============================================================================ - -// ---------------------------------------------------------------------------- -// wxToolbook creation -// ---------------------------------------------------------------------------- - -void wxToolbook::Init() -{ - m_selection = wxNOT_FOUND; - m_needsRealizing = false; -} - -bool wxToolbook::Create(wxWindow *parent, - wxWindowID id, - const wxPoint& pos, - const wxSize& size, - long style, - const wxString& name) -{ - if ( (style & wxBK_ALIGN_MASK) == wxBK_DEFAULT ) - style |= wxBK_TOP; - - // no border for this control - style &= ~wxBORDER_MASK; - style |= wxBORDER_NONE; - - if ( !wxControl::Create(parent, id, pos, size, style, - wxDefaultValidator, name) ) - return false; - - int orient = wxTB_HORIZONTAL; - if ( (style & (wxBK_LEFT | wxBK_RIGHT)) != 0) - orient = wxTB_VERTICAL; - - // TODO: make more configurable - -#if defined(__WXMAC__) && wxUSE_TOOLBAR && wxUSE_BMPBUTTON - if (style & wxBK_BUTTONBAR) - { - m_bookctrl = new wxButtonToolBar - ( - this, - wxID_ANY, - wxDefaultPosition, - wxDefaultSize, - orient|wxTB_TEXT|wxTB_FLAT|wxNO_BORDER - ); - } - else -#endif - { - m_bookctrl = new wxToolBar - ( - this, - wxID_ANY, - wxDefaultPosition, - wxDefaultSize, - orient|wxTB_TEXT|wxTB_FLAT|wxTB_NODIVIDER|wxNO_BORDER - ); - } - - return true; -} - -// ---------------------------------------------------------------------------- -// wxToolbook geometry management -// ---------------------------------------------------------------------------- - -wxSize wxToolbook::GetControllerSize() const -{ - const wxSize sizeClient = GetClientSize(), - sizeBorder = m_bookctrl->GetSize() - m_bookctrl->GetClientSize(), - sizeToolBar = GetToolBar()->GetSize() + sizeBorder; - - wxSize size; - - if ( IsVertical() ) - { - size.x = sizeClient.x; - size.y = sizeToolBar.y; - } - else // left/right aligned - { - size.x = sizeToolBar.x; - size.y = sizeClient.y; - } - - return size; -} - -void wxToolbook::OnSize(wxSizeEvent& event) -{ - if (m_needsRealizing) - Realize(); - - wxBookCtrlBase::OnSize(event); -} - -wxSize wxToolbook::CalcSizeFromPage(const wxSize& sizePage) const -{ - // we need to add the size of the list control and the border between - const wxSize sizeToolBar = GetControllerSize(); - - wxSize size = sizePage; - if ( IsVertical() ) - { - size.y += sizeToolBar.y + GetInternalBorder(); - } - else // left/right aligned - { - size.x += sizeToolBar.x + GetInternalBorder(); - } - - return size; -} - -// ---------------------------------------------------------------------------- -// accessing the pages -// ---------------------------------------------------------------------------- - -bool wxToolbook::SetPageText(size_t n, const wxString& strText) -{ - // Assume tool ids start from 1 - wxToolBarToolBase* tool = GetToolBar()->FindById(n + 1); - if (tool) - { - tool->SetLabel(strText); - return true; - } - else - return false; -} - -wxString wxToolbook::GetPageText(size_t n) const -{ - wxToolBarToolBase* tool = GetToolBar()->FindById(n + 1); - if (tool) - return tool->GetLabel(); - else - return wxEmptyString; -} - -int wxToolbook::GetPageImage(size_t WXUNUSED(n)) const -{ - wxFAIL_MSG( _T("wxToolbook::GetPageImage() not implemented") ); - - return wxNOT_FOUND; -} - -bool wxToolbook::SetPageImage(size_t n, int imageId) -{ - wxASSERT( GetImageList() != NULL ); - if (!GetImageList()) - return false; - - wxToolBarToolBase* tool = GetToolBar()->FindById(n + 1); - if (tool) - { - // Find the image list index for this tool - wxBitmap bitmap = GetImageList()->GetBitmap(imageId); - tool->SetNormalBitmap(bitmap); - return true; - } - else - return false; -} - -// ---------------------------------------------------------------------------- -// image list stuff -// ---------------------------------------------------------------------------- - -void wxToolbook::SetImageList(wxImageList *imageList) -{ - wxBookCtrlBase::SetImageList(imageList); -} - -// ---------------------------------------------------------------------------- -// selection -// ---------------------------------------------------------------------------- - -int wxToolbook::GetSelection() const -{ - return m_selection; -} - -wxBookCtrlBaseEvent* wxToolbook::CreatePageChangingEvent() const -{ - return new wxToolbookEvent(wxEVT_COMMAND_TOOLBOOK_PAGE_CHANGING, m_windowId); -} - -void wxToolbook::MakeChangedEvent(wxBookCtrlBaseEvent &event) -{ - event.SetEventType(wxEVT_COMMAND_TOOLBOOK_PAGE_CHANGED); -} - -void wxToolbook::UpdateSelectedPage(size_t newsel) -{ - m_selection = newsel; - GetToolBar()->ToggleTool(newsel + 1, true); -} - -// Not part of the wxBookctrl API, but must be called in OnIdle or -// by application to realize the toolbar and select the initial page. -void wxToolbook::Realize() -{ - if (m_needsRealizing) - { - GetToolBar()->SetToolBitmapSize(m_maxBitmapSize); - - int remap = wxSystemOptions::GetOptionInt(wxT("msw.remap")); - wxSystemOptions::SetOption(wxT("msw.remap"), 0); - GetToolBar()->Realize(); - wxSystemOptions::SetOption(wxT("msw.remap"), remap); - } - - m_needsRealizing = false; - - if (m_selection == -1) - m_selection = 0; - - if (GetPageCount() > 0) - { - int sel = m_selection; - m_selection = -1; - SetSelection(sel); - } - - DoSize(); -} - -int wxToolbook::HitTest(const wxPoint& pt, long *flags) const -{ - int pagePos = wxNOT_FOUND; - - if ( flags ) - *flags = wxBK_HITTEST_NOWHERE; - - // convert from wxToolbook coordinates to wxToolBar ones - const wxToolBarBase * const tbar = GetToolBar(); - const wxPoint tbarPt = tbar->ScreenToClient(ClientToScreen(pt)); - - // is the point over the toolbar? - if ( wxRect(tbar->GetSize()).Contains(tbarPt) ) - { - const wxToolBarToolBase * const - tool = tbar->FindToolForPosition(tbarPt.x, tbarPt.y); - - if ( tool ) - { - pagePos = tbar->GetToolPos(tool->GetId()); - if ( flags ) - *flags = wxBK_HITTEST_ONICON | wxBK_HITTEST_ONLABEL; - } - } - else // not over the toolbar - { - if ( flags && GetPageRect().Contains(pt) ) - *flags |= wxBK_HITTEST_ONPAGE; - } - - return pagePos; -} - -void wxToolbook::OnIdle(wxIdleEvent& event) -{ - if (m_needsRealizing) - Realize(); - event.Skip(); -} - -// ---------------------------------------------------------------------------- -// adding/removing the pages -// ---------------------------------------------------------------------------- - -bool wxToolbook::InsertPage(size_t n, - wxWindow *page, - const wxString& text, - bool bSelect, - int imageId) -{ - if ( !wxBookCtrlBase::InsertPage(n, page, text, bSelect, imageId) ) - return false; - - m_needsRealizing = true; - - wxASSERT(GetImageList() != NULL); - - if (!GetImageList()) - return false; - - // TODO: make sure all platforms can convert between icon and bitmap, - // and/or test whether the image is a bitmap or an icon. -#ifdef __WXMAC__ - wxBitmap bitmap = GetImageList()->GetBitmap(imageId); -#else - // On Windows, we can lose information by using GetBitmap, so extract icon instead - wxIcon icon = GetImageList()->GetIcon(imageId); - wxBitmap bitmap; - bitmap.CopyFromIcon(icon); -#endif - - m_maxBitmapSize.x = wxMax(bitmap.GetWidth(), m_maxBitmapSize.x); - m_maxBitmapSize.y = wxMax(bitmap.GetHeight(), m_maxBitmapSize.y); - - GetToolBar()->SetToolBitmapSize(m_maxBitmapSize); - GetToolBar()->AddRadioTool(n + 1, text, bitmap, wxNullBitmap, text); - - if (bSelect) - { - GetToolBar()->ToggleTool(n, true); - m_selection = n; - } - else - page->Hide(); - - InvalidateBestSize(); - return true; -} - -wxWindow *wxToolbook::DoRemovePage(size_t page) -{ - const size_t page_count = GetPageCount(); - wxWindow *win = wxBookCtrlBase::DoRemovePage(page); - - if ( win ) - { - GetToolBar()->DeleteTool(page + 1); - - if (m_selection >= (int)page) - { - // force new sel valid if possible - int sel = m_selection - 1; - if (page_count == 1) - sel = wxNOT_FOUND; - else if ((page_count == 2) || (sel == -1)) - sel = 0; - - // force sel invalid if deleting current page - don't try to hide it - m_selection = (m_selection == (int)page) ? wxNOT_FOUND : m_selection - 1; - - if ((sel != wxNOT_FOUND) && (sel != m_selection)) - SetSelection(sel); - } - } - - return win; -} - - -bool wxToolbook::DeleteAllPages() -{ - GetToolBar()->ClearTools(); - return wxBookCtrlBase::DeleteAllPages(); -} - -// ---------------------------------------------------------------------------- -// wxToolbook events -// ---------------------------------------------------------------------------- - -void wxToolbook::OnToolSelected(wxCommandEvent& event) -{ - const int selNew = event.GetId() - 1; - - if ( selNew == m_selection ) - { - // this event can only come from our own Select(m_selection) below - // which we call when the page change is vetoed, so we should simply - // ignore it - return; - } - - SetSelection(selNew); - - // change wasn't allowed, return to previous state - if (m_selection != selNew) - { - GetToolBar()->ToggleTool(m_selection, false); - } -} - -#endif // wxUSE_TOOLBOOK diff --git a/wxWidgets/src/generic/treebkg.cpp b/wxWidgets/src/generic/treebkg.cpp deleted file mode 100644 index efbad22fe3..0000000000 --- a/wxWidgets/src/generic/treebkg.cpp +++ /dev/null @@ -1,794 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: src/generic/treebkg.cpp -// Purpose: generic implementation of wxTreebook -// Author: Evgeniy Tarassov, Vadim Zeitlin -// Modified by: -// Created: 2005-09-15 -// RCS-ID: $Id: treebkg.cpp 54645 2008-07-15 21:29:10Z JS $ -// Copyright: (c) 2005 Vadim Zeitlin -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_TREEBOOK - -#include "wx/treebook.h" - -#ifndef WX_PRECOMP - #include "wx/settings.h" -#endif - -#include "wx/imaglist.h" - -// ---------------------------------------------------------------------------- -// various wxWidgets macros -// ---------------------------------------------------------------------------- - -// check that the page index is valid -#define IS_VALID_PAGE(nPage) ((nPage) < DoInternalGetPageCount()) - -// ---------------------------------------------------------------------------- -// event table -// ---------------------------------------------------------------------------- - -IMPLEMENT_DYNAMIC_CLASS(wxTreebook, wxBookCtrlBase) -IMPLEMENT_DYNAMIC_CLASS(wxTreebookEvent, wxNotifyEvent) - -#if !WXWIN_COMPATIBILITY_EVENT_TYPES -const wxEventType wxEVT_COMMAND_TREEBOOK_PAGE_CHANGING = wxNewEventType(); -const wxEventType wxEVT_COMMAND_TREEBOOK_PAGE_CHANGED = wxNewEventType(); -const wxEventType wxEVT_COMMAND_TREEBOOK_NODE_COLLAPSED = wxNewEventType(); -const wxEventType wxEVT_COMMAND_TREEBOOK_NODE_EXPANDED = wxNewEventType(); -#endif - -BEGIN_EVENT_TABLE(wxTreebook, wxBookCtrlBase) - EVT_TREE_SEL_CHANGED (wxID_ANY, wxTreebook::OnTreeSelectionChange) - EVT_TREE_ITEM_EXPANDED (wxID_ANY, wxTreebook::OnTreeNodeExpandedCollapsed) - EVT_TREE_ITEM_COLLAPSED(wxID_ANY, wxTreebook::OnTreeNodeExpandedCollapsed) - - WX_EVENT_TABLE_CONTROL_CONTAINER(wxTreebook) -END_EVENT_TABLE() - -// ============================================================================ -// wxTreebook implementation -// ============================================================================ - -WX_DELEGATE_TO_CONTROL_CONTAINER(wxTreebook, wxControl) - -// ---------------------------------------------------------------------------- -// wxTreebook creation -// ---------------------------------------------------------------------------- - -void wxTreebook::Init() -{ - m_container.SetContainerWindow(this); - - m_selection = - m_actualSelection = wxNOT_FOUND; -} - -bool -wxTreebook::Create(wxWindow *parent, - wxWindowID id, - const wxPoint& pos, - const wxSize& size, - long style, - const wxString& name) -{ - // Check the style flag to have either wxTBK_RIGHT or wxTBK_LEFT - if ( (style & wxBK_ALIGN_MASK) == wxBK_DEFAULT ) - { - style |= wxBK_LEFT; - } - style |= wxTAB_TRAVERSAL; - - // no border for this control, it doesn't look nice together with the tree - style &= ~wxBORDER_MASK; - style |= wxBORDER_NONE; - - if ( !wxControl::Create(parent, id, pos, size, - style, wxDefaultValidator, name) ) - return false; - -#ifdef __WXMSW__ - long treeStyle = GetThemedBorderStyle(); -#else - long treeStyle = wxBORDER_SUNKEN; -#endif - m_bookctrl = new wxTreeCtrl - ( - this, - wxID_ANY, - wxDefaultPosition, - wxDefaultSize, - treeStyle| - wxTR_DEFAULT_STYLE | - wxTR_HIDE_ROOT | - wxTR_SINGLE - ); - GetTreeCtrl()->SetQuickBestSize(false); // do full size calculation - GetTreeCtrl()->AddRoot(wxEmptyString); // label doesn't matter, it's hidden - -#ifdef __WXMSW__ - // We need to add dummy size event to force possible scrollbar hiding - wxSizeEvent evt; - GetEventHandler()->AddPendingEvent(evt); -#endif - - return true; -} - - -// insert a new page just before the pagePos -bool wxTreebook::InsertPage(size_t pagePos, - wxWindow *page, - const wxString& text, - bool bSelect, - int imageId) -{ - return DoInsertPage(pagePos, page, text, bSelect, imageId); -} - -bool wxTreebook::InsertSubPage(size_t pagePos, - wxWindow *page, - const wxString& text, - bool bSelect, - int imageId) -{ - return DoInsertSubPage(pagePos, page, text, bSelect, imageId); -} - -bool wxTreebook::AddPage(wxWindow *page, const wxString& text, bool bSelect, - int imageId) -{ - return DoInsertPage(m_treeIds.GetCount(), page, text, bSelect, imageId); -} - -// insertion time is linear to the number of top-pages -bool wxTreebook::AddSubPage(wxWindow *page, const wxString& text, bool bSelect, int imageId) -{ - return DoAddSubPage(page, text, bSelect, imageId); -} - - -bool wxTreebook::DoInsertPage(size_t pagePos, - wxWindow *page, - const wxString& text, - bool bSelect, - int imageId) -{ - wxCHECK_MSG( pagePos <= DoInternalGetPageCount(), false, - wxT("Invalid treebook page position") ); - - if ( !wxBookCtrlBase::InsertPage(pagePos, page, text, bSelect, imageId) ) - return false; - - wxTreeCtrl *tree = GetTreeCtrl(); - wxTreeItemId newId; - if ( pagePos == DoInternalGetPageCount() ) - { - // append the page to the end - wxTreeItemId rootId = tree->GetRootItem(); - - newId = tree->AppendItem(rootId, text, imageId); - } - else // insert the new page before the given one - { - wxTreeItemId nodeId = m_treeIds[pagePos]; - - wxTreeItemId previousId = tree->GetPrevSibling(nodeId); - wxTreeItemId parentId = tree->GetItemParent(nodeId); - - if ( previousId.IsOk() ) - { - // insert before the sibling - previousId - newId = tree->InsertItem(parentId, previousId, text, imageId); - } - else // no prev siblings -- insert as a first child - { - wxASSERT_MSG( parentId.IsOk(), wxT( "Tree has no root node?" ) ); - - newId = tree->PrependItem(parentId, text, imageId); - } - } - - if ( !newId.IsOk() ) - { - //something wrong -> cleaning and returning with false - (void)wxBookCtrlBase::DoRemovePage(pagePos); - - wxFAIL_MSG( wxT("Failed to insert treebook page") ); - return false; - } - - DoInternalAddPage(pagePos, page, newId); - - DoUpdateSelection(bSelect, pagePos); - - return true; -} - -bool wxTreebook::DoAddSubPage(wxWindow *page, const wxString& text, bool bSelect, int imageId) -{ - wxTreeCtrl *tree = GetTreeCtrl(); - - wxTreeItemId rootId = tree->GetRootItem(); - - wxTreeItemId lastNodeId = tree->GetLastChild(rootId); - - wxCHECK_MSG( lastNodeId.IsOk(), false, - _T("Can't insert sub page when there are no pages") ); - - // now calculate its position (should we save/update it too?) - size_t newPos = tree->GetCount() - - (tree->GetChildrenCount(lastNodeId, true) + 1); - - return DoInsertSubPage(newPos, page, text, bSelect, imageId); -} - -bool wxTreebook::DoInsertSubPage(size_t pagePos, - wxTreebookPage *page, - const wxString& text, - bool bSelect, - int imageId) -{ - wxTreeItemId parentId = DoInternalGetPage(pagePos); - wxCHECK_MSG( parentId.IsOk(), false, wxT("invalid tree item") ); - - wxTreeCtrl *tree = GetTreeCtrl(); - - size_t newPos = pagePos + tree->GetChildrenCount(parentId, true) + 1; - wxASSERT_MSG( newPos <= DoInternalGetPageCount(), - wxT("Internal error in tree insert point calculation") ); - - if ( !wxBookCtrlBase::InsertPage(newPos, page, text, bSelect, imageId) ) - return false; - - wxTreeItemId newId = tree->AppendItem(parentId, text, imageId); - - if ( !newId.IsOk() ) - { - (void)wxBookCtrlBase::DoRemovePage(newPos); - - wxFAIL_MSG( wxT("Failed to insert treebook page") ); - return false; - } - - DoInternalAddPage(newPos, page, newId); - - DoUpdateSelection(bSelect, newPos); - - return true; -} - -bool wxTreebook::DeletePage(size_t pagePos) -{ - wxCHECK_MSG( IS_VALID_PAGE(pagePos), false, wxT("Invalid tree index") ); - - wxTreebookPage *oldPage = DoRemovePage(pagePos); - if ( !oldPage ) - return false; - - delete oldPage; - - return true; -} - -wxTreebookPage *wxTreebook::DoRemovePage(size_t pagePos) -{ - wxTreeItemId pageId = DoInternalGetPage(pagePos); - wxCHECK_MSG( pageId.IsOk(), NULL, wxT("Invalid tree index") ); - - wxTreebookPage * oldPage = GetPage(pagePos); - wxTreeCtrl *tree = GetTreeCtrl(); - - size_t subCount = tree->GetChildrenCount(pageId, true); - wxASSERT_MSG ( IS_VALID_PAGE(pagePos + subCount), - wxT("Internal error in wxTreebook::DoRemovePage") ); - - // here we are going to delete ALL the pages in the range - // [pagePos, pagePos + subCount] -- the page and its children - - // deleting all the pages from the base class - for ( size_t i = 0; i <= subCount; ++i ) - { - wxTreebookPage *page = wxBookCtrlBase::DoRemovePage(pagePos); - - // don't delete the page itself though -- it will be deleted in - // DeletePage() when we return - if ( i ) - { - delete page; - } - } - - DoInternalRemovePageRange(pagePos, subCount); - - tree->DeleteChildren( pageId ); - tree->Delete( pageId ); - - return oldPage; -} - -bool wxTreebook::DeleteAllPages() -{ - wxBookCtrlBase::DeleteAllPages(); - m_treeIds.Clear(); - m_selection = - m_actualSelection = wxNOT_FOUND; - - wxTreeCtrl *tree = GetTreeCtrl(); - tree->DeleteChildren(tree->GetRootItem()); - - return true; -} - -void wxTreebook::DoInternalAddPage(size_t newPos, - wxTreebookPage *page, - wxTreeItemId pageId) -{ - wxASSERT_MSG( newPos <= m_treeIds.GetCount(), wxT("Ivalid index passed to wxTreebook::DoInternalAddPage") ); - - // hide newly inserted page initially (it will be shown when selected) - if ( page ) - page->Hide(); - - if ( newPos == m_treeIds.GetCount() ) - { - // append - m_treeIds.Add(pageId); - } - else // insert - { - m_treeIds.Insert(pageId, newPos); - - if ( m_selection != wxNOT_FOUND && newPos <= (size_t)m_selection ) - { - // selection has been moved one unit toward the end - ++m_selection; - if ( m_actualSelection != wxNOT_FOUND ) - ++m_actualSelection; - } - else if ( m_actualSelection != wxNOT_FOUND && - newPos <= (size_t)m_actualSelection ) - { - DoSetSelection(m_selection); - } - } -} - -void wxTreebook::DoInternalRemovePageRange(size_t pagePos, size_t subCount) -{ - // Attention: this function is only for a situation when we delete a node - // with all its children so pagePos is the node's index and subCount is the - // node children count - wxASSERT_MSG( pagePos + subCount < m_treeIds.GetCount(), - wxT("Ivalid page index") ); - - wxTreeItemId pageId = m_treeIds[pagePos]; - - m_treeIds.RemoveAt(pagePos, subCount + 1); - - if ( m_selection != wxNOT_FOUND ) - { - if ( (size_t)m_selection > pagePos + subCount) - { - // selection is far after the deleted page, so just update the index and move on - m_selection -= 1 + subCount; - if ( m_actualSelection != wxNOT_FOUND) - { - m_actualSelection -= subCount + 1; - } - } - else if ( (size_t)m_selection >= pagePos ) - { - wxTreeCtrl *tree = GetTreeCtrl(); - - // as selected page is going to be deleted, try to select the next - // sibling if exists, if not then the parent - wxTreeItemId nodeId = tree->GetNextSibling(pageId); - - m_selection = wxNOT_FOUND; - m_actualSelection = wxNOT_FOUND; - - if ( nodeId.IsOk() ) - { - // selecting next siblings - tree->SelectItem(nodeId); - } - else // no next sibling, select the parent - { - wxTreeItemId parentId = tree->GetItemParent(pageId); - - if ( parentId.IsOk() && parentId != tree->GetRootItem() ) - { - tree->SelectItem(parentId); - } - else // parent is root - { - // we can't select it as it's hidden - DoUpdateSelection(false, wxNOT_FOUND); - } - } - } - else if ( m_actualSelection != wxNOT_FOUND && - (size_t)m_actualSelection >= pagePos ) - { - // nothing to do -- selection is before the deleted node, but - // actually shown page (the first (sub)child with page != NULL) is - // already deleted - m_actualSelection = m_selection; - - // send event as documented - DoSetSelection(m_selection, SetSelection_SendEvent); - } - //else: nothing to do -- selection is before the deleted node - } - else - { - DoUpdateSelection(false, wxNOT_FOUND); - } -} - - -void wxTreebook::DoUpdateSelection(bool bSelect, int newPos) -{ - int newSelPos; - if ( bSelect ) - { - newSelPos = newPos; - } - else if ( m_selection == wxNOT_FOUND && DoInternalGetPageCount() > 0 ) - { - newSelPos = 0; - } - else - { - newSelPos = wxNOT_FOUND; - } - - if ( newSelPos != wxNOT_FOUND ) - { - SetSelection((size_t)newSelPos); - } -} - -wxTreeItemId wxTreebook::DoInternalGetPage(size_t pagePos) const -{ - if ( pagePos >= m_treeIds.GetCount() ) - { - // invalid position but ok here, in this internal function, don't assert - // (the caller will do it) - return wxTreeItemId(); - } - - return m_treeIds[pagePos]; -} - -int wxTreebook::DoInternalFindPageById(wxTreeItemId pageId) const -{ - const size_t count = m_treeIds.GetCount(); - for ( size_t i = 0; i < count; ++i ) - { - if ( m_treeIds[i] == pageId ) - return i; - } - - return wxNOT_FOUND; -} - -bool wxTreebook::IsNodeExpanded(size_t pagePos) const -{ - wxTreeItemId pageId = DoInternalGetPage(pagePos); - - wxCHECK_MSG( pageId.IsOk(), false, wxT("invalid tree item") ); - - return GetTreeCtrl()->IsExpanded(pageId); -} - -bool wxTreebook::ExpandNode(size_t pagePos, bool expand) -{ - wxTreeItemId pageId = DoInternalGetPage(pagePos); - - wxCHECK_MSG( pageId.IsOk(), false, wxT("invalid tree item") ); - - if ( expand ) - { - GetTreeCtrl()->Expand( pageId ); - } - else // collapse - { - GetTreeCtrl()->Collapse( pageId ); - - // rely on the events generated by wxTreeCtrl to update selection - } - - return true; -} - -int wxTreebook::GetPageParent(size_t pagePos) const -{ - wxTreeItemId nodeId = DoInternalGetPage( pagePos ); - wxCHECK_MSG( nodeId.IsOk(), wxNOT_FOUND, wxT("Invalid page index spacified!") ); - - const wxTreeItemId parent = GetTreeCtrl()->GetItemParent( nodeId ); - - return parent.IsOk() ? DoInternalFindPageById(parent) : wxNOT_FOUND; -} - -bool wxTreebook::SetPageText(size_t n, const wxString& strText) -{ - wxTreeItemId pageId = DoInternalGetPage(n); - - wxCHECK_MSG( pageId.IsOk(), false, wxT("invalid tree item") ); - - GetTreeCtrl()->SetItemText(pageId, strText); - - return true; -} - -wxString wxTreebook::GetPageText(size_t n) const -{ - wxTreeItemId pageId = DoInternalGetPage(n); - - wxCHECK_MSG( pageId.IsOk(), wxString(), wxT("invalid tree item") ); - - return GetTreeCtrl()->GetItemText(pageId); -} - -int wxTreebook::GetPageImage(size_t n) const -{ - wxTreeItemId pageId = DoInternalGetPage(n); - - wxCHECK_MSG( pageId.IsOk(), wxNOT_FOUND, wxT("invalid tree item") ); - - return GetTreeCtrl()->GetItemImage(pageId); -} - -bool wxTreebook::SetPageImage(size_t n, int imageId) -{ - wxTreeItemId pageId = DoInternalGetPage(n); - - wxCHECK_MSG( pageId.IsOk(), false, wxT("invalid tree item") ); - - GetTreeCtrl()->SetItemImage(pageId, imageId); - - return true; -} - -wxSize wxTreebook::CalcSizeFromPage(const wxSize& sizePage) const -{ - const wxSize sizeTree = GetControllerSize(); - - wxSize size = sizePage; - size.x += sizeTree.x; - - return size; -} - -int wxTreebook::GetSelection() const -{ - return m_selection; -} - -int wxTreebook::DoSetSelection(size_t pagePos, int flags) -{ - wxCHECK_MSG( IS_VALID_PAGE(pagePos), wxNOT_FOUND, - wxT("invalid page index in wxListbook::DoSetSelection()") ); - wxASSERT_MSG( GetPageCount() == DoInternalGetPageCount(), - wxT("wxTreebook logic error: m_treeIds and m_pages not in sync!")); - - wxTreebookEvent event(wxEVT_COMMAND_TREEBOOK_PAGE_CHANGING, m_windowId); - const int oldSel = m_selection; - wxTreeCtrl *tree = GetTreeCtrl(); - bool allowed = false; - - if (flags & SetSelection_SendEvent) - { - event.SetEventObject(this); - event.SetSelection(pagePos); - event.SetOldSelection(m_selection); - - // don't send the event if the old and new pages are the same; do send it - // otherwise and be prepared for it to be vetoed - allowed = (int)pagePos == m_selection || - !GetEventHandler()->ProcessEvent(event) || - event.IsAllowed(); - } - - if ( !(flags & SetSelection_SendEvent) || allowed ) - { - // hide the previously shown page - wxTreebookPage * const oldPage = DoGetCurrentPage(); - if ( oldPage ) - oldPage->Hide(); - - // then show the new one - m_selection = pagePos; - wxTreebookPage *page = wxBookCtrlBase::GetPage(m_selection); - if ( !page ) - { - // find the next page suitable to be shown: the first (grand)child - // of this one with a non-NULL associated page - wxTreeItemId childId = m_treeIds[pagePos]; - int actualPagePos = pagePos; - while ( !page && childId.IsOk() ) - { - wxTreeItemIdValue cookie; - childId = tree->GetFirstChild( childId, cookie ); - if ( childId.IsOk() ) - { - page = wxBookCtrlBase::GetPage(++actualPagePos); - } - } - - m_actualSelection = page ? actualPagePos : m_selection; - } - - if ( page ) - page->Show(); - - tree->SelectItem(DoInternalGetPage(pagePos)); - - if (flags & SetSelection_SendEvent) - { - // notify about the (now completed) page change - event.SetEventType(wxEVT_COMMAND_TREEBOOK_PAGE_CHANGED); - (void)GetEventHandler()->ProcessEvent(event); - } - } - else if ( (flags & SetSelection_SendEvent) && !allowed) // page change vetoed - { - // tree selection might have already had changed - if ( oldSel != wxNOT_FOUND ) - tree->SelectItem(DoInternalGetPage(oldSel)); - } - - return oldSel; -} - -wxTreebookPage *wxTreebook::DoGetCurrentPage() const -{ - if ( m_selection == wxNOT_FOUND ) - return NULL; - - wxTreebookPage *page = wxBookCtrlBase::GetPage(m_selection); - if ( !page && m_actualSelection != wxNOT_FOUND ) - { - page = wxBookCtrlBase::GetPage(m_actualSelection); - } - - return page; -} - -void wxTreebook::SetImageList(wxImageList *imageList) -{ - wxBookCtrlBase::SetImageList(imageList); - GetTreeCtrl()->SetImageList(imageList); -} - -void wxTreebook::AssignImageList(wxImageList *imageList) -{ - wxBookCtrlBase::AssignImageList(imageList); - GetTreeCtrl()->SetImageList(imageList); -} - -// ---------------------------------------------------------------------------- -// event handlers -// ---------------------------------------------------------------------------- - -void wxTreebook::OnTreeSelectionChange(wxTreeEvent& event) -{ - if ( event.GetEventObject() != m_bookctrl ) - { - event.Skip(); - return; - } - - wxTreeItemId newId = event.GetItem(); - - if ( (m_selection == wxNOT_FOUND && - (!newId.IsOk() || newId == GetTreeCtrl()->GetRootItem())) || - (m_selection != wxNOT_FOUND && newId == m_treeIds[m_selection]) ) - { - // this event can only come when we modify the tree selection ourselves - // so we should simply ignore it - return; - } - - int newPos = DoInternalFindPageById(newId); - - if ( newPos != wxNOT_FOUND ) - SetSelection( newPos ); -} - -void wxTreebook::OnTreeNodeExpandedCollapsed(wxTreeEvent & event) -{ - if ( event.GetEventObject() != m_bookctrl ) - { - event.Skip(); - return; - } - - wxTreeItemId nodeId = event.GetItem(); - if ( !nodeId.IsOk() || nodeId == GetTreeCtrl()->GetRootItem() ) - return; - int pagePos = DoInternalFindPageById(nodeId); - wxCHECK_RET( pagePos != wxNOT_FOUND, wxT("Internal problem in wxTreebook!..") ); - - wxTreebookEvent ev(GetTreeCtrl()->IsExpanded(nodeId) - ? wxEVT_COMMAND_TREEBOOK_NODE_EXPANDED - : wxEVT_COMMAND_TREEBOOK_NODE_COLLAPSED, - m_windowId); - - ev.SetSelection(pagePos); - ev.SetOldSelection(pagePos); - ev.SetEventObject(this); - - GetEventHandler()->ProcessEvent(ev); -} - -// ---------------------------------------------------------------------------- -// wxTreebook geometry management -// ---------------------------------------------------------------------------- - -int wxTreebook::HitTest(wxPoint const & pt, long * flags) const -{ - int pagePos = wxNOT_FOUND; - - if ( flags ) - *flags = wxBK_HITTEST_NOWHERE; - - // convert from wxTreebook coorindates to wxTreeCtrl ones - const wxTreeCtrl * const tree = GetTreeCtrl(); - const wxPoint treePt = tree->ScreenToClient(ClientToScreen(pt)); - - // is it over the tree? - if ( wxRect(tree->GetSize()).Contains(treePt) ) - { - int flagsTree; - wxTreeItemId id = tree->HitTest(treePt, flagsTree); - - if ( id.IsOk() && (flagsTree & wxTREE_HITTEST_ONITEM) ) - { - pagePos = DoInternalFindPageById(id); - } - - if ( flags ) - { - if ( pagePos != wxNOT_FOUND ) - *flags = 0; - - if ( flagsTree & (wxTREE_HITTEST_ONITEMBUTTON | - wxTREE_HITTEST_ONITEMICON | - wxTREE_HITTEST_ONITEMSTATEICON) ) - *flags |= wxBK_HITTEST_ONICON; - - if ( flagsTree & wxTREE_HITTEST_ONITEMLABEL ) - *flags |= wxBK_HITTEST_ONLABEL; - } - } - else // not over the tree - { - if ( flags && GetPageRect().Contains( pt ) ) - *flags |= wxBK_HITTEST_ONPAGE; - } - - return pagePos; -} - -#endif // wxUSE_TREEBOOK diff --git a/wxWidgets/src/generic/treectlg.cpp b/wxWidgets/src/generic/treectlg.cpp deleted file mode 100644 index b48f09d746..0000000000 --- a/wxWidgets/src/generic/treectlg.cpp +++ /dev/null @@ -1,3823 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/generic/treectlg.cpp -// Purpose: generic tree control implementation -// Author: Robert Roebling -// Created: 01/02/97 -// Modified: 22/10/98 - almost total rewrite, simpler interface (VZ) -// Id: $Id: treectlg.cpp 67017 2011-02-25 09:37:28Z JS $ -// Copyright: (c) 1998 Robert Roebling and Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// ============================================================================= -// declarations -// ============================================================================= - -// ----------------------------------------------------------------------------- -// headers -// ----------------------------------------------------------------------------- - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_TREECTRL - -#include "wx/treectrl.h" - -#ifndef WX_PRECOMP - #include "wx/dcclient.h" - #include "wx/timer.h" - #include "wx/settings.h" - #include "wx/listbox.h" - #include "wx/textctrl.h" -#endif - -#include "wx/generic/treectlg.h" -#include "wx/imaglist.h" - -#include "wx/renderer.h" - -#ifdef __WXMAC__ - #include "wx/mac/private.h" -#endif - -// ----------------------------------------------------------------------------- -// array types -// ----------------------------------------------------------------------------- - -class WXDLLIMPEXP_FWD_CORE wxGenericTreeItem; - -WX_DEFINE_EXPORTED_ARRAY_PTR(wxGenericTreeItem *, wxArrayGenericTreeItems); - -// ---------------------------------------------------------------------------- -// constants -// ---------------------------------------------------------------------------- - -static const int NO_IMAGE = -1; - -static const int PIXELS_PER_UNIT = 10; - -// the margin between the item image and the item text -static const int MARGIN_BETWEEN_IMAGE_AND_TEXT = 4; - -// ----------------------------------------------------------------------------- -// private classes -// ----------------------------------------------------------------------------- - -// timer used for enabling in-place edit -class WXDLLEXPORT wxTreeRenameTimer: public wxTimer -{ -public: - // start editing the current item after half a second (if the mouse hasn't - // been clicked/moved) - enum { DELAY = 250 }; - - wxTreeRenameTimer( wxGenericTreeCtrl *owner ); - - virtual void Notify(); - -private: - wxGenericTreeCtrl *m_owner; - - DECLARE_NO_COPY_CLASS(wxTreeRenameTimer) -}; - -// control used for in-place edit -class WXDLLEXPORT wxTreeTextCtrl: public wxTextCtrl -{ -public: - wxTreeTextCtrl(wxGenericTreeCtrl *owner, wxGenericTreeItem *item); - - void EndEdit(bool discardChanges); - - const wxGenericTreeItem* item() const { return m_itemEdited; } - -protected: - void OnChar( wxKeyEvent &event ); - void OnKeyUp( wxKeyEvent &event ); - void OnKillFocus( wxFocusEvent &event ); - - bool AcceptChanges(); - void Finish( bool setfocus = true ); - -private: - wxGenericTreeCtrl *m_owner; - wxGenericTreeItem *m_itemEdited; - wxString m_startValue; - bool m_aboutToFinish; - - DECLARE_EVENT_TABLE() - DECLARE_NO_COPY_CLASS(wxTreeTextCtrl) -}; - -// timer used to clear wxGenericTreeCtrl::m_findPrefix if no key was pressed -// for a sufficiently long time -class WXDLLEXPORT wxTreeFindTimer : public wxTimer -{ -public: - // reset the current prefix after half a second of inactivity - enum { DELAY = 500 }; - - wxTreeFindTimer( wxGenericTreeCtrl *owner ) { m_owner = owner; } - - virtual void Notify() { m_owner->m_findPrefix.clear(); } - -private: - wxGenericTreeCtrl *m_owner; - - DECLARE_NO_COPY_CLASS(wxTreeFindTimer) -}; - -// a tree item -class WXDLLEXPORT wxGenericTreeItem -{ -public: - // ctors & dtor - wxGenericTreeItem() { - m_data = NULL; - m_widthText = - m_heightText = -1; - } - - wxGenericTreeItem( wxGenericTreeItem *parent, - const wxString& text, - int image, - int selImage, - wxTreeItemData *data ); - - ~wxGenericTreeItem(); - - // trivial accessors - wxArrayGenericTreeItems& GetChildren() { return m_children; } - - const wxString& GetText() const { return m_text; } - int GetImage(wxTreeItemIcon which = wxTreeItemIcon_Normal) const - { return m_images[which]; } - wxTreeItemData *GetData() const { return m_data; } - - // returns the current image for the item (depending on its - // selected/expanded/whatever state) - int GetCurrentImage() const; - - void SetText(const wxString& text) - { - m_text = text; - - ResetTextSize(); - } - - void SetImage(int image, wxTreeItemIcon which) - { - m_images[which] = image; - m_width = 0; - } - - void SetData(wxTreeItemData *data) { m_data = data; } - - void SetHasPlus(bool has = true) { m_hasPlus = has; } - - void SetBold(bool bold) - { - m_isBold = bold; - - ResetTextSize(); - } - - int GetX() const { return m_x; } - int GetY() const { return m_y; } - - void SetX(int x) { m_x = x; } - void SetY(int y) { m_y = y; } - - int GetHeight() const { return m_height; } - int GetWidth() const { return m_width; } - - int GetTextHeight() const - { - wxASSERT_MSG( m_heightText != -1, _T("must call CalculateSize() first") ); - - return m_heightText; - } - - int GetTextWidth() const - { - wxASSERT_MSG( m_widthText != -1, _T("must call CalculateSize() first") ); - - return m_widthText; - } - - wxGenericTreeItem *GetParent() const { return m_parent; } - - // sets the items font for the specified DC if it uses any special font or - // simply returns false otherwise - bool SetFont(wxGenericTreeCtrl *control, wxDC& dc) const - { - wxFont font; - - wxTreeItemAttr * const attr = GetAttributes(); - if ( attr && attr->HasFont() ) - font = attr->GetFont(); - else if ( IsBold() ) - font = control->m_boldFont; - else - return false; - - dc.SetFont(font); - return true; - } - - // operations - - // deletes all children notifying the treectrl about it - void DeleteChildren(wxGenericTreeCtrl *tree); - - // get count of all children (and grand children if 'recursively') - size_t GetChildrenCount(bool recursively = true) const; - - void Insert(wxGenericTreeItem *child, size_t index) - { m_children.Insert(child, index); } - - // calculate and cache the item size using either the provided DC (which is - // supposed to have wxGenericTreeCtrl::m_normalFont selected into it!) or a - // wxClientDC on the control window - void CalculateSize(wxGenericTreeCtrl *control, wxDC& dc) - { DoCalculateSize(control, dc, true /* dc uses normal font */); } - void CalculateSize(wxGenericTreeCtrl *control); - - void GetSize( int &x, int &y, const wxGenericTreeCtrl* ); - - void ResetSize() { m_width = 0; } - void ResetTextSize() { m_width = 0; m_widthText = -1; } - void RecursiveResetSize(); - void RecursiveResetTextSize(); - - // return the item at given position (or NULL if no item), onButton is - // true if the point belongs to the item's button, otherwise it lies - // on the item's label - wxGenericTreeItem *HitTest( const wxPoint& point, - const wxGenericTreeCtrl *, - int &flags, - int level ); - - void Expand() { m_isCollapsed = false; } - void Collapse() { m_isCollapsed = true; } - - void SetHilight( bool set = true ) { m_hasHilight = set; } - - // status inquiries - bool HasChildren() const { return !m_children.IsEmpty(); } - bool IsSelected() const { return m_hasHilight != 0; } - bool IsExpanded() const { return !m_isCollapsed; } - bool HasPlus() const { return m_hasPlus || HasChildren(); } - bool IsBold() const { return m_isBold != 0; } - - // attributes - // get them - may be NULL - wxTreeItemAttr *GetAttributes() const { return m_attr; } - // get them ensuring that the pointer is not NULL - wxTreeItemAttr& Attr() - { - if ( !m_attr ) - { - m_attr = new wxTreeItemAttr; - m_ownsAttr = true; - } - return *m_attr; - } - // set them - void SetAttributes(wxTreeItemAttr *attr) - { - if ( m_ownsAttr ) delete m_attr; - m_attr = attr; - m_ownsAttr = false; - m_width = 0; - m_widthText = -1; - } - // set them and delete when done - void AssignAttributes(wxTreeItemAttr *attr) - { - SetAttributes(attr); - m_ownsAttr = true; - m_width = 0; - m_widthText = -1; - } - -private: - // calculate the size of this item, i.e. set m_width, m_height and - // m_widthText and m_heightText properly - // - // if dcUsesNormalFont is true, the current dc font must be the normal tree - // control font - void DoCalculateSize(wxGenericTreeCtrl *control, - wxDC& dc, - bool dcUsesNormalFont); - - // since there can be very many of these, we save size by chosing - // the smallest representation for the elements and by ordering - // the members to avoid padding. - wxString m_text; // label to be rendered for item - int m_widthText; - int m_heightText; - - wxTreeItemData *m_data; // user-provided data - - wxArrayGenericTreeItems m_children; // list of children - wxGenericTreeItem *m_parent; // parent of this item - - wxTreeItemAttr *m_attr; // attributes??? - - // tree ctrl images for the normal, selected, expanded and - // expanded+selected states - int m_images[wxTreeItemIcon_Max]; - - wxCoord m_x; // (virtual) offset from top - wxCoord m_y; // (virtual) offset from left - int m_width; // width of this item - int m_height; // height of this item - - // use bitfields to save size - unsigned int m_isCollapsed :1; - unsigned int m_hasHilight :1; // same as focused - unsigned int m_hasPlus :1; // used for item which doesn't have - // children but has a [+] button - unsigned int m_isBold :1; // render the label in bold font - unsigned int m_ownsAttr :1; // delete attribute when done - - DECLARE_NO_COPY_CLASS(wxGenericTreeItem) -}; - -// ============================================================================= -// implementation -// ============================================================================= - -// ---------------------------------------------------------------------------- -// private functions -// ---------------------------------------------------------------------------- - -// translate the key or mouse event flags to the type of selection we're -// dealing with -static void EventFlagsToSelType(long style, - bool shiftDown, - bool ctrlDown, - bool &is_multiple, - bool &extended_select, - bool &unselect_others) -{ - is_multiple = (style & wxTR_MULTIPLE) != 0; - extended_select = shiftDown && is_multiple; - unselect_others = !(extended_select || (ctrlDown && is_multiple)); -} - -// check if the given item is under another one -static bool IsDescendantOf(const wxGenericTreeItem *parent, const wxGenericTreeItem *item) -{ - while ( item ) - { - if ( item == parent ) - { - // item is a descendant of parent - return true; - } - - item = item->GetParent(); - } - - return false; -} - -// ----------------------------------------------------------------------------- -// wxTreeRenameTimer (internal) -// ----------------------------------------------------------------------------- - -wxTreeRenameTimer::wxTreeRenameTimer( wxGenericTreeCtrl *owner ) -{ - m_owner = owner; -} - -void wxTreeRenameTimer::Notify() -{ - m_owner->OnRenameTimer(); -} - -//----------------------------------------------------------------------------- -// wxTreeTextCtrl (internal) -//----------------------------------------------------------------------------- - -BEGIN_EVENT_TABLE(wxTreeTextCtrl,wxTextCtrl) - EVT_CHAR (wxTreeTextCtrl::OnChar) - EVT_KEY_UP (wxTreeTextCtrl::OnKeyUp) - EVT_KILL_FOCUS (wxTreeTextCtrl::OnKillFocus) -END_EVENT_TABLE() - -wxTreeTextCtrl::wxTreeTextCtrl(wxGenericTreeCtrl *owner, - wxGenericTreeItem *item) - : m_itemEdited(item), m_startValue(item->GetText()) -{ - m_owner = owner; - m_aboutToFinish = false; - - int w = m_itemEdited->GetWidth(), - h = m_itemEdited->GetHeight(); - - int x, y; - m_owner->CalcScrolledPosition(item->GetX(), item->GetY(), &x, &y); - - int image_h = 0, - image_w = 0; - - int image = item->GetCurrentImage(); - if ( image != NO_IMAGE ) - { - if ( m_owner->m_imageListNormal ) - { - m_owner->m_imageListNormal->GetSize( image, image_w, image_h ); - image_w += MARGIN_BETWEEN_IMAGE_AND_TEXT; - } - else - { - wxFAIL_MSG(_T("you must create an image list to use images!")); - } - } - - // FIXME: what are all these hardcoded 4, 8 and 11s really? - x += image_w; - w -= image_w + 4; -#ifdef __WXMAC__ - wxSize bs = DoGetBestSize() ; - // edit control height - if ( h > bs.y - 8 ) - { - int diff = h - ( bs.y - 8 ) ; - h -= diff ; - y += diff / 2 ; - } -#endif - - (void)Create(m_owner, wxID_ANY, m_startValue, - wxPoint(x - 4, y - 4), wxSize(w + 11, h + 8)); -} - -void wxTreeTextCtrl::EndEdit(bool discardChanges) -{ - m_aboutToFinish = true; - - if ( discardChanges ) - { - m_owner->OnRenameCancelled(m_itemEdited); - - Finish(); - } - else - { - // Notify the owner about the changes - AcceptChanges(); - - // Even if vetoed, close the control (consistent with MSW) - Finish(); - } -} - -bool wxTreeTextCtrl::AcceptChanges() -{ - const wxString value = GetValue(); - - if ( value == m_startValue ) - { - // nothing changed, always accept - // when an item remains unchanged, the owner - // needs to be notified that the user decided - // not to change the tree item label, and that - // the edit has been cancelled - - m_owner->OnRenameCancelled(m_itemEdited); - return true; - } - - if ( !m_owner->OnRenameAccept(m_itemEdited, value) ) - { - // vetoed by the user - return false; - } - - // accepted, do rename the item - m_owner->SetItemText(m_itemEdited, value); - - return true; -} - -void wxTreeTextCtrl::Finish( bool setfocus ) -{ - m_owner->ResetTextControl(); - - wxPendingDelete.Append(this); - - if (setfocus) - m_owner->SetFocus(); -} - -void wxTreeTextCtrl::OnChar( wxKeyEvent &event ) -{ - switch ( event.m_keyCode ) - { - case WXK_RETURN: - EndEdit( false ); - break; - - case WXK_ESCAPE: - EndEdit( true ); - break; - - default: - event.Skip(); - } -} - -void wxTreeTextCtrl::OnKeyUp( wxKeyEvent &event ) -{ - if ( !m_aboutToFinish ) - { - // auto-grow the textctrl: - wxSize parentSize = m_owner->GetSize(); - wxPoint myPos = GetPosition(); - wxSize mySize = GetSize(); - int sx, sy; - GetTextExtent(GetValue() + _T("M"), &sx, &sy); - if (myPos.x + sx > parentSize.x) - sx = parentSize.x - myPos.x; - if (mySize.x > sx) - sx = mySize.x; - SetSize(sx, wxDefaultCoord); - } - - event.Skip(); -} - -void wxTreeTextCtrl::OnKillFocus( wxFocusEvent &event ) -{ - if ( !m_aboutToFinish ) - { - if ( !AcceptChanges() ) - m_owner->OnRenameCancelled( m_itemEdited ); - - Finish( false ); - } - - // We should let the native text control handle focus, too. - event.Skip(); -} - -// ----------------------------------------------------------------------------- -// wxGenericTreeItem -// ----------------------------------------------------------------------------- - -wxGenericTreeItem::wxGenericTreeItem(wxGenericTreeItem *parent, - const wxString& text, - int image, int selImage, - wxTreeItemData *data) - : m_text(text) -{ - m_images[wxTreeItemIcon_Normal] = image; - m_images[wxTreeItemIcon_Selected] = selImage; - m_images[wxTreeItemIcon_Expanded] = NO_IMAGE; - m_images[wxTreeItemIcon_SelectedExpanded] = NO_IMAGE; - - m_data = data; - m_x = m_y = 0; - - m_isCollapsed = true; - m_hasHilight = false; - m_hasPlus = false; - m_isBold = false; - - m_parent = parent; - - m_attr = (wxTreeItemAttr *)NULL; - m_ownsAttr = false; - - // We don't know the height here yet. - m_width = 0; - m_height = 0; - - m_widthText = -1; - m_heightText = -1; -} - -wxGenericTreeItem::~wxGenericTreeItem() -{ - delete m_data; - - if (m_ownsAttr) delete m_attr; - - wxASSERT_MSG( m_children.IsEmpty(), - wxT("please call DeleteChildren() before deleting the item") ); -} - -void wxGenericTreeItem::DeleteChildren(wxGenericTreeCtrl *tree) -{ - size_t count = m_children.Count(); - for ( size_t n = 0; n < count; n++ ) - { - wxGenericTreeItem *child = m_children[n]; - tree->SendDeleteEvent(child); - - child->DeleteChildren(tree); - if ( child == tree->m_select_me ) - tree->m_select_me = NULL; - delete child; - } - - m_children.Empty(); -} - -size_t wxGenericTreeItem::GetChildrenCount(bool recursively) const -{ - size_t count = m_children.Count(); - if ( !recursively ) - return count; - - size_t total = count; - for (size_t n = 0; n < count; ++n) - { - total += m_children[n]->GetChildrenCount(); - } - - return total; -} - -void wxGenericTreeItem::GetSize( int &x, int &y, - const wxGenericTreeCtrl *theButton ) -{ - int bottomY=m_y+theButton->GetLineHeight(this); - if ( y < bottomY ) y = bottomY; - int width = m_x + m_width; - if ( x < width ) x = width; - - if (IsExpanded()) - { - size_t count = m_children.Count(); - for ( size_t n = 0; n < count; ++n ) - { - m_children[n]->GetSize( x, y, theButton ); - } - } -} - -wxGenericTreeItem *wxGenericTreeItem::HitTest(const wxPoint& point, - const wxGenericTreeCtrl *theCtrl, - int &flags, - int level) -{ - // for a hidden root node, don't evaluate it, but do evaluate children - if ( !(level == 0 && theCtrl->HasFlag(wxTR_HIDE_ROOT)) ) - { - // evaluate the item - int h = theCtrl->GetLineHeight(this); - if ((point.y > m_y) && (point.y < m_y + h)) - { - int y_mid = m_y + h/2; - if (point.y < y_mid ) - flags |= wxTREE_HITTEST_ONITEMUPPERPART; - else - flags |= wxTREE_HITTEST_ONITEMLOWERPART; - - int xCross = m_x - theCtrl->GetSpacing(); -#ifdef __WXMAC__ - // according to the drawing code the triangels are drawn - // at -4 , -4 from the position up to +10/+10 max - if ((point.x > xCross-4) && (point.x < xCross+10) && - (point.y > y_mid-4) && (point.y < y_mid+10) && - HasPlus() && theCtrl->HasButtons() ) -#else - // 5 is the size of the plus sign - if ((point.x > xCross-6) && (point.x < xCross+6) && - (point.y > y_mid-6) && (point.y < y_mid+6) && - HasPlus() && theCtrl->HasButtons() ) -#endif - { - flags |= wxTREE_HITTEST_ONITEMBUTTON; - return this; - } - - if ((point.x >= m_x) && (point.x <= m_x+m_width)) - { - int image_w = -1; - int image_h; - - // assuming every image (normal and selected) has the same size! - if ( (GetImage() != NO_IMAGE) && theCtrl->m_imageListNormal ) - theCtrl->m_imageListNormal->GetSize(GetImage(), - image_w, image_h); - - if ((image_w != -1) && (point.x <= m_x + image_w + 1)) - flags |= wxTREE_HITTEST_ONITEMICON; - else - flags |= wxTREE_HITTEST_ONITEMLABEL; - - return this; - } - - if (point.x < m_x) - flags |= wxTREE_HITTEST_ONITEMINDENT; - if (point.x > m_x+m_width) - flags |= wxTREE_HITTEST_ONITEMRIGHT; - - return this; - } - - // if children are expanded, fall through to evaluate them - if (m_isCollapsed) return (wxGenericTreeItem*) NULL; - } - - // evaluate children - size_t count = m_children.Count(); - for ( size_t n = 0; n < count; n++ ) - { - wxGenericTreeItem *res = m_children[n]->HitTest( point, - theCtrl, - flags, - level + 1 ); - if ( res != NULL ) - return res; - } - - return (wxGenericTreeItem*) NULL; -} - -int wxGenericTreeItem::GetCurrentImage() const -{ - int image = NO_IMAGE; - if ( IsExpanded() ) - { - if ( IsSelected() ) - { - image = GetImage(wxTreeItemIcon_SelectedExpanded); - } - - if ( image == NO_IMAGE ) - { - // we usually fall back to the normal item, but try just the - // expanded one (and not selected) first in this case - image = GetImage(wxTreeItemIcon_Expanded); - } - } - else // not expanded - { - if ( IsSelected() ) - image = GetImage(wxTreeItemIcon_Selected); - } - - // maybe it doesn't have the specific image we want, - // try the default one instead - if ( image == NO_IMAGE ) image = GetImage(); - - return image; -} - -void wxGenericTreeItem::CalculateSize(wxGenericTreeCtrl* control) -{ - // check if we need to do anything before creating the DC - if ( m_width != 0 ) - return; - - wxClientDC dc(control); - DoCalculateSize(control, dc, false /* normal font not used */); -} - -void -wxGenericTreeItem::DoCalculateSize(wxGenericTreeCtrl* control, - wxDC& dc, - bool dcUsesNormalFont) -{ - if ( m_width != 0 ) // Size known, nothing to do - return; - - if ( m_widthText == -1 ) - { - bool fontChanged; - if ( SetFont(control, dc) ) - { - fontChanged = true; - } - else // we have no special font - { - if ( !dcUsesNormalFont ) - { - // but we do need to ensure that the normal font is used: notice - // that this doesn't count as changing the font as we don't need - // to restore it - dc.SetFont(control->m_normalFont); - } - - fontChanged = false; - } - - dc.GetTextExtent( GetText(), &m_widthText, &m_heightText ); - - // restore normal font if the DC used it previously and we changed it - if ( fontChanged ) - dc.SetFont(control->m_normalFont); - } - - int text_h = m_heightText + 2; - - int image_h = 0; - int image_w = 0; - int image = GetCurrentImage(); - if ( image != NO_IMAGE ) - { - if ( control->m_imageListNormal ) - { - control->m_imageListNormal->GetSize( image, image_w, image_h ); - image_w += MARGIN_BETWEEN_IMAGE_AND_TEXT; - } - } - - m_height = (image_h > text_h) ? image_h : text_h; - - if (m_height < 30) - m_height += 2; // at least 2 pixels - else - m_height += m_height / 10; // otherwise 10% extra spacing - - if (m_height > control->m_lineHeight) - control->m_lineHeight = m_height; - - m_width = image_w + m_widthText + 2; -} - -void wxGenericTreeItem::RecursiveResetSize() -{ - m_width = 0; - - const size_t count = m_children.Count(); - for (size_t i = 0; i < count; i++ ) - m_children[i]->RecursiveResetSize(); -} - -void wxGenericTreeItem::RecursiveResetTextSize() -{ - m_width = 0; - m_widthText = -1; - - const size_t count = m_children.Count(); - for (size_t i = 0; i < count; i++ ) - m_children[i]->RecursiveResetTextSize(); -} - -// ----------------------------------------------------------------------------- -// wxGenericTreeCtrl implementation -// ----------------------------------------------------------------------------- - -IMPLEMENT_DYNAMIC_CLASS(wxGenericTreeCtrl, wxControl) - -BEGIN_EVENT_TABLE(wxGenericTreeCtrl, wxTreeCtrlBase) - EVT_PAINT (wxGenericTreeCtrl::OnPaint) - EVT_SIZE (wxGenericTreeCtrl::OnSize) - EVT_MOUSE_EVENTS (wxGenericTreeCtrl::OnMouse) - EVT_CHAR (wxGenericTreeCtrl::OnChar) - EVT_SET_FOCUS (wxGenericTreeCtrl::OnSetFocus) - EVT_KILL_FOCUS (wxGenericTreeCtrl::OnKillFocus) - EVT_TREE_ITEM_GETTOOLTIP(wxID_ANY, wxGenericTreeCtrl::OnGetToolTip) -END_EVENT_TABLE() - -#if !defined(__WXMSW__) || defined(__WXUNIVERSAL__) -/* - * wxTreeCtrl has to be a real class or we have problems with - * the run-time information. - */ - -IMPLEMENT_DYNAMIC_CLASS(wxTreeCtrl, wxGenericTreeCtrl) -#endif - -// ----------------------------------------------------------------------------- -// construction/destruction -// ----------------------------------------------------------------------------- - -void wxGenericTreeCtrl::Init() -{ - m_current = - m_key_current = - m_anchor = - m_select_me = (wxGenericTreeItem *) NULL; - m_hasFocus = false; - m_dirty = false; - - m_lineHeight = 10; - m_indent = 15; - m_spacing = 18; - - m_hilightBrush = new wxBrush - ( - wxSystemSettings::GetColour - ( - wxSYS_COLOUR_HIGHLIGHT - ), - wxSOLID - ); - - m_hilightUnfocusedBrush = new wxBrush - ( - wxSystemSettings::GetColour - ( - wxSYS_COLOUR_BTNSHADOW - ), - wxSOLID - ); - - m_imageListButtons = NULL; - m_ownsImageListButtons = false; - - m_dragCount = 0; - m_isDragging = false; - m_dropTarget = m_oldSelection = NULL; - m_underMouse = NULL; - m_textCtrl = NULL; - - m_renameTimer = NULL; - m_freezeCount = 0; - - m_findTimer = NULL; - - m_dropEffectAboveItem = false; - - m_lastOnSame = false; - -#ifdef __WXMAC_CARBON__ - m_normalFont.MacCreateThemeFont( kThemeViewsFont ) ; -#else - m_normalFont = wxSystemSettings::GetFont( wxSYS_DEFAULT_GUI_FONT ); -#endif - m_boldFont = wxFont(m_normalFont.GetPointSize(), - m_normalFont.GetFamily(), - m_normalFont.GetStyle(), - wxBOLD, - m_normalFont.GetUnderlined(), - m_normalFont.GetFaceName(), - m_normalFont.GetEncoding()); -} - -bool wxGenericTreeCtrl::Create(wxWindow *parent, - wxWindowID id, - const wxPoint& pos, - const wxSize& size, - long style, - const wxValidator& validator, - const wxString& name ) -{ -#ifdef __WXMAC__ - int major,minor; - wxGetOsVersion( &major, &minor ); - - style &= ~wxTR_LINES_AT_ROOT; - style |= wxTR_NO_LINES; - if (major < 10) - style |= wxTR_ROW_LINES; - - if (style == 0 || style & wxTR_DEFAULT_STYLE) - style |= wxTR_FULL_ROW_HIGHLIGHT; - -#endif // __WXMAC__ -#ifdef __WXGTK20__ - style |= wxTR_NO_LINES; -#endif - - if ( !wxControl::Create( parent, id, pos, size, - style|wxHSCROLL|wxVSCROLL, - validator, - name ) ) - return false; - - // If the tree display has no buttons, but does have - // connecting lines, we can use a narrower layout. - // It may not be a good idea to force this... - if (!HasButtons() && !HasFlag(wxTR_NO_LINES)) - { - m_indent= 10; - m_spacing = 10; - } - - wxVisualAttributes attr = GetDefaultAttributes(); - SetOwnForegroundColour( attr.colFg ); - SetOwnBackgroundColour( attr.colBg ); - if (!m_hasFont) - SetOwnFont(attr.font); - - m_dottedPen = wxPen( wxT("grey"), 0, 0 ); - - SetInitialSize(size); - - return true; -} - -wxGenericTreeCtrl::~wxGenericTreeCtrl() -{ - delete m_hilightBrush; - delete m_hilightUnfocusedBrush; - - DeleteAllItems(); - - delete m_renameTimer; - delete m_findTimer; - - if (m_ownsImageListButtons) - delete m_imageListButtons; -} - -// ----------------------------------------------------------------------------- -// accessors -// ----------------------------------------------------------------------------- - -unsigned int wxGenericTreeCtrl::GetCount() const -{ - if ( !m_anchor ) - { - // the tree is empty - return 0; - } - - unsigned int count = m_anchor->GetChildrenCount(); - if ( !HasFlag(wxTR_HIDE_ROOT) ) - { - // take the root itself into account - count++; - } - - return count; -} - -void wxGenericTreeCtrl::SetIndent(unsigned int indent) -{ - m_indent = (unsigned short) indent; - m_dirty = true; -} - -size_t -wxGenericTreeCtrl::GetChildrenCount(const wxTreeItemId& item, - bool recursively) const -{ - wxCHECK_MSG( item.IsOk(), 0u, wxT("invalid tree item") ); - - return ((wxGenericTreeItem*) item.m_pItem)->GetChildrenCount(recursively); -} - -void wxGenericTreeCtrl::SetWindowStyle(const long styles) -{ - // Do not try to expand the root node if it hasn't been created yet - if (m_anchor && !HasFlag(wxTR_HIDE_ROOT) && (styles & wxTR_HIDE_ROOT)) - { - // if we will hide the root, make sure children are visible - m_anchor->SetHasPlus(); - m_anchor->Expand(); - CalculatePositions(); - } - - // right now, just sets the styles. Eventually, we may - // want to update the inherited styles, but right now - // none of the parents has updatable styles - m_windowStyle = styles; - m_dirty = true; -} - -// ----------------------------------------------------------------------------- -// functions to work with tree items -// ----------------------------------------------------------------------------- - -wxString wxGenericTreeCtrl::GetItemText(const wxTreeItemId& item) const -{ - wxCHECK_MSG( item.IsOk(), wxEmptyString, wxT("invalid tree item") ); - - return ((wxGenericTreeItem*) item.m_pItem)->GetText(); -} - -int wxGenericTreeCtrl::GetItemImage(const wxTreeItemId& item, - wxTreeItemIcon which) const -{ - wxCHECK_MSG( item.IsOk(), -1, wxT("invalid tree item") ); - - return ((wxGenericTreeItem*) item.m_pItem)->GetImage(which); -} - -wxTreeItemData *wxGenericTreeCtrl::GetItemData(const wxTreeItemId& item) const -{ - wxCHECK_MSG( item.IsOk(), NULL, wxT("invalid tree item") ); - - return ((wxGenericTreeItem*) item.m_pItem)->GetData(); -} - -wxColour wxGenericTreeCtrl::GetItemTextColour(const wxTreeItemId& item) const -{ - wxCHECK_MSG( item.IsOk(), wxNullColour, wxT("invalid tree item") ); - - wxGenericTreeItem *pItem = (wxGenericTreeItem*) item.m_pItem; - return pItem->Attr().GetTextColour(); -} - -wxColour wxGenericTreeCtrl::GetItemBackgroundColour(const wxTreeItemId& item) const -{ - wxCHECK_MSG( item.IsOk(), wxNullColour, wxT("invalid tree item") ); - - wxGenericTreeItem *pItem = (wxGenericTreeItem*) item.m_pItem; - return pItem->Attr().GetBackgroundColour(); -} - -wxFont wxGenericTreeCtrl::GetItemFont(const wxTreeItemId& item) const -{ - wxCHECK_MSG( item.IsOk(), wxNullFont, wxT("invalid tree item") ); - - wxGenericTreeItem *pItem = (wxGenericTreeItem*) item.m_pItem; - return pItem->Attr().GetFont(); -} - -void wxGenericTreeCtrl::SetItemText(const wxTreeItemId& item, const wxString& text) -{ - wxCHECK_RET( item.IsOk(), wxT("invalid tree item") ); - - wxGenericTreeItem *pItem = (wxGenericTreeItem*) item.m_pItem; - pItem->SetText(text); - pItem->CalculateSize(this); - RefreshLine(pItem); -} - -void wxGenericTreeCtrl::SetItemImage(const wxTreeItemId& item, - int image, - wxTreeItemIcon which) -{ - wxCHECK_RET( item.IsOk(), wxT("invalid tree item") ); - - wxGenericTreeItem *pItem = (wxGenericTreeItem*) item.m_pItem; - pItem->SetImage(image, which); - pItem->CalculateSize(this); - RefreshLine(pItem); -} - -void wxGenericTreeCtrl::SetItemData(const wxTreeItemId& item, wxTreeItemData *data) -{ - wxCHECK_RET( item.IsOk(), wxT("invalid tree item") ); - - if (data) - data->SetId( item ); - - ((wxGenericTreeItem*) item.m_pItem)->SetData(data); -} - -void wxGenericTreeCtrl::SetItemHasChildren(const wxTreeItemId& item, bool has) -{ - wxCHECK_RET( item.IsOk(), wxT("invalid tree item") ); - - wxGenericTreeItem *pItem = (wxGenericTreeItem*) item.m_pItem; - pItem->SetHasPlus(has); - RefreshLine(pItem); -} - -void wxGenericTreeCtrl::SetItemBold(const wxTreeItemId& item, bool bold) -{ - wxCHECK_RET( item.IsOk(), wxT("invalid tree item") ); - - // avoid redrawing the tree if no real change - wxGenericTreeItem *pItem = (wxGenericTreeItem*) item.m_pItem; - if ( pItem->IsBold() != bold ) - { - pItem->SetBold(bold); - - // recalculate the item size as bold and non bold fonts have different - // widths - pItem->CalculateSize(this); - } -} - -void wxGenericTreeCtrl::SetItemDropHighlight(const wxTreeItemId& item, - bool highlight) -{ - wxCHECK_RET( item.IsOk(), wxT("invalid tree item") ); - - wxColour fg, bg; - - if (highlight) - { - bg = wxSystemSettings::GetColour(wxSYS_COLOUR_HIGHLIGHT); - fg = wxSystemSettings::GetColour(wxSYS_COLOUR_HIGHLIGHTTEXT); - } - - wxGenericTreeItem *pItem = (wxGenericTreeItem*) item.m_pItem; - pItem->Attr().SetTextColour(fg); - pItem->Attr().SetBackgroundColour(bg); - RefreshLine(pItem); -} - -void wxGenericTreeCtrl::SetItemTextColour(const wxTreeItemId& item, - const wxColour& col) -{ - wxCHECK_RET( item.IsOk(), wxT("invalid tree item") ); - - wxGenericTreeItem *pItem = (wxGenericTreeItem*) item.m_pItem; - pItem->Attr().SetTextColour(col); - RefreshLine(pItem); -} - -void wxGenericTreeCtrl::SetItemBackgroundColour(const wxTreeItemId& item, - const wxColour& col) -{ - wxCHECK_RET( item.IsOk(), wxT("invalid tree item") ); - - wxGenericTreeItem *pItem = (wxGenericTreeItem*) item.m_pItem; - pItem->Attr().SetBackgroundColour(col); - RefreshLine(pItem); -} - -void wxGenericTreeCtrl::SetItemFont(const wxTreeItemId& item, const wxFont& font) -{ - wxCHECK_RET( item.IsOk(), wxT("invalid tree item") ); - - wxGenericTreeItem *pItem = (wxGenericTreeItem*) item.m_pItem; - pItem->Attr().SetFont(font); - pItem->ResetTextSize(); - pItem->CalculateSize(this); - RefreshLine(pItem); -} - -bool wxGenericTreeCtrl::SetFont( const wxFont &font ) -{ - wxTreeCtrlBase::SetFont(font); - - m_normalFont = font ; - m_boldFont = wxFont(m_normalFont.GetPointSize(), - m_normalFont.GetFamily(), - m_normalFont.GetStyle(), - wxBOLD, - m_normalFont.GetUnderlined(), - m_normalFont.GetFaceName(), - m_normalFont.GetEncoding()); - - if (m_anchor) - m_anchor->RecursiveResetTextSize(); - - return true; -} - - -// ----------------------------------------------------------------------------- -// item status inquiries -// ----------------------------------------------------------------------------- - -bool wxGenericTreeCtrl::IsVisible(const wxTreeItemId& item) const -{ - wxCHECK_MSG( item.IsOk(), false, wxT("invalid tree item") ); - - // An item is only visible if it's not a descendant of a collapsed item - wxGenericTreeItem *pItem = (wxGenericTreeItem*) item.m_pItem; - wxGenericTreeItem* parent = pItem->GetParent(); - while (parent) - { - if (!parent->IsExpanded()) - return false; - parent = parent->GetParent(); - } - - int startX, startY; - GetViewStart(& startX, & startY); - - wxSize clientSize = GetClientSize(); - - wxRect rect; - if (!GetBoundingRect(item, rect)) - return false; - if (rect.GetWidth() == 0 || rect.GetHeight() == 0) - return false; - if (rect.GetBottom() < 0 || rect.GetTop() > clientSize.y) - return false; - if (rect.GetRight() < 0 || rect.GetLeft() > clientSize.x) - return false; - - return true; -} - -bool wxGenericTreeCtrl::ItemHasChildren(const wxTreeItemId& item) const -{ - wxCHECK_MSG( item.IsOk(), false, wxT("invalid tree item") ); - - // consider that the item does have children if it has the "+" button: it - // might not have them (if it had never been expanded yet) but then it - // could have them as well and it's better to err on this side rather than - // disabling some operations which are restricted to the items with - // children for an item which does have them - return ((wxGenericTreeItem*) item.m_pItem)->HasPlus(); -} - -bool wxGenericTreeCtrl::IsExpanded(const wxTreeItemId& item) const -{ - wxCHECK_MSG( item.IsOk(), false, wxT("invalid tree item") ); - - return ((wxGenericTreeItem*) item.m_pItem)->IsExpanded(); -} - -bool wxGenericTreeCtrl::IsSelected(const wxTreeItemId& item) const -{ - wxCHECK_MSG( item.IsOk(), false, wxT("invalid tree item") ); - - return ((wxGenericTreeItem*) item.m_pItem)->IsSelected(); -} - -bool wxGenericTreeCtrl::IsBold(const wxTreeItemId& item) const -{ - wxCHECK_MSG( item.IsOk(), false, wxT("invalid tree item") ); - - return ((wxGenericTreeItem*) item.m_pItem)->IsBold(); -} - -// ----------------------------------------------------------------------------- -// navigation -// ----------------------------------------------------------------------------- - -wxTreeItemId wxGenericTreeCtrl::GetItemParent(const wxTreeItemId& item) const -{ - wxCHECK_MSG( item.IsOk(), wxTreeItemId(), wxT("invalid tree item") ); - - return ((wxGenericTreeItem*) item.m_pItem)->GetParent(); -} - -wxTreeItemId wxGenericTreeCtrl::GetFirstChild(const wxTreeItemId& item, - wxTreeItemIdValue& cookie) const -{ - wxCHECK_MSG( item.IsOk(), wxTreeItemId(), wxT("invalid tree item") ); - - cookie = 0; - return GetNextChild(item, cookie); -} - -wxTreeItemId wxGenericTreeCtrl::GetNextChild(const wxTreeItemId& item, - wxTreeItemIdValue& cookie) const -{ - wxCHECK_MSG( item.IsOk(), wxTreeItemId(), wxT("invalid tree item") ); - - wxArrayGenericTreeItems& children = ((wxGenericTreeItem*) item.m_pItem)->GetChildren(); - - // it's ok to cast cookie to size_t, we never have indices big enough to - // overflow "void *" - size_t *pIndex = (size_t *)&cookie; - if ( *pIndex < children.Count() ) - { - return children.Item((*pIndex)++); - } - else - { - // there are no more of them - return wxTreeItemId(); - } -} - -#if WXWIN_COMPATIBILITY_2_4 - -wxTreeItemId wxGenericTreeCtrl::GetFirstChild(const wxTreeItemId& item, - long& cookie) const -{ - wxCHECK_MSG( item.IsOk(), wxTreeItemId(), wxT("invalid tree item") ); - - cookie = 0; - return GetNextChild(item, cookie); -} - -wxTreeItemId wxGenericTreeCtrl::GetNextChild(const wxTreeItemId& item, - long& cookie) const -{ - wxCHECK_MSG( item.IsOk(), wxTreeItemId(), wxT("invalid tree item") ); - - wxArrayGenericTreeItems& children = ((wxGenericTreeItem*) item.m_pItem)->GetChildren(); - if ( (size_t)cookie < children.Count() ) - { - return children.Item((size_t)cookie++); - } - else - { - // there are no more of them - return wxTreeItemId(); - } -} - -#endif // WXWIN_COMPATIBILITY_2_4 - -wxTreeItemId wxGenericTreeCtrl::GetLastChild(const wxTreeItemId& item) const -{ - wxCHECK_MSG( item.IsOk(), wxTreeItemId(), wxT("invalid tree item") ); - - wxArrayGenericTreeItems& children = ((wxGenericTreeItem*) item.m_pItem)->GetChildren(); - return (children.IsEmpty() ? wxTreeItemId() : wxTreeItemId(children.Last())); -} - -wxTreeItemId wxGenericTreeCtrl::GetNextSibling(const wxTreeItemId& item) const -{ - wxCHECK_MSG( item.IsOk(), wxTreeItemId(), wxT("invalid tree item") ); - - wxGenericTreeItem *i = (wxGenericTreeItem*) item.m_pItem; - wxGenericTreeItem *parent = i->GetParent(); - if ( parent == NULL ) - { - // root item doesn't have any siblings - return wxTreeItemId(); - } - - wxArrayGenericTreeItems& siblings = parent->GetChildren(); - int index = siblings.Index(i); - wxASSERT( index != wxNOT_FOUND ); // I'm not a child of my parent? - - size_t n = (size_t)(index + 1); - return n == siblings.Count() ? wxTreeItemId() : wxTreeItemId(siblings[n]); -} - -wxTreeItemId wxGenericTreeCtrl::GetPrevSibling(const wxTreeItemId& item) const -{ - wxCHECK_MSG( item.IsOk(), wxTreeItemId(), wxT("invalid tree item") ); - - wxGenericTreeItem *i = (wxGenericTreeItem*) item.m_pItem; - wxGenericTreeItem *parent = i->GetParent(); - if ( parent == NULL ) - { - // root item doesn't have any siblings - return wxTreeItemId(); - } - - wxArrayGenericTreeItems& siblings = parent->GetChildren(); - int index = siblings.Index(i); - wxASSERT( index != wxNOT_FOUND ); // I'm not a child of my parent? - - return index == 0 ? wxTreeItemId() - : wxTreeItemId(siblings[(size_t)(index - 1)]); -} - -// Only for internal use right now, but should probably be public -wxTreeItemId wxGenericTreeCtrl::GetNext(const wxTreeItemId& item) const -{ - wxCHECK_MSG( item.IsOk(), wxTreeItemId(), wxT("invalid tree item") ); - - wxGenericTreeItem *i = (wxGenericTreeItem*) item.m_pItem; - - // First see if there are any children. - wxArrayGenericTreeItems& children = i->GetChildren(); - if (children.GetCount() > 0) - { - return children.Item(0); - } - else - { - // Try a sibling of this or ancestor instead - wxTreeItemId p = item; - wxTreeItemId toFind; - do - { - toFind = GetNextSibling(p); - p = GetItemParent(p); - } while (p.IsOk() && !toFind.IsOk()); - return toFind; - } -} - -wxTreeItemId wxGenericTreeCtrl::GetFirstVisibleItem() const -{ - wxTreeItemId id = GetRootItem(); - if (!id.IsOk()) - return id; - - do - { - if (IsVisible(id)) - return id; - id = GetNext(id); - } while (id.IsOk()); - - return wxTreeItemId(); -} - -wxTreeItemId wxGenericTreeCtrl::GetNextVisible(const wxTreeItemId& item) const -{ - wxCHECK_MSG( item.IsOk(), wxTreeItemId(), wxT("invalid tree item") ); - - wxTreeItemId id = item; - if (id.IsOk()) - { - while (id = GetNext(id), id.IsOk()) - { - if (IsVisible(id)) - return id; - } - } - return wxTreeItemId(); -} - -wxTreeItemId wxGenericTreeCtrl::GetPrevVisible(const wxTreeItemId& item) const -{ - wxCHECK_MSG( item.IsOk(), wxTreeItemId(), wxT("invalid tree item") ); - - wxFAIL_MSG(wxT("not implemented")); - - return wxTreeItemId(); -} - -// called by wxTextTreeCtrl when it marks itself for deletion -void wxGenericTreeCtrl::ResetTextControl() -{ - m_textCtrl = NULL; -} - -// find the first item starting with the given prefix after the given item -wxTreeItemId wxGenericTreeCtrl::FindItem(const wxTreeItemId& idParent, - const wxString& prefixOrig) const -{ - // match is case insensitive as this is more convenient to the user: having - // to press Shift-letter to go to the item starting with a capital letter - // would be too bothersome - wxString prefix = prefixOrig.Lower(); - - // determine the starting point: we shouldn't take the current item (this - // allows to switch between two items starting with the same letter just by - // pressing it) but we shouldn't jump to the next one if the user is - // continuing to type as otherwise he might easily skip the item he wanted - wxTreeItemId id = idParent; - if ( prefix.length() == 1 ) - { - id = GetNext(id); - } - - // look for the item starting with the given prefix after it - while ( id.IsOk() && !GetItemText(id).Lower().StartsWith(prefix) ) - { - id = GetNext(id); - } - - // if we haven't found anything... - if ( !id.IsOk() ) - { - // ... wrap to the beginning - id = GetRootItem(); - if ( HasFlag(wxTR_HIDE_ROOT) ) - { - // can't select virtual root - id = GetNext(id); - } - - // and try all the items (stop when we get to the one we started from) - while (id.IsOk() && id != idParent && !GetItemText(id).Lower().StartsWith(prefix) ) - { - id = GetNext(id); - } - // If we haven't found the item, id.IsOk() will be false, as per - // documentation - } - - return id; -} - -// ----------------------------------------------------------------------------- -// operations -// ----------------------------------------------------------------------------- - -wxTreeItemId wxGenericTreeCtrl::DoInsertItem(const wxTreeItemId& parentId, - size_t previous, - const wxString& text, - int image, - int selImage, - wxTreeItemData *data) -{ - wxGenericTreeItem *parent = (wxGenericTreeItem*) parentId.m_pItem; - if ( !parent ) - { - // should we give a warning here? - return AddRoot(text, image, selImage, data); - } - - m_dirty = true; // do this first so stuff below doesn't cause flicker - - wxGenericTreeItem *item = - new wxGenericTreeItem( parent, text, image, selImage, data ); - - if ( data != NULL ) - { - data->m_pItem = item; - } - - parent->Insert( item, previous == (size_t)-1 ? parent->GetChildren().size() - : previous ); - - InvalidateBestSize(); - return item; -} - -wxTreeItemId wxGenericTreeCtrl::AddRoot(const wxString& text, - int image, - int selImage, - wxTreeItemData *data) -{ - wxCHECK_MSG( !m_anchor, wxTreeItemId(), wxT("tree can have only one root") ); - - m_dirty = true; // do this first so stuff below doesn't cause flicker - - m_anchor = new wxGenericTreeItem((wxGenericTreeItem *)NULL, text, - image, selImage, data); - if ( data != NULL ) - { - data->m_pItem = m_anchor; - } - - if (HasFlag(wxTR_HIDE_ROOT)) - { - // if root is hidden, make sure we can navigate - // into children - m_anchor->SetHasPlus(); - m_anchor->Expand(); - } - CalculatePositions(); - - if (!HasFlag(wxTR_MULTIPLE)) - { - m_current = m_key_current = m_anchor; - m_current->SetHilight( true ); - } - - InvalidateBestSize(); - return m_anchor; -} - -wxTreeItemId wxGenericTreeCtrl::DoInsertAfter(const wxTreeItemId& parentId, - const wxTreeItemId& idPrevious, - const wxString& text, - int image, int selImage, - wxTreeItemData *data) -{ - wxGenericTreeItem *parent = (wxGenericTreeItem*) parentId.m_pItem; - if ( !parent ) - { - // should we give a warning here? - return AddRoot(text, image, selImage, data); - } - - int index = -1; - if (idPrevious.IsOk()) - { - index = parent->GetChildren().Index((wxGenericTreeItem*) idPrevious.m_pItem); - wxASSERT_MSG( index != wxNOT_FOUND, - wxT("previous item in wxGenericTreeCtrl::InsertItem() is not a sibling") ); - } - - return DoInsertItem(parentId, (size_t)++index, text, image, selImage, data); -} - - -void wxGenericTreeCtrl::SendDeleteEvent(wxGenericTreeItem *item) -{ - wxTreeEvent event(wxEVT_COMMAND_TREE_DELETE_ITEM, this, item); - ProcessEvent( event ); -} - -// Don't leave edit or selection on a child which is about to disappear -void wxGenericTreeCtrl::ChildrenClosing(wxGenericTreeItem* item) -{ - if (m_textCtrl != NULL && item != m_textCtrl->item() && IsDescendantOf(item, m_textCtrl->item())) { - m_textCtrl->EndEdit( true ); - } - if (item != m_key_current && IsDescendantOf(item, m_key_current)) { - m_key_current = NULL; - } - if (IsDescendantOf(item, m_select_me)) { - m_select_me = item; - } - if (item != m_current && IsDescendantOf(item, m_current)) { - m_current->SetHilight( false ); - m_current = NULL; - m_select_me = item; - } -} - -void wxGenericTreeCtrl::DeleteChildren(const wxTreeItemId& itemId) -{ - m_dirty = true; // do this first so stuff below doesn't cause flicker - - wxGenericTreeItem *item = (wxGenericTreeItem*) itemId.m_pItem; - ChildrenClosing(item); - item->DeleteChildren(this); - InvalidateBestSize(); -} - -void wxGenericTreeCtrl::Delete(const wxTreeItemId& itemId) -{ - m_dirty = true; // do this first so stuff below doesn't cause flicker - - wxGenericTreeItem *item = (wxGenericTreeItem*) itemId.m_pItem; - - if (m_textCtrl != NULL && IsDescendantOf(item, m_textCtrl->item())) - { - // can't delete the item being edited, cancel editing it first - m_textCtrl->EndEdit( true ); - } - - wxGenericTreeItem *parent = item->GetParent(); - - // don't keep stale pointers around! - if ( IsDescendantOf(item, m_key_current) ) - { - // Don't silently change the selection: - // do it properly in idle time, so event - // handlers get called. - - // m_key_current = parent; - m_key_current = NULL; - } - - // m_select_me records whether we need to select - // a different item, in idle time. - if ( m_select_me && IsDescendantOf(item, m_select_me) ) - { - m_select_me = parent; - } - - if ( IsDescendantOf(item, m_current) ) - { - // Don't silently change the selection: - // do it properly in idle time, so event - // handlers get called. - - // m_current = parent; - m_current = NULL; - m_select_me = parent; - } - - // remove the item from the tree - if ( parent ) - { - parent->GetChildren().Remove( item ); // remove by value - } - else // deleting the root - { - // nothing will be left in the tree - m_anchor = NULL; - } - - // and delete all of its children and the item itself now - item->DeleteChildren(this); - SendDeleteEvent(item); - - if (item == m_select_me) - m_select_me = NULL; - - delete item; - - InvalidateBestSize(); -} - -void wxGenericTreeCtrl::DeleteAllItems() -{ - if ( m_anchor ) - { - Delete(m_anchor); - } -} - -void wxGenericTreeCtrl::Expand(const wxTreeItemId& itemId) -{ - wxGenericTreeItem *item = (wxGenericTreeItem*) itemId.m_pItem; - - wxCHECK_RET( item, _T("invalid item in wxGenericTreeCtrl::Expand") ); - wxCHECK_RET( !HasFlag(wxTR_HIDE_ROOT) || itemId != GetRootItem(), - _T("can't expand hidden root") ); - - if ( !item->HasPlus() ) - return; - - if ( item->IsExpanded() ) - return; - - wxTreeEvent event(wxEVT_COMMAND_TREE_ITEM_EXPANDING, this, item); - - if ( ProcessEvent( event ) && !event.IsAllowed() ) - { - // cancelled by program - return; - } - - item->Expand(); - CalculatePositions(); - - RefreshSubtree(item); - - event.SetEventType(wxEVT_COMMAND_TREE_ITEM_EXPANDED); - ProcessEvent( event ); -} - -void wxGenericTreeCtrl::Collapse(const wxTreeItemId& itemId) -{ - wxCHECK_RET( !HasFlag(wxTR_HIDE_ROOT) || itemId != GetRootItem(), - _T("can't collapse hidden root") ); - - wxGenericTreeItem *item = (wxGenericTreeItem*) itemId.m_pItem; - - if ( !item->IsExpanded() ) - return; - - wxTreeEvent event(wxEVT_COMMAND_TREE_ITEM_COLLAPSING, this, item); - if ( ProcessEvent( event ) && !event.IsAllowed() ) - { - // cancelled by program - return; - } - - ChildrenClosing(item); - item->Collapse(); - -#if 0 // TODO why should items be collapsed recursively? - wxArrayGenericTreeItems& children = item->GetChildren(); - size_t count = children.Count(); - for ( size_t n = 0; n < count; n++ ) - { - Collapse(children[n]); - } -#endif - - CalculatePositions(); - - RefreshSubtree(item); - - event.SetEventType(wxEVT_COMMAND_TREE_ITEM_COLLAPSED); - ProcessEvent( event ); -} - -void wxGenericTreeCtrl::CollapseAndReset(const wxTreeItemId& item) -{ - Collapse(item); - DeleteChildren(item); -} - -void wxGenericTreeCtrl::Toggle(const wxTreeItemId& itemId) -{ - wxGenericTreeItem *item = (wxGenericTreeItem*) itemId.m_pItem; - - if (item->IsExpanded()) - Collapse(itemId); - else - Expand(itemId); -} - -void wxGenericTreeCtrl::Unselect() -{ - if (m_current) - { - m_current->SetHilight( false ); - RefreshLine( m_current ); - - m_current = NULL; - m_select_me = NULL; - } -} - -void wxGenericTreeCtrl::UnselectAllChildren(wxGenericTreeItem *item) -{ - if (item->IsSelected()) - { - item->SetHilight(false); - RefreshLine(item); - } - - if (item->HasChildren()) - { - wxArrayGenericTreeItems& children = item->GetChildren(); - size_t count = children.Count(); - for ( size_t n = 0; n < count; ++n ) - { - UnselectAllChildren(children[n]); - } - } -} - -void wxGenericTreeCtrl::UnselectAll() -{ - wxTreeItemId rootItem = GetRootItem(); - - // the tree might not have the root item at all - if ( rootItem ) - { - UnselectAllChildren((wxGenericTreeItem*) rootItem.m_pItem); - } -} - -// Recursive function ! -// To stop we must have crt_itemGetParent(); - - if (parent == NULL) // This is root item - return TagAllChildrenUntilLast(crt_item, last_item, select); - - wxArrayGenericTreeItems& children = parent->GetChildren(); - int index = children.Index(crt_item); - wxASSERT( index != wxNOT_FOUND ); // I'm not a child of my parent? - - size_t count = children.Count(); - for (size_t n=(size_t)(index+1); nSetHilight(select); - RefreshLine(crt_item); - - if (crt_item==last_item) - return true; - - if (crt_item->HasChildren()) - { - wxArrayGenericTreeItems& children = crt_item->GetChildren(); - size_t count = children.Count(); - for ( size_t n = 0; n < count; ++n ) - { - if (TagAllChildrenUntilLast(children[n], last_item, select)) - return true; - } - } - - return false; -} - -void wxGenericTreeCtrl::SelectItemRange(wxGenericTreeItem *item1, wxGenericTreeItem *item2) -{ - m_select_me = NULL; - - // item2 is not necessary after item1 - // choice first' and 'last' between item1 and item2 - wxGenericTreeItem *first= (item1->GetY()GetY()) ? item1 : item2; - wxGenericTreeItem *last = (item1->GetY()GetY()) ? item2 : item1; - - bool select = m_current->IsSelected(); - - if ( TagAllChildrenUntilLast(first,last,select) ) - return; - - TagNextChildren(first,last,select); -} - -void wxGenericTreeCtrl::DoSelectItem(const wxTreeItemId& itemId, - bool unselect_others, - bool extended_select) -{ - wxCHECK_RET( itemId.IsOk(), wxT("invalid tree item") ); - - m_select_me = NULL; - - bool is_single=!(GetWindowStyleFlag() & wxTR_MULTIPLE); - wxGenericTreeItem *item = (wxGenericTreeItem*) itemId.m_pItem; - - //wxCHECK_RET( ( (!unselect_others) && is_single), - // wxT("this is a single selection tree") ); - - // to keep going anyhow !!! - if (is_single) - { - if (item->IsSelected()) - return; // nothing to do - unselect_others = true; - extended_select = false; - } - else if ( unselect_others && item->IsSelected() ) - { - // selection change if there is more than one item currently selected - wxArrayTreeItemIds selected_items; - if ( GetSelections(selected_items) == 1 ) - return; - } - - wxTreeEvent event(wxEVT_COMMAND_TREE_SEL_CHANGING, this, item); - event.m_itemOld = m_current; - // TODO : Here we don't send any selection mode yet ! - - if ( GetEventHandler()->ProcessEvent( event ) && !event.IsAllowed() ) - return; - - wxTreeItemId parent = GetItemParent( itemId ); - while (parent.IsOk()) - { - if (!IsExpanded(parent)) - Expand( parent ); - - parent = GetItemParent( parent ); - } - - // ctrl press - if (unselect_others) - { - if (is_single) Unselect(); // to speed up thing - else UnselectAll(); - } - - // shift press - if (extended_select) - { - if ( !m_current ) - { - m_current = m_key_current = (wxGenericTreeItem*) GetRootItem().m_pItem; - } - - // don't change the mark (m_current) - SelectItemRange(m_current, item); - } - else - { - bool select = true; // the default - - // Check if we need to toggle hilight (ctrl mode) - if (!unselect_others) - select=!item->IsSelected(); - - m_current = m_key_current = item; - m_current->SetHilight(select); - RefreshLine( m_current ); - } - - // This can cause idle processing to select the root - // if no item is selected, so it must be after the - // selection is set - EnsureVisible( itemId ); - - event.SetEventType(wxEVT_COMMAND_TREE_SEL_CHANGED); - GetEventHandler()->ProcessEvent( event ); -} - -void wxGenericTreeCtrl::SelectItem(const wxTreeItemId& itemId, bool select) -{ - wxGenericTreeItem * const item = (wxGenericTreeItem*) itemId.m_pItem; - wxCHECK_RET( item, wxT("SelectItem(): invalid tree item") ); - - if ( select ) - { - if (!item->IsSelected()) - DoSelectItem(itemId, !HasFlag(wxTR_MULTIPLE)); - } - else // deselect - { - wxTreeEvent event(wxEVT_COMMAND_TREE_SEL_CHANGING, this, item); - if ( GetEventHandler()->ProcessEvent( event ) && !event.IsAllowed() ) - return; - - item->SetHilight(false); - RefreshLine(item); - - event.SetEventType(wxEVT_COMMAND_TREE_SEL_CHANGED); - GetEventHandler()->ProcessEvent( event ); - } -} - -void wxGenericTreeCtrl::FillArray(wxGenericTreeItem *item, - wxArrayTreeItemIds &array) const -{ - if ( item->IsSelected() ) - array.Add(wxTreeItemId(item)); - - if ( item->HasChildren() ) - { - wxArrayGenericTreeItems& children = item->GetChildren(); - size_t count = children.GetCount(); - for ( size_t n = 0; n < count; ++n ) - FillArray(children[n], array); - } -} - -size_t wxGenericTreeCtrl::GetSelections(wxArrayTreeItemIds &array) const -{ - array.Empty(); - wxTreeItemId idRoot = GetRootItem(); - if ( idRoot.IsOk() ) - { - FillArray((wxGenericTreeItem*) idRoot.m_pItem, array); - } - //else: the tree is empty, so no selections - - return array.Count(); -} - -void wxGenericTreeCtrl::EnsureVisible(const wxTreeItemId& item) -{ - wxCHECK_RET( item.IsOk(), wxT("invalid tree item") ); - - if (!item.IsOk()) return; - - wxGenericTreeItem *gitem = (wxGenericTreeItem*) item.m_pItem; - - // first expand all parent branches - wxGenericTreeItem *parent = gitem->GetParent(); - - if ( HasFlag(wxTR_HIDE_ROOT) ) - { - while ( parent && parent != m_anchor ) - { - Expand(parent); - parent = parent->GetParent(); - } - } - else - { - while ( parent ) - { - Expand(parent); - parent = parent->GetParent(); - } - } - - //if (parent) CalculatePositions(); - - ScrollTo(item); -} - -void wxGenericTreeCtrl::ScrollTo(const wxTreeItemId &item) -{ - if (!item.IsOk()) return; - - // We have to call this here because the label in - // question might just have been added and no screen - // update taken place. - if (m_dirty) -#if defined( __WXMSW__ ) || defined(__WXMAC__) - Update(); -#else - DoDirtyProcessing(); -#endif - wxGenericTreeItem *gitem = (wxGenericTreeItem*) item.m_pItem; - - // now scroll to the item - int item_y = gitem->GetY(); - - int start_x = 0; - int start_y = 0; - GetViewStart( &start_x, &start_y ); - start_y *= PIXELS_PER_UNIT; - - int client_h = 0; - int client_w = 0; - GetClientSize( &client_w, &client_h ); - - if (item_y < start_y+3) - { - // going down - int x = 0; - int y = 0; - m_anchor->GetSize( x, y, this ); - y += PIXELS_PER_UNIT+2; // one more scrollbar unit + 2 pixels - x += PIXELS_PER_UNIT+2; // one more scrollbar unit + 2 pixels - int x_pos = GetScrollPos( wxHORIZONTAL ); - // Item should appear at top - SetScrollbars( PIXELS_PER_UNIT, PIXELS_PER_UNIT, x/PIXELS_PER_UNIT, y/PIXELS_PER_UNIT, x_pos, item_y/PIXELS_PER_UNIT ); - } - else if (item_y+GetLineHeight(gitem) > start_y+client_h) - { - // going up - int x = 0; - int y = 0; - m_anchor->GetSize( x, y, this ); - y += PIXELS_PER_UNIT+2; // one more scrollbar unit + 2 pixels - x += PIXELS_PER_UNIT+2; // one more scrollbar unit + 2 pixels - item_y += PIXELS_PER_UNIT+2; - int x_pos = GetScrollPos( wxHORIZONTAL ); - // Item should appear at bottom - SetScrollbars( PIXELS_PER_UNIT, PIXELS_PER_UNIT, x/PIXELS_PER_UNIT, y/PIXELS_PER_UNIT, x_pos, (item_y+GetLineHeight(gitem)-client_h)/PIXELS_PER_UNIT ); - } -} - -// FIXME: tree sorting functions are not reentrant and not MT-safe! -static wxGenericTreeCtrl *s_treeBeingSorted = NULL; - -static int LINKAGEMODE tree_ctrl_compare_func(wxGenericTreeItem **item1, - wxGenericTreeItem **item2) -{ - wxCHECK_MSG( s_treeBeingSorted, 0, wxT("bug in wxGenericTreeCtrl::SortChildren()") ); - - return s_treeBeingSorted->OnCompareItems(*item1, *item2); -} - -void wxGenericTreeCtrl::SortChildren(const wxTreeItemId& itemId) -{ - wxCHECK_RET( itemId.IsOk(), wxT("invalid tree item") ); - - wxGenericTreeItem *item = (wxGenericTreeItem*) itemId.m_pItem; - - wxCHECK_RET( !s_treeBeingSorted, - wxT("wxGenericTreeCtrl::SortChildren is not reentrant") ); - - wxArrayGenericTreeItems& children = item->GetChildren(); - if ( children.Count() > 1 ) - { - m_dirty = true; - - s_treeBeingSorted = this; - children.Sort(tree_ctrl_compare_func); - s_treeBeingSorted = NULL; - } - //else: don't make the tree dirty as nothing changed -} - -void wxGenericTreeCtrl::CalculateLineHeight() -{ - wxClientDC dc(this); - m_lineHeight = (int)(dc.GetCharHeight() + 4); - - if ( m_imageListNormal ) - { - // Calculate a m_lineHeight value from the normal Image sizes. - // May be toggle off. Then wxGenericTreeCtrl will spread when - // necessary (which might look ugly). - int n = m_imageListNormal->GetImageCount(); - for (int i = 0; i < n ; i++) - { - int width = 0, height = 0; - m_imageListNormal->GetSize(i, width, height); - if (height > m_lineHeight) m_lineHeight = height; - } - } - - if (m_imageListButtons) - { - // Calculate a m_lineHeight value from the Button image sizes. - // May be toggle off. Then wxGenericTreeCtrl will spread when - // necessary (which might look ugly). - int n = m_imageListButtons->GetImageCount(); - for (int i = 0; i < n ; i++) - { - int width = 0, height = 0; - m_imageListButtons->GetSize(i, width, height); - if (height > m_lineHeight) m_lineHeight = height; - } - } - - if (m_lineHeight < 30) - m_lineHeight += 2; // at least 2 pixels - else - m_lineHeight += m_lineHeight/10; // otherwise 10% extra spacing -} - -void wxGenericTreeCtrl::SetImageList(wxImageList *imageList) -{ - if (m_ownsImageListNormal) delete m_imageListNormal; - m_imageListNormal = imageList; - m_ownsImageListNormal = false; - m_dirty = true; - - if (m_anchor) - m_anchor->RecursiveResetSize(); - - // Don't do any drawing if we're setting the list to NULL, - // since we may be in the process of deleting the tree control. - if (imageList) - CalculateLineHeight(); -} - -void wxGenericTreeCtrl::SetStateImageList(wxImageList *imageList) -{ - if (m_ownsImageListState) delete m_imageListState; - m_imageListState = imageList; - m_ownsImageListState = false; -} - -void wxGenericTreeCtrl::SetButtonsImageList(wxImageList *imageList) -{ - if (m_ownsImageListButtons) delete m_imageListButtons; - m_imageListButtons = imageList; - m_ownsImageListButtons = false; - m_dirty = true; - - if (m_anchor) - m_anchor->RecursiveResetSize(); - - CalculateLineHeight(); -} - -void wxGenericTreeCtrl::AssignButtonsImageList(wxImageList *imageList) -{ - SetButtonsImageList(imageList); - m_ownsImageListButtons = true; -} - -// ----------------------------------------------------------------------------- -// helpers -// ----------------------------------------------------------------------------- - -void wxGenericTreeCtrl::AdjustMyScrollbars() -{ - if (m_anchor) - { - int x = 0, y = 0; - m_anchor->GetSize( x, y, this ); - y += PIXELS_PER_UNIT+2; // one more scrollbar unit + 2 pixels - x += PIXELS_PER_UNIT+2; // one more scrollbar unit + 2 pixels - int x_pos = GetScrollPos( wxHORIZONTAL ); - int y_pos = GetScrollPos( wxVERTICAL ); - SetScrollbars( PIXELS_PER_UNIT, PIXELS_PER_UNIT, x/PIXELS_PER_UNIT, y/PIXELS_PER_UNIT, x_pos, y_pos ); - } - else - { - SetScrollbars( 0, 0, 0, 0 ); - } -} - -int wxGenericTreeCtrl::GetLineHeight(wxGenericTreeItem *item) const -{ - if (GetWindowStyleFlag() & wxTR_HAS_VARIABLE_ROW_HEIGHT) - return item->GetHeight(); - else - return m_lineHeight; -} - -void wxGenericTreeCtrl::PaintItem(wxGenericTreeItem *item, wxDC& dc) -{ - item->SetFont(this, dc); - - wxCoord text_h = item->GetTextHeight(); - - int image_h = 0, image_w = 0; - int image = item->GetCurrentImage(); - if ( image != NO_IMAGE ) - { - if ( m_imageListNormal ) - { - m_imageListNormal->GetSize( image, image_w, image_h ); - image_w += MARGIN_BETWEEN_IMAGE_AND_TEXT; - } - else - { - image = NO_IMAGE; - } - } - - int total_h = GetLineHeight(item); - bool drawItemBackground = false, - hasBgColour = false; - - if ( item->IsSelected() ) - { - dc.SetBrush(*(m_hasFocus ? m_hilightBrush : m_hilightUnfocusedBrush)); - drawItemBackground = true; - } - else - { - wxColour colBg; - wxTreeItemAttr * const attr = item->GetAttributes(); - if ( attr && attr->HasBackgroundColour() ) - { - drawItemBackground = - hasBgColour = true; - colBg = attr->GetBackgroundColour(); - } - else - { - colBg = GetBackgroundColour(); - } - dc.SetBrush(wxBrush(colBg, wxSOLID)); - } - - int offset = HasFlag(wxTR_ROW_LINES) ? 1 : 0; - - if ( HasFlag(wxTR_FULL_ROW_HIGHLIGHT) ) - { - int x = 0, w = 0, h = 0; - GetVirtualSize(&w, &h); - wxRect rect( x, item->GetY()+offset, w, total_h-offset); -#if !defined(__WXGTK20__) && !defined(__WXMAC__) - dc.DrawRectangle(rect); -#else - if (!item->IsSelected()) - { - dc.DrawRectangle(rect); - } - else - { - int flags = wxCONTROL_SELECTED; - if (m_hasFocus -#ifdef __WXMAC__ - && IsControlActive( (ControlRef)GetHandle() ) -#endif - ) - flags |= wxCONTROL_FOCUSED; - if ((item == m_current) && (m_hasFocus)) - flags |= wxCONTROL_CURRENT; - wxRendererNative::Get().DrawItemSelectionRect( this, dc, rect, flags ); - } -#endif - } - else - { - if ( item->IsSelected() && image != NO_IMAGE ) - { - // If it's selected, and there's an image, then we should - // take care to leave the area under the image painted in the - // background colour. - wxRect rect( item->GetX() + image_w - 2, item->GetY()+offset, - item->GetWidth() - image_w + 2, total_h-offset ); -#if !defined(__WXGTK20__) && !defined(__WXMAC__) - dc.DrawRectangle( rect ); -#else - rect.x -= 1; - rect.width += 2; - - int flags = wxCONTROL_SELECTED; - if (m_hasFocus) - flags |= wxCONTROL_FOCUSED; - if ((item == m_current) && (m_hasFocus)) - flags |= wxCONTROL_CURRENT; - wxRendererNative::Get().DrawItemSelectionRect( this, dc, rect, flags ); -#endif - } - // On GTK+ 2, drawing a 'normal' background is wrong for themes that - // don't allow backgrounds to be customized. Not drawing the background, - // except for custom item backgrounds, works for both kinds of theme. - else if (drawItemBackground) - { - wxRect rect( item->GetX()-2, item->GetY()+offset, - item->GetWidth()+2, total_h-offset ); -#if !defined(__WXGTK20__) && !defined(__WXMAC__) - dc.DrawRectangle( rect ); -#else - if ( hasBgColour ) - { - dc.DrawRectangle( rect ); - } - else - { - rect.x -= 1; - rect.width += 2; - - int flags = wxCONTROL_SELECTED; - if (m_hasFocus) - flags |= wxCONTROL_FOCUSED; - if ((item == m_current) && (m_hasFocus)) - flags |= wxCONTROL_CURRENT; - wxRendererNative::Get().DrawItemSelectionRect( this, dc, rect, flags ); - } -#endif - } - } - - if ( image != NO_IMAGE ) - { - dc.SetClippingRegion( item->GetX(), item->GetY(), image_w-2, total_h ); - m_imageListNormal->Draw( image, dc, - item->GetX(), - item->GetY() +((total_h > image_h)?((total_h-image_h)/2):0), - wxIMAGELIST_DRAW_TRANSPARENT ); - dc.DestroyClippingRegion(); - } - - dc.SetBackgroundMode(wxTRANSPARENT); - int extraH = (total_h > text_h) ? (total_h - text_h)/2 : 0; - dc.DrawText( item->GetText(), - (wxCoord)(image_w + item->GetX()), - (wxCoord)(item->GetY() + extraH)); - - // restore normal font - dc.SetFont( m_normalFont ); -} - -// Now y stands for the top of the item, whereas it used to stand for middle ! -void wxGenericTreeCtrl::PaintLevel( wxGenericTreeItem *item, wxDC &dc, int level, int &y ) -{ - int x = level*m_indent; - if (!HasFlag(wxTR_HIDE_ROOT)) - { - x += m_indent; - } - else if (level == 0) - { - // always expand hidden root - int origY = y; - wxArrayGenericTreeItems& children = item->GetChildren(); - int count = children.Count(); - if (count > 0) - { - int n = 0, oldY; - do { - oldY = y; - PaintLevel(children[n], dc, 1, y); - } while (++n < count); - - if (!HasFlag(wxTR_NO_LINES) && HasFlag(wxTR_LINES_AT_ROOT) && count > 0) - { - // draw line down to last child - origY += GetLineHeight(children[0])>>1; - oldY += GetLineHeight(children[n-1])>>1; - dc.DrawLine(3, origY, 3, oldY); - } - } - return; - } - - item->SetX(x+m_spacing); - item->SetY(y); - - int h = GetLineHeight(item); - int y_top = y; - int y_mid = y_top + (h>>1); - y += h; - - int exposed_x = dc.LogicalToDeviceX(0); - int exposed_y = dc.LogicalToDeviceY(y_top); - - if (IsExposed(exposed_x, exposed_y, 10000, h)) // 10000 = very much - { - const wxPen *pen = -#ifndef __WXMAC__ - // don't draw rect outline if we already have the - // background color under Mac - (item->IsSelected() && m_hasFocus) ? wxBLACK_PEN : -#endif // !__WXMAC__ - wxTRANSPARENT_PEN; - - wxColour colText; - if ( item->IsSelected() -#ifdef __WXMAC__ - // On wxMac, if the tree doesn't have the focus we draw an empty - // rectangle, so we want to make sure that the text is visible - // against the normal background, not the highlightbackground, so - // don't use the highlight text colour unless we have the focus. - && m_hasFocus && IsControlActive( (ControlRef)GetHandle() ) -#endif - ) - { -#ifdef __WXMAC__ - colText = *wxWHITE; -#else - if (m_hasFocus) - colText = wxSystemSettings::GetColour(wxSYS_COLOUR_HIGHLIGHTTEXT); - else - colText = wxSystemSettings::GetColour(wxSYS_COLOUR_LISTBOXHIGHLIGHTTEXT); -#endif - } - else - { - wxTreeItemAttr *attr = item->GetAttributes(); - if (attr && attr->HasTextColour()) - colText = attr->GetTextColour(); - else - colText = GetForegroundColour(); - } - - // prepare to draw - dc.SetTextForeground(colText); - dc.SetPen(*pen); - - // draw - PaintItem(item, dc); - - if (HasFlag(wxTR_ROW_LINES)) - { - // if the background colour is white, choose a - // contrasting color for the lines - dc.SetPen(*((GetBackgroundColour() == *wxWHITE) - ? wxMEDIUM_GREY_PEN : wxWHITE_PEN)); - dc.DrawLine(0, y_top, 10000, y_top); - dc.DrawLine(0, y, 10000, y); - } - - // restore DC objects - dc.SetBrush(*wxWHITE_BRUSH); - dc.SetPen(m_dottedPen); - dc.SetTextForeground(*wxBLACK); - - if ( !HasFlag(wxTR_NO_LINES) ) - { - // draw the horizontal line here - int x_start = x; - if (x > (signed)m_indent) - x_start -= m_indent; - else if (HasFlag(wxTR_LINES_AT_ROOT)) - x_start = 3; - dc.DrawLine(x_start, y_mid, x + m_spacing, y_mid); - } - - // should the item show a button? - if ( item->HasPlus() && HasButtons() ) - { - if ( m_imageListButtons ) - { - // draw the image button here - int image_h = 0, - image_w = 0; - int image = item->IsExpanded() ? wxTreeItemIcon_Expanded - : wxTreeItemIcon_Normal; - if ( item->IsSelected() ) - image += wxTreeItemIcon_Selected - wxTreeItemIcon_Normal; - - m_imageListButtons->GetSize(image, image_w, image_h); - int xx = x - image_w/2; - int yy = y_mid - image_h/2; - - wxDCClipper clip(dc, xx, yy, image_w, image_h); - m_imageListButtons->Draw(image, dc, xx, yy, - wxIMAGELIST_DRAW_TRANSPARENT); - } - else // no custom buttons - { - static const int wImage = 9; - static const int hImage = 9; - - int flag = 0; - if (item->IsExpanded()) - flag |= wxCONTROL_EXPANDED; - if (item == m_underMouse) - flag |= wxCONTROL_CURRENT; - - wxRendererNative::Get().DrawTreeItemButton - ( - this, - dc, - wxRect(x - wImage/2, - y_mid - hImage/2, - wImage, hImage), - flag - ); - } - } - } - - if (item->IsExpanded()) - { - wxArrayGenericTreeItems& children = item->GetChildren(); - int count = children.Count(); - if (count > 0) - { - int n = 0, oldY; - ++level; - do { - oldY = y; - PaintLevel(children[n], dc, level, y); - } while (++n < count); - - if (!HasFlag(wxTR_NO_LINES) && count > 0) - { - // draw line down to last child - oldY += GetLineHeight(children[n-1])>>1; - if (HasButtons()) y_mid += 5; - - // Only draw the portion of the line that is visible, in case it is huge - wxCoord xOrigin=0, yOrigin=0, width, height; - dc.GetDeviceOrigin(&xOrigin, &yOrigin); - yOrigin = abs(yOrigin); - GetClientSize(&width, &height); - - // Move end points to the begining/end of the view? - if (y_mid < yOrigin) - y_mid = yOrigin; - if (oldY > yOrigin + height) - oldY = yOrigin + height; - - // after the adjustments if y_mid is larger than oldY then the line - // isn't visible at all so don't draw anything - if (y_mid < oldY) - dc.DrawLine(x, y_mid, x, oldY); - } - } - } -} - -void wxGenericTreeCtrl::DrawDropEffect(wxGenericTreeItem *item) -{ - if ( item ) - { - if ( item->HasPlus() ) - { - // it's a folder, indicate it by a border - DrawBorder(item); - } - else - { - // draw a line under the drop target because the item will be - // dropped there - DrawLine(item, !m_dropEffectAboveItem ); - } - - SetCursor(wxCURSOR_BULLSEYE); - } - else - { - // can't drop here - SetCursor(wxCURSOR_NO_ENTRY); - } -} - -void wxGenericTreeCtrl::DrawBorder(const wxTreeItemId &item) -{ - wxCHECK_RET( item.IsOk(), _T("invalid item in wxGenericTreeCtrl::DrawLine") ); - - wxGenericTreeItem *i = (wxGenericTreeItem*) item.m_pItem; - - wxClientDC dc(this); - PrepareDC( dc ); - dc.SetLogicalFunction(wxINVERT); - dc.SetBrush(*wxTRANSPARENT_BRUSH); - - int w = i->GetWidth() + 2; - int h = GetLineHeight(i) + 2; - - dc.DrawRectangle( i->GetX() - 1, i->GetY() - 1, w, h); -} - -void wxGenericTreeCtrl::DrawLine(const wxTreeItemId &item, bool below) -{ - wxCHECK_RET( item.IsOk(), _T("invalid item in wxGenericTreeCtrl::DrawLine") ); - - wxGenericTreeItem *i = (wxGenericTreeItem*) item.m_pItem; - - wxClientDC dc(this); - PrepareDC( dc ); - dc.SetLogicalFunction(wxINVERT); - - int x = i->GetX(), - y = i->GetY(); - if ( below ) - { - y += GetLineHeight(i) - 1; - } - - dc.DrawLine( x, y, x + i->GetWidth(), y); -} - -// ----------------------------------------------------------------------------- -// wxWidgets callbacks -// ----------------------------------------------------------------------------- - -void wxGenericTreeCtrl::OnSize( wxSizeEvent &event ) -{ -#ifdef __WXGTK__ - if (HasFlag( wxTR_FULL_ROW_HIGHLIGHT) && m_current) - RefreshLine( m_current ); -#endif - - event.Skip(true); -} - -void wxGenericTreeCtrl::OnPaint( wxPaintEvent &WXUNUSED(event) ) -{ - wxPaintDC dc(this); - PrepareDC( dc ); - - if ( !m_anchor) - return; - - dc.SetFont( m_normalFont ); - dc.SetPen( m_dottedPen ); - - // this is now done dynamically - //if(GetImageList() == NULL) - // m_lineHeight = (int)(dc.GetCharHeight() + 4); - - int y = 2; - PaintLevel( m_anchor, dc, 0, y ); -} - -void wxGenericTreeCtrl::OnSetFocus( wxFocusEvent &event ) -{ - m_hasFocus = true; - - RefreshSelected(); - - event.Skip(); -} - -void wxGenericTreeCtrl::OnKillFocus( wxFocusEvent &event ) -{ - m_hasFocus = false; - - RefreshSelected(); - - event.Skip(); -} - -void wxGenericTreeCtrl::OnChar( wxKeyEvent &event ) -{ - wxTreeEvent te( wxEVT_COMMAND_TREE_KEY_DOWN, this); - te.m_evtKey = event; - if ( GetEventHandler()->ProcessEvent( te ) ) - { - // intercepted by the user code - return; - } - - if ( (m_current == 0) || (m_key_current == 0) ) - { - event.Skip(); - return; - } - - // how should the selection work for this event? - bool is_multiple, extended_select, unselect_others; - EventFlagsToSelType(GetWindowStyleFlag(), - event.ShiftDown(), - event.CmdDown(), - is_multiple, extended_select, unselect_others); - - if (GetLayoutDirection() == wxLayout_RightToLeft) - { - if (event.GetKeyCode() == WXK_RIGHT) - event.m_keyCode = WXK_LEFT; - else if (event.GetKeyCode() == WXK_LEFT) - event.m_keyCode = WXK_RIGHT; - } - - // + : Expand - // - : Collaspe - // * : Expand all/Collapse all - // ' ' | return : activate - // up : go up (not last children!) - // down : go down - // left : go to parent - // right : open if parent and go next - // home : go to root - // end : go to last item without opening parents - // alnum : start or continue searching for the item with this prefix - int keyCode = event.GetKeyCode(); - switch ( keyCode ) - { - case '+': - case WXK_ADD: - if (m_current->HasPlus() && !IsExpanded(m_current)) - { - Expand(m_current); - } - break; - - case '*': - case WXK_MULTIPLY: - if ( !IsExpanded(m_current) ) - { - // expand all - ExpandAllChildren(m_current); - break; - } - //else: fall through to Collapse() it - - case '-': - case WXK_SUBTRACT: - if (IsExpanded(m_current)) - { - Collapse(m_current); - } - break; - - case WXK_MENU: - { - // Use the item's bounding rectangle to determine position for the event - wxRect ItemRect; - GetBoundingRect(m_current, ItemRect, true); - - wxTreeEvent eventMenu(wxEVT_COMMAND_TREE_ITEM_MENU, this, m_current); - // Use the left edge, vertical middle - eventMenu.m_pointDrag = wxPoint(ItemRect.GetX(), - ItemRect.GetY() + ItemRect.GetHeight() / 2); - GetEventHandler()->ProcessEvent( eventMenu ); - } - break; - - case ' ': - case WXK_RETURN: - if ( !event.HasModifiers() ) - { - wxTreeEvent eventAct(wxEVT_COMMAND_TREE_ITEM_ACTIVATED, this, m_current); - GetEventHandler()->ProcessEvent( eventAct ); - } - - // in any case, also generate the normal key event for this key, - // even if we generated the ACTIVATED event above: this is what - // wxMSW does and it makes sense because you might not want to - // process ACTIVATED event at all and handle Space and Return - // directly (and differently) which would be impossible otherwise - event.Skip(); - break; - - // up goes to the previous sibling or to the last - // of its children if it's expanded - case WXK_UP: - { - wxTreeItemId prev = GetPrevSibling( m_key_current ); - if (!prev) - { - prev = GetItemParent( m_key_current ); - if ((prev == GetRootItem()) && HasFlag(wxTR_HIDE_ROOT)) - { - break; // don't go to root if it is hidden - } - if (prev) - { - wxTreeItemIdValue cookie; - wxTreeItemId current = m_key_current; - // TODO: Huh? If we get here, we'd better be the first child of our parent. How else could it be? - if (current == GetFirstChild( prev, cookie )) - { - // otherwise we return to where we came from - DoSelectItem( prev, unselect_others, extended_select ); - m_key_current= (wxGenericTreeItem*) prev.m_pItem; - break; - } - } - } - if (prev) - { - while ( IsExpanded(prev) && HasChildren(prev) ) - { - wxTreeItemId child = GetLastChild(prev); - if ( child ) - { - prev = child; - } - } - - DoSelectItem( prev, unselect_others, extended_select ); - m_key_current=(wxGenericTreeItem*) prev.m_pItem; - } - } - break; - - // left arrow goes to the parent - case WXK_LEFT: - { - wxTreeItemId prev = GetItemParent( m_current ); - if ((prev == GetRootItem()) && HasFlag(wxTR_HIDE_ROOT)) - { - // don't go to root if it is hidden - prev = GetPrevSibling( m_current ); - } - if (prev) - { - DoSelectItem( prev, unselect_others, extended_select ); - } - } - break; - - case WXK_RIGHT: - // this works the same as the down arrow except that we - // also expand the item if it wasn't expanded yet - if (m_current != GetRootItem().m_pItem || !HasFlag(wxTR_HIDE_ROOT)) - Expand(m_current); - //else: don't try to expand hidden root item (which can be the - // current one when the tree is empty) - - // fall through - - case WXK_DOWN: - { - if (IsExpanded(m_key_current) && HasChildren(m_key_current)) - { - wxTreeItemIdValue cookie; - wxTreeItemId child = GetFirstChild( m_key_current, cookie ); - if ( !child ) - break; - - DoSelectItem( child, unselect_others, extended_select ); - m_key_current=(wxGenericTreeItem*) child.m_pItem; - } - else - { - wxTreeItemId next = GetNextSibling( m_key_current ); - if (!next) - { - wxTreeItemId current = m_key_current; - while (current.IsOk() && !next) - { - current = GetItemParent( current ); - if (current) next = GetNextSibling( current ); - } - } - if (next) - { - DoSelectItem( next, unselect_others, extended_select ); - m_key_current=(wxGenericTreeItem*) next.m_pItem; - } - } - } - break; - - // selects the last visible tree item - case WXK_END: - { - wxTreeItemId last = GetRootItem(); - - while ( last.IsOk() && IsExpanded(last) ) - { - wxTreeItemId lastChild = GetLastChild(last); - - // it may happen if the item was expanded but then all of - // its children have been deleted - so IsExpanded() returned - // true, but GetLastChild() returned invalid item - if ( !lastChild ) - break; - - last = lastChild; - } - - if ( last.IsOk() ) - { - DoSelectItem( last, unselect_others, extended_select ); - } - } - break; - - // selects the root item - case WXK_HOME: - { - wxTreeItemId prev = GetRootItem(); - if (!prev) - break; - - if ( HasFlag(wxTR_HIDE_ROOT) ) - { - wxTreeItemIdValue cookie; - prev = GetFirstChild(prev, cookie); - if (!prev) - break; - } - - DoSelectItem( prev, unselect_others, extended_select ); - } - break; - - default: - // do not use wxIsalnum() here - if ( !event.HasModifiers() && - ((keyCode >= '0' && keyCode <= '9') || - (keyCode >= 'a' && keyCode <= 'z') || - (keyCode >= 'A' && keyCode <= 'Z' ))) - { - // find the next item starting with the given prefix - wxChar ch = (wxChar)keyCode; - - wxTreeItemId id = FindItem(m_current, m_findPrefix + ch); - if ( !id.IsOk() ) - { - // no such item - break; - } - - SelectItem(id); - - m_findPrefix += ch; - - // also start the timer to reset the current prefix if the user - // doesn't press any more alnum keys soon -- we wouldn't want - // to use this prefix for a new item search - if ( !m_findTimer ) - { - m_findTimer = new wxTreeFindTimer(this); - } - - m_findTimer->Start(wxTreeFindTimer::DELAY, wxTIMER_ONE_SHOT); - } - else - { - event.Skip(); - } - } -} - -wxTreeItemId -wxGenericTreeCtrl::DoTreeHitTest(const wxPoint& point, int& flags) const -{ - int w, h; - GetSize(&w, &h); - flags=0; - if (point.x<0) flags |= wxTREE_HITTEST_TOLEFT; - if (point.x>w) flags |= wxTREE_HITTEST_TORIGHT; - if (point.y<0) flags |= wxTREE_HITTEST_ABOVE; - if (point.y>h) flags |= wxTREE_HITTEST_BELOW; - if (flags) return wxTreeItemId(); - - if (m_anchor == NULL) - { - flags = wxTREE_HITTEST_NOWHERE; - return wxTreeItemId(); - } - - wxGenericTreeItem *hit = m_anchor->HitTest(CalcUnscrolledPosition(point), - this, flags, 0); - if (hit == NULL) - { - flags = wxTREE_HITTEST_NOWHERE; - return wxTreeItemId(); - } - return hit; -} - -// get the bounding rectangle of the item (or of its label only) -bool wxGenericTreeCtrl::GetBoundingRect(const wxTreeItemId& item, - wxRect& rect, - bool textOnly) const -{ - wxCHECK_MSG( item.IsOk(), false, _T("invalid item in wxGenericTreeCtrl::GetBoundingRect") ); - - wxGenericTreeItem *i = (wxGenericTreeItem*) item.m_pItem; - - if ( textOnly ) - { - rect.x = i->GetX(); - rect.width = i->GetWidth(); - - if ( m_imageListNormal ) - { - int image = ((wxGenericTreeItem*) item.m_pItem)->GetCurrentImage(); - if ( image != NO_IMAGE ) - { - int image_w, image_h; - m_imageListNormal->GetSize( image, image_w, image_h ); - rect.width += image_w + MARGIN_BETWEEN_IMAGE_AND_TEXT; - } - } - } - else // the entire line - { - rect.x = 0; - rect.width = GetClientSize().x; - } - - rect.y = i->GetY(); - rect.height = GetLineHeight(i); - - // we have to return the logical coordinates, not physical ones - rect.SetTopLeft(CalcScrolledPosition(rect.GetTopLeft())); - - return true; -} - -wxTextCtrl *wxGenericTreeCtrl::EditLabel(const wxTreeItemId& item, - wxClassInfo * WXUNUSED(textCtrlClass)) -{ - wxCHECK_MSG( item.IsOk(), NULL, _T("can't edit an invalid item") ); - - wxGenericTreeItem *itemEdit = (wxGenericTreeItem *)item.m_pItem; - - wxTreeEvent te(wxEVT_COMMAND_TREE_BEGIN_LABEL_EDIT, this, itemEdit); - if ( GetEventHandler()->ProcessEvent( te ) && !te.IsAllowed() ) - { - // vetoed by user - return NULL; - } - - // We have to call this here because the label in - // question might just have been added and no screen - // update taken place. - if ( m_dirty ) -#if defined( __WXMSW__ ) || defined(__WXMAC__) - Update(); -#else - DoDirtyProcessing(); -#endif - - // TODO: use textCtrlClass here to create the control of correct class - m_textCtrl = new wxTreeTextCtrl(this, itemEdit); - - m_textCtrl->SetFocus(); - - return m_textCtrl; -} - -// returns a pointer to the text edit control if the item is being -// edited, NULL otherwise (it's assumed that no more than one item may -// be edited simultaneously) -wxTextCtrl* wxGenericTreeCtrl::GetEditControl() const -{ - return m_textCtrl; -} - -void wxGenericTreeCtrl::EndEditLabel(const wxTreeItemId& WXUNUSED(item), - bool discardChanges) -{ - wxCHECK_RET( m_textCtrl, _T("not editing label") ); - - m_textCtrl->EndEdit(discardChanges); -} - -bool wxGenericTreeCtrl::OnRenameAccept(wxGenericTreeItem *item, - const wxString& value) -{ - wxTreeEvent le(wxEVT_COMMAND_TREE_END_LABEL_EDIT, this, item); - le.m_label = value; - le.m_editCancelled = false; - - return !GetEventHandler()->ProcessEvent( le ) || le.IsAllowed(); -} - -void wxGenericTreeCtrl::OnRenameCancelled(wxGenericTreeItem *item) -{ - // let owner know that the edit was cancelled - wxTreeEvent le(wxEVT_COMMAND_TREE_END_LABEL_EDIT, this, item); - le.m_label = wxEmptyString; - le.m_editCancelled = true; - - GetEventHandler()->ProcessEvent( le ); -} - -void wxGenericTreeCtrl::OnRenameTimer() -{ - EditLabel( m_current ); -} - -void wxGenericTreeCtrl::OnMouse( wxMouseEvent &event ) -{ - if ( !m_anchor )return; - - wxPoint pt = CalcUnscrolledPosition(event.GetPosition()); - - // Is the mouse over a tree item button? - int flags = 0; - wxGenericTreeItem *thisItem = m_anchor->HitTest(pt, this, flags, 0); - wxGenericTreeItem *underMouse = thisItem; -#if wxUSE_TOOLTIPS - bool underMouseChanged = (underMouse != m_underMouse) ; -#endif // wxUSE_TOOLTIPS - - if ((underMouse) && - (flags & wxTREE_HITTEST_ONITEMBUTTON) && - (!event.LeftIsDown()) && - (!m_isDragging) && - (!m_renameTimer || !m_renameTimer->IsRunning())) - { - } - else - { - underMouse = NULL; - } - - if (underMouse != m_underMouse) - { - if (m_underMouse) - { - // unhighlight old item - wxGenericTreeItem *tmp = m_underMouse; - m_underMouse = NULL; - RefreshLine( tmp ); - } - - m_underMouse = underMouse; - if (m_underMouse) - RefreshLine( m_underMouse ); - } - -#if wxUSE_TOOLTIPS - // Determines what item we are hovering over and need a tooltip for - wxTreeItemId hoverItem = thisItem; - - // We do not want a tooltip if we are dragging, or if the rename timer is running - if (underMouseChanged && hoverItem.IsOk() && !m_isDragging && (!m_renameTimer || !m_renameTimer->IsRunning())) - { - // Ask the tree control what tooltip (if any) should be shown - wxTreeEvent hevent(wxEVT_COMMAND_TREE_ITEM_GETTOOLTIP, this, hoverItem); - - if ( GetEventHandler()->ProcessEvent(hevent) && hevent.IsAllowed() ) - { - SetToolTip(hevent.m_label); - } - } -#endif - - // we process left mouse up event (enables in-place edit), middle/right down - // (pass to the user code), left dbl click (activate item) and - // dragging/moving events for items drag-and-drop - if ( !(event.LeftDown() || - event.LeftUp() || - event.MiddleDown() || - event.RightDown() || - event.LeftDClick() || - event.Dragging() || - ((event.Moving() || event.RightUp()) && m_isDragging)) ) - { - event.Skip(); - - return; - } - - - flags = 0; - wxGenericTreeItem *item = m_anchor->HitTest(pt, this, flags, 0); - - if ( event.Dragging() && !m_isDragging ) - { - if (m_dragCount == 0) - m_dragStart = pt; - - m_dragCount++; - - if (m_dragCount != 3) - { - // wait until user drags a bit further... - return; - } - - wxEventType command = event.RightIsDown() - ? wxEVT_COMMAND_TREE_BEGIN_RDRAG - : wxEVT_COMMAND_TREE_BEGIN_DRAG; - - wxTreeEvent nevent(command, this, m_current); - nevent.SetPoint(CalcScrolledPosition(pt)); - - // by default the dragging is not supported, the user code must - // explicitly allow the event for it to take place - nevent.Veto(); - - if ( GetEventHandler()->ProcessEvent(nevent) && nevent.IsAllowed() ) - { - // we're going to drag this item - m_isDragging = true; - - // remember the old cursor because we will change it while - // dragging - m_oldCursor = m_cursor; - - // in a single selection control, hide the selection temporarily - if ( !(GetWindowStyleFlag() & wxTR_MULTIPLE) ) - { - m_oldSelection = (wxGenericTreeItem*) GetSelection().m_pItem; - - if ( m_oldSelection ) - { - m_oldSelection->SetHilight(false); - RefreshLine(m_oldSelection); - } - } - - CaptureMouse(); - } - } - else if ( event.Dragging() ) - { - if ( item != m_dropTarget ) - { - // unhighlight the previous drop target - DrawDropEffect(m_dropTarget); - - m_dropTarget = item; - - // highlight the current drop target if any - DrawDropEffect(m_dropTarget); - -#if defined(__WXMSW__) || defined(__WXMAC__) || defined(__WXGTK20__) - Update(); -#else - wxYieldIfNeeded(); -#endif - } - } - else if ( (event.LeftUp() || event.RightUp()) && m_isDragging ) - { - ReleaseMouse(); - - // erase the highlighting - DrawDropEffect(m_dropTarget); - - if ( m_oldSelection ) - { - m_oldSelection->SetHilight(true); - RefreshLine(m_oldSelection); - m_oldSelection = (wxGenericTreeItem *)NULL; - } - - // generate the drag end event - wxTreeEvent eventEndDrag(wxEVT_COMMAND_TREE_END_DRAG, this, item); - - eventEndDrag.m_pointDrag = CalcScrolledPosition(pt); - - (void)GetEventHandler()->ProcessEvent(eventEndDrag); - - m_isDragging = false; - m_dropTarget = (wxGenericTreeItem *)NULL; - - SetCursor(m_oldCursor); - -#if defined( __WXMSW__ ) || defined(__WXMAC__) - Update(); -#else - wxYieldIfNeeded(); -#endif - } - else - { - // If we got to this point, we are not dragging or moving the mouse. - // Because the code in carbon/toplevel.cpp will only set focus to the tree - // if we skip for EVT_LEFT_DOWN, we MUST skip this event here for focus to work. - // We skip even if we didn't hit an item because we still should - // restore focus to the tree control even if we didn't exactly hit an item. - if ( event.LeftDown() ) - { - event.Skip(); - } - - // here we process only the messages which happen on tree items - - m_dragCount = 0; - - if (item == NULL) return; /* we hit the blank area */ - - if ( event.RightDown() ) - { - // If the item is already selected, do not update the selection. - // Multi-selections should not be cleared if a selected item is clicked. - if (!IsSelected(item)) - { - DoSelectItem(item, true, false); - } - - wxTreeEvent nevent(wxEVT_COMMAND_TREE_ITEM_RIGHT_CLICK, this, item); - nevent.m_pointDrag = CalcScrolledPosition(pt); - event.Skip(!GetEventHandler()->ProcessEvent(nevent)); - - // Consistent with MSW (for now), send the ITEM_MENU *after* - // the RIGHT_CLICK event. TODO: This behavior may change. - wxTreeEvent nevent2(wxEVT_COMMAND_TREE_ITEM_MENU, this, item); - nevent2.m_pointDrag = CalcScrolledPosition(pt); - GetEventHandler()->ProcessEvent(nevent2); - } - else if ( event.MiddleDown() ) - { - wxTreeEvent nevent(wxEVT_COMMAND_TREE_ITEM_MIDDLE_CLICK, this, item); - nevent.m_pointDrag = CalcScrolledPosition(pt); - event.Skip(!GetEventHandler()->ProcessEvent(nevent)); - } - else if ( event.LeftUp() ) - { - // this facilitates multiple-item drag-and-drop - - if ( /* item && */ HasFlag(wxTR_MULTIPLE)) - { - wxArrayTreeItemIds selections; - size_t count = GetSelections(selections); - - if (count > 1 && - !event.CmdDown() && - !event.ShiftDown()) - { - DoSelectItem(item, true, false); - } - } - - if ( m_lastOnSame ) - { - if ( (item == m_current) && - (flags & wxTREE_HITTEST_ONITEMLABEL) && - HasFlag(wxTR_EDIT_LABELS) ) - { - if ( m_renameTimer ) - { - if ( m_renameTimer->IsRunning() ) - m_renameTimer->Stop(); - } - else - { - m_renameTimer = new wxTreeRenameTimer( this ); - } - - m_renameTimer->Start( wxTreeRenameTimer::DELAY, true ); - } - - m_lastOnSame = false; - } - } - else // !RightDown() && !MiddleDown() && !LeftUp() ==> LeftDown() || LeftDClick() - { - if ( event.LeftDown() ) - { - m_lastOnSame = item == m_current; - } - - if ( flags & wxTREE_HITTEST_ONITEMBUTTON ) - { - // only toggle the item for a single click, double click on - // the button doesn't do anything (it toggles the item twice) - if ( event.LeftDown() ) - { - Toggle( item ); - } - - // don't select the item if the button was clicked - return; - } - - - // clear the previously selected items, if the - // user clicked outside of the present selection. - // otherwise, perform the deselection on mouse-up. - // this allows multiple drag and drop to work. - // but if Cmd is down, toggle selection of the clicked item - if (!IsSelected(item) || event.CmdDown()) - { - // how should the selection work for this event? - bool is_multiple, extended_select, unselect_others; - EventFlagsToSelType(GetWindowStyleFlag(), - event.ShiftDown(), - event.CmdDown(), - is_multiple, extended_select, unselect_others); - - DoSelectItem(item, unselect_others, extended_select); - } - - - // For some reason, Windows isn't recognizing a left double-click, - // so we need to simulate it here. Allow 200 milliseconds for now. - if ( event.LeftDClick() ) - { - // double clicking should not start editing the item label - if ( m_renameTimer ) - m_renameTimer->Stop(); - - m_lastOnSame = false; - - // send activate event first - wxTreeEvent nevent(wxEVT_COMMAND_TREE_ITEM_ACTIVATED, this, item); - nevent.m_pointDrag = CalcScrolledPosition(pt); - if ( !GetEventHandler()->ProcessEvent( nevent ) ) - { - // if the user code didn't process the activate event, - // handle it ourselves by toggling the item when it is - // double clicked - if ( item->HasPlus() ) - { - Toggle(item); - } - } - } - } - } -} - -void wxGenericTreeCtrl::OnInternalIdle() -{ - wxWindow::OnInternalIdle(); - - // Check if we need to select the root item - // because nothing else has been selected. - // Delaying it means that we can invoke event handlers - // as required, when a first item is selected. - if (!HasFlag(wxTR_MULTIPLE) && !GetSelection().IsOk()) - { - if (m_select_me) - SelectItem(m_select_me); - else if (GetRootItem().IsOk()) - SelectItem(GetRootItem()); - } - - // after all changes have been done to the tree control, - // actually redraw the tree when everything is over - if (m_dirty) - DoDirtyProcessing(); -} - -void wxGenericTreeCtrl::CalculateSize( wxGenericTreeItem *WXUNUSED(item), wxDC &WXUNUSED(dc) ) -{ - // Should not be called anymore, keeping for ABI compatibility. -} - -// ----------------------------------------------------------------------------- -// for developper : y is now the top of the level -// not the middle of it ! -void wxGenericTreeCtrl::CalculateLevel( wxGenericTreeItem *item, wxDC &dc, int level, int &y ) -{ - int x = level*m_indent; - if (!HasFlag(wxTR_HIDE_ROOT)) - { - x += m_indent; - } - else if (level == 0) - { - // a hidden root is not evaluated, but its - // children are always calculated - goto Recurse; - } - - item->CalculateSize(this, dc); - - // set its position - item->SetX( x+m_spacing ); - item->SetY( y ); - y += GetLineHeight(item); - - if ( !item->IsExpanded() ) - { - // we don't need to calculate collapsed branches - return; - } - - Recurse: - wxArrayGenericTreeItems& children = item->GetChildren(); - size_t n, count = children.Count(); - ++level; - for (n = 0; n < count; ++n ) - CalculateLevel( children[n], dc, level, y ); // recurse -} - -void wxGenericTreeCtrl::CalculatePositions() -{ - if ( !m_anchor ) return; - - wxClientDC dc(this); - PrepareDC( dc ); - - dc.SetFont( m_normalFont ); - - dc.SetPen( m_dottedPen ); - - m_anchor->CalculateSize(this, dc); - - int y = 2; - CalculateLevel( m_anchor, dc, 0, y ); // start recursion -} - -void wxGenericTreeCtrl::Refresh(bool eraseBackground, const wxRect *rect) -{ - if ( !m_freezeCount ) - wxTreeCtrlBase::Refresh(eraseBackground, rect); -} - -void wxGenericTreeCtrl::RefreshSubtree(wxGenericTreeItem *item) -{ - if (m_dirty || m_freezeCount) - return; - - wxSize client = GetClientSize(); - - wxRect rect; - CalcScrolledPosition(0, item->GetY(), NULL, &rect.y); - rect.width = client.x; - rect.height = client.y; - - Refresh(true, &rect); - - AdjustMyScrollbars(); -} - -void wxGenericTreeCtrl::RefreshLine( wxGenericTreeItem *item ) -{ - if (m_dirty || m_freezeCount) - return; - - wxRect rect; - CalcScrolledPosition(0, item->GetY(), NULL, &rect.y); - rect.width = GetClientSize().x; - rect.height = GetLineHeight(item); //dc.GetCharHeight() + 6; - - Refresh(true, &rect); -} - -void wxGenericTreeCtrl::RefreshSelected() -{ - if (m_freezeCount) - return; - - // TODO: this is awfully inefficient, we should keep the list of all - // selected items internally, should be much faster - if ( m_anchor ) - RefreshSelectedUnder(m_anchor); -} - -void wxGenericTreeCtrl::RefreshSelectedUnder(wxGenericTreeItem *item) -{ - if (m_freezeCount) - return; - - if ( item->IsSelected() ) - RefreshLine(item); - - const wxArrayGenericTreeItems& children = item->GetChildren(); - size_t count = children.GetCount(); - for ( size_t n = 0; n < count; n++ ) - { - RefreshSelectedUnder(children[n]); - } -} - -void wxGenericTreeCtrl::Freeze() -{ - m_freezeCount++; -} - -void wxGenericTreeCtrl::Thaw() -{ - wxCHECK_RET( m_freezeCount > 0, _T("thawing unfrozen tree control?") ); - - if ( --m_freezeCount == 0 ) - { - Refresh(); - } -} - -// ---------------------------------------------------------------------------- -// changing colours: we need to refresh the tree control -// ---------------------------------------------------------------------------- - -bool wxGenericTreeCtrl::SetBackgroundColour(const wxColour& colour) -{ - if ( !wxWindow::SetBackgroundColour(colour) ) - return false; - - Refresh(); - - return true; -} - -bool wxGenericTreeCtrl::SetForegroundColour(const wxColour& colour) -{ - if ( !wxWindow::SetForegroundColour(colour) ) - return false; - - Refresh(); - - return true; -} - -// Process the tooltip event, to speed up event processing. -// Doesn't actually get a tooltip. -void wxGenericTreeCtrl::OnGetToolTip( wxTreeEvent &event ) -{ - event.Veto(); -} - - -// NOTE: If using the wxListBox visual attributes works everywhere then this can -// be removed, as well as the #else case below. -#define _USE_VISATTR 0 - -//static -wxVisualAttributes -#if _USE_VISATTR -wxGenericTreeCtrl::GetClassDefaultAttributes(wxWindowVariant variant) -#else -wxGenericTreeCtrl::GetClassDefaultAttributes(wxWindowVariant WXUNUSED(variant)) -#endif -{ -#if _USE_VISATTR - // Use the same color scheme as wxListBox - return wxListBox::GetClassDefaultAttributes(variant); -#else - wxVisualAttributes attr; - attr.colFg = wxSystemSettings::GetColour(wxSYS_COLOUR_LISTBOXTEXT); - attr.colBg = wxSystemSettings::GetColour(wxSYS_COLOUR_LISTBOX); - attr.font = wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT); - return attr; -#endif -} - -#if WXWIN_COMPATIBILITY_2_4 - -int wxGenericTreeCtrl::GetItemSelectedImage(const wxTreeItemId& item) const -{ - return GetItemImage(item, wxTreeItemIcon_Selected); -} - -void wxGenericTreeCtrl::SetItemSelectedImage(const wxTreeItemId& item, int image) -{ - SetItemImage(item, image, wxTreeItemIcon_Selected); -} - -#endif // WXWIN_COMPATIBILITY_2_4 - -void wxGenericTreeCtrl::DoDirtyProcessing() -{ - if (m_freezeCount) - return; - - m_dirty = false; - - CalculatePositions(); - Refresh(); - AdjustMyScrollbars(); -} - -wxSize wxGenericTreeCtrl::DoGetBestSize() const -{ - // make sure all positions are calculated as normally this only done during - // idle time but we need them for base class DoGetBestSize() to return the - // correct result - wxConstCast(this, wxGenericTreeCtrl)->CalculatePositions(); - - wxSize size = wxTreeCtrlBase::DoGetBestSize(); - - // there seems to be an implicit extra border around the items, although - // I'm not really sure where does it come from -- but without this, the - // scrollbars appear in a tree with default/best size - size.IncBy(4, 4); - - // and the border has to be rounded up to a multiple of PIXELS_PER_UNIT or - // scrollbars still appear - const wxSize& borderSize = GetWindowBorderSize(); - - int dx = (size.x - borderSize.x) % PIXELS_PER_UNIT; - if ( dx ) - size.x += PIXELS_PER_UNIT - dx; - int dy = (size.y - borderSize.y) % PIXELS_PER_UNIT; - if ( dy ) - size.y += PIXELS_PER_UNIT - dy; - - // we need to update the cache too as the base class cached its own value - CacheBestSize(size); - - return size; -} - -#endif // wxUSE_TREECTRL diff --git a/wxWidgets/src/generic/vlbox.cpp b/wxWidgets/src/generic/vlbox.cpp deleted file mode 100644 index 4299d03194..0000000000 --- a/wxWidgets/src/generic/vlbox.cpp +++ /dev/null @@ -1,653 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: src/generic/vlbox.cpp -// Purpose: implementation of wxVListBox -// Author: Vadim Zeitlin -// Modified by: -// Created: 31.05.03 -// RCS-ID: $Id: vlbox.cpp 53998 2008-06-06 22:55:23Z VZ $ -// 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 - -#if wxUSE_LISTBOX - -#include "wx/vlbox.h" - -#ifndef WX_PRECOMP - #include "wx/settings.h" - #include "wx/dcclient.h" - #include "wx/listbox.h" -#endif //WX_PRECOMP - -#include "wx/dcbuffer.h" -#include "wx/selstore.h" - -// ---------------------------------------------------------------------------- -// event tables -// ---------------------------------------------------------------------------- - -BEGIN_EVENT_TABLE(wxVListBox, wxVScrolledWindow) - EVT_PAINT(wxVListBox::OnPaint) - - EVT_KEY_DOWN(wxVListBox::OnKeyDown) - EVT_LEFT_DOWN(wxVListBox::OnLeftDown) - EVT_LEFT_DCLICK(wxVListBox::OnLeftDClick) -END_EVENT_TABLE() - -// ============================================================================ -// implementation -// ============================================================================ - -IMPLEMENT_ABSTRACT_CLASS(wxVListBox, wxVScrolledWindow) - -// ---------------------------------------------------------------------------- -// wxVListBox creation -// ---------------------------------------------------------------------------- - -void wxVListBox::Init() -{ - m_current = - m_anchor = wxNOT_FOUND; - m_selStore = NULL; -} - -bool wxVListBox::Create(wxWindow *parent, - wxWindowID id, - const wxPoint& pos, - const wxSize& size, - long style, - const wxString& name) -{ - style |= wxWANTS_CHARS | wxFULL_REPAINT_ON_RESIZE; - if ( !wxVScrolledWindow::Create(parent, id, pos, size, style, name) ) - return false; - - if ( style & wxLB_MULTIPLE ) - m_selStore = new wxSelectionStore; - - // make sure the native widget has the right colour since we do - // transparent drawing by default - SetBackgroundColour(GetBackgroundColour()); - m_colBgSel = wxSystemSettings::GetColour(wxSYS_COLOUR_HIGHLIGHT); - - // flicker-free drawing requires this - SetBackgroundStyle(wxBG_STYLE_CUSTOM); - - return true; -} - -wxVListBox::~wxVListBox() -{ - delete m_selStore; -} - -void wxVListBox::SetItemCount(size_t count) -{ - // don't leave the current index invalid - if ( m_current != wxNOT_FOUND && (size_t)m_current >= count ) - m_current = count - 1; // also ok when count == 0 as wxNOT_FOUND == -1 - - if ( m_selStore ) - { - // tell the selection store that our number of items has changed - m_selStore->SetItemCount(count); - } - - SetLineCount(count); -} - -// ---------------------------------------------------------------------------- -// selection handling -// ---------------------------------------------------------------------------- - -bool wxVListBox::IsSelected(size_t line) const -{ - return m_selStore ? m_selStore->IsSelected(line) : (int)line == m_current; -} - -bool wxVListBox::Select(size_t item, bool select) -{ - wxCHECK_MSG( m_selStore, false, - _T("Select() may only be used with multiselection listbox") ); - - wxCHECK_MSG( item < GetItemCount(), false, - _T("Select(): invalid item index") ); - - bool changed = m_selStore->SelectItem(item, select); - if ( changed ) - { - // selection really changed - RefreshLine(item); - } - - DoSetCurrent(item); - - return changed; -} - -bool wxVListBox::SelectRange(size_t from, size_t to) -{ - wxCHECK_MSG( m_selStore, false, - _T("SelectRange() may only be used with multiselection listbox") ); - - // make sure items are in correct order - if ( from > to ) - { - size_t tmp = from; - from = to; - to = tmp; - } - - wxCHECK_MSG( to < GetItemCount(), false, - _T("SelectRange(): invalid item index") ); - - wxArrayInt changed; - if ( !m_selStore->SelectRange(from, to, true, &changed) ) - { - // too many items have changed, we didn't record them in changed array - // so we have no choice but to refresh everything between from and to - RefreshLines(from, to); - } - else // we've got the indices of the changed items - { - const size_t count = changed.GetCount(); - if ( !count ) - { - // nothing changed - return false; - } - - // refresh just the lines which have really changed - for ( size_t n = 0; n < count; n++ ) - { - RefreshLine(changed[n]); - } - } - - // something changed - return true; -} - -bool wxVListBox::DoSelectAll(bool select) -{ - wxCHECK_MSG( m_selStore, false, - _T("SelectAll may only be used with multiselection listbox") ); - - size_t count = GetItemCount(); - if ( count ) - { - wxArrayInt changed; - if ( !m_selStore->SelectRange(0, count - 1, select) || - !changed.IsEmpty() ) - { - Refresh(); - - // something changed - return true; - } - } - - return false; -} - -bool wxVListBox::DoSetCurrent(int current) -{ - wxASSERT_MSG( current == wxNOT_FOUND || - (current >= 0 && (size_t)current < GetItemCount()), - _T("wxVListBox::DoSetCurrent(): invalid item index") ); - - if ( current == m_current ) - { - // nothing to do - return false; - } - - if ( m_current != wxNOT_FOUND ) - RefreshLine(m_current); - - m_current = current; - - if ( m_current != wxNOT_FOUND ) - { - // if the line is not visible at all, we scroll it into view but we - // don't need to refresh it -- it will be redrawn anyhow - if ( !IsVisible(m_current) ) - { - ScrollToLine(m_current); - } - else // line is at least partly visible - { - // it is, indeed, only partly visible, so scroll it into view to - // make it entirely visible - while ( (size_t)m_current == GetLastVisibleLine() && - ScrollToLine(GetVisibleBegin()+1) ) ; - - // but in any case refresh it as even if it was only partly visible - // before we need to redraw it entirely as its background changed - RefreshLine(m_current); - } - } - - return true; -} - -void wxVListBox::SendSelectedEvent() -{ - wxASSERT_MSG( m_current != wxNOT_FOUND, - _T("SendSelectedEvent() shouldn't be called") ); - - wxCommandEvent event(wxEVT_COMMAND_LISTBOX_SELECTED, GetId()); - event.SetEventObject(this); - event.SetInt(m_current); - - (void)GetEventHandler()->ProcessEvent(event); -} - -void wxVListBox::SetSelection(int selection) -{ - wxCHECK_RET( selection == wxNOT_FOUND || - (selection >= 0 && (size_t)selection < GetItemCount()), - _T("wxVListBox::SetSelection(): invalid item index") ); - - if ( HasMultipleSelection() ) - { - if (selection != wxNOT_FOUND) - Select(selection); - else - DeselectAll(); - m_anchor = selection; - } - - DoSetCurrent(selection); -} - -size_t wxVListBox::GetSelectedCount() const -{ - return m_selStore ? m_selStore->GetSelectedCount() - : m_current == wxNOT_FOUND ? 0 : 1; -} - -int wxVListBox::GetFirstSelected(unsigned long& cookie) const -{ - cookie = 0; - - return GetNextSelected(cookie); -} - -int wxVListBox::GetNextSelected(unsigned long& cookie) const -{ - wxCHECK_MSG( m_selStore, wxNOT_FOUND, - _T("GetFirst/NextSelected() may only be used with multiselection listboxes") ); - - while ( cookie < GetItemCount() ) - { - if ( IsSelected(cookie++) ) - return cookie - 1; - } - - return wxNOT_FOUND; -} - -// ---------------------------------------------------------------------------- -// wxVListBox appearance parameters -// ---------------------------------------------------------------------------- - -void wxVListBox::SetMargins(const wxPoint& pt) -{ - if ( pt != m_ptMargins ) - { - m_ptMargins = pt; - - Refresh(); - } -} - -void wxVListBox::SetSelectionBackground(const wxColour& col) -{ - m_colBgSel = col; -} - -// ---------------------------------------------------------------------------- -// wxVListBox painting -// ---------------------------------------------------------------------------- - -wxCoord wxVListBox::OnGetLineHeight(size_t line) const -{ - return OnMeasureItem(line) + 2*m_ptMargins.y; -} - -void wxVListBox::OnDrawSeparator(wxDC& WXUNUSED(dc), - wxRect& WXUNUSED(rect), - size_t WXUNUSED(n)) const -{ -} - -void wxVListBox::OnDrawBackground(wxDC& dc, const wxRect& rect, size_t n) const -{ - // we need to render selected and current items differently - const bool isSelected = IsSelected(n), - isCurrent = IsCurrent(n); - if ( isSelected || isCurrent ) - { - if ( isSelected ) - { - dc.SetBrush(wxBrush(m_colBgSel, wxSOLID)); - } - else // !selected - { - dc.SetBrush(*wxTRANSPARENT_BRUSH); - } - - dc.SetPen(*(isCurrent ? wxBLACK_PEN : wxTRANSPARENT_PEN)); - - dc.DrawRectangle(rect); - } - //else: do nothing for the normal items -} - -void wxVListBox::OnPaint(wxPaintEvent& WXUNUSED(event)) -{ - wxSize clientSize = GetClientSize(); - - wxAutoBufferedPaintDC dc(this); - - // the update rectangle - wxRect rectUpdate = GetUpdateClientRect(); - - // fill it with background colour - dc.SetBackground(GetBackgroundColour()); - dc.Clear(); - - // the bounding rectangle of the current line - wxRect rectLine; - rectLine.width = clientSize.x; - - // iterate over all visible lines - const size_t lineMax = GetVisibleEnd(); - for ( size_t line = GetFirstVisibleLine(); line < lineMax; line++ ) - { - const wxCoord hLine = OnGetLineHeight(line); - - rectLine.height = hLine; - - // and draw the ones which intersect the update rect - if ( rectLine.Intersects(rectUpdate) ) - { - // don't allow drawing outside of the lines rectangle - wxDCClipper clip(dc, rectLine); - - wxRect rect = rectLine; - OnDrawBackground(dc, rect, line); - - OnDrawSeparator(dc, rect, line); - - rect.Deflate(m_ptMargins.x, m_ptMargins.y); - OnDrawItem(dc, rect, line); - } - else // no intersection - { - if ( rectLine.GetTop() > rectUpdate.GetBottom() ) - { - // we are already below the update rect, no need to continue - // further - break; - } - //else: the next line may intersect the update rect - } - - rectLine.y += hLine; - } -} - -// ============================================================================ -// wxVListBox keyboard/mouse handling -// ============================================================================ - -void wxVListBox::DoHandleItemClick(int item, int flags) -{ - // has anything worth telling the client code about happened? - bool notify = false; - - if ( HasMultipleSelection() ) - { - // select the iteem clicked? - bool select = true; - - // NB: the keyboard interface we implement here corresponds to - // wxLB_EXTENDED rather than wxLB_MULTIPLE but this one makes more - // sense IMHO - if ( flags & ItemClick_Shift ) - { - if ( m_current != wxNOT_FOUND ) - { - if ( m_anchor == wxNOT_FOUND ) - m_anchor = m_current; - - select = false; - - // only the range from the selection anchor to new m_current - // must be selected - if ( DeselectAll() ) - notify = true; - - if ( SelectRange(m_anchor, item) ) - notify = true; - } - //else: treat it as ordinary click/keypress - } - else // Shift not pressed - { - m_anchor = item; - - if ( flags & ItemClick_Ctrl ) - { - select = false; - - if ( !(flags & ItemClick_Kbd) ) - { - Toggle(item); - - // the status of the item has definitely changed - notify = true; - } - //else: Ctrl-arrow pressed, don't change selection - } - //else: behave as in single selection case - } - - if ( select ) - { - // make the clicked item the only selection - if ( DeselectAll() ) - notify = true; - - if ( Select(item) ) - notify = true; - } - } - - // in any case the item should become the current one - if ( DoSetCurrent(item) ) - { - if ( !HasMultipleSelection() ) - { - // this has also changed the selection for single selection case - notify = true; - } - } - - if ( notify ) - { - // notify the user about the selection change - SendSelectedEvent(); - } - //else: nothing changed at all -} - -// ---------------------------------------------------------------------------- -// keyboard handling -// ---------------------------------------------------------------------------- - -void wxVListBox::OnKeyDown(wxKeyEvent& event) -{ - // flags for DoHandleItemClick() - int flags = ItemClick_Kbd; - - int current; - switch ( event.GetKeyCode() ) - { - case WXK_HOME: - current = 0; - break; - - case WXK_END: - current = GetLineCount() - 1; - break; - - case WXK_DOWN: - if ( m_current == (int)GetLineCount() - 1 ) - return; - - current = m_current + 1; - break; - - case WXK_UP: - if ( m_current == wxNOT_FOUND ) - current = GetLineCount() - 1; - else if ( m_current != 0 ) - current = m_current - 1; - else // m_current == 0 - return; - break; - - case WXK_PAGEDOWN: - PageDown(); - current = GetFirstVisibleLine(); - break; - - case WXK_PAGEUP: - if ( m_current == (int)GetFirstVisibleLine() ) - { - PageUp(); - } - - current = GetFirstVisibleLine(); - break; - - case WXK_SPACE: - // hack: pressing space should work like a mouse click rather than - // like a keyboard arrow press, so trick DoHandleItemClick() in - // thinking we were clicked - flags &= ~ItemClick_Kbd; - current = m_current; - break; - -#ifdef __WXMSW__ - case WXK_TAB: - // Since we are using wxWANTS_CHARS we need to send navigation - // events for the tabs on MSW - { - wxNavigationKeyEvent ne; - ne.SetDirection(!event.ShiftDown()); - ne.SetCurrentFocus(this); - ne.SetEventObject(this); - GetParent()->GetEventHandler()->ProcessEvent(ne); - } - // fall through to default -#endif - default: - event.Skip(); - current = 0; // just to silent the stupid compiler warnings - wxUnusedVar(current); - return; - } - - if ( event.ShiftDown() ) - flags |= ItemClick_Shift; - if ( event.ControlDown() ) - flags |= ItemClick_Ctrl; - - DoHandleItemClick(current, flags); -} - -// ---------------------------------------------------------------------------- -// wxVListBox mouse handling -// ---------------------------------------------------------------------------- - -void wxVListBox::OnLeftDown(wxMouseEvent& event) -{ - SetFocus(); - - int item = HitTest(event.GetPosition()); - - if ( item != wxNOT_FOUND ) - { - int flags = 0; - if ( event.ShiftDown() ) - flags |= ItemClick_Shift; - - // under Mac Apple-click is used in the same way as Ctrl-click - // elsewhere -#ifdef __WXMAC__ - if ( event.MetaDown() ) -#else - if ( event.ControlDown() ) -#endif - flags |= ItemClick_Ctrl; - - DoHandleItemClick(item, flags); - } -} - -void wxVListBox::OnLeftDClick(wxMouseEvent& eventMouse) -{ - int item = HitTest(eventMouse.GetPosition()); - if ( item != wxNOT_FOUND ) - { - - // if item double-clicked was not yet selected, then treat - // this event as a left-click instead - if ( item == m_current ) - { - wxCommandEvent event(wxEVT_COMMAND_LISTBOX_DOUBLECLICKED, GetId()); - event.SetEventObject(this); - event.SetInt(item); - - (void)GetEventHandler()->ProcessEvent(event); - } - else - { - OnLeftDown(eventMouse); - } - - } -} - - -// ---------------------------------------------------------------------------- -// use the same default attributes as wxListBox -// ---------------------------------------------------------------------------- - -//static -wxVisualAttributes -wxVListBox::GetClassDefaultAttributes(wxWindowVariant variant) -{ - return wxListBox::GetClassDefaultAttributes(variant); -} - -#endif diff --git a/wxWidgets/src/generic/vscroll.cpp b/wxWidgets/src/generic/vscroll.cpp deleted file mode 100644 index 6fc4a91fcb..0000000000 --- a/wxWidgets/src/generic/vscroll.cpp +++ /dev/null @@ -1,519 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/generic/vscroll.cpp -// Purpose: wxVScrolledWindow implementation -// Author: Vadim Zeitlin -// Modified by: -// Created: 30.05.03 -// RCS-ID: $Id: vscroll.cpp 57359 2008-12-15 19:09:31Z BP $ -// Copyright: (c) 2003 Vadim Zeitlin -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ -#pragma hdrstop -#endif - -#ifndef WX_PRECOMP - #include "wx/sizer.h" -#endif - -#include "wx/vscroll.h" - -// ---------------------------------------------------------------------------- -// event tables -// ---------------------------------------------------------------------------- - -BEGIN_EVENT_TABLE(wxVScrolledWindow, wxPanel) - EVT_SIZE(wxVScrolledWindow::OnSize) - EVT_SCROLLWIN(wxVScrolledWindow::OnScroll) -#if wxUSE_MOUSEWHEEL - EVT_MOUSEWHEEL(wxVScrolledWindow::OnMouseWheel) -#endif -END_EVENT_TABLE() - - -// ============================================================================ -// implementation -// ============================================================================ - -IMPLEMENT_ABSTRACT_CLASS(wxVScrolledWindow, wxPanel) - -// ---------------------------------------------------------------------------- -// initialization -// ---------------------------------------------------------------------------- - -void wxVScrolledWindow::Init() -{ - // we're initially empty - m_lineMax = - m_lineFirst = 0; - - // this one should always be strictly positive - m_nVisible = 1; - - m_heightTotal = 0; - -#if wxUSE_MOUSEWHEEL - m_sumWheelRotation = 0; -#endif -} - -// ---------------------------------------------------------------------------- -// various helpers -// ---------------------------------------------------------------------------- - -wxCoord wxVScrolledWindow::EstimateTotalHeight() const -{ - // estimate the total height: it is impossible to call - // OnGetLineHeight() for every line because there may be too many of - // them, so we just make a guess using some lines in the beginning, - // some in the end and some in the middle - static const size_t NUM_LINES_TO_SAMPLE = 10; - - wxCoord heightTotal; - if ( m_lineMax < 3*NUM_LINES_TO_SAMPLE ) - { - // in this case calculating exactly is faster and more correct than - // guessing - heightTotal = GetLinesHeight(0, m_lineMax); - } - else // too many lines to calculate exactly - { - // look at some lines in the beginning/middle/end - heightTotal = - GetLinesHeight(0, NUM_LINES_TO_SAMPLE) + - GetLinesHeight(m_lineMax - NUM_LINES_TO_SAMPLE, m_lineMax) + - GetLinesHeight(m_lineMax/2 - NUM_LINES_TO_SAMPLE/2, - m_lineMax/2 + NUM_LINES_TO_SAMPLE/2); - - // use the height of the lines we looked as the average - heightTotal = (wxCoord) - (((float)heightTotal / (3*NUM_LINES_TO_SAMPLE)) * m_lineMax); - } - - return heightTotal; -} - -wxCoord wxVScrolledWindow::GetLinesHeight(size_t lineMin, size_t lineMax) const -{ - if ( lineMin == lineMax ) - return 0; - else if ( lineMin > lineMax ) - return -GetLinesHeight(lineMax, lineMin); - //else: lineMin < lineMax - - // let the user code know that we're going to need all these lines - OnGetLinesHint(lineMin, lineMax); - - // do sum up their heights - wxCoord height = 0; - for ( size_t line = lineMin; line < lineMax; line++ ) - { - height += OnGetLineHeight(line); - } - - return height; -} - -size_t wxVScrolledWindow::FindFirstFromBottom(size_t lineLast, bool full) -{ - const wxCoord hWindow = GetClientSize().y; - - // go upwards until we arrive at a line such that lineLast is not visible - // any more when it is shown - size_t lineFirst = lineLast; - wxCoord h = 0; - for ( ;; ) - { - h += OnGetLineHeight(lineFirst); - - if ( h > hWindow ) - { - // for this line to be fully visible we need to go one line - // down, but if it is enough for it to be only partly visible then - // this line will do as well - if ( full ) - { - lineFirst++; - } - - break; - } - - if ( !lineFirst ) - break; - - lineFirst--; - } - - return lineFirst; -} - -void wxVScrolledWindow::RemoveScrollbar() -{ - m_lineFirst = 0; - m_nVisible = m_lineMax; - SetScrollbar(wxVERTICAL, 0, 0, 0); -} - -void wxVScrolledWindow::UpdateScrollbar() -{ - // see how many lines can we fit on screen - const wxCoord hWindow = GetClientSize().y; - - wxCoord h = 0; - size_t line; - for ( line = m_lineFirst; line < m_lineMax; line++ ) - { - if ( h > hWindow ) - break; - - h += OnGetLineHeight(line); - } - - // if we still have remaining space below, maybe we can fit everything? - if ( h < hWindow ) - { - wxCoord hAll = h; - for ( size_t lineFirst = m_lineFirst; lineFirst > 0; lineFirst-- ) - { - hAll += OnGetLineHeight(m_lineFirst - 1); - if ( hAll > hWindow ) - break; - } - - if ( hAll < hWindow ) - { - // we don't need scrollbar at all - RemoveScrollbar(); - return; - } - } - - m_nVisible = line - m_lineFirst; - - int pageSize = m_nVisible; - if ( h > hWindow ) - { - // last line is only partially visible, we still need the scrollbar and - // so we have to "fix" pageSize because if it is equal to m_lineMax the - // scrollbar is not shown at all under MSW - pageSize--; - } - - // set the scrollbar parameters to reflect this - SetScrollbar(wxVERTICAL, m_lineFirst, pageSize, m_lineMax); -} - -// ---------------------------------------------------------------------------- -// operations -// ---------------------------------------------------------------------------- - -void wxVScrolledWindow::SetLineCount(size_t count) -{ - // save the number of lines - m_lineMax = count; - - // and our estimate for their total height - m_heightTotal = EstimateTotalHeight(); - - // recalculate the scrollbars parameters - if ( count ) - { - m_lineFirst = 1; // make sure it is != 0 - ScrollToLine(0); - } - else // no items - { - RemoveScrollbar(); - } -} - -void wxVScrolledWindow::RefreshLine(size_t line) -{ - // is this line visible? - if ( !IsVisible(line) ) - { - // no, it is useless to do anything - return; - } - - // calculate the rect occupied by this line on screen - wxRect rect; - rect.width = GetClientSize().x; - rect.height = OnGetLineHeight(line); - for ( size_t n = GetVisibleBegin(); n < line; n++ ) - { - rect.y += OnGetLineHeight(n); - } - - // do refresh it - RefreshRect(rect); -} - -void wxVScrolledWindow::RefreshLines(size_t from, size_t to) -{ - wxASSERT_MSG( from <= to, _T("RefreshLines(): empty range") ); - - // clump the range to just the visible lines -- it is useless to refresh - // the other ones - if ( from < GetVisibleBegin() ) - from = GetVisibleBegin(); - - if ( to >= GetVisibleEnd() ) - to = GetVisibleEnd(); - else - to++; - - // calculate the rect occupied by these lines on screen - wxRect rect; - rect.width = GetClientSize().x; - for ( size_t nBefore = GetVisibleBegin(); nBefore < from; nBefore++ ) - { - rect.y += OnGetLineHeight(nBefore); - } - - for ( size_t nBetween = from; nBetween < to; nBetween++ ) - { - rect.height += OnGetLineHeight(nBetween); - } - - // do refresh it - RefreshRect(rect); -} - -void wxVScrolledWindow::RefreshAll() -{ - UpdateScrollbar(); - - Refresh(); -} - -bool wxVScrolledWindow::Layout() -{ - if ( GetSizer() ) - { - // adjust the sizer dimensions/position taking into account the - // virtual size and scrolled position of the window. - - int w = 0, h = 0; - GetVirtualSize(&w, &h); - - // x is always 0 so no variable needed - int y = -GetLinesHeight(0, GetFirstVisibleLine()); - - GetSizer()->SetDimension(0, y, w, h); - return true; - } - - // fall back to default for LayoutConstraints - return wxPanel::Layout(); -} - -int wxVScrolledWindow::HitTest(wxCoord WXUNUSED(x), wxCoord y) const -{ - const size_t lineMax = GetVisibleEnd(); - for ( size_t line = GetVisibleBegin(); line < lineMax; line++ ) - { - y -= OnGetLineHeight(line); - if ( y < 0 ) - return line; - } - - return wxNOT_FOUND; -} - -// ---------------------------------------------------------------------------- -// scrolling -// ---------------------------------------------------------------------------- - -bool wxVScrolledWindow::ScrollToLine(size_t line) -{ - if ( !m_lineMax ) - { - // we're empty, code below doesn't make sense in this case - return false; - } - - // determine the real first line to scroll to: we shouldn't scroll beyond - // the end - size_t lineFirstLast = FindFirstFromBottom(m_lineMax - 1, true); - if ( line > lineFirstLast ) - line = lineFirstLast; - - // anything to do? - if ( line == m_lineFirst ) - { - // no - return false; - } - - - // remember the currently shown lines for the refresh code below - size_t lineFirstOld = GetVisibleBegin(), - lineLastOld = GetVisibleEnd(); - - m_lineFirst = line; - - - // the size of scrollbar thumb could have changed - UpdateScrollbar(); - - - // finally refresh the display -- but only redraw as few lines as possible - // to avoid flicker - if ( GetChildren().empty() && - (GetVisibleBegin() >= lineLastOld || GetVisibleEnd() <= lineFirstOld ) ) - { - // the simplest case: we don't have any old lines left, just redraw - // everything - Refresh(); - } - else // overlap between the lines we showed before and should show now - { - // Avoid scrolling visible parts of the screen on Mac -#ifdef __WXMAC__ - if (!IsShownOnScreen()) - Refresh(); - else -#endif - ScrollWindow(0, GetLinesHeight(GetVisibleBegin(), lineFirstOld)); - } - - return true; -} - -bool wxVScrolledWindow::ScrollLines(int lines) -{ - lines += m_lineFirst; - if ( lines < 0 ) - lines = 0; - - return ScrollToLine(lines); -} - -bool wxVScrolledWindow::ScrollPages(int pages) -{ - bool didSomething = false; - - while ( pages ) - { - int line; - if ( pages > 0 ) - { - line = GetVisibleEnd(); - if ( line ) - line--; - pages--; - } - else // pages < 0 - { - line = FindFirstFromBottom(GetVisibleBegin()); - pages++; - } - - didSomething = ScrollToLine(line); - } - - return didSomething; -} - -// ---------------------------------------------------------------------------- -// event handling -// ---------------------------------------------------------------------------- - -void wxVScrolledWindow::OnSize(wxSizeEvent& event) -{ - UpdateScrollbar(); - - event.Skip(); -} - -void wxVScrolledWindow::OnScroll(wxScrollWinEvent& event) -{ - size_t lineFirstNew; - - const wxEventType evtType = event.GetEventType(); - - if ( evtType == wxEVT_SCROLLWIN_TOP ) - { - lineFirstNew = 0; - } - else if ( evtType == wxEVT_SCROLLWIN_BOTTOM ) - { - lineFirstNew = m_lineMax; - } - else if ( evtType == wxEVT_SCROLLWIN_LINEUP ) - { - lineFirstNew = m_lineFirst ? m_lineFirst - 1 : 0; - } - else if ( evtType == wxEVT_SCROLLWIN_LINEDOWN ) - { - lineFirstNew = m_lineFirst + 1; - } - else if ( evtType == wxEVT_SCROLLWIN_PAGEUP ) - { - lineFirstNew = FindFirstFromBottom(m_lineFirst); - } - else if ( evtType == wxEVT_SCROLLWIN_PAGEDOWN ) - { - lineFirstNew = GetVisibleEnd(); - if ( lineFirstNew ) - lineFirstNew--; - } - else if ( evtType == wxEVT_SCROLLWIN_THUMBRELEASE ) - { - lineFirstNew = event.GetPosition(); - } - else if ( evtType == wxEVT_SCROLLWIN_THUMBTRACK ) - { - lineFirstNew = event.GetPosition(); - } - - else // unknown scroll event? - { - wxFAIL_MSG( _T("unknown scroll event type?") ); - return; - } - - ScrollToLine(lineFirstNew); - -#ifdef __WXMAC__ - Update(); -#endif // __WXMAC__ -} - -#if wxUSE_MOUSEWHEEL - -void wxVScrolledWindow::OnMouseWheel(wxMouseEvent& event) -{ - m_sumWheelRotation += event.GetWheelRotation(); - int delta = event.GetWheelDelta(); - - // how much to scroll this time - int units_to_scroll = -(m_sumWheelRotation/delta); - if ( !units_to_scroll ) - return; - - m_sumWheelRotation += units_to_scroll*delta; - - if ( !event.IsPageScroll() ) - ScrollLines( units_to_scroll*event.GetLinesPerAction() ); - else - // scroll pages instead of lines - ScrollPages( units_to_scroll ); -} - -#endif // wxUSE_MOUSEWHEEL - diff --git a/wxWidgets/src/generic/wizard.cpp b/wxWidgets/src/generic/wizard.cpp deleted file mode 100644 index 1caed65eff..0000000000 --- a/wxWidgets/src/generic/wizard.cpp +++ /dev/null @@ -1,882 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: src/generic/wizard.cpp -// Purpose: generic implementation of wxWizard class -// Author: Vadim Zeitlin -// Modified by: Robert Cavanaugh -// 1) Added capability for wxWizardPage to accept resources -// 2) Added "Help" button handler stub -// 3) Fixed ShowPage() bug on displaying bitmaps -// Robert Vazan (sizers) -// Created: 15.08.99 -// RCS-ID: $Id: wizard.cpp 63262 2010-01-25 18:47:47Z JS $ -// Copyright: (c) 1999 Vadim Zeitlin -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_WIZARDDLG - -#ifndef WX_PRECOMP - #include "wx/dynarray.h" - #include "wx/intl.h" - #include "wx/statbmp.h" - #include "wx/button.h" - #include "wx/settings.h" - #include "wx/sizer.h" -#endif //WX_PRECOMP - -#include "wx/statline.h" - -#include "wx/wizard.h" - -// ---------------------------------------------------------------------------- -// wxWizardSizer -// ---------------------------------------------------------------------------- - -class wxWizardSizer : public wxSizer -{ -public: - wxWizardSizer(wxWizard *owner); - - virtual wxSizerItem *Insert(size_t index, wxSizerItem *item); - - virtual void RecalcSizes(); - virtual wxSize CalcMin(); - - // get the max size of all wizard pages - wxSize GetMaxChildSize(); - - // return the border which can be either set using wxWizard::SetBorder() or - // have default value - int GetBorder() const; - - // hide the pages which we temporarily "show" when they're added to this - // sizer (see Insert()) - void HidePages(); - -private: - wxSize SiblingSize(wxSizerItem *child); - - wxWizard *m_owner; - wxSize m_childSize; -}; - -// ---------------------------------------------------------------------------- -// event tables and such -// ---------------------------------------------------------------------------- - -DEFINE_EVENT_TYPE(wxEVT_WIZARD_PAGE_CHANGED) -DEFINE_EVENT_TYPE(wxEVT_WIZARD_PAGE_CHANGING) -DEFINE_EVENT_TYPE(wxEVT_WIZARD_CANCEL) -DEFINE_EVENT_TYPE(wxEVT_WIZARD_FINISHED) -DEFINE_EVENT_TYPE(wxEVT_WIZARD_HELP) -DEFINE_EVENT_TYPE(wxEVT_WIZARD_PAGE_SHOWN) - -BEGIN_EVENT_TABLE(wxWizard, wxDialog) - EVT_BUTTON(wxID_CANCEL, wxWizard::OnCancel) - EVT_BUTTON(wxID_BACKWARD, wxWizard::OnBackOrNext) - EVT_BUTTON(wxID_FORWARD, wxWizard::OnBackOrNext) - EVT_BUTTON(wxID_HELP, wxWizard::OnHelp) - - EVT_WIZARD_PAGE_CHANGED(wxID_ANY, wxWizard::OnWizEvent) - EVT_WIZARD_PAGE_CHANGING(wxID_ANY, wxWizard::OnWizEvent) - EVT_WIZARD_CANCEL(wxID_ANY, wxWizard::OnWizEvent) - EVT_WIZARD_FINISHED(wxID_ANY, wxWizard::OnWizEvent) - EVT_WIZARD_HELP(wxID_ANY, wxWizard::OnWizEvent) -END_EVENT_TABLE() - -IMPLEMENT_DYNAMIC_CLASS(wxWizard, wxDialog) - -/* - TODO PROPERTIES : - wxWizard - extstyle - title -*/ - -IMPLEMENT_ABSTRACT_CLASS(wxWizardPage, wxPanel) -IMPLEMENT_DYNAMIC_CLASS(wxWizardPageSimple, wxWizardPage) -IMPLEMENT_DYNAMIC_CLASS(wxWizardEvent, wxNotifyEvent) - -// ============================================================================ -// implementation -// ============================================================================ - -// ---------------------------------------------------------------------------- -// wxWizardPage -// ---------------------------------------------------------------------------- - -void wxWizardPage::Init() -{ - m_bitmap = wxNullBitmap; -} - -wxWizardPage::wxWizardPage(wxWizard *parent, - const wxBitmap& bitmap, - const wxChar *resource) -{ - Create(parent, bitmap, resource); -} - -bool wxWizardPage::Create(wxWizard *parent, - const wxBitmap& bitmap, - const wxChar *resource) -{ - if ( !wxPanel::Create(parent, wxID_ANY) ) - return false; - - if ( resource != NULL ) - { -#if wxUSE_WX_RESOURCES -#if 0 - if ( !LoadFromResource(this, resource) ) - { - wxFAIL_MSG(wxT("wxWizardPage LoadFromResource failed!!!!")); - } -#endif -#endif // wxUSE_RESOURCES - } - - m_bitmap = bitmap; - - // initially the page is hidden, it's shown only when it becomes current - Hide(); - - return true; -} - -// ---------------------------------------------------------------------------- -// wxWizardPageSimple -// ---------------------------------------------------------------------------- - -wxWizardPage *wxWizardPageSimple::GetPrev() const -{ - return m_prev; -} - -wxWizardPage *wxWizardPageSimple::GetNext() const -{ - return m_next; -} - -// ---------------------------------------------------------------------------- -// wxWizardSizer -// ---------------------------------------------------------------------------- - -wxWizardSizer::wxWizardSizer(wxWizard *owner) - : m_owner(owner), - m_childSize(wxDefaultSize) -{ -} - -wxSizerItem *wxWizardSizer::Insert(size_t index, wxSizerItem *item) -{ - m_owner->m_usingSizer = true; - - if ( item->IsWindow() ) - { - // we must pretend that the window is shown as otherwise it wouldn't be - // taken into account for the layout -- but avoid really showing it, so - // just set the internal flag instead of calling wxWindow::Show() - item->GetWindow()->wxWindowBase::Show(); - } - - return wxSizer::Insert(index, item); -} - -void wxWizardSizer::HidePages() -{ - for ( wxSizerItemList::compatibility_iterator node = GetChildren().GetFirst(); - node; - node = node->GetNext() ) - { - wxSizerItem * const item = node->GetData(); - if ( item->IsWindow() ) - item->GetWindow()->wxWindowBase::Show(false); - } -} - -void wxWizardSizer::RecalcSizes() -{ - // Effect of this function depends on m_owner->m_page and - // it should be called whenever it changes (wxWizard::ShowPage) - if ( m_owner->m_page ) - { - m_owner->m_page->SetSize(wxRect(m_position, m_size)); - } -} - -wxSize wxWizardSizer::CalcMin() -{ - return m_owner->GetPageSize(); -} - -wxSize wxWizardSizer::GetMaxChildSize() -{ -#if !defined(__WXDEBUG__) - if ( m_childSize.IsFullySpecified() ) - return m_childSize; -#endif - - wxSize maxOfMin; - - for ( wxSizerItemList::compatibility_iterator childNode = m_children.GetFirst(); - childNode; - childNode = childNode->GetNext() ) - { - wxSizerItem *child = childNode->GetData(); - maxOfMin.IncTo(child->CalcMin()); - maxOfMin.IncTo(SiblingSize(child)); - } - -#ifdef __WXDEBUG__ - if ( m_childSize.IsFullySpecified() && m_childSize != maxOfMin ) - { - wxFAIL_MSG( _T("Size changed in wxWizard::GetPageAreaSizer()") - _T("after RunWizard().\n") - _T("Did you forget to call GetSizer()->Fit(this) ") - _T("for some page?")) ; - - return m_childSize; - } -#endif // __WXDEBUG__ - - if ( m_owner->m_started ) - { - m_childSize = maxOfMin; - } - - return maxOfMin; -} - -int wxWizardSizer::GetBorder() const -{ - return m_owner->m_border; -} - -wxSize wxWizardSizer::SiblingSize(wxSizerItem *child) -{ - wxSize maxSibling; - - if ( child->IsWindow() ) - { - wxWizardPage *page = wxDynamicCast(child->GetWindow(), wxWizardPage); - if ( page ) - { - for ( wxWizardPage *sibling = page->GetNext(); - sibling; - sibling = sibling->GetNext() ) - { - if ( sibling->GetSizer() ) - { - maxSibling.IncTo(sibling->GetSizer()->CalcMin()); - } - } - } - } - - return maxSibling; -} - -// ---------------------------------------------------------------------------- -// generic wxWizard implementation -// ---------------------------------------------------------------------------- - -void wxWizard::Init() -{ - m_posWizard = wxDefaultPosition; - m_page = (wxWizardPage *)NULL; - m_btnPrev = m_btnNext = NULL; - m_statbmp = NULL; - m_sizerBmpAndPage = NULL; - m_sizerPage = NULL; - m_border = 5; - m_started = false; - m_wasModal = false; - m_usingSizer = false; -} - -bool wxWizard::Create(wxWindow *parent, - int id, - const wxString& title, - const wxBitmap& bitmap, - const wxPoint& pos, - long style) -{ - bool result = wxDialog::Create(parent,id,title,pos,wxDefaultSize,style); - - m_posWizard = pos; - m_bitmap = bitmap ; - - DoCreateControls(); - - return result; -} - -wxWizard::~wxWizard() -{ - // normally we don't have to delete this sizer as it's deleted by the - // associated window but if we never used it or didn't set it as the window - // sizer yet, do delete it manually - if ( !m_usingSizer || !m_started ) - delete m_sizerPage; -} - -void wxWizard::AddBitmapRow(wxBoxSizer *mainColumn) -{ - m_sizerBmpAndPage = new wxBoxSizer(wxHORIZONTAL); - mainColumn->Add( - m_sizerBmpAndPage, - 1, // Vertically stretchable - wxEXPAND // Horizonal stretching, no border - ); - mainColumn->Add(0,5, - 0, // No vertical stretching - wxEXPAND // No border, (mostly useless) horizontal stretching - ); - -#if wxUSE_STATBMP - if ( m_bitmap.Ok() ) - { - m_statbmp = new wxStaticBitmap(this, wxID_ANY, m_bitmap); - m_sizerBmpAndPage->Add( - m_statbmp, - 0, // No horizontal stretching - wxALL, // Border all around, top alignment - 5 // Border width - ); - m_sizerBmpAndPage->Add( - 5,0, - 0, // No horizontal stretching - wxEXPAND // No border, (mostly useless) vertical stretching - ); - } -#endif - - // Added to m_sizerBmpAndPage later - m_sizerPage = new wxWizardSizer(this); -} - -void wxWizard::AddStaticLine(wxBoxSizer *mainColumn) -{ -#if wxUSE_STATLINE - mainColumn->Add( - new wxStaticLine(this, wxID_ANY), - 0, // Vertically unstretchable - wxEXPAND | wxALL, // Border all around, horizontally stretchable - 5 // Border width - ); - mainColumn->Add(0,5, - 0, // No vertical stretching - wxEXPAND // No border, (mostly useless) horizontal stretching - ); -#else - (void)mainColumn; -#endif // wxUSE_STATLINE -} - -void wxWizard::AddBackNextPair(wxBoxSizer *buttonRow) -{ - wxASSERT_MSG( m_btnNext && m_btnPrev, - _T("You must create the buttons before calling ") - _T("wxWizard::AddBackNextPair") ); - - // margin between Back and Next buttons -#ifdef __WXMAC__ - static const int BACKNEXT_MARGIN = 10; -#else - static const int BACKNEXT_MARGIN = 0; -#endif - - wxBoxSizer *backNextPair = new wxBoxSizer(wxHORIZONTAL); - buttonRow->Add( - backNextPair, - 0, // No horizontal stretching - wxALL, // Border all around - 5 // Border width - ); - - backNextPair->Add(m_btnPrev); - backNextPair->Add(BACKNEXT_MARGIN,0, - 0, // No horizontal stretching - wxEXPAND // No border, (mostly useless) vertical stretching - ); - backNextPair->Add(m_btnNext); -} - -void wxWizard::AddButtonRow(wxBoxSizer *mainColumn) -{ - // the order in which the buttons are created determines the TAB order - at least under MSWindows... - // although the 'back' button appears before the 'next' button, a more userfriendly tab order is - // to activate the 'next' button first (create the next button before the back button). - // The reason is: The user will repeatedly enter information in the wizard pages and then wants to - // press 'next'. If a user uses mostly the keyboard, he would have to skip the 'back' button - // everytime. This is annoying. There is a second reason: RETURN acts as TAB. If the 'next' - // button comes first in the TAB order, the user can enter information very fast using the RETURN - // key to TAB to the next entry field and page. This would not be possible, if the 'back' button - // was created before the 'next' button. - - bool isPda = (wxSystemSettings::GetScreenType() <= wxSYS_SCREEN_PDA); - int buttonStyle = isPda ? wxBU_EXACTFIT : 0; - - wxBoxSizer *buttonRow = new wxBoxSizer(wxHORIZONTAL); -#ifdef __WXMAC__ - if (GetExtraStyle() & wxWIZARD_EX_HELPBUTTON) - mainColumn->Add( - buttonRow, - 0, // Vertically unstretchable - wxGROW|wxALIGN_CENTRE - ); - else -#endif - mainColumn->Add( - buttonRow, - 0, // Vertically unstretchable - wxALIGN_RIGHT // Right aligned, no border - ); - - // Desired TAB order is 'next', 'cancel', 'help', 'back'. This makes the 'back' button the last control on the page. - // Create the buttons in the right order... - wxButton *btnHelp=0; -#ifdef __WXMAC__ - if (GetExtraStyle() & wxWIZARD_EX_HELPBUTTON) - btnHelp=new wxButton(this, wxID_HELP, _("&Help"), wxDefaultPosition, wxDefaultSize, buttonStyle); -#endif - - m_btnNext = new wxButton(this, wxID_FORWARD, _("&Next >")); - wxButton *btnCancel=new wxButton(this, wxID_CANCEL, _("&Cancel"), wxDefaultPosition, wxDefaultSize, buttonStyle); -#ifndef __WXMAC__ - if (GetExtraStyle() & wxWIZARD_EX_HELPBUTTON) - btnHelp=new wxButton(this, wxID_HELP, _("&Help"), wxDefaultPosition, wxDefaultSize, buttonStyle); -#endif - m_btnPrev = new wxButton(this, wxID_BACKWARD, _("< &Back"), wxDefaultPosition, wxDefaultSize, buttonStyle); - - if (btnHelp) - { - buttonRow->Add( - btnHelp, - 0, // Horizontally unstretchable - wxALL, // Border all around, top aligned - 5 // Border width - ); -#ifdef __WXMAC__ - // Put stretchable space between help button and others - buttonRow->Add(0, 0, 1, wxALIGN_CENTRE, 0); -#endif - } - - AddBackNextPair(buttonRow); - - buttonRow->Add( - btnCancel, - 0, // Horizontally unstretchable - wxALL, // Border all around, top aligned - 5 // Border width - ); -} - -void wxWizard::DoCreateControls() -{ - // do nothing if the controls were already created - if ( WasCreated() ) - return; - - bool isPda = (wxSystemSettings::GetScreenType() <= wxSYS_SCREEN_PDA); - - // Horizontal stretching, and if not PDA, border all around - int mainColumnSizerFlags = isPda ? wxEXPAND : wxALL|wxEXPAND ; - - // wxWindow::SetSizer will be called at end - wxBoxSizer *windowSizer = new wxBoxSizer(wxVERTICAL); - - wxBoxSizer *mainColumn = new wxBoxSizer(wxVERTICAL); - windowSizer->Add( - mainColumn, - 1, // Vertical stretching - mainColumnSizerFlags, - 5 // Border width - ); - - AddBitmapRow(mainColumn); - - if (!isPda) - AddStaticLine(mainColumn); - - AddButtonRow(mainColumn); - - SetSizer(windowSizer); -} - -void wxWizard::SetPageSize(const wxSize& size) -{ - wxCHECK_RET(!m_started, wxT("wxWizard::SetPageSize after RunWizard")); - m_sizePage = size; -} - -void wxWizard::FitToPage(const wxWizardPage *page) -{ - wxCHECK_RET(!m_started, wxT("wxWizard::FitToPage after RunWizard")); - - while ( page ) - { - wxSize size = page->GetBestSize(); - - m_sizePage.IncTo(size); - - page = page->GetNext(); - } -} - -bool wxWizard::ShowPage(wxWizardPage *page, bool goingForward) -{ - wxASSERT_MSG( page != m_page, wxT("this is useless") ); - - wxSizerFlags flags(1); - flags.Border(wxALL, m_border).Expand(); - - if ( !m_started ) - { - if ( m_usingSizer ) - { - m_sizerBmpAndPage->Add(m_sizerPage, flags); - - // now that our layout is computed correctly, hide the pages - // artificially shown in wxWizardSizer::Insert() back again - m_sizerPage->HidePages(); - } - } - - - // we'll use this to decide whether we have to change the label of this - // button or not (initially the label is "Next") - bool btnLabelWasNext = true; - - // remember the old bitmap (if any) to compare with the new one later - wxBitmap bmpPrev; - - // check for previous page - if ( m_page ) - { - // send the event to the old page - wxWizardEvent event(wxEVT_WIZARD_PAGE_CHANGING, GetId(), - goingForward, m_page); - if ( m_page->GetEventHandler()->ProcessEvent(event) && - !event.IsAllowed() ) - { - // vetoed by the page - return false; - } - - m_page->Hide(); - - btnLabelWasNext = HasNextPage(m_page); - - bmpPrev = m_page->GetBitmap(); - - if ( !m_usingSizer ) - m_sizerBmpAndPage->Detach(m_page); - } - - // set the new page - m_page = page; - - // is this the end? - if ( !m_page ) - { - // terminate successfully - if ( IsModal() ) - { - EndModal(wxID_OK); - } - else - { - SetReturnCode(wxID_OK); - Hide(); - } - - // and notify the user code (this is especially useful for modeless - // wizards) - wxWizardEvent event(wxEVT_WIZARD_FINISHED, GetId(), false, 0); - (void)GetEventHandler()->ProcessEvent(event); - - return true; - } - - // position and show the new page - (void)m_page->TransferDataToWindow(); - - if ( m_usingSizer ) - { - // wxWizardSizer::RecalcSizes wants to be called when m_page changes - m_sizerPage->RecalcSizes(); - } - else // pages are not managed by the sizer - { - m_sizerBmpAndPage->Add(m_page, flags); - m_sizerBmpAndPage->SetItemMinSize(m_page, GetPageSize()); - } - -#if wxUSE_STATBMP - // update the bitmap if:it changed - if ( m_statbmp ) - { - wxBitmap bmp = m_page->GetBitmap(); - if ( !bmp.Ok() ) - bmp = m_bitmap; - - if ( !bmpPrev.Ok() ) - bmpPrev = m_bitmap; - - if ( !bmp.IsSameAs(bmpPrev) ) - m_statbmp->SetBitmap(bmp); - } -#endif // wxUSE_STATBMP - - - // and update the buttons state - m_btnPrev->Enable(HasPrevPage(m_page)); - - bool hasNext = HasNextPage(m_page); - if ( btnLabelWasNext != hasNext ) - { - m_btnNext->SetLabel(hasNext ? _("&Next >") : _("&Finish")); - } - // nothing to do: the label was already correct - - m_btnNext->SetDefault(); - - - // send the change event to the new page now - wxWizardEvent event(wxEVT_WIZARD_PAGE_CHANGED, GetId(), goingForward, m_page); - (void)m_page->GetEventHandler()->ProcessEvent(event); - - // and finally show it - m_page->Show(); - m_page->SetFocus(); - - if ( !m_usingSizer ) - m_sizerBmpAndPage->Layout(); - - if ( !m_started ) - { - m_started = true; - - if ( wxSystemSettings::GetScreenType() > wxSYS_SCREEN_PDA ) - { - GetSizer()->SetSizeHints(this); - if ( m_posWizard == wxDefaultPosition ) - CentreOnScreen(); - } - } - - wxWizardEvent pageShownEvent(wxEVT_WIZARD_PAGE_SHOWN, GetId(), - goingForward, m_page); - m_page->GetEventHandler()->ProcessEvent(pageShownEvent); - - return true; -} - -bool wxWizard::RunWizard(wxWizardPage *firstPage) -{ - wxCHECK_MSG( firstPage, false, wxT("can't run empty wizard") ); - - // can't return false here because there is no old page - (void)ShowPage(firstPage, true /* forward */); - - m_wasModal = true; - - return ShowModal() == wxID_OK; -} - -wxWizardPage *wxWizard::GetCurrentPage() const -{ - return m_page; -} - -wxSize wxWizard::GetPageSize() const -{ - // default width and height of the page - int DEFAULT_PAGE_WIDTH, - DEFAULT_PAGE_HEIGHT; - if ( wxSystemSettings::GetScreenType() <= wxSYS_SCREEN_PDA ) - { - // Make the default page size small enough to fit on screen - DEFAULT_PAGE_WIDTH = wxSystemSettings::GetMetric(wxSYS_SCREEN_X) / 2; - DEFAULT_PAGE_HEIGHT = wxSystemSettings::GetMetric(wxSYS_SCREEN_Y) / 2; - } - else // !PDA - { - DEFAULT_PAGE_WIDTH = - DEFAULT_PAGE_HEIGHT = 270; - } - - // start with default minimal size - wxSize pageSize(DEFAULT_PAGE_WIDTH, DEFAULT_PAGE_HEIGHT); - - // make the page at least as big as specified by user - pageSize.IncTo(m_sizePage); - - if ( m_statbmp ) - { - // make the page at least as tall as the bitmap - pageSize.IncTo(wxSize(0, m_bitmap.GetHeight())); - } - - if ( m_usingSizer ) - { - // make it big enough to contain all pages added to the sizer - pageSize.IncTo(m_sizerPage->GetMaxChildSize()); - } - - return pageSize; -} - -wxSizer *wxWizard::GetPageAreaSizer() const -{ - return m_sizerPage; -} - -void wxWizard::SetBorder(int border) -{ - wxCHECK_RET(!m_started, wxT("wxWizard::SetBorder after RunWizard")); - - m_border = border; -} - -void wxWizard::OnCancel(wxCommandEvent& WXUNUSED(eventUnused)) -{ - // this function probably can never be called when we don't have an active - // page, but a small extra check won't hurt - wxWindow *win = m_page ? (wxWindow *)m_page : (wxWindow *)this; - - wxWizardEvent event(wxEVT_WIZARD_CANCEL, GetId(), false, m_page); - if ( !win->GetEventHandler()->ProcessEvent(event) || event.IsAllowed() ) - { - // no objections - close the dialog - if(IsModal()) - { - EndModal(wxID_CANCEL); - } - else - { - SetReturnCode(wxID_CANCEL); - Hide(); - } - } - //else: request to Cancel ignored -} - -void wxWizard::OnBackOrNext(wxCommandEvent& event) -{ - wxASSERT_MSG( (event.GetEventObject() == m_btnNext) || - (event.GetEventObject() == m_btnPrev), - wxT("unknown button") ); - - wxCHECK_RET( m_page, _T("should have a valid current page") ); - - // ask the current page first: notice that we do it before calling - // GetNext/Prev() because the data transfered from the controls of the page - // may change the value returned by these methods - if ( !m_page->Validate() || !m_page->TransferDataFromWindow() ) - { - // the page data is incorrect, don't do anything - return; - } - - bool forward = event.GetEventObject() == m_btnNext; - - wxWizardPage *page; - if ( forward ) - { - page = m_page->GetNext(); - } - else // back - { - page = m_page->GetPrev(); - - wxASSERT_MSG( page, wxT("\"GetEventHandler()->ProcessEvent(eventHelp); - } -} - -void wxWizard::OnWizEvent(wxWizardEvent& event) -{ - // the dialogs have wxWS_EX_BLOCK_EVENTS style on by default but we want to - // propagate wxEVT_WIZARD_XXX to the parent (if any), so do it manually - if ( !(GetExtraStyle() & wxWS_EX_BLOCK_EVENTS) ) - { - // the event will be propagated anyhow - event.Skip(); - } - else - { - wxWindow *parent = GetParent(); - - if ( !parent || !parent->GetEventHandler()->ProcessEvent(event) ) - { - event.Skip(); - } - } - - if ( ( !m_wasModal ) && - event.IsAllowed() && - ( event.GetEventType() == wxEVT_WIZARD_FINISHED || - event.GetEventType() == wxEVT_WIZARD_CANCEL - ) - ) - { - Destroy(); - } -} - -void wxWizard::SetBitmap(const wxBitmap& bitmap) -{ - m_bitmap = bitmap; - if (m_statbmp) - m_statbmp->SetBitmap(m_bitmap); -} - -// ---------------------------------------------------------------------------- -// wxWizardEvent -// ---------------------------------------------------------------------------- - -wxWizardEvent::wxWizardEvent(wxEventType type, int id, bool direction, wxWizardPage* page) - : wxNotifyEvent(type, id) -{ - // Modified 10-20-2001 Robert Cavanaugh - // add the active page to the event data - m_direction = direction; - m_page = page; -} - -#endif // wxUSE_WIZARDDLG diff --git a/wxWidgets/src/html/chm.cpp b/wxWidgets/src/html/chm.cpp deleted file mode 100644 index 4e6550b877..0000000000 --- a/wxWidgets/src/html/chm.cpp +++ /dev/null @@ -1,914 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/html/chm.cpp -// Purpose: CHM (Help) support for wxHTML -// Author: Markus Sinner -// Copyright: (c) 2003 Herd Software Development -// CVS-ID: $Id: chm.cpp 65784 2010-10-08 11:16:54Z MW $ -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_LIBMSPACK - -#include - -#ifndef WXPRECOMP - #include "wx/intl.h" - #include "wx/log.h" - #include "wx/module.h" -#endif - -#include "wx/filesys.h" -#include "wx/mstream.h" -#include "wx/wfstream.h" - -#include "wx/html/forcelnk.h" -FORCE_LINK_ME(wxhtml_chm_support) - -// ---------------------------------------------------------------------------- -/// wxChmTools -///

-/// this class is used to abstract access to CHM-Archives -/// with library mspack written by Stuart Caie -/// http://www.kyz.uklinux.net/libmspack/ -// ---------------------------------------------------------------------------- -class wxChmTools -{ -public: - /// constructor - wxChmTools(const wxFileName &archive); - /// destructor - ~wxChmTools(); - - /// Generate error-string for error-code - static const wxString ChmErrorMsg(int error); - - /// get an array of archive-member-filenames - const wxArrayString *GetFileNames() - { - return m_fileNames; - }; - - /// get the name of the archive representated by this class - const wxString GetArchiveName() - { - return m_chmFileName; - }; - - /// Find a file in the archive - const wxString Find(const wxString& pattern, - const wxString& startfrom = wxEmptyString); - - /// Extract a file in the archive into a file - size_t Extract(const wxString& pattern, const wxString& filename); - - /// check archive for a file - bool Contains(const wxString& pattern); - - /// get a string for the last error which occurred - const wxString GetLastErrorMessage(); - - /// Last Error - int m_lasterror; - -private: - // these vars are used by FindFirst/Next: - wxString m_chmFileName; - char *m_chmFileNameANSI; - - /// mspack-pointer to mschmd_header - struct mschmd_header *m_archive; - /// mspack-pointer to mschm_decompressor - struct mschm_decompressor *m_decompressor; - - /// Array of filenames in archive - wxArrayString * m_fileNames; - - /// Internal function to get filepointer - struct mschmd_file *GetMschmdFile(const wxString& pattern); -}; - - -/*** - * constructor - * - * @param archive The filename of the archive to open - */ -wxChmTools::wxChmTools(const wxFileName &archive) -{ - m_chmFileName = archive.GetFullPath(); - - wxASSERT_MSG( !m_chmFileName.empty(), _T("empty archive name") ); - - m_archive = NULL; - m_decompressor = NULL; - m_fileNames = NULL; - m_lasterror = 0; - - struct mschmd_header *chmh; - struct mschm_decompressor *chmd; - struct mschmd_file *file; - - // Create decompressor - chmd = mspack_create_chm_decompressor(NULL); - m_decompressor = (struct mschm_decompressor *) chmd; - - // NB: we must make a copy of the string because chmd->open won't call - // strdup() [libmspack-20030726], which would cause crashes in - // Unicode build when mb_str() returns temporary buffer - m_chmFileNameANSI = strdup((const char*)m_chmFileName.mb_str(wxConvFile)); - - // Open the archive and store it in class: - if ( (chmh = chmd->open(chmd, (char*)m_chmFileNameANSI)) ) - { - m_archive = chmh; - - // Create Filenamearray - m_fileNames = new wxArrayString; - - // Store Filenames in array - for (file = chmh->files; file; file = file->next) - { - m_fileNames->Add(wxString::FromAscii(file->filename)); - } - } - else - { - wxLogError(_("Failed to open CHM archive '%s'."), - archive.GetFullPath().c_str()); - m_lasterror = (chmd->last_error(chmd)); - return; - } -} - - -/*** - * Destructor - */ -wxChmTools::~wxChmTools() -{ - struct mschm_decompressor *chmd = m_decompressor; - struct mschmd_header *chmh = m_archive; - - delete m_fileNames; - - // Close Archive - if (chmh && chmd) - chmd->close(chmd, chmh); - - free(m_chmFileNameANSI); - - // Destroy Decompressor - if (chmd) - mspack_destroy_chm_decompressor(chmd); -} - - - -/** - * Checks if the given pattern matches to any - * filename stored in archive - * - * @param pattern The filename pattern, may include '*' and/or '?' - * @return true, if any file matching pattern has been found, - * false if not - */ -bool wxChmTools::Contains(const wxString& pattern) -{ - int count; - wxString pattern_tmp = wxString(pattern).MakeLower(); - - // loop through filearay - if ( m_fileNames && (count = m_fileNames->GetCount()) > 0 ) - { - for (int i = 0; i < count; i++) - { - wxString tmp = m_fileNames->Item(i).MakeLower(); - if ( tmp.Matches(pattern_tmp) || tmp.Mid(1).Matches(pattern_tmp)) - return true; - } - } - - return false; -} - - - -/** - * Find() - * - * Finds the next file descibed by a pattern in the archive, starting - * the file given by second parameter - * - * @param pattern The file-pattern to search for. May contain '*' and/or '?' - * @param startfrom The filename which the search should start after - * @returns The full pathname of the found file - */ -const wxString wxChmTools::Find(const wxString& pattern, - const wxString& startfrom) -{ - int count; - wxString tmp; - wxString pattern_tmp(pattern); - wxString startfrom_tmp(startfrom); - pattern_tmp.MakeLower(); - startfrom_tmp.MakeLower(); - - if ( m_fileNames && (count = m_fileNames->GetCount()) > 0 ) - { - for (int i = 0; i < count; i++) - { - tmp = m_fileNames->Item(i).MakeLower(); - // if we find the string where the search should began - if ( tmp.Matches(startfrom_tmp) || - tmp.Mid(1).Matches(startfrom_tmp) ) - continue; - if ( tmp.Matches(pattern_tmp) || - tmp.Mid(1).Matches(pattern_tmp) ) - { - return tmp; - } - } - } - - return wxEmptyString; -} - - -/** - * Extract () - * - * extracts the first hit of pattern to the given position - * - * @param pattern A filename pattern (may contain * and ? chars) - * @param filename The FileName where to temporary extract the file to - * @return 0 at no file extracted
- * number of bytes extracted else - */ -size_t wxChmTools::Extract(const wxString& pattern, const wxString& filename) -{ - struct mschm_decompressor *d = m_decompressor; - struct mschmd_header *h = m_archive; - struct mschmd_file *f; - - wxString tmp; - wxString pattern_tmp = (wxString(pattern)).MakeLower(); - - for (f = h->files; f; f = f->next) - { - tmp = wxString::FromAscii(f->filename).MakeLower(); - if ( tmp.Matches(pattern_tmp) || - tmp.Mid(1).Matches(pattern_tmp) ) - { - // ignore leading '/' - if (d->extract(d, f, - (char*)(const char*)filename.mb_str(wxConvFile))) - { - // Error - m_lasterror = d->last_error(d); - wxLogError(_("Could not extract %s into %s: %s"), - wxString::FromAscii(f->filename).c_str(), - filename.c_str(), - ChmErrorMsg(m_lasterror).c_str()); - return 0; - } - else - { - return (size_t) f->length; - } - } - } - - return 0; -} - - - -/** - * Find a file by pattern - * - * @param pattern A filename pattern (may contain * and ? chars) - * @return A pointer to the file (mschmd_file*) - */ -struct mschmd_file *wxChmTools::GetMschmdFile(const wxString& pattern_orig) -{ - struct mschmd_file *f; - struct mschmd_header *h = (struct mschmd_header *) m_archive; - wxString tmp; - wxString pattern = wxString(pattern_orig).MakeLower(); - - for (f = h->files; f; f = f->next) - { - tmp = wxString::FromAscii(f->filename).MakeLower(); - if ( tmp.Matches(pattern) || tmp.Mid(1).Matches(pattern) ) - { - // ignore leading '/' - return f; - } - } - - return NULL; -} - -const wxString wxChmTools::GetLastErrorMessage() -{ - return ChmErrorMsg(m_lasterror); -} - -const wxString wxChmTools::ChmErrorMsg(int error) -{ - switch (error) - { - case MSPACK_ERR_OK: - return _("no error"); - case MSPACK_ERR_ARGS: - return _("bad arguments to library function"); - case MSPACK_ERR_OPEN: - return _("error opening file"); - case MSPACK_ERR_READ: - return _("read error"); - case MSPACK_ERR_WRITE: - return _("write error"); - case MSPACK_ERR_SEEK: - return _("seek error"); - case MSPACK_ERR_NOMEMORY: - return _("out of memory"); - case MSPACK_ERR_SIGNATURE: - return _("bad signature"); - case MSPACK_ERR_DATAFORMAT: - return _("error in data format"); - case MSPACK_ERR_CHECKSUM: - return _("checksum error"); - case MSPACK_ERR_CRUNCH: - return _("compression error"); - case MSPACK_ERR_DECRUNCH: - return _("decompression error"); - } - return _("unknown error"); -} - - -// --------------------------------------------------------------------------- -/// wxChmInputStream -// --------------------------------------------------------------------------- - -class wxChmInputStream : public wxInputStream -{ -public: - /// Constructor - wxChmInputStream(const wxString& archive, - const wxString& file, bool simulate = false); - /// Destructor - virtual ~wxChmInputStream(); - - /// Return the size of the accessed file in archive - virtual size_t GetSize() const { return m_size; } - /// End of Stream? - virtual bool Eof() const; - /// Set simulation-mode of HHP-File (if non is found) - void SimulateHHP(bool sim) { m_simulateHHP = sim; } - -protected: - /// See wxInputStream - virtual size_t OnSysRead(void *buffer, size_t bufsize); - /// See wxInputStream - virtual wxFileOffset OnSysSeek(wxFileOffset seek, wxSeekMode mode); - /// See wxInputStream - virtual wxFileOffset OnSysTell() const { return m_pos; } - -private: - size_t m_size; - wxFileOffset m_pos; - bool m_simulateHHP; - - char * m_content; - wxInputStream * m_contentStream; - - void CreateHHPStream(); - bool CreateFileStream(const wxString& pattern); - // this void* is handle of archive . I'm sorry it is void and not proper - // type but I don't want to make unzip.h header public. - - - // locates the file and returns a mspack_file * - mspack_file *LocateFile(wxString filename); - - // should store pointer to current file - mspack_file *m_file; - - // The Chm-Class for extracting the data - wxChmTools *m_chm; - - wxString m_fileName; -}; - - -/** - * Constructor - * @param archive The name of the .chm archive. Remember that archive must - * be local file accesible via fopen, fread functions! - * @param filename The Name of the file to be extracted from archive - * @param simulate if true than class should simulate .HHP-File based on #SYSTEM - * if false than class does nothing if it doesnt find .hhp - */ -wxChmInputStream::wxChmInputStream(const wxString& archive, - const wxString& filename, bool simulate) - : wxInputStream() -{ - m_pos = 0; - m_size = 0; - m_content = NULL; - m_contentStream = NULL; - m_lasterror = wxSTREAM_NO_ERROR; - m_chm = new wxChmTools (wxFileName(archive)); - m_file = NULL; - m_fileName = wxString(filename).MakeLower(); - m_simulateHHP = simulate; - - if ( !m_chm->Contains(m_fileName) ) - { - // if the file could not be located, but was *.hhp, than we create - // the content of the hhp-file on the fly and store it for reading - // by the application - if ( m_fileName.Find(_T(".hhp")) != wxNOT_FOUND && m_simulateHHP ) - { - // now we open an hhp-file - CreateHHPStream(); - } - else - { - wxLogError(_("Could not locate file '%s'."), filename.c_str()); - m_lasterror = wxSTREAM_READ_ERROR; - return; - } - } - else - { // file found - CreateFileStream(m_fileName); - } -} - - -wxChmInputStream::~wxChmInputStream() -{ - delete m_chm; - - delete m_contentStream; - - if (m_content) - { - free (m_content); - m_content=NULL; - } -} - -bool wxChmInputStream::Eof() const -{ - return (m_content==NULL || - m_contentStream==NULL || - m_contentStream->Eof() || - m_pos>m_size); -} - - - -size_t wxChmInputStream::OnSysRead(void *buffer, size_t bufsize) -{ - if ( m_pos >= m_size ) - { - m_lasterror = wxSTREAM_EOF; - return 0; - } - m_lasterror = wxSTREAM_NO_ERROR; - - // If the rest to read from the stream is less - // than the buffer size, than only read the rest - if ( m_pos + bufsize > m_size ) - bufsize = m_size - m_pos; - - m_contentStream->SeekI(m_pos); - m_contentStream->Read(buffer, bufsize); - m_pos +=bufsize; - m_contentStream->SeekI(m_pos); - return bufsize; -} - - - - -wxFileOffset wxChmInputStream::OnSysSeek(wxFileOffset seek, wxSeekMode mode) -{ - wxString mode_str = wxEmptyString; - - if ( !m_contentStream || m_contentStream->Eof() ) - { - m_lasterror = wxSTREAM_EOF; - return 0; - } - m_lasterror = wxSTREAM_NO_ERROR; - - wxFileOffset nextpos; - - switch ( mode ) - { - case wxFromCurrent: - nextpos = seek + m_pos; - break; - case wxFromStart: - nextpos = seek; - break; - case wxFromEnd: - nextpos = m_size - 1 + seek; - break; - default: - nextpos = m_pos; - break; /* just to fool compiler, never happens */ - } - m_pos=nextpos; - - // Set current position on stream - m_contentStream->SeekI(m_pos); - return m_pos; -} - - - -/** - * Help Browser tries to read the contents of the - * file by interpreting a .hhp file in the Archiv. - * For .chm doesnt include such a file, we need - * to rebuild the information based on stored - * system-files. - */ -void -wxChmInputStream::CreateHHPStream() -{ - wxFileName file; - bool topic = false; - bool hhc = false; - bool hhk = false; - wxInputStream *i; - wxMemoryOutputStream *out; - const char *tmp; - - // Try to open the #SYSTEM-File and create the HHP File out of it - // see http://bonedaddy.net/pabs3/chmspec/0.1.2/Internal.html#SYSTEM - if ( ! m_chm->Contains(_T("/#SYSTEM")) ) - { -#ifdef DEBUG - wxLogDebug(_("Archive doesnt contain #SYSTEM file")); -#endif - return; - } - else - { - file = wxFileName(_T("/#SYSTEM")); - } - - if ( CreateFileStream(_T("/#SYSTEM")) ) - { - // New stream for writing a memory area to simulate the - // .hhp-file - out = new wxMemoryOutputStream(); - - tmp = "[OPTIONS]\r\n"; - out->Write((const void *) tmp, strlen(tmp)); - - wxUint16 code; - wxUint16 len; - void *buf; - - // use the actual stream for reading - i = m_contentStream; - - /* Now read the contents, and try to get the needed information */ - - // First 4 Bytes are Version information, skip - i->SeekI(4); - - while (!i->Eof()) - { - // Read #SYSTEM-Code and length - i->Read(&code, 2); - code = wxUINT16_SWAP_ON_BE( code ) ; - i->Read(&len, 2); - len = wxUINT16_SWAP_ON_BE( len ) ; - // data - buf = malloc(len); - i->Read(buf, len); - - switch (code) - { - case 0: // CONTENTS_FILE - if (len) - { - tmp = "Contents file="; - hhc=true; - } - break; - case 1: // INDEX_FILE - tmp = "Index file="; - hhk = true; - break; - case 2: // DEFAULT_TOPIC - tmp = "Default Topic="; - topic = true; - break; - case 3: // TITLE - tmp = "Title="; - break; - // case 6: // COMPILED_FILE - // tmp = "Compiled File="; - // break; - case 7: // COMPILED_FILE - tmp = "Binary Index=YES\r\n"; - out->Write( (const void *) tmp, strlen(tmp)); - tmp = NULL; - break; - case 4: // STRUCT SYSTEM INFO - tmp = NULL ; - if ( len >= 28 ) - { - char *structptr = (char*) buf ; - // LCID at position 0 - wxUint32 dummy = *((wxUint32 *)(structptr+0)) ; - wxUint32 lcid = wxUINT32_SWAP_ON_BE( dummy ) ; - char msg[64]; - int len = sprintf(msg, "Language=0x%X\r\n", lcid) ; - if (len > 0) - out->Write(msg, len) ; - } - break ; - default: - tmp=NULL; - } - - if (tmp) - { - out->Write((const void *) tmp, strlen(tmp)); - out->Write(buf, strlen((char*)buf)); - out->Write("\r\n", 2); - } - - free(buf); - buf=NULL; - } - - - // Free the old data which wont be used any more - delete m_contentStream; - if (m_content) - free (m_content); - - // Now add entries which are missing - if ( !hhc && m_chm->Contains(_T("*.hhc")) ) - { - tmp = "Contents File=*.hhc\r\n"; - out->Write((const void *) tmp, strlen(tmp)); - } - - if ( !hhk && m_chm->Contains(_T("*.hhk")) ) - { - tmp = "Index File=*.hhk\r\n"; - out->Write((const void *) tmp, strlen(tmp)); - } - - // Now copy the Data from the memory - out->SeekO(0, wxFromEnd); - m_size = out->TellO(); - out->SeekO(0, wxFromStart); - m_content = (char *) malloc (m_size+1); - out->CopyTo(m_content, m_size); - m_content[m_size]='\0'; - m_size++; - m_contentStream = new wxMemoryInputStream(m_content, m_size); - - delete out; - } -} - - -/** - * Creates a Stream pointing to a virtual file in - * the current archive - */ -bool wxChmInputStream::CreateFileStream(const wxString& pattern) -{ - wxFileInputStream * fin; - wxString tmpfile = wxFileName::CreateTempFileName(_T("chmstrm")); - - if ( tmpfile.empty() ) - { - wxLogError(_("Could not create temporary file '%s'"), tmpfile.c_str()); - return false; - } - - // try to extract the file - if ( m_chm->Extract(pattern, tmpfile) <= 0 ) - { - wxLogError(_("Extraction of '%s' into '%s' failed."), - pattern.c_str(), tmpfile.c_str()); - if ( wxFileExists(tmpfile) ) - wxRemoveFile(tmpfile); - return false; - } - else - { - // Open a filestream to extracted file - fin = new wxFileInputStream(tmpfile); - m_size = fin->GetSize(); - m_content = (char *) malloc(m_size+1); - fin->Read(m_content, m_size); - m_content[m_size]='\0'; - - wxRemoveFile(tmpfile); - - delete fin; - - m_contentStream = new wxMemoryInputStream (m_content, m_size); - - return m_contentStream->IsOk(); - } -} - - - -// ---------------------------------------------------------------------------- -// wxChmFSHandler -// ---------------------------------------------------------------------------- - -class wxChmFSHandler : public wxFileSystemHandler -{ -public: - /// Constructor and Destructor - wxChmFSHandler(); - virtual ~wxChmFSHandler(); - - /// Is able to open location? - virtual bool CanOpen(const wxString& location); - /// Open a file - virtual wxFSFile* OpenFile(wxFileSystem& fs, const wxString& location); - /// Find first occurrence of spec - virtual wxString FindFirst(const wxString& spec, int flags = 0); - /// Find next occurrence of spec - virtual wxString FindNext(); - -private: - int m_lasterror; - wxString m_pattern; - wxString m_found; - wxChmTools * m_chm; -}; - -wxChmFSHandler::wxChmFSHandler() : wxFileSystemHandler() -{ - m_lasterror=0; - m_pattern=wxEmptyString; - m_found=wxEmptyString; - m_chm=NULL; -} - -wxChmFSHandler::~wxChmFSHandler() -{ - if (m_chm) - delete m_chm; -} - -bool wxChmFSHandler::CanOpen(const wxString& location) -{ - wxString p = GetProtocol(location); - return (p == _T("chm")) && - (GetProtocol(GetLeftLocation(location)) == _T("file")); -} - -wxFSFile* wxChmFSHandler::OpenFile(wxFileSystem& WXUNUSED(fs), - const wxString& location) -{ - wxString right = GetRightLocation(location); - wxString left = GetLeftLocation(location); - - wxInputStream *s; - - int index; - - if ( GetProtocol(left) != _T("file") ) - { - wxLogError(_("CHM handler currently supports only local files!")); - return NULL; - } - - // Work around javascript - wxString tmp = wxString(right); - if ( tmp.MakeLower().Contains(_T("javascipt")) && tmp.Contains(_T("\'")) ) - { - right = right.AfterFirst(_T('\'')).BeforeLast(_T('\'')); - } - - // now work on the right location - if (right.Contains(_T(".."))) - { - wxFileName abs(right); - abs.MakeAbsolute(_T("/")); - right = abs.GetFullPath(); - } - - // a workaround for absolute links to root - if ( (index=right.Index(_T("//"))) != wxNOT_FOUND ) - { - right=wxString(right.Mid(index+1)); - wxLogWarning(_("Link contained '//', converted to absolute link.")); - } - - wxFileName leftFilename = wxFileSystem::URLToFileName(left); - if (!leftFilename.FileExists()) - return NULL; - - // Open a stream to read the content of the chm-file - s = new wxChmInputStream(leftFilename.GetFullPath(), right, true); - - wxString mime = GetMimeTypeFromExt(location); - - if ( s ) - { - return new wxFSFile(s, - left + _T("#chm:") + right, - mime, - GetAnchor(location), - wxDateTime(leftFilename.GetModificationTime())); - } - - delete s; - return NULL; -} - - - -/** - * Doku see wxFileSystemHandler - */ -wxString wxChmFSHandler::FindFirst(const wxString& spec, int flags) -{ - wxString right = GetRightLocation(spec); - wxString left = GetLeftLocation(spec); - wxString nativename = wxFileSystem::URLToFileName(left).GetFullPath(); - - if ( GetProtocol(left) != _T("file") ) - { - wxLogError(_("CHM handler currently supports only local files!")); - return wxEmptyString; - } - - m_chm = new wxChmTools(wxFileName(nativename)); - m_pattern = right.AfterLast(_T('/')); - - wxString m_found = m_chm->Find(m_pattern); - - // now fake around hhp-files which are not existing in projects... - if (m_found.empty() && - m_pattern.Contains(_T(".hhp")) && - !m_pattern.Contains(_T(".hhp.cached"))) - { - m_found.Printf(_T("%s#chm:%s.hhp"), - left.c_str(), m_pattern.BeforeLast(_T('.')).c_str()); - } - - return m_found; - -} - - - -wxString wxChmFSHandler::FindNext() -{ - if (m_pattern.empty()) - return wxEmptyString; - else - return m_chm->Find(m_pattern, m_found); -} - -// --------------------------------------------------------------------------- -// wxModule to register CHM handler -// --------------------------------------------------------------------------- - -class wxChmSupportModule : public wxModule -{ - DECLARE_DYNAMIC_CLASS(wxChmSupportModule) - -public: - virtual bool OnInit() - { - wxFileSystem::AddHandler(new wxChmFSHandler); - return true; - } - virtual void OnExit() {} -} -; - -IMPLEMENT_DYNAMIC_CLASS(wxChmSupportModule, wxModule) - -#endif // wxUSE_LIBMSPACK diff --git a/wxWidgets/src/html/descrip.mms b/wxWidgets/src/html/descrip.mms deleted file mode 100644 index 11ab81f5a1..0000000000 --- a/wxWidgets/src/html/descrip.mms +++ /dev/null @@ -1,96 +0,0 @@ -#***************************************************************************** -# * -# Make file for VMS * -# Author : J.Jansen (joukj@hrem.nano.tudelft.nl) * -# Date : 13 February 2006 * -# * -#***************************************************************************** -.first - define wx [--.include.wx] - -.ifdef __WXMOTIF__ -CXX_DEFINE = /define=(__WXMOTIF__=1)/name=(as_is,short)\ - /assume=(nostdnew,noglobal_array_new) -CC_DEFINE = /define=(__WXMOTIF__=1)/name=(as_is,short) -.else -.ifdef __WXGTK__ -CXX_DEFINE = /define=(__WXGTK__=1)/float=ieee/name=(as_is,short)/ieee=denorm\ - /assume=(nostdnew,noglobal_array_new) -CC_DEFINE = /define=(__WXGTK__=1)/float=ieee/name=(as_is,short)/ieee=denorm -.else -.ifdef __WXGTK2__ -CXX_DEFINE = /define=(__WXGTK__=1,VMS_GTK2=1)/float=ieee/name=(as_is,short)/ieee=denorm\ - /assume=(nostdnew,noglobal_array_new) -CC_DEFINE = /define=(__WXGTK__=1,VMS_GTK2=1)/float=ieee/name=(as_is,short)/ieee=denorm -.else -.ifdef __WXX11__ -CXX_DEFINE = /define=(__WXX11__=1,__WXUNIVERSAL__==1)/float=ieee\ - /name=(as_is,short)/assume=(nostdnew,noglobal_array_new) -CC_DEFINE = /define=(__WXX11__=1,__WXUNIVERSAL__==1)/float=ieee\ - /name=(as_is,short) -.else -CXX_DEFINE = -CC_DEFINE = -.endif -.endif -.endif -.endif - -.suffixes : .cpp - -.cpp.obj : - cxx $(CXXFLAGS)$(CXX_DEFINE) $(MMS$TARGET_NAME).cpp -.c.obj : - cc $(CFLAGS)$(CC_DEFINE) $(MMS$TARGET_NAME).c - -OBJECTS = \ - helpctrl.obj,helpdata.obj,helpfrm.obj,htmlcell.obj,htmlfilt.obj,\ - htmlpars.obj,htmltag.obj,htmlwin.obj,htmprint.obj,m_dflist.obj,\ - m_fonts.obj,m_hline.obj,m_image.obj,m_layout.obj,m_links.obj,\ - m_list.obj,m_pre.obj,m_tables.obj,winpars.obj,chm.obj,m_style.obj - -SOURCES = \ - helpctrl.cpp,helpdata.cpp,helpfrm.cpp,htmlcell.cpp,htmlfilt.cpp,\ - htmlpars.cpp,htmltag.cpp,htmlwin.cpp,htmprint.cpp,m_dflist.cpp,\ - m_fonts.cpp,m_hline.cpp,m_image.cpp,m_layout.cpp,m_links.cpp,\ - m_list.cpp,m_pre.cpp,m_tables.cpp,winpars.cpp,chm.cpp,m_style.cpp - -all : $(SOURCES) - $(MMS)$(MMSQUALIFIERS) $(OBJECTS) -.ifdef __WXMOTIF__ - library [--.lib]libwx_motif.olb $(OBJECTS) -.else -.ifdef __WXGTK__ - library [--.lib]libwx_gtk.olb $(OBJECTS) -.else -.ifdef __WXGTK2__ - library [--.lib]libwx_gtk2.olb $(OBJECTS) -.else -.ifdef __WXX11__ - library [--.lib]libwx_x11_univ.olb $(OBJECTS) -.endif -.endif -.endif -.endif - -helpctrl.obj : helpctrl.cpp -helpdata.obj : helpdata.cpp -helpfrm.obj : helpfrm.cpp -htmlcell.obj : htmlcell.cpp -htmlfilt.obj : htmlfilt.cpp -htmlpars.obj : htmlpars.cpp -htmltag.obj : htmltag.cpp -htmlwin.obj : htmlwin.cpp -htmprint.obj : htmprint.cpp -m_dflist.obj : m_dflist.cpp -m_fonts.obj : m_fonts.cpp -m_hline.obj : m_hline.cpp -m_image.obj : m_image.cpp -m_layout.obj : m_layout.cpp -m_links.obj : m_links.cpp -m_list.obj : m_list.cpp -m_pre.obj : m_pre.cpp -m_tables.obj : m_tables.cpp -winpars.obj : winpars.cpp -chm.obj : chm.cpp -m_style.obj : m_style.cpp \ No newline at end of file diff --git a/wxWidgets/src/html/helpctrl.cpp b/wxWidgets/src/html/helpctrl.cpp deleted file mode 100644 index 9019ec8ebe..0000000000 --- a/wxWidgets/src/html/helpctrl.cpp +++ /dev/null @@ -1,442 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: helpctrl.cpp -// Purpose: wxHtmlHelpController -// Notes: Based on htmlhelp.cpp, implementing a monolithic -// HTML Help controller class, by Vaclav Slavik -// Author: Harm van der Heijden and Vaclav Slavik -// RCS-ID: $Id: helpctrl.cpp 52470 2008-03-13 23:29:27Z VS $ -// Copyright: (c) Harm van der Heijden and Vaclav Slavik -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ -#pragma hdrstop -#endif - -#if wxUSE_WXHTML_HELP - -#ifndef WX_PRECOMP - #include "wx/app.h" - #include "wx/intl.h" -#endif // WX_PRECOMP - -#include "wx/busyinfo.h" -#include "wx/html/helpctrl.h" -#include "wx/html/helpwnd.h" -#include "wx/html/helpfrm.h" -#include "wx/html/helpdlg.h" - -#if wxUSE_HELP - #include "wx/tipwin.h" -#endif - -#if wxUSE_LIBMSPACK -#include "wx/html/forcelnk.h" -FORCE_LINK(wxhtml_chm_support) -#endif - -IMPLEMENT_DYNAMIC_CLASS(wxHtmlHelpController, wxHelpControllerBase) - -wxHtmlHelpController::wxHtmlHelpController(int style, wxWindow* parentWindow): - wxHelpControllerBase(parentWindow) -{ - m_helpWindow = NULL; - m_helpFrame = NULL; - m_helpDialog = NULL; - m_Config = NULL; - m_ConfigRoot = wxEmptyString; - m_titleFormat = _("Help: %s"); - m_FrameStyle = style; -} - -wxHtmlHelpController::~wxHtmlHelpController() -{ - if (m_Config) - WriteCustomization(m_Config, m_ConfigRoot); - if (m_helpWindow) - DestroyHelpWindow(); -} - - -void wxHtmlHelpController::DestroyHelpWindow() -{ - if (m_FrameStyle & wxHF_EMBEDDED) - return; - - // Find top-most parent window - // If a modal dialog - wxWindow* parent = FindTopLevelWindow(); - if (parent) - { - wxDialog* dialog = wxDynamicCast(parent, wxDialog); - if (dialog && dialog->IsModal()) - { - dialog->EndModal(wxID_OK); - } - parent->Destroy(); - m_helpWindow = NULL; - } - m_helpDialog = NULL; - m_helpFrame = NULL; -} - -void wxHtmlHelpController::OnCloseFrame(wxCloseEvent& evt) -{ - if (m_Config) - WriteCustomization(m_Config, m_ConfigRoot); - - evt.Skip(); - - OnQuit(); - - if ( m_helpWindow ) - m_helpWindow->SetController(NULL); - m_helpWindow = NULL; - m_helpDialog = NULL; - m_helpFrame = NULL; -} - -void wxHtmlHelpController::SetTitleFormat(const wxString& title) -{ - m_titleFormat = title; - wxHtmlHelpFrame* frame = wxDynamicCast(FindTopLevelWindow(), wxHtmlHelpFrame); - wxHtmlHelpDialog* dialog = wxDynamicCast(FindTopLevelWindow(), wxHtmlHelpDialog); - if (frame) - { - frame->SetTitleFormat(title); - } - else if (dialog) - dialog->SetTitleFormat(title); -} - -// Find the top-most parent window -wxWindow* wxHtmlHelpController::FindTopLevelWindow() -{ - wxWindow* parent = m_helpWindow; - while (parent && !parent->IsTopLevel()) - { - parent = parent->GetParent(); - } - return parent; -} - -bool wxHtmlHelpController::AddBook(const wxFileName& book_file, bool show_wait_msg) -{ - return AddBook(wxFileSystem::FileNameToURL(book_file), show_wait_msg); -} - -bool wxHtmlHelpController::AddBook(const wxString& book, bool show_wait_msg) -{ - wxBusyCursor cur; -#if wxUSE_BUSYINFO - wxBusyInfo* busy = NULL; - wxString info; - if (show_wait_msg) - { - info.Printf(_("Adding book %s"), book.c_str()); - busy = new wxBusyInfo(info); - } -#endif - bool retval = m_helpData.AddBook(book); -#if wxUSE_BUSYINFO - if (show_wait_msg) - delete busy; -#else - wxUnusedVar(show_wait_msg); -#endif - if (m_helpWindow) - m_helpWindow->RefreshLists(); - return retval; -} - -wxHtmlHelpFrame* wxHtmlHelpController::CreateHelpFrame(wxHtmlHelpData *data) -{ - wxHtmlHelpFrame* frame = new wxHtmlHelpFrame(data); - frame->SetController(this); - frame->Create(m_parentWindow, -1, wxEmptyString, m_FrameStyle, m_Config, m_ConfigRoot); - frame->SetTitleFormat(m_titleFormat); - m_helpFrame = frame; - return frame; -} - -wxHtmlHelpDialog* wxHtmlHelpController::CreateHelpDialog(wxHtmlHelpData *data) -{ - wxHtmlHelpDialog* dialog = new wxHtmlHelpDialog(data); - dialog->SetController(this); - dialog->SetTitleFormat(m_titleFormat); - dialog->Create(m_parentWindow, -1, wxEmptyString, m_FrameStyle); - m_helpDialog = dialog; - return dialog; -} - -wxWindow* wxHtmlHelpController::CreateHelpWindow() -{ - if (m_helpWindow) - { - if (m_FrameStyle & wxHF_EMBEDDED) - return m_helpWindow; - - wxWindow* topLevelWindow = FindTopLevelWindow(); - if (topLevelWindow) - topLevelWindow->Raise(); - return m_helpWindow; - } - - if (m_Config == NULL) - { - m_Config = wxConfigBase::Get(false); - if (m_Config != NULL) - m_ConfigRoot = _T("wxWindows/wxHtmlHelpController"); - } - - if (m_FrameStyle & wxHF_DIALOG) - { - wxHtmlHelpDialog* dialog = CreateHelpDialog(&m_helpData); - m_helpWindow = dialog->GetHelpWindow(); - } - else if ((m_FrameStyle & wxHF_EMBEDDED) && m_parentWindow) - { - m_helpWindow = new wxHtmlHelpWindow(m_parentWindow, -1, wxDefaultPosition, wxDefaultSize, - wxTAB_TRAVERSAL|wxNO_BORDER, m_FrameStyle, &m_helpData); - } - else // wxHF_FRAME - { - wxHtmlHelpFrame* frame = CreateHelpFrame(&m_helpData); - m_helpWindow = frame->GetHelpWindow(); - frame->Show(true); - } - - return m_helpWindow; -} - -void wxHtmlHelpController::ReadCustomization(wxConfigBase* cfg, const wxString& path) -{ - /* should not be called by the user; call UseConfig, and the controller - * will do the rest */ - if (m_helpWindow && cfg) - m_helpWindow->ReadCustomization(cfg, path); -} - -void wxHtmlHelpController::WriteCustomization(wxConfigBase* cfg, const wxString& path) -{ - /* typically called by the controllers OnCloseFrame handler */ - if (m_helpWindow && cfg) - m_helpWindow->WriteCustomization(cfg, path); -} - -void wxHtmlHelpController::UseConfig(wxConfigBase *config, const wxString& rootpath) -{ - m_Config = config; - m_ConfigRoot = rootpath; - if (m_helpWindow) m_helpWindow->UseConfig(config, rootpath); - ReadCustomization(config, rootpath); -} - -//// Backward compatibility with wxHelpController API - -bool wxHtmlHelpController::Initialize(const wxString& file) -{ - wxString dir, filename, ext; - wxSplitPath(file, & dir, & filename, & ext); - - if (!dir.empty()) - dir = dir + wxFILE_SEP_PATH; - - // Try to find a suitable file - wxString actualFilename = dir + filename + wxString(wxT(".zip")); - if (!wxFileExists(actualFilename)) - { - actualFilename = dir + filename + wxString(wxT(".htb")); - if (!wxFileExists(actualFilename)) - { - actualFilename = dir + filename + wxString(wxT(".hhp")); - if (!wxFileExists(actualFilename)) - { -#if wxUSE_LIBMSPACK - actualFilename = dir + filename + wxString(wxT(".chm")); - if (!wxFileExists(actualFilename)) -#endif - return false; - } - } - } - return AddBook(wxFileName(actualFilename)); -} - -bool wxHtmlHelpController::LoadFile(const wxString& WXUNUSED(file)) -{ - // Don't reload the file or we'll have it appear again, presumably. - return true; -} - -bool wxHtmlHelpController::DisplaySection(int sectionNo) -{ - return Display(sectionNo); -} - -bool wxHtmlHelpController::DisplayTextPopup(const wxString& text, const wxPoint& WXUNUSED(pos)) -{ -#if wxUSE_TIPWINDOW - static wxTipWindow* s_tipWindow = NULL; - - if (s_tipWindow) - { - // Prevent s_tipWindow being nulled in OnIdle, - // thereby removing the chance for the window to be closed by ShowHelp - s_tipWindow->SetTipWindowPtr(NULL); - s_tipWindow->Close(); - } - s_tipWindow = NULL; - - if ( !text.empty() ) - { - s_tipWindow = new wxTipWindow(wxTheApp->GetTopWindow(), text, 100, & s_tipWindow); - - return true; - } -#else - wxUnusedVar(text); -#endif // wxUSE_TIPWINDOW - - return false; -} - -void wxHtmlHelpController::SetHelpWindow(wxHtmlHelpWindow* helpWindow) -{ - m_helpWindow = helpWindow; - if (helpWindow) - helpWindow->SetController(this); -} - -void wxHtmlHelpController::SetFrameParameters(const wxString& title, - const wxSize& size, - const wxPoint& pos, - bool WXUNUSED(newFrameEachTime)) -{ - SetTitleFormat(title); - wxHtmlHelpFrame* frame = wxDynamicCast(FindTopLevelWindow(), wxHtmlHelpFrame); - wxHtmlHelpDialog* dialog = wxDynamicCast(FindTopLevelWindow(), wxHtmlHelpDialog); - if (frame) - frame->SetSize(pos.x, pos.y, size.x, size.y); - else if (dialog) - dialog->SetSize(pos.x, pos.y, size.x, size.y); -} - -wxFrame* wxHtmlHelpController::GetFrameParameters(wxSize *size, - wxPoint *pos, - bool *newFrameEachTime) -{ - if (newFrameEachTime) - (* newFrameEachTime) = false; - - wxHtmlHelpFrame* frame = wxDynamicCast(FindTopLevelWindow(), wxHtmlHelpFrame); - wxHtmlHelpDialog* dialog = wxDynamicCast(FindTopLevelWindow(), wxHtmlHelpDialog); - if (frame) - { - if (size) - (* size) = frame->GetSize(); - if (pos) - (* pos) = frame->GetPosition(); - return frame; - } - else if (dialog) - { - if (size) - (* size) = dialog->GetSize(); - if (pos) - (* pos) = dialog->GetPosition(); - return NULL; - } - return NULL; -} - -bool wxHtmlHelpController::Quit() -{ - DestroyHelpWindow(); - return true; -} - -// Make the help controller's frame 'modal' if -// needed -void wxHtmlHelpController::MakeModalIfNeeded() -{ - if ((m_FrameStyle & wxHF_EMBEDDED) == 0) - { - wxHtmlHelpFrame* frame = wxDynamicCast(FindTopLevelWindow(), wxHtmlHelpFrame); - wxHtmlHelpDialog* dialog = wxDynamicCast(FindTopLevelWindow(), wxHtmlHelpDialog); - if (frame) - frame->AddGrabIfNeeded(); - else if (dialog && (m_FrameStyle & wxHF_MODAL)) - { - dialog->ShowModal(); - } - } -} - -bool wxHtmlHelpController::Display(const wxString& x) -{ - CreateHelpWindow(); - bool success = m_helpWindow->Display(x); - MakeModalIfNeeded(); - return success; -} - -bool wxHtmlHelpController::Display(int id) -{ - CreateHelpWindow(); - bool success = m_helpWindow->Display(id); - MakeModalIfNeeded(); - return success; -} - -bool wxHtmlHelpController::DisplayContents() -{ - CreateHelpWindow(); - bool success = m_helpWindow->DisplayContents(); - MakeModalIfNeeded(); - return success; -} - -bool wxHtmlHelpController::DisplayIndex() -{ - CreateHelpWindow(); - bool success = m_helpWindow->DisplayIndex(); - MakeModalIfNeeded(); - return success; -} - -bool wxHtmlHelpController::KeywordSearch(const wxString& keyword, - wxHelpSearchMode mode) -{ - CreateHelpWindow(); - bool success = m_helpWindow->KeywordSearch(keyword, mode); - MakeModalIfNeeded(); - return success; -} - -/* - * wxHtmlModalHelp - * A convenience class, to use like this: - * - * wxHtmlModalHelp help(parent, helpFile, topic); - */ - -wxHtmlModalHelp::wxHtmlModalHelp(wxWindow* parent, const wxString& helpFile, const wxString& topic, int style) -{ - // Force some mandatory styles - style |= wxHF_DIALOG | wxHF_MODAL; - - wxHtmlHelpController controller(style, parent); - controller.Initialize(helpFile); - - if (topic.IsEmpty()) - controller.DisplayContents(); - else - controller.DisplaySection(topic); -} - -#endif // wxUSE_WXHTML_HELP - diff --git a/wxWidgets/src/html/helpdata.cpp b/wxWidgets/src/html/helpdata.cpp deleted file mode 100644 index 38844272d0..0000000000 --- a/wxWidgets/src/html/helpdata.cpp +++ /dev/null @@ -1,1077 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/html/helpdata.cpp -// Purpose: wxHtmlHelpData -// Notes: Based on htmlhelp.cpp, implementing a monolithic -// HTML Help controller class, by Vaclav Slavik -// Author: Harm van der Heijden and Vaclav Slavik -// RCS-ID: $Id: helpdata.cpp 42675 2006-10-29 21:29:49Z VZ $ -// Copyright: (c) Harm van der Heijden and Vaclav Slavik -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_HTML && wxUSE_STREAMS - -#ifndef WXPRECOMP - #include "wx/intl.h" - #include "wx/log.h" -#endif - -#include - -#include "wx/html/helpdata.h" -#include "wx/tokenzr.h" -#include "wx/wfstream.h" -#include "wx/busyinfo.h" -#include "wx/encconv.h" -#include "wx/fontmap.h" -#include "wx/html/htmlpars.h" -#include "wx/html/htmldefs.h" -#include "wx/html/htmlfilt.h" -#include "wx/filename.h" - -#include "wx/arrimpl.cpp" -WX_DEFINE_OBJARRAY(wxHtmlBookRecArray) -WX_DEFINE_OBJARRAY(wxHtmlHelpDataItems) - -//----------------------------------------------------------------------------- -// static helper functions -//----------------------------------------------------------------------------- - -// Reads one line, stores it into buf and returns pointer to new line or NULL. -static const wxChar* ReadLine(const wxChar *line, wxChar *buf, size_t bufsize) -{ - wxChar *writeptr = buf; - wxChar *endptr = buf + bufsize - 1; - const wxChar *readptr = line; - - while (*readptr != 0 && *readptr != _T('\r') && *readptr != _T('\n') && - writeptr != endptr) - *(writeptr++) = *(readptr++); - *writeptr = 0; - while (*readptr == _T('\r') || *readptr == _T('\n')) - readptr++; - if (*readptr == 0) - return NULL; - else - return readptr; -} - - - -static int -wxHtmlHelpIndexCompareFunc(wxHtmlHelpDataItem **a, wxHtmlHelpDataItem **b) -{ - wxHtmlHelpDataItem *ia = *a; - wxHtmlHelpDataItem *ib = *b; - - if (ia == NULL) - return -1; - if (ib == NULL) - return 1; - - if (ia->parent == ib->parent) - { - return ia->name.CmpNoCase(ib->name); - } - else if (ia->level == ib->level) - { - return wxHtmlHelpIndexCompareFunc(&ia->parent, &ib->parent); - } - else - { - wxHtmlHelpDataItem *ia2 = ia; - wxHtmlHelpDataItem *ib2 = ib; - - while (ia2->level > ib2->level) - { - ia2 = ia2->parent; - } - while (ib2->level > ia2->level) - { - ib2 = ib2->parent; - } - - wxASSERT(ia2); - wxASSERT(ib2); - int res = wxHtmlHelpIndexCompareFunc(&ia2, &ib2); - if (res != 0) - return res; - else if (ia->level > ib->level) - return 1; - else - return -1; - } -} - -//----------------------------------------------------------------------------- -// HP_Parser -//----------------------------------------------------------------------------- - -class HP_Parser : public wxHtmlParser -{ -public: - HP_Parser() - { - GetEntitiesParser()->SetEncoding(wxFONTENCODING_ISO8859_1); - } - - wxObject* GetProduct() { return NULL; } - -protected: - virtual void AddText(const wxChar* WXUNUSED(txt)) {} - - DECLARE_NO_COPY_CLASS(HP_Parser) -}; - - -//----------------------------------------------------------------------------- -// HP_TagHandler -//----------------------------------------------------------------------------- - -class HP_TagHandler : public wxHtmlTagHandler -{ - private: - wxString m_name, m_page; - int m_level; - int m_id; - int m_index; - int m_count; - wxHtmlHelpDataItem *m_parentItem; - wxHtmlBookRecord *m_book; - - wxHtmlHelpDataItems *m_data; - - public: - HP_TagHandler(wxHtmlBookRecord *b) : wxHtmlTagHandler() - { - m_data = NULL; - m_book = b; - m_name = m_page = wxEmptyString; - m_level = 0; - m_id = wxID_ANY; - m_count = 0; - m_parentItem = NULL; - } - wxString GetSupportedTags() { return wxT("UL,OBJECT,PARAM"); } - bool HandleTag(const wxHtmlTag& tag); - - void Reset(wxHtmlHelpDataItems& data) - { - m_data = &data; - m_count = 0; - m_level = 0; - m_parentItem = NULL; - } - - DECLARE_NO_COPY_CLASS(HP_TagHandler) -}; - - -bool HP_TagHandler::HandleTag(const wxHtmlTag& tag) -{ - if (tag.GetName() == wxT("UL")) - { - wxHtmlHelpDataItem *oldparent = m_parentItem; - m_level++; - m_parentItem = (m_count > 0) ? &(*m_data)[m_data->size()-1] : NULL; - ParseInner(tag); - m_level--; - m_parentItem = oldparent; - return true; - } - else if (tag.GetName() == wxT("OBJECT")) - { - m_name = m_page = wxEmptyString; - ParseInner(tag); - -#if 0 - if (!page.IsEmpty()) - /* Valid HHW's file may contain only two object tags: - - - - - - or - - - - - - - We're interested in the latter. !page.IsEmpty() is valid - condition because text/site properties does not contain Local param - */ -#endif - if (tag.GetParam(wxT("TYPE")) == wxT("text/sitemap")) - { - wxHtmlHelpDataItem *item = new wxHtmlHelpDataItem(); - item->parent = m_parentItem; - item->level = m_level; - item->id = m_id; - item->page = m_page; - item->name = m_name; - - item->book = m_book; - m_data->Add(item); - m_count++; - } - - return true; - } - else - { // "PARAM" - if (m_name.empty() && tag.GetParam(wxT("NAME")) == wxT("Name")) - m_name = tag.GetParam(wxT("VALUE")); - if (tag.GetParam(wxT("NAME")) == wxT("Local")) - m_page = tag.GetParam(wxT("VALUE")); - if (tag.GetParam(wxT("NAME")) == wxT("ID")) - tag.GetParamAsInt(wxT("VALUE"), &m_id); - return false; - } -} - - -//----------------------------------------------------------------------------- -// wxHtmlHelpData -//----------------------------------------------------------------------------- - -wxString wxHtmlBookRecord::GetFullPath(const wxString &page) const -{ - if (wxIsAbsolutePath(page)) - return page; - else - return m_BasePath + page; -} - -wxString wxHtmlHelpDataItem::GetIndentedName() const -{ - wxString s; - for (int i = 1; i < level; i++) - s << _T(" "); - s << name; - return s; -} - - -IMPLEMENT_DYNAMIC_CLASS(wxHtmlHelpData, wxObject) - -wxHtmlHelpData::wxHtmlHelpData() -{ -#if WXWIN_COMPATIBILITY_2_4 - m_cacheContents = NULL; - m_cacheIndex = NULL; -#endif -} - -wxHtmlHelpData::~wxHtmlHelpData() -{ -#if WXWIN_COMPATIBILITY_2_4 - CleanCompatibilityData(); -#endif -} - -bool wxHtmlHelpData::LoadMSProject(wxHtmlBookRecord *book, wxFileSystem& fsys, - const wxString& indexfile, - const wxString& contentsfile) -{ - wxFSFile *f; - wxHtmlFilterHTML filter; - wxString buf; - wxString string; - - HP_Parser parser; - HP_TagHandler *handler = new HP_TagHandler(book); - parser.AddTagHandler(handler); - - f = ( contentsfile.empty() ? (wxFSFile*) NULL : fsys.OpenFile(contentsfile) ); - if (f) - { - buf.clear(); - buf = filter.ReadFile(*f); - delete f; - handler->Reset(m_contents); - parser.Parse(buf); - } - else - { - wxLogError(_("Cannot open contents file: %s"), contentsfile.c_str()); - } - - f = ( indexfile.empty() ? (wxFSFile*) NULL : fsys.OpenFile(indexfile) ); - if (f) - { - buf.clear(); - buf = filter.ReadFile(*f); - delete f; - handler->Reset(m_index); - parser.Parse(buf); - } - else if (!indexfile.empty()) - { - wxLogError(_("Cannot open index file: %s"), indexfile.c_str()); - } - return true; -} - -inline static void CacheWriteInt32(wxOutputStream *f, wxInt32 value) -{ - wxInt32 x = wxINT32_SWAP_ON_BE(value); - f->Write(&x, sizeof(x)); -} - -inline static wxInt32 CacheReadInt32(wxInputStream *f) -{ - wxInt32 x; - f->Read(&x, sizeof(x)); - return wxINT32_SWAP_ON_BE(x); -} - -inline static void CacheWriteString(wxOutputStream *f, const wxString& str) -{ - const wxWX2MBbuf mbstr = str.mb_str(wxConvUTF8); - size_t len = strlen((const char*)mbstr)+1; - CacheWriteInt32(f, len); - f->Write((const char*)mbstr, len); -} - -inline static wxString CacheReadString(wxInputStream *f) -{ - size_t len = (size_t)CacheReadInt32(f); - wxCharBuffer str(len-1); - f->Read(str.data(), len); - return wxString(str, wxConvUTF8); -} - -#define CURRENT_CACHED_BOOK_VERSION 5 - -// Additional flags to detect incompatibilities of the runtime environment: -#define CACHED_BOOK_FORMAT_FLAGS \ - (wxUSE_UNICODE << 0) - - -bool wxHtmlHelpData::LoadCachedBook(wxHtmlBookRecord *book, wxInputStream *f) -{ - int i, st, newsize; - wxInt32 version; - - /* load header - version info : */ - version = CacheReadInt32(f); - - if (version != CURRENT_CACHED_BOOK_VERSION) - { - // NB: We can just silently return false here and don't worry about - // it anymore, because AddBookParam will load the MS project in - // absence of (properly versioned) .cached file and automatically - // create new .cached file immediately afterward. - return false; - } - - if (CacheReadInt32(f) != CACHED_BOOK_FORMAT_FLAGS) - return false; - - /* load contents : */ - st = m_contents.size(); - newsize = st + CacheReadInt32(f); - m_contents.Alloc(newsize); - for (i = st; i < newsize; i++) - { - wxHtmlHelpDataItem *item = new wxHtmlHelpDataItem; - item->level = CacheReadInt32(f); - item->id = CacheReadInt32(f); - item->name = CacheReadString(f); - item->page = CacheReadString(f); - item->book = book; - m_contents.Add(item); - } - - /* load index : */ - st = m_index.size(); - newsize = st + CacheReadInt32(f); - m_index.Alloc(newsize); - for (i = st; i < newsize; i++) - { - wxHtmlHelpDataItem *item = new wxHtmlHelpDataItem; - item->name = CacheReadString(f); - item->page = CacheReadString(f); - item->level = CacheReadInt32(f); - item->book = book; - int parentShift = CacheReadInt32(f); - if (parentShift != 0) - item->parent = &m_index[m_index.size() - parentShift]; - m_index.Add(item); - } - return true; -} - - -bool wxHtmlHelpData::SaveCachedBook(wxHtmlBookRecord *book, wxOutputStream *f) -{ - int i; - wxInt32 cnt; - - /* save header - version info : */ - CacheWriteInt32(f, CURRENT_CACHED_BOOK_VERSION); - CacheWriteInt32(f, CACHED_BOOK_FORMAT_FLAGS); - - /* save contents : */ - int len = m_contents.size(); - for (cnt = 0, i = 0; i < len; i++) - if (m_contents[i].book == book && m_contents[i].level > 0) - cnt++; - CacheWriteInt32(f, cnt); - - for (i = 0; i < len; i++) - { - if (m_contents[i].book != book || m_contents[i].level == 0) - continue; - CacheWriteInt32(f, m_contents[i].level); - CacheWriteInt32(f, m_contents[i].id); - CacheWriteString(f, m_contents[i].name); - CacheWriteString(f, m_contents[i].page); - } - - /* save index : */ - len = m_index.size(); - for (cnt = 0, i = 0; i < len; i++) - if (m_index[i].book == book && m_index[i].level > 0) - cnt++; - CacheWriteInt32(f, cnt); - - for (i = 0; i < len; i++) - { - if (m_index[i].book != book || m_index[i].level == 0) - continue; - CacheWriteString(f, m_index[i].name); - CacheWriteString(f, m_index[i].page); - CacheWriteInt32(f, m_index[i].level); - // save distance to parent item, if any: - if (m_index[i].parent == NULL) - { - CacheWriteInt32(f, 0); - } - else - { - int cnt2 = 0; - wxHtmlHelpDataItem *parent = m_index[i].parent; - for (int j = i-1; j >= 0; j--) - { - if (m_index[j].book == book && m_index[j].level > 0) - cnt2++; - if (&m_index[j] == parent) - break; - } - wxASSERT(cnt2 > 0); - CacheWriteInt32(f, cnt2); - } - } - return true; -} - - -void wxHtmlHelpData::SetTempDir(const wxString& path) -{ - if (path.empty()) - m_tempPath = path; - else - { - if (wxIsAbsolutePath(path)) m_tempPath = path; - else m_tempPath = wxGetCwd() + _T("/") + path; - - if (m_tempPath[m_tempPath.length() - 1] != _T('/')) - m_tempPath << _T('/'); - } -} - - - -static wxString SafeFileName(const wxString& s) -{ - wxString res(s); - res.Replace(wxT("#"), wxT("_")); - res.Replace(wxT(":"), wxT("_")); - res.Replace(wxT("\\"), wxT("_")); - res.Replace(wxT("/"), wxT("_")); - return res; -} - -bool wxHtmlHelpData::AddBookParam(const wxFSFile& bookfile, - wxFontEncoding encoding, - const wxString& title, const wxString& contfile, - const wxString& indexfile, const wxString& deftopic, - const wxString& path) -{ - wxFileSystem fsys; - wxFSFile *fi; - wxHtmlBookRecord *bookr; - - int IndexOld = m_index.size(), - ContentsOld = m_contents.size(); - - if (!path.empty()) - fsys.ChangePathTo(path, true); - - size_t booksCnt = m_bookRecords.GetCount(); - for (size_t i = 0; i < booksCnt; i++) - { - if ( m_bookRecords[i].GetBookFile() == bookfile.GetLocation() ) - return true; // book is (was) loaded - } - - bookr = new wxHtmlBookRecord(bookfile.GetLocation(), fsys.GetPath(), title, deftopic); - - wxHtmlHelpDataItem *bookitem = new wxHtmlHelpDataItem; - bookitem->level = 0; - bookitem->id = 0; - bookitem->page = deftopic; - bookitem->name = title; - bookitem->book = bookr; - - // store the contents index for later - int cont_start = m_contents.size(); - - m_contents.Add(bookitem); - - // Try to find cached binary versions: - // 1. save file as book, but with .hhp.cached extension - // 2. same as 1. but in temp path - // 3. otherwise or if cache load failed, load it from MS. - - fi = fsys.OpenFile(bookfile.GetLocation() + wxT(".cached")); - - if (fi == NULL || -#if wxUSE_DATETIME - fi->GetModificationTime() < bookfile.GetModificationTime() || -#endif // wxUSE_DATETIME - !LoadCachedBook(bookr, fi->GetStream())) - { - if (fi != NULL) delete fi; - fi = fsys.OpenFile(m_tempPath + wxFileNameFromPath(bookfile.GetLocation()) + wxT(".cached")); - if (m_tempPath.empty() || fi == NULL || -#if wxUSE_DATETIME - fi->GetModificationTime() < bookfile.GetModificationTime() || -#endif // wxUSE_DATETIME - !LoadCachedBook(bookr, fi->GetStream())) - { - LoadMSProject(bookr, fsys, indexfile, contfile); - if (!m_tempPath.empty()) - { - wxFileOutputStream *outs = new wxFileOutputStream(m_tempPath + - SafeFileName(wxFileNameFromPath(bookfile.GetLocation())) + wxT(".cached")); - SaveCachedBook(bookr, outs); - delete outs; - } - } - } - - if (fi != NULL) delete fi; - - // Now store the contents range - bookr->SetContentsRange(cont_start, m_contents.size()); - -#if wxUSE_WCHAR_T - // MS HTML Help files [written by MS HTML Help Workshop] are broken - // in that the data are iso-8859-1 (including HTML entities), but must - // be interpreted as being in language's windows charset. Correct the - // differences here and also convert to wxConvLocal in ANSI build - if (encoding != wxFONTENCODING_SYSTEM) - { - #if wxUSE_UNICODE - #define CORRECT_STR(str, conv) \ - str = wxString((str).mb_str(wxConvISO8859_1), conv) - #else - #define CORRECT_STR(str, conv) \ - str = wxString((str).wc_str(conv), wxConvLocal) - #endif - wxCSConv conv(encoding); - size_t IndexCnt = m_index.size(); - size_t ContentsCnt = m_contents.size(); - size_t i; - for (i = IndexOld; i < IndexCnt; i++) - { - CORRECT_STR(m_index[i].name, conv); - } - for (i = ContentsOld; i < ContentsCnt; i++) - { - CORRECT_STR(m_contents[i].name, conv); - } - #undef CORRECT_STR - } -#else - wxUnusedVar(IndexOld); - wxUnusedVar(ContentsOld); - wxASSERT_MSG(encoding == wxFONTENCODING_SYSTEM, wxT("Help files need charset conversion, but wxUSE_WCHAR_T is 0")); -#endif // wxUSE_WCHAR_T/!wxUSE_WCHAR_T - - m_bookRecords.Add(bookr); - if (!m_index.empty()) - { - m_index.Sort(wxHtmlHelpIndexCompareFunc); - } - - return true; -} - - -bool wxHtmlHelpData::AddBook(const wxString& book) -{ - wxString extension(book.Right(4).Lower()); - if (extension == wxT(".zip") || -#if wxUSE_LIBMSPACK - extension == wxT(".chm") /*compressed html help book*/ || -#endif - extension == wxT(".htb") /*html book*/) - { - wxFileSystem fsys; - wxString s; - bool rt = false; - -#if wxUSE_LIBMSPACK - if (extension == wxT(".chm")) - s = fsys.FindFirst(book + wxT("#chm:*.hhp"), wxFILE); - else -#endif - s = fsys.FindFirst(book + wxT("#zip:*.hhp"), wxFILE); - - while (!s.empty()) - { - if (AddBook(s)) rt = true; - s = fsys.FindNext(); - } - - return rt; - } - - wxFSFile *fi; - wxFileSystem fsys; - - wxString title = _("noname"), - safetitle, - start = wxEmptyString, - contents = wxEmptyString, - index = wxEmptyString, - charset = wxEmptyString; - - fi = fsys.OpenFile(book); - if (fi == NULL) - { - wxLogError(_("Cannot open HTML help book: %s"), book.c_str()); - return false; - } - fsys.ChangePathTo(book); - - const wxChar *lineptr; - wxChar linebuf[300]; - wxString tmp; - wxHtmlFilterPlainText filter; - tmp = filter.ReadFile(*fi); - lineptr = tmp.c_str(); - - do - { - lineptr = ReadLine(lineptr, linebuf, 300); - - for (wxChar *ch = linebuf; *ch != wxT('\0') && *ch != wxT('='); ch++) - *ch = (wxChar)wxTolower(*ch); - - if (wxStrstr(linebuf, _T("title=")) == linebuf) - title = linebuf + wxStrlen(_T("title=")); - if (wxStrstr(linebuf, _T("default topic=")) == linebuf) - start = linebuf + wxStrlen(_T("default topic=")); - if (wxStrstr(linebuf, _T("index file=")) == linebuf) - index = linebuf + wxStrlen(_T("index file=")); - if (wxStrstr(linebuf, _T("contents file=")) == linebuf) - contents = linebuf + wxStrlen(_T("contents file=")); - if (wxStrstr(linebuf, _T("charset=")) == linebuf) - charset = linebuf + wxStrlen(_T("charset=")); - } while (lineptr != NULL); - - wxFontEncoding enc = wxFONTENCODING_SYSTEM; -#if wxUSE_FONTMAP - if (charset != wxEmptyString) - enc = wxFontMapper::Get()->CharsetToEncoding(charset); -#endif - - bool rtval = AddBookParam(*fi, enc, - title, contents, index, start, fsys.GetPath()); - delete fi; - -#if WXWIN_COMPATIBILITY_2_4 - CleanCompatibilityData(); -#endif - - return rtval; -} - -wxString wxHtmlHelpData::FindPageByName(const wxString& x) -{ - int cnt; - int i; - wxFileSystem fsys; - wxFSFile *f; - - // 1. try to open given file: - cnt = m_bookRecords.GetCount(); - for (i = 0; i < cnt; i++) - { - f = fsys.OpenFile(m_bookRecords[i].GetFullPath(x)); - if (f) - { - wxString url = m_bookRecords[i].GetFullPath(x); - delete f; - return url; - } - } - - - // 2. try to find a book: - for (i = 0; i < cnt; i++) - { - if (m_bookRecords[i].GetTitle() == x) - return m_bookRecords[i].GetFullPath(m_bookRecords[i].GetStart()); - } - - // 3. try to find in contents: - cnt = m_contents.size(); - for (i = 0; i < cnt; i++) - { - if (m_contents[i].name == x) - return m_contents[i].GetFullPath(); - } - - - // 4. try to find in index: - cnt = m_index.size(); - for (i = 0; i < cnt; i++) - { - if (m_index[i].name == x) - return m_index[i].GetFullPath(); - } - - // 4b. if still not found, try case-insensitive comparison - for (i = 0; i < cnt; i++) - { - if (m_index[i].name.CmpNoCase(x) == 0) - return m_index[i].GetFullPath(); - } - - return wxEmptyString; -} - -wxString wxHtmlHelpData::FindPageById(int id) -{ - size_t cnt = m_contents.size(); - for (size_t i = 0; i < cnt; i++) - { - if (m_contents[i].id == id) - { - return m_contents[i].GetFullPath(); - } - } - - return wxEmptyString; -} - -#if WXWIN_COMPATIBILITY_2_4 -wxHtmlContentsItem::wxHtmlContentsItem() - : m_Level(0), m_ID(wxID_ANY), m_Name(NULL), m_Page(NULL), m_Book(NULL), - m_autofree(false) -{ -} - -wxHtmlContentsItem::wxHtmlContentsItem(const wxHtmlHelpDataItem& d) -{ - m_autofree = true; - m_Level = d.level; - m_ID = d.id; - m_Name = wxStrdup(d.name.c_str()); - m_Page = wxStrdup(d.page.c_str()); - m_Book = d.book; -} - -wxHtmlContentsItem& wxHtmlContentsItem::operator=(const wxHtmlContentsItem& d) -{ - if (m_autofree) - { - free(m_Name); - free(m_Page); - } - m_autofree = true; - m_Level = d.m_Level; - m_ID = d.m_ID; - m_Name = d.m_Name ? wxStrdup(d.m_Name) : NULL; - m_Page = d.m_Page ? wxStrdup(d.m_Page) : NULL; - m_Book = d.m_Book; - return *this; -} - -wxHtmlContentsItem::~wxHtmlContentsItem() -{ - if (m_autofree) - { - free(m_Name); - free(m_Page); - } -} - -wxHtmlContentsItem* wxHtmlHelpData::GetContents() -{ - if (!m_cacheContents && !m_contents.empty()) - { - size_t len = m_contents.size(); - m_cacheContents = new wxHtmlContentsItem[len]; - for (size_t i = 0; i < len; i++) - m_cacheContents[i] = m_contents[i]; - } - return m_cacheContents; -} - -int wxHtmlHelpData::GetContentsCnt() -{ - return m_contents.size(); -} - -wxHtmlContentsItem* wxHtmlHelpData::GetIndex() -{ - if (!m_cacheContents && !m_index.empty()) - { - size_t len = m_index.size(); - m_cacheContents = new wxHtmlContentsItem[len]; - for (size_t i = 0; i < len; i++) - m_cacheContents[i] = m_index[i]; - } - return m_cacheContents; -} - -int wxHtmlHelpData::GetIndexCnt() -{ - return m_index.size(); -} - -void wxHtmlHelpData::CleanCompatibilityData() -{ - delete[] m_cacheContents; - m_cacheContents = NULL; - delete[] m_cacheIndex; - m_cacheIndex = NULL; -} -#endif // WXWIN_COMPATIBILITY_2_4 - -//---------------------------------------------------------------------------------- -// wxHtmlSearchStatus functions -//---------------------------------------------------------------------------------- - -wxHtmlSearchStatus::wxHtmlSearchStatus(wxHtmlHelpData* data, const wxString& keyword, - bool case_sensitive, bool whole_words_only, - const wxString& book) -{ - m_Data = data; - m_Keyword = keyword; - wxHtmlBookRecord* bookr = NULL; - if (book != wxEmptyString) - { - // we have to search in a specific book. Find it first - int i, cnt = data->m_bookRecords.GetCount(); - for (i = 0; i < cnt; i++) - if (data->m_bookRecords[i].GetTitle() == book) - { - bookr = &(data->m_bookRecords[i]); - m_CurIndex = bookr->GetContentsStart(); - m_MaxIndex = bookr->GetContentsEnd(); - break; - } - // check; we won't crash if the book doesn't exist, but it's Bad Anyway. - wxASSERT(bookr); - } - if (! bookr) - { - // no book specified; search all books - m_CurIndex = 0; - m_MaxIndex = m_Data->m_contents.size(); - } - m_Engine.LookFor(keyword, case_sensitive, whole_words_only); - m_Active = (m_CurIndex < m_MaxIndex); -} - -#if WXWIN_COMPATIBILITY_2_4 -wxHtmlContentsItem* wxHtmlSearchStatus::GetContentsItem() -{ - static wxHtmlContentsItem it; - it = wxHtmlContentsItem(*m_CurItem); - return ⁢ -} -#endif - -bool wxHtmlSearchStatus::Search() -{ - wxFSFile *file; - int i = m_CurIndex; // shortcut - bool found = false; - wxString thepage; - - if (!m_Active) - { - // sanity check. Illegal use, but we'll try to prevent a crash anyway - wxASSERT(m_Active); - return false; - } - - m_Name = wxEmptyString; - m_CurItem = NULL; - thepage = m_Data->m_contents[i].page; - - m_Active = (++m_CurIndex < m_MaxIndex); - // check if it is same page with different anchor: - if (!m_LastPage.empty()) - { - const wxChar *p1, *p2; - for (p1 = thepage.c_str(), p2 = m_LastPage.c_str(); - *p1 != 0 && *p1 != _T('#') && *p1 == *p2; p1++, p2++) {} - - m_LastPage = thepage; - - if (*p1 == 0 || *p1 == _T('#')) - return false; - } - else m_LastPage = thepage; - - wxFileSystem fsys; - file = fsys.OpenFile(m_Data->m_contents[i].book->GetFullPath(thepage)); - if (file) - { - if (m_Engine.Scan(*file)) - { - m_Name = m_Data->m_contents[i].name; - m_CurItem = &m_Data->m_contents[i]; - found = true; - } - delete file; - } - return found; -} - - - - - - - - -//-------------------------------------------------------------------------------- -// wxHtmlSearchEngine -//-------------------------------------------------------------------------------- - -void wxHtmlSearchEngine::LookFor(const wxString& keyword, bool case_sensitive, bool whole_words_only) -{ - m_CaseSensitive = case_sensitive; - m_WholeWords = whole_words_only; - m_Keyword = keyword; - - if (!m_CaseSensitive) - m_Keyword.LowerCase(); -} - - -static inline bool WHITESPACE(wxChar c) -{ - return c == _T(' ') || c == _T('\n') || c == _T('\r') || c == _T('\t'); -} - -// replace continuous spaces by one single space -static inline wxString CompressSpaces(const wxString & str) -{ - wxString buf; - buf.reserve( str.size() ); - - bool space_counted = false; - for( const wxChar * pstr = str.c_str(); *pstr; ++pstr ) - { - wxChar ch = *pstr; - if( WHITESPACE( ch ) ) - { - if( space_counted ) - { - continue; - } - ch = _T(' '); - space_counted = true; - } - else - { - space_counted = false; - } - buf += ch; - } - - return buf; -} - -bool wxHtmlSearchEngine::Scan(const wxFSFile& file) -{ - wxASSERT_MSG(!m_Keyword.empty(), wxT("wxHtmlSearchEngine::LookFor must be called before scanning!")); - - wxHtmlFilterHTML filter; - wxString bufStr = filter.ReadFile(file); - - if (!m_CaseSensitive) - bufStr.LowerCase(); - - { // remove html tags - wxString bufStrCopy; - bufStrCopy.reserve( bufStr.size() ); - bool insideTag = false; - for (const wxChar * pBufStr = bufStr.c_str(); *pBufStr; ++pBufStr) - { - wxChar c = *pBufStr; - if (insideTag) - { - if (c == _T('>')) - { - insideTag = false; - // replace the tag by an empty space - c = _T(' '); - } - else - continue; - } - else if (c == _T('<')) - { - wxChar nextCh = *(pBufStr + 1); - if (nextCh == _T('/') || !WHITESPACE(nextCh)) - { - insideTag = true; - continue; - } - } - bufStrCopy += c; - } - bufStr.swap( bufStrCopy ); - } - - wxString keyword = m_Keyword; - - if (m_WholeWords) - { - // insert ' ' at the beginning and at the end - keyword.insert( 0, _T(" ") ); - keyword.append( _T(" ") ); - bufStr.insert( 0, _T(" ") ); - bufStr.append( _T(" ") ); - } - - // remove continuous spaces - keyword = CompressSpaces( keyword ); - bufStr = CompressSpaces( bufStr ); - - // finally do the search - return bufStr.find( keyword ) != wxString::npos; -} - -#endif diff --git a/wxWidgets/src/html/helpdlg.cpp b/wxWidgets/src/html/helpdlg.cpp deleted file mode 100644 index dcf89b9330..0000000000 --- a/wxWidgets/src/html/helpdlg.cpp +++ /dev/null @@ -1,132 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/html/helpdlg.cpp -// Purpose: wxHtmlHelpDialog -// Notes: Based on htmlhelp.cpp, implementing a monolithic -// HTML Help controller class, by Vaclav Slavik -// Author: Harm van der Heijden, Vaclav Slavik and Julian Smart -// RCS-ID: $Id: helpdlg.cpp 50074 2007-11-19 09:12:08Z JS $ -// Copyright: (c) Harm van der Heijden, Vaclav Slavik and Julian Smart -// Licence: wxWidgets licence -///////////////////////////////////////////////////////////////////////////// - -// For compilers that support precompilation, includes "wx.h" -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_WXHTML_HELP - -#ifndef WXPRECOMP - #include "wx/object.h" - #include "wx/intl.h" - #include "wx/log.h" - - #include "wx/sizer.h" - - #include "wx/bmpbuttn.h" - #include "wx/statbox.h" - #include "wx/radiobox.h" - #include "wx/menu.h" - #include "wx/msgdlg.h" -#endif // WXPRECOMP - -#include "wx/html/htmlwin.h" -#include "wx/html/helpdlg.h" -#include "wx/html/helpctrl.h" -#include "wx/artprov.h" - -IMPLEMENT_DYNAMIC_CLASS(wxHtmlHelpDialog, wxDialog) - -BEGIN_EVENT_TABLE(wxHtmlHelpDialog, wxDialog) - EVT_CLOSE(wxHtmlHelpDialog::OnCloseWindow) -END_EVENT_TABLE() - -wxHtmlHelpDialog::wxHtmlHelpDialog(wxWindow* parent, wxWindowID id, const wxString& title, - int style, wxHtmlHelpData* data) -{ - Init(data); - Create(parent, id, title, style); -} - -void wxHtmlHelpDialog::Init(wxHtmlHelpData* data) -{ - // Simply pass the pointer on to the help window - m_Data = data; - m_HtmlHelpWin = NULL; - m_helpController = NULL; -} - -// Create: builds the GUI components. -bool wxHtmlHelpDialog::Create(wxWindow* parent, wxWindowID id, - const wxString& WXUNUSED(title), int style) -{ - m_HtmlHelpWin = new wxHtmlHelpWindow(m_Data); - - wxDialog::Create(parent, id, _("Help"), - wxPoint(m_HtmlHelpWin->GetCfgData().x, m_HtmlHelpWin->GetCfgData().y), - wxSize(m_HtmlHelpWin->GetCfgData().w, m_HtmlHelpWin->GetCfgData().h), - wxDEFAULT_FRAME_STYLE|wxRESIZE_BORDER, wxT("wxHtmlHelp")); - m_HtmlHelpWin->Create(this, wxID_ANY, wxDefaultPosition, GetClientSize(), - wxTAB_TRAVERSAL|wxNO_BORDER, style); - - GetPosition(& (m_HtmlHelpWin->GetCfgData().x), & (m_HtmlHelpWin->GetCfgData()).y); - - SetIcon(wxArtProvider::GetIcon(wxART_HELP, wxART_HELP_BROWSER)); - - wxWindow* item1 = this; - wxBoxSizer* item2 = new wxBoxSizer(wxVERTICAL); - item1->SetSizer(item2); - item1->SetAutoLayout(true); - - wxWindow* item3 = m_HtmlHelpWin; - item2->Add(item3, 1, wxGROW|wxALL, 5); - - wxBoxSizer* item4 = new wxBoxSizer(wxHORIZONTAL); - item2->Add(item4, 0, wxGROW, 5); - - item4->Add(5, 5, 1, wxALIGN_CENTER_VERTICAL|wxALL, 5); - - wxButton* item6 = new wxButton(item1, wxID_OK, _("Close"), wxDefaultPosition, wxDefaultSize, 0); - item4->Add(item6, 0, wxALIGN_CENTER_VERTICAL|wxALL, 10); -#ifdef __WXMAC__ - // Add some space for the resize handle - item4->Add(5, 5, 0, wxALIGN_CENTER_VERTICAL, 0); -#endif - - Layout(); - Centre(); - - return true; -} - -wxHtmlHelpDialog::~wxHtmlHelpDialog() -{ -} - -void wxHtmlHelpDialog::SetTitleFormat(const wxString& format) -{ - m_TitleFormat = format; -} - -void wxHtmlHelpDialog::OnCloseWindow(wxCloseEvent& evt) -{ - if (!IsIconized()) - { - GetSize(& (m_HtmlHelpWin->GetCfgData().w), &(m_HtmlHelpWin->GetCfgData().h)); - GetPosition(& (m_HtmlHelpWin->GetCfgData().x), & (m_HtmlHelpWin->GetCfgData().y)); - } - - if (m_HtmlHelpWin->GetSplitterWindow() && m_HtmlHelpWin->GetCfgData().navig_on) - m_HtmlHelpWin->GetCfgData().sashpos = m_HtmlHelpWin->GetSplitterWindow()->GetSashPosition(); - - if (m_helpController) - { - m_helpController->OnCloseFrame(evt); - } - - evt.Skip(); -} - -#endif // wxUSE_WXHTML_HELP diff --git a/wxWidgets/src/html/helpfrm.cpp b/wxWidgets/src/html/helpfrm.cpp deleted file mode 100644 index 85c63a89eb..0000000000 --- a/wxWidgets/src/html/helpfrm.cpp +++ /dev/null @@ -1,241 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/html/helpfrm.cpp -// Purpose: wxHtmlHelpFrame -// Notes: Based on htmlhelp.cpp, implementing a monolithic -// HTML Help controller class, by Vaclav Slavik -// Author: Harm van der Heijden and Vaclav Slavik -// RCS-ID: $Id: helpfrm.cpp 56234 2008-10-11 20:18:19Z VS $ -// Copyright: (c) Harm van der Heijden and Vaclav Slavik -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// For compilers that support precompilation, includes "wx.h" - -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_WXHTML_HELP - -#ifndef WXPRECOMP - #include "wx/object.h" - #include "wx/dynarray.h" - #include "wx/intl.h" - #include "wx/log.h" - #if wxUSE_STREAMS - #include "wx/stream.h" - #endif - - #include "wx/sizer.h" - - #include "wx/bmpbuttn.h" - #include "wx/statbox.h" - #include "wx/radiobox.h" - #include "wx/menu.h" - #include "wx/settings.h" - #include "wx/msgdlg.h" - #include "wx/textctrl.h" - #include "wx/toolbar.h" - #include "wx/choicdlg.h" - #include "wx/filedlg.h" -#endif // WXPRECOMP - -#include "wx/html/helpfrm.h" -#include "wx/html/helpctrl.h" -#include "wx/notebook.h" -#include "wx/imaglist.h" -#include "wx/treectrl.h" -#include "wx/tokenzr.h" -#include "wx/wfstream.h" -#include "wx/html/htmlwin.h" -#include "wx/busyinfo.h" -#include "wx/progdlg.h" -#include "wx/fontenum.h" -#include "wx/artprov.h" -#include "wx/spinctrl.h" - -IMPLEMENT_DYNAMIC_CLASS(wxHtmlHelpFrame, wxFrame) - -BEGIN_EVENT_TABLE(wxHtmlHelpFrame, wxFrame) - EVT_ACTIVATE(wxHtmlHelpFrame::OnActivate) - EVT_CLOSE(wxHtmlHelpFrame::OnCloseWindow) -#ifdef __WXMAC__ - EVT_MENU(wxID_CLOSE, wxHtmlHelpFrame::OnClose) - EVT_MENU(wxID_ABOUT, wxHtmlHelpFrame::OnAbout) - EVT_MENU(wxID_HELP_CONTENTS, wxHtmlHelpFrame::OnAbout) -#endif -END_EVENT_TABLE() - -wxHtmlHelpFrame::wxHtmlHelpFrame(wxWindow* parent, wxWindowID id, const wxString& title, - int style, wxHtmlHelpData* data, - wxConfigBase *config, const wxString& rootpath) -{ - Init(data); - Create(parent, id, title, style, config, rootpath); -} - -void wxHtmlHelpFrame::Init(wxHtmlHelpData* data) -{ - // Simply pass the pointer on to the help window - m_Data = data; - m_HtmlHelpWin = NULL; - m_helpController = (wxHtmlHelpController*) NULL; -} - -// Create: builds the GUI components. -bool wxHtmlHelpFrame::Create(wxWindow* parent, wxWindowID id, - const wxString& WXUNUSED(title), int style, - wxConfigBase *config, const wxString& rootpath) -{ - m_HtmlHelpWin = new wxHtmlHelpWindow(m_Data); - m_HtmlHelpWin->SetController(m_helpController); - if ( config) - m_HtmlHelpWin->UseConfig(config, rootpath); - - wxFrame::Create(parent, id, _("Help"), - wxPoint(m_HtmlHelpWin->GetCfgData().x, m_HtmlHelpWin->GetCfgData().y), - wxSize(m_HtmlHelpWin->GetCfgData().w, m_HtmlHelpWin->GetCfgData().h), - wxDEFAULT_FRAME_STYLE, wxT("wxHtmlHelp")); -#if wxUSE_STATUSBAR - CreateStatusBar(); -#endif - m_HtmlHelpWin->Create(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, - wxTAB_TRAVERSAL|wxNO_BORDER, style); - - GetPosition(& (m_HtmlHelpWin->GetCfgData().x), & (m_HtmlHelpWin->GetCfgData()).y); - - SetIcon(wxArtProvider::GetIcon(wxART_HELP, wxART_FRAME_ICON)); - - // On the Mac, each modeless frame must have a menubar. - // TODO: add more menu items, and perhaps add a style to show - // the menubar: compulsory on the Mac, optional elsewhere. -#ifdef __WXMAC__ - wxMenuBar* menuBar = new wxMenuBar; - - wxMenu* fileMenu = new wxMenu; - fileMenu->Append(wxID_HTML_OPENFILE, _("&Open...")); - fileMenu->AppendSeparator(); - fileMenu->Append(wxID_CLOSE, _("&Close")); - - wxMenu* helpMenu = new wxMenu; - helpMenu->Append(wxID_ABOUT, _("&About...")); - // Ensures we don't get an empty help menu - helpMenu->Append(wxID_HELP_CONTENTS, _("&About...")); - - menuBar->Append(fileMenu,_("&File")); - menuBar->Append(helpMenu,_("&Help")); - SetMenuBar(menuBar); -#endif - - m_HtmlHelpWin->GetHtmlWindow()->SetRelatedFrame(this, m_TitleFormat); -#if wxUSE_STATUSBAR - m_HtmlHelpWin->GetHtmlWindow()->SetRelatedStatusBar(0); -#endif - return true; -} - -wxHtmlHelpFrame::~wxHtmlHelpFrame() -{ -} - -void wxHtmlHelpFrame::SetTitleFormat(const wxString& format) -{ - if (GetHelpWindow() && GetHelpWindow()->GetHtmlWindow()) - GetHelpWindow()->GetHtmlWindow()->SetRelatedFrame(this, format); - m_TitleFormat = format; -} - -/* -EVENT HANDLING : -*/ - - -void wxHtmlHelpFrame::OnActivate(wxActivateEvent& event) -{ - // This saves one mouse click when using the - // wxHTML for context sensitive help systems -#ifndef __WXGTK__ - // NB: wxActivateEvent is a bit broken in wxGTK - // and is sometimes sent when it should not be - if (event.GetActive() && m_HtmlHelpWin) - m_HtmlHelpWin->GetHtmlWindow()->SetFocus(); -#endif - - event.Skip(); -} - -void wxHtmlHelpFrame::OnCloseWindow(wxCloseEvent& evt) -{ - if (!IsIconized()) - { - GetSize(& (m_HtmlHelpWin->GetCfgData().w), &(m_HtmlHelpWin->GetCfgData().h)); - GetPosition(& (m_HtmlHelpWin->GetCfgData().x), & (m_HtmlHelpWin->GetCfgData().y)); - } - -#ifdef __WXGTK__ - if (IsGrabbed()) - { - RemoveGrab(); - } -#endif - - if (m_HtmlHelpWin->GetSplitterWindow() && m_HtmlHelpWin->GetCfgData().navig_on) - m_HtmlHelpWin->GetCfgData().sashpos = m_HtmlHelpWin->GetSplitterWindow()->GetSashPosition(); - - if (m_helpController && m_helpController->IsKindOf(CLASSINFO(wxHtmlHelpController))) - { - ((wxHtmlHelpController*) m_helpController)->OnCloseFrame(evt); - } - - evt.Skip(); -} - -// Make the help controller's frame 'modal' if -// needed -void wxHtmlHelpFrame::AddGrabIfNeeded() -{ - // So far, wxGTK only -#ifdef __WXGTK__ - bool needGrab = false; - - // Check if there are any modal windows present, - // in which case we need to add a grab. - for ( wxWindowList::iterator it = wxTopLevelWindows.begin(); - it != wxTopLevelWindows.end(); - ++it ) - { - wxWindow *win = *it; - wxDialog *dialog = wxDynamicCast(win, wxDialog); - - if (dialog && dialog->IsModal()) - needGrab = true; - } - - if (needGrab) - AddGrab(); -#endif // __WXGTK__ -} - -// For compatibility -void wxHtmlHelpFrame::UseConfig(wxConfigBase *config, const wxString& rootPath) -{ - if (m_HtmlHelpWin) - m_HtmlHelpWin->UseConfig(config, rootPath); -} - -#ifdef __WXMAC__ -void wxHtmlHelpFrame::OnClose(wxCommandEvent& event) -{ - Close(true); -} - -void wxHtmlHelpFrame::OnAbout(wxCommandEvent& event) -{ - wxMessageBox(wxT("wxWidgets HTML Help Viewer (c) 1998-2006, Vaclav Slavik et al"), wxT("HelpView"), - wxICON_INFORMATION|wxOK, this); -} -#endif - -#endif // wxUSE_WXHTML_HELP diff --git a/wxWidgets/src/html/helpwnd.cpp b/wxWidgets/src/html/helpwnd.cpp deleted file mode 100644 index c3a8162281..0000000000 --- a/wxWidgets/src/html/helpwnd.cpp +++ /dev/null @@ -1,1774 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/html/helpwnd.cpp -// Purpose: wxHtmlHelpWindow -// Notes: Based on htmlhelp.cpp, implementing a monolithic -// HTML Help controller class, by Vaclav Slavik -// Author: Harm van der Heijden and Vaclav Slavik -// RCS-ID: $Id: helpwnd.cpp 67259 2011-03-20 12:27:35Z JS $ -// Copyright: (c) Harm van der Heijden and Vaclav Slavik -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// For compilers that support precompilation, includes "wx.h" - -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_WXHTML_HELP - -#ifndef WXPRECOMP - #include "wx/object.h" - #include "wx/dynarray.h" - #include "wx/intl.h" - #include "wx/log.h" - #if wxUSE_STREAMS - #include "wx/stream.h" - #endif - - #include "wx/sizer.h" - - #include "wx/bmpbuttn.h" - #include "wx/statbox.h" - #include "wx/radiobox.h" - #include "wx/menu.h" - #include "wx/settings.h" - #include "wx/msgdlg.h" - #include "wx/textctrl.h" - #include "wx/toolbar.h" - #include "wx/choicdlg.h" - #include "wx/filedlg.h" -#endif // WXPRECOMP - -#include "wx/html/helpfrm.h" -#include "wx/html/helpdlg.h" -#include "wx/html/helpctrl.h" -#include "wx/notebook.h" -#include "wx/imaglist.h" -#include "wx/treectrl.h" -#include "wx/tokenzr.h" -#include "wx/wfstream.h" -#include "wx/html/htmlwin.h" -#include "wx/busyinfo.h" -#include "wx/progdlg.h" -#include "wx/fontenum.h" -#include "wx/artprov.h" -#include "wx/spinctrl.h" - -// what is considered "small index"? -#define INDEX_IS_SMALL 100 - -/* Motif defines this as a macro */ -#ifdef Below -#undef Below -#endif - -//-------------------------------------------------------------------------- -// wxHtmlHelpTreeItemData (private) -//-------------------------------------------------------------------------- - -class wxHtmlHelpTreeItemData : public wxTreeItemData -{ - public: -#if defined(__VISAGECPP__) -// VA needs a default ctor for some reason.... - wxHtmlHelpTreeItemData() : wxTreeItemData() - { m_Id = 0; } -#endif - wxHtmlHelpTreeItemData(int id) : wxTreeItemData() - { m_Id = id;} - - int m_Id; -}; - - -//-------------------------------------------------------------------------- -// wxHtmlHelpHashData (private) -//-------------------------------------------------------------------------- - -class wxHtmlHelpHashData : public wxObject -{ - public: - wxHtmlHelpHashData(int index, wxTreeItemId id) : wxObject() - { m_Index = index; m_Id = id;} - virtual ~wxHtmlHelpHashData() {} - - int m_Index; - wxTreeItemId m_Id; -}; - - -//-------------------------------------------------------------------------- -// wxHtmlHelpHtmlWindow (private) -//-------------------------------------------------------------------------- - - -class wxHtmlHelpHtmlWindow : public wxHtmlWindow -{ -public: - wxHtmlHelpHtmlWindow(wxHtmlHelpWindow *win, wxWindow *parent, wxWindowID id = wxID_ANY, - const wxPoint& pos = wxDefaultPosition, const wxSize& sz = wxDefaultSize, long style = wxHW_DEFAULT_STYLE) - : wxHtmlWindow(parent, id, pos, sz, style), m_Window(win) - { - SetStandardFonts(); - } - - void OnLink(wxHtmlLinkEvent& ev) - { - const wxMouseEvent *e = ev.GetLinkInfo().GetEvent(); - if (e == NULL || e->LeftUp()) - m_Window->NotifyPageChanged(); - - // skip the event so that normal processing (i.e. following the link) - // is done: - ev.Skip(); - } - - // Returns full location with anchor (helper) - static wxString GetOpenedPageWithAnchor(wxHtmlWindow *win) - { - if(!win) - return wxEmptyString; - - wxString an = win->GetOpenedAnchor(); - wxString pg = win->GetOpenedPage(); - if(!an.empty()) - { - pg << wxT("#") << an; - } - return pg; - } - -private: - wxHtmlHelpWindow *m_Window; - - DECLARE_NO_COPY_CLASS(wxHtmlHelpHtmlWindow) - DECLARE_EVENT_TABLE() -}; - -BEGIN_EVENT_TABLE(wxHtmlHelpHtmlWindow, wxHtmlWindow) - EVT_HTML_LINK_CLICKED(wxID_ANY, wxHtmlHelpHtmlWindow::OnLink) -END_EVENT_TABLE() - - -//--------------------------------------------------------------------------- -// wxHtmlHelpWindow::m_mergedIndex -//--------------------------------------------------------------------------- - -WX_DEFINE_ARRAY_PTR(const wxHtmlHelpDataItem*, wxHtmlHelpDataItemPtrArray); - -struct wxHtmlHelpMergedIndexItem -{ - wxHtmlHelpMergedIndexItem *parent; - wxString name; - wxHtmlHelpDataItemPtrArray items; -}; - -WX_DECLARE_OBJARRAY(wxHtmlHelpMergedIndexItem, wxHtmlHelpMergedIndex); -#include "wx/arrimpl.cpp" -WX_DEFINE_OBJARRAY(wxHtmlHelpMergedIndex) - -void wxHtmlHelpWindow::UpdateMergedIndex() -{ - delete m_mergedIndex; - m_mergedIndex = new wxHtmlHelpMergedIndex; - wxHtmlHelpMergedIndex& merged = *m_mergedIndex; - - const wxHtmlHelpDataItems& items = m_Data->GetIndexArray(); - size_t len = items.size(); - - wxHtmlHelpMergedIndexItem *history[128] = {NULL}; - - for (size_t i = 0; i < len; i++) - { - const wxHtmlHelpDataItem& item = items[i]; - wxASSERT_MSG( item.level < 128, _T("nested index entries too deep") ); - - if (history[item.level] && - history[item.level]->items[0]->name == item.name) - { - // same index entry as previous one, update list of items - history[item.level]->items.Add(&item); - } - else - { - // new index entry - wxHtmlHelpMergedIndexItem *mi = new wxHtmlHelpMergedIndexItem(); - mi->name = item.GetIndentedName(); - mi->items.Add(&item); - mi->parent = (item.level == 0) ? NULL : history[item.level - 1]; - history[item.level] = mi; - merged.Add(mi); - } - } -} - -//--------------------------------------------------------------------------- -// wxHtmlHelpWindow -//--------------------------------------------------------------------------- - -IMPLEMENT_DYNAMIC_CLASS(wxHtmlHelpWindow, wxWindow) - -BEGIN_EVENT_TABLE(wxHtmlHelpWindow, wxWindow) - EVT_TOOL_RANGE(wxID_HTML_PANEL, wxID_HTML_OPTIONS, wxHtmlHelpWindow::OnToolbar) - EVT_BUTTON(wxID_HTML_BOOKMARKSREMOVE, wxHtmlHelpWindow::OnToolbar) - EVT_BUTTON(wxID_HTML_BOOKMARKSADD, wxHtmlHelpWindow::OnToolbar) - EVT_TREE_SEL_CHANGED(wxID_HTML_TREECTRL, wxHtmlHelpWindow::OnContentsSel) - EVT_LISTBOX(wxID_HTML_INDEXLIST, wxHtmlHelpWindow::OnIndexSel) - EVT_LISTBOX(wxID_HTML_SEARCHLIST, wxHtmlHelpWindow::OnSearchSel) - EVT_BUTTON(wxID_HTML_SEARCHBUTTON, wxHtmlHelpWindow::OnSearch) - EVT_TEXT_ENTER(wxID_HTML_SEARCHTEXT, wxHtmlHelpWindow::OnSearch) - EVT_BUTTON(wxID_HTML_INDEXBUTTON, wxHtmlHelpWindow::OnIndexFind) - EVT_TEXT_ENTER(wxID_HTML_INDEXTEXT, wxHtmlHelpWindow::OnIndexFind) - EVT_BUTTON(wxID_HTML_INDEXBUTTONALL, wxHtmlHelpWindow::OnIndexAll) - EVT_COMBOBOX(wxID_HTML_BOOKMARKSLIST, wxHtmlHelpWindow::OnBookmarksSel) - EVT_SIZE(wxHtmlHelpWindow::OnSize) -END_EVENT_TABLE() - -wxHtmlHelpWindow::wxHtmlHelpWindow(wxWindow* parent, wxWindowID id, - const wxPoint& pos, - const wxSize& size, - int style, int helpStyle, wxHtmlHelpData* data) -{ - Init(data); - Create(parent, id, pos, size, style, helpStyle); -} - -void wxHtmlHelpWindow::Init(wxHtmlHelpData* data) -{ - if (data) - { - m_Data = data; - m_DataCreated = false; - } - else - { - m_Data = new wxHtmlHelpData(); - m_DataCreated = true; - } - - m_ContentsPage = 0; - m_IndexPage = 0; - m_SearchPage = 0; - - m_ContentsBox = NULL; - m_IndexList = NULL; - m_IndexButton = NULL; - m_IndexButtonAll = NULL; - m_IndexText = NULL; - m_SearchList = NULL; - m_SearchButton = NULL; - m_SearchText = NULL; - m_SearchChoice = NULL; - m_IndexCountInfo = NULL; - m_Splitter = NULL; - m_NavigPan = NULL; - m_NavigNotebook = NULL; - m_HtmlWin = NULL; - m_Bookmarks = NULL; - m_SearchCaseSensitive = NULL; - m_SearchWholeWords = NULL; - - m_mergedIndex = NULL; - - m_Config = NULL; - m_ConfigRoot = wxEmptyString; - - m_Cfg.x = m_Cfg.y = wxDefaultCoord; - m_Cfg.w = 700; - m_Cfg.h = 480; - m_Cfg.sashpos = 240; - m_Cfg.navig_on = true; - - m_NormalFonts = m_FixedFonts = NULL; - m_NormalFace = m_FixedFace = wxEmptyString; -#ifdef __WXMSW__ - m_FontSize = 10; -#else - m_FontSize = 14; -#endif - -#if wxUSE_PRINTING_ARCHITECTURE - m_Printer = NULL; -#endif - - m_PagesHash = NULL; - m_UpdateContents = true; - m_toolBar = NULL; - m_helpController = (wxHtmlHelpController*) NULL; -} - -// Create: builds the GUI components. -// with the style flag it's possible to toggle the toolbar, contents, index and search -// controls. -// m_HtmlWin will *always* be created, but it's important to realize that -// m_ContentsBox, m_IndexList, m_SearchList, m_SearchButton, m_SearchText and -// m_SearchButton may be NULL. -// moreover, if no contents, index or searchpage is needed, m_Splitter and -// m_NavigPan will be NULL too (with m_HtmlWin directly connected to the frame) - -bool wxHtmlHelpWindow::Create(wxWindow* parent, wxWindowID id, - const wxPoint& pos, const wxSize& size, - int style, int helpStyle) -{ - m_hfStyle = helpStyle; - - // Do the config in two steps. We read the HtmlWindow customization after we - // create the window. - if (m_Config) - ReadCustomization(m_Config, m_ConfigRoot); - - wxWindow::Create(parent, id, pos, size, style, wxT("wxHtmlHelp")); - - SetHelpText(_("Displays help as you browse the books on the left.")); - - GetPosition(&m_Cfg.x, &m_Cfg.y); - - int notebook_page = 0; - - // The sizer for the whole top-level window. - wxSizer *topWindowSizer = new wxBoxSizer(wxVERTICAL); - SetSizer(topWindowSizer); - SetAutoLayout(true); - -#if wxUSE_TOOLBAR - // toolbar? - if (helpStyle & (wxHF_TOOLBAR | wxHF_FLAT_TOOLBAR)) - { - wxToolBar *toolBar = new wxToolBar(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, - wxNO_BORDER | wxTB_HORIZONTAL | - wxTB_DOCKABLE | wxTB_NODIVIDER | - (helpStyle & wxHF_FLAT_TOOLBAR ? wxTB_FLAT : 0)); - toolBar->SetMargins( 2, 2 ); - AddToolbarButtons(toolBar, helpStyle); - toolBar->Realize(); - topWindowSizer->Add(toolBar, 0, wxEXPAND); - m_toolBar = toolBar; - } -#endif //wxUSE_TOOLBAR - - wxSizer *navigSizer = NULL; - -#ifdef __WXMSW__ - wxBorder htmlWindowBorder = GetThemedBorderStyle(); - if (htmlWindowBorder == wxBORDER_SUNKEN) - htmlWindowBorder = wxBORDER_SIMPLE; -#else - wxBorder htmlWindowBorder = wxBORDER_SUNKEN; -#endif - - if (helpStyle & (wxHF_CONTENTS | wxHF_INDEX | wxHF_SEARCH)) - { - // traditional help controller; splitter window with html page on the - // right and a notebook containing various pages on the left - long splitterStyle = wxSP_3D; - // Drawing moving sash can cause problems on wxMac -#ifdef __WXMAC__ - splitterStyle |= wxSP_LIVE_UPDATE; -#endif - m_Splitter = new wxSplitterWindow(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, splitterStyle); - - topWindowSizer->Add(m_Splitter, 1, wxEXPAND); - - m_HtmlWin = new wxHtmlHelpHtmlWindow(this, m_Splitter, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxHW_DEFAULT_STYLE|htmlWindowBorder); - m_NavigPan = new wxPanel(m_Splitter, wxID_ANY); - m_NavigNotebook = new wxNotebook(m_NavigPan, wxID_HTML_NOTEBOOK, - wxDefaultPosition, wxDefaultSize); -#ifdef __WXMAC__ - m_NavigNotebook->SetWindowVariant(wxWINDOW_VARIANT_SMALL); -#endif - - navigSizer = new wxBoxSizer(wxVERTICAL); - navigSizer->Add(m_NavigNotebook, 1, wxEXPAND); - - m_NavigPan->SetSizer(navigSizer); - } - else - { - // only html window, no notebook with index,contents etc - m_HtmlWin = new wxHtmlWindow(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxHW_DEFAULT_STYLE|htmlWindowBorder); - topWindowSizer->Add(m_HtmlWin, 1, wxEXPAND); - } - - if ( m_Config ) - m_HtmlWin->ReadCustomization(m_Config, m_ConfigRoot); - - // contents tree panel? - if ( helpStyle & wxHF_CONTENTS ) - { - wxWindow *dummy = new wxPanel(m_NavigNotebook, wxID_HTML_INDEXPAGE); -#ifdef __WXMAC__ - dummy->SetWindowVariant(wxWINDOW_VARIANT_NORMAL); -#endif - wxSizer *topsizer = new wxBoxSizer(wxVERTICAL); - - topsizer->Add(0, 10); - - dummy->SetSizer(topsizer); - - if ( helpStyle & wxHF_BOOKMARKS ) - { - m_Bookmarks = new wxComboBox(dummy, wxID_HTML_BOOKMARKSLIST, - wxEmptyString, - wxDefaultPosition, wxDefaultSize, - 0, NULL, wxCB_READONLY | wxCB_SORT); - m_Bookmarks->Append(_("(bookmarks)")); - for (unsigned i = 0; i < m_BookmarksNames.GetCount(); i++) - m_Bookmarks->Append(m_BookmarksNames[i]); - m_Bookmarks->SetSelection(0); - - wxBitmapButton *bmpbt1, *bmpbt2; - bmpbt1 = new wxBitmapButton(dummy, wxID_HTML_BOOKMARKSADD, - wxArtProvider::GetBitmap(wxART_ADD_BOOKMARK, - wxART_BUTTON)); - bmpbt2 = new wxBitmapButton(dummy, wxID_HTML_BOOKMARKSREMOVE, - wxArtProvider::GetBitmap(wxART_DEL_BOOKMARK, - wxART_BUTTON)); -#if wxUSE_TOOLTIPS - bmpbt1->SetToolTip(_("Add current page to bookmarks")); - bmpbt2->SetToolTip(_("Remove current page from bookmarks")); -#endif // wxUSE_TOOLTIPS - - wxSizer *sizer = new wxBoxSizer(wxHORIZONTAL); - - sizer->Add(m_Bookmarks, 1, wxALIGN_CENTRE_VERTICAL | wxRIGHT, 5); - sizer->Add(bmpbt1, 0, wxALIGN_CENTRE_VERTICAL | wxRIGHT, 2); - sizer->Add(bmpbt2, 0, wxALIGN_CENTRE_VERTICAL, 0); - - topsizer->Add(sizer, 0, wxEXPAND | wxLEFT | wxBOTTOM | wxRIGHT, 10); - } - - m_ContentsBox = new wxTreeCtrl(dummy, wxID_HTML_TREECTRL, - wxDefaultPosition, wxDefaultSize, -#ifdef __WXGTK20__ - wxSUNKEN_BORDER | - wxTR_HAS_BUTTONS | wxTR_HIDE_ROOT | - wxTR_NO_LINES -#else - wxSUNKEN_BORDER | - wxTR_HAS_BUTTONS | wxTR_HIDE_ROOT | - wxTR_LINES_AT_ROOT -#endif - ); - - wxImageList *ContentsImageList = new wxImageList(16, 16); - ContentsImageList->Add(wxArtProvider::GetIcon(wxART_HELP_BOOK, - wxART_HELP_BROWSER, - wxSize(16, 16))); - ContentsImageList->Add(wxArtProvider::GetIcon(wxART_HELP_FOLDER, - wxART_HELP_BROWSER, - wxSize(16, 16))); - ContentsImageList->Add(wxArtProvider::GetIcon(wxART_HELP_PAGE, - wxART_HELP_BROWSER, - wxSize(16, 16))); - - m_ContentsBox->AssignImageList(ContentsImageList); - - topsizer->Add(m_ContentsBox, 1, - wxEXPAND | wxLEFT | wxBOTTOM | wxRIGHT, - 2); - - m_NavigNotebook->AddPage(dummy, _("Contents")); - m_ContentsPage = notebook_page++; - } - - // index listbox panel? - if ( helpStyle & wxHF_INDEX ) - { - wxWindow *dummy = new wxPanel(m_NavigNotebook, wxID_HTML_INDEXPAGE); -#ifdef __WXMAC__ - dummy->SetWindowVariant(wxWINDOW_VARIANT_NORMAL); -#endif - wxSizer *topsizer = new wxBoxSizer(wxVERTICAL); - - dummy->SetSizer(topsizer); - - m_IndexText = new wxTextCtrl(dummy, wxID_HTML_INDEXTEXT, wxEmptyString, - wxDefaultPosition, wxDefaultSize, - wxTE_PROCESS_ENTER); - m_IndexButton = new wxButton(dummy, wxID_HTML_INDEXBUTTON, _("Find")); - m_IndexButtonAll = new wxButton(dummy, wxID_HTML_INDEXBUTTONALL, - _("Show all")); - m_IndexCountInfo = new wxStaticText(dummy, wxID_HTML_COUNTINFO, - wxEmptyString, wxDefaultPosition, - wxDefaultSize, - wxALIGN_RIGHT | wxST_NO_AUTORESIZE); - m_IndexList = new wxListBox(dummy, wxID_HTML_INDEXLIST, - wxDefaultPosition, wxDefaultSize, - 0, NULL, wxLB_SINGLE); - -#if wxUSE_TOOLTIPS - m_IndexButton->SetToolTip(_("Display all index items that contain given substring. Search is case insensitive.")); - m_IndexButtonAll->SetToolTip(_("Show all items in index")); -#endif //wxUSE_TOOLTIPS - - topsizer->Add(m_IndexText, 0, wxEXPAND | wxALL, 10); - wxSizer *btsizer = new wxBoxSizer(wxHORIZONTAL); - btsizer->Add(m_IndexButton, 0, wxRIGHT, 2); - btsizer->Add(m_IndexButtonAll); - 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, 2); - - m_NavigNotebook->AddPage(dummy, _("Index")); - m_IndexPage = notebook_page++; - } - - // search list panel? - if ( helpStyle & wxHF_SEARCH ) - { - wxWindow *dummy = new wxPanel(m_NavigNotebook, wxID_HTML_INDEXPAGE); -#ifdef __WXMAC__ - dummy->SetWindowVariant(wxWINDOW_VARIANT_NORMAL); -#endif - wxSizer *sizer = new wxBoxSizer(wxVERTICAL); - - dummy->SetSizer(sizer); - - m_SearchText = new wxTextCtrl(dummy, wxID_HTML_SEARCHTEXT, - wxEmptyString, - wxDefaultPosition, wxDefaultSize, - wxTE_PROCESS_ENTER); - m_SearchChoice = new wxChoice(dummy, wxID_HTML_SEARCHCHOICE, - wxDefaultPosition, wxSize(125,wxDefaultCoord)); - m_SearchCaseSensitive = new wxCheckBox(dummy, wxID_ANY, _("Case sensitive")); - m_SearchWholeWords = new wxCheckBox(dummy, wxID_ANY, _("Whole words only")); - m_SearchButton = new wxButton(dummy, wxID_HTML_SEARCHBUTTON, _("Search")); -#if wxUSE_TOOLTIPS - m_SearchButton->SetToolTip(_("Search contents of help book(s) for all occurences of the text you typed above")); -#endif //wxUSE_TOOLTIPS - m_SearchList = new wxListBox(dummy, wxID_HTML_SEARCHLIST, - wxDefaultPosition, wxDefaultSize, - 0, NULL, wxLB_SINGLE); - - sizer->Add(m_SearchText, 0, wxEXPAND | wxALL, 10); - sizer->Add(m_SearchChoice, 0, wxEXPAND | wxLEFT | wxRIGHT | wxBOTTOM, 10); - 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, 2); - - m_NavigNotebook->AddPage(dummy, _("Search")); - m_SearchPage = notebook_page; - } - - m_HtmlWin->Show(); - - RefreshLists(); - - if ( navigSizer ) - { - navigSizer->SetSizeHints(m_NavigPan); - m_NavigPan->Layout(); - } - - // showtime - if ( m_NavigPan && m_Splitter ) - { - // The panel will have its own min size which the splitter - // should respect - //if (m_NavigPan) - // m_Splitter->SetMinimumPaneSize(m_NavigPan->GetBestSize().x); - //else - m_Splitter->SetMinimumPaneSize(20); - - if ( m_Cfg.navig_on ) - { - m_NavigPan->Show(); - m_Splitter->SplitVertically(m_NavigPan, m_HtmlWin, m_Cfg.sashpos); - } - else - { - m_NavigPan->Show(false); - m_Splitter->Initialize(m_HtmlWin); - } - } - - // Reduce flicker by updating the splitter pane sizes before the - // frame is shown - wxSizeEvent sizeEvent(GetSize(), GetId()); - ProcessEvent(sizeEvent); - - if (m_Splitter) - m_Splitter->UpdateSize(); - - return true; -} - -wxHtmlHelpWindow::~wxHtmlHelpWindow() -{ - if ( m_helpController ) - m_helpController->SetHelpWindow(NULL); - - delete m_mergedIndex; - - // PopEventHandler(); // wxhtmlhelpcontroller (not any more!) - if (m_DataCreated) - delete m_Data; - if (m_NormalFonts) delete m_NormalFonts; - if (m_FixedFonts) delete m_FixedFonts; - if (m_PagesHash) - { - WX_CLEAR_HASH_TABLE(*m_PagesHash); - delete m_PagesHash; - } -#if wxUSE_PRINTING_ARCHITECTURE - if (m_Printer) delete m_Printer; -#endif -} - -void wxHtmlHelpWindow::SetController(wxHtmlHelpController* controller) -{ - if (m_DataCreated) - delete m_Data; - m_helpController = controller; - m_Data = controller->GetHelpData(); - m_DataCreated = false; -} - -#if wxUSE_TOOLBAR -void wxHtmlHelpWindow::AddToolbarButtons(wxToolBar *toolBar, int style) -{ - wxBitmap wpanelBitmap = - wxArtProvider::GetBitmap(wxART_HELP_SIDE_PANEL, wxART_TOOLBAR); - wxBitmap wbackBitmap = - wxArtProvider::GetBitmap(wxART_GO_BACK, wxART_TOOLBAR); - wxBitmap wforwardBitmap = - wxArtProvider::GetBitmap(wxART_GO_FORWARD, wxART_TOOLBAR); - wxBitmap wupnodeBitmap = - wxArtProvider::GetBitmap(wxART_GO_TO_PARENT, wxART_TOOLBAR); - wxBitmap wupBitmap = - wxArtProvider::GetBitmap(wxART_GO_UP, wxART_TOOLBAR); - wxBitmap wdownBitmap = - wxArtProvider::GetBitmap(wxART_GO_DOWN, wxART_TOOLBAR); - wxBitmap wopenBitmap = - wxArtProvider::GetBitmap(wxART_FILE_OPEN, wxART_TOOLBAR); - wxBitmap wprintBitmap = - wxArtProvider::GetBitmap(wxART_PRINT, wxART_TOOLBAR); - wxBitmap woptionsBitmap = - wxArtProvider::GetBitmap(wxART_HELP_SETTINGS, wxART_TOOLBAR); - - wxASSERT_MSG( (wpanelBitmap.Ok() && wbackBitmap.Ok() && - wforwardBitmap.Ok() && wupnodeBitmap.Ok() && - wupBitmap.Ok() && wdownBitmap.Ok() && - wopenBitmap.Ok() && wprintBitmap.Ok() && - woptionsBitmap.Ok()), - wxT("One or more HTML help frame toolbar bitmap could not be loaded.")) ; - - - toolBar->AddTool(wxID_HTML_PANEL, wpanelBitmap, wxNullBitmap, - false, wxDefaultCoord, wxDefaultCoord, (wxObject *) NULL, - _("Show/hide navigation panel")); - - toolBar->AddSeparator(); - toolBar->AddTool(wxID_HTML_BACK, wbackBitmap, wxNullBitmap, - false, wxDefaultCoord, wxDefaultCoord, (wxObject *) NULL, - _("Go back")); - toolBar->AddTool(wxID_HTML_FORWARD, wforwardBitmap, wxNullBitmap, - false, wxDefaultCoord, wxDefaultCoord, (wxObject *) NULL, - _("Go forward")); - toolBar->AddSeparator(); - - toolBar->AddTool(wxID_HTML_UPNODE, wupnodeBitmap, wxNullBitmap, - false, wxDefaultCoord, wxDefaultCoord, (wxObject *) NULL, - _("Go one level up in document hierarchy")); - toolBar->AddTool(wxID_HTML_UP, wupBitmap, wxNullBitmap, - false, wxDefaultCoord, wxDefaultCoord, (wxObject *) NULL, - _("Previous page")); - toolBar->AddTool(wxID_HTML_DOWN, wdownBitmap, wxNullBitmap, - false, wxDefaultCoord, wxDefaultCoord, (wxObject *) NULL, - _("Next page")); - - if ((style & wxHF_PRINT) || (style & wxHF_OPEN_FILES)) - toolBar->AddSeparator(); - - if (style & wxHF_OPEN_FILES) - toolBar->AddTool(wxID_HTML_OPENFILE, wopenBitmap, wxNullBitmap, - false, wxDefaultCoord, wxDefaultCoord, (wxObject *) NULL, - _("Open HTML document")); - -#if wxUSE_PRINTING_ARCHITECTURE - if (style & wxHF_PRINT) - toolBar->AddTool(wxID_HTML_PRINT, wprintBitmap, wxNullBitmap, - false, wxDefaultCoord, wxDefaultCoord, (wxObject *) NULL, - _("Print this page")); -#endif - - toolBar->AddSeparator(); - toolBar->AddTool(wxID_HTML_OPTIONS, woptionsBitmap, wxNullBitmap, - false, wxDefaultCoord, wxDefaultCoord, (wxObject *) NULL, - _("Display options dialog")); - - // Allow application to add custom buttons - wxHtmlHelpFrame* parentFrame = wxDynamicCast(GetParent(), wxHtmlHelpFrame); - wxHtmlHelpDialog* parentDialog = wxDynamicCast(GetParent(), wxHtmlHelpDialog); - if (parentFrame) - parentFrame->AddToolbarButtons(toolBar, style); - if (parentDialog) - parentDialog->AddToolbarButtons(toolBar, style); -} -#endif //wxUSE_TOOLBAR - - -bool wxHtmlHelpWindow::Display(const wxString& x) -{ - wxString url = m_Data->FindPageByName(x); - if (!url.empty()) - { - m_HtmlWin->LoadPage(url); - NotifyPageChanged(); - return true; - } - - return false; -} - -bool wxHtmlHelpWindow::Display(const int id) -{ - wxString url = m_Data->FindPageById(id); - if (!url.empty()) - { - m_HtmlWin->LoadPage(url); - NotifyPageChanged(); - return true; - } - - return false; -} - -bool wxHtmlHelpWindow::DisplayContents() -{ - if (! m_ContentsBox) - return false; - - if (!m_Splitter->IsSplit()) - { - m_NavigPan->Show(); - m_HtmlWin->Show(); - m_Splitter->SplitVertically(m_NavigPan, m_HtmlWin, m_Cfg.sashpos); - m_Cfg.navig_on = true; - } - - m_NavigNotebook->SetSelection(m_ContentsPage); - - if (m_Data->GetBookRecArray().GetCount() > 0) - { - wxHtmlBookRecord& book = m_Data->GetBookRecArray()[0]; - if (!book.GetStart().empty()) - m_HtmlWin->LoadPage(book.GetFullPath(book.GetStart())); - } - - return true; -} - -bool wxHtmlHelpWindow::DisplayIndex() -{ - if (! m_IndexList) - return false; - - if (!m_Splitter->IsSplit()) - { - m_NavigPan->Show(); - m_HtmlWin->Show(); - m_Splitter->SplitVertically(m_NavigPan, m_HtmlWin, m_Cfg.sashpos); - } - - m_NavigNotebook->SetSelection(m_IndexPage); - - if (m_Data->GetBookRecArray().GetCount() > 0) - { - wxHtmlBookRecord& book = m_Data->GetBookRecArray()[0]; - if (!book.GetStart().empty()) - m_HtmlWin->LoadPage(book.GetFullPath(book.GetStart())); - } - - return true; -} - -void wxHtmlHelpWindow::DisplayIndexItem(const wxHtmlHelpMergedIndexItem *it) -{ - if (it->items.size() == 1) - { - if (!it->items[0]->page.empty()) - { - m_HtmlWin->LoadPage(it->items[0]->GetFullPath()); - NotifyPageChanged(); - } - } - else - { - wxBusyCursor busy_cursor; - - // more pages associated with this index item -- let the user choose - // which one she/he wants from a list: - wxArrayString arr; - size_t len = it->items.size(); - for (size_t i = 0; i < len; i++) - { - wxString page = it->items[i]->page; - // try to find page's title in contents: - const wxHtmlHelpDataItems& contents = m_Data->GetContentsArray(); - size_t clen = contents.size(); - for (size_t j = 0; j < clen; j++) - { - if (contents[j].page == page) - { - page = contents[j].name; - break; - } - } - arr.push_back(page); - } - - wxSingleChoiceDialog dlg(this, - _("Please choose the page to display:"), - _("Help Topics"), - arr, NULL, wxCHOICEDLG_STYLE & ~wxCENTRE); - if (dlg.ShowModal() == wxID_OK) - { - m_HtmlWin->LoadPage(it->items[dlg.GetSelection()]->GetFullPath()); - NotifyPageChanged(); - } - } -} - -bool wxHtmlHelpWindow::KeywordSearch(const wxString& keyword, - wxHelpSearchMode mode) -{ - if (mode == wxHELP_SEARCH_ALL) - { - if ( !(m_SearchList && - m_SearchButton && m_SearchText && m_SearchChoice) ) - return false; - } - else if (mode == wxHELP_SEARCH_INDEX) - { - if ( !(m_IndexList && - m_IndexButton && m_IndexButtonAll && m_IndexText) ) - return false; - } - - int foundcnt = 0; - wxString foundstr; - wxString book = wxEmptyString; - - if (!m_Splitter->IsSplit()) - { - m_NavigPan->Show(); - m_HtmlWin->Show(); - m_Splitter->SplitVertically(m_NavigPan, m_HtmlWin, m_Cfg.sashpos); - } - - if (mode == wxHELP_SEARCH_ALL) - { - m_NavigNotebook->SetSelection(m_SearchPage); - m_SearchList->Clear(); - m_SearchText->SetValue(keyword); - m_SearchButton->Disable(); - - if (m_SearchChoice->GetSelection() != 0) - book = m_SearchChoice->GetStringSelection(); - - wxHtmlSearchStatus status(m_Data, keyword, - m_SearchCaseSensitive->GetValue(), - m_SearchWholeWords->GetValue(), - book); - -#if wxUSE_PROGRESSDLG - wxProgressDialog progress(_("Searching..."), - _("No matching page found yet"), - status.GetMaxIndex(), this, - wxPD_APP_MODAL | wxPD_CAN_ABORT | wxPD_AUTO_HIDE); -#endif - - int curi; - while (status.IsActive()) - { - curi = status.GetCurIndex(); - if (curi % 32 == 0 -#if wxUSE_PROGRESSDLG - && !progress.Update(curi) -#endif - ) - break; - if (status.Search()) - { - foundstr.Printf(_("Found %i matches"), ++foundcnt); -#if wxUSE_PROGRESSDLG - progress.Update(status.GetCurIndex(), foundstr); -#endif - m_SearchList->Append(status.GetName(), (void*)status.GetCurItem()); - } - } - - m_SearchButton->Enable(); - m_SearchText->SetSelection(0, keyword.length()); - m_SearchText->SetFocus(); - } - else if (mode == wxHELP_SEARCH_INDEX) - { - m_NavigNotebook->SetSelection(m_IndexPage); - m_IndexList->Clear(); - m_IndexButton->Disable(); - m_IndexButtonAll->Disable(); - m_IndexText->SetValue(keyword); - - DoIndexFind(); - m_IndexButton->Enable(); - m_IndexButtonAll->Enable(); - foundcnt = m_IndexList->GetCount(); - } - - if (foundcnt) - { - switch ( mode ) - { - default: - wxFAIL_MSG( _T("unknown help search mode") ); - // fall back - - case wxHELP_SEARCH_ALL: - { - wxHtmlHelpDataItem *it = - (wxHtmlHelpDataItem*) m_SearchList->GetClientData(0); - if (it) - { - m_HtmlWin->LoadPage(it->GetFullPath()); - NotifyPageChanged(); - } - break; - } - - case wxHELP_SEARCH_INDEX: - { - wxHtmlHelpMergedIndexItem* it = - (wxHtmlHelpMergedIndexItem*) m_IndexList->GetClientData(0); - if (it) - DisplayIndexItem(it); - break; - } - } - - } - - return foundcnt > 0; -} - -void wxHtmlHelpWindow::CreateContents() -{ - if (! m_ContentsBox) - return ; - - if (m_PagesHash) - { - WX_CLEAR_HASH_TABLE(*m_PagesHash); - delete m_PagesHash; - } - - const wxHtmlHelpDataItems& contents = m_Data->GetContentsArray(); - - size_t cnt = contents.size(); - - m_PagesHash = new wxHashTable(wxKEY_STRING, 2 * cnt); - - const int MAX_ROOTS = 64; - wxTreeItemId roots[MAX_ROOTS]; - // VS: this array holds information about whether we've set item icon at - // given level. This is necessary because m_Data has a flat structure - // and there's no way of recognizing if some item has subitems or not. - // We set the icon later: when we find an item with level=n, we know - // that the last item with level=n-1 was afolder with subitems, so we - // set its icon accordingly - bool imaged[MAX_ROOTS]; - m_ContentsBox->DeleteAllItems(); - - roots[0] = m_ContentsBox->AddRoot(_("(Help)")); - imaged[0] = true; - - for (size_t i = 0; i < cnt; i++) - { - wxHtmlHelpDataItem *it = &contents[i]; - // Handle books: - if (it->level == 0) - { - if (m_hfStyle & wxHF_MERGE_BOOKS) - // VS: we don't want book nodes, books' content should - // appear under tree's root. This line will create a "fake" - // record about book node so that the rest of this look - // will believe there really _is_ a book node and will - // behave correctly. - roots[1] = roots[0]; - else - { - roots[1] = m_ContentsBox->AppendItem(roots[0], - it->name, IMG_Book, -1, - new wxHtmlHelpTreeItemData(i)); - m_ContentsBox->SetItemBold(roots[1], true); - } - imaged[1] = true; - } - // ...and their contents: - else - { - roots[it->level + 1] = m_ContentsBox->AppendItem( - roots[it->level], it->name, IMG_Page, - -1, new wxHtmlHelpTreeItemData(i)); - imaged[it->level + 1] = false; - } - - m_PagesHash->Put(it->GetFullPath(), - new wxHtmlHelpHashData(i, roots[it->level + 1])); - - // Set the icon for the node one level up in the hierarchy, - // unless already done (see comment above imaged[] declaration) - if (!imaged[it->level]) - { - int image = IMG_Folder; - if (m_hfStyle & wxHF_ICONS_BOOK) - image = IMG_Book; - else if (m_hfStyle & wxHF_ICONS_BOOK_CHAPTER) - image = (it->level == 1) ? IMG_Book : IMG_Folder; - m_ContentsBox->SetItemImage(roots[it->level], image); - m_ContentsBox->SetItemImage(roots[it->level], image, - wxTreeItemIcon_Selected); - imaged[it->level] = true; - } - } -} - -void wxHtmlHelpWindow::CreateIndex() -{ - if (! m_IndexList) - return ; - - m_IndexList->Clear(); - - size_t cnt = m_mergedIndex->size(); - - wxString cnttext; - if (cnt > INDEX_IS_SMALL) - cnttext.Printf(_("%i of %i"), 0, cnt); - else - cnttext.Printf(_("%i of %i"), cnt, cnt); - m_IndexCountInfo->SetLabel(cnttext); - if (cnt > INDEX_IS_SMALL) - return; - - for (size_t i = 0; i < cnt; i++) - m_IndexList->Append((*m_mergedIndex)[i].name, - (char*)(&(*m_mergedIndex)[i])); -} - -void wxHtmlHelpWindow::CreateSearch() -{ - if (! (m_SearchList && m_SearchChoice)) - return ; - m_SearchList->Clear(); - m_SearchChoice->Clear(); - m_SearchChoice->Append(_("Search in all books")); - const wxHtmlBookRecArray& bookrec = m_Data->GetBookRecArray(); - int i, cnt = bookrec.GetCount(); - for (i = 0; i < cnt; i++) - m_SearchChoice->Append(bookrec[i].GetTitle()); - m_SearchChoice->SetSelection(0); -} - -void wxHtmlHelpWindow::RefreshLists() -{ - // Update m_mergedIndex: - UpdateMergedIndex(); - // Update the controls - CreateContents(); - CreateIndex(); - CreateSearch(); -} - -void wxHtmlHelpWindow::ReadCustomization(wxConfigBase *cfg, const wxString& path) -{ - wxString oldpath; - wxString tmp; - - if (path != wxEmptyString) - { - oldpath = cfg->GetPath(); - cfg->SetPath(_T("/") + path); - } - - m_Cfg.navig_on = cfg->Read(wxT("hcNavigPanel"), m_Cfg.navig_on) != 0; - m_Cfg.sashpos = cfg->Read(wxT("hcSashPos"), m_Cfg.sashpos); - m_Cfg.x = cfg->Read(wxT("hcX"), m_Cfg.x); - m_Cfg.y = cfg->Read(wxT("hcY"), m_Cfg.y); - m_Cfg.w = cfg->Read(wxT("hcW"), m_Cfg.w); - m_Cfg.h = cfg->Read(wxT("hcH"), m_Cfg.h); - - m_FixedFace = cfg->Read(wxT("hcFixedFace"), m_FixedFace); - m_NormalFace = cfg->Read(wxT("hcNormalFace"), m_NormalFace); - m_FontSize = cfg->Read(wxT("hcBaseFontSize"), m_FontSize); - - { - int i; - int cnt; - wxString val, s; - - cnt = cfg->Read(wxT("hcBookmarksCnt"), 0L); - if (cnt != 0) - { - m_BookmarksNames.Clear(); - m_BookmarksPages.Clear(); - if (m_Bookmarks) - { - m_Bookmarks->Clear(); - m_Bookmarks->Append(_("(bookmarks)")); - } - - for (i = 0; i < cnt; i++) - { - val.Printf(wxT("hcBookmark_%i"), i); - s = cfg->Read(val); - m_BookmarksNames.Add(s); - if (m_Bookmarks) m_Bookmarks->Append(s); - val.Printf(wxT("hcBookmark_%i_url"), i); - s = cfg->Read(val); - m_BookmarksPages.Add(s); - } - } - } - - if (m_HtmlWin) - m_HtmlWin->ReadCustomization(cfg); - - if (path != wxEmptyString) - cfg->SetPath(oldpath); -} - -void wxHtmlHelpWindow::WriteCustomization(wxConfigBase *cfg, const wxString& path) -{ - wxString oldpath; - wxString tmp; - - if (path != wxEmptyString) - { - oldpath = cfg->GetPath(); - cfg->SetPath(_T("/") + path); - } - - cfg->Write(wxT("hcNavigPanel"), m_Cfg.navig_on); - cfg->Write(wxT("hcSashPos"), (long)m_Cfg.sashpos); - - // Don't write if iconized as this would make the window - // disappear next time it is shown! - cfg->Write(wxT("hcX"), (long)m_Cfg.x); - cfg->Write(wxT("hcY"), (long)m_Cfg.y); - cfg->Write(wxT("hcW"), (long)m_Cfg.w); - cfg->Write(wxT("hcH"), (long)m_Cfg.h); - - cfg->Write(wxT("hcFixedFace"), m_FixedFace); - cfg->Write(wxT("hcNormalFace"), m_NormalFace); - cfg->Write(wxT("hcBaseFontSize"), (long)m_FontSize); - - if (m_Bookmarks) - { - int i; - int cnt = m_BookmarksNames.GetCount(); - wxString val; - - cfg->Write(wxT("hcBookmarksCnt"), (long)cnt); - for (i = 0; i < cnt; i++) - { - val.Printf(wxT("hcBookmark_%i"), i); - cfg->Write(val, m_BookmarksNames[i]); - val.Printf(wxT("hcBookmark_%i_url"), i); - cfg->Write(val, m_BookmarksPages[i]); - } - } - - if (m_HtmlWin) - m_HtmlWin->WriteCustomization(cfg); - - if (path != wxEmptyString) - cfg->SetPath(oldpath); -} - -static void SetFontsToHtmlWin(wxHtmlWindow *win, const wxString& scalf, const wxString& fixf, int size) -{ - int f_sizes[7]; - f_sizes[0] = int(size * 0.6); - f_sizes[1] = int(size * 0.8); - f_sizes[2] = size; - f_sizes[3] = int(size * 1.2); - f_sizes[4] = int(size * 1.4); - f_sizes[5] = int(size * 1.6); - f_sizes[6] = int(size * 1.8); - - win->SetFonts(scalf, fixf, f_sizes); -} - -class wxHtmlHelpWindowOptionsDialog : public wxDialog -{ -public: - wxComboBox *NormalFont, *FixedFont; - wxSpinCtrl *FontSize; - wxHtmlWindow *TestWin; - - wxHtmlHelpWindowOptionsDialog(wxWindow *parent) - : wxDialog(parent, wxID_ANY, wxString(_("Help Browser Options"))) - { - wxBoxSizer *topsizer = new wxBoxSizer(wxVERTICAL); - wxFlexGridSizer *sizer = new wxFlexGridSizer(2, 3, 2, 5); - - sizer->Add(new wxStaticText(this, wxID_ANY, _("Normal font:"))); - sizer->Add(new wxStaticText(this, wxID_ANY, _("Fixed font:"))); - sizer->Add(new wxStaticText(this, wxID_ANY, _("Font size:"))); - - sizer->Add(NormalFont = new wxComboBox(this, wxID_ANY, wxEmptyString, wxDefaultPosition, - wxSize(200, wxDefaultCoord), - 0, NULL, wxCB_DROPDOWN | wxCB_READONLY)); - - sizer->Add(FixedFont = new wxComboBox(this, wxID_ANY, wxEmptyString, wxDefaultPosition, - wxSize(200, wxDefaultCoord), - 0, NULL, wxCB_DROPDOWN | wxCB_READONLY)); - - sizer->Add(FontSize = new wxSpinCtrl(this, wxID_ANY, wxEmptyString, wxDefaultPosition, - wxDefaultSize, wxSP_ARROW_KEYS, 2, 100, 2, _T("wxSpinCtrl"))); - - topsizer->Add(sizer, 0, wxLEFT|wxRIGHT|wxTOP, 10); - - topsizer->Add(new wxStaticText(this, wxID_ANY, _("Preview:")), - 0, wxLEFT | wxTOP, 10); - - int style = wxHW_SCROLLBAR_AUTO; - -#ifdef __WXMSW__ - style |= GetThemedBorderStyle(); -#else - style |= wxBORDER_SUNKEN; -#endif - topsizer->AddSpacer(5); - - topsizer->Add(TestWin = new wxHtmlWindow(this, wxID_ANY, wxDefaultPosition, wxSize(20, 150), - style), - 1, wxEXPAND | wxLEFT|wxRIGHT, 10); - - wxBoxSizer *sizer2 = new wxBoxSizer(wxHORIZONTAL); - wxButton *ok; - sizer2->Add(ok = new wxButton(this, wxID_OK), 0, wxALL, 10); - ok->SetDefault(); - sizer2->Add(new wxButton(this, wxID_CANCEL), 0, wxALL, 10); - topsizer->Add(sizer2, 0, wxALIGN_RIGHT); - - SetSizer(topsizer); - topsizer->Fit(this); - Centre(wxBOTH); - } - - - void UpdateTestWin() - { - wxBusyCursor bcur; - SetFontsToHtmlWin(TestWin, - NormalFont->GetStringSelection(), - FixedFont->GetStringSelection(), - FontSize->GetValue()); - - wxString content(_("font size")); - - content = _T("") + content + _T(" -2
") - _T("") + content + _T(" -1
") - _T("") + content + _T(" +0
") - _T("") + content + _T(" +1
") - _T("") + content + _T(" +2
") - _T("") + content + _T(" +3
") - _T("") + content + _T(" +4
") ; - - content = wxString( _T("
") ) + - _("Normal face
and underlined. ") + - _("Italic face. ") + - _("Bold face. ") + - _("Bold italic face.
") + - content + - wxString( _T("
") ) + - _("Fixed size face.
bold italic ") + - _("bold italic underlined
") + - content + - _T("
"); - - TestWin->SetPage( content ); - } - - void OnUpdate(wxCommandEvent& WXUNUSED(event)) - { - UpdateTestWin(); - } - void OnUpdateSpin(wxSpinEvent& WXUNUSED(event)) - { - UpdateTestWin(); - } - - DECLARE_EVENT_TABLE() - DECLARE_NO_COPY_CLASS(wxHtmlHelpWindowOptionsDialog) -}; - -BEGIN_EVENT_TABLE(wxHtmlHelpWindowOptionsDialog, wxDialog) - EVT_COMBOBOX(wxID_ANY, wxHtmlHelpWindowOptionsDialog::OnUpdate) - EVT_SPINCTRL(wxID_ANY, wxHtmlHelpWindowOptionsDialog::OnUpdateSpin) -END_EVENT_TABLE() - -void wxHtmlHelpWindow::OptionsDialog() -{ - wxHtmlHelpWindowOptionsDialog dlg(this); - unsigned i; - - if (m_NormalFonts == NULL) - { - m_NormalFonts = new wxArrayString(wxFontEnumerator::GetFacenames()); - m_NormalFonts->Sort(); // ascending sort - } - if (m_FixedFonts == NULL) - { - m_FixedFonts = new wxArrayString( - wxFontEnumerator::GetFacenames(wxFONTENCODING_SYSTEM, - true /*enum fixed width only*/)); - m_FixedFonts->Sort(); // ascending sort - } - - // VS: We want to show the font that is actually used by wxHtmlWindow. - // If customization dialog wasn't used yet, facenames are empty and - // wxHtmlWindow uses default fonts -- let's find out what they - // are so that we can pass them to the dialog: - if (m_NormalFace.empty()) - { - wxFont fnt(m_FontSize, wxSWISS, wxNORMAL, wxNORMAL, false); - m_NormalFace = fnt.GetFaceName(); - } - if (m_FixedFace.empty()) - { - wxFont fnt(m_FontSize, wxMODERN, wxNORMAL, wxNORMAL, false); - m_FixedFace = fnt.GetFaceName(); - } - - for (i = 0; i < m_NormalFonts->GetCount(); i++) - dlg.NormalFont->Append((*m_NormalFonts)[i]); - for (i = 0; i < m_FixedFonts->GetCount(); i++) - dlg.FixedFont->Append((*m_FixedFonts)[i]); - if (!m_NormalFace.empty()) - dlg.NormalFont->SetStringSelection(m_NormalFace); - else - dlg.NormalFont->SetSelection(0); - if (!m_FixedFace.empty()) - dlg.FixedFont->SetStringSelection(m_FixedFace); - else - dlg.FixedFont->SetSelection(0); - dlg.FontSize->SetValue(m_FontSize); - dlg.UpdateTestWin(); - - if (dlg.ShowModal() == wxID_OK) - { - m_NormalFace = dlg.NormalFont->GetStringSelection(); - m_FixedFace = dlg.FixedFont->GetStringSelection(); - m_FontSize = dlg.FontSize->GetValue(); - SetFontsToHtmlWin(m_HtmlWin, m_NormalFace, m_FixedFace, m_FontSize); - } -} - -void wxHtmlHelpWindow::NotifyPageChanged() -{ - if (m_UpdateContents && m_PagesHash) - { - wxString page = wxHtmlHelpHtmlWindow::GetOpenedPageWithAnchor(m_HtmlWin); - wxHtmlHelpHashData *ha = NULL; - if (!page.empty()) - ha = (wxHtmlHelpHashData*) m_PagesHash->Get(page); - - if (ha) - { - bool olduc = m_UpdateContents; - m_UpdateContents = false; - m_ContentsBox->SelectItem(ha->m_Id); - m_ContentsBox->EnsureVisible(ha->m_Id); - m_UpdateContents = olduc; - } - } -} - -/* -EVENT HANDLING : -*/ - - -void wxHtmlHelpWindow::OnToolbar(wxCommandEvent& event) -{ - switch (event.GetId()) - { - case wxID_HTML_BACK : - m_HtmlWin->HistoryBack(); - NotifyPageChanged(); - break; - - case wxID_HTML_FORWARD : - m_HtmlWin->HistoryForward(); - NotifyPageChanged(); - break; - - case wxID_HTML_UP : - if (m_PagesHash) - { - wxString page = wxHtmlHelpHtmlWindow::GetOpenedPageWithAnchor(m_HtmlWin); - wxHtmlHelpHashData *ha = NULL; - if (!page.empty()) - ha = (wxHtmlHelpHashData*) m_PagesHash->Get(page); - if (ha && ha->m_Index > 0) - { - const wxHtmlHelpDataItem& it = m_Data->GetContentsArray()[ha->m_Index - 1]; - if (!it.page.empty()) - { - m_HtmlWin->LoadPage(it.GetFullPath()); - NotifyPageChanged(); - } - } - } - break; - - case wxID_HTML_UPNODE : - if (m_PagesHash) - { - wxString page = wxHtmlHelpHtmlWindow::GetOpenedPageWithAnchor(m_HtmlWin); - wxHtmlHelpHashData *ha = NULL; - if (!page.empty()) - ha = (wxHtmlHelpHashData*) m_PagesHash->Get(page); - if (ha && ha->m_Index > 0) - { - int level = - m_Data->GetContentsArray()[ha->m_Index].level - 1; - int ind = ha->m_Index - 1; - - const wxHtmlHelpDataItem *it = - &m_Data->GetContentsArray()[ind]; - while (ind >= 0 && it->level != level) - { - ind--; - it = &m_Data->GetContentsArray()[ind]; - } - if (ind >= 0) - { - if (!it->page.empty()) - { - m_HtmlWin->LoadPage(it->GetFullPath()); - NotifyPageChanged(); - } - } - } - } - break; - - case wxID_HTML_DOWN : - if (m_PagesHash) - { - wxString page = wxHtmlHelpHtmlWindow::GetOpenedPageWithAnchor(m_HtmlWin); - wxHtmlHelpHashData *ha = NULL; - if (!page.empty()) - ha = (wxHtmlHelpHashData*) m_PagesHash->Get(page); - - const wxHtmlHelpDataItems& contents = m_Data->GetContentsArray(); - if (ha && ha->m_Index < (int)contents.size() - 1) - { - size_t idx = ha->m_Index + 1; - - while (contents[idx].GetFullPath() == page) idx++; - - if (!contents[idx].page.empty()) - { - m_HtmlWin->LoadPage(contents[idx].GetFullPath()); - NotifyPageChanged(); - } - } - } - break; - - case wxID_HTML_PANEL : - { - if (! (m_Splitter && m_NavigPan)) - return ; - if (m_Splitter->IsSplit()) - { - m_Cfg.sashpos = m_Splitter->GetSashPosition(); - m_Splitter->Unsplit(m_NavigPan); - m_Cfg.navig_on = false; - } - else - { - m_NavigPan->Show(); - m_HtmlWin->Show(); - m_Splitter->SplitVertically(m_NavigPan, m_HtmlWin, m_Cfg.sashpos); - m_Cfg.navig_on = true; - } - } - break; - - case wxID_HTML_OPTIONS : - OptionsDialog(); - break; - - case wxID_HTML_BOOKMARKSADD : - { - wxString item; - wxString url; - - item = m_HtmlWin->GetOpenedPageTitle(); - url = m_HtmlWin->GetOpenedPage(); - if (item == wxEmptyString) - item = url.AfterLast(wxT('/')); - if (m_BookmarksPages.Index(url) == wxNOT_FOUND) - { - m_Bookmarks->Append(item); - m_BookmarksNames.Add(item); - m_BookmarksPages.Add(url); - } - } - break; - - case wxID_HTML_BOOKMARKSREMOVE : - { - wxString item; - int pos; - - item = m_Bookmarks->GetStringSelection(); - pos = m_BookmarksNames.Index(item); - if (pos != wxNOT_FOUND) - { - m_BookmarksNames.RemoveAt(pos); - m_BookmarksPages.RemoveAt(pos); - pos = m_Bookmarks->GetSelection(); - wxASSERT_MSG( pos != wxNOT_FOUND , wxT("Unknown bookmark position") ) ; - m_Bookmarks->Delete((unsigned int)pos); - } - } - break; - -#if wxUSE_PRINTING_ARCHITECTURE - case wxID_HTML_PRINT : - { - if (m_Printer == NULL) - m_Printer = new wxHtmlEasyPrinting(_("Help Printing"), this); - if (!m_HtmlWin->GetOpenedPage()) - wxLogWarning(_("Cannot print empty page.")); - else - m_Printer->PrintFile(m_HtmlWin->GetOpenedPage()); - } - break; -#endif - - case wxID_HTML_OPENFILE : - { - wxString filemask = wxString( - _("HTML files (*.html;*.htm)|*.html;*.htm|")) + - _("Help books (*.htb)|*.htb|Help books (*.zip)|*.zip|") + - _("HTML Help Project (*.hhp)|*.hhp|") + -#if wxUSE_LIBMSPACK - _("Compressed HTML Help file (*.chm)|*.chm|") + -#endif - _("All files (*.*)|*"); - wxString s = wxFileSelector(_("Open HTML document"), - wxEmptyString, - wxEmptyString, - wxEmptyString, - filemask, - wxFD_OPEN | wxFD_FILE_MUST_EXIST, - this); - if (!s.empty()) - { - wxString ext = s.Right(4).Lower(); - if (ext == _T(".zip") || ext == _T(".htb") || -#if wxUSE_LIBMSPACK - ext == _T(".chm") || -#endif - ext == _T(".hhp")) - { - wxBusyCursor bcur; - m_Data->AddBook(s); - RefreshLists(); - } - else - m_HtmlWin->LoadPage(s); - } - } - break; - } -} - -void wxHtmlHelpWindow::OnContentsSel(wxTreeEvent& event) -{ - wxHtmlHelpTreeItemData *pg; - - pg = (wxHtmlHelpTreeItemData*) m_ContentsBox->GetItemData(event.GetItem()); - - if (pg && m_UpdateContents) - { - const wxHtmlHelpDataItems& contents = m_Data->GetContentsArray(); - m_UpdateContents = false; - if (!contents[pg->m_Id].page.empty()) - m_HtmlWin->LoadPage(contents[pg->m_Id].GetFullPath()); - m_UpdateContents = true; - } -} - -void wxHtmlHelpWindow::OnIndexSel(wxCommandEvent& WXUNUSED(event)) -{ - wxHtmlHelpMergedIndexItem *it = (wxHtmlHelpMergedIndexItem*) - m_IndexList->GetClientData(m_IndexList->GetSelection()); - if (it) - DisplayIndexItem(it); -} - -void wxHtmlHelpWindow::OnIndexFind(wxCommandEvent& WXUNUSED(event)) -{ - DoIndexFind(); -} - -void wxHtmlHelpWindow::DoIndexFind() -{ - wxString sr = m_IndexText->GetLineText(0); - sr.MakeLower(); - if (sr == wxEmptyString) - { - DoIndexAll(); - } - else - { - wxBusyCursor bcur; - - m_IndexList->Clear(); - const wxHtmlHelpMergedIndex& index = *m_mergedIndex; - size_t cnt = index.size(); - - int displ = 0; - for (size_t i = 0; i < cnt; i++) - { - if (index[i].name.Lower().find(sr) != wxString::npos) - { - int pos = m_IndexList->Append(index[i].name, - (char*)(&index[i])); - - if (displ++ == 0) - { - // don't automatically show topic selector if this - // item points to multiple pages: - if (index[i].items.size() == 1) - { - m_IndexList->SetSelection(0); - DisplayIndexItem(&index[i]); - } - } - - // if this is nested item of the index, show its parent(s) - // as well, otherwise it would not be clear what entry is - // shown: - wxHtmlHelpMergedIndexItem *parent = index[i].parent; - while (parent) - { - if (pos == 0 || - (index.Index(*(wxHtmlHelpMergedIndexItem*)m_IndexList->GetClientData(pos-1))) < index.Index(*parent)) - { - m_IndexList->Insert(parent->name, - pos, (char*)parent); - parent = parent->parent; - } - else break; - } - - // finally, it the item we just added is itself a parent for - // other items, show them as well, because they are refinements - // of the displayed index entry (i.e. it is implicitly contained - // in them: "foo" with parent "bar" reads as "bar, foo"): - int level = index[i].items[0]->level; - i++; - while (i < cnt && index[i].items[0]->level > level) - { - m_IndexList->Append(index[i].name, (char*)(&index[i])); - i++; - } - i--; - } - } - - wxString cnttext; - cnttext.Printf(_("%i of %i"), displ, cnt); - m_IndexCountInfo->SetLabel(cnttext); - - m_IndexText->SetSelection(0, sr.length()); - m_IndexText->SetFocus(); - } -} - -void wxHtmlHelpWindow::OnIndexAll(wxCommandEvent& WXUNUSED(event)) -{ - DoIndexAll(); -} - -void wxHtmlHelpWindow::DoIndexAll() -{ - wxBusyCursor bcur; - - m_IndexList->Clear(); - const wxHtmlHelpMergedIndex& index = *m_mergedIndex; - size_t cnt = index.size(); - bool first = true; - - for (size_t i = 0; i < cnt; i++) - { - m_IndexList->Append(index[i].name, (char*)(&index[i])); - if (first) - { - // don't automatically show topic selector if this - // item points to multiple pages: - if (index[i].items.size() == 1) - { - DisplayIndexItem(&index[i]); - } - first = false; - } - } - - wxString cnttext; - cnttext.Printf(_("%i of %i"), cnt, cnt); - m_IndexCountInfo->SetLabel(cnttext); -} - -void wxHtmlHelpWindow::OnSearchSel(wxCommandEvent& WXUNUSED(event)) -{ - wxHtmlHelpDataItem *it = (wxHtmlHelpDataItem*) m_SearchList->GetClientData(m_SearchList->GetSelection()); - if (it) - { - if (!it->page.empty()) - m_HtmlWin->LoadPage(it->GetFullPath()); - NotifyPageChanged(); - } -} - -void wxHtmlHelpWindow::OnSearch(wxCommandEvent& WXUNUSED(event)) -{ - wxString sr = m_SearchText->GetLineText(0); - - if (!sr.empty()) - KeywordSearch(sr, wxHELP_SEARCH_ALL); -} - -void wxHtmlHelpWindow::OnBookmarksSel(wxCommandEvent& WXUNUSED(event)) -{ - wxString str = m_Bookmarks->GetStringSelection(); - int idx = m_BookmarksNames.Index(str); - if (!str.empty() && str != _("(bookmarks)") && idx != wxNOT_FOUND) - { - m_HtmlWin->LoadPage(m_BookmarksPages[(size_t)idx]); - NotifyPageChanged(); - } -} - -void wxHtmlHelpWindow::OnSize(wxSizeEvent& WXUNUSED(event)) -{ - Layout(); -} - -#endif // wxUSE_WXHTML_HELP diff --git a/wxWidgets/src/html/htmlcell.cpp b/wxWidgets/src/html/htmlcell.cpp deleted file mode 100644 index 38bf03cb53..0000000000 --- a/wxWidgets/src/html/htmlcell.cpp +++ /dev/null @@ -1,1609 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/html/htmlcell.cpp -// Purpose: wxHtmlCell - basic element of HTML output -// Author: Vaclav Slavik -// RCS-ID: $Id: htmlcell.cpp 53318 2008-04-23 11:54:05Z VS $ -// Copyright: (c) 1999 Vaclav Slavik -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_HTML && wxUSE_STREAMS - -#ifndef WXPRECOMP - #include "wx/dynarray.h" - #include "wx/brush.h" - #include "wx/colour.h" - #include "wx/dc.h" - #include "wx/settings.h" - #include "wx/module.h" -#endif - -#include "wx/html/htmlcell.h" -#include "wx/html/htmlwin.h" - -#include - -//----------------------------------------------------------------------------- -// Helper classes -//----------------------------------------------------------------------------- - -void wxHtmlSelection::Set(const wxPoint& fromPos, const wxHtmlCell *fromCell, - const wxPoint& toPos, const wxHtmlCell *toCell) -{ - m_fromCell = fromCell; - m_toCell = toCell; - m_fromPos = fromPos; - m_toPos = toPos; -} - -void wxHtmlSelection::Set(const wxHtmlCell *fromCell, const wxHtmlCell *toCell) -{ - wxPoint p1 = fromCell ? fromCell->GetAbsPos() : wxDefaultPosition; - wxPoint p2 = toCell ? toCell->GetAbsPos() : wxDefaultPosition; - if ( toCell ) - { - p2.x += toCell->GetWidth(); - p2.y += toCell->GetHeight(); - } - Set(p1, fromCell, p2, toCell); -} - -wxColour -wxDefaultHtmlRenderingStyle:: -GetSelectedTextColour(const wxColour& WXUNUSED(clr)) -{ - return wxSystemSettings::GetColour(wxSYS_COLOUR_HIGHLIGHTTEXT); -} - -wxColour -wxDefaultHtmlRenderingStyle:: -GetSelectedTextBgColour(const wxColour& WXUNUSED(clr)) -{ - return wxSystemSettings::GetColour(wxSYS_COLOUR_HIGHLIGHT); -} - - -//----------------------------------------------------------------------------- -// wxHtmlCell -//----------------------------------------------------------------------------- - -IMPLEMENT_ABSTRACT_CLASS(wxHtmlCell, wxObject) - -wxHtmlCell::wxHtmlCell() : wxObject() -{ - m_Next = NULL; - m_Parent = NULL; - m_Width = m_Height = m_Descent = 0; - m_ScriptMode = wxHTML_SCRIPT_NORMAL; // or mode - m_ScriptBaseline = 0; // or baseline - m_CanLiveOnPagebreak = true; - m_Link = NULL; -} - -wxHtmlCell::~wxHtmlCell() -{ - delete m_Link; -} - -// Update the descent value when whe are in a or . -// prevbase is the parent base -void wxHtmlCell::SetScriptMode(wxHtmlScriptMode mode, long previousBase) -{ - m_ScriptMode = mode; - - if (mode == wxHTML_SCRIPT_SUP) - m_ScriptBaseline = previousBase - (m_Height + 1) / 2; - else if (mode == wxHTML_SCRIPT_SUB) - m_ScriptBaseline = previousBase + (m_Height + 1) / 6; - else - m_ScriptBaseline = 0; - - m_Descent += m_ScriptBaseline; -} - -#if WXWIN_COMPATIBILITY_2_6 - -struct wxHtmlCellOnMouseClickCompatHelper; - -static wxHtmlCellOnMouseClickCompatHelper *gs_helperOnMouseClick = NULL; - -// helper for routing calls to new ProcessMouseClick() method to deprecated -// OnMouseClick() method -struct wxHtmlCellOnMouseClickCompatHelper -{ - wxHtmlCellOnMouseClickCompatHelper(wxHtmlWindowInterface *window_, - const wxPoint& pos_, - const wxMouseEvent& event_) - : window(window_), pos(pos_), event(event_), retval(false) - { - } - - bool CallOnMouseClick(wxHtmlCell *cell) - { - wxHtmlCellOnMouseClickCompatHelper *oldHelper = gs_helperOnMouseClick; - gs_helperOnMouseClick = this; - cell->OnMouseClick - ( - window ? window->GetHTMLWindow() : NULL, - pos.x, pos.y, - event - ); - gs_helperOnMouseClick = oldHelper; - return retval; - } - - wxHtmlWindowInterface *window; - const wxPoint& pos; - const wxMouseEvent& event; - bool retval; -}; -#endif // WXWIN_COMPATIBILITY_2_6 - -bool wxHtmlCell::ProcessMouseClick(wxHtmlWindowInterface *window, - const wxPoint& pos, - const wxMouseEvent& event) -{ - wxCHECK_MSG( window, false, _T("window interface must be provided") ); - -#if WXWIN_COMPATIBILITY_2_6 - // NB: this hack puts the body of ProcessMouseClick() into OnMouseClick() - // (for which it has to pass the arguments and return value via a - // helper variable because these two methods have different - // signatures), so that old code overriding OnMouseClick will continue - // to work - wxHtmlCellOnMouseClickCompatHelper compat(window, pos, event); - return compat.CallOnMouseClick(this); -} - -void wxHtmlCell::OnMouseClick(wxWindow *, int, int, const wxMouseEvent& event) -{ - wxCHECK_RET( gs_helperOnMouseClick, _T("unexpected call to OnMouseClick") ); - wxHtmlWindowInterface *window = gs_helperOnMouseClick->window; - const wxPoint& pos = gs_helperOnMouseClick->pos; -#endif // WXWIN_COMPATIBILITY_2_6 - - wxHtmlLinkInfo *lnk = GetLink(pos.x, pos.y); - bool retval = false; - - if (lnk) - { - wxHtmlLinkInfo lnk2(*lnk); - lnk2.SetEvent(&event); - lnk2.SetHtmlCell(this); - - window->OnHTMLLinkClicked(lnk2); - retval = true; - } - -#if WXWIN_COMPATIBILITY_2_6 - gs_helperOnMouseClick->retval = retval; -#else - return retval; -#endif // WXWIN_COMPATIBILITY_2_6 -} - -#if WXWIN_COMPATIBILITY_2_6 -wxCursor wxHtmlCell::GetCursor() const -{ - return wxNullCursor; -} -#endif // WXWIN_COMPATIBILITY_2_6 - -wxCursor wxHtmlCell::GetMouseCursor(wxHtmlWindowInterface *window) const -{ -#if WXWIN_COMPATIBILITY_2_6 - // NB: Older versions of wx used GetCursor() virtual method in place of - // GetMouseCursor(interface). This code ensures that user code that - // overriden GetCursor() continues to work. The trick is that the base - // wxHtmlCell::GetCursor() method simply returns wxNullCursor, so we - // know that GetCursor() was overriden iff it returns valid cursor. - wxCursor cur = GetCursor(); - if (cur.Ok()) - return cur; -#endif // WXWIN_COMPATIBILITY_2_6 - - if ( GetLink() ) - { - return window->GetHTMLCursor(wxHtmlWindowInterface::HTMLCursor_Link); - } - else - { - return window->GetHTMLCursor(wxHtmlWindowInterface::HTMLCursor_Default); - } -} - - -bool wxHtmlCell::AdjustPagebreak(int *pagebreak, - wxArrayInt& WXUNUSED(known_pagebreaks)) const -{ - if ((!m_CanLiveOnPagebreak) && - m_PosY < *pagebreak && m_PosY + m_Height > *pagebreak) - { - *pagebreak = m_PosY; - return true; - } - - return false; -} - - - -void wxHtmlCell::SetLink(const wxHtmlLinkInfo& link) -{ - if (m_Link) delete m_Link; - m_Link = NULL; - if (link.GetHref() != wxEmptyString) - m_Link = new wxHtmlLinkInfo(link); -} - - -void wxHtmlCell::Layout(int WXUNUSED(w)) -{ - SetPos(0, 0); -} - - - -const wxHtmlCell* wxHtmlCell::Find(int WXUNUSED(condition), const void* WXUNUSED(param)) const -{ - return NULL; -} - - -wxHtmlCell *wxHtmlCell::FindCellByPos(wxCoord x, wxCoord y, - unsigned flags) const -{ - if ( x >= 0 && x < m_Width && y >= 0 && y < m_Height ) - { - return wxConstCast(this, wxHtmlCell); - } - else - { - if ((flags & wxHTML_FIND_NEAREST_AFTER) && - (y < 0 || (y < 0+m_Height && x < 0+m_Width))) - return wxConstCast(this, wxHtmlCell); - else if ((flags & wxHTML_FIND_NEAREST_BEFORE) && - (y >= 0+m_Height || (y >= 0 && x >= 0))) - return wxConstCast(this, wxHtmlCell); - else - return NULL; - } -} - - -wxPoint wxHtmlCell::GetAbsPos(wxHtmlCell *rootCell) const -{ - wxPoint p(m_PosX, m_PosY); - for (wxHtmlCell *parent = m_Parent; parent && parent != rootCell; - parent = parent->m_Parent) - { - p.x += parent->m_PosX; - p.y += parent->m_PosY; - } - return p; -} - -wxHtmlCell *wxHtmlCell::GetRootCell() const -{ - wxHtmlCell *c = wxConstCast(this, wxHtmlCell); - while ( c->m_Parent ) - c = c->m_Parent; - return c; -} - -unsigned wxHtmlCell::GetDepth() const -{ - unsigned d = 0; - for (wxHtmlCell *p = m_Parent; p; p = p->m_Parent) - d++; - return d; -} - -bool wxHtmlCell::IsBefore(wxHtmlCell *cell) const -{ - const wxHtmlCell *c1 = this; - const wxHtmlCell *c2 = cell; - unsigned d1 = GetDepth(); - unsigned d2 = cell->GetDepth(); - - if ( d1 > d2 ) - for (; d1 != d2; d1-- ) - c1 = c1->m_Parent; - else if ( d1 < d2 ) - for (; d1 != d2; d2-- ) - c2 = c2->m_Parent; - - if ( cell == this ) - return true; - - while ( c1 && c2 ) - { - if ( c1->m_Parent == c2->m_Parent ) - { - while ( c1 ) - { - if ( c1 == c2 ) - return true; - c1 = c1->GetNext(); - } - return false; - } - else - { - c1 = c1->m_Parent; - c2 = c2->m_Parent; - } - } - - wxFAIL_MSG(_T("Cells are in different trees")); - return false; -} - - -//----------------------------------------------------------------------------- -// wxHtmlWordCell -//----------------------------------------------------------------------------- - -IMPLEMENT_ABSTRACT_CLASS(wxHtmlWordCell, wxHtmlCell) - -wxHtmlWordCell::wxHtmlWordCell(const wxString& word, const wxDC& dc) : wxHtmlCell() -{ - m_Word = word; - dc.GetTextExtent(m_Word, &m_Width, &m_Height, &m_Descent); - SetCanLiveOnPagebreak(false); - m_allowLinebreak = true; -} - -void wxHtmlWordCell::SetPreviousWord(wxHtmlWordCell *cell) -{ - if ( cell && m_Parent == cell->m_Parent && - !wxIsspace(cell->m_Word.Last()) && !wxIsspace(m_Word[0u]) ) - { - m_allowLinebreak = false; - } -} - -// Splits m_Word into up to three parts according to selection, returns -// substring before, in and after selection and the points (in relative coords) -// where s2 and s3 start: -void wxHtmlWordCell::Split(const wxDC& dc, - const wxPoint& selFrom, const wxPoint& selTo, - unsigned& pos1, unsigned& pos2) const -{ - wxPoint pt1 = (selFrom == wxDefaultPosition) ? - wxDefaultPosition : selFrom - GetAbsPos(); - wxPoint pt2 = (selTo == wxDefaultPosition) ? - wxPoint(m_Width, wxDefaultCoord) : selTo - GetAbsPos(); - - // if the selection is entirely within this cell, make sure pt1 < pt2 in - // order to make the rest of this function simpler: - if ( selFrom != wxDefaultPosition && selTo != wxDefaultPosition && - selFrom.x > selTo.x ) - { - wxPoint tmp = pt1; - pt1 = pt2; - pt2 = tmp; - } - - unsigned len = m_Word.length(); - unsigned i = 0; - pos1 = 0; - - // adjust for cases when the start/end position is completely - // outside the cell: - if ( pt1.y < 0 ) - pt1.x = 0; - if ( pt2.y >= m_Height ) - pt2.x = m_Width; - - // before selection: - // (include character under caret only if in first half of width) -#ifdef __WXMAC__ - // implementation using PartialExtents to support fractional widths - wxArrayInt widths ; - dc.GetPartialTextExtents(m_Word,widths) ; - while( i < len && pt1.x >= widths[i] ) - i++ ; - if ( i < len ) - { - int charW = (i > 0) ? widths[i] - widths[i-1] : widths[i]; - if ( widths[i] - pt1.x < charW/2 ) - i++; - } -#else // !__WXMAC__ - wxCoord charW, charH; - while ( pt1.x > 0 && i < len ) - { - dc.GetTextExtent(m_Word[i], &charW, &charH); - pt1.x -= charW; - if ( pt1.x >= -charW/2 ) - { - pos1 += charW; - i++; - } - } -#endif // __WXMAC__/!__WXMAC__ - - // in selection: - // (include character under caret only if in first half of width) - unsigned j = i; -#ifdef __WXMAC__ - while( j < len && pt2.x >= widths[j] ) - j++ ; - if ( j < len ) - { - int charW = (j > 0) ? widths[j] - widths[j-1] : widths[j]; - if ( widths[j] - pt2.x < charW/2 ) - j++; - } -#else // !__WXMAC__ - pos2 = pos1; - pt2.x -= pos2; - while ( pt2.x > 0 && j < len ) - { - dc.GetTextExtent(m_Word[j], &charW, &charH); - pt2.x -= charW; - if ( pt2.x >= -charW/2 ) - { - pos2 += charW; - j++; - } - } -#endif // __WXMAC__/!__WXMAC__ - - pos1 = i; - pos2 = j; -} - -void wxHtmlWordCell::SetSelectionPrivPos(const wxDC& dc, wxHtmlSelection *s) const -{ - unsigned p1, p2; - - Split(dc, - this == s->GetFromCell() ? s->GetFromPos() : wxDefaultPosition, - this == s->GetToCell() ? s->GetToPos() : wxDefaultPosition, - p1, p2); - - wxPoint p(0, m_Word.length()); - - if ( this == s->GetFromCell() ) - p.x = p1; // selection starts here - if ( this == s->GetToCell() ) - p.y = p2; // selection ends here - - if ( this == s->GetFromCell() ) - s->SetFromPrivPos(p); - if ( this == s->GetToCell() ) - s->SetToPrivPos(p); -} - - -static void SwitchSelState(wxDC& dc, wxHtmlRenderingInfo& info, - bool toSelection) -{ - wxColour fg = info.GetState().GetFgColour(); - wxColour bg = info.GetState().GetBgColour(); - - if ( toSelection ) - { - dc.SetBackgroundMode(wxSOLID); - dc.SetTextForeground(info.GetStyle().GetSelectedTextColour(fg)); - dc.SetTextBackground(info.GetStyle().GetSelectedTextBgColour(bg)); - dc.SetBackground(wxBrush(info.GetStyle().GetSelectedTextBgColour(bg), - wxSOLID)); - } - else - { - dc.SetBackgroundMode(wxTRANSPARENT); - dc.SetTextForeground(fg); - dc.SetTextBackground(bg); - dc.SetBackground(wxBrush(bg, wxSOLID)); - } -} - - -void wxHtmlWordCell::Draw(wxDC& dc, int x, int y, - int WXUNUSED(view_y1), int WXUNUSED(view_y2), - wxHtmlRenderingInfo& info) -{ -#if 0 // useful for debugging - dc.SetPen(*wxBLACK_PEN); - dc.DrawRectangle(x+m_PosX,y+m_PosY,m_Width /* VZ: +1? */ ,m_Height); -#endif - - bool drawSelectionAfterCell = false; - - if ( info.GetState().GetSelectionState() == wxHTML_SEL_CHANGING ) - { - // Selection changing, we must draw the word piecewise: - wxHtmlSelection *s = info.GetSelection(); - wxString txt; - int w, h; - int ofs = 0; - - wxPoint priv = (this == s->GetFromCell()) ? - s->GetFromPrivPos() : s->GetToPrivPos(); - - // NB: this is quite a hack: in order to compute selection boundaries - // (in word's characters) we must know current font, which is only - // possible inside rendering code. Therefore we update the - // information here and store it in wxHtmlSelection so that - // ConvertToText can use it later: - if ( priv == wxDefaultPosition ) - { - SetSelectionPrivPos(dc, s); - priv = (this == s->GetFromCell()) ? - s->GetFromPrivPos() : s->GetToPrivPos(); - } - - int part1 = priv.x; - int part2 = priv.y; - - if ( part1 > 0 ) - { - txt = m_Word.Mid(0, part1); - dc.DrawText(txt, x + m_PosX, y + m_PosY); - dc.GetTextExtent(txt, &w, &h); - ofs += w; - } - - SwitchSelState(dc, info, true); - - txt = m_Word.Mid(part1, part2-part1); - dc.DrawText(txt, ofs + x + m_PosX, y + m_PosY); - - if ( (size_t)part2 < m_Word.length() ) - { - dc.GetTextExtent(txt, &w, &h); - ofs += w; - SwitchSelState(dc, info, false); - txt = m_Word.Mid(part2); - dc.DrawText(txt, ofs + x + m_PosX, y + m_PosY); - } - else - drawSelectionAfterCell = true; - } - else - { - wxHtmlSelectionState selstate = info.GetState().GetSelectionState(); - // Not changing selection state, draw the word in single mode: - if ( selstate != wxHTML_SEL_OUT && - dc.GetBackgroundMode() != wxSOLID ) - { - SwitchSelState(dc, info, true); - } - else if ( selstate == wxHTML_SEL_OUT && - dc.GetBackgroundMode() == wxSOLID ) - { - SwitchSelState(dc, info, false); - } - dc.DrawText(m_Word, x + m_PosX, y + m_PosY); - drawSelectionAfterCell = (selstate != wxHTML_SEL_OUT); - } - - // NB: If the text is justified then there is usually some free space - // between adjacent cells and drawing the selection only onto cells - // would result in ugly unselected spaces. The code below detects - // this special case and renders the selection *outside* the sell, - // too. - if ( m_Parent->GetAlignHor() == wxHTML_ALIGN_JUSTIFY && - drawSelectionAfterCell ) - { - wxHtmlCell *nextCell = m_Next; - while ( nextCell && nextCell->IsFormattingCell() ) - nextCell = nextCell->GetNext(); - if ( nextCell ) - { - int nextX = nextCell->GetPosX(); - if ( m_PosX + m_Width < nextX ) - { - dc.SetBrush(dc.GetBackground()); - dc.SetPen(*wxTRANSPARENT_PEN); - dc.DrawRectangle(x + m_PosX + m_Width, y + m_PosY, - nextX - m_PosX - m_Width, m_Height); - } - } - } -} - - -wxString wxHtmlWordCell::ConvertToText(wxHtmlSelection *s) const -{ - if ( s && (this == s->GetFromCell() || this == s->GetToCell()) ) - { - wxPoint priv = this == s->GetFromCell() ? s->GetFromPrivPos() - : s->GetToPrivPos(); - - // VZ: we may be called before we had a chance to re-render ourselves - // and in this case GetFrom/ToPrivPos() is not set yet -- assume - // that this only happens in case of a double/triple click (which - // seems to be the case now) and so it makes sense to select the - // entire contents of the cell in this case - // - // TODO: but this really needs to be fixed in some better way later... - if ( priv != wxDefaultPosition ) - { - int part1 = priv.x; - int part2 = priv.y; - if ( part1 == part2 ) - return wxEmptyString; - return m_Word.Mid(part1, part2-part1); - } - //else: return the whole word below - } - - return m_Word; -} - -wxCursor wxHtmlWordCell::GetMouseCursor(wxHtmlWindowInterface *window) const -{ - if ( !GetLink() ) - { - return window->GetHTMLCursor(wxHtmlWindowInterface::HTMLCursor_Text); - } - else - { - return wxHtmlCell::GetMouseCursor(window); - } -} - - -//----------------------------------------------------------------------------- -// wxHtmlContainerCell -//----------------------------------------------------------------------------- - -IMPLEMENT_ABSTRACT_CLASS(wxHtmlContainerCell, wxHtmlCell) - -wxHtmlContainerCell::wxHtmlContainerCell(wxHtmlContainerCell *parent) : wxHtmlCell() -{ - m_Cells = m_LastCell = NULL; - m_Parent = parent; - m_MaxTotalWidth = 0; - if (m_Parent) m_Parent->InsertCell(this); - m_AlignHor = wxHTML_ALIGN_LEFT; - m_AlignVer = wxHTML_ALIGN_BOTTOM; - m_IndentLeft = m_IndentRight = m_IndentTop = m_IndentBottom = 0; - m_WidthFloat = 100; m_WidthFloatUnits = wxHTML_UNITS_PERCENT; - m_UseBkColour = false; - m_UseBorder = false; - m_MinHeight = 0; - m_MinHeightAlign = wxHTML_ALIGN_TOP; - m_LastLayout = -1; -} - -wxHtmlContainerCell::~wxHtmlContainerCell() -{ - wxHtmlCell *cell = m_Cells; - while ( cell ) - { - wxHtmlCell *cellNext = cell->GetNext(); - delete cell; - cell = cellNext; - } -} - - - -void wxHtmlContainerCell::SetIndent(int i, int what, int units) -{ - int val = (units == wxHTML_UNITS_PIXELS) ? i : -i; - if (what & wxHTML_INDENT_LEFT) m_IndentLeft = val; - if (what & wxHTML_INDENT_RIGHT) m_IndentRight = val; - if (what & wxHTML_INDENT_TOP) m_IndentTop = val; - if (what & wxHTML_INDENT_BOTTOM) m_IndentBottom = val; - m_LastLayout = -1; -} - - - -int wxHtmlContainerCell::GetIndent(int ind) const -{ - if (ind & wxHTML_INDENT_LEFT) return m_IndentLeft; - else if (ind & wxHTML_INDENT_RIGHT) return m_IndentRight; - else if (ind & wxHTML_INDENT_TOP) return m_IndentTop; - else if (ind & wxHTML_INDENT_BOTTOM) return m_IndentBottom; - else return -1; /* BUG! Should not be called... */ -} - - - - -int wxHtmlContainerCell::GetIndentUnits(int ind) const -{ - bool p = false; - if (ind & wxHTML_INDENT_LEFT) p = m_IndentLeft < 0; - else if (ind & wxHTML_INDENT_RIGHT) p = m_IndentRight < 0; - else if (ind & wxHTML_INDENT_TOP) p = m_IndentTop < 0; - else if (ind & wxHTML_INDENT_BOTTOM) p = m_IndentBottom < 0; - if (p) return wxHTML_UNITS_PERCENT; - else return wxHTML_UNITS_PIXELS; -} - - -bool wxHtmlContainerCell::AdjustPagebreak(int *pagebreak, - wxArrayInt& known_pagebreaks) const -{ - if (!m_CanLiveOnPagebreak) - return wxHtmlCell::AdjustPagebreak(pagebreak, known_pagebreaks); - - wxHtmlCell *c = GetFirstChild(); - bool rt = false; - int pbrk = *pagebreak - m_PosY; - - while (c) - { - if (c->AdjustPagebreak(&pbrk, known_pagebreaks)) - rt = true; - c = c->GetNext(); - } - if (rt) - *pagebreak = pbrk + m_PosY; - return rt; -} - - -void wxHtmlContainerCell::Layout(int w) -{ - wxHtmlCell::Layout(w); - - if (m_LastLayout == w) - return; - m_LastLayout = w; - - // VS: Any attempt to layout with negative or zero width leads to hell, - // but we can't ignore such attempts completely, since it sometimes - // happen (e.g. when trying how small a table can be). The best thing we - // can do is to set the width of child cells to zero - if (w < 1) - { - m_Width = 0; - for (wxHtmlCell *cell = m_Cells; cell; cell = cell->GetNext()) - cell->Layout(0); - // this does two things: it recursively calls this code on all - // child contrainers and resets children's position to (0,0) - return; - } - - wxHtmlCell *nextCell; - long xpos = 0, ypos = m_IndentTop; - int xdelta = 0, ybasicpos = 0, ydiff; - int s_width, nextWordWidth, s_indent; - int ysizeup = 0, ysizedown = 0; - int MaxLineWidth = 0; - int curLineWidth = 0; - m_MaxTotalWidth = 0; - - - /* - - WIDTH ADJUSTING : - - */ - - if (m_WidthFloatUnits == wxHTML_UNITS_PERCENT) - { - if (m_WidthFloat < 0) m_Width = (100 + m_WidthFloat) * w / 100; - else m_Width = m_WidthFloat * w / 100; - } - else - { - if (m_WidthFloat < 0) m_Width = w + m_WidthFloat; - else m_Width = m_WidthFloat; - } - - if (m_Cells) - { - int l = (m_IndentLeft < 0) ? (-m_IndentLeft * m_Width / 100) : m_IndentLeft; - int r = (m_IndentRight < 0) ? (-m_IndentRight * m_Width / 100) : m_IndentRight; - for (wxHtmlCell *cell = m_Cells; cell; cell = cell->GetNext()) - cell->Layout(m_Width - (l + r)); - } - - /* - - LAYOUTING : - - */ - - // adjust indentation: - s_indent = (m_IndentLeft < 0) ? (-m_IndentLeft * m_Width / 100) : m_IndentLeft; - s_width = m_Width - s_indent - ((m_IndentRight < 0) ? (-m_IndentRight * m_Width / 100) : m_IndentRight); - - // my own layouting: - wxHtmlCell *cell = m_Cells, - *line = m_Cells; - while (cell != NULL) - { - switch (m_AlignVer) - { - case wxHTML_ALIGN_TOP : ybasicpos = 0; break; - case wxHTML_ALIGN_BOTTOM : ybasicpos = - cell->GetHeight(); break; - case wxHTML_ALIGN_CENTER : ybasicpos = - cell->GetHeight() / 2; break; - } - ydiff = cell->GetHeight() + ybasicpos; - - if (cell->GetDescent() + ydiff > ysizedown) ysizedown = cell->GetDescent() + ydiff; - if (ybasicpos + cell->GetDescent() < -ysizeup) ysizeup = - (ybasicpos + cell->GetDescent()); - - // layout nonbreakable run of cells: - cell->SetPos(xpos, ybasicpos + cell->GetDescent()); - xpos += cell->GetWidth(); - if (!cell->IsTerminalCell()) - { - // Container cell indicates new line - if (curLineWidth > m_MaxTotalWidth) - m_MaxTotalWidth = curLineWidth; - - if (wxMax(cell->GetWidth(), cell->GetMaxTotalWidth()) > m_MaxTotalWidth) - m_MaxTotalWidth = cell->GetMaxTotalWidth(); - curLineWidth = 0; - } - else - // Normal cell, add maximum cell width to line width - curLineWidth += cell->GetMaxTotalWidth(); - - cell = cell->GetNext(); - - // compute length of the next word that would be added: - nextWordWidth = 0; - if (cell) - { - nextCell = cell; - do - { - nextWordWidth += nextCell->GetWidth(); - nextCell = nextCell->GetNext(); - } while (nextCell && !nextCell->IsLinebreakAllowed()); - } - - // force new line if occurred: - if ((cell == NULL) || - (xpos + nextWordWidth > s_width && cell->IsLinebreakAllowed())) - { - if (xpos > MaxLineWidth) MaxLineWidth = xpos; - if (ysizeup < 0) ysizeup = 0; - if (ysizedown < 0) ysizedown = 0; - switch (m_AlignHor) { - case wxHTML_ALIGN_LEFT : - case wxHTML_ALIGN_JUSTIFY : - xdelta = 0; - break; - case wxHTML_ALIGN_RIGHT : - xdelta = 0 + (s_width - xpos); - break; - case wxHTML_ALIGN_CENTER : - xdelta = 0 + (s_width - xpos) / 2; - break; - } - if (xdelta < 0) xdelta = 0; - xdelta += s_indent; - - ypos += ysizeup; - - if (m_AlignHor != wxHTML_ALIGN_JUSTIFY || cell == NULL) - { - while (line != cell) - { - line->SetPos(line->GetPosX() + xdelta, - ypos + line->GetPosY()); - line = line->GetNext(); - } - } - else // align == justify - { - // we have to distribute the extra horz space between the cells - // on this line - - // an added complication is that some cells have fixed size and - // shouldn't get any increment (it so happens that these cells - // also don't allow line break on them which provides with an - // easy way to test for this) -- and neither should the cells - // adjacent to them as this could result in a visible space - // between two cells separated by, e.g. font change, cell which - // is wrong - - int step = s_width - xpos; - if ( step > 0 ) - { - // first count the cells which will get extra space - int total = -1; - - const wxHtmlCell *c; - if ( line != cell ) - { - for ( c = line; c != cell; c = c->GetNext() ) - { - if ( c->IsLinebreakAllowed() ) - { - total++; - } - } - } - - // and now extra space to those cells which merit it - if ( total ) - { - // first visible cell on line is not moved: - while (line !=cell && !line->IsLinebreakAllowed()) - { - line->SetPos(line->GetPosX() + s_indent, - line->GetPosY() + ypos); - line = line->GetNext(); - } - - if (line != cell) - { - line->SetPos(line->GetPosX() + s_indent, - line->GetPosY() + ypos); - - line = line->GetNext(); - } - - for ( int n = 0; line != cell; line = line->GetNext() ) - { - if ( line->IsLinebreakAllowed() ) - { - // offset the next cell relative to this one - // thus increasing our size - n++; - } - - line->SetPos(line->GetPosX() + s_indent + - ((n * step) / total), - line->GetPosY() + ypos); - } - } - else - { - // this will cause the code to enter "else branch" below: - step = 0; - } - } - // else branch: - if ( step <= 0 ) // no extra space to distribute - { - // just set the indent properly - while (line != cell) - { - line->SetPos(line->GetPosX() + s_indent, - line->GetPosY() + ypos); - line = line->GetNext(); - } - } - } - - ypos += ysizedown; - xpos = 0; - ysizeup = ysizedown = 0; - line = cell; - } - } - - // setup height & width, depending on container layout: - m_Height = ypos + (ysizedown + ysizeup) + m_IndentBottom; - - if (m_Height < m_MinHeight) - { - if (m_MinHeightAlign != wxHTML_ALIGN_TOP) - { - int diff = m_MinHeight - m_Height; - if (m_MinHeightAlign == wxHTML_ALIGN_CENTER) diff /= 2; - cell = m_Cells; - while (cell) - { - cell->SetPos(cell->GetPosX(), cell->GetPosY() + diff); - cell = cell->GetNext(); - } - } - m_Height = m_MinHeight; - } - - if (curLineWidth > m_MaxTotalWidth) - m_MaxTotalWidth = curLineWidth; - - m_MaxTotalWidth += s_indent + ((m_IndentRight < 0) ? (-m_IndentRight * m_Width / 100) : m_IndentRight); - MaxLineWidth += s_indent + ((m_IndentRight < 0) ? (-m_IndentRight * m_Width / 100) : m_IndentRight); - if (m_Width < MaxLineWidth) m_Width = MaxLineWidth; -} - -void wxHtmlContainerCell::UpdateRenderingStatePre(wxHtmlRenderingInfo& info, - wxHtmlCell *cell) const -{ - wxHtmlSelection *s = info.GetSelection(); - if (!s) return; - if (s->GetFromCell() == cell || s->GetToCell() == cell) - { - info.GetState().SetSelectionState(wxHTML_SEL_CHANGING); - } -} - -void wxHtmlContainerCell::UpdateRenderingStatePost(wxHtmlRenderingInfo& info, - wxHtmlCell *cell) const -{ - wxHtmlSelection *s = info.GetSelection(); - if (!s) return; - if (s->GetToCell() == cell) - info.GetState().SetSelectionState(wxHTML_SEL_OUT); - else if (s->GetFromCell() == cell) - info.GetState().SetSelectionState(wxHTML_SEL_IN); -} - -#define mMin(a, b) (((a) < (b)) ? (a) : (b)) -#define mMax(a, b) (((a) < (b)) ? (b) : (a)) - -void wxHtmlContainerCell::Draw(wxDC& dc, int x, int y, int view_y1, int view_y2, - wxHtmlRenderingInfo& info) -{ -#if 0 // useful for debugging - dc.SetPen(*wxRED_PEN); - dc.DrawRectangle(x+m_PosX,y+m_PosY,m_Width,m_Height); -#endif - - int xlocal = x + m_PosX; - int ylocal = y + m_PosY; - - if (m_UseBkColour) - { - wxBrush myb = wxBrush(m_BkColour, wxSOLID); - - int real_y1 = mMax(ylocal, view_y1); - int real_y2 = mMin(ylocal + m_Height - 1, view_y2); - - dc.SetBrush(myb); - dc.SetPen(*wxTRANSPARENT_PEN); - dc.DrawRectangle(xlocal, real_y1, m_Width, real_y2 - real_y1 + 1); - } - - if (m_UseBorder) - { - wxPen mypen1(m_BorderColour1, 1, wxSOLID); - wxPen mypen2(m_BorderColour2, 1, wxSOLID); - - dc.SetPen(mypen1); - dc.DrawLine(xlocal, ylocal, xlocal, ylocal + m_Height - 1); - dc.DrawLine(xlocal, ylocal, xlocal + m_Width, ylocal); - dc.SetPen(mypen2); - dc.DrawLine(xlocal + m_Width - 1, ylocal, xlocal + m_Width - 1, ylocal + m_Height - 1); - dc.DrawLine(xlocal, ylocal + m_Height - 1, xlocal + m_Width, ylocal + m_Height - 1); - } - - if (m_Cells) - { - // draw container's contents: - for (wxHtmlCell *cell = m_Cells; cell; cell = cell->GetNext()) - { - - // optimize drawing: don't render off-screen content: - if ((ylocal + cell->GetPosY() <= view_y2) && - (ylocal + cell->GetPosY() + cell->GetHeight() > view_y1)) - { - // the cell is visible, draw it: - UpdateRenderingStatePre(info, cell); - cell->Draw(dc, - xlocal, ylocal, view_y1, view_y2, - info); - UpdateRenderingStatePost(info, cell); - } - else - { - // the cell is off-screen, proceed with font+color+etc. - // changes only: - cell->DrawInvisible(dc, xlocal, ylocal, info); - } - } - } -} - - - -void wxHtmlContainerCell::DrawInvisible(wxDC& dc, int x, int y, - wxHtmlRenderingInfo& info) -{ - if (m_Cells) - { - for (wxHtmlCell *cell = m_Cells; cell; cell = cell->GetNext()) - { - UpdateRenderingStatePre(info, cell); - cell->DrawInvisible(dc, x + m_PosX, y + m_PosY, info); - UpdateRenderingStatePost(info, cell); - } - } -} - - -wxColour wxHtmlContainerCell::GetBackgroundColour() -{ - if (m_UseBkColour) - return m_BkColour; - else - return wxNullColour; -} - - - -wxHtmlLinkInfo *wxHtmlContainerCell::GetLink(int x, int y) const -{ - wxHtmlCell *cell = FindCellByPos(x, y); - - // VZ: I don't know if we should pass absolute or relative coords to - // wxHtmlCell::GetLink()? As the base class version just ignores them - // anyhow, it hardly matters right now but should still be clarified - return cell ? cell->GetLink(x, y) : NULL; -} - - - -void wxHtmlContainerCell::InsertCell(wxHtmlCell *f) -{ - if (!m_Cells) m_Cells = m_LastCell = f; - else - { - m_LastCell->SetNext(f); - m_LastCell = f; - if (m_LastCell) while (m_LastCell->GetNext()) m_LastCell = m_LastCell->GetNext(); - } - f->SetParent(this); - m_LastLayout = -1; -} - - - -void wxHtmlContainerCell::SetAlign(const wxHtmlTag& tag) -{ - if (tag.HasParam(wxT("ALIGN"))) - { - wxString alg = tag.GetParam(wxT("ALIGN")); - alg.MakeUpper(); - if (alg == wxT("CENTER")) - SetAlignHor(wxHTML_ALIGN_CENTER); - else if (alg == wxT("LEFT")) - SetAlignHor(wxHTML_ALIGN_LEFT); - else if (alg == wxT("JUSTIFY")) - SetAlignHor(wxHTML_ALIGN_JUSTIFY); - else if (alg == wxT("RIGHT")) - SetAlignHor(wxHTML_ALIGN_RIGHT); - m_LastLayout = -1; - } -} - - - -void wxHtmlContainerCell::SetWidthFloat(const wxHtmlTag& tag, double pixel_scale) -{ - if (tag.HasParam(wxT("WIDTH"))) - { - int wdi; - wxString wd = tag.GetParam(wxT("WIDTH")); - - if (wd[wd.length()-1] == wxT('%')) - { - wxSscanf(wd.c_str(), wxT("%i%%"), &wdi); - SetWidthFloat(wdi, wxHTML_UNITS_PERCENT); - } - else - { - wxSscanf(wd.c_str(), wxT("%i"), &wdi); - SetWidthFloat((int)(pixel_scale * (double)wdi), wxHTML_UNITS_PIXELS); - } - m_LastLayout = -1; - } -} - - - -const wxHtmlCell* wxHtmlContainerCell::Find(int condition, const void* param) const -{ - if (m_Cells) - { - for (wxHtmlCell *cell = m_Cells; cell; cell = cell->GetNext()) - { - const wxHtmlCell *r = cell->Find(condition, param); - if (r) return r; - } - } - return NULL; -} - - -wxHtmlCell *wxHtmlContainerCell::FindCellByPos(wxCoord x, wxCoord y, - unsigned flags) const -{ - if ( flags & wxHTML_FIND_EXACT ) - { - for ( const wxHtmlCell *cell = m_Cells; cell; cell = cell->GetNext() ) - { - int cx = cell->GetPosX(), - cy = cell->GetPosY(); - - if ( (cx <= x) && (cx + cell->GetWidth() > x) && - (cy <= y) && (cy + cell->GetHeight() > y) ) - { - return cell->FindCellByPos(x - cx, y - cy, flags); - } - } - } - else if ( flags & wxHTML_FIND_NEAREST_AFTER ) - { - wxHtmlCell *c; - for ( const wxHtmlCell *cell = m_Cells; cell; cell = cell->GetNext() ) - { - if ( cell->IsFormattingCell() ) - continue; - int cellY = cell->GetPosY(); - if (!( y < cellY || (y < cellY + cell->GetHeight() && - x < cell->GetPosX() + cell->GetWidth()) )) - continue; - - c = cell->FindCellByPos(x - cell->GetPosX(), y - cellY, flags); - if (c) return c; - } - } - else if ( flags & wxHTML_FIND_NEAREST_BEFORE ) - { - wxHtmlCell *c2, *c = NULL; - for ( const wxHtmlCell *cell = m_Cells; cell; cell = cell->GetNext() ) - { - if ( cell->IsFormattingCell() ) - continue; - int cellY = cell->GetPosY(); - if (!( cellY + cell->GetHeight() <= y || - (y >= cellY && x >= cell->GetPosX()) )) - break; - c2 = cell->FindCellByPos(x - cell->GetPosX(), y - cellY, flags); - if (c2) - c = c2; - } - if (c) return c; - } - - return NULL; -} - - -bool wxHtmlContainerCell::ProcessMouseClick(wxHtmlWindowInterface *window, - const wxPoint& pos, - const wxMouseEvent& event) -{ -#if WXWIN_COMPATIBILITY_2_6 - wxHtmlCellOnMouseClickCompatHelper compat(window, pos, event); - return compat.CallOnMouseClick(this); -} - -void wxHtmlContainerCell::OnMouseClick(wxWindow*, - int, int, const wxMouseEvent& event) -{ - wxCHECK_RET( gs_helperOnMouseClick, _T("unexpected call to OnMouseClick") ); - wxHtmlWindowInterface *window = gs_helperOnMouseClick->window; - const wxPoint& pos = gs_helperOnMouseClick->pos; -#endif // WXWIN_COMPATIBILITY_2_6 - - bool retval = false; - wxHtmlCell *cell = FindCellByPos(pos.x, pos.y); - if ( cell ) - retval = cell->ProcessMouseClick(window, pos, event); - -#if WXWIN_COMPATIBILITY_2_6 - gs_helperOnMouseClick->retval = retval; -#else - return retval; -#endif // WXWIN_COMPATIBILITY_2_6 -} - - -wxHtmlCell *wxHtmlContainerCell::GetFirstTerminal() const -{ - if ( m_Cells ) - { - wxHtmlCell *c2; - for (wxHtmlCell *c = m_Cells; c; c = c->GetNext()) - { - c2 = c->GetFirstTerminal(); - if ( c2 ) - return c2; - } - } - return NULL; -} - -wxHtmlCell *wxHtmlContainerCell::GetLastTerminal() const -{ - if ( m_Cells ) - { - // most common case first: - wxHtmlCell *c = m_LastCell->GetLastTerminal(); - if ( c ) - return c; - - wxHtmlCell *ctmp; - wxHtmlCell *c2 = NULL; - for (c = m_Cells; c; c = c->GetNext()) - { - ctmp = c->GetLastTerminal(); - if ( ctmp ) - c2 = ctmp; - } - return c2; - } - else - return NULL; -} - - -static bool IsEmptyContainer(wxHtmlContainerCell *cell) -{ - for ( wxHtmlCell *c = cell->GetFirstChild(); c; c = c->GetNext() ) - { - if ( !c->IsTerminalCell() || !c->IsFormattingCell() ) - return false; - } - return true; -} - -void wxHtmlContainerCell::RemoveExtraSpacing(bool top, bool bottom) -{ - if ( top ) - SetIndent(0, wxHTML_INDENT_TOP); - if ( bottom ) - SetIndent(0, wxHTML_INDENT_BOTTOM); - - if ( m_Cells ) - { - wxHtmlCell *c; - wxHtmlContainerCell *cont; - if ( top ) - { - for ( c = m_Cells; c; c = c->GetNext() ) - { - if ( c->IsTerminalCell() ) - { - if ( !c->IsFormattingCell() ) - break; - } - else - { - cont = (wxHtmlContainerCell*)c; - if ( IsEmptyContainer(cont) ) - { - cont->SetIndent(0, wxHTML_INDENT_VERTICAL); - } - else - { - cont->RemoveExtraSpacing(true, false); - break; - } - } - } - } - - if ( bottom ) - { - wxArrayPtrVoid arr; - for ( c = m_Cells; c; c = c->GetNext() ) - arr.Add((void*)c); - - for ( int i = arr.GetCount() - 1; i >= 0; i--) - { - c = (wxHtmlCell*)arr[i]; - if ( c->IsTerminalCell() ) - { - if ( !c->IsFormattingCell() ) - break; - } - else - { - cont = (wxHtmlContainerCell*)c; - if ( IsEmptyContainer(cont) ) - { - cont->SetIndent(0, wxHTML_INDENT_VERTICAL); - } - else - { - cont->RemoveExtraSpacing(false, true); - break; - } - } - } - } - } -} - - - - -// -------------------------------------------------------------------------- -// wxHtmlColourCell -// -------------------------------------------------------------------------- - -IMPLEMENT_ABSTRACT_CLASS(wxHtmlColourCell, wxHtmlCell) - -void wxHtmlColourCell::Draw(wxDC& dc, - int x, int y, - int WXUNUSED(view_y1), int WXUNUSED(view_y2), - wxHtmlRenderingInfo& info) -{ - DrawInvisible(dc, x, y, info); -} - -void wxHtmlColourCell::DrawInvisible(wxDC& dc, - int WXUNUSED(x), int WXUNUSED(y), - wxHtmlRenderingInfo& info) -{ - wxHtmlRenderingState& state = info.GetState(); - if (m_Flags & wxHTML_CLR_FOREGROUND) - { - state.SetFgColour(m_Colour); - if (state.GetSelectionState() != wxHTML_SEL_IN) - dc.SetTextForeground(m_Colour); - else - dc.SetTextForeground( - info.GetStyle().GetSelectedTextColour(m_Colour)); - } - if (m_Flags & wxHTML_CLR_BACKGROUND) - { - state.SetBgColour(m_Colour); - if (state.GetSelectionState() != wxHTML_SEL_IN) - { - dc.SetTextBackground(m_Colour); - dc.SetBackground(wxBrush(m_Colour, wxSOLID)); - } - else - { - wxColour c = info.GetStyle().GetSelectedTextBgColour(m_Colour); - dc.SetTextBackground(c); - dc.SetBackground(wxBrush(c, wxSOLID)); - } - } -} - - - - -// --------------------------------------------------------------------------- -// wxHtmlFontCell -// --------------------------------------------------------------------------- - -IMPLEMENT_ABSTRACT_CLASS(wxHtmlFontCell, wxHtmlCell) - -void wxHtmlFontCell::Draw(wxDC& dc, - int WXUNUSED(x), int WXUNUSED(y), - int WXUNUSED(view_y1), int WXUNUSED(view_y2), - wxHtmlRenderingInfo& WXUNUSED(info)) -{ - dc.SetFont(m_Font); -} - -void wxHtmlFontCell::DrawInvisible(wxDC& dc, int WXUNUSED(x), int WXUNUSED(y), - wxHtmlRenderingInfo& WXUNUSED(info)) -{ - dc.SetFont(m_Font); -} - - - - - - - - -// --------------------------------------------------------------------------- -// wxHtmlWidgetCell -// --------------------------------------------------------------------------- - -IMPLEMENT_ABSTRACT_CLASS(wxHtmlWidgetCell, wxHtmlCell) - -wxHtmlWidgetCell::wxHtmlWidgetCell(wxWindow *wnd, int w) -{ - int sx, sy; - m_Wnd = wnd; - m_Wnd->GetSize(&sx, &sy); - m_Width = sx, m_Height = sy; - m_WidthFloat = w; -} - - -void wxHtmlWidgetCell::Draw(wxDC& WXUNUSED(dc), - int WXUNUSED(x), int WXUNUSED(y), - int WXUNUSED(view_y1), int WXUNUSED(view_y2), - wxHtmlRenderingInfo& WXUNUSED(info)) -{ - int absx = 0, absy = 0, stx, sty; - wxHtmlCell *c = this; - - while (c) - { - absx += c->GetPosX(); - absy += c->GetPosY(); - c = c->GetParent(); - } - - wxScrolledWindow *scrolwin = - wxDynamicCast(m_Wnd->GetParent(), wxScrolledWindow); - wxCHECK_RET( scrolwin, - _T("widget cells can only be placed in wxHtmlWindow") ); - - scrolwin->GetViewStart(&stx, &sty); - m_Wnd->SetSize(absx - wxHTML_SCROLL_STEP * stx, - absy - wxHTML_SCROLL_STEP * sty, - m_Width, m_Height); -} - - - -void wxHtmlWidgetCell::DrawInvisible(wxDC& WXUNUSED(dc), - int WXUNUSED(x), int WXUNUSED(y), - wxHtmlRenderingInfo& WXUNUSED(info)) -{ - int absx = 0, absy = 0, stx, sty; - wxHtmlCell *c = this; - - while (c) - { - absx += c->GetPosX(); - absy += c->GetPosY(); - c = c->GetParent(); - } - - ((wxScrolledWindow*)(m_Wnd->GetParent()))->GetViewStart(&stx, &sty); - m_Wnd->SetSize(absx - wxHTML_SCROLL_STEP * stx, absy - wxHTML_SCROLL_STEP * sty, m_Width, m_Height); -} - - - -void wxHtmlWidgetCell::Layout(int w) -{ - if (m_WidthFloat != 0) - { - m_Width = (w * m_WidthFloat) / 100; - m_Wnd->SetSize(m_Width, m_Height); - } - - wxHtmlCell::Layout(w); -} - - - -// ---------------------------------------------------------------------------- -// wxHtmlTerminalCellsInterator -// ---------------------------------------------------------------------------- - -const wxHtmlCell* wxHtmlTerminalCellsInterator::operator++() -{ - if ( !m_pos ) - return NULL; - - do - { - if ( m_pos == m_to ) - { - m_pos = NULL; - return NULL; - } - - if ( m_pos->GetNext() ) - m_pos = m_pos->GetNext(); - else - { - // we must go up the hierarchy until we reach container where this - // is not the last child, and then go down to first terminal cell: - while ( m_pos->GetNext() == NULL ) - { - m_pos = m_pos->GetParent(); - if ( !m_pos ) - return NULL; - } - m_pos = m_pos->GetNext(); - } - while ( m_pos->GetFirstChild() != NULL ) - m_pos = m_pos->GetFirstChild(); - } while ( !m_pos->IsTerminalCell() ); - - return m_pos; -} - -#endif diff --git a/wxWidgets/src/html/htmlctrl/webkit/webkit.mm b/wxWidgets/src/html/htmlctrl/webkit/webkit.mm deleted file mode 100644 index cb36261866..0000000000 --- a/wxWidgets/src/html/htmlctrl/webkit/webkit.mm +++ /dev/null @@ -1,892 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: webkit.mm -// Purpose: wxWebKitCtrl - embeddable web kit control -// Author: Jethro Grassie / Kevin Ollivier -// Modified by: -// Created: 2004-4-16 -// RCS-ID: $Id: webkit.mm 56767 2008-11-14 23:02:15Z KO $ -// Copyright: (c) Jethro Grassie / Kevin Ollivier -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) - #pragma implementation "webkit.h" -#endif - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" -#include "wx/splitter.h" - -#ifndef WX_PRECOMP - #include "wx/wx.h" -#endif - -#if wxUSE_WEBKIT - -#ifdef __WXCOCOA__ -#include "wx/cocoa/autorelease.h" -#else -#include "wx/mac/uma.h" -#include -#include -#include -#include -#endif - -#include "wx/html/webkit.h" - -#define DEBUG_WEBKIT_SIZING 0 - -// ---------------------------------------------------------------------------- -// macros -// ---------------------------------------------------------------------------- - -IMPLEMENT_DYNAMIC_CLASS(wxWebKitCtrl, wxControl) - -BEGIN_EVENT_TABLE(wxWebKitCtrl, wxControl) - EVT_SIZE(wxWebKitCtrl::OnSize) -END_EVENT_TABLE() - -// ---------------------------------------------------------------------------- -// Carbon Events handlers -// ---------------------------------------------------------------------------- - -// prototype for function in src/mac/carbon/toplevel.cpp -void SetupMouseEvent( wxMouseEvent &wxevent , wxMacCarbonEvent &cEvent ); - -static const EventTypeSpec eventList[] = -{ - //{ kEventClassControl, kEventControlTrack } , - { kEventClassMouse, kEventMouseUp }, - { kEventClassMouse, kEventMouseDown }, - { kEventClassMouse, kEventMouseMoved }, - { kEventClassMouse, kEventMouseDragged }, - - { kEventClassKeyboard, kEventRawKeyDown } , - { kEventClassKeyboard, kEventRawKeyRepeat } , - { kEventClassKeyboard, kEventRawKeyUp } , - { kEventClassKeyboard, kEventRawKeyModifiersChanged } , - - { kEventClassTextInput, kEventTextInputUnicodeForKeyEvent } , - { kEventClassTextInput, kEventTextInputUpdateActiveInputArea } , - -#if DEBUG_WEBKIT_SIZING == 1 - { kEventClassControl, kEventControlBoundsChanged } , -#endif -}; - -// mix this in from window.cpp -pascal OSStatus wxMacUnicodeTextEventHandler( EventHandlerCallRef handler , EventRef event , void *data ) ; - -// NOTE: This is mostly taken from KeyboardEventHandler in toplevel.cpp, but -// that expects the data pointer is a top-level window, so I needed to change -// that in this case. However, once 2.8 is out, we should factor out the common logic -// among the two functions and merge them. -static pascal OSStatus wxWebKitKeyEventHandler( EventHandlerCallRef handler , EventRef event , void *data ) -{ - OSStatus result = eventNotHandledErr ; - wxMacCarbonEvent cEvent( event ) ; - - wxWebKitCtrl* thisWindow = (wxWebKitCtrl*) data ; - wxWindow* focus = thisWindow ; - - unsigned char charCode ; - wxChar uniChar[2] ; - uniChar[0] = 0; - uniChar[1] = 0; - - UInt32 keyCode ; - UInt32 modifiers ; - Point point ; - UInt32 when = EventTimeToTicks( GetEventTime( event ) ) ; - -#if wxUSE_UNICODE - ByteCount dataSize = 0 ; - if ( GetEventParameter( event, kEventParamKeyUnicodes, typeUnicodeText, NULL, 0 , &dataSize, NULL ) == noErr ) - { - UniChar buf[2] ; - int numChars = dataSize / sizeof( UniChar) + 1; - - UniChar* charBuf = buf ; - - if ( numChars * 2 > 4 ) - charBuf = new UniChar[ numChars ] ; - GetEventParameter( event, kEventParamKeyUnicodes, typeUnicodeText, NULL, dataSize , NULL , charBuf ) ; - charBuf[ numChars - 1 ] = 0; - -#if SIZEOF_WCHAR_T == 2 - uniChar = charBuf[0] ; -#else - wxMBConvUTF16 converter ; - converter.MB2WC( uniChar , (const char*)charBuf , 2 ) ; -#endif - - if ( numChars * 2 > 4 ) - delete[] charBuf ; - } -#endif - - 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 && */ wxTheApp->MacSendKeyDownEvent( - focus , message , modifiers , when , point.h , point.v , uniChar[0] ) ) - { - result = noErr ; - } - wxTheApp->MacSetCurrentEvent( formerEvent , formerHandler ) ; - } - break ; - - case kEventRawKeyUp : - if ( /* focus && */ wxTheApp->MacSendKeyUpEvent( - focus , message , modifiers , when , point.h , point.v , uniChar[0] ) ) - { - 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; - -#if wxUSE_UNICODE - event.m_uniChar = uniChar[0] ; -#endif - - event.SetTimestamp(when); - event.SetEventObject(focus); - - if ( /* focus && */ (modifiers ^ wxApp::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 ^ wxApp::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 ^ wxApp::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 ^ wxApp::s_lastModifiers ) & cmdKey ) - { - event.m_keyCode = WXK_COMMAND ; - event.SetEventType( ( modifiers & cmdKey ) ? wxEVT_KEY_DOWN : wxEVT_KEY_UP ) ; - focus->GetEventHandler()->ProcessEvent( event ) ; - } - - wxApp::s_lastModifiers = modifiers ; - } - break ; - - default: - break; - } - - return result ; -} - -static pascal OSStatus wxWebKitCtrlEventHandler( EventHandlerCallRef handler , EventRef event , void *data ) -{ - OSStatus result = eventNotHandledErr ; - - wxMacCarbonEvent cEvent( event ) ; - - ControlRef controlRef ; - wxWebKitCtrl* thisWindow = (wxWebKitCtrl*) data ; - wxTopLevelWindowMac* tlw = NULL; - if (thisWindow) - tlw = thisWindow->MacGetTopLevelWindow(); - - cEvent.GetParameter( kEventParamDirectObject , &controlRef ) ; - - wxWindow* currentMouseWindow = thisWindow ; - - if ( wxApp::s_captureWindow ) - currentMouseWindow = wxApp::s_captureWindow; - - switch ( GetEventClass( event ) ) - { - case kEventClassKeyboard: - { - result = wxWebKitKeyEventHandler(handler, event, data); - break; - } - - case kEventClassTextInput: - { - result = wxMacUnicodeTextEventHandler(handler, event, data); - break; - } - - case kEventClassMouse: - { - switch ( GetEventKind( event ) ) - { - case kEventMouseDragged : - case kEventMouseMoved : - case kEventMouseDown : - case kEventMouseUp : - { - wxMouseEvent wxevent(wxEVT_LEFT_DOWN); - SetupMouseEvent( wxevent , cEvent ) ; - - currentMouseWindow->ScreenToClient( &wxevent.m_x , &wxevent.m_y ) ; - wxevent.SetEventObject( currentMouseWindow ) ; - wxevent.SetId( currentMouseWindow->GetId() ) ; - - if ( currentMouseWindow->GetEventHandler()->ProcessEvent(wxevent) ) - { - result = noErr; - } - - break; // this should enable WebKit to fire mouse dragged and mouse up events... - } - default : - break ; - } - } - default: - break; - } - - result = CallNextEventHandler(handler, event); - return result ; -} - -DEFINE_ONE_SHOT_HANDLER_GETTER( wxWebKitCtrlEventHandler ) - - -// ---------------------------------------------------------------------------- -// wxWebKit Events -// ---------------------------------------------------------------------------- - -IMPLEMENT_DYNAMIC_CLASS( wxWebKitStateChangedEvent, wxCommandEvent ) - -DEFINE_EVENT_TYPE( wxEVT_WEBKIT_STATE_CHANGED ) - -wxWebKitStateChangedEvent::wxWebKitStateChangedEvent( wxWindow* win ) -{ - SetEventType( wxEVT_WEBKIT_STATE_CHANGED); - SetEventObject( win ); - SetId(win->GetId()); -} - -IMPLEMENT_DYNAMIC_CLASS( wxWebKitBeforeLoadEvent, wxCommandEvent ) - -DEFINE_EVENT_TYPE( wxEVT_WEBKIT_BEFORE_LOAD ) - -wxWebKitBeforeLoadEvent::wxWebKitBeforeLoadEvent( wxWindow* win ) -{ - m_cancelled = false; - SetEventType( wxEVT_WEBKIT_BEFORE_LOAD); - SetEventObject( win ); - SetId(win->GetId()); -} - - -IMPLEMENT_DYNAMIC_CLASS( wxWebKitNewWindowEvent, wxCommandEvent ) - -DEFINE_EVENT_TYPE( wxEVT_WEBKIT_NEW_WINDOW ) - -wxWebKitNewWindowEvent::wxWebKitNewWindowEvent( wxWindow* win ) -{ - SetEventType( wxEVT_WEBKIT_NEW_WINDOW); - SetEventObject( win ); - SetId(win->GetId()); -} - - - -//--------------------------------------------------------- -// helper functions for NSString<->wxString conversion -//--------------------------------------------------------- - -inline wxString wxStringWithNSString(NSString *nsstring) -{ -#if wxUSE_UNICODE - return wxString([nsstring UTF8String], wxConvUTF8); -#else - return wxString([nsstring lossyCString]); -#endif // wxUSE_UNICODE -} - -inline NSString* wxNSStringWithWxString(const wxString &wxstring) -{ -#if wxUSE_UNICODE - return [NSString stringWithUTF8String: wxstring.mb_str(wxConvUTF8)]; -#else - return [NSString stringWithCString: wxstring.c_str() length:wxstring.Len()]; -#endif // wxUSE_UNICODE -} - -inline int wxNavTypeFromWebNavType(int type){ - if (type == WebNavigationTypeLinkClicked) - return wxWEBKIT_NAV_LINK_CLICKED; - - if (type == WebNavigationTypeFormSubmitted) - return wxWEBKIT_NAV_FORM_SUBMITTED; - - if (type == WebNavigationTypeBackForward) - return wxWEBKIT_NAV_BACK_NEXT; - - if (type == WebNavigationTypeReload) - return wxWEBKIT_NAV_RELOAD; - - if (type == WebNavigationTypeFormResubmitted) - return wxWEBKIT_NAV_FORM_RESUBMITTED; - - return wxWEBKIT_NAV_OTHER; -} - -@interface MyFrameLoadMonitor : NSObject -{ - wxWebKitCtrl* webKitWindow; -} - -- initWithWxWindow: (wxWebKitCtrl*)inWindow; - -@end - -@interface MyPolicyDelegate : NSObject -{ - wxWebKitCtrl* webKitWindow; -} - -- initWithWxWindow: (wxWebKitCtrl*)inWindow; - -@end - -// ---------------------------------------------------------------------------- -// creation/destruction -// ---------------------------------------------------------------------------- - -bool wxWebKitCtrl::Create(wxWindow *parent, - wxWindowID winID, - const wxString& strURL, - const wxPoint& pos, - const wxSize& size, long style, - const wxValidator& validator, - const wxString& name) -{ - - m_currentURL = strURL; - //m_pageTitle = _("Untitled Page"); - - //still needed for wxCocoa?? -/* - int width, height; - wxSize sizeInstance; - if (size.x == wxDefaultCoord || size.y == wxDefaultCoord) - { - m_parent->GetClientSize(&width, &height); - sizeInstance.x = width; - sizeInstance.y = height; - } - else - { - sizeInstance.x = size.x; - sizeInstance.y = size.y; - } -*/ - // now create and attach WebKit view... -#ifdef __WXCOCOA__ - wxControl::Create(parent, m_windowID, pos, sizeInstance, style , validator , name); - SetSize(pos.x, pos.y, sizeInstance.x, sizeInstance.y); - - wxTopLevelWindowCocoa *topWin = wxDynamicCast(this, wxTopLevelWindowCocoa); - NSWindow* nsWin = topWin->GetNSWindow(); - NSRect rect; - rect.origin.x = pos.x; - rect.origin.y = pos.y; - rect.size.width = sizeInstance.x; - rect.size.height = sizeInstance.y; - m_webView = (WebView*)[[WebView alloc] initWithFrame:rect frameName:@"webkitFrame" groupName:@"webkitGroup"]; - SetNSView(m_webView); - [m_cocoaNSView release]; - - if(m_parent) m_parent->CocoaAddChild(this); - SetInitialFrameRect(pos,sizeInstance); -#else - m_macIsUserPane = false; - wxControl::Create(parent, winID, pos, size, style , validator , name); - m_peer = new wxMacControl(this); - WebInitForCarbon(); - HIWebViewCreate( m_peer->GetControlRefAddr() ); - - m_webView = (WebView*) HIWebViewGetWebView( m_peer->GetControlRef() ); - - MacPostControlCreate(pos, size); - HIViewSetVisible( m_peer->GetControlRef(), true ); - [m_webView setHidden:false]; -#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_3 - if ( UMAGetSystemVersion() >= 0x1030 ) - HIViewChangeFeatures( m_peer->GetControlRef() , kHIViewIsOpaque , 0 ) ; -#endif - InstallControlEventHandler( m_peer->GetControlRef() , GetwxWebKitCtrlEventHandlerUPP(), - GetEventTypeCount(eventList), eventList, this, - (EventHandlerRef *)&m_webKitCtrlEventHandler); - -#endif - - // Register event listener interfaces - MyFrameLoadMonitor* myFrameLoadMonitor = [[MyFrameLoadMonitor alloc] initWithWxWindow: this]; - [m_webView setFrameLoadDelegate:myFrameLoadMonitor]; - - // this is used to veto page loads, etc. - MyPolicyDelegate* myPolicyDelegate = [[MyPolicyDelegate alloc] initWithWxWindow: this]; - [m_webView setPolicyDelegate:myPolicyDelegate]; - - LoadURL(m_currentURL); - return true; -} - -wxWebKitCtrl::~wxWebKitCtrl() -{ - MyFrameLoadMonitor* myFrameLoadMonitor = [m_webView frameLoadDelegate]; - MyPolicyDelegate* myPolicyDelegate = [m_webView policyDelegate]; - [m_webView setFrameLoadDelegate: nil]; - [m_webView setPolicyDelegate: nil]; - - if (myFrameLoadMonitor) - [myFrameLoadMonitor release]; - - if (myPolicyDelegate) - [myPolicyDelegate release]; -} - -// ---------------------------------------------------------------------------- -// public methods -// ---------------------------------------------------------------------------- - -void wxWebKitCtrl::LoadURL(const wxString &url) -{ - if( !m_webView ) - return; - - [[m_webView mainFrame] loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:wxNSStringWithWxString(url)]]]; - - m_currentURL = url; -} - -bool wxWebKitCtrl::CanGoBack(){ - if ( !m_webView ) - return false; - - return [m_webView canGoBack]; -} - -bool wxWebKitCtrl::CanGoForward(){ - if ( !m_webView ) - return false; - - return [m_webView canGoForward]; -} - -bool wxWebKitCtrl::GoBack(){ - if ( !m_webView ) - return false; - - bool result = [(WebView*)m_webView goBack]; - return result; -} - -bool wxWebKitCtrl::GoForward(){ - if ( !m_webView ) - return false; - - bool result = [(WebView*)m_webView goForward]; - return result; -} - -void wxWebKitCtrl::Reload(){ - if ( !m_webView ) - return; - - [[m_webView mainFrame] reload]; -} - -void wxWebKitCtrl::Stop(){ - if ( !m_webView ) - return; - - [[m_webView mainFrame] stopLoading]; -} - -bool wxWebKitCtrl::CanGetPageSource(){ - if ( !m_webView ) - return false; - - WebDataSource* dataSource = [[m_webView mainFrame] dataSource]; - return ( [[dataSource representation] canProvideDocumentSource] ); -} - -wxString wxWebKitCtrl::GetPageSource(){ - - if (CanGetPageSource()){ - WebDataSource* dataSource = [[m_webView mainFrame] dataSource]; - return wxStringWithNSString( [[dataSource representation] documentSource] ); - } - - return wxEmptyString; -} - -wxString wxWebKitCtrl::GetSelection(){ - if ( !m_webView ) - return wxEmptyString; - - NSString* selectedText = [[m_webView selectedDOMRange] toString]; - return wxStringWithNSString( selectedText ); -} - -bool wxWebKitCtrl::CanIncreaseTextSize(){ - if ( !m_webView ) - return false; - - if ([m_webView canMakeTextLarger]) - return true; - else - return false; -} - -void wxWebKitCtrl::IncreaseTextSize(){ - if ( !m_webView ) - return; - - if (CanIncreaseTextSize()) - [m_webView makeTextLarger:(WebView*)m_webView]; -} - -bool wxWebKitCtrl::CanDecreaseTextSize(){ - if ( !m_webView ) - return false; - - if ([m_webView canMakeTextSmaller]) - return true; - else - return false; -} - -void wxWebKitCtrl::DecreaseTextSize(){ - if ( !m_webView ) - return; - - if (CanDecreaseTextSize()) - [m_webView makeTextSmaller:(WebView*)m_webView]; -} - -void wxWebKitCtrl::SetPageSource(const wxString& source, const wxString& baseUrl){ - if ( !m_webView ) - return; - - [[m_webView mainFrame] loadHTMLString:(NSString*)wxNSStringWithWxString( source ) baseURL:[NSURL URLWithString:wxNSStringWithWxString( baseUrl )]]; - -} - -void wxWebKitCtrl::Print(bool showPrompt){ - if ( !m_webView ) - return; - - id view = [[[m_webView mainFrame] frameView] documentView]; - NSPrintOperation *op = [NSPrintOperation printOperationWithView:view printInfo: [NSPrintInfo sharedPrintInfo]]; - if (showPrompt){ - [op setShowsPrintPanel: showPrompt]; - // in my tests, the progress bar always freezes and it stops the whole print operation. - // do not turn this to true unless there is a workaround for the bug. - [op setShowsProgressPanel: false]; - } - // Print it. - [op runOperation]; -} - -void wxWebKitCtrl::MakeEditable(bool enable){ - if ( !m_webView ) - return; - - [m_webView setEditable:enable ]; -} - -bool wxWebKitCtrl::IsEditable(){ - if ( !m_webView ) - return false; - - return [m_webView isEditable]; -} - -int wxWebKitCtrl::GetScrollPos(){ - id result = [[m_webView windowScriptObject] evaluateWebScript:@"document.body.scrollTop"]; - return [result intValue]; -} - -void wxWebKitCtrl::SetScrollPos(int pos){ - if ( !m_webView ) - return; - - wxString javascript; - javascript.Printf(wxT("document.body.scrollTop = %d;"), pos); - [[m_webView windowScriptObject] evaluateWebScript:(NSString*)wxNSStringWithWxString( javascript )]; -} - -wxString wxWebKitCtrl::RunScript(const wxString& javascript){ - if ( !m_webView ) - return wxEmptyString; - - id result = [[m_webView windowScriptObject] evaluateWebScript:(NSString*)wxNSStringWithWxString( javascript )]; - - NSString* resultAsString; - wxString resultAsWxString = wxEmptyString; - NSString* className = NSStringFromClass([result class]); - if ([className isEqualToString:@"NSCFNumber"]) - resultAsString = [NSString stringWithFormat:@"%@", result]; - else if ([className isEqualToString:@"NSCFString"]) - resultAsString = result; - else if ([className isEqualToString:@"NSCFBoolean"]){ - if ([result boolValue]) - resultAsString = @"true"; - else - resultAsString = @"false"; - } - else if ([className isEqualToString:@"WebScriptObject"]) - resultAsString = [result stringRepresentation]; - else - fprintf(stderr, "wxWebKitCtrl::RunScript - Unexpected return type: %s!\n", [className UTF8String]); - - resultAsWxString = wxStringWithNSString( resultAsString ); - return resultAsWxString; -} - -void wxWebKitCtrl::OnSize(wxSizeEvent &event){ - // This is a nasty hack because WebKit seems to lose its position when it is embedded - // in a control that is not itself the content view for a TLW. - // I put it in OnSize because these calcs are not perfect, and in fact are basically - // guesses based on reverse engineering, so it's best to give people the option of - // overriding OnSize with their own calcs if need be. - // I also left some test debugging print statements as a convenience if a(nother) - // problem crops up. - - wxWindow* tlw = MacGetTopLevelWindow(); - - NSRect frame = [m_webView frame]; - NSRect bounds = [m_webView bounds]; - -#if DEBUG_WEBKIT_SIZING - fprintf(stderr,"Carbon window x=%d, y=%d, width=%d, height=%d\n", GetPosition().x, GetPosition().y, GetSize().x, GetSize().y); - fprintf(stderr, "Cocoa window frame x=%G, y=%G, width=%G, height=%G\n", frame.origin.x, frame.origin.y, frame.size.width, frame.size.height); - fprintf(stderr, "Cocoa window bounds x=%G, y=%G, width=%G, height=%G\n", bounds.origin.x, bounds.origin.y, bounds.size.width, bounds.size.height); -#endif - - // This must be the case that Apple tested with, because well, in this one case - // we don't need to do anything! It just works. ;) - if (GetParent() == tlw){ - return; - } - - // since we no longer use parent coordinates, we always want 0,0. - int x = 0; - int y = 0; - - HIRect rect; - rect.origin.x = x; - rect.origin.y = y; - -#if DEBUG_WEBKIT_SIZING - printf("Before conversion, origin is: x = %d, y = %d\n", x, y); -#endif - - // NB: In most cases, when calling HIViewConvertRect, what people want is to use GetRootControl(), - // and this tripped me up at first. But in fact, what we want is the root view, because we need to - // make the y origin relative to the very top of the window, not its contents, since we later flip - // the y coordinate for Cocoa. - HIViewConvertRect (&rect, m_peer->GetControlRef(), - HIViewGetRoot( (WindowRef) MacGetTopLevelWindowRef() ) ); - - x = (int)rect.origin.x; - y = (int)rect.origin.y; - -#if DEBUG_WEBKIT_SIZING - printf("Moving Cocoa frame origin to: x = %d, y = %d\n", x, y); -#endif - - if (tlw){ - //flip the y coordinate to convert to Cocoa coordinates - y = tlw->GetSize().y - ((GetSize().y) + y); - } - -#if DEBUG_WEBKIT_SIZING - printf("y = %d after flipping value\n", y); -#endif - - frame.origin.x = x; - frame.origin.y = y; - [m_webView setFrame:frame]; - - if (IsShown()) - [(WebView*)m_webView display]; - event.Skip(); -} - -void wxWebKitCtrl::MacVisibilityChanged(){ - bool isHidden = !IsControlVisible( m_peer->GetControlRef()); - if (!isHidden) - [(WebView*)m_webView display]; - - [m_webView setHidden:isHidden]; -} - -//------------------------------------------------------------ -// Listener interfaces -//------------------------------------------------------------ - -// NB: I'm still tracking this down, but it appears the Cocoa window -// still has these events fired on it while the Carbon control is being -// destroyed. Therefore, we must be careful to check both the existence -// of the Carbon control and the event handler before firing events. - -@implementation MyFrameLoadMonitor - -- initWithWxWindow: (wxWebKitCtrl*)inWindow -{ - [super init]; - webKitWindow = inWindow; // non retained - return self; -} - -- (void)webView:(WebView *)sender didStartProvisionalLoadForFrame:(WebFrame *)frame -{ - if (webKitWindow && frame == [sender mainFrame]){ - NSString *url = [[[[frame provisionalDataSource] request] URL] absoluteString]; - wxWebKitStateChangedEvent thisEvent(webKitWindow); - thisEvent.SetState(wxWEBKIT_STATE_NEGOTIATING); - thisEvent.SetURL( wxStringWithNSString( url ) ); - if (webKitWindow->GetEventHandler()) - webKitWindow->GetEventHandler()->ProcessEvent( thisEvent ); - } -} - -- (void)webView:(WebView *)sender didCommitLoadForFrame:(WebFrame *)frame -{ - if (webKitWindow && frame == [sender mainFrame]){ - NSString *url = [[[[frame dataSource] request] URL] absoluteString]; - wxWebKitStateChangedEvent thisEvent(webKitWindow); - thisEvent.SetState(wxWEBKIT_STATE_TRANSFERRING); - thisEvent.SetURL( wxStringWithNSString( url ) ); - if (webKitWindow->GetEventHandler()) - webKitWindow->GetEventHandler()->ProcessEvent( thisEvent ); - } -} - -- (void)webView:(WebView *)sender didFinishLoadForFrame:(WebFrame *)frame -{ - if (webKitWindow && frame == [sender mainFrame]){ - NSString *url = [[[[frame dataSource] request] URL] absoluteString]; - wxWebKitStateChangedEvent thisEvent(webKitWindow); - thisEvent.SetState(wxWEBKIT_STATE_STOP); - thisEvent.SetURL( wxStringWithNSString( url ) ); - if (webKitWindow->GetEventHandler()) - webKitWindow->GetEventHandler()->ProcessEvent( thisEvent ); - } -} - -- (void)webView:(WebView *)sender didFailLoadWithError:(NSError*) error forFrame:(WebFrame *)frame -{ - if (webKitWindow && frame == [sender mainFrame]){ - NSString *url = [[[[frame dataSource] request] URL] absoluteString]; - wxWebKitStateChangedEvent thisEvent(webKitWindow); - thisEvent.SetState(wxWEBKIT_STATE_FAILED); - thisEvent.SetURL( wxStringWithNSString( url ) ); - if (webKitWindow->GetEventHandler()) - webKitWindow->GetEventHandler()->ProcessEvent( thisEvent ); - } -} - -- (void)webView:(WebView *)sender didFailProvisionalLoadWithError:(NSError*) error forFrame:(WebFrame *)frame -{ - if (webKitWindow && frame == [sender mainFrame]){ - NSString *url = [[[[frame provisionalDataSource] request] URL] absoluteString]; - wxWebKitStateChangedEvent thisEvent(webKitWindow); - thisEvent.SetState(wxWEBKIT_STATE_FAILED); - thisEvent.SetURL( wxStringWithNSString( url ) ); - if (webKitWindow->GetEventHandler()) - webKitWindow->GetEventHandler()->ProcessEvent( thisEvent ); - } -} - -- (void)webView:(WebView *)sender didReceiveTitle:(NSString *)title forFrame:(WebFrame *)frame -{ - if (webKitWindow && frame == [sender mainFrame]){ - webKitWindow->SetPageTitle(wxStringWithNSString( title )); - } -} -@end - -@implementation MyPolicyDelegate - -- initWithWxWindow: (wxWebKitCtrl*)inWindow -{ - [super init]; - webKitWindow = inWindow; // non retained - return self; -} - -- (void)webView:(WebView *)sender decidePolicyForNavigationAction:(NSDictionary *)actionInformation request:(NSURLRequest *)request frame:(WebFrame *)frame decisionListener:(id)listener -{ - wxWebKitBeforeLoadEvent thisEvent(webKitWindow); - - // Get the navigation type. - NSNumber *n = [actionInformation objectForKey:WebActionNavigationTypeKey]; - int actionType = [n intValue]; - thisEvent.SetNavigationType( wxNavTypeFromWebNavType(actionType) ); - - NSString *url = [[request URL] absoluteString]; - thisEvent.SetURL( wxStringWithNSString( url ) ); - - if (webKitWindow && webKitWindow->GetEventHandler()) - webKitWindow->GetEventHandler()->ProcessEvent(thisEvent); - - if (thisEvent.IsCancelled()) - [listener ignore]; - else - [listener use]; -} - -- (void)webView:(WebView *)sender decidePolicyForNewWindowAction:(NSDictionary *)actionInformation request:(NSURLRequest *)request newFrameName:(NSString *)frameName decisionListener:(id < WebPolicyDecisionListener >)listener -{ - wxWebKitNewWindowEvent thisEvent(webKitWindow); - - NSString *url = [[request URL] absoluteString]; - thisEvent.SetURL( wxStringWithNSString( url ) ); - thisEvent.SetTargetName( wxStringWithNSString( frameName ) ); - - if (webKitWindow && webKitWindow->GetEventHandler()) - webKitWindow->GetEventHandler()->ProcessEvent(thisEvent); - - [listener use]; -} -@end - -#endif //wxUSE_WEBKIT diff --git a/wxWidgets/src/html/htmlfilt.cpp b/wxWidgets/src/html/htmlfilt.cpp deleted file mode 100644 index 1714302de9..0000000000 --- a/wxWidgets/src/html/htmlfilt.cpp +++ /dev/null @@ -1,223 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/html/htmlfilt.cpp -// Purpose: wxHtmlFilter - input filter for translating into HTML format -// Author: Vaclav Slavik -// RCS-ID: $Id: htmlfilt.cpp 38788 2006-04-18 08:11:26Z ABX $ -// Copyright: (c) 1999 Vaclav Slavik -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_HTML && wxUSE_STREAMS - -#ifndef WXPRECOMP - #include "wx/log.h" - #include "wx/intl.h" -#endif - -#include "wx/strconv.h" -#include "wx/html/htmlfilt.h" -#include "wx/html/htmlwin.h" - -// utility function: read a wxString from a wxInputStream -static void ReadString(wxString& str, wxInputStream* s, wxMBConv& conv) -{ - size_t streamSize = s->GetSize(); - - if (streamSize == ~(size_t)0) - { - const size_t bufSize = 4095; - char buffer[bufSize+1]; - size_t lastRead; - - do - { - s->Read(buffer, bufSize); - lastRead = s->LastRead(); - buffer[lastRead] = 0; - str.Append(wxString(buffer, conv)); - } - while (lastRead == bufSize); - } - else - { - char* src = new char[streamSize+1]; - s->Read(src, streamSize); - src[streamSize] = 0; - str = wxString(src, conv); - delete[] src; - } -} - -/* - -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(); - wxString doc, doc2; - - if (s == NULL) return wxEmptyString; - ReadString(doc, s, wxConvISO8859_1); - - doc.Replace(wxT("&"), wxT("&"), true); - doc.Replace(wxT("<"), wxT("<"), true); - doc.Replace(wxT(">"), wxT(">"), true); - doc2 = wxT("

\n") + doc + wxT("\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) == wxT("image/")); -} - - - -wxString wxHtmlFilterImage::ReadFile(const wxFSFile& file) const -{ - wxString res = wxT(""); - return res; -} - - - - -//-------------------------------------------------------------------------------- -// wxHtmlFilterHTML -// filter for text/html -//-------------------------------------------------------------------------------- - - -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(wxT("text/html")) == 0); -} - - - -wxString wxHtmlFilterHTML::ReadFile(const wxFSFile& file) const -{ - wxInputStream *s = file.GetStream(); - wxString doc; - - if (s == NULL) - { - wxLogError(_("Cannot open HTML document: %s"), file.GetLocation().c_str()); - return wxEmptyString; - } - - // NB: We convert input file to wchar_t here in Unicode mode, based on - // either Content-Type header or tags. In ANSI mode, we don't - // do it as it is done by wxHtmlParser (for this reason, we add - // tag if we used Content-Type header). -#if wxUSE_UNICODE - int charsetPos; - if ((charsetPos = file.GetMimeType().Find(_T("; charset="))) != wxNOT_FOUND) - { - wxString charset = file.GetMimeType().Mid(charsetPos + 10); - wxCSConv conv(charset); - ReadString(doc, s, conv); - } - else - { - wxString tmpdoc; - ReadString(tmpdoc, s, wxConvISO8859_1); - wxString charset = wxHtmlParser::ExtractCharsetInformation(tmpdoc); - if (charset.empty()) - doc = tmpdoc; - else - { - wxCSConv conv(charset); - doc = wxString(tmpdoc.mb_str(wxConvISO8859_1), conv); - } - } -#else // !wxUSE_UNICODE - ReadString(doc, s, wxConvLibc); - // add meta tag if we obtained this through http: - if (!file.GetMimeType().empty()) - { - wxString hdr; - wxString mime = file.GetMimeType(); - hdr.Printf(_T(""), mime.c_str()); - return hdr+doc; - } -#endif - - 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/wxWidgets/src/html/htmlpars.cpp b/wxWidgets/src/html/htmlpars.cpp deleted file mode 100644 index e4acb0b56b..0000000000 --- a/wxWidgets/src/html/htmlpars.cpp +++ /dev/null @@ -1,961 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/html/htmlpars.cpp -// Purpose: wxHtmlParser class (generic parser) -// Author: Vaclav Slavik -// RCS-ID: $Id: htmlpars.cpp 66413 2010-12-20 17:40:05Z JS $ -// Copyright: (c) 1999 Vaclav Slavik -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_HTML && wxUSE_STREAMS - -#ifndef WXPRECOMP - #include "wx/dynarray.h" - #include "wx/log.h" - #include "wx/intl.h" - #include "wx/app.h" -#endif - -#include "wx/tokenzr.h" -#include "wx/wfstream.h" -#include "wx/url.h" -#include "wx/fontmap.h" -#include "wx/html/htmldefs.h" -#include "wx/html/htmlpars.h" -#include "wx/arrimpl.cpp" - -#ifdef __WXWINCE__ - #include "wx/msw/wince/missing.h" // for bsearch() -#endif - -// DLL options compatibility check: -WX_CHECK_BUILD_OPTIONS("wxHTML") - -const wxChar *wxTRACE_HTML_DEBUG = _T("htmldebug"); - -//----------------------------------------------------------------------------- -// wxHtmlParser helpers -//----------------------------------------------------------------------------- - -class wxHtmlTextPiece -{ -public: - wxHtmlTextPiece(int pos, int lng) : m_pos(pos), m_lng(lng) {} - int m_pos, m_lng; -}; - -WX_DECLARE_OBJARRAY(wxHtmlTextPiece, wxHtmlTextPieces); -WX_DEFINE_OBJARRAY(wxHtmlTextPieces) - -class wxHtmlParserState -{ -public: - wxHtmlTag *m_curTag; - wxHtmlTag *m_tags; - wxHtmlTextPieces *m_textPieces; - int m_curTextPiece; - wxString m_source; - wxHtmlParserState *m_nextState; -}; - -//----------------------------------------------------------------------------- -// wxHtmlParser -//----------------------------------------------------------------------------- - -IMPLEMENT_ABSTRACT_CLASS(wxHtmlParser,wxObject) - -wxHtmlParser::wxHtmlParser() - : wxObject(), m_HandlersHash(wxKEY_STRING), - m_FS(NULL), m_HandlersStack(NULL) -{ - m_entitiesParser = new wxHtmlEntitiesParser; - m_Tags = NULL; - m_CurTag = NULL; - m_TextPieces = NULL; - m_CurTextPiece = 0; - m_SavedStates = NULL; -} - -wxHtmlParser::~wxHtmlParser() -{ - while (RestoreState()) {} - DestroyDOMTree(); - - if (m_HandlersStack) - { - wxList& tmp = *m_HandlersStack; - wxList::iterator it, en; - for( it = tmp.begin(), en = tmp.end(); it != en; ++it ) - delete (wxHashTable*)*it; - tmp.clear(); - } - delete m_HandlersStack; - m_HandlersHash.Clear(); - WX_CLEAR_LIST(wxList, m_HandlersList); - delete m_entitiesParser; -} - -wxObject* wxHtmlParser::Parse(const wxString& source) -{ - InitParser(source); - DoParsing(); - wxObject *result = GetProduct(); - DoneParser(); - return result; -} - -void wxHtmlParser::InitParser(const wxString& source) -{ - SetSource(source); - m_stopParsing = false; -} - -void wxHtmlParser::DoneParser() -{ - DestroyDOMTree(); -} - -void wxHtmlParser::SetSource(const wxString& src) -{ - DestroyDOMTree(); - m_Source = src; - CreateDOMTree(); - m_CurTag = NULL; - m_CurTextPiece = 0; -} - -void wxHtmlParser::CreateDOMTree() -{ - wxHtmlTagsCache cache(m_Source); - m_TextPieces = new wxHtmlTextPieces; - CreateDOMSubTree(NULL, 0, m_Source.length(), &cache); - m_CurTextPiece = 0; -} - -extern bool wxIsCDATAElement(const wxChar *tag); - -void wxHtmlParser::CreateDOMSubTree(wxHtmlTag *cur, - int begin_pos, int end_pos, - wxHtmlTagsCache *cache) -{ - if (end_pos <= begin_pos) return; - - wxChar c; - int i = begin_pos; - int textBeginning = begin_pos; - - // If the tag contains CDATA text, we include the text between beginning - // and ending tag verbosely. Setting i=end_pos will skip to the very - // end of this function where text piece is added, bypassing any child - // tags parsing (CDATA element can't have child elements by definition): - if (cur != NULL && wxIsCDATAElement(cur->GetName().c_str())) - { - i = end_pos; - } - - while (i < end_pos) - { - c = m_Source.GetChar(i); - - if (c == wxT('<')) - { - // add text to m_TextPieces: - if (i - textBeginning > 0) - m_TextPieces->Add( - wxHtmlTextPiece(textBeginning, i - textBeginning)); - - // if it is a comment, skip it: - if (i < end_pos-6 && m_Source.GetChar(i+1) == wxT('!') && - m_Source.GetChar(i+2) == wxT('-') && - m_Source.GetChar(i+3) == wxT('-')) - { - // Comments begin with " /home/kejin/iodbc-2.12.sl - -3. odbc.ini( ~/.odbc.ini ) - - Driver manager and drivers use odbc.ini(or ~/.odbc.ini on Unix) file - or connection string when establishing a data source connection. On - Windows, odbc.ini is located in Windows directory. On unix, iODBC driver - manager(and all other ODBC drivers and driver managers I awared) looks - .odbc.ini file in real user's home directory (it could be a softlink to - the file located somewhere else). Make sure your driver will look into - the same file (or a file which is a symbolic link to the same file). - The format of odbc.ini( or ~/.odbc.ini ) is defined as: - - odbc.ini(or .odbc.ini) ::= data_source_list - - data_source_list ::= /* empty */ - | data_source '\n' data_source_list - - data_source ::= '[' data_source_name ']' '\n' data_source_desc - - data_source_name ::= 'default' | [A-Za-z]*[A-Za-z0-9_]* - - data_source_desc ::= /* empty */ - | attrib_desc '\n' data_source_desc - - addrib_desc ::= Attrib '=' attrib_value - - Attrib ::= 'Driver' | 'PID' | 'UID' | driver_def_attrib - - driver_def_attrib ::= [A-Za-z]*[A-Za-z0-9_]* - - An example of .odbc.ini file: - - [toronto_yp] - # yellow page of metro Toronto - Driver = /usr/lib/odbc/oracle.so - <....> - - [toronto_wp] - # white page of metro Toronto - Driver = /usr/lib/odbc/oracle.so - <....> - - [contract] - # all contract documents - Driver = /usr/lib/odbc/informix.so - <....> - - [netnews] - # NNTP netnews group - Driver = /usr/lib/odbc/nnodbc.so - Server = news.empress.com - - [rnd_test] - # data source for R&D test - Driver = /home/r_d/odbc/empodbc.so - URL = empodbc://rnd.empress.com:6322/rnd_test/testdb - - [default] - # default to odbc gateway - Driver = /usr/lib/odbc/gateway.so - -4. Tracing - - iODBC driver manager traces driver's ODBC call invoked by the driver - manager. Default tracing file is ./odbc.log. Tracing option (i.e. - on/off or optional tracing file name) can be set in ~/.odbc.ini - file (under a data source section) as: - - TraceFile = - Trace = ON | On | on | 1 | OFF | Off | off | 0 - - If is stderr or stdout, i.e. - - TraceFile = stderr - - or - - TraceFile = stdout - - the tracing message will go to the terminal screen(if it is available). - - iODBC driver manager allows one to tune on/off tracing on selected - connection(s). Different connections can share one or use different - tracing file(s). ODBC calls on connections without tuning tracing on - will not be traced. - -5. File list: - - README This file - IAFA-PACKAGE Version and copyright information - Changes.log Source changes log - Version.mk Version make include file - Config.mk Config make include file - Makefile make file - config.h system config include file - isql.h ODBC 1.0 macro - isqlext.h ODBC 2.0 macro - dlf.h general dynamic loader module interface - dlf.c general dynamic loader module (mapping to svr4) - dlproc.h simple dynamic loader module interface - dlproc.c simple dynamic loader on top of dlf module - herr.h error handling module interface - herr.c error handling module - herr.ci error handling source include - henv.h environment handle interface - henv.c environment handle module - henv.ci environment handle source include - hdbc.h connection handle interface - hdbc.c connection handle module - hstmt.h statement handle interface - hstmt.c statement handle module - connect.c connect functions - prepare.c query prepare functions - execute.c query executing functions - result.c query result property functions - fetch.c query result fetch functions - info.c driver information functions - catalog.c catalog functions - misc.c miscellaneous functions - itrace.h macro - itrace.c trace function - main.c entry function used to build a share library on AIX - shrsub.exp export symbol list used on AIX - autoconfig shell script for creating Config.mk - build shell script for building iodbc driver manager diff --git a/wxWidgets/src/iodbc/autoconfig b/wxWidgets/src/iodbc/autoconfig deleted file mode 100644 index ac6de96f2d..0000000000 --- a/wxWidgets/src/iodbc/autoconfig +++ /dev/null @@ -1,230 +0,0 @@ -#! /usr/bin/sh - -cat > Config.tmp << '@END' -# -# Copyright (C) 1995 by Ke Jin -# - -#============ Default for all system ============== -SHELL = -SHELL = /bin/sh -DLDAPI = DLDAPI_SVR4_DLFCN -DLSUFFIX= so -OUTFILE = iodbc -OBJX = -@END - -\rm -f Makefile.tmp -cat > Makefile.tmp <<'@END' -include Version.mk -include Config.mk -@END - -case $1 in - sun4) - cat >> Config.tmp << '@END' - -#============ SunOS 4.1.x ========================= -PIC = -pic -CC = acc -LIBS = -ldl -@END - ;; - - aix) - cat >> Config.tmp << '@END' - -#=========== AIX 3.x 4.x ========================== -DLDAPI = DLDAPI_AIX_LOAD -ANSI = -langlvl=ansi -LDFLAGS = -H512 -T512 -bE:shrsub.exp -bM:SRE -LIBS = -lc -OBJX = main.o -DLSUFFIX= s.o -CFLAGSX = -DCLI_NAME_PREFIX=\".SQL\" -@END - ;; - - hp300 | hp400) - cat >> Config.tmp << '@END' - -#============ HP/UX (s300/s400) 9.x 10.x ========== -DLDAPI = DLDAPI_HP_SHL -ANSI = -Aa -PIC = +z -LDFLAGS = -b -DLSUFFIX= sl -CFLAGSX = -D_INCLUDE_POSIX_SOURCE -DCLI_NAME_PREFIX=\"_SQL\" -@END - ;; - - hp700 | hp800) - cat >> Config.tmp << '@END' - -#============ HP/UX 9000(s700/s800) 9.x 10.x ====== -DLDAPI = DLDAPI_HP_SHL -ANSI = -Aa -PIC = +z -LDFLAGS = -b -LIBS = -lc -ldld -DLSUFFIX= sl -CFLAGSX = -D_INCLUDE_POSIX_SOURCE -@END - ;; - - solaris) - cat >> Config.tmp << '@END' - -#======= Solaris 2.x, SunOS 5.x (Sparc/x86) ======= -LDFLAGS = -G -z defs -LIBS = -lc -ldl -lnsl -@END - ;; - - ncr |gis) - cat >> Config.tmp << '@END' - -#============= NCR SVR4 3.x ======================= -PIC = -KPIC -LDFLAGS = -G -z defs -LIBS = -lc -ldl -@END - ;; - - unixware) - cat >> Config.tmp << '@END' - -#========= UnixWare SVR4 1.x, 2.x ================= -PIC = -KPIC -LDFLAGS = -G -z defs -LIBS = -lc -ldl -@END - ;; - - maxos) - cat >> Config.tmp << '@END' - -#============ Concurrent Maxion MAX/OS 1.x ======== -PIC = -KPIC -LDFLAGS = -G -z defs -LIBS = -lc -ldl -@END - ;; - - sco-opensrv | sco-osr5 ) - cat >> Config.tmp << '@END' - -#============ SCO OpenServer 5.x ================== -PIC = -K PIC -b elf -LDFLAGS = -G -z defs -LIBS = -lc -ldl -@END - ;; - - dgux) - cat >> Config.tmp << '@END' - -#============ DG/UX 5.x =========================== -PIC = -K PIC -LDFLAGS = -G -z defs -LIBS = -lc -ldl -@END - ;; - - freebsd) - cat >> Config.tmp << '@END' - -#============= FreeBSD 2.x ======================== -PIC = -fPIC -CFLAGSX = -DCLI_NAME_PREFIX=\"_SQL\" -LDFLAGS = -Bshareable -LIBS = -lc -@END - - \rm -f Makefile.tmp - cat > Makefile.tmp <<'@END' -.include "Version.mk" -.include "Config.mk" -@END - ;; - - bsd-os) - cat >> Config.tmp << '@END' - -#============ BSDI BSD/OS 2.x ===================== -# -# ported by: Stuart Hayton -# -CC = gcc -LDFLAGS = -r -LDSUFFIX= o -LIBS = -lc_s.2.0 -ldl -@END - ;; - - linux-elf) - cat >> Config.tmp << '@END' - -#============= Linux ELF ========================= -# Slackware 2.x,(kernel 1.3.x) on i386 -# Red Hat 2.x (kernel 1.2.x) on i486 -# -ANSI = -ansi -CC = gcc -PIC = -fPIC -LDFLAGS = -shared -LIBS = -ldl -@END - ;; - - irix5| irix6) - cat >> Config.tmp << '@END' - -#============= SGI IRIX 5.x, 6.x ================= -LDFLAGS = -shared -LIBS = -lc -@END - ;; - - dec-osf1 | dec-unix) - cat >> Config.tmp << '@END' - -#============= DEC Unix(OSF/1) 3.x, 4.x ========== -LDFLAGS = -shared -LIBS = -lc -@END - ;; - *) - cat << '@END' - - Usage: autoconfig or - build - - platform_opt: - - sun4 -- SunOS 4.1.x - aix -- IBM AIX 3.x, 4.x - hp300, hp400 -- HP/UX 9.x, 10.x on 9000 s300/s400 - hp700, hp800 -- HP/UX 9.x, 10.x on 9000 s700/s800 - solaris -- Sun Solaris 2.x, SunOS 5.x - ncr, gis -- NCR(GIS) SVR4 3.x - unixware -- Novell UnixWare 1.x, 2.x - maxos -- Concurrent MAX/OS SVR4 1.x - sco-osr5 -- SCO Open Server 5.x - dgux -- DG/UX 5.x - freebsd -- FreeBSD 2.x - bsd-os -- BSDI BSD/OS 2.x - linux-elf -- Linux ELF 1.2.x and up - irix5, irix6 -- SGI Irix 5.x, 6.x - dec-osf1 -- DEC Unix(OSF/1) 3.x, 4.x - -@END - \rm -f Config.tmp - \rm -f Makefile.tmp - exit 1 - ;; -esac - \mv -f Config.tmp Config.mk - sed -e 's/.include.*//' -e 's/include.*//' Makefile >> Makefile.tmp - \mv -f Makefile.tmp Makefile - exit 0 diff --git a/wxWidgets/src/iodbc/catalog.c b/wxWidgets/src/iodbc/catalog.c deleted file mode 100644 index e2a537e3bc..0000000000 --- a/wxWidgets/src/iodbc/catalog.c +++ /dev/null @@ -1,987 +0,0 @@ -/* - * catalog.c - * - * $Id: catalog.c 2613 1999-06-01 15:32:12Z VZ $ - * - * Catalog functions - * - * The iODBC driver manager. - * - * Copyright (C) 1995 by Ke Jin - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -#include "config.h" - -#include "isql.h" -#include "isqlext.h" - -#include "dlproc.h" - -#include "herr.h" -#include "henv.h" -#include "hdbc.h" -#include "hstmt.h" - -#include "itrace.h" - -#ifndef NULL -#define NULL 0 -#endif - -static RETCODE -_iodbcdm_cata_state_ok ( - HSTMT hstmt, - int fidx) -/* check state for executing catalog functions */ -{ - STMT_t FAR *pstmt = (STMT_t FAR *) hstmt; - int sqlstat = en_00000; - - if (pstmt->asyn_on == en_NullProc) - { - switch (pstmt->state) - { - case en_stmt_needdata: - case en_stmt_mustput: - case en_stmt_canput: - sqlstat = en_S1010; - break; - - case en_stmt_fetched: - case en_stmt_xfetched: - sqlstat = en_24000; - break; - - default: - break; - } - } - else if (pstmt->asyn_on != fidx) - { - sqlstat = en_S1010; - } - - if (sqlstat != en_00000) - { - PUSHSQLERR (pstmt->herr, sqlstat); - - return SQL_ERROR; - } - - return SQL_SUCCESS; -} - - -static RETCODE -_iodbcdm_cata_state_tr ( - HSTMT hstmt, - int fidx, - RETCODE result) -/* state transition for catalog function */ -{ - STMT_t FAR *pstmt = (STMT_t FAR *) hstmt; - DBC_t FAR *pdbc; - - pdbc = (DBC_t FAR *) (pstmt->hdbc); - - if (pstmt->asyn_on == fidx) - { - switch (result) - { - case SQL_SUCCESS: - case SQL_SUCCESS_WITH_INFO: - case SQL_ERROR: - pstmt->asyn_on = en_NullProc; - break; - - case SQL_STILL_EXECUTING: - default: - return result; - } - } - - if (pstmt->state <= en_stmt_executed) - { - switch (result) - { - case SQL_SUCCESS: - case SQL_SUCCESS_WITH_INFO: - pstmt->state = en_stmt_cursoropen; - break; - - case SQL_ERROR: - pstmt->state = en_stmt_allocated; - pstmt->prep_state = 0; - break; - - case SQL_STILL_EXECUTING: - pstmt->asyn_on = fidx; - break; - - default: - break; - } - } - - return result; -} - - -RETCODE SQL_API -SQLGetTypeInfo ( - HSTMT hstmt, - SWORD fSqlType) -{ - STMT_t FAR *pstmt = (STMT_t FAR *) hstmt; - HPROC hproc = SQL_NULL_HPROC; - int sqlstat = en_00000; - RETCODE retcode; - - if (hstmt == SQL_NULL_HSTMT || pstmt->hdbc == SQL_NULL_HDBC) - { - return SQL_INVALID_HANDLE; - } - - for (;;) - { - if (fSqlType > SQL_TYPE_MAX) - { - sqlstat = en_S1004; - break; - } - - /* Note: SQL_TYPE_DRIVER_START is a negative number So, we use ">" */ - if (fSqlType < SQL_TYPE_MIN && fSqlType > SQL_TYPE_DRIVER_START) - { - sqlstat = en_S1004; - break; - } - - retcode = _iodbcdm_cata_state_ok (hstmt, en_GetTypeInfo); - - if (retcode != SQL_SUCCESS) - { - return SQL_ERROR; - } - - hproc = _iodbcdm_getproc (pstmt->hdbc, en_GetTypeInfo); - - if (hproc == SQL_NULL_HPROC) - { - sqlstat = en_IM001; - break; - } - - sqlstat = en_00000; - if (1) /* turn off solaris warning message */ - break; - } - - if (sqlstat != en_00000) - { - PUSHSQLERR (pstmt->herr, sqlstat); - - return SQL_ERROR; - } - - CALL_DRIVER ( pstmt->hdbc, retcode, hproc, en_GetTypeInfo, - (pstmt->dhstmt, fSqlType)) - - return _iodbcdm_cata_state_tr (hstmt, en_GetTypeInfo, retcode); -} - - -RETCODE SQL_API -SQLSpecialColumns ( - HSTMT hstmt, - UWORD fColType, - UCHAR FAR * szTableQualifier, - SWORD cbTableQualifier, - UCHAR FAR * szTableOwner, - SWORD cbTableOwner, - UCHAR FAR * szTableName, - SWORD cbTableName, - UWORD fScope, - UWORD fNullable) -{ - STMT_t FAR *pstmt = (STMT_t FAR *) hstmt; - HPROC hproc = SQL_NULL_HPROC; - RETCODE retcode; - int sqlstat = en_00000; - - if (hstmt == SQL_NULL_HSTMT || pstmt->hdbc == SQL_NULL_HDBC) - { - return SQL_INVALID_HANDLE; - } - - for (;;) - { - if ((cbTableQualifier < 0 && cbTableQualifier != SQL_NTS) - || (cbTableOwner < 0 && cbTableOwner != SQL_NTS) - || (cbTableName < 0 && cbTableName != SQL_NTS)) - { - sqlstat = en_S1090; - break; - } - - if (fColType != SQL_BEST_ROWID && fColType != SQL_ROWVER) - { - sqlstat = en_S1097; - break; - } - - if (fScope != SQL_SCOPE_CURROW - && fScope != SQL_SCOPE_TRANSACTION - && fScope != SQL_SCOPE_SESSION) - { - sqlstat = en_S1098; - break; - } - - if (fNullable != SQL_NO_NULLS && fNullable != SQL_NULLABLE) - { - sqlstat = en_S1099; - break; - } - - retcode = _iodbcdm_cata_state_ok (hstmt, en_SpecialColumns); - - if (retcode != SQL_SUCCESS) - { - return SQL_ERROR; - } - - hproc = _iodbcdm_getproc (pstmt->hdbc, en_SpecialColumns); - - if (hproc == SQL_NULL_HPROC) - { - sqlstat = en_IM001; - break; - } - - sqlstat = en_00000; - if (1) /* turn off solaris warning message */ - break; - } - - if (sqlstat != en_00000) - { - PUSHSQLERR (pstmt->herr, sqlstat); - - return SQL_ERROR; - } - - CALL_DRIVER (pstmt->hdbc, retcode, hproc, en_SpecialColumns, ( - pstmt->dhstmt, - fColType, - szTableQualifier, - cbTableQualifier, - szTableOwner, - cbTableOwner, - szTableName, - cbTableName, - fScope, - fNullable)) - - return _iodbcdm_cata_state_tr (hstmt, en_SpecialColumns, retcode); -} - - -RETCODE SQL_API -SQLStatistics ( - HSTMT hstmt, - UCHAR FAR * szTableQualifier, - SWORD cbTableQualifier, - UCHAR FAR * szTableOwner, - SWORD cbTableOwner, - UCHAR FAR * szTableName, - SWORD cbTableName, - UWORD fUnique, - UWORD fAccuracy) -{ - STMT_t FAR *pstmt = (STMT_t FAR *) hstmt; - HPROC hproc = SQL_NULL_HPROC; - RETCODE retcode; - int sqlstat = en_00000; - - if (hstmt == SQL_NULL_HSTMT || pstmt->hdbc == SQL_NULL_HDBC) - { - return SQL_INVALID_HANDLE; - } - - for (;;) - { - if ((cbTableQualifier < 0 && cbTableQualifier != SQL_NTS) - || (cbTableOwner < 0 && cbTableOwner != SQL_NTS) - || (cbTableName < 0 && cbTableName != SQL_NTS)) - { - sqlstat = en_S1090; - break; - } - - if (fUnique != SQL_INDEX_UNIQUE && fUnique != SQL_INDEX_ALL) - { - sqlstat = en_S1100; - break; - } - - if (fAccuracy != SQL_ENSURE && fAccuracy != SQL_QUICK) - { - sqlstat = en_S1101; - break; - } - - retcode = _iodbcdm_cata_state_ok (hstmt, en_Statistics); - - if (retcode != SQL_SUCCESS) - { - return SQL_ERROR; - } - - hproc = _iodbcdm_getproc (pstmt->hdbc, en_Statistics); - - if (hproc == SQL_NULL_HPROC) - { - sqlstat = en_IM001; - break; - } - - sqlstat = en_00000; - - if (1) /* turn off solaris warning message */ - break; - } - - if (sqlstat != en_00000) - { - PUSHSQLERR (pstmt->herr, sqlstat); - - return SQL_ERROR; - } - - CALL_DRIVER (pstmt->hdbc, retcode, hproc, en_Statistics, ( - pstmt->dhstmt, - szTableQualifier, - cbTableQualifier, - szTableOwner, - cbTableOwner, - szTableName, - cbTableName, - fUnique, - fAccuracy)) - - return _iodbcdm_cata_state_tr (hstmt, en_Statistics, retcode); -} - - -RETCODE SQL_API -SQLTables ( - HSTMT hstmt, - UCHAR FAR * szTableQualifier, - SWORD cbTableQualifier, - UCHAR FAR * szTableOwner, - SWORD cbTableOwner, - UCHAR FAR * szTableName, - SWORD cbTableName, - UCHAR FAR * szTableType, - SWORD cbTableType) -{ - STMT_t FAR *pstmt = (STMT_t FAR *) hstmt; - HPROC hproc = SQL_NULL_HPROC; - RETCODE retcode; - int sqlstat = en_00000; - - if (hstmt == SQL_NULL_HSTMT || pstmt->hdbc == SQL_NULL_HDBC) - { - return SQL_INVALID_HANDLE; - } - - for (;;) - { - if ((cbTableQualifier < 0 && cbTableQualifier != SQL_NTS) - || (cbTableOwner < 0 && cbTableOwner != SQL_NTS) - || (cbTableName < 0 && cbTableName != SQL_NTS) - || (cbTableType < 0 && cbTableType != SQL_NTS)) - { - sqlstat = en_S1090; - break; - } - - retcode = _iodbcdm_cata_state_ok (hstmt, en_Tables); - - if (retcode != SQL_SUCCESS) - { - return SQL_ERROR; - } - - hproc = _iodbcdm_getproc (pstmt->hdbc, en_Tables); - - if (hproc == SQL_NULL_HPROC) - { - sqlstat = en_IM001; - break; - } - - sqlstat = en_00000; - - if (1) /* turn off solaris warning message */ - break; - } - - if (sqlstat != en_00000) - { - PUSHSQLERR (pstmt->herr, sqlstat); - - return SQL_ERROR; - } - - CALL_DRIVER (pstmt->hdbc, retcode, hproc, en_Tables, ( - pstmt->dhstmt, - szTableQualifier, - cbTableQualifier, - szTableOwner, - cbTableOwner, - szTableName, - cbTableName, - szTableType, - cbTableType)) - - return _iodbcdm_cata_state_tr (hstmt, en_Tables, retcode); -} - - -RETCODE SQL_API -SQLColumnPrivileges ( - HSTMT hstmt, - UCHAR FAR * szTableQualifier, - SWORD cbTableQualifier, - UCHAR FAR * szTableOwner, - SWORD cbTableOwner, - UCHAR FAR * szTableName, - SWORD cbTableName, - UCHAR FAR * szColumnName, - SWORD cbColumnName) -{ - STMT_t FAR *pstmt = (STMT_t FAR *) hstmt; - HPROC hproc = SQL_NULL_HPROC; - RETCODE retcode; - int sqlstat = en_00000; - - if (hstmt == SQL_NULL_HSTMT || pstmt->hdbc == SQL_NULL_HDBC) - { - return SQL_INVALID_HANDLE; - } - - for (;;) - { - if ((cbTableQualifier < 0 && cbTableQualifier != SQL_NTS) - || (cbTableOwner < 0 && cbTableOwner != SQL_NTS) - || (cbTableName < 0 && cbTableName != SQL_NTS) - || (cbColumnName < 0 && cbColumnName != SQL_NTS)) - { - sqlstat = en_S1090; - break; - } - - retcode = _iodbcdm_cata_state_ok (hstmt, en_ColumnPrivileges); - - if (retcode != SQL_SUCCESS) - { - return SQL_ERROR; - } - - hproc = _iodbcdm_getproc (pstmt->hdbc, en_ColumnPrivileges); - - if (hproc == SQL_NULL_HPROC) - { - sqlstat = en_IM001; - break; - } - - sqlstat = en_00000; - - if (1) /* turn off solaris warning message */ - break; - } - - if (sqlstat != en_00000) - { - PUSHSQLERR (pstmt->herr, sqlstat); - - return SQL_ERROR; - } - - CALL_DRIVER (pstmt->hdbc, retcode, hproc, en_ColumnPrivileges, ( - pstmt->dhstmt, - szTableQualifier, - cbTableQualifier, - szTableOwner, - cbTableOwner, - szTableName, - cbTableName, - szColumnName, - cbColumnName)) - - return _iodbcdm_cata_state_tr (hstmt, en_ColumnPrivileges, retcode); -} - - -RETCODE SQL_API -SQLColumns ( - HSTMT hstmt, - UCHAR FAR * szTableQualifier, - SWORD cbTableQualifier, - UCHAR FAR * szTableOwner, - SWORD cbTableOwner, - UCHAR FAR * szTableName, - SWORD cbTableName, - UCHAR FAR * szColumnName, - SWORD cbColumnName) -{ - STMT_t FAR *pstmt = (STMT_t FAR *) hstmt; - HPROC hproc = SQL_NULL_HPROC; - RETCODE retcode; - int sqlstat = en_00000; - - if (hstmt == SQL_NULL_HSTMT || pstmt->hdbc == SQL_NULL_HDBC) - { - return SQL_INVALID_HANDLE; - } - - for (;;) - { - if ((cbTableQualifier < 0 && cbTableQualifier != SQL_NTS) - || (cbTableOwner < 0 && cbTableOwner != SQL_NTS) - || (cbTableName < 0 && cbTableName != SQL_NTS) - || (cbColumnName < 0 && cbColumnName != SQL_NTS)) - { - sqlstat = en_S1090; - break; - } - - retcode = _iodbcdm_cata_state_ok (hstmt, en_Columns); - - if (retcode != SQL_SUCCESS) - { - return SQL_ERROR; - } - - hproc = _iodbcdm_getproc (pstmt->hdbc, en_Columns); - - if (hproc == SQL_NULL_HPROC) - { - sqlstat = en_IM001; - break; - } - - sqlstat = en_00000; - - if (1) /* turn off solaris warning message */ - break; - } - - if (sqlstat != en_00000) - { - PUSHSQLERR (pstmt->herr, sqlstat); - - return SQL_ERROR; - } - - CALL_DRIVER (pstmt->hdbc, retcode, hproc, en_Columns, ( - pstmt->dhstmt, - szTableQualifier, - cbTableQualifier, - szTableOwner, - cbTableOwner, - szTableName, - cbTableName, - szColumnName, - cbColumnName)) - - return _iodbcdm_cata_state_tr (hstmt, en_Columns, retcode); -} - - -RETCODE SQL_API -SQLForeignKeys ( - HSTMT hstmt, - UCHAR FAR * szPkTableQualifier, - SWORD cbPkTableQualifier, - UCHAR FAR * szPkTableOwner, - SWORD cbPkTableOwner, - UCHAR FAR * szPkTableName, - SWORD cbPkTableName, - UCHAR FAR * szFkTableQualifier, - SWORD cbFkTableQualifier, - UCHAR FAR * szFkTableOwner, - SWORD cbFkTableOwner, - UCHAR FAR * szFkTableName, - SWORD cbFkTableName) -{ - STMT_t FAR *pstmt = (STMT_t FAR *) hstmt; - HPROC hproc = SQL_NULL_HPROC; - RETCODE retcode; - int sqlstat = en_00000; - - if (hstmt == SQL_NULL_HSTMT || pstmt->hdbc == SQL_NULL_HDBC) - { - return SQL_INVALID_HANDLE; - } - - for (;;) - { - if ((cbPkTableQualifier < 0 && cbPkTableQualifier != SQL_NTS) - || (cbPkTableOwner < 0 && cbPkTableOwner != SQL_NTS) - || (cbPkTableName < 0 && cbPkTableName != SQL_NTS) - || (cbFkTableQualifier < 0 && cbFkTableQualifier != SQL_NTS) - || (cbFkTableOwner < 0 && cbFkTableOwner != SQL_NTS) - || (cbFkTableName < 0 && cbFkTableName != SQL_NTS)) - { - sqlstat = en_S1090; - break; - } - - retcode = _iodbcdm_cata_state_ok (hstmt, en_ForeignKeys); - - if (retcode != SQL_SUCCESS) - { - return SQL_ERROR; - } - - hproc = _iodbcdm_getproc (pstmt->hdbc, en_ForeignKeys); - - if (hproc == SQL_NULL_HPROC) - { - sqlstat = en_IM001; - break; - } - - sqlstat = en_00000; - - if (1) /* turn off solaris warning message */ - break; - } - - if (sqlstat != en_00000) - { - PUSHSQLERR (pstmt->herr, sqlstat); - - return SQL_ERROR; - } - - CALL_DRIVER (pstmt->hdbc, retcode, hproc, en_ForeignKeys, ( - pstmt->dhstmt, - szPkTableQualifier, - cbPkTableQualifier, - szPkTableOwner, - cbPkTableOwner, - szPkTableName, - cbPkTableName, - szFkTableQualifier, - cbFkTableQualifier, - szFkTableOwner, - cbFkTableOwner, - szFkTableName, - cbFkTableName)) - - return _iodbcdm_cata_state_tr (hstmt, en_ForeignKeys, retcode); -} - - -RETCODE SQL_API -SQLPrimaryKeys ( - HSTMT hstmt, - UCHAR FAR * szTableQualifier, - SWORD cbTableQualifier, - UCHAR FAR * szTableOwner, - SWORD cbTableOwner, - UCHAR FAR * szTableName, - SWORD cbTableName) -{ - STMT_t FAR *pstmt = (STMT_t FAR *) hstmt; - HPROC hproc = SQL_NULL_HPROC; - RETCODE retcode; - int sqlstat = en_00000; - - if (hstmt == SQL_NULL_HSTMT || pstmt->hdbc == SQL_NULL_HDBC) - { - return SQL_INVALID_HANDLE; - } - - for (;;) - { - if ((cbTableQualifier < 0 && cbTableQualifier != SQL_NTS) - || (cbTableOwner < 0 && cbTableOwner != SQL_NTS) - || (cbTableName < 0 && cbTableName != SQL_NTS)) - { - sqlstat = en_S1090; - break; - } - - retcode = _iodbcdm_cata_state_ok (hstmt, en_PrimaryKeys); - - if (retcode != SQL_SUCCESS) - { - return SQL_ERROR; - } - - hproc = _iodbcdm_getproc (pstmt->hdbc, en_PrimaryKeys); - - if (hproc == SQL_NULL_HPROC) - { - sqlstat = en_IM001; - break; - } - - sqlstat = en_00000; - - if (1) /* turn off solaris warning message */ - break; - } - - if (sqlstat != en_00000) - { - PUSHSQLERR (pstmt->herr, sqlstat); - - return SQL_ERROR; - } - - CALL_DRIVER (pstmt->hdbc, retcode, hproc, en_PrimaryKeys, ( - pstmt->dhstmt, - szTableQualifier, - cbTableQualifier, - szTableOwner, - cbTableOwner, - szTableName, - cbTableName)) - - return _iodbcdm_cata_state_tr (hstmt, en_PrimaryKeys, retcode); -} - - -RETCODE SQL_API -SQLProcedureColumns ( - HSTMT hstmt, - UCHAR FAR * szProcQualifier, - SWORD cbProcQualifier, - UCHAR FAR * szProcOwner, - SWORD cbProcOwner, - UCHAR FAR * szProcName, - SWORD cbProcName, - UCHAR FAR * szColumnName, - SWORD cbColumnName) -{ - STMT_t FAR *pstmt = (STMT_t FAR *) hstmt; - HPROC hproc = SQL_NULL_HPROC; - RETCODE retcode; - int sqlstat = en_00000; - - if (hstmt == SQL_NULL_HSTMT || pstmt->hdbc == SQL_NULL_HDBC) - { - return SQL_INVALID_HANDLE; - } - - for (;;) - { - if ((cbProcQualifier < 0 && cbProcQualifier != SQL_NTS) - || (cbProcOwner < 0 && cbProcOwner != SQL_NTS) - || (cbProcName < 0 && cbProcName != SQL_NTS) - || (cbColumnName < 0 && cbColumnName != SQL_NTS)) - { - sqlstat = en_S1090; - break; - } - - retcode = _iodbcdm_cata_state_ok (hstmt, en_ProcedureColumns); - - if (retcode != SQL_SUCCESS) - { - return SQL_ERROR; - } - - hproc = _iodbcdm_getproc (pstmt->hdbc, en_ProcedureColumns); - - if (hproc == SQL_NULL_HPROC) - { - sqlstat = en_IM001; - break; - } - - sqlstat = en_00000; - - if (1) /* turn off solaris warning message */ - break; - } - - if (sqlstat != en_00000) - { - PUSHSQLERR (pstmt->herr, sqlstat); - - return SQL_ERROR; - } - - CALL_DRIVER (pstmt->hdbc, retcode, hproc, en_ProcedureColumns, ( - pstmt->dhstmt, - szProcQualifier, - cbProcQualifier, - szProcOwner, - cbProcOwner, - szProcName, - cbProcName, - szColumnName, - cbColumnName)) - - return _iodbcdm_cata_state_tr (hstmt, en_ProcedureColumns, retcode); -} - - -RETCODE SQL_API -SQLProcedures ( - HSTMT hstmt, - UCHAR FAR * szProcQualifier, - SWORD cbProcQualifier, - UCHAR FAR * szProcOwner, - SWORD cbProcOwner, - UCHAR FAR * szProcName, - SWORD cbProcName) -{ - STMT_t FAR *pstmt = (STMT_t FAR *) hstmt; - HPROC hproc = SQL_NULL_HPROC; - RETCODE retcode; - int sqlstat = en_00000; - - if (hstmt == SQL_NULL_HSTMT || pstmt->hdbc == SQL_NULL_HDBC) - { - return SQL_INVALID_HANDLE; - } - - for (;;) - { - if ((cbProcQualifier < 0 && cbProcQualifier != SQL_NTS) - || (cbProcOwner < 0 && cbProcOwner != SQL_NTS) - || (cbProcName < 0 && cbProcName != SQL_NTS)) - { - sqlstat = en_S1090; - break; - } - - retcode = _iodbcdm_cata_state_ok (hstmt, en_Procedures); - - if (retcode != SQL_SUCCESS) - { - return SQL_ERROR; - } - - hproc = _iodbcdm_getproc (pstmt->hdbc, en_Procedures); - - if (hproc == SQL_NULL_HPROC) - { - sqlstat = en_IM001; - break; - } - - sqlstat = en_00000; - - if (1) /* turn off solaris warning message */ - break; - } - - if (sqlstat != en_00000) - { - PUSHSQLERR (pstmt->herr, sqlstat); - - return SQL_ERROR; - } - - CALL_DRIVER (pstmt->hdbc, retcode, hproc, en_Procedures, ( - pstmt->dhstmt, - szProcQualifier, - cbProcQualifier, - szProcOwner, - cbProcOwner, - szProcName, - cbProcName)) - - return _iodbcdm_cata_state_tr (hstmt, en_Procedures, retcode); -} - - -RETCODE SQL_API -SQLTablePrivileges ( - HSTMT hstmt, - UCHAR FAR * szTableQualifier, - SWORD cbTableQualifier, - UCHAR FAR * szTableOwner, - SWORD cbTableOwner, - UCHAR FAR * szTableName, - SWORD cbTableName) -{ - - STMT_t FAR *pstmt = (STMT_t FAR *) hstmt; - HPROC hproc = SQL_NULL_HPROC; - RETCODE retcode; - int sqlstat = en_00000; - - if (hstmt == SQL_NULL_HSTMT || pstmt->hdbc == SQL_NULL_HDBC) - { - return SQL_INVALID_HANDLE; - } - - for (;;) - { - if ((cbTableQualifier < 0 && cbTableQualifier != SQL_NTS) - || (cbTableOwner < 0 && cbTableOwner != SQL_NTS) - || (cbTableName < 0 && cbTableName != SQL_NTS)) - { - sqlstat = en_S1090; - break; - } - - retcode = _iodbcdm_cata_state_ok (hstmt, en_TablePrivileges); - - if (retcode != SQL_SUCCESS) - { - return SQL_ERROR; - } - - hproc = _iodbcdm_getproc (pstmt->hdbc, en_TablePrivileges); - - if (hproc == SQL_NULL_HPROC) - { - sqlstat = en_IM001; - break; - } - - sqlstat = en_00000; - - if (1) /* turn off solaris warning message */ - break; - } - - if (sqlstat != en_00000) - { - PUSHSQLERR (pstmt->herr, sqlstat); - - return SQL_ERROR; - } - - CALL_DRIVER (pstmt->hdbc, retcode, hproc, en_TablePrivileges, - (pstmt->dhstmt, szTableQualifier, cbTableQualifier, szTableOwner, - cbTableOwner, szTableName, cbTableName)) - - return _iodbcdm_cata_state_tr (hstmt, en_TablePrivileges, retcode); -} diff --git a/wxWidgets/src/iodbc/config.h b/wxWidgets/src/iodbc/config.h deleted file mode 100644 index dcd7a0e110..0000000000 --- a/wxWidgets/src/iodbc/config.h +++ /dev/null @@ -1,100 +0,0 @@ -/* - * - * config.h - * - * $Id: config.h 3995 1999-10-14 17:08:31Z RR $ - * - * Configuration - * - * The iODBC driver manager. - * - * Copyright (C) 1995 by Ke Jin - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ -#ifndef _CONFIG_H -#define _CONFIG_H - -#if !defined(WINDOWS) && !defined(WIN32_SYSTEM) -#define _UNIX_ - -#include "wx/setup.h" - -/* we have these definitions from configure */ -#if defined(HAVE_DLOPEN) - #define DLDAPI_SVR4_DLFCN -#elif defined(HAVE_SHL_LOAD) - #define DLDAPI_HP_SHL -#endif - -#include -#include -#include -#include - -#define MEM_ALLOC(size) (malloc((size_t)(size))) -#define MEM_FREE(ptr) {if(ptr) free(ptr);} - -#define STRCPY(t, s) (strcpy((char*)(t), (char*)(s))) -#define STRNCPY(t,s,n) (strncpy((char*)(t), (char*)(s), (size_t)(n))) -#define STRCAT(t, s) (strcat((char*)(t), (char*)(s))) -#define STRNCAT(t,s,n) (strncat((char*)(t), (char*)(s), (size_t)(n))) -#define STREQ(a, b) (strcmp((char*)(a), (char*)(b)) == 0) -#define STRLEN(str) ((str)? strlen((char*)(str)):0) - -#define EXPORT -#define CALLBACK -#define FAR - -typedef signed short SSHOR; -typedef short WORD; -typedef long DWORD; - -typedef WORD WPARAM; -typedef DWORD LPARAM; -typedef int BOOL; -#endif /* _UNIX_ */ - -#if defined(WINDOWS) || defined(WIN32_SYSTEM) -#include -#include - -#ifdef _MSVC_ -#define MEM_ALLOC(size) (fmalloc((size_t)(size))) -#define MEM_FREE(ptr) ((ptr)? ffree((PTR)(ptr)):0)) -#define STRCPY(t, s) (fstrcpy((char FAR*)(t), (char FAR*)(s))) -#define STRNCPY(t,s,n) (fstrncpy((char FAR*)(t), (char FAR*)(s), (size_t)(n))) -#define STRLEN(str) ((str)? fstrlen((char FAR*)(str)):0) -#define STREQ(a, b) (fstrcmp((char FAR*)(a), (char FAR*)(b) == 0) -#endif - -#ifdef _BORLAND_ -#define MEM_ALLOC(size) (farmalloc((unsigned long)(size)) -#define MEM_FREE(ptr) ((ptr)? farfree((void far*)(ptr)):0) -#define STRCPY(t, s) (_fstrcpy((char FAR*)(t), (char FAR*)(s))) -#define STRNCPY(t,s,n) (_fstrncpy((char FAR*)(t), (char FAR*)(s), (size_t)(n))) -#define STRLEN(str) ((str)? _fstrlen((char FAR*)(str)):0) -#define STREQ(a, b) (_fstrcmp((char FAR*)(a), (char FAR*)(b) == 0) -#endif - -#endif /* WINDOWS */ - -#define SYSERR (-1) - -#ifndef NULL -#define NULL ((void FAR*)0UL) -#endif - -#endif diff --git a/wxWidgets/src/iodbc/connect.c b/wxWidgets/src/iodbc/connect.c deleted file mode 100644 index d939ef96d9..0000000000 --- a/wxWidgets/src/iodbc/connect.c +++ /dev/null @@ -1,1241 +0,0 @@ -/* - * connect.c - * - * $Id: connect.c 5545 2000-01-20 13:19:20Z GT $ - * - * Connect (load) driver - * - * The iODBC driver manager. - * - * Copyright (C) 1995 by Ke Jin - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -#include "config.h" - -#include "isql.h" -#include "isqlext.h" - -#include "dlproc.h" - -#include "herr.h" -#include "henv.h" -#include "hdbc.h" -#include "hstmt.h" - -#include "itrace.h" - -extern char* _iodbcdm_getkeyvalbydsn(); -extern char* _iodbcdm_getkeyvalinstr(); -extern RETCODE _iodbcdm_driverunload(); - -/* - * Following id string is a copyright mark. Removing(i.e. use - * souce code of this package without it or make it not appear - * in the final object file) or modifing it without permission - * from original author(kejin@empress.com) are copyright - * violation. - */ -static char sccsid[] - = "@(#)iODBC driver manager 2.5, Copyright(c) 1995 by Ke Jin"; - -/* - Load driver share library( or increase its reference count - * if it has already been loaded by another active connection) - * - Call driver's SQLAllocEnv() (for the first reference only) - * - Call driver's SQLAllocConnect() - * - Call driver's SQLSetConnectOption() (set login time out) - * - Increase the bookkeeping reference count - */ -static RETCODE -_iodbcdm_driverload ( - char FAR * path, - HDBC hdbc) -{ - DBC_t FAR *pdbc = (DBC_t FAR *) hdbc; - GENV_t FAR *genv; - ENV_t FAR *penv = NULL; - HDLL hdll; - HPROC hproc; - RETCODE retcode = SQL_SUCCESS; - int sqlstat = en_00000; - - if (path == NULL || path[0] == '\0') - { - PUSHSQLERR (pdbc->herr, en_IM002); - - return SQL_ERROR; - } - - if (hdbc == SQL_NULL_HDBC || pdbc->genv == SQL_NULL_HENV) - { - return SQL_INVALID_HANDLE; - } - - genv = (GENV_t FAR *) pdbc->genv; - - /* This will either load the driver dll or increase its reference count */ - hdll = _iodbcdm_dllopen ((char FAR *) path); - - if (hdll == SQL_NULL_HDLL) - { - PUSHSYSERR (pdbc->herr, _iodbcdm_dllerror ()); - PUSHSQLERR (pdbc->herr, en_IM003); - return SQL_ERROR; - } - - penv = (ENV_t FAR *) (pdbc->henv); - - if (penv != NULL) - { - if (penv->hdll != hdll) - { - _iodbcdm_driverunload (hdbc); - } - else - { - /* - * this will not unload the driver but only decrease its internal - * reference count - */ - _iodbcdm_dllclose (hdll); - } - } - - if (penv == NULL) - { - /* - * find out whether this dll has already been loaded on another - * connection - */ - for (penv = (ENV_t FAR *) genv->henv; - penv != NULL; - penv = (ENV_t FAR *) penv->next) - { - if (penv->hdll == hdll) - { - /* - * this will not unload the driver but only decrease its internal - * reference count - */ - _iodbcdm_dllclose (hdll); - break; - } - } - - if (penv == NULL) - /* no connection attaching with this dll */ - { - int i; - - /* create a new dll env instance */ - penv = (ENV_t FAR *) MEM_ALLOC (sizeof (ENV_t)); - - if (penv == NULL) - { - _iodbcdm_dllclose (hdll); - - PUSHSQLERR (pdbc->herr, en_S1001); - - return SQL_ERROR; - } - - for (i = 0; i < SQL_EXT_API_LAST + 1; i++) - { - (penv->dllproc_tab)[i] = SQL_NULL_HPROC; - } - - pdbc->henv = penv; - penv->hdll = hdll; - - /* call driver's SQLAllocHandle() or SQLAllocEnv() */ - -#if (ODBCVER >= 0x0300) - hproc = _iodbcdm_getproc (hdbc, en_AllocHandle); - - if (hproc) - { - CALL_DRIVER (hdbc, retcode, hproc, en_AllocHandle, - (SQL_HANDLE_ENV, SQL_NULL_HANDLE, &(penv->dhenv))) - } - else /* try driver's SQLAllocEnv() */ -#endif - { - hproc = _iodbcdm_getproc (hdbc, en_AllocEnv); - - if (hproc == SQL_NULL_HPROC) - { - sqlstat = en_IM004; - } - else - { - CALL_DRIVER (hdbc, retcode, hproc, - en_AllocEnv, (&(penv->dhenv))) - } - } - - if (retcode == SQL_ERROR) - { - sqlstat = en_IM004; - } - - if (sqlstat != en_00000) - { - _iodbcdm_dllclose (hdll); - MEM_FREE (penv); - PUSHSQLERR (pdbc->herr, en_IM004); - - return SQL_ERROR; - } - - /* insert into dll env list */ - penv->next = (ENV_t FAR *) genv->henv; - genv->henv = penv; - - /* initiate this new env entry */ - penv->refcount = 0; /* we will increase it after - * driver's SQLAllocConnect() - * success - */ - } - - pdbc->henv = penv; - - if (pdbc->dhdbc == SQL_NULL_HDBC) - { - -#if (ODBCVER >= 0x0300) - hproc = _iodbcdm_getproc (hdbc, en_AllocHandle); - - if (hproc) - { - CALL_DRIVER (hdbc, retcode, hproc, en_AllocHandle, - (SQL_HANDLE_DBC, penv->dhenv, &(pdbc->dhdbc))) - } - else -#endif - - { - hproc = _iodbcdm_getproc (hdbc, en_AllocConnect); - - if (hproc == SQL_NULL_HPROC) - { - sqlstat = en_IM005; - } - else - { - CALL_DRIVER (hdbc, retcode, hproc, - en_AllocConnect, (penv->dhenv, &(pdbc->dhdbc))) - } - } - - if (retcode == SQL_ERROR) - { - sqlstat = en_IM005; - } - - if (sqlstat != en_00000) - { - _iodbcdm_driverunload (hdbc); - - pdbc->dhdbc = SQL_NULL_HDBC; - PUSHSQLERR (pdbc->herr, en_IM005); - - return SQL_ERROR; - } - } - - pdbc->henv = penv; - penv->refcount++; /* bookkeeping reference count on this driver */ - } - - /* driver's login timeout option must been set before - * its SQLConnect() call */ - if (pdbc->login_timeout != 0UL) - { - hproc = _iodbcdm_getproc (hdbc, en_SetConnectOption); - - if (hproc == SQL_NULL_HPROC) - { - sqlstat = en_IM004; - } - else - { - CALL_DRIVER (hdbc, retcode, hproc, - en_SetConnectOption, ( - pdbc->dhdbc, - SQL_LOGIN_TIMEOUT, - pdbc->login_timeout)) - - if (retcode == SQL_ERROR) - { - PUSHSQLERR (pdbc->herr, en_IM006); - - return SQL_SUCCESS_WITH_INFO; - } - } - } - - return SQL_SUCCESS; -} - - -/* - Call driver's SQLFreeConnect() - * - Call driver's SQLFreeEnv() ( for the last reference only) - * - Unload the share library( or decrease its reference - * count if it is not the last referenct ) - * - decrease bookkeeping reference count - * - state transition to allocated - */ -RETCODE -_iodbcdm_driverunload (HDBC hdbc) -{ - DBC_t FAR *pdbc = (DBC_t FAR *) hdbc; - ENV_t FAR *penv; - ENV_t FAR *tpenv; - GENV_t FAR *genv; - HPROC hproc; - RETCODE retcode = SQL_SUCCESS; - - if (hdbc == SQL_NULL_HDBC) - { - return SQL_INVALID_HANDLE; - } - - /* no pointer check will be performed in this function */ - penv = (ENV_t FAR *) pdbc->henv; - genv = (GENV_t FAR *) pdbc->genv; - - if (penv == NULL || penv->hdll == SQL_NULL_HDLL) - { - return SQL_SUCCESS; - } - -#if (ODBCVER >= 0x0300) - hproc = _iodbcdm_getproc (hdbc, en_FreeHandle); - - if (hproc) - { - CALL_DRIVER (hdbc, retcode, hproc, en_FreeHandle, - (SQL_HANDLE_DBC, pdbc->dhdbc)) - } - else -#endif - - { - hproc = _iodbcdm_getproc (hdbc, en_FreeConnect); - - if (hproc != SQL_NULL_HPROC) - { - CALL_DRIVER (hdbc, retcode, hproc, - en_FreeConnect, (pdbc->dhdbc)) - - pdbc->dhdbc = SQL_NULL_HDBC; - } - } - - penv->refcount--; - - if (!penv->refcount) - /* no other connections still attaching with this driver */ - { - -#if (ODBCVER >= 0x0300) - hproc = _iodbcdm_getproc (hdbc, en_FreeHandle); - - if (hproc) - { - CALL_DRIVER (hdbc, retcode, hproc, en_FreeHandle, - (SQL_HANDLE_ENV, penv->dhenv)) - } - else -#endif - - { - hproc = _iodbcdm_getproc (hdbc, en_FreeEnv); - - if (hproc != SQL_NULL_HPROC) - { - CALL_DRIVER (hdbc, retcode, hproc, en_FreeEnv, - (penv->dhenv)) - - penv->dhenv = SQL_NULL_HENV; - } - } - - _iodbcdm_dllclose (penv->hdll); - - penv->hdll = SQL_NULL_HDLL; - - for (tpenv = (ENV_t FAR *) genv->henv; - tpenv != NULL; - tpenv = (ENV_t FAR *) penv->next) - { - if (tpenv == penv) - { - genv->henv = penv->next; - break; - } - - if (tpenv->next == penv) - { - tpenv->next = penv->next; - break; - } - } - - MEM_FREE (penv); - } - - pdbc->henv = SQL_NULL_HENV; - pdbc->hstmt = SQL_NULL_HSTMT; - /* pdbc->herr = SQL_NULL_HERR; - -- delay to DM's SQLFreeConnect() */ - pdbc->dhdbc = SQL_NULL_HDBC; - pdbc->state = en_dbc_allocated; - - /* set connect options to default values */ - /********** - pdbc->access_mode = SQL_MODE_DEFAULT; - pdbc->autocommit = SQL_AUTOCOMMIT_DEFAULT; - pdbc->login_timeout = 0UL; - **********/ - pdbc->odbc_cursors = SQL_CUR_DEFAULT; - pdbc->packet_size = 0UL; - pdbc->quiet_mode = (UDWORD) NULL; - pdbc->txn_isolation = SQL_TXN_READ_UNCOMMITTED; - - if (pdbc->current_qualifier != NULL) - { - MEM_FREE (pdbc->current_qualifier); - pdbc->current_qualifier = NULL; - } - - return SQL_SUCCESS; -} - - -static RETCODE -_iodbcdm_dbcdelayset (HDBC hdbc) -{ - DBC_t FAR *pdbc = (DBC_t FAR *) hdbc; - ENV_t FAR *penv; - HPROC hproc; - RETCODE retcode = SQL_SUCCESS; - RETCODE ret; - - penv = pdbc->henv; - - hproc = _iodbcdm_getproc (hdbc, en_SetConnectOption); - - if (hproc == SQL_NULL_HPROC) - { - PUSHSQLERR (pdbc->herr, en_IM006); - - return SQL_SUCCESS_WITH_INFO; - } - - if (pdbc->access_mode != SQL_MODE_DEFAULT) - { - CALL_DRIVER (hdbc, ret, hproc, - en_SetConnectOption, ( - SQL_ACCESS_MODE, - pdbc->access_mode)) - - retcode |= ret; - } - - if (pdbc->autocommit != SQL_AUTOCOMMIT_DEFAULT) - { - CALL_DRIVER (hdbc, ret, hproc, - en_SetConnectOption, ( - pdbc->dhdbc, - SQL_AUTOCOMMIT, - pdbc->autocommit)) - - retcode |= ret; - } - - if (pdbc->current_qualifier != NULL) - { - CALL_DRIVER (hdbc, ret, hproc, - en_SetConnectOption, ( - pdbc->dhdbc, - SQL_CURRENT_QUALIFIER, - pdbc->current_qualifier)) - - retcode |= ret; - } - - if (pdbc->packet_size != 0UL) - { - CALL_DRIVER (hdbc, ret, hproc, - en_SetConnectOption, ( - pdbc->dhdbc, - SQL_PACKET_SIZE, - pdbc->packet_size)) - - retcode |= ret; - } - - if (pdbc->quiet_mode != (UDWORD) NULL) - { - CALL_DRIVER (hdbc, ret, hproc, - en_SetConnectOption, ( - pdbc->dhdbc, - SQL_QUIET_MODE, - pdbc->quiet_mode)) - - retcode |= ret; - } - - if (pdbc->txn_isolation != SQL_TXN_READ_UNCOMMITTED) - { - CALL_DRIVER (hdbc, ret, hproc, - en_SetConnectOption, ( - pdbc->dhdbc, - SQL_TXN_ISOLATION, - pdbc->txn_isolation)) - } - - /* check error code for driver's SQLSetConnectOption() call */ - if (retcode != SQL_SUCCESS && retcode != SQL_SUCCESS_WITH_INFO) - { - PUSHSQLERR (pdbc->herr, en_IM006); - - retcode = SQL_ERROR; - } - - /* get cursor behavior on transaction commit or rollback */ - hproc = _iodbcdm_getproc (hdbc, en_GetInfo); - - if (hproc == SQL_NULL_HPROC) - { - PUSHSQLERR (pdbc->herr, en_01000); - - return retcode; - } - - CALL_DRIVER (hdbc, ret, hproc, - en_GetInfo, ( - pdbc->dhdbc, - SQL_CURSOR_COMMIT_BEHAVIOR, - (PTR) & (pdbc->cb_commit), - sizeof (pdbc->cb_commit), - NULL)) - - retcode |= ret; - - CALL_DRIVER (hdbc, ret, hproc, - en_GetInfo, ( - pdbc->dhdbc, - SQL_CURSOR_ROLLBACK_BEHAVIOR, - (PTR) & (pdbc->cb_rollback), - sizeof (pdbc->cb_rollback), - NULL)) - - retcode |= ret; - - if (retcode != SQL_SUCCESS - && retcode != SQL_SUCCESS_WITH_INFO) - { - return SQL_ERROR; - } - - return retcode; -} - - -static RETCODE -_iodbcdm_settracing (HDBC hdbc, char *dsn, int dsnlen) -{ - char buf[256]; - char *ptr; - RETCODE setopterr = SQL_SUCCESS; - - /* Get Driver's DLL path from specificed or default dsn section */ - ptr = _iodbcdm_getkeyvalbydsn (dsn, dsnlen, "TraceFile", - (char FAR *) buf, sizeof (buf)); - - if (ptr == NULL || ptr[0] == '\0') - { - ptr = (char FAR *) (SQL_OPT_TRACE_FILE_DEFAULT); - } - - setopterr |= SQLSetConnectOption (hdbc, SQL_OPT_TRACEFILE, (UDWORD) (ptr)); - - ptr = _iodbcdm_getkeyvalbydsn (dsn, dsnlen, "Trace", - (char FAR *) buf, sizeof (buf)); - - if (ptr != NULL) - { - UDWORD opt = (UDWORD) (-1L); - - if (STREQ (ptr, "ON") - || STREQ (ptr, "On") - || STREQ (ptr, "on") - || STREQ (ptr, "1")) - { - opt = SQL_OPT_TRACE_ON; - } - - if (STREQ (ptr, "OFF") - || STREQ (ptr, "Off") - || STREQ (ptr, "off") - || STREQ (ptr, "0")) - { - opt = SQL_OPT_TRACE_OFF; - } - - if (opt != (UDWORD) (-1L)) - { - setopterr |= SQLSetConnectOption (hdbc, - SQL_OPT_TRACE, opt); - } - } - - return setopterr; -} - - -RETCODE SQL_API -SQLConnect ( - HDBC hdbc, - UCHAR FAR * szDSN, - SWORD cbDSN, - UCHAR FAR * szUID, - SWORD cbUID, - UCHAR FAR * szAuthStr, - SWORD cbAuthStr) -{ - DBC_t FAR *pdbc = (DBC_t FAR *) hdbc; - RETCODE retcode = SQL_SUCCESS; - RETCODE setopterr = SQL_SUCCESS; - char driver[1024] = {'\0'}; /* MS SDK Guide - * specifies driver - * path can't longer - * than 255. */ - char *ptr; - HPROC hproc; - - if (hdbc == SQL_NULL_HDBC) - { - return SQL_INVALID_HANDLE; - } - - /* check arguments */ - if ((cbDSN < 0 && cbDSN != SQL_NTS) - || (cbUID < 0 && cbUID != SQL_NTS) - || (cbAuthStr < 0 && cbAuthStr != SQL_NTS) - || (cbDSN > SQL_MAX_DSN_LENGTH)) - { - PUSHSQLERR (pdbc->herr, en_S1090); - - return SQL_ERROR; - } - - if (szDSN == NULL || cbDSN == 0) - { - PUSHSQLERR (pdbc->herr, en_IM002); - - return SQL_ERROR; - } - - /* check state */ - if (pdbc->state != en_dbc_allocated) - { - PUSHSQLERR (pdbc->herr, en_08002); - - return SQL_ERROR; - } - - setopterr |= _iodbcdm_settracing (hdbc, - (char *) szDSN, cbDSN); - - ptr = _iodbcdm_getkeyvalbydsn (szDSN, cbDSN, "Driver", - (char FAR *) driver, sizeof (driver)); - - if (ptr == NULL) - /* No specified or default dsn section or - * no driver specification in this dsn section */ - { - PUSHSQLERR (pdbc->herr, en_IM002); - - return SQL_ERROR; - } - - retcode = _iodbcdm_driverload (driver, hdbc); - - switch (retcode) - { - case SQL_SUCCESS: - break; - - case SQL_SUCCESS_WITH_INFO: - setopterr = SQL_ERROR; - /* unsuccessed in calling driver's - * SQLSetConnectOption() to set login - * timeout. - */ - break; - - default: - return retcode; - } - - hproc = _iodbcdm_getproc (hdbc, en_Connect); - - if (hproc == SQL_NULL_HPROC) - { - _iodbcdm_driverunload (hdbc); - - PUSHSQLERR (pdbc->herr, en_IM001); - - return SQL_ERROR; - } - - CALL_DRIVER (hdbc, retcode, hproc, en_Connect, ( - pdbc->dhdbc, - szDSN, cbDSN, - szUID, cbUID, - szAuthStr, cbAuthStr)) - - if (retcode != SQL_SUCCESS - && retcode != SQL_SUCCESS_WITH_INFO) - { - /* not unload driver for retrive error - * messge from driver */ - /********* - _iodbcdm_driverunload( hdbc ); - **********/ - - return retcode; - } - - /* state transition */ - pdbc->state = en_dbc_connected; - - /* do delaid option setting */ - setopterr |= _iodbcdm_dbcdelayset (hdbc); - - if (setopterr != SQL_SUCCESS) - { - return SQL_SUCCESS_WITH_INFO; - } - - return retcode; -} - - -RETCODE SQL_API -SQLDriverConnect ( - HDBC hdbc, - SQLHWND hwnd, - UCHAR FAR * szConnStrIn, - SWORD cbConnStrIn, - UCHAR FAR * szConnStrOut, - SWORD cbConnStrOutMax, - SWORD FAR * pcbConnStrOut, - UWORD fDriverCompletion) -{ - DBC_t FAR *pdbc = (DBC_t FAR *) hdbc; - HDLL hdll; - char FAR *drv; - char drvbuf[1024]; - char FAR *dsn; - char dsnbuf[SQL_MAX_DSN_LENGTH + 1]; - UCHAR cnstr2drv[1024]; - - HPROC hproc; - HPROC dialproc; - - int sqlstat = en_00000; - RETCODE retcode = SQL_SUCCESS; - RETCODE setopterr = SQL_SUCCESS; - - if (hdbc == SQL_NULL_HDBC) - { - return SQL_INVALID_HANDLE; - } - - /* check arguments */ - if ((cbConnStrIn < 0 && cbConnStrIn != SQL_NTS) - || cbConnStrOutMax < 0) - { - PUSHSQLERR (pdbc->herr, en_S1090); - - return SQL_ERROR; - } - - /* check state */ - if (pdbc->state != en_dbc_allocated) - { - PUSHSQLERR (pdbc->herr, en_08002); - - return SQL_ERROR; - } - - drv = _iodbcdm_getkeyvalinstr (szConnStrIn, cbConnStrIn, - "DRIVER", drvbuf, sizeof (drvbuf)); - - dsn = _iodbcdm_getkeyvalinstr (szConnStrIn, cbConnStrIn, - "DSN", dsnbuf, sizeof (dsnbuf)); - - switch (fDriverCompletion) - { - case SQL_DRIVER_NOPROMPT: - break; - - case SQL_DRIVER_COMPLETE: - case SQL_DRIVER_COMPLETE_REQUIRED: - if (dsn != NULL || drv != NULL) - { - break; - } - /* fall to next case */ - case SQL_DRIVER_PROMPT: - /* Get data source dialog box function from - * current executable */ - hdll = _iodbcdm_dllopen ((char FAR *) NULL); - dialproc = _iodbcdm_dllproc (hdll, - "_iodbcdm_drvconn_dialbox"); - - if (dialproc == SQL_NULL_HPROC) - { - sqlstat = en_IM008; - break; - } - - retcode = dialproc ( - hwnd, /* window or display handle */ - dsnbuf, /* input/output dsn buf */ - sizeof (dsnbuf), /* buf size */ - &sqlstat); /* error code */ - - if (retcode != SQL_SUCCESS) - { - break; - } - - if (cbConnStrIn == SQL_NTS) - { - cbConnStrIn = STRLEN (szConnStrIn); - } - - dsn = dsnbuf; - - if (dsn[0] == '\0') - { - dsn = "default"; - } - - if (cbConnStrIn > sizeof (cnstr2drv) - - STRLEN (dsn) - STRLEN ("DSN=;") - 1) - { - sqlstat = en_S1001; /* a lazy way to avoid - * using heap memory */ - break; - } - - sprintf ((char*)cnstr2drv, "DSN=%s;", dsn); - cbConnStrIn += STRLEN (cnstr2drv); - STRNCAT (cnstr2drv, szConnStrIn, cbConnStrIn); - szConnStrIn = cnstr2drv; - break; - - default: - sqlstat = en_S1110; - break; - } - - if (sqlstat != en_00000) - { - PUSHSQLERR (pdbc->herr, sqlstat); - - return SQL_ERROR; - } - - if (dsn == NULL || dsn[0] == '\0') - { - dsn = "default"; - } - else - /* if you want tracing, you must use a DSN */ - { - setopterr |= _iodbcdm_settracing (hdbc, - (char *) dsn, SQL_NTS); - } - - if (drv == NULL || drv[0] == '\0') - { - drv = _iodbcdm_getkeyvalbydsn (dsn, SQL_NTS, "Driver", - drvbuf, sizeof (drvbuf)); - } - - if (drv == NULL) - { - PUSHSQLERR (pdbc->herr, en_IM002); - - return SQL_ERROR; - } - - retcode = _iodbcdm_driverload (drv, hdbc); - - switch (retcode) - { - case SQL_SUCCESS: - break; - - case SQL_SUCCESS_WITH_INFO: - setopterr = SQL_ERROR; - /* unsuccessed in calling driver's - * SQLSetConnectOption() to set login - * timeout. - */ - break; - - default: - return retcode; - } - - hproc = _iodbcdm_getproc (hdbc, en_DriverConnect); - - if (hproc == SQL_NULL_HPROC) - { - _iodbcdm_driverunload (hdbc); - - PUSHSQLERR (pdbc->herr, en_IM001); - - return SQL_ERROR; - } - - CALL_DRIVER (hdbc, retcode, hproc, en_DriverConnect, ( - pdbc->dhdbc, hwnd, - szConnStrIn, cbConnStrIn, - szConnStrOut, cbConnStrOutMax, - pcbConnStrOut, fDriverCompletion)) - - if (retcode != SQL_SUCCESS && retcode != SQL_SUCCESS_WITH_INFO) - { - /* don't unload driver here for retrive - * error message from driver */ - /******** - _iodbcdm_driverunload( hdbc ); - *********/ - - return retcode; - } - - /* state transition */ - pdbc->state = en_dbc_connected; - - /* do delaid option setting */ - setopterr |= _iodbcdm_dbcdelayset (hdbc); - - if (setopterr != SQL_SUCCESS) - { - return SQL_SUCCESS_WITH_INFO; - } - - return retcode; -} - - -RETCODE SQL_API -SQLBrowseConnect ( - HDBC hdbc, - UCHAR FAR * szConnStrIn, - SWORD cbConnStrIn, - UCHAR FAR * szConnStrOut, - SWORD cbConnStrOutMax, - SWORD FAR * pcbConnStrOut) -{ - DBC_t FAR *pdbc = (DBC_t FAR *) hdbc; - char FAR *drv; - char drvbuf[1024]; - char FAR *dsn; - char dsnbuf[SQL_MAX_DSN_LENGTH + 1]; - - HPROC hproc; - - RETCODE retcode = SQL_SUCCESS; - RETCODE setopterr = SQL_SUCCESS; - - if (hdbc == SQL_NULL_HDBC) - { - return SQL_INVALID_HANDLE; - } - - /* check arguments */ - if ((cbConnStrIn < 0 && cbConnStrIn != SQL_NTS) || cbConnStrOutMax < 0) - { - PUSHSQLERR (pdbc->herr, en_S1090); - - return SQL_ERROR; - } - - if (pdbc->state == en_dbc_allocated) - { - drv = _iodbcdm_getkeyvalinstr (szConnStrIn, cbConnStrIn, - "DRIVER", drvbuf, sizeof (drvbuf)); - - dsn = _iodbcdm_getkeyvalinstr (szConnStrIn, cbConnStrIn, - "DSN", dsnbuf, sizeof (dsnbuf)); - - if (dsn == NULL || dsn[0] == '\0') - { - dsn = "default"; - } - else - /* if you want tracing, you must use a DSN */ - { - setopterr |= _iodbcdm_settracing (hdbc, - (char *) dsn, SQL_NTS); - } - - if (drv == NULL || drv[0] == '\0') - { - drv = _iodbcdm_getkeyvalbydsn (dsn, SQL_NTS, "Driver", - drvbuf, sizeof (drvbuf)); - } - - if (drv == NULL) - { - PUSHSQLERR (pdbc->herr, en_IM002); - - return SQL_ERROR; - } - - retcode = _iodbcdm_driverload (drv, hdbc); - - switch (retcode) - { - case SQL_SUCCESS: - break; - - case SQL_SUCCESS_WITH_INFO: - setopterr = SQL_ERROR; - /* unsuccessed in calling driver's - * SQLSetConnectOption() to set login - * timeout. - */ - break; - - default: - return retcode; - } - } - else if (pdbc->state != en_dbc_needdata) - { - PUSHSQLERR (pdbc->herr, en_08002); - - return SQL_ERROR; - } - - hproc = _iodbcdm_getproc (hdbc, en_BrowseConnect); - - if (hproc == SQL_NULL_HPROC) - { - _iodbcdm_driverunload (hdbc); - - pdbc->state = en_dbc_allocated; - - PUSHSQLERR (pdbc->herr, en_IM001); - - return SQL_ERROR; - } - - CALL_DRIVER (hdbc, retcode, hproc, en_BrowseConnect, ( - pdbc->dhdbc, - szConnStrIn, cbConnStrIn, - szConnStrOut, cbConnStrOutMax, - pcbConnStrOut)) - - switch (retcode) - { - case SQL_SUCCESS: - case SQL_SUCCESS_WITH_INFO: - pdbc->state = en_dbc_connected; - setopterr |= _iodbcdm_dbcdelayset (hdbc); - if (setopterr != SQL_SUCCESS) - { - retcode = SQL_SUCCESS_WITH_INFO; - } - break; - - case SQL_NEED_DATA: - pdbc->state = en_dbc_needdata; - break; - - case SQL_ERROR: - pdbc->state = en_dbc_allocated; - /* but the driver will not unloaded - * to allow application retrive err - * message from driver - */ - break; - - default: - break; - } - - return retcode; -} - - -RETCODE SQL_API -SQLDisconnect (HDBC hdbc) -{ - DBC_t FAR *pdbc = (DBC_t *) hdbc; - STMT_t FAR *pstmt; - RETCODE retcode; - HPROC hproc; - - int sqlstat = en_00000; - - if (hdbc == SQL_NULL_HDBC) - { - return SQL_INVALID_HANDLE; - } - - /* check hdbc state */ - if (pdbc->state == en_dbc_allocated) - { - sqlstat = en_08003; - } - - /* check stmt(s) state */ - for (pstmt = (STMT_t FAR *) pdbc->hstmt; - pstmt != NULL && sqlstat == en_00000; - pstmt = (STMT_t FAR *) pstmt->next) - { - if (pstmt->state >= en_stmt_needdata - || pstmt->asyn_on != en_NullProc) - /* In this case one need to call - * SQLCancel() first */ - { - sqlstat = en_S1010; - } - } - - if (sqlstat == en_00000) - { - hproc = _iodbcdm_getproc (hdbc, en_Disconnect); - - if (hproc == SQL_NULL_HPROC) - { - sqlstat = en_IM001; - } - } - - if (sqlstat != en_00000) - { - PUSHSQLERR (pdbc->herr, sqlstat); - - return SQL_ERROR; - } - - CALL_DRIVER (hdbc, retcode, hproc, en_Disconnect, ( - pdbc->dhdbc)) - - if (retcode == SQL_SUCCESS || retcode == SQL_SUCCESS_WITH_INFO) - { - /* diff from MS specs. We disallow - * driver SQLDisconnect() return - * SQL_SUCCESS_WITH_INFO and post - * error message. - */ - retcode = SQL_SUCCESS; - } - else - { - return retcode; - } - - /* free all statement handle(s) on this connection */ - for (; pdbc->hstmt;) - { - _iodbcdm_dropstmt (pdbc->hstmt); - } - - /* state transition */ - if (retcode == SQL_SUCCESS) - { - pdbc->state = en_dbc_allocated; - } - - return retcode; -} - - -RETCODE SQL_API -SQLNativeSql ( - HDBC hdbc, - UCHAR FAR * szSqlStrIn, - SDWORD cbSqlStrIn, - UCHAR FAR * szSqlStr, - SDWORD cbSqlStrMax, - SDWORD FAR * pcbSqlStr) -{ - DBC_t FAR *pdbc = (DBC_t FAR *) hdbc; - HPROC hproc; - int sqlstat = en_00000; - RETCODE retcode; - - if (hdbc == SQL_NULL_HDBC) - { - return SQL_INVALID_HANDLE; - } - - /* check argument */ - if (szSqlStrIn == NULL) - { - sqlstat = en_S1009; - } - else if (cbSqlStrIn < 0 && cbSqlStrIn != SQL_NTS) - { - sqlstat = en_S1090; - } - - if (sqlstat != en_00000) - { - PUSHSQLERR (pdbc->herr, sqlstat); - - return SQL_ERROR; - } - - /* check state */ - if (pdbc->state <= en_dbc_needdata) - { - PUSHSQLERR (pdbc->herr, en_08003); - - return SQL_ERROR; - } - - /* call driver */ - hproc = _iodbcdm_getproc (hdbc, en_NativeSql); - - if (hproc == SQL_NULL_HPROC) - { - PUSHSQLERR (pdbc->herr, en_IM001); - - return SQL_ERROR; - } - - CALL_DRIVER (hdbc, retcode, hproc, en_NativeSql, - (pdbc->dhdbc, szSqlStrIn, cbSqlStrIn, szSqlStr, cbSqlStrMax, pcbSqlStr)) - - return retcode; -} diff --git a/wxWidgets/src/iodbc/dlf.c b/wxWidgets/src/iodbc/dlf.c deleted file mode 100644 index 3d2eebfbab..0000000000 --- a/wxWidgets/src/iodbc/dlf.c +++ /dev/null @@ -1,612 +0,0 @@ -/* - * dlf.c - * - * $Id: dlf.c 2613 1999-06-01 15:32:12Z VZ $ - * - * Dynamic Library Loader (mapping to SVR4) - * - * The iODBC driver manager. - * - * Copyright (C) 1995 by Ke Jin - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -#include "dlf.h" -#include - -#ifdef DLDAPI_DEFINED -#undef DLDAPI_DEFINED -#endif - -#ifdef DLDAPI_SVR4_DLFCN -#define DLDAPI_DEFINED -static char sccsid[] = "@(#)dynamic load interface -- SVR4 dlfcn"; -#endif - -/********************************* - * - * HP/UX - * - *********************************/ - -#ifdef DLDAPI_HP_SHL -#define DLDAPI_DEFINED -#include - -static char sccsid[] = "@(#)dynamic load interface -- HP/UX dl(shl)"; - -void * -dlopen (char *path, int mode) -{ - return (void *) shl_load ((char *) (path), BIND_DEFERRED, 0L); -} - - -void * -dlsym (void *hdll, char *sym) -{ - void *symaddr = 0; - int ret; - - if (!hdll) - hdll = (void *) PROG_HANDLE; - - /* Remember, a driver may export calls as function pointers - * (i.e. with type TYPE_DATA) rather than as functions - * (i.e. with type TYPE_PROCEDURE). Thus, to be safe, we - * uses TYPE_UNDEFINED to cover all of them. - */ - ret = shl_findsym ((shl_t *) & hdll, sym, TYPE_UNDEFINED, &symaddr); - - if (ret == -1) - return 0; - - return symaddr; -} - - -char * -dlerror () -{ - extern char *strerror (); - - return strerror (errno); -} - - -int -dlclose (void *hdll) -{ - return shl_unload ((shl_t) hdll); -} -#endif /* end of HP/UX Seection */ - - -/********************************* - * - * IBM AIX - * - *********************************/ - -#ifdef DLDAPI_AIX_LOAD -#define DLDAPI_DEFINED -#include -#include -#include -#include - -/* - * Following id sting is a copyright mark. Removing(i.e. use the - * source code in this .c file without include it or make it not - * appear in the final object file of AIX platform) or modifing - * it without permission from original author(kejin@empress.com) - * are copyright violation. - */ -static char sccsid[] -= "@(#)dynamic load interface, Copyright(c) 1995 by Ke Jin"; - -#ifndef HTAB_SIZE -#define HTAB_SIZE 256 -#endif - -#define FACTOR 0.618039887 /* i.e. (sqrt(5) - 1)/2 */ - -#ifndef ENTRY_SYM -#define ENTRY_SYM ".__start" /* default entry point for aix */ -#endif - -typedef struct slot_s - { - char *sym; - long fdesc[3]; /* 12 bytes function descriptor */ - struct slot_s *next; - } -slot_t; - -/* Note: on AIX, a function pointer actually points to a - * function descriptor, a 12 bytes data. The first 4 bytes - * is the virtual address of the function. The next 4 bytes - * is the virtual address of TOC (Table of Contents) of the - * object module the function belong to. The last 4 bytes - * are always 0 for C and Fortran functions. Every object - * module has an entry point (which can be specified at link - * time by -e ld option). iODBC driver manager requires ODBC - * driver shared library always use the default entry point - * (so you shouldn't use -e ld option when creating a driver - * share library). load() returns the function descriptor of - * a module's entry point. From which we can calculate function - * descriptors of other functions in the same module by using - * the fact that the load() doesn't change the relative - * offset of functions to their module entry point(i.e the - * offset in memory loaded by load() will be as same as in - * the module library file). - */ - -typedef slot_t *hent_t; -typedef struct nlist nlist_t; -typedef struct stat stat_t; - -typedef struct obj - { - int dev; /* device id */ - int ino; /* inode number */ - char *path; /* file name */ - int (*pentry) (); /* entry point of this share library */ - int refn; /* number of reference */ - hent_t htab[HTAB_SIZE]; - struct obj * next; - } -obj_t; - -static char *errmsg = 0; - -static void -init_htab (hent_t * ht) -/* initate a hashing table */ -{ - int i; - - for (i = 0; i < HTAB_SIZE; i++) - ht[i] = (slot_t *) 0; - - return; -} - - -static void -clean_htab (hent_t * ht) -/* free all slots */ -{ - int i; - slot_t *ent; - slot_t *tent; - - for (i = 0; i < HTAB_SIZE; i++) - { - for (ent = ht[i]; ent;) - { - tent = ent->next; - - free (ent->sym); - free (ent); - - ent = tent; - } - - ht[i] = 0; - } - - return; -} - - -static int -hash (char *sym) -{ - int a, key; - double f; - - if (!sym || !*sym) - return 0; - - for (key = *sym; *sym; sym++) - { - key += *sym; - a = key; - - key = (int) ((a << 8) + (key >> 8)); - key = (key > 0) ? key : -key; - } - - f = key * FACTOR; - a = (int) f; - - return (int) ((HTAB_SIZE - 1) * (f - a)); -} - - -static hent_t -search (hent_t * htab, char *sym) -/* search hashing table to find a matched slot */ -{ - int key; - slot_t *ent; - - key = hash (sym); - - for (ent = htab[key]; ent; ent = ent->next) - { - if (!strcmp (ent->sym, sym)) - return ent; - } - - return 0; /* no match */ -} - - -static void -insert (hent_t * htab, slot_t * ent) -/* insert a new slot to hashing table */ -{ - int key; - - key = hash (ent->sym); - - ent->next = htab[key]; - htab[key] = ent; - - return; -} - - -static slot_t * -slot_alloc (char *sym) -/* allocate a new slot with symbol */ -{ - slot_t *ent; - - ent = (slot_t *) malloc (sizeof (slot_t)); - - ent->sym = (char *) malloc (strlen (sym) + 1); - - if (!ent->sym) - { - free (ent); - return 0; - } - - strcpy (ent->sym, sym); - - return ent; -} - - -static obj_t *obj_list = 0; - -void * -dlopen (char *file, int mode) -{ - stat_t st; - obj_t *pobj; - char buf[1024]; - - if (!file || !*file) - { - errno = EINVAL; - return 0; - } - - errno = 0; - errmsg = 0; - - if (stat (file, &st)) - return 0; - - for (pobj = obj_list; pobj; pobj = pobj->next) - /* find a match object */ - { - if (pobj->ino == st.st_ino - && pobj->dev == st.st_dev) - { - /* found a match. increase its - * reference count and return - * its address */ - pobj->refn++; - return pobj; - } - } - - pobj = (obj_t *) malloc (sizeof (obj_t)); - - if (!pobj) - return 0; - - pobj->path = (char *) malloc (strlen (file) + 1); - - if (!pobj->path) - { - free (pobj); - return 0; - } - - strcpy (pobj->path, file); - - pobj->dev = st.st_dev; - pobj->ino = st.st_ino; - pobj->refn = 1; - - pobj->pentry = (int (*)()) load (file, 0, 0); - - if (!pobj->pentry) - { - free (pobj->path); - free (pobj); - return 0; - } - - init_htab (pobj->htab); - - pobj->next = obj_list; - obj_list = pobj; - - return pobj; -} - - -int -dlclose (void *hobj) -{ - obj_t *pobj = (obj_t *) hobj; - obj_t *tpobj; - int match = 0; - - if (!hobj) - { - errno = EINVAL; - return -1; - } - - errno = 0; - errmsg = 0; - - if (pobj == obj_list) - { - pobj->refn--; - - if (pobj->refn) - return 0; - - match = 1; - obj_list = pobj->next; - } - - for (tpobj = obj_list; !match && tpobj; tpobj = tpobj->next) - { - if (tpobj->next == pobj) - { - pobj->refn--; - - if (pobj->refn) - return 0; - - match = 1; - tpobj->next = pobj->next; - } - } - - if (match) - { - unload ((void *) (pobj->pentry)); - clean_htab (pobj->htab); - free (pobj->path); - free (pobj); - } - - return 0; -} - - -char * -dlerror () -{ - extern char *sys_errlist[]; - - if (!errmsg || !errmsg[0]) - { - if (errno >= 0) - return sys_errlist[errno]; - - return ""; - } - - return errmsg; -} - - -void * -dlsym (void *hdl, char *sym) -{ - nlist_t nl[3]; - obj_t *pobj = (obj_t *) hdl; - slot_t *ent; - int (*fp) (); - long lbuf[3]; - - if (!hdl || !(pobj->htab) || !sym || !*sym) - { - errno = EINVAL; - return 0; - } - - errno = 0; - errmsg = 0; - - ent = search (pobj->htab, sym); - - if (ent) - return ent->fdesc; - -#define n_name _n._n_name - - nl[0].n_name = ENTRY_SYM; - nl[1].n_name = sym; - nl[2].n_name = 0; - - /* There is a potential problem here. If application - * did not pass a full path name, and changed the - * working directory after the load(), then nlist() - * will be unable to open the original shared library - * file to resolve the symbols. there are 3 ways to working - * round this: 1. convert to full pathname in driver - * manager. 2. applications always pass driver's full - * path name. 3. if driver itself don't support - * SQLGetFunctions(), call it with SQL_ALL_FUNCTIONS - * as flag immidately after SQLConnect(), SQLDriverConnect() - * and SQLBrowseConnect() to force the driver manager - * resolving all will be used symbols. - */ - if (nlist (pobj->path, nl) == -1) - return 0; - - if (!nl[0].n_type && !nl[0].n_value) - { - errmsg = "can't locate module entry symbol"; - return 0; - } - - /* Note: On AIX 3.x if the object library is not - * built with -g compiling option, .n_type field - * is always 0. While on 4.x it will be 32. - * On AIX 4.x, if the symbol is a entry point, - * n_value will be 0. However, one thing is for sure - * that if a symbol is not existance in the file, - * both .n_type and .n_value would be 0. - */ - - if (!nl[1].n_type && !nl[1].n_value) - { - errmsg = "symbol not existance in this module"; - return 0; - } - - ent = slot_alloc (sym); - - if (!ent) - return 0; - - /* catch it with a slot in the hashing table */ - insert (pobj->htab, ent); - - memcpy (ent->fdesc, pobj->pentry, sizeof (ent->fdesc)); - - /* now ent->fdesc[0] is the virtual address of entry point - * and ent->fdesc[1] is the TOC of the module - */ - - /* let's calculate the virtual address of the symbol - * by adding a relative offset getting from the module - * file symbol table, i.e - * - * functin virtual address = entry point virtual address + - * + ( function offset in file - entry point offset in file ) - */ - - (ent->fdesc)[0] = (ent->fdesc)[0] + - (nl[1].n_value - nl[0].n_value); - - /* return the function descriptor */ - return ent->fdesc; -} -#endif /* end of IBM AIX Section */ - - -/********************************* - * - * Windows 3.x, 95, NT - * - *********************************/ - -#ifdef DLDAPI_WINDOWS -#define DLDAPI_DEFINED -#include - -void FAR * -dlopen (char FAR * dll, int mode) -{ - HINSTANCE hint; - - if (dll == NULL) - { - return GetWindowWord (NULL, GWW_HINSTANCE); - } - - hint = LoadLibrary (dll); - - if (hint < HINSTANCE_ERROR) - { - return NULL; - } - - return (void FAR *) hint; -} - - -void FAR * -dlsym (void FAR * hdll, char FAR * sym) -{ - return (void FAR *) GetProcAddress (hdll, sym); -} - - -char FAR * -dlerror () -{ - return 0L; /* unimplemented yet */ -} - - -int -dlclose (void FAR * hdll) -{ - FreeLibrary ((HINSTANCE) hdll); -} -#endif /* end of Windows family */ - - -/*********************************** - * - * other platforms - * - ***********************************/ - -#ifdef DLDAPI_OS2 -#define DLDAPI_DEFINED -/* - * DosLoadModule(), DosQueryProcAddress(), DosFreeModule(), ... - */ -#endif - -#ifdef DLDAPI_MAC -#define DLDAPI_DEFINED -#endif - -#ifdef DLDAPI_NEXT -#define DLDAPI_DEFINED -#endif - -#ifndef DLDAPI_DEFINED -#error "dynamic load editor undefined" -#endif diff --git a/wxWidgets/src/iodbc/dlf.h b/wxWidgets/src/iodbc/dlf.h deleted file mode 100644 index ecde186a87..0000000000 --- a/wxWidgets/src/iodbc/dlf.h +++ /dev/null @@ -1,55 +0,0 @@ -/* - * dlf.h - * - * $Id: dlf.h 2613 1999-06-01 15:32:12Z VZ $ - * - * Dynamic Library Loader (mapping to SVR4) - * - * The iODBC driver manager. - * - * Copyright (C) 1995 by Ke Jin - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ -#ifndef _DLF_H -#define _DLF_H -#include "config.h" - -#if defined(HAVE_LIBDL) -#define DLDAPI_SVR4_DLFCN -#elif defined(HAVE_SHL_LOAD) -#define DLDAPI_HP_SHL -#endif - -#ifdef DLDAPI_SVR4_DLFCN -#include -#elif DLDAPI_AIX_LOAD -#include -#else -extern void FAR *dlopen (char FAR * path, int mode); -extern void FAR *dlsym (void FAR * hdll, char FAR * sym); -extern char FAR *dlerror (); -extern int dlclose (void FAR * hdll); -#endif - -#ifndef RTLD_LAZY -#define RTLD_LAZY 1 -#endif - -#define DLL_OPEN(dll) (void*)dlopen((char*)(path), RTLD_LAZY) -#define DLL_PROC(hdll, sym) (void*)dlsym((void*)(hdll), (char*)sym) -#define DLL_ERROR() (char*)dlerror() -#define DLL_CLOSE(hdll) dlclose((void*)(hdll)) -#endif diff --git a/wxWidgets/src/iodbc/dlproc.c b/wxWidgets/src/iodbc/dlproc.c deleted file mode 100644 index 805660649e..0000000000 --- a/wxWidgets/src/iodbc/dlproc.c +++ /dev/null @@ -1,119 +0,0 @@ -/* - * dlproc.c - * - * $Id: dlproc.c 2613 1999-06-01 15:32:12Z VZ $ - * - * Load driver and resolve driver's function entry point - * - * The iODBC driver manager. - * - * Copyright (C) 1995 by Ke Jin - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -#include "config.h" - -#include "isql.h" -#include "isqlext.h" - -#include "dlproc.h" - -#include "herr.h" -#include "henv.h" -#include "hdbc.h" - -#include "itrace.h" - -#include "henv.ci" - -HPROC -_iodbcdm_getproc (HDBC hdbc, int idx) -{ - DBC_t FAR *pdbc = (DBC_t FAR *) hdbc; - ENV_t FAR *penv; - HPROC FAR *phproc; - - if (idx <= 0 || idx > SQL_EXT_API_LAST) - /* first entry naver used */ - { - return SQL_NULL_HPROC; - } - - penv = (ENV_t FAR *) (pdbc->henv); - - if (penv == NULL) - { - return SQL_NULL_HPROC; - } - - phproc = penv->dllproc_tab + idx; - - if (*phproc == SQL_NULL_HPROC) - { - int i, en_idx; - - for (i = 0;; i++) - { - en_idx = odbcapi_symtab[i].en_idx; - - if (en_idx == en_NullProc) - { - break; - } - - if (en_idx == idx) - { - *phproc = _iodbcdm_dllproc (penv->hdll, - odbcapi_symtab[i].symbol); - - break; - } - } - } - - return *phproc; -} - - -HDLL -_iodbcdm_dllopen (char FAR * path) -{ - return (HDLL) DLL_OPEN (path); -} - - -HPROC -_iodbcdm_dllproc (HDLL hdll, char FAR * sym) -{ - return (HPROC) DLL_PROC (hdll, sym); -} - - -int -_iodbcdm_dllclose (HDLL hdll) -{ - DLL_CLOSE (hdll); - - return 0; -} - - -char * -_iodbcdm_dllerror () -{ - return DLL_ERROR (); -} - diff --git a/wxWidgets/src/iodbc/dlproc.h b/wxWidgets/src/iodbc/dlproc.h deleted file mode 100644 index 97a69eca7f..0000000000 --- a/wxWidgets/src/iodbc/dlproc.h +++ /dev/null @@ -1,55 +0,0 @@ -/* - * dlproc.h - * - * $Id: dlproc.h 2613 1999-06-01 15:32:12Z VZ $ - * - * Load driver and resolve driver's function entry point - * - * The iODBC driver manager. - * - * Copyright (C) 1995 by Ke Jin - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ -#ifndef _DLPROC_H -#define _DLPROC_H - -#include "dlf.h" - -typedef RETCODE (FAR * HPROC) (); - -#ifdef DLDAPI_SVR4_DLFCN -#include -typedef void *HDLL; -#endif - -#ifdef DLDAPI_HP_SHL -#include -typedef shl_t HDLL; -#endif - -#if defined(DLDAPI_AIX_LOAD) || defined(__DECCXX) -typedef void *HDLL; -#endif - -extern HPROC _iodbcdm_getproc (); -extern HDLL _iodbcdm_dllopen (char FAR * dll); -extern HPROC _iodbcdm_dllproc (HDLL hdll, char FAR * sym); -extern char FAR *_iodbcdm_dllerror (); -extern int _iodbcdm_dllclose (HDLL hdll); - -#define SQL_NULL_HDLL ((HDLL)NULL) -#define SQL_NULL_HPROC ((HPROC)NULL) -#endif diff --git a/wxWidgets/src/iodbc/execute.c b/wxWidgets/src/iodbc/execute.c deleted file mode 100644 index 844903b8e8..0000000000 --- a/wxWidgets/src/iodbc/execute.c +++ /dev/null @@ -1,768 +0,0 @@ -/* - * execute.c - * - * $Id: execute.c 2613 1999-06-01 15:32:12Z VZ $ - * - * Invoke a query - * - * The iODBC driver manager. - * - * Copyright (C) 1995 by Ke Jin - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -#include "config.h" - -#include "isql.h" -#include "isqlext.h" - -#include "dlproc.h" - -#include "herr.h" -#include "henv.h" -#include "hdbc.h" -#include "hstmt.h" - -#include "itrace.h" - -static void -do_cursoropen (STMT_t FAR * pstmt) -{ - RETCODE retcode; - SWORD ncol; - - pstmt->state = en_stmt_executed; - - retcode = SQLNumResultCols (pstmt, &ncol); - - if (retcode == SQL_SUCCESS || retcode == SQL_SUCCESS_WITH_INFO) - { - if (ncol) - { - pstmt->state = en_stmt_cursoropen; - pstmt->cursor_state = en_stmt_cursor_opened; - } - else - { - pstmt->state = en_stmt_executed; - pstmt->cursor_state = en_stmt_cursor_no; - } - } -} - - -RETCODE SQL_API -SQLExecute (HSTMT hstmt) -{ - STMT_t FAR *pstmt = (STMT_t FAR *) hstmt; - HPROC hproc = SQL_NULL_HPROC; - RETCODE retcode; - - int sqlstat = en_00000; - - if (hstmt == SQL_NULL_HSTMT || pstmt->hdbc == SQL_NULL_HDBC) - { - return SQL_INVALID_HANDLE; - } - - /* check state */ - if (pstmt->asyn_on == en_NullProc) - { - switch (pstmt->state) - { - case en_stmt_allocated: - sqlstat = en_S1010; - break; - - case en_stmt_executed: - if (!pstmt->prep_state) - { - sqlstat = en_S1010; - } - break; - - case en_stmt_cursoropen: - if (!pstmt->prep_state) - { - sqlstat = en_S1010; - } - break; - - case en_stmt_fetched: - case en_stmt_xfetched: - if (!pstmt->prep_state) - { - sqlstat = en_S1010; - } - else - { - sqlstat = en_24000; - } - break; - - case en_stmt_needdata: - case en_stmt_mustput: - case en_stmt_canput: - sqlstat = en_S1010; - break; - - default: - break; - } - } - else if (pstmt->asyn_on != en_Execute) - { - sqlstat = en_S1010; - } - - if (sqlstat == en_00000) - { - hproc = _iodbcdm_getproc (pstmt->hdbc, en_Execute); - - if (hproc == SQL_NULL_HPROC) - { - sqlstat = en_IM001; - } - } - - if (sqlstat != en_00000) - { - PUSHSQLERR (pstmt->herr, sqlstat); - - return SQL_ERROR; - } - - CALL_DRIVER (pstmt->hdbc, retcode, hproc, en_Execute, - (pstmt->dhstmt)) - - /* stmt state transition */ - if (pstmt->asyn_on == en_Execute) - { - switch (retcode) - { - case SQL_SUCCESS: - case SQL_SUCCESS_WITH_INFO: - case SQL_NEED_DATA: - case SQL_ERROR: - pstmt->asyn_on = en_NullProc; - break; - - case SQL_STILL_EXECUTING: - default: - return retcode; - } - } - - switch (pstmt->state) - { - case en_stmt_prepared: - switch (retcode) - { - case SQL_SUCCESS: - case SQL_SUCCESS_WITH_INFO: - do_cursoropen (hstmt); - break; - - case SQL_NEED_DATA: - pstmt->state = en_stmt_needdata; - pstmt->need_on = en_Execute; - break; - - case SQL_STILL_EXECUTING: - pstmt->asyn_on = en_Execute; - break; - - default: - break; - } - break; - - case en_stmt_executed: - switch (retcode) - { - case SQL_ERROR: - pstmt->state = en_stmt_allocated; - pstmt->cursor_state = en_stmt_cursor_no; - pstmt->prep_state = 0; - break; - - case SQL_NEED_DATA: - pstmt->state = en_stmt_needdata; - pstmt->need_on = en_Execute; - break; - - case SQL_STILL_EXECUTING: - pstmt->asyn_on = en_Execute; - break; - - default: - break; - } - break; - - default: - break; - } - - return retcode; -} - - -RETCODE SQL_API -SQLExecDirect ( - HSTMT hstmt, - UCHAR FAR * szSqlStr, - SDWORD cbSqlStr) -{ - STMT_t FAR *pstmt = (STMT_t FAR *) hstmt; - HPROC hproc = SQL_NULL_HPROC; - - int sqlstat = en_00000; - RETCODE retcode = SQL_SUCCESS; - - if (hstmt == SQL_NULL_HSTMT || pstmt->hdbc == SQL_NULL_HDBC) - { - return SQL_INVALID_HANDLE; - } - - /* check arguments */ - if (szSqlStr == NULL) - { - sqlstat = en_S1009; - } - else if (cbSqlStr < 0 && cbSqlStr != SQL_NTS) - { - sqlstat = en_S1090; - } - - if (sqlstat != en_00000) - { - PUSHSQLERR (pstmt->herr, sqlstat); - - return SQL_ERROR; - } - - /* check state */ - if (pstmt->asyn_on == en_NullProc) - { - switch (pstmt->state) - { - case en_stmt_fetched: - case en_stmt_xfetched: - sqlstat = en_24000; - break; - - case en_stmt_needdata: - case en_stmt_mustput: - case en_stmt_canput: - sqlstat = en_S1010; - break; - - default: - break; - } - } - else if (pstmt->asyn_on != en_ExecDirect) - { - sqlstat = en_S1010; - } - - if (sqlstat != en_00000) - { - PUSHSQLERR (pstmt->herr, sqlstat); - - return SQL_ERROR; - } - - hproc = _iodbcdm_getproc (pstmt->hdbc, en_ExecDirect); - - if (hproc == SQL_NULL_HPROC) - { - PUSHSQLERR (pstmt->herr, en_IM001); - - return SQL_ERROR; - } - - CALL_DRIVER (pstmt->hdbc, retcode, hproc, en_ExecDirect, - (pstmt->dhstmt, szSqlStr, cbSqlStr)) - - /* stmt state transition */ - if (pstmt->asyn_on == en_ExecDirect) - { - switch (retcode) - { - case SQL_SUCCESS: - case SQL_SUCCESS_WITH_INFO: - case SQL_NEED_DATA: - case SQL_ERROR: - pstmt->asyn_on = en_NullProc; - break; - - case SQL_STILL_EXECUTING: - default: - return retcode; - } - } - - if (pstmt->state <= en_stmt_executed) - { - switch (retcode) - { - case SQL_SUCCESS: - case SQL_SUCCESS_WITH_INFO: - do_cursoropen (hstmt); - break; - - case SQL_NEED_DATA: - pstmt->state = en_stmt_needdata; - pstmt->need_on = en_ExecDirect; - break; - - case SQL_STILL_EXECUTING: - pstmt->asyn_on = en_ExecDirect; - break; - - case SQL_ERROR: - pstmt->state = en_stmt_allocated; - pstmt->cursor_state = en_stmt_cursor_no; - pstmt->prep_state = 0; - break; - - default: - break; - } - } - - return retcode; -} - - -RETCODE SQL_API -SQLPutData ( - HSTMT hstmt, - PTR rgbValue, - SDWORD cbValue) -{ - STMT_t FAR *pstmt = (STMT_t FAR *) hstmt; - HPROC hproc; - RETCODE retcode; - - if (hstmt == SQL_NULL_HSTMT || pstmt->hdbc == SQL_NULL_HDBC) - { - return SQL_INVALID_HANDLE; - } - - /* check argument value */ - if (rgbValue == NULL && - (cbValue != SQL_DEFAULT_PARAM && cbValue != SQL_NULL_DATA)) - { - PUSHSQLERR (pstmt->herr, en_S1009); - - return SQL_ERROR; - } - - /* check state */ - if (pstmt->asyn_on == en_NullProc) - { - if (pstmt->state <= en_stmt_xfetched) - { - PUSHSQLERR (pstmt->herr, en_S1010); - - return SQL_ERROR; - } - } - else if (pstmt->asyn_on != en_PutData) - { - PUSHSQLERR (pstmt->herr, en_S1010); - - return SQL_ERROR; - } - - /* call driver */ - hproc = _iodbcdm_getproc (pstmt->hdbc, en_PutData); - - if (hproc == SQL_NULL_HPROC) - { - PUSHSQLERR (pstmt->herr, en_IM001); - - return SQL_ERROR; - } - - CALL_DRIVER (pstmt->hdbc, retcode, hproc, en_PutData, - (pstmt->dhstmt, rgbValue, cbValue)) - - /* state transition */ - if (pstmt->asyn_on == en_PutData) - { - switch (retcode) - { - case SQL_SUCCESS: - case SQL_SUCCESS_WITH_INFO: - case SQL_ERROR: - pstmt->asyn_on = en_NullProc; - break; - - case SQL_STILL_EXECUTING: - default: - return retcode; - } - } - - /* must in mustput or canput states */ - switch (retcode) - { - case SQL_SUCCESS: - case SQL_SUCCESS_WITH_INFO: - pstmt->state = en_stmt_canput; - break; - - case SQL_ERROR: - switch (pstmt->need_on) - { - case en_ExecDirect: - pstmt->state = en_stmt_allocated; - pstmt->need_on = en_NullProc; - break; - - case en_Execute: - if (pstmt->prep_state) - { - pstmt->state = en_stmt_prepared; - pstmt->need_on = en_NullProc; - } - break; - - case en_SetPos: - /* Is this possible ???? */ - pstmt->state = en_stmt_xfetched; - break; - - default: - break; - } - break; - - case SQL_STILL_EXECUTING: - pstmt->asyn_on = en_PutData; - break; - - default: - break; - } - - return retcode; -} - - -RETCODE SQL_API -SQLParamData ( - HSTMT hstmt, - PTR FAR * prgbValue) -{ - STMT_t FAR *pstmt = (STMT_t FAR *) hstmt; - HPROC hproc; - RETCODE retcode; - - if (hstmt == SQL_NULL_HSTMT || pstmt->hdbc == SQL_NULL_HDBC) - { - return SQL_INVALID_HANDLE; - } - - /* check argument */ - - /* check state */ - if (pstmt->asyn_on == en_NullProc) - { - if (pstmt->state <= en_stmt_xfetched) - { - PUSHSQLERR (pstmt->herr, en_S1010); - - return SQL_ERROR; - } - } - else if (pstmt->asyn_on != en_ParamData) - { - PUSHSQLERR (pstmt->herr, en_S1010); - - return SQL_ERROR; - } - - /* call driver */ - hproc = _iodbcdm_getproc (pstmt->hdbc, en_ParamData); - - if (hproc == SQL_NULL_HPROC) - { - PUSHSQLERR (pstmt->herr, en_IM001); - - return SQL_ERROR; - } - - CALL_DRIVER (pstmt->hdbc, retcode, hproc, en_ParamData, - (pstmt->dhstmt, prgbValue)) - - /* state transition */ - if (pstmt->asyn_on == en_ParamData) - { - switch (retcode) - { - case SQL_SUCCESS: - case SQL_SUCCESS_WITH_INFO: - case SQL_ERROR: - pstmt->asyn_on = en_NullProc; - break; - - case SQL_STILL_EXECUTING: - default: - return retcode; - } - } - - if (pstmt->state < en_stmt_needdata) - { - return retcode; - } - - switch (retcode) - { - case SQL_ERROR: - switch (pstmt->need_on) - { - case en_ExecDirect: - pstmt->state = en_stmt_allocated; - break; - - case en_Execute: - pstmt->state = en_stmt_prepared; - break; - - case en_SetPos: - pstmt->state = en_stmt_xfetched; - pstmt->cursor_state - = en_stmt_cursor_xfetched; - break; - - default: - break; - } - pstmt->need_on = en_NullProc; - break; - - case SQL_SUCCESS: - case SQL_SUCCESS_WITH_INFO: - switch (pstmt->state) - { - case en_stmt_needdata: - pstmt->state = en_stmt_mustput; - break; - - case en_stmt_canput: - switch (pstmt->need_on) - { - case en_SetPos: - pstmt->state - = en_stmt_xfetched; - pstmt->cursor_state - = en_stmt_cursor_xfetched; - break; - - case en_ExecDirect: - case en_Execute: - do_cursoropen (hstmt); - break; - - default: - break; - } - break; - - default: - break; - } - pstmt->need_on = en_NullProc; - break; - - case SQL_NEED_DATA: - pstmt->state = en_stmt_mustput; - break; - - default: - break; - } - - return retcode; -} - - -RETCODE SQL_API -SQLNumParams ( - HSTMT hstmt, - SWORD FAR * pcpar) -{ - STMT_t FAR *pstmt = (STMT_t FAR *) hstmt; - HPROC hproc; - RETCODE retcode; - - if (hstmt == SQL_NULL_HSTMT || pstmt->hdbc == SQL_NULL_HDBC) - { - return SQL_INVALID_HANDLE; - } - - /* check argument */ - - /* check state */ - if (pstmt->asyn_on == en_NullProc) - { - switch (pstmt->state) - { - case en_stmt_allocated: - case en_stmt_needdata: - case en_stmt_mustput: - case en_stmt_canput: - PUSHSQLERR (pstmt->herr, en_S1010); - return SQL_ERROR; - - default: - break; - } - } - else if (pstmt->asyn_on != en_NumParams) - { - PUSHSQLERR (pstmt->herr, en_S1010); - - return SQL_ERROR; - } - - /* call driver */ - hproc = _iodbcdm_getproc (pstmt->hdbc, en_NumParams); - - if (hproc == SQL_NULL_HPROC) - { - PUSHSQLERR (pstmt->herr, en_IM001); - - return SQL_ERROR; - } - - CALL_DRIVER (pstmt->hdbc, retcode, hproc, en_NumParams, - (pstmt->dhstmt, pcpar)) - - /* state transition */ - if (pstmt->asyn_on == en_NumParams) - { - switch (retcode) - { - case SQL_SUCCESS: - case SQL_SUCCESS_WITH_INFO: - case SQL_ERROR: - break; - - default: - return retcode; - } - } - - if (retcode == SQL_STILL_EXECUTING) - { - pstmt->asyn_on = en_NumParams; - } - - return retcode; -} - - -RETCODE SQL_API -SQLDescribeParam ( - HSTMT hstmt, - UWORD ipar, - SWORD FAR * pfSqlType, - UDWORD FAR * pcbColDef, - SWORD FAR * pibScale, - SWORD FAR * pfNullable) -{ - STMT_t FAR *pstmt = (STMT_t FAR *) hstmt; - HPROC hproc; - RETCODE retcode; - - if (hstmt == SQL_NULL_HSTMT || pstmt->hdbc == SQL_NULL_HDBC) - { - return SQL_INVALID_HANDLE; - } - - /* check argument */ - if (ipar == 0) - { - PUSHSQLERR (pstmt->herr, en_S1093); - - return SQL_ERROR; - } - - /* check state */ - if (pstmt->asyn_on == en_NullProc) - { - switch (pstmt->state) - { - case en_stmt_allocated: - case en_stmt_needdata: - case en_stmt_mustput: - case en_stmt_canput: - PUSHSQLERR (pstmt->herr, en_S1010); - return SQL_ERROR; - - default: - break; - } - } - else if (pstmt->asyn_on != en_DescribeParam) - { - PUSHSQLERR (pstmt->herr, en_S1010); - - return SQL_ERROR; - } - - /* call driver */ - hproc = _iodbcdm_getproc (pstmt->hdbc, en_DescribeParam); - - if (hproc == SQL_NULL_HPROC) - { - PUSHSQLERR (pstmt->herr, en_IM001); - - return SQL_ERROR; - } - - CALL_DRIVER (pstmt->hdbc, retcode, hproc, en_DescribeParam, - (pstmt->dhstmt, ipar, pfSqlType, pcbColDef, pibScale, pfNullable)) - - /* state transition */ - if (pstmt->asyn_on == en_DescribeParam) - { - switch (retcode) - { - case SQL_SUCCESS: - case SQL_SUCCESS_WITH_INFO: - case SQL_ERROR: - break; - - default: - return retcode; - } - } - - if (retcode == SQL_STILL_EXECUTING) - { - pstmt->asyn_on = en_DescribeParam; - } - - return retcode; -} diff --git a/wxWidgets/src/iodbc/fetch.c b/wxWidgets/src/iodbc/fetch.c deleted file mode 100644 index 51169aaf67..0000000000 --- a/wxWidgets/src/iodbc/fetch.c +++ /dev/null @@ -1,649 +0,0 @@ -/* - * fetch.c - * - * $Id: fetch.c 2613 1999-06-01 15:32:12Z VZ $ - * - * Fetch query result - * - * The iODBC driver manager. - * - * Copyright (C) 1995 by Ke Jin - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -#include "config.h" - -#include "isql.h" -#include "isqlext.h" - -#include "dlproc.h" - -#include "herr.h" -#include "henv.h" -#include "hdbc.h" -#include "hstmt.h" - -#include "itrace.h" - -RETCODE SQL_API -SQLFetch (HSTMT hstmt) -{ - STMT_t FAR *pstmt = (STMT_t FAR *) hstmt; - HPROC hproc = SQL_NULL_HPROC; - RETCODE retcode; - - if (hstmt == SQL_NULL_HSTMT || pstmt->hdbc == SQL_NULL_HDBC) - { - return SQL_INVALID_HANDLE; - } - - /* check state */ - if (pstmt->asyn_on == en_NullProc) - { - switch (pstmt->state) - { - case en_stmt_allocated: - case en_stmt_prepared: - case en_stmt_xfetched: - case en_stmt_needdata: - case en_stmt_mustput: - case en_stmt_canput: - PUSHSQLERR (pstmt->herr, en_S1010); - return SQL_ERROR; - - default: - break; - } - } - else if (pstmt->asyn_on != en_Fetch) - { - PUSHSQLERR (pstmt->herr, en_S1010); - return SQL_ERROR; - } - - hproc = _iodbcdm_getproc (pstmt->hdbc, en_Fetch); - - if (hproc == SQL_NULL_HPROC) - { - PUSHSQLERR (pstmt->herr, en_IM001); - - return SQL_ERROR; - } - - CALL_DRIVER (pstmt->hdbc, retcode, hproc, en_Fetch, - (pstmt->dhstmt)) - - /* state transition */ - if (pstmt->asyn_on == en_Fetch) - { - switch (retcode) - { - case SQL_SUCCESS: - case SQL_SUCCESS_WITH_INFO: - case SQL_NO_DATA_FOUND: - case SQL_ERROR: - pstmt->asyn_on = en_NullProc; - break; - - case SQL_STILL_EXECUTING: - default: - return retcode; - } - } - - switch (pstmt->state) - { - case en_stmt_cursoropen: - case en_stmt_fetched: - switch (retcode) - { - case SQL_SUCCESS: - case SQL_SUCCESS_WITH_INFO: - pstmt->state = en_stmt_fetched; - pstmt->cursor_state = en_stmt_cursor_fetched; - break; - - case SQL_NO_DATA_FOUND: - if (pstmt->prep_state) - { - pstmt->state = en_stmt_prepared; - } - else - { - - pstmt->state = en_stmt_allocated; - } - pstmt->cursor_state = en_stmt_cursor_no; - break; - - case SQL_STILL_EXECUTING: - pstmt->asyn_on = en_Fetch; - break; - - default: - break; - } - break; - - default: - break; - } - - return retcode; -} - - -RETCODE SQL_API -SQLExtendedFetch ( - HSTMT hstmt, - UWORD fFetchType, - SDWORD irow, - UDWORD FAR * pcrow, - UWORD FAR * rgfRowStatus) -{ - STMT_t FAR *pstmt = (STMT_t FAR *) hstmt; - HPROC hproc = SQL_NULL_HPROC; - RETCODE retcode; - - if (hstmt == SQL_NULL_HSTMT || pstmt->hdbc == SQL_NULL_HDBC) - { - return SQL_INVALID_HANDLE; - } - - /* check fetch type */ - if (fFetchType < SQL_FETCH_NEXT || fFetchType > SQL_FETCH_BOOKMARK) - { - /* Unlike MS driver manager(i.e. DM), - * we don't check driver's ODBC version - * against SQL_FETCH_RESUME (only 1.0) - * and SQL_FETCH_BOOKMARK (only 2.0). - */ - PUSHSQLERR (pstmt->herr, en_S1106); - - return SQL_ERROR; - } - - /* check state */ - if (pstmt->asyn_on == en_NullProc) - { - switch (pstmt->state) - { - case en_stmt_allocated: - case en_stmt_prepared: - case en_stmt_fetched: - case en_stmt_needdata: - case en_stmt_mustput: - case en_stmt_canput: - PUSHSQLERR (pstmt->herr, en_S1010); - return SQL_ERROR; - - default: - break; - } - } - else if (pstmt->asyn_on != en_ExtendedFetch) - { - PUSHSQLERR (pstmt->herr, en_S1010); - return SQL_ERROR; - } - - hproc = _iodbcdm_getproc (pstmt->hdbc, en_ExtendedFetch); - - if (hproc == SQL_NULL_HPROC) - { - PUSHSQLERR (pstmt->herr, en_IM001); - - return SQL_ERROR; - } - - CALL_DRIVER (pstmt->hdbc, retcode, hproc, en_ExtendedFetch, - (pstmt->dhstmt, fFetchType, irow, pcrow, rgfRowStatus)) - - /* state transition */ - if (pstmt->asyn_on == en_ExtendedFetch) - { - switch (retcode) - { - case SQL_SUCCESS: - case SQL_SUCCESS_WITH_INFO: - case SQL_NO_DATA_FOUND: - case SQL_ERROR: - pstmt->asyn_on = en_NullProc; - break; - - case SQL_STILL_EXECUTING: - default: - return retcode; - } - } - - switch (pstmt->state) - { - case en_stmt_cursoropen: - case en_stmt_xfetched: - switch (retcode) - { - case SQL_SUCCESS: - case SQL_SUCCESS_WITH_INFO: - case SQL_NO_DATA_FOUND: - pstmt->state = en_stmt_xfetched; - pstmt->cursor_state = en_stmt_cursor_xfetched; - break; - - case SQL_STILL_EXECUTING: - pstmt->asyn_on = en_ExtendedFetch; - break; - - default: - break; - } - break; - - default: - break; - } - - return retcode; -} - - -RETCODE SQL_API -SQLGetData ( - HSTMT hstmt, - UWORD icol, - SWORD fCType, - PTR rgbValue, - SDWORD cbValueMax, - SDWORD FAR * pcbValue) -{ - STMT_t FAR *pstmt = (STMT_t FAR *) hstmt; - HPROC hproc; - RETCODE retcode; - int sqlstat = en_00000; - - if (hstmt == SQL_NULL_HSTMT || pstmt->hdbc == SQL_NULL_HDBC) - { - return SQL_INVALID_HANDLE; - } - - /* check argument */ - if (rgbValue == NULL) - { - sqlstat = en_S1009; - } - else if (cbValueMax < 0) - { - sqlstat = en_S1090; - } - else - { - switch (fCType) - { - case SQL_C_DEFAULT: - case SQL_C_CHAR: - case SQL_C_BINARY: - case SQL_C_BIT: - case SQL_C_TINYINT: - case SQL_C_STINYINT: - case SQL_C_UTINYINT: - case SQL_C_SHORT: - case SQL_C_SSHORT: - case SQL_C_USHORT: - case SQL_C_LONG: - case SQL_C_SLONG: - case SQL_C_ULONG: - case SQL_C_FLOAT: - case SQL_C_DOUBLE: - case SQL_C_DATE: - case SQL_C_TIME: - case SQL_C_TIMESTAMP: - break; - - default: - sqlstat = en_S1003; - break; - } - } - - if (sqlstat != en_00000) - { - PUSHSQLERR (pstmt->herr, sqlstat); - - return SQL_ERROR; - } - - /* check state */ - if (pstmt->asyn_on == en_NullProc) - { - switch (pstmt->state) - { - case en_stmt_allocated: - case en_stmt_prepared: - case en_stmt_needdata: - case en_stmt_mustput: - case en_stmt_canput: - sqlstat = en_S1010; - break; - - case en_stmt_executed: - case en_stmt_cursoropen: - sqlstat = en_24000; - break; - - default: - break; - } - } - else if (pstmt->asyn_on != en_GetData) - { - sqlstat = en_S1010; - } - - if (sqlstat != en_00000) - { - PUSHSQLERR (pstmt->herr, sqlstat); - - return SQL_ERROR; - } - - /* call driver */ - hproc = _iodbcdm_getproc (pstmt->hdbc, en_GetData); - - if (hproc == SQL_NULL_HPROC) - { - PUSHSQLERR (pstmt->herr, en_IM001); - - return SQL_ERROR; - } - - CALL_DRIVER (pstmt->hdbc, retcode, hproc, en_GetData, - (pstmt->dhstmt, icol, fCType, rgbValue, cbValueMax, pcbValue)) - - /* state transition */ - if (pstmt->asyn_on == en_GetData) - { - switch (retcode) - { - case SQL_SUCCESS: - case SQL_SUCCESS_WITH_INFO: - case SQL_NO_DATA_FOUND: - case SQL_ERROR: - pstmt->asyn_on = en_NullProc; - break; - - case SQL_STILL_EXECUTING: - default: - return retcode; - } - } - - switch (pstmt->state) - { - case en_stmt_fetched: - case en_stmt_xfetched: - if (retcode == SQL_STILL_EXECUTING) - { - pstmt->asyn_on = en_GetData; - break; - } - break; - - default: - break; - } - - return retcode; -} - - -RETCODE SQL_API -SQLMoreResults (HSTMT hstmt) -{ - STMT_t FAR *pstmt = (STMT_t FAR *) hstmt; - HPROC hproc; - RETCODE retcode; - - if (hstmt == SQL_NULL_HSTMT - || pstmt->hdbc == SQL_NULL_HDBC) - { - return SQL_INVALID_HANDLE; - } - - /* check state */ - if (pstmt->asyn_on == en_NullProc) - { - switch (pstmt->state) - { - case en_stmt_allocated: - case en_stmt_prepared: - return SQL_NO_DATA_FOUND; - - case en_stmt_needdata: - case en_stmt_mustput: - case en_stmt_canput: - PUSHSQLERR (pstmt->herr, en_S1010); - return SQL_ERROR; - - default: - break; - } - } - else if (pstmt->asyn_on != en_MoreResults) - { - PUSHSQLERR (pstmt->herr, en_S1010); - - return SQL_ERROR; - } - - /* call driver */ - hproc = _iodbcdm_getproc (pstmt->hdbc, en_MoreResults); - - if (hproc == SQL_NULL_HPROC) - { - PUSHSQLERR (pstmt->herr, en_IM001); - - return SQL_ERROR; - } - - CALL_DRIVER (pstmt->hdbc, retcode, hproc, en_MoreResults, - (pstmt->dhstmt)) - - /* state transition */ - if (pstmt->asyn_on == en_MoreResults) - { - switch (retcode) - { - case SQL_SUCCESS: - case SQL_SUCCESS_WITH_INFO: - case SQL_NO_DATA_FOUND: - case SQL_ERROR: - pstmt->asyn_on = en_NullProc; - break; - - case SQL_STILL_EXECUTING: - default: - return retcode; - } - } - - switch (pstmt->state) - { - case en_stmt_allocated: - case en_stmt_prepared: - /* driver should return SQL_NO_DATA_FOUND */ - break; - - case en_stmt_executed: - if (retcode == SQL_NO_DATA_FOUND) - { - if (pstmt->prep_state) - { - pstmt->state = en_stmt_prepared; - } - else - { - pstmt->state = en_stmt_allocated; - } - } - else if (retcode == SQL_STILL_EXECUTING) - { - pstmt->asyn_on = en_MoreResults; - } - break; - - case en_stmt_cursoropen: - case en_stmt_fetched: - case en_stmt_xfetched: - if (retcode == SQL_SUCCESS) - { - break; - } - else if (retcode == SQL_NO_DATA_FOUND) - { - if (pstmt->prep_state) - { - pstmt->state = en_stmt_prepared; - } - else - { - pstmt->state = en_stmt_allocated; - } - } - else if (retcode == SQL_STILL_EXECUTING) - { - pstmt->asyn_on = en_MoreResults; - } - break; - - default: - break; - } - - return retcode; -} - - -RETCODE SQL_API -SQLSetPos ( - HSTMT hstmt, - UWORD irow, - UWORD fOption, - UWORD fLock) -{ - STMT_t FAR *pstmt = (STMT_t FAR *) hstmt; - HPROC hproc; - RETCODE retcode; - int sqlstat = en_00000; - - if (hstmt == SQL_NULL_HSTMT || pstmt->hdbc == SQL_NULL_HDBC) - { - return SQL_INVALID_HANDLE; - } - - /* check argument value */ - if (fOption > SQL_ADD || fLock > SQL_LOCK_UNLOCK) - { - PUSHSQLERR (pstmt->herr, en_S1009); - } - - /* check state */ - if (pstmt->asyn_on == en_NullProc) - { - switch (pstmt->state) - { - case en_stmt_allocated: - case en_stmt_prepared: - case en_stmt_fetched: - case en_stmt_needdata: - case en_stmt_mustput: - case en_stmt_canput: - sqlstat = en_S1010; - break; - - case en_stmt_executed: - case en_stmt_cursoropen: - sqlstat = en_24000; - break; - - default: - break; - } - } - else if (pstmt->asyn_on != en_SetPos) - { - sqlstat = en_S1010; - } - - if (sqlstat != en_00000) - { - PUSHSQLERR (pstmt->herr, sqlstat); - - return SQL_ERROR; - } - - /* call driver */ - hproc = _iodbcdm_getproc (pstmt->hdbc, en_SetPos); - - if (hproc == SQL_NULL_HPROC) - { - PUSHSQLERR (pstmt->herr, en_IM001); - - return SQL_ERROR; - } - - CALL_DRIVER (pstmt->hdbc, retcode, hproc, en_SetPos, - (pstmt->dhstmt, irow, fOption, fLock)) - - /* state transition */ - if (pstmt->asyn_on == en_SetPos) - { - switch (retcode) - { - case SQL_SUCCESS: - case SQL_SUCCESS_WITH_INFO: - case SQL_NEED_DATA: - case SQL_ERROR: - pstmt->asyn_on = en_NullProc; - break; - - case SQL_STILL_EXECUTING: - default: - return retcode; - } - } - - /* now, the only possible init state is 'xfetched' */ - switch (retcode) - { - case SQL_SUCCESS: - case SQL_SUCCESS_WITH_INFO: - break; - - case SQL_NEED_DATA: - pstmt->state = en_stmt_needdata; - pstmt->need_on = en_SetPos; - break; - - case SQL_STILL_EXECUTING: - pstmt->asyn_on = en_SetPos; - break; - - default: - break; - } - - return retcode; -} diff --git a/wxWidgets/src/iodbc/hdbc.c b/wxWidgets/src/iodbc/hdbc.c deleted file mode 100644 index 509fc858fc..0000000000 --- a/wxWidgets/src/iodbc/hdbc.c +++ /dev/null @@ -1,811 +0,0 @@ -/* - * hdbc.c - * - * $Id: hdbc.c 2613 1999-06-01 15:32:12Z VZ $ - * - * Data source connect object management functions - * - * The iODBC driver manager. - * - * Copyright (C) 1995 by Ke Jin - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -#include "config.h" - -#include "isql.h" -#include "isqlext.h" - -#include "dlproc.h" - -#include "herr.h" -#include "henv.h" -#include "hdbc.h" -#include "hstmt.h" - -#include "itrace.h" -#include "stdio.h" - -extern RETCODE _iodbcdm_driverunload(); - - -RETCODE SQL_API -SQLAllocConnect ( - HENV henv, - HDBC FAR * phdbc) -{ - GENV_t FAR *genv = (GENV_t FAR *) henv; - DBC_t FAR *pdbc; - -#if (ODBCVER >= 0x0300) - if (henv == SQL_NULL_HENV || genv->type != SQL_HANDLE_ENV) -#else - if (henv == SQL_NULL_HENV) -#endif - - { - return SQL_INVALID_HANDLE; - } - - if (phdbc == NULL) - { - PUSHSQLERR (genv->herr, en_S1009); - - return SQL_ERROR; - } - - pdbc = (DBC_t FAR *) MEM_ALLOC (sizeof (DBC_t)); - - if (pdbc == NULL) - { - *phdbc = SQL_NULL_HDBC; - - PUSHSQLERR (genv->herr, en_S1001); - - return SQL_ERROR; - } - -#if (ODBCVER >= 0x0300) - pdbc->type = SQL_HANDLE_DBC; -#endif - - /* insert this dbc entry into the link list */ - pdbc->next = genv->hdbc; - genv->hdbc = pdbc; - pdbc->genv = henv; - - pdbc->henv = SQL_NULL_HENV; - pdbc->hstmt = SQL_NULL_HSTMT; - pdbc->herr = SQL_NULL_HERR; - pdbc->dhdbc = SQL_NULL_HDBC; - pdbc->state = en_dbc_allocated; - pdbc->trace = 0; - pdbc->tstm = NULL; - pdbc->tfile = NULL; - - /* set connect options to default values */ - pdbc->access_mode = SQL_MODE_DEFAULT; - pdbc->autocommit = SQL_AUTOCOMMIT_DEFAULT; - pdbc->current_qualifier = NULL; - pdbc->login_timeout = 0UL; - pdbc->odbc_cursors = SQL_CUR_DEFAULT; - pdbc->packet_size = 0UL; - pdbc->quiet_mode = (UDWORD) NULL; - pdbc->txn_isolation = SQL_TXN_READ_UNCOMMITTED; - pdbc->cb_commit = (SWORD) SQL_CB_DELETE; - pdbc->cb_rollback = (SWORD) SQL_CB_DELETE; - - *phdbc = (HDBC) pdbc; - - return SQL_SUCCESS; -} - - -RETCODE SQL_API -SQLFreeConnect (HDBC hdbc) -{ - GENV_t FAR *genv; - DBC_t FAR *pdbc = (DBC_t FAR *) hdbc; - DBC_t FAR *tpdbc; - - if (hdbc == SQL_NULL_HDBC) - { - return SQL_INVALID_HANDLE; - } - - /* check state */ - if (pdbc->state != en_dbc_allocated) - { - PUSHSQLERR (pdbc->herr, en_S1010); - - return SQL_ERROR; - } - - genv = (GENV_t FAR *) pdbc->genv; - - for (tpdbc = (DBC_t FAR *) genv->hdbc; - tpdbc != NULL; - tpdbc = tpdbc->next) - { - if (pdbc == tpdbc) - { - genv->hdbc = pdbc->next; - break; - } - - if (pdbc == tpdbc->next) - { - tpdbc->next = pdbc->next; - break; - } - } - - /* free this dbc */ - _iodbcdm_driverunload (pdbc); - _iodbcdm_freesqlerrlist (pdbc->herr); - - if (pdbc->tfile) - { - MEM_FREE (pdbc->tfile); - } - - SQLSetConnectOption (pdbc, SQL_OPT_TRACE, SQL_OPT_TRACE_OFF); - - MEM_FREE (pdbc); - - return SQL_SUCCESS; -} - - -RETCODE SQL_API -SQLSetConnectOption ( - HDBC hdbc, - UWORD fOption, - UDWORD vParam) -{ - DBC_t FAR *pdbc = (DBC_t FAR *) hdbc; - STMT_t FAR *pstmt; - HPROC hproc = SQL_NULL_HPROC; - int sqlstat = en_00000; - RETCODE retcode = SQL_SUCCESS; - - if (hdbc == SQL_NULL_HDBC) - { - return SQL_INVALID_HANDLE; - } - - /* check option */ - if (fOption < SQL_CONN_OPT_MIN || - (fOption > SQL_CONN_OPT_MAX && fOption < SQL_CONNECT_OPT_DRVR_START)) - { - PUSHSQLERR (pdbc->herr, en_S1092); - - return SQL_ERROR; - } - - /* check state of connection handle */ - switch (pdbc->state) - { - case en_dbc_allocated: - if (fOption == SQL_TRANSLATE_DLL || fOption == SQL_TRANSLATE_OPTION) - { - /* This two options are only meaningful - * for specified driver. So, has to be - * set after a dirver has been loaded. - */ - sqlstat = en_08003; - break; - } - - if (fOption >= SQL_CONNECT_OPT_DRVR_START && pdbc->henv == SQL_NULL_HENV) - /* An option only meaningful for drivers - * is passed before loading a driver. - * We classify this as an invalid option error. - * This is not documented by MS SDK guide. - */ - { - sqlstat = en_S1092; - break; - } - break; - - case en_dbc_needdata: - sqlstat = en_S1010; - break; - - case en_dbc_connected: - case en_dbc_hstmt: - if (fOption == SQL_ODBC_CURSORS) - { - sqlstat = en_08002; - } - break; - - default: - break; - } - - /* check state of statement handle(s) */ - for (pstmt = (STMT_t FAR *) pdbc->hstmt; - pstmt != NULL && sqlstat == en_00000; - pstmt = (STMT_t FAR *) pstmt->next) - { - if (pstmt->state >= en_stmt_needdata || pstmt->asyn_on != en_NullProc) - { - sqlstat = en_S1010; - } - } - - if (sqlstat != en_00000) - { - PUSHSQLERR (pdbc->herr, sqlstat); - - return SQL_ERROR; - } - - if (fOption == SQL_OPT_TRACE) - /* tracing flag can be set before and after connect - * and only meaningful for driver manager(actually - * there is only one tracing file under one global - * environment). - */ - { - switch (vParam) - { - case SQL_OPT_TRACE_ON: - if (pdbc->tfile == NULL) - { - pdbc->tfile = (char FAR *) MEM_ALLOC (1 + - STRLEN (SQL_OPT_TRACE_FILE_DEFAULT)); - - if (pdbc->tfile == NULL) - { - PUSHSQLERR (pdbc->herr, en_S1001); - - return SQL_ERROR; - } - - STRCPY (pdbc->tfile, SQL_OPT_TRACE_FILE_DEFAULT); - } - - if (pdbc->tstm == NULL) - { - -#if defined(stderr) && defined(stdout) - if (STREQ (pdbc->tfile, "stderr")) - { - pdbc->tstm = stderr; - } - else if (STREQ (pdbc->tfile, "stdout")) - { - pdbc->tstm = stdout; - } - else -#endif - - { - pdbc->tstm - = fopen (pdbc->tfile, "a+"); - } - - if (pdbc->tstm) - { - pdbc->trace = 1; - } - else - { - pdbc->trace = 0; - - sqlstat = en_IM013; - retcode = SQL_ERROR; - } - } - break; - - case SQL_OPT_TRACE_OFF: - if (pdbc->trace && pdbc->tstm) - { - -#if defined(stderr) && defined(stdout) - if (stderr != (FILE FAR *) (pdbc->tstm) - && stdout != (FILE FAR *) (pdbc->tstm)) -#endif - - { - fclose (pdbc->tstm); - } - } - pdbc->tstm = NULL; - pdbc->trace = 0; - break; - - default: - PUSHSQLERR (pdbc->herr, en_S1009); - retcode = SQL_ERROR; - } - - if (sqlstat != en_00000) - { - PUSHSQLERR (pdbc->herr, sqlstat); - } - - return retcode; - } - - if (fOption == SQL_OPT_TRACEFILE) - /* Tracing file can be set before and after connect - * and only meaningful for driver manager. - */ - { - if (vParam == 0UL || ((char FAR *) vParam)[0] == 0) - { - PUSHSQLERR (pdbc->herr, en_S1009); - - return SQL_ERROR; - } - - if (pdbc->tfile && STREQ (pdbc->tfile, vParam)) - { - return SQL_SUCCESS; - } - - if (pdbc->trace) - { - PUSHSQLERR (pdbc->herr, en_IM014); - - return SQL_ERROR; - } - - if (pdbc->tfile) - { - MEM_FREE (pdbc->tfile); - } - - pdbc->tfile = (char FAR *) MEM_ALLOC (1 + STRLEN (vParam)); - - if (pdbc->tfile == NULL) - { - PUSHSQLERR (pdbc->herr, en_S1001); - - return SQL_ERROR; - } - - STRCPY (pdbc->tfile, vParam); - - return SQL_SUCCESS; - } - - if (pdbc->state != en_dbc_allocated) - { - /* If already connected, then, driver's odbc call - * will be invoked. Otherwise, we only save the options - * and delay the setting process until the connection - * been established. - */ - hproc = _iodbcdm_getproc (hdbc, en_SetConnectOption); - - if (hproc == SQL_NULL_HPROC) - { - PUSHSQLERR (pdbc->herr, en_IM001); - - return SQL_ERROR; - } - - CALL_DRIVER (hdbc, retcode, hproc, en_SetConnectOption, - (pdbc->dhdbc, fOption, vParam)) - - if (retcode != SQL_SUCCESS && retcode != SQL_SUCCESS_WITH_INFO) - { - return retcode; - } - } - - /* - * Now, either driver's odbc call was successed or - * driver has not been loaded yet. In the first case, we - * need flip flag for(such as access_mode, autocommit, ...) - * for our finit state machine. While in the second case, - * we need save option values(such as current_qualifier, ...) - * for delaied setting. So, ... - */ - - /* No matter what state we are(i.e. allocated or connected, ..) - * we need to flip the flag. - */ - switch (fOption) - { - case SQL_ACCESS_MODE: - pdbc->access_mode = vParam; - break; - - case SQL_AUTOCOMMIT: - pdbc->autocommit = vParam; - break; - } - - /* state transition */ - if (pdbc->state != en_dbc_allocated) - { - return retcode; - } - - /* Only 'allocated' state is possible here, and we need to - * save the options for delaied setting. - */ - switch (fOption) - { - case SQL_CURRENT_QUALIFIER: - if (pdbc->current_qualifier != NULL) - { - MEM_FREE (pdbc->current_qualifier); - } - - if (vParam == 0UL) - { - pdbc->current_qualifier = NULL; - - break; - } - - pdbc->current_qualifier - = (char FAR *) MEM_ALLOC ( - STRLEN (vParam) + 1); - - if (pdbc->current_qualifier == NULL) - { - PUSHSQLERR (pdbc->herr, en_S1001); - return SQL_ERROR; - } - - STRCPY (pdbc->current_qualifier, vParam); - break; - - case SQL_LOGIN_TIMEOUT: - pdbc->login_timeout = vParam; - break; - - case SQL_ODBC_CURSORS: - pdbc->odbc_cursors = vParam; - break; - - case SQL_PACKET_SIZE: - pdbc->packet_size = vParam; - break; - - case SQL_QUIET_MODE: - pdbc->quiet_mode = vParam; - break; - - case SQL_TXN_ISOLATION: - pdbc->txn_isolation = vParam; - break; - - default: - /* Since we didn't save the option value for delaied - * setting, we should raise an error here. - */ - break; - } - - return retcode; -} - - -RETCODE SQL_API -SQLGetConnectOption ( - HDBC hdbc, - UWORD fOption, - PTR pvParam) -{ - DBC_t FAR *pdbc = (DBC_t FAR *) hdbc; - int sqlstat = en_00000; - HPROC hproc = SQL_NULL_HPROC; - RETCODE retcode; - - if (hdbc == SQL_NULL_HDBC) - { - return SQL_INVALID_HANDLE; - } - - /* check option */ - if (fOption < SQL_CONN_OPT_MIN || - (fOption > SQL_CONN_OPT_MAX && fOption < SQL_CONNECT_OPT_DRVR_START)) - { - PUSHSQLERR (pdbc->herr, en_S1092); - - return SQL_ERROR; - } - - /* check state */ - switch (pdbc->state) - { - case en_dbc_allocated: - if (fOption != SQL_ACCESS_MODE - && fOption != SQL_AUTOCOMMIT - && fOption != SQL_LOGIN_TIMEOUT - && fOption != SQL_OPT_TRACE - && fOption != SQL_OPT_TRACEFILE) - { - sqlstat = en_08003; - } - /* MS ODBC SDK document only - * allows SQL_ACCESS_MODE - * and SQL_AUTOCOMMIT in this - * dbc state. We allow another - * two options, because they - * are only meaningful for driver - * manager. - */ - break; - - case en_dbc_needdata: - sqlstat = en_S1010; - break; - - default: - break; - } - - if (sqlstat != en_00000) - { - PUSHSQLERR (pdbc->herr, sqlstat); - - return SQL_ERROR; - } - - /* Tracing and tracing file options are only - * meaningful for driver manager - */ - if (fOption == SQL_OPT_TRACE) - { - if (pdbc->trace) - *((UDWORD *) pvParam) = (UDWORD) SQL_OPT_TRACE_ON; - else - *((UDWORD *) pvParam) = (UDWORD) SQL_OPT_TRACE_OFF; - - return SQL_SUCCESS; - } - - if (fOption == SQL_OPT_TRACEFILE) - { - STRCPY (pvParam, pdbc->tfile); - - return SQL_ERROR; - } - - if (pdbc->state != en_dbc_allocated) - /* if already connected, we will invoke driver's function */ - { - hproc = _iodbcdm_getproc (hdbc, en_GetConnectOption); - - if (hproc == SQL_NULL_HPROC) - { - PUSHSQLERR (pdbc->herr, en_IM001); - - return SQL_ERROR; - } - - CALL_DRIVER (hdbc, retcode, hproc, en_GetConnectOption, - (pdbc->dhdbc, fOption, pvParam)) - - return retcode; - } - - /* We needn't to handle options which are not allowed - * to be *get* at a allocated dbc state(and two tracing - * options which has been handled and returned). Thus, - * there are only two possible cases. - */ - switch (fOption) - { - case SQL_ACCESS_MODE: - *((UDWORD *) pvParam) = pdbc->access_mode; - break; - - case SQL_AUTOCOMMIT: - *((UDWORD *) pvParam) = pdbc->autocommit; - break; - - case SQL_LOGIN_TIMEOUT: - *((UDWORD *) pvParam) = pdbc->login_timeout; - break; - - default: - break; - } - - return SQL_SUCCESS; -} - - -static RETCODE -_iodbcdm_transact ( - HDBC hdbc, - UWORD fType) -{ - DBC_t FAR *pdbc = (DBC_t FAR *) hdbc; - STMT_t FAR *pstmt; - HPROC hproc; - RETCODE retcode; - - /* check state */ - switch (pdbc->state) - { - case en_dbc_allocated: - case en_dbc_needdata: - PUSHSQLERR (pdbc->herr, en_08003); - return SQL_ERROR; - - case en_dbc_connected: - return SQL_SUCCESS; - - case en_dbc_hstmt: - default: - break; - } - - for (pstmt = (STMT_t FAR *) (pdbc->hstmt); - pstmt != NULL; - pstmt = pstmt->next) - { - if (pstmt->state >= en_stmt_needdata - || pstmt->asyn_on != en_NullProc) - { - PUSHSQLERR (pdbc->herr, en_S1010); - - return SQL_ERROR; - } - } - - hproc = _iodbcdm_getproc (hdbc, en_Transact); - - if (hproc == SQL_NULL_HPROC) - { - PUSHSQLERR (pdbc->herr, en_IM001); - - return SQL_ERROR; - } - - CALL_DRIVER (hdbc, retcode, hproc, en_Transact, - (SQL_NULL_HENV, pdbc->dhdbc, fType)) - - /* state transition */ - if (retcode != SQL_SUCCESS && retcode != SQL_SUCCESS_WITH_INFO) - { - return retcode; - } - - pdbc->state = en_dbc_hstmt; - - for (pstmt = (STMT_t FAR *) (pdbc->hstmt); - pstmt != NULL; - pstmt = pstmt->next) - { - switch (pstmt->state) - { - case en_stmt_prepared: - if (pdbc->cb_commit == SQL_CB_DELETE - || pdbc->cb_rollback == SQL_CB_DELETE) - { - pstmt->state = en_stmt_allocated; - pstmt->prep_state = 0; - break; - } - break; - - case en_stmt_executed: - case en_stmt_cursoropen: - case en_stmt_fetched: - case en_stmt_xfetched: - if (!pstmt->prep_state - && pdbc->cb_commit != SQL_CB_PRESERVE - && pdbc->cb_rollback != SQL_CB_PRESERVE) - { - pstmt->state = en_stmt_allocated; - pstmt->prep_state = 0; - pstmt->cursor_state = en_stmt_cursor_no; - break; - } - - if (pstmt->prep_state) - { - if (pdbc->cb_commit == SQL_CB_DELETE - || pdbc->cb_rollback == SQL_CB_DELETE) - { - pstmt->state = en_stmt_allocated; - pstmt->prep_state = 0; - pstmt->cursor_state = en_stmt_cursor_no; - break; - } - - if (pdbc->cb_commit == SQL_CB_CLOSE - || pdbc->cb_rollback == SQL_CB_CLOSE) - { - pstmt->state - = en_stmt_prepared; - pstmt->cursor_state - = en_stmt_cursor_no; - break; - } - break; - } - break; - - default: - break; - } - } - - return retcode; -} - - -RETCODE SQL_API -SQLTransact ( - HENV henv, - HDBC hdbc, - UWORD fType) -{ - GENV_t FAR *genv = (GENV_t FAR *) henv; - DBC_t FAR *pdbc = (DBC_t FAR *) hdbc; - HERR herr; - RETCODE retcode = 0; - - if (hdbc != SQL_NULL_HDBC) - { - herr = pdbc->herr; - } - else if (henv != SQL_NULL_HENV) - { - herr = genv->herr; - } - else - { - return SQL_INVALID_HANDLE; - } - - /* check argument */ - if (fType != SQL_COMMIT - && fType != SQL_ROLLBACK) - { - PUSHSQLERR (herr, en_S1012); - - return SQL_ERROR; - } - - if (hdbc != SQL_NULL_HDBC) - { - retcode = _iodbcdm_transact (hdbc, fType); - } - else - { - for (pdbc = (DBC_t FAR *) (genv->hdbc); - pdbc != NULL; - pdbc = pdbc->next) - { - retcode |= _iodbcdm_transact (hdbc, fType); - } - } - - if (retcode != SQL_SUCCESS - && retcode != SQL_SUCCESS_WITH_INFO) - { - /* fail on one of the connection */ - return SQL_ERROR; - } - - return retcode; -} diff --git a/wxWidgets/src/iodbc/hdbc.h b/wxWidgets/src/iodbc/hdbc.h deleted file mode 100644 index b6ab13e4fc..0000000000 --- a/wxWidgets/src/iodbc/hdbc.h +++ /dev/null @@ -1,93 +0,0 @@ -/* - * hdbc.h - * - * $Id: hdbc.h 1446 1999-01-22 10:52:42Z RR $ - * - * Data source connect object management functions - * - * The iODBC driver manager. - * - * Copyright (C) 1995 by Ke Jin - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ -#ifndef _HDBC_H -#define _HDBC_H - -typedef struct DBC - { - int type; /* must be 1st field */ - struct DBC FAR * - next; - - HENV genv; /* back point to global env object */ - - HDBC dhdbc; /* driver's private dbc */ - HENV henv; /* back point to instant env object */ - HSTMT hstmt; /* list of statement object handle(s) */ - HERR herr; - - int state; - - /* options */ - UDWORD access_mode; - UDWORD autocommit; - - UDWORD login_timeout; - UDWORD odbc_cursors; - UDWORD packet_size; - UDWORD quiet_mode; - UDWORD txn_isolation; - SWORD cb_commit; - SWORD cb_rollback; - - char FAR * - current_qualifier; - - int trace; /* trace flag */ - char FAR * - tfile; - void FAR * - tstm; /* trace stream */ - } -DBC_t; - -/* - * Note: - * - ODBC applications can see address of driver manager's - * connection object, i.e connection handle -- a void pointer, - * but not detail of it. ODBC applications can neither see - * detail driver's connection object nor its address. - * - * - ODBC driver manager knows its own connection objects and - * exposes their address to an ODBC application. Driver manager - * also knows address of driver's connection objects and keeps - * it via dhdbc field in driver manager's connection object. - * - * - ODBC driver exposes address of its own connection object to - * driver manager without detail. - * - * - Applications can get driver's connection object handle by - * SQLGetInfo() with fInfoType equals to SQL_DRIVER_HDBC. - */ - -enum - { - en_dbc_allocated, - en_dbc_needdata, - en_dbc_connected, - en_dbc_hstmt - }; -#endif diff --git a/wxWidgets/src/iodbc/henv.c b/wxWidgets/src/iodbc/henv.c deleted file mode 100644 index 4aa3bb0de6..0000000000 --- a/wxWidgets/src/iodbc/henv.c +++ /dev/null @@ -1,89 +0,0 @@ -/* - * henv.c - * - * $Id: henv.c 2613 1999-06-01 15:32:12Z VZ $ - * - * Environment object management functions - * - * The iODBC driver manager. - * - * Copyright (C) 1995 by Ke Jin - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -#include "config.h" - -#include "isql.h" -#include "isqlext.h" - -#include "dlproc.h" - -#include "herr.h" -#include "henv.h" - -#include "itrace.h" - -RETCODE SQL_API -SQLAllocEnv (HENV FAR * phenv) -{ - GENV_t FAR *genv; - - genv = (GENV_t *) MEM_ALLOC (sizeof (GENV_t)); - - if (genv == NULL) - { - *phenv = SQL_NULL_HENV; - - return SQL_ERROR; - } - -#if (ODBCVER >= 0x0300 ) - genv->type = SQL_HANDLE_ENV; -#endif - - genv->henv = SQL_NULL_HENV; /* driver's env list */ - genv->hdbc = SQL_NULL_HDBC; /* driver's dbc list */ - genv->herr = SQL_NULL_HERR; /* err list */ - - *phenv = (HENV) genv; - - return SQL_SUCCESS; -} - - -RETCODE SQL_API -SQLFreeEnv (HENV henv) -{ - GENV_t FAR *genv = (GENV_t *) henv; - - if (henv == SQL_NULL_HENV) - { - return SQL_INVALID_HANDLE; - } - - if (genv->hdbc != SQL_NULL_HDBC) - { - PUSHSQLERR (genv->herr, en_S1010); - - return SQL_ERROR; - } - - _iodbcdm_freesqlerrlist (genv->herr); - - MEM_FREE (henv); - - return SQL_SUCCESS; -} diff --git a/wxWidgets/src/iodbc/henv.ci b/wxWidgets/src/iodbc/henv.ci deleted file mode 100644 index 6108c4d4bb..0000000000 --- a/wxWidgets/src/iodbc/henv.ci +++ /dev/null @@ -1,117 +0,0 @@ -/* - * henv.ci - * - * $Id: henv.ci 1446 1999-01-22 10:52:42Z RR $ - * - * Function names - * - * The iODBC driver manager. - * - * Copyright (C) 1995 by Ke Jin - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -/* There are some exceptions : - * on FreeBSD 2.x CLI_NAME_PREFIX is defined in Config.mk as "_SQL" - * on HP/UX s300/s400, CLI_NAME_PREFIX is defined in Config.mk as "_SQL" - * on AIX 3.x 4.x, CLI_NAME_PREFIX is defined in Config.mk as ".SQL" - */ -#ifndef CLI_NAME_PREFIX -# define CLI_NAME_PREFIX "SQL" /* using call by value prefix */ -#else -# ifdef NEED_USCORE -# define CLI_NAME_PREFIX "_SQL" -# endif -#endif - -static struct - { - int en_idx; - char *symbol; - } -odbcapi_symtab[] = { - -#if (ODBCVER >= 0x0300) - { en_AllocHandle CLI_NAME_PREFIX "AllocHandle" }, - { en_FreeHandle CLI_NAME_PREFIX "FreeHandle" }, -#endif - { en_AllocEnv, CLI_NAME_PREFIX "AllocEnv" }, - { en_AllocConnect, CLI_NAME_PREFIX "AllocConnect" }, - { en_Connect, CLI_NAME_PREFIX "Connect" }, - { en_DriverConnect, CLI_NAME_PREFIX "DriverConnect" }, - { en_BrowseConnect, CLI_NAME_PREFIX "BrowseConnect" }, - - { en_DataSources, CLI_NAME_PREFIX "DataSources" }, - { en_Drivers, CLI_NAME_PREFIX "Driver" }, - { en_GetInfo, CLI_NAME_PREFIX "GetInfo" }, - { en_GetFunctions, CLI_NAME_PREFIX "GetFunctions" }, - { en_GetTypeInfo, CLI_NAME_PREFIX "GetTypeInfo" }, - - { en_SetConnectOption, CLI_NAME_PREFIX "SetConnectOption" }, - { en_GetConnectOption, CLI_NAME_PREFIX "GetConnectOption" }, - { en_SetStmtOption, CLI_NAME_PREFIX "SetStmtOption" }, - { en_GetStmtOption, CLI_NAME_PREFIX "GetStmtOption" }, - - { en_AllocStmt, CLI_NAME_PREFIX "AllocStmt" }, - { en_Prepare, CLI_NAME_PREFIX "Prepare" }, - { en_BindParameter, CLI_NAME_PREFIX "BindParameter" }, - { en_ParamOptions, CLI_NAME_PREFIX "ParamOptions" }, - { en_GetCursorName, CLI_NAME_PREFIX "GetCursorName" }, - { en_SetCursorName, CLI_NAME_PREFIX "SetCursorName" }, - { en_SetScrollOptions, CLI_NAME_PREFIX "SetScrollOptions" }, - { en_SetParam, CLI_NAME_PREFIX "SetParam" }, - - { en_Execute, CLI_NAME_PREFIX "Execute" }, - { en_ExecDirect, CLI_NAME_PREFIX "ExecDirect" }, - { en_NativeSql, CLI_NAME_PREFIX "NativeSql" }, - { en_DescribeParam, CLI_NAME_PREFIX "DescribeParam" }, - { en_NumParams, CLI_NAME_PREFIX "NumParams" }, - { en_ParamData, CLI_NAME_PREFIX "ParamData" }, - { en_PutData, CLI_NAME_PREFIX "PutData" }, - - { en_RowCount, CLI_NAME_PREFIX "RowCount" }, - { en_NumResultCols, CLI_NAME_PREFIX "NumResultCols" }, - { en_DescribeCol, CLI_NAME_PREFIX "DescribeCol" }, - { en_ColAttributes, CLI_NAME_PREFIX "ColAttributes" }, - { en_BindCol, CLI_NAME_PREFIX "BindCol" }, - { en_Fetch, CLI_NAME_PREFIX "Fetch" }, - { en_ExtendedFetch, CLI_NAME_PREFIX "ExtendedFetch" }, - { en_GetData, CLI_NAME_PREFIX "GetData" }, - { en_SetPos, CLI_NAME_PREFIX "SetPos" }, - { en_MoreResults, CLI_NAME_PREFIX "MoreResults" }, - { en_Error, CLI_NAME_PREFIX "Error" }, - - { en_ColumnPrivileges, CLI_NAME_PREFIX "ColumnPrivileges" }, - { en_Columns, CLI_NAME_PREFIX "Columns" }, - { en_ForeignKeys, CLI_NAME_PREFIX "ForeignKeys" }, - { en_PrimaryKeys, CLI_NAME_PREFIX "PrimaryKeys" }, - { en_ProcedureColumns, CLI_NAME_PREFIX "ProcedureColumns" }, - { en_Procedures, CLI_NAME_PREFIX "Procedures" }, - { en_SpecialColumns, CLI_NAME_PREFIX "SpecialColumns" }, - { en_Statistics, CLI_NAME_PREFIX "Statistics" }, - { en_TablePrivileges, CLI_NAME_PREFIX "TablePrivileges" }, - { en_Tables, CLI_NAME_PREFIX "Tables" }, - - { en_FreeStmt, CLI_NAME_PREFIX "FreeStmt" }, - { en_Cancel, CLI_NAME_PREFIX "Cancel" }, - { en_Transact, CLI_NAME_PREFIX "Transact" }, - - { en_Disconnect, CLI_NAME_PREFIX "Disconnect" }, - { en_FreeConnect, CLI_NAME_PREFIX "FreeConnect" }, - { en_FreeEnv, CLI_NAME_PREFIX "FreeEnv" }, - - { en_NullProc, NULL } -}; diff --git a/wxWidgets/src/iodbc/henv.h b/wxWidgets/src/iodbc/henv.h deleted file mode 100644 index 1a6a55bd4d..0000000000 --- a/wxWidgets/src/iodbc/henv.h +++ /dev/null @@ -1,160 +0,0 @@ -/* - * henv.h - * - * $Id: henv.h 2613 1999-06-01 15:32:12Z VZ $ - * - * Environment object management functions - * - * The iODBC driver manager. - * - * Copyright (C) 1995 by Ke Jin - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ -#ifndef _HENV_H -#define _HENV_H - -#include "config.h" -#include "dlproc.h" - -#include "isql.h" -#include "isqlext.h" - -#ifndef SYSERR -#define SYSERR -1 -#endif - -enum - { - -#if (ODBCVER >= 0x0300) - en_AllocHandle = SQL_API_SQLALLOCHANDLE, - en_FreeHandle = SQL_API_SQLFREEHANDLE, -#endif - - en_AllocEnv = SQL_API_SQLALLOCENV, - en_AllocConnect = SQL_API_SQLALLOCCONNECT, - en_Connect = SQL_API_SQLCONNECT, - en_DriverConnect = SQL_API_SQLDRIVERCONNECT, - en_BrowseConnect = SQL_API_SQLBROWSECONNECT, - - en_DataSources = SQL_API_SQLDATASOURCES, - en_Drivers = SQL_API_SQLDRIVERS, - en_GetInfo = SQL_API_SQLGETINFO, - en_GetFunctions = SQL_API_SQLGETFUNCTIONS, - en_GetTypeInfo = SQL_API_SQLGETTYPEINFO, - - en_SetConnectOption = SQL_API_SQLSETCONNECTOPTION, - en_GetConnectOption = SQL_API_SQLGETCONNECTOPTION, - en_SetStmtOption = SQL_API_SQLSETSTMTOPTION, - en_GetStmtOption = SQL_API_SQLGETSTMTOPTION, - - en_AllocStmt = SQL_API_SQLALLOCSTMT, - en_Prepare = SQL_API_SQLPREPARE, - en_BindParameter = SQL_API_SQLBINDPARAMETER, - en_ParamOptions = SQL_API_SQLPARAMOPTIONS, - en_GetCursorName = SQL_API_SQLGETCURSORNAME, - en_SetCursorName = SQL_API_SQLSETCURSORNAME, - en_SetScrollOptions = SQL_API_SQLSETSCROLLOPTIONS, - en_SetParam = SQL_API_SQLSETPARAM, - - en_Execute = SQL_API_SQLEXECUTE, - en_ExecDirect = SQL_API_SQLEXECDIRECT, - en_NativeSql = SQL_API_SQLNATIVESQL, - en_DescribeParam = SQL_API_SQLDESCRIBEPARAM, - en_NumParams = SQL_API_SQLNUMPARAMS, - en_ParamData = SQL_API_SQLPARAMDATA, - en_PutData = SQL_API_SQLPUTDATA, - - en_RowCount = SQL_API_SQLROWCOUNT, - en_NumResultCols = SQL_API_SQLNUMRESULTCOLS, - en_DescribeCol = SQL_API_SQLDESCRIBECOL, - en_ColAttributes = SQL_API_SQLCOLATTRIBUTES, - en_BindCol = SQL_API_SQLBINDCOL, - en_Fetch = SQL_API_SQLFETCH, - en_ExtendedFetch = SQL_API_SQLEXTENDEDFETCH, - en_GetData = SQL_API_SQLGETDATA, - en_SetPos = SQL_API_SQLSETPOS, - en_MoreResults = SQL_API_SQLMORERESULTS, - en_Error = SQL_API_SQLERROR, - - en_ColumnPrivileges = SQL_API_SQLCOLUMNPRIVILEGES, - en_Columns = SQL_API_SQLCOLUMNS, - en_ForeignKeys = SQL_API_SQLFOREIGNKEYS, - en_PrimaryKeys = SQL_API_SQLPRIMARYKEYS, - en_ProcedureColumns = SQL_API_SQLPROCEDURECOLUMNS, - en_Procedures = SQL_API_SQLPROCEDURES, - en_SpecialColumns = SQL_API_SQLSPECIALCOLUMNS, - en_Statistics = SQL_API_SQLSTATISTICS, - en_TablePrivileges = SQL_API_SQLTABLEPRIVILEGES, - en_Tables = SQL_API_SQLTABLES, - - en_FreeStmt = SQL_API_SQLFREESTMT, - en_Cancel = SQL_API_SQLCANCEL, - en_Transact = SQL_API_SQLTRANSACT, - - en_Disconnect = SQL_API_SQLDISCONNECT, - en_FreeConnect = SQL_API_SQLFREECONNECT, - en_FreeEnv = SQL_API_SQLFREEENV, - - en_NullProc = SYSERR - }; - -typedef struct - { - int type; /* must be 1st field */ - - HENV henv; /* driver's env list */ - HDBC hdbc; /* driver's dbc list */ - HERR herr; /* err list */ - int state; - } -GENV_t; - -typedef struct - { - HENV next; /* next attached env handle */ - int refcount; /* Driver's bookkeeping reference count */ - HPROC dllproc_tab[SQL_EXT_API_LAST + 1]; /* driver api calls */ - - HENV dhenv; /* driver env handle */ - HDLL hdll; /* drvier share library handle */ - } -ENV_t; - -/* Note: - - * - ODBC applications only know about global environment handle, - * a void pointer points to a GENV_t object. There is only one - * this object per process(however, to make the library reentrant, - * we still keep this object on heap). Applications only know - * address of this object and needn't care about its detail. - * - * - ODBC driver manager knows about instance environment handles, - * void pointers point to ENV_t objects. There are maybe more - * than one this kind of objects per process. However, multiple - * connections to a same data source(i.e. call same share library) - * will share one instance environment object. - * - * - ODBC drvier manager knows about their own environemnt handle, - * a void pointer point to a driver defined object. Every driver - * keeps one of its own environment object and driver manager - * keeps address of it by the 'dhenv' field in the instance - * environment object without care about its detail. - * - * - Applications can get driver's environment object handle by - * SQLGetInfo() with fInfoType equals to SQL_DRIVER_HENV - */ -#endif diff --git a/wxWidgets/src/iodbc/herr.c b/wxWidgets/src/iodbc/herr.c deleted file mode 100644 index 7e66893304..0000000000 --- a/wxWidgets/src/iodbc/herr.c +++ /dev/null @@ -1,378 +0,0 @@ -/* - * herr.c - * - * $Id: herr.c 2613 1999-06-01 15:32:12Z VZ $ - * - * Error stack management functions - * - * The iODBC driver manager. - * - * Copyright (C) 1995 by Ke Jin - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -#include "config.h" - -#include "isql.h" -#include "isqlext.h" - -#include "dlproc.h" - -#include "herr.h" -#include "henv.h" -#include "hdbc.h" -#include "hstmt.h" - -#include "itrace.h" - -#include "herr.ci" - -static HERR -_iodbcdm_popsqlerr (HERR herr) -{ - sqlerr_t *list = (sqlerr_t *) herr; - sqlerr_t *next; - - if (herr == SQL_NULL_HERR) - { - return herr; - } - - next = list->next; - - MEM_FREE (list); - - return next; -} - - -void -_iodbcdm_freesqlerrlist (HERR herrlist) -{ - HERR list; - - for (list = herrlist; list != 0;) - { - list = _iodbcdm_popsqlerr (list); - } -} - - -HERR -_iodbcdm_pushsqlerr ( - HERR herr, - sqlstcode_t code, - char *msg) -{ - sqlerr_t *ebuf; - sqlerr_t *perr = (sqlerr_t *) herr; - int idx = 0; - - if (herr != SQL_NULL_HERR) - { - idx = perr->idx + 1; - } - - if (idx == 64) - /* over wirte the top entry to prevent error stack blow out */ - { - perr->code = code; - perr->msg = msg; - - return herr; - } - - ebuf = (sqlerr_t *) MEM_ALLOC (sizeof (sqlerr_t)); - - if (ebuf == NULL) - { - return NULL; - } - - ebuf->msg = msg; - ebuf->code = code; - ebuf->idx = idx; - ebuf->next = (sqlerr_t *) herr; - - return (HERR) ebuf; -} - - -static char FAR * -_iodbcdm_getsqlstate ( - HERR herr, - void FAR * tab) -{ - sqlerr_t *perr = (sqlerr_t *) herr; - sqlerrmsg_t *ptr; - - if (herr == SQL_NULL_HERR || tab == NULL) - { - return (char FAR *) NULL; - } - - for (ptr = tab; - ptr->code != en_sqlstat_total; - ptr++) - { - if (ptr->code == perr->code) - { - return (char FAR *) (ptr->stat); - } - } - - return (char FAR *) NULL; -} - - -static char FAR * -_iodbcdm_getsqlerrmsg ( - HERR herr, - void FAR * errtab) -{ - sqlerr_t *perr = (sqlerr_t *) herr; - sqlerrmsg_t *ptr; - - if (herr == SQL_NULL_HERR) - { - return NULL; - } - - if (perr->msg == NULL && errtab == NULL) - { - return NULL; - } - - if (perr->msg != NULL) - { - return perr->msg; - } - - for (ptr = (sqlerrmsg_t *) errtab; - ptr->code != en_sqlstat_total; - ptr++) - { - if (ptr->code == perr->code) - { - return (char FAR *) ptr->msg; - } - } - - return (char FAR *) NULL; -} - - -RETCODE SQL_API -SQLError ( - HENV henv, - HDBC hdbc, - HSTMT hstmt, - UCHAR FAR * szSqlstate, - SDWORD FAR * pfNativeError, - UCHAR FAR * szErrorMsg, - SWORD cbErrorMsgMax, - SWORD FAR * pcbErrorMsg) -{ - GENV_t FAR *genv = (GENV_t FAR *) henv; - DBC_t FAR *pdbc = (DBC_t FAR *) hdbc; - STMT_t FAR *pstmt = (STMT_t FAR *) hstmt; - HDBC thdbc; - - HENV dhenv = SQL_NULL_HENV; - HDBC dhdbc = SQL_NULL_HDBC; - HSTMT dhstmt = SQL_NULL_HSTMT; - - HERR herr = SQL_NULL_HERR; - HPROC hproc = SQL_NULL_HPROC; - - char FAR *errmsg = NULL; - char FAR *ststr = NULL; - - int handle = 0; - RETCODE retcode = SQL_SUCCESS; - - if (hstmt != SQL_NULL_HSTMT) /* retrive stmt err */ - { - herr = pstmt->herr; - thdbc = pstmt->hdbc; - - if (thdbc == SQL_NULL_HDBC) - { - return SQL_INVALID_HANDLE; - } - hproc = _iodbcdm_getproc (thdbc, en_Error); - dhstmt = pstmt->dhstmt; - handle = 3; - } - else if (hdbc != SQL_NULL_HDBC) /* retrive dbc err */ - { - herr = pdbc->herr; - thdbc = hdbc; - if (thdbc == SQL_NULL_HDBC) - { - return SQL_INVALID_HANDLE; - } - hproc = _iodbcdm_getproc (thdbc, en_Error); - dhdbc = pdbc->dhdbc; - handle = 2; - - if (herr == SQL_NULL_HERR - && pdbc->henv == SQL_NULL_HENV) - { - return SQL_NO_DATA_FOUND; - } - } - else if (henv != SQL_NULL_HENV) /* retrive env err */ - { - herr = genv->herr; - - /* Drivers shouldn't push error message - * on envoriment handle */ - - if (herr == SQL_NULL_HERR) - { - return SQL_NO_DATA_FOUND; - } - - handle = 1; - } - else - { - return SQL_INVALID_HANDLE; - } - - if (szErrorMsg != NULL) - { - if (cbErrorMsgMax < 0 - || cbErrorMsgMax > SQL_MAX_MESSAGE_LENGTH - 1) - { - return SQL_ERROR; - /* SQLError() doesn't post error for itself */ - } - } - - if (herr == SQL_NULL_HERR) /* no err on drv mng */ - { - /* call driver */ - if (hproc == SQL_NULL_HPROC) - { - PUSHSQLERR (herr, en_IM001); - - return SQL_ERROR; - } - - CALL_DRIVER (thdbc, retcode, hproc, en_Error, - (dhenv, dhdbc, dhstmt, szSqlstate, pfNativeError, szErrorMsg, - cbErrorMsgMax, pcbErrorMsg)) - - return retcode; - } - - if (szSqlstate != NULL) - { - int len; - - /* get sql state string */ - ststr = (char FAR *) _iodbcdm_getsqlstate (herr, - (void FAR *) sqlerrmsg_tab); - - if (ststr == NULL) - { - len = 0; - } - else - { - len = (int) STRLEN (ststr); - } - - STRNCPY (szSqlstate, ststr, len); - szSqlstate[len] = 0; - /* buffer size of szSqlstate is not checked. Applications - * suppose provide enough ( not less than 6 bytes ) buffer - * or NULL for it. - */ - } - - if (pfNativeError != NULL) - { - /* native error code is specific to data source */ - *pfNativeError = (SDWORD) 0L; - } - - if (szErrorMsg == NULL || cbErrorMsgMax == 0) - { - if (pcbErrorMsg != NULL) - { - *pcbErrorMsg = (SWORD) 0; - } - } - else - { - int len; - char msgbuf[256] = {'\0'}; - - /* get sql state message */ - errmsg = _iodbcdm_getsqlerrmsg (herr, (void FAR *) sqlerrmsg_tab); - - if (errmsg == NULL) - { - errmsg = (char FAR *) ""; - } - - sprintf (msgbuf, "%s%s", sqlerrhd, errmsg); - - len = STRLEN (msgbuf); - - if (len < cbErrorMsgMax - 1) - { - retcode = SQL_SUCCESS; - } - else - { - len = cbErrorMsgMax - 1; - retcode = SQL_SUCCESS_WITH_INFO; - /* and not posts error for itself */ - } - - STRNCPY ((char *) szErrorMsg, msgbuf, len); - szErrorMsg[len] = 0; - - if (pcbErrorMsg != NULL) - { - *pcbErrorMsg = (SWORD) len; - } - } - - switch (handle) /* free this err */ - { - case 1: - genv->herr = _iodbcdm_popsqlerr (genv->herr); - break; - - case 2: - pdbc->herr = _iodbcdm_popsqlerr (pdbc->herr); - break; - - case 3: - pstmt->herr = _iodbcdm_popsqlerr (pstmt->herr); - break; - - default: - break; - } - - return retcode; -} diff --git a/wxWidgets/src/iodbc/herr.ci b/wxWidgets/src/iodbc/herr.ci deleted file mode 100644 index eb9f04e8a0..0000000000 --- a/wxWidgets/src/iodbc/herr.ci +++ /dev/null @@ -1,124 +0,0 @@ -/* - * herr.ci - * - * $Id: herr.ci 1446 1999-01-22 10:52:42Z RR $ - * - * Error messages - * - * The iODBC driver manager. - * - * Copyright (C) 1995 by Ke Jin - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -static const sqlerrmsg_t sqlerrmsg_tab[] = -{ - { en_00000, "00000", "" }, - { en_01000, "01000", "General warning" }, - { en_01002, "01002", "Disconnect error" }, - { en_01004, "01004", "Data truncated" }, - { en_01006, "01006", "Privilege not revoked" }, - { en_01S00, "01S00", "Invalid connection string attribute" }, - { en_01S01, "01S01", "Error in row" }, - { en_01S02, "01S02", "Optional value changed" }, - { en_01S03, "01S03", "No rows updated or deleted" }, - { en_01S04, "01S04", "More than one row updated or deleted" }, - { en_07001, "07001", "Wrong number of parameters" }, - { en_07006, "07006", "Restricted data type attribute violation" }, - { en_08001, "08001", "Unable to connect to data source" }, - { en_08002, "08002", "Connection in use" }, - { en_08003, "08003", "Connect not open" }, - { en_08004, "08004", "Data source rejected establishment of connection" }, - { en_08007, "08007", "Connection failure during transaction" }, - { en_08S01, "08S01", "Communication link failure" }, - { en_21S01, "21S01", "Insert value list does not match" }, - { en_21S02, "21S02", "Degree of derived table does not match column list" }, - { en_22001, "22001", "String data right truncation" }, - { en_22003, "22003", "Numeric value out of range" }, - { en_22005, "22005", "Error in assignment" }, - { en_22008, "22008", "Datetime field overflow" }, - { en_22012, "22012", "Division by zero" }, - { en_22026, "22026", "String data, length mismatch" }, - { en_23000, "23000", "Integrity constraint violation" }, - { en_24000, "24000", "Invalid cursor state" }, - { en_25000, "25000", "Invalid transaction state" }, - { en_28000, "28000", "Invalid authorization specification" }, - { en_34000, "34000", "Invalid cursor name" }, - { en_37000, "37000", "Syntex error or access violation" }, - { en_3C000, "3C000", "Duplicate cursor name" }, - { en_40001, "40001", "Serialization failure" }, - { en_42000, "42000", "Syntax error or access violation" }, - { en_70100, "70100", "Operation aborted" }, - { en_IM001, "IM001", "Driver does not support this function" }, - { en_IM002, "IM002", "Data source name not found and no default " - "driver specified. Driver could not be loaded" }, - { en_IM003, "IM003", "Specified driver could not be loaded" }, - { en_IM004, "IM004", "Driver's SQLAllocEnv() failed" }, - { en_IM005, "IM005", "Driver's SQLAllocConnect() failed" }, - { en_IM006, "IM006", "Driver's SQLSetConnectOption failed" }, - { en_IM007, "IM007", "No data source or driver specified, dialog prohibited" }, - { en_IM008, "IM008", "Dialog failed" }, - { en_IM009, "IM009", "Unable to load translation DLL" }, - { en_IM010, "IM010", "Data source name too long" }, - { en_IM011, "IM011", "Driver name too long" }, - { en_IM012, "IM012", "DRIVER keyword syntax error" }, - { en_IM013, "IM013", "Trace file error" }, - { en_IM014, "IM014", "Try to change tracing file while tracing is on" }, - { en_S0001, "S0001", "Base table or view already exists" }, - { en_S0002, "S0002", "Base table not found" }, - { en_S0011, "S0011", "Index already exists" }, - { en_S0012, "S0012", "Index not found" }, - { en_S0021, "S0021", "Column already exists" }, - { en_S0022, "S0022", "Column not found" }, - { en_S0023, "S0023", "No default for column" }, - { en_S1000, "S1000", "General error" }, - { en_S1001, "S1001", "Memory allocation failure" }, - { en_S1002, "S1002", "Invalid column number" }, - { en_S1003, "S1003", "Program type out of range" }, - { en_S1004, "S1004", "SQL data type out of range" }, - { en_S1008, "S1008", "Operation canceled" }, - { en_S1009, "S1009", "Invalid argument value" }, - { en_S1010, "S1010", "Function sequence error" }, - { en_S1011, "S1011", "Operation invalid at this time" }, - { en_S1012, "S1012", "Invalid transaction operation code specified" }, - { en_S1015, "S1015", "No cursor name available" }, - { en_S1090, "S1090", "Invalid string or buffer length" }, - { en_S1091, "S1091", "Descriptor type out of range" }, - { en_S1092, "S1092", "Option type out of range" }, - { en_S1093, "S1093", "Invalid parameter" }, - { en_S1094, "S1094", "Invalid scale value" }, - { en_S1095, "S1095", "Function type out of range" }, - { en_S1096, "S1096", "Information type out of range" }, - { en_S1097, "S1097", "Column type out of range" }, - { en_S1098, "S1098", "Scope type out of range" }, - { en_S1099, "S1099", "Nullable type out of range" }, - { en_S1100, "S1100", "Uniquenss option type out of range" }, - { en_S1101, "S1101", "Accuracy option type out of range" }, - { en_S1103, "S1103", "Direction option out of range" }, - { en_S1104, "S1104", "Invalid precision value" }, - { en_S1105, "S1105", "Invalid parameter type" }, - { en_S1106, "S1106", "Fetch type out of range" }, - { en_S1107, "S1107", "Row value out of range" }, - { en_S1108, "S1108", "Concurrency option out of range" }, - { en_S1109, "S1109", "Invalid cursor position" }, - { en_S1110, "S1110", "Invalid driver completion" }, - { en_S1111, "S1111", "Invalid bookmark value" }, - { en_S1C00, "S1C00", "Driver not capable" }, - { en_S1T00, "S1T00", "Timeout expired" }, - { en_sqlstat_total, NULL, NULL } -}; - -static char FAR* sqlerrhd = "[iODBC][Driver Manager]"; diff --git a/wxWidgets/src/iodbc/herr.h b/wxWidgets/src/iodbc/herr.h deleted file mode 100644 index 5865b4496b..0000000000 --- a/wxWidgets/src/iodbc/herr.h +++ /dev/null @@ -1,153 +0,0 @@ -/* - * herr.h - * - * $Id: herr.h 1446 1999-01-22 10:52:42Z RR $ - * - * Error stack management functions - * - * The iODBC driver manager. - * - * Copyright (C) 1995 by Ke Jin - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ -#ifndef _HERR_H -#define _HERR_H - -typedef enum - { - en_00000 = 0, - en_01000, - en_01002, - en_01004, - en_01006, - en_01S00, - en_01S01, - en_01S02, - en_01S03, - en_01S04, - en_07001, - en_07006, - en_08001, - en_08002, - en_08003, - en_08004, - en_08007, - en_08S01, - en_21S01, - en_21S02, - en_22001, - en_22003, - en_22005, - en_22008, - en_22012, - en_22026, - en_23000, - en_24000, - en_25000, - en_28000, - en_34000, - en_37000, - en_3C000, - en_40001, - en_42000, - en_70100, - en_IM001, - en_IM002, - en_IM003, - en_IM004, - en_IM005, - en_IM006, - en_IM007, - en_IM008, - en_IM009, - en_IM010, - en_IM011, - en_IM012, - en_IM013, - en_IM014, - en_S0001, - en_S0002, - en_S0011, - en_S0012, - en_S0021, - en_S0022, - en_S0023, - en_S1000, - en_S1001, - en_S1002, - en_S1003, - en_S1004, - en_S1008, - en_S1009, - en_S1010, - en_S1011, - en_S1012, - en_S1015, - en_S1090, - en_S1091, - en_S1092, - en_S1093, - en_S1094, - en_S1095, - en_S1096, - en_S1097, - en_S1098, - en_S1099, - en_S1100, - en_S1101, - en_S1103, - en_S1104, - en_S1105, - en_S1106, - en_S1107, - en_S1108, - en_S1109, - en_S1110, - en_S1111, - en_S1C00, - en_S1T00, - en_sqlstat_total - } -sqlstcode_t; - -typedef void FAR *HERR; -#define SQL_NULL_HERR ((HERR)NULL) - -typedef struct - { - sqlstcode_t code; - char FAR *stat; - char FAR *msg; - } -sqlerrmsg_t; - -typedef struct sqlerr - { - sqlstcode_t code; - int idx; - char FAR *msg; - struct sqlerr *next; - } -sqlerr_t; - -extern void _iodbcdm_freesqlerrlist (HERR herr); -extern HERR _iodbcdm_pushsqlerr (HERR list, sqlstcode_t code, char *sysmsg); - -#define PUSHSYSERR(list, msg) \ - list = (HERR)_iodbcdm_pushsqlerr( (HERR)(list), 0, (char*)msg ) -#define PUSHSQLERR(list, code) \ - list = (HERR)_iodbcdm_pushsqlerr( (HERR)(list), (int)(code), NULL ) -#endif /* _SQLERR_H */ diff --git a/wxWidgets/src/iodbc/hstmt.c b/wxWidgets/src/iodbc/hstmt.c deleted file mode 100644 index 01f17a19ba..0000000000 --- a/wxWidgets/src/iodbc/hstmt.c +++ /dev/null @@ -1,600 +0,0 @@ -/* - * hstmt.c - * - * $Id: hstmt.c 2613 1999-06-01 15:32:12Z VZ $ - * - * Query statement object management functions - * - * The iODBC driver manager. - * - * Copyright (C) 1995 by Ke Jin - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -#include "config.h" - -#include "isql.h" -#include "isqlext.h" - -#include "dlproc.h" - -#include "herr.h" -#include "henv.h" -#include "hdbc.h" -#include "hstmt.h" - -#include "itrace.h" - -RETCODE SQL_API -SQLAllocStmt ( - HDBC hdbc, - HSTMT FAR * phstmt) -{ - DBC_t FAR *pdbc = (DBC_t FAR *) hdbc; - STMT_t FAR *pstmt = NULL; - HPROC hproc = SQL_NULL_HPROC; - RETCODE retcode = SQL_SUCCESS; - -#if (ODBCVER >= 0x0300) - if (hdbc == SQL_NULL_HDBC || pdbc->type != SQL_HANDLE_DBC) -#else - if (hdbc == SQL_NULL_HDBC) -#endif - { - return SQL_INVALID_HANDLE; - } - - if (phstmt == NULL) - { - PUSHSQLERR (pdbc->herr, en_S1009); - - return SQL_ERROR; - } - - /* check state */ - switch (pdbc->state) - { - case en_dbc_connected: - case en_dbc_hstmt: - break; - - case en_dbc_allocated: - case en_dbc_needdata: - PUSHSQLERR (pdbc->herr, en_08003); - *phstmt = SQL_NULL_HSTMT; - return SQL_ERROR; - - default: - return SQL_INVALID_HANDLE; - } - - pstmt = (STMT_t FAR *) MEM_ALLOC (sizeof (STMT_t)); - - if (pstmt == NULL) - { - PUSHSQLERR (pdbc->herr, en_S1001); - *phstmt = SQL_NULL_HSTMT; - - return SQL_ERROR; - } - -#if (ODBCVER >= 0x0300) - pstmt->type = SQL_HANDLE_STMT; -#endif - - /* initiate the object */ - pstmt->herr = SQL_NULL_HERR; - pstmt->hdbc = hdbc; - pstmt->state = en_stmt_allocated; - pstmt->cursor_state = en_stmt_cursor_no; - pstmt->prep_state = 0; - pstmt->asyn_on = en_NullProc; - pstmt->need_on = en_NullProc; - - /* call driver's function */ - -#if (ODBCVER >= 0x0300) - hproc = _iodbcdm_getproc (hdbc, en_AllocHandle); - - if (hproc) - { - CALL_DRIVER (pstmt->hdbc, hdbc, retcode, hproc, en_AllocHandle, - (SQL_HANDLE_STMT, pdbc->dhdbc, &(pstmt->dhstmt))) - } - else -#endif - - { - hproc = _iodbcdm_getproc (hdbc, en_AllocStmt); - - if (hproc == SQL_NULL_HPROC) - { - PUSHSQLERR (pstmt->herr, en_IM001); - *phstmt = SQL_NULL_HSTMT; - MEM_FREE (pstmt); - - return SQL_ERROR; - } - - CALL_DRIVER (hdbc, retcode, hproc, en_AllocStmt, - (pdbc->dhdbc, &(pstmt->dhstmt))) - } - - if (retcode != SQL_SUCCESS && retcode != SQL_SUCCESS_WITH_INFO) - { - *phstmt = SQL_NULL_HSTMT; - MEM_FREE (pstmt); - - return retcode; - } - - /* insert into list */ - pstmt->next = pdbc->hstmt; - pdbc->hstmt = pstmt; - - *phstmt = (HSTMT) pstmt; - - /* state transition */ - pdbc->state = en_dbc_hstmt; - - return SQL_SUCCESS; -} - - -RETCODE -_iodbcdm_dropstmt (HSTMT hstmt) -{ - STMT_t FAR *pstmt = (STMT_t FAR *) hstmt; - STMT_t FAR *tpstmt; - DBC_t FAR *pdbc; - - if (hstmt == SQL_NULL_HSTMT) - { - return SQL_INVALID_HANDLE; - } - - pdbc = (DBC_t FAR *) (pstmt->hdbc); - - for (tpstmt = (STMT_t FAR *) pdbc->hstmt; - tpstmt != NULL; - tpstmt = tpstmt->next) - { - if (tpstmt == pstmt) - { - pdbc->hstmt = (HSTMT) pstmt->next; - break; - } - - if (tpstmt->next == pstmt) - { - tpstmt->next = pstmt->next; - break; - } - } - - if (tpstmt == NULL) - { - return SQL_INVALID_HANDLE; - } - - _iodbcdm_freesqlerrlist (pstmt->herr); - MEM_FREE (hstmt); - - return SQL_SUCCESS; -} - - -RETCODE SQL_API -SQLFreeStmt ( - HSTMT hstmt, - UWORD fOption) -{ - STMT_t FAR *pstmt = (STMT_t FAR *) hstmt; - STMT_t FAR *tpstmt; - DBC_t FAR *pdbc; - - HPROC hproc = SQL_NULL_HPROC; - RETCODE retcode; - - if (hstmt == SQL_NULL_HSTMT || pstmt->hdbc == SQL_NULL_HDBC) - { - return SQL_INVALID_HANDLE; - } - - pdbc = (DBC_t FAR *) (pstmt->hdbc); - - /* check option */ - switch (fOption) - { - case SQL_DROP: - case SQL_CLOSE: - case SQL_UNBIND: - case SQL_RESET_PARAMS: - break; - - default: - PUSHSQLERR (pstmt->herr, en_S1092); - return SQL_ERROR; - } - - /* check state */ - if (pstmt->state >= en_stmt_needdata || pstmt->asyn_on != en_NullProc) - { - PUSHSQLERR (pstmt->herr, en_S1010); - - return SQL_ERROR; - } - - hproc = SQL_NULL_HPROC; - -#if (ODBCVER >= 0x0300) - if (fOption == SQL_DROP) - { - hproc = _iodbcdm_getproc (pstmt->hdbc, en_FreeHandle); - - if (hproc) - { - CALL_DRIVER (pstmt->hdbc, retcode, hproc, en_FreeHandle, - (SQL_HANDLE_STMT, pstmt->dhstmt)) - } - } -#endif - - if (hproc == SQL_NULL_HPROC) - { - hproc = _iodbcdm_getproc (pstmt->hdbc, en_FreeStmt); - - if (hproc == SQL_NULL_HPROC) - { - PUSHSQLERR (pstmt->herr, en_IM001); - - return SQL_ERROR; - } - - CALL_DRIVER (pstmt->hdbc, retcode, hproc, en_FreeStmt, - (pstmt->dhstmt, fOption)) - } - - if (retcode != SQL_SUCCESS - && retcode != SQL_SUCCESS_WITH_INFO) - { - return retcode; - } - - /* state transition */ - switch (fOption) - { - case SQL_DROP: - /* delet this object (ignore return) */ - _iodbcdm_dropstmt (hstmt); - break; - - case SQL_CLOSE: - pstmt->cursor_state = en_stmt_cursor_no; - /* This means cursor name set by - * SQLSetCursorName() call will also - * be erased. - */ - - switch (pstmt->state) - { - case en_stmt_allocated: - case en_stmt_prepared: - break; - - case en_stmt_executed: - case en_stmt_cursoropen: - case en_stmt_fetched: - case en_stmt_xfetched: - if (pstmt->prep_state) - { - pstmt->state = - en_stmt_prepared; - } - else - { - pstmt->state = - en_stmt_allocated; - } - break; - - default: - break; - } - break; - - case SQL_UNBIND: - case SQL_RESET_PARAMS: - default: - break; - } - - return retcode; -} - - -RETCODE SQL_API -SQLSetStmtOption ( - HSTMT hstmt, - UWORD fOption, - UDWORD vParam) -{ - STMT_t FAR *pstmt = (STMT_t FAR *) hstmt; - HPROC hproc; - int sqlstat = en_00000; - RETCODE retcode; - - if (hstmt == SQL_NULL_HSTMT || pstmt->hdbc == SQL_NULL_HDBC) - { - return SQL_INVALID_HANDLE; - } - - /* check option */ - if ( /* fOption < SQL_STMT_OPT_MIN || */ - fOption > SQL_STMT_OPT_MAX) - { - PUSHSQLERR (pstmt->herr, en_S1092); - - return SQL_ERROR; - } - - if (fOption == SQL_CONCURRENCY - || fOption == SQL_CURSOR_TYPE - || fOption == SQL_SIMULATE_CURSOR - || fOption == SQL_USE_BOOKMARKS) - { - if (pstmt->asyn_on != en_NullProc) - { - if (pstmt->prep_state) - { - sqlstat = en_S1011; - } - } - else - { - switch (pstmt->state) - { - case en_stmt_prepared: - sqlstat = en_S1011; - break; - - case en_stmt_executed: - case en_stmt_cursoropen: - case en_stmt_fetched: - case en_stmt_xfetched: - sqlstat = en_24000; - break; - - case en_stmt_needdata: - case en_stmt_mustput: - case en_stmt_canput: - if (pstmt->prep_state) - { - sqlstat = en_S1011; - } - break; - - default: - break; - } - } - } - else - { - if (pstmt->asyn_on != en_NullProc) - { - if (!pstmt->prep_state) - { - sqlstat = en_S1010; - } - } - else - { - if (pstmt->state >= en_stmt_needdata) - { - sqlstat = en_S1010; - } - } - } - - if (sqlstat != en_00000) - { - PUSHSQLERR (pstmt->herr, sqlstat); - - return SQL_ERROR; - } - - hproc = _iodbcdm_getproc (pstmt->hdbc, en_SetStmtOption); - - if (hproc == SQL_NULL_HPROC) - { - PUSHSQLERR (pstmt->herr, en_IM001); - - return SQL_ERROR; - } - - CALL_DRIVER (pstmt->hdbc, retcode, hproc, en_SetStmtOption, - (pstmt->dhstmt, fOption, vParam)) - - return retcode; -} - - -RETCODE SQL_API -SQLGetStmtOption ( - HSTMT hstmt, - UWORD fOption, - PTR pvParam) -{ - STMT_t FAR *pstmt = (STMT_t *) hstmt; - HPROC hproc; - int sqlstat = en_00000; - RETCODE retcode; - - if (hstmt == SQL_NULL_HSTMT || pstmt->hdbc == SQL_NULL_HDBC) - { - return SQL_INVALID_HANDLE; - } - - /* check option */ - if ( /* fOption < SQL_STMT_OPT_MIN || */ - fOption > SQL_STMT_OPT_MAX) - { - PUSHSQLERR (pstmt->herr, en_S1092); - - return SQL_ERROR; - } - - /* check state */ - if (pstmt->state >= en_stmt_needdata - || pstmt->asyn_on != en_NullProc) - { - sqlstat = en_S1010; - } - else - { - switch (pstmt->state) - { - case en_stmt_allocated: - case en_stmt_prepared: - case en_stmt_executed: - case en_stmt_cursoropen: - if (fOption == SQL_ROW_NUMBER || fOption == SQL_GET_BOOKMARK) - { - sqlstat = en_24000; - } - break; - - default: - break; - } - } - - if (sqlstat != en_00000) - { - PUSHSQLERR (pstmt->herr, sqlstat); - - return SQL_ERROR; - } - - hproc = _iodbcdm_getproc (pstmt->hdbc, en_GetStmtOption); - - if (hproc == SQL_NULL_HPROC) - { - PUSHSQLERR (pstmt->herr, en_IM001); - return SQL_ERROR; - } - - CALL_DRIVER (pstmt->hdbc, retcode, hproc, en_GetStmtOption, - (pstmt->dhstmt, fOption, pvParam)) - - return retcode; -} - - -RETCODE SQL_API -SQLCancel (HSTMT hstmt) -{ - STMT_t FAR *pstmt = (STMT_t FAR *) hstmt; - HPROC hproc; - RETCODE retcode; - - if (hstmt == SQL_NULL_HSTMT || pstmt->hdbc == SQL_NULL_HDBC) - { - return SQL_INVALID_HANDLE; - } - - /* check argument */ - /* check state */ - - /* call driver */ - hproc = _iodbcdm_getproc (pstmt->hdbc, en_Cancel); - - if (hproc == SQL_NULL_HPROC) - { - PUSHSQLERR (pstmt->herr, en_IM001); - - return SQL_ERROR; - } - - CALL_DRIVER (pstmt->hdbc, retcode, hproc, en_Cancel, - (pstmt->dhstmt)) - - /* state transition */ - if (retcode != SQL_SUCCESS && retcode != SQL_SUCCESS_WITH_INFO) - { - return retcode; - } - - switch (pstmt->state) - { - case en_stmt_allocated: - case en_stmt_prepared: - break; - - case en_stmt_executed: - if (pstmt->prep_state) - { - pstmt->state = en_stmt_prepared; - } - else - { - pstmt->state = en_stmt_allocated; - } - break; - - case en_stmt_cursoropen: - case en_stmt_fetched: - case en_stmt_xfetched: - if (pstmt->prep_state) - { - pstmt->state = en_stmt_prepared; - } - else - { - pstmt->state = en_stmt_allocated; - } - break; - - case en_stmt_needdata: - case en_stmt_mustput: - case en_stmt_canput: - switch (pstmt->need_on) - { - case en_ExecDirect: - pstmt->state = en_stmt_allocated; - break; - - case en_Execute: - pstmt->state = en_stmt_prepared; - break; - - case en_SetPos: - pstmt->state = en_stmt_xfetched; - break; - - default: - break; - } - pstmt->need_on = en_NullProc; - break; - - default: - break; - } - - return retcode; -} diff --git a/wxWidgets/src/iodbc/hstmt.h b/wxWidgets/src/iodbc/hstmt.h deleted file mode 100644 index c0fbcc0340..0000000000 --- a/wxWidgets/src/iodbc/hstmt.h +++ /dev/null @@ -1,75 +0,0 @@ -/* - * hstmt.h - * - * $Id: hstmt.h 2613 1999-06-01 15:32:12Z VZ $ - * - * Query statement object management functions - * - * The iODBC driver manager. - * - * Copyright (C) 1995 by Ke Jin - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ -#ifndef _HSTMT_H -#define _HSTMT_H - -#include "config.h" - -#include "isql.h" -#include "isqlext.h" - -typedef struct STMT - { - int type; /* must be 1st field */ - - struct STMT *next; - - HERR herr; - HDBC hdbc; /* back point to connection object */ - HSTMT dhstmt; /* driver's stmt handle */ - - int state; - int cursor_state; - int prep_state; - int asyn_on; /* async executing which odbc call */ - int need_on; /* which call return SQL_NEED_DATA */ - } -STMT_t; - -enum - { - en_stmt_allocated = 0, - en_stmt_prepared, - en_stmt_executed, - en_stmt_cursoropen, - en_stmt_fetched, - en_stmt_xfetched, - en_stmt_needdata, /* not call SQLParamData() yet */ - en_stmt_mustput, /* not call SQLPutData() yet */ - en_stmt_canput /* SQLPutData() called */ - }; /* for statement handle state */ - -enum - { - en_stmt_cursor_no = 0, - en_stmt_cursor_named, - en_stmt_cursor_opened, - en_stmt_cursor_fetched, - en_stmt_cursor_xfetched - }; /* for statement cursor state */ - -extern RETCODE _iodbcdm_dropstmt (); -#endif diff --git a/wxWidgets/src/iodbc/info.c b/wxWidgets/src/iodbc/info.c deleted file mode 100644 index 36fac3bfc4..0000000000 --- a/wxWidgets/src/iodbc/info.c +++ /dev/null @@ -1,521 +0,0 @@ -/* - * info.c - * - * $Id: info.c 5714 2000-01-27 22:47:49Z GT $ - * - * Information functions - * - * The iODBC driver manager. - * - * Copyright (C) 1995 by Ke Jin - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -#include "config.h" - -#include "isql.h" -#include "isqlext.h" - -#include "dlproc.h" - -#include "herr.h" -#include "henv.h" -#include "hdbc.h" -#include "hstmt.h" - -#include "itrace.h" - -#include -#include - -#define SECT1 "ODBC Data Sources" -#define SECT2 "Default" -#define MAX_ENTRIES 1024 - -extern char * _iodbcdm_getinifile (char *buf, int size); -extern char * _iodbcdm_getkeyvalbydsn (char *dsn, int dsnlen, char *keywd, char *value, int size); - -static int -stricmp (const char *s1, const char *s2) -{ - int cmp; - - while (*s1) - { - if ((cmp = toupper (*s1) - toupper (*s2)) != 0) - return cmp; - s1++; - s2++; - } - return (*s2) ? -1 : 0; -} - -static int -SectSorter (const void *p1, const void *p2) -{ - char **s1 = (char **) p1; - char **s2 = (char **) p2; - - return stricmp (*s1, *s2); -} - - -RETCODE SQL_API -SQLDataSources ( - HENV henv, - UWORD fDir, - UCHAR FAR * szDSN, - SWORD cbDSNMax, - SWORD FAR * pcbDSN, - UCHAR FAR * szDesc, - SWORD cbDescMax, - SWORD FAR * pcbDesc) -{ - GENV_t FAR *genv = (GENV_t FAR *) henv; - char *path; - char buf[1024]; - FILE *fp; - int i; - static int cur_entry = -1; - static int num_entries = 0; - static char **sect = NULL; - - if (henv == SQL_NULL_HENV) - { - return SQL_INVALID_HANDLE; - } - /* check argument */ - if (cbDSNMax < 0 || cbDescMax < 0) - { - PUSHSQLERR (genv->herr, en_S1090); - - return SQL_ERROR; - } - if (fDir != SQL_FETCH_FIRST - && fDir != SQL_FETCH_NEXT) - { - PUSHSQLERR (genv->herr, en_S1103); - - return SQL_ERROR; - } - if (cur_entry < 0 || fDir == SQL_FETCH_FIRST) - { - cur_entry = 0; - num_entries = 0; - - - /* - * Open the odbc.ini file - */ - path = (char *) _iodbcdm_getinifile (buf, sizeof (buf)); - if ((fp = fopen (path, "r")) == NULL) - { - return SQL_NO_DATA_FOUND; - } - /* - * Free old section list - */ - if (sect) - { - for (i = 0; i < MAX_ENTRIES; i++) - if (sect[i]) - free (sect[i]); - free (sect); - } - if ((sect = (char **) calloc (MAX_ENTRIES, sizeof (char *))) == NULL) - { - PUSHSQLERR (genv->herr, en_S1011); - - return SQL_ERROR; - } - /* - * Build a dynamic list of sections - */ - while (1) - { - char *str, *p; - - str = fgets (buf, sizeof (buf), fp); - - if (str == NULL) - break; - - if (*str == '[') - { - str++; - for (p = str; *p; p++) - if (*p == ']') - *p = '\0'; - - if (!strcmp (str, SECT1)) - continue; - if (!strcmp (str, SECT2)) - continue; - - /* - * Add this section to the comma separated list - */ - if (num_entries >= MAX_ENTRIES) - break; /* Skip the rest */ - - sect[num_entries++] = (char *) strdup (str); - } - } - - /* - * Sort all entries so we can present a nice list - */ - if (num_entries > 1) - qsort (sect, num_entries, sizeof (char *), SectSorter); - } - /* - * Try to get to the next item - */ - if (cur_entry >= num_entries) - { - cur_entry = 0; /* Next time, start all over again */ - return SQL_NO_DATA_FOUND; - } - /* - * Copy DSN information - */ - STRNCPY (szDSN, sect[cur_entry], cbDSNMax); -/* -glt??? pcbDSN = strlen(szDSN); -*/ - /* - * And find the description that goes with this entry - */ - _iodbcdm_getkeyvalbydsn (sect[cur_entry], strlen (sect[cur_entry]), - "Description", (char*) szDesc, cbDescMax); -/* -glt??? pcbDesc = strlen(szDesc); -*/ - /* - * Next record - */ - cur_entry++; - - return SQL_SUCCESS; -} - - -RETCODE SQL_API -SQLDrivers ( - HENV henv, - UWORD fDir, - UCHAR FAR * szDrvDesc, - SWORD cbDrvDescMax, - SWORD FAR * pcbDrvDesc, - UCHAR FAR * szDrvAttr, - SWORD cbDrvAttrMax, - SWORD FAR * pcbDrvAttr) -{ - GENV_t FAR *genv = (GENV_t FAR *) henv; - - if (henv == SQL_NULL_HENV) - { - return SQL_INVALID_HANDLE; - } - - if (cbDrvDescMax < 0 || cbDrvAttrMax < 0 || cbDrvAttrMax == 1) - { - PUSHSQLERR (genv->herr, en_S1090); - - return SQL_ERROR; - } - - if (fDir != SQL_FETCH_FIRST || fDir != SQL_FETCH_NEXT) - { - PUSHSQLERR (genv->herr, en_S1103); - - return SQL_ERROR; - } - -/*********************/ - return SQL_NO_DATA_FOUND; -} - - -RETCODE SQL_API -SQLGetInfo ( - HDBC hdbc, - UWORD fInfoType, - PTR rgbInfoValue, - SWORD cbInfoValueMax, - SWORD FAR * pcbInfoValue) -{ - DBC_t FAR *pdbc = (DBC_t FAR *) hdbc; - ENV_t FAR *penv; - STMT_t FAR *pstmt = NULL; - STMT_t FAR *tpstmt; - HPROC hproc; - RETCODE retcode = SQL_SUCCESS; - - DWORD dword; - int size = 0, len = 0; - char buf[16] = {'\0'}; - - if (hdbc == SQL_NULL_HDBC || pdbc->henv == SQL_NULL_HENV) - { - return SQL_INVALID_HANDLE; - } - - if (cbInfoValueMax < 0) - { - PUSHSQLERR (pdbc->herr, en_S1090); - - return SQL_ERROR; - } - - if ( /* fInfoType < SQL_INFO_FIRST || */ - (fInfoType > SQL_INFO_LAST - && fInfoType < SQL_INFO_DRIVER_START)) - { - PUSHSQLERR (pdbc->herr, en_S1096); - - return SQL_ERROR; - } - - if (fInfoType == SQL_ODBC_VER) - { - sprintf (buf, "%02d.%02d", - (ODBCVER) >> 8, 0x00FF & (ODBCVER)); - - - if (rgbInfoValue != NULL - && cbInfoValueMax > 0) - { - len = STRLEN (buf); - - if (len < cbInfoValueMax - 1) - { - len = cbInfoValueMax - 1; - PUSHSQLERR (pdbc->herr, en_01004); - - retcode = SQL_SUCCESS_WITH_INFO; - } - - STRNCPY (rgbInfoValue, buf, len); - ((char FAR *) rgbInfoValue)[len] = '\0'; - } - - if (pcbInfoValue != NULL) - { - *pcbInfoValue = (SWORD) len; - } - - return retcode; - } - - if (pdbc->state == en_dbc_allocated || pdbc->state == en_dbc_needdata) - { - PUSHSQLERR (pdbc->herr, en_08003); - - return SQL_ERROR; - } - - switch (fInfoType) - { - case SQL_DRIVER_HDBC: - dword = (DWORD) (pdbc->dhdbc); - size = sizeof (dword); - break; - - case SQL_DRIVER_HENV: - penv = (ENV_t FAR *) (pdbc->henv); - dword = (DWORD) (penv->dhenv); - size = sizeof (dword); - break; - - case SQL_DRIVER_HLIB: - penv = (ENV_t FAR *) (pdbc->henv); - dword = (DWORD) (penv->hdll); - size = sizeof (dword); - break; - - case SQL_DRIVER_HSTMT: - if (rgbInfoValue != NULL) - { - pstmt = *((STMT_t FAR **) rgbInfoValue); - } - - for (tpstmt = (STMT_t FAR *) (pdbc->hstmt); - tpstmt != NULL; - tpstmt = tpstmt->next) - { - if (tpstmt == pstmt) - { - break; - } - } - - if (tpstmt == NULL) - { - PUSHSQLERR (pdbc->herr, en_S1009); - - return SQL_ERROR; - } - - dword = (DWORD) (pstmt->dhstmt); - size = sizeof (dword); - break; - - default: - break; - } - - if (size) - { - if (rgbInfoValue != NULL) - { - *((DWORD *) rgbInfoValue) = dword; - } - - if (pcbInfoValue != NULL) - { - *(pcbInfoValue) = (SWORD) size; - } - - return SQL_SUCCESS; - } - - hproc = _iodbcdm_getproc (hdbc, en_GetInfo); - - if (hproc == SQL_NULL_HPROC) - { - PUSHSQLERR (pdbc->herr, en_IM001); - - return SQL_ERROR; - } - - CALL_DRIVER (hdbc, retcode, hproc, en_GetInfo, - (pdbc->dhdbc, fInfoType, rgbInfoValue, cbInfoValueMax, pcbInfoValue)) - - if (retcode == SQL_ERROR - && fInfoType == SQL_DRIVER_ODBC_VER) - { - STRCPY (buf, "01.00"); - - if (rgbInfoValue != NULL - && cbInfoValueMax > 0) - { - len = STRLEN (buf); - - if (len < cbInfoValueMax - 1) - { - len = cbInfoValueMax - 1; - PUSHSQLERR (pdbc->herr, en_01004); - } - - STRNCPY (rgbInfoValue, buf, len); - ((char FAR *) rgbInfoValue)[len] = '\0'; - } - - if (pcbInfoValue != NULL) - { - *pcbInfoValue = (SWORD) len; - } - - /* what should we return in this case ???? */ - } - - return retcode; -} - - -RETCODE SQL_API -SQLGetFunctions ( - HDBC hdbc, - UWORD fFunc, - UWORD FAR * pfExists) -{ - DBC_t FAR *pdbc = (DBC_t FAR *) hdbc; - HPROC hproc; - RETCODE retcode; - - if (hdbc == SQL_NULL_HDBC) - { - return SQL_INVALID_HANDLE; - } - - if (fFunc > SQL_EXT_API_LAST) - { - PUSHSQLERR (pdbc->herr, en_S1095); - - return SQL_ERROR; - } - - if (pdbc->state == en_dbc_allocated - || pdbc->state == en_dbc_needdata) - { - PUSHSQLERR (pdbc->herr, en_S1010); - - return SQL_ERROR; - } - - if (pfExists == NULL) - { - return SQL_SUCCESS; - } - - hproc = _iodbcdm_getproc (hdbc, en_GetFunctions); - - if (hproc != SQL_NULL_HPROC) - { - CALL_DRIVER (hdbc, retcode, hproc, en_GetFunctions, - (pdbc->dhdbc, fFunc, pfExists)) - - return retcode; - } - - if (fFunc == SQL_API_SQLSETPARAM) - { - fFunc = SQL_API_SQLBINDPARAMETER; - } - - if (fFunc != SQL_API_ALL_FUNCTIONS) - { - hproc = _iodbcdm_getproc (hdbc, fFunc); - - if (hproc == SQL_NULL_HPROC) - { - *pfExists = (UWORD) 0; - } - else - { - *pfExists = (UWORD) 1; - } - - return SQL_SUCCESS; - } - - for (fFunc = 0; fFunc < 100; fFunc++) - { - hproc = _iodbcdm_getproc (hdbc, fFunc); - - if (hproc == SQL_NULL_HPROC) - { - pfExists[fFunc] = (UWORD) 0; - } - else - { - pfExists[fFunc] = (UWORD) 1; - } - } - - return SQL_SUCCESS; -} diff --git a/wxWidgets/src/iodbc/iodbc.h b/wxWidgets/src/iodbc/iodbc.h deleted file mode 100644 index e60123d0b2..0000000000 --- a/wxWidgets/src/iodbc/iodbc.h +++ /dev/null @@ -1,66 +0,0 @@ -#ifndef _CONFIG_H -#define _CONFIG_H - -# if !defined(WINDOWS) && !defined(WIN32_SYSTEM) -# define _UNIX_ - -# include -# include - -# define MEM_ALLOC(size) (malloc((size_t)(size))) -# define MEM_FREE(ptr) {if(ptr) free(ptr);} - -# define STRCPY(t, s) (strcpy((char*)(t), (char*)(s))) -# define STRNCPY(t,s,n) (strncpy((char*)(t), (char*)(s), (size_t)(n))) -# define STRCAT(t, s) (strcat((char*)(t), (char*)(s))) -# define STRNCAT(t,s,n) (strncat((char*)(t), (char*)(s), (size_t)(n))) -# define STREQ(a, b) (strcmp((char*)(a), (char*)(b)) == 0) -# define STRLEN(str) ((str)? strlen((char*)(str)):0) - -# define EXPORT -# define CALLBACK -# define FAR - - typedef signed short SSHOR; - typedef short WORD; - typedef long DWORD; - - typedef WORD WPARAM; - typedef DWORD LPARAM; - typedef void* HWND; - typedef int BOOL; - -# endif /* _UNIX_ */ - -# if defined(WINDOWS) || defined(WIN32_SYSTEM) - -# include -# include - -# ifdef _MSVC_ -# define MEM_ALLOC(size) (fmalloc((size_t)(size))) -# define MEM_FREE(ptr) ((ptr)? ffree((PTR)(ptr)):0)) -# define STRCPY(t, s) (fstrcpy((char FAR*)(t), (char FAR*)(s))) -# define STRNCPY(t,s,n) (fstrncpy((char FAR*)(t), (char FAR*)(s), (size_t)(n))) -# define STRLEN(str) ((str)? fstrlen((char FAR*)(str)):0) -# define STREQ(a, b) (fstrcmp((char FAR*)(a), (char FAR*)(b) == 0) -# endif - -# ifdef _BORLAND_ -# define MEM_ALLOC(size) (farmalloc((unsigned long)(size)) -# define MEM_FREE(ptr) ((ptr)? farfree((void far*)(ptr)):0) -# define STRCPY(t, s) (_fstrcpy((char FAR*)(t), (char FAR*)(s))) -# define STRNCPY(t,s,n) (_fstrncpy((char FAR*)(t), (char FAR*)(s), (size_t)(n))) -# define STRLEN(str) ((str)? _fstrlen((char FAR*)(str)):0) -# define STREQ(a, b) (_fstrcmp((char FAR*)(a), (char FAR*)(b) == 0) -# endif - -# endif /* WINDOWS */ - -# define SYSERR (-1) - -# ifndef NULL -# define NULL ((void FAR*)0UL) -# endif - -#endif diff --git a/wxWidgets/src/iodbc/isql.h b/wxWidgets/src/iodbc/isql.h deleted file mode 100644 index 380bd97c50..0000000000 --- a/wxWidgets/src/iodbc/isql.h +++ /dev/null @@ -1,235 +0,0 @@ -/* - * isql.h - * - * $Id: isql.h 35518 2005-09-16 11:22:35Z JS $ - * - * iODBC defines - * - * The iODBC driver manager. - * - * Copyright (C) 1995 by Ke Jin - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ -#ifndef _ISQL_H -#define _ISQL_H - -#ifndef WIN16 -#ifdef WIN32 -#define SQL_API __stdcall -#else -#define FAR -#define EXPORT -#define CALLBACK -#define SQL_API EXPORT CALLBACK -#ifndef __EMX__ -typedef void *HWND; -#endif -#endif -#endif - -typedef void *SQLHWND; - -typedef unsigned char UCHAR; -typedef long int SDWORD; -typedef short int SWORD; -typedef unsigned long int UDWORD; -typedef unsigned short int UWORD; -typedef long SQLINTEGER; -typedef UDWORD SQLUINTEGER; - -typedef void FAR *PTR; -typedef void FAR *HENV; -typedef void FAR *HDBC; -typedef void FAR *HSTMT; - -typedef signed short RETCODE; -#define SQLRETURN RETCODE - - -#define ODBCVER 0x0250 - -#define SQL_MAX_MESSAGE_LENGTH 512 -#define SQL_MAX_DSN_LENGTH 32 - -/* - * Function return codes - */ -#define SQL_INVALID_HANDLE (-2) -#define SQL_ERROR (-1) -#define SQL_SUCCESS 0 -#define SQL_SUCCESS_WITH_INFO 1 -#define SQL_NO_DATA_FOUND 100 - -/* - * Standard SQL datatypes, using ANSI type numbering - */ -#define SQL_CHAR 1 -#define SQL_NUMERIC 2 -#define SQL_DECIMAL 3 -#define SQL_INTEGER 4 -#define SQL_SMALLINT 5 -#define SQL_FLOAT 6 -#define SQL_REAL 7 -#define SQL_DOUBLE 8 -#define SQL_VARCHAR 12 - -#define SQL_TYPE_MIN SQL_CHAR -#define SQL_TYPE_NULL 0 -#define SQL_TYPE_MAX SQL_VARCHAR - -/* - * C datatype to SQL datatype mapping - */ -#define SQL_C_CHAR SQL_CHAR -#define SQL_C_LONG SQL_INTEGER -#define SQL_C_SHORT SQL_SMALLINT -#define SQL_C_FLOAT SQL_REAL -#define SQL_C_DOUBLE SQL_DOUBLE -#define SQL_C_DEFAULT 99 - -/* - * NULL status constants. - */ -#define SQL_NO_NULLS 0 -#define SQL_NULLABLE 1 -#define SQL_NULLABLE_UNKNOWN 2 - -/* - * Special length values - */ -#define SQL_NULL_DATA (-1) -#define SQL_DATA_AT_EXEC (-2) -#define SQL_NTS (-3) - -/* - * SQLFreeStmt - */ -#define SQL_CLOSE 0 -#define SQL_DROP 1 -#define SQL_UNBIND 2 -#define SQL_RESET_PARAMS 3 - -/* - * SQLTransact - */ -#define SQL_COMMIT 0 -#define SQL_ROLLBACK 1 - -/* - * SQLColAttributes - */ -#define SQL_COLUMN_COUNT 0 -#define SQL_COLUMN_NAME 1 -#define SQL_COLUMN_TYPE 2 -#define SQL_COLUMN_LENGTH 3 -#define SQL_COLUMN_PRECISION 4 -#define SQL_COLUMN_SCALE 5 -#define SQL_COLUMN_DISPLAY_SIZE 6 -#define SQL_COLUMN_NULLABLE 7 -#define SQL_COLUMN_UNSIGNED 8 -#define SQL_COLUMN_MONEY 9 -#define SQL_COLUMN_UPDATABLE 10 -#define SQL_COLUMN_AUTO_INCREMENT 11 -#define SQL_COLUMN_CASE_SENSITIVE 12 -#define SQL_COLUMN_SEARCHABLE 13 -#define SQL_COLUMN_TYPE_NAME 14 -#define SQL_COLUMN_TABLE_NAME 15 -#define SQL_COLUMN_OWNER_NAME 16 -#define SQL_COLUMN_QUALIFIER_NAME 17 -#define SQL_COLUMN_LABEL 18 - -#define SQL_COLATT_OPT_MAX SQL_COLUMN_LABEL -#define SQL_COLATT_OPT_MIN SQL_COLUMN_COUNT -#define SQL_COLUMN_DRIVER_START 1000 - -/* - * SQLColAttributes : SQL_COLUMN_UPDATABLE - */ -#define SQL_ATTR_READONLY 0 -#define SQL_ATTR_WRITE 1 -#define SQL_ATTR_READWRITE_UNKNOWN 2 - -/* - * SQLColAttributes : SQL_COLUMN_SEARCHABLE - */ -#define SQL_UNSEARCHABLE 0 -#define SQL_LIKE_ONLY 1 -#define SQL_ALL_EXCEPT_LIKE 2 -#define SQL_SEARCHABLE 3 - -/* - * NULL Handles - */ -#define SQL_NULL_HENV 0 -#define SQL_NULL_HDBC 0 -#define SQL_NULL_HSTMT 0 - - -/* - * Function Prototypes - */ -#ifdef __cplusplus -extern "C" -{ -#endif - - RETCODE SQL_API SQLAllocConnect (HENV henv, HDBC FAR * phdbc); - RETCODE SQL_API SQLAllocEnv (HENV FAR * phenv); - RETCODE SQL_API SQLAllocStmt (HDBC hdbc, HSTMT FAR * phstmt); - RETCODE SQL_API SQLBindCol (HSTMT hstmt, UWORD icol, SWORD fCType, - PTR rgbValue, SDWORD cbValueMax, SDWORD FAR * pcbValue); - RETCODE SQL_API SQLCancel (HSTMT hstmt); - RETCODE SQL_API SQLColAttributes (HSTMT hstmt, UWORD icol, UWORD fDescType, - PTR rgbDesc, SWORD cbDescMax, SWORD FAR * pcbDesc, SDWORD FAR * pfDesc); - RETCODE SQL_API SQLConnect (HDBC hdbc, UCHAR FAR * szDSN, SWORD cbDSN, - UCHAR FAR * szUID, SWORD cbUID, UCHAR FAR * szAuthStr, SWORD cbAuthStr); - RETCODE SQL_API SQLDescribeCol (HSTMT hstmt, UWORD icol, - UCHAR FAR * szColName, SWORD cbColNameMax, SWORD FAR * pcbColName, - SWORD FAR * pfSqlType, UDWORD FAR * pcbColDef, SWORD FAR * pibScale, - SWORD FAR * pfNullable); - RETCODE SQL_API SQLDisconnect (HDBC hdbc); - RETCODE SQL_API SQLError (HENV henv, HDBC hdbc, HSTMT hstmt, - UCHAR FAR * szSqlState, SDWORD FAR * pfNativeError, UCHAR FAR * szErrorMsg, - SWORD cbErrorMsgMax, SWORD FAR * pcbErrorMsg); - RETCODE SQL_API SQLExecDirect (HSTMT hstmt, UCHAR FAR * szSqlStr, - SDWORD cbSqlStr); - RETCODE SQL_API SQLExecute (HSTMT hstmt); - RETCODE SQL_API SQLFetch (HSTMT hstmt); - RETCODE SQL_API SQLFreeConnect (HDBC hdbc); - RETCODE SQL_API SQLFreeEnv (HENV henv); - RETCODE SQL_API SQLFreeStmt (HSTMT hstmt, UWORD fOption); - RETCODE SQL_API SQLGetCursorName (HSTMT hstmt, UCHAR FAR * szCursor, - SWORD cbCursorMax, SWORD FAR * pcbCursor); - RETCODE SQL_API SQLNumResultCols (HSTMT hstmt, SWORD FAR * pccol); - RETCODE SQL_API SQLPrepare (HSTMT hstmt, UCHAR FAR * szSqlStr, - SDWORD cbSqlStr); - RETCODE SQL_API SQLRowCount (HSTMT hstmt, SDWORD FAR * pcrow); - RETCODE SQL_API SQLSetCursorName (HSTMT hstmt, UCHAR FAR * szCursor, - SWORD cbCursor); - RETCODE SQL_API SQLTransact (HENV henv, HDBC hdbc, UWORD fType); - -/* - * Deprecated ODBC 1.0 function - Use SQLBindParameter - */ - RETCODE SQL_API SQLSetParam (HSTMT hstmt, UWORD ipar, SWORD fCType, - SWORD fSqlType, UDWORD cbColDef, SWORD ibScale, PTR rgbValue, - SDWORD FAR * pcbValue); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/wxWidgets/src/iodbc/isqlext.h b/wxWidgets/src/iodbc/isqlext.h deleted file mode 100644 index faeaccb1fe..0000000000 --- a/wxWidgets/src/iodbc/isqlext.h +++ /dev/null @@ -1,1177 +0,0 @@ -/* - * - * isqlext.h - * - * $Id: isqlext.h 30070 2004-10-22 19:11:07Z KH $ - * - * iODBC defines (ext) - * - * The iODBC driver manager. - * - * Copyright (C) 1995 by Ke Jin - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ -#ifndef _ISQLEXT_H -# define _ISQLEXT_H - -#include "isql.h" - -/* - * Generic constants - */ -#define SQL_MAX_OPTION_STRING_LENGTH 256 - -/* - * Additional return codes - */ -#define SQL_STILL_EXECUTING 2 -#define SQL_NEED_DATA 99 - -/* - * SQL extended datatypes - */ -#define SQL_DATE 9 -#define SQL_TIME 10 -#define SQL_TIMESTAMP 11 -#define SQL_LONGVARCHAR (-1) -#define SQL_BINARY (-2) -#define SQL_VARBINARY (-3) -#define SQL_LONGVARBINARY (-4) -#define SQL_BIGINT (-5) -#define SQL_TINYINT (-6) -#define SQL_BIT (-7) - -#define SQL_INTERVAL_YEAR (-80) -#define SQL_INTERVAL_MONTH (-81) -#define SQL_INTERVAL_YEAR_TO_MONTH (-82) -#define SQL_INTERVAL_DAY (-83) -#define SQL_INTERVAL_HOUR (-84) -#define SQL_INTERVAL_MINUTE (-85) -#define SQL_INTERVAL_SECOND (-86) -#define SQL_INTERVAL_DAY_TO_HOUR (-87) -#define SQL_INTERVAL_DAY_TO_MINUTE (-88) -#define SQL_INTERVAL_DAY_TO_SECOND (-89) -#define SQL_INTERVAL_HOUR_TO_MINUTE (-90) -#define SQL_INTERVAL_HOUR_TO_SECOND (-91) -#define SQL_INTERVAL_MINUTE_TO_SECOND (-92) -#define SQL_UNICODE (-95) - -#define SQL_TYPE_DRIVER_START SQL_INTERVAL_YEAR -#define SQL_TYPE_DRIVER_END SQL_UNICODE - -#define SQL_SIGNED_OFFSET (-20) -#define SQL_UNSIGNED_OFFSET (-22) - -/* - * C datatype to SQL datatype mapping - */ -#define SQL_C_DATE SQL_DATE -#define SQL_C_TIME SQL_TIME -#define SQL_C_TIMESTAMP SQL_TIMESTAMP -#define SQL_C_BINARY SQL_BINARY -#define SQL_C_BIT SQL_BIT -#define SQL_C_TINYINT SQL_TINYINT -#define SQL_C_SLONG SQL_C_LONG+SQL_SIGNED_OFFSET -#define SQL_C_SSHORT SQL_C_SHORT+SQL_SIGNED_OFFSET -#define SQL_C_STINYINT SQL_TINYINT+SQL_SIGNED_OFFSET -#define SQL_C_ULONG SQL_C_LONG+SQL_UNSIGNED_OFFSET -#define SQL_C_USHORT SQL_C_SHORT+SQL_UNSIGNED_OFFSET -#define SQL_C_UTINYINT SQL_TINYINT+SQL_UNSIGNED_OFFSET -#define SQL_C_BOOKMARK SQL_C_ULONG - -/* - * Extended data types override sql.h defined - */ -#undef SQL_TYPE_MIN -#define SQL_TYPE_MIN SQL_BIT -#define SQL_ALL_TYPES 0 - -/* - * SQL portable types for C - DATE, TIME, TIMESTAMP - */ -typedef struct _DATE_STRUCT - { - SWORD year; - UWORD month; - UWORD day; - } -DATE_STRUCT; - -typedef struct _TIME_STRUCT - { - UWORD hour; - UWORD minute; - UWORD second; - } -TIME_STRUCT; - -typedef struct _TIMESTAMP_STRUCT - { - SWORD year; - UWORD month; - UWORD day; - UWORD hour; - UWORD minute; - UWORD second; - UDWORD fraction; - } -TIMESTAMP_STRUCT; - -typedef unsigned long int BOOKMARK; - -/* - * ---------------------------------------------------------------------- - * Level 1 Functions - * ---------------------------------------------------------------------- - */ - -/* - * SQLDriverConnect - */ -#define SQL_DRIVER_NOPROMPT 0 -#define SQL_DRIVER_COMPLETE 1 -#define SQL_DRIVER_PROMPT 2 -#define SQL_DRIVER_COMPLETE_REQUIRED 3 - -/* - * SQLGetData - */ -#define SQL_NO_TOTAL (-4) - -/* - * SQLBindParameter - */ -#define SQL_DEFAULT_PARAM (-5) -#define SQL_IGNORE (-6) -#define SQL_LEN_DATA_AT_EXEC_OFFSET (-100) -#define SQL_LEN_DATA_AT_EXEC(length) (-length+SQL_LEN_DATA_AT_EXEC_OFFSET) - -/* - * SQLGetFunctions - */ -#define SQL_API_SQLALLOCCONNECT 1 /* Core Functions */ -#define SQL_API_SQLALLOCENV 2 -#define SQL_API_SQLALLOCSTMT 3 -#define SQL_API_SQLBINDCOL 4 -#define SQL_API_SQLCANCEL 5 -#define SQL_API_SQLCOLATTRIBUTES 6 -#define SQL_API_SQLCONNECT 7 -#define SQL_API_SQLDESCRIBECOL 8 -#define SQL_API_SQLDISCONNECT 9 -#define SQL_API_SQLERROR 10 -#define SQL_API_SQLEXECDIRECT 11 -#define SQL_API_SQLEXECUTE 12 -#define SQL_API_SQLFETCH 13 -#define SQL_API_SQLFREECONNECT 14 -#define SQL_API_SQLFREEENV 15 -#define SQL_API_SQLFREESTMT 16 -#define SQL_API_SQLGETCURSORNAME 17 -#define SQL_API_SQLNUMRESULTCOLS 18 -#define SQL_API_SQLPREPARE 19 -#define SQL_API_SQLROWCOUNT 20 -#define SQL_API_SQLSETCURSORNAME 21 -#define SQL_API_SQLSETPARAM 22 -#define SQL_API_SQLTRANSACT 23 - -#define SQL_NUM_FUNCTIONS 23 - -#define SQL_EXT_API_START 40 - -#define SQL_API_SQLCOLUMNS 40 /* Level 1 Functions */ -#define SQL_API_SQLDRIVERCONNECT 41 -#define SQL_API_SQLGETCONNECTOPTION 42 -#define SQL_API_SQLGETDATA 43 -#define SQL_API_SQLGETFUNCTIONS 44 -#define SQL_API_SQLGETINFO 45 -#define SQL_API_SQLGETSTMTOPTION 46 -#define SQL_API_SQLGETTYPEINFO 47 -#define SQL_API_SQLPARAMDATA 48 -#define SQL_API_SQLPUTDATA 49 -#define SQL_API_SQLSETCONNECTOPTION 50 -#define SQL_API_SQLSETSTMTOPTION 51 -#define SQL_API_SQLSPECIALCOLUMNS 52 -#define SQL_API_SQLSTATISTICS 53 -#define SQL_API_SQLTABLES 54 - -#define SQL_API_SQLBROWSECONNECT 55 /* Level 2 Functions */ -#define SQL_API_SQLCOLUMNPRIVILEGES 56 -#define SQL_API_SQLDATASOURCES 57 -#define SQL_API_SQLDESCRIBEPARAM 58 -#define SQL_API_SQLEXTENDEDFETCH 59 -#define SQL_API_SQLFOREIGNKEYS 60 -#define SQL_API_SQLMORERESULTS 61 -#define SQL_API_SQLNATIVESQL 62 -#define SQL_API_SQLNUMPARAMS 63 -#define SQL_API_SQLPARAMOPTIONS 64 -#define SQL_API_SQLPRIMARYKEYS 65 -#define SQL_API_SQLPROCEDURECOLUMNS 66 -#define SQL_API_SQLPROCEDURES 67 -#define SQL_API_SQLSETPOS 68 -#define SQL_API_SQLSETSCROLLOPTIONS 69 -#define SQL_API_SQLTABLEPRIVILEGES 70 - -#define SQL_API_SQLDRIVERS 71 -#define SQL_API_SQLBINDPARAMETER 72 -#define SQL_EXT_API_LAST SQL_API_SQLBINDPARAMETER - -#define SQL_API_ALL_FUNCTIONS 0 - -#define SQL_NUM_EXTENSIONS (SQL_EXT_API_LAST-SQL_EXT_API_START+1) - -/* - * SQLGetInfo - */ -#define SQL_INFO_FIRST 0 -#define SQL_ACTIVE_CONNECTIONS 0 -#define SQL_ACTIVE_STATEMENTS 1 -#define SQL_DATA_SOURCE_NAME 2 -#define SQL_DRIVER_HDBC 3 -#define SQL_DRIVER_HENV 4 -#define SQL_DRIVER_HSTMT 5 -#define SQL_DRIVER_NAME 6 -#define SQL_DRIVER_VER 7 -#define SQL_FETCH_DIRECTION 8 -#define SQL_ODBC_API_CONFORMANCE 9 -#define SQL_ODBC_VER 10 -#define SQL_ROW_UPDATES 11 -#define SQL_ODBC_SAG_CLI_CONFORMANCE 12 -#define SQL_SERVER_NAME 13 -#define SQL_SEARCH_PATTERN_ESCAPE 14 -#define SQL_ODBC_SQL_CONFORMANCE 15 -#define SQL_DBMS_NAME 17 -#define SQL_DBMS_VER 18 -#define SQL_ACCESSIBLE_TABLES 19 -#define SQL_ACCESSIBLE_PROCEDURES 20 -#define SQL_PROCEDURES 21 -#define SQL_CONCAT_NULL_BEHAVIOR 22 -#define SQL_CURSOR_COMMIT_BEHAVIOR 23 -#define SQL_CURSOR_ROLLBACK_BEHAVIOR 24 -#define SQL_DATA_SOURCE_READ_ONLY 25 -#define SQL_DEFAULT_TXN_ISOLATION 26 -#define SQL_EXPRESSIONS_IN_ORDERBY 27 -#define SQL_IDENTIFIER_CASE 28 -#define SQL_IDENTIFIER_QUOTE_CHAR 29 -#define SQL_MAX_COLUMN_NAME_LEN 30 -#define SQL_MAX_CURSOR_NAME_LEN 31 -#define SQL_MAX_OWNER_NAME_LEN 32 -#define SQL_MAX_PROCEDURE_NAME_LEN 33 -#define SQL_MAX_QUALIFIER_NAME_LEN 34 -#define SQL_MAX_TABLE_NAME_LEN 35 -#define SQL_MULT_RESULT_SETS 36 -#define SQL_MULTIPLE_ACTIVE_TXN 37 -#define SQL_OUTER_JOINS 38 -#define SQL_OWNER_TERM 39 -#define SQL_PROCEDURE_TERM 40 -#define SQL_QUALIFIER_NAME_SEPARATOR 41 -#define SQL_QUALIFIER_TERM 42 -#define SQL_SCROLL_CONCURRENCY 43 -#define SQL_SCROLL_OPTIONS 44 -#define SQL_TABLE_TERM 45 -#define SQL_TXN_CAPABLE 46 -#define SQL_USER_NAME 47 -#define SQL_CONVERT_FUNCTIONS 48 -#define SQL_NUMERIC_FUNCTIONS 49 -#define SQL_STRING_FUNCTIONS 50 -#define SQL_SYSTEM_FUNCTIONS 51 -#define SQL_TIMEDATE_FUNCTIONS 52 -#define SQL_CONVERT_BIGINT 53 -#define SQL_CONVERT_BINARY 54 -#define SQL_CONVERT_BIT 55 -#define SQL_CONVERT_CHAR 56 -#define SQL_CONVERT_DATE 57 -#define SQL_CONVERT_DECIMAL 58 -#define SQL_CONVERT_DOUBLE 59 -#define SQL_CONVERT_FLOAT 60 -#define SQL_CONVERT_INTEGER 61 -#define SQL_CONVERT_LONGVARCHAR 62 -#define SQL_CONVERT_NUMERIC 63 -#define SQL_CONVERT_REAL 64 -#define SQL_CONVERT_SMALLINT 65 -#define SQL_CONVERT_TIME 66 -#define SQL_CONVERT_TIMESTAMP 67 -#define SQL_CONVERT_TINYINT 68 -#define SQL_CONVERT_VARBINARY 69 -#define SQL_CONVERT_VARCHAR 70 -#define SQL_CONVERT_LONGVARBINARY 71 -#define SQL_TXN_ISOLATION_OPTION 72 -#define SQL_ODBC_SQL_OPT_IEF 73 - -/* - * ODBC SDK 1.0 Additions - */ -#define SQL_CORRELATION_NAME 74 -#define SQL_NON_NULLABLE_COLUMNS 75 - -/* - * ODBC SDK 2.0 Additions - */ -#define SQL_DRIVER_HLIB 76 -#define SQL_DRIVER_ODBC_VER 77 -#define SQL_LOCK_TYPES 78 -#define SQL_POS_OPERATIONS 79 -#define SQL_POSITIONED_STATEMENTS 80 -#define SQL_GETDATA_EXTENSIONS 81 -#define SQL_BOOKMARK_PERSISTENCE 82 -#define SQL_STATIC_SENSITIVITY 83 -#define SQL_FILE_USAGE 84 -#define SQL_NULL_COLLATION 85 -#define SQL_ALTER_TABLE 86 -#define SQL_COLUMN_ALIAS 87 -#define SQL_GROUP_BY 88 -#define SQL_KEYWORDS 89 -#define SQL_ORDER_BY_COLUMNS_IN_SELECT 90 -#define SQL_OWNER_USAGE 91 -#define SQL_QUALIFIER_USAGE 92 -#define SQL_QUOTED_IDENTIFIER_CASE 93 -#define SQL_SPECIAL_CHARACTERS 94 -#define SQL_SUBQUERIES 95 -#define SQL_UNION 96 -#define SQL_MAX_COLUMNS_IN_GROUP_BY 97 -#define SQL_MAX_COLUMNS_IN_INDEX 98 -#define SQL_MAX_COLUMNS_IN_ORDER_BY 99 -#define SQL_MAX_COLUMNS_IN_SELECT 100 -#define SQL_MAX_COLUMNS_IN_TABLE 101 -#define SQL_MAX_INDEX_SIZE 102 -#define SQL_MAX_ROW_SIZE_INCLUDES_LONG 103 -#define SQL_MAX_ROW_SIZE 104 -#define SQL_MAX_STATEMENT_LEN 105 -#define SQL_MAX_TABLES_IN_SELECT 106 -#define SQL_MAX_USER_NAME_LEN 107 -#define SQL_MAX_CHAR_LITERAL_LEN 108 -#define SQL_TIMEDATE_ADD_INTERVALS 109 -#define SQL_TIMEDATE_DIFF_INTERVALS 110 -#define SQL_NEED_LONG_DATA_LEN 111 -#define SQL_MAX_BINARY_LITERAL_LEN 112 -#define SQL_LIKE_ESCAPE_CLAUSE 113 -#define SQL_QUALIFIER_LOCATION 114 - -/* - * ODBC SDK 2.01 Additions - */ -#define SQL_OJ_CAPABILITIES 65003 /* Temp value until ODBC 3.0 */ - -#define SQL_INFO_LAST SQL_QUALIFIER_LOCATION -#define SQL_INFO_DRIVER_START 1000 - - -/* - * SQL_CONVERT_* bitmask values - */ -#define SQL_CVT_CHAR 0x00000001L -#define SQL_CVT_NUMERIC 0x00000002L -#define SQL_CVT_DECIMAL 0x00000004L -#define SQL_CVT_INTEGER 0x00000008L -#define SQL_CVT_SMALLINT 0x00000010L -#define SQL_CVT_FLOAT 0x00000020L -#define SQL_CVT_REAL 0x00000040L -#define SQL_CVT_DOUBLE 0x00000080L -#define SQL_CVT_VARCHAR 0x00000100L -#define SQL_CVT_LONGVARCHAR 0x00000200L -#define SQL_CVT_BINARY 0x00000400L -#define SQL_CVT_VARBINARY 0x00000800L -#define SQL_CVT_BIT 0x00001000L -#define SQL_CVT_TINYINT 0x00002000L -#define SQL_CVT_BIGINT 0x00004000L -#define SQL_CVT_DATE 0x00008000L -#define SQL_CVT_TIME 0x00010000L -#define SQL_CVT_TIMESTAMP 0x00020000L -#define SQL_CVT_LONGVARBINARY 0x00040000L - -/* - * SQL_CONVERT_FUNCTIONS - */ -#define SQL_FN_CVT_CONVERT 0x00000001L - -/* - * SQL_STRING_FUNCTIONS - */ -#define SQL_FN_STR_CONCAT 0x00000001L -#define SQL_FN_STR_INSERT 0x00000002L -#define SQL_FN_STR_LEFT 0x00000004L -#define SQL_FN_STR_LTRIM 0x00000008L -#define SQL_FN_STR_LENGTH 0x00000010L -#define SQL_FN_STR_LOCATE 0x00000020L -#define SQL_FN_STR_LCASE 0x00000040L -#define SQL_FN_STR_REPEAT 0x00000080L -#define SQL_FN_STR_REPLACE 0x00000100L -#define SQL_FN_STR_RIGHT 0x00000200L -#define SQL_FN_STR_RTRIM 0x00000400L -#define SQL_FN_STR_SUBSTRING 0x00000800L -#define SQL_FN_STR_UCASE 0x00001000L -#define SQL_FN_STR_ASCII 0x00002000L -#define SQL_FN_STR_CHAR 0x00004000L -#define SQL_FN_STR_DIFFERENCE 0x00008000L -#define SQL_FN_STR_LOCATE_2 0x00010000L -#define SQL_FN_STR_SOUNDEX 0x00020000L -#define SQL_FN_STR_SPACE 0x00040000L - -/* - * SQL_NUMERIC_FUNCTIONS - */ -#define SQL_FN_NUM_ABS 0x00000001L -#define SQL_FN_NUM_ACOS 0x00000002L -#define SQL_FN_NUM_ASIN 0x00000004L -#define SQL_FN_NUM_ATAN 0x00000008L -#define SQL_FN_NUM_ATAN2 0x00000010L -#define SQL_FN_NUM_CEILING 0x00000020L -#define SQL_FN_NUM_COS 0x00000040L -#define SQL_FN_NUM_COT 0x00000080L -#define SQL_FN_NUM_EXP 0x00000100L -#define SQL_FN_NUM_FLOOR 0x00000200L -#define SQL_FN_NUM_LOG 0x00000400L -#define SQL_FN_NUM_MOD 0x00000800L -#define SQL_FN_NUM_SIGN 0x00001000L -#define SQL_FN_NUM_SIN 0x00002000L -#define SQL_FN_NUM_SQRT 0x00004000L -#define SQL_FN_NUM_TAN 0x00008000L -#define SQL_FN_NUM_PI 0x00010000L -#define SQL_FN_NUM_RAND 0x00020000L -#define SQL_FN_NUM_DEGREES 0x00040000L -#define SQL_FN_NUM_LOG10 0x00080000L -#define SQL_FN_NUM_POWER 0x00100000L -#define SQL_FN_NUM_RADIANS 0x00200000L -#define SQL_FN_NUM_ROUND 0x00400000L -#define SQL_FN_NUM_TRUNCATE 0x00800000L - -/* - * SQL_TIMEDATE_FUNCTIONS - */ -#define SQL_FN_TD_NOW 0x00000001L -#define SQL_FN_TD_CURDATE 0x00000002L -#define SQL_FN_TD_DAYOFMONTH 0x00000004L -#define SQL_FN_TD_DAYOFWEEK 0x00000008L -#define SQL_FN_TD_DAYOFYEAR 0x00000010L -#define SQL_FN_TD_MONTH 0x00000020L -#define SQL_FN_TD_QUARTER 0x00000040L -#define SQL_FN_TD_WEEK 0x00000080L -#define SQL_FN_TD_YEAR 0x00000100L -#define SQL_FN_TD_CURTIME 0x00000200L -#define SQL_FN_TD_HOUR 0x00000400L -#define SQL_FN_TD_MINUTE 0x00000800L -#define SQL_FN_TD_SECOND 0x00001000L -#define SQL_FN_TD_TIMESTAMPADD 0x00002000L -#define SQL_FN_TD_TIMESTAMPDIFF 0x00004000L -#define SQL_FN_TD_DAYNAME 0x00008000L -#define SQL_FN_TD_MONTHNAME 0x00010000L - -/* - * SQL_SYSTEM_FUNCTIONS - */ -#define SQL_FN_SYS_USERNAME 0x00000001L -#define SQL_FN_SYS_DBNAME 0x00000002L -#define SQL_FN_SYS_IFNULL 0x00000004L - -/* - * SQL_TIMEDATE_ADD_INTERVALS - * SQL_TIMEDATE_DIFF_INTERVALS - */ -#define SQL_FN_TSI_FRAC_SECOND 0x00000001L -#define SQL_FN_TSI_SECOND 0x00000002L -#define SQL_FN_TSI_MINUTE 0x00000004L -#define SQL_FN_TSI_HOUR 0x00000008L -#define SQL_FN_TSI_DAY 0x00000010L -#define SQL_FN_TSI_WEEK 0x00000020L -#define SQL_FN_TSI_MONTH 0x00000040L -#define SQL_FN_TSI_QUARTER 0x00000080L -#define SQL_FN_TSI_YEAR 0x00000100L - -/* - * SQL_ODBC_API_CONFORMANCE - */ -#define SQL_OAC_NONE 0x0000 -#define SQL_OAC_LEVEL1 0x0001 -#define SQL_OAC_LEVEL2 0x0002 - -/* - * SQL_ODBC_SAG_CLI_CONFORMANCE - */ -#define SQL_OSCC_NOT_COMPLIANT 0x0000 -#define SQL_OSCC_COMPLIANT 0x0001 - -/* - * SQL_ODBC_SQL_CONFORMANCE - */ -#define SQL_OSC_MINIMUM 0x0000 -#define SQL_OSC_CORE 0x0001 -#define SQL_OSC_EXTENDED 0x0002 - -/* - * SQL_CONCAT_NULL_BEHAVIOR - */ -#define SQL_CB_NULL 0x0000 -#define SQL_CB_NON_NULL 0x0001 - -/* - * SQL_CURSOR_COMMIT_BEHAVIOR - * SQL_CURSOR_ROLLBACK_BEHAVIOR - */ -#define SQL_CB_DELETE 0x0000 -#define SQL_CB_CLOSE 0x0001 -#define SQL_CB_PRESERVE 0x0002 - -/* - * SQL_IDENTIFIER_CASE - */ -#define SQL_IC_UPPER 0x0001 -#define SQL_IC_LOWER 0x0002 -#define SQL_IC_SENSITIVE 0x0003 -#define SQL_IC_MIXED 0x0004 - -/* - * SQL_TXN_CAPABLE - */ -#define SQL_TC_NONE 0x0000 -#define SQL_TC_DML 0x0001 -#define SQL_TC_ALL 0x0002 -#define SQL_TC_DDL_COMMIT 0x0003 -#define SQL_TC_DDL_IGNORE 0x0004 - -/* - * SQL_SCROLL_OPTIONS - */ -#define SQL_SO_FORWARD_ONLY 0x00000001L -#define SQL_SO_KEYSET_DRIVEN 0x00000002L -#define SQL_SO_DYNAMIC 0x00000004L -#define SQL_SO_MIXED 0x00000008L -#define SQL_SO_STATIC 0x00000010L - -/* - * SQL_SCROLL_CONCURRENCY - */ -#define SQL_SCCO_READ_ONLY 0x00000001L -#define SQL_SCCO_LOCK 0x00000002L -#define SQL_SCCO_OPT_ROWVER 0x00000004L -#define SQL_SCCO_OPT_VALUES 0x00000008L - -/* - * SQL_FETCH_DIRECTION - */ -#define SQL_FD_FETCH_NEXT 0x00000001L -#define SQL_FD_FETCH_FIRST 0x00000002L -#define SQL_FD_FETCH_LAST 0x00000004L -#define SQL_FD_FETCH_PRIOR 0x00000008L -#define SQL_FD_FETCH_ABSOLUTE 0x00000010L -#define SQL_FD_FETCH_RELATIVE 0x00000020L -#define SQL_FD_FETCH_RESUME 0x00000040L -#define SQL_FD_FETCH_BOOKMARK 0x00000080L - -/* - * SQL_TXN_ISOLATION_OPTION - */ -#define SQL_TXN_READ_UNCOMMITTED 0x00000001L -#define SQL_TXN_READ_COMMITTED 0x00000002L -#define SQL_TXN_REPEATABLE_READ 0x00000004L -#define SQL_TXN_SERIALIZABLE 0x00000008L -#define SQL_TXN_VERSIONING 0x00000010L - -/* - * SQL_CORRELATION_NAME - */ -#define SQL_CN_NONE 0x0000 -#define SQL_CN_DIFFERENT 0x0001 -#define SQL_CN_ANY 0x0002 - -/* - * SQL_NON_NULLABLE_COLUMNS - */ -#define SQL_NNC_NULL 0x0000 -#define SQL_NNC_NON_NULL 0x0001 - -/* - * SQL_NULL_COLLATION - */ -#define SQL_NC_HIGH 0x0000 -#define SQL_NC_LOW 0x0001 -#define SQL_NC_START 0x0002 -#define SQL_NC_END 0x0004 - -/* - * SQL_FILE_USAGE - */ -#define SQL_FILE_NOT_SUPPORTED 0x0000 -#define SQL_FILE_TABLE 0x0001 -#define SQL_FILE_QUALIFIER 0x0002 - -/* - * SQL_GETDATA_EXTENSIONS - */ -#define SQL_GD_ANY_COLUMN 0x00000001L -#define SQL_GD_ANY_ORDER 0x00000002L -#define SQL_GD_BLOCK 0x00000004L -#define SQL_GD_BOUND 0x00000008L - -/* - * SQL_ALTER_TABLE - */ -#define SQL_AT_ADD_COLUMN 0x00000001L -#define SQL_AT_DROP_COLUMN 0x00000002L - -/* - * SQL_POSITIONED_STATEMENTS - */ -#define SQL_PS_POSITIONED_DELETE 0x00000001L -#define SQL_PS_POSITIONED_UPDATE 0x00000002L -#define SQL_PS_SELECT_FOR_UPDATE 0x00000004L - -/* - * SQL_GROUP_BY - */ -#define SQL_GB_NOT_SUPPORTED 0x0000 -#define SQL_GB_GROUP_BY_EQUALS_SELECT 0x0001 -#define SQL_GB_GROUP_BY_CONTAINS_SELECT 0x0002 -#define SQL_GB_NO_RELATION 0x0003 - -/* - * SQL_OWNER_USAGE - */ -#define SQL_OU_DML_STATEMENTS 0x00000001L -#define SQL_OU_PROCEDURE_INVOCATION 0x00000002L -#define SQL_OU_TABLE_DEFINITION 0x00000004L -#define SQL_OU_INDEX_DEFINITION 0x00000008L -#define SQL_OU_PRIVILEGE_DEFINITION 0x00000010L - -/* - * SQL_QUALIFIER_USAGE - */ -#define SQL_QU_DML_STATEMENTS 0x00000001L -#define SQL_QU_PROCEDURE_INVOCATION 0x00000002L -#define SQL_QU_TABLE_DEFINITION 0x00000004L -#define SQL_QU_INDEX_DEFINITION 0x00000008L -#define SQL_QU_PRIVILEGE_DEFINITION 0x00000010L - -/* - * SQL_SUBQUERIES - */ -#define SQL_SQ_COMPARISON 0x00000001L -#define SQL_SQ_EXISTS 0x00000002L -#define SQL_SQ_IN 0x00000004L -#define SQL_SQ_QUANTIFIED 0x00000008L -#define SQL_SQ_CORRELATED_SUBQUERIES 0x00000010L - -/* - * SQL_UNION - */ -#define SQL_U_UNION 0x00000001L -#define SQL_U_UNION_ALL 0x00000002L - -/* - * SQL_BOOKMARK_PERSISTENCE - */ -#define SQL_BP_CLOSE 0x00000001L -#define SQL_BP_DELETE 0x00000002L -#define SQL_BP_DROP 0x00000004L -#define SQL_BP_TRANSACTION 0x00000008L -#define SQL_BP_UPDATE 0x00000010L -#define SQL_BP_OTHER_HSTMT 0x00000020L -#define SQL_BP_SCROLL 0x00000040L - -/* - * SQL_STATIC_SENSITIVITY - */ -#define SQL_SS_ADDITIONS 0x00000001L -#define SQL_SS_DELETIONS 0x00000002L -#define SQL_SS_UPDATES 0x00000004L - -/* - * SQL_LOCK_TYPES - */ -#define SQL_LCK_NO_CHANGE 0x00000001L -#define SQL_LCK_EXCLUSIVE 0x00000002L -#define SQL_LCK_UNLOCK 0x00000004L - -/* - * SQL_POS_OPERATIONS - */ -#define SQL_POS_POSITION 0x00000001L -#define SQL_POS_REFRESH 0x00000002L -#define SQL_POS_UPDATE 0x00000004L -#define SQL_POS_DELETE 0x00000008L -#define SQL_POS_ADD 0x00000010L - -/* - * SQL_QUALIFIER_LOCATION - */ -#define SQL_QL_START 0x0001L -#define SQL_QL_END 0x0002L - -/* - * SQL_OJ_CAPABILITIES - */ -#define SQL_OJ_LEFT 0x00000001L -#define SQL_OJ_RIGHT 0x00000002L -#define SQL_OJ_FULL 0x00000004L -#define SQL_OJ_NESTED 0x00000008L -#define SQL_OJ_NOT_ORDERED 0x00000010L -#define SQL_OJ_INNER 0x00000020L -#define SQL_OJ_ALL_COMPARISON_OPS 0x00000040L - -/* - * SQLGetStmtOption/SQLSetStmtOption - */ -#define SQL_QUERY_TIMEOUT 0 -#define SQL_MAX_ROWS 1 -#define SQL_NOSCAN 2 -#define SQL_MAX_LENGTH 3 -#define SQL_ASYNC_ENABLE 4 -#define SQL_BIND_TYPE 5 -#define SQL_CURSOR_TYPE 6 -#define SQL_CONCURRENCY 7 -#define SQL_KEYSET_SIZE 8 -#define SQL_ROWSET_SIZE 9 -#define SQL_SIMULATE_CURSOR 10 -#define SQL_RETRIEVE_DATA 11 -#define SQL_USE_BOOKMARKS 12 -#define SQL_GET_BOOKMARK 13 -#define SQL_ROW_NUMBER 14 - -#define SQL_STMT_OPT_MIN SQL_QUERY_TIMEOUT -#define SQL_STMT_OPT_MAX SQL_ROW_NUMBER - - -/* - * SQL_QUERY_TIMEOUT - */ -#define SQL_QUERY_TIMEOUT_DEFAULT 0UL - -/* - * SQL_MAX_ROWS - */ -#define SQL_MAX_ROWS_DEFAULT 0UL - -/* - * SQL_NOSCAN - */ -#define SQL_NOSCAN_OFF 0UL /* 1.0 FALSE */ -#define SQL_NOSCAN_ON 1UL /* 1.0 TRUE */ -#define SQL_NOSCAN_DEFAULT SQL_NOSCAN_OFF - -/* - * SQL_MAX_LENGTH - */ -#define SQL_MAX_LENGTH_DEFAULT 0UL - -/* - * SQL_ASYNC_ENABLE - */ -#define SQL_ASYNC_ENABLE_OFF 0UL -#define SQL_ASYNC_ENABLE_ON 1UL -#define SQL_ASYNC_ENABLE_DEFAULT SQL_ASYNC_ENABLE_OFF - -/* - * SQL_BIND_TYPE - */ -#define SQL_BIND_BY_COLUMN 0UL -#define SQL_BIND_TYPE_DEFAULT SQL_BIND_BY_COLUMN - -/* - * SQL_CONCURRENCY - */ -#define SQL_CONCUR_READ_ONLY 1 -#define SQL_CONCUR_LOCK 2 -#define SQL_CONCUR_ROWVER 3 -#define SQL_CONCUR_VALUES 4 -#define SQL_CONCUR_DEFAULT SQL_CONCUR_READ_ONLY - -/* - * SQL_CURSOR_TYPE - */ -#define SQL_CURSOR_FORWARD_ONLY 0UL -#define SQL_CURSOR_KEYSET_DRIVEN 1UL -#define SQL_CURSOR_DYNAMIC 2UL -#define SQL_CURSOR_STATIC 3UL -#define SQL_CURSOR_TYPE_DEFAULT SQL_CURSOR_FORWARD_ONLY - -/* - * SQL_ROWSET_SIZE - */ -#define SQL_ROWSET_SIZE_DEFAULT 1UL - -/* - * SQL_KEYSET_SIZE - */ -#define SQL_KEYSET_SIZE_DEFAULT 0UL - -/* - * SQL_SIMULATE_CURSOR - */ -#define SQL_SC_NON_UNIQUE 0UL -#define SQL_SC_TRY_UNIQUE 1UL -#define SQL_SC_UNIQUE 2UL - -/* - * SQL_RETRIEVE_DATA - */ -#define SQL_RD_OFF 0UL -#define SQL_RD_ON 1UL -#define SQL_RD_DEFAULT SQL_RD_ON - -/* - * SQL_USE_BOOKMARKS - */ -#define SQL_UB_OFF 0UL -#define SQL_UB_ON 1UL -#define SQL_UB_DEFAULT SQL_UB_OFF - -/* - * SQLSetConnectOption/SQLGetConnectOption - */ -#define SQL_ACCESS_MODE 101 -#define SQL_AUTOCOMMIT 102 -#define SQL_LOGIN_TIMEOUT 103 -#define SQL_OPT_TRACE 104 -#define SQL_OPT_TRACEFILE 105 -#define SQL_TRANSLATE_DLL 106 -#define SQL_TRANSLATE_OPTION 107 -#define SQL_TXN_ISOLATION 108 -#define SQL_CURRENT_QUALIFIER 109 -#define SQL_ODBC_CURSORS 110 -#define SQL_QUIET_MODE 111 -#define SQL_PACKET_SIZE 112 - -#define SQL_CONN_OPT_MIN SQL_ACCESS_MODE -#define SQL_CONN_OPT_MAX SQL_PACKET_SIZE -#define SQL_CONNECT_OPT_DRVR_START 1000 - - -/* - * SQL_ACCESS_MODE - */ -#define SQL_MODE_READ_WRITE 0UL -#define SQL_MODE_READ_ONLY 1UL -#define SQL_MODE_DEFAULT SQL_MODE_READ_WRITE - -/* - * SQL_AUTOCOMMIT - */ -#define SQL_AUTOCOMMIT_OFF 0UL -#define SQL_AUTOCOMMIT_ON 1UL -#define SQL_AUTOCOMMIT_DEFAULT SQL_AUTOCOMMIT_ON - -/* - * SQL_LOGIN_TIMEOUT - */ -#define SQL_LOGIN_TIMEOUT_DEFAULT 15UL - -/* - * SQL_OPT_TRACE - */ -#define SQL_OPT_TRACE_OFF 0UL -#define SQL_OPT_TRACE_ON 1UL -#define SQL_OPT_TRACE_DEFAULT SQL_OPT_TRACE_OFF -#define SQL_OPT_TRACE_FILE_DEFAULT "odbc.log" - -/* - * SQL_ODBC_CURSORS - */ -#define SQL_CUR_USE_IF_NEEDED 0UL -#define SQL_CUR_USE_ODBC 1UL -#define SQL_CUR_USE_DRIVER 2UL -#define SQL_CUR_DEFAULT SQL_CUR_USE_DRIVER - -/* - * SQLSpecialColumns - Column types and scopes - */ -#define SQL_BEST_ROWID 1 -#define SQL_ROWVER 2 - -#define SQL_SCOPE_CURROW 0 -#define SQL_SCOPE_TRANSACTION 1 -#define SQL_SCOPE_SESSION 2 - -/* - * SQLSetPos - */ -#define SQL_ENTIRE_ROWSET 0 - -/* - * SQLSetPos - */ -#define SQL_POSITION 0 -#define SQL_REFRESH 1 -#define SQL_UPDATE 2 -#define SQL_DELETE 3 -#define SQL_ADD 4 - -/* - * SQLSetPos - */ -#define SQL_LOCK_NO_CHANGE 0 -#define SQL_LOCK_EXCLUSIVE 1 -#define SQL_LOCK_UNLOCK 2 - -/* - * SQLSetPos - */ -#define SQL_POSITION_TO(hstmt,irow) \ - SQLSetPos(hstmt,irow,SQL_POSITION,SQL_LOCK_NO_CHANGE) -#define SQL_LOCK_RECORD(hstmt,irow,fLock) \ - SQLSetPos(hstmt,irow,SQL_POSITION,fLock) -#define SQL_REFRESH_RECORD(hstmt,irow,fLock) \ - SQLSetPos(hstmt,irow,SQL_REFRESH,fLock) -#define SQL_UPDATE_RECORD(hstmt,irow) \ - SQLSetPos(hstmt,irow,SQL_UPDATE,SQL_LOCK_NO_CHANGE) -#define SQL_DELETE_RECORD(hstmt,irow) \ - SQLSetPos(hstmt,irow,SQL_DELETE,SQL_LOCK_NO_CHANGE) -#define SQL_ADD_RECORD(hstmt,irow) \ - SQLSetPos(hstmt,irow,SQL_ADD,SQL_LOCK_NO_CHANGE) - -/* - * All the ODBC keywords - */ -#define SQL_ODBC_KEYWORDS \ -"ABSOLUTE,ACTION,ADA,ADD,ALL,ALLOCATE,ALTER,AND,ANY,ARE,AS,"\ -"ASC,ASSERTION,AT,AUTHORIZATION,AVG,"\ -"BEGIN,BETWEEN,BIT,BIT_LENGTH,BOTH,BY,CASCADE,CASCADED,CASE,CAST,CATALOG,"\ -"CHAR,CHAR_LENGTH,CHARACTER,CHARACTER_LENGTH,CHECK,CLOSE,COALESCE,"\ -"COBOL,COLLATE,COLLATION,COLUMN,COMMIT,CONNECT,CONNECTION,CONSTRAINT,"\ -"CONSTRAINTS,CONTINUE,CONVERT,CORRESPONDING,COUNT,CREATE,CROSS,CURRENT,"\ -"CURRENT_DATE,CURRENT_TIME,CURRENT_TIMESTAMP,CURRENT_USER,CURSOR,"\ -"DATE,DAY,DEALLOCATE,DEC,DECIMAL,DECLARE,DEFAULT,DEFERRABLE,"\ -"DEFERRED,DELETE,DESC,DESCRIBE,DESCRIPTOR,DIAGNOSTICS,DISCONNECT,"\ -"DISTINCT,DOMAIN,DOUBLE,DROP,"\ -"ELSE,END,END-EXEC,ESCAPE,EXCEPT,EXCEPTION,EXEC,EXECUTE,"\ -"EXISTS,EXTERNAL,EXTRACT,"\ -"FALSE,FETCH,FIRST,FLOAT,FOR,FOREIGN,FORTRAN,FOUND,FROM,FULL,"\ -"GET,GLOBAL,GO,GOTO,GRANT,GROUP,HAVING,HOUR,"\ -"IDENTITY,IMMEDIATE,IN,INCLUDE,INDEX,INDICATOR,INITIALLY,INNER,"\ -"INPUT,INSENSITIVE,INSERT,INTEGER,INTERSECT,INTERVAL,INTO,IS,ISOLATION,"\ -"JOIN,KEY,LANGUAGE,LAST,LEADING,LEFT,LEVEL,LIKE,LOCAL,LOWER,"\ -"MATCH,MAX,MIN,MINUTE,MODULE,MONTH,MUMPS,"\ -"NAMES,NATIONAL,NATURAL,NCHAR,NEXT,NO,NONE,NOT,NULL,NULLIF,NUMERIC,"\ -"OCTET_LENGTH,OF,ON,ONLY,OPEN,OPTION,OR,ORDER,OUTER,OUTPUT,OVERLAPS,"\ -"PAD,PARTIAL,PASCAL,PLI,POSITION,PRECISION,PREPARE,PRESERVE,"\ -"PRIMARY,PRIOR,PRIVILEGES,PROCEDURE,PUBLIC,"\ -"REFERENCES,RELATIVE,RESTRICT,REVOKE,RIGHT,ROLLBACK,ROWS,"\ -"SCHEMA,SCROLL,SECOND,SECTION,SELECT,SEQUENCE,SESSION,SESSION_USER,SET,SIZE,"\ -"SMALLINT,SOME,SPACE,SQL,SQLCA,SQLCODE,SQLERROR,SQLSTATE,SQLWARNING,"\ -"SUBSTRING,SUM,SYSTEM_USER,"\ -"TABLE,TEMPORARY,THEN,TIME,TIMESTAMP,TIMEZONE_HOUR,TIMEZONE_MINUTE,"\ -"TO,TRAILING,TRANSACTION,TRANSLATE,TRANSLATION,TRIM,TRUE,"\ -"UNION,UNIQUE,UNKNOWN,UPDATE,UPPER,USAGE,USER,USING,"\ -"VALUE,,VARCHAR,VARYING,VIEW,WHEN,WHENEVER,WHERE,WITH,WORK,YEAR" - -/* - * ---------------------------------------------------------------------- - * Level 2 Functions - * ---------------------------------------------------------------------- - */ - -/* - * SQLExtendedFetch - fFetchType - */ -#define SQL_FETCH_NEXT 1 -#define SQL_FETCH_FIRST 2 -#define SQL_FETCH_LAST 3 -#define SQL_FETCH_PRIOR 4 -#define SQL_FETCH_ABSOLUTE 5 -#define SQL_FETCH_RELATIVE 6 -#define SQL_FETCH_BOOKMARK 8 - -/* - * SQLExtendedFetch - rgfRowStatus - */ -#define SQL_ROW_SUCCESS 0 -#define SQL_ROW_DELETED 1 -#define SQL_ROW_UPDATED 2 -#define SQL_ROW_NOROW 3 -#define SQL_ROW_ADDED 4 -#define SQL_ROW_ERROR 5 - -/* - * SQLForeignKeys - UPDATE_RULE/DELETE_RULE - */ -#define SQL_CASCADE 0 -#define SQL_RESTRICT 1 -#define SQL_SET_NULL 2 - -/* - * SQLBindParameter - fParamType - * SQLProcedureColumns - COLUMN_TYPE - */ -#define SQL_PARAM_TYPE_UNKNOWN 0 -#define SQL_PARAM_INPUT 1 -#define SQL_PARAM_INPUT_OUTPUT 2 -#define SQL_RESULT_COL 3 -#define SQL_PARAM_OUTPUT 4 -#define SQL_RETURN_VALUE 5 - -/* - * SQLSetParam to SQLBindParameter conversion - */ -#define SQL_PARAM_TYPE_DEFAULT SQL_PARAM_INPUT_OUTPUT -#define SQL_SETPARAM_VALUE_MAX (-1L) - -/* - * SQLStatistics - fUnique - */ -#define SQL_INDEX_UNIQUE 0 -#define SQL_INDEX_ALL 1 - -/* - * SQLStatistics - fAccuracy - */ -#define SQL_QUICK 0 -#define SQL_ENSURE 1 - -/* - * SQLStatistics - TYPE - */ -#define SQL_TABLE_STAT 0 -#define SQL_INDEX_CLUSTERED 1 -#define SQL_INDEX_HASHED 2 -#define SQL_INDEX_OTHER 3 - -/* - * SQLProcedures - PROCEDURE_TYPE - */ -#define SQL_PT_UNKNOWN 0 -#define SQL_PT_PROCEDURE 1 -#define SQL_PT_FUNCTION 2 - -/* - * SQLSpecialColumns - PSEUDO_COLUMN - */ -#define SQL_PC_UNKNOWN 0 -#define SQL_PC_NOT_PSEUDO 1 -#define SQL_PC_PSEUDO 2 - -/* - * Deprecated defines from prior versions of ODBC - */ -#define SQL_DATABASE_NAME 16 -#define SQL_FD_FETCH_PREV SQL_FD_FETCH_PRIOR -#define SQL_FETCH_PREV SQL_FETCH_PRIOR -#define SQL_CONCUR_TIMESTAMP SQL_CONCUR_ROWVER -#define SQL_SCCO_OPT_TIMESTAMP SQL_SCCO_OPT_ROWVER -#define SQL_CC_DELETE SQL_CB_DELETE -#define SQL_CR_DELETE SQL_CB_DELETE -#define SQL_CC_CLOSE SQL_CB_CLOSE -#define SQL_CR_CLOSE SQL_CB_CLOSE -#define SQL_CC_PRESERVE SQL_CB_PRESERVE -#define SQL_CR_PRESERVE SQL_CB_PRESERVE -#define SQL_FETCH_RESUME 7 -#define SQL_SCROLL_FORWARD_ONLY 0L -#define SQL_SCROLL_KEYSET_DRIVEN (-1L) -#define SQL_SCROLL_DYNAMIC (-2L) -#define SQL_SCROLL_STATIC (-3L) -#define SQL_PC_NON_PSEUDO SQL_PC_NOT_PSEUDO - -#ifdef __cplusplus -extern "C" { -#endif -/* - * Level 1 function prototypes - */ -RETCODE SQL_API SQLColumns (HSTMT hstmt, UCHAR FAR * szTableQualifier, - SWORD cbTableQualifier, UCHAR FAR * szTableOwner, SWORD cbTableOwner, - UCHAR FAR * szTableName, SWORD cbTableName, UCHAR FAR * szColumnName, - SWORD cbColumnName); -RETCODE SQL_API SQLDriverConnect (HDBC hdbc, SQLHWND hwnd, - UCHAR FAR * szConnStrIn, SWORD cbConnStrIn, UCHAR FAR * szConnStrOut, - SWORD cbConnStrOutMax, SWORD FAR * pcbConnStrOut, UWORD fDriverCompletion); -RETCODE SQL_API SQLGetConnectOption (HDBC hdbc, UWORD fOption, PTR pvParam); -RETCODE SQL_API SQLGetData (HSTMT hstmt, UWORD icol, SWORD fCType, - PTR rgbValue, SDWORD cbValueMax, SDWORD FAR * pcbValue); -RETCODE SQL_API SQLGetFunctions (HDBC hdbc, UWORD fFunction, - UWORD FAR * pfExists); -RETCODE SQL_API SQLGetInfo (HDBC hdbc, UWORD fInfoType, PTR rgbInfoValue, - SWORD cbInfoValueMax, SWORD FAR * pcbInfoValue); -RETCODE SQL_API SQLGetStmtOption (HSTMT hstmt, UWORD fOption, PTR pvParam); -RETCODE SQL_API SQLGetTypeInfo (HSTMT hstmt, SWORD fSqlType); -RETCODE SQL_API SQLParamData (HSTMT hstmt, PTR FAR * prgbValue); -RETCODE SQL_API SQLPutData (HSTMT hstmt, PTR rgbValue, SDWORD cbValue); -RETCODE SQL_API SQLSetConnectOption (HDBC hdbc, UWORD fOption, UDWORD vParam); -RETCODE SQL_API SQLSetStmtOption (HSTMT hstmt, UWORD fOption, UDWORD vParam); -RETCODE SQL_API SQLSpecialColumns (HSTMT hstmt, UWORD fColType, - UCHAR FAR * szTableQualifier, SWORD cbTableQualifier, - UCHAR FAR * szTableOwner, SWORD cbTableOwner, UCHAR FAR * szTableName, - SWORD cbTableName, UWORD fScope, UWORD fNullable); -RETCODE SQL_API SQLStatistics (HSTMT hstmt, UCHAR FAR * szTableQualifier, - SWORD cbTableQualifier, UCHAR FAR * szTableOwner, SWORD cbTableOwner, - UCHAR FAR * szTableName, SWORD cbTableName, UWORD fUnique, UWORD fAccuracy); -RETCODE SQL_API SQLTables (HSTMT hstmt, UCHAR FAR * szTableQualifier, - SWORD cbTableQualifier, UCHAR FAR * szTableOwner, SWORD cbTableOwner, - UCHAR FAR * szTableName, SWORD cbTableName, UCHAR FAR * szTableType, - SWORD cbTableType); - -/* - * Level 2 function prototypes - */ -RETCODE SQL_API SQLBrowseConnect (HDBC hdbc, - UCHAR FAR * szConnStrIn, SWORD cbConnStrIn, UCHAR FAR * szConnStrOut, - SWORD cbConnStrOutMax, SWORD FAR * pcbConnStrOut); -RETCODE SQL_API SQLColumnPrivileges (HSTMT hstmt, - UCHAR FAR * szTableQualifier, SWORD cbTableQualifier, - UCHAR FAR * szTableOwner, SWORD cbTableOwner, UCHAR FAR * szTableName, - SWORD cbTableName, UCHAR FAR * szColumnName, SWORD cbColumnName); -RETCODE SQL_API SQLDataSources (HENV henv, UWORD fDirection, - UCHAR FAR * szDSN, SWORD cbDSNMax, SWORD FAR * pcbDSN, - UCHAR FAR * szDescription, SWORD cbDescriptionMax, - SWORD FAR * pcbDescription); -RETCODE SQL_API SQLDescribeParam (HSTMT hstmt, UWORD ipar, - SWORD FAR * pfSqlType, UDWORD FAR * pcbColDef, SWORD FAR * pibScale, - SWORD FAR * pfNullable); -RETCODE SQL_API SQLExtendedFetch (HSTMT hstmt, UWORD fFetchType, SDWORD irow, - UDWORD FAR * pcrow, UWORD FAR * rgfRowStatus); -RETCODE SQL_API SQLForeignKeys (HSTMT hstmt, UCHAR FAR * szPkTableQualifier, - SWORD cbPkTableQualifier, UCHAR FAR * szPkTableOwner, SWORD cbPkTableOwner, - UCHAR FAR * szPkTableName, SWORD cbPkTableName, - UCHAR FAR * szFkTableQualifier, SWORD cbFkTableQualifier, - UCHAR FAR * szFkTableOwner, SWORD cbFkTableOwner, UCHAR FAR * szFkTableName, - SWORD cbFkTableName); -RETCODE SQL_API SQLMoreResults (HSTMT hstmt); -RETCODE SQL_API SQLNativeSql (HDBC hdbc, UCHAR FAR * szSqlStrIn, - SDWORD cbSqlStrIn, UCHAR FAR * szSqlStr, SDWORD cbSqlStrMax, - SDWORD FAR * pcbSqlStr); -RETCODE SQL_API SQLNumParams (HSTMT hstmt, SWORD FAR * pcpar); -RETCODE SQL_API SQLParamOptions (HSTMT hstmt, UDWORD crow, UDWORD FAR * pirow); -RETCODE SQL_API SQLPrimaryKeys (HSTMT hstmt, UCHAR FAR * szTableQualifier, - SWORD cbTableQualifier, UCHAR FAR * szTableOwner, SWORD cbTableOwner, - UCHAR FAR * szTableName, SWORD cbTableName); -RETCODE SQL_API SQLProcedureColumns (HSTMT hstmt, UCHAR FAR * szProcQualifier, - SWORD cbProcQualifier, UCHAR FAR * szProcOwner, SWORD cbProcOwner, - UCHAR FAR * szProcName, SWORD cbProcName, UCHAR FAR * szColumnName, - SWORD cbColumnName); -RETCODE SQL_API SQLProcedures (HSTMT hstmt, UCHAR FAR * szProcQualifier, - SWORD cbProcQualifier, UCHAR FAR * szProcOwner, SWORD cbProcOwner, - UCHAR FAR * szProcName, SWORD cbProcName); -RETCODE SQL_API SQLSetPos (HSTMT hstmt, UWORD irow, UWORD fOption, UWORD fLock); -RETCODE SQL_API SQLTablePrivileges (HSTMT hstmt, UCHAR FAR * szTableQualifier, - SWORD cbTableQualifier, UCHAR FAR * szTableOwner, SWORD cbTableOwner, - UCHAR FAR * szTableName, SWORD cbTableName); - -/* - * SDK 2.0 Additional function prototypes - */ -RETCODE SQL_API SQLDrivers (HENV henv, UWORD fDirection, - UCHAR FAR * szDriverDesc, SWORD cbDriverDescMax, SWORD FAR * pcbDriverDesc, - UCHAR FAR * szDriverAttributes, SWORD cbDrvrAttrMax, - SWORD FAR * pcbDrvrAttr); -RETCODE SQL_API SQLBindParameter (HSTMT hstmt, UWORD ipar, SWORD fParamType, - SWORD fCType, SWORD fSqlType, UDWORD cbColDef, SWORD ibScale, PTR rgbValue, - SDWORD cbValueMax, SDWORD FAR * pcbValue); - -/* - * Deprecated - use SQLSetStmtOptions - */ -RETCODE SQL_API SQLSetScrollOptions (HSTMT hstmt, UWORD fConcurrency, - SDWORD crowKeyset, UWORD crowRowset); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/wxWidgets/src/iodbc/itrace.c b/wxWidgets/src/iodbc/itrace.c deleted file mode 100644 index 475e4a12d1..0000000000 --- a/wxWidgets/src/iodbc/itrace.c +++ /dev/null @@ -1,117 +0,0 @@ -/* - * itrace.c - * - * $Id: itrace.c 2613 1999-06-01 15:32:12Z VZ $ - * - * Trace functions - * - * The iODBC driver manager. - * - * Copyright (C) 1995 by Ke Jin - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -#include "config.h" - -#include "isql.h" -#include "isqlext.h" - -#include "dlproc.h" - -#include "itrace.h" - -#include "herr.h" -#include "henv.h" -#include "henv.ci" - -#include - -static int -printreturn (void FAR * istm, int ret) -{ - FILE FAR *stm = (FILE FAR *) istm; - char FAR *ptr = "Invalid return value"; - - switch (ret) - { - case SQL_SUCCESS: - ptr = "SQL_SUCCESS"; - break; - - case SQL_SUCCESS_WITH_INFO: - ptr = "SQL_SUCCESS_WITH_INFO"; - break; - - case SQL_NO_DATA_FOUND: - ptr = "SQL_NO_DATA_FOUND"; - break; - - case SQL_NEED_DATA: - ptr = "SQL_NEED_DATA"; - break; - - case SQL_INVALID_HANDLE: - ptr = "SQL_INVALID_HANDLE"; - break; - - case SQL_ERROR: - ptr = "SQL_ERROR"; - break; - - case SQL_STILL_EXECUTING: - ptr = "SQL_STILL_EXECUTING"; - break; - - default: - break; - } - - fprintf (stm, "%s\n", ptr); - fflush (stm); - - return 0; -} - - -HPROC -_iodbcdm_gettrproc (void FAR * istm, int procid, int type) -{ - FILE FAR *stm = (FILE FAR *) istm; - - if (type == TRACE_TYPE_DM2DRV) - { - int i, j = 0; - - for (i = 0; j != en_NullProc; i++) - { - j = odbcapi_symtab[i].en_idx; - - if (j == procid) - { - fprintf (stm, "\n%s ( ... )\n", odbcapi_symtab[i].symbol); - - fflush (stm); - } - } - } - - if (type == TRACE_TYPE_RETURN) - { - return (HPROC) printreturn; - } - - return SQL_NULL_HPROC; -} diff --git a/wxWidgets/src/iodbc/itrace.h b/wxWidgets/src/iodbc/itrace.h deleted file mode 100644 index 70f802f709..0000000000 --- a/wxWidgets/src/iodbc/itrace.h +++ /dev/null @@ -1,124 +0,0 @@ -/* - * itrace.h - * - * $Id: itrace.h 1446 1999-01-22 10:52:42Z RR $ - * - * Trace functions - * - * The iODBC driver manager. - * - * Copyright (C) 1995 by Ke Jin - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ -#ifndef _ITRACE_H -#define _ITRACE_H - -#ifdef DEBUG - -#ifndef NO_TRACE -#define NO_TRACE -#endif - -#endif - -#define TRACE_TYPE_APP2DM 1 -#define TRACE_TYPE_DM2DRV 2 -#define TRACE_TYPE_DRV2DM 3 - -#define TRACE_TYPE_RETURN 4 - -extern HPROC _iodbcdm_gettrproc (void FAR * stm, int procid, int type); - -#ifdef NO_TRACE -#define TRACE_CALL( stm, trace_on, procid, plist ) -#else -#define TRACE_CALL( stm, trace_on, plist )\ - {\ - if( trace_on)\ - {\ - HPROC hproc;\ -\ - hproc = _iodbcdm_gettrproc(stm, procid, TRACE_TYPE_APP2DM);\ -\ - if( hproc )\ - hproc plist;\ - }\ - } -#endif - -#ifdef NO_TRACE -#define TRACE_DM2DRV( stm, procid, plist ) -#else -#define TRACE_DM2DRV( stm, procid, plist )\ - {\ - HPROC hproc;\ -\ - hproc = _iodbcdm_gettrproc(stm, procid, TRACE_TYPE_DM2DRV);\ -\ - if( hproc )\ - hproc plist;\ - } -#endif - -#ifdef NO_TRACE -#define TRACE_DRV2DM( stm, procid, plist ) -#else -#define TRACE_DRV2DM( stm, procid, plist ) \ - {\ - HPROC hproc;\ -\ - hproc = _iodbcdm_gettrproc( stm, procid, TRACE_TYPE_DRV2DM);\ -\ - if( hproc )\ - hproc plist;\ - } -#endif - -#ifdef NO_TRACE -#define TRACE_RETURN( stm, trace_on, ret ) -#else -#define TRACE_RETURN( stm, trace_on, ret )\ - {\ - if( trace_on ) {\ - HPROC hproc;\ -\ - hproc = _iodbcdm_gettrproc( stm, 0, TRACE_TYPE_RETURN);\ -\ - if( hproc )\ - hproc( stm, ret );\ - }\ - } -#endif - -#ifdef NO_TRACE -#define CALL_DRIVER( hdbc, ret, proc, procid, plist ) { ret = proc plist; } -#else -#define CALL_DRIVER( hdbc, ret, proc, procid, plist )\ - {\ - DBC_t FAR* pdbc = (DBC_t FAR*)(hdbc);\ -\ - if( pdbc->trace ) {\ - TRACE_DM2DRV( pdbc->tstm, procid, plist )\ - ret = proc plist;\ - TRACE_DRV2DM( pdbc->tstm, procid, plist )\ - TRACE_RETURN( pdbc->tstm, 1, ret )\ - }\ - else\ - ret = proc plist;\ - } -#endif - -#endif diff --git a/wxWidgets/src/iodbc/misc.c b/wxWidgets/src/iodbc/misc.c deleted file mode 100644 index e2e154f142..0000000000 --- a/wxWidgets/src/iodbc/misc.c +++ /dev/null @@ -1,413 +0,0 @@ -/* - * misc.c - * - * $Id: misc.c 2613 1999-06-01 15:32:12Z VZ $ - * - * Miscellaneous functions - * - * The iODBC driver manager. - * - * Copyright (C) 1995 by Ke Jin - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -#include "config.h" - -#include "isql.h" -#include "isqlext.h" - -#include -#include - -static int -upper_strneq ( - char *s1, - char *s2, - int n) -{ - int i; - char c1, c2; - - for (i = 1; i < n; i++) - { - c1 = s1[i]; - c2 = s2[i]; - - if (c1 >= 'a' && c1 <= 'z') - { - c1 += ('A' - 'a'); - } - else if (c1 == '\n') - { - c1 = '\0'; - } - - if (c2 >= 'a' && c2 <= 'z') - { - c2 += ('A' - 'a'); - } - else if (c2 == '\n') - { - c2 = '\0'; - } - - if ((c1 - c2) || !c1 || !c2) - { - break; - } - } - - return (int) !(c1 - c2); -} - -static char * /* return new position in input str */ -readtoken ( - char *istr, /* old position in input buf */ - char *obuf) /* token string ( if "\0", then finished ) */ -{ - char *start = obuf; - - /* Skip leading white space */ - while (*istr == ' ' || *istr == '\t') - istr++; - - for (; *istr && *istr != '\n'; istr++) - { - char c, nx; - - c = *(istr); - nx = *(istr + 1); - - if (c == ';') - { - for (; *istr && *istr != '\n'; istr++); - break; - } - *obuf = c; - obuf++; - - if (nx == ';' || nx == '=' || c == '=') - { - istr++; - break; - } - } - *obuf = '\0'; - - /* Trim end of token */ - for (; obuf > start && (*(obuf - 1) == ' ' || *(obuf - 1) == '\t');) - *--obuf = '\0'; - - return istr; -} - -#if !defined(WINDOWS) && !defined(WIN32) && !defined(OS2) -# include -# define UNIX_PWD -#endif - -char * -_iodbcdm_getinifile (char *buf, int size) -{ - int i, j; - char *ptr; - - j = STRLEN ("/odbc.ini") + 1; - - if (size < j) - { - return NULL; - } - -#if !defined(UNIX_PWD) - - i = GetWindowsDirectory ((LPSTR) buf, size); - - if (i == 0 || i > size - j) - { - return NULL; - } - - sprintf (buf + i, "/odbc.ini"); - - return buf; -#else - if ((ptr = getenv ("ODBCINI")) != NULL) - { - strcpy (buf, ptr); - return buf; - } - - if ((ptr = getenv ("IODBCINI")) != NULL) - { - strcpy (buf, ptr); - return buf; - } - - if ((ptr = getenv ("HOME")) == NULL) - { - ptr = (char *) getpwuid (getuid ()); - - if (ptr == NULL) - { - return NULL; - } - - ptr = ((struct passwd *) ptr)->pw_dir; - } - - if (ptr == NULL || *ptr == '\0') - { - ptr = "/home"; - } - - if (size < STRLEN (ptr) + j) - { - return NULL; - } - - sprintf (buf, "%s%s", ptr, "/.odbc.ini"); - /* i.e. searching ~/.odbc.ini */ -#endif - - return buf; -} - - -/* - * read odbc init file to resolve the value of specified - * key from named or defaulted dsn section - */ -char * -_iodbcdm_getkeyvalbydsn ( - char *dsn, - int dsnlen, - char *keywd, - char *value, - int size) -{ - char buf[1024]; - char dsntk[SQL_MAX_DSN_LENGTH + 3] = {'[', '\0'}; - char token[1024]; /* large enough */ - FILE *file; - char pathbuf[1024]; - char *path; - -#define DSN_NOMATCH 0 -#define DSN_NAMED 1 -#define DSN_DEFAULT 2 - - int dsnid = DSN_NOMATCH; - int defaultdsn = DSN_NOMATCH; - - if (dsn == NULL || *dsn == 0) - { - dsn = "default"; - dsnlen = STRLEN (dsn); - } - - if (dsnlen == SQL_NTS) - { - dsnlen = STRLEN (dsn); - } - - if (dsnlen <= 0 || keywd == NULL || buf == 0 || size <= 0) - { - return NULL; - } - - if (dsnlen > sizeof (dsntk) - 2) - { - return NULL; - } - - value[0] = '\0'; - - STRNCAT (dsntk, dsn, dsnlen); - STRCAT (dsntk, "]"); - - dsnlen = dsnlen + 2; - - path = _iodbcdm_getinifile (pathbuf, sizeof (pathbuf)); - - if (path == NULL) - { - return NULL; - } - - file = (FILE *) fopen (path, "r"); - - if (file == NULL) - { - return NULL; - } - - for (;;) - { - char *str; - - str = fgets (buf, sizeof (buf), file); - - if (str == NULL) - { - break; - } - - if (*str == '[') - { - if (upper_strneq (str, "[default]", STRLEN ("[default]"))) - { - /* we only read first dsn default dsn - * section (as well as named dsn). - */ - if (defaultdsn == DSN_NOMATCH) - { - dsnid = DSN_DEFAULT; - defaultdsn = DSN_DEFAULT; - } - else - { - dsnid = DSN_NOMATCH; - } - - continue; - } - else if (upper_strneq (str, dsntk, dsnlen)) - { - dsnid = DSN_NAMED; - } - else - { - dsnid = DSN_NOMATCH; - } - - continue; - } - else if (dsnid == DSN_NOMATCH) - { - continue; - } - - str = readtoken (str, token); - - if (upper_strneq (keywd, token, STRLEN (keywd))) - { - str = readtoken (str, token); - - if (!STREQ (token, "=")) - /* something other than = */ - { - continue; - } - - str = readtoken (str, token); - - if (STRLEN (token) > size - 1) - { - break; - } - - STRNCPY (value, token, size); - /* copy the value(i.e. next token) to buf */ - - if (dsnid != DSN_DEFAULT) - { - break; - } - } - } - - fclose (file); - - return (*value) ? value : NULL; -} - - -char * -_iodbcdm_getkeyvalinstr ( - char *cnstr, - int cnlen, - char *keywd, - char *value, - int size) -{ - char token[1024] = {'\0'}; - int flag = 0; - - if (cnstr == NULL || value == NULL - || keywd == NULL || size < 1) - { - return NULL; - } - - if (cnlen == SQL_NTS) - { - cnlen = STRLEN (cnstr); - } - - if (cnlen <= 0) - { - return NULL; - } - - for (;;) - { - cnstr = readtoken (cnstr, token); - - if (*token == '\0') - { - break; - } - - if (STREQ (token, ";")) - { - flag = 0; - continue; - } - - switch (flag) - { - case 0: - if (upper_strneq (token, keywd, strlen (keywd))) - { - flag = 1; - } - break; - - case 1: - if (STREQ (token, "=")) - { - flag = 2; - } - break; - - case 2: - if (size < strlen (token) + 1) - { - return NULL; - } - - STRNCPY (value, token, size); - - return value; - - default: - break; - } - } - - return NULL; -} diff --git a/wxWidgets/src/iodbc/prepare.c b/wxWidgets/src/iodbc/prepare.c deleted file mode 100644 index 1be31512d9..0000000000 --- a/wxWidgets/src/iodbc/prepare.c +++ /dev/null @@ -1,525 +0,0 @@ -/* - * prepare.c - * - * $Id: prepare.c 2613 1999-06-01 15:32:12Z VZ $ - * - * Prepare a query - * - * The iODBC driver manager. - * - * Copyright (C) 1995 by Ke Jin - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -#include "config.h" - -#include "isql.h" -#include "isqlext.h" - -#include "dlproc.h" - -#include "herr.h" -#include "henv.h" -#include "hdbc.h" -#include "hstmt.h" - -#include "itrace.h" - -#include - -RETCODE SQL_API -SQLPrepare ( - HSTMT hstmt, - UCHAR FAR * szSqlStr, - SDWORD cbSqlStr) -{ - STMT_t FAR *pstmt = (STMT_t *) hstmt; - - HPROC hproc = SQL_NULL_HPROC; - RETCODE retcode = SQL_SUCCESS; - int sqlstat = en_00000; - - if (hstmt == SQL_NULL_HSTMT || pstmt->hdbc == SQL_NULL_HDBC) - { - return SQL_INVALID_HANDLE; - } - - /* check state */ - if (pstmt->asyn_on == en_NullProc) - { - /* not on asyn state */ - switch (pstmt->state) - { - case en_stmt_fetched: - case en_stmt_xfetched: - sqlstat = en_24000; - break; - - case en_stmt_needdata: - case en_stmt_mustput: - case en_stmt_canput: - sqlstat = en_S1010; - break; - - default: - break; - } - } - else if (pstmt->asyn_on != en_Prepare) - { - /* asyn on other */ - sqlstat = en_S1010; - } - - if (sqlstat != en_00000) - { - PUSHSQLERR (pstmt->herr, sqlstat); - - return SQL_ERROR; - } - - if (szSqlStr == NULL) - { - PUSHSQLERR (pstmt->herr, en_S1009); - - return SQL_ERROR; - } - - if (cbSqlStr < 0 && cbSqlStr != SQL_NTS) - { - PUSHSQLERR (pstmt->herr, en_S1090); - - return SQL_ERROR; - } - - hproc = _iodbcdm_getproc (pstmt->hdbc, en_Prepare); - - if (hproc == SQL_NULL_HPROC) - { - PUSHSQLERR (pstmt->herr, en_IM001); - return SQL_ERROR; - } - - CALL_DRIVER (pstmt->hdbc, retcode, hproc, en_Prepare, - (pstmt->dhstmt, szSqlStr, cbSqlStr)) - - /* stmt state transition */ - if (pstmt->asyn_on == en_Prepare) - { - switch (retcode) - { - case SQL_SUCCESS: - case SQL_SUCCESS_WITH_INFO: - case SQL_ERROR: - pstmt->asyn_on = en_NullProc; - return retcode; - - case SQL_STILL_EXECUTING: - default: - return retcode; - } - } - - switch (retcode) - { - case SQL_STILL_EXECUTING: - pstmt->asyn_on = en_Prepare; - break; - - case SQL_SUCCESS: - case SQL_SUCCESS_WITH_INFO: - pstmt->state = en_stmt_prepared; - pstmt->prep_state = 1; - break; - - case SQL_ERROR: - switch (pstmt->state) - { - case en_stmt_prepared: - case en_stmt_executed: - pstmt->state = en_stmt_allocated; - pstmt->prep_state = 0; - break; - - default: - break; - } - - default: - break; - } - - return retcode; -} - - -RETCODE SQL_API -SQLSetCursorName ( - HSTMT hstmt, - UCHAR FAR * szCursor, - SWORD cbCursor) -{ - STMT_t FAR *pstmt = (STMT_t *) hstmt; - HPROC hproc = SQL_NULL_HPROC; - - RETCODE retcode = SQL_SUCCESS; - int sqlstat = en_00000; - - if (hstmt == SQL_NULL_HSTMT || pstmt->hdbc == SQL_NULL_HDBC) - { - return SQL_INVALID_HANDLE; - } - - if (szCursor == NULL) - { - PUSHSQLERR (pstmt->herr, en_S1009); - - return SQL_ERROR; - } - - if (cbCursor < 0 && cbCursor != SQL_NTS) - { - PUSHSQLERR (pstmt->herr, en_S1090); - - return SQL_ERROR; - } - - /* check state */ - if (pstmt->asyn_on != en_NullProc) - { - sqlstat = en_S1010; - } - else - { - switch (pstmt->state) - { - case en_stmt_executed: - case en_stmt_cursoropen: - case en_stmt_fetched: - case en_stmt_xfetched: - sqlstat = en_24000; - break; - - case en_stmt_needdata: - case en_stmt_mustput: - case en_stmt_canput: - sqlstat = en_S1010; - break; - - default: - break; - } - } - - if (sqlstat != en_00000) - { - PUSHSQLERR (pstmt->herr, sqlstat); - - return SQL_ERROR; - } - - hproc = _iodbcdm_getproc (pstmt->hdbc, en_SetCursorName); - - if (hproc == SQL_NULL_HPROC) - { - PUSHSQLERR (pstmt->herr, en_IM001); - - return SQL_ERROR; - } - - CALL_DRIVER (pstmt->hdbc, retcode, hproc, en_SetCursorName, - (pstmt->dhstmt, szCursor, cbCursor)) - - if (retcode == SQL_SUCCESS || retcode == SQL_SUCCESS_WITH_INFO) - { - pstmt->cursor_state = en_stmt_cursor_named; - } - - return retcode; -} - - -RETCODE SQL_API -SQLBindParameter ( - HSTMT hstmt, - UWORD ipar, - SWORD fParamType, - SWORD fCType, - SWORD fSqlType, - UDWORD cbColDef, - SWORD ibScale, - PTR rgbValue, - SDWORD cbValueMax, - SDWORD FAR * pcbValue) -{ - STMT_t FAR *pstmt = (STMT_t FAR *) hstmt; - HPROC hproc = SQL_NULL_HPROC; - - int sqlstat = en_00000; - RETCODE retcode = SQL_SUCCESS; - - if (hstmt == SQL_NULL_HSTMT || pstmt->hdbc == SQL_NULL_HDBC) - { - return SQL_INVALID_HANDLE; - } - - /* check param */ - if (fSqlType > SQL_TYPE_MAX || - (fSqlType < SQL_TYPE_MIN && fSqlType > SQL_TYPE_DRIVER_START)) - /* Note: SQL_TYPE_DRIVER_START is a nagtive number - * So, we use ">" */ - { - sqlstat = en_S1004; - } - else if (ipar < 1) - { - sqlstat = en_S1093; - } - else if ((rgbValue == NULL && pcbValue == NULL) - && fParamType != SQL_PARAM_OUTPUT) - { - sqlstat = en_S1009; - /* This means, I allow output to nowhere - * (i.e. * junk output result). But I can't - * allow input from nowhere. - */ - } -/********** - else if( cbValueMax < 0L && cbValueMax != SQL_SETPARAM_VALUE_MAX ) - { - sqlstat = en_S1090; - } -**********/ - else if (fParamType != SQL_PARAM_INPUT - && fParamType != SQL_PARAM_OUTPUT - && fParamType != SQL_PARAM_INPUT_OUTPUT) - { - sqlstat = en_S1105; - } - else - { - switch (fCType) - { - case SQL_C_DEFAULT: - case SQL_C_CHAR: - case SQL_C_BINARY: - case SQL_C_BIT: - case SQL_C_TINYINT: - case SQL_C_STINYINT: - case SQL_C_UTINYINT: - case SQL_C_SHORT: - case SQL_C_SSHORT: - case SQL_C_USHORT: - case SQL_C_LONG: - case SQL_C_SLONG: - case SQL_C_ULONG: - case SQL_C_FLOAT: - case SQL_C_DOUBLE: - case SQL_C_DATE: - case SQL_C_TIME: - case SQL_C_TIMESTAMP: - break; - - default: - sqlstat = en_S1003; - break; - } - } - - if (sqlstat != en_00000) - { - PUSHSQLERR (pstmt->herr, sqlstat); - - return SQL_ERROR; - } - - /* check state */ - if (pstmt->state >= en_stmt_needdata || pstmt->asyn_on != en_NullProc) - { - PUSHSQLERR (pstmt->herr, en_S1010); - - retcode = SQL_ERROR; - } - - hproc = _iodbcdm_getproc (pstmt->hdbc, en_BindParameter); - - if (hproc == SQL_NULL_HPROC) - { - PUSHSQLERR (pstmt->herr, en_IM001); - - return SQL_ERROR; - } - - CALL_DRIVER (pstmt->hdbc, retcode, hproc, en_BindParameter, - (pstmt->dhstmt, ipar, fParamType, fCType, fSqlType, cbColDef, - ibScale, rgbValue, cbValueMax, pcbValue)) - - return retcode; -} - - -RETCODE SQL_API -SQLParamOptions ( - HSTMT hstmt, - UDWORD crow, - UDWORD FAR * pirow) -{ - STMT_t FAR *pstmt = (STMT_t FAR *) hstmt; - HPROC hproc; - RETCODE retcode; - - if (hstmt == SQL_NULL_HSTMT || pstmt->hdbc == SQL_NULL_HDBC) - { - return SQL_INVALID_HANDLE; - } - - if (crow == (UDWORD) 0UL) - { - PUSHSQLERR (pstmt->herr, en_S1107); - - return SQL_ERROR; - } - - if (pstmt->state >= en_stmt_needdata || pstmt->asyn_on != en_NullProc) - { - PUSHSQLERR (pstmt->herr, en_S1010); - - return SQL_ERROR; - } - - hproc = _iodbcdm_getproc (pstmt->hdbc, en_ParamOptions); - - if (hproc == SQL_NULL_HPROC) - { - PUSHSQLERR (pstmt->herr, en_IM001); - - return SQL_ERROR; - } - - CALL_DRIVER (pstmt->hdbc, retcode, hproc, en_ParamOptions, - (pstmt->dhstmt, crow, pirow)) - - return retcode; -} - - -RETCODE SQL_API -SQLSetScrollOptions ( - HSTMT hstmt, - UWORD fConcurrency, - SDWORD crowKeyset, - UWORD crowRowset) -{ - STMT_t FAR *pstmt = (STMT_t FAR *) hstmt; - HPROC hproc; - int sqlstat = en_00000; - RETCODE retcode; - - if (hstmt == SQL_NULL_HSTMT || pstmt->hdbc == SQL_NULL_HDBC) - { - return SQL_INVALID_HANDLE; - } - - for (;;) - { - if (crowRowset == (UWORD) 0) - { - sqlstat = en_S1107; - break; - } - - if (crowKeyset > (SDWORD) 0L && crowKeyset < (SDWORD) crowRowset) - { - sqlstat = en_S1107; - break; - } - - if (crowKeyset < 1) - { - if (crowKeyset != SQL_SCROLL_FORWARD_ONLY - && crowKeyset != SQL_SCROLL_STATIC - && crowKeyset != SQL_SCROLL_KEYSET_DRIVEN - && crowKeyset != SQL_SCROLL_DYNAMIC) - { - sqlstat = en_S1107; - break; - } - } - - if (fConcurrency != SQL_CONCUR_READ_ONLY - && fConcurrency != SQL_CONCUR_LOCK - && fConcurrency != SQL_CONCUR_ROWVER - && fConcurrency != SQL_CONCUR_VALUES) - { - sqlstat = en_S1108; - break; - } - - if (pstmt->state != en_stmt_allocated) - { - sqlstat = en_S1010; - break; - } - - hproc = _iodbcdm_getproc (pstmt->hdbc, en_SetScrollOptions); - - if (hproc == SQL_NULL_HPROC) - { - sqlstat = en_IM001; - break; - } - - sqlstat = en_00000; - if (1) /* turn off solaris warning message */ - break; - } - - if (sqlstat != en_00000) - { - PUSHSQLERR (pstmt->herr, sqlstat); - - return SQL_ERROR; - } - - CALL_DRIVER (pstmt->hdbc, retcode, hproc, en_SetScrollOptions, - (pstmt->dhstmt, fConcurrency, crowKeyset, crowRowset)) - - return retcode; -} - - -RETCODE SQL_API -SQLSetParam ( - HSTMT hstmt, - UWORD ipar, - SWORD fCType, - SWORD fSqlType, - UDWORD cbColDef, - SWORD ibScale, - PTR rgbValue, - SDWORD FAR * pcbValue) -{ - return SQLBindParameter (hstmt, - ipar, - (SWORD) SQL_PARAM_INPUT_OUTPUT, - fCType, - fSqlType, - cbColDef, - ibScale, - rgbValue, - SQL_SETPARAM_VALUE_MAX, - pcbValue); -} diff --git a/wxWidgets/src/iodbc/result.c b/wxWidgets/src/iodbc/result.c deleted file mode 100644 index dafe4540f0..0000000000 --- a/wxWidgets/src/iodbc/result.c +++ /dev/null @@ -1,523 +0,0 @@ -/* - * result.c - * - * $Id: result.c 2613 1999-06-01 15:32:12Z VZ $ - * - * Prepare for getting query result - * - * The iODBC driver manager. - * - * Copyright (C) 1995 by Ke Jin - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -#include "config.h" - -#include "isql.h" -#include "isqlext.h" - -#include "dlproc.h" - -#include "herr.h" -#include "henv.h" -#include "hdbc.h" -#include "hstmt.h" - -#include "itrace.h" - -RETCODE SQL_API -SQLBindCol ( - HSTMT hstmt, - UWORD icol, - SWORD fCType, - PTR rgbValue, - SDWORD cbValueMax, - SDWORD FAR * pcbValue) -{ - STMT_t FAR *pstmt = (STMT_t FAR *) hstmt; - HPROC hproc = SQL_NULL_HPROC; - RETCODE retcode; - - if (hstmt == SQL_NULL_HSTMT || pstmt->hdbc == SQL_NULL_HDBC) - { - return SQL_INVALID_HANDLE; - } - - /* check argument */ - switch (fCType) - { - case SQL_C_DEFAULT: - case SQL_C_CHAR: - case SQL_C_BINARY: - case SQL_C_BIT: - case SQL_C_TINYINT: - case SQL_C_STINYINT: - case SQL_C_UTINYINT: - case SQL_C_SHORT: - case SQL_C_SSHORT: - case SQL_C_USHORT: - case SQL_C_LONG: - case SQL_C_SLONG: - case SQL_C_ULONG: - case SQL_C_FLOAT: - case SQL_C_DOUBLE: - case SQL_C_DATE: - case SQL_C_TIME: - case SQL_C_TIMESTAMP: - break; - - default: - PUSHSQLERR (pstmt->herr, en_S1003); - return SQL_ERROR; - } - - if (cbValueMax < 0) - { - PUSHSQLERR (pstmt->herr, en_S1090); - - return SQL_ERROR; - } - - /* check state */ - if (pstmt->state > en_stmt_needdata || pstmt->asyn_on != en_NullProc) - { - PUSHSQLERR (pstmt->herr, en_S1010); - return SQL_ERROR; - } - - /* call driver's function */ - hproc = _iodbcdm_getproc (pstmt->hdbc, en_BindCol); - - if (hproc == SQL_NULL_HPROC) - { - PUSHSQLERR (pstmt->herr, en_IM001); - - return SQL_ERROR; - } - - CALL_DRIVER (pstmt->hdbc, retcode, hproc, en_BindCol, - (pstmt->dhstmt, icol, fCType, rgbValue, cbValueMax, pcbValue)) - - return retcode; -} - - -RETCODE SQL_API -SQLGetCursorName ( - HSTMT hstmt, - UCHAR FAR * szCursor, - SWORD cbCursorMax, - SWORD FAR * pcbCursor) -{ - STMT_t FAR *pstmt = (STMT_t FAR *) hstmt; - HPROC hproc; - RETCODE retcode; - - if (hstmt == SQL_NULL_HSTMT || pstmt->hdbc == SQL_NULL_HDBC) - { - return SQL_INVALID_HANDLE; - } - - /* check argument */ - if (cbCursorMax < (SWORD) 0) - { - PUSHSQLERR (pstmt->herr, en_S1090); - - return SQL_ERROR; - } - - /* check state */ - if (pstmt->state >= en_stmt_needdata || pstmt->asyn_on != en_NullProc) - { - PUSHSQLERR (pstmt->herr, en_S1010); - - return SQL_ERROR; - } - - if (pstmt->state < en_stmt_cursoropen - && pstmt->cursor_state == en_stmt_cursor_no) - { - PUSHSQLERR (pstmt->herr, en_S1015); - - return SQL_ERROR; - } - - /* call driver's function */ - hproc = _iodbcdm_getproc (pstmt->hdbc, en_GetCursorName); - - if (hproc == SQL_NULL_HPROC) - { - PUSHSQLERR (pstmt->herr, en_IM001); - - return SQL_ERROR; - } - - CALL_DRIVER (pstmt->hdbc, retcode, hproc, en_GetCursorName, - (pstmt->dhstmt, szCursor, cbCursorMax, pcbCursor)) - - return retcode; -} - - -RETCODE SQL_API -SQLRowCount ( - HSTMT hstmt, - SDWORD FAR * pcrow) -{ - STMT_t FAR *pstmt = (STMT_t FAR *) hstmt; - HPROC hproc; - RETCODE retcode; - - if (hstmt == SQL_NULL_HSTMT || pstmt->hdbc == SQL_NULL_HDBC) - { - return SQL_INVALID_HANDLE; - } - - /* check state */ - if (pstmt->state >= en_stmt_needdata - || pstmt->state <= en_stmt_prepared - || pstmt->asyn_on != en_NullProc) - { - PUSHSQLERR (pstmt->herr, en_S1010); - - return SQL_ERROR; - } - - /* call driver */ - hproc = _iodbcdm_getproc (pstmt->hdbc, en_RowCount); - - if (hproc == SQL_NULL_HPROC) - { - PUSHSQLERR (pstmt->herr, en_IM001); - - return SQL_ERROR; - } - - CALL_DRIVER (pstmt->hdbc, retcode, hproc, en_RowCount, - (pstmt->dhstmt, pcrow)) - - return retcode; -} - - -RETCODE SQL_API -SQLNumResultCols ( - HSTMT hstmt, - SWORD FAR * pccol) -{ - STMT_t FAR *pstmt = (STMT_t FAR *) hstmt; - HPROC hproc; - RETCODE retcode; - SWORD ccol; - - if (hstmt == SQL_NULL_HSTMT || pstmt->hdbc == SQL_NULL_HDBC) - { - return SQL_INVALID_HANDLE; - } - - /* check state */ - if (pstmt->asyn_on == en_NullProc) - { - if (pstmt->state == en_stmt_allocated - || pstmt->state >= en_stmt_needdata) - { - PUSHSQLERR (pstmt->herr, en_S1010); - return SQL_ERROR; - } - } - else if (pstmt->asyn_on != en_NumResultCols) - { - PUSHSQLERR (pstmt->herr, en_S1010); - - return SQL_ERROR; - } - - /* call driver */ - hproc = _iodbcdm_getproc (pstmt->hdbc, en_NumResultCols); - - if (hproc == SQL_NULL_HPROC) - { - PUSHSQLERR (pstmt->herr, en_IM001); - - return SQL_ERROR; - } - - CALL_DRIVER (pstmt->hdbc, retcode, hproc, en_NumResultCols, - (pstmt->dhstmt, &ccol)) - - /* state transition */ - if (pstmt->asyn_on == en_NumResultCols) - { - switch (retcode) - { - case SQL_SUCCESS: - case SQL_SUCCESS_WITH_INFO: - case SQL_ERROR: - pstmt->asyn_on = en_NullProc; - - case SQL_STILL_EXECUTING: - default: - break; - } - } - - switch (retcode) - { - case SQL_SUCCESS: - case SQL_SUCCESS_WITH_INFO: - break; - - case SQL_STILL_EXECUTING: - ccol = 0; - pstmt->asyn_on = en_NumResultCols; - break; - - default: - ccol = 0; - break; - } - - if (pccol) - { - *pccol = ccol; - } - - return retcode; -} - - -RETCODE SQL_API -SQLDescribeCol ( - HSTMT hstmt, - UWORD icol, - UCHAR FAR * szColName, - SWORD cbColNameMax, - SWORD FAR * pcbColName, - SWORD FAR * pfSqlType, - UDWORD FAR * pcbColDef, - SWORD FAR * pibScale, - SWORD FAR * pfNullable) -{ - STMT_t FAR *pstmt = (STMT_t FAR *) hstmt; - HPROC hproc; - RETCODE retcode; - int sqlstat = en_00000; - - if (hstmt == SQL_NULL_HSTMT - || pstmt->hdbc == SQL_NULL_HDBC) - { - return SQL_INVALID_HANDLE; - } - - /* check arguments */ - if (icol == 0) - { - sqlstat = en_S1002; - } - else if (cbColNameMax < 0) - { - sqlstat = en_S1090; - } - - if (sqlstat != en_00000) - { - PUSHSQLERR (pstmt->herr, sqlstat); - - return SQL_ERROR; - } - - /* check state */ - if (pstmt->asyn_on == en_NullProc) - { - if (pstmt->asyn_on == en_stmt_allocated - || pstmt->asyn_on >= en_stmt_needdata) - { - sqlstat = en_S1010; - } - } - else if (pstmt->asyn_on != en_DescribeCol) - { - sqlstat = en_S1010; - } - - if (sqlstat != en_00000) - { - PUSHSQLERR (pstmt->herr, sqlstat); - - return SQL_ERROR; - } - - /* call driver */ - hproc = _iodbcdm_getproc (pstmt->hdbc, en_DescribeCol); - - if (hproc == SQL_NULL_HPROC) - { - PUSHSQLERR (pstmt->herr, en_IM001); - - return SQL_ERROR; - } - - CALL_DRIVER (pstmt->hdbc, retcode, hproc, en_DescribeCol, - (pstmt->dhstmt, icol, szColName, cbColNameMax, pcbColName, - pfSqlType, pcbColDef, pibScale, pfNullable)) - - /* state transition */ - if (pstmt->asyn_on == en_DescribeCol) - { - switch (retcode) - { - case SQL_SUCCESS: - case SQL_SUCCESS_WITH_INFO: - case SQL_ERROR: - pstmt->asyn_on = en_NullProc; - break; - - default: - return retcode; - } - } - - switch (pstmt->state) - { - case en_stmt_prepared: - case en_stmt_cursoropen: - case en_stmt_fetched: - case en_stmt_xfetched: - if (retcode == SQL_STILL_EXECUTING) - { - pstmt->asyn_on = en_DescribeCol; - } - break; - - default: - break; - } - - return retcode; -} - - -RETCODE SQL_API -SQLColAttributes ( - HSTMT hstmt, - UWORD icol, - UWORD fDescType, - PTR rgbDesc, - SWORD cbDescMax, - SWORD FAR * pcbDesc, - SDWORD FAR * pfDesc) -{ - STMT_t FAR *pstmt = (STMT_t FAR *) hstmt; - HPROC hproc; - RETCODE retcode; - int sqlstat = en_00000; - - if (hstmt == SQL_NULL_HSTMT || pstmt->hdbc == SQL_NULL_HDBC) - { - return SQL_INVALID_HANDLE; - } - - /* check arguments */ - if (icol == 0 && fDescType != SQL_COLUMN_COUNT) - { - sqlstat = en_S1002; - } - else if (cbDescMax < 0) - { - sqlstat = en_S1090; - } - else if ( /* fDescType < SQL_COLATT_OPT_MIN || *//* turnoff warning */ - (fDescType > SQL_COLATT_OPT_MAX - && fDescType < SQL_COLUMN_DRIVER_START)) - { - sqlstat = en_S1091; - } - - if (sqlstat != en_00000) - { - PUSHSQLERR (pstmt->herr, sqlstat); - - return SQL_ERROR; - } - - /* check state */ - if (pstmt->asyn_on == en_NullProc) - { - if (pstmt->asyn_on == en_stmt_allocated - || pstmt->asyn_on >= en_stmt_needdata) - { - sqlstat = en_S1010; - } - } - else if (pstmt->asyn_on != en_ColAttributes) - { - sqlstat = en_S1010; - } - - if (sqlstat != en_00000) - { - PUSHSQLERR (pstmt->herr, sqlstat); - - return SQL_ERROR; - } - - /* call driver */ - hproc = _iodbcdm_getproc (pstmt->hdbc, en_ColAttributes); - - if (hproc == SQL_NULL_HPROC) - { - PUSHSQLERR (pstmt->herr, en_IM001); - - return SQL_ERROR; - } - - CALL_DRIVER (pstmt->hdbc, retcode, hproc, en_ColAttributes, - (pstmt->dhstmt, icol, fDescType, rgbDesc, cbDescMax, pcbDesc, pfDesc)) - - /* state transition */ - if (pstmt->asyn_on == en_ColAttributes) - { - switch (retcode) - { - case SQL_SUCCESS: - case SQL_SUCCESS_WITH_INFO: - case SQL_ERROR: - pstmt->asyn_on = en_NullProc; - break; - - default: - return retcode; - } - } - - switch (pstmt->state) - { - case en_stmt_prepared: - case en_stmt_cursoropen: - case en_stmt_fetched: - case en_stmt_xfetched: - if (retcode == SQL_STILL_EXECUTING) - { - pstmt->asyn_on = en_ColAttributes; - } - break; - - default: - break; - } - - return retcode; -} diff --git a/wxWidgets/src/iodbc/shrsub.exp b/wxWidgets/src/iodbc/shrsub.exp deleted file mode 100644 index 1fe3ec7de9..0000000000 --- a/wxWidgets/src/iodbc/shrsub.exp +++ /dev/null @@ -1,64 +0,0 @@ -SQLAllocEnv -SQLAllocConnect -SQLConnect -SQLDriverConnect -SQLBrowseConnect - -SQLDataSources -SQLDrivers -SQLGetInfo -SQLGetFunctions -SQLGetTypeInfo - -SQLSetConnectOption -SQLGetConnectOption -SQLSetStmtOption -SQLGetStmtOption - -SQLAllocStmt -SQLPrepare -SQLBindParameter -SQLParamOptions -SQLGetCursorName -SQLSetCursorName -SQLSetScrollOptions -SQLSetParam - -SQLExecute -SQLExecDirect -SQLNativeSql -SQLDescribeParam -SQLNumParams -SQLParamData -SQLPutData - -SQLRowCount -SQLNumResultCols -SQLDescribeCol -SQLColAttributes -SQLBindCol -SQLFetch -SQLExtendedFetch -SQLGetData -SQLSetPos -SQLMoreResults -SQLError - -SQLColumnPrivileges -SQLColumns -SQLForeignKeys -SQLPrimaryKeys -SQLProcedureColumns -SQLProcedures -SQLSpecialColumns -SQLStatistics -SQLTablePrivileges -SQLTables - -SQLFreeStmt -SQLCancel -SQLTransact - -SQLDisconnect -SQLFreeConnect -SQLFreeEnv diff --git a/wxWidgets/src/jpeg/MAKEFILE.VA b/wxWidgets/src/jpeg/MAKEFILE.VA deleted file mode 100644 index ddaef8bd49..0000000000 --- a/wxWidgets/src/jpeg/MAKEFILE.VA +++ /dev/null @@ -1,335 +0,0 @@ -# -# File: makefile.vc -# Author: David Webster -# Created: 1999 -# Updated: -# Copyright: -# Licence: wxWindows Licence -# "%W% %G%" -# -# Makefile : Builds os2jpeg.lib library for OS/2 3.0/4.0 - -# Suffixes -OBJSUFF=obj -SRCSUFF=cpp - -OS2FLAGS=/c /W2 /DOS232 /D__VISAGECPP__ /D__WXPM__ /DJPEGLOCAL /Ss /Q /N100 /Tdc -OS2LINKFLAGS=/BASE:0x00010000 /PMTYPE:PM /NOE /NOD /ALIGN:16 -OS2LIBFLAGS=/NOL /NOE -OS2LIBS=CPPOM30.lib CPPOOC3.LIB OS2386.LIB - -!if "$(WXMAKINGDLL)" != "0" -EXTRADLLFLAGS=/DWXMAKINGDLL=1 /Ge- /D__OS2DLL__ -EXTRALNKFLAGS=/DLL -!endif - -# Change WXDIR or WXWIN to wherever wxWindows is found -WXDIR = $(WXWIN) - -OS2JPEGDIR=$(WXDIR)\src\jpeg -OS2JPEGINC=$(WINJPEGDIR) -!if "$(WXMAKINGDLL)" != "1" -OS2JPEGLIB=$(WXDIR)\lib\os2jpeg.lib -!else -OS2JPEGLIB=$(WXDIR)\lib\os2jpeg.dll -!endif - -TEMP1TGT=$(WXDIR)\lib\os2jpeg1.lib -TEMP2TGT=$(WXDIR)\lib\os2jpeg2.lib - -INC=-I$(WXDIR)\src\jpeg -I$(WXDIR)\Include -!ifndef FINAL -FINAL=0 -!endif - -!if "$(NOPCH)" == "1" -PCH= -PRECOMP= -MAKEPRECOMP= -!else -PCH=$(WXLIBNAME).pch -PRECOMP=/Si$(PCH) -MAKEPRECOMP=/Fi$(PCH) -!endif - -!if "$(FINAL)" == "0" -!if "$(WXMAKINGDLL)" == "1" -D=DebugOS2DLL -!else -D=DebugOS2 -!endif - -OPT = -DEBUG_FLAGS= /Ti /D__WXDEBUG__ #/Fb -LINK_DEBUG_FLAGS=/DEBUG -CRTFLAG=/Gm /Gd -!else -# /O1 - smallest code -# /O2 - fastest code -!if "$(WXMAKINGDLL)" == "1" -D=RelseOS2DLL -!else -D=RelseOS2 -!endif -OPT = /O+ /Oc /G5 -DEBUG_FLAGS= -LINK_DEBUG_FLAGS=/RELEASE -CRTFLAG=/Gm /Gd -!endif - -!if [md $(OS2JPEGDIR)\$D] -!endif - -CPPFLAGS=$(OS2FLAGS) $(EXTRADLLFLAGS) $(DEBUG_FLAGS) $(PRECOMP) $(INC) $(OPT) $(CRTFLAG) -LINKFKAGS=$(OS2LINKFLAGS) $(EXTRALNKFLAGS) - -{..\jpeg}.c{..\jpeg\$D}.obj: - @echo $< - icc @<< -$(CPPFLAGS) /Fo$@ /Tp $< -<< - -SYSDEPMEM= ..\jpeg\$D\jmemnobs.obj - -# library object files common to compression and decompression -COMOBJECTS= \ - ..\jpeg\$D\jcomapi.obj \ - ..\jpeg\$D\jutils.obj \ - ..\jpeg\$D\jerror.obj \ - ..\jpeg\$D\jmemmgr.obj \ - $(SYSDEPMEM) - -COMLIBOBJS= \ - jcomapi.obj \ - jutils.obj \ - jerror.obj \ - jmemmgr.obj \ - jmemnobs - -# compression library object files -CLIBOBJECTS= \ - ..\jpeg\$D\jcapimin.obj \ - ..\jpeg\$D\jcapistd.obj \ - ..\jpeg\$D\jctrans.obj \ - ..\jpeg\$D\jcparam.obj \ - ..\jpeg\$D\jdatadst.obj \ - ..\jpeg\$D\jcinit.obj \ - ..\jpeg\$D\jcmaster.obj \ - ..\jpeg\$D\jcmarker.obj \ - ..\jpeg\$D\jcmainct.obj \ - ..\jpeg\$D\jcprepct.obj \ - ..\jpeg\$D\jccoefct.obj \ - ..\jpeg\$D\jccolor.obj \ - ..\jpeg\$D\jcsample.obj \ - ..\jpeg\$D\jchuff.obj \ - ..\jpeg\$D\jcphuff.obj \ - ..\jpeg\$D\jcdctmgr.obj \ - ..\jpeg\$D\jfdctfst.obj \ - ..\jpeg\$D\jfdctflt.obj \ - ..\jpeg\$D\jfdctint.obj - -CLIBLIBOBJS= \ - jcapimin.obj \ - jcapistd.obj \ - jctrans.obj \ - jcparam.obj \ - jdatadst.obj \ - jcinit.obj \ - jcmaster.obj \ - jcmarker.obj \ - jcmainct.obj \ - jcprepct.obj \ - jccoefct.obj \ - jccolor.obj \ - jcsample.obj \ - jchuff.obj \ - jcphuff.obj \ - jcdctmgr.obj \ - jfdctfst.obj \ - jfdctflt.obj \ - jfdctint.obj - -# decompression library object files -DLIBOBJECTS= \ - ..\jpeg\$D\jdapimin.obj \ - ..\jpeg\$D\jdapistd.obj \ - ..\jpeg\$D\jdtrans.obj \ - ..\jpeg\$D\jdatasrc.obj \ - ..\jpeg\$D\jdmaster.obj \ - ..\jpeg\$D\jdinput.obj \ - ..\jpeg\$D\jdmarker.obj \ - ..\jpeg\$D\jdhuff.obj \ - ..\jpeg\$D\jdphuff.obj \ - ..\jpeg\$D\jdmainct.obj \ - ..\jpeg\$D\jdcoefct.obj \ - ..\jpeg\$D\jdpostct.obj \ - ..\jpeg\$D\jddctmgr.obj \ - ..\jpeg\$D\jidctfst.obj \ - ..\jpeg\$D\jidctflt.obj \ - ..\jpeg\$D\jidctint.obj \ - ..\jpeg\$D\jidctred.obj \ - ..\jpeg\$D\jdsample.obj \ - ..\jpeg\$D\jdcolor.obj \ - ..\jpeg\$D\jquant1.obj \ - ..\jpeg\$D\jquant2.obj \ - ..\jpeg\$D\jdmerge.obj - -DLIBLIBOBJS= \ - jdapimin.obj \ - jdapistd.obj \ - jdtrans.obj \ - jdatasrc.obj \ - jdmaster.obj \ - jdinput.obj \ - jdmarker.obj \ - jdhuff.obj \ - jdphuff.obj \ - jdmainct.obj \ - jdcoefct.obj \ - jdpostct.obj \ - jddctmgr.obj \ - jidctfst.obj \ - jidctflt.obj \ - jidctint.obj \ - jidctred.obj \ - jdsample.obj \ - jdcolor.obj \ - jquant1.obj \ - jquant2.obj \ - jdmerge.obj - -# These objectfiles are included in libjpeg.lib -OBJECTS= $(COMOBJECTS) $(CLIBOBJECTS) $(DLIBOBJECTS) - -# object files for sample applications (excluding library files) -COBJECTS= \ - ..\jpeg\$D\cjpeg.obj \ - ..\jpeg\$D\rdppm.obj \ - ..\jpeg\$D\rdgif.obj \ - ..\jpeg\$D\rdtarga.obj \ - ..\jpeg\$D\rdrle.obj \ - ..\jpeg\$D\rdbmp.obj \ - ..\jpeg\$D\rdswitch.obj \ - ..\jpeg\$D\cdjpeg.obj - -DOBJECTS= \ - ..\jpeg\$D\djpeg.obj \ - ..\jpeg\$D\wrppm.obj \ - ..\jpeg\$D\wrgif.obj \ - ..\jpeg\$D\wrtarga.obj \ - ..\jpeg\$D\wrrle.obj \ - ..\jpeg\$D\wrbmp.obj \ - ..\jpeg\$D\rdcolmap.obj \ - ..\jpeg\$D\cdjpeg.obj - -TROBJECTS= \ - ..\jpeg\$D\jpegtran.obj \ - ..\jpeg\$D\rdswitch.obj \ - ..\jpeg\$D\cdjpeg.obj \ - ..\jpeg\$D\transupp.obj - -all: $(OBJECTS) $(OS2JPEGLIB) - -$(COMLIBOBJS): - copy ..\jpeg\$D\jcomapi.obj - copy ..\jpeg\$D\jutils.obj - copy ..\jpeg\$D\jerror.obj - copy ..\jpeg\$D\jmemmgr.obj - copy ..\jpeg\$D\jmemnobs.obj - -$(CLIBLIBOBJS): - copy ..\jpeg\$D\jcapimin.obj - copy ..\jpeg\$D\jcapistd.obj - copy ..\jpeg\$D\jctrans.obj - copy ..\jpeg\$D\jcparam.obj - copy ..\jpeg\$D\jdatadst.obj - copy ..\jpeg\$D\jcinit.obj - copy ..\jpeg\$D\jcmaster.obj - copy ..\jpeg\$D\jcmarker.obj - copy ..\jpeg\$D\jcmainct.obj - copy ..\jpeg\$D\jcprepct.obj - copy ..\jpeg\$D\jccoefct.obj - copy ..\jpeg\$D\jccolor.obj - copy ..\jpeg\$D\jcsample.obj - copy ..\jpeg\$D\jchuff.obj - copy ..\jpeg\$D\jcphuff.obj - copy ..\jpeg\$D\jcdctmgr.obj - copy ..\jpeg\$D\jfdctfst.obj - copy ..\jpeg\$D\jfdctflt.obj - copy ..\jpeg\$D\jfdctint.obj - -$(DLIBLIBOBJS): - copy ..\jpeg\$D\jdapimin.obj - copy ..\jpeg\$D\jdapistd.obj - copy ..\jpeg\$D\jdtrans.obj - copy ..\jpeg\$D\jdatasrc.obj - copy ..\jpeg\$D\jdmaster.obj - copy ..\jpeg\$D\jdinput.obj - copy ..\jpeg\$D\jdmarker.obj - copy ..\jpeg\$D\jdhuff.obj - copy ..\jpeg\$D\jdphuff.obj - copy ..\jpeg\$D\jdmainct.obj - copy ..\jpeg\$D\jdcoefct.obj - copy ..\jpeg\$D\jdpostct.obj - copy ..\jpeg\$D\jddctmgr.obj - copy ..\jpeg\$D\jidctfst.obj - copy ..\jpeg\$D\jidctflt.obj - copy ..\jpeg\$D\jidctint.obj - copy ..\jpeg\$D\jidctred.obj - copy ..\jpeg\$D\jdsample.obj - copy ..\jpeg\$D\jdcolor.obj - copy ..\jpeg\$D\jquant1.obj - copy ..\jpeg\$D\jquant2.obj - copy ..\jpeg\$D\jdmerge.obj - -!if "$(WXMAKINGDLL)" != "1" - -$(WXDIR)\lib\os2jpeg1.lib: \ - $(COMLIBOBJS) \ - $(CLIBLIBOBJS) - -touch $(WXDIR)\lib\os2jpeg1.lib - -del $(WXDIR)\lib\os2jpeg1.lib - ilib $(OS2LIBFLAGS) $@ @<< - $**; -<< - -$(WXDIR)\lib\os2jpeg2.lib: $(DLIBLIBOBJS) - -touch $(WXDIR)\lib\os2jpeg2.lib - -del $(WXDIR)\lib\os2jpeg2.lib - ilib $(OS2LIBFLAGS) $@ @<< - $**; -<< - -$(WXDIR)\lib\os2jpeg.lib: \ - $(TEMP1TGT) \ - $(TEMP2TGT) - -touch $(WXDIR)\lib\os2jpeg.lib - -del $(WXDIR)\lib\os2jpeg.lib - ilib $(OS2LIBFLAGS) $@ @<< - $**; -<< - del *.obj - del $(TEMP1TGT) - del $(TEMP2TGT) - -!else - -# Update the dynamic link library -$(WXDIR)\lib\os2jpeg.dll: $(OBJECTS) - icc @<< - /B" $(LINKFLAGS)" /Fe$@ - $(LIBS) - $(OBJECTS) - $(WXDIR)\src\os2\os2jpeg.def -<< - implib $(WXDIR)\lib\os2jpegd.lib $(WXDIR)\src\os2\os2jpeg.def - -!endif - -clean: - del $(OS2JPEGLIB) - erase /N $(OS2JPEGDIR)\$D - rd $(OS2JPEGDIR)\$D - -cleanall: clean - diff --git a/wxWidgets/src/jpeg/README b/wxWidgets/src/jpeg/README deleted file mode 100644 index 86cc20669d..0000000000 --- a/wxWidgets/src/jpeg/README +++ /dev/null @@ -1,385 +0,0 @@ -The Independent JPEG Group's JPEG software -========================================== - -README for release 6b of 27-Mar-1998 -==================================== - -This distribution contains the sixth public release of the Independent JPEG -Group's free JPEG software. You are welcome to redistribute this software and -to use it for any purpose, subject to the conditions under LEGAL ISSUES, below. - -Serious users of this software (particularly those incorporating it into -larger programs) should contact IJG at jpeg-info@uunet.uu.net to be added to -our electronic mailing list. Mailing list members are notified of updates -and have a chance to participate in technical discussions, etc. - -This software is the work of Tom Lane, Philip Gladstone, Jim Boucher, -Lee Crocker, Julian Minguillon, Luis Ortiz, George Phillips, Davide Rossi, -Guido Vollbeding, Ge' Weijers, and other members of the Independent JPEG -Group. - -IJG is not affiliated with the official ISO JPEG standards committee. - - -DOCUMENTATION ROADMAP -===================== - -This file contains the following sections: - -OVERVIEW General description of JPEG and the IJG software. -LEGAL ISSUES Copyright, lack of warranty, terms of distribution. -REFERENCES Where to learn more about JPEG. -ARCHIVE LOCATIONS Where to find newer versions of this software. -RELATED SOFTWARE Other stuff you should get. -FILE FORMAT WARS Software *not* to get. -TO DO Plans for future IJG releases. - -Other documentation files in the distribution are: - -User documentation: - install.doc How to configure and install the IJG software. - usage.doc Usage instructions for cjpeg, djpeg, jpegtran, - rdjpgcom, and wrjpgcom. - *.1 Unix-style man pages for programs (same info as usage.doc). - wizard.doc Advanced usage instructions for JPEG wizards only. - change.log Version-to-version change highlights. -Programmer and internal documentation: - libjpeg.doc How to use the JPEG library in your own programs. - example.c Sample code for calling the JPEG library. - structure.doc Overview of the JPEG library's internal structure. - filelist.doc Road map of IJG files. - coderules.doc Coding style rules --- please read if you contribute code. - -Please read at least the files install.doc and usage.doc. Useful information -can also be found in the JPEG FAQ (Frequently Asked Questions) article. See -ARCHIVE LOCATIONS below to find out where to obtain the FAQ article. - -If you want to understand how the JPEG code works, we suggest reading one or -more of the REFERENCES, then looking at the documentation files (in roughly -the order listed) before diving into the code. - - -OVERVIEW -======== - -This package contains C software to implement JPEG image compression and -decompression. JPEG (pronounced "jay-peg") is a standardized compression -method for full-color and gray-scale images. JPEG is intended for compressing -"real-world" scenes; line drawings, cartoons and other non-realistic images -are not its strong suit. JPEG is lossy, meaning that the output image is not -exactly identical to the input image. Hence you must not use JPEG if you -have to have identical output bits. However, on typical photographic images, -very good compression levels can be obtained with no visible change, and -remarkably high compression levels are possible if you can tolerate a -low-quality image. For more details, see the references, or just experiment -with various compression settings. - -This software implements JPEG baseline, extended-sequential, and progressive -compression processes. Provision is made for supporting all variants of these -processes, although some uncommon parameter settings aren't implemented yet. -For legal reasons, we are not distributing code for the arithmetic-coding -variants of JPEG; see LEGAL ISSUES. We have made no provision for supporting -the hierarchical or lossless processes defined in the standard. - -We provide a set of library routines for reading and writing JPEG image files, -plus two sample applications "cjpeg" and "djpeg", which use the library to -perform conversion between JPEG and some other popular image file formats. -The library is intended to be reused in other applications. - -In order to support file conversion and viewing software, we have included -considerable functionality beyond the bare JPEG coding/decoding capability; -for example, the color quantization modules are not strictly part of JPEG -decoding, but they are essential for output to colormapped file formats or -colormapped displays. These extra functions can be compiled out of the -library if not required for a particular application. We have also included -"jpegtran", a utility for lossless transcoding between different JPEG -processes, and "rdjpgcom" and "wrjpgcom", two simple applications for -inserting and extracting textual comments in JFIF files. - -The emphasis in designing this software has been on achieving portability and -flexibility, while also making it fast enough to be useful. In particular, -the software is not intended to be read as a tutorial on JPEG. (See the -REFERENCES section for introductory material.) Rather, it is intended to -be reliable, portable, industrial-strength code. We do not claim to have -achieved that goal in every aspect of the software, but we strive for it. - -We welcome the use of this software as a component of commercial products. -No royalty is required, but we do ask for an acknowledgement in product -documentation, as described under LEGAL ISSUES. - - -LEGAL ISSUES -============ - -In plain English: - -1. We don't promise that this software works. (But if you find any bugs, - please let us know!) -2. You can use this software for whatever you want. You don't have to pay us. -3. You may not pretend that you wrote this software. If you use it in a - program, you must acknowledge somewhere in your documentation that - you've used the IJG code. - -In legalese: - -The authors make NO WARRANTY or representation, either express or implied, -with respect to this software, its quality, accuracy, merchantability, or -fitness for a particular purpose. This software is provided "AS IS", and you, -its user, assume the entire risk as to its quality and accuracy. - -This software is copyright (C) 1991-1998, Thomas G. Lane. -All Rights Reserved except as specified below. - -Permission is hereby granted to use, copy, modify, and distribute this -software (or portions thereof) for any purpose, without fee, subject to these -conditions: -(1) If any part of the source code for this software is distributed, then this -README file must be included, with this copyright and no-warranty notice -unaltered; and any additions, deletions, or changes to the original files -must be clearly indicated in accompanying documentation. -(2) If only executable code is distributed, then the accompanying -documentation must state that "this software is based in part on the work of -the Independent JPEG Group". -(3) Permission for use of this software is granted only if the user accepts -full responsibility for any undesirable consequences; the authors accept -NO LIABILITY for damages of any kind. - -These conditions apply to any software derived from or based on the IJG code, -not just to the unmodified library. If you use our work, you ought to -acknowledge us. - -Permission is NOT granted for the use of any IJG author's name or company name -in advertising or publicity relating to this software or products derived from -it. This software may be referred to only as "the Independent JPEG Group's -software". - -We specifically permit and encourage the use of this software as the basis of -commercial products, provided that all warranty or liability claims are -assumed by the product vendor. - - -ansi2knr.c is included in this distribution by permission of L. Peter Deutsch, -sole proprietor of its copyright holder, Aladdin Enterprises of Menlo Park, CA. -ansi2knr.c is NOT covered by the above copyright and conditions, but instead -by the usual distribution terms of the Free Software Foundation; principally, -that you must include source code if you redistribute it. (See the file -ansi2knr.c for full details.) However, since ansi2knr.c is not needed as part -of any program generated from the IJG code, this does not limit you more than -the foregoing paragraphs do. - -The Unix configuration script "configure" was produced with GNU Autoconf. -It is copyright by the Free Software Foundation but is freely distributable. -The same holds for its supporting scripts (config.guess, config.sub, -ltconfig, ltmain.sh). Another support script, install-sh, is copyright -by M.I.T. but is also freely distributable. - -It appears that the arithmetic coding option of the JPEG spec is covered by -patents owned by IBM, AT&T, and Mitsubishi. Hence arithmetic coding cannot -legally be used without obtaining one or more licenses. For this reason, -support for arithmetic coding has been removed from the free JPEG software. -(Since arithmetic coding provides only a marginal gain over the unpatented -Huffman mode, it is unlikely that very many implementations will support it.) -So far as we are aware, there are no patent restrictions on the remaining -code. - -The IJG distribution formerly included code to read and write GIF files. -To avoid entanglement with the Unisys LZW patent, GIF reading support has -been removed altogether, and the GIF writer has been simplified to produce -"uncompressed GIFs". This technique does not use the LZW algorithm; the -resulting GIF files are larger than usual, but are readable by all standard -GIF decoders. - -We are required to state that - "The Graphics Interchange Format(c) is the Copyright property of - CompuServe Incorporated. GIF(sm) is a Service Mark property of - CompuServe Incorporated." - - -REFERENCES -========== - -We highly recommend reading one or more of these references before trying to -understand the innards of the JPEG software. - -The best short technical introduction to the JPEG compression algorithm is - Wallace, Gregory K. "The JPEG Still Picture Compression Standard", - Communications of the ACM, April 1991 (vol. 34 no. 4), pp. 30-44. -(Adjacent articles in that issue discuss MPEG motion picture compression, -applications of JPEG, and related topics.) If you don't have the CACM issue -handy, a PostScript file containing a revised version of Wallace's article is -available at ftp://ftp.uu.net/graphics/jpeg/wallace.ps.gz. The file (actually -a preprint for an article that appeared in IEEE Trans. Consumer Electronics) -omits the sample images that appeared in CACM, but it includes corrections -and some added material. Note: the Wallace article is copyright ACM and IEEE, -and it may not be used for commercial purposes. - -A somewhat less technical, more leisurely introduction to JPEG can be found in -"The Data Compression Book" by Mark Nelson and Jean-loup Gailly, published by -M&T Books (New York), 2nd ed. 1996, ISBN 1-55851-434-1. This book provides -good explanations and example C code for a multitude of compression methods -including JPEG. It is an excellent source if you are comfortable reading C -code but don't know much about data compression in general. The book's JPEG -sample code is far from industrial-strength, but when you are ready to look -at a full implementation, you've got one here... - -The best full description of JPEG is the textbook "JPEG Still Image Data -Compression Standard" by William B. Pennebaker and Joan L. Mitchell, published -by Van Nostrand Reinhold, 1993, ISBN 0-442-01272-1. Price US$59.95, 638 pp. -The book includes the complete text of the ISO JPEG standards (DIS 10918-1 -and draft DIS 10918-2). This is by far the most complete exposition of JPEG -in existence, and we highly recommend it. - -The JPEG standard itself is not available electronically; you must order a -paper copy through ISO or ITU. (Unless you feel a need to own a certified -official copy, we recommend buying the Pennebaker and Mitchell book instead; -it's much cheaper and includes a great deal of useful explanatory material.) -In the USA, copies of the standard may be ordered from ANSI Sales at (212) -642-4900, or from Global Engineering Documents at (800) 854-7179. (ANSI -doesn't take credit card orders, but Global does.) It's not cheap: as of -1992, ANSI was charging $95 for Part 1 and $47 for Part 2, plus 7% -shipping/handling. The standard is divided into two parts, Part 1 being the -actual specification, while Part 2 covers compliance testing methods. Part 1 -is titled "Digital Compression and Coding of Continuous-tone Still Images, -Part 1: Requirements and guidelines" and has document numbers ISO/IEC IS -10918-1, ITU-T T.81. Part 2 is titled "Digital Compression and Coding of -Continuous-tone Still Images, Part 2: Compliance testing" and has document -numbers ISO/IEC IS 10918-2, ITU-T T.83. - -Some extensions to the original JPEG standard are defined in JPEG Part 3, -a newer ISO standard numbered ISO/IEC IS 10918-3 and ITU-T T.84. IJG -currently does not support any Part 3 extensions. - -The JPEG standard does not specify all details of an interchangeable file -format. For the omitted details we follow the "JFIF" conventions, revision -1.02. A copy of the JFIF spec is available from: - Literature Department - C-Cube Microsystems, Inc. - 1778 McCarthy Blvd. - Milpitas, CA 95035 - phone (408) 944-6300, fax (408) 944-6314 -A PostScript version of this document is available by FTP at -ftp://ftp.uu.net/graphics/jpeg/jfif.ps.gz. There is also a plain text -version at ftp://ftp.uu.net/graphics/jpeg/jfif.txt.gz, but it is missing -the figures. - -The TIFF 6.0 file format specification can be obtained by FTP from -ftp://ftp.sgi.com/graphics/tiff/TIFF6.ps.gz. The JPEG incorporation scheme -found in the TIFF 6.0 spec of 3-June-92 has a number of serious problems. -IJG does not recommend use of the TIFF 6.0 design (TIFF Compression tag 6). -Instead, we recommend the JPEG design proposed by TIFF Technical Note #2 -(Compression tag 7). Copies of this Note can be obtained from ftp.sgi.com or -from ftp://ftp.uu.net/graphics/jpeg/. It is expected that the next revision -of the TIFF spec will replace the 6.0 JPEG design with the Note's design. -Although IJG's own code does not support TIFF/JPEG, the free libtiff library -uses our library to implement TIFF/JPEG per the Note. libtiff is available -from ftp://ftp.sgi.com/graphics/tiff/. - - -ARCHIVE LOCATIONS -================= - -The "official" archive site for this software is ftp.uu.net (Internet -address 192.48.96.9). The most recent released version can always be found -there in directory graphics/jpeg. This particular version will be archived -as ftp://ftp.uu.net/graphics/jpeg/jpegsrc.v6b.tar.gz. If you don't have -direct Internet access, UUNET's archives are also available via UUCP; contact -help@uunet.uu.net for information on retrieving files that way. - -Numerous Internet sites maintain copies of the UUNET files. However, only -ftp.uu.net is guaranteed to have the latest official version. - -You can also obtain this software in DOS-compatible "zip" archive format from -the SimTel archives (ftp://ftp.simtel.net/pub/simtelnet/msdos/graphics/), or -on CompuServe in the Graphics Support forum (GO CIS:GRAPHSUP), library 12 -"JPEG Tools". Again, these versions may sometimes lag behind the ftp.uu.net -release. - -The JPEG FAQ (Frequently Asked Questions) article is a useful source of -general information about JPEG. It is updated constantly and therefore is -not included in this distribution. The FAQ is posted every two weeks to -Usenet newsgroups comp.graphics.misc, news.answers, and other groups. -It is available on the World Wide Web at http://www.faqs.org/faqs/jpeg-faq/ -and other news.answers archive sites, including the official news.answers -archive at rtfm.mit.edu: ftp://rtfm.mit.edu/pub/usenet/news.answers/jpeg-faq/. -If you don't have Web or FTP access, send e-mail to mail-server@rtfm.mit.edu -with body - send usenet/news.answers/jpeg-faq/part1 - send usenet/news.answers/jpeg-faq/part2 - - -RELATED SOFTWARE -================ - -Numerous viewing and image manipulation programs now support JPEG. (Quite a -few of them use this library to do so.) The JPEG FAQ described above lists -some of the more popular free and shareware viewers, and tells where to -obtain them on Internet. - -If you are on a Unix machine, we highly recommend Jef Poskanzer's free -PBMPLUS software, which provides many useful operations on PPM-format image -files. In particular, it can convert PPM images to and from a wide range of -other formats, thus making cjpeg/djpeg considerably more useful. The latest -version is distributed by the NetPBM group, and is available from numerous -sites, notably ftp://wuarchive.wustl.edu/graphics/graphics/packages/NetPBM/. -Unfortunately PBMPLUS/NETPBM is not nearly as portable as the IJG software is; -you are likely to have difficulty making it work on any non-Unix machine. - -A different free JPEG implementation, written by the PVRG group at Stanford, -is available from ftp://havefun.stanford.edu/pub/jpeg/. This program -is designed for research and experimentation rather than production use; -it is slower, harder to use, and less portable than the IJG code, but it -is easier to read and modify. Also, the PVRG code supports lossless JPEG, -which we do not. (On the other hand, it doesn't do progressive JPEG.) - - -FILE FORMAT WARS -================ - -Some JPEG programs produce files that are not compatible with our library. -The root of the problem is that the ISO JPEG committee failed to specify a -concrete file format. Some vendors "filled in the blanks" on their own, -creating proprietary formats that no one else could read. (For example, none -of the early commercial JPEG implementations for the Macintosh were able to -exchange compressed files.) - -The file format we have adopted is called JFIF (see REFERENCES). This format -has been agreed to by a number of major commercial JPEG vendors, and it has -become the de facto standard. JFIF is a minimal or "low end" representation. -We recommend the use of TIFF/JPEG (TIFF revision 6.0 as modified by TIFF -Technical Note #2) for "high end" applications that need to record a lot of -additional data about an image. TIFF/JPEG is fairly new and not yet widely -supported, unfortunately. - -The upcoming JPEG Part 3 standard defines a file format called SPIFF. -SPIFF is interoperable with JFIF, in the sense that most JFIF decoders should -be able to read the most common variant of SPIFF. SPIFF has some technical -advantages over JFIF, but its major claim to fame is simply that it is an -official standard rather than an informal one. At this point it is unclear -whether SPIFF will supersede JFIF or whether JFIF will remain the de-facto -standard. IJG intends to support SPIFF once the standard is frozen, but we -have not decided whether it should become our default output format or not. -(In any case, our decoder will remain capable of reading JFIF indefinitely.) - -Various proprietary file formats incorporating JPEG compression also exist. -We have little or no sympathy for the existence of these formats. Indeed, -one of the original reasons for developing this free software was to help -force convergence on common, open format standards for JPEG files. Don't -use a proprietary file format! - - -TO DO -===== - -The major thrust for v7 will probably be improvement of visual quality. -The current method for scaling the quantization tables is known not to be -very good at low Q values. We also intend to investigate block boundary -smoothing, "poor man's variable quantization", and other means of improving -quality-vs-file-size performance without sacrificing compatibility. - -In future versions, we are considering supporting some of the upcoming JPEG -Part 3 extensions --- principally, variable quantization and the SPIFF file -format. - -As always, speeding things up is of great interest. - -Please send bug reports, offers of help, etc. to jpeg-info@uunet.uu.net. diff --git a/wxWidgets/src/jpeg/ansi2knr.1 b/wxWidgets/src/jpeg/ansi2knr.1 deleted file mode 100644 index f9ee5a631c..0000000000 --- a/wxWidgets/src/jpeg/ansi2knr.1 +++ /dev/null @@ -1,36 +0,0 @@ -.TH ANSI2KNR 1 "19 Jan 1996" -.SH NAME -ansi2knr \- convert ANSI C to Kernighan & Ritchie C -.SH SYNOPSIS -.I ansi2knr -[--varargs] input_file [output_file] -.SH DESCRIPTION -If no output_file is supplied, output goes to stdout. -.br -There are no error messages. -.sp -.I ansi2knr -recognizes function definitions by seeing a non-keyword identifier at the left -margin, followed by a left parenthesis, with a right parenthesis as the last -character on the line, and with a left brace as the first token on the -following line (ignoring possible intervening comments). It will recognize a -multi-line header provided that no intervening line ends with a left or right -brace or a semicolon. These algorithms ignore whitespace and comments, except -that the function name must be the first thing on the line. -.sp -The following constructs will confuse it: -.br - - Any other construct that starts at the left margin and follows the -above syntax (such as a macro or function call). -.br - - Some macros that tinker with the syntax of the function header. -.sp -The --varargs switch is obsolete, and is recognized only for -backwards compatibility. The present version of -.I ansi2knr -will always attempt to convert a ... argument to va_alist and va_dcl. -.SH AUTHOR -L. Peter Deutsch wrote the original ansi2knr and -continues to maintain the current version; most of the code in the current -version is his work. ansi2knr also includes contributions by Francois -Pinard and Jim Avera . diff --git a/wxWidgets/src/jpeg/ansi2knr.c b/wxWidgets/src/jpeg/ansi2knr.c deleted file mode 100644 index 4e05fc2d32..0000000000 --- a/wxWidgets/src/jpeg/ansi2knr.c +++ /dev/null @@ -1,693 +0,0 @@ -/* ansi2knr.c */ -/* Convert ANSI C function definitions to K&R ("traditional C") syntax */ - -/* -ansi2knr is distributed in the hope that it will be useful, but WITHOUT ANY -WARRANTY. No author or distributor accepts responsibility to anyone for the -consequences of using it or for whether it serves any particular purpose or -works at all, unless he says so in writing. Refer to the GNU General Public -License (the "GPL") for full details. - -Everyone is granted permission to copy, modify and redistribute ansi2knr, -but only under the conditions described in the GPL. A copy of this license -is supposed to have been given to you along with ansi2knr so you can know -your rights and responsibilities. It should be in a file named COPYLEFT. -[In the IJG distribution, the GPL appears below, not in a separate file.] -Among other things, the copyright notice and this notice must be preserved -on all copies. - -We explicitly state here what we believe is already implied by the GPL: if -the ansi2knr program is distributed as a separate set of sources and a -separate executable file which are aggregated on a storage medium together -with another program, this in itself does not bring the other program under -the GPL, nor does the mere fact that such a program or the procedures for -constructing it invoke the ansi2knr executable bring any other part of the -program under the GPL. -*/ - -/* ----------- Here is the GNU GPL file COPYLEFT, referred to above ---------- ------ These terms do NOT apply to the JPEG software itself; see README ------ - - GHOSTSCRIPT GENERAL PUBLIC LICENSE - (Clarified 11 Feb 1988) - - Copyright (C) 1988 Richard M. Stallman - Everyone is permitted to copy and distribute verbatim copies of this - license, but changing it is not allowed. You can also use this wording - to make the terms for other programs. - - The license agreements of most software companies keep you at the -mercy of those companies. By contrast, our general public license is -intended to give everyone the right to share Ghostscript. To make sure -that you get the rights we want you to have, we need to make -restrictions that forbid anyone to deny you these rights or to ask you -to surrender the rights. Hence this license agreement. - - Specifically, we want to make sure that you have the right to give -away copies of Ghostscript, that you receive source code or else can get -it if you want it, that you can change Ghostscript or use pieces of it -in new free programs, and that you know you can do these things. - - To make sure that everyone has such rights, we have to forbid you to -deprive anyone else of these rights. For example, if you distribute -copies of Ghostscript, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must tell them their rights. - - Also, for our own protection, we must make certain that everyone finds -out that there is no warranty for Ghostscript. If Ghostscript is -modified by someone else and passed on, we want its recipients to know -that what they have is not what we distributed, so that any problems -introduced by others will not reflect on our reputation. - - Therefore we (Richard M. Stallman and the Free Software Foundation, -Inc.) make the following terms which say what you must do to be allowed -to distribute or change Ghostscript. - - - COPYING POLICIES - - 1. You may copy and distribute verbatim copies of Ghostscript source -code as you receive it, in any medium, provided that you conspicuously -and appropriately publish on each copy a valid copyright and license -notice "Copyright (C) 1989 Aladdin Enterprises. All rights reserved. -Distributed by Free Software Foundation, Inc." (or with whatever year is -appropriate); keep intact the notices on all files that refer to this -License Agreement and to the absence of any warranty; and give any other -recipients of the Ghostscript program a copy of this License Agreement -along with the program. You may charge a distribution fee for the -physical act of transferring a copy. - - 2. You may modify your copy or copies of Ghostscript or any portion of -it, and copy and distribute such modifications under the terms of -Paragraph 1 above, provided that you also do the following: - - a) cause the modified files to carry prominent notices stating - that you changed the files and the date of any change; and - - b) cause the whole of any work that you distribute or publish, - that in whole or in part contains or is a derivative of Ghostscript - or any part thereof, to be licensed at no charge to all third - parties on terms identical to those contained in this License - Agreement (except that you may choose to grant more extensive - warranty protection to some or all third parties, at your option). - - c) You may charge a distribution fee for the physical act of - transferring a copy, and you may at your option offer warranty - protection in exchange for a fee. - -Mere aggregation of another unrelated program with this program (or its -derivative) on a volume of a storage or distribution medium does not bring -the other program under the scope of these terms. - - 3. You may copy and distribute Ghostscript (or a portion or derivative -of it, under Paragraph 2) in object code or executable form under the -terms of Paragraphs 1 and 2 above provided that you also do one of the -following: - - a) accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of - Paragraphs 1 and 2 above; or, - - b) accompany it with a written offer, valid for at least three - years, to give any third party free (except for a nominal - shipping charge) a complete machine-readable copy of the - corresponding source code, to be distributed under the terms of - Paragraphs 1 and 2 above; or, - - c) accompany it with the information you received as to where the - corresponding source code may be obtained. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form alone.) - -For an executable file, complete source code means all the source code for -all modules it contains; but, as a special exception, it need not include -source code for modules which are standard libraries that accompany the -operating system on which the executable file runs. - - 4. You may not copy, sublicense, distribute or transfer Ghostscript -except as expressly provided under this License Agreement. Any attempt -otherwise to copy, sublicense, distribute or transfer Ghostscript is -void and your rights to use the program under this License agreement -shall be automatically terminated. However, parties who have received -computer software programs from you with this License Agreement will not -have their licenses terminated so long as such parties remain in full -compliance. - - 5. If you wish to incorporate parts of Ghostscript into other free -programs whose distribution conditions are different, write to the Free -Software Foundation at 675 Mass Ave, Cambridge, MA 02139. We have not -yet worked out a simple rule that can be stated here, but we will often -permit this. We will be guided by the two goals of preserving the free -status of all derivatives of our free software and of promoting the -sharing and reuse of software. - -Your comments and suggestions about our licensing policies and our -software are welcome! Please contact the Free Software Foundation, -Inc., 675 Mass Ave, Cambridge, MA 02139, or call (617) 876-3296. - - NO WARRANTY - - BECAUSE GHOSTSCRIPT IS LICENSED FREE OF CHARGE, WE PROVIDE ABSOLUTELY -NO WARRANTY, TO THE EXTENT PERMITTED BY APPLICABLE STATE LAW. EXCEPT -WHEN OTHERWISE STATED IN WRITING, FREE SOFTWARE FOUNDATION, INC, RICHARD -M. STALLMAN, ALADDIN ENTERPRISES, L. PETER DEUTSCH, AND/OR OTHER PARTIES -PROVIDE GHOSTSCRIPT "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER -EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE -ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF GHOSTSCRIPT IS WITH -YOU. SHOULD GHOSTSCRIPT PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL -NECESSARY SERVICING, REPAIR OR CORRECTION. - - IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW WILL RICHARD M. -STALLMAN, THE FREE SOFTWARE FOUNDATION, INC., L. PETER DEUTSCH, ALADDIN -ENTERPRISES, AND/OR ANY OTHER PARTY WHO MAY MODIFY AND REDISTRIBUTE -GHOSTSCRIPT AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING -ANY LOST PROFITS, LOST MONIES, OR OTHER SPECIAL, INCIDENTAL OR -CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE -(INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED -INACCURATE OR LOSSES SUSTAINED BY THIRD PARTIES OR A FAILURE OF THE -PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS) GHOSTSCRIPT, EVEN IF YOU -HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES, OR FOR ANY CLAIM -BY ANY OTHER PARTY. - --------------------- End of file COPYLEFT ------------------------------ -*/ - -/* - * Usage: - ansi2knr input_file [output_file] - * If no output_file is supplied, output goes to stdout. - * There are no error messages. - * - * ansi2knr recognizes function definitions by seeing a non-keyword - * identifier at the left margin, followed by a left parenthesis, - * with a right parenthesis as the last character on the line, - * and with a left brace as the first token on the following line - * (ignoring possible intervening comments). - * It will recognize a multi-line header provided that no intervening - * line ends with a left or right brace or a semicolon. - * These algorithms ignore whitespace and comments, except that - * the function name must be the first thing on the line. - * The following constructs will confuse it: - * - Any other construct that starts at the left margin and - * follows the above syntax (such as a macro or function call). - * - Some macros that tinker with the syntax of the function header. - */ - -/* - * The original and principal author of ansi2knr is L. Peter Deutsch - * . Other authors are noted in the change history - * that follows (in reverse chronological order): - lpd 96-01-21 added code to cope with not HAVE_CONFIG_H and with - compilers that don't understand void, as suggested by - Tom Lane - lpd 96-01-15 changed to require that the first non-comment token - on the line following a function header be a left brace, - to reduce sensitivity to macros, as suggested by Tom Lane - - lpd 95-06-22 removed #ifndefs whose sole purpose was to define - undefined preprocessor symbols as 0; changed all #ifdefs - for configuration symbols to #ifs - lpd 95-04-05 changed copyright notice to make it clear that - including ansi2knr in a program does not bring the entire - program under the GPL - lpd 94-12-18 added conditionals for systems where ctype macros - don't handle 8-bit characters properly, suggested by - Francois Pinard ; - removed --varargs switch (this is now the default) - lpd 94-10-10 removed CONFIG_BROKETS conditional - lpd 94-07-16 added some conditionals to help GNU `configure', - suggested by Francois Pinard ; - properly erase prototype args in function parameters, - contributed by Jim Avera ; - correct error in writeblanks (it shouldn't erase EOLs) - lpd 89-xx-xx original version - */ - -/* Most of the conditionals here are to make ansi2knr work with */ -/* or without the GNU configure machinery. */ - -#if HAVE_CONFIG_H -# include -#endif - -#include -#include - -#if HAVE_CONFIG_H - -/* - For properly autoconfiguring ansi2knr, use AC_CONFIG_HEADER(config.h). - This will define HAVE_CONFIG_H and so, activate the following lines. - */ - -# if STDC_HEADERS || HAVE_STRING_H -# include -# else -# include -# endif - -#else /* not HAVE_CONFIG_H */ - -/* Otherwise do it the hard way */ - -# ifdef BSD -# include -# else -# ifdef VMS - extern int strlen(), strncmp(); -# else -# include -# endif -# endif - -#endif /* not HAVE_CONFIG_H */ - -#if STDC_HEADERS -# include -#else -/* - malloc and free should be declared in stdlib.h, - but if you've got a K&R compiler, they probably aren't. - */ -# ifdef MSDOS -# include -# else -# ifdef VMS - extern char *malloc(); - extern void free(); -# else - extern char *malloc(); - extern int free(); -# endif -# endif - -#endif - -/* - * The ctype macros don't always handle 8-bit characters correctly. - * Compensate for this here. - */ -#ifdef isascii -# undef HAVE_ISASCII /* just in case */ -# define HAVE_ISASCII 1 -#else -#endif -#if STDC_HEADERS || !HAVE_ISASCII -# define is_ascii(c) 1 -#else -# define is_ascii(c) isascii(c) -#endif - -#define is_space(c) (is_ascii(c) && isspace(c)) -#define is_alpha(c) (is_ascii(c) && isalpha(c)) -#define is_alnum(c) (is_ascii(c) && isalnum(c)) - -/* Scanning macros */ -#define isidchar(ch) (is_alnum(ch) || (ch) == '_') -#define isidfirstchar(ch) (is_alpha(ch) || (ch) == '_') - -/* Forward references */ -char *skipspace(); -int writeblanks(); -int test1(); -int convert1(); - -/* The main program */ -int -main(argc, argv) - int argc; - char *argv[]; -{ FILE *in, *out; -#define bufsize 5000 /* arbitrary size */ - char *buf; - char *line; - char *more; - /* - * In previous versions, ansi2knr recognized a --varargs switch. - * If this switch was supplied, ansi2knr would attempt to convert - * a ... argument to va_alist and va_dcl; if this switch was not - * supplied, ansi2knr would simply drop any such arguments. - * Now, ansi2knr always does this conversion, and we only - * check for this switch for backward compatibility. - */ - int convert_varargs = 1; - - if ( argc > 1 && argv[1][0] == '-' ) - { if ( !strcmp(argv[1], "--varargs") ) - { convert_varargs = 1; - argc--; - argv++; - } - else - { fprintf(stderr, "Unrecognized switch: %s\n", argv[1]); - exit(1); - } - } - switch ( argc ) - { - default: - printf("Usage: ansi2knr input_file [output_file]\n"); - exit(0); - case 2: - out = stdout; - break; - case 3: - out = fopen(argv[2], "w"); - if ( out == NULL ) - { fprintf(stderr, "Cannot open output file %s\n", argv[2]); - exit(1); - } - } - in = fopen(argv[1], "r"); - if ( in == NULL ) - { fprintf(stderr, "Cannot open input file %s\n", argv[1]); - exit(1); - } - fprintf(out, "#line 1 \"%s\"\n", argv[1]); - buf = malloc(bufsize); - line = buf; - while ( fgets(line, (unsigned)(buf + bufsize - line), in) != NULL ) - { -test: line += strlen(line); - switch ( test1(buf) ) - { - case 2: /* a function header */ - convert1(buf, out, 1, convert_varargs); - break; - case 1: /* a function */ - /* Check for a { at the start of the next line. */ - more = ++line; -f: if ( line >= buf + (bufsize - 1) ) /* overflow check */ - goto wl; - if ( fgets(line, (unsigned)(buf + bufsize - line), in) == NULL ) - goto wl; - switch ( *skipspace(more, 1) ) - { - case '{': - /* Definitely a function header. */ - convert1(buf, out, 0, convert_varargs); - fputs(more, out); - break; - case 0: - /* The next line was blank or a comment: */ - /* keep scanning for a non-comment. */ - line += strlen(line); - goto f; - default: - /* buf isn't a function header, but */ - /* more might be. */ - fputs(buf, out); - strcpy(buf, more); - line = buf; - goto test; - } - break; - case -1: /* maybe the start of a function */ - if ( line != buf + (bufsize - 1) ) /* overflow check */ - continue; - /* falls through */ - default: /* not a function */ -wl: fputs(buf, out); - break; - } - line = buf; - } - if ( line != buf ) - fputs(buf, out); - free(buf); - fclose(out); - fclose(in); - return 0; -} - -/* Skip over space and comments, in either direction. */ -char * -skipspace(p, dir) - register char *p; - register int dir; /* 1 for forward, -1 for backward */ -{ for ( ; ; ) - { while ( is_space(*p) ) - p += dir; - if ( !(*p == '/' && p[dir] == '*') ) - break; - p += dir; p += dir; - while ( !(*p == '*' && p[dir] == '/') ) - { if ( *p == 0 ) - return p; /* multi-line comment?? */ - p += dir; - } - p += dir; p += dir; - } - return p; -} - -/* - * Write blanks over part of a string. - * Don't overwrite end-of-line characters. - */ -int -writeblanks(start, end) - char *start; - char *end; -{ char *p; - for ( p = start; p < end; p++ ) - if ( *p != '\r' && *p != '\n' ) - *p = ' '; - return 0; -} - -/* - * Test whether the string in buf is a function definition. - * The string may contain and/or end with a newline. - * Return as follows: - * 0 - definitely not a function definition; - * 1 - definitely a function definition; - * 2 - definitely a function prototype (NOT USED); - * -1 - may be the beginning of a function definition, - * append another line and look again. - * The reason we don't attempt to convert function prototypes is that - * Ghostscript's declaration-generating macros look too much like - * prototypes, and confuse the algorithms. - */ -int -test1(buf) - char *buf; -{ register char *p = buf; - char *bend; - char *endfn; - int contin; - - if ( !isidfirstchar(*p) ) - return 0; /* no name at left margin */ - bend = skipspace(buf + strlen(buf) - 1, -1); - switch ( *bend ) - { - case ';': contin = 0 /*2*/; break; - case ')': contin = 1; break; - case '{': return 0; /* not a function */ - case '}': return 0; /* not a function */ - default: contin = -1; - } - while ( isidchar(*p) ) - p++; - endfn = p; - p = skipspace(p, 1); - if ( *p++ != '(' ) - return 0; /* not a function */ - p = skipspace(p, 1); - if ( *p == ')' ) - return 0; /* no parameters */ - /* Check that the apparent function name isn't a keyword. */ - /* We only need to check for keywords that could be followed */ - /* by a left parenthesis (which, unfortunately, is most of them). */ - { static char *words[] = - { "asm", "auto", "case", "char", "const", "double", - "extern", "float", "for", "if", "int", "long", - "register", "return", "short", "signed", "sizeof", - "static", "switch", "typedef", "unsigned", - "void", "volatile", "while", 0 - }; - char **key = words; - char *kp; - int len = endfn - buf; - - while ( (kp = *key) != 0 ) - { if ( strlen(kp) == len && !strncmp(kp, buf, len) ) - return 0; /* name is a keyword */ - key++; - } - } - return contin; -} - -/* Convert a recognized function definition or header to K&R syntax. */ -int -convert1(buf, out, header, convert_varargs) - char *buf; - FILE *out; - int header; /* Boolean */ - int convert_varargs; /* Boolean */ -{ char *endfn; - register char *p; - char **breaks; - unsigned num_breaks = 2; /* for testing */ - char **btop; - char **bp; - char **ap; - char *vararg = 0; - - /* Pre-ANSI implementations don't agree on whether strchr */ - /* is called strchr or index, so we open-code it here. */ - for ( endfn = buf; *(endfn++) != '('; ) - ; -top: p = endfn; - breaks = (char **)malloc(sizeof(char *) * num_breaks * 2); - if ( breaks == 0 ) - { /* Couldn't allocate break table, give up */ - fprintf(stderr, "Unable to allocate break table!\n"); - fputs(buf, out); - return -1; - } - btop = breaks + num_breaks * 2 - 2; - bp = breaks; - /* Parse the argument list */ - do - { int level = 0; - char *lp = NULL; - char *rp; - char *end = NULL; - - if ( bp >= btop ) - { /* Filled up break table. */ - /* Allocate a bigger one and start over. */ - free((char *)breaks); - num_breaks <<= 1; - goto top; - } - *bp++ = p; - /* Find the end of the argument */ - for ( ; end == NULL; p++ ) - { switch(*p) - { - case ',': - if ( !level ) end = p; - break; - case '(': - if ( !level ) lp = p; - level++; - break; - case ')': - if ( --level < 0 ) end = p; - else rp = p; - break; - case '/': - p = skipspace(p, 1) - 1; - break; - default: - ; - } - } - /* Erase any embedded prototype parameters. */ - if ( lp ) - writeblanks(lp + 1, rp); - p--; /* back up over terminator */ - /* Find the name being declared. */ - /* This is complicated because of procedure and */ - /* array modifiers. */ - for ( ; ; ) - { p = skipspace(p - 1, -1); - switch ( *p ) - { - case ']': /* skip array dimension(s) */ - case ')': /* skip procedure args OR name */ - { int level = 1; - while ( level ) - switch ( *--p ) - { - case ']': case ')': level++; break; - case '[': case '(': level--; break; - case '/': p = skipspace(p, -1) + 1; break; - default: ; - } - } - if ( *p == '(' && *skipspace(p + 1, 1) == '*' ) - { /* We found the name being declared */ - while ( !isidfirstchar(*p) ) - p = skipspace(p, 1) + 1; - goto found; - } - break; - default: - goto found; - } - } -found: if ( *p == '.' && p[-1] == '.' && p[-2] == '.' ) - { if ( convert_varargs ) - { *bp++ = "va_alist"; - vararg = p-2; - } - else - { p++; - if ( bp == breaks + 1 ) /* sole argument */ - writeblanks(breaks[0], p); - else - writeblanks(bp[-1] - 1, p); - bp--; - } - } - else - { while ( isidchar(*p) ) p--; - *bp++ = p+1; - } - p = end; - } - while ( *p++ == ',' ); - *bp = p; - /* Make a special check for 'void' arglist */ - if ( bp == breaks+2 ) - { p = skipspace(breaks[0], 1); - if ( !strncmp(p, "void", 4) ) - { p = skipspace(p+4, 1); - if ( p == breaks[2] - 1 ) - { bp = breaks; /* yup, pretend arglist is empty */ - writeblanks(breaks[0], p + 1); - } - } - } - /* Put out the function name and left parenthesis. */ - p = buf; - while ( p != endfn ) putc(*p, out), p++; - /* Put out the declaration. */ - if ( header ) - { fputs(");", out); - for ( p = breaks[0]; *p; p++ ) - if ( *p == '\r' || *p == '\n' ) - putc(*p, out); - } - else - { for ( ap = breaks+1; ap < bp; ap += 2 ) - { p = *ap; - while ( isidchar(*p) ) - putc(*p, out), p++; - if ( ap < bp - 1 ) - fputs(", ", out); - } - fputs(") ", out); - /* Put out the argument declarations */ - for ( ap = breaks+2; ap <= bp; ap += 2 ) - (*ap)[-1] = ';'; - if ( vararg != 0 ) - { *vararg = 0; - fputs(breaks[0], out); /* any prior args */ - fputs("va_dcl", out); /* the final arg */ - fputs(bp[0], out); - } - else - fputs(breaks[0], out); - } - free((char *)breaks); - return 0; -} diff --git a/wxWidgets/src/jpeg/change.log b/wxWidgets/src/jpeg/change.log deleted file mode 100644 index 74102c0db5..0000000000 --- a/wxWidgets/src/jpeg/change.log +++ /dev/null @@ -1,217 +0,0 @@ -CHANGE LOG for Independent JPEG Group's JPEG software - - -Version 6b 27-Mar-1998 ------------------------ - -jpegtran has new features for lossless image transformations (rotation -and flipping) as well as "lossless" reduction to grayscale. - -jpegtran now copies comments by default; it has a -copy switch to enable -copying all APPn blocks as well, or to suppress comments. (Formerly it -always suppressed comments and APPn blocks.) jpegtran now also preserves -JFIF version and resolution information. - -New decompressor library feature: COM and APPn markers found in the input -file can be saved in memory for later use by the application. (Before, -you had to code this up yourself with a custom marker processor.) - -There is an unused field "void * client_data" now in compress and decompress -parameter structs; this may be useful in some applications. - -JFIF version number information is now saved by the decoder and accepted by -the encoder. jpegtran uses this to copy the source file's version number, -to ensure "jpegtran -copy all" won't create bogus files that contain JFXX -extensions but claim to be version 1.01. Applications that generate their -own JFXX extension markers also (finally) have a supported way to cause the -encoder to emit JFIF version number 1.02. - -djpeg's trace mode reports JFIF 1.02 thumbnail images as such, rather -than as unknown APP0 markers. - -In -verbose mode, djpeg and rdjpgcom will try to print the contents of -APP12 markers as text. Some digital cameras store useful text information -in APP12 markers. - -Handling of truncated data streams is more robust: blocks beyond the one in -which the error occurs will be output as uniform gray, or left unchanged -if decoding a progressive JPEG. The appearance no longer depends on the -Huffman tables being used. - -Huffman tables are checked for validity much more carefully than before. - -To avoid the Unisys LZW patent, djpeg's GIF output capability has been -changed to produce "uncompressed GIFs", and cjpeg's GIF input capability -has been removed altogether. We're not happy about it either, but there -seems to be no good alternative. - -The configure script now supports building libjpeg as a shared library -on many flavors of Unix (all the ones that GNU libtool knows how to -build shared libraries for). Use "./configure --enable-shared" to -try this out. - -New jconfig file and makefiles for Microsoft Visual C++ and Developer Studio. -Also, a jconfig file and a build script for Metrowerks CodeWarrior -on Apple Macintosh. makefile.dj has been updated for DJGPP v2, and there -are miscellaneous other minor improvements in the makefiles. - -jmemmac.c now knows how to create temporary files following Mac System 7 -conventions. - -djpeg's -map switch is now able to read raw-format PPM files reliably. - -cjpeg -progressive -restart no longer generates any unnecessary DRI markers. - -Multiple calls to jpeg_simple_progression for a single JPEG object -no longer leak memory. - - -Version 6a 7-Feb-96 --------------------- - -Library initialization sequence modified to detect version mismatches -and struct field packing mismatches between library and calling application. -This change requires applications to be recompiled, but does not require -any application source code change. - -All routine declarations changed to the style "GLOBAL(type) name ...", -that is, GLOBAL, LOCAL, METHODDEF, EXTERN are now macros taking the -routine's return type as an argument. This makes it possible to add -Microsoft-style linkage keywords to all the routines by changing just -these macros. Note that any application code that was using these macros -will have to be changed. - -DCT coefficient quantization tables are now stored in normal array order -rather than zigzag order. Application code that calls jpeg_add_quant_table, -or otherwise manipulates quantization tables directly, will need to be -changed. If you need to make such code work with either older or newer -versions of the library, a test like "#if JPEG_LIB_VERSION >= 61" is -recommended. - -djpeg's trace capability now dumps DQT tables in natural order, not zigzag -order. This allows the trace output to be made into a "-qtables" file -more easily. - -New system-dependent memory manager module for use on Apple Macintosh. - -Fix bug in cjpeg's -smooth option: last one or two scanlines would be -duplicates of the prior line unless the image height mod 16 was 1 or 2. - -Repair minor problems in VMS, BCC, MC6 makefiles. - -New configure script based on latest GNU Autoconf. - -Correct the list of include files needed by MetroWerks C for ccommand(). - -Numerous small documentation updates. - - -Version 6 2-Aug-95 -------------------- - -Progressive JPEG support: library can read and write full progressive JPEG -files. A "buffered image" mode supports incremental decoding for on-the-fly -display of progressive images. Simply recompiling an existing IJG-v5-based -decoder with v6 should allow it to read progressive files, though of course -without any special progressive display. - -New "jpegtran" application performs lossless transcoding between different -JPEG formats; primarily, it can be used to convert baseline to progressive -JPEG and vice versa. In support of jpegtran, the library now allows lossless -reading and writing of JPEG files as DCT coefficient arrays. This ability -may be of use in other applications. - -Notes for programmers: -* We changed jpeg_start_decompress() to be able to suspend; this makes all -decoding modes available to suspending-input applications. However, -existing applications that use suspending input will need to be changed -to check the return value from jpeg_start_decompress(). You don't need to -do anything if you don't use a suspending data source. -* We changed the interface to the virtual array routines: access_virt_array -routines now take a count of the number of rows to access this time. The -last parameter to request_virt_array routines is now interpreted as the -maximum number of rows that may be accessed at once, but not necessarily -the height of every access. - - -Version 5b 15-Mar-95 ---------------------- - -Correct bugs with grayscale images having v_samp_factor > 1. - -jpeg_write_raw_data() now supports output suspension. - -Correct bugs in "configure" script for case of compiling in -a directory other than the one containing the source files. - -Repair bug in jquant1.c: sometimes didn't use as many colors as it could. - -Borland C makefile and jconfig file work under either MS-DOS or OS/2. - -Miscellaneous improvements to documentation. - - -Version 5a 7-Dec-94 --------------------- - -Changed color conversion roundoff behavior so that grayscale values are -represented exactly. (This causes test image files to change.) - -Make ordered dither use 16x16 instead of 4x4 pattern for a small quality -improvement. - -New configure script based on latest GNU Autoconf. -Fix configure script to handle CFLAGS correctly. -Rename *.auto files to *.cfg, so that configure script still works if -file names have been truncated for DOS. - -Fix bug in rdbmp.c: didn't allow for extra data between header and image. - -Modify rdppm.c/wrppm.c to handle 2-byte raw PPM/PGM formats for 12-bit data. - -Fix several bugs in rdrle.c. - -NEED_SHORT_EXTERNAL_NAMES option was broken. - -Revise jerror.h/jerror.c for more flexibility in message table. - -Repair oversight in jmemname.c NO_MKTEMP case: file could be there -but unreadable. - - -Version 5 24-Sep-94 --------------------- - -Version 5 represents a nearly complete redesign and rewrite of the IJG -software. Major user-visible changes include: - * Automatic configuration simplifies installation for most Unix systems. - * A range of speed vs. image quality tradeoffs are supported. - This includes resizing of an image during decompression: scaling down - by a factor of 1/2, 1/4, or 1/8 is handled very efficiently. - * New programs rdjpgcom and wrjpgcom allow insertion and extraction - of text comments in a JPEG file. - -The application programmer's interface to the library has changed completely. -Notable improvements include: - * We have eliminated the use of callback routines for handling the - uncompressed image data. The application now sees the library as a - set of routines that it calls to read or write image data on a - scanline-by-scanline basis. - * The application image data is represented in a conventional interleaved- - pixel format, rather than as a separate array for each color channel. - This can save a copying step in many programs. - * The handling of compressed data has been cleaned up: the application can - supply routines to source or sink the compressed data. It is possible to - suspend processing on source/sink buffer overrun, although this is not - supported in all operating modes. - * All static state has been eliminated from the library, so that multiple - instances of compression or decompression can be active concurrently. - * JPEG abbreviated datastream formats are supported, ie, quantization and - Huffman tables can be stored separately from the image data. - * And not only that, but the documentation of the library has improved - considerably! - - -The last widely used release before the version 5 rewrite was version 4A of -18-Feb-93. Change logs before that point have been discarded, since they -are not of much interest after the rewrite. diff --git a/wxWidgets/src/jpeg/jcapimin.c b/wxWidgets/src/jpeg/jcapimin.c deleted file mode 100644 index 270a353685..0000000000 --- a/wxWidgets/src/jpeg/jcapimin.c +++ /dev/null @@ -1,280 +0,0 @@ -/* - * jcapimin.c - * - * Copyright (C) 1994-1998, Thomas G. Lane. - * This file is part of the Independent JPEG Group's software. - * For conditions of distribution and use, see the accompanying README file. - * - * This file contains application interface code for the compression half - * of the JPEG library. These are the "minimum" API routines that may be - * needed in either the normal full-compression case or the transcoding-only - * case. - * - * Most of the routines intended to be called directly by an application - * are in this file or in jcapistd.c. But also see jcparam.c for - * parameter-setup helper routines, jcomapi.c for routines shared by - * compression and decompression, and jctrans.c for the transcoding case. - */ - -#define JPEG_INTERNALS -#include "jinclude.h" -#include "jpeglib.h" - - -/* - * Initialization of a JPEG compression object. - * The error manager must already be set up (in case memory manager fails). - */ - -GLOBAL(void) -jpeg_CreateCompress (j_compress_ptr cinfo, int version, size_t structsize) -{ - int i; - - /* Guard against version mismatches between library and caller. */ - cinfo->mem = NULL; /* so jpeg_destroy knows mem mgr not called */ - if (version != JPEG_LIB_VERSION) - ERREXIT2(cinfo, JERR_BAD_LIB_VERSION, JPEG_LIB_VERSION, version); - if (structsize != SIZEOF(struct jpeg_compress_struct)) - ERREXIT2(cinfo, JERR_BAD_STRUCT_SIZE, - (int) SIZEOF(struct jpeg_compress_struct), (int) structsize); - - /* For debugging purposes, we zero the whole master structure. - * But the application has already set the err pointer, and may have set - * client_data, so we have to save and restore those fields. - * Note: if application hasn't set client_data, tools like Purify may - * complain here. - */ - { - struct jpeg_error_mgr * err = cinfo->err; - void * client_data = cinfo->client_data; /* ignore Purify complaint here */ - MEMZERO(cinfo, SIZEOF(struct jpeg_compress_struct)); - cinfo->err = err; - cinfo->client_data = client_data; - } - cinfo->is_decompressor = FALSE; - - /* Initialize a memory manager instance for this object */ - jinit_memory_mgr((j_common_ptr) cinfo); - - /* Zero out pointers to permanent structures. */ - cinfo->progress = NULL; - cinfo->dest = NULL; - - cinfo->comp_info = NULL; - - for (i = 0; i < NUM_QUANT_TBLS; i++) - cinfo->quant_tbl_ptrs[i] = NULL; - - for (i = 0; i < NUM_HUFF_TBLS; i++) { - cinfo->dc_huff_tbl_ptrs[i] = NULL; - cinfo->ac_huff_tbl_ptrs[i] = NULL; - } - - cinfo->script_space = NULL; - - cinfo->input_gamma = 1.0; /* in case application forgets */ - - /* OK, I'm ready */ - cinfo->global_state = CSTATE_START; -} - - -/* - * Destruction of a JPEG compression object - */ - -GLOBAL(void) -jpeg_destroy_compress (j_compress_ptr cinfo) -{ - jpeg_destroy((j_common_ptr) cinfo); /* use common routine */ -} - - -/* - * Abort processing of a JPEG compression operation, - * but don't destroy the object itself. - */ - -GLOBAL(void) -jpeg_abort_compress (j_compress_ptr cinfo) -{ - jpeg_abort((j_common_ptr) cinfo); /* use common routine */ -} - - -/* - * Forcibly suppress or un-suppress all quantization and Huffman tables. - * Marks all currently defined tables as already written (if suppress) - * or not written (if !suppress). This will control whether they get emitted - * by a subsequent jpeg_start_compress call. - * - * This routine is exported for use by applications that want to produce - * abbreviated JPEG datastreams. It logically belongs in jcparam.c, but - * since it is called by jpeg_start_compress, we put it here --- otherwise - * jcparam.o would be linked whether the application used it or not. - */ - -GLOBAL(void) -jpeg_suppress_tables (j_compress_ptr cinfo, wxjpeg_boolean suppress) -{ - int i; - JQUANT_TBL * qtbl; - JHUFF_TBL * htbl; - - for (i = 0; i < NUM_QUANT_TBLS; i++) { - if ((qtbl = cinfo->quant_tbl_ptrs[i]) != NULL) - qtbl->sent_table = suppress; - } - - for (i = 0; i < NUM_HUFF_TBLS; i++) { - if ((htbl = cinfo->dc_huff_tbl_ptrs[i]) != NULL) - htbl->sent_table = suppress; - if ((htbl = cinfo->ac_huff_tbl_ptrs[i]) != NULL) - htbl->sent_table = suppress; - } -} - - -/* - * Finish JPEG compression. - * - * If a multipass operating mode was selected, this may do a great deal of - * work including most of the actual output. - */ - -GLOBAL(void) -jpeg_finish_compress (j_compress_ptr cinfo) -{ - JDIMENSION iMCU_row; - - if (cinfo->global_state == CSTATE_SCANNING || - cinfo->global_state == CSTATE_RAW_OK) { - /* Terminate first pass */ - if (cinfo->next_scanline < cinfo->image_height) - ERREXIT(cinfo, JERR_TOO_LITTLE_DATA); - (*cinfo->master->finish_pass) (cinfo); - } else if (cinfo->global_state != CSTATE_WRCOEFS) - ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state); - /* Perform any remaining passes */ - while (! cinfo->master->is_last_pass) { - (*cinfo->master->prepare_for_pass) (cinfo); - for (iMCU_row = 0; iMCU_row < cinfo->total_iMCU_rows; iMCU_row++) { - if (cinfo->progress != NULL) { - cinfo->progress->pass_counter = (long) iMCU_row; - cinfo->progress->pass_limit = (long) cinfo->total_iMCU_rows; - (*cinfo->progress->progress_monitor) ((j_common_ptr) cinfo); - } - /* We bypass the main controller and invoke coef controller directly; - * all work is being done from the coefficient buffer. - */ - if (! (*cinfo->coef->compress_data) (cinfo, (JSAMPIMAGE) NULL)) - ERREXIT(cinfo, JERR_CANT_SUSPEND); - } - (*cinfo->master->finish_pass) (cinfo); - } - /* Write EOI, do final cleanup */ - (*cinfo->marker->write_file_trailer) (cinfo); - (*cinfo->dest->term_destination) (cinfo); - /* We can use jpeg_abort to release memory and reset global_state */ - jpeg_abort((j_common_ptr) cinfo); -} - - -/* - * Write a special marker. - * This is only recommended for writing COM or APPn markers. - * Must be called after jpeg_start_compress() and before - * first call to jpeg_write_scanlines() or jpeg_write_raw_data(). - */ - -GLOBAL(void) -jpeg_write_marker (j_compress_ptr cinfo, int marker, - const JOCTET *dataptr, unsigned int datalen) -{ - JMETHOD(void, write_marker_byte, (j_compress_ptr info, int val)); - - if (cinfo->next_scanline != 0 || - (cinfo->global_state != CSTATE_SCANNING && - cinfo->global_state != CSTATE_RAW_OK && - cinfo->global_state != CSTATE_WRCOEFS)) - ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state); - - (*cinfo->marker->write_marker_header) (cinfo, marker, datalen); - write_marker_byte = cinfo->marker->write_marker_byte; /* copy for speed */ - while (datalen--) { - (*write_marker_byte) (cinfo, *dataptr); - dataptr++; - } -} - -/* Same, but piecemeal. */ - -GLOBAL(void) -jpeg_write_m_header (j_compress_ptr cinfo, int marker, unsigned int datalen) -{ - if (cinfo->next_scanline != 0 || - (cinfo->global_state != CSTATE_SCANNING && - cinfo->global_state != CSTATE_RAW_OK && - cinfo->global_state != CSTATE_WRCOEFS)) - ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state); - - (*cinfo->marker->write_marker_header) (cinfo, marker, datalen); -} - -GLOBAL(void) -jpeg_write_m_byte (j_compress_ptr cinfo, int val) -{ - (*cinfo->marker->write_marker_byte) (cinfo, val); -} - - -/* - * Alternate compression function: just write an abbreviated table file. - * Before calling this, all parameters and a data destination must be set up. - * - * To produce a pair of files containing abbreviated tables and abbreviated - * image data, one would proceed as follows: - * - * initialize JPEG object - * set JPEG parameters - * set destination to table file - * jpeg_write_tables(cinfo); - * set destination to image file - * jpeg_start_compress(cinfo, FALSE); - * write data... - * jpeg_finish_compress(cinfo); - * - * jpeg_write_tables has the side effect of marking all tables written - * (same as jpeg_suppress_tables(..., TRUE)). Thus a subsequent start_compress - * will not re-emit the tables unless it is passed write_all_tables=TRUE. - */ - -GLOBAL(void) -jpeg_write_tables (j_compress_ptr cinfo) -{ - if (cinfo->global_state != CSTATE_START) - ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state); - - /* (Re)initialize error mgr and destination modules */ - (*cinfo->err->reset_error_mgr) ((j_common_ptr) cinfo); - (*cinfo->dest->init_destination) (cinfo); - /* Initialize the marker writer ... bit of a crock to do it here. */ - jinit_marker_writer(cinfo); - /* Write them tables! */ - (*cinfo->marker->write_tables_only) (cinfo); - /* And clean up. */ - (*cinfo->dest->term_destination) (cinfo); - /* - * In library releases up through v6a, we called jpeg_abort() here to free - * any working memory allocated by the destination manager and marker - * writer. Some applications had a problem with that: they allocated space - * of their own from the library memory manager, and didn't want it to go - * away during write_tables. So now we do nothing. This will cause a - * memory leak if an app calls write_tables repeatedly without doing a full - * compression cycle or otherwise resetting the JPEG object. However, that - * seems less bad than unexpectedly freeing memory in the normal case. - * An app that prefers the old behavior can call jpeg_abort for itself after - * each call to jpeg_write_tables(). - */ -} diff --git a/wxWidgets/src/jpeg/jcapistd.c b/wxWidgets/src/jpeg/jcapistd.c deleted file mode 100644 index c138b7c12d..0000000000 --- a/wxWidgets/src/jpeg/jcapistd.c +++ /dev/null @@ -1,161 +0,0 @@ -/* - * jcapistd.c - * - * Copyright (C) 1994-1996, Thomas G. Lane. - * This file is part of the Independent JPEG Group's software. - * For conditions of distribution and use, see the accompanying README file. - * - * This file contains application interface code for the compression half - * of the JPEG library. These are the "standard" API routines that are - * used in the normal full-compression case. They are not used by a - * transcoding-only application. Note that if an application links in - * jpeg_start_compress, it will end up linking in the entire compressor. - * We thus must separate this file from jcapimin.c to avoid linking the - * whole compression library into a transcoder. - */ - -#define JPEG_INTERNALS -#include "jinclude.h" -#include "jpeglib.h" - - -/* - * Compression initialization. - * Before calling this, all parameters and a data destination must be set up. - * - * We require a write_all_tables parameter as a failsafe check when writing - * multiple datastreams from the same compression object. Since prior runs - * will have left all the tables marked sent_table=TRUE, a subsequent run - * would emit an abbreviated stream (no tables) by default. This may be what - * is wanted, but for safety's sake it should not be the default behavior: - * programmers should have to make a deliberate choice to emit abbreviated - * images. Therefore the documentation and examples should encourage people - * to pass write_all_tables=TRUE; then it will take active thought to do the - * wrong thing. - */ - -GLOBAL(void) -jpeg_start_compress (j_compress_ptr cinfo, wxjpeg_boolean write_all_tables) -{ - if (cinfo->global_state != CSTATE_START) - ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state); - - if (write_all_tables) - jpeg_suppress_tables(cinfo, FALSE); /* mark all tables to be written */ - - /* (Re)initialize error mgr and destination modules */ - (*cinfo->err->reset_error_mgr) ((j_common_ptr) cinfo); - (*cinfo->dest->init_destination) (cinfo); - /* Perform master selection of active modules */ - jinit_compress_master(cinfo); - /* Set up for the first pass */ - (*cinfo->master->prepare_for_pass) (cinfo); - /* Ready for application to drive first pass through jpeg_write_scanlines - * or jpeg_write_raw_data. - */ - cinfo->next_scanline = 0; - cinfo->global_state = (cinfo->raw_data_in ? CSTATE_RAW_OK : CSTATE_SCANNING); -} - - -/* - * Write some scanlines of data to the JPEG compressor. - * - * The return value will be the number of lines actually written. - * This should be less than the supplied num_lines only in case that - * the data destination module has requested suspension of the compressor, - * or if more than image_height scanlines are passed in. - * - * Note: we warn about excess calls to jpeg_write_scanlines() since - * this likely signals an application programmer error. However, - * excess scanlines passed in the last valid call are *silently* ignored, - * so that the application need not adjust num_lines for end-of-image - * when using a multiple-scanline buffer. - */ - -GLOBAL(JDIMENSION) -jpeg_write_scanlines (j_compress_ptr cinfo, JSAMPARRAY scanlines, - JDIMENSION num_lines) -{ - JDIMENSION row_ctr, rows_left; - - if (cinfo->global_state != CSTATE_SCANNING) - ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state); - if (cinfo->next_scanline >= cinfo->image_height) - WARNMS(cinfo, JWRN_TOO_MUCH_DATA); - - /* Call progress monitor hook if present */ - if (cinfo->progress != NULL) { - cinfo->progress->pass_counter = (long) cinfo->next_scanline; - cinfo->progress->pass_limit = (long) cinfo->image_height; - (*cinfo->progress->progress_monitor) ((j_common_ptr) cinfo); - } - - /* Give master control module another chance if this is first call to - * jpeg_write_scanlines. This lets output of the frame/scan headers be - * delayed so that application can write COM, etc, markers between - * jpeg_start_compress and jpeg_write_scanlines. - */ - if (cinfo->master->call_pass_startup) - (*cinfo->master->pass_startup) (cinfo); - - /* Ignore any extra scanlines at bottom of image. */ - rows_left = cinfo->image_height - cinfo->next_scanline; - if (num_lines > rows_left) - num_lines = rows_left; - - row_ctr = 0; - (*cinfo->main->process_data) (cinfo, scanlines, &row_ctr, num_lines); - cinfo->next_scanline += row_ctr; - return row_ctr; -} - - -/* - * Alternate entry point to write raw data. - * Processes exactly one iMCU row per call, unless suspended. - */ - -GLOBAL(JDIMENSION) -jpeg_write_raw_data (j_compress_ptr cinfo, JSAMPIMAGE data, - JDIMENSION num_lines) -{ - JDIMENSION lines_per_iMCU_row; - - if (cinfo->global_state != CSTATE_RAW_OK) - ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state); - if (cinfo->next_scanline >= cinfo->image_height) { - WARNMS(cinfo, JWRN_TOO_MUCH_DATA); - return 0; - } - - /* Call progress monitor hook if present */ - if (cinfo->progress != NULL) { - cinfo->progress->pass_counter = (long) cinfo->next_scanline; - cinfo->progress->pass_limit = (long) cinfo->image_height; - (*cinfo->progress->progress_monitor) ((j_common_ptr) cinfo); - } - - /* Give master control module another chance if this is first call to - * jpeg_write_raw_data. This lets output of the frame/scan headers be - * delayed so that application can write COM, etc, markers between - * jpeg_start_compress and jpeg_write_raw_data. - */ - if (cinfo->master->call_pass_startup) - (*cinfo->master->pass_startup) (cinfo); - - /* Verify that at least one iMCU row has been passed. */ - lines_per_iMCU_row = cinfo->max_v_samp_factor * DCTSIZE; - if (num_lines < lines_per_iMCU_row) - ERREXIT(cinfo, JERR_BUFFER_SIZE); - - /* Directly compress the row. */ - if (! (*cinfo->coef->compress_data) (cinfo, data)) { - /* If compressor did not consume the whole row, suspend processing. */ - return 0; - } - - /* OK, we processed one iMCU row. */ - cinfo->next_scanline += lines_per_iMCU_row; - return lines_per_iMCU_row; -} diff --git a/wxWidgets/src/jpeg/jccoefct.c b/wxWidgets/src/jpeg/jccoefct.c deleted file mode 100644 index 3315f21b32..0000000000 --- a/wxWidgets/src/jpeg/jccoefct.c +++ /dev/null @@ -1,449 +0,0 @@ -/* - * jccoefct.c - * - * Copyright (C) 1994-1997, Thomas G. Lane. - * This file is part of the Independent JPEG Group's software. - * For conditions of distribution and use, see the accompanying README file. - * - * This file contains the coefficient buffer controller for compression. - * This controller is the top level of the JPEG compressor proper. - * The coefficient buffer lies between forward-DCT and entropy encoding steps. - */ - -#define JPEG_INTERNALS -#include "jinclude.h" -#include "jpeglib.h" - - -/* We use a full-image coefficient buffer when doing Huffman optimization, - * and also for writing multiple-scan JPEG files. In all cases, the DCT - * step is run during the first pass, and subsequent passes need only read - * the buffered coefficients. - */ -#ifdef ENTROPY_OPT_SUPPORTED -#define FULL_COEF_BUFFER_SUPPORTED -#else -#ifdef C_MULTISCAN_FILES_SUPPORTED -#define FULL_COEF_BUFFER_SUPPORTED -#endif -#endif - - -/* Private buffer controller object */ - -typedef struct { - struct jpeg_c_coef_controller pub; /* public fields */ - - JDIMENSION iMCU_row_num; /* iMCU row # within image */ - JDIMENSION mcu_ctr; /* counts MCUs processed in current row */ - int MCU_vert_offset; /* counts MCU rows within iMCU row */ - int MCU_rows_per_iMCU_row; /* number of such rows needed */ - - /* For single-pass compression, it's sufficient to buffer just one MCU - * (although this may prove a bit slow in practice). We allocate a - * workspace of C_MAX_BLOCKS_IN_MCU coefficient blocks, and reuse it for each - * MCU constructed and sent. (On 80x86, the workspace is FAR even though - * it's not really very big; this is to keep the module interfaces unchanged - * when a large coefficient buffer is necessary.) - * In multi-pass modes, this array points to the current MCU's blocks - * within the virtual arrays. - */ - JBLOCKROW MCU_buffer[C_MAX_BLOCKS_IN_MCU]; - - /* In multi-pass modes, we need a virtual block array for each component. */ - jvirt_barray_ptr whole_image[MAX_COMPONENTS]; -} my_coef_controller; - -typedef my_coef_controller * my_coef_ptr; - - -/* Forward declarations */ -METHODDEF(wxjpeg_boolean) compress_data - JPP((j_compress_ptr cinfo, JSAMPIMAGE input_buf)); -#ifdef FULL_COEF_BUFFER_SUPPORTED -METHODDEF(wxjpeg_boolean) compress_first_pass - JPP((j_compress_ptr cinfo, JSAMPIMAGE input_buf)); -METHODDEF(wxjpeg_boolean) compress_output - JPP((j_compress_ptr cinfo, JSAMPIMAGE input_buf)); -#endif - - -LOCAL(void) -start_iMCU_row (j_compress_ptr cinfo) -/* Reset within-iMCU-row counters for a new row */ -{ - my_coef_ptr coef = (my_coef_ptr) cinfo->coef; - - /* In an interleaved scan, an MCU row is the same as an iMCU row. - * In a noninterleaved scan, an iMCU row has v_samp_factor MCU rows. - * But at the bottom of the image, process only what's left. - */ - if (cinfo->comps_in_scan > 1) { - coef->MCU_rows_per_iMCU_row = 1; - } else { - if (coef->iMCU_row_num < (cinfo->total_iMCU_rows-1)) - coef->MCU_rows_per_iMCU_row = cinfo->cur_comp_info[0]->v_samp_factor; - else - coef->MCU_rows_per_iMCU_row = cinfo->cur_comp_info[0]->last_row_height; - } - - coef->mcu_ctr = 0; - coef->MCU_vert_offset = 0; -} - - -/* - * Initialize for a processing pass. - */ - -METHODDEF(void) -start_pass_coef (j_compress_ptr cinfo, J_BUF_MODE pass_mode) -{ - my_coef_ptr coef = (my_coef_ptr) cinfo->coef; - - coef->iMCU_row_num = 0; - start_iMCU_row(cinfo); - - switch (pass_mode) { - case JBUF_PASS_THRU: - if (coef->whole_image[0] != NULL) - ERREXIT(cinfo, JERR_BAD_BUFFER_MODE); - coef->pub.compress_data = compress_data; - break; -#ifdef FULL_COEF_BUFFER_SUPPORTED - case JBUF_SAVE_AND_PASS: - if (coef->whole_image[0] == NULL) - ERREXIT(cinfo, JERR_BAD_BUFFER_MODE); - coef->pub.compress_data = compress_first_pass; - break; - case JBUF_CRANK_DEST: - if (coef->whole_image[0] == NULL) - ERREXIT(cinfo, JERR_BAD_BUFFER_MODE); - coef->pub.compress_data = compress_output; - break; -#endif - default: - ERREXIT(cinfo, JERR_BAD_BUFFER_MODE); - break; - } -} - - -/* - * Process some data in the single-pass case. - * We process the equivalent of one fully interleaved MCU row ("iMCU" row) - * per call, ie, v_samp_factor block rows for each component in the image. - * Returns TRUE if the iMCU row is completed, FALSE if suspended. - * - * NB: input_buf contains a plane for each component in image, - * which we index according to the component's SOF position. - */ - -METHODDEF(wxjpeg_boolean) -compress_data (j_compress_ptr cinfo, JSAMPIMAGE input_buf) -{ - my_coef_ptr coef = (my_coef_ptr) cinfo->coef; - JDIMENSION MCU_col_num; /* index of current MCU within row */ - JDIMENSION last_MCU_col = cinfo->MCUs_per_row - 1; - JDIMENSION last_iMCU_row = cinfo->total_iMCU_rows - 1; - int blkn, bi, ci, yindex, yoffset, blockcnt; - JDIMENSION ypos, xpos; - jpeg_component_info *compptr; - - /* Loop to write as much as one whole iMCU row */ - for (yoffset = coef->MCU_vert_offset; yoffset < coef->MCU_rows_per_iMCU_row; - yoffset++) { - for (MCU_col_num = coef->mcu_ctr; MCU_col_num <= last_MCU_col; - MCU_col_num++) { - /* Determine where data comes from in input_buf and do the DCT thing. - * Each call on forward_DCT processes a horizontal row of DCT blocks - * as wide as an MCU; we rely on having allocated the MCU_buffer[] blocks - * sequentially. Dummy blocks at the right or bottom edge are filled in - * specially. The data in them does not matter for image reconstruction, - * so we fill them with values that will encode to the smallest amount of - * data, viz: all zeroes in the AC entries, DC entries equal to previous - * block's DC value. (Thanks to Thomas Kinsman for this idea.) - */ - blkn = 0; - for (ci = 0; ci < cinfo->comps_in_scan; ci++) { - compptr = cinfo->cur_comp_info[ci]; - blockcnt = (MCU_col_num < last_MCU_col) ? compptr->MCU_width - : compptr->last_col_width; - xpos = MCU_col_num * compptr->MCU_sample_width; - ypos = yoffset * DCTSIZE; /* ypos == (yoffset+yindex) * DCTSIZE */ - for (yindex = 0; yindex < compptr->MCU_height; yindex++) { - if (coef->iMCU_row_num < last_iMCU_row || - yoffset+yindex < compptr->last_row_height) { - (*cinfo->fdct->forward_DCT) (cinfo, compptr, - input_buf[compptr->component_index], - coef->MCU_buffer[blkn], - ypos, xpos, (JDIMENSION) blockcnt); - if (blockcnt < compptr->MCU_width) { - /* Create some dummy blocks at the right edge of the image. */ - jzero_far((void FAR *) coef->MCU_buffer[blkn + blockcnt], - (compptr->MCU_width - blockcnt) * SIZEOF(JBLOCK)); - for (bi = blockcnt; bi < compptr->MCU_width; bi++) { - coef->MCU_buffer[blkn+bi][0][0] = coef->MCU_buffer[blkn+bi-1][0][0]; - } - } - } else { - /* Create a row of dummy blocks at the bottom of the image. */ - jzero_far((void FAR *) coef->MCU_buffer[blkn], - compptr->MCU_width * SIZEOF(JBLOCK)); - for (bi = 0; bi < compptr->MCU_width; bi++) { - coef->MCU_buffer[blkn+bi][0][0] = coef->MCU_buffer[blkn-1][0][0]; - } - } - blkn += compptr->MCU_width; - ypos += DCTSIZE; - } - } - /* Try to write the MCU. In event of a suspension failure, we will - * re-DCT the MCU on restart (a bit inefficient, could be fixed...) - */ - if (! (*cinfo->entropy->encode_mcu) (cinfo, coef->MCU_buffer)) { - /* Suspension forced; update state counters and exit */ - coef->MCU_vert_offset = yoffset; - coef->mcu_ctr = MCU_col_num; - return FALSE; - } - } - /* Completed an MCU row, but perhaps not an iMCU row */ - coef->mcu_ctr = 0; - } - /* Completed the iMCU row, advance counters for next one */ - coef->iMCU_row_num++; - start_iMCU_row(cinfo); - return TRUE; -} - - -#ifdef FULL_COEF_BUFFER_SUPPORTED - -/* - * Process some data in the first pass of a multi-pass case. - * We process the equivalent of one fully interleaved MCU row ("iMCU" row) - * per call, ie, v_samp_factor block rows for each component in the image. - * This amount of data is read from the source buffer, DCT'd and quantized, - * and saved into the virtual arrays. We also generate suitable dummy blocks - * as needed at the right and lower edges. (The dummy blocks are constructed - * in the virtual arrays, which have been padded appropriately.) This makes - * it possible for subsequent passes not to worry about real vs. dummy blocks. - * - * We must also emit the data to the entropy encoder. This is conveniently - * done by calling compress_output() after we've loaded the current strip - * of the virtual arrays. - * - * NB: input_buf contains a plane for each component in image. All - * components are DCT'd and loaded into the virtual arrays in this pass. - * However, it may be that only a subset of the components are emitted to - * the entropy encoder during this first pass; be careful about looking - * at the scan-dependent variables (MCU dimensions, etc). - */ - -METHODDEF(wxjpeg_boolean) -compress_first_pass (j_compress_ptr cinfo, JSAMPIMAGE input_buf) -{ - my_coef_ptr coef = (my_coef_ptr) cinfo->coef; - JDIMENSION last_iMCU_row = cinfo->total_iMCU_rows - 1; - JDIMENSION blocks_across, MCUs_across, MCUindex; - int bi, ci, h_samp_factor, block_row, block_rows, ndummy; - JCOEF lastDC; - jpeg_component_info *compptr; - JBLOCKARRAY buffer; - JBLOCKROW thisblockrow, lastblockrow; - - for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; - ci++, compptr++) { - /* Align the virtual buffer for this component. */ - buffer = (*cinfo->mem->access_virt_barray) - ((j_common_ptr) cinfo, coef->whole_image[ci], - coef->iMCU_row_num * compptr->v_samp_factor, - (JDIMENSION) compptr->v_samp_factor, TRUE); - /* Count non-dummy DCT block rows in this iMCU row. */ - if (coef->iMCU_row_num < last_iMCU_row) - block_rows = compptr->v_samp_factor; - else { - /* NB: can't use last_row_height here, since may not be set! */ - block_rows = (int) (compptr->height_in_blocks % compptr->v_samp_factor); - if (block_rows == 0) block_rows = compptr->v_samp_factor; - } - blocks_across = compptr->width_in_blocks; - h_samp_factor = compptr->h_samp_factor; - /* Count number of dummy blocks to be added at the right margin. */ - ndummy = (int) (blocks_across % h_samp_factor); - if (ndummy > 0) - ndummy = h_samp_factor - ndummy; - /* Perform DCT for all non-dummy blocks in this iMCU row. Each call - * on forward_DCT processes a complete horizontal row of DCT blocks. - */ - for (block_row = 0; block_row < block_rows; block_row++) { - thisblockrow = buffer[block_row]; - (*cinfo->fdct->forward_DCT) (cinfo, compptr, - input_buf[ci], thisblockrow, - (JDIMENSION) (block_row * DCTSIZE), - (JDIMENSION) 0, blocks_across); - if (ndummy > 0) { - /* Create dummy blocks at the right edge of the image. */ - thisblockrow += blocks_across; /* => first dummy block */ - jzero_far((void FAR *) thisblockrow, ndummy * SIZEOF(JBLOCK)); - lastDC = thisblockrow[-1][0]; - for (bi = 0; bi < ndummy; bi++) { - thisblockrow[bi][0] = lastDC; - } - } - } - /* If at end of image, create dummy block rows as needed. - * The tricky part here is that within each MCU, we want the DC values - * of the dummy blocks to match the last real block's DC value. - * This squeezes a few more bytes out of the resulting file... - */ - if (coef->iMCU_row_num == last_iMCU_row) { - blocks_across += ndummy; /* include lower right corner */ - MCUs_across = blocks_across / h_samp_factor; - for (block_row = block_rows; block_row < compptr->v_samp_factor; - block_row++) { - thisblockrow = buffer[block_row]; - lastblockrow = buffer[block_row-1]; - jzero_far((void FAR *) thisblockrow, - (size_t) (blocks_across * SIZEOF(JBLOCK))); - for (MCUindex = 0; MCUindex < MCUs_across; MCUindex++) { - lastDC = lastblockrow[h_samp_factor-1][0]; - for (bi = 0; bi < h_samp_factor; bi++) { - thisblockrow[bi][0] = lastDC; - } - thisblockrow += h_samp_factor; /* advance to next MCU in row */ - lastblockrow += h_samp_factor; - } - } - } - } - /* NB: compress_output will increment iMCU_row_num if successful. - * A suspension return will result in redoing all the work above next time. - */ - - /* Emit data to the entropy encoder, sharing code with subsequent passes */ - return compress_output(cinfo, input_buf); -} - - -/* - * Process some data in subsequent passes of a multi-pass case. - * We process the equivalent of one fully interleaved MCU row ("iMCU" row) - * per call, ie, v_samp_factor block rows for each component in the scan. - * The data is obtained from the virtual arrays and fed to the entropy coder. - * Returns TRUE if the iMCU row is completed, FALSE if suspended. - * - * NB: input_buf is ignored; it is likely to be a NULL pointer. - */ - -METHODDEF(wxjpeg_boolean) -compress_output (j_compress_ptr cinfo, JSAMPIMAGE input_buf) -{ - my_coef_ptr coef = (my_coef_ptr) cinfo->coef; - JDIMENSION MCU_col_num; /* index of current MCU within row */ - int blkn, ci, xindex, yindex, yoffset; - JDIMENSION start_col; - JBLOCKARRAY buffer[MAX_COMPS_IN_SCAN]; - JBLOCKROW buffer_ptr; - jpeg_component_info *compptr; - - /* Align the virtual buffers for the components used in this scan. - * NB: during first pass, this is safe only because the buffers will - * already be aligned properly, so jmemmgr.c won't need to do any I/O. - */ - for (ci = 0; ci < cinfo->comps_in_scan; ci++) { - compptr = cinfo->cur_comp_info[ci]; - buffer[ci] = (*cinfo->mem->access_virt_barray) - ((j_common_ptr) cinfo, coef->whole_image[compptr->component_index], - coef->iMCU_row_num * compptr->v_samp_factor, - (JDIMENSION) compptr->v_samp_factor, FALSE); - } - - /* Loop to process one whole iMCU row */ - for (yoffset = coef->MCU_vert_offset; yoffset < coef->MCU_rows_per_iMCU_row; - yoffset++) { - for (MCU_col_num = coef->mcu_ctr; MCU_col_num < cinfo->MCUs_per_row; - MCU_col_num++) { - /* Construct list of pointers to DCT blocks belonging to this MCU */ - blkn = 0; /* index of current DCT block within MCU */ - for (ci = 0; ci < cinfo->comps_in_scan; ci++) { - compptr = cinfo->cur_comp_info[ci]; - start_col = MCU_col_num * compptr->MCU_width; - for (yindex = 0; yindex < compptr->MCU_height; yindex++) { - buffer_ptr = buffer[ci][yindex+yoffset] + start_col; - for (xindex = 0; xindex < compptr->MCU_width; xindex++) { - coef->MCU_buffer[blkn++] = buffer_ptr++; - } - } - } - /* Try to write the MCU. */ - if (! (*cinfo->entropy->encode_mcu) (cinfo, coef->MCU_buffer)) { - /* Suspension forced; update state counters and exit */ - coef->MCU_vert_offset = yoffset; - coef->mcu_ctr = MCU_col_num; - return FALSE; - } - } - /* Completed an MCU row, but perhaps not an iMCU row */ - coef->mcu_ctr = 0; - } - /* Completed the iMCU row, advance counters for next one */ - coef->iMCU_row_num++; - start_iMCU_row(cinfo); - return TRUE; -} - -#endif /* FULL_COEF_BUFFER_SUPPORTED */ - - -/* - * Initialize coefficient buffer controller. - */ - -GLOBAL(void) -jinit_c_coef_controller (j_compress_ptr cinfo, wxjpeg_boolean need_full_buffer) -{ - my_coef_ptr coef; - - coef = (my_coef_ptr) - (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, - SIZEOF(my_coef_controller)); - cinfo->coef = (struct jpeg_c_coef_controller *) coef; - coef->pub.start_pass = start_pass_coef; - - /* Create the coefficient buffer. */ - if (need_full_buffer) { -#ifdef FULL_COEF_BUFFER_SUPPORTED - /* Allocate a full-image virtual array for each component, */ - /* padded to a multiple of samp_factor DCT blocks in each direction. */ - int ci; - jpeg_component_info *compptr; - - for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; - ci++, compptr++) { - coef->whole_image[ci] = (*cinfo->mem->request_virt_barray) - ((j_common_ptr) cinfo, JPOOL_IMAGE, FALSE, - (JDIMENSION) jround_up((long) compptr->width_in_blocks, - (long) compptr->h_samp_factor), - (JDIMENSION) jround_up((long) compptr->height_in_blocks, - (long) compptr->v_samp_factor), - (JDIMENSION) compptr->v_samp_factor); - } -#else - ERREXIT(cinfo, JERR_BAD_BUFFER_MODE); -#endif - } else { - /* We only need a single-MCU buffer. */ - JBLOCKROW buffer; - int i; - - buffer = (JBLOCKROW) - (*cinfo->mem->alloc_large) ((j_common_ptr) cinfo, JPOOL_IMAGE, - C_MAX_BLOCKS_IN_MCU * SIZEOF(JBLOCK)); - for (i = 0; i < C_MAX_BLOCKS_IN_MCU; i++) { - coef->MCU_buffer[i] = buffer + i; - } - coef->whole_image[0] = NULL; /* flag for no virtual arrays */ - } -} diff --git a/wxWidgets/src/jpeg/jccolor.c b/wxWidgets/src/jpeg/jccolor.c deleted file mode 100644 index 2f74cc2a39..0000000000 --- a/wxWidgets/src/jpeg/jccolor.c +++ /dev/null @@ -1,459 +0,0 @@ -/* - * jccolor.c - * - * Copyright (C) 1991-1996, Thomas G. Lane. - * This file is part of the Independent JPEG Group's software. - * For conditions of distribution and use, see the accompanying README file. - * - * This file contains input colorspace conversion routines. - */ - -#define JPEG_INTERNALS -#include "jinclude.h" -#include "jpeglib.h" - - -/* Private subobject */ - -typedef struct { - struct jpeg_color_converter pub; /* public fields */ - - /* Private state for RGB->YCC conversion */ - JPEG_INT32 * rgb_ycc_tab; /* => table for RGB to YCbCr conversion */ -} my_color_converter; - -typedef my_color_converter * my_cconvert_ptr; - - -/**************** RGB -> YCbCr conversion: most common case **************/ - -/* - * YCbCr is defined per CCIR 601-1, except that Cb and Cr are - * normalized to the range 0..MAXJSAMPLE rather than -0.5 .. 0.5. - * The conversion equations to be implemented are therefore - * Y = 0.29900 * R + 0.58700 * G + 0.11400 * B - * Cb = -0.16874 * R - 0.33126 * G + 0.50000 * B + CENTERJSAMPLE - * Cr = 0.50000 * R - 0.41869 * G - 0.08131 * B + CENTERJSAMPLE - * (These numbers are derived from TIFF 6.0 section 21, dated 3-June-92.) - * Note: older versions of the IJG code used a zero offset of MAXJSAMPLE/2, - * rather than CENTERJSAMPLE, for Cb and Cr. This gave equal positive and - * negative swings for Cb/Cr, but meant that grayscale values (Cb=Cr=0) - * were not represented exactly. Now we sacrifice exact representation of - * maximum red and maximum blue in order to get exact grayscales. - * - * To avoid floating-point arithmetic, we represent the fractional constants - * as integers scaled up by 2^16 (about 4 digits precision); we have to divide - * the products by 2^16, with appropriate rounding, to get the correct answer. - * - * For even more speed, we avoid doing any multiplications in the inner loop - * by precalculating the constants times R,G,B for all possible values. - * For 8-bit JSAMPLEs this is very reasonable (only 256 entries per table); - * for 12-bit samples it is still acceptable. It's not very reasonable for - * 16-bit samples, but if you want lossless storage you shouldn't be changing - * colorspace anyway. - * The CENTERJSAMPLE offsets and the rounding fudge-factor of 0.5 are included - * in the tables to save adding them separately in the inner loop. - */ - -#define SCALEBITS 16 /* speediest right-shift on some machines */ -#define CBCR_OFFSET ((JPEG_INT32) CENTERJSAMPLE << SCALEBITS) -#define ONE_HALF ((JPEG_INT32) 1 << (SCALEBITS-1)) -#define FIX(x) ((JPEG_INT32) ((x) * (1L< Y section */ -#define G_Y_OFF (1*(MAXJSAMPLE+1)) /* offset to G => Y section */ -#define B_Y_OFF (2*(MAXJSAMPLE+1)) /* etc. */ -#define R_CB_OFF (3*(MAXJSAMPLE+1)) -#define G_CB_OFF (4*(MAXJSAMPLE+1)) -#define B_CB_OFF (5*(MAXJSAMPLE+1)) -#define R_CR_OFF B_CB_OFF /* B=>Cb, R=>Cr are the same */ -#define G_CR_OFF (6*(MAXJSAMPLE+1)) -#define B_CR_OFF (7*(MAXJSAMPLE+1)) -#define TABLE_SIZE (8*(MAXJSAMPLE+1)) - - -/* - * Initialize for RGB->YCC colorspace conversion. - */ - -METHODDEF(void) -rgb_ycc_start (j_compress_ptr cinfo) -{ - my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert; - JPEG_INT32 * rgb_ycc_tab; - JPEG_INT32 i; - - /* Allocate and fill in the conversion tables. */ - cconvert->rgb_ycc_tab = rgb_ycc_tab = (JPEG_INT32 *) - (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, - (TABLE_SIZE * SIZEOF(JPEG_INT32))); - - for (i = 0; i <= MAXJSAMPLE; i++) { - rgb_ycc_tab[i+R_Y_OFF] = FIX(0.29900) * i; - rgb_ycc_tab[i+G_Y_OFF] = FIX(0.58700) * i; - rgb_ycc_tab[i+B_Y_OFF] = FIX(0.11400) * i + ONE_HALF; - rgb_ycc_tab[i+R_CB_OFF] = (-FIX(0.16874)) * i; - rgb_ycc_tab[i+G_CB_OFF] = (-FIX(0.33126)) * i; - /* We use a rounding fudge-factor of 0.5-epsilon for Cb and Cr. - * This ensures that the maximum output will round to MAXJSAMPLE - * not MAXJSAMPLE+1, and thus that we don't have to range-limit. - */ - rgb_ycc_tab[i+B_CB_OFF] = FIX(0.50000) * i + CBCR_OFFSET + ONE_HALF-1; -/* B=>Cb and R=>Cr tables are the same - rgb_ycc_tab[i+R_CR_OFF] = FIX(0.50000) * i + CBCR_OFFSET + ONE_HALF-1; -*/ - rgb_ycc_tab[i+G_CR_OFF] = (-FIX(0.41869)) * i; - rgb_ycc_tab[i+B_CR_OFF] = (-FIX(0.08131)) * i; - } -} - - -/* - * Convert some rows of samples to the JPEG colorspace. - * - * Note that we change from the application's interleaved-pixel format - * to our internal noninterleaved, one-plane-per-component format. - * The input buffer is therefore three times as wide as the output buffer. - * - * A starting row offset is provided only for the output buffer. The caller - * can easily adjust the passed input_buf value to accommodate any row - * offset required on that side. - */ - -METHODDEF(void) -rgb_ycc_convert (j_compress_ptr cinfo, - JSAMPARRAY input_buf, JSAMPIMAGE output_buf, - JDIMENSION output_row, int num_rows) -{ - my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert; - register int r, g, b; - register JPEG_INT32 * ctab = cconvert->rgb_ycc_tab; - register JSAMPROW inptr; - register JSAMPROW outptr0, outptr1, outptr2; - register JDIMENSION col; - JDIMENSION num_cols = cinfo->image_width; - - while (--num_rows >= 0) { - inptr = *input_buf++; - outptr0 = output_buf[0][output_row]; - outptr1 = output_buf[1][output_row]; - outptr2 = output_buf[2][output_row]; - output_row++; - for (col = 0; col < num_cols; col++) { - r = GETJSAMPLE(inptr[RGB_RED]); - g = GETJSAMPLE(inptr[RGB_GREEN]); - b = GETJSAMPLE(inptr[RGB_BLUE]); - inptr += RGB_PIXELSIZE; - /* If the inputs are 0..MAXJSAMPLE, the outputs of these equations - * must be too; we do not need an explicit range-limiting operation. - * Hence the value being shifted is never negative, and we don't - * need the general RIGHT_SHIFT macro. - */ - /* Y */ - outptr0[col] = (JSAMPLE) - ((ctab[r+R_Y_OFF] + ctab[g+G_Y_OFF] + ctab[b+B_Y_OFF]) - >> SCALEBITS); - /* Cb */ - outptr1[col] = (JSAMPLE) - ((ctab[r+R_CB_OFF] + ctab[g+G_CB_OFF] + ctab[b+B_CB_OFF]) - >> SCALEBITS); - /* Cr */ - outptr2[col] = (JSAMPLE) - ((ctab[r+R_CR_OFF] + ctab[g+G_CR_OFF] + ctab[b+B_CR_OFF]) - >> SCALEBITS); - } - } -} - - -/**************** Cases other than RGB -> YCbCr **************/ - - -/* - * Convert some rows of samples to the JPEG colorspace. - * This version handles RGB->grayscale conversion, which is the same - * as the RGB->Y portion of RGB->YCbCr. - * We assume rgb_ycc_start has been called (we only use the Y tables). - */ - -METHODDEF(void) -rgb_gray_convert (j_compress_ptr cinfo, - JSAMPARRAY input_buf, JSAMPIMAGE output_buf, - JDIMENSION output_row, int num_rows) -{ - my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert; - register int r, g, b; - register JPEG_INT32 * ctab = cconvert->rgb_ycc_tab; - register JSAMPROW inptr; - register JSAMPROW outptr; - register JDIMENSION col; - JDIMENSION num_cols = cinfo->image_width; - - while (--num_rows >= 0) { - inptr = *input_buf++; - outptr = output_buf[0][output_row]; - output_row++; - for (col = 0; col < num_cols; col++) { - r = GETJSAMPLE(inptr[RGB_RED]); - g = GETJSAMPLE(inptr[RGB_GREEN]); - b = GETJSAMPLE(inptr[RGB_BLUE]); - inptr += RGB_PIXELSIZE; - /* Y */ - outptr[col] = (JSAMPLE) - ((ctab[r+R_Y_OFF] + ctab[g+G_Y_OFF] + ctab[b+B_Y_OFF]) - >> SCALEBITS); - } - } -} - - -/* - * Convert some rows of samples to the JPEG colorspace. - * This version handles Adobe-style CMYK->YCCK conversion, - * where we convert R=1-C, G=1-M, and B=1-Y to YCbCr using the same - * conversion as above, while passing K (black) unchanged. - * We assume rgb_ycc_start has been called. - */ - -METHODDEF(void) -cmyk_ycck_convert (j_compress_ptr cinfo, - JSAMPARRAY input_buf, JSAMPIMAGE output_buf, - JDIMENSION output_row, int num_rows) -{ - my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert; - register int r, g, b; - register JPEG_INT32 * ctab = cconvert->rgb_ycc_tab; - register JSAMPROW inptr; - register JSAMPROW outptr0, outptr1, outptr2, outptr3; - register JDIMENSION col; - JDIMENSION num_cols = cinfo->image_width; - - while (--num_rows >= 0) { - inptr = *input_buf++; - outptr0 = output_buf[0][output_row]; - outptr1 = output_buf[1][output_row]; - outptr2 = output_buf[2][output_row]; - outptr3 = output_buf[3][output_row]; - output_row++; - for (col = 0; col < num_cols; col++) { - r = MAXJSAMPLE - GETJSAMPLE(inptr[0]); - g = MAXJSAMPLE - GETJSAMPLE(inptr[1]); - b = MAXJSAMPLE - GETJSAMPLE(inptr[2]); - /* K passes through as-is */ - outptr3[col] = inptr[3]; /* don't need GETJSAMPLE here */ - inptr += 4; - /* If the inputs are 0..MAXJSAMPLE, the outputs of these equations - * must be too; we do not need an explicit range-limiting operation. - * Hence the value being shifted is never negative, and we don't - * need the general RIGHT_SHIFT macro. - */ - /* Y */ - outptr0[col] = (JSAMPLE) - ((ctab[r+R_Y_OFF] + ctab[g+G_Y_OFF] + ctab[b+B_Y_OFF]) - >> SCALEBITS); - /* Cb */ - outptr1[col] = (JSAMPLE) - ((ctab[r+R_CB_OFF] + ctab[g+G_CB_OFF] + ctab[b+B_CB_OFF]) - >> SCALEBITS); - /* Cr */ - outptr2[col] = (JSAMPLE) - ((ctab[r+R_CR_OFF] + ctab[g+G_CR_OFF] + ctab[b+B_CR_OFF]) - >> SCALEBITS); - } - } -} - - -/* - * Convert some rows of samples to the JPEG colorspace. - * This version handles grayscale output with no conversion. - * The source can be either plain grayscale or YCbCr (since Y == gray). - */ - -METHODDEF(void) -grayscale_convert (j_compress_ptr cinfo, - JSAMPARRAY input_buf, JSAMPIMAGE output_buf, - JDIMENSION output_row, int num_rows) -{ - register JSAMPROW inptr; - register JSAMPROW outptr; - register JDIMENSION col; - JDIMENSION num_cols = cinfo->image_width; - int instride = cinfo->input_components; - - while (--num_rows >= 0) { - inptr = *input_buf++; - outptr = output_buf[0][output_row]; - output_row++; - for (col = 0; col < num_cols; col++) { - outptr[col] = inptr[0]; /* don't need GETJSAMPLE() here */ - inptr += instride; - } - } -} - - -/* - * Convert some rows of samples to the JPEG colorspace. - * This version handles multi-component colorspaces without conversion. - * We assume input_components == num_components. - */ - -METHODDEF(void) -null_convert (j_compress_ptr cinfo, - JSAMPARRAY input_buf, JSAMPIMAGE output_buf, - JDIMENSION output_row, int num_rows) -{ - register JSAMPROW inptr; - register JSAMPROW outptr; - register JDIMENSION col; - register int ci; - int nc = cinfo->num_components; - JDIMENSION num_cols = cinfo->image_width; - - while (--num_rows >= 0) { - /* It seems fastest to make a separate pass for each component. */ - for (ci = 0; ci < nc; ci++) { - inptr = *input_buf; - outptr = output_buf[ci][output_row]; - for (col = 0; col < num_cols; col++) { - outptr[col] = inptr[ci]; /* don't need GETJSAMPLE() here */ - inptr += nc; - } - } - input_buf++; - output_row++; - } -} - - -/* - * Empty method for start_pass. - */ - -METHODDEF(void) -null_method (j_compress_ptr cinfo) -{ - /* no work needed */ -} - - -/* - * Module initialization routine for input colorspace conversion. - */ - -GLOBAL(void) -jinit_color_converter (j_compress_ptr cinfo) -{ - my_cconvert_ptr cconvert; - - cconvert = (my_cconvert_ptr) - (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, - SIZEOF(my_color_converter)); - cinfo->cconvert = (struct jpeg_color_converter *) cconvert; - /* set start_pass to null method until we find out differently */ - cconvert->pub.start_pass = null_method; - - /* Make sure input_components agrees with in_color_space */ - switch (cinfo->in_color_space) { - case JCS_GRAYSCALE: - if (cinfo->input_components != 1) - ERREXIT(cinfo, JERR_BAD_IN_COLORSPACE); - break; - - case JCS_RGB: -#if RGB_PIXELSIZE != 3 - if (cinfo->input_components != RGB_PIXELSIZE) - ERREXIT(cinfo, JERR_BAD_IN_COLORSPACE); - break; -#endif /* else share code with YCbCr */ - - case JCS_YCbCr: - if (cinfo->input_components != 3) - ERREXIT(cinfo, JERR_BAD_IN_COLORSPACE); - break; - - case JCS_CMYK: - case JCS_YCCK: - if (cinfo->input_components != 4) - ERREXIT(cinfo, JERR_BAD_IN_COLORSPACE); - break; - - default: /* JCS_UNKNOWN can be anything */ - if (cinfo->input_components < 1) - ERREXIT(cinfo, JERR_BAD_IN_COLORSPACE); - break; - } - - /* Check num_components, set conversion method based on requested space */ - switch (cinfo->jpeg_color_space) { - case JCS_GRAYSCALE: - if (cinfo->num_components != 1) - ERREXIT(cinfo, JERR_BAD_J_COLORSPACE); - if (cinfo->in_color_space == JCS_GRAYSCALE) - cconvert->pub.color_convert = grayscale_convert; - else if (cinfo->in_color_space == JCS_RGB) { - cconvert->pub.start_pass = rgb_ycc_start; - cconvert->pub.color_convert = rgb_gray_convert; - } else if (cinfo->in_color_space == JCS_YCbCr) - cconvert->pub.color_convert = grayscale_convert; - else - ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL); - break; - - case JCS_RGB: - if (cinfo->num_components != 3) - ERREXIT(cinfo, JERR_BAD_J_COLORSPACE); - if (cinfo->in_color_space == JCS_RGB && RGB_PIXELSIZE == 3) - cconvert->pub.color_convert = null_convert; - else - ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL); - break; - - case JCS_YCbCr: - if (cinfo->num_components != 3) - ERREXIT(cinfo, JERR_BAD_J_COLORSPACE); - if (cinfo->in_color_space == JCS_RGB) { - cconvert->pub.start_pass = rgb_ycc_start; - cconvert->pub.color_convert = rgb_ycc_convert; - } else if (cinfo->in_color_space == JCS_YCbCr) - cconvert->pub.color_convert = null_convert; - else - ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL); - break; - - case JCS_CMYK: - if (cinfo->num_components != 4) - ERREXIT(cinfo, JERR_BAD_J_COLORSPACE); - if (cinfo->in_color_space == JCS_CMYK) - cconvert->pub.color_convert = null_convert; - else - ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL); - break; - - case JCS_YCCK: - if (cinfo->num_components != 4) - ERREXIT(cinfo, JERR_BAD_J_COLORSPACE); - if (cinfo->in_color_space == JCS_CMYK) { - cconvert->pub.start_pass = rgb_ycc_start; - cconvert->pub.color_convert = cmyk_ycck_convert; - } else if (cinfo->in_color_space == JCS_YCCK) - cconvert->pub.color_convert = null_convert; - else - ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL); - break; - - default: /* allow null conversion of JCS_UNKNOWN */ - if (cinfo->jpeg_color_space != cinfo->in_color_space || - cinfo->num_components != cinfo->input_components) - ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL); - cconvert->pub.color_convert = null_convert; - break; - } -} diff --git a/wxWidgets/src/jpeg/jcdctmgr.c b/wxWidgets/src/jpeg/jcdctmgr.c deleted file mode 100644 index 03ffc8ae41..0000000000 --- a/wxWidgets/src/jpeg/jcdctmgr.c +++ /dev/null @@ -1,387 +0,0 @@ -/* - * jcdctmgr.c - * - * Copyright (C) 1994-1996, Thomas G. Lane. - * This file is part of the Independent JPEG Group's software. - * For conditions of distribution and use, see the accompanying README file. - * - * This file contains the forward-DCT management logic. - * This code selects a particular DCT implementation to be used, - * and it performs related housekeeping chores including coefficient - * quantization. - */ - -#define JPEG_INTERNALS -#include "jinclude.h" -#include "jpeglib.h" -#include "jdct.h" /* Private declarations for DCT subsystem */ - - -/* Private subobject for this module */ - -typedef struct { - struct jpeg_forward_dct pub; /* public fields */ - - /* Pointer to the DCT routine actually in use */ - forward_DCT_method_ptr do_dct; - - /* The actual post-DCT divisors --- not identical to the quant table - * entries, because of scaling (especially for an unnormalized DCT). - * Each table is given in normal array order. - */ - DCTELEM * divisors[NUM_QUANT_TBLS]; - -#ifdef DCT_FLOAT_SUPPORTED - /* Same as above for the floating-point case. */ - float_DCT_method_ptr do_float_dct; - FAST_FLOAT * float_divisors[NUM_QUANT_TBLS]; -#endif -} my_fdct_controller; - -typedef my_fdct_controller * my_fdct_ptr; - - -/* - * Initialize for a processing pass. - * Verify that all referenced Q-tables are present, and set up - * the divisor table for each one. - * In the current implementation, DCT of all components is done during - * the first pass, even if only some components will be output in the - * first scan. Hence all components should be examined here. - */ - -METHODDEF(void) -start_pass_fdctmgr (j_compress_ptr cinfo) -{ - my_fdct_ptr fdct = (my_fdct_ptr) cinfo->fdct; - int ci, qtblno, i; - jpeg_component_info *compptr; - JQUANT_TBL * qtbl; - DCTELEM * dtbl; - - for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; - ci++, compptr++) { - qtblno = compptr->quant_tbl_no; - /* Make sure specified quantization table is present */ - if (qtblno < 0 || qtblno >= NUM_QUANT_TBLS || - cinfo->quant_tbl_ptrs[qtblno] == NULL) - ERREXIT1(cinfo, JERR_NO_QUANT_TABLE, qtblno); - qtbl = cinfo->quant_tbl_ptrs[qtblno]; - /* Compute divisors for this quant table */ - /* We may do this more than once for same table, but it's not a big deal */ - switch (cinfo->dct_method) { -#ifdef DCT_ISLOW_SUPPORTED - case JDCT_ISLOW: - /* For LL&M IDCT method, divisors are equal to raw quantization - * coefficients multiplied by 8 (to counteract scaling). - */ - if (fdct->divisors[qtblno] == NULL) { - fdct->divisors[qtblno] = (DCTELEM *) - (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, - DCTSIZE2 * SIZEOF(DCTELEM)); - } - dtbl = fdct->divisors[qtblno]; - for (i = 0; i < DCTSIZE2; i++) { - dtbl[i] = ((DCTELEM) qtbl->quantval[i]) << 3; - } - break; -#endif -#ifdef DCT_IFAST_SUPPORTED - case JDCT_IFAST: - { - /* For AA&N IDCT method, divisors are equal to quantization - * coefficients scaled by scalefactor[row]*scalefactor[col], where - * scalefactor[0] = 1 - * scalefactor[k] = cos(k*PI/16) * sqrt(2) for k=1..7 - * We apply a further scale factor of 8. - */ -#define CONST_BITS 14 - static const INT16 aanscales[DCTSIZE2] = { - /* precomputed values scaled up by 14 bits */ - 16384, 22725, 21407, 19266, 16384, 12873, 8867, 4520, - 22725, 31521, 29692, 26722, 22725, 17855, 12299, 6270, - 21407, 29692, 27969, 25172, 21407, 16819, 11585, 5906, - 19266, 26722, 25172, 22654, 19266, 15137, 10426, 5315, - 16384, 22725, 21407, 19266, 16384, 12873, 8867, 4520, - 12873, 17855, 16819, 15137, 12873, 10114, 6967, 3552, - 8867, 12299, 11585, 10426, 8867, 6967, 4799, 2446, - 4520, 6270, 5906, 5315, 4520, 3552, 2446, 1247 - }; - SHIFT_TEMPS - - if (fdct->divisors[qtblno] == NULL) { - fdct->divisors[qtblno] = (DCTELEM *) - (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, - DCTSIZE2 * SIZEOF(DCTELEM)); - } - dtbl = fdct->divisors[qtblno]; - for (i = 0; i < DCTSIZE2; i++) { - dtbl[i] = (DCTELEM) - DESCALE(MULTIPLY16V16((JPEG_INT32) qtbl->quantval[i], - (JPEG_INT32) aanscales[i]), - CONST_BITS-3); - } - } - break; -#endif -#ifdef DCT_FLOAT_SUPPORTED - case JDCT_FLOAT: - { - /* For float AA&N IDCT method, divisors are equal to quantization - * coefficients scaled by scalefactor[row]*scalefactor[col], where - * scalefactor[0] = 1 - * scalefactor[k] = cos(k*PI/16) * sqrt(2) for k=1..7 - * We apply a further scale factor of 8. - * What's actually stored is 1/divisor so that the inner loop can - * use a multiplication rather than a division. - */ - FAST_FLOAT * fdtbl; - int row, col; - static const double aanscalefactor[DCTSIZE] = { - 1.0, 1.387039845, 1.306562965, 1.175875602, - 1.0, 0.785694958, 0.541196100, 0.275899379 - }; - - if (fdct->float_divisors[qtblno] == NULL) { - fdct->float_divisors[qtblno] = (FAST_FLOAT *) - (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, - DCTSIZE2 * SIZEOF(FAST_FLOAT)); - } - fdtbl = fdct->float_divisors[qtblno]; - i = 0; - for (row = 0; row < DCTSIZE; row++) { - for (col = 0; col < DCTSIZE; col++) { - fdtbl[i] = (FAST_FLOAT) - (1.0 / (((double) qtbl->quantval[i] * - aanscalefactor[row] * aanscalefactor[col] * 8.0))); - i++; - } - } - } - break; -#endif - default: - ERREXIT(cinfo, JERR_NOT_COMPILED); - break; - } - } -} - - -/* - * Perform forward DCT on one or more blocks of a component. - * - * The input samples are taken from the sample_data[] array starting at - * position start_row/start_col, and moving to the right for any additional - * blocks. The quantized coefficients are returned in coef_blocks[]. - */ - -METHODDEF(void) -forward_DCT (j_compress_ptr cinfo, jpeg_component_info * compptr, - JSAMPARRAY sample_data, JBLOCKROW coef_blocks, - JDIMENSION start_row, JDIMENSION start_col, - JDIMENSION num_blocks) -/* This version is used for integer DCT implementations. */ -{ - /* This routine is heavily used, so it's worth coding it tightly. */ - my_fdct_ptr fdct = (my_fdct_ptr) cinfo->fdct; - forward_DCT_method_ptr do_dct = fdct->do_dct; - DCTELEM * divisors = fdct->divisors[compptr->quant_tbl_no]; - DCTELEM workspace[DCTSIZE2]; /* work area for FDCT subroutine */ - JDIMENSION bi; - - sample_data += start_row; /* fold in the vertical offset once */ - - for (bi = 0; bi < num_blocks; bi++, start_col += DCTSIZE) { - /* Load data into workspace, applying unsigned->signed conversion */ - { register DCTELEM *workspaceptr; - register JSAMPROW elemptr; - register int elemr; - - workspaceptr = workspace; - for (elemr = 0; elemr < DCTSIZE; elemr++) { - elemptr = sample_data[elemr] + start_col; -#if DCTSIZE == 8 /* unroll the inner loop */ - *workspaceptr++ = GETJSAMPLE(*elemptr++) - CENTERJSAMPLE; - *workspaceptr++ = GETJSAMPLE(*elemptr++) - CENTERJSAMPLE; - *workspaceptr++ = GETJSAMPLE(*elemptr++) - CENTERJSAMPLE; - *workspaceptr++ = GETJSAMPLE(*elemptr++) - CENTERJSAMPLE; - *workspaceptr++ = GETJSAMPLE(*elemptr++) - CENTERJSAMPLE; - *workspaceptr++ = GETJSAMPLE(*elemptr++) - CENTERJSAMPLE; - *workspaceptr++ = GETJSAMPLE(*elemptr++) - CENTERJSAMPLE; - *workspaceptr++ = GETJSAMPLE(*elemptr++) - CENTERJSAMPLE; -#else - { register int elemc; - for (elemc = DCTSIZE; elemc > 0; elemc--) { - *workspaceptr++ = GETJSAMPLE(*elemptr++) - CENTERJSAMPLE; - } - } -#endif - } - } - - /* Perform the DCT */ - (*do_dct) (workspace); - - /* Quantize/descale the coefficients, and store into coef_blocks[] */ - { register DCTELEM temp, qval; - register int i; - register JCOEFPTR output_ptr = coef_blocks[bi]; - - for (i = 0; i < DCTSIZE2; i++) { - qval = divisors[i]; - temp = workspace[i]; - /* Divide the coefficient value by qval, ensuring proper rounding. - * Since C does not specify the direction of rounding for negative - * quotients, we have to force the dividend positive for portability. - * - * In most files, at least half of the output values will be zero - * (at default quantization settings, more like three-quarters...) - * so we should ensure that this case is fast. On many machines, - * a comparison is enough cheaper than a divide to make a special test - * a win. Since both inputs will be nonnegative, we need only test - * for a < b to discover whether a/b is 0. - * If your machine's division is fast enough, define FAST_DIVIDE. - */ -#ifdef FAST_DIVIDE -#define DIVIDE_BY(a,b) a /= b -#else -#define DIVIDE_BY(a,b) if (a >= b) a /= b; else a = 0 -#endif - if (temp < 0) { - temp = -temp; - temp += qval>>1; /* for rounding */ - DIVIDE_BY(temp, qval); - temp = -temp; - } else { - temp += qval>>1; /* for rounding */ - DIVIDE_BY(temp, qval); - } - output_ptr[i] = (JCOEF) temp; - } - } - } -} - - -#ifdef DCT_FLOAT_SUPPORTED - -METHODDEF(void) -forward_DCT_float (j_compress_ptr cinfo, jpeg_component_info * compptr, - JSAMPARRAY sample_data, JBLOCKROW coef_blocks, - JDIMENSION start_row, JDIMENSION start_col, - JDIMENSION num_blocks) -/* This version is used for floating-point DCT implementations. */ -{ - /* This routine is heavily used, so it's worth coding it tightly. */ - my_fdct_ptr fdct = (my_fdct_ptr) cinfo->fdct; - float_DCT_method_ptr do_dct = fdct->do_float_dct; - FAST_FLOAT * divisors = fdct->float_divisors[compptr->quant_tbl_no]; - FAST_FLOAT workspace[DCTSIZE2]; /* work area for FDCT subroutine */ - JDIMENSION bi; - - sample_data += start_row; /* fold in the vertical offset once */ - - for (bi = 0; bi < num_blocks; bi++, start_col += DCTSIZE) { - /* Load data into workspace, applying unsigned->signed conversion */ - { register FAST_FLOAT *workspaceptr; - register JSAMPROW elemptr; - register int elemr; - - workspaceptr = workspace; - for (elemr = 0; elemr < DCTSIZE; elemr++) { - elemptr = sample_data[elemr] + start_col; -#if DCTSIZE == 8 /* unroll the inner loop */ - *workspaceptr++ = (FAST_FLOAT)(GETJSAMPLE(*elemptr++) - CENTERJSAMPLE); - *workspaceptr++ = (FAST_FLOAT)(GETJSAMPLE(*elemptr++) - CENTERJSAMPLE); - *workspaceptr++ = (FAST_FLOAT)(GETJSAMPLE(*elemptr++) - CENTERJSAMPLE); - *workspaceptr++ = (FAST_FLOAT)(GETJSAMPLE(*elemptr++) - CENTERJSAMPLE); - *workspaceptr++ = (FAST_FLOAT)(GETJSAMPLE(*elemptr++) - CENTERJSAMPLE); - *workspaceptr++ = (FAST_FLOAT)(GETJSAMPLE(*elemptr++) - CENTERJSAMPLE); - *workspaceptr++ = (FAST_FLOAT)(GETJSAMPLE(*elemptr++) - CENTERJSAMPLE); - *workspaceptr++ = (FAST_FLOAT)(GETJSAMPLE(*elemptr++) - CENTERJSAMPLE); -#else - { register int elemc; - for (elemc = DCTSIZE; elemc > 0; elemc--) { - *workspaceptr++ = (FAST_FLOAT) - (GETJSAMPLE(*elemptr++) - CENTERJSAMPLE); - } - } -#endif - } - } - - /* Perform the DCT */ - (*do_dct) (workspace); - - /* Quantize/descale the coefficients, and store into coef_blocks[] */ - { register FAST_FLOAT temp; - register int i; - register JCOEFPTR output_ptr = coef_blocks[bi]; - - for (i = 0; i < DCTSIZE2; i++) { - /* Apply the quantization and scaling factor */ - temp = workspace[i] * divisors[i]; - /* Round to nearest integer. - * Since C does not specify the direction of rounding for negative - * quotients, we have to force the dividend positive for portability. - * The maximum coefficient size is +-16K (for 12-bit data), so this - * code should work for either 16-bit or 32-bit ints. - */ - output_ptr[i] = (JCOEF) ((int) (temp + (FAST_FLOAT) 16384.5) - 16384); - } - } - } -} - -#endif /* DCT_FLOAT_SUPPORTED */ - - -/* - * Initialize FDCT manager. - */ - -GLOBAL(void) -jinit_forward_dct (j_compress_ptr cinfo) -{ - my_fdct_ptr fdct; - int i; - - fdct = (my_fdct_ptr) - (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, - SIZEOF(my_fdct_controller)); - cinfo->fdct = (struct jpeg_forward_dct *) fdct; - fdct->pub.start_pass = start_pass_fdctmgr; - - switch (cinfo->dct_method) { -#ifdef DCT_ISLOW_SUPPORTED - case JDCT_ISLOW: - fdct->pub.forward_DCT = forward_DCT; - fdct->do_dct = jpeg_fdct_islow; - break; -#endif -#ifdef DCT_IFAST_SUPPORTED - case JDCT_IFAST: - fdct->pub.forward_DCT = forward_DCT; - fdct->do_dct = jpeg_fdct_ifast; - break; -#endif -#ifdef DCT_FLOAT_SUPPORTED - case JDCT_FLOAT: - fdct->pub.forward_DCT = forward_DCT_float; - fdct->do_float_dct = jpeg_fdct_float; - break; -#endif - default: - ERREXIT(cinfo, JERR_NOT_COMPILED); - break; - } - - /* Mark divisor tables unallocated */ - for (i = 0; i < NUM_QUANT_TBLS; i++) { - fdct->divisors[i] = NULL; -#ifdef DCT_FLOAT_SUPPORTED - fdct->float_divisors[i] = NULL; -#endif - } -} diff --git a/wxWidgets/src/jpeg/jchuff.c b/wxWidgets/src/jpeg/jchuff.c deleted file mode 100644 index 45b3d2b6fb..0000000000 --- a/wxWidgets/src/jpeg/jchuff.c +++ /dev/null @@ -1,909 +0,0 @@ -/* - * jchuff.c - * - * Copyright (C) 1991-1997, Thomas G. Lane. - * This file is part of the Independent JPEG Group's software. - * For conditions of distribution and use, see the accompanying README file. - * - * This file contains Huffman entropy encoding routines. - * - * Much of the complexity here has to do with supporting output suspension. - * If the data destination module demands suspension, we want to be able to - * back up to the start of the current MCU. To do this, we copy state - * variables into local working storage, and update them back to the - * permanent JPEG objects only upon successful completion of an MCU. - */ - -#define JPEG_INTERNALS -#include "jinclude.h" -#include "jpeglib.h" -#include "jchuff.h" /* Declarations shared with jcphuff.c */ - - -/* Expanded entropy encoder object for Huffman encoding. - * - * The savable_state subrecord contains fields that change within an MCU, - * but must not be updated permanently until we complete the MCU. - */ - -typedef struct { - JPEG_INT32 put_buffer; /* current bit-accumulation buffer */ - int put_bits; /* # of bits now in it */ - int last_dc_val[MAX_COMPS_IN_SCAN]; /* last DC coef for each component */ -} savable_state; - -/* This macro is to work around compilers with missing or broken - * structure assignment. You'll need to fix this code if you have - * such a compiler and you change MAX_COMPS_IN_SCAN. - */ - -#ifndef NO_STRUCT_ASSIGN -#define ASSIGN_STATE(dest,src) ((dest) = (src)) -#else -#if MAX_COMPS_IN_SCAN == 4 -#define ASSIGN_STATE(dest,src) \ - ((dest).put_buffer = (src).put_buffer, \ - (dest).put_bits = (src).put_bits, \ - (dest).last_dc_val[0] = (src).last_dc_val[0], \ - (dest).last_dc_val[1] = (src).last_dc_val[1], \ - (dest).last_dc_val[2] = (src).last_dc_val[2], \ - (dest).last_dc_val[3] = (src).last_dc_val[3]) -#endif -#endif - - -typedef struct { - struct jpeg_entropy_encoder pub; /* public fields */ - - savable_state saved; /* Bit buffer & DC state at start of MCU */ - - /* These fields are NOT loaded into local working state. */ - unsigned int restarts_to_go; /* MCUs left in this restart interval */ - int next_restart_num; /* next restart number to write (0-7) */ - - /* Pointers to derived tables (these workspaces have image lifespan) */ - c_derived_tbl * dc_derived_tbls[NUM_HUFF_TBLS]; - c_derived_tbl * ac_derived_tbls[NUM_HUFF_TBLS]; - -#ifdef ENTROPY_OPT_SUPPORTED /* Statistics tables for optimization */ - long * dc_count_ptrs[NUM_HUFF_TBLS]; - long * ac_count_ptrs[NUM_HUFF_TBLS]; -#endif -} huff_entropy_encoder; - -typedef huff_entropy_encoder * huff_entropy_ptr; - -/* Working state while writing an MCU. - * This struct contains all the fields that are needed by subroutines. - */ - -typedef struct { - JOCTET * next_output_byte; /* => next byte to write in buffer */ - size_t free_in_buffer; /* # of byte spaces remaining in buffer */ - savable_state cur; /* Current bit buffer & DC state */ - j_compress_ptr cinfo; /* dump_buffer needs access to this */ -} working_state; - - -/* Forward declarations */ -METHODDEF(wxjpeg_boolean) encode_mcu_huff JPP((j_compress_ptr cinfo, - JBLOCKROW *MCU_data)); -METHODDEF(void) finish_pass_huff JPP((j_compress_ptr cinfo)); -#ifdef ENTROPY_OPT_SUPPORTED -METHODDEF(wxjpeg_boolean) encode_mcu_gather JPP((j_compress_ptr cinfo, - JBLOCKROW *MCU_data)); -METHODDEF(void) finish_pass_gather JPP((j_compress_ptr cinfo)); -#endif - - -/* - * Initialize for a Huffman-compressed scan. - * If gather_statistics is TRUE, we do not output anything during the scan, - * just count the Huffman symbols used and generate Huffman code tables. - */ - -METHODDEF(void) -start_pass_huff (j_compress_ptr cinfo, wxjpeg_boolean gather_statistics) -{ - huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy; - int ci, dctbl, actbl; - jpeg_component_info * compptr; - - if (gather_statistics) { -#ifdef ENTROPY_OPT_SUPPORTED - entropy->pub.encode_mcu = encode_mcu_gather; - entropy->pub.finish_pass = finish_pass_gather; -#else - ERREXIT(cinfo, JERR_NOT_COMPILED); -#endif - } else { - entropy->pub.encode_mcu = encode_mcu_huff; - entropy->pub.finish_pass = finish_pass_huff; - } - - for (ci = 0; ci < cinfo->comps_in_scan; ci++) { - compptr = cinfo->cur_comp_info[ci]; - dctbl = compptr->dc_tbl_no; - actbl = compptr->ac_tbl_no; - if (gather_statistics) { -#ifdef ENTROPY_OPT_SUPPORTED - /* Check for invalid table indexes */ - /* (make_c_derived_tbl does this in the other path) */ - if (dctbl < 0 || dctbl >= NUM_HUFF_TBLS) - ERREXIT1(cinfo, JERR_NO_HUFF_TABLE, dctbl); - if (actbl < 0 || actbl >= NUM_HUFF_TBLS) - ERREXIT1(cinfo, JERR_NO_HUFF_TABLE, actbl); - /* Allocate and zero the statistics tables */ - /* Note that jpeg_gen_optimal_table expects 257 entries in each table! */ - if (entropy->dc_count_ptrs[dctbl] == NULL) - entropy->dc_count_ptrs[dctbl] = (long *) - (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, - 257 * SIZEOF(long)); - MEMZERO(entropy->dc_count_ptrs[dctbl], 257 * SIZEOF(long)); - if (entropy->ac_count_ptrs[actbl] == NULL) - entropy->ac_count_ptrs[actbl] = (long *) - (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, - 257 * SIZEOF(long)); - MEMZERO(entropy->ac_count_ptrs[actbl], 257 * SIZEOF(long)); -#endif - } else { - /* Compute derived values for Huffman tables */ - /* We may do this more than once for a table, but it's not expensive */ - jpeg_make_c_derived_tbl(cinfo, TRUE, dctbl, - & entropy->dc_derived_tbls[dctbl]); - jpeg_make_c_derived_tbl(cinfo, FALSE, actbl, - & entropy->ac_derived_tbls[actbl]); - } - /* Initialize DC predictions to 0 */ - entropy->saved.last_dc_val[ci] = 0; - } - - /* Initialize bit buffer to empty */ - entropy->saved.put_buffer = 0; - entropy->saved.put_bits = 0; - - /* Initialize restart stuff */ - entropy->restarts_to_go = cinfo->restart_interval; - entropy->next_restart_num = 0; -} - - -/* - * Compute the derived values for a Huffman table. - * This routine also performs some validation checks on the table. - * - * Note this is also used by jcphuff.c. - */ - -GLOBAL(void) -jpeg_make_c_derived_tbl (j_compress_ptr cinfo, wxjpeg_boolean isDC, int tblno, - c_derived_tbl ** pdtbl) -{ - JHUFF_TBL *htbl; - c_derived_tbl *dtbl; - int p, i, l, lastp, si, maxsymbol; - char huffsize[257]; - unsigned int huffcode[257]; - unsigned int code; - - /* Note that huffsize[] and huffcode[] are filled in code-length order, - * paralleling the order of the symbols themselves in htbl->huffval[]. - */ - - /* Find the input Huffman table */ - if (tblno < 0 || tblno >= NUM_HUFF_TBLS) - ERREXIT1(cinfo, JERR_NO_HUFF_TABLE, tblno); - htbl = - isDC ? cinfo->dc_huff_tbl_ptrs[tblno] : cinfo->ac_huff_tbl_ptrs[tblno]; - if (htbl == NULL) - ERREXIT1(cinfo, JERR_NO_HUFF_TABLE, tblno); - - /* Allocate a workspace if we haven't already done so. */ - if (*pdtbl == NULL) - *pdtbl = (c_derived_tbl *) - (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, - SIZEOF(c_derived_tbl)); - dtbl = *pdtbl; - - /* Figure C.1: make table of Huffman code length for each symbol */ - - p = 0; - for (l = 1; l <= 16; l++) { - i = (int) htbl->bits[l]; - if (i < 0 || p + i > 256) /* protect against table overrun */ - ERREXIT(cinfo, JERR_BAD_HUFF_TABLE); - while (i--) - huffsize[p++] = (char) l; - } - huffsize[p] = 0; - lastp = p; - - /* Figure C.2: generate the codes themselves */ - /* We also validate that the counts represent a legal Huffman code tree. */ - - code = 0; - si = huffsize[0]; - p = 0; - while (huffsize[p]) { - while (((int) huffsize[p]) == si) { - huffcode[p++] = code; - code++; - } - /* code is now 1 more than the last code used for codelength si; but - * it must still fit in si bits, since no code is allowed to be all ones. - */ - if (((JPEG_INT32) code) >= (((JPEG_INT32) 1) << si)) - ERREXIT(cinfo, JERR_BAD_HUFF_TABLE); - code <<= 1; - si++; - } - - /* Figure C.3: generate encoding tables */ - /* These are code and size indexed by symbol value */ - - /* Set all codeless symbols to have code length 0; - * this lets us detect duplicate VAL entries here, and later - * allows emit_bits to detect any attempt to emit such symbols. - */ - MEMZERO(dtbl->ehufsi, SIZEOF(dtbl->ehufsi)); - - /* This is also a convenient place to check for out-of-range - * and duplicated VAL entries. We allow 0..255 for AC symbols - * but only 0..15 for DC. (We could constrain them further - * based on data depth and mode, but this seems enough.) - */ - maxsymbol = isDC ? 15 : 255; - - for (p = 0; p < lastp; p++) { - i = htbl->huffval[p]; - if (i < 0 || i > maxsymbol || dtbl->ehufsi[i]) - ERREXIT(cinfo, JERR_BAD_HUFF_TABLE); - dtbl->ehufco[i] = huffcode[p]; - dtbl->ehufsi[i] = huffsize[p]; - } -} - - -/* Outputting bytes to the file */ - -/* Emit a byte, taking 'action' if must suspend. */ -#define emit_byte(state,val,action) \ - { *(state)->next_output_byte++ = (JOCTET) (val); \ - if (--(state)->free_in_buffer == 0) \ - if (! dump_buffer(state)) \ - { action; } } - - -LOCAL(wxjpeg_boolean) -dump_buffer (working_state * state) -/* Empty the output buffer; return TRUE if successful, FALSE if must suspend */ -{ - struct jpeg_destination_mgr * dest = state->cinfo->dest; - - if (! (*dest->empty_output_buffer) (state->cinfo)) - return FALSE; - /* After a successful buffer dump, must reset buffer pointers */ - state->next_output_byte = dest->next_output_byte; - state->free_in_buffer = dest->free_in_buffer; - return TRUE; -} - - -/* Outputting bits to the file */ - -/* Only the right 24 bits of put_buffer are used; the valid bits are - * left-justified in this part. At most 16 bits can be passed to emit_bits - * in one call, and we never retain more than 7 bits in put_buffer - * between calls, so 24 bits are sufficient. - */ - -INLINE -LOCAL(wxjpeg_boolean) -emit_bits (working_state * state, unsigned int code, int size) -/* Emit some bits; return TRUE if successful, FALSE if must suspend */ -{ - /* This routine is heavily used, so it's worth coding tightly. */ - register JPEG_INT32 put_buffer = (JPEG_INT32) code; - register int put_bits = state->cur.put_bits; - - /* if size is 0, caller used an invalid Huffman table entry */ - if (size == 0) - ERREXIT(state->cinfo, JERR_HUFF_MISSING_CODE); - - put_buffer &= (((JPEG_INT32) 1)<cur.put_buffer; /* and merge with old buffer contents */ - - while (put_bits >= 8) { - int c = (int) ((put_buffer >> 16) & 0xFF); - - emit_byte(state, c, return FALSE); - if (c == 0xFF) { /* need to stuff a zero byte? */ - emit_byte(state, 0, return FALSE); - } - put_buffer <<= 8; - put_bits -= 8; - } - - state->cur.put_buffer = put_buffer; /* update state variables */ - state->cur.put_bits = put_bits; - - return TRUE; -} - - -LOCAL(wxjpeg_boolean) -flush_bits (working_state * state) -{ - if (! emit_bits(state, 0x7F, 7)) /* fill any partial byte with ones */ - return FALSE; - state->cur.put_buffer = 0; /* and reset bit-buffer to empty */ - state->cur.put_bits = 0; - return TRUE; -} - - -/* Encode a single block's worth of coefficients */ - -LOCAL(wxjpeg_boolean) -encode_one_block (working_state * state, JCOEFPTR block, int last_dc_val, - c_derived_tbl *dctbl, c_derived_tbl *actbl) -{ - register int temp, temp2; - register int nbits; - register int k, r, i; - - /* Encode the DC coefficient difference per section F.1.2.1 */ - - temp = temp2 = block[0] - last_dc_val; - - if (temp < 0) { - temp = -temp; /* temp is abs value of input */ - /* For a negative input, want temp2 = bitwise complement of abs(input) */ - /* This code assumes we are on a two's complement machine */ - temp2--; - } - - /* Find the number of bits needed for the magnitude of the coefficient */ - nbits = 0; - while (temp) { - nbits++; - temp >>= 1; - } - /* Check for out-of-range coefficient values. - * Since we're encoding a difference, the range limit is twice as much. - */ - if (nbits > MAX_COEF_BITS+1) - ERREXIT(state->cinfo, JERR_BAD_DCT_COEF); - - /* Emit the Huffman-coded symbol for the number of bits */ - if (! emit_bits(state, dctbl->ehufco[nbits], dctbl->ehufsi[nbits])) - return FALSE; - - /* Emit that number of bits of the value, if positive, */ - /* or the complement of its magnitude, if negative. */ - if (nbits) /* emit_bits rejects calls with size 0 */ - if (! emit_bits(state, (unsigned int) temp2, nbits)) - return FALSE; - - /* Encode the AC coefficients per section F.1.2.2 */ - - r = 0; /* r = run length of zeros */ - - for (k = 1; k < DCTSIZE2; k++) { - if ((temp = block[jpeg_natural_order[k]]) == 0) { - r++; - } else { - /* if run length > 15, must emit special run-length-16 codes (0xF0) */ - while (r > 15) { - if (! emit_bits(state, actbl->ehufco[0xF0], actbl->ehufsi[0xF0])) - return FALSE; - r -= 16; - } - - temp2 = temp; - if (temp < 0) { - temp = -temp; /* temp is abs value of input */ - /* This code assumes we are on a two's complement machine */ - temp2--; - } - - /* Find the number of bits needed for the magnitude of the coefficient */ - nbits = 1; /* there must be at least one 1 bit */ - while ((temp >>= 1)) - nbits++; - /* Check for out-of-range coefficient values */ - if (nbits > MAX_COEF_BITS) - ERREXIT(state->cinfo, JERR_BAD_DCT_COEF); - - /* Emit Huffman symbol for run length / number of bits */ - i = (r << 4) + nbits; - if (! emit_bits(state, actbl->ehufco[i], actbl->ehufsi[i])) - return FALSE; - - /* Emit that number of bits of the value, if positive, */ - /* or the complement of its magnitude, if negative. */ - if (! emit_bits(state, (unsigned int) temp2, nbits)) - return FALSE; - - r = 0; - } - } - - /* If the last coef(s) were zero, emit an end-of-block code */ - if (r > 0) - if (! emit_bits(state, actbl->ehufco[0], actbl->ehufsi[0])) - return FALSE; - - return TRUE; -} - - -/* - * Emit a restart marker & resynchronize predictions. - */ - -LOCAL(wxjpeg_boolean) -emit_restart (working_state * state, int restart_num) -{ - int ci; - - if (! flush_bits(state)) - return FALSE; - - emit_byte(state, 0xFF, return FALSE); - emit_byte(state, JPEG_RST0 + restart_num, return FALSE); - - /* Re-initialize DC predictions to 0 */ - for (ci = 0; ci < state->cinfo->comps_in_scan; ci++) - state->cur.last_dc_val[ci] = 0; - - /* The restart counter is not updated until we successfully write the MCU. */ - - return TRUE; -} - - -/* - * Encode and output one MCU's worth of Huffman-compressed coefficients. - */ - -METHODDEF(wxjpeg_boolean) -encode_mcu_huff (j_compress_ptr cinfo, JBLOCKROW *MCU_data) -{ - huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy; - working_state state; - int blkn, ci; - jpeg_component_info * compptr; - - /* Load up working state */ - state.next_output_byte = cinfo->dest->next_output_byte; - state.free_in_buffer = cinfo->dest->free_in_buffer; - ASSIGN_STATE(state.cur, entropy->saved); - state.cinfo = cinfo; - - /* Emit restart marker if needed */ - if (cinfo->restart_interval) { - if (entropy->restarts_to_go == 0) - if (! emit_restart(&state, entropy->next_restart_num)) - return FALSE; - } - - /* Encode the MCU data blocks */ - for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) { - ci = cinfo->MCU_membership[blkn]; - compptr = cinfo->cur_comp_info[ci]; - if (! encode_one_block(&state, - MCU_data[blkn][0], state.cur.last_dc_val[ci], - entropy->dc_derived_tbls[compptr->dc_tbl_no], - entropy->ac_derived_tbls[compptr->ac_tbl_no])) - return FALSE; - /* Update last_dc_val */ - state.cur.last_dc_val[ci] = MCU_data[blkn][0][0]; - } - - /* Completed MCU, so update state */ - cinfo->dest->next_output_byte = state.next_output_byte; - cinfo->dest->free_in_buffer = state.free_in_buffer; - ASSIGN_STATE(entropy->saved, state.cur); - - /* Update restart-interval state too */ - if (cinfo->restart_interval) { - if (entropy->restarts_to_go == 0) { - entropy->restarts_to_go = cinfo->restart_interval; - entropy->next_restart_num++; - entropy->next_restart_num &= 7; - } - entropy->restarts_to_go--; - } - - return TRUE; -} - - -/* - * Finish up at the end of a Huffman-compressed scan. - */ - -METHODDEF(void) -finish_pass_huff (j_compress_ptr cinfo) -{ - huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy; - working_state state; - - /* Load up working state ... flush_bits needs it */ - state.next_output_byte = cinfo->dest->next_output_byte; - state.free_in_buffer = cinfo->dest->free_in_buffer; - ASSIGN_STATE(state.cur, entropy->saved); - state.cinfo = cinfo; - - /* Flush out the last data */ - if (! flush_bits(&state)) - ERREXIT(cinfo, JERR_CANT_SUSPEND); - - /* Update state */ - cinfo->dest->next_output_byte = state.next_output_byte; - cinfo->dest->free_in_buffer = state.free_in_buffer; - ASSIGN_STATE(entropy->saved, state.cur); -} - - -/* - * Huffman coding optimization. - * - * We first scan the supplied data and count the number of uses of each symbol - * that is to be Huffman-coded. (This process MUST agree with the code above.) - * Then we build a Huffman coding tree for the observed counts. - * Symbols which are not needed at all for the particular image are not - * assigned any code, which saves space in the DHT marker as well as in - * the compressed data. - */ - -#ifdef ENTROPY_OPT_SUPPORTED - - -/* Process a single block's worth of coefficients */ - -LOCAL(void) -htest_one_block (j_compress_ptr cinfo, JCOEFPTR block, int last_dc_val, - long dc_counts[], long ac_counts[]) -{ - register int temp; - register int nbits; - register int k, r; - - /* Encode the DC coefficient difference per section F.1.2.1 */ - - temp = block[0] - last_dc_val; - if (temp < 0) - temp = -temp; - - /* Find the number of bits needed for the magnitude of the coefficient */ - nbits = 0; - while (temp) { - nbits++; - temp >>= 1; - } - /* Check for out-of-range coefficient values. - * Since we're encoding a difference, the range limit is twice as much. - */ - if (nbits > MAX_COEF_BITS+1) - ERREXIT(cinfo, JERR_BAD_DCT_COEF); - - /* Count the Huffman symbol for the number of bits */ - dc_counts[nbits]++; - - /* Encode the AC coefficients per section F.1.2.2 */ - - r = 0; /* r = run length of zeros */ - - for (k = 1; k < DCTSIZE2; k++) { - if ((temp = block[jpeg_natural_order[k]]) == 0) { - r++; - } else { - /* if run length > 15, must emit special run-length-16 codes (0xF0) */ - while (r > 15) { - ac_counts[0xF0]++; - r -= 16; - } - - /* Find the number of bits needed for the magnitude of the coefficient */ - if (temp < 0) - temp = -temp; - - /* Find the number of bits needed for the magnitude of the coefficient */ - nbits = 1; /* there must be at least one 1 bit */ - while ((temp >>= 1)) - nbits++; - /* Check for out-of-range coefficient values */ - if (nbits > MAX_COEF_BITS) - ERREXIT(cinfo, JERR_BAD_DCT_COEF); - - /* Count Huffman symbol for run length / number of bits */ - ac_counts[(r << 4) + nbits]++; - - r = 0; - } - } - - /* If the last coef(s) were zero, emit an end-of-block code */ - if (r > 0) - ac_counts[0]++; -} - - -/* - * Trial-encode one MCU's worth of Huffman-compressed coefficients. - * No data is actually output, so no suspension return is possible. - */ - -METHODDEF(wxjpeg_boolean) -encode_mcu_gather (j_compress_ptr cinfo, JBLOCKROW *MCU_data) -{ - huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy; - int blkn, ci; - jpeg_component_info * compptr; - - /* Take care of restart intervals if needed */ - if (cinfo->restart_interval) { - if (entropy->restarts_to_go == 0) { - /* Re-initialize DC predictions to 0 */ - for (ci = 0; ci < cinfo->comps_in_scan; ci++) - entropy->saved.last_dc_val[ci] = 0; - /* Update restart state */ - entropy->restarts_to_go = cinfo->restart_interval; - } - entropy->restarts_to_go--; - } - - for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) { - ci = cinfo->MCU_membership[blkn]; - compptr = cinfo->cur_comp_info[ci]; - htest_one_block(cinfo, MCU_data[blkn][0], entropy->saved.last_dc_val[ci], - entropy->dc_count_ptrs[compptr->dc_tbl_no], - entropy->ac_count_ptrs[compptr->ac_tbl_no]); - entropy->saved.last_dc_val[ci] = MCU_data[blkn][0][0]; - } - - return TRUE; -} - - -/* - * Generate the best Huffman code table for the given counts, fill htbl. - * Note this is also used by jcphuff.c. - * - * The JPEG standard requires that no symbol be assigned a codeword of all - * one bits (so that padding bits added at the end of a compressed segment - * can't look like a valid code). Because of the canonical ordering of - * codewords, this just means that there must be an unused slot in the - * longest codeword length category. Section K.2 of the JPEG spec suggests - * reserving such a slot by pretending that symbol 256 is a valid symbol - * with count 1. In theory that's not optimal; giving it count zero but - * including it in the symbol set anyway should give a better Huffman code. - * But the theoretically better code actually seems to come out worse in - * practice, because it produces more all-ones bytes (which incur stuffed - * zero bytes in the final file). In any case the difference is tiny. - * - * The JPEG standard requires Huffman codes to be no more than 16 bits long. - * If some symbols have a very small but nonzero probability, the Huffman tree - * must be adjusted to meet the code length restriction. We currently use - * the adjustment method suggested in JPEG section K.2. This method is *not* - * optimal; it may not choose the best possible limited-length code. But - * typically only very-low-frequency symbols will be given less-than-optimal - * lengths, so the code is almost optimal. Experimental comparisons against - * an optimal limited-length-code algorithm indicate that the difference is - * microscopic --- usually less than a hundredth of a percent of total size. - * So the extra complexity of an optimal algorithm doesn't seem worthwhile. - */ - -GLOBAL(void) -jpeg_gen_optimal_table (j_compress_ptr cinfo, JHUFF_TBL * htbl, long freq[]) -{ -#define MAX_CLEN 32 /* assumed maximum initial code length */ - UINT8 bits[MAX_CLEN+1]; /* bits[k] = # of symbols with code length k */ - int codesize[257]; /* codesize[k] = code length of symbol k */ - int others[257]; /* next symbol in current branch of tree */ - int c1, c2; - int p, i, j; - long v; - - /* This algorithm is explained in section K.2 of the JPEG standard */ - - MEMZERO(bits, SIZEOF(bits)); - MEMZERO(codesize, SIZEOF(codesize)); - for (i = 0; i < 257; i++) - others[i] = -1; /* init links to empty */ - - freq[256] = 1; /* make sure 256 has a nonzero count */ - /* Including the pseudo-symbol 256 in the Huffman procedure guarantees - * that no real symbol is given code-value of all ones, because 256 - * will be placed last in the largest codeword category. - */ - - /* Huffman's basic algorithm to assign optimal code lengths to symbols */ - - for (;;) { - /* Find the smallest nonzero frequency, set c1 = its symbol */ - /* In case of ties, take the larger symbol number */ - c1 = -1; - v = 1000000000L; - for (i = 0; i <= 256; i++) { - if (freq[i] && freq[i] <= v) { - v = freq[i]; - c1 = i; - } - } - - /* Find the next smallest nonzero frequency, set c2 = its symbol */ - /* In case of ties, take the larger symbol number */ - c2 = -1; - v = 1000000000L; - for (i = 0; i <= 256; i++) { - if (freq[i] && freq[i] <= v && i != c1) { - v = freq[i]; - c2 = i; - } - } - - /* Done if we've merged everything into one frequency */ - if (c2 < 0) - break; - - /* Else merge the two counts/trees */ - freq[c1] += freq[c2]; - freq[c2] = 0; - - /* Increment the codesize of everything in c1's tree branch */ - codesize[c1]++; - while (others[c1] >= 0) { - c1 = others[c1]; - codesize[c1]++; - } - - others[c1] = c2; /* chain c2 onto c1's tree branch */ - - /* Increment the codesize of everything in c2's tree branch */ - codesize[c2]++; - while (others[c2] >= 0) { - c2 = others[c2]; - codesize[c2]++; - } - } - - /* Now count the number of symbols of each code length */ - for (i = 0; i <= 256; i++) { - if (codesize[i]) { - /* The JPEG standard seems to think that this can't happen, */ - /* but I'm paranoid... */ - if (codesize[i] > MAX_CLEN) - ERREXIT(cinfo, JERR_HUFF_CLEN_OVERFLOW); - - bits[codesize[i]]++; - } - } - - /* JPEG doesn't allow symbols with code lengths over 16 bits, so if the pure - * Huffman procedure assigned any such lengths, we must adjust the coding. - * Here is what the JPEG spec says about how this next bit works: - * Since symbols are paired for the longest Huffman code, the symbols are - * removed from this length category two at a time. The prefix for the pair - * (which is one bit shorter) is allocated to one of the pair; then, - * skipping the BITS entry for that prefix length, a code word from the next - * shortest nonzero BITS entry is converted into a prefix for two code words - * one bit longer. - */ - - for (i = MAX_CLEN; i > 16; i--) { - while (bits[i] > 0) { - j = i - 2; /* find length of new prefix to be used */ - while (bits[j] == 0) - j--; - - bits[i] -= 2; /* remove two symbols */ - bits[i-1]++; /* one goes in this length */ - bits[j+1] += 2; /* two new symbols in this length */ - bits[j]--; /* symbol of this length is now a prefix */ - } - } - - /* Remove the count for the pseudo-symbol 256 from the largest codelength */ - while (bits[i] == 0) /* find largest codelength still in use */ - i--; - bits[i]--; - - /* Return final symbol counts (only for lengths 0..16) */ - MEMCOPY(htbl->bits, bits, SIZEOF(htbl->bits)); - - /* Return a list of the symbols sorted by code length */ - /* It's not real clear to me why we don't need to consider the codelength - * changes made above, but the JPEG spec seems to think this works. - */ - p = 0; - for (i = 1; i <= MAX_CLEN; i++) { - for (j = 0; j <= 255; j++) { - if (codesize[j] == i) { - htbl->huffval[p] = (UINT8) j; - p++; - } - } - } - - /* Set sent_table FALSE so updated table will be written to JPEG file. */ - htbl->sent_table = FALSE; -} - - -/* - * Finish up a statistics-gathering pass and create the new Huffman tables. - */ - -METHODDEF(void) -finish_pass_gather (j_compress_ptr cinfo) -{ - huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy; - int ci, dctbl, actbl; - jpeg_component_info * compptr; - JHUFF_TBL **htblptr; - wxjpeg_boolean did_dc[NUM_HUFF_TBLS]; - wxjpeg_boolean did_ac[NUM_HUFF_TBLS]; - - /* It's important not to apply jpeg_gen_optimal_table more than once - * per table, because it clobbers the input frequency counts! - */ - MEMZERO(did_dc, SIZEOF(did_dc)); - MEMZERO(did_ac, SIZEOF(did_ac)); - - for (ci = 0; ci < cinfo->comps_in_scan; ci++) { - compptr = cinfo->cur_comp_info[ci]; - dctbl = compptr->dc_tbl_no; - actbl = compptr->ac_tbl_no; - if (! did_dc[dctbl]) { - htblptr = & cinfo->dc_huff_tbl_ptrs[dctbl]; - if (*htblptr == NULL) - *htblptr = jpeg_alloc_huff_table((j_common_ptr) cinfo); - jpeg_gen_optimal_table(cinfo, *htblptr, entropy->dc_count_ptrs[dctbl]); - did_dc[dctbl] = TRUE; - } - if (! did_ac[actbl]) { - htblptr = & cinfo->ac_huff_tbl_ptrs[actbl]; - if (*htblptr == NULL) - *htblptr = jpeg_alloc_huff_table((j_common_ptr) cinfo); - jpeg_gen_optimal_table(cinfo, *htblptr, entropy->ac_count_ptrs[actbl]); - did_ac[actbl] = TRUE; - } - } -} - - -#endif /* ENTROPY_OPT_SUPPORTED */ - - -/* - * Module initialization routine for Huffman entropy encoding. - */ - -GLOBAL(void) -jinit_huff_encoder (j_compress_ptr cinfo) -{ - huff_entropy_ptr entropy; - int i; - - entropy = (huff_entropy_ptr) - (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, - SIZEOF(huff_entropy_encoder)); - cinfo->entropy = (struct jpeg_entropy_encoder *) entropy; - entropy->pub.start_pass = start_pass_huff; - - /* Mark tables unallocated */ - for (i = 0; i < NUM_HUFF_TBLS; i++) { - entropy->dc_derived_tbls[i] = entropy->ac_derived_tbls[i] = NULL; -#ifdef ENTROPY_OPT_SUPPORTED - entropy->dc_count_ptrs[i] = entropy->ac_count_ptrs[i] = NULL; -#endif - } -} diff --git a/wxWidgets/src/jpeg/jchuff.h b/wxWidgets/src/jpeg/jchuff.h deleted file mode 100644 index 881962ad52..0000000000 --- a/wxWidgets/src/jpeg/jchuff.h +++ /dev/null @@ -1,47 +0,0 @@ -/* - * jchuff.h - * - * Copyright (C) 1991-1997, Thomas G. Lane. - * This file is part of the Independent JPEG Group's software. - * For conditions of distribution and use, see the accompanying README file. - * - * This file contains declarations for Huffman entropy encoding routines - * that are shared between the sequential encoder (jchuff.c) and the - * progressive encoder (jcphuff.c). No other modules need to see these. - */ - -/* The legal range of a DCT coefficient is - * -1024 .. +1023 for 8-bit data; - * -16384 .. +16383 for 12-bit data. - * Hence the magnitude should always fit in 10 or 14 bits respectively. - */ - -#if BITS_IN_JSAMPLE == 8 -#define MAX_COEF_BITS 10 -#else -#define MAX_COEF_BITS 14 -#endif - -/* Derived data constructed for each Huffman table */ - -typedef struct { - unsigned int ehufco[256]; /* code for each symbol */ - char ehufsi[256]; /* length of code for each symbol */ - /* If no code has been allocated for a symbol S, ehufsi[S] contains 0 */ -} c_derived_tbl; - -/* Short forms of external names for systems with brain-damaged linkers. */ - -#ifdef NEED_SHORT_EXTERNAL_NAMES -#define jpeg_make_c_derived_tbl jMkCDerived -#define jpeg_gen_optimal_table jGenOptTbl -#endif /* NEED_SHORT_EXTERNAL_NAMES */ - -/* Expand a Huffman table definition into the derived format */ -EXTERN(void) jpeg_make_c_derived_tbl - JPP((j_compress_ptr cinfo, wxjpeg_boolean isDC, int tblno, - c_derived_tbl ** pdtbl)); - -/* Generate an optimal table definition given the specified counts */ -EXTERN(void) jpeg_gen_optimal_table - JPP((j_compress_ptr cinfo, JHUFF_TBL * htbl, long freq[])); diff --git a/wxWidgets/src/jpeg/jcinit.c b/wxWidgets/src/jpeg/jcinit.c deleted file mode 100644 index b9e68a9adc..0000000000 --- a/wxWidgets/src/jpeg/jcinit.c +++ /dev/null @@ -1,72 +0,0 @@ -/* - * jcinit.c - * - * Copyright (C) 1991-1997, Thomas G. Lane. - * This file is part of the Independent JPEG Group's software. - * For conditions of distribution and use, see the accompanying README file. - * - * This file contains initialization logic for the JPEG compressor. - * This routine is in charge of selecting the modules to be executed and - * making an initialization call to each one. - * - * Logically, this code belongs in jcmaster.c. It's split out because - * linking this routine implies linking the entire compression library. - * For a transcoding-only application, we want to be able to use jcmaster.c - * without linking in the whole library. - */ - -#define JPEG_INTERNALS -#include "jinclude.h" -#include "jpeglib.h" - - -/* - * Master selection of compression modules. - * This is done once at the start of processing an image. We determine - * which modules will be used and give them appropriate initialization calls. - */ - -GLOBAL(void) -jinit_compress_master (j_compress_ptr cinfo) -{ - /* Initialize master control (includes parameter checking/processing) */ - jinit_c_master_control(cinfo, FALSE /* full compression */); - - /* Preprocessing */ - if (! cinfo->raw_data_in) { - jinit_color_converter(cinfo); - jinit_downsampler(cinfo); - jinit_c_prep_controller(cinfo, FALSE /* never need full buffer here */); - } - /* Forward DCT */ - jinit_forward_dct(cinfo); - /* Entropy encoding: either Huffman or arithmetic coding. */ - if (cinfo->arith_code) { - ERREXIT(cinfo, JERR_ARITH_NOTIMPL); - } else { - if (cinfo->progressive_mode) { -#ifdef C_PROGRESSIVE_SUPPORTED - jinit_phuff_encoder(cinfo); -#else - ERREXIT(cinfo, JERR_NOT_COMPILED); -#endif - } else - jinit_huff_encoder(cinfo); - } - - /* Need a full-image coefficient buffer in any multi-pass mode. */ - jinit_c_coef_controller(cinfo, - (wxjpeg_boolean) (cinfo->num_scans > 1 || cinfo->optimize_coding)); - jinit_c_main_controller(cinfo, FALSE /* never need full buffer here */); - - jinit_marker_writer(cinfo); - - /* We can now tell the memory manager to allocate virtual arrays. */ - (*cinfo->mem->realize_virt_arrays) ((j_common_ptr) cinfo); - - /* Write the datastream header (SOI) immediately. - * Frame and scan headers are postponed till later. - * This lets application insert special markers after the SOI. - */ - (*cinfo->marker->write_file_header) (cinfo); -} diff --git a/wxWidgets/src/jpeg/jcmainct.c b/wxWidgets/src/jpeg/jcmainct.c deleted file mode 100644 index 42846cb517..0000000000 --- a/wxWidgets/src/jpeg/jcmainct.c +++ /dev/null @@ -1,293 +0,0 @@ -/* - * jcmainct.c - * - * Copyright (C) 1994-1996, Thomas G. Lane. - * This file is part of the Independent JPEG Group's software. - * For conditions of distribution and use, see the accompanying README file. - * - * This file contains the main buffer controller for compression. - * The main buffer lies between the pre-processor and the JPEG - * compressor proper; it holds downsampled data in the JPEG colorspace. - */ - -#define JPEG_INTERNALS -#include "jinclude.h" -#include "jpeglib.h" - - -/* Note: currently, there is no operating mode in which a full-image buffer - * is needed at this step. If there were, that mode could not be used with - * "raw data" input, since this module is bypassed in that case. However, - * we've left the code here for possible use in special applications. - */ -#undef FULL_MAIN_BUFFER_SUPPORTED - - -/* Private buffer controller object */ - -typedef struct { - struct jpeg_c_main_controller pub; /* public fields */ - - JDIMENSION cur_iMCU_row; /* number of current iMCU row */ - JDIMENSION rowgroup_ctr; /* counts row groups received in iMCU row */ - wxjpeg_boolean suspended; /* remember if we suspended output */ - J_BUF_MODE pass_mode; /* current operating mode */ - - /* If using just a strip buffer, this points to the entire set of buffers - * (we allocate one for each component). In the full-image case, this - * points to the currently accessible strips of the virtual arrays. - */ - JSAMPARRAY buffer[MAX_COMPONENTS]; - -#ifdef FULL_MAIN_BUFFER_SUPPORTED - /* If using full-image storage, this array holds pointers to virtual-array - * control blocks for each component. Unused if not full-image storage. - */ - jvirt_sarray_ptr whole_image[MAX_COMPONENTS]; -#endif -} my_main_controller; - -typedef my_main_controller * my_main_ptr; - - -/* Forward declarations */ -METHODDEF(void) process_data_simple_main - JPP((j_compress_ptr cinfo, JSAMPARRAY input_buf, - JDIMENSION *in_row_ctr, JDIMENSION in_rows_avail)); -#ifdef FULL_MAIN_BUFFER_SUPPORTED -METHODDEF(void) process_data_buffer_main - JPP((j_compress_ptr cinfo, JSAMPARRAY input_buf, - JDIMENSION *in_row_ctr, JDIMENSION in_rows_avail)); -#endif - - -/* - * Initialize for a processing pass. - */ - -METHODDEF(void) -start_pass_main (j_compress_ptr cinfo, J_BUF_MODE pass_mode) -{ - my_main_ptr mymain = (my_main_ptr) cinfo->main; - - /* Do nothing in raw-data mode. */ - if (cinfo->raw_data_in) - return; - - mymain->cur_iMCU_row = 0; /* initialize counters */ - mymain->rowgroup_ctr = 0; - mymain->suspended = FALSE; - mymain->pass_mode = pass_mode; /* save mode for use by process_data */ - - switch (pass_mode) { - case JBUF_PASS_THRU: -#ifdef FULL_MAIN_BUFFER_SUPPORTED - if (mymain->whole_image[0] != NULL) - ERREXIT(cinfo, JERR_BAD_BUFFER_MODE); -#endif - mymain->pub.process_data = process_data_simple_main; - break; -#ifdef FULL_MAIN_BUFFER_SUPPORTED - case JBUF_SAVE_SOURCE: - case JBUF_CRANK_DEST: - case JBUF_SAVE_AND_PASS: - if (mymain->whole_image[0] == NULL) - ERREXIT(cinfo, JERR_BAD_BUFFER_MODE); - mymain->pub.process_data = process_data_buffer_main; - break; -#endif - default: - ERREXIT(cinfo, JERR_BAD_BUFFER_MODE); - break; - } -} - - -/* - * Process some data. - * This routine handles the simple pass-through mode, - * where we have only a strip buffer. - */ - -METHODDEF(void) -process_data_simple_main (j_compress_ptr cinfo, - JSAMPARRAY input_buf, JDIMENSION *in_row_ctr, - JDIMENSION in_rows_avail) -{ - my_main_ptr mymain = (my_main_ptr) cinfo->main; - - while (mymain->cur_iMCU_row < cinfo->total_iMCU_rows) { - /* Read input data if we haven't filled the main buffer yet */ - if (mymain->rowgroup_ctr < DCTSIZE) - (*cinfo->prep->pre_process_data) (cinfo, - input_buf, in_row_ctr, in_rows_avail, - mymain->buffer, &mymain->rowgroup_ctr, - (JDIMENSION) DCTSIZE); - - /* If we don't have a full iMCU row buffered, return to application for - * more data. Note that preprocessor will always pad to fill the iMCU row - * at the bottom of the image. - */ - if (mymain->rowgroup_ctr != DCTSIZE) - return; - - /* Send the completed row to the compressor */ - if (! (*cinfo->coef->compress_data) (cinfo, mymain->buffer)) { - /* If compressor did not consume the whole row, then we must need to - * suspend processing and return to the application. In this situation - * we pretend we didn't yet consume the last input row; otherwise, if - * it happened to be the last row of the image, the application would - * think we were done. - */ - if (! mymain->suspended) { - (*in_row_ctr)--; - mymain->suspended = TRUE; - } - return; - } - /* We did finish the row. Undo our little suspension hack if a previous - * call suspended; then mark the main buffer empty. - */ - if (mymain->suspended) { - (*in_row_ctr)++; - mymain->suspended = FALSE; - } - mymain->rowgroup_ctr = 0; - mymain->cur_iMCU_row++; - } -} - - -#ifdef FULL_MAIN_BUFFER_SUPPORTED - -/* - * Process some data. - * This routine handles all of the modes that use a full-size buffer. - */ - -METHODDEF(void) -process_data_buffer_main (j_compress_ptr cinfo, - JSAMPARRAY input_buf, JDIMENSION *in_row_ctr, - JDIMENSION in_rows_avail) -{ - my_main_ptr mymain = (my_main_ptr) cinfo->main; - int ci; - jpeg_component_info *compptr; - wxjpeg_boolean writing = (mymain->pass_mode != JBUF_CRANK_DEST); - - while (mymain->cur_iMCU_row < cinfo->total_iMCU_rows) { - /* Realign the virtual buffers if at the start of an iMCU row. */ - if (mymain->rowgroup_ctr == 0) { - for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; - ci++, compptr++) { - mymain->buffer[ci] = (*cinfo->mem->access_virt_sarray) - ((j_common_ptr) cinfo, mymain->whole_image[ci], - mymain->cur_iMCU_row * (compptr->v_samp_factor * DCTSIZE), - (JDIMENSION) (compptr->v_samp_factor * DCTSIZE), writing); - } - /* In a read pass, pretend we just read some source data. */ - if (! writing) { - *in_row_ctr += cinfo->max_v_samp_factor * DCTSIZE; - mymain->rowgroup_ctr = DCTSIZE; - } - } - - /* If a write pass, read input data until the current iMCU row is full. */ - /* Note: preprocessor will pad if necessary to fill the last iMCU row. */ - if (writing) { - (*cinfo->prep->pre_process_data) (cinfo, - input_buf, in_row_ctr, in_rows_avail, - mymain->buffer, &mymain->rowgroup_ctr, - (JDIMENSION) DCTSIZE); - /* Return to application if we need more data to fill the iMCU row. */ - if (mymain->rowgroup_ctr < DCTSIZE) - return; - } - - /* Emit data, unless this is a sink-only pass. */ - if (mymain->pass_mode != JBUF_SAVE_SOURCE) { - if (! (*cinfo->coef->compress_data) (cinfo, mymain->buffer)) { - /* If compressor did not consume the whole row, then we must need to - * suspend processing and return to the application. In this situation - * we pretend we didn't yet consume the last input row; otherwise, if - * it happened to be the last row of the image, the application would - * think we were done. - */ - if (! mymain->suspended) { - (*in_row_ctr)--; - mymain->suspended = TRUE; - } - return; - } - /* We did finish the row. Undo our little suspension hack if a previous - * call suspended; then mark the main buffer empty. - */ - if (mymain->suspended) { - (*in_row_ctr)++; - mymain->suspended = FALSE; - } - } - - /* If get here, we are done with this iMCU row. Mark buffer empty. */ - mymain->rowgroup_ctr = 0; - mymain->cur_iMCU_row++; - } -} - -#endif /* FULL_MAIN_BUFFER_SUPPORTED */ - - -/* - * Initialize main buffer controller. - */ - -GLOBAL(void) -jinit_c_main_controller (j_compress_ptr cinfo, wxjpeg_boolean need_full_buffer) -{ - my_main_ptr mymain; - int ci; - jpeg_component_info *compptr; - - mymain = (my_main_ptr) - (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, - SIZEOF(my_main_controller)); - cinfo->main = (struct jpeg_c_main_controller *) mymain; - mymain->pub.start_pass = start_pass_main; - - /* We don't need to create a buffer in raw-data mode. */ - if (cinfo->raw_data_in) - return; - - /* Create the buffer. It holds downsampled data, so each component - * may be of a different size. - */ - if (need_full_buffer) { -#ifdef FULL_MAIN_BUFFER_SUPPORTED - /* Allocate a full-image virtual array for each component */ - /* Note we pad the bottom to a multiple of the iMCU height */ - for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; - ci++, compptr++) { - mymain->whole_image[ci] = (*cinfo->mem->request_virt_sarray) - ((j_common_ptr) cinfo, JPOOL_IMAGE, FALSE, - compptr->width_in_blocks * DCTSIZE, - (JDIMENSION) jround_up((long) compptr->height_in_blocks, - (long) compptr->v_samp_factor) * DCTSIZE, - (JDIMENSION) (compptr->v_samp_factor * DCTSIZE)); - } -#else - ERREXIT(cinfo, JERR_BAD_BUFFER_MODE); -#endif - } else { -#ifdef FULL_MAIN_BUFFER_SUPPORTED - mymain->whole_image[0] = NULL; /* flag for no virtual arrays */ -#endif - /* Allocate a strip buffer for each component */ - for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; - ci++, compptr++) { - mymain->buffer[ci] = (*cinfo->mem->alloc_sarray) - ((j_common_ptr) cinfo, JPOOL_IMAGE, - compptr->width_in_blocks * DCTSIZE, - (JDIMENSION) (compptr->v_samp_factor * DCTSIZE)); - } - } -} diff --git a/wxWidgets/src/jpeg/jcmarker.c b/wxWidgets/src/jpeg/jcmarker.c deleted file mode 100644 index b6d987af88..0000000000 --- a/wxWidgets/src/jpeg/jcmarker.c +++ /dev/null @@ -1,664 +0,0 @@ -/* - * jcmarker.c - * - * Copyright (C) 1991-1998, Thomas G. Lane. - * This file is part of the Independent JPEG Group's software. - * For conditions of distribution and use, see the accompanying README file. - * - * This file contains routines to write JPEG datastream markers. - */ - -#define JPEG_INTERNALS -#include "jinclude.h" -#include "jpeglib.h" - - -typedef enum { /* JPEG marker codes */ - M_SOF0 = 0xc0, - M_SOF1 = 0xc1, - M_SOF2 = 0xc2, - M_SOF3 = 0xc3, - - M_SOF5 = 0xc5, - M_SOF6 = 0xc6, - M_SOF7 = 0xc7, - - M_JPG = 0xc8, - M_SOF9 = 0xc9, - M_SOF10 = 0xca, - M_SOF11 = 0xcb, - - M_SOF13 = 0xcd, - M_SOF14 = 0xce, - M_SOF15 = 0xcf, - - M_DHT = 0xc4, - - M_DAC = 0xcc, - - M_RST0 = 0xd0, - M_RST1 = 0xd1, - M_RST2 = 0xd2, - M_RST3 = 0xd3, - M_RST4 = 0xd4, - M_RST5 = 0xd5, - M_RST6 = 0xd6, - M_RST7 = 0xd7, - - M_SOI = 0xd8, - M_EOI = 0xd9, - M_SOS = 0xda, - M_DQT = 0xdb, - M_DNL = 0xdc, - M_DRI = 0xdd, - M_DHP = 0xde, - M_EXP = 0xdf, - - M_APP0 = 0xe0, - M_APP1 = 0xe1, - M_APP2 = 0xe2, - M_APP3 = 0xe3, - M_APP4 = 0xe4, - M_APP5 = 0xe5, - M_APP6 = 0xe6, - M_APP7 = 0xe7, - M_APP8 = 0xe8, - M_APP9 = 0xe9, - M_APP10 = 0xea, - M_APP11 = 0xeb, - M_APP12 = 0xec, - M_APP13 = 0xed, - M_APP14 = 0xee, - M_APP15 = 0xef, - - M_JPG0 = 0xf0, - M_JPG13 = 0xfd, - M_COM = 0xfe, - - M_TEM = 0x01, - - M_ERROR = 0x100 -} JPEG_MARKER; - - -/* Private state */ - -typedef struct { - struct jpeg_marker_writer pub; /* public fields */ - - unsigned int last_restart_interval; /* last DRI value emitted; 0 after SOI */ -} my_marker_writer; - -typedef my_marker_writer * my_marker_ptr; - - -/* - * Basic output routines. - * - * Note that we do not support suspension while writing a marker. - * Therefore, an application using suspension must ensure that there is - * enough buffer space for the initial markers (typ. 600-700 bytes) before - * calling jpeg_start_compress, and enough space to write the trailing EOI - * (a few bytes) before calling jpeg_finish_compress. Multipass compression - * modes are not supported at all with suspension, so those two are the only - * points where markers will be written. - */ - -LOCAL(void) -emit_byte (j_compress_ptr cinfo, int val) -/* Emit a byte */ -{ - struct jpeg_destination_mgr * dest = cinfo->dest; - - *(dest->next_output_byte)++ = (JOCTET) val; - if (--dest->free_in_buffer == 0) { - if (! (*dest->empty_output_buffer) (cinfo)) - ERREXIT(cinfo, JERR_CANT_SUSPEND); - } -} - - -LOCAL(void) -emit_marker (j_compress_ptr cinfo, JPEG_MARKER mark) -/* Emit a marker code */ -{ - emit_byte(cinfo, 0xFF); - emit_byte(cinfo, (int) mark); -} - - -LOCAL(void) -emit_2bytes (j_compress_ptr cinfo, int value) -/* Emit a 2-byte integer; these are always MSB first in JPEG files */ -{ - emit_byte(cinfo, (value >> 8) & 0xFF); - emit_byte(cinfo, value & 0xFF); -} - - -/* - * Routines to write specific marker types. - */ - -LOCAL(int) -emit_dqt (j_compress_ptr cinfo, int index) -/* Emit a DQT marker */ -/* Returns the precision used (0 = 8bits, 1 = 16bits) for baseline checking */ -{ - JQUANT_TBL * qtbl = cinfo->quant_tbl_ptrs[index]; - int prec; - int i; - - if (qtbl == NULL) - ERREXIT1(cinfo, JERR_NO_QUANT_TABLE, index); - - prec = 0; - for (i = 0; i < DCTSIZE2; i++) { - if (qtbl->quantval[i] > 255) - prec = 1; - } - - if (! qtbl->sent_table) { - emit_marker(cinfo, M_DQT); - - emit_2bytes(cinfo, prec ? DCTSIZE2*2 + 1 + 2 : DCTSIZE2 + 1 + 2); - - emit_byte(cinfo, index + (prec<<4)); - - for (i = 0; i < DCTSIZE2; i++) { - /* The table entries must be emitted in zigzag order. */ - unsigned int qval = qtbl->quantval[jpeg_natural_order[i]]; - if (prec) - emit_byte(cinfo, (int) (qval >> 8)); - emit_byte(cinfo, (int) (qval & 0xFF)); - } - - qtbl->sent_table = TRUE; - } - - return prec; -} - - -LOCAL(void) -emit_dht (j_compress_ptr cinfo, int index, wxjpeg_boolean is_ac) -/* Emit a DHT marker */ -{ - JHUFF_TBL * htbl; - int length, i; - - if (is_ac) { - htbl = cinfo->ac_huff_tbl_ptrs[index]; - index += 0x10; /* output index has AC bit set */ - } else { - htbl = cinfo->dc_huff_tbl_ptrs[index]; - } - - if (htbl == NULL) - ERREXIT1(cinfo, JERR_NO_HUFF_TABLE, index); - - if (! htbl->sent_table) { - emit_marker(cinfo, M_DHT); - - length = 0; - for (i = 1; i <= 16; i++) - length += htbl->bits[i]; - - emit_2bytes(cinfo, length + 2 + 1 + 16); - emit_byte(cinfo, index); - - for (i = 1; i <= 16; i++) - emit_byte(cinfo, htbl->bits[i]); - - for (i = 0; i < length; i++) - emit_byte(cinfo, htbl->huffval[i]); - - htbl->sent_table = TRUE; - } -} - - -LOCAL(void) -emit_dac (j_compress_ptr cinfo) -/* Emit a DAC marker */ -/* Since the useful info is so small, we want to emit all the tables in */ -/* one DAC marker. Therefore this routine does its own scan of the table. */ -{ -#ifdef C_ARITH_CODING_SUPPORTED - char dc_in_use[NUM_ARITH_TBLS]; - char ac_in_use[NUM_ARITH_TBLS]; - int length, i; - jpeg_component_info *compptr; - - for (i = 0; i < NUM_ARITH_TBLS; i++) - dc_in_use[i] = ac_in_use[i] = 0; - - for (i = 0; i < cinfo->comps_in_scan; i++) { - compptr = cinfo->cur_comp_info[i]; - dc_in_use[compptr->dc_tbl_no] = 1; - ac_in_use[compptr->ac_tbl_no] = 1; - } - - length = 0; - for (i = 0; i < NUM_ARITH_TBLS; i++) - length += dc_in_use[i] + ac_in_use[i]; - - emit_marker(cinfo, M_DAC); - - emit_2bytes(cinfo, length*2 + 2); - - for (i = 0; i < NUM_ARITH_TBLS; i++) { - if (dc_in_use[i]) { - emit_byte(cinfo, i); - emit_byte(cinfo, cinfo->arith_dc_L[i] + (cinfo->arith_dc_U[i]<<4)); - } - if (ac_in_use[i]) { - emit_byte(cinfo, i + 0x10); - emit_byte(cinfo, cinfo->arith_ac_K[i]); - } - } -#endif /* C_ARITH_CODING_SUPPORTED */ -} - - -LOCAL(void) -emit_dri (j_compress_ptr cinfo) -/* Emit a DRI marker */ -{ - emit_marker(cinfo, M_DRI); - - emit_2bytes(cinfo, 4); /* fixed length */ - - emit_2bytes(cinfo, (int) cinfo->restart_interval); -} - - -LOCAL(void) -emit_sof (j_compress_ptr cinfo, JPEG_MARKER code) -/* Emit a SOF marker */ -{ - int ci; - jpeg_component_info *compptr; - - emit_marker(cinfo, code); - - emit_2bytes(cinfo, 3 * cinfo->num_components + 2 + 5 + 1); /* length */ - - /* Make sure image isn't bigger than SOF field can handle */ - if ((long) cinfo->image_height > 65535L || - (long) cinfo->image_width > 65535L) - ERREXIT1(cinfo, JERR_IMAGE_TOO_BIG, (unsigned int) 65535); - - emit_byte(cinfo, cinfo->data_precision); - emit_2bytes(cinfo, (int) cinfo->image_height); - emit_2bytes(cinfo, (int) cinfo->image_width); - - emit_byte(cinfo, cinfo->num_components); - - for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; - ci++, compptr++) { - emit_byte(cinfo, compptr->component_id); - emit_byte(cinfo, (compptr->h_samp_factor << 4) + compptr->v_samp_factor); - emit_byte(cinfo, compptr->quant_tbl_no); - } -} - - -LOCAL(void) -emit_sos (j_compress_ptr cinfo) -/* Emit a SOS marker */ -{ - int i, td, ta; - jpeg_component_info *compptr; - - emit_marker(cinfo, M_SOS); - - emit_2bytes(cinfo, 2 * cinfo->comps_in_scan + 2 + 1 + 3); /* length */ - - emit_byte(cinfo, cinfo->comps_in_scan); - - for (i = 0; i < cinfo->comps_in_scan; i++) { - compptr = cinfo->cur_comp_info[i]; - emit_byte(cinfo, compptr->component_id); - td = compptr->dc_tbl_no; - ta = compptr->ac_tbl_no; - if (cinfo->progressive_mode) { - /* Progressive mode: only DC or only AC tables are used in one scan; - * furthermore, Huffman coding of DC refinement uses no table at all. - * We emit 0 for unused field(s); this is recommended by the P&M text - * but does not seem to be specified in the standard. - */ - if (cinfo->Ss == 0) { - ta = 0; /* DC scan */ - if (cinfo->Ah != 0 && !cinfo->arith_code) - td = 0; /* no DC table either */ - } else { - td = 0; /* AC scan */ - } - } - emit_byte(cinfo, (td << 4) + ta); - } - - emit_byte(cinfo, cinfo->Ss); - emit_byte(cinfo, cinfo->Se); - emit_byte(cinfo, (cinfo->Ah << 4) + cinfo->Al); -} - - -LOCAL(void) -emit_jfif_app0 (j_compress_ptr cinfo) -/* Emit a JFIF-compliant APP0 marker */ -{ - /* - * Length of APP0 block (2 bytes) - * Block ID (4 bytes - ASCII "JFIF") - * Zero byte (1 byte to terminate the ID string) - * Version Major, Minor (2 bytes - major first) - * Units (1 byte - 0x00 = none, 0x01 = inch, 0x02 = cm) - * Xdpu (2 bytes - dots per unit horizontal) - * Ydpu (2 bytes - dots per unit vertical) - * Thumbnail X size (1 byte) - * Thumbnail Y size (1 byte) - */ - - emit_marker(cinfo, M_APP0); - - emit_2bytes(cinfo, 2 + 4 + 1 + 2 + 1 + 2 + 2 + 1 + 1); /* length */ - - emit_byte(cinfo, 0x4A); /* Identifier: ASCII "JFIF" */ - emit_byte(cinfo, 0x46); - emit_byte(cinfo, 0x49); - emit_byte(cinfo, 0x46); - emit_byte(cinfo, 0); - emit_byte(cinfo, cinfo->JFIF_major_version); /* Version fields */ - emit_byte(cinfo, cinfo->JFIF_minor_version); - emit_byte(cinfo, cinfo->density_unit); /* Pixel size information */ - emit_2bytes(cinfo, (int) cinfo->X_density); - emit_2bytes(cinfo, (int) cinfo->Y_density); - emit_byte(cinfo, 0); /* No thumbnail image */ - emit_byte(cinfo, 0); -} - - -LOCAL(void) -emit_adobe_app14 (j_compress_ptr cinfo) -/* Emit an Adobe APP14 marker */ -{ - /* - * Length of APP14 block (2 bytes) - * Block ID (5 bytes - ASCII "Adobe") - * Version Number (2 bytes - currently 100) - * Flags0 (2 bytes - currently 0) - * Flags1 (2 bytes - currently 0) - * Color transform (1 byte) - * - * Although Adobe TN 5116 mentions Version = 101, all the Adobe files - * now in circulation seem to use Version = 100, so that's what we write. - * - * We write the color transform byte as 1 if the JPEG color space is - * YCbCr, 2 if it's YCCK, 0 otherwise. Adobe's definition has to do with - * whether the encoder performed a transformation, which is pretty useless. - */ - - emit_marker(cinfo, M_APP14); - - emit_2bytes(cinfo, 2 + 5 + 2 + 2 + 2 + 1); /* length */ - - emit_byte(cinfo, 0x41); /* Identifier: ASCII "Adobe" */ - emit_byte(cinfo, 0x64); - emit_byte(cinfo, 0x6F); - emit_byte(cinfo, 0x62); - emit_byte(cinfo, 0x65); - emit_2bytes(cinfo, 100); /* Version */ - emit_2bytes(cinfo, 0); /* Flags0 */ - emit_2bytes(cinfo, 0); /* Flags1 */ - switch (cinfo->jpeg_color_space) { - case JCS_YCbCr: - emit_byte(cinfo, 1); /* Color transform = 1 */ - break; - case JCS_YCCK: - emit_byte(cinfo, 2); /* Color transform = 2 */ - break; - default: - emit_byte(cinfo, 0); /* Color transform = 0 */ - break; - } -} - - -/* - * These routines allow writing an arbitrary marker with parameters. - * The only intended use is to emit COM or APPn markers after calling - * write_file_header and before calling write_frame_header. - * Other uses are not guaranteed to produce desirable results. - * Counting the parameter bytes properly is the caller's responsibility. - */ - -METHODDEF(void) -write_marker_header (j_compress_ptr cinfo, int marker, unsigned int datalen) -/* Emit an arbitrary marker header */ -{ - if (datalen > (unsigned int) 65533) /* safety check */ - ERREXIT(cinfo, JERR_BAD_LENGTH); - - emit_marker(cinfo, (JPEG_MARKER) marker); - - emit_2bytes(cinfo, (int) (datalen + 2)); /* total length */ -} - -METHODDEF(void) -write_marker_byte (j_compress_ptr cinfo, int val) -/* Emit one byte of marker parameters following write_marker_header */ -{ - emit_byte(cinfo, val); -} - - -/* - * Write datastream header. - * This consists of an SOI and optional APPn markers. - * We recommend use of the JFIF marker, but not the Adobe marker, - * when using YCbCr or grayscale data. The JFIF marker should NOT - * be used for any other JPEG colorspace. The Adobe marker is helpful - * to distinguish RGB, CMYK, and YCCK colorspaces. - * Note that an application can write additional header markers after - * jpeg_start_compress returns. - */ - -METHODDEF(void) -write_file_header (j_compress_ptr cinfo) -{ - my_marker_ptr marker = (my_marker_ptr) cinfo->marker; - - emit_marker(cinfo, M_SOI); /* first the SOI */ - - /* SOI is defined to reset restart interval to 0 */ - marker->last_restart_interval = 0; - - if (cinfo->write_JFIF_header) /* next an optional JFIF APP0 */ - emit_jfif_app0(cinfo); - if (cinfo->write_Adobe_marker) /* next an optional Adobe APP14 */ - emit_adobe_app14(cinfo); -} - - -/* - * Write frame header. - * This consists of DQT and SOFn markers. - * Note that we do not emit the SOF until we have emitted the DQT(s). - * This avoids compatibility problems with incorrect implementations that - * try to error-check the quant table numbers as soon as they see the SOF. - */ - -METHODDEF(void) -write_frame_header (j_compress_ptr cinfo) -{ - int ci, prec; - wxjpeg_boolean is_baseline; - jpeg_component_info *compptr; - - /* Emit DQT for each quantization table. - * Note that emit_dqt() suppresses any duplicate tables. - */ - prec = 0; - for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; - ci++, compptr++) { - prec += emit_dqt(cinfo, compptr->quant_tbl_no); - } - /* now prec is nonzero iff there are any 16-bit quant tables. */ - - /* Check for a non-baseline specification. - * Note we assume that Huffman table numbers won't be changed later. - */ - if (cinfo->arith_code || cinfo->progressive_mode || - cinfo->data_precision != 8) { - is_baseline = FALSE; - } else { - is_baseline = TRUE; - for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; - ci++, compptr++) { - if (compptr->dc_tbl_no > 1 || compptr->ac_tbl_no > 1) - is_baseline = FALSE; - } - if (prec && is_baseline) { - is_baseline = FALSE; - /* If it's baseline except for quantizer size, warn the user */ - TRACEMS(cinfo, 0, JTRC_16BIT_TABLES); - } - } - - /* Emit the proper SOF marker */ - if (cinfo->arith_code) { - emit_sof(cinfo, M_SOF9); /* SOF code for arithmetic coding */ - } else { - if (cinfo->progressive_mode) - emit_sof(cinfo, M_SOF2); /* SOF code for progressive Huffman */ - else if (is_baseline) - emit_sof(cinfo, M_SOF0); /* SOF code for baseline implementation */ - else - emit_sof(cinfo, M_SOF1); /* SOF code for non-baseline Huffman file */ - } -} - - -/* - * Write scan header. - * This consists of DHT or DAC markers, optional DRI, and SOS. - * Compressed data will be written following the SOS. - */ - -METHODDEF(void) -write_scan_header (j_compress_ptr cinfo) -{ - my_marker_ptr marker = (my_marker_ptr) cinfo->marker; - int i; - jpeg_component_info *compptr; - - if (cinfo->arith_code) { - /* Emit arith conditioning info. We may have some duplication - * if the file has multiple scans, but it's so small it's hardly - * worth worrying about. - */ - emit_dac(cinfo); - } else { - /* Emit Huffman tables. - * Note that emit_dht() suppresses any duplicate tables. - */ - for (i = 0; i < cinfo->comps_in_scan; i++) { - compptr = cinfo->cur_comp_info[i]; - if (cinfo->progressive_mode) { - /* Progressive mode: only DC or only AC tables are used in one scan */ - if (cinfo->Ss == 0) { - if (cinfo->Ah == 0) /* DC needs no table for refinement scan */ - emit_dht(cinfo, compptr->dc_tbl_no, FALSE); - } else { - emit_dht(cinfo, compptr->ac_tbl_no, TRUE); - } - } else { - /* Sequential mode: need both DC and AC tables */ - emit_dht(cinfo, compptr->dc_tbl_no, FALSE); - emit_dht(cinfo, compptr->ac_tbl_no, TRUE); - } - } - } - - /* Emit DRI if required --- note that DRI value could change for each scan. - * We avoid wasting space with unnecessary DRIs, however. - */ - if (cinfo->restart_interval != marker->last_restart_interval) { - emit_dri(cinfo); - marker->last_restart_interval = cinfo->restart_interval; - } - - emit_sos(cinfo); -} - - -/* - * Write datastream trailer. - */ - -METHODDEF(void) -write_file_trailer (j_compress_ptr cinfo) -{ - emit_marker(cinfo, M_EOI); -} - - -/* - * Write an abbreviated table-specification datastream. - * This consists of SOI, DQT and DHT tables, and EOI. - * Any table that is defined and not marked sent_table = TRUE will be - * emitted. Note that all tables will be marked sent_table = TRUE at exit. - */ - -METHODDEF(void) -write_tables_only (j_compress_ptr cinfo) -{ - int i; - - emit_marker(cinfo, M_SOI); - - for (i = 0; i < NUM_QUANT_TBLS; i++) { - if (cinfo->quant_tbl_ptrs[i] != NULL) - (void) emit_dqt(cinfo, i); - } - - if (! cinfo->arith_code) { - for (i = 0; i < NUM_HUFF_TBLS; i++) { - if (cinfo->dc_huff_tbl_ptrs[i] != NULL) - emit_dht(cinfo, i, FALSE); - if (cinfo->ac_huff_tbl_ptrs[i] != NULL) - emit_dht(cinfo, i, TRUE); - } - } - - emit_marker(cinfo, M_EOI); -} - - -/* - * Initialize the marker writer module. - */ - -GLOBAL(void) -jinit_marker_writer (j_compress_ptr cinfo) -{ - my_marker_ptr marker; - - /* Create the subobject */ - marker = (my_marker_ptr) - (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, - SIZEOF(my_marker_writer)); - cinfo->marker = (struct jpeg_marker_writer *) marker; - /* Initialize method pointers */ - marker->pub.write_file_header = write_file_header; - marker->pub.write_frame_header = write_frame_header; - marker->pub.write_scan_header = write_scan_header; - marker->pub.write_file_trailer = write_file_trailer; - marker->pub.write_tables_only = write_tables_only; - marker->pub.write_marker_header = write_marker_header; - marker->pub.write_marker_byte = write_marker_byte; - /* Initialize private state */ - marker->last_restart_interval = 0; -} diff --git a/wxWidgets/src/jpeg/jcmaster.c b/wxWidgets/src/jpeg/jcmaster.c deleted file mode 100644 index af887794ca..0000000000 --- a/wxWidgets/src/jpeg/jcmaster.c +++ /dev/null @@ -1,590 +0,0 @@ -/* - * jcmaster.c - * - * Copyright (C) 1991-1997, Thomas G. Lane. - * This file is part of the Independent JPEG Group's software. - * For conditions of distribution and use, see the accompanying README file. - * - * This file contains master control logic for the JPEG compressor. - * These routines are concerned with parameter validation, initial setup, - * and inter-pass control (determining the number of passes and the work - * to be done in each pass). - */ - -#define JPEG_INTERNALS -#include "jinclude.h" -#include "jpeglib.h" - - -/* Private state */ - -typedef enum { - main_pass, /* input data, also do first output step */ - huff_opt_pass, /* Huffman code optimization pass */ - output_pass /* data output pass */ -} c_pass_type; - -typedef struct { - struct jpeg_comp_master pub; /* public fields */ - - c_pass_type pass_type; /* the type of the current pass */ - - int pass_number; /* # of passes completed */ - int total_passes; /* total # of passes needed */ - - int scan_number; /* current index in scan_info[] */ -} my_comp_master; - -typedef my_comp_master * my_master_ptr; - - -/* - * Support routines that do various essential calculations. - */ - -LOCAL(void) -initial_setup (j_compress_ptr cinfo) -/* Do computations that are needed before master selection phase */ -{ - int ci; - jpeg_component_info *compptr; - long samplesperrow; - JDIMENSION jd_samplesperrow; - - /* Sanity check on image dimensions */ - if (cinfo->image_height <= 0 || cinfo->image_width <= 0 - || cinfo->num_components <= 0 || cinfo->input_components <= 0) - ERREXIT(cinfo, JERR_EMPTY_IMAGE); - - /* Make sure image isn't bigger than I can handle */ - if ((long) cinfo->image_height > (long) JPEG_MAX_DIMENSION || - (long) cinfo->image_width > (long) JPEG_MAX_DIMENSION) - ERREXIT1(cinfo, JERR_IMAGE_TOO_BIG, (unsigned int) JPEG_MAX_DIMENSION); - - /* Width of an input scanline must be representable as JDIMENSION. */ - samplesperrow = (long) cinfo->image_width * (long) cinfo->input_components; - jd_samplesperrow = (JDIMENSION) samplesperrow; - if ((long) jd_samplesperrow != samplesperrow) - ERREXIT(cinfo, JERR_WIDTH_OVERFLOW); - - /* For now, precision must match compiled-in value... */ - if (cinfo->data_precision != BITS_IN_JSAMPLE) - ERREXIT1(cinfo, JERR_BAD_PRECISION, cinfo->data_precision); - - /* Check that number of components won't exceed internal array sizes */ - if (cinfo->num_components > MAX_COMPONENTS) - ERREXIT2(cinfo, JERR_COMPONENT_COUNT, cinfo->num_components, - MAX_COMPONENTS); - - /* Compute maximum sampling factors; check factor validity */ - cinfo->max_h_samp_factor = 1; - cinfo->max_v_samp_factor = 1; - for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; - ci++, compptr++) { - if (compptr->h_samp_factor<=0 || compptr->h_samp_factor>MAX_SAMP_FACTOR || - compptr->v_samp_factor<=0 || compptr->v_samp_factor>MAX_SAMP_FACTOR) - ERREXIT(cinfo, JERR_BAD_SAMPLING); - cinfo->max_h_samp_factor = MAX(cinfo->max_h_samp_factor, - compptr->h_samp_factor); - cinfo->max_v_samp_factor = MAX(cinfo->max_v_samp_factor, - compptr->v_samp_factor); - } - - /* Compute dimensions of components */ - for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; - ci++, compptr++) { - /* Fill in the correct component_index value; don't rely on application */ - compptr->component_index = ci; - /* For compression, we never do DCT scaling. */ - compptr->DCT_scaled_size = DCTSIZE; - /* Size in DCT blocks */ - compptr->width_in_blocks = (JDIMENSION) - jdiv_round_up((long) cinfo->image_width * (long) compptr->h_samp_factor, - (long) (cinfo->max_h_samp_factor * DCTSIZE)); - compptr->height_in_blocks = (JDIMENSION) - jdiv_round_up((long) cinfo->image_height * (long) compptr->v_samp_factor, - (long) (cinfo->max_v_samp_factor * DCTSIZE)); - /* Size in samples */ - compptr->downsampled_width = (JDIMENSION) - jdiv_round_up((long) cinfo->image_width * (long) compptr->h_samp_factor, - (long) cinfo->max_h_samp_factor); - compptr->downsampled_height = (JDIMENSION) - jdiv_round_up((long) cinfo->image_height * (long) compptr->v_samp_factor, - (long) cinfo->max_v_samp_factor); - /* Mark component needed (this flag isn't actually used for compression) */ - compptr->component_needed = TRUE; - } - - /* Compute number of fully interleaved MCU rows (number of times that - * main controller will call coefficient controller). - */ - cinfo->total_iMCU_rows = (JDIMENSION) - jdiv_round_up((long) cinfo->image_height, - (long) (cinfo->max_v_samp_factor*DCTSIZE)); -} - - -#ifdef C_MULTISCAN_FILES_SUPPORTED - -LOCAL(void) -validate_script (j_compress_ptr cinfo) -/* Verify that the scan script in cinfo->scan_info[] is valid; also - * determine whether it uses progressive JPEG, and set cinfo->progressive_mode. - */ -{ - const jpeg_scan_info * scanptr; - int scanno, ncomps, ci, coefi, thisi; - int Ss, Se, Ah, Al; - wxjpeg_boolean component_sent[MAX_COMPONENTS]; -#ifdef C_PROGRESSIVE_SUPPORTED - int * last_bitpos_ptr; - int last_bitpos[MAX_COMPONENTS][DCTSIZE2]; - /* -1 until that coefficient has been seen; then last Al for it */ -#endif - - if (cinfo->num_scans <= 0) - ERREXIT1(cinfo, JERR_BAD_SCAN_SCRIPT, 0); - - /* For sequential JPEG, all scans must have Ss=0, Se=DCTSIZE2-1; - * for progressive JPEG, no scan can have this. - */ - scanptr = cinfo->scan_info; - if (scanptr->Ss != 0 || scanptr->Se != DCTSIZE2-1) { -#ifdef C_PROGRESSIVE_SUPPORTED - cinfo->progressive_mode = TRUE; - last_bitpos_ptr = & last_bitpos[0][0]; - for (ci = 0; ci < cinfo->num_components; ci++) - for (coefi = 0; coefi < DCTSIZE2; coefi++) - *last_bitpos_ptr++ = -1; -#else - ERREXIT(cinfo, JERR_NOT_COMPILED); -#endif - } else { - cinfo->progressive_mode = FALSE; - for (ci = 0; ci < cinfo->num_components; ci++) - component_sent[ci] = FALSE; - } - - for (scanno = 1; scanno <= cinfo->num_scans; scanptr++, scanno++) { - /* Validate component indexes */ - ncomps = scanptr->comps_in_scan; - if (ncomps <= 0 || ncomps > MAX_COMPS_IN_SCAN) - ERREXIT2(cinfo, JERR_COMPONENT_COUNT, ncomps, MAX_COMPS_IN_SCAN); - for (ci = 0; ci < ncomps; ci++) { - thisi = scanptr->component_index[ci]; - if (thisi < 0 || thisi >= cinfo->num_components) - ERREXIT1(cinfo, JERR_BAD_SCAN_SCRIPT, scanno); - /* Components must appear in SOF order within each scan */ - if (ci > 0 && thisi <= scanptr->component_index[ci-1]) - ERREXIT1(cinfo, JERR_BAD_SCAN_SCRIPT, scanno); - } - /* Validate progression parameters */ - Ss = scanptr->Ss; - Se = scanptr->Se; - Ah = scanptr->Ah; - Al = scanptr->Al; - if (cinfo->progressive_mode) { -#ifdef C_PROGRESSIVE_SUPPORTED - /* The JPEG spec simply gives the ranges 0..13 for Ah and Al, but that - * seems wrong: the upper bound ought to depend on data precision. - * Perhaps they really meant 0..N+1 for N-bit precision. - * Here we allow 0..10 for 8-bit data; Al larger than 10 results in - * out-of-range reconstructed DC values during the first DC scan, - * which might cause problems for some decoders. - */ -#if BITS_IN_JSAMPLE == 8 -#define MAX_AH_AL 10 -#else -#define MAX_AH_AL 13 -#endif - if (Ss < 0 || Ss >= DCTSIZE2 || Se < Ss || Se >= DCTSIZE2 || - Ah < 0 || Ah > MAX_AH_AL || Al < 0 || Al > MAX_AH_AL) - ERREXIT1(cinfo, JERR_BAD_PROG_SCRIPT, scanno); - if (Ss == 0) { - if (Se != 0) /* DC and AC together not OK */ - ERREXIT1(cinfo, JERR_BAD_PROG_SCRIPT, scanno); - } else { - if (ncomps != 1) /* AC scans must be for only one component */ - ERREXIT1(cinfo, JERR_BAD_PROG_SCRIPT, scanno); - } - for (ci = 0; ci < ncomps; ci++) { - last_bitpos_ptr = & last_bitpos[scanptr->component_index[ci]][0]; - if (Ss != 0 && last_bitpos_ptr[0] < 0) /* AC without prior DC scan */ - ERREXIT1(cinfo, JERR_BAD_PROG_SCRIPT, scanno); - for (coefi = Ss; coefi <= Se; coefi++) { - if (last_bitpos_ptr[coefi] < 0) { - /* first scan of this coefficient */ - if (Ah != 0) - ERREXIT1(cinfo, JERR_BAD_PROG_SCRIPT, scanno); - } else { - /* not first scan */ - if (Ah != last_bitpos_ptr[coefi] || Al != Ah-1) - ERREXIT1(cinfo, JERR_BAD_PROG_SCRIPT, scanno); - } - last_bitpos_ptr[coefi] = Al; - } - } -#endif - } else { - /* For sequential JPEG, all progression parameters must be these: */ - if (Ss != 0 || Se != DCTSIZE2-1 || Ah != 0 || Al != 0) - ERREXIT1(cinfo, JERR_BAD_PROG_SCRIPT, scanno); - /* Make sure components are not sent twice */ - for (ci = 0; ci < ncomps; ci++) { - thisi = scanptr->component_index[ci]; - if (component_sent[thisi]) - ERREXIT1(cinfo, JERR_BAD_SCAN_SCRIPT, scanno); - component_sent[thisi] = TRUE; - } - } - } - - /* Now verify that everything got sent. */ - if (cinfo->progressive_mode) { -#ifdef C_PROGRESSIVE_SUPPORTED - /* For progressive mode, we only check that at least some DC data - * got sent for each component; the spec does not require that all bits - * of all coefficients be transmitted. Would it be wiser to enforce - * transmission of all coefficient bits?? - */ - for (ci = 0; ci < cinfo->num_components; ci++) { - if (last_bitpos[ci][0] < 0) - ERREXIT(cinfo, JERR_MISSING_DATA); - } -#endif - } else { - for (ci = 0; ci < cinfo->num_components; ci++) { - if (! component_sent[ci]) - ERREXIT(cinfo, JERR_MISSING_DATA); - } - } -} - -#endif /* C_MULTISCAN_FILES_SUPPORTED */ - - -LOCAL(void) -select_scan_parameters (j_compress_ptr cinfo) -/* Set up the scan parameters for the current scan */ -{ - int ci; - -#ifdef C_MULTISCAN_FILES_SUPPORTED - if (cinfo->scan_info != NULL) { - /* Prepare for current scan --- the script is already validated */ - my_master_ptr master = (my_master_ptr) cinfo->master; - const jpeg_scan_info * scanptr = cinfo->scan_info + master->scan_number; - - cinfo->comps_in_scan = scanptr->comps_in_scan; - for (ci = 0; ci < scanptr->comps_in_scan; ci++) { - cinfo->cur_comp_info[ci] = - &cinfo->comp_info[scanptr->component_index[ci]]; - } - cinfo->Ss = scanptr->Ss; - cinfo->Se = scanptr->Se; - cinfo->Ah = scanptr->Ah; - cinfo->Al = scanptr->Al; - } - else -#endif - { - /* Prepare for single sequential-JPEG scan containing all components */ - if (cinfo->num_components > MAX_COMPS_IN_SCAN) - ERREXIT2(cinfo, JERR_COMPONENT_COUNT, cinfo->num_components, - MAX_COMPS_IN_SCAN); - cinfo->comps_in_scan = cinfo->num_components; - for (ci = 0; ci < cinfo->num_components; ci++) { - cinfo->cur_comp_info[ci] = &cinfo->comp_info[ci]; - } - cinfo->Ss = 0; - cinfo->Se = DCTSIZE2-1; - cinfo->Ah = 0; - cinfo->Al = 0; - } -} - - -LOCAL(void) -per_scan_setup (j_compress_ptr cinfo) -/* Do computations that are needed before processing a JPEG scan */ -/* cinfo->comps_in_scan and cinfo->cur_comp_info[] are already set */ -{ - int ci, mcublks, tmp; - jpeg_component_info *compptr; - - if (cinfo->comps_in_scan == 1) { - - /* Noninterleaved (single-component) scan */ - compptr = cinfo->cur_comp_info[0]; - - /* Overall image size in MCUs */ - cinfo->MCUs_per_row = compptr->width_in_blocks; - cinfo->MCU_rows_in_scan = compptr->height_in_blocks; - - /* For noninterleaved scan, always one block per MCU */ - compptr->MCU_width = 1; - compptr->MCU_height = 1; - compptr->MCU_blocks = 1; - compptr->MCU_sample_width = DCTSIZE; - compptr->last_col_width = 1; - /* For noninterleaved scans, it is convenient to define last_row_height - * as the number of block rows present in the last iMCU row. - */ - tmp = (int) (compptr->height_in_blocks % compptr->v_samp_factor); - if (tmp == 0) tmp = compptr->v_samp_factor; - compptr->last_row_height = tmp; - - /* Prepare array describing MCU composition */ - cinfo->blocks_in_MCU = 1; - cinfo->MCU_membership[0] = 0; - - } else { - - /* Interleaved (multi-component) scan */ - if (cinfo->comps_in_scan <= 0 || cinfo->comps_in_scan > MAX_COMPS_IN_SCAN) - ERREXIT2(cinfo, JERR_COMPONENT_COUNT, cinfo->comps_in_scan, - MAX_COMPS_IN_SCAN); - - /* Overall image size in MCUs */ - cinfo->MCUs_per_row = (JDIMENSION) - jdiv_round_up((long) cinfo->image_width, - (long) (cinfo->max_h_samp_factor*DCTSIZE)); - cinfo->MCU_rows_in_scan = (JDIMENSION) - jdiv_round_up((long) cinfo->image_height, - (long) (cinfo->max_v_samp_factor*DCTSIZE)); - - cinfo->blocks_in_MCU = 0; - - for (ci = 0; ci < cinfo->comps_in_scan; ci++) { - compptr = cinfo->cur_comp_info[ci]; - /* Sampling factors give # of blocks of component in each MCU */ - compptr->MCU_width = compptr->h_samp_factor; - compptr->MCU_height = compptr->v_samp_factor; - compptr->MCU_blocks = compptr->MCU_width * compptr->MCU_height; - compptr->MCU_sample_width = compptr->MCU_width * DCTSIZE; - /* Figure number of non-dummy blocks in last MCU column & row */ - tmp = (int) (compptr->width_in_blocks % compptr->MCU_width); - if (tmp == 0) tmp = compptr->MCU_width; - compptr->last_col_width = tmp; - tmp = (int) (compptr->height_in_blocks % compptr->MCU_height); - if (tmp == 0) tmp = compptr->MCU_height; - compptr->last_row_height = tmp; - /* Prepare array describing MCU composition */ - mcublks = compptr->MCU_blocks; - if (cinfo->blocks_in_MCU + mcublks > C_MAX_BLOCKS_IN_MCU) - ERREXIT(cinfo, JERR_BAD_MCU_SIZE); - while (mcublks-- > 0) { - cinfo->MCU_membership[cinfo->blocks_in_MCU++] = ci; - } - } - - } - - /* Convert restart specified in rows to actual MCU count. */ - /* Note that count must fit in 16 bits, so we provide limiting. */ - if (cinfo->restart_in_rows > 0) { - long nominal = (long) cinfo->restart_in_rows * (long) cinfo->MCUs_per_row; - cinfo->restart_interval = (unsigned int) MIN(nominal, 65535L); - } -} - - -/* - * Per-pass setup. - * This is called at the beginning of each pass. We determine which modules - * will be active during this pass and give them appropriate start_pass calls. - * We also set is_last_pass to indicate whether any more passes will be - * required. - */ - -METHODDEF(void) -prepare_for_pass (j_compress_ptr cinfo) -{ - my_master_ptr master = (my_master_ptr) cinfo->master; - - switch (master->pass_type) { - case main_pass: - /* Initial pass: will collect input data, and do either Huffman - * optimization or data output for the first scan. - */ - select_scan_parameters(cinfo); - per_scan_setup(cinfo); - if (! cinfo->raw_data_in) { - (*cinfo->cconvert->start_pass) (cinfo); - (*cinfo->downsample->start_pass) (cinfo); - (*cinfo->prep->start_pass) (cinfo, JBUF_PASS_THRU); - } - (*cinfo->fdct->start_pass) (cinfo); - (*cinfo->entropy->start_pass) (cinfo, cinfo->optimize_coding); - (*cinfo->coef->start_pass) (cinfo, - (master->total_passes > 1 ? - JBUF_SAVE_AND_PASS : JBUF_PASS_THRU)); - (*cinfo->main->start_pass) (cinfo, JBUF_PASS_THRU); - if (cinfo->optimize_coding) { - /* No immediate data output; postpone writing frame/scan headers */ - master->pub.call_pass_startup = FALSE; - } else { - /* Will write frame/scan headers at first jpeg_write_scanlines call */ - master->pub.call_pass_startup = TRUE; - } - break; -#ifdef ENTROPY_OPT_SUPPORTED - case huff_opt_pass: - /* Do Huffman optimization for a scan after the first one. */ - select_scan_parameters(cinfo); - per_scan_setup(cinfo); - if (cinfo->Ss != 0 || cinfo->Ah == 0 || cinfo->arith_code) { - (*cinfo->entropy->start_pass) (cinfo, TRUE); - (*cinfo->coef->start_pass) (cinfo, JBUF_CRANK_DEST); - master->pub.call_pass_startup = FALSE; - break; - } - /* Special case: Huffman DC refinement scans need no Huffman table - * and therefore we can skip the optimization pass for them. - */ - master->pass_type = output_pass; - master->pass_number++; - /*FALLTHROUGH*/ -#endif - case output_pass: - /* Do a data-output pass. */ - /* We need not repeat per-scan setup if prior optimization pass did it. */ - if (! cinfo->optimize_coding) { - select_scan_parameters(cinfo); - per_scan_setup(cinfo); - } - (*cinfo->entropy->start_pass) (cinfo, FALSE); - (*cinfo->coef->start_pass) (cinfo, JBUF_CRANK_DEST); - /* We emit frame/scan headers now */ - if (master->scan_number == 0) - (*cinfo->marker->write_frame_header) (cinfo); - (*cinfo->marker->write_scan_header) (cinfo); - master->pub.call_pass_startup = FALSE; - break; - default: - ERREXIT(cinfo, JERR_NOT_COMPILED); - } - - master->pub.is_last_pass = (master->pass_number == master->total_passes-1); - - /* Set up progress monitor's pass info if present */ - if (cinfo->progress != NULL) { - cinfo->progress->completed_passes = master->pass_number; - cinfo->progress->total_passes = master->total_passes; - } -} - - -/* - * Special start-of-pass hook. - * This is called by jpeg_write_scanlines if call_pass_startup is TRUE. - * In single-pass processing, we need this hook because we don't want to - * write frame/scan headers during jpeg_start_compress; we want to let the - * application write COM markers etc. between jpeg_start_compress and the - * jpeg_write_scanlines loop. - * In multi-pass processing, this routine is not used. - */ - -METHODDEF(void) -pass_startup (j_compress_ptr cinfo) -{ - cinfo->master->call_pass_startup = FALSE; /* reset flag so call only once */ - - (*cinfo->marker->write_frame_header) (cinfo); - (*cinfo->marker->write_scan_header) (cinfo); -} - - -/* - * Finish up at end of pass. - */ - -METHODDEF(void) -finish_pass_master (j_compress_ptr cinfo) -{ - my_master_ptr master = (my_master_ptr) cinfo->master; - - /* The entropy coder always needs an end-of-pass call, - * either to analyze statistics or to flush its output buffer. - */ - (*cinfo->entropy->finish_pass) (cinfo); - - /* Update state for next pass */ - switch (master->pass_type) { - case main_pass: - /* next pass is either output of scan 0 (after optimization) - * or output of scan 1 (if no optimization). - */ - master->pass_type = output_pass; - if (! cinfo->optimize_coding) - master->scan_number++; - break; - case huff_opt_pass: - /* next pass is always output of current scan */ - master->pass_type = output_pass; - break; - case output_pass: - /* next pass is either optimization or output of next scan */ - if (cinfo->optimize_coding) - master->pass_type = huff_opt_pass; - master->scan_number++; - break; - } - - master->pass_number++; -} - - -/* - * Initialize master compression control. - */ - -GLOBAL(void) -jinit_c_master_control (j_compress_ptr cinfo, wxjpeg_boolean transcode_only) -{ - my_master_ptr master; - - master = (my_master_ptr) - (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, - SIZEOF(my_comp_master)); - cinfo->master = (struct jpeg_comp_master *) master; - master->pub.prepare_for_pass = prepare_for_pass; - master->pub.pass_startup = pass_startup; - master->pub.finish_pass = finish_pass_master; - master->pub.is_last_pass = FALSE; - - /* Validate parameters, determine derived values */ - initial_setup(cinfo); - - if (cinfo->scan_info != NULL) { -#ifdef C_MULTISCAN_FILES_SUPPORTED - validate_script(cinfo); -#else - ERREXIT(cinfo, JERR_NOT_COMPILED); -#endif - } else { - cinfo->progressive_mode = FALSE; - cinfo->num_scans = 1; - } - - if (cinfo->progressive_mode) /* TEMPORARY HACK ??? */ - cinfo->optimize_coding = TRUE; /* assume default tables no good for progressive mode */ - - /* Initialize my private state */ - if (transcode_only) { - /* no main pass in transcoding */ - if (cinfo->optimize_coding) - master->pass_type = huff_opt_pass; - else - master->pass_type = output_pass; - } else { - /* for normal compression, first pass is always this type: */ - master->pass_type = main_pass; - } - master->scan_number = 0; - master->pass_number = 0; - if (cinfo->optimize_coding) - master->total_passes = cinfo->num_scans * 2; - else - master->total_passes = cinfo->num_scans; -} diff --git a/wxWidgets/src/jpeg/jcomapi.c b/wxWidgets/src/jpeg/jcomapi.c deleted file mode 100644 index 9b1fa7568a..0000000000 --- a/wxWidgets/src/jpeg/jcomapi.c +++ /dev/null @@ -1,106 +0,0 @@ -/* - * jcomapi.c - * - * Copyright (C) 1994-1997, Thomas G. Lane. - * This file is part of the Independent JPEG Group's software. - * For conditions of distribution and use, see the accompanying README file. - * - * This file contains application interface routines that are used for both - * compression and decompression. - */ - -#define JPEG_INTERNALS -#include "jinclude.h" -#include "jpeglib.h" - - -/* - * Abort processing of a JPEG compression or decompression operation, - * but don't destroy the object itself. - * - * For this, we merely clean up all the nonpermanent memory pools. - * Note that temp files (virtual arrays) are not allowed to belong to - * the permanent pool, so we will be able to close all temp files here. - * Closing a data source or destination, if necessary, is the application's - * responsibility. - */ - -GLOBAL(void) -jpeg_abort (j_common_ptr cinfo) -{ - int pool; - - /* Do nothing if called on a not-initialized or destroyed JPEG object. */ - if (cinfo->mem == NULL) - return; - - /* Releasing pools in reverse order might help avoid fragmentation - * with some (brain-damaged) malloc libraries. - */ - for (pool = JPOOL_NUMPOOLS-1; pool > JPOOL_PERMANENT; pool--) { - (*cinfo->mem->free_pool) (cinfo, pool); - } - - /* Reset overall state for possible reuse of object */ - if (cinfo->is_decompressor) { - cinfo->global_state = DSTATE_START; - /* Try to keep application from accessing now-deleted marker list. - * A bit kludgy to do it here, but this is the most central place. - */ - ((j_decompress_ptr) cinfo)->marker_list = NULL; - } else { - cinfo->global_state = CSTATE_START; - } -} - - -/* - * Destruction of a JPEG object. - * - * Everything gets deallocated except the master jpeg_compress_struct itself - * and the error manager struct. Both of these are supplied by the application - * and must be freed, if necessary, by the application. (Often they are on - * the stack and so don't need to be freed anyway.) - * Closing a data source or destination, if necessary, is the application's - * responsibility. - */ - -GLOBAL(void) -jpeg_destroy (j_common_ptr cinfo) -{ - /* We need only tell the memory manager to release everything. */ - /* NB: mem pointer is NULL if memory mgr failed to initialize. */ - if (cinfo->mem != NULL) - (*cinfo->mem->self_destruct) (cinfo); - cinfo->mem = NULL; /* be safe if jpeg_destroy is called twice */ - cinfo->global_state = 0; /* mark it destroyed */ -} - - -/* - * Convenience routines for allocating quantization and Huffman tables. - * (Would jutils.c be a more reasonable place to put these?) - */ - -GLOBAL(JQUANT_TBL *) -jpeg_alloc_quant_table (j_common_ptr cinfo) -{ - JQUANT_TBL *tbl; - - tbl = (JQUANT_TBL *) - (*cinfo->mem->alloc_small) (cinfo, JPOOL_PERMANENT, SIZEOF(JQUANT_TBL)); - tbl->sent_table = FALSE; /* make sure this is false in any new table */ - return tbl; -} - - -GLOBAL(JHUFF_TBL *) -jpeg_alloc_huff_table (j_common_ptr cinfo) -{ - JHUFF_TBL *tbl; - - tbl = (JHUFF_TBL *) - (*cinfo->mem->alloc_small) (cinfo, JPOOL_PERMANENT, SIZEOF(JHUFF_TBL)); - tbl->sent_table = FALSE; /* make sure this is false in any new table */ - return tbl; -} diff --git a/wxWidgets/src/jpeg/jconfig.h b/wxWidgets/src/jpeg/jconfig.h deleted file mode 100644 index 254d9264d1..0000000000 --- a/wxWidgets/src/jpeg/jconfig.h +++ /dev/null @@ -1,109 +0,0 @@ -/* This test added by JACS as a quick fix. What should we do - * to make it work with configure? - */ - -#if defined(_MSC_VER) || defined(__BORLANDC__) || defined (__DMC__) -#include "jconfig.vc" -#else - -/* jconfig.h. Generated automatically by configure. */ -/* jconfig.cfg --- source file edited by configure script */ -/* see jconfig.doc for explanations */ - -/* If using MetroWerks on Mac define __WXMAC__ if it isn't already - FIXME: Is this necessary any longer? */ -#ifdef __MWERKS__ -#if (__MWERKS__ < 0x0900) || macintosh || defined ( __MACH__ ) -# ifndef __WXMAC__ -# define __WXMAC__ -# endif -#endif -#endif - -/* use wxWidgets' configure */ -#include "wx/setup.h" - -/* If using Metrowerks and not using configure-generated setup */ -#if defined(__MWERKS__) && !defined(__WX_SETUP_H__) -#if (__MWERKS__ < 0x0900) || macintosh || defined ( __MACH__ ) - -# define USE_MAC_MEMMGR - -# ifdef __MACH__ -# include -# include -# include -# undef WCHAR_MAX -# include -# endif - -/* automatically includes MacHeaders */ -#elif (__MWERKS__ >= 0x0900) && __INTEL__ - #define __WXMSW__ -#endif -#endif - -#define HAVE_PROTOTYPES -#define HAVE_UNSIGNED_CHAR -#define HAVE_UNSIGNED_SHORT -#undef void -#undef const - -/* use wxWidgets' configure */ -/* #undef CHAR_IS_UNSIGNED */ -#ifdef __CHAR_UNSIGNED__ - #ifndef CHAR_IS_UNSIGNED - #define CHAR_IS_UNSIGNED - #endif -#else - #undef CHAR_IS_UNSIGNED -#endif - -#define HAVE_STDDEF_H -#define HAVE_STDLIB_H -#undef NEED_BSD_STRINGS -#undef NEED_SYS_TYPES_H -#undef NEED_FAR_POINTERS -#undef NEED_SHORT_EXTERNAL_NAMES -/* Define this if you get warnings about undefined structures. */ -#undef INCOMPLETE_TYPES_BROKEN - -#ifdef JPEG_INTERNALS - -#undef RIGHT_SHIFT_IS_UNSIGNED - -/* use wxWidgets' configure */ -/* #define INLINE __inline__ */ -#if defined(__VISAGECPP__) && (__IBMCPP__ >= 400 || __IBMC__ >= 400) -#define INLINE -#elif defined(__WATCOMC__) -#define INLINE -#else -#define INLINE inline -#endif - -/* These are for configuring the JPEG memory manager. */ -#undef DEFAULT_MAX_MEM -#undef NO_MKTEMP - -#endif /* JPEG_INTERNALS */ - -#ifdef JPEG_CJPEG_DJPEG - -#define BMP_SUPPORTED /* BMP image file format */ -#define GIF_SUPPORTED /* GIF image file format */ -#define PPM_SUPPORTED /* PBMPLUS PPM/PGM image file format */ -#undef RLE_SUPPORTED /* Utah RLE image file format */ -#define TARGA_SUPPORTED /* Targa image file format */ - -#undef TWO_FILE_COMMANDLINE -#undef NEED_SIGNAL_CATCHER -#undef DONT_USE_B_MODE - -/* Define this if you want percent-done progress reports from cjpeg/djpeg. */ -#undef PROGRESS_REPORT - -#endif /* JPEG_CJPEG_DJPEG */ -#endif - /* _MSC_VER */ - diff --git a/wxWidgets/src/jpeg/jconfig.vc b/wxWidgets/src/jpeg/jconfig.vc deleted file mode 100644 index 7e291c75bd..0000000000 --- a/wxWidgets/src/jpeg/jconfig.vc +++ /dev/null @@ -1,45 +0,0 @@ -/* jconfig.vc --- jconfig.h for Microsoft Visual C++ on Windows 95 or NT. */ -/* see jconfig.doc for explanations */ - -#define HAVE_PROTOTYPES -#define HAVE_UNSIGNED_CHAR -#define HAVE_UNSIGNED_SHORT -/* #define void char */ -/* #define const */ -#undef CHAR_IS_UNSIGNED -#define HAVE_STDDEF_H -#define HAVE_STDLIB_H -#undef NEED_BSD_STRINGS -#undef NEED_SYS_TYPES_H -#undef NEED_FAR_POINTERS /* we presume a 32-bit flat memory model */ -#undef NEED_SHORT_EXTERNAL_NAMES -#undef INCOMPLETE_TYPES_BROKEN - -/* Define "boolean" as unsigned char, not int, per Windows custom */ -#ifndef __RPCNDR_H__ /* don't conflict if rpcndr.h already read */ -typedef unsigned char boolean; -#endif -#define HAVE_BOOLEAN /* prevent jmorecfg.h from redefining it */ - - -#ifdef JPEG_INTERNALS - -#undef RIGHT_SHIFT_IS_UNSIGNED - -#endif /* JPEG_INTERNALS */ - -#ifdef JPEG_CJPEG_DJPEG - -#define BMP_SUPPORTED /* BMP image file format */ -#define GIF_SUPPORTED /* GIF image file format */ -#define PPM_SUPPORTED /* PBMPLUS PPM/PGM image file format */ -#undef RLE_SUPPORTED /* Utah RLE image file format */ -#define TARGA_SUPPORTED /* Targa image file format */ - -#define TWO_FILE_COMMANDLINE /* optional */ -#define USE_SETMODE /* Microsoft has setmode() */ -#undef NEED_SIGNAL_CATCHER -#undef DONT_USE_B_MODE -#undef PROGRESS_REPORT /* optional */ - -#endif /* JPEG_CJPEG_DJPEG */ diff --git a/wxWidgets/src/jpeg/jcparam.c b/wxWidgets/src/jpeg/jcparam.c deleted file mode 100644 index 046bd87e06..0000000000 --- a/wxWidgets/src/jpeg/jcparam.c +++ /dev/null @@ -1,610 +0,0 @@ -/* - * jcparam.c - * - * Copyright (C) 1991-1998, Thomas G. Lane. - * This file is part of the Independent JPEG Group's software. - * For conditions of distribution and use, see the accompanying README file. - * - * This file contains optional default-setting code for the JPEG compressor. - * Applications do not have to use this file, but those that don't use it - * must know a lot more about the innards of the JPEG code. - */ - -#define JPEG_INTERNALS -#include "jinclude.h" -#include "jpeglib.h" - - -/* - * Quantization table setup routines - */ - -GLOBAL(void) -jpeg_add_quant_table (j_compress_ptr cinfo, int which_tbl, - const unsigned int *basic_table, - int scale_factor, wxjpeg_boolean force_baseline) -/* Define a quantization table equal to the basic_table times - * a scale factor (given as a percentage). - * If force_baseline is TRUE, the computed quantization table entries - * are limited to 1..255 for JPEG baseline compatibility. - */ -{ - JQUANT_TBL ** qtblptr; - int i; - long temp; - - /* Safety check to ensure start_compress not called yet. */ - if (cinfo->global_state != CSTATE_START) - ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state); - - if (which_tbl < 0 || which_tbl >= NUM_QUANT_TBLS) - ERREXIT1(cinfo, JERR_DQT_INDEX, which_tbl); - - qtblptr = & cinfo->quant_tbl_ptrs[which_tbl]; - - if (*qtblptr == NULL) - *qtblptr = jpeg_alloc_quant_table((j_common_ptr) cinfo); - - for (i = 0; i < DCTSIZE2; i++) { - temp = ((long) basic_table[i] * scale_factor + 50L) / 100L; - /* limit the values to the valid range */ - if (temp <= 0L) temp = 1L; - if (temp > 32767L) temp = 32767L; /* max quantizer needed for 12 bits */ - if (force_baseline && temp > 255L) - temp = 255L; /* limit to baseline range if requested */ - (*qtblptr)->quantval[i] = (UINT16) temp; - } - - /* Initialize sent_table FALSE so table will be written to JPEG file. */ - (*qtblptr)->sent_table = FALSE; -} - - -GLOBAL(void) -jpeg_set_linear_quality (j_compress_ptr cinfo, int scale_factor, - wxjpeg_boolean force_baseline) -/* Set or change the 'quality' (quantization) setting, using default tables - * and a straight percentage-scaling quality scale. In most cases it's better - * to use jpeg_set_quality (below); this entry point is provided for - * applications that insist on a linear percentage scaling. - */ -{ - /* These are the sample quantization tables given in JPEG spec section K.1. - * The spec says that the values given produce "good" quality, and - * when divided by 2, "very good" quality. - */ - static const unsigned int std_luminance_quant_tbl[DCTSIZE2] = { - 16, 11, 10, 16, 24, 40, 51, 61, - 12, 12, 14, 19, 26, 58, 60, 55, - 14, 13, 16, 24, 40, 57, 69, 56, - 14, 17, 22, 29, 51, 87, 80, 62, - 18, 22, 37, 56, 68, 109, 103, 77, - 24, 35, 55, 64, 81, 104, 113, 92, - 49, 64, 78, 87, 103, 121, 120, 101, - 72, 92, 95, 98, 112, 100, 103, 99 - }; - static const unsigned int std_chrominance_quant_tbl[DCTSIZE2] = { - 17, 18, 24, 47, 99, 99, 99, 99, - 18, 21, 26, 66, 99, 99, 99, 99, - 24, 26, 56, 99, 99, 99, 99, 99, - 47, 66, 99, 99, 99, 99, 99, 99, - 99, 99, 99, 99, 99, 99, 99, 99, - 99, 99, 99, 99, 99, 99, 99, 99, - 99, 99, 99, 99, 99, 99, 99, 99, - 99, 99, 99, 99, 99, 99, 99, 99 - }; - - /* Set up two quantization tables using the specified scaling */ - jpeg_add_quant_table(cinfo, 0, std_luminance_quant_tbl, - scale_factor, force_baseline); - jpeg_add_quant_table(cinfo, 1, std_chrominance_quant_tbl, - scale_factor, force_baseline); -} - - -GLOBAL(int) -jpeg_quality_scaling (int quality) -/* Convert a user-specified quality rating to a percentage scaling factor - * for an underlying quantization table, using our recommended scaling curve. - * The input 'quality' factor should be 0 (terrible) to 100 (very good). - */ -{ - /* Safety limit on quality factor. Convert 0 to 1 to avoid zero divide. */ - if (quality <= 0) quality = 1; - if (quality > 100) quality = 100; - - /* The basic table is used as-is (scaling 100) for a quality of 50. - * Qualities 50..100 are converted to scaling percentage 200 - 2*Q; - * note that at Q=100 the scaling is 0, which will cause jpeg_add_quant_table - * to make all the table entries 1 (hence, minimum quantization loss). - * Qualities 1..50 are converted to scaling percentage 5000/Q. - */ - if (quality < 50) - quality = 5000 / quality; - else - quality = 200 - quality*2; - - return quality; -} - - -GLOBAL(void) -jpeg_set_quality (j_compress_ptr cinfo, int quality, wxjpeg_boolean force_baseline) -/* Set or change the 'quality' (quantization) setting, using default tables. - * This is the standard quality-adjusting entry point for typical user - * interfaces; only those who want detailed control over quantization tables - * would use the preceding three routines directly. - */ -{ - /* Convert user 0-100 rating to percentage scaling */ - quality = jpeg_quality_scaling(quality); - - /* Set up standard quality tables */ - jpeg_set_linear_quality(cinfo, quality, force_baseline); -} - - -/* - * Huffman table setup routines - */ - -LOCAL(void) -add_huff_table (j_compress_ptr cinfo, - JHUFF_TBL **htblptr, const UINT8 *bits, const UINT8 *val) -/* Define a Huffman table */ -{ - int nsymbols, len; - - if (*htblptr == NULL) - *htblptr = jpeg_alloc_huff_table((j_common_ptr) cinfo); - - /* Copy the number-of-symbols-of-each-code-length counts */ - MEMCOPY((*htblptr)->bits, bits, SIZEOF((*htblptr)->bits)); - - /* Validate the counts. We do this here mainly so we can copy the right - * number of symbols from the val[] array, without risking marching off - * the end of memory. jchuff.c will do a more thorough test later. - */ - nsymbols = 0; - for (len = 1; len <= 16; len++) - nsymbols += bits[len]; - if (nsymbols < 1 || nsymbols > 256) - ERREXIT(cinfo, JERR_BAD_HUFF_TABLE); - - MEMCOPY((*htblptr)->huffval, val, nsymbols * SIZEOF(UINT8)); - - /* Initialize sent_table FALSE so table will be written to JPEG file. */ - (*htblptr)->sent_table = FALSE; -} - - -LOCAL(void) -std_huff_tables (j_compress_ptr cinfo) -/* Set up the standard Huffman tables (cf. JPEG standard section K.3) */ -/* IMPORTANT: these are only valid for 8-bit data precision! */ -{ - static const UINT8 bits_dc_luminance[17] = - { /* 0-base */ 0, 0, 1, 5, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0 }; - static const UINT8 val_dc_luminance[] = - { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 }; - - static const UINT8 bits_dc_chrominance[17] = - { /* 0-base */ 0, 0, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0 }; - static const UINT8 val_dc_chrominance[] = - { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 }; - - static const UINT8 bits_ac_luminance[17] = - { /* 0-base */ 0, 0, 2, 1, 3, 3, 2, 4, 3, 5, 5, 4, 4, 0, 0, 1, 0x7d }; - static const UINT8 val_ac_luminance[] = - { 0x01, 0x02, 0x03, 0x00, 0x04, 0x11, 0x05, 0x12, - 0x21, 0x31, 0x41, 0x06, 0x13, 0x51, 0x61, 0x07, - 0x22, 0x71, 0x14, 0x32, 0x81, 0x91, 0xa1, 0x08, - 0x23, 0x42, 0xb1, 0xc1, 0x15, 0x52, 0xd1, 0xf0, - 0x24, 0x33, 0x62, 0x72, 0x82, 0x09, 0x0a, 0x16, - 0x17, 0x18, 0x19, 0x1a, 0x25, 0x26, 0x27, 0x28, - 0x29, 0x2a, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, - 0x3a, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, - 0x4a, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, - 0x5a, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, - 0x6a, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, - 0x7a, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, - 0x8a, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, - 0x99, 0x9a, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, - 0xa8, 0xa9, 0xaa, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, - 0xb7, 0xb8, 0xb9, 0xba, 0xc2, 0xc3, 0xc4, 0xc5, - 0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xd2, 0xd3, 0xd4, - 0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda, 0xe1, 0xe2, - 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, 0xea, - 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, - 0xf9, 0xfa }; - - static const UINT8 bits_ac_chrominance[17] = - { /* 0-base */ 0, 0, 2, 1, 2, 4, 4, 3, 4, 7, 5, 4, 4, 0, 1, 2, 0x77 }; - static const UINT8 val_ac_chrominance[] = - { 0x00, 0x01, 0x02, 0x03, 0x11, 0x04, 0x05, 0x21, - 0x31, 0x06, 0x12, 0x41, 0x51, 0x07, 0x61, 0x71, - 0x13, 0x22, 0x32, 0x81, 0x08, 0x14, 0x42, 0x91, - 0xa1, 0xb1, 0xc1, 0x09, 0x23, 0x33, 0x52, 0xf0, - 0x15, 0x62, 0x72, 0xd1, 0x0a, 0x16, 0x24, 0x34, - 0xe1, 0x25, 0xf1, 0x17, 0x18, 0x19, 0x1a, 0x26, - 0x27, 0x28, 0x29, 0x2a, 0x35, 0x36, 0x37, 0x38, - 0x39, 0x3a, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, - 0x49, 0x4a, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, - 0x59, 0x5a, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, - 0x69, 0x6a, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, - 0x79, 0x7a, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, - 0x88, 0x89, 0x8a, 0x92, 0x93, 0x94, 0x95, 0x96, - 0x97, 0x98, 0x99, 0x9a, 0xa2, 0xa3, 0xa4, 0xa5, - 0xa6, 0xa7, 0xa8, 0xa9, 0xaa, 0xb2, 0xb3, 0xb4, - 0xb5, 0xb6, 0xb7, 0xb8, 0xb9, 0xba, 0xc2, 0xc3, - 0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xd2, - 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda, - 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, - 0xea, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, - 0xf9, 0xfa }; - - add_huff_table(cinfo, &cinfo->dc_huff_tbl_ptrs[0], - bits_dc_luminance, val_dc_luminance); - add_huff_table(cinfo, &cinfo->ac_huff_tbl_ptrs[0], - bits_ac_luminance, val_ac_luminance); - add_huff_table(cinfo, &cinfo->dc_huff_tbl_ptrs[1], - bits_dc_chrominance, val_dc_chrominance); - add_huff_table(cinfo, &cinfo->ac_huff_tbl_ptrs[1], - bits_ac_chrominance, val_ac_chrominance); -} - - -/* - * Default parameter setup for compression. - * - * Applications that don't choose to use this routine must do their - * own setup of all these parameters. Alternately, you can call this - * to establish defaults and then alter parameters selectively. This - * is the recommended approach since, if we add any new parameters, - * your code will still work (they'll be set to reasonable defaults). - */ - -GLOBAL(void) -jpeg_set_defaults (j_compress_ptr cinfo) -{ - int i; - - /* Safety check to ensure start_compress not called yet. */ - if (cinfo->global_state != CSTATE_START) - ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state); - - /* Allocate comp_info array large enough for maximum component count. - * Array is made permanent in case application wants to compress - * multiple images at same param settings. - */ - if (cinfo->comp_info == NULL) - cinfo->comp_info = (jpeg_component_info *) - (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT, - MAX_COMPONENTS * SIZEOF(jpeg_component_info)); - - /* Initialize everything not dependent on the color space */ - - cinfo->data_precision = BITS_IN_JSAMPLE; - /* Set up two quantization tables using default quality of 75 */ - jpeg_set_quality(cinfo, 75, TRUE); - /* Set up two Huffman tables */ - std_huff_tables(cinfo); - - /* Initialize default arithmetic coding conditioning */ - for (i = 0; i < NUM_ARITH_TBLS; i++) { - cinfo->arith_dc_L[i] = 0; - cinfo->arith_dc_U[i] = 1; - cinfo->arith_ac_K[i] = 5; - } - - /* Default is no multiple-scan output */ - cinfo->scan_info = NULL; - cinfo->num_scans = 0; - - /* Expect normal source image, not raw downsampled data */ - cinfo->raw_data_in = FALSE; - - /* Use Huffman coding, not arithmetic coding, by default */ - cinfo->arith_code = FALSE; - - /* By default, don't do extra passes to optimize entropy coding */ - cinfo->optimize_coding = FALSE; - /* The standard Huffman tables are only valid for 8-bit data precision. - * If the precision is higher, force optimization on so that usable - * tables will be computed. This test can be removed if default tables - * are supplied that are valid for the desired precision. - */ - if (cinfo->data_precision > 8) - cinfo->optimize_coding = TRUE; - - /* By default, use the simpler non-cosited sampling alignment */ - cinfo->CCIR601_sampling = FALSE; - - /* No input smoothing */ - cinfo->smoothing_factor = 0; - - /* DCT algorithm preference */ - cinfo->dct_method = JDCT_DEFAULT; - - /* No restart markers */ - cinfo->restart_interval = 0; - cinfo->restart_in_rows = 0; - - /* Fill in default JFIF marker parameters. Note that whether the marker - * will actually be written is determined by jpeg_set_colorspace. - * - * By default, the library emits JFIF version code 1.01. - * An application that wants to emit JFIF 1.02 extension markers should set - * JFIF_minor_version to 2. We could probably get away with just defaulting - * to 1.02, but there may still be some decoders in use that will complain - * about that; saying 1.01 should minimize compatibility problems. - */ - cinfo->JFIF_major_version = 1; /* Default JFIF version = 1.01 */ - cinfo->JFIF_minor_version = 1; - cinfo->density_unit = 0; /* Pixel size is unknown by default */ - cinfo->X_density = 1; /* Pixel aspect ratio is square by default */ - cinfo->Y_density = 1; - - /* Choose JPEG colorspace based on input space, set defaults accordingly */ - - jpeg_default_colorspace(cinfo); -} - - -/* - * Select an appropriate JPEG colorspace for in_color_space. - */ - -GLOBAL(void) -jpeg_default_colorspace (j_compress_ptr cinfo) -{ - switch (cinfo->in_color_space) { - case JCS_GRAYSCALE: - jpeg_set_colorspace(cinfo, JCS_GRAYSCALE); - break; - case JCS_RGB: - jpeg_set_colorspace(cinfo, JCS_YCbCr); - break; - case JCS_YCbCr: - jpeg_set_colorspace(cinfo, JCS_YCbCr); - break; - case JCS_CMYK: - jpeg_set_colorspace(cinfo, JCS_CMYK); /* By default, no translation */ - break; - case JCS_YCCK: - jpeg_set_colorspace(cinfo, JCS_YCCK); - break; - case JCS_UNKNOWN: - jpeg_set_colorspace(cinfo, JCS_UNKNOWN); - break; - default: - ERREXIT(cinfo, JERR_BAD_IN_COLORSPACE); - } -} - - -/* - * Set the JPEG colorspace, and choose colorspace-dependent default values. - */ - -GLOBAL(void) -jpeg_set_colorspace (j_compress_ptr cinfo, J_COLOR_SPACE colorspace) -{ - jpeg_component_info * compptr; - int ci; - -#define SET_COMP(index,id,hsamp,vsamp,quant,dctbl,actbl) \ - (compptr = &cinfo->comp_info[index], \ - compptr->component_id = (id), \ - compptr->h_samp_factor = (hsamp), \ - compptr->v_samp_factor = (vsamp), \ - compptr->quant_tbl_no = (quant), \ - compptr->dc_tbl_no = (dctbl), \ - compptr->ac_tbl_no = (actbl) ) - - /* Safety check to ensure start_compress not called yet. */ - if (cinfo->global_state != CSTATE_START) - ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state); - - /* For all colorspaces, we use Q and Huff tables 0 for luminance components, - * tables 1 for chrominance components. - */ - - cinfo->jpeg_color_space = colorspace; - - cinfo->write_JFIF_header = FALSE; /* No marker for non-JFIF colorspaces */ - cinfo->write_Adobe_marker = FALSE; /* write no Adobe marker by default */ - - switch (colorspace) { - case JCS_GRAYSCALE: - cinfo->write_JFIF_header = TRUE; /* Write a JFIF marker */ - cinfo->num_components = 1; - /* JFIF specifies component ID 1 */ - SET_COMP(0, 1, 1,1, 0, 0,0); - break; - case JCS_RGB: - cinfo->write_Adobe_marker = TRUE; /* write Adobe marker to flag RGB */ - cinfo->num_components = 3; - SET_COMP(0, 0x52 /* 'R' */, 1,1, 0, 0,0); - SET_COMP(1, 0x47 /* 'G' */, 1,1, 0, 0,0); - SET_COMP(2, 0x42 /* 'B' */, 1,1, 0, 0,0); - break; - case JCS_YCbCr: - cinfo->write_JFIF_header = TRUE; /* Write a JFIF marker */ - cinfo->num_components = 3; - /* JFIF specifies component IDs 1,2,3 */ - /* We default to 2x2 subsamples of chrominance */ - SET_COMP(0, 1, 2,2, 0, 0,0); - SET_COMP(1, 2, 1,1, 1, 1,1); - SET_COMP(2, 3, 1,1, 1, 1,1); - break; - case JCS_CMYK: - cinfo->write_Adobe_marker = TRUE; /* write Adobe marker to flag CMYK */ - cinfo->num_components = 4; - SET_COMP(0, 0x43 /* 'C' */, 1,1, 0, 0,0); - SET_COMP(1, 0x4D /* 'M' */, 1,1, 0, 0,0); - SET_COMP(2, 0x59 /* 'Y' */, 1,1, 0, 0,0); - SET_COMP(3, 0x4B /* 'K' */, 1,1, 0, 0,0); - break; - case JCS_YCCK: - cinfo->write_Adobe_marker = TRUE; /* write Adobe marker to flag YCCK */ - cinfo->num_components = 4; - SET_COMP(0, 1, 2,2, 0, 0,0); - SET_COMP(1, 2, 1,1, 1, 1,1); - SET_COMP(2, 3, 1,1, 1, 1,1); - SET_COMP(3, 4, 2,2, 0, 0,0); - break; - case JCS_UNKNOWN: - cinfo->num_components = cinfo->input_components; - if (cinfo->num_components < 1 || cinfo->num_components > MAX_COMPONENTS) - ERREXIT2(cinfo, JERR_COMPONENT_COUNT, cinfo->num_components, - MAX_COMPONENTS); - for (ci = 0; ci < cinfo->num_components; ci++) { - SET_COMP(ci, ci, 1,1, 0, 0,0); - } - break; - default: - ERREXIT(cinfo, JERR_BAD_J_COLORSPACE); - } -} - - -#ifdef C_PROGRESSIVE_SUPPORTED - -LOCAL(jpeg_scan_info *) -fill_a_scan (jpeg_scan_info * scanptr, int ci, - int Ss, int Se, int Ah, int Al) -/* Support routine: generate one scan for specified component */ -{ - scanptr->comps_in_scan = 1; - scanptr->component_index[0] = ci; - scanptr->Ss = Ss; - scanptr->Se = Se; - scanptr->Ah = Ah; - scanptr->Al = Al; - scanptr++; - return scanptr; -} - -LOCAL(jpeg_scan_info *) -fill_scans (jpeg_scan_info * scanptr, int ncomps, - int Ss, int Se, int Ah, int Al) -/* Support routine: generate one scan for each component */ -{ - int ci; - - for (ci = 0; ci < ncomps; ci++) { - scanptr->comps_in_scan = 1; - scanptr->component_index[0] = ci; - scanptr->Ss = Ss; - scanptr->Se = Se; - scanptr->Ah = Ah; - scanptr->Al = Al; - scanptr++; - } - return scanptr; -} - -LOCAL(jpeg_scan_info *) -fill_dc_scans (jpeg_scan_info * scanptr, int ncomps, int Ah, int Al) -/* Support routine: generate interleaved DC scan if possible, else N scans */ -{ - int ci; - - if (ncomps <= MAX_COMPS_IN_SCAN) { - /* Single interleaved DC scan */ - scanptr->comps_in_scan = ncomps; - for (ci = 0; ci < ncomps; ci++) - scanptr->component_index[ci] = ci; - scanptr->Ss = scanptr->Se = 0; - scanptr->Ah = Ah; - scanptr->Al = Al; - scanptr++; - } else { - /* Noninterleaved DC scan for each component */ - scanptr = fill_scans(scanptr, ncomps, 0, 0, Ah, Al); - } - return scanptr; -} - - -/* - * Create a recommended progressive-JPEG script. - * cinfo->num_components and cinfo->jpeg_color_space must be correct. - */ - -GLOBAL(void) -jpeg_simple_progression (j_compress_ptr cinfo) -{ - int ncomps = cinfo->num_components; - int nscans; - jpeg_scan_info * scanptr; - - /* Safety check to ensure start_compress not called yet. */ - if (cinfo->global_state != CSTATE_START) - ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state); - - /* Figure space needed for script. Calculation must match code below! */ - if (ncomps == 3 && cinfo->jpeg_color_space == JCS_YCbCr) { - /* Custom script for YCbCr color images. */ - nscans = 10; - } else { - /* All-purpose script for other color spaces. */ - if (ncomps > MAX_COMPS_IN_SCAN) - nscans = 6 * ncomps; /* 2 DC + 4 AC scans per component */ - else - nscans = 2 + 4 * ncomps; /* 2 DC scans; 4 AC scans per component */ - } - - /* Allocate space for script. - * We need to put it in the permanent pool in case the application performs - * multiple compressions without changing the settings. To avoid a memory - * leak if jpeg_simple_progression is called repeatedly for the same JPEG - * object, we try to re-use previously allocated space, and we allocate - * enough space to handle YCbCr even if initially asked for grayscale. - */ - if (cinfo->script_space == NULL || cinfo->script_space_size < nscans) { - cinfo->script_space_size = MAX(nscans, 10); - cinfo->script_space = (jpeg_scan_info *) - (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT, - cinfo->script_space_size * SIZEOF(jpeg_scan_info)); - } - scanptr = cinfo->script_space; - cinfo->scan_info = scanptr; - cinfo->num_scans = nscans; - - if (ncomps == 3 && cinfo->jpeg_color_space == JCS_YCbCr) { - /* Custom script for YCbCr color images. */ - /* Initial DC scan */ - scanptr = fill_dc_scans(scanptr, ncomps, 0, 1); - /* Initial AC scan: get some luma data out in a hurry */ - scanptr = fill_a_scan(scanptr, 0, 1, 5, 0, 2); - /* Chroma data is too small to be worth expending many scans on */ - scanptr = fill_a_scan(scanptr, 2, 1, 63, 0, 1); - scanptr = fill_a_scan(scanptr, 1, 1, 63, 0, 1); - /* Complete spectral selection for luma AC */ - scanptr = fill_a_scan(scanptr, 0, 6, 63, 0, 2); - /* Refine next bit of luma AC */ - scanptr = fill_a_scan(scanptr, 0, 1, 63, 2, 1); - /* Finish DC successive approximation */ - scanptr = fill_dc_scans(scanptr, ncomps, 1, 0); - /* Finish AC successive approximation */ - scanptr = fill_a_scan(scanptr, 2, 1, 63, 1, 0); - scanptr = fill_a_scan(scanptr, 1, 1, 63, 1, 0); - /* Luma bottom bit comes last since it's usually largest scan */ - scanptr = fill_a_scan(scanptr, 0, 1, 63, 1, 0); - } else { - /* All-purpose script for other color spaces. */ - /* Successive approximation first pass */ - scanptr = fill_dc_scans(scanptr, ncomps, 0, 1); - scanptr = fill_scans(scanptr, ncomps, 1, 5, 0, 2); - scanptr = fill_scans(scanptr, ncomps, 6, 63, 0, 2); - /* Successive approximation second pass */ - scanptr = fill_scans(scanptr, ncomps, 1, 63, 2, 1); - /* Successive approximation final pass */ - scanptr = fill_dc_scans(scanptr, ncomps, 1, 0); - scanptr = fill_scans(scanptr, ncomps, 1, 63, 1, 0); - } -} - -#endif /* C_PROGRESSIVE_SUPPORTED */ diff --git a/wxWidgets/src/jpeg/jcphuff.c b/wxWidgets/src/jpeg/jcphuff.c deleted file mode 100644 index 84e53f4032..0000000000 --- a/wxWidgets/src/jpeg/jcphuff.c +++ /dev/null @@ -1,833 +0,0 @@ -/* - * jcphuff.c - * - * Copyright (C) 1995-1997, Thomas G. Lane. - * This file is part of the Independent JPEG Group's software. - * For conditions of distribution and use, see the accompanying README file. - * - * This file contains Huffman entropy encoding routines for progressive JPEG. - * - * We do not support output suspension in this module, since the library - * currently does not allow multiple-scan files to be written with output - * suspension. - */ - -#define JPEG_INTERNALS -#include "jinclude.h" -#include "jpeglib.h" -#include "jchuff.h" /* Declarations shared with jchuff.c */ - -#ifdef C_PROGRESSIVE_SUPPORTED - -/* Expanded entropy encoder object for progressive Huffman encoding. */ - -typedef struct { - struct jpeg_entropy_encoder pub; /* public fields */ - - /* Mode flag: TRUE for optimization, FALSE for actual data output */ - wxjpeg_boolean gather_statistics; - - /* Bit-level coding status. - * next_output_byte/free_in_buffer are local copies of cinfo->dest fields. - */ - JOCTET * next_output_byte; /* => next byte to write in buffer */ - size_t free_in_buffer; /* # of byte spaces remaining in buffer */ - JPEG_INT32 put_buffer; /* current bit-accumulation buffer */ - int put_bits; /* # of bits now in it */ - j_compress_ptr cinfo; /* link to cinfo (needed for dump_buffer) */ - - /* Coding status for DC components */ - int last_dc_val[MAX_COMPS_IN_SCAN]; /* last DC coef for each component */ - - /* Coding status for AC components */ - int ac_tbl_no; /* the table number of the single component */ - unsigned int EOBRUN; /* run length of EOBs */ - unsigned int BE; /* # of buffered correction bits before MCU */ - char * bit_buffer; /* buffer for correction bits (1 per char) */ - /* packing correction bits tightly would save some space but cost time... */ - - unsigned int restarts_to_go; /* MCUs left in this restart interval */ - int next_restart_num; /* next restart number to write (0-7) */ - - /* Pointers to derived tables (these workspaces have image lifespan). - * Since any one scan codes only DC or only AC, we only need one set - * of tables, not one for DC and one for AC. - */ - c_derived_tbl * derived_tbls[NUM_HUFF_TBLS]; - - /* Statistics tables for optimization; again, one set is enough */ - long * count_ptrs[NUM_HUFF_TBLS]; -} phuff_entropy_encoder; - -typedef phuff_entropy_encoder * phuff_entropy_ptr; - -/* MAX_CORR_BITS is the number of bits the AC refinement correction-bit - * buffer can hold. Larger sizes may slightly improve compression, but - * 1000 is already well into the realm of overkill. - * The minimum safe size is 64 bits. - */ - -#define MAX_CORR_BITS 1000 /* Max # of correction bits I can buffer */ - -/* IRIGHT_SHIFT is like RIGHT_SHIFT, but works on int rather than INT32. - * We assume that int right shift is unsigned if INT32 right shift is, - * which should be safe. - */ - -#ifdef RIGHT_SHIFT_IS_UNSIGNED -#define ISHIFT_TEMPS int ishift_temp; -#define IRIGHT_SHIFT(x,shft) \ - ((ishift_temp = (x)) < 0 ? \ - (ishift_temp >> (shft)) | ((~0) << (16-(shft))) : \ - (ishift_temp >> (shft))) -#else -#define ISHIFT_TEMPS -#define IRIGHT_SHIFT(x,shft) ((x) >> (shft)) -#endif - -/* Forward declarations */ -METHODDEF(wxjpeg_boolean) encode_mcu_DC_first JPP((j_compress_ptr cinfo, - JBLOCKROW *MCU_data)); -METHODDEF(wxjpeg_boolean) encode_mcu_AC_first JPP((j_compress_ptr cinfo, - JBLOCKROW *MCU_data)); -METHODDEF(wxjpeg_boolean) encode_mcu_DC_refine JPP((j_compress_ptr cinfo, - JBLOCKROW *MCU_data)); -METHODDEF(wxjpeg_boolean) encode_mcu_AC_refine JPP((j_compress_ptr cinfo, - JBLOCKROW *MCU_data)); -METHODDEF(void) finish_pass_phuff JPP((j_compress_ptr cinfo)); -METHODDEF(void) finish_pass_gather_phuff JPP((j_compress_ptr cinfo)); - - -/* - * Initialize for a Huffman-compressed scan using progressive JPEG. - */ - -METHODDEF(void) -start_pass_phuff (j_compress_ptr cinfo, wxjpeg_boolean gather_statistics) -{ - phuff_entropy_ptr entropy = (phuff_entropy_ptr) cinfo->entropy; - wxjpeg_boolean is_DC_band; - int ci, tbl; - jpeg_component_info * compptr; - - entropy->cinfo = cinfo; - entropy->gather_statistics = gather_statistics; - - is_DC_band = (cinfo->Ss == 0); - - /* We assume jcmaster.c already validated the scan parameters. */ - - /* Select execution routines */ - if (cinfo->Ah == 0) { - if (is_DC_band) - entropy->pub.encode_mcu = encode_mcu_DC_first; - else - entropy->pub.encode_mcu = encode_mcu_AC_first; - } else { - if (is_DC_band) - entropy->pub.encode_mcu = encode_mcu_DC_refine; - else { - entropy->pub.encode_mcu = encode_mcu_AC_refine; - /* AC refinement needs a correction bit buffer */ - if (entropy->bit_buffer == NULL) - entropy->bit_buffer = (char *) - (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, - MAX_CORR_BITS * SIZEOF(char)); - } - } - if (gather_statistics) - entropy->pub.finish_pass = finish_pass_gather_phuff; - else - entropy->pub.finish_pass = finish_pass_phuff; - - /* Only DC coefficients may be interleaved, so cinfo->comps_in_scan = 1 - * for AC coefficients. - */ - for (ci = 0; ci < cinfo->comps_in_scan; ci++) { - compptr = cinfo->cur_comp_info[ci]; - /* Initialize DC predictions to 0 */ - entropy->last_dc_val[ci] = 0; - /* Get table index */ - if (is_DC_band) { - if (cinfo->Ah != 0) /* DC refinement needs no table */ - continue; - tbl = compptr->dc_tbl_no; - } else { - entropy->ac_tbl_no = tbl = compptr->ac_tbl_no; - } - if (gather_statistics) { - /* Check for invalid table index */ - /* (make_c_derived_tbl does this in the other path) */ - if (tbl < 0 || tbl >= NUM_HUFF_TBLS) - ERREXIT1(cinfo, JERR_NO_HUFF_TABLE, tbl); - /* Allocate and zero the statistics tables */ - /* Note that jpeg_gen_optimal_table expects 257 entries in each table! */ - if (entropy->count_ptrs[tbl] == NULL) - entropy->count_ptrs[tbl] = (long *) - (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, - 257 * SIZEOF(long)); - MEMZERO(entropy->count_ptrs[tbl], 257 * SIZEOF(long)); - } else { - /* Compute derived values for Huffman table */ - /* We may do this more than once for a table, but it's not expensive */ - jpeg_make_c_derived_tbl(cinfo, is_DC_band, tbl, - & entropy->derived_tbls[tbl]); - } - } - - /* Initialize AC stuff */ - entropy->EOBRUN = 0; - entropy->BE = 0; - - /* Initialize bit buffer to empty */ - entropy->put_buffer = 0; - entropy->put_bits = 0; - - /* Initialize restart stuff */ - entropy->restarts_to_go = cinfo->restart_interval; - entropy->next_restart_num = 0; -} - - -/* Outputting bytes to the file. - * NB: these must be called only when actually outputting, - * that is, entropy->gather_statistics == FALSE. - */ - -/* Emit a byte */ -#define emit_byte(entropy,val) \ - { *(entropy)->next_output_byte++ = (JOCTET) (val); \ - if (--(entropy)->free_in_buffer == 0) \ - dump_buffer(entropy); } - - -LOCAL(void) -dump_buffer (phuff_entropy_ptr entropy) -/* Empty the output buffer; we do not support suspension in this module. */ -{ - struct jpeg_destination_mgr * dest = entropy->cinfo->dest; - - if (! (*dest->empty_output_buffer) (entropy->cinfo)) - ERREXIT(entropy->cinfo, JERR_CANT_SUSPEND); - /* After a successful buffer dump, must reset buffer pointers */ - entropy->next_output_byte = dest->next_output_byte; - entropy->free_in_buffer = dest->free_in_buffer; -} - - -/* Outputting bits to the file */ - -/* Only the right 24 bits of put_buffer are used; the valid bits are - * left-justified in this part. At most 16 bits can be passed to emit_bits - * in one call, and we never retain more than 7 bits in put_buffer - * between calls, so 24 bits are sufficient. - */ - -INLINE -LOCAL(void) -emit_bits (phuff_entropy_ptr entropy, unsigned int code, int size) -/* Emit some bits, unless we are in gather mode */ -{ - /* This routine is heavily used, so it's worth coding tightly. */ - register JPEG_INT32 put_buffer = (JPEG_INT32) code; - register int put_bits = entropy->put_bits; - - /* if size is 0, caller used an invalid Huffman table entry */ - if (size == 0) - ERREXIT(entropy->cinfo, JERR_HUFF_MISSING_CODE); - - if (entropy->gather_statistics) - return; /* do nothing if we're only getting stats */ - - put_buffer &= (((JPEG_INT32) 1)<put_buffer; /* and merge with old buffer contents */ - - while (put_bits >= 8) { - int c = (int) ((put_buffer >> 16) & 0xFF); - - emit_byte(entropy, c); - if (c == 0xFF) { /* need to stuff a zero byte? */ - emit_byte(entropy, 0); - } - put_buffer <<= 8; - put_bits -= 8; - } - - entropy->put_buffer = put_buffer; /* update variables */ - entropy->put_bits = put_bits; -} - - -LOCAL(void) -flush_bits (phuff_entropy_ptr entropy) -{ - emit_bits(entropy, 0x7F, 7); /* fill any partial byte with ones */ - entropy->put_buffer = 0; /* and reset bit-buffer to empty */ - entropy->put_bits = 0; -} - - -/* - * Emit (or just count) a Huffman symbol. - */ - -INLINE -LOCAL(void) -emit_symbol (phuff_entropy_ptr entropy, int tbl_no, int symbol) -{ - if (entropy->gather_statistics) - entropy->count_ptrs[tbl_no][symbol]++; - else { - c_derived_tbl * tbl = entropy->derived_tbls[tbl_no]; - emit_bits(entropy, tbl->ehufco[symbol], tbl->ehufsi[symbol]); - } -} - - -/* - * Emit bits from a correction bit buffer. - */ - -LOCAL(void) -emit_buffered_bits (phuff_entropy_ptr entropy, char * bufstart, - unsigned int nbits) -{ - if (entropy->gather_statistics) - return; /* no real work */ - - while (nbits > 0) { - emit_bits(entropy, (unsigned int) (*bufstart), 1); - bufstart++; - nbits--; - } -} - - -/* - * Emit any pending EOBRUN symbol. - */ - -LOCAL(void) -emit_eobrun (phuff_entropy_ptr entropy) -{ - register int temp, nbits; - - if (entropy->EOBRUN > 0) { /* if there is any pending EOBRUN */ - temp = entropy->EOBRUN; - nbits = 0; - while ((temp >>= 1)) - nbits++; - /* safety check: shouldn't happen given limited correction-bit buffer */ - if (nbits > 14) - ERREXIT(entropy->cinfo, JERR_HUFF_MISSING_CODE); - - emit_symbol(entropy, entropy->ac_tbl_no, nbits << 4); - if (nbits) - emit_bits(entropy, entropy->EOBRUN, nbits); - - entropy->EOBRUN = 0; - - /* Emit any buffered correction bits */ - emit_buffered_bits(entropy, entropy->bit_buffer, entropy->BE); - entropy->BE = 0; - } -} - - -/* - * Emit a restart marker & resynchronize predictions. - */ - -LOCAL(void) -emit_restart (phuff_entropy_ptr entropy, int restart_num) -{ - int ci; - - emit_eobrun(entropy); - - if (! entropy->gather_statistics) { - flush_bits(entropy); - emit_byte(entropy, 0xFF); - emit_byte(entropy, JPEG_RST0 + restart_num); - } - - if (entropy->cinfo->Ss == 0) { - /* Re-initialize DC predictions to 0 */ - for (ci = 0; ci < entropy->cinfo->comps_in_scan; ci++) - entropy->last_dc_val[ci] = 0; - } else { - /* Re-initialize all AC-related fields to 0 */ - entropy->EOBRUN = 0; - entropy->BE = 0; - } -} - - -/* - * MCU encoding for DC initial scan (either spectral selection, - * or first pass of successive approximation). - */ - -METHODDEF(wxjpeg_boolean) -encode_mcu_DC_first (j_compress_ptr cinfo, JBLOCKROW *MCU_data) -{ - phuff_entropy_ptr entropy = (phuff_entropy_ptr) cinfo->entropy; - register int temp, temp2; - register int nbits; - int blkn, ci; - int Al = cinfo->Al; - JBLOCKROW block; - jpeg_component_info * compptr; - ISHIFT_TEMPS - - entropy->next_output_byte = cinfo->dest->next_output_byte; - entropy->free_in_buffer = cinfo->dest->free_in_buffer; - - /* Emit restart marker if needed */ - if (cinfo->restart_interval) - if (entropy->restarts_to_go == 0) - emit_restart(entropy, entropy->next_restart_num); - - /* Encode the MCU data blocks */ - for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) { - block = MCU_data[blkn]; - ci = cinfo->MCU_membership[blkn]; - compptr = cinfo->cur_comp_info[ci]; - - /* Compute the DC value after the required point transform by Al. - * This is simply an arithmetic right shift. - */ - temp2 = IRIGHT_SHIFT((int) ((*block)[0]), Al); - - /* DC differences are figured on the point-transformed values. */ - temp = temp2 - entropy->last_dc_val[ci]; - entropy->last_dc_val[ci] = temp2; - - /* Encode the DC coefficient difference per section G.1.2.1 */ - temp2 = temp; - if (temp < 0) { - temp = -temp; /* temp is abs value of input */ - /* For a negative input, want temp2 = bitwise complement of abs(input) */ - /* This code assumes we are on a two's complement machine */ - temp2--; - } - - /* Find the number of bits needed for the magnitude of the coefficient */ - nbits = 0; - while (temp) { - nbits++; - temp >>= 1; - } - /* Check for out-of-range coefficient values. - * Since we're encoding a difference, the range limit is twice as much. - */ - if (nbits > MAX_COEF_BITS+1) - ERREXIT(cinfo, JERR_BAD_DCT_COEF); - - /* Count/emit the Huffman-coded symbol for the number of bits */ - emit_symbol(entropy, compptr->dc_tbl_no, nbits); - - /* Emit that number of bits of the value, if positive, */ - /* or the complement of its magnitude, if negative. */ - if (nbits) /* emit_bits rejects calls with size 0 */ - emit_bits(entropy, (unsigned int) temp2, nbits); - } - - cinfo->dest->next_output_byte = entropy->next_output_byte; - cinfo->dest->free_in_buffer = entropy->free_in_buffer; - - /* Update restart-interval state too */ - if (cinfo->restart_interval) { - if (entropy->restarts_to_go == 0) { - entropy->restarts_to_go = cinfo->restart_interval; - entropy->next_restart_num++; - entropy->next_restart_num &= 7; - } - entropy->restarts_to_go--; - } - - return TRUE; -} - - -/* - * MCU encoding for AC initial scan (either spectral selection, - * or first pass of successive approximation). - */ - -METHODDEF(wxjpeg_boolean) -encode_mcu_AC_first (j_compress_ptr cinfo, JBLOCKROW *MCU_data) -{ - phuff_entropy_ptr entropy = (phuff_entropy_ptr) cinfo->entropy; - register int temp, temp2; - register int nbits; - register int r, k; - int Se = cinfo->Se; - int Al = cinfo->Al; - JBLOCKROW block; - - entropy->next_output_byte = cinfo->dest->next_output_byte; - entropy->free_in_buffer = cinfo->dest->free_in_buffer; - - /* Emit restart marker if needed */ - if (cinfo->restart_interval) - if (entropy->restarts_to_go == 0) - emit_restart(entropy, entropy->next_restart_num); - - /* Encode the MCU data block */ - block = MCU_data[0]; - - /* Encode the AC coefficients per section G.1.2.2, fig. G.3 */ - - r = 0; /* r = run length of zeros */ - - for (k = cinfo->Ss; k <= Se; k++) { - if ((temp = (*block)[jpeg_natural_order[k]]) == 0) { - r++; - continue; - } - /* We must apply the point transform by Al. For AC coefficients this - * is an integer division with rounding towards 0. To do this portably - * in C, we shift after obtaining the absolute value; so the code is - * interwoven with finding the abs value (temp) and output bits (temp2). - */ - if (temp < 0) { - temp = -temp; /* temp is abs value of input */ - temp >>= Al; /* apply the point transform */ - /* For a negative coef, want temp2 = bitwise complement of abs(coef) */ - temp2 = ~temp; - } else { - temp >>= Al; /* apply the point transform */ - temp2 = temp; - } - /* Watch out for case that nonzero coef is zero after point transform */ - if (temp == 0) { - r++; - continue; - } - - /* Emit any pending EOBRUN */ - if (entropy->EOBRUN > 0) - emit_eobrun(entropy); - /* if run length > 15, must emit special run-length-16 codes (0xF0) */ - while (r > 15) { - emit_symbol(entropy, entropy->ac_tbl_no, 0xF0); - r -= 16; - } - - /* Find the number of bits needed for the magnitude of the coefficient */ - nbits = 1; /* there must be at least one 1 bit */ - while ((temp >>= 1)) - nbits++; - /* Check for out-of-range coefficient values */ - if (nbits > MAX_COEF_BITS) - ERREXIT(cinfo, JERR_BAD_DCT_COEF); - - /* Count/emit Huffman symbol for run length / number of bits */ - emit_symbol(entropy, entropy->ac_tbl_no, (r << 4) + nbits); - - /* Emit that number of bits of the value, if positive, */ - /* or the complement of its magnitude, if negative. */ - emit_bits(entropy, (unsigned int) temp2, nbits); - - r = 0; /* reset zero run length */ - } - - if (r > 0) { /* If there are trailing zeroes, */ - entropy->EOBRUN++; /* count an EOB */ - if (entropy->EOBRUN == 0x7FFF) - emit_eobrun(entropy); /* force it out to avoid overflow */ - } - - cinfo->dest->next_output_byte = entropy->next_output_byte; - cinfo->dest->free_in_buffer = entropy->free_in_buffer; - - /* Update restart-interval state too */ - if (cinfo->restart_interval) { - if (entropy->restarts_to_go == 0) { - entropy->restarts_to_go = cinfo->restart_interval; - entropy->next_restart_num++; - entropy->next_restart_num &= 7; - } - entropy->restarts_to_go--; - } - - return TRUE; -} - - -/* - * MCU encoding for DC successive approximation refinement scan. - * Note: we assume such scans can be multi-component, although the spec - * is not very clear on the point. - */ - -METHODDEF(wxjpeg_boolean) -encode_mcu_DC_refine (j_compress_ptr cinfo, JBLOCKROW *MCU_data) -{ - phuff_entropy_ptr entropy = (phuff_entropy_ptr) cinfo->entropy; - register int temp; - int blkn; - int Al = cinfo->Al; - JBLOCKROW block; - - entropy->next_output_byte = cinfo->dest->next_output_byte; - entropy->free_in_buffer = cinfo->dest->free_in_buffer; - - /* Emit restart marker if needed */ - if (cinfo->restart_interval) - if (entropy->restarts_to_go == 0) - emit_restart(entropy, entropy->next_restart_num); - - /* Encode the MCU data blocks */ - for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) { - block = MCU_data[blkn]; - - /* We simply emit the Al'th bit of the DC coefficient value. */ - temp = (*block)[0]; - emit_bits(entropy, (unsigned int) (temp >> Al), 1); - } - - cinfo->dest->next_output_byte = entropy->next_output_byte; - cinfo->dest->free_in_buffer = entropy->free_in_buffer; - - /* Update restart-interval state too */ - if (cinfo->restart_interval) { - if (entropy->restarts_to_go == 0) { - entropy->restarts_to_go = cinfo->restart_interval; - entropy->next_restart_num++; - entropy->next_restart_num &= 7; - } - entropy->restarts_to_go--; - } - - return TRUE; -} - - -/* - * MCU encoding for AC successive approximation refinement scan. - */ - -METHODDEF(wxjpeg_boolean) -encode_mcu_AC_refine (j_compress_ptr cinfo, JBLOCKROW *MCU_data) -{ - phuff_entropy_ptr entropy = (phuff_entropy_ptr) cinfo->entropy; - register int temp; - register int r, k; - int EOB; - char *BR_buffer; - unsigned int BR; - int Se = cinfo->Se; - int Al = cinfo->Al; - JBLOCKROW block; - int absvalues[DCTSIZE2]; - - entropy->next_output_byte = cinfo->dest->next_output_byte; - entropy->free_in_buffer = cinfo->dest->free_in_buffer; - - /* Emit restart marker if needed */ - if (cinfo->restart_interval) - if (entropy->restarts_to_go == 0) - emit_restart(entropy, entropy->next_restart_num); - - /* Encode the MCU data block */ - block = MCU_data[0]; - - /* It is convenient to make a pre-pass to determine the transformed - * coefficients' absolute values and the EOB position. - */ - EOB = 0; - for (k = cinfo->Ss; k <= Se; k++) { - temp = (*block)[jpeg_natural_order[k]]; - /* We must apply the point transform by Al. For AC coefficients this - * is an integer division with rounding towards 0. To do this portably - * in C, we shift after obtaining the absolute value. - */ - if (temp < 0) - temp = -temp; /* temp is abs value of input */ - temp >>= Al; /* apply the point transform */ - absvalues[k] = temp; /* save abs value for main pass */ - if (temp == 1) - EOB = k; /* EOB = index of last newly-nonzero coef */ - } - - /* Encode the AC coefficients per section G.1.2.3, fig. G.7 */ - - r = 0; /* r = run length of zeros */ - BR = 0; /* BR = count of buffered bits added now */ - BR_buffer = entropy->bit_buffer + entropy->BE; /* Append bits to buffer */ - - for (k = cinfo->Ss; k <= Se; k++) { - if ((temp = absvalues[k]) == 0) { - r++; - continue; - } - - /* Emit any required ZRLs, but not if they can be folded into EOB */ - while (r > 15 && k <= EOB) { - /* emit any pending EOBRUN and the BE correction bits */ - emit_eobrun(entropy); - /* Emit ZRL */ - emit_symbol(entropy, entropy->ac_tbl_no, 0xF0); - r -= 16; - /* Emit buffered correction bits that must be associated with ZRL */ - emit_buffered_bits(entropy, BR_buffer, BR); - BR_buffer = entropy->bit_buffer; /* BE bits are gone now */ - BR = 0; - } - - /* If the coef was previously nonzero, it only needs a correction bit. - * NOTE: a straight translation of the spec's figure G.7 would suggest - * that we also need to test r > 15. But if r > 15, we can only get here - * if k > EOB, which implies that this coefficient is not 1. - */ - if (temp > 1) { - /* The correction bit is the next bit of the absolute value. */ - BR_buffer[BR++] = (char) (temp & 1); - continue; - } - - /* Emit any pending EOBRUN and the BE correction bits */ - emit_eobrun(entropy); - - /* Count/emit Huffman symbol for run length / number of bits */ - emit_symbol(entropy, entropy->ac_tbl_no, (r << 4) + 1); - - /* Emit output bit for newly-nonzero coef */ - temp = ((*block)[jpeg_natural_order[k]] < 0) ? 0 : 1; - emit_bits(entropy, (unsigned int) temp, 1); - - /* Emit buffered correction bits that must be associated with this code */ - emit_buffered_bits(entropy, BR_buffer, BR); - BR_buffer = entropy->bit_buffer; /* BE bits are gone now */ - BR = 0; - r = 0; /* reset zero run length */ - } - - if (r > 0 || BR > 0) { /* If there are trailing zeroes, */ - entropy->EOBRUN++; /* count an EOB */ - entropy->BE += BR; /* concat my correction bits to older ones */ - /* We force out the EOB if we risk either: - * 1. overflow of the EOB counter; - * 2. overflow of the correction bit buffer during the next MCU. - */ - if (entropy->EOBRUN == 0x7FFF || entropy->BE > (MAX_CORR_BITS-DCTSIZE2+1)) - emit_eobrun(entropy); - } - - cinfo->dest->next_output_byte = entropy->next_output_byte; - cinfo->dest->free_in_buffer = entropy->free_in_buffer; - - /* Update restart-interval state too */ - if (cinfo->restart_interval) { - if (entropy->restarts_to_go == 0) { - entropy->restarts_to_go = cinfo->restart_interval; - entropy->next_restart_num++; - entropy->next_restart_num &= 7; - } - entropy->restarts_to_go--; - } - - return TRUE; -} - - -/* - * Finish up at the end of a Huffman-compressed progressive scan. - */ - -METHODDEF(void) -finish_pass_phuff (j_compress_ptr cinfo) -{ - phuff_entropy_ptr entropy = (phuff_entropy_ptr) cinfo->entropy; - - entropy->next_output_byte = cinfo->dest->next_output_byte; - entropy->free_in_buffer = cinfo->dest->free_in_buffer; - - /* Flush out any buffered data */ - emit_eobrun(entropy); - flush_bits(entropy); - - cinfo->dest->next_output_byte = entropy->next_output_byte; - cinfo->dest->free_in_buffer = entropy->free_in_buffer; -} - - -/* - * Finish up a statistics-gathering pass and create the new Huffman tables. - */ - -METHODDEF(void) -finish_pass_gather_phuff (j_compress_ptr cinfo) -{ - phuff_entropy_ptr entropy = (phuff_entropy_ptr) cinfo->entropy; - wxjpeg_boolean is_DC_band; - int ci, tbl; - jpeg_component_info * compptr; - JHUFF_TBL **htblptr; - wxjpeg_boolean did[NUM_HUFF_TBLS]; - - /* Flush out buffered data (all we care about is counting the EOB symbol) */ - emit_eobrun(entropy); - - is_DC_band = (cinfo->Ss == 0); - - /* It's important not to apply jpeg_gen_optimal_table more than once - * per table, because it clobbers the input frequency counts! - */ - MEMZERO(did, SIZEOF(did)); - - for (ci = 0; ci < cinfo->comps_in_scan; ci++) { - compptr = cinfo->cur_comp_info[ci]; - if (is_DC_band) { - if (cinfo->Ah != 0) /* DC refinement needs no table */ - continue; - tbl = compptr->dc_tbl_no; - } else { - tbl = compptr->ac_tbl_no; - } - if (! did[tbl]) { - if (is_DC_band) - htblptr = & cinfo->dc_huff_tbl_ptrs[tbl]; - else - htblptr = & cinfo->ac_huff_tbl_ptrs[tbl]; - if (*htblptr == NULL) - *htblptr = jpeg_alloc_huff_table((j_common_ptr) cinfo); - jpeg_gen_optimal_table(cinfo, *htblptr, entropy->count_ptrs[tbl]); - did[tbl] = TRUE; - } - } -} - - -/* - * Module initialization routine for progressive Huffman entropy encoding. - */ - -GLOBAL(void) -jinit_phuff_encoder (j_compress_ptr cinfo) -{ - phuff_entropy_ptr entropy; - int i; - - entropy = (phuff_entropy_ptr) - (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, - SIZEOF(phuff_entropy_encoder)); - cinfo->entropy = (struct jpeg_entropy_encoder *) entropy; - entropy->pub.start_pass = start_pass_phuff; - - /* Mark tables unallocated */ - for (i = 0; i < NUM_HUFF_TBLS; i++) { - entropy->derived_tbls[i] = NULL; - entropy->count_ptrs[i] = NULL; - } - entropy->bit_buffer = NULL; /* needed only in AC refinement scan */ -} - -#endif /* C_PROGRESSIVE_SUPPORTED */ diff --git a/wxWidgets/src/jpeg/jcprepct.c b/wxWidgets/src/jpeg/jcprepct.c deleted file mode 100644 index d106242057..0000000000 --- a/wxWidgets/src/jpeg/jcprepct.c +++ /dev/null @@ -1,354 +0,0 @@ -/* - * jcprepct.c - * - * Copyright (C) 1994-1996, Thomas G. Lane. - * This file is part of the Independent JPEG Group's software. - * For conditions of distribution and use, see the accompanying README file. - * - * This file contains the compression preprocessing controller. - * This controller manages the color conversion, downsampling, - * and edge expansion steps. - * - * Most of the complexity here is associated with buffering input rows - * as required by the downsampler. See the comments at the head of - * jcsample.c for the downsampler's needs. - */ - -#define JPEG_INTERNALS -#include "jinclude.h" -#include "jpeglib.h" - - -/* At present, jcsample.c can request context rows only for smoothing. - * In the future, we might also need context rows for CCIR601 sampling - * or other more-complex downsampling procedures. The code to support - * context rows should be compiled only if needed. - */ -#ifdef INPUT_SMOOTHING_SUPPORTED -#define CONTEXT_ROWS_SUPPORTED -#endif - - -/* - * For the simple (no-context-row) case, we just need to buffer one - * row group's worth of pixels for the downsampling step. At the bottom of - * the image, we pad to a full row group by replicating the last pixel row. - * The downsampler's last output row is then replicated if needed to pad - * out to a full iMCU row. - * - * When providing context rows, we must buffer three row groups' worth of - * pixels. Three row groups are physically allocated, but the row pointer - * arrays are made five row groups high, with the extra pointers above and - * below "wrapping around" to point to the last and first real row groups. - * This allows the downsampler to access the proper context rows. - * At the top and bottom of the image, we create dummy context rows by - * copying the first or last real pixel row. This copying could be avoided - * by pointer hacking as is done in jdmainct.c, but it doesn't seem worth the - * trouble on the compression side. - */ - - -/* Private buffer controller object */ - -typedef struct { - struct jpeg_c_prep_controller pub; /* public fields */ - - /* Downsampling input buffer. This buffer holds color-converted data - * until we have enough to do a downsample step. - */ - JSAMPARRAY color_buf[MAX_COMPONENTS]; - - JDIMENSION rows_to_go; /* counts rows remaining in source image */ - int next_buf_row; /* index of next row to store in color_buf */ - -#ifdef CONTEXT_ROWS_SUPPORTED /* only needed for context case */ - int this_row_group; /* starting row index of group to process */ - int next_buf_stop; /* downsample when we reach this index */ -#endif -} my_prep_controller; - -typedef my_prep_controller * my_prep_ptr; - - -/* - * Initialize for a processing pass. - */ - -METHODDEF(void) -start_pass_prep (j_compress_ptr cinfo, J_BUF_MODE pass_mode) -{ - my_prep_ptr prep = (my_prep_ptr) cinfo->prep; - - if (pass_mode != JBUF_PASS_THRU) - ERREXIT(cinfo, JERR_BAD_BUFFER_MODE); - - /* Initialize total-height counter for detecting bottom of image */ - prep->rows_to_go = cinfo->image_height; - /* Mark the conversion buffer empty */ - prep->next_buf_row = 0; -#ifdef CONTEXT_ROWS_SUPPORTED - /* Preset additional state variables for context mode. - * These aren't used in non-context mode, so we needn't test which mode. - */ - prep->this_row_group = 0; - /* Set next_buf_stop to stop after two row groups have been read in. */ - prep->next_buf_stop = 2 * cinfo->max_v_samp_factor; -#endif -} - - -/* - * Expand an image vertically from height input_rows to height output_rows, - * by duplicating the bottom row. - */ - -LOCAL(void) -expand_bottom_edge (JSAMPARRAY image_data, JDIMENSION num_cols, - int input_rows, int output_rows) -{ - register int row; - - for (row = input_rows; row < output_rows; row++) { - jcopy_sample_rows(image_data, input_rows-1, image_data, row, - 1, num_cols); - } -} - - -/* - * Process some data in the simple no-context case. - * - * Preprocessor output data is counted in "row groups". A row group - * is defined to be v_samp_factor sample rows of each component. - * Downsampling will produce this much data from each max_v_samp_factor - * input rows. - */ - -METHODDEF(void) -pre_process_data (j_compress_ptr cinfo, - JSAMPARRAY input_buf, JDIMENSION *in_row_ctr, - JDIMENSION in_rows_avail, - JSAMPIMAGE output_buf, JDIMENSION *out_row_group_ctr, - JDIMENSION out_row_groups_avail) -{ - my_prep_ptr prep = (my_prep_ptr) cinfo->prep; - int numrows, ci; - JDIMENSION inrows; - jpeg_component_info * compptr; - - while (*in_row_ctr < in_rows_avail && - *out_row_group_ctr < out_row_groups_avail) { - /* Do color conversion to fill the conversion buffer. */ - inrows = in_rows_avail - *in_row_ctr; - numrows = cinfo->max_v_samp_factor - prep->next_buf_row; - numrows = (int) MIN((JDIMENSION) numrows, inrows); - (*cinfo->cconvert->color_convert) (cinfo, input_buf + *in_row_ctr, - prep->color_buf, - (JDIMENSION) prep->next_buf_row, - numrows); - *in_row_ctr += numrows; - prep->next_buf_row += numrows; - prep->rows_to_go -= numrows; - /* If at bottom of image, pad to fill the conversion buffer. */ - if (prep->rows_to_go == 0 && - prep->next_buf_row < cinfo->max_v_samp_factor) { - for (ci = 0; ci < cinfo->num_components; ci++) { - expand_bottom_edge(prep->color_buf[ci], cinfo->image_width, - prep->next_buf_row, cinfo->max_v_samp_factor); - } - prep->next_buf_row = cinfo->max_v_samp_factor; - } - /* If we've filled the conversion buffer, empty it. */ - if (prep->next_buf_row == cinfo->max_v_samp_factor) { - (*cinfo->downsample->downsample) (cinfo, - prep->color_buf, (JDIMENSION) 0, - output_buf, *out_row_group_ctr); - prep->next_buf_row = 0; - (*out_row_group_ctr)++; - } - /* If at bottom of image, pad the output to a full iMCU height. - * Note we assume the caller is providing a one-iMCU-height output buffer! - */ - if (prep->rows_to_go == 0 && - *out_row_group_ctr < out_row_groups_avail) { - for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; - ci++, compptr++) { - expand_bottom_edge(output_buf[ci], - compptr->width_in_blocks * DCTSIZE, - (int) (*out_row_group_ctr * compptr->v_samp_factor), - (int) (out_row_groups_avail * compptr->v_samp_factor)); - } - *out_row_group_ctr = out_row_groups_avail; - break; /* can exit outer loop without test */ - } - } -} - - -#ifdef CONTEXT_ROWS_SUPPORTED - -/* - * Process some data in the context case. - */ - -METHODDEF(void) -pre_process_context (j_compress_ptr cinfo, - JSAMPARRAY input_buf, JDIMENSION *in_row_ctr, - JDIMENSION in_rows_avail, - JSAMPIMAGE output_buf, JDIMENSION *out_row_group_ctr, - JDIMENSION out_row_groups_avail) -{ - my_prep_ptr prep = (my_prep_ptr) cinfo->prep; - int numrows, ci; - int buf_height = cinfo->max_v_samp_factor * 3; - JDIMENSION inrows; - - while (*out_row_group_ctr < out_row_groups_avail) { - if (*in_row_ctr < in_rows_avail) { - /* Do color conversion to fill the conversion buffer. */ - inrows = in_rows_avail - *in_row_ctr; - numrows = prep->next_buf_stop - prep->next_buf_row; - numrows = (int) MIN((JDIMENSION) numrows, inrows); - (*cinfo->cconvert->color_convert) (cinfo, input_buf + *in_row_ctr, - prep->color_buf, - (JDIMENSION) prep->next_buf_row, - numrows); - /* Pad at top of image, if first time through */ - if (prep->rows_to_go == cinfo->image_height) { - for (ci = 0; ci < cinfo->num_components; ci++) { - int row; - for (row = 1; row <= cinfo->max_v_samp_factor; row++) { - jcopy_sample_rows(prep->color_buf[ci], 0, - prep->color_buf[ci], -row, - 1, cinfo->image_width); - } - } - } - *in_row_ctr += numrows; - prep->next_buf_row += numrows; - prep->rows_to_go -= numrows; - } else { - /* Return for more data, unless we are at the bottom of the image. */ - if (prep->rows_to_go != 0) - break; - /* When at bottom of image, pad to fill the conversion buffer. */ - if (prep->next_buf_row < prep->next_buf_stop) { - for (ci = 0; ci < cinfo->num_components; ci++) { - expand_bottom_edge(prep->color_buf[ci], cinfo->image_width, - prep->next_buf_row, prep->next_buf_stop); - } - prep->next_buf_row = prep->next_buf_stop; - } - } - /* If we've gotten enough data, downsample a row group. */ - if (prep->next_buf_row == prep->next_buf_stop) { - (*cinfo->downsample->downsample) (cinfo, - prep->color_buf, - (JDIMENSION) prep->this_row_group, - output_buf, *out_row_group_ctr); - (*out_row_group_ctr)++; - /* Advance pointers with wraparound as necessary. */ - prep->this_row_group += cinfo->max_v_samp_factor; - if (prep->this_row_group >= buf_height) - prep->this_row_group = 0; - if (prep->next_buf_row >= buf_height) - prep->next_buf_row = 0; - prep->next_buf_stop = prep->next_buf_row + cinfo->max_v_samp_factor; - } - } -} - - -/* - * Create the wrapped-around downsampling input buffer needed for context mode. - */ - -LOCAL(void) -create_context_buffer (j_compress_ptr cinfo) -{ - my_prep_ptr prep = (my_prep_ptr) cinfo->prep; - int rgroup_height = cinfo->max_v_samp_factor; - int ci, i; - jpeg_component_info * compptr; - JSAMPARRAY true_buffer, fake_buffer; - - /* Grab enough space for fake row pointers for all the components; - * we need five row groups' worth of pointers for each component. - */ - fake_buffer = (JSAMPARRAY) - (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, - (cinfo->num_components * 5 * rgroup_height) * - SIZEOF(JSAMPROW)); - - for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; - ci++, compptr++) { - /* Allocate the actual buffer space (3 row groups) for this component. - * We make the buffer wide enough to allow the downsampler to edge-expand - * horizontally within the buffer, if it so chooses. - */ - true_buffer = (*cinfo->mem->alloc_sarray) - ((j_common_ptr) cinfo, JPOOL_IMAGE, - (JDIMENSION) (((long) compptr->width_in_blocks * DCTSIZE * - cinfo->max_h_samp_factor) / compptr->h_samp_factor), - (JDIMENSION) (3 * rgroup_height)); - /* Copy true buffer row pointers into the middle of the fake row array */ - MEMCOPY(fake_buffer + rgroup_height, true_buffer, - 3 * rgroup_height * SIZEOF(JSAMPROW)); - /* Fill in the above and below wraparound pointers */ - for (i = 0; i < rgroup_height; i++) { - fake_buffer[i] = true_buffer[2 * rgroup_height + i]; - fake_buffer[4 * rgroup_height + i] = true_buffer[i]; - } - prep->color_buf[ci] = fake_buffer + rgroup_height; - fake_buffer += 5 * rgroup_height; /* point to space for next component */ - } -} - -#endif /* CONTEXT_ROWS_SUPPORTED */ - - -/* - * Initialize preprocessing controller. - */ - -GLOBAL(void) -jinit_c_prep_controller (j_compress_ptr cinfo, wxjpeg_boolean need_full_buffer) -{ - my_prep_ptr prep; - int ci; - jpeg_component_info * compptr; - - if (need_full_buffer) /* safety check */ - ERREXIT(cinfo, JERR_BAD_BUFFER_MODE); - - prep = (my_prep_ptr) - (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, - SIZEOF(my_prep_controller)); - cinfo->prep = (struct jpeg_c_prep_controller *) prep; - prep->pub.start_pass = start_pass_prep; - - /* Allocate the color conversion buffer. - * We make the buffer wide enough to allow the downsampler to edge-expand - * horizontally within the buffer, if it so chooses. - */ - if (cinfo->downsample->need_context_rows) { - /* Set up to provide context rows */ -#ifdef CONTEXT_ROWS_SUPPORTED - prep->pub.pre_process_data = pre_process_context; - create_context_buffer(cinfo); -#else - ERREXIT(cinfo, JERR_NOT_COMPILED); -#endif - } else { - /* No context, just make it tall enough for one row group */ - prep->pub.pre_process_data = pre_process_data; - for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; - ci++, compptr++) { - prep->color_buf[ci] = (*cinfo->mem->alloc_sarray) - ((j_common_ptr) cinfo, JPOOL_IMAGE, - (JDIMENSION) (((long) compptr->width_in_blocks * DCTSIZE * - cinfo->max_h_samp_factor) / compptr->h_samp_factor), - (JDIMENSION) cinfo->max_v_samp_factor); - } - } -} diff --git a/wxWidgets/src/jpeg/jcsample.c b/wxWidgets/src/jpeg/jcsample.c deleted file mode 100644 index 5cc2999c17..0000000000 --- a/wxWidgets/src/jpeg/jcsample.c +++ /dev/null @@ -1,519 +0,0 @@ -/* - * jcsample.c - * - * Copyright (C) 1991-1996, Thomas G. Lane. - * This file is part of the Independent JPEG Group's software. - * For conditions of distribution and use, see the accompanying README file. - * - * This file contains downsampling routines. - * - * Downsampling input data is counted in "row groups". A row group - * is defined to be max_v_samp_factor pixel rows of each component, - * from which the downsampler produces v_samp_factor sample rows. - * A single row group is processed in each call to the downsampler module. - * - * The downsampler is responsible for edge-expansion of its output data - * to fill an integral number of DCT blocks horizontally. The source buffer - * may be modified if it is helpful for this purpose (the source buffer is - * allocated wide enough to correspond to the desired output width). - * The caller (the prep controller) is responsible for vertical padding. - * - * The downsampler may request "context rows" by setting need_context_rows - * during startup. In this case, the input arrays will contain at least - * one row group's worth of pixels above and below the passed-in data; - * the caller will create dummy rows at image top and bottom by replicating - * the first or last real pixel row. - * - * An excellent reference for image resampling is - * Digital Image Warping, George Wolberg, 1990. - * Pub. by IEEE Computer Society Press, Los Alamitos, CA. ISBN 0-8186-8944-7. - * - * The downsampling algorithm used here is a simple average of the source - * pixels covered by the output pixel. The hi-falutin sampling literature - * refers to this as a "box filter". In general the characteristics of a box - * filter are not very good, but for the specific cases we normally use (1:1 - * and 2:1 ratios) the box is equivalent to a "triangle filter" which is not - * nearly so bad. If you intend to use other sampling ratios, you'd be well - * advised to improve this code. - * - * A simple input-smoothing capability is provided. This is mainly intended - * for cleaning up color-dithered GIF input files (if you find it inadequate, - * we suggest using an external filtering program such as pnmconvol). When - * enabled, each input pixel P is replaced by a weighted sum of itself and its - * eight neighbors. P's weight is 1-8*SF and each neighbor's weight is SF, - * where SF = (smoothing_factor / 1024). - * Currently, smoothing is only supported for 2h2v sampling factors. - */ - -#define JPEG_INTERNALS -#include "jinclude.h" -#include "jpeglib.h" - - -/* Pointer to routine to downsample a single component */ -typedef JMETHOD(void, downsample1_ptr, - (j_compress_ptr cinfo, jpeg_component_info * compptr, - JSAMPARRAY input_data, JSAMPARRAY output_data)); - -/* Private subobject */ - -typedef struct { - struct jpeg_downsampler pub; /* public fields */ - - /* Downsampling method pointers, one per component */ - downsample1_ptr methods[MAX_COMPONENTS]; -} my_downsampler; - -typedef my_downsampler * my_downsample_ptr; - - -/* - * Initialize for a downsampling pass. - */ - -METHODDEF(void) -start_pass_downsample (j_compress_ptr cinfo) -{ - /* no work for now */ -} - - -/* - * Expand a component horizontally from width input_cols to width output_cols, - * by duplicating the rightmost samples. - */ - -LOCAL(void) -expand_right_edge (JSAMPARRAY image_data, int num_rows, - JDIMENSION input_cols, JDIMENSION output_cols) -{ - register JSAMPROW ptr; - register JSAMPLE pixval; - register int count; - int row; - int numcols = (int) (output_cols - input_cols); - - if (numcols > 0) { - for (row = 0; row < num_rows; row++) { - ptr = image_data[row] + input_cols; - pixval = ptr[-1]; /* don't need GETJSAMPLE() here */ - for (count = numcols; count > 0; count--) - *ptr++ = pixval; - } - } -} - - -/* - * Do downsampling for a whole row group (all components). - * - * In this version we simply downsample each component independently. - */ - -METHODDEF(void) -sep_downsample (j_compress_ptr cinfo, - JSAMPIMAGE input_buf, JDIMENSION in_row_index, - JSAMPIMAGE output_buf, JDIMENSION out_row_group_index) -{ - my_downsample_ptr downsample = (my_downsample_ptr) cinfo->downsample; - int ci; - jpeg_component_info * compptr; - JSAMPARRAY in_ptr, out_ptr; - - for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; - ci++, compptr++) { - in_ptr = input_buf[ci] + in_row_index; - out_ptr = output_buf[ci] + (out_row_group_index * compptr->v_samp_factor); - (*downsample->methods[ci]) (cinfo, compptr, in_ptr, out_ptr); - } -} - - -/* - * Downsample pixel values of a single component. - * One row group is processed per call. - * This version handles arbitrary integral sampling ratios, without smoothing. - * Note that this version is not actually used for customary sampling ratios. - */ - -METHODDEF(void) -int_downsample (j_compress_ptr cinfo, jpeg_component_info * compptr, - JSAMPARRAY input_data, JSAMPARRAY output_data) -{ - int inrow, outrow, h_expand, v_expand, numpix, numpix2, h, v; - JDIMENSION outcol, outcol_h; /* outcol_h == outcol*h_expand */ - JDIMENSION output_cols = compptr->width_in_blocks * DCTSIZE; - JSAMPROW inptr, outptr; - JPEG_INT32 outvalue; - - h_expand = cinfo->max_h_samp_factor / compptr->h_samp_factor; - v_expand = cinfo->max_v_samp_factor / compptr->v_samp_factor; - numpix = h_expand * v_expand; - numpix2 = numpix/2; - - /* Expand input data enough to let all the output samples be generated - * by the standard loop. Special-casing padded output would be more - * efficient. - */ - expand_right_edge(input_data, cinfo->max_v_samp_factor, - cinfo->image_width, output_cols * h_expand); - - inrow = 0; - for (outrow = 0; outrow < compptr->v_samp_factor; outrow++) { - outptr = output_data[outrow]; - for (outcol = 0, outcol_h = 0; outcol < output_cols; - outcol++, outcol_h += h_expand) { - outvalue = 0; - for (v = 0; v < v_expand; v++) { - inptr = input_data[inrow+v] + outcol_h; - for (h = 0; h < h_expand; h++) { - outvalue += (JPEG_INT32) GETJSAMPLE(*inptr++); - } - } - *outptr++ = (JSAMPLE) ((outvalue + numpix2) / numpix); - } - inrow += v_expand; - } -} - - -/* - * Downsample pixel values of a single component. - * This version handles the special case of a full-size component, - * without smoothing. - */ - -METHODDEF(void) -fullsize_downsample (j_compress_ptr cinfo, jpeg_component_info * compptr, - JSAMPARRAY input_data, JSAMPARRAY output_data) -{ - /* Copy the data */ - jcopy_sample_rows(input_data, 0, output_data, 0, - cinfo->max_v_samp_factor, cinfo->image_width); - /* Edge-expand */ - expand_right_edge(output_data, cinfo->max_v_samp_factor, - cinfo->image_width, compptr->width_in_blocks * DCTSIZE); -} - - -/* - * Downsample pixel values of a single component. - * This version handles the common case of 2:1 horizontal and 1:1 vertical, - * without smoothing. - * - * A note about the "bias" calculations: when rounding fractional values to - * integer, we do not want to always round 0.5 up to the next integer. - * If we did that, we'd introduce a noticeable bias towards larger values. - * Instead, this code is arranged so that 0.5 will be rounded up or down at - * alternate pixel locations (a simple ordered dither pattern). - */ - -METHODDEF(void) -h2v1_downsample (j_compress_ptr cinfo, jpeg_component_info * compptr, - JSAMPARRAY input_data, JSAMPARRAY output_data) -{ - int outrow; - JDIMENSION outcol; - JDIMENSION output_cols = compptr->width_in_blocks * DCTSIZE; - register JSAMPROW inptr, outptr; - register int bias; - - /* Expand input data enough to let all the output samples be generated - * by the standard loop. Special-casing padded output would be more - * efficient. - */ - expand_right_edge(input_data, cinfo->max_v_samp_factor, - cinfo->image_width, output_cols * 2); - - for (outrow = 0; outrow < compptr->v_samp_factor; outrow++) { - outptr = output_data[outrow]; - inptr = input_data[outrow]; - bias = 0; /* bias = 0,1,0,1,... for successive samples */ - for (outcol = 0; outcol < output_cols; outcol++) { - *outptr++ = (JSAMPLE) ((GETJSAMPLE(*inptr) + GETJSAMPLE(inptr[1]) - + bias) >> 1); - bias ^= 1; /* 0=>1, 1=>0 */ - inptr += 2; - } - } -} - - -/* - * Downsample pixel values of a single component. - * This version handles the standard case of 2:1 horizontal and 2:1 vertical, - * without smoothing. - */ - -METHODDEF(void) -h2v2_downsample (j_compress_ptr cinfo, jpeg_component_info * compptr, - JSAMPARRAY input_data, JSAMPARRAY output_data) -{ - int inrow, outrow; - JDIMENSION outcol; - JDIMENSION output_cols = compptr->width_in_blocks * DCTSIZE; - register JSAMPROW inptr0, inptr1, outptr; - register int bias; - - /* Expand input data enough to let all the output samples be generated - * by the standard loop. Special-casing padded output would be more - * efficient. - */ - expand_right_edge(input_data, cinfo->max_v_samp_factor, - cinfo->image_width, output_cols * 2); - - inrow = 0; - for (outrow = 0; outrow < compptr->v_samp_factor; outrow++) { - outptr = output_data[outrow]; - inptr0 = input_data[inrow]; - inptr1 = input_data[inrow+1]; - bias = 1; /* bias = 1,2,1,2,... for successive samples */ - for (outcol = 0; outcol < output_cols; outcol++) { - *outptr++ = (JSAMPLE) ((GETJSAMPLE(*inptr0) + GETJSAMPLE(inptr0[1]) + - GETJSAMPLE(*inptr1) + GETJSAMPLE(inptr1[1]) - + bias) >> 2); - bias ^= 3; /* 1=>2, 2=>1 */ - inptr0 += 2; inptr1 += 2; - } - inrow += 2; - } -} - - -#ifdef INPUT_SMOOTHING_SUPPORTED - -/* - * Downsample pixel values of a single component. - * This version handles the standard case of 2:1 horizontal and 2:1 vertical, - * with smoothing. One row of context is required. - */ - -METHODDEF(void) -h2v2_smooth_downsample (j_compress_ptr cinfo, jpeg_component_info * compptr, - JSAMPARRAY input_data, JSAMPARRAY output_data) -{ - int inrow, outrow; - JDIMENSION colctr; - JDIMENSION output_cols = compptr->width_in_blocks * DCTSIZE; - register JSAMPROW inptr0, inptr1, above_ptr, below_ptr, outptr; - JPEG_INT32 membersum, neighsum, memberscale, neighscale; - - /* Expand input data enough to let all the output samples be generated - * by the standard loop. Special-casing padded output would be more - * efficient. - */ - expand_right_edge(input_data - 1, cinfo->max_v_samp_factor + 2, - cinfo->image_width, output_cols * 2); - - /* We don't bother to form the individual "smoothed" input pixel values; - * we can directly compute the output which is the average of the four - * smoothed values. Each of the four member pixels contributes a fraction - * (1-8*SF) to its own smoothed image and a fraction SF to each of the three - * other smoothed pixels, therefore a total fraction (1-5*SF)/4 to the final - * output. The four corner-adjacent neighbor pixels contribute a fraction - * SF to just one smoothed pixel, or SF/4 to the final output; while the - * eight edge-adjacent neighbors contribute SF to each of two smoothed - * pixels, or SF/2 overall. In order to use integer arithmetic, these - * factors are scaled by 2^16 = 65536. - * Also recall that SF = smoothing_factor / 1024. - */ - - memberscale = 16384 - cinfo->smoothing_factor * 80; /* scaled (1-5*SF)/4 */ - neighscale = cinfo->smoothing_factor * 16; /* scaled SF/4 */ - - inrow = 0; - for (outrow = 0; outrow < compptr->v_samp_factor; outrow++) { - outptr = output_data[outrow]; - inptr0 = input_data[inrow]; - inptr1 = input_data[inrow+1]; - above_ptr = input_data[inrow-1]; - below_ptr = input_data[inrow+2]; - - /* Special case for first column: pretend column -1 is same as column 0 */ - membersum = GETJSAMPLE(*inptr0) + GETJSAMPLE(inptr0[1]) + - GETJSAMPLE(*inptr1) + GETJSAMPLE(inptr1[1]); - neighsum = GETJSAMPLE(*above_ptr) + GETJSAMPLE(above_ptr[1]) + - GETJSAMPLE(*below_ptr) + GETJSAMPLE(below_ptr[1]) + - GETJSAMPLE(*inptr0) + GETJSAMPLE(inptr0[2]) + - GETJSAMPLE(*inptr1) + GETJSAMPLE(inptr1[2]); - neighsum += neighsum; - neighsum += GETJSAMPLE(*above_ptr) + GETJSAMPLE(above_ptr[2]) + - GETJSAMPLE(*below_ptr) + GETJSAMPLE(below_ptr[2]); - membersum = membersum * memberscale + neighsum * neighscale; - *outptr++ = (JSAMPLE) ((membersum + 32768) >> 16); - inptr0 += 2; inptr1 += 2; above_ptr += 2; below_ptr += 2; - - for (colctr = output_cols - 2; colctr > 0; colctr--) { - /* sum of pixels directly mapped to this output element */ - membersum = GETJSAMPLE(*inptr0) + GETJSAMPLE(inptr0[1]) + - GETJSAMPLE(*inptr1) + GETJSAMPLE(inptr1[1]); - /* sum of edge-neighbor pixels */ - neighsum = GETJSAMPLE(*above_ptr) + GETJSAMPLE(above_ptr[1]) + - GETJSAMPLE(*below_ptr) + GETJSAMPLE(below_ptr[1]) + - GETJSAMPLE(inptr0[-1]) + GETJSAMPLE(inptr0[2]) + - GETJSAMPLE(inptr1[-1]) + GETJSAMPLE(inptr1[2]); - /* The edge-neighbors count twice as much as corner-neighbors */ - neighsum += neighsum; - /* Add in the corner-neighbors */ - neighsum += GETJSAMPLE(above_ptr[-1]) + GETJSAMPLE(above_ptr[2]) + - GETJSAMPLE(below_ptr[-1]) + GETJSAMPLE(below_ptr[2]); - /* form final output scaled up by 2^16 */ - membersum = membersum * memberscale + neighsum * neighscale; - /* round, descale and output it */ - *outptr++ = (JSAMPLE) ((membersum + 32768) >> 16); - inptr0 += 2; inptr1 += 2; above_ptr += 2; below_ptr += 2; - } - - /* Special case for last column */ - membersum = GETJSAMPLE(*inptr0) + GETJSAMPLE(inptr0[1]) + - GETJSAMPLE(*inptr1) + GETJSAMPLE(inptr1[1]); - neighsum = GETJSAMPLE(*above_ptr) + GETJSAMPLE(above_ptr[1]) + - GETJSAMPLE(*below_ptr) + GETJSAMPLE(below_ptr[1]) + - GETJSAMPLE(inptr0[-1]) + GETJSAMPLE(inptr0[1]) + - GETJSAMPLE(inptr1[-1]) + GETJSAMPLE(inptr1[1]); - neighsum += neighsum; - neighsum += GETJSAMPLE(above_ptr[-1]) + GETJSAMPLE(above_ptr[1]) + - GETJSAMPLE(below_ptr[-1]) + GETJSAMPLE(below_ptr[1]); - membersum = membersum * memberscale + neighsum * neighscale; - *outptr = (JSAMPLE) ((membersum + 32768) >> 16); - - inrow += 2; - } -} - - -/* - * Downsample pixel values of a single component. - * This version handles the special case of a full-size component, - * with smoothing. One row of context is required. - */ - -METHODDEF(void) -fullsize_smooth_downsample (j_compress_ptr cinfo, jpeg_component_info *compptr, - JSAMPARRAY input_data, JSAMPARRAY output_data) -{ - int outrow; - JDIMENSION colctr; - JDIMENSION output_cols = compptr->width_in_blocks * DCTSIZE; - register JSAMPROW inptr, above_ptr, below_ptr, outptr; - JPEG_INT32 membersum, neighsum, memberscale, neighscale; - int colsum, lastcolsum, nextcolsum; - - /* Expand input data enough to let all the output samples be generated - * by the standard loop. Special-casing padded output would be more - * efficient. - */ - expand_right_edge(input_data - 1, cinfo->max_v_samp_factor + 2, - cinfo->image_width, output_cols); - - /* Each of the eight neighbor pixels contributes a fraction SF to the - * smoothed pixel, while the main pixel contributes (1-8*SF). In order - * to use integer arithmetic, these factors are multiplied by 2^16 = 65536. - * Also recall that SF = smoothing_factor / 1024. - */ - - memberscale = 65536L - cinfo->smoothing_factor * 512L; /* scaled 1-8*SF */ - neighscale = cinfo->smoothing_factor * 64; /* scaled SF */ - - for (outrow = 0; outrow < compptr->v_samp_factor; outrow++) { - outptr = output_data[outrow]; - inptr = input_data[outrow]; - above_ptr = input_data[outrow-1]; - below_ptr = input_data[outrow+1]; - - /* Special case for first column */ - colsum = GETJSAMPLE(*above_ptr++) + GETJSAMPLE(*below_ptr++) + - GETJSAMPLE(*inptr); - membersum = GETJSAMPLE(*inptr++); - nextcolsum = GETJSAMPLE(*above_ptr) + GETJSAMPLE(*below_ptr) + - GETJSAMPLE(*inptr); - neighsum = colsum + (colsum - membersum) + nextcolsum; - membersum = membersum * memberscale + neighsum * neighscale; - *outptr++ = (JSAMPLE) ((membersum + 32768) >> 16); - lastcolsum = colsum; colsum = nextcolsum; - - for (colctr = output_cols - 2; colctr > 0; colctr--) { - membersum = GETJSAMPLE(*inptr++); - above_ptr++; below_ptr++; - nextcolsum = GETJSAMPLE(*above_ptr) + GETJSAMPLE(*below_ptr) + - GETJSAMPLE(*inptr); - neighsum = lastcolsum + (colsum - membersum) + nextcolsum; - membersum = membersum * memberscale + neighsum * neighscale; - *outptr++ = (JSAMPLE) ((membersum + 32768) >> 16); - lastcolsum = colsum; colsum = nextcolsum; - } - - /* Special case for last column */ - membersum = GETJSAMPLE(*inptr); - neighsum = lastcolsum + (colsum - membersum) + colsum; - membersum = membersum * memberscale + neighsum * neighscale; - *outptr = (JSAMPLE) ((membersum + 32768) >> 16); - - } -} - -#endif /* INPUT_SMOOTHING_SUPPORTED */ - - -/* - * Module initialization routine for downsampling. - * Note that we must select a routine for each component. - */ - -GLOBAL(void) -jinit_downsampler (j_compress_ptr cinfo) -{ - my_downsample_ptr downsample; - int ci; - jpeg_component_info * compptr; - wxjpeg_boolean smoothok = TRUE; - - downsample = (my_downsample_ptr) - (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, - SIZEOF(my_downsampler)); - cinfo->downsample = (struct jpeg_downsampler *) downsample; - downsample->pub.start_pass = start_pass_downsample; - downsample->pub.downsample = sep_downsample; - downsample->pub.need_context_rows = FALSE; - - if (cinfo->CCIR601_sampling) - ERREXIT(cinfo, JERR_CCIR601_NOTIMPL); - - /* Verify we can handle the sampling factors, and set up method pointers */ - for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; - ci++, compptr++) { - if (compptr->h_samp_factor == cinfo->max_h_samp_factor && - compptr->v_samp_factor == cinfo->max_v_samp_factor) { -#ifdef INPUT_SMOOTHING_SUPPORTED - if (cinfo->smoothing_factor) { - downsample->methods[ci] = fullsize_smooth_downsample; - downsample->pub.need_context_rows = TRUE; - } else -#endif - downsample->methods[ci] = fullsize_downsample; - } else if (compptr->h_samp_factor * 2 == cinfo->max_h_samp_factor && - compptr->v_samp_factor == cinfo->max_v_samp_factor) { - smoothok = FALSE; - downsample->methods[ci] = h2v1_downsample; - } else if (compptr->h_samp_factor * 2 == cinfo->max_h_samp_factor && - compptr->v_samp_factor * 2 == cinfo->max_v_samp_factor) { -#ifdef INPUT_SMOOTHING_SUPPORTED - if (cinfo->smoothing_factor) { - downsample->methods[ci] = h2v2_smooth_downsample; - downsample->pub.need_context_rows = TRUE; - } else -#endif - downsample->methods[ci] = h2v2_downsample; - } else if ((cinfo->max_h_samp_factor % compptr->h_samp_factor) == 0 && - (cinfo->max_v_samp_factor % compptr->v_samp_factor) == 0) { - smoothok = FALSE; - downsample->methods[ci] = int_downsample; - } else - ERREXIT(cinfo, JERR_FRACT_SAMPLE_NOTIMPL); - } - -#ifdef INPUT_SMOOTHING_SUPPORTED - if (cinfo->smoothing_factor && !smoothok) - TRACEMS(cinfo, 0, JTRC_SMOOTH_NOTIMPL); -#endif -} diff --git a/wxWidgets/src/jpeg/jctrans.c b/wxWidgets/src/jpeg/jctrans.c deleted file mode 100644 index c5bb27f321..0000000000 --- a/wxWidgets/src/jpeg/jctrans.c +++ /dev/null @@ -1,402 +0,0 @@ -/* - * jctrans.c - * - * Copyright (C) 1995-1998, Thomas G. Lane. - * This file is part of the Independent JPEG Group's software. - * For conditions of distribution and use, see the accompanying README file. - * - * This file contains library routines for transcoding compression, - * that is, writing raw DCT coefficient arrays to an output JPEG file. - * The routines in jcapimin.c will also be needed by a transcoder. - */ - -#define JPEG_INTERNALS -#include "jinclude.h" -#include "jpeglib.h" - - -/* Forward declarations */ -LOCAL(void) transencode_master_selection - JPP((j_compress_ptr cinfo, jvirt_barray_ptr * coef_arrays)); -LOCAL(void) transencode_coef_controller - JPP((j_compress_ptr cinfo, jvirt_barray_ptr * coef_arrays)); - -#if defined(__VISAGECPP__) -/* Visual Age fixups for multiple declarations */ -# define start_pass_coef start_pass_coef2 /* already in jccoeft.c */ -# define compress_output compress_output2 /* already in jccoeft.c */ -#endif - - -/* - * Compression initialization for writing raw-coefficient data. - * Before calling this, all parameters and a data destination must be set up. - * Call jpeg_finish_compress() to actually write the data. - * - * The number of passed virtual arrays must match cinfo->num_components. - * Note that the virtual arrays need not be filled or even realized at - * the time write_coefficients is called; indeed, if the virtual arrays - * were requested from this compression object's memory manager, they - * typically will be realized during this routine and filled afterwards. - */ - -GLOBAL(void) -jpeg_write_coefficients (j_compress_ptr cinfo, jvirt_barray_ptr * coef_arrays) -{ - if (cinfo->global_state != CSTATE_START) - ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state); - /* Mark all tables to be written */ - jpeg_suppress_tables(cinfo, FALSE); - /* (Re)initialize error mgr and destination modules */ - (*cinfo->err->reset_error_mgr) ((j_common_ptr) cinfo); - (*cinfo->dest->init_destination) (cinfo); - /* Perform master selection of active modules */ - transencode_master_selection(cinfo, coef_arrays); - /* Wait for jpeg_finish_compress() call */ - cinfo->next_scanline = 0; /* so jpeg_write_marker works */ - cinfo->global_state = CSTATE_WRCOEFS; -} - - -/* - * Initialize the compression object with default parameters, - * then copy from the source object all parameters needed for lossless - * transcoding. Parameters that can be varied without loss (such as - * scan script and Huffman optimization) are left in their default states. - */ - -GLOBAL(void) -jpeg_copy_critical_parameters (j_decompress_ptr srcinfo, - j_compress_ptr dstinfo) -{ - JQUANT_TBL ** qtblptr; - jpeg_component_info *incomp, *outcomp; - JQUANT_TBL *c_quant, *slot_quant; - int tblno, ci, coefi; - - /* Safety check to ensure start_compress not called yet. */ - if (dstinfo->global_state != CSTATE_START) - ERREXIT1(dstinfo, JERR_BAD_STATE, dstinfo->global_state); - /* Copy fundamental image dimensions */ - dstinfo->image_width = srcinfo->image_width; - dstinfo->image_height = srcinfo->image_height; - dstinfo->input_components = srcinfo->num_components; - dstinfo->in_color_space = srcinfo->jpeg_color_space; - /* Initialize all parameters to default values */ - jpeg_set_defaults(dstinfo); - /* jpeg_set_defaults may choose wrong colorspace, eg YCbCr if input is RGB. - * Fix it to get the right header markers for the image colorspace. - */ - jpeg_set_colorspace(dstinfo, srcinfo->jpeg_color_space); - dstinfo->data_precision = srcinfo->data_precision; - dstinfo->CCIR601_sampling = srcinfo->CCIR601_sampling; - /* Copy the source's quantization tables. */ - for (tblno = 0; tblno < NUM_QUANT_TBLS; tblno++) { - if (srcinfo->quant_tbl_ptrs[tblno] != NULL) { - qtblptr = & dstinfo->quant_tbl_ptrs[tblno]; - if (*qtblptr == NULL) - *qtblptr = jpeg_alloc_quant_table((j_common_ptr) dstinfo); - MEMCOPY((*qtblptr)->quantval, - srcinfo->quant_tbl_ptrs[tblno]->quantval, - SIZEOF((*qtblptr)->quantval)); - (*qtblptr)->sent_table = FALSE; - } - } - /* Copy the source's per-component info. - * Note we assume jpeg_set_defaults has allocated the dest comp_info array. - */ - dstinfo->num_components = srcinfo->num_components; - if (dstinfo->num_components < 1 || dstinfo->num_components > MAX_COMPONENTS) - ERREXIT2(dstinfo, JERR_COMPONENT_COUNT, dstinfo->num_components, - MAX_COMPONENTS); - for (ci = 0, incomp = srcinfo->comp_info, outcomp = dstinfo->comp_info; - ci < dstinfo->num_components; ci++, incomp++, outcomp++) { - outcomp->component_id = incomp->component_id; - outcomp->h_samp_factor = incomp->h_samp_factor; - outcomp->v_samp_factor = incomp->v_samp_factor; - outcomp->quant_tbl_no = incomp->quant_tbl_no; - /* Make sure saved quantization table for component matches the qtable - * slot. If not, the input file re-used this qtable slot. - * IJG encoder currently cannot duplicate this. - */ - tblno = outcomp->quant_tbl_no; - if (tblno < 0 || tblno >= NUM_QUANT_TBLS || - srcinfo->quant_tbl_ptrs[tblno] == NULL) - ERREXIT1(dstinfo, JERR_NO_QUANT_TABLE, tblno); - slot_quant = srcinfo->quant_tbl_ptrs[tblno]; - c_quant = incomp->quant_table; - if (c_quant != NULL) { - for (coefi = 0; coefi < DCTSIZE2; coefi++) { - if (c_quant->quantval[coefi] != slot_quant->quantval[coefi]) - ERREXIT1(dstinfo, JERR_MISMATCHED_QUANT_TABLE, tblno); - } - } - /* Note: we do not copy the source's Huffman table assignments; - * instead we rely on jpeg_set_colorspace to have made a suitable choice. - */ - } - /* Also copy JFIF version and resolution information, if available. - * Strictly speaking this isn't "critical" info, but it's nearly - * always appropriate to copy it if available. In particular, - * if the application chooses to copy JFIF 1.02 extension markers from - * the source file, we need to copy the version to make sure we don't - * emit a file that has 1.02 extensions but a claimed version of 1.01. - * We will *not*, however, copy version info from mislabeled "2.01" files. - */ - if (srcinfo->saw_JFIF_marker) { - if (srcinfo->JFIF_major_version == 1) { - dstinfo->JFIF_major_version = srcinfo->JFIF_major_version; - dstinfo->JFIF_minor_version = srcinfo->JFIF_minor_version; - } - dstinfo->density_unit = srcinfo->density_unit; - dstinfo->X_density = srcinfo->X_density; - dstinfo->Y_density = srcinfo->Y_density; - } -} - - -/* - * Master selection of compression modules for transcoding. - * This substitutes for jcinit.c's initialization of the full compressor. - */ - -LOCAL(void) -transencode_master_selection (j_compress_ptr cinfo, - jvirt_barray_ptr * coef_arrays) -{ - /* Although we don't actually use input_components for transcoding, - * jcmaster.c's initial_setup will complain if input_components is 0. - */ - cinfo->input_components = 1; - /* Initialize master control (includes parameter checking/processing) */ - jinit_c_master_control(cinfo, TRUE /* transcode only */); - - /* Entropy encoding: either Huffman or arithmetic coding. */ - if (cinfo->arith_code) { - ERREXIT(cinfo, JERR_ARITH_NOTIMPL); - } else { - if (cinfo->progressive_mode) { -#ifdef C_PROGRESSIVE_SUPPORTED - jinit_phuff_encoder(cinfo); -#else - ERREXIT(cinfo, JERR_NOT_COMPILED); -#endif - } else - jinit_huff_encoder(cinfo); - } - - /* We need a special coefficient buffer controller. */ - transencode_coef_controller(cinfo, coef_arrays); - - jinit_marker_writer(cinfo); - - /* We can now tell the memory manager to allocate virtual arrays. */ - (*cinfo->mem->realize_virt_arrays) ((j_common_ptr) cinfo); - - /* Write the datastream header (SOI, JFIF) immediately. - * Frame and scan headers are postponed till later. - * This lets application insert special markers after the SOI. - */ - (*cinfo->marker->write_file_header) (cinfo); -} - - -/* - * The rest of this file is a special implementation of the coefficient - * buffer controller. This is similar to jccoefct.c, but it handles only - * output from presupplied virtual arrays. Furthermore, we generate any - * dummy padding blocks on-the-fly rather than expecting them to be present - * in the arrays. - */ - -/* Private buffer controller object */ - -typedef struct { - struct jpeg_c_coef_controller pub; /* public fields */ - - JDIMENSION iMCU_row_num; /* iMCU row # within image */ - JDIMENSION mcu_ctr; /* counts MCUs processed in current row */ - int MCU_vert_offset; /* counts MCU rows within iMCU row */ - int MCU_rows_per_iMCU_row; /* number of such rows needed */ - - /* Virtual block array for each component. */ - jvirt_barray_ptr * whole_image; - - /* Workspace for constructing dummy blocks at right/bottom edges. */ - JBLOCKROW dummy_buffer[C_MAX_BLOCKS_IN_MCU]; -} my_coef_controller; - -typedef my_coef_controller * my_coef_ptr; - - -LOCAL(void) -start_iMCU_row (j_compress_ptr cinfo) -/* Reset within-iMCU-row counters for a new row */ -{ - my_coef_ptr coef = (my_coef_ptr) cinfo->coef; - - /* In an interleaved scan, an MCU row is the same as an iMCU row. - * In a noninterleaved scan, an iMCU row has v_samp_factor MCU rows. - * But at the bottom of the image, process only what's left. - */ - if (cinfo->comps_in_scan > 1) { - coef->MCU_rows_per_iMCU_row = 1; - } else { - if (coef->iMCU_row_num < (cinfo->total_iMCU_rows-1)) - coef->MCU_rows_per_iMCU_row = cinfo->cur_comp_info[0]->v_samp_factor; - else - coef->MCU_rows_per_iMCU_row = cinfo->cur_comp_info[0]->last_row_height; - } - - coef->mcu_ctr = 0; - coef->MCU_vert_offset = 0; -} - -/* - * Initialize for a processing pass. - */ - -METHODDEF(void) -start_pass_coef (j_compress_ptr cinfo, J_BUF_MODE pass_mode) -{ - my_coef_ptr coef = (my_coef_ptr) cinfo->coef; - - if (pass_mode != JBUF_CRANK_DEST) - ERREXIT(cinfo, JERR_BAD_BUFFER_MODE); - - coef->iMCU_row_num = 0; - start_iMCU_row(cinfo); -} - - -/* - * Process some data. - * We process the equivalent of one fully interleaved MCU row ("iMCU" row) - * per call, ie, v_samp_factor block rows for each component in the scan. - * The data is obtained from the virtual arrays and fed to the entropy coder. - * Returns TRUE if the iMCU row is completed, FALSE if suspended. - * - * NB: input_buf is ignored; it is likely to be a NULL pointer. - */ - -METHODDEF(wxjpeg_boolean) -compress_output (j_compress_ptr cinfo, JSAMPIMAGE input_buf) -{ - my_coef_ptr coef = (my_coef_ptr) cinfo->coef; - JDIMENSION MCU_col_num; /* index of current MCU within row */ - JDIMENSION last_MCU_col = cinfo->MCUs_per_row - 1; - JDIMENSION last_iMCU_row = cinfo->total_iMCU_rows - 1; - int blkn, ci, xindex, yindex, yoffset, blockcnt; - JDIMENSION start_col; - JBLOCKARRAY buffer[MAX_COMPS_IN_SCAN]; - JBLOCKROW MCU_buffer[C_MAX_BLOCKS_IN_MCU]; - JBLOCKROW buffer_ptr; - jpeg_component_info *compptr; - - /* Align the virtual buffers for the components used in this scan. */ - for (ci = 0; ci < cinfo->comps_in_scan; ci++) { - compptr = cinfo->cur_comp_info[ci]; - buffer[ci] = (*cinfo->mem->access_virt_barray) - ((j_common_ptr) cinfo, coef->whole_image[compptr->component_index], - coef->iMCU_row_num * compptr->v_samp_factor, - (JDIMENSION) compptr->v_samp_factor, FALSE); - } - - /* Loop to process one whole iMCU row */ - for (yoffset = coef->MCU_vert_offset; yoffset < coef->MCU_rows_per_iMCU_row; - yoffset++) { - for (MCU_col_num = coef->mcu_ctr; MCU_col_num < cinfo->MCUs_per_row; - MCU_col_num++) { - /* Construct list of pointers to DCT blocks belonging to this MCU */ - blkn = 0; /* index of current DCT block within MCU */ - for (ci = 0; ci < cinfo->comps_in_scan; ci++) { - compptr = cinfo->cur_comp_info[ci]; - start_col = MCU_col_num * compptr->MCU_width; - blockcnt = (MCU_col_num < last_MCU_col) ? compptr->MCU_width - : compptr->last_col_width; - for (yindex = 0; yindex < compptr->MCU_height; yindex++) { - if (coef->iMCU_row_num < last_iMCU_row || - yindex+yoffset < compptr->last_row_height) { - /* Fill in pointers to real blocks in this row */ - buffer_ptr = buffer[ci][yindex+yoffset] + start_col; - for (xindex = 0; xindex < blockcnt; xindex++) - MCU_buffer[blkn++] = buffer_ptr++; - } else { - /* At bottom of image, need a whole row of dummy blocks */ - xindex = 0; - } - /* Fill in any dummy blocks needed in this row. - * Dummy blocks are filled in the same way as in jccoefct.c: - * all zeroes in the AC entries, DC entries equal to previous - * block's DC value. The init routine has already zeroed the - * AC entries, so we need only set the DC entries correctly. - */ - for (; xindex < compptr->MCU_width; xindex++) { - MCU_buffer[blkn] = coef->dummy_buffer[blkn]; - MCU_buffer[blkn][0][0] = MCU_buffer[blkn-1][0][0]; - blkn++; - } - } - } - /* Try to write the MCU. */ - if (! (*cinfo->entropy->encode_mcu) (cinfo, MCU_buffer)) { - /* Suspension forced; update state counters and exit */ - coef->MCU_vert_offset = yoffset; - coef->mcu_ctr = MCU_col_num; - return FALSE; - } - } - /* Completed an MCU row, but perhaps not an iMCU row */ - coef->mcu_ctr = 0; - } - /* Completed the iMCU row, advance counters for next one */ - coef->iMCU_row_num++; - start_iMCU_row(cinfo); - return TRUE; -} - - -/* - * Initialize coefficient buffer controller. - * - * Each passed coefficient array must be the right size for that - * coefficient: width_in_blocks wide and height_in_blocks high, - * with unitheight at least v_samp_factor. - */ - -LOCAL(void) -transencode_coef_controller (j_compress_ptr cinfo, - jvirt_barray_ptr * coef_arrays) -{ - my_coef_ptr coef; - JBLOCKROW buffer; - int i; - - coef = (my_coef_ptr) - (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, - SIZEOF(my_coef_controller)); - cinfo->coef = (struct jpeg_c_coef_controller *) coef; - coef->pub.start_pass = start_pass_coef; - coef->pub.compress_data = compress_output; - - /* Save pointer to virtual arrays */ - coef->whole_image = coef_arrays; - - /* Allocate and pre-zero space for dummy DCT blocks. */ - buffer = (JBLOCKROW) - (*cinfo->mem->alloc_large) ((j_common_ptr) cinfo, JPOOL_IMAGE, - C_MAX_BLOCKS_IN_MCU * SIZEOF(JBLOCK)); - jzero_far((void FAR *) buffer, C_MAX_BLOCKS_IN_MCU * SIZEOF(JBLOCK)); - for (i = 0; i < C_MAX_BLOCKS_IN_MCU; i++) { - coef->dummy_buffer[i] = buffer + i; - } -} - -#if defined(__VISAGECPP__) -# ifdef start_pass_coef2 -# undef start_pass_coef2 -# endif -# ifdef compress_output2 -# undef compress_output2 -# endif -#endif diff --git a/wxWidgets/src/jpeg/jdapimin.c b/wxWidgets/src/jpeg/jdapimin.c deleted file mode 100644 index 5c8474f018..0000000000 --- a/wxWidgets/src/jpeg/jdapimin.c +++ /dev/null @@ -1,395 +0,0 @@ -/* - * jdapimin.c - * - * Copyright (C) 1994-1998, Thomas G. Lane. - * This file is part of the Independent JPEG Group's software. - * For conditions of distribution and use, see the accompanying README file. - * - * This file contains application interface code for the decompression half - * of the JPEG library. These are the "minimum" API routines that may be - * needed in either the normal full-decompression case or the - * transcoding-only case. - * - * Most of the routines intended to be called directly by an application - * are in this file or in jdapistd.c. But also see jcomapi.c for routines - * shared by compression and decompression, and jdtrans.c for the transcoding - * case. - */ - -#define JPEG_INTERNALS -#include "jinclude.h" -#include "jpeglib.h" - - -/* - * Initialization of a JPEG decompression object. - * The error manager must already be set up (in case memory manager fails). - */ - -GLOBAL(void) -jpeg_CreateDecompress (j_decompress_ptr cinfo, int version, size_t structsize) -{ - int i; - - /* Guard against version mismatches between library and caller. */ - cinfo->mem = NULL; /* so jpeg_destroy knows mem mgr not called */ - if (version != JPEG_LIB_VERSION) - ERREXIT2(cinfo, JERR_BAD_LIB_VERSION, JPEG_LIB_VERSION, version); - if (structsize != SIZEOF(struct jpeg_decompress_struct)) - ERREXIT2(cinfo, JERR_BAD_STRUCT_SIZE, - (int) SIZEOF(struct jpeg_decompress_struct), (int) structsize); - - /* For debugging purposes, we zero the whole master structure. - * But the application has already set the err pointer, and may have set - * client_data, so we have to save and restore those fields. - * Note: if application hasn't set client_data, tools like Purify may - * complain here. - */ - { - struct jpeg_error_mgr * err = cinfo->err; - void * client_data = cinfo->client_data; /* ignore Purify complaint here */ - MEMZERO(cinfo, SIZEOF(struct jpeg_decompress_struct)); - cinfo->err = err; - cinfo->client_data = client_data; - } - cinfo->is_decompressor = TRUE; - - /* Initialize a memory manager instance for this object */ - jinit_memory_mgr((j_common_ptr) cinfo); - - /* Zero out pointers to permanent structures. */ - cinfo->progress = NULL; - cinfo->src = NULL; - - for (i = 0; i < NUM_QUANT_TBLS; i++) - cinfo->quant_tbl_ptrs[i] = NULL; - - for (i = 0; i < NUM_HUFF_TBLS; i++) { - cinfo->dc_huff_tbl_ptrs[i] = NULL; - cinfo->ac_huff_tbl_ptrs[i] = NULL; - } - - /* Initialize marker processor so application can override methods - * for COM, APPn markers before calling jpeg_read_header. - */ - cinfo->marker_list = NULL; - jinit_marker_reader(cinfo); - - /* And initialize the overall input controller. */ - jinit_input_controller(cinfo); - - /* OK, I'm ready */ - cinfo->global_state = DSTATE_START; -} - - -/* - * Destruction of a JPEG decompression object - */ - -GLOBAL(void) -jpeg_destroy_decompress (j_decompress_ptr cinfo) -{ - jpeg_destroy((j_common_ptr) cinfo); /* use common routine */ -} - - -/* - * Abort processing of a JPEG decompression operation, - * but don't destroy the object itself. - */ - -GLOBAL(void) -jpeg_abort_decompress (j_decompress_ptr cinfo) -{ - jpeg_abort((j_common_ptr) cinfo); /* use common routine */ -} - - -/* - * Set default decompression parameters. - */ - -LOCAL(void) -default_decompress_parms (j_decompress_ptr cinfo) -{ - /* Guess the input colorspace, and set output colorspace accordingly. */ - /* (Wish JPEG committee had provided a real way to specify this...) */ - /* Note application may override our guesses. */ - switch (cinfo->num_components) { - case 1: - cinfo->jpeg_color_space = JCS_GRAYSCALE; - cinfo->out_color_space = JCS_GRAYSCALE; - break; - - case 3: - if (cinfo->saw_JFIF_marker) { - cinfo->jpeg_color_space = JCS_YCbCr; /* JFIF implies YCbCr */ - } else if (cinfo->saw_Adobe_marker) { - switch (cinfo->Adobe_transform) { - case 0: - cinfo->jpeg_color_space = JCS_RGB; - break; - case 1: - cinfo->jpeg_color_space = JCS_YCbCr; - break; - default: - WARNMS1(cinfo, JWRN_ADOBE_XFORM, cinfo->Adobe_transform); - cinfo->jpeg_color_space = JCS_YCbCr; /* assume it's YCbCr */ - break; - } - } else { - /* Saw no special markers, try to guess from the component IDs */ - int cid0 = cinfo->comp_info[0].component_id; - int cid1 = cinfo->comp_info[1].component_id; - int cid2 = cinfo->comp_info[2].component_id; - - if (cid0 == 1 && cid1 == 2 && cid2 == 3) - cinfo->jpeg_color_space = JCS_YCbCr; /* assume JFIF w/out marker */ - else if (cid0 == 82 && cid1 == 71 && cid2 == 66) - cinfo->jpeg_color_space = JCS_RGB; /* ASCII 'R', 'G', 'B' */ - else { - TRACEMS3(cinfo, 1, JTRC_UNKNOWN_IDS, cid0, cid1, cid2); - cinfo->jpeg_color_space = JCS_YCbCr; /* assume it's YCbCr */ - } - } - /* Always guess RGB is proper output colorspace. */ - cinfo->out_color_space = JCS_RGB; - break; - - case 4: - if (cinfo->saw_Adobe_marker) { - switch (cinfo->Adobe_transform) { - case 0: - cinfo->jpeg_color_space = JCS_CMYK; - break; - case 2: - cinfo->jpeg_color_space = JCS_YCCK; - break; - default: - WARNMS1(cinfo, JWRN_ADOBE_XFORM, cinfo->Adobe_transform); - cinfo->jpeg_color_space = JCS_YCCK; /* assume it's YCCK */ - break; - } - } else { - /* No special markers, assume straight CMYK. */ - cinfo->jpeg_color_space = JCS_CMYK; - } - cinfo->out_color_space = JCS_CMYK; - break; - - default: - cinfo->jpeg_color_space = JCS_UNKNOWN; - cinfo->out_color_space = JCS_UNKNOWN; - break; - } - - /* Set defaults for other decompression parameters. */ - cinfo->scale_num = 1; /* 1:1 scaling */ - cinfo->scale_denom = 1; - cinfo->output_gamma = 1.0; - cinfo->buffered_image = FALSE; - cinfo->raw_data_out = FALSE; - cinfo->dct_method = JDCT_DEFAULT; - cinfo->do_fancy_upsampling = TRUE; - cinfo->do_block_smoothing = TRUE; - cinfo->quantize_colors = FALSE; - /* We set these in case application only sets quantize_colors. */ - cinfo->dither_mode = JDITHER_FS; -#ifdef QUANT_2PASS_SUPPORTED - cinfo->two_pass_quantize = TRUE; -#else - cinfo->two_pass_quantize = FALSE; -#endif - cinfo->desired_number_of_colors = 256; - cinfo->colormap = NULL; - /* Initialize for no mode change in buffered-image mode. */ - cinfo->enable_1pass_quant = FALSE; - cinfo->enable_external_quant = FALSE; - cinfo->enable_2pass_quant = FALSE; -} - - -/* - * Decompression startup: read start of JPEG datastream to see what's there. - * Need only initialize JPEG object and supply a data source before calling. - * - * This routine will read as far as the first SOS marker (ie, actual start of - * compressed data), and will save all tables and parameters in the JPEG - * object. It will also initialize the decompression parameters to default - * values, and finally return JPEG_HEADER_OK. On return, the application may - * adjust the decompression parameters and then call jpeg_start_decompress. - * (Or, if the application only wanted to determine the image parameters, - * the data need not be decompressed. In that case, call jpeg_abort or - * jpeg_destroy to release any temporary space.) - * If an abbreviated (tables only) datastream is presented, the routine will - * return JPEG_HEADER_TABLES_ONLY upon reaching EOI. The application may then - * re-use the JPEG object to read the abbreviated image datastream(s). - * It is unnecessary (but OK) to call jpeg_abort in this case. - * The JPEG_SUSPENDED return code only occurs if the data source module - * requests suspension of the decompressor. In this case the application - * should load more source data and then re-call jpeg_read_header to resume - * processing. - * If a non-suspending data source is used and require_image is TRUE, then the - * return code need not be inspected since only JPEG_HEADER_OK is possible. - * - * This routine is now just a front end to jpeg_consume_input, with some - * extra error checking. - */ - -GLOBAL(int) -jpeg_read_header (j_decompress_ptr cinfo, wxjpeg_boolean require_image) -{ - int retcode; - - if (cinfo->global_state != DSTATE_START && - cinfo->global_state != DSTATE_INHEADER) - ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state); - - retcode = jpeg_consume_input(cinfo); - - switch (retcode) { - case JPEG_REACHED_SOS: - retcode = JPEG_HEADER_OK; - break; - case JPEG_REACHED_EOI: - if (require_image) /* Complain if application wanted an image */ - ERREXIT(cinfo, JERR_NO_IMAGE); - /* Reset to start state; it would be safer to require the application to - * call jpeg_abort, but we can't change it now for compatibility reasons. - * A side effect is to free any temporary memory (there shouldn't be any). - */ - jpeg_abort((j_common_ptr) cinfo); /* sets state = DSTATE_START */ - retcode = JPEG_HEADER_TABLES_ONLY; - break; - case JPEG_SUSPENDED: - /* no work */ - break; - } - - return retcode; -} - - -/* - * Consume data in advance of what the decompressor requires. - * This can be called at any time once the decompressor object has - * been created and a data source has been set up. - * - * This routine is essentially a state machine that handles a couple - * of critical state-transition actions, namely initial setup and - * transition from header scanning to ready-for-start_decompress. - * All the actual input is done via the input controller's consume_input - * method. - */ - -GLOBAL(int) -jpeg_consume_input (j_decompress_ptr cinfo) -{ - int retcode = JPEG_SUSPENDED; - - /* NB: every possible DSTATE value should be listed in this switch */ - switch (cinfo->global_state) { - case DSTATE_START: - /* Start-of-datastream actions: reset appropriate modules */ - (*cinfo->inputctl->reset_input_controller) (cinfo); - /* Initialize application's data source module */ - (*cinfo->src->init_source) (cinfo); - cinfo->global_state = DSTATE_INHEADER; - /*FALLTHROUGH*/ - case DSTATE_INHEADER: - retcode = (*cinfo->inputctl->consume_input) (cinfo); - if (retcode == JPEG_REACHED_SOS) { /* Found SOS, prepare to decompress */ - /* Set up default parameters based on header data */ - default_decompress_parms(cinfo); - /* Set global state: ready for start_decompress */ - cinfo->global_state = DSTATE_READY; - } - break; - case DSTATE_READY: - /* Can't advance past first SOS until start_decompress is called */ - retcode = JPEG_REACHED_SOS; - break; - case DSTATE_PRELOAD: - case DSTATE_PRESCAN: - case DSTATE_SCANNING: - case DSTATE_RAW_OK: - case DSTATE_BUFIMAGE: - case DSTATE_BUFPOST: - case DSTATE_STOPPING: - retcode = (*cinfo->inputctl->consume_input) (cinfo); - break; - default: - ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state); - } - return retcode; -} - - -/* - * Have we finished reading the input file? - */ - -GLOBAL(wxjpeg_boolean) -jpeg_input_complete (j_decompress_ptr cinfo) -{ - /* Check for valid jpeg object */ - if (cinfo->global_state < DSTATE_START || - cinfo->global_state > DSTATE_STOPPING) - ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state); - return cinfo->inputctl->eoi_reached; -} - - -/* - * Is there more than one scan? - */ - -GLOBAL(wxjpeg_boolean) -jpeg_has_multiple_scans (j_decompress_ptr cinfo) -{ - /* Only valid after jpeg_read_header completes */ - if (cinfo->global_state < DSTATE_READY || - cinfo->global_state > DSTATE_STOPPING) - ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state); - return cinfo->inputctl->has_multiple_scans; -} - - -/* - * Finish JPEG decompression. - * - * This will normally just verify the file trailer and release temp storage. - * - * Returns FALSE if suspended. The return value need be inspected only if - * a suspending data source is used. - */ - -GLOBAL(wxjpeg_boolean) -jpeg_finish_decompress (j_decompress_ptr cinfo) -{ - if ((cinfo->global_state == DSTATE_SCANNING || - cinfo->global_state == DSTATE_RAW_OK) && ! cinfo->buffered_image) { - /* Terminate final pass of non-buffered mode */ - if (cinfo->output_scanline < cinfo->output_height) - ERREXIT(cinfo, JERR_TOO_LITTLE_DATA); - (*cinfo->master->finish_output_pass) (cinfo); - cinfo->global_state = DSTATE_STOPPING; - } else if (cinfo->global_state == DSTATE_BUFIMAGE) { - /* Finishing after a buffered-image operation */ - cinfo->global_state = DSTATE_STOPPING; - } else if (cinfo->global_state != DSTATE_STOPPING) { - /* STOPPING = repeat call after a suspension, anything else is error */ - ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state); - } - /* Read until EOI */ - while (! cinfo->inputctl->eoi_reached) { - if ((*cinfo->inputctl->consume_input) (cinfo) == JPEG_SUSPENDED) - return FALSE; /* Suspend, come back later */ - } - /* Do final cleanup */ - (*cinfo->src->term_source) (cinfo); - /* We can use jpeg_abort to release memory and reset global_state */ - jpeg_abort((j_common_ptr) cinfo); - return TRUE; -} diff --git a/wxWidgets/src/jpeg/jdapistd.c b/wxWidgets/src/jpeg/jdapistd.c deleted file mode 100644 index 9c995b4d87..0000000000 --- a/wxWidgets/src/jpeg/jdapistd.c +++ /dev/null @@ -1,275 +0,0 @@ -/* - * jdapistd.c - * - * Copyright (C) 1994-1996, Thomas G. Lane. - * This file is part of the Independent JPEG Group's software. - * For conditions of distribution and use, see the accompanying README file. - * - * This file contains application interface code for the decompression half - * of the JPEG library. These are the "standard" API routines that are - * used in the normal full-decompression case. They are not used by a - * transcoding-only application. Note that if an application links in - * jpeg_start_decompress, it will end up linking in the entire decompressor. - * We thus must separate this file from jdapimin.c to avoid linking the - * whole decompression library into a transcoder. - */ - -#define JPEG_INTERNALS -#include "jinclude.h" -#include "jpeglib.h" - - -/* Forward declarations */ -LOCAL(wxjpeg_boolean) output_pass_setup JPP((j_decompress_ptr cinfo)); - - -/* - * Decompression initialization. - * jpeg_read_header must be completed before calling this. - * - * If a multipass operating mode was selected, this will do all but the - * last pass, and thus may take a great deal of time. - * - * Returns FALSE if suspended. The return value need be inspected only if - * a suspending data source is used. - */ - -GLOBAL(wxjpeg_boolean) -jpeg_start_decompress (j_decompress_ptr cinfo) -{ - if (cinfo->global_state == DSTATE_READY) { - /* First call: initialize master control, select active modules */ - jinit_master_decompress(cinfo); - if (cinfo->buffered_image) { - /* No more work here; expecting jpeg_start_output next */ - cinfo->global_state = DSTATE_BUFIMAGE; - return TRUE; - } - cinfo->global_state = DSTATE_PRELOAD; - } - if (cinfo->global_state == DSTATE_PRELOAD) { - /* If file has multiple scans, absorb them all into the coef buffer */ - if (cinfo->inputctl->has_multiple_scans) { -#ifdef D_MULTISCAN_FILES_SUPPORTED - for (;;) { - int retcode; - /* Call progress monitor hook if present */ - if (cinfo->progress != NULL) - (*cinfo->progress->progress_monitor) ((j_common_ptr) cinfo); - /* Absorb some more input */ - retcode = (*cinfo->inputctl->consume_input) (cinfo); - if (retcode == JPEG_SUSPENDED) - return FALSE; - if (retcode == JPEG_REACHED_EOI) - break; - /* Advance progress counter if appropriate */ - if (cinfo->progress != NULL && - (retcode == JPEG_ROW_COMPLETED || retcode == JPEG_REACHED_SOS)) { - if (++cinfo->progress->pass_counter >= cinfo->progress->pass_limit) { - /* jdmaster underestimated number of scans; ratchet up one scan */ - cinfo->progress->pass_limit += (long) cinfo->total_iMCU_rows; - } - } - } -#else - ERREXIT(cinfo, JERR_NOT_COMPILED); -#endif /* D_MULTISCAN_FILES_SUPPORTED */ - } - cinfo->output_scan_number = cinfo->input_scan_number; - } else if (cinfo->global_state != DSTATE_PRESCAN) - ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state); - /* Perform any dummy output passes, and set up for the final pass */ - return output_pass_setup(cinfo); -} - - -/* - * Set up for an output pass, and perform any dummy pass(es) needed. - * Common subroutine for jpeg_start_decompress and jpeg_start_output. - * Entry: global_state = DSTATE_PRESCAN only if previously suspended. - * Exit: If done, returns TRUE and sets global_state for proper output mode. - * If suspended, returns FALSE and sets global_state = DSTATE_PRESCAN. - */ - -LOCAL(wxjpeg_boolean) -output_pass_setup (j_decompress_ptr cinfo) -{ - if (cinfo->global_state != DSTATE_PRESCAN) { - /* First call: do pass setup */ - (*cinfo->master->prepare_for_output_pass) (cinfo); - cinfo->output_scanline = 0; - cinfo->global_state = DSTATE_PRESCAN; - } - /* Loop over any required dummy passes */ - while (cinfo->master->is_dummy_pass) { -#ifdef QUANT_2PASS_SUPPORTED - /* Crank through the dummy pass */ - while (cinfo->output_scanline < cinfo->output_height) { - JDIMENSION last_scanline; - /* Call progress monitor hook if present */ - if (cinfo->progress != NULL) { - cinfo->progress->pass_counter = (long) cinfo->output_scanline; - cinfo->progress->pass_limit = (long) cinfo->output_height; - (*cinfo->progress->progress_monitor) ((j_common_ptr) cinfo); - } - /* Process some data */ - last_scanline = cinfo->output_scanline; - (*cinfo->main->process_data) (cinfo, (JSAMPARRAY) NULL, - &cinfo->output_scanline, (JDIMENSION) 0); - if (cinfo->output_scanline == last_scanline) - return FALSE; /* No progress made, must suspend */ - } - /* Finish up dummy pass, and set up for another one */ - (*cinfo->master->finish_output_pass) (cinfo); - (*cinfo->master->prepare_for_output_pass) (cinfo); - cinfo->output_scanline = 0; -#else - ERREXIT(cinfo, JERR_NOT_COMPILED); -#endif /* QUANT_2PASS_SUPPORTED */ - } - /* Ready for application to drive output pass through - * jpeg_read_scanlines or jpeg_read_raw_data. - */ - cinfo->global_state = cinfo->raw_data_out ? DSTATE_RAW_OK : DSTATE_SCANNING; - return TRUE; -} - - -/* - * Read some scanlines of data from the JPEG decompressor. - * - * The return value will be the number of lines actually read. - * This may be less than the number requested in several cases, - * including bottom of image, data source suspension, and operating - * modes that emit multiple scanlines at a time. - * - * Note: we warn about excess calls to jpeg_read_scanlines() since - * this likely signals an application programmer error. However, - * an oversize buffer (max_lines > scanlines remaining) is not an error. - */ - -GLOBAL(JDIMENSION) -jpeg_read_scanlines (j_decompress_ptr cinfo, JSAMPARRAY scanlines, - JDIMENSION max_lines) -{ - JDIMENSION row_ctr; - - if (cinfo->global_state != DSTATE_SCANNING) - ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state); - if (cinfo->output_scanline >= cinfo->output_height) { - WARNMS(cinfo, JWRN_TOO_MUCH_DATA); - return 0; - } - - /* Call progress monitor hook if present */ - if (cinfo->progress != NULL) { - cinfo->progress->pass_counter = (long) cinfo->output_scanline; - cinfo->progress->pass_limit = (long) cinfo->output_height; - (*cinfo->progress->progress_monitor) ((j_common_ptr) cinfo); - } - - /* Process some data */ - row_ctr = 0; - (*cinfo->main->process_data) (cinfo, scanlines, &row_ctr, max_lines); - cinfo->output_scanline += row_ctr; - return row_ctr; -} - - -/* - * Alternate entry point to read raw data. - * Processes exactly one iMCU row per call, unless suspended. - */ - -GLOBAL(JDIMENSION) -jpeg_read_raw_data (j_decompress_ptr cinfo, JSAMPIMAGE data, - JDIMENSION max_lines) -{ - JDIMENSION lines_per_iMCU_row; - - if (cinfo->global_state != DSTATE_RAW_OK) - ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state); - if (cinfo->output_scanline >= cinfo->output_height) { - WARNMS(cinfo, JWRN_TOO_MUCH_DATA); - return 0; - } - - /* Call progress monitor hook if present */ - if (cinfo->progress != NULL) { - cinfo->progress->pass_counter = (long) cinfo->output_scanline; - cinfo->progress->pass_limit = (long) cinfo->output_height; - (*cinfo->progress->progress_monitor) ((j_common_ptr) cinfo); - } - - /* Verify that at least one iMCU row can be returned. */ - lines_per_iMCU_row = cinfo->max_v_samp_factor * cinfo->min_DCT_scaled_size; - if (max_lines < lines_per_iMCU_row) - ERREXIT(cinfo, JERR_BUFFER_SIZE); - - /* Decompress directly into user's buffer. */ - if (! (*cinfo->coef->decompress_data) (cinfo, data)) - return 0; /* suspension forced, can do nothing more */ - - /* OK, we processed one iMCU row. */ - cinfo->output_scanline += lines_per_iMCU_row; - return lines_per_iMCU_row; -} - - -/* Additional entry points for buffered-image mode. */ - -#ifdef D_MULTISCAN_FILES_SUPPORTED - -/* - * Initialize for an output pass in buffered-image mode. - */ - -GLOBAL(wxjpeg_boolean) -jpeg_start_output (j_decompress_ptr cinfo, int scan_number) -{ - if (cinfo->global_state != DSTATE_BUFIMAGE && - cinfo->global_state != DSTATE_PRESCAN) - ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state); - /* Limit scan number to valid range */ - if (scan_number <= 0) - scan_number = 1; - if (cinfo->inputctl->eoi_reached && - scan_number > cinfo->input_scan_number) - scan_number = cinfo->input_scan_number; - cinfo->output_scan_number = scan_number; - /* Perform any dummy output passes, and set up for the real pass */ - return output_pass_setup(cinfo); -} - - -/* - * Finish up after an output pass in buffered-image mode. - * - * Returns FALSE if suspended. The return value need be inspected only if - * a suspending data source is used. - */ - -GLOBAL(wxjpeg_boolean) -jpeg_finish_output (j_decompress_ptr cinfo) -{ - if ((cinfo->global_state == DSTATE_SCANNING || - cinfo->global_state == DSTATE_RAW_OK) && cinfo->buffered_image) { - /* Terminate this pass. */ - /* We do not require the whole pass to have been completed. */ - (*cinfo->master->finish_output_pass) (cinfo); - cinfo->global_state = DSTATE_BUFPOST; - } else if (cinfo->global_state != DSTATE_BUFPOST) { - /* BUFPOST = repeat call after a suspension, anything else is error */ - ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state); - } - /* Read markers looking for SOS or EOI */ - while (cinfo->input_scan_number <= cinfo->output_scan_number && - ! cinfo->inputctl->eoi_reached) { - if ((*cinfo->inputctl->consume_input) (cinfo) == JPEG_SUSPENDED) - return FALSE; /* Suspend, come back later */ - } - cinfo->global_state = DSTATE_BUFIMAGE; - return TRUE; -} - -#endif /* D_MULTISCAN_FILES_SUPPORTED */ diff --git a/wxWidgets/src/jpeg/jdatadst.c b/wxWidgets/src/jpeg/jdatadst.c deleted file mode 100644 index 053431fa66..0000000000 --- a/wxWidgets/src/jpeg/jdatadst.c +++ /dev/null @@ -1,151 +0,0 @@ -/* - * jdatadst.c - * - * Copyright (C) 1994-1996, Thomas G. Lane. - * This file is part of the Independent JPEG Group's software. - * For conditions of distribution and use, see the accompanying README file. - * - * This file contains compression data destination routines for the case of - * emitting JPEG data to a file (or any stdio stream). While these routines - * are sufficient for most applications, some will want to use a different - * destination manager. - * IMPORTANT: we assume that fwrite() will correctly transcribe an array of - * JOCTETs into 8-bit-wide elements on external storage. If char is wider - * than 8 bits on your machine, you may need to do some tweaking. - */ - -/* this is not a core library module, so it doesn't define JPEG_INTERNALS */ -#include "jinclude.h" -#include "jpeglib.h" -#include "jerror.h" - - -/* Expanded data destination object for stdio output */ - -typedef struct { - struct jpeg_destination_mgr pub; /* public fields */ - - FILE * outfile; /* target stream */ - JOCTET * buffer; /* start of buffer */ -} my_destination_mgr; - -typedef my_destination_mgr * my_dest_ptr; - -#define OUTPUT_BUF_SIZE 4096 /* choose an efficiently fwrite'able size */ - - -/* - * Initialize destination --- called by jpeg_start_compress - * before any data is actually written. - */ - -METHODDEF(void) -init_destination (j_compress_ptr cinfo) -{ - my_dest_ptr dest = (my_dest_ptr) cinfo->dest; - - /* Allocate the output buffer --- it will be released when done with image */ - dest->buffer = (JOCTET *) - (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, - OUTPUT_BUF_SIZE * SIZEOF(JOCTET)); - - dest->pub.next_output_byte = dest->buffer; - dest->pub.free_in_buffer = OUTPUT_BUF_SIZE; -} - - -/* - * Empty the output buffer --- called whenever buffer fills up. - * - * In typical applications, this should write the entire output buffer - * (ignoring the current state of next_output_byte & free_in_buffer), - * reset the pointer & count to the start of the buffer, and return TRUE - * indicating that the buffer has been dumped. - * - * In applications that need to be able to suspend compression due to output - * overrun, a FALSE return indicates that the buffer cannot be emptied now. - * In this situation, the compressor will return to its caller (possibly with - * an indication that it has not accepted all the supplied scanlines). The - * application should resume compression after it has made more room in the - * output buffer. Note that there are substantial restrictions on the use of - * suspension --- see the documentation. - * - * When suspending, the compressor will back up to a convenient restart point - * (typically the start of the current MCU). next_output_byte & free_in_buffer - * indicate where the restart point will be if the current call returns FALSE. - * Data beyond this point will be regenerated after resumption, so do not - * write it out when emptying the buffer externally. - */ - -METHODDEF(wxjpeg_boolean) -empty_output_buffer (j_compress_ptr cinfo) -{ - my_dest_ptr dest = (my_dest_ptr) cinfo->dest; - - if (JFWRITE(dest->outfile, dest->buffer, OUTPUT_BUF_SIZE) != - (size_t) OUTPUT_BUF_SIZE) - ERREXIT(cinfo, JERR_FILE_WRITE); - - dest->pub.next_output_byte = dest->buffer; - dest->pub.free_in_buffer = OUTPUT_BUF_SIZE; - - return TRUE; -} - - -/* - * Terminate destination --- called by jpeg_finish_compress - * after all data has been written. Usually needs to flush buffer. - * - * NB: *not* called by jpeg_abort or jpeg_destroy; surrounding - * application must deal with any cleanup that should happen even - * for error exit. - */ - -METHODDEF(void) -term_destination (j_compress_ptr cinfo) -{ - my_dest_ptr dest = (my_dest_ptr) cinfo->dest; - size_t datacount = OUTPUT_BUF_SIZE - dest->pub.free_in_buffer; - - /* Write any data remaining in the buffer */ - if (datacount > 0) { - if (JFWRITE(dest->outfile, dest->buffer, datacount) != datacount) - ERREXIT(cinfo, JERR_FILE_WRITE); - } - fflush(dest->outfile); - /* Make sure we wrote the output file OK */ - if (ferror(dest->outfile)) - ERREXIT(cinfo, JERR_FILE_WRITE); -} - - -/* - * Prepare for output to a stdio stream. - * The caller must have already opened the stream, and is responsible - * for closing it after finishing compression. - */ - -GLOBAL(void) -jpeg_stdio_dest (j_compress_ptr cinfo, FILE * outfile) -{ - my_dest_ptr dest; - - /* The destination object is made permanent so that multiple JPEG images - * can be written to the same file without re-executing jpeg_stdio_dest. - * This makes it dangerous to use this manager and a different destination - * manager serially with the same JPEG object, because their private object - * sizes may be different. Caveat programmer. - */ - if (cinfo->dest == NULL) { /* first time for this JPEG object? */ - cinfo->dest = (struct jpeg_destination_mgr *) - (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT, - SIZEOF(my_destination_mgr)); - } - - dest = (my_dest_ptr) cinfo->dest; - dest->pub.init_destination = init_destination; - dest->pub.empty_output_buffer = empty_output_buffer; - dest->pub.term_destination = term_destination; - dest->outfile = outfile; -} diff --git a/wxWidgets/src/jpeg/jdatasrc.c b/wxWidgets/src/jpeg/jdatasrc.c deleted file mode 100644 index 09a43300aa..0000000000 --- a/wxWidgets/src/jpeg/jdatasrc.c +++ /dev/null @@ -1,212 +0,0 @@ -/* - * jdatasrc.c - * - * Copyright (C) 1994-1996, Thomas G. Lane. - * This file is part of the Independent JPEG Group's software. - * For conditions of distribution and use, see the accompanying README file. - * - * This file contains decompression data source routines for the case of - * reading JPEG data from a file (or any stdio stream). While these routines - * are sufficient for most applications, some will want to use a different - * source manager. - * IMPORTANT: we assume that fread() will correctly transcribe an array of - * JOCTETs from 8-bit-wide elements on external storage. If char is wider - * than 8 bits on your machine, you may need to do some tweaking. - */ - -/* this is not a core library module, so it doesn't define JPEG_INTERNALS */ -#include "jinclude.h" -#include "jpeglib.h" -#include "jerror.h" - - -/* Expanded data source object for stdio input */ - -typedef struct { - struct jpeg_source_mgr pub; /* public fields */ - - FILE * infile; /* source stream */ - JOCTET * buffer; /* start of buffer */ - wxjpeg_boolean start_of_file; /* have we gotten any data yet? */ -} my_source_mgr; - -typedef my_source_mgr * my_src_ptr; - -#define INPUT_BUF_SIZE 4096 /* choose an efficiently fread'able size */ - - -/* - * Initialize source --- called by jpeg_read_header - * before any data is actually read. - */ - -METHODDEF(void) -init_source (j_decompress_ptr cinfo) -{ - my_src_ptr src = (my_src_ptr) cinfo->src; - - /* We reset the empty-input-file flag for each image, - * but we don't clear the input buffer. - * This is correct behavior for reading a series of images from one source. - */ - src->start_of_file = TRUE; -} - - -/* - * Fill the input buffer --- called whenever buffer is emptied. - * - * In typical applications, this should read fresh data into the buffer - * (ignoring the current state of next_input_byte & bytes_in_buffer), - * reset the pointer & count to the start of the buffer, and return TRUE - * indicating that the buffer has been reloaded. It is not necessary to - * fill the buffer entirely, only to obtain at least one more byte. - * - * There is no such thing as an EOF return. If the end of the file has been - * reached, the routine has a choice of ERREXIT() or inserting fake data into - * the buffer. In most cases, generating a warning message and inserting a - * fake EOI marker is the best course of action --- this will allow the - * decompressor to output however much of the image is there. However, - * the resulting error message is misleading if the real problem is an empty - * input file, so we handle that case specially. - * - * In applications that need to be able to suspend compression due to input - * not being available yet, a FALSE return indicates that no more data can be - * obtained right now, but more may be forthcoming later. In this situation, - * the decompressor will return to its caller (with an indication of the - * number of scanlines it has read, if any). The application should resume - * decompression after it has loaded more data into the input buffer. Note - * that there are substantial restrictions on the use of suspension --- see - * the documentation. - * - * When suspending, the decompressor will back up to a convenient restart point - * (typically the start of the current MCU). next_input_byte & bytes_in_buffer - * indicate where the restart point will be if the current call returns FALSE. - * Data beyond this point must be rescanned after resumption, so move it to - * the front of the buffer rather than discarding it. - */ - -METHODDEF(wxjpeg_boolean) -fill_input_buffer (j_decompress_ptr cinfo) -{ - my_src_ptr src = (my_src_ptr) cinfo->src; - size_t nbytes; - - nbytes = JFREAD(src->infile, src->buffer, INPUT_BUF_SIZE); - - if (nbytes <= 0) { - if (src->start_of_file) /* Treat empty input file as fatal error */ - ERREXIT(cinfo, JERR_INPUT_EMPTY); - WARNMS(cinfo, JWRN_JPEG_EOF); - /* Insert a fake EOI marker */ - src->buffer[0] = (JOCTET) 0xFF; - src->buffer[1] = (JOCTET) JPEG_EOI; - nbytes = 2; - } - - src->pub.next_input_byte = src->buffer; - src->pub.bytes_in_buffer = nbytes; - src->start_of_file = FALSE; - - return TRUE; -} - - -/* - * Skip data --- used to skip over a potentially large amount of - * uninteresting data (such as an APPn marker). - * - * Writers of suspendable-input applications must note that skip_input_data - * is not granted the right to give a suspension return. If the skip extends - * beyond the data currently in the buffer, the buffer can be marked empty so - * that the next read will cause a fill_input_buffer call that can suspend. - * Arranging for additional bytes to be discarded before reloading the input - * buffer is the application writer's problem. - */ - -METHODDEF(void) -skip_input_data (j_decompress_ptr cinfo, long num_bytes) -{ - my_src_ptr src = (my_src_ptr) cinfo->src; - - /* Just a dumb implementation for now. Could use fseek() except - * it doesn't work on pipes. Not clear that being smart is worth - * any trouble anyway --- large skips are infrequent. - */ - if (num_bytes > 0) { - while (num_bytes > (long) src->pub.bytes_in_buffer) { - num_bytes -= (long) src->pub.bytes_in_buffer; - (void) fill_input_buffer(cinfo); - /* note we assume that fill_input_buffer will never return FALSE, - * so suspension need not be handled. - */ - } - src->pub.next_input_byte += (size_t) num_bytes; - src->pub.bytes_in_buffer -= (size_t) num_bytes; - } -} - - -/* - * An additional method that can be provided by data source modules is the - * resync_to_restart method for error recovery in the presence of RST markers. - * For the moment, this source module just uses the default resync method - * provided by the JPEG library. That method assumes that no backtracking - * is possible. - */ - - -/* - * Terminate source --- called by jpeg_finish_decompress - * after all data has been read. Often a no-op. - * - * NB: *not* called by jpeg_abort or jpeg_destroy; surrounding - * application must deal with any cleanup that should happen even - * for error exit. - */ - -METHODDEF(void) -term_source (j_decompress_ptr cinfo) -{ - /* no work necessary here */ -} - - -/* - * Prepare for input from a stdio stream. - * The caller must have already opened the stream, and is responsible - * for closing it after finishing decompression. - */ - -GLOBAL(void) -jpeg_stdio_src (j_decompress_ptr cinfo, FILE * infile) -{ - my_src_ptr src; - - /* The source object and input buffer are made permanent so that a series - * of JPEG images can be read from the same file by calling jpeg_stdio_src - * only before the first one. (If we discarded the buffer at the end of - * one image, we'd likely lose the start of the next one.) - * This makes it unsafe to use this manager and a different source - * manager serially with the same JPEG object. Caveat programmer. - */ - if (cinfo->src == NULL) { /* first time for this JPEG object? */ - cinfo->src = (struct jpeg_source_mgr *) - (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT, - SIZEOF(my_source_mgr)); - src = (my_src_ptr) cinfo->src; - src->buffer = (JOCTET *) - (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT, - INPUT_BUF_SIZE * SIZEOF(JOCTET)); - } - - src = (my_src_ptr) cinfo->src; - src->pub.init_source = init_source; - src->pub.fill_input_buffer = fill_input_buffer; - src->pub.skip_input_data = skip_input_data; - src->pub.resync_to_restart = jpeg_resync_to_restart; /* use default method */ - src->pub.term_source = term_source; - src->infile = infile; - src->pub.bytes_in_buffer = 0; /* forces fill_input_buffer on first read */ - src->pub.next_input_byte = NULL; /* until buffer loaded */ -} diff --git a/wxWidgets/src/jpeg/jdcoefct.c b/wxWidgets/src/jpeg/jdcoefct.c deleted file mode 100644 index e5c3636e46..0000000000 --- a/wxWidgets/src/jpeg/jdcoefct.c +++ /dev/null @@ -1,745 +0,0 @@ -/* - * jdcoefct.c - * - * Copyright (C) 1994-1997, Thomas G. Lane. - * This file is part of the Independent JPEG Group's software. - * For conditions of distribution and use, see the accompanying README file. - * - * This file contains the coefficient buffer controller for decompression. - * This controller is the top level of the JPEG decompressor proper. - * The coefficient buffer lies between entropy decoding and inverse-DCT steps. - * - * In buffered-image mode, this controller is the interface between - * input-oriented processing and output-oriented processing. - * Also, the input side (only) is used when reading a file for transcoding. - */ - -#define JPEG_INTERNALS -#include "jinclude.h" -#include "jpeglib.h" - -/* Block smoothing is only applicable for progressive JPEG, so: */ -#ifndef D_PROGRESSIVE_SUPPORTED -#undef BLOCK_SMOOTHING_SUPPORTED -#endif - -/* Private buffer controller object */ - -typedef struct { - struct jpeg_d_coef_controller pub; /* public fields */ - - /* These variables keep track of the current location of the input side. */ - /* cinfo->input_iMCU_row is also used for this. */ - JDIMENSION MCU_ctr; /* counts MCUs processed in current row */ - int MCU_vert_offset; /* counts MCU rows within iMCU row */ - int MCU_rows_per_iMCU_row; /* number of such rows needed */ - - /* The output side's location is represented by cinfo->output_iMCU_row. */ - - /* In single-pass modes, it's sufficient to buffer just one MCU. - * We allocate a workspace of D_MAX_BLOCKS_IN_MCU coefficient blocks, - * and let the entropy decoder write into that workspace each time. - * (On 80x86, the workspace is FAR even though it's not really very big; - * this is to keep the module interfaces unchanged when a large coefficient - * buffer is necessary.) - * In multi-pass modes, this array points to the current MCU's blocks - * within the virtual arrays; it is used only by the input side. - */ - JBLOCKROW MCU_buffer[D_MAX_BLOCKS_IN_MCU]; - -#ifdef D_MULTISCAN_FILES_SUPPORTED - /* In multi-pass modes, we need a virtual block array for each component. */ - jvirt_barray_ptr whole_image[MAX_COMPONENTS]; -#endif - -#ifdef BLOCK_SMOOTHING_SUPPORTED - /* When doing block smoothing, we latch coefficient Al values here */ - int * coef_bits_latch; -#define SAVED_COEFS 6 /* we save coef_bits[0..5] */ -#endif -} my_coef_controller; - -typedef my_coef_controller * my_coef_ptr; - -/* Forward declarations */ -METHODDEF(int) decompress_onepass - JPP((j_decompress_ptr cinfo, JSAMPIMAGE output_buf)); -#ifdef D_MULTISCAN_FILES_SUPPORTED -METHODDEF(int) decompress_data - JPP((j_decompress_ptr cinfo, JSAMPIMAGE output_buf)); -#endif -#ifdef BLOCK_SMOOTHING_SUPPORTED -LOCAL(wxjpeg_boolean) smoothing_ok JPP((j_decompress_ptr cinfo)); -METHODDEF(int) decompress_smooth_data - JPP((j_decompress_ptr cinfo, JSAMPIMAGE output_buf)); -#endif - - -LOCAL(void) -start_iMCU_row (j_decompress_ptr cinfo) -/* Reset within-iMCU-row counters for a new row (input side) */ -{ - my_coef_ptr coef = (my_coef_ptr) cinfo->coef; - - /* In an interleaved scan, an MCU row is the same as an iMCU row. - * In a noninterleaved scan, an iMCU row has v_samp_factor MCU rows. - * But at the bottom of the image, process only what's left. - */ - if (cinfo->comps_in_scan > 1) { - coef->MCU_rows_per_iMCU_row = 1; - } else { - if (cinfo->input_iMCU_row < (cinfo->total_iMCU_rows-1)) - coef->MCU_rows_per_iMCU_row = cinfo->cur_comp_info[0]->v_samp_factor; - else - coef->MCU_rows_per_iMCU_row = cinfo->cur_comp_info[0]->last_row_height; - } - - coef->MCU_ctr = 0; - coef->MCU_vert_offset = 0; -} - - -/* - * Initialize for an input processing pass. - */ - -METHODDEF(void) -#if defined(__VISAGECPP__) -start_input_pass2 (j_decompress_ptr cinfo) -#else -start_input_pass (j_decompress_ptr cinfo) -#endif -{ - cinfo->input_iMCU_row = 0; - start_iMCU_row(cinfo); -} - -/* - * Initialize for an output processing pass. - */ - -METHODDEF(void) -start_output_pass (j_decompress_ptr cinfo) -{ -#ifdef BLOCK_SMOOTHING_SUPPORTED - my_coef_ptr coef = (my_coef_ptr) cinfo->coef; - - /* If multipass, check to see whether to use block smoothing on this pass */ - if (coef->pub.coef_arrays != NULL) { - if (cinfo->do_block_smoothing && smoothing_ok(cinfo)) - coef->pub.decompress_data = decompress_smooth_data; - else - coef->pub.decompress_data = decompress_data; - } -#endif - cinfo->output_iMCU_row = 0; -} - - -/* - * Decompress and return some data in the single-pass case. - * Always attempts to emit one fully interleaved MCU row ("iMCU" row). - * Input and output must run in lockstep since we have only a one-MCU buffer. - * Return value is JPEG_ROW_COMPLETED, JPEG_SCAN_COMPLETED, or JPEG_SUSPENDED. - * - * NB: output_buf contains a plane for each component in image, - * which we index according to the component's SOF position. - */ - -METHODDEF(int) -decompress_onepass (j_decompress_ptr cinfo, JSAMPIMAGE output_buf) -{ - my_coef_ptr coef = (my_coef_ptr) cinfo->coef; - JDIMENSION MCU_col_num; /* index of current MCU within row */ - JDIMENSION last_MCU_col = cinfo->MCUs_per_row - 1; - JDIMENSION last_iMCU_row = cinfo->total_iMCU_rows - 1; - int blkn, ci, xindex, yindex, yoffset, useful_width; - JSAMPARRAY output_ptr; - JDIMENSION start_col, output_col; - jpeg_component_info *compptr; - inverse_DCT_method_ptr inverse_DCT; - - /* Loop to process as much as one whole iMCU row */ - for (yoffset = coef->MCU_vert_offset; yoffset < coef->MCU_rows_per_iMCU_row; - yoffset++) { - for (MCU_col_num = coef->MCU_ctr; MCU_col_num <= last_MCU_col; - MCU_col_num++) { - /* Try to fetch an MCU. Entropy decoder expects buffer to be zeroed. */ - jzero_far((void FAR *) coef->MCU_buffer[0], - (size_t) (cinfo->blocks_in_MCU * SIZEOF(JBLOCK))); - if (! (*cinfo->entropy->decode_mcu) (cinfo, coef->MCU_buffer)) { - /* Suspension forced; update state counters and exit */ - coef->MCU_vert_offset = yoffset; - coef->MCU_ctr = MCU_col_num; - return JPEG_SUSPENDED; - } - /* Determine where data should go in output_buf and do the IDCT thing. - * We skip dummy blocks at the right and bottom edges (but blkn gets - * incremented past them!). Note the inner loop relies on having - * allocated the MCU_buffer[] blocks sequentially. - */ - blkn = 0; /* index of current DCT block within MCU */ - for (ci = 0; ci < cinfo->comps_in_scan; ci++) { - compptr = cinfo->cur_comp_info[ci]; - /* Don't bother to IDCT an uninteresting component. */ - if (! compptr->component_needed) { - blkn += compptr->MCU_blocks; - continue; - } - inverse_DCT = cinfo->idct->inverse_DCT[compptr->component_index]; - useful_width = (MCU_col_num < last_MCU_col) ? compptr->MCU_width - : compptr->last_col_width; - output_ptr = output_buf[compptr->component_index] + - yoffset * compptr->DCT_scaled_size; - start_col = MCU_col_num * compptr->MCU_sample_width; - for (yindex = 0; yindex < compptr->MCU_height; yindex++) { - if (cinfo->input_iMCU_row < last_iMCU_row || - yoffset+yindex < compptr->last_row_height) { - output_col = start_col; - for (xindex = 0; xindex < useful_width; xindex++) { - (*inverse_DCT) (cinfo, compptr, - (JCOEFPTR) coef->MCU_buffer[blkn+xindex], - output_ptr, output_col); - output_col += compptr->DCT_scaled_size; - } - } - blkn += compptr->MCU_width; - output_ptr += compptr->DCT_scaled_size; - } - } - } - /* Completed an MCU row, but perhaps not an iMCU row */ - coef->MCU_ctr = 0; - } - /* Completed the iMCU row, advance counters for next one */ - cinfo->output_iMCU_row++; - if (++(cinfo->input_iMCU_row) < cinfo->total_iMCU_rows) { - start_iMCU_row(cinfo); - return JPEG_ROW_COMPLETED; - } - /* Completed the scan */ - (*cinfo->inputctl->finish_input_pass) (cinfo); - return JPEG_SCAN_COMPLETED; -} - - -/* - * Dummy consume-input routine for single-pass operation. - */ - -METHODDEF(int) -dummy_consume_data (j_decompress_ptr cinfo) -{ - return JPEG_SUSPENDED; /* Always indicate nothing was done */ -} - - -#ifdef D_MULTISCAN_FILES_SUPPORTED - -/* - * Consume input data and store it in the full-image coefficient buffer. - * We read as much as one fully interleaved MCU row ("iMCU" row) per call, - * ie, v_samp_factor block rows for each component in the scan. - * Return value is JPEG_ROW_COMPLETED, JPEG_SCAN_COMPLETED, or JPEG_SUSPENDED. - */ - -METHODDEF(int) -consume_data (j_decompress_ptr cinfo) -{ - my_coef_ptr coef = (my_coef_ptr) cinfo->coef; - JDIMENSION MCU_col_num; /* index of current MCU within row */ - int blkn, ci, xindex, yindex, yoffset; - JDIMENSION start_col; - JBLOCKARRAY buffer[MAX_COMPS_IN_SCAN]; - JBLOCKROW buffer_ptr; - jpeg_component_info *compptr; - - /* Align the virtual buffers for the components used in this scan. */ - for (ci = 0; ci < cinfo->comps_in_scan; ci++) { - compptr = cinfo->cur_comp_info[ci]; - buffer[ci] = (*cinfo->mem->access_virt_barray) - ((j_common_ptr) cinfo, coef->whole_image[compptr->component_index], - cinfo->input_iMCU_row * compptr->v_samp_factor, - (JDIMENSION) compptr->v_samp_factor, TRUE); - /* Note: entropy decoder expects buffer to be zeroed, - * but this is handled automatically by the memory manager - * because we requested a pre-zeroed array. - */ - } - - /* Loop to process one whole iMCU row */ - for (yoffset = coef->MCU_vert_offset; yoffset < coef->MCU_rows_per_iMCU_row; - yoffset++) { - for (MCU_col_num = coef->MCU_ctr; MCU_col_num < cinfo->MCUs_per_row; - MCU_col_num++) { - /* Construct list of pointers to DCT blocks belonging to this MCU */ - blkn = 0; /* index of current DCT block within MCU */ - for (ci = 0; ci < cinfo->comps_in_scan; ci++) { - compptr = cinfo->cur_comp_info[ci]; - start_col = MCU_col_num * compptr->MCU_width; - for (yindex = 0; yindex < compptr->MCU_height; yindex++) { - buffer_ptr = buffer[ci][yindex+yoffset] + start_col; - for (xindex = 0; xindex < compptr->MCU_width; xindex++) { - coef->MCU_buffer[blkn++] = buffer_ptr++; - } - } - } - /* Try to fetch the MCU. */ - if (! (*cinfo->entropy->decode_mcu) (cinfo, coef->MCU_buffer)) { - /* Suspension forced; update state counters and exit */ - coef->MCU_vert_offset = yoffset; - coef->MCU_ctr = MCU_col_num; - return JPEG_SUSPENDED; - } - } - /* Completed an MCU row, but perhaps not an iMCU row */ - coef->MCU_ctr = 0; - } - /* Completed the iMCU row, advance counters for next one */ - if (++(cinfo->input_iMCU_row) < cinfo->total_iMCU_rows) { - start_iMCU_row(cinfo); - return JPEG_ROW_COMPLETED; - } - /* Completed the scan */ - (*cinfo->inputctl->finish_input_pass) (cinfo); - return JPEG_SCAN_COMPLETED; -} - - -/* - * Decompress and return some data in the multi-pass case. - * Always attempts to emit one fully interleaved MCU row ("iMCU" row). - * Return value is JPEG_ROW_COMPLETED, JPEG_SCAN_COMPLETED, or JPEG_SUSPENDED. - * - * NB: output_buf contains a plane for each component in image. - */ - -METHODDEF(int) -decompress_data (j_decompress_ptr cinfo, JSAMPIMAGE output_buf) -{ - my_coef_ptr coef = (my_coef_ptr) cinfo->coef; - JDIMENSION last_iMCU_row = cinfo->total_iMCU_rows - 1; - JDIMENSION block_num; - int ci, block_row, block_rows; - JBLOCKARRAY buffer; - JBLOCKROW buffer_ptr; - JSAMPARRAY output_ptr; - JDIMENSION output_col; - jpeg_component_info *compptr; - inverse_DCT_method_ptr inverse_DCT; - - /* Force some input to be done if we are getting ahead of the input. */ - while (cinfo->input_scan_number < cinfo->output_scan_number || - (cinfo->input_scan_number == cinfo->output_scan_number && - cinfo->input_iMCU_row <= cinfo->output_iMCU_row)) { - if ((*cinfo->inputctl->consume_input)(cinfo) == JPEG_SUSPENDED) - return JPEG_SUSPENDED; - } - - /* OK, output from the virtual arrays. */ - for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; - ci++, compptr++) { - /* Don't bother to IDCT an uninteresting component. */ - if (! compptr->component_needed) - continue; - /* Align the virtual buffer for this component. */ - buffer = (*cinfo->mem->access_virt_barray) - ((j_common_ptr) cinfo, coef->whole_image[ci], - cinfo->output_iMCU_row * compptr->v_samp_factor, - (JDIMENSION) compptr->v_samp_factor, FALSE); - /* Count non-dummy DCT block rows in this iMCU row. */ - if (cinfo->output_iMCU_row < last_iMCU_row) - block_rows = compptr->v_samp_factor; - else { - /* NB: can't use last_row_height here; it is input-side-dependent! */ - block_rows = (int) (compptr->height_in_blocks % compptr->v_samp_factor); - if (block_rows == 0) block_rows = compptr->v_samp_factor; - } - inverse_DCT = cinfo->idct->inverse_DCT[ci]; - output_ptr = output_buf[ci]; - /* Loop over all DCT blocks to be processed. */ - for (block_row = 0; block_row < block_rows; block_row++) { - buffer_ptr = buffer[block_row]; - output_col = 0; - for (block_num = 0; block_num < compptr->width_in_blocks; block_num++) { - (*inverse_DCT) (cinfo, compptr, (JCOEFPTR) buffer_ptr, - output_ptr, output_col); - buffer_ptr++; - output_col += compptr->DCT_scaled_size; - } - output_ptr += compptr->DCT_scaled_size; - } - } - - if (++(cinfo->output_iMCU_row) < cinfo->total_iMCU_rows) - return JPEG_ROW_COMPLETED; - return JPEG_SCAN_COMPLETED; -} - -#endif /* D_MULTISCAN_FILES_SUPPORTED */ - - -#ifdef BLOCK_SMOOTHING_SUPPORTED - -/* - * This code applies interblock smoothing as described by section K.8 - * of the JPEG standard: the first 5 AC coefficients are estimated from - * the DC values of a DCT block and its 8 neighboring blocks. - * We apply smoothing only for progressive JPEG decoding, and only if - * the coefficients it can estimate are not yet known to full precision. - */ - -/* Natural-order array positions of the first 5 zigzag-order coefficients */ -#define Q01_POS 1 -#define Q10_POS 8 -#define Q20_POS 16 -#define Q11_POS 9 -#define Q02_POS 2 - -/* - * Determine whether block smoothing is applicable and safe. - * We also latch the current states of the coef_bits[] entries for the - * AC coefficients; otherwise, if the input side of the decompressor - * advances into a new scan, we might think the coefficients are known - * more accurately than they really are. - */ - -LOCAL(wxjpeg_boolean) -smoothing_ok (j_decompress_ptr cinfo) -{ - my_coef_ptr coef = (my_coef_ptr) cinfo->coef; - wxjpeg_boolean smoothing_useful = FALSE; - int ci, coefi; - jpeg_component_info *compptr; - JQUANT_TBL * qtable; - int * coef_bits; - int * coef_bits_latch; - - if (! cinfo->progressive_mode || cinfo->coef_bits == NULL) - return FALSE; - - /* Allocate latch area if not already done */ - if (coef->coef_bits_latch == NULL) - coef->coef_bits_latch = (int *) - (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, - cinfo->num_components * - (SAVED_COEFS * SIZEOF(int))); - coef_bits_latch = coef->coef_bits_latch; - - for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; - ci++, compptr++) { - /* All components' quantization values must already be latched. */ - if ((qtable = compptr->quant_table) == NULL) - return FALSE; - /* Verify DC & first 5 AC quantizers are nonzero to avoid zero-divide. */ - if (qtable->quantval[0] == 0 || - qtable->quantval[Q01_POS] == 0 || - qtable->quantval[Q10_POS] == 0 || - qtable->quantval[Q20_POS] == 0 || - qtable->quantval[Q11_POS] == 0 || - qtable->quantval[Q02_POS] == 0) - return FALSE; - /* DC values must be at least partly known for all components. */ - coef_bits = cinfo->coef_bits[ci]; - if (coef_bits[0] < 0) - return FALSE; - /* Block smoothing is helpful if some AC coefficients remain inaccurate. */ - for (coefi = 1; coefi <= 5; coefi++) { - coef_bits_latch[coefi] = coef_bits[coefi]; - if (coef_bits[coefi] != 0) - smoothing_useful = TRUE; - } - coef_bits_latch += SAVED_COEFS; - } - - return smoothing_useful; -} - - -/* - * Variant of decompress_data for use when doing block smoothing. - */ - -METHODDEF(int) -decompress_smooth_data (j_decompress_ptr cinfo, JSAMPIMAGE output_buf) -{ - my_coef_ptr coef = (my_coef_ptr) cinfo->coef; - JDIMENSION last_iMCU_row = cinfo->total_iMCU_rows - 1; - JDIMENSION block_num, last_block_column; - int ci, block_row, block_rows, access_rows; - JBLOCKARRAY buffer; - JBLOCKROW buffer_ptr, prev_block_row, next_block_row; - JSAMPARRAY output_ptr; - JDIMENSION output_col; - jpeg_component_info *compptr; - inverse_DCT_method_ptr inverse_DCT; - wxjpeg_boolean first_row, last_row; - JBLOCK workspace; - int *coef_bits; - JQUANT_TBL *quanttbl; - JPEG_INT32 Q00,Q01,Q02,Q10,Q11,Q20, num; - int DC1,DC2,DC3,DC4,DC5,DC6,DC7,DC8,DC9; - int Al, pred; - - /* Force some input to be done if we are getting ahead of the input. */ - while (cinfo->input_scan_number <= cinfo->output_scan_number && - ! cinfo->inputctl->eoi_reached) { - if (cinfo->input_scan_number == cinfo->output_scan_number) { - /* If input is working on current scan, we ordinarily want it to - * have completed the current row. But if input scan is DC, - * we want it to keep one row ahead so that next block row's DC - * values are up to date. - */ - JDIMENSION delta = (cinfo->Ss == 0) ? 1 : 0; - if (cinfo->input_iMCU_row > cinfo->output_iMCU_row+delta) - break; - } - if ((*cinfo->inputctl->consume_input)(cinfo) == JPEG_SUSPENDED) - return JPEG_SUSPENDED; - } - - /* OK, output from the virtual arrays. */ - for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; - ci++, compptr++) { - /* Don't bother to IDCT an uninteresting component. */ - if (! compptr->component_needed) - continue; - /* Count non-dummy DCT block rows in this iMCU row. */ - if (cinfo->output_iMCU_row < last_iMCU_row) { - block_rows = compptr->v_samp_factor; - access_rows = block_rows * 2; /* this and next iMCU row */ - last_row = FALSE; - } else { - /* NB: can't use last_row_height here; it is input-side-dependent! */ - block_rows = (int) (compptr->height_in_blocks % compptr->v_samp_factor); - if (block_rows == 0) block_rows = compptr->v_samp_factor; - access_rows = block_rows; /* this iMCU row only */ - last_row = TRUE; - } - /* Align the virtual buffer for this component. */ - if (cinfo->output_iMCU_row > 0) { - access_rows += compptr->v_samp_factor; /* prior iMCU row too */ - buffer = (*cinfo->mem->access_virt_barray) - ((j_common_ptr) cinfo, coef->whole_image[ci], - (cinfo->output_iMCU_row - 1) * compptr->v_samp_factor, - (JDIMENSION) access_rows, FALSE); - buffer += compptr->v_samp_factor; /* point to current iMCU row */ - first_row = FALSE; - } else { - buffer = (*cinfo->mem->access_virt_barray) - ((j_common_ptr) cinfo, coef->whole_image[ci], - (JDIMENSION) 0, (JDIMENSION) access_rows, FALSE); - first_row = TRUE; - } - /* Fetch component-dependent info */ - coef_bits = coef->coef_bits_latch + (ci * SAVED_COEFS); - quanttbl = compptr->quant_table; - Q00 = quanttbl->quantval[0]; - Q01 = quanttbl->quantval[Q01_POS]; - Q10 = quanttbl->quantval[Q10_POS]; - Q20 = quanttbl->quantval[Q20_POS]; - Q11 = quanttbl->quantval[Q11_POS]; - Q02 = quanttbl->quantval[Q02_POS]; - inverse_DCT = cinfo->idct->inverse_DCT[ci]; - output_ptr = output_buf[ci]; - /* Loop over all DCT blocks to be processed. */ - for (block_row = 0; block_row < block_rows; block_row++) { - buffer_ptr = buffer[block_row]; - if (first_row && block_row == 0) - prev_block_row = buffer_ptr; - else - prev_block_row = buffer[block_row-1]; - if (last_row && block_row == block_rows-1) - next_block_row = buffer_ptr; - else - next_block_row = buffer[block_row+1]; - /* We fetch the surrounding DC values using a sliding-register approach. - * Initialize all nine here so as to do the right thing on narrow pics. - */ - DC1 = DC2 = DC3 = (int) prev_block_row[0][0]; - DC4 = DC5 = DC6 = (int) buffer_ptr[0][0]; - DC7 = DC8 = DC9 = (int) next_block_row[0][0]; - output_col = 0; - last_block_column = compptr->width_in_blocks - 1; - for (block_num = 0; block_num <= last_block_column; block_num++) { - /* Fetch current DCT block into workspace so we can modify it. */ - jcopy_block_row(buffer_ptr, (JBLOCKROW) workspace, (JDIMENSION) 1); - /* Update DC values */ - if (block_num < last_block_column) { - DC3 = (int) prev_block_row[1][0]; - DC6 = (int) buffer_ptr[1][0]; - DC9 = (int) next_block_row[1][0]; - } - /* Compute coefficient estimates per K.8. - * An estimate is applied only if coefficient is still zero, - * and is not known to be fully accurate. - */ - /* AC01 */ - if ((Al=coef_bits[1]) != 0 && workspace[1] == 0) { - num = 36 * Q00 * (DC4 - DC6); - if (num >= 0) { - pred = (int) (((Q01<<7) + num) / (Q01<<8)); - if (Al > 0 && pred >= (1< 0 && pred >= (1<= 0) { - pred = (int) (((Q10<<7) + num) / (Q10<<8)); - if (Al > 0 && pred >= (1< 0 && pred >= (1<= 0) { - pred = (int) (((Q20<<7) + num) / (Q20<<8)); - if (Al > 0 && pred >= (1< 0 && pred >= (1<= 0) { - pred = (int) (((Q11<<7) + num) / (Q11<<8)); - if (Al > 0 && pred >= (1< 0 && pred >= (1<= 0) { - pred = (int) (((Q02<<7) + num) / (Q02<<8)); - if (Al > 0 && pred >= (1< 0 && pred >= (1<DCT_scaled_size; - } - output_ptr += compptr->DCT_scaled_size; - } - } - - if (++(cinfo->output_iMCU_row) < cinfo->total_iMCU_rows) - return JPEG_ROW_COMPLETED; - return JPEG_SCAN_COMPLETED; -} - -#endif /* BLOCK_SMOOTHING_SUPPORTED */ - - -/* - * Initialize coefficient buffer controller. - */ - -GLOBAL(void) -jinit_d_coef_controller (j_decompress_ptr cinfo, wxjpeg_boolean need_full_buffer) -{ - my_coef_ptr coef; - - coef = (my_coef_ptr) - (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, - SIZEOF(my_coef_controller)); - cinfo->coef = (struct jpeg_d_coef_controller *) coef; -#if defined(__VISAGECPP__) - coef->pub.start_input_pass2 = start_input_pass2; -#else - coef->pub.start_input_pass = start_input_pass; -#endif - - coef->pub.start_output_pass = start_output_pass; -#ifdef BLOCK_SMOOTHING_SUPPORTED - coef->coef_bits_latch = NULL; -#endif - - /* Create the coefficient buffer. */ - if (need_full_buffer) { -#ifdef D_MULTISCAN_FILES_SUPPORTED - /* Allocate a full-image virtual array for each component, */ - /* padded to a multiple of samp_factor DCT blocks in each direction. */ - /* Note we ask for a pre-zeroed array. */ - int ci, access_rows; - jpeg_component_info *compptr; - - for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; - ci++, compptr++) { - access_rows = compptr->v_samp_factor; -#ifdef BLOCK_SMOOTHING_SUPPORTED - /* If block smoothing could be used, need a bigger window */ - if (cinfo->progressive_mode) - access_rows *= 3; -#endif - coef->whole_image[ci] = (*cinfo->mem->request_virt_barray) - ((j_common_ptr) cinfo, JPOOL_IMAGE, TRUE, - (JDIMENSION) jround_up((long) compptr->width_in_blocks, - (long) compptr->h_samp_factor), - (JDIMENSION) jround_up((long) compptr->height_in_blocks, - (long) compptr->v_samp_factor), - (JDIMENSION) access_rows); - } - coef->pub.consume_data = consume_data; - coef->pub.decompress_data = decompress_data; - coef->pub.coef_arrays = coef->whole_image; /* link to virtual arrays */ -#else - ERREXIT(cinfo, JERR_NOT_COMPILED); -#endif - } else { - /* We only need a single-MCU buffer. */ - JBLOCKROW buffer; - int i; - - buffer = (JBLOCKROW) - (*cinfo->mem->alloc_large) ((j_common_ptr) cinfo, JPOOL_IMAGE, - D_MAX_BLOCKS_IN_MCU * SIZEOF(JBLOCK)); - for (i = 0; i < D_MAX_BLOCKS_IN_MCU; i++) { - coef->MCU_buffer[i] = buffer + i; - } - coef->pub.consume_data = dummy_consume_data; - coef->pub.decompress_data = decompress_onepass; - coef->pub.coef_arrays = NULL; /* flag for no virtual arrays */ - } -} - diff --git a/wxWidgets/src/jpeg/jdcolor.c b/wxWidgets/src/jpeg/jdcolor.c deleted file mode 100644 index cca2842297..0000000000 --- a/wxWidgets/src/jpeg/jdcolor.c +++ /dev/null @@ -1,410 +0,0 @@ -/* - * jdcolor.c - * - * Copyright (C) 1991-1997, Thomas G. Lane. - * This file is part of the Independent JPEG Group's software. - * For conditions of distribution and use, see the accompanying README file. - * - * This file contains output colorspace conversion routines. - */ - -#define JPEG_INTERNALS -#include "jinclude.h" -#include "jpeglib.h" - -#if defined(__VISAGECPP__) -/* Visual Age fixups for multiple declarations */ -# define null_convert null_convert2 /* already in jcmaint.c */ -# define grayscale_convert grayscale_convert2 /* already in jcmaint.c */ -#endif - -/* Private subobject */ - -typedef struct { - struct jpeg_color_deconverter pub; /* public fields */ - - /* Private state for YCC->RGB conversion */ - int * Cr_r_tab; /* => table for Cr to R conversion */ - int * Cb_b_tab; /* => table for Cb to B conversion */ - JPEG_INT32 * Cr_g_tab; /* => table for Cr to G conversion */ - JPEG_INT32 * Cb_g_tab; /* => table for Cb to G conversion */ -} my_color_deconverter; - -typedef my_color_deconverter * my_cconvert_ptr; - - -/**************** YCbCr -> RGB conversion: most common case **************/ - -/* - * YCbCr is defined per CCIR 601-1, except that Cb and Cr are - * normalized to the range 0..MAXJSAMPLE rather than -0.5 .. 0.5. - * The conversion equations to be implemented are therefore - * R = Y + 1.40200 * Cr - * G = Y - 0.34414 * Cb - 0.71414 * Cr - * B = Y + 1.77200 * Cb - * where Cb and Cr represent the incoming values less CENTERJSAMPLE. - * (These numbers are derived from TIFF 6.0 section 21, dated 3-June-92.) - * - * To avoid floating-point arithmetic, we represent the fractional constants - * as integers scaled up by 2^16 (about 4 digits precision); we have to divide - * the products by 2^16, with appropriate rounding, to get the correct answer. - * Notice that Y, being an integral input, does not contribute any fraction - * so it need not participate in the rounding. - * - * For even more speed, we avoid doing any multiplications in the inner loop - * by precalculating the constants times Cb and Cr for all possible values. - * For 8-bit JSAMPLEs this is very reasonable (only 256 entries per table); - * for 12-bit samples it is still acceptable. It's not very reasonable for - * 16-bit samples, but if you want lossless storage you shouldn't be changing - * colorspace anyway. - * The Cr=>R and Cb=>B values can be rounded to integers in advance; the - * values for the G calculation are left scaled up, since we must add them - * together before rounding. - */ - -#define SCALEBITS 16 /* speediest right-shift on some machines */ -#define ONE_HALF ((JPEG_INT32) 1 << (SCALEBITS-1)) -#define FIX(x) ((JPEG_INT32) ((x) * (1L<RGB colorspace conversion. - */ - -LOCAL(void) -build_ycc_rgb_table (j_decompress_ptr cinfo) -{ - my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert; - int i; - JPEG_INT32 x; - SHIFT_TEMPS - - cconvert->Cr_r_tab = (int *) - (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, - (MAXJSAMPLE+1) * SIZEOF(int)); - cconvert->Cb_b_tab = (int *) - (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, - (MAXJSAMPLE+1) * SIZEOF(int)); - cconvert->Cr_g_tab = (JPEG_INT32 *) - (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, - (MAXJSAMPLE+1) * SIZEOF(JPEG_INT32)); - cconvert->Cb_g_tab = (JPEG_INT32 *) - (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, - (MAXJSAMPLE+1) * SIZEOF(JPEG_INT32)); - - for (i = 0, x = -CENTERJSAMPLE; i <= MAXJSAMPLE; i++, x++) { - /* i is the actual input pixel value, in the range 0..MAXJSAMPLE */ - /* The Cb or Cr value we are thinking of is x = i - CENTERJSAMPLE */ - /* Cr=>R value is nearest int to 1.40200 * x */ - cconvert->Cr_r_tab[i] = (int) - RIGHT_SHIFT(FIX(1.40200) * x + ONE_HALF, SCALEBITS); - /* Cb=>B value is nearest int to 1.77200 * x */ - cconvert->Cb_b_tab[i] = (int) - RIGHT_SHIFT(FIX(1.77200) * x + ONE_HALF, SCALEBITS); - /* Cr=>G value is scaled-up -0.71414 * x */ - cconvert->Cr_g_tab[i] = (- FIX(0.71414)) * x; - /* Cb=>G value is scaled-up -0.34414 * x */ - /* We also add in ONE_HALF so that need not do it in inner loop */ - cconvert->Cb_g_tab[i] = (- FIX(0.34414)) * x + ONE_HALF; - } -} - - -/* - * Convert some rows of samples to the output colorspace. - * - * Note that we change from noninterleaved, one-plane-per-component format - * to interleaved-pixel format. The output buffer is therefore three times - * as wide as the input buffer. - * A starting row offset is provided only for the input buffer. The caller - * can easily adjust the passed output_buf value to accommodate any row - * offset required on that side. - */ - -METHODDEF(void) -ycc_rgb_convert (j_decompress_ptr cinfo, - JSAMPIMAGE input_buf, JDIMENSION input_row, - JSAMPARRAY output_buf, int num_rows) -{ - my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert; - register int y, cb, cr; - register JSAMPROW outptr; - register JSAMPROW inptr0, inptr1, inptr2; - register JDIMENSION col; - JDIMENSION num_cols = cinfo->output_width; - /* copy these pointers into registers if possible */ - register JSAMPLE * range_limit = cinfo->sample_range_limit; - register int * Crrtab = cconvert->Cr_r_tab; - register int * Cbbtab = cconvert->Cb_b_tab; - register JPEG_INT32 * Crgtab = cconvert->Cr_g_tab; - register JPEG_INT32 * Cbgtab = cconvert->Cb_g_tab; - SHIFT_TEMPS - - while (--num_rows >= 0) { - inptr0 = input_buf[0][input_row]; - inptr1 = input_buf[1][input_row]; - inptr2 = input_buf[2][input_row]; - input_row++; - outptr = *output_buf++; - for (col = 0; col < num_cols; col++) { - y = GETJSAMPLE(inptr0[col]); - cb = GETJSAMPLE(inptr1[col]); - cr = GETJSAMPLE(inptr2[col]); - /* Range-limiting is essential due to noise introduced by DCT losses. */ - outptr[RGB_RED] = range_limit[y + Crrtab[cr]]; - outptr[RGB_GREEN] = range_limit[y + - ((int) RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr], - SCALEBITS))]; - outptr[RGB_BLUE] = range_limit[y + Cbbtab[cb]]; - outptr += RGB_PIXELSIZE; - } - } -} - - -/**************** Cases other than YCbCr -> RGB **************/ - - -/* - * Color conversion for no colorspace change: just copy the data, - * converting from separate-planes to interleaved representation. - */ - -METHODDEF(void) -null_convert (j_decompress_ptr cinfo, - JSAMPIMAGE input_buf, JDIMENSION input_row, - JSAMPARRAY output_buf, int num_rows) -{ - register JSAMPROW inptr, outptr; - register JDIMENSION count; - register int num_components = cinfo->num_components; - JDIMENSION num_cols = cinfo->output_width; - int ci; - - while (--num_rows >= 0) { - for (ci = 0; ci < num_components; ci++) { - inptr = input_buf[ci][input_row]; - outptr = output_buf[0] + ci; - for (count = num_cols; count > 0; count--) { - *outptr = *inptr++; /* needn't bother with GETJSAMPLE() here */ - outptr += num_components; - } - } - input_row++; - output_buf++; - } -} - - -/* - * Color conversion for grayscale: just copy the data. - * This also works for YCbCr -> grayscale conversion, in which - * we just copy the Y (luminance) component and ignore chrominance. - */ - -METHODDEF(void) -grayscale_convert (j_decompress_ptr cinfo, - JSAMPIMAGE input_buf, JDIMENSION input_row, - JSAMPARRAY output_buf, int num_rows) -{ - jcopy_sample_rows(input_buf[0], (int) input_row, output_buf, 0, - num_rows, cinfo->output_width); -} - - -/* - * Convert grayscale to RGB: just duplicate the graylevel three times. - * This is provided to support applications that don't want to cope - * with grayscale as a separate case. - */ - -METHODDEF(void) -gray_rgb_convert (j_decompress_ptr cinfo, - JSAMPIMAGE input_buf, JDIMENSION input_row, - JSAMPARRAY output_buf, int num_rows) -{ - register JSAMPROW inptr, outptr; - register JDIMENSION col; - JDIMENSION num_cols = cinfo->output_width; - - while (--num_rows >= 0) { - inptr = input_buf[0][input_row++]; - outptr = *output_buf++; - for (col = 0; col < num_cols; col++) { - /* We can dispense with GETJSAMPLE() here */ - outptr[RGB_RED] = outptr[RGB_GREEN] = outptr[RGB_BLUE] = inptr[col]; - outptr += RGB_PIXELSIZE; - } - } -} - - -/* - * Adobe-style YCCK->CMYK conversion. - * We convert YCbCr to R=1-C, G=1-M, and B=1-Y using the same - * conversion as above, while passing K (black) unchanged. - * We assume build_ycc_rgb_table has been called. - */ - -METHODDEF(void) -ycck_cmyk_convert (j_decompress_ptr cinfo, - JSAMPIMAGE input_buf, JDIMENSION input_row, - JSAMPARRAY output_buf, int num_rows) -{ - my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert; - register int y, cb, cr; - register JSAMPROW outptr; - register JSAMPROW inptr0, inptr1, inptr2, inptr3; - register JDIMENSION col; - JDIMENSION num_cols = cinfo->output_width; - /* copy these pointers into registers if possible */ - register JSAMPLE * range_limit = cinfo->sample_range_limit; - register int * Crrtab = cconvert->Cr_r_tab; - register int * Cbbtab = cconvert->Cb_b_tab; - register JPEG_INT32 * Crgtab = cconvert->Cr_g_tab; - register JPEG_INT32 * Cbgtab = cconvert->Cb_g_tab; - SHIFT_TEMPS - - while (--num_rows >= 0) { - inptr0 = input_buf[0][input_row]; - inptr1 = input_buf[1][input_row]; - inptr2 = input_buf[2][input_row]; - inptr3 = input_buf[3][input_row]; - input_row++; - outptr = *output_buf++; - for (col = 0; col < num_cols; col++) { - y = GETJSAMPLE(inptr0[col]); - cb = GETJSAMPLE(inptr1[col]); - cr = GETJSAMPLE(inptr2[col]); - /* Range-limiting is essential due to noise introduced by DCT losses. */ - outptr[0] = range_limit[MAXJSAMPLE - (y + Crrtab[cr])]; /* red */ - outptr[1] = range_limit[MAXJSAMPLE - (y + /* green */ - ((int) RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr], - SCALEBITS)))]; - outptr[2] = range_limit[MAXJSAMPLE - (y + Cbbtab[cb])]; /* blue */ - /* K passes through unchanged */ - outptr[3] = inptr3[col]; /* don't need GETJSAMPLE here */ - outptr += 4; - } - } -} - - -/* - * Empty method for start_pass. - */ - -METHODDEF(void) -start_pass_dcolor (j_decompress_ptr cinfo) -{ - /* no work needed */ -} - - -/* - * Module initialization routine for output colorspace conversion. - */ - -GLOBAL(void) -jinit_color_deconverter (j_decompress_ptr cinfo) -{ - my_cconvert_ptr cconvert; - int ci; - - cconvert = (my_cconvert_ptr) - (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, - SIZEOF(my_color_deconverter)); - cinfo->cconvert = (struct jpeg_color_deconverter *) cconvert; - cconvert->pub.start_pass = start_pass_dcolor; - - /* Make sure num_components agrees with jpeg_color_space */ - switch (cinfo->jpeg_color_space) { - case JCS_GRAYSCALE: - if (cinfo->num_components != 1) - ERREXIT(cinfo, JERR_BAD_J_COLORSPACE); - break; - - case JCS_RGB: - case JCS_YCbCr: - if (cinfo->num_components != 3) - ERREXIT(cinfo, JERR_BAD_J_COLORSPACE); - break; - - case JCS_CMYK: - case JCS_YCCK: - if (cinfo->num_components != 4) - ERREXIT(cinfo, JERR_BAD_J_COLORSPACE); - break; - - default: /* JCS_UNKNOWN can be anything */ - if (cinfo->num_components < 1) - ERREXIT(cinfo, JERR_BAD_J_COLORSPACE); - break; - } - - /* Set out_color_components and conversion method based on requested space. - * Also clear the component_needed flags for any unused components, - * so that earlier pipeline stages can avoid useless computation. - */ - - switch (cinfo->out_color_space) { - case JCS_GRAYSCALE: - cinfo->out_color_components = 1; - if (cinfo->jpeg_color_space == JCS_GRAYSCALE || - cinfo->jpeg_color_space == JCS_YCbCr) { - cconvert->pub.color_convert = grayscale_convert; - /* For color->grayscale conversion, only the Y (0) component is needed */ - for (ci = 1; ci < cinfo->num_components; ci++) - cinfo->comp_info[ci].component_needed = FALSE; - } else - ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL); - break; - - case JCS_RGB: - cinfo->out_color_components = RGB_PIXELSIZE; - if (cinfo->jpeg_color_space == JCS_YCbCr) { - cconvert->pub.color_convert = ycc_rgb_convert; - build_ycc_rgb_table(cinfo); - } else if (cinfo->jpeg_color_space == JCS_GRAYSCALE) { - cconvert->pub.color_convert = gray_rgb_convert; - } else if (cinfo->jpeg_color_space == JCS_RGB && RGB_PIXELSIZE == 3) { - cconvert->pub.color_convert = null_convert; - } else - ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL); - break; - - case JCS_CMYK: - cinfo->out_color_components = 4; - if (cinfo->jpeg_color_space == JCS_YCCK) { - cconvert->pub.color_convert = ycck_cmyk_convert; - build_ycc_rgb_table(cinfo); - } else if (cinfo->jpeg_color_space == JCS_CMYK) { - cconvert->pub.color_convert = null_convert; - } else - ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL); - break; - - default: - /* Permit null conversion to same output space */ - if (cinfo->out_color_space == cinfo->jpeg_color_space) { - cinfo->out_color_components = cinfo->num_components; - cconvert->pub.color_convert = null_convert; - } else /* unsupported non-null conversion */ - ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL); - break; - } - - if (cinfo->quantize_colors) - cinfo->output_components = 1; /* single colormapped output component */ - else - cinfo->output_components = cinfo->out_color_components; -} - -#if defined(__VISAGECPP__) -# ifdef null_convert2 -# undef null_convert2 -# endif -# ifdef grayscale_convert2 -# undef grayscale_convert2 -# endif -#endif diff --git a/wxWidgets/src/jpeg/jdct.h b/wxWidgets/src/jpeg/jdct.h deleted file mode 100644 index 42180f390e..0000000000 --- a/wxWidgets/src/jpeg/jdct.h +++ /dev/null @@ -1,176 +0,0 @@ -/* - * jdct.h - * - * Copyright (C) 1994-1996, Thomas G. Lane. - * This file is part of the Independent JPEG Group's software. - * For conditions of distribution and use, see the accompanying README file. - * - * This include file contains common declarations for the forward and - * inverse DCT modules. These declarations are private to the DCT managers - * (jcdctmgr.c, jddctmgr.c) and the individual DCT algorithms. - * The individual DCT algorithms are kept in separate files to ease - * machine-dependent tuning (e.g., assembly coding). - */ - - -/* - * A forward DCT routine is given a pointer to a work area of type DCTELEM[]; - * the DCT is to be performed in-place in that buffer. Type DCTELEM is int - * for 8-bit samples, INT32 for 12-bit samples. (NOTE: Floating-point DCT - * implementations use an array of type FAST_FLOAT, instead.) - * The DCT inputs are expected to be signed (range +-CENTERJSAMPLE). - * The DCT outputs are returned scaled up by a factor of 8; they therefore - * have a range of +-8K for 8-bit data, +-128K for 12-bit data. This - * convention improves accuracy in integer implementations and saves some - * work in floating-point ones. - * Quantization of the output coefficients is done by jcdctmgr.c. - */ - -#if BITS_IN_JSAMPLE == 8 -typedef int DCTELEM; /* 16 or 32 bits is fine */ -#else -typedef JPEG_INT32 DCTELEM; /* must have 32 bits */ -#endif - -typedef JMETHOD(void, forward_DCT_method_ptr, (DCTELEM * data)); -typedef JMETHOD(void, float_DCT_method_ptr, (FAST_FLOAT * data)); - - -/* - * An inverse DCT routine is given a pointer to the input JBLOCK and a pointer - * to an output sample array. The routine must dequantize the input data as - * well as perform the IDCT; for dequantization, it uses the multiplier table - * pointed to by compptr->dct_table. The output data is to be placed into the - * sample array starting at a specified column. (Any row offset needed will - * be applied to the array pointer before it is passed to the IDCT code.) - * Note that the number of samples emitted by the IDCT routine is - * DCT_scaled_size * DCT_scaled_size. - */ - -/* typedef inverse_DCT_method_ptr is declared in jpegint.h */ - -/* - * Each IDCT routine has its own ideas about the best dct_table element type. - */ - -typedef MULTIPLIER ISLOW_MULT_TYPE; /* short or int, whichever is faster */ -#if BITS_IN_JSAMPLE == 8 -typedef MULTIPLIER IFAST_MULT_TYPE; /* 16 bits is OK, use short if faster */ -#define IFAST_SCALE_BITS 2 /* fractional bits in scale factors */ -#else -typedef JPEG_INT32 IFAST_MULT_TYPE; /* need 32 bits for scaled quantizers */ -#define IFAST_SCALE_BITS 13 /* fractional bits in scale factors */ -#endif -typedef FAST_FLOAT FLOAT_MULT_TYPE; /* preferred floating type */ - - -/* - * Each IDCT routine is responsible for range-limiting its results and - * converting them to unsigned form (0..MAXJSAMPLE). The raw outputs could - * be quite far out of range if the input data is corrupt, so a bulletproof - * range-limiting step is required. We use a mask-and-table-lookup method - * to do the combined operations quickly. See the comments with - * prepare_range_limit_table (in jdmaster.c) for more info. - */ - -#define IDCT_range_limit(cinfo) ((cinfo)->sample_range_limit + CENTERJSAMPLE) - -#define RANGE_MASK (MAXJSAMPLE * 4 + 3) /* 2 bits wider than legal samples */ - - -/* Short forms of external names for systems with brain-damaged linkers. */ - -#ifdef NEED_SHORT_EXTERNAL_NAMES -#define jpeg_fdct_islow jFDislow -#define jpeg_fdct_ifast jFDifast -#define jpeg_fdct_float jFDfloat -#define jpeg_idct_islow jRDislow -#define jpeg_idct_ifast jRDifast -#define jpeg_idct_float jRDfloat -#define jpeg_idct_4x4 jRD4x4 -#define jpeg_idct_2x2 jRD2x2 -#define jpeg_idct_1x1 jRD1x1 -#endif /* NEED_SHORT_EXTERNAL_NAMES */ - -/* Extern declarations for the forward and inverse DCT routines. */ - -EXTERN(void) jpeg_fdct_islow JPP((DCTELEM * data)); -EXTERN(void) jpeg_fdct_ifast JPP((DCTELEM * data)); -EXTERN(void) jpeg_fdct_float JPP((FAST_FLOAT * data)); - -EXTERN(void) jpeg_idct_islow - JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr, - JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col)); -EXTERN(void) jpeg_idct_ifast - JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr, - JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col)); -EXTERN(void) jpeg_idct_float - JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr, - JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col)); -EXTERN(void) jpeg_idct_4x4 - JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr, - JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col)); -EXTERN(void) jpeg_idct_2x2 - JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr, - JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col)); -EXTERN(void) jpeg_idct_1x1 - JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr, - JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col)); - - -/* - * Macros for handling fixed-point arithmetic; these are used by many - * but not all of the DCT/IDCT modules. - * - * All values are expected to be of type INT32. - * Fractional constants are scaled left by CONST_BITS bits. - * CONST_BITS is defined within each module using these macros, - * and may differ from one module to the next. - */ - -#define ONE ((JPEG_INT32) 1) -#define CONST_SCALE (ONE << CONST_BITS) - -/* Convert a positive real constant to an integer scaled by CONST_SCALE. - * Caution: some C compilers fail to reduce "FIX(constant)" at compile time, - * thus causing a lot of useless floating-point operations at run time. - */ - -#define FIX(x) ((JPEG_INT32) ((x) * CONST_SCALE + 0.5)) - -/* Descale and correctly round an INT32 value that's scaled by N bits. - * We assume RIGHT_SHIFT rounds towards minus infinity, so adding - * the fudge factor is correct for either sign of X. - */ - -#define DESCALE(x,n) RIGHT_SHIFT((x) + (ONE << ((n)-1)), n) - -/* Multiply an INT32 variable by an INT32 constant to yield an INT32 result. - * This macro is used only when the two inputs will actually be no more than - * 16 bits wide, so that a 16x16->32 bit multiply can be used instead of a - * full 32x32 multiply. This provides a useful speedup on many machines. - * Unfortunately there is no way to specify a 16x16->32 multiply portably - * in C, but some C compilers will do the right thing if you provide the - * correct combination of casts. - */ - -#ifdef SHORTxSHORT_32 /* may work if 'int' is 32 bits */ -#define MULTIPLY16C16(var,const) (((INT16) (var)) * ((INT16) (const))) -#endif -#ifdef SHORTxLCONST_32 /* known to work with Microsoft C 6.0 */ -#define MULTIPLY16C16(var,const) (((INT16) (var)) * ((JPEG_INT32) (const))) -#endif - -#ifndef MULTIPLY16C16 /* default definition */ -#define MULTIPLY16C16(var,const) ((var) * (const)) -#endif - -/* Same except both inputs are variables. */ - -#ifdef SHORTxSHORT_32 /* may work if 'int' is 32 bits */ -#define MULTIPLY16V16(var1,var2) (((INT16) (var1)) * ((INT16) (var2))) -#endif - -#ifndef MULTIPLY16V16 /* default definition */ -#define MULTIPLY16V16(var1,var2) ((var1) * (var2)) -#endif diff --git a/wxWidgets/src/jpeg/jddctmgr.c b/wxWidgets/src/jpeg/jddctmgr.c deleted file mode 100644 index e27cc3d511..0000000000 --- a/wxWidgets/src/jpeg/jddctmgr.c +++ /dev/null @@ -1,269 +0,0 @@ -/* - * jddctmgr.c - * - * Copyright (C) 1994-1996, Thomas G. Lane. - * This file is part of the Independent JPEG Group's software. - * For conditions of distribution and use, see the accompanying README file. - * - * This file contains the inverse-DCT management logic. - * This code selects a particular IDCT implementation to be used, - * and it performs related housekeeping chores. No code in this file - * is executed per IDCT step, only during output pass setup. - * - * Note that the IDCT routines are responsible for performing coefficient - * dequantization as well as the IDCT proper. This module sets up the - * dequantization multiplier table needed by the IDCT routine. - */ - -#define JPEG_INTERNALS -#include "jinclude.h" -#include "jpeglib.h" -#include "jdct.h" /* Private declarations for DCT subsystem */ - - -/* - * The decompressor input side (jdinput.c) saves away the appropriate - * quantization table for each component at the start of the first scan - * involving that component. (This is necessary in order to correctly - * decode files that reuse Q-table slots.) - * When we are ready to make an output pass, the saved Q-table is converted - * to a multiplier table that will actually be used by the IDCT routine. - * The multiplier table contents are IDCT-method-dependent. To support - * application changes in IDCT method between scans, we can remake the - * multiplier tables if necessary. - * In buffered-image mode, the first output pass may occur before any data - * has been seen for some components, and thus before their Q-tables have - * been saved away. To handle this case, multiplier tables are preset - * to zeroes; the result of the IDCT will be a neutral gray level. - */ - - -/* Private subobject for this module */ - -typedef struct { - struct jpeg_inverse_dct pub; /* public fields */ - - /* This array contains the IDCT method code that each multiplier table - * is currently set up for, or -1 if it's not yet set up. - * The actual multiplier tables are pointed to by dct_table in the - * per-component comp_info structures. - */ - int cur_method[MAX_COMPONENTS]; -} my_idct_controller; - -typedef my_idct_controller * my_idct_ptr; - - -/* Allocated multiplier tables: big enough for any supported variant */ - -typedef union { - ISLOW_MULT_TYPE islow_array[DCTSIZE2]; -#ifdef DCT_IFAST_SUPPORTED - IFAST_MULT_TYPE ifast_array[DCTSIZE2]; -#endif -#ifdef DCT_FLOAT_SUPPORTED - FLOAT_MULT_TYPE float_array[DCTSIZE2]; -#endif -} multiplier_table; - - -/* The current scaled-IDCT routines require ISLOW-style multiplier tables, - * so be sure to compile that code if either ISLOW or SCALING is requested. - */ -#ifdef DCT_ISLOW_SUPPORTED -#define PROVIDE_ISLOW_TABLES -#else -#ifdef IDCT_SCALING_SUPPORTED -#define PROVIDE_ISLOW_TABLES -#endif -#endif - - -/* - * Prepare for an output pass. - * Here we select the proper IDCT routine for each component and build - * a matching multiplier table. - */ - -METHODDEF(void) -start_pass (j_decompress_ptr cinfo) -{ - my_idct_ptr idct = (my_idct_ptr) cinfo->idct; - int ci, i; - jpeg_component_info *compptr; - int method = 0; - inverse_DCT_method_ptr method_ptr = NULL; - JQUANT_TBL * qtbl; - - for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; - ci++, compptr++) { - /* Select the proper IDCT routine for this component's scaling */ - switch (compptr->DCT_scaled_size) { -#ifdef IDCT_SCALING_SUPPORTED - case 1: - method_ptr = jpeg_idct_1x1; - method = JDCT_ISLOW; /* jidctred uses islow-style table */ - break; - case 2: - method_ptr = jpeg_idct_2x2; - method = JDCT_ISLOW; /* jidctred uses islow-style table */ - break; - case 4: - method_ptr = jpeg_idct_4x4; - method = JDCT_ISLOW; /* jidctred uses islow-style table */ - break; -#endif - case DCTSIZE: - switch (cinfo->dct_method) { -#ifdef DCT_ISLOW_SUPPORTED - case JDCT_ISLOW: - method_ptr = jpeg_idct_islow; - method = JDCT_ISLOW; - break; -#endif -#ifdef DCT_IFAST_SUPPORTED - case JDCT_IFAST: - method_ptr = jpeg_idct_ifast; - method = JDCT_IFAST; - break; -#endif -#ifdef DCT_FLOAT_SUPPORTED - case JDCT_FLOAT: - method_ptr = jpeg_idct_float; - method = JDCT_FLOAT; - break; -#endif - default: - ERREXIT(cinfo, JERR_NOT_COMPILED); - break; - } - break; - default: - ERREXIT1(cinfo, JERR_BAD_DCTSIZE, compptr->DCT_scaled_size); - break; - } - idct->pub.inverse_DCT[ci] = method_ptr; - /* Create multiplier table from quant table. - * However, we can skip this if the component is uninteresting - * or if we already built the table. Also, if no quant table - * has yet been saved for the component, we leave the - * multiplier table all-zero; we'll be reading zeroes from the - * coefficient controller's buffer anyway. - */ - if (! compptr->component_needed || idct->cur_method[ci] == method) - continue; - qtbl = compptr->quant_table; - if (qtbl == NULL) /* happens if no data yet for component */ - continue; - idct->cur_method[ci] = method; - switch (method) { -#ifdef PROVIDE_ISLOW_TABLES - case JDCT_ISLOW: - { - /* For LL&M IDCT method, multipliers are equal to raw quantization - * coefficients, but are stored as ints to ensure access efficiency. - */ - ISLOW_MULT_TYPE * ismtbl = (ISLOW_MULT_TYPE *) compptr->dct_table; - for (i = 0; i < DCTSIZE2; i++) { - ismtbl[i] = (ISLOW_MULT_TYPE) qtbl->quantval[i]; - } - } - break; -#endif -#ifdef DCT_IFAST_SUPPORTED - case JDCT_IFAST: - { - /* For AA&N IDCT method, multipliers are equal to quantization - * coefficients scaled by scalefactor[row]*scalefactor[col], where - * scalefactor[0] = 1 - * scalefactor[k] = cos(k*PI/16) * sqrt(2) for k=1..7 - * For integer operation, the multiplier table is to be scaled by - * IFAST_SCALE_BITS. - */ - IFAST_MULT_TYPE * ifmtbl = (IFAST_MULT_TYPE *) compptr->dct_table; -#define CONST_BITS 14 - static const INT16 aanscales[DCTSIZE2] = { - /* precomputed values scaled up by 14 bits */ - 16384, 22725, 21407, 19266, 16384, 12873, 8867, 4520, - 22725, 31521, 29692, 26722, 22725, 17855, 12299, 6270, - 21407, 29692, 27969, 25172, 21407, 16819, 11585, 5906, - 19266, 26722, 25172, 22654, 19266, 15137, 10426, 5315, - 16384, 22725, 21407, 19266, 16384, 12873, 8867, 4520, - 12873, 17855, 16819, 15137, 12873, 10114, 6967, 3552, - 8867, 12299, 11585, 10426, 8867, 6967, 4799, 2446, - 4520, 6270, 5906, 5315, 4520, 3552, 2446, 1247 - }; - SHIFT_TEMPS - - for (i = 0; i < DCTSIZE2; i++) { - ifmtbl[i] = (IFAST_MULT_TYPE) - DESCALE(MULTIPLY16V16((JPEG_INT32) qtbl->quantval[i], - (JPEG_INT32) aanscales[i]), - CONST_BITS-IFAST_SCALE_BITS); - } - } - break; -#endif -#ifdef DCT_FLOAT_SUPPORTED - case JDCT_FLOAT: - { - /* For float AA&N IDCT method, multipliers are equal to quantization - * coefficients scaled by scalefactor[row]*scalefactor[col], where - * scalefactor[0] = 1 - * scalefactor[k] = cos(k*PI/16) * sqrt(2) for k=1..7 - */ - FLOAT_MULT_TYPE * fmtbl = (FLOAT_MULT_TYPE *) compptr->dct_table; - int row, col; - static const double aanscalefactor[DCTSIZE] = { - 1.0, 1.387039845, 1.306562965, 1.175875602, - 1.0, 0.785694958, 0.541196100, 0.275899379 - }; - - i = 0; - for (row = 0; row < DCTSIZE; row++) { - for (col = 0; col < DCTSIZE; col++) { - fmtbl[i] = (FLOAT_MULT_TYPE) - ((double) qtbl->quantval[i] * - aanscalefactor[row] * aanscalefactor[col]); - i++; - } - } - } - break; -#endif - default: - ERREXIT(cinfo, JERR_NOT_COMPILED); - break; - } - } -} - - -/* - * Initialize IDCT manager. - */ - -GLOBAL(void) -jinit_inverse_dct (j_decompress_ptr cinfo) -{ - my_idct_ptr idct; - int ci; - jpeg_component_info *compptr; - - idct = (my_idct_ptr) - (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, - SIZEOF(my_idct_controller)); - cinfo->idct = (struct jpeg_inverse_dct *) idct; - idct->pub.start_pass = start_pass; - - for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; - ci++, compptr++) { - /* Allocate and pre-zero a multiplier table for each component */ - compptr->dct_table = - (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, - SIZEOF(multiplier_table)); - MEMZERO(compptr->dct_table, SIZEOF(multiplier_table)); - /* Mark multiplier table not yet set up for any method */ - idct->cur_method[ci] = -1; - } -} diff --git a/wxWidgets/src/jpeg/jdhuff.c b/wxWidgets/src/jpeg/jdhuff.c deleted file mode 100644 index dccbc52b42..0000000000 --- a/wxWidgets/src/jpeg/jdhuff.c +++ /dev/null @@ -1,651 +0,0 @@ -/* - * jdhuff.c - * - * Copyright (C) 1991-1997, Thomas G. Lane. - * This file is part of the Independent JPEG Group's software. - * For conditions of distribution and use, see the accompanying README file. - * - * This file contains Huffman entropy decoding routines. - * - * Much of the complexity here has to do with supporting input suspension. - * If the data source module demands suspension, we want to be able to back - * up to the start of the current MCU. To do this, we copy state variables - * into local working storage, and update them back to the permanent - * storage only upon successful completion of an MCU. - */ - -#define JPEG_INTERNALS -#include "jinclude.h" -#include "jpeglib.h" -#include "jdhuff.h" /* Declarations shared with jdphuff.c */ - - -/* - * Expanded entropy decoder object for Huffman decoding. - * - * The savable_state subrecord contains fields that change within an MCU, - * but must not be updated permanently until we complete the MCU. - */ - -typedef struct { - int last_dc_val[MAX_COMPS_IN_SCAN]; /* last DC coef for each component */ -} savable_state; - -/* This macro is to work around compilers with missing or broken - * structure assignment. You'll need to fix this code if you have - * such a compiler and you change MAX_COMPS_IN_SCAN. - */ - -#ifndef NO_STRUCT_ASSIGN -#define ASSIGN_STATE(dest,src) ((dest) = (src)) -#else -#if MAX_COMPS_IN_SCAN == 4 -#define ASSIGN_STATE(dest,src) \ - ((dest).last_dc_val[0] = (src).last_dc_val[0], \ - (dest).last_dc_val[1] = (src).last_dc_val[1], \ - (dest).last_dc_val[2] = (src).last_dc_val[2], \ - (dest).last_dc_val[3] = (src).last_dc_val[3]) -#endif -#endif - - -typedef struct { - struct jpeg_entropy_decoder pub; /* public fields */ - - /* These fields are loaded into local variables at start of each MCU. - * In case of suspension, we exit WITHOUT updating them. - */ - bitread_perm_state bitstate; /* Bit buffer at start of MCU */ - savable_state saved; /* Other state at start of MCU */ - - /* These fields are NOT loaded into local working state. */ - unsigned int restarts_to_go; /* MCUs left in this restart interval */ - - /* Pointers to derived tables (these workspaces have image lifespan) */ - d_derived_tbl * dc_derived_tbls[NUM_HUFF_TBLS]; - d_derived_tbl * ac_derived_tbls[NUM_HUFF_TBLS]; - - /* Precalculated info set up by start_pass for use in decode_mcu: */ - - /* Pointers to derived tables to be used for each block within an MCU */ - d_derived_tbl * dc_cur_tbls[D_MAX_BLOCKS_IN_MCU]; - d_derived_tbl * ac_cur_tbls[D_MAX_BLOCKS_IN_MCU]; - /* Whether we care about the DC and AC coefficient values for each block */ - wxjpeg_boolean dc_needed[D_MAX_BLOCKS_IN_MCU]; - wxjpeg_boolean ac_needed[D_MAX_BLOCKS_IN_MCU]; -} huff_entropy_decoder; - -typedef huff_entropy_decoder * huff_entropy_ptr; - - -/* - * Initialize for a Huffman-compressed scan. - */ - -METHODDEF(void) -start_pass_huff_decoder (j_decompress_ptr cinfo) -{ - huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy; - int ci, blkn, dctbl, actbl; - jpeg_component_info * compptr; - - /* Check that the scan parameters Ss, Se, Ah/Al are OK for sequential JPEG. - * This ought to be an error condition, but we make it a warning because - * there are some baseline files out there with all zeroes in these bytes. - */ - if (cinfo->Ss != 0 || cinfo->Se != DCTSIZE2-1 || - cinfo->Ah != 0 || cinfo->Al != 0) - WARNMS(cinfo, JWRN_NOT_SEQUENTIAL); - - for (ci = 0; ci < cinfo->comps_in_scan; ci++) { - compptr = cinfo->cur_comp_info[ci]; - dctbl = compptr->dc_tbl_no; - actbl = compptr->ac_tbl_no; - /* Compute derived values for Huffman tables */ - /* We may do this more than once for a table, but it's not expensive */ - jpeg_make_d_derived_tbl(cinfo, TRUE, dctbl, - & entropy->dc_derived_tbls[dctbl]); - jpeg_make_d_derived_tbl(cinfo, FALSE, actbl, - & entropy->ac_derived_tbls[actbl]); - /* Initialize DC predictions to 0 */ - entropy->saved.last_dc_val[ci] = 0; - } - - /* Precalculate decoding info for each block in an MCU of this scan */ - for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) { - ci = cinfo->MCU_membership[blkn]; - compptr = cinfo->cur_comp_info[ci]; - /* Precalculate which table to use for each block */ - entropy->dc_cur_tbls[blkn] = entropy->dc_derived_tbls[compptr->dc_tbl_no]; - entropy->ac_cur_tbls[blkn] = entropy->ac_derived_tbls[compptr->ac_tbl_no]; - /* Decide whether we really care about the coefficient values */ - if (compptr->component_needed) { - entropy->dc_needed[blkn] = TRUE; - /* we don't need the ACs if producing a 1/8th-size image */ - entropy->ac_needed[blkn] = (compptr->DCT_scaled_size > 1); - } else { - entropy->dc_needed[blkn] = entropy->ac_needed[blkn] = FALSE; - } - } - - /* Initialize bitread state variables */ - entropy->bitstate.bits_left = 0; - entropy->bitstate.get_buffer = 0; /* unnecessary, but keeps Purify quiet */ - entropy->pub.insufficient_data = FALSE; - - /* Initialize restart counter */ - entropy->restarts_to_go = cinfo->restart_interval; -} - - -/* - * Compute the derived values for a Huffman table. - * This routine also performs some validation checks on the table. - * - * Note this is also used by jdphuff.c. - */ - -GLOBAL(void) -jpeg_make_d_derived_tbl (j_decompress_ptr cinfo, wxjpeg_boolean isDC, int tblno, - d_derived_tbl ** pdtbl) -{ - JHUFF_TBL *htbl; - d_derived_tbl *dtbl; - int p, i, l, si, numsymbols; - int lookbits, ctr; - char huffsize[257]; - unsigned int huffcode[257]; - unsigned int code; - - /* Note that huffsize[] and huffcode[] are filled in code-length order, - * paralleling the order of the symbols themselves in htbl->huffval[]. - */ - - /* Find the input Huffman table */ - if (tblno < 0 || tblno >= NUM_HUFF_TBLS) - ERREXIT1(cinfo, JERR_NO_HUFF_TABLE, tblno); - htbl = - isDC ? cinfo->dc_huff_tbl_ptrs[tblno] : cinfo->ac_huff_tbl_ptrs[tblno]; - if (htbl == NULL) - ERREXIT1(cinfo, JERR_NO_HUFF_TABLE, tblno); - - /* Allocate a workspace if we haven't already done so. */ - if (*pdtbl == NULL) - *pdtbl = (d_derived_tbl *) - (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, - SIZEOF(d_derived_tbl)); - dtbl = *pdtbl; - dtbl->pub = htbl; /* fill in back link */ - - /* Figure C.1: make table of Huffman code length for each symbol */ - - p = 0; - for (l = 1; l <= 16; l++) { - i = (int) htbl->bits[l]; - if (i < 0 || p + i > 256) /* protect against table overrun */ - ERREXIT(cinfo, JERR_BAD_HUFF_TABLE); - while (i--) - huffsize[p++] = (char) l; - } - huffsize[p] = 0; - numsymbols = p; - - /* Figure C.2: generate the codes themselves */ - /* We also validate that the counts represent a legal Huffman code tree. */ - - code = 0; - si = huffsize[0]; - p = 0; - while (huffsize[p]) { - while (((int) huffsize[p]) == si) { - huffcode[p++] = code; - code++; - } - /* code is now 1 more than the last code used for codelength si; but - * it must still fit in si bits, since no code is allowed to be all ones. - */ - if (((JPEG_INT32) code) >= (((JPEG_INT32) 1) << si)) - ERREXIT(cinfo, JERR_BAD_HUFF_TABLE); - code <<= 1; - si++; - } - - /* Figure F.15: generate decoding tables for bit-sequential decoding */ - - p = 0; - for (l = 1; l <= 16; l++) { - if (htbl->bits[l]) { - /* valoffset[l] = huffval[] index of 1st symbol of code length l, - * minus the minimum code of length l - */ - dtbl->valoffset[l] = (JPEG_INT32) p - (JPEG_INT32) huffcode[p]; - p += htbl->bits[l]; - dtbl->maxcode[l] = huffcode[p-1]; /* maximum code of length l */ - } else { - dtbl->maxcode[l] = -1; /* -1 if no codes of this length */ - } - } - dtbl->maxcode[17] = 0xFFFFFL; /* ensures jpeg_huff_decode terminates */ - - /* Compute lookahead tables to speed up decoding. - * First we set all the table entries to 0, indicating "too long"; - * then we iterate through the Huffman codes that are short enough and - * fill in all the entries that correspond to bit sequences starting - * with that code. - */ - - MEMZERO(dtbl->look_nbits, SIZEOF(dtbl->look_nbits)); - - p = 0; - for (l = 1; l <= HUFF_LOOKAHEAD; l++) { - for (i = 1; i <= (int) htbl->bits[l]; i++, p++) { - /* l = current code's length, p = its index in huffcode[] & huffval[]. */ - /* Generate left-justified code followed by all possible bit sequences */ - lookbits = huffcode[p] << (HUFF_LOOKAHEAD-l); - for (ctr = 1 << (HUFF_LOOKAHEAD-l); ctr > 0; ctr--) { - dtbl->look_nbits[lookbits] = l; - dtbl->look_sym[lookbits] = htbl->huffval[p]; - lookbits++; - } - } - } - - /* Validate symbols as being reasonable. - * For AC tables, we make no check, but accept all byte values 0..255. - * For DC tables, we require the symbols to be in range 0..15. - * (Tighter bounds could be applied depending on the data depth and mode, - * but this is sufficient to ensure safe decoding.) - */ - if (isDC) { - for (i = 0; i < numsymbols; i++) { - int sym = htbl->huffval[i]; - if (sym < 0 || sym > 15) - ERREXIT(cinfo, JERR_BAD_HUFF_TABLE); - } - } -} - - -/* - * Out-of-line code for bit fetching (shared with jdphuff.c). - * See jdhuff.h for info about usage. - * Note: current values of get_buffer and bits_left are passed as parameters, - * but are returned in the corresponding fields of the state struct. - * - * On most machines MIN_GET_BITS should be 25 to allow the full 32-bit width - * of get_buffer to be used. (On machines with wider words, an even larger - * buffer could be used.) However, on some machines 32-bit shifts are - * quite slow and take time proportional to the number of places shifted. - * (This is true with most PC compilers, for instance.) In this case it may - * be a win to set MIN_GET_BITS to the minimum value of 15. This reduces the - * average shift distance at the cost of more calls to jpeg_fill_bit_buffer. - */ - -#ifdef SLOW_SHIFT_32 -#define MIN_GET_BITS 15 /* minimum allowable value */ -#else -#define MIN_GET_BITS (BIT_BUF_SIZE-7) -#endif - - -GLOBAL(wxjpeg_boolean) -jpeg_fill_bit_buffer (bitread_working_state * state, - register bit_buf_type get_buffer, register int bits_left, - int nbits) -/* Load up the bit buffer to a depth of at least nbits */ -{ - /* Copy heavily used state fields into locals (hopefully registers) */ - register const JOCTET * next_input_byte = state->next_input_byte; - register size_t bytes_in_buffer = state->bytes_in_buffer; - j_decompress_ptr cinfo = state->cinfo; - - /* Attempt to load at least MIN_GET_BITS bits into get_buffer. */ - /* (It is assumed that no request will be for more than that many bits.) */ - /* We fail to do so only if we hit a marker or are forced to suspend. */ - - if (cinfo->unread_marker == 0) { /* cannot advance past a marker */ - while (bits_left < MIN_GET_BITS) { - register int c; - - /* Attempt to read a byte */ - if (bytes_in_buffer == 0) { - if (! (*cinfo->src->fill_input_buffer) (cinfo)) - return FALSE; - next_input_byte = cinfo->src->next_input_byte; - bytes_in_buffer = cinfo->src->bytes_in_buffer; - } - bytes_in_buffer--; - c = GETJOCTET(*next_input_byte++); - - /* If it's 0xFF, check and discard stuffed zero byte */ - if (c == 0xFF) { - /* Loop here to discard any padding FF's on terminating marker, - * so that we can save a valid unread_marker value. NOTE: we will - * accept multiple FF's followed by a 0 as meaning a single FF data - * byte. This data pattern is not valid according to the standard. - */ - do { - if (bytes_in_buffer == 0) { - if (! (*cinfo->src->fill_input_buffer) (cinfo)) - return FALSE; - next_input_byte = cinfo->src->next_input_byte; - bytes_in_buffer = cinfo->src->bytes_in_buffer; - } - bytes_in_buffer--; - c = GETJOCTET(*next_input_byte++); - } while (c == 0xFF); - - if (c == 0) { - /* Found FF/00, which represents an FF data byte */ - c = 0xFF; - } else { - /* Oops, it's actually a marker indicating end of compressed data. - * Save the marker code for later use. - * Fine point: it might appear that we should save the marker into - * bitread working state, not straight into permanent state. But - * once we have hit a marker, we cannot need to suspend within the - * current MCU, because we will read no more bytes from the data - * source. So it is OK to update permanent state right away. - */ - cinfo->unread_marker = c; - /* See if we need to insert some fake zero bits. */ - goto no_more_bytes; - } - } - - /* OK, load c into get_buffer */ - get_buffer = (get_buffer << 8) | c; - bits_left += 8; - } /* end while */ - } else { - no_more_bytes: - /* We get here if we've read the marker that terminates the compressed - * data segment. There should be enough bits in the buffer register - * to satisfy the request; if so, no problem. - */ - if (nbits > bits_left) { - /* Uh-oh. Report corrupted data to user and stuff zeroes into - * the data stream, so that we can produce some kind of image. - * We use a nonvolatile flag to ensure that only one warning message - * appears per data segment. - */ - if (! cinfo->entropy->insufficient_data) { - WARNMS(cinfo, JWRN_HIT_MARKER); - cinfo->entropy->insufficient_data = TRUE; - } - /* Fill the buffer with zero bits */ - get_buffer <<= MIN_GET_BITS - bits_left; - bits_left = MIN_GET_BITS; - } - } - - /* Unload the local registers */ - state->next_input_byte = next_input_byte; - state->bytes_in_buffer = bytes_in_buffer; - state->get_buffer = get_buffer; - state->bits_left = bits_left; - - return TRUE; -} - - -/* - * Out-of-line code for Huffman code decoding. - * See jdhuff.h for info about usage. - */ - -GLOBAL(int) -jpeg_huff_decode (bitread_working_state * state, - register bit_buf_type get_buffer, register int bits_left, - d_derived_tbl * htbl, int min_bits) -{ - register int l = min_bits; - register JPEG_INT32 code; - - /* HUFF_DECODE has determined that the code is at least min_bits */ - /* bits long, so fetch that many bits in one swoop. */ - - CHECK_BIT_BUFFER(*state, l, return -1); - code = GET_BITS(l); - - /* Collect the rest of the Huffman code one bit at a time. */ - /* This is per Figure F.16 in the JPEG spec. */ - - while (code > htbl->maxcode[l]) { - code <<= 1; - CHECK_BIT_BUFFER(*state, 1, return -1); - code |= GET_BITS(1); - l++; - } - - /* Unload the local registers */ - state->get_buffer = get_buffer; - state->bits_left = bits_left; - - /* With garbage input we may reach the sentinel value l = 17. */ - - if (l > 16) { - WARNMS(state->cinfo, JWRN_HUFF_BAD_CODE); - return 0; /* fake a zero as the safest result */ - } - - return htbl->pub->huffval[ (int) (code + htbl->valoffset[l]) ]; -} - - -/* - * Figure F.12: extend sign bit. - * On some machines, a shift and add will be faster than a table lookup. - */ - -#ifdef AVOID_TABLES - -#define HUFF_EXTEND(x,s) ((x) < (1<<((s)-1)) ? (x) + (((-1)<<(s)) + 1) : (x)) - -#else - -#define HUFF_EXTEND(x,s) ((x) < extend_test[s] ? (x) + extend_offset[s] : (x)) - -static const int extend_test[16] = /* entry n is 2**(n-1) */ - { 0, 0x0001, 0x0002, 0x0004, 0x0008, 0x0010, 0x0020, 0x0040, 0x0080, - 0x0100, 0x0200, 0x0400, 0x0800, 0x1000, 0x2000, 0x4000 }; - -static const int extend_offset[16] = /* entry n is (-1 << n) + 1 */ - { 0, ((-1)<<1) + 1, ((-1)<<2) + 1, ((-1)<<3) + 1, ((-1)<<4) + 1, - ((-1)<<5) + 1, ((-1)<<6) + 1, ((-1)<<7) + 1, ((-1)<<8) + 1, - ((-1)<<9) + 1, ((-1)<<10) + 1, ((-1)<<11) + 1, ((-1)<<12) + 1, - ((-1)<<13) + 1, ((-1)<<14) + 1, ((-1)<<15) + 1 }; - -#endif /* AVOID_TABLES */ - - -/* - * Check for a restart marker & resynchronize decoder. - * Returns FALSE if must suspend. - */ - -LOCAL(wxjpeg_boolean) -process_restart (j_decompress_ptr cinfo) -{ - huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy; - int ci; - - /* Throw away any unused bits remaining in bit buffer; */ - /* include any full bytes in next_marker's count of discarded bytes */ - cinfo->marker->discarded_bytes += entropy->bitstate.bits_left / 8; - entropy->bitstate.bits_left = 0; - - /* Advance past the RSTn marker */ - if (! (*cinfo->marker->read_restart_marker) (cinfo)) - return FALSE; - - /* Re-initialize DC predictions to 0 */ - for (ci = 0; ci < cinfo->comps_in_scan; ci++) - entropy->saved.last_dc_val[ci] = 0; - - /* Reset restart counter */ - entropy->restarts_to_go = cinfo->restart_interval; - - /* Reset out-of-data flag, unless read_restart_marker left us smack up - * against a marker. In that case we will end up treating the next data - * segment as empty, and we can avoid producing bogus output pixels by - * leaving the flag set. - */ - if (cinfo->unread_marker == 0) - entropy->pub.insufficient_data = FALSE; - - return TRUE; -} - - -/* - * Decode and return one MCU's worth of Huffman-compressed coefficients. - * The coefficients are reordered from zigzag order into natural array order, - * but are not dequantized. - * - * The i'th block of the MCU is stored into the block pointed to by - * MCU_data[i]. WE ASSUME THIS AREA HAS BEEN ZEROED BY THE CALLER. - * (Wholesale zeroing is usually a little faster than retail...) - * - * Returns FALSE if data source requested suspension. In that case no - * changes have been made to permanent state. (Exception: some output - * coefficients may already have been assigned. This is harmless for - * this module, since we'll just re-assign them on the next call.) - */ - -METHODDEF(wxjpeg_boolean) -decode_mcu (j_decompress_ptr cinfo, JBLOCKROW *MCU_data) -{ - huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy; - int blkn; - BITREAD_STATE_VARS; - savable_state state; - - /* Process restart marker if needed; may have to suspend */ - if (cinfo->restart_interval) { - if (entropy->restarts_to_go == 0) - if (! process_restart(cinfo)) - return FALSE; - } - - /* If we've run out of data, just leave the MCU set to zeroes. - * This way, we return uniform gray for the remainder of the segment. - */ - if (! entropy->pub.insufficient_data) { - - /* Load up working state */ - BITREAD_LOAD_STATE(cinfo,entropy->bitstate); - ASSIGN_STATE(state, entropy->saved); - - /* Outer loop handles each block in the MCU */ - - for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) { - JBLOCKROW block = MCU_data[blkn]; - d_derived_tbl * dctbl = entropy->dc_cur_tbls[blkn]; - d_derived_tbl * actbl = entropy->ac_cur_tbls[blkn]; - register int s, k, r; - - /* Decode a single block's worth of coefficients */ - - /* Section F.2.2.1: decode the DC coefficient difference */ - HUFF_DECODE(s, br_state, dctbl, return FALSE, label1); - if (s) { - CHECK_BIT_BUFFER(br_state, s, return FALSE); - r = GET_BITS(s); - s = HUFF_EXTEND(r, s); - } - - if (entropy->dc_needed[blkn]) { - /* Convert DC difference to actual value, update last_dc_val */ - int ci = cinfo->MCU_membership[blkn]; - s += state.last_dc_val[ci]; - state.last_dc_val[ci] = s; - /* Output the DC coefficient (assumes jpeg_natural_order[0] = 0) */ - (*block)[0] = (JCOEF) s; - } - - if (entropy->ac_needed[blkn]) { - - /* Section F.2.2.2: decode the AC coefficients */ - /* Since zeroes are skipped, output area must be cleared beforehand */ - for (k = 1; k < DCTSIZE2; k++) { - HUFF_DECODE(s, br_state, actbl, return FALSE, label2); - - r = s >> 4; - s &= 15; - - if (s) { - k += r; - CHECK_BIT_BUFFER(br_state, s, return FALSE); - r = GET_BITS(s); - s = HUFF_EXTEND(r, s); - /* Output coefficient in natural (dezigzagged) order. - * Note: the extra entries in jpeg_natural_order[] will save us - * if k >= DCTSIZE2, which could happen if the data is corrupted. - */ - (*block)[jpeg_natural_order[k]] = (JCOEF) s; - } else { - if (r != 15) - break; - k += 15; - } - } - - } else { - - /* Section F.2.2.2: decode the AC coefficients */ - /* In this path we just discard the values */ - for (k = 1; k < DCTSIZE2; k++) { - HUFF_DECODE(s, br_state, actbl, return FALSE, label3); - - r = s >> 4; - s &= 15; - - if (s) { - k += r; - CHECK_BIT_BUFFER(br_state, s, return FALSE); - DROP_BITS(s); - } else { - if (r != 15) - break; - k += 15; - } - } - - } - } - - /* Completed MCU, so update state */ - BITREAD_SAVE_STATE(cinfo,entropy->bitstate); - ASSIGN_STATE(entropy->saved, state); - } - - /* Account for restart interval (no-op if not using restarts) */ - entropy->restarts_to_go--; - - return TRUE; -} - - -/* - * Module initialization routine for Huffman entropy decoding. - */ - -GLOBAL(void) -jinit_huff_decoder (j_decompress_ptr cinfo) -{ - huff_entropy_ptr entropy; - int i; - - entropy = (huff_entropy_ptr) - (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, - SIZEOF(huff_entropy_decoder)); - cinfo->entropy = (struct jpeg_entropy_decoder *) entropy; - entropy->pub.start_pass = start_pass_huff_decoder; - entropy->pub.decode_mcu = decode_mcu; - - /* Mark tables unallocated */ - for (i = 0; i < NUM_HUFF_TBLS; i++) { - entropy->dc_derived_tbls[i] = entropy->ac_derived_tbls[i] = NULL; - } -} diff --git a/wxWidgets/src/jpeg/jdhuff.h b/wxWidgets/src/jpeg/jdhuff.h deleted file mode 100644 index 9e9e87daec..0000000000 --- a/wxWidgets/src/jpeg/jdhuff.h +++ /dev/null @@ -1,201 +0,0 @@ -/* - * jdhuff.h - * - * Copyright (C) 1991-1997, Thomas G. Lane. - * This file is part of the Independent JPEG Group's software. - * For conditions of distribution and use, see the accompanying README file. - * - * This file contains declarations for Huffman entropy decoding routines - * that are shared between the sequential decoder (jdhuff.c) and the - * progressive decoder (jdphuff.c). No other modules need to see these. - */ - -/* Short forms of external names for systems with brain-damaged linkers. */ - -#ifdef NEED_SHORT_EXTERNAL_NAMES -#define jpeg_make_d_derived_tbl jMkDDerived -#define jpeg_fill_bit_buffer jFilBitBuf -#define jpeg_huff_decode jHufDecode -#endif /* NEED_SHORT_EXTERNAL_NAMES */ - - -/* Derived data constructed for each Huffman table */ - -#define HUFF_LOOKAHEAD 8 /* # of bits of lookahead */ - -typedef struct { - /* Basic tables: (element [0] of each array is unused) */ - JPEG_INT32 maxcode[18]; /* largest code of length k (-1 if none) */ - /* (maxcode[17] is a sentinel to ensure jpeg_huff_decode terminates) */ - JPEG_INT32 valoffset[17]; /* huffval[] offset for codes of length k */ - /* valoffset[k] = huffval[] index of 1st symbol of code length k, less - * the smallest code of length k; so given a code of length k, the - * corresponding symbol is huffval[code + valoffset[k]] - */ - - /* Link to public Huffman table (needed only in jpeg_huff_decode) */ - JHUFF_TBL *pub; - - /* Lookahead tables: indexed by the next HUFF_LOOKAHEAD bits of - * the input data stream. If the next Huffman code is no more - * than HUFF_LOOKAHEAD bits long, we can obtain its length and - * the corresponding symbol directly from these tables. - */ - int look_nbits[1< 32 bits on your machine, and shifting/masking longs is - * reasonably fast, making bit_buf_type be long and setting BIT_BUF_SIZE - * appropriately should be a win. Unfortunately we can't define the size - * with something like #define BIT_BUF_SIZE (sizeof(bit_buf_type)*8) - * because not all machines measure sizeof in 8-bit bytes. - */ - -typedef struct { /* Bitreading state saved across MCUs */ - bit_buf_type get_buffer; /* current bit-extraction buffer */ - int bits_left; /* # of unused bits in it */ -} bitread_perm_state; - -typedef struct { /* Bitreading working state within an MCU */ - /* Current data source location */ - /* We need a copy, rather than munging the original, in case of suspension */ - const JOCTET * next_input_byte; /* => next byte to read from source */ - size_t bytes_in_buffer; /* # of bytes remaining in source buffer */ - /* Bit input buffer --- note these values are kept in register variables, - * not in this struct, inside the inner loops. - */ - bit_buf_type get_buffer; /* current bit-extraction buffer */ - int bits_left; /* # of unused bits in it */ - /* Pointer needed by jpeg_fill_bit_buffer. */ - j_decompress_ptr cinfo; /* back link to decompress master record */ -} bitread_working_state; - -/* Macros to declare and load/save bitread local variables. */ -#define BITREAD_STATE_VARS \ - register bit_buf_type get_buffer; \ - register int bits_left; \ - bitread_working_state br_state - -#define BITREAD_LOAD_STATE(cinfop,permstate) \ - br_state.cinfo = cinfop; \ - br_state.next_input_byte = cinfop->src->next_input_byte; \ - br_state.bytes_in_buffer = cinfop->src->bytes_in_buffer; \ - get_buffer = permstate.get_buffer; \ - bits_left = permstate.bits_left; - -#define BITREAD_SAVE_STATE(cinfop,permstate) \ - cinfop->src->next_input_byte = br_state.next_input_byte; \ - cinfop->src->bytes_in_buffer = br_state.bytes_in_buffer; \ - permstate.get_buffer = get_buffer; \ - permstate.bits_left = bits_left - -/* - * These macros provide the in-line portion of bit fetching. - * Use CHECK_BIT_BUFFER to ensure there are N bits in get_buffer - * before using GET_BITS, PEEK_BITS, or DROP_BITS. - * The variables get_buffer and bits_left are assumed to be locals, - * but the state struct might not be (jpeg_huff_decode needs this). - * CHECK_BIT_BUFFER(state,n,action); - * Ensure there are N bits in get_buffer; if suspend, take action. - * val = GET_BITS(n); - * Fetch next N bits. - * val = PEEK_BITS(n); - * Fetch next N bits without removing them from the buffer. - * DROP_BITS(n); - * Discard next N bits. - * The value N should be a simple variable, not an expression, because it - * is evaluated multiple times. - */ - -#define CHECK_BIT_BUFFER(state,nbits,action) \ - { if (bits_left < (nbits)) { \ - if (! jpeg_fill_bit_buffer(&(state),get_buffer,bits_left,nbits)) \ - { action; } \ - get_buffer = (state).get_buffer; bits_left = (state).bits_left; } } - -#define GET_BITS(nbits) \ - (((int) (get_buffer >> (bits_left -= (nbits)))) & ((1<<(nbits))-1)) - -#define PEEK_BITS(nbits) \ - (((int) (get_buffer >> (bits_left - (nbits)))) & ((1<<(nbits))-1)) - -#define DROP_BITS(nbits) \ - (bits_left -= (nbits)) - -/* Load up the bit buffer to a depth of at least nbits */ -EXTERN(wxjpeg_boolean) jpeg_fill_bit_buffer - JPP((bitread_working_state * state, register bit_buf_type get_buffer, - register int bits_left, int nbits)); - - -/* - * Code for extracting next Huffman-coded symbol from input bit stream. - * Again, this is time-critical and we make the main paths be macros. - * - * We use a lookahead table to process codes of up to HUFF_LOOKAHEAD bits - * without looping. Usually, more than 95% of the Huffman codes will be 8 - * or fewer bits long. The few overlength codes are handled with a loop, - * which need not be inline code. - * - * Notes about the HUFF_DECODE macro: - * 1. Near the end of the data segment, we may fail to get enough bits - * for a lookahead. In that case, we do it the hard way. - * 2. If the lookahead table contains no entry, the next code must be - * more than HUFF_LOOKAHEAD bits long. - * 3. jpeg_huff_decode returns -1 if forced to suspend. - */ - -#define HUFF_DECODE(result,state,htbl,failaction,slowlabel) \ -{ register int nb, look; \ - if (bits_left < HUFF_LOOKAHEAD) { \ - if (! jpeg_fill_bit_buffer(&state,get_buffer,bits_left, 0)) {failaction;} \ - get_buffer = state.get_buffer; bits_left = state.bits_left; \ - if (bits_left < HUFF_LOOKAHEAD) { \ - nb = 1; goto slowlabel; \ - } \ - } \ - look = PEEK_BITS(HUFF_LOOKAHEAD); \ - if ((nb = htbl->look_nbits[look]) != 0) { \ - DROP_BITS(nb); \ - result = htbl->look_sym[look]; \ - } else { \ - nb = HUFF_LOOKAHEAD+1; \ -slowlabel: \ - if ((result=jpeg_huff_decode(&state,get_buffer,bits_left,htbl,nb)) < 0) \ - { failaction; } \ - get_buffer = state.get_buffer; bits_left = state.bits_left; \ - } \ -} - -/* Out-of-line case for Huffman code fetching */ -EXTERN(int) jpeg_huff_decode - JPP((bitread_working_state * state, register bit_buf_type get_buffer, - register int bits_left, d_derived_tbl * htbl, int min_bits)); diff --git a/wxWidgets/src/jpeg/jdinput.c b/wxWidgets/src/jpeg/jdinput.c deleted file mode 100644 index c89b75de58..0000000000 --- a/wxWidgets/src/jpeg/jdinput.c +++ /dev/null @@ -1,385 +0,0 @@ -/* - * jdinput.c - * - * Copyright (C) 1991-1997, Thomas G. Lane. - * This file is part of the Independent JPEG Group's software. - * For conditions of distribution and use, see the accompanying README file. - * - * This file contains input control logic for the JPEG decompressor. - * These routines are concerned with controlling the decompressor's input - * processing (marker reading and coefficient decoding). The actual input - * reading is done in jdmarker.c, jdhuff.c, and jdphuff.c. - */ - -#define JPEG_INTERNALS -#include "jinclude.h" -#include "jpeglib.h" - -/* Private state */ - -typedef struct { - struct jpeg_input_controller pub; /* public fields */ - - wxjpeg_boolean inheaders; /* TRUE until first SOS is reached */ -} my_input_controller; - -typedef my_input_controller * my_inputctl_ptr; - - -/* Forward declarations */ -METHODDEF(int) consume_markers JPP((j_decompress_ptr cinfo)); - - -/* - * Routines to calculate various quantities related to the size of the image. - */ - -LOCAL(void) -initial_setup (j_decompress_ptr cinfo) -/* Called once, when first SOS marker is reached */ -{ - int ci; - jpeg_component_info *compptr; - - /* Make sure image isn't bigger than I can handle */ - if ((long) cinfo->image_height > (long) JPEG_MAX_DIMENSION || - (long) cinfo->image_width > (long) JPEG_MAX_DIMENSION) - ERREXIT1(cinfo, JERR_IMAGE_TOO_BIG, (unsigned int) JPEG_MAX_DIMENSION); - - /* For now, precision must match compiled-in value... */ - if (cinfo->data_precision != BITS_IN_JSAMPLE) - ERREXIT1(cinfo, JERR_BAD_PRECISION, cinfo->data_precision); - - /* Check that number of components won't exceed internal array sizes */ - if (cinfo->num_components > MAX_COMPONENTS) - ERREXIT2(cinfo, JERR_COMPONENT_COUNT, cinfo->num_components, - MAX_COMPONENTS); - - /* Compute maximum sampling factors; check factor validity */ - cinfo->max_h_samp_factor = 1; - cinfo->max_v_samp_factor = 1; - for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; - ci++, compptr++) { - if (compptr->h_samp_factor<=0 || compptr->h_samp_factor>MAX_SAMP_FACTOR || - compptr->v_samp_factor<=0 || compptr->v_samp_factor>MAX_SAMP_FACTOR) - ERREXIT(cinfo, JERR_BAD_SAMPLING); - cinfo->max_h_samp_factor = MAX(cinfo->max_h_samp_factor, - compptr->h_samp_factor); - cinfo->max_v_samp_factor = MAX(cinfo->max_v_samp_factor, - compptr->v_samp_factor); - } - - /* We initialize DCT_scaled_size and min_DCT_scaled_size to DCTSIZE. - * In the full decompressor, this will be overridden by jdmaster.c; - * but in the transcoder, jdmaster.c is not used, so we must do it here. - */ - cinfo->min_DCT_scaled_size = DCTSIZE; - - /* Compute dimensions of components */ - for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; - ci++, compptr++) { - compptr->DCT_scaled_size = DCTSIZE; - /* Size in DCT blocks */ - compptr->width_in_blocks = (JDIMENSION) - jdiv_round_up((long) cinfo->image_width * (long) compptr->h_samp_factor, - (long) (cinfo->max_h_samp_factor * DCTSIZE)); - compptr->height_in_blocks = (JDIMENSION) - jdiv_round_up((long) cinfo->image_height * (long) compptr->v_samp_factor, - (long) (cinfo->max_v_samp_factor * DCTSIZE)); - /* downsampled_width and downsampled_height will also be overridden by - * jdmaster.c if we are doing full decompression. The transcoder library - * doesn't use these values, but the calling application might. - */ - /* Size in samples */ - compptr->downsampled_width = (JDIMENSION) - jdiv_round_up((long) cinfo->image_width * (long) compptr->h_samp_factor, - (long) cinfo->max_h_samp_factor); - compptr->downsampled_height = (JDIMENSION) - jdiv_round_up((long) cinfo->image_height * (long) compptr->v_samp_factor, - (long) cinfo->max_v_samp_factor); - /* Mark component needed, until color conversion says otherwise */ - compptr->component_needed = TRUE; - /* Mark no quantization table yet saved for component */ - compptr->quant_table = NULL; - } - - /* Compute number of fully interleaved MCU rows. */ - cinfo->total_iMCU_rows = (JDIMENSION) - jdiv_round_up((long) cinfo->image_height, - (long) (cinfo->max_v_samp_factor*DCTSIZE)); - - /* Decide whether file contains multiple scans */ - if (cinfo->comps_in_scan < cinfo->num_components || cinfo->progressive_mode) - cinfo->inputctl->has_multiple_scans = TRUE; - else - cinfo->inputctl->has_multiple_scans = FALSE; -} - - -LOCAL(void) -per_scan_setup (j_decompress_ptr cinfo) -/* Do computations that are needed before processing a JPEG scan */ -/* cinfo->comps_in_scan and cinfo->cur_comp_info[] were set from SOS marker */ -{ - int ci, mcublks, tmp; - jpeg_component_info *compptr; - - if (cinfo->comps_in_scan == 1) { - - /* Noninterleaved (single-component) scan */ - compptr = cinfo->cur_comp_info[0]; - - /* Overall image size in MCUs */ - cinfo->MCUs_per_row = compptr->width_in_blocks; - cinfo->MCU_rows_in_scan = compptr->height_in_blocks; - - /* For noninterleaved scan, always one block per MCU */ - compptr->MCU_width = 1; - compptr->MCU_height = 1; - compptr->MCU_blocks = 1; - compptr->MCU_sample_width = compptr->DCT_scaled_size; - compptr->last_col_width = 1; - /* For noninterleaved scans, it is convenient to define last_row_height - * as the number of block rows present in the last iMCU row. - */ - tmp = (int) (compptr->height_in_blocks % compptr->v_samp_factor); - if (tmp == 0) tmp = compptr->v_samp_factor; - compptr->last_row_height = tmp; - - /* Prepare array describing MCU composition */ - cinfo->blocks_in_MCU = 1; - cinfo->MCU_membership[0] = 0; - - } else { - - /* Interleaved (multi-component) scan */ - if (cinfo->comps_in_scan <= 0 || cinfo->comps_in_scan > MAX_COMPS_IN_SCAN) - ERREXIT2(cinfo, JERR_COMPONENT_COUNT, cinfo->comps_in_scan, - MAX_COMPS_IN_SCAN); - - /* Overall image size in MCUs */ - cinfo->MCUs_per_row = (JDIMENSION) - jdiv_round_up((long) cinfo->image_width, - (long) (cinfo->max_h_samp_factor*DCTSIZE)); - cinfo->MCU_rows_in_scan = (JDIMENSION) - jdiv_round_up((long) cinfo->image_height, - (long) (cinfo->max_v_samp_factor*DCTSIZE)); - - cinfo->blocks_in_MCU = 0; - - for (ci = 0; ci < cinfo->comps_in_scan; ci++) { - compptr = cinfo->cur_comp_info[ci]; - /* Sampling factors give # of blocks of component in each MCU */ - compptr->MCU_width = compptr->h_samp_factor; - compptr->MCU_height = compptr->v_samp_factor; - compptr->MCU_blocks = compptr->MCU_width * compptr->MCU_height; - compptr->MCU_sample_width = compptr->MCU_width * compptr->DCT_scaled_size; - /* Figure number of non-dummy blocks in last MCU column & row */ - tmp = (int) (compptr->width_in_blocks % compptr->MCU_width); - if (tmp == 0) tmp = compptr->MCU_width; - compptr->last_col_width = tmp; - tmp = (int) (compptr->height_in_blocks % compptr->MCU_height); - if (tmp == 0) tmp = compptr->MCU_height; - compptr->last_row_height = tmp; - /* Prepare array describing MCU composition */ - mcublks = compptr->MCU_blocks; - if (cinfo->blocks_in_MCU + mcublks > D_MAX_BLOCKS_IN_MCU) - ERREXIT(cinfo, JERR_BAD_MCU_SIZE); - while (mcublks-- > 0) { - cinfo->MCU_membership[cinfo->blocks_in_MCU++] = ci; - } - } - - } -} - - -/* - * Save away a copy of the Q-table referenced by each component present - * in the current scan, unless already saved during a prior scan. - * - * In a multiple-scan JPEG file, the encoder could assign different components - * the same Q-table slot number, but change table definitions between scans - * so that each component uses a different Q-table. (The IJG encoder is not - * currently capable of doing this, but other encoders might.) Since we want - * to be able to dequantize all the components at the end of the file, this - * means that we have to save away the table actually used for each component. - * We do this by copying the table at the start of the first scan containing - * the component. - * The JPEG spec prohibits the encoder from changing the contents of a Q-table - * slot between scans of a component using that slot. If the encoder does so - * anyway, this decoder will simply use the Q-table values that were current - * at the start of the first scan for the component. - * - * The decompressor output side looks only at the saved quant tables, - * not at the current Q-table slots. - */ - -LOCAL(void) -latch_quant_tables (j_decompress_ptr cinfo) -{ - int ci, qtblno; - jpeg_component_info *compptr; - JQUANT_TBL * qtbl; - - for (ci = 0; ci < cinfo->comps_in_scan; ci++) { - compptr = cinfo->cur_comp_info[ci]; - /* No work if we already saved Q-table for this component */ - if (compptr->quant_table != NULL) - continue; - /* Make sure specified quantization table is present */ - qtblno = compptr->quant_tbl_no; - if (qtblno < 0 || qtblno >= NUM_QUANT_TBLS || - cinfo->quant_tbl_ptrs[qtblno] == NULL) - ERREXIT1(cinfo, JERR_NO_QUANT_TABLE, qtblno); - /* OK, save away the quantization table */ - qtbl = (JQUANT_TBL *) - (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, - SIZEOF(JQUANT_TBL)); - MEMCOPY(qtbl, cinfo->quant_tbl_ptrs[qtblno], SIZEOF(JQUANT_TBL)); - compptr->quant_table = qtbl; - } -} - - -/* - * Initialize the input modules to read a scan of compressed data. - * The first call to this is done by jdmaster.c after initializing - * the entire decompressor (during jpeg_start_decompress). - * Subsequent calls come from consume_markers, below. - */ - -METHODDEF(void) -start_input_pass (j_decompress_ptr cinfo) -{ - per_scan_setup(cinfo); - latch_quant_tables(cinfo); - (*cinfo->entropy->start_pass) (cinfo); -#if defined(__VISAGECPP__) - (*cinfo->coef->start_input_pass2) (cinfo); -#else - (*cinfo->coef->start_input_pass) (cinfo); -#endif - cinfo->inputctl->consume_input = cinfo->coef->consume_data; -} - - -/* - * Finish up after inputting a compressed-data scan. - * This is called by the coefficient controller after it's read all - * the expected data of the scan. - */ - -METHODDEF(void) -finish_input_pass (j_decompress_ptr cinfo) -{ - cinfo->inputctl->consume_input = consume_markers; -} - - -/* - * Read JPEG markers before, between, or after compressed-data scans. - * Change state as necessary when a new scan is reached. - * Return value is JPEG_SUSPENDED, JPEG_REACHED_SOS, or JPEG_REACHED_EOI. - * - * The consume_input method pointer points either here or to the - * coefficient controller's consume_data routine, depending on whether - * we are reading a compressed data segment or inter-segment markers. - */ - -METHODDEF(int) -consume_markers (j_decompress_ptr cinfo) -{ - my_inputctl_ptr inputctl = (my_inputctl_ptr) cinfo->inputctl; - int val; - - if (inputctl->pub.eoi_reached) /* After hitting EOI, read no further */ - return JPEG_REACHED_EOI; - - val = (*cinfo->marker->read_markers) (cinfo); - - switch (val) { - case JPEG_REACHED_SOS: /* Found SOS */ - if (inputctl->inheaders) { /* 1st SOS */ - initial_setup(cinfo); - inputctl->inheaders = FALSE; - /* Note: start_input_pass must be called by jdmaster.c - * before any more input can be consumed. jdapimin.c is - * responsible for enforcing this sequencing. - */ - } else { /* 2nd or later SOS marker */ - if (! inputctl->pub.has_multiple_scans) - ERREXIT(cinfo, JERR_EOI_EXPECTED); /* Oops, I wasn't expecting this! */ - start_input_pass(cinfo); - } - break; - case JPEG_REACHED_EOI: /* Found EOI */ - inputctl->pub.eoi_reached = TRUE; - if (inputctl->inheaders) { /* Tables-only datastream, apparently */ - if (cinfo->marker->saw_SOF) - ERREXIT(cinfo, JERR_SOF_NO_SOS); - } else { - /* Prevent infinite loop in coef ctlr's decompress_data routine - * if user set output_scan_number larger than number of scans. - */ - if (cinfo->output_scan_number > cinfo->input_scan_number) - cinfo->output_scan_number = cinfo->input_scan_number; - } - break; - case JPEG_SUSPENDED: - break; - } - - return val; -} - - -/* - * Reset state to begin a fresh datastream. - */ - -METHODDEF(void) -reset_input_controller (j_decompress_ptr cinfo) -{ - my_inputctl_ptr inputctl = (my_inputctl_ptr) cinfo->inputctl; - - inputctl->pub.consume_input = consume_markers; - inputctl->pub.has_multiple_scans = FALSE; /* "unknown" would be better */ - inputctl->pub.eoi_reached = FALSE; - inputctl->inheaders = TRUE; - /* Reset other modules */ - (*cinfo->err->reset_error_mgr) ((j_common_ptr) cinfo); - (*cinfo->marker->reset_marker_reader) (cinfo); - /* Reset progression state -- would be cleaner if entropy decoder did this */ - cinfo->coef_bits = NULL; -} - - -/* - * Initialize the input controller module. - * This is called only once, when the decompression object is created. - */ - -GLOBAL(void) -jinit_input_controller (j_decompress_ptr cinfo) -{ - my_inputctl_ptr inputctl; - - /* Create subobject in permanent pool */ - inputctl = (my_inputctl_ptr) - (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT, - SIZEOF(my_input_controller)); - cinfo->inputctl = (struct jpeg_input_controller *) inputctl; - /* Initialize method pointers */ - inputctl->pub.consume_input = consume_markers; - inputctl->pub.reset_input_controller = reset_input_controller; - inputctl->pub.start_input_pass = start_input_pass; - inputctl->pub.finish_input_pass = finish_input_pass; - /* Initialize state: can't use reset_input_controller since we don't - * want to try to reset other modules yet. - */ - inputctl->pub.has_multiple_scans = FALSE; /* "unknown" would be better */ - inputctl->pub.eoi_reached = FALSE; - inputctl->inheaders = TRUE; -} - diff --git a/wxWidgets/src/jpeg/jdmainct.c b/wxWidgets/src/jpeg/jdmainct.c deleted file mode 100644 index cd55e8ce1c..0000000000 --- a/wxWidgets/src/jpeg/jdmainct.c +++ /dev/null @@ -1,529 +0,0 @@ -/* - * jdmainct.c - * - * Copyright (C) 1994-1996, Thomas G. Lane. - * This file is part of the Independent JPEG Group's software. - * For conditions of distribution and use, see the accompanying README file. - * - * This file contains the main buffer controller for decompression. - * The main buffer lies between the JPEG decompressor proper and the - * post-processor; it holds downsampled data in the JPEG colorspace. - * - * Note that this code is bypassed in raw-data mode, since the application - * supplies the equivalent of the main buffer in that case. - */ - -/* suppress the warnings about using main for the variable names */ -#define main jpegMain - -#define JPEG_INTERNALS -#include "jinclude.h" -#include "jpeglib.h" - -/* - * In the current system design, the main buffer need never be a full-image - * buffer; any full-height buffers will be found inside the coefficient or - * postprocessing controllers. Nonetheless, the main controller is not - * trivial. Its responsibility is to provide context rows for upsampling/ - * rescaling, and doing this in an efficient fashion is a bit tricky. - * - * Postprocessor input data is counted in "row groups". A row group - * is defined to be (v_samp_factor * DCT_scaled_size / min_DCT_scaled_size) - * sample rows of each component. (We require DCT_scaled_size values to be - * chosen such that these numbers are integers. In practice DCT_scaled_size - * values will likely be powers of two, so we actually have the stronger - * condition that DCT_scaled_size / min_DCT_scaled_size is an integer.) - * Upsampling will typically produce max_v_samp_factor pixel rows from each - * row group (times any additional scale factor that the upsampler is - * applying). - * - * The coefficient controller will deliver data to us one iMCU row at a time; - * each iMCU row contains v_samp_factor * DCT_scaled_size sample rows, or - * exactly min_DCT_scaled_size row groups. (This amount of data corresponds - * to one row of MCUs when the image is fully interleaved.) Note that the - * number of sample rows varies across components, but the number of row - * groups does not. Some garbage sample rows may be included in the last iMCU - * row at the bottom of the image. - * - * Depending on the vertical scaling algorithm used, the upsampler may need - * access to the sample row(s) above and below its current input row group. - * The upsampler is required to set need_context_rows TRUE at global selection - * time if so. When need_context_rows is FALSE, this controller can simply - * obtain one iMCU row at a time from the coefficient controller and dole it - * out as row groups to the postprocessor. - * - * When need_context_rows is TRUE, this controller guarantees that the buffer - * passed to postprocessing contains at least one row group's worth of samples - * above and below the row group(s) being processed. Note that the context - * rows "above" the first passed row group appear at negative row offsets in - * the passed buffer. At the top and bottom of the image, the required - * context rows are manufactured by duplicating the first or last real sample - * row; this avoids having special cases in the upsampling inner loops. - * - * The amount of context is fixed at one row group just because that's a - * convenient number for this controller to work with. The existing - * upsamplers really only need one sample row of context. An upsampler - * supporting arbitrary output rescaling might wish for more than one row - * group of context when shrinking the image; tough, we don't handle that. - * (This is justified by the assumption that downsizing will be handled mostly - * by adjusting the DCT_scaled_size values, so that the actual scale factor at - * the upsample step needn't be much less than one.) - * - * To provide the desired context, we have to retain the last two row groups - * of one iMCU row while reading in the next iMCU row. (The last row group - * can't be processed until we have another row group for its below-context, - * and so we have to save the next-to-last group too for its above-context.) - * We could do this most simply by copying data around in our buffer, but - * that'd be very slow. We can avoid copying any data by creating a rather - * strange pointer structure. Here's how it works. We allocate a workspace - * consisting of M+2 row groups (where M = min_DCT_scaled_size is the number - * of row groups per iMCU row). We create two sets of redundant pointers to - * the workspace. Labeling the physical row groups 0 to M+1, the synthesized - * pointer lists look like this: - * M+1 M-1 - * master pointer --> 0 master pointer --> 0 - * 1 1 - * ... ... - * M-3 M-3 - * M-2 M - * M-1 M+1 - * M M-2 - * M+1 M-1 - * 0 0 - * We read alternate iMCU rows using each master pointer; thus the last two - * row groups of the previous iMCU row remain un-overwritten in the workspace. - * The pointer lists are set up so that the required context rows appear to - * be adjacent to the proper places when we pass the pointer lists to the - * upsampler. - * - * The above pictures describe the normal state of the pointer lists. - * At top and bottom of the image, we diddle the pointer lists to duplicate - * the first or last sample row as necessary (this is cheaper than copying - * sample rows around). - * - * This scheme breaks down if M < 2, ie, min_DCT_scaled_size is 1. In that - * situation each iMCU row provides only one row group so the buffering logic - * must be different (eg, we must read two iMCU rows before we can emit the - * first row group). For now, we simply do not support providing context - * rows when min_DCT_scaled_size is 1. That combination seems unlikely to - * be worth providing --- if someone wants a 1/8th-size preview, they probably - * want it quick and dirty, so a context-free upsampler is sufficient. - */ - - -/* Private buffer controller object */ - -typedef struct { - struct jpeg_d_main_controller pub; /* public fields */ - - /* Pointer to allocated workspace (M or M+2 row groups). */ - JSAMPARRAY buffer[MAX_COMPONENTS]; - - wxjpeg_boolean buffer_full; /* Have we gotten an iMCU row from decoder? */ - JDIMENSION rowgroup_ctr; /* counts row groups output to postprocessor */ - - /* Remaining fields are only used in the context case. */ - - /* These are the master pointers to the funny-order pointer lists. */ - JSAMPIMAGE xbuffer[2]; /* pointers to weird pointer lists */ - - int whichptr; /* indicates which pointer set is now in use */ - int context_state; /* process_data state machine status */ - JDIMENSION rowgroups_avail; /* row groups available to postprocessor */ - JDIMENSION iMCU_row_ctr; /* counts iMCU rows to detect image top/bot */ -} my_main_controller; - -typedef my_main_controller * my_main_ptr; - -/* context_state values: */ -#define CTX_PREPARE_FOR_IMCU 0 /* need to prepare for MCU row */ -#define CTX_PROCESS_IMCU 1 /* feeding iMCU to postprocessor */ -#define CTX_POSTPONED_ROW 2 /* feeding postponed row group */ - - -#if defined(__VISAGECPP__) -/* Visual Age fixups for multiple declarations */ -# define start_pass_main start_pass_main2 /* already in jcmaint.c */ -# define process_data_simple_main process_data_simple_main2 /* already in jcmaint.c */ -#endif - -/* Forward declarations */ -METHODDEF(void) process_data_simple_main - JPP((j_decompress_ptr cinfo, JSAMPARRAY output_buf, - JDIMENSION *out_row_ctr, JDIMENSION out_rows_avail)); -METHODDEF(void) process_data_context_main - JPP((j_decompress_ptr cinfo, JSAMPARRAY output_buf, - JDIMENSION *out_row_ctr, JDIMENSION out_rows_avail)); -#ifdef QUANT_2PASS_SUPPORTED -METHODDEF(void) process_data_crank_post - JPP((j_decompress_ptr cinfo, JSAMPARRAY output_buf, - JDIMENSION *out_row_ctr, JDIMENSION out_rows_avail)); -#endif - - -LOCAL(void) -alloc_funny_pointers (j_decompress_ptr cinfo) -/* Allocate space for the funny pointer lists. - * This is done only once, not once per pass. - */ -{ - my_main_ptr main = (my_main_ptr) cinfo->main; - int ci, rgroup; - int M = cinfo->min_DCT_scaled_size; - jpeg_component_info *compptr; - JSAMPARRAY xbuf; - - /* Get top-level space for component array pointers. - * We alloc both arrays with one call to save a few cycles. - */ - main->xbuffer[0] = (JSAMPIMAGE) - (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, - cinfo->num_components * 2 * SIZEOF(JSAMPARRAY)); - main->xbuffer[1] = main->xbuffer[0] + cinfo->num_components; - - for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; - ci++, compptr++) { - rgroup = (compptr->v_samp_factor * compptr->DCT_scaled_size) / - cinfo->min_DCT_scaled_size; /* height of a row group of component */ - /* Get space for pointer lists --- M+4 row groups in each list. - * We alloc both pointer lists with one call to save a few cycles. - */ - xbuf = (JSAMPARRAY) - (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, - 2 * (rgroup * (M + 4)) * SIZEOF(JSAMPROW)); - xbuf += rgroup; /* want one row group at negative offsets */ - main->xbuffer[0][ci] = xbuf; - xbuf += rgroup * (M + 4); - main->xbuffer[1][ci] = xbuf; - } -} - - -LOCAL(void) -make_funny_pointers (j_decompress_ptr cinfo) -/* Create the funny pointer lists discussed in the comments above. - * The actual workspace is already allocated (in main->buffer), - * and the space for the pointer lists is allocated too. - * This routine just fills in the curiously ordered lists. - * This will be repeated at the beginning of each pass. - */ -{ - my_main_ptr main = (my_main_ptr) cinfo->main; - int ci, i, rgroup; - int M = cinfo->min_DCT_scaled_size; - jpeg_component_info *compptr; - JSAMPARRAY buf, xbuf0, xbuf1; - - for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; - ci++, compptr++) { - rgroup = (compptr->v_samp_factor * compptr->DCT_scaled_size) / - cinfo->min_DCT_scaled_size; /* height of a row group of component */ - xbuf0 = main->xbuffer[0][ci]; - xbuf1 = main->xbuffer[1][ci]; - /* First copy the workspace pointers as-is */ - buf = main->buffer[ci]; - for (i = 0; i < rgroup * (M + 2); i++) { - xbuf0[i] = xbuf1[i] = buf[i]; - } - /* In the second list, put the last four row groups in swapped order */ - for (i = 0; i < rgroup * 2; i++) { - xbuf1[rgroup*(M-2) + i] = buf[rgroup*M + i]; - xbuf1[rgroup*M + i] = buf[rgroup*(M-2) + i]; - } - /* The wraparound pointers at top and bottom will be filled later - * (see set_wraparound_pointers, below). Initially we want the "above" - * pointers to duplicate the first actual data line. This only needs - * to happen in xbuffer[0]. - */ - for (i = 0; i < rgroup; i++) { - xbuf0[i - rgroup] = xbuf0[0]; - } - } -} - - -LOCAL(void) -set_wraparound_pointers (j_decompress_ptr cinfo) -/* Set up the "wraparound" pointers at top and bottom of the pointer lists. - * This changes the pointer list state from top-of-image to the normal state. - */ -{ - my_main_ptr main = (my_main_ptr) cinfo->main; - int ci, i, rgroup; - int M = cinfo->min_DCT_scaled_size; - jpeg_component_info *compptr; - JSAMPARRAY xbuf0, xbuf1; - - for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; - ci++, compptr++) { - rgroup = (compptr->v_samp_factor * compptr->DCT_scaled_size) / - cinfo->min_DCT_scaled_size; /* height of a row group of component */ - xbuf0 = main->xbuffer[0][ci]; - xbuf1 = main->xbuffer[1][ci]; - for (i = 0; i < rgroup; i++) { - xbuf0[i - rgroup] = xbuf0[rgroup*(M+1) + i]; - xbuf1[i - rgroup] = xbuf1[rgroup*(M+1) + i]; - xbuf0[rgroup*(M+2) + i] = xbuf0[i]; - xbuf1[rgroup*(M+2) + i] = xbuf1[i]; - } - } -} - - -LOCAL(void) -set_bottom_pointers (j_decompress_ptr cinfo) -/* Change the pointer lists to duplicate the last sample row at the bottom - * of the image. whichptr indicates which xbuffer holds the final iMCU row. - * Also sets rowgroups_avail to indicate number of nondummy row groups in row. - */ -{ - my_main_ptr main = (my_main_ptr) cinfo->main; - int ci, i, rgroup, iMCUheight, rows_left; - jpeg_component_info *compptr; - JSAMPARRAY xbuf; - - for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; - ci++, compptr++) { - /* Count sample rows in one iMCU row and in one row group */ - iMCUheight = compptr->v_samp_factor * compptr->DCT_scaled_size; - rgroup = iMCUheight / cinfo->min_DCT_scaled_size; - /* Count nondummy sample rows remaining for this component */ - rows_left = (int) (compptr->downsampled_height % (JDIMENSION) iMCUheight); - if (rows_left == 0) rows_left = iMCUheight; - /* Count nondummy row groups. Should get same answer for each component, - * so we need only do it once. - */ - if (ci == 0) { - main->rowgroups_avail = (JDIMENSION) ((rows_left-1) / rgroup + 1); - } - /* Duplicate the last real sample row rgroup*2 times; this pads out the - * last partial rowgroup and ensures at least one full rowgroup of context. - */ - xbuf = main->xbuffer[main->whichptr][ci]; - for (i = 0; i < rgroup * 2; i++) { - xbuf[rows_left + i] = xbuf[rows_left-1]; - } - } -} - - -/* - * Initialize for a processing pass. - */ - -METHODDEF(void) -start_pass_main (j_decompress_ptr cinfo, J_BUF_MODE pass_mode) -{ - my_main_ptr main = (my_main_ptr) cinfo->main; - - switch (pass_mode) { - case JBUF_PASS_THRU: - if (cinfo->upsample->need_context_rows) { - main->pub.process_data = process_data_context_main; - make_funny_pointers(cinfo); /* Create the xbuffer[] lists */ - main->whichptr = 0; /* Read first iMCU row into xbuffer[0] */ - main->context_state = CTX_PREPARE_FOR_IMCU; - main->iMCU_row_ctr = 0; - } else { - /* Simple case with no context needed */ - main->pub.process_data = process_data_simple_main; - } - main->buffer_full = FALSE; /* Mark buffer empty */ - main->rowgroup_ctr = 0; - break; -#ifdef QUANT_2PASS_SUPPORTED - case JBUF_CRANK_DEST: - /* For last pass of 2-pass quantization, just crank the postprocessor */ - main->pub.process_data = process_data_crank_post; - break; -#endif - default: - ERREXIT(cinfo, JERR_BAD_BUFFER_MODE); - break; - } -} - - -/* - * Process some data. - * This handles the simple case where no context is required. - */ - -METHODDEF(void) -process_data_simple_main (j_decompress_ptr cinfo, - JSAMPARRAY output_buf, JDIMENSION *out_row_ctr, - JDIMENSION out_rows_avail) -{ - my_main_ptr main = (my_main_ptr) cinfo->main; - JDIMENSION rowgroups_avail; - - /* Read input data if we haven't filled the main buffer yet */ - if (! main->buffer_full) { - if (! (*cinfo->coef->decompress_data) (cinfo, main->buffer)) - return; /* suspension forced, can do nothing more */ - main->buffer_full = TRUE; /* OK, we have an iMCU row to work with */ - } - - /* There are always min_DCT_scaled_size row groups in an iMCU row. */ - rowgroups_avail = (JDIMENSION) cinfo->min_DCT_scaled_size; - /* Note: at the bottom of the image, we may pass extra garbage row groups - * to the postprocessor. The postprocessor has to check for bottom - * of image anyway (at row resolution), so no point in us doing it too. - */ - - /* Feed the postprocessor */ - (*cinfo->post->post_process_data) (cinfo, main->buffer, - &main->rowgroup_ctr, rowgroups_avail, - output_buf, out_row_ctr, out_rows_avail); - - /* Has postprocessor consumed all the data yet? If so, mark buffer empty */ - if (main->rowgroup_ctr >= rowgroups_avail) { - main->buffer_full = FALSE; - main->rowgroup_ctr = 0; - } -} - - -/* - * Process some data. - * This handles the case where context rows must be provided. - */ - -METHODDEF(void) -process_data_context_main (j_decompress_ptr cinfo, - JSAMPARRAY output_buf, JDIMENSION *out_row_ctr, - JDIMENSION out_rows_avail) -{ - my_main_ptr main = (my_main_ptr) cinfo->main; - - /* Read input data if we haven't filled the main buffer yet */ - if (! main->buffer_full) { - if (! (*cinfo->coef->decompress_data) (cinfo, - main->xbuffer[main->whichptr])) - return; /* suspension forced, can do nothing more */ - main->buffer_full = TRUE; /* OK, we have an iMCU row to work with */ - main->iMCU_row_ctr++; /* count rows received */ - } - - /* Postprocessor typically will not swallow all the input data it is handed - * in one call (due to filling the output buffer first). Must be prepared - * to exit and restart. This switch lets us keep track of how far we got. - * Note that each case falls through to the next on successful completion. - */ - switch (main->context_state) { - case CTX_POSTPONED_ROW: - /* Call postprocessor using previously set pointers for postponed row */ - (*cinfo->post->post_process_data) (cinfo, main->xbuffer[main->whichptr], - &main->rowgroup_ctr, main->rowgroups_avail, - output_buf, out_row_ctr, out_rows_avail); - if (main->rowgroup_ctr < main->rowgroups_avail) - return; /* Need to suspend */ - main->context_state = CTX_PREPARE_FOR_IMCU; - if (*out_row_ctr >= out_rows_avail) - return; /* Postprocessor exactly filled output buf */ - /*FALLTHROUGH*/ - case CTX_PREPARE_FOR_IMCU: - /* Prepare to process first M-1 row groups of this iMCU row */ - main->rowgroup_ctr = 0; - main->rowgroups_avail = (JDIMENSION) (cinfo->min_DCT_scaled_size - 1); - /* Check for bottom of image: if so, tweak pointers to "duplicate" - * the last sample row, and adjust rowgroups_avail to ignore padding rows. - */ - if (main->iMCU_row_ctr == cinfo->total_iMCU_rows) - set_bottom_pointers(cinfo); - main->context_state = CTX_PROCESS_IMCU; - /*FALLTHROUGH*/ - case CTX_PROCESS_IMCU: - /* Call postprocessor using previously set pointers */ - (*cinfo->post->post_process_data) (cinfo, main->xbuffer[main->whichptr], - &main->rowgroup_ctr, main->rowgroups_avail, - output_buf, out_row_ctr, out_rows_avail); - if (main->rowgroup_ctr < main->rowgroups_avail) - return; /* Need to suspend */ - /* After the first iMCU, change wraparound pointers to normal state */ - if (main->iMCU_row_ctr == 1) - set_wraparound_pointers(cinfo); - /* Prepare to load new iMCU row using other xbuffer list */ - main->whichptr ^= 1; /* 0=>1 or 1=>0 */ - main->buffer_full = FALSE; - /* Still need to process last row group of this iMCU row, */ - /* which is saved at index M+1 of the other xbuffer */ - main->rowgroup_ctr = (JDIMENSION) (cinfo->min_DCT_scaled_size + 1); - main->rowgroups_avail = (JDIMENSION) (cinfo->min_DCT_scaled_size + 2); - main->context_state = CTX_POSTPONED_ROW; - } -} - - -/* - * Process some data. - * Final pass of two-pass quantization: just call the postprocessor. - * Source data will be the postprocessor controller's internal buffer. - */ - -#ifdef QUANT_2PASS_SUPPORTED - -METHODDEF(void) -process_data_crank_post (j_decompress_ptr cinfo, - JSAMPARRAY output_buf, JDIMENSION *out_row_ctr, - JDIMENSION out_rows_avail) -{ - (*cinfo->post->post_process_data) (cinfo, (JSAMPIMAGE) NULL, - (JDIMENSION *) NULL, (JDIMENSION) 0, - output_buf, out_row_ctr, out_rows_avail); -} - -#endif /* QUANT_2PASS_SUPPORTED */ - - -/* - * Initialize main buffer controller. - */ - -GLOBAL(void) -jinit_d_main_controller (j_decompress_ptr cinfo, wxjpeg_boolean need_full_buffer) -{ - my_main_ptr main; - int ci, rgroup, ngroups; - jpeg_component_info *compptr; - - main = (my_main_ptr) - (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, - SIZEOF(my_main_controller)); - cinfo->main = (struct jpeg_d_main_controller *) main; - main->pub.start_pass = start_pass_main; - - if (need_full_buffer) /* shouldn't happen */ - ERREXIT(cinfo, JERR_BAD_BUFFER_MODE); - - /* Allocate the workspace. - * ngroups is the number of row groups we need. - */ - if (cinfo->upsample->need_context_rows) { - if (cinfo->min_DCT_scaled_size < 2) /* unsupported, see comments above */ - ERREXIT(cinfo, JERR_NOTIMPL); - alloc_funny_pointers(cinfo); /* Alloc space for xbuffer[] lists */ - ngroups = cinfo->min_DCT_scaled_size + 2; - } else { - ngroups = cinfo->min_DCT_scaled_size; - } - - for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; - ci++, compptr++) { - rgroup = (compptr->v_samp_factor * compptr->DCT_scaled_size) / - cinfo->min_DCT_scaled_size; /* height of a row group of component */ - main->buffer[ci] = (*cinfo->mem->alloc_sarray) - ((j_common_ptr) cinfo, JPOOL_IMAGE, - compptr->width_in_blocks * compptr->DCT_scaled_size, - (JDIMENSION) (rgroup * ngroups)); - } -} - -#if defined(__VISAGECPP__) -# ifdef start_pass_main2 -# undef start_pass_main2 -# endif -# ifdef process_data_simple_main2 -# undef process_data_simple_main2 -# endif -#endif diff --git a/wxWidgets/src/jpeg/jdmarker.c b/wxWidgets/src/jpeg/jdmarker.c deleted file mode 100644 index 39bed54224..0000000000 --- a/wxWidgets/src/jpeg/jdmarker.c +++ /dev/null @@ -1,1360 +0,0 @@ -/* - * jdmarker.c - * - * Copyright (C) 1991-1998, Thomas G. Lane. - * This file is part of the Independent JPEG Group's software. - * For conditions of distribution and use, see the accompanying README file. - * - * This file contains routines to decode JPEG datastream markers. - * Most of the complexity arises from our desire to support input - * suspension: if not all of the data for a marker is available, - * we must exit back to the application. On resumption, we reprocess - * the marker. - */ - -#define JPEG_INTERNALS -#include "jinclude.h" -#include "jpeglib.h" - - -typedef enum { /* JPEG marker codes */ - M_SOF0 = 0xc0, - M_SOF1 = 0xc1, - M_SOF2 = 0xc2, - M_SOF3 = 0xc3, - - M_SOF5 = 0xc5, - M_SOF6 = 0xc6, - M_SOF7 = 0xc7, - - M_JPG = 0xc8, - M_SOF9 = 0xc9, - M_SOF10 = 0xca, - M_SOF11 = 0xcb, - - M_SOF13 = 0xcd, - M_SOF14 = 0xce, - M_SOF15 = 0xcf, - - M_DHT = 0xc4, - - M_DAC = 0xcc, - - M_RST0 = 0xd0, - M_RST1 = 0xd1, - M_RST2 = 0xd2, - M_RST3 = 0xd3, - M_RST4 = 0xd4, - M_RST5 = 0xd5, - M_RST6 = 0xd6, - M_RST7 = 0xd7, - - M_SOI = 0xd8, - M_EOI = 0xd9, - M_SOS = 0xda, - M_DQT = 0xdb, - M_DNL = 0xdc, - M_DRI = 0xdd, - M_DHP = 0xde, - M_EXP = 0xdf, - - M_APP0 = 0xe0, - M_APP1 = 0xe1, - M_APP2 = 0xe2, - M_APP3 = 0xe3, - M_APP4 = 0xe4, - M_APP5 = 0xe5, - M_APP6 = 0xe6, - M_APP7 = 0xe7, - M_APP8 = 0xe8, - M_APP9 = 0xe9, - M_APP10 = 0xea, - M_APP11 = 0xeb, - M_APP12 = 0xec, - M_APP13 = 0xed, - M_APP14 = 0xee, - M_APP15 = 0xef, - - M_JPG0 = 0xf0, - M_JPG13 = 0xfd, - M_COM = 0xfe, - - M_TEM = 0x01, - - M_ERROR = 0x100 -} JPEG_MARKER; - - -/* Private state */ - -typedef struct { - struct jpeg_marker_reader pub; /* public fields */ - - /* Application-overridable marker processing methods */ - jpeg_marker_parser_method process_COM; - jpeg_marker_parser_method process_APPn[16]; - - /* Limit on marker data length to save for each marker type */ - unsigned int length_limit_COM; - unsigned int length_limit_APPn[16]; - - /* Status of COM/APPn marker saving */ - jpeg_saved_marker_ptr cur_marker; /* NULL if not processing a marker */ - unsigned int bytes_read; /* data bytes read so far in marker */ - /* Note: cur_marker is not linked into marker_list until it's all read. */ -} my_marker_reader; - -typedef my_marker_reader * my_marker_ptr; - - -/* - * Macros for fetching data from the data source module. - * - * At all times, cinfo->src->next_input_byte and ->bytes_in_buffer reflect - * the current restart point; we update them only when we have reached a - * suitable place to restart if a suspension occurs. - */ - -/* Declare and initialize local copies of input pointer/count */ -#define INPUT_VARS(cinfo) \ - struct jpeg_source_mgr * datasrc = (cinfo)->src; \ - const JOCTET * next_input_byte = datasrc->next_input_byte; \ - size_t bytes_in_buffer = datasrc->bytes_in_buffer - -/* Unload the local copies --- do this only at a restart boundary */ -#define INPUT_SYNC(cinfo) \ - ( datasrc->next_input_byte = next_input_byte, \ - datasrc->bytes_in_buffer = bytes_in_buffer ) - -/* Reload the local copies --- used only in MAKE_BYTE_AVAIL */ -#define INPUT_RELOAD(cinfo) \ - ( next_input_byte = datasrc->next_input_byte, \ - bytes_in_buffer = datasrc->bytes_in_buffer ) - -/* Internal macro for INPUT_BYTE and INPUT_2BYTES: make a byte available. - * Note we do *not* do INPUT_SYNC before calling fill_input_buffer, - * but we must reload the local copies after a successful fill. - */ -#define MAKE_BYTE_AVAIL(cinfo,action) \ - if (bytes_in_buffer == 0) { \ - if (! (*datasrc->fill_input_buffer) (cinfo)) \ - { action; } \ - INPUT_RELOAD(cinfo); \ - } - -/* Read a byte into variable V. - * If must suspend, take the specified action (typically "return FALSE"). - */ -#define INPUT_BYTE(cinfo,V,action) \ - MAKESTMT( MAKE_BYTE_AVAIL(cinfo,action); \ - bytes_in_buffer--; \ - V = GETJOCTET(*next_input_byte++); ) - -/* As above, but read two bytes interpreted as an unsigned 16-bit integer. - * V should be declared unsigned int or perhaps INT32. - */ -#define INPUT_2BYTES(cinfo,V,action) \ - MAKESTMT( MAKE_BYTE_AVAIL(cinfo,action); \ - bytes_in_buffer--; \ - V = ((unsigned int) GETJOCTET(*next_input_byte++)) << 8; \ - MAKE_BYTE_AVAIL(cinfo,action); \ - bytes_in_buffer--; \ - V += GETJOCTET(*next_input_byte++); ) - - -/* - * Routines to process JPEG markers. - * - * Entry condition: JPEG marker itself has been read and its code saved - * in cinfo->unread_marker; input restart point is just after the marker. - * - * Exit: if return TRUE, have read and processed any parameters, and have - * updated the restart point to point after the parameters. - * If return FALSE, was forced to suspend before reaching end of - * marker parameters; restart point has not been moved. Same routine - * will be called again after application supplies more input data. - * - * This approach to suspension assumes that all of a marker's parameters - * can fit into a single input bufferload. This should hold for "normal" - * markers. Some COM/APPn markers might have large parameter segments - * that might not fit. If we are simply dropping such a marker, we use - * skip_input_data to get past it, and thereby put the problem on the - * source manager's shoulders. If we are saving the marker's contents - * into memory, we use a slightly different convention: when forced to - * suspend, the marker processor updates the restart point to the end of - * what it's consumed (ie, the end of the buffer) before returning FALSE. - * On resumption, cinfo->unread_marker still contains the marker code, - * but the data source will point to the next chunk of marker data. - * The marker processor must retain internal state to deal with this. - * - * Note that we don't bother to avoid duplicate trace messages if a - * suspension occurs within marker parameters. Other side effects - * require more care. - */ - - -LOCAL(wxjpeg_boolean) -get_soi (j_decompress_ptr cinfo) -/* Process an SOI marker */ -{ - int i; - - TRACEMS(cinfo, 1, JTRC_SOI); - - if (cinfo->marker->saw_SOI) - ERREXIT(cinfo, JERR_SOI_DUPLICATE); - - /* Reset all parameters that are defined to be reset by SOI */ - - for (i = 0; i < NUM_ARITH_TBLS; i++) { - cinfo->arith_dc_L[i] = 0; - cinfo->arith_dc_U[i] = 1; - cinfo->arith_ac_K[i] = 5; - } - cinfo->restart_interval = 0; - - /* Set initial assumptions for colorspace etc */ - - cinfo->jpeg_color_space = JCS_UNKNOWN; - cinfo->CCIR601_sampling = FALSE; /* Assume non-CCIR sampling??? */ - - cinfo->saw_JFIF_marker = FALSE; - cinfo->JFIF_major_version = 1; /* set default JFIF APP0 values */ - cinfo->JFIF_minor_version = 1; - cinfo->density_unit = 0; - cinfo->X_density = 1; - cinfo->Y_density = 1; - cinfo->saw_Adobe_marker = FALSE; - cinfo->Adobe_transform = 0; - - cinfo->marker->saw_SOI = TRUE; - - return TRUE; -} - - -LOCAL(wxjpeg_boolean) -get_sof (j_decompress_ptr cinfo, wxjpeg_boolean is_prog, wxjpeg_boolean is_arith) -/* Process a SOFn marker */ -{ - JPEG_INT32 length; - int c, ci; - jpeg_component_info * compptr; - INPUT_VARS(cinfo); - - cinfo->progressive_mode = is_prog; - cinfo->arith_code = is_arith; - - INPUT_2BYTES(cinfo, length, return FALSE); - - INPUT_BYTE(cinfo, cinfo->data_precision, return FALSE); - INPUT_2BYTES(cinfo, cinfo->image_height, return FALSE); - INPUT_2BYTES(cinfo, cinfo->image_width, return FALSE); - INPUT_BYTE(cinfo, cinfo->num_components, return FALSE); - - length -= 8; - - TRACEMS4(cinfo, 1, JTRC_SOF, cinfo->unread_marker, - (int) cinfo->image_width, (int) cinfo->image_height, - cinfo->num_components); - - if (cinfo->marker->saw_SOF) - ERREXIT(cinfo, JERR_SOF_DUPLICATE); - - /* We don't support files in which the image height is initially specified */ - /* as 0 and is later redefined by DNL. As long as we have to check that, */ - /* might as well have a general sanity check. */ - if (cinfo->image_height <= 0 || cinfo->image_width <= 0 - || cinfo->num_components <= 0) - ERREXIT(cinfo, JERR_EMPTY_IMAGE); - - if (length != (cinfo->num_components * 3)) - ERREXIT(cinfo, JERR_BAD_LENGTH); - - if (cinfo->comp_info == NULL) /* do only once, even if suspend */ - cinfo->comp_info = (jpeg_component_info *) (*cinfo->mem->alloc_small) - ((j_common_ptr) cinfo, JPOOL_IMAGE, - cinfo->num_components * SIZEOF(jpeg_component_info)); - - for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; - ci++, compptr++) { - compptr->component_index = ci; - INPUT_BYTE(cinfo, compptr->component_id, return FALSE); - INPUT_BYTE(cinfo, c, return FALSE); - compptr->h_samp_factor = (c >> 4) & 15; - compptr->v_samp_factor = (c ) & 15; - INPUT_BYTE(cinfo, compptr->quant_tbl_no, return FALSE); - - TRACEMS4(cinfo, 1, JTRC_SOF_COMPONENT, - compptr->component_id, compptr->h_samp_factor, - compptr->v_samp_factor, compptr->quant_tbl_no); - } - - cinfo->marker->saw_SOF = TRUE; - - INPUT_SYNC(cinfo); - return TRUE; -} - - -LOCAL(wxjpeg_boolean) -get_sos (j_decompress_ptr cinfo) -/* Process a SOS marker */ -{ - JPEG_INT32 length; - int i, ci, n, c, cc; - jpeg_component_info * compptr; - INPUT_VARS(cinfo); - - if (! cinfo->marker->saw_SOF) - ERREXIT(cinfo, JERR_SOS_NO_SOF); - - INPUT_2BYTES(cinfo, length, return FALSE); - - INPUT_BYTE(cinfo, n, return FALSE); /* Number of components */ - - TRACEMS1(cinfo, 1, JTRC_SOS, n); - - if (length != (n * 2 + 6) || n < 1 || n > MAX_COMPS_IN_SCAN) - ERREXIT(cinfo, JERR_BAD_LENGTH); - - cinfo->comps_in_scan = n; - - /* Collect the component-spec parameters */ - - for (i = 0; i < n; i++) { - INPUT_BYTE(cinfo, cc, return FALSE); - INPUT_BYTE(cinfo, c, return FALSE); - - for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; - ci++, compptr++) { - if (cc == compptr->component_id) - goto id_found; - } - - ERREXIT1(cinfo, JERR_BAD_COMPONENT_ID, cc); - - id_found: - - cinfo->cur_comp_info[i] = compptr; - compptr->dc_tbl_no = (c >> 4) & 15; - compptr->ac_tbl_no = (c ) & 15; - - TRACEMS3(cinfo, 1, JTRC_SOS_COMPONENT, cc, - compptr->dc_tbl_no, compptr->ac_tbl_no); - } - - /* Collect the additional scan parameters Ss, Se, Ah/Al. */ - INPUT_BYTE(cinfo, c, return FALSE); - cinfo->Ss = c; - INPUT_BYTE(cinfo, c, return FALSE); - cinfo->Se = c; - INPUT_BYTE(cinfo, c, return FALSE); - cinfo->Ah = (c >> 4) & 15; - cinfo->Al = (c ) & 15; - - TRACEMS4(cinfo, 1, JTRC_SOS_PARAMS, cinfo->Ss, cinfo->Se, - cinfo->Ah, cinfo->Al); - - /* Prepare to scan data & restart markers */ - cinfo->marker->next_restart_num = 0; - - /* Count another SOS marker */ - cinfo->input_scan_number++; - - INPUT_SYNC(cinfo); - return TRUE; -} - - -#ifdef D_ARITH_CODING_SUPPORTED - -LOCAL(wxjpeg_boolean) -get_dac (j_decompress_ptr cinfo) -/* Process a DAC marker */ -{ - JPEG_INT32 length; - int index, val; - INPUT_VARS(cinfo); - - INPUT_2BYTES(cinfo, length, return FALSE); - length -= 2; - - while (length > 0) { - INPUT_BYTE(cinfo, index, return FALSE); - INPUT_BYTE(cinfo, val, return FALSE); - - length -= 2; - - TRACEMS2(cinfo, 1, JTRC_DAC, index, val); - - if (index < 0 || index >= (2*NUM_ARITH_TBLS)) - ERREXIT1(cinfo, JERR_DAC_INDEX, index); - - if (index >= NUM_ARITH_TBLS) { /* define AC table */ - cinfo->arith_ac_K[index-NUM_ARITH_TBLS] = (UINT8) val; - } else { /* define DC table */ - cinfo->arith_dc_L[index] = (UINT8) (val & 0x0F); - cinfo->arith_dc_U[index] = (UINT8) (val >> 4); - if (cinfo->arith_dc_L[index] > cinfo->arith_dc_U[index]) - ERREXIT1(cinfo, JERR_DAC_VALUE, val); - } - } - - if (length != 0) - ERREXIT(cinfo, JERR_BAD_LENGTH); - - INPUT_SYNC(cinfo); - return TRUE; -} - -#else /* ! D_ARITH_CODING_SUPPORTED */ - -#define get_dac(cinfo) skip_variable(cinfo) - -#endif /* D_ARITH_CODING_SUPPORTED */ - - -LOCAL(wxjpeg_boolean) -get_dht (j_decompress_ptr cinfo) -/* Process a DHT marker */ -{ - JPEG_INT32 length; - UINT8 bits[17]; - UINT8 huffval[256]; - int i, index, count; - JHUFF_TBL **htblptr; - INPUT_VARS(cinfo); - - INPUT_2BYTES(cinfo, length, return FALSE); - length -= 2; - - while (length > 16) { - INPUT_BYTE(cinfo, index, return FALSE); - - TRACEMS1(cinfo, 1, JTRC_DHT, index); - - bits[0] = 0; - count = 0; - for (i = 1; i <= 16; i++) { - INPUT_BYTE(cinfo, bits[i], return FALSE); - count += bits[i]; - } - - length -= 1 + 16; - - TRACEMS8(cinfo, 2, JTRC_HUFFBITS, - bits[1], bits[2], bits[3], bits[4], - bits[5], bits[6], bits[7], bits[8]); - TRACEMS8(cinfo, 2, JTRC_HUFFBITS, - bits[9], bits[10], bits[11], bits[12], - bits[13], bits[14], bits[15], bits[16]); - - /* Here we just do minimal validation of the counts to avoid walking - * off the end of our table space. jdhuff.c will check more carefully. - */ - if (count > 256 || ((JPEG_INT32) count) > length) - ERREXIT(cinfo, JERR_BAD_HUFF_TABLE); - - for (i = 0; i < count; i++) - INPUT_BYTE(cinfo, huffval[i], return FALSE); - - length -= count; - - if (index & 0x10) { /* AC table definition */ - index -= 0x10; - htblptr = &cinfo->ac_huff_tbl_ptrs[index]; - } else { /* DC table definition */ - htblptr = &cinfo->dc_huff_tbl_ptrs[index]; - } - - if (index < 0 || index >= NUM_HUFF_TBLS) - ERREXIT1(cinfo, JERR_DHT_INDEX, index); - - if (*htblptr == NULL) - *htblptr = jpeg_alloc_huff_table((j_common_ptr) cinfo); - - MEMCOPY((*htblptr)->bits, bits, SIZEOF((*htblptr)->bits)); - MEMCOPY((*htblptr)->huffval, huffval, SIZEOF((*htblptr)->huffval)); - } - - if (length != 0) - ERREXIT(cinfo, JERR_BAD_LENGTH); - - INPUT_SYNC(cinfo); - return TRUE; -} - - -LOCAL(wxjpeg_boolean) -get_dqt (j_decompress_ptr cinfo) -/* Process a DQT marker */ -{ - JPEG_INT32 length; - int n, i, prec; - unsigned int tmp; - JQUANT_TBL *quant_ptr; - INPUT_VARS(cinfo); - - INPUT_2BYTES(cinfo, length, return FALSE); - length -= 2; - - while (length > 0) { - INPUT_BYTE(cinfo, n, return FALSE); - prec = n >> 4; - n &= 0x0F; - - TRACEMS2(cinfo, 1, JTRC_DQT, n, prec); - - if (n >= NUM_QUANT_TBLS) - ERREXIT1(cinfo, JERR_DQT_INDEX, n); - - if (cinfo->quant_tbl_ptrs[n] == NULL) - cinfo->quant_tbl_ptrs[n] = jpeg_alloc_quant_table((j_common_ptr) cinfo); - quant_ptr = cinfo->quant_tbl_ptrs[n]; - - for (i = 0; i < DCTSIZE2; i++) { - if (prec) - INPUT_2BYTES(cinfo, tmp, return FALSE); - else - INPUT_BYTE(cinfo, tmp, return FALSE); - /* We convert the zigzag-order table to natural array order. */ - quant_ptr->quantval[jpeg_natural_order[i]] = (UINT16) tmp; - } - - if (cinfo->err->trace_level >= 2) { - for (i = 0; i < DCTSIZE2; i += 8) { - TRACEMS8(cinfo, 2, JTRC_QUANTVALS, - quant_ptr->quantval[i], quant_ptr->quantval[i+1], - quant_ptr->quantval[i+2], quant_ptr->quantval[i+3], - quant_ptr->quantval[i+4], quant_ptr->quantval[i+5], - quant_ptr->quantval[i+6], quant_ptr->quantval[i+7]); - } - } - - length -= DCTSIZE2+1; - if (prec) length -= DCTSIZE2; - } - - if (length != 0) - ERREXIT(cinfo, JERR_BAD_LENGTH); - - INPUT_SYNC(cinfo); - return TRUE; -} - - -LOCAL(wxjpeg_boolean) -get_dri (j_decompress_ptr cinfo) -/* Process a DRI marker */ -{ - JPEG_INT32 length; - unsigned int tmp; - INPUT_VARS(cinfo); - - INPUT_2BYTES(cinfo, length, return FALSE); - - if (length != 4) - ERREXIT(cinfo, JERR_BAD_LENGTH); - - INPUT_2BYTES(cinfo, tmp, return FALSE); - - TRACEMS1(cinfo, 1, JTRC_DRI, tmp); - - cinfo->restart_interval = tmp; - - INPUT_SYNC(cinfo); - return TRUE; -} - - -/* - * Routines for processing APPn and COM markers. - * These are either saved in memory or discarded, per application request. - * APP0 and APP14 are specially checked to see if they are - * JFIF and Adobe markers, respectively. - */ - -#define APP0_DATA_LEN 14 /* Length of interesting data in APP0 */ -#define APP14_DATA_LEN 12 /* Length of interesting data in APP14 */ -#define APPN_DATA_LEN 14 /* Must be the largest of the above!! */ - - -LOCAL(void) -examine_app0 (j_decompress_ptr cinfo, JOCTET FAR * data, - unsigned int datalen, JPEG_INT32 remaining) -/* Examine first few bytes from an APP0. - * Take appropriate action if it is a JFIF marker. - * datalen is # of bytes at data[], remaining is length of rest of marker data. - */ -{ - JPEG_INT32 totallen = (JPEG_INT32) datalen + remaining; - - if (datalen >= APP0_DATA_LEN && - GETJOCTET(data[0]) == 0x4A && - GETJOCTET(data[1]) == 0x46 && - GETJOCTET(data[2]) == 0x49 && - GETJOCTET(data[3]) == 0x46 && - GETJOCTET(data[4]) == 0) { - /* Found JFIF APP0 marker: save info */ - cinfo->saw_JFIF_marker = TRUE; - cinfo->JFIF_major_version = GETJOCTET(data[5]); - cinfo->JFIF_minor_version = GETJOCTET(data[6]); - cinfo->density_unit = GETJOCTET(data[7]); - cinfo->X_density = (GETJOCTET(data[8]) << 8) + GETJOCTET(data[9]); - cinfo->Y_density = (GETJOCTET(data[10]) << 8) + GETJOCTET(data[11]); - /* Check version. - * Major version must be 1, anything else signals an incompatible change. - * (We used to treat this as an error, but now it's a nonfatal warning, - * because some bozo at Hijaak couldn't read the spec.) - * Minor version should be 0..2, but process anyway if newer. - */ - if (cinfo->JFIF_major_version != 1) - WARNMS2(cinfo, JWRN_JFIF_MAJOR, - cinfo->JFIF_major_version, cinfo->JFIF_minor_version); - /* Generate trace messages */ - TRACEMS5(cinfo, 1, JTRC_JFIF, - cinfo->JFIF_major_version, cinfo->JFIF_minor_version, - cinfo->X_density, cinfo->Y_density, cinfo->density_unit); - /* Validate thumbnail dimensions and issue appropriate messages */ - if (GETJOCTET(data[12]) | GETJOCTET(data[13])) - TRACEMS2(cinfo, 1, JTRC_JFIF_THUMBNAIL, - GETJOCTET(data[12]), GETJOCTET(data[13])); - totallen -= APP0_DATA_LEN; - if (totallen != - ((JPEG_INT32)GETJOCTET(data[12]) * (JPEG_INT32)GETJOCTET(data[13]) * (JPEG_INT32) 3)) - TRACEMS1(cinfo, 1, JTRC_JFIF_BADTHUMBNAILSIZE, (int) totallen); - } else if (datalen >= 6 && - GETJOCTET(data[0]) == 0x4A && - GETJOCTET(data[1]) == 0x46 && - GETJOCTET(data[2]) == 0x58 && - GETJOCTET(data[3]) == 0x58 && - GETJOCTET(data[4]) == 0) { - /* Found JFIF "JFXX" extension APP0 marker */ - /* The library doesn't actually do anything with these, - * but we try to produce a helpful trace message. - */ - switch (GETJOCTET(data[5])) { - case 0x10: - TRACEMS1(cinfo, 1, JTRC_THUMB_JPEG, (int) totallen); - break; - case 0x11: - TRACEMS1(cinfo, 1, JTRC_THUMB_PALETTE, (int) totallen); - break; - case 0x13: - TRACEMS1(cinfo, 1, JTRC_THUMB_RGB, (int) totallen); - break; - default: - TRACEMS2(cinfo, 1, JTRC_JFIF_EXTENSION, - GETJOCTET(data[5]), (int) totallen); - break; - } - } else { - /* Start of APP0 does not match "JFIF" or "JFXX", or too short */ - TRACEMS1(cinfo, 1, JTRC_APP0, (int) totallen); - } -} - - -LOCAL(void) -examine_app14 (j_decompress_ptr cinfo, JOCTET FAR * data, - unsigned int datalen, JPEG_INT32 remaining) -/* Examine first few bytes from an APP14. - * Take appropriate action if it is an Adobe marker. - * datalen is # of bytes at data[], remaining is length of rest of marker data. - */ -{ - unsigned int version, flags0, flags1, transform; - - if (datalen >= APP14_DATA_LEN && - GETJOCTET(data[0]) == 0x41 && - GETJOCTET(data[1]) == 0x64 && - GETJOCTET(data[2]) == 0x6F && - GETJOCTET(data[3]) == 0x62 && - GETJOCTET(data[4]) == 0x65) { - /* Found Adobe APP14 marker */ - version = (GETJOCTET(data[5]) << 8) + GETJOCTET(data[6]); - flags0 = (GETJOCTET(data[7]) << 8) + GETJOCTET(data[8]); - flags1 = (GETJOCTET(data[9]) << 8) + GETJOCTET(data[10]); - transform = GETJOCTET(data[11]); - TRACEMS4(cinfo, 1, JTRC_ADOBE, version, flags0, flags1, transform); - cinfo->saw_Adobe_marker = TRUE; - cinfo->Adobe_transform = (UINT8) transform; - } else { - /* Start of APP14 does not match "Adobe", or too short */ - TRACEMS1(cinfo, 1, JTRC_APP14, (int) (datalen + remaining)); - } -} - - -METHODDEF(wxjpeg_boolean) -get_interesting_appn (j_decompress_ptr cinfo) -/* Process an APP0 or APP14 marker without saving it */ -{ - JPEG_INT32 length; - JOCTET b[APPN_DATA_LEN]; - unsigned int i, numtoread; - INPUT_VARS(cinfo); - - INPUT_2BYTES(cinfo, length, return FALSE); - length -= 2; - - /* get the interesting part of the marker data */ - if (length >= APPN_DATA_LEN) - numtoread = APPN_DATA_LEN; - else if (length > 0) - numtoread = (unsigned int) length; - else - numtoread = 0; - for (i = 0; i < numtoread; i++) - INPUT_BYTE(cinfo, b[i], return FALSE); - length -= numtoread; - - /* process it */ - switch (cinfo->unread_marker) { - case M_APP0: - examine_app0(cinfo, (JOCTET FAR *) b, numtoread, length); - break; - case M_APP14: - examine_app14(cinfo, (JOCTET FAR *) b, numtoread, length); - break; - default: - /* can't get here unless jpeg_save_markers chooses wrong processor */ - ERREXIT1(cinfo, JERR_UNKNOWN_MARKER, cinfo->unread_marker); - break; - } - - /* skip any remaining data -- could be lots */ - INPUT_SYNC(cinfo); - if (length > 0) - (*cinfo->src->skip_input_data) (cinfo, (long) length); - - return TRUE; -} - - -#ifdef SAVE_MARKERS_SUPPORTED - -METHODDEF(wxjpeg_boolean) -save_marker (j_decompress_ptr cinfo) -/* Save an APPn or COM marker into the marker list */ -{ - my_marker_ptr marker = (my_marker_ptr) cinfo->marker; - jpeg_saved_marker_ptr cur_marker = marker->cur_marker; - unsigned int bytes_read, data_length; - JOCTET FAR * data; - JPEG_INT32 length = 0; - INPUT_VARS(cinfo); - - if (cur_marker == NULL) { - /* begin reading a marker */ - INPUT_2BYTES(cinfo, length, return FALSE); - length -= 2; - if (length >= 0) { /* watch out for bogus length word */ - /* figure out how much we want to save */ - unsigned int limit; - if (cinfo->unread_marker == (int) M_COM) - limit = marker->length_limit_COM; - else - limit = marker->length_limit_APPn[cinfo->unread_marker - (int) M_APP0]; - if ((unsigned int) length < limit) - limit = (unsigned int) length; - /* allocate and initialize the marker item */ - cur_marker = (jpeg_saved_marker_ptr) - (*cinfo->mem->alloc_large) ((j_common_ptr) cinfo, JPOOL_IMAGE, - SIZEOF(struct jpeg_marker_struct) + limit); - cur_marker->next = NULL; - cur_marker->marker = (UINT8) cinfo->unread_marker; - cur_marker->original_length = (unsigned int) length; - cur_marker->data_length = limit; - /* data area is just beyond the jpeg_marker_struct */ - data = cur_marker->data = (JOCTET FAR *) (cur_marker + 1); - marker->cur_marker = cur_marker; - marker->bytes_read = 0; - bytes_read = 0; - data_length = limit; - } else { - /* deal with bogus length word */ - bytes_read = data_length = 0; - data = NULL; - } - } else { - /* resume reading a marker */ - bytes_read = marker->bytes_read; - data_length = cur_marker->data_length; - data = cur_marker->data + bytes_read; - } - - while (bytes_read < data_length) { - INPUT_SYNC(cinfo); /* move the restart point to here */ - marker->bytes_read = bytes_read; - /* If there's not at least one byte in buffer, suspend */ - MAKE_BYTE_AVAIL(cinfo, return FALSE); - /* Copy bytes with reasonable rapidity */ - while (bytes_read < data_length && bytes_in_buffer > 0) { - *data++ = *next_input_byte++; - bytes_in_buffer--; - bytes_read++; - } - } - - /* Done reading what we want to read */ - if (cur_marker != NULL) { /* will be NULL if bogus length word */ - /* Add new marker to end of list */ - if (cinfo->marker_list == NULL) { - cinfo->marker_list = cur_marker; - } else { - jpeg_saved_marker_ptr prev = cinfo->marker_list; - while (prev->next != NULL) - prev = prev->next; - prev->next = cur_marker; - } - /* Reset pointer & calc remaining data length */ - data = cur_marker->data; - length = cur_marker->original_length - data_length; - } - /* Reset to initial state for next marker */ - marker->cur_marker = NULL; - - /* Process the marker if interesting; else just make a generic trace msg */ - switch (cinfo->unread_marker) { - case M_APP0: - examine_app0(cinfo, data, data_length, length); - break; - case M_APP14: - examine_app14(cinfo, data, data_length, length); - break; - default: - TRACEMS2(cinfo, 1, JTRC_MISC_MARKER, cinfo->unread_marker, - (int) (data_length + length)); - break; - } - - /* skip any remaining data -- could be lots */ - INPUT_SYNC(cinfo); /* do before skip_input_data */ - if (length > 0) - (*cinfo->src->skip_input_data) (cinfo, (long) length); - - return TRUE; -} - -#endif /* SAVE_MARKERS_SUPPORTED */ - - -METHODDEF(wxjpeg_boolean) -skip_variable (j_decompress_ptr cinfo) -/* Skip over an unknown or uninteresting variable-length marker */ -{ - JPEG_INT32 length; - INPUT_VARS(cinfo); - - INPUT_2BYTES(cinfo, length, return FALSE); - length -= 2; - - TRACEMS2(cinfo, 1, JTRC_MISC_MARKER, cinfo->unread_marker, (int) length); - - INPUT_SYNC(cinfo); /* do before skip_input_data */ - if (length > 0) - (*cinfo->src->skip_input_data) (cinfo, (long) length); - - return TRUE; -} - - -/* - * Find the next JPEG marker, save it in cinfo->unread_marker. - * Returns FALSE if had to suspend before reaching a marker; - * in that case cinfo->unread_marker is unchanged. - * - * Note that the result might not be a valid marker code, - * but it will never be 0 or FF. - */ - -LOCAL(wxjpeg_boolean) -next_marker (j_decompress_ptr cinfo) -{ - int c; - INPUT_VARS(cinfo); - - for (;;) { - INPUT_BYTE(cinfo, c, return FALSE); - /* Skip any non-FF bytes. - * This may look a bit inefficient, but it will not occur in a valid file. - * We sync after each discarded byte so that a suspending data source - * can discard the byte from its buffer. - */ - while (c != 0xFF) { - cinfo->marker->discarded_bytes++; - INPUT_SYNC(cinfo); - INPUT_BYTE(cinfo, c, return FALSE); - } - /* This loop swallows any duplicate FF bytes. Extra FFs are legal as - * pad bytes, so don't count them in discarded_bytes. We assume there - * will not be so many consecutive FF bytes as to overflow a suspending - * data source's input buffer. - */ - do { - INPUT_BYTE(cinfo, c, return FALSE); - } while (c == 0xFF); - if (c != 0) - break; /* found a valid marker, exit loop */ - /* Reach here if we found a stuffed-zero data sequence (FF/00). - * Discard it and loop back to try again. - */ - cinfo->marker->discarded_bytes += 2; - INPUT_SYNC(cinfo); - } - - if (cinfo->marker->discarded_bytes != 0) { - WARNMS2(cinfo, JWRN_EXTRANEOUS_DATA, cinfo->marker->discarded_bytes, c); - cinfo->marker->discarded_bytes = 0; - } - - cinfo->unread_marker = c; - - INPUT_SYNC(cinfo); - return TRUE; -} - - -LOCAL(wxjpeg_boolean) -first_marker (j_decompress_ptr cinfo) -/* Like next_marker, but used to obtain the initial SOI marker. */ -/* For this marker, we do not allow preceding garbage or fill; otherwise, - * we might well scan an entire input file before realizing it ain't JPEG. - * If an application wants to process non-JFIF files, it must seek to the - * SOI before calling the JPEG library. - */ -{ - int c, c2; - INPUT_VARS(cinfo); - - INPUT_BYTE(cinfo, c, return FALSE); - INPUT_BYTE(cinfo, c2, return FALSE); - if (c != 0xFF || c2 != (int) M_SOI) - ERREXIT2(cinfo, JERR_NO_SOI, c, c2); - - cinfo->unread_marker = c2; - - INPUT_SYNC(cinfo); - return TRUE; -} - - -/* - * Read markers until SOS or EOI. - * - * Returns same codes as are defined for jpeg_consume_input: - * JPEG_SUSPENDED, JPEG_REACHED_SOS, or JPEG_REACHED_EOI. - */ - -METHODDEF(int) -read_markers (j_decompress_ptr cinfo) -{ - /* Outer loop repeats once for each marker. */ - for (;;) { - /* Collect the marker proper, unless we already did. */ - /* NB: first_marker() enforces the requirement that SOI appear first. */ - if (cinfo->unread_marker == 0) { - if (! cinfo->marker->saw_SOI) { - if (! first_marker(cinfo)) - return JPEG_SUSPENDED; - } else { - if (! next_marker(cinfo)) - return JPEG_SUSPENDED; - } - } - /* At this point cinfo->unread_marker contains the marker code and the - * input point is just past the marker proper, but before any parameters. - * A suspension will cause us to return with this state still true. - */ - switch (cinfo->unread_marker) { - case M_SOI: - if (! get_soi(cinfo)) - return JPEG_SUSPENDED; - break; - - case M_SOF0: /* Baseline */ - case M_SOF1: /* Extended sequential, Huffman */ - if (! get_sof(cinfo, FALSE, FALSE)) - return JPEG_SUSPENDED; - break; - - case M_SOF2: /* Progressive, Huffman */ - if (! get_sof(cinfo, TRUE, FALSE)) - return JPEG_SUSPENDED; - break; - - case M_SOF9: /* Extended sequential, arithmetic */ - if (! get_sof(cinfo, FALSE, TRUE)) - return JPEG_SUSPENDED; - break; - - case M_SOF10: /* Progressive, arithmetic */ - if (! get_sof(cinfo, TRUE, TRUE)) - return JPEG_SUSPENDED; - break; - - /* Currently unsupported SOFn types */ - case M_SOF3: /* Lossless, Huffman */ - case M_SOF5: /* Differential sequential, Huffman */ - case M_SOF6: /* Differential progressive, Huffman */ - case M_SOF7: /* Differential lossless, Huffman */ - case M_JPG: /* Reserved for JPEG extensions */ - case M_SOF11: /* Lossless, arithmetic */ - case M_SOF13: /* Differential sequential, arithmetic */ - case M_SOF14: /* Differential progressive, arithmetic */ - case M_SOF15: /* Differential lossless, arithmetic */ - ERREXIT1(cinfo, JERR_SOF_UNSUPPORTED, cinfo->unread_marker); - break; - - case M_SOS: - if (! get_sos(cinfo)) - return JPEG_SUSPENDED; - cinfo->unread_marker = 0; /* processed the marker */ - return JPEG_REACHED_SOS; - - case M_EOI: - TRACEMS(cinfo, 1, JTRC_EOI); - cinfo->unread_marker = 0; /* processed the marker */ - return JPEG_REACHED_EOI; - - case M_DAC: - if (! get_dac(cinfo)) - return JPEG_SUSPENDED; - break; - - case M_DHT: - if (! get_dht(cinfo)) - return JPEG_SUSPENDED; - break; - - case M_DQT: - if (! get_dqt(cinfo)) - return JPEG_SUSPENDED; - break; - - case M_DRI: - if (! get_dri(cinfo)) - return JPEG_SUSPENDED; - break; - - case M_APP0: - case M_APP1: - case M_APP2: - case M_APP3: - case M_APP4: - case M_APP5: - case M_APP6: - case M_APP7: - case M_APP8: - case M_APP9: - case M_APP10: - case M_APP11: - case M_APP12: - case M_APP13: - case M_APP14: - case M_APP15: - if (! (*((my_marker_ptr) cinfo->marker)->process_APPn[ - cinfo->unread_marker - (int) M_APP0]) (cinfo)) - return JPEG_SUSPENDED; - break; - - case M_COM: - if (! (*((my_marker_ptr) cinfo->marker)->process_COM) (cinfo)) - return JPEG_SUSPENDED; - break; - - case M_RST0: /* these are all parameterless */ - case M_RST1: - case M_RST2: - case M_RST3: - case M_RST4: - case M_RST5: - case M_RST6: - case M_RST7: - case M_TEM: - TRACEMS1(cinfo, 1, JTRC_PARMLESS_MARKER, cinfo->unread_marker); - break; - - case M_DNL: /* Ignore DNL ... perhaps the wrong thing */ - if (! skip_variable(cinfo)) - return JPEG_SUSPENDED; - break; - - default: /* must be DHP, EXP, JPGn, or RESn */ - /* For now, we treat the reserved markers as fatal errors since they are - * likely to be used to signal incompatible JPEG Part 3 extensions. - * Once the JPEG 3 version-number marker is well defined, this code - * ought to change! - */ - ERREXIT1(cinfo, JERR_UNKNOWN_MARKER, cinfo->unread_marker); - break; - } - /* Successfully processed marker, so reset state variable */ - cinfo->unread_marker = 0; - } /* end loop */ -} - - -/* - * Read a restart marker, which is expected to appear next in the datastream; - * if the marker is not there, take appropriate recovery action. - * Returns FALSE if suspension is required. - * - * This is called by the entropy decoder after it has read an appropriate - * number of MCUs. cinfo->unread_marker may be nonzero if the entropy decoder - * has already read a marker from the data source. Under normal conditions - * cinfo->unread_marker will be reset to 0 before returning; if not reset, - * it holds a marker which the decoder will be unable to read past. - */ - -METHODDEF(wxjpeg_boolean) -read_restart_marker (j_decompress_ptr cinfo) -{ - /* Obtain a marker unless we already did. */ - /* Note that next_marker will complain if it skips any data. */ - if (cinfo->unread_marker == 0) { - if (! next_marker(cinfo)) - return FALSE; - } - - if (cinfo->unread_marker == - ((int) M_RST0 + cinfo->marker->next_restart_num)) { - /* Normal case --- swallow the marker and let entropy decoder continue */ - TRACEMS1(cinfo, 3, JTRC_RST, cinfo->marker->next_restart_num); - cinfo->unread_marker = 0; - } else { - /* Uh-oh, the restart markers have been messed up. */ - /* Let the data source manager determine how to resync. */ - if (! (*cinfo->src->resync_to_restart) (cinfo, - cinfo->marker->next_restart_num)) - return FALSE; - } - - /* Update next-restart state */ - cinfo->marker->next_restart_num = (cinfo->marker->next_restart_num + 1) & 7; - - return TRUE; -} - - -/* - * This is the default resync_to_restart method for data source managers - * to use if they don't have any better approach. Some data source managers - * may be able to back up, or may have additional knowledge about the data - * which permits a more intelligent recovery strategy; such managers would - * presumably supply their own resync method. - * - * read_restart_marker calls resync_to_restart if it finds a marker other than - * the restart marker it was expecting. (This code is *not* used unless - * a nonzero restart interval has been declared.) cinfo->unread_marker is - * the marker code actually found (might be anything, except 0 or FF). - * The desired restart marker number (0..7) is passed as a parameter. - * This routine is supposed to apply whatever error recovery strategy seems - * appropriate in order to position the input stream to the next data segment. - * Note that cinfo->unread_marker is treated as a marker appearing before - * the current data-source input point; usually it should be reset to zero - * before returning. - * Returns FALSE if suspension is required. - * - * This implementation is substantially constrained by wanting to treat the - * input as a data stream; this means we can't back up. Therefore, we have - * only the following actions to work with: - * 1. Simply discard the marker and let the entropy decoder resume at next - * byte of file. - * 2. Read forward until we find another marker, discarding intervening - * data. (In theory we could look ahead within the current bufferload, - * without having to discard data if we don't find the desired marker. - * This idea is not implemented here, in part because it makes behavior - * dependent on buffer size and chance buffer-boundary positions.) - * 3. Leave the marker unread (by failing to zero cinfo->unread_marker). - * This will cause the entropy decoder to process an empty data segment, - * inserting dummy zeroes, and then we will reprocess the marker. - * - * #2 is appropriate if we think the desired marker lies ahead, while #3 is - * appropriate if the found marker is a future restart marker (indicating - * that we have missed the desired restart marker, probably because it got - * corrupted). - * We apply #2 or #3 if the found marker is a restart marker no more than - * two counts behind or ahead of the expected one. We also apply #2 if the - * found marker is not a legal JPEG marker code (it's certainly bogus data). - * If the found marker is a restart marker more than 2 counts away, we do #1 - * (too much risk that the marker is erroneous; with luck we will be able to - * resync at some future point). - * For any valid non-restart JPEG marker, we apply #3. This keeps us from - * overrunning the end of a scan. An implementation limited to single-scan - * files might find it better to apply #2 for markers other than EOI, since - * any other marker would have to be bogus data in that case. - */ - -GLOBAL(wxjpeg_boolean) -jpeg_resync_to_restart (j_decompress_ptr cinfo, int desired) -{ - int marker = cinfo->unread_marker; - int action = 1; - - /* Always put up a warning. */ - WARNMS2(cinfo, JWRN_MUST_RESYNC, marker, desired); - - /* Outer loop handles repeated decision after scanning forward. */ - for (;;) { - if (marker < (int) M_SOF0) - action = 2; /* invalid marker */ - else if (marker < (int) M_RST0 || marker > (int) M_RST7) - action = 3; /* valid non-restart marker */ - else { - if (marker == ((int) M_RST0 + ((desired+1) & 7)) || - marker == ((int) M_RST0 + ((desired+2) & 7))) - action = 3; /* one of the next two expected restarts */ - else if (marker == ((int) M_RST0 + ((desired-1) & 7)) || - marker == ((int) M_RST0 + ((desired-2) & 7))) - action = 2; /* a prior restart, so advance */ - else - action = 1; /* desired restart or too far away */ - } - TRACEMS2(cinfo, 4, JTRC_RECOVERY_ACTION, marker, action); - switch (action) { - case 1: - /* Discard marker and let entropy decoder resume processing. */ - cinfo->unread_marker = 0; - return TRUE; - case 2: - /* Scan to the next marker, and repeat the decision loop. */ - if (! next_marker(cinfo)) - return FALSE; - marker = cinfo->unread_marker; - break; - case 3: - /* Return without advancing past this marker. */ - /* Entropy decoder will be forced to process an empty segment. */ - return TRUE; - } - } /* end loop */ -} - - -/* - * Reset marker processing state to begin a fresh datastream. - */ - -METHODDEF(void) -reset_marker_reader (j_decompress_ptr cinfo) -{ - my_marker_ptr marker = (my_marker_ptr) cinfo->marker; - - cinfo->comp_info = NULL; /* until allocated by get_sof */ - cinfo->input_scan_number = 0; /* no SOS seen yet */ - cinfo->unread_marker = 0; /* no pending marker */ - marker->pub.saw_SOI = FALSE; /* set internal state too */ - marker->pub.saw_SOF = FALSE; - marker->pub.discarded_bytes = 0; - marker->cur_marker = NULL; -} - - -/* - * Initialize the marker reader module. - * This is called only once, when the decompression object is created. - */ - -GLOBAL(void) -jinit_marker_reader (j_decompress_ptr cinfo) -{ - my_marker_ptr marker; - int i; - - /* Create subobject in permanent pool */ - marker = (my_marker_ptr) - (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT, - SIZEOF(my_marker_reader)); - cinfo->marker = (struct jpeg_marker_reader *) marker; - /* Initialize public method pointers */ - marker->pub.reset_marker_reader = reset_marker_reader; - marker->pub.read_markers = read_markers; - marker->pub.read_restart_marker = read_restart_marker; - /* Initialize COM/APPn processing. - * By default, we examine and then discard APP0 and APP14, - * but simply discard COM and all other APPn. - */ - marker->process_COM = skip_variable; - marker->length_limit_COM = 0; - for (i = 0; i < 16; i++) { - marker->process_APPn[i] = skip_variable; - marker->length_limit_APPn[i] = 0; - } - marker->process_APPn[0] = get_interesting_appn; - marker->process_APPn[14] = get_interesting_appn; - /* Reset marker processing state */ - reset_marker_reader(cinfo); -} - - -/* - * Control saving of COM and APPn markers into marker_list. - */ - -#ifdef SAVE_MARKERS_SUPPORTED - -GLOBAL(void) -jpeg_save_markers (j_decompress_ptr cinfo, int marker_code, - unsigned int length_limit) -{ - my_marker_ptr marker = (my_marker_ptr) cinfo->marker; - long maxlength; - jpeg_marker_parser_method processor; - - /* Length limit mustn't be larger than what we can allocate - * (should only be a concern in a 16-bit environment). - */ - maxlength = cinfo->mem->max_alloc_chunk - SIZEOF(struct jpeg_marker_struct); - if (((long) length_limit) > maxlength) - length_limit = (unsigned int) maxlength; - - /* Choose processor routine to use. - * APP0/APP14 have special requirements. - */ - if (length_limit) { - processor = save_marker; - /* If saving APP0/APP14, save at least enough for our internal use. */ - if (marker_code == (int) M_APP0 && length_limit < APP0_DATA_LEN) - length_limit = APP0_DATA_LEN; - else if (marker_code == (int) M_APP14 && length_limit < APP14_DATA_LEN) - length_limit = APP14_DATA_LEN; - } else { - processor = skip_variable; - /* If discarding APP0/APP14, use our regular on-the-fly processor. */ - if (marker_code == (int) M_APP0 || marker_code == (int) M_APP14) - processor = get_interesting_appn; - } - - if (marker_code == (int) M_COM) { - marker->process_COM = processor; - marker->length_limit_COM = length_limit; - } else if (marker_code >= (int) M_APP0 && marker_code <= (int) M_APP15) { - marker->process_APPn[marker_code - (int) M_APP0] = processor; - marker->length_limit_APPn[marker_code - (int) M_APP0] = length_limit; - } else - ERREXIT1(cinfo, JERR_UNKNOWN_MARKER, marker_code); -} - -#endif /* SAVE_MARKERS_SUPPORTED */ - - -/* - * Install a special processing method for COM or APPn markers. - */ - -GLOBAL(void) -jpeg_set_marker_processor (j_decompress_ptr cinfo, int marker_code, - jpeg_marker_parser_method routine) -{ - my_marker_ptr marker = (my_marker_ptr) cinfo->marker; - - if (marker_code == (int) M_COM) - marker->process_COM = routine; - else if (marker_code >= (int) M_APP0 && marker_code <= (int) M_APP15) - marker->process_APPn[marker_code - (int) M_APP0] = routine; - else - ERREXIT1(cinfo, JERR_UNKNOWN_MARKER, marker_code); -} diff --git a/wxWidgets/src/jpeg/jdmaster.c b/wxWidgets/src/jpeg/jdmaster.c deleted file mode 100644 index d68747631a..0000000000 --- a/wxWidgets/src/jpeg/jdmaster.c +++ /dev/null @@ -1,557 +0,0 @@ -/* - * jdmaster.c - * - * Copyright (C) 1991-1997, Thomas G. Lane. - * This file is part of the Independent JPEG Group's software. - * For conditions of distribution and use, see the accompanying README file. - * - * This file contains master control logic for the JPEG decompressor. - * These routines are concerned with selecting the modules to be executed - * and with determining the number of passes and the work to be done in each - * pass. - */ - -#define JPEG_INTERNALS -#include "jinclude.h" -#include "jpeglib.h" - -/* Private state */ - -typedef struct { - struct jpeg_decomp_master pub; /* public fields */ - - int pass_number; /* # of passes completed */ - - wxjpeg_boolean using_merged_upsample; /* TRUE if using merged upsample/cconvert */ - - /* Saved references to initialized quantizer modules, - * in case we need to switch modes. - */ - struct jpeg_color_quantizer * quantizer_1pass; - struct jpeg_color_quantizer * quantizer_2pass; -} my_decomp_master; - -typedef my_decomp_master * my_master_ptr; - - -/* - * Determine whether merged upsample/color conversion should be used. - * CRUCIAL: this must match the actual capabilities of jdmerge.c! - */ - -LOCAL(wxjpeg_boolean) -use_merged_upsample (j_decompress_ptr cinfo) -{ -#ifdef UPSAMPLE_MERGING_SUPPORTED - /* Merging is the equivalent of plain box-filter upsampling */ - if (cinfo->do_fancy_upsampling || cinfo->CCIR601_sampling) - return FALSE; - /* jdmerge.c only supports YCC=>RGB color conversion */ - if (cinfo->jpeg_color_space != JCS_YCbCr || cinfo->num_components != 3 || - cinfo->out_color_space != JCS_RGB || - cinfo->out_color_components != RGB_PIXELSIZE) - return FALSE; - /* and it only handles 2h1v or 2h2v sampling ratios */ - if (cinfo->comp_info[0].h_samp_factor != 2 || - cinfo->comp_info[1].h_samp_factor != 1 || - cinfo->comp_info[2].h_samp_factor != 1 || - cinfo->comp_info[0].v_samp_factor > 2 || - cinfo->comp_info[1].v_samp_factor != 1 || - cinfo->comp_info[2].v_samp_factor != 1) - return FALSE; - /* furthermore, it doesn't work if we've scaled the IDCTs differently */ - if (cinfo->comp_info[0].DCT_scaled_size != cinfo->min_DCT_scaled_size || - cinfo->comp_info[1].DCT_scaled_size != cinfo->min_DCT_scaled_size || - cinfo->comp_info[2].DCT_scaled_size != cinfo->min_DCT_scaled_size) - return FALSE; - /* ??? also need to test for upsample-time rescaling, when & if supported */ - return TRUE; /* by golly, it'll work... */ -#else - return FALSE; -#endif -} - - -/* - * Compute output image dimensions and related values. - * NOTE: this is exported for possible use by application. - * Hence it mustn't do anything that can't be done twice. - * Also note that it may be called before the master module is initialized! - */ - -GLOBAL(void) -jpeg_calc_output_dimensions (j_decompress_ptr cinfo) -/* Do computations that are needed before master selection phase */ -{ -#ifdef IDCT_SCALING_SUPPORTED - int ci; - jpeg_component_info *compptr; -#endif - - /* Prevent application from calling me at wrong times */ - if (cinfo->global_state != DSTATE_READY) - ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state); - -#ifdef IDCT_SCALING_SUPPORTED - - /* Compute actual output image dimensions and DCT scaling choices. */ - if (cinfo->scale_num * 8 <= cinfo->scale_denom) { - /* Provide 1/8 scaling */ - cinfo->output_width = (JDIMENSION) - jdiv_round_up((long) cinfo->image_width, 8L); - cinfo->output_height = (JDIMENSION) - jdiv_round_up((long) cinfo->image_height, 8L); - cinfo->min_DCT_scaled_size = 1; - } else if (cinfo->scale_num * 4 <= cinfo->scale_denom) { - /* Provide 1/4 scaling */ - cinfo->output_width = (JDIMENSION) - jdiv_round_up((long) cinfo->image_width, 4L); - cinfo->output_height = (JDIMENSION) - jdiv_round_up((long) cinfo->image_height, 4L); - cinfo->min_DCT_scaled_size = 2; - } else if (cinfo->scale_num * 2 <= cinfo->scale_denom) { - /* Provide 1/2 scaling */ - cinfo->output_width = (JDIMENSION) - jdiv_round_up((long) cinfo->image_width, 2L); - cinfo->output_height = (JDIMENSION) - jdiv_round_up((long) cinfo->image_height, 2L); - cinfo->min_DCT_scaled_size = 4; - } else { - /* Provide 1/1 scaling */ - cinfo->output_width = cinfo->image_width; - cinfo->output_height = cinfo->image_height; - cinfo->min_DCT_scaled_size = DCTSIZE; - } - /* In selecting the actual DCT scaling for each component, we try to - * scale up the chroma components via IDCT scaling rather than upsampling. - * This saves time if the upsampler gets to use 1:1 scaling. - * Note this code assumes that the supported DCT scalings are powers of 2. - */ - for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; - ci++, compptr++) { - int ssize = cinfo->min_DCT_scaled_size; - while (ssize < DCTSIZE && - (compptr->h_samp_factor * ssize * 2 <= - cinfo->max_h_samp_factor * cinfo->min_DCT_scaled_size) && - (compptr->v_samp_factor * ssize * 2 <= - cinfo->max_v_samp_factor * cinfo->min_DCT_scaled_size)) { - ssize = ssize * 2; - } - compptr->DCT_scaled_size = ssize; - } - - /* Recompute downsampled dimensions of components; - * application needs to know these if using raw downsampled data. - */ - for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; - ci++, compptr++) { - /* Size in samples, after IDCT scaling */ - compptr->downsampled_width = (JDIMENSION) - jdiv_round_up((long) cinfo->image_width * - (long) (compptr->h_samp_factor * compptr->DCT_scaled_size), - (long) (cinfo->max_h_samp_factor * DCTSIZE)); - compptr->downsampled_height = (JDIMENSION) - jdiv_round_up((long) cinfo->image_height * - (long) (compptr->v_samp_factor * compptr->DCT_scaled_size), - (long) (cinfo->max_v_samp_factor * DCTSIZE)); - } - -#else /* !IDCT_SCALING_SUPPORTED */ - - /* Hardwire it to "no scaling" */ - cinfo->output_width = cinfo->image_width; - cinfo->output_height = cinfo->image_height; - /* jdinput.c has already initialized DCT_scaled_size to DCTSIZE, - * and has computed unscaled downsampled_width and downsampled_height. - */ - -#endif /* IDCT_SCALING_SUPPORTED */ - - /* Report number of components in selected colorspace. */ - /* Probably this should be in the color conversion module... */ - switch (cinfo->out_color_space) { - case JCS_GRAYSCALE: - cinfo->out_color_components = 1; - break; - case JCS_RGB: -#if RGB_PIXELSIZE != 3 - cinfo->out_color_components = RGB_PIXELSIZE; - break; -#endif /* else share code with YCbCr */ - case JCS_YCbCr: - cinfo->out_color_components = 3; - break; - case JCS_CMYK: - case JCS_YCCK: - cinfo->out_color_components = 4; - break; - default: /* else must be same colorspace as in file */ - cinfo->out_color_components = cinfo->num_components; - break; - } - cinfo->output_components = (cinfo->quantize_colors ? 1 : - cinfo->out_color_components); - - /* See if upsampler will want to emit more than one row at a time */ - if (use_merged_upsample(cinfo)) - cinfo->rec_outbuf_height = cinfo->max_v_samp_factor; - else - cinfo->rec_outbuf_height = 1; -} - - -/* - * Several decompression processes need to range-limit values to the range - * 0..MAXJSAMPLE; the input value may fall somewhat outside this range - * due to noise introduced by quantization, roundoff error, etc. These - * processes are inner loops and need to be as fast as possible. On most - * machines, particularly CPUs with pipelines or instruction prefetch, - * a (subscript-check-less) C table lookup - * x = sample_range_limit[x]; - * is faster than explicit tests - * if (x < 0) x = 0; - * else if (x > MAXJSAMPLE) x = MAXJSAMPLE; - * These processes all use a common table prepared by the routine below. - * - * For most steps we can mathematically guarantee that the initial value - * of x is within MAXJSAMPLE+1 of the legal range, so a table running from - * -(MAXJSAMPLE+1) to 2*MAXJSAMPLE+1 is sufficient. But for the initial - * limiting step (just after the IDCT), a wildly out-of-range value is - * possible if the input data is corrupt. To avoid any chance of indexing - * off the end of memory and getting a bad-pointer trap, we perform the - * post-IDCT limiting thus: - * x = range_limit[x & MASK]; - * where MASK is 2 bits wider than legal sample data, ie 10 bits for 8-bit - * samples. Under normal circumstances this is more than enough range and - * a correct output will be generated; with bogus input data the mask will - * cause wraparound, and we will safely generate a bogus-but-in-range output. - * For the post-IDCT step, we want to convert the data from signed to unsigned - * representation by adding CENTERJSAMPLE at the same time that we limit it. - * So the post-IDCT limiting table ends up looking like this: - * CENTERJSAMPLE,CENTERJSAMPLE+1,...,MAXJSAMPLE, - * MAXJSAMPLE (repeat 2*(MAXJSAMPLE+1)-CENTERJSAMPLE times), - * 0 (repeat 2*(MAXJSAMPLE+1)-CENTERJSAMPLE times), - * 0,1,...,CENTERJSAMPLE-1 - * Negative inputs select values from the upper half of the table after - * masking. - * - * We can save some space by overlapping the start of the post-IDCT table - * with the simpler range limiting table. The post-IDCT table begins at - * sample_range_limit + CENTERJSAMPLE. - * - * Note that the table is allocated in near data space on PCs; it's small - * enough and used often enough to justify this. - */ - -LOCAL(void) -prepare_range_limit_table (j_decompress_ptr cinfo) -/* Allocate and fill in the sample_range_limit table */ -{ - JSAMPLE * table; - int i; - - table = (JSAMPLE *) - (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, - (5 * (MAXJSAMPLE+1) + CENTERJSAMPLE) * SIZEOF(JSAMPLE)); - table += (MAXJSAMPLE+1); /* allow negative subscripts of simple table */ - cinfo->sample_range_limit = table; - /* First segment of "simple" table: limit[x] = 0 for x < 0 */ - MEMZERO(table - (MAXJSAMPLE+1), (MAXJSAMPLE+1) * SIZEOF(JSAMPLE)); - /* Main part of "simple" table: limit[x] = x */ - for (i = 0; i <= MAXJSAMPLE; i++) - table[i] = (JSAMPLE) i; - table += CENTERJSAMPLE; /* Point to where post-IDCT table starts */ - /* End of simple table, rest of first half of post-IDCT table */ - for (i = CENTERJSAMPLE; i < 2*(MAXJSAMPLE+1); i++) - table[i] = MAXJSAMPLE; - /* Second half of post-IDCT table */ - MEMZERO(table + (2 * (MAXJSAMPLE+1)), - (2 * (MAXJSAMPLE+1) - CENTERJSAMPLE) * SIZEOF(JSAMPLE)); - MEMCOPY(table + (4 * (MAXJSAMPLE+1) - CENTERJSAMPLE), - cinfo->sample_range_limit, CENTERJSAMPLE * SIZEOF(JSAMPLE)); -} - - -/* - * Master selection of decompression modules. - * This is done once at jpeg_start_decompress time. We determine - * which modules will be used and give them appropriate initialization calls. - * We also initialize the decompressor input side to begin consuming data. - * - * Since jpeg_read_header has finished, we know what is in the SOF - * and (first) SOS markers. We also have all the application parameter - * settings. - */ - -LOCAL(void) -master_selection (j_decompress_ptr cinfo) -{ - my_master_ptr master = (my_master_ptr) cinfo->master; - wxjpeg_boolean use_c_buffer; - long samplesperrow; - JDIMENSION jd_samplesperrow; - - /* Initialize dimensions and other stuff */ - jpeg_calc_output_dimensions(cinfo); - prepare_range_limit_table(cinfo); - - /* Width of an output scanline must be representable as JDIMENSION. */ - samplesperrow = (long) cinfo->output_width * (long) cinfo->out_color_components; - jd_samplesperrow = (JDIMENSION) samplesperrow; - if ((long) jd_samplesperrow != samplesperrow) - ERREXIT(cinfo, JERR_WIDTH_OVERFLOW); - - /* Initialize my private state */ - master->pass_number = 0; - master->using_merged_upsample = use_merged_upsample(cinfo); - - /* Color quantizer selection */ - master->quantizer_1pass = NULL; - master->quantizer_2pass = NULL; - /* No mode changes if not using buffered-image mode. */ - if (! cinfo->quantize_colors || ! cinfo->buffered_image) { - cinfo->enable_1pass_quant = FALSE; - cinfo->enable_external_quant = FALSE; - cinfo->enable_2pass_quant = FALSE; - } - if (cinfo->quantize_colors) { - if (cinfo->raw_data_out) - ERREXIT(cinfo, JERR_NOTIMPL); - /* 2-pass quantizer only works in 3-component color space. */ - if (cinfo->out_color_components != 3) { - cinfo->enable_1pass_quant = TRUE; - cinfo->enable_external_quant = FALSE; - cinfo->enable_2pass_quant = FALSE; - cinfo->colormap = NULL; - } else if (cinfo->colormap != NULL) { - cinfo->enable_external_quant = TRUE; - } else if (cinfo->two_pass_quantize) { - cinfo->enable_2pass_quant = TRUE; - } else { - cinfo->enable_1pass_quant = TRUE; - } - - if (cinfo->enable_1pass_quant) { -#ifdef QUANT_1PASS_SUPPORTED - jinit_1pass_quantizer(cinfo); - master->quantizer_1pass = cinfo->cquantize; -#else - ERREXIT(cinfo, JERR_NOT_COMPILED); -#endif - } - - /* We use the 2-pass code to map to external colormaps. */ - if (cinfo->enable_2pass_quant || cinfo->enable_external_quant) { -#ifdef QUANT_2PASS_SUPPORTED - jinit_2pass_quantizer(cinfo); - master->quantizer_2pass = cinfo->cquantize; -#else - ERREXIT(cinfo, JERR_NOT_COMPILED); -#endif - } - /* If both quantizers are initialized, the 2-pass one is left active; - * this is necessary for starting with quantization to an external map. - */ - } - - /* Post-processing: in particular, color conversion first */ - if (! cinfo->raw_data_out) { - if (master->using_merged_upsample) { -#ifdef UPSAMPLE_MERGING_SUPPORTED - jinit_merged_upsampler(cinfo); /* does color conversion too */ -#else - ERREXIT(cinfo, JERR_NOT_COMPILED); -#endif - } else { - jinit_color_deconverter(cinfo); - jinit_upsampler(cinfo); - } - jinit_d_post_controller(cinfo, cinfo->enable_2pass_quant); - } - /* Inverse DCT */ - jinit_inverse_dct(cinfo); - /* Entropy decoding: either Huffman or arithmetic coding. */ - if (cinfo->arith_code) { - ERREXIT(cinfo, JERR_ARITH_NOTIMPL); - } else { - if (cinfo->progressive_mode) { -#ifdef D_PROGRESSIVE_SUPPORTED - jinit_phuff_decoder(cinfo); -#else - ERREXIT(cinfo, JERR_NOT_COMPILED); -#endif - } else - jinit_huff_decoder(cinfo); - } - - /* Initialize principal buffer controllers. */ - use_c_buffer = cinfo->inputctl->has_multiple_scans || cinfo->buffered_image; - jinit_d_coef_controller(cinfo, use_c_buffer); - - if (! cinfo->raw_data_out) - jinit_d_main_controller(cinfo, FALSE /* never need full buffer here */); - - /* We can now tell the memory manager to allocate virtual arrays. */ - (*cinfo->mem->realize_virt_arrays) ((j_common_ptr) cinfo); - - /* Initialize input side of decompressor to consume first scan. */ - (*cinfo->inputctl->start_input_pass) (cinfo); - -#ifdef D_MULTISCAN_FILES_SUPPORTED - /* If jpeg_start_decompress will read the whole file, initialize - * progress monitoring appropriately. The input step is counted - * as one pass. - */ - if (cinfo->progress != NULL && ! cinfo->buffered_image && - cinfo->inputctl->has_multiple_scans) { - int nscans; - /* Estimate number of scans to set pass_limit. */ - if (cinfo->progressive_mode) { - /* Arbitrarily estimate 2 interleaved DC scans + 3 AC scans/component. */ - nscans = 2 + 3 * cinfo->num_components; - } else { - /* For a nonprogressive multiscan file, estimate 1 scan per component. */ - nscans = cinfo->num_components; - } - cinfo->progress->pass_counter = 0L; - cinfo->progress->pass_limit = (long) cinfo->total_iMCU_rows * nscans; - cinfo->progress->completed_passes = 0; - cinfo->progress->total_passes = (cinfo->enable_2pass_quant ? 3 : 2); - /* Count the input pass as done */ - master->pass_number++; - } -#endif /* D_MULTISCAN_FILES_SUPPORTED */ -} - - -/* - * Per-pass setup. - * This is called at the beginning of each output pass. We determine which - * modules will be active during this pass and give them appropriate - * start_pass calls. We also set is_dummy_pass to indicate whether this - * is a "real" output pass or a dummy pass for color quantization. - * (In the latter case, jdapistd.c will crank the pass to completion.) - */ - -METHODDEF(void) -prepare_for_output_pass (j_decompress_ptr cinfo) -{ - my_master_ptr master = (my_master_ptr) cinfo->master; - - if (master->pub.is_dummy_pass) { -#ifdef QUANT_2PASS_SUPPORTED - /* Final pass of 2-pass quantization */ - master->pub.is_dummy_pass = FALSE; - (*cinfo->cquantize->start_pass) (cinfo, FALSE); - (*cinfo->post->start_pass) (cinfo, JBUF_CRANK_DEST); - (*cinfo->main->start_pass) (cinfo, JBUF_CRANK_DEST); -#else - ERREXIT(cinfo, JERR_NOT_COMPILED); -#endif /* QUANT_2PASS_SUPPORTED */ - } else { - if (cinfo->quantize_colors && cinfo->colormap == NULL) { - /* Select new quantization method */ - if (cinfo->two_pass_quantize && cinfo->enable_2pass_quant) { - cinfo->cquantize = master->quantizer_2pass; - master->pub.is_dummy_pass = TRUE; - } else if (cinfo->enable_1pass_quant) { - cinfo->cquantize = master->quantizer_1pass; - } else { - ERREXIT(cinfo, JERR_MODE_CHANGE); - } - } - (*cinfo->idct->start_pass) (cinfo); - (*cinfo->coef->start_output_pass) (cinfo); - if (! cinfo->raw_data_out) { - if (! master->using_merged_upsample) - (*cinfo->cconvert->start_pass) (cinfo); - (*cinfo->upsample->start_pass) (cinfo); - if (cinfo->quantize_colors) - (*cinfo->cquantize->start_pass) (cinfo, master->pub.is_dummy_pass); - (*cinfo->post->start_pass) (cinfo, - (master->pub.is_dummy_pass ? JBUF_SAVE_AND_PASS : JBUF_PASS_THRU)); - (*cinfo->main->start_pass) (cinfo, JBUF_PASS_THRU); - } - } - - /* Set up progress monitor's pass info if present */ - if (cinfo->progress != NULL) { - cinfo->progress->completed_passes = master->pass_number; - cinfo->progress->total_passes = master->pass_number + - (master->pub.is_dummy_pass ? 2 : 1); - /* In buffered-image mode, we assume one more output pass if EOI not - * yet reached, but no more passes if EOI has been reached. - */ - if (cinfo->buffered_image && ! cinfo->inputctl->eoi_reached) { - cinfo->progress->total_passes += (cinfo->enable_2pass_quant ? 2 : 1); - } - } -} - - -/* - * Finish up at end of an output pass. - */ - -METHODDEF(void) -finish_output_pass (j_decompress_ptr cinfo) -{ - my_master_ptr master = (my_master_ptr) cinfo->master; - - if (cinfo->quantize_colors) - (*cinfo->cquantize->finish_pass) (cinfo); - master->pass_number++; -} - - -#ifdef D_MULTISCAN_FILES_SUPPORTED - -/* - * Switch to a new external colormap between output passes. - */ - -GLOBAL(void) -jpeg_new_colormap (j_decompress_ptr cinfo) -{ - my_master_ptr master = (my_master_ptr) cinfo->master; - - /* Prevent application from calling me at wrong times */ - if (cinfo->global_state != DSTATE_BUFIMAGE) - ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state); - - if (cinfo->quantize_colors && cinfo->enable_external_quant && - cinfo->colormap != NULL) { - /* Select 2-pass quantizer for external colormap use */ - cinfo->cquantize = master->quantizer_2pass; - /* Notify quantizer of colormap change */ - (*cinfo->cquantize->new_color_map) (cinfo); - master->pub.is_dummy_pass = FALSE; /* just in case */ - } else - ERREXIT(cinfo, JERR_MODE_CHANGE); -} - -#endif /* D_MULTISCAN_FILES_SUPPORTED */ - - -/* - * Initialize master decompression control and select active modules. - * This is performed at the start of jpeg_start_decompress. - */ - -GLOBAL(void) -jinit_master_decompress (j_decompress_ptr cinfo) -{ - my_master_ptr master; - - master = (my_master_ptr) - (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, - SIZEOF(my_decomp_master)); - cinfo->master = (struct jpeg_decomp_master *) master; - master->pub.prepare_for_output_pass = prepare_for_output_pass; - master->pub.finish_output_pass = finish_output_pass; - - master->pub.is_dummy_pass = FALSE; - - master_selection(cinfo); -} - diff --git a/wxWidgets/src/jpeg/jdmerge.c b/wxWidgets/src/jpeg/jdmerge.c deleted file mode 100644 index 55eab36217..0000000000 --- a/wxWidgets/src/jpeg/jdmerge.c +++ /dev/null @@ -1,399 +0,0 @@ -/* - * jdmerge.c - * - * Copyright (C) 1994-1996, Thomas G. Lane. - * This file is part of the Independent JPEG Group's software. - * For conditions of distribution and use, see the accompanying README file. - * - * This file contains code for merged upsampling/color conversion. - * - * This file combines functions from jdsample.c and jdcolor.c; - * read those files first to understand what's going on. - * - * When the chroma components are to be upsampled by simple replication - * (ie, box filtering), we can save some work in color conversion by - * calculating all the output pixels corresponding to a pair of chroma - * samples at one time. In the conversion equations - * R = Y + K1 * Cr - * G = Y + K2 * Cb + K3 * Cr - * B = Y + K4 * Cb - * only the Y term varies among the group of pixels corresponding to a pair - * of chroma samples, so the rest of the terms can be calculated just once. - * At typical sampling ratios, this eliminates half or three-quarters of the - * multiplications needed for color conversion. - * - * This file currently provides implementations for the following cases: - * YCbCr => RGB color conversion only. - * Sampling ratios of 2h1v or 2h2v. - * No scaling needed at upsample time. - * Corner-aligned (non-CCIR601) sampling alignment. - * Other special cases could be added, but in most applications these are - * the only common cases. (For uncommon cases we fall back on the more - * general code in jdsample.c and jdcolor.c.) - */ - -#define JPEG_INTERNALS -#include "jinclude.h" -#include "jpeglib.h" - -#ifdef UPSAMPLE_MERGING_SUPPORTED - - -/* Private subobject */ - -typedef struct { - struct jpeg_upsampler pub; /* public fields */ - - /* Pointer to routine to do actual upsampling/conversion of one row group */ - JMETHOD(void, upmethod, (j_decompress_ptr cinfo, - JSAMPIMAGE input_buf, JDIMENSION in_row_group_ctr, - JSAMPARRAY output_buf)); - - /* Private state for YCC->RGB conversion */ - int * Cr_r_tab; /* => table for Cr to R conversion */ - int * Cb_b_tab; /* => table for Cb to B conversion */ - JPEG_INT32 * Cr_g_tab; /* => table for Cr to G conversion */ - JPEG_INT32 * Cb_g_tab; /* => table for Cb to G conversion */ - - /* For 2:1 vertical sampling, we produce two output rows at a time. - * We need a "spare" row buffer to hold the second output row if the - * application provides just a one-row buffer; we also use the spare - * to discard the dummy last row if the image height is odd. - */ - JSAMPROW spare_row; - wxjpeg_boolean spare_full; /* T if spare buffer is occupied */ - - JDIMENSION out_row_width; /* samples per output row */ - JDIMENSION rows_to_go; /* counts rows remaining in image */ -} my_upsampler; - -typedef my_upsampler * my_upsample_ptr; - -#define SCALEBITS 16 /* speediest right-shift on some machines */ -#define ONE_HALF ((JPEG_INT32) 1 << (SCALEBITS-1)) -#define FIX(x) ((JPEG_INT32) ((x) * (1L<RGB colorspace conversion. - * This is taken directly from jdcolor.c; see that file for more info. - */ - -LOCAL(void) -build_ycc_rgb_table (j_decompress_ptr cinfo) -{ - my_upsample_ptr upsample = (my_upsample_ptr) cinfo->upsample; - int i; - JPEG_INT32 x; - SHIFT_TEMPS - - upsample->Cr_r_tab = (int *) - (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, - (MAXJSAMPLE+1) * SIZEOF(int)); - upsample->Cb_b_tab = (int *) - (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, - (MAXJSAMPLE+1) * SIZEOF(int)); - upsample->Cr_g_tab = (JPEG_INT32 *) - (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, - (MAXJSAMPLE+1) * SIZEOF(JPEG_INT32)); - upsample->Cb_g_tab = (JPEG_INT32 *) - (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, - (MAXJSAMPLE+1) * SIZEOF(JPEG_INT32)); - - for (i = 0, x = -CENTERJSAMPLE; i <= MAXJSAMPLE; i++, x++) { - /* i is the actual input pixel value, in the range 0..MAXJSAMPLE */ - /* The Cb or Cr value we are thinking of is x = i - CENTERJSAMPLE */ - /* Cr=>R value is nearest int to 1.40200 * x */ - upsample->Cr_r_tab[i] = (int) - RIGHT_SHIFT(FIX(1.40200) * x + ONE_HALF, SCALEBITS); - /* Cb=>B value is nearest int to 1.77200 * x */ - upsample->Cb_b_tab[i] = (int) - RIGHT_SHIFT(FIX(1.77200) * x + ONE_HALF, SCALEBITS); - /* Cr=>G value is scaled-up -0.71414 * x */ - upsample->Cr_g_tab[i] = (- FIX(0.71414)) * x; - /* Cb=>G value is scaled-up -0.34414 * x */ - /* We also add in ONE_HALF so that need not do it in inner loop */ - upsample->Cb_g_tab[i] = (- FIX(0.34414)) * x + ONE_HALF; - } -} - - -/* - * Initialize for an upsampling pass. - */ - -METHODDEF(void) -start_pass_merged_upsample (j_decompress_ptr cinfo) -{ - my_upsample_ptr upsample = (my_upsample_ptr) cinfo->upsample; - - /* Mark the spare buffer empty */ - upsample->spare_full = FALSE; - /* Initialize total-height counter for detecting bottom of image */ - upsample->rows_to_go = cinfo->output_height; -} - - -/* - * Control routine to do upsampling (and color conversion). - * - * The control routine just handles the row buffering considerations. - */ - -METHODDEF(void) -merged_2v_upsample (j_decompress_ptr cinfo, - JSAMPIMAGE input_buf, JDIMENSION *in_row_group_ctr, - JDIMENSION in_row_groups_avail, - JSAMPARRAY output_buf, JDIMENSION *out_row_ctr, - JDIMENSION out_rows_avail) -/* 2:1 vertical sampling case: may need a spare row. */ -{ - my_upsample_ptr upsample = (my_upsample_ptr) cinfo->upsample; - JSAMPROW work_ptrs[2]; - JDIMENSION num_rows; /* number of rows returned to caller */ - - if (upsample->spare_full) { - /* If we have a spare row saved from a previous cycle, just return it. */ - jcopy_sample_rows(& upsample->spare_row, 0, output_buf + *out_row_ctr, 0, - 1, upsample->out_row_width); - num_rows = 1; - upsample->spare_full = FALSE; - } else { - /* Figure number of rows to return to caller. */ - num_rows = 2; - /* Not more than the distance to the end of the image. */ - if (num_rows > upsample->rows_to_go) - num_rows = upsample->rows_to_go; - /* And not more than what the client can accept: */ - out_rows_avail -= *out_row_ctr; - if (num_rows > out_rows_avail) - num_rows = out_rows_avail; - /* Create output pointer array for upsampler. */ - work_ptrs[0] = output_buf[*out_row_ctr]; - if (num_rows > 1) { - work_ptrs[1] = output_buf[*out_row_ctr + 1]; - } else { - work_ptrs[1] = upsample->spare_row; - upsample->spare_full = TRUE; - } - /* Now do the upsampling. */ - (*upsample->upmethod) (cinfo, input_buf, *in_row_group_ctr, work_ptrs); - } - - /* Adjust counts */ - *out_row_ctr += num_rows; - upsample->rows_to_go -= num_rows; - /* When the buffer is emptied, declare this input row group consumed */ - if (! upsample->spare_full) - (*in_row_group_ctr)++; -} - - -METHODDEF(void) -merged_1v_upsample (j_decompress_ptr cinfo, - JSAMPIMAGE input_buf, JDIMENSION *in_row_group_ctr, - JDIMENSION in_row_groups_avail, - JSAMPARRAY output_buf, JDIMENSION *out_row_ctr, - JDIMENSION out_rows_avail) -/* 1:1 vertical sampling case: much easier, never need a spare row. */ -{ - my_upsample_ptr upsample = (my_upsample_ptr) cinfo->upsample; - - /* Just do the upsampling. */ - (*upsample->upmethod) (cinfo, input_buf, *in_row_group_ctr, - output_buf + *out_row_ctr); - /* Adjust counts */ - (*out_row_ctr)++; - (*in_row_group_ctr)++; -} - - -/* - * These are the routines invoked by the control routines to do - * the actual upsampling/conversion. One row group is processed per call. - * - * Note: since we may be writing directly into application-supplied buffers, - * we have to be honest about the output width; we can't assume the buffer - * has been rounded up to an even width. - */ - - -/* - * Upsample and color convert for the case of 2:1 horizontal and 1:1 vertical. - */ - -METHODDEF(void) -h2v1_merged_upsample (j_decompress_ptr cinfo, - JSAMPIMAGE input_buf, JDIMENSION in_row_group_ctr, - JSAMPARRAY output_buf) -{ - my_upsample_ptr upsample = (my_upsample_ptr) cinfo->upsample; - register int y, cred, cgreen, cblue; - int cb, cr; - register JSAMPROW outptr; - JSAMPROW inptr0, inptr1, inptr2; - JDIMENSION col; - /* copy these pointers into registers if possible */ - register JSAMPLE * range_limit = cinfo->sample_range_limit; - int * Crrtab = upsample->Cr_r_tab; - int * Cbbtab = upsample->Cb_b_tab; - JPEG_INT32 * Crgtab = upsample->Cr_g_tab; - JPEG_INT32 * Cbgtab = upsample->Cb_g_tab; - SHIFT_TEMPS - - inptr0 = input_buf[0][in_row_group_ctr]; - inptr1 = input_buf[1][in_row_group_ctr]; - inptr2 = input_buf[2][in_row_group_ctr]; - outptr = output_buf[0]; - /* Loop for each pair of output pixels */ - for (col = cinfo->output_width >> 1; col > 0; col--) { - /* Do the chroma part of the calculation */ - cb = GETJSAMPLE(*inptr1++); - cr = GETJSAMPLE(*inptr2++); - cred = Crrtab[cr]; - cgreen = (int) RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr], SCALEBITS); - cblue = Cbbtab[cb]; - /* Fetch 2 Y values and emit 2 pixels */ - y = GETJSAMPLE(*inptr0++); - outptr[RGB_RED] = range_limit[y + cred]; - outptr[RGB_GREEN] = range_limit[y + cgreen]; - outptr[RGB_BLUE] = range_limit[y + cblue]; - outptr += RGB_PIXELSIZE; - y = GETJSAMPLE(*inptr0++); - outptr[RGB_RED] = range_limit[y + cred]; - outptr[RGB_GREEN] = range_limit[y + cgreen]; - outptr[RGB_BLUE] = range_limit[y + cblue]; - outptr += RGB_PIXELSIZE; - } - /* If image width is odd, do the last output column separately */ - if (cinfo->output_width & 1) { - cb = GETJSAMPLE(*inptr1); - cr = GETJSAMPLE(*inptr2); - cred = Crrtab[cr]; - cgreen = (int) RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr], SCALEBITS); - cblue = Cbbtab[cb]; - y = GETJSAMPLE(*inptr0); - outptr[RGB_RED] = range_limit[y + cred]; - outptr[RGB_GREEN] = range_limit[y + cgreen]; - outptr[RGB_BLUE] = range_limit[y + cblue]; - } -} - -/* - * Upsample and color convert for the case of 2:1 horizontal and 2:1 vertical. - */ - -METHODDEF(void) -h2v2_merged_upsample (j_decompress_ptr cinfo, - JSAMPIMAGE input_buf, JDIMENSION in_row_group_ctr, - JSAMPARRAY output_buf) -{ - my_upsample_ptr upsample = (my_upsample_ptr) cinfo->upsample; - register int y, cred, cgreen, cblue; - int cb, cr; - register JSAMPROW outptr0, outptr1; - JSAMPROW inptr00, inptr01, inptr1, inptr2; - JDIMENSION col; - /* copy these pointers into registers if possible */ - register JSAMPLE * range_limit = cinfo->sample_range_limit; - int * Crrtab = upsample->Cr_r_tab; - int * Cbbtab = upsample->Cb_b_tab; - JPEG_INT32 * Crgtab = upsample->Cr_g_tab; - JPEG_INT32 * Cbgtab = upsample->Cb_g_tab; - SHIFT_TEMPS - - inptr00 = input_buf[0][in_row_group_ctr*2]; - inptr01 = input_buf[0][in_row_group_ctr*2 + 1]; - inptr1 = input_buf[1][in_row_group_ctr]; - inptr2 = input_buf[2][in_row_group_ctr]; - outptr0 = output_buf[0]; - outptr1 = output_buf[1]; - /* Loop for each group of output pixels */ - for (col = cinfo->output_width >> 1; col > 0; col--) { - /* Do the chroma part of the calculation */ - cb = GETJSAMPLE(*inptr1++); - cr = GETJSAMPLE(*inptr2++); - cred = Crrtab[cr]; - cgreen = (int) RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr], SCALEBITS); - cblue = Cbbtab[cb]; - /* Fetch 4 Y values and emit 4 pixels */ - y = GETJSAMPLE(*inptr00++); - outptr0[RGB_RED] = range_limit[y + cred]; - outptr0[RGB_GREEN] = range_limit[y + cgreen]; - outptr0[RGB_BLUE] = range_limit[y + cblue]; - outptr0 += RGB_PIXELSIZE; - y = GETJSAMPLE(*inptr00++); - outptr0[RGB_RED] = range_limit[y + cred]; - outptr0[RGB_GREEN] = range_limit[y + cgreen]; - outptr0[RGB_BLUE] = range_limit[y + cblue]; - outptr0 += RGB_PIXELSIZE; - y = GETJSAMPLE(*inptr01++); - outptr1[RGB_RED] = range_limit[y + cred]; - outptr1[RGB_GREEN] = range_limit[y + cgreen]; - outptr1[RGB_BLUE] = range_limit[y + cblue]; - outptr1 += RGB_PIXELSIZE; - y = GETJSAMPLE(*inptr01++); - outptr1[RGB_RED] = range_limit[y + cred]; - outptr1[RGB_GREEN] = range_limit[y + cgreen]; - outptr1[RGB_BLUE] = range_limit[y + cblue]; - outptr1 += RGB_PIXELSIZE; - } - /* If image width is odd, do the last output column separately */ - if (cinfo->output_width & 1) { - cb = GETJSAMPLE(*inptr1); - cr = GETJSAMPLE(*inptr2); - cred = Crrtab[cr]; - cgreen = (int) RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr], SCALEBITS); - cblue = Cbbtab[cb]; - y = GETJSAMPLE(*inptr00); - outptr0[RGB_RED] = range_limit[y + cred]; - outptr0[RGB_GREEN] = range_limit[y + cgreen]; - outptr0[RGB_BLUE] = range_limit[y + cblue]; - y = GETJSAMPLE(*inptr01); - outptr1[RGB_RED] = range_limit[y + cred]; - outptr1[RGB_GREEN] = range_limit[y + cgreen]; - outptr1[RGB_BLUE] = range_limit[y + cblue]; - } -} - - -/* - * Module initialization routine for merged upsampling/color conversion. - * - * NB: this is called under the conditions determined by use_merged_upsample() - * in jdmaster.c. That routine MUST correspond to the actual capabilities - * of this module; no safety checks are made here. - */ - -GLOBAL(void) -jinit_merged_upsampler (j_decompress_ptr cinfo) -{ - my_upsample_ptr upsample; - - upsample = (my_upsample_ptr) - (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, - SIZEOF(my_upsampler)); - cinfo->upsample = (struct jpeg_upsampler *) upsample; - upsample->pub.start_pass = start_pass_merged_upsample; - upsample->pub.need_context_rows = FALSE; - - upsample->out_row_width = cinfo->output_width * cinfo->out_color_components; - - if (cinfo->max_v_samp_factor == 2) { - upsample->pub.upsample = merged_2v_upsample; - upsample->upmethod = h2v2_merged_upsample; - /* Allocate a spare row buffer */ - upsample->spare_row = (JSAMPROW) - (*cinfo->mem->alloc_large) ((j_common_ptr) cinfo, JPOOL_IMAGE, - (size_t) (upsample->out_row_width * SIZEOF(JSAMPLE))); - } else { - upsample->pub.upsample = merged_1v_upsample; - upsample->upmethod = h2v1_merged_upsample; - /* No spare row needed */ - upsample->spare_row = NULL; - } - - build_ycc_rgb_table(cinfo); -} - -#endif /* UPSAMPLE_MERGING_SUPPORTED */ diff --git a/wxWidgets/src/jpeg/jdphuff.c b/wxWidgets/src/jpeg/jdphuff.c deleted file mode 100644 index 96b4364e45..0000000000 --- a/wxWidgets/src/jpeg/jdphuff.c +++ /dev/null @@ -1,668 +0,0 @@ -/* - * jdphuff.c - * - * Copyright (C) 1995-1997, Thomas G. Lane. - * This file is part of the Independent JPEG Group's software. - * For conditions of distribution and use, see the accompanying README file. - * - * This file contains Huffman entropy decoding routines for progressive JPEG. - * - * Much of the complexity here has to do with supporting input suspension. - * If the data source module demands suspension, we want to be able to back - * up to the start of the current MCU. To do this, we copy state variables - * into local working storage, and update them back to the permanent - * storage only upon successful completion of an MCU. - */ - -#define JPEG_INTERNALS -#include "jinclude.h" -#include "jpeglib.h" -#include "jdhuff.h" /* Declarations shared with jdhuff.c */ - - -#ifdef D_PROGRESSIVE_SUPPORTED - -/* - * Expanded entropy decoder object for progressive Huffman decoding. - * - * The savable_state subrecord contains fields that change within an MCU, - * but must not be updated permanently until we complete the MCU. - */ - -typedef struct { - unsigned int EOBRUN; /* remaining EOBs in EOBRUN */ - int last_dc_val[MAX_COMPS_IN_SCAN]; /* last DC coef for each component */ -} savable_state; - -/* This macro is to work around compilers with missing or broken - * structure assignment. You'll need to fix this code if you have - * such a compiler and you change MAX_COMPS_IN_SCAN. - */ - -#ifndef NO_STRUCT_ASSIGN -#define ASSIGN_STATE(dest,src) ((dest) = (src)) -#else -#if MAX_COMPS_IN_SCAN == 4 -#define ASSIGN_STATE(dest,src) \ - ((dest).EOBRUN = (src).EOBRUN, \ - (dest).last_dc_val[0] = (src).last_dc_val[0], \ - (dest).last_dc_val[1] = (src).last_dc_val[1], \ - (dest).last_dc_val[2] = (src).last_dc_val[2], \ - (dest).last_dc_val[3] = (src).last_dc_val[3]) -#endif -#endif - - -typedef struct { - struct jpeg_entropy_decoder pub; /* public fields */ - - /* These fields are loaded into local variables at start of each MCU. - * In case of suspension, we exit WITHOUT updating them. - */ - bitread_perm_state bitstate; /* Bit buffer at start of MCU */ - savable_state saved; /* Other state at start of MCU */ - - /* These fields are NOT loaded into local working state. */ - unsigned int restarts_to_go; /* MCUs left in this restart interval */ - - /* Pointers to derived tables (these workspaces have image lifespan) */ - d_derived_tbl * derived_tbls[NUM_HUFF_TBLS]; - - d_derived_tbl * ac_derived_tbl; /* active table during an AC scan */ -} phuff_entropy_decoder; - -typedef phuff_entropy_decoder * phuff_entropy_ptr; - -/* Forward declarations */ -METHODDEF(wxjpeg_boolean) decode_mcu_DC_first JPP((j_decompress_ptr cinfo, - JBLOCKROW *MCU_data)); -METHODDEF(wxjpeg_boolean) decode_mcu_AC_first JPP((j_decompress_ptr cinfo, - JBLOCKROW *MCU_data)); -METHODDEF(wxjpeg_boolean) decode_mcu_DC_refine JPP((j_decompress_ptr cinfo, - JBLOCKROW *MCU_data)); -METHODDEF(wxjpeg_boolean) decode_mcu_AC_refine JPP((j_decompress_ptr cinfo, - JBLOCKROW *MCU_data)); - - -/* - * Initialize for a Huffman-compressed scan. - */ - -METHODDEF(void) -start_pass_phuff_decoder (j_decompress_ptr cinfo) -{ - phuff_entropy_ptr entropy = (phuff_entropy_ptr) cinfo->entropy; - wxjpeg_boolean is_DC_band, bad; - int ci, coefi, tbl; - int *coef_bit_ptr; - jpeg_component_info * compptr; - - is_DC_band = (cinfo->Ss == 0); - - /* Validate scan parameters */ - bad = FALSE; - if (is_DC_band) { - if (cinfo->Se != 0) - bad = TRUE; - } else { - /* need not check Ss/Se < 0 since they came from unsigned bytes */ - if (cinfo->Ss > cinfo->Se || cinfo->Se >= DCTSIZE2) - bad = TRUE; - /* AC scans may have only one component */ - if (cinfo->comps_in_scan != 1) - bad = TRUE; - } - if (cinfo->Ah != 0) { - /* Successive approximation refinement scan: must have Al = Ah-1. */ - if (cinfo->Al != cinfo->Ah-1) - bad = TRUE; - } - if (cinfo->Al > 13) /* need not check for < 0 */ - bad = TRUE; - /* Arguably the maximum Al value should be less than 13 for 8-bit precision, - * but the spec doesn't say so, and we try to be liberal about what we - * accept. Note: large Al values could result in out-of-range DC - * coefficients during early scans, leading to bizarre displays due to - * overflows in the IDCT math. But we won't crash. - */ - if (bad) - ERREXIT4(cinfo, JERR_BAD_PROGRESSION, - cinfo->Ss, cinfo->Se, cinfo->Ah, cinfo->Al); - /* Update progression status, and verify that scan order is legal. - * Note that inter-scan inconsistencies are treated as warnings - * not fatal errors ... not clear if this is right way to behave. - */ - for (ci = 0; ci < cinfo->comps_in_scan; ci++) { - int cindex = cinfo->cur_comp_info[ci]->component_index; - coef_bit_ptr = & cinfo->coef_bits[cindex][0]; - if (!is_DC_band && coef_bit_ptr[0] < 0) /* AC without prior DC scan */ - WARNMS2(cinfo, JWRN_BOGUS_PROGRESSION, cindex, 0); - for (coefi = cinfo->Ss; coefi <= cinfo->Se; coefi++) { - int expected = (coef_bit_ptr[coefi] < 0) ? 0 : coef_bit_ptr[coefi]; - if (cinfo->Ah != expected) - WARNMS2(cinfo, JWRN_BOGUS_PROGRESSION, cindex, coefi); - coef_bit_ptr[coefi] = cinfo->Al; - } - } - - /* Select MCU decoding routine */ - if (cinfo->Ah == 0) { - if (is_DC_band) - entropy->pub.decode_mcu = decode_mcu_DC_first; - else - entropy->pub.decode_mcu = decode_mcu_AC_first; - } else { - if (is_DC_band) - entropy->pub.decode_mcu = decode_mcu_DC_refine; - else - entropy->pub.decode_mcu = decode_mcu_AC_refine; - } - - for (ci = 0; ci < cinfo->comps_in_scan; ci++) { - compptr = cinfo->cur_comp_info[ci]; - /* Make sure requested tables are present, and compute derived tables. - * We may build same derived table more than once, but it's not expensive. - */ - if (is_DC_band) { - if (cinfo->Ah == 0) { /* DC refinement needs no table */ - tbl = compptr->dc_tbl_no; - jpeg_make_d_derived_tbl(cinfo, TRUE, tbl, - & entropy->derived_tbls[tbl]); - } - } else { - tbl = compptr->ac_tbl_no; - jpeg_make_d_derived_tbl(cinfo, FALSE, tbl, - & entropy->derived_tbls[tbl]); - /* remember the single active table */ - entropy->ac_derived_tbl = entropy->derived_tbls[tbl]; - } - /* Initialize DC predictions to 0 */ - entropy->saved.last_dc_val[ci] = 0; - } - - /* Initialize bitread state variables */ - entropy->bitstate.bits_left = 0; - entropy->bitstate.get_buffer = 0; /* unnecessary, but keeps Purify quiet */ - entropy->pub.insufficient_data = FALSE; - - /* Initialize private state variables */ - entropy->saved.EOBRUN = 0; - - /* Initialize restart counter */ - entropy->restarts_to_go = cinfo->restart_interval; -} - - -/* - * Figure F.12: extend sign bit. - * On some machines, a shift and add will be faster than a table lookup. - */ - -#ifdef AVOID_TABLES - -#define HUFF_EXTEND(x,s) ((x) < (1<<((s)-1)) ? (x) + (((-1)<<(s)) + 1) : (x)) - -#else - -#define HUFF_EXTEND(x,s) ((x) < extend_test[s] ? (x) + extend_offset[s] : (x)) - -static const int extend_test[16] = /* entry n is 2**(n-1) */ - { 0, 0x0001, 0x0002, 0x0004, 0x0008, 0x0010, 0x0020, 0x0040, 0x0080, - 0x0100, 0x0200, 0x0400, 0x0800, 0x1000, 0x2000, 0x4000 }; - -static const int extend_offset[16] = /* entry n is (-1 << n) + 1 */ - { 0, ((-1)<<1) + 1, ((-1)<<2) + 1, ((-1)<<3) + 1, ((-1)<<4) + 1, - ((-1)<<5) + 1, ((-1)<<6) + 1, ((-1)<<7) + 1, ((-1)<<8) + 1, - ((-1)<<9) + 1, ((-1)<<10) + 1, ((-1)<<11) + 1, ((-1)<<12) + 1, - ((-1)<<13) + 1, ((-1)<<14) + 1, ((-1)<<15) + 1 }; - -#endif /* AVOID_TABLES */ - - -/* - * Check for a restart marker & resynchronize decoder. - * Returns FALSE if must suspend. - */ - -LOCAL(wxjpeg_boolean) -process_restart (j_decompress_ptr cinfo) -{ - phuff_entropy_ptr entropy = (phuff_entropy_ptr) cinfo->entropy; - int ci; - - /* Throw away any unused bits remaining in bit buffer; */ - /* include any full bytes in next_marker's count of discarded bytes */ - cinfo->marker->discarded_bytes += entropy->bitstate.bits_left / 8; - entropy->bitstate.bits_left = 0; - - /* Advance past the RSTn marker */ - if (! (*cinfo->marker->read_restart_marker) (cinfo)) - return FALSE; - - /* Re-initialize DC predictions to 0 */ - for (ci = 0; ci < cinfo->comps_in_scan; ci++) - entropy->saved.last_dc_val[ci] = 0; - /* Re-init EOB run count, too */ - entropy->saved.EOBRUN = 0; - - /* Reset restart counter */ - entropy->restarts_to_go = cinfo->restart_interval; - - /* Reset out-of-data flag, unless read_restart_marker left us smack up - * against a marker. In that case we will end up treating the next data - * segment as empty, and we can avoid producing bogus output pixels by - * leaving the flag set. - */ - if (cinfo->unread_marker == 0) - entropy->pub.insufficient_data = FALSE; - - return TRUE; -} - - -/* - * Huffman MCU decoding. - * Each of these routines decodes and returns one MCU's worth of - * Huffman-compressed coefficients. - * The coefficients are reordered from zigzag order into natural array order, - * but are not dequantized. - * - * The i'th block of the MCU is stored into the block pointed to by - * MCU_data[i]. WE ASSUME THIS AREA IS INITIALLY ZEROED BY THE CALLER. - * - * We return FALSE if data source requested suspension. In that case no - * changes have been made to permanent state. (Exception: some output - * coefficients may already have been assigned. This is harmless for - * spectral selection, since we'll just re-assign them on the next call. - * Successive approximation AC refinement has to be more careful, however.) - */ - -/* - * MCU decoding for DC initial scan (either spectral selection, - * or first pass of successive approximation). - */ - -METHODDEF(wxjpeg_boolean) -decode_mcu_DC_first (j_decompress_ptr cinfo, JBLOCKROW *MCU_data) -{ - phuff_entropy_ptr entropy = (phuff_entropy_ptr) cinfo->entropy; - int Al = cinfo->Al; - register int s, r; - int blkn, ci; - JBLOCKROW block; - BITREAD_STATE_VARS; - savable_state state; - d_derived_tbl * tbl; - jpeg_component_info * compptr; - - /* Process restart marker if needed; may have to suspend */ - if (cinfo->restart_interval) { - if (entropy->restarts_to_go == 0) - if (! process_restart(cinfo)) - return FALSE; - } - - /* If we've run out of data, just leave the MCU set to zeroes. - * This way, we return uniform gray for the remainder of the segment. - */ - if (! entropy->pub.insufficient_data) { - - /* Load up working state */ - BITREAD_LOAD_STATE(cinfo,entropy->bitstate); - ASSIGN_STATE(state, entropy->saved); - - /* Outer loop handles each block in the MCU */ - - for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) { - block = MCU_data[blkn]; - ci = cinfo->MCU_membership[blkn]; - compptr = cinfo->cur_comp_info[ci]; - tbl = entropy->derived_tbls[compptr->dc_tbl_no]; - - /* Decode a single block's worth of coefficients */ - - /* Section F.2.2.1: decode the DC coefficient difference */ - HUFF_DECODE(s, br_state, tbl, return FALSE, label1); - if (s) { - CHECK_BIT_BUFFER(br_state, s, return FALSE); - r = GET_BITS(s); - s = HUFF_EXTEND(r, s); - } - - /* Convert DC difference to actual value, update last_dc_val */ - s += state.last_dc_val[ci]; - state.last_dc_val[ci] = s; - /* Scale and output the coefficient (assumes jpeg_natural_order[0]=0) */ - (*block)[0] = (JCOEF) (s << Al); - } - - /* Completed MCU, so update state */ - BITREAD_SAVE_STATE(cinfo,entropy->bitstate); - ASSIGN_STATE(entropy->saved, state); - } - - /* Account for restart interval (no-op if not using restarts) */ - entropy->restarts_to_go--; - - return TRUE; -} - - -/* - * MCU decoding for AC initial scan (either spectral selection, - * or first pass of successive approximation). - */ - -METHODDEF(wxjpeg_boolean) -decode_mcu_AC_first (j_decompress_ptr cinfo, JBLOCKROW *MCU_data) -{ - phuff_entropy_ptr entropy = (phuff_entropy_ptr) cinfo->entropy; - int Se = cinfo->Se; - int Al = cinfo->Al; - register int s, k, r; - unsigned int EOBRUN; - JBLOCKROW block; - BITREAD_STATE_VARS; - d_derived_tbl * tbl; - - /* Process restart marker if needed; may have to suspend */ - if (cinfo->restart_interval) { - if (entropy->restarts_to_go == 0) - if (! process_restart(cinfo)) - return FALSE; - } - - /* If we've run out of data, just leave the MCU set to zeroes. - * This way, we return uniform gray for the remainder of the segment. - */ - if (! entropy->pub.insufficient_data) { - - /* Load up working state. - * We can avoid loading/saving bitread state if in an EOB run. - */ - EOBRUN = entropy->saved.EOBRUN; /* only part of saved state we need */ - - /* There is always only one block per MCU */ - - if (EOBRUN > 0) /* if it's a band of zeroes... */ - EOBRUN--; /* ...process it now (we do nothing) */ - else { - BITREAD_LOAD_STATE(cinfo,entropy->bitstate); - block = MCU_data[0]; - tbl = entropy->ac_derived_tbl; - - for (k = cinfo->Ss; k <= Se; k++) { - HUFF_DECODE(s, br_state, tbl, return FALSE, label2); - r = s >> 4; - s &= 15; - if (s) { - k += r; - CHECK_BIT_BUFFER(br_state, s, return FALSE); - r = GET_BITS(s); - s = HUFF_EXTEND(r, s); - /* Scale and output coefficient in natural (dezigzagged) order */ - (*block)[jpeg_natural_order[k]] = (JCOEF) (s << Al); - } else { - if (r == 15) { /* ZRL */ - k += 15; /* skip 15 zeroes in band */ - } else { /* EOBr, run length is 2^r + appended bits */ - EOBRUN = 1 << r; - if (r) { /* EOBr, r > 0 */ - CHECK_BIT_BUFFER(br_state, r, return FALSE); - r = GET_BITS(r); - EOBRUN += r; - } - EOBRUN--; /* this band is processed at this moment */ - break; /* force end-of-band */ - } - } - } - - BITREAD_SAVE_STATE(cinfo,entropy->bitstate); - } - - /* Completed MCU, so update state */ - entropy->saved.EOBRUN = EOBRUN; /* only part of saved state we need */ - } - - /* Account for restart interval (no-op if not using restarts) */ - entropy->restarts_to_go--; - - return TRUE; -} - - -/* - * MCU decoding for DC successive approximation refinement scan. - * Note: we assume such scans can be multi-component, although the spec - * is not very clear on the point. - */ - -METHODDEF(wxjpeg_boolean) -decode_mcu_DC_refine (j_decompress_ptr cinfo, JBLOCKROW *MCU_data) -{ - phuff_entropy_ptr entropy = (phuff_entropy_ptr) cinfo->entropy; - int p1 = 1 << cinfo->Al; /* 1 in the bit position being coded */ - int blkn; - JBLOCKROW block; - BITREAD_STATE_VARS; - - /* Process restart marker if needed; may have to suspend */ - if (cinfo->restart_interval) { - if (entropy->restarts_to_go == 0) - if (! process_restart(cinfo)) - return FALSE; - } - - /* Not worth the cycles to check insufficient_data here, - * since we will not change the data anyway if we read zeroes. - */ - - /* Load up working state */ - BITREAD_LOAD_STATE(cinfo,entropy->bitstate); - - /* Outer loop handles each block in the MCU */ - - for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) { - block = MCU_data[blkn]; - - /* Encoded data is simply the next bit of the two's-complement DC value */ - CHECK_BIT_BUFFER(br_state, 1, return FALSE); - if (GET_BITS(1)) - (*block)[0] |= p1; - /* Note: since we use |=, repeating the assignment later is safe */ - } - - /* Completed MCU, so update state */ - BITREAD_SAVE_STATE(cinfo,entropy->bitstate); - - /* Account for restart interval (no-op if not using restarts) */ - entropy->restarts_to_go--; - - return TRUE; -} - - -/* - * MCU decoding for AC successive approximation refinement scan. - */ - -METHODDEF(wxjpeg_boolean) -decode_mcu_AC_refine (j_decompress_ptr cinfo, JBLOCKROW *MCU_data) -{ - phuff_entropy_ptr entropy = (phuff_entropy_ptr) cinfo->entropy; - int Se = cinfo->Se; - int p1 = 1 << cinfo->Al; /* 1 in the bit position being coded */ - int m1 = (-1) << cinfo->Al; /* -1 in the bit position being coded */ - register int s, k, r; - unsigned int EOBRUN; - JBLOCKROW block; - JCOEFPTR thiscoef; - BITREAD_STATE_VARS; - d_derived_tbl * tbl; - int num_newnz; - int newnz_pos[DCTSIZE2]; - - /* Process restart marker if needed; may have to suspend */ - if (cinfo->restart_interval) { - if (entropy->restarts_to_go == 0) - if (! process_restart(cinfo)) - return FALSE; - } - - /* If we've run out of data, don't modify the MCU. - */ - if (! entropy->pub.insufficient_data) { - - /* Load up working state */ - BITREAD_LOAD_STATE(cinfo,entropy->bitstate); - EOBRUN = entropy->saved.EOBRUN; /* only part of saved state we need */ - - /* There is always only one block per MCU */ - block = MCU_data[0]; - tbl = entropy->ac_derived_tbl; - - /* If we are forced to suspend, we must undo the assignments to any newly - * nonzero coefficients in the block, because otherwise we'd get confused - * next time about which coefficients were already nonzero. - * But we need not undo addition of bits to already-nonzero coefficients; - * instead, we can test the current bit to see if we already did it. - */ - num_newnz = 0; - - /* initialize coefficient loop counter to start of band */ - k = cinfo->Ss; - - if (EOBRUN == 0) { - for (; k <= Se; k++) { - HUFF_DECODE(s, br_state, tbl, goto undoit, label3); - r = s >> 4; - s &= 15; - if (s) { - if (s != 1) /* size of new coef should always be 1 */ - WARNMS(cinfo, JWRN_HUFF_BAD_CODE); - CHECK_BIT_BUFFER(br_state, 1, goto undoit); - if (GET_BITS(1)) - s = p1; /* newly nonzero coef is positive */ - else - s = m1; /* newly nonzero coef is negative */ - } else { - if (r != 15) { - EOBRUN = 1 << r; /* EOBr, run length is 2^r + appended bits */ - if (r) { - CHECK_BIT_BUFFER(br_state, r, goto undoit); - r = GET_BITS(r); - EOBRUN += r; - } - break; /* rest of block is handled by EOB logic */ - } - /* note s = 0 for processing ZRL */ - } - /* Advance over already-nonzero coefs and r still-zero coefs, - * appending correction bits to the nonzeroes. A correction bit is 1 - * if the absolute value of the coefficient must be increased. - */ - do { - thiscoef = *block + jpeg_natural_order[k]; - if (*thiscoef != 0) { - CHECK_BIT_BUFFER(br_state, 1, goto undoit); - if (GET_BITS(1)) { - if ((*thiscoef & p1) == 0) { /* do nothing if already set it */ - if (*thiscoef >= 0) - *thiscoef += p1; - else - *thiscoef += m1; - } - } - } else { - if (--r < 0) - break; /* reached target zero coefficient */ - } - k++; - } while (k <= Se); - if (s) { - int pos = jpeg_natural_order[k]; - /* Output newly nonzero coefficient */ - (*block)[pos] = (JCOEF) s; - /* Remember its position in case we have to suspend */ - newnz_pos[num_newnz++] = pos; - } - } - } - - if (EOBRUN > 0) { - /* Scan any remaining coefficient positions after the end-of-band - * (the last newly nonzero coefficient, if any). Append a correction - * bit to each already-nonzero coefficient. A correction bit is 1 - * if the absolute value of the coefficient must be increased. - */ - for (; k <= Se; k++) { - thiscoef = *block + jpeg_natural_order[k]; - if (*thiscoef != 0) { - CHECK_BIT_BUFFER(br_state, 1, goto undoit); - if (GET_BITS(1)) { - if ((*thiscoef & p1) == 0) { /* do nothing if already changed it */ - if (*thiscoef >= 0) - *thiscoef += p1; - else - *thiscoef += m1; - } - } - } - } - /* Count one block completed in EOB run */ - EOBRUN--; - } - - /* Completed MCU, so update state */ - BITREAD_SAVE_STATE(cinfo,entropy->bitstate); - entropy->saved.EOBRUN = EOBRUN; /* only part of saved state we need */ - } - - /* Account for restart interval (no-op if not using restarts) */ - entropy->restarts_to_go--; - - return TRUE; - -undoit: - /* Re-zero any output coefficients that we made newly nonzero */ - while (num_newnz > 0) - (*block)[newnz_pos[--num_newnz]] = 0; - - return FALSE; -} - - -/* - * Module initialization routine for progressive Huffman entropy decoding. - */ - -GLOBAL(void) -jinit_phuff_decoder (j_decompress_ptr cinfo) -{ - phuff_entropy_ptr entropy; - int *coef_bit_ptr; - int ci, i; - - entropy = (phuff_entropy_ptr) - (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, - SIZEOF(phuff_entropy_decoder)); - cinfo->entropy = (struct jpeg_entropy_decoder *) entropy; - entropy->pub.start_pass = start_pass_phuff_decoder; - - /* Mark derived tables unallocated */ - for (i = 0; i < NUM_HUFF_TBLS; i++) { - entropy->derived_tbls[i] = NULL; - } - - /* Create progression status table */ - cinfo->coef_bits = (int (*)[DCTSIZE2]) - (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, - cinfo->num_components*DCTSIZE2*SIZEOF(int)); - coef_bit_ptr = & cinfo->coef_bits[0][0]; - for (ci = 0; ci < cinfo->num_components; ci++) - for (i = 0; i < DCTSIZE2; i++) - *coef_bit_ptr++ = -1; -} - -#endif /* D_PROGRESSIVE_SUPPORTED */ diff --git a/wxWidgets/src/jpeg/jdpostct.c b/wxWidgets/src/jpeg/jdpostct.c deleted file mode 100644 index e6bcd4a9c3..0000000000 --- a/wxWidgets/src/jpeg/jdpostct.c +++ /dev/null @@ -1,290 +0,0 @@ -/* - * jdpostct.c - * - * Copyright (C) 1994-1996, Thomas G. Lane. - * This file is part of the Independent JPEG Group's software. - * For conditions of distribution and use, see the accompanying README file. - * - * This file contains the decompression postprocessing controller. - * This controller manages the upsampling, color conversion, and color - * quantization/reduction steps; specifically, it controls the buffering - * between upsample/color conversion and color quantization/reduction. - * - * If no color quantization/reduction is required, then this module has no - * work to do, and it just hands off to the upsample/color conversion code. - * An integrated upsample/convert/quantize process would replace this module - * entirely. - */ - -#define JPEG_INTERNALS -#include "jinclude.h" -#include "jpeglib.h" - - -/* Private buffer controller object */ - -typedef struct { - struct jpeg_d_post_controller pub; /* public fields */ - - /* Color quantization source buffer: this holds output data from - * the upsample/color conversion step to be passed to the quantizer. - * For two-pass color quantization, we need a full-image buffer; - * for one-pass operation, a strip buffer is sufficient. - */ - jvirt_sarray_ptr whole_image; /* virtual array, or NULL if one-pass */ - JSAMPARRAY buffer; /* strip buffer, or current strip of virtual */ - JDIMENSION strip_height; /* buffer size in rows */ - /* for two-pass mode only: */ - JDIMENSION starting_row; /* row # of first row in current strip */ - JDIMENSION next_row; /* index of next row to fill/empty in strip */ -} my_post_controller; - -typedef my_post_controller * my_post_ptr; - - -/* Forward declarations */ -METHODDEF(void) post_process_1pass - JPP((j_decompress_ptr cinfo, - JSAMPIMAGE input_buf, JDIMENSION *in_row_group_ctr, - JDIMENSION in_row_groups_avail, - JSAMPARRAY output_buf, JDIMENSION *out_row_ctr, - JDIMENSION out_rows_avail)); -#ifdef QUANT_2PASS_SUPPORTED -METHODDEF(void) post_process_prepass - JPP((j_decompress_ptr cinfo, - JSAMPIMAGE input_buf, JDIMENSION *in_row_group_ctr, - JDIMENSION in_row_groups_avail, - JSAMPARRAY output_buf, JDIMENSION *out_row_ctr, - JDIMENSION out_rows_avail)); -METHODDEF(void) post_process_2pass - JPP((j_decompress_ptr cinfo, - JSAMPIMAGE input_buf, JDIMENSION *in_row_group_ctr, - JDIMENSION in_row_groups_avail, - JSAMPARRAY output_buf, JDIMENSION *out_row_ctr, - JDIMENSION out_rows_avail)); -#endif - - -/* - * Initialize for a processing pass. - */ - -METHODDEF(void) -start_pass_dpost (j_decompress_ptr cinfo, J_BUF_MODE pass_mode) -{ - my_post_ptr post = (my_post_ptr) cinfo->post; - - switch (pass_mode) { - case JBUF_PASS_THRU: - if (cinfo->quantize_colors) { - /* Single-pass processing with color quantization. */ - post->pub.post_process_data = post_process_1pass; - /* We could be doing buffered-image output before starting a 2-pass - * color quantization; in that case, jinit_d_post_controller did not - * allocate a strip buffer. Use the virtual-array buffer as workspace. - */ - if (post->buffer == NULL) { - post->buffer = (*cinfo->mem->access_virt_sarray) - ((j_common_ptr) cinfo, post->whole_image, - (JDIMENSION) 0, post->strip_height, TRUE); - } - } else { - /* For single-pass processing without color quantization, - * I have no work to do; just call the upsampler directly. - */ - post->pub.post_process_data = cinfo->upsample->upsample; - } - break; -#ifdef QUANT_2PASS_SUPPORTED - case JBUF_SAVE_AND_PASS: - /* First pass of 2-pass quantization */ - if (post->whole_image == NULL) - ERREXIT(cinfo, JERR_BAD_BUFFER_MODE); - post->pub.post_process_data = post_process_prepass; - break; - case JBUF_CRANK_DEST: - /* Second pass of 2-pass quantization */ - if (post->whole_image == NULL) - ERREXIT(cinfo, JERR_BAD_BUFFER_MODE); - post->pub.post_process_data = post_process_2pass; - break; -#endif /* QUANT_2PASS_SUPPORTED */ - default: - ERREXIT(cinfo, JERR_BAD_BUFFER_MODE); - break; - } - post->starting_row = post->next_row = 0; -} - - -/* - * Process some data in the one-pass (strip buffer) case. - * This is used for color precision reduction as well as one-pass quantization. - */ - -METHODDEF(void) -post_process_1pass (j_decompress_ptr cinfo, - JSAMPIMAGE input_buf, JDIMENSION *in_row_group_ctr, - JDIMENSION in_row_groups_avail, - JSAMPARRAY output_buf, JDIMENSION *out_row_ctr, - JDIMENSION out_rows_avail) -{ - my_post_ptr post = (my_post_ptr) cinfo->post; - JDIMENSION num_rows, max_rows; - - /* Fill the buffer, but not more than what we can dump out in one go. */ - /* Note we rely on the upsampler to detect bottom of image. */ - max_rows = out_rows_avail - *out_row_ctr; - if (max_rows > post->strip_height) - max_rows = post->strip_height; - num_rows = 0; - (*cinfo->upsample->upsample) (cinfo, - input_buf, in_row_group_ctr, in_row_groups_avail, - post->buffer, &num_rows, max_rows); - /* Quantize and emit data. */ - (*cinfo->cquantize->color_quantize) (cinfo, - post->buffer, output_buf + *out_row_ctr, (int) num_rows); - *out_row_ctr += num_rows; -} - - -#ifdef QUANT_2PASS_SUPPORTED - -/* - * Process some data in the first pass of 2-pass quantization. - */ - -METHODDEF(void) -post_process_prepass (j_decompress_ptr cinfo, - JSAMPIMAGE input_buf, JDIMENSION *in_row_group_ctr, - JDIMENSION in_row_groups_avail, - JSAMPARRAY output_buf, JDIMENSION *out_row_ctr, - JDIMENSION out_rows_avail) -{ - my_post_ptr post = (my_post_ptr) cinfo->post; - JDIMENSION old_next_row, num_rows; - - /* Reposition virtual buffer if at start of strip. */ - if (post->next_row == 0) { - post->buffer = (*cinfo->mem->access_virt_sarray) - ((j_common_ptr) cinfo, post->whole_image, - post->starting_row, post->strip_height, TRUE); - } - - /* Upsample some data (up to a strip height's worth). */ - old_next_row = post->next_row; - (*cinfo->upsample->upsample) (cinfo, - input_buf, in_row_group_ctr, in_row_groups_avail, - post->buffer, &post->next_row, post->strip_height); - - /* Allow quantizer to scan new data. No data is emitted, */ - /* but we advance out_row_ctr so outer loop can tell when we're done. */ - if (post->next_row > old_next_row) { - num_rows = post->next_row - old_next_row; - (*cinfo->cquantize->color_quantize) (cinfo, post->buffer + old_next_row, - (JSAMPARRAY) NULL, (int) num_rows); - *out_row_ctr += num_rows; - } - - /* Advance if we filled the strip. */ - if (post->next_row >= post->strip_height) { - post->starting_row += post->strip_height; - post->next_row = 0; - } -} - - -/* - * Process some data in the second pass of 2-pass quantization. - */ - -METHODDEF(void) -post_process_2pass (j_decompress_ptr cinfo, - JSAMPIMAGE input_buf, JDIMENSION *in_row_group_ctr, - JDIMENSION in_row_groups_avail, - JSAMPARRAY output_buf, JDIMENSION *out_row_ctr, - JDIMENSION out_rows_avail) -{ - my_post_ptr post = (my_post_ptr) cinfo->post; - JDIMENSION num_rows, max_rows; - - /* Reposition virtual buffer if at start of strip. */ - if (post->next_row == 0) { - post->buffer = (*cinfo->mem->access_virt_sarray) - ((j_common_ptr) cinfo, post->whole_image, - post->starting_row, post->strip_height, FALSE); - } - - /* Determine number of rows to emit. */ - num_rows = post->strip_height - post->next_row; /* available in strip */ - max_rows = out_rows_avail - *out_row_ctr; /* available in output area */ - if (num_rows > max_rows) - num_rows = max_rows; - /* We have to check bottom of image here, can't depend on upsampler. */ - max_rows = cinfo->output_height - post->starting_row; - if (num_rows > max_rows) - num_rows = max_rows; - - /* Quantize and emit data. */ - (*cinfo->cquantize->color_quantize) (cinfo, - post->buffer + post->next_row, output_buf + *out_row_ctr, - (int) num_rows); - *out_row_ctr += num_rows; - - /* Advance if we filled the strip. */ - post->next_row += num_rows; - if (post->next_row >= post->strip_height) { - post->starting_row += post->strip_height; - post->next_row = 0; - } -} - -#endif /* QUANT_2PASS_SUPPORTED */ - - -/* - * Initialize postprocessing controller. - */ - -GLOBAL(void) -jinit_d_post_controller (j_decompress_ptr cinfo, wxjpeg_boolean need_full_buffer) -{ - my_post_ptr post; - - post = (my_post_ptr) - (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, - SIZEOF(my_post_controller)); - cinfo->post = (struct jpeg_d_post_controller *) post; - post->pub.start_pass = start_pass_dpost; - post->whole_image = NULL; /* flag for no virtual arrays */ - post->buffer = NULL; /* flag for no strip buffer */ - - /* Create the quantization buffer, if needed */ - if (cinfo->quantize_colors) { - /* The buffer strip height is max_v_samp_factor, which is typically - * an efficient number of rows for upsampling to return. - * (In the presence of output rescaling, we might want to be smarter?) - */ - post->strip_height = (JDIMENSION) cinfo->max_v_samp_factor; - if (need_full_buffer) { - /* Two-pass color quantization: need full-image storage. */ - /* We round up the number of rows to a multiple of the strip height. */ -#ifdef QUANT_2PASS_SUPPORTED - post->whole_image = (*cinfo->mem->request_virt_sarray) - ((j_common_ptr) cinfo, JPOOL_IMAGE, FALSE, - cinfo->output_width * cinfo->out_color_components, - (JDIMENSION) jround_up((long) cinfo->output_height, - (long) post->strip_height), - post->strip_height); -#else - ERREXIT(cinfo, JERR_BAD_BUFFER_MODE); -#endif /* QUANT_2PASS_SUPPORTED */ - } else { - /* One-pass color quantization: just make a strip buffer. */ - post->buffer = (*cinfo->mem->alloc_sarray) - ((j_common_ptr) cinfo, JPOOL_IMAGE, - cinfo->output_width * cinfo->out_color_components, - post->strip_height); - } - } -} diff --git a/wxWidgets/src/jpeg/jdsample.c b/wxWidgets/src/jpeg/jdsample.c deleted file mode 100644 index 8c8fc1713c..0000000000 --- a/wxWidgets/src/jpeg/jdsample.c +++ /dev/null @@ -1,478 +0,0 @@ -/* - * jdsample.c - * - * Copyright (C) 1991-1996, Thomas G. Lane. - * This file is part of the Independent JPEG Group's software. - * For conditions of distribution and use, see the accompanying README file. - * - * This file contains upsampling routines. - * - * Upsampling input data is counted in "row groups". A row group - * is defined to be (v_samp_factor * DCT_scaled_size / min_DCT_scaled_size) - * sample rows of each component. Upsampling will normally produce - * max_v_samp_factor pixel rows from each row group (but this could vary - * if the upsampler is applying a scale factor of its own). - * - * An excellent reference for image resampling is - * Digital Image Warping, George Wolberg, 1990. - * Pub. by IEEE Computer Society Press, Los Alamitos, CA. ISBN 0-8186-8944-7. - */ - -#define JPEG_INTERNALS -#include "jinclude.h" -#include "jpeglib.h" - - -/* Pointer to routine to upsample a single component */ -typedef JMETHOD(void, upsample1_ptr, - (j_decompress_ptr cinfo, jpeg_component_info * compptr, - JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr)); - -/* Private subobject */ - -typedef struct { - struct jpeg_upsampler pub; /* public fields */ - - /* Color conversion buffer. When using separate upsampling and color - * conversion steps, this buffer holds one upsampled row group until it - * has been color converted and output. - * Note: we do not allocate any storage for component(s) which are full-size, - * ie do not need rescaling. The corresponding entry of color_buf[] is - * simply set to point to the input data array, thereby avoiding copying. - */ - JSAMPARRAY color_buf[MAX_COMPONENTS]; - - /* Per-component upsampling method pointers */ - upsample1_ptr methods[MAX_COMPONENTS]; - - int next_row_out; /* counts rows emitted from color_buf */ - JDIMENSION rows_to_go; /* counts rows remaining in image */ - - /* Height of an input row group for each component. */ - int rowgroup_height[MAX_COMPONENTS]; - - /* These arrays save pixel expansion factors so that int_expand need not - * recompute them each time. They are unused for other upsampling methods. - */ - UINT8 h_expand[MAX_COMPONENTS]; - UINT8 v_expand[MAX_COMPONENTS]; -} my_upsampler; - -typedef my_upsampler * my_upsample_ptr; - - -/* - * Initialize for an upsampling pass. - */ - -METHODDEF(void) -start_pass_upsample (j_decompress_ptr cinfo) -{ - my_upsample_ptr upsample = (my_upsample_ptr) cinfo->upsample; - - /* Mark the conversion buffer empty */ - upsample->next_row_out = cinfo->max_v_samp_factor; - /* Initialize total-height counter for detecting bottom of image */ - upsample->rows_to_go = cinfo->output_height; -} - - -/* - * Control routine to do upsampling (and color conversion). - * - * In this version we upsample each component independently. - * We upsample one row group into the conversion buffer, then apply - * color conversion a row at a time. - */ - -METHODDEF(void) -sep_upsample (j_decompress_ptr cinfo, - JSAMPIMAGE input_buf, JDIMENSION *in_row_group_ctr, - JDIMENSION in_row_groups_avail, - JSAMPARRAY output_buf, JDIMENSION *out_row_ctr, - JDIMENSION out_rows_avail) -{ - my_upsample_ptr upsample = (my_upsample_ptr) cinfo->upsample; - int ci; - jpeg_component_info * compptr; - JDIMENSION num_rows; - - /* Fill the conversion buffer, if it's empty */ - if (upsample->next_row_out >= cinfo->max_v_samp_factor) { - for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; - ci++, compptr++) { - /* Invoke per-component upsample method. Notice we pass a POINTER - * to color_buf[ci], so that fullsize_upsample can change it. - */ - (*upsample->methods[ci]) (cinfo, compptr, - input_buf[ci] + (*in_row_group_ctr * upsample->rowgroup_height[ci]), - upsample->color_buf + ci); - } - upsample->next_row_out = 0; - } - - /* Color-convert and emit rows */ - - /* How many we have in the buffer: */ - num_rows = (JDIMENSION) (cinfo->max_v_samp_factor - upsample->next_row_out); - /* Not more than the distance to the end of the image. Need this test - * in case the image height is not a multiple of max_v_samp_factor: - */ - if (num_rows > upsample->rows_to_go) - num_rows = upsample->rows_to_go; - /* And not more than what the client can accept: */ - out_rows_avail -= *out_row_ctr; - if (num_rows > out_rows_avail) - num_rows = out_rows_avail; - - (*cinfo->cconvert->color_convert) (cinfo, upsample->color_buf, - (JDIMENSION) upsample->next_row_out, - output_buf + *out_row_ctr, - (int) num_rows); - - /* Adjust counts */ - *out_row_ctr += num_rows; - upsample->rows_to_go -= num_rows; - upsample->next_row_out += num_rows; - /* When the buffer is emptied, declare this input row group consumed */ - if (upsample->next_row_out >= cinfo->max_v_samp_factor) - (*in_row_group_ctr)++; -} - - -/* - * These are the routines invoked by sep_upsample to upsample pixel values - * of a single component. One row group is processed per call. - */ - - -/* - * For full-size components, we just make color_buf[ci] point at the - * input buffer, and thus avoid copying any data. Note that this is - * safe only because sep_upsample doesn't declare the input row group - * "consumed" until we are done color converting and emitting it. - */ - -METHODDEF(void) -fullsize_upsample (j_decompress_ptr cinfo, jpeg_component_info * compptr, - JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr) -{ - *output_data_ptr = input_data; -} - - -/* - * This is a no-op version used for "uninteresting" components. - * These components will not be referenced by color conversion. - */ - -METHODDEF(void) -noop_upsample (j_decompress_ptr cinfo, jpeg_component_info * compptr, - JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr) -{ - *output_data_ptr = NULL; /* safety check */ -} - - -/* - * This version handles any integral sampling ratios. - * This is not used for typical JPEG files, so it need not be fast. - * Nor, for that matter, is it particularly accurate: the algorithm is - * simple replication of the input pixel onto the corresponding output - * pixels. The hi-falutin sampling literature refers to this as a - * "box filter". A box filter tends to introduce visible artifacts, - * so if you are actually going to use 3:1 or 4:1 sampling ratios - * you would be well advised to improve this code. - */ - -METHODDEF(void) -int_upsample (j_decompress_ptr cinfo, jpeg_component_info * compptr, - JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr) -{ - my_upsample_ptr upsample = (my_upsample_ptr) cinfo->upsample; - JSAMPARRAY output_data = *output_data_ptr; - register JSAMPROW inptr, outptr; - register JSAMPLE invalue; - register int h; - JSAMPROW outend; - int h_expand, v_expand; - int inrow, outrow; - - h_expand = upsample->h_expand[compptr->component_index]; - v_expand = upsample->v_expand[compptr->component_index]; - - inrow = outrow = 0; - while (outrow < cinfo->max_v_samp_factor) { - /* Generate one output row with proper horizontal expansion */ - inptr = input_data[inrow]; - outptr = output_data[outrow]; - outend = outptr + cinfo->output_width; - while (outptr < outend) { - invalue = *inptr++; /* don't need GETJSAMPLE() here */ - for (h = h_expand; h > 0; h--) { - *outptr++ = invalue; - } - } - /* Generate any additional output rows by duplicating the first one */ - if (v_expand > 1) { - jcopy_sample_rows(output_data, outrow, output_data, outrow+1, - v_expand-1, cinfo->output_width); - } - inrow++; - outrow += v_expand; - } -} - - -/* - * Fast processing for the common case of 2:1 horizontal and 1:1 vertical. - * It's still a box filter. - */ - -METHODDEF(void) -h2v1_upsample (j_decompress_ptr cinfo, jpeg_component_info * compptr, - JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr) -{ - JSAMPARRAY output_data = *output_data_ptr; - register JSAMPROW inptr, outptr; - register JSAMPLE invalue; - JSAMPROW outend; - int inrow; - - for (inrow = 0; inrow < cinfo->max_v_samp_factor; inrow++) { - inptr = input_data[inrow]; - outptr = output_data[inrow]; - outend = outptr + cinfo->output_width; - while (outptr < outend) { - invalue = *inptr++; /* don't need GETJSAMPLE() here */ - *outptr++ = invalue; - *outptr++ = invalue; - } - } -} - - -/* - * Fast processing for the common case of 2:1 horizontal and 2:1 vertical. - * It's still a box filter. - */ - -METHODDEF(void) -h2v2_upsample (j_decompress_ptr cinfo, jpeg_component_info * compptr, - JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr) -{ - JSAMPARRAY output_data = *output_data_ptr; - register JSAMPROW inptr, outptr; - register JSAMPLE invalue; - JSAMPROW outend; - int inrow, outrow; - - inrow = outrow = 0; - while (outrow < cinfo->max_v_samp_factor) { - inptr = input_data[inrow]; - outptr = output_data[outrow]; - outend = outptr + cinfo->output_width; - while (outptr < outend) { - invalue = *inptr++; /* don't need GETJSAMPLE() here */ - *outptr++ = invalue; - *outptr++ = invalue; - } - jcopy_sample_rows(output_data, outrow, output_data, outrow+1, - 1, cinfo->output_width); - inrow++; - outrow += 2; - } -} - - -/* - * Fancy processing for the common case of 2:1 horizontal and 1:1 vertical. - * - * The upsampling algorithm is linear interpolation between pixel centers, - * also known as a "triangle filter". This is a good compromise between - * speed and visual quality. The centers of the output pixels are 1/4 and 3/4 - * of the way between input pixel centers. - * - * A note about the "bias" calculations: when rounding fractional values to - * integer, we do not want to always round 0.5 up to the next integer. - * If we did that, we'd introduce a noticeable bias towards larger values. - * Instead, this code is arranged so that 0.5 will be rounded up or down at - * alternate pixel locations (a simple ordered dither pattern). - */ - -METHODDEF(void) -h2v1_fancy_upsample (j_decompress_ptr cinfo, jpeg_component_info * compptr, - JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr) -{ - JSAMPARRAY output_data = *output_data_ptr; - register JSAMPROW inptr, outptr; - register int invalue; - register JDIMENSION colctr; - int inrow; - - for (inrow = 0; inrow < cinfo->max_v_samp_factor; inrow++) { - inptr = input_data[inrow]; - outptr = output_data[inrow]; - /* Special case for first column */ - invalue = GETJSAMPLE(*inptr++); - *outptr++ = (JSAMPLE) invalue; - *outptr++ = (JSAMPLE) ((invalue * 3 + GETJSAMPLE(*inptr) + 2) >> 2); - - for (colctr = compptr->downsampled_width - 2; colctr > 0; colctr--) { - /* General case: 3/4 * nearer pixel + 1/4 * further pixel */ - invalue = GETJSAMPLE(*inptr++) * 3; - *outptr++ = (JSAMPLE) ((invalue + GETJSAMPLE(inptr[-2]) + 1) >> 2); - *outptr++ = (JSAMPLE) ((invalue + GETJSAMPLE(*inptr) + 2) >> 2); - } - - /* Special case for last column */ - invalue = GETJSAMPLE(*inptr); - *outptr++ = (JSAMPLE) ((invalue * 3 + GETJSAMPLE(inptr[-1]) + 1) >> 2); - *outptr++ = (JSAMPLE) invalue; - } -} - - -/* - * Fancy processing for the common case of 2:1 horizontal and 2:1 vertical. - * Again a triangle filter; see comments for h2v1 case, above. - * - * It is OK for us to reference the adjacent input rows because we demanded - * context from the main buffer controller (see initialization code). - */ - -METHODDEF(void) -h2v2_fancy_upsample (j_decompress_ptr cinfo, jpeg_component_info * compptr, - JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr) -{ - JSAMPARRAY output_data = *output_data_ptr; - register JSAMPROW inptr0, inptr1, outptr; -#if BITS_IN_JSAMPLE == 8 - register int thiscolsum, lastcolsum, nextcolsum; -#else - register JPEG_INT32 thiscolsum, lastcolsum, nextcolsum; -#endif - register JDIMENSION colctr; - int inrow, outrow, v; - - inrow = outrow = 0; - while (outrow < cinfo->max_v_samp_factor) { - for (v = 0; v < 2; v++) { - /* inptr0 points to nearest input row, inptr1 points to next nearest */ - inptr0 = input_data[inrow]; - if (v == 0) /* next nearest is row above */ - inptr1 = input_data[inrow-1]; - else /* next nearest is row below */ - inptr1 = input_data[inrow+1]; - outptr = output_data[outrow++]; - - /* Special case for first column */ - thiscolsum = GETJSAMPLE(*inptr0++) * 3 + GETJSAMPLE(*inptr1++); - nextcolsum = GETJSAMPLE(*inptr0++) * 3 + GETJSAMPLE(*inptr1++); - *outptr++ = (JSAMPLE) ((thiscolsum * 4 + 8) >> 4); - *outptr++ = (JSAMPLE) ((thiscolsum * 3 + nextcolsum + 7) >> 4); - lastcolsum = thiscolsum; thiscolsum = nextcolsum; - - for (colctr = compptr->downsampled_width - 2; colctr > 0; colctr--) { - /* General case: 3/4 * nearer pixel + 1/4 * further pixel in each */ - /* dimension, thus 9/16, 3/16, 3/16, 1/16 overall */ - nextcolsum = GETJSAMPLE(*inptr0++) * 3 + GETJSAMPLE(*inptr1++); - *outptr++ = (JSAMPLE) ((thiscolsum * 3 + lastcolsum + 8) >> 4); - *outptr++ = (JSAMPLE) ((thiscolsum * 3 + nextcolsum + 7) >> 4); - lastcolsum = thiscolsum; thiscolsum = nextcolsum; - } - - /* Special case for last column */ - *outptr++ = (JSAMPLE) ((thiscolsum * 3 + lastcolsum + 8) >> 4); - *outptr++ = (JSAMPLE) ((thiscolsum * 4 + 7) >> 4); - } - inrow++; - } -} - - -/* - * Module initialization routine for upsampling. - */ - -GLOBAL(void) -jinit_upsampler (j_decompress_ptr cinfo) -{ - my_upsample_ptr upsample; - int ci; - jpeg_component_info * compptr; - wxjpeg_boolean need_buffer, do_fancy; - int h_in_group, v_in_group, h_out_group, v_out_group; - - upsample = (my_upsample_ptr) - (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, - SIZEOF(my_upsampler)); - cinfo->upsample = (struct jpeg_upsampler *) upsample; - upsample->pub.start_pass = start_pass_upsample; - upsample->pub.upsample = sep_upsample; - upsample->pub.need_context_rows = FALSE; /* until we find out differently */ - - if (cinfo->CCIR601_sampling) /* this isn't supported */ - ERREXIT(cinfo, JERR_CCIR601_NOTIMPL); - - /* jdmainct.c doesn't support context rows when min_DCT_scaled_size = 1, - * so don't ask for it. - */ - do_fancy = cinfo->do_fancy_upsampling && cinfo->min_DCT_scaled_size > 1; - - /* Verify we can handle the sampling factors, select per-component methods, - * and create storage as needed. - */ - for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; - ci++, compptr++) { - /* Compute size of an "input group" after IDCT scaling. This many samples - * are to be converted to max_h_samp_factor * max_v_samp_factor pixels. - */ - h_in_group = (compptr->h_samp_factor * compptr->DCT_scaled_size) / - cinfo->min_DCT_scaled_size; - v_in_group = (compptr->v_samp_factor * compptr->DCT_scaled_size) / - cinfo->min_DCT_scaled_size; - h_out_group = cinfo->max_h_samp_factor; - v_out_group = cinfo->max_v_samp_factor; - upsample->rowgroup_height[ci] = v_in_group; /* save for use later */ - need_buffer = TRUE; - if (! compptr->component_needed) { - /* Don't bother to upsample an uninteresting component. */ - upsample->methods[ci] = noop_upsample; - need_buffer = FALSE; - } else if (h_in_group == h_out_group && v_in_group == v_out_group) { - /* Fullsize components can be processed without any work. */ - upsample->methods[ci] = fullsize_upsample; - need_buffer = FALSE; - } else if (h_in_group * 2 == h_out_group && - v_in_group == v_out_group) { - /* Special cases for 2h1v upsampling */ - if (do_fancy && compptr->downsampled_width > 2) - upsample->methods[ci] = h2v1_fancy_upsample; - else - upsample->methods[ci] = h2v1_upsample; - } else if (h_in_group * 2 == h_out_group && - v_in_group * 2 == v_out_group) { - /* Special cases for 2h2v upsampling */ - if (do_fancy && compptr->downsampled_width > 2) { - upsample->methods[ci] = h2v2_fancy_upsample; - upsample->pub.need_context_rows = TRUE; - } else - upsample->methods[ci] = h2v2_upsample; - } else if ((h_out_group % h_in_group) == 0 && - (v_out_group % v_in_group) == 0) { - /* Generic integral-factors upsampling method */ - upsample->methods[ci] = int_upsample; - upsample->h_expand[ci] = (UINT8) (h_out_group / h_in_group); - upsample->v_expand[ci] = (UINT8) (v_out_group / v_in_group); - } else - ERREXIT(cinfo, JERR_FRACT_SAMPLE_NOTIMPL); - if (need_buffer) { - upsample->color_buf[ci] = (*cinfo->mem->alloc_sarray) - ((j_common_ptr) cinfo, JPOOL_IMAGE, - (JDIMENSION) jround_up((long) cinfo->output_width, - (long) cinfo->max_h_samp_factor), - (JDIMENSION) cinfo->max_v_samp_factor); - } - } -} diff --git a/wxWidgets/src/jpeg/jdtrans.c b/wxWidgets/src/jpeg/jdtrans.c deleted file mode 100644 index d22388684f..0000000000 --- a/wxWidgets/src/jpeg/jdtrans.c +++ /dev/null @@ -1,143 +0,0 @@ -/* - * jdtrans.c - * - * Copyright (C) 1995-1997, Thomas G. Lane. - * This file is part of the Independent JPEG Group's software. - * For conditions of distribution and use, see the accompanying README file. - * - * This file contains library routines for transcoding decompression, - * that is, reading raw DCT coefficient arrays from an input JPEG file. - * The routines in jdapimin.c will also be needed by a transcoder. - */ - -#define JPEG_INTERNALS -#include "jinclude.h" -#include "jpeglib.h" - - -/* Forward declarations */ -LOCAL(void) transdecode_master_selection JPP((j_decompress_ptr cinfo)); - - -/* - * Read the coefficient arrays from a JPEG file. - * jpeg_read_header must be completed before calling this. - * - * The entire image is read into a set of virtual coefficient-block arrays, - * one per component. The return value is a pointer to the array of - * virtual-array descriptors. These can be manipulated directly via the - * JPEG memory manager, or handed off to jpeg_write_coefficients(). - * To release the memory occupied by the virtual arrays, call - * jpeg_finish_decompress() when done with the data. - * - * An alternative usage is to simply obtain access to the coefficient arrays - * during a buffered-image-mode decompression operation. This is allowed - * after any jpeg_finish_output() call. The arrays can be accessed until - * jpeg_finish_decompress() is called. (Note that any call to the library - * may reposition the arrays, so don't rely on access_virt_barray() results - * to stay valid across library calls.) - * - * Returns NULL if suspended. This case need be checked only if - * a suspending data source is used. - */ - -GLOBAL(jvirt_barray_ptr *) -jpeg_read_coefficients (j_decompress_ptr cinfo) -{ - if (cinfo->global_state == DSTATE_READY) { - /* First call: initialize active modules */ - transdecode_master_selection(cinfo); - cinfo->global_state = DSTATE_RDCOEFS; - } - if (cinfo->global_state == DSTATE_RDCOEFS) { - /* Absorb whole file into the coef buffer */ - for (;;) { - int retcode; - /* Call progress monitor hook if present */ - if (cinfo->progress != NULL) - (*cinfo->progress->progress_monitor) ((j_common_ptr) cinfo); - /* Absorb some more input */ - retcode = (*cinfo->inputctl->consume_input) (cinfo); - if (retcode == JPEG_SUSPENDED) - return NULL; - if (retcode == JPEG_REACHED_EOI) - break; - /* Advance progress counter if appropriate */ - if (cinfo->progress != NULL && - (retcode == JPEG_ROW_COMPLETED || retcode == JPEG_REACHED_SOS)) { - if (++cinfo->progress->pass_counter >= cinfo->progress->pass_limit) { - /* startup underestimated number of scans; ratchet up one scan */ - cinfo->progress->pass_limit += (long) cinfo->total_iMCU_rows; - } - } - } - /* Set state so that jpeg_finish_decompress does the right thing */ - cinfo->global_state = DSTATE_STOPPING; - } - /* At this point we should be in state DSTATE_STOPPING if being used - * standalone, or in state DSTATE_BUFIMAGE if being invoked to get access - * to the coefficients during a full buffered-image-mode decompression. - */ - if ((cinfo->global_state == DSTATE_STOPPING || - cinfo->global_state == DSTATE_BUFIMAGE) && cinfo->buffered_image) { - return cinfo->coef->coef_arrays; - } - /* Oops, improper usage */ - ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state); - return NULL; /* keep compiler happy */ -} - - -/* - * Master selection of decompression modules for transcoding. - * This substitutes for jdmaster.c's initialization of the full decompressor. - */ - -LOCAL(void) -transdecode_master_selection (j_decompress_ptr cinfo) -{ - /* This is effectively a buffered-image operation. */ - cinfo->buffered_image = TRUE; - - /* Entropy decoding: either Huffman or arithmetic coding. */ - if (cinfo->arith_code) { - ERREXIT(cinfo, JERR_ARITH_NOTIMPL); - } else { - if (cinfo->progressive_mode) { -#ifdef D_PROGRESSIVE_SUPPORTED - jinit_phuff_decoder(cinfo); -#else - ERREXIT(cinfo, JERR_NOT_COMPILED); -#endif - } else - jinit_huff_decoder(cinfo); - } - - /* Always get a full-image coefficient buffer. */ - jinit_d_coef_controller(cinfo, TRUE); - - /* We can now tell the memory manager to allocate virtual arrays. */ - (*cinfo->mem->realize_virt_arrays) ((j_common_ptr) cinfo); - - /* Initialize input side of decompressor to consume first scan. */ - (*cinfo->inputctl->start_input_pass) (cinfo); - /* Initialize progress monitoring. */ - if (cinfo->progress != NULL) { - int nscans; - /* Estimate number of scans to set pass_limit. */ - if (cinfo->progressive_mode) { - /* Arbitrarily estimate 2 interleaved DC scans + 3 AC scans/component. */ - nscans = 2 + 3 * cinfo->num_components; - } else if (cinfo->inputctl->has_multiple_scans) { - /* For a nonprogressive multiscan file, estimate 1 scan per component. */ - nscans = cinfo->num_components; - } else { - nscans = 1; - } - cinfo->progress->pass_counter = 0L; - cinfo->progress->pass_limit = (long) cinfo->total_iMCU_rows * nscans; - cinfo->progress->completed_passes = 0; - cinfo->progress->total_passes = 1; - } -} - diff --git a/wxWidgets/src/jpeg/jerror.c b/wxWidgets/src/jpeg/jerror.c deleted file mode 100644 index 660c4a6dd8..0000000000 --- a/wxWidgets/src/jpeg/jerror.c +++ /dev/null @@ -1,252 +0,0 @@ -/* - * jerror.c - * - * Copyright (C) 1991-1998, Thomas G. Lane. - * This file is part of the Independent JPEG Group's software. - * For conditions of distribution and use, see the accompanying README file. - * - * This file contains simple error-reporting and trace-message routines. - * These are suitable for Unix-like systems and others where writing to - * stderr is the right thing to do. Many applications will want to replace - * some or all of these routines. - * - * If you define USE_WINDOWS_MESSAGEBOX in jconfig.h or in the makefile, - * you get a Windows-specific hack to display error messages in a dialog box. - * It ain't much, but it beats dropping error messages into the bit bucket, - * which is what happens to output to stderr under most Windows C compilers. - * - * These routines are used by both the compression and decompression code. - */ - -/* this is not a core library module, so it doesn't define JPEG_INTERNALS */ -#include "jinclude.h" -#include "jpeglib.h" -#include "jversion.h" -#include "jerror.h" - -#ifdef USE_WINDOWS_MESSAGEBOX -#include -#endif - -#ifndef EXIT_FAILURE /* define exit() codes if not provided */ -#define EXIT_FAILURE 1 -#endif - - -/* - * Create the message string table. - * We do this from the master message list in jerror.h by re-reading - * jerror.h with a suitable definition for macro JMESSAGE. - * The message table is made an external symbol just in case any applications - * want to refer to it directly. - */ - -#ifdef NEED_SHORT_EXTERNAL_NAMES -#define jpeg_std_message_table jMsgTable -#endif - -#define JMESSAGE(code,string) string , - -const char * const jpeg_std_message_table[] = { -#include "jerror.h" - NULL -}; - - -/* - * Error exit handler: must not return to caller. - * - * Applications may override this if they want to get control back after - * an error. Typically one would longjmp somewhere instead of exiting. - * The setjmp buffer can be made a private field within an expanded error - * handler object. Note that the info needed to generate an error message - * is stored in the error object, so you can generate the message now or - * later, at your convenience. - * You should make sure that the JPEG object is cleaned up (with jpeg_abort - * or jpeg_destroy) at some point. - */ - -METHODDEF(void) -error_exit (j_common_ptr cinfo) -{ - /* Always display the message */ - (*cinfo->err->output_message) (cinfo); - - /* Let the memory manager delete any temp files before we die */ - jpeg_destroy(cinfo); - - exit(EXIT_FAILURE); -} - - -/* - * Actual output of an error or trace message. - * Applications may override this method to send JPEG messages somewhere - * other than stderr. - * - * On Windows, printing to stderr is generally completely useless, - * so we provide optional code to produce an error-dialog popup. - * Most Windows applications will still prefer to override this routine, - * but if they don't, it'll do something at least marginally useful. - * - * NOTE: to use the library in an environment that doesn't support the - * C stdio library, you may have to delete the call to fprintf() entirely, - * not just not use this routine. - */ - -METHODDEF(void) -output_message (j_common_ptr cinfo) -{ - char buffer[JMSG_LENGTH_MAX]; - - /* Create the message */ - (*cinfo->err->format_message) (cinfo, buffer); - -#ifdef USE_WINDOWS_MESSAGEBOX - /* Display it in a message dialog box */ - MessageBox(GetActiveWindow(), buffer, "JPEG Library Error", - MB_OK | MB_ICONERROR); -#else - /* Send it to stderr, adding a newline */ - fprintf(stderr, "%s\n", buffer); -#endif -} - - -/* - * Decide whether to emit a trace or warning message. - * msg_level is one of: - * -1: recoverable corrupt-data warning, may want to abort. - * 0: important advisory messages (always display to user). - * 1: first level of tracing detail. - * 2,3,...: successively more detailed tracing messages. - * An application might override this method if it wanted to abort on warnings - * or change the policy about which messages to display. - */ - -METHODDEF(void) -emit_message (j_common_ptr cinfo, int msg_level) -{ - struct jpeg_error_mgr * err = cinfo->err; - - if (msg_level < 0) { - /* It's a warning message. Since corrupt files may generate many warnings, - * the policy implemented here is to show only the first warning, - * unless trace_level >= 3. - */ - if (err->num_warnings == 0 || err->trace_level >= 3) - (*err->output_message) (cinfo); - /* Always count warnings in num_warnings. */ - err->num_warnings++; - } else { - /* It's a trace message. Show it if trace_level >= msg_level. */ - if (err->trace_level >= msg_level) - (*err->output_message) (cinfo); - } -} - - -/* - * Format a message string for the most recent JPEG error or message. - * The message is stored into buffer, which should be at least JMSG_LENGTH_MAX - * characters. Note that no '\n' character is added to the string. - * Few applications should need to override this method. - */ - -METHODDEF(void) -format_message (j_common_ptr cinfo, char * buffer) -{ - struct jpeg_error_mgr * err = cinfo->err; - int msg_code = err->msg_code; - const char * msgtext = NULL; - const char * msgptr; - char ch; - wxjpeg_boolean isstring; - - /* Look up message string in proper table */ - if (msg_code > 0 && msg_code <= err->last_jpeg_message) { - msgtext = err->jpeg_message_table[msg_code]; - } else if (err->addon_message_table != NULL && - msg_code >= err->first_addon_message && - msg_code <= err->last_addon_message) { - msgtext = err->addon_message_table[msg_code - err->first_addon_message]; - } - - /* Defend against bogus message number */ - if (msgtext == NULL) { - err->msg_parm.i[0] = msg_code; - msgtext = err->jpeg_message_table[0]; - } - - /* Check for string parameter, as indicated by %s in the message text */ - isstring = FALSE; - msgptr = msgtext; - while ((ch = *msgptr++) != '\0') { - if (ch == '%') { - if (*msgptr == 's') isstring = TRUE; - break; - } - } - - /* Format the message into the passed buffer */ - if (isstring) - sprintf(buffer, msgtext, err->msg_parm.s); - else - sprintf(buffer, msgtext, - err->msg_parm.i[0], err->msg_parm.i[1], - err->msg_parm.i[2], err->msg_parm.i[3], - err->msg_parm.i[4], err->msg_parm.i[5], - err->msg_parm.i[6], err->msg_parm.i[7]); -} - - -/* - * Reset error state variables at start of a new image. - * This is called during compression startup to reset trace/error - * processing to default state, without losing any application-specific - * method pointers. An application might possibly want to override - * this method if it has additional error processing state. - */ - -METHODDEF(void) -reset_error_mgr (j_common_ptr cinfo) -{ - cinfo->err->num_warnings = 0; - /* trace_level is not reset since it is an application-supplied parameter */ - cinfo->err->msg_code = 0; /* may be useful as a flag for "no error" */ -} - - -/* - * Fill in the standard error-handling methods in a jpeg_error_mgr object. - * Typical call is: - * struct jpeg_compress_struct cinfo; - * struct jpeg_error_mgr err; - * - * cinfo.err = jpeg_std_error(&err); - * after which the application may override some of the methods. - */ - -GLOBAL(struct jpeg_error_mgr *) -jpeg_std_error (struct jpeg_error_mgr * err) -{ - err->error_exit = error_exit; - err->emit_message = emit_message; - err->output_message = output_message; - err->format_message = format_message; - err->reset_error_mgr = reset_error_mgr; - - err->trace_level = 0; /* default = no tracing */ - err->num_warnings = 0; /* no warnings emitted yet */ - err->msg_code = 0; /* may be useful as a flag for "no error" */ - - /* Initialize message table pointers */ - err->jpeg_message_table = jpeg_std_message_table; - err->last_jpeg_message = (int) JMSG_LASTMSGCODE - 1; - - err->addon_message_table = NULL; - err->first_addon_message = 0; /* for safety */ - err->last_addon_message = 0; - - return err; -} diff --git a/wxWidgets/src/jpeg/jerror.h b/wxWidgets/src/jpeg/jerror.h deleted file mode 100644 index fc2fffeac2..0000000000 --- a/wxWidgets/src/jpeg/jerror.h +++ /dev/null @@ -1,291 +0,0 @@ -/* - * jerror.h - * - * Copyright (C) 1994-1997, Thomas G. Lane. - * This file is part of the Independent JPEG Group's software. - * For conditions of distribution and use, see the accompanying README file. - * - * This file defines the error and message codes for the JPEG library. - * Edit this file to add new codes, or to translate the message strings to - * some other language. - * A set of error-reporting macros are defined too. Some applications using - * the JPEG library may wish to include this file to get the error codes - * and/or the macros. - */ - -/* - * To define the enum list of message codes, include this file without - * defining macro JMESSAGE. To create a message string table, include it - * again with a suitable JMESSAGE definition (see jerror.c for an example). - */ -#ifndef JMESSAGE -#ifndef JERROR_H -/* First time through, define the enum list */ -#define JMAKE_ENUM_LIST -#else -/* Repeated inclusions of this file are no-ops unless JMESSAGE is defined */ -#define JMESSAGE(code,string) -#endif /* JERROR_H */ -#endif /* JMESSAGE */ - -#ifdef JMAKE_ENUM_LIST - -typedef enum { - -#define JMESSAGE(code,string) code , - -#endif /* JMAKE_ENUM_LIST */ - -JMESSAGE(JMSG_NOMESSAGE, "Bogus message code %d") /* Must be first entry! */ - -/* For maintenance convenience, list is alphabetical by message code name */ -JMESSAGE(JERR_ARITH_NOTIMPL, - "Sorry, there are legal restrictions on arithmetic coding") -JMESSAGE(JERR_BAD_ALIGN_TYPE, "ALIGN_TYPE is wrong, please fix") -JMESSAGE(JERR_BAD_ALLOC_CHUNK, "MAX_ALLOC_CHUNK is wrong, please fix") -JMESSAGE(JERR_BAD_BUFFER_MODE, "Bogus buffer control mode") -JMESSAGE(JERR_BAD_COMPONENT_ID, "Invalid component ID %d in SOS") -JMESSAGE(JERR_BAD_DCT_COEF, "DCT coefficient out of range") -JMESSAGE(JERR_BAD_DCTSIZE, "IDCT output block size %d not supported") -JMESSAGE(JERR_BAD_HUFF_TABLE, "Bogus Huffman table definition") -JMESSAGE(JERR_BAD_IN_COLORSPACE, "Bogus input colorspace") -JMESSAGE(JERR_BAD_J_COLORSPACE, "Bogus JPEG colorspace") -JMESSAGE(JERR_BAD_LENGTH, "Bogus marker length") -JMESSAGE(JERR_BAD_LIB_VERSION, - "Wrong JPEG library version: library is %d, caller expects %d") -JMESSAGE(JERR_BAD_MCU_SIZE, "Sampling factors too large for interleaved scan") -JMESSAGE(JERR_BAD_POOL_ID, "Invalid memory pool code %d") -JMESSAGE(JERR_BAD_PRECISION, "Unsupported JPEG data precision %d") -JMESSAGE(JERR_BAD_PROGRESSION, - "Invalid progressive parameters Ss=%d Se=%d Ah=%d Al=%d") -JMESSAGE(JERR_BAD_PROG_SCRIPT, - "Invalid progressive parameters at scan script entry %d") -JMESSAGE(JERR_BAD_SAMPLING, "Bogus sampling factors") -JMESSAGE(JERR_BAD_SCAN_SCRIPT, "Invalid scan script at entry %d") -JMESSAGE(JERR_BAD_STATE, "Improper call to JPEG library in state %d") -JMESSAGE(JERR_BAD_STRUCT_SIZE, - "JPEG parameter struct mismatch: library thinks size is %u, caller expects %u") -JMESSAGE(JERR_BAD_VIRTUAL_ACCESS, "Bogus virtual array access") -JMESSAGE(JERR_BUFFER_SIZE, "Buffer passed to JPEG library is too small") -JMESSAGE(JERR_CANT_SUSPEND, "Suspension not allowed here") -JMESSAGE(JERR_CCIR601_NOTIMPL, "CCIR601 sampling not implemented yet") -JMESSAGE(JERR_COMPONENT_COUNT, "Too many color components: %d, max %d") -JMESSAGE(JERR_CONVERSION_NOTIMPL, "Unsupported color conversion request") -JMESSAGE(JERR_DAC_INDEX, "Bogus DAC index %d") -JMESSAGE(JERR_DAC_VALUE, "Bogus DAC value 0x%x") -JMESSAGE(JERR_DHT_INDEX, "Bogus DHT index %d") -JMESSAGE(JERR_DQT_INDEX, "Bogus DQT index %d") -JMESSAGE(JERR_EMPTY_IMAGE, "Empty JPEG image (DNL not supported)") -JMESSAGE(JERR_EMS_READ, "Read from EMS failed") -JMESSAGE(JERR_EMS_WRITE, "Write to EMS failed") -JMESSAGE(JERR_EOI_EXPECTED, "Didn't expect more than one scan") -JMESSAGE(JERR_FILE_READ, "Input file read error") -JMESSAGE(JERR_FILE_WRITE, "Output file write error --- out of disk space?") -JMESSAGE(JERR_FRACT_SAMPLE_NOTIMPL, "Fractional sampling not implemented yet") -JMESSAGE(JERR_HUFF_CLEN_OVERFLOW, "Huffman code size table overflow") -JMESSAGE(JERR_HUFF_MISSING_CODE, "Missing Huffman code table entry") -JMESSAGE(JERR_IMAGE_TOO_BIG, "Maximum supported image dimension is %u pixels") -JMESSAGE(JERR_INPUT_EMPTY, "Empty input file") -JMESSAGE(JERR_INPUT_EOF, "Premature end of input file") -JMESSAGE(JERR_MISMATCHED_QUANT_TABLE, - "Cannot transcode due to multiple use of quantization table %d") -JMESSAGE(JERR_MISSING_DATA, "Scan script does not transmit all data") -JMESSAGE(JERR_MODE_CHANGE, "Invalid color quantization mode change") -JMESSAGE(JERR_NOTIMPL, "Not implemented yet") -JMESSAGE(JERR_NOT_COMPILED, "Requested feature was omitted at compile time") -JMESSAGE(JERR_NO_BACKING_STORE, "Backing store not supported") -JMESSAGE(JERR_NO_HUFF_TABLE, "Huffman table 0x%02x was not defined") -JMESSAGE(JERR_NO_IMAGE, "JPEG datastream contains no image") -JMESSAGE(JERR_NO_QUANT_TABLE, "Quantization table 0x%02x was not defined") -JMESSAGE(JERR_NO_SOI, "Not a JPEG file: starts with 0x%02x 0x%02x") -JMESSAGE(JERR_OUT_OF_MEMORY, "Insufficient memory (case %d)") -JMESSAGE(JERR_QUANT_COMPONENTS, - "Cannot quantize more than %d color components") -JMESSAGE(JERR_QUANT_FEW_COLORS, "Cannot quantize to fewer than %d colors") -JMESSAGE(JERR_QUANT_MANY_COLORS, "Cannot quantize to more than %d colors") -JMESSAGE(JERR_SOF_DUPLICATE, "Invalid JPEG file structure: two SOF markers") -JMESSAGE(JERR_SOF_NO_SOS, "Invalid JPEG file structure: missing SOS marker") -JMESSAGE(JERR_SOF_UNSUPPORTED, "Unsupported JPEG process: SOF type 0x%02x") -JMESSAGE(JERR_SOI_DUPLICATE, "Invalid JPEG file structure: two SOI markers") -JMESSAGE(JERR_SOS_NO_SOF, "Invalid JPEG file structure: SOS before SOF") -JMESSAGE(JERR_TFILE_CREATE, "Failed to create temporary file %s") -JMESSAGE(JERR_TFILE_READ, "Read failed on temporary file") -JMESSAGE(JERR_TFILE_SEEK, "Seek failed on temporary file") -JMESSAGE(JERR_TFILE_WRITE, - "Write failed on temporary file --- out of disk space?") -JMESSAGE(JERR_TOO_LITTLE_DATA, "Application transferred too few scanlines") -JMESSAGE(JERR_UNKNOWN_MARKER, "Unsupported marker type 0x%02x") -JMESSAGE(JERR_VIRTUAL_BUG, "Virtual array controller messed up") -JMESSAGE(JERR_WIDTH_OVERFLOW, "Image too wide for this implementation") -JMESSAGE(JERR_XMS_READ, "Read from XMS failed") -JMESSAGE(JERR_XMS_WRITE, "Write to XMS failed") -JMESSAGE(JMSG_COPYRIGHT, JCOPYRIGHT) -JMESSAGE(JMSG_VERSION, JVERSION) -JMESSAGE(JTRC_16BIT_TABLES, - "Caution: quantization tables are too coarse for baseline JPEG") -JMESSAGE(JTRC_ADOBE, - "Adobe APP14 marker: version %d, flags 0x%04x 0x%04x, transform %d") -JMESSAGE(JTRC_APP0, "Unknown APP0 marker (not JFIF), length %u") -JMESSAGE(JTRC_APP14, "Unknown APP14 marker (not Adobe), length %u") -JMESSAGE(JTRC_DAC, "Define Arithmetic Table 0x%02x: 0x%02x") -JMESSAGE(JTRC_DHT, "Define Huffman Table 0x%02x") -JMESSAGE(JTRC_DQT, "Define Quantization Table %d precision %d") -JMESSAGE(JTRC_DRI, "Define Restart Interval %u") -JMESSAGE(JTRC_EMS_CLOSE, "Freed EMS handle %u") -JMESSAGE(JTRC_EMS_OPEN, "Obtained EMS handle %u") -JMESSAGE(JTRC_EOI, "End Of Image") -JMESSAGE(JTRC_HUFFBITS, " %3d %3d %3d %3d %3d %3d %3d %3d") -JMESSAGE(JTRC_JFIF, "JFIF APP0 marker: version %d.%02d, density %dx%d %d") -JMESSAGE(JTRC_JFIF_BADTHUMBNAILSIZE, - "Warning: thumbnail image size does not match data length %u") -JMESSAGE(JTRC_JFIF_EXTENSION, - "JFIF extension marker: type 0x%02x, length %u") -JMESSAGE(JTRC_JFIF_THUMBNAIL, " with %d x %d thumbnail image") -JMESSAGE(JTRC_MISC_MARKER, "Miscellaneous marker 0x%02x, length %u") -JMESSAGE(JTRC_PARMLESS_MARKER, "Unexpected marker 0x%02x") -JMESSAGE(JTRC_QUANTVALS, " %4u %4u %4u %4u %4u %4u %4u %4u") -JMESSAGE(JTRC_QUANT_3_NCOLORS, "Quantizing to %d = %d*%d*%d colors") -JMESSAGE(JTRC_QUANT_NCOLORS, "Quantizing to %d colors") -JMESSAGE(JTRC_QUANT_SELECTED, "Selected %d colors for quantization") -JMESSAGE(JTRC_RECOVERY_ACTION, "At marker 0x%02x, recovery action %d") -JMESSAGE(JTRC_RST, "RST%d") -JMESSAGE(JTRC_SMOOTH_NOTIMPL, - "Smoothing not supported with nonstandard sampling ratios") -JMESSAGE(JTRC_SOF, "Start Of Frame 0x%02x: width=%u, height=%u, components=%d") -JMESSAGE(JTRC_SOF_COMPONENT, " Component %d: %dhx%dv q=%d") -JMESSAGE(JTRC_SOI, "Start of Image") -JMESSAGE(JTRC_SOS, "Start Of Scan: %d components") -JMESSAGE(JTRC_SOS_COMPONENT, " Component %d: dc=%d ac=%d") -JMESSAGE(JTRC_SOS_PARAMS, " Ss=%d, Se=%d, Ah=%d, Al=%d") -JMESSAGE(JTRC_TFILE_CLOSE, "Closed temporary file %s") -JMESSAGE(JTRC_TFILE_OPEN, "Opened temporary file %s") -JMESSAGE(JTRC_THUMB_JPEG, - "JFIF extension marker: JPEG-compressed thumbnail image, length %u") -JMESSAGE(JTRC_THUMB_PALETTE, - "JFIF extension marker: palette thumbnail image, length %u") -JMESSAGE(JTRC_THUMB_RGB, - "JFIF extension marker: RGB thumbnail image, length %u") -JMESSAGE(JTRC_UNKNOWN_IDS, - "Unrecognized component IDs %d %d %d, assuming YCbCr") -JMESSAGE(JTRC_XMS_CLOSE, "Freed XMS handle %u") -JMESSAGE(JTRC_XMS_OPEN, "Obtained XMS handle %u") -JMESSAGE(JWRN_ADOBE_XFORM, "Unknown Adobe color transform code %d") -JMESSAGE(JWRN_BOGUS_PROGRESSION, - "Inconsistent progression sequence for component %d coefficient %d") -JMESSAGE(JWRN_EXTRANEOUS_DATA, - "Corrupt JPEG data: %u extraneous bytes before marker 0x%02x") -JMESSAGE(JWRN_HIT_MARKER, "Corrupt JPEG data: premature end of data segment") -JMESSAGE(JWRN_HUFF_BAD_CODE, "Corrupt JPEG data: bad Huffman code") -JMESSAGE(JWRN_JFIF_MAJOR, "Warning: unknown JFIF revision number %d.%02d") -JMESSAGE(JWRN_JPEG_EOF, "Premature end of JPEG file") -JMESSAGE(JWRN_MUST_RESYNC, - "Corrupt JPEG data: found marker 0x%02x instead of RST%d") -JMESSAGE(JWRN_NOT_SEQUENTIAL, "Invalid SOS parameters for sequential JPEG") -JMESSAGE(JWRN_TOO_MUCH_DATA, "Application transferred too many scanlines") - -#ifdef JMAKE_ENUM_LIST - - JMSG_LASTMSGCODE -} J_MESSAGE_CODE; - -#undef JMAKE_ENUM_LIST -#endif /* JMAKE_ENUM_LIST */ - -/* Zap JMESSAGE macro so that future re-inclusions do nothing by default */ -#undef JMESSAGE - - -#ifndef JERROR_H -#define JERROR_H - -/* Macros to simplify using the error and trace message stuff */ -/* The first parameter is either type of cinfo pointer */ - -/* Fatal errors (print message and exit) */ -#define ERREXIT(cinfo,code) \ - ((cinfo)->err->msg_code = (code), \ - (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo))) -#define ERREXIT1(cinfo,code,p1) \ - ((cinfo)->err->msg_code = (code), \ - (cinfo)->err->msg_parm.i[0] = (p1), \ - (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo))) -#define ERREXIT2(cinfo,code,p1,p2) \ - ((cinfo)->err->msg_code = (code), \ - (cinfo)->err->msg_parm.i[0] = (p1), \ - (cinfo)->err->msg_parm.i[1] = (p2), \ - (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo))) -#define ERREXIT3(cinfo,code,p1,p2,p3) \ - ((cinfo)->err->msg_code = (code), \ - (cinfo)->err->msg_parm.i[0] = (p1), \ - (cinfo)->err->msg_parm.i[1] = (p2), \ - (cinfo)->err->msg_parm.i[2] = (p3), \ - (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo))) -#define ERREXIT4(cinfo,code,p1,p2,p3,p4) \ - ((cinfo)->err->msg_code = (code), \ - (cinfo)->err->msg_parm.i[0] = (p1), \ - (cinfo)->err->msg_parm.i[1] = (p2), \ - (cinfo)->err->msg_parm.i[2] = (p3), \ - (cinfo)->err->msg_parm.i[3] = (p4), \ - (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo))) -#define ERREXITS(cinfo,code,str) \ - ((cinfo)->err->msg_code = (code), \ - strncpy((cinfo)->err->msg_parm.s, (str), JMSG_STR_PARM_MAX), \ - (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo))) - -#define MAKESTMT(stuff) do { stuff } while (0) - -/* Nonfatal errors (we can keep going, but the data is probably corrupt) */ -#define WARNMS(cinfo,code) \ - ((cinfo)->err->msg_code = (code), \ - (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), -1)) -#define WARNMS1(cinfo,code,p1) \ - ((cinfo)->err->msg_code = (code), \ - (cinfo)->err->msg_parm.i[0] = (p1), \ - (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), -1)) -#define WARNMS2(cinfo,code,p1,p2) \ - ((cinfo)->err->msg_code = (code), \ - (cinfo)->err->msg_parm.i[0] = (p1), \ - (cinfo)->err->msg_parm.i[1] = (p2), \ - (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), -1)) - -/* Informational/debugging messages */ -#define TRACEMS(cinfo,lvl,code) \ - ((cinfo)->err->msg_code = (code), \ - (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl))) -#define TRACEMS1(cinfo,lvl,code,p1) \ - ((cinfo)->err->msg_code = (code), \ - (cinfo)->err->msg_parm.i[0] = (p1), \ - (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl))) -#define TRACEMS2(cinfo,lvl,code,p1,p2) \ - ((cinfo)->err->msg_code = (code), \ - (cinfo)->err->msg_parm.i[0] = (p1), \ - (cinfo)->err->msg_parm.i[1] = (p2), \ - (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl))) -#define TRACEMS3(cinfo,lvl,code,p1,p2,p3) \ - MAKESTMT(int * _mp = (cinfo)->err->msg_parm.i; \ - _mp[0] = (p1); _mp[1] = (p2); _mp[2] = (p3); \ - (cinfo)->err->msg_code = (code); \ - (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)); ) -#define TRACEMS4(cinfo,lvl,code,p1,p2,p3,p4) \ - MAKESTMT(int * _mp = (cinfo)->err->msg_parm.i; \ - _mp[0] = (p1); _mp[1] = (p2); _mp[2] = (p3); _mp[3] = (p4); \ - (cinfo)->err->msg_code = (code); \ - (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)); ) -#define TRACEMS5(cinfo,lvl,code,p1,p2,p3,p4,p5) \ - MAKESTMT(int * _mp = (cinfo)->err->msg_parm.i; \ - _mp[0] = (p1); _mp[1] = (p2); _mp[2] = (p3); _mp[3] = (p4); \ - _mp[4] = (p5); \ - (cinfo)->err->msg_code = (code); \ - (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)); ) -#define TRACEMS8(cinfo,lvl,code,p1,p2,p3,p4,p5,p6,p7,p8) \ - MAKESTMT(int * _mp = (cinfo)->err->msg_parm.i; \ - _mp[0] = (p1); _mp[1] = (p2); _mp[2] = (p3); _mp[3] = (p4); \ - _mp[4] = (p5); _mp[5] = (p6); _mp[6] = (p7); _mp[7] = (p8); \ - (cinfo)->err->msg_code = (code); \ - (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)); ) -#define TRACEMSS(cinfo,lvl,code,str) \ - ((cinfo)->err->msg_code = (code), \ - strncpy((cinfo)->err->msg_parm.s, (str), JMSG_STR_PARM_MAX), \ - (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl))) - -#endif /* JERROR_H */ diff --git a/wxWidgets/src/jpeg/jfdctflt.c b/wxWidgets/src/jpeg/jfdctflt.c deleted file mode 100644 index 79d7a00787..0000000000 --- a/wxWidgets/src/jpeg/jfdctflt.c +++ /dev/null @@ -1,168 +0,0 @@ -/* - * jfdctflt.c - * - * Copyright (C) 1994-1996, Thomas G. Lane. - * This file is part of the Independent JPEG Group's software. - * For conditions of distribution and use, see the accompanying README file. - * - * This file contains a floating-point implementation of the - * forward DCT (Discrete Cosine Transform). - * - * This implementation should be more accurate than either of the integer - * DCT implementations. However, it may not give the same results on all - * machines because of differences in roundoff behavior. Speed will depend - * on the hardware's floating point capacity. - * - * A 2-D DCT can be done by 1-D DCT on each row followed by 1-D DCT - * on each column. Direct algorithms are also available, but they are - * much more complex and seem not to be any faster when reduced to code. - * - * This implementation is based on Arai, Agui, and Nakajima's algorithm for - * scaled DCT. Their original paper (Trans. IEICE E-71(11):1095) is in - * Japanese, but the algorithm is described in the Pennebaker & Mitchell - * JPEG textbook (see REFERENCES section in file README). The following code - * is based directly on figure 4-8 in P&M. - * While an 8-point DCT cannot be done in less than 11 multiplies, it is - * possible to arrange the computation so that many of the multiplies are - * simple scalings of the final outputs. These multiplies can then be - * folded into the multiplications or divisions by the JPEG quantization - * table entries. The AA&N method leaves only 5 multiplies and 29 adds - * to be done in the DCT itself. - * The primary disadvantage of this method is that with a fixed-point - * implementation, accuracy is lost due to imprecise representation of the - * scaled quantization values. However, that problem does not arise if - * we use floating point arithmetic. - */ - -#define JPEG_INTERNALS -#include "jinclude.h" -#include "jpeglib.h" -#include "jdct.h" /* Private declarations for DCT subsystem */ - -#ifdef DCT_FLOAT_SUPPORTED - - -/* - * This module is specialized to the case DCTSIZE = 8. - */ - -#if DCTSIZE != 8 - Sorry, this code only copes with 8x8 DCTs. /* deliberate syntax err */ -#endif - - -/* - * Perform the forward DCT on one block of samples. - */ - -GLOBAL(void) -jpeg_fdct_float (FAST_FLOAT * data) -{ - FAST_FLOAT tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7; - FAST_FLOAT tmp10, tmp11, tmp12, tmp13; - FAST_FLOAT z1, z2, z3, z4, z5, z11, z13; - FAST_FLOAT *dataptr; - int ctr; - - /* Pass 1: process rows. */ - - dataptr = data; - for (ctr = DCTSIZE-1; ctr >= 0; ctr--) { - tmp0 = dataptr[0] + dataptr[7]; - tmp7 = dataptr[0] - dataptr[7]; - tmp1 = dataptr[1] + dataptr[6]; - tmp6 = dataptr[1] - dataptr[6]; - tmp2 = dataptr[2] + dataptr[5]; - tmp5 = dataptr[2] - dataptr[5]; - tmp3 = dataptr[3] + dataptr[4]; - tmp4 = dataptr[3] - dataptr[4]; - - /* Even part */ - - tmp10 = tmp0 + tmp3; /* phase 2 */ - tmp13 = tmp0 - tmp3; - tmp11 = tmp1 + tmp2; - tmp12 = tmp1 - tmp2; - - dataptr[0] = tmp10 + tmp11; /* phase 3 */ - dataptr[4] = tmp10 - tmp11; - - z1 = (tmp12 + tmp13) * ((FAST_FLOAT) 0.707106781); /* c4 */ - dataptr[2] = tmp13 + z1; /* phase 5 */ - dataptr[6] = tmp13 - z1; - - /* Odd part */ - - tmp10 = tmp4 + tmp5; /* phase 2 */ - tmp11 = tmp5 + tmp6; - tmp12 = tmp6 + tmp7; - - /* The rotator is modified from fig 4-8 to avoid extra negations. */ - z5 = (tmp10 - tmp12) * ((FAST_FLOAT) 0.382683433); /* c6 */ - z2 = ((FAST_FLOAT) 0.541196100) * tmp10 + z5; /* c2-c6 */ - z4 = ((FAST_FLOAT) 1.306562965) * tmp12 + z5; /* c2+c6 */ - z3 = tmp11 * ((FAST_FLOAT) 0.707106781); /* c4 */ - - z11 = tmp7 + z3; /* phase 5 */ - z13 = tmp7 - z3; - - dataptr[5] = z13 + z2; /* phase 6 */ - dataptr[3] = z13 - z2; - dataptr[1] = z11 + z4; - dataptr[7] = z11 - z4; - - dataptr += DCTSIZE; /* advance pointer to next row */ - } - - /* Pass 2: process columns. */ - - dataptr = data; - for (ctr = DCTSIZE-1; ctr >= 0; ctr--) { - tmp0 = dataptr[DCTSIZE*0] + dataptr[DCTSIZE*7]; - tmp7 = dataptr[DCTSIZE*0] - dataptr[DCTSIZE*7]; - tmp1 = dataptr[DCTSIZE*1] + dataptr[DCTSIZE*6]; - tmp6 = dataptr[DCTSIZE*1] - dataptr[DCTSIZE*6]; - tmp2 = dataptr[DCTSIZE*2] + dataptr[DCTSIZE*5]; - tmp5 = dataptr[DCTSIZE*2] - dataptr[DCTSIZE*5]; - tmp3 = dataptr[DCTSIZE*3] + dataptr[DCTSIZE*4]; - tmp4 = dataptr[DCTSIZE*3] - dataptr[DCTSIZE*4]; - - /* Even part */ - - tmp10 = tmp0 + tmp3; /* phase 2 */ - tmp13 = tmp0 - tmp3; - tmp11 = tmp1 + tmp2; - tmp12 = tmp1 - tmp2; - - dataptr[DCTSIZE*0] = tmp10 + tmp11; /* phase 3 */ - dataptr[DCTSIZE*4] = tmp10 - tmp11; - - z1 = (tmp12 + tmp13) * ((FAST_FLOAT) 0.707106781); /* c4 */ - dataptr[DCTSIZE*2] = tmp13 + z1; /* phase 5 */ - dataptr[DCTSIZE*6] = tmp13 - z1; - - /* Odd part */ - - tmp10 = tmp4 + tmp5; /* phase 2 */ - tmp11 = tmp5 + tmp6; - tmp12 = tmp6 + tmp7; - - /* The rotator is modified from fig 4-8 to avoid extra negations. */ - z5 = (tmp10 - tmp12) * ((FAST_FLOAT) 0.382683433); /* c6 */ - z2 = ((FAST_FLOAT) 0.541196100) * tmp10 + z5; /* c2-c6 */ - z4 = ((FAST_FLOAT) 1.306562965) * tmp12 + z5; /* c2+c6 */ - z3 = tmp11 * ((FAST_FLOAT) 0.707106781); /* c4 */ - - z11 = tmp7 + z3; /* phase 5 */ - z13 = tmp7 - z3; - - dataptr[DCTSIZE*5] = z13 + z2; /* phase 6 */ - dataptr[DCTSIZE*3] = z13 - z2; - dataptr[DCTSIZE*1] = z11 + z4; - dataptr[DCTSIZE*7] = z11 - z4; - - dataptr++; /* advance pointer to next column */ - } -} - -#endif /* DCT_FLOAT_SUPPORTED */ diff --git a/wxWidgets/src/jpeg/jfdctfst.c b/wxWidgets/src/jpeg/jfdctfst.c deleted file mode 100644 index 37900ec90f..0000000000 --- a/wxWidgets/src/jpeg/jfdctfst.c +++ /dev/null @@ -1,224 +0,0 @@ -/* - * jfdctfst.c - * - * Copyright (C) 1994-1996, Thomas G. Lane. - * This file is part of the Independent JPEG Group's software. - * For conditions of distribution and use, see the accompanying README file. - * - * This file contains a fast, not so accurate integer implementation of the - * forward DCT (Discrete Cosine Transform). - * - * A 2-D DCT can be done by 1-D DCT on each row followed by 1-D DCT - * on each column. Direct algorithms are also available, but they are - * much more complex and seem not to be any faster when reduced to code. - * - * This implementation is based on Arai, Agui, and Nakajima's algorithm for - * scaled DCT. Their original paper (Trans. IEICE E-71(11):1095) is in - * Japanese, but the algorithm is described in the Pennebaker & Mitchell - * JPEG textbook (see REFERENCES section in file README). The following code - * is based directly on figure 4-8 in P&M. - * While an 8-point DCT cannot be done in less than 11 multiplies, it is - * possible to arrange the computation so that many of the multiplies are - * simple scalings of the final outputs. These multiplies can then be - * folded into the multiplications or divisions by the JPEG quantization - * table entries. The AA&N method leaves only 5 multiplies and 29 adds - * to be done in the DCT itself. - * The primary disadvantage of this method is that with fixed-point math, - * accuracy is lost due to imprecise representation of the scaled - * quantization values. The smaller the quantization table entry, the less - * precise the scaled value, so this implementation does worse with high- - * quality-setting files than with low-quality ones. - */ - -#define JPEG_INTERNALS -#include "jinclude.h" -#include "jpeglib.h" -#include "jdct.h" /* Private declarations for DCT subsystem */ - -#ifdef DCT_IFAST_SUPPORTED - - -/* - * This module is specialized to the case DCTSIZE = 8. - */ - -#if DCTSIZE != 8 - Sorry, this code only copes with 8x8 DCTs. /* deliberate syntax err */ -#endif - - -/* Scaling decisions are generally the same as in the LL&M algorithm; - * see jfdctint.c for more details. However, we choose to descale - * (right shift) multiplication products as soon as they are formed, - * rather than carrying additional fractional bits into subsequent additions. - * This compromises accuracy slightly, but it lets us save a few shifts. - * More importantly, 16-bit arithmetic is then adequate (for 8-bit samples) - * everywhere except in the multiplications proper; this saves a good deal - * of work on 16-bit-int machines. - * - * Again to save a few shifts, the intermediate results between pass 1 and - * pass 2 are not upscaled, but are represented only to integral precision. - * - * A final compromise is to represent the multiplicative constants to only - * 8 fractional bits, rather than 13. This saves some shifting work on some - * machines, and may also reduce the cost of multiplication (since there - * are fewer one-bits in the constants). - */ - -#define CONST_BITS 8 - - -/* Some C compilers fail to reduce "FIX(constant)" at compile time, thus - * causing a lot of useless floating-point operations at run time. - * To get around this we use the following pre-calculated constants. - * If you change CONST_BITS you may want to add appropriate values. - * (With a reasonable C compiler, you can just rely on the FIX() macro...) - */ - -#if CONST_BITS == 8 -#define FIX_0_382683433 ((JPEG_INT32) 98) /* FIX(0.382683433) */ -#define FIX_0_541196100 ((JPEG_INT32) 139) /* FIX(0.541196100) */ -#define FIX_0_707106781 ((JPEG_INT32) 181) /* FIX(0.707106781) */ -#define FIX_1_306562965 ((JPEG_INT32) 334) /* FIX(1.306562965) */ -#else -#define FIX_0_382683433 FIX(0.382683433) -#define FIX_0_541196100 FIX(0.541196100) -#define FIX_0_707106781 FIX(0.707106781) -#define FIX_1_306562965 FIX(1.306562965) -#endif - - -/* We can gain a little more speed, with a further compromise in accuracy, - * by omitting the addition in a descaling shift. This yields an incorrectly - * rounded result half the time... - */ - -#ifndef USE_ACCURATE_ROUNDING -#undef DESCALE -#define DESCALE(x,n) RIGHT_SHIFT(x, n) -#endif - - -/* Multiply a DCTELEM variable by an INT32 constant, and immediately - * descale to yield a DCTELEM result. - */ - -#define MULTIPLY(var,const) ((DCTELEM) DESCALE((var) * (const), CONST_BITS)) - - -/* - * Perform the forward DCT on one block of samples. - */ - -GLOBAL(void) -jpeg_fdct_ifast (DCTELEM * data) -{ - DCTELEM tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7; - DCTELEM tmp10, tmp11, tmp12, tmp13; - DCTELEM z1, z2, z3, z4, z5, z11, z13; - DCTELEM *dataptr; - int ctr; - SHIFT_TEMPS - - /* Pass 1: process rows. */ - - dataptr = data; - for (ctr = DCTSIZE-1; ctr >= 0; ctr--) { - tmp0 = dataptr[0] + dataptr[7]; - tmp7 = dataptr[0] - dataptr[7]; - tmp1 = dataptr[1] + dataptr[6]; - tmp6 = dataptr[1] - dataptr[6]; - tmp2 = dataptr[2] + dataptr[5]; - tmp5 = dataptr[2] - dataptr[5]; - tmp3 = dataptr[3] + dataptr[4]; - tmp4 = dataptr[3] - dataptr[4]; - - /* Even part */ - - tmp10 = tmp0 + tmp3; /* phase 2 */ - tmp13 = tmp0 - tmp3; - tmp11 = tmp1 + tmp2; - tmp12 = tmp1 - tmp2; - - dataptr[0] = tmp10 + tmp11; /* phase 3 */ - dataptr[4] = tmp10 - tmp11; - - z1 = MULTIPLY(tmp12 + tmp13, FIX_0_707106781); /* c4 */ - dataptr[2] = tmp13 + z1; /* phase 5 */ - dataptr[6] = tmp13 - z1; - - /* Odd part */ - - tmp10 = tmp4 + tmp5; /* phase 2 */ - tmp11 = tmp5 + tmp6; - tmp12 = tmp6 + tmp7; - - /* The rotator is modified from fig 4-8 to avoid extra negations. */ - z5 = MULTIPLY(tmp10 - tmp12, FIX_0_382683433); /* c6 */ - z2 = MULTIPLY(tmp10, FIX_0_541196100) + z5; /* c2-c6 */ - z4 = MULTIPLY(tmp12, FIX_1_306562965) + z5; /* c2+c6 */ - z3 = MULTIPLY(tmp11, FIX_0_707106781); /* c4 */ - - z11 = tmp7 + z3; /* phase 5 */ - z13 = tmp7 - z3; - - dataptr[5] = z13 + z2; /* phase 6 */ - dataptr[3] = z13 - z2; - dataptr[1] = z11 + z4; - dataptr[7] = z11 - z4; - - dataptr += DCTSIZE; /* advance pointer to next row */ - } - - /* Pass 2: process columns. */ - - dataptr = data; - for (ctr = DCTSIZE-1; ctr >= 0; ctr--) { - tmp0 = dataptr[DCTSIZE*0] + dataptr[DCTSIZE*7]; - tmp7 = dataptr[DCTSIZE*0] - dataptr[DCTSIZE*7]; - tmp1 = dataptr[DCTSIZE*1] + dataptr[DCTSIZE*6]; - tmp6 = dataptr[DCTSIZE*1] - dataptr[DCTSIZE*6]; - tmp2 = dataptr[DCTSIZE*2] + dataptr[DCTSIZE*5]; - tmp5 = dataptr[DCTSIZE*2] - dataptr[DCTSIZE*5]; - tmp3 = dataptr[DCTSIZE*3] + dataptr[DCTSIZE*4]; - tmp4 = dataptr[DCTSIZE*3] - dataptr[DCTSIZE*4]; - - /* Even part */ - - tmp10 = tmp0 + tmp3; /* phase 2 */ - tmp13 = tmp0 - tmp3; - tmp11 = tmp1 + tmp2; - tmp12 = tmp1 - tmp2; - - dataptr[DCTSIZE*0] = tmp10 + tmp11; /* phase 3 */ - dataptr[DCTSIZE*4] = tmp10 - tmp11; - - z1 = MULTIPLY(tmp12 + tmp13, FIX_0_707106781); /* c4 */ - dataptr[DCTSIZE*2] = tmp13 + z1; /* phase 5 */ - dataptr[DCTSIZE*6] = tmp13 - z1; - - /* Odd part */ - - tmp10 = tmp4 + tmp5; /* phase 2 */ - tmp11 = tmp5 + tmp6; - tmp12 = tmp6 + tmp7; - - /* The rotator is modified from fig 4-8 to avoid extra negations. */ - z5 = MULTIPLY(tmp10 - tmp12, FIX_0_382683433); /* c6 */ - z2 = MULTIPLY(tmp10, FIX_0_541196100) + z5; /* c2-c6 */ - z4 = MULTIPLY(tmp12, FIX_1_306562965) + z5; /* c2+c6 */ - z3 = MULTIPLY(tmp11, FIX_0_707106781); /* c4 */ - - z11 = tmp7 + z3; /* phase 5 */ - z13 = tmp7 - z3; - - dataptr[DCTSIZE*5] = z13 + z2; /* phase 6 */ - dataptr[DCTSIZE*3] = z13 - z2; - dataptr[DCTSIZE*1] = z11 + z4; - dataptr[DCTSIZE*7] = z11 - z4; - - dataptr++; /* advance pointer to next column */ - } -} - -#endif /* DCT_IFAST_SUPPORTED */ diff --git a/wxWidgets/src/jpeg/jfdctint.c b/wxWidgets/src/jpeg/jfdctint.c deleted file mode 100644 index 4543b2e861..0000000000 --- a/wxWidgets/src/jpeg/jfdctint.c +++ /dev/null @@ -1,283 +0,0 @@ -/* - * jfdctint.c - * - * Copyright (C) 1991-1996, Thomas G. Lane. - * This file is part of the Independent JPEG Group's software. - * For conditions of distribution and use, see the accompanying README file. - * - * This file contains a slow-but-accurate integer implementation of the - * forward DCT (Discrete Cosine Transform). - * - * A 2-D DCT can be done by 1-D DCT on each row followed by 1-D DCT - * on each column. Direct algorithms are also available, but they are - * much more complex and seem not to be any faster when reduced to code. - * - * This implementation is based on an algorithm described in - * C. Loeffler, A. Ligtenberg and G. Moschytz, "Practical Fast 1-D DCT - * Algorithms with 11 Multiplications", Proc. Int'l. Conf. on Acoustics, - * Speech, and Signal Processing 1989 (ICASSP '89), pp. 988-991. - * The primary algorithm described there uses 11 multiplies and 29 adds. - * We use their alternate method with 12 multiplies and 32 adds. - * The advantage of this method is that no data path contains more than one - * multiplication; this allows a very simple and accurate implementation in - * scaled fixed-point arithmetic, with a minimal number of shifts. - */ - -#define JPEG_INTERNALS -#include "jinclude.h" -#include "jpeglib.h" -#include "jdct.h" /* Private declarations for DCT subsystem */ - -#ifdef DCT_ISLOW_SUPPORTED - - -/* - * This module is specialized to the case DCTSIZE = 8. - */ - -#if DCTSIZE != 8 - Sorry, this code only copes with 8x8 DCTs. /* deliberate syntax err */ -#endif - - -/* - * The poop on this scaling stuff is as follows: - * - * Each 1-D DCT step produces outputs which are a factor of sqrt(N) - * larger than the true DCT outputs. The final outputs are therefore - * a factor of N larger than desired; since N=8 this can be cured by - * a simple right shift at the end of the algorithm. The advantage of - * this arrangement is that we save two multiplications per 1-D DCT, - * because the y0 and y4 outputs need not be divided by sqrt(N). - * In the IJG code, this factor of 8 is removed by the quantization step - * (in jcdctmgr.c), NOT in this module. - * - * We have to do addition and subtraction of the integer inputs, which - * is no problem, and multiplication by fractional constants, which is - * a problem to do in integer arithmetic. We multiply all the constants - * by CONST_SCALE and convert them to integer constants (thus retaining - * CONST_BITS bits of precision in the constants). After doing a - * multiplication we have to divide the product by CONST_SCALE, with proper - * rounding, to produce the correct output. This division can be done - * cheaply as a right shift of CONST_BITS bits. We postpone shifting - * as long as possible so that partial sums can be added together with - * full fractional precision. - * - * The outputs of the first pass are scaled up by PASS1_BITS bits so that - * they are represented to better-than-integral precision. These outputs - * require BITS_IN_JSAMPLE + PASS1_BITS + 3 bits; this fits in a 16-bit word - * with the recommended scaling. (For 12-bit sample data, the intermediate - * array is INT32 anyway.) - * - * To avoid overflow of the 32-bit intermediate results in pass 2, we must - * have BITS_IN_JSAMPLE + CONST_BITS + PASS1_BITS <= 26. Error analysis - * shows that the values given below are the most effective. - */ - -#if BITS_IN_JSAMPLE == 8 -#define CONST_BITS 13 -#define PASS1_BITS 2 -#else -#define CONST_BITS 13 -#define PASS1_BITS 1 /* lose a little precision to avoid overflow */ -#endif - -/* Some C compilers fail to reduce "FIX(constant)" at compile time, thus - * causing a lot of useless floating-point operations at run time. - * To get around this we use the following pre-calculated constants. - * If you change CONST_BITS you may want to add appropriate values. - * (With a reasonable C compiler, you can just rely on the FIX() macro...) - */ - -#if CONST_BITS == 13 -#define FIX_0_298631336 ((JPEG_INT32) 2446) /* FIX(0.298631336) */ -#define FIX_0_390180644 ((JPEG_INT32) 3196) /* FIX(0.390180644) */ -#define FIX_0_541196100 ((JPEG_INT32) 4433) /* FIX(0.541196100) */ -#define FIX_0_765366865 ((JPEG_INT32) 6270) /* FIX(0.765366865) */ -#define FIX_0_899976223 ((JPEG_INT32) 7373) /* FIX(0.899976223) */ -#define FIX_1_175875602 ((JPEG_INT32) 9633) /* FIX(1.175875602) */ -#define FIX_1_501321110 ((JPEG_INT32) 12299) /* FIX(1.501321110) */ -#define FIX_1_847759065 ((JPEG_INT32) 15137) /* FIX(1.847759065) */ -#define FIX_1_961570560 ((JPEG_INT32) 16069) /* FIX(1.961570560) */ -#define FIX_2_053119869 ((JPEG_INT32) 16819) /* FIX(2.053119869) */ -#define FIX_2_562915447 ((JPEG_INT32) 20995) /* FIX(2.562915447) */ -#define FIX_3_072711026 ((JPEG_INT32) 25172) /* FIX(3.072711026) */ -#else -#define FIX_0_298631336 FIX(0.298631336) -#define FIX_0_390180644 FIX(0.390180644) -#define FIX_0_541196100 FIX(0.541196100) -#define FIX_0_765366865 FIX(0.765366865) -#define FIX_0_899976223 FIX(0.899976223) -#define FIX_1_175875602 FIX(1.175875602) -#define FIX_1_501321110 FIX(1.501321110) -#define FIX_1_847759065 FIX(1.847759065) -#define FIX_1_961570560 FIX(1.961570560) -#define FIX_2_053119869 FIX(2.053119869) -#define FIX_2_562915447 FIX(2.562915447) -#define FIX_3_072711026 FIX(3.072711026) -#endif - - -/* Multiply an INT32 variable by an INT32 constant to yield an INT32 result. - * For 8-bit samples with the recommended scaling, all the variable - * and constant values involved are no more than 16 bits wide, so a - * 16x16->32 bit multiply can be used instead of a full 32x32 multiply. - * For 12-bit samples, a full 32-bit multiplication will be needed. - */ - -#if BITS_IN_JSAMPLE == 8 -#define MULTIPLY(var,const) MULTIPLY16C16(var,const) -#else -#define MULTIPLY(var,const) ((var) * (const)) -#endif - - -/* - * Perform the forward DCT on one block of samples. - */ - -GLOBAL(void) -jpeg_fdct_islow (DCTELEM * data) -{ - JPEG_INT32 tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7; - JPEG_INT32 tmp10, tmp11, tmp12, tmp13; - JPEG_INT32 z1, z2, z3, z4, z5; - DCTELEM *dataptr; - int ctr; - SHIFT_TEMPS - - /* Pass 1: process rows. */ - /* Note results are scaled up by sqrt(8) compared to a true DCT; */ - /* furthermore, we scale the results by 2**PASS1_BITS. */ - - dataptr = data; - for (ctr = DCTSIZE-1; ctr >= 0; ctr--) { - tmp0 = dataptr[0] + dataptr[7]; - tmp7 = dataptr[0] - dataptr[7]; - tmp1 = dataptr[1] + dataptr[6]; - tmp6 = dataptr[1] - dataptr[6]; - tmp2 = dataptr[2] + dataptr[5]; - tmp5 = dataptr[2] - dataptr[5]; - tmp3 = dataptr[3] + dataptr[4]; - tmp4 = dataptr[3] - dataptr[4]; - - /* Even part per LL&M figure 1 --- note that published figure is faulty; - * rotator "sqrt(2)*c1" should be "sqrt(2)*c6". - */ - - tmp10 = tmp0 + tmp3; - tmp13 = tmp0 - tmp3; - tmp11 = tmp1 + tmp2; - tmp12 = tmp1 - tmp2; - - dataptr[0] = (DCTELEM) ((tmp10 + tmp11) << PASS1_BITS); - dataptr[4] = (DCTELEM) ((tmp10 - tmp11) << PASS1_BITS); - - z1 = MULTIPLY(tmp12 + tmp13, FIX_0_541196100); - dataptr[2] = (DCTELEM) DESCALE(z1 + MULTIPLY(tmp13, FIX_0_765366865), - CONST_BITS-PASS1_BITS); - dataptr[6] = (DCTELEM) DESCALE(z1 + MULTIPLY(tmp12, - FIX_1_847759065), - CONST_BITS-PASS1_BITS); - - /* Odd part per figure 8 --- note paper omits factor of sqrt(2). - * cK represents cos(K*pi/16). - * i0..i3 in the paper are tmp4..tmp7 here. - */ - - z1 = tmp4 + tmp7; - z2 = tmp5 + tmp6; - z3 = tmp4 + tmp6; - z4 = tmp5 + tmp7; - z5 = MULTIPLY(z3 + z4, FIX_1_175875602); /* sqrt(2) * c3 */ - - tmp4 = MULTIPLY(tmp4, FIX_0_298631336); /* sqrt(2) * (-c1+c3+c5-c7) */ - tmp5 = MULTIPLY(tmp5, FIX_2_053119869); /* sqrt(2) * ( c1+c3-c5+c7) */ - tmp6 = MULTIPLY(tmp6, FIX_3_072711026); /* sqrt(2) * ( c1+c3+c5-c7) */ - tmp7 = MULTIPLY(tmp7, FIX_1_501321110); /* sqrt(2) * ( c1+c3-c5-c7) */ - z1 = MULTIPLY(z1, - FIX_0_899976223); /* sqrt(2) * (c7-c3) */ - z2 = MULTIPLY(z2, - FIX_2_562915447); /* sqrt(2) * (-c1-c3) */ - z3 = MULTIPLY(z3, - FIX_1_961570560); /* sqrt(2) * (-c3-c5) */ - z4 = MULTIPLY(z4, - FIX_0_390180644); /* sqrt(2) * (c5-c3) */ - - z3 += z5; - z4 += z5; - - dataptr[7] = (DCTELEM) DESCALE(tmp4 + z1 + z3, CONST_BITS-PASS1_BITS); - dataptr[5] = (DCTELEM) DESCALE(tmp5 + z2 + z4, CONST_BITS-PASS1_BITS); - dataptr[3] = (DCTELEM) DESCALE(tmp6 + z2 + z3, CONST_BITS-PASS1_BITS); - dataptr[1] = (DCTELEM) DESCALE(tmp7 + z1 + z4, CONST_BITS-PASS1_BITS); - - dataptr += DCTSIZE; /* advance pointer to next row */ - } - - /* Pass 2: process columns. - * We remove the PASS1_BITS scaling, but leave the results scaled up - * by an overall factor of 8. - */ - - dataptr = data; - for (ctr = DCTSIZE-1; ctr >= 0; ctr--) { - tmp0 = dataptr[DCTSIZE*0] + dataptr[DCTSIZE*7]; - tmp7 = dataptr[DCTSIZE*0] - dataptr[DCTSIZE*7]; - tmp1 = dataptr[DCTSIZE*1] + dataptr[DCTSIZE*6]; - tmp6 = dataptr[DCTSIZE*1] - dataptr[DCTSIZE*6]; - tmp2 = dataptr[DCTSIZE*2] + dataptr[DCTSIZE*5]; - tmp5 = dataptr[DCTSIZE*2] - dataptr[DCTSIZE*5]; - tmp3 = dataptr[DCTSIZE*3] + dataptr[DCTSIZE*4]; - tmp4 = dataptr[DCTSIZE*3] - dataptr[DCTSIZE*4]; - - /* Even part per LL&M figure 1 --- note that published figure is faulty; - * rotator "sqrt(2)*c1" should be "sqrt(2)*c6". - */ - - tmp10 = tmp0 + tmp3; - tmp13 = tmp0 - tmp3; - tmp11 = tmp1 + tmp2; - tmp12 = tmp1 - tmp2; - - dataptr[DCTSIZE*0] = (DCTELEM) DESCALE(tmp10 + tmp11, PASS1_BITS); - dataptr[DCTSIZE*4] = (DCTELEM) DESCALE(tmp10 - tmp11, PASS1_BITS); - - z1 = MULTIPLY(tmp12 + tmp13, FIX_0_541196100); - dataptr[DCTSIZE*2] = (DCTELEM) DESCALE(z1 + MULTIPLY(tmp13, FIX_0_765366865), - CONST_BITS+PASS1_BITS); - dataptr[DCTSIZE*6] = (DCTELEM) DESCALE(z1 + MULTIPLY(tmp12, - FIX_1_847759065), - CONST_BITS+PASS1_BITS); - - /* Odd part per figure 8 --- note paper omits factor of sqrt(2). - * cK represents cos(K*pi/16). - * i0..i3 in the paper are tmp4..tmp7 here. - */ - - z1 = tmp4 + tmp7; - z2 = tmp5 + tmp6; - z3 = tmp4 + tmp6; - z4 = tmp5 + tmp7; - z5 = MULTIPLY(z3 + z4, FIX_1_175875602); /* sqrt(2) * c3 */ - - tmp4 = MULTIPLY(tmp4, FIX_0_298631336); /* sqrt(2) * (-c1+c3+c5-c7) */ - tmp5 = MULTIPLY(tmp5, FIX_2_053119869); /* sqrt(2) * ( c1+c3-c5+c7) */ - tmp6 = MULTIPLY(tmp6, FIX_3_072711026); /* sqrt(2) * ( c1+c3+c5-c7) */ - tmp7 = MULTIPLY(tmp7, FIX_1_501321110); /* sqrt(2) * ( c1+c3-c5-c7) */ - z1 = MULTIPLY(z1, - FIX_0_899976223); /* sqrt(2) * (c7-c3) */ - z2 = MULTIPLY(z2, - FIX_2_562915447); /* sqrt(2) * (-c1-c3) */ - z3 = MULTIPLY(z3, - FIX_1_961570560); /* sqrt(2) * (-c3-c5) */ - z4 = MULTIPLY(z4, - FIX_0_390180644); /* sqrt(2) * (c5-c3) */ - - z3 += z5; - z4 += z5; - - dataptr[DCTSIZE*7] = (DCTELEM) DESCALE(tmp4 + z1 + z3, - CONST_BITS+PASS1_BITS); - dataptr[DCTSIZE*5] = (DCTELEM) DESCALE(tmp5 + z2 + z4, - CONST_BITS+PASS1_BITS); - dataptr[DCTSIZE*3] = (DCTELEM) DESCALE(tmp6 + z2 + z3, - CONST_BITS+PASS1_BITS); - dataptr[DCTSIZE*1] = (DCTELEM) DESCALE(tmp7 + z1 + z4, - CONST_BITS+PASS1_BITS); - - dataptr++; /* advance pointer to next column */ - } -} - -#endif /* DCT_ISLOW_SUPPORTED */ diff --git a/wxWidgets/src/jpeg/jidctflt.c b/wxWidgets/src/jpeg/jidctflt.c deleted file mode 100644 index a0f22c295c..0000000000 --- a/wxWidgets/src/jpeg/jidctflt.c +++ /dev/null @@ -1,242 +0,0 @@ -/* - * jidctflt.c - * - * Copyright (C) 1994-1998, Thomas G. Lane. - * This file is part of the Independent JPEG Group's software. - * For conditions of distribution and use, see the accompanying README file. - * - * This file contains a floating-point implementation of the - * inverse DCT (Discrete Cosine Transform). In the IJG code, this routine - * must also perform dequantization of the input coefficients. - * - * This implementation should be more accurate than either of the integer - * IDCT implementations. However, it may not give the same results on all - * machines because of differences in roundoff behavior. Speed will depend - * on the hardware's floating point capacity. - * - * A 2-D IDCT can be done by 1-D IDCT on each column followed by 1-D IDCT - * on each row (or vice versa, but it's more convenient to emit a row at - * a time). Direct algorithms are also available, but they are much more - * complex and seem not to be any faster when reduced to code. - * - * This implementation is based on Arai, Agui, and Nakajima's algorithm for - * scaled DCT. Their original paper (Trans. IEICE E-71(11):1095) is in - * Japanese, but the algorithm is described in the Pennebaker & Mitchell - * JPEG textbook (see REFERENCES section in file README). The following code - * is based directly on figure 4-8 in P&M. - * While an 8-point DCT cannot be done in less than 11 multiplies, it is - * possible to arrange the computation so that many of the multiplies are - * simple scalings of the final outputs. These multiplies can then be - * folded into the multiplications or divisions by the JPEG quantization - * table entries. The AA&N method leaves only 5 multiplies and 29 adds - * to be done in the DCT itself. - * The primary disadvantage of this method is that with a fixed-point - * implementation, accuracy is lost due to imprecise representation of the - * scaled quantization values. However, that problem does not arise if - * we use floating point arithmetic. - */ - -#define JPEG_INTERNALS -#include "jinclude.h" -#include "jpeglib.h" -#include "jdct.h" /* Private declarations for DCT subsystem */ - -#ifdef DCT_FLOAT_SUPPORTED - - -/* - * This module is specialized to the case DCTSIZE = 8. - */ - -#if DCTSIZE != 8 - Sorry, this code only copes with 8x8 DCTs. /* deliberate syntax err */ -#endif - - -/* Dequantize a coefficient by multiplying it by the multiplier-table - * entry; produce a float result. - */ - -#define DEQUANTIZE(coef,quantval) (((FAST_FLOAT) (coef)) * (quantval)) - - -/* - * Perform dequantization and inverse DCT on one block of coefficients. - */ - -GLOBAL(void) -jpeg_idct_float (j_decompress_ptr cinfo, jpeg_component_info * compptr, - JCOEFPTR coef_block, - JSAMPARRAY output_buf, JDIMENSION output_col) -{ - FAST_FLOAT tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7; - FAST_FLOAT tmp10, tmp11, tmp12, tmp13; - FAST_FLOAT z5, z10, z11, z12, z13; - JCOEFPTR inptr; - FLOAT_MULT_TYPE * quantptr; - FAST_FLOAT * wsptr; - JSAMPROW outptr; - JSAMPLE *range_limit = IDCT_range_limit(cinfo); - int ctr; - FAST_FLOAT workspace[DCTSIZE2]; /* buffers data between passes */ - SHIFT_TEMPS - - /* Pass 1: process columns from input, store into work array. */ - - inptr = coef_block; - quantptr = (FLOAT_MULT_TYPE *) compptr->dct_table; - wsptr = workspace; - for (ctr = DCTSIZE; ctr > 0; ctr--) { - /* Due to quantization, we will usually find that many of the input - * coefficients are zero, especially the AC terms. We can exploit this - * by short-circuiting the IDCT calculation for any column in which all - * the AC terms are zero. In that case each output is equal to the - * DC coefficient (with scale factor as needed). - * With typical images and quantization tables, half or more of the - * column DCT calculations can be simplified this way. - */ - - if (inptr[DCTSIZE*1] == 0 && inptr[DCTSIZE*2] == 0 && - inptr[DCTSIZE*3] == 0 && inptr[DCTSIZE*4] == 0 && - inptr[DCTSIZE*5] == 0 && inptr[DCTSIZE*6] == 0 && - inptr[DCTSIZE*7] == 0) { - /* AC terms all zero */ - FAST_FLOAT dcval = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]); - - wsptr[DCTSIZE*0] = dcval; - wsptr[DCTSIZE*1] = dcval; - wsptr[DCTSIZE*2] = dcval; - wsptr[DCTSIZE*3] = dcval; - wsptr[DCTSIZE*4] = dcval; - wsptr[DCTSIZE*5] = dcval; - wsptr[DCTSIZE*6] = dcval; - wsptr[DCTSIZE*7] = dcval; - - inptr++; /* advance pointers to next column */ - quantptr++; - wsptr++; - continue; - } - - /* Even part */ - - tmp0 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]); - tmp1 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]); - tmp2 = DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]); - tmp3 = DEQUANTIZE(inptr[DCTSIZE*6], quantptr[DCTSIZE*6]); - - tmp10 = tmp0 + tmp2; /* phase 3 */ - tmp11 = tmp0 - tmp2; - - tmp13 = tmp1 + tmp3; /* phases 5-3 */ - tmp12 = (tmp1 - tmp3) * ((FAST_FLOAT) 1.414213562) - tmp13; /* 2*c4 */ - - tmp0 = tmp10 + tmp13; /* phase 2 */ - tmp3 = tmp10 - tmp13; - tmp1 = tmp11 + tmp12; - tmp2 = tmp11 - tmp12; - - /* Odd part */ - - tmp4 = DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]); - tmp5 = DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]); - tmp6 = DEQUANTIZE(inptr[DCTSIZE*5], quantptr[DCTSIZE*5]); - tmp7 = DEQUANTIZE(inptr[DCTSIZE*7], quantptr[DCTSIZE*7]); - - z13 = tmp6 + tmp5; /* phase 6 */ - z10 = tmp6 - tmp5; - z11 = tmp4 + tmp7; - z12 = tmp4 - tmp7; - - tmp7 = z11 + z13; /* phase 5 */ - tmp11 = (z11 - z13) * ((FAST_FLOAT) 1.414213562); /* 2*c4 */ - - z5 = (z10 + z12) * ((FAST_FLOAT) 1.847759065); /* 2*c2 */ - tmp10 = ((FAST_FLOAT) 1.082392200) * z12 - z5; /* 2*(c2-c6) */ - tmp12 = ((FAST_FLOAT) -2.613125930) * z10 + z5; /* -2*(c2+c6) */ - - tmp6 = tmp12 - tmp7; /* phase 2 */ - tmp5 = tmp11 - tmp6; - tmp4 = tmp10 + tmp5; - - wsptr[DCTSIZE*0] = tmp0 + tmp7; - wsptr[DCTSIZE*7] = tmp0 - tmp7; - wsptr[DCTSIZE*1] = tmp1 + tmp6; - wsptr[DCTSIZE*6] = tmp1 - tmp6; - wsptr[DCTSIZE*2] = tmp2 + tmp5; - wsptr[DCTSIZE*5] = tmp2 - tmp5; - wsptr[DCTSIZE*4] = tmp3 + tmp4; - wsptr[DCTSIZE*3] = tmp3 - tmp4; - - inptr++; /* advance pointers to next column */ - quantptr++; - wsptr++; - } - - /* Pass 2: process rows from work array, store into output array. */ - /* Note that we must descale the results by a factor of 8 == 2**3. */ - - wsptr = workspace; - for (ctr = 0; ctr < DCTSIZE; ctr++) { - outptr = output_buf[ctr] + output_col; - /* Rows of zeroes can be exploited in the same way as we did with columns. - * However, the column calculation has created many nonzero AC terms, so - * the simplification applies less often (typically 5% to 10% of the time). - * And testing floats for zero is relatively expensive, so we don't bother. - */ - - /* Even part */ - - tmp10 = wsptr[0] + wsptr[4]; - tmp11 = wsptr[0] - wsptr[4]; - - tmp13 = wsptr[2] + wsptr[6]; - tmp12 = (wsptr[2] - wsptr[6]) * ((FAST_FLOAT) 1.414213562) - tmp13; - - tmp0 = tmp10 + tmp13; - tmp3 = tmp10 - tmp13; - tmp1 = tmp11 + tmp12; - tmp2 = tmp11 - tmp12; - - /* Odd part */ - - z13 = wsptr[5] + wsptr[3]; - z10 = wsptr[5] - wsptr[3]; - z11 = wsptr[1] + wsptr[7]; - z12 = wsptr[1] - wsptr[7]; - - tmp7 = z11 + z13; - tmp11 = (z11 - z13) * ((FAST_FLOAT) 1.414213562); - - z5 = (z10 + z12) * ((FAST_FLOAT) 1.847759065); /* 2*c2 */ - tmp10 = ((FAST_FLOAT) 1.082392200) * z12 - z5; /* 2*(c2-c6) */ - tmp12 = ((FAST_FLOAT) -2.613125930) * z10 + z5; /* -2*(c2+c6) */ - - tmp6 = tmp12 - tmp7; - tmp5 = tmp11 - tmp6; - tmp4 = tmp10 + tmp5; - - /* Final output stage: scale down by a factor of 8 and range-limit */ - - outptr[0] = range_limit[(int) DESCALE((JPEG_INT32) (tmp0 + tmp7), 3) - & RANGE_MASK]; - outptr[7] = range_limit[(int) DESCALE((JPEG_INT32) (tmp0 - tmp7), 3) - & RANGE_MASK]; - outptr[1] = range_limit[(int) DESCALE((JPEG_INT32) (tmp1 + tmp6), 3) - & RANGE_MASK]; - outptr[6] = range_limit[(int) DESCALE((JPEG_INT32) (tmp1 - tmp6), 3) - & RANGE_MASK]; - outptr[2] = range_limit[(int) DESCALE((JPEG_INT32) (tmp2 + tmp5), 3) - & RANGE_MASK]; - outptr[5] = range_limit[(int) DESCALE((JPEG_INT32) (tmp2 - tmp5), 3) - & RANGE_MASK]; - outptr[4] = range_limit[(int) DESCALE((JPEG_INT32) (tmp3 + tmp4), 3) - & RANGE_MASK]; - outptr[3] = range_limit[(int) DESCALE((JPEG_INT32) (tmp3 - tmp4), 3) - & RANGE_MASK]; - - wsptr += DCTSIZE; /* advance pointer to next row */ - } -} - -#endif /* DCT_FLOAT_SUPPORTED */ diff --git a/wxWidgets/src/jpeg/jidctfst.c b/wxWidgets/src/jpeg/jidctfst.c deleted file mode 100644 index d388b61783..0000000000 --- a/wxWidgets/src/jpeg/jidctfst.c +++ /dev/null @@ -1,368 +0,0 @@ -/* - * jidctfst.c - * - * Copyright (C) 1994-1998, Thomas G. Lane. - * This file is part of the Independent JPEG Group's software. - * For conditions of distribution and use, see the accompanying README file. - * - * This file contains a fast, not so accurate integer implementation of the - * inverse DCT (Discrete Cosine Transform). In the IJG code, this routine - * must also perform dequantization of the input coefficients. - * - * A 2-D IDCT can be done by 1-D IDCT on each column followed by 1-D IDCT - * on each row (or vice versa, but it's more convenient to emit a row at - * a time). Direct algorithms are also available, but they are much more - * complex and seem not to be any faster when reduced to code. - * - * This implementation is based on Arai, Agui, and Nakajima's algorithm for - * scaled DCT. Their original paper (Trans. IEICE E-71(11):1095) is in - * Japanese, but the algorithm is described in the Pennebaker & Mitchell - * JPEG textbook (see REFERENCES section in file README). The following code - * is based directly on figure 4-8 in P&M. - * While an 8-point DCT cannot be done in less than 11 multiplies, it is - * possible to arrange the computation so that many of the multiplies are - * simple scalings of the final outputs. These multiplies can then be - * folded into the multiplications or divisions by the JPEG quantization - * table entries. The AA&N method leaves only 5 multiplies and 29 adds - * to be done in the DCT itself. - * The primary disadvantage of this method is that with fixed-point math, - * accuracy is lost due to imprecise representation of the scaled - * quantization values. The smaller the quantization table entry, the less - * precise the scaled value, so this implementation does worse with high- - * quality-setting files than with low-quality ones. - */ - -#define JPEG_INTERNALS -#include "jinclude.h" -#include "jpeglib.h" -#include "jdct.h" /* Private declarations for DCT subsystem */ - -#ifdef DCT_IFAST_SUPPORTED - - -/* - * This module is specialized to the case DCTSIZE = 8. - */ - -#if DCTSIZE != 8 - Sorry, this code only copes with 8x8 DCTs. /* deliberate syntax err */ -#endif - - -/* Scaling decisions are generally the same as in the LL&M algorithm; - * see jidctint.c for more details. However, we choose to descale - * (right shift) multiplication products as soon as they are formed, - * rather than carrying additional fractional bits into subsequent additions. - * This compromises accuracy slightly, but it lets us save a few shifts. - * More importantly, 16-bit arithmetic is then adequate (for 8-bit samples) - * everywhere except in the multiplications proper; this saves a good deal - * of work on 16-bit-int machines. - * - * The dequantized coefficients are not integers because the AA&N scaling - * factors have been incorporated. We represent them scaled up by PASS1_BITS, - * so that the first and second IDCT rounds have the same input scaling. - * For 8-bit JSAMPLEs, we choose IFAST_SCALE_BITS = PASS1_BITS so as to - * avoid a descaling shift; this compromises accuracy rather drastically - * for small quantization table entries, but it saves a lot of shifts. - * For 12-bit JSAMPLEs, there's no hope of using 16x16 multiplies anyway, - * so we use a much larger scaling factor to preserve accuracy. - * - * A final compromise is to represent the multiplicative constants to only - * 8 fractional bits, rather than 13. This saves some shifting work on some - * machines, and may also reduce the cost of multiplication (since there - * are fewer one-bits in the constants). - */ - -#if BITS_IN_JSAMPLE == 8 -#define CONST_BITS 8 -#define PASS1_BITS 2 -#else -#define CONST_BITS 8 -#define PASS1_BITS 1 /* lose a little precision to avoid overflow */ -#endif - -/* Some C compilers fail to reduce "FIX(constant)" at compile time, thus - * causing a lot of useless floating-point operations at run time. - * To get around this we use the following pre-calculated constants. - * If you change CONST_BITS you may want to add appropriate values. - * (With a reasonable C compiler, you can just rely on the FIX() macro...) - */ - -#if CONST_BITS == 8 -#define FIX_1_082392200 ((JPEG_INT32) 277) /* FIX(1.082392200) */ -#define FIX_1_414213562 ((JPEG_INT32) 362) /* FIX(1.414213562) */ -#define FIX_1_847759065 ((JPEG_INT32) 473) /* FIX(1.847759065) */ -#define FIX_2_613125930 ((JPEG_INT32) 669) /* FIX(2.613125930) */ -#else -#define FIX_1_082392200 FIX(1.082392200) -#define FIX_1_414213562 FIX(1.414213562) -#define FIX_1_847759065 FIX(1.847759065) -#define FIX_2_613125930 FIX(2.613125930) -#endif - - -/* We can gain a little more speed, with a further compromise in accuracy, - * by omitting the addition in a descaling shift. This yields an incorrectly - * rounded result half the time... - */ - -#ifndef USE_ACCURATE_ROUNDING -#undef DESCALE -#define DESCALE(x,n) RIGHT_SHIFT(x, n) -#endif - - -/* Multiply a DCTELEM variable by an INT32 constant, and immediately - * descale to yield a DCTELEM result. - */ - -#define MULTIPLY(var,const) ((DCTELEM) DESCALE((var) * (const), CONST_BITS)) - - -/* Dequantize a coefficient by multiplying it by the multiplier-table - * entry; produce a DCTELEM result. For 8-bit data a 16x16->16 - * multiplication will do. For 12-bit data, the multiplier table is - * declared INT32, so a 32-bit multiply will be used. - */ - -#if BITS_IN_JSAMPLE == 8 -#define DEQUANTIZE(coef,quantval) (((IFAST_MULT_TYPE) (coef)) * (quantval)) -#else -#define DEQUANTIZE(coef,quantval) \ - DESCALE((coef)*(quantval), IFAST_SCALE_BITS-PASS1_BITS) -#endif - - -/* Like DESCALE, but applies to a DCTELEM and produces an int. - * We assume that int right shift is unsigned if INT32 right shift is. - */ - -#ifdef RIGHT_SHIFT_IS_UNSIGNED -#define ISHIFT_TEMPS DCTELEM ishift_temp; -#if BITS_IN_JSAMPLE == 8 -#define DCTELEMBITS 16 /* DCTELEM may be 16 or 32 bits */ -#else -#define DCTELEMBITS 32 /* DCTELEM must be 32 bits */ -#endif -#define IRIGHT_SHIFT(x,shft) \ - ((ishift_temp = (x)) < 0 ? \ - (ishift_temp >> (shft)) | ((~((DCTELEM) 0)) << (DCTELEMBITS-(shft))) : \ - (ishift_temp >> (shft))) -#else -#define ISHIFT_TEMPS -#define IRIGHT_SHIFT(x,shft) ((x) >> (shft)) -#endif - -#ifdef USE_ACCURATE_ROUNDING -#define IDESCALE(x,n) ((int) IRIGHT_SHIFT((x) + (1 << ((n)-1)), n)) -#else -#define IDESCALE(x,n) ((int) IRIGHT_SHIFT(x, n)) -#endif - - -/* - * Perform dequantization and inverse DCT on one block of coefficients. - */ - -GLOBAL(void) -jpeg_idct_ifast (j_decompress_ptr cinfo, jpeg_component_info * compptr, - JCOEFPTR coef_block, - JSAMPARRAY output_buf, JDIMENSION output_col) -{ - DCTELEM tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7; - DCTELEM tmp10, tmp11, tmp12, tmp13; - DCTELEM z5, z10, z11, z12, z13; - JCOEFPTR inptr; - IFAST_MULT_TYPE * quantptr; - int * wsptr; - JSAMPROW outptr; - JSAMPLE *range_limit = IDCT_range_limit(cinfo); - int ctr; - int workspace[DCTSIZE2]; /* buffers data between passes */ - SHIFT_TEMPS /* for DESCALE */ - ISHIFT_TEMPS /* for IDESCALE */ - - /* Pass 1: process columns from input, store into work array. */ - - inptr = coef_block; - quantptr = (IFAST_MULT_TYPE *) compptr->dct_table; - wsptr = workspace; - for (ctr = DCTSIZE; ctr > 0; ctr--) { - /* Due to quantization, we will usually find that many of the input - * coefficients are zero, especially the AC terms. We can exploit this - * by short-circuiting the IDCT calculation for any column in which all - * the AC terms are zero. In that case each output is equal to the - * DC coefficient (with scale factor as needed). - * With typical images and quantization tables, half or more of the - * column DCT calculations can be simplified this way. - */ - - if (inptr[DCTSIZE*1] == 0 && inptr[DCTSIZE*2] == 0 && - inptr[DCTSIZE*3] == 0 && inptr[DCTSIZE*4] == 0 && - inptr[DCTSIZE*5] == 0 && inptr[DCTSIZE*6] == 0 && - inptr[DCTSIZE*7] == 0) { - /* AC terms all zero */ - int dcval = (int) DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]); - - wsptr[DCTSIZE*0] = dcval; - wsptr[DCTSIZE*1] = dcval; - wsptr[DCTSIZE*2] = dcval; - wsptr[DCTSIZE*3] = dcval; - wsptr[DCTSIZE*4] = dcval; - wsptr[DCTSIZE*5] = dcval; - wsptr[DCTSIZE*6] = dcval; - wsptr[DCTSIZE*7] = dcval; - - inptr++; /* advance pointers to next column */ - quantptr++; - wsptr++; - continue; - } - - /* Even part */ - - tmp0 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]); - tmp1 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]); - tmp2 = DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]); - tmp3 = DEQUANTIZE(inptr[DCTSIZE*6], quantptr[DCTSIZE*6]); - - tmp10 = tmp0 + tmp2; /* phase 3 */ - tmp11 = tmp0 - tmp2; - - tmp13 = tmp1 + tmp3; /* phases 5-3 */ - tmp12 = MULTIPLY(tmp1 - tmp3, FIX_1_414213562) - tmp13; /* 2*c4 */ - - tmp0 = tmp10 + tmp13; /* phase 2 */ - tmp3 = tmp10 - tmp13; - tmp1 = tmp11 + tmp12; - tmp2 = tmp11 - tmp12; - - /* Odd part */ - - tmp4 = DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]); - tmp5 = DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]); - tmp6 = DEQUANTIZE(inptr[DCTSIZE*5], quantptr[DCTSIZE*5]); - tmp7 = DEQUANTIZE(inptr[DCTSIZE*7], quantptr[DCTSIZE*7]); - - z13 = tmp6 + tmp5; /* phase 6 */ - z10 = tmp6 - tmp5; - z11 = tmp4 + tmp7; - z12 = tmp4 - tmp7; - - tmp7 = z11 + z13; /* phase 5 */ - tmp11 = MULTIPLY(z11 - z13, FIX_1_414213562); /* 2*c4 */ - - z5 = MULTIPLY(z10 + z12, FIX_1_847759065); /* 2*c2 */ - tmp10 = MULTIPLY(z12, FIX_1_082392200) - z5; /* 2*(c2-c6) */ - tmp12 = MULTIPLY(z10, - FIX_2_613125930) + z5; /* -2*(c2+c6) */ - - tmp6 = tmp12 - tmp7; /* phase 2 */ - tmp5 = tmp11 - tmp6; - tmp4 = tmp10 + tmp5; - - wsptr[DCTSIZE*0] = (int) (tmp0 + tmp7); - wsptr[DCTSIZE*7] = (int) (tmp0 - tmp7); - wsptr[DCTSIZE*1] = (int) (tmp1 + tmp6); - wsptr[DCTSIZE*6] = (int) (tmp1 - tmp6); - wsptr[DCTSIZE*2] = (int) (tmp2 + tmp5); - wsptr[DCTSIZE*5] = (int) (tmp2 - tmp5); - wsptr[DCTSIZE*4] = (int) (tmp3 + tmp4); - wsptr[DCTSIZE*3] = (int) (tmp3 - tmp4); - - inptr++; /* advance pointers to next column */ - quantptr++; - wsptr++; - } - - /* Pass 2: process rows from work array, store into output array. */ - /* Note that we must descale the results by a factor of 8 == 2**3, */ - /* and also undo the PASS1_BITS scaling. */ - - wsptr = workspace; - for (ctr = 0; ctr < DCTSIZE; ctr++) { - outptr = output_buf[ctr] + output_col; - /* Rows of zeroes can be exploited in the same way as we did with columns. - * However, the column calculation has created many nonzero AC terms, so - * the simplification applies less often (typically 5% to 10% of the time). - * On machines with very fast multiplication, it's possible that the - * test takes more time than it's worth. In that case this section - * may be commented out. - */ - -#ifndef NO_ZERO_ROW_TEST - if (wsptr[1] == 0 && wsptr[2] == 0 && wsptr[3] == 0 && wsptr[4] == 0 && - wsptr[5] == 0 && wsptr[6] == 0 && wsptr[7] == 0) { - /* AC terms all zero */ - JSAMPLE dcval = range_limit[IDESCALE(wsptr[0], PASS1_BITS+3) - & RANGE_MASK]; - - outptr[0] = dcval; - outptr[1] = dcval; - outptr[2] = dcval; - outptr[3] = dcval; - outptr[4] = dcval; - outptr[5] = dcval; - outptr[6] = dcval; - outptr[7] = dcval; - - wsptr += DCTSIZE; /* advance pointer to next row */ - continue; - } -#endif - - /* Even part */ - - tmp10 = ((DCTELEM) wsptr[0] + (DCTELEM) wsptr[4]); - tmp11 = ((DCTELEM) wsptr[0] - (DCTELEM) wsptr[4]); - - tmp13 = ((DCTELEM) wsptr[2] + (DCTELEM) wsptr[6]); - tmp12 = MULTIPLY((DCTELEM) wsptr[2] - (DCTELEM) wsptr[6], FIX_1_414213562) - - tmp13; - - tmp0 = tmp10 + tmp13; - tmp3 = tmp10 - tmp13; - tmp1 = tmp11 + tmp12; - tmp2 = tmp11 - tmp12; - - /* Odd part */ - - z13 = (DCTELEM) wsptr[5] + (DCTELEM) wsptr[3]; - z10 = (DCTELEM) wsptr[5] - (DCTELEM) wsptr[3]; - z11 = (DCTELEM) wsptr[1] + (DCTELEM) wsptr[7]; - z12 = (DCTELEM) wsptr[1] - (DCTELEM) wsptr[7]; - - tmp7 = z11 + z13; /* phase 5 */ - tmp11 = MULTIPLY(z11 - z13, FIX_1_414213562); /* 2*c4 */ - - z5 = MULTIPLY(z10 + z12, FIX_1_847759065); /* 2*c2 */ - tmp10 = MULTIPLY(z12, FIX_1_082392200) - z5; /* 2*(c2-c6) */ - tmp12 = MULTIPLY(z10, - FIX_2_613125930) + z5; /* -2*(c2+c6) */ - - tmp6 = tmp12 - tmp7; /* phase 2 */ - tmp5 = tmp11 - tmp6; - tmp4 = tmp10 + tmp5; - - /* Final output stage: scale down by a factor of 8 and range-limit */ - - outptr[0] = range_limit[IDESCALE(tmp0 + tmp7, PASS1_BITS+3) - & RANGE_MASK]; - outptr[7] = range_limit[IDESCALE(tmp0 - tmp7, PASS1_BITS+3) - & RANGE_MASK]; - outptr[1] = range_limit[IDESCALE(tmp1 + tmp6, PASS1_BITS+3) - & RANGE_MASK]; - outptr[6] = range_limit[IDESCALE(tmp1 - tmp6, PASS1_BITS+3) - & RANGE_MASK]; - outptr[2] = range_limit[IDESCALE(tmp2 + tmp5, PASS1_BITS+3) - & RANGE_MASK]; - outptr[5] = range_limit[IDESCALE(tmp2 - tmp5, PASS1_BITS+3) - & RANGE_MASK]; - outptr[4] = range_limit[IDESCALE(tmp3 + tmp4, PASS1_BITS+3) - & RANGE_MASK]; - outptr[3] = range_limit[IDESCALE(tmp3 - tmp4, PASS1_BITS+3) - & RANGE_MASK]; - - wsptr += DCTSIZE; /* advance pointer to next row */ - } -} - -#endif /* DCT_IFAST_SUPPORTED */ diff --git a/wxWidgets/src/jpeg/jidctint.c b/wxWidgets/src/jpeg/jidctint.c deleted file mode 100644 index 2783c23027..0000000000 --- a/wxWidgets/src/jpeg/jidctint.c +++ /dev/null @@ -1,389 +0,0 @@ -/* - * jidctint.c - * - * Copyright (C) 1991-1998, Thomas G. Lane. - * This file is part of the Independent JPEG Group's software. - * For conditions of distribution and use, see the accompanying README file. - * - * This file contains a slow-but-accurate integer implementation of the - * inverse DCT (Discrete Cosine Transform). In the IJG code, this routine - * must also perform dequantization of the input coefficients. - * - * A 2-D IDCT can be done by 1-D IDCT on each column followed by 1-D IDCT - * on each row (or vice versa, but it's more convenient to emit a row at - * a time). Direct algorithms are also available, but they are much more - * complex and seem not to be any faster when reduced to code. - * - * This implementation is based on an algorithm described in - * C. Loeffler, A. Ligtenberg and G. Moschytz, "Practical Fast 1-D DCT - * Algorithms with 11 Multiplications", Proc. Int'l. Conf. on Acoustics, - * Speech, and Signal Processing 1989 (ICASSP '89), pp. 988-991. - * The primary algorithm described there uses 11 multiplies and 29 adds. - * We use their alternate method with 12 multiplies and 32 adds. - * The advantage of this method is that no data path contains more than one - * multiplication; this allows a very simple and accurate implementation in - * scaled fixed-point arithmetic, with a minimal number of shifts. - */ - -#define JPEG_INTERNALS -#include "jinclude.h" -#include "jpeglib.h" -#include "jdct.h" /* Private declarations for DCT subsystem */ - -#ifdef DCT_ISLOW_SUPPORTED - - -/* - * This module is specialized to the case DCTSIZE = 8. - */ - -#if DCTSIZE != 8 - Sorry, this code only copes with 8x8 DCTs. /* deliberate syntax err */ -#endif - - -/* - * The poop on this scaling stuff is as follows: - * - * Each 1-D IDCT step produces outputs which are a factor of sqrt(N) - * larger than the true IDCT outputs. The final outputs are therefore - * a factor of N larger than desired; since N=8 this can be cured by - * a simple right shift at the end of the algorithm. The advantage of - * this arrangement is that we save two multiplications per 1-D IDCT, - * because the y0 and y4 inputs need not be divided by sqrt(N). - * - * We have to do addition and subtraction of the integer inputs, which - * is no problem, and multiplication by fractional constants, which is - * a problem to do in integer arithmetic. We multiply all the constants - * by CONST_SCALE and convert them to integer constants (thus retaining - * CONST_BITS bits of precision in the constants). After doing a - * multiplication we have to divide the product by CONST_SCALE, with proper - * rounding, to produce the correct output. This division can be done - * cheaply as a right shift of CONST_BITS bits. We postpone shifting - * as long as possible so that partial sums can be added together with - * full fractional precision. - * - * The outputs of the first pass are scaled up by PASS1_BITS bits so that - * they are represented to better-than-integral precision. These outputs - * require BITS_IN_JSAMPLE + PASS1_BITS + 3 bits; this fits in a 16-bit word - * with the recommended scaling. (To scale up 12-bit sample data further, an - * intermediate INT32 array would be needed.) - * - * To avoid overflow of the 32-bit intermediate results in pass 2, we must - * have BITS_IN_JSAMPLE + CONST_BITS + PASS1_BITS <= 26. Error analysis - * shows that the values given below are the most effective. - */ - -#if BITS_IN_JSAMPLE == 8 -#define CONST_BITS 13 -#define PASS1_BITS 2 -#else -#define CONST_BITS 13 -#define PASS1_BITS 1 /* lose a little precision to avoid overflow */ -#endif - -/* Some C compilers fail to reduce "FIX(constant)" at compile time, thus - * causing a lot of useless floating-point operations at run time. - * To get around this we use the following pre-calculated constants. - * If you change CONST_BITS you may want to add appropriate values. - * (With a reasonable C compiler, you can just rely on the FIX() macro...) - */ - -#if CONST_BITS == 13 -#define FIX_0_298631336 ((JPEG_INT32) 2446) /* FIX(0.298631336) */ -#define FIX_0_390180644 ((JPEG_INT32) 3196) /* FIX(0.390180644) */ -#define FIX_0_541196100 ((JPEG_INT32) 4433) /* FIX(0.541196100) */ -#define FIX_0_765366865 ((JPEG_INT32) 6270) /* FIX(0.765366865) */ -#define FIX_0_899976223 ((JPEG_INT32) 7373) /* FIX(0.899976223) */ -#define FIX_1_175875602 ((JPEG_INT32) 9633) /* FIX(1.175875602) */ -#define FIX_1_501321110 ((JPEG_INT32) 12299) /* FIX(1.501321110) */ -#define FIX_1_847759065 ((JPEG_INT32) 15137) /* FIX(1.847759065) */ -#define FIX_1_961570560 ((JPEG_INT32) 16069) /* FIX(1.961570560) */ -#define FIX_2_053119869 ((JPEG_INT32) 16819) /* FIX(2.053119869) */ -#define FIX_2_562915447 ((JPEG_INT32) 20995) /* FIX(2.562915447) */ -#define FIX_3_072711026 ((JPEG_INT32) 25172) /* FIX(3.072711026) */ -#else -#define FIX_0_298631336 FIX(0.298631336) -#define FIX_0_390180644 FIX(0.390180644) -#define FIX_0_541196100 FIX(0.541196100) -#define FIX_0_765366865 FIX(0.765366865) -#define FIX_0_899976223 FIX(0.899976223) -#define FIX_1_175875602 FIX(1.175875602) -#define FIX_1_501321110 FIX(1.501321110) -#define FIX_1_847759065 FIX(1.847759065) -#define FIX_1_961570560 FIX(1.961570560) -#define FIX_2_053119869 FIX(2.053119869) -#define FIX_2_562915447 FIX(2.562915447) -#define FIX_3_072711026 FIX(3.072711026) -#endif - - -/* Multiply an INT32 variable by an INT32 constant to yield an INT32 result. - * For 8-bit samples with the recommended scaling, all the variable - * and constant values involved are no more than 16 bits wide, so a - * 16x16->32 bit multiply can be used instead of a full 32x32 multiply. - * For 12-bit samples, a full 32-bit multiplication will be needed. - */ - -#if BITS_IN_JSAMPLE == 8 -#define MULTIPLY(var,const) MULTIPLY16C16(var,const) -#else -#define MULTIPLY(var,const) ((var) * (const)) -#endif - - -/* Dequantize a coefficient by multiplying it by the multiplier-table - * entry; produce an int result. In this module, both inputs and result - * are 16 bits or less, so either int or short multiply will work. - */ - -#define DEQUANTIZE(coef,quantval) (((ISLOW_MULT_TYPE) (coef)) * (quantval)) - - -/* - * Perform dequantization and inverse DCT on one block of coefficients. - */ - -GLOBAL(void) -jpeg_idct_islow (j_decompress_ptr cinfo, jpeg_component_info * compptr, - JCOEFPTR coef_block, - JSAMPARRAY output_buf, JDIMENSION output_col) -{ - JPEG_INT32 tmp0, tmp1, tmp2, tmp3; - JPEG_INT32 tmp10, tmp11, tmp12, tmp13; - JPEG_INT32 z1, z2, z3, z4, z5; - JCOEFPTR inptr; - ISLOW_MULT_TYPE * quantptr; - int * wsptr; - JSAMPROW outptr; - JSAMPLE *range_limit = IDCT_range_limit(cinfo); - int ctr; - int workspace[DCTSIZE2]; /* buffers data between passes */ - SHIFT_TEMPS - - /* Pass 1: process columns from input, store into work array. */ - /* Note results are scaled up by sqrt(8) compared to a true IDCT; */ - /* furthermore, we scale the results by 2**PASS1_BITS. */ - - inptr = coef_block; - quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table; - wsptr = workspace; - for (ctr = DCTSIZE; ctr > 0; ctr--) { - /* Due to quantization, we will usually find that many of the input - * coefficients are zero, especially the AC terms. We can exploit this - * by short-circuiting the IDCT calculation for any column in which all - * the AC terms are zero. In that case each output is equal to the - * DC coefficient (with scale factor as needed). - * With typical images and quantization tables, half or more of the - * column DCT calculations can be simplified this way. - */ - - if (inptr[DCTSIZE*1] == 0 && inptr[DCTSIZE*2] == 0 && - inptr[DCTSIZE*3] == 0 && inptr[DCTSIZE*4] == 0 && - inptr[DCTSIZE*5] == 0 && inptr[DCTSIZE*6] == 0 && - inptr[DCTSIZE*7] == 0) { - /* AC terms all zero */ - int dcval = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]) << PASS1_BITS; - - wsptr[DCTSIZE*0] = dcval; - wsptr[DCTSIZE*1] = dcval; - wsptr[DCTSIZE*2] = dcval; - wsptr[DCTSIZE*3] = dcval; - wsptr[DCTSIZE*4] = dcval; - wsptr[DCTSIZE*5] = dcval; - wsptr[DCTSIZE*6] = dcval; - wsptr[DCTSIZE*7] = dcval; - - inptr++; /* advance pointers to next column */ - quantptr++; - wsptr++; - continue; - } - - /* Even part: reverse the even part of the forward DCT. */ - /* The rotator is sqrt(2)*c(-6). */ - - z2 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]); - z3 = DEQUANTIZE(inptr[DCTSIZE*6], quantptr[DCTSIZE*6]); - - z1 = MULTIPLY(z2 + z3, FIX_0_541196100); - tmp2 = z1 + MULTIPLY(z3, - FIX_1_847759065); - tmp3 = z1 + MULTIPLY(z2, FIX_0_765366865); - - z2 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]); - z3 = DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]); - - tmp0 = (z2 + z3) << CONST_BITS; - tmp1 = (z2 - z3) << CONST_BITS; - - tmp10 = tmp0 + tmp3; - tmp13 = tmp0 - tmp3; - tmp11 = tmp1 + tmp2; - tmp12 = tmp1 - tmp2; - - /* Odd part per figure 8; the matrix is unitary and hence its - * transpose is its inverse. i0..i3 are y7,y5,y3,y1 respectively. - */ - - tmp0 = DEQUANTIZE(inptr[DCTSIZE*7], quantptr[DCTSIZE*7]); - tmp1 = DEQUANTIZE(inptr[DCTSIZE*5], quantptr[DCTSIZE*5]); - tmp2 = DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]); - tmp3 = DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]); - - z1 = tmp0 + tmp3; - z2 = tmp1 + tmp2; - z3 = tmp0 + tmp2; - z4 = tmp1 + tmp3; - z5 = MULTIPLY(z3 + z4, FIX_1_175875602); /* sqrt(2) * c3 */ - - tmp0 = MULTIPLY(tmp0, FIX_0_298631336); /* sqrt(2) * (-c1+c3+c5-c7) */ - tmp1 = MULTIPLY(tmp1, FIX_2_053119869); /* sqrt(2) * ( c1+c3-c5+c7) */ - tmp2 = MULTIPLY(tmp2, FIX_3_072711026); /* sqrt(2) * ( c1+c3+c5-c7) */ - tmp3 = MULTIPLY(tmp3, FIX_1_501321110); /* sqrt(2) * ( c1+c3-c5-c7) */ - z1 = MULTIPLY(z1, - FIX_0_899976223); /* sqrt(2) * (c7-c3) */ - z2 = MULTIPLY(z2, - FIX_2_562915447); /* sqrt(2) * (-c1-c3) */ - z3 = MULTIPLY(z3, - FIX_1_961570560); /* sqrt(2) * (-c3-c5) */ - z4 = MULTIPLY(z4, - FIX_0_390180644); /* sqrt(2) * (c5-c3) */ - - z3 += z5; - z4 += z5; - - tmp0 += z1 + z3; - tmp1 += z2 + z4; - tmp2 += z2 + z3; - tmp3 += z1 + z4; - - /* Final output stage: inputs are tmp10..tmp13, tmp0..tmp3 */ - - wsptr[DCTSIZE*0] = (int) DESCALE(tmp10 + tmp3, CONST_BITS-PASS1_BITS); - wsptr[DCTSIZE*7] = (int) DESCALE(tmp10 - tmp3, CONST_BITS-PASS1_BITS); - wsptr[DCTSIZE*1] = (int) DESCALE(tmp11 + tmp2, CONST_BITS-PASS1_BITS); - wsptr[DCTSIZE*6] = (int) DESCALE(tmp11 - tmp2, CONST_BITS-PASS1_BITS); - wsptr[DCTSIZE*2] = (int) DESCALE(tmp12 + tmp1, CONST_BITS-PASS1_BITS); - wsptr[DCTSIZE*5] = (int) DESCALE(tmp12 - tmp1, CONST_BITS-PASS1_BITS); - wsptr[DCTSIZE*3] = (int) DESCALE(tmp13 + tmp0, CONST_BITS-PASS1_BITS); - wsptr[DCTSIZE*4] = (int) DESCALE(tmp13 - tmp0, CONST_BITS-PASS1_BITS); - - inptr++; /* advance pointers to next column */ - quantptr++; - wsptr++; - } - - /* Pass 2: process rows from work array, store into output array. */ - /* Note that we must descale the results by a factor of 8 == 2**3, */ - /* and also undo the PASS1_BITS scaling. */ - - wsptr = workspace; - for (ctr = 0; ctr < DCTSIZE; ctr++) { - outptr = output_buf[ctr] + output_col; - /* Rows of zeroes can be exploited in the same way as we did with columns. - * However, the column calculation has created many nonzero AC terms, so - * the simplification applies less often (typically 5% to 10% of the time). - * On machines with very fast multiplication, it's possible that the - * test takes more time than it's worth. In that case this section - * may be commented out. - */ - -#ifndef NO_ZERO_ROW_TEST - if (wsptr[1] == 0 && wsptr[2] == 0 && wsptr[3] == 0 && wsptr[4] == 0 && - wsptr[5] == 0 && wsptr[6] == 0 && wsptr[7] == 0) { - /* AC terms all zero */ - JSAMPLE dcval = range_limit[(int) DESCALE((JPEG_INT32) wsptr[0], PASS1_BITS+3) - & RANGE_MASK]; - - outptr[0] = dcval; - outptr[1] = dcval; - outptr[2] = dcval; - outptr[3] = dcval; - outptr[4] = dcval; - outptr[5] = dcval; - outptr[6] = dcval; - outptr[7] = dcval; - - wsptr += DCTSIZE; /* advance pointer to next row */ - continue; - } -#endif - - /* Even part: reverse the even part of the forward DCT. */ - /* The rotator is sqrt(2)*c(-6). */ - - z2 = (JPEG_INT32) wsptr[2]; - z3 = (JPEG_INT32) wsptr[6]; - - z1 = MULTIPLY(z2 + z3, FIX_0_541196100); - tmp2 = z1 + MULTIPLY(z3, - FIX_1_847759065); - tmp3 = z1 + MULTIPLY(z2, FIX_0_765366865); - - tmp0 = ((JPEG_INT32) wsptr[0] + (JPEG_INT32) wsptr[4]) << CONST_BITS; - tmp1 = ((JPEG_INT32) wsptr[0] - (JPEG_INT32) wsptr[4]) << CONST_BITS; - - tmp10 = tmp0 + tmp3; - tmp13 = tmp0 - tmp3; - tmp11 = tmp1 + tmp2; - tmp12 = tmp1 - tmp2; - - /* Odd part per figure 8; the matrix is unitary and hence its - * transpose is its inverse. i0..i3 are y7,y5,y3,y1 respectively. - */ - - tmp0 = (JPEG_INT32) wsptr[7]; - tmp1 = (JPEG_INT32) wsptr[5]; - tmp2 = (JPEG_INT32) wsptr[3]; - tmp3 = (JPEG_INT32) wsptr[1]; - - z1 = tmp0 + tmp3; - z2 = tmp1 + tmp2; - z3 = tmp0 + tmp2; - z4 = tmp1 + tmp3; - z5 = MULTIPLY(z3 + z4, FIX_1_175875602); /* sqrt(2) * c3 */ - - tmp0 = MULTIPLY(tmp0, FIX_0_298631336); /* sqrt(2) * (-c1+c3+c5-c7) */ - tmp1 = MULTIPLY(tmp1, FIX_2_053119869); /* sqrt(2) * ( c1+c3-c5+c7) */ - tmp2 = MULTIPLY(tmp2, FIX_3_072711026); /* sqrt(2) * ( c1+c3+c5-c7) */ - tmp3 = MULTIPLY(tmp3, FIX_1_501321110); /* sqrt(2) * ( c1+c3-c5-c7) */ - z1 = MULTIPLY(z1, - FIX_0_899976223); /* sqrt(2) * (c7-c3) */ - z2 = MULTIPLY(z2, - FIX_2_562915447); /* sqrt(2) * (-c1-c3) */ - z3 = MULTIPLY(z3, - FIX_1_961570560); /* sqrt(2) * (-c3-c5) */ - z4 = MULTIPLY(z4, - FIX_0_390180644); /* sqrt(2) * (c5-c3) */ - - z3 += z5; - z4 += z5; - - tmp0 += z1 + z3; - tmp1 += z2 + z4; - tmp2 += z2 + z3; - tmp3 += z1 + z4; - - /* Final output stage: inputs are tmp10..tmp13, tmp0..tmp3 */ - - outptr[0] = range_limit[(int) DESCALE(tmp10 + tmp3, - CONST_BITS+PASS1_BITS+3) - & RANGE_MASK]; - outptr[7] = range_limit[(int) DESCALE(tmp10 - tmp3, - CONST_BITS+PASS1_BITS+3) - & RANGE_MASK]; - outptr[1] = range_limit[(int) DESCALE(tmp11 + tmp2, - CONST_BITS+PASS1_BITS+3) - & RANGE_MASK]; - outptr[6] = range_limit[(int) DESCALE(tmp11 - tmp2, - CONST_BITS+PASS1_BITS+3) - & RANGE_MASK]; - outptr[2] = range_limit[(int) DESCALE(tmp12 + tmp1, - CONST_BITS+PASS1_BITS+3) - & RANGE_MASK]; - outptr[5] = range_limit[(int) DESCALE(tmp12 - tmp1, - CONST_BITS+PASS1_BITS+3) - & RANGE_MASK]; - outptr[3] = range_limit[(int) DESCALE(tmp13 + tmp0, - CONST_BITS+PASS1_BITS+3) - & RANGE_MASK]; - outptr[4] = range_limit[(int) DESCALE(tmp13 - tmp0, - CONST_BITS+PASS1_BITS+3) - & RANGE_MASK]; - - wsptr += DCTSIZE; /* advance pointer to next row */ - } -} - -#endif /* DCT_ISLOW_SUPPORTED */ diff --git a/wxWidgets/src/jpeg/jidctred.c b/wxWidgets/src/jpeg/jidctred.c deleted file mode 100644 index efda35aeb5..0000000000 --- a/wxWidgets/src/jpeg/jidctred.c +++ /dev/null @@ -1,398 +0,0 @@ -/* - * jidctred.c - * - * Copyright (C) 1994-1998, Thomas G. Lane. - * This file is part of the Independent JPEG Group's software. - * For conditions of distribution and use, see the accompanying README file. - * - * This file contains inverse-DCT routines that produce reduced-size output: - * either 4x4, 2x2, or 1x1 pixels from an 8x8 DCT block. - * - * The implementation is based on the Loeffler, Ligtenberg and Moschytz (LL&M) - * algorithm used in jidctint.c. We simply replace each 8-to-8 1-D IDCT step - * with an 8-to-4 step that produces the four averages of two adjacent outputs - * (or an 8-to-2 step producing two averages of four outputs, for 2x2 output). - * These steps were derived by computing the corresponding values at the end - * of the normal LL&M code, then simplifying as much as possible. - * - * 1x1 is trivial: just take the DC coefficient divided by 8. - * - * See jidctint.c for additional comments. - */ - -#define JPEG_INTERNALS -#include "jinclude.h" -#include "jpeglib.h" -#include "jdct.h" /* Private declarations for DCT subsystem */ - -#ifdef IDCT_SCALING_SUPPORTED - - -/* - * This module is specialized to the case DCTSIZE = 8. - */ - -#if DCTSIZE != 8 - Sorry, this code only copes with 8x8 DCTs. /* deliberate syntax err */ -#endif - - -/* Scaling is the same as in jidctint.c. */ - -#if BITS_IN_JSAMPLE == 8 -#define CONST_BITS 13 -#define PASS1_BITS 2 -#else -#define CONST_BITS 13 -#define PASS1_BITS 1 /* lose a little precision to avoid overflow */ -#endif - -/* Some C compilers fail to reduce "FIX(constant)" at compile time, thus - * causing a lot of useless floating-point operations at run time. - * To get around this we use the following pre-calculated constants. - * If you change CONST_BITS you may want to add appropriate values. - * (With a reasonable C compiler, you can just rely on the FIX() macro...) - */ - -#if CONST_BITS == 13 -#define FIX_0_211164243 ((JPEG_INT32) 1730) /* FIX(0.211164243) */ -#define FIX_0_509795579 ((JPEG_INT32) 4176) /* FIX(0.509795579) */ -#define FIX_0_601344887 ((JPEG_INT32) 4926) /* FIX(0.601344887) */ -#define FIX_0_720959822 ((JPEG_INT32) 5906) /* FIX(0.720959822) */ -#define FIX_0_765366865 ((JPEG_INT32) 6270) /* FIX(0.765366865) */ -#define FIX_0_850430095 ((JPEG_INT32) 6967) /* FIX(0.850430095) */ -#define FIX_0_899976223 ((JPEG_INT32) 7373) /* FIX(0.899976223) */ -#define FIX_1_061594337 ((JPEG_INT32) 8697) /* FIX(1.061594337) */ -#define FIX_1_272758580 ((JPEG_INT32) 10426) /* FIX(1.272758580) */ -#define FIX_1_451774981 ((JPEG_INT32) 11893) /* FIX(1.451774981) */ -#define FIX_1_847759065 ((JPEG_INT32) 15137) /* FIX(1.847759065) */ -#define FIX_2_172734803 ((JPEG_INT32) 17799) /* FIX(2.172734803) */ -#define FIX_2_562915447 ((JPEG_INT32) 20995) /* FIX(2.562915447) */ -#define FIX_3_624509785 ((JPEG_INT32) 29692) /* FIX(3.624509785) */ -#else -#define FIX_0_211164243 FIX(0.211164243) -#define FIX_0_509795579 FIX(0.509795579) -#define FIX_0_601344887 FIX(0.601344887) -#define FIX_0_720959822 FIX(0.720959822) -#define FIX_0_765366865 FIX(0.765366865) -#define FIX_0_850430095 FIX(0.850430095) -#define FIX_0_899976223 FIX(0.899976223) -#define FIX_1_061594337 FIX(1.061594337) -#define FIX_1_272758580 FIX(1.272758580) -#define FIX_1_451774981 FIX(1.451774981) -#define FIX_1_847759065 FIX(1.847759065) -#define FIX_2_172734803 FIX(2.172734803) -#define FIX_2_562915447 FIX(2.562915447) -#define FIX_3_624509785 FIX(3.624509785) -#endif - - -/* Multiply an INT32 variable by an INT32 constant to yield an INT32 result. - * For 8-bit samples with the recommended scaling, all the variable - * and constant values involved are no more than 16 bits wide, so a - * 16x16->32 bit multiply can be used instead of a full 32x32 multiply. - * For 12-bit samples, a full 32-bit multiplication will be needed. - */ - -#if BITS_IN_JSAMPLE == 8 -#define MULTIPLY(var,const) MULTIPLY16C16(var,const) -#else -#define MULTIPLY(var,const) ((var) * (const)) -#endif - - -/* Dequantize a coefficient by multiplying it by the multiplier-table - * entry; produce an int result. In this module, both inputs and result - * are 16 bits or less, so either int or short multiply will work. - */ - -#define DEQUANTIZE(coef,quantval) (((ISLOW_MULT_TYPE) (coef)) * (quantval)) - - -/* - * Perform dequantization and inverse DCT on one block of coefficients, - * producing a reduced-size 4x4 output block. - */ - -GLOBAL(void) -jpeg_idct_4x4 (j_decompress_ptr cinfo, jpeg_component_info * compptr, - JCOEFPTR coef_block, - JSAMPARRAY output_buf, JDIMENSION output_col) -{ - JPEG_INT32 tmp0, tmp2, tmp10, tmp12; - JPEG_INT32 z1, z2, z3, z4; - JCOEFPTR inptr; - ISLOW_MULT_TYPE * quantptr; - int * wsptr; - JSAMPROW outptr; - JSAMPLE *range_limit = IDCT_range_limit(cinfo); - int ctr; - int workspace[DCTSIZE*4]; /* buffers data between passes */ - SHIFT_TEMPS - - /* Pass 1: process columns from input, store into work array. */ - - inptr = coef_block; - quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table; - wsptr = workspace; - for (ctr = DCTSIZE; ctr > 0; inptr++, quantptr++, wsptr++, ctr--) { - /* Don't bother to process column 4, because second pass won't use it */ - if (ctr == DCTSIZE-4) - continue; - if (inptr[DCTSIZE*1] == 0 && inptr[DCTSIZE*2] == 0 && - inptr[DCTSIZE*3] == 0 && inptr[DCTSIZE*5] == 0 && - inptr[DCTSIZE*6] == 0 && inptr[DCTSIZE*7] == 0) { - /* AC terms all zero; we need not examine term 4 for 4x4 output */ - int dcval = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]) << PASS1_BITS; - - wsptr[DCTSIZE*0] = dcval; - wsptr[DCTSIZE*1] = dcval; - wsptr[DCTSIZE*2] = dcval; - wsptr[DCTSIZE*3] = dcval; - - continue; - } - - /* Even part */ - - tmp0 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]); - tmp0 <<= (CONST_BITS+1); - - z2 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]); - z3 = DEQUANTIZE(inptr[DCTSIZE*6], quantptr[DCTSIZE*6]); - - tmp2 = MULTIPLY(z2, FIX_1_847759065) + MULTIPLY(z3, - FIX_0_765366865); - - tmp10 = tmp0 + tmp2; - tmp12 = tmp0 - tmp2; - - /* Odd part */ - - z1 = DEQUANTIZE(inptr[DCTSIZE*7], quantptr[DCTSIZE*7]); - z2 = DEQUANTIZE(inptr[DCTSIZE*5], quantptr[DCTSIZE*5]); - z3 = DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]); - z4 = DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]); - - tmp0 = MULTIPLY(z1, - FIX_0_211164243) /* sqrt(2) * (c3-c1) */ - + MULTIPLY(z2, FIX_1_451774981) /* sqrt(2) * (c3+c7) */ - + MULTIPLY(z3, - FIX_2_172734803) /* sqrt(2) * (-c1-c5) */ - + MULTIPLY(z4, FIX_1_061594337); /* sqrt(2) * (c5+c7) */ - - tmp2 = MULTIPLY(z1, - FIX_0_509795579) /* sqrt(2) * (c7-c5) */ - + MULTIPLY(z2, - FIX_0_601344887) /* sqrt(2) * (c5-c1) */ - + MULTIPLY(z3, FIX_0_899976223) /* sqrt(2) * (c3-c7) */ - + MULTIPLY(z4, FIX_2_562915447); /* sqrt(2) * (c1+c3) */ - - /* Final output stage */ - - wsptr[DCTSIZE*0] = (int) DESCALE(tmp10 + tmp2, CONST_BITS-PASS1_BITS+1); - wsptr[DCTSIZE*3] = (int) DESCALE(tmp10 - tmp2, CONST_BITS-PASS1_BITS+1); - wsptr[DCTSIZE*1] = (int) DESCALE(tmp12 + tmp0, CONST_BITS-PASS1_BITS+1); - wsptr[DCTSIZE*2] = (int) DESCALE(tmp12 - tmp0, CONST_BITS-PASS1_BITS+1); - } - - /* Pass 2: process 4 rows from work array, store into output array. */ - - wsptr = workspace; - for (ctr = 0; ctr < 4; ctr++) { - outptr = output_buf[ctr] + output_col; - /* It's not clear whether a zero row test is worthwhile here ... */ - -#ifndef NO_ZERO_ROW_TEST - if (wsptr[1] == 0 && wsptr[2] == 0 && wsptr[3] == 0 && - wsptr[5] == 0 && wsptr[6] == 0 && wsptr[7] == 0) { - /* AC terms all zero */ - JSAMPLE dcval = range_limit[(int) DESCALE((JPEG_INT32) wsptr[0], PASS1_BITS+3) - & RANGE_MASK]; - - outptr[0] = dcval; - outptr[1] = dcval; - outptr[2] = dcval; - outptr[3] = dcval; - - wsptr += DCTSIZE; /* advance pointer to next row */ - continue; - } -#endif - - /* Even part */ - - tmp0 = ((JPEG_INT32) wsptr[0]) << (CONST_BITS+1); - - tmp2 = MULTIPLY((JPEG_INT32) wsptr[2], FIX_1_847759065) - + MULTIPLY((JPEG_INT32) wsptr[6], - FIX_0_765366865); - - tmp10 = tmp0 + tmp2; - tmp12 = tmp0 - tmp2; - - /* Odd part */ - - z1 = (JPEG_INT32) wsptr[7]; - z2 = (JPEG_INT32) wsptr[5]; - z3 = (JPEG_INT32) wsptr[3]; - z4 = (JPEG_INT32) wsptr[1]; - - tmp0 = MULTIPLY(z1, - FIX_0_211164243) /* sqrt(2) * (c3-c1) */ - + MULTIPLY(z2, FIX_1_451774981) /* sqrt(2) * (c3+c7) */ - + MULTIPLY(z3, - FIX_2_172734803) /* sqrt(2) * (-c1-c5) */ - + MULTIPLY(z4, FIX_1_061594337); /* sqrt(2) * (c5+c7) */ - - tmp2 = MULTIPLY(z1, - FIX_0_509795579) /* sqrt(2) * (c7-c5) */ - + MULTIPLY(z2, - FIX_0_601344887) /* sqrt(2) * (c5-c1) */ - + MULTIPLY(z3, FIX_0_899976223) /* sqrt(2) * (c3-c7) */ - + MULTIPLY(z4, FIX_2_562915447); /* sqrt(2) * (c1+c3) */ - - /* Final output stage */ - - outptr[0] = range_limit[(int) DESCALE(tmp10 + tmp2, - CONST_BITS+PASS1_BITS+3+1) - & RANGE_MASK]; - outptr[3] = range_limit[(int) DESCALE(tmp10 - tmp2, - CONST_BITS+PASS1_BITS+3+1) - & RANGE_MASK]; - outptr[1] = range_limit[(int) DESCALE(tmp12 + tmp0, - CONST_BITS+PASS1_BITS+3+1) - & RANGE_MASK]; - outptr[2] = range_limit[(int) DESCALE(tmp12 - tmp0, - CONST_BITS+PASS1_BITS+3+1) - & RANGE_MASK]; - - wsptr += DCTSIZE; /* advance pointer to next row */ - } -} - - -/* - * Perform dequantization and inverse DCT on one block of coefficients, - * producing a reduced-size 2x2 output block. - */ - -GLOBAL(void) -jpeg_idct_2x2 (j_decompress_ptr cinfo, jpeg_component_info * compptr, - JCOEFPTR coef_block, - JSAMPARRAY output_buf, JDIMENSION output_col) -{ - JPEG_INT32 tmp0, tmp10, z1; - JCOEFPTR inptr; - ISLOW_MULT_TYPE * quantptr; - int * wsptr; - JSAMPROW outptr; - JSAMPLE *range_limit = IDCT_range_limit(cinfo); - int ctr; - int workspace[DCTSIZE*2]; /* buffers data between passes */ - SHIFT_TEMPS - - /* Pass 1: process columns from input, store into work array. */ - - inptr = coef_block; - quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table; - wsptr = workspace; - for (ctr = DCTSIZE; ctr > 0; inptr++, quantptr++, wsptr++, ctr--) { - /* Don't bother to process columns 2,4,6 */ - if (ctr == DCTSIZE-2 || ctr == DCTSIZE-4 || ctr == DCTSIZE-6) - continue; - if (inptr[DCTSIZE*1] == 0 && inptr[DCTSIZE*3] == 0 && - inptr[DCTSIZE*5] == 0 && inptr[DCTSIZE*7] == 0) { - /* AC terms all zero; we need not examine terms 2,4,6 for 2x2 output */ - int dcval = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]) << PASS1_BITS; - - wsptr[DCTSIZE*0] = dcval; - wsptr[DCTSIZE*1] = dcval; - - continue; - } - - /* Even part */ - - z1 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]); - tmp10 = z1 << (CONST_BITS+2); - - /* Odd part */ - - z1 = DEQUANTIZE(inptr[DCTSIZE*7], quantptr[DCTSIZE*7]); - tmp0 = MULTIPLY(z1, - FIX_0_720959822); /* sqrt(2) * (c7-c5+c3-c1) */ - z1 = DEQUANTIZE(inptr[DCTSIZE*5], quantptr[DCTSIZE*5]); - tmp0 += MULTIPLY(z1, FIX_0_850430095); /* sqrt(2) * (-c1+c3+c5+c7) */ - z1 = DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]); - tmp0 += MULTIPLY(z1, - FIX_1_272758580); /* sqrt(2) * (-c1+c3-c5-c7) */ - z1 = DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]); - tmp0 += MULTIPLY(z1, FIX_3_624509785); /* sqrt(2) * (c1+c3+c5+c7) */ - - /* Final output stage */ - - wsptr[DCTSIZE*0] = (int) DESCALE(tmp10 + tmp0, CONST_BITS-PASS1_BITS+2); - wsptr[DCTSIZE*1] = (int) DESCALE(tmp10 - tmp0, CONST_BITS-PASS1_BITS+2); - } - - /* Pass 2: process 2 rows from work array, store into output array. */ - - wsptr = workspace; - for (ctr = 0; ctr < 2; ctr++) { - outptr = output_buf[ctr] + output_col; - /* It's not clear whether a zero row test is worthwhile here ... */ - -#ifndef NO_ZERO_ROW_TEST - if (wsptr[1] == 0 && wsptr[3] == 0 && wsptr[5] == 0 && wsptr[7] == 0) { - /* AC terms all zero */ - JSAMPLE dcval = range_limit[(int) DESCALE((JPEG_INT32) wsptr[0], PASS1_BITS+3) - & RANGE_MASK]; - - outptr[0] = dcval; - outptr[1] = dcval; - - wsptr += DCTSIZE; /* advance pointer to next row */ - continue; - } -#endif - - /* Even part */ - - tmp10 = ((JPEG_INT32) wsptr[0]) << (CONST_BITS+2); - - /* Odd part */ - - tmp0 = MULTIPLY((JPEG_INT32) wsptr[7], - FIX_0_720959822) /* sqrt(2) * (c7-c5+c3-c1) */ - + MULTIPLY((JPEG_INT32) wsptr[5], FIX_0_850430095) /* sqrt(2) * (-c1+c3+c5+c7) */ - + MULTIPLY((JPEG_INT32) wsptr[3], - FIX_1_272758580) /* sqrt(2) * (-c1+c3-c5-c7) */ - + MULTIPLY((JPEG_INT32) wsptr[1], FIX_3_624509785); /* sqrt(2) * (c1+c3+c5+c7) */ - - /* Final output stage */ - - outptr[0] = range_limit[(int) DESCALE(tmp10 + tmp0, - CONST_BITS+PASS1_BITS+3+2) - & RANGE_MASK]; - outptr[1] = range_limit[(int) DESCALE(tmp10 - tmp0, - CONST_BITS+PASS1_BITS+3+2) - & RANGE_MASK]; - - wsptr += DCTSIZE; /* advance pointer to next row */ - } -} - - -/* - * Perform dequantization and inverse DCT on one block of coefficients, - * producing a reduced-size 1x1 output block. - */ - -GLOBAL(void) -jpeg_idct_1x1 (j_decompress_ptr cinfo, jpeg_component_info * compptr, - JCOEFPTR coef_block, - JSAMPARRAY output_buf, JDIMENSION output_col) -{ - int dcval; - ISLOW_MULT_TYPE * quantptr; - JSAMPLE *range_limit = IDCT_range_limit(cinfo); - SHIFT_TEMPS - - /* We hardly need an inverse DCT routine for this: just take the - * average pixel value, which is one-eighth of the DC coefficient. - */ - quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table; - dcval = DEQUANTIZE(coef_block[0], quantptr[0]); - dcval = (int) DESCALE((JPEG_INT32) dcval, 3); - - output_buf[0][output_col] = range_limit[dcval & RANGE_MASK]; -} - -#endif /* IDCT_SCALING_SUPPORTED */ diff --git a/wxWidgets/src/jpeg/jinclude.h b/wxWidgets/src/jpeg/jinclude.h deleted file mode 100644 index 0a4f15146a..0000000000 --- a/wxWidgets/src/jpeg/jinclude.h +++ /dev/null @@ -1,91 +0,0 @@ -/* - * jinclude.h - * - * Copyright (C) 1991-1994, Thomas G. Lane. - * This file is part of the Independent JPEG Group's software. - * For conditions of distribution and use, see the accompanying README file. - * - * This file exists to provide a single place to fix any problems with - * including the wrong system include files. (Common problems are taken - * care of by the standard jconfig symbols, but on really weird systems - * you may have to edit this file.) - * - * NOTE: this file is NOT intended to be included by applications using the - * JPEG library. Most applications need only include jpeglib.h. - */ - - -/* Include auto-config file to find out which system include files we need. */ - -#include "jconfig.h" /* auto configuration options */ -#define JCONFIG_INCLUDED /* so that jpeglib.h doesn't do it again */ - -/* - * We need the NULL macro and size_t typedef. - * On an ANSI-conforming system it is sufficient to include . - * Otherwise, we get them from or ; we may have to - * pull in as well. - * Note that the core JPEG library does not require ; - * only the default error handler and data source/destination modules do. - * But we must pull it in because of the references to FILE in jpeglib.h. - * You can remove those references if you want to compile without . - */ - -#ifdef HAVE_STDDEF_H -#include -#endif - -#ifdef HAVE_STDLIB_H -#include -#endif - -#ifdef NEED_SYS_TYPES_H -#include -#endif - -#include - -/* - * We need memory copying and zeroing functions, plus strncpy(). - * ANSI and System V implementations declare these in . - * BSD doesn't have the mem() functions, but it does have bcopy()/bzero(). - * Some systems may declare memset and memcpy in . - * - * NOTE: we assume the size parameters to these functions are of type size_t. - * Change the casts in these macros if not! - */ - -#ifdef NEED_BSD_STRINGS - -#include -#define MEMZERO(target,size) bzero((void *)(target), (size_t)(size)) -#define MEMCOPY(dest,src,size) bcopy((const void *)(src), (void *)(dest), (size_t)(size)) - -#else /* not BSD, assume ANSI/SysV string lib */ - -#include -#define MEMZERO(target,size) memset((void *)(target), 0, (size_t)(size)) -#define MEMCOPY(dest,src,size) memcpy((void *)(dest), (const void *)(src), (size_t)(size)) - -#endif - -/* - * In ANSI C, and indeed any rational implementation, size_t is also the - * type returned by sizeof(). However, it seems there are some irrational - * implementations out there, in which sizeof() returns an int even though - * size_t is defined as long or unsigned long. To ensure consistent results - * we always use this SIZEOF() macro in place of using sizeof() directly. - */ - -#define SIZEOF(object) ((size_t) sizeof(object)) - -/* - * The modules that use fread() and fwrite() always invoke them through - * these macros. On some systems you may need to twiddle the argument casts. - * CAUTION: argument order is different from underlying functions! - */ - -#define JFREAD(file,buf,sizeofbuf) \ - ((size_t) fread((void *) (buf), (size_t) 1, (size_t) (sizeofbuf), (file))) -#define JFWRITE(file,buf,sizeofbuf) \ - ((size_t) fwrite((const void *) (buf), (size_t) 1, (size_t) (sizeofbuf), (file))) diff --git a/wxWidgets/src/jpeg/jmemansi.c b/wxWidgets/src/jpeg/jmemansi.c deleted file mode 100644 index 2d93e49625..0000000000 --- a/wxWidgets/src/jpeg/jmemansi.c +++ /dev/null @@ -1,167 +0,0 @@ -/* - * jmemansi.c - * - * Copyright (C) 1992-1996, Thomas G. Lane. - * This file is part of the Independent JPEG Group's software. - * For conditions of distribution and use, see the accompanying README file. - * - * This file provides a simple generic implementation of the system- - * dependent portion of the JPEG memory manager. This implementation - * assumes that you have the ANSI-standard library routine tmpfile(). - * Also, the problem of determining the amount of memory available - * is shoved onto the user. - */ - -#define JPEG_INTERNALS -#include "jinclude.h" -#include "jpeglib.h" -#include "jmemsys.h" /* import the system-dependent declarations */ - -#ifndef HAVE_STDLIB_H /* should declare malloc(),free() */ -extern void * malloc JPP((size_t size)); -extern void free JPP((void *ptr)); -#endif - -#ifndef SEEK_SET /* pre-ANSI systems may not define this; */ -#define SEEK_SET 0 /* if not, assume 0 is correct */ -#endif - - -/* - * Memory allocation and freeing are controlled by the regular library - * routines malloc() and free(). - */ - -GLOBAL(void *) -jpeg_get_small (j_common_ptr cinfo, size_t sizeofobject) -{ - return (void *) malloc(sizeofobject); -} - -GLOBAL(void) -jpeg_free_small (j_common_ptr cinfo, void * object, size_t sizeofobject) -{ - free(object); -} - - -/* - * "Large" objects are treated the same as "small" ones. - * NB: although we include FAR keywords in the routine declarations, - * this file won't actually work in 80x86 small/medium model; at least, - * you probably won't be able to process useful-size images in only 64KB. - */ - -GLOBAL(void FAR *) -jpeg_get_large (j_common_ptr cinfo, size_t sizeofobject) -{ - return (void FAR *) malloc(sizeofobject); -} - -GLOBAL(void) -jpeg_free_large (j_common_ptr cinfo, void FAR * object, size_t sizeofobject) -{ - free(object); -} - - -/* - * This routine computes the total memory space available for allocation. - * It's impossible to do this in a portable way; our current solution is - * to make the user tell us (with a default value set at compile time). - * If you can actually get the available space, it's a good idea to subtract - * a slop factor of 5% or so. - */ - -#ifndef DEFAULT_MAX_MEM /* so can override from makefile */ -#define DEFAULT_MAX_MEM 1000000L /* default: one megabyte */ -#endif - -GLOBAL(long) -jpeg_mem_available (j_common_ptr cinfo, long min_bytes_needed, - long max_bytes_needed, long already_allocated) -{ - return cinfo->mem->max_memory_to_use - already_allocated; -} - - -/* - * Backing store (temporary file) management. - * Backing store objects are only used when the value returned by - * jpeg_mem_available is less than the total space needed. You can dispense - * with these routines if you have plenty of virtual memory; see jmemnobs.c. - */ - - -METHODDEF(void) -read_backing_store (j_common_ptr cinfo, backing_store_ptr info, - void FAR * buffer_address, - long file_offset, long byte_count) -{ - if (fseek(info->temp_file, file_offset, SEEK_SET)) - ERREXIT(cinfo, JERR_TFILE_SEEK); - if (JFREAD(info->temp_file, buffer_address, byte_count) - != (size_t) byte_count) - ERREXIT(cinfo, JERR_TFILE_READ); -} - - -METHODDEF(void) -write_backing_store (j_common_ptr cinfo, backing_store_ptr info, - void FAR * buffer_address, - long file_offset, long byte_count) -{ - if (fseek(info->temp_file, file_offset, SEEK_SET)) - ERREXIT(cinfo, JERR_TFILE_SEEK); - if (JFWRITE(info->temp_file, buffer_address, byte_count) - != (size_t) byte_count) - ERREXIT(cinfo, JERR_TFILE_WRITE); -} - - -METHODDEF(void) -close_backing_store (j_common_ptr cinfo, backing_store_ptr info) -{ - fclose(info->temp_file); - /* Since this implementation uses tmpfile() to create the file, - * no explicit file deletion is needed. - */ -} - - -/* - * Initial opening of a backing-store object. - * - * This version uses tmpfile(), which constructs a suitable file name - * behind the scenes. We don't have to use info->temp_name[] at all; - * indeed, we can't even find out the actual name of the temp file. - */ - -GLOBAL(void) -jpeg_open_backing_store (j_common_ptr cinfo, backing_store_ptr info, - long total_bytes_needed) -{ - if ((info->temp_file = tmpfile()) == NULL) - ERREXITS(cinfo, JERR_TFILE_CREATE, ""); - info->read_backing_store = read_backing_store; - info->write_backing_store = write_backing_store; - info->close_backing_store = close_backing_store; -} - - -/* - * These routines take care of any system-dependent initialization and - * cleanup required. - */ - -GLOBAL(long) -jpeg_mem_init (j_common_ptr cinfo) -{ - return DEFAULT_MAX_MEM; /* default for max_memory_to_use */ -} - -GLOBAL(void) -jpeg_mem_term (j_common_ptr cinfo) -{ - /* no work */ -} diff --git a/wxWidgets/src/jpeg/jmemdos.c b/wxWidgets/src/jpeg/jmemdos.c deleted file mode 100644 index d64835d57c..0000000000 --- a/wxWidgets/src/jpeg/jmemdos.c +++ /dev/null @@ -1,638 +0,0 @@ -/* - * jmemdos.c - * - * Copyright (C) 1992-1997, Thomas G. Lane. - * This file is part of the Independent JPEG Group's software. - * For conditions of distribution and use, see the accompanying README file. - * - * This file provides an MS-DOS-compatible implementation of the system- - * dependent portion of the JPEG memory manager. Temporary data can be - * stored in extended or expanded memory as well as in regular DOS files. - * - * If you use this file, you must be sure that NEED_FAR_POINTERS is defined - * if you compile in a small-data memory model; it should NOT be defined if - * you use a large-data memory model. This file is not recommended if you - * are using a flat-memory-space 386 environment such as DJGCC or Watcom C. - * Also, this code will NOT work if struct fields are aligned on greater than - * 2-byte boundaries. - * - * Based on code contributed by Ge' Weijers. - */ - -/* - * If you have both extended and expanded memory, you may want to change the - * order in which they are tried in jopen_backing_store. On a 286 machine - * expanded memory is usually faster, since extended memory access involves - * an expensive protected-mode-and-back switch. On 386 and better, extended - * memory is usually faster. As distributed, the code tries extended memory - * first (what? not everyone has a 386? :-). - * - * You can disable use of extended/expanded memory entirely by altering these - * definitions or overriding them from the Makefile (eg, -DEMS_SUPPORTED=0). - */ - -#ifndef XMS_SUPPORTED -#define XMS_SUPPORTED 1 -#endif -#ifndef EMS_SUPPORTED -#define EMS_SUPPORTED 1 -#endif - - -#define JPEG_INTERNALS -#include "jinclude.h" -#include "jpeglib.h" -#include "jmemsys.h" /* import the system-dependent declarations */ - -#ifndef HAVE_STDLIB_H /* should declare these */ -extern void * malloc JPP((size_t size)); -extern void free JPP((void *ptr)); -extern char * getenv JPP((const char * name)); -#endif - -#ifdef NEED_FAR_POINTERS - -#ifdef __TURBOC__ -/* These definitions work for Borland C (Turbo C) */ -#include /* need farmalloc(), farfree() */ -#define far_malloc(x) farmalloc(x) -#define far_free(x) farfree(x) -#else -/* These definitions work for Microsoft C and compatible compilers */ -#include /* need _fmalloc(), _ffree() */ -#define far_malloc(x) _fmalloc(x) -#define far_free(x) _ffree(x) -#endif - -#else /* not NEED_FAR_POINTERS */ - -#define far_malloc(x) malloc(x) -#define far_free(x) free(x) - -#endif /* NEED_FAR_POINTERS */ - -#ifdef DONT_USE_B_MODE /* define mode parameters for fopen() */ -#define READ_BINARY "r" -#else -#define READ_BINARY "rb" -#endif - -#ifndef USE_MSDOS_MEMMGR /* make sure user got configuration right */ - You forgot to define USE_MSDOS_MEMMGR in jconfig.h. /* deliberate syntax error */ -#endif - -#if MAX_ALLOC_CHUNK >= 65535L /* make sure jconfig.h got this right */ - MAX_ALLOC_CHUNK should be less than 64K. /* deliberate syntax error */ -#endif - - -/* - * Declarations for assembly-language support routines (see jmemdosa.asm). - * - * The functions are declared "far" as are all their pointer arguments; - * this ensures the assembly source code will work regardless of the - * compiler memory model. We assume "short" is 16 bits, "long" is 32. - */ - -typedef void far * XMSDRIVER; /* actually a pointer to code */ -typedef struct { /* registers for calling XMS driver */ - unsigned short ax, dx, bx; - void far * ds_si; - } XMScontext; -typedef struct { /* registers for calling EMS driver */ - unsigned short ax, dx, bx; - void far * ds_si; - } EMScontext; - -extern short far jdos_open JPP((short far * handle, char far * filename)); -extern short far jdos_close JPP((short handle)); -extern short far jdos_seek JPP((short handle, long offset)); -extern short far jdos_read JPP((short handle, void far * buffer, - unsigned short count)); -extern short far jdos_write JPP((short handle, void far * buffer, - unsigned short count)); -extern void far jxms_getdriver JPP((XMSDRIVER far *)); -extern void far jxms_calldriver JPP((XMSDRIVER, XMScontext far *)); -extern short far jems_available JPP((void)); -extern void far jems_calldriver JPP((EMScontext far *)); - - -/* - * Selection of a file name for a temporary file. - * This is highly system-dependent, and you may want to customize it. - */ - -static int next_file_num; /* to distinguish among several temp files */ - -LOCAL(void) -select_file_name (char * fname) -{ - const char * env; - char * ptr; - FILE * tfile; - - /* Keep generating file names till we find one that's not in use */ - for (;;) { - /* Get temp directory name from environment TMP or TEMP variable; - * if none, use "." - */ - if ((env = (const char *) getenv("TMP")) == NULL) - if ((env = (const char *) getenv("TEMP")) == NULL) - env = "."; - if (*env == '\0') /* null string means "." */ - env = "."; - ptr = fname; /* copy name to fname */ - while (*env != '\0') - *ptr++ = *env++; - if (ptr[-1] != '\\' && ptr[-1] != '/') - *ptr++ = '\\'; /* append backslash if not in env variable */ - /* Append a suitable file name */ - next_file_num++; /* advance counter */ - sprintf(ptr, "JPG%03d.TMP", next_file_num); - /* Probe to see if file name is already in use */ - if ((tfile = fopen(fname, READ_BINARY)) == NULL) - break; - fclose(tfile); /* oops, it's there; close tfile & try again */ - } -} - - -/* - * Near-memory allocation and freeing are controlled by the regular library - * routines malloc() and free(). - */ - -GLOBAL(void *) -jpeg_get_small (j_common_ptr cinfo, size_t sizeofobject) -{ - return (void *) malloc(sizeofobject); -} - -GLOBAL(void) -jpeg_free_small (j_common_ptr cinfo, void * object, size_t sizeofobject) -{ - free(object); -} - - -/* - * "Large" objects are allocated in far memory, if possible - */ - -GLOBAL(void FAR *) -jpeg_get_large (j_common_ptr cinfo, size_t sizeofobject) -{ - return (void FAR *) far_malloc(sizeofobject); -} - -GLOBAL(void) -jpeg_free_large (j_common_ptr cinfo, void FAR * object, size_t sizeofobject) -{ - far_free(object); -} - - -/* - * This routine computes the total memory space available for allocation. - * It's impossible to do this in a portable way; our current solution is - * to make the user tell us (with a default value set at compile time). - * If you can actually get the available space, it's a good idea to subtract - * a slop factor of 5% or so. - */ - -#ifndef DEFAULT_MAX_MEM /* so can override from makefile */ -#define DEFAULT_MAX_MEM 300000L /* for total usage about 450K */ -#endif - -GLOBAL(long) -jpeg_mem_available (j_common_ptr cinfo, long min_bytes_needed, - long max_bytes_needed, long already_allocated) -{ - return cinfo->mem->max_memory_to_use - already_allocated; -} - - -/* - * Backing store (temporary file) management. - * Backing store objects are only used when the value returned by - * jpeg_mem_available is less than the total space needed. You can dispense - * with these routines if you have plenty of virtual memory; see jmemnobs.c. - */ - -/* - * For MS-DOS we support three types of backing storage: - * 1. Conventional DOS files. We access these by direct DOS calls rather - * than via the stdio package. This provides a bit better performance, - * but the real reason is that the buffers to be read or written are FAR. - * The stdio library for small-data memory models can't cope with that. - * 2. Extended memory, accessed per the XMS V2.0 specification. - * 3. Expanded memory, accessed per the LIM/EMS 4.0 specification. - * You'll need copies of those specs to make sense of the related code. - * The specs are available by Internet FTP from the SIMTEL archives - * (oak.oakland.edu and its various mirror sites). See files - * pub/msdos/microsoft/xms20.arc and pub/msdos/info/limems41.zip. - */ - - -/* - * Access methods for a DOS file. - */ - - -METHODDEF(void) -read_file_store (j_common_ptr cinfo, backing_store_ptr info, - void FAR * buffer_address, - long file_offset, long byte_count) -{ - if (jdos_seek(info->handle.file_handle, file_offset)) - ERREXIT(cinfo, JERR_TFILE_SEEK); - /* Since MAX_ALLOC_CHUNK is less than 64K, byte_count will be too. */ - if (byte_count > 65535L) /* safety check */ - ERREXIT(cinfo, JERR_BAD_ALLOC_CHUNK); - if (jdos_read(info->handle.file_handle, buffer_address, - (unsigned short) byte_count)) - ERREXIT(cinfo, JERR_TFILE_READ); -} - - -METHODDEF(void) -write_file_store (j_common_ptr cinfo, backing_store_ptr info, - void FAR * buffer_address, - long file_offset, long byte_count) -{ - if (jdos_seek(info->handle.file_handle, file_offset)) - ERREXIT(cinfo, JERR_TFILE_SEEK); - /* Since MAX_ALLOC_CHUNK is less than 64K, byte_count will be too. */ - if (byte_count > 65535L) /* safety check */ - ERREXIT(cinfo, JERR_BAD_ALLOC_CHUNK); - if (jdos_write(info->handle.file_handle, buffer_address, - (unsigned short) byte_count)) - ERREXIT(cinfo, JERR_TFILE_WRITE); -} - - -METHODDEF(void) -close_file_store (j_common_ptr cinfo, backing_store_ptr info) -{ - jdos_close(info->handle.file_handle); /* close the file */ - remove(info->temp_name); /* delete the file */ -/* If your system doesn't have remove(), try unlink() instead. - * remove() is the ANSI-standard name for this function, but - * unlink() was more common in pre-ANSI systems. - */ - TRACEMSS(cinfo, 1, JTRC_TFILE_CLOSE, info->temp_name); -} - - -LOCAL(wxjpeg_boolean) -open_file_store (j_common_ptr cinfo, backing_store_ptr info, - long total_bytes_needed) -{ - short handle; - - select_file_name(info->temp_name); - if (jdos_open((short far *) & handle, (char far *) info->temp_name)) { - /* might as well exit since jpeg_open_backing_store will fail anyway */ - ERREXITS(cinfo, JERR_TFILE_CREATE, info->temp_name); - return FALSE; - } - info->handle.file_handle = handle; - info->read_backing_store = read_file_store; - info->write_backing_store = write_file_store; - info->close_backing_store = close_file_store; - TRACEMSS(cinfo, 1, JTRC_TFILE_OPEN, info->temp_name); - return TRUE; /* succeeded */ -} - - -/* - * Access methods for extended memory. - */ - -#if XMS_SUPPORTED - -static XMSDRIVER xms_driver; /* saved address of XMS driver */ - -typedef union { /* either long offset or real-mode pointer */ - long offset; - void far * ptr; - } XMSPTR; - -typedef struct { /* XMS move specification structure */ - long length; - XMSH src_handle; - XMSPTR src; - XMSH dst_handle; - XMSPTR dst; - } XMSspec; - -#define ODD(X) (((X) & 1L) != 0) - - -METHODDEF(void) -read_xms_store (j_common_ptr cinfo, backing_store_ptr info, - void FAR * buffer_address, - long file_offset, long byte_count) -{ - XMScontext ctx; - XMSspec spec; - char endbuffer[2]; - - /* The XMS driver can't cope with an odd length, so handle the last byte - * specially if byte_count is odd. We don't expect this to be common. - */ - - spec.length = byte_count & (~ 1L); - spec.src_handle = info->handle.xms_handle; - spec.src.offset = file_offset; - spec.dst_handle = 0; - spec.dst.ptr = buffer_address; - - ctx.ds_si = (void far *) & spec; - ctx.ax = 0x0b00; /* EMB move */ - jxms_calldriver(xms_driver, (XMScontext far *) & ctx); - if (ctx.ax != 1) - ERREXIT(cinfo, JERR_XMS_READ); - - if (ODD(byte_count)) { - read_xms_store(cinfo, info, (void FAR *) endbuffer, - file_offset + byte_count - 1L, 2L); - ((char FAR *) buffer_address)[byte_count - 1L] = endbuffer[0]; - } -} - - -METHODDEF(void) -write_xms_store (j_common_ptr cinfo, backing_store_ptr info, - void FAR * buffer_address, - long file_offset, long byte_count) -{ - XMScontext ctx; - XMSspec spec; - char endbuffer[2]; - - /* The XMS driver can't cope with an odd length, so handle the last byte - * specially if byte_count is odd. We don't expect this to be common. - */ - - spec.length = byte_count & (~ 1L); - spec.src_handle = 0; - spec.src.ptr = buffer_address; - spec.dst_handle = info->handle.xms_handle; - spec.dst.offset = file_offset; - - ctx.ds_si = (void far *) & spec; - ctx.ax = 0x0b00; /* EMB move */ - jxms_calldriver(xms_driver, (XMScontext far *) & ctx); - if (ctx.ax != 1) - ERREXIT(cinfo, JERR_XMS_WRITE); - - if (ODD(byte_count)) { - read_xms_store(cinfo, info, (void FAR *) endbuffer, - file_offset + byte_count - 1L, 2L); - endbuffer[0] = ((char FAR *) buffer_address)[byte_count - 1L]; - write_xms_store(cinfo, info, (void FAR *) endbuffer, - file_offset + byte_count - 1L, 2L); - } -} - - -METHODDEF(void) -close_xms_store (j_common_ptr cinfo, backing_store_ptr info) -{ - XMScontext ctx; - - ctx.dx = info->handle.xms_handle; - ctx.ax = 0x0a00; - jxms_calldriver(xms_driver, (XMScontext far *) & ctx); - TRACEMS1(cinfo, 1, JTRC_XMS_CLOSE, info->handle.xms_handle); - /* we ignore any error return from the driver */ -} - - -LOCAL(wxjpeg_boolean) -open_xms_store (j_common_ptr cinfo, backing_store_ptr info, - long total_bytes_needed) -{ - XMScontext ctx; - - /* Get address of XMS driver */ - jxms_getdriver((XMSDRIVER far *) & xms_driver); - if (xms_driver == NULL) - return FALSE; /* no driver to be had */ - - /* Get version number, must be >= 2.00 */ - ctx.ax = 0x0000; - jxms_calldriver(xms_driver, (XMScontext far *) & ctx); - if (ctx.ax < (unsigned short) 0x0200) - return FALSE; - - /* Try to get space (expressed in kilobytes) */ - ctx.dx = (unsigned short) ((total_bytes_needed + 1023L) >> 10); - ctx.ax = 0x0900; - jxms_calldriver(xms_driver, (XMScontext far *) & ctx); - if (ctx.ax != 1) - return FALSE; - - /* Succeeded, save the handle and away we go */ - info->handle.xms_handle = ctx.dx; - info->read_backing_store = read_xms_store; - info->write_backing_store = write_xms_store; - info->close_backing_store = close_xms_store; - TRACEMS1(cinfo, 1, JTRC_XMS_OPEN, ctx.dx); - return TRUE; /* succeeded */ -} - -#endif /* XMS_SUPPORTED */ - - -/* - * Access methods for expanded memory. - */ - -#if EMS_SUPPORTED - -/* The EMS move specification structure requires word and long fields aligned - * at odd byte boundaries. Some compilers will align struct fields at even - * byte boundaries. While it's usually possible to force byte alignment, - * that causes an overall performance penalty and may pose problems in merging - * JPEG into a larger application. Instead we accept some rather dirty code - * here. Note this code would fail if the hardware did not allow odd-byte - * word & long accesses, but all 80x86 CPUs do. - */ - -typedef void far * EMSPTR; - -typedef union { /* EMS move specification structure */ - long length; /* It's easy to access first 4 bytes */ - char bytes[18]; /* Misaligned fields in here! */ - } EMSspec; - -/* Macros for accessing misaligned fields */ -#define FIELD_AT(spec,offset,type) (*((type *) &(spec.bytes[offset]))) -#define SRC_TYPE(spec) FIELD_AT(spec,4,char) -#define SRC_HANDLE(spec) FIELD_AT(spec,5,EMSH) -#define SRC_OFFSET(spec) FIELD_AT(spec,7,unsigned short) -#define SRC_PAGE(spec) FIELD_AT(spec,9,unsigned short) -#define SRC_PTR(spec) FIELD_AT(spec,7,EMSPTR) -#define DST_TYPE(spec) FIELD_AT(spec,11,char) -#define DST_HANDLE(spec) FIELD_AT(spec,12,EMSH) -#define DST_OFFSET(spec) FIELD_AT(spec,14,unsigned short) -#define DST_PAGE(spec) FIELD_AT(spec,16,unsigned short) -#define DST_PTR(spec) FIELD_AT(spec,14,EMSPTR) - -#define EMSPAGESIZE 16384L /* gospel, see the EMS specs */ - -#define HIBYTE(W) (((W) >> 8) & 0xFF) -#define LOBYTE(W) ((W) & 0xFF) - - -METHODDEF(void) -read_ems_store (j_common_ptr cinfo, backing_store_ptr info, - void FAR * buffer_address, - long file_offset, long byte_count) -{ - EMScontext ctx; - EMSspec spec; - - spec.length = byte_count; - SRC_TYPE(spec) = 1; - SRC_HANDLE(spec) = info->handle.ems_handle; - SRC_PAGE(spec) = (unsigned short) (file_offset / EMSPAGESIZE); - SRC_OFFSET(spec) = (unsigned short) (file_offset % EMSPAGESIZE); - DST_TYPE(spec) = 0; - DST_HANDLE(spec) = 0; - DST_PTR(spec) = buffer_address; - - ctx.ds_si = (void far *) & spec; - ctx.ax = 0x5700; /* move memory region */ - jems_calldriver((EMScontext far *) & ctx); - if (HIBYTE(ctx.ax) != 0) - ERREXIT(cinfo, JERR_EMS_READ); -} - - -METHODDEF(void) -write_ems_store (j_common_ptr cinfo, backing_store_ptr info, - void FAR * buffer_address, - long file_offset, long byte_count) -{ - EMScontext ctx; - EMSspec spec; - - spec.length = byte_count; - SRC_TYPE(spec) = 0; - SRC_HANDLE(spec) = 0; - SRC_PTR(spec) = buffer_address; - DST_TYPE(spec) = 1; - DST_HANDLE(spec) = info->handle.ems_handle; - DST_PAGE(spec) = (unsigned short) (file_offset / EMSPAGESIZE); - DST_OFFSET(spec) = (unsigned short) (file_offset % EMSPAGESIZE); - - ctx.ds_si = (void far *) & spec; - ctx.ax = 0x5700; /* move memory region */ - jems_calldriver((EMScontext far *) & ctx); - if (HIBYTE(ctx.ax) != 0) - ERREXIT(cinfo, JERR_EMS_WRITE); -} - - -METHODDEF(void) -close_ems_store (j_common_ptr cinfo, backing_store_ptr info) -{ - EMScontext ctx; - - ctx.ax = 0x4500; - ctx.dx = info->handle.ems_handle; - jems_calldriver((EMScontext far *) & ctx); - TRACEMS1(cinfo, 1, JTRC_EMS_CLOSE, info->handle.ems_handle); - /* we ignore any error return from the driver */ -} - - -LOCAL(wxjpeg_boolean) -open_ems_store (j_common_ptr cinfo, backing_store_ptr info, - long total_bytes_needed) -{ - EMScontext ctx; - - /* Is EMS driver there? */ - if (! jems_available()) - return FALSE; - - /* Get status, make sure EMS is OK */ - ctx.ax = 0x4000; - jems_calldriver((EMScontext far *) & ctx); - if (HIBYTE(ctx.ax) != 0) - return FALSE; - - /* Get version, must be >= 4.0 */ - ctx.ax = 0x4600; - jems_calldriver((EMScontext far *) & ctx); - if (HIBYTE(ctx.ax) != 0 || LOBYTE(ctx.ax) < 0x40) - return FALSE; - - /* Try to allocate requested space */ - ctx.ax = 0x4300; - ctx.bx = (unsigned short) ((total_bytes_needed + EMSPAGESIZE-1L) / EMSPAGESIZE); - jems_calldriver((EMScontext far *) & ctx); - if (HIBYTE(ctx.ax) != 0) - return FALSE; - - /* Succeeded, save the handle and away we go */ - info->handle.ems_handle = ctx.dx; - info->read_backing_store = read_ems_store; - info->write_backing_store = write_ems_store; - info->close_backing_store = close_ems_store; - TRACEMS1(cinfo, 1, JTRC_EMS_OPEN, ctx.dx); - return TRUE; /* succeeded */ -} - -#endif /* EMS_SUPPORTED */ - - -/* - * Initial opening of a backing-store object. - */ - -GLOBAL(void) -jpeg_open_backing_store (j_common_ptr cinfo, backing_store_ptr info, - long total_bytes_needed) -{ - /* Try extended memory, then expanded memory, then regular file. */ -#if XMS_SUPPORTED - if (open_xms_store(cinfo, info, total_bytes_needed)) - return; -#endif -#if EMS_SUPPORTED - if (open_ems_store(cinfo, info, total_bytes_needed)) - return; -#endif - if (open_file_store(cinfo, info, total_bytes_needed)) - return; - ERREXITS(cinfo, JERR_TFILE_CREATE, ""); -} - - -/* - * These routines take care of any system-dependent initialization and - * cleanup required. - */ - -GLOBAL(long) -jpeg_mem_init (j_common_ptr cinfo) -{ - next_file_num = 0; /* initialize temp file name generator */ - return DEFAULT_MAX_MEM; /* default for max_memory_to_use */ -} - -GLOBAL(void) -jpeg_mem_term (j_common_ptr cinfo) -{ - /* Microsoft C, at least in v6.00A, will not successfully reclaim freed - * blocks of size > 32Kbytes unless we give it a kick in the rear, like so: - */ -#ifdef NEED_FHEAPMIN - _fheapmin(); -#endif -} diff --git a/wxWidgets/src/jpeg/jmemdosa.asm b/wxWidgets/src/jpeg/jmemdosa.asm deleted file mode 100644 index ecd43729fe..0000000000 --- a/wxWidgets/src/jpeg/jmemdosa.asm +++ /dev/null @@ -1,379 +0,0 @@ -; -; jmemdosa.asm -; -; Copyright (C) 1992, Thomas G. Lane. -; This file is part of the Independent JPEG Group's software. -; For conditions of distribution and use, see the accompanying README file. -; -; This file contains low-level interface routines to support the MS-DOS -; backing store manager (jmemdos.c). Routines are provided to access disk -; files through direct DOS calls, and to access XMS and EMS drivers. -; -; This file should assemble with Microsoft's MASM or any compatible -; assembler (including Borland's Turbo Assembler). If you haven't got -; a compatible assembler, better fall back to jmemansi.c or jmemname.c. -; -; To minimize dependence on the C compiler's register usage conventions, -; we save and restore all 8086 registers, even though most compilers only -; require SI,DI,DS to be preserved. Also, we use only 16-bit-wide return -; values, which everybody returns in AX. -; -; Based on code contributed by Ge' Weijers. -; - -JMEMDOSA_TXT segment byte public 'CODE' - - assume cs:JMEMDOSA_TXT - - public _jdos_open - public _jdos_close - public _jdos_seek - public _jdos_read - public _jdos_write - public _jxms_getdriver - public _jxms_calldriver - public _jems_available - public _jems_calldriver - -; -; short far jdos_open (short far * handle, char far * filename) -; -; Create and open a temporary file -; -_jdos_open proc far - push bp ; linkage - mov bp,sp - push si ; save all registers for safety - push di - push bx - push cx - push dx - push es - push ds - mov cx,0 ; normal file attributes - lds dx,dword ptr [bp+10] ; get filename pointer - mov ah,3ch ; create file - int 21h - jc open_err ; if failed, return error code - lds bx,dword ptr [bp+6] ; get handle pointer - mov word ptr [bx],ax ; save the handle - xor ax,ax ; return zero for OK -open_err: pop ds ; restore registers and exit - pop es - pop dx - pop cx - pop bx - pop di - pop si - pop bp - ret -_jdos_open endp - - -; -; short far jdos_close (short handle) -; -; Close the file handle -; -_jdos_close proc far - push bp ; linkage - mov bp,sp - push si ; save all registers for safety - push di - push bx - push cx - push dx - push es - push ds - mov bx,word ptr [bp+6] ; file handle - mov ah,3eh ; close file - int 21h - jc close_err ; if failed, return error code - xor ax,ax ; return zero for OK -close_err: pop ds ; restore registers and exit - pop es - pop dx - pop cx - pop bx - pop di - pop si - pop bp - ret -_jdos_close endp - - -; -; short far jdos_seek (short handle, long offset) -; -; Set file position -; -_jdos_seek proc far - push bp ; linkage - mov bp,sp - push si ; save all registers for safety - push di - push bx - push cx - push dx - push es - push ds - mov bx,word ptr [bp+6] ; file handle - mov dx,word ptr [bp+8] ; LS offset - mov cx,word ptr [bp+10] ; MS offset - mov ax,4200h ; absolute seek - int 21h - jc seek_err ; if failed, return error code - xor ax,ax ; return zero for OK -seek_err: pop ds ; restore registers and exit - pop es - pop dx - pop cx - pop bx - pop di - pop si - pop bp - ret -_jdos_seek endp - - -; -; short far jdos_read (short handle, void far * buffer, unsigned short count) -; -; Read from file -; -_jdos_read proc far - push bp ; linkage - mov bp,sp - push si ; save all registers for safety - push di - push bx - push cx - push dx - push es - push ds - mov bx,word ptr [bp+6] ; file handle - lds dx,dword ptr [bp+8] ; buffer address - mov cx,word ptr [bp+12] ; number of bytes - mov ah,3fh ; read file - int 21h - jc read_err ; if failed, return error code - cmp ax,word ptr [bp+12] ; make sure all bytes were read - je read_ok - mov ax,1 ; else return 1 for not OK - jmp short read_err -read_ok: xor ax,ax ; return zero for OK -read_err: pop ds ; restore registers and exit - pop es - pop dx - pop cx - pop bx - pop di - pop si - pop bp - ret -_jdos_read endp - - -; -; short far jdos_write (short handle, void far * buffer, unsigned short count) -; -; Write to file -; -_jdos_write proc far - push bp ; linkage - mov bp,sp - push si ; save all registers for safety - push di - push bx - push cx - push dx - push es - push ds - mov bx,word ptr [bp+6] ; file handle - lds dx,dword ptr [bp+8] ; buffer address - mov cx,word ptr [bp+12] ; number of bytes - mov ah,40h ; write file - int 21h - jc write_err ; if failed, return error code - cmp ax,word ptr [bp+12] ; make sure all bytes written - je write_ok - mov ax,1 ; else return 1 for not OK - jmp short write_err -write_ok: xor ax,ax ; return zero for OK -write_err: pop ds ; restore registers and exit - pop es - pop dx - pop cx - pop bx - pop di - pop si - pop bp - ret -_jdos_write endp - - -; -; void far jxms_getdriver (XMSDRIVER far *) -; -; Get the address of the XMS driver, or NULL if not available -; -_jxms_getdriver proc far - push bp ; linkage - mov bp,sp - push si ; save all registers for safety - push di - push bx - push cx - push dx - push es - push ds - mov ax,4300h ; call multiplex interrupt with - int 2fh ; a magic cookie, hex 4300 - cmp al,80h ; AL should contain hex 80 - je xmsavail - xor dx,dx ; no XMS driver available - xor ax,ax ; return a nil pointer - jmp short xmsavail_done -xmsavail: mov ax,4310h ; fetch driver address with - int 2fh ; another magic cookie - mov dx,es ; copy address to dx:ax - mov ax,bx -xmsavail_done: les bx,dword ptr [bp+6] ; get pointer to return value - mov word ptr es:[bx],ax - mov word ptr es:[bx+2],dx - pop ds ; restore registers and exit - pop es - pop dx - pop cx - pop bx - pop di - pop si - pop bp - ret -_jxms_getdriver endp - - -; -; void far jxms_calldriver (XMSDRIVER, XMScontext far *) -; -; The XMScontext structure contains values for the AX,DX,BX,SI,DS registers. -; These are loaded, the XMS call is performed, and the new values of the -; AX,DX,BX registers are written back to the context structure. -; -_jxms_calldriver proc far - push bp ; linkage - mov bp,sp - push si ; save all registers for safety - push di - push bx - push cx - push dx - push es - push ds - les bx,dword ptr [bp+10] ; get XMScontext pointer - mov ax,word ptr es:[bx] ; load registers - mov dx,word ptr es:[bx+2] - mov si,word ptr es:[bx+6] - mov ds,word ptr es:[bx+8] - mov bx,word ptr es:[bx+4] - call dword ptr [bp+6] ; call the driver - mov cx,bx ; save returned BX for a sec - les bx,dword ptr [bp+10] ; get XMScontext pointer - mov word ptr es:[bx],ax ; put back ax,dx,bx - mov word ptr es:[bx+2],dx - mov word ptr es:[bx+4],cx - pop ds ; restore registers and exit - pop es - pop dx - pop cx - pop bx - pop di - pop si - pop bp - ret -_jxms_calldriver endp - - -; -; short far jems_available (void) -; -; Have we got an EMS driver? (this comes straight from the EMS 4.0 specs) -; -_jems_available proc far - push si ; save all registers for safety - push di - push bx - push cx - push dx - push es - push ds - mov ax,3567h ; get interrupt vector 67h - int 21h - push cs - pop ds - mov di,000ah ; check offs 10 in returned seg - lea si,ASCII_device_name ; against literal string - mov cx,8 - cld - repe cmpsb - jne no_ems - mov ax,1 ; match, it's there - jmp short avail_done -no_ems: xor ax,ax ; it's not there -avail_done: pop ds ; restore registers and exit - pop es - pop dx - pop cx - pop bx - pop di - pop si - ret - -ASCII_device_name db "EMMXXXX0" - -_jems_available endp - - -; -; void far jems_calldriver (EMScontext far *) -; -; The EMScontext structure contains values for the AX,DX,BX,SI,DS registers. -; These are loaded, the EMS trap is performed, and the new values of the -; AX,DX,BX registers are written back to the context structure. -; -_jems_calldriver proc far - push bp ; linkage - mov bp,sp - push si ; save all registers for safety - push di - push bx - push cx - push dx - push es - push ds - les bx,dword ptr [bp+6] ; get EMScontext pointer - mov ax,word ptr es:[bx] ; load registers - mov dx,word ptr es:[bx+2] - mov si,word ptr es:[bx+6] - mov ds,word ptr es:[bx+8] - mov bx,word ptr es:[bx+4] - int 67h ; call the EMS driver - mov cx,bx ; save returned BX for a sec - les bx,dword ptr [bp+6] ; get EMScontext pointer - mov word ptr es:[bx],ax ; put back ax,dx,bx - mov word ptr es:[bx+2],dx - mov word ptr es:[bx+4],cx - pop ds ; restore registers and exit - pop es - pop dx - pop cx - pop bx - pop di - pop si - pop bp - ret -_jems_calldriver endp - -JMEMDOSA_TXT ends - - end diff --git a/wxWidgets/src/jpeg/jmemmac.c b/wxWidgets/src/jpeg/jmemmac.c deleted file mode 100644 index 106f9bea05..0000000000 --- a/wxWidgets/src/jpeg/jmemmac.c +++ /dev/null @@ -1,289 +0,0 @@ -/* - * jmemmac.c - * - * Copyright (C) 1992-1997, Thomas G. Lane. - * This file is part of the Independent JPEG Group's software. - * For conditions of distribution and use, see the accompanying README file. - * - * jmemmac.c provides an Apple Macintosh implementation of the system- - * dependent portion of the JPEG memory manager. - * - * If you use jmemmac.c, then you must define USE_MAC_MEMMGR in the - * JPEG_INTERNALS part of jconfig.h. - * - * jmemmac.c uses the Macintosh toolbox routines NewPtr and DisposePtr - * instead of malloc and free. It accurately determines the amount of - * memory available by using CompactMem. Notice that if left to its - * own devices, this code can chew up all available space in the - * application's zone, with the exception of the rather small "slop" - * factor computed in jpeg_mem_available(). The application can ensure - * that more space is left over by reducing max_memory_to_use. - * - * Large images are swapped to disk using temporary files and System 7.0+'s - * temporary folder functionality. - * - * Note that jmemmac.c depends on two features of MacOS that were first - * introduced in System 7: FindFolder and the FSSpec-based calls. - * If your application uses jmemmac.c and is run under System 6 or earlier, - * and the jpeg library decides it needs a temporary file, it will abort, - * printing error messages about requiring System 7. (If no temporary files - * are created, it will run fine.) - * - * If you want to use jmemmac.c in an application that might be used with - * System 6 or earlier, then you should remove dependencies on FindFolder - * and the FSSpec calls. You will need to replace FindFolder with some - * other mechanism for finding a place to put temporary files, and you - * should replace the FSSpec calls with their HFS equivalents: - * - * FSpDelete -> HDelete - * FSpGetFInfo -> HGetFInfo - * FSpCreate -> HCreate - * FSpOpenDF -> HOpen *** Note: not HOpenDF *** - * FSMakeFSSpec -> (fill in spec by hand.) - * - * (Use HOpen instead of HOpenDF. HOpen is just a glue-interface to PBHOpen, - * which is on all HFS macs. HOpenDF is a System 7 addition which avoids the - * ages-old problem of names starting with a period.) - * - * Contributed by Sam Bushell (jsam@iagu.on.net) and - * Dan Gildor (gyld@in-touch.com). - */ - -#define JPEG_INTERNALS -#include "jinclude.h" -#include "jpeglib.h" -#include "jmemsys.h" /* import the system-dependent declarations */ - -#ifndef USE_MAC_MEMMGR /* make sure user got configuration right */ - You forgot to define USE_MAC_MEMMGR in jconfig.h. /* deliberate syntax error */ -#endif - -#include /* we use the MacOS memory manager */ -#include /* we use the MacOS File stuff */ -#include /* we use the MacOS HFS stuff */ -#include /* for smSystemScript */ -#include /* we use Gestalt to test for specific functionality */ - -#ifndef TEMP_FILE_NAME /* can override from jconfig.h or Makefile */ -#define TEMP_FILE_NAME "JPG%03d.TMP" -#endif - -static int next_file_num; /* to distinguish among several temp files */ - - -/* - * Memory allocation and freeing are controlled by the MacOS library - * routines NewPtr() and DisposePtr(), which allocate fixed-address - * storage. Unfortunately, the IJG library isn't smart enough to cope - * with relocatable storage. - */ - -GLOBAL(void *) -jpeg_get_small (j_common_ptr cinfo, size_t sizeofobject) -{ - return (void *) NewPtr(sizeofobject); -} - -GLOBAL(void) -jpeg_free_small (j_common_ptr cinfo, void * object, size_t sizeofobject) -{ - DisposePtr((Ptr) object); -} - - -/* - * "Large" objects are treated the same as "small" ones. - * NB: we include FAR keywords in the routine declarations simply for - * consistency with the rest of the IJG code; FAR should expand to empty - * on rational architectures like the Mac. - */ - -GLOBAL(void FAR *) -jpeg_get_large (j_common_ptr cinfo, size_t sizeofobject) -{ - return (void FAR *) NewPtr(sizeofobject); -} - -GLOBAL(void) -jpeg_free_large (j_common_ptr cinfo, void FAR * object, size_t sizeofobject) -{ - DisposePtr((Ptr) object); -} - - -/* - * This routine computes the total memory space available for allocation. - */ - -GLOBAL(long) -jpeg_mem_available (j_common_ptr cinfo, long min_bytes_needed, - long max_bytes_needed, long already_allocated) -{ - long limit = cinfo->mem->max_memory_to_use - already_allocated; - long slop, mem; - - /* Don't ask for more than what application has told us we may use */ - if (max_bytes_needed > limit && limit > 0) - max_bytes_needed = limit; - /* Find whether there's a big enough free block in the heap. - * CompactMem tries to create a contiguous block of the requested size, - * and then returns the size of the largest free block (which could be - * much more or much less than we asked for). - * We add some slop to ensure we don't use up all available memory. - */ - slop = max_bytes_needed / 16 + 32768L; - mem = CompactMem(max_bytes_needed + slop) - slop; - if (mem < 0) - mem = 0; /* sigh, couldn't even get the slop */ - /* Don't take more than the application says we can have */ - if (mem > limit && limit > 0) - mem = limit; - return mem; -} - - -/* - * Backing store (temporary file) management. - * Backing store objects are only used when the value returned by - * jpeg_mem_available is less than the total space needed. You can dispense - * with these routines if you have plenty of virtual memory; see jmemnobs.c. - */ - - -METHODDEF(void) -read_backing_store (j_common_ptr cinfo, backing_store_ptr info, - void FAR * buffer_address, - long file_offset, long byte_count) -{ - long bytes = byte_count; - long retVal; - - if ( SetFPos ( info->temp_file, fsFromStart, file_offset ) != noErr ) - ERREXIT(cinfo, JERR_TFILE_SEEK); - - retVal = FSRead ( info->temp_file, &bytes, - (unsigned char *) buffer_address ); - if ( retVal != noErr || bytes != byte_count ) - ERREXIT(cinfo, JERR_TFILE_READ); -} - - -METHODDEF(void) -write_backing_store (j_common_ptr cinfo, backing_store_ptr info, - void FAR * buffer_address, - long file_offset, long byte_count) -{ - long bytes = byte_count; - long retVal; - - if ( SetFPos ( info->temp_file, fsFromStart, file_offset ) != noErr ) - ERREXIT(cinfo, JERR_TFILE_SEEK); - - retVal = FSWrite ( info->temp_file, &bytes, - (unsigned char *) buffer_address ); - if ( retVal != noErr || bytes != byte_count ) - ERREXIT(cinfo, JERR_TFILE_WRITE); -} - - -METHODDEF(void) -close_backing_store (j_common_ptr cinfo, backing_store_ptr info) -{ - FSClose ( info->temp_file ); - FSpDelete ( &(info->tempSpec) ); -} - - -/* - * Initial opening of a backing-store object. - * - * This version uses FindFolder to find the Temporary Items folder, - * and puts the temporary file in there. - */ - -GLOBAL(void) -jpeg_open_backing_store (j_common_ptr cinfo, backing_store_ptr info, - long total_bytes_needed) -{ - short tmpRef, vRefNum; - long dirID; - FInfo finderInfo; - FSSpec theSpec; - Str255 fName; - OSErr osErr; - long gestaltResponse = 0; - - /* Check that FSSpec calls are available. */ - osErr = Gestalt( gestaltFSAttr, &gestaltResponse ); - if ( ( osErr != noErr ) - || !( gestaltResponse & (1<temp_name, TEMP_FILE_NAME, next_file_num); - strcpy ( (Ptr)fName+1, info->temp_name ); - *fName = strlen (info->temp_name); - osErr = FSMakeFSSpec ( vRefNum, dirID, fName, &theSpec ); - - if ( (osErr = FSpGetFInfo ( &theSpec, &finderInfo ) ) != noErr ) - break; - } - - osErr = FSpCreate ( &theSpec, '????', '????', smSystemScript ); - if ( osErr != noErr ) - ERREXITS(cinfo, JERR_TFILE_CREATE, info->temp_name); - - osErr = FSpOpenDF ( &theSpec, fsRdWrPerm, &(info->temp_file) ); - if ( osErr != noErr ) - ERREXITS(cinfo, JERR_TFILE_CREATE, info->temp_name); - - info->tempSpec = theSpec; - - info->read_backing_store = read_backing_store; - info->write_backing_store = write_backing_store; - info->close_backing_store = close_backing_store; - TRACEMSS(cinfo, 1, JTRC_TFILE_OPEN, info->temp_name); -} - - -/* - * These routines take care of any system-dependent initialization and - * cleanup required. - */ - -GLOBAL(long) -jpeg_mem_init (j_common_ptr cinfo) -{ - next_file_num = 0; - - /* max_memory_to_use will be initialized to FreeMem()'s result; - * the calling application might later reduce it, for example - * to leave room to invoke multiple JPEG objects. - * Note that FreeMem returns the total number of free bytes; - * it may not be possible to allocate a single block of this size. - */ - return FreeMem(); -} - -GLOBAL(void) -jpeg_mem_term (j_common_ptr cinfo) -{ - /* no work */ -} diff --git a/wxWidgets/src/jpeg/jmemmgr.c b/wxWidgets/src/jpeg/jmemmgr.c deleted file mode 100644 index 173d9ded61..0000000000 --- a/wxWidgets/src/jpeg/jmemmgr.c +++ /dev/null @@ -1,1118 +0,0 @@ -/* - * jmemmgr.c - * - * Copyright (C) 1991-1997, Thomas G. Lane. - * This file is part of the Independent JPEG Group's software. - * For conditions of distribution and use, see the accompanying README file. - * - * This file contains the JPEG system-independent memory management - * routines. This code is usable across a wide variety of machines; most - * of the system dependencies have been isolated in a separate file. - * The major functions provided here are: - * * pool-based allocation and freeing of memory; - * * policy decisions about how to divide available memory among the - * virtual arrays; - * * control logic for swapping virtual arrays between main memory and - * backing storage. - * The separate system-dependent file provides the actual backing-storage - * access code, and it contains the policy decision about how much total - * main memory to use. - * This file is system-dependent in the sense that some of its functions - * are unnecessary in some systems. For example, if there is enough virtual - * memory so that backing storage will never be used, much of the virtual - * array control logic could be removed. (Of course, if you have that much - * memory then you shouldn't care about a little bit of unused code...) - */ - -#define JPEG_INTERNALS -#define AM_MEMORY_MANAGER /* we define jvirt_Xarray_control structs */ -#include "jinclude.h" -#include "jpeglib.h" -#include "jmemsys.h" /* import the system-dependent declarations */ - -#ifndef NO_GETENV -#ifndef HAVE_STDLIB_H /* should declare getenv() */ -extern char * getenv JPP((const char * name)); -#endif -#endif - - -/* - * Some important notes: - * The allocation routines provided here must never return NULL. - * They should exit to error_exit if unsuccessful. - * - * It's not a good idea to try to merge the sarray and barray routines, - * even though they are textually almost the same, because samples are - * usually stored as bytes while coefficients are shorts or ints. Thus, - * in machines where byte pointers have a different representation from - * word pointers, the resulting machine code could not be the same. - */ - - -/* - * Many machines require storage alignment: longs must start on 4-byte - * boundaries, doubles on 8-byte boundaries, etc. On such machines, malloc() - * always returns pointers that are multiples of the worst-case alignment - * requirement, and we had better do so too. - * There isn't any really portable way to determine the worst-case alignment - * requirement. This module assumes that the alignment requirement is - * multiples of sizeof(ALIGN_TYPE). - * By default, we define ALIGN_TYPE as double. This is necessary on some - * workstations (where doubles really do need 8-byte alignment) and will work - * fine on nearly everything. If your machine has lesser alignment needs, - * you can save a few bytes by making ALIGN_TYPE smaller. - * The only place I know of where this will NOT work is certain Macintosh - * 680x0 compilers that define double as a 10-byte IEEE extended float. - * Doing 10-byte alignment is counterproductive because longwords won't be - * aligned well. Put "#define ALIGN_TYPE long" in jconfig.h if you have - * such a compiler. - */ - -#ifndef ALIGN_TYPE /* so can override from jconfig.h */ -#define ALIGN_TYPE double -#endif - - -/* - * We allocate objects from "pools", where each pool is gotten with a single - * request to jpeg_get_small() or jpeg_get_large(). There is no per-object - * overhead within a pool, except for alignment padding. Each pool has a - * header with a link to the next pool of the same class. - * Small and large pool headers are identical except that the latter's - * link pointer must be FAR on 80x86 machines. - * Notice that the "real" header fields are union'ed with a dummy ALIGN_TYPE - * field. This forces the compiler to make SIZEOF(small_pool_hdr) a multiple - * of the alignment requirement of ALIGN_TYPE. - */ - -typedef union small_pool_struct * small_pool_ptr; - -typedef union small_pool_struct { - struct { - small_pool_ptr next; /* next in list of pools */ - size_t bytes_used; /* how many bytes already used within pool */ - size_t bytes_left; /* bytes still available in this pool */ - } hdr; - ALIGN_TYPE dummy; /* included in union to ensure alignment */ -} small_pool_hdr; - -typedef union large_pool_struct FAR * large_pool_ptr; - -typedef union large_pool_struct { - struct { - large_pool_ptr next; /* next in list of pools */ - size_t bytes_used; /* how many bytes already used within pool */ - size_t bytes_left; /* bytes still available in this pool */ - } hdr; - ALIGN_TYPE dummy; /* included in union to ensure alignment */ -} large_pool_hdr; - - -/* - * Here is the full definition of a memory manager object. - */ - -typedef struct { - struct jpeg_memory_mgr pub; /* public fields */ - - /* Each pool identifier (lifetime class) names a linked list of pools. */ - small_pool_ptr small_list[JPOOL_NUMPOOLS]; - large_pool_ptr large_list[JPOOL_NUMPOOLS]; - - /* Since we only have one lifetime class of virtual arrays, only one - * linked list is necessary (for each datatype). Note that the virtual - * array control blocks being linked together are actually stored somewhere - * in the small-pool list. - */ - jvirt_sarray_ptr virt_sarray_list; - jvirt_barray_ptr virt_barray_list; - - /* This counts total space obtained from jpeg_get_small/large */ - long total_space_allocated; - - /* alloc_sarray and alloc_barray set this value for use by virtual - * array routines. - */ - JDIMENSION last_rowsperchunk; /* from most recent alloc_sarray/barray */ -} my_memory_mgr; - -typedef my_memory_mgr * my_mem_ptr; - - -/* - * The control blocks for virtual arrays. - * Note that these blocks are allocated in the "small" pool area. - * System-dependent info for the associated backing store (if any) is hidden - * inside the backing_store_info struct. - */ - -struct jvirt_sarray_control { - JSAMPARRAY mem_buffer; /* => the in-memory buffer */ - JDIMENSION rows_in_array; /* total virtual array height */ - JDIMENSION samplesperrow; /* width of array (and of memory buffer) */ - JDIMENSION maxaccess; /* max rows accessed by access_virt_sarray */ - JDIMENSION rows_in_mem; /* height of memory buffer */ - JDIMENSION rowsperchunk; /* allocation chunk size in mem_buffer */ - JDIMENSION cur_start_row; /* first logical row # in the buffer */ - JDIMENSION first_undef_row; /* row # of first uninitialized row */ - wxjpeg_boolean pre_zero; /* pre-zero mode requested? */ - wxjpeg_boolean dirty; /* do current buffer contents need written? */ - wxjpeg_boolean b_s_open; /* is backing-store data valid? */ - jvirt_sarray_ptr next; /* link to next virtual sarray control block */ - backing_store_info b_s_info; /* System-dependent control info */ -}; - -struct jvirt_barray_control { - JBLOCKARRAY mem_buffer; /* => the in-memory buffer */ - JDIMENSION rows_in_array; /* total virtual array height */ - JDIMENSION blocksperrow; /* width of array (and of memory buffer) */ - JDIMENSION maxaccess; /* max rows accessed by access_virt_barray */ - JDIMENSION rows_in_mem; /* height of memory buffer */ - JDIMENSION rowsperchunk; /* allocation chunk size in mem_buffer */ - JDIMENSION cur_start_row; /* first logical row # in the buffer */ - JDIMENSION first_undef_row; /* row # of first uninitialized row */ - wxjpeg_boolean pre_zero; /* pre-zero mode requested? */ - wxjpeg_boolean dirty; /* do current buffer contents need written? */ - wxjpeg_boolean b_s_open; /* is backing-store data valid? */ - jvirt_barray_ptr next; /* link to next virtual barray control block */ - backing_store_info b_s_info; /* System-dependent control info */ -}; - - -#ifdef MEM_STATS /* optional extra stuff for statistics */ - -LOCAL(void) -print_mem_stats (j_common_ptr cinfo, int pool_id) -{ - my_mem_ptr mem = (my_mem_ptr) cinfo->mem; - small_pool_ptr shdr_ptr; - large_pool_ptr lhdr_ptr; - - /* Since this is only a debugging stub, we can cheat a little by using - * fprintf directly rather than going through the trace message code. - * This is helpful because message parm array can't handle longs. - */ - fprintf(stderr, "Freeing pool %d, total space = %ld\n", - pool_id, mem->total_space_allocated); - - for (lhdr_ptr = mem->large_list[pool_id]; lhdr_ptr != NULL; - lhdr_ptr = lhdr_ptr->hdr.next) { - fprintf(stderr, " Large chunk used %ld\n", - (long) lhdr_ptr->hdr.bytes_used); - } - - for (shdr_ptr = mem->small_list[pool_id]; shdr_ptr != NULL; - shdr_ptr = shdr_ptr->hdr.next) { - fprintf(stderr, " Small chunk used %ld free %ld\n", - (long) shdr_ptr->hdr.bytes_used, - (long) shdr_ptr->hdr.bytes_left); - } -} - -#endif /* MEM_STATS */ - - -LOCAL(void) -out_of_memory (j_common_ptr cinfo, int which) -/* Report an out-of-memory error and stop execution */ -/* If we compiled MEM_STATS support, report alloc requests before dying */ -{ -#ifdef MEM_STATS - cinfo->err->trace_level = 2; /* force self_destruct to report stats */ -#endif - ERREXIT1(cinfo, JERR_OUT_OF_MEMORY, which); -} - - -/* - * Allocation of "small" objects. - * - * For these, we use pooled storage. When a new pool must be created, - * we try to get enough space for the current request plus a "slop" factor, - * where the slop will be the amount of leftover space in the new pool. - * The speed vs. space tradeoff is largely determined by the slop values. - * A different slop value is provided for each pool class (lifetime), - * and we also distinguish the first pool of a class from later ones. - * NOTE: the values given work fairly well on both 16- and 32-bit-int - * machines, but may be too small if longs are 64 bits or more. - */ - -static const size_t first_pool_slop[JPOOL_NUMPOOLS] = -{ - 1600, /* first PERMANENT pool */ - 16000 /* first IMAGE pool */ -}; - -static const size_t extra_pool_slop[JPOOL_NUMPOOLS] = -{ - 0, /* additional PERMANENT pools */ - 5000 /* additional IMAGE pools */ -}; - -#define MIN_SLOP 50 /* greater than 0 to avoid futile looping */ - - -METHODDEF(void *) -alloc_small (j_common_ptr cinfo, int pool_id, size_t sizeofobject) -/* Allocate a "small" object */ -{ - my_mem_ptr mem = (my_mem_ptr) cinfo->mem; - small_pool_ptr hdr_ptr, prev_hdr_ptr; - char * data_ptr; - size_t odd_bytes, min_request, slop; - - /* Check for unsatisfiable request (do now to ensure no overflow below) */ - if (sizeofobject > (size_t) (MAX_ALLOC_CHUNK-SIZEOF(small_pool_hdr))) - out_of_memory(cinfo, 1); /* request exceeds malloc's ability */ - - /* Round up the requested size to a multiple of SIZEOF(ALIGN_TYPE) */ - odd_bytes = sizeofobject % SIZEOF(ALIGN_TYPE); - if (odd_bytes > 0) - sizeofobject += SIZEOF(ALIGN_TYPE) - odd_bytes; - - /* See if space is available in any existing pool */ - if (pool_id < 0 || pool_id >= JPOOL_NUMPOOLS) - ERREXIT1(cinfo, JERR_BAD_POOL_ID, pool_id); /* safety check */ - prev_hdr_ptr = NULL; - hdr_ptr = mem->small_list[pool_id]; - while (hdr_ptr != NULL) { - if (hdr_ptr->hdr.bytes_left >= sizeofobject) - break; /* found pool with enough space */ - prev_hdr_ptr = hdr_ptr; - hdr_ptr = hdr_ptr->hdr.next; - } - - /* Time to make a new pool? */ - if (hdr_ptr == NULL) { - /* min_request is what we need now, slop is what will be leftover */ - min_request = sizeofobject + SIZEOF(small_pool_hdr); - if (prev_hdr_ptr == NULL) /* first pool in class? */ - slop = first_pool_slop[pool_id]; - else - slop = extra_pool_slop[pool_id]; - /* Don't ask for more than MAX_ALLOC_CHUNK */ - if (slop > (size_t) (MAX_ALLOC_CHUNK-min_request)) - slop = (size_t) (MAX_ALLOC_CHUNK-min_request); - /* Try to get space, if fail reduce slop and try again */ - for (;;) { - hdr_ptr = (small_pool_ptr) jpeg_get_small(cinfo, min_request + slop); - if (hdr_ptr != NULL) - break; - slop /= 2; - if (slop < MIN_SLOP) /* give up when it gets real small */ - out_of_memory(cinfo, 2); /* jpeg_get_small failed */ - } - mem->total_space_allocated += min_request + slop; - /* Success, initialize the new pool header and add to end of list */ - hdr_ptr->hdr.next = NULL; - hdr_ptr->hdr.bytes_used = 0; - hdr_ptr->hdr.bytes_left = sizeofobject + slop; - if (prev_hdr_ptr == NULL) /* first pool in class? */ - mem->small_list[pool_id] = hdr_ptr; - else - prev_hdr_ptr->hdr.next = hdr_ptr; - } - - /* OK, allocate the object from the current pool */ - data_ptr = (char *) (hdr_ptr + 1); /* point to first data byte in pool */ - data_ptr += hdr_ptr->hdr.bytes_used; /* point to place for object */ - hdr_ptr->hdr.bytes_used += sizeofobject; - hdr_ptr->hdr.bytes_left -= sizeofobject; - - return (void *) data_ptr; -} - - -/* - * Allocation of "large" objects. - * - * The external semantics of these are the same as "small" objects, - * except that FAR pointers are used on 80x86. However the pool - * management heuristics are quite different. We assume that each - * request is large enough that it may as well be passed directly to - * jpeg_get_large; the pool management just links everything together - * so that we can free it all on demand. - * Note: the major use of "large" objects is in JSAMPARRAY and JBLOCKARRAY - * structures. The routines that create these structures (see below) - * deliberately bunch rows together to ensure a large request size. - */ - -METHODDEF(void FAR *) -alloc_large (j_common_ptr cinfo, int pool_id, size_t sizeofobject) -/* Allocate a "large" object */ -{ - my_mem_ptr mem = (my_mem_ptr) cinfo->mem; - large_pool_ptr hdr_ptr; - size_t odd_bytes; - - /* Check for unsatisfiable request (do now to ensure no overflow below) */ - if (sizeofobject > (size_t) (MAX_ALLOC_CHUNK-SIZEOF(large_pool_hdr))) - out_of_memory(cinfo, 3); /* request exceeds malloc's ability */ - - /* Round up the requested size to a multiple of SIZEOF(ALIGN_TYPE) */ - odd_bytes = sizeofobject % SIZEOF(ALIGN_TYPE); - if (odd_bytes > 0) - sizeofobject += SIZEOF(ALIGN_TYPE) - odd_bytes; - - /* Always make a new pool */ - if (pool_id < 0 || pool_id >= JPOOL_NUMPOOLS) - ERREXIT1(cinfo, JERR_BAD_POOL_ID, pool_id); /* safety check */ - - hdr_ptr = (large_pool_ptr) jpeg_get_large(cinfo, sizeofobject + - SIZEOF(large_pool_hdr)); - if (hdr_ptr == NULL) - out_of_memory(cinfo, 4); /* jpeg_get_large failed */ - mem->total_space_allocated += sizeofobject + SIZEOF(large_pool_hdr); - - /* Success, initialize the new pool header and add to list */ - hdr_ptr->hdr.next = mem->large_list[pool_id]; - /* We maintain space counts in each pool header for statistical purposes, - * even though they are not needed for allocation. - */ - hdr_ptr->hdr.bytes_used = sizeofobject; - hdr_ptr->hdr.bytes_left = 0; - mem->large_list[pool_id] = hdr_ptr; - - return (void FAR *) (hdr_ptr + 1); /* point to first data byte in pool */ -} - - -/* - * Creation of 2-D sample arrays. - * The pointers are in near heap, the samples themselves in FAR heap. - * - * To minimize allocation overhead and to allow I/O of large contiguous - * blocks, we allocate the sample rows in groups of as many rows as possible - * without exceeding MAX_ALLOC_CHUNK total bytes per allocation request. - * NB: the virtual array control routines, later in this file, know about - * this chunking of rows. The rowsperchunk value is left in the mem manager - * object so that it can be saved away if this sarray is the workspace for - * a virtual array. - */ - -METHODDEF(JSAMPARRAY) -alloc_sarray (j_common_ptr cinfo, int pool_id, - JDIMENSION samplesperrow, JDIMENSION numrows) -/* Allocate a 2-D sample array */ -{ - my_mem_ptr mem = (my_mem_ptr) cinfo->mem; - JSAMPARRAY result; - JSAMPROW workspace; - JDIMENSION rowsperchunk, currow, i; - long ltemp; - - /* Calculate max # of rows allowed in one allocation chunk */ - ltemp = (MAX_ALLOC_CHUNK-SIZEOF(large_pool_hdr)) / - ((long) samplesperrow * SIZEOF(JSAMPLE)); - if (ltemp <= 0) - ERREXIT(cinfo, JERR_WIDTH_OVERFLOW); - if (ltemp < (long) numrows) - rowsperchunk = (JDIMENSION) ltemp; - else - rowsperchunk = numrows; - mem->last_rowsperchunk = rowsperchunk; - - /* Get space for row pointers (small object) */ - result = (JSAMPARRAY) alloc_small(cinfo, pool_id, - (size_t) (numrows * SIZEOF(JSAMPROW))); - - /* Get the rows themselves (large objects) */ - currow = 0; - while (currow < numrows) { - rowsperchunk = MIN(rowsperchunk, numrows - currow); - workspace = (JSAMPROW) alloc_large(cinfo, pool_id, - (size_t) ((size_t) rowsperchunk * (size_t) samplesperrow - * SIZEOF(JSAMPLE))); - for (i = rowsperchunk; i > 0; i--) { - result[currow++] = workspace; - workspace += samplesperrow; - } - } - - return result; -} - - -/* - * Creation of 2-D coefficient-block arrays. - * This is essentially the same as the code for sample arrays, above. - */ - -METHODDEF(JBLOCKARRAY) -alloc_barray (j_common_ptr cinfo, int pool_id, - JDIMENSION blocksperrow, JDIMENSION numrows) -/* Allocate a 2-D coefficient-block array */ -{ - my_mem_ptr mem = (my_mem_ptr) cinfo->mem; - JBLOCKARRAY result; - JBLOCKROW workspace; - JDIMENSION rowsperchunk, currow, i; - long ltemp; - - /* Calculate max # of rows allowed in one allocation chunk */ - ltemp = (MAX_ALLOC_CHUNK-SIZEOF(large_pool_hdr)) / - ((long) blocksperrow * SIZEOF(JBLOCK)); - if (ltemp <= 0) - ERREXIT(cinfo, JERR_WIDTH_OVERFLOW); - if (ltemp < (long) numrows) - rowsperchunk = (JDIMENSION) ltemp; - else - rowsperchunk = numrows; - mem->last_rowsperchunk = rowsperchunk; - - /* Get space for row pointers (small object) */ - result = (JBLOCKARRAY) alloc_small(cinfo, pool_id, - (size_t) (numrows * SIZEOF(JBLOCKROW))); - - /* Get the rows themselves (large objects) */ - currow = 0; - while (currow < numrows) { - rowsperchunk = MIN(rowsperchunk, numrows - currow); - workspace = (JBLOCKROW) alloc_large(cinfo, pool_id, - (size_t) ((size_t) rowsperchunk * (size_t) blocksperrow - * SIZEOF(JBLOCK))); - for (i = rowsperchunk; i > 0; i--) { - result[currow++] = workspace; - workspace += blocksperrow; - } - } - - return result; -} - - -/* - * About virtual array management: - * - * The above "normal" array routines are only used to allocate strip buffers - * (as wide as the image, but just a few rows high). Full-image-sized buffers - * are handled as "virtual" arrays. The array is still accessed a strip at a - * time, but the memory manager must save the whole array for repeated - * accesses. The intended implementation is that there is a strip buffer in - * memory (as high as is possible given the desired memory limit), plus a - * backing file that holds the rest of the array. - * - * The request_virt_array routines are told the total size of the image and - * the maximum number of rows that will be accessed at once. The in-memory - * buffer must be at least as large as the maxaccess value. - * - * The request routines create control blocks but not the in-memory buffers. - * That is postponed until realize_virt_arrays is called. At that time the - * total amount of space needed is known (approximately, anyway), so free - * memory can be divided up fairly. - * - * The access_virt_array routines are responsible for making a specific strip - * area accessible (after reading or writing the backing file, if necessary). - * Note that the access routines are told whether the caller intends to modify - * the accessed strip; during a read-only pass this saves having to rewrite - * data to disk. The access routines are also responsible for pre-zeroing - * any newly accessed rows, if pre-zeroing was requested. - * - * In current usage, the access requests are usually for nonoverlapping - * strips; that is, successive access start_row numbers differ by exactly - * num_rows = maxaccess. This means we can get good performance with simple - * buffer dump/reload logic, by making the in-memory buffer be a multiple - * of the access height; then there will never be accesses across bufferload - * boundaries. The code will still work with overlapping access requests, - * but it doesn't handle bufferload overlaps very efficiently. - */ - - -METHODDEF(jvirt_sarray_ptr) -request_virt_sarray (j_common_ptr cinfo, int pool_id, wxjpeg_boolean pre_zero, - JDIMENSION samplesperrow, JDIMENSION numrows, - JDIMENSION maxaccess) -/* Request a virtual 2-D sample array */ -{ - my_mem_ptr mem = (my_mem_ptr) cinfo->mem; - jvirt_sarray_ptr result; - - /* Only IMAGE-lifetime virtual arrays are currently supported */ - if (pool_id != JPOOL_IMAGE) - ERREXIT1(cinfo, JERR_BAD_POOL_ID, pool_id); /* safety check */ - - /* get control block */ - result = (jvirt_sarray_ptr) alloc_small(cinfo, pool_id, - SIZEOF(struct jvirt_sarray_control)); - - result->mem_buffer = NULL; /* marks array not yet realized */ - result->rows_in_array = numrows; - result->samplesperrow = samplesperrow; - result->maxaccess = maxaccess; - result->pre_zero = pre_zero; - result->b_s_open = FALSE; /* no associated backing-store object */ - result->next = mem->virt_sarray_list; /* add to list of virtual arrays */ - mem->virt_sarray_list = result; - - return result; -} - - -METHODDEF(jvirt_barray_ptr) -request_virt_barray (j_common_ptr cinfo, int pool_id, wxjpeg_boolean pre_zero, - JDIMENSION blocksperrow, JDIMENSION numrows, - JDIMENSION maxaccess) -/* Request a virtual 2-D coefficient-block array */ -{ - my_mem_ptr mem = (my_mem_ptr) cinfo->mem; - jvirt_barray_ptr result; - - /* Only IMAGE-lifetime virtual arrays are currently supported */ - if (pool_id != JPOOL_IMAGE) - ERREXIT1(cinfo, JERR_BAD_POOL_ID, pool_id); /* safety check */ - - /* get control block */ - result = (jvirt_barray_ptr) alloc_small(cinfo, pool_id, - SIZEOF(struct jvirt_barray_control)); - - result->mem_buffer = NULL; /* marks array not yet realized */ - result->rows_in_array = numrows; - result->blocksperrow = blocksperrow; - result->maxaccess = maxaccess; - result->pre_zero = pre_zero; - result->b_s_open = FALSE; /* no associated backing-store object */ - result->next = mem->virt_barray_list; /* add to list of virtual arrays */ - mem->virt_barray_list = result; - - return result; -} - - -METHODDEF(void) -realize_virt_arrays (j_common_ptr cinfo) -/* Allocate the in-memory buffers for any unrealized virtual arrays */ -{ - my_mem_ptr mem = (my_mem_ptr) cinfo->mem; - long space_per_minheight, maximum_space, avail_mem; - long minheights, max_minheights; - jvirt_sarray_ptr sptr; - jvirt_barray_ptr bptr; - - /* Compute the minimum space needed (maxaccess rows in each buffer) - * and the maximum space needed (full image height in each buffer). - * These may be of use to the system-dependent jpeg_mem_available routine. - */ - space_per_minheight = 0; - maximum_space = 0; - for (sptr = mem->virt_sarray_list; sptr != NULL; sptr = sptr->next) { - if (sptr->mem_buffer == NULL) { /* if not realized yet */ - space_per_minheight += (long) sptr->maxaccess * - (long) sptr->samplesperrow * SIZEOF(JSAMPLE); - maximum_space += (long) sptr->rows_in_array * - (long) sptr->samplesperrow * SIZEOF(JSAMPLE); - } - } - for (bptr = mem->virt_barray_list; bptr != NULL; bptr = bptr->next) { - if (bptr->mem_buffer == NULL) { /* if not realized yet */ - space_per_minheight += (long) bptr->maxaccess * - (long) bptr->blocksperrow * SIZEOF(JBLOCK); - maximum_space += (long) bptr->rows_in_array * - (long) bptr->blocksperrow * SIZEOF(JBLOCK); - } - } - - if (space_per_minheight <= 0) - return; /* no unrealized arrays, no work */ - - /* Determine amount of memory to actually use; this is system-dependent. */ - avail_mem = jpeg_mem_available(cinfo, space_per_minheight, maximum_space, - mem->total_space_allocated); - - /* If the maximum space needed is available, make all the buffers full - * height; otherwise parcel it out with the same number of minheights - * in each buffer. - */ - if (avail_mem >= maximum_space) - max_minheights = 1000000000L; - else { - max_minheights = avail_mem / space_per_minheight; - /* If there doesn't seem to be enough space, try to get the minimum - * anyway. This allows a "stub" implementation of jpeg_mem_available(). - */ - if (max_minheights <= 0) - max_minheights = 1; - } - - /* Allocate the in-memory buffers and initialize backing store as needed. */ - - for (sptr = mem->virt_sarray_list; sptr != NULL; sptr = sptr->next) { - if (sptr->mem_buffer == NULL) { /* if not realized yet */ - minheights = ((long) sptr->rows_in_array - 1L) / sptr->maxaccess + 1L; - if (minheights <= max_minheights) { - /* This buffer fits in memory */ - sptr->rows_in_mem = sptr->rows_in_array; - } else { - /* It doesn't fit in memory, create backing store. */ - sptr->rows_in_mem = (JDIMENSION) (max_minheights * sptr->maxaccess); - jpeg_open_backing_store(cinfo, & sptr->b_s_info, - (long) sptr->rows_in_array * - (long) sptr->samplesperrow * - (long) SIZEOF(JSAMPLE)); - sptr->b_s_open = TRUE; - } - sptr->mem_buffer = alloc_sarray(cinfo, JPOOL_IMAGE, - sptr->samplesperrow, sptr->rows_in_mem); - sptr->rowsperchunk = mem->last_rowsperchunk; - sptr->cur_start_row = 0; - sptr->first_undef_row = 0; - sptr->dirty = FALSE; - } - } - - for (bptr = mem->virt_barray_list; bptr != NULL; bptr = bptr->next) { - if (bptr->mem_buffer == NULL) { /* if not realized yet */ - minheights = ((long) bptr->rows_in_array - 1L) / bptr->maxaccess + 1L; - if (minheights <= max_minheights) { - /* This buffer fits in memory */ - bptr->rows_in_mem = bptr->rows_in_array; - } else { - /* It doesn't fit in memory, create backing store. */ - bptr->rows_in_mem = (JDIMENSION) (max_minheights * bptr->maxaccess); - jpeg_open_backing_store(cinfo, & bptr->b_s_info, - (long) bptr->rows_in_array * - (long) bptr->blocksperrow * - (long) SIZEOF(JBLOCK)); - bptr->b_s_open = TRUE; - } - bptr->mem_buffer = alloc_barray(cinfo, JPOOL_IMAGE, - bptr->blocksperrow, bptr->rows_in_mem); - bptr->rowsperchunk = mem->last_rowsperchunk; - bptr->cur_start_row = 0; - bptr->first_undef_row = 0; - bptr->dirty = FALSE; - } - } -} - - -LOCAL(void) -do_sarray_io (j_common_ptr cinfo, jvirt_sarray_ptr ptr, wxjpeg_boolean writing) -/* Do backing store read or write of a virtual sample array */ -{ - long bytesperrow, file_offset, byte_count, rows, thisrow, i; - - bytesperrow = (long) ptr->samplesperrow * SIZEOF(JSAMPLE); - file_offset = ptr->cur_start_row * bytesperrow; - /* Loop to read or write each allocation chunk in mem_buffer */ - for (i = 0; i < (long) ptr->rows_in_mem; i += ptr->rowsperchunk) { - /* One chunk, but check for short chunk at end of buffer */ - rows = MIN((long) ptr->rowsperchunk, (long) ptr->rows_in_mem - i); - /* Transfer no more than is currently defined */ - thisrow = (long) ptr->cur_start_row + i; - rows = MIN(rows, (long) ptr->first_undef_row - thisrow); - /* Transfer no more than fits in file */ - rows = MIN(rows, (long) ptr->rows_in_array - thisrow); - if (rows <= 0) /* this chunk might be past end of file! */ - break; - byte_count = rows * bytesperrow; - if (writing) - (*ptr->b_s_info.write_backing_store) (cinfo, & ptr->b_s_info, - (void FAR *) ptr->mem_buffer[i], - file_offset, byte_count); - else - (*ptr->b_s_info.read_backing_store) (cinfo, & ptr->b_s_info, - (void FAR *) ptr->mem_buffer[i], - file_offset, byte_count); - file_offset += byte_count; - } -} - - -LOCAL(void) -do_barray_io (j_common_ptr cinfo, jvirt_barray_ptr ptr, wxjpeg_boolean writing) -/* Do backing store read or write of a virtual coefficient-block array */ -{ - long bytesperrow, file_offset, byte_count, rows, thisrow, i; - - bytesperrow = (long) ptr->blocksperrow * SIZEOF(JBLOCK); - file_offset = ptr->cur_start_row * bytesperrow; - /* Loop to read or write each allocation chunk in mem_buffer */ - for (i = 0; i < (long) ptr->rows_in_mem; i += ptr->rowsperchunk) { - /* One chunk, but check for short chunk at end of buffer */ - rows = MIN((long) ptr->rowsperchunk, (long) ptr->rows_in_mem - i); - /* Transfer no more than is currently defined */ - thisrow = (long) ptr->cur_start_row + i; - rows = MIN(rows, (long) ptr->first_undef_row - thisrow); - /* Transfer no more than fits in file */ - rows = MIN(rows, (long) ptr->rows_in_array - thisrow); - if (rows <= 0) /* this chunk might be past end of file! */ - break; - byte_count = rows * bytesperrow; - if (writing) - (*ptr->b_s_info.write_backing_store) (cinfo, & ptr->b_s_info, - (void FAR *) ptr->mem_buffer[i], - file_offset, byte_count); - else - (*ptr->b_s_info.read_backing_store) (cinfo, & ptr->b_s_info, - (void FAR *) ptr->mem_buffer[i], - file_offset, byte_count); - file_offset += byte_count; - } -} - - -METHODDEF(JSAMPARRAY) -access_virt_sarray (j_common_ptr cinfo, jvirt_sarray_ptr ptr, - JDIMENSION start_row, JDIMENSION num_rows, - wxjpeg_boolean writable) -/* Access the part of a virtual sample array starting at start_row */ -/* and extending for num_rows rows. writable is true if */ -/* caller intends to modify the accessed area. */ -{ - JDIMENSION end_row = start_row + num_rows; - JDIMENSION undef_row; - - /* debugging check */ - if (end_row > ptr->rows_in_array || num_rows > ptr->maxaccess || - ptr->mem_buffer == NULL) - ERREXIT(cinfo, JERR_BAD_VIRTUAL_ACCESS); - - /* Make the desired part of the virtual array accessible */ - if (start_row < ptr->cur_start_row || - end_row > ptr->cur_start_row+ptr->rows_in_mem) { - if (! ptr->b_s_open) - ERREXIT(cinfo, JERR_VIRTUAL_BUG); - /* Flush old buffer contents if necessary */ - if (ptr->dirty) { - do_sarray_io(cinfo, ptr, TRUE); - ptr->dirty = FALSE; - } - /* Decide what part of virtual array to access. - * Algorithm: if target address > current window, assume forward scan, - * load starting at target address. If target address < current window, - * assume backward scan, load so that target area is top of window. - * Note that when switching from forward write to forward read, will have - * start_row = 0, so the limiting case applies and we load from 0 anyway. - */ - if (start_row > ptr->cur_start_row) { - ptr->cur_start_row = start_row; - } else { - /* use long arithmetic here to avoid overflow & unsigned problems */ - long ltemp; - - ltemp = (long) end_row - (long) ptr->rows_in_mem; - if (ltemp < 0) - ltemp = 0; /* don't fall off front end of file */ - ptr->cur_start_row = (JDIMENSION) ltemp; - } - /* Read in the selected part of the array. - * During the initial write pass, we will do no actual read - * because the selected part is all undefined. - */ - do_sarray_io(cinfo, ptr, FALSE); - } - /* Ensure the accessed part of the array is defined; prezero if needed. - * To improve locality of access, we only prezero the part of the array - * that the caller is about to access, not the entire in-memory array. - */ - if (ptr->first_undef_row < end_row) { - if (ptr->first_undef_row < start_row) { - if (writable) /* writer skipped over a section of array */ - ERREXIT(cinfo, JERR_BAD_VIRTUAL_ACCESS); - undef_row = start_row; /* but reader is allowed to read ahead */ - } else { - undef_row = ptr->first_undef_row; - } - if (writable) - ptr->first_undef_row = end_row; - if (ptr->pre_zero) { - size_t bytesperrow = (size_t) ptr->samplesperrow * SIZEOF(JSAMPLE); - undef_row -= ptr->cur_start_row; /* make indexes relative to buffer */ - end_row -= ptr->cur_start_row; - while (undef_row < end_row) { - jzero_far((void FAR *) ptr->mem_buffer[undef_row], bytesperrow); - undef_row++; - } - } else { - if (! writable) /* reader looking at undefined data */ - ERREXIT(cinfo, JERR_BAD_VIRTUAL_ACCESS); - } - } - /* Flag the buffer dirty if caller will write in it */ - if (writable) - ptr->dirty = TRUE; - /* Return address of proper part of the buffer */ - return ptr->mem_buffer + (start_row - ptr->cur_start_row); -} - - -METHODDEF(JBLOCKARRAY) -access_virt_barray (j_common_ptr cinfo, jvirt_barray_ptr ptr, - JDIMENSION start_row, JDIMENSION num_rows, - wxjpeg_boolean writable) -/* Access the part of a virtual block array starting at start_row */ -/* and extending for num_rows rows. writable is true if */ -/* caller intends to modify the accessed area. */ -{ - JDIMENSION end_row = start_row + num_rows; - JDIMENSION undef_row; - - /* debugging check */ - if (end_row > ptr->rows_in_array || num_rows > ptr->maxaccess || - ptr->mem_buffer == NULL) - ERREXIT(cinfo, JERR_BAD_VIRTUAL_ACCESS); - - /* Make the desired part of the virtual array accessible */ - if (start_row < ptr->cur_start_row || - end_row > ptr->cur_start_row+ptr->rows_in_mem) { - if (! ptr->b_s_open) - ERREXIT(cinfo, JERR_VIRTUAL_BUG); - /* Flush old buffer contents if necessary */ - if (ptr->dirty) { - do_barray_io(cinfo, ptr, TRUE); - ptr->dirty = FALSE; - } - /* Decide what part of virtual array to access. - * Algorithm: if target address > current window, assume forward scan, - * load starting at target address. If target address < current window, - * assume backward scan, load so that target area is top of window. - * Note that when switching from forward write to forward read, will have - * start_row = 0, so the limiting case applies and we load from 0 anyway. - */ - if (start_row > ptr->cur_start_row) { - ptr->cur_start_row = start_row; - } else { - /* use long arithmetic here to avoid overflow & unsigned problems */ - long ltemp; - - ltemp = (long) end_row - (long) ptr->rows_in_mem; - if (ltemp < 0) - ltemp = 0; /* don't fall off front end of file */ - ptr->cur_start_row = (JDIMENSION) ltemp; - } - /* Read in the selected part of the array. - * During the initial write pass, we will do no actual read - * because the selected part is all undefined. - */ - do_barray_io(cinfo, ptr, FALSE); - } - /* Ensure the accessed part of the array is defined; prezero if needed. - * To improve locality of access, we only prezero the part of the array - * that the caller is about to access, not the entire in-memory array. - */ - if (ptr->first_undef_row < end_row) { - if (ptr->first_undef_row < start_row) { - if (writable) /* writer skipped over a section of array */ - ERREXIT(cinfo, JERR_BAD_VIRTUAL_ACCESS); - undef_row = start_row; /* but reader is allowed to read ahead */ - } else { - undef_row = ptr->first_undef_row; - } - if (writable) - ptr->first_undef_row = end_row; - if (ptr->pre_zero) { - size_t bytesperrow = (size_t) ptr->blocksperrow * SIZEOF(JBLOCK); - undef_row -= ptr->cur_start_row; /* make indexes relative to buffer */ - end_row -= ptr->cur_start_row; - while (undef_row < end_row) { - jzero_far((void FAR *) ptr->mem_buffer[undef_row], bytesperrow); - undef_row++; - } - } else { - if (! writable) /* reader looking at undefined data */ - ERREXIT(cinfo, JERR_BAD_VIRTUAL_ACCESS); - } - } - /* Flag the buffer dirty if caller will write in it */ - if (writable) - ptr->dirty = TRUE; - /* Return address of proper part of the buffer */ - return ptr->mem_buffer + (start_row - ptr->cur_start_row); -} - - -/* - * Release all objects belonging to a specified pool. - */ - -METHODDEF(void) -free_pool (j_common_ptr cinfo, int pool_id) -{ - my_mem_ptr mem = (my_mem_ptr) cinfo->mem; - small_pool_ptr shdr_ptr; - large_pool_ptr lhdr_ptr; - size_t space_freed; - - if (pool_id < 0 || pool_id >= JPOOL_NUMPOOLS) - ERREXIT1(cinfo, JERR_BAD_POOL_ID, pool_id); /* safety check */ - -#ifdef MEM_STATS - if (cinfo->err->trace_level > 1) - print_mem_stats(cinfo, pool_id); /* print pool's memory usage statistics */ -#endif - - /* If freeing IMAGE pool, close any virtual arrays first */ - if (pool_id == JPOOL_IMAGE) { - jvirt_sarray_ptr sptr; - jvirt_barray_ptr bptr; - - for (sptr = mem->virt_sarray_list; sptr != NULL; sptr = sptr->next) { - if (sptr->b_s_open) { /* there may be no backing store */ - sptr->b_s_open = FALSE; /* prevent recursive close if error */ - (*sptr->b_s_info.close_backing_store) (cinfo, & sptr->b_s_info); - } - } - mem->virt_sarray_list = NULL; - for (bptr = mem->virt_barray_list; bptr != NULL; bptr = bptr->next) { - if (bptr->b_s_open) { /* there may be no backing store */ - bptr->b_s_open = FALSE; /* prevent recursive close if error */ - (*bptr->b_s_info.close_backing_store) (cinfo, & bptr->b_s_info); - } - } - mem->virt_barray_list = NULL; - } - - /* Release large objects */ - lhdr_ptr = mem->large_list[pool_id]; - mem->large_list[pool_id] = NULL; - - while (lhdr_ptr != NULL) { - large_pool_ptr next_lhdr_ptr = lhdr_ptr->hdr.next; - space_freed = lhdr_ptr->hdr.bytes_used + - lhdr_ptr->hdr.bytes_left + - SIZEOF(large_pool_hdr); - jpeg_free_large(cinfo, (void FAR *) lhdr_ptr, space_freed); - mem->total_space_allocated -= space_freed; - lhdr_ptr = next_lhdr_ptr; - } - - /* Release small objects */ - shdr_ptr = mem->small_list[pool_id]; - mem->small_list[pool_id] = NULL; - - while (shdr_ptr != NULL) { - small_pool_ptr next_shdr_ptr = shdr_ptr->hdr.next; - space_freed = shdr_ptr->hdr.bytes_used + - shdr_ptr->hdr.bytes_left + - SIZEOF(small_pool_hdr); - jpeg_free_small(cinfo, (void *) shdr_ptr, space_freed); - mem->total_space_allocated -= space_freed; - shdr_ptr = next_shdr_ptr; - } -} - - -/* - * Close up shop entirely. - * Note that this cannot be called unless cinfo->mem is non-NULL. - */ - -METHODDEF(void) -self_destruct (j_common_ptr cinfo) -{ - int pool; - - /* Close all backing store, release all memory. - * Releasing pools in reverse order might help avoid fragmentation - * with some (brain-damaged) malloc libraries. - */ - for (pool = JPOOL_NUMPOOLS-1; pool >= JPOOL_PERMANENT; pool--) { - free_pool(cinfo, pool); - } - - /* Release the memory manager control block too. */ - jpeg_free_small(cinfo, (void *) cinfo->mem, SIZEOF(my_memory_mgr)); - cinfo->mem = NULL; /* ensures I will be called only once */ - - jpeg_mem_term(cinfo); /* system-dependent cleanup */ -} - - -/* - * Memory manager initialization. - * When this is called, only the error manager pointer is valid in cinfo! - */ - -GLOBAL(void) -jinit_memory_mgr (j_common_ptr cinfo) -{ - my_mem_ptr mem; - long max_to_use; - int pool; - size_t test_mac; - - cinfo->mem = NULL; /* for safety if init fails */ - - /* Check for configuration errors. - * SIZEOF(ALIGN_TYPE) should be a power of 2; otherwise, it probably - * doesn't reflect any real hardware alignment requirement. - * The test is a little tricky: for X>0, X and X-1 have no one-bits - * in common if and only if X is a power of 2, ie has only one one-bit. - * Some compilers may give an "unreachable code" warning here; ignore it. - */ - if ((SIZEOF(ALIGN_TYPE) & (SIZEOF(ALIGN_TYPE)-1)) != 0) - ERREXIT(cinfo, JERR_BAD_ALIGN_TYPE); - /* MAX_ALLOC_CHUNK must be representable as type size_t, and must be - * a multiple of SIZEOF(ALIGN_TYPE). - * Again, an "unreachable code" warning may be ignored here. - * But a "constant too large" warning means you need to fix MAX_ALLOC_CHUNK. - */ - test_mac = (size_t) MAX_ALLOC_CHUNK; - if ((long) test_mac != MAX_ALLOC_CHUNK || - (MAX_ALLOC_CHUNK % SIZEOF(ALIGN_TYPE)) != 0) - ERREXIT(cinfo, JERR_BAD_ALLOC_CHUNK); - - max_to_use = jpeg_mem_init(cinfo); /* system-dependent initialization */ - - /* Attempt to allocate memory manager's control block */ - mem = (my_mem_ptr) jpeg_get_small(cinfo, SIZEOF(my_memory_mgr)); - - if (mem == NULL) { - jpeg_mem_term(cinfo); /* system-dependent cleanup */ - ERREXIT1(cinfo, JERR_OUT_OF_MEMORY, 0); - } - - /* OK, fill in the method pointers */ - mem->pub.alloc_small = alloc_small; - mem->pub.alloc_large = alloc_large; - mem->pub.alloc_sarray = alloc_sarray; - mem->pub.alloc_barray = alloc_barray; - mem->pub.request_virt_sarray = request_virt_sarray; - mem->pub.request_virt_barray = request_virt_barray; - mem->pub.realize_virt_arrays = realize_virt_arrays; - mem->pub.access_virt_sarray = access_virt_sarray; - mem->pub.access_virt_barray = access_virt_barray; - mem->pub.free_pool = free_pool; - mem->pub.self_destruct = self_destruct; - - /* Make MAX_ALLOC_CHUNK accessible to other modules */ - mem->pub.max_alloc_chunk = MAX_ALLOC_CHUNK; - - /* Initialize working state */ - mem->pub.max_memory_to_use = max_to_use; - - for (pool = JPOOL_NUMPOOLS-1; pool >= JPOOL_PERMANENT; pool--) { - mem->small_list[pool] = NULL; - mem->large_list[pool] = NULL; - } - mem->virt_sarray_list = NULL; - mem->virt_barray_list = NULL; - - mem->total_space_allocated = SIZEOF(my_memory_mgr); - - /* Declare ourselves open for business */ - cinfo->mem = & mem->pub; - - /* Check for an environment variable JPEGMEM; if found, override the - * default max_memory setting from jpeg_mem_init. Note that the - * surrounding application may again override this value. - * If your system doesn't support getenv(), define NO_GETENV to disable - * this feature. - */ -#ifndef NO_GETENV - { char * memenv; - - if ((memenv = getenv("JPEGMEM")) != NULL) { - char ch = 'x'; - - if (sscanf(memenv, "%ld%c", &max_to_use, &ch) > 0) { - if (ch == 'm' || ch == 'M') - max_to_use *= 1000L; - mem->pub.max_memory_to_use = max_to_use * 1000L; - } - } - } -#endif - -} diff --git a/wxWidgets/src/jpeg/jmemname.c b/wxWidgets/src/jpeg/jmemname.c deleted file mode 100644 index ed96dee1bc..0000000000 --- a/wxWidgets/src/jpeg/jmemname.c +++ /dev/null @@ -1,276 +0,0 @@ -/* - * jmemname.c - * - * Copyright (C) 1992-1997, Thomas G. Lane. - * This file is part of the Independent JPEG Group's software. - * For conditions of distribution and use, see the accompanying README file. - * - * This file provides a generic implementation of the system-dependent - * portion of the JPEG memory manager. This implementation assumes that - * you must explicitly construct a name for each temp file. - * Also, the problem of determining the amount of memory available - * is shoved onto the user. - */ - -#define JPEG_INTERNALS -#include "jinclude.h" -#include "jpeglib.h" -#include "jmemsys.h" /* import the system-dependent declarations */ - -#ifndef HAVE_STDLIB_H /* should declare malloc(),free() */ -extern void * malloc JPP((size_t size)); -extern void free JPP((void *ptr)); -#endif - -#ifndef SEEK_SET /* pre-ANSI systems may not define this; */ -#define SEEK_SET 0 /* if not, assume 0 is correct */ -#endif - -#ifdef DONT_USE_B_MODE /* define mode parameters for fopen() */ -#define READ_BINARY "r" -#define RW_BINARY "w+" -#else -#ifdef VMS /* VMS is very nonstandard */ -#define READ_BINARY "rb", "ctx=stm" -#define RW_BINARY "w+b", "ctx=stm" -#else /* standard ANSI-compliant case */ -#define READ_BINARY "rb" -#define RW_BINARY "w+b" -#endif -#endif - - -/* - * Selection of a file name for a temporary file. - * This is system-dependent! - * - * The code as given is suitable for most Unix systems, and it is easily - * modified for most non-Unix systems. Some notes: - * 1. The temp file is created in the directory named by TEMP_DIRECTORY. - * The default value is /usr/tmp, which is the conventional place for - * creating large temp files on Unix. On other systems you'll probably - * want to change the file location. You can do this by editing the - * #define, or (preferred) by defining TEMP_DIRECTORY in jconfig.h. - * - * 2. If you need to change the file name as well as its location, - * you can override the TEMP_FILE_NAME macro. (Note that this is - * actually a printf format string; it must contain %s and %d.) - * Few people should need to do this. - * - * 3. mktemp() is used to ensure that multiple processes running - * simultaneously won't select the same file names. If your system - * doesn't have mktemp(), define NO_MKTEMP to do it the hard way. - * (If you don't have , also define NO_ERRNO_H.) - * - * 4. You probably want to define NEED_SIGNAL_CATCHER so that cjpeg.c/djpeg.c - * will cause the temp files to be removed if you stop the program early. - */ - -#ifndef TEMP_DIRECTORY /* can override from jconfig.h or Makefile */ -#define TEMP_DIRECTORY "/usr/tmp/" /* recommended setting for Unix */ -#endif - -static int next_file_num; /* to distinguish among several temp files */ - -#ifdef NO_MKTEMP - -#ifndef TEMP_FILE_NAME /* can override from jconfig.h or Makefile */ -#define TEMP_FILE_NAME "%sJPG%03d.TMP" -#endif - -#ifndef NO_ERRNO_H -#include /* to define ENOENT */ -#endif - -/* ANSI C specifies that errno is a macro, but on older systems it's more - * likely to be a plain int variable. And not all versions of errno.h - * bother to declare it, so we have to in order to be most portable. Thus: - */ -#ifndef errno -extern int errno; -#endif - - -LOCAL(void) -select_file_name (char * fname) -{ - FILE * tfile; - - /* Keep generating file names till we find one that's not in use */ - for (;;) { - next_file_num++; /* advance counter */ - sprintf(fname, TEMP_FILE_NAME, TEMP_DIRECTORY, next_file_num); - if ((tfile = fopen(fname, READ_BINARY)) == NULL) { - /* fopen could have failed for a reason other than the file not - * being there; for example, file there but unreadable. - * If isn't available, then we cannot test the cause. - */ -#ifdef ENOENT - if (errno != ENOENT) - continue; -#endif - break; - } - fclose(tfile); /* oops, it's there; close tfile & try again */ - } -} - -#else /* ! NO_MKTEMP */ - -/* Note that mktemp() requires the initial filename to end in six X's */ -#ifndef TEMP_FILE_NAME /* can override from jconfig.h or Makefile */ -#define TEMP_FILE_NAME "%sJPG%dXXXXXX" -#endif - -LOCAL(void) -select_file_name (char * fname) -{ - next_file_num++; /* advance counter */ - sprintf(fname, TEMP_FILE_NAME, TEMP_DIRECTORY, next_file_num); - mktemp(fname); /* make sure file name is unique */ - /* mktemp replaces the trailing XXXXXX with a unique string of characters */ -} - -#endif /* NO_MKTEMP */ - - -/* - * Memory allocation and freeing are controlled by the regular library - * routines malloc() and free(). - */ - -GLOBAL(void *) -jpeg_get_small (j_common_ptr cinfo, size_t sizeofobject) -{ - return (void *) malloc(sizeofobject); -} - -GLOBAL(void) -jpeg_free_small (j_common_ptr cinfo, void * object, size_t sizeofobject) -{ - free(object); -} - - -/* - * "Large" objects are treated the same as "small" ones. - * NB: although we include FAR keywords in the routine declarations, - * this file won't actually work in 80x86 small/medium model; at least, - * you probably won't be able to process useful-size images in only 64KB. - */ - -GLOBAL(void FAR *) -jpeg_get_large (j_common_ptr cinfo, size_t sizeofobject) -{ - return (void FAR *) malloc(sizeofobject); -} - -GLOBAL(void) -jpeg_free_large (j_common_ptr cinfo, void FAR * object, size_t sizeofobject) -{ - free(object); -} - - -/* - * This routine computes the total memory space available for allocation. - * It's impossible to do this in a portable way; our current solution is - * to make the user tell us (with a default value set at compile time). - * If you can actually get the available space, it's a good idea to subtract - * a slop factor of 5% or so. - */ - -#ifndef DEFAULT_MAX_MEM /* so can override from makefile */ -#define DEFAULT_MAX_MEM 1000000L /* default: one megabyte */ -#endif - -GLOBAL(long) -jpeg_mem_available (j_common_ptr cinfo, long min_bytes_needed, - long max_bytes_needed, long already_allocated) -{ - return cinfo->mem->max_memory_to_use - already_allocated; -} - - -/* - * Backing store (temporary file) management. - * Backing store objects are only used when the value returned by - * jpeg_mem_available is less than the total space needed. You can dispense - * with these routines if you have plenty of virtual memory; see jmemnobs.c. - */ - - -METHODDEF(void) -read_backing_store (j_common_ptr cinfo, backing_store_ptr info, - void FAR * buffer_address, - long file_offset, long byte_count) -{ - if (fseek(info->temp_file, file_offset, SEEK_SET)) - ERREXIT(cinfo, JERR_TFILE_SEEK); - if (JFREAD(info->temp_file, buffer_address, byte_count) - != (size_t) byte_count) - ERREXIT(cinfo, JERR_TFILE_READ); -} - - -METHODDEF(void) -write_backing_store (j_common_ptr cinfo, backing_store_ptr info, - void FAR * buffer_address, - long file_offset, long byte_count) -{ - if (fseek(info->temp_file, file_offset, SEEK_SET)) - ERREXIT(cinfo, JERR_TFILE_SEEK); - if (JFWRITE(info->temp_file, buffer_address, byte_count) - != (size_t) byte_count) - ERREXIT(cinfo, JERR_TFILE_WRITE); -} - - -METHODDEF(void) -close_backing_store (j_common_ptr cinfo, backing_store_ptr info) -{ - fclose(info->temp_file); /* close the file */ - unlink(info->temp_name); /* delete the file */ -/* If your system doesn't have unlink(), use remove() instead. - * remove() is the ANSI-standard name for this function, but if - * your system was ANSI you'd be using jmemansi.c, right? - */ - TRACEMSS(cinfo, 1, JTRC_TFILE_CLOSE, info->temp_name); -} - - -/* - * Initial opening of a backing-store object. - */ - -GLOBAL(void) -jpeg_open_backing_store (j_common_ptr cinfo, backing_store_ptr info, - long total_bytes_needed) -{ - select_file_name(info->temp_name); - if ((info->temp_file = fopen(info->temp_name, RW_BINARY)) == NULL) - ERREXITS(cinfo, JERR_TFILE_CREATE, info->temp_name); - info->read_backing_store = read_backing_store; - info->write_backing_store = write_backing_store; - info->close_backing_store = close_backing_store; - TRACEMSS(cinfo, 1, JTRC_TFILE_OPEN, info->temp_name); -} - - -/* - * These routines take care of any system-dependent initialization and - * cleanup required. - */ - -GLOBAL(long) -jpeg_mem_init (j_common_ptr cinfo) -{ - next_file_num = 0; /* initialize temp file name generator */ - return DEFAULT_MAX_MEM; /* default for max_memory_to_use */ -} - -GLOBAL(void) -jpeg_mem_term (j_common_ptr cinfo) -{ - /* no work */ -} diff --git a/wxWidgets/src/jpeg/jmemnobs.c b/wxWidgets/src/jpeg/jmemnobs.c deleted file mode 100644 index eb8c337725..0000000000 --- a/wxWidgets/src/jpeg/jmemnobs.c +++ /dev/null @@ -1,109 +0,0 @@ -/* - * jmemnobs.c - * - * Copyright (C) 1992-1996, Thomas G. Lane. - * This file is part of the Independent JPEG Group's software. - * For conditions of distribution and use, see the accompanying README file. - * - * This file provides a really simple implementation of the system- - * dependent portion of the JPEG memory manager. This implementation - * assumes that no backing-store files are needed: all required space - * can be obtained from malloc(). - * This is very portable in the sense that it'll compile on almost anything, - * but you'd better have lots of main memory (or virtual memory) if you want - * to process big images. - * Note that the max_memory_to_use option is ignored by this implementation. - */ - -#define JPEG_INTERNALS -#include "jinclude.h" -#include "jpeglib.h" -#include "jmemsys.h" /* import the system-dependent declarations */ - -#ifndef HAVE_STDLIB_H /* should declare malloc(),free() */ -extern void * malloc JPP((size_t size)); -extern void free JPP((void *ptr)); -#endif - - -/* - * Memory allocation and freeing are controlled by the regular library - * routines malloc() and free(). - */ - -GLOBAL(void *) -jpeg_get_small (j_common_ptr cinfo, size_t sizeofobject) -{ - return (void *) malloc(sizeofobject); -} - -GLOBAL(void) -jpeg_free_small (j_common_ptr cinfo, void * object, size_t sizeofobject) -{ - free(object); -} - - -/* - * "Large" objects are treated the same as "small" ones. - * NB: although we include FAR keywords in the routine declarations, - * this file won't actually work in 80x86 small/medium model; at least, - * you probably won't be able to process useful-size images in only 64KB. - */ - -GLOBAL(void FAR *) -jpeg_get_large (j_common_ptr cinfo, size_t sizeofobject) -{ - return (void FAR *) malloc(sizeofobject); -} - -GLOBAL(void) -jpeg_free_large (j_common_ptr cinfo, void FAR * object, size_t sizeofobject) -{ - free(object); -} - - -/* - * This routine computes the total memory space available for allocation. - * Here we always say, "we got all you want bud!" - */ - -GLOBAL(long) -jpeg_mem_available (j_common_ptr cinfo, long min_bytes_needed, - long max_bytes_needed, long already_allocated) -{ - return max_bytes_needed; -} - - -/* - * Backing store (temporary file) management. - * Since jpeg_mem_available always promised the moon, - * this should never be called and we can just error out. - */ - -GLOBAL(void) -jpeg_open_backing_store (j_common_ptr cinfo, backing_store_ptr info, - long total_bytes_needed) -{ - ERREXIT(cinfo, JERR_NO_BACKING_STORE); -} - - -/* - * These routines take care of any system-dependent initialization and - * cleanup required. Here, there isn't any. - */ - -GLOBAL(long) -jpeg_mem_init (j_common_ptr cinfo) -{ - return 0; /* just set max_memory_to_use to 0 */ -} - -GLOBAL(void) -jpeg_mem_term (j_common_ptr cinfo) -{ - /* no work */ -} diff --git a/wxWidgets/src/jpeg/jmemsys.h b/wxWidgets/src/jpeg/jmemsys.h deleted file mode 100644 index 6c3c6d348f..0000000000 --- a/wxWidgets/src/jpeg/jmemsys.h +++ /dev/null @@ -1,198 +0,0 @@ -/* - * jmemsys.h - * - * Copyright (C) 1992-1997, Thomas G. Lane. - * This file is part of the Independent JPEG Group's software. - * For conditions of distribution and use, see the accompanying README file. - * - * This include file defines the interface between the system-independent - * and system-dependent portions of the JPEG memory manager. No other - * modules need include it. (The system-independent portion is jmemmgr.c; - * there are several different versions of the system-dependent portion.) - * - * This file works as-is for the system-dependent memory managers supplied - * in the IJG distribution. You may need to modify it if you write a - * custom memory manager. If system-dependent changes are needed in - * this file, the best method is to #ifdef them based on a configuration - * symbol supplied in jconfig.h, as we have done with USE_MSDOS_MEMMGR - * and USE_MAC_MEMMGR. - */ - - -/* Short forms of external names for systems with brain-damaged linkers. */ - -#ifdef NEED_SHORT_EXTERNAL_NAMES -#define jpeg_get_small jGetSmall -#define jpeg_free_small jFreeSmall -#define jpeg_get_large jGetLarge -#define jpeg_free_large jFreeLarge -#define jpeg_mem_available jMemAvail -#define jpeg_open_backing_store jOpenBackStore -#define jpeg_mem_init jMemInit -#define jpeg_mem_term jMemTerm -#endif /* NEED_SHORT_EXTERNAL_NAMES */ - - -/* - * These two functions are used to allocate and release small chunks of - * memory. (Typically the total amount requested through jpeg_get_small is - * no more than 20K or so; this will be requested in chunks of a few K each.) - * Behavior should be the same as for the standard library functions malloc - * and free; in particular, jpeg_get_small must return NULL on failure. - * On most systems, these ARE malloc and free. jpeg_free_small is passed the - * size of the object being freed, just in case it's needed. - * On an 80x86 machine using small-data memory model, these manage near heap. - */ - -EXTERN(void *) jpeg_get_small JPP((j_common_ptr cinfo, size_t sizeofobject)); -EXTERN(void) jpeg_free_small JPP((j_common_ptr cinfo, void * object, - size_t sizeofobject)); - -/* - * These two functions are used to allocate and release large chunks of - * memory (up to the total free space designated by jpeg_mem_available). - * The interface is the same as above, except that on an 80x86 machine, - * far pointers are used. On most other machines these are identical to - * the jpeg_get/free_small routines; but we keep them separate anyway, - * in case a different allocation strategy is desirable for large chunks. - */ - -EXTERN(void FAR *) jpeg_get_large JPP((j_common_ptr cinfo, - size_t sizeofobject)); -EXTERN(void) jpeg_free_large JPP((j_common_ptr cinfo, void FAR * object, - size_t sizeofobject)); - -/* - * The macro MAX_ALLOC_CHUNK designates the maximum number of bytes that may - * be requested in a single call to jpeg_get_large (and jpeg_get_small for that - * matter, but that case should never come into play). This macro is needed - * to model the 64Kb-segment-size limit of far addressing on 80x86 machines. - * On those machines, we expect that jconfig.h will provide a proper value. - * On machines with 32-bit flat address spaces, any large constant may be used. - * - * NB: jmemmgr.c expects that MAX_ALLOC_CHUNK will be representable as type - * size_t and will be a multiple of sizeof(align_type). - */ - -#ifndef MAX_ALLOC_CHUNK /* may be overridden in jconfig.h */ -#define MAX_ALLOC_CHUNK 1000000000L -#endif - -/* - * This routine computes the total space still available for allocation by - * jpeg_get_large. If more space than this is needed, backing store will be - * used. NOTE: any memory already allocated must not be counted. - * - * There is a minimum space requirement, corresponding to the minimum - * feasible buffer sizes; jmemmgr.c will request that much space even if - * jpeg_mem_available returns zero. The maximum space needed, enough to hold - * all working storage in memory, is also passed in case it is useful. - * Finally, the total space already allocated is passed. If no better - * method is available, cinfo->mem->max_memory_to_use - already_allocated - * is often a suitable calculation. - * - * It is OK for jpeg_mem_available to underestimate the space available - * (that'll just lead to more backing-store access than is really necessary). - * However, an overestimate will lead to failure. Hence it's wise to subtract - * a slop factor from the true available space. 5% should be enough. - * - * On machines with lots of virtual memory, any large constant may be returned. - * Conversely, zero may be returned to always use the minimum amount of memory. - */ - -EXTERN(long) jpeg_mem_available JPP((j_common_ptr cinfo, - long min_bytes_needed, - long max_bytes_needed, - long already_allocated)); - - -/* - * This structure holds whatever state is needed to access a single - * backing-store object. The read/write/close method pointers are called - * by jmemmgr.c to manipulate the backing-store object; all other fields - * are private to the system-dependent backing store routines. - */ - -#define TEMP_NAME_LENGTH 64 /* max length of a temporary file's name */ - - -#ifdef USE_MSDOS_MEMMGR /* DOS-specific junk */ - -typedef unsigned short XMSH; /* type of extended-memory handles */ -typedef unsigned short EMSH; /* type of expanded-memory handles */ - -typedef union { - short file_handle; /* DOS file handle if it's a temp file */ - XMSH xms_handle; /* handle if it's a chunk of XMS */ - EMSH ems_handle; /* handle if it's a chunk of EMS */ -} handle_union; - -#endif /* USE_MSDOS_MEMMGR */ - -#ifdef USE_MAC_MEMMGR /* Mac-specific junk */ -#include -#endif /* USE_MAC_MEMMGR */ - - -typedef struct backing_store_struct * backing_store_ptr; - -typedef struct backing_store_struct { - /* Methods for reading/writing/closing this backing-store object */ - JMETHOD(void, read_backing_store, (j_common_ptr cinfo, - backing_store_ptr info, - void FAR * buffer_address, - long file_offset, long byte_count)); - JMETHOD(void, write_backing_store, (j_common_ptr cinfo, - backing_store_ptr info, - void FAR * buffer_address, - long file_offset, long byte_count)); - JMETHOD(void, close_backing_store, (j_common_ptr cinfo, - backing_store_ptr info)); - - /* Private fields for system-dependent backing-store management */ -#ifdef USE_MSDOS_MEMMGR - /* For the MS-DOS manager (jmemdos.c), we need: */ - handle_union handle; /* reference to backing-store storage object */ - char temp_name[TEMP_NAME_LENGTH]; /* name if it's a file */ -#else -#ifdef USE_MAC_MEMMGR - /* For the Mac manager (jmemmac.c), we need: */ - short temp_file; /* file reference number to temp file */ - FSSpec tempSpec; /* the FSSpec for the temp file */ - char temp_name[TEMP_NAME_LENGTH]; /* name if it's a file */ -#else - /* For a typical implementation with temp files, we need: */ - FILE * temp_file; /* stdio reference to temp file */ - char temp_name[TEMP_NAME_LENGTH]; /* name of temp file */ -#endif -#endif -} backing_store_info; - - -/* - * Initial opening of a backing-store object. This must fill in the - * read/write/close pointers in the object. The read/write routines - * may take an error exit if the specified maximum file size is exceeded. - * (If jpeg_mem_available always returns a large value, this routine can - * just take an error exit.) - */ - -EXTERN(void) jpeg_open_backing_store JPP((j_common_ptr cinfo, - backing_store_ptr info, - long total_bytes_needed)); - - -/* - * These routines take care of any system-dependent initialization and - * cleanup required. jpeg_mem_init will be called before anything is - * allocated (and, therefore, nothing in cinfo is of use except the error - * manager pointer). It should return a suitable default value for - * max_memory_to_use; this may subsequently be overridden by the surrounding - * application. (Note that max_memory_to_use is only important if - * jpeg_mem_available chooses to consult it ... no one else will.) - * jpeg_mem_term may assume that all requested memory has been freed and that - * all opened backing-store objects have been closed. - */ - -EXTERN(long) jpeg_mem_init JPP((j_common_ptr cinfo)); -EXTERN(void) jpeg_mem_term JPP((j_common_ptr cinfo)); diff --git a/wxWidgets/src/jpeg/jmorecfg.h b/wxWidgets/src/jpeg/jmorecfg.h deleted file mode 100644 index c4a5d33b08..0000000000 --- a/wxWidgets/src/jpeg/jmorecfg.h +++ /dev/null @@ -1,420 +0,0 @@ -/* - * jmorecfg.h - * - * Copyright (C) 1991-1997, Thomas G. Lane. - * This file is part of the Independent JPEG Group's software. - * For conditions of distribution and use, see the accompanying README file. - * - * This file contains additional configuration options that customize the - * JPEG software for special applications or support machine-dependent - * optimizations. Most users will not need to touch this file. - */ - - -/* - * Define BITS_IN_JSAMPLE as either - * 8 for 8-bit sample values (the usual setting) - * 12 for 12-bit sample values - * Only 8 and 12 are legal data precisions for lossy JPEG according to the - * JPEG standard, and the IJG code does not support anything else! - * We do not support run-time selection of data precision, sorry. - */ - -#define BITS_IN_JSAMPLE 8 /* use 8 or 12 */ - - -/* - * Maximum number of components (color channels) allowed in JPEG image. - * To meet the letter of the JPEG spec, set this to 255. However, darn - * few applications need more than 4 channels (maybe 5 for CMYK + alpha - * mask). We recommend 10 as a reasonable compromise; use 4 if you are - * really short on memory. (Each allowed component costs a hundred or so - * bytes of storage, whether actually used in an image or not.) - */ - -#define MAX_COMPONENTS 10 /* maximum number of image components */ - - -/* - * Basic data types. - * You may need to change these if you have a machine with unusual data - * type sizes; for example, "char" not 8 bits, "short" not 16 bits, - * or "long" not 32 bits. We don't care whether "int" is 16 or 32 bits, - * but it had better be at least 16. - */ - -/* Representation of a single sample (pixel element value). - * We frequently allocate large arrays of these, so it's important to keep - * them small. But if you have memory to burn and access to char or short - * arrays is very slow on your hardware, you might want to change these. - */ - -#if BITS_IN_JSAMPLE == 8 -/* JSAMPLE should be the smallest type that will hold the values 0..255. - * You can use a signed char by having GETJSAMPLE mask it with 0xFF. - */ - -#ifdef HAVE_UNSIGNED_CHAR - -typedef unsigned char JSAMPLE; -#define GETJSAMPLE(value) ((int) (value)) - -#else /* not HAVE_UNSIGNED_CHAR */ - -typedef char JSAMPLE; -#ifdef CHAR_IS_UNSIGNED -#define GETJSAMPLE(value) ((int) (value)) -#else -#define GETJSAMPLE(value) ((int) (value) & 0xFF) -#endif /* CHAR_IS_UNSIGNED */ - -#endif /* HAVE_UNSIGNED_CHAR */ - -#define MAXJSAMPLE 255 -#define CENTERJSAMPLE 128 - -#endif /* BITS_IN_JSAMPLE == 8 */ - - -#if BITS_IN_JSAMPLE == 12 -/* JSAMPLE should be the smallest type that will hold the values 0..4095. - * On nearly all machines "short" will do nicely. - */ - -typedef short JSAMPLE; -#define GETJSAMPLE(value) ((int) (value)) - -#define MAXJSAMPLE 4095 -#define CENTERJSAMPLE 2048 - -#endif /* BITS_IN_JSAMPLE == 12 */ - - -/* Representation of a DCT frequency coefficient. - * This should be a signed value of at least 16 bits; "short" is usually OK. - * Again, we allocate large arrays of these, but you can change to int - * if you have memory to burn and "short" is really slow. - */ - -typedef short JCOEF; - - -/* Compressed datastreams are represented as arrays of JOCTET. - * These must be EXACTLY 8 bits wide, at least once they are written to - * external storage. Note that when using the stdio data source/destination - * managers, this is also the data type passed to fread/fwrite. - */ - -#ifdef HAVE_UNSIGNED_CHAR - -typedef unsigned char JOCTET; -#define GETJOCTET(value) (value) - -#else /* not HAVE_UNSIGNED_CHAR */ - -typedef char JOCTET; -#ifdef CHAR_IS_UNSIGNED -#define GETJOCTET(value) (value) -#else -#define GETJOCTET(value) ((value) & 0xFF) -#endif /* CHAR_IS_UNSIGNED */ - -#endif /* HAVE_UNSIGNED_CHAR */ - - -/* These typedefs are used for various table entries and so forth. - * They must be at least as wide as specified; but making them too big - * won't cost a huge amount of memory, so we don't provide special - * extraction code like we did for JSAMPLE. (In other words, these - * typedefs live at a different point on the speed/space tradeoff curve.) - */ - -/* UINT8 must hold at least the values 0..255. */ -#ifndef __WINE_BASETSD_H - -#ifdef HAVE_UNSIGNED_CHAR -typedef unsigned char UINT8; -#else /* not HAVE_UNSIGNED_CHAR */ -#ifdef CHAR_IS_UNSIGNED -typedef char UINT8; -#else /* not CHAR_IS_UNSIGNED */ -typedef short UINT8; -#endif /* CHAR_IS_UNSIGNED */ -#endif /* HAVE_UNSIGNED_CHAR */ - -/* UINT16 must hold at least the values 0..65535. */ - -#ifdef HAVE_UNSIGNED_SHORT -typedef unsigned short UINT16; -#else /* not HAVE_UNSIGNED_SHORT */ -typedef unsigned int UINT16; -#endif /* HAVE_UNSIGNED_SHORT */ - -/* INT16 must hold at least the values -32768..32767. */ - -#ifndef XMD_H /* X11/xmd.h correctly defines INT16 */ -typedef short INT16; -#endif - -#endif /* __WINE_BASETSD_H */ - -/* INT32 must hold at least signed 32-bit values. */ - -/* - VZ: due to the horrible mess resulting in INT32 being defined in windows.h - for some compilers but not for the other ones, I have globally replace - INT32 with JPEG_INT32 in libjpeg code to avoid the eight level ifdef - which used to be here. The problem is that, of course, now we'll have - conflicts when upgrading to the next libjpeg release -- however - considering their frequency (1 in the last 5 years) it seems that - it is not too high a price to pay for the clean compilation with all - versions of mingw32 and cygwin - */ -typedef long JPEG_INT32; - -/* Datatype used for image dimensions. The JPEG standard only supports - * images up to 64K*64K due to 16-bit fields in SOF markers. Therefore - * "unsigned int" is sufficient on all machines. However, if you need to - * handle larger images and you don't mind deviating from the spec, you - * can change this datatype. - */ - -typedef unsigned int JDIMENSION; - -#define JPEG_MAX_DIMENSION 65500L /* a tad under 64K to prevent overflows */ - - -/* These macros are used in all function definitions and extern declarations. - * You could modify them if you need to change function linkage conventions; - * in particular, you'll need to do that to make the library a Windows DLL. - * Another application is to make all functions global for use with debuggers - * or code profilers that require it. - */ - -#if defined(__VISAGECPP__) -#define JPEG_CALLING_CONV _Optlink -#else /* !Visual Age C++ */ -#define JPEG_CALLING_CONV -#endif - -/* We can't declare a static function as extern "C" as we need to do in C++ - * programs, so suppress static in METHODDEF when using C++. - */ -#if defined(__cplusplus) -#define JPEG_METHOD_LINKAGE -#else /* !__cplusplus */ -#define JPEG_METHOD_LINKAGE static -#endif - -/* a function called through method pointers: */ -#define METHODDEF(type) JPEG_METHOD_LINKAGE type JPEG_CALLING_CONV -/* a function used only in its module: */ -#define LOCAL(type) static type JPEG_CALLING_CONV -/* a function referenced thru EXTERNs: */ -#define GLOBAL(type) type -/* a reference to a GLOBAL function: */ -#define EXTERN(type) extern type JPEG_CALLING_CONV - -/* This macro is used to declare a "method", that is, a function pointer. - * We want to supply prototype parameters if the compiler can cope. - * Note that the arglist parameter must be parenthesized! - * Again, you can customize this if you need special linkage keywords. - */ - -#if defined(__VISAGECPP__) /* need this for /common/imagjpeg.obj but not loclly */ -#ifdef HAVE_PROTOTYPES -#define JMETHOD(type,methodname,arglist) type (_Optlink *methodname) arglist -#else -#define JMETHOD(type,methodname,arglist) type (_Optlink *methodname) () -#endif - -#else - -#ifdef HAVE_PROTOTYPES -#define JMETHOD(type,methodname,arglist) type (*methodname) arglist -#else -#define JMETHOD(type,methodname,arglist) type (*methodname) () -#endif - -#endif - -/* Here is the pseudo-keyword for declaring pointers that must be "far" - * on 80x86 machines. Most of the specialized coding for 80x86 is handled - * by just saying "FAR *" where such a pointer is needed. In a few places - * explicit coding is needed; see uses of the NEED_FAR_POINTERS symbol. - */ - -#ifdef NEED_FAR_POINTERS -#define FAR far -#else -#ifndef FAR -#define FAR -#endif -#endif - - -/* - * On a few systems, type boolean and/or its values FALSE, TRUE may appear - * in standard header files. Or you may have conflicts with application- - * specific header files that you want to include together with these files. - * Defining HAVE_BOOLEAN before including jpeglib.h should make it work. - */ - -#if 0 -#ifndef HAVE_BOOLEAN -typedef int boolean; -#endif -#endif - -/* - * Notes about boolean above: - * - * The main conflict we see is with the Windows headers of some compilers that - * have a different definition of boolean. Therefore boolean has been replaced - * with wxjpeg_boolean throughout the jpeg sources. The alternative would have - * been to make the definition here the same as the Windows definition. It's - * not enough to just define HAVE_BOOLEAN when using the jpeg library, the - * definition of boolean must match when the jpeg library is compiled too. - * - * System jepg libs won't have this type, of course, so to use test - * HAVE_WXJPEG_BOOLEAN and fall back to boolean when not defined. - */ - -typedef int wxjpeg_boolean; -#define HAVE_WXJPEG_BOOLEAN - -#ifndef FALSE /* in case these macros already exist */ -#define FALSE 0 /* values of boolean */ -#endif -#ifndef TRUE -#define TRUE 1 -#endif - - -/* - * The remaining options affect code selection within the JPEG library, - * but they don't need to be visible to most applications using the library. - * To minimize application namespace pollution, the symbols won't be - * defined unless JPEG_INTERNALS or JPEG_INTERNAL_OPTIONS has been defined. - */ - -#ifdef JPEG_INTERNALS -#define JPEG_INTERNAL_OPTIONS -#endif - -#ifdef JPEG_INTERNAL_OPTIONS - - -/* - * These defines indicate whether to include various optional functions. - * Undefining some of these symbols will produce a smaller but less capable - * library. Note that you can leave certain source files out of the - * compilation/linking process if you've #undef'd the corresponding symbols. - * (You may HAVE to do that if your compiler doesn't like null source files.) - */ - -/* Arithmetic coding is unsupported for legal reasons. Complaints to IBM. */ - -/* Capability options common to encoder and decoder: */ - -#define DCT_ISLOW_SUPPORTED /* slow but accurate integer algorithm */ -#define DCT_IFAST_SUPPORTED /* faster, less accurate integer method */ -#define DCT_FLOAT_SUPPORTED /* floating-point: accurate, fast on fast HW */ - -/* Encoder capability options: */ - -#undef C_ARITH_CODING_SUPPORTED /* Arithmetic coding back end? */ -#define C_MULTISCAN_FILES_SUPPORTED /* Multiple-scan JPEG files? */ -#define C_PROGRESSIVE_SUPPORTED /* Progressive JPEG? (Requires MULTISCAN)*/ -#define ENTROPY_OPT_SUPPORTED /* Optimization of entropy coding parms? */ -/* Note: if you selected 12-bit data precision, it is dangerous to turn off - * ENTROPY_OPT_SUPPORTED. The standard Huffman tables are only good for 8-bit - * precision, so jchuff.c normally uses entropy optimization to compute - * usable tables for higher precision. If you don't want to do optimization, - * you'll have to supply different default Huffman tables. - * The exact same statements apply for progressive JPEG: the default tables - * don't work for progressive mode. (This may get fixed, however.) - */ -#define INPUT_SMOOTHING_SUPPORTED /* Input image smoothing option? */ - -/* Decoder capability options: */ - -#undef D_ARITH_CODING_SUPPORTED /* Arithmetic coding back end? */ -#define D_MULTISCAN_FILES_SUPPORTED /* Multiple-scan JPEG files? */ -#define D_PROGRESSIVE_SUPPORTED /* Progressive JPEG? (Requires MULTISCAN)*/ -#define SAVE_MARKERS_SUPPORTED /* jpeg_save_markers() needed? */ -#define BLOCK_SMOOTHING_SUPPORTED /* Block smoothing? (Progressive only) */ -#define IDCT_SCALING_SUPPORTED /* Output rescaling via IDCT? */ -#undef UPSAMPLE_SCALING_SUPPORTED /* Output rescaling at upsample stage? */ -#define UPSAMPLE_MERGING_SUPPORTED /* Fast path for sloppy upsampling? */ -#define QUANT_1PASS_SUPPORTED /* 1-pass color quantization? */ -#define QUANT_2PASS_SUPPORTED /* 2-pass color quantization? */ - -/* more capability options later, no doubt */ - - -/* - * Ordering of RGB data in scanlines passed to or from the application. - * If your application wants to deal with data in the order B,G,R, just - * change these macros. You can also deal with formats such as R,G,B,X - * (one extra byte per pixel) by changing RGB_PIXELSIZE. Note that changing - * the offsets will also change the order in which colormap data is organized. - * RESTRICTIONS: - * 1. The sample applications cjpeg,djpeg do NOT support modified RGB formats. - * 2. These macros only affect RGB<=>YCbCr color conversion, so they are not - * useful if you are using JPEG color spaces other than YCbCr or grayscale. - * 3. The color quantizer modules will not behave desirably if RGB_PIXELSIZE - * is not 3 (they don't understand about dummy color components!). So you - * can't use color quantization if you change that value. - */ - -#define RGB_RED 0 /* Offset of Red in an RGB scanline element */ -#define RGB_GREEN 1 /* Offset of Green */ -#define RGB_BLUE 2 /* Offset of Blue */ -#define RGB_PIXELSIZE 3 /* JSAMPLEs per RGB scanline element */ - - -/* Definitions for speed-related optimizations. */ - - -/* If your compiler supports inline functions, define INLINE - * as the inline keyword; otherwise define it as empty. - */ - -#ifndef INLINE -#ifdef __GNUC__ /* for instance, GNU C knows about inline */ -#define INLINE __inline__ -#endif -#ifndef INLINE -#define INLINE /* default is to define it as empty */ -#endif -#endif - - -/* On some machines (notably 68000 series) "int" is 32 bits, but multiplying - * two 16-bit shorts is faster than multiplying two ints. Define MULTIPLIER - * as short on such a machine. MULTIPLIER must be at least 16 bits wide. - */ - -#ifndef MULTIPLIER -#define MULTIPLIER int /* type for fastest integer multiply */ -#endif - - -/* FAST_FLOAT should be either float or double, whichever is done faster - * by your compiler. (Note that this type is only used in the floating point - * DCT routines, so it only matters if you've defined DCT_FLOAT_SUPPORTED.) - * Typically, float is faster in ANSI C compilers, while double is faster in - * pre-ANSI compilers (because they insist on converting to double anyway). - * The code below therefore chooses float if we have ANSI-style prototypes. - */ - -#ifndef FAST_FLOAT -#ifdef HAVE_PROTOTYPES -#define FAST_FLOAT float -#else -#define FAST_FLOAT double -#endif -#endif - -#endif /* JPEG_INTERNAL_OPTIONS */ diff --git a/wxWidgets/src/jpeg/jpeg.dsp b/wxWidgets/src/jpeg/jpeg.dsp deleted file mode 100644 index 6bed87d729..0000000000 --- a/wxWidgets/src/jpeg/jpeg.dsp +++ /dev/null @@ -1,872 +0,0 @@ -# Microsoft Developer Studio Project File - Name="jpeg" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Static Library" 0x0104 - -CFG=jpeg - 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 "JpegVC.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 "JpegVC.mak" CFG="jpeg - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "jpeg - Win32 Release" (based on "Win32 (x86) Static Library") -!MESSAGE "jpeg - Win32 Debug" (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)" == "jpeg - 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 Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /MD /W1 /O1 /Ob2 /I "../include" /D "WIN32" /D "_WINDOWS" /D "__WINDOWS__" /D "__WXMSW__" /D "__WIN95__" /D "__WIN32__" /D WINVER=0x0400 /D "STRICT" /Yu"wx/wxprec.h" /FD /c -# ADD BASE RSC /l 0x809 -# ADD RSC /l 0x809 -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo /out:"..\..\lib\jpeg.lib" - -!ELSEIF "$(CFG)" == "jpeg - 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 Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /Z7 /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /MDd /W1 /Zi /Od /I "../include" /I ".." /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "__WINDOWS__" /D "__WXMSW__" /D DEBUG=1 /D "__WXDEBUG__" /D "__WIN95__" /D "__WIN32__" /D WINVER=0x0400 /D "STRICT" /Yu"wx/wxprec.h" /FD /c -# ADD BASE RSC /l 0x809 -# ADD RSC /l 0x809 -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo /out:"..\..\lib\jpegd.lib" - -!ENDIF - -# Begin Target - -# Name "jpeg - Win32 Release" -# Name "jpeg - Win32 Debug" -# Begin Group "JPEG Files" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\jcapimin.c - -!IF "$(CFG)" == "jpeg - Win32 Release" - -# ADD CPP /I ".." -# SUBTRACT CPP /YX /Yc /Yu - -!ELSEIF "$(CFG)" == "jpeg - Win32 Debug" - -# SUBTRACT CPP /YX /Yc /Yu - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\jcapistd.c - -!IF "$(CFG)" == "jpeg - Win32 Release" - -# ADD CPP /I ".." -# SUBTRACT CPP /YX /Yc /Yu - -!ELSEIF "$(CFG)" == "jpeg - Win32 Debug" - -# SUBTRACT CPP /YX /Yc /Yu - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\jccoefct.c - -!IF "$(CFG)" == "jpeg - Win32 Release" - -# ADD CPP /I ".." -# SUBTRACT CPP /YX /Yc /Yu - -!ELSEIF "$(CFG)" == "jpeg - Win32 Debug" - -# SUBTRACT CPP /YX /Yc /Yu - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\jccolor.c - -!IF "$(CFG)" == "jpeg - Win32 Release" - -# ADD CPP /I ".." -# SUBTRACT CPP /YX /Yc /Yu - -!ELSEIF "$(CFG)" == "jpeg - Win32 Debug" - -# SUBTRACT CPP /YX /Yc /Yu - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\jcdctmgr.c - -!IF "$(CFG)" == "jpeg - Win32 Release" - -# ADD CPP /I ".." -# SUBTRACT CPP /YX /Yc /Yu - -!ELSEIF "$(CFG)" == "jpeg - Win32 Debug" - -# SUBTRACT CPP /YX /Yc /Yu - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\jchuff.c - -!IF "$(CFG)" == "jpeg - Win32 Release" - -# ADD CPP /I ".." -# SUBTRACT CPP /YX /Yc /Yu - -!ELSEIF "$(CFG)" == "jpeg - Win32 Debug" - -# SUBTRACT CPP /YX /Yc /Yu - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\jcinit.c - -!IF "$(CFG)" == "jpeg - Win32 Release" - -# ADD CPP /I ".." -# SUBTRACT CPP /YX /Yc /Yu - -!ELSEIF "$(CFG)" == "jpeg - Win32 Debug" - -# SUBTRACT CPP /YX /Yc /Yu - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\jcmainct.c - -!IF "$(CFG)" == "jpeg - Win32 Release" - -# ADD CPP /I ".." -# SUBTRACT CPP /YX /Yc /Yu - -!ELSEIF "$(CFG)" == "jpeg - Win32 Debug" - -# SUBTRACT CPP /YX /Yc /Yu - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\jcmarker.c - -!IF "$(CFG)" == "jpeg - Win32 Release" - -# ADD CPP /I ".." -# SUBTRACT CPP /YX /Yc /Yu - -!ELSEIF "$(CFG)" == "jpeg - Win32 Debug" - -# SUBTRACT CPP /YX /Yc /Yu - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\jcmaster.c - -!IF "$(CFG)" == "jpeg - Win32 Release" - -# ADD CPP /I ".." -# SUBTRACT CPP /YX /Yc /Yu - -!ELSEIF "$(CFG)" == "jpeg - Win32 Debug" - -# SUBTRACT CPP /YX /Yc /Yu - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\jcomapi.c - -!IF "$(CFG)" == "jpeg - Win32 Release" - -# ADD CPP /I ".." -# SUBTRACT CPP /YX /Yc /Yu - -!ELSEIF "$(CFG)" == "jpeg - Win32 Debug" - -# SUBTRACT CPP /YX /Yc /Yu - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\jcparam.c - -!IF "$(CFG)" == "jpeg - Win32 Release" - -# ADD CPP /I ".." -# SUBTRACT CPP /YX /Yc /Yu - -!ELSEIF "$(CFG)" == "jpeg - Win32 Debug" - -# SUBTRACT CPP /YX /Yc /Yu - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\jcphuff.c - -!IF "$(CFG)" == "jpeg - Win32 Release" - -# ADD CPP /I ".." -# SUBTRACT CPP /YX /Yc /Yu - -!ELSEIF "$(CFG)" == "jpeg - Win32 Debug" - -# SUBTRACT CPP /YX /Yc /Yu - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\jcprepct.c - -!IF "$(CFG)" == "jpeg - Win32 Release" - -# ADD CPP /I ".." -# SUBTRACT CPP /YX /Yc /Yu - -!ELSEIF "$(CFG)" == "jpeg - Win32 Debug" - -# SUBTRACT CPP /YX /Yc /Yu - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\jcsample.c - -!IF "$(CFG)" == "jpeg - Win32 Release" - -# ADD CPP /I ".." -# SUBTRACT CPP /YX /Yc /Yu - -!ELSEIF "$(CFG)" == "jpeg - Win32 Debug" - -# SUBTRACT CPP /YX /Yc /Yu - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\jctrans.c - -!IF "$(CFG)" == "jpeg - Win32 Release" - -# ADD CPP /I ".." -# SUBTRACT CPP /YX /Yc /Yu - -!ELSEIF "$(CFG)" == "jpeg - Win32 Debug" - -# SUBTRACT CPP /YX /Yc /Yu - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\jdapimin.c - -!IF "$(CFG)" == "jpeg - Win32 Release" - -# ADD CPP /I ".." -# SUBTRACT CPP /YX /Yc /Yu - -!ELSEIF "$(CFG)" == "jpeg - Win32 Debug" - -# SUBTRACT CPP /YX /Yc /Yu - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\jdapistd.c - -!IF "$(CFG)" == "jpeg - Win32 Release" - -# ADD CPP /I ".." -# SUBTRACT CPP /YX /Yc /Yu - -!ELSEIF "$(CFG)" == "jpeg - Win32 Debug" - -# SUBTRACT CPP /YX /Yc /Yu - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\jdatadst.c - -!IF "$(CFG)" == "jpeg - Win32 Release" - -# ADD CPP /I ".." -# SUBTRACT CPP /YX /Yc /Yu - -!ELSEIF "$(CFG)" == "jpeg - Win32 Debug" - -# SUBTRACT CPP /YX /Yc /Yu - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\jdatasrc.c - -!IF "$(CFG)" == "jpeg - Win32 Release" - -# ADD CPP /I ".." -# SUBTRACT CPP /YX /Yc /Yu - -!ELSEIF "$(CFG)" == "jpeg - Win32 Debug" - -# SUBTRACT CPP /YX /Yc /Yu - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\jdcoefct.c - -!IF "$(CFG)" == "jpeg - Win32 Release" - -# ADD CPP /I ".." -# SUBTRACT CPP /YX /Yc /Yu - -!ELSEIF "$(CFG)" == "jpeg - Win32 Debug" - -# SUBTRACT CPP /YX /Yc /Yu - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\jdcolor.c - -!IF "$(CFG)" == "jpeg - Win32 Release" - -# ADD CPP /I ".." -# SUBTRACT CPP /YX /Yc /Yu - -!ELSEIF "$(CFG)" == "jpeg - Win32 Debug" - -# SUBTRACT CPP /YX /Yc /Yu - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\jddctmgr.c - -!IF "$(CFG)" == "jpeg - Win32 Release" - -# ADD CPP /I ".." -# SUBTRACT CPP /YX /Yc /Yu - -!ELSEIF "$(CFG)" == "jpeg - Win32 Debug" - -# SUBTRACT CPP /YX /Yc /Yu - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\jdhuff.c - -!IF "$(CFG)" == "jpeg - Win32 Release" - -# ADD CPP /I ".." -# SUBTRACT CPP /YX /Yc /Yu - -!ELSEIF "$(CFG)" == "jpeg - Win32 Debug" - -# SUBTRACT CPP /YX /Yc /Yu - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\jdinput.c - -!IF "$(CFG)" == "jpeg - Win32 Release" - -# ADD CPP /I ".." -# SUBTRACT CPP /YX /Yc /Yu - -!ELSEIF "$(CFG)" == "jpeg - Win32 Debug" - -# SUBTRACT CPP /YX /Yc /Yu - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\jdmainct.c - -!IF "$(CFG)" == "jpeg - Win32 Release" - -# ADD CPP /I ".." -# SUBTRACT CPP /YX /Yc /Yu - -!ELSEIF "$(CFG)" == "jpeg - Win32 Debug" - -# SUBTRACT CPP /YX /Yc /Yu - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\jdmarker.c - -!IF "$(CFG)" == "jpeg - Win32 Release" - -# ADD CPP /I ".." -# SUBTRACT CPP /YX /Yc /Yu - -!ELSEIF "$(CFG)" == "jpeg - Win32 Debug" - -# SUBTRACT CPP /YX /Yc /Yu - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\jdmaster.c - -!IF "$(CFG)" == "jpeg - Win32 Release" - -# ADD CPP /I ".." -# SUBTRACT CPP /YX /Yc /Yu - -!ELSEIF "$(CFG)" == "jpeg - Win32 Debug" - -# SUBTRACT CPP /YX /Yc /Yu - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\jdmerge.c - -!IF "$(CFG)" == "jpeg - Win32 Release" - -# ADD CPP /I ".." -# SUBTRACT CPP /YX /Yc /Yu - -!ELSEIF "$(CFG)" == "jpeg - Win32 Debug" - -# SUBTRACT CPP /YX /Yc /Yu - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\jdphuff.c - -!IF "$(CFG)" == "jpeg - Win32 Release" - -# ADD CPP /I ".." -# SUBTRACT CPP /YX /Yc /Yu - -!ELSEIF "$(CFG)" == "jpeg - Win32 Debug" - -# SUBTRACT CPP /YX /Yc /Yu - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\jdpostct.c - -!IF "$(CFG)" == "jpeg - Win32 Release" - -# ADD CPP /I ".." -# SUBTRACT CPP /YX /Yc /Yu - -!ELSEIF "$(CFG)" == "jpeg - Win32 Debug" - -# SUBTRACT CPP /YX /Yc /Yu - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\jdsample.c - -!IF "$(CFG)" == "jpeg - Win32 Release" - -# ADD CPP /I ".." -# SUBTRACT CPP /YX /Yc /Yu - -!ELSEIF "$(CFG)" == "jpeg - Win32 Debug" - -# SUBTRACT CPP /YX /Yc /Yu - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\jdtrans.c - -!IF "$(CFG)" == "jpeg - Win32 Release" - -# ADD CPP /I ".." -# SUBTRACT CPP /YX /Yc /Yu - -!ELSEIF "$(CFG)" == "jpeg - Win32 Debug" - -# SUBTRACT CPP /YX /Yc /Yu - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\jerror.c - -!IF "$(CFG)" == "jpeg - Win32 Release" - -# ADD CPP /I ".." -# SUBTRACT CPP /YX /Yc /Yu - -!ELSEIF "$(CFG)" == "jpeg - Win32 Debug" - -# SUBTRACT CPP /YX /Yc /Yu - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\jfdctflt.c - -!IF "$(CFG)" == "jpeg - Win32 Release" - -# ADD CPP /I ".." -# SUBTRACT CPP /YX /Yc /Yu - -!ELSEIF "$(CFG)" == "jpeg - Win32 Debug" - -# SUBTRACT CPP /YX /Yc /Yu - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\jfdctfst.c - -!IF "$(CFG)" == "jpeg - Win32 Release" - -# ADD CPP /I ".." -# SUBTRACT CPP /YX /Yc /Yu - -!ELSEIF "$(CFG)" == "jpeg - Win32 Debug" - -# SUBTRACT CPP /YX /Yc /Yu - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\jfdctint.c - -!IF "$(CFG)" == "jpeg - Win32 Release" - -# ADD CPP /I ".." -# SUBTRACT CPP /YX /Yc /Yu - -!ELSEIF "$(CFG)" == "jpeg - Win32 Debug" - -# SUBTRACT CPP /YX /Yc /Yu - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\jidctflt.c - -!IF "$(CFG)" == "jpeg - Win32 Release" - -# ADD CPP /I ".." -# SUBTRACT CPP /YX /Yc /Yu - -!ELSEIF "$(CFG)" == "jpeg - Win32 Debug" - -# SUBTRACT CPP /YX /Yc /Yu - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\jidctfst.c - -!IF "$(CFG)" == "jpeg - Win32 Release" - -# ADD CPP /I ".." -# SUBTRACT CPP /YX /Yc /Yu - -!ELSEIF "$(CFG)" == "jpeg - Win32 Debug" - -# SUBTRACT CPP /YX /Yc /Yu - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\jidctint.c - -!IF "$(CFG)" == "jpeg - Win32 Release" - -# ADD CPP /I ".." -# SUBTRACT CPP /YX /Yc /Yu - -!ELSEIF "$(CFG)" == "jpeg - Win32 Debug" - -# SUBTRACT CPP /YX /Yc /Yu - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\jidctred.c - -!IF "$(CFG)" == "jpeg - Win32 Release" - -# ADD CPP /I ".." -# SUBTRACT CPP /YX /Yc /Yu - -!ELSEIF "$(CFG)" == "jpeg - Win32 Debug" - -# SUBTRACT CPP /YX /Yc /Yu - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\jmemmgr.c - -!IF "$(CFG)" == "jpeg - Win32 Release" - -# ADD CPP /I ".." -# SUBTRACT CPP /YX /Yc /Yu - -!ELSEIF "$(CFG)" == "jpeg - Win32 Debug" - -# SUBTRACT CPP /YX /Yc /Yu - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\jmemnobs.c - -!IF "$(CFG)" == "jpeg - Win32 Release" - -# ADD CPP /I ".." -# SUBTRACT CPP /YX /Yc /Yu - -!ELSEIF "$(CFG)" == "jpeg - Win32 Debug" - -# SUBTRACT CPP /YX /Yc /Yu - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\jquant1.c - -!IF "$(CFG)" == "jpeg - Win32 Release" - -# ADD CPP /I ".." -# SUBTRACT CPP /YX /Yc /Yu - -!ELSEIF "$(CFG)" == "jpeg - Win32 Debug" - -# SUBTRACT CPP /YX /Yc /Yu - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\jquant2.c - -!IF "$(CFG)" == "jpeg - Win32 Release" - -# ADD CPP /I ".." -# SUBTRACT CPP /YX /Yc /Yu - -!ELSEIF "$(CFG)" == "jpeg - Win32 Debug" - -# SUBTRACT CPP /YX /Yc /Yu - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\jutils.c - -!IF "$(CFG)" == "jpeg - Win32 Release" - -# ADD CPP /I ".." -# SUBTRACT CPP /YX /Yc /Yu - -!ELSEIF "$(CFG)" == "jpeg - Win32 Debug" - -# SUBTRACT CPP /YX /Yc /Yu - -!ENDIF - -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h" -# Begin Source File - -SOURCE=.\jchuff.h -# End Source File -# Begin Source File - -SOURCE=.\jconfig.h -# End Source File -# Begin Source File - -SOURCE=.\jdct.h -# End Source File -# Begin Source File - -SOURCE=.\jdhuff.h -# End Source File -# Begin Source File - -SOURCE=.\jerror.h -# End Source File -# Begin Source File - -SOURCE=.\jinclude.h -# End Source File -# Begin Source File - -SOURCE=.\jmemsys.h -# End Source File -# Begin Source File - -SOURCE=.\jmorecfg.h -# End Source File -# Begin Source File - -SOURCE=.\jpegint.h -# End Source File -# Begin Source File - -SOURCE=.\jpeglib.h -# End Source File -# Begin Source File - -SOURCE=.\jversion.h -# End Source File -# End Group -# End Target -# End Project diff --git a/wxWidgets/src/jpeg/jpegM8.xml b/wxWidgets/src/jpeg/jpegM8.xml deleted file mode 100644 index 8800595420..0000000000 --- a/wxWidgets/src/jpeg/jpegM8.xml +++ /dev/null @@ -1,3328 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -]> - - - - - PPC - - - - UserSourceTrees - - - AlwaysSearchUserPathstrue - InterpretDOSAndUnixPathstrue - RequireFrameworkStyleIncludesfalse - UserSearchPaths - - SearchPath - Path: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:::include: - PathFormatMacOS - PathRootProject - - Recursivefalse - FrameworkPathfalse - HostFlagsAll - - - SystemSearchPaths - - SearchPath - PathMSL - PathFormatWindows - PathRootCodeWarrior - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:MacOS Support: - PathFormatMacOS - PathRootCodeWarrior - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - - - MWRuntimeSettings_WorkingDirectory - MWRuntimeSettings_CommandLine - MWRuntimeSettings_HostApplication - Path - PathFormatGeneric - PathRootAbsolute - - MWRuntimeSettings_EnvVars - - - LinkerMacOS PPC Linker - PreLinker - PostLinker - TargetnamePPC - OutputDirectory - Path:::lib: - PathFormatMacOS - PathRootProject - - SaveEntriesUsingRelativePathsfalse - - - FileMappings - - FileTypeAPPL - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypeAppl - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypeMMLB - FileExtension - CompilerLib Import PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeMPLF - FileExtension - CompilerLib Import PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeMWCD - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypeRSRC - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.bh - CompilerBalloon Help - EditLanguageBalloon Help - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.c - CompilerMW C/C++ PPC - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.c++ - CompilerMW C/C++ PPC - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.cc - CompilerMW C/C++ PPC - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.cp - CompilerMW C/C++ PPC - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.cpp - CompilerMW C/C++ PPC - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.exp - Compiler - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.h - CompilerMW C/C++ PPC - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMaketrue - - - FileTypeTEXT - FileExtension.p - CompilerMW Pascal PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.pas - CompilerMW Pascal PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.pch - CompilerMW C/C++ PPC - EditLanguageC/C++ - Precompiletrue - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.pch++ - CompilerMW C/C++ PPC - EditLanguageC/C++ - Precompiletrue - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.ppu - CompilerMW Pascal PPC - EditLanguage - Precompiletrue - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.r - CompilerRez - EditLanguageRez - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.s - CompilerPPCAsm - EditLanguageBalloon Help - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeXCOF - FileExtension - CompilerXCOFF Import PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypedocu - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypersrc - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypeshlb - FileExtension - CompilerPEF Import PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypestub - FileExtension - CompilerPEF Import PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileExtension.doc - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFilefalse - IgnoredByMaketrue - - - FileExtension.o - CompilerXCOFF Import PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileExtension.ppob - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileExtension.rsrc - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - - - CacheModDatestrue - DumpBrowserInfofalse - CacheSubprojectstrue - UseThirdPartyDebuggerfalse - BrowserGenerator1 - DebuggerAppPath - Path - PathFormatGeneric - PathRootAbsolute - - DebuggerCmdLineArgs - DebuggerWorkingDir - Path - PathFormatGeneric - PathRootAbsolute - - CodeCompletionPrefixFileNameMacHeaders.c - CodeCompletionMacroFileNameMacOS_Carbon_C++_Macros.h - - - ConsoleEncoding0 - LogSystemMessagestrue - AutoTargetDLLsfalse - StopAtWatchpointstrue - PauseWhileRunningfalse - PauseInterval5 - PauseUIFlags0 - AltExePath - Path - PathFormatGeneric - PathRootAbsolute - - StopAtTempBPOnLaunchtrue - CacheSymbolicstrue - TempBPFunctionNamemain - TempBPType0 - - - Enabledfalse - ConnectionName - DownloadPath - LaunchRemoteAppfalse - RemoteAppPath - CoreID0 - JTAGClockSpeed8000 - IsMultiCorefalse - OSDownloadfalse - UseGlobalOSDownloadfalse - OSDownloadConnectionName - OSDownloadPath - AltDownloadfalse - AltDownloadConnectionName - - - OtherExecutables - - - CustomColor1 - Red0 - Green32767 - Blue0 - - CustomColor2 - Red0 - Green32767 - Blue0 - - CustomColor3 - Red0 - Green32767 - Blue0 - - CustomColor4 - Red0 - Green32767 - Blue0 - - - - MWFrontEnd_C_cplusplus0 - MWFrontEnd_C_checkprotos0 - MWFrontEnd_C_arm0 - MWFrontEnd_C_trigraphs0 - MWFrontEnd_C_onlystdkeywords0 - MWFrontEnd_C_enumsalwaysint0 - MWFrontEnd_C_mpwpointerstyle0 - MWFrontEnd_C_prefixname - MWFrontEnd_C_ansistrict0 - MWFrontEnd_C_mpwcnewline0 - MWFrontEnd_C_wchar_type1 - MWFrontEnd_C_enableexceptions1 - MWFrontEnd_C_dontreusestrings0 - MWFrontEnd_C_poolstrings0 - MWFrontEnd_C_dontinline0 - MWFrontEnd_C_useRTTI1 - MWFrontEnd_C_multibyteaware0 - MWFrontEnd_C_unsignedchars0 - MWFrontEnd_C_autoinline0 - MWFrontEnd_C_booltruefalse1 - MWFrontEnd_C_inlinelevel0 - MWFrontEnd_C_ecplusplus0 - MWFrontEnd_C_objective_c0 - MWFrontEnd_C_defer_codegen0 - MWFrontEnd_C_templateparser0 - MWFrontEnd_C_c990 - MWFrontEnd_C_bottomupinline1 - - - MWWarning_C_warn_illpragma0 - MWWarning_C_warn_emptydecl0 - MWWarning_C_warn_possunwant0 - MWWarning_C_warn_unusedvar0 - MWWarning_C_warn_unusedarg0 - MWWarning_C_warn_extracomma0 - MWWarning_C_pedantic0 - MWWarning_C_warningerrors0 - MWWarning_C_warn_hidevirtual0 - MWWarning_C_warn_implicitconv0 - MWWarning_C_warn_notinlined0 - MWWarning_C_warn_structclass0 - - - MWMerge_MacOS_projectTypeApplication - MWMerge_MacOS_outputNameMerge Out - MWMerge_MacOS_outputCreator???? - MWMerge_MacOS_outputTypeAPPL - MWMerge_MacOS_suppressWarning0 - MWMerge_MacOS_copyFragments1 - MWMerge_MacOS_copyResources1 - MWMerge_MacOS_flattenResource0 - MWMerge_MacOS_flatFileNamea.rsrc - MWMerge_MacOS_flatFileOutputPath - Path: - PathFormatMacOS - PathRootProject - - MWMerge_MacOS_skipResources - DLGX - ckid - Proj - WSPC - - - - FileLockedfalse - ResourcesMapIsReadOnlyfalse - PrinterDriverIsMultiFinderCompatiblefalse - Invisiblefalse - HasBundlefalse - NameLockedfalse - Stationeryfalse - HasCustomIconfalse - Sharedfalse - HasBeenInitedfalse - Label0 - Comments - - - MWMacOSPackager_UsePackager0 - MWMacOSPackager_FolderToPackage - Path - PathFormatMacOS - PathRootAbsolute - - MWMacOSPackager_CreateClassicAlias0 - MWMacOSPackager_ClassicAliasMethodUseTargetOutput - MWMacOSPackager_ClassicAliasPath - MWMacOSPackager_CreatePkgInfo0 - MWMacOSPackager_PkgCreatorType???? - MWMacOSPackager_PkgFileTypeAPPL - - - MWCodeGen_PPC_structalignmentPPC_mw - MWCodeGen_PPC_tracebacktablesNone - MWCodeGen_PPC_processorGeneric - MWCodeGen_PPC_function_align4 - MWCodeGen_PPC_tocdata1 - MWCodeGen_PPC_largetoc0 - MWCodeGen_PPC_profiler0 - MWCodeGen_PPC_vectortocdata0 - MWCodeGen_PPC_poolconst0 - MWCodeGen_PPC_peephole1 - MWCodeGen_PPC_readonlystrings0 - MWCodeGen_PPC_linkerpoolsstrings0 - MWCodeGen_PPC_volatileasm0 - MWCodeGen_PPC_schedule0 - MWCodeGen_PPC_altivec0 - MWCodeGen_PPC_altivec_move_block0 - MWCodeGen_PPC_strictIEEEfp0 - MWCodeGen_PPC_fpcontract1 - MWCodeGen_PPC_genfsel0 - MWCodeGen_PPC_orderedfpcmp0 - - - MWCodeGen_MachO_structalignmentPPC_mw - MWCodeGen_MachO_profiler_enumOff - MWCodeGen_MachO_processorGeneric - MWCodeGen_MachO_function_align4 - MWCodeGen_MachO_common0 - MWCodeGen_MachO_peephole1 - MWCodeGen_MachO_readonlystrings0 - MWCodeGen_MachO_linkerpoolsstrings1 - MWCodeGen_MachO_volatileasm0 - MWCodeGen_MachO_schedule0 - MWCodeGen_MachO_altivec0 - MWCodeGen_MachO_vecmove0 - MWCodeGen_MachO_fp_ieee_strict0 - MWCodeGen_MachO_fpcontract1 - MWCodeGen_MachO_genfsel0 - MWCodeGen_MachO_fp_cmps_ordered0 - - - MWDisassembler_PPC_showcode1 - MWDisassembler_PPC_extended1 - MWDisassembler_PPC_mix0 - MWDisassembler_PPC_nohex0 - MWDisassembler_PPC_showdata1 - MWDisassembler_PPC_showexceptions1 - MWDisassembler_PPC_showsym0 - MWDisassembler_PPC_shownames1 - - - GlobalOptimizer_PPC_optimizationlevelLevel2 - GlobalOptimizer_PPC_optforSpeed - - - MWLinker_PPC_linksym1 - MWLinker_PPC_symfullpath1 - MWLinker_PPC_linkmap0 - MWLinker_PPC_nolinkwarnings0 - MWLinker_PPC_dontdeadstripinitcode0 - MWLinker_PPC_permitmultdefs0 - MWLinker_PPC_linkmodeFast - MWLinker_PPC_initname - MWLinker_PPC_mainname__start - MWLinker_PPC_termname - - - MWLinker_MacOSX_linksym0 - MWLinker_MacOSX_symfullpath0 - MWLinker_MacOSX_nolinkwarnings0 - MWLinker_MacOSX_linkmap0 - MWLinker_MacOSX_dontdeadstripinitcode0 - MWLinker_MacOSX_permitmultdefs1 - MWLinker_MacOSX_use_objectivec_semantics0 - MWLinker_MacOSX_strip_debug_symbols0 - MWLinker_MacOSX_split_segs0 - MWLinker_MacOSX_report_msl_overloads0 - MWLinker_MacOSX_objects_follow_linkorder0 - MWLinker_MacOSX_linkmodeFast - MWLinker_MacOSX_exportsReferencedGlobals - MWLinker_MacOSX_sortcodeNone - MWLinker_MacOSX_mainnamestart - - - MWProject_MacOSX_typeLibrary - MWProject_MacOSX_outfilejpeg_PPC.lib - MWProject_MacOSX_filecreator???? - MWProject_MacOSX_filetype???? - MWProject_MacOSX_vmaddress0 - MWProject_MacOSX_usedefaultvmaddr1 - MWProject_MacOSX_flatrsrc0 - MWProject_MacOSX_flatrsrcfilename - MWProject_MacOSX_flatrsrcoutputdir - Path: - PathFormatMacOS - PathRootProject - - MWProject_MacOSX_installpath./ - MWProject_MacOSX_dont_prebind0 - MWProject_MacOSX_flat_namespace0 - MWProject_MacOSX_frameworkversionA - MWProject_MacOSX_currentversion0 - MWProject_MacOSX_flat_oldimpversion0 - - - MWLinker_MachO_exportsNone - MWLinker_MachO_mainnamestart - MWLinker_MachO_currentversion0 - MWLinker_MachO_compatibleversion0 - MWLinker_MachO_symfullpath0 - MWLinker_MachO_supresswarnings0 - MWLinker_MachO_multisymerror0 - MWLinker_MachO_prebind1 - MWLinker_MachO_deadstrip1 - MWLinker_MachO_objectivecsemantics0 - MWLinker_MachO_whichfileloaded0 - MWLinker_MachO_whyfileloaded0 - MWLinker_MachO_readonlyrelocsErrors - MWLinker_MachO_undefinedsymbolsErrors - MWLinker_MachO_twolevelnamespace1 - MWLinker_MachO_stripdebugsymbols0 - - - MWProject_MachO_typeExecutable - MWProject_MachO_outfilea.exe - MWProject_MachO_filecreator???? - MWProject_MachO_filetypeMEXE - MWProject_MachO_vmaddress4096 - MWProject_MachO_flatrsrc1 - MWProject_MachO_flatrsrcfilenamea.rsrc - MWProject_MachO_flatrsrcoutputdir - Path: - PathFormatMacOS - PathRootProject - - MWProject_MachO_installpath./ - MWProject_MachO_frameworkversion - - - MWPEF_exportsNone - MWPEF_libfolder0 - MWPEF_sortcodeNone - MWPEF_expandbss0 - MWPEF_sharedata0 - MWPEF_olddefversion0 - MWPEF_oldimpversion0 - MWPEF_currentversion0 - MWPEF_fragmentname - MWPEF_collapsereloads0 - - - MWProject_PPC_typeLibrary - MWProject_PPC_outfilejpeg_PPC.lib - MWProject_PPC_filecreator???? - MWProject_PPC_filetype???? - MWProject_PPC_size0 - MWProject_PPC_minsize0 - MWProject_PPC_stacksize0 - MWProject_PPC_flags0 - MWProject_PPC_symfilename - MWProject_PPC_rsrcname - MWProject_PPC_rsrcheaderNative - MWProject_PPC_rsrctype???? - MWProject_PPC_rsrcid0 - MWProject_PPC_rsrcflags0 - MWProject_PPC_rsrcstore0 - MWProject_PPC_rsrcmerge0 - MWProject_PPC_flatrsrc0 - MWProject_PPC_flatrsrcoutputdir - Path: - PathFormatMacOS - PathRootProject - - MWProject_PPC_flatrsrcfilename - - - MWAssembler_PPC_auxheader0 - MWAssembler_PPC_symmodeMac - MWAssembler_PPC_dialectPPC - MWAssembler_PPC_prefixfile - MWAssembler_PPC_typecheck0 - MWAssembler_PPC_warnings0 - MWAssembler_PPC_casesensitive0 - - - PList_OutputTypeFile - PList_OutputEncodingUTF-8 - PList_Prefix - PList_FileFilenameInfo.plist - PList_FileDirectory - Path: - PathFormatMacOS - PathRootProject - - PList_ResourceTypeplst - PList_ResourceID0 - PList_ResourceName - - - MWRez_Language_maxwidth80 - MWRez_Language_scriptRoman - MWRez_Language_alignmentAlign1 - MWRez_Language_filtermodeFilterSkip - MWRez_Language_suppresswarnings0 - MWRez_Language_escapecontrolchars1 - MWRez_Language_prefixname - MWRez_Language_filteredtypes'CODE' 'DATA' 'PICT' - - - MWCodeGen_X86_processorGeneric - MWCodeGen_X86_alignmentbytes8 - MWCodeGen_X86_exceptionsZeroOverhead - MWCodeGen_X86_name_manglingMWWin32 - MWCodeGen_X86_use_extinst0 - MWCodeGen_X86_extinst_mmx0 - MWCodeGen_X86_extinst_3dnow0 - MWCodeGen_X86_use_mmx_3dnow_convention0 - MWCodeGen_X86_extinst_cmov0 - MWCodeGen_X86_extinst_sse0 - MWCodeGen_X86_extinst_sse20 - MWCodeGen_X86_intrinsics0 - MWCodeGen_X86_optimizeasm0 - MWCodeGen_X86_disableopts0 - MWCodeGen_X86_profile0 - MWLinker_X86_runtimeCustom - MWCodeGen_X86_readonlystrings0 - - - MWLinker_X86_subsysmajorid4 - MWLinker_X86_subsysminorid0 - MWCOFF_X86_opsysmajorid4 - MWCOFF_X86_opsysminorid0 - MWLinker_X86_usrmajorid0 - MWLinker_X86_usrminorid0 - MWProject_X86_maxstacksize1024 - MWProject_X86_minstacksize4 - MWProject_X86_size1024 - MWProject_X86_minsize4 - MWCOFF_X86_coff_flags0 - MWCOFF_X86_dll_flags0 - MWProject_X86_baseaddress4194304 - MWCOFF_X86_filealign512 - MWCOFF_X86_sectionalign4096 - - - MWLinker_X86_entrypointusageDefault - MWLinker_X86_entrypoint - MWLinker_X86_subsystemWinGUI - MWLinker_X86_commandfile - MWLinker_X86_generatemap0 - MWLinker_X86_linksym0 - MWLinker_X86_linkCV1 - MWLinker_X86_symfullpathfalse - MWLinker_X86_linkdebugtrue - MWLinker_X86_checksumfalse - MWLinker_X86_zero_init_bssfalse - MWLinker_X86_mergedatafalse - MWLinker_X86_usedefaultlibsfalse - MWLinker_X86_adddefaultlibsfalse - MWLinker_X86_nowarningsfalse - MWLinker_X86_verbosefalse - - - MWProject_X86_typeApplication - MWProject_X86_outfileNONAME.EXE - MWProject_X86_importlib - MWProject_X86_setimportlibdirfalse - MWProject_X86_dontgenerateimportlibfalse - MWProject_X86_oldformatlibfalse - MWProject_X86_replaceobjextensionfalse - MWProject_X86_copyallfilesfalse - - - - Name - jcapimin.c - MacOS - Text - - - - Name - jcapistd.c - MacOS - Text - - - - Name - jccoefct.c - MacOS - Text - - - - Name - jccolor.c - MacOS - Text - - - - Name - jcdctmgr.c - MacOS - Text - - - - Name - jchuff.c - MacOS - Text - - - - Name - jcinit.c - MacOS - Text - - - - Name - jcmainct.c - MacOS - Text - - - - Name - jcmarker.c - MacOS - Text - - - - Name - jcmaster.c - MacOS - Text - - - - Name - jcomapi.c - MacOS - Text - - - - Name - jcparam.c - MacOS - Text - - - - Name - jcphuff.c - MacOS - Text - - - - Name - jcprepct.c - MacOS - Text - - - - Name - jcsample.c - MacOS - Text - - - - Name - jctrans.c - MacOS - Text - - - - Name - jdapimin.c - MacOS - Text - - - - Name - jdapistd.c - MacOS - Text - - - - Name - jdatadst.c - MacOS - Text - - - - Name - jdatasrc.c - MacOS - Text - - - - Name - jdcoefct.c - MacOS - Text - - - - Name - jdcolor.c - MacOS - Text - - - - Name - jddctmgr.c - MacOS - Text - - - - Name - jdhuff.c - MacOS - Text - - - - Name - jdinput.c - MacOS - Text - - - - Name - jdmainct.c - MacOS - Text - - - - Name - jdmarker.c - MacOS - Text - - - - Name - jdmaster.c - MacOS - Text - - - - Name - jdmerge.c - MacOS - Text - - - - Name - jdphuff.c - MacOS - Text - - - - Name - jdpostct.c - MacOS - Text - - - - Name - jdsample.c - MacOS - Text - - - - Name - jdtrans.c - MacOS - Text - - - - Name - jerror.c - MacOS - Text - - - - Name - jfdctflt.c - MacOS - Text - - - - Name - jfdctint.c - MacOS - Text - - - - Name - jfdctfst.c - MacOS - Text - - - - Name - jidctflt.c - MacOS - Text - - - - Name - jidctfst.c - MacOS - Text - - - - Name - jidctint.c - MacOS - Text - - - - Name - jidctred.c - MacOS - Text - - - - Name - jmemmgr.c - MacOS - Text - - - - Name - jquant1.c - MacOS - Text - - - - Name - jquant2.c - MacOS - Text - - - - Name - jutils.c - MacOS - Text - - - - Name - jmemmac.c - MacOS - Text - - - - - - Name - jcapimin.c - MacOS - - - Name - jcapistd.c - MacOS - - - Name - jccoefct.c - MacOS - - - Name - jccolor.c - MacOS - - - Name - jcdctmgr.c - MacOS - - - Name - jchuff.c - MacOS - - - Name - jcinit.c - MacOS - - - Name - jcmainct.c - MacOS - - - Name - jcmarker.c - MacOS - - - Name - jcmaster.c - MacOS - - - Name - jcomapi.c - MacOS - - - Name - jcparam.c - MacOS - - - Name - jcphuff.c - MacOS - - - Name - jcprepct.c - MacOS - - - Name - jcsample.c - MacOS - - - Name - jctrans.c - MacOS - - - Name - jdapimin.c - MacOS - - - Name - jdapistd.c - MacOS - - - Name - jdatadst.c - MacOS - - - Name - jdatasrc.c - MacOS - - - Name - jdcoefct.c - MacOS - - - Name - jdcolor.c - MacOS - - - Name - jddctmgr.c - MacOS - - - Name - jdhuff.c - MacOS - - - Name - jdinput.c - MacOS - - - Name - jdmainct.c - MacOS - - - Name - jdmarker.c - MacOS - - - Name - jdmaster.c - MacOS - - - Name - jdmerge.c - MacOS - - - Name - jdphuff.c - MacOS - - - Name - jdpostct.c - MacOS - - - Name - jdsample.c - MacOS - - - Name - jdtrans.c - MacOS - - - Name - jerror.c - MacOS - - - Name - jfdctflt.c - MacOS - - - Name - jfdctint.c - MacOS - - - Name - jfdctfst.c - MacOS - - - Name - jidctflt.c - MacOS - - - Name - jidctfst.c - MacOS - - - Name - jidctint.c - MacOS - - - Name - jidctred.c - MacOS - - - Name - jmemmgr.c - MacOS - - - Name - jquant1.c - MacOS - - - Name - jquant2.c - MacOS - - - Name - jutils.c - MacOS - - - Name - jmemmac.c - MacOS - - - - - Mach-O - - - - UserSourceTrees - - - AlwaysSearchUserPathstrue - InterpretDOSAndUnixPathstrue - RequireFrameworkStyleIncludesfalse - UserSearchPaths - - SearchPath - Path: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:::include: - PathFormatMacOS - PathRootProject - - Recursivefalse - FrameworkPathfalse - HostFlagsAll - - - SystemSearchPaths - - SearchPath - PathMacOS X Support/Headers/(wchar_t Support fix) - PathFormatUnix - PathRootCodeWarrior - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Pathusr/include - PathFormatUnix - PathRootOS X Volume - - Recursivefalse - FrameworkPathfalse - HostFlagsAll - - - SearchPath - PathMSL/MSL_C - PathFormatUnix - PathRootCodeWarrior - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - PathMSL/MSL_C++ - PathFormatUnix - PathRootCodeWarrior - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - PathMacOS X Support - PathFormatUnix - PathRootCodeWarrior - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Pathusr/lib - PathFormatUnix - PathRootOS X Volume - - Recursivefalse - FrameworkPathfalse - HostFlagsAll - - - SearchPath - PathSystem/Library/Frameworks - PathFormatUnix - PathRootOS X Volume - - Recursivefalse - FrameworkPathtrue - HostFlagsAll - - - - - MWRuntimeSettings_WorkingDirectory - MWRuntimeSettings_CommandLine - MWRuntimeSettings_HostApplication - Path - PathFormatGeneric - PathRootAbsolute - - MWRuntimeSettings_EnvVars - - - LinkerMacOS X PPC Linker - PreLinker - PostLinker - TargetnameMach-O - OutputDirectory - Path:::lib: - PathFormatMacOS - PathRootProject - - SaveEntriesUsingRelativePathsfalse - - - FileMappings - - FileTypeAPPL - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypeAppl - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypeMDYL - FileExtension - CompilerMachO Importer - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeMLIB - FileExtension - CompilerMachO Importer - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeMMLB - FileExtension - CompilerMachO Importer - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeMPLF - FileExtension - CompilerMachO Importer - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeMWCD - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypeRSRC - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.arr - Compiler - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.axp - Compiler - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.c - CompilerMW C/C++ PPC Mac OS X - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.c++ - CompilerMW C/C++ PPC Mac OS X - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.cc - CompilerMW C/C++ PPC Mac OS X - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.cp - CompilerMW C/C++ PPC Mac OS X - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.cpp - CompilerMW C/C++ PPC Mac OS X - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.exp - Compiler - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.h - CompilerMW C/C++ PPC Mac OS X - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMaketrue - - - FileTypeTEXT - FileExtension.h++ - CompilerMW C/C++ PPC Mac OS X - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMaketrue - - - FileTypeTEXT - FileExtension.hpp - CompilerMW C/C++ PPC Mac OS X - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMaketrue - - - FileTypeTEXT - FileExtension.lcf - Compiler - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.m - CompilerMW C/C++ PPC Mac OS X - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.mm - CompilerMW C/C++ PPC Mac OS X - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.pch - CompilerMW C/C++ PPC Mac OS X - EditLanguageC/C++ - Precompiletrue - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.pch++ - CompilerMW C/C++ PPC Mac OS X - EditLanguageC/C++ - Precompiletrue - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.pchm - CompilerMW C/C++ PPC Mac OS X - EditLanguageC/C++ - Precompiletrue - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.pchmm - CompilerMW C/C++ PPC Mac OS X - EditLanguageC/C++ - Precompiletrue - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.plc - CompilerProperty List Compiler - EditLanguageProperty List - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.ploc - CompilerProperty List Compiler - EditLanguageProperty List - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.r - CompilerRez - EditLanguageRez - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.wke - Compiler - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypedocu - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypersrc - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileExtension.a - CompilerMachO Importer - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileExtension.doc - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFilefalse - IgnoredByMaketrue - - - FileExtension.dylib - CompilerMachO Importer - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileExtension.gif - CompilerCopy To Package - EditLanguage - Precompilefalse - Launchabletrue - ResourceFilefalse - IgnoredByMaketrue - - - FileExtension.icns - CompilerCopy To Package - EditLanguage - Precompilefalse - Launchabletrue - ResourceFilefalse - IgnoredByMaketrue - - - FileExtension.jpg - CompilerCopy To Package - EditLanguage - Precompilefalse - Launchabletrue - ResourceFilefalse - IgnoredByMaketrue - - - FileExtension.lib - CompilerMachO Importer - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileExtension.nib - CompilerCopy To Package - EditLanguage - Precompilefalse - Launchabletrue - ResourceFilefalse - IgnoredByMaketrue - - - FileExtension.pl - CompilerPerl Tool - EditLanguagePerl - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileExtension.plist - CompilerCopy To Package - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMaketrue - - - FileExtension.ppob - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileExtension.psh - CompilerShell Tool - EditLanguage - Precompiletrue - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileExtension.rsrc - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileExtension.sh - CompilerShell Tool - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileExtension.strings - CompilerCopy To Package - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMaketrue - - - FileExtension.tiff - CompilerCopy To Package - EditLanguage - Precompilefalse - Launchabletrue - ResourceFilefalse - IgnoredByMaketrue - - - - - CacheModDatestrue - DumpBrowserInfofalse - CacheSubprojectstrue - UseThirdPartyDebuggerfalse - BrowserGenerator1 - DebuggerAppPath - Path - PathFormatGeneric - PathRootAbsolute - - DebuggerCmdLineArgs - DebuggerWorkingDir - Path - PathFormatGeneric - PathRootAbsolute - - CodeCompletionPrefixFileNameMacHeaders.c - CodeCompletionMacroFileNameMacOS_Carbon_C++_Macros.h - - - ConsoleEncoding0 - LogSystemMessagestrue - AutoTargetDLLsfalse - StopAtWatchpointstrue - PauseWhileRunningfalse - PauseInterval5 - PauseUIFlags0 - AltExePath - Path - PathFormatGeneric - PathRootAbsolute - - StopAtTempBPOnLaunchtrue - CacheSymbolicstrue - TempBPFunctionNamemain - TempBPType0 - - - Enabledfalse - ConnectionName - DownloadPath - LaunchRemoteAppfalse - RemoteAppPath - CoreID0 - JTAGClockSpeed8000 - IsMultiCorefalse - OSDownloadfalse - UseGlobalOSDownloadfalse - OSDownloadConnectionName - OSDownloadPath - AltDownloadfalse - AltDownloadConnectionName - - - OtherExecutables - - - CustomColor1 - Red0 - Green32767 - Blue0 - - CustomColor2 - Red0 - Green32767 - Blue0 - - CustomColor3 - Red0 - Green32767 - Blue0 - - CustomColor4 - Red0 - Green32767 - Blue0 - - - - MWFrontEnd_C_cplusplus0 - MWFrontEnd_C_checkprotos0 - MWFrontEnd_C_arm0 - MWFrontEnd_C_trigraphs0 - MWFrontEnd_C_onlystdkeywords0 - MWFrontEnd_C_enumsalwaysint0 - MWFrontEnd_C_mpwpointerstyle0 - MWFrontEnd_C_prefixname - MWFrontEnd_C_ansistrict0 - MWFrontEnd_C_mpwcnewline0 - MWFrontEnd_C_wchar_type1 - MWFrontEnd_C_enableexceptions1 - MWFrontEnd_C_dontreusestrings0 - MWFrontEnd_C_poolstrings0 - MWFrontEnd_C_dontinline0 - MWFrontEnd_C_useRTTI1 - MWFrontEnd_C_multibyteaware0 - MWFrontEnd_C_unsignedchars0 - MWFrontEnd_C_autoinline0 - MWFrontEnd_C_booltruefalse1 - MWFrontEnd_C_inlinelevel0 - MWFrontEnd_C_ecplusplus0 - MWFrontEnd_C_objective_c0 - MWFrontEnd_C_defer_codegen0 - MWFrontEnd_C_templateparser0 - MWFrontEnd_C_c990 - MWFrontEnd_C_bottomupinline1 - - - MWWarning_C_warn_illpragma0 - MWWarning_C_warn_emptydecl0 - MWWarning_C_warn_possunwant0 - MWWarning_C_warn_unusedvar0 - MWWarning_C_warn_unusedarg0 - MWWarning_C_warn_extracomma0 - MWWarning_C_pedantic0 - MWWarning_C_warningerrors0 - MWWarning_C_warn_hidevirtual0 - MWWarning_C_warn_implicitconv0 - MWWarning_C_warn_notinlined0 - MWWarning_C_warn_structclass0 - - - MWMerge_MacOS_projectTypeApplication - MWMerge_MacOS_outputNameMerge Out - MWMerge_MacOS_outputCreator???? - MWMerge_MacOS_outputTypeAPPL - MWMerge_MacOS_suppressWarning0 - MWMerge_MacOS_copyFragments1 - MWMerge_MacOS_copyResources1 - MWMerge_MacOS_flattenResource0 - MWMerge_MacOS_flatFileNamea.rsrc - MWMerge_MacOS_flatFileOutputPath - Path: - PathFormatMacOS - PathRootProject - - MWMerge_MacOS_skipResources - DLGX - ckid - Proj - WSPC - - - - FileLockedfalse - ResourcesMapIsReadOnlyfalse - PrinterDriverIsMultiFinderCompatiblefalse - Invisiblefalse - HasBundlefalse - NameLockedfalse - Stationeryfalse - HasCustomIconfalse - Sharedfalse - HasBeenInitedfalse - Label0 - Comments - - - MWMacOSPackager_UsePackager0 - MWMacOSPackager_FolderToPackage - Path - PathFormatMacOS - PathRootAbsolute - - MWMacOSPackager_CreateClassicAlias0 - MWMacOSPackager_ClassicAliasMethodUseTargetOutput - MWMacOSPackager_ClassicAliasPath - MWMacOSPackager_CreatePkgInfo0 - MWMacOSPackager_PkgCreatorType???? - MWMacOSPackager_PkgFileTypeAPPL - - - MWCodeGen_PPC_structalignmentPPC_mw - MWCodeGen_PPC_tracebacktablesNone - MWCodeGen_PPC_processorGeneric - MWCodeGen_PPC_function_align4 - MWCodeGen_PPC_tocdata1 - MWCodeGen_PPC_largetoc0 - MWCodeGen_PPC_profiler0 - MWCodeGen_PPC_vectortocdata0 - MWCodeGen_PPC_poolconst0 - MWCodeGen_PPC_peephole1 - MWCodeGen_PPC_readonlystrings0 - MWCodeGen_PPC_linkerpoolsstrings0 - MWCodeGen_PPC_volatileasm0 - MWCodeGen_PPC_schedule0 - MWCodeGen_PPC_altivec0 - MWCodeGen_PPC_altivec_move_block0 - MWCodeGen_PPC_strictIEEEfp0 - MWCodeGen_PPC_fpcontract1 - MWCodeGen_PPC_genfsel0 - MWCodeGen_PPC_orderedfpcmp0 - - - MWCodeGen_MachO_structalignmentPPC_mw - MWCodeGen_MachO_profiler_enumOff - MWCodeGen_MachO_processorGeneric - MWCodeGen_MachO_function_align4 - MWCodeGen_MachO_common0 - MWCodeGen_MachO_peephole1 - MWCodeGen_MachO_readonlystrings0 - MWCodeGen_MachO_linkerpoolsstrings1 - MWCodeGen_MachO_volatileasm0 - MWCodeGen_MachO_schedule0 - MWCodeGen_MachO_altivec0 - MWCodeGen_MachO_vecmove0 - MWCodeGen_MachO_fp_ieee_strict0 - MWCodeGen_MachO_fpcontract1 - MWCodeGen_MachO_genfsel0 - MWCodeGen_MachO_fp_cmps_ordered0 - - - MWDisassembler_PPC_showcode1 - MWDisassembler_PPC_extended1 - MWDisassembler_PPC_mix0 - MWDisassembler_PPC_nohex0 - MWDisassembler_PPC_showdata1 - MWDisassembler_PPC_showexceptions1 - MWDisassembler_PPC_showsym0 - MWDisassembler_PPC_shownames1 - - - GlobalOptimizer_PPC_optimizationlevelLevel2 - GlobalOptimizer_PPC_optforSpeed - - - MWLinker_PPC_linksym1 - MWLinker_PPC_symfullpath1 - MWLinker_PPC_linkmap0 - MWLinker_PPC_nolinkwarnings0 - MWLinker_PPC_dontdeadstripinitcode0 - MWLinker_PPC_permitmultdefs0 - MWLinker_PPC_linkmodeFast - MWLinker_PPC_initname - MWLinker_PPC_mainname__start - MWLinker_PPC_termname - - - MWLinker_MacOSX_linksym0 - MWLinker_MacOSX_symfullpath0 - MWLinker_MacOSX_nolinkwarnings0 - MWLinker_MacOSX_linkmap0 - MWLinker_MacOSX_dontdeadstripinitcode0 - MWLinker_MacOSX_permitmultdefs1 - MWLinker_MacOSX_use_objectivec_semantics0 - MWLinker_MacOSX_strip_debug_symbols0 - MWLinker_MacOSX_split_segs0 - MWLinker_MacOSX_report_msl_overloads0 - MWLinker_MacOSX_objects_follow_linkorder0 - MWLinker_MacOSX_linkmodeFast - MWLinker_MacOSX_exportsReferencedGlobals - MWLinker_MacOSX_sortcodeNone - MWLinker_MacOSX_mainnamestart - - - MWProject_MacOSX_typeLibrary - MWProject_MacOSX_outfilejpeg_MACH.lib - MWProject_MacOSX_filecreator???? - MWProject_MacOSX_filetype???? - MWProject_MacOSX_vmaddress0 - MWProject_MacOSX_usedefaultvmaddr1 - MWProject_MacOSX_flatrsrc0 - MWProject_MacOSX_flatrsrcfilename - MWProject_MacOSX_flatrsrcoutputdir - Path: - PathFormatMacOS - PathRootProject - - MWProject_MacOSX_installpath./ - MWProject_MacOSX_dont_prebind0 - MWProject_MacOSX_flat_namespace0 - MWProject_MacOSX_frameworkversionA - MWProject_MacOSX_currentversion0 - MWProject_MacOSX_flat_oldimpversion0 - - - MWLinker_MachO_exportsNone - MWLinker_MachO_mainnamestart - MWLinker_MachO_currentversion0 - MWLinker_MachO_compatibleversion0 - MWLinker_MachO_symfullpath0 - MWLinker_MachO_supresswarnings0 - MWLinker_MachO_multisymerror0 - MWLinker_MachO_prebind1 - MWLinker_MachO_deadstrip1 - MWLinker_MachO_objectivecsemantics0 - MWLinker_MachO_whichfileloaded0 - MWLinker_MachO_whyfileloaded0 - MWLinker_MachO_readonlyrelocsErrors - MWLinker_MachO_undefinedsymbolsErrors - MWLinker_MachO_twolevelnamespace1 - MWLinker_MachO_stripdebugsymbols0 - - - MWProject_MachO_typeExecutable - MWProject_MachO_outfilea.exe - MWProject_MachO_filecreator???? - MWProject_MachO_filetypeMEXE - MWProject_MachO_vmaddress4096 - MWProject_MachO_flatrsrc1 - MWProject_MachO_flatrsrcfilenamea.rsrc - MWProject_MachO_flatrsrcoutputdir - Path: - PathFormatMacOS - PathRootProject - - MWProject_MachO_installpath./ - MWProject_MachO_frameworkversion - - - MWPEF_exportsNone - MWPEF_libfolder0 - MWPEF_sortcodeNone - MWPEF_expandbss0 - MWPEF_sharedata0 - MWPEF_olddefversion0 - MWPEF_oldimpversion0 - MWPEF_currentversion0 - MWPEF_fragmentname - MWPEF_collapsereloads0 - - - MWProject_PPC_typeLibrary - MWProject_PPC_outfilejpeg_PPC.lib - MWProject_PPC_filecreator???? - MWProject_PPC_filetype???? - MWProject_PPC_size0 - MWProject_PPC_minsize0 - MWProject_PPC_stacksize0 - MWProject_PPC_flags0 - MWProject_PPC_symfilename - MWProject_PPC_rsrcname - MWProject_PPC_rsrcheaderNative - MWProject_PPC_rsrctype???? - MWProject_PPC_rsrcid0 - MWProject_PPC_rsrcflags0 - MWProject_PPC_rsrcstore0 - MWProject_PPC_rsrcmerge0 - MWProject_PPC_flatrsrc0 - MWProject_PPC_flatrsrcoutputdir - Path: - PathFormatMacOS - PathRootProject - - MWProject_PPC_flatrsrcfilename - - - MWAssembler_PPC_auxheader0 - MWAssembler_PPC_symmodeMac - MWAssembler_PPC_dialectPPC - MWAssembler_PPC_prefixfile - MWAssembler_PPC_typecheck0 - MWAssembler_PPC_warnings0 - MWAssembler_PPC_casesensitive0 - - - PList_OutputTypeFile - PList_OutputEncodingUTF-8 - PList_Prefix - PList_FileFilenameInfo.plist - PList_FileDirectory - Path: - PathFormatMacOS - PathRootProject - - PList_ResourceTypeplst - PList_ResourceID0 - PList_ResourceName - - - MWRez_Language_maxwidth80 - MWRez_Language_scriptRoman - MWRez_Language_alignmentAlign1 - MWRez_Language_filtermodeFilterSkip - MWRez_Language_suppresswarnings0 - MWRez_Language_escapecontrolchars1 - MWRez_Language_prefixname - MWRez_Language_filteredtypes'CODE' 'DATA' 'PICT' - - - MWCodeGen_X86_processorGeneric - MWCodeGen_X86_alignmentbytes8 - MWCodeGen_X86_exceptionsZeroOverhead - MWCodeGen_X86_name_manglingMWWin32 - MWCodeGen_X86_use_extinst0 - MWCodeGen_X86_extinst_mmx0 - MWCodeGen_X86_extinst_3dnow0 - MWCodeGen_X86_use_mmx_3dnow_convention0 - MWCodeGen_X86_extinst_cmov0 - MWCodeGen_X86_extinst_sse0 - MWCodeGen_X86_extinst_sse20 - MWCodeGen_X86_intrinsics0 - MWCodeGen_X86_optimizeasm0 - MWCodeGen_X86_disableopts0 - MWCodeGen_X86_profile0 - MWLinker_X86_runtimeCustom - MWCodeGen_X86_readonlystrings0 - - - MWLinker_X86_subsysmajorid4 - MWLinker_X86_subsysminorid0 - MWCOFF_X86_opsysmajorid4 - MWCOFF_X86_opsysminorid0 - MWLinker_X86_usrmajorid0 - MWLinker_X86_usrminorid0 - MWProject_X86_maxstacksize1024 - MWProject_X86_minstacksize4 - MWProject_X86_size1024 - MWProject_X86_minsize4 - MWCOFF_X86_coff_flags0 - MWCOFF_X86_dll_flags0 - MWProject_X86_baseaddress4194304 - MWCOFF_X86_filealign512 - MWCOFF_X86_sectionalign4096 - - - MWLinker_X86_entrypointusageDefault - MWLinker_X86_entrypoint - MWLinker_X86_subsystemWinGUI - MWLinker_X86_commandfile - MWLinker_X86_generatemap0 - MWLinker_X86_linksym0 - MWLinker_X86_linkCV1 - MWLinker_X86_symfullpathfalse - MWLinker_X86_linkdebugtrue - MWLinker_X86_checksumfalse - MWLinker_X86_zero_init_bssfalse - MWLinker_X86_mergedatafalse - MWLinker_X86_usedefaultlibsfalse - MWLinker_X86_adddefaultlibsfalse - MWLinker_X86_nowarningsfalse - MWLinker_X86_verbosefalse - - - MWProject_X86_typeApplication - MWProject_X86_outfileNONAME.EXE - MWProject_X86_importlib - MWProject_X86_setimportlibdirfalse - MWProject_X86_dontgenerateimportlibfalse - MWProject_X86_oldformatlibfalse - MWProject_X86_replaceobjextensionfalse - MWProject_X86_copyallfilesfalse - - - - Name - jcapimin.c - MacOS - Text - - - - Name - jcapistd.c - MacOS - Text - - - - Name - jccoefct.c - MacOS - Text - - - - Name - jccolor.c - MacOS - Text - - - - Name - jcdctmgr.c - MacOS - Text - - - - Name - jchuff.c - MacOS - Text - - - - Name - jcinit.c - MacOS - Text - - - - Name - jcmainct.c - MacOS - Text - - - - Name - jcmarker.c - MacOS - Text - - - - Name - jcmaster.c - MacOS - Text - - - - Name - jcomapi.c - MacOS - Text - - - - Name - jcparam.c - MacOS - Text - - - - Name - jcphuff.c - MacOS - Text - - - - Name - jcprepct.c - MacOS - Text - - - - Name - jcsample.c - MacOS - Text - - - - Name - jctrans.c - MacOS - Text - - - - Name - jdapimin.c - MacOS - Text - - - - Name - jdapistd.c - MacOS - Text - - - - Name - jdatadst.c - MacOS - Text - - - - Name - jdatasrc.c - MacOS - Text - - - - Name - jdcoefct.c - MacOS - Text - - - - Name - jdcolor.c - MacOS - Text - - - - Name - jddctmgr.c - MacOS - Text - - - - Name - jdhuff.c - MacOS - Text - - - - Name - jdinput.c - MacOS - Text - - - - Name - jdmainct.c - MacOS - Text - - - - Name - jdmarker.c - MacOS - Text - - - - Name - jdmaster.c - MacOS - Text - - - - Name - jdmerge.c - MacOS - Text - - - - Name - jdphuff.c - MacOS - Text - - - - Name - jdpostct.c - MacOS - Text - - - - Name - jdsample.c - MacOS - Text - - - - Name - jdtrans.c - MacOS - Text - - - - Name - jerror.c - MacOS - Text - - - - Name - jfdctflt.c - MacOS - Text - - - - Name - jfdctint.c - MacOS - Text - - - - Name - jfdctfst.c - MacOS - Text - - - - Name - jidctflt.c - MacOS - Text - - - - Name - jidctfst.c - MacOS - Text - - - - Name - jidctint.c - MacOS - Text - - - - Name - jidctred.c - MacOS - Text - - - - Name - jmemmgr.c - MacOS - Text - - - - Name - jquant1.c - MacOS - Text - - - - Name - jquant2.c - MacOS - Text - - - - Name - jutils.c - MacOS - Text - - - - Name - jmemmac.c - MacOS - Text - - - - - - Name - jcapimin.c - MacOS - - - Name - jcapistd.c - MacOS - - - Name - jccoefct.c - MacOS - - - Name - jccolor.c - MacOS - - - Name - jcdctmgr.c - MacOS - - - Name - jchuff.c - MacOS - - - Name - jcinit.c - MacOS - - - Name - jcmainct.c - MacOS - - - Name - jcmarker.c - MacOS - - - Name - jcmaster.c - MacOS - - - Name - jcomapi.c - MacOS - - - Name - jcparam.c - MacOS - - - Name - jcphuff.c - MacOS - - - Name - jcprepct.c - MacOS - - - Name - jcsample.c - MacOS - - - Name - jctrans.c - MacOS - - - Name - jdapimin.c - MacOS - - - Name - jdapistd.c - MacOS - - - Name - jdatadst.c - MacOS - - - Name - jdatasrc.c - MacOS - - - Name - jdcoefct.c - MacOS - - - Name - jdcolor.c - MacOS - - - Name - jddctmgr.c - MacOS - - - Name - jdhuff.c - MacOS - - - Name - jdinput.c - MacOS - - - Name - jdmainct.c - MacOS - - - Name - jdmarker.c - MacOS - - - Name - jdmaster.c - MacOS - - - Name - jdmerge.c - MacOS - - - Name - jdphuff.c - MacOS - - - Name - jdpostct.c - MacOS - - - Name - jdsample.c - MacOS - - - Name - jdtrans.c - MacOS - - - Name - jerror.c - MacOS - - - Name - jfdctflt.c - MacOS - - - Name - jfdctint.c - MacOS - - - Name - jfdctfst.c - MacOS - - - Name - jidctflt.c - MacOS - - - Name - jidctfst.c - MacOS - - - Name - jidctint.c - MacOS - - - Name - jidctred.c - MacOS - - - Name - jmemmgr.c - MacOS - - - Name - jquant1.c - MacOS - - - Name - jquant2.c - MacOS - - - Name - jutils.c - MacOS - - - Name - jmemmac.c - MacOS - - - - - - Name - Carbon.framework - Unix - - Carbon - - - - - - - PPC - Mach-O - - - - - PPC - Name - jcapimin.c - MacOS - - - PPC - Name - jcapistd.c - MacOS - - - PPC - Name - jccoefct.c - MacOS - - - PPC - Name - jccolor.c - MacOS - - - PPC - Name - jcdctmgr.c - MacOS - - - PPC - Name - jchuff.c - MacOS - - - PPC - Name - jcinit.c - MacOS - - - PPC - Name - jcmainct.c - MacOS - - - PPC - Name - jcmarker.c - MacOS - - - PPC - Name - jcmaster.c - MacOS - - - PPC - Name - jcomapi.c - MacOS - - - PPC - Name - jcparam.c - MacOS - - - PPC - Name - jcphuff.c - MacOS - - - PPC - Name - jcprepct.c - MacOS - - - PPC - Name - jcsample.c - MacOS - - - PPC - Name - jctrans.c - MacOS - - - PPC - Name - jdapimin.c - MacOS - - - PPC - Name - jdapistd.c - MacOS - - - PPC - Name - jdatadst.c - MacOS - - - PPC - Name - jdatasrc.c - MacOS - - - PPC - Name - jdcoefct.c - MacOS - - - PPC - Name - jdcolor.c - MacOS - - - PPC - Name - jddctmgr.c - MacOS - - - PPC - Name - jdhuff.c - MacOS - - - PPC - Name - jdinput.c - MacOS - - - PPC - Name - jdmainct.c - MacOS - - - PPC - Name - jdmarker.c - MacOS - - - PPC - Name - jdmaster.c - MacOS - - - PPC - Name - jdmerge.c - MacOS - - - PPC - Name - jdphuff.c - MacOS - - - PPC - Name - jdpostct.c - MacOS - - - PPC - Name - jdsample.c - MacOS - - - PPC - Name - jdtrans.c - MacOS - - - PPC - Name - jerror.c - MacOS - - - PPC - Name - jfdctflt.c - MacOS - - - PPC - Name - jfdctint.c - MacOS - - - PPC - Name - jfdctfst.c - MacOS - - - PPC - Name - jidctflt.c - MacOS - - - PPC - Name - jidctfst.c - MacOS - - - PPC - Name - jidctint.c - MacOS - - - PPC - Name - jidctred.c - MacOS - - - PPC - Name - jmemmac.c - MacOS - - - PPC - Name - jmemmgr.c - MacOS - - - PPC - Name - jquant1.c - MacOS - - - PPC - Name - jquant2.c - MacOS - - - PPC - Name - jutils.c - MacOS - - - - diff --git a/wxWidgets/src/jpeg/jpeg_CW_Prefix.h b/wxWidgets/src/jpeg/jpeg_CW_Prefix.h deleted file mode 100644 index 92afda8c10..0000000000 --- a/wxWidgets/src/jpeg/jpeg_CW_Prefix.h +++ /dev/null @@ -1,6 +0,0 @@ -// Special configuration file for building jpeg under CodeWarrior - - -//#define HAVE_BOOLEAN - - diff --git a/wxWidgets/src/jpeg/jpegint.h b/wxWidgets/src/jpeg/jpegint.h deleted file mode 100644 index 7928ae3c50..0000000000 --- a/wxWidgets/src/jpeg/jpegint.h +++ /dev/null @@ -1,400 +0,0 @@ -/* - * jpegint.h - * - * Copyright (C) 1991-1997, Thomas G. Lane. - * This file is part of the Independent JPEG Group's software. - * For conditions of distribution and use, see the accompanying README file. - * - * This file provides common declarations for the various JPEG modules. - * These declarations are considered internal to the JPEG library; most - * applications using the library shouldn't need to include this file. - */ - - -/* Declarations for both compression & decompression */ - -typedef enum { /* Operating modes for buffer controllers */ - JBUF_PASS_THRU, /* Plain stripwise operation */ - /* Remaining modes require a full-image buffer to have been created */ - JBUF_SAVE_SOURCE, /* Run source subobject only, save output */ - JBUF_CRANK_DEST, /* Run dest subobject only, using saved data */ - JBUF_SAVE_AND_PASS /* Run both subobjects, save output */ -} J_BUF_MODE; - -/* Values of global_state field (jdapi.c has some dependencies on ordering!) */ -#define CSTATE_START 100 /* after create_compress */ -#define CSTATE_SCANNING 101 /* start_compress done, write_scanlines OK */ -#define CSTATE_RAW_OK 102 /* start_compress done, write_raw_data OK */ -#define CSTATE_WRCOEFS 103 /* jpeg_write_coefficients done */ -#define DSTATE_START 200 /* after create_decompress */ -#define DSTATE_INHEADER 201 /* reading header markers, no SOS yet */ -#define DSTATE_READY 202 /* found SOS, ready for start_decompress */ -#define DSTATE_PRELOAD 203 /* reading multiscan file in start_decompress*/ -#define DSTATE_PRESCAN 204 /* performing dummy pass for 2-pass quant */ -#define DSTATE_SCANNING 205 /* start_decompress done, read_scanlines OK */ -#define DSTATE_RAW_OK 206 /* start_decompress done, read_raw_data OK */ -#define DSTATE_BUFIMAGE 207 /* expecting jpeg_start_output */ -#define DSTATE_BUFPOST 208 /* looking for SOS/EOI in jpeg_finish_output */ -#define DSTATE_RDCOEFS 209 /* reading file in jpeg_read_coefficients */ -#define DSTATE_STOPPING 210 /* looking for EOI in jpeg_finish_decompress */ - - -/* Declarations for compression modules */ - -/* Master control module */ -struct jpeg_comp_master { - JMETHOD(void, prepare_for_pass, (j_compress_ptr cinfo)); - JMETHOD(void, pass_startup, (j_compress_ptr cinfo)); - JMETHOD(void, finish_pass, (j_compress_ptr cinfo)); - - /* State variables made visible to other modules */ - wxjpeg_boolean call_pass_startup; /* True if pass_startup must be called */ - wxjpeg_boolean is_last_pass; /* True during last pass */ -}; - -/* Main buffer control (downsampled-data buffer) */ -struct jpeg_c_main_controller { - JMETHOD(void, start_pass, (j_compress_ptr cinfo, J_BUF_MODE pass_mode)); - JMETHOD(void, process_data, (j_compress_ptr cinfo, - JSAMPARRAY input_buf, JDIMENSION *in_row_ctr, - JDIMENSION in_rows_avail)); -}; - -/* Compression preprocessing (downsampling input buffer control) */ -struct jpeg_c_prep_controller { - JMETHOD(void, start_pass, (j_compress_ptr cinfo, J_BUF_MODE pass_mode)); - JMETHOD(void, pre_process_data, (j_compress_ptr cinfo, - JSAMPARRAY input_buf, - JDIMENSION *in_row_ctr, - JDIMENSION in_rows_avail, - JSAMPIMAGE output_buf, - JDIMENSION *out_row_group_ctr, - JDIMENSION out_row_groups_avail)); -}; - -/* Coefficient buffer control */ -struct jpeg_c_coef_controller { - JMETHOD(void, start_pass, (j_compress_ptr cinfo, J_BUF_MODE pass_mode)); - JMETHOD(wxjpeg_boolean, compress_data, (j_compress_ptr cinfo, - JSAMPIMAGE input_buf)); -}; - -/* Colorspace conversion */ -struct jpeg_color_converter { - JMETHOD(void, start_pass, (j_compress_ptr cinfo)); - JMETHOD(void, color_convert, (j_compress_ptr cinfo, - JSAMPARRAY input_buf, JSAMPIMAGE output_buf, - JDIMENSION output_row, int num_rows)); -}; - -/* Downsampling */ -struct jpeg_downsampler { - JMETHOD(void, start_pass, (j_compress_ptr cinfo)); - JMETHOD(void, downsample, (j_compress_ptr cinfo, - JSAMPIMAGE input_buf, JDIMENSION in_row_index, - JSAMPIMAGE output_buf, - JDIMENSION out_row_group_index)); - - wxjpeg_boolean need_context_rows; /* TRUE if need rows above & below */ -}; - -/* Forward DCT (also controls coefficient quantization) */ -struct jpeg_forward_dct { - JMETHOD(void, start_pass, (j_compress_ptr cinfo)); - /* perhaps this should be an array??? */ - JMETHOD(void, forward_DCT, (j_compress_ptr cinfo, - jpeg_component_info * compptr, - JSAMPARRAY sample_data, JBLOCKROW coef_blocks, - JDIMENSION start_row, JDIMENSION start_col, - JDIMENSION num_blocks)); -}; - -/* Entropy encoding */ -struct jpeg_entropy_encoder { - JMETHOD(void, start_pass, (j_compress_ptr cinfo, wxjpeg_boolean gather_statistics)); - JMETHOD(wxjpeg_boolean, encode_mcu, (j_compress_ptr cinfo, JBLOCKROW *MCU_data)); - JMETHOD(void, finish_pass, (j_compress_ptr cinfo)); -}; - -/* Marker writing */ -struct jpeg_marker_writer { - JMETHOD(void, write_file_header, (j_compress_ptr cinfo)); - JMETHOD(void, write_frame_header, (j_compress_ptr cinfo)); - JMETHOD(void, write_scan_header, (j_compress_ptr cinfo)); - JMETHOD(void, write_file_trailer, (j_compress_ptr cinfo)); - JMETHOD(void, write_tables_only, (j_compress_ptr cinfo)); - /* These routines are exported to allow insertion of extra markers */ - /* Probably only COM and APPn markers should be written this way */ - JMETHOD(void, write_marker_header, (j_compress_ptr cinfo, int marker, - unsigned int datalen)); - JMETHOD(void, write_marker_byte, (j_compress_ptr cinfo, int val)); -}; - - -/* Declarations for decompression modules */ - -/* Master control module */ -struct jpeg_decomp_master { - JMETHOD(void, prepare_for_output_pass, (j_decompress_ptr cinfo)); - JMETHOD(void, finish_output_pass, (j_decompress_ptr cinfo)); - - /* State variables made visible to other modules */ - wxjpeg_boolean is_dummy_pass; /* True during 1st pass for 2-pass quant */ -}; - -/* Input control module */ -struct jpeg_input_controller { - JMETHOD(int, consume_input, (j_decompress_ptr cinfo)); - JMETHOD(void, reset_input_controller, (j_decompress_ptr cinfo)); - JMETHOD(void, start_input_pass, (j_decompress_ptr cinfo)); - JMETHOD(void, finish_input_pass, (j_decompress_ptr cinfo)); - - /* State variables made visible to other modules */ - wxjpeg_boolean has_multiple_scans; /* True if file has multiple scans */ - wxjpeg_boolean eoi_reached; /* True when EOI has been consumed */ -}; - -/* Main buffer control (downsampled-data buffer) */ -struct jpeg_d_main_controller { - JMETHOD(void, start_pass, (j_decompress_ptr cinfo, J_BUF_MODE pass_mode)); - JMETHOD(void, process_data, (j_decompress_ptr cinfo, - JSAMPARRAY output_buf, JDIMENSION *out_row_ctr, - JDIMENSION out_rows_avail)); -}; - -/* Coefficient buffer control */ -struct jpeg_d_coef_controller { -#if defined(__VISAGECPP__) - /* the start input pass in jdcoeft must have a different name than the - // one in jdtrans under VisualAge or else we get a dup symbol error - */ - JMETHOD(void, start_input_pass2, (j_decompress_ptr cinfo)); -#else - JMETHOD(void, start_input_pass, (j_decompress_ptr cinfo)); -#endif - - JMETHOD(int, consume_data, (j_decompress_ptr cinfo)); - JMETHOD(void, start_output_pass, (j_decompress_ptr cinfo)); - JMETHOD(int, decompress_data, (j_decompress_ptr cinfo, - JSAMPIMAGE output_buf)); - /* Pointer to array of coefficient virtual arrays, or NULL if none */ - jvirt_barray_ptr *coef_arrays; -}; - -/* Decompression postprocessing (color quantization buffer control) */ -struct jpeg_d_post_controller { - JMETHOD(void, start_pass, (j_decompress_ptr cinfo, J_BUF_MODE pass_mode)); - JMETHOD(void, post_process_data, (j_decompress_ptr cinfo, - JSAMPIMAGE input_buf, - JDIMENSION *in_row_group_ctr, - JDIMENSION in_row_groups_avail, - JSAMPARRAY output_buf, - JDIMENSION *out_row_ctr, - JDIMENSION out_rows_avail)); -}; - -/* Marker reading & parsing */ -struct jpeg_marker_reader { - JMETHOD(void, reset_marker_reader, (j_decompress_ptr cinfo)); - /* Read markers until SOS or EOI. - * Returns same codes as are defined for jpeg_consume_input: - * JPEG_SUSPENDED, JPEG_REACHED_SOS, or JPEG_REACHED_EOI. - */ - JMETHOD(int, read_markers, (j_decompress_ptr cinfo)); - /* Read a restart marker --- exported for use by entropy decoder only */ - jpeg_marker_parser_method read_restart_marker; - - /* State of marker reader --- nominally internal, but applications - * supplying COM or APPn handlers might like to know the state. - */ - wxjpeg_boolean saw_SOI; /* found SOI? */ - wxjpeg_boolean saw_SOF; /* found SOF? */ - int next_restart_num; /* next restart number expected (0-7) */ - unsigned int discarded_bytes; /* # of bytes skipped looking for a marker */ -}; - -/* Entropy decoding */ -struct jpeg_entropy_decoder { - JMETHOD(void, start_pass, (j_decompress_ptr cinfo)); - JMETHOD(wxjpeg_boolean, decode_mcu, (j_decompress_ptr cinfo, - JBLOCKROW *MCU_data)); - - /* This is here to share code between baseline and progressive decoders; */ - /* other modules probably should not use it */ - wxjpeg_boolean insufficient_data; /* set TRUE after emitting warning */ -}; - -/* Inverse DCT (also performs dequantization) */ -typedef JMETHOD(void, inverse_DCT_method_ptr, - (j_decompress_ptr cinfo, jpeg_component_info * compptr, - JCOEFPTR coef_block, - JSAMPARRAY output_buf, JDIMENSION output_col)); - -struct jpeg_inverse_dct { - JMETHOD(void, start_pass, (j_decompress_ptr cinfo)); - /* It is useful to allow each component to have a separate IDCT method. */ - inverse_DCT_method_ptr inverse_DCT[MAX_COMPONENTS]; -}; - -/* Upsampling (note that upsampler must also call color converter) */ -struct jpeg_upsampler { - JMETHOD(void, start_pass, (j_decompress_ptr cinfo)); - JMETHOD(void, upsample, (j_decompress_ptr cinfo, - JSAMPIMAGE input_buf, - JDIMENSION *in_row_group_ctr, - JDIMENSION in_row_groups_avail, - JSAMPARRAY output_buf, - JDIMENSION *out_row_ctr, - JDIMENSION out_rows_avail)); - - wxjpeg_boolean need_context_rows; /* TRUE if need rows above & below */ -}; - -/* Colorspace conversion */ -struct jpeg_color_deconverter { - JMETHOD(void, start_pass, (j_decompress_ptr cinfo)); - JMETHOD(void, color_convert, (j_decompress_ptr cinfo, - JSAMPIMAGE input_buf, JDIMENSION input_row, - JSAMPARRAY output_buf, int num_rows)); -}; - -/* Color quantization or color precision reduction */ -struct jpeg_color_quantizer { - JMETHOD(void, start_pass, (j_decompress_ptr cinfo, wxjpeg_boolean is_pre_scan)); - JMETHOD(void, color_quantize, (j_decompress_ptr cinfo, - JSAMPARRAY input_buf, JSAMPARRAY output_buf, - int num_rows)); - JMETHOD(void, finish_pass, (j_decompress_ptr cinfo)); - JMETHOD(void, new_color_map, (j_decompress_ptr cinfo)); -}; - - -/* Miscellaneous useful macros */ - -#undef MAX -#define MAX(a,b) ((a) > (b) ? (a) : (b)) -#undef MIN -#define MIN(a,b) ((a) < (b) ? (a) : (b)) - - -/* We assume that right shift corresponds to signed division by 2 with - * rounding towards minus infinity. This is correct for typical "arithmetic - * shift" instructions that shift in copies of the sign bit. But some - * C compilers implement >> with an unsigned shift. For these machines you - * must define RIGHT_SHIFT_IS_UNSIGNED. - * RIGHT_SHIFT provides a proper signed right shift of an INT32 quantity. - * It is only applied with constant shift counts. SHIFT_TEMPS must be - * included in the variables of any routine using RIGHT_SHIFT. - */ - -#ifdef RIGHT_SHIFT_IS_UNSIGNED -#define SHIFT_TEMPS JPEG_INT32 shift_temp; -#define RIGHT_SHIFT(x,shft) \ - ((shift_temp = (x)) < 0 ? \ - (shift_temp >> (shft)) | ((~((JPEG_INT32) 0)) << (32-(shft))) : \ - (shift_temp >> (shft))) -#else -#define SHIFT_TEMPS -#define RIGHT_SHIFT(x,shft) ((x) >> (shft)) -#endif - - -/* Short forms of external names for systems with brain-damaged linkers. */ - -#ifdef NEED_SHORT_EXTERNAL_NAMES -#define jinit_compress_master jICompress -#define jinit_c_master_control jICMaster -#define jinit_c_main_controller jICMainC -#define jinit_c_prep_controller jICPrepC -#define jinit_c_coef_controller jICCoefC -#define jinit_color_converter jICColor -#define jinit_downsampler jIDownsampler -#define jinit_forward_dct jIFDCT -#define jinit_huff_encoder jIHEncoder -#define jinit_phuff_encoder jIPHEncoder -#define jinit_marker_writer jIMWriter -#define jinit_master_decompress jIDMaster -#define jinit_d_main_controller jIDMainC -#define jinit_d_coef_controller jIDCoefC -#define jinit_d_post_controller jIDPostC -#define jinit_input_controller jIInCtlr -#define jinit_marker_reader jIMReader -#define jinit_huff_decoder jIHDecoder -#define jinit_phuff_decoder jIPHDecoder -#define jinit_inverse_dct jIIDCT -#define jinit_upsampler jIUpsampler -#define jinit_color_deconverter jIDColor -#define jinit_1pass_quantizer jI1Quant -#define jinit_2pass_quantizer jI2Quant -#define jinit_merged_upsampler jIMUpsampler -#define jinit_memory_mgr jIMemMgr -#define jdiv_round_up jDivRound -#define jround_up jRound -#define jcopy_sample_rows jCopySamples -#define jcopy_block_row jCopyBlocks -#define jzero_far jZeroFar -#define jpeg_zigzag_order jZIGTable -#define jpeg_natural_order jZAGTable -#endif /* NEED_SHORT_EXTERNAL_NAMES */ - - -/* Compression module initialization routines */ -EXTERN(void) jinit_compress_master JPP((j_compress_ptr cinfo)); -EXTERN(void) jinit_c_master_control JPP((j_compress_ptr cinfo, - wxjpeg_boolean transcode_only)); -EXTERN(void) jinit_c_main_controller JPP((j_compress_ptr cinfo, - wxjpeg_boolean need_full_buffer)); -EXTERN(void) jinit_c_prep_controller JPP((j_compress_ptr cinfo, - wxjpeg_boolean need_full_buffer)); -EXTERN(void) jinit_c_coef_controller JPP((j_compress_ptr cinfo, - wxjpeg_boolean need_full_buffer)); -EXTERN(void) jinit_color_converter JPP((j_compress_ptr cinfo)); -EXTERN(void) jinit_downsampler JPP((j_compress_ptr cinfo)); -EXTERN(void) jinit_forward_dct JPP((j_compress_ptr cinfo)); -EXTERN(void) jinit_huff_encoder JPP((j_compress_ptr cinfo)); -EXTERN(void) jinit_phuff_encoder JPP((j_compress_ptr cinfo)); -EXTERN(void) jinit_marker_writer JPP((j_compress_ptr cinfo)); -/* Decompression module initialization routines */ -EXTERN(void) jinit_master_decompress JPP((j_decompress_ptr cinfo)); -EXTERN(void) jinit_d_main_controller JPP((j_decompress_ptr cinfo, - wxjpeg_boolean need_full_buffer)); -EXTERN(void) jinit_d_coef_controller JPP((j_decompress_ptr cinfo, - wxjpeg_boolean need_full_buffer)); -EXTERN(void) jinit_d_post_controller JPP((j_decompress_ptr cinfo, - wxjpeg_boolean need_full_buffer)); -EXTERN(void) jinit_input_controller JPP((j_decompress_ptr cinfo)); -EXTERN(void) jinit_marker_reader JPP((j_decompress_ptr cinfo)); -EXTERN(void) jinit_huff_decoder JPP((j_decompress_ptr cinfo)); -EXTERN(void) jinit_phuff_decoder JPP((j_decompress_ptr cinfo)); -EXTERN(void) jinit_inverse_dct JPP((j_decompress_ptr cinfo)); -EXTERN(void) jinit_upsampler JPP((j_decompress_ptr cinfo)); -EXTERN(void) jinit_color_deconverter JPP((j_decompress_ptr cinfo)); -EXTERN(void) jinit_1pass_quantizer JPP((j_decompress_ptr cinfo)); -EXTERN(void) jinit_2pass_quantizer JPP((j_decompress_ptr cinfo)); -EXTERN(void) jinit_merged_upsampler JPP((j_decompress_ptr cinfo)); -/* Memory manager initialization */ -EXTERN(void) jinit_memory_mgr JPP((j_common_ptr cinfo)); - -/* Utility routines in jutils.c */ -EXTERN(long) jdiv_round_up JPP((long a, long b)); -EXTERN(long) jround_up JPP((long a, long b)); -EXTERN(void) jcopy_sample_rows JPP((JSAMPARRAY input_array, int source_row, - JSAMPARRAY output_array, int dest_row, - int num_rows, JDIMENSION num_cols)); -EXTERN(void) jcopy_block_row JPP((JBLOCKROW input_row, JBLOCKROW output_row, - JDIMENSION num_blocks)); -EXTERN(void) jzero_far JPP((void FAR * target, size_t bytestozero)); -/* Constant tables in jutils.c */ -#if 0 /* This table is not actually needed in v6a */ -extern const int jpeg_zigzag_order[]; /* natural coef order to zigzag order */ -#endif -extern const int jpeg_natural_order[]; /* zigzag coef order to natural order */ - -/* Suppress undefined-structure complaints if necessary. */ - -#ifdef INCOMPLETE_TYPES_BROKEN -#ifndef AM_MEMORY_MANAGER /* only jmemmgr.c defines these */ -struct jvirt_sarray_control { long dummy; }; -struct jvirt_barray_control { long dummy; }; -#endif -#endif /* INCOMPLETE_TYPES_BROKEN */ diff --git a/wxWidgets/src/jpeg/jpeglib.h b/wxWidgets/src/jpeg/jpeglib.h deleted file mode 100644 index 8bdfe51745..0000000000 --- a/wxWidgets/src/jpeg/jpeglib.h +++ /dev/null @@ -1,1096 +0,0 @@ -/* - * jpeglib.h - * - * Copyright (C) 1991-1998, Thomas G. Lane. - * This file is part of the Independent JPEG Group's software. - * For conditions of distribution and use, see the accompanying README file. - * - * This file defines the application interface for the JPEG library. - * Most applications using the library need only include this file, - * and perhaps jerror.h if they want to know the exact error codes. - */ - -#ifndef JPEGLIB_H -#define JPEGLIB_H - -/* - * First we include the configuration files that record how this - * installation of the JPEG library is set up. jconfig.h can be - * generated automatically for many systems. jmorecfg.h contains - * manual configuration options that most people need not worry about. - */ - -#ifndef JCONFIG_INCLUDED /* in case jinclude.h already did */ -#include "../src/jpeg/jconfig.h" /* widely used configuration options */ -#endif -#include "jmorecfg.h" /* seldom changed options */ - - -/* Version ID for the JPEG library. - * Might be useful for tests like "#if JPEG_LIB_VERSION >= 60". - */ - -#define JPEG_LIB_VERSION 62 /* Version 6b */ - - -/* Various constants determining the sizes of things. - * All of these are specified by the JPEG standard, so don't change them - * if you want to be compatible. - */ - -#define DCTSIZE 8 /* The basic DCT block is 8x8 samples */ -#define DCTSIZE2 64 /* DCTSIZE squared; # of elements in a block */ -#define NUM_QUANT_TBLS 4 /* Quantization tables are numbered 0..3 */ -#define NUM_HUFF_TBLS 4 /* Huffman tables are numbered 0..3 */ -#define NUM_ARITH_TBLS 16 /* Arith-coding tables are numbered 0..15 */ -#define MAX_COMPS_IN_SCAN 4 /* JPEG limit on # of components in one scan */ -#define MAX_SAMP_FACTOR 4 /* JPEG limit on sampling factors */ -/* Unfortunately, some bozo at Adobe saw no reason to be bound by the standard; - * the PostScript DCT filter can emit files with many more than 10 blocks/MCU. - * If you happen to run across such a file, you can up D_MAX_BLOCKS_IN_MCU - * to handle it. We even let you do this from the jconfig.h file. However, - * we strongly discourage changing C_MAX_BLOCKS_IN_MCU; just because Adobe - * sometimes emits noncompliant files doesn't mean you should too. - */ -#define C_MAX_BLOCKS_IN_MCU 10 /* compressor's limit on blocks per MCU */ -#ifndef D_MAX_BLOCKS_IN_MCU -#define D_MAX_BLOCKS_IN_MCU 10 /* decompressor's limit on blocks per MCU */ -#endif - - -/* Data structures for images (arrays of samples and of DCT coefficients). - * On 80x86 machines, the image arrays are too big for near pointers, - * but the pointer arrays can fit in near memory. - */ - -typedef JSAMPLE FAR *JSAMPROW; /* ptr to one image row of pixel samples. */ -typedef JSAMPROW *JSAMPARRAY; /* ptr to some rows (a 2-D sample array) */ -typedef JSAMPARRAY *JSAMPIMAGE; /* a 3-D sample array: top index is color */ - -typedef JCOEF JBLOCK[DCTSIZE2]; /* one block of coefficients */ -typedef JBLOCK FAR *JBLOCKROW; /* pointer to one row of coefficient blocks */ -typedef JBLOCKROW *JBLOCKARRAY; /* a 2-D array of coefficient blocks */ -typedef JBLOCKARRAY *JBLOCKIMAGE; /* a 3-D array of coefficient blocks */ - -typedef JCOEF FAR *JCOEFPTR; /* useful in a couple of places */ - - -/* Types for JPEG compression parameters and working tables. */ - - -/* DCT coefficient quantization tables. */ - -typedef struct { - /* This array gives the coefficient quantizers in natural array order - * (not the zigzag order in which they are stored in a JPEG DQT marker). - * CAUTION: IJG versions prior to v6a kept this array in zigzag order. - */ - UINT16 quantval[DCTSIZE2]; /* quantization step for each coefficient */ - /* This field is used only during compression. It's initialized FALSE when - * the table is created, and set TRUE when it's been output to the file. - * You could suppress output of a table by setting this to TRUE. - * (See jpeg_suppress_tables for an example.) - */ - wxjpeg_boolean sent_table; /* TRUE when table has been output */ -} JQUANT_TBL; - - -/* Huffman coding tables. */ - -typedef struct { - /* These two fields directly represent the contents of a JPEG DHT marker */ - UINT8 bits[17]; /* bits[k] = # of symbols with codes of */ - /* length k bits; bits[0] is unused */ - UINT8 huffval[256]; /* The symbols, in order of incr code length */ - /* This field is used only during compression. It's initialized FALSE when - * the table is created, and set TRUE when it's been output to the file. - * You could suppress output of a table by setting this to TRUE. - * (See jpeg_suppress_tables for an example.) - */ - wxjpeg_boolean sent_table; /* TRUE when table has been output */ -} JHUFF_TBL; - - -/* Basic info about one component (color channel). */ - -typedef struct { - /* These values are fixed over the whole image. */ - /* For compression, they must be supplied by parameter setup; */ - /* for decompression, they are read from the SOF marker. */ - int component_id; /* identifier for this component (0..255) */ - int component_index; /* its index in SOF or cinfo->comp_info[] */ - int h_samp_factor; /* horizontal sampling factor (1..4) */ - int v_samp_factor; /* vertical sampling factor (1..4) */ - int quant_tbl_no; /* quantization table selector (0..3) */ - /* These values may vary between scans. */ - /* For compression, they must be supplied by parameter setup; */ - /* for decompression, they are read from the SOS marker. */ - /* The decompressor output side may not use these variables. */ - int dc_tbl_no; /* DC entropy table selector (0..3) */ - int ac_tbl_no; /* AC entropy table selector (0..3) */ - - /* Remaining fields should be treated as private by applications. */ - - /* These values are computed during compression or decompression startup: */ - /* Component's size in DCT blocks. - * Any dummy blocks added to complete an MCU are not counted; therefore - * these values do not depend on whether a scan is interleaved or not. - */ - JDIMENSION width_in_blocks; - JDIMENSION height_in_blocks; - /* Size of a DCT block in samples. Always DCTSIZE for compression. - * For decompression this is the size of the output from one DCT block, - * reflecting any scaling we choose to apply during the IDCT step. - * Values of 1,2,4,8 are likely to be supported. Note that different - * components may receive different IDCT scalings. - */ - int DCT_scaled_size; - /* The downsampled dimensions are the component's actual, unpadded number - * of samples at the main buffer (preprocessing/compression interface), thus - * downsampled_width = ceil(image_width * Hi/Hmax) - * and similarly for height. For decompression, IDCT scaling is included, so - * downsampled_width = ceil(image_width * Hi/Hmax * DCT_scaled_size/DCTSIZE) - */ - JDIMENSION downsampled_width; /* actual width in samples */ - JDIMENSION downsampled_height; /* actual height in samples */ - /* This flag is used only for decompression. In cases where some of the - * components will be ignored (eg grayscale output from YCbCr image), - * we can skip most computations for the unused components. - */ - wxjpeg_boolean component_needed; /* do we need the value of this component? */ - - /* These values are computed before starting a scan of the component. */ - /* The decompressor output side may not use these variables. */ - int MCU_width; /* number of blocks per MCU, horizontally */ - int MCU_height; /* number of blocks per MCU, vertically */ - int MCU_blocks; /* MCU_width * MCU_height */ - int MCU_sample_width; /* MCU width in samples, MCU_width*DCT_scaled_size */ - int last_col_width; /* # of non-dummy blocks across in last MCU */ - int last_row_height; /* # of non-dummy blocks down in last MCU */ - - /* Saved quantization table for component; NULL if none yet saved. - * See jdinput.c comments about the need for this information. - * This field is currently used only for decompression. - */ - JQUANT_TBL * quant_table; - - /* Private per-component storage for DCT or IDCT subsystem. */ - void * dct_table; -} jpeg_component_info; - - -/* The script for encoding a multiple-scan file is an array of these: */ - -typedef struct { - int comps_in_scan; /* number of components encoded in this scan */ - int component_index[MAX_COMPS_IN_SCAN]; /* their SOF/comp_info[] indexes */ - int Ss, Se; /* progressive JPEG spectral selection parms */ - int Ah, Al; /* progressive JPEG successive approx. parms */ -} jpeg_scan_info; - -/* The decompressor can save APPn and COM markers in a list of these: */ - -typedef struct jpeg_marker_struct FAR * jpeg_saved_marker_ptr; - -struct jpeg_marker_struct { - jpeg_saved_marker_ptr next; /* next in list, or NULL */ - UINT8 marker; /* marker code: JPEG_COM, or JPEG_APP0+n */ - unsigned int original_length; /* # bytes of data in the file */ - unsigned int data_length; /* # bytes of data saved at data[] */ - JOCTET FAR * data; /* the data contained in the marker */ - /* the marker length word is not counted in data_length or original_length */ -}; - -/* Known color spaces. */ - -typedef enum { - JCS_UNKNOWN, /* error/unspecified */ - JCS_GRAYSCALE, /* monochrome */ - JCS_RGB, /* red/green/blue */ - JCS_YCbCr, /* Y/Cb/Cr (also known as YUV) */ - JCS_CMYK, /* C/M/Y/K */ - JCS_YCCK /* Y/Cb/Cr/K */ -} J_COLOR_SPACE; - -/* DCT/IDCT algorithm options. */ - -typedef enum { - JDCT_ISLOW, /* slow but accurate integer algorithm */ - JDCT_IFAST, /* faster, less accurate integer method */ - JDCT_FLOAT /* floating-point: accurate, fast on fast HW */ -} J_DCT_METHOD; - -#ifndef JDCT_DEFAULT /* may be overridden in jconfig.h */ -#define JDCT_DEFAULT JDCT_ISLOW -#endif -#ifndef JDCT_FASTEST /* may be overridden in jconfig.h */ -#define JDCT_FASTEST JDCT_IFAST -#endif - -/* Dithering options for decompression. */ - -typedef enum { - JDITHER_NONE, /* no dithering */ - JDITHER_ORDERED, /* simple ordered dither */ - JDITHER_FS /* Floyd-Steinberg error diffusion dither */ -} J_DITHER_MODE; - - -/* Common fields between JPEG compression and decompression master structs. */ - -#define jpeg_common_fields \ - struct jpeg_error_mgr * err; /* Error handler module */\ - struct jpeg_memory_mgr * mem; /* Memory manager module */\ - struct jpeg_progress_mgr * progress; /* Progress monitor, or NULL if none */\ - void * client_data; /* Available for use by application */\ - wxjpeg_boolean is_decompressor; /* So common code can tell which is which */\ - int global_state /* For checking call sequence validity */ - -/* Routines that are to be used by both halves of the library are declared - * to receive a pointer to this structure. There are no actual instances of - * jpeg_common_struct, only of jpeg_compress_struct and jpeg_decompress_struct. - */ -struct jpeg_common_struct { - jpeg_common_fields; /* Fields common to both master struct types */ - /* Additional fields follow in an actual jpeg_compress_struct or - * jpeg_decompress_struct. All three structs must agree on these - * initial fields! (This would be a lot cleaner in C++.) - */ -}; - -typedef struct jpeg_common_struct * j_common_ptr; -typedef struct jpeg_compress_struct * j_compress_ptr; -typedef struct jpeg_decompress_struct * j_decompress_ptr; - - -/* Master record for a compression instance */ - -struct jpeg_compress_struct { - jpeg_common_fields; /* Fields shared with jpeg_decompress_struct */ - - /* Destination for compressed data */ - struct jpeg_destination_mgr * dest; - - /* Description of source image --- these fields must be filled in by - * outer application before starting compression. in_color_space must - * be correct before you can even call jpeg_set_defaults(). - */ - - JDIMENSION image_width; /* input image width */ - JDIMENSION image_height; /* input image height */ - int input_components; /* # of color components in input image */ - J_COLOR_SPACE in_color_space; /* colorspace of input image */ - - double input_gamma; /* image gamma of input image */ - - /* Compression parameters --- these fields must be set before calling - * jpeg_start_compress(). We recommend calling jpeg_set_defaults() to - * initialize everything to reasonable defaults, then changing anything - * the application specifically wants to change. That way you won't get - * burnt when new parameters are added. Also note that there are several - * helper routines to simplify changing parameters. - */ - - int data_precision; /* bits of precision in image data */ - - int num_components; /* # of color components in JPEG image */ - J_COLOR_SPACE jpeg_color_space; /* colorspace of JPEG image */ - - jpeg_component_info * comp_info; - /* comp_info[i] describes component that appears i'th in SOF */ - - JQUANT_TBL * quant_tbl_ptrs[NUM_QUANT_TBLS]; - /* ptrs to coefficient quantization tables, or NULL if not defined */ - - JHUFF_TBL * dc_huff_tbl_ptrs[NUM_HUFF_TBLS]; - JHUFF_TBL * ac_huff_tbl_ptrs[NUM_HUFF_TBLS]; - /* ptrs to Huffman coding tables, or NULL if not defined */ - - UINT8 arith_dc_L[NUM_ARITH_TBLS]; /* L values for DC arith-coding tables */ - UINT8 arith_dc_U[NUM_ARITH_TBLS]; /* U values for DC arith-coding tables */ - UINT8 arith_ac_K[NUM_ARITH_TBLS]; /* Kx values for AC arith-coding tables */ - - int num_scans; /* # of entries in scan_info array */ - const jpeg_scan_info * scan_info; /* script for multi-scan file, or NULL */ - /* The default value of scan_info is NULL, which causes a single-scan - * sequential JPEG file to be emitted. To create a multi-scan file, - * set num_scans and scan_info to point to an array of scan definitions. - */ - - wxjpeg_boolean raw_data_in; /* TRUE=caller supplies downsampled data */ - wxjpeg_boolean arith_code; /* TRUE=arithmetic coding, FALSE=Huffman */ - wxjpeg_boolean optimize_coding; /* TRUE=optimize entropy encoding parms */ - wxjpeg_boolean CCIR601_sampling; /* TRUE=first samples are cosited */ - int smoothing_factor; /* 1..100, or 0 for no input smoothing */ - J_DCT_METHOD dct_method; /* DCT algorithm selector */ - - /* The restart interval can be specified in absolute MCUs by setting - * restart_interval, or in MCU rows by setting restart_in_rows - * (in which case the correct restart_interval will be figured - * for each scan). - */ - unsigned int restart_interval; /* MCUs per restart, or 0 for no restart */ - int restart_in_rows; /* if > 0, MCU rows per restart interval */ - - /* Parameters controlling emission of special markers. */ - - wxjpeg_boolean write_JFIF_header; /* should a JFIF marker be written? */ - UINT8 JFIF_major_version; /* What to write for the JFIF version number */ - UINT8 JFIF_minor_version; - /* These three values are not used by the JPEG code, merely copied */ - /* into the JFIF APP0 marker. density_unit can be 0 for unknown, */ - /* 1 for dots/inch, or 2 for dots/cm. Note that the pixel aspect */ - /* ratio is defined by X_density/Y_density even when density_unit=0. */ - UINT8 density_unit; /* JFIF code for pixel size units */ - UINT16 X_density; /* Horizontal pixel density */ - UINT16 Y_density; /* Vertical pixel density */ - wxjpeg_boolean write_Adobe_marker; /* should an Adobe marker be written? */ - - /* State variable: index of next scanline to be written to - * jpeg_write_scanlines(). Application may use this to control its - * processing loop, e.g., "while (next_scanline < image_height)". - */ - - JDIMENSION next_scanline; /* 0 .. image_height-1 */ - - /* Remaining fields are known throughout compressor, but generally - * should not be touched by a surrounding application. - */ - - /* - * These fields are computed during compression startup - */ - wxjpeg_boolean progressive_mode; /* TRUE if scan script uses progressive mode */ - int max_h_samp_factor; /* largest h_samp_factor */ - int max_v_samp_factor; /* largest v_samp_factor */ - - JDIMENSION total_iMCU_rows; /* # of iMCU rows to be input to coef ctlr */ - /* The coefficient controller receives data in units of MCU rows as defined - * for fully interleaved scans (whether the JPEG file is interleaved or not). - * There are v_samp_factor * DCTSIZE sample rows of each component in an - * "iMCU" (interleaved MCU) row. - */ - - /* - * These fields are valid during any one scan. - * They describe the components and MCUs actually appearing in the scan. - */ - int comps_in_scan; /* # of JPEG components in this scan */ - jpeg_component_info * cur_comp_info[MAX_COMPS_IN_SCAN]; - /* *cur_comp_info[i] describes component that appears i'th in SOS */ - - JDIMENSION MCUs_per_row; /* # of MCUs across the image */ - JDIMENSION MCU_rows_in_scan; /* # of MCU rows in the image */ - - int blocks_in_MCU; /* # of DCT blocks per MCU */ - int MCU_membership[C_MAX_BLOCKS_IN_MCU]; - /* MCU_membership[i] is index in cur_comp_info of component owning */ - /* i'th block in an MCU */ - - int Ss, Se, Ah, Al; /* progressive JPEG parameters for scan */ - - /* - * Links to compression subobjects (methods and private variables of modules) - */ - struct jpeg_comp_master * master; - struct jpeg_c_main_controller * main; - struct jpeg_c_prep_controller * prep; - struct jpeg_c_coef_controller * coef; - struct jpeg_marker_writer * marker; - struct jpeg_color_converter * cconvert; - struct jpeg_downsampler * downsample; - struct jpeg_forward_dct * fdct; - struct jpeg_entropy_encoder * entropy; - jpeg_scan_info * script_space; /* workspace for jpeg_simple_progression */ - int script_space_size; -}; - - -/* Master record for a decompression instance */ - -struct jpeg_decompress_struct { - jpeg_common_fields; /* Fields shared with jpeg_compress_struct */ - - /* Source of compressed data */ - struct jpeg_source_mgr * src; - - /* Basic description of image --- filled in by jpeg_read_header(). */ - /* Application may inspect these values to decide how to process image. */ - - JDIMENSION image_width; /* nominal image width (from SOF marker) */ - JDIMENSION image_height; /* nominal image height */ - int num_components; /* # of color components in JPEG image */ - J_COLOR_SPACE jpeg_color_space; /* colorspace of JPEG image */ - - /* Decompression processing parameters --- these fields must be set before - * calling jpeg_start_decompress(). Note that jpeg_read_header() initializes - * them to default values. - */ - - J_COLOR_SPACE out_color_space; /* colorspace for output */ - - unsigned int scale_num, scale_denom; /* fraction by which to scale image */ - - double output_gamma; /* image gamma wanted in output */ - - wxjpeg_boolean buffered_image; /* TRUE=multiple output passes */ - wxjpeg_boolean raw_data_out; /* TRUE=downsampled data wanted */ - - J_DCT_METHOD dct_method; /* IDCT algorithm selector */ - wxjpeg_boolean do_fancy_upsampling; /* TRUE=apply fancy upsampling */ - wxjpeg_boolean do_block_smoothing; /* TRUE=apply interblock smoothing */ - - wxjpeg_boolean quantize_colors; /* TRUE=colormapped output wanted */ - /* the following are ignored if not quantize_colors: */ - J_DITHER_MODE dither_mode; /* type of color dithering to use */ - wxjpeg_boolean two_pass_quantize; /* TRUE=use two-pass color quantization */ - int desired_number_of_colors; /* max # colors to use in created colormap */ - /* these are significant only in buffered-image mode: */ - wxjpeg_boolean enable_1pass_quant; /* enable future use of 1-pass quantizer */ - wxjpeg_boolean enable_external_quant;/* enable future use of external colormap */ - wxjpeg_boolean enable_2pass_quant; /* enable future use of 2-pass quantizer */ - - /* Description of actual output image that will be returned to application. - * These fields are computed by jpeg_start_decompress(). - * You can also use jpeg_calc_output_dimensions() to determine these values - * in advance of calling jpeg_start_decompress(). - */ - - JDIMENSION output_width; /* scaled image width */ - JDIMENSION output_height; /* scaled image height */ - int out_color_components; /* # of color components in out_color_space */ - int output_components; /* # of color components returned */ - /* output_components is 1 (a colormap index) when quantizing colors; - * otherwise it equals out_color_components. - */ - int rec_outbuf_height; /* min recommended height of scanline buffer */ - /* If the buffer passed to jpeg_read_scanlines() is less than this many rows - * high, space and time will be wasted due to unnecessary data copying. - * Usually rec_outbuf_height will be 1 or 2, at most 4. - */ - - /* When quantizing colors, the output colormap is described by these fields. - * The application can supply a colormap by setting colormap non-NULL before - * calling jpeg_start_decompress; otherwise a colormap is created during - * jpeg_start_decompress or jpeg_start_output. - * The map has out_color_components rows and actual_number_of_colors columns. - */ - int actual_number_of_colors; /* number of entries in use */ - JSAMPARRAY colormap; /* The color map as a 2-D pixel array */ - - /* State variables: these variables indicate the progress of decompression. - * The application may examine these but must not modify them. - */ - - /* Row index of next scanline to be read from jpeg_read_scanlines(). - * Application may use this to control its processing loop, e.g., - * "while (output_scanline < output_height)". - */ - JDIMENSION output_scanline; /* 0 .. output_height-1 */ - - /* Current input scan number and number of iMCU rows completed in scan. - * These indicate the progress of the decompressor input side. - */ - int input_scan_number; /* Number of SOS markers seen so far */ - JDIMENSION input_iMCU_row; /* Number of iMCU rows completed */ - - /* The "output scan number" is the notional scan being displayed by the - * output side. The decompressor will not allow output scan/row number - * to get ahead of input scan/row, but it can fall arbitrarily far behind. - */ - int output_scan_number; /* Nominal scan number being displayed */ - JDIMENSION output_iMCU_row; /* Number of iMCU rows read */ - - /* Current progression status. coef_bits[c][i] indicates the precision - * with which component c's DCT coefficient i (in zigzag order) is known. - * It is -1 when no data has yet been received, otherwise it is the point - * transform (shift) value for the most recent scan of the coefficient - * (thus, 0 at completion of the progression). - * This pointer is NULL when reading a non-progressive file. - */ - int (*coef_bits)[DCTSIZE2]; /* -1 or current Al value for each coef */ - - /* Internal JPEG parameters --- the application usually need not look at - * these fields. Note that the decompressor output side may not use - * any parameters that can change between scans. - */ - - /* Quantization and Huffman tables are carried forward across input - * datastreams when processing abbreviated JPEG datastreams. - */ - - JQUANT_TBL * quant_tbl_ptrs[NUM_QUANT_TBLS]; - /* ptrs to coefficient quantization tables, or NULL if not defined */ - - JHUFF_TBL * dc_huff_tbl_ptrs[NUM_HUFF_TBLS]; - JHUFF_TBL * ac_huff_tbl_ptrs[NUM_HUFF_TBLS]; - /* ptrs to Huffman coding tables, or NULL if not defined */ - - /* These parameters are never carried across datastreams, since they - * are given in SOF/SOS markers or defined to be reset by SOI. - */ - - int data_precision; /* bits of precision in image data */ - - jpeg_component_info * comp_info; - /* comp_info[i] describes component that appears i'th in SOF */ - - wxjpeg_boolean progressive_mode; /* TRUE if SOFn specifies progressive mode */ - wxjpeg_boolean arith_code; /* TRUE=arithmetic coding, FALSE=Huffman */ - - UINT8 arith_dc_L[NUM_ARITH_TBLS]; /* L values for DC arith-coding tables */ - UINT8 arith_dc_U[NUM_ARITH_TBLS]; /* U values for DC arith-coding tables */ - UINT8 arith_ac_K[NUM_ARITH_TBLS]; /* Kx values for AC arith-coding tables */ - - unsigned int restart_interval; /* MCUs per restart interval, or 0 for no restart */ - - /* These fields record data obtained from optional markers recognized by - * the JPEG library. - */ - wxjpeg_boolean saw_JFIF_marker; /* TRUE iff a JFIF APP0 marker was found */ - /* Data copied from JFIF marker; only valid if saw_JFIF_marker is TRUE: */ - UINT8 JFIF_major_version; /* JFIF version number */ - UINT8 JFIF_minor_version; - UINT8 density_unit; /* JFIF code for pixel size units */ - UINT16 X_density; /* Horizontal pixel density */ - UINT16 Y_density; /* Vertical pixel density */ - wxjpeg_boolean saw_Adobe_marker; /* TRUE iff an Adobe APP14 marker was found */ - UINT8 Adobe_transform; /* Color transform code from Adobe marker */ - - wxjpeg_boolean CCIR601_sampling; /* TRUE=first samples are cosited */ - - /* Aside from the specific data retained from APPn markers known to the - * library, the uninterpreted contents of any or all APPn and COM markers - * can be saved in a list for examination by the application. - */ - jpeg_saved_marker_ptr marker_list; /* Head of list of saved markers */ - - /* Remaining fields are known throughout decompressor, but generally - * should not be touched by a surrounding application. - */ - - /* - * These fields are computed during decompression startup - */ - int max_h_samp_factor; /* largest h_samp_factor */ - int max_v_samp_factor; /* largest v_samp_factor */ - - int min_DCT_scaled_size; /* smallest DCT_scaled_size of any component */ - - JDIMENSION total_iMCU_rows; /* # of iMCU rows in image */ - /* The coefficient controller's input and output progress is measured in - * units of "iMCU" (interleaved MCU) rows. These are the same as MCU rows - * in fully interleaved JPEG scans, but are used whether the scan is - * interleaved or not. We define an iMCU row as v_samp_factor DCT block - * rows of each component. Therefore, the IDCT output contains - * v_samp_factor*DCT_scaled_size sample rows of a component per iMCU row. - */ - - JSAMPLE * sample_range_limit; /* table for fast range-limiting */ - - /* - * These fields are valid during any one scan. - * They describe the components and MCUs actually appearing in the scan. - * Note that the decompressor output side must not use these fields. - */ - int comps_in_scan; /* # of JPEG components in this scan */ - jpeg_component_info * cur_comp_info[MAX_COMPS_IN_SCAN]; - /* *cur_comp_info[i] describes component that appears i'th in SOS */ - - JDIMENSION MCUs_per_row; /* # of MCUs across the image */ - JDIMENSION MCU_rows_in_scan; /* # of MCU rows in the image */ - - int blocks_in_MCU; /* # of DCT blocks per MCU */ - int MCU_membership[D_MAX_BLOCKS_IN_MCU]; - /* MCU_membership[i] is index in cur_comp_info of component owning */ - /* i'th block in an MCU */ - - int Ss, Se, Ah, Al; /* progressive JPEG parameters for scan */ - - /* This field is shared between entropy decoder and marker parser. - * It is either zero or the code of a JPEG marker that has been - * read from the data source, but has not yet been processed. - */ - int unread_marker; - - /* - * Links to decompression subobjects (methods, private variables of modules) - */ - struct jpeg_decomp_master * master; - struct jpeg_d_main_controller * main; - struct jpeg_d_coef_controller * coef; - struct jpeg_d_post_controller * post; - struct jpeg_input_controller * inputctl; - struct jpeg_marker_reader * marker; - struct jpeg_entropy_decoder * entropy; - struct jpeg_inverse_dct * idct; - struct jpeg_upsampler * upsample; - struct jpeg_color_deconverter * cconvert; - struct jpeg_color_quantizer * cquantize; -}; - - -/* "Object" declarations for JPEG modules that may be supplied or called - * directly by the surrounding application. - * As with all objects in the JPEG library, these structs only define the - * publicly visible methods and state variables of a module. Additional - * private fields may exist after the public ones. - */ - - -/* Error handler object */ - -struct jpeg_error_mgr { - /* Error exit handler: does not return to caller */ - JMETHOD(void, error_exit, (j_common_ptr cinfo)); - /* Conditionally emit a trace or warning message */ - JMETHOD(void, emit_message, (j_common_ptr cinfo, int msg_level)); - /* Routine that actually outputs a trace or error message */ - JMETHOD(void, output_message, (j_common_ptr cinfo)); - /* Format a message string for the most recent JPEG error or message */ - JMETHOD(void, format_message, (j_common_ptr cinfo, char * buffer)); -#define JMSG_LENGTH_MAX 200 /* recommended size of format_message buffer */ - /* Reset error state variables at start of a new image */ - JMETHOD(void, reset_error_mgr, (j_common_ptr cinfo)); - - /* The message ID code and any parameters are saved here. - * A message can have one string parameter or up to 8 int parameters. - */ - int msg_code; -#define JMSG_STR_PARM_MAX 80 - union { - int i[8]; - char s[JMSG_STR_PARM_MAX]; - } msg_parm; - - /* Standard state variables for error facility */ - - int trace_level; /* max msg_level that will be displayed */ - - /* For recoverable corrupt-data errors, we emit a warning message, - * but keep going unless emit_message chooses to abort. emit_message - * should count warnings in num_warnings. The surrounding application - * can check for bad data by seeing if num_warnings is nonzero at the - * end of processing. - */ - long num_warnings; /* number of corrupt-data warnings */ - - /* These fields point to the table(s) of error message strings. - * An application can change the table pointer to switch to a different - * message list (typically, to change the language in which errors are - * reported). Some applications may wish to add additional error codes - * that will be handled by the JPEG library error mechanism; the second - * table pointer is used for this purpose. - * - * First table includes all errors generated by JPEG library itself. - * Error code 0 is reserved for a "no such error string" message. - */ - const char * const * jpeg_message_table; /* Library errors */ - int last_jpeg_message; /* Table contains strings 0..last_jpeg_message */ - /* Second table can be added by application (see cjpeg/djpeg for example). - * It contains strings numbered first_addon_message..last_addon_message. - */ - const char * const * addon_message_table; /* Non-library errors */ - int first_addon_message; /* code for first string in addon table */ - int last_addon_message; /* code for last string in addon table */ -}; - - -/* Progress monitor object */ - -struct jpeg_progress_mgr { - JMETHOD(void, progress_monitor, (j_common_ptr cinfo)); - - long pass_counter; /* work units completed in this pass */ - long pass_limit; /* total number of work units in this pass */ - int completed_passes; /* passes completed so far */ - int total_passes; /* total number of passes expected */ -}; - - -/* Data destination object for compression */ - -struct jpeg_destination_mgr { - JOCTET * next_output_byte; /* => next byte to write in buffer */ - size_t free_in_buffer; /* # of byte spaces remaining in buffer */ - - JMETHOD(void, init_destination, (j_compress_ptr cinfo)); - JMETHOD(wxjpeg_boolean, empty_output_buffer, (j_compress_ptr cinfo)); - JMETHOD(void, term_destination, (j_compress_ptr cinfo)); -}; - - -/* Data source object for decompression */ - -struct jpeg_source_mgr { - const JOCTET * next_input_byte; /* => next byte to read from buffer */ - size_t bytes_in_buffer; /* # of bytes remaining in buffer */ - - JMETHOD(void, init_source, (j_decompress_ptr cinfo)); - JMETHOD(wxjpeg_boolean, fill_input_buffer, (j_decompress_ptr cinfo)); - JMETHOD(void, skip_input_data, (j_decompress_ptr cinfo, long num_bytes)); - JMETHOD(wxjpeg_boolean, resync_to_restart, (j_decompress_ptr cinfo, int desired)); - JMETHOD(void, term_source, (j_decompress_ptr cinfo)); -}; - - -/* Memory manager object. - * Allocates "small" objects (a few K total), "large" objects (tens of K), - * and "really big" objects (virtual arrays with backing store if needed). - * The memory manager does not allow individual objects to be freed; rather, - * each created object is assigned to a pool, and whole pools can be freed - * at once. This is faster and more convenient than remembering exactly what - * to free, especially where malloc()/free() are not too speedy. - * NB: alloc routines never return NULL. They exit to error_exit if not - * successful. - */ - -#define JPOOL_PERMANENT 0 /* lasts until master record is destroyed */ -#define JPOOL_IMAGE 1 /* lasts until done with image/datastream */ -#define JPOOL_NUMPOOLS 2 - -typedef struct jvirt_sarray_control * jvirt_sarray_ptr; -typedef struct jvirt_barray_control * jvirt_barray_ptr; - - -struct jpeg_memory_mgr { - /* Method pointers */ - JMETHOD(void *, alloc_small, (j_common_ptr cinfo, int pool_id, - size_t sizeofobject)); - JMETHOD(void FAR *, alloc_large, (j_common_ptr cinfo, int pool_id, - size_t sizeofobject)); - JMETHOD(JSAMPARRAY, alloc_sarray, (j_common_ptr cinfo, int pool_id, - JDIMENSION samplesperrow, - JDIMENSION numrows)); - JMETHOD(JBLOCKARRAY, alloc_barray, (j_common_ptr cinfo, int pool_id, - JDIMENSION blocksperrow, - JDIMENSION numrows)); - JMETHOD(jvirt_sarray_ptr, request_virt_sarray, (j_common_ptr cinfo, - int pool_id, - wxjpeg_boolean pre_zero, - JDIMENSION samplesperrow, - JDIMENSION numrows, - JDIMENSION maxaccess)); - JMETHOD(jvirt_barray_ptr, request_virt_barray, (j_common_ptr cinfo, - int pool_id, - wxjpeg_boolean pre_zero, - JDIMENSION blocksperrow, - JDIMENSION numrows, - JDIMENSION maxaccess)); - JMETHOD(void, realize_virt_arrays, (j_common_ptr cinfo)); - JMETHOD(JSAMPARRAY, access_virt_sarray, (j_common_ptr cinfo, - jvirt_sarray_ptr ptr, - JDIMENSION start_row, - JDIMENSION num_rows, - wxjpeg_boolean writable)); - JMETHOD(JBLOCKARRAY, access_virt_barray, (j_common_ptr cinfo, - jvirt_barray_ptr ptr, - JDIMENSION start_row, - JDIMENSION num_rows, - wxjpeg_boolean writable)); - JMETHOD(void, free_pool, (j_common_ptr cinfo, int pool_id)); - JMETHOD(void, self_destruct, (j_common_ptr cinfo)); - - /* Limit on memory allocation for this JPEG object. (Note that this is - * merely advisory, not a guaranteed maximum; it only affects the space - * used for virtual-array buffers.) May be changed by outer application - * after creating the JPEG object. - */ - long max_memory_to_use; - - /* Maximum allocation request accepted by alloc_large. */ - long max_alloc_chunk; -}; - - -/* Routine signature for application-supplied marker processing methods. - * Need not pass marker code since it is stored in cinfo->unread_marker. - */ -typedef JMETHOD(wxjpeg_boolean, jpeg_marker_parser_method, (j_decompress_ptr cinfo)); - - -/* Declarations for routines called by application. - * The JPP macro hides prototype parameters from compilers that can't cope. - * Note JPP requires double parentheses. - */ - -#ifdef HAVE_PROTOTYPES -#define JPP(arglist) arglist -#else -#define JPP(arglist) () -#endif - - -/* Short forms of external names for systems with brain-damaged linkers. - * We shorten external names to be unique in the first six letters, which - * is good enough for all known systems. - * (If your compiler itself needs names to be unique in less than 15 - * characters, you are out of luck. Get a better compiler.) - */ - -#ifdef NEED_SHORT_EXTERNAL_NAMES -#define jpeg_std_error jStdError -#define jpeg_CreateCompress jCreaCompress -#define jpeg_CreateDecompress jCreaDecompress -#define jpeg_destroy_compress jDestCompress -#define jpeg_destroy_decompress jDestDecompress -#define jpeg_stdio_dest jStdDest -#define jpeg_stdio_src jStdSrc -#define jpeg_set_defaults jSetDefaults -#define jpeg_set_colorspace jSetColorspace -#define jpeg_default_colorspace jDefColorspace -#define jpeg_set_quality jSetQuality -#define jpeg_set_linear_quality jSetLQuality -#define jpeg_add_quant_table jAddQuantTable -#define jpeg_quality_scaling jQualityScaling -#define jpeg_simple_progression jSimProgress -#define jpeg_suppress_tables jSuppressTables -#define jpeg_alloc_quant_table jAlcQTable -#define jpeg_alloc_huff_table jAlcHTable -#define jpeg_start_compress jStrtCompress -#define jpeg_write_scanlines jWrtScanlines -#define jpeg_finish_compress jFinCompress -#define jpeg_write_raw_data jWrtRawData -#define jpeg_write_marker jWrtMarker -#define jpeg_write_m_header jWrtMHeader -#define jpeg_write_m_byte jWrtMByte -#define jpeg_write_tables jWrtTables -#define jpeg_read_header jReadHeader -#define jpeg_start_decompress jStrtDecompress -#define jpeg_read_scanlines jReadScanlines -#define jpeg_finish_decompress jFinDecompress -#define jpeg_read_raw_data jReadRawData -#define jpeg_has_multiple_scans jHasMultScn -#define jpeg_start_output jStrtOutput -#define jpeg_finish_output jFinOutput -#define jpeg_input_complete jInComplete -#define jpeg_new_colormap jNewCMap -#define jpeg_consume_input jConsumeInput -#define jpeg_calc_output_dimensions jCalcDimensions -#define jpeg_save_markers jSaveMarkers -#define jpeg_set_marker_processor jSetMarker -#define jpeg_read_coefficients jReadCoefs -#define jpeg_write_coefficients jWrtCoefs -#define jpeg_copy_critical_parameters jCopyCrit -#define jpeg_abort_compress jAbrtCompress -#define jpeg_abort_decompress jAbrtDecompress -#define jpeg_abort jAbort -#define jpeg_destroy jDestroy -#define jpeg_resync_to_restart jResyncRestart -#endif /* NEED_SHORT_EXTERNAL_NAMES */ - - -/* Default error-management setup */ -EXTERN(struct jpeg_error_mgr *) jpeg_std_error - JPP((struct jpeg_error_mgr * err)); - -/* Initialization of JPEG compression objects. - * jpeg_create_compress() and jpeg_create_decompress() are the exported - * names that applications should call. These expand to calls on - * jpeg_CreateCompress and jpeg_CreateDecompress with additional information - * passed for version mismatch checking. - * NB: you must set up the error-manager BEFORE calling jpeg_create_xxx. - */ -#define jpeg_create_compress(cinfo) \ - jpeg_CreateCompress((cinfo), JPEG_LIB_VERSION, \ - (size_t) sizeof(struct jpeg_compress_struct)) -#define jpeg_create_decompress(cinfo) \ - jpeg_CreateDecompress((cinfo), JPEG_LIB_VERSION, \ - (size_t) sizeof(struct jpeg_decompress_struct)) -EXTERN(void) jpeg_CreateCompress JPP((j_compress_ptr cinfo, - int version, size_t structsize)); -EXTERN(void) jpeg_CreateDecompress JPP((j_decompress_ptr cinfo, - int version, size_t structsize)); -/* Destruction of JPEG compression objects */ -EXTERN(void) jpeg_destroy_compress JPP((j_compress_ptr cinfo)); -EXTERN(void) jpeg_destroy_decompress JPP((j_decompress_ptr cinfo)); - -/* Standard data source and destination managers: stdio streams. */ -/* Caller is responsible for opening the file before and closing after. */ -EXTERN(void) jpeg_stdio_dest JPP((j_compress_ptr cinfo, FILE * outfile)); -EXTERN(void) jpeg_stdio_src JPP((j_decompress_ptr cinfo, FILE * infile)); - -/* Default parameter setup for compression */ -EXTERN(void) jpeg_set_defaults JPP((j_compress_ptr cinfo)); -/* Compression parameter setup aids */ -EXTERN(void) jpeg_set_colorspace JPP((j_compress_ptr cinfo, - J_COLOR_SPACE colorspace)); -EXTERN(void) jpeg_default_colorspace JPP((j_compress_ptr cinfo)); -EXTERN(void) jpeg_set_quality JPP((j_compress_ptr cinfo, int quality, - wxjpeg_boolean force_baseline)); -EXTERN(void) jpeg_set_linear_quality JPP((j_compress_ptr cinfo, - int scale_factor, - wxjpeg_boolean force_baseline)); -EXTERN(void) jpeg_add_quant_table JPP((j_compress_ptr cinfo, int which_tbl, - const unsigned int *basic_table, - int scale_factor, - wxjpeg_boolean force_baseline)); -EXTERN(int) jpeg_quality_scaling JPP((int quality)); -EXTERN(void) jpeg_simple_progression JPP((j_compress_ptr cinfo)); -EXTERN(void) jpeg_suppress_tables JPP((j_compress_ptr cinfo, - wxjpeg_boolean suppress)); -EXTERN(JQUANT_TBL *) jpeg_alloc_quant_table JPP((j_common_ptr cinfo)); -EXTERN(JHUFF_TBL *) jpeg_alloc_huff_table JPP((j_common_ptr cinfo)); - -/* Main entry points for compression */ -EXTERN(void) jpeg_start_compress JPP((j_compress_ptr cinfo, - wxjpeg_boolean write_all_tables)); -EXTERN(JDIMENSION) jpeg_write_scanlines JPP((j_compress_ptr cinfo, - JSAMPARRAY scanlines, - JDIMENSION num_lines)); -EXTERN(void) jpeg_finish_compress JPP((j_compress_ptr cinfo)); - -/* Replaces jpeg_write_scanlines when writing raw downsampled data. */ -EXTERN(JDIMENSION) jpeg_write_raw_data JPP((j_compress_ptr cinfo, - JSAMPIMAGE data, - JDIMENSION num_lines)); - -/* Write a special marker. See libjpeg.doc concerning safe usage. */ -EXTERN(void) jpeg_write_marker - JPP((j_compress_ptr cinfo, int marker, - const JOCTET * dataptr, unsigned int datalen)); -/* Same, but piecemeal. */ -EXTERN(void) jpeg_write_m_header - JPP((j_compress_ptr cinfo, int marker, unsigned int datalen)); -EXTERN(void) jpeg_write_m_byte - JPP((j_compress_ptr cinfo, int val)); - -/* Alternate compression function: just write an abbreviated table file */ -EXTERN(void) jpeg_write_tables JPP((j_compress_ptr cinfo)); - -/* Decompression startup: read start of JPEG datastream to see what's there */ -EXTERN(int) jpeg_read_header JPP((j_decompress_ptr cinfo, - wxjpeg_boolean require_image)); -/* Return value is one of: */ -#define JPEG_SUSPENDED 0 /* Suspended due to lack of input data */ -#define JPEG_HEADER_OK 1 /* Found valid image datastream */ -#define JPEG_HEADER_TABLES_ONLY 2 /* Found valid table-specs-only datastream */ -/* If you pass require_image = TRUE (normal case), you need not check for - * a TABLES_ONLY return code; an abbreviated file will cause an error exit. - * JPEG_SUSPENDED is only possible if you use a data source module that can - * give a suspension return (the stdio source module doesn't). - */ - -/* Main entry points for decompression */ -EXTERN(wxjpeg_boolean) jpeg_start_decompress JPP((j_decompress_ptr cinfo)); -EXTERN(JDIMENSION) jpeg_read_scanlines JPP((j_decompress_ptr cinfo, - JSAMPARRAY scanlines, - JDIMENSION max_lines)); -EXTERN(wxjpeg_boolean) jpeg_finish_decompress JPP((j_decompress_ptr cinfo)); - -/* Replaces jpeg_read_scanlines when reading raw downsampled data. */ -EXTERN(JDIMENSION) jpeg_read_raw_data JPP((j_decompress_ptr cinfo, - JSAMPIMAGE data, - JDIMENSION max_lines)); - -/* Additional entry points for buffered-image mode. */ -EXTERN(wxjpeg_boolean) jpeg_has_multiple_scans JPP((j_decompress_ptr cinfo)); -EXTERN(wxjpeg_boolean) jpeg_start_output JPP((j_decompress_ptr cinfo, - int scan_number)); -EXTERN(wxjpeg_boolean) jpeg_finish_output JPP((j_decompress_ptr cinfo)); -EXTERN(wxjpeg_boolean) jpeg_input_complete JPP((j_decompress_ptr cinfo)); -EXTERN(void) jpeg_new_colormap JPP((j_decompress_ptr cinfo)); -EXTERN(int) jpeg_consume_input JPP((j_decompress_ptr cinfo)); -/* Return value is one of: */ -/* #define JPEG_SUSPENDED 0 Suspended due to lack of input data */ -#define JPEG_REACHED_SOS 1 /* Reached start of new scan */ -#define JPEG_REACHED_EOI 2 /* Reached end of image */ -#define JPEG_ROW_COMPLETED 3 /* Completed one iMCU row */ -#define JPEG_SCAN_COMPLETED 4 /* Completed last iMCU row of a scan */ - -/* Precalculate output dimensions for current decompression parameters. */ -EXTERN(void) jpeg_calc_output_dimensions JPP((j_decompress_ptr cinfo)); - -/* Control saving of COM and APPn markers into marker_list. */ -EXTERN(void) jpeg_save_markers - JPP((j_decompress_ptr cinfo, int marker_code, - unsigned int length_limit)); - -/* Install a special processing method for COM or APPn markers. */ -EXTERN(void) jpeg_set_marker_processor - JPP((j_decompress_ptr cinfo, int marker_code, - jpeg_marker_parser_method routine)); - -/* Read or write raw DCT coefficients --- useful for lossless transcoding. */ -EXTERN(jvirt_barray_ptr *) jpeg_read_coefficients JPP((j_decompress_ptr cinfo)); -EXTERN(void) jpeg_write_coefficients JPP((j_compress_ptr cinfo, - jvirt_barray_ptr * coef_arrays)); -EXTERN(void) jpeg_copy_critical_parameters JPP((j_decompress_ptr srcinfo, - j_compress_ptr dstinfo)); - -/* If you choose to abort compression or decompression before completing - * jpeg_finish_(de)compress, then you need to clean up to release memory, - * temporary files, etc. You can just call jpeg_destroy_(de)compress - * if you're done with the JPEG object, but if you want to clean it up and - * reuse it, call this: - */ -EXTERN(void) jpeg_abort_compress JPP((j_compress_ptr cinfo)); -EXTERN(void) jpeg_abort_decompress JPP((j_decompress_ptr cinfo)); - -/* Generic versions of jpeg_abort and jpeg_destroy that work on either - * flavor of JPEG object. These may be more convenient in some places. - */ -EXTERN(void) jpeg_abort JPP((j_common_ptr cinfo)); -EXTERN(void) jpeg_destroy JPP((j_common_ptr cinfo)); - -/* Default restart-marker-resync procedure for use by data source modules */ -EXTERN(wxjpeg_boolean) jpeg_resync_to_restart JPP((j_decompress_ptr cinfo, - int desired)); - - -/* These marker codes are exported since applications and data source modules - * are likely to want to use them. - */ - -#define JPEG_RST0 0xD0 /* RST0 marker code */ -#define JPEG_EOI 0xD9 /* EOI marker code */ -#define JPEG_APP0 0xE0 /* APP0 marker code */ -#define JPEG_COM 0xFE /* COM marker code */ - - -/* If we have a brain-damaged compiler that emits warnings (or worse, errors) - * for structure definitions that are never filled in, keep it quiet by - * supplying dummy definitions for the various substructures. - */ - -#ifdef INCOMPLETE_TYPES_BROKEN -#ifndef JPEG_INTERNALS /* will be defined in jpegint.h */ -struct jvirt_sarray_control { long dummy; }; -struct jvirt_barray_control { long dummy; }; -struct jpeg_comp_master { long dummy; }; -struct jpeg_c_main_controller { long dummy; }; -struct jpeg_c_prep_controller { long dummy; }; -struct jpeg_c_coef_controller { long dummy; }; -struct jpeg_marker_writer { long dummy; }; -struct jpeg_color_converter { long dummy; }; -struct jpeg_downsampler { long dummy; }; -struct jpeg_forward_dct { long dummy; }; -struct jpeg_entropy_encoder { long dummy; }; -struct jpeg_decomp_master { long dummy; }; -struct jpeg_d_main_controller { long dummy; }; -struct jpeg_d_coef_controller { long dummy; }; -struct jpeg_d_post_controller { long dummy; }; -struct jpeg_input_controller { long dummy; }; -struct jpeg_marker_reader { long dummy; }; -struct jpeg_entropy_decoder { long dummy; }; -struct jpeg_inverse_dct { long dummy; }; -struct jpeg_upsampler { long dummy; }; -struct jpeg_color_deconverter { long dummy; }; -struct jpeg_color_quantizer { long dummy; }; -#endif /* JPEG_INTERNALS */ -#endif /* INCOMPLETE_TYPES_BROKEN */ - - -/* - * The JPEG library modules define JPEG_INTERNALS before including this file. - * The internal structure declarations are read only when that is true. - * Applications using the library should not include jpegint.h, but may wish - * to include jerror.h. - */ - -#ifdef JPEG_INTERNALS -#include "jpegint.h" /* fetch private declarations */ -#include "jerror.h" /* fetch error codes too */ -#endif - -#endif /* JPEGLIB_H */ diff --git a/wxWidgets/src/jpeg/jpegtran.1 b/wxWidgets/src/jpeg/jpegtran.1 deleted file mode 100644 index 6de18e2af9..0000000000 --- a/wxWidgets/src/jpeg/jpegtran.1 +++ /dev/null @@ -1,238 +0,0 @@ -.TH JPEGTRAN 1 "3 August 1997" -.SH NAME -jpegtran \- lossless transformation of JPEG files -.SH SYNOPSIS -.B jpegtran -[ -.I options -] -[ -.I filename -] -.LP -.SH DESCRIPTION -.LP -.B jpegtran -performs various useful transformations of JPEG files. -It can translate the coded representation from one variant of JPEG to another, -for example from baseline JPEG to progressive JPEG or vice versa. It can also -perform some rearrangements of the image data, for example turning an image -from landscape to portrait format by rotation. -.PP -.B jpegtran -works by rearranging the compressed data (DCT coefficients), without -ever fully decoding the image. Therefore, its transformations are lossless: -there is no image degradation at all, which would not be true if you used -.B djpeg -followed by -.B cjpeg -to accomplish the same conversion. But by the same token, -.B jpegtran -cannot perform lossy operations such as changing the image quality. -.PP -.B jpegtran -reads the named JPEG/JFIF file, or the standard input if no file is -named, and produces a JPEG/JFIF file on the standard output. -.SH OPTIONS -All switch names may be abbreviated; for example, -.B \-optimize -may be written -.B \-opt -or -.BR \-o . -Upper and lower case are equivalent. -British spellings are also accepted (e.g., -.BR \-optimise ), -though for brevity these are not mentioned below. -.PP -To specify the coded JPEG representation used in the output file, -.B jpegtran -accepts a subset of the switches recognized by -.BR cjpeg : -.TP -.B \-optimize -Perform optimization of entropy encoding parameters. -.TP -.B \-progressive -Create progressive JPEG file. -.TP -.BI \-restart " N" -Emit a JPEG restart marker every N MCU rows, or every N MCU blocks if "B" is -attached to the number. -.TP -.BI \-scans " file" -Use the scan script given in the specified text file. -.PP -See -.BR cjpeg (1) -for more details about these switches. -If you specify none of these switches, you get a plain baseline-JPEG output -file. The quality setting and so forth are determined by the input file. -.PP -The image can be losslessly transformed by giving one of these switches: -.TP -.B \-flip horizontal -Mirror image horizontally (left-right). -.TP -.B \-flip vertical -Mirror image vertically (top-bottom). -.TP -.B \-rotate 90 -Rotate image 90 degrees clockwise. -.TP -.B \-rotate 180 -Rotate image 180 degrees. -.TP -.B \-rotate 270 -Rotate image 270 degrees clockwise (or 90 ccw). -.TP -.B \-transpose -Transpose image (across UL-to-LR axis). -.TP -.B \-transverse -Transverse transpose (across UR-to-LL axis). -.PP -The transpose transformation has no restrictions regarding image dimensions. -The other transformations operate rather oddly if the image dimensions are not -a multiple of the iMCU size (usually 8 or 16 pixels), because they can only -transform complete blocks of DCT coefficient data in the desired way. -.PP -.BR jpegtran 's -default behavior when transforming an odd-size image is designed -to preserve exact reversibility and mathematical consistency of the -transformation set. As stated, transpose is able to flip the entire image -area. Horizontal mirroring leaves any partial iMCU column at the right edge -untouched, but is able to flip all rows of the image. Similarly, vertical -mirroring leaves any partial iMCU row at the bottom edge untouched, but is -able to flip all columns. The other transforms can be built up as sequences -of transpose and flip operations; for consistency, their actions on edge -pixels are defined to be the same as the end result of the corresponding -transpose-and-flip sequence. -.PP -For practical use, you may prefer to discard any untransformable edge pixels -rather than having a strange-looking strip along the right and/or bottom edges -of a transformed image. To do this, add the -.B \-trim -switch: -.TP -.B \-trim -Drop non-transformable edge blocks. -.PP -Obviously, a transformation with -.B \-trim -is not reversible, so strictly speaking -.B jpegtran -with this switch is not lossless. Also, the expected mathematical -equivalences between the transformations no longer hold. For example, -.B \-rot 270 -trim -trims only the bottom edge, but -.B \-rot 90 -trim -followed by -.B \-rot 180 -trim -trims both edges. -.PP -Another not-strictly-lossless transformation switch is: -.TP -.B \-grayscale -Force grayscale output. -.PP -This option discards the chrominance channels if the input image is YCbCr -(ie, a standard color JPEG), resulting in a grayscale JPEG file. The -luminance channel is preserved exactly, so this is a better method of reducing -to grayscale than decompression, conversion, and recompression. This switch -is particularly handy for fixing a monochrome picture that was mistakenly -encoded as a color JPEG. (In such a case, the space savings from getting rid -of the near-empty chroma channels won't be large; but the decoding time for -a grayscale JPEG is substantially less than that for a color JPEG.) -.PP -.B jpegtran -also recognizes these switches that control what to do with "extra" markers, -such as comment blocks: -.TP -.B \-copy none -Copy no extra markers from source file. This setting suppresses all -comments and other excess baggage present in the source file. -.TP -.B \-copy comments -Copy only comment markers. This setting copies comments from the source file, -but discards any other inessential data. -.TP -.B \-copy all -Copy all extra markers. This setting preserves miscellaneous markers -found in the source file, such as JFIF thumbnails and Photoshop settings. -In some files these extra markers can be sizable. -.PP -The default behavior is -.BR "\-copy comments" . -(Note: in IJG releases v6 and v6a, -.B jpegtran -always did the equivalent of -.BR "\-copy none" .) -.PP -Additional switches recognized by jpegtran are: -.TP -.BI \-maxmemory " N" -Set limit for amount of memory to use in processing large images. Value is -in thousands of bytes, or millions of bytes if "M" is attached to the -number. For example, -.B \-max 4m -selects 4000000 bytes. If more space is needed, temporary files will be used. -.TP -.BI \-outfile " name" -Send output image to the named file, not to standard output. -.TP -.B \-verbose -Enable debug printout. More -.BR \-v 's -give more output. Also, version information is printed at startup. -.TP -.B \-debug -Same as -.BR \-verbose . -.SH EXAMPLES -.LP -This example converts a baseline JPEG file to progressive form: -.IP -.B jpegtran \-progressive -.I foo.jpg -.B > -.I fooprog.jpg -.PP -This example rotates an image 90 degrees clockwise, discarding any -unrotatable edge pixels: -.IP -.B jpegtran \-rot 90 -trim -.I foo.jpg -.B > -.I foo90.jpg -.SH ENVIRONMENT -.TP -.B JPEGMEM -If this environment variable is set, its value is the default memory limit. -The value is specified as described for the -.B \-maxmemory -switch. -.B JPEGMEM -overrides the default value specified when the program was compiled, and -itself is overridden by an explicit -.BR \-maxmemory . -.SH SEE ALSO -.BR cjpeg (1), -.BR djpeg (1), -.BR rdjpgcom (1), -.BR wrjpgcom (1) -.br -Wallace, Gregory K. "The JPEG Still Picture Compression Standard", -Communications of the ACM, April 1991 (vol. 34, no. 4), pp. 30-44. -.SH AUTHOR -Independent JPEG Group -.SH BUGS -Arithmetic coding is not supported for legal reasons. -.PP -The transform options can't transform odd-size images perfectly. Use -.B \-trim -if you don't like the results without it. -.PP -The entire image is read into memory and then written out again, even in -cases where this isn't really necessary. Expect swapping on large images, -especially when using the more complex transform options. diff --git a/wxWidgets/src/jpeg/jpegtran.c b/wxWidgets/src/jpeg/jpegtran.c deleted file mode 100644 index c81a626561..0000000000 --- a/wxWidgets/src/jpeg/jpegtran.c +++ /dev/null @@ -1,504 +0,0 @@ -/* - * jpegtran.c - * - * Copyright (C) 1995-1997, Thomas G. Lane. - * This file is part of the Independent JPEG Group's software. - * For conditions of distribution and use, see the accompanying README file. - * - * This file contains a command-line user interface for JPEG transcoding. - * It is very similar to cjpeg.c, but provides lossless transcoding between - * different JPEG file formats. It also provides some lossless and sort-of- - * lossless transformations of JPEG data. - */ - -#include "cdjpeg.h" /* Common decls for cjpeg/djpeg applications */ -#include "transupp.h" /* Support routines for jpegtran */ -#include "jversion.h" /* for version message */ - -#ifdef USE_CCOMMAND /* command-line reader for Macintosh */ -#ifdef __MWERKS__ -#include /* Metrowerks needs this */ -#include /* ... and this */ -#endif -#ifdef THINK_C -#include /* Think declares it here */ -#endif -#endif - - -/* - * Argument-parsing code. - * The switch parser is designed to be useful with DOS-style command line - * syntax, ie, intermixed switches and file names, where only the switches - * to the left of a given file name affect processing of that file. - * The main program in this file doesn't actually use this capability... - */ - - -static const char * progname; /* program name for error messages */ -static char * outfilename; /* for -outfile switch */ -static JCOPY_OPTION copyoption; /* -copy switch */ -static jpeg_transform_info transformoption; /* image transformation options */ - - -LOCAL(void) -usage (void) -/* complain about bad command line */ -{ - fprintf(stderr, "usage: %s [switches] ", progname); -#ifdef TWO_FILE_COMMANDLINE - fprintf(stderr, "inputfile outputfile\n"); -#else - fprintf(stderr, "[inputfile]\n"); -#endif - - fprintf(stderr, "Switches (names may be abbreviated):\n"); - fprintf(stderr, " -copy none Copy no extra markers from source file\n"); - fprintf(stderr, " -copy comments Copy only comment markers (default)\n"); - fprintf(stderr, " -copy all Copy all extra markers\n"); -#ifdef ENTROPY_OPT_SUPPORTED - fprintf(stderr, " -optimize Optimize Huffman table (smaller file, but slow compression)\n"); -#endif -#ifdef C_PROGRESSIVE_SUPPORTED - fprintf(stderr, " -progressive Create progressive JPEG file\n"); -#endif -#if TRANSFORMS_SUPPORTED - fprintf(stderr, "Switches for modifying the image:\n"); - fprintf(stderr, " -grayscale Reduce to grayscale (omit color data)\n"); - fprintf(stderr, " -flip [horizontal|vertical] Mirror image (left-right or top-bottom)\n"); - fprintf(stderr, " -rotate [90|180|270] Rotate image (degrees clockwise)\n"); - fprintf(stderr, " -transpose Transpose image\n"); - fprintf(stderr, " -transverse Transverse transpose image\n"); - fprintf(stderr, " -trim Drop non-transformable edge blocks\n"); -#endif /* TRANSFORMS_SUPPORTED */ - fprintf(stderr, "Switches for advanced users:\n"); - fprintf(stderr, " -restart N Set restart interval in rows, or in blocks with B\n"); - fprintf(stderr, " -maxmemory N Maximum memory to use (in kbytes)\n"); - fprintf(stderr, " -outfile name Specify name for output file\n"); - fprintf(stderr, " -verbose or -debug Emit debug output\n"); - fprintf(stderr, "Switches for wizards:\n"); -#ifdef C_ARITH_CODING_SUPPORTED - fprintf(stderr, " -arithmetic Use arithmetic coding\n"); -#endif -#ifdef C_MULTISCAN_FILES_SUPPORTED - fprintf(stderr, " -scans file Create multi-scan JPEG per script file\n"); -#endif - exit(EXIT_FAILURE); -} - - -LOCAL(void) -select_transform (JXFORM_CODE transform) -/* Silly little routine to detect multiple transform options, - * which we can't handle. - */ -{ -#if TRANSFORMS_SUPPORTED - if (transformoption.transform == JXFORM_NONE || - transformoption.transform == transform) { - transformoption.transform = transform; - } else { - fprintf(stderr, "%s: can only do one image transformation at a time\n", - progname); - usage(); - } -#else - fprintf(stderr, "%s: sorry, image transformation was not compiled\n", - progname); - exit(EXIT_FAILURE); -#endif -} - - -LOCAL(int) -parse_switches (j_compress_ptr cinfo, int argc, char **argv, - int last_file_arg_seen, wxjpeg_boolean for_real) -/* Parse optional switches. - * Returns argv[] index of first file-name argument (== argc if none). - * Any file names with indexes <= last_file_arg_seen are ignored; - * they have presumably been processed in a previous iteration. - * (Pass 0 for last_file_arg_seen on the first or only iteration.) - * for_real is FALSE on the first (dummy) pass; we may skip any expensive - * processing. - */ -{ - int argn; - char * arg; - wxjpeg_boolean simple_progressive; - char * scansarg = NULL; /* saves -scans parm if any */ - - /* Set up default JPEG parameters. */ - simple_progressive = FALSE; - outfilename = NULL; - copyoption = JCOPYOPT_DEFAULT; - transformoption.transform = JXFORM_NONE; - transformoption.trim = FALSE; - transformoption.force_grayscale = FALSE; - cinfo->err->trace_level = 0; - - /* Scan command line options, adjust parameters */ - - for (argn = 1; argn < argc; argn++) { - arg = argv[argn]; - if (*arg != '-') { - /* Not a switch, must be a file name argument */ - if (argn <= last_file_arg_seen) { - outfilename = NULL; /* -outfile applies to just one input file */ - continue; /* ignore this name if previously processed */ - } - break; /* else done parsing switches */ - } - arg++; /* advance past switch marker character */ - - if (keymatch(arg, "arithmetic", 1)) { - /* Use arithmetic coding. */ -#ifdef C_ARITH_CODING_SUPPORTED - cinfo->arith_code = TRUE; -#else - fprintf(stderr, "%s: sorry, arithmetic coding not supported\n", - progname); - exit(EXIT_FAILURE); -#endif - - } else if (keymatch(arg, "copy", 1)) { - /* Select which extra markers to copy. */ - if (++argn >= argc) /* advance to next argument */ - usage(); - if (keymatch(argv[argn], "none", 1)) { - copyoption = JCOPYOPT_NONE; - } else if (keymatch(argv[argn], "comments", 1)) { - copyoption = JCOPYOPT_COMMENTS; - } else if (keymatch(argv[argn], "all", 1)) { - copyoption = JCOPYOPT_ALL; - } else - usage(); - - } else if (keymatch(arg, "debug", 1) || keymatch(arg, "verbose", 1)) { - /* Enable debug printouts. */ - /* On first -d, print version identification */ - static wxjpeg_boolean printed_version = FALSE; - - if (! printed_version) { - fprintf(stderr, "Independent JPEG Group's JPEGTRAN, version %s\n%s\n", - JVERSION, JCOPYRIGHT); - printed_version = TRUE; - } - cinfo->err->trace_level++; - - } else if (keymatch(arg, "flip", 1)) { - /* Mirror left-right or top-bottom. */ - if (++argn >= argc) /* advance to next argument */ - usage(); - if (keymatch(argv[argn], "horizontal", 1)) - select_transform(JXFORM_FLIP_H); - else if (keymatch(argv[argn], "vertical", 1)) - select_transform(JXFORM_FLIP_V); - else - usage(); - - } else if (keymatch(arg, "grayscale", 1) || keymatch(arg, "greyscale",1)) { - /* Force to grayscale. */ -#if TRANSFORMS_SUPPORTED - transformoption.force_grayscale = TRUE; -#else - select_transform(JXFORM_NONE); /* force an error */ -#endif - - } else if (keymatch(arg, "maxmemory", 3)) { - /* Maximum memory in Kb (or Mb with 'm'). */ - long lval; - char ch = 'x'; - - if (++argn >= argc) /* advance to next argument */ - usage(); - if (sscanf(argv[argn], "%ld%c", &lval, &ch) < 1) - usage(); - if (ch == 'm' || ch == 'M') - lval *= 1000L; - cinfo->mem->max_memory_to_use = lval * 1000L; - - } else if (keymatch(arg, "optimize", 1) || keymatch(arg, "optimise", 1)) { - /* Enable entropy parm optimization. */ -#ifdef ENTROPY_OPT_SUPPORTED - cinfo->optimize_coding = TRUE; -#else - fprintf(stderr, "%s: sorry, entropy optimization was not compiled\n", - progname); - exit(EXIT_FAILURE); -#endif - - } else if (keymatch(arg, "outfile", 4)) { - /* Set output file name. */ - if (++argn >= argc) /* advance to next argument */ - usage(); - outfilename = argv[argn]; /* save it away for later use */ - - } else if (keymatch(arg, "progressive", 1)) { - /* Select simple progressive mode. */ -#ifdef C_PROGRESSIVE_SUPPORTED - simple_progressive = TRUE; - /* We must postpone execution until num_components is known. */ -#else - fprintf(stderr, "%s: sorry, progressive output was not compiled\n", - progname); - exit(EXIT_FAILURE); -#endif - - } else if (keymatch(arg, "restart", 1)) { - /* Restart interval in MCU rows (or in MCUs with 'b'). */ - long lval; - char ch = 'x'; - - if (++argn >= argc) /* advance to next argument */ - usage(); - if (sscanf(argv[argn], "%ld%c", &lval, &ch) < 1) - usage(); - if (lval < 0 || lval > 65535L) - usage(); - if (ch == 'b' || ch == 'B') { - cinfo->restart_interval = (unsigned int) lval; - cinfo->restart_in_rows = 0; /* else prior '-restart n' overrides me */ - } else { - cinfo->restart_in_rows = (int) lval; - /* restart_interval will be computed during startup */ - } - - } else if (keymatch(arg, "rotate", 2)) { - /* Rotate 90, 180, or 270 degrees (measured clockwise). */ - if (++argn >= argc) /* advance to next argument */ - usage(); - if (keymatch(argv[argn], "90", 2)) - select_transform(JXFORM_ROT_90); - else if (keymatch(argv[argn], "180", 3)) - select_transform(JXFORM_ROT_180); - else if (keymatch(argv[argn], "270", 3)) - select_transform(JXFORM_ROT_270); - else - usage(); - - } else if (keymatch(arg, "scans", 1)) { - /* Set scan script. */ -#ifdef C_MULTISCAN_FILES_SUPPORTED - if (++argn >= argc) /* advance to next argument */ - usage(); - scansarg = argv[argn]; - /* We must postpone reading the file in case -progressive appears. */ -#else - fprintf(stderr, "%s: sorry, multi-scan output was not compiled\n", - progname); - exit(EXIT_FAILURE); -#endif - - } else if (keymatch(arg, "transpose", 1)) { - /* Transpose (across UL-to-LR axis). */ - select_transform(JXFORM_TRANSPOSE); - - } else if (keymatch(arg, "transverse", 6)) { - /* Transverse transpose (across UR-to-LL axis). */ - select_transform(JXFORM_TRANSVERSE); - - } else if (keymatch(arg, "trim", 3)) { - /* Trim off any partial edge MCUs that the transform can't handle. */ - transformoption.trim = TRUE; - - } else { - usage(); /* bogus switch */ - } - } - - /* Post-switch-scanning cleanup */ - - if (for_real) { - -#ifdef C_PROGRESSIVE_SUPPORTED - if (simple_progressive) /* process -progressive; -scans can override */ - jpeg_simple_progression(cinfo); -#endif - -#ifdef C_MULTISCAN_FILES_SUPPORTED - if (scansarg != NULL) /* process -scans if it was present */ - if (! read_scan_script(cinfo, scansarg)) - usage(); -#endif - } - - return argn; /* return index of next arg (file name) */ -} - - -/* - * The main program. - */ - -int -main (int argc, char **argv) -{ - struct jpeg_decompress_struct srcinfo; - struct jpeg_compress_struct dstinfo; - struct jpeg_error_mgr jsrcerr, jdsterr; -#ifdef PROGRESS_REPORT - struct cdjpeg_progress_mgr progress; -#endif - jvirt_barray_ptr * src_coef_arrays; - jvirt_barray_ptr * dst_coef_arrays; - int file_index; - FILE * input_file; - FILE * output_file; - - /* On Mac, fetch a command line. */ -#ifdef USE_CCOMMAND - argc = ccommand(&argv); -#endif - - progname = argv[0]; - if (progname == NULL || progname[0] == 0) - progname = "jpegtran"; /* in case C library doesn't provide it */ - - /* Initialize the JPEG decompression object with default error handling. */ - srcinfo.err = jpeg_std_error(&jsrcerr); - jpeg_create_decompress(&srcinfo); - /* Initialize the JPEG compression object with default error handling. */ - dstinfo.err = jpeg_std_error(&jdsterr); - jpeg_create_compress(&dstinfo); - - /* Now safe to enable signal catcher. - * Note: we assume only the decompression object will have virtual arrays. - */ -#ifdef NEED_SIGNAL_CATCHER - enable_signal_catcher((j_common_ptr) &srcinfo); -#endif - - /* Scan command line to find file names. - * It is convenient to use just one switch-parsing routine, but the switch - * values read here are mostly ignored; we will rescan the switches after - * opening the input file. Also note that most of the switches affect the - * destination JPEG object, so we parse into that and then copy over what - * needs to affects the source too. - */ - - file_index = parse_switches(&dstinfo, argc, argv, 0, FALSE); - jsrcerr.trace_level = jdsterr.trace_level; - srcinfo.mem->max_memory_to_use = dstinfo.mem->max_memory_to_use; - -#ifdef TWO_FILE_COMMANDLINE - /* Must have either -outfile switch or explicit output file name */ - if (outfilename == NULL) { - if (file_index != argc-2) { - fprintf(stderr, "%s: must name one input and one output file\n", - progname); - usage(); - } - outfilename = argv[file_index+1]; - } else { - if (file_index != argc-1) { - fprintf(stderr, "%s: must name one input and one output file\n", - progname); - usage(); - } - } -#else - /* Unix style: expect zero or one file name */ - if (file_index < argc-1) { - fprintf(stderr, "%s: only one input file\n", progname); - usage(); - } -#endif /* TWO_FILE_COMMANDLINE */ - - /* Open the input file. */ - if (file_index < argc) { - if ((input_file = fopen(argv[file_index], READ_BINARY)) == NULL) { - fprintf(stderr, "%s: can't open %s\n", progname, argv[file_index]); - exit(EXIT_FAILURE); - } - } else { - /* default input file is stdin */ - input_file = read_stdin(); - } - - /* Open the output file. */ - if (outfilename != NULL) { - if ((output_file = fopen(outfilename, WRITE_BINARY)) == NULL) { - fprintf(stderr, "%s: can't open %s\n", progname, outfilename); - exit(EXIT_FAILURE); - } - } else { - /* default output file is stdout */ - output_file = write_stdout(); - } - -#ifdef PROGRESS_REPORT - start_progress_monitor((j_common_ptr) &dstinfo, &progress); -#endif - - /* Specify data source for decompression */ - jpeg_stdio_src(&srcinfo, input_file); - - /* Enable saving of extra markers that we want to copy */ - jcopy_markers_setup(&srcinfo, copyoption); - - /* Read file header */ - (void) jpeg_read_header(&srcinfo, TRUE); - - /* Any space needed by a transform option must be requested before - * jpeg_read_coefficients so that memory allocation will be done right. - */ -#if TRANSFORMS_SUPPORTED - jtransform_request_workspace(&srcinfo, &transformoption); -#endif - - /* Read source file as DCT coefficients */ - src_coef_arrays = jpeg_read_coefficients(&srcinfo); - - /* Initialize destination compression parameters from source values */ - jpeg_copy_critical_parameters(&srcinfo, &dstinfo); - - /* Adjust destination parameters if required by transform options; - * also find out which set of coefficient arrays will hold the output. - */ -#if TRANSFORMS_SUPPORTED - dst_coef_arrays = jtransform_adjust_parameters(&srcinfo, &dstinfo, - src_coef_arrays, - &transformoption); -#else - dst_coef_arrays = src_coef_arrays; -#endif - - /* Adjust default compression parameters by re-parsing the options */ - file_index = parse_switches(&dstinfo, argc, argv, 0, TRUE); - - /* Specify data destination for compression */ - jpeg_stdio_dest(&dstinfo, output_file); - - /* Start compressor (note no image data is actually written here) */ - jpeg_write_coefficients(&dstinfo, dst_coef_arrays); - - /* Copy to the output file any extra markers that we want to preserve */ - jcopy_markers_execute(&srcinfo, &dstinfo, copyoption); - - /* Execute image transformation, if any */ -#if TRANSFORMS_SUPPORTED - jtransform_execute_transformation(&srcinfo, &dstinfo, - src_coef_arrays, - &transformoption); -#endif - - /* Finish compression and release memory */ - jpeg_finish_compress(&dstinfo); - jpeg_destroy_compress(&dstinfo); - (void) jpeg_finish_decompress(&srcinfo); - jpeg_destroy_decompress(&srcinfo); - - /* Close files, if we opened them */ - if (input_file != stdin) - fclose(input_file); - if (output_file != stdout) - fclose(output_file); - -#ifdef PROGRESS_REPORT - end_progress_monitor((j_common_ptr) &dstinfo); -#endif - - /* All done. */ - exit(jsrcerr.num_warnings + jdsterr.num_warnings ?EXIT_WARNING:EXIT_SUCCESS); - return 0; /* suppress no-return-value warnings */ -} diff --git a/wxWidgets/src/jpeg/jquant1.c b/wxWidgets/src/jpeg/jquant1.c deleted file mode 100644 index f6d221f5f9..0000000000 --- a/wxWidgets/src/jpeg/jquant1.c +++ /dev/null @@ -1,856 +0,0 @@ -/* - * jquant1.c - * - * Copyright (C) 1991-1996, Thomas G. Lane. - * This file is part of the Independent JPEG Group's software. - * For conditions of distribution and use, see the accompanying README file. - * - * This file contains 1-pass color quantization (color mapping) routines. - * These routines provide mapping to a fixed color map using equally spaced - * color values. Optional Floyd-Steinberg or ordered dithering is available. - */ - -#define JPEG_INTERNALS -#include "jinclude.h" -#include "jpeglib.h" - -#ifdef QUANT_1PASS_SUPPORTED - - -/* - * The main purpose of 1-pass quantization is to provide a fast, if not very - * high quality, colormapped output capability. A 2-pass quantizer usually - * gives better visual quality; however, for quantized grayscale output this - * quantizer is perfectly adequate. Dithering is highly recommended with this - * quantizer, though you can turn it off if you really want to. - * - * In 1-pass quantization the colormap must be chosen in advance of seeing the - * image. We use a map consisting of all combinations of Ncolors[i] color - * values for the i'th component. The Ncolors[] values are chosen so that - * their product, the total number of colors, is no more than that requested. - * (In most cases, the product will be somewhat less.) - * - * Since the colormap is orthogonal, the representative value for each color - * component can be determined without considering the other components; - * then these indexes can be combined into a colormap index by a standard - * N-dimensional-array-subscript calculation. Most of the arithmetic involved - * can be precalculated and stored in the lookup table colorindex[]. - * colorindex[i][j] maps pixel value j in component i to the nearest - * representative value (grid plane) for that component; this index is - * multiplied by the array stride for component i, so that the - * index of the colormap entry closest to a given pixel value is just - * sum( colorindex[component-number][pixel-component-value] ) - * Aside from being fast, this scheme allows for variable spacing between - * representative values with no additional lookup cost. - * - * If gamma correction has been applied in color conversion, it might be wise - * to adjust the color grid spacing so that the representative colors are - * equidistant in linear space. At this writing, gamma correction is not - * implemented by jdcolor, so nothing is done here. - */ - - -/* Declarations for ordered dithering. - * - * We use a standard 16x16 ordered dither array. The basic concept of ordered - * dithering is described in many references, for instance Dale Schumacher's - * chapter II.2 of Graphics Gems II (James Arvo, ed. Academic Press, 1991). - * In place of Schumacher's comparisons against a "threshold" value, we add a - * "dither" value to the input pixel and then round the result to the nearest - * output value. The dither value is equivalent to (0.5 - threshold) times - * the distance between output values. For ordered dithering, we assume that - * the output colors are equally spaced; if not, results will probably be - * worse, since the dither may be too much or too little at a given point. - * - * The normal calculation would be to form pixel value + dither, range-limit - * this to 0..MAXJSAMPLE, and then index into the colorindex table as usual. - * We can skip the separate range-limiting step by extending the colorindex - * table in both directions. - */ - -#define ODITHER_SIZE 16 /* dimension of dither matrix */ -/* NB: if ODITHER_SIZE is not a power of 2, ODITHER_MASK uses will break */ -#define ODITHER_CELLS (ODITHER_SIZE*ODITHER_SIZE) /* # cells in matrix */ -#define ODITHER_MASK (ODITHER_SIZE-1) /* mask for wrapping around counters */ - -typedef int ODITHER_MATRIX[ODITHER_SIZE][ODITHER_SIZE]; -typedef int (*ODITHER_MATRIX_PTR)[ODITHER_SIZE]; - -static const UINT8 base_dither_matrix[ODITHER_SIZE][ODITHER_SIZE] = { - /* Bayer's order-4 dither array. Generated by the code given in - * Stephen Hawley's article "Ordered Dithering" in Graphics Gems I. - * The values in this array must range from 0 to ODITHER_CELLS-1. - */ - { 0,192, 48,240, 12,204, 60,252, 3,195, 51,243, 15,207, 63,255 }, - { 128, 64,176,112,140, 76,188,124,131, 67,179,115,143, 79,191,127 }, - { 32,224, 16,208, 44,236, 28,220, 35,227, 19,211, 47,239, 31,223 }, - { 160, 96,144, 80,172,108,156, 92,163, 99,147, 83,175,111,159, 95 }, - { 8,200, 56,248, 4,196, 52,244, 11,203, 59,251, 7,199, 55,247 }, - { 136, 72,184,120,132, 68,180,116,139, 75,187,123,135, 71,183,119 }, - { 40,232, 24,216, 36,228, 20,212, 43,235, 27,219, 39,231, 23,215 }, - { 168,104,152, 88,164,100,148, 84,171,107,155, 91,167,103,151, 87 }, - { 2,194, 50,242, 14,206, 62,254, 1,193, 49,241, 13,205, 61,253 }, - { 130, 66,178,114,142, 78,190,126,129, 65,177,113,141, 77,189,125 }, - { 34,226, 18,210, 46,238, 30,222, 33,225, 17,209, 45,237, 29,221 }, - { 162, 98,146, 82,174,110,158, 94,161, 97,145, 81,173,109,157, 93 }, - { 10,202, 58,250, 6,198, 54,246, 9,201, 57,249, 5,197, 53,245 }, - { 138, 74,186,122,134, 70,182,118,137, 73,185,121,133, 69,181,117 }, - { 42,234, 26,218, 38,230, 22,214, 41,233, 25,217, 37,229, 21,213 }, - { 170,106,154, 90,166,102,150, 86,169,105,153, 89,165,101,149, 85 } -}; - - -/* Declarations for Floyd-Steinberg dithering. - * - * Errors are accumulated into the array fserrors[], at a resolution of - * 1/16th of a pixel count. The error at a given pixel is propagated - * to its not-yet-processed neighbors using the standard F-S fractions, - * ... (here) 7/16 - * 3/16 5/16 1/16 - * We work left-to-right on even rows, right-to-left on odd rows. - * - * We can get away with a single array (holding one row's worth of errors) - * by using it to store the current row's errors at pixel columns not yet - * processed, but the next row's errors at columns already processed. We - * need only a few extra variables to hold the errors immediately around the - * current column. (If we are lucky, those variables are in registers, but - * even if not, they're probably cheaper to access than array elements are.) - * - * The fserrors[] array is indexed [component#][position]. - * We provide (#columns + 2) entries per component; the extra entry at each - * end saves us from special-casing the first and last pixels. - * - * Note: on a wide image, we might not have enough room in a PC's near data - * segment to hold the error array; so it is allocated with alloc_large. - */ - -#if BITS_IN_JSAMPLE == 8 -typedef INT16 FSERROR; /* 16 bits should be enough */ -typedef int LOCFSERROR; /* use 'int' for calculation temps */ -#else -typedef JPEG_INT32 FSERROR; /* may need more than 16 bits */ -typedef JPEG_INT32 LOCFSERROR; /* be sure calculation temps are big enough */ -#endif - -typedef FSERROR FAR *FSERRPTR; /* pointer to error array (in FAR storage!) */ - - -/* Private subobject */ - -#define MAX_Q_COMPS 4 /* max components I can handle */ - -typedef struct { - struct jpeg_color_quantizer pub; /* public fields */ - - /* Initially allocated colormap is saved here */ - JSAMPARRAY sv_colormap; /* The color map as a 2-D pixel array */ - int sv_actual; /* number of entries in use */ - - JSAMPARRAY colorindex; /* Precomputed mapping for speed */ - /* colorindex[i][j] = index of color closest to pixel value j in component i, - * premultiplied as described above. Since colormap indexes must fit into - * JSAMPLEs, the entries of this array will too. - */ - wxjpeg_boolean is_padded; /* is the colorindex padded for odither? */ - - int Ncolors[MAX_Q_COMPS]; /* # of values alloced to each component */ - - /* Variables for ordered dithering */ - int row_index; /* cur row's vertical index in dither matrix */ - ODITHER_MATRIX_PTR odither[MAX_Q_COMPS]; /* one dither array per component */ - - /* Variables for Floyd-Steinberg dithering */ - FSERRPTR fserrors[MAX_Q_COMPS]; /* accumulated errors */ - wxjpeg_boolean on_odd_row; /* flag to remember which row we are on */ -} my_cquantizer; - -typedef my_cquantizer * my_cquantize_ptr; - - -/* - * Policy-making subroutines for create_colormap and create_colorindex. - * These routines determine the colormap to be used. The rest of the module - * only assumes that the colormap is orthogonal. - * - * * select_ncolors decides how to divvy up the available colors - * among the components. - * * output_value defines the set of representative values for a component. - * * largest_input_value defines the mapping from input values to - * representative values for a component. - * Note that the latter two routines may impose different policies for - * different components, though this is not currently done. - */ - - -LOCAL(int) -select_ncolors (j_decompress_ptr cinfo, int Ncolors[]) -/* Determine allocation of desired colors to components, */ -/* and fill in Ncolors[] array to indicate choice. */ -/* Return value is total number of colors (product of Ncolors[] values). */ -{ - int nc = cinfo->out_color_components; /* number of color components */ - int max_colors = cinfo->desired_number_of_colors; - int total_colors, iroot, i, j; - wxjpeg_boolean changed; - long temp; - static const int RGB_order[3] = { RGB_GREEN, RGB_RED, RGB_BLUE }; - - /* We can allocate at least the nc'th root of max_colors per component. */ - /* Compute floor(nc'th root of max_colors). */ - iroot = 1; - do { - iroot++; - temp = iroot; /* set temp = iroot ** nc */ - for (i = 1; i < nc; i++) - temp *= iroot; - } while (temp <= (long) max_colors); /* repeat till iroot exceeds root */ - iroot--; /* now iroot = floor(root) */ - - /* Must have at least 2 color values per component */ - if (iroot < 2) - ERREXIT1(cinfo, JERR_QUANT_FEW_COLORS, (int) temp); - - /* Initialize to iroot color values for each component */ - total_colors = 1; - for (i = 0; i < nc; i++) { - Ncolors[i] = iroot; - total_colors *= iroot; - } - /* We may be able to increment the count for one or more components without - * exceeding max_colors, though we know not all can be incremented. - * Sometimes, the first component can be incremented more than once! - * (Example: for 16 colors, we start at 2*2*2, go to 3*2*2, then 4*2*2.) - * In RGB colorspace, try to increment G first, then R, then B. - */ - do { - changed = FALSE; - for (i = 0; i < nc; i++) { - j = (cinfo->out_color_space == JCS_RGB ? RGB_order[i] : i); - /* calculate new total_colors if Ncolors[j] is incremented */ - temp = total_colors / Ncolors[j]; - temp *= Ncolors[j]+1; /* done in long arith to avoid oflo */ - if (temp > (long) max_colors) - break; /* won't fit, done with this pass */ - Ncolors[j]++; /* OK, apply the increment */ - total_colors = (int) temp; - changed = TRUE; - } - } while (changed); - - return total_colors; -} - - -LOCAL(int) -output_value (j_decompress_ptr cinfo, int ci, int j, int maxj) -/* Return j'th output value, where j will range from 0 to maxj */ -/* The output values must fall in 0..MAXJSAMPLE in increasing order */ -{ - /* We always provide values 0 and MAXJSAMPLE for each component; - * any additional values are equally spaced between these limits. - * (Forcing the upper and lower values to the limits ensures that - * dithering can't produce a color outside the selected gamut.) - */ - return (int) (((JPEG_INT32) j * MAXJSAMPLE + maxj/2) / maxj); -} - - -LOCAL(int) -largest_input_value (j_decompress_ptr cinfo, int ci, int j, int maxj) -/* Return largest input value that should map to j'th output value */ -/* Must have largest(j=0) >= 0, and largest(j=maxj) >= MAXJSAMPLE */ -{ - /* Breakpoints are halfway between values returned by output_value */ - return (int) (((JPEG_INT32) (2*j + 1) * MAXJSAMPLE + maxj) / (2*maxj)); -} - - -/* - * Create the colormap. - */ - -LOCAL(void) -create_colormap (j_decompress_ptr cinfo) -{ - my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize; - JSAMPARRAY colormap; /* Created colormap */ - int total_colors; /* Number of distinct output colors */ - int i,j,k, nci, blksize, blkdist, ptr, val; - - /* Select number of colors for each component */ - total_colors = select_ncolors(cinfo, cquantize->Ncolors); - - /* Report selected color counts */ - if (cinfo->out_color_components == 3) - TRACEMS4(cinfo, 1, JTRC_QUANT_3_NCOLORS, - total_colors, cquantize->Ncolors[0], - cquantize->Ncolors[1], cquantize->Ncolors[2]); - else - TRACEMS1(cinfo, 1, JTRC_QUANT_NCOLORS, total_colors); - - /* Allocate and fill in the colormap. */ - /* The colors are ordered in the map in standard row-major order, */ - /* i.e. rightmost (highest-indexed) color changes most rapidly. */ - - colormap = (*cinfo->mem->alloc_sarray) - ((j_common_ptr) cinfo, JPOOL_IMAGE, - (JDIMENSION) total_colors, (JDIMENSION) cinfo->out_color_components); - - /* blksize is number of adjacent repeated entries for a component */ - /* blkdist is distance between groups of identical entries for a component */ - blkdist = total_colors; - - for (i = 0; i < cinfo->out_color_components; i++) { - /* fill in colormap entries for i'th color component */ - nci = cquantize->Ncolors[i]; /* # of distinct values for this color */ - blksize = blkdist / nci; - for (j = 0; j < nci; j++) { - /* Compute j'th output value (out of nci) for component */ - val = output_value(cinfo, i, j, nci-1); - /* Fill in all colormap entries that have this value of this component */ - for (ptr = j * blksize; ptr < total_colors; ptr += blkdist) { - /* fill in blksize entries beginning at ptr */ - for (k = 0; k < blksize; k++) - colormap[i][ptr+k] = (JSAMPLE) val; - } - } - blkdist = blksize; /* blksize of this color is blkdist of next */ - } - - /* Save the colormap in private storage, - * where it will survive color quantization mode changes. - */ - cquantize->sv_colormap = colormap; - cquantize->sv_actual = total_colors; -} - - -/* - * Create the color index table. - */ - -LOCAL(void) -create_colorindex (j_decompress_ptr cinfo) -{ - my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize; - JSAMPROW indexptr; - int i,j,k, nci, blksize, val, pad; - - /* For ordered dither, we pad the color index tables by MAXJSAMPLE in - * each direction (input index values can be -MAXJSAMPLE .. 2*MAXJSAMPLE). - * This is not necessary in the other dithering modes. However, we - * flag whether it was done in case user changes dithering mode. - */ - if (cinfo->dither_mode == JDITHER_ORDERED) { - pad = MAXJSAMPLE*2; - cquantize->is_padded = TRUE; - } else { - pad = 0; - cquantize->is_padded = FALSE; - } - - cquantize->colorindex = (*cinfo->mem->alloc_sarray) - ((j_common_ptr) cinfo, JPOOL_IMAGE, - (JDIMENSION) (MAXJSAMPLE+1 + pad), - (JDIMENSION) cinfo->out_color_components); - - /* blksize is number of adjacent repeated entries for a component */ - blksize = cquantize->sv_actual; - - for (i = 0; i < cinfo->out_color_components; i++) { - /* fill in colorindex entries for i'th color component */ - nci = cquantize->Ncolors[i]; /* # of distinct values for this color */ - blksize = blksize / nci; - - /* adjust colorindex pointers to provide padding at negative indexes. */ - if (pad) - cquantize->colorindex[i] += MAXJSAMPLE; - - /* in loop, val = index of current output value, */ - /* and k = largest j that maps to current val */ - indexptr = cquantize->colorindex[i]; - val = 0; - k = largest_input_value(cinfo, i, 0, nci-1); - for (j = 0; j <= MAXJSAMPLE; j++) { - while (j > k) /* advance val if past boundary */ - k = largest_input_value(cinfo, i, ++val, nci-1); - /* premultiply so that no multiplication needed in main processing */ - indexptr[j] = (JSAMPLE) (val * blksize); - } - /* Pad at both ends if necessary */ - if (pad) - for (j = 1; j <= MAXJSAMPLE; j++) { - indexptr[-j] = indexptr[0]; - indexptr[MAXJSAMPLE+j] = indexptr[MAXJSAMPLE]; - } - } -} - - -/* - * Create an ordered-dither array for a component having ncolors - * distinct output values. - */ - -LOCAL(ODITHER_MATRIX_PTR) -make_odither_array (j_decompress_ptr cinfo, int ncolors) -{ - ODITHER_MATRIX_PTR odither; - int j,k; - JPEG_INT32 num,den; - - odither = (ODITHER_MATRIX_PTR) - (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, - SIZEOF(ODITHER_MATRIX)); - /* The inter-value distance for this color is MAXJSAMPLE/(ncolors-1). - * Hence the dither value for the matrix cell with fill order f - * (f=0..N-1) should be (N-1-2*f)/(2*N) * MAXJSAMPLE/(ncolors-1). - * On 16-bit-int machine, be careful to avoid overflow. - */ - den = 2 * ODITHER_CELLS * ((JPEG_INT32) (ncolors - 1)); - for (j = 0; j < ODITHER_SIZE; j++) { - for (k = 0; k < ODITHER_SIZE; k++) { - num = ((JPEG_INT32) (ODITHER_CELLS-1 - 2*((int)base_dither_matrix[j][k]))) - * MAXJSAMPLE; - /* Ensure round towards zero despite C's lack of consistency - * about rounding negative values in integer division... - */ - odither[j][k] = (int) (num<0 ? -((-num)/den) : num/den); - } - } - return odither; -} - - -/* - * Create the ordered-dither tables. - * Components having the same number of representative colors may - * share a dither table. - */ - -LOCAL(void) -create_odither_tables (j_decompress_ptr cinfo) -{ - my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize; - ODITHER_MATRIX_PTR odither; - int i, j, nci; - - for (i = 0; i < cinfo->out_color_components; i++) { - nci = cquantize->Ncolors[i]; /* # of distinct values for this color */ - odither = NULL; /* search for matching prior component */ - for (j = 0; j < i; j++) { - if (nci == cquantize->Ncolors[j]) { - odither = cquantize->odither[j]; - break; - } - } - if (odither == NULL) /* need a new table? */ - odither = make_odither_array(cinfo, nci); - cquantize->odither[i] = odither; - } -} - - -/* - * Map some rows of pixels to the output colormapped representation. - */ - -METHODDEF(void) -color_quantize (j_decompress_ptr cinfo, JSAMPARRAY input_buf, - JSAMPARRAY output_buf, int num_rows) -/* General case, no dithering */ -{ - my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize; - JSAMPARRAY colorindex = cquantize->colorindex; - register int pixcode, ci; - register JSAMPROW ptrin, ptrout; - int row; - JDIMENSION col; - JDIMENSION width = cinfo->output_width; - register int nc = cinfo->out_color_components; - - for (row = 0; row < num_rows; row++) { - ptrin = input_buf[row]; - ptrout = output_buf[row]; - for (col = width; col > 0; col--) { - pixcode = 0; - for (ci = 0; ci < nc; ci++) { - pixcode += GETJSAMPLE(colorindex[ci][GETJSAMPLE(*ptrin++)]); - } - *ptrout++ = (JSAMPLE) pixcode; - } - } -} - - -METHODDEF(void) -color_quantize3 (j_decompress_ptr cinfo, JSAMPARRAY input_buf, - JSAMPARRAY output_buf, int num_rows) -/* Fast path for out_color_components==3, no dithering */ -{ - my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize; - register int pixcode; - register JSAMPROW ptrin, ptrout; - JSAMPROW colorindex0 = cquantize->colorindex[0]; - JSAMPROW colorindex1 = cquantize->colorindex[1]; - JSAMPROW colorindex2 = cquantize->colorindex[2]; - int row; - JDIMENSION col; - JDIMENSION width = cinfo->output_width; - - for (row = 0; row < num_rows; row++) { - ptrin = input_buf[row]; - ptrout = output_buf[row]; - for (col = width; col > 0; col--) { - pixcode = GETJSAMPLE(colorindex0[GETJSAMPLE(*ptrin++)]); - pixcode += GETJSAMPLE(colorindex1[GETJSAMPLE(*ptrin++)]); - pixcode += GETJSAMPLE(colorindex2[GETJSAMPLE(*ptrin++)]); - *ptrout++ = (JSAMPLE) pixcode; - } - } -} - - -METHODDEF(void) -quantize_ord_dither (j_decompress_ptr cinfo, JSAMPARRAY input_buf, - JSAMPARRAY output_buf, int num_rows) -/* General case, with ordered dithering */ -{ - my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize; - register JSAMPROW input_ptr; - register JSAMPROW output_ptr; - JSAMPROW colorindex_ci; - int * dither; /* points to active row of dither matrix */ - int row_index, col_index; /* current indexes into dither matrix */ - int nc = cinfo->out_color_components; - int ci; - int row; - JDIMENSION col; - JDIMENSION width = cinfo->output_width; - - for (row = 0; row < num_rows; row++) { - /* Initialize output values to 0 so can process components separately */ - jzero_far((void FAR *) output_buf[row], - (size_t) (width * SIZEOF(JSAMPLE))); - row_index = cquantize->row_index; - for (ci = 0; ci < nc; ci++) { - input_ptr = input_buf[row] + ci; - output_ptr = output_buf[row]; - colorindex_ci = cquantize->colorindex[ci]; - dither = cquantize->odither[ci][row_index]; - col_index = 0; - - for (col = width; col > 0; col--) { - /* Form pixel value + dither, range-limit to 0..MAXJSAMPLE, - * select output value, accumulate into output code for this pixel. - * Range-limiting need not be done explicitly, as we have extended - * the colorindex table to produce the right answers for out-of-range - * inputs. The maximum dither is +- MAXJSAMPLE; this sets the - * required amount of padding. - */ - *output_ptr += colorindex_ci[GETJSAMPLE(*input_ptr)+dither[col_index]]; - input_ptr += nc; - output_ptr++; - col_index = (col_index + 1) & ODITHER_MASK; - } - } - /* Advance row index for next row */ - row_index = (row_index + 1) & ODITHER_MASK; - cquantize->row_index = row_index; - } -} - - -METHODDEF(void) -quantize3_ord_dither (j_decompress_ptr cinfo, JSAMPARRAY input_buf, - JSAMPARRAY output_buf, int num_rows) -/* Fast path for out_color_components==3, with ordered dithering */ -{ - my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize; - register int pixcode; - register JSAMPROW input_ptr; - register JSAMPROW output_ptr; - JSAMPROW colorindex0 = cquantize->colorindex[0]; - JSAMPROW colorindex1 = cquantize->colorindex[1]; - JSAMPROW colorindex2 = cquantize->colorindex[2]; - int * dither0; /* points to active row of dither matrix */ - int * dither1; - int * dither2; - int row_index, col_index; /* current indexes into dither matrix */ - int row; - JDIMENSION col; - JDIMENSION width = cinfo->output_width; - - for (row = 0; row < num_rows; row++) { - row_index = cquantize->row_index; - input_ptr = input_buf[row]; - output_ptr = output_buf[row]; - dither0 = cquantize->odither[0][row_index]; - dither1 = cquantize->odither[1][row_index]; - dither2 = cquantize->odither[2][row_index]; - col_index = 0; - - for (col = width; col > 0; col--) { - pixcode = GETJSAMPLE(colorindex0[GETJSAMPLE(*input_ptr++) + - dither0[col_index]]); - pixcode += GETJSAMPLE(colorindex1[GETJSAMPLE(*input_ptr++) + - dither1[col_index]]); - pixcode += GETJSAMPLE(colorindex2[GETJSAMPLE(*input_ptr++) + - dither2[col_index]]); - *output_ptr++ = (JSAMPLE) pixcode; - col_index = (col_index + 1) & ODITHER_MASK; - } - row_index = (row_index + 1) & ODITHER_MASK; - cquantize->row_index = row_index; - } -} - - -METHODDEF(void) -quantize_fs_dither (j_decompress_ptr cinfo, JSAMPARRAY input_buf, - JSAMPARRAY output_buf, int num_rows) -/* General case, with Floyd-Steinberg dithering */ -{ - my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize; - register LOCFSERROR cur; /* current error or pixel value */ - LOCFSERROR belowerr; /* error for pixel below cur */ - LOCFSERROR bpreverr; /* error for below/prev col */ - LOCFSERROR bnexterr; /* error for below/next col */ - LOCFSERROR delta; - register FSERRPTR errorptr; /* => fserrors[] at column before current */ - register JSAMPROW input_ptr; - register JSAMPROW output_ptr; - JSAMPROW colorindex_ci; - JSAMPROW colormap_ci; - int pixcode; - int nc = cinfo->out_color_components; - int dir; /* 1 for left-to-right, -1 for right-to-left */ - int dirnc; /* dir * nc */ - int ci; - int row; - JDIMENSION col; - JDIMENSION width = cinfo->output_width; - JSAMPLE *range_limit = cinfo->sample_range_limit; - SHIFT_TEMPS - - for (row = 0; row < num_rows; row++) { - /* Initialize output values to 0 so can process components separately */ - jzero_far((void FAR *) output_buf[row], - (size_t) (width * SIZEOF(JSAMPLE))); - for (ci = 0; ci < nc; ci++) { - input_ptr = input_buf[row] + ci; - output_ptr = output_buf[row]; - if (cquantize->on_odd_row) { - /* work right to left in this row */ - input_ptr += (width-1) * nc; /* so point to rightmost pixel */ - output_ptr += width-1; - dir = -1; - dirnc = -nc; - errorptr = cquantize->fserrors[ci] + (width+1); /* => entry after last column */ - } else { - /* work left to right in this row */ - dir = 1; - dirnc = nc; - errorptr = cquantize->fserrors[ci]; /* => entry before first column */ - } - colorindex_ci = cquantize->colorindex[ci]; - colormap_ci = cquantize->sv_colormap[ci]; - /* Preset error values: no error propagated to first pixel from left */ - cur = 0; - /* and no error propagated to row below yet */ - belowerr = bpreverr = 0; - - for (col = width; col > 0; col--) { - /* cur holds the error propagated from the previous pixel on the - * current line. Add the error propagated from the previous line - * to form the complete error correction term for this pixel, and - * round the error term (which is expressed * 16) to an integer. - * RIGHT_SHIFT rounds towards minus infinity, so adding 8 is correct - * for either sign of the error value. - * Note: errorptr points to *previous* column's array entry. - */ - cur = RIGHT_SHIFT(cur + errorptr[dir] + 8, 4); - /* Form pixel value + error, and range-limit to 0..MAXJSAMPLE. - * The maximum error is +- MAXJSAMPLE; this sets the required size - * of the range_limit array. - */ - cur += GETJSAMPLE(*input_ptr); - cur = GETJSAMPLE(range_limit[cur]); - /* Select output value, accumulate into output code for this pixel */ - pixcode = GETJSAMPLE(colorindex_ci[cur]); - *output_ptr += (JSAMPLE) pixcode; - /* Compute actual representation error at this pixel */ - /* Note: we can do this even though we don't have the final */ - /* pixel code, because the colormap is orthogonal. */ - cur -= GETJSAMPLE(colormap_ci[pixcode]); - /* Compute error fractions to be propagated to adjacent pixels. - * Add these into the running sums, and simultaneously shift the - * next-line error sums left by 1 column. - */ - bnexterr = cur; - delta = cur * 2; - cur += delta; /* form error * 3 */ - errorptr[0] = (FSERROR) (bpreverr + cur); - cur += delta; /* form error * 5 */ - bpreverr = belowerr + cur; - belowerr = bnexterr; - cur += delta; /* form error * 7 */ - /* At this point cur contains the 7/16 error value to be propagated - * to the next pixel on the current line, and all the errors for the - * next line have been shifted over. We are therefore ready to move on. - */ - input_ptr += dirnc; /* advance input ptr to next column */ - output_ptr += dir; /* advance output ptr to next column */ - errorptr += dir; /* advance errorptr to current column */ - } - /* Post-loop cleanup: we must unload the final error value into the - * final fserrors[] entry. Note we need not unload belowerr because - * it is for the dummy column before or after the actual array. - */ - errorptr[0] = (FSERROR) bpreverr; /* unload prev err into array */ - } - cquantize->on_odd_row = (cquantize->on_odd_row ? FALSE : TRUE); - } -} - - -/* - * Allocate workspace for Floyd-Steinberg errors. - */ - -LOCAL(void) -alloc_fs_workspace (j_decompress_ptr cinfo) -{ - my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize; - size_t arraysize; - int i; - - arraysize = (size_t) ((cinfo->output_width + 2) * SIZEOF(FSERROR)); - for (i = 0; i < cinfo->out_color_components; i++) { - cquantize->fserrors[i] = (FSERRPTR) - (*cinfo->mem->alloc_large)((j_common_ptr) cinfo, JPOOL_IMAGE, arraysize); - } -} - - -/* - * Initialize for one-pass color quantization. - */ - -METHODDEF(void) -start_pass_1_quant (j_decompress_ptr cinfo, wxjpeg_boolean is_pre_scan) -{ - my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize; - size_t arraysize; - int i; - - /* Install my colormap. */ - cinfo->colormap = cquantize->sv_colormap; - cinfo->actual_number_of_colors = cquantize->sv_actual; - - /* Initialize for desired dithering mode. */ - switch (cinfo->dither_mode) { - case JDITHER_NONE: - if (cinfo->out_color_components == 3) - cquantize->pub.color_quantize = color_quantize3; - else - cquantize->pub.color_quantize = color_quantize; - break; - case JDITHER_ORDERED: - if (cinfo->out_color_components == 3) - cquantize->pub.color_quantize = quantize3_ord_dither; - else - cquantize->pub.color_quantize = quantize_ord_dither; - cquantize->row_index = 0; /* initialize state for ordered dither */ - /* If user changed to ordered dither from another mode, - * we must recreate the color index table with padding. - * This will cost extra space, but probably isn't very likely. - */ - if (! cquantize->is_padded) - create_colorindex(cinfo); - /* Create ordered-dither tables if we didn't already. */ - if (cquantize->odither[0] == NULL) - create_odither_tables(cinfo); - break; - case JDITHER_FS: - cquantize->pub.color_quantize = quantize_fs_dither; - cquantize->on_odd_row = FALSE; /* initialize state for F-S dither */ - /* Allocate Floyd-Steinberg workspace if didn't already. */ - if (cquantize->fserrors[0] == NULL) - alloc_fs_workspace(cinfo); - /* Initialize the propagated errors to zero. */ - arraysize = (size_t) ((cinfo->output_width + 2) * SIZEOF(FSERROR)); - for (i = 0; i < cinfo->out_color_components; i++) - jzero_far((void FAR *) cquantize->fserrors[i], arraysize); - break; - default: - ERREXIT(cinfo, JERR_NOT_COMPILED); - break; - } -} - - -/* - * Finish up at the end of the pass. - */ - -METHODDEF(void) -finish_pass_1_quant (j_decompress_ptr cinfo) -{ - /* no work in 1-pass case */ -} - - -/* - * Switch to a new external colormap between output passes. - * Shouldn't get to this module! - */ - -METHODDEF(void) -new_color_map_1_quant (j_decompress_ptr cinfo) -{ - ERREXIT(cinfo, JERR_MODE_CHANGE); -} - - -/* - * Module initialization routine for 1-pass color quantization. - */ - -GLOBAL(void) -jinit_1pass_quantizer (j_decompress_ptr cinfo) -{ - my_cquantize_ptr cquantize; - - cquantize = (my_cquantize_ptr) - (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, - SIZEOF(my_cquantizer)); - cinfo->cquantize = (struct jpeg_color_quantizer *) cquantize; - cquantize->pub.start_pass = start_pass_1_quant; - cquantize->pub.finish_pass = finish_pass_1_quant; - cquantize->pub.new_color_map = new_color_map_1_quant; - cquantize->fserrors[0] = NULL; /* Flag FS workspace not allocated */ - cquantize->odither[0] = NULL; /* Also flag odither arrays not allocated */ - - /* Make sure my internal arrays won't overflow */ - if (cinfo->out_color_components > MAX_Q_COMPS) - ERREXIT1(cinfo, JERR_QUANT_COMPONENTS, MAX_Q_COMPS); - /* Make sure colormap indexes can be represented by JSAMPLEs */ - if (cinfo->desired_number_of_colors > (MAXJSAMPLE+1)) - ERREXIT1(cinfo, JERR_QUANT_MANY_COLORS, MAXJSAMPLE+1); - - /* Create the colormap and color index table. */ - create_colormap(cinfo); - create_colorindex(cinfo); - - /* Allocate Floyd-Steinberg workspace now if requested. - * We do this now since it is FAR storage and may affect the memory - * manager's space calculations. If the user changes to FS dither - * mode in a later pass, we will allocate the space then, and will - * possibly overrun the max_memory_to_use setting. - */ - if (cinfo->dither_mode == JDITHER_FS) - alloc_fs_workspace(cinfo); -} - -#endif /* QUANT_1PASS_SUPPORTED */ diff --git a/wxWidgets/src/jpeg/jquant2.c b/wxWidgets/src/jpeg/jquant2.c deleted file mode 100644 index b9c66a325c..0000000000 --- a/wxWidgets/src/jpeg/jquant2.c +++ /dev/null @@ -1,1310 +0,0 @@ -/* - * jquant2.c - * - * Copyright (C) 1991-1996, Thomas G. Lane. - * This file is part of the Independent JPEG Group's software. - * For conditions of distribution and use, see the accompanying README file. - * - * This file contains 2-pass color quantization (color mapping) routines. - * These routines provide selection of a custom color map for an image, - * followed by mapping of the image to that color map, with optional - * Floyd-Steinberg dithering. - * It is also possible to use just the second pass to map to an arbitrary - * externally-given color map. - * - * Note: ordered dithering is not supported, since there isn't any fast - * way to compute intercolor distances; it's unclear that ordered dither's - * fundamental assumptions even hold with an irregularly spaced color map. - */ - -#define JPEG_INTERNALS -#include "jinclude.h" -#include "jpeglib.h" - -#ifdef QUANT_2PASS_SUPPORTED - - -/* - * This module implements the well-known Heckbert paradigm for color - * quantization. Most of the ideas used here can be traced back to - * Heckbert's seminal paper - * Heckbert, Paul. "Color Image Quantization for Frame Buffer Display", - * Proc. SIGGRAPH '82, Computer Graphics v.16 #3 (July 1982), pp 297-304. - * - * In the first pass over the image, we accumulate a histogram showing the - * usage count of each possible color. To keep the histogram to a reasonable - * size, we reduce the precision of the input; typical practice is to retain - * 5 or 6 bits per color, so that 8 or 4 different input values are counted - * in the same histogram cell. - * - * Next, the color-selection step begins with a box representing the whole - * color space, and repeatedly splits the "largest" remaining box until we - * have as many boxes as desired colors. Then the mean color in each - * remaining box becomes one of the possible output colors. - * - * The second pass over the image maps each input pixel to the closest output - * color (optionally after applying a Floyd-Steinberg dithering correction). - * This mapping is logically trivial, but making it go fast enough requires - * considerable care. - * - * Heckbert-style quantizers vary a good deal in their policies for choosing - * the "largest" box and deciding where to cut it. The particular policies - * used here have proved out well in experimental comparisons, but better ones - * may yet be found. - * - * In earlier versions of the IJG code, this module quantized in YCbCr color - * space, processing the raw upsampled data without a color conversion step. - * This allowed the color conversion math to be done only once per colormap - * entry, not once per pixel. However, that optimization precluded other - * useful optimizations (such as merging color conversion with upsampling) - * and it also interfered with desired capabilities such as quantizing to an - * externally-supplied colormap. We have therefore abandoned that approach. - * The present code works in the post-conversion color space, typically RGB. - * - * To improve the visual quality of the results, we actually work in scaled - * RGB space, giving G distances more weight than R, and R in turn more than - * B. To do everything in integer math, we must use integer scale factors. - * The 2/3/1 scale factors used here correspond loosely to the relative - * weights of the colors in the NTSC grayscale equation. - * If you want to use this code to quantize a non-RGB color space, you'll - * probably need to change these scale factors. - */ - -#define R_SCALE 2 /* scale R distances by this much */ -#define G_SCALE 3 /* scale G distances by this much */ -#define B_SCALE 1 /* and B by this much */ - -/* Relabel R/G/B as components 0/1/2, respecting the RGB ordering defined - * in jmorecfg.h. As the code stands, it will do the right thing for R,G,B - * and B,G,R orders. If you define some other weird order in jmorecfg.h, - * you'll get compile errors until you extend this logic. In that case - * you'll probably want to tweak the histogram sizes too. - */ - -#if RGB_RED == 0 -#define C0_SCALE R_SCALE -#endif -#if RGB_BLUE == 0 -#define C0_SCALE B_SCALE -#endif -#if RGB_GREEN == 1 -#define C1_SCALE G_SCALE -#endif -#if RGB_RED == 2 -#define C2_SCALE R_SCALE -#endif -#if RGB_BLUE == 2 -#define C2_SCALE B_SCALE -#endif - - -/* - * First we have the histogram data structure and routines for creating it. - * - * The number of bits of precision can be adjusted by changing these symbols. - * We recommend keeping 6 bits for G and 5 each for R and B. - * If you have plenty of memory and cycles, 6 bits all around gives marginally - * better results; if you are short of memory, 5 bits all around will save - * some space but degrade the results. - * To maintain a fully accurate histogram, we'd need to allocate a "long" - * (preferably unsigned long) for each cell. In practice this is overkill; - * we can get by with 16 bits per cell. Few of the cell counts will overflow, - * and clamping those that do overflow to the maximum value will give close- - * enough results. This reduces the recommended histogram size from 256Kb - * to 128Kb, which is a useful savings on PC-class machines. - * (In the second pass the histogram space is re-used for pixel mapping data; - * in that capacity, each cell must be able to store zero to the number of - * desired colors. 16 bits/cell is plenty for that too.) - * Since the JPEG code is intended to run in small memory model on 80x86 - * machines, we can't just allocate the histogram in one chunk. Instead - * of a true 3-D array, we use a row of pointers to 2-D arrays. Each - * pointer corresponds to a C0 value (typically 2^5 = 32 pointers) and - * each 2-D array has 2^6*2^5 = 2048 or 2^6*2^6 = 4096 entries. Note that - * on 80x86 machines, the pointer row is in near memory but the actual - * arrays are in far memory (same arrangement as we use for image arrays). - */ - -#define MAXNUMCOLORS (MAXJSAMPLE+1) /* maximum size of colormap */ - -/* These will do the right thing for either R,G,B or B,G,R color order, - * but you may not like the results for other color orders. - */ -#define HIST_C0_BITS 5 /* bits of precision in R/B histogram */ -#define HIST_C1_BITS 6 /* bits of precision in G histogram */ -#define HIST_C2_BITS 5 /* bits of precision in B/R histogram */ - -/* Number of elements along histogram axes. */ -#define HIST_C0_ELEMS (1<cquantize; - register JSAMPROW ptr; - register histptr histp; - register hist3d histogram = cquantize->histogram; - int row; - JDIMENSION col; - JDIMENSION width = cinfo->output_width; - - for (row = 0; row < num_rows; row++) { - ptr = input_buf[row]; - for (col = width; col > 0; col--) { - /* get pixel value and index into the histogram */ - histp = & histogram[GETJSAMPLE(ptr[0]) >> C0_SHIFT] - [GETJSAMPLE(ptr[1]) >> C1_SHIFT] - [GETJSAMPLE(ptr[2]) >> C2_SHIFT]; - /* increment, check for overflow and undo increment if so. */ - if (++(*histp) <= 0) - (*histp)--; - ptr += 3; - } - } -} - - -/* - * Next we have the really interesting routines: selection of a colormap - * given the completed histogram. - * These routines work with a list of "boxes", each representing a rectangular - * subset of the input color space (to histogram precision). - */ - -typedef struct { - /* The bounds of the box (inclusive); expressed as histogram indexes */ - int c0min, c0max; - int c1min, c1max; - int c2min, c2max; - /* The volume (actually 2-norm) of the box */ - JPEG_INT32 volume; - /* The number of nonzero histogram cells within this box */ - long colorcount; -} box; - -typedef box * boxptr; - - -LOCAL(boxptr) -find_biggest_color_pop (boxptr boxlist, int numboxes) -/* Find the splittable box with the largest color population */ -/* Returns NULL if no splittable boxes remain */ -{ - register boxptr boxp; - register int i; - register long maxc = 0; - boxptr which = NULL; - - for (i = 0, boxp = boxlist; i < numboxes; i++, boxp++) { - if (boxp->colorcount > maxc && boxp->volume > 0) { - which = boxp; - maxc = boxp->colorcount; - } - } - return which; -} - - -LOCAL(boxptr) -find_biggest_volume (boxptr boxlist, int numboxes) -/* Find the splittable box with the largest (scaled) volume */ -/* Returns NULL if no splittable boxes remain */ -{ - register boxptr boxp; - register int i; - register JPEG_INT32 maxv = 0; - boxptr which = NULL; - - for (i = 0, boxp = boxlist; i < numboxes; i++, boxp++) { - if (boxp->volume > maxv) { - which = boxp; - maxv = boxp->volume; - } - } - return which; -} - - -LOCAL(void) -update_box (j_decompress_ptr cinfo, boxptr boxp) -/* Shrink the min/max bounds of a box to enclose only nonzero elements, */ -/* and recompute its volume and population */ -{ - my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize; - hist3d histogram = cquantize->histogram; - histptr histp; - int c0,c1,c2; - int c0min,c0max,c1min,c1max,c2min,c2max; - JPEG_INT32 dist0,dist1,dist2; - long ccount; - - c0min = boxp->c0min; c0max = boxp->c0max; - c1min = boxp->c1min; c1max = boxp->c1max; - c2min = boxp->c2min; c2max = boxp->c2max; - - if (c0max > c0min) - for (c0 = c0min; c0 <= c0max; c0++) - for (c1 = c1min; c1 <= c1max; c1++) { - histp = & histogram[c0][c1][c2min]; - for (c2 = c2min; c2 <= c2max; c2++) - if (*histp++ != 0) { - boxp->c0min = c0min = c0; - goto have_c0min; - } - } - have_c0min: - if (c0max > c0min) - for (c0 = c0max; c0 >= c0min; c0--) - for (c1 = c1min; c1 <= c1max; c1++) { - histp = & histogram[c0][c1][c2min]; - for (c2 = c2min; c2 <= c2max; c2++) - if (*histp++ != 0) { - boxp->c0max = c0max = c0; - goto have_c0max; - } - } - have_c0max: - if (c1max > c1min) - for (c1 = c1min; c1 <= c1max; c1++) - for (c0 = c0min; c0 <= c0max; c0++) { - histp = & histogram[c0][c1][c2min]; - for (c2 = c2min; c2 <= c2max; c2++) - if (*histp++ != 0) { - boxp->c1min = c1min = c1; - goto have_c1min; - } - } - have_c1min: - if (c1max > c1min) - for (c1 = c1max; c1 >= c1min; c1--) - for (c0 = c0min; c0 <= c0max; c0++) { - histp = & histogram[c0][c1][c2min]; - for (c2 = c2min; c2 <= c2max; c2++) - if (*histp++ != 0) { - boxp->c1max = c1max = c1; - goto have_c1max; - } - } - have_c1max: - if (c2max > c2min) - for (c2 = c2min; c2 <= c2max; c2++) - for (c0 = c0min; c0 <= c0max; c0++) { - histp = & histogram[c0][c1min][c2]; - for (c1 = c1min; c1 <= c1max; c1++, histp += HIST_C2_ELEMS) - if (*histp != 0) { - boxp->c2min = c2min = c2; - goto have_c2min; - } - } - have_c2min: - if (c2max > c2min) - for (c2 = c2max; c2 >= c2min; c2--) - for (c0 = c0min; c0 <= c0max; c0++) { - histp = & histogram[c0][c1min][c2]; - for (c1 = c1min; c1 <= c1max; c1++, histp += HIST_C2_ELEMS) - if (*histp != 0) { - boxp->c2max = c2max = c2; - goto have_c2max; - } - } - have_c2max: - - /* Update box volume. - * We use 2-norm rather than real volume here; this biases the method - * against making long narrow boxes, and it has the side benefit that - * a box is splittable iff norm > 0. - * Since the differences are expressed in histogram-cell units, - * we have to shift back to JSAMPLE units to get consistent distances; - * after which, we scale according to the selected distance scale factors. - */ - dist0 = ((c0max - c0min) << C0_SHIFT) * C0_SCALE; - dist1 = ((c1max - c1min) << C1_SHIFT) * C1_SCALE; - dist2 = ((c2max - c2min) << C2_SHIFT) * C2_SCALE; - boxp->volume = dist0*dist0 + dist1*dist1 + dist2*dist2; - - /* Now scan remaining volume of box and compute population */ - ccount = 0; - for (c0 = c0min; c0 <= c0max; c0++) - for (c1 = c1min; c1 <= c1max; c1++) { - histp = & histogram[c0][c1][c2min]; - for (c2 = c2min; c2 <= c2max; c2++, histp++) - if (*histp != 0) { - ccount++; - } - } - boxp->colorcount = ccount; -} - - -LOCAL(int) -median_cut (j_decompress_ptr cinfo, boxptr boxlist, int numboxes, - int desired_colors) -/* Repeatedly select and split the largest box until we have enough boxes */ -{ - int n,lb; - int c0,c1,c2,cmax; - register boxptr b1,b2; - - while (numboxes < desired_colors) { - /* Select box to split. - * Current algorithm: by population for first half, then by volume. - */ - if (numboxes*2 <= desired_colors) { - b1 = find_biggest_color_pop(boxlist, numboxes); - } else { - b1 = find_biggest_volume(boxlist, numboxes); - } - if (b1 == NULL) /* no splittable boxes left! */ - break; - b2 = &boxlist[numboxes]; /* where new box will go */ - /* Copy the color bounds to the new box. */ - b2->c0max = b1->c0max; b2->c1max = b1->c1max; b2->c2max = b1->c2max; - b2->c0min = b1->c0min; b2->c1min = b1->c1min; b2->c2min = b1->c2min; - /* Choose which axis to split the box on. - * Current algorithm: longest scaled axis. - * See notes in update_box about scaling distances. - */ - c0 = ((b1->c0max - b1->c0min) << C0_SHIFT) * C0_SCALE; - c1 = ((b1->c1max - b1->c1min) << C1_SHIFT) * C1_SCALE; - c2 = ((b1->c2max - b1->c2min) << C2_SHIFT) * C2_SCALE; - /* We want to break any ties in favor of green, then red, blue last. - * This code does the right thing for R,G,B or B,G,R color orders only. - */ -#if RGB_RED == 0 - cmax = c1; n = 1; - if (c0 > cmax) { cmax = c0; n = 0; } - if (c2 > cmax) { n = 2; } -#else - cmax = c1; n = 1; - if (c2 > cmax) { cmax = c2; n = 2; } - if (c0 > cmax) { n = 0; } -#endif - /* Choose split point along selected axis, and update box bounds. - * Current algorithm: split at halfway point. - * (Since the box has been shrunk to minimum volume, - * any split will produce two nonempty subboxes.) - * Note that lb value is max for lower box, so must be < old max. - */ - switch (n) { - case 0: - lb = (b1->c0max + b1->c0min) / 2; - b1->c0max = lb; - b2->c0min = lb+1; - break; - case 1: - lb = (b1->c1max + b1->c1min) / 2; - b1->c1max = lb; - b2->c1min = lb+1; - break; - case 2: - lb = (b1->c2max + b1->c2min) / 2; - b1->c2max = lb; - b2->c2min = lb+1; - break; - } - /* Update stats for boxes */ - update_box(cinfo, b1); - update_box(cinfo, b2); - numboxes++; - } - return numboxes; -} - - -LOCAL(void) -compute_color (j_decompress_ptr cinfo, boxptr boxp, int icolor) -/* Compute representative color for a box, put it in colormap[icolor] */ -{ - /* Current algorithm: mean weighted by pixels (not colors) */ - /* Note it is important to get the rounding correct! */ - my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize; - hist3d histogram = cquantize->histogram; - histptr histp; - int c0,c1,c2; - int c0min,c0max,c1min,c1max,c2min,c2max; - long count; - long total = 0; - long c0total = 0; - long c1total = 0; - long c2total = 0; - - c0min = boxp->c0min; c0max = boxp->c0max; - c1min = boxp->c1min; c1max = boxp->c1max; - c2min = boxp->c2min; c2max = boxp->c2max; - - for (c0 = c0min; c0 <= c0max; c0++) - for (c1 = c1min; c1 <= c1max; c1++) { - histp = & histogram[c0][c1][c2min]; - for (c2 = c2min; c2 <= c2max; c2++) { - if ((count = *histp++) != 0) { - total += count; - c0total += ((c0 << C0_SHIFT) + ((1<>1)) * count; - c1total += ((c1 << C1_SHIFT) + ((1<>1)) * count; - c2total += ((c2 << C2_SHIFT) + ((1<>1)) * count; - } - } - } - - cinfo->colormap[0][icolor] = (JSAMPLE) ((c0total + (total>>1)) / total); - cinfo->colormap[1][icolor] = (JSAMPLE) ((c1total + (total>>1)) / total); - cinfo->colormap[2][icolor] = (JSAMPLE) ((c2total + (total>>1)) / total); -} - - -LOCAL(void) -select_colors (j_decompress_ptr cinfo, int desired_colors) -/* Master routine for color selection */ -{ - boxptr boxlist; - int numboxes; - int i; - - /* Allocate workspace for box list */ - boxlist = (boxptr) (*cinfo->mem->alloc_small) - ((j_common_ptr) cinfo, JPOOL_IMAGE, desired_colors * SIZEOF(box)); - /* Initialize one box containing whole space */ - numboxes = 1; - boxlist[0].c0min = 0; - boxlist[0].c0max = MAXJSAMPLE >> C0_SHIFT; - boxlist[0].c1min = 0; - boxlist[0].c1max = MAXJSAMPLE >> C1_SHIFT; - boxlist[0].c2min = 0; - boxlist[0].c2max = MAXJSAMPLE >> C2_SHIFT; - /* Shrink it to actually-used volume and set its statistics */ - update_box(cinfo, & boxlist[0]); - /* Perform median-cut to produce final box list */ - numboxes = median_cut(cinfo, boxlist, numboxes, desired_colors); - /* Compute the representative color for each box, fill colormap */ - for (i = 0; i < numboxes; i++) - compute_color(cinfo, & boxlist[i], i); - cinfo->actual_number_of_colors = numboxes; - TRACEMS1(cinfo, 1, JTRC_QUANT_SELECTED, numboxes); -} - - -/* - * These routines are concerned with the time-critical task of mapping input - * colors to the nearest color in the selected colormap. - * - * We re-use the histogram space as an "inverse color map", essentially a - * cache for the results of nearest-color searches. All colors within a - * histogram cell will be mapped to the same colormap entry, namely the one - * closest to the cell's center. This may not be quite the closest entry to - * the actual input color, but it's almost as good. A zero in the cache - * indicates we haven't found the nearest color for that cell yet; the array - * is cleared to zeroes before starting the mapping pass. When we find the - * nearest color for a cell, its colormap index plus one is recorded in the - * cache for future use. The pass2 scanning routines call fill_inverse_cmap - * when they need to use an unfilled entry in the cache. - * - * Our method of efficiently finding nearest colors is based on the "locally - * sorted search" idea described by Heckbert and on the incremental distance - * calculation described by Spencer W. Thomas in chapter III.1 of Graphics - * Gems II (James Arvo, ed. Academic Press, 1991). Thomas points out that - * the distances from a given colormap entry to each cell of the histogram can - * be computed quickly using an incremental method: the differences between - * distances to adjacent cells themselves differ by a constant. This allows a - * fairly fast implementation of the "brute force" approach of computing the - * distance from every colormap entry to every histogram cell. Unfortunately, - * it needs a work array to hold the best-distance-so-far for each histogram - * cell (because the inner loop has to be over cells, not colormap entries). - * The work array elements have to be INT32s, so the work array would need - * 256Kb at our recommended precision. This is not feasible in DOS machines. - * - * To get around these problems, we apply Thomas' method to compute the - * nearest colors for only the cells within a small subbox of the histogram. - * The work array need be only as big as the subbox, so the memory usage - * problem is solved. Furthermore, we need not fill subboxes that are never - * referenced in pass2; many images use only part of the color gamut, so a - * fair amount of work is saved. An additional advantage of this - * approach is that we can apply Heckbert's locality criterion to quickly - * eliminate colormap entries that are far away from the subbox; typically - * three-fourths of the colormap entries are rejected by Heckbert's criterion, - * and we need not compute their distances to individual cells in the subbox. - * The speed of this approach is heavily influenced by the subbox size: too - * small means too much overhead, too big loses because Heckbert's criterion - * can't eliminate as many colormap entries. Empirically the best subbox - * size seems to be about 1/512th of the histogram (1/8th in each direction). - * - * Thomas' article also describes a refined method which is asymptotically - * faster than the brute-force method, but it is also far more complex and - * cannot efficiently be applied to small subboxes. It is therefore not - * useful for programs intended to be portable to DOS machines. On machines - * with plenty of memory, filling the whole histogram in one shot with Thomas' - * refined method might be faster than the present code --- but then again, - * it might not be any faster, and it's certainly more complicated. - */ - - -/* log2(histogram cells in update box) for each axis; this can be adjusted */ -#define BOX_C0_LOG (HIST_C0_BITS-3) -#define BOX_C1_LOG (HIST_C1_BITS-3) -#define BOX_C2_LOG (HIST_C2_BITS-3) - -#define BOX_C0_ELEMS (1<actual_number_of_colors; - int maxc0, maxc1, maxc2; - int centerc0, centerc1, centerc2; - int i, x, ncolors; - JPEG_INT32 minmaxdist, min_dist, max_dist, tdist; - JPEG_INT32 mindist[MAXNUMCOLORS]; /* min distance to colormap entry i */ - - /* Compute true coordinates of update box's upper corner and center. - * Actually we compute the coordinates of the center of the upper-corner - * histogram cell, which are the upper bounds of the volume we care about. - * Note that since ">>" rounds down, the "center" values may be closer to - * min than to max; hence comparisons to them must be "<=", not "<". - */ - maxc0 = minc0 + ((1 << BOX_C0_SHIFT) - (1 << C0_SHIFT)); - centerc0 = (minc0 + maxc0) >> 1; - maxc1 = minc1 + ((1 << BOX_C1_SHIFT) - (1 << C1_SHIFT)); - centerc1 = (minc1 + maxc1) >> 1; - maxc2 = minc2 + ((1 << BOX_C2_SHIFT) - (1 << C2_SHIFT)); - centerc2 = (minc2 + maxc2) >> 1; - - /* For each color in colormap, find: - * 1. its minimum squared-distance to any point in the update box - * (zero if color is within update box); - * 2. its maximum squared-distance to any point in the update box. - * Both of these can be found by considering only the corners of the box. - * We save the minimum distance for each color in mindist[]; - * only the smallest maximum distance is of interest. - */ - minmaxdist = 0x7FFFFFFFL; - - for (i = 0; i < numcolors; i++) { - /* We compute the squared-c0-distance term, then add in the other two. */ - x = GETJSAMPLE(cinfo->colormap[0][i]); - if (x < minc0) { - tdist = (x - minc0) * C0_SCALE; - min_dist = tdist*tdist; - tdist = (x - maxc0) * C0_SCALE; - max_dist = tdist*tdist; - } else if (x > maxc0) { - tdist = (x - maxc0) * C0_SCALE; - min_dist = tdist*tdist; - tdist = (x - minc0) * C0_SCALE; - max_dist = tdist*tdist; - } else { - /* within cell range so no contribution to min_dist */ - min_dist = 0; - if (x <= centerc0) { - tdist = (x - maxc0) * C0_SCALE; - max_dist = tdist*tdist; - } else { - tdist = (x - minc0) * C0_SCALE; - max_dist = tdist*tdist; - } - } - - x = GETJSAMPLE(cinfo->colormap[1][i]); - if (x < minc1) { - tdist = (x - minc1) * C1_SCALE; - min_dist += tdist*tdist; - tdist = (x - maxc1) * C1_SCALE; - max_dist += tdist*tdist; - } else if (x > maxc1) { - tdist = (x - maxc1) * C1_SCALE; - min_dist += tdist*tdist; - tdist = (x - minc1) * C1_SCALE; - max_dist += tdist*tdist; - } else { - /* within cell range so no contribution to min_dist */ - if (x <= centerc1) { - tdist = (x - maxc1) * C1_SCALE; - max_dist += tdist*tdist; - } else { - tdist = (x - minc1) * C1_SCALE; - max_dist += tdist*tdist; - } - } - - x = GETJSAMPLE(cinfo->colormap[2][i]); - if (x < minc2) { - tdist = (x - minc2) * C2_SCALE; - min_dist += tdist*tdist; - tdist = (x - maxc2) * C2_SCALE; - max_dist += tdist*tdist; - } else if (x > maxc2) { - tdist = (x - maxc2) * C2_SCALE; - min_dist += tdist*tdist; - tdist = (x - minc2) * C2_SCALE; - max_dist += tdist*tdist; - } else { - /* within cell range so no contribution to min_dist */ - if (x <= centerc2) { - tdist = (x - maxc2) * C2_SCALE; - max_dist += tdist*tdist; - } else { - tdist = (x - minc2) * C2_SCALE; - max_dist += tdist*tdist; - } - } - - mindist[i] = min_dist; /* save away the results */ - if (max_dist < minmaxdist) - minmaxdist = max_dist; - } - - /* Now we know that no cell in the update box is more than minmaxdist - * away from some colormap entry. Therefore, only colors that are - * within minmaxdist of some part of the box need be considered. - */ - ncolors = 0; - for (i = 0; i < numcolors; i++) { - if (mindist[i] <= minmaxdist) - colorlist[ncolors++] = (JSAMPLE) i; - } - return ncolors; -} - - -LOCAL(void) -find_best_colors (j_decompress_ptr cinfo, int minc0, int minc1, int minc2, - int numcolors, JSAMPLE colorlist[], JSAMPLE bestcolor[]) -/* Find the closest colormap entry for each cell in the update box, - * given the list of candidate colors prepared by find_nearby_colors. - * Return the indexes of the closest entries in the bestcolor[] array. - * This routine uses Thomas' incremental distance calculation method to - * find the distance from a colormap entry to successive cells in the box. - */ -{ - int ic0, ic1, ic2; - int i, icolor; - register JPEG_INT32 * bptr; /* pointer into bestdist[] array */ - JSAMPLE * cptr; /* pointer into bestcolor[] array */ - JPEG_INT32 dist0, dist1; /* initial distance values */ - register JPEG_INT32 dist2; /* current distance in inner loop */ - JPEG_INT32 xx0, xx1; /* distance increments */ - register JPEG_INT32 xx2; - JPEG_INT32 inc0, inc1, inc2; /* initial values for increments */ - /* This array holds the distance to the nearest-so-far color for each cell */ - JPEG_INT32 bestdist[BOX_C0_ELEMS * BOX_C1_ELEMS * BOX_C2_ELEMS]; - - /* Initialize best-distance for each cell of the update box */ - bptr = bestdist; - for (i = BOX_C0_ELEMS*BOX_C1_ELEMS*BOX_C2_ELEMS-1; i >= 0; i--) - *bptr++ = 0x7FFFFFFFL; - - /* For each color selected by find_nearby_colors, - * compute its distance to the center of each cell in the box. - * If that's less than best-so-far, update best distance and color number. - */ - - /* Nominal steps between cell centers ("x" in Thomas article) */ -#define STEP_C0 ((1 << C0_SHIFT) * C0_SCALE) -#define STEP_C1 ((1 << C1_SHIFT) * C1_SCALE) -#define STEP_C2 ((1 << C2_SHIFT) * C2_SCALE) - - for (i = 0; i < numcolors; i++) { - icolor = GETJSAMPLE(colorlist[i]); - /* Compute (square of) distance from minc0/c1/c2 to this color */ - inc0 = (minc0 - GETJSAMPLE(cinfo->colormap[0][icolor])) * C0_SCALE; - dist0 = inc0*inc0; - inc1 = (minc1 - GETJSAMPLE(cinfo->colormap[1][icolor])) * C1_SCALE; - dist0 += inc1*inc1; - inc2 = (minc2 - GETJSAMPLE(cinfo->colormap[2][icolor])) * C2_SCALE; - dist0 += inc2*inc2; - /* Form the initial difference increments */ - inc0 = inc0 * (2 * STEP_C0) + STEP_C0 * STEP_C0; - inc1 = inc1 * (2 * STEP_C1) + STEP_C1 * STEP_C1; - inc2 = inc2 * (2 * STEP_C2) + STEP_C2 * STEP_C2; - /* Now loop over all cells in box, updating distance per Thomas method */ - bptr = bestdist; - cptr = bestcolor; - xx0 = inc0; - for (ic0 = BOX_C0_ELEMS-1; ic0 >= 0; ic0--) { - dist1 = dist0; - xx1 = inc1; - for (ic1 = BOX_C1_ELEMS-1; ic1 >= 0; ic1--) { - dist2 = dist1; - xx2 = inc2; - for (ic2 = BOX_C2_ELEMS-1; ic2 >= 0; ic2--) { - if (dist2 < *bptr) { - *bptr = dist2; - *cptr = (JSAMPLE) icolor; - } - dist2 += xx2; - xx2 += 2 * STEP_C2 * STEP_C2; - bptr++; - cptr++; - } - dist1 += xx1; - xx1 += 2 * STEP_C1 * STEP_C1; - } - dist0 += xx0; - xx0 += 2 * STEP_C0 * STEP_C0; - } - } -} - - -LOCAL(void) -fill_inverse_cmap (j_decompress_ptr cinfo, int c0, int c1, int c2) -/* Fill the inverse-colormap entries in the update box that contains */ -/* histogram cell c0/c1/c2. (Only that one cell MUST be filled, but */ -/* we can fill as many others as we wish.) */ -{ - my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize; - hist3d histogram = cquantize->histogram; - int minc0, minc1, minc2; /* lower left corner of update box */ - int ic0, ic1, ic2; - register JSAMPLE * cptr; /* pointer into bestcolor[] array */ - register histptr cachep; /* pointer into main cache array */ - /* This array lists the candidate colormap indexes. */ - JSAMPLE colorlist[MAXNUMCOLORS]; - int numcolors; /* number of candidate colors */ - /* This array holds the actually closest colormap index for each cell. */ - JSAMPLE bestcolor[BOX_C0_ELEMS * BOX_C1_ELEMS * BOX_C2_ELEMS]; - - /* Convert cell coordinates to update box ID */ - c0 >>= BOX_C0_LOG; - c1 >>= BOX_C1_LOG; - c2 >>= BOX_C2_LOG; - - /* Compute true coordinates of update box's origin corner. - * Actually we compute the coordinates of the center of the corner - * histogram cell, which are the lower bounds of the volume we care about. - */ - minc0 = (c0 << BOX_C0_SHIFT) + ((1 << C0_SHIFT) >> 1); - minc1 = (c1 << BOX_C1_SHIFT) + ((1 << C1_SHIFT) >> 1); - minc2 = (c2 << BOX_C2_SHIFT) + ((1 << C2_SHIFT) >> 1); - - /* Determine which colormap entries are close enough to be candidates - * for the nearest entry to some cell in the update box. - */ - numcolors = find_nearby_colors(cinfo, minc0, minc1, minc2, colorlist); - - /* Determine the actually nearest colors. */ - find_best_colors(cinfo, minc0, minc1, minc2, numcolors, colorlist, - bestcolor); - - /* Save the best color numbers (plus 1) in the main cache array */ - c0 <<= BOX_C0_LOG; /* convert ID back to base cell indexes */ - c1 <<= BOX_C1_LOG; - c2 <<= BOX_C2_LOG; - cptr = bestcolor; - for (ic0 = 0; ic0 < BOX_C0_ELEMS; ic0++) { - for (ic1 = 0; ic1 < BOX_C1_ELEMS; ic1++) { - cachep = & histogram[c0+ic0][c1+ic1][c2]; - for (ic2 = 0; ic2 < BOX_C2_ELEMS; ic2++) { - *cachep++ = (histcell) (GETJSAMPLE(*cptr++) + 1); - } - } - } -} - - -/* - * Map some rows of pixels to the output colormapped representation. - */ - -METHODDEF(void) -pass2_no_dither (j_decompress_ptr cinfo, - JSAMPARRAY input_buf, JSAMPARRAY output_buf, int num_rows) -/* This version performs no dithering */ -{ - my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize; - hist3d histogram = cquantize->histogram; - register JSAMPROW inptr, outptr; - register histptr cachep; - register int c0, c1, c2; - int row; - JDIMENSION col; - JDIMENSION width = cinfo->output_width; - - for (row = 0; row < num_rows; row++) { - inptr = input_buf[row]; - outptr = output_buf[row]; - for (col = width; col > 0; col--) { - /* get pixel value and index into the cache */ - c0 = GETJSAMPLE(*inptr++) >> C0_SHIFT; - c1 = GETJSAMPLE(*inptr++) >> C1_SHIFT; - c2 = GETJSAMPLE(*inptr++) >> C2_SHIFT; - cachep = & histogram[c0][c1][c2]; - /* If we have not seen this color before, find nearest colormap entry */ - /* and update the cache */ - if (*cachep == 0) - fill_inverse_cmap(cinfo, c0,c1,c2); - /* Now emit the colormap index for this cell */ - *outptr++ = (JSAMPLE) (*cachep - 1); - } - } -} - - -METHODDEF(void) -pass2_fs_dither (j_decompress_ptr cinfo, - JSAMPARRAY input_buf, JSAMPARRAY output_buf, int num_rows) -/* This version performs Floyd-Steinberg dithering */ -{ - my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize; - hist3d histogram = cquantize->histogram; - register LOCFSERROR cur0, cur1, cur2; /* current error or pixel value */ - LOCFSERROR belowerr0, belowerr1, belowerr2; /* error for pixel below cur */ - LOCFSERROR bpreverr0, bpreverr1, bpreverr2; /* error for below/prev col */ - register FSERRPTR errorptr; /* => fserrors[] at column before current */ - JSAMPROW inptr; /* => current input pixel */ - JSAMPROW outptr; /* => current output pixel */ - histptr cachep; - int dir; /* +1 or -1 depending on direction */ - int dir3; /* 3*dir, for advancing inptr & errorptr */ - int row; - JDIMENSION col; - JDIMENSION width = cinfo->output_width; - JSAMPLE *range_limit = cinfo->sample_range_limit; - int *error_limit = cquantize->error_limiter; - JSAMPROW colormap0 = cinfo->colormap[0]; - JSAMPROW colormap1 = cinfo->colormap[1]; - JSAMPROW colormap2 = cinfo->colormap[2]; - SHIFT_TEMPS - - for (row = 0; row < num_rows; row++) { - inptr = input_buf[row]; - outptr = output_buf[row]; - if (cquantize->on_odd_row) { - /* work right to left in this row */ - inptr += (width-1) * 3; /* so point to rightmost pixel */ - outptr += width-1; - dir = -1; - dir3 = -3; - errorptr = cquantize->fserrors + (width+1)*3; /* => entry after last column */ - cquantize->on_odd_row = FALSE; /* flip for next time */ - } else { - /* work left to right in this row */ - dir = 1; - dir3 = 3; - errorptr = cquantize->fserrors; /* => entry before first real column */ - cquantize->on_odd_row = TRUE; /* flip for next time */ - } - /* Preset error values: no error propagated to first pixel from left */ - cur0 = cur1 = cur2 = 0; - /* and no error propagated to row below yet */ - belowerr0 = belowerr1 = belowerr2 = 0; - bpreverr0 = bpreverr1 = bpreverr2 = 0; - - for (col = width; col > 0; col--) { - /* curN holds the error propagated from the previous pixel on the - * current line. Add the error propagated from the previous line - * to form the complete error correction term for this pixel, and - * round the error term (which is expressed * 16) to an integer. - * RIGHT_SHIFT rounds towards minus infinity, so adding 8 is correct - * for either sign of the error value. - * Note: errorptr points to *previous* column's array entry. - */ - cur0 = RIGHT_SHIFT(cur0 + errorptr[dir3+0] + 8, 4); - cur1 = RIGHT_SHIFT(cur1 + errorptr[dir3+1] + 8, 4); - cur2 = RIGHT_SHIFT(cur2 + errorptr[dir3+2] + 8, 4); - /* Limit the error using transfer function set by init_error_limit. - * See comments with init_error_limit for rationale. - */ - cur0 = error_limit[cur0]; - cur1 = error_limit[cur1]; - cur2 = error_limit[cur2]; - /* Form pixel value + error, and range-limit to 0..MAXJSAMPLE. - * The maximum error is +- MAXJSAMPLE (or less with error limiting); - * this sets the required size of the range_limit array. - */ - cur0 += GETJSAMPLE(inptr[0]); - cur1 += GETJSAMPLE(inptr[1]); - cur2 += GETJSAMPLE(inptr[2]); - cur0 = GETJSAMPLE(range_limit[cur0]); - cur1 = GETJSAMPLE(range_limit[cur1]); - cur2 = GETJSAMPLE(range_limit[cur2]); - /* Index into the cache with adjusted pixel value */ - cachep = & histogram[cur0>>C0_SHIFT][cur1>>C1_SHIFT][cur2>>C2_SHIFT]; - /* If we have not seen this color before, find nearest colormap */ - /* entry and update the cache */ - if (*cachep == 0) - fill_inverse_cmap(cinfo, cur0>>C0_SHIFT,cur1>>C1_SHIFT,cur2>>C2_SHIFT); - /* Now emit the colormap index for this cell */ - { register int pixcode = *cachep - 1; - *outptr = (JSAMPLE) pixcode; - /* Compute representation error for this pixel */ - cur0 -= GETJSAMPLE(colormap0[pixcode]); - cur1 -= GETJSAMPLE(colormap1[pixcode]); - cur2 -= GETJSAMPLE(colormap2[pixcode]); - } - /* Compute error fractions to be propagated to adjacent pixels. - * Add these into the running sums, and simultaneously shift the - * next-line error sums left by 1 column. - */ - { register LOCFSERROR bnexterr, delta; - - bnexterr = cur0; /* Process component 0 */ - delta = cur0 * 2; - cur0 += delta; /* form error * 3 */ - errorptr[0] = (FSERROR) (bpreverr0 + cur0); - cur0 += delta; /* form error * 5 */ - bpreverr0 = belowerr0 + cur0; - belowerr0 = bnexterr; - cur0 += delta; /* form error * 7 */ - bnexterr = cur1; /* Process component 1 */ - delta = cur1 * 2; - cur1 += delta; /* form error * 3 */ - errorptr[1] = (FSERROR) (bpreverr1 + cur1); - cur1 += delta; /* form error * 5 */ - bpreverr1 = belowerr1 + cur1; - belowerr1 = bnexterr; - cur1 += delta; /* form error * 7 */ - bnexterr = cur2; /* Process component 2 */ - delta = cur2 * 2; - cur2 += delta; /* form error * 3 */ - errorptr[2] = (FSERROR) (bpreverr2 + cur2); - cur2 += delta; /* form error * 5 */ - bpreverr2 = belowerr2 + cur2; - belowerr2 = bnexterr; - cur2 += delta; /* form error * 7 */ - } - /* At this point curN contains the 7/16 error value to be propagated - * to the next pixel on the current line, and all the errors for the - * next line have been shifted over. We are therefore ready to move on. - */ - inptr += dir3; /* Advance pixel pointers to next column */ - outptr += dir; - errorptr += dir3; /* advance errorptr to current column */ - } - /* Post-loop cleanup: we must unload the final error values into the - * final fserrors[] entry. Note we need not unload belowerrN because - * it is for the dummy column before or after the actual array. - */ - errorptr[0] = (FSERROR) bpreverr0; /* unload prev errs into array */ - errorptr[1] = (FSERROR) bpreverr1; - errorptr[2] = (FSERROR) bpreverr2; - } -} - - -/* - * Initialize the error-limiting transfer function (lookup table). - * The raw F-S error computation can potentially compute error values of up to - * +- MAXJSAMPLE. But we want the maximum correction applied to a pixel to be - * much less, otherwise obviously wrong pixels will be created. (Typical - * effects include weird fringes at color-area boundaries, isolated bright - * pixels in a dark area, etc.) The standard advice for avoiding this problem - * is to ensure that the "corners" of the color cube are allocated as output - * colors; then repeated errors in the same direction cannot cause cascading - * error buildup. However, that only prevents the error from getting - * completely out of hand; Aaron Giles reports that error limiting improves - * the results even with corner colors allocated. - * A simple clamping of the error values to about +- MAXJSAMPLE/8 works pretty - * well, but the smoother transfer function used below is even better. Thanks - * to Aaron Giles for this idea. - */ - -LOCAL(void) -init_error_limit (j_decompress_ptr cinfo) -/* Allocate and fill in the error_limiter table */ -{ - my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize; - int * table; - int in, out; - - table = (int *) (*cinfo->mem->alloc_small) - ((j_common_ptr) cinfo, JPOOL_IMAGE, (MAXJSAMPLE*2+1) * SIZEOF(int)); - table += MAXJSAMPLE; /* so can index -MAXJSAMPLE .. +MAXJSAMPLE */ - cquantize->error_limiter = table; - -#define STEPSIZE ((MAXJSAMPLE+1)/16) - /* Map errors 1:1 up to +- MAXJSAMPLE/16 */ - out = 0; - for (in = 0; in < STEPSIZE; in++, out++) { - table[in] = out; table[-in] = -out; - } - /* Map errors 1:2 up to +- 3*MAXJSAMPLE/16 */ - for (; in < STEPSIZE*3; in++, out += (in&1) ? 0 : 1) { - table[in] = out; table[-in] = -out; - } - /* Clamp the rest to final out value (which is (MAXJSAMPLE+1)/8) */ - for (; in <= MAXJSAMPLE; in++) { - table[in] = out; table[-in] = -out; - } -#undef STEPSIZE -} - - -/* - * Finish up at the end of each pass. - */ - -METHODDEF(void) -finish_pass1 (j_decompress_ptr cinfo) -{ - my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize; - - /* Select the representative colors and fill in cinfo->colormap */ - cinfo->colormap = cquantize->sv_colormap; - select_colors(cinfo, cquantize->desired); - /* Force next pass to zero the color index table */ - cquantize->needs_zeroed = TRUE; -} - - -METHODDEF(void) -finish_pass2 (j_decompress_ptr cinfo) -{ - /* no work */ -} - - -/* - * Initialize for each processing pass. - */ - -METHODDEF(void) -start_pass_2_quant (j_decompress_ptr cinfo, wxjpeg_boolean is_pre_scan) -{ - my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize; - hist3d histogram = cquantize->histogram; - int i; - - /* Only F-S dithering or no dithering is supported. */ - /* If user asks for ordered dither, give him F-S. */ - if (cinfo->dither_mode != JDITHER_NONE) - cinfo->dither_mode = JDITHER_FS; - - if (is_pre_scan) { - /* Set up method pointers */ - cquantize->pub.color_quantize = prescan_quantize; - cquantize->pub.finish_pass = finish_pass1; - cquantize->needs_zeroed = TRUE; /* Always zero histogram */ - } else { - /* Set up method pointers */ - if (cinfo->dither_mode == JDITHER_FS) - cquantize->pub.color_quantize = pass2_fs_dither; - else - cquantize->pub.color_quantize = pass2_no_dither; - cquantize->pub.finish_pass = finish_pass2; - - /* Make sure color count is acceptable */ - i = cinfo->actual_number_of_colors; - if (i < 1) - ERREXIT1(cinfo, JERR_QUANT_FEW_COLORS, 1); - if (i > MAXNUMCOLORS) - ERREXIT1(cinfo, JERR_QUANT_MANY_COLORS, MAXNUMCOLORS); - - if (cinfo->dither_mode == JDITHER_FS) { - size_t arraysize = (size_t) ((cinfo->output_width + 2) * - (3 * SIZEOF(FSERROR))); - /* Allocate Floyd-Steinberg workspace if we didn't already. */ - if (cquantize->fserrors == NULL) - cquantize->fserrors = (FSERRPTR) (*cinfo->mem->alloc_large) - ((j_common_ptr) cinfo, JPOOL_IMAGE, arraysize); - /* Initialize the propagated errors to zero. */ - jzero_far((void FAR *) cquantize->fserrors, arraysize); - /* Make the error-limit table if we didn't already. */ - if (cquantize->error_limiter == NULL) - init_error_limit(cinfo); - cquantize->on_odd_row = FALSE; - } - - } - /* Zero the histogram or inverse color map, if necessary */ - if (cquantize->needs_zeroed) { - for (i = 0; i < HIST_C0_ELEMS; i++) { - jzero_far((void FAR *) histogram[i], - HIST_C1_ELEMS*HIST_C2_ELEMS * SIZEOF(histcell)); - } - cquantize->needs_zeroed = FALSE; - } -} - - -/* - * Switch to a new external colormap between output passes. - */ - -METHODDEF(void) -new_color_map_2_quant (j_decompress_ptr cinfo) -{ - my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize; - - /* Reset the inverse color map */ - cquantize->needs_zeroed = TRUE; -} - - -/* - * Module initialization routine for 2-pass color quantization. - */ - -GLOBAL(void) -jinit_2pass_quantizer (j_decompress_ptr cinfo) -{ - my_cquantize_ptr cquantize; - int i; - - cquantize = (my_cquantize_ptr) - (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, - SIZEOF(my_cquantizer)); - cinfo->cquantize = (struct jpeg_color_quantizer *) cquantize; - cquantize->pub.start_pass = start_pass_2_quant; - cquantize->pub.new_color_map = new_color_map_2_quant; - cquantize->fserrors = NULL; /* flag optional arrays not allocated */ - cquantize->error_limiter = NULL; - - /* Make sure jdmaster didn't give me a case I can't handle */ - if (cinfo->out_color_components != 3) - ERREXIT(cinfo, JERR_NOTIMPL); - - /* Allocate the histogram/inverse colormap storage */ - cquantize->histogram = (hist3d) (*cinfo->mem->alloc_small) - ((j_common_ptr) cinfo, JPOOL_IMAGE, HIST_C0_ELEMS * SIZEOF(hist2d)); - for (i = 0; i < HIST_C0_ELEMS; i++) { - cquantize->histogram[i] = (hist2d) (*cinfo->mem->alloc_large) - ((j_common_ptr) cinfo, JPOOL_IMAGE, - HIST_C1_ELEMS*HIST_C2_ELEMS * SIZEOF(histcell)); - } - cquantize->needs_zeroed = TRUE; /* histogram is garbage now */ - - /* Allocate storage for the completed colormap, if required. - * We do this now since it is FAR storage and may affect - * the memory manager's space calculations. - */ - if (cinfo->enable_2pass_quant) { - /* Make sure color count is acceptable */ - int desired = cinfo->desired_number_of_colors; - /* Lower bound on # of colors ... somewhat arbitrary as long as > 0 */ - if (desired < 8) - ERREXIT1(cinfo, JERR_QUANT_FEW_COLORS, 8); - /* Make sure colormap indexes can be represented by JSAMPLEs */ - if (desired > MAXNUMCOLORS) - ERREXIT1(cinfo, JERR_QUANT_MANY_COLORS, MAXNUMCOLORS); - cquantize->sv_colormap = (*cinfo->mem->alloc_sarray) - ((j_common_ptr) cinfo,JPOOL_IMAGE, (JDIMENSION) desired, (JDIMENSION) 3); - cquantize->desired = desired; - } else - cquantize->sv_colormap = NULL; - - /* Only F-S dithering or no dithering is supported. */ - /* If user asks for ordered dither, give him F-S. */ - if (cinfo->dither_mode != JDITHER_NONE) - cinfo->dither_mode = JDITHER_FS; - - /* Allocate Floyd-Steinberg workspace if necessary. - * This isn't really needed until pass 2, but again it is FAR storage. - * Although we will cope with a later change in dither_mode, - * we do not promise to honor max_memory_to_use if dither_mode changes. - */ - if (cinfo->dither_mode == JDITHER_FS) { - cquantize->fserrors = (FSERRPTR) (*cinfo->mem->alloc_large) - ((j_common_ptr) cinfo, JPOOL_IMAGE, - (size_t) ((cinfo->output_width + 2) * (3 * SIZEOF(FSERROR)))); - /* Might as well create the error-limiting table too. */ - init_error_limit(cinfo); - } -} - -#endif /* QUANT_2PASS_SUPPORTED */ diff --git a/wxWidgets/src/jpeg/jutils.c b/wxWidgets/src/jpeg/jutils.c deleted file mode 100644 index d18a955562..0000000000 --- a/wxWidgets/src/jpeg/jutils.c +++ /dev/null @@ -1,179 +0,0 @@ -/* - * jutils.c - * - * Copyright (C) 1991-1996, Thomas G. Lane. - * This file is part of the Independent JPEG Group's software. - * For conditions of distribution and use, see the accompanying README file. - * - * This file contains tables and miscellaneous utility routines needed - * for both compression and decompression. - * Note we prefix all global names with "j" to minimize conflicts with - * a surrounding application. - */ - -#define JPEG_INTERNALS -#include "jinclude.h" -#include "jpeglib.h" - - -/* - * jpeg_zigzag_order[i] is the zigzag-order position of the i'th element - * of a DCT block read in natural order (left to right, top to bottom). - */ - -#if 0 /* This table is not actually needed in v6a */ - -const int jpeg_zigzag_order[DCTSIZE2] = { - 0, 1, 5, 6, 14, 15, 27, 28, - 2, 4, 7, 13, 16, 26, 29, 42, - 3, 8, 12, 17, 25, 30, 41, 43, - 9, 11, 18, 24, 31, 40, 44, 53, - 10, 19, 23, 32, 39, 45, 52, 54, - 20, 22, 33, 38, 46, 51, 55, 60, - 21, 34, 37, 47, 50, 56, 59, 61, - 35, 36, 48, 49, 57, 58, 62, 63 -}; - -#endif - -/* - * jpeg_natural_order[i] is the natural-order position of the i'th element - * of zigzag order. - * - * When reading corrupted data, the Huffman decoders could attempt - * to reference an entry beyond the end of this array (if the decoded - * zero run length reaches past the end of the block). To prevent - * wild stores without adding an inner-loop test, we put some extra - * "63"s after the real entries. This will cause the extra coefficient - * to be stored in location 63 of the block, not somewhere random. - * The worst case would be a run-length of 15, which means we need 16 - * fake entries. - */ - -const int jpeg_natural_order[DCTSIZE2+16] = { - 0, 1, 8, 16, 9, 2, 3, 10, - 17, 24, 32, 25, 18, 11, 4, 5, - 12, 19, 26, 33, 40, 48, 41, 34, - 27, 20, 13, 6, 7, 14, 21, 28, - 35, 42, 49, 56, 57, 50, 43, 36, - 29, 22, 15, 23, 30, 37, 44, 51, - 58, 59, 52, 45, 38, 31, 39, 46, - 53, 60, 61, 54, 47, 55, 62, 63, - 63, 63, 63, 63, 63, 63, 63, 63, /* extra entries for safety in decoder */ - 63, 63, 63, 63, 63, 63, 63, 63 -}; - - -/* - * Arithmetic utilities - */ - -GLOBAL(long) -jdiv_round_up (long a, long b) -/* Compute a/b rounded up to next integer, ie, ceil(a/b) */ -/* Assumes a >= 0, b > 0 */ -{ - return (a + b - 1L) / b; -} - - -GLOBAL(long) -jround_up (long a, long b) -/* Compute a rounded up to next multiple of b, ie, ceil(a/b)*b */ -/* Assumes a >= 0, b > 0 */ -{ - a += b - 1L; - return a - (a % b); -} - - -/* On normal machines we can apply MEMCOPY() and MEMZERO() to sample arrays - * and coefficient-block arrays. This won't work on 80x86 because the arrays - * are FAR and we're assuming a small-pointer memory model. However, some - * DOS compilers provide far-pointer versions of memcpy() and memset() even - * in the small-model libraries. These will be used if USE_FMEM is defined. - * Otherwise, the routines below do it the hard way. (The performance cost - * is not all that great, because these routines aren't very heavily used.) - */ - -#ifndef NEED_FAR_POINTERS /* normal case, same as regular macros */ -#define FMEMCOPY(dest,src,size) MEMCOPY(dest,src,size) -#define FMEMZERO(target,size) MEMZERO(target,size) -#else /* 80x86 case, define if we can */ -#ifdef USE_FMEM -#define FMEMCOPY(dest,src,size) _fmemcpy((void FAR *)(dest), (const void FAR *)(src), (size_t)(size)) -#define FMEMZERO(target,size) _fmemset((void FAR *)(target), 0, (size_t)(size)) -#endif -#endif - - -GLOBAL(void) -jcopy_sample_rows (JSAMPARRAY input_array, int source_row, - JSAMPARRAY output_array, int dest_row, - int num_rows, JDIMENSION num_cols) -/* Copy some rows of samples from one place to another. - * num_rows rows are copied from input_array[source_row++] - * to output_array[dest_row++]; these areas may overlap for duplication. - * The source and destination arrays must be at least as wide as num_cols. - */ -{ - register JSAMPROW inptr, outptr; -#ifdef FMEMCOPY - register size_t count = (size_t) (num_cols * SIZEOF(JSAMPLE)); -#else - register JDIMENSION count; -#endif - register int row; - - input_array += source_row; - output_array += dest_row; - - for (row = num_rows; row > 0; row--) { - inptr = *input_array++; - outptr = *output_array++; -#ifdef FMEMCOPY - FMEMCOPY(outptr, inptr, count); -#else - for (count = num_cols; count > 0; count--) - *outptr++ = *inptr++; /* needn't bother with GETJSAMPLE() here */ -#endif - } -} - - -GLOBAL(void) -jcopy_block_row (JBLOCKROW input_row, JBLOCKROW output_row, - JDIMENSION num_blocks) -/* Copy a row of coefficient blocks from one place to another. */ -{ -#ifdef FMEMCOPY - FMEMCOPY(output_row, input_row, num_blocks * (DCTSIZE2 * SIZEOF(JCOEF))); -#else - register JCOEFPTR inptr, outptr; - register long count; - - inptr = (JCOEFPTR) input_row; - outptr = (JCOEFPTR) output_row; - for (count = (long) num_blocks * DCTSIZE2; count > 0; count--) { - *outptr++ = *inptr++; - } -#endif -} - - -GLOBAL(void) -jzero_far (void FAR * target, size_t bytestozero) -/* Zero out a chunk of FAR memory. */ -/* This might be sample-array data, block-array data, or alloc_large data. */ -{ -#ifdef FMEMZERO - FMEMZERO(target, bytestozero); -#else - register char FAR * ptr = (char FAR *) target; - register size_t count; - - for (count = bytestozero; count > 0; count--) { - *ptr++ = 0; - } -#endif -} diff --git a/wxWidgets/src/jpeg/jversion.h b/wxWidgets/src/jpeg/jversion.h deleted file mode 100644 index 6472c58d35..0000000000 --- a/wxWidgets/src/jpeg/jversion.h +++ /dev/null @@ -1,14 +0,0 @@ -/* - * jversion.h - * - * Copyright (C) 1991-1998, Thomas G. Lane. - * This file is part of the Independent JPEG Group's software. - * For conditions of distribution and use, see the accompanying README file. - * - * This file contains software version identification. - */ - - -#define JVERSION "6b 27-Mar-1998" - -#define JCOPYRIGHT "Copyright (C) 1998, Thomas G. Lane" diff --git a/wxWidgets/src/jpeg/makefile.unx b/wxWidgets/src/jpeg/makefile.unx deleted file mode 100644 index bcf905ee69..0000000000 --- a/wxWidgets/src/jpeg/makefile.unx +++ /dev/null @@ -1,36 +0,0 @@ -# -# File: makefile.unx -# Author: Julian Smart -# Created: 1999 -# Updated: -# Copyright: (c) 1999 -# -# -# Makefile for OGL library, Unix - -include ../make.env - -JPEGLIB=$(WXDIR)/lib/libjpeg$(GUISUFFIX).a - -all: $(JPEGLIB) - -# Define library objects -OBJECTS=\ - jcomapi.o jutils.o jerror.o jmemmgr.o jmemnobs.o \ - jcapimin.o jcapistd.o jctrans.o jcparam.o jdatadst.o \ - jcinit.o jcmaster.o jcmarker.o jcmainct.o jcprepct.o \ - jccoefct.o jccolor.o jcsample.o jchuff.o jcphuff.o \ - jcdctmgr.o jfdctfst.o jfdctflt.o jfdctint.o \ - jdapimin.o jdapistd.o jdtrans.o jdatasrc.o \ - jdmaster.o jdinput.o jdmarker.o jdhuff.o jdphuff.o \ - jdmainct.o jdcoefct.o jdpostct.o jddctmgr.o jidctfst.o \ - jidctflt.o jidctint.o jidctred.o jdsample.o jdcolor.o \ - jquant1.o jquant2.o jdmerge.o - -$(JPEGLIB) : $(OBJECTS) - ar $(AROPTIONS) $@ $(OBJECTS) - $(RANLIB) $@ - -clean: - rm -f $(OBJECTS) $(JPEGLIB) - diff --git a/wxWidgets/src/jpeg/makefile.vc b/wxWidgets/src/jpeg/makefile.vc deleted file mode 100644 index af92dd53d0..0000000000 --- a/wxWidgets/src/jpeg/makefile.vc +++ /dev/null @@ -1,201 +0,0 @@ -# Makefile for Independent JPEG Group's software - -# This makefile is for Microsoft Visual C++ on Windows NT (and 95?). -# It builds the IJG library as a statically linkable library (.LIB), -# and builds the sample applications as console-mode apps. -# Thanks to Xingong Chang, Raymond Everly and others. - -# Read installation instructions before saying "nmake" !! -# To build an optimized library without debug info, say "nmake nodebug=1". - -# Put here the object file name for the correct system-dependent memory -# manager file. For NT we suggest jmemnobs.obj, which expects the OS to -# provide adequate virtual memory. -SYSDEPMEM= $D\jmemnobs.obj - -# miscellaneous OS-dependent stuff -# file deletion command -!if "$(RM)" == "" -RM= erase -!endif - -# End of configurable options. - -# source files: JPEG library proper -LIBSOURCES= jcapimin.c \ - jcapistd.c \ - jccoefct.c \ - jccolor.c \ - jcdctmgr.c \ - jchuff.c \ - jcinit.c \ - jcmainct.c \ - jcmarker.c \ - jcmaster.c \ - jcomapi.c \ - jcparam.c \ - jcphuff.c \ - jcprepct.c \ - jcsample.c \ - jctrans.c \ - jdapimin.c \ - jdapistd.c \ - jdatadst.c \ - jdatasrc.c \ - jdcoefct.c \ - jdcolor.c \ - jddctmgr.c \ - jdhuff.c \ - jdinput.c \ - jdmainct.c \ - jdmarker.c \ - jdmaster.c \ - jdmerge.c \ - jdphuff.c \ - jdpostct.c \ - jdsample.c \ - jdtrans.c \ - jerror.c \ - jfdctflt.c \ - jfdctfst.c \ - jfdctint.c \ - jidctflt.c \ - jidctfst.c \ - jidctint.c \ - jidctred.c \ - jquant1.c \ - jquant2.c \ - jutils.c \ - jmemmgr.c - -# memmgr back ends: compile only one of these into a working library -SYSDEPSOURCES= jmemansi.c jmemname.c jmemnobs.c jmemdos.c jmemmac.c - -# source files: cjpeg/djpeg/jpegtran applications, also rdjpgcom/wrjpgcom -APPSOURCES= cjpeg.c djpeg.c jpegtran.c rdjpgcom.c wrjpgcom.c cdjpeg.c \ - rdcolmap.c rdswitch.c transupp.c rdppm.c wrppm.c rdgif.c wrgif.c \ - rdtarga.c wrtarga.c rdbmp.c wrbmp.c rdrle.c wrrle.c - -SOURCES= $(LIBSOURCES) $(SYSDEPSOURCES) $(APPSOURCES) - -# files included by source files -INCLUDES= jchuff.h jdhuff.h jdct.h jerror.h jinclude.h jmemsys.h jmorecfg.h \ - jpegint.h jpeglib.h jversion.h cdjpeg.h cderror.h transupp.h - -# documentation, test, and support files -DOCS= README install.doc usage.doc cjpeg.1 djpeg.1 jpegtran.1 rdjpgcom.1 \ - wrjpgcom.1 wizard.doc example.c libjpeg.doc structure.doc \ - coderules.doc filelist.doc change.log - -MKFILES= configure makefile.cfg makefile.ansi makefile.unix makefile.bcc \ - makefile.mc6 makefile.dj makefile.wat makefile.vc makelib.ds \ - makeapps.ds makeproj.mac makcjpeg.st makdjpeg.st makljpeg.st \ - maktjpeg.st makefile.manx makefile.sas makefile.mms makefile.vms \ - makvms.opt - -CONFIGFILES= jconfig.cfg jconfig.bcc jconfig.mc6 jconfig.dj jconfig.wat \ - jconfig.vc jconfig.mac jconfig.st jconfig.manx jconfig.sas \ - jconfig.vms - -CONFIGUREFILES= config.guess config.sub install-sh ltconfig ltmain.sh -OTHERFILES= jconfig.doc ckconfig.c ansi2knr.c ansi2knr.1 jmemdosa.asm -TESTFILES= testorig.jpg testimg.ppm testimg.bmp testimg.jpg testprog.jpg \ - testimgp.jpg -DISTFILES= $(DOCS) $(MKFILES) $(CONFIGFILES) $(SOURCES) $(INCLUDES) \ - $(CONFIGUREFILES) $(OTHERFILES) $(TESTFILES) - -# library object files common to compression and decompression -COMOBJECTS= $D\jcomapi.obj $D\jutils.obj $D\jerror.obj $D\jmemmgr.obj $(SYSDEPMEM) - -# compression library object files -CLIBOBJECTS= $D\jcapimin.obj \ - $D\jcapistd.obj \ - $D\jctrans.obj \ - $D\jcparam.obj \ - $D\jdatadst.obj \ - $D\jcinit.obj \ - $D\jcmaster.obj \ - $D\jcmarker.obj \ - $D\jcmainct.obj \ - $D\jcprepct.obj \ - $D\jccoefct.obj \ - $D\jccolor.obj \ - $D\jcsample.obj \ - $D\jchuff.obj \ - $D\jcphuff.obj \ - $D\jcdctmgr.obj \ - $D\jfdctfst.obj \ - $D\jfdctflt.obj \ - $D\jfdctint.obj - -# decompression library object files -DLIBOBJECTS= $D\jdapimin.obj \ - $D\jdapistd.obj \ - $D\jdtrans.obj \ - $D\jdatasrc.obj \ - $D\jdmaster.obj \ - $D\jdinput.obj \ - $D\jdmarker.obj \ - $D\jdhuff.obj \ - $D\jdphuff.obj \ - $D\jdmainct.obj \ - $D\jdcoefct.obj \ - $D\jdpostct.obj \ - $D\jddctmgr.obj \ - $D\jidctfst.obj \ - $D\jidctflt.obj \ - $D\jidctint.obj \ - $D\jidctred.obj \ - $D\jdsample.obj \ - $D\jdcolor.obj \ - $D\jquant1.obj \ - $D\jquant2.obj \ - $D\jdmerge.obj -# These objectfiles are included in libjpeg.lib -OBJECTS= $(CLIBOBJECTS) $(DLIBOBJECTS) $(COMOBJECTS) - -# object files for sample applications (excluding library files) -COBJECTS= $D\cjpeg.obj \ - $D\rdppm.obj \ - $D\rdgif.obj \ - $D\rdtarga.obj \ - $D\rdrle.obj \ - $D\rdbmp.obj \ - $D\rdswitch.obj \ - $D\cdjpeg.obj - -DOBJECTS= $D\djpeg.obj \ - $D\wrppm.obj \ - $D\wrgif.obj \ - $D\wrtarga.obj \ - $D\wrrle.obj \ - $D\wrbmp.obj \ - $D\rdcolmap.obj \ - $D\cdjpeg.obj - -TROBJECTS= $D\jpegtran.obj \ - $D\rdswitch.obj \ - $D\cdjpeg.obj \ - $D\transupp.obj - -!if "$(FINAL)" == "1" -LIBTARGET=..\..\lib\jpeg.lib -!else if "$(FINAL)" == "hybrid" -LIBTARGET=..\..\lib\jpegh.lib -!else -LIBTARGET=..\..\lib\jpegd.lib -!endif - -# Note: we have to put this first, to override the default definition -# which doesn't work because there are too many files on the command line. -# This means that we must explicitly use the 'all' target when making -# jpeg.lib, because of the ordering of targets. - -defaulttarget: - echo Please use the 'all' target for this makefile. - - -# Pull in standard variable definitions - -!include ..\makelib.vc - diff --git a/wxWidgets/src/makeb32.env b/wxWidgets/src/makeb32.env deleted file mode 100644 index 21351f5b01..0000000000 --- a/wxWidgets/src/makeb32.env +++ /dev/null @@ -1,173 +0,0 @@ -# Common settings for Borland 32-bit compilation (makefile.b32 files) - -!if "$(RM)" == "" -RM= del -!endif - -BORLAND_SUFFIX=bc -DEBUG_SUFFIX= - -MAKEFLAGS=FINAL=$(FINAL) WXUSINGDLL=$(WXUSINGDLL) OUTPUTDIR=$(OUTPUTDIR) EXEDIR=$(EXEDIR) - -WXDIR = $(WXWIN) -CFG = wxw32 - -!ifndef OUTPUTDIR -OBJ_PATH=$(WXDIR)\BORL -OUTPUTDIR=$(WXDIR)\BORL -!else -OBJ_PATH=$(OUTPUTDIR) -!endif - -!ifndef BCCDIR -BCCDIR=$(MAKEDIR)\.. -!endif - -!if "$(BCCDIR)" == "\.." -!error Your Borland compiler does not define MAKEDIR. Pleasedefine the BCCDIR variable in makeb32.env line 10, e.g. BCCDIR=d:\bc4 -!endif - -ARCHINCDIR=$(WXDIR)\lib\$(BORLAND_SUFFIX) -ARCHSETUPH=$(ARCHINCDIR)\wx\setup.h -#see below for SETUPSRCDIR - -!ifndef WXLIBDIR -WXLIBDIR = $(WXDIR)\lib -!endif - -WXINC = $(WXDIR)\include;$(WXDIR)\contrib\include;$(WXDIR)\src\iodbc;$(WXDIR)\src\regex; -WIN95FLAG = -D__WIN95__ -D__WINDOWS__ -RFLAGS = -i$(WXDIR)\include;$(WXDIR)\src - -# This should be changed to tlink32 if ilink32 is not available. -# Ilink32 is available on BC++ 5.02 and above, and all -# versions of C++ Builder. -!ifndef LINK -LINK=ilink32 -#LINK=tlink32 -!endif - -!ifndef FINAL -FINAL=0 -!endif - -!ifndef WXMAKINGDLL -WXMAKINGDLL=0 -!endif - -!if "$(FINAL)" == "1" -OPT = -O2 -DEBUG_FLAGS = -DUSE_DEFINE -LINKDEBUGFLAGS= -!else -OPT = -Od -DEBUG_FLAGS= -v -DWXDEBUG=1 -D__WXDEBUG__ -DUSE_DEFINE -LINKDEBUGFLAGS=/v -!endif - -# allow to use debugger but no wxDebugging functions -!if "$(FINAL)" == "hybrid" -OPT = -Od -DEBUG_FLAGS= -v -LINKDEBUGFLAGS=/v -!endif - -!ifndef DLL -DLL=0 -!else -DLL=1 -WXMAKINGDLL=1 -!endif - -# Target WXMAKINGDLL WXUSINGDLL WXBUILDDLL -# wxWin DLL 1 0 1 -# wxWin STATIC 0 0 0 -# App use wxWin DLL 0 1 0 -# DLL use wxWin DLL 0 1 1 -# DLL use wxWin STATIC 0 0 1 -# - -# Determine the library name depending on the options, to allow -# multiple versions to coexist. -# Note that the clean target will only delete the appropriate .lib for the current -# options and all the obj files, and note that you must delete the obj files if you -# change the options so that they are compiled using the correct ones. - -WXLIBNAME=wx25 - - -## Use this if you want to use the UNIV controls set rather than the native ones -## make -f makefile.b32 WXUSINGUNIV=1 -!if "$(WXUSINGUNIV)" == "1" -USE_UNIV="UNIV" -BORLAND_SUFFIX=$(BORLAND_SUFFIX)v -ARCHINCDIR=$(ARCHINCDIR)v -SETUPSRCDIR=$(WXDIR)\include\wx\univ -PORT=__WXUNIVERSAL__ -!else -USE_UNIV="" -PORT=__WXMSW__ -SETUPSRCDIR=$(WXDIR)\include\wx\msw -!endif - -#unicode builds handled inside setup.h - -#a hybrid , does not set __WXDEBUG__ but sets -v (see above) -!if "$(FINAL)" == "hybrid" -DEBUG_SUFFIX=$(DEBUG_SUFFIX)h -!endif - -!if "$(FINAL)" == "0" -DEBUG_SUFFIX=$(DEBUG_SUFFIX)d -!endif - -!if "$(wxUSE_GUI)" == "0" -BORLAND_SUFFIX=$(BORLAND_SUFFIX)b -CPPFLAGS=-DwxUSE_GUI=0 -!endif - -!if "$(WXMAKINGDLL)" != "1" && "$(WXUSINGDLL)" != "1" -BORLAND_SUFFIX=$(BORLAND_SUFFIX)s -!endif - -!if "$(WXMAKINGDLL)" == "1" || "$(WXUSINGDLL)" == "1" -INCEXT=dll$(INCEXT) -!endif - -# final names determined here -WXLIB=$(WXLIBDIR)\$(WXLIBNAME)_$(BORLAND_SUFFIX)$(DEBUG_SUFFIX).lib -WXDLL=$(WXLIBDIR)\$(WXLIBNAME)_$(BORLAND_SUFFIX)$(DEBUG_SUFFIX).dll -LIBTARGET=$(WXLIBDIR)\$(LIBTARGET)_bc$(DEBUG_SUFFIX).lib -OBJ_PATH=$(OBJ_PATH)_$(BORLAND_SUFFIX)$(DEBUG_SUFFIX) - -!if "$(WXMAKINGDLL)" == "1" -DLL_FLAGS= -DWXMAKINGDLL=1 -D_RTLDLL -!else - -!if "$(WXUSINGDLL)" == "1" -DLL_FLAGS= -DWXUSINGDLL=1 -D_RTLDLL -!else -DLL_FLAGS= -!endif - -!endif - -!if "$(WXBUILDDLL)" == "1" -LINK_FLAGS= /Tpd /c $(EXTRALINKFLAGS) -!endif - -CFG=$(OBJ_PATH)\$(CFG).cfg -CPPFLAGS=$(CPPFLAGS) $(DLL_FLAGS) @$(CFG) $(EXTRACPPFLAGS) - -DUMMY=dummy - -SRCSUFF = cpp -OBJSUFF = obj - -WAITFLAG = /w - -.$(SRCSUFF).obj: - bcc32 $(CPPFLAGS) -c -n$(OBJ_PATH) {$< } - -.c.obj: - bcc32 $(CPPFLAGS) -P- -c -n$(OBJ_PATH) {$< } diff --git a/wxWidgets/src/makebcc.env b/wxWidgets/src/makebcc.env deleted file mode 100644 index e9c4876f74..0000000000 --- a/wxWidgets/src/makebcc.env +++ /dev/null @@ -1,34 +0,0 @@ -# Common settings for Borland 16-bit compilation (makefile.bcc files) - -WXDIR = $(WXWIN) - -CFG = $(WXDIR)\src\msw\wxwin.cfg -WXLIBDIR = $(WXDIR)\lib -WXLIBDIR2 = $(WXDIR)\contrib\lib -WXINC = $(WXDIR)\include;$(WXDIR)\contrib\include - -!ifndef FINAL -FINAL=0 -!endif - -!if "$(FINAL)" == "0" -LINKFLAGS=/v/Vt /Twe /L$(WXDIR)\lib;$(WXDIR)\contrib\lib;$(BCCDIR)\lib $(EXTRALINKFLAGS) -OPT = -Od -DEBUG_FLAGS= -v -D__WXDEBUG__ -!else -LINKFLAGS=/Twe /L$(WXDIR)\lib;$(WXDIR)\contrib\lib;$(BCCDIR)\lib $(EXTRALINKFLAGS) -OPT = -O2 -DEBUG_FLAGS = -!endif - -CPPFLAGS=$(DEBUG_FLAGS) $(OPT) $(EXTRACPPFLAGS) @$(CFG) -WXLIB= $(WXLIBDIR)\wx.lib - -SRCSUFF = cpp -OBJSUFF = obj - -.$(SRCSUFF).obj: - bcc $(CPPFLAGS) -c {$< } - -.c.obj: - bcc $(CPPFLAGS) -DUSE_DEFINE -P- -c {$< } diff --git a/wxWidgets/src/makefile.va b/wxWidgets/src/makefile.va deleted file mode 100644 index 3dcfcfe104..0000000000 --- a/wxWidgets/src/makefile.va +++ /dev/null @@ -1,35 +0,0 @@ -# -# File: makefile.va -# Author: David Webster -# Created: 1999 -# Updated: -# Copyright: (c) 1999, David Webster -# -# "%W% %G%" -# -# Makefile : Builds wxWindows library wx.lib for VisualAge C++ V3.0 for OS/2 -# Arguments: -# -# FINAL=1 argument to nmake to build version with no debugging info. -# dll builds a library (wxdll.lib) suitable for creating DLLs -# * Note that the dll target is experimental - see docs/dll.txt. -# -!include - -THISDIR=$(WXDIR)\src - -all: - cd os2 - nmake -f makefile.va - cd $(THISDIR) - -clean: - cd os2 - nmake -f makefile.va clean - cd $(THISDIR) - -cleanall: - cd os2 - nmake -f makefile.va cleanall - cd $(THISDIR) - diff --git a/wxWidgets/src/makefile.vc b/wxWidgets/src/makefile.vc deleted file mode 100644 index ca8985bf2e..0000000000 --- a/wxWidgets/src/makefile.vc +++ /dev/null @@ -1,35 +0,0 @@ -# -# File: makefile.nt -# Author: Julian Smart -# Created: 1997 -# Updated: -# Copyright: (c) 1997, Julian Smart -# -# "%W% %G%" -# -# Makefile : Builds wxWindows library wx.lib for VC++ (32-bit) -# Arguments: -# -# FINAL=1 argument to nmake to build version with no debugging info. -# dll builds a library (wxdll.lib) suitable for creating DLLs -# * Note that the dll target is experimental - see docs/dll.txt. -# -!include - -THISDIR=$(WXWIN)\src - -all: - cd msw - nmake -f makefile.vc - cd $(THISDIR) - -clean: - cd msw - nmake -f makefile.vc clean - cd $(THISDIR) - -cleanall: - cd msw - nmake -f makefile.vc cleanall - cd $(THISDIR) - diff --git a/wxWidgets/src/makeg95.env b/wxWidgets/src/makeg95.env deleted file mode 100644 index fd87183c0b..0000000000 --- a/wxWidgets/src/makeg95.env +++ /dev/null @@ -1,437 +0,0 @@ -# -# makeg95.env -# Common makefile settings for wxWindows programs -# This file is included by all the other makefiles, thus changes -# made here take effect everywhere (except where overriden). -# The settings are for GnuWin32-derived compilers, i.e. Cygwin and Mingw32. -# -# Customize this file to match your own settings. -# -# CVS_ID: $Id: makeg95.env 20425 2003-05-01 22:36:46Z VZ $ -# - -# The MINGW32 and MINGW32VERSION variables are preconfigured for -# MinGW gcc version 3.x and must both be changed for any version -# earlier than 3.0 or for cygwin. Editing this file is one way to -# change them. An easier way, at least with GNU make, is to override -# them on the command line, e.g. -# make MINGW32=0 MINGW32VERSION=2.8 -f makefile.g95 - -# If using Mingw32 (any version), set this to 1. -# If using Cygwin (any version), set this to 0. -# -# This agrees with the instructions given in docs/msw/install.txt . -# Earlier versions of this makefile suggested setting MINGW32=1 for -# recent versions of cygwin, but that would give the wrong dll entry -# point in src/msw/makefile.g95 . -# -# With cygwin, there are still some problems compiling wxWindows -# this way; './configure && make' may work better. -# -MINGW32=1 - -# set MIN_SUFFIX to nothing if you use only MinGW compiler, set it to -# something MinGW-specific if you want to build wxWindows with more than one -# compiler -ifeq ($(MINGW32),1) - MIN_SUFFIX=_min -else - MIN_SUFFIX=_cyg -endif - -# Set to your gcc version. Generally 'gcc --version' tells you -# which version you have. But it cannot distinguish between -# 2.95.2-1 and earlier suffix versions of 2.95 . In that case, -# inspect the dates of bin/gcc.exe and bin/ld.exe ; if they -# are at least -# 2000-01-21 for gcc.exe and -# 2000-02-04 for ld.exe -# then use '2.95-late'. -# -# gcc 2.8.x and earlier require struct-return workaround -#MINGW32VERSION=2.8 -# -# gcc 2.95.2 and earlier requires special thunk option -#MINGW32VERSION=2.9-early -# -# mingw gcc-2.95.2-1 supports '-shared' -# windres provided with gcc-2.95.2-1 supports temp file option -#MINGW32VERSION=2.95-late -# -# gcc 3.x provides a win32api.h header -MINGW32VERSION=3.0 - -# If you want to compile on Wine, simply uncomment this variable -# If you don't want to edit the file, you can simply define it -# on the command line like so: make WINE=1 -f makefile.g95 -#WINE=1 - -# Set this if you are using a cross-compiler, i.e. compiling on one system -# the program for another one -# CROSS=i386-mingw32- - -# If we're using MSYS, or other utilities that use forward slashes, -# you need to set this when invoking the makefile from DOS, or the -# wrong separators will be assumed. However, if you're using MSYS, -# you really ought to invoke the makefile from MSYS--or, even better, -# use the './configure && make' technique that MSYS is designed for. -ifndef WINE -#OSTYPE=msys -else -OSTYPE=msys -endif - -# If building DLL, the version -include $(WXDIR)/src/version.mak -WXVERSION=$(wxMAJOR_VERSION)$(wxMINOR_VERSION)$(wxRELEASE_NUMBER_IFUNSTABLE) - -ifndef UNICODE - UNICODE=0 -endif - -ifndef FINAL - FINAL=0 -endif - -ifndef wxUSE_GUI - wxUSE_GUI=1 -endif - -# Set to the appropriate remove command (must support forward slashes) -# You can get a suitable rm.exe from ports/mingw32/extra.zip on the ftp site. -RM=rm -f - -# Set to the appropriate copy command (must support forward slashes) -# You can get a suitable cp.exe from ports/mingw32/extra.zip on the ftp site. -COPY=cp - -########################## Compiler ################################## - -ifneq (,$(findstring $(MINGW32VERSION),2.8)) -# According to Guillermo Rodriguez Garcia , the -# -fno-pcc-struct-return option is needed to make the standard div() -# function work - otherwise it returns absolutely incorrect results -# which breaks the wxImage class. This was fixed on 1998-08-14 for -# mingw and cygwin. It is preferable not to use this option where it -# is not required, because it is documented to cause binary API -# incompatibility. - _STRUCT_RETURN_WORKAROUND=-fno-pcc-struct-return -# Really old versions of cygwin are thought to require extra headers. - ifneq ($(MINGW32),1) - GNUWIN32EXTRA=-I$(WXDIR)/include/wx/msw/gnuwin32 - endif -endif - -ifneq (,$(findstring $(MINGW32VERSION),2.8 2.9-early)) -# Earlier versions of this makefile defined the following macros -# explicitly; mingw versions since at least '2.95-late' define -# them already. - OBSOLETE_DEFINES = -D_X86_=1 -DWIN32 -D_WIN32 -D__WIN32__ -endif -# But cygwin doesn't define them, at least through its version -# 2.95.3-4 of gcc. -ifneq ($(MINGW32),1) - OBSOLETE_DEFINES = -D_X86_=1 -DWIN32 -D_WIN32 -D__WIN32__ -endif - -ifneq (,$(findstring $(MINGW32VERSION),2.8 2.9-early 2.95-late)) -# Versions prior to 3.0 require -fvtable-thunks for OLE support. -# All code must be built with this option, even C++ libraries you -# only link to, including system libraries. This option can cause -# subtle problems with multiple inheritance. - _THUNK_WORKAROUND=-fvtable-thunks -endif - -ifeq (,$(findstring $(MINGW32VERSION),2.8 2.9-early)) -# Versions since 2.95.2-1 support '-shared', which makes linking -# a dll *much* faster; and the accompanying windres supports -# '--use-temp-file', which is more robust. - LD_SUPPORTS_SHARED=yes - _USE_TEMP_FILE_IF_SUPPORTED=--use-temp-file -# Use the WIN32 wxDirDialog only if we have a recent mingw version - RECENT_MINGW=yes -endif - -ifeq (,$(findstring $(MINGW32VERSION),2.8 2.9-early 2.95-late)) -# Versions since 3.0 provide win32api.h . An old comment said to -# define this 'if you have w32api >= 0.5', but mingw 2.95.2-1 -# has no such header. -ifndef WINE - _USE_W32API_HEADER_IF_SUPPORTED = -DHAVE_W32API_H -endif -# -# Revision 1.70.2.6 of this file suggested '--pipe' for mingw but -# not for cygwin, and only for version 3.0 or later. Since then, -# the advice given here -# http://mail.gnu.org/pipermail/autoconf/2000-July/005479.html -# is followed, and '--pipe' is not used unless you specify it on -# the make command line, e.g. -# make CXXFLAGS=--pipe CFLAGS=--pipe -f makefile.g95 -# -endif - -# Define the C++ and C compiler respectively -ifndef WINE -CXX = $(CROSS)g++ -CC = $(CROSS)gcc -else -CXX = wineg++ -CC = winegcc -endif - -# Compiler used for LEX generated C -# For now at least, it can be the same as the regular C compiler -CCLEX = $(CROSS)$(CC) - -# This shouldn't be needed as make is supposed to define this -# variable itself. Uncomment it if your make complains. -#MAKE=make - -# LEX (currently unused) -# LEX=flex # -t -L - -# YACC (currently unused) -# YACC=byacc -# YACC=bison - -# Settings for Cyginw/Mingw32 -# Some versions of windres cannot cope with the --preprocessor -# option. Uncomment the RCPREPROCESSOR line below if yours can. -ifndef WINE -RESCOMP=$(CROSS)windres $(_USE_TEMP_FILE_IF_SUPPORTED) -else -RESCOMP=wrc -endif -RCINPUTSWITCH=-i -RCOUTPUTSWITCH=-o -RCINCSWITCH=--include-dir -RCDEFSWITCH=--define -# Note that this can cause windres to fail (Win95/98 problem?) -# but commenting out RCPREPROCESSOR then does the trick. -#RCPREPROCESSOR=--preprocessor "$(CXX) -c -E -xc-header -DRC_INVOKED" - -# Don't make this too long (e.g. by adding contrib/include/wx) because it will -# truncate the command line -RESFLAGS=$(RCPREPROCESSOR) $(RCINCSWITCH) $(WXDIR)/include $(RCEXTRAINC) $(RCDEFSWITCH) __WIN32__ $(RCDEFSWITCH) __WIN95__ $(RCDEFSWITCH) __GNUWIN32__ - -# Needed to build a DLL if your linker does not support --shared option. -AS = $(CROSS)as -DLLTOOL = $(CROSS)dlltool - -########################## Compiler flags ############################# - -# Unicode defines -ifeq ($(UNICODE),1) - UNICODE_OPT = -D_UNICODE -DUNICODE -DwxUSE_UNICODE=1 -else - UNICODE_OPT = -endif - -# Miscellaneous compiler options -OPTIONS = -DSTRICT $(_USE_W32API_HEADER_IF_SUPPORTED) - -# Add "-mthreads" if you want to have threads under mingw32 -# Add "-mno-cygwin" if you want to link with msvcrt.dll in Cywin and Wine -# Otherwise, you link against the native runtime (cygwin.dll -# or libc). Having the flag in mingw32 does not hurt as you -# always link against msvcrt.dll By default it should be on, -# to minimize dependencies on Cygwin, and have more correct -# filename behaviour in Wine. -COMMON_FLAGS = -mno-cygwin # -mthreads - -# Debugging information -ifeq ($(FINAL),0) - DEBUGFLAGS = -g -D__WXDEBUG__ -endif - -WIN95=1 - -ifeq ($(WIN95),0) -# With 3.50, Win95 will use your existing icons to show smaller ones. -# With 4.0, you'll have to follow Win95 procedures for icons or you'll get the -# default Windows icon. -APPVER=3.50 -WINVERSION=-DWINVER=0x0350 -D__GNUWIN32__ # Generic WIN32 -else -APPVER=4.0 # 3.50 -# This means 'enable Windows 95 features' (in wxWindows and in the compiler). -WINVERSION=-DWINVER=0x0400 -D__GNUWIN32__ -endif - -# This is never used and should be expunged. -# CPU=i386 - -# Suffixes -OBJSUFF=o -SRCSUFF=cpp -LIBPREFIX=lib -LIBSUFF=a -EXESUFF=.exe -RESSUFF=res -RSCSUFF=rsc - -# Warnings -WARN = -Wall - -# build wxbase/wxMSW -ifeq ($(wxUSE_GUI),1) - TOOLKIT=msw - GUI = -else - TOOLKIT=base - GUI = -DwxUSE_GUI=0 -endif - -ifeq ($(FINAL),1) - OPT = -O2 -fno-rtti -fno-exceptions -else - OPT = -fno-rtti -fno-exceptions -endif - -# Options for ar archiver -AROPTIONS = ruv -AR = $(CROSS)ar -RANLIB = $(CROSS)ranlib - -# Extra compiler libraries -COMPLIBS= - -# Compiler or system-specific include paths -COMPPATHS= - -########################## Directories ############################### - -OLELIBS=-lole32 -loleaut32 -luuid -BASELIBS=-lstdc++ -lgcc -lodbc32 -lwsock32 -ifeq ($(wxUSE_GUI),1) - WINLIBS= $(BASELIBS) \ - -lwinspool -lwinmm -lshell32 \ - -lcomctl32 -lctl3d32 -lodbc32 -ladvapi32 \ - -lodbc32 -lwsock32 -lopengl32 -lglu32 $(OLELIBS) # -loldnames -else - WINLIBS=$(BASELIBS) -endif - -#WINLIBS=-lstdc++ -lgcc \ -# -lwinspool -lwinmm -lshell32 \ -# -lcomctl32 -lctl3d32 -lodbc32 -ladvapi32 -lwsock32 # -loldnames - -# Shouldn't need to change these... -WXSRC=$(WXDIR)/src/msw -WXINC=$(WXDIR)/include -WXBASESRC=$(WXDIR)/src/common - -#ifeq ($(MINGW32),1) -#INC = -I$(WXINC) -I$(WXDIR)/contrib/include -I$(WXDIR)/src/png -I$(WXDIR)/src/jpeg -I$(WXDIR)/src/zlib -I$(WXDIR)/src/tiff $(EXTRAINC) $(COMPPATHS) -#else -INC = -I$(WXDIR)/lib/$(TOOLKIT)$(INCEXT) -I$(WXINC) -I$(WXDIR)/contrib/include -I$(WXDIR)/src/regex -I$(WXDIR)/src/png -I$(WXDIR)/src/jpeg -I$(WXDIR)/src/zlib -I$(WXDIR)/src/tiff $(EXTRAINC) $(COMPPATHS) $(GNUWIN32EXTRA) -#endif - -RCLFLAGS=-cpp "cpp -lang-c++ $(OBSOLETE_DEFINES) -DRCL_INVOKED -I$(WXWIN)/include" - -ifdef WXUSINGDLL - # png, jpeg, etc are exported from wx dll, so skip and save on link time. - LIBS = $(EXTRALIBS) $(WXLIB) $(WINLIBS) $(COMPLIBS) -else - LIBS = $(EXTRALIBS) $(WXLIB) -lregex$(MIN_SUFFIX) -lpng$(MIN_SUFFIX) -ljpeg$(MIN_SUFFIX) -lzlib$(MIN_SUFFIX) -ltiff$(MIN_SUFFIX) $(WINLIBS) $(COMPLIBS) -endif - -WINFLAGS = $(OBSOLETE_DEFINES) $(WINVERSION) - -#for windows 95 -XINCLUDE=$(WINFLAGS) -XLIB=$(LIBS) -LDLIBS = $(LIBS) - -# Directory for object files (don't change) -# OBJDIR = objects$(GUISUFFIX) -OBJDIR = . - -ifeq ($(FINAL),1) - DEBEXT= -else - DEBEXT=d -endif - -ifeq ($(UNICODE),1) - UNIEXT=u -else - UNIEXT= -endif - -ifeq ($(WXMAKINGDLL)$(WXUSINGDLL),) - INCEXT=$(UNIEXT)$(DEBEXT) -else - INCEXT=dll$(UNIEXT)$(DEBEXT) -endif - -WXLIB=$(WXDIR)/lib/$(LIBPREFIX)wx$(TOOLKIT)$(UNIEXT)$(DEBEXT).$(LIBSUFF) - -ifdef WXMAKINGDLL - EXTRADLLFLAGS = -DWXMAKINGDLL=1 -D_DLL=1 -D_WINDLL=1 - WXLIB=$(WXDIR)/lib/$(LIBPREFIX)wx$(TOOLKIT)$(WXVERSION)$(UNIEXT)$(DEBEXT)$(MIN_SUFFIX).$(LIBSUFF) -endif - -ifdef WXUSINGDLL - EXTRADLLFLAGS = -DWXUSINGDLL=1 - WXLIB=$(WXDIR)/lib/$(LIBPREFIX)wx$(TOOLKIT)$(WXVERSION)$(UNIEXT)$(DEBEXT)$(MIN_SUFFIX).$(LIBSUFF) -endif - - -ifeq ($(wxUSE_GUI),1) - WINDOWSLDFLAGS=-Wl,--subsystem,windows - WINDOWSLDLIBS=-mwindows -endif - -# Note: WIN32_LEAN_AND_MEAN is defined only for C and not for C++ compiles. -# Defining this macro means that a great deal of less commonly used stuff -# is ignored in the windows headers, resulting in faster compiles. It can't -# be used with some C++ source files. It just so happens that it can be -# used with all C source files. - -CFLAGS = -DWIN32_LEAN_AND_MEAN - -WXLIBDIRS = -L$(WXDIR)/lib -L$(WXDIR)/contrib/lib - -# You shouldn't need to change these flags, which are merely composed of -# the options selected above. You can add more flags by specifying them on -# the make command line, e.g. -# make CXXFLAGS='-O3 -march=i686' -f makefile.g95 -# The gnu make manual says -# 'Users expect to be able to specify CFLAGS freely themselves' -# That was unsafe with older versions of this makefile, but now it works. -# -# C preprocessor flags -# Some makefiles pass extra flags in $(EXTRACPPFLAGS); although earlier -# versions of this file used CPPFLAGS as C++ compiler flags (instead of -# as C preprocessor flags), it is OK to add them to the preprocessor -# flags, which are always used for C++ compiles. Because other makefiles -# use this method to override these flags, they are added after $(CPPFLAGS), -# which would normally come last. -ALL_CPPFLAGS = $(XINCLUDE) $(INC) $(CPPFLAGS) $(EXTRACPPFLAGS) -# C and C++ compiler flags for compatibility with old gcc versions -REQUIRED_GCC_FLAGS = $(_STRUCT_RETURN_WORKAROUND) $(_THUNK_WORKAROUND) -# C++ compiler flags -ALL_CXXFLAGS = $(COMMON_FLAGS) $(REQUIRED_GCC_FLAGS) $(UNICODE_OPT) $(OPTIONS) $(GUI) $(DEBUGFLAGS) $(WARN) $(OPT) $(EXTRADLLFLAGS) $(CXXFLAGS) -# C compiler flags -ALL_CFLAGS = $(COMMON_FLAGS) $(REQUIRED_GCC_FLAGS) $(UNICODE_OPT) $(OPTIONS) $(GUI) $(DEBUGFLAGS) $(WARN) $(OPT) $(EXTRADLLFLAGS) $(CFLAGS) -# Linker flags -ALL_LDFLAGS = $(COMMON_FLAGS) $(WINDOWSLDFLAGS) $(WINDOWSLDLIBS) $(WXLIBDIRS) $(EXTRALDFLAGS) $(LDFLAGS) -# under Cygwin, Dlls must not be linked with subsystem=windows -ALL_LDFLAGS_DLL = $(COMMON_FLAGS) $(WINDOWSLDLIBS) $(WXLIBDIRS) $(EXTRALDFLAGS) $(LDFLAGS) - -.SUFFIXES: .rc .$(RESSUFF) .$(RSCSUFF) .cpp .cxx .cc .c - -.c.o: - $(CC) -c $(ALL_CPPFLAGS) $(ALL_CFLAGS) -o $@ $*.c - -.cc.o: - $(CXX) -c $(ALL_CPPFLAGS) $(ALL_CXXFLAGS) -o $@ $*.cc - -.cxx.o: - $(CXX) -c $(ALL_CPPFLAGS) $(ALL_CXXFLAGS) -o $@ $*.cxx - -# This '.cpp.o' rule is apparently written this way because -# the 'tmake' file g95.t expects it. -.$(SRCSUFF).$(OBJSUFF): - $(CXX) -c $(ALL_CPPFLAGS) $(ALL_CXXFLAGS) -o $@ $*.$(SRCSUFF) diff --git a/wxWidgets/src/makelib.b32 b/wxWidgets/src/makelib.b32 deleted file mode 100644 index 1ebba24158..0000000000 --- a/wxWidgets/src/makelib.b32 +++ /dev/null @@ -1,32 +0,0 @@ -# -# File: makelib.b32 -# Author: Julian Smart -# Created: 1999 -# Updated: -# Copyright: -# -# Include file for libraries. Set LIBTARGET and OBJECTS -# before including this file. - - -lib: $(LIBTARGET) - -$(LIBTARGET): $(OBJECTS) - -if exist $(LIBTARGET) $(RM) $(LIBTARGET) - echo making $(LIBTARGET) - tlib "$(LIBTARGET)" /P512 @&&! -+$(OBJECTS:.obj =.obj +) -! - -clean: -## -if exist $(OBJ_PATH)\*.obj $(RM) $(OBJ_PATH)\*.obj - -if exist *.res $(RM) *.res - -if exist *.map $(RM) *.map - -if exist *.rws $(RM) *.rws - -if exist $(LIBTARGET) $(RM) $(LIBTARGET) - -.$(SRCSUFF).obj: - bcc32 $(CPPFLAGS) -c -n$(OBJ_PATH) {$< } - -.c.obj: - bcc32 $(CPPFLAGS) -P- -c -n$(OBJ_PATH) {$< } diff --git a/wxWidgets/src/makelib.bcc b/wxWidgets/src/makelib.bcc deleted file mode 100644 index 73705fb5be..0000000000 --- a/wxWidgets/src/makelib.bcc +++ /dev/null @@ -1,37 +0,0 @@ -# -# File: makelib.b32 -# Author: Julian Smart -# Created: 1999 -# Updated: -# Copyright: -# -# Include file for libraries. Set LIBTARGET and OBJECTS -# before including this file. - -# WXWIN and BCCDIR are set by parent make - -WXDIR = $(WXWIN) - -!include $(WXDIR)\src\makebcc.env - -$(LIBTARGET): $(OBJECTS) - erase $(LIBTARGET) - tlib $(LIBTARGET) /P1024 @&&! --+$(OBJECTS:.obj =.obj -+) -! - -.$(SRCSUFF).obj: - bcc $(CPPFLAGS) -c {$< } - -.c.obj: - bcc $(CPPFLAGS) -P- -c {$< } - -clean: - -erase *.obj - -erase *.exe - -erase *.res - -erase *.map - -erase *.rws - -erase $(LIBTARGET) - - diff --git a/wxWidgets/src/makelib.g95 b/wxWidgets/src/makelib.g95 deleted file mode 100644 index 882d560429..0000000000 --- a/wxWidgets/src/makelib.g95 +++ /dev/null @@ -1,24 +0,0 @@ -# -# File: makelib.g95 -# Author: Julian Smart -# Created: 1999 -# Updated: -# Copyright: (c) Julian Smart, 1999 -# -# Include file for Cygwin/Mingw32 libraries - -# All common UNIX compiler flags and options are now in -# this central makefile. -include $(WXDIR)/src/makeg95.env - -all: $(LIBTARGET) $(EXTRATARGETS) - -$(LIBTARGET): $(OBJECTS) - ar $(AROPTIONS) $@ $(OBJECTS) - $(RANLIB) $@ - -clean: - -$(RM) $(OBJECTS) core *.rsc *.res - -cleanall: clean - -$(RM) $(LIBTARGET) diff --git a/wxWidgets/src/makelib.vc b/wxWidgets/src/makelib.vc deleted file mode 100644 index 2c4b8b9b5a..0000000000 --- a/wxWidgets/src/makelib.vc +++ /dev/null @@ -1,49 +0,0 @@ -# -# File: makelib.vc -# Author: Julian Smart -# Created: 1999 -# Updated: -# Copyright: (c) Julian Smart -# -# Makefile : Builds a library for a utility -# Use FINAL=1 argument to nmake to build final version with no debugging -# info - -# Set WXDIR for your system (hint, set an environment variable named WXWIN) -WXDIR = $(WXWIN) - -!include $(WXDIR)\src\makevc.env - -!if "$(RM)" == "" -RM= erase -!endif - -all: $(D) $(EXTRATARGETS) $(LIBTARGET) - -$(D) : - mkdir $(D) - -wx: - cd $(WXDIR)\src\msw - nmake -f makefile.vc FINAL=$(FINAL) - -wxclean: - cd $(WXDIR)\src\msw - nmake -f makefile.vc clean - -$(LIBTARGET): $(OBJECTS) - -$(RM) $(LIBTARGET) - $(implib) @<< --out:$(LIBTARGET) --machine:$(CPU) -$(OBJECTS) -<< - -clean: - -$(RM) $(LIBTARGET) - -$(RM) $(OBJECTS) - -$(RM) *.exe - -$(RM) *.res - -$(RM) *.map - -$(RM) *.sbr - -$(RM) *.pdb diff --git a/wxWidgets/src/makemsc.env b/wxWidgets/src/makemsc.env deleted file mode 100644 index b896b1852f..0000000000 --- a/wxWidgets/src/makemsc.env +++ /dev/null @@ -1,72 +0,0 @@ -# -# File: makemsc.env -# Author: Julian Smart -# Created: 1993 -# Updated: -# Copyright: -# -# "%W% %G%" -# -# Include file for MS VC++ makefiles -# Arguments: -# -# FINAL=1 argument to nmake to build version with no debugging info. -# DLL=1 builds a library (wxdll.lib) suitable for creating DLLs. -# -# Set WXDIR to the wxWindows directory if env. variable WXWIN not set. -# From your specific makefile, set EXTRAFLAGS to add flags to CPPFLAGS, -# such as extra include directories or defines. - -WXDIR = $(WXWIN) -WXINC = $(WXDIR)\include - -WXLIB=$(WXDIR)\lib\wx1.lib $(WXDIR)\lib\wx2.lib $(WXDIR)\lib\wx3.lib $(WXDIR)\lib\wx4.lib $(WXDIR)\lib\wx5.lib - -# Suffixes -OBJSUFF=obj -SRCSUFF=cpp - -#INC=/I$(WXDIR)\include -INC=-I$(WXINC) -I$(WXDIR)/src/png -I$(WXDIR)/src/zlib -I$(WXDIR)/src/jpeg $(EXTRAINC) - -# Set this to nothing if using MS C++ 7 -ZOPTION=/Z7 - -!ifndef FINAL -FINAL=0 -!endif - -!ifndef DLL -DLL=0 -!endif - -OPTIONS= - -!if "$(FINAL)" == "0" -OPT = /Od /Gy -DEBUG_FLAGS= /Zi $(ZOPTION) -LINK_DEBUG_FLAGS=/CO -!else -OPT = /Od /Gy # Note: /Ox or /Os crash the compiler or samples -DEBUG_FLAGS= -LINK_DEBUG_FLAGS= -!endif - -LIBS=$(WXLIB) $(EXTRALIBS) oldnames libw llibcew commdlg ddeml shell mmsystem ole2 $(WXDIR)\lib\msvc15\ctl3dv2.lib - -!if "$(DLL)" == "0" -PCH=WX.PCH -PRECOMP=/YuWX/WXPREC.H /Fp$(WXDIR)\src\msw\$(PCH) -CPPFLAGS= $(DEBUG_FLAGS) $(OPTIONS) $(INC) $(EXTRAFLAGS) /DWXDEBUG=1 /D__WXDEBUG__ /AL /Gt4 /Gx- /W4 /G2sw $(OPT) /D__WXMSW__ /D__WINDOWS__ $(PRECOMP) -CPPFLAGS2= $(DEBUG_FLAGS) $(OPTIONS) $(INC) $(EXTRAFLAGS) /DWXDEBUG=1 /D__WXDEBUG__ /AL /Gt4 /Gx- /W4 /G2sw $(OPT) /D__WXMSW__ /D__WINDOWS__ -LINKFLAGS=$(LINK_DEBUG_FLAGS) /NOD /SEG:512 /ONERROR:NOEXE -DUMMY=dummy -!else -PCH=WX.PCH -PRECOMP=/YuWX/WXPREC.H /Fp$(WXDIR)\src\msw\$(PCH) -CPPFLAGS= $(DEBUG_FLAGS) $(OPTIONS) $(INC) $(EXTRAFLAGS) /AL /Gt4 /Gx- /W4 /G2s /GD $(OPT) /D__WXMSW__ /D__WINDOWS__$(PRECOMP) -CPPFLAGS2= $(DEBUG_FLAGS) $(OPTIONS) $(INC) $(EXTRAFLAGS) /AL /Gt4 /Gx- /W4 /G2s /GD $(OPT) /D__WXMSW__ /D__WINDOWS__ -LINKFLAGS=$(LINK_DEBUG_FLAGS) /NOD /SEG:512 /ONERROR:NOEXE -DUMMY=dummydll -!endif - diff --git a/wxWidgets/src/makeprog.b32 b/wxWidgets/src/makeprog.b32 deleted file mode 100644 index 59592513ea..0000000000 --- a/wxWidgets/src/makeprog.b32 +++ /dev/null @@ -1,118 +0,0 @@ -# -# File: makeprog.b32 -# Author: Julian Smart -# Created: 1999 -# Updated: -# Copyright: -# -# Include file for samples and utilities. Set TARGET, OBJECTS and -# TARGETDEF (if you want to include a DEF file in the build) before -# including this file. - -# WXWIN set by parent make -# BCCDIR set in makeb32.env - -WXDIR = $(WXWIN) - -!ifndef EXEDIR -EXEDIR = BORL -!endif - -!include $(WXDIR)\src\makeb32.env - -!if "$(wxUSE_GUI)" == "0" -IMGLIBS= -!else -IMGLIBS= png_bc$(DEBUG_SUFFIX) jpeg_bc$(DEBUG_SUFFIX) tiff_bc$(DEBUG_SUFFIX) -!endif - -!if "$(FINAL)" == "0" -EX_LIBS=$(EXTRALIBS:.lib=_bcd.lib) -!else -EX_LIBS=$(EXTRALIBS:.lib=_bc.lib) -!endif - -!if "$(WXUSINGDLL)" == "1" -LIBS=$(WXLIB) $(EX_LIBS) cw32mti import32 ole2w32 regex_bc$(DEBUG_SUFFIX) zlib_bc$(DEBUG_SUFFIX) $(IMGLIBS) -!else -LIBS=$(WXLIB) $(EX_LIBS) cw32mt import32 ole2w32 regex_bc$(DEBUG_SUFFIX) zlib_bc$(DEBUG_SUFFIX) $(IMGLIBS) -!endif - -!if "$(wxUSE_ODBC)" == "1" -LIBS=$(LIBS) odbc32 -!endif - - -!if "$(wxUSE_GUI)" == "0" -LINKOUT = /ap -!else -LINKOUT = /aa -!endif - -!if "$(FINAL)" == "0" -#LINKFLAGS=/v /c /Tpe $(LNKCFG) $(EXTRALINKFLAGS) -LINKFLAGS=/v /c $(LINKOUT) -L"$(WXLIBDIR);$(BCCDIR)\lib;$(BCCDIR)\lib\psdk" $(EXTRALINKFLAGS) -OPT = -Od -DEBUG_FLAGS= -v -!else -#LINKFLAGS=/Tpe +$(LNKCFG) $(EXTRALINKFLAGS) -LINKFLAGS=$(LINKOUT) -L"$(WXLIBDIR);$(BCCDIR)\lib;$(BCCDIR)\lib\psdk" $(EXTRALINKFLAGS) -OPT = -Od -DEBUG_FLAGS = -!endif - -CPPFLAGS=$(CPPFLAGS) $(DEBUG_FLAGS) $(OPT) - -!if "$(wxUSE_GUI)" == "0" -TARGETRES = -STARTUP = c0x32.obj -!else -TARGETRES = $(EXEDIR)\$(TARGET).res -STARTUP = c0w32.obj -!endif - -EXE_TARGET=$(EXEDIR)\$(TARGET) - -default : all - -maked: - -if not exist $(EXEDIR)\nul mkdir $(EXEDIR) - -wx: $(EXE_TARGET).exe $(EXTRATARGETS) - -all: maked wx - - -$(EXE_TARGET).exe: $(OBJECTS) $(TARGETDEF) $(TARGETRES) - $(LINK) $(LINKFLAGS) -j$(EXEDIR) @&&! -$(STARTUP) $(OBJECTS) -$(EXE_TARGET) -nul -$(LIBS) -$(TARGETDEF) -$(TARGETRES) -! - -.path.obj=$(EXEDIR) - -.$(SRCSUFF).obj: - bcc32 $(CPPFLAGS) -c -n$(EXEDIR) {$< } - -.c.obj: - bcc32 $(CPPFLAGS) -P- -c -n$(EXEDIR) {$< } - -!if "$(wxUSE_GUI)" != "0" -#make resources only with GUI apps -$(TARGETRES) : $(TARGET).rc $(WXDIR)\include\wx\msw\wx.rc - brc32 -r /i$(BCCDIR)\include /i$(WXDIR)\include /i$(WXDIR)\contrib\include -fo$(EXEDIR)\$( - -# read version numbers -!include "version.mak" -WXVERSION=$(wxMAJOR_VERSION)$(wxMINOR_VERSION)$(wxRELEASE_NUMBER_IFUNSTABLE) - -!if "$(RM)" == "" -RM= erase -!endif - -# WIN95 means "all systems newer than Win95", i.e. Win9x and NT 4+ -WIN95=1 - -!if "$(WIN95)" == "0" -# With 3.50, Win95 will use your existing icons to show smaller ones. -# With 4.0, you'll have to follow Win95 procedures for icons or you'll get the -# default Windows icon. -APPVER=3.50 -WINVERSION=-DWINVER=0x0350 # Generic WIN32 -!else -APPVER=4.0 -# This means 'enable Windows 95 features' (in wxWindows and in VC++ 4.0). -WINVERSION=-DWINVER=0x0400 -!endif - -# On Alpha machines, change to CPU=ALPHA -CPU=i386 - -# Suffixes -OBJSUFF=obj -SRCSUFF=cpp - -WAITFLAG=/w - -# If you set wxUSE_IOSTREAMH to 0, remove -# -Dtry=__try -Dexcept=__except -Dleave=__leave -Dfinally=__finally -#WINFLAGS=-c -W3 -DCRTAPI1=_cdecl -DCRTAPI2=_cdecl -nologo -D_X86_=1 -DWIN32 -D__WIN32__ $(WINVERSION) -DSTRICT -WINFLAGS=-c -W3 -nologo -DWIN32 -D_WINDOWS $(WINVERSION) -DSTRICT -WINLINKFLAGS=-nologo -machine:$(CPU) -subsystem:windows,$(APPVER) -BASELINKFLAGS=-nologo -machine:$(CPU) -subsystem:console,$(APPVER) -WINLIBS=kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib \ - shell32.lib oldnames.lib comctl32.lib odbc32.lib ole32.lib oleaut32.lib \ - uuid.lib rpcrt4.lib advapi32.lib wsock32.lib \ - # libci.lib # libci.lib required for VC++ 4.2 - -# Set a WXWIN environment variable be the path to your WXWIN directory -WXDIR=$(WXWIN) - -WXSRC=$(WXDIR)\src\msw -WXINC=$(WXDIR)\include -WXBASESRC=$(WXDIR)\src\common - -##################################################################### -# These are the possible DLL/non-DLL usages: -# -# Type _DLL/_WINDLL WXUSINGDLL WXMAKINGDLL Library -#-------------------------------------------------------------------- -# Normal application - - - wx.lib -# -# wxWin as DLL Defined - Defined wx$(WXVERSION).lib -# -# App using wxWin DLL - Defined - wx$(WXVERSION).lib -# -# App built as one DLL Defined - - wx.lib -# -###################################################################### -# -# Compiling your app: -#-------------------- -# when compiling an app to use the DLL version of wxWindows -# (but not to be a DLL itself), set WXUSINGDLL to 1 in your -# makefile just before including ntwxwin.mak. -# To compile wxWin _and_ app itself as a DLL, set DLL to 1 -# in ntwxwin.mak, and do not set WXUSINGDLL. -# -# Compiling wxWindows: -#--------------------- -# Use the dll target to compile wxWindows as DLL; then make 'pch' -# to generate a precompiled header for your apps to use. BUG: must compile without -# wxExpr (USE_WX_RESOURCES = 0) for this to link properly. Don't know why yet. -# Use the dllapp target to compile wxWindows for making a DLL app (not implemented yet) - -#DLL=0 - -!if "$(WXUSINGDLL)" == "1" -EXTRADLLFLAGS=/DWXUSINGDLL=1 -!endif - -!if "$(WXMAKINGDLL)" == "1" -EXTRADLLFLAGS=/DWXMAKINGDLL=1 -!endif - -!if "$(WXMAKINGDLL)" == "0" && "$(DLL)" == "1" -EXTRADLLFLAGS= -!endif - -!if "$(NOMAIN)" == "1" -EXTRADLLFLAGS=$(EXTRADLLFLAGS) /DNOMAIN -!endif - -!ifndef UNICODE -UNICODE=0 -!endif - -!ifndef MSLU -MSLU=0 -!endif - -!ifndef FINAL -FINAL=0 -!endif - -!ifndef DEBUGINFO -!if "$(FINAL)" == "0" -DEBUGINFO=1 -!else -DEBUGINFO=0 -!endif -!endif - -!ifndef DLL -DLL=0 -!endif - -# Set this to 1 if you don't want to use precompiled headers -!ifndef NOPCH -NOPCH=0 -!endif - -# This sets 'D' to a suitable directory name: [Base](Debug|Release|Hybrid)[Dll] -# for this kind of build, and WXLIBNAME to one of wx(msw|base)[u][d] (static), -# wx(msw|base)$(WXVERSION)[u][d] (DLL) - -!if "$(UNICODE)" == "1" -_WXLIB_SUFFIX=u -_WXINC_SUFFIX=u -_WXDIR_UNICODESUFFIX=Unicode -!endif - -!if "$(WXMAKINGDLL)" == "1" || "$(WXUSINGDLL)" == "1" -_WXLIB_VERSION=$(WXVERSION) -_WXDIR_DLLSUFFIX=Dll -_WXINC_DLLSUFFIX=dll -!else -_WXLIB_VERSION= -_WXDIR_DLLSUFFIX= -_WXINC_DLLSUFFIX= -!endif - -!if "$(FINAL)" == "1" -_WXDIR_BUILD=Release -LIBEXT= -# no _WXDIR_SUFFIX -!else if "$(FINAL)" == "hybrid" -_WXDIR_BUILD=Hybrid -LIBEXT=h -!else -guilibsdll= oldnames.lib kernel32.lib \ - ws2_32.lib mswsock.lib advapi32.lib user32.lib \ - gdi32.lib comdlg32.lib winspool.lib -_WXDIR_BUILD=Debug -LIBEXT=d -!endif - -!if "$(wxUSE_GUI)" == "0" -_WXDIR_PREFIX=Base -_WXLIB_NAME=wxbase -_WXINC_BUILD=base -!else -_WXDIR_PREFIX= -_WXLIB_NAME=wxmsw -_WXINC_BUILD=msw -!endif - -!if "$(UNICODE)" == "1" -UNIFLAGS=-DUNICODE -D_UNICODE -DwxUSE_UNICODE=1 -!endif - -!if "$(wxUSE_GUI)" == "0" -UNIFLAGS=$(UNIFLAGS) -DwxUSE_GUI=0 -!endif - -!if "$(WXMAKINGDLL)" == "1" || "$(WXUSINGDLL)" == "1" -D=$(D)DLL -INCEXT=dll$(INCEXT) -!endif - -D=$(_WXDIR_PREFIX)$(_WXDIR_BUILD)$(_WXDIR_UNICODESUFFIX)$(_WXDIR_DLLSUFFIX) -WXLIBNAME=$(_WXLIB_NAME)$(_WXLIB_VERSION)$(_WXLIB_SUFFIX)$(LIBEXT) -INCEXT=$(_WXINC_SUFFIX)$(LIBEXT) - -!if "$(NEW_WXLIBNAME)" != "" -WXLIBNAME=$(NEW_WXLIBNAME) -!endif - -#---------------------------------------------------------------------- -# MSLU == Microsoft Layer for Unicode -# See MSDN or the Platform SDK docs for details -!if "$(MSLU)" == "1" -MSLU_FLAGS=/nod:kernel32.lib /nod:advapi32.lib /nod:user32.lib /nod:gdi32.lib /nod:shell32.lib /nod:comdlg32.lib /nod:version.lib /nod:mpr.lib /nod:rasapi32.lib /nod:winmm.lib /nod:winspool.lib /nod:vfw32.lib /nod:secur32.lib /nod:oleacc.lib /nod:oledlg.lib /nod:sensapi.lib -MSLU_LIBS=$(MSLU_FLAGS) unicows.lib -!endif - -WXLIB=$(WXDIR)\lib\$(WXLIBNAME).lib - -INC=$(EXTRAINC) -I$(WXDIR)/lib/$(_WXINC_BUILD)$(_WXINC_DLLSUFFIX)$(_WXINC_SUFFIX)$(LIBEXT) -I$(WXINC) -I$(WXDIR)/contrib/include -I$(WXDIR)/src/regex -I$(WXDIR)/src/png -I$(WXDIR)/src/zlib -I$(WXDIR)/src/jpeg -I$(WXDIR)/src/tiff - -!if "$(WXUSINGDLL)" == "1" || "$(wxUSE_GUI)" == "0" -LIBS = $(MSLU_LIBS) $(EXTRALIBS) $(WXLIB) $(WINLIBS) $(WXDIR)\lib\regex$(LIBEXT).lib $(WXDIR)\lib\zlib$(LIBEXT).lib -!else -LIBS = $(MSLU_LIBS) $(EXTRALIBS) $(WXLIB) $(WINLIBS) $(WXDIR)\lib\regex$(LIBEXT).lib $(WXDIR)\lib\png$(LIBEXT).lib $(WXDIR)\lib\zlib$(LIBEXT).lib $(WXDIR)\lib\jpeg$(LIBEXT).lib $(WXDIR)\lib\tiff$(LIBEXT).lib -!endif - -OPTIONS= - -!if "$(DEBUGINFO)" == "0" - -!if "$(FINAL)" == "hybrid" -OPT = /Ox /Gy -!else -# /O1 - smallest code -# /O2 - fastest code -OPT = /O1 # /O2 # /Od -!endif - -LINK_DEBUG_FLAGS=/RELEASE - -!else -OPT = /Od /Gy /Zi -LINK_DEBUG_FLAGS=-debug:full -debugtype:cv -!endif - -!if "$(FINAL)" == "0" -# ***N.B.*** to save space/time, comment out /FR to avoid browse info (.sbr files) being generated -DEBUG_FLAGS= /D__WXDEBUG__ # /DDEBUG=1 # /FR -_CRTFLAG=/MDd - -!else if "$(FINAL)" == "hybrid" -DEBUG_FLAGS= /D__WXDEBUG__ /D__NO_VC_CRTDBG__ -_CRTFLAG=/MD - -!else -DEBUG_FLAGS= -_CRTFLAG=/MD - -!endif - - -!if "$(CRTFLAG)" == "" -CRTFLAG=$(_CRTFLAG) -!endif - -!if "$(NOPCH)" == "1" - -PCH= -PRECOMP= -MAKEPRECOMP= - -!else - -!if "$(wxUSE_GUI)" == "0" -PCH=wxBase.pch -!else -PCH=wxWindows.pch -!endif - -PRECOMP=/YuWX/WXPREC.H /Fp$(WXDIR)\$D\$(PCH) /Fd$(WXDIR)\lib\$(WXLIBNAME).pdb -MAKEPRECOMP=/YcWX/WXPREC.H - -!endif - -!if "$(DLL)" == "0" - -CPPFLAGS=$(UNIFLAGS) $(WINFLAGS) $(DEBUG_FLAGS) $(PRECOMP) $(EXTRAFLAGS) $(INC) $(OPT) $(EXTRADLLFLAGS) $(CRTFLAG) $(OVERRIDEFLAGS) -# If you don't include wxprec.h, use CPPFLAGS2 -CPPFLAGS2=$(UNIFLAGS) $(WINFLAGS) $(DEBUG_FLAGS) $(INC) $(EXTRAFLAGS) $(OPT) $(EXTRADLLFLAGS) $(CRTFLAG) $(OVERRIDEFLAGS) - -!if "$(wxUSE_GUI)" == "0" -LINKFLAGS=$(LINK_DEBUG_FLAGS) $(BASELINKFLAGS) -!else -LINKFLAGS=$(LINK_DEBUG_FLAGS) $(WINLINKFLAGS) -!endif - -DUMMY=dummy - -!else - -CPPFLAGS= $(UNIFLAGS) $(WINFLAGS) $(DEBUG_FLAGS) $(PRECOMP) $(EXTRAFLAGS) $(INC) $(OPT) /D_DLL $(CRTFLAG) $(EXTRADLLFLAGS) /D_WINDLL -CPPFLAGS2=$(UNIFLAGS) $(WINFLAGS) $(DEBUG_FLAGS) $(EXTRAFLAGS) $(INC) $(OPT) /D_DLL $(CRTFLAG) $(EXTRADLLFLAGS) /D_WINDLL - -!if "$(wxUSE_GUI)" == "0" -LINKFLAGS=$(LINK_DEBUG_FLAGS) $(BASELINKFLAGS) -dll -!else -LINKFLAGS=$(LINK_DEBUG_FLAGS) $(WINLINKFLAGS) -dll -!endif - -!if "$(WXMAKINGDLL)" == "1" -DUMMY=dummydll -!else -DUMMY=dummy -!endif - -!endif - -DUMMYOBJ=$(WXDIR)\$D\$(DUMMY).obj - -.c.obj: - cl @<< -$(CPPFLAGS2) /Fo$@ /c $< -<< - -.cpp.obj: - cl @<< -$(CPPFLAGS2) /Fo$@ /c $< -<< - -#use CPPFLAGS2 so as not to use precompiled headers -{}.c{$D}.obj: - cl @<< -$(CPPFLAGS2) /Fo$@ /c $< -<< - -{}.cpp{$D}.obj: - cl @<< -$(CPPFLAGS) /Fo$@ /c /Tp $< -<< - diff --git a/wxWidgets/src/mingegcs.bat b/wxWidgets/src/mingegcs.bat deleted file mode 100644 index cae95b56e0..0000000000 --- a/wxWidgets/src/mingegcs.bat +++ /dev/null @@ -1,17 +0,0 @@ -REM -REM replace k:\mingw32 with whatever your installation root may be. -REM -path C:\WINDOWS;C:\WINDOWS\COMMAND;k:\mingw32\bin;c:\bin - -SET GCC_EXEC_PREFIX=k:\mingw32\lib\gcc-lib\ -set BISON_SIMPLE=k:\mingw32\share\bison.simple -set BISON_HAIRY=k:\mingw32\share\bison.hairy -set C_INCLUDE_PATH=k:\MINGW32\include -set CPLUS_INCLUDE_PATH=k:\MINGW32\include\g++;g:\MINGW32\include -set LIBRARY_PATH=k:\MINGW32\lib -set GCC_EXEC_PREFIX=k:\MINGW32\lib\gcc-lib\ - -rem 4DOS users only... -unalias make -alias makeming make -f makefile.g95 - diff --git a/wxWidgets/src/mingw32.bat b/wxWidgets/src/mingw32.bat deleted file mode 100644 index 5b1685b9ec..0000000000 --- a/wxWidgets/src/mingw32.bat +++ /dev/null @@ -1,16 +0,0 @@ -REM -REM replace c:\MINGW with whatever your installation root may be. -REM GCC_EXEC_PREFIX is optional, and hardly ever needs to be set (read: -REM leave it alone). -REM -SET MINGWDIR=c:\gcc-2.95 -PATH=%MINGWDIR%\bin;%PATH% -set BISON_SIMPLE=%MINGWDIR%\share\bison.simple -set BISON_HAIRY=%MINGWDIR%\share\bison.hairy - -REM SET GCC_EXEC_PREFIX=%MINGWDIR%\lib\gcc-lib\ -REM set LIBRARY_PATH=%MINGWDIR%\lib;%MINGWDIR%\lib\gcc-lib\i386-mingw32\2.8.1 - -rem 4DOS users only... -unalias make -alias makeming make -f makefile.g95 diff --git a/wxWidgets/src/msw/aboutdlg.cpp b/wxWidgets/src/msw/aboutdlg.cpp deleted file mode 100644 index da24c0bf7c..0000000000 --- a/wxWidgets/src/msw/aboutdlg.cpp +++ /dev/null @@ -1,70 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: src/msw/aboutdlg.cpp -// Purpose: implementation of wxAboutBox() for wxMSW -// Author: Vadim Zeitlin -// Created: 2006-10-07 -// RCS-ID: $Id: aboutdlg.cpp 58748 2009-02-08 09:46:03Z VZ $ -// Copyright: (c) 2006 Vadim Zeitlin -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -// for compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_ABOUTDLG - -#ifndef WX_PRECOMP - #include "wx/msgdlg.h" -#endif //WX_PRECOMP - -#include "wx/aboutdlg.h" -#include "wx/generic/aboutdlgg.h" - -// ============================================================================ -// implementation -// ============================================================================ - -// our public entry point -void wxAboutBox(const wxAboutDialogInfo& info) -{ - // we prefer to show a simple message box if we don't have any fields which - // can't be shown in it because as much as there is a standard about box - // under MSW at all, this is it - if ( info.IsSimple() ) - { - // build the text to show in the box - const wxString name = info.GetName(); - wxString msg; - msg << name; - if ( info.HasVersion() ) - msg << _(" Version ") << info.GetVersion(); - msg << _T('\n'); - - if ( info.HasCopyright() ) - msg << info.GetCopyrightToDisplay() << _T('\n'); - - // add everything remaining - msg << info.GetDescriptionAndCredits(); - - wxMessageBox(msg, _("About ") + name); - } - else // simple "native" version is not enough - { - // we need to use the full-blown generic version - wxGenericAboutBox(info); - } -} - -#endif // wxUSE_ABOUTDLG diff --git a/wxWidgets/src/msw/accel.cpp b/wxWidgets/src/msw/accel.cpp deleted file mode 100644 index 048023f48e..0000000000 --- a/wxWidgets/src/msw/accel.cpp +++ /dev/null @@ -1,160 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: msw/accel.cpp -// Purpose: wxAcceleratorTable -// Author: Julian Smart -// Modified by: -// Created: 04/01/98 -// RCS-ID: $Id: accel.cpp 56049 2008-10-03 12:13:21Z VZ $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_ACCEL - -#ifndef WX_PRECOMP - #include "wx/window.h" -#endif - -#include "wx/accel.h" - -#include "wx/msw/private.h" - -extern WXWORD wxCharCodeWXToMSW(int id, bool *isVirtual); - -IMPLEMENT_DYNAMIC_CLASS(wxAcceleratorTable, wxObject) - -// ---------------------------------------------------------------------------- -// data defining wxAcceleratorTable -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxAcceleratorRefData: public wxObjectRefData -{ - friend class WXDLLIMPEXP_FWD_CORE wxAcceleratorTable; -public: - wxAcceleratorRefData(); - virtual ~wxAcceleratorRefData(); - - inline HACCEL GetHACCEL() const { return m_hAccel; } -protected: - HACCEL m_hAccel; - bool m_ok; - - DECLARE_NO_COPY_CLASS(wxAcceleratorRefData) -}; - -// ============================================================================ -// implementation -// ============================================================================ - -// ---------------------------------------------------------------------------- -// wxAcceleratorRefData -// ---------------------------------------------------------------------------- - -#define M_ACCELDATA ((wxAcceleratorRefData *)m_refData) - -wxAcceleratorRefData::wxAcceleratorRefData() -{ - m_ok = false; - m_hAccel = 0; -} - -wxAcceleratorRefData::~wxAcceleratorRefData() -{ - if (m_hAccel) - { - DestroyAcceleratorTable((HACCEL) m_hAccel); - } -} - -// ---------------------------------------------------------------------------- -// wxAcceleratorTable -// ---------------------------------------------------------------------------- - -// Load from .rc resource -wxAcceleratorTable::wxAcceleratorTable(const wxString& resource) -{ - m_refData = new wxAcceleratorRefData; - - HACCEL hAccel = ::LoadAccelerators(wxGetInstance(), resource); - M_ACCELDATA->m_hAccel = hAccel; - M_ACCELDATA->m_ok = hAccel != 0; -} - -// Create from an array -wxAcceleratorTable::wxAcceleratorTable(int n, const wxAcceleratorEntry entries[]) -{ - m_refData = new wxAcceleratorRefData; - - ACCEL* arr = new ACCEL[n]; - for ( int i = 0; i < n; i++ ) - { - int flags = entries[i].GetFlags(); - - BYTE fVirt = 0; - if ( flags & wxACCEL_ALT ) - fVirt |= FALT | FVIRTKEY; - if ( flags & wxACCEL_SHIFT ) - fVirt |= FSHIFT | FVIRTKEY; - if ( flags & wxACCEL_CTRL ) - fVirt |= FCONTROL | FVIRTKEY; - - bool isVirtual; - - WORD key = wxCharCodeWXToMSW(entries[i].GetKeyCode(), &isVirtual); - if (isVirtual) - fVirt |= FVIRTKEY; - - arr[i].fVirt = fVirt; - arr[i].key = key; - arr[i].cmd = (WORD)entries[i].GetCommand(); - } - - M_ACCELDATA->m_hAccel = ::CreateAcceleratorTable(arr, n); - delete[] arr; - - M_ACCELDATA->m_ok = (M_ACCELDATA->m_hAccel != 0); -} - -bool wxAcceleratorTable::IsOk() const -{ - return (M_ACCELDATA && (M_ACCELDATA->m_ok)); -} - -void wxAcceleratorTable::SetHACCEL(WXHACCEL hAccel) -{ - if (!M_ACCELDATA) - m_refData = new wxAcceleratorRefData; - - M_ACCELDATA->m_hAccel = (HACCEL) hAccel; -} - -WXHACCEL wxAcceleratorTable::GetHACCEL() const -{ - if (!M_ACCELDATA) - return 0; - return (WXHACCEL) M_ACCELDATA->m_hAccel; -} - -bool wxAcceleratorTable::Translate(wxWindow *window, WXMSG *wxmsg) const -{ - MSG *msg = (MSG *)wxmsg; - return Ok() && ::TranslateAccelerator(GetHwndOf(window), GetHaccel(), msg); -} - -#endif // wxUSE_ACCEL - diff --git a/wxWidgets/src/msw/app.cpp b/wxWidgets/src/msw/app.cpp deleted file mode 100644 index 08e358443f..0000000000 --- a/wxWidgets/src/msw/app.cpp +++ /dev/null @@ -1,809 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/msw/app.cpp -// Purpose: wxApp -// Author: Julian Smart -// Modified by: -// Created: 04/01/98 -// RCS-ID: $Id: app.cpp 62085 2009-09-24 15:42:13Z JS $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// =========================================================================== -// declarations -// =========================================================================== - -// --------------------------------------------------------------------------- -// headers -// --------------------------------------------------------------------------- - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#if defined(__BORLANDC__) - #pragma hdrstop -#endif - -#ifndef WX_PRECOMP - #include "wx/msw/wrapcctl.h" - #include "wx/dynarray.h" - #include "wx/frame.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/icon.h" - #include "wx/palette.h" - #include "wx/dc.h" - #include "wx/dialog.h" - #include "wx/msgdlg.h" - #include "wx/intl.h" - #include "wx/wxchar.h" - #include "wx/log.h" - #include "wx/module.h" -#endif - -#include "wx/apptrait.h" -#include "wx/filename.h" -#include "wx/dynlib.h" -#include "wx/evtloop.h" - -#include "wx/msw/private.h" -#include "wx/msw/ole/oleutils.h" - -#if wxUSE_TOOLTIPS - #include "wx/tooltip.h" -#endif // wxUSE_TOOLTIPS - -// OLE is used for drag-and-drop, clipboard, OLE Automation..., but some -// compilers don't support it (missing headers, libs, ...) -#if defined(__GNUWIN32_OLD__) || defined(__SYMANTEC__) || defined(__SALFORDC__) - #undef wxUSE_OLE - - #define wxUSE_OLE 0 -#endif // broken compilers - -#if defined(__POCKETPC__) || defined(__SMARTPHONE__) - #include - #include -#endif - -#if wxUSE_OLE - #include -#endif - -#include -#include - -// For MB_TASKMODAL -#ifdef __WXWINCE__ -#include "wx/msw/wince/missing.h" -#endif - -// instead of including which is not part of the core SDK and not -// shipped at all with other compilers, we always define the parts of it we -// need here ourselves -// -// NB: DLLVER_PLATFORM_WINDOWS will be defined if shlwapi.h had been somehow -// included already -#ifndef DLLVER_PLATFORM_WINDOWS - // hopefully we don't need to change packing as DWORDs should be already - // correctly aligned - struct DLLVERSIONINFO - { - DWORD cbSize; - DWORD dwMajorVersion; // Major version - DWORD dwMinorVersion; // Minor version - DWORD dwBuildNumber; // Build number - DWORD dwPlatformID; // DLLVER_PLATFORM_* - }; - - typedef HRESULT (CALLBACK* DLLGETVERSIONPROC)(DLLVERSIONINFO *); -#endif // defined(DLLVERSIONINFO) - - -// --------------------------------------------------------------------------- -// global variables -// --------------------------------------------------------------------------- - -#if !defined(__WXMICROWIN__) && !defined(__WXWINCE__) -extern void wxSetKeyboardHook(bool doIt); -#endif - -// NB: all "NoRedraw" classes must have the same names as the "normal" classes -// with NR suffix - wxWindow::MSWCreate() supposes this -#ifdef __WXWINCE__ -WXDLLIMPEXP_CORE wxChar *wxCanvasClassName; -WXDLLIMPEXP_CORE wxChar *wxCanvasClassNameNR; -#else -WXDLLIMPEXP_CORE const wxChar *wxCanvasClassName = wxT("wxWindowClass"); -WXDLLIMPEXP_CORE const wxChar *wxCanvasClassNameNR = wxT("wxWindowClassNR"); -#endif -WXDLLIMPEXP_CORE const wxChar *wxMDIFrameClassName = wxT("wxMDIFrameClass"); -WXDLLIMPEXP_CORE const wxChar *wxMDIFrameClassNameNoRedraw = wxT("wxMDIFrameClassNR"); -WXDLLIMPEXP_CORE const wxChar *wxMDIChildFrameClassName = wxT("wxMDIChildFrameClass"); -WXDLLIMPEXP_CORE const wxChar *wxMDIChildFrameClassNameNoRedraw = wxT("wxMDIChildFrameClassNR"); - -// ---------------------------------------------------------------------------- -// private functions -// ---------------------------------------------------------------------------- - -LRESULT WXDLLEXPORT APIENTRY wxWndProc(HWND, UINT, WPARAM, LPARAM); - -// =========================================================================== -// wxGUIAppTraits implementation -// =========================================================================== - -// private class which we use to pass parameters from BeforeChildWaitLoop() to -// AfterChildWaitLoop() -struct ChildWaitLoopData -{ - ChildWaitLoopData(wxWindowDisabler *wd_, wxWindow *winActive_) - { - wd = wd_; - winActive = winActive_; - } - - wxWindowDisabler *wd; - wxWindow *winActive; -}; - -void *wxGUIAppTraits::BeforeChildWaitLoop() -{ - /* - We use a dirty hack here to disable all application windows (which we - must do because otherwise the calls to wxYield() could lead to some very - unexpected reentrancies in the users code) but to avoid losing - focus/activation entirely when the child process terminates which would - happen if we simply disabled everything using wxWindowDisabler. Indeed, - remember that Windows will never activate a disabled window and when the - last childs window is closed and Windows looks for a window to activate - all our windows are still disabled. There is no way to enable them in - time because we don't know when the childs windows are going to be - closed, so the solution we use here is to keep one special tiny frame - enabled all the time. Then when the child terminates it will get - activated and when we close it below -- after reenabling all the other - windows! -- the previously active window becomes activated again and - everything is ok. - */ - wxBeginBusyCursor(); - - // first disable all existing windows - wxWindowDisabler *wd = new wxWindowDisabler; - - // then create an "invisible" frame: it has minimal size, is positioned - // (hopefully) outside the screen and doesn't appear on the taskbar - wxWindow *winActive = new wxFrame - ( - wxTheApp->GetTopWindow(), - wxID_ANY, - wxEmptyString, - wxPoint(32600, 32600), - wxSize(1, 1), - wxDEFAULT_FRAME_STYLE | wxFRAME_NO_TASKBAR - ); - winActive->Show(); - - return new ChildWaitLoopData(wd, winActive); -} - -void wxGUIAppTraits::AlwaysYield() -{ - wxYield(); -} - -void wxGUIAppTraits::AfterChildWaitLoop(void *dataOrig) -{ - wxEndBusyCursor(); - - ChildWaitLoopData * const data = (ChildWaitLoopData *)dataOrig; - - delete data->wd; - - // finally delete the dummy frame and, as wd has been already destroyed and - // the other windows reenabled, the activation is going to return to the - // window which had had it before - data->winActive->Destroy(); - - // also delete the temporary data object itself - delete data; -} - -bool wxGUIAppTraits::DoMessageFromThreadWait() -{ - // we should return false only if the app should exit, i.e. only if - // Dispatch() determines that the main event loop should terminate - wxEventLoop *evtLoop = wxEventLoop::GetActive(); - if ( !evtLoop || !evtLoop->Pending() ) - { - // no events means no quit event - return true; - } - - return evtLoop->Dispatch(); -} - -wxPortId wxGUIAppTraits::GetToolkitVersion(int *majVer, int *minVer) const -{ - OSVERSIONINFO info; - wxZeroMemory(info); - - // on Windows, the toolkit version is the same of the OS version - // as Windows integrates the OS kernel with the GUI toolkit. - info.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); - if ( ::GetVersionEx(&info) ) - { - if ( majVer ) - *majVer = info.dwMajorVersion; - if ( minVer ) - *minVer = info.dwMinorVersion; - } - -#if defined(__WXHANDHELD__) || defined(__WXWINCE__) - return wxPORT_WINCE; -#else - return wxPORT_MSW; -#endif -} - -// =========================================================================== -// wxApp implementation -// =========================================================================== - -int wxApp::m_nCmdShow = SW_SHOWNORMAL; - -// --------------------------------------------------------------------------- -// wxWin macros -// --------------------------------------------------------------------------- - -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() - -// class to ensure that wxAppBase::CleanUp() is called if our Initialize() -// fails -class wxCallBaseCleanup -{ -public: - wxCallBaseCleanup(wxApp *app) : m_app(app) { } - ~wxCallBaseCleanup() { if ( m_app ) m_app->wxAppBase::CleanUp(); } - - void Dismiss() { m_app = NULL; } - -private: - wxApp *m_app; -}; - -//// Initialize -bool wxApp::Initialize(int& argc, wxChar **argv) -{ - if ( !wxAppBase::Initialize(argc, argv) ) - return false; - - // ensure that base cleanup is done if we return too early - wxCallBaseCleanup callBaseCleanup(this); - -#ifdef __WXWINCE__ - wxString tmp = GetAppName(); - tmp += wxT("ClassName"); - wxCanvasClassName = wxStrdup( tmp.c_str() ); - tmp += wxT("NR"); - wxCanvasClassNameNR = wxStrdup( tmp.c_str() ); - HWND hWnd = FindWindow( wxCanvasClassNameNR, NULL ); - if (hWnd) - { - SetForegroundWindow( (HWND)(((DWORD)hWnd)|0x01) ); - return false; - } -#endif - -#if !defined(__WXMICROWIN__) - InitCommonControls(); -#endif // !defined(__WXMICROWIN__) - -#if defined(__SMARTPHONE__) || defined(__POCKETPC__) - SHInitExtraControls(); -#endif - -#ifndef __WXWINCE__ - // Don't show a message box if a function such as SHGetFileInfo - // fails to find a device. - SetErrorMode(SEM_FAILCRITICALERRORS|SEM_NOOPENFILEERRORBOX); -#endif - - wxOleInitialize(); - - RegisterWindowClasses(); - - wxWinHandleHash = new wxWinHashTable(wxKEY_INTEGER, 100); - -#if !defined(__WXMICROWIN__) && !defined(__WXWINCE__) - wxSetKeyboardHook(true); -#endif - - callBaseCleanup.Dismiss(); - - return true; -} - -// --------------------------------------------------------------------------- -// RegisterWindowClasses -// --------------------------------------------------------------------------- - -// TODO we should only register classes really used by the app. For this it -// would be enough to just delay the class registration until an attempt -// to create a window of this class is made. -bool wxApp::RegisterWindowClasses() -{ - WNDCLASS wndclass; - wxZeroMemory(wndclass); - - // for each class we register one with CS_(V|H)REDRAW style and one - // without for windows created with wxNO_FULL_REDRAW_ON_REPAINT flag - static const long styleNormal = CS_HREDRAW | CS_VREDRAW | CS_DBLCLKS; - static const long styleNoRedraw = CS_DBLCLKS; - - // the fields which are common to all classes - wndclass.lpfnWndProc = (WNDPROC)wxWndProc; - wndclass.hInstance = wxhInstance; - wndclass.hCursor = ::LoadCursor((HINSTANCE)NULL, IDC_ARROW); - - // register the class for all normal windows - wndclass.hbrBackground = (HBRUSH)(COLOR_BTNFACE + 1); - wndclass.lpszClassName = wxCanvasClassName; - wndclass.style = styleNormal; - - if ( !RegisterClass(&wndclass) ) - { - wxLogLastError(wxT("RegisterClass(frame)")); - } - - // "no redraw" frame - wndclass.lpszClassName = wxCanvasClassNameNR; - wndclass.style = styleNoRedraw; - - if ( !RegisterClass(&wndclass) ) - { - wxLogLastError(wxT("RegisterClass(no redraw frame)")); - } - - // Register the MDI frame window class. - wndclass.hbrBackground = (HBRUSH)NULL; // paint MDI frame ourselves - wndclass.lpszClassName = wxMDIFrameClassName; - wndclass.style = styleNormal; - - if ( !RegisterClass(&wndclass) ) - { - wxLogLastError(wxT("RegisterClass(MDI parent)")); - } - - // "no redraw" MDI frame - wndclass.lpszClassName = wxMDIFrameClassNameNoRedraw; - wndclass.style = styleNoRedraw; - - if ( !RegisterClass(&wndclass) ) - { - wxLogLastError(wxT("RegisterClass(no redraw MDI parent frame)")); - } - - // Register the MDI child frame window class. - wndclass.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1); - wndclass.lpszClassName = wxMDIChildFrameClassName; - wndclass.style = styleNormal; - - if ( !RegisterClass(&wndclass) ) - { - wxLogLastError(wxT("RegisterClass(MDI child)")); - } - - // "no redraw" MDI child frame - wndclass.lpszClassName = wxMDIChildFrameClassNameNoRedraw; - wndclass.style = styleNoRedraw; - - if ( !RegisterClass(&wndclass) ) - { - wxLogLastError(wxT("RegisterClass(no redraw MDI child)")); - } - - return true; -} - -// --------------------------------------------------------------------------- -// UnregisterWindowClasses -// --------------------------------------------------------------------------- - -bool wxApp::UnregisterWindowClasses() -{ - bool retval = true; - -#ifndef __WXMICROWIN__ - // MDI frame window class. - if ( !::UnregisterClass(wxMDIFrameClassName, wxhInstance) ) - { - wxLogLastError(wxT("UnregisterClass(MDI parent)")); - - retval = false; - } - - // "no redraw" MDI frame - if ( !::UnregisterClass(wxMDIFrameClassNameNoRedraw, wxhInstance) ) - { - wxLogLastError(wxT("UnregisterClass(no redraw MDI parent frame)")); - - retval = false; - } - - // MDI child frame window class. - if ( !::UnregisterClass(wxMDIChildFrameClassName, wxhInstance) ) - { - wxLogLastError(wxT("UnregisterClass(MDI child)")); - - retval = false; - } - - // "no redraw" MDI child frame - if ( !::UnregisterClass(wxMDIChildFrameClassNameNoRedraw, wxhInstance) ) - { - wxLogLastError(wxT("UnregisterClass(no redraw MDI child)")); - - retval = false; - } - - // canvas class name - if ( !::UnregisterClass(wxCanvasClassName, wxhInstance) ) - { - wxLogLastError(wxT("UnregisterClass(canvas)")); - - retval = false; - } - - if ( !::UnregisterClass(wxCanvasClassNameNR, wxhInstance) ) - { - wxLogLastError(wxT("UnregisterClass(no redraw canvas)")); - - retval = false; - } -#endif // __WXMICROWIN__ - - return retval; -} - -void wxApp::CleanUp() -{ - // all objects pending for deletion must be deleted first, otherwise we - // would crash when they use wxWinHandleHash (and UnregisterWindowClasses() - // call wouldn't succeed as long as any windows still exist), so call the - // base class method first and only then do our clean up - wxAppBase::CleanUp(); - -#if !defined(__WXMICROWIN__) && !defined(__WXWINCE__) - wxSetKeyboardHook(false); -#endif - - wxOleUninitialize(); - - // for an EXE the classes are unregistered when it terminates but DLL may - // be loaded several times (load/unload/load) into the same process in - // which case the registration will fail after the first time if we don't - // unregister the classes now - UnregisterWindowClasses(); - - delete wxWinHandleHash; - wxWinHandleHash = NULL; - -#ifdef __WXWINCE__ - free( wxCanvasClassName ); - free( wxCanvasClassNameNR ); -#endif -} - -// ---------------------------------------------------------------------------- -// wxApp ctor/dtor -// ---------------------------------------------------------------------------- - -wxApp::wxApp() -{ - m_printMode = wxPRINT_WINDOWS; -} - -wxApp::~wxApp() -{ -} - -// ---------------------------------------------------------------------------- -// wxApp idle handling -// ---------------------------------------------------------------------------- - -void wxApp::OnIdle(wxIdleEvent& event) -{ - wxAppBase::OnIdle(event); - -#if wxUSE_DC_CACHEING - // automated DC cache management: clear the cached DCs and bitmap - // if it's likely that the app has finished with them, that is, we - // get an idle event and we're not dragging anything. - if (!::GetKeyState(MK_LBUTTON) && !::GetKeyState(MK_MBUTTON) && !::GetKeyState(MK_RBUTTON)) - wxDC::ClearCache(); -#endif // wxUSE_DC_CACHEING -} - -void wxApp::WakeUpIdle() -{ - // Send the top window a dummy message so idle handler processing will - // start up again. Doing it this way ensures that the idle handler - // wakes up in the right thread (see also wxWakeUpMainThread() which does - // the same for the main app thread only) - wxWindow * const topWindow = wxTheApp->GetTopWindow(); - if ( topWindow ) - { - HWND hwndTop = GetHwndOf(topWindow); - - // Do not post WM_NULL if there's already a pending WM_NULL to avoid - // overflowing the message queue. - // - // Notice that due to a limitation of PeekMessage() API (which handles - // 0,0 range specially), we have to check the range from 0-1 instead. - // This still makes it possible to overflow the queue with WM_NULLs by - // interspersing the calles to WakeUpIdle() with windows creation but - // it should be rather hard to do it accidentally. - MSG msg; - if ( !::PeekMessage(&msg, hwndTop, 0, 1, PM_NOREMOVE) || - ::PeekMessage(&msg, hwndTop, 1, 1, PM_NOREMOVE) ) - { - if ( !::PostMessage(hwndTop, WM_NULL, 0, 0) ) - { - // should never happen - wxLogLastError(wxT("PostMessage(WM_NULL)")); - } - } - } -#if wxUSE_THREADS - else - wxWakeUpMainThread(); -#endif // wxUSE_THREADS -} - -// ---------------------------------------------------------------------------- -// other wxApp event hanlders -// ---------------------------------------------------------------------------- - -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); - } -} - -// ---------------------------------------------------------------------------- -// miscellaneous -// ---------------------------------------------------------------------------- - -/* static */ -int wxApp::GetComCtl32Version() -{ -#if defined(__WXMICROWIN__) || defined(__WXWINCE__) - return 0; -#else - // cache the result - // - // NB: this is MT-ok as in the worst case we'd compute s_verComCtl32 twice, - // but as its value should be the same both times it doesn't matter - static int s_verComCtl32 = -1; - - if ( s_verComCtl32 == -1 ) - { - // initally assume no comctl32.dll at all - s_verComCtl32 = 0; - - // we're prepared to handle the errors - wxLogNull noLog; - -#if wxUSE_DYNLIB_CLASS - // we don't want to load comctl32.dll, it should be already loaded but, - // depending on the OS version and the presence of the manifest, it can - // be either v5 or v6 and instead of trying to guess it just get the - // handle of the already loaded version - wxLoadedDLL dllComCtl32(_T("comctl32.dll")); - if ( !dllComCtl32.IsLoaded() ) - { - s_verComCtl32 = 0; - return 0; - } - - // if so, then we can check for the version - if ( dllComCtl32.IsLoaded() ) - { - // now check if the function is available during run-time - wxDYNLIB_FUNCTION( DLLGETVERSIONPROC, DllGetVersion, dllComCtl32 ); - if ( pfnDllGetVersion ) - { - DLLVERSIONINFO dvi; - dvi.cbSize = sizeof(dvi); - - HRESULT hr = (*pfnDllGetVersion)(&dvi); - if ( FAILED(hr) ) - { - wxLogApiError(_T("DllGetVersion"), hr); - } - else - { - // this is incompatible with _WIN32_IE values, but - // compatible with the other values returned by - // GetComCtl32Version() - s_verComCtl32 = 100*dvi.dwMajorVersion + - dvi.dwMinorVersion; - } - } - - // if DllGetVersion() is unavailable either during compile or - // run-time, try to guess the version otherwise - if ( !s_verComCtl32 ) - { - // InitCommonControlsEx is unique to 4.70 and later - void *pfn = dllComCtl32.GetSymbol(_T("InitCommonControlsEx")); - if ( !pfn ) - { - // not found, must be 4.00 - s_verComCtl32 = 400; - } - else // 4.70+ - { - // many symbols appeared in comctl32 4.71, could use any of - // them except may be DllInstall() - pfn = dllComCtl32.GetSymbol(_T("InitializeFlatSB")); - if ( !pfn ) - { - // not found, must be 4.70 - s_verComCtl32 = 470; - } - else - { - // found, must be 4.71 or later - s_verComCtl32 = 471; - } - } - } - } -#endif // wxUSE_DYNLIB_CLASS - } - - return s_verComCtl32; -#endif // Microwin/!Microwin -} - -// Yield to incoming messages - -bool wxApp::Yield(bool onlyIfNeeded) -{ - // MT-FIXME - static bool s_inYield = false; - -#if wxUSE_LOG - // disable log flushing from here because a call to wxYield() shouldn't - // normally result in message boxes popping up &c - wxLog::Suspend(); -#endif // wxUSE_LOG - - if ( s_inYield ) - { - if ( !onlyIfNeeded ) - { - wxFAIL_MSG( wxT("wxYield called recursively" ) ); - } - - return false; - } - - s_inYield = true; - - // we don't want to process WM_QUIT from here - it should be processed in - // the main event loop in order to stop it - wxEventLoopGuarantor dummyLoopIfNeeded; - MSG msg; - while ( PeekMessage(&msg, (HWND)0, 0, 0, PM_NOREMOVE) && - msg.message != WM_QUIT ) - { -#if wxUSE_THREADS - wxMutexGuiLeaveOrEnter(); -#endif // wxUSE_THREADS - - if ( !wxTheApp->Dispatch() ) - break; - } - - // if there are pending events, we must process them. - ProcessPendingEvents(); - -#if wxUSE_LOG - // let the logs be flashed again - wxLog::Resume(); -#endif // wxUSE_LOG - - s_inYield = false; - - return true; -} - -#if wxUSE_EXCEPTIONS - -// ---------------------------------------------------------------------------- -// exception handling -// ---------------------------------------------------------------------------- - -bool wxApp::OnExceptionInMainLoop() -{ - // ask the user about what to do: use the Win32 API function here as it - // could be dangerous to use any wxWidgets code in this state - switch ( - ::MessageBox - ( - NULL, - _T("An unhandled exception occurred. Press \"Abort\" to \ -terminate the program,\r\n\ -\"Retry\" to exit the program normally and \"Ignore\" to try to continue."), - _T("Unhandled exception"), - MB_ABORTRETRYIGNORE | - MB_ICONERROR| - MB_TASKMODAL - ) - ) - { - case IDABORT: - throw; - - default: - wxFAIL_MSG( _T("unexpected MessageBox() return code") ); - // fall through - - case IDRETRY: - return false; - - case IDIGNORE: - return true; - } -} - -#endif // wxUSE_EXCEPTIONS - -// ---------------------------------------------------------------------------- -// deprecated event loop functions -// ---------------------------------------------------------------------------- - -#if WXWIN_COMPATIBILITY_2_4 - -void wxApp::DoMessage(WXMSG *pMsg) -{ - wxEventLoop *evtLoop = wxEventLoop::GetActive(); - if ( evtLoop ) - evtLoop->ProcessMessage(pMsg); -} - -bool wxApp::DoMessage() -{ - wxEventLoop *evtLoop = wxEventLoop::GetActive(); - return evtLoop ? evtLoop->Dispatch() : false; -} - -bool wxApp::ProcessMessage(WXMSG* pMsg) -{ - wxEventLoop *evtLoop = wxEventLoop::GetActive(); - return evtLoop && evtLoop->PreProcessMessage(pMsg); -} - -#endif // WXWIN_COMPATIBILITY_2_4 diff --git a/wxWidgets/src/msw/basemsw.cpp b/wxWidgets/src/msw/basemsw.cpp deleted file mode 100644 index 4347fee039..0000000000 --- a/wxWidgets/src/msw/basemsw.cpp +++ /dev/null @@ -1,73 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: msw/basemsw.cpp -// Purpose: misc stuff only used in console applications under MSW -// Author: Vadim Zeitlin -// Modified by: -// Created: 22.06.2003 -// RCS-ID: $Id: basemsw.cpp 39831 2006-06-25 23:53:53Z VZ $ -// Copyright: (c) 2003 Vadim Zeitlin -// License: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -// for compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#ifndef WX_PRECOMP -#endif //WX_PRECOMP - -#include "wx/apptrait.h" -// MBN: this is a workaround for MSVC 5: if it is not #included in -// some wxBase file, wxRecursionGuard methods won't be exported from -// wxBase.dll, and MSVC 5 will give linker errors -#include "wx/recguard.h" - -#include "wx/msw/private.h" - -// ============================================================================ -// wxConsoleAppTraits implementation -// ============================================================================ - -void wxConsoleAppTraits::AlwaysYield() -{ - // we need to use special logic to deal with WM_PAINT: as this pseudo - // message is generated automatically as long as there are invalidated - // windows belonging to this thread, we'd never return if we waited here - // until we have no more of them left. OTOH, this message is always the - // last one in the queue, so we can safely return as soon as we detect it - MSG msg; - while ( ::PeekMessage(&msg, NULL, 0, 0, PM_REMOVE) ) - { - if ( msg.message == WM_PAINT ) - break; - } -} - -void *wxConsoleAppTraits::BeforeChildWaitLoop() -{ - // nothing to do here - return NULL; -} - -void wxConsoleAppTraits::AfterChildWaitLoop(void * WXUNUSED(data)) -{ - // nothing to do here -} - -bool wxConsoleAppTraits::DoMessageFromThreadWait() -{ - // nothing to process here - return true; -} - diff --git a/wxWidgets/src/msw/bitmap.cpp b/wxWidgets/src/msw/bitmap.cpp deleted file mode 100644 index 8a878f4d63..0000000000 --- a/wxWidgets/src/msw/bitmap.cpp +++ /dev/null @@ -1,1809 +0,0 @@ -//////////////////////////////////////////////////////////////////////////// -// Name: src/msw/bitmap.cpp -// Purpose: wxBitmap -// Author: Julian Smart -// Modified by: -// Created: 04/01/98 -// RCS-ID: $Id: bitmap.cpp 56488 2008-10-22 17:01:02Z RR $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#include "wx/bitmap.h" - -#ifndef WX_PRECOMP - #include - - #include "wx/list.h" - #include "wx/utils.h" - #include "wx/app.h" - #include "wx/palette.h" - #include "wx/dcmemory.h" - #include "wx/icon.h" - #include "wx/log.h" - #include "wx/image.h" -#endif - -#include "wx/msw/private.h" - -#if wxUSE_WXDIB - #include "wx/msw/dib.h" -#endif - -#ifdef wxHAVE_RAW_BITMAP - #include "wx/rawbmp.h" -#endif - -// missing from mingw32 header -#ifndef CLR_INVALID - #define CLR_INVALID ((COLORREF)-1) -#endif // no CLR_INVALID - -// ---------------------------------------------------------------------------- -// Bitmap data -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxBitmapRefData : public wxGDIImageRefData -{ -public: - wxBitmapRefData(); - wxBitmapRefData(const wxBitmapRefData& data); - virtual ~wxBitmapRefData() { Free(); } - - virtual void Free(); - - // set the mask object to use as the mask, we take ownership of it - void SetMask(wxMask *mask) - { - delete m_bitmapMask; - m_bitmapMask = mask; - } - - // set the HBITMAP to use as the mask - void SetMask(HBITMAP hbmpMask) - { - SetMask(new wxMask((WXHBITMAP)hbmpMask)); - } - - // return the mask - wxMask *GetMask() const { return m_bitmapMask; } - -public: -#if wxUSE_PALETTE - wxPalette m_bitmapPalette; -#endif // wxUSE_PALETTE - - // MSW-specific - // ------------ - -#ifdef __WXDEBUG__ - // this field is solely for error checking: we detect selecting a bitmap - // into more than one DC at once or deleting a bitmap still selected into a - // DC (both are serious programming errors under Windows) - wxDC *m_selectedInto; -#endif // __WXDEBUG__ - -#if wxUSE_WXDIB - // when GetRawData() is called for a DDB we need to convert it to a DIB - // first to be able to provide direct access to it and we cache that DIB - // here and convert it back to DDB when UngetRawData() is called - wxDIB *m_dib; -#endif - - // true if we have alpha transparency info and can be drawn using - // AlphaBlend() - bool m_hasAlpha; - - // true if our HBITMAP is a DIB section, false if it is a DDB - bool m_isDIB; - -private: - // optional mask for transparent drawing - wxMask *m_bitmapMask; - - - // not implemented - wxBitmapRefData& operator=(const wxBitmapRefData&); -}; - -// ---------------------------------------------------------------------------- -// macros -// ---------------------------------------------------------------------------- - -IMPLEMENT_DYNAMIC_CLASS(wxBitmap, wxGDIObject) -IMPLEMENT_DYNAMIC_CLASS(wxMask, wxObject) - -IMPLEMENT_DYNAMIC_CLASS(wxBitmapHandler, wxObject) - -// ============================================================================ -// implementation -// ============================================================================ - -// ---------------------------------------------------------------------------- -// helper functions -// ---------------------------------------------------------------------------- - -// decide whether we should create a DIB or a DDB for the given parameters -// -// NB: we always use DIBs under Windows CE as this is much simpler (even if -// also less efficient...) and we obviously can't use them if there is no -// DIB support compiled in at all -#ifdef __WXWINCE__ - static inline bool wxShouldCreateDIB(int, int, int, WXHDC) { return true; } - - #define ALWAYS_USE_DIB -#elif !wxUSE_WXDIB - // no sense in defining wxShouldCreateDIB() as we can't compile code - // executed if it is true, so we have to use #if's anyhow - #define NEVER_USE_DIB -#else // wxUSE_WXDIB && !__WXWINCE__ - static inline bool wxShouldCreateDIB(int w, int h, int d, WXHDC hdc) - { - // here is the logic: - // - // (a) if hdc is specified, the caller explicitly wants DDB - // (b) otherwise, create a DIB if depth >= 24 (we don't support 16bpp - // or less DIBs anyhow) - // (c) finally, create DIBs under Win9x even if the depth hasn't been - // explicitly specified but the current display depth is 24 or - // more and the image is "big", i.e. > 16Mb which is the - // theoretical limit for DDBs under Win9x - // - // consequences (all of which seem to make sense): - // - // (i) by default, DDBs are created (depth == -1 usually) - // (ii) DIBs can be created by explicitly specifying the depth - // (iii) using a DC always forces creating a DDB - return !hdc && - (d >= 24 || - (d == -1 && - wxDIB::GetLineSize(w, wxDisplayDepth())*h > 16*1024*1024)); - } - - #define SOMETIMES_USE_DIB -#endif // different DIB usage scenarious - -// ---------------------------------------------------------------------------- -// wxBitmapRefData -// ---------------------------------------------------------------------------- - -wxBitmapRefData::wxBitmapRefData() -{ -#ifdef __WXDEBUG__ - m_selectedInto = NULL; -#endif - m_bitmapMask = NULL; - - m_hBitmap = (WXHBITMAP) NULL; -#if wxUSE_WXDIB - m_dib = NULL; -#endif - - m_isDIB = - m_hasAlpha = false; -} - -wxBitmapRefData::wxBitmapRefData(const wxBitmapRefData& data) - : wxGDIImageRefData(data) -{ -#ifdef __WXDEBUG__ - m_selectedInto = NULL; -#endif - - // (deep) copy the mask if present - m_bitmapMask = NULL; - if (data.m_bitmapMask) - m_bitmapMask = new wxMask(*data.m_bitmapMask); - - // FIXME: we don't copy m_hBitmap currently but we should, see wxBitmap:: - // CloneRefData() - - wxASSERT_MSG( !data.m_isDIB, - _T("can't copy bitmap locked for raw access!") ); - m_isDIB = false; - - m_hasAlpha = data.m_hasAlpha; -} - -void wxBitmapRefData::Free() -{ - wxASSERT_MSG( !m_selectedInto, - wxT("deleting bitmap still selected into wxMemoryDC") ); - -#if wxUSE_WXDIB - wxASSERT_MSG( !m_dib, _T("forgot to call wxBitmap::UngetRawData()!") ); -#endif - - if ( m_hBitmap) - { - if ( !::DeleteObject((HBITMAP)m_hBitmap) ) - { - wxLogLastError(wxT("DeleteObject(hbitmap)")); - } - } - - delete m_bitmapMask; - m_bitmapMask = NULL; -} - -// ---------------------------------------------------------------------------- -// wxBitmap creation -// ---------------------------------------------------------------------------- - -wxGDIImageRefData *wxBitmap::CreateData() const -{ - return new wxBitmapRefData; -} - -wxObjectRefData *wxBitmap::CloneRefData(const wxObjectRefData *dataOrig) const -{ - const wxBitmapRefData * - data = wx_static_cast(const wxBitmapRefData *, dataOrig); - if ( !data ) - return NULL; - - // FIXME: this method is backwards, it should just create a new - // wxBitmapRefData using its copy ctor but instead it modifies this - // bitmap itself and then returns its m_refData -- which works, of - // course (except in !wxUSE_WXDIB), but is completely illogical - wxBitmap *self = wx_const_cast(wxBitmap *, this); - - wxBitmapRefData *selfdata; -#if wxUSE_WXDIB - // copy the other bitmap - if ( data->m_hBitmap ) - { - wxDIB dib((HBITMAP)(data->m_hBitmap)); - self->CopyFromDIB(dib); - - selfdata = wx_static_cast(wxBitmapRefData *, m_refData); - selfdata->m_hasAlpha = data->m_hasAlpha; - } - else -#endif // wxUSE_WXDIB - { - // copy the bitmap data - selfdata = new wxBitmapRefData(*data); - self->m_refData = selfdata; - } - - // copy also the mask - wxMask * const maskSrc = data->GetMask(); - if ( maskSrc ) - { - selfdata->SetMask(new wxMask(*maskSrc)); - } - - return selfdata; -} - -#ifdef __WIN32__ - -bool wxBitmap::CopyFromIconOrCursor(const wxGDIImage& icon) -{ -#if !defined(__WXMICROWIN__) && !defined(__WXWINCE__) - // it may be either HICON or HCURSOR - HICON hicon = (HICON)icon.GetHandle(); - - ICONINFO iconInfo; - if ( !::GetIconInfo(hicon, &iconInfo) ) - { - wxLogLastError(wxT("GetIconInfo")); - - return false; - } - - wxBitmapRefData *refData = new wxBitmapRefData; - m_refData = refData; - - int w = icon.GetWidth(), - h = icon.GetHeight(); - - refData->m_width = w; - refData->m_height = h; - refData->m_depth = wxDisplayDepth(); - - refData->m_hBitmap = (WXHBITMAP)iconInfo.hbmColor; - -#if wxUSE_WXDIB - // If the icon is 32 bits per pixel then it may have alpha channel data, - // although there are some icons that are 32 bpp but have no alpha... So - // convert to a DIB and manually check the 4th byte for each pixel. - BITMAP bm; - if ( ::GetObject(iconInfo.hbmColor, sizeof(BITMAP), (LPVOID)&bm) - && bm.bmBitsPixel == 32) - { - wxDIB dib(iconInfo.hbmColor); - if (dib.IsOk()) - { - unsigned char* pixels = dib.GetData(); - for (int idx=0; idxm_hasAlpha = true; - break; - } - } - } - } -#endif - if ( !refData->m_hasAlpha ) - { - // the mask returned by GetIconInfo() is inverted compared to the usual - // wxWin convention - refData->SetMask(wxInvertMask(iconInfo.hbmMask, w, h)); - } - - // delete the old one now as we don't need it any more - ::DeleteObject(iconInfo.hbmMask); - - return true; -#else - wxUnusedVar(icon); - return false; -#endif -} - -#endif // Win32 - -bool wxBitmap::CopyFromCursor(const wxCursor& cursor) -{ - UnRef(); - - if ( !cursor.Ok() ) - return false; - - return CopyFromIconOrCursor(cursor); -} - -bool wxBitmap::CopyFromIcon(const wxIcon& icon) -{ - UnRef(); - - if ( !icon.Ok() ) - return false; - - return CopyFromIconOrCursor(icon); -} - -#ifndef NEVER_USE_DIB - -bool wxBitmap::CopyFromDIB(const wxDIB& dib) -{ - wxCHECK_MSG( dib.IsOk(), false, _T("invalid DIB in CopyFromDIB") ); - -#ifdef SOMETIMES_USE_DIB - HBITMAP hbitmap = dib.CreateDDB(); - if ( !hbitmap ) - return false; -#else // ALWAYS_USE_DIB - HBITMAP hbitmap = ((wxDIB &)dib).Detach(); // const_cast -#endif // SOMETIMES_USE_DIB/ALWAYS_USE_DIB - - UnRef(); - - wxBitmapRefData *refData = new wxBitmapRefData; - m_refData = refData; - - refData->m_width = dib.GetWidth(); - refData->m_height = dib.GetHeight(); - refData->m_depth = dib.GetDepth(); - - refData->m_hBitmap = (WXHBITMAP)hbitmap; - -#if wxUSE_PALETTE - wxPalette *palette = dib.CreatePalette(); - if ( palette ) - { - refData->m_bitmapPalette = *palette; - } - - delete palette; -#endif // wxUSE_PALETTE - - return true; -} - -#endif // NEVER_USE_DIB - -wxBitmap::~wxBitmap() -{ -} - -wxBitmap::wxBitmap(const char bits[], int width, int height, int depth) -{ -#ifndef __WXMICROWIN__ - wxBitmapRefData *refData = new wxBitmapRefData; - m_refData = refData; - - refData->m_width = width; - refData->m_height = height; - refData->m_depth = depth; - - char *data; - if ( depth == 1 ) - { - // we assume that it is in XBM format which is not quite the same as - // the format CreateBitmap() wants because the order of bytes in the - // line is reversed! - const size_t bytesPerLine = (width + 7) / 8; - const size_t padding = bytesPerLine % 2; - const size_t len = height * ( padding + bytesPerLine ); - data = (char *)malloc(len); - const char *src = bits; - char *dst = data; - - for ( int rows = 0; rows < height; rows++ ) - { - for ( size_t cols = 0; cols < bytesPerLine; cols++ ) - { - unsigned char val = *src++; - unsigned char reversed = 0; - - for ( int bits = 0; bits < 8; bits++) - { - reversed <<= 1; - reversed |= (unsigned char)(val & 0x01); - val >>= 1; - } - *dst++ = ~reversed; - } - - if ( padding ) - *dst++ = 0; - } - } - else - { - // bits should already be in Windows standard format - data = (char *)bits; // const_cast is harmless - } - - HBITMAP hbmp = ::CreateBitmap(width, height, 1, depth, data); - if ( !hbmp ) - { - wxLogLastError(wxT("CreateBitmap")); - } - - if ( data != bits ) - { - free(data); - } - - SetHBITMAP((WXHBITMAP)hbmp); -#endif -} - -wxBitmap::wxBitmap(int w, int h, int d) -{ - (void)Create(w, h, d); -} - -wxBitmap::wxBitmap(int w, int h, const wxDC& dc) -{ - (void)Create(w, h, dc); -} - -wxBitmap::wxBitmap(const void* data, long type, int width, int height, int depth) -{ - (void)Create(data, type, width, height, depth); -} - -wxBitmap::wxBitmap(const wxString& filename, wxBitmapType type) -{ - LoadFile(filename, (int)type); -} - -bool wxBitmap::Create(int width, int height, int depth) -{ - return DoCreate(width, height, depth, 0); -} - -bool wxBitmap::Create(int width, int height, const wxDC& dc) -{ - wxCHECK_MSG( dc.Ok(), false, _T("invalid HDC in wxBitmap::Create()") ); - - return DoCreate(width, height, -1, dc.GetHDC()); -} - -bool wxBitmap::DoCreate(int w, int h, int d, WXHDC hdc) -{ - UnRef(); - - m_refData = new wxBitmapRefData; - - GetBitmapData()->m_width = w; - GetBitmapData()->m_height = h; - - HBITMAP hbmp wxDUMMY_INITIALIZE(0); - -#ifndef NEVER_USE_DIB - if ( wxShouldCreateDIB(w, h, d, hdc) ) - { - if ( d == -1 ) - { - // create DIBs without alpha channel by default - d = 24; - } - - wxDIB dib(w, h, d); - if ( !dib.IsOk() ) - return false; - - // don't delete the DIB section in dib object dtor - hbmp = dib.Detach(); - - GetBitmapData()->m_isDIB = true; - GetBitmapData()->m_depth = d; - } - else // create a DDB -#endif // NEVER_USE_DIB - { -#ifndef ALWAYS_USE_DIB -#ifndef __WXMICROWIN__ - if ( d > 0 ) - { - hbmp = ::CreateBitmap(w, h, 1, d, NULL); - if ( !hbmp ) - { - wxLogLastError(wxT("CreateBitmap")); - } - - GetBitmapData()->m_depth = d; - } - else // d == 0, create bitmap compatible with the screen -#endif // !__WXMICROWIN__ - { - ScreenHDC dc; - hbmp = ::CreateCompatibleBitmap(dc, w, h); - if ( !hbmp ) - { - wxLogLastError(wxT("CreateCompatibleBitmap")); - } - - GetBitmapData()->m_depth = wxDisplayDepth(); - } -#endif // !ALWAYS_USE_DIB - } - - SetHBITMAP((WXHBITMAP)hbmp); - - return Ok(); -} - -#if wxUSE_IMAGE - -// ---------------------------------------------------------------------------- -// wxImage to/from conversions for Microwin -// ---------------------------------------------------------------------------- - -// Microwin versions are so different from normal ones that it really doesn't -// make sense to use #ifdefs inside the function bodies -#ifdef __WXMICROWIN__ - -bool wxBitmap::CreateFromImage(const wxImage& image, int depth, const wxDC& dc) -{ - // Set this to 1 to experiment with mask code, - // which currently doesn't work - #define USE_MASKS 0 - - m_refData = new wxBitmapRefData(); - - // Initial attempt at a simple-minded implementation. - // The bitmap will always be created at the screen depth, - // so the 'depth' argument is ignored. - - HDC hScreenDC = ::GetDC(NULL); - int screenDepth = ::GetDeviceCaps(hScreenDC, BITSPIXEL); - - HBITMAP hBitmap = ::CreateCompatibleBitmap(hScreenDC, image.GetWidth(), image.GetHeight()); - HBITMAP hMaskBitmap = NULL; - HBITMAP hOldMaskBitmap = NULL; - HDC hMaskDC = NULL; - unsigned char maskR = 0; - unsigned char maskG = 0; - unsigned char maskB = 0; - - // printf("Created bitmap %d\n", (int) hBitmap); - if (hBitmap == NULL) - { - ::ReleaseDC(NULL, hScreenDC); - return false; - } - HDC hMemDC = ::CreateCompatibleDC(hScreenDC); - - HBITMAP hOldBitmap = ::SelectObject(hMemDC, hBitmap); - ::ReleaseDC(NULL, hScreenDC); - - // created an mono-bitmap for the possible mask - bool hasMask = image.HasMask(); - - if ( hasMask ) - { -#if USE_MASKS - // FIXME: we should be able to pass bpp = 1, but - // GdBlit can't handle a different depth -#if 0 - hMaskBitmap = ::CreateBitmap( (WORD)image.GetWidth(), (WORD)image.GetHeight(), 1, 1, NULL ); -#else - hMaskBitmap = ::CreateCompatibleBitmap( hMemDC, (WORD)image.GetWidth(), (WORD)image.GetHeight()); -#endif - maskR = image.GetMaskRed(); - maskG = image.GetMaskGreen(); - maskB = image.GetMaskBlue(); - - if (!hMaskBitmap) - { - hasMask = false; - } - else - { - hScreenDC = ::GetDC(NULL); - hMaskDC = ::CreateCompatibleDC(hScreenDC); - ::ReleaseDC(NULL, hScreenDC); - - hOldMaskBitmap = ::SelectObject( hMaskDC, hMaskBitmap); - } -#else - hasMask = false; -#endif - } - - int i, j; - for (i = 0; i < image.GetWidth(); i++) - { - for (j = 0; j < image.GetHeight(); j++) - { - unsigned char red = image.GetRed(i, j); - unsigned char green = image.GetGreen(i, j); - unsigned char blue = image.GetBlue(i, j); - - ::SetPixel(hMemDC, i, j, PALETTERGB(red, green, blue)); - - if (hasMask) - { - // scan the bitmap for the transparent colour and set the corresponding - // pixels in the mask to BLACK and the rest to WHITE - if (maskR == red && maskG == green && maskB == blue) - ::SetPixel(hMaskDC, i, j, PALETTERGB(0, 0, 0)); - else - ::SetPixel(hMaskDC, i, j, PALETTERGB(255, 255, 255)); - } - } - } - - ::SelectObject(hMemDC, hOldBitmap); - ::DeleteDC(hMemDC); - if (hasMask) - { - ::SelectObject(hMaskDC, hOldMaskBitmap); - ::DeleteDC(hMaskDC); - - ((wxBitmapRefData*)m_refData)->SetMask(hMaskBitmap); - } - - SetWidth(image.GetWidth()); - SetHeight(image.GetHeight()); - SetDepth(screenDepth); - SetHBITMAP( (WXHBITMAP) hBitmap ); - -#if wxUSE_PALETTE - // Copy the palette from the source image - SetPalette(image.GetPalette()); -#endif // wxUSE_PALETTE - - return true; -} - -wxImage wxBitmap::ConvertToImage() const -{ - // Initial attempt at a simple-minded implementation. - // The bitmap will always be created at the screen depth, - // so the 'depth' argument is ignored. - // TODO: transparency (create a mask image) - - if (!Ok()) - { - wxFAIL_MSG( wxT("bitmap is invalid") ); - return wxNullImage; - } - - 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(); - if( !data ) - { - wxFAIL_MSG( wxT("could not allocate data for image") ); - return wxNullImage; - } - - HDC hScreenDC = ::GetDC(NULL); - - HDC hMemDC = ::CreateCompatibleDC(hScreenDC); - ::ReleaseDC(NULL, hScreenDC); - - HBITMAP hBitmap = (HBITMAP) GetHBITMAP(); - - HBITMAP hOldBitmap = ::SelectObject(hMemDC, hBitmap); - - int i, j; - for (i = 0; i < GetWidth(); i++) - { - for (j = 0; j < GetHeight(); j++) - { - COLORREF color = ::GetPixel(hMemDC, i, j); - unsigned char red = GetRValue(color); - unsigned char green = GetGValue(color); - unsigned char blue = GetBValue(color); - - image.SetRGB(i, j, red, green, blue); - } - } - - ::SelectObject(hMemDC, hOldBitmap); - ::DeleteDC(hMemDC); - -#if wxUSE_PALETTE - // Copy the palette from the source image - if (GetPalette()) - image.SetPalette(* GetPalette()); -#endif // wxUSE_PALETTE - - return image; -} - -#endif // __WXMICROWIN__ - -// ---------------------------------------------------------------------------- -// wxImage to/from conversions -// ---------------------------------------------------------------------------- - -bool wxBitmap::CreateFromImage(const wxImage& image, int depth) -{ - return CreateFromImage(image, depth, 0); -} - -bool wxBitmap::CreateFromImage(const wxImage& image, const wxDC& dc) -{ - wxCHECK_MSG( dc.Ok(), false, - _T("invalid HDC in wxBitmap::CreateFromImage()") ); - - return CreateFromImage(image, -1, dc.GetHDC()); -} - -#if wxUSE_WXDIB - -bool wxBitmap::CreateFromImage(const wxImage& image, int depth, WXHDC hdc) -{ - wxCHECK_MSG( image.Ok(), false, wxT("invalid image") ); - - UnRef(); - - // first convert the image to DIB - const int h = image.GetHeight(); - const int w = image.GetWidth(); - - wxDIB dib(image); - if ( !dib.IsOk() ) - return false; - - const bool hasAlpha = image.HasAlpha(); - - if (depth == -1) - depth = dib.GetDepth(); - - // store the bitmap parameters - wxBitmapRefData * const refData = new wxBitmapRefData; - refData->m_width = w; - refData->m_height = h; - refData->m_hasAlpha = hasAlpha; - refData->m_depth = depth; - - m_refData = refData; - - - // next either store DIB as is or create a DDB from it - HBITMAP hbitmap wxDUMMY_INITIALIZE(0); - - // are we going to use DIB? - // - // NB: DDBs don't support alpha so if we have alpha channel we must use DIB - if ( hasAlpha || wxShouldCreateDIB(w, h, depth, hdc) ) - { - // don't delete the DIB section in dib object dtor - hbitmap = dib.Detach(); - - refData->m_isDIB = true; - } -#ifndef ALWAYS_USE_DIB - else // we need to convert DIB to DDB - { - hbitmap = dib.CreateDDB((HDC)hdc); - } -#endif // !ALWAYS_USE_DIB - - // validate this object - SetHBITMAP((WXHBITMAP)hbitmap); - - // finally also set the mask if we have one - if ( image.HasMask() ) - { - const size_t len = 2*((w+15)/16); - BYTE *src = image.GetData(); - BYTE *data = new BYTE[h*len]; - memset(data, 0, h*len); - BYTE r = image.GetMaskRed(), - g = image.GetMaskGreen(), - b = image.GetMaskBlue(); - BYTE *dst = data; - for ( int y = 0; y < h; y++, dst += len ) - { - BYTE *dstLine = dst; - BYTE mask = 0x80; - for ( int x = 0; x < w; x++, src += 3 ) - { - if (src[0] != r || src[1] != g || src[2] != b) - *dstLine |= mask; - - if ( (mask >>= 1) == 0 ) - { - dstLine++; - mask = 0x80; - } - } - } - - hbitmap = ::CreateBitmap(w, h, 1, 1, data); - if ( !hbitmap ) - { - wxLogLastError(_T("CreateBitmap(mask)")); - } - else - { - SetMask(new wxMask((WXHBITMAP)hbitmap)); - } - - delete[] data; - } - - return true; -} - -wxImage wxBitmap::ConvertToImage() const -{ - // convert DDB to DIB - wxDIB dib(*this); - - if ( !dib.IsOk() ) - { - return wxNullImage; - } - - // and then DIB to our wxImage - wxImage image = dib.ConvertToImage(); - if ( !image.Ok() ) - { - return wxNullImage; - } - - // now do the same for the mask, if we have any - HBITMAP hbmpMask = GetMask() ? (HBITMAP) GetMask()->GetMaskBitmap() : NULL; - if ( hbmpMask ) - { - wxDIB dibMask(hbmpMask); - if ( dibMask.IsOk() ) - { - // TODO: use wxRawBitmap to iterate over DIB - - // we hard code the mask colour for now but we could also make an - // effort (and waste time) to choose a colour not present in the - // image already to avoid having to fudge the pixels below -- - // whether it's worth to do it is unclear however - static const int MASK_RED = 1; - static const int MASK_GREEN = 2; - static const int MASK_BLUE = 3; - static const int MASK_BLUE_REPLACEMENT = 2; - - const int h = dibMask.GetHeight(); - const int w = dibMask.GetWidth(); - const int bpp = dibMask.GetDepth(); - const int maskBytesPerPixel = bpp >> 3; - const int maskBytesPerLine = wxDIB::GetLineSize(w, bpp); - unsigned char *data = image.GetData(); - - // remember that DIBs are stored in bottom to top order - unsigned char * - maskLineStart = dibMask.GetData() + ((h - 1) * maskBytesPerLine); - - for ( int y = 0; y < h; y++, maskLineStart -= maskBytesPerLine ) - { - // traverse one mask DIB line - unsigned char *mask = maskLineStart; - for ( int x = 0; x < w; x++, mask += maskBytesPerPixel ) - { - // should this pixel be transparent? - if ( *mask ) - { - // no, check that it isn't transparent by accident - if ( (data[0] == MASK_RED) && - (data[1] == MASK_GREEN) && - (data[2] == MASK_BLUE) ) - { - // we have to fudge the colour a bit to prevent - // this pixel from appearing transparent - data[2] = MASK_BLUE_REPLACEMENT; - } - - data += 3; - } - else // yes, transparent pixel - { - *data++ = MASK_RED; - *data++ = MASK_GREEN; - *data++ = MASK_BLUE; - } - } - } - - image.SetMaskColour(MASK_RED, MASK_GREEN, MASK_BLUE); - } - } - - return image; -} - -#else // !wxUSE_WXDIB - -bool -wxBitmap::CreateFromImage(const wxImage& WXUNUSED(image), - int WXUNUSED(depth), - WXHDC WXUNUSED(hdc)) -{ - return false; -} - -wxImage wxBitmap::ConvertToImage() const -{ - return wxImage(); -} - -#endif // wxUSE_WXDIB/!wxUSE_WXDIB - -#endif // wxUSE_IMAGE - -// ---------------------------------------------------------------------------- -// loading and saving bitmaps -// ---------------------------------------------------------------------------- - -bool wxBitmap::LoadFile(const wxString& filename, long type) -{ - UnRef(); - - wxBitmapHandler *handler = wxDynamicCast(FindHandler(type), wxBitmapHandler); - - if ( handler ) - { - m_refData = new wxBitmapRefData; - - return handler->LoadFile(this, filename, type, -1, -1); - } -#if wxUSE_IMAGE && wxUSE_WXDIB - else // no bitmap handler found - { - wxImage image; - if ( image.LoadFile( filename, type ) && image.Ok() ) - { - *this = wxBitmap(image); - - return true; - } - } -#endif // wxUSE_IMAGE - - return false; -} - -bool wxBitmap::Create(const void* data, long type, int width, int height, int depth) -{ - UnRef(); - - wxBitmapHandler *handler = wxDynamicCast(FindHandler(type), wxBitmapHandler); - - if ( !handler ) - { - wxLogDebug(wxT("Failed to create bitmap: no bitmap handler for type %ld defined."), type); - - return false; - } - - m_refData = new wxBitmapRefData; - - return handler->Create(this, data, type, width, height, depth); -} - -bool wxBitmap::SaveFile(const wxString& filename, - int type, - const wxPalette *palette) -{ - wxBitmapHandler *handler = wxDynamicCast(FindHandler(type), wxBitmapHandler); - - if ( handler ) - { - return handler->SaveFile(this, filename, type, palette); - } -#if wxUSE_IMAGE && wxUSE_WXDIB - else // no bitmap handler found - { - // FIXME what about palette? shouldn't we use it? - wxImage image = ConvertToImage(); - if ( image.Ok() ) - { - return image.SaveFile(filename, type); - } - } -#endif // wxUSE_IMAGE - - return false; -} - -// ---------------------------------------------------------------------------- -// sub bitmap extraction -// ---------------------------------------------------------------------------- -wxBitmap wxBitmap::GetSubBitmap( const wxRect& rect ) const -{ - MemoryHDC dcSrc; - SelectInHDC selectSrc(dcSrc, GetHbitmap()); - return GetSubBitmapOfHDC( rect, (WXHDC)dcSrc ); -} - -wxBitmap wxBitmap::GetSubBitmapOfHDC( const wxRect& rect, WXHDC hdc ) 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") ); - -#ifndef __WXMICROWIN__ - // handle alpha channel, if any - if (HasAlpha()) - ret.UseAlpha(); - - // copy bitmap data - MemoryHDC dcSrc, - dcDst; - - { - SelectInHDC selectDst(dcDst, GetHbitmapOf(ret)); - - if ( !selectDst ) - { - wxLogLastError(_T("SelectObject(destBitmap)")); - } - - if ( !::BitBlt(dcDst, 0, 0, rect.width, rect.height, - (HDC)hdc, rect.x, rect.y, SRCCOPY) ) - { - wxLogLastError(_T("BitBlt")); - } - } - - // copy mask if there is one - if ( GetMask() ) - { - HBITMAP hbmpMask = ::CreateBitmap(rect.width, rect.height, 1, 1, 0); - - SelectInHDC selectSrc(dcSrc, (HBITMAP) GetMask()->GetMaskBitmap()), - selectDst(dcDst, hbmpMask); - - if ( !::BitBlt(dcDst, 0, 0, rect.width, rect.height, - dcSrc, rect.x, rect.y, SRCCOPY) ) - { - wxLogLastError(_T("BitBlt")); - } - - wxMask *mask = new wxMask((WXHBITMAP) hbmpMask); - ret.SetMask(mask); - } -#endif // !__WXMICROWIN__ - - return ret; -} - -// ---------------------------------------------------------------------------- -// wxBitmap accessors -// ---------------------------------------------------------------------------- - -#if wxUSE_PALETTE -wxPalette* wxBitmap::GetPalette() const -{ - return GetBitmapData() ? &GetBitmapData()->m_bitmapPalette - : (wxPalette *) NULL; -} -#endif - -wxMask *wxBitmap::GetMask() const -{ - return GetBitmapData() ? GetBitmapData()->GetMask() : (wxMask *) NULL; -} - -wxBitmap wxBitmap::GetMaskBitmap() const -{ - wxBitmap bmp; - wxMask *mask = GetMask(); - if ( mask ) - bmp.SetHBITMAP(mask->GetMaskBitmap()); - return bmp; -} - -#ifdef __WXDEBUG__ - -wxDC *wxBitmap::GetSelectedInto() const -{ - return GetBitmapData() ? GetBitmapData()->m_selectedInto : (wxDC *) NULL; -} - -#endif - -#if WXWIN_COMPATIBILITY_2_4 - -int wxBitmap::GetQuality() const -{ - return 0; -} - -#endif // WXWIN_COMPATIBILITY_2_4 - -void wxBitmap::UseAlpha() -{ - if ( GetBitmapData() ) - GetBitmapData()->m_hasAlpha = true; -} - -bool wxBitmap::HasAlpha() const -{ - return GetBitmapData() && GetBitmapData()->m_hasAlpha; -} - -// ---------------------------------------------------------------------------- -// wxBitmap setters -// ---------------------------------------------------------------------------- - -#ifdef __WXDEBUG__ - -void wxBitmap::SetSelectedInto(wxDC *dc) -{ - if ( GetBitmapData() ) - GetBitmapData()->m_selectedInto = dc; -} - -#endif - -#if wxUSE_PALETTE - -void wxBitmap::SetPalette(const wxPalette& palette) -{ - AllocExclusive(); - - GetBitmapData()->m_bitmapPalette = palette; -} - -#endif // wxUSE_PALETTE - -void wxBitmap::SetMask(wxMask *mask) -{ - AllocExclusive(); - - GetBitmapData()->SetMask(mask); -} - -#if WXWIN_COMPATIBILITY_2_4 - -void wxBitmap::SetQuality(int WXUNUSED(quality)) -{ -} - -#endif // WXWIN_COMPATIBILITY_2_4 - -// ---------------------------------------------------------------------------- -// raw bitmap access support -// ---------------------------------------------------------------------------- - -#ifdef wxHAVE_RAW_BITMAP -void *wxBitmap::GetRawData(wxPixelDataBase& data, int bpp) -{ -#if wxUSE_WXDIB - if ( !Ok() ) - { - // no bitmap, no data (raw or otherwise) - return NULL; - } - - // if we're already a DIB we can access our data directly, but if not we - // need to convert this DDB to a DIB section and use it for raw access and - // then convert it back - HBITMAP hDIB; - if ( !GetBitmapData()->m_isDIB ) - { - wxCHECK_MSG( !GetBitmapData()->m_dib, NULL, - _T("GetRawData() may be called only once") ); - - wxDIB *dib = new wxDIB(*this); - if ( !dib->IsOk() ) - { - delete dib; - - return NULL; - } - - // we'll free it in UngetRawData() - GetBitmapData()->m_dib = dib; - - hDIB = dib->GetHandle(); - } - else // we're a DIB - { - hDIB = GetHbitmap(); - } - - DIBSECTION ds; - if ( ::GetObject(hDIB, sizeof(ds), &ds) != sizeof(DIBSECTION) ) - { - wxFAIL_MSG( _T("failed to get DIBSECTION from a DIB?") ); - - return NULL; - } - - // check that the bitmap is in correct format - if ( ds.dsBm.bmBitsPixel != bpp ) - { - wxFAIL_MSG( _T("incorrect bitmap type in wxBitmap::GetRawData()") ); - - return NULL; - } - - // ok, store the relevant info in wxPixelDataBase - const LONG h = ds.dsBm.bmHeight; - - data.m_width = ds.dsBm.bmWidth; - data.m_height = h; - - // remember that DIBs are stored in top to bottom order! - // (We can't just use ds.dsBm.bmWidthBytes here, because it isn't always a - // multiple of 2, as required by the documentation. So we use the official - // formula, which we already use elsewhere.) - const LONG bytesPerRow = - wxDIB::GetLineSize(ds.dsBm.bmWidth, ds.dsBm.bmBitsPixel); - data.m_stride = -bytesPerRow; - - char *bits = (char *)ds.dsBm.bmBits; - if ( h > 1 ) - { - bits += (h - 1)*bytesPerRow; - } - - return bits; -#else - return NULL; -#endif -} - -void wxBitmap::UngetRawData(wxPixelDataBase& dataBase) -{ -#if wxUSE_WXDIB - if ( !Ok() ) - return; - - if ( !&dataBase ) - { - // invalid data, don't crash -- but don't assert neither as we're - // called automatically from wxPixelDataBase dtor and so there is no - // way to prevent this from happening - return; - } - - // if we're a DDB we need to convert DIB back to DDB now to make the - // changes made via raw bitmap access effective - if ( !GetBitmapData()->m_isDIB ) - { - wxDIB *dib = GetBitmapData()->m_dib; - GetBitmapData()->m_dib = NULL; - - // TODO: convert - - delete dib; - } -#endif // wxUSE_WXDIB -} -#endif // #ifdef wxHAVE_RAW_BITMAP - -// ---------------------------------------------------------------------------- -// wxMask -// ---------------------------------------------------------------------------- - -wxMask::wxMask() -{ - m_maskBitmap = 0; -} - -// Copy constructor -wxMask::wxMask(const wxMask &mask) - : wxObject() -{ - BITMAP bmp; - - HDC srcDC = CreateCompatibleDC(0); - HDC destDC = CreateCompatibleDC(0); - - // GetBitmapDimensionEx won't work if SetBitmapDimensionEx wasn't used - // so we'll use GetObject() API here: - if (::GetObject((HGDIOBJ)mask.m_maskBitmap, sizeof(bmp), &bmp) == 0) - { - wxFAIL_MSG(wxT("Cannot retrieve the dimensions of the wxMask to copy")); - return; - } - - // create our HBITMAP - int w = bmp.bmWidth, h = bmp.bmHeight; - m_maskBitmap = (WXHBITMAP)CreateCompatibleBitmap(srcDC, w, h); - - // copy the mask's HBITMAP into our HBITMAP - SelectObject(srcDC, (HBITMAP) mask.m_maskBitmap); - SelectObject(destDC, (HBITMAP) m_maskBitmap); - - BitBlt(destDC, 0, 0, w, h, srcDC, 0, 0, SRCCOPY); - - SelectObject(srcDC, 0); - DeleteDC(srcDC); - SelectObject(destDC, 0); - DeleteDC(destDC); -} - -// Construct a mask from a bitmap and a colour indicating -// the transparent area -wxMask::wxMask(const wxBitmap& bitmap, const wxColour& colour) -{ - m_maskBitmap = 0; - 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 = 0; - Create(bitmap, paletteIndex); -} - -// Construct a mask from a mono bitmap (copies the bitmap). -wxMask::wxMask(const wxBitmap& bitmap) -{ - m_maskBitmap = 0; - Create(bitmap); -} - -wxMask::~wxMask() -{ - if ( m_maskBitmap ) - ::DeleteObject((HBITMAP) m_maskBitmap); -} - -// Create a mask from a mono bitmap (copies the bitmap). -bool wxMask::Create(const wxBitmap& bitmap) -{ -#ifndef __WXMICROWIN__ - wxCHECK_MSG( bitmap.Ok() && bitmap.GetDepth() == 1, false, - _T("can't create mask from invalid or not monochrome bitmap") ); - - if ( m_maskBitmap ) - { - ::DeleteObject((HBITMAP) m_maskBitmap); - m_maskBitmap = 0; - } - - m_maskBitmap = (WXHBITMAP) CreateBitmap( - bitmap.GetWidth(), - bitmap.GetHeight(), - 1, 1, 0 - ); - HDC srcDC = CreateCompatibleDC(0); - SelectObject(srcDC, (HBITMAP) bitmap.GetHBITMAP()); - HDC destDC = CreateCompatibleDC(0); - SelectObject(destDC, (HBITMAP) m_maskBitmap); - BitBlt(destDC, 0, 0, bitmap.GetWidth(), bitmap.GetHeight(), srcDC, 0, 0, SRCCOPY); - SelectObject(srcDC, 0); - DeleteDC(srcDC); - SelectObject(destDC, 0); - DeleteDC(destDC); - return true; -#else - wxUnusedVar(bitmap); - return false; -#endif -} - -// Create a mask from a bitmap and a palette index indicating -// the transparent area -bool wxMask::Create(const wxBitmap& bitmap, int paletteIndex) -{ - if ( m_maskBitmap ) - { - ::DeleteObject((HBITMAP) m_maskBitmap); - m_maskBitmap = 0; - } - -#if wxUSE_PALETTE - if (bitmap.Ok() && bitmap.GetPalette()->Ok()) - { - unsigned char red, green, blue; - if (bitmap.GetPalette()->GetRGB(paletteIndex, &red, &green, &blue)) - { - wxColour transparentColour(red, green, blue); - return Create(bitmap, transparentColour); - } - } -#endif // wxUSE_PALETTE - - return false; -} - -// Create a mask from a bitmap and a colour indicating -// the transparent area -bool wxMask::Create(const wxBitmap& bitmap, const wxColour& colour) -{ -#ifndef __WXMICROWIN__ - wxCHECK_MSG( bitmap.Ok(), false, _T("invalid bitmap in wxMask::Create") ); - - if ( m_maskBitmap ) - { - ::DeleteObject((HBITMAP) m_maskBitmap); - m_maskBitmap = 0; - } - - int width = bitmap.GetWidth(), - height = bitmap.GetHeight(); - - // scan the bitmap for the transparent colour and set the corresponding - // pixels in the mask to BLACK and the rest to WHITE - COLORREF maskColour = wxColourToPalRGB(colour); - m_maskBitmap = (WXHBITMAP)::CreateBitmap(width, height, 1, 1, 0); - - HDC srcDC = ::CreateCompatibleDC(NULL); - HDC destDC = ::CreateCompatibleDC(NULL); - if ( !srcDC || !destDC ) - { - wxLogLastError(wxT("CreateCompatibleDC")); - } - - bool ok = true; - - // SelectObject() will fail - wxASSERT_MSG( !bitmap.GetSelectedInto(), - _T("bitmap can't be selected in another DC") ); - - HGDIOBJ hbmpSrcOld = ::SelectObject(srcDC, GetHbitmapOf(bitmap)); - if ( !hbmpSrcOld ) - { - wxLogLastError(wxT("SelectObject")); - - ok = false; - } - - HGDIOBJ hbmpDstOld = ::SelectObject(destDC, (HBITMAP)m_maskBitmap); - if ( !hbmpDstOld ) - { - wxLogLastError(wxT("SelectObject")); - - ok = false; - } - - if ( ok ) - { - // this will create a monochrome bitmap with 0 points for the pixels - // which have the same value as the background colour and 1 for the - // others - ::SetBkColor(srcDC, maskColour); - ::BitBlt(destDC, 0, 0, width, height, srcDC, 0, 0, NOTSRCCOPY); - } - - ::SelectObject(srcDC, hbmpSrcOld); - ::DeleteDC(srcDC); - ::SelectObject(destDC, hbmpDstOld); - ::DeleteDC(destDC); - - return ok; -#else // __WXMICROWIN__ - wxUnusedVar(bitmap); - wxUnusedVar(colour); - return false; -#endif // __WXMICROWIN__/!__WXMICROWIN__ -} - -// ---------------------------------------------------------------------------- -// wxBitmapHandler -// ---------------------------------------------------------------------------- - -bool wxBitmapHandler::Create(wxGDIImage *image, - const void* data, - long flags, - int width, int height, int depth) -{ - wxBitmap *bitmap = wxDynamicCast(image, wxBitmap); - - return bitmap && Create(bitmap, data, flags, width, height, depth); -} - -bool wxBitmapHandler::Load(wxGDIImage *image, - const wxString& name, - long flags, - int width, int height) -{ - wxBitmap *bitmap = wxDynamicCast(image, wxBitmap); - - return bitmap && LoadFile(bitmap, name, flags, width, height); -} - -bool wxBitmapHandler::Save(wxGDIImage *image, - const wxString& name, - int type) -{ - wxBitmap *bitmap = wxDynamicCast(image, wxBitmap); - - return bitmap && SaveFile(bitmap, name, type); -} - -bool wxBitmapHandler::Create(wxBitmap *WXUNUSED(bitmap), - const void* WXUNUSED(data), - long WXUNUSED(type), - int WXUNUSED(width), - int WXUNUSED(height), - int WXUNUSED(depth)) -{ - return false; -} - -bool wxBitmapHandler::LoadFile(wxBitmap *WXUNUSED(bitmap), - const wxString& WXUNUSED(name), - long WXUNUSED(type), - int WXUNUSED(desiredWidth), - int WXUNUSED(desiredHeight)) -{ - return false; -} - -bool wxBitmapHandler::SaveFile(wxBitmap *WXUNUSED(bitmap), - const wxString& WXUNUSED(name), - int WXUNUSED(type), - const wxPalette *WXUNUSED(palette)) -{ - return false; -} - -// ---------------------------------------------------------------------------- -// DIB functions -// ---------------------------------------------------------------------------- - -#ifndef __WXMICROWIN__ -bool wxCreateDIB(long xSize, long ySize, long bitsPerPixel, - HPALETTE hPal, LPBITMAPINFO* lpDIBHeader) -{ - unsigned long i, headerSize; - - // Allocate space for a DIB header - headerSize = (sizeof(BITMAPINFOHEADER) + (256 * sizeof(PALETTEENTRY))); - LPBITMAPINFO lpDIBheader = (BITMAPINFO *) malloc(headerSize); - LPPALETTEENTRY lpPe = (PALETTEENTRY *)((BYTE*)lpDIBheader + sizeof(BITMAPINFOHEADER)); - - GetPaletteEntries(hPal, 0, 256, lpPe); - - memset(lpDIBheader, 0x00, sizeof(BITMAPINFOHEADER)); - - // Fill in the static parts of the DIB header - lpDIBheader->bmiHeader.biSize = sizeof(BITMAPINFOHEADER); - lpDIBheader->bmiHeader.biWidth = xSize; - lpDIBheader->bmiHeader.biHeight = ySize; - lpDIBheader->bmiHeader.biPlanes = 1; - - // this value must be 1, 4, 8 or 24 so PixelDepth can only be - lpDIBheader->bmiHeader.biBitCount = (WORD)(bitsPerPixel); - lpDIBheader->bmiHeader.biCompression = BI_RGB; - lpDIBheader->bmiHeader.biSizeImage = (xSize * abs((int)ySize) * bitsPerPixel) >> 3; - lpDIBheader->bmiHeader.biClrUsed = 256; - - - // Initialize the DIB palette - for (i = 0; i < 256; i++) { - lpDIBheader->bmiColors[i].rgbReserved = lpPe[i].peFlags; - lpDIBheader->bmiColors[i].rgbRed = lpPe[i].peRed; - lpDIBheader->bmiColors[i].rgbGreen = lpPe[i].peGreen; - lpDIBheader->bmiColors[i].rgbBlue = lpPe[i].peBlue; - } - - *lpDIBHeader = lpDIBheader; - - return true; -} - -void wxFreeDIB(LPBITMAPINFO lpDIBHeader) -{ - free(lpDIBHeader); -} -#endif - -// ---------------------------------------------------------------------------- -// global helper functions implemented here -// ---------------------------------------------------------------------------- - -// helper of wxBitmapToHICON/HCURSOR -static -HICON wxBitmapToIconOrCursor(const wxBitmap& bmp, - bool iconWanted, - int hotSpotX, - int hotSpotY) -{ - if ( !bmp.Ok() ) - { - // we can't create an icon/cursor form nothing - return 0; - } - - if ( bmp.HasAlpha() ) - { - // Create an empty mask bitmap. - // it doesn't seem to work if we mess with the mask at all. - HBITMAP hMonoBitmap = CreateBitmap(bmp.GetWidth(),bmp.GetHeight(),1,1,NULL); - - ICONINFO iconInfo; - wxZeroMemory(iconInfo); - iconInfo.fIcon = iconWanted; // do we want an icon or a cursor? - if ( !iconWanted ) - { - iconInfo.xHotspot = hotSpotX; - iconInfo.yHotspot = hotSpotY; - } - - iconInfo.hbmMask = hMonoBitmap; - iconInfo.hbmColor = GetHbitmapOf(bmp); - - HICON hicon = ::CreateIconIndirect(&iconInfo); - - ::DeleteObject(hMonoBitmap); - - return hicon; - } - - wxMask* mask = bmp.GetMask(); - - if ( !mask ) - { - // we must have a mask for an icon, so even if it's probably incorrect, - // do create it (grey is the "standard" transparent colour) - mask = new wxMask(bmp, *wxLIGHT_GREY); - } - - ICONINFO iconInfo; - wxZeroMemory(iconInfo); - iconInfo.fIcon = iconWanted; // do we want an icon or a cursor? - if ( !iconWanted ) - { - iconInfo.xHotspot = hotSpotX; - iconInfo.yHotspot = hotSpotY; - } - - iconInfo.hbmMask = wxInvertMask((HBITMAP)mask->GetMaskBitmap()); - iconInfo.hbmColor = GetHbitmapOf(bmp); - - // black out the transparent area to preserve background colour, because - // Windows blits the original bitmap using SRCINVERT (XOR) after applying - // the mask to the dest rect. - { - MemoryHDC dcSrc, dcDst; - SelectInHDC selectMask(dcSrc, (HBITMAP)mask->GetMaskBitmap()), - selectBitmap(dcDst, iconInfo.hbmColor); - - if ( !::BitBlt(dcDst, 0, 0, bmp.GetWidth(), bmp.GetHeight(), - dcSrc, 0, 0, SRCAND) ) - { - wxLogLastError(_T("BitBlt")); - } - } - - HICON hicon = ::CreateIconIndirect(&iconInfo); - - if ( !bmp.GetMask() && !bmp.HasAlpha() ) - { - // we created the mask, now delete it - delete mask; - } - - // delete the inverted mask bitmap we created as well - ::DeleteObject(iconInfo.hbmMask); - - return hicon; -} - -HICON wxBitmapToHICON(const wxBitmap& bmp) -{ - return wxBitmapToIconOrCursor(bmp, true, 0, 0); -} - -HCURSOR wxBitmapToHCURSOR(const wxBitmap& bmp, int hotSpotX, int hotSpotY) -{ - return (HCURSOR)wxBitmapToIconOrCursor(bmp, false, hotSpotX, hotSpotY); -} - -HBITMAP wxInvertMask(HBITMAP hbmpMask, int w, int h) -{ -#ifndef __WXMICROWIN__ - wxCHECK_MSG( hbmpMask, 0, _T("invalid bitmap in wxInvertMask") ); - - // get width/height from the bitmap if not given - if ( !w || !h ) - { - BITMAP bm; - ::GetObject(hbmpMask, sizeof(BITMAP), (LPVOID)&bm); - w = bm.bmWidth; - h = bm.bmHeight; - } - - HDC hdcSrc = ::CreateCompatibleDC(NULL); - HDC hdcDst = ::CreateCompatibleDC(NULL); - if ( !hdcSrc || !hdcDst ) - { - wxLogLastError(wxT("CreateCompatibleDC")); - } - - HBITMAP hbmpInvMask = ::CreateBitmap(w, h, 1, 1, 0); - if ( !hbmpInvMask ) - { - wxLogLastError(wxT("CreateBitmap")); - } - - HGDIOBJ srcTmp = ::SelectObject(hdcSrc, hbmpMask); - HGDIOBJ dstTmp = ::SelectObject(hdcDst, hbmpInvMask); - if ( !::BitBlt(hdcDst, 0, 0, w, h, - hdcSrc, 0, 0, - NOTSRCCOPY) ) - { - wxLogLastError(wxT("BitBlt")); - } - - // Deselect objects - SelectObject(hdcSrc,srcTmp); - SelectObject(hdcDst,dstTmp); - - ::DeleteDC(hdcSrc); - ::DeleteDC(hdcDst); - - return hbmpInvMask; -#else - return 0; -#endif -} diff --git a/wxWidgets/src/msw/bmpbuttn.cpp b/wxWidgets/src/msw/bmpbuttn.cpp deleted file mode 100644 index a78ada6ebb..0000000000 --- a/wxWidgets/src/msw/bmpbuttn.cpp +++ /dev/null @@ -1,646 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/msw/bmpbuttn.cpp -// Purpose: wxBitmapButton -// Author: Julian Smart -// Modified by: -// Created: 04/01/98 -// RCS-ID: $Id: bmpbuttn.cpp 42816 2006-10-31 08:50:17Z RD $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_BMPBUTTON - -#include "wx/bmpbuttn.h" - -#ifndef WX_PRECOMP - #include "wx/log.h" - #include "wx/dcmemory.h" - #include "wx/image.h" -#endif - -#include "wx/msw/private.h" - -#include "wx/msw/uxtheme.h" - -#if wxUSE_UXTHEME - // no need to include tmschema.h - #ifndef BP_PUSHBUTTON - #define BP_PUSHBUTTON 1 - - #define PBS_NORMAL 1 - #define PBS_HOT 2 - #define PBS_PRESSED 3 - #define PBS_DISABLED 4 - #define PBS_DEFAULTED 5 - - #define TMT_CONTENTMARGINS 3602 - #endif -#endif // wxUSE_UXTHEME - -#ifndef ODS_NOFOCUSRECT - #define ODS_NOFOCUSRECT 0x0200 -#endif - -// ---------------------------------------------------------------------------- -// macros -// ---------------------------------------------------------------------------- - -#if wxUSE_EXTENDED_RTTI - -WX_DEFINE_FLAGS( wxBitmapButtonStyle ) - -wxBEGIN_FLAGS( wxBitmapButtonStyle ) - // new style border flags, we put them first to - // use them for streaming out - wxFLAGS_MEMBER(wxBORDER_SIMPLE) - wxFLAGS_MEMBER(wxBORDER_SUNKEN) - wxFLAGS_MEMBER(wxBORDER_DOUBLE) - wxFLAGS_MEMBER(wxBORDER_RAISED) - wxFLAGS_MEMBER(wxBORDER_STATIC) - wxFLAGS_MEMBER(wxBORDER_NONE) - - // old style border flags - wxFLAGS_MEMBER(wxSIMPLE_BORDER) - wxFLAGS_MEMBER(wxSUNKEN_BORDER) - wxFLAGS_MEMBER(wxDOUBLE_BORDER) - wxFLAGS_MEMBER(wxRAISED_BORDER) - wxFLAGS_MEMBER(wxSTATIC_BORDER) - wxFLAGS_MEMBER(wxBORDER) - - // standard window styles - wxFLAGS_MEMBER(wxTAB_TRAVERSAL) - wxFLAGS_MEMBER(wxCLIP_CHILDREN) - wxFLAGS_MEMBER(wxTRANSPARENT_WINDOW) - wxFLAGS_MEMBER(wxWANTS_CHARS) - wxFLAGS_MEMBER(wxFULL_REPAINT_ON_RESIZE) - wxFLAGS_MEMBER(wxALWAYS_SHOW_SB ) - wxFLAGS_MEMBER(wxVSCROLL) - wxFLAGS_MEMBER(wxHSCROLL) - - wxFLAGS_MEMBER(wxBU_AUTODRAW) - wxFLAGS_MEMBER(wxBU_LEFT) - wxFLAGS_MEMBER(wxBU_RIGHT) - wxFLAGS_MEMBER(wxBU_TOP) - wxFLAGS_MEMBER(wxBU_BOTTOM) -wxEND_FLAGS( wxBitmapButtonStyle ) - -IMPLEMENT_DYNAMIC_CLASS_XTI(wxBitmapButton, wxButton,"wx/bmpbuttn.h") - -wxBEGIN_PROPERTIES_TABLE(wxBitmapButton) - wxPROPERTY_FLAGS( WindowStyle , wxBitmapButtonStyle , long , SetWindowStyleFlag , GetWindowStyleFlag , EMPTY_MACROVALUE, 0 /*flags*/ , wxT("Helpstring") , wxT("group")) // style -wxEND_PROPERTIES_TABLE() - -wxBEGIN_HANDLERS_TABLE(wxBitmapButton) -wxEND_HANDLERS_TABLE() - -wxCONSTRUCTOR_5( wxBitmapButton , wxWindow* , Parent , wxWindowID , Id , wxBitmap , Bitmap , wxPoint , Position , wxSize , Size ) - -#else -IMPLEMENT_DYNAMIC_CLASS(wxBitmapButton, wxButton) -#endif - -BEGIN_EVENT_TABLE(wxBitmapButton, wxBitmapButtonBase) - EVT_SYS_COLOUR_CHANGED(wxBitmapButton::OnSysColourChanged) - EVT_ENTER_WINDOW(wxBitmapButton::OnMouseEnterOrLeave) - EVT_LEAVE_WINDOW(wxBitmapButton::OnMouseEnterOrLeave) -END_EVENT_TABLE() - -/* -TODO PROPERTIES : - -long "style" , wxBU_AUTODRAW -bool "default" , 0 -bitmap "selected" , -bitmap "focus" , -bitmap "disabled" , -*/ - -bool wxBitmapButton::Create(wxWindow *parent, wxWindowID id, - const wxBitmap& bitmap, - const wxPoint& pos, - const wxSize& size, long style, - const wxValidator& wxVALIDATOR_PARAM(validator), - const wxString& name) -{ - m_bmpNormal = bitmap; - SetName(name); - -#if wxUSE_VALIDATORS - SetValidator(validator); -#endif // wxUSE_VALIDATORS - - parent->AddChild(this); - - m_windowStyle = style; - - if ( style & wxBU_AUTODRAW ) - { - m_marginX = - m_marginY = 4; - } - - if (id == wxID_ANY) - m_windowId = NewControlId(); - else - m_windowId = id; - - long msStyle = WS_VISIBLE | WS_TABSTOP | WS_CHILD | BS_OWNERDRAW ; - - if ( m_windowStyle & wxCLIP_SIBLINGS ) - msStyle |= WS_CLIPSIBLINGS; - -#ifdef __WIN32__ - if(m_windowStyle & wxBU_LEFT) - msStyle |= BS_LEFT; - if(m_windowStyle & wxBU_RIGHT) - msStyle |= BS_RIGHT; - if(m_windowStyle & wxBU_TOP) - msStyle |= BS_TOP; - if(m_windowStyle & wxBU_BOTTOM) - msStyle |= BS_BOTTOM; -#endif - - m_hWnd = (WXHWND) CreateWindowEx( - 0, - wxT("BUTTON"), - wxEmptyString, - msStyle, - 0, 0, 0, 0, - GetWinHwnd(parent), - (HMENU)m_windowId, - wxGetInstance(), - NULL - ); - - // Subclass again for purposes of dialog editing mode - SubclassWin(m_hWnd); - - SetPosition(pos); - SetInitialSize(size); - - return true; -} - -bool wxBitmapButton::SetBackgroundColour(const wxColour& colour) -{ - if ( !wxBitmapButtonBase::SetBackgroundColour(colour) ) - { - // didn't change - return false; - } - - // invalidate the brush, it will be recreated the next time it's needed - m_brushDisabled = wxNullBrush; - - return true; -} - -void wxBitmapButton::OnSysColourChanged(wxSysColourChangedEvent& event) -{ - m_brushDisabled = wxNullBrush; - - if ( !IsEnabled() ) - { - // this change affects our current state - Refresh(); - } - - event.Skip(); -} - -void wxBitmapButton::OnMouseEnterOrLeave(wxMouseEvent& event) -{ - if ( IsEnabled() && m_bmpHover.Ok() ) - Refresh(); - - event.Skip(); -} - -void wxBitmapButton::OnSetBitmap() -{ - // if the focus bitmap is specified but hover one isn't, use the focus - // bitmap for hovering as well if this is consistent with the current - // Windows version look and feel - // - // rationale: this is compatible with the old wxGTK behaviour and also - // makes it much easier to do "the right thing" for all platforms (some of - // them, such as Windows XP, have "hot" buttons while others don't) - if ( !m_bmpHover.Ok() && - m_bmpFocus.Ok() && - wxUxThemeEngine::GetIfActive() ) - { - m_bmpHover = m_bmpFocus; - } - - // this will redraw us - wxBitmapButtonBase::OnSetBitmap(); -} - -#if wxUSE_UXTHEME -static -void MSWDrawXPBackground(wxButton *button, WXDRAWITEMSTRUCT *wxdis) -{ - LPDRAWITEMSTRUCT lpDIS = (LPDRAWITEMSTRUCT)wxdis; - HDC hdc = lpDIS->hDC; - UINT state = lpDIS->itemState; - RECT rectBtn; - CopyRect(&rectBtn, &lpDIS->rcItem); - - wxUxThemeHandle theme(button, L"BUTTON"); - int iState; - - if ( state & ODS_SELECTED ) - { - iState = PBS_PRESSED; - } - else if ( button->HasCapture() || button->IsMouseInWindow() ) - { - iState = PBS_HOT; - } - else if ( state & ODS_FOCUS ) - { - iState = PBS_DEFAULTED; - } - else if ( state & ODS_DISABLED ) - { - iState = PBS_DISABLED; - } - else - { - iState = PBS_NORMAL; - } - - // draw parent background if needed - if ( wxUxThemeEngine::Get()->IsThemeBackgroundPartiallyTransparent(theme, - BP_PUSHBUTTON, - iState) ) - { - wxUxThemeEngine::Get()->DrawThemeParentBackground(GetHwndOf(button), hdc, &rectBtn); - } - - // draw background - wxUxThemeEngine::Get()->DrawThemeBackground(theme, hdc, BP_PUSHBUTTON, iState, - &rectBtn, NULL); - - // calculate content area margins - MARGINS margins; - wxUxThemeEngine::Get()->GetThemeMargins(theme, hdc, BP_PUSHBUTTON, iState, - TMT_CONTENTMARGINS, &rectBtn, &margins); - RECT rectClient; - ::CopyRect(&rectClient, &rectBtn); - ::InflateRect(&rectClient, -margins.cxLeftWidth, -margins.cyTopHeight); - - // if focused and !nofocus rect - if ( (state & ODS_FOCUS) && !(state & ODS_NOFOCUSRECT) ) - { - DrawFocusRect(hdc, &rectClient); - } - - if ( button->UseBgCol() ) - { - COLORREF colBg = wxColourToRGB(button->GetBackgroundColour()); - HBRUSH hbrushBackground = ::CreateSolidBrush(colBg); - - // don't overwrite the focus rect - ::InflateRect(&rectClient, -1, -1); - FillRect(hdc, &rectClient, hbrushBackground); - ::DeleteObject(hbrushBackground); - } -} -#endif // wxUSE_UXTHEME - -// VZ: should be at the very least less than wxDEFAULT_BUTTON_MARGIN -#define FOCUS_MARGIN 3 - -bool wxBitmapButton::MSWOnDraw(WXDRAWITEMSTRUCT *item) -{ -#ifndef __WXWINCE__ - long style = GetWindowLong((HWND) GetHWND(), GWL_STYLE); - if (style & BS_BITMAP) - { - // Let default procedure draw the bitmap, which is defined - // in the Windows resource. - return false; - } -#endif - - LPDRAWITEMSTRUCT lpDIS = (LPDRAWITEMSTRUCT) item; - HDC hDC = lpDIS->hDC; - UINT state = lpDIS->itemState; - bool isSelected = (state & ODS_SELECTED) != 0; - bool autoDraw = (GetWindowStyleFlag() & wxBU_AUTODRAW) != 0; - - - // choose the bitmap to use depending on the button state - wxBitmap *bitmap; - - if ( isSelected && m_bmpSelected.Ok() ) - bitmap = &m_bmpSelected; - else if ( m_bmpHover.Ok() && IsMouseInWindow() ) - bitmap = &m_bmpHover; - else if ((state & ODS_FOCUS) && m_bmpFocus.Ok()) - bitmap = &m_bmpFocus; - else if ((state & ODS_DISABLED) && m_bmpDisabled.Ok()) - bitmap = &m_bmpDisabled; - else - bitmap = &m_bmpNormal; - - if ( !bitmap->Ok() ) - return false; - - // centre the bitmap in the control area - int x = lpDIS->rcItem.left; - int y = lpDIS->rcItem.top; - int width = lpDIS->rcItem.right - x; - int height = lpDIS->rcItem.bottom - y; - int wBmp = bitmap->GetWidth(); - int hBmp = bitmap->GetHeight(); - -#if wxUSE_UXTHEME - if ( autoDraw && wxUxThemeEngine::GetIfActive() ) - { - MSWDrawXPBackground(this, item); - wxUxThemeHandle theme(this, L"BUTTON"); - - // calculate content area margins - // assuming here that each state is the same size - MARGINS margins; - wxUxThemeEngine::Get()->GetThemeMargins(theme, NULL, - BP_PUSHBUTTON, PBS_NORMAL, - TMT_CONTENTMARGINS, NULL, - &margins); - int marginX = margins.cxLeftWidth + 1; - int marginY = margins.cyTopHeight + 1; - int x1,y1; - - if ( m_windowStyle & wxBU_LEFT ) - { - x1 = x + marginX; - } - else if ( m_windowStyle & wxBU_RIGHT ) - { - x1 = x + (width - wBmp) - marginX; - } - else - { - x1 = x + (width - wBmp) / 2; - } - - if ( m_windowStyle & wxBU_TOP ) - { - y1 = y + marginY; - } - else if ( m_windowStyle & wxBU_BOTTOM ) - { - y1 = y + (height - hBmp) - marginY; - } - else - { - y1 = y + (height - hBmp) / 2; - } - - // draw the bitmap - wxDCTemp dst((WXHDC)hDC); - dst.DrawBitmap(*bitmap, x1, y1, true); - - return true; - } -#endif // wxUSE_UXTHEME - - int x1,y1; - - if(m_windowStyle & wxBU_LEFT) - x1 = x + (FOCUS_MARGIN+1); - else if(m_windowStyle & wxBU_RIGHT) - x1 = x + (width - wBmp) - (FOCUS_MARGIN+1); - else - x1 = x + (width - wBmp) / 2; - - if(m_windowStyle & wxBU_TOP) - y1 = y + (FOCUS_MARGIN+1); - else if(m_windowStyle & wxBU_BOTTOM) - y1 = y + (height - hBmp) - (FOCUS_MARGIN+1); - else - y1 = y + (height - hBmp) / 2; - - if ( isSelected && autoDraw ) - { - x1++; - y1++; - } - - // draw the face, if auto-drawing - if ( autoDraw ) - { - DrawFace((WXHDC) hDC, - lpDIS->rcItem.left, lpDIS->rcItem.top, - lpDIS->rcItem.right, lpDIS->rcItem.bottom, - isSelected); - } - - // draw the bitmap - wxDCTemp dst((WXHDC)hDC); - dst.DrawBitmap(*bitmap, x1, y1, true); - - // draw focus / disabled state, if auto-drawing - if ( (state & ODS_DISABLED) && autoDraw ) - { - DrawButtonDisable((WXHDC) hDC, - lpDIS->rcItem.left, lpDIS->rcItem.top, - lpDIS->rcItem.right, lpDIS->rcItem.bottom, - true); - } - else if ( (state & ODS_FOCUS) && autoDraw ) - { - DrawButtonFocus((WXHDC) hDC, - lpDIS->rcItem.left, - lpDIS->rcItem.top, - lpDIS->rcItem.right, - lpDIS->rcItem.bottom, - isSelected); - } - - return true; -} - -// GRG Feb/2000, support for bmp buttons with Win95/98 standard LNF - -void wxBitmapButton::DrawFace( WXHDC dc, int left, int top, - int right, int bottom, bool sel ) -{ - HPEN oldp; - HPEN penHiLight; - HPEN penLight; - HPEN penShadow; - HPEN penDkShadow; - HBRUSH brushFace; - - // create needed pens and brush - penHiLight = CreatePen(PS_SOLID, 0, GetSysColor(COLOR_3DHILIGHT)); - penLight = CreatePen(PS_SOLID, 0, GetSysColor(COLOR_3DLIGHT)); - penShadow = CreatePen(PS_SOLID, 0, GetSysColor(COLOR_3DSHADOW)); - penDkShadow = CreatePen(PS_SOLID, 0, GetSysColor(COLOR_3DDKSHADOW)); - brushFace = CreateSolidBrush(GetSysColor(COLOR_BTNFACE)); - - // draw the rectangle - RECT rect; - rect.left = left; - rect.right = right; - rect.top = top; - rect.bottom = bottom; - FillRect((HDC) dc, &rect, brushFace); - - // draw the border - oldp = (HPEN) SelectObject( (HDC) dc, sel? penDkShadow : penHiLight); - - wxDrawLine((HDC) dc, left, top, right-1, top); - wxDrawLine((HDC) dc, left, top+1, left, bottom-1); - - SelectObject( (HDC) dc, sel? penShadow : penLight); - wxDrawLine((HDC) dc, left+1, top+1, right-2, top+1); - wxDrawLine((HDC) dc, left+1, top+2, left+1, bottom-2); - - SelectObject( (HDC) dc, sel? penLight : penShadow); - wxDrawLine((HDC) dc, left+1, bottom-2, right-1, bottom-2); - wxDrawLine((HDC) dc, right-2, bottom-3, right-2, top); - - SelectObject( (HDC) dc, sel? penHiLight : penDkShadow); - wxDrawLine((HDC) dc, left, bottom-1, right+2, bottom-1); - wxDrawLine((HDC) dc, right-1, bottom-2, right-1, top-1); - - // delete allocated resources - SelectObject((HDC) dc,oldp); - DeleteObject(penHiLight); - DeleteObject(penLight); - DeleteObject(penShadow); - DeleteObject(penDkShadow); - DeleteObject(brushFace); -} - -void wxBitmapButton::DrawButtonFocus( WXHDC dc, int left, int top, int right, - int bottom, bool WXUNUSED(sel) ) -{ - RECT rect; - rect.left = left; - rect.top = top; - rect.right = right; - rect.bottom = bottom; - InflateRect( &rect, - FOCUS_MARGIN, - FOCUS_MARGIN ); - - // GRG: the focus rectangle should not move when the button is pushed! -/* - if ( sel ) - OffsetRect( &rect, 1, 1 ); -*/ - - DrawFocusRect( (HDC) dc, &rect ); -} - -void -wxBitmapButton::DrawButtonDisable( WXHDC dc, - int left, int top, int right, int bottom, - bool with_marg ) -{ - if ( !m_brushDisabled.Ok() ) - { - // draw a bitmap with two black and two background colour pixels - wxBitmap bmp(2, 2); - wxMemoryDC dc; - dc.SelectObject(bmp); - dc.SetPen(*wxBLACK_PEN); - dc.DrawPoint(0, 0); - dc.DrawPoint(1, 1); - dc.SetPen(GetBackgroundColour()); - dc.DrawPoint(0, 1); - dc.DrawPoint(1, 0); - - m_brushDisabled = wxBrush(bmp); - } - - SelectInHDC selectBrush((HDC)dc, GetHbrushOf(m_brushDisabled)); - - // ROP for "dest |= pattern" operation -- as it doesn't have a standard - // name, give it our own - static const DWORD PATTERNPAINT = 0xFA0089UL; - - if ( with_marg ) - { - left += m_marginX; - top += m_marginY; - right -= 2 * m_marginX; - bottom -= 2 * m_marginY; - } - - ::PatBlt( (HDC) dc, left, top, right, bottom, PATTERNPAINT); -} - -void wxBitmapButton::SetDefault() -{ - wxButton::SetDefault(); -} - -wxSize wxBitmapButton::DoGetBestSize() const -{ - if ( m_bmpNormal.Ok() ) - { - int width = m_bmpNormal.GetWidth(), - height = m_bmpNormal.GetHeight(); - int marginH = 0, - marginV = 0; - -#if wxUSE_UXTHEME - if ( wxUxThemeEngine::GetIfActive() ) - { - wxUxThemeHandle theme((wxBitmapButton *)this, L"BUTTON"); - - MARGINS margins; - wxUxThemeEngine::Get()->GetThemeMargins(theme, NULL, - BP_PUSHBUTTON, PBS_NORMAL, - TMT_CONTENTMARGINS, NULL, - &margins); - - // XP doesn't draw themed buttons correctly when the client area is - // smaller than 8x8 - enforce this minimum size for small bitmaps - if ( width < 8 ) - width = 8; - if ( height < 8 ) - height = 8; - - // don't add margins for the borderless buttons, they don't need - // them and it just makes them appear larger than needed - if ( !HasFlag(wxBORDER_NONE) ) - { - // we need 2 extra pixels for the focus rectangle, without them - // it's overwritten by the bitmap itself - marginH = margins.cxLeftWidth + margins.cxRightWidth + 2; - marginV = margins.cyTopHeight + margins.cyBottomHeight + 2; - } - } - else -#endif // wxUSE_UXTHEME - { - if ( !HasFlag(wxBORDER_NONE) ) - { - marginH = 2*m_marginX; - marginV = 2*m_marginY; - } - } - - wxSize best(width + marginH, height + marginV); - CacheBestSize(best); - return best; - } - - // no idea what our best size should be, defer to the base class - return wxBitmapButtonBase::DoGetBestSize(); -} - -#endif // wxUSE_BMPBUTTON diff --git a/wxWidgets/src/msw/brush.cpp b/wxWidgets/src/msw/brush.cpp deleted file mode 100644 index c0bbee874a..0000000000 --- a/wxWidgets/src/msw/brush.cpp +++ /dev/null @@ -1,327 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/msw/brush.cpp -// Purpose: wxBrush -// Author: Julian Smart -// Modified by: -// Created: 04/01/98 -// RCS-ID: $Id: brush.cpp 42776 2006-10-30 22:03:53Z VZ $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#include "wx/brush.h" - -#ifndef WX_PRECOMP - #include "wx/list.h" - #include "wx/utils.h" - #include "wx/app.h" -#endif // WX_PRECOMP - -#include "wx/msw/private.h" - -// ---------------------------------------------------------------------------- -// private classes -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxBrushRefData: public wxGDIRefData -{ -public: - wxBrushRefData(const wxColour& colour = wxNullColour, int style = wxSOLID); - wxBrushRefData(const wxBitmap& stipple); - wxBrushRefData(const wxBrushRefData& data); - virtual ~wxBrushRefData(); - - bool operator==(const wxBrushRefData& data) const; - - HBRUSH GetHBRUSH(); - void Free(); - - const wxColour& GetColour() const { return m_colour; } - int GetStyle() const { return m_style; } - wxBitmap *GetStipple() { return &m_stipple; } - - void SetColour(const wxColour& colour) { Free(); m_colour = colour; } - void SetStyle(int style) { Free(); m_style = style; } - void SetStipple(const wxBitmap& stipple) { Free(); DoSetStipple(stipple); } - -private: - void DoSetStipple(const wxBitmap& stipple); - - int m_style; - wxBitmap m_stipple; - wxColour m_colour; - HBRUSH m_hBrush; - - // no assignment operator, the objects of this class are shared and never - // assigned after being created once - wxBrushRefData& operator=(const wxBrushRefData&); -}; - -#define M_BRUSHDATA ((wxBrushRefData *)m_refData) - -// ============================================================================ -// wxBrushRefData implementation -// ============================================================================ - -IMPLEMENT_DYNAMIC_CLASS(wxBrush, wxGDIObject) - -// ---------------------------------------------------------------------------- -// wxBrushRefData ctors/dtor -// ---------------------------------------------------------------------------- - -wxBrushRefData::wxBrushRefData(const wxColour& colour, int style) - : m_colour(colour) -{ - m_style = style; - - m_hBrush = NULL; -} - -wxBrushRefData::wxBrushRefData(const wxBitmap& stipple) -{ - DoSetStipple(stipple); - - m_hBrush = NULL; -} - -wxBrushRefData::wxBrushRefData(const wxBrushRefData& data) - : wxGDIRefData(), - m_stipple(data.m_stipple), - m_colour(data.m_colour) -{ - m_style = data.m_style; - - // we can't share HBRUSH, we'd need to create another one ourselves - m_hBrush = NULL; -} - -wxBrushRefData::~wxBrushRefData() -{ - Free(); -} - -// ---------------------------------------------------------------------------- -// wxBrushRefData accesors -// ---------------------------------------------------------------------------- - -bool wxBrushRefData::operator==(const wxBrushRefData& data) const -{ - // don't compare HBRUSHes - return m_style == data.m_style && - m_colour == data.m_colour && - m_stipple.IsSameAs(data.m_stipple); -} - -void wxBrushRefData::DoSetStipple(const wxBitmap& stipple) -{ - m_stipple = stipple; - m_style = stipple.GetMask() ? wxSTIPPLE_MASK_OPAQUE : wxSTIPPLE; -} - -// ---------------------------------------------------------------------------- -// wxBrushRefData resource handling -// ---------------------------------------------------------------------------- - -void wxBrushRefData::Free() -{ - if ( m_hBrush ) - { - ::DeleteObject(m_hBrush); - - m_hBrush = NULL; - } -} - -#if !defined(__WXMICROWIN__) && !defined(__WXWINCE__) - -static int TranslateHatchStyle(int style) -{ - switch ( style ) - { - case wxBDIAGONAL_HATCH: return HS_BDIAGONAL; - case wxCROSSDIAG_HATCH: return HS_DIAGCROSS; - case wxFDIAGONAL_HATCH: return HS_FDIAGONAL; - case wxCROSS_HATCH: return HS_CROSS; - case wxHORIZONTAL_HATCH:return HS_HORIZONTAL; - case wxVERTICAL_HATCH: return HS_VERTICAL; - default: return -1; - } -} - -#endif // !__WXMICROWIN__ && !__WXWINCE__ - -HBRUSH wxBrushRefData::GetHBRUSH() -{ - if ( !m_hBrush ) - { -#if !defined(__WXMICROWIN__) && !defined(__WXWINCE__) - int hatchStyle = TranslateHatchStyle(m_style); - if ( hatchStyle == -1 ) -#endif // !__WXMICROWIN__ && !__WXWINCE__ - { - switch ( m_style ) - { - case wxTRANSPARENT: - m_hBrush = (HBRUSH)::GetStockObject(NULL_BRUSH); - break; - - case wxSTIPPLE: - m_hBrush = ::CreatePatternBrush(GetHbitmapOf(m_stipple)); - break; - - case wxSTIPPLE_MASK_OPAQUE: - m_hBrush = ::CreatePatternBrush((HBITMAP)m_stipple.GetMask() - ->GetMaskBitmap()); - break; - - default: - wxFAIL_MSG( _T("unknown brush style") ); - // fall through - - case wxSOLID: - m_hBrush = ::CreateSolidBrush(m_colour.GetPixel()); - break; - } - } -#ifndef __WXWINCE__ - else // create a hatched brush - { - m_hBrush = ::CreateHatchBrush(hatchStyle, m_colour.GetPixel()); - } -#endif - - if ( !m_hBrush ) - { - wxLogLastError(_T("CreateXXXBrush()")); - } - } - - return m_hBrush; -} - -// ============================================================================ -// wxBrush implementation -// ============================================================================ - -// ---------------------------------------------------------------------------- -// wxBrush ctors/dtor -// ---------------------------------------------------------------------------- - -wxBrush::wxBrush() -{ -} - -wxBrush::wxBrush(const wxColour& col, int style) -{ - m_refData = new wxBrushRefData(col, style); -} - -wxBrush::wxBrush(const wxBitmap& stipple) -{ - m_refData = new wxBrushRefData(stipple); -} - -wxBrush::~wxBrush() -{ -} - -// ---------------------------------------------------------------------------- -// wxBrush house keeping stuff -// ---------------------------------------------------------------------------- - -bool wxBrush::operator==(const wxBrush& brush) const -{ - const wxBrushRefData *brushData = (wxBrushRefData *)brush.m_refData; - - // an invalid brush is considered to be only equal to another invalid brush - return m_refData ? (brushData && *M_BRUSHDATA == *brushData) : !brushData; -} - -wxObjectRefData *wxBrush::CreateRefData() const -{ - return new wxBrushRefData; -} - -wxObjectRefData *wxBrush::CloneRefData(const wxObjectRefData *data) const -{ - return new wxBrushRefData(*(const wxBrushRefData *)data); -} - -// ---------------------------------------------------------------------------- -// wxBrush accessors -// ---------------------------------------------------------------------------- - -wxColour wxBrush::GetColour() const -{ - wxCHECK_MSG( Ok(), wxNullColour, _T("invalid brush") ); - - return M_BRUSHDATA->GetColour(); -} - -int wxBrush::GetStyle() const -{ - wxCHECK_MSG( Ok(), 0, _T("invalid brush") ); - - return M_BRUSHDATA->GetStyle(); -} - -wxBitmap *wxBrush::GetStipple() const -{ - wxCHECK_MSG( Ok(), NULL, _T("invalid brush") ); - - return M_BRUSHDATA->GetStipple(); -} - -WXHANDLE wxBrush::GetResourceHandle() const -{ - wxCHECK_MSG( Ok(), FALSE, _T("invalid brush") ); - - return (WXHANDLE)M_BRUSHDATA->GetHBRUSH(); -} - -// ---------------------------------------------------------------------------- -// wxBrush setters -// ---------------------------------------------------------------------------- - -void wxBrush::SetColour(const wxColour& col) -{ - AllocExclusive(); - - M_BRUSHDATA->SetColour(col); -} - -void wxBrush::SetColour(unsigned char r, unsigned char g, unsigned char b) -{ - AllocExclusive(); - - M_BRUSHDATA->SetColour(wxColour(r, g, b)); -} - -void wxBrush::SetStyle(int style) -{ - AllocExclusive(); - - M_BRUSHDATA->SetStyle(style); -} - -void wxBrush::SetStipple(const wxBitmap& stipple) -{ - AllocExclusive(); - - M_BRUSHDATA->SetStipple(stipple); -} diff --git a/wxWidgets/src/msw/button.cpp b/wxWidgets/src/msw/button.cpp deleted file mode 100644 index 20e8fbcc04..0000000000 --- a/wxWidgets/src/msw/button.cpp +++ /dev/null @@ -1,890 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/msw/button.cpp -// Purpose: wxButton -// Author: Julian Smart -// Modified by: -// Created: 04/01/98 -// RCS-ID: $Id: button.cpp 51575 2008-02-06 19:58:30Z VZ $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_BUTTON - -#include "wx/button.h" - -#ifndef WX_PRECOMP - #include "wx/app.h" - #include "wx/brush.h" - #include "wx/panel.h" - #include "wx/bmpbuttn.h" - #include "wx/settings.h" - #include "wx/dcscreen.h" - #include "wx/dcclient.h" - #include "wx/toplevel.h" -#endif - -#include "wx/stockitem.h" -#include "wx/tokenzr.h" -#include "wx/msw/private.h" - -#if wxUSE_UXTHEME - #include "wx/msw/uxtheme.h" - - // no need to include tmschema.h - #ifndef BP_PUSHBUTTON - #define BP_PUSHBUTTON 1 - - #define PBS_NORMAL 1 - #define PBS_HOT 2 - #define PBS_PRESSED 3 - #define PBS_DISABLED 4 - #define PBS_DEFAULTED 5 - - #define TMT_CONTENTMARGINS 3602 - #endif -#endif // wxUSE_UXTHEME - -#ifndef WM_THEMECHANGED - #define WM_THEMECHANGED 0x031A -#endif - -#ifndef ODS_NOACCEL - #define ODS_NOACCEL 0x0100 -#endif - -#ifndef ODS_NOFOCUSRECT - #define ODS_NOFOCUSRECT 0x0200 -#endif - -// ---------------------------------------------------------------------------- -// macros -// ---------------------------------------------------------------------------- - -#if wxUSE_EXTENDED_RTTI - -WX_DEFINE_FLAGS( wxButtonStyle ) - -wxBEGIN_FLAGS( wxButtonStyle ) - // new style border flags, we put them first to - // use them for streaming out - wxFLAGS_MEMBER(wxBORDER_SIMPLE) - wxFLAGS_MEMBER(wxBORDER_SUNKEN) - wxFLAGS_MEMBER(wxBORDER_DOUBLE) - wxFLAGS_MEMBER(wxBORDER_RAISED) - wxFLAGS_MEMBER(wxBORDER_STATIC) - wxFLAGS_MEMBER(wxBORDER_NONE) - - // old style border flags - wxFLAGS_MEMBER(wxSIMPLE_BORDER) - wxFLAGS_MEMBER(wxSUNKEN_BORDER) - wxFLAGS_MEMBER(wxDOUBLE_BORDER) - wxFLAGS_MEMBER(wxRAISED_BORDER) - wxFLAGS_MEMBER(wxSTATIC_BORDER) - wxFLAGS_MEMBER(wxBORDER) - - // standard window styles - wxFLAGS_MEMBER(wxTAB_TRAVERSAL) - wxFLAGS_MEMBER(wxCLIP_CHILDREN) - wxFLAGS_MEMBER(wxTRANSPARENT_WINDOW) - wxFLAGS_MEMBER(wxWANTS_CHARS) - wxFLAGS_MEMBER(wxFULL_REPAINT_ON_RESIZE) - wxFLAGS_MEMBER(wxALWAYS_SHOW_SB ) - wxFLAGS_MEMBER(wxVSCROLL) - wxFLAGS_MEMBER(wxHSCROLL) - - wxFLAGS_MEMBER(wxBU_LEFT) - wxFLAGS_MEMBER(wxBU_RIGHT) - wxFLAGS_MEMBER(wxBU_TOP) - wxFLAGS_MEMBER(wxBU_BOTTOM) - wxFLAGS_MEMBER(wxBU_EXACTFIT) -wxEND_FLAGS( wxButtonStyle ) - -IMPLEMENT_DYNAMIC_CLASS_XTI(wxButton, wxControl,"wx/button.h") - -wxBEGIN_PROPERTIES_TABLE(wxButton) - wxEVENT_PROPERTY( Click , wxEVT_COMMAND_BUTTON_CLICKED , wxCommandEvent) - - wxPROPERTY( Font , wxFont , SetFont , GetFont , EMPTY_MACROVALUE, 0 /*flags*/ , wxT("Helpstring") , wxT("group")) - wxPROPERTY( Label, wxString , SetLabel, GetLabel, wxString(), 0 /*flags*/ , wxT("Helpstring") , wxT("group") ) - - wxPROPERTY_FLAGS( WindowStyle , wxButtonStyle , long , SetWindowStyleFlag , GetWindowStyleFlag , EMPTY_MACROVALUE , 0 /*flags*/ , wxT("Helpstring") , wxT("group")) // style - -wxEND_PROPERTIES_TABLE() - -wxBEGIN_HANDLERS_TABLE(wxButton) -wxEND_HANDLERS_TABLE() - -wxCONSTRUCTOR_6( wxButton , wxWindow* , Parent , wxWindowID , Id , wxString , Label , wxPoint , Position , wxSize , Size , long , WindowStyle ) - - -#else -IMPLEMENT_DYNAMIC_CLASS(wxButton, wxControl) -#endif - -// this macro tries to adjust the default button height to a reasonable value -// using the char height as the base -#define BUTTON_HEIGHT_FROM_CHAR_HEIGHT(cy) (11*EDIT_HEIGHT_FROM_CHAR_HEIGHT(cy)/10) - -// ============================================================================ -// implementation -// ============================================================================ - -// ---------------------------------------------------------------------------- -// creation/destruction -// ---------------------------------------------------------------------------- - -bool wxButton::Create(wxWindow *parent, - wxWindowID id, - const wxString& lbl, - const wxPoint& pos, - const wxSize& size, - long style, - const wxValidator& validator, - const wxString& name) -{ - wxString label(lbl); - if (label.empty() && wxIsStockID(id)) - { - // On Windows, some buttons aren't supposed to have - // mnemonics, so strip them out. - - label = wxGetStockLabel(id -#if defined(__WXMSW__) || defined(__WXWINCE__) - , ( id != wxID_OK && - id != wxID_CANCEL && - id != wxID_CLOSE ) -#endif - ); - } - - if ( !CreateControl(parent, id, pos, size, style, validator, name) ) - return false; - - WXDWORD exstyle; - WXDWORD msStyle = MSWGetStyle(style, &exstyle); - -#ifdef __WIN32__ - // if the label contains several lines we must explicitly tell the button - // about it or it wouldn't draw it correctly ("\n"s would just appear as - // black boxes) - // - // NB: we do it here and not in MSWGetStyle() because we need the label - // value and m_label is not set yet when MSWGetStyle() is called; - // besides changing BS_MULTILINE during run-time is pointless anyhow - if ( label.find(_T('\n')) != wxString::npos ) - { - msStyle |= BS_MULTILINE; - } -#endif // __WIN32__ - - return MSWCreateControl(_T("BUTTON"), msStyle, pos, size, label, exstyle); -} - -wxButton::~wxButton() -{ - wxTopLevelWindow *tlw = wxDynamicCast(wxGetTopLevelParent(this), wxTopLevelWindow); - if ( tlw && tlw->GetTmpDefaultItem() == this ) - { - UnsetTmpDefault(); - } -} - -// ---------------------------------------------------------------------------- -// flags -// ---------------------------------------------------------------------------- - -WXDWORD wxButton::MSWGetStyle(long style, WXDWORD *exstyle) const -{ - // buttons never have an external border, they draw their own one - WXDWORD msStyle = wxControl::MSWGetStyle - ( - (style & ~wxBORDER_MASK) | wxBORDER_NONE, exstyle - ); - - // we must use WS_CLIPSIBLINGS with the buttons or they would draw over - // each other in any resizeable dialog which has more than one button in - // the bottom - msStyle |= WS_CLIPSIBLINGS; - -#ifdef __WIN32__ - // don't use "else if" here: weird as it is, but you may combine wxBU_LEFT - // and wxBU_RIGHT to get BS_CENTER! - if ( style & wxBU_LEFT ) - msStyle |= BS_LEFT; - if ( style & wxBU_RIGHT ) - msStyle |= BS_RIGHT; - if ( style & wxBU_TOP ) - msStyle |= BS_TOP; - if ( style & wxBU_BOTTOM ) - msStyle |= BS_BOTTOM; -#ifndef __WXWINCE__ - // flat 2d buttons - if ( style & wxNO_BORDER ) - msStyle |= BS_FLAT; -#endif // __WXWINCE__ -#endif // __WIN32__ - - return msStyle; -} - -// ---------------------------------------------------------------------------- -// size management including autosizing -// ---------------------------------------------------------------------------- - -wxSize wxButton::DoGetBestSize() const -{ - wxClientDC dc(wx_const_cast(wxButton *, this)); - dc.SetFont(GetFont()); - - wxCoord wBtn, - hBtn; - dc.GetMultiLineTextExtent(GetLabelText(), &wBtn, &hBtn); - - // add a margin -- the button is wider than just its label - wBtn += 3*GetCharWidth(); - hBtn = BUTTON_HEIGHT_FROM_CHAR_HEIGHT(hBtn); - - // all buttons have at least the standard size unless the user explicitly - // wants them to be of smaller size and used wxBU_EXACTFIT style when - // creating the button - if ( !HasFlag(wxBU_EXACTFIT) ) - { - wxSize sz = GetDefaultSize(); - if (wBtn > sz.x) - sz.x = wBtn; - if (hBtn > sz.y) - sz.y = hBtn; - - return sz; - } - - wxSize best(wBtn, hBtn); - CacheBestSize(best); - return best; -} - -/* static */ -wxSize wxButtonBase::GetDefaultSize() -{ - static wxSize s_sizeBtn; - - if ( s_sizeBtn.x == 0 ) - { - wxScreenDC dc; - dc.SetFont(wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT)); - - // the size of a standard button in the dialog units is 50x14, - // translate this to pixels - // NB1: the multipliers come from the Windows convention - // NB2: the extra +1/+2 were needed to get the size be the same as the - // size of the buttons in the standard dialog - I don't know how - // this happens, but on my system this size is 75x23 in pixels and - // 23*8 isn't even divisible by 14... Would be nice to understand - // why these constants are needed though! - s_sizeBtn.x = (50 * (dc.GetCharWidth() + 1))/4; - s_sizeBtn.y = ((14 * dc.GetCharHeight()) + 2)/8; - } - - return s_sizeBtn; -} - -// ---------------------------------------------------------------------------- -// default button handling -// ---------------------------------------------------------------------------- - -/* - "Everything you ever wanted to know about the default buttons" or "Why do we - have to do all this?" - - In MSW the default button should be activated when the user presses Enter - and the current control doesn't process Enter itself somehow. This is - handled by ::DefWindowProc() (or maybe ::DefDialogProc()) using DM_SETDEFID - Another aspect of "defaultness" is that the default button has different - appearance: this is due to BS_DEFPUSHBUTTON style which is completely - separate from DM_SETDEFID stuff (!). Also note that BS_DEFPUSHBUTTON should - be unset if our parent window is not active so it should be unset whenever - we lose activation and set back when we regain it. - - Final complication is that when a button is active, it should be the default - one, i.e. pressing Enter on a button always activates it and not another - one. - - We handle this by maintaining a permanent and a temporary default items in - wxControlContainer (both may be NULL). When a button becomes the current - control (i.e. gets focus) it sets itself as the temporary default which - ensures that it has the right appearance and that Enter will be redirected - to it. When the button loses focus, it unsets the temporary default and so - the default item will be the permanent default -- that is the default button - if any had been set or none otherwise, which is just what we want. - - NB: all this is quite complicated by now and the worst is that normally - it shouldn't be necessary at all as for the normal Windows programs - DefWindowProc() and IsDialogMessage() take care of all this - automatically -- however in wxWidgets programs this doesn't work for - nested hierarchies (i.e. a notebook inside a notebook) for unknown - reason and so we have to reproduce all this code ourselves. It would be - very nice if we could avoid doing it. - */ - -// set this button as the (permanently) default one in its panel -void wxButton::SetDefault() -{ - wxTopLevelWindow *tlw = wxDynamicCast(wxGetTopLevelParent(this), wxTopLevelWindow); - - wxCHECK_RET( tlw, _T("button without top level window?") ); - - // set this one as the default button both for wxWidgets ... - wxWindow *winOldDefault = tlw->SetDefaultItem(this); - - // ... and Windows - SetDefaultStyle(wxDynamicCast(winOldDefault, wxButton), false); - SetDefaultStyle(this, true); -} - -// return the top level parent window if it's not being deleted yet, otherwise -// return NULL -static wxTopLevelWindow *GetTLWParentIfNotBeingDeleted(wxWindow *win) -{ - for ( ;; ) - { - // IsTopLevel() will return false for a wxTLW being deleted, so we also - // need the parent test for this case - wxWindow * const parent = win->GetParent(); - if ( !parent || win->IsTopLevel() ) - { - if ( win->IsBeingDeleted() ) - return NULL; - - break; - } - - win = parent; - } - - wxASSERT_MSG( win, _T("button without top level parent?") ); - - wxTopLevelWindow * const tlw = wxDynamicCast(win, wxTopLevelWindow); - wxASSERT_MSG( tlw, _T("logic error in GetTLWParentIfNotBeingDeleted()") ); - - return tlw; -} - -// set this button as being currently default -void wxButton::SetTmpDefault() -{ - wxTopLevelWindow * const tlw = GetTLWParentIfNotBeingDeleted(GetParent()); - if ( !tlw ) - return; - - wxWindow *winOldDefault = tlw->GetDefaultItem(); - tlw->SetTmpDefaultItem(this); - - SetDefaultStyle(wxDynamicCast(winOldDefault, wxButton), false); - SetDefaultStyle(this, true); -} - -// unset this button as currently default, it may still stay permanent default -void wxButton::UnsetTmpDefault() -{ - wxTopLevelWindow * const tlw = GetTLWParentIfNotBeingDeleted(GetParent()); - if ( !tlw ) - return; - - tlw->SetTmpDefaultItem(NULL); - - wxWindow *winOldDefault = tlw->GetDefaultItem(); - - SetDefaultStyle(this, false); - SetDefaultStyle(wxDynamicCast(winOldDefault, wxButton), true); -} - -/* static */ -void -wxButton::SetDefaultStyle(wxButton *btn, bool on) -{ - // we may be called with NULL pointer -- simpler to do the check here than - // in the caller which does wxDynamicCast() - if ( !btn ) - return; - - // first, let DefDlgProc() know about the new default button - if ( on ) - { - // we shouldn't set BS_DEFPUSHBUTTON for any button if we don't have - // focus at all any more - if ( !wxTheApp->IsActive() ) - return; - - wxWindow * const tlw = wxGetTopLevelParent(btn); - wxCHECK_RET( tlw, _T("button without top level window?") ); - - ::SendMessage(GetHwndOf(tlw), DM_SETDEFID, btn->GetId(), 0L); - - // sending DM_SETDEFID also changes the button style to - // BS_DEFPUSHBUTTON so there is nothing more to do - } - - // then also change the style as needed - long style = ::GetWindowLong(GetHwndOf(btn), GWL_STYLE); - if ( !(style & BS_DEFPUSHBUTTON) == on ) - { - // don't do it with the owner drawn buttons because it will - // reset BS_OWNERDRAW style bit too (as BS_OWNERDRAW & - // BS_DEFPUSHBUTTON != 0)! - if ( (style & BS_OWNERDRAW) != BS_OWNERDRAW ) - { - ::SendMessage(GetHwndOf(btn), BM_SETSTYLE, - on ? style | BS_DEFPUSHBUTTON - : style & ~BS_DEFPUSHBUTTON, - 1L /* redraw */); - } - else // owner drawn - { - // redraw the button - it will notice itself that it's - // [not] the default one [any longer] - btn->Refresh(); - } - } - //else: already has correct style -} - -// ---------------------------------------------------------------------------- -// helpers -// ---------------------------------------------------------------------------- - -bool wxButton::SendClickEvent() -{ - wxCommandEvent event(wxEVT_COMMAND_BUTTON_CLICKED, GetId()); - event.SetEventObject(this); - - return ProcessCommand(event); -} - -void wxButton::Command(wxCommandEvent & event) -{ - ProcessCommand(event); -} - -// ---------------------------------------------------------------------------- -// event/message handlers -// ---------------------------------------------------------------------------- - -bool wxButton::MSWCommand(WXUINT param, WXWORD WXUNUSED(id)) -{ - bool processed = false; - switch ( param ) - { - // NOTE: Apparently older versions (NT 4?) of the common controls send - // BN_DOUBLECLICKED but not a second BN_CLICKED for owner-drawn - // buttons, so in order to send two EVT_BUTTON events we should - // catch both types. Currently (Feb 2003) up-to-date versions of - // win98, win2k and winXP all send two BN_CLICKED messages for - // all button types, so we don't catch BN_DOUBLECLICKED anymore - // in order to not get 3 EVT_BUTTON events. If this is a problem - // then we need to figure out which version of the comctl32 changed - // this behaviour and test for it. - - case 1: // message came from an accelerator - case BN_CLICKED: // normal buttons send this - processed = SendClickEvent(); - break; - } - - return processed; -} - -WXLRESULT wxButton::MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam) -{ - // when we receive focus, we want to temporarily become the default button in - // our parent panel so that pressing "Enter" would activate us -- and when - // losing it we should restore the previous default button as well - if ( nMsg == WM_SETFOCUS ) - { - SetTmpDefault(); - - // let the default processing take place too - } - else if ( nMsg == WM_KILLFOCUS ) - { - UnsetTmpDefault(); - } - else if ( nMsg == WM_LBUTTONDBLCLK ) - { - // emulate a click event to force an owner-drawn button to change its - // appearance - without this, it won't do it - (void)wxControl::MSWWindowProc(WM_LBUTTONDOWN, wParam, lParam); - - // and continue with processing the message normally as well - } -#if wxUSE_UXTHEME - else if ( nMsg == WM_THEMECHANGED ) - { - // need to recalculate the best size here - // as the theme size might have changed - InvalidateBestSize(); - } - else if ( wxUxThemeEngine::GetIfActive() ) - { - // we need to Refresh() if mouse has entered or left window - // so we can update the hot tracking state - // must use m_mouseInWindow here instead of IsMouseInWindow() - // since we need to know the first time the mouse enters the window - // and IsMouseInWindow() would return true in this case - if ( ( nMsg == WM_MOUSEMOVE && !m_mouseInWindow ) || - nMsg == WM_MOUSELEAVE ) - { - Refresh(); - } - } -#endif // wxUSE_UXTHEME - - // let the base class do all real processing - return wxControl::MSWWindowProc(nMsg, wParam, lParam); -} - -// ---------------------------------------------------------------------------- -// owner-drawn buttons support -// ---------------------------------------------------------------------------- - -#ifdef __WIN32__ - -// drawing helpers - -static void DrawButtonText(HDC hdc, - RECT *pRect, - const wxString& text, - COLORREF col) -{ - COLORREF colOld = SetTextColor(hdc, col); - int modeOld = SetBkMode(hdc, TRANSPARENT); - - if ( text.find(_T('\n')) != wxString::npos ) - { - // draw multiline label - - // first we need to compute its bounding rect - RECT rc; - ::CopyRect(&rc, pRect); - ::DrawText(hdc, text, text.length(), &rc, DT_CENTER | DT_CALCRECT); - - // now center this rect inside the entire button area - const LONG w = rc.right - rc.left; - const LONG h = rc.bottom - rc.top; - rc.left = (pRect->right - pRect->left)/2 - w/2; - rc.right = rc.left+w; - rc.top = (pRect->bottom - pRect->top)/2 - h/2; - rc.bottom = rc.top+h; - - ::DrawText(hdc, text, text.length(), &rc, DT_CENTER); - } - else // single line label - { - // Note: we must have DT_SINGLELINE for DT_VCENTER to work. - ::DrawText(hdc, text, text.length(), pRect, - DT_SINGLELINE | DT_CENTER | DT_VCENTER); - } - - SetBkMode(hdc, modeOld); - SetTextColor(hdc, colOld); -} - -static void DrawRect(HDC hdc, const RECT& r) -{ - wxDrawLine(hdc, r.left, r.top, r.right, r.top); - wxDrawLine(hdc, r.right, r.top, r.right, r.bottom); - wxDrawLine(hdc, r.right, r.bottom, r.left, r.bottom); - wxDrawLine(hdc, r.left, r.bottom, r.left, r.top); -} - -void wxButton::MakeOwnerDrawn() -{ - long style = GetWindowLong(GetHwnd(), GWL_STYLE); - if ( (style & BS_OWNERDRAW) != BS_OWNERDRAW ) - { - // make it so - style |= BS_OWNERDRAW; - SetWindowLong(GetHwnd(), GWL_STYLE, style); - } -} - -bool wxButton::SetBackgroundColour(const wxColour &colour) -{ - if ( !wxControl::SetBackgroundColour(colour) ) - { - // nothing to do - return false; - } - - MakeOwnerDrawn(); - - Refresh(); - - return true; -} - -bool wxButton::SetForegroundColour(const wxColour &colour) -{ - if ( !wxControl::SetForegroundColour(colour) ) - { - // nothing to do - return false; - } - - MakeOwnerDrawn(); - - Refresh(); - - return true; -} - -/* - The button frame looks like this normally: - - WWWWWWWWWWWWWWWWWWB - WHHHHHHHHHHHHHHHHGB W = white (HILIGHT) - WH GB H = light grey (LIGHT) - WH GB G = dark grey (SHADOW) - WH GB B = black (DKSHADOW) - WH GB - WGGGGGGGGGGGGGGGGGB - BBBBBBBBBBBBBBBBBBB - - When the button is selected, the button becomes like this (the total button - size doesn't change): - - BBBBBBBBBBBBBBBBBBB - BWWWWWWWWWWWWWWWWBB - BWHHHHHHHHHHHHHHGBB - BWH GBB - BWH GBB - BWGGGGGGGGGGGGGGGBB - BBBBBBBBBBBBBBBBBBB - BBBBBBBBBBBBBBBBBBB - - When the button is pushed (while selected) it is like: - - BBBBBBBBBBBBBBBBBBB - BGGGGGGGGGGGGGGGGGB - BG GB - BG GB - BG GB - BG GB - BGGGGGGGGGGGGGGGGGB - BBBBBBBBBBBBBBBBBBB -*/ - -static void DrawButtonFrame(HDC hdc, const RECT& rectBtn, - bool selected, bool pushed) -{ - RECT r; - CopyRect(&r, &rectBtn); - - HPEN hpenBlack = CreatePen(PS_SOLID, 1, GetSysColor(COLOR_3DDKSHADOW)), - hpenGrey = CreatePen(PS_SOLID, 1, GetSysColor(COLOR_3DSHADOW)), - hpenLightGr = CreatePen(PS_SOLID, 1, GetSysColor(COLOR_3DLIGHT)), - hpenWhite = CreatePen(PS_SOLID, 1, GetSysColor(COLOR_3DHILIGHT)); - - HPEN hpenOld = (HPEN)SelectObject(hdc, hpenBlack); - - r.right--; - r.bottom--; - - if ( pushed ) - { - DrawRect(hdc, r); - - (void)SelectObject(hdc, hpenGrey); - ::InflateRect(&r, -1, -1); - - DrawRect(hdc, r); - } - else // !pushed - { - if ( selected ) - { - DrawRect(hdc, r); - - ::InflateRect(&r, -1, -1); - } - - wxDrawLine(hdc, r.left, r.bottom, r.right, r.bottom); - wxDrawLine(hdc, r.right, r.bottom, r.right, r.top - 1); - - (void)SelectObject(hdc, hpenWhite); - wxDrawLine(hdc, r.left, r.bottom - 1, r.left, r.top); - wxDrawLine(hdc, r.left, r.top, r.right, r.top); - - (void)SelectObject(hdc, hpenLightGr); - wxDrawLine(hdc, r.left + 1, r.bottom - 2, r.left + 1, r.top + 1); - wxDrawLine(hdc, r.left + 1, r.top + 1, r.right - 1, r.top + 1); - - (void)SelectObject(hdc, hpenGrey); - wxDrawLine(hdc, r.left + 1, r.bottom - 1, r.right - 1, r.bottom - 1); - wxDrawLine(hdc, r.right - 1, r.bottom - 1, r.right - 1, r.top); - } - - (void)SelectObject(hdc, hpenOld); - DeleteObject(hpenWhite); - DeleteObject(hpenLightGr); - DeleteObject(hpenGrey); - DeleteObject(hpenBlack); -} - -#if wxUSE_UXTHEME -static -void MSWDrawXPBackground(wxButton *button, WXDRAWITEMSTRUCT *wxdis) -{ - LPDRAWITEMSTRUCT lpDIS = (LPDRAWITEMSTRUCT)wxdis; - HDC hdc = lpDIS->hDC; - UINT state = lpDIS->itemState; - RECT rectBtn; - CopyRect(&rectBtn, &lpDIS->rcItem); - - wxUxThemeHandle theme(button, L"BUTTON"); - int iState; - - if ( state & ODS_SELECTED ) - { - iState = PBS_PRESSED; - } - else if ( button->HasCapture() || button->IsMouseInWindow() ) - { - iState = PBS_HOT; - } - else if ( state & ODS_FOCUS ) - { - iState = PBS_DEFAULTED; - } - else if ( state & ODS_DISABLED ) - { - iState = PBS_DISABLED; - } - else - { - iState = PBS_NORMAL; - } - - // draw parent background if needed - if ( wxUxThemeEngine::Get()->IsThemeBackgroundPartiallyTransparent(theme, - BP_PUSHBUTTON, - iState) ) - { - wxUxThemeEngine::Get()->DrawThemeParentBackground(GetHwndOf(button), hdc, &rectBtn); - } - - // draw background - wxUxThemeEngine::Get()->DrawThemeBackground(theme, hdc, BP_PUSHBUTTON, iState, - &rectBtn, NULL); - - // calculate content area margins - MARGINS margins; - wxUxThemeEngine::Get()->GetThemeMargins(theme, hdc, BP_PUSHBUTTON, iState, - TMT_CONTENTMARGINS, &rectBtn, &margins); - RECT rectClient; - ::CopyRect(&rectClient, &rectBtn); - ::InflateRect(&rectClient, -margins.cxLeftWidth, -margins.cyTopHeight); - - // if focused and !nofocus rect - if ( (state & ODS_FOCUS) && !(state & ODS_NOFOCUSRECT) ) - { - DrawFocusRect(hdc, &rectClient); - } - - if ( button->UseBgCol() ) - { - COLORREF colBg = wxColourToRGB(button->GetBackgroundColour()); - HBRUSH hbrushBackground = ::CreateSolidBrush(colBg); - - // don't overwrite the focus rect - ::InflateRect(&rectClient, -1, -1); - FillRect(hdc, &rectClient, hbrushBackground); - ::DeleteObject(hbrushBackground); - } -} -#endif // wxUSE_UXTHEME - -bool wxButton::MSWOnDraw(WXDRAWITEMSTRUCT *wxdis) -{ - LPDRAWITEMSTRUCT lpDIS = (LPDRAWITEMSTRUCT)wxdis; - HDC hdc = lpDIS->hDC; - UINT state = lpDIS->itemState; - RECT rectBtn; - CopyRect(&rectBtn, &lpDIS->rcItem); - -#if wxUSE_UXTHEME - if ( wxUxThemeEngine::GetIfActive() ) - { - MSWDrawXPBackground(this, wxdis); - } - else -#endif // wxUSE_UXTHEME - { - COLORREF colBg = wxColourToRGB(GetBackgroundColour()); - - // first, draw the background - HBRUSH hbrushBackground = ::CreateSolidBrush(colBg); - FillRect(hdc, &rectBtn, hbrushBackground); - ::DeleteObject(hbrushBackground); - - // draw the border for the current state - bool selected = (state & ODS_SELECTED) != 0; - if ( !selected ) - { - wxTopLevelWindow *tlw = wxDynamicCast(wxGetTopLevelParent(this), wxTopLevelWindow); - if ( tlw ) - { - selected = tlw->GetDefaultItem() == this; - } - } - bool pushed = (SendMessage(GetHwnd(), BM_GETSTATE, 0, 0) & BST_PUSHED) != 0; - - DrawButtonFrame(hdc, rectBtn, selected, pushed); - - // if focused and !nofocus rect - if ( (state & ODS_FOCUS) && !(state & ODS_NOFOCUSRECT) ) - { - RECT rectFocus; - CopyRect(&rectFocus, &rectBtn); - - // I don't know where does this constant come from, but this is how - // Windows draws them - InflateRect(&rectFocus, -4, -4); - - DrawFocusRect(hdc, &rectFocus); - } - - if ( pushed ) - { - // the label is shifted by 1 pixel to create "pushed" effect - OffsetRect(&rectBtn, 1, 1); - } - } - - COLORREF colFg = wxColourToRGB(GetForegroundColour()); - if ( state & ODS_DISABLED ) colFg = GetSysColor(COLOR_GRAYTEXT) ; - wxString label = GetLabel(); - if ( state & ODS_NOACCEL ) label = GetLabelText() ; - DrawButtonText(hdc, &rectBtn, label, colFg); - - return true; -} - -#endif // __WIN32__ - -#endif // wxUSE_BUTTON diff --git a/wxWidgets/src/msw/caret.cpp b/wxWidgets/src/msw/caret.cpp deleted file mode 100644 index f8939f31bc..0000000000 --- a/wxWidgets/src/msw/caret.cpp +++ /dev/null @@ -1,188 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: msw/caret.cpp -// Purpose: MSW implementation of wxCaret -// Author: Vadim Zeitlin -// Modified by: -// Created: 23.05.99 -// RCS-ID: $Id: caret.cpp 35650 2005-09-23 12:56:45Z MR $ -// Copyright: (c) wxWidgets team -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -// =========================================================================== -// declarations -// =========================================================================== - -// --------------------------------------------------------------------------- -// headers -// --------------------------------------------------------------------------- - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#ifndef WX_PRECOMP - #include "wx/window.h" - #include "wx/log.h" -#endif // WX_PRECOMP - -#include "wx/caret.h" - -#if wxUSE_CARET - -#include "wx/msw/private.h" - -// --------------------------------------------------------------------------- -// macros -// --------------------------------------------------------------------------- - -#define CALL_CARET_API(api, args) \ - if ( !api args ) \ - wxLogLastError(_T(#api)) - -// =========================================================================== -// implementation -// =========================================================================== - -// --------------------------------------------------------------------------- -// blink time -// --------------------------------------------------------------------------- - -//static -int wxCaretBase::GetBlinkTime() -{ - int blinkTime = ::GetCaretBlinkTime(); - if ( !blinkTime ) - { - wxLogLastError(wxT("GetCaretBlinkTime")); - } - - return blinkTime; -} - -//static -void wxCaretBase::SetBlinkTime(int milliseconds) -{ - CALL_CARET_API(SetCaretBlinkTime, (milliseconds)); -} - -// --------------------------------------------------------------------------- -// creating/destroying the caret -// --------------------------------------------------------------------------- - -bool wxCaret::MSWCreateCaret() -{ - wxASSERT_MSG( GetWindow(), wxT("caret without window cannot be created") ); - wxASSERT_MSG( IsOk(), wxT("caret of zero size cannot be created") ); - - if ( !m_hasCaret ) - { - CALL_CARET_API(CreateCaret, (GetWinHwnd(GetWindow()), 0, - m_width, m_height)); - - m_hasCaret = true; - } - - return m_hasCaret; -} - -void wxCaret::OnSetFocus() -{ - if ( m_countVisible > 0 ) - { - if ( MSWCreateCaret() ) - { - // the caret was recreated but it doesn't remember its position and - // it's not shown - - DoMove(); - DoShow(); - } - } - //else: caret is invisible, don't waste time creating it -} - -void wxCaret::OnKillFocus() -{ - if ( m_hasCaret ) - { - m_hasCaret = false; - - CALL_CARET_API(DestroyCaret, ()); - } -} - -// --------------------------------------------------------------------------- -// showing/hiding the caret -// --------------------------------------------------------------------------- - -void wxCaret::DoShow() -{ - wxASSERT_MSG( GetWindow(), wxT("caret without window cannot be shown") ); - wxASSERT_MSG( IsOk(), wxT("caret of zero size cannot be shown") ); - - // we might not have created the caret yet if we had got the focus first - // and the caret was shown later - so do it now if we have the focus but - // not the caret - if ( !m_hasCaret && (wxWindow::FindFocus() == GetWindow()) ) - { - if ( MSWCreateCaret() ) - { - DoMove(); - } - } - - if ( m_hasCaret ) - { - CALL_CARET_API(ShowCaret, (GetWinHwnd(GetWindow()))); - } - //else: will be shown when we get the focus -} - -void wxCaret::DoHide() -{ - if ( m_hasCaret ) - { - CALL_CARET_API(HideCaret, (GetWinHwnd(GetWindow()))); - } -} - -// --------------------------------------------------------------------------- -// moving the caret -// --------------------------------------------------------------------------- - -void wxCaret::DoMove() -{ - if ( m_hasCaret ) - { - wxASSERT_MSG( wxWindow::FindFocus() == GetWindow(), - wxT("how did we lose focus?") ); - - // for compatibility with the generic version, the coordinates are - // client ones - wxPoint pt = GetWindow()->GetClientAreaOrigin(); - CALL_CARET_API(SetCaretPos, (m_x + pt.x, m_y + pt.y)); - } - //else: we don't have caret right now, nothing to do (this does happen) -} - - -// --------------------------------------------------------------------------- -// resizing the caret -// --------------------------------------------------------------------------- - -void wxCaret::DoSize() -{ - if ( m_hasCaret ) - { - m_hasCaret = false; - CALL_CARET_API(DestroyCaret, ()); - MSWCreateCaret(); - OnSetFocus(); - } -} - -#endif diff --git a/wxWidgets/src/msw/checkbox.cpp b/wxWidgets/src/msw/checkbox.cpp deleted file mode 100644 index f4c19ff989..0000000000 --- a/wxWidgets/src/msw/checkbox.cpp +++ /dev/null @@ -1,588 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/msw/checkbox.cpp -// Purpose: wxCheckBox -// Author: Julian Smart -// Modified by: -// Created: 04/01/98 -// RCS-ID: $Id: checkbox.cpp 40331 2006-07-25 18:47:39Z VZ $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_CHECKBOX - -#include "wx/checkbox.h" - -#ifndef WX_PRECOMP - #include "wx/brush.h" - #include "wx/dcscreen.h" - #include "wx/settings.h" -#endif - -#include "wx/msw/uxtheme.h" -#include "wx/msw/private.h" - -// ---------------------------------------------------------------------------- -// constants -// ---------------------------------------------------------------------------- - -#ifndef BST_UNCHECKED - #define BST_UNCHECKED 0x0000 -#endif - -#ifndef BST_CHECKED - #define BST_CHECKED 0x0001 -#endif - -#ifndef BST_INDETERMINATE - #define BST_INDETERMINATE 0x0002 -#endif - -#ifndef DFCS_HOT - #define DFCS_HOT 0x1000 -#endif - -#ifndef DT_HIDEPREFIX - #define DT_HIDEPREFIX 0x00100000 -#endif - -#ifndef BP_CHECKBOX - #define BP_CHECKBOX 3 -#endif - -// these values are defined in tmschema.h (except the first one) -enum -{ - CBS_INVALID, - CBS_UNCHECKEDNORMAL, - CBS_UNCHECKEDHOT, - CBS_UNCHECKEDPRESSED, - CBS_UNCHECKEDDISABLED, - CBS_CHECKEDNORMAL, - CBS_CHECKEDHOT, - CBS_CHECKEDPRESSED, - CBS_CHECKEDDISABLED, - CBS_MIXEDNORMAL, - CBS_MIXEDHOT, - CBS_MIXEDPRESSED, - CBS_MIXEDDISABLED -}; - -// these are our own -enum -{ - CBS_HOT_OFFSET = 1, - CBS_PRESSED_OFFSET = 2, - CBS_DISABLED_OFFSET = 3 -}; - -// ============================================================================ -// implementation -// ============================================================================ - -#if wxUSE_EXTENDED_RTTI -WX_DEFINE_FLAGS( wxCheckBoxStyle ) - -wxBEGIN_FLAGS( wxCheckBoxStyle ) - // new style border flags, we put them first to - // use them for streaming out - wxFLAGS_MEMBER(wxBORDER_SIMPLE) - wxFLAGS_MEMBER(wxBORDER_SUNKEN) - wxFLAGS_MEMBER(wxBORDER_DOUBLE) - wxFLAGS_MEMBER(wxBORDER_RAISED) - wxFLAGS_MEMBER(wxBORDER_STATIC) - wxFLAGS_MEMBER(wxBORDER_NONE) - - // old style border flags - wxFLAGS_MEMBER(wxSIMPLE_BORDER) - wxFLAGS_MEMBER(wxSUNKEN_BORDER) - wxFLAGS_MEMBER(wxDOUBLE_BORDER) - wxFLAGS_MEMBER(wxRAISED_BORDER) - wxFLAGS_MEMBER(wxSTATIC_BORDER) - wxFLAGS_MEMBER(wxNO_BORDER) - - // standard window styles - wxFLAGS_MEMBER(wxTAB_TRAVERSAL) - wxFLAGS_MEMBER(wxCLIP_CHILDREN) - wxFLAGS_MEMBER(wxTRANSPARENT_WINDOW) - wxFLAGS_MEMBER(wxWANTS_CHARS) - wxFLAGS_MEMBER(wxNO_FULL_REPAINT_ON_RESIZE) - wxFLAGS_MEMBER(wxALWAYS_SHOW_SB ) - wxFLAGS_MEMBER(wxVSCROLL) - wxFLAGS_MEMBER(wxHSCROLL) - -wxEND_FLAGS( wxCheckBoxStyle ) - -IMPLEMENT_DYNAMIC_CLASS_XTI(wxCheckBox, wxControl,"wx/checkbox.h") - -wxBEGIN_PROPERTIES_TABLE(wxCheckBox) - wxEVENT_PROPERTY( Click , wxEVT_COMMAND_CHECKBOX_CLICKED , wxCommandEvent ) - - wxPROPERTY( Font , wxFont , SetFont , GetFont , EMPTY_MACROVALUE , 0 /*flags*/ , wxT("Helpstring") , wxT("group")) - wxPROPERTY( Label,wxString, SetLabel, GetLabel, wxString() , 0 /*flags*/ , wxT("Helpstring") , wxT("group")) - wxPROPERTY( Value ,bool, SetValue, GetValue, EMPTY_MACROVALUE, 0 /*flags*/ , wxT("Helpstring") , wxT("group")) - wxPROPERTY_FLAGS( WindowStyle , wxCheckBoxStyle , long , SetWindowStyleFlag , GetWindowStyleFlag , EMPTY_MACROVALUE, 0 /*flags*/ , wxT("Helpstring") , wxT("group")) // style -wxEND_PROPERTIES_TABLE() - -wxBEGIN_HANDLERS_TABLE(wxCheckBox) -wxEND_HANDLERS_TABLE() - -wxCONSTRUCTOR_6( wxCheckBox , wxWindow* , Parent , wxWindowID , Id , wxString , Label , wxPoint , Position , wxSize , Size , long , WindowStyle ) -#else -IMPLEMENT_DYNAMIC_CLASS(wxCheckBox, wxControl) -#endif - - -// ---------------------------------------------------------------------------- -// wxCheckBox creation -// ---------------------------------------------------------------------------- - -void wxCheckBox::Init() -{ - m_state = wxCHK_UNCHECKED; - m_isPressed = - m_isHot = false; -} - -bool wxCheckBox::Create(wxWindow *parent, - wxWindowID id, - const wxString& label, - const wxPoint& pos, - const wxSize& size, long style, - const wxValidator& validator, - const wxString& name) -{ - Init(); - - if ( !CreateControl(parent, id, pos, size, style, validator, name) ) - return false; - - long msStyle = WS_TABSTOP; - - if ( style & wxCHK_3STATE ) - { - msStyle |= BS_3STATE; - } - else - { - wxASSERT_MSG( !Is3rdStateAllowedForUser(), - wxT("Using wxCH_ALLOW_3RD_STATE_FOR_USER") - wxT(" style flag for a 2-state checkbox is useless") ); - msStyle |= BS_CHECKBOX; - } - - if ( style & wxALIGN_RIGHT ) - { - msStyle |= BS_LEFTTEXT | BS_RIGHT; - } - - return MSWCreateControl(wxT("BUTTON"), msStyle, pos, size, label, 0); -} - -// ---------------------------------------------------------------------------- -// wxCheckBox geometry -// ---------------------------------------------------------------------------- - -wxSize wxCheckBox::DoGetBestSize() const -{ - static int s_checkSize = 0; - - if ( !s_checkSize ) - { - wxScreenDC dc; - dc.SetFont(wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT)); - - s_checkSize = dc.GetCharHeight(); - } - - wxString str = wxGetWindowText(GetHWND()); - - int wCheckbox, hCheckbox; - if ( !str.empty() ) - { - GetTextExtent(GetLabelText(str), &wCheckbox, &hCheckbox); - wCheckbox += s_checkSize + GetCharWidth(); - - if ( hCheckbox < s_checkSize ) - hCheckbox = s_checkSize; - } - else - { - wCheckbox = s_checkSize; - hCheckbox = s_checkSize; - } -#ifdef __WXWINCE__ - hCheckbox += 1; -#endif - - wxSize best(wCheckbox, hCheckbox); - CacheBestSize(best); - return best; -} - -// ---------------------------------------------------------------------------- -// wxCheckBox operations -// ---------------------------------------------------------------------------- - -void wxCheckBox::SetValue(bool val) -{ - Set3StateValue(val ? wxCHK_CHECKED : wxCHK_UNCHECKED); -} - -bool wxCheckBox::GetValue() const -{ - return Get3StateValue() != wxCHK_UNCHECKED; -} - -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); -} - -wxCOMPILE_TIME_ASSERT(wxCHK_UNCHECKED == BST_UNCHECKED - && wxCHK_CHECKED == BST_CHECKED - && wxCHK_UNDETERMINED == BST_INDETERMINATE, EnumValuesIncorrect); - -void wxCheckBox::DoSet3StateValue(wxCheckBoxState state) -{ - m_state = state; - if ( !IsOwnerDrawn() ) - ::SendMessage(GetHwnd(), BM_SETCHECK, (WPARAM) state, 0); - else // owner drawn buttons don't react to this message - Refresh(); -} - -wxCheckBoxState wxCheckBox::DoGet3StateValue() const -{ - return m_state; -} - -bool wxCheckBox::MSWCommand(WXUINT cmd, WXWORD WXUNUSED(id)) -{ - if ( cmd != BN_CLICKED && cmd != BN_DBLCLK ) - return false; - - // first update the value so that user event handler gets the new checkbox - // value - - // ownerdrawn buttons don't manage their state themselves unlike usual - // auto checkboxes so do it ourselves in any case - wxCheckBoxState state; - if ( Is3rdStateAllowedForUser() ) - { - state = (wxCheckBoxState)((m_state + 1) % 3); - } - else // 2 state checkbox (at least from users point of view) - { - // note that wxCHK_UNDETERMINED also becomes unchecked when clicked - state = m_state == wxCHK_UNCHECKED ? wxCHK_CHECKED : wxCHK_UNCHECKED; - } - - DoSet3StateValue(state); - - - // generate the event - wxCommandEvent event(wxEVT_COMMAND_CHECKBOX_CLICKED, m_windowId); - - event.SetInt(state); - event.SetEventObject(this); - ProcessCommand(event); - - return true; -} - -// ---------------------------------------------------------------------------- -// owner drawn checkboxes stuff -// ---------------------------------------------------------------------------- - -bool wxCheckBox::SetForegroundColour(const wxColour& colour) -{ - if ( !wxCheckBoxBase::SetForegroundColour(colour) ) - return false; - - // the only way to change the checkbox foreground colour under Windows XP - // is to owner draw it - if ( wxUxThemeEngine::GetIfActive() ) - MakeOwnerDrawn(colour.Ok()); - - return true; -} - -bool wxCheckBox::IsOwnerDrawn() const -{ - return - (::GetWindowLong(GetHwnd(), GWL_STYLE) & BS_OWNERDRAW) == BS_OWNERDRAW; -} - -void wxCheckBox::MakeOwnerDrawn(bool ownerDrawn) -{ - long style = ::GetWindowLong(GetHwnd(), GWL_STYLE); - - // note that BS_CHECKBOX & BS_OWNERDRAW != 0 so we can't operate on - // them as on independent style bits - if ( ownerDrawn ) - { - style &= ~(BS_CHECKBOX | BS_3STATE); - style |= BS_OWNERDRAW; - - Connect(wxEVT_ENTER_WINDOW, - wxMouseEventHandler(wxCheckBox::OnMouseEnterOrLeave)); - Connect(wxEVT_LEAVE_WINDOW, - wxMouseEventHandler(wxCheckBox::OnMouseEnterOrLeave)); - Connect(wxEVT_LEFT_DOWN, wxMouseEventHandler(wxCheckBox::OnMouseLeft)); - Connect(wxEVT_LEFT_UP, wxMouseEventHandler(wxCheckBox::OnMouseLeft)); - Connect(wxEVT_SET_FOCUS, wxFocusEventHandler(wxCheckBox::OnFocus)); - Connect(wxEVT_KILL_FOCUS, wxFocusEventHandler(wxCheckBox::OnFocus)); - } - else // reset to default colour - { - style &= ~BS_OWNERDRAW; - style |= HasFlag(wxCHK_3STATE) ? BS_3STATE : BS_CHECKBOX; - - Disconnect(wxEVT_ENTER_WINDOW, - wxMouseEventHandler(wxCheckBox::OnMouseEnterOrLeave)); - Disconnect(wxEVT_LEAVE_WINDOW, - wxMouseEventHandler(wxCheckBox::OnMouseEnterOrLeave)); - Disconnect(wxEVT_LEFT_DOWN, wxMouseEventHandler(wxCheckBox::OnMouseLeft)); - Disconnect(wxEVT_LEFT_UP, wxMouseEventHandler(wxCheckBox::OnMouseLeft)); - Disconnect(wxEVT_SET_FOCUS, wxFocusEventHandler(wxCheckBox::OnFocus)); - Disconnect(wxEVT_KILL_FOCUS, wxFocusEventHandler(wxCheckBox::OnFocus)); - } - - ::SetWindowLong(GetHwnd(), GWL_STYLE, style); - - if ( !ownerDrawn ) - { - // ensure that controls state is consistent with internal state - DoSet3StateValue(m_state); - } -} - -void wxCheckBox::OnMouseEnterOrLeave(wxMouseEvent& event) -{ - m_isHot = event.GetEventType() == wxEVT_ENTER_WINDOW; - if ( !m_isHot ) - m_isPressed = false; - - Refresh(); - - event.Skip(); -} - -void wxCheckBox::OnMouseLeft(wxMouseEvent& event) -{ - // TODO: we should capture the mouse here to be notified about left up - // event but this interferes with BN_CLICKED generation so if we - // want to do this we'd need to generate them ourselves - m_isPressed = event.GetEventType() == wxEVT_LEFT_DOWN; - Refresh(); - - event.Skip(); -} - -void wxCheckBox::OnFocus(wxFocusEvent& event) -{ - Refresh(); - - event.Skip(); -} - -bool wxCheckBox::MSWOnDraw(WXDRAWITEMSTRUCT *item) -{ - DRAWITEMSTRUCT *dis = (DRAWITEMSTRUCT *)item; - - if ( !IsOwnerDrawn() || dis->CtlType != ODT_BUTTON ) - return wxCheckBoxBase::MSWOnDraw(item); - - // calculate the rectangles for the check mark itself and the label - HDC hdc = dis->hDC; - RECT& rect = dis->rcItem; - RECT rectCheck, - rectLabel; - rectCheck.top = - rectLabel.top = rect.top; - rectCheck.bottom = - rectLabel.bottom = rect.bottom; - const int checkSize = GetBestSize().y; - const int MARGIN = 3; - - const bool isRightAligned = HasFlag(wxALIGN_RIGHT); - if ( isRightAligned ) - { - rectCheck.right = rect.right; - rectCheck.left = rectCheck.right - checkSize; - - rectLabel.right = rectCheck.left - MARGIN; - rectLabel.left = rect.left; - } - else // normal, left-aligned checkbox - { - rectCheck.left = rect.left; - rectCheck.right = rectCheck.left + checkSize; - - rectLabel.left = rectCheck.right + MARGIN; - rectLabel.right = rect.right; - } - - // show we draw a focus rect? - const bool isFocused = m_isPressed || FindFocus() == this; - - - // draw the checkbox itself: note that this should really, really be in - // wxRendererNative but unfortunately we can't add a new virtual function - // to it without breaking backwards compatibility - - // classic Win32 version -- this can be useful when we move this into - // wxRendererNative -#if defined(__WXWINCE__) || !wxUSE_UXTHEME - UINT state = DFCS_BUTTONCHECK; - if ( !IsEnabled() ) - state |= DFCS_INACTIVE; - switch ( Get3StateValue() ) - { - case wxCHK_CHECKED: - state |= DFCS_CHECKED; - break; - - case wxCHK_UNDETERMINED: - state |= DFCS_PUSHED; - break; - - default: - wxFAIL_MSG( _T("unexpected Get3StateValue() return value") ); - // fall through - - case wxCHK_UNCHECKED: - // no extra styles needed - break; - } - - if ( wxFindWindowAtPoint(wxGetMousePosition()) == this ) - state |= DFCS_HOT; - - if ( !::DrawFrameControl(hdc, &rectCheck, DFC_BUTTON, state) ) - { - wxLogLastError(_T("DrawFrameControl(DFC_BUTTON)")); - } -#else // XP version - wxUxThemeEngine *themeEngine = wxUxThemeEngine::GetIfActive(); - if ( !themeEngine ) - return false; - - wxUxThemeHandle theme(this, L"BUTTON"); - if ( !theme ) - return false; - - int state; - switch ( Get3StateValue() ) - { - case wxCHK_CHECKED: - state = CBS_CHECKEDNORMAL; - break; - - case wxCHK_UNDETERMINED: - state = CBS_MIXEDNORMAL; - break; - - default: - wxFAIL_MSG( _T("unexpected Get3StateValue() return value") ); - // fall through - - case wxCHK_UNCHECKED: - state = CBS_UNCHECKEDNORMAL; - break; - } - - if ( !IsEnabled() ) - state += CBS_DISABLED_OFFSET; - else if ( m_isPressed ) - state += CBS_PRESSED_OFFSET; - else if ( m_isHot ) - state += CBS_HOT_OFFSET; - - HRESULT hr = themeEngine->DrawThemeBackground - ( - theme, - hdc, - BP_CHECKBOX, - state, - &rectCheck, - NULL - ); - if ( FAILED(hr) ) - { - wxLogApiError(_T("DrawThemeBackground(BP_CHECKBOX)"), hr); - } -#endif // 0/1 - - // draw the text - const wxString& label = GetLabel(); - - // first we need to measure it - UINT fmt = DT_NOCLIP; - - // drawing underlying doesn't look well with focus rect (and the native - // control doesn't do it) - if ( isFocused ) - fmt |= DT_HIDEPREFIX; - if ( isRightAligned ) - fmt |= DT_RIGHT; - // TODO: also use DT_HIDEPREFIX if the system is configured so - - // we need to get the label real size first if we have to draw a focus rect - // around it - if ( isFocused ) - { - if ( !::DrawText(hdc, label, label.length(), &rectLabel, - fmt | DT_CALCRECT) ) - { - wxLogLastError(_T("DrawText(DT_CALCRECT)")); - } - } - - if ( !IsEnabled() ) - { - ::SetTextColor(hdc, ::GetSysColor(COLOR_GRAYTEXT)); - } - - if ( !::DrawText(hdc, label, label.length(), &rectLabel, fmt) ) - { - wxLogLastError(_T("DrawText()")); - } - - // finally draw the focus - if ( isFocused ) - { - rectLabel.left--; - rectLabel.right++; - if ( !::DrawFocusRect(hdc, &rectLabel) ) - { - wxLogLastError(_T("DrawFocusRect()")); - } - } - - return true; -} - -#endif // wxUSE_CHECKBOX diff --git a/wxWidgets/src/msw/checklst.cpp b/wxWidgets/src/msw/checklst.cpp deleted file mode 100644 index 765bf66eab..0000000000 --- a/wxWidgets/src/msw/checklst.cpp +++ /dev/null @@ -1,546 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: src/msw/checklst.cpp -// Purpose: implementation of wxCheckListBox class -// Author: Vadim Zeitlin -// Modified by: -// Created: 16.11.97 -// RCS-ID: $Id: checklst.cpp 62511 2009-10-30 14:11:03Z JMS $ -// Copyright: (c) 1998 Vadim Zeitlin -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_CHECKLISTBOX && wxUSE_OWNER_DRAWN - -#include "wx/checklst.h" - -#ifndef WX_PRECOMP - #include "wx/msw/wrapwin.h" - #include "wx/object.h" - #include "wx/colour.h" - #include "wx/font.h" - #include "wx/bitmap.h" - #include "wx/window.h" - #include "wx/listbox.h" - #include "wx/dcmemory.h" - #include "wx/settings.h" - #include "wx/log.h" -#endif - -#include "wx/ownerdrw.h" - -#include - -#include "wx/msw/private.h" - -// ---------------------------------------------------------------------------- -// private functions -// ---------------------------------------------------------------------------- - -// get item (converted to right type) -#define GetItem(n) ((wxCheckListBoxItem *)(GetItem(n))) - -// ============================================================================ -// implementation -// ============================================================================ - - -#if wxUSE_EXTENDED_RTTI -WX_DEFINE_FLAGS( wxCheckListBoxStyle ) - -wxBEGIN_FLAGS( wxCheckListBoxStyle ) - // new style border flags, we put them first to - // use them for streaming out - wxFLAGS_MEMBER(wxBORDER_SIMPLE) - wxFLAGS_MEMBER(wxBORDER_SUNKEN) - wxFLAGS_MEMBER(wxBORDER_DOUBLE) - wxFLAGS_MEMBER(wxBORDER_RAISED) - wxFLAGS_MEMBER(wxBORDER_STATIC) - wxFLAGS_MEMBER(wxBORDER_NONE) - - // old style border flags - wxFLAGS_MEMBER(wxSIMPLE_BORDER) - wxFLAGS_MEMBER(wxSUNKEN_BORDER) - wxFLAGS_MEMBER(wxDOUBLE_BORDER) - wxFLAGS_MEMBER(wxRAISED_BORDER) - wxFLAGS_MEMBER(wxSTATIC_BORDER) - wxFLAGS_MEMBER(wxBORDER) - - // standard window styles - wxFLAGS_MEMBER(wxTAB_TRAVERSAL) - wxFLAGS_MEMBER(wxCLIP_CHILDREN) - wxFLAGS_MEMBER(wxTRANSPARENT_WINDOW) - wxFLAGS_MEMBER(wxWANTS_CHARS) - wxFLAGS_MEMBER(wxFULL_REPAINT_ON_RESIZE) - wxFLAGS_MEMBER(wxALWAYS_SHOW_SB ) - wxFLAGS_MEMBER(wxVSCROLL) - wxFLAGS_MEMBER(wxHSCROLL) - - wxFLAGS_MEMBER(wxLB_SINGLE) - wxFLAGS_MEMBER(wxLB_MULTIPLE) - wxFLAGS_MEMBER(wxLB_EXTENDED) - wxFLAGS_MEMBER(wxLB_HSCROLL) - wxFLAGS_MEMBER(wxLB_ALWAYS_SB) - wxFLAGS_MEMBER(wxLB_NEEDED_SB) - wxFLAGS_MEMBER(wxLB_SORT) - wxFLAGS_MEMBER(wxLB_OWNERDRAW) - -wxEND_FLAGS( wxCheckListBoxStyle ) - -IMPLEMENT_DYNAMIC_CLASS_XTI(wxCheckListBox, wxListBox,"wx/checklst.h") - -wxBEGIN_PROPERTIES_TABLE(wxCheckListBox) - wxEVENT_PROPERTY( Toggle , wxEVT_COMMAND_CHECKLISTBOX_TOGGLED , wxCommandEvent ) - wxPROPERTY_FLAGS( WindowStyle , wxCheckListBoxStyle , long , SetWindowStyleFlag , GetWindowStyleFlag , EMPTY_MACROVALUE , wxLB_OWNERDRAW /*flags*/ , wxT("Helpstring") , wxT("group")) // style -wxEND_PROPERTIES_TABLE() - -wxBEGIN_HANDLERS_TABLE(wxCheckListBox) -wxEND_HANDLERS_TABLE() - -wxCONSTRUCTOR_4( wxCheckListBox , wxWindow* , Parent , wxWindowID , Id , wxPoint , Position , wxSize , Size ) - -#else -IMPLEMENT_DYNAMIC_CLASS(wxCheckListBox, wxListBox) -#endif - -// ---------------------------------------------------------------------------- -// declaration and implementation of wxCheckListBoxItem class -// ---------------------------------------------------------------------------- - -class wxCheckListBoxItem : public wxOwnerDrawn -{ -friend class WXDLLIMPEXP_FWD_CORE wxCheckListBox; -public: - // ctor - wxCheckListBoxItem(wxCheckListBox *pParent, size_t nIndex); - - // drawing functions - virtual bool OnDrawItem(wxDC& dc, const wxRect& rc, wxODAction act, wxODStatus stat); - - // simple accessors and operations - bool IsChecked() const { return m_bChecked; } - - void Check(bool bCheck); - void Toggle() { Check(!IsChecked()); } - - void SendEvent(); - -private: - bool m_bChecked; - wxCheckListBox *m_pParent; - size_t m_nIndex; - - DECLARE_NO_COPY_CLASS(wxCheckListBoxItem) -}; - -wxCheckListBoxItem::wxCheckListBoxItem(wxCheckListBox *pParent, size_t nIndex) - : wxOwnerDrawn(wxEmptyString, true) // checkable -{ - m_bChecked = false; - m_pParent = pParent; - m_nIndex = nIndex; - - // we don't initialize m_nCheckHeight/Width vars because it's - // done in OnMeasure while they are used only in OnDraw and we - // know that there will always be OnMeasure before OnDraw - - // fix appearance for check list boxes: they don't look quite the same as - // menu icons - SetOwnMarginWidth(::GetSystemMetrics(SM_CXMENUCHECK) - - 2*wxSystemSettings::GetMetric(wxSYS_EDGE_X) + 1); - - SetBackgroundColour(pParent->GetBackgroundColour()); -} - -bool wxCheckListBoxItem::OnDrawItem(wxDC& dc, const wxRect& rc, - wxODAction act, wxODStatus stat) -{ - // first draw the label - if ( IsChecked() ) - stat = (wxOwnerDrawn::wxODStatus)(stat | wxOwnerDrawn::wxODChecked); - - if ( !wxOwnerDrawn::OnDrawItem(dc, rc, act, stat) ) - return false; - - - // now draw the check mark part - size_t nCheckWidth = GetDefaultMarginWidth(), - nCheckHeight = m_pParent->GetItemHeight(); - - int x = rc.GetX(), - y = rc.GetY(); - - HDC hdc = (HDC)dc.GetHDC(); - - // create pens, brushes &c - COLORREF colBg = wxColourToRGB(GetBackgroundColour()); - AutoHPEN hpenBack(colBg), - hpenGray(RGB(0xc0, 0xc0, 0xc0)); - - SelectInHDC selPen(hdc, (HGDIOBJ)hpenBack); - AutoHBRUSH hbrBack(colBg); - SelectInHDC selBrush(hdc, hbrBack); - - // erase the background: it could have been filled with the selected colour - Rectangle(hdc, x, y, x + nCheckWidth + 1, rc.GetBottom() + 1); - - // shift check mark 1 pixel to the right, looks better like this - x++; - - if ( IsChecked() ) - { - // first create a monochrome bitmap in a memory DC - MemoryHDC hdcMem(hdc); - MonoBitmap hbmpCheck(nCheckWidth, nCheckHeight); - SelectInHDC selBmp(hdcMem, hbmpCheck); - - // then draw a check mark into it - RECT rect = { 0, 0, nCheckWidth, nCheckHeight }; - ::DrawFrameControl(hdcMem, &rect, -#ifdef __WXWINCE__ - DFC_BUTTON, DFCS_BUTTONCHECK -#else - DFC_MENU, DFCS_MENUCHECK -#endif - ); - - // finally copy it to screen DC - ::BitBlt(hdc, x, y, nCheckWidth, nCheckHeight, hdcMem, 0, 0, SRCCOPY); - } - - // now we draw the smaller rectangle - y++; - nCheckWidth -= 2; - nCheckHeight -= 2; - - // draw hollow gray rectangle - (void)::SelectObject(hdc, (HGDIOBJ)hpenGray); - - SelectInHDC selBrush2(hdc, ::GetStockObject(NULL_BRUSH)); - Rectangle(hdc, x, y, x + nCheckWidth, y + nCheckHeight); - - if (stat & wxODHasFocus) - { - RECT rect; - wxCopyRectToRECT(rc, rect); - DrawFocusRect(hdc, &rect); - } - - return true; -} - -// change the state of the item and redraw it -void wxCheckListBoxItem::Check(bool check) -{ - m_bChecked = check; - - // index may be changed because new items were added/deleted - if ( m_pParent->GetItemIndex(this) != (int)m_nIndex ) - { - // update it - int index = m_pParent->GetItemIndex(this); - - wxASSERT_MSG( index != wxNOT_FOUND, wxT("what does this item do here?") ); - - m_nIndex = (size_t)index; - } - - HWND hwndListbox = (HWND)m_pParent->GetHWND(); - - RECT rcUpdate; - - if ( ::SendMessage(hwndListbox, LB_GETITEMRECT, - m_nIndex, (LPARAM)&rcUpdate) == LB_ERR ) - { - wxLogDebug(wxT("LB_GETITEMRECT failed")); - } - - ::InvalidateRect(hwndListbox, &rcUpdate, FALSE); -} - -// send an "item checked" event -void wxCheckListBoxItem::SendEvent() -{ - wxCommandEvent event(wxEVT_COMMAND_CHECKLISTBOX_TOGGLED, m_pParent->GetId()); - event.SetInt(m_nIndex); - event.SetEventObject(m_pParent); - m_pParent->ProcessCommand(event); -} - -// ---------------------------------------------------------------------------- -// implementation of wxCheckListBox class -// ---------------------------------------------------------------------------- - -// define event table -// ------------------ -BEGIN_EVENT_TABLE(wxCheckListBox, wxListBox) - EVT_KEY_DOWN(wxCheckListBox::OnKeyDown) - EVT_LEFT_DOWN(wxCheckListBox::OnLeftClick) -END_EVENT_TABLE() - -// control creation -// ---------------- - -// def ctor: use Create() to really create the control -wxCheckListBox::wxCheckListBox() -{ -} - -// ctor which creates the associated control -wxCheckListBox::wxCheckListBox(wxWindow *parent, wxWindowID id, - const wxPoint& pos, const wxSize& size, - int nStrings, const wxString choices[], - long style, const wxValidator& val, - const wxString& name) -{ - Create(parent, id, pos, size, nStrings, choices, style, val, name); -} - -wxCheckListBox::wxCheckListBox(wxWindow *parent, wxWindowID id, - const wxPoint& pos, const wxSize& size, - const wxArrayString& choices, - long style, const wxValidator& val, - const wxString& name) -{ - Create(parent, id, pos, size, choices, style, val, 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) -{ - return wxListBox::Create(parent, id, pos, size, n, choices, - style | wxLB_OWNERDRAW, validator, name); -} - -bool wxCheckListBox::Create(wxWindow *parent, wxWindowID id, - const wxPoint& pos, const wxSize& size, - const wxArrayString& choices, - long style, - const wxValidator& validator, const wxString& name) -{ - return wxListBox::Create(parent, id, pos, size, choices, - style | wxLB_OWNERDRAW, validator, name); -} - -// misc overloaded methods -// ----------------------- - -void wxCheckListBox::Delete(unsigned int n) -{ - wxCHECK_RET( IsValid(n), - wxT("invalid index in wxListBox::Delete") ); - - wxListBox::Delete(n); - - // free memory - delete m_aItems[n]; - - m_aItems.RemoveAt(n); -} - -bool wxCheckListBox::SetFont( const wxFont &font ) -{ - unsigned int i; - for ( i = 0; i < m_aItems.GetCount(); i++ ) - m_aItems[i]->SetFont(font); - - wxListBox::SetFont(font); - - return true; -} - -// create/retrieve item -// -------------------- - -// create a check list box item -wxOwnerDrawn *wxCheckListBox::CreateLboxItem(size_t nIndex) -{ - wxCheckListBoxItem *pItem = new wxCheckListBoxItem(this, nIndex); - return pItem; -} - -// return item size -// ---------------- -bool wxCheckListBox::MSWOnMeasure(WXMEASUREITEMSTRUCT *item) -{ - if ( wxListBox::MSWOnMeasure(item) ) { - MEASUREITEMSTRUCT *pStruct = (MEASUREITEMSTRUCT *)item; - - // save item height - m_nItemHeight = pStruct->itemHeight; - - // add place for the check mark - pStruct->itemWidth += wxOwnerDrawn::GetDefaultMarginWidth(); - - return true; - } - - return false; -} - -// check items -// ----------- - -bool wxCheckListBox::IsChecked(unsigned int uiIndex) const -{ - wxCHECK_MSG( IsValid(uiIndex), false, _T("bad wxCheckListBox index") ); - - return GetItem(uiIndex)->IsChecked(); -} - -void wxCheckListBox::Check(unsigned int uiIndex, bool bCheck) -{ - wxCHECK_RET( IsValid(uiIndex), _T("bad wxCheckListBox index") ); - - GetItem(uiIndex)->Check(bCheck); -} - -// process events -// -------------- - -void wxCheckListBox::OnKeyDown(wxKeyEvent& event) -{ - // what do we do? - enum - { - None, - Toggle, - Set, - Clear - } oper; - - switch ( event.GetKeyCode() ) - { - case WXK_SPACE: - oper = Toggle; - break; - - case WXK_NUMPAD_ADD: - case '+': - oper = Set; - break; - - case WXK_NUMPAD_SUBTRACT: - case '-': - oper = Clear; - break; - - default: - oper = None; - } - - if ( oper != None ) - { - wxArrayInt selections; - int count = 0; - if ( HasMultipleSelection() ) - { - count = GetSelections(selections); - } - else - { - int sel = GetSelection(); - if (sel != -1) - { - count = 1; - selections.Add(sel); - } - } - - for ( int i = 0; i < count; i++ ) - { - wxCheckListBoxItem *item = GetItem(selections[i]); - if ( !item ) - { - wxFAIL_MSG( _T("no wxCheckListBoxItem?") ); - continue; - } - - switch ( oper ) - { - case Toggle: - item->Toggle(); - break; - - case Set: - case Clear: - item->Check( oper == Set ); - break; - - default: - wxFAIL_MSG( _T("what should this key do?") ); - } - - // we should send an event as this has been done by the user and - // not by the program - item->SendEvent(); - } - } - else // nothing to do - { - event.Skip(); - } -} - -void wxCheckListBox::OnLeftClick(wxMouseEvent& event) -{ - // clicking on the item selects it, clicking on the checkmark toggles - if ( event.GetX() <= wxOwnerDrawn::GetDefaultMarginWidth() ) - { - int nItem = HitTest(event.GetX(), event.GetY()); - - if ( nItem != wxNOT_FOUND ) - { - wxCheckListBoxItem *item = GetItem(nItem); - item->Toggle(); - item->SendEvent(); - } - //else: it's not an error, just click outside of client zone - } - else - { - // implement default behaviour: clicking on the item selects it - event.Skip(); - } -} - -int wxCheckListBox::DoHitTestItem(wxCoord x, wxCoord y) const -{ - int nItem = (int)::SendMessage - ( - (HWND)GetHWND(), - LB_ITEMFROMPOINT, - 0, - MAKELPARAM(x, y) - ); - - return nItem >= (int)m_noItems ? wxNOT_FOUND : nItem; -} - - -wxSize wxCheckListBox::DoGetBestSize() const -{ - wxSize best = wxListBox::DoGetBestSize(); - best.x += wxOwnerDrawn::GetDefaultMarginWidth(); // add room for the checkbox - CacheBestSize(best); - return best; -} - -#endif diff --git a/wxWidgets/src/msw/choice.cpp b/wxWidgets/src/msw/choice.cpp deleted file mode 100644 index 16619bc2de..0000000000 --- a/wxWidgets/src/msw/choice.cpp +++ /dev/null @@ -1,802 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/msw/choice.cpp -// Purpose: wxChoice -// Author: Julian Smart -// Modified by: Vadim Zeitlin to derive from wxChoiceBase -// Created: 04/01/98 -// RCS-ID: $Id: choice.cpp 51616 2008-02-09 15:22:15Z VZ $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_CHOICE && !(defined(__SMARTPHONE__) && defined(__WXWINCE__)) - -#include "wx/choice.h" - -#ifndef WX_PRECOMP - #include "wx/utils.h" - #include "wx/log.h" - #include "wx/brush.h" - #include "wx/settings.h" -#endif - -#include "wx/msw/private.h" - -#if wxUSE_EXTENDED_RTTI -WX_DEFINE_FLAGS( wxChoiceStyle ) - -wxBEGIN_FLAGS( wxChoiceStyle ) - // new style border flags, we put them first to - // use them for streaming out - wxFLAGS_MEMBER(wxBORDER_SIMPLE) - wxFLAGS_MEMBER(wxBORDER_SUNKEN) - wxFLAGS_MEMBER(wxBORDER_DOUBLE) - wxFLAGS_MEMBER(wxBORDER_RAISED) - wxFLAGS_MEMBER(wxBORDER_STATIC) - wxFLAGS_MEMBER(wxBORDER_NONE) - - // old style border flags - wxFLAGS_MEMBER(wxSIMPLE_BORDER) - wxFLAGS_MEMBER(wxSUNKEN_BORDER) - wxFLAGS_MEMBER(wxDOUBLE_BORDER) - wxFLAGS_MEMBER(wxRAISED_BORDER) - wxFLAGS_MEMBER(wxSTATIC_BORDER) - wxFLAGS_MEMBER(wxBORDER) - - // standard window styles - wxFLAGS_MEMBER(wxTAB_TRAVERSAL) - wxFLAGS_MEMBER(wxCLIP_CHILDREN) - wxFLAGS_MEMBER(wxTRANSPARENT_WINDOW) - wxFLAGS_MEMBER(wxWANTS_CHARS) - wxFLAGS_MEMBER(wxFULL_REPAINT_ON_RESIZE) - wxFLAGS_MEMBER(wxALWAYS_SHOW_SB ) - wxFLAGS_MEMBER(wxVSCROLL) - wxFLAGS_MEMBER(wxHSCROLL) - -wxEND_FLAGS( wxChoiceStyle ) - -IMPLEMENT_DYNAMIC_CLASS_XTI(wxChoice, wxControl,"wx/choice.h") - -wxBEGIN_PROPERTIES_TABLE(wxChoice) - wxEVENT_PROPERTY( Select , wxEVT_COMMAND_CHOICE_SELECTED , wxCommandEvent ) - - wxPROPERTY( Font , wxFont , SetFont , GetFont , EMPTY_MACROVALUE , 0 /*flags*/ , wxT("Helpstring") , wxT("group")) - wxPROPERTY_COLLECTION( Choices , wxArrayString , wxString , AppendString , GetStrings , 0 /*flags*/ , wxT("Helpstring") , wxT("group")) - wxPROPERTY( Selection ,int, SetSelection, GetSelection, EMPTY_MACROVALUE , 0 /*flags*/ , wxT("Helpstring") , wxT("group")) - wxPROPERTY_FLAGS( WindowStyle , wxChoiceStyle , long , SetWindowStyleFlag , GetWindowStyleFlag , EMPTY_MACROVALUE , 0 /*flags*/ , wxT("Helpstring") , wxT("group")) // style -wxEND_PROPERTIES_TABLE() - -wxBEGIN_HANDLERS_TABLE(wxChoice) -wxEND_HANDLERS_TABLE() - -wxCONSTRUCTOR_4( wxChoice , wxWindow* , Parent , wxWindowID , Id , wxPoint , Position , wxSize , Size ) -#else -IMPLEMENT_DYNAMIC_CLASS(wxChoice, wxControl) -#endif -/* - TODO PROPERTIES - selection (long) - content (list) - item -*/ - -// ============================================================================ -// implementation -// ============================================================================ - -// ---------------------------------------------------------------------------- -// creation -// ---------------------------------------------------------------------------- - -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) -{ - // Experience shows that wxChoice vs. wxComboBox distinction confuses - // quite a few people - try to help them - wxASSERT_MSG( !(style & wxCB_DROPDOWN) && - !(style & wxCB_READONLY) && - !(style & wxCB_SIMPLE), - _T("this style flag is ignored by wxChoice, you ") - _T("probably want to use a wxComboBox") ); - - return CreateAndInit(parent, id, pos, size, n, choices, style, - validator, name); -} - -bool wxChoice::CreateAndInit(wxWindow *parent, - wxWindowID id, - const wxPoint& pos, - const wxSize& size, - int n, const wxString choices[], - long style, - const wxValidator& validator, - const wxString& name) -{ - // initialize wxControl - if ( !CreateControl(parent, id, pos, size, style, validator, name) ) - return false; - - // now create the real HWND - if ( !MSWCreateControl(wxT("COMBOBOX"), wxEmptyString, pos, size) ) - return false; - - - // choice/combobox normally has "white" (depends on colour scheme, of - // course) background rather than inheriting the parent's background - SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW)); - - // initialize the controls contents - for ( int i = 0; i < n; i++ ) - { - Append(choices[i]); - } - - // and now we may finally size the control properly (if needed) - SetInitialSize(size); - - return true; -} - -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); -} - -void wxChoice::SetLabel(const wxString& label) -{ - if ( FindString(label) == wxNOT_FOUND ) - { - // unless we explicitly do this here, CB_GETCURSEL will continue to - // return the index of the previously selected item which will result - // in wrongly replacing the value being set now with the previously - // value if the user simply opens and closes (without selecting - // anything) the combobox popup - SetSelection(-1); - } - - wxChoiceBase::SetLabel(label); -} - -bool wxChoice::MSWShouldPreProcessMessage(WXMSG *pMsg) -{ - MSG *msg = (MSG *) pMsg; - - // if the dropdown list is visible, don't preprocess certain keys - if ( msg->message == WM_KEYDOWN - && (msg->wParam == VK_ESCAPE || msg->wParam == VK_RETURN) ) - { - if (::SendMessage(GetHwndOf(this), CB_GETDROPPEDSTATE, 0, 0)) - { - return false; - } - } - - return wxControl::MSWShouldPreProcessMessage(pMsg); -} - -WXDWORD wxChoice::MSWGetStyle(long style, WXDWORD *exstyle) const -{ - // we never have an external border - WXDWORD msStyle = wxControl::MSWGetStyle - ( - (style & ~wxBORDER_MASK) | wxBORDER_NONE, exstyle - ); - - // WS_CLIPSIBLINGS is useful with wxChoice and doesn't seem to result in - // any problems - msStyle |= WS_CLIPSIBLINGS; - - // wxChoice-specific styles - msStyle |= CBS_DROPDOWNLIST | WS_HSCROLL | WS_VSCROLL; - if ( style & wxCB_SORT ) - msStyle |= CBS_SORT; - - return msStyle; -} - -wxChoice::~wxChoice() -{ - Free(); -} - -// ---------------------------------------------------------------------------- -// adding/deleting items to/from the list -// ---------------------------------------------------------------------------- - -int wxChoice::DoAppend(const wxString& item) -{ - int n = (int)SendMessage(GetHwnd(), CB_ADDSTRING, 0, (LPARAM)item.c_str()); - if ( n == CB_ERR ) - { - wxLogLastError(wxT("SendMessage(CB_ADDSTRING)")); - } - else // ok - { - // we need to refresh our size in order to have enough space for the - // newly added items - if ( !IsFrozen() ) - UpdateVisibleHeight(); - } - - InvalidateBestSize(); - return n; -} - -int wxChoice::DoInsert(const wxString& item, unsigned int pos) -{ - wxCHECK_MSG(!(GetWindowStyle() & wxCB_SORT), -1, wxT("can't insert into sorted list")); - wxCHECK_MSG(IsValidInsert(pos), -1, wxT("invalid index")); - - int n = (int)SendMessage(GetHwnd(), CB_INSERTSTRING, pos, (LPARAM)item.c_str()); - if ( n == CB_ERR ) - { - wxLogLastError(wxT("SendMessage(CB_INSERTSTRING)")); - } - else // ok - { - if ( !IsFrozen() ) - UpdateVisibleHeight(); - } - - InvalidateBestSize(); - return n; -} - -void wxChoice::Delete(unsigned int n) -{ - wxCHECK_RET( IsValid(n), wxT("invalid item index in wxChoice::Delete") ); - - if ( HasClientObjectData() ) - { - delete GetClientObject(n); - } - - SendMessage(GetHwnd(), CB_DELETESTRING, n, 0); - - if ( !IsFrozen() ) - UpdateVisibleHeight(); - - InvalidateBestSize(); -} - -void wxChoice::Clear() -{ - Free(); - - SendMessage(GetHwnd(), CB_RESETCONTENT, 0, 0); - - if ( !IsFrozen() ) - UpdateVisibleHeight(); - - InvalidateBestSize(); -} - -void wxChoice::Free() -{ - if ( HasClientObjectData() ) - { - unsigned int count = GetCount(); - for ( unsigned int n = 0; n < count; n++ ) - { - delete GetClientObject(n); - } - } -} - -// ---------------------------------------------------------------------------- -// selection -// ---------------------------------------------------------------------------- - -int wxChoice::GetSelection() const -{ - // if m_lastAcceptedSelection is set, it means that the dropdown is - // currently shown and that we want to use the last "permanent" selection - // instead of whatever is under the mouse pointer currently - // - // otherwise, get the selection from the control - return m_lastAcceptedSelection == wxID_NONE ? GetCurrentSelection() - : m_lastAcceptedSelection; -} - -int wxChoice::GetCurrentSelection() const -{ - return (int)SendMessage(GetHwnd(), CB_GETCURSEL, 0, 0); -} - -void wxChoice::SetSelection(int n) -{ - SendMessage(GetHwnd(), CB_SETCURSEL, n, 0); -} - -// ---------------------------------------------------------------------------- -// string list functions -// ---------------------------------------------------------------------------- - -unsigned int wxChoice::GetCount() const -{ - return (unsigned int)SendMessage(GetHwnd(), CB_GETCOUNT, 0, 0); -} - -int wxChoice::FindString(const wxString& s, bool bCase) const -{ -#if defined(__WATCOMC__) && defined(__WIN386__) - // For some reason, Watcom in WIN386 mode crashes in the CB_FINDSTRINGEXACT message. - // wxChoice::Do it the long way instead. - unsigned int count = GetCount(); - for ( unsigned int i = 0; i < count; i++ ) - { - // as CB_FINDSTRINGEXACT is case insensitive, be case insensitive too - if (GetString(i).IsSameAs(s, bCase)) - return i; - } - - return wxNOT_FOUND; -#else // !Watcom - //TODO: Evidently some MSW versions (all?) don't like empty strings - //passed to SendMessage, so we have to do it ourselves in that case - if ( s.empty() ) - { - unsigned int count = GetCount(); - for ( unsigned int i = 0; i < count; i++ ) - { - if (GetString(i).empty()) - return i; - } - - return wxNOT_FOUND; - } - else if (bCase) - { - // back to base class search for not native search type - return wxItemContainerImmutable::FindString( s, bCase ); - } - else - { - int pos = (int)SendMessage(GetHwnd(), CB_FINDSTRINGEXACT, - (WPARAM)-1, (LPARAM)s.c_str()); - - return pos == LB_ERR ? wxNOT_FOUND : pos; - } -#endif // Watcom/!Watcom -} - -void wxChoice::SetString(unsigned int n, const wxString& s) -{ - wxCHECK_RET( IsValid(n), wxT("invalid item index in wxChoice::SetString") ); - - // we have to delete and add back the string as there is no way to change a - // string in place - - // we need to preserve the client data - void *data; - if ( m_clientDataItemsType != wxClientData_None ) - { - data = DoGetItemClientData(n); - } - else // no client data - { - data = NULL; - } - - ::SendMessage(GetHwnd(), CB_DELETESTRING, n, 0); - ::SendMessage(GetHwnd(), CB_INSERTSTRING, n, (LPARAM)s.c_str() ); - - if ( data ) - { - DoSetItemClientData(n, data); - } - //else: it's already NULL by default - - InvalidateBestSize(); -} - -wxString wxChoice::GetString(unsigned int n) const -{ - int len = (int)::SendMessage(GetHwnd(), CB_GETLBTEXTLEN, n, 0); - - wxString str; - if ( len != CB_ERR && len > 0 ) - { - if ( ::SendMessage - ( - GetHwnd(), - CB_GETLBTEXT, - n, - (LPARAM)(wxChar *)wxStringBuffer(str, len) - ) == CB_ERR ) - { - wxLogLastError(wxT("SendMessage(CB_GETLBTEXT)")); - } - } - - return str; -} - -// ---------------------------------------------------------------------------- -// client data -// ---------------------------------------------------------------------------- - -void wxChoice::DoSetItemClientData(unsigned int n, void* clientData) -{ - if ( ::SendMessage(GetHwnd(), CB_SETITEMDATA, - n, (LPARAM)clientData) == CB_ERR ) - { - wxLogLastError(wxT("CB_SETITEMDATA")); - } -} - -void* wxChoice::DoGetItemClientData(unsigned int n) const -{ - LPARAM rc = SendMessage(GetHwnd(), CB_GETITEMDATA, n, 0); - if ( rc == CB_ERR ) - { - wxLogLastError(wxT("CB_GETITEMDATA")); - - // unfortunately, there is no way to return an error code to the user - rc = (LPARAM) NULL; - } - - return (void *)rc; -} - -void wxChoice::DoSetItemClientObject(unsigned int n, wxClientData* clientData) -{ - DoSetItemClientData(n, clientData); -} - -wxClientData* wxChoice::DoGetItemClientObject(unsigned int n) const -{ - return (wxClientData *)DoGetItemClientData(n); -} - -// ---------------------------------------------------------------------------- -// wxMSW specific helpers -// ---------------------------------------------------------------------------- - -void wxChoice::UpdateVisibleHeight() -{ - // be careful to not change the width here - DoSetSize(wxDefaultCoord, wxDefaultCoord, wxDefaultCoord, GetSize().y, wxSIZE_USE_EXISTING); -} - -void wxChoice::DoMoveWindow(int x, int y, int width, int height) -{ - // here is why this is necessary: if the width is negative, the combobox - // window proc makes the window of the size width*height instead of - // interpreting height in the usual manner (meaning the height of the drop - // down list - usually the height specified in the call to MoveWindow() - // will not change the height of combo box per se) - // - // this behaviour is not documented anywhere, but this is just how it is - // here (NT 4.4) and, anyhow, the check shouldn't hurt - however without - // the check, constraints/sizers using combos may break the height - // constraint will have not at all the same value as expected - if ( width < 0 ) - return; - - wxControl::DoMoveWindow(x, y, width, height); -} - -void wxChoice::DoGetSize(int *w, int *h) const -{ - // this is weird: sometimes, the height returned by Windows is clearly the - // total height of the control including the drop down list -- but only - // sometimes, and normally it isn't... I have no idea about what to do with - // this - wxControl::DoGetSize(w, h); -} - -void wxChoice::DoSetSize(int x, int y, - int width, int height, - int sizeFlags) -{ - int heightOrig = height; - - // the height which we must pass to Windows should be the total height of - // the control including the drop down list while the height given to us - // is, of course, just the height of the permanently visible part of it - if ( height != wxDefaultCoord ) - { - // don't make the drop down list too tall, arbitrarily limit it to 40 - // items max and also don't leave it empty - size_t nItems = GetCount(); - if ( !nItems ) - nItems = 9; - else if ( nItems > 24 ) - nItems = 24; - - // add space for the drop down list - const int hItem = SendMessage(GetHwnd(), CB_GETITEMHEIGHT, 0, 0); - height += hItem*(nItems + 1); - } - else - { - // We cannot pass wxDefaultCoord as height to wxControl. wxControl uses - // wxGetWindowRect() to determine the current height of the combobox, - // and then again sets the combobox's height to that value. Unfortunately, - // wxGetWindowRect doesn't include the dropdown list's height (at least - // on Win2K), so this would result in a combobox with dropdown height of - // 1 pixel. We have to determine the default height ourselves and call - // wxControl with that value instead. - int w, h; - RECT r; - DoGetSize(&w, &h); - if (::SendMessage(GetHwnd(), CB_GETDROPPEDCONTROLRECT, 0, (LPARAM) &r) != 0) - { - height = h + r.bottom - r.top; - } - } - - wxControl::DoSetSize(x, y, width, height, sizeFlags); - - // If we're storing a pending size, make sure we store - // the original size for reporting back to the app. - if (m_pendingSize != wxDefaultSize) - m_pendingSize = wxSize(width, heightOrig); - - // This solution works on XP, but causes choice/combobox lists to be - // too short on W2K and earlier. -#if 0 - int widthCurrent, heightCurrent; - DoGetSize(&widthCurrent, &heightCurrent); - - // the height which we must pass to Windows should be the total height of - // the control including the drop down list while the height given to us - // is, of course, just the height of the permanently visible part of it - if ( height != wxDefaultCoord && height != heightCurrent ) - { - // don't make the drop down list too tall, arbitrarily limit it to 40 - // items max and also don't leave it empty - unsigned int nItems = GetCount(); - if ( !nItems ) - nItems = 9; - else if ( nItems > 24 ) - nItems = 24; - - // add space for the drop down list - const int hItem = SendMessage(GetHwnd(), CB_GETITEMHEIGHT, 0, 0); - height += hItem*(nItems + 1); - } - else // keep the same height as now - { - // normally wxWindow::DoSetSize() checks if we set the same size as the - // window already has and does nothing in this case, but for us the - // check fails as the size we pass to it includes the dropdown while - // the size returned by our GetSize() does not, so test if the size - // didn't really change ourselves here - if ( width == wxDefaultCoord || width == widthCurrent ) - { - // size doesn't change, what about position? - int xCurrent, yCurrent; - DoGetPosition(&xCurrent, &yCurrent); - const bool defMeansUnchanged = !(sizeFlags & wxSIZE_ALLOW_MINUS_ONE); - if ( ((x == wxDefaultCoord && defMeansUnchanged) || x == xCurrent) - && - ((y == wxDefaultCoord && defMeansUnchanged) || y == yCurrent) ) - { - // nothing changes, nothing to do - return; - } - } - - // We cannot pass wxDefaultCoord as height to wxControl. wxControl uses - // wxGetWindowRect() to determine the current height of the combobox, - // and then again sets the combobox's height to that value. Unfortunately, - // wxGetWindowRect doesn't include the dropdown list's height (at least - // on Win2K), so this would result in a combobox with dropdown height of - // 1 pixel. We have to determine the default height ourselves and call - // wxControl with that value instead. - // - // Also notice that sometimes CB_GETDROPPEDCONTROLRECT seems to return - // wildly incorrect values (~32000) which looks like a bug in it, just - // ignore them in this case - RECT r; - if ( ::SendMessage(GetHwnd(), CB_GETDROPPEDCONTROLRECT, 0, (LPARAM) &r) - && r.bottom < 30000 ) - { - height = heightCurrent + r.bottom - r.top; - } - } - - wxControl::DoSetSize(x, y, width, height, sizeFlags); -#endif -} - -wxSize wxChoice::DoGetBestSize() const -{ - // find the widest string - int wChoice = 0; - const unsigned int nItems = GetCount(); - for ( unsigned int i = 0; i < nItems; i++ ) - { - int wLine; - GetTextExtent(GetString(i), &wLine, NULL); - if ( wLine > wChoice ) - wChoice = wLine; - } - - // give it some reasonable default value if there are no strings in the - // list - if ( wChoice == 0 ) - wChoice = 100; - - // the combobox should be slightly larger than the widest string - wChoice += 5*GetCharWidth(); - - wxSize best(wChoice, EDIT_HEIGHT_FROM_CHAR_HEIGHT(GetCharHeight())); - CacheBestSize(best); - return best; -} - -WXLRESULT wxChoice::MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam) -{ - switch ( nMsg ) - { - case WM_LBUTTONUP: - { - int x = (int)LOWORD(lParam); - int y = (int)HIWORD(lParam); - - // Ok, this is truly weird, but if a panel with a wxChoice - // loses the focus, then you get a *fake* WM_LBUTTONUP message - // with x = 65535 and y = 65535. Filter out this nonsense. - // - // VZ: I'd like to know how to reproduce this please... - if ( x == 65535 && y == 65535 ) - return 0; - } - break; - - // we have to handle both: one for the normal case and the other - // for readonly - case WM_CTLCOLOREDIT: - case WM_CTLCOLORLISTBOX: - case WM_CTLCOLORSTATIC: - { - WXHDC hdc; - WXHWND hwnd; - UnpackCtlColor(wParam, lParam, &hdc, &hwnd); - - WXHBRUSH hbr = MSWControlColor((WXHDC)hdc, hwnd); - if ( hbr ) - return (WXLRESULT)hbr; - //else: fall through to default window proc - } - } - - return wxWindow::MSWWindowProc(nMsg, wParam, lParam); -} - -bool wxChoice::MSWCommand(WXUINT param, WXWORD WXUNUSED(id)) -{ - /* - The native control provides a great variety in the events it sends in - the different selection scenarios (undoubtedly for greater amusement of - the programmers using it). For the reference, here are the cases when - the final selection is accepted (things are quite interesting when it - is cancelled too): - - A. Selecting with just the arrows without opening the dropdown: - 1. CBN_SELENDOK - 2. CBN_SELCHANGE - - B. Opening dropdown with F4 and selecting with arrows: - 1. CBN_DROPDOWN - 2. many CBN_SELCHANGE while changing selection in the list - 3. CBN_SELENDOK - 4. CBN_CLOSEUP - - C. Selecting with the mouse: - 1. CBN_DROPDOWN - -- no intermediate CBN_SELCHANGEs -- - 2. CBN_SELENDOK - 3. CBN_CLOSEUP - 4. CBN_SELCHANGE - - Admire the different order of messages in all of those cases, it must - surely have taken a lot of effort to Microsoft developers to achieve - such originality. - */ - switch ( param ) - { - case CBN_DROPDOWN: - // we use this value both because we don't want to track selection - // using CB_GETCURSEL while the dropdown is opened and because we - // need to reset the selection back to it if it's eventually - // cancelled by user - m_lastAcceptedSelection = GetCurrentSelection(); - if ( m_lastAcceptedSelection == -1 ) - { - // no current selection so no need to restore it later (this - // happens when opening a combobox containing text not from its - // list of items and we shouldn't erase this text) - m_lastAcceptedSelection = wxID_NONE; - } - break; - - case CBN_CLOSEUP: - // if the selection was accepted by the user, it should have been - // reset to wxID_NONE by CBN_SELENDOK, otherwise the selection was - // cancelled and we must restore the old one - if ( m_lastAcceptedSelection != wxID_NONE ) - { - SetSelection(m_lastAcceptedSelection); - m_lastAcceptedSelection = wxID_NONE; - } - break; - - case CBN_SELENDOK: - // reset it to prevent CBN_CLOSEUP from undoing the selection (it's - // ok to reset it now as GetCurrentSelection() will now return the - // same thing anyhow) - m_lastAcceptedSelection = wxID_NONE; - - { - const int n = GetSelection(); - - wxCommandEvent event(wxEVT_COMMAND_CHOICE_SELECTED, m_windowId); - event.SetInt(n); - event.SetEventObject(this); - - if ( n > -1 ) - { - event.SetString(GetStringSelection()); - InitCommandEventWithItems(event, n); - } - - ProcessCommand(event); - } - break; - - // don't handle CBN_SELENDCANCEL: just leave m_lastAcceptedSelection - // valid and the selection will be undone in CBN_CLOSEUP above - - // don't handle CBN_SELCHANGE neither, we don't want to generate events - // while the dropdown is opened -- but do add it if we ever need this - - default: - return false; - } - - return true; -} - -WXHBRUSH wxChoice::MSWControlColor(WXHDC hDC, WXHWND hWnd) -{ - if ( !IsEnabled() ) - return MSWControlColorDisabled(hDC); - - return wxChoiceBase::MSWControlColor(hDC, hWnd); -} - -#endif // wxUSE_CHOICE && !(__SMARTPHONE__ && __WXWINCE__) diff --git a/wxWidgets/src/msw/clipbrd.cpp b/wxWidgets/src/msw/clipbrd.cpp deleted file mode 100644 index a87267b464..0000000000 --- a/wxWidgets/src/msw/clipbrd.cpp +++ /dev/null @@ -1,931 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/msw/clipbrd.cpp -// Purpose: Clipboard functionality -// Author: Julian Smart -// Modified by: -// Created: 04/01/98 -// RCS-ID: $Id: clipbrd.cpp 43884 2006-12-09 19:49:40Z PC $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// =========================================================================== -// declarations -// =========================================================================== - -// --------------------------------------------------------------------------- -// headers -// --------------------------------------------------------------------------- - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_CLIPBOARD - -#include "wx/clipbrd.h" - -#ifndef WX_PRECOMP - #include "wx/object.h" - #include "wx/event.h" - #include "wx/app.h" - #include "wx/frame.h" - #include "wx/bitmap.h" - #include "wx/utils.h" - #include "wx/intl.h" - #include "wx/log.h" - #include "wx/dataobj.h" -#endif - -#if wxUSE_METAFILE - #include "wx/metafile.h" -#endif - - -#include - -#include "wx/msw/private.h" -#include "wx/msw/ole/oleutils.h" - -#if wxUSE_WXDIB - #include "wx/msw/dib.h" -#endif - -// wxDataObject is tied to OLE/drag and drop implementation, therefore so are -// the functions using wxDataObject in wxClipboard -//#define wxUSE_DATAOBJ wxUSE_DRAG_AND_DROP - -#if wxUSE_OLE && !defined(__WXWINCE__) - // use OLE clipboard - #define wxUSE_OLE_CLIPBOARD 1 -#else // !wxUSE_DATAOBJ - // use Win clipboard API - #define wxUSE_OLE_CLIPBOARD 0 -#endif - -#if wxUSE_OLE_CLIPBOARD - #include -#endif // wxUSE_OLE_CLIPBOARD - -// =========================================================================== -// implementation -// =========================================================================== - -// --------------------------------------------------------------------------- -// old-style clipboard functions using Windows API -// --------------------------------------------------------------------------- - -static bool gs_wxClipboardIsOpen = false; - -bool wxOpenClipboard() -{ - wxCHECK_MSG( !gs_wxClipboardIsOpen, true, wxT("clipboard already opened.") ); - - wxWindow *win = wxTheApp->GetTopWindow(); - if ( win ) - { - gs_wxClipboardIsOpen = ::OpenClipboard((HWND)win->GetHWND()) != 0; - - if ( !gs_wxClipboardIsOpen ) - wxLogSysError(_("Failed to open the clipboard.")); - - return gs_wxClipboardIsOpen; - } - else - { - wxLogDebug(wxT("Can not open clipboard without a main window.")); - - return false; - } -} - -bool wxCloseClipboard() -{ - wxCHECK_MSG( gs_wxClipboardIsOpen, false, wxT("clipboard is not opened") ); - - gs_wxClipboardIsOpen = false; - - if ( ::CloseClipboard() == 0 ) - { - wxLogSysError(_("Failed to close the clipboard.")); - - return false; - } - - return true; -} - -bool wxEmptyClipboard() -{ - if ( ::EmptyClipboard() == 0 ) - { - wxLogSysError(_("Failed to empty the clipboard.")); - - return false; - } - - return true; -} - -bool wxIsClipboardOpened() -{ - return gs_wxClipboardIsOpen; -} - -bool wxIsClipboardFormatAvailable(wxDataFormat dataFormat) -{ - wxDataFormat::NativeFormat cf = dataFormat.GetFormatId(); - - if ( ::IsClipboardFormatAvailable(cf) ) - { - // ok from the first try - return true; - } - - // for several standard formats, we can convert from some other ones too - switch ( cf ) - { - // for bitmaps, DIBs will also do - case CF_BITMAP: - return ::IsClipboardFormatAvailable(CF_DIB) != 0; - -#if wxUSE_ENH_METAFILE && !defined(__WXWINCE__) - case CF_METAFILEPICT: - return ::IsClipboardFormatAvailable(CF_ENHMETAFILE) != 0; -#endif // wxUSE_ENH_METAFILE - - default: - return false; - } -} - - -bool wxSetClipboardData(wxDataFormat dataFormat, - const void *data, - int width, int height) -{ - HANDLE handle = 0; // return value of SetClipboardData - - switch (dataFormat) - { - case wxDF_BITMAP: - { - wxBitmap *bitmap = (wxBitmap *)data; - - HDC hdcMem = CreateCompatibleDC((HDC) NULL); - HDC hdcSrc = CreateCompatibleDC((HDC) NULL); - HBITMAP old = (HBITMAP) - ::SelectObject(hdcSrc, (HBITMAP)bitmap->GetHBITMAP()); - HBITMAP hBitmap = CreateCompatibleBitmap(hdcSrc, - bitmap->GetWidth(), - bitmap->GetHeight()); - if (!hBitmap) - { - SelectObject(hdcSrc, old); - DeleteDC(hdcMem); - DeleteDC(hdcSrc); - return false; - } - - HBITMAP old1 = (HBITMAP) SelectObject(hdcMem, hBitmap); - BitBlt(hdcMem, 0, 0, bitmap->GetWidth(), bitmap->GetHeight(), - hdcSrc, 0, 0, SRCCOPY); - - // Select new bitmap out of memory DC - SelectObject(hdcMem, old1); - - // Set the data - handle = ::SetClipboardData(CF_BITMAP, hBitmap); - - // Clean up - SelectObject(hdcSrc, old); - DeleteDC(hdcSrc); - DeleteDC(hdcMem); - break; - } - -#if wxUSE_WXDIB - case wxDF_DIB: - { - wxBitmap *bitmap = (wxBitmap *)data; - - if ( bitmap && bitmap->Ok() ) - { - wxDIB dib(*bitmap); - if ( dib.IsOk() ) - { - handle = ::SetClipboardData(CF_DIB, dib.Detach()); - } - } - break; - } -#endif - - // VZ: I'm told that this code works, but it doesn't seem to work for me - // and, anyhow, I'd be highly surprised if it did. So I leave it here - // but IMNSHO it is completely broken. -#if wxUSE_METAFILE && !defined(wxMETAFILE_IS_ENH) && !defined(__WXWINCE__) - case wxDF_METAFILE: - { - wxMetafile *wxMF = (wxMetafile *)data; - HANDLE data = GlobalAlloc(GHND, sizeof(METAFILEPICT) + 1); - METAFILEPICT *mf = (METAFILEPICT *)GlobalLock(data); - - mf->mm = wxMF->GetWindowsMappingMode(); - mf->xExt = width; - mf->yExt = height; - mf->hMF = (HMETAFILE) wxMF->GetHMETAFILE(); - GlobalUnlock(data); - wxMF->SetHMETAFILE((WXHANDLE) NULL); - - handle = SetClipboardData(CF_METAFILEPICT, data); - break; - } -#endif // wxUSE_METAFILE - -#if wxUSE_ENH_METAFILE && !defined(__WXWINCE__) - case wxDF_ENHMETAFILE: - { - wxEnhMetaFile *emf = (wxEnhMetaFile *)data; - wxEnhMetaFile emfCopy = *emf; - - handle = SetClipboardData(CF_ENHMETAFILE, - (void *)emfCopy.GetHENHMETAFILE()); - } - break; -#endif // wxUSE_ENH_METAFILE - - case CF_SYLK: - case CF_DIF: - case CF_TIFF: - case CF_PALETTE: - default: - { - wxLogError(_("Unsupported clipboard format.")); - return false; - } - - case wxDF_OEMTEXT: - dataFormat = wxDF_TEXT; - // fall through - - case wxDF_TEXT: - { - char *s = (char *)data; - - width = strlen(s) + 1; - height = 1; - DWORD l = (width * height); - HANDLE hGlobalMemory = GlobalAlloc(GHND, l); - if ( hGlobalMemory ) - { - LPSTR lpGlobalMemory = (LPSTR)GlobalLock(hGlobalMemory); - - memcpy(lpGlobalMemory, s, l); - - GlobalUnlock(hGlobalMemory); - } - - handle = SetClipboardData(dataFormat, hGlobalMemory); - break; - } - // Only tested with Visual C++ 6.0 so far -#if defined(__VISUALC__) - case wxDF_HTML: - { - char* html = (char *)data; - - // Create temporary buffer for HTML header... - char *buf = new char [400 + strlen(html)]; - if(!buf) return false; - - // Get clipboard id for HTML format... - static int cfid = 0; - if(!cfid) cfid = RegisterClipboardFormat(wxT("HTML Format")); - - // Create a template string for the HTML header... - strcpy(buf, - "Version:0.9\r\n" - "StartHTML:00000000\r\n" - "EndHTML:00000000\r\n" - "StartFragment:00000000\r\n" - "EndFragment:00000000\r\n" - "\r\n" - "\r\n"); - - // Append the HTML... - strcat(buf, html); - strcat(buf, "\r\n"); - // Finish up the HTML format... - strcat(buf, - "\r\n" - "\r\n" - ""); - - // Now go back, calculate all the lengths, and write out the - // necessary header information. Note, wsprintf() truncates the - // string when you overwrite it so you follow up with code to replace - // the 0 appended at the end with a '\r'... - char *ptr = strstr(buf, "StartHTML"); - sprintf(ptr+10, "%08u", strstr(buf, "") - buf); - *(ptr+10+8) = '\r'; - - ptr = strstr(buf, "EndHTML"); - sprintf(ptr+8, "%08u", strlen(buf)); - *(ptr+8+8) = '\r'; - - ptr = strstr(buf, "StartFragment"); - sprintf(ptr+14, "%08u", strstr(buf, " - UserSourceTrees - - - AlwaysSearchUserPathstrue - InterpretDOSAndUnixPathstrue - RequireFrameworkStyleIncludesfalse - UserSearchPaths - - SearchPath - Path: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path::zlib: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SystemSearchPaths - - SearchPath - Path:MSL: - PathFormatMacOS - PathRootCodeWarrior - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:MacOS Support: - PathFormatMacOS - PathRootCodeWarrior - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - - - MWRuntimeSettings_WorkingDirectory - MWRuntimeSettings_CommandLine - MWRuntimeSettings_HostApplication - Path - PathFormatGeneric - PathRootAbsolute - - MWRuntimeSettings_EnvVars - - - LinkerMacOS PPC Linker - PreLinker - PostLinker - TargetnamePPC - OutputDirectory - Path:::lib: - PathFormatMacOS - PathRootProject - - SaveEntriesUsingRelativePathsfalse - - - FileMappings - - FileTypeAPPL - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypeAppl - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypeMMLB - FileExtension - CompilerLib Import PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeMPLF - FileExtension - CompilerLib Import PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeMWCD - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypeRSRC - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.bh - CompilerBalloon Help - EditLanguageBalloon Help - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.c - CompilerMW C/C++ PPC - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.c++ - CompilerMW C/C++ PPC - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.cc - CompilerMW C/C++ PPC - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.cp - CompilerMW C/C++ PPC - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.cpp - CompilerMW C/C++ PPC - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.exp - Compiler - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.h - CompilerMW C/C++ PPC - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMaketrue - - - FileTypeTEXT - FileExtension.p - CompilerMW Pascal PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.pas - CompilerMW Pascal PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.pch - CompilerMW C/C++ PPC - EditLanguageC/C++ - Precompiletrue - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.pch++ - CompilerMW C/C++ PPC - EditLanguageC/C++ - Precompiletrue - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.ppu - CompilerMW Pascal PPC - EditLanguage - Precompiletrue - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.r - CompilerRez - EditLanguageRez - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.s - CompilerPPCAsm - EditLanguageBalloon Help - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeXCOF - FileExtension - CompilerXCOFF Import PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypedocu - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypersrc - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypeshlb - FileExtension - CompilerPEF Import PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypestub - FileExtension - CompilerPEF Import PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileExtension.doc - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFilefalse - IgnoredByMaketrue - - - FileExtension.o - CompilerXCOFF Import PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileExtension.ppob - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileExtension.rsrc - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - - - CacheModDatestrue - DumpBrowserInfofalse - CacheSubprojectstrue - UseThirdPartyDebuggerfalse - BrowserGenerator1 - DebuggerAppPath - Path - PathFormatGeneric - PathRootAbsolute - - DebuggerCmdLineArgs - DebuggerWorkingDir - Path - PathFormatGeneric - PathRootAbsolute - - CodeCompletionPrefixFileNameMacHeaders.c - CodeCompletionMacroFileNameMacOS_Carbon_C++_Macros.h - - - ConsoleEncoding0 - LogSystemMessagestrue - AutoTargetDLLsfalse - StopAtWatchpointstrue - PauseWhileRunningfalse - PauseInterval5 - PauseUIFlags0 - AltExePath - Path - PathFormatGeneric - PathRootAbsolute - - StopAtTempBPOnLaunchtrue - CacheSymbolicstrue - TempBPFunctionNamemain - TempBPType0 - - - Enabledfalse - ConnectionName - DownloadPath - LaunchRemoteAppfalse - RemoteAppPath - CoreID0 - JTAGClockSpeed8000 - IsMultiCorefalse - OSDownloadfalse - UseGlobalOSDownloadfalse - OSDownloadConnectionName - OSDownloadPath - AltDownloadfalse - AltDownloadConnectionName - - - OtherExecutables - - - CustomColor1 - Red0 - Green32767 - Blue0 - - CustomColor2 - Red0 - Green32767 - Blue0 - - CustomColor3 - Red0 - Green32767 - Blue0 - - CustomColor4 - Red0 - Green32767 - Blue0 - - - - MWFrontEnd_C_cplusplus0 - MWFrontEnd_C_checkprotos0 - MWFrontEnd_C_arm0 - MWFrontEnd_C_trigraphs0 - MWFrontEnd_C_onlystdkeywords0 - MWFrontEnd_C_enumsalwaysint0 - MWFrontEnd_C_mpwpointerstyle0 - MWFrontEnd_C_prefixname - MWFrontEnd_C_ansistrict0 - MWFrontEnd_C_mpwcnewline0 - MWFrontEnd_C_wchar_type1 - MWFrontEnd_C_enableexceptions1 - MWFrontEnd_C_dontreusestrings0 - MWFrontEnd_C_poolstrings0 - MWFrontEnd_C_dontinline0 - MWFrontEnd_C_useRTTI1 - MWFrontEnd_C_multibyteaware0 - MWFrontEnd_C_unsignedchars0 - MWFrontEnd_C_autoinline0 - MWFrontEnd_C_booltruefalse1 - MWFrontEnd_C_inlinelevel0 - MWFrontEnd_C_ecplusplus0 - MWFrontEnd_C_objective_c0 - MWFrontEnd_C_defer_codegen0 - MWFrontEnd_C_templateparser0 - MWFrontEnd_C_c990 - MWFrontEnd_C_bottomupinline1 - - - MWWarning_C_warn_illpragma0 - MWWarning_C_warn_emptydecl0 - MWWarning_C_warn_possunwant0 - MWWarning_C_warn_unusedvar0 - MWWarning_C_warn_unusedarg0 - MWWarning_C_warn_extracomma0 - MWWarning_C_pedantic0 - MWWarning_C_warningerrors0 - MWWarning_C_warn_hidevirtual0 - MWWarning_C_warn_implicitconv0 - MWWarning_C_warn_notinlined0 - MWWarning_C_warn_structclass0 - - - MWFTP_Post_hostName - MWFTP_Post_username - MWFTP_Post_password0ÿÀ° - MWFTP_Post_remoteDir - MWFTP_Post_ftp_PathVersion1 - MWFTP_Post_ftp_PathType0 - MWFTP_Post_ftp_PathFormat0 - MWFTP_Post_ftp_tree - MWFTP_Post_uploadDir - MWFTP_Post_ftp_port21 - MWFTP_Post_SendBin1 - MWFTP_Post_ShouldLog1 - - - MWCommandLine_Java_clsName - MWCommandLine_Java_args - - - MWVJavaDebugging_Protocol1 - MWVJavaDebugging_JDKVersion1 - MWVJavaDebugging_TimeOut25 - MWVJavaDebugging_SupportSlowDevicesfalse - MWVJavaDebugging_UseRemoteLaunchAgentfalse - MWVJavaDebugging_LaunchVMasServerfalse - - - MWJava_Language_optimizefalse - MWJava_Language_warnDeprecatedfalse - MWJava_Language_emitMapfalse - MWJava_Language_strictFileNamesfalse - MWJava_Language_strictFileHierarchyfalse - MWJava_Language_1_1_Compatiblefalse - MWJava_Language_emitHeaders0 - MWJava_Language_headerTypeJNINativeHeaders - MWJava_Language_packageFilter - MWJava_Language_genCommentstrue - MWJava_Language_genHeadersfalse - MWJava_Language_enableAssertsfalse - MWJava_Language_targetVM1.1 - - - Manifest-JAD Attributes - - AttributeMain-Class - ValueAuto-Generated - - - - - MWJava_MRJAppBuilder_outFileMRJApplication - MWJava_MRJAppBuilder_mergefalse - MWJava_MRJAppBuilder_quitMenutrue - MWJava_MRJAppBuilder_growfalse - MWJava_MRJAppBuilder_stdoutTypeConsole - MWJava_MRJAppBuilder_stderrTypeConsole - MWJava_MRJAppBuilder_stdinTypeConsole - MWJava_MRJAppBuilder_appIconPVersion0 - MWJava_MRJAppBuilder_appIconPType0 - MWJava_MRJAppBuilder_appIconPFormat0 - MWJava_MRJAppBuilder_appIconPTree - MWJava_MRJAppBuilder_appIconFile - MWJava_MRJAppBuilder_splashScreenPVersion0 - MWJava_MRJAppBuilder_splashScreenPType0 - MWJava_MRJAppBuilder_splashScreenPFormat0 - MWJava_MRJAppBuilder_splashScreenPTree - MWJava_MRJAppBuilder_splashScreenPICTFile - MWJava_MRJAppBuilder_aboutName - MWJava_MRJAppBuilder_stdoutPVersion0 - MWJava_MRJAppBuilder_stdoutPType0 - MWJava_MRJAppBuilder_stdoutPFormat0 - MWJava_MRJAppBuilder_stdoutPTree - MWJava_MRJAppBuilder_stdoutFile - MWJava_MRJAppBuilder_stdoutAppendfalse - MWJava_MRJAppBuilder_stderrPType0 - MWJava_MRJAppBuilder_stderrPFormat0 - MWJava_MRJAppBuilder_stderrPTree - MWJava_MRJAppBuilder_stderrFile - MWJava_MRJAppBuilder_stderrAppendfalse - MWJava_MRJAppBuilder_stdinPType0 - MWJava_MRJAppBuilder_stdinPFormat0 - MWJava_MRJAppBuilder_stdinPTree - MWJava_MRJAppBuilder_stdinFile - - - MWJava_Output_outputtypeJarFile - MWJava_Output_outfileJavaClasses.jar - MWJava_Output_ftype1514754080 - MWJava_Output_fcreator1297570384 - MWJava_Output_compress0 - MWJava_Output_genManifest0 - MWJava_Output_trunctypeFront - MWJava_Output_deleteClasses0 - MWJava_Output_consoleApp1 - MWJava_Output_preverify0 - MWJava_Output_genJad0 - MWJava_Output_obfuscate0 - - - MWJava_Proj_projtypeApplet - MWJava_Proj_mainClassName - MWJava_Proj_HTMLAppCreator1145457748 - MWJava_Proj_HTMLAppNameMetrowerks Java - MWJava_Proj_PathVersion1 - MWJava_Proj_PathType0 - MWJava_Proj_PathFormat0 - MWJava_Proj_tree - MWJava_Proj_HTMLAppWin32NameInternet Explorer - MWJava_Proj_compress0 - MWJava_Proj_simulator0 - MWJava_Proj_useVM\000\000macosx - MWJava_Proj_vmarguments - MWJava_Proj_vmName - MWJava_Proj_simPropFile - - - MWJavaDoc_Proj_Version1 - MWJavaDoc_Proj_Deprecated1 - MWJavaDoc_Proj_Author1 - MWJavaDoc_Proj_Index1 - MWJavaDoc_Proj_Tree1 - MWJavaDoc_Proj_SunResolveToSame0 - MWJavaDoc_Proj_Shortnames1 - MWJavaDoc_Proj_Folder0 - MWJavaDoc_Proj_GenerateAPILinks0 - MWJavaDoc_Proj_scopePublic - MWJavaDoc_Proj_fcreator1297303877 - MWJavaDoc_Proj_encodingName - MWJavaDoc_Proj_decodingName - MWJavaDoc_Proj_javaPackagePathhttp://java.sun.com/products/jdk/1.1/docs/api/ - - - MWMerge_MacOS_projectTypeApplication - MWMerge_MacOS_outputNameMerge Out - MWMerge_MacOS_outputCreator???? - MWMerge_MacOS_outputTypeAPPL - MWMerge_MacOS_suppressWarning0 - MWMerge_MacOS_copyFragments1 - MWMerge_MacOS_copyResources1 - MWMerge_MacOS_flattenResource0 - MWMerge_MacOS_flatFileNamea.rsrc - MWMerge_MacOS_flatFileOutputPath - Path: - PathFormatMacOS - PathRootProject - - MWMerge_MacOS_skipResources - DLGX - ckid - Proj - WSPC - - - - FileLockedfalse - ResourcesMapIsReadOnlyfalse - PrinterDriverIsMultiFinderCompatiblefalse - Invisiblefalse - HasBundlefalse - NameLockedfalse - Stationeryfalse - HasCustomIconfalse - Sharedfalse - HasBeenInitedfalse - Label0 - Comments - - - MWMacOSPackager_UsePackager0 - MWMacOSPackager_FolderToPackage - Path - PathFormatMacOS - PathRootAbsolute - - MWMacOSPackager_CreateClassicAlias0 - MWMacOSPackager_ClassicAliasMethodUseTargetOutput - MWMacOSPackager_ClassicAliasPath - MWMacOSPackager_CreatePkgInfo0 - MWMacOSPackager_PkgCreatorType???? - MWMacOSPackager_PkgFileTypeAPPL - - - MWCodeGen_PPC_structalignmentPPC_mw - MWCodeGen_PPC_tracebacktablesNone - MWCodeGen_PPC_processorGeneric - MWCodeGen_PPC_function_align4 - MWCodeGen_PPC_tocdata1 - MWCodeGen_PPC_largetoc0 - MWCodeGen_PPC_profiler0 - MWCodeGen_PPC_vectortocdata0 - MWCodeGen_PPC_poolconst0 - MWCodeGen_PPC_peephole1 - MWCodeGen_PPC_readonlystrings0 - MWCodeGen_PPC_linkerpoolsstrings0 - MWCodeGen_PPC_volatileasm0 - MWCodeGen_PPC_schedule0 - MWCodeGen_PPC_altivec0 - MWCodeGen_PPC_altivec_move_block0 - MWCodeGen_PPC_strictIEEEfp0 - MWCodeGen_PPC_fpcontract1 - MWCodeGen_PPC_genfsel0 - MWCodeGen_PPC_orderedfpcmp0 - - - MWCodeGen_MachO_structalignmentPPC_mw - MWCodeGen_MachO_profiler_enumOff - MWCodeGen_MachO_processorGeneric - MWCodeGen_MachO_function_align4 - MWCodeGen_MachO_common0 - MWCodeGen_MachO_peephole1 - MWCodeGen_MachO_readonlystrings0 - MWCodeGen_MachO_linkerpoolsstrings1 - MWCodeGen_MachO_volatileasm0 - MWCodeGen_MachO_schedule0 - MWCodeGen_MachO_altivec0 - MWCodeGen_MachO_vecmove0 - MWCodeGen_MachO_fp_ieee_strict0 - MWCodeGen_MachO_fpcontract1 - MWCodeGen_MachO_genfsel0 - MWCodeGen_MachO_fp_cmps_ordered0 - - - MWDisassembler_PPC_showcode1 - MWDisassembler_PPC_extended1 - MWDisassembler_PPC_mix0 - MWDisassembler_PPC_nohex0 - MWDisassembler_PPC_showdata1 - MWDisassembler_PPC_showexceptions1 - MWDisassembler_PPC_showsym0 - MWDisassembler_PPC_shownames1 - - - GlobalOptimizer_PPC_optimizationlevelLevel2 - GlobalOptimizer_PPC_optforSpeed - - - MWLinker_PPC_linksym1 - MWLinker_PPC_symfullpath1 - MWLinker_PPC_linkmap0 - MWLinker_PPC_nolinkwarnings0 - MWLinker_PPC_dontdeadstripinitcode0 - MWLinker_PPC_permitmultdefs0 - MWLinker_PPC_linkmodeFast - MWLinker_PPC_initname - MWLinker_PPC_mainname__start - MWLinker_PPC_termname - - - MWLinker_MacOSX_linksym0 - MWLinker_MacOSX_symfullpath0 - MWLinker_MacOSX_nolinkwarnings0 - MWLinker_MacOSX_linkmap0 - MWLinker_MacOSX_dontdeadstripinitcode0 - MWLinker_MacOSX_permitmultdefs1 - MWLinker_MacOSX_use_objectivec_semantics0 - MWLinker_MacOSX_strip_debug_symbols0 - MWLinker_MacOSX_split_segs0 - MWLinker_MacOSX_report_msl_overloads0 - MWLinker_MacOSX_objects_follow_linkorder0 - MWLinker_MacOSX_linkmodeFast - MWLinker_MacOSX_exportsReferencedGlobals - MWLinker_MacOSX_sortcodeNone - MWLinker_MacOSX_mainnamestart - - - MWProject_MacOSX_typeLibrary - MWProject_MacOSX_outfilepng_PPC.lib - MWProject_MacOSX_filecreator???? - MWProject_MacOSX_filetype???? - MWProject_MacOSX_vmaddress0 - MWProject_MacOSX_usedefaultvmaddr1 - MWProject_MacOSX_flatrsrc0 - MWProject_MacOSX_flatrsrcfilename - MWProject_MacOSX_flatrsrcoutputdir - Path: - PathFormatMacOS - PathRootProject - - MWProject_MacOSX_installpath./ - MWProject_MacOSX_dont_prebind0 - MWProject_MacOSX_flat_namespace0 - MWProject_MacOSX_frameworkversionA - MWProject_MacOSX_currentversion0 - MWProject_MacOSX_flat_oldimpversion0 - - - MWLinker_MachO_exportsNone - MWLinker_MachO_mainnamestart - MWLinker_MachO_currentversion0 - MWLinker_MachO_compatibleversion0 - MWLinker_MachO_symfullpath0 - MWLinker_MachO_supresswarnings0 - MWLinker_MachO_multisymerror0 - MWLinker_MachO_prebind1 - MWLinker_MachO_deadstrip1 - MWLinker_MachO_objectivecsemantics0 - MWLinker_MachO_whichfileloaded0 - MWLinker_MachO_whyfileloaded0 - MWLinker_MachO_readonlyrelocsErrors - MWLinker_MachO_undefinedsymbolsErrors - MWLinker_MachO_twolevelnamespace1 - MWLinker_MachO_stripdebugsymbols0 - - - MWProject_MachO_typeExecutable - MWProject_MachO_outfilea.exe - MWProject_MachO_filecreator???? - MWProject_MachO_filetypeMEXE - MWProject_MachO_vmaddress4096 - MWProject_MachO_flatrsrc1 - MWProject_MachO_flatrsrcfilenamea.rsrc - MWProject_MachO_flatrsrcoutputdir - Path: - PathFormatMacOS - PathRootProject - - MWProject_MachO_installpath./ - MWProject_MachO_frameworkversion - - - MWPEF_exportsNone - MWPEF_libfolder0 - MWPEF_sortcodeNone - MWPEF_expandbss0 - MWPEF_sharedata0 - MWPEF_olddefversion0 - MWPEF_oldimpversion0 - MWPEF_currentversion0 - MWPEF_fragmentname - MWPEF_collapsereloads0 - - - MWProject_PPC_typeLibrary - MWProject_PPC_outfilepng_PPC.lib - MWProject_PPC_filecreator???? - MWProject_PPC_filetype???? - MWProject_PPC_size0 - MWProject_PPC_minsize0 - MWProject_PPC_stacksize0 - MWProject_PPC_flags0 - MWProject_PPC_symfilename - MWProject_PPC_rsrcname - MWProject_PPC_rsrcheaderNative - MWProject_PPC_rsrctype???? - MWProject_PPC_rsrcid0 - MWProject_PPC_rsrcflags0 - MWProject_PPC_rsrcstore0 - MWProject_PPC_rsrcmerge0 - MWProject_PPC_flatrsrc0 - MWProject_PPC_flatrsrcoutputdir - Path: - PathFormatMacOS - PathRootProject - - MWProject_PPC_flatrsrcfilename - - - MWAssembler_PPC_auxheader0 - MWAssembler_PPC_symmodeMac - MWAssembler_PPC_dialectPPC - MWAssembler_PPC_prefixfile - MWAssembler_PPC_typecheck0 - MWAssembler_PPC_warnings0 - MWAssembler_PPC_casesensitive0 - - - PList_OutputTypeFile - PList_OutputEncodingUTF-8 - PList_Prefix - PList_FileFilenameInfo.plist - PList_FileDirectory - Path: - PathFormatMacOS - PathRootProject - - PList_ResourceTypeplst - PList_ResourceID0 - PList_ResourceName - - - MWRez_Language_maxwidth80 - MWRez_Language_scriptRoman - MWRez_Language_alignmentAlign1 - MWRez_Language_filtermodeFilterSkip - MWRez_Language_suppresswarnings0 - MWRez_Language_escapecontrolchars1 - MWRez_Language_prefixname - MWRez_Language_filteredtypes'CODE' 'DATA' 'PICT' - - - MWWinRC_prefixname - - - MWCodeGen_X86_processorGeneric - MWCodeGen_X86_alignmentbytes8 - MWCodeGen_X86_exceptionsZeroOverhead - MWCodeGen_X86_name_manglingMWWin32 - MWCodeGen_X86_use_extinst0 - MWCodeGen_X86_extinst_mmx0 - MWCodeGen_X86_extinst_3dnow0 - MWCodeGen_X86_use_mmx_3dnow_convention0 - MWCodeGen_X86_extinst_cmov0 - MWCodeGen_X86_extinst_sse0 - MWCodeGen_X86_extinst_sse20 - MWCodeGen_X86_intrinsics0 - MWCodeGen_X86_optimizeasm0 - MWCodeGen_X86_disableopts0 - MWCodeGen_X86_profile0 - MWLinker_X86_runtimeCustom - MWCodeGen_X86_readonlystrings0 - - - MWLinker_X86_subsysmajorid4 - MWLinker_X86_subsysminorid0 - MWCOFF_X86_opsysmajorid4 - MWCOFF_X86_opsysminorid0 - MWLinker_X86_usrmajorid0 - MWLinker_X86_usrminorid0 - MWProject_X86_maxstacksize1024 - MWProject_X86_minstacksize4 - MWProject_X86_size1024 - MWProject_X86_minsize4 - MWCOFF_X86_coff_flags0 - MWCOFF_X86_dll_flags0 - MWProject_X86_baseaddress4194304 - MWCOFF_X86_filealign512 - MWCOFF_X86_sectionalign4096 - - - PDisasmX86_showHeaderstrue - PDisasmX86_showSectHeaderstrue - PDisasmX86_showSymTabtrue - PDisasmX86_showCodetrue - PDisasmX86_showDatatrue - PDisasmX86_showDebugfalse - PDisasmX86_showExceptionsfalse - PDisasmX86_showRawfalse - PDisasmX86_showAllRawfalse - PDisasmX86_showSourcefalse - PDisasmX86_showRelocationtrue - PDisasmX86_showHextrue - PDisasmX86_showCommentsfalse - PDisasmX86_showSymDefstrue - PDisasmX86_unmanglefalse - PDisasmX86_verbosefalse - PDisasmX86_resolveRelocstrue - PDisasmX86_resolveLocalsfalse - - - MWDebugger_X86_Exceptions - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - - - - GlobalOptimizer_X86_optimizationlevelLevel0 - GlobalOptimizer_X86_optforSpeed - - - MWLinker_X86_entrypointusageDefault - MWLinker_X86_entrypoint - MWLinker_X86_subsystemWinGUI - MWLinker_X86_commandfile - MWLinker_X86_generatemap0 - MWLinker_X86_linksym0 - MWLinker_X86_linkCV1 - MWLinker_X86_symfullpathfalse - MWLinker_X86_linkdebugtrue - MWLinker_X86_checksumfalse - MWLinker_X86_zero_init_bssfalse - MWLinker_X86_mergedatafalse - MWLinker_X86_usedefaultlibsfalse - MWLinker_X86_adddefaultlibsfalse - MWLinker_X86_nowarningsfalse - MWLinker_X86_verbosefalse - - - MWProject_X86_typeApplication - MWProject_X86_outfileNONAME.EXE - MWProject_X86_importlib - MWProject_X86_setimportlibdirfalse - MWProject_X86_dontgenerateimportlibfalse - MWProject_X86_oldformatlibfalse - MWProject_X86_replaceobjextensionfalse - MWProject_X86_copyallfilesfalse - - - - Name - png.c - MacOS - Text - Debug - - - Name - pngerror.c - MacOS - Text - Debug - - - Name - pngget.c - MacOS - Text - Debug - - - Name - pngmem.c - MacOS - Text - Debug - - - Name - pngpread.c - MacOS - Text - Debug - - - Name - pngread.c - MacOS - Text - Debug - - - Name - pngrio.c - MacOS - Text - Debug - - - Name - pngrtran.c - MacOS - Text - Debug - - - Name - pngrutil.c - MacOS - Text - Debug - - - Name - pngset.c - MacOS - Text - Debug - - - Name - pngtrans.c - MacOS - Text - Debug - - - Name - pngwio.c - MacOS - Text - Debug - - - Name - pngwrite.c - MacOS - Text - Debug - - - Name - pngwtran.c - MacOS - Text - Debug - - - Name - pngwutil.c - MacOS - Text - Debug - - - - - Name - png.c - MacOS - - - Name - pngerror.c - MacOS - - - Name - pngget.c - MacOS - - - Name - pngmem.c - MacOS - - - Name - pngpread.c - MacOS - - - Name - pngread.c - MacOS - - - Name - pngrio.c - MacOS - - - Name - pngrtran.c - MacOS - - - Name - pngrutil.c - MacOS - - - Name - pngset.c - MacOS - - - Name - pngtrans.c - MacOS - - - Name - pngwio.c - MacOS - - - Name - pngwrite.c - MacOS - - - Name - pngwtran.c - MacOS - - - Name - pngwutil.c - MacOS - - - - - Mach-O - - - - UserSourceTrees - - - AlwaysSearchUserPathstrue - InterpretDOSAndUnixPathstrue - RequireFrameworkStyleIncludesfalse - UserSearchPaths - - SearchPath - Path: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path::zlib: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SystemSearchPaths - - SearchPath - PathMacOS X Support/Headers/(wchar_t Support fix) - PathFormatUnix - PathRootCodeWarrior - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Pathusr/include - PathFormatUnix - PathRootOS X Volume - - Recursivefalse - FrameworkPathfalse - HostFlagsAll - - - SearchPath - PathMSL/MSL_C - PathFormatUnix - PathRootCodeWarrior - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - PathMSL/MSL_C++ - PathFormatUnix - PathRootCodeWarrior - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - PathMacOS X Support - PathFormatUnix - PathRootCodeWarrior - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - PathSystem/Library/Frameworks - PathFormatUnix - PathRootOS X Volume - - Recursivefalse - FrameworkPathtrue - HostFlagsAll - - - - - MWRuntimeSettings_WorkingDirectory - MWRuntimeSettings_CommandLine - MWRuntimeSettings_HostApplication - Path - PathFormatGeneric - PathRootAbsolute - - MWRuntimeSettings_EnvVars - - - LinkerMacOS X PPC Linker - PreLinker - PostLinker - TargetnameMach-O - OutputDirectory - Path:::lib: - PathFormatMacOS - PathRootProject - - SaveEntriesUsingRelativePathsfalse - - - FileMappings - - FileTypeAPPL - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypeAppl - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypeMDYL - FileExtension - CompilerMachO Importer - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeMLIB - FileExtension - CompilerMachO Importer - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeMMLB - FileExtension - CompilerMachO Importer - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeMPLF - FileExtension - CompilerMachO Importer - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeMWCD - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypeRSRC - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.arr - Compiler - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.axp - Compiler - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.c - CompilerMW C/C++ PPC Mac OS X - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.c++ - CompilerMW C/C++ PPC Mac OS X - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.cc - CompilerMW C/C++ PPC Mac OS X - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.cp - CompilerMW C/C++ PPC Mac OS X - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.cpp - CompilerMW C/C++ PPC Mac OS X - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.exp - Compiler - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.h - CompilerMW C/C++ PPC Mac OS X - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMaketrue - - - FileTypeTEXT - FileExtension.h++ - CompilerMW C/C++ PPC Mac OS X - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMaketrue - - - FileTypeTEXT - FileExtension.hpp - CompilerMW C/C++ PPC Mac OS X - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMaketrue - - - FileTypeTEXT - FileExtension.lcf - Compiler - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.m - CompilerMW C/C++ PPC Mac OS X - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.mm - CompilerMW C/C++ PPC Mac OS X - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.pch - CompilerMW C/C++ PPC Mac OS X - EditLanguageC/C++ - Precompiletrue - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.pch++ - CompilerMW C/C++ PPC Mac OS X - EditLanguageC/C++ - Precompiletrue - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.pchm - CompilerMW C/C++ PPC Mac OS X - EditLanguageC/C++ - Precompiletrue - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.pchmm - CompilerMW C/C++ PPC Mac OS X - EditLanguageC/C++ - Precompiletrue - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.plc - CompilerProperty List Compiler - EditLanguageProperty List - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.ploc - CompilerProperty List Compiler - EditLanguageProperty List - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.r - CompilerRez - EditLanguageRez - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.wke - Compiler - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypedocu - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypersrc - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileExtension.a - CompilerMachO Importer - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileExtension.doc - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFilefalse - IgnoredByMaketrue - - - FileExtension.dylib - CompilerMachO Importer - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileExtension.gif - CompilerCopy To Package - EditLanguage - Precompilefalse - Launchabletrue - ResourceFilefalse - IgnoredByMaketrue - - - FileExtension.icns - CompilerCopy To Package - EditLanguage - Precompilefalse - Launchabletrue - ResourceFilefalse - IgnoredByMaketrue - - - FileExtension.jpg - CompilerCopy To Package - EditLanguage - Precompilefalse - Launchabletrue - ResourceFilefalse - IgnoredByMaketrue - - - FileExtension.lib - CompilerMachO Importer - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileExtension.nib - CompilerCopy To Package - EditLanguage - Precompilefalse - Launchabletrue - ResourceFilefalse - IgnoredByMaketrue - - - FileExtension.pl - CompilerPerl Tool - EditLanguagePerl - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileExtension.plist - CompilerCopy To Package - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMaketrue - - - FileExtension.ppob - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileExtension.psh - CompilerShell Tool - EditLanguage - Precompiletrue - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileExtension.rsrc - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileExtension.sh - CompilerShell Tool - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileExtension.strings - CompilerCopy To Package - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMaketrue - - - FileExtension.tiff - CompilerCopy To Package - EditLanguage - Precompilefalse - Launchabletrue - ResourceFilefalse - IgnoredByMaketrue - - - - - CacheModDatestrue - DumpBrowserInfofalse - CacheSubprojectstrue - UseThirdPartyDebuggerfalse - BrowserGenerator1 - DebuggerAppPath - Path - PathFormatGeneric - PathRootAbsolute - - DebuggerCmdLineArgs - DebuggerWorkingDir - Path - PathFormatGeneric - PathRootAbsolute - - CodeCompletionPrefixFileNameMacHeaders.c - CodeCompletionMacroFileNameMacOS_Carbon_C++_Macros.h - - - ConsoleEncoding0 - LogSystemMessagestrue - AutoTargetDLLsfalse - StopAtWatchpointstrue - PauseWhileRunningfalse - PauseInterval5 - PauseUIFlags0 - AltExePath - Path - PathFormatGeneric - PathRootAbsolute - - StopAtTempBPOnLaunchtrue - CacheSymbolicstrue - TempBPFunctionNamemain - TempBPType0 - - - Enabledfalse - ConnectionName - DownloadPath - LaunchRemoteAppfalse - RemoteAppPath - CoreID0 - JTAGClockSpeed8000 - IsMultiCorefalse - OSDownloadfalse - UseGlobalOSDownloadfalse - OSDownloadConnectionName - OSDownloadPath - AltDownloadfalse - AltDownloadConnectionName - - - OtherExecutables - - - CustomColor1 - Red0 - Green32767 - Blue0 - - CustomColor2 - Red0 - Green32767 - Blue0 - - CustomColor3 - Red0 - Green32767 - Blue0 - - CustomColor4 - Red0 - Green32767 - Blue0 - - - - MWFrontEnd_C_cplusplus0 - MWFrontEnd_C_checkprotos0 - MWFrontEnd_C_arm0 - MWFrontEnd_C_trigraphs0 - MWFrontEnd_C_onlystdkeywords0 - MWFrontEnd_C_enumsalwaysint0 - MWFrontEnd_C_mpwpointerstyle0 - MWFrontEnd_C_prefixname - MWFrontEnd_C_ansistrict0 - MWFrontEnd_C_mpwcnewline0 - MWFrontEnd_C_wchar_type1 - MWFrontEnd_C_enableexceptions1 - MWFrontEnd_C_dontreusestrings0 - MWFrontEnd_C_poolstrings0 - MWFrontEnd_C_dontinline0 - MWFrontEnd_C_useRTTI1 - MWFrontEnd_C_multibyteaware0 - MWFrontEnd_C_unsignedchars0 - MWFrontEnd_C_autoinline0 - MWFrontEnd_C_booltruefalse1 - MWFrontEnd_C_inlinelevel0 - MWFrontEnd_C_ecplusplus0 - MWFrontEnd_C_objective_c0 - MWFrontEnd_C_defer_codegen0 - MWFrontEnd_C_templateparser0 - MWFrontEnd_C_c990 - MWFrontEnd_C_bottomupinline1 - - - MWWarning_C_warn_illpragma0 - MWWarning_C_warn_emptydecl0 - MWWarning_C_warn_possunwant0 - MWWarning_C_warn_unusedvar0 - MWWarning_C_warn_unusedarg0 - MWWarning_C_warn_extracomma0 - MWWarning_C_pedantic0 - MWWarning_C_warningerrors0 - MWWarning_C_warn_hidevirtual0 - MWWarning_C_warn_implicitconv0 - MWWarning_C_warn_notinlined0 - MWWarning_C_warn_structclass0 - - - MWFTP_Post_hostName - MWFTP_Post_username - MWFTP_Post_password0ÿÀ° - MWFTP_Post_remoteDir - MWFTP_Post_ftp_PathVersion1 - MWFTP_Post_ftp_PathType0 - MWFTP_Post_ftp_PathFormat0 - MWFTP_Post_ftp_tree - MWFTP_Post_uploadDir - MWFTP_Post_ftp_port21 - MWFTP_Post_SendBin1 - MWFTP_Post_ShouldLog1 - - - MWCommandLine_Java_clsName - MWCommandLine_Java_args - - - MWVJavaDebugging_Protocol1 - MWVJavaDebugging_JDKVersion1 - MWVJavaDebugging_TimeOut25 - MWVJavaDebugging_SupportSlowDevicesfalse - MWVJavaDebugging_UseRemoteLaunchAgentfalse - MWVJavaDebugging_LaunchVMasServerfalse - - - MWJava_Language_optimizefalse - MWJava_Language_warnDeprecatedfalse - MWJava_Language_emitMapfalse - MWJava_Language_strictFileNamesfalse - MWJava_Language_strictFileHierarchyfalse - MWJava_Language_1_1_Compatiblefalse - MWJava_Language_emitHeaders0 - MWJava_Language_headerTypeJNINativeHeaders - MWJava_Language_packageFilter - MWJava_Language_genCommentstrue - MWJava_Language_genHeadersfalse - MWJava_Language_enableAssertsfalse - MWJava_Language_targetVM1.1 - - - Manifest-JAD Attributes - - AttributeMain-Class - ValueAuto-Generated - - - - - MWJava_MRJAppBuilder_outFileMRJApplication - MWJava_MRJAppBuilder_mergefalse - MWJava_MRJAppBuilder_quitMenutrue - MWJava_MRJAppBuilder_growfalse - MWJava_MRJAppBuilder_stdoutTypeConsole - MWJava_MRJAppBuilder_stderrTypeConsole - MWJava_MRJAppBuilder_stdinTypeConsole - MWJava_MRJAppBuilder_appIconPVersion0 - MWJava_MRJAppBuilder_appIconPType0 - MWJava_MRJAppBuilder_appIconPFormat0 - MWJava_MRJAppBuilder_appIconPTree - MWJava_MRJAppBuilder_appIconFile - MWJava_MRJAppBuilder_splashScreenPVersion0 - MWJava_MRJAppBuilder_splashScreenPType0 - MWJava_MRJAppBuilder_splashScreenPFormat0 - MWJava_MRJAppBuilder_splashScreenPTree - MWJava_MRJAppBuilder_splashScreenPICTFile - MWJava_MRJAppBuilder_aboutName - MWJava_MRJAppBuilder_stdoutPVersion0 - MWJava_MRJAppBuilder_stdoutPType0 - MWJava_MRJAppBuilder_stdoutPFormat0 - MWJava_MRJAppBuilder_stdoutPTree - MWJava_MRJAppBuilder_stdoutFile - MWJava_MRJAppBuilder_stdoutAppendfalse - MWJava_MRJAppBuilder_stderrPType0 - MWJava_MRJAppBuilder_stderrPFormat0 - MWJava_MRJAppBuilder_stderrPTree - MWJava_MRJAppBuilder_stderrFile - MWJava_MRJAppBuilder_stderrAppendfalse - MWJava_MRJAppBuilder_stdinPType0 - MWJava_MRJAppBuilder_stdinPFormat0 - MWJava_MRJAppBuilder_stdinPTree - MWJava_MRJAppBuilder_stdinFile - - - MWJava_Output_outputtypeJarFile - MWJava_Output_outfileJavaClasses.jar - MWJava_Output_ftype1514754080 - MWJava_Output_fcreator1297570384 - MWJava_Output_compress0 - MWJava_Output_genManifest0 - MWJava_Output_trunctypeFront - MWJava_Output_deleteClasses0 - MWJava_Output_consoleApp1 - MWJava_Output_preverify0 - MWJava_Output_genJad0 - MWJava_Output_obfuscate0 - - - MWJava_Proj_projtypeApplet - MWJava_Proj_mainClassName - MWJava_Proj_HTMLAppCreator1145457748 - MWJava_Proj_HTMLAppNameMetrowerks Java - MWJava_Proj_PathVersion1 - MWJava_Proj_PathType0 - MWJava_Proj_PathFormat0 - MWJava_Proj_tree - MWJava_Proj_HTMLAppWin32NameInternet Explorer - MWJava_Proj_compress0 - MWJava_Proj_simulator0 - MWJava_Proj_useVM\000\000macosx - MWJava_Proj_vmarguments - MWJava_Proj_vmName - MWJava_Proj_simPropFile - - - MWJavaDoc_Proj_Version1 - MWJavaDoc_Proj_Deprecated1 - MWJavaDoc_Proj_Author1 - MWJavaDoc_Proj_Index1 - MWJavaDoc_Proj_Tree1 - MWJavaDoc_Proj_SunResolveToSame0 - MWJavaDoc_Proj_Shortnames1 - MWJavaDoc_Proj_Folder0 - MWJavaDoc_Proj_GenerateAPILinks0 - MWJavaDoc_Proj_scopePublic - MWJavaDoc_Proj_fcreator1297303877 - MWJavaDoc_Proj_encodingName - MWJavaDoc_Proj_decodingName - MWJavaDoc_Proj_javaPackagePathhttp://java.sun.com/products/jdk/1.1/docs/api/ - - - MWMerge_MacOS_projectTypeApplication - MWMerge_MacOS_outputNameMerge Out - MWMerge_MacOS_outputCreator???? - MWMerge_MacOS_outputTypeAPPL - MWMerge_MacOS_suppressWarning0 - MWMerge_MacOS_copyFragments1 - MWMerge_MacOS_copyResources1 - MWMerge_MacOS_flattenResource0 - MWMerge_MacOS_flatFileNamea.rsrc - MWMerge_MacOS_flatFileOutputPath - Path: - PathFormatMacOS - PathRootProject - - MWMerge_MacOS_skipResources - DLGX - ckid - Proj - WSPC - - - - FileLockedfalse - ResourcesMapIsReadOnlyfalse - PrinterDriverIsMultiFinderCompatiblefalse - Invisiblefalse - HasBundlefalse - NameLockedfalse - Stationeryfalse - HasCustomIconfalse - Sharedfalse - HasBeenInitedfalse - Label0 - Comments - - - MWMacOSPackager_UsePackager0 - MWMacOSPackager_FolderToPackage - Path - PathFormatMacOS - PathRootAbsolute - - MWMacOSPackager_CreateClassicAlias0 - MWMacOSPackager_ClassicAliasMethodUseTargetOutput - MWMacOSPackager_ClassicAliasPath - MWMacOSPackager_CreatePkgInfo0 - MWMacOSPackager_PkgCreatorType???? - MWMacOSPackager_PkgFileTypeAPPL - - - MWCodeGen_PPC_structalignmentPPC_mw - MWCodeGen_PPC_tracebacktablesNone - MWCodeGen_PPC_processorGeneric - MWCodeGen_PPC_function_align4 - MWCodeGen_PPC_tocdata1 - MWCodeGen_PPC_largetoc0 - MWCodeGen_PPC_profiler0 - MWCodeGen_PPC_vectortocdata0 - MWCodeGen_PPC_poolconst0 - MWCodeGen_PPC_peephole1 - MWCodeGen_PPC_readonlystrings0 - MWCodeGen_PPC_linkerpoolsstrings0 - MWCodeGen_PPC_volatileasm0 - MWCodeGen_PPC_schedule0 - MWCodeGen_PPC_altivec0 - MWCodeGen_PPC_altivec_move_block0 - MWCodeGen_PPC_strictIEEEfp0 - MWCodeGen_PPC_fpcontract1 - MWCodeGen_PPC_genfsel0 - MWCodeGen_PPC_orderedfpcmp0 - - - MWCodeGen_MachO_structalignmentPPC_mw - MWCodeGen_MachO_profiler_enumOff - MWCodeGen_MachO_processorGeneric - MWCodeGen_MachO_function_align4 - MWCodeGen_MachO_common0 - MWCodeGen_MachO_peephole1 - MWCodeGen_MachO_readonlystrings0 - MWCodeGen_MachO_linkerpoolsstrings1 - MWCodeGen_MachO_volatileasm0 - MWCodeGen_MachO_schedule0 - MWCodeGen_MachO_altivec0 - MWCodeGen_MachO_vecmove0 - MWCodeGen_MachO_fp_ieee_strict0 - MWCodeGen_MachO_fpcontract1 - MWCodeGen_MachO_genfsel0 - MWCodeGen_MachO_fp_cmps_ordered0 - - - MWDisassembler_PPC_showcode1 - MWDisassembler_PPC_extended1 - MWDisassembler_PPC_mix0 - MWDisassembler_PPC_nohex0 - MWDisassembler_PPC_showdata1 - MWDisassembler_PPC_showexceptions1 - MWDisassembler_PPC_showsym0 - MWDisassembler_PPC_shownames1 - - - GlobalOptimizer_PPC_optimizationlevelLevel2 - GlobalOptimizer_PPC_optforSpeed - - - MWLinker_PPC_linksym1 - MWLinker_PPC_symfullpath1 - MWLinker_PPC_linkmap0 - MWLinker_PPC_nolinkwarnings0 - MWLinker_PPC_dontdeadstripinitcode0 - MWLinker_PPC_permitmultdefs0 - MWLinker_PPC_linkmodeFast - MWLinker_PPC_initname - MWLinker_PPC_mainname__start - MWLinker_PPC_termname - - - MWLinker_MacOSX_linksym0 - MWLinker_MacOSX_symfullpath0 - MWLinker_MacOSX_nolinkwarnings0 - MWLinker_MacOSX_linkmap0 - MWLinker_MacOSX_dontdeadstripinitcode0 - MWLinker_MacOSX_permitmultdefs1 - MWLinker_MacOSX_use_objectivec_semantics0 - MWLinker_MacOSX_strip_debug_symbols0 - MWLinker_MacOSX_split_segs0 - MWLinker_MacOSX_report_msl_overloads0 - MWLinker_MacOSX_objects_follow_linkorder0 - MWLinker_MacOSX_linkmodeFast - MWLinker_MacOSX_exportsReferencedGlobals - MWLinker_MacOSX_sortcodeNone - MWLinker_MacOSX_mainnamestart - - - MWProject_MacOSX_typeLibrary - MWProject_MacOSX_outfilepng_MACH.lib - MWProject_MacOSX_filecreator???? - MWProject_MacOSX_filetype???? - MWProject_MacOSX_vmaddress0 - MWProject_MacOSX_usedefaultvmaddr1 - MWProject_MacOSX_flatrsrc0 - MWProject_MacOSX_flatrsrcfilename - MWProject_MacOSX_flatrsrcoutputdir - Path: - PathFormatMacOS - PathRootProject - - MWProject_MacOSX_installpath./ - MWProject_MacOSX_dont_prebind0 - MWProject_MacOSX_flat_namespace0 - MWProject_MacOSX_frameworkversionA - MWProject_MacOSX_currentversion0 - MWProject_MacOSX_flat_oldimpversion0 - - - MWLinker_MachO_exportsNone - MWLinker_MachO_mainnamestart - MWLinker_MachO_currentversion0 - MWLinker_MachO_compatibleversion0 - MWLinker_MachO_symfullpath0 - MWLinker_MachO_supresswarnings0 - MWLinker_MachO_multisymerror0 - MWLinker_MachO_prebind1 - MWLinker_MachO_deadstrip1 - MWLinker_MachO_objectivecsemantics0 - MWLinker_MachO_whichfileloaded0 - MWLinker_MachO_whyfileloaded0 - MWLinker_MachO_readonlyrelocsErrors - MWLinker_MachO_undefinedsymbolsErrors - MWLinker_MachO_twolevelnamespace1 - MWLinker_MachO_stripdebugsymbols0 - - - MWProject_MachO_typeExecutable - MWProject_MachO_outfilea.exe - MWProject_MachO_filecreator???? - MWProject_MachO_filetypeMEXE - MWProject_MachO_vmaddress4096 - MWProject_MachO_flatrsrc1 - MWProject_MachO_flatrsrcfilenamea.rsrc - MWProject_MachO_flatrsrcoutputdir - Path: - PathFormatMacOS - PathRootProject - - MWProject_MachO_installpath./ - MWProject_MachO_frameworkversion - - - MWPEF_exportsNone - MWPEF_libfolder0 - MWPEF_sortcodeNone - MWPEF_expandbss0 - MWPEF_sharedata0 - MWPEF_olddefversion0 - MWPEF_oldimpversion0 - MWPEF_currentversion0 - MWPEF_fragmentname - MWPEF_collapsereloads0 - - - MWProject_PPC_typeLibrary - MWProject_PPC_outfilepng_PPC.lib - MWProject_PPC_filecreator???? - MWProject_PPC_filetype???? - MWProject_PPC_size0 - MWProject_PPC_minsize0 - MWProject_PPC_stacksize0 - MWProject_PPC_flags0 - MWProject_PPC_symfilename - MWProject_PPC_rsrcname - MWProject_PPC_rsrcheaderNative - MWProject_PPC_rsrctype???? - MWProject_PPC_rsrcid0 - MWProject_PPC_rsrcflags0 - MWProject_PPC_rsrcstore0 - MWProject_PPC_rsrcmerge0 - MWProject_PPC_flatrsrc0 - MWProject_PPC_flatrsrcoutputdir - Path: - PathFormatMacOS - PathRootProject - - MWProject_PPC_flatrsrcfilename - - - MWAssembler_PPC_auxheader0 - MWAssembler_PPC_symmodeMac - MWAssembler_PPC_dialectPPC - MWAssembler_PPC_prefixfile - MWAssembler_PPC_typecheck0 - MWAssembler_PPC_warnings0 - MWAssembler_PPC_casesensitive0 - - - PList_OutputTypeFile - PList_OutputEncodingUTF-8 - PList_Prefix - PList_FileFilenameInfo.plist - PList_FileDirectory - Path: - PathFormatMacOS - PathRootProject - - PList_ResourceTypeplst - PList_ResourceID0 - PList_ResourceName - - - MWRez_Language_maxwidth80 - MWRez_Language_scriptRoman - MWRez_Language_alignmentAlign1 - MWRez_Language_filtermodeFilterSkip - MWRez_Language_suppresswarnings0 - MWRez_Language_escapecontrolchars1 - MWRez_Language_prefixname - MWRez_Language_filteredtypes'CODE' 'DATA' 'PICT' - - - MWWinRC_prefixname - - - MWCodeGen_X86_processorGeneric - MWCodeGen_X86_alignmentbytes8 - MWCodeGen_X86_exceptionsZeroOverhead - MWCodeGen_X86_name_manglingMWWin32 - MWCodeGen_X86_use_extinst0 - MWCodeGen_X86_extinst_mmx0 - MWCodeGen_X86_extinst_3dnow0 - MWCodeGen_X86_use_mmx_3dnow_convention0 - MWCodeGen_X86_extinst_cmov0 - MWCodeGen_X86_extinst_sse0 - MWCodeGen_X86_extinst_sse20 - MWCodeGen_X86_intrinsics0 - MWCodeGen_X86_optimizeasm0 - MWCodeGen_X86_disableopts0 - MWCodeGen_X86_profile0 - MWLinker_X86_runtimeCustom - MWCodeGen_X86_readonlystrings0 - - - MWLinker_X86_subsysmajorid4 - MWLinker_X86_subsysminorid0 - MWCOFF_X86_opsysmajorid4 - MWCOFF_X86_opsysminorid0 - MWLinker_X86_usrmajorid0 - MWLinker_X86_usrminorid0 - MWProject_X86_maxstacksize1024 - MWProject_X86_minstacksize4 - MWProject_X86_size1024 - MWProject_X86_minsize4 - MWCOFF_X86_coff_flags0 - MWCOFF_X86_dll_flags0 - MWProject_X86_baseaddress4194304 - MWCOFF_X86_filealign512 - MWCOFF_X86_sectionalign4096 - - - PDisasmX86_showHeaderstrue - PDisasmX86_showSectHeaderstrue - PDisasmX86_showSymTabtrue - PDisasmX86_showCodetrue - PDisasmX86_showDatatrue - PDisasmX86_showDebugfalse - PDisasmX86_showExceptionsfalse - PDisasmX86_showRawfalse - PDisasmX86_showAllRawfalse - PDisasmX86_showSourcefalse - PDisasmX86_showRelocationtrue - PDisasmX86_showHextrue - PDisasmX86_showCommentsfalse - PDisasmX86_showSymDefstrue - PDisasmX86_unmanglefalse - PDisasmX86_verbosefalse - PDisasmX86_resolveRelocstrue - PDisasmX86_resolveLocalsfalse - - - MWDebugger_X86_Exceptions - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - - - - GlobalOptimizer_X86_optimizationlevelLevel0 - GlobalOptimizer_X86_optforSpeed - - - MWLinker_X86_entrypointusageDefault - MWLinker_X86_entrypoint - MWLinker_X86_subsystemWinGUI - MWLinker_X86_commandfile - MWLinker_X86_generatemap0 - MWLinker_X86_linksym0 - MWLinker_X86_linkCV1 - MWLinker_X86_symfullpathfalse - MWLinker_X86_linkdebugtrue - MWLinker_X86_checksumfalse - MWLinker_X86_zero_init_bssfalse - MWLinker_X86_mergedatafalse - MWLinker_X86_usedefaultlibsfalse - MWLinker_X86_adddefaultlibsfalse - MWLinker_X86_nowarningsfalse - MWLinker_X86_verbosefalse - - - MWProject_X86_typeApplication - MWProject_X86_outfileNONAME.EXE - MWProject_X86_importlib - MWProject_X86_setimportlibdirfalse - MWProject_X86_dontgenerateimportlibfalse - MWProject_X86_oldformatlibfalse - MWProject_X86_replaceobjextensionfalse - MWProject_X86_copyallfilesfalse - - - - Name - png.c - MacOS - Text - Debug - - - Name - pngerror.c - MacOS - Text - Debug - - - Name - pngget.c - MacOS - Text - Debug - - - Name - pngmem.c - MacOS - Text - Debug - - - Name - pngpread.c - MacOS - Text - Debug - - - Name - pngread.c - MacOS - Text - Debug - - - Name - pngrio.c - MacOS - Text - Debug - - - Name - pngrtran.c - MacOS - Text - Debug - - - Name - pngrutil.c - MacOS - Text - Debug - - - Name - pngset.c - MacOS - Text - Debug - - - Name - pngtrans.c - MacOS - Text - Debug - - - Name - pngwio.c - MacOS - Text - Debug - - - Name - pngwrite.c - MacOS - Text - Debug - - - Name - pngwtran.c - MacOS - Text - Debug - - - Name - pngwutil.c - MacOS - Text - Debug - - - - - Name - png.c - MacOS - - - Name - pngerror.c - MacOS - - - Name - pngget.c - MacOS - - - Name - pngmem.c - MacOS - - - Name - pngpread.c - MacOS - - - Name - pngread.c - MacOS - - - Name - pngrio.c - MacOS - - - Name - pngrtran.c - MacOS - - - Name - pngrutil.c - MacOS - - - Name - pngset.c - MacOS - - - Name - pngtrans.c - MacOS - - - Name - pngwio.c - MacOS - - - Name - pngwrite.c - MacOS - - - Name - pngwtran.c - MacOS - - - Name - pngwutil.c - MacOS - - - - - - Name - Carbon.framework - Unix - - Carbon - - - - - - - PPC - Mach-O - - - - - PPC - Name - png.c - MacOS - - - PPC - Name - pngerror.c - MacOS - - - PPC - Name - pngget.c - MacOS - - - PPC - Name - pngmem.c - MacOS - - - PPC - Name - pngpread.c - MacOS - - - PPC - Name - pngread.c - MacOS - - - PPC - Name - pngrio.c - MacOS - - - PPC - Name - pngrtran.c - MacOS - - - PPC - Name - pngrutil.c - MacOS - - - PPC - Name - pngset.c - MacOS - - - PPC - Name - pngtrans.c - MacOS - - - PPC - Name - pngwio.c - MacOS - - - PPC - Name - pngwrite.c - MacOS - - - PPC - Name - pngwtran.c - MacOS - - - PPC - Name - pngwutil.c - MacOS - - - - diff --git a/wxWidgets/src/png/pngasmrd.h b/wxWidgets/src/png/pngasmrd.h deleted file mode 100644 index 0505258261..0000000000 --- a/wxWidgets/src/png/pngasmrd.h +++ /dev/null @@ -1,11 +0,0 @@ -/* pngasmrd.h - assembler version of utilities to read a PNG file - * - * libpng 1.2.6 - August 15, 2004 - * For conditions of distribution and use, see copyright notice in png.h - * Copyright (c) 2002-2004 Glenn Randers-Pehrson - * - */ - -/* This file is obsolete in libpng-1.0.9 and later; its contents now appear - * at the end of pngconf.h. - */ diff --git a/wxWidgets/src/png/pngbar.jpg b/wxWidgets/src/png/pngbar.jpg deleted file mode 100644 index 70ba8d817ce433788c7933dbe3c29c3e384b2b0a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2498 zcmb79cR1UN8veLX-}`>=f8Y0x?_}m=8Q`%n#hU_5OiaM90Zxtq1>=CgTfsNH zyhE`{nwsjeShHXcFRV>~hi`yq2v*YHBRtd~Fu*+^LY^4lCw1}#Lva_%-vvRO=aKPAMFitLB9!@Se7YxRO;(_xakVqs4H@^T1A;613B7T`LfloCM zC>s>YhTw#8BK~ij^a5~J00TIJnM42(oCyqPI(Y@00RRyA^t=CpnFWBbLcymyB_03- z0x_M|W@3T<`-BN}TAvxt!Yd50@*zZ&*pN77LnCW9lz^y8aNMcnEYqn3{J(Y(W-t^0 zvHZ$XfCC^V5CqH&h5jdw2?Phg5ME(JD6^7?wOdfuSH8H0zP}N;;+36~Ie_ET2?Phj z0ewJu_XPOzrM!FkVBFSWa?9PHSVQF9@l6YED#^WWRML1J9VDQieoKN{=G;@B(Vmqw zMZd`y)ni0|7a{dGH#QBu4Xb>^8Ml-38dtbR*{4J6CiE}A`n<^Swi_b~53dp@Oz5&x zqIb>@R2bY|^Eg5Q^oZrcolUy~e~ev4`E;SpK(~nwOpGHYx7IEN6TgtCZ%ql2@{}O= zB=jD|t!NkbZ`gujXu2t1GZEV?OI;QB^sVbc{HllYU92vX0u%;zs?5Dy7i5b^Vr}Pn zO2G4GXu7^$QmgA^)I4+H4Ve#&F8{pR>+ENwX4HwzetiUp&~J{h-wxp)&2&qMG9ULl z$1sGXW1&H@50#Izy=lZUfjypz`|x(CS!BmIDmt4<-iM+7vJJYh6Ok&Y`9uLDz-dii|{T@&nMOnhYGW-(Yq<%v= zZ{=JMeWTwA?P4UG8a$$%3#A_D7*<`B{srsRec$8y$6ez;HO0+<=@)~a+C#KD$fFie zOF5lh(}n6`?kJ=#rB8?(qO_~`d`n%$zP0)o`DHOCeo?6M-Pn1fN6p1D_{#*0&JIPU zL@9JFTVPL!MG(xN{Pyi$)cs@-UVOt7&mCx*p!Qt+LYRroDYFGACZJ{8Pxa zhc4YRL#jc2?yi*%aQ(San~2E>xW1QR0J9uq>9 zE|N+~DEC)g{=F~&W?nheQJ?`Q<2i%Wz?M||p-DL5&AOs`qIe3z=N#%2ExTl7#Mi~t zZTvmnY2L6RG=bnbgRr9M+u}{jp7ydMJN^)W@t){SwRelgUb%&^y1 zM;W@kz|uUoUabJ?0dbrrlPe>APntXLz&pJ5ZWI7}GEh1`;2^(^ytgu48%@k}`m_4R zx8US1L-x+#p75_R@wMZVM}ykuYvioTTGW)v@utp6&FdCbVm5jv1($E4n`7P(vX8P^ zVZA#7-KlKgbTX}&!a_R%ta^0&^b~I$WKg~SIROeW8CO-de{#3jS6!TXFi85;P@Hrz zD3>)2F0f1;VrK&%21hW;jd0Cjw4?npnIr&aVCT_ zW9a^Bg^fd&pImbNpxTP+{rooTc`NU48`F^mV8?f=97sYHnM7{LO)G6#omwpLj@zjk z*`m5o3~<=GP;|qAvDunf<-pg& zIH~t>Us-XJV%rkrKOD99=3flubRj$V{UNE2PCJI@Qi7&wDXM|x@Dll=Tj)D@Y(u1P z7_yCfQ%}|zKKprCcz*XtvG}TKViW44NE~ZF&3pW4f2!sm`cI`U`Bl!2_PqS3Dvok5 z=2eTiaWh#`Q&nhOeYk8Y2gu}DUKS%W-&K5bD>U`DQo92*Z9Jvl-A7zo%D^O5+z3*TS2sjBs^v)SGJg_-$$y+3;FN@u#o{#rqd z=-;Zemc);1)~-n;ZNYgD*QCx)qTS?(6>`Yxu0|T02j9{jA-iY!XBs6VtKgN(?M>3M zXitp$#9|Y^aqefnpO5s_bc&VI`Mol8lb36szrH?8J9^Y{Sh=Zut;vy9EAFY*!eBw< zUh1>Fup<1+##XO=O2huD7w?@yH~akK6(i-EANrw@1tl$;?SdE;AJIJyTU&yrti_SX zqL2K}JyH4R*vHyPyly4H@@Qky6>b`Z!-~dp<=^<0ql8jCIzJ{n2`02PuA?k^A&hB? zljJT{WGG{Bb%mft`m0YCNhgQcH?}Ga`o4KT7r9mpTO|G-ajjf)rUae~l{ z0Rja6`T3xspr4_iba{e!dVHCinSz3e@1>=%j($2G9;~mjBv2nTG{hSR28W4<;$UEa zfq+#nVBJJS0RaHmC@AQFfQX5U(+mu00070t%A%vz78nt@y3y1S5N2m)Kc7E!n|s1o zS3*LZ`|ImCIy_xnT}Vn#B_<}-6cj!`B>eC1D=aTfO-&XS7mt#WfPvpvG$H~507gef za(0FG_V)er^K^NAv$WC-3=ME`ynZ!EiHe1F4i6%tFFzXq(o3jLNqluBO@b zVbTT$78e$QPf^Cm#xylL6B84MYEWEsVPscG4Gj%}gp7rShJJ*J1_uTQ1qZgcwgm+R zTU=lS0|Z`PB(t=$0s#U60RaF30IsgC78d%fuB?oX+;MYqIXXKmDvVH6GZr>DJ8*F|pP|?3h={zu&lnR8iH(zuj*X0tj8%hK4-gJ}V^=2} z6>oEP2?_mre}vT-7)}5HC?_Km6cv1ad;tIecYA?^h0qZY6Aum%b9;T@R8)kCkwQa5 zadmqS2M0SlJZ)}m(EtEcS6dMa3_n3bUt?)wWMf%cS%!(3`QP6|MM@eP`5+-7d3AOF z|Nm+%D{E|VNkkrIXlz47LkkNGKtMq3?d<#K=S5UV_RGudo}K{#0%vG&=I7>ARK#Xx zZ!^wXXe#HK_DO?>Sbn6Qdo$IQAs2u8X6iK7#qpU$!=|P zH#j{eCMlYoeM(75KtVqc5c_+8WeN%km6n;gySbjFueP_g0|EoHwX*;K|7dG)!Bu-G z000IGNklHt z*vcw)0ZfC}7KY%R=*angFf7GDQDX{kit>gDqYzS58b_&yP)Sh~f_vJw^;p^2y#yCM zISs%G832=BMOOfjy#g7m@ zt+jh(w*X#u^vDspeASlpa4&Rno;k@j!sy{`WCR+Uq@`vIjHM+IP*3zXu&|I&vvBhr zt5-6<$;<(2f0#8w1lUp z1?ZrY7`SR}R`W7r#`?tgl6cdPoX?M$DvQtWI;4E?_jQN%)H5pc$G$QI+vc!SEpCkx z#+g9_7fww>9KozuLwWI;j6+9TpAhcZ3t)y?l zdFG(xs{LWrE9KT-raI@mim4p&N{FMfnYvkx$&R<(ms07RfJb`ikXw53l+@$=(}P z?MpK-^c){YFoBt|a4?lG5TfY@J<<>?PQod%2Mgco&28>|0SA}+mYBOllOs`!S5By% zPP)yMN8hY0FHucYC;n_6!ovRAX#_Va6gmb@(5FOo!%@D@y8%T(VK`nksAFI>hf954 z%;R4p&z*B}R#o1+ANee}?qI;Zm|;~&O?-uKytC6Dx4SG1Pcbm+Lj?nKq_BGlH;X_Kt|nbMUG0>1pkOx7k6gb9<~7 zEJCZ>+w;OZRw?IW&lmbl5aqEGH3-e+iMsSUx=|fB7lp(Cl}Z05;e)elg=25lhPU3OFC-`X4O~Pp z(+u8SxX6@Nu-gU$cM%?iDf;}>eg@uPwZ7NbAfwc4%LKv$AESApwMAQTgR)Bj)d}7P zwCAfKkJo5opoC@6Lg<3Mcwvcs4!^5<=}qW6{9VgWp{KyaBpI7crIgaZ7IUp RQSJZ$002ovPDHLkV1iCKFfIT9 diff --git a/wxWidgets/src/png/pngconf.h b/wxWidgets/src/png/pngconf.h deleted file mode 100644 index 867e0a8668..0000000000 --- a/wxWidgets/src/png/pngconf.h +++ /dev/null @@ -1,1394 +0,0 @@ - -/* pngconf.h - machine configurable file for libpng - * - * libpng version 1.2.7 - September 12, 2004 - * For conditions of distribution and use, see copyright notice in png.h - * Copyright (c) 1998-2004 Glenn Randers-Pehrson - * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) - * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) - */ - -/* Any machine specific code is near the front of this file, so if you - * are configuring libpng for a machine, you may want to read the section - * starting here down to where it starts to typedef png_color, png_text, - * and png_info. - */ - -#ifndef PNGCONF_H -#define PNGCONF_H - -#ifdef PNG_USER_CONFIG -#include "pngusr.h" -#endif - -/* This is the size of the compression buffer, and thus the size of - * an IDAT chunk. Make this whatever size you feel is best for your - * machine. One of these will be allocated per png_struct. When this - * is full, it writes the data to the disk, and does some other - * calculations. Making this an extremely small size will slow - * the library down, but you may want to experiment to determine - * where it becomes significant, if you are concerned with memory - * usage. Note that zlib allocates at least 32Kb also. For readers, - * this describes the size of the buffer available to read the data in. - * Unless this gets smaller than the size of a row (compressed), - * it should not make much difference how big this is. - */ - -#ifndef PNG_ZBUF_SIZE -# define PNG_ZBUF_SIZE 8192 -#endif - -/* Enable if you want a write-only libpng */ - -#ifndef PNG_NO_READ_SUPPORTED -# define PNG_READ_SUPPORTED -#endif - -/* Enable if you want a read-only libpng */ - -#ifndef PNG_NO_WRITE_SUPPORTED -# define PNG_WRITE_SUPPORTED -#endif - -/* Enabled by default in 1.2.0. You can disable this if you don't need to - support PNGs that are embedded in MNG datastreams */ -#if !defined(PNG_1_0_X) && !defined(PNG_NO_MNG_FEATURES) -# ifndef PNG_MNG_FEATURES_SUPPORTED -# define PNG_MNG_FEATURES_SUPPORTED -# endif -#endif - -#ifndef PNG_NO_FLOATING_POINT_SUPPORTED -# ifndef PNG_FLOATING_POINT_SUPPORTED -# define PNG_FLOATING_POINT_SUPPORTED -# endif -#endif - -/* If you are running on a machine where you cannot allocate more - * than 64K of memory at once, uncomment this. While libpng will not - * normally need that much memory in a chunk (unless you load up a very - * large file), zlib needs to know how big of a chunk it can use, and - * libpng thus makes sure to check any memory allocation to verify it - * will fit into memory. -#define PNG_MAX_MALLOC_64K - */ -#if defined(MAXSEG_64K) && !defined(PNG_MAX_MALLOC_64K) -# define PNG_MAX_MALLOC_64K -#endif - -/* Special munging to support doing things the 'cygwin' way: - * 'Normal' png-on-win32 defines/defaults: - * PNG_BUILD_DLL -- building dll - * PNG_USE_DLL -- building an application, linking to dll - * (no define) -- building static library, or building an - * application and linking to the static lib - * 'Cygwin' defines/defaults: - * PNG_BUILD_DLL -- (ignored) building the dll - * (no define) -- (ignored) building an application, linking to the dll - * PNG_STATIC -- (ignored) building the static lib, or building an - * application that links to the static lib. - * ALL_STATIC -- (ignored) building various static libs, or building an - * application that links to the static libs. - * Thus, - * a cygwin user should define either PNG_BUILD_DLL or PNG_STATIC, and - * this bit of #ifdefs will define the 'correct' config variables based on - * that. If a cygwin user *wants* to define 'PNG_USE_DLL' that's okay, but - * unnecessary. - * - * Also, the precedence order is: - * ALL_STATIC (since we can't #undef something outside our namespace) - * PNG_BUILD_DLL - * PNG_STATIC - * (nothing) == PNG_USE_DLL - * - * CYGWIN (2002-01-20): The preceding is now obsolete. With the advent - * of auto-import in binutils, we no longer need to worry about - * __declspec(dllexport) / __declspec(dllimport) and friends. Therefore, - * we don't need to worry about PNG_STATIC or ALL_STATIC when it comes - * to __declspec() stuff. However, we DO need to worry about - * PNG_BUILD_DLL and PNG_STATIC because those change some defaults - * such as CONSOLE_IO and whether GLOBAL_ARRAYS are allowed. - */ -#if defined(__CYGWIN__) -# if defined(ALL_STATIC) -# if defined(PNG_BUILD_DLL) -# undef PNG_BUILD_DLL -# endif -# if defined(PNG_USE_DLL) -# undef PNG_USE_DLL -# endif -# if defined(PNG_DLL) -# undef PNG_DLL -# endif -# if !defined(PNG_STATIC) -# define PNG_STATIC -# endif -# else -# if defined (PNG_BUILD_DLL) -# if defined(PNG_STATIC) -# undef PNG_STATIC -# endif -# if defined(PNG_USE_DLL) -# undef PNG_USE_DLL -# endif -# if !defined(PNG_DLL) -# define PNG_DLL -# endif -# else -# if defined(PNG_STATIC) -# if defined(PNG_USE_DLL) -# undef PNG_USE_DLL -# endif -# if defined(PNG_DLL) -# undef PNG_DLL -# endif -# else -# if !defined(PNG_USE_DLL) -# define PNG_USE_DLL -# endif -# if !defined(PNG_DLL) -# define PNG_DLL -# endif -# endif -# endif -# endif -#endif - -/* This protects us against compilers that run on a windowing system - * and thus don't have or would rather us not use the stdio types: - * stdin, stdout, and stderr. The only one currently used is stderr - * in png_error() and png_warning(). #defining PNG_NO_CONSOLE_IO will - * prevent these from being compiled and used. #defining PNG_NO_STDIO - * will also prevent these, plus will prevent the entire set of stdio - * macros and functions (FILE *, printf, etc.) from being compiled and used, - * unless (PNG_DEBUG > 0) has been #defined. - * - * #define PNG_NO_CONSOLE_IO - * #define PNG_NO_STDIO - */ - -#if defined(_WIN32_WCE) -# include - /* Console I/O functions are not supported on WindowsCE */ -# define PNG_NO_CONSOLE_IO -# ifdef PNG_DEBUG -# undef PNG_DEBUG -# endif -#endif - -#ifdef PNG_BUILD_DLL -# ifndef PNG_CONSOLE_IO_SUPPORTED -# ifndef PNG_NO_CONSOLE_IO -# define PNG_NO_CONSOLE_IO -# endif -# endif -#endif - -# ifdef PNG_NO_STDIO -# ifndef PNG_NO_CONSOLE_IO -# define PNG_NO_CONSOLE_IO -# endif -# ifdef PNG_DEBUG -# if (PNG_DEBUG > 0) -# include -# endif -# endif -# else -# if !defined(_WIN32_WCE) -/* "stdio.h" functions are not supported on WindowsCE */ -# include -# endif -# endif - -/* This macro protects us against machines that don't have function - * prototypes (ie K&R style headers). If your compiler does not handle - * function prototypes, define this macro and use the included ansi2knr. - * I've always been able to use _NO_PROTO as the indicator, but you may - * need to drag the empty declaration out in front of here, or change the - * ifdef to suit your own needs. - */ -#ifndef PNGARG - -#ifdef OF /* zlib prototype munger */ -# define PNGARG(arglist) OF(arglist) -#else - -#ifdef _NO_PROTO -# define PNGARG(arglist) () -# ifndef PNG_TYPECAST_NULL -# define PNG_TYPECAST_NULL -# endif -#else -# define PNGARG(arglist) arglist -#endif /* _NO_PROTO */ - -#endif /* OF */ - -#endif /* PNGARG */ - -/* Try to determine if we are compiling on a Mac. Note that testing for - * just __MWERKS__ is not good enough, because the Codewarrior is now used - * on non-Mac platforms. - */ -#ifndef MACOS -# if (defined(__MWERKS__) && defined(macintosh)) || defined(applec) || \ - defined(THINK_C) || (defined(__SC__) && !defined(__DMC__))|| defined(TARGET_OS_MAC) -# define MACOS -# endif -#endif - -/* enough people need this for various reasons to include it here */ -#if !defined(MACOS) && !defined(RISCOS) && !defined(_WIN32_WCE) -# include -#endif - -#if !defined(PNG_SETJMP_NOT_SUPPORTED) && !defined(PNG_NO_SETJMP_SUPPORTED) -# define PNG_SETJMP_SUPPORTED -#endif - -#ifdef PNG_SETJMP_SUPPORTED -/* This is an attempt to force a single setjmp behaviour on Linux. If - * the X config stuff didn't define _BSD_SOURCE we wouldn't need this. - */ - -# ifdef __linux__ -# ifdef _BSD_SOURCE -# define PNG_SAVE_BSD_SOURCE -# undef _BSD_SOURCE -# endif -# ifdef _SETJMP_H - /* If you encounter a compiler error here, see the explanation - * near the end of INSTALL. - */ - __png.h__ already includes setjmp.h; - __dont__ include it again.; -# endif -# endif /* __linux__ */ - - /* include setjmp.h for error handling */ -# include - -# ifdef __linux__ -# ifdef PNG_SAVE_BSD_SOURCE -# define _BSD_SOURCE -# undef PNG_SAVE_BSD_SOURCE -# endif -# endif /* __linux__ */ -#endif /* PNG_SETJMP_SUPPORTED */ - -#ifdef BSD -# include -#else -# include -#endif - -/* Other defines for things like memory and the like can go here. */ -#ifdef PNG_INTERNAL - -#include - -/* The functions exported by PNG_EXTERN are PNG_INTERNAL functions, which - * aren't usually used outside the library (as far as I know), so it is - * debatable if they should be exported at all. In the future, when it is - * possible to have run-time registry of chunk-handling functions, some of - * these will be made available again. -#define PNG_EXTERN extern - */ -#define PNG_EXTERN - -/* Other defines specific to compilers can go here. Try to keep - * them inside an appropriate ifdef/endif pair for portability. - */ - -#if defined(PNG_FLOATING_POINT_SUPPORTED) -# if defined(MACOS) - /* We need to check that hasn't already been included earlier - * as it seems it doesn't agree with , yet we should really use - * if possible. - */ -# if !defined(__MATH_H__) && !defined(__MATH_H) && !defined(__cmath__) -# include -# endif -# else -# include -# endif -# if defined(_AMIGA) && defined(__SASC) && defined(_M68881) - /* Amiga SAS/C: We must include builtin FPU functions when compiling using - * MATH=68881 - */ -# include -# endif -#endif - -/* Codewarrior on NT has linking problems without this. */ -#if (defined(__MWERKS__) && defined(WIN32)) || defined(__STDC__) -# define PNG_ALWAYS_EXTERN -#endif - -/* This provides the non-ANSI (far) memory allocation routines. */ -#if defined(__TURBOC__) && defined(__MSDOS__) -# include -# include -#endif - -/* I have no idea why is this necessary... */ -#if defined(_MSC_VER) && (defined(WIN32) || defined(_Windows) || \ - defined(_WINDOWS) || defined(_WIN32) || defined(__WIN32__)) -# include -#endif - -/* This controls how fine the dithering gets. As this allocates - * a largish chunk of memory (32K), those who are not as concerned - * with dithering quality can decrease some or all of these. - */ -#ifndef PNG_DITHER_RED_BITS -# define PNG_DITHER_RED_BITS 5 -#endif -#ifndef PNG_DITHER_GREEN_BITS -# define PNG_DITHER_GREEN_BITS 5 -#endif -#ifndef PNG_DITHER_BLUE_BITS -# define PNG_DITHER_BLUE_BITS 5 -#endif - -/* This controls how fine the gamma correction becomes when you - * are only interested in 8 bits anyway. Increasing this value - * results in more memory being used, and more pow() functions - * being called to fill in the gamma tables. Don't set this value - * less then 8, and even that may not work (I haven't tested it). - */ - -#ifndef PNG_MAX_GAMMA_8 -# define PNG_MAX_GAMMA_8 11 -#endif - -/* This controls how much a difference in gamma we can tolerate before - * we actually start doing gamma conversion. - */ -#ifndef PNG_GAMMA_THRESHOLD -# define PNG_GAMMA_THRESHOLD 0.05 -#endif - -#endif /* PNG_INTERNAL */ - -/* The following uses const char * instead of char * for error - * and warning message functions, so some compilers won't complain. - * If you do not want to use const, define PNG_NO_CONST here. - */ - -#ifndef PNG_NO_CONST -# define PNG_CONST const -#else -# define PNG_CONST -#endif - -/* The following defines give you the ability to remove code from the - * library that you will not be using. I wish I could figure out how to - * automate this, but I can't do that without making it seriously hard - * on the users. So if you are not using an ability, change the #define - * to and #undef, and that part of the library will not be compiled. If - * your linker can't find a function, you may want to make sure the - * ability is defined here. Some of these depend upon some others being - * defined. I haven't figured out all the interactions here, so you may - * have to experiment awhile to get everything to compile. If you are - * creating or using a shared library, you probably shouldn't touch this, - * as it will affect the size of the structures, and this will cause bad - * things to happen if the library and/or application ever change. - */ - -/* Any features you will not be using can be undef'ed here */ - -/* GR-P, 0.96a: Set "*TRANSFORMS_SUPPORTED as default but allow user - * to turn it off with "*TRANSFORMS_NOT_SUPPORTED" or *PNG_NO_*_TRANSFORMS - * on the compile line, then pick and choose which ones to define without - * having to edit this file. It is safe to use the *TRANSFORMS_NOT_SUPPORTED - * if you only want to have a png-compliant reader/writer but don't need - * any of the extra transformations. This saves about 80 kbytes in a - * typical installation of the library. (PNG_NO_* form added in version - * 1.0.1c, for consistency) - */ - -/* The size of the png_text structure changed in libpng-1.0.6 when - * iTXt is supported. It is turned off by default, to support old apps - * that malloc the png_text structure instead of calling png_set_text() - * and letting libpng malloc it. It will be turned on by default in - * libpng-1.3.0. - */ - -#ifndef PNG_iTXt_SUPPORTED -# if !defined(PNG_READ_iTXt_SUPPORTED) && !defined(PNG_NO_READ_iTXt) -# define PNG_NO_READ_iTXt -# endif -# if !defined(PNG_WRITE_iTXt_SUPPORTED) && !defined(PNG_NO_WRITE_iTXt) -# define PNG_NO_WRITE_iTXt -# endif -#endif - -/* The following support, added after version 1.0.0, can be turned off here en - * masse by defining PNG_LEGACY_SUPPORTED in case you need binary compatibility - * with old applications that require the length of png_struct and png_info - * to remain unchanged. - */ - -#ifdef PNG_LEGACY_SUPPORTED -# define PNG_NO_FREE_ME -# define PNG_NO_READ_UNKNOWN_CHUNKS -# define PNG_NO_WRITE_UNKNOWN_CHUNKS -# define PNG_NO_READ_USER_CHUNKS -# define PNG_NO_READ_iCCP -# define PNG_NO_WRITE_iCCP -# define PNG_NO_READ_iTXt -# define PNG_NO_WRITE_iTXt -# define PNG_NO_READ_sCAL -# define PNG_NO_WRITE_sCAL -# define PNG_NO_READ_sPLT -# define PNG_NO_WRITE_sPLT -# define PNG_NO_INFO_IMAGE -# define PNG_NO_READ_RGB_TO_GRAY -# define PNG_NO_READ_USER_TRANSFORM -# define PNG_NO_WRITE_USER_TRANSFORM -# define PNG_NO_USER_MEM -# define PNG_NO_READ_EMPTY_PLTE -# define PNG_NO_MNG_FEATURES -# define PNG_NO_FIXED_POINT_SUPPORTED -#endif - -/* Ignore attempt to turn off both floating and fixed point support */ -#if !defined(PNG_FLOATING_POINT_SUPPORTED) || \ - !defined(PNG_NO_FIXED_POINT_SUPPORTED) -# define PNG_FIXED_POINT_SUPPORTED -#endif - -#ifndef PNG_NO_FREE_ME -# define PNG_FREE_ME_SUPPORTED -#endif - -#if defined(PNG_READ_SUPPORTED) - -#if !defined(PNG_READ_TRANSFORMS_NOT_SUPPORTED) && \ - !defined(PNG_NO_READ_TRANSFORMS) -# define PNG_READ_TRANSFORMS_SUPPORTED -#endif - -#ifdef PNG_READ_TRANSFORMS_SUPPORTED -# ifndef PNG_NO_READ_EXPAND -# define PNG_READ_EXPAND_SUPPORTED -# endif -# ifndef PNG_NO_READ_SHIFT -# define PNG_READ_SHIFT_SUPPORTED -# endif -# ifndef PNG_NO_READ_PACK -# define PNG_READ_PACK_SUPPORTED -# endif -# ifndef PNG_NO_READ_BGR -# define PNG_READ_BGR_SUPPORTED -# endif -# ifndef PNG_NO_READ_SWAP -# define PNG_READ_SWAP_SUPPORTED -# endif -# ifndef PNG_NO_READ_PACKSWAP -# define PNG_READ_PACKSWAP_SUPPORTED -# endif -# ifndef PNG_NO_READ_INVERT -# define PNG_READ_INVERT_SUPPORTED -# endif -# ifndef PNG_NO_READ_DITHER -# define PNG_READ_DITHER_SUPPORTED -# endif -# ifndef PNG_NO_READ_BACKGROUND -# define PNG_READ_BACKGROUND_SUPPORTED -# endif -# ifndef PNG_NO_READ_16_TO_8 -# define PNG_READ_16_TO_8_SUPPORTED -# endif -# ifndef PNG_NO_READ_FILLER -# define PNG_READ_FILLER_SUPPORTED -# endif -# ifndef PNG_NO_READ_GAMMA -# define PNG_READ_GAMMA_SUPPORTED -# endif -# ifndef PNG_NO_READ_GRAY_TO_RGB -# define PNG_READ_GRAY_TO_RGB_SUPPORTED -# endif -# ifndef PNG_NO_READ_SWAP_ALPHA -# define PNG_READ_SWAP_ALPHA_SUPPORTED -# endif -# ifndef PNG_NO_READ_INVERT_ALPHA -# define PNG_READ_INVERT_ALPHA_SUPPORTED -# endif -# ifndef PNG_NO_READ_STRIP_ALPHA -# define PNG_READ_STRIP_ALPHA_SUPPORTED -# endif -# ifndef PNG_NO_READ_USER_TRANSFORM -# define PNG_READ_USER_TRANSFORM_SUPPORTED -# endif -# ifndef PNG_NO_READ_RGB_TO_GRAY -# define PNG_READ_RGB_TO_GRAY_SUPPORTED -# endif -#endif /* PNG_READ_TRANSFORMS_SUPPORTED */ - -#if !defined(PNG_NO_PROGRESSIVE_READ) && \ - !defined(PNG_PROGRESSIVE_READ_NOT_SUPPORTED) /* if you don't do progressive */ -# define PNG_PROGRESSIVE_READ_SUPPORTED /* reading. This is not talking */ -#endif /* about interlacing capability! You'll */ - /* still have interlacing unless you change the following line: */ - -#define PNG_READ_INTERLACING_SUPPORTED /* required for PNG-compliant decoders */ - -#ifndef PNG_NO_READ_COMPOSITE_NODIV -# ifndef PNG_NO_READ_COMPOSITED_NODIV /* libpng-1.0.x misspelling */ -# define PNG_READ_COMPOSITE_NODIV_SUPPORTED /* well tested on Intel, SGI */ -# endif -#endif - -/* Deprecated, will be removed from version 2.0.0. - Use PNG_MNG_FEATURES_SUPPORTED instead. */ -#ifndef PNG_NO_READ_EMPTY_PLTE -# define PNG_READ_EMPTY_PLTE_SUPPORTED -#endif - -#endif /* PNG_READ_SUPPORTED */ - -#if defined(PNG_WRITE_SUPPORTED) - -# if !defined(PNG_WRITE_TRANSFORMS_NOT_SUPPORTED) && \ - !defined(PNG_NO_WRITE_TRANSFORMS) -# define PNG_WRITE_TRANSFORMS_SUPPORTED -#endif - -#ifdef PNG_WRITE_TRANSFORMS_SUPPORTED -# ifndef PNG_NO_WRITE_SHIFT -# define PNG_WRITE_SHIFT_SUPPORTED -# endif -# ifndef PNG_NO_WRITE_PACK -# define PNG_WRITE_PACK_SUPPORTED -# endif -# ifndef PNG_NO_WRITE_BGR -# define PNG_WRITE_BGR_SUPPORTED -# endif -# ifndef PNG_NO_WRITE_SWAP -# define PNG_WRITE_SWAP_SUPPORTED -# endif -# ifndef PNG_NO_WRITE_PACKSWAP -# define PNG_WRITE_PACKSWAP_SUPPORTED -# endif -# ifndef PNG_NO_WRITE_INVERT -# define PNG_WRITE_INVERT_SUPPORTED -# endif -# ifndef PNG_NO_WRITE_FILLER -# define PNG_WRITE_FILLER_SUPPORTED /* same as WRITE_STRIP_ALPHA */ -# endif -# ifndef PNG_NO_WRITE_SWAP_ALPHA -# define PNG_WRITE_SWAP_ALPHA_SUPPORTED -# endif -# ifndef PNG_NO_WRITE_INVERT_ALPHA -# define PNG_WRITE_INVERT_ALPHA_SUPPORTED -# endif -# ifndef PNG_NO_WRITE_USER_TRANSFORM -# define PNG_WRITE_USER_TRANSFORM_SUPPORTED -# endif -#endif /* PNG_WRITE_TRANSFORMS_SUPPORTED */ - -#define PNG_WRITE_INTERLACING_SUPPORTED /* not required for PNG-compliant - encoders, but can cause trouble - if left undefined */ - -#if !defined(PNG_NO_WRITE_WEIGHTED_FILTER) && \ - defined(PNG_FLOATING_POINT_SUPPORTED) -# define PNG_WRITE_WEIGHTED_FILTER_SUPPORTED -#endif - -#ifndef PNG_NO_WRITE_FLUSH -# define PNG_WRITE_FLUSH_SUPPORTED -#endif - -/* Deprecated, see PNG_MNG_FEATURES_SUPPORTED, above */ -#ifndef PNG_NO_WRITE_EMPTY_PLTE -# define PNG_WRITE_EMPTY_PLTE_SUPPORTED -#endif - -#endif /* PNG_WRITE_SUPPORTED */ - -#ifndef PNG_1_0_X -# ifndef PNG_NO_ERROR_NUMBERS -# define PNG_ERROR_NUMBERS_SUPPORTED -# endif -#endif /* PNG_1_0_X */ - -#if defined(PNG_READ_USER_TRANSFORM_SUPPORTED) || \ - defined(PNG_WRITE_USER_TRANSFORM_SUPPORTED) -# ifndef PNG_NO_USER_TRANSFORM_PTR -# define PNG_USER_TRANSFORM_PTR_SUPPORTED -# endif -#endif - -#ifndef PNG_NO_STDIO -# define PNG_TIME_RFC1123_SUPPORTED -#endif - -/* This adds extra functions in pngget.c for accessing data from the - * info pointer (added in version 0.99) - * png_get_image_width() - * png_get_image_height() - * png_get_bit_depth() - * png_get_color_type() - * png_get_compression_type() - * png_get_filter_type() - * png_get_interlace_type() - * png_get_pixel_aspect_ratio() - * png_get_pixels_per_meter() - * png_get_x_offset_pixels() - * png_get_y_offset_pixels() - * png_get_x_offset_microns() - * png_get_y_offset_microns() - */ -#if !defined(PNG_NO_EASY_ACCESS) && !defined(PNG_EASY_ACCESS_SUPPORTED) -# define PNG_EASY_ACCESS_SUPPORTED -#endif - -/* PNG_ASSEMBLER_CODE was enabled by default in version 1.2.0 - even when PNG_USE_PNGVCRD or PNG_USE_PNGGCCRD is not defined */ -#if defined(PNG_READ_SUPPORTED) && !defined(PNG_NO_ASSEMBLER_CODE) -# ifndef PNG_ASSEMBLER_CODE_SUPPORTED -# define PNG_ASSEMBLER_CODE_SUPPORTED -# endif -# if !defined(PNG_MMX_CODE_SUPPORTED) && !defined(PNG_NO_MMX_CODE) -# define PNG_MMX_CODE_SUPPORTED -# endif -#endif - -/* If you are sure that you don't need thread safety and you are compiling - with PNG_USE_PNGCCRD for an MMX application, you can define this for - faster execution. See pnggccrd.c. -#define PNG_THREAD_UNSAFE_OK -*/ - -#if !defined(PNG_1_0_X) -#if !defined(PNG_NO_USER_MEM) && !defined(PNG_USER_MEM_SUPPORTED) -# define PNG_USER_MEM_SUPPORTED -#endif -#endif /* PNG_1_0_X */ - -/* Added at libpng-1.2.6 */ -#if !defined(PNG_1_0_X) -#ifndef PNG_SET_USER_LIMITS_SUPPORTED -#if !defined(PNG_NO_SET_USER_LIMITS) && !defined(PNG_SET_USER_LIMITS_SUPPORTED) -# define PNG_SET_USER_LIMITS_SUPPORTED -#endif -#endif -#endif /* PNG_1_0_X */ - -/* Added at libpng-1.0.16 and 1.2.6. To accept all valid PNGS no matter - * how large, set these limits to 0x7fffffffL - */ -#ifndef PNG_USER_WIDTH_MAX -# define PNG_USER_WIDTH_MAX 1000000L -#endif -#ifndef PNG_USER_HEIGHT_MAX -# define PNG_USER_HEIGHT_MAX 1000000L -#endif - -/* These are currently experimental features, define them if you want */ - -/* very little testing */ -/* -#ifdef PNG_READ_SUPPORTED -# ifndef PNG_READ_16_TO_8_ACCURATE_SCALE_SUPPORTED -# define PNG_READ_16_TO_8_ACCURATE_SCALE_SUPPORTED -# endif -#endif -*/ - -/* This is only for PowerPC big-endian and 680x0 systems */ -/* some testing */ -/* -#ifndef PNG_READ_BIG_ENDIAN_SUPPORTED -# define PNG_READ_BIG_ENDIAN_SUPPORTED -#endif -*/ - -/* Buggy compilers (e.g., gcc 2.7.2.2) need this */ -/* -#define PNG_NO_POINTER_INDEXING -*/ - -/* These functions are turned off by default, as they will be phased out. */ -/* -#define PNG_USELESS_TESTS_SUPPORTED -#define PNG_CORRECT_PALETTE_SUPPORTED -*/ - -/* Any chunks you are not interested in, you can undef here. The - * ones that allocate memory may be expecially important (hIST, - * tEXt, zTXt, tRNS, pCAL). Others will just save time and make png_info - * a bit smaller. - */ - -#if defined(PNG_READ_SUPPORTED) && \ - !defined(PNG_READ_ANCILLARY_CHUNKS_NOT_SUPPORTED) && \ - !defined(PNG_NO_READ_ANCILLARY_CHUNKS) -# define PNG_READ_ANCILLARY_CHUNKS_SUPPORTED -#endif - -#if defined(PNG_WRITE_SUPPORTED) && \ - !defined(PNG_WRITE_ANCILLARY_CHUNKS_NOT_SUPPORTED) && \ - !defined(PNG_NO_WRITE_ANCILLARY_CHUNKS) -# define PNG_WRITE_ANCILLARY_CHUNKS_SUPPORTED -#endif - -#ifdef PNG_READ_ANCILLARY_CHUNKS_SUPPORTED - -#ifdef PNG_NO_READ_TEXT -# define PNG_NO_READ_iTXt -# define PNG_NO_READ_tEXt -# define PNG_NO_READ_zTXt -#endif -#ifndef PNG_NO_READ_bKGD -# define PNG_READ_bKGD_SUPPORTED -# define PNG_bKGD_SUPPORTED -#endif -#ifndef PNG_NO_READ_cHRM -# define PNG_READ_cHRM_SUPPORTED -# define PNG_cHRM_SUPPORTED -#endif -#ifndef PNG_NO_READ_gAMA -# define PNG_READ_gAMA_SUPPORTED -# define PNG_gAMA_SUPPORTED -#endif -#ifndef PNG_NO_READ_hIST -# define PNG_READ_hIST_SUPPORTED -# define PNG_hIST_SUPPORTED -#endif -#ifndef PNG_NO_READ_iCCP -# define PNG_READ_iCCP_SUPPORTED -# define PNG_iCCP_SUPPORTED -#endif -#ifndef PNG_NO_READ_iTXt -# ifndef PNG_READ_iTXt_SUPPORTED -# define PNG_READ_iTXt_SUPPORTED -# endif -# ifndef PNG_iTXt_SUPPORTED -# define PNG_iTXt_SUPPORTED -# endif -#endif -#ifndef PNG_NO_READ_oFFs -# define PNG_READ_oFFs_SUPPORTED -# define PNG_oFFs_SUPPORTED -#endif -#ifndef PNG_NO_READ_pCAL -# define PNG_READ_pCAL_SUPPORTED -# define PNG_pCAL_SUPPORTED -#endif -#ifndef PNG_NO_READ_sCAL -# define PNG_READ_sCAL_SUPPORTED -# define PNG_sCAL_SUPPORTED -#endif -#ifndef PNG_NO_READ_pHYs -# define PNG_READ_pHYs_SUPPORTED -# define PNG_pHYs_SUPPORTED -#endif -#ifndef PNG_NO_READ_sBIT -# define PNG_READ_sBIT_SUPPORTED -# define PNG_sBIT_SUPPORTED -#endif -#ifndef PNG_NO_READ_sPLT -# define PNG_READ_sPLT_SUPPORTED -# define PNG_sPLT_SUPPORTED -#endif -#ifndef PNG_NO_READ_sRGB -# define PNG_READ_sRGB_SUPPORTED -# define PNG_sRGB_SUPPORTED -#endif -#ifndef PNG_NO_READ_tEXt -# define PNG_READ_tEXt_SUPPORTED -# define PNG_tEXt_SUPPORTED -#endif -#ifndef PNG_NO_READ_tIME -# define PNG_READ_tIME_SUPPORTED -# define PNG_tIME_SUPPORTED -#endif -#ifndef PNG_NO_READ_tRNS -# define PNG_READ_tRNS_SUPPORTED -# define PNG_tRNS_SUPPORTED -#endif -#ifndef PNG_NO_READ_zTXt -# define PNG_READ_zTXt_SUPPORTED -# define PNG_zTXt_SUPPORTED -#endif -#ifndef PNG_NO_READ_UNKNOWN_CHUNKS -# define PNG_READ_UNKNOWN_CHUNKS_SUPPORTED -# ifndef PNG_UNKNOWN_CHUNKS_SUPPORTED -# define PNG_UNKNOWN_CHUNKS_SUPPORTED -# endif -# ifndef PNG_NO_HANDLE_AS_UNKNOWN -# define PNG_HANDLE_AS_UNKNOWN_SUPPORTED -# endif -#endif -#if !defined(PNG_NO_READ_USER_CHUNKS) && \ - defined(PNG_READ_UNKNOWN_CHUNKS_SUPPORTED) -# define PNG_READ_USER_CHUNKS_SUPPORTED -# define PNG_USER_CHUNKS_SUPPORTED -# ifdef PNG_NO_READ_UNKNOWN_CHUNKS -# undef PNG_NO_READ_UNKNOWN_CHUNKS -# endif -# ifdef PNG_NO_HANDLE_AS_UNKNOWN -# undef PNG_NO_HANDLE_AS_UNKNOWN -# endif -#endif -#ifndef PNG_NO_READ_OPT_PLTE -# define PNG_READ_OPT_PLTE_SUPPORTED /* only affects support of the */ -#endif /* optional PLTE chunk in RGB and RGBA images */ -#if defined(PNG_READ_iTXt_SUPPORTED) || defined(PNG_READ_tEXt_SUPPORTED) || \ - defined(PNG_READ_zTXt_SUPPORTED) -# define PNG_READ_TEXT_SUPPORTED -# define PNG_TEXT_SUPPORTED -#endif - -#endif /* PNG_READ_ANCILLARY_CHUNKS_SUPPORTED */ - -#ifdef PNG_WRITE_ANCILLARY_CHUNKS_SUPPORTED - -#ifdef PNG_NO_WRITE_TEXT -# define PNG_NO_WRITE_iTXt -# define PNG_NO_WRITE_tEXt -# define PNG_NO_WRITE_zTXt -#endif -#ifndef PNG_NO_WRITE_bKGD -# define PNG_WRITE_bKGD_SUPPORTED -# ifndef PNG_bKGD_SUPPORTED -# define PNG_bKGD_SUPPORTED -# endif -#endif -#ifndef PNG_NO_WRITE_cHRM -# define PNG_WRITE_cHRM_SUPPORTED -# ifndef PNG_cHRM_SUPPORTED -# define PNG_cHRM_SUPPORTED -# endif -#endif -#ifndef PNG_NO_WRITE_gAMA -# define PNG_WRITE_gAMA_SUPPORTED -# ifndef PNG_gAMA_SUPPORTED -# define PNG_gAMA_SUPPORTED -# endif -#endif -#ifndef PNG_NO_WRITE_hIST -# define PNG_WRITE_hIST_SUPPORTED -# ifndef PNG_hIST_SUPPORTED -# define PNG_hIST_SUPPORTED -# endif -#endif -#ifndef PNG_NO_WRITE_iCCP -# define PNG_WRITE_iCCP_SUPPORTED -# ifndef PNG_iCCP_SUPPORTED -# define PNG_iCCP_SUPPORTED -# endif -#endif -#ifndef PNG_NO_WRITE_iTXt -# ifndef PNG_WRITE_iTXt_SUPPORTED -# define PNG_WRITE_iTXt_SUPPORTED -# endif -# ifndef PNG_iTXt_SUPPORTED -# define PNG_iTXt_SUPPORTED -# endif -#endif -#ifndef PNG_NO_WRITE_oFFs -# define PNG_WRITE_oFFs_SUPPORTED -# ifndef PNG_oFFs_SUPPORTED -# define PNG_oFFs_SUPPORTED -# endif -#endif -#ifndef PNG_NO_WRITE_pCAL -# define PNG_WRITE_pCAL_SUPPORTED -# ifndef PNG_pCAL_SUPPORTED -# define PNG_pCAL_SUPPORTED -# endif -#endif -#ifndef PNG_NO_WRITE_sCAL -# define PNG_WRITE_sCAL_SUPPORTED -# ifndef PNG_sCAL_SUPPORTED -# define PNG_sCAL_SUPPORTED -# endif -#endif -#ifndef PNG_NO_WRITE_pHYs -# define PNG_WRITE_pHYs_SUPPORTED -# ifndef PNG_pHYs_SUPPORTED -# define PNG_pHYs_SUPPORTED -# endif -#endif -#ifndef PNG_NO_WRITE_sBIT -# define PNG_WRITE_sBIT_SUPPORTED -# ifndef PNG_sBIT_SUPPORTED -# define PNG_sBIT_SUPPORTED -# endif -#endif -#ifndef PNG_NO_WRITE_sPLT -# define PNG_WRITE_sPLT_SUPPORTED -# ifndef PNG_sPLT_SUPPORTED -# define PNG_sPLT_SUPPORTED -# endif -#endif -#ifndef PNG_NO_WRITE_sRGB -# define PNG_WRITE_sRGB_SUPPORTED -# ifndef PNG_sRGB_SUPPORTED -# define PNG_sRGB_SUPPORTED -# endif -#endif -#ifndef PNG_NO_WRITE_tEXt -# define PNG_WRITE_tEXt_SUPPORTED -# ifndef PNG_tEXt_SUPPORTED -# define PNG_tEXt_SUPPORTED -# endif -#endif -#ifndef PNG_NO_WRITE_tIME -# define PNG_WRITE_tIME_SUPPORTED -# ifndef PNG_tIME_SUPPORTED -# define PNG_tIME_SUPPORTED -# endif -#endif -#ifndef PNG_NO_WRITE_tRNS -# define PNG_WRITE_tRNS_SUPPORTED -# ifndef PNG_tRNS_SUPPORTED -# define PNG_tRNS_SUPPORTED -# endif -#endif -#ifndef PNG_NO_WRITE_zTXt -# define PNG_WRITE_zTXt_SUPPORTED -# ifndef PNG_zTXt_SUPPORTED -# define PNG_zTXt_SUPPORTED -# endif -#endif -#ifndef PNG_NO_WRITE_UNKNOWN_CHUNKS -# define PNG_WRITE_UNKNOWN_CHUNKS_SUPPORTED -# ifndef PNG_UNKNOWN_CHUNKS_SUPPORTED -# define PNG_UNKNOWN_CHUNKS_SUPPORTED -# endif -# ifndef PNG_NO_HANDLE_AS_UNKNOWN -# ifndef PNG_HANDLE_AS_UNKNOWN_SUPPORTED -# define PNG_HANDLE_AS_UNKNOWN_SUPPORTED -# endif -# endif -#endif -#if defined(PNG_WRITE_iTXt_SUPPORTED) || defined(PNG_WRITE_tEXt_SUPPORTED) || \ - defined(PNG_WRITE_zTXt_SUPPORTED) -# define PNG_WRITE_TEXT_SUPPORTED -# ifndef PNG_TEXT_SUPPORTED -# define PNG_TEXT_SUPPORTED -# endif -#endif - -#endif /* PNG_WRITE_ANCILLARY_CHUNKS_SUPPORTED */ - -/* Turn this off to disable png_read_png() and - * png_write_png() and leave the row_pointers member - * out of the info structure. - */ -#ifndef PNG_NO_INFO_IMAGE -# define PNG_INFO_IMAGE_SUPPORTED -#endif - -/* need the time information for reading tIME chunks */ -#if defined(PNG_tIME_SUPPORTED) -# if !defined(_WIN32_WCE) - /* "time.h" functions are not supported on WindowsCE */ -# include -# endif -#endif - -/* Some typedefs to get us started. These should be safe on most of the - * common platforms. The typedefs should be at least as large as the - * numbers suggest (a png_uint_32 must be at least 32 bits long), but they - * don't have to be exactly that size. Some compilers dislike passing - * unsigned shorts as function parameters, so you may be better off using - * unsigned int for png_uint_16. Likewise, for 64-bit systems, you may - * want to have unsigned int for png_uint_32 instead of unsigned long. - */ - -typedef unsigned long png_uint_32; -typedef long png_int_32; -typedef unsigned short png_uint_16; -typedef short png_int_16; -typedef unsigned char png_byte; - -/* This is usually size_t. It is typedef'ed just in case you need it to - change (I'm not sure if you will or not, so I thought I'd be safe) */ -#ifdef PNG_SIZE_T - typedef PNG_SIZE_T png_size_t; -# define png_sizeof(x) png_convert_size(sizeof (x)) -#else - typedef size_t png_size_t; -# define png_sizeof(x) sizeof (x) -#endif - -/* The following is needed for medium model support. It cannot be in the - * PNG_INTERNAL section. Needs modification for other compilers besides - * MSC. Model independent support declares all arrays and pointers to be - * large using the far keyword. The zlib version used must also support - * model independent data. As of version zlib 1.0.4, the necessary changes - * have been made in zlib. The USE_FAR_KEYWORD define triggers other - * changes that are needed. (Tim Wegner) - */ - -/* Separate compiler dependencies (problem here is that zlib.h always - defines FAR. (SJT) */ -#ifdef __BORLANDC__ -# if defined(__LARGE__) || defined(__HUGE__) || defined(__COMPACT__) -# define LDATA 1 -# else -# define LDATA 0 -# endif - /* GRR: why is Cygwin in here? Cygwin is not Borland C... */ -# if !defined(__WIN32__) && !defined(__FLAT__) && !defined(__CYGWIN__) -# define PNG_MAX_MALLOC_64K -# if (LDATA != 1) -# ifndef FAR -# define FAR __far -# endif -# define USE_FAR_KEYWORD -# endif /* LDATA != 1 */ - /* Possibly useful for moving data out of default segment. - * Uncomment it if you want. Could also define FARDATA as - * const if your compiler supports it. (SJT) -# define FARDATA FAR - */ -# endif /* __WIN32__, __FLAT__, __CYGWIN__ */ -#endif /* __BORLANDC__ */ - - -/* Suggest testing for specific compiler first before testing for - * FAR. The Watcom compiler defines both __MEDIUM__ and M_I86MM, - * making reliance oncertain keywords suspect. (SJT) - */ - -/* MSC Medium model */ -#if defined(FAR) -# if defined(M_I86MM) -# define USE_FAR_KEYWORD -# define FARDATA FAR -# include -# endif -#endif - -/* SJT: default case */ -#ifndef FAR -# define FAR -#endif - -/* At this point FAR is always defined */ -#ifndef FARDATA -# define FARDATA -#endif - -/* Typedef for floating-point numbers that are converted - to fixed-point with a multiple of 100,000, e.g., int_gamma */ -typedef png_int_32 png_fixed_point; - -/* Add typedefs for pointers */ -typedef void FAR * png_voidp; -typedef png_byte FAR * png_bytep; -typedef png_uint_32 FAR * png_uint_32p; -typedef png_int_32 FAR * png_int_32p; -typedef png_uint_16 FAR * png_uint_16p; -typedef png_int_16 FAR * png_int_16p; -typedef PNG_CONST char FAR * png_const_charp; -typedef char FAR * png_charp; -typedef png_fixed_point FAR * png_fixed_point_p; - -#ifndef PNG_NO_STDIO -#if defined(_WIN32_WCE) -typedef HANDLE png_FILE_p; -#else -typedef FILE * png_FILE_p; -#endif -#endif - -#ifdef PNG_FLOATING_POINT_SUPPORTED -typedef double FAR * png_doublep; -#endif - -/* Pointers to pointers; i.e. arrays */ -typedef png_byte FAR * FAR * png_bytepp; -typedef png_uint_32 FAR * FAR * png_uint_32pp; -typedef png_int_32 FAR * FAR * png_int_32pp; -typedef png_uint_16 FAR * FAR * png_uint_16pp; -typedef png_int_16 FAR * FAR * png_int_16pp; -typedef PNG_CONST char FAR * FAR * png_const_charpp; -typedef char FAR * FAR * png_charpp; -typedef png_fixed_point FAR * FAR * png_fixed_point_pp; -#ifdef PNG_FLOATING_POINT_SUPPORTED -typedef double FAR * FAR * png_doublepp; -#endif - -/* Pointers to pointers to pointers; i.e., pointer to array */ -typedef char FAR * FAR * FAR * png_charppp; - -/* libpng typedefs for types in zlib. If zlib changes - * or another compression library is used, then change these. - * Eliminates need to change all the source files. - */ -typedef charf * png_zcharp; -typedef charf * FAR * png_zcharpp; -typedef z_stream FAR * png_zstreamp; - -/* - * Define PNG_BUILD_DLL if the module being built is a Windows - * LIBPNG DLL. - * - * Define PNG_USE_DLL if you want to *link* to the Windows LIBPNG DLL. - * It is equivalent to Microsoft predefined macro _DLL that is - * automatically defined when you compile using the share - * version of the CRT (C Run-Time library) - * - * The cygwin mods make this behavior a little different: - * Define PNG_BUILD_DLL if you are building a dll for use with cygwin - * Define PNG_STATIC if you are building a static library for use with cygwin, - * -or- if you are building an application that you want to link to the - * static library. - * PNG_USE_DLL is defined by default (no user action needed) unless one of - * the other flags is defined. - */ - -#if !defined(PNG_DLL) && (defined(PNG_BUILD_DLL) || defined(PNG_USE_DLL)) -# define PNG_DLL -#endif -/* If CYGWIN, then disallow GLOBAL ARRAYS unless building a static lib. - * When building a static lib, default to no GLOBAL ARRAYS, but allow - * command-line override - */ -#if defined(__CYGWIN__) -# if !defined(PNG_STATIC) -# if defined(PNG_USE_GLOBAL_ARRAYS) -# undef PNG_USE_GLOBAL_ARRAYS -# endif -# if !defined(PNG_USE_LOCAL_ARRAYS) -# define PNG_USE_LOCAL_ARRAYS -# endif -# else -# if defined(PNG_USE_LOCAL_ARRAYS) || defined(PNG_NO_GLOBAL_ARRAYS) -# if defined(PNG_USE_GLOBAL_ARRAYS) -# undef PNG_USE_GLOBAL_ARRAYS -# endif -# endif -# endif -# if !defined(PNG_USE_LOCAL_ARRAYS) && !defined(PNG_USE_GLOBAL_ARRAYS) -# define PNG_USE_LOCAL_ARRAYS -# endif -#endif - -/* Do not use global arrays (helps with building DLL's) - * They are no longer used in libpng itself, since version 1.0.5c, - * but might be required for some pre-1.0.5c applications. - */ -#if !defined(PNG_USE_LOCAL_ARRAYS) && !defined(PNG_USE_GLOBAL_ARRAYS) -# if defined(PNG_NO_GLOBAL_ARRAYS) || (defined(__GNUC__) && defined(PNG_DLL)) -# define PNG_USE_LOCAL_ARRAYS -# else -# define PNG_USE_GLOBAL_ARRAYS -# endif -#endif - -#if defined(__CYGWIN__) || defined(__WINE__) -# undef PNGAPI -# if defined(__WINE__) -# define PNGAPI -# else -# define PNGAPI __cdecl -# endif -# undef PNG_IMPEXP -# define PNG_IMPEXP -#endif - -/* If you define PNGAPI, e.g., with compiler option "-DPNGAPI=__stdcall", - * you may get warnings regarding the linkage of png_zalloc and png_zfree. - * Don't ignore those warnings; you must also reset the default calling - * convention in your compiler to match your PNGAPI, and you must build - * zlib and your applications the same way you build libpng. - */ - -#if defined(__MINGW32__) && !defined(PNG_MODULEDEF) -# ifndef PNG_NO_MODULEDEF -# define PNG_NO_MODULEDEF -# endif -#endif - -#if !defined(PNG_IMPEXP) && defined(PNG_BUILD_DLL) && !defined(PNG_NO_MODULEDEF) -# define PNG_IMPEXP -#endif - -#if defined(PNG_DLL) || defined(_DLL) || defined(__DLL__ ) || \ - (( defined(_Windows) || defined(_WINDOWS) || \ - defined(WIN32) || defined(_WIN32) || defined(__WIN32__) )) - -# ifndef PNGAPI -# if defined(__GNUC__) || (defined (_MSC_VER) && (_MSC_VER >= 800)) -# define PNGAPI __cdecl -# else -# define PNGAPI _cdecl -# endif -# endif - -# if !defined(PNG_IMPEXP) && (!defined(PNG_DLL) || \ - 0 /* WINCOMPILER_WITH_NO_SUPPORT_FOR_DECLIMPEXP */) -# define PNG_IMPEXP -# endif - -# if !defined(PNG_IMPEXP) - -# define PNG_EXPORT_TYPE1(type,symbol) PNG_IMPEXP type PNGAPI symbol -# define PNG_EXPORT_TYPE2(type,symbol) type PNG_IMPEXP PNGAPI symbol - - /* Borland/Microsoft */ -# if defined(_MSC_VER) || defined(__BORLANDC__) -# if (_MSC_VER >= 800) || (__BORLANDC__ >= 0x500) -# define PNG_EXPORT PNG_EXPORT_TYPE1 -# else -# define PNG_EXPORT PNG_EXPORT_TYPE2 -# if defined(PNG_BUILD_DLL) -# define PNG_IMPEXP __export -# else -# define PNG_IMPEXP /*__import */ /* doesn't exist AFAIK in - VC++ */ -# endif /* Exists in Borland C++ for - C++ classes (== huge) */ -# endif -# endif - -# if !defined(PNG_IMPEXP) -# if defined(PNG_BUILD_DLL) -# define PNG_IMPEXP __declspec(dllexport) -# else -# define PNG_IMPEXP __declspec(dllimport) -# endif -# endif -# endif /* PNG_IMPEXP */ -#else /* !(DLL || non-cygwin WINDOWS) */ -# if (defined(__IBMC__) || defined(__IBMCPP__)) && defined(__OS2__) -# ifndef PNGAPI -# define PNGAPI _System -# endif -# else -# if 0 /* ... other platforms, with other meanings */ -# endif -# endif -#endif - -#if defined(__VISAGECPP__) -/* I don't compile with this _System linkage for wxWidgets */ -# ifdef PNGAPI -# undef PNGAPI -# endif -# define PNGAPI _Optlink -# define PNG_IMPEXP -# define PNG_USE_LOCAL_ARRAYS -# ifdef PNG_USE_GLOBAL_ARRAYS -# undef PNG_USE_GLOBAL_ARRAYS -# endif -extern const char png_libpng_ver[18]; -#endif - -#ifndef PNGAPI -# define PNGAPI -#endif -#ifndef PNG_IMPEXP -# define PNG_IMPEXP -#endif - -#ifndef PNG_EXPORT -# define PNG_EXPORT(type,symbol) PNG_IMPEXP type PNGAPI symbol -#endif - -#ifdef PNG_USE_GLOBAL_ARRAYS -# ifndef PNG_EXPORT_VAR -# define PNG_EXPORT_VAR(type) extern PNG_IMPEXP type -# endif -#endif - -/* User may want to use these so they are not in PNG_INTERNAL. Any library - * functions that are passed far data must be model independent. - */ - -#ifndef PNG_ABORT -# define PNG_ABORT() abort() -#endif - -#ifdef PNG_SETJMP_SUPPORTED -# define png_jmpbuf(png_ptr) ((png_ptr)->jmpbuf) -#else -# define png_jmpbuf(png_ptr) \ - (LIBPNG_WAS_COMPILED_WITH__PNG_SETJMP_NOT_SUPPORTED) -#endif - -#if defined(USE_FAR_KEYWORD) /* memory model independent fns */ -/* use this to make far-to-near assignments */ -# define CHECK 1 -# define NOCHECK 0 -# define CVT_PTR(ptr) (png_far_to_near(png_ptr,ptr,CHECK)) -# define CVT_PTR_NOCHECK(ptr) (png_far_to_near(png_ptr,ptr,NOCHECK)) -# define png_strcpy _fstrcpy -# define png_strncpy _fstrncpy /* Added to v 1.2.6 */ -# define png_strlen _fstrlen -# define png_memcmp _fmemcmp /* SJT: added */ -# define png_memcpy _fmemcpy -# define png_memset _fmemset -#else /* use the usual functions */ -# define CVT_PTR(ptr) (ptr) -# define CVT_PTR_NOCHECK(ptr) (ptr) -# define png_strcpy strcpy -# define png_strncpy strncpy /* Added to v 1.2.6 */ -# define png_strlen strlen -# define png_memcmp memcmp /* SJT: added */ -# define png_memcpy memcpy -# define png_memset memset -#endif -/* End of memory model independent support */ - -/* Just a little check that someone hasn't tried to define something - * contradictory. - */ -#if (PNG_ZBUF_SIZE > 65536L) && defined(PNG_MAX_MALLOC_64K) -# undef PNG_ZBUF_SIZE -# define PNG_ZBUF_SIZE 65536L -#endif - -#ifdef PNG_READ_SUPPORTED -/* Prior to libpng-1.0.9, this block was in pngasmrd.h */ -#if defined(PNG_INTERNAL) - -/* These are the default thresholds before the MMX code kicks in; if either - * rowbytes or bitdepth is below the threshold, plain C code is used. These - * can be overridden at runtime via the png_set_mmx_thresholds() call in - * libpng 1.2.0 and later. The values below were chosen by Intel. - */ - -#ifndef PNG_MMX_ROWBYTES_THRESHOLD_DEFAULT -# define PNG_MMX_ROWBYTES_THRESHOLD_DEFAULT 128 /* >= */ -#endif -#ifndef PNG_MMX_BITDEPTH_THRESHOLD_DEFAULT -# define PNG_MMX_BITDEPTH_THRESHOLD_DEFAULT 9 /* >= */ -#endif - -/* Set this in the makefile for VC++ on Pentium, not here. */ -/* Platform must be Pentium. Makefile must assemble and load pngvcrd.c . - * MMX will be detected at run time and used if present. - */ -#ifdef PNG_USE_PNGVCRD -# define PNG_HAVE_ASSEMBLER_COMBINE_ROW -# define PNG_HAVE_ASSEMBLER_READ_INTERLACE -# define PNG_HAVE_ASSEMBLER_READ_FILTER_ROW -#endif - -/* Set this in the makefile for gcc/as on Pentium, not here. */ -/* Platform must be Pentium. Makefile must assemble and load pnggccrd.c . - * MMX will be detected at run time and used if present. - */ -#ifdef PNG_USE_PNGGCCRD -# define PNG_HAVE_ASSEMBLER_COMBINE_ROW -# define PNG_HAVE_ASSEMBLER_READ_INTERLACE -# define PNG_HAVE_ASSEMBLER_READ_FILTER_ROW -#endif -/* - see pnggccrd.c for info about what is currently enabled */ - -#endif /* PNG_INTERNAL */ -#endif /* PNG_READ_SUPPORTED */ - -#endif /* PNGCONF_H */ - diff --git a/wxWidgets/src/png/pngerror.c b/wxWidgets/src/png/pngerror.c deleted file mode 100644 index fda078ef58..0000000000 --- a/wxWidgets/src/png/pngerror.c +++ /dev/null @@ -1,295 +0,0 @@ - -/* pngerror.c - stub functions for i/o and memory allocation - * - * libpng version 1.2.7 - September 12, 2004 - * For conditions of distribution and use, see copyright notice in png.h - * Copyright (c) 1998-2004 Glenn Randers-Pehrson - * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) - * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) - * - * This file provides a location for all error handling. Users who - * need special error handling are expected to write replacement functions - * and use png_set_error_fn() to use those functions. See the instructions - * at each function. - */ - -#define PNG_INTERNAL -#include "png.h" - -static void /* PRIVATE */ -png_default_error PNGARG((png_structp png_ptr, - png_const_charp error_message)); -static void /* PRIVATE */ -png_default_warning PNGARG((png_structp png_ptr, - png_const_charp warning_message)); - -/* This function is called whenever there is a fatal error. This function - * should not be changed. If there is a need to handle errors differently, - * you should supply a replacement error function and use png_set_error_fn() - * to replace the error function at run-time. - */ -void PNGAPI -png_error(png_structp png_ptr, png_const_charp error_message) -{ -#ifdef PNG_ERROR_NUMBERS_SUPPORTED - char msg[16]; - if (png_ptr->flags&(PNG_FLAG_STRIP_ERROR_NUMBERS|PNG_FLAG_STRIP_ERROR_TEXT)) - { - if (*error_message == '#') - { - int offset; - for (offset=1; offset<15; offset++) - if (*(error_message+offset) == ' ') - break; - if (png_ptr->flags&PNG_FLAG_STRIP_ERROR_TEXT) - { - int i; - for (i=0; iflags&PNG_FLAG_STRIP_ERROR_TEXT) - { - msg[0]='0'; - msg[1]='\0'; - error_message=msg; - } - } - } -#endif - if (png_ptr != NULL && png_ptr->error_fn != NULL) - (*(png_ptr->error_fn))(png_ptr, error_message); - - /* If the custom handler doesn't exist, or if it returns, - use the default handler, which will not return. */ - png_default_error(png_ptr, error_message); -} - -/* This function is called whenever there is a non-fatal error. This function - * should not be changed. If there is a need to handle warnings differently, - * you should supply a replacement warning function and use - * png_set_error_fn() to replace the warning function at run-time. - */ -void PNGAPI -png_warning(png_structp png_ptr, png_const_charp warning_message) -{ - int offset = 0; -#ifdef PNG_ERROR_NUMBERS_SUPPORTED - if (png_ptr->flags&(PNG_FLAG_STRIP_ERROR_NUMBERS|PNG_FLAG_STRIP_ERROR_TEXT)) -#endif - { - if (*warning_message == '#') - { - for (offset=1; offset<15; offset++) - if (*(warning_message+offset) == ' ') - break; - } - } - if (png_ptr != NULL && png_ptr->warning_fn != NULL) - (*(png_ptr->warning_fn))(png_ptr, warning_message+offset); - else - png_default_warning(png_ptr, warning_message+offset); -} - -/* These utilities are used internally to build an error message that relates - * to the current chunk. The chunk name comes from png_ptr->chunk_name, - * this is used to prefix the message. The message is limited in length - * to 63 bytes, the name characters are output as hex digits wrapped in [] - * if the character is invalid. - */ -#define isnonalpha(c) ((c) < 65 || (c) > 122 || ((c) > 90 && (c) < 97)) -static PNG_CONST char png_digit[16] = { - '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', - 'A', 'B', 'C', 'D', 'E', 'F' -}; - -static void /* PRIVATE */ -png_format_buffer(png_structp png_ptr, png_charp buffer, png_const_charp - error_message) -{ - int iout = 0, iin = 0; - - while (iin < 4) - { - int c = png_ptr->chunk_name[iin++]; - if (isnonalpha(c)) - { - buffer[iout++] = '['; - buffer[iout++] = png_digit[(c & 0xf0) >> 4]; - buffer[iout++] = png_digit[c & 0x0f]; - buffer[iout++] = ']'; - } - else - { - buffer[iout++] = (png_byte)c; - } - } - - if (error_message == NULL) - buffer[iout] = 0; - else - { - buffer[iout++] = ':'; - buffer[iout++] = ' '; - png_strncpy(buffer+iout, error_message, 63); - buffer[iout+63] = 0; - } -} - -void PNGAPI -png_chunk_error(png_structp png_ptr, png_const_charp error_message) -{ - char msg[18+64]; - png_format_buffer(png_ptr, msg, error_message); - png_error(png_ptr, msg); -} - -void PNGAPI -png_chunk_warning(png_structp png_ptr, png_const_charp warning_message) -{ - char msg[18+64]; - png_format_buffer(png_ptr, msg, warning_message); - png_warning(png_ptr, msg); -} - -/* This is the default error handling function. Note that replacements for - * this function MUST NOT RETURN, or the program will likely crash. This - * function is used by default, or if the program supplies NULL for the - * error function pointer in png_set_error_fn(). - */ -static void /* PRIVATE */ -png_default_error(png_structp png_ptr, png_const_charp error_message) -{ -#ifndef PNG_NO_CONSOLE_IO -#ifdef PNG_ERROR_NUMBERS_SUPPORTED - if (*error_message == '#') - { - int offset; - char error_number[16]; - for (offset=0; offset<15; offset++) - { - error_number[offset] = *(error_message+offset+1); - if (*(error_message+offset) == ' ') - break; - } - if((offset > 1) && (offset < 15)) - { - error_number[offset-1]='\0'; - fprintf(stderr, "libpng error no. %s: %s\n", error_number, - error_message+offset); - } - else - fprintf(stderr, "libpng error: %s, offset=%d\n", error_message,offset); - } - else -#endif - fprintf(stderr, "libpng error: %s\n", error_message); -#endif - -#ifdef PNG_SETJMP_SUPPORTED -# ifdef USE_FAR_KEYWORD - { - jmp_buf jmpbuf; - png_memcpy(jmpbuf,png_ptr->jmpbuf,png_sizeof(jmp_buf)); - longjmp(jmpbuf, 1); - } -# else - longjmp(png_ptr->jmpbuf, 1); -# endif -#else - /* make compiler happy */ ; - if (png_ptr) - PNG_ABORT(); -#endif -#ifdef PNG_NO_CONSOLE_IO - /* make compiler happy */ ; - if (&error_message != NULL) - return; -#endif -} - -/* This function is called when there is a warning, but the library thinks - * it can continue anyway. Replacement functions don't have to do anything - * here if you don't want them to. In the default configuration, png_ptr is - * not used, but it is passed in case it may be useful. - */ -static void /* PRIVATE */ -png_default_warning(png_structp png_ptr, png_const_charp warning_message) -{ -#ifndef PNG_NO_CONSOLE_IO -# ifdef PNG_ERROR_NUMBERS_SUPPORTED - if (*warning_message == '#') - { - int offset; - char warning_number[16]; - for (offset=0; offset<15; offset++) - { - warning_number[offset]=*(warning_message+offset+1); - if (*(warning_message+offset) == ' ') - break; - } - if((offset > 1) && (offset < 15)) - { - warning_number[offset-1]='\0'; - fprintf(stderr, "libpng warning no. %s: %s\n", warning_number, - warning_message+offset); - } - else - fprintf(stderr, "libpng warning: %s\n", warning_message); - } - else -# endif - fprintf(stderr, "libpng warning: %s\n", warning_message); -#else - /* make compiler happy */ ; - if (warning_message) - return; -#endif - /* make compiler happy */ ; - if (png_ptr) - return; -} - -/* This function is called when the application wants to use another method - * of handling errors and warnings. Note that the error function MUST NOT - * return to the calling routine or serious problems will occur. The return - * method used in the default routine calls longjmp(png_ptr->jmpbuf, 1) - */ -void PNGAPI -png_set_error_fn(png_structp png_ptr, png_voidp error_ptr, - png_error_ptr error_fn, png_error_ptr warning_fn) -{ - png_ptr->error_ptr = error_ptr; - png_ptr->error_fn = error_fn; - png_ptr->warning_fn = warning_fn; -} - - -/* This function returns a pointer to the error_ptr associated with the user - * functions. The application should free any memory associated with this - * pointer before png_write_destroy and png_read_destroy are called. - */ -png_voidp PNGAPI -png_get_error_ptr(png_structp png_ptr) -{ - return ((png_voidp)png_ptr->error_ptr); -} - - -#ifdef PNG_ERROR_NUMBERS_SUPPORTED -void PNGAPI -png_set_strip_error_numbers(png_structp png_ptr, png_uint_32 strip_mode) -{ - if(png_ptr != NULL) - { - png_ptr->flags &= - ((~(PNG_FLAG_STRIP_ERROR_NUMBERS|PNG_FLAG_STRIP_ERROR_TEXT))&strip_mode); - } -} -#endif diff --git a/wxWidgets/src/png/pnggccrd.c b/wxWidgets/src/png/pnggccrd.c deleted file mode 100644 index 27c716a2c0..0000000000 --- a/wxWidgets/src/png/pnggccrd.c +++ /dev/null @@ -1,5408 +0,0 @@ -/* pnggccrd.c - mixed C/assembler version of utilities to read a PNG file - * - * For Intel x86 CPU (Pentium-MMX or later) and GNU C compiler. - * - * See http://www.intel.com/drg/pentiumII/appnotes/916/916.htm - * and http://www.intel.com/drg/pentiumII/appnotes/923/923.htm - * for Intel's performance analysis of the MMX vs. non-MMX code. - * - * libpng version 1.2.7 - September 12, 2004 - * For conditions of distribution and use, see copyright notice in png.h - * Copyright (c) 1998-2004 Glenn Randers-Pehrson - * Copyright (c) 1998, Intel Corporation - * - * Based on MSVC code contributed by Nirav Chhatrapati, Intel Corp., 1998. - * Interface to libpng contributed by Gilles Vollant, 1999. - * GNU C port by Greg Roelofs, 1999-2001. - * - * Lines 2350-4300 converted in place with intel2gas 1.3.1: - * - * intel2gas -mdI pnggccrd.c.partially-msvc -o pnggccrd.c - * - * and then cleaned up by hand. See http://hermes.terminal.at/intel2gas/ . - * - * NOTE: A sufficiently recent version of GNU as (or as.exe under DOS/Windows) - * is required to assemble the newer MMX instructions such as movq. - * For djgpp, see - * - * ftp://ftp.simtel.net/pub/simtelnet/gnu/djgpp/v2gnu/bnu281b.zip - * - * (or a later version in the same directory). For Linux, check your - * distribution's web site(s) or try these links: - * - * http://rufus.w3.org/linux/RPM/binutils.html - * http://www.debian.org/Packages/stable/devel/binutils.html - * ftp://ftp.slackware.com/pub/linux/slackware/slackware/slakware/d1/ - * binutils.tgz - * - * For other platforms, see the main GNU site: - * - * ftp://ftp.gnu.org/pub/gnu/binutils/ - * - * Version 2.5.2l.15 is definitely too old... - */ - -/* - * TEMPORARY PORTING NOTES AND CHANGELOG (mostly by Greg Roelofs) - * ===================================== - * - * 19991006: - * - fixed sign error in post-MMX cleanup code (16- & 32-bit cases) - * - * 19991007: - * - additional optimizations (possible or definite): - * x [DONE] write MMX code for 64-bit case (pixel_bytes == 8) [not tested] - * - write MMX code for 48-bit case (pixel_bytes == 6) - * - figure out what's up with 24-bit case (pixel_bytes == 3): - * why subtract 8 from width_mmx in the pass 4/5 case? - * (only width_mmx case) (near line 1606) - * x [DONE] replace pixel_bytes within each block with the true - * constant value (or are compilers smart enough to do that?) - * - rewrite all MMX interlacing code so it's aligned with - * the *beginning* of the row buffer, not the end. This - * would not only allow one to eliminate half of the memory - * writes for odd passes (that is, pass == odd), it may also - * eliminate some unaligned-data-access exceptions (assuming - * there's a penalty for not aligning 64-bit accesses on - * 64-bit boundaries). The only catch is that the "leftover" - * pixel(s) at the end of the row would have to be saved, - * but there are enough unused MMX registers in every case, - * so this is not a problem. A further benefit is that the - * post-MMX cleanup code (C code) in at least some of the - * cases could be done within the assembler block. - * x [DONE] the "v3 v2 v1 v0 v7 v6 v5 v4" comments are confusing, - * inconsistent, and don't match the MMX Programmer's Reference - * Manual conventions anyway. They should be changed to - * "b7 b6 b5 b4 b3 b2 b1 b0," where b0 indicates the byte that - * was lowest in memory (e.g., corresponding to a left pixel) - * and b7 is the byte that was highest (e.g., a right pixel). - * - * 19991016: - * - Brennan's Guide notwithstanding, gcc under Linux does *not* - * want globals prefixed by underscores when referencing them-- - * i.e., if the variable is const4, then refer to it as const4, - * not _const4. This seems to be a djgpp-specific requirement. - * Also, such variables apparently *must* be declared outside - * of functions; neither static nor automatic variables work if - * defined within the scope of a single function, but both - * static and truly global (multi-module) variables work fine. - * - * 19991023: - * - fixed png_combine_row() non-MMX replication bug (odd passes only?) - * - switched from string-concatenation-with-macros to cleaner method of - * renaming global variables for djgpp--i.e., always use prefixes in - * inlined assembler code (== strings) and conditionally rename the - * variables, not the other way around. Hence _const4, _mask8_0, etc. - * - * 19991024: - * - fixed mmxsupport()/png_do_read_interlace() first-row bug - * This one was severely weird: even though mmxsupport() doesn't touch - * ebx (where "row" pointer was stored), it nevertheless managed to zero - * the register (even in static/non-fPIC code--see below), which in turn - * caused png_do_read_interlace() to return prematurely on the first row of - * interlaced images (i.e., without expanding the interlaced pixels). - * Inspection of the generated assembly code didn't turn up any clues, - * although it did point at a minor optimization (i.e., get rid of - * mmx_supported_local variable and just use eax). Possibly the CPUID - * instruction is more destructive than it looks? (Not yet checked.) - * - "info gcc" was next to useless, so compared fPIC and non-fPIC assembly - * listings... Apparently register spillage has to do with ebx, since - * it's used to index the global offset table. Commenting it out of the - * input-reg lists in png_combine_row() eliminated compiler barfage, so - * ifdef'd with __PIC__ macro: if defined, use a global for unmask - * - * 19991107: - * - verified CPUID clobberage: 12-char string constant ("GenuineIntel", - * "AuthenticAMD", etc.) placed in ebx:ecx:edx. Still need to polish. - * - * 19991120: - * - made "diff" variable (now "_dif") global to simplify conversion of - * filtering routines (running out of regs, sigh). "diff" is still used - * in interlacing routines, however. - * - fixed up both versions of mmxsupport() (ORIG_THAT_USED_TO_CLOBBER_EBX - * macro determines which is used); original not yet tested. - * - * 20000213: - * - when compiling with gcc, be sure to use -fomit-frame-pointer - * - * 20000319: - * - fixed a register-name typo in png_do_read_interlace(), default (MMX) case, - * pass == 4 or 5, that caused visible corruption of interlaced images - * - * 20000623: - * - Various problems were reported with gcc 2.95.2 in the Cygwin environment, - * many of the form "forbidden register 0 (ax) was spilled for class AREG." - * This is explained at http://gcc.gnu.org/fom_serv/cache/23.html, and - * Chuck Wilson supplied a patch involving dummy output registers. See - * http://sourceforge.net/bugs/?func=detailbug&bug_id=108741&group_id=5624 - * for the original (anonymous) SourceForge bug report. - * - * 20000706: - * - Chuck Wilson passed along these remaining gcc 2.95.2 errors: - * pnggccrd.c: In function `png_combine_row': - * pnggccrd.c:525: more than 10 operands in `asm' - * pnggccrd.c:669: more than 10 operands in `asm' - * pnggccrd.c:828: more than 10 operands in `asm' - * pnggccrd.c:994: more than 10 operands in `asm' - * pnggccrd.c:1177: more than 10 operands in `asm' - * They are all the same problem and can be worked around by using the - * global _unmask variable unconditionally, not just in the -fPIC case. - * Reportedly earlier versions of gcc also have the problem with more than - * 10 operands; they just don't report it. Much strangeness ensues, etc. - * - * 20000729: - * - enabled png_read_filter_row_mmx_up() (shortest remaining unconverted - * MMX routine); began converting png_read_filter_row_mmx_sub() - * - to finish remaining sections: - * - clean up indentation and comments - * - preload local variables - * - add output and input regs (order of former determines numerical - * mapping of latter) - * - avoid all usage of ebx (including bx, bh, bl) register [20000823] - * - remove "$" from addressing of Shift and Mask variables [20000823] - * - * 20000731: - * - global union vars causing segfaults in png_read_filter_row_mmx_sub()? - * - * 20000822: - * - ARGH, stupid png_read_filter_row_mmx_sub() segfault only happens with - * shared-library (-fPIC) version! Code works just fine as part of static - * library. Damn damn damn damn damn, should have tested that sooner. - * ebx is getting clobbered again (explicitly this time); need to save it - * on stack or rewrite asm code to avoid using it altogether. Blargh! - * - * 20000823: - * - first section was trickiest; all remaining sections have ebx -> edx now. - * (-fPIC works again.) Also added missing underscores to various Shift* - * and *Mask* globals and got rid of leading "$" signs. - * - * 20000826: - * - added visual separators to help navigate microscopic printed copies - * (http://pobox.com/~newt/code/gpr-latest.zip, mode 10); started working - * on png_read_filter_row_mmx_avg() - * - * 20000828: - * - finished png_read_filter_row_mmx_avg(): only Paeth left! (930 lines...) - * What the hell, did png_read_filter_row_mmx_paeth(), too. Comments not - * cleaned up/shortened in either routine, but functionality is complete - * and seems to be working fine. - * - * 20000829: - * - ahhh, figured out last(?) bit of gcc/gas asm-fu: if register is listed - * as an input reg (with dummy output variables, etc.), then it *cannot* - * also appear in the clobber list or gcc 2.95.2 will barf. The solution - * is simple enough... - * - * 20000914: - * - bug in png_read_filter_row_mmx_avg(): 16-bit grayscale not handled - * correctly (but 48-bit RGB just fine) - * - * 20000916: - * - fixed bug in png_read_filter_row_mmx_avg(), bpp == 2 case; three errors: - * - "_ShiftBpp.use = 24;" should have been "_ShiftBpp.use = 16;" - * - "_ShiftRem.use = 40;" should have been "_ShiftRem.use = 48;" - * - "psllq _ShiftRem, %%mm2" should have been "psrlq _ShiftRem, %%mm2" - * - * 20010101: - * - added new png_init_mmx_flags() function (here only because it needs to - * call mmxsupport(), which should probably become global png_mmxsupport()); - * modified other MMX routines to run conditionally (png_ptr->asm_flags) - * - * 20010103: - * - renamed mmxsupport() to png_mmx_support(), with auto-set of mmx_supported, - * and made it public; moved png_init_mmx_flags() to png.c as internal func - * - * 20010104: - * - removed dependency on png_read_filter_row_c() (C code already duplicated - * within MMX version of png_read_filter_row()) so no longer necessary to - * compile it into pngrutil.o - * - * 20010310: - * - fixed buffer-overrun bug in png_combine_row() C code (non-MMX) - * - * 20020304: - * - eliminated incorrect use of width_mmx in pixel_bytes == 8 case - * - * 20040724: - * - more tinkering with clobber list at lines 4529 and 5033, to get - * it to compile on gcc-3.4. - * - * STILL TO DO: - * - test png_do_read_interlace() 64-bit case (pixel_bytes == 8) - * - write MMX code for 48-bit case (pixel_bytes == 6) - * - figure out what's up with 24-bit case (pixel_bytes == 3): - * why subtract 8 from width_mmx in the pass 4/5 case? - * (only width_mmx case) (near line 1606) - * - rewrite all MMX interlacing code so it's aligned with beginning - * of the row buffer, not the end (see 19991007 for details) - * x pick one version of mmxsupport() and get rid of the other - * - add error messages to any remaining bogus default cases - * - enable pixel_depth == 8 cases in png_read_filter_row()? (test speed) - * x add support for runtime enable/disable/query of various MMX routines - */ - -#define PNG_INTERNAL -#include "png.h" - -#if defined(PNG_USE_PNGGCCRD) - -int PNGAPI png_mmx_support(void); - -#ifdef PNG_USE_LOCAL_ARRAYS -static const int FARDATA png_pass_start[7] = {0, 4, 0, 2, 0, 1, 0}; -static const int FARDATA png_pass_inc[7] = {8, 8, 4, 4, 2, 2, 1}; -static const int FARDATA png_pass_width[7] = {8, 4, 4, 2, 2, 1, 1}; -#endif - -#if defined(PNG_ASSEMBLER_CODE_SUPPORTED) -/* djgpp, Win32, and Cygwin add their own underscores to global variables, - * so define them without: */ -#if defined(__DJGPP__) || defined(WIN32) || defined(__CYGWIN__) -# define _mmx_supported mmx_supported -# define _const4 const4 -# define _const6 const6 -# define _mask8_0 mask8_0 -# define _mask16_1 mask16_1 -# define _mask16_0 mask16_0 -# define _mask24_2 mask24_2 -# define _mask24_1 mask24_1 -# define _mask24_0 mask24_0 -# define _mask32_3 mask32_3 -# define _mask32_2 mask32_2 -# define _mask32_1 mask32_1 -# define _mask32_0 mask32_0 -# define _mask48_5 mask48_5 -# define _mask48_4 mask48_4 -# define _mask48_3 mask48_3 -# define _mask48_2 mask48_2 -# define _mask48_1 mask48_1 -# define _mask48_0 mask48_0 -# define _LBCarryMask LBCarryMask -# define _HBClearMask HBClearMask -# define _ActiveMask ActiveMask -# define _ActiveMask2 ActiveMask2 -# define _ActiveMaskEnd ActiveMaskEnd -# define _ShiftBpp ShiftBpp -# define _ShiftRem ShiftRem -#ifdef PNG_THREAD_UNSAFE_OK -# define _unmask unmask -# define _FullLength FullLength -# define _MMXLength MMXLength -# define _dif dif -# define _patemp patemp -# define _pbtemp pbtemp -# define _pctemp pctemp -#endif -#endif - - -/* These constants are used in the inlined MMX assembly code. - Ignore gcc's "At top level: defined but not used" warnings. */ - -/* GRR 20000706: originally _unmask was needed only when compiling with -fPIC, - * since that case uses the %ebx register for indexing the Global Offset Table - * and there were no other registers available. But gcc 2.95 and later emit - * "more than 10 operands in `asm'" errors when %ebx is used to preload unmask - * in the non-PIC case, so we'll just use the global unconditionally now. - */ -#ifdef PNG_THREAD_UNSAFE_OK -static int _unmask; -#endif - -static unsigned long long _mask8_0 = 0x0102040810204080LL; - -static unsigned long long _mask16_1 = 0x0101020204040808LL; -static unsigned long long _mask16_0 = 0x1010202040408080LL; - -static unsigned long long _mask24_2 = 0x0101010202020404LL; -static unsigned long long _mask24_1 = 0x0408080810101020LL; -static unsigned long long _mask24_0 = 0x2020404040808080LL; - -static unsigned long long _mask32_3 = 0x0101010102020202LL; -static unsigned long long _mask32_2 = 0x0404040408080808LL; -static unsigned long long _mask32_1 = 0x1010101020202020LL; -static unsigned long long _mask32_0 = 0x4040404080808080LL; - -static unsigned long long _mask48_5 = 0x0101010101010202LL; -static unsigned long long _mask48_4 = 0x0202020204040404LL; -static unsigned long long _mask48_3 = 0x0404080808080808LL; -static unsigned long long _mask48_2 = 0x1010101010102020LL; -static unsigned long long _mask48_1 = 0x2020202040404040LL; -static unsigned long long _mask48_0 = 0x4040808080808080LL; - -static unsigned long long _const4 = 0x0000000000FFFFFFLL; -/* static unsigned long long _const5 = 0x000000FFFFFF0000LL; */ /* NOT USED */ -static unsigned long long _const6 = 0x00000000000000FFLL; - -/* These are used in the row-filter routines and should/would be local */ -/* variables if not for gcc addressing limitations. */ -/* WARNING: Their presence probably defeats the thread safety of libpng. */ - -#ifdef PNG_THREAD_UNSAFE_OK -static png_uint_32 _FullLength; -static png_uint_32 _MMXLength; -static int _dif; -static int _patemp; /* temp variables for Paeth routine */ -static int _pbtemp; -static int _pctemp; -#endif - -void /* PRIVATE */ -png_squelch_warnings(void) -{ -#ifdef PNG_THREAD_UNSAFE_OK - _dif = _dif; - _patemp = _patemp; - _pbtemp = _pbtemp; - _pctemp = _pctemp; - _MMXLength = _MMXLength; -#endif - _const4 = _const4; - _const6 = _const6; - _mask8_0 = _mask8_0; - _mask16_1 = _mask16_1; - _mask16_0 = _mask16_0; - _mask24_2 = _mask24_2; - _mask24_1 = _mask24_1; - _mask24_0 = _mask24_0; - _mask32_3 = _mask32_3; - _mask32_2 = _mask32_2; - _mask32_1 = _mask32_1; - _mask32_0 = _mask32_0; - _mask48_5 = _mask48_5; - _mask48_4 = _mask48_4; - _mask48_3 = _mask48_3; - _mask48_2 = _mask48_2; - _mask48_1 = _mask48_1; - _mask48_0 = _mask48_0; -} -#endif /* PNG_ASSEMBLER_CODE_SUPPORTED */ - - -static int _mmx_supported = 2; - -/*===========================================================================*/ -/* */ -/* P N G _ C O M B I N E _ R O W */ -/* */ -/*===========================================================================*/ - -#if defined(PNG_HAVE_ASSEMBLER_COMBINE_ROW) - -#define BPP2 2 -#define BPP3 3 /* bytes per pixel (a.k.a. pixel_bytes) */ -#define BPP4 4 -#define BPP6 6 /* (defined only to help avoid cut-and-paste errors) */ -#define BPP8 8 - -/* Combines the row recently read in with the previous row. - This routine takes care of alpha and transparency if requested. - This routine also handles the two methods of progressive display - of interlaced images, depending on the mask value. - The mask value describes which pixels are to be combined with - the row. The pattern always repeats every 8 pixels, so just 8 - bits are needed. A one indicates the pixel is to be combined; a - zero indicates the pixel is to be skipped. This is in addition - to any alpha or transparency value associated with the pixel. - If you want all pixels to be combined, pass 0xff (255) in mask. */ - -/* Use this routine for the x86 platform - it uses a faster MMX routine - if the machine supports MMX. */ - -void /* PRIVATE */ -png_combine_row(png_structp png_ptr, png_bytep row, int mask) -{ - png_debug(1, "in png_combine_row (pnggccrd.c)\n"); - -#if defined(PNG_ASSEMBLER_CODE_SUPPORTED) - if (_mmx_supported == 2) { -#if !defined(PNG_1_0_X) - /* this should have happened in png_init_mmx_flags() already */ - png_warning(png_ptr, "asm_flags may not have been initialized"); -#endif - png_mmx_support(); - } -#endif - - if (mask == 0xff) - { - png_debug(2,"mask == 0xff: doing single png_memcpy()\n"); - png_memcpy(row, png_ptr->row_buf + 1, - (png_size_t)PNG_ROWBYTES(png_ptr->row_info.pixel_depth,png_ptr->width)); - } - else /* (png_combine_row() is never called with mask == 0) */ - { - switch (png_ptr->row_info.pixel_depth) - { - case 1: /* png_ptr->row_info.pixel_depth */ - { - png_bytep sp; - png_bytep dp; - int s_inc, s_start, s_end; - int m; - int shift; - png_uint_32 i; - - sp = png_ptr->row_buf + 1; - dp = row; - m = 0x80; -#if defined(PNG_READ_PACKSWAP_SUPPORTED) - if (png_ptr->transformations & PNG_PACKSWAP) - { - s_start = 0; - s_end = 7; - s_inc = 1; - } - else -#endif - { - s_start = 7; - s_end = 0; - s_inc = -1; - } - - shift = s_start; - - for (i = 0; i < png_ptr->width; i++) - { - if (m & mask) - { - int value; - - value = (*sp >> shift) & 0x1; - *dp &= (png_byte)((0x7f7f >> (7 - shift)) & 0xff); - *dp |= (png_byte)(value << shift); - } - - if (shift == s_end) - { - shift = s_start; - sp++; - dp++; - } - else - shift += s_inc; - - if (m == 1) - m = 0x80; - else - m >>= 1; - } - break; - } - - case 2: /* png_ptr->row_info.pixel_depth */ - { - png_bytep sp; - png_bytep dp; - int s_start, s_end, s_inc; - int m; - int shift; - png_uint_32 i; - int value; - - sp = png_ptr->row_buf + 1; - dp = row; - m = 0x80; -#if defined(PNG_READ_PACKSWAP_SUPPORTED) - if (png_ptr->transformations & PNG_PACKSWAP) - { - s_start = 0; - s_end = 6; - s_inc = 2; - } - else -#endif - { - s_start = 6; - s_end = 0; - s_inc = -2; - } - - shift = s_start; - - for (i = 0; i < png_ptr->width; i++) - { - if (m & mask) - { - value = (*sp >> shift) & 0x3; - *dp &= (png_byte)((0x3f3f >> (6 - shift)) & 0xff); - *dp |= (png_byte)(value << shift); - } - - if (shift == s_end) - { - shift = s_start; - sp++; - dp++; - } - else - shift += s_inc; - if (m == 1) - m = 0x80; - else - m >>= 1; - } - break; - } - - case 4: /* png_ptr->row_info.pixel_depth */ - { - png_bytep sp; - png_bytep dp; - int s_start, s_end, s_inc; - int m; - int shift; - png_uint_32 i; - int value; - - sp = png_ptr->row_buf + 1; - dp = row; - m = 0x80; -#if defined(PNG_READ_PACKSWAP_SUPPORTED) - if (png_ptr->transformations & PNG_PACKSWAP) - { - s_start = 0; - s_end = 4; - s_inc = 4; - } - else -#endif - { - s_start = 4; - s_end = 0; - s_inc = -4; - } - shift = s_start; - - for (i = 0; i < png_ptr->width; i++) - { - if (m & mask) - { - value = (*sp >> shift) & 0xf; - *dp &= (png_byte)((0xf0f >> (4 - shift)) & 0xff); - *dp |= (png_byte)(value << shift); - } - - if (shift == s_end) - { - shift = s_start; - sp++; - dp++; - } - else - shift += s_inc; - if (m == 1) - m = 0x80; - else - m >>= 1; - } - break; - } - - case 8: /* png_ptr->row_info.pixel_depth */ - { - png_bytep srcptr; - png_bytep dstptr; - -#if defined(PNG_ASSEMBLER_CODE_SUPPORTED) && defined(PNG_THREAD_UNSAFE_OK) -#if !defined(PNG_1_0_X) - if ((png_ptr->asm_flags & PNG_ASM_FLAG_MMX_READ_COMBINE_ROW) - /* && _mmx_supported */ ) -#else - if (_mmx_supported) -#endif - { - png_uint_32 len; - int diff; - int dummy_value_a; /* fix 'forbidden register spilled' error */ - int dummy_value_d; - int dummy_value_c; - int dummy_value_S; - int dummy_value_D; - _unmask = ~mask; /* global variable for -fPIC version */ - srcptr = png_ptr->row_buf + 1; - dstptr = row; - len = png_ptr->width &~7; /* reduce to multiple of 8 */ - diff = (int) (png_ptr->width & 7); /* amount lost */ - - __asm__ __volatile__ ( - "movd _unmask, %%mm7 \n\t" /* load bit pattern */ - "psubb %%mm6, %%mm6 \n\t" /* zero mm6 */ - "punpcklbw %%mm7, %%mm7 \n\t" - "punpcklwd %%mm7, %%mm7 \n\t" - "punpckldq %%mm7, %%mm7 \n\t" /* fill reg with 8 masks */ - - "movq _mask8_0, %%mm0 \n\t" - "pand %%mm7, %%mm0 \n\t" /* nonzero if keep byte */ - "pcmpeqb %%mm6, %%mm0 \n\t" /* zeros->1s, v versa */ - -/* preload "movl len, %%ecx \n\t" // load length of line */ -/* preload "movl srcptr, %%esi \n\t" // load source */ -/* preload "movl dstptr, %%edi \n\t" // load dest */ - - "cmpl $0, %%ecx \n\t" /* len == 0 ? */ - "je mainloop8end \n\t" - - "mainloop8: \n\t" - "movq (%%esi), %%mm4 \n\t" /* *srcptr */ - "pand %%mm0, %%mm4 \n\t" - "movq %%mm0, %%mm6 \n\t" - "pandn (%%edi), %%mm6 \n\t" /* *dstptr */ - "por %%mm6, %%mm4 \n\t" - "movq %%mm4, (%%edi) \n\t" - "addl $8, %%esi \n\t" /* inc by 8 bytes processed */ - "addl $8, %%edi \n\t" - "subl $8, %%ecx \n\t" /* dec by 8 pixels processed */ - "ja mainloop8 \n\t" - - "mainloop8end: \n\t" -/* preload "movl diff, %%ecx \n\t" // (diff is in eax) */ - "movl %%eax, %%ecx \n\t" - "cmpl $0, %%ecx \n\t" - "jz end8 \n\t" -/* preload "movl mask, %%edx \n\t" */ - "sall $24, %%edx \n\t" /* make low byte, high byte */ - - "secondloop8: \n\t" - "sall %%edx \n\t" /* move high bit to CF */ - "jnc skip8 \n\t" /* if CF = 0 */ - "movb (%%esi), %%al \n\t" - "movb %%al, (%%edi) \n\t" - - "skip8: \n\t" - "incl %%esi \n\t" - "incl %%edi \n\t" - "decl %%ecx \n\t" - "jnz secondloop8 \n\t" - - "end8: \n\t" - "EMMS \n\t" /* DONE */ - - : "=a" (dummy_value_a), /* output regs (dummy) */ - "=d" (dummy_value_d), - "=c" (dummy_value_c), - "=S" (dummy_value_S), - "=D" (dummy_value_D) - - : "3" (srcptr), /* esi // input regs */ - "4" (dstptr), /* edi */ - "0" (diff), /* eax */ -/* was (unmask) "b" RESERVED // ebx // Global Offset Table idx */ - "2" (len), /* ecx */ - "1" (mask) /* edx */ - -#if 0 /* MMX regs (%mm0, etc.) not supported by gcc 2.7.2.3 or egcs 1.1 */ - : "%mm0", "%mm4", "%mm6", "%mm7" /* clobber list */ -#endif - ); - } - else /* mmx _not supported - Use modified C routine */ -#endif /* PNG_ASSEMBLER_CODE_SUPPORTED */ - { - register png_uint_32 i; - png_uint_32 initial_val = png_pass_start[png_ptr->pass]; - /* png.c: png_pass_start[] = {0, 4, 0, 2, 0, 1, 0}; */ - register int stride = png_pass_inc[png_ptr->pass]; - /* png.c: png_pass_inc[] = {8, 8, 4, 4, 2, 2, 1}; */ - register int rep_bytes = png_pass_width[png_ptr->pass]; - /* png.c: png_pass_width[] = {8, 4, 4, 2, 2, 1, 1}; */ - png_uint_32 len = png_ptr->width &~7; /* reduce to mult. of 8 */ - int diff = (int) (png_ptr->width & 7); /* amount lost */ - register png_uint_32 final_val = len; /* GRR bugfix */ - - srcptr = png_ptr->row_buf + 1 + initial_val; - dstptr = row + initial_val; - - for (i = initial_val; i < final_val; i += stride) - { - png_memcpy(dstptr, srcptr, rep_bytes); - srcptr += stride; - dstptr += stride; - } - if (diff) /* number of leftover pixels: 3 for pngtest */ - { - final_val+=diff /* *BPP1 */ ; - for (; i < final_val; i += stride) - { - if (rep_bytes > (int)(final_val-i)) - rep_bytes = (int)(final_val-i); - png_memcpy(dstptr, srcptr, rep_bytes); - srcptr += stride; - dstptr += stride; - } - } - - } /* end of else (_mmx_supported) */ - - break; - } /* end 8 bpp */ - - case 16: /* png_ptr->row_info.pixel_depth */ - { - png_bytep srcptr; - png_bytep dstptr; - -#if defined(PNG_ASSEMBLER_CODE_SUPPORTED) && defined(PNG_THREAD_UNSAFE_OK) -#if !defined(PNG_1_0_X) - if ((png_ptr->asm_flags & PNG_ASM_FLAG_MMX_READ_COMBINE_ROW) - /* && _mmx_supported */ ) -#else - if (_mmx_supported) -#endif - { - png_uint_32 len; - int diff; - int dummy_value_a; /* fix 'forbidden register spilled' error */ - int dummy_value_d; - int dummy_value_c; - int dummy_value_S; - int dummy_value_D; - _unmask = ~mask; /* global variable for -fPIC version */ - srcptr = png_ptr->row_buf + 1; - dstptr = row; - len = png_ptr->width &~7; /* reduce to multiple of 8 */ - diff = (int) (png_ptr->width & 7); /* amount lost // */ - - __asm__ __volatile__ ( - "movd _unmask, %%mm7 \n\t" /* load bit pattern */ - "psubb %%mm6, %%mm6 \n\t" /* zero mm6 */ - "punpcklbw %%mm7, %%mm7 \n\t" - "punpcklwd %%mm7, %%mm7 \n\t" - "punpckldq %%mm7, %%mm7 \n\t" /* fill reg with 8 masks */ - - "movq _mask16_0, %%mm0 \n\t" - "movq _mask16_1, %%mm1 \n\t" - - "pand %%mm7, %%mm0 \n\t" - "pand %%mm7, %%mm1 \n\t" - - "pcmpeqb %%mm6, %%mm0 \n\t" - "pcmpeqb %%mm6, %%mm1 \n\t" - -/* preload "movl len, %%ecx \n\t" // load length of line */ -/* preload "movl srcptr, %%esi \n\t" // load source */ -/* preload "movl dstptr, %%edi \n\t" // load dest */ - - "cmpl $0, %%ecx \n\t" - "jz mainloop16end \n\t" - - "mainloop16: \n\t" - "movq (%%esi), %%mm4 \n\t" - "pand %%mm0, %%mm4 \n\t" - "movq %%mm0, %%mm6 \n\t" - "movq (%%edi), %%mm7 \n\t" - "pandn %%mm7, %%mm6 \n\t" - "por %%mm6, %%mm4 \n\t" - "movq %%mm4, (%%edi) \n\t" - - "movq 8(%%esi), %%mm5 \n\t" - "pand %%mm1, %%mm5 \n\t" - "movq %%mm1, %%mm7 \n\t" - "movq 8(%%edi), %%mm6 \n\t" - "pandn %%mm6, %%mm7 \n\t" - "por %%mm7, %%mm5 \n\t" - "movq %%mm5, 8(%%edi) \n\t" - - "addl $16, %%esi \n\t" /* inc by 16 bytes processed */ - "addl $16, %%edi \n\t" - "subl $8, %%ecx \n\t" /* dec by 8 pixels processed */ - "ja mainloop16 \n\t" - - "mainloop16end: \n\t" -/* preload "movl diff, %%ecx \n\t" // (diff is in eax) */ - "movl %%eax, %%ecx \n\t" - "cmpl $0, %%ecx \n\t" - "jz end16 \n\t" -/* preload "movl mask, %%edx \n\t" */ - "sall $24, %%edx \n\t" /* make low byte, high byte */ - - "secondloop16: \n\t" - "sall %%edx \n\t" /* move high bit to CF */ - "jnc skip16 \n\t" /* if CF = 0 */ - "movw (%%esi), %%ax \n\t" - "movw %%ax, (%%edi) \n\t" - - "skip16: \n\t" - "addl $2, %%esi \n\t" - "addl $2, %%edi \n\t" - "decl %%ecx \n\t" - "jnz secondloop16 \n\t" - - "end16: \n\t" - "EMMS \n\t" /* DONE */ - - : "=a" (dummy_value_a), /* output regs (dummy) */ - "=c" (dummy_value_c), - "=d" (dummy_value_d), - "=S" (dummy_value_S), - "=D" (dummy_value_D) - - : "0" (diff), /* eax // input regs */ -/* was (unmask) " " RESERVED // ebx // Global Offset Table idx */ - "1" (len), /* ecx */ - "2" (mask), /* edx */ - "3" (srcptr), /* esi */ - "4" (dstptr) /* edi */ - -#if 0 /* MMX regs (%mm0, etc.) not supported by gcc 2.7.2.3 or egcs 1.1 */ - : "%mm0", "%mm1", "%mm4" /* clobber list */ - , "%mm5", "%mm6", "%mm7" -#endif - ); - } - else /* mmx _not supported - Use modified C routine */ -#endif /* PNG_ASSEMBLER_CODE_SUPPORTED */ - { - register png_uint_32 i; - png_uint_32 initial_val = BPP2 * png_pass_start[png_ptr->pass]; - /* png.c: png_pass_start[] = {0, 4, 0, 2, 0, 1, 0}; */ - register int stride = BPP2 * png_pass_inc[png_ptr->pass]; - /* png.c: png_pass_inc[] = {8, 8, 4, 4, 2, 2, 1}; */ - register int rep_bytes = BPP2 * png_pass_width[png_ptr->pass]; - /* png.c: png_pass_width[] = {8, 4, 4, 2, 2, 1, 1}; */ - png_uint_32 len = png_ptr->width &~7; /* reduce to mult. of 8 */ - int diff = (int) (png_ptr->width & 7); /* amount lost */ - register png_uint_32 final_val = BPP2 * len; /* GRR bugfix */ - - srcptr = png_ptr->row_buf + 1 + initial_val; - dstptr = row + initial_val; - - for (i = initial_val; i < final_val; i += stride) - { - png_memcpy(dstptr, srcptr, rep_bytes); - srcptr += stride; - dstptr += stride; - } - if (diff) /* number of leftover pixels: 3 for pngtest */ - { - final_val+=diff*BPP2; - for (; i < final_val; i += stride) - { - if (rep_bytes > (int)(final_val-i)) - rep_bytes = (int)(final_val-i); - png_memcpy(dstptr, srcptr, rep_bytes); - srcptr += stride; - dstptr += stride; - } - } - } /* end of else (_mmx_supported) */ - - break; - } /* end 16 bpp */ - - case 24: /* png_ptr->row_info.pixel_depth */ - { - png_bytep srcptr; - png_bytep dstptr; - -#if defined(PNG_ASSEMBLER_CODE_SUPPORTED) && defined(PNG_THREAD_UNSAFE_OK) -#if !defined(PNG_1_0_X) - if ((png_ptr->asm_flags & PNG_ASM_FLAG_MMX_READ_COMBINE_ROW) - /* && _mmx_supported */ ) -#else - if (_mmx_supported) -#endif - { - png_uint_32 len; - int diff; - int dummy_value_a; /* fix 'forbidden register spilled' error */ - int dummy_value_d; - int dummy_value_c; - int dummy_value_S; - int dummy_value_D; - _unmask = ~mask; /* global variable for -fPIC version */ - srcptr = png_ptr->row_buf + 1; - dstptr = row; - len = png_ptr->width &~7; /* reduce to multiple of 8 */ - diff = (int) (png_ptr->width & 7); /* amount lost // */ - - __asm__ __volatile__ ( - "movd _unmask, %%mm7 \n\t" /* load bit pattern */ - "psubb %%mm6, %%mm6 \n\t" /* zero mm6 */ - "punpcklbw %%mm7, %%mm7 \n\t" - "punpcklwd %%mm7, %%mm7 \n\t" - "punpckldq %%mm7, %%mm7 \n\t" /* fill reg with 8 masks */ - - "movq _mask24_0, %%mm0 \n\t" - "movq _mask24_1, %%mm1 \n\t" - "movq _mask24_2, %%mm2 \n\t" - - "pand %%mm7, %%mm0 \n\t" - "pand %%mm7, %%mm1 \n\t" - "pand %%mm7, %%mm2 \n\t" - - "pcmpeqb %%mm6, %%mm0 \n\t" - "pcmpeqb %%mm6, %%mm1 \n\t" - "pcmpeqb %%mm6, %%mm2 \n\t" - -/* preload "movl len, %%ecx \n\t" // load length of line */ -/* preload "movl srcptr, %%esi \n\t" // load source */ -/* preload "movl dstptr, %%edi \n\t" // load dest */ - - "cmpl $0, %%ecx \n\t" - "jz mainloop24end \n\t" - - "mainloop24: \n\t" - "movq (%%esi), %%mm4 \n\t" - "pand %%mm0, %%mm4 \n\t" - "movq %%mm0, %%mm6 \n\t" - "movq (%%edi), %%mm7 \n\t" - "pandn %%mm7, %%mm6 \n\t" - "por %%mm6, %%mm4 \n\t" - "movq %%mm4, (%%edi) \n\t" - - "movq 8(%%esi), %%mm5 \n\t" - "pand %%mm1, %%mm5 \n\t" - "movq %%mm1, %%mm7 \n\t" - "movq 8(%%edi), %%mm6 \n\t" - "pandn %%mm6, %%mm7 \n\t" - "por %%mm7, %%mm5 \n\t" - "movq %%mm5, 8(%%edi) \n\t" - - "movq 16(%%esi), %%mm6 \n\t" - "pand %%mm2, %%mm6 \n\t" - "movq %%mm2, %%mm4 \n\t" - "movq 16(%%edi), %%mm7 \n\t" - "pandn %%mm7, %%mm4 \n\t" - "por %%mm4, %%mm6 \n\t" - "movq %%mm6, 16(%%edi) \n\t" - - "addl $24, %%esi \n\t" /* inc by 24 bytes processed */ - "addl $24, %%edi \n\t" - "subl $8, %%ecx \n\t" /* dec by 8 pixels processed */ - - "ja mainloop24 \n\t" - - "mainloop24end: \n\t" -/* preload "movl diff, %%ecx \n\t" // (diff is in eax) */ - "movl %%eax, %%ecx \n\t" - "cmpl $0, %%ecx \n\t" - "jz end24 \n\t" -/* preload "movl mask, %%edx \n\t" */ - "sall $24, %%edx \n\t" /* make low byte, high byte */ - - "secondloop24: \n\t" - "sall %%edx \n\t" /* move high bit to CF */ - "jnc skip24 \n\t" /* if CF = 0 */ - "movw (%%esi), %%ax \n\t" - "movw %%ax, (%%edi) \n\t" - "xorl %%eax, %%eax \n\t" - "movb 2(%%esi), %%al \n\t" - "movb %%al, 2(%%edi) \n\t" - - "skip24: \n\t" - "addl $3, %%esi \n\t" - "addl $3, %%edi \n\t" - "decl %%ecx \n\t" - "jnz secondloop24 \n\t" - - "end24: \n\t" - "EMMS \n\t" /* DONE */ - - : "=a" (dummy_value_a), /* output regs (dummy) */ - "=d" (dummy_value_d), - "=c" (dummy_value_c), - "=S" (dummy_value_S), - "=D" (dummy_value_D) - - : "3" (srcptr), /* esi // input regs */ - "4" (dstptr), /* edi */ - "0" (diff), /* eax */ -/* was (unmask) "b" RESERVED // ebx // Global Offset Table idx */ - "2" (len), /* ecx */ - "1" (mask) /* edx */ - -#if 0 /* MMX regs (%mm0, etc.) not supported by gcc 2.7.2.3 or egcs 1.1 */ - : "%mm0", "%mm1", "%mm2" /* clobber list */ - , "%mm4", "%mm5", "%mm6", "%mm7" -#endif - ); - } - else /* mmx _not supported - Use modified C routine */ -#endif /* PNG_ASSEMBLER_CODE_SUPPORTED */ - { - register png_uint_32 i; - png_uint_32 initial_val = BPP3 * png_pass_start[png_ptr->pass]; - /* png.c: png_pass_start[] = {0, 4, 0, 2, 0, 1, 0}; */ - register int stride = BPP3 * png_pass_inc[png_ptr->pass]; - /* png.c: png_pass_inc[] = {8, 8, 4, 4, 2, 2, 1}; */ - register int rep_bytes = BPP3 * png_pass_width[png_ptr->pass]; - /* png.c: png_pass_width[] = {8, 4, 4, 2, 2, 1, 1}; */ - png_uint_32 len = png_ptr->width &~7; /* reduce to mult. of 8 */ - int diff = (int) (png_ptr->width & 7); /* amount lost */ - register png_uint_32 final_val = BPP3 * len; /* GRR bugfix */ - - srcptr = png_ptr->row_buf + 1 + initial_val; - dstptr = row + initial_val; - - for (i = initial_val; i < final_val; i += stride) - { - png_memcpy(dstptr, srcptr, rep_bytes); - srcptr += stride; - dstptr += stride; - } - if (diff) /* number of leftover pixels: 3 for pngtest */ - { - final_val+=diff*BPP3; - for (; i < final_val; i += stride) - { - if (rep_bytes > (int)(final_val-i)) - rep_bytes = (int)(final_val-i); - png_memcpy(dstptr, srcptr, rep_bytes); - srcptr += stride; - dstptr += stride; - } - } - } /* end of else (_mmx_supported) */ - - break; - } /* end 24 bpp */ - - case 32: /* png_ptr->row_info.pixel_depth */ - { - png_bytep srcptr; - png_bytep dstptr; - -#if defined(PNG_ASSEMBLER_CODE_SUPPORTED) && defined(PNG_THREAD_UNSAFE_OK) -#if !defined(PNG_1_0_X) - if ((png_ptr->asm_flags & PNG_ASM_FLAG_MMX_READ_COMBINE_ROW) - /* && _mmx_supported */ ) -#else - if (_mmx_supported) -#endif - { - png_uint_32 len; - int diff; - int dummy_value_a; /* fix 'forbidden register spilled' error */ - int dummy_value_d; - int dummy_value_c; - int dummy_value_S; - int dummy_value_D; - _unmask = ~mask; /* global variable for -fPIC version */ - srcptr = png_ptr->row_buf + 1; - dstptr = row; - len = png_ptr->width &~7; /* reduce to multiple of 8 */ - diff = (int) (png_ptr->width & 7); /* amount lost // */ - - __asm__ __volatile__ ( - "movd _unmask, %%mm7 \n\t" /* load bit pattern */ - "psubb %%mm6, %%mm6 \n\t" /* zero mm6 */ - "punpcklbw %%mm7, %%mm7 \n\t" - "punpcklwd %%mm7, %%mm7 \n\t" - "punpckldq %%mm7, %%mm7 \n\t" /* fill reg with 8 masks */ - - "movq _mask32_0, %%mm0 \n\t" - "movq _mask32_1, %%mm1 \n\t" - "movq _mask32_2, %%mm2 \n\t" - "movq _mask32_3, %%mm3 \n\t" - - "pand %%mm7, %%mm0 \n\t" - "pand %%mm7, %%mm1 \n\t" - "pand %%mm7, %%mm2 \n\t" - "pand %%mm7, %%mm3 \n\t" - - "pcmpeqb %%mm6, %%mm0 \n\t" - "pcmpeqb %%mm6, %%mm1 \n\t" - "pcmpeqb %%mm6, %%mm2 \n\t" - "pcmpeqb %%mm6, %%mm3 \n\t" - -/* preload "movl len, %%ecx \n\t" // load length of line */ -/* preload "movl srcptr, %%esi \n\t" // load source */ -/* preload "movl dstptr, %%edi \n\t" // load dest */ - - "cmpl $0, %%ecx \n\t" /* lcr */ - "jz mainloop32end \n\t" - - "mainloop32: \n\t" - "movq (%%esi), %%mm4 \n\t" - "pand %%mm0, %%mm4 \n\t" - "movq %%mm0, %%mm6 \n\t" - "movq (%%edi), %%mm7 \n\t" - "pandn %%mm7, %%mm6 \n\t" - "por %%mm6, %%mm4 \n\t" - "movq %%mm4, (%%edi) \n\t" - - "movq 8(%%esi), %%mm5 \n\t" - "pand %%mm1, %%mm5 \n\t" - "movq %%mm1, %%mm7 \n\t" - "movq 8(%%edi), %%mm6 \n\t" - "pandn %%mm6, %%mm7 \n\t" - "por %%mm7, %%mm5 \n\t" - "movq %%mm5, 8(%%edi) \n\t" - - "movq 16(%%esi), %%mm6 \n\t" - "pand %%mm2, %%mm6 \n\t" - "movq %%mm2, %%mm4 \n\t" - "movq 16(%%edi), %%mm7 \n\t" - "pandn %%mm7, %%mm4 \n\t" - "por %%mm4, %%mm6 \n\t" - "movq %%mm6, 16(%%edi) \n\t" - - "movq 24(%%esi), %%mm7 \n\t" - "pand %%mm3, %%mm7 \n\t" - "movq %%mm3, %%mm5 \n\t" - "movq 24(%%edi), %%mm4 \n\t" - "pandn %%mm4, %%mm5 \n\t" - "por %%mm5, %%mm7 \n\t" - "movq %%mm7, 24(%%edi) \n\t" - - "addl $32, %%esi \n\t" /* inc by 32 bytes processed */ - "addl $32, %%edi \n\t" - "subl $8, %%ecx \n\t" /* dec by 8 pixels processed */ - "ja mainloop32 \n\t" - - "mainloop32end: \n\t" -/* preload "movl diff, %%ecx \n\t" // (diff is in eax) */ - "movl %%eax, %%ecx \n\t" - "cmpl $0, %%ecx \n\t" - "jz end32 \n\t" -/* preload "movl mask, %%edx \n\t" */ - "sall $24, %%edx \n\t" /* low byte => high byte */ - - "secondloop32: \n\t" - "sall %%edx \n\t" /* move high bit to CF */ - "jnc skip32 \n\t" /* if CF = 0 */ - "movl (%%esi), %%eax \n\t" - "movl %%eax, (%%edi) \n\t" - - "skip32: \n\t" - "addl $4, %%esi \n\t" - "addl $4, %%edi \n\t" - "decl %%ecx \n\t" - "jnz secondloop32 \n\t" - - "end32: \n\t" - "EMMS \n\t" /* DONE */ - - : "=a" (dummy_value_a), /* output regs (dummy) */ - "=d" (dummy_value_d), - "=c" (dummy_value_c), - "=S" (dummy_value_S), - "=D" (dummy_value_D) - - : "3" (srcptr), /* esi // input regs */ - "4" (dstptr), /* edi */ - "0" (diff), /* eax */ -/* was (unmask) "b" RESERVED // ebx // Global Offset Table idx */ - "2" (len), /* ecx */ - "1" (mask) /* edx */ - -#if 0 /* MMX regs (%mm0, etc.) not supported by gcc 2.7.2.3 or egcs 1.1 */ - : "%mm0", "%mm1", "%mm2", "%mm3" /* clobber list */ - , "%mm4", "%mm5", "%mm6", "%mm7" -#endif - ); - } - else /* mmx _not supported - Use modified C routine */ -#endif /* PNG_ASSEMBLER_CODE_SUPPORTED */ - { - register png_uint_32 i; - png_uint_32 initial_val = BPP4 * png_pass_start[png_ptr->pass]; - /* png.c: png_pass_start[] = {0, 4, 0, 2, 0, 1, 0}; */ - register int stride = BPP4 * png_pass_inc[png_ptr->pass]; - /* png.c: png_pass_inc[] = {8, 8, 4, 4, 2, 2, 1}; */ - register int rep_bytes = BPP4 * png_pass_width[png_ptr->pass]; - /* png.c: png_pass_width[] = {8, 4, 4, 2, 2, 1, 1}; */ - png_uint_32 len = png_ptr->width &~7; /* reduce to mult. of 8 */ - int diff = (int) (png_ptr->width & 7); /* amount lost */ - register png_uint_32 final_val = BPP4 * len; /* GRR bugfix */ - - srcptr = png_ptr->row_buf + 1 + initial_val; - dstptr = row + initial_val; - - for (i = initial_val; i < final_val; i += stride) - { - png_memcpy(dstptr, srcptr, rep_bytes); - srcptr += stride; - dstptr += stride; - } - if (diff) /* number of leftover pixels: 3 for pngtest */ - { - final_val+=diff*BPP4; - for (; i < final_val; i += stride) - { - if (rep_bytes > (int)(final_val-i)) - rep_bytes = (int)(final_val-i); - png_memcpy(dstptr, srcptr, rep_bytes); - srcptr += stride; - dstptr += stride; - } - } - } /* end of else (_mmx_supported) */ - - break; - } /* end 32 bpp */ - - case 48: /* png_ptr->row_info.pixel_depth */ - { - png_bytep srcptr; - png_bytep dstptr; - -#if defined(PNG_ASSEMBLER_CODE_SUPPORTED) && defined(PNG_THREAD_UNSAFE_OK) -#if !defined(PNG_1_0_X) - if ((png_ptr->asm_flags & PNG_ASM_FLAG_MMX_READ_COMBINE_ROW) - /* && _mmx_supported */ ) -#else - if (_mmx_supported) -#endif - { - png_uint_32 len; - int diff; - int dummy_value_a; /* fix 'forbidden register spilled' error */ - int dummy_value_d; - int dummy_value_c; - int dummy_value_S; - int dummy_value_D; - _unmask = ~mask; /* global variable for -fPIC version */ - srcptr = png_ptr->row_buf + 1; - dstptr = row; - len = png_ptr->width &~7; /* reduce to multiple of 8 */ - diff = (int) (png_ptr->width & 7); /* amount lost // */ - - __asm__ __volatile__ ( - "movd _unmask, %%mm7 \n\t" /* load bit pattern */ - "psubb %%mm6, %%mm6 \n\t" /* zero mm6 */ - "punpcklbw %%mm7, %%mm7 \n\t" - "punpcklwd %%mm7, %%mm7 \n\t" - "punpckldq %%mm7, %%mm7 \n\t" /* fill reg with 8 masks */ - - "movq _mask48_0, %%mm0 \n\t" - "movq _mask48_1, %%mm1 \n\t" - "movq _mask48_2, %%mm2 \n\t" - "movq _mask48_3, %%mm3 \n\t" - "movq _mask48_4, %%mm4 \n\t" - "movq _mask48_5, %%mm5 \n\t" - - "pand %%mm7, %%mm0 \n\t" - "pand %%mm7, %%mm1 \n\t" - "pand %%mm7, %%mm2 \n\t" - "pand %%mm7, %%mm3 \n\t" - "pand %%mm7, %%mm4 \n\t" - "pand %%mm7, %%mm5 \n\t" - - "pcmpeqb %%mm6, %%mm0 \n\t" - "pcmpeqb %%mm6, %%mm1 \n\t" - "pcmpeqb %%mm6, %%mm2 \n\t" - "pcmpeqb %%mm6, %%mm3 \n\t" - "pcmpeqb %%mm6, %%mm4 \n\t" - "pcmpeqb %%mm6, %%mm5 \n\t" - -/* preload "movl len, %%ecx \n\t" // load length of line */ -/* preload "movl srcptr, %%esi \n\t" // load source */ -/* preload "movl dstptr, %%edi \n\t" // load dest */ - - "cmpl $0, %%ecx \n\t" - "jz mainloop48end \n\t" - - "mainloop48: \n\t" - "movq (%%esi), %%mm7 \n\t" - "pand %%mm0, %%mm7 \n\t" - "movq %%mm0, %%mm6 \n\t" - "pandn (%%edi), %%mm6 \n\t" - "por %%mm6, %%mm7 \n\t" - "movq %%mm7, (%%edi) \n\t" - - "movq 8(%%esi), %%mm6 \n\t" - "pand %%mm1, %%mm6 \n\t" - "movq %%mm1, %%mm7 \n\t" - "pandn 8(%%edi), %%mm7 \n\t" - "por %%mm7, %%mm6 \n\t" - "movq %%mm6, 8(%%edi) \n\t" - - "movq 16(%%esi), %%mm6 \n\t" - "pand %%mm2, %%mm6 \n\t" - "movq %%mm2, %%mm7 \n\t" - "pandn 16(%%edi), %%mm7 \n\t" - "por %%mm7, %%mm6 \n\t" - "movq %%mm6, 16(%%edi) \n\t" - - "movq 24(%%esi), %%mm7 \n\t" - "pand %%mm3, %%mm7 \n\t" - "movq %%mm3, %%mm6 \n\t" - "pandn 24(%%edi), %%mm6 \n\t" - "por %%mm6, %%mm7 \n\t" - "movq %%mm7, 24(%%edi) \n\t" - - "movq 32(%%esi), %%mm6 \n\t" - "pand %%mm4, %%mm6 \n\t" - "movq %%mm4, %%mm7 \n\t" - "pandn 32(%%edi), %%mm7 \n\t" - "por %%mm7, %%mm6 \n\t" - "movq %%mm6, 32(%%edi) \n\t" - - "movq 40(%%esi), %%mm7 \n\t" - "pand %%mm5, %%mm7 \n\t" - "movq %%mm5, %%mm6 \n\t" - "pandn 40(%%edi), %%mm6 \n\t" - "por %%mm6, %%mm7 \n\t" - "movq %%mm7, 40(%%edi) \n\t" - - "addl $48, %%esi \n\t" /* inc by 48 bytes processed */ - "addl $48, %%edi \n\t" - "subl $8, %%ecx \n\t" /* dec by 8 pixels processed */ - - "ja mainloop48 \n\t" - - "mainloop48end: \n\t" -/* preload "movl diff, %%ecx \n\t" // (diff is in eax) */ - "movl %%eax, %%ecx \n\t" - "cmpl $0, %%ecx \n\t" - "jz end48 \n\t" -/* preload "movl mask, %%edx \n\t" */ - "sall $24, %%edx \n\t" /* make low byte, high byte */ - - "secondloop48: \n\t" - "sall %%edx \n\t" /* move high bit to CF */ - "jnc skip48 \n\t" /* if CF = 0 */ - "movl (%%esi), %%eax \n\t" - "movl %%eax, (%%edi) \n\t" - - "skip48: \n\t" - "addl $4, %%esi \n\t" - "addl $4, %%edi \n\t" - "decl %%ecx \n\t" - "jnz secondloop48 \n\t" - - "end48: \n\t" - "EMMS \n\t" /* DONE */ - - : "=a" (dummy_value_a), /* output regs (dummy) */ - "=d" (dummy_value_d), - "=c" (dummy_value_c), - "=S" (dummy_value_S), - "=D" (dummy_value_D) - - : "3" (srcptr), /* esi // input regs */ - "4" (dstptr), /* edi */ - "0" (diff), /* eax */ -/* was (unmask) "b" RESERVED // ebx // Global Offset Table idx */ - "2" (len), /* ecx */ - "1" (mask) /* edx */ - -#if 0 /* MMX regs (%mm0, etc.) not supported by gcc 2.7.2.3 or egcs 1.1 */ - : "%mm0", "%mm1", "%mm2", "%mm3" /* clobber list */ - , "%mm4", "%mm5", "%mm6", "%mm7" -#endif - ); - } - else /* mmx _not supported - Use modified C routine */ -#endif /* PNG_ASSEMBLER_CODE_SUPPORTED */ - { - register png_uint_32 i; - png_uint_32 initial_val = BPP6 * png_pass_start[png_ptr->pass]; - /* png.c: png_pass_start[] = {0, 4, 0, 2, 0, 1, 0}; */ - register int stride = BPP6 * png_pass_inc[png_ptr->pass]; - /* png.c: png_pass_inc[] = {8, 8, 4, 4, 2, 2, 1}; */ - register int rep_bytes = BPP6 * png_pass_width[png_ptr->pass]; - /* png.c: png_pass_width[] = {8, 4, 4, 2, 2, 1, 1}; */ - png_uint_32 len = png_ptr->width &~7; /* reduce to mult. of 8 */ - int diff = (int) (png_ptr->width & 7); /* amount lost */ - register png_uint_32 final_val = BPP6 * len; /* GRR bugfix */ - - srcptr = png_ptr->row_buf + 1 + initial_val; - dstptr = row + initial_val; - - for (i = initial_val; i < final_val; i += stride) - { - png_memcpy(dstptr, srcptr, rep_bytes); - srcptr += stride; - dstptr += stride; - } - if (diff) /* number of leftover pixels: 3 for pngtest */ - { - final_val+=diff*BPP6; - for (; i < final_val; i += stride) - { - if (rep_bytes > (int)(final_val-i)) - rep_bytes = (int)(final_val-i); - png_memcpy(dstptr, srcptr, rep_bytes); - srcptr += stride; - dstptr += stride; - } - } - } /* end of else (_mmx_supported) */ - - break; - } /* end 48 bpp */ - - case 64: /* png_ptr->row_info.pixel_depth */ - { - png_bytep srcptr; - png_bytep dstptr; - register png_uint_32 i; - png_uint_32 initial_val = BPP8 * png_pass_start[png_ptr->pass]; - /* png.c: png_pass_start[] = {0, 4, 0, 2, 0, 1, 0}; */ - register int stride = BPP8 * png_pass_inc[png_ptr->pass]; - /* png.c: png_pass_inc[] = {8, 8, 4, 4, 2, 2, 1}; */ - register int rep_bytes = BPP8 * png_pass_width[png_ptr->pass]; - /* png.c: png_pass_width[] = {8, 4, 4, 2, 2, 1, 1}; */ - png_uint_32 len = png_ptr->width &~7; /* reduce to mult. of 8 */ - int diff = (int) (png_ptr->width & 7); /* amount lost */ - register png_uint_32 final_val = BPP8 * len; /* GRR bugfix */ - - srcptr = png_ptr->row_buf + 1 + initial_val; - dstptr = row + initial_val; - - for (i = initial_val; i < final_val; i += stride) - { - png_memcpy(dstptr, srcptr, rep_bytes); - srcptr += stride; - dstptr += stride; - } - if (diff) /* number of leftover pixels: 3 for pngtest */ - { - final_val+=diff*BPP8; - for (; i < final_val; i += stride) - { - if (rep_bytes > (int)(final_val-i)) - rep_bytes = (int)(final_val-i); - png_memcpy(dstptr, srcptr, rep_bytes); - srcptr += stride; - dstptr += stride; - } - } - - break; - } /* end 64 bpp */ - - default: /* png_ptr->row_info.pixel_depth != 1,2,4,8,16,24,32,48,64 */ - { - /* this should never happen */ - png_warning(png_ptr, "Invalid row_info.pixel_depth in pnggccrd"); - break; - } - } /* end switch (png_ptr->row_info.pixel_depth) */ - - } /* end if (non-trivial mask) */ - -} /* end png_combine_row() */ - -#endif /* PNG_HAVE_ASSEMBLER_COMBINE_ROW */ - - - - -/*===========================================================================*/ -/* */ -/* P N G _ D O _ R E A D _ I N T E R L A C E */ -/* */ -/*===========================================================================*/ - -#if defined(PNG_READ_INTERLACING_SUPPORTED) -#if defined(PNG_HAVE_ASSEMBLER_READ_INTERLACE) - -/* png_do_read_interlace() is called after any 16-bit to 8-bit conversion - * has taken place. [GRR: what other steps come before and/or after?] - */ - -void /* PRIVATE */ -png_do_read_interlace(png_structp png_ptr) -{ - png_row_infop row_info = &(png_ptr->row_info); - png_bytep row = png_ptr->row_buf + 1; - int pass = png_ptr->pass; -#if defined(PNG_READ_PACKSWAP_SUPPORTED) - png_uint_32 transformations = png_ptr->transformations; -#endif - - png_debug(1, "in png_do_read_interlace (pnggccrd.c)\n"); - -#if defined(PNG_ASSEMBLER_CODE_SUPPORTED) - if (_mmx_supported == 2) { -#if !defined(PNG_1_0_X) - /* this should have happened in png_init_mmx_flags() already */ - png_warning(png_ptr, "asm_flags may not have been initialized"); -#endif - png_mmx_support(); - } -#endif - - if (row != NULL && row_info != NULL) - { - png_uint_32 final_width; - - final_width = row_info->width * png_pass_inc[pass]; - - switch (row_info->pixel_depth) - { - case 1: - { - png_bytep sp, dp; - int sshift, dshift; - int s_start, s_end, s_inc; - png_byte v; - png_uint_32 i; - int j; - - sp = row + (png_size_t)((row_info->width - 1) >> 3); - dp = row + (png_size_t)((final_width - 1) >> 3); -#if defined(PNG_READ_PACKSWAP_SUPPORTED) - if (transformations & PNG_PACKSWAP) - { - sshift = (int)((row_info->width + 7) & 7); - dshift = (int)((final_width + 7) & 7); - s_start = 7; - s_end = 0; - s_inc = -1; - } - else -#endif - { - sshift = 7 - (int)((row_info->width + 7) & 7); - dshift = 7 - (int)((final_width + 7) & 7); - s_start = 0; - s_end = 7; - s_inc = 1; - } - - for (i = row_info->width; i; i--) - { - v = (png_byte)((*sp >> sshift) & 0x1); - for (j = 0; j < png_pass_inc[pass]; j++) - { - *dp &= (png_byte)((0x7f7f >> (7 - dshift)) & 0xff); - *dp |= (png_byte)(v << dshift); - if (dshift == s_end) - { - dshift = s_start; - dp--; - } - else - dshift += s_inc; - } - if (sshift == s_end) - { - sshift = s_start; - sp--; - } - else - sshift += s_inc; - } - break; - } - - case 2: - { - png_bytep sp, dp; - int sshift, dshift; - int s_start, s_end, s_inc; - png_uint_32 i; - - sp = row + (png_size_t)((row_info->width - 1) >> 2); - dp = row + (png_size_t)((final_width - 1) >> 2); -#if defined(PNG_READ_PACKSWAP_SUPPORTED) - if (transformations & PNG_PACKSWAP) - { - sshift = (png_size_t)(((row_info->width + 3) & 3) << 1); - dshift = (png_size_t)(((final_width + 3) & 3) << 1); - s_start = 6; - s_end = 0; - s_inc = -2; - } - else -#endif - { - sshift = (png_size_t)((3 - ((row_info->width + 3) & 3)) << 1); - dshift = (png_size_t)((3 - ((final_width + 3) & 3)) << 1); - s_start = 0; - s_end = 6; - s_inc = 2; - } - - for (i = row_info->width; i; i--) - { - png_byte v; - int j; - - v = (png_byte)((*sp >> sshift) & 0x3); - for (j = 0; j < png_pass_inc[pass]; j++) - { - *dp &= (png_byte)((0x3f3f >> (6 - dshift)) & 0xff); - *dp |= (png_byte)(v << dshift); - if (dshift == s_end) - { - dshift = s_start; - dp--; - } - else - dshift += s_inc; - } - if (sshift == s_end) - { - sshift = s_start; - sp--; - } - else - sshift += s_inc; - } - break; - } - - case 4: - { - png_bytep sp, dp; - int sshift, dshift; - int s_start, s_end, s_inc; - png_uint_32 i; - - sp = row + (png_size_t)((row_info->width - 1) >> 1); - dp = row + (png_size_t)((final_width - 1) >> 1); -#if defined(PNG_READ_PACKSWAP_SUPPORTED) - if (transformations & PNG_PACKSWAP) - { - sshift = (png_size_t)(((row_info->width + 1) & 1) << 2); - dshift = (png_size_t)(((final_width + 1) & 1) << 2); - s_start = 4; - s_end = 0; - s_inc = -4; - } - else -#endif - { - sshift = (png_size_t)((1 - ((row_info->width + 1) & 1)) << 2); - dshift = (png_size_t)((1 - ((final_width + 1) & 1)) << 2); - s_start = 0; - s_end = 4; - s_inc = 4; - } - - for (i = row_info->width; i; i--) - { - png_byte v; - int j; - - v = (png_byte)((*sp >> sshift) & 0xf); - for (j = 0; j < png_pass_inc[pass]; j++) - { - *dp &= (png_byte)((0xf0f >> (4 - dshift)) & 0xff); - *dp |= (png_byte)(v << dshift); - if (dshift == s_end) - { - dshift = s_start; - dp--; - } - else - dshift += s_inc; - } - if (sshift == s_end) - { - sshift = s_start; - sp--; - } - else - sshift += s_inc; - } - break; - } - - /*====================================================================*/ - - default: /* 8-bit or larger (this is where the routine is modified) */ - { -#if 0 -/* static unsigned long long _const4 = 0x0000000000FFFFFFLL; no good */ -/* static unsigned long long const4 = 0x0000000000FFFFFFLL; no good */ -/* unsigned long long _const4 = 0x0000000000FFFFFFLL; no good */ -/* unsigned long long const4 = 0x0000000000FFFFFFLL; no good */ -#endif - png_bytep sptr, dp; - png_uint_32 i; - png_size_t pixel_bytes; - int width = (int)row_info->width; - - pixel_bytes = (row_info->pixel_depth >> 3); - - /* point sptr at the last pixel in the pre-expanded row: */ - sptr = row + (width - 1) * pixel_bytes; - - /* point dp at the last pixel position in the expanded row: */ - dp = row + (final_width - 1) * pixel_bytes; - - /* New code by Nirav Chhatrapati - Intel Corporation */ - -#if defined(PNG_ASSEMBLER_CODE_SUPPORTED) -#if !defined(PNG_1_0_X) - if ((png_ptr->asm_flags & PNG_ASM_FLAG_MMX_READ_INTERLACE) - /* && _mmx_supported */ ) -#else - if (_mmx_supported) -#endif - { - //-------------------------------------------------------------- - if (pixel_bytes == 3) - { - if (((pass == 0) || (pass == 1)) && width) - { - int dummy_value_c; /* fix 'forbidden register spilled' */ - int dummy_value_S; - int dummy_value_D; - - __asm__ __volatile__ ( - "subl $21, %%edi \n\t" - /* (png_pass_inc[pass] - 1)*pixel_bytes */ - - ".loop3_pass0: \n\t" - "movd (%%esi), %%mm0 \n\t" /* x x x x x 2 1 0 */ - "pand _const4, %%mm0 \n\t" /* z z z z z 2 1 0 */ - "movq %%mm0, %%mm1 \n\t" /* z z z z z 2 1 0 */ - "psllq $16, %%mm0 \n\t" /* z z z 2 1 0 z z */ - "movq %%mm0, %%mm2 \n\t" /* z z z 2 1 0 z z */ - "psllq $24, %%mm0 \n\t" /* 2 1 0 z z z z z */ - "psrlq $8, %%mm1 \n\t" /* z z z z z z 2 1 */ - "por %%mm2, %%mm0 \n\t" /* 2 1 0 2 1 0 z z */ - "por %%mm1, %%mm0 \n\t" /* 2 1 0 2 1 0 2 1 */ - "movq %%mm0, %%mm3 \n\t" /* 2 1 0 2 1 0 2 1 */ - "psllq $16, %%mm0 \n\t" /* 0 2 1 0 2 1 z z */ - "movq %%mm3, %%mm4 \n\t" /* 2 1 0 2 1 0 2 1 */ - "punpckhdq %%mm0, %%mm3 \n\t" /* 0 2 1 0 2 1 0 2 */ - "movq %%mm4, 16(%%edi) \n\t" - "psrlq $32, %%mm0 \n\t" /* z z z z 0 2 1 0 */ - "movq %%mm3, 8(%%edi) \n\t" - "punpckldq %%mm4, %%mm0 \n\t" /* 1 0 2 1 0 2 1 0 */ - "subl $3, %%esi \n\t" - "movq %%mm0, (%%edi) \n\t" - "subl $24, %%edi \n\t" - "decl %%ecx \n\t" - "jnz .loop3_pass0 \n\t" - "EMMS \n\t" /* DONE */ - - : "=c" (dummy_value_c), /* output regs (dummy) */ - "=S" (dummy_value_S), - "=D" (dummy_value_D) - - : "1" (sptr), // esi // input regs - "2" (dp), // edi - "0" (width), // ecx - "rim" (_const4) // %1(?) (0x0000000000FFFFFFLL) - -#if 0 /* %mm0, ..., %mm4 not supported by gcc 2.7.2.3 or egcs 1.1 */ - : "%mm0", "%mm1", "%mm2" /* clobber list */ - , "%mm3", "%mm4" -#endif - ); - } - else if (((pass == 2) || (pass == 3)) && width) - { - int dummy_value_c; /* fix 'forbidden register spilled' */ - int dummy_value_S; - int dummy_value_D; - - __asm__ __volatile__ ( - "subl $9, %%edi \n\t" - /* (png_pass_inc[pass] - 1)*pixel_bytes */ - - ".loop3_pass2: \n\t" - "movd (%%esi), %%mm0 \n\t" /* x x x x x 2 1 0 */ - "pand _const4, %%mm0 \n\t" /* z z z z z 2 1 0 */ - "movq %%mm0, %%mm1 \n\t" /* z z z z z 2 1 0 */ - "psllq $16, %%mm0 \n\t" /* z z z 2 1 0 z z */ - "movq %%mm0, %%mm2 \n\t" /* z z z 2 1 0 z z */ - "psllq $24, %%mm0 \n\t" /* 2 1 0 z z z z z */ - "psrlq $8, %%mm1 \n\t" /* z z z z z z 2 1 */ - "por %%mm2, %%mm0 \n\t" /* 2 1 0 2 1 0 z z */ - "por %%mm1, %%mm0 \n\t" /* 2 1 0 2 1 0 2 1 */ - "movq %%mm0, 4(%%edi) \n\t" - "psrlq $16, %%mm0 \n\t" /* z z 2 1 0 2 1 0 */ - "subl $3, %%esi \n\t" - "movd %%mm0, (%%edi) \n\t" - "subl $12, %%edi \n\t" - "decl %%ecx \n\t" - "jnz .loop3_pass2 \n\t" - "EMMS \n\t" /* DONE */ - - : "=c" (dummy_value_c), /* output regs (dummy) */ - "=S" (dummy_value_S), - "=D" (dummy_value_D) - - : "1" (sptr), // esi // input regs - "2" (dp), // edi - "0" (width), // ecx - "rim" (_const4) // (0x0000000000FFFFFFLL) - -#if 0 /* %mm0, ..., %mm2 not supported by gcc 2.7.2.3 or egcs 1.1 */ - : "%mm0", "%mm1", "%mm2" /* clobber list */ -#endif - ); - } - else if (width) /* && ((pass == 4) || (pass == 5)) */ - { - int width_mmx = ((width >> 1) << 1) - 8; /* GRR: huh? */ - if (width_mmx < 0) - width_mmx = 0; - width -= width_mmx; /* 8 or 9 pix, 24 or 27 bytes */ - if (width_mmx) - { - /* png_pass_inc[] = {8, 8, 4, 4, 2, 2, 1}; */ - /* sptr points at last pixel in pre-expanded row */ - /* dp points at last pixel position in expanded row */ - int dummy_value_c; /* fix 'forbidden register spilled' */ - int dummy_value_S; - int dummy_value_D; - - __asm__ __volatile__ ( - "subl $3, %%esi \n\t" - "subl $9, %%edi \n\t" - /* (png_pass_inc[pass] + 1)*pixel_bytes */ - - ".loop3_pass4: \n\t" - "movq (%%esi), %%mm0 \n\t" /* x x 5 4 3 2 1 0 */ - "movq %%mm0, %%mm1 \n\t" /* x x 5 4 3 2 1 0 */ - "movq %%mm0, %%mm2 \n\t" /* x x 5 4 3 2 1 0 */ - "psllq $24, %%mm0 \n\t" /* 4 3 2 1 0 z z z */ - "pand _const4, %%mm1 \n\t" /* z z z z z 2 1 0 */ - "psrlq $24, %%mm2 \n\t" /* z z z x x 5 4 3 */ - "por %%mm1, %%mm0 \n\t" /* 4 3 2 1 0 2 1 0 */ - "movq %%mm2, %%mm3 \n\t" /* z z z x x 5 4 3 */ - "psllq $8, %%mm2 \n\t" /* z z x x 5 4 3 z */ - "movq %%mm0, (%%edi) \n\t" - "psrlq $16, %%mm3 \n\t" /* z z z z z x x 5 */ - "pand _const6, %%mm3 \n\t" /* z z z z z z z 5 */ - "por %%mm3, %%mm2 \n\t" /* z z x x 5 4 3 5 */ - "subl $6, %%esi \n\t" - "movd %%mm2, 8(%%edi) \n\t" - "subl $12, %%edi \n\t" - "subl $2, %%ecx \n\t" - "jnz .loop3_pass4 \n\t" - "EMMS \n\t" /* DONE */ - - : "=c" (dummy_value_c), /* output regs (dummy) */ - "=S" (dummy_value_S), - "=D" (dummy_value_D) - - : "1" (sptr), // esi // input regs - "2" (dp), // edi - "0" (width_mmx), // ecx - "rim" (_const4), // 0x0000000000FFFFFFLL - "rim" (_const6) // 0x00000000000000FFLL - -#if 0 /* %mm0, ..., %mm3 not supported by gcc 2.7.2.3 or egcs 1.1 */ - : "%mm0", "%mm1" /* clobber list */ - , "%mm2", "%mm3" -#endif - ); - } - - sptr -= width_mmx*3; - dp -= width_mmx*6; - for (i = width; i; i--) - { - png_byte v[8]; - int j; - - png_memcpy(v, sptr, 3); - for (j = 0; j < png_pass_inc[pass]; j++) - { - png_memcpy(dp, v, 3); - dp -= 3; - } - sptr -= 3; - } - } - } /* end of pixel_bytes == 3 */ - - //-------------------------------------------------------------- - else if (pixel_bytes == 1) - { - if (((pass == 0) || (pass == 1)) && width) - { - int width_mmx = ((width >> 2) << 2); - width -= width_mmx; /* 0-3 pixels => 0-3 bytes */ - if (width_mmx) - { - int dummy_value_c; /* fix 'forbidden register spilled' */ - int dummy_value_S; - int dummy_value_D; - - __asm__ __volatile__ ( - "subl $3, %%esi \n\t" - "subl $31, %%edi \n\t" - - ".loop1_pass0: \n\t" - "movd (%%esi), %%mm0 \n\t" /* x x x x 3 2 1 0 */ - "movq %%mm0, %%mm1 \n\t" /* x x x x 3 2 1 0 */ - "punpcklbw %%mm0, %%mm0 \n\t" /* 3 3 2 2 1 1 0 0 */ - "movq %%mm0, %%mm2 \n\t" /* 3 3 2 2 1 1 0 0 */ - "punpcklwd %%mm0, %%mm0 \n\t" /* 1 1 1 1 0 0 0 0 */ - "movq %%mm0, %%mm3 \n\t" /* 1 1 1 1 0 0 0 0 */ - "punpckldq %%mm0, %%mm0 \n\t" /* 0 0 0 0 0 0 0 0 */ - "punpckhdq %%mm3, %%mm3 \n\t" /* 1 1 1 1 1 1 1 1 */ - "movq %%mm0, (%%edi) \n\t" - "punpckhwd %%mm2, %%mm2 \n\t" /* 3 3 3 3 2 2 2 2 */ - "movq %%mm3, 8(%%edi) \n\t" - "movq %%mm2, %%mm4 \n\t" /* 3 3 3 3 2 2 2 2 */ - "punpckldq %%mm2, %%mm2 \n\t" /* 2 2 2 2 2 2 2 2 */ - "punpckhdq %%mm4, %%mm4 \n\t" /* 3 3 3 3 3 3 3 3 */ - "movq %%mm2, 16(%%edi) \n\t" - "subl $4, %%esi \n\t" - "movq %%mm4, 24(%%edi) \n\t" - "subl $32, %%edi \n\t" - "subl $4, %%ecx \n\t" - "jnz .loop1_pass0 \n\t" - "EMMS \n\t" /* DONE */ - - : "=c" (dummy_value_c), /* output regs (dummy) */ - "=S" (dummy_value_S), - "=D" (dummy_value_D) - - : "1" (sptr), /* esi // input regs */ - "2" (dp), /* edi */ - "0" (width_mmx) /* ecx */ - -#if 0 /* %mm0, ..., %mm4 not supported by gcc 2.7.2.3 or egcs 1.1 */ - : "%mm0", "%mm1", "%mm2" /* clobber list */ - , "%mm3", "%mm4" -#endif - ); - } - - sptr -= width_mmx; - dp -= width_mmx*8; - for (i = width; i; i--) - { - int j; - - /* I simplified this part in version 1.0.4e - * here and in several other instances where - * pixel_bytes == 1 -- GR-P - * - * Original code: - * - * png_byte v[8]; - * png_memcpy(v, sptr, pixel_bytes); - * for (j = 0; j < png_pass_inc[pass]; j++) - * { - * png_memcpy(dp, v, pixel_bytes); - * dp -= pixel_bytes; - * } - * sptr -= pixel_bytes; - * - * Replacement code is in the next three lines: - */ - - for (j = 0; j < png_pass_inc[pass]; j++) - { - *dp-- = *sptr; - } - --sptr; - } - } - else if (((pass == 2) || (pass == 3)) && width) - { - int width_mmx = ((width >> 2) << 2); - width -= width_mmx; /* 0-3 pixels => 0-3 bytes */ - if (width_mmx) - { - int dummy_value_c; /* fix 'forbidden register spilled' */ - int dummy_value_S; - int dummy_value_D; - - __asm__ __volatile__ ( - "subl $3, %%esi \n\t" - "subl $15, %%edi \n\t" - - ".loop1_pass2: \n\t" - "movd (%%esi), %%mm0 \n\t" /* x x x x 3 2 1 0 */ - "punpcklbw %%mm0, %%mm0 \n\t" /* 3 3 2 2 1 1 0 0 */ - "movq %%mm0, %%mm1 \n\t" /* 3 3 2 2 1 1 0 0 */ - "punpcklwd %%mm0, %%mm0 \n\t" /* 1 1 1 1 0 0 0 0 */ - "punpckhwd %%mm1, %%mm1 \n\t" /* 3 3 3 3 2 2 2 2 */ - "movq %%mm0, (%%edi) \n\t" - "subl $4, %%esi \n\t" - "movq %%mm1, 8(%%edi) \n\t" - "subl $16, %%edi \n\t" - "subl $4, %%ecx \n\t" - "jnz .loop1_pass2 \n\t" - "EMMS \n\t" /* DONE */ - - : "=c" (dummy_value_c), /* output regs (dummy) */ - "=S" (dummy_value_S), - "=D" (dummy_value_D) - - : "1" (sptr), /* esi // input regs */ - "2" (dp), /* edi */ - "0" (width_mmx) /* ecx */ - -#if 0 /* %mm0, %mm1 not supported by gcc 2.7.2.3 or egcs 1.1 */ - : "%mm0", "%mm1" /* clobber list */ -#endif - ); - } - - sptr -= width_mmx; - dp -= width_mmx*4; - for (i = width; i; i--) - { - int j; - - for (j = 0; j < png_pass_inc[pass]; j++) - { - *dp-- = *sptr; - } - --sptr; - } - } - else if (width) /* && ((pass == 4) || (pass == 5)) */ - { - int width_mmx = ((width >> 3) << 3); - width -= width_mmx; /* 0-3 pixels => 0-3 bytes */ - if (width_mmx) - { - int dummy_value_c; /* fix 'forbidden register spilled' */ - int dummy_value_S; - int dummy_value_D; - - __asm__ __volatile__ ( - "subl $7, %%esi \n\t" - "subl $15, %%edi \n\t" - - ".loop1_pass4: \n\t" - "movq (%%esi), %%mm0 \n\t" /* 7 6 5 4 3 2 1 0 */ - "movq %%mm0, %%mm1 \n\t" /* 7 6 5 4 3 2 1 0 */ - "punpcklbw %%mm0, %%mm0 \n\t" /* 3 3 2 2 1 1 0 0 */ - "punpckhbw %%mm1, %%mm1 \n\t" /* 7 7 6 6 5 5 4 4 */ - "movq %%mm1, 8(%%edi) \n\t" - "subl $8, %%esi \n\t" - "movq %%mm0, (%%edi) \n\t" - "subl $16, %%edi \n\t" - "subl $8, %%ecx \n\t" - "jnz .loop1_pass4 \n\t" - "EMMS \n\t" /* DONE */ - - : "=c" (dummy_value_c), /* output regs (none) */ - "=S" (dummy_value_S), - "=D" (dummy_value_D) - - : "1" (sptr), /* esi // input regs */ - "2" (dp), /* edi */ - "0" (width_mmx) /* ecx */ - -#if 0 /* %mm0, %mm1 not supported by gcc 2.7.2.3 or egcs 1.1 */ - : "%mm0", "%mm1" /* clobber list */ -#endif - ); - } - - sptr -= width_mmx; - dp -= width_mmx*2; - for (i = width; i; i--) - { - int j; - - for (j = 0; j < png_pass_inc[pass]; j++) - { - *dp-- = *sptr; - } - --sptr; - } - } - } /* end of pixel_bytes == 1 */ - - //-------------------------------------------------------------- - else if (pixel_bytes == 2) - { - if (((pass == 0) || (pass == 1)) && width) - { - int width_mmx = ((width >> 1) << 1); - width -= width_mmx; /* 0,1 pixels => 0,2 bytes */ - if (width_mmx) - { - int dummy_value_c; /* fix 'forbidden register spilled' */ - int dummy_value_S; - int dummy_value_D; - - __asm__ __volatile__ ( - "subl $2, %%esi \n\t" - "subl $30, %%edi \n\t" - - ".loop2_pass0: \n\t" - "movd (%%esi), %%mm0 \n\t" /* x x x x 3 2 1 0 */ - "punpcklwd %%mm0, %%mm0 \n\t" /* 3 2 3 2 1 0 1 0 */ - "movq %%mm0, %%mm1 \n\t" /* 3 2 3 2 1 0 1 0 */ - "punpckldq %%mm0, %%mm0 \n\t" /* 1 0 1 0 1 0 1 0 */ - "punpckhdq %%mm1, %%mm1 \n\t" /* 3 2 3 2 3 2 3 2 */ - "movq %%mm0, (%%edi) \n\t" - "movq %%mm0, 8(%%edi) \n\t" - "movq %%mm1, 16(%%edi) \n\t" - "subl $4, %%esi \n\t" - "movq %%mm1, 24(%%edi) \n\t" - "subl $32, %%edi \n\t" - "subl $2, %%ecx \n\t" - "jnz .loop2_pass0 \n\t" - "EMMS \n\t" /* DONE */ - - : "=c" (dummy_value_c), /* output regs (dummy) */ - "=S" (dummy_value_S), - "=D" (dummy_value_D) - - : "1" (sptr), /* esi // input regs */ - "2" (dp), /* edi */ - "0" (width_mmx) /* ecx */ - -#if 0 /* %mm0, %mm1 not supported by gcc 2.7.2.3 or egcs 1.1 */ - : "%mm0", "%mm1" /* clobber list */ -#endif - ); - } - - sptr -= (width_mmx*2 - 2); /* sign fixed */ - dp -= (width_mmx*16 - 2); /* sign fixed */ - for (i = width; i; i--) - { - png_byte v[8]; - int j; - sptr -= 2; - png_memcpy(v, sptr, 2); - for (j = 0; j < png_pass_inc[pass]; j++) - { - dp -= 2; - png_memcpy(dp, v, 2); - } - } - } - else if (((pass == 2) || (pass == 3)) && width) - { - int width_mmx = ((width >> 1) << 1) ; - width -= width_mmx; /* 0,1 pixels => 0,2 bytes */ - if (width_mmx) - { - int dummy_value_c; /* fix 'forbidden register spilled' */ - int dummy_value_S; - int dummy_value_D; - - __asm__ __volatile__ ( - "subl $2, %%esi \n\t" - "subl $14, %%edi \n\t" - - ".loop2_pass2: \n\t" - "movd (%%esi), %%mm0 \n\t" /* x x x x 3 2 1 0 */ - "punpcklwd %%mm0, %%mm0 \n\t" /* 3 2 3 2 1 0 1 0 */ - "movq %%mm0, %%mm1 \n\t" /* 3 2 3 2 1 0 1 0 */ - "punpckldq %%mm0, %%mm0 \n\t" /* 1 0 1 0 1 0 1 0 */ - "punpckhdq %%mm1, %%mm1 \n\t" /* 3 2 3 2 3 2 3 2 */ - "movq %%mm0, (%%edi) \n\t" - "subl $4, %%esi \n\t" - "movq %%mm1, 8(%%edi) \n\t" - "subl $16, %%edi \n\t" - "subl $2, %%ecx \n\t" - "jnz .loop2_pass2 \n\t" - "EMMS \n\t" /* DONE */ - - : "=c" (dummy_value_c), /* output regs (dummy) */ - "=S" (dummy_value_S), - "=D" (dummy_value_D) - - : "1" (sptr), /* esi // input regs */ - "2" (dp), /* edi */ - "0" (width_mmx) /* ecx */ - -#if 0 /* %mm0, %mm1 not supported by gcc 2.7.2.3 or egcs 1.1 */ - : "%mm0", "%mm1" /* clobber list */ -#endif - ); - } - - sptr -= (width_mmx*2 - 2); /* sign fixed */ - dp -= (width_mmx*8 - 2); /* sign fixed */ - for (i = width; i; i--) - { - png_byte v[8]; - int j; - sptr -= 2; - png_memcpy(v, sptr, 2); - for (j = 0; j < png_pass_inc[pass]; j++) - { - dp -= 2; - png_memcpy(dp, v, 2); - } - } - } - else if (width) /* pass == 4 or 5 */ - { - int width_mmx = ((width >> 1) << 1) ; - width -= width_mmx; /* 0,1 pixels => 0,2 bytes */ - if (width_mmx) - { - int dummy_value_c; /* fix 'forbidden register spilled' */ - int dummy_value_S; - int dummy_value_D; - - __asm__ __volatile__ ( - "subl $2, %%esi \n\t" - "subl $6, %%edi \n\t" - - ".loop2_pass4: \n\t" - "movd (%%esi), %%mm0 \n\t" /* x x x x 3 2 1 0 */ - "punpcklwd %%mm0, %%mm0 \n\t" /* 3 2 3 2 1 0 1 0 */ - "subl $4, %%esi \n\t" - "movq %%mm0, (%%edi) \n\t" - "subl $8, %%edi \n\t" - "subl $2, %%ecx \n\t" - "jnz .loop2_pass4 \n\t" - "EMMS \n\t" /* DONE */ - - : "=c" (dummy_value_c), /* output regs (dummy) */ - "=S" (dummy_value_S), - "=D" (dummy_value_D) - - : "1" (sptr), /* esi // input regs */ - "2" (dp), /* edi */ - "0" (width_mmx) /* ecx */ - -#if 0 /* %mm0 not supported by gcc 2.7.2.3 or egcs 1.1 */ - : "%mm0" /* clobber list */ -#endif - ); - } - - sptr -= (width_mmx*2 - 2); /* sign fixed */ - dp -= (width_mmx*4 - 2); /* sign fixed */ - for (i = width; i; i--) - { - png_byte v[8]; - int j; - sptr -= 2; - png_memcpy(v, sptr, 2); - for (j = 0; j < png_pass_inc[pass]; j++) - { - dp -= 2; - png_memcpy(dp, v, 2); - } - } - } - } /* end of pixel_bytes == 2 */ - - //-------------------------------------------------------------- - else if (pixel_bytes == 4) - { - if (((pass == 0) || (pass == 1)) && width) - { - int width_mmx = ((width >> 1) << 1); - width -= width_mmx; /* 0,1 pixels => 0,4 bytes */ - if (width_mmx) - { - int dummy_value_c; /* fix 'forbidden register spilled' */ - int dummy_value_S; - int dummy_value_D; - - __asm__ __volatile__ ( - "subl $4, %%esi \n\t" - "subl $60, %%edi \n\t" - - ".loop4_pass0: \n\t" - "movq (%%esi), %%mm0 \n\t" /* 7 6 5 4 3 2 1 0 */ - "movq %%mm0, %%mm1 \n\t" /* 7 6 5 4 3 2 1 0 */ - "punpckldq %%mm0, %%mm0 \n\t" /* 3 2 1 0 3 2 1 0 */ - "punpckhdq %%mm1, %%mm1 \n\t" /* 7 6 5 4 7 6 5 4 */ - "movq %%mm0, (%%edi) \n\t" - "movq %%mm0, 8(%%edi) \n\t" - "movq %%mm0, 16(%%edi) \n\t" - "movq %%mm0, 24(%%edi) \n\t" - "movq %%mm1, 32(%%edi) \n\t" - "movq %%mm1, 40(%%edi) \n\t" - "movq %%mm1, 48(%%edi) \n\t" - "subl $8, %%esi \n\t" - "movq %%mm1, 56(%%edi) \n\t" - "subl $64, %%edi \n\t" - "subl $2, %%ecx \n\t" - "jnz .loop4_pass0 \n\t" - "EMMS \n\t" /* DONE */ - - : "=c" (dummy_value_c), /* output regs (dummy) */ - "=S" (dummy_value_S), - "=D" (dummy_value_D) - - : "1" (sptr), /* esi // input regs */ - "2" (dp), /* edi */ - "0" (width_mmx) /* ecx */ - -#if 0 /* %mm0, %mm1 not supported by gcc 2.7.2.3 or egcs 1.1 */ - : "%mm0", "%mm1" /* clobber list */ -#endif - ); - } - - sptr -= (width_mmx*4 - 4); /* sign fixed */ - dp -= (width_mmx*32 - 4); /* sign fixed */ - for (i = width; i; i--) - { - png_byte v[8]; - int j; - sptr -= 4; - png_memcpy(v, sptr, 4); - for (j = 0; j < png_pass_inc[pass]; j++) - { - dp -= 4; - png_memcpy(dp, v, 4); - } - } - } - else if (((pass == 2) || (pass == 3)) && width) - { - int width_mmx = ((width >> 1) << 1); - width -= width_mmx; /* 0,1 pixels => 0,4 bytes */ - if (width_mmx) - { - int dummy_value_c; /* fix 'forbidden register spilled' */ - int dummy_value_S; - int dummy_value_D; - - __asm__ __volatile__ ( - "subl $4, %%esi \n\t" - "subl $28, %%edi \n\t" - - ".loop4_pass2: \n\t" - "movq (%%esi), %%mm0 \n\t" /* 7 6 5 4 3 2 1 0 */ - "movq %%mm0, %%mm1 \n\t" /* 7 6 5 4 3 2 1 0 */ - "punpckldq %%mm0, %%mm0 \n\t" /* 3 2 1 0 3 2 1 0 */ - "punpckhdq %%mm1, %%mm1 \n\t" /* 7 6 5 4 7 6 5 4 */ - "movq %%mm0, (%%edi) \n\t" - "movq %%mm0, 8(%%edi) \n\t" - "movq %%mm1, 16(%%edi) \n\t" - "movq %%mm1, 24(%%edi) \n\t" - "subl $8, %%esi \n\t" - "subl $32, %%edi \n\t" - "subl $2, %%ecx \n\t" - "jnz .loop4_pass2 \n\t" - "EMMS \n\t" /* DONE */ - - : "=c" (dummy_value_c), /* output regs (dummy) */ - "=S" (dummy_value_S), - "=D" (dummy_value_D) - - : "1" (sptr), /* esi // input regs */ - "2" (dp), /* edi */ - "0" (width_mmx) /* ecx */ - -#if 0 /* %mm0, %mm1 not supported by gcc 2.7.2.3 or egcs 1.1 */ - : "%mm0", "%mm1" /* clobber list */ -#endif - ); - } - - sptr -= (width_mmx*4 - 4); /* sign fixed */ - dp -= (width_mmx*16 - 4); /* sign fixed */ - for (i = width; i; i--) - { - png_byte v[8]; - int j; - sptr -= 4; - png_memcpy(v, sptr, 4); - for (j = 0; j < png_pass_inc[pass]; j++) - { - dp -= 4; - png_memcpy(dp, v, 4); - } - } - } - else if (width) /* pass == 4 or 5 */ - { - int width_mmx = ((width >> 1) << 1) ; - width -= width_mmx; /* 0,1 pixels => 0,4 bytes */ - if (width_mmx) - { - int dummy_value_c; /* fix 'forbidden register spilled' */ - int dummy_value_S; - int dummy_value_D; - - __asm__ __volatile__ ( - "subl $4, %%esi \n\t" - "subl $12, %%edi \n\t" - - ".loop4_pass4: \n\t" - "movq (%%esi), %%mm0 \n\t" /* 7 6 5 4 3 2 1 0 */ - "movq %%mm0, %%mm1 \n\t" /* 7 6 5 4 3 2 1 0 */ - "punpckldq %%mm0, %%mm0 \n\t" /* 3 2 1 0 3 2 1 0 */ - "punpckhdq %%mm1, %%mm1 \n\t" /* 7 6 5 4 7 6 5 4 */ - "movq %%mm0, (%%edi) \n\t" - "subl $8, %%esi \n\t" - "movq %%mm1, 8(%%edi) \n\t" - "subl $16, %%edi \n\t" - "subl $2, %%ecx \n\t" - "jnz .loop4_pass4 \n\t" - "EMMS \n\t" /* DONE */ - - : "=c" (dummy_value_c), /* output regs (dummy) */ - "=S" (dummy_value_S), - "=D" (dummy_value_D) - - : "1" (sptr), /* esi // input regs */ - "2" (dp), /* edi */ - "0" (width_mmx) /* ecx */ - -#if 0 /* %mm0, %mm1 not supported by gcc 2.7.2.3 or egcs 1.1 */ - : "%mm0", "%mm1" /* clobber list */ -#endif - ); - } - - sptr -= (width_mmx*4 - 4); /* sign fixed */ - dp -= (width_mmx*8 - 4); /* sign fixed */ - for (i = width; i; i--) - { - png_byte v[8]; - int j; - sptr -= 4; - png_memcpy(v, sptr, 4); - for (j = 0; j < png_pass_inc[pass]; j++) - { - dp -= 4; - png_memcpy(dp, v, 4); - } - } - } - } /* end of pixel_bytes == 4 */ - - //-------------------------------------------------------------- - else if (pixel_bytes == 8) - { -/* GRR TEST: should work, but needs testing (special 64-bit version of rpng2?) */ - /* GRR NOTE: no need to combine passes here! */ - if (((pass == 0) || (pass == 1)) && width) - { - int dummy_value_c; /* fix 'forbidden register spilled' */ - int dummy_value_S; - int dummy_value_D; - - /* source is 8-byte RRGGBBAA */ - /* dest is 64-byte RRGGBBAA RRGGBBAA RRGGBBAA RRGGBBAA ... */ - __asm__ __volatile__ ( - "subl $56, %%edi \n\t" /* start of last block */ - - ".loop8_pass0: \n\t" - "movq (%%esi), %%mm0 \n\t" /* 7 6 5 4 3 2 1 0 */ - "movq %%mm0, (%%edi) \n\t" - "movq %%mm0, 8(%%edi) \n\t" - "movq %%mm0, 16(%%edi) \n\t" - "movq %%mm0, 24(%%edi) \n\t" - "movq %%mm0, 32(%%edi) \n\t" - "movq %%mm0, 40(%%edi) \n\t" - "movq %%mm0, 48(%%edi) \n\t" - "subl $8, %%esi \n\t" - "movq %%mm0, 56(%%edi) \n\t" - "subl $64, %%edi \n\t" - "decl %%ecx \n\t" - "jnz .loop8_pass0 \n\t" - "EMMS \n\t" /* DONE */ - - : "=c" (dummy_value_c), /* output regs (dummy) */ - "=S" (dummy_value_S), - "=D" (dummy_value_D) - - : "1" (sptr), /* esi // input regs */ - "2" (dp), /* edi */ - "0" (width) /* ecx */ - -#if 0 /* %mm0 not supported by gcc 2.7.2.3 or egcs 1.1 */ - : "%mm0" /* clobber list */ -#endif - ); - } - else if (((pass == 2) || (pass == 3)) && width) - { - /* source is 8-byte RRGGBBAA */ - /* dest is 32-byte RRGGBBAA RRGGBBAA RRGGBBAA RRGGBBAA */ - /* (recall that expansion is _in place_: sptr and dp */ - /* both point at locations within same row buffer) */ - { - int dummy_value_c; /* fix 'forbidden register spilled' */ - int dummy_value_S; - int dummy_value_D; - - __asm__ __volatile__ ( - "subl $24, %%edi \n\t" /* start of last block */ - - ".loop8_pass2: \n\t" - "movq (%%esi), %%mm0 \n\t" /* 7 6 5 4 3 2 1 0 */ - "movq %%mm0, (%%edi) \n\t" - "movq %%mm0, 8(%%edi) \n\t" - "movq %%mm0, 16(%%edi) \n\t" - "subl $8, %%esi \n\t" - "movq %%mm0, 24(%%edi) \n\t" - "subl $32, %%edi \n\t" - "decl %%ecx \n\t" - "jnz .loop8_pass2 \n\t" - "EMMS \n\t" /* DONE */ - - : "=c" (dummy_value_c), /* output regs (dummy) */ - "=S" (dummy_value_S), - "=D" (dummy_value_D) - - : "1" (sptr), /* esi // input regs */ - "2" (dp), /* edi */ - "0" (width) /* ecx */ - -#if 0 /* %mm0 not supported by gcc 2.7.2.3 or egcs 1.1 */ - : "%mm0" /* clobber list */ -#endif - ); - } - } - else if (width) /* pass == 4 or 5 */ - { - /* source is 8-byte RRGGBBAA */ - /* dest is 16-byte RRGGBBAA RRGGBBAA */ - { - int dummy_value_c; /* fix 'forbidden register spilled' */ - int dummy_value_S; - int dummy_value_D; - - __asm__ __volatile__ ( - "subl $8, %%edi \n\t" /* start of last block */ - - ".loop8_pass4: \n\t" - "movq (%%esi), %%mm0 \n\t" /* 7 6 5 4 3 2 1 0 */ - "movq %%mm0, (%%edi) \n\t" - "subl $8, %%esi \n\t" - "movq %%mm0, 8(%%edi) \n\t" - "subl $16, %%edi \n\t" - "decl %%ecx \n\t" - "jnz .loop8_pass4 \n\t" - "EMMS \n\t" /* DONE */ - - : "=c" (dummy_value_c), /* output regs (dummy) */ - "=S" (dummy_value_S), - "=D" (dummy_value_D) - - : "1" (sptr), /* esi // input regs */ - "2" (dp), /* edi */ - "0" (width) /* ecx */ - -#if 0 /* %mm0 not supported by gcc 2.7.2.3 or egcs 1.1 */ - : "%mm0" /* clobber list */ -#endif - ); - } - } - - } /* end of pixel_bytes == 8 */ - - //-------------------------------------------------------------- - else if (pixel_bytes == 6) - { - for (i = width; i; i--) - { - png_byte v[8]; - int j; - png_memcpy(v, sptr, 6); - for (j = 0; j < png_pass_inc[pass]; j++) - { - png_memcpy(dp, v, 6); - dp -= 6; - } - sptr -= 6; - } - } /* end of pixel_bytes == 6 */ - - //-------------------------------------------------------------- - else - { - for (i = width; i; i--) - { - png_byte v[8]; - int j; - png_memcpy(v, sptr, pixel_bytes); - for (j = 0; j < png_pass_inc[pass]; j++) - { - png_memcpy(dp, v, pixel_bytes); - dp -= pixel_bytes; - } - sptr-= pixel_bytes; - } - } - } /* end of _mmx_supported ======================================== */ - - else /* MMX not supported: use modified C code - takes advantage - * of inlining of png_memcpy for a constant */ - /* GRR 19991007: does it? or should pixel_bytes in each - * block be replaced with immediate value (e.g., 1)? */ - /* GRR 19991017: replaced with constants in each case */ -#endif /* PNG_ASSEMBLER_CODE_SUPPORTED */ - { - if (pixel_bytes == 1) - { - for (i = width; i; i--) - { - int j; - for (j = 0; j < png_pass_inc[pass]; j++) - { - *dp-- = *sptr; - } - --sptr; - } - } - else if (pixel_bytes == 3) - { - for (i = width; i; i--) - { - png_byte v[8]; - int j; - png_memcpy(v, sptr, 3); - for (j = 0; j < png_pass_inc[pass]; j++) - { - png_memcpy(dp, v, 3); - dp -= 3; - } - sptr -= 3; - } - } - else if (pixel_bytes == 2) - { - for (i = width; i; i--) - { - png_byte v[8]; - int j; - png_memcpy(v, sptr, 2); - for (j = 0; j < png_pass_inc[pass]; j++) - { - png_memcpy(dp, v, 2); - dp -= 2; - } - sptr -= 2; - } - } - else if (pixel_bytes == 4) - { - for (i = width; i; i--) - { - png_byte v[8]; - int j; - png_memcpy(v, sptr, 4); - for (j = 0; j < png_pass_inc[pass]; j++) - { -#ifdef PNG_DEBUG - if (dp < row || dp+3 > row+png_ptr->row_buf_size) - { - printf("dp out of bounds: row=%d, dp=%d, rp=%d\n", - row, dp, row+png_ptr->row_buf_size); - printf("row_buf=%d\n",png_ptr->row_buf_size); - } -#endif - png_memcpy(dp, v, 4); - dp -= 4; - } - sptr -= 4; - } - } - else if (pixel_bytes == 6) - { - for (i = width; i; i--) - { - png_byte v[8]; - int j; - png_memcpy(v, sptr, 6); - for (j = 0; j < png_pass_inc[pass]; j++) - { - png_memcpy(dp, v, 6); - dp -= 6; - } - sptr -= 6; - } - } - else if (pixel_bytes == 8) - { - for (i = width; i; i--) - { - png_byte v[8]; - int j; - png_memcpy(v, sptr, 8); - for (j = 0; j < png_pass_inc[pass]; j++) - { - png_memcpy(dp, v, 8); - dp -= 8; - } - sptr -= 8; - } - } - else /* GRR: should never be reached */ - { - for (i = width; i; i--) - { - png_byte v[8]; - int j; - png_memcpy(v, sptr, pixel_bytes); - for (j = 0; j < png_pass_inc[pass]; j++) - { - png_memcpy(dp, v, pixel_bytes); - dp -= pixel_bytes; - } - sptr -= pixel_bytes; - } - } - - } /* end if (MMX not supported) */ - break; - } - } /* end switch (row_info->pixel_depth) */ - - row_info->width = final_width; - - row_info->rowbytes = PNG_ROWBYTES(row_info->pixel_depth,final_width); - } - -} /* end png_do_read_interlace() */ - -#endif /* PNG_HAVE_ASSEMBLER_READ_INTERLACE */ -#endif /* PNG_READ_INTERLACING_SUPPORTED */ - - - -#if defined(PNG_HAVE_ASSEMBLER_READ_FILTER_ROW) -#if defined(PNG_ASSEMBLER_CODE_SUPPORTED) - -/* These variables are utilized in the functions below. They are declared */ -/* globally here to ensure alignment on 8-byte boundaries. */ - -union uAll { - long long use; - double align; -} _LBCarryMask = {0x0101010101010101LL}, - _HBClearMask = {0x7f7f7f7f7f7f7f7fLL}, - _ActiveMask, _ActiveMask2, _ActiveMaskEnd, _ShiftBpp, _ShiftRem; - -#ifdef PNG_THREAD_UNSAFE_OK -/*===========================================================================*/ -/* */ -/* P N G _ R E A D _ F I L T E R _ R O W _ M M X _ A V G */ -/* */ -/*===========================================================================*/ - -/* Optimized code for PNG Average filter decoder */ - -static void /* PRIVATE */ -png_read_filter_row_mmx_avg(png_row_infop row_info, png_bytep row, - png_bytep prev_row) -{ - int bpp; - int dummy_value_c; /* fix 'forbidden register 2 (cx) was spilled' error */ - int dummy_value_S; - int dummy_value_D; - - bpp = (row_info->pixel_depth + 7) >> 3; /* get # bytes per pixel */ - _FullLength = row_info->rowbytes; /* # of bytes to filter */ - - __asm__ __volatile__ ( - /* initialize address pointers and offset */ -#ifdef __PIC__ - "pushl %%ebx \n\t" /* save index to Global Offset Table */ -#endif -/*pre "movl row, %%edi \n\t" */ /* edi: Avg(x) */ - "xorl %%ebx, %%ebx \n\t" /* ebx: x */ - "movl %%edi, %%edx \n\t" -/*pre "movl prev_row, %%esi \n\t" */ /* esi: Prior(x) */ -/*pre "subl bpp, %%edx \n\t" */ /* (bpp is preloaded into ecx) */ - "subl %%ecx, %%edx \n\t" /* edx: Raw(x-bpp) */ - - "xorl %%eax,%%eax \n\t" - - /* Compute the Raw value for the first bpp bytes */ - /* Raw(x) = Avg(x) + (Prior(x)/2) */ - "avg_rlp: \n\t" - "movb (%%esi,%%ebx,),%%al \n\t" /* load al with Prior(x) */ - "incl %%ebx \n\t" - "shrb %%al \n\t" /* divide by 2 */ - "addb -1(%%edi,%%ebx,),%%al \n\t" /* add Avg(x); -1 to offset inc ebx */ -/* pre "cmpl bpp, %%ebx \n\t" */ /* (bpp is preloaded into ecx) */ - "cmpl %%ecx, %%ebx \n\t" - "movb %%al,-1(%%edi,%%ebx,) \n\t" /* write Raw(x); -1 to offset inc ebx */ - "jb avg_rlp \n\t" /* mov does not affect flags */ - - /* get # of bytes to alignment */ - "movl %%edi, _dif \n\t" /* take start of row */ - "addl %%ebx, _dif \n\t" /* add bpp */ - "addl $0xf, _dif \n\t" /* add 7+8 to incr past alignment bdry */ - "andl $0xfffffff8, _dif \n\t" /* mask to alignment boundary */ - "subl %%edi, _dif \n\t" /* subtract from start => value ebx at */ - "jz avg_go \n\t" /* alignment */ - - /* fix alignment */ - /* Compute the Raw value for the bytes up to the alignment boundary */ - /* Raw(x) = Avg(x) + ((Raw(x-bpp) + Prior(x))/2) */ - "xorl %%ecx, %%ecx \n\t" - - "avg_lp1: \n\t" - "xorl %%eax, %%eax \n\t" - "movb (%%esi,%%ebx,), %%cl \n\t" /* load cl with Prior(x) */ - "movb (%%edx,%%ebx,), %%al \n\t" /* load al with Raw(x-bpp) */ - "addw %%cx, %%ax \n\t" - "incl %%ebx \n\t" - "shrw %%ax \n\t" /* divide by 2 */ - "addb -1(%%edi,%%ebx,), %%al \n\t" /* add Avg(x); -1 to offset inc ebx */ - "cmpl _dif, %%ebx \n\t" /* check if at alignment boundary */ - "movb %%al, -1(%%edi,%%ebx,) \n\t" /* write Raw(x); -1 to offset inc ebx */ - "jb avg_lp1 \n\t" /* repeat until at alignment boundary */ - - "avg_go: \n\t" - "movl _FullLength, %%eax \n\t" - "movl %%eax, %%ecx \n\t" - "subl %%ebx, %%eax \n\t" /* subtract alignment fix */ - "andl $0x00000007, %%eax \n\t" /* calc bytes over mult of 8 */ - "subl %%eax, %%ecx \n\t" /* drop over bytes from original length */ - "movl %%ecx, _MMXLength \n\t" -#ifdef __PIC__ - "popl %%ebx \n\t" /* restore index to Global Offset Table */ -#endif - - : "=c" (dummy_value_c), /* output regs (dummy) */ - "=S" (dummy_value_S), - "=D" (dummy_value_D) - - : "0" (bpp), /* ecx // input regs */ - "1" (prev_row), /* esi */ - "2" (row) /* edi */ - - : "%eax", "%edx" /* clobber list */ -#ifndef __PIC__ - , "%ebx" -#endif - /* GRR: INCLUDE "memory" as clobbered? (_dif, _MMXLength) */ - /* (seems to work fine without...) */ - ); - - /* now do the math for the rest of the row */ - switch (bpp) - { - case 3: - { - _ActiveMask.use = 0x0000000000ffffffLL; - _ShiftBpp.use = 24; /* == 3 * 8 */ - _ShiftRem.use = 40; /* == 64 - 24 */ - - __asm__ __volatile__ ( - /* re-init address pointers and offset */ - "movq _ActiveMask, %%mm7 \n\t" - "movl _dif, %%ecx \n\t" /* ecx: x = offset to */ - "movq _LBCarryMask, %%mm5 \n\t" /* alignment boundary */ -/* preload "movl row, %%edi \n\t" // edi: Avg(x) */ - "movq _HBClearMask, %%mm4 \n\t" -/* preload "movl prev_row, %%esi \n\t" // esi: Prior(x) */ - - /* prime the pump: load the first Raw(x-bpp) data set */ - "movq -8(%%edi,%%ecx,), %%mm2 \n\t" /* load previous aligned 8 bytes */ - /* (correct pos. in loop below) */ - "avg_3lp: \n\t" - "movq (%%edi,%%ecx,), %%mm0 \n\t" /* load mm0 with Avg(x) */ - "movq %%mm5, %%mm3 \n\t" - "psrlq _ShiftRem, %%mm2 \n\t" /* correct position Raw(x-bpp) */ - /* data */ - "movq (%%esi,%%ecx,), %%mm1 \n\t" /* load mm1 with Prior(x) */ - "movq %%mm7, %%mm6 \n\t" - "pand %%mm1, %%mm3 \n\t" /* get lsb for each prev_row byte */ - "psrlq $1, %%mm1 \n\t" /* divide prev_row bytes by 2 */ - "pand %%mm4, %%mm1 \n\t" /* clear invalid bit 7 of each */ - /* byte */ - "paddb %%mm1, %%mm0 \n\t" /* add (Prev_row/2) to Avg for */ - /* each byte */ - /* add 1st active group (Raw(x-bpp)/2) to average with LBCarry */ - "movq %%mm3, %%mm1 \n\t" /* now use mm1 for getting */ - /* LBCarrys */ - "pand %%mm2, %%mm1 \n\t" /* get LBCarrys for each byte */ - /* where both */ - /* lsb's were == 1 (only valid for active group) */ - "psrlq $1, %%mm2 \n\t" /* divide raw bytes by 2 */ - "pand %%mm4, %%mm2 \n\t" /* clear invalid bit 7 of each */ - /* byte */ - "paddb %%mm1, %%mm2 \n\t" /* add LBCarrys to (Raw(x-bpp)/2) */ - /* for each byte */ - "pand %%mm6, %%mm2 \n\t" /* leave only Active Group 1 */ - /* bytes to add to Avg */ - "paddb %%mm2, %%mm0 \n\t" /* add (Raw/2) + LBCarrys to */ - /* Avg for each Active */ - /* byte */ - /* add 2nd active group (Raw(x-bpp)/2) to average with _LBCarry */ - "psllq _ShiftBpp, %%mm6 \n\t" /* shift the mm6 mask to cover */ - /* bytes 3-5 */ - "movq %%mm0, %%mm2 \n\t" /* mov updated Raws to mm2 */ - "psllq _ShiftBpp, %%mm2 \n\t" /* shift data to pos. correctly */ - "movq %%mm3, %%mm1 \n\t" /* now use mm1 for getting */ - /* LBCarrys */ - "pand %%mm2, %%mm1 \n\t" /* get LBCarrys for each byte */ - /* where both */ - /* lsb's were == 1 (only valid for active group) */ - "psrlq $1, %%mm2 \n\t" /* divide raw bytes by 2 */ - "pand %%mm4, %%mm2 \n\t" /* clear invalid bit 7 of each */ - /* byte */ - "paddb %%mm1, %%mm2 \n\t" /* add LBCarrys to (Raw(x-bpp)/2) */ - /* for each byte */ - "pand %%mm6, %%mm2 \n\t" /* leave only Active Group 2 */ - /* bytes to add to Avg */ - "paddb %%mm2, %%mm0 \n\t" /* add (Raw/2) + LBCarrys to */ - /* Avg for each Active */ - /* byte */ - - /* add 3rd active group (Raw(x-bpp)/2) to average with _LBCarry */ - "psllq _ShiftBpp, %%mm6 \n\t" /* shift mm6 mask to cover last */ - /* two */ - /* bytes */ - "movq %%mm0, %%mm2 \n\t" /* mov updated Raws to mm2 */ - "psllq _ShiftBpp, %%mm2 \n\t" /* shift data to pos. correctly */ - /* Data only needs to be shifted once here to */ - /* get the correct x-bpp offset. */ - "movq %%mm3, %%mm1 \n\t" /* now use mm1 for getting */ - /* LBCarrys */ - "pand %%mm2, %%mm1 \n\t" /* get LBCarrys for each byte */ - /* where both */ - /* lsb's were == 1 (only valid for active group) */ - "psrlq $1, %%mm2 \n\t" /* divide raw bytes by 2 */ - "pand %%mm4, %%mm2 \n\t" /* clear invalid bit 7 of each */ - /* byte */ - "paddb %%mm1, %%mm2 \n\t" /* add LBCarrys to (Raw(x-bpp)/2) */ - /* for each byte */ - "pand %%mm6, %%mm2 \n\t" /* leave only Active Group 2 */ - /* bytes to add to Avg */ - "addl $8, %%ecx \n\t" - "paddb %%mm2, %%mm0 \n\t" /* add (Raw/2) + LBCarrys to */ - /* Avg for each Active */ - /* byte */ - /* now ready to write back to memory */ - "movq %%mm0, -8(%%edi,%%ecx,) \n\t" - /* move updated Raw(x) to use as Raw(x-bpp) for next loop */ - "cmpl _MMXLength, %%ecx \n\t" - "movq %%mm0, %%mm2 \n\t" /* mov updated Raw(x) to mm2 */ - "jb avg_3lp \n\t" - - : "=S" (dummy_value_S), /* output regs (dummy) */ - "=D" (dummy_value_D) - - : "0" (prev_row), /* esi // input regs */ - "1" (row) /* edi */ - - : "%ecx" /* clobber list */ -#if 0 /* %mm0, ..., %mm7 not supported by gcc 2.7.2.3 or egcs 1.1 */ - , "%mm0", "%mm1", "%mm2", "%mm3" - , "%mm4", "%mm5", "%mm6", "%mm7" -#endif - ); - } - break; /* end 3 bpp */ - - case 6: - case 4: - //case 7: /* who wrote this? PNG doesn't support 5 or 7 bytes/pixel */ - //case 5: /* GRR BOGUS */ - { - _ActiveMask.use = 0xffffffffffffffffLL; /* use shift below to clear */ - /* appropriate inactive bytes */ - _ShiftBpp.use = bpp << 3; - _ShiftRem.use = 64 - _ShiftBpp.use; - - __asm__ __volatile__ ( - "movq _HBClearMask, %%mm4 \n\t" - - /* re-init address pointers and offset */ - "movl _dif, %%ecx \n\t" /* ecx: x = offset to */ - /* alignment boundary */ - - /* load _ActiveMask and clear all bytes except for 1st active group */ - "movq _ActiveMask, %%mm7 \n\t" -/* preload "movl row, %%edi \n\t" // edi: Avg(x) */ - "psrlq _ShiftRem, %%mm7 \n\t" -/* preload "movl prev_row, %%esi \n\t" // esi: Prior(x) */ - "movq %%mm7, %%mm6 \n\t" - "movq _LBCarryMask, %%mm5 \n\t" - "psllq _ShiftBpp, %%mm6 \n\t" /* create mask for 2nd active */ - /* group */ - - /* prime the pump: load the first Raw(x-bpp) data set */ - "movq -8(%%edi,%%ecx,), %%mm2 \n\t" /* load previous aligned 8 bytes */ - /* (we correct pos. in loop below) */ - "avg_4lp: \n\t" - "movq (%%edi,%%ecx,), %%mm0 \n\t" - "psrlq _ShiftRem, %%mm2 \n\t" /* shift data to pos. correctly */ - "movq (%%esi,%%ecx,), %%mm1 \n\t" - /* add (Prev_row/2) to average */ - "movq %%mm5, %%mm3 \n\t" - "pand %%mm1, %%mm3 \n\t" /* get lsb for each prev_row byte */ - "psrlq $1, %%mm1 \n\t" /* divide prev_row bytes by 2 */ - "pand %%mm4, %%mm1 \n\t" /* clear invalid bit 7 of each */ - /* byte */ - "paddb %%mm1, %%mm0 \n\t" /* add (Prev_row/2) to Avg for */ - /* each byte */ - /* add 1st active group (Raw(x-bpp)/2) to average with _LBCarry */ - "movq %%mm3, %%mm1 \n\t" /* now use mm1 for getting */ - /* LBCarrys */ - "pand %%mm2, %%mm1 \n\t" /* get LBCarrys for each byte */ - /* where both */ - /* lsb's were == 1 (only valid for active group) */ - "psrlq $1, %%mm2 \n\t" /* divide raw bytes by 2 */ - "pand %%mm4, %%mm2 \n\t" /* clear invalid bit 7 of each */ - /* byte */ - "paddb %%mm1, %%mm2 \n\t" /* add LBCarrys to (Raw(x-bpp)/2) */ - /* for each byte */ - "pand %%mm7, %%mm2 \n\t" /* leave only Active Group 1 */ - /* bytes to add to Avg */ - "paddb %%mm2, %%mm0 \n\t" /* add (Raw/2) + LBCarrys to Avg */ - /* for each Active */ - /* byte */ - /* add 2nd active group (Raw(x-bpp)/2) to average with _LBCarry */ - "movq %%mm0, %%mm2 \n\t" /* mov updated Raws to mm2 */ - "psllq _ShiftBpp, %%mm2 \n\t" /* shift data to pos. correctly */ - "addl $8, %%ecx \n\t" - "movq %%mm3, %%mm1 \n\t" /* now use mm1 for getting */ - /* LBCarrys */ - "pand %%mm2, %%mm1 \n\t" /* get LBCarrys for each byte */ - /* where both */ - /* lsb's were == 1 (only valid for active group) */ - "psrlq $1, %%mm2 \n\t" /* divide raw bytes by 2 */ - "pand %%mm4, %%mm2 \n\t" /* clear invalid bit 7 of each */ - /* byte */ - "paddb %%mm1, %%mm2 \n\t" /* add LBCarrys to (Raw(x-bpp)/2) */ - /* for each byte */ - "pand %%mm6, %%mm2 \n\t" /* leave only Active Group 2 */ - /* bytes to add to Avg */ - "paddb %%mm2, %%mm0 \n\t" /* add (Raw/2) + LBCarrys to */ - /* Avg for each Active */ - /* byte */ - "cmpl _MMXLength, %%ecx \n\t" - /* now ready to write back to memory */ - "movq %%mm0, -8(%%edi,%%ecx,) \n\t" - /* prep Raw(x-bpp) for next loop */ - "movq %%mm0, %%mm2 \n\t" /* mov updated Raws to mm2 */ - "jb avg_4lp \n\t" - - : "=S" (dummy_value_S), /* output regs (dummy) */ - "=D" (dummy_value_D) - - : "0" (prev_row), /* esi // input regs */ - "1" (row) /* edi */ - - : "%ecx" /* clobber list */ -#if 0 /* %mm0, ..., %mm7 not supported by gcc 2.7.2.3 or egcs 1.1 */ - , "%mm0", "%mm1", "%mm2", "%mm3" - , "%mm4", "%mm5", "%mm6", "%mm7" -#endif - ); - } - break; /* end 4,6 bpp */ - - case 2: - { - _ActiveMask.use = 0x000000000000ffffLL; - _ShiftBpp.use = 16; /* == 2 * 8 */ - _ShiftRem.use = 48; /* == 64 - 16 */ - - __asm__ __volatile__ ( - /* load _ActiveMask */ - "movq _ActiveMask, %%mm7 \n\t" - /* re-init address pointers and offset */ - "movl _dif, %%ecx \n\t" /* ecx: x = offset to alignment */ - /* boundary */ - "movq _LBCarryMask, %%mm5 \n\t" -/* preload "movl row, %%edi \n\t" // edi: Avg(x) */ - "movq _HBClearMask, %%mm4 \n\t" -/* preload "movl prev_row, %%esi \n\t" // esi: Prior(x) */ - - /* prime the pump: load the first Raw(x-bpp) data set */ - "movq -8(%%edi,%%ecx,), %%mm2 \n\t" /* load previous aligned 8 bytes */ - /* (we correct pos. in loop below) */ - "avg_2lp: \n\t" - "movq (%%edi,%%ecx,), %%mm0 \n\t" - "psrlq _ShiftRem, %%mm2 \n\t" /* shift data to pos. correctly */ - "movq (%%esi,%%ecx,), %%mm1 \n\t" /* (GRR BUGFIX: was psllq) */ - /* add (Prev_row/2) to average */ - "movq %%mm5, %%mm3 \n\t" - "pand %%mm1, %%mm3 \n\t" /* get lsb for each prev_row byte */ - "psrlq $1, %%mm1 \n\t" /* divide prev_row bytes by 2 */ - "pand %%mm4, %%mm1 \n\t" /* clear invalid bit 7 of each */ - /* byte */ - "movq %%mm7, %%mm6 \n\t" - "paddb %%mm1, %%mm0 \n\t" /* add (Prev_row/2) to Avg for */ - /* each byte */ - - /* add 1st active group (Raw(x-bpp)/2) to average with _LBCarry */ - "movq %%mm3, %%mm1 \n\t" /* now use mm1 for getting */ - /* LBCarrys */ - "pand %%mm2, %%mm1 \n\t" /* get LBCarrys for each byte */ - /* where both */ - /* lsb's were == 1 (only valid */ - /* for active group) */ - "psrlq $1, %%mm2 \n\t" /* divide raw bytes by 2 */ - "pand %%mm4, %%mm2 \n\t" /* clear invalid bit 7 of each */ - /* byte */ - "paddb %%mm1, %%mm2 \n\t" /* add LBCarrys to (Raw(x-bpp)/2) */ - /* for each byte */ - "pand %%mm6, %%mm2 \n\t" /* leave only Active Group 1 */ - /* bytes to add to Avg */ - "paddb %%mm2, %%mm0 \n\t" /* add (Raw/2) + LBCarrys to Avg */ - /* for each Active byte */ - - /* add 2nd active group (Raw(x-bpp)/2) to average with _LBCarry */ - "psllq _ShiftBpp, %%mm6 \n\t" /* shift the mm6 mask to cover */ - /* bytes 2 & 3 */ - "movq %%mm0, %%mm2 \n\t" /* mov updated Raws to mm2 */ - "psllq _ShiftBpp, %%mm2 \n\t" /* shift data to pos. correctly */ - "movq %%mm3, %%mm1 \n\t" /* now use mm1 for getting */ - /* LBCarrys */ - "pand %%mm2, %%mm1 \n\t" /* get LBCarrys for each byte */ - /* where both */ - /* lsb's were == 1 (only valid */ - /* for active group) */ - "psrlq $1, %%mm2 \n\t" /* divide raw bytes by 2 */ - "pand %%mm4, %%mm2 \n\t" /* clear invalid bit 7 of each */ - /* byte */ - "paddb %%mm1, %%mm2 \n\t" /* add LBCarrys to (Raw(x-bpp)/2) */ - /* for each byte */ - "pand %%mm6, %%mm2 \n\t" /* leave only Active Group 2 */ - /* bytes to add to Avg */ - "paddb %%mm2, %%mm0 \n\t" /* add (Raw/2) + LBCarrys to */ - /* Avg for each Active byte */ - - /* add 3rd active group (Raw(x-bpp)/2) to average with _LBCarry */ - "psllq _ShiftBpp, %%mm6 \n\t" /* shift the mm6 mask to cover */ - /* bytes 4 & 5 */ - "movq %%mm0, %%mm2 \n\t" /* mov updated Raws to mm2 */ - "psllq _ShiftBpp, %%mm2 \n\t" /* shift data to pos. correctly */ - "movq %%mm3, %%mm1 \n\t" /* now use mm1 for getting */ - /* LBCarrys */ - "pand %%mm2, %%mm1 \n\t" /* get LBCarrys for each byte */ - /* where both lsb's were == 1 */ - /* (only valid for active group) */ - "psrlq $1, %%mm2 \n\t" /* divide raw bytes by 2 */ - "pand %%mm4, %%mm2 \n\t" /* clear invalid bit 7 of each */ - /* byte */ - "paddb %%mm1, %%mm2 \n\t" /* add LBCarrys to (Raw(x-bpp)/2) */ - /* for each byte */ - "pand %%mm6, %%mm2 \n\t" /* leave only Active Group 2 */ - /* bytes to add to Avg */ - "paddb %%mm2, %%mm0 \n\t" /* add (Raw/2) + LBCarrys to */ - /* Avg for each Active byte */ - - /* add 4th active group (Raw(x-bpp)/2) to average with _LBCarry */ - "psllq _ShiftBpp, %%mm6 \n\t" /* shift the mm6 mask to cover */ - /* bytes 6 & 7 */ - "movq %%mm0, %%mm2 \n\t" /* mov updated Raws to mm2 */ - "psllq _ShiftBpp, %%mm2 \n\t" /* shift data to pos. correctly */ - "addl $8, %%ecx \n\t" - "movq %%mm3, %%mm1 \n\t" /* now use mm1 for getting */ - /* LBCarrys */ - "pand %%mm2, %%mm1 \n\t" /* get LBCarrys for each byte */ - /* where both */ - /* lsb's were == 1 (only valid */ - /* for active group) */ - "psrlq $1, %%mm2 \n\t" /* divide raw bytes by 2 */ - "pand %%mm4, %%mm2 \n\t" /* clear invalid bit 7 of each */ - /* byte */ - "paddb %%mm1, %%mm2 \n\t" /* add LBCarrys to (Raw(x-bpp)/2) */ - /* for each byte */ - "pand %%mm6, %%mm2 \n\t" /* leave only Active Group 2 */ - /* bytes to add to Avg */ - "paddb %%mm2, %%mm0 \n\t" /* add (Raw/2) + LBCarrys to */ - /* Avg for each Active byte */ - - "cmpl _MMXLength, %%ecx \n\t" - /* now ready to write back to memory */ - "movq %%mm0, -8(%%edi,%%ecx,) \n\t" - /* prep Raw(x-bpp) for next loop */ - "movq %%mm0, %%mm2 \n\t" /* mov updated Raws to mm2 */ - "jb avg_2lp \n\t" - - : "=S" (dummy_value_S), /* output regs (dummy) */ - "=D" (dummy_value_D) - - : "0" (prev_row), /* esi // input regs */ - "1" (row) /* edi */ - - : "%ecx" /* clobber list */ -#if 0 /* %mm0, ..., %mm7 not supported by gcc 2.7.2.3 or egcs 1.1 */ - , "%mm0", "%mm1", "%mm2", "%mm3" - , "%mm4", "%mm5", "%mm6", "%mm7" -#endif - ); - } - break; /* end 2 bpp */ - - case 1: - { - __asm__ __volatile__ ( - /* re-init address pointers and offset */ -#ifdef __PIC__ - "pushl %%ebx \n\t" /* save Global Offset Table index */ -#endif - "movl _dif, %%ebx \n\t" /* ebx: x = offset to alignment */ - /* boundary */ -/* preload "movl row, %%edi \n\t" // edi: Avg(x) */ - "cmpl _FullLength, %%ebx \n\t" /* test if offset at end of array */ - "jnb avg_1end \n\t" - /* do Paeth decode for remaining bytes */ -/* preload "movl prev_row, %%esi \n\t" // esi: Prior(x) */ - "movl %%edi, %%edx \n\t" -/* preload "subl bpp, %%edx \n\t" // (bpp is preloaded into ecx) */ - "subl %%ecx, %%edx \n\t" /* edx: Raw(x-bpp) */ - "xorl %%ecx, %%ecx \n\t" /* zero ecx before using cl & cx */ - /* in loop below */ - "avg_1lp: \n\t" - /* Raw(x) = Avg(x) + ((Raw(x-bpp) + Prior(x))/2) */ - "xorl %%eax, %%eax \n\t" - "movb (%%esi,%%ebx,), %%cl \n\t" /* load cl with Prior(x) */ - "movb (%%edx,%%ebx,), %%al \n\t" /* load al with Raw(x-bpp) */ - "addw %%cx, %%ax \n\t" - "incl %%ebx \n\t" - "shrw %%ax \n\t" /* divide by 2 */ - "addb -1(%%edi,%%ebx,), %%al \n\t" /* add Avg(x); -1 to offset */ - /* inc ebx */ - "cmpl _FullLength, %%ebx \n\t" /* check if at end of array */ - "movb %%al, -1(%%edi,%%ebx,) \n\t" /* write back Raw(x); */ - /* mov does not affect flags; -1 to offset inc ebx */ - "jb avg_1lp \n\t" - - "avg_1end: \n\t" -#ifdef __PIC__ - "popl %%ebx \n\t" /* Global Offset Table index */ -#endif - - : "=c" (dummy_value_c), /* output regs (dummy) */ - "=S" (dummy_value_S), - "=D" (dummy_value_D) - - : "0" (bpp), /* ecx // input regs */ - "1" (prev_row), /* esi */ - "2" (row) /* edi */ - - : "%eax", "%edx" /* clobber list */ -#ifndef __PIC__ - , "%ebx" -#endif - ); - } - return; /* end 1 bpp */ - - case 8: - { - __asm__ __volatile__ ( - /* re-init address pointers and offset */ - "movl _dif, %%ecx \n\t" /* ecx: x == offset to alignment */ - "movq _LBCarryMask, %%mm5 \n\t" /* boundary */ -/* preload "movl row, %%edi \n\t" // edi: Avg(x) */ - "movq _HBClearMask, %%mm4 \n\t" -/* preload "movl prev_row, %%esi \n\t" // esi: Prior(x) */ - - /* prime the pump: load the first Raw(x-bpp) data set */ - "movq -8(%%edi,%%ecx,), %%mm2 \n\t" /* load previous aligned 8 bytes */ - /* (NO NEED to correct pos. in loop below) */ - - "avg_8lp: \n\t" - "movq (%%edi,%%ecx,), %%mm0 \n\t" - "movq %%mm5, %%mm3 \n\t" - "movq (%%esi,%%ecx,), %%mm1 \n\t" - "addl $8, %%ecx \n\t" - "pand %%mm1, %%mm3 \n\t" /* get lsb for each prev_row byte */ - "psrlq $1, %%mm1 \n\t" /* divide prev_row bytes by 2 */ - "pand %%mm2, %%mm3 \n\t" /* get LBCarrys for each byte */ - /* where both lsb's were == 1 */ - "psrlq $1, %%mm2 \n\t" /* divide raw bytes by 2 */ - "pand %%mm4, %%mm1 \n\t" /* clear invalid bit 7, each byte */ - "paddb %%mm3, %%mm0 \n\t" /* add LBCarrys to Avg, each byte */ - "pand %%mm4, %%mm2 \n\t" /* clear invalid bit 7, each byte */ - "paddb %%mm1, %%mm0 \n\t" /* add (Prev_row/2) to Avg, each */ - "paddb %%mm2, %%mm0 \n\t" /* add (Raw/2) to Avg for each */ - "cmpl _MMXLength, %%ecx \n\t" - "movq %%mm0, -8(%%edi,%%ecx,) \n\t" - "movq %%mm0, %%mm2 \n\t" /* reuse as Raw(x-bpp) */ - "jb avg_8lp \n\t" - - : "=S" (dummy_value_S), /* output regs (dummy) */ - "=D" (dummy_value_D) - - : "0" (prev_row), /* esi // input regs */ - "1" (row) /* edi */ - - : "%ecx" /* clobber list */ -#if 0 /* %mm0, ..., %mm5 not supported by gcc 2.7.2.3 or egcs 1.1 */ - , "%mm0", "%mm1", "%mm2" - , "%mm3", "%mm4", "%mm5" -#endif - ); - } - break; /* end 8 bpp */ - - default: /* bpp greater than 8 (!= 1,2,3,4,[5],6,[7],8) */ - { - -#ifdef PNG_DEBUG - /* GRR: PRINT ERROR HERE: SHOULD NEVER BE REACHED */ - png_debug(1, - "Internal logic error in pnggccrd (png_read_filter_row_mmx_avg())\n"); -#endif - -#if 0 - __asm__ __volatile__ ( - "movq _LBCarryMask, %%mm5 \n\t" - /* re-init address pointers and offset */ - "movl _dif, %%ebx \n\t" /* ebx: x = offset to */ - /* alignment boundary */ - "movl row, %%edi \n\t" /* edi: Avg(x) */ - "movq _HBClearMask, %%mm4 \n\t" - "movl %%edi, %%edx \n\t" - "movl prev_row, %%esi \n\t" /* esi: Prior(x) */ - "subl bpp, %%edx \n\t" /* edx: Raw(x-bpp) */ - "avg_Alp: \n\t" - "movq (%%edi,%%ebx,), %%mm0 \n\t" - "movq %%mm5, %%mm3 \n\t" - "movq (%%esi,%%ebx,), %%mm1 \n\t" - "pand %%mm1, %%mm3 \n\t" /* get lsb for each prev_row byte */ - "movq (%%edx,%%ebx,), %%mm2 \n\t" - "psrlq $1, %%mm1 \n\t" /* divide prev_row bytes by 2 */ - "pand %%mm2, %%mm3 \n\t" /* get LBCarrys for each byte */ - /* where both lsb's were == 1 */ - "psrlq $1, %%mm2 \n\t" /* divide raw bytes by 2 */ - "pand %%mm4, %%mm1 \n\t" /* clear invalid bit 7 of each */ - /* byte */ - "paddb %%mm3, %%mm0 \n\t" /* add LBCarrys to Avg for each */ - /* byte */ - "pand %%mm4, %%mm2 \n\t" /* clear invalid bit 7 of each */ - /* byte */ - "paddb %%mm1, %%mm0 \n\t" /* add (Prev_row/2) to Avg for */ - /* each byte */ - "addl $8, %%ebx \n\t" - "paddb %%mm2, %%mm0 \n\t" /* add (Raw/2) to Avg for each */ - /* byte */ - "cmpl _MMXLength, %%ebx \n\t" - "movq %%mm0, -8(%%edi,%%ebx,) \n\t" - "jb avg_Alp \n\t" - - : /* FIXASM: output regs/vars go here, e.g.: "=m" (memory_var) */ - - : /* FIXASM: input regs, e.g.: "c" (count), "S" (src), "D" (dest) */ - - : "%ebx", "%edx", "%edi", "%esi" /* CHECKASM: clobber list */ - ); -#endif /* 0 - NEVER REACHED */ - } - break; - - } /* end switch (bpp) */ - - __asm__ __volatile__ ( - /* MMX acceleration complete; now do clean-up */ - /* check if any remaining bytes left to decode */ -#ifdef __PIC__ - "pushl %%ebx \n\t" /* save index to Global Offset Table */ -#endif - "movl _MMXLength, %%ebx \n\t" /* ebx: x == offset bytes after MMX */ -/* pre "movl row, %%edi \n\t" */ /* edi: Avg(x) */ - "cmpl _FullLength, %%ebx \n\t" /* test if offset at end of array */ - "jnb avg_end \n\t" - - /* do Avg decode for remaining bytes */ -/*pre "movl prev_row, %%esi \n\t" */ /* esi: Prior(x) */ - "movl %%edi, %%edx \n\t" -/*pre "subl bpp, %%edx \n\t" */ /* (bpp is preloaded into ecx) */ - "subl %%ecx, %%edx \n\t" /* edx: Raw(x-bpp) */ - "xorl %%ecx, %%ecx \n\t" /* zero ecx before using cl & cx below */ - - "avg_lp2: \n\t" - /* Raw(x) = Avg(x) + ((Raw(x-bpp) + Prior(x))/2) */ - "xorl %%eax, %%eax \n\t" - "movb (%%esi,%%ebx,), %%cl \n\t" /* load cl with Prior(x) */ - "movb (%%edx,%%ebx,), %%al \n\t" /* load al with Raw(x-bpp) */ - "addw %%cx, %%ax \n\t" - "incl %%ebx \n\t" - "shrw %%ax \n\t" /* divide by 2 */ - "addb -1(%%edi,%%ebx,), %%al \n\t" /* add Avg(x); -1 to offset inc ebx */ - "cmpl _FullLength, %%ebx \n\t" /* check if at end of array */ - "movb %%al, -1(%%edi,%%ebx,) \n\t" /* write back Raw(x) [mov does not */ - "jb avg_lp2 \n\t" /* affect flags; -1 to offset inc ebx] */ - - "avg_end: \n\t" - "EMMS \n\t" /* end MMX; prep for poss. FP instrs. */ -#ifdef __PIC__ - "popl %%ebx \n\t" /* restore index to Global Offset Table */ -#endif - - : "=c" (dummy_value_c), /* output regs (dummy) */ - "=S" (dummy_value_S), - "=D" (dummy_value_D) - - : "0" (bpp), /* ecx // input regs */ - "1" (prev_row), /* esi */ - "2" (row) /* edi */ - - : "%eax", "%edx" /* clobber list */ -#ifndef __PIC__ - , "%ebx" -#endif - ); - -} /* end png_read_filter_row_mmx_avg() */ -#endif - - - -#ifdef PNG_THREAD_UNSAFE_OK -/*===========================================================================*/ -/* */ -/* P N G _ R E A D _ F I L T E R _ R O W _ M M X _ P A E T H */ -/* */ -/*===========================================================================*/ - -/* Optimized code for PNG Paeth filter decoder */ - -static void /* PRIVATE */ -png_read_filter_row_mmx_paeth(png_row_infop row_info, png_bytep row, - png_bytep prev_row) -{ - int bpp; - int dummy_value_c; /* fix 'forbidden register 2 (cx) was spilled' error */ - int dummy_value_S; - int dummy_value_D; - - bpp = (row_info->pixel_depth + 7) >> 3; /* Get # bytes per pixel */ - _FullLength = row_info->rowbytes; /* # of bytes to filter */ - - __asm__ __volatile__ ( -#ifdef __PIC__ - "pushl %%ebx \n\t" /* save index to Global Offset Table */ -#endif - "xorl %%ebx, %%ebx \n\t" /* ebx: x offset */ -/*pre "movl row, %%edi \n\t" */ - "xorl %%edx, %%edx \n\t" /* edx: x-bpp offset */ -/*pre "movl prev_row, %%esi \n\t" */ - "xorl %%eax, %%eax \n\t" - - /* Compute the Raw value for the first bpp bytes */ - /* Note: the formula works out to be always */ - /* Paeth(x) = Raw(x) + Prior(x) where x < bpp */ - "paeth_rlp: \n\t" - "movb (%%edi,%%ebx,), %%al \n\t" - "addb (%%esi,%%ebx,), %%al \n\t" - "incl %%ebx \n\t" -/*pre "cmpl bpp, %%ebx \n\t" (bpp is preloaded into ecx) */ - "cmpl %%ecx, %%ebx \n\t" - "movb %%al, -1(%%edi,%%ebx,) \n\t" - "jb paeth_rlp \n\t" - /* get # of bytes to alignment */ - "movl %%edi, _dif \n\t" /* take start of row */ - "addl %%ebx, _dif \n\t" /* add bpp */ - "xorl %%ecx, %%ecx \n\t" - "addl $0xf, _dif \n\t" /* add 7 + 8 to incr past alignment */ - /* boundary */ - "andl $0xfffffff8, _dif \n\t" /* mask to alignment boundary */ - "subl %%edi, _dif \n\t" /* subtract from start ==> value ebx */ - /* at alignment */ - "jz paeth_go \n\t" - /* fix alignment */ - - "paeth_lp1: \n\t" - "xorl %%eax, %%eax \n\t" - /* pav = p - a = (a + b - c) - a = b - c */ - "movb (%%esi,%%ebx,), %%al \n\t" /* load Prior(x) into al */ - "movb (%%esi,%%edx,), %%cl \n\t" /* load Prior(x-bpp) into cl */ - "subl %%ecx, %%eax \n\t" /* subtract Prior(x-bpp) */ - "movl %%eax, _patemp \n\t" /* Save pav for later use */ - "xorl %%eax, %%eax \n\t" - /* pbv = p - b = (a + b - c) - b = a - c */ - "movb (%%edi,%%edx,), %%al \n\t" /* load Raw(x-bpp) into al */ - "subl %%ecx, %%eax \n\t" /* subtract Prior(x-bpp) */ - "movl %%eax, %%ecx \n\t" - /* pcv = p - c = (a + b - c) -c = (a - c) + (b - c) = pav + pbv */ - "addl _patemp, %%eax \n\t" /* pcv = pav + pbv */ - /* pc = abs(pcv) */ - "testl $0x80000000, %%eax \n\t" - "jz paeth_pca \n\t" - "negl %%eax \n\t" /* reverse sign of neg values */ - - "paeth_pca: \n\t" - "movl %%eax, _pctemp \n\t" /* save pc for later use */ - /* pb = abs(pbv) */ - "testl $0x80000000, %%ecx \n\t" - "jz paeth_pba \n\t" - "negl %%ecx \n\t" /* reverse sign of neg values */ - - "paeth_pba: \n\t" - "movl %%ecx, _pbtemp \n\t" /* save pb for later use */ - /* pa = abs(pav) */ - "movl _patemp, %%eax \n\t" - "testl $0x80000000, %%eax \n\t" - "jz paeth_paa \n\t" - "negl %%eax \n\t" /* reverse sign of neg values */ - - "paeth_paa: \n\t" - "movl %%eax, _patemp \n\t" /* save pa for later use */ - /* test if pa <= pb */ - "cmpl %%ecx, %%eax \n\t" - "jna paeth_abb \n\t" - /* pa > pb; now test if pb <= pc */ - "cmpl _pctemp, %%ecx \n\t" - "jna paeth_bbc \n\t" - /* pb > pc; Raw(x) = Paeth(x) + Prior(x-bpp) */ - "movb (%%esi,%%edx,), %%cl \n\t" /* load Prior(x-bpp) into cl */ - "jmp paeth_paeth \n\t" - - "paeth_bbc: \n\t" - /* pb <= pc; Raw(x) = Paeth(x) + Prior(x) */ - "movb (%%esi,%%ebx,), %%cl \n\t" /* load Prior(x) into cl */ - "jmp paeth_paeth \n\t" - - "paeth_abb: \n\t" - /* pa <= pb; now test if pa <= pc */ - "cmpl _pctemp, %%eax \n\t" - "jna paeth_abc \n\t" - /* pa > pc; Raw(x) = Paeth(x) + Prior(x-bpp) */ - "movb (%%esi,%%edx,), %%cl \n\t" /* load Prior(x-bpp) into cl */ - "jmp paeth_paeth \n\t" - - "paeth_abc: \n\t" - /* pa <= pc; Raw(x) = Paeth(x) + Raw(x-bpp) */ - "movb (%%edi,%%edx,), %%cl \n\t" /* load Raw(x-bpp) into cl */ - - "paeth_paeth: \n\t" - "incl %%ebx \n\t" - "incl %%edx \n\t" - /* Raw(x) = (Paeth(x) + Paeth_Predictor( a, b, c )) mod 256 */ - "addb %%cl, -1(%%edi,%%ebx,) \n\t" - "cmpl _dif, %%ebx \n\t" - "jb paeth_lp1 \n\t" - - "paeth_go: \n\t" - "movl _FullLength, %%ecx \n\t" - "movl %%ecx, %%eax \n\t" - "subl %%ebx, %%eax \n\t" /* subtract alignment fix */ - "andl $0x00000007, %%eax \n\t" /* calc bytes over mult of 8 */ - "subl %%eax, %%ecx \n\t" /* drop over bytes from original length */ - "movl %%ecx, _MMXLength \n\t" -#ifdef __PIC__ - "popl %%ebx \n\t" /* restore index to Global Offset Table */ -#endif - - : "=c" (dummy_value_c), /* output regs (dummy) */ - "=S" (dummy_value_S), - "=D" (dummy_value_D) - - : "0" (bpp), /* ecx // input regs */ - "1" (prev_row), /* esi */ - "2" (row) /* edi */ - - : "%eax", "%edx" /* clobber list */ -#ifndef __PIC__ - , "%ebx" -#endif - ); - - /* now do the math for the rest of the row */ - switch (bpp) - { - case 3: - { - _ActiveMask.use = 0x0000000000ffffffLL; - _ActiveMaskEnd.use = 0xffff000000000000LL; - _ShiftBpp.use = 24; /* == bpp(3) * 8 */ - _ShiftRem.use = 40; /* == 64 - 24 */ - - __asm__ __volatile__ ( - "movl _dif, %%ecx \n\t" -/* preload "movl row, %%edi \n\t" */ -/* preload "movl prev_row, %%esi \n\t" */ - "pxor %%mm0, %%mm0 \n\t" - /* prime the pump: load the first Raw(x-bpp) data set */ - "movq -8(%%edi,%%ecx,), %%mm1 \n\t" - "paeth_3lp: \n\t" - "psrlq _ShiftRem, %%mm1 \n\t" /* shift last 3 bytes to 1st */ - /* 3 bytes */ - "movq (%%esi,%%ecx,), %%mm2 \n\t" /* load b=Prior(x) */ - "punpcklbw %%mm0, %%mm1 \n\t" /* unpack High bytes of a */ - "movq -8(%%esi,%%ecx,), %%mm3 \n\t" /* prep c=Prior(x-bpp) bytes */ - "punpcklbw %%mm0, %%mm2 \n\t" /* unpack High bytes of b */ - "psrlq _ShiftRem, %%mm3 \n\t" /* shift last 3 bytes to 1st */ - /* 3 bytes */ - /* pav = p - a = (a + b - c) - a = b - c */ - "movq %%mm2, %%mm4 \n\t" - "punpcklbw %%mm0, %%mm3 \n\t" /* unpack High bytes of c */ - /* pbv = p - b = (a + b - c) - b = a - c */ - "movq %%mm1, %%mm5 \n\t" - "psubw %%mm3, %%mm4 \n\t" - "pxor %%mm7, %%mm7 \n\t" - /* pcv = p - c = (a + b - c) -c = (a - c) + (b - c) = pav + pbv */ - "movq %%mm4, %%mm6 \n\t" - "psubw %%mm3, %%mm5 \n\t" - - /* pa = abs(p-a) = abs(pav) */ - /* pb = abs(p-b) = abs(pbv) */ - /* pc = abs(p-c) = abs(pcv) */ - "pcmpgtw %%mm4, %%mm0 \n\t" /* create mask pav bytes < 0 */ - "paddw %%mm5, %%mm6 \n\t" - "pand %%mm4, %%mm0 \n\t" /* only pav bytes < 0 in mm7 */ - "pcmpgtw %%mm5, %%mm7 \n\t" /* create mask pbv bytes < 0 */ - "psubw %%mm0, %%mm4 \n\t" - "pand %%mm5, %%mm7 \n\t" /* only pbv bytes < 0 in mm0 */ - "psubw %%mm0, %%mm4 \n\t" - "psubw %%mm7, %%mm5 \n\t" - "pxor %%mm0, %%mm0 \n\t" - "pcmpgtw %%mm6, %%mm0 \n\t" /* create mask pcv bytes < 0 */ - "pand %%mm6, %%mm0 \n\t" /* only pav bytes < 0 in mm7 */ - "psubw %%mm7, %%mm5 \n\t" - "psubw %%mm0, %%mm6 \n\t" - /* test pa <= pb */ - "movq %%mm4, %%mm7 \n\t" - "psubw %%mm0, %%mm6 \n\t" - "pcmpgtw %%mm5, %%mm7 \n\t" /* pa > pb? */ - "movq %%mm7, %%mm0 \n\t" - /* use mm7 mask to merge pa & pb */ - "pand %%mm7, %%mm5 \n\t" - /* use mm0 mask copy to merge a & b */ - "pand %%mm0, %%mm2 \n\t" - "pandn %%mm4, %%mm7 \n\t" - "pandn %%mm1, %%mm0 \n\t" - "paddw %%mm5, %%mm7 \n\t" - "paddw %%mm2, %%mm0 \n\t" - /* test ((pa <= pb)? pa:pb) <= pc */ - "pcmpgtw %%mm6, %%mm7 \n\t" /* pab > pc? */ - "pxor %%mm1, %%mm1 \n\t" - "pand %%mm7, %%mm3 \n\t" - "pandn %%mm0, %%mm7 \n\t" - "paddw %%mm3, %%mm7 \n\t" - "pxor %%mm0, %%mm0 \n\t" - "packuswb %%mm1, %%mm7 \n\t" - "movq (%%esi,%%ecx,), %%mm3 \n\t" /* load c=Prior(x-bpp) */ - "pand _ActiveMask, %%mm7 \n\t" - "movq %%mm3, %%mm2 \n\t" /* load b=Prior(x) step 1 */ - "paddb (%%edi,%%ecx,), %%mm7 \n\t" /* add Paeth predictor with Raw(x) */ - "punpcklbw %%mm0, %%mm3 \n\t" /* unpack High bytes of c */ - "movq %%mm7, (%%edi,%%ecx,) \n\t" /* write back updated value */ - "movq %%mm7, %%mm1 \n\t" /* now mm1 will be used as */ - /* Raw(x-bpp) */ - /* now do Paeth for 2nd set of bytes (3-5) */ - "psrlq _ShiftBpp, %%mm2 \n\t" /* load b=Prior(x) step 2 */ - "punpcklbw %%mm0, %%mm1 \n\t" /* unpack High bytes of a */ - "pxor %%mm7, %%mm7 \n\t" - "punpcklbw %%mm0, %%mm2 \n\t" /* unpack High bytes of b */ - /* pbv = p - b = (a + b - c) - b = a - c */ - "movq %%mm1, %%mm5 \n\t" - /* pav = p - a = (a + b - c) - a = b - c */ - "movq %%mm2, %%mm4 \n\t" - "psubw %%mm3, %%mm5 \n\t" - "psubw %%mm3, %%mm4 \n\t" - /* pcv = p - c = (a + b - c) -c = (a - c) + (b - c) = */ - /* pav + pbv = pbv + pav */ - "movq %%mm5, %%mm6 \n\t" - "paddw %%mm4, %%mm6 \n\t" - - /* pa = abs(p-a) = abs(pav) */ - /* pb = abs(p-b) = abs(pbv) */ - /* pc = abs(p-c) = abs(pcv) */ - "pcmpgtw %%mm5, %%mm0 \n\t" /* create mask pbv bytes < 0 */ - "pcmpgtw %%mm4, %%mm7 \n\t" /* create mask pav bytes < 0 */ - "pand %%mm5, %%mm0 \n\t" /* only pbv bytes < 0 in mm0 */ - "pand %%mm4, %%mm7 \n\t" /* only pav bytes < 0 in mm7 */ - "psubw %%mm0, %%mm5 \n\t" - "psubw %%mm7, %%mm4 \n\t" - "psubw %%mm0, %%mm5 \n\t" - "psubw %%mm7, %%mm4 \n\t" - "pxor %%mm0, %%mm0 \n\t" - "pcmpgtw %%mm6, %%mm0 \n\t" /* create mask pcv bytes < 0 */ - "pand %%mm6, %%mm0 \n\t" /* only pav bytes < 0 in mm7 */ - "psubw %%mm0, %%mm6 \n\t" - /* test pa <= pb */ - "movq %%mm4, %%mm7 \n\t" - "psubw %%mm0, %%mm6 \n\t" - "pcmpgtw %%mm5, %%mm7 \n\t" /* pa > pb? */ - "movq %%mm7, %%mm0 \n\t" - /* use mm7 mask to merge pa & pb */ - "pand %%mm7, %%mm5 \n\t" - /* use mm0 mask copy to merge a & b */ - "pand %%mm0, %%mm2 \n\t" - "pandn %%mm4, %%mm7 \n\t" - "pandn %%mm1, %%mm0 \n\t" - "paddw %%mm5, %%mm7 \n\t" - "paddw %%mm2, %%mm0 \n\t" - /* test ((pa <= pb)? pa:pb) <= pc */ - "pcmpgtw %%mm6, %%mm7 \n\t" /* pab > pc? */ - "movq (%%esi,%%ecx,), %%mm2 \n\t" /* load b=Prior(x) */ - "pand %%mm7, %%mm3 \n\t" - "pandn %%mm0, %%mm7 \n\t" - "pxor %%mm1, %%mm1 \n\t" - "paddw %%mm3, %%mm7 \n\t" - "pxor %%mm0, %%mm0 \n\t" - "packuswb %%mm1, %%mm7 \n\t" - "movq %%mm2, %%mm3 \n\t" /* load c=Prior(x-bpp) step 1 */ - "pand _ActiveMask, %%mm7 \n\t" - "punpckhbw %%mm0, %%mm2 \n\t" /* unpack High bytes of b */ - "psllq _ShiftBpp, %%mm7 \n\t" /* shift bytes to 2nd group of */ - /* 3 bytes */ - /* pav = p - a = (a + b - c) - a = b - c */ - "movq %%mm2, %%mm4 \n\t" - "paddb (%%edi,%%ecx,), %%mm7 \n\t" /* add Paeth predictor with Raw(x) */ - "psllq _ShiftBpp, %%mm3 \n\t" /* load c=Prior(x-bpp) step 2 */ - "movq %%mm7, (%%edi,%%ecx,) \n\t" /* write back updated value */ - "movq %%mm7, %%mm1 \n\t" - "punpckhbw %%mm0, %%mm3 \n\t" /* unpack High bytes of c */ - "psllq _ShiftBpp, %%mm1 \n\t" /* shift bytes */ - /* now mm1 will be used as Raw(x-bpp) */ - /* now do Paeth for 3rd, and final, set of bytes (6-7) */ - "pxor %%mm7, %%mm7 \n\t" - "punpckhbw %%mm0, %%mm1 \n\t" /* unpack High bytes of a */ - "psubw %%mm3, %%mm4 \n\t" - /* pbv = p - b = (a + b - c) - b = a - c */ - "movq %%mm1, %%mm5 \n\t" - /* pcv = p - c = (a + b - c) -c = (a - c) + (b - c) = pav + pbv */ - "movq %%mm4, %%mm6 \n\t" - "psubw %%mm3, %%mm5 \n\t" - "pxor %%mm0, %%mm0 \n\t" - "paddw %%mm5, %%mm6 \n\t" - - /* pa = abs(p-a) = abs(pav) */ - /* pb = abs(p-b) = abs(pbv) */ - /* pc = abs(p-c) = abs(pcv) */ - "pcmpgtw %%mm4, %%mm0 \n\t" /* create mask pav bytes < 0 */ - "pcmpgtw %%mm5, %%mm7 \n\t" /* create mask pbv bytes < 0 */ - "pand %%mm4, %%mm0 \n\t" /* only pav bytes < 0 in mm7 */ - "pand %%mm5, %%mm7 \n\t" /* only pbv bytes < 0 in mm0 */ - "psubw %%mm0, %%mm4 \n\t" - "psubw %%mm7, %%mm5 \n\t" - "psubw %%mm0, %%mm4 \n\t" - "psubw %%mm7, %%mm5 \n\t" - "pxor %%mm0, %%mm0 \n\t" - "pcmpgtw %%mm6, %%mm0 \n\t" /* create mask pcv bytes < 0 */ - "pand %%mm6, %%mm0 \n\t" /* only pav bytes < 0 in mm7 */ - "psubw %%mm0, %%mm6 \n\t" - /* test pa <= pb */ - "movq %%mm4, %%mm7 \n\t" - "psubw %%mm0, %%mm6 \n\t" - "pcmpgtw %%mm5, %%mm7 \n\t" /* pa > pb? */ - "movq %%mm7, %%mm0 \n\t" - /* use mm0 mask copy to merge a & b */ - "pand %%mm0, %%mm2 \n\t" - /* use mm7 mask to merge pa & pb */ - "pand %%mm7, %%mm5 \n\t" - "pandn %%mm1, %%mm0 \n\t" - "pandn %%mm4, %%mm7 \n\t" - "paddw %%mm2, %%mm0 \n\t" - "paddw %%mm5, %%mm7 \n\t" - /* test ((pa <= pb)? pa:pb) <= pc */ - "pcmpgtw %%mm6, %%mm7 \n\t" /* pab > pc? */ - "pand %%mm7, %%mm3 \n\t" - "pandn %%mm0, %%mm7 \n\t" - "paddw %%mm3, %%mm7 \n\t" - "pxor %%mm1, %%mm1 \n\t" - "packuswb %%mm7, %%mm1 \n\t" - /* step ecx to next set of 8 bytes and repeat loop til done */ - "addl $8, %%ecx \n\t" - "pand _ActiveMaskEnd, %%mm1 \n\t" - "paddb -8(%%edi,%%ecx,), %%mm1 \n\t" /* add Paeth predictor with */ - /* Raw(x) */ - - "cmpl _MMXLength, %%ecx \n\t" - "pxor %%mm0, %%mm0 \n\t" /* pxor does not affect flags */ - "movq %%mm1, -8(%%edi,%%ecx,) \n\t" /* write back updated value */ - /* mm1 will be used as Raw(x-bpp) next loop */ - /* mm3 ready to be used as Prior(x-bpp) next loop */ - "jb paeth_3lp \n\t" - - : "=S" (dummy_value_S), /* output regs (dummy) */ - "=D" (dummy_value_D) - - : "0" (prev_row), /* esi // input regs */ - "1" (row) /* edi */ - - : "%ecx" /* clobber list */ -#if 0 /* %mm0, ..., %mm7 not supported by gcc 2.7.2.3 or egcs 1.1 */ - , "%mm0", "%mm1", "%mm2", "%mm3" - , "%mm4", "%mm5", "%mm6", "%mm7" -#endif - ); - } - break; /* end 3 bpp */ - - case 6: - //case 7: /* GRR BOGUS */ - //case 5: /* GRR BOGUS */ - { - _ActiveMask.use = 0x00000000ffffffffLL; - _ActiveMask2.use = 0xffffffff00000000LL; - _ShiftBpp.use = bpp << 3; /* == bpp * 8 */ - _ShiftRem.use = 64 - _ShiftBpp.use; - - __asm__ __volatile__ ( - "movl _dif, %%ecx \n\t" -/* preload "movl row, %%edi \n\t" */ -/* preload "movl prev_row, %%esi \n\t" */ - /* prime the pump: load the first Raw(x-bpp) data set */ - "movq -8(%%edi,%%ecx,), %%mm1 \n\t" - "pxor %%mm0, %%mm0 \n\t" - - "paeth_6lp: \n\t" - /* must shift to position Raw(x-bpp) data */ - "psrlq _ShiftRem, %%mm1 \n\t" - /* do first set of 4 bytes */ - "movq -8(%%esi,%%ecx,), %%mm3 \n\t" /* read c=Prior(x-bpp) bytes */ - "punpcklbw %%mm0, %%mm1 \n\t" /* unpack Low bytes of a */ - "movq (%%esi,%%ecx,), %%mm2 \n\t" /* load b=Prior(x) */ - "punpcklbw %%mm0, %%mm2 \n\t" /* unpack Low bytes of b */ - /* must shift to position Prior(x-bpp) data */ - "psrlq _ShiftRem, %%mm3 \n\t" - /* pav = p - a = (a + b - c) - a = b - c */ - "movq %%mm2, %%mm4 \n\t" - "punpcklbw %%mm0, %%mm3 \n\t" /* unpack Low bytes of c */ - /* pbv = p - b = (a + b - c) - b = a - c */ - "movq %%mm1, %%mm5 \n\t" - "psubw %%mm3, %%mm4 \n\t" - "pxor %%mm7, %%mm7 \n\t" - /* pcv = p - c = (a + b - c) -c = (a - c) + (b - c) = pav + pbv */ - "movq %%mm4, %%mm6 \n\t" - "psubw %%mm3, %%mm5 \n\t" - /* pa = abs(p-a) = abs(pav) */ - /* pb = abs(p-b) = abs(pbv) */ - /* pc = abs(p-c) = abs(pcv) */ - "pcmpgtw %%mm4, %%mm0 \n\t" /* create mask pav bytes < 0 */ - "paddw %%mm5, %%mm6 \n\t" - "pand %%mm4, %%mm0 \n\t" /* only pav bytes < 0 in mm7 */ - "pcmpgtw %%mm5, %%mm7 \n\t" /* create mask pbv bytes < 0 */ - "psubw %%mm0, %%mm4 \n\t" - "pand %%mm5, %%mm7 \n\t" /* only pbv bytes < 0 in mm0 */ - "psubw %%mm0, %%mm4 \n\t" - "psubw %%mm7, %%mm5 \n\t" - "pxor %%mm0, %%mm0 \n\t" - "pcmpgtw %%mm6, %%mm0 \n\t" /* create mask pcv bytes < 0 */ - "pand %%mm6, %%mm0 \n\t" /* only pav bytes < 0 in mm7 */ - "psubw %%mm7, %%mm5 \n\t" - "psubw %%mm0, %%mm6 \n\t" - /* test pa <= pb */ - "movq %%mm4, %%mm7 \n\t" - "psubw %%mm0, %%mm6 \n\t" - "pcmpgtw %%mm5, %%mm7 \n\t" /* pa > pb? */ - "movq %%mm7, %%mm0 \n\t" - /* use mm7 mask to merge pa & pb */ - "pand %%mm7, %%mm5 \n\t" - /* use mm0 mask copy to merge a & b */ - "pand %%mm0, %%mm2 \n\t" - "pandn %%mm4, %%mm7 \n\t" - "pandn %%mm1, %%mm0 \n\t" - "paddw %%mm5, %%mm7 \n\t" - "paddw %%mm2, %%mm0 \n\t" - /* test ((pa <= pb)? pa:pb) <= pc */ - "pcmpgtw %%mm6, %%mm7 \n\t" /* pab > pc? */ - "pxor %%mm1, %%mm1 \n\t" - "pand %%mm7, %%mm3 \n\t" - "pandn %%mm0, %%mm7 \n\t" - "paddw %%mm3, %%mm7 \n\t" - "pxor %%mm0, %%mm0 \n\t" - "packuswb %%mm1, %%mm7 \n\t" - "movq -8(%%esi,%%ecx,), %%mm3 \n\t" /* load c=Prior(x-bpp) */ - "pand _ActiveMask, %%mm7 \n\t" - "psrlq _ShiftRem, %%mm3 \n\t" - "movq (%%esi,%%ecx,), %%mm2 \n\t" /* load b=Prior(x) step 1 */ - "paddb (%%edi,%%ecx,), %%mm7 \n\t" /* add Paeth predictor and Raw(x) */ - "movq %%mm2, %%mm6 \n\t" - "movq %%mm7, (%%edi,%%ecx,) \n\t" /* write back updated value */ - "movq -8(%%edi,%%ecx,), %%mm1 \n\t" - "psllq _ShiftBpp, %%mm6 \n\t" - "movq %%mm7, %%mm5 \n\t" - "psrlq _ShiftRem, %%mm1 \n\t" - "por %%mm6, %%mm3 \n\t" - "psllq _ShiftBpp, %%mm5 \n\t" - "punpckhbw %%mm0, %%mm3 \n\t" /* unpack High bytes of c */ - "por %%mm5, %%mm1 \n\t" - /* do second set of 4 bytes */ - "punpckhbw %%mm0, %%mm2 \n\t" /* unpack High bytes of b */ - "punpckhbw %%mm0, %%mm1 \n\t" /* unpack High bytes of a */ - /* pav = p - a = (a + b - c) - a = b - c */ - "movq %%mm2, %%mm4 \n\t" - /* pbv = p - b = (a + b - c) - b = a - c */ - "movq %%mm1, %%mm5 \n\t" - "psubw %%mm3, %%mm4 \n\t" - "pxor %%mm7, %%mm7 \n\t" - /* pcv = p - c = (a + b - c) -c = (a - c) + (b - c) = pav + pbv */ - "movq %%mm4, %%mm6 \n\t" - "psubw %%mm3, %%mm5 \n\t" - /* pa = abs(p-a) = abs(pav) */ - /* pb = abs(p-b) = abs(pbv) */ - /* pc = abs(p-c) = abs(pcv) */ - "pcmpgtw %%mm4, %%mm0 \n\t" /* create mask pav bytes < 0 */ - "paddw %%mm5, %%mm6 \n\t" - "pand %%mm4, %%mm0 \n\t" /* only pav bytes < 0 in mm7 */ - "pcmpgtw %%mm5, %%mm7 \n\t" /* create mask pbv bytes < 0 */ - "psubw %%mm0, %%mm4 \n\t" - "pand %%mm5, %%mm7 \n\t" /* only pbv bytes < 0 in mm0 */ - "psubw %%mm0, %%mm4 \n\t" - "psubw %%mm7, %%mm5 \n\t" - "pxor %%mm0, %%mm0 \n\t" - "pcmpgtw %%mm6, %%mm0 \n\t" /* create mask pcv bytes < 0 */ - "pand %%mm6, %%mm0 \n\t" /* only pav bytes < 0 in mm7 */ - "psubw %%mm7, %%mm5 \n\t" - "psubw %%mm0, %%mm6 \n\t" - /* test pa <= pb */ - "movq %%mm4, %%mm7 \n\t" - "psubw %%mm0, %%mm6 \n\t" - "pcmpgtw %%mm5, %%mm7 \n\t" /* pa > pb? */ - "movq %%mm7, %%mm0 \n\t" - /* use mm7 mask to merge pa & pb */ - "pand %%mm7, %%mm5 \n\t" - /* use mm0 mask copy to merge a & b */ - "pand %%mm0, %%mm2 \n\t" - "pandn %%mm4, %%mm7 \n\t" - "pandn %%mm1, %%mm0 \n\t" - "paddw %%mm5, %%mm7 \n\t" - "paddw %%mm2, %%mm0 \n\t" - /* test ((pa <= pb)? pa:pb) <= pc */ - "pcmpgtw %%mm6, %%mm7 \n\t" /* pab > pc? */ - "pxor %%mm1, %%mm1 \n\t" - "pand %%mm7, %%mm3 \n\t" - "pandn %%mm0, %%mm7 \n\t" - "pxor %%mm1, %%mm1 \n\t" - "paddw %%mm3, %%mm7 \n\t" - "pxor %%mm0, %%mm0 \n\t" - /* step ecx to next set of 8 bytes and repeat loop til done */ - "addl $8, %%ecx \n\t" - "packuswb %%mm7, %%mm1 \n\t" - "paddb -8(%%edi,%%ecx,), %%mm1 \n\t" /* add Paeth predictor with Raw(x) */ - "cmpl _MMXLength, %%ecx \n\t" - "movq %%mm1, -8(%%edi,%%ecx,) \n\t" /* write back updated value */ - /* mm1 will be used as Raw(x-bpp) next loop */ - "jb paeth_6lp \n\t" - - : "=S" (dummy_value_S), /* output regs (dummy) */ - "=D" (dummy_value_D) - - : "0" (prev_row), /* esi // input regs */ - "1" (row) /* edi */ - - : "%ecx" /* clobber list */ -#if 0 /* %mm0, ..., %mm7 not supported by gcc 2.7.2.3 or egcs 1.1 */ - , "%mm0", "%mm1", "%mm2", "%mm3" - , "%mm4", "%mm5", "%mm6", "%mm7" -#endif - ); - } - break; /* end 6 bpp */ - - case 4: - { - _ActiveMask.use = 0x00000000ffffffffLL; - - __asm__ __volatile__ ( - "movl _dif, %%ecx \n\t" -/* preload "movl row, %%edi \n\t" */ -/* preload "movl prev_row, %%esi \n\t" */ - "pxor %%mm0, %%mm0 \n\t" - /* prime the pump: load the first Raw(x-bpp) data set */ - "movq -8(%%edi,%%ecx,), %%mm1 \n\t" /* only time should need to read */ - /* a=Raw(x-bpp) bytes */ - "paeth_4lp: \n\t" - /* do first set of 4 bytes */ - "movq -8(%%esi,%%ecx,), %%mm3 \n\t" /* read c=Prior(x-bpp) bytes */ - "punpckhbw %%mm0, %%mm1 \n\t" /* unpack Low bytes of a */ - "movq (%%esi,%%ecx,), %%mm2 \n\t" /* load b=Prior(x) */ - "punpcklbw %%mm0, %%mm2 \n\t" /* unpack High bytes of b */ - /* pav = p - a = (a + b - c) - a = b - c */ - "movq %%mm2, %%mm4 \n\t" - "punpckhbw %%mm0, %%mm3 \n\t" /* unpack High bytes of c */ - /* pbv = p - b = (a + b - c) - b = a - c */ - "movq %%mm1, %%mm5 \n\t" - "psubw %%mm3, %%mm4 \n\t" - "pxor %%mm7, %%mm7 \n\t" - /* pcv = p - c = (a + b - c) -c = (a - c) + (b - c) = pav + pbv */ - "movq %%mm4, %%mm6 \n\t" - "psubw %%mm3, %%mm5 \n\t" - /* pa = abs(p-a) = abs(pav) */ - /* pb = abs(p-b) = abs(pbv) */ - /* pc = abs(p-c) = abs(pcv) */ - "pcmpgtw %%mm4, %%mm0 \n\t" /* create mask pav bytes < 0 */ - "paddw %%mm5, %%mm6 \n\t" - "pand %%mm4, %%mm0 \n\t" /* only pav bytes < 0 in mm7 */ - "pcmpgtw %%mm5, %%mm7 \n\t" /* create mask pbv bytes < 0 */ - "psubw %%mm0, %%mm4 \n\t" - "pand %%mm5, %%mm7 \n\t" /* only pbv bytes < 0 in mm0 */ - "psubw %%mm0, %%mm4 \n\t" - "psubw %%mm7, %%mm5 \n\t" - "pxor %%mm0, %%mm0 \n\t" - "pcmpgtw %%mm6, %%mm0 \n\t" /* create mask pcv bytes < 0 */ - "pand %%mm6, %%mm0 \n\t" /* only pav bytes < 0 in mm7 */ - "psubw %%mm7, %%mm5 \n\t" - "psubw %%mm0, %%mm6 \n\t" - /* test pa <= pb */ - "movq %%mm4, %%mm7 \n\t" - "psubw %%mm0, %%mm6 \n\t" - "pcmpgtw %%mm5, %%mm7 \n\t" /* pa > pb? */ - "movq %%mm7, %%mm0 \n\t" - /* use mm7 mask to merge pa & pb */ - "pand %%mm7, %%mm5 \n\t" - /* use mm0 mask copy to merge a & b */ - "pand %%mm0, %%mm2 \n\t" - "pandn %%mm4, %%mm7 \n\t" - "pandn %%mm1, %%mm0 \n\t" - "paddw %%mm5, %%mm7 \n\t" - "paddw %%mm2, %%mm0 \n\t" - /* test ((pa <= pb)? pa:pb) <= pc */ - "pcmpgtw %%mm6, %%mm7 \n\t" /* pab > pc? */ - "pxor %%mm1, %%mm1 \n\t" - "pand %%mm7, %%mm3 \n\t" - "pandn %%mm0, %%mm7 \n\t" - "paddw %%mm3, %%mm7 \n\t" - "pxor %%mm0, %%mm0 \n\t" - "packuswb %%mm1, %%mm7 \n\t" - "movq (%%esi,%%ecx,), %%mm3 \n\t" /* load c=Prior(x-bpp) */ - "pand _ActiveMask, %%mm7 \n\t" - "movq %%mm3, %%mm2 \n\t" /* load b=Prior(x) step 1 */ - "paddb (%%edi,%%ecx,), %%mm7 \n\t" /* add Paeth predictor with Raw(x) */ - "punpcklbw %%mm0, %%mm3 \n\t" /* unpack High bytes of c */ - "movq %%mm7, (%%edi,%%ecx,) \n\t" /* write back updated value */ - "movq %%mm7, %%mm1 \n\t" /* now mm1 will be used as Raw(x-bpp) */ - /* do second set of 4 bytes */ - "punpckhbw %%mm0, %%mm2 \n\t" /* unpack Low bytes of b */ - "punpcklbw %%mm0, %%mm1 \n\t" /* unpack Low bytes of a */ - /* pav = p - a = (a + b - c) - a = b - c */ - "movq %%mm2, %%mm4 \n\t" - /* pbv = p - b = (a + b - c) - b = a - c */ - "movq %%mm1, %%mm5 \n\t" - "psubw %%mm3, %%mm4 \n\t" - "pxor %%mm7, %%mm7 \n\t" - /* pcv = p - c = (a + b - c) -c = (a - c) + (b - c) = pav + pbv */ - "movq %%mm4, %%mm6 \n\t" - "psubw %%mm3, %%mm5 \n\t" - /* pa = abs(p-a) = abs(pav) */ - /* pb = abs(p-b) = abs(pbv) */ - /* pc = abs(p-c) = abs(pcv) */ - "pcmpgtw %%mm4, %%mm0 \n\t" /* create mask pav bytes < 0 */ - "paddw %%mm5, %%mm6 \n\t" - "pand %%mm4, %%mm0 \n\t" /* only pav bytes < 0 in mm7 */ - "pcmpgtw %%mm5, %%mm7 \n\t" /* create mask pbv bytes < 0 */ - "psubw %%mm0, %%mm4 \n\t" - "pand %%mm5, %%mm7 \n\t" /* only pbv bytes < 0 in mm0 */ - "psubw %%mm0, %%mm4 \n\t" - "psubw %%mm7, %%mm5 \n\t" - "pxor %%mm0, %%mm0 \n\t" - "pcmpgtw %%mm6, %%mm0 \n\t" /* create mask pcv bytes < 0 */ - "pand %%mm6, %%mm0 \n\t" /* only pav bytes < 0 in mm7 */ - "psubw %%mm7, %%mm5 \n\t" - "psubw %%mm0, %%mm6 \n\t" - /* test pa <= pb */ - "movq %%mm4, %%mm7 \n\t" - "psubw %%mm0, %%mm6 \n\t" - "pcmpgtw %%mm5, %%mm7 \n\t" /* pa > pb? */ - "movq %%mm7, %%mm0 \n\t" - /* use mm7 mask to merge pa & pb */ - "pand %%mm7, %%mm5 \n\t" - /* use mm0 mask copy to merge a & b */ - "pand %%mm0, %%mm2 \n\t" - "pandn %%mm4, %%mm7 \n\t" - "pandn %%mm1, %%mm0 \n\t" - "paddw %%mm5, %%mm7 \n\t" - "paddw %%mm2, %%mm0 \n\t" - /* test ((pa <= pb)? pa:pb) <= pc */ - "pcmpgtw %%mm6, %%mm7 \n\t" /* pab > pc? */ - "pxor %%mm1, %%mm1 \n\t" - "pand %%mm7, %%mm3 \n\t" - "pandn %%mm0, %%mm7 \n\t" - "pxor %%mm1, %%mm1 \n\t" - "paddw %%mm3, %%mm7 \n\t" - "pxor %%mm0, %%mm0 \n\t" - /* step ecx to next set of 8 bytes and repeat loop til done */ - "addl $8, %%ecx \n\t" - "packuswb %%mm7, %%mm1 \n\t" - "paddb -8(%%edi,%%ecx,), %%mm1 \n\t" /* add predictor with Raw(x) */ - "cmpl _MMXLength, %%ecx \n\t" - "movq %%mm1, -8(%%edi,%%ecx,) \n\t" /* write back updated value */ - /* mm1 will be used as Raw(x-bpp) next loop */ - "jb paeth_4lp \n\t" - - : "=S" (dummy_value_S), /* output regs (dummy) */ - "=D" (dummy_value_D) - - : "0" (prev_row), /* esi // input regs */ - "1" (row) /* edi */ - - : "%ecx" /* clobber list */ -#if 0 /* %mm0, ..., %mm7 not supported by gcc 2.7.2.3 or egcs 1.1 */ - , "%mm0", "%mm1", "%mm2", "%mm3" - , "%mm4", "%mm5", "%mm6", "%mm7" -#endif - ); - } - break; /* end 4 bpp */ - - case 8: /* bpp == 8 */ - { - _ActiveMask.use = 0x00000000ffffffffLL; - - __asm__ __volatile__ ( - "movl _dif, %%ecx \n\t" -/* preload "movl row, %%edi \n\t" */ -/* preload "movl prev_row, %%esi \n\t" */ - "pxor %%mm0, %%mm0 \n\t" - /* prime the pump: load the first Raw(x-bpp) data set */ - "movq -8(%%edi,%%ecx,), %%mm1 \n\t" /* only time should need to read */ - /* a=Raw(x-bpp) bytes */ - "paeth_8lp: \n\t" - /* do first set of 4 bytes */ - "movq -8(%%esi,%%ecx,), %%mm3 \n\t" /* read c=Prior(x-bpp) bytes */ - "punpcklbw %%mm0, %%mm1 \n\t" /* unpack Low bytes of a */ - "movq (%%esi,%%ecx,), %%mm2 \n\t" /* load b=Prior(x) */ - "punpcklbw %%mm0, %%mm2 \n\t" /* unpack Low bytes of b */ - /* pav = p - a = (a + b - c) - a = b - c */ - "movq %%mm2, %%mm4 \n\t" - "punpcklbw %%mm0, %%mm3 \n\t" /* unpack Low bytes of c */ - /* pbv = p - b = (a + b - c) - b = a - c */ - "movq %%mm1, %%mm5 \n\t" - "psubw %%mm3, %%mm4 \n\t" - "pxor %%mm7, %%mm7 \n\t" - /* pcv = p - c = (a + b - c) -c = (a - c) + (b - c) = pav + pbv */ - "movq %%mm4, %%mm6 \n\t" - "psubw %%mm3, %%mm5 \n\t" - /* pa = abs(p-a) = abs(pav) */ - /* pb = abs(p-b) = abs(pbv) */ - /* pc = abs(p-c) = abs(pcv) */ - "pcmpgtw %%mm4, %%mm0 \n\t" /* create mask pav bytes < 0 */ - "paddw %%mm5, %%mm6 \n\t" - "pand %%mm4, %%mm0 \n\t" /* only pav bytes < 0 in mm7 */ - "pcmpgtw %%mm5, %%mm7 \n\t" /* create mask pbv bytes < 0 */ - "psubw %%mm0, %%mm4 \n\t" - "pand %%mm5, %%mm7 \n\t" /* only pbv bytes < 0 in mm0 */ - "psubw %%mm0, %%mm4 \n\t" - "psubw %%mm7, %%mm5 \n\t" - "pxor %%mm0, %%mm0 \n\t" - "pcmpgtw %%mm6, %%mm0 \n\t" /* create mask pcv bytes < 0 */ - "pand %%mm6, %%mm0 \n\t" /* only pav bytes < 0 in mm7 */ - "psubw %%mm7, %%mm5 \n\t" - "psubw %%mm0, %%mm6 \n\t" - /* test pa <= pb */ - "movq %%mm4, %%mm7 \n\t" - "psubw %%mm0, %%mm6 \n\t" - "pcmpgtw %%mm5, %%mm7 \n\t" /* pa > pb? */ - "movq %%mm7, %%mm0 \n\t" - /* use mm7 mask to merge pa & pb */ - "pand %%mm7, %%mm5 \n\t" - /* use mm0 mask copy to merge a & b */ - "pand %%mm0, %%mm2 \n\t" - "pandn %%mm4, %%mm7 \n\t" - "pandn %%mm1, %%mm0 \n\t" - "paddw %%mm5, %%mm7 \n\t" - "paddw %%mm2, %%mm0 \n\t" - /* test ((pa <= pb)? pa:pb) <= pc */ - "pcmpgtw %%mm6, %%mm7 \n\t" /* pab > pc? */ - "pxor %%mm1, %%mm1 \n\t" - "pand %%mm7, %%mm3 \n\t" - "pandn %%mm0, %%mm7 \n\t" - "paddw %%mm3, %%mm7 \n\t" - "pxor %%mm0, %%mm0 \n\t" - "packuswb %%mm1, %%mm7 \n\t" - "movq -8(%%esi,%%ecx,), %%mm3 \n\t" /* read c=Prior(x-bpp) bytes */ - "pand _ActiveMask, %%mm7 \n\t" - "movq (%%esi,%%ecx,), %%mm2 \n\t" /* load b=Prior(x) */ - "paddb (%%edi,%%ecx,), %%mm7 \n\t" /* add Paeth predictor with Raw(x) */ - "punpckhbw %%mm0, %%mm3 \n\t" /* unpack High bytes of c */ - "movq %%mm7, (%%edi,%%ecx,) \n\t" /* write back updated value */ - "movq -8(%%edi,%%ecx,), %%mm1 \n\t" /* read a=Raw(x-bpp) bytes */ - - /* do second set of 4 bytes */ - "punpckhbw %%mm0, %%mm2 \n\t" /* unpack High bytes of b */ - "punpckhbw %%mm0, %%mm1 \n\t" /* unpack High bytes of a */ - /* pav = p - a = (a + b - c) - a = b - c */ - "movq %%mm2, %%mm4 \n\t" - /* pbv = p - b = (a + b - c) - b = a - c */ - "movq %%mm1, %%mm5 \n\t" - "psubw %%mm3, %%mm4 \n\t" - "pxor %%mm7, %%mm7 \n\t" - /* pcv = p - c = (a + b - c) -c = (a - c) + (b - c) = pav + pbv */ - "movq %%mm4, %%mm6 \n\t" - "psubw %%mm3, %%mm5 \n\t" - /* pa = abs(p-a) = abs(pav) */ - /* pb = abs(p-b) = abs(pbv) */ - /* pc = abs(p-c) = abs(pcv) */ - "pcmpgtw %%mm4, %%mm0 \n\t" /* create mask pav bytes < 0 */ - "paddw %%mm5, %%mm6 \n\t" - "pand %%mm4, %%mm0 \n\t" /* only pav bytes < 0 in mm7 */ - "pcmpgtw %%mm5, %%mm7 \n\t" /* create mask pbv bytes < 0 */ - "psubw %%mm0, %%mm4 \n\t" - "pand %%mm5, %%mm7 \n\t" /* only pbv bytes < 0 in mm0 */ - "psubw %%mm0, %%mm4 \n\t" - "psubw %%mm7, %%mm5 \n\t" - "pxor %%mm0, %%mm0 \n\t" - "pcmpgtw %%mm6, %%mm0 \n\t" /* create mask pcv bytes < 0 */ - "pand %%mm6, %%mm0 \n\t" /* only pav bytes < 0 in mm7 */ - "psubw %%mm7, %%mm5 \n\t" - "psubw %%mm0, %%mm6 \n\t" - /* test pa <= pb */ - "movq %%mm4, %%mm7 \n\t" - "psubw %%mm0, %%mm6 \n\t" - "pcmpgtw %%mm5, %%mm7 \n\t" /* pa > pb? */ - "movq %%mm7, %%mm0 \n\t" - /* use mm7 mask to merge pa & pb */ - "pand %%mm7, %%mm5 \n\t" - /* use mm0 mask copy to merge a & b */ - "pand %%mm0, %%mm2 \n\t" - "pandn %%mm4, %%mm7 \n\t" - "pandn %%mm1, %%mm0 \n\t" - "paddw %%mm5, %%mm7 \n\t" - "paddw %%mm2, %%mm0 \n\t" - /* test ((pa <= pb)? pa:pb) <= pc */ - "pcmpgtw %%mm6, %%mm7 \n\t" /* pab > pc? */ - "pxor %%mm1, %%mm1 \n\t" - "pand %%mm7, %%mm3 \n\t" - "pandn %%mm0, %%mm7 \n\t" - "pxor %%mm1, %%mm1 \n\t" - "paddw %%mm3, %%mm7 \n\t" - "pxor %%mm0, %%mm0 \n\t" - /* step ecx to next set of 8 bytes and repeat loop til done */ - "addl $8, %%ecx \n\t" - "packuswb %%mm7, %%mm1 \n\t" - "paddb -8(%%edi,%%ecx,), %%mm1 \n\t" /* add Paeth predictor with Raw(x) */ - "cmpl _MMXLength, %%ecx \n\t" - "movq %%mm1, -8(%%edi,%%ecx,) \n\t" /* write back updated value */ - /* mm1 will be used as Raw(x-bpp) next loop */ - "jb paeth_8lp \n\t" - - : "=S" (dummy_value_S), /* output regs (dummy) */ - "=D" (dummy_value_D) - - : "0" (prev_row), /* esi // input regs */ - "1" (row) /* edi */ - - : "%ecx" /* clobber list */ -#if 0 /* %mm0, ..., %mm7 not supported by gcc 2.7.2.3 or egcs 1.1 */ - , "%mm0", "%mm1", "%mm2", "%mm3" - , "%mm4", "%mm5", "%mm6", "%mm7" -#endif - ); - } - break; /* end 8 bpp */ - - case 1: /* bpp = 1 */ - case 2: /* bpp = 2 */ - default: /* bpp > 8 */ - { - __asm__ __volatile__ ( -#ifdef __PIC__ - "pushl %%ebx \n\t" /* save Global Offset Table index */ -#endif - "movl _dif, %%ebx \n\t" - "cmpl _FullLength, %%ebx \n\t" - "jnb paeth_dend \n\t" - -/* preload "movl row, %%edi \n\t" */ -/* preload "movl prev_row, %%esi \n\t" */ - /* do Paeth decode for remaining bytes */ - "movl %%ebx, %%edx \n\t" -/* preload "subl bpp, %%edx \n\t" // (bpp is preloaded into ecx) */ - "subl %%ecx, %%edx \n\t" /* edx = ebx - bpp */ - "xorl %%ecx, %%ecx \n\t" /* zero ecx before using cl & cx */ - - "paeth_dlp: \n\t" - "xorl %%eax, %%eax \n\t" - /* pav = p - a = (a + b - c) - a = b - c */ - "movb (%%esi,%%ebx,), %%al \n\t" /* load Prior(x) into al */ - "movb (%%esi,%%edx,), %%cl \n\t" /* load Prior(x-bpp) into cl */ - "subl %%ecx, %%eax \n\t" /* subtract Prior(x-bpp) */ - "movl %%eax, _patemp \n\t" /* Save pav for later use */ - "xorl %%eax, %%eax \n\t" - /* pbv = p - b = (a + b - c) - b = a - c */ - "movb (%%edi,%%edx,), %%al \n\t" /* load Raw(x-bpp) into al */ - "subl %%ecx, %%eax \n\t" /* subtract Prior(x-bpp) */ - "movl %%eax, %%ecx \n\t" - /* pcv = p - c = (a + b - c) -c = (a - c) + (b - c) = pav + pbv */ - "addl _patemp, %%eax \n\t" /* pcv = pav + pbv */ - /* pc = abs(pcv) */ - "testl $0x80000000, %%eax \n\t" - "jz paeth_dpca \n\t" - "negl %%eax \n\t" /* reverse sign of neg values */ - - "paeth_dpca: \n\t" - "movl %%eax, _pctemp \n\t" /* save pc for later use */ - /* pb = abs(pbv) */ - "testl $0x80000000, %%ecx \n\t" - "jz paeth_dpba \n\t" - "negl %%ecx \n\t" /* reverse sign of neg values */ - - "paeth_dpba: \n\t" - "movl %%ecx, _pbtemp \n\t" /* save pb for later use */ - /* pa = abs(pav) */ - "movl _patemp, %%eax \n\t" - "testl $0x80000000, %%eax \n\t" - "jz paeth_dpaa \n\t" - "negl %%eax \n\t" /* reverse sign of neg values */ - - "paeth_dpaa: \n\t" - "movl %%eax, _patemp \n\t" /* save pa for later use */ - /* test if pa <= pb */ - "cmpl %%ecx, %%eax \n\t" - "jna paeth_dabb \n\t" - /* pa > pb; now test if pb <= pc */ - "cmpl _pctemp, %%ecx \n\t" - "jna paeth_dbbc \n\t" - /* pb > pc; Raw(x) = Paeth(x) + Prior(x-bpp) */ - "movb (%%esi,%%edx,), %%cl \n\t" /* load Prior(x-bpp) into cl */ - "jmp paeth_dpaeth \n\t" - - "paeth_dbbc: \n\t" - /* pb <= pc; Raw(x) = Paeth(x) + Prior(x) */ - "movb (%%esi,%%ebx,), %%cl \n\t" /* load Prior(x) into cl */ - "jmp paeth_dpaeth \n\t" - - "paeth_dabb: \n\t" - /* pa <= pb; now test if pa <= pc */ - "cmpl _pctemp, %%eax \n\t" - "jna paeth_dabc \n\t" - /* pa > pc; Raw(x) = Paeth(x) + Prior(x-bpp) */ - "movb (%%esi,%%edx,), %%cl \n\t" /* load Prior(x-bpp) into cl */ - "jmp paeth_dpaeth \n\t" - - "paeth_dabc: \n\t" - /* pa <= pc; Raw(x) = Paeth(x) + Raw(x-bpp) */ - "movb (%%edi,%%edx,), %%cl \n\t" /* load Raw(x-bpp) into cl */ - - "paeth_dpaeth: \n\t" - "incl %%ebx \n\t" - "incl %%edx \n\t" - /* Raw(x) = (Paeth(x) + Paeth_Predictor( a, b, c )) mod 256 */ - "addb %%cl, -1(%%edi,%%ebx,) \n\t" - "cmpl _FullLength, %%ebx \n\t" - "jb paeth_dlp \n\t" - - "paeth_dend: \n\t" -#ifdef __PIC__ - "popl %%ebx \n\t" /* index to Global Offset Table */ -#endif - - : "=c" (dummy_value_c), /* output regs (dummy) */ - "=S" (dummy_value_S), - "=D" (dummy_value_D) - - : "0" (bpp), /* ecx // input regs */ - "1" (prev_row), /* esi */ - "2" (row) /* edi */ - - : "%eax", "%edx" /* clobber list */ -#ifndef __PIC__ - , "%ebx" -#endif - ); - } - return; /* No need to go further with this one */ - - } /* end switch (bpp) */ - - __asm__ __volatile__ ( - /* MMX acceleration complete; now do clean-up */ - /* check if any remaining bytes left to decode */ -#ifdef __PIC__ - "pushl %%ebx \n\t" /* save index to Global Offset Table */ -#endif - "movl _MMXLength, %%ebx \n\t" - "cmpl _FullLength, %%ebx \n\t" - "jnb paeth_end \n\t" -/*pre "movl row, %%edi \n\t" */ -/*pre "movl prev_row, %%esi \n\t" */ - /* do Paeth decode for remaining bytes */ - "movl %%ebx, %%edx \n\t" -/*pre "subl bpp, %%edx \n\t" */ /* (bpp is preloaded into ecx) */ - "subl %%ecx, %%edx \n\t" /* edx = ebx - bpp */ - "xorl %%ecx, %%ecx \n\t" /* zero ecx before using cl & cx below */ - - "paeth_lp2: \n\t" - "xorl %%eax, %%eax \n\t" - /* pav = p - a = (a + b - c) - a = b - c */ - "movb (%%esi,%%ebx,), %%al \n\t" /* load Prior(x) into al */ - "movb (%%esi,%%edx,), %%cl \n\t" /* load Prior(x-bpp) into cl */ - "subl %%ecx, %%eax \n\t" /* subtract Prior(x-bpp) */ - "movl %%eax, _patemp \n\t" /* Save pav for later use */ - "xorl %%eax, %%eax \n\t" - /* pbv = p - b = (a + b - c) - b = a - c */ - "movb (%%edi,%%edx,), %%al \n\t" /* load Raw(x-bpp) into al */ - "subl %%ecx, %%eax \n\t" /* subtract Prior(x-bpp) */ - "movl %%eax, %%ecx \n\t" - /* pcv = p - c = (a + b - c) -c = (a - c) + (b - c) = pav + pbv */ - "addl _patemp, %%eax \n\t" /* pcv = pav + pbv */ - /* pc = abs(pcv) */ - "testl $0x80000000, %%eax \n\t" - "jz paeth_pca2 \n\t" - "negl %%eax \n\t" /* reverse sign of neg values */ - - "paeth_pca2: \n\t" - "movl %%eax, _pctemp \n\t" /* save pc for later use */ - /* pb = abs(pbv) */ - "testl $0x80000000, %%ecx \n\t" - "jz paeth_pba2 \n\t" - "negl %%ecx \n\t" /* reverse sign of neg values */ - - "paeth_pba2: \n\t" - "movl %%ecx, _pbtemp \n\t" /* save pb for later use */ - /* pa = abs(pav) */ - "movl _patemp, %%eax \n\t" - "testl $0x80000000, %%eax \n\t" - "jz paeth_paa2 \n\t" - "negl %%eax \n\t" /* reverse sign of neg values */ - - "paeth_paa2: \n\t" - "movl %%eax, _patemp \n\t" /* save pa for later use */ - /* test if pa <= pb */ - "cmpl %%ecx, %%eax \n\t" - "jna paeth_abb2 \n\t" - /* pa > pb; now test if pb <= pc */ - "cmpl _pctemp, %%ecx \n\t" - "jna paeth_bbc2 \n\t" - /* pb > pc; Raw(x) = Paeth(x) + Prior(x-bpp) */ - "movb (%%esi,%%edx,), %%cl \n\t" /* load Prior(x-bpp) into cl */ - "jmp paeth_paeth2 \n\t" - - "paeth_bbc2: \n\t" - /* pb <= pc; Raw(x) = Paeth(x) + Prior(x) */ - "movb (%%esi,%%ebx,), %%cl \n\t" /* load Prior(x) into cl */ - "jmp paeth_paeth2 \n\t" - - "paeth_abb2: \n\t" - /* pa <= pb; now test if pa <= pc */ - "cmpl _pctemp, %%eax \n\t" - "jna paeth_abc2 \n\t" - /* pa > pc; Raw(x) = Paeth(x) + Prior(x-bpp) */ - "movb (%%esi,%%edx,), %%cl \n\t" /* load Prior(x-bpp) into cl */ - "jmp paeth_paeth2 \n\t" - - "paeth_abc2: \n\t" - /* pa <= pc; Raw(x) = Paeth(x) + Raw(x-bpp) */ - "movb (%%edi,%%edx,), %%cl \n\t" /* load Raw(x-bpp) into cl */ - - "paeth_paeth2: \n\t" - "incl %%ebx \n\t" - "incl %%edx \n\t" - /* Raw(x) = (Paeth(x) + Paeth_Predictor( a, b, c )) mod 256 */ - "addb %%cl, -1(%%edi,%%ebx,) \n\t" - "cmpl _FullLength, %%ebx \n\t" - "jb paeth_lp2 \n\t" - - "paeth_end: \n\t" - "EMMS \n\t" /* end MMX; prep for poss. FP instrs. */ -#ifdef __PIC__ - "popl %%ebx \n\t" /* restore index to Global Offset Table */ -#endif - - : "=c" (dummy_value_c), /* output regs (dummy) */ - "=S" (dummy_value_S), - "=D" (dummy_value_D) - - : "0" (bpp), /* ecx // input regs */ - "1" (prev_row), /* esi */ - "2" (row) /* edi */ - - : "%eax", "%edx" /* clobber list (no input regs!) */ -#ifndef __PIC__ - , "%ebx" -#endif - ); - -} /* end png_read_filter_row_mmx_paeth() */ -#endif - - - - -#ifdef PNG_THREAD_UNSAFE_OK -/*===========================================================================*/ -/* */ -/* P N G _ R E A D _ F I L T E R _ R O W _ M M X _ S U B */ -/* */ -/*===========================================================================*/ - -/* Optimized code for PNG Sub filter decoder */ - -static void /* PRIVATE */ -png_read_filter_row_mmx_sub(png_row_infop row_info, png_bytep row) -{ - int bpp; - int dummy_value_a; - int dummy_value_D; - - bpp = (row_info->pixel_depth + 7) >> 3; /* calc number of bytes per pixel */ - _FullLength = row_info->rowbytes - bpp; /* number of bytes to filter */ - - __asm__ __volatile__ ( -/*pre "movl row, %%edi \n\t" */ - "movl %%edi, %%esi \n\t" /* lp = row */ -/*pre "movl bpp, %%eax \n\t" */ - "addl %%eax, %%edi \n\t" /* rp = row + bpp */ -/*irr "xorl %%eax, %%eax \n\t" */ - /* get # of bytes to alignment */ - "movl %%edi, _dif \n\t" /* take start of row */ - "addl $0xf, _dif \n\t" /* add 7 + 8 to incr past */ - /* alignment boundary */ - "xorl %%ecx, %%ecx \n\t" - "andl $0xfffffff8, _dif \n\t" /* mask to alignment boundary */ - "subl %%edi, _dif \n\t" /* subtract from start ==> value */ - "jz sub_go \n\t" /* ecx at alignment */ - - "sub_lp1: \n\t" /* fix alignment */ - "movb (%%esi,%%ecx,), %%al \n\t" - "addb %%al, (%%edi,%%ecx,) \n\t" - "incl %%ecx \n\t" - "cmpl _dif, %%ecx \n\t" - "jb sub_lp1 \n\t" - - "sub_go: \n\t" - "movl _FullLength, %%eax \n\t" - "movl %%eax, %%edx \n\t" - "subl %%ecx, %%edx \n\t" /* subtract alignment fix */ - "andl $0x00000007, %%edx \n\t" /* calc bytes over mult of 8 */ - "subl %%edx, %%eax \n\t" /* drop over bytes from length */ - "movl %%eax, _MMXLength \n\t" - - : "=a" (dummy_value_a), /* 0 // output regs (dummy) */ - "=D" (dummy_value_D) /* 1 */ - - : "0" (bpp), /* eax // input regs */ - "1" (row) /* edi */ - - : "%esi", "%ecx", "%edx" // clobber list - -#if 0 /* MMX regs (%mm0, etc.) not supported by gcc 2.7.2.3 or egcs 1.1 */ - , "%mm0", "%mm1", "%mm2", "%mm3" - , "%mm4", "%mm5", "%mm6", "%mm7" -#endif - ); - - /* now do the math for the rest of the row */ - switch (bpp) - { - case 3: - { - _ActiveMask.use = 0x0000ffffff000000LL; - _ShiftBpp.use = 24; /* == 3 * 8 */ - _ShiftRem.use = 40; /* == 64 - 24 */ - - __asm__ __volatile__ ( -/* preload "movl row, %%edi \n\t" */ - "movq _ActiveMask, %%mm7 \n\t" /* load _ActiveMask for 2nd */ - /* active byte group */ - "movl %%edi, %%esi \n\t" /* lp = row */ -/* preload "movl bpp, %%eax \n\t" */ - "addl %%eax, %%edi \n\t" /* rp = row + bpp */ - "movq %%mm7, %%mm6 \n\t" - "movl _dif, %%edx \n\t" - "psllq _ShiftBpp, %%mm6 \n\t" /* move mask in mm6 to cover */ - /* 3rd active byte group */ - /* prime the pump: load the first Raw(x-bpp) data set */ - "movq -8(%%edi,%%edx,), %%mm1 \n\t" - - "sub_3lp: \n\t" /* shift data for adding first */ - "psrlq _ShiftRem, %%mm1 \n\t" /* bpp bytes (no need for mask; */ - /* shift clears inactive bytes) */ - /* add 1st active group */ - "movq (%%edi,%%edx,), %%mm0 \n\t" - "paddb %%mm1, %%mm0 \n\t" - - /* add 2nd active group */ - "movq %%mm0, %%mm1 \n\t" /* mov updated Raws to mm1 */ - "psllq _ShiftBpp, %%mm1 \n\t" /* shift data to pos. correctly */ - "pand %%mm7, %%mm1 \n\t" /* mask to use 2nd active group */ - "paddb %%mm1, %%mm0 \n\t" - - /* add 3rd active group */ - "movq %%mm0, %%mm1 \n\t" /* mov updated Raws to mm1 */ - "psllq _ShiftBpp, %%mm1 \n\t" /* shift data to pos. correctly */ - "pand %%mm6, %%mm1 \n\t" /* mask to use 3rd active group */ - "addl $8, %%edx \n\t" - "paddb %%mm1, %%mm0 \n\t" - - "cmpl _MMXLength, %%edx \n\t" - "movq %%mm0, -8(%%edi,%%edx,) \n\t" /* write updated Raws to array */ - "movq %%mm0, %%mm1 \n\t" /* prep 1st add at top of loop */ - "jb sub_3lp \n\t" - - : "=a" (dummy_value_a), /* 0 // output regs (dummy) */ - "=D" (dummy_value_D) /* 1 */ - - : "0" (bpp), /* eax // input regs */ - "1" (row) /* edi */ - - : "%edx", "%esi" /* clobber list */ -#if 0 /* MMX regs (%mm0, etc.) not supported by gcc 2.7.2.3 or egcs 1.1 */ - , "%mm0", "%mm1", "%mm6", "%mm7" -#endif - ); - } - break; - - case 1: - { - __asm__ __volatile__ ( - "movl _dif, %%edx \n\t" -/* preload "movl row, %%edi \n\t" */ - "cmpl _FullLength, %%edx \n\t" - "jnb sub_1end \n\t" - "movl %%edi, %%esi \n\t" /* lp = row */ - "xorl %%eax, %%eax \n\t" -/* preload "movl bpp, %%eax \n\t" */ - "addl %%eax, %%edi \n\t" /* rp = row + bpp */ - - "sub_1lp: \n\t" - "movb (%%esi,%%edx,), %%al \n\t" - "addb %%al, (%%edi,%%edx,) \n\t" - "incl %%edx \n\t" - "cmpl _FullLength, %%edx \n\t" - "jb sub_1lp \n\t" - - "sub_1end: \n\t" - - : "=a" (dummy_value_a), /* 0 // output regs (dummy) */ - "=D" (dummy_value_D) /* 1 */ - - : "0" (bpp), /* eax // input regs */ - "1" (row) /* edi */ - - : "%edx", "%esi" /* clobber list */ - ); - } - return; - - case 6: - case 4: - //case 7: /* GRR BOGUS */ - //case 5: /* GRR BOGUS */ - { - _ShiftBpp.use = bpp << 3; - _ShiftRem.use = 64 - _ShiftBpp.use; - - __asm__ __volatile__ ( -/* preload "movl row, %%edi \n\t" */ - "movl _dif, %%edx \n\t" - "movl %%edi, %%esi \n\t" /* lp = row */ -/* preload "movl bpp, %%eax \n\t" */ - "addl %%eax, %%edi \n\t" /* rp = row + bpp */ - - /* prime the pump: load the first Raw(x-bpp) data set */ - "movq -8(%%edi,%%edx,), %%mm1 \n\t" - - "sub_4lp: \n\t" /* shift data for adding first */ - "psrlq _ShiftRem, %%mm1 \n\t" /* bpp bytes (no need for mask; */ - /* shift clears inactive bytes) */ - "movq (%%edi,%%edx,), %%mm0 \n\t" - "paddb %%mm1, %%mm0 \n\t" - - /* add 2nd active group */ - "movq %%mm0, %%mm1 \n\t" /* mov updated Raws to mm1 */ - "psllq _ShiftBpp, %%mm1 \n\t" /* shift data to pos. correctly */ - "addl $8, %%edx \n\t" - "paddb %%mm1, %%mm0 \n\t" - - "cmpl _MMXLength, %%edx \n\t" - "movq %%mm0, -8(%%edi,%%edx,) \n\t" - "movq %%mm0, %%mm1 \n\t" /* prep 1st add at top of loop */ - "jb sub_4lp \n\t" - - : "=a" (dummy_value_a), /* 0 // output regs (dummy) */ - "=D" (dummy_value_D) /* 1 */ - - : "0" (bpp), /* eax // input regs */ - "1" (row) /* edi */ - - : "%edx", "%esi" /* clobber list */ -#if 0 /* MMX regs (%mm0, etc.) not supported by gcc 2.7.2.3 or egcs 1.1 */ - , "%mm0", "%mm1" -#endif - ); - } - break; - - case 2: - { - _ActiveMask.use = 0x00000000ffff0000LL; - _ShiftBpp.use = 16; /* == 2 * 8 */ - _ShiftRem.use = 48; /* == 64 - 16 */ - - __asm__ __volatile__ ( - "movq _ActiveMask, %%mm7 \n\t" /* load _ActiveMask for 2nd */ - /* active byte group */ - "movl _dif, %%edx \n\t" - "movq %%mm7, %%mm6 \n\t" -/* preload "movl row, %%edi \n\t" */ - "psllq _ShiftBpp, %%mm6 \n\t" /* move mask in mm6 to cover */ - /* 3rd active byte group */ - "movl %%edi, %%esi \n\t" /* lp = row */ - "movq %%mm6, %%mm5 \n\t" -/* preload "movl bpp, %%eax \n\t" */ - "addl %%eax, %%edi \n\t" /* rp = row + bpp */ - "psllq _ShiftBpp, %%mm5 \n\t" /* move mask in mm5 to cover */ - /* 4th active byte group */ - /* prime the pump: load the first Raw(x-bpp) data set */ - "movq -8(%%edi,%%edx,), %%mm1 \n\t" - - "sub_2lp: \n\t" /* shift data for adding first */ - "psrlq _ShiftRem, %%mm1 \n\t" /* bpp bytes (no need for mask; */ - /* shift clears inactive bytes) */ - /* add 1st active group */ - "movq (%%edi,%%edx,), %%mm0 \n\t" - "paddb %%mm1, %%mm0 \n\t" - - /* add 2nd active group */ - "movq %%mm0, %%mm1 \n\t" /* mov updated Raws to mm1 */ - "psllq _ShiftBpp, %%mm1 \n\t" /* shift data to pos. correctly */ - "pand %%mm7, %%mm1 \n\t" /* mask to use 2nd active group */ - "paddb %%mm1, %%mm0 \n\t" - - /* add 3rd active group */ - "movq %%mm0, %%mm1 \n\t" /* mov updated Raws to mm1 */ - "psllq _ShiftBpp, %%mm1 \n\t" /* shift data to pos. correctly */ - "pand %%mm6, %%mm1 \n\t" /* mask to use 3rd active group */ - "paddb %%mm1, %%mm0 \n\t" - - /* add 4th active group */ - "movq %%mm0, %%mm1 \n\t" /* mov updated Raws to mm1 */ - "psllq _ShiftBpp, %%mm1 \n\t" /* shift data to pos. correctly */ - "pand %%mm5, %%mm1 \n\t" /* mask to use 4th active group */ - "addl $8, %%edx \n\t" - "paddb %%mm1, %%mm0 \n\t" - "cmpl _MMXLength, %%edx \n\t" - "movq %%mm0, -8(%%edi,%%edx,) \n\t" /* write updated Raws to array */ - "movq %%mm0, %%mm1 \n\t" /* prep 1st add at top of loop */ - "jb sub_2lp \n\t" - - : "=a" (dummy_value_a), /* 0 // output regs (dummy) */ - "=D" (dummy_value_D) /* 1 */ - - : "0" (bpp), /* eax // input regs */ - "1" (row) /* edi */ - - : "%edx", "%esi" /* clobber list */ -#if 0 /* MMX regs (%mm0, etc.) not supported by gcc 2.7.2.3 or egcs 1.1 */ - , "%mm0", "%mm1", "%mm5", "%mm6", "%mm7" -#endif - ); - } - break; - - case 8: - { - __asm__ __volatile__ ( -/* preload "movl row, %%edi \n\t" */ - "movl _dif, %%edx \n\t" - "movl %%edi, %%esi \n\t" /* lp = row */ -/* preload "movl bpp, %%eax \n\t" */ - "addl %%eax, %%edi \n\t" /* rp = row + bpp */ - "movl _MMXLength, %%ecx \n\t" - - /* prime the pump: load the first Raw(x-bpp) data set */ - "movq -8(%%edi,%%edx,), %%mm7 \n\t" - "andl $0x0000003f, %%ecx \n\t" /* calc bytes over mult of 64 */ - - "sub_8lp: \n\t" - "movq (%%edi,%%edx,), %%mm0 \n\t" /* load Sub(x) for 1st 8 bytes */ - "paddb %%mm7, %%mm0 \n\t" - "movq 8(%%edi,%%edx,), %%mm1 \n\t" /* load Sub(x) for 2nd 8 bytes */ - "movq %%mm0, (%%edi,%%edx,) \n\t" /* write Raw(x) for 1st 8 bytes */ - - /* Now mm0 will be used as Raw(x-bpp) for the 2nd group of 8 bytes. */ - /* This will be repeated for each group of 8 bytes with the 8th */ - /* group being used as the Raw(x-bpp) for the 1st group of the */ - /* next loop. */ - - "paddb %%mm0, %%mm1 \n\t" - "movq 16(%%edi,%%edx,), %%mm2 \n\t" /* load Sub(x) for 3rd 8 bytes */ - "movq %%mm1, 8(%%edi,%%edx,) \n\t" /* write Raw(x) for 2nd 8 bytes */ - "paddb %%mm1, %%mm2 \n\t" - "movq 24(%%edi,%%edx,), %%mm3 \n\t" /* load Sub(x) for 4th 8 bytes */ - "movq %%mm2, 16(%%edi,%%edx,) \n\t" /* write Raw(x) for 3rd 8 bytes */ - "paddb %%mm2, %%mm3 \n\t" - "movq 32(%%edi,%%edx,), %%mm4 \n\t" /* load Sub(x) for 5th 8 bytes */ - "movq %%mm3, 24(%%edi,%%edx,) \n\t" /* write Raw(x) for 4th 8 bytes */ - "paddb %%mm3, %%mm4 \n\t" - "movq 40(%%edi,%%edx,), %%mm5 \n\t" /* load Sub(x) for 6th 8 bytes */ - "movq %%mm4, 32(%%edi,%%edx,) \n\t" /* write Raw(x) for 5th 8 bytes */ - "paddb %%mm4, %%mm5 \n\t" - "movq 48(%%edi,%%edx,), %%mm6 \n\t" /* load Sub(x) for 7th 8 bytes */ - "movq %%mm5, 40(%%edi,%%edx,) \n\t" /* write Raw(x) for 6th 8 bytes */ - "paddb %%mm5, %%mm6 \n\t" - "movq 56(%%edi,%%edx,), %%mm7 \n\t" /* load Sub(x) for 8th 8 bytes */ - "movq %%mm6, 48(%%edi,%%edx,) \n\t" /* write Raw(x) for 7th 8 bytes */ - "addl $64, %%edx \n\t" - "paddb %%mm6, %%mm7 \n\t" - "cmpl %%ecx, %%edx \n\t" - "movq %%mm7, -8(%%edi,%%edx,) \n\t" /* write Raw(x) for 8th 8 bytes */ - "jb sub_8lp \n\t" - - "cmpl _MMXLength, %%edx \n\t" - "jnb sub_8lt8 \n\t" - - "sub_8lpA: \n\t" - "movq (%%edi,%%edx,), %%mm0 \n\t" - "addl $8, %%edx \n\t" - "paddb %%mm7, %%mm0 \n\t" - "cmpl _MMXLength, %%edx \n\t" - "movq %%mm0, -8(%%edi,%%edx,) \n\t" /* -8 to offset early addl edx */ - "movq %%mm0, %%mm7 \n\t" /* move calculated Raw(x) data */ - /* to mm1 to be new Raw(x-bpp) */ - /* for next loop */ - "jb sub_8lpA \n\t" - - "sub_8lt8: \n\t" - - : "=a" (dummy_value_a), /* 0 // output regs (dummy) */ - "=D" (dummy_value_D) /* 1 */ - - : "0" (bpp), /* eax // input regs */ - "1" (row) /* edi */ - - : "%ecx", "%edx", "%esi" /* clobber list */ -#if 0 /* MMX regs (%mm0, etc.) not supported by gcc 2.7.2.3 or egcs 1.1 */ - , "%mm0", "%mm1", "%mm2", "%mm3", "%mm4", "%mm5", "%mm6", "%mm7" -#endif - ); - } - break; - - default: /* bpp greater than 8 bytes GRR BOGUS */ - { - __asm__ __volatile__ ( - "movl _dif, %%edx \n\t" -/* preload "movl row, %%edi \n\t" */ - "movl %%edi, %%esi \n\t" /* lp = row */ -/* preload "movl bpp, %%eax \n\t" */ - "addl %%eax, %%edi \n\t" /* rp = row + bpp */ - - "sub_Alp: \n\t" - "movq (%%edi,%%edx,), %%mm0 \n\t" - "movq (%%esi,%%edx,), %%mm1 \n\t" - "addl $8, %%edx \n\t" - "paddb %%mm1, %%mm0 \n\t" - "cmpl _MMXLength, %%edx \n\t" - "movq %%mm0, -8(%%edi,%%edx,) \n\t" /* mov does not affect flags; */ - /* -8 to offset addl edx */ - "jb sub_Alp \n\t" - - : "=a" (dummy_value_a), /* 0 // output regs (dummy) */ - "=D" (dummy_value_D) /* 1 */ - - : "0" (bpp), /* eax // input regs */ - "1" (row) /* edi */ - - : "%edx", "%esi" /* clobber list */ -#if 0 /* MMX regs (%mm0, etc.) not supported by gcc 2.7.2.3 or egcs 1.1 */ - , "%mm0", "%mm1" -#endif - ); - } - break; - - } /* end switch (bpp) */ - - __asm__ __volatile__ ( - "movl _MMXLength, %%edx \n\t" -/* pre "movl row, %%edi \n\t" */ - "cmpl _FullLength, %%edx \n\t" - "jnb sub_end \n\t" - - "movl %%edi, %%esi \n\t" /* lp = row */ -/* pre "movl bpp, %%eax \n\t" */ - "addl %%eax, %%edi \n\t" /* rp = row + bpp */ - "xorl %%eax, %%eax \n\t" - - "sub_lp2: \n\t" - "movb (%%esi,%%edx,), %%al \n\t" - "addb %%al, (%%edi,%%edx,) \n\t" - "incl %%edx \n\t" - "cmpl _FullLength, %%edx \n\t" - "jb sub_lp2 \n\t" - - "sub_end: \n\t" - "EMMS \n\t" /* end MMX instructions */ - - : "=a" (dummy_value_a), /* 0 // output regs (dummy) */ - "=D" (dummy_value_D) /* 1 */ - - : "0" (bpp), /* eax // input regs */ - "1" (row) /* edi */ - - : "%edx", "%esi" /* clobber list */ - ); - -} /* end of png_read_filter_row_mmx_sub() */ -#endif - - - - -/*===========================================================================*/ -/* */ -/* P N G _ R E A D _ F I L T E R _ R O W _ M M X _ U P */ -/* */ -/*===========================================================================*/ - -/* Optimized code for PNG Up filter decoder */ - -static void /* PRIVATE */ -png_read_filter_row_mmx_up(png_row_infop row_info, png_bytep row, - png_bytep prev_row) -{ - png_uint_32 len; - int dummy_value_d; /* fix 'forbidden register 3 (dx) was spilled' error */ - int dummy_value_S; - int dummy_value_D; - - len = row_info->rowbytes; /* number of bytes to filter */ - - __asm__ __volatile__ ( -/* pre "movl row, %%edi \n\t" */ - /* get # of bytes to alignment */ -#ifdef __PIC__ - "pushl %%ebx \n\t" -#endif - "movl %%edi, %%ecx \n\t" - "xorl %%ebx, %%ebx \n\t" - "addl $0x7, %%ecx \n\t" - "xorl %%eax, %%eax \n\t" - "andl $0xfffffff8, %%ecx \n\t" -/* pre "movl prev_row, %%esi \n\t" */ - "subl %%edi, %%ecx \n\t" - "jz up_go \n\t" - - "up_lp1: \n\t" /* fix alignment */ - "movb (%%edi,%%ebx,), %%al \n\t" - "addb (%%esi,%%ebx,), %%al \n\t" - "incl %%ebx \n\t" - "cmpl %%ecx, %%ebx \n\t" - "movb %%al, -1(%%edi,%%ebx,) \n\t" /* mov does not affect flags; -1 to */ - "jb up_lp1 \n\t" /* offset incl ebx */ - - "up_go: \n\t" -/* pre "movl len, %%edx \n\t" */ - "movl %%edx, %%ecx \n\t" - "subl %%ebx, %%edx \n\t" /* subtract alignment fix */ - "andl $0x0000003f, %%edx \n\t" /* calc bytes over mult of 64 */ - "subl %%edx, %%ecx \n\t" /* drop over bytes from length */ - - /* unrolled loop - use all MMX registers and interleave to reduce */ - /* number of branch instructions (loops) and reduce partial stalls */ - "up_loop: \n\t" - "movq (%%esi,%%ebx,), %%mm1 \n\t" - "movq (%%edi,%%ebx,), %%mm0 \n\t" - "movq 8(%%esi,%%ebx,), %%mm3 \n\t" - "paddb %%mm1, %%mm0 \n\t" - "movq 8(%%edi,%%ebx,), %%mm2 \n\t" - "movq %%mm0, (%%edi,%%ebx,) \n\t" - "paddb %%mm3, %%mm2 \n\t" - "movq 16(%%esi,%%ebx,), %%mm5 \n\t" - "movq %%mm2, 8(%%edi,%%ebx,) \n\t" - "movq 16(%%edi,%%ebx,), %%mm4 \n\t" - "movq 24(%%esi,%%ebx,), %%mm7 \n\t" - "paddb %%mm5, %%mm4 \n\t" - "movq 24(%%edi,%%ebx,), %%mm6 \n\t" - "movq %%mm4, 16(%%edi,%%ebx,) \n\t" - "paddb %%mm7, %%mm6 \n\t" - "movq 32(%%esi,%%ebx,), %%mm1 \n\t" - "movq %%mm6, 24(%%edi,%%ebx,) \n\t" - "movq 32(%%edi,%%ebx,), %%mm0 \n\t" - "movq 40(%%esi,%%ebx,), %%mm3 \n\t" - "paddb %%mm1, %%mm0 \n\t" - "movq 40(%%edi,%%ebx,), %%mm2 \n\t" - "movq %%mm0, 32(%%edi,%%ebx,) \n\t" - "paddb %%mm3, %%mm2 \n\t" - "movq 48(%%esi,%%ebx,), %%mm5 \n\t" - "movq %%mm2, 40(%%edi,%%ebx,) \n\t" - "movq 48(%%edi,%%ebx,), %%mm4 \n\t" - "movq 56(%%esi,%%ebx,), %%mm7 \n\t" - "paddb %%mm5, %%mm4 \n\t" - "movq 56(%%edi,%%ebx,), %%mm6 \n\t" - "movq %%mm4, 48(%%edi,%%ebx,) \n\t" - "addl $64, %%ebx \n\t" - "paddb %%mm7, %%mm6 \n\t" - "cmpl %%ecx, %%ebx \n\t" - "movq %%mm6, -8(%%edi,%%ebx,) \n\t" /* (+56)movq does not affect flags; */ - "jb up_loop \n\t" /* -8 to offset addl ebx */ - - "cmpl $0, %%edx \n\t" /* test for bytes over mult of 64 */ - "jz up_end \n\t" - - "cmpl $8, %%edx \n\t" /* test for less than 8 bytes */ - "jb up_lt8 \n\t" /* [added by lcreeve@netins.net] */ - - "addl %%edx, %%ecx \n\t" - "andl $0x00000007, %%edx \n\t" /* calc bytes over mult of 8 */ - "subl %%edx, %%ecx \n\t" /* drop over bytes from length */ - "jz up_lt8 \n\t" - - "up_lpA: \n\t" /* use MMX regs to update 8 bytes sim. */ - "movq (%%esi,%%ebx,), %%mm1 \n\t" - "movq (%%edi,%%ebx,), %%mm0 \n\t" - "addl $8, %%ebx \n\t" - "paddb %%mm1, %%mm0 \n\t" - "cmpl %%ecx, %%ebx \n\t" - "movq %%mm0, -8(%%edi,%%ebx,) \n\t" /* movq does not affect flags; -8 to */ - "jb up_lpA \n\t" /* offset add ebx */ - "cmpl $0, %%edx \n\t" /* test for bytes over mult of 8 */ - "jz up_end \n\t" - - "up_lt8: \n\t" - "xorl %%eax, %%eax \n\t" - "addl %%edx, %%ecx \n\t" /* move over byte count into counter */ - - "up_lp2: \n\t" /* use x86 regs for remaining bytes */ - "movb (%%edi,%%ebx,), %%al \n\t" - "addb (%%esi,%%ebx,), %%al \n\t" - "incl %%ebx \n\t" - "cmpl %%ecx, %%ebx \n\t" - "movb %%al, -1(%%edi,%%ebx,) \n\t" /* mov does not affect flags; -1 to */ - "jb up_lp2 \n\t" /* offset inc ebx */ - - "up_end: \n\t" - "EMMS \n\t" /* conversion of filtered row complete */ -#ifdef __PIC__ - "popl %%ebx \n\t" -#endif - - : "=d" (dummy_value_d), /* 0 // output regs (dummy) */ - "=S" (dummy_value_S), /* 1 */ - "=D" (dummy_value_D) /* 2 */ - - : "0" (len), /* edx // input regs */ - "1" (prev_row), /* esi */ - "2" (row) /* edi */ - - : "%eax", "%ecx" // clobber list (no input regs!) -#ifndef __PIC__ - , "%ebx" -#endif - -#if 0 /* MMX regs (%mm0, etc.) not supported by gcc 2.7.2.3 or egcs 1.1 */ - , "%mm0", "%mm1", "%mm2", "%mm3" - , "%mm4", "%mm5", "%mm6", "%mm7" -#endif - ); - -} /* end of png_read_filter_row_mmx_up() */ - -#endif /* PNG_ASSEMBLER_CODE_SUPPORTED */ - - - - -/*===========================================================================*/ -/* */ -/* P N G _ R E A D _ F I L T E R _ R O W */ -/* */ -/*===========================================================================*/ - - -/* Optimized png_read_filter_row routines */ - -void /* PRIVATE */ -png_read_filter_row(png_structp png_ptr, png_row_infop row_info, png_bytep - row, png_bytep prev_row, int filter) -{ -#ifdef PNG_DEBUG - char filnm[10]; -#endif - -#if defined(PNG_ASSEMBLER_CODE_SUPPORTED) -/* GRR: these are superseded by png_ptr->asm_flags: */ -#define UseMMX_sub 1 /* GRR: converted 20000730 */ -#define UseMMX_up 1 /* GRR: converted 20000729 */ -#define UseMMX_avg 1 /* GRR: converted 20000828 (+ 16-bit bugfix 20000916) */ -#define UseMMX_paeth 1 /* GRR: converted 20000828 */ - - if (_mmx_supported == 2) { - /* this should have happened in png_init_mmx_flags() already */ -#if !defined(PNG_1_0_X) - png_warning(png_ptr, "asm_flags may not have been initialized"); -#endif - png_mmx_support(); - } -#endif /* PNG_ASSEMBLER_CODE_SUPPORTED */ - -#ifdef PNG_DEBUG - png_debug(1, "in png_read_filter_row (pnggccrd.c)\n"); - switch (filter) - { - case 0: sprintf(filnm, "none"); - break; - case 1: sprintf(filnm, "sub-%s", -#if defined(PNG_ASSEMBLER_CODE_SUPPORTED) && defined(PNG_THREAD_UNSAFE_OK) -#if !defined(PNG_1_0_X) - (png_ptr->asm_flags & PNG_ASM_FLAG_MMX_READ_FILTER_SUB)? "MMX" : -#endif -#endif -"x86"); - break; - case 2: sprintf(filnm, "up-%s", -#ifdef PNG_ASSEMBLER_CODE_SUPPORTED -#if !defined(PNG_1_0_X) - (png_ptr->asm_flags & PNG_ASM_FLAG_MMX_READ_FILTER_UP)? "MMX" : -#endif -#endif - "x86"); - break; - case 3: sprintf(filnm, "avg-%s", -#if defined(PNG_ASSEMBLER_CODE_SUPPORTED) && defined(PNG_THREAD_UNSAFE_OK) -#if !defined(PNG_1_0_X) - (png_ptr->asm_flags & PNG_ASM_FLAG_MMX_READ_FILTER_AVG)? "MMX" : -#endif -#endif - "x86"); - break; - case 4: sprintf(filnm, "Paeth-%s", -#if defined(PNG_ASSEMBLER_CODE_SUPPORTED) && defined(PNG_THREAD_UNSAFE_OK) -#if !defined(PNG_1_0_X) - (png_ptr->asm_flags & PNG_ASM_FLAG_MMX_READ_FILTER_PAETH)? "MMX": -#endif -#endif -"x86"); - break; - default: sprintf(filnm, "unknw"); - break; - } - png_debug2(0, "row_number=%5ld, %5s, ", png_ptr->row_number, filnm); - png_debug1(0, "row=0x%08lx, ", (unsigned long)row); - png_debug2(0, "pixdepth=%2d, bytes=%d, ", (int)row_info->pixel_depth, - (int)((row_info->pixel_depth + 7) >> 3)); - png_debug1(0,"rowbytes=%8ld\n", row_info->rowbytes); -#endif /* PNG_DEBUG */ - - switch (filter) - { - case PNG_FILTER_VALUE_NONE: - break; - - case PNG_FILTER_VALUE_SUB: -#if defined(PNG_ASSEMBLER_CODE_SUPPORTED) && defined(PNG_THREAD_UNSAFE_OK) -#if !defined(PNG_1_0_X) - if ((png_ptr->asm_flags & PNG_ASM_FLAG_MMX_READ_FILTER_SUB) && - (row_info->pixel_depth >= png_ptr->mmx_bitdepth_threshold) && - (row_info->rowbytes >= png_ptr->mmx_rowbytes_threshold)) -#else - if (_mmx_supported) -#endif - { - png_read_filter_row_mmx_sub(row_info, row); - } - else -#endif /* PNG_ASSEMBLER_CODE_SUPPORTED */ - { - png_uint_32 i; - png_uint_32 istop = row_info->rowbytes; - png_uint_32 bpp = (row_info->pixel_depth + 7) >> 3; - png_bytep rp = row + bpp; - png_bytep lp = row; - - for (i = bpp; i < istop; i++) - { - *rp = (png_byte)(((int)(*rp) + (int)(*lp++)) & 0xff); - rp++; - } - } /* end !UseMMX_sub */ - break; - - case PNG_FILTER_VALUE_UP: -#if defined(PNG_ASSEMBLER_CODE_SUPPORTED) -#if !defined(PNG_1_0_X) - if ((png_ptr->asm_flags & PNG_ASM_FLAG_MMX_READ_FILTER_UP) && - (row_info->pixel_depth >= png_ptr->mmx_bitdepth_threshold) && - (row_info->rowbytes >= png_ptr->mmx_rowbytes_threshold)) -#else - if (_mmx_supported) -#endif - { - png_read_filter_row_mmx_up(row_info, row, prev_row); - } - else -#endif /* PNG_ASSEMBLER_CODE_SUPPORTED */ - { - png_uint_32 i; - png_uint_32 istop = row_info->rowbytes; - png_bytep rp = row; - png_bytep pp = prev_row; - - for (i = 0; i < istop; ++i) - { - *rp = (png_byte)(((int)(*rp) + (int)(*pp++)) & 0xff); - rp++; - } - } /* end !UseMMX_up */ - break; - - case PNG_FILTER_VALUE_AVG: -#if defined(PNG_ASSEMBLER_CODE_SUPPORTED) && defined(PNG_THREAD_UNSAFE_OK) -#if !defined(PNG_1_0_X) - if ((png_ptr->asm_flags & PNG_ASM_FLAG_MMX_READ_FILTER_AVG) && - (row_info->pixel_depth >= png_ptr->mmx_bitdepth_threshold) && - (row_info->rowbytes >= png_ptr->mmx_rowbytes_threshold)) -#else - if (_mmx_supported) -#endif - { - png_read_filter_row_mmx_avg(row_info, row, prev_row); - } - else -#endif /* PNG_ASSEMBLER_CODE_SUPPORTED */ - { - png_uint_32 i; - png_bytep rp = row; - png_bytep pp = prev_row; - png_bytep lp = row; - png_uint_32 bpp = (row_info->pixel_depth + 7) >> 3; - png_uint_32 istop = row_info->rowbytes - bpp; - - for (i = 0; i < bpp; i++) - { - *rp = (png_byte)(((int)(*rp) + - ((int)(*pp++) >> 1)) & 0xff); - rp++; - } - - for (i = 0; i < istop; i++) - { - *rp = (png_byte)(((int)(*rp) + - ((int)(*pp++ + *lp++) >> 1)) & 0xff); - rp++; - } - } /* end !UseMMX_avg */ - break; - - case PNG_FILTER_VALUE_PAETH: -#if defined(PNG_ASSEMBLER_CODE_SUPPORTED) && defined(PNG_THREAD_UNSAFE_OK) -#if !defined(PNG_1_0_X) - if ((png_ptr->asm_flags & PNG_ASM_FLAG_MMX_READ_FILTER_PAETH) && - (row_info->pixel_depth >= png_ptr->mmx_bitdepth_threshold) && - (row_info->rowbytes >= png_ptr->mmx_rowbytes_threshold)) -#else - if (_mmx_supported) -#endif - { - png_read_filter_row_mmx_paeth(row_info, row, prev_row); - } - else -#endif /* PNG_ASSEMBLER_CODE_SUPPORTED */ - { - png_uint_32 i; - png_bytep rp = row; - png_bytep pp = prev_row; - png_bytep lp = row; - png_bytep cp = prev_row; - png_uint_32 bpp = (row_info->pixel_depth + 7) >> 3; - png_uint_32 istop = row_info->rowbytes - bpp; - - for (i = 0; i < bpp; i++) - { - *rp = (png_byte)(((int)(*rp) + (int)(*pp++)) & 0xff); - rp++; - } - - for (i = 0; i < istop; i++) /* use leftover rp,pp */ - { - int a, b, c, pa, pb, pc, p; - - a = *lp++; - b = *pp++; - c = *cp++; - - p = b - c; - pc = a - c; - -#ifdef PNG_USE_ABS - pa = abs(p); - pb = abs(pc); - pc = abs(p + pc); -#else - pa = p < 0 ? -p : p; - pb = pc < 0 ? -pc : pc; - pc = (p + pc) < 0 ? -(p + pc) : p + pc; -#endif - - /* - if (pa <= pb && pa <= pc) - p = a; - else if (pb <= pc) - p = b; - else - p = c; - */ - - p = (pa <= pb && pa <= pc) ? a : (pb <= pc) ? b : c; - - *rp = (png_byte)(((int)(*rp) + p) & 0xff); - rp++; - } - } /* end !UseMMX_paeth */ - break; - - default: - png_warning(png_ptr, "Ignoring bad row-filter type"); - *row=0; - break; - } -} - -#endif /* PNG_HAVE_ASSEMBLER_READ_FILTER_ROW */ - - -/*===========================================================================*/ -/* */ -/* P N G _ M M X _ S U P P O R T */ -/* */ -/*===========================================================================*/ - -/* GRR NOTES: (1) the following code assumes 386 or better (pushfl/popfl) - * (2) all instructions compile with gcc 2.7.2.3 and later - * (3) the function is moved down here to prevent gcc from - * inlining it in multiple places and then barfing be- - * cause the ".NOT_SUPPORTED" label is multiply defined - * [is there a way to signal that a *single* function should - * not be inlined? is there a way to modify the label for - * each inlined instance, e.g., by appending _1, _2, etc.? - * maybe if don't use leading "." in label name? (nope...sigh)] - */ - -int PNGAPI -png_mmx_support(void) -{ -#if defined(PNG_MMX_CODE_SUPPORTED) - __asm__ __volatile__ ( - "pushl %%ebx \n\t" // ebx gets clobbered by CPUID instruction - "pushl %%ecx \n\t" // so does ecx... - "pushl %%edx \n\t" // ...and edx (but ecx & edx safe on Linux) -// ".byte 0x66 \n\t" // convert 16-bit pushf to 32-bit pushfd -// "pushf \n\t" // 16-bit pushf - "pushfl \n\t" // save Eflag to stack - "popl %%eax \n\t" // get Eflag from stack into eax - "movl %%eax, %%ecx \n\t" // make another copy of Eflag in ecx - "xorl $0x200000, %%eax \n\t" // toggle ID bit in Eflag (i.e., bit 21) - "pushl %%eax \n\t" // save modified Eflag back to stack -// ".byte 0x66 \n\t" // convert 16-bit popf to 32-bit popfd -// "popf \n\t" // 16-bit popf - "popfl \n\t" // restore modified value to Eflag reg - "pushfl \n\t" // save Eflag to stack - "popl %%eax \n\t" // get Eflag from stack - "pushl %%ecx \n\t" // save original Eflag to stack - "popfl \n\t" // restore original Eflag - "xorl %%ecx, %%eax \n\t" // compare new Eflag with original Eflag - "jz 0f \n\t" // if same, CPUID instr. is not supported - - "xorl %%eax, %%eax \n\t" // set eax to zero -// ".byte 0x0f, 0xa2 \n\t" // CPUID instruction (two-byte opcode) - "cpuid \n\t" // get the CPU identification info - "cmpl $1, %%eax \n\t" // make sure eax return non-zero value - "jl 0f \n\t" // if eax is zero, MMX is not supported - - "xorl %%eax, %%eax \n\t" // set eax to zero and... - "incl %%eax \n\t" // ...increment eax to 1. This pair is - // faster than the instruction "mov eax, 1" - "cpuid \n\t" // get the CPU identification info again - "andl $0x800000, %%edx \n\t" // mask out all bits but MMX bit (23) - "cmpl $0, %%edx \n\t" // 0 = MMX not supported - "jz 0f \n\t" // non-zero = yes, MMX IS supported - - "movl $1, %%eax \n\t" // set return value to 1 - "jmp 1f \n\t" // DONE: have MMX support - - "0: \n\t" // .NOT_SUPPORTED: target label for jump instructions - "movl $0, %%eax \n\t" // set return value to 0 - "1: \n\t" // .RETURN: target label for jump instructions - "movl %%eax, _mmx_supported \n\t" // save in global static variable, too - "popl %%edx \n\t" // restore edx - "popl %%ecx \n\t" // restore ecx - "popl %%ebx \n\t" // restore ebx - -// "ret \n\t" // DONE: no MMX support - // (fall through to standard C "ret") - - : // output list (none) - - : // any variables used on input (none) - - : "%eax" // clobber list -// , "%ebx", "%ecx", "%edx" // GRR: we handle these manually -// , "memory" // if write to a variable gcc thought was in a reg -// , "cc" // "condition codes" (flag bits) - ); -#else - _mmx_supported = 0; -#endif /* PNG_MMX_CODE_SUPPORTED */ - - return _mmx_supported; -} - - -#endif /* PNG_USE_PNGGCCRD */ diff --git a/wxWidgets/src/png/pngget.c b/wxWidgets/src/png/pngget.c deleted file mode 100644 index 1d1cc218bd..0000000000 --- a/wxWidgets/src/png/pngget.c +++ /dev/null @@ -1,934 +0,0 @@ - -/* pngget.c - retrieval of values from info struct - * - * libpng 1.2.7 - September 12, 2004 - * For conditions of distribution and use, see copyright notice in png.h - * Copyright (c) 1998-2004 Glenn Randers-Pehrson - * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) - * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) - */ - -#define PNG_INTERNAL -#include "png.h" - -png_uint_32 PNGAPI -png_get_valid(png_structp png_ptr, png_infop info_ptr, png_uint_32 flag) -{ - if (png_ptr != NULL && info_ptr != NULL) - return(info_ptr->valid & flag); - else - return(0); -} - -png_uint_32 PNGAPI -png_get_rowbytes(png_structp png_ptr, png_infop info_ptr) -{ - if (png_ptr != NULL && info_ptr != NULL) - return(info_ptr->rowbytes); - else - return(0); -} - -#if defined(PNG_INFO_IMAGE_SUPPORTED) -png_bytepp PNGAPI -png_get_rows(png_structp png_ptr, png_infop info_ptr) -{ - if (png_ptr != NULL && info_ptr != NULL) - return(info_ptr->row_pointers); - else - return(0); -} -#endif - -#ifdef PNG_EASY_ACCESS_SUPPORTED -/* easy access to info, added in libpng-0.99 */ -png_uint_32 PNGAPI -png_get_image_width(png_structp png_ptr, png_infop info_ptr) -{ - if (png_ptr != NULL && info_ptr != NULL) - { - return info_ptr->width; - } - return (0); -} - -png_uint_32 PNGAPI -png_get_image_height(png_structp png_ptr, png_infop info_ptr) -{ - if (png_ptr != NULL && info_ptr != NULL) - { - return info_ptr->height; - } - return (0); -} - -png_byte PNGAPI -png_get_bit_depth(png_structp png_ptr, png_infop info_ptr) -{ - if (png_ptr != NULL && info_ptr != NULL) - { - return info_ptr->bit_depth; - } - return (0); -} - -png_byte PNGAPI -png_get_color_type(png_structp png_ptr, png_infop info_ptr) -{ - if (png_ptr != NULL && info_ptr != NULL) - { - return info_ptr->color_type; - } - return (0); -} - -png_byte PNGAPI -png_get_filter_type(png_structp png_ptr, png_infop info_ptr) -{ - if (png_ptr != NULL && info_ptr != NULL) - { - return info_ptr->filter_type; - } - return (0); -} - -png_byte PNGAPI -png_get_interlace_type(png_structp png_ptr, png_infop info_ptr) -{ - if (png_ptr != NULL && info_ptr != NULL) - { - return info_ptr->interlace_type; - } - return (0); -} - -png_byte PNGAPI -png_get_compression_type(png_structp png_ptr, png_infop info_ptr) -{ - if (png_ptr != NULL && info_ptr != NULL) - { - return info_ptr->compression_type; - } - return (0); -} - -png_uint_32 PNGAPI -png_get_x_pixels_per_meter(png_structp png_ptr, png_infop info_ptr) -{ - if (png_ptr != NULL && info_ptr != NULL) -#if defined(PNG_pHYs_SUPPORTED) - if (info_ptr->valid & PNG_INFO_pHYs) - { - png_debug1(1, "in %s retrieval function\n", "png_get_x_pixels_per_meter"); - if(info_ptr->phys_unit_type != PNG_RESOLUTION_METER) - return (0); - else return (info_ptr->x_pixels_per_unit); - } -#else - return (0); -#endif - return (0); -} - -png_uint_32 PNGAPI -png_get_y_pixels_per_meter(png_structp png_ptr, png_infop info_ptr) -{ - if (png_ptr != NULL && info_ptr != NULL) -#if defined(PNG_pHYs_SUPPORTED) - if (info_ptr->valid & PNG_INFO_pHYs) - { - png_debug1(1, "in %s retrieval function\n", "png_get_y_pixels_per_meter"); - if(info_ptr->phys_unit_type != PNG_RESOLUTION_METER) - return (0); - else return (info_ptr->y_pixels_per_unit); - } -#else - return (0); -#endif - return (0); -} - -png_uint_32 PNGAPI -png_get_pixels_per_meter(png_structp png_ptr, png_infop info_ptr) -{ - if (png_ptr != NULL && info_ptr != NULL) -#if defined(PNG_pHYs_SUPPORTED) - if (info_ptr->valid & PNG_INFO_pHYs) - { - png_debug1(1, "in %s retrieval function\n", "png_get_pixels_per_meter"); - if(info_ptr->phys_unit_type != PNG_RESOLUTION_METER || - info_ptr->x_pixels_per_unit != info_ptr->y_pixels_per_unit) - return (0); - else return (info_ptr->x_pixels_per_unit); - } -#else - return (0); -#endif - return (0); -} - -#ifdef PNG_FLOATING_POINT_SUPPORTED -float PNGAPI -png_get_pixel_aspect_ratio(png_structp png_ptr, png_infop info_ptr) - { - if (png_ptr != NULL && info_ptr != NULL) -#if defined(PNG_pHYs_SUPPORTED) - if (info_ptr->valid & PNG_INFO_pHYs) - { - png_debug1(1, "in %s retrieval function\n", "png_get_aspect_ratio"); - if (info_ptr->x_pixels_per_unit == 0) - return ((float)0.0); - else - return ((float)((float)info_ptr->y_pixels_per_unit - /(float)info_ptr->x_pixels_per_unit)); - } -#else - return (0.0); -#endif - return ((float)0.0); -} -#endif - -png_int_32 PNGAPI -png_get_x_offset_microns(png_structp png_ptr, png_infop info_ptr) -{ - if (png_ptr != NULL && info_ptr != NULL) -#if defined(PNG_oFFs_SUPPORTED) - if (info_ptr->valid & PNG_INFO_oFFs) - { - png_debug1(1, "in %s retrieval function\n", "png_get_x_offset_microns"); - if(info_ptr->offset_unit_type != PNG_OFFSET_MICROMETER) - return (0); - else return (info_ptr->x_offset); - } -#else - return (0); -#endif - return (0); -} - -png_int_32 PNGAPI -png_get_y_offset_microns(png_structp png_ptr, png_infop info_ptr) -{ - if (png_ptr != NULL && info_ptr != NULL) -#if defined(PNG_oFFs_SUPPORTED) - if (info_ptr->valid & PNG_INFO_oFFs) - { - png_debug1(1, "in %s retrieval function\n", "png_get_y_offset_microns"); - if(info_ptr->offset_unit_type != PNG_OFFSET_MICROMETER) - return (0); - else return (info_ptr->y_offset); - } -#else - return (0); -#endif - return (0); -} - -png_int_32 PNGAPI -png_get_x_offset_pixels(png_structp png_ptr, png_infop info_ptr) -{ - if (png_ptr != NULL && info_ptr != NULL) -#if defined(PNG_oFFs_SUPPORTED) - if (info_ptr->valid & PNG_INFO_oFFs) - { - png_debug1(1, "in %s retrieval function\n", "png_get_x_offset_microns"); - if(info_ptr->offset_unit_type != PNG_OFFSET_PIXEL) - return (0); - else return (info_ptr->x_offset); - } -#else - return (0); -#endif - return (0); -} - -png_int_32 PNGAPI -png_get_y_offset_pixels(png_structp png_ptr, png_infop info_ptr) -{ - if (png_ptr != NULL && info_ptr != NULL) -#if defined(PNG_oFFs_SUPPORTED) - if (info_ptr->valid & PNG_INFO_oFFs) - { - png_debug1(1, "in %s retrieval function\n", "png_get_y_offset_microns"); - if(info_ptr->offset_unit_type != PNG_OFFSET_PIXEL) - return (0); - else return (info_ptr->y_offset); - } -#else - return (0); -#endif - return (0); -} - -#if defined(PNG_INCH_CONVERSIONS) && defined(PNG_FLOATING_POINT_SUPPORTED) -png_uint_32 PNGAPI -png_get_pixels_per_inch(png_structp png_ptr, png_infop info_ptr) -{ - return ((png_uint_32)((float)png_get_pixels_per_meter(png_ptr, info_ptr) - *.0254 +.5)); -} - -png_uint_32 PNGAPI -png_get_x_pixels_per_inch(png_structp png_ptr, png_infop info_ptr) -{ - return ((png_uint_32)((float)png_get_x_pixels_per_meter(png_ptr, info_ptr) - *.0254 +.5)); -} - -png_uint_32 PNGAPI -png_get_y_pixels_per_inch(png_structp png_ptr, png_infop info_ptr) -{ - return ((png_uint_32)((float)png_get_y_pixels_per_meter(png_ptr, info_ptr) - *.0254 +.5)); -} - -float PNGAPI -png_get_x_offset_inches(png_structp png_ptr, png_infop info_ptr) -{ - return ((float)png_get_x_offset_microns(png_ptr, info_ptr) - *.00003937); -} - -float PNGAPI -png_get_y_offset_inches(png_structp png_ptr, png_infop info_ptr) -{ - return ((float)png_get_y_offset_microns(png_ptr, info_ptr) - *.00003937); -} - -#if defined(PNG_pHYs_SUPPORTED) -png_uint_32 PNGAPI -png_get_pHYs_dpi(png_structp png_ptr, png_infop info_ptr, - png_uint_32 *res_x, png_uint_32 *res_y, int *unit_type) -{ - png_uint_32 retval = 0; - - if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_pHYs)) - { - png_debug1(1, "in %s retrieval function\n", "pHYs"); - if (res_x != NULL) - { - *res_x = info_ptr->x_pixels_per_unit; - retval |= PNG_INFO_pHYs; - } - if (res_y != NULL) - { - *res_y = info_ptr->y_pixels_per_unit; - retval |= PNG_INFO_pHYs; - } - if (unit_type != NULL) - { - *unit_type = (int)info_ptr->phys_unit_type; - retval |= PNG_INFO_pHYs; - if(*unit_type == 1) - { - if (res_x != NULL) *res_x = (png_uint_32)(*res_x * .0254 + .50); - if (res_y != NULL) *res_y = (png_uint_32)(*res_y * .0254 + .50); - } - } - } - return (retval); -} -#endif /* PNG_pHYs_SUPPORTED */ -#endif /* PNG_INCH_CONVERSIONS && PNG_FLOATING_POINT_SUPPORTED */ - -/* png_get_channels really belongs in here, too, but it's been around longer */ - -#endif /* PNG_EASY_ACCESS_SUPPORTED */ - -png_byte PNGAPI -png_get_channels(png_structp png_ptr, png_infop info_ptr) -{ - if (png_ptr != NULL && info_ptr != NULL) - return(info_ptr->channels); - else - return (0); -} - -png_bytep PNGAPI -png_get_signature(png_structp png_ptr, png_infop info_ptr) -{ - if (png_ptr != NULL && info_ptr != NULL) - return(info_ptr->signature); - else - return (NULL); -} - -#if defined(PNG_bKGD_SUPPORTED) -png_uint_32 PNGAPI -png_get_bKGD(png_structp png_ptr, png_infop info_ptr, - png_color_16p *background) -{ - if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_bKGD) - && background != NULL) - { - png_debug1(1, "in %s retrieval function\n", "bKGD"); - *background = &(info_ptr->background); - return (PNG_INFO_bKGD); - } - return (0); -} -#endif - -#if defined(PNG_cHRM_SUPPORTED) -#ifdef PNG_FLOATING_POINT_SUPPORTED -png_uint_32 PNGAPI -png_get_cHRM(png_structp png_ptr, png_infop info_ptr, - double *white_x, double *white_y, double *red_x, double *red_y, - double *green_x, double *green_y, double *blue_x, double *blue_y) -{ - if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_cHRM)) - { - png_debug1(1, "in %s retrieval function\n", "cHRM"); - if (white_x != NULL) - *white_x = (double)info_ptr->x_white; - if (white_y != NULL) - *white_y = (double)info_ptr->y_white; - if (red_x != NULL) - *red_x = (double)info_ptr->x_red; - if (red_y != NULL) - *red_y = (double)info_ptr->y_red; - if (green_x != NULL) - *green_x = (double)info_ptr->x_green; - if (green_y != NULL) - *green_y = (double)info_ptr->y_green; - if (blue_x != NULL) - *blue_x = (double)info_ptr->x_blue; - if (blue_y != NULL) - *blue_y = (double)info_ptr->y_blue; - return (PNG_INFO_cHRM); - } - return (0); -} -#endif -#ifdef PNG_FIXED_POINT_SUPPORTED -png_uint_32 PNGAPI -png_get_cHRM_fixed(png_structp png_ptr, png_infop info_ptr, - png_fixed_point *white_x, png_fixed_point *white_y, png_fixed_point *red_x, - png_fixed_point *red_y, png_fixed_point *green_x, png_fixed_point *green_y, - png_fixed_point *blue_x, png_fixed_point *blue_y) -{ - if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_cHRM)) - { - png_debug1(1, "in %s retrieval function\n", "cHRM"); - if (white_x != NULL) - *white_x = info_ptr->int_x_white; - if (white_y != NULL) - *white_y = info_ptr->int_y_white; - if (red_x != NULL) - *red_x = info_ptr->int_x_red; - if (red_y != NULL) - *red_y = info_ptr->int_y_red; - if (green_x != NULL) - *green_x = info_ptr->int_x_green; - if (green_y != NULL) - *green_y = info_ptr->int_y_green; - if (blue_x != NULL) - *blue_x = info_ptr->int_x_blue; - if (blue_y != NULL) - *blue_y = info_ptr->int_y_blue; - return (PNG_INFO_cHRM); - } - return (0); -} -#endif -#endif - -#if defined(PNG_gAMA_SUPPORTED) -#ifdef PNG_FLOATING_POINT_SUPPORTED -png_uint_32 PNGAPI -png_get_gAMA(png_structp png_ptr, png_infop info_ptr, double *file_gamma) -{ - if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_gAMA) - && file_gamma != NULL) - { - png_debug1(1, "in %s retrieval function\n", "gAMA"); - *file_gamma = (double)info_ptr->gamma; - return (PNG_INFO_gAMA); - } - return (0); -} -#endif -#ifdef PNG_FIXED_POINT_SUPPORTED -png_uint_32 PNGAPI -png_get_gAMA_fixed(png_structp png_ptr, png_infop info_ptr, - png_fixed_point *int_file_gamma) -{ - if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_gAMA) - && int_file_gamma != NULL) - { - png_debug1(1, "in %s retrieval function\n", "gAMA"); - *int_file_gamma = info_ptr->int_gamma; - return (PNG_INFO_gAMA); - } - return (0); -} -#endif -#endif - -#if defined(PNG_sRGB_SUPPORTED) -png_uint_32 PNGAPI -png_get_sRGB(png_structp png_ptr, png_infop info_ptr, int *file_srgb_intent) -{ - if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_sRGB) - && file_srgb_intent != NULL) - { - png_debug1(1, "in %s retrieval function\n", "sRGB"); - *file_srgb_intent = (int)info_ptr->srgb_intent; - return (PNG_INFO_sRGB); - } - return (0); -} -#endif - -#if defined(PNG_iCCP_SUPPORTED) -png_uint_32 PNGAPI -png_get_iCCP(png_structp png_ptr, png_infop info_ptr, - png_charpp name, int *compression_type, - png_charpp profile, png_uint_32 *proflen) -{ - if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_iCCP) - && name != NULL && profile != NULL && proflen != NULL) - { - png_debug1(1, "in %s retrieval function\n", "iCCP"); - *name = info_ptr->iccp_name; - *profile = info_ptr->iccp_profile; - /* compression_type is a dummy so the API won't have to change - if we introduce multiple compression types later. */ - *proflen = (int)info_ptr->iccp_proflen; - *compression_type = (int)info_ptr->iccp_compression; - return (PNG_INFO_iCCP); - } - return (0); -} -#endif - -#if defined(PNG_sPLT_SUPPORTED) -png_uint_32 PNGAPI -png_get_sPLT(png_structp png_ptr, png_infop info_ptr, - png_sPLT_tpp spalettes) -{ - if (png_ptr != NULL && info_ptr != NULL && spalettes != NULL) - *spalettes = info_ptr->splt_palettes; - return ((png_uint_32)info_ptr->splt_palettes_num); -} -#endif - -#if defined(PNG_hIST_SUPPORTED) -png_uint_32 PNGAPI -png_get_hIST(png_structp png_ptr, png_infop info_ptr, png_uint_16p *hist) -{ - if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_hIST) - && hist != NULL) - { - png_debug1(1, "in %s retrieval function\n", "hIST"); - *hist = info_ptr->hist; - return (PNG_INFO_hIST); - } - return (0); -} -#endif - -png_uint_32 PNGAPI -png_get_IHDR(png_structp png_ptr, png_infop info_ptr, - png_uint_32 *width, png_uint_32 *height, int *bit_depth, - int *color_type, int *interlace_type, int *compression_type, - int *filter_type) - -{ - if (png_ptr != NULL && info_ptr != NULL && width != NULL && height != NULL && - bit_depth != NULL && color_type != NULL) - { - png_debug1(1, "in %s retrieval function\n", "IHDR"); - *width = info_ptr->width; - *height = info_ptr->height; - *bit_depth = info_ptr->bit_depth; - if (info_ptr->bit_depth < 1 || info_ptr->bit_depth > 16) - png_error(png_ptr, "Invalid bit depth"); - *color_type = info_ptr->color_type; - if (info_ptr->color_type > 6) - png_error(png_ptr, "Invalid color type"); - if (compression_type != NULL) - *compression_type = info_ptr->compression_type; - if (filter_type != NULL) - *filter_type = info_ptr->filter_type; - if (interlace_type != NULL) - *interlace_type = info_ptr->interlace_type; - - /* check for potential overflow of rowbytes */ - if (width == 0 || *width > PNG_UINT_31_MAX) - png_error(png_ptr, "Invalid image width"); - if (height == 0 || *height > PNG_UINT_31_MAX) - png_error(png_ptr, "Invalid image height"); - if (info_ptr->width > (PNG_UINT_32_MAX - >> 3) /* 8-byte RGBA pixels */ - - 64 /* bigrowbuf hack */ - - 1 /* filter byte */ - - 7*8 /* rounding of width to multiple of 8 pixels */ - - 8) /* extra max_pixel_depth pad */ - { - png_warning(png_ptr, - "Width too large for libpng to process image data."); - } - return (1); - } - return (0); -} - -#if defined(PNG_oFFs_SUPPORTED) -png_uint_32 PNGAPI -png_get_oFFs(png_structp png_ptr, png_infop info_ptr, - png_int_32 *offset_x, png_int_32 *offset_y, int *unit_type) -{ - if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_oFFs) - && offset_x != NULL && offset_y != NULL && unit_type != NULL) - { - png_debug1(1, "in %s retrieval function\n", "oFFs"); - *offset_x = info_ptr->x_offset; - *offset_y = info_ptr->y_offset; - *unit_type = (int)info_ptr->offset_unit_type; - return (PNG_INFO_oFFs); - } - return (0); -} -#endif - -#if defined(PNG_pCAL_SUPPORTED) -png_uint_32 PNGAPI -png_get_pCAL(png_structp png_ptr, png_infop info_ptr, - png_charp *purpose, png_int_32 *X0, png_int_32 *X1, int *type, int *nparams, - png_charp *units, png_charpp *params) -{ - if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_pCAL) - && purpose != NULL && X0 != NULL && X1 != NULL && type != NULL && - nparams != NULL && units != NULL && params != NULL) - { - png_debug1(1, "in %s retrieval function\n", "pCAL"); - *purpose = info_ptr->pcal_purpose; - *X0 = info_ptr->pcal_X0; - *X1 = info_ptr->pcal_X1; - *type = (int)info_ptr->pcal_type; - *nparams = (int)info_ptr->pcal_nparams; - *units = info_ptr->pcal_units; - *params = info_ptr->pcal_params; - return (PNG_INFO_pCAL); - } - return (0); -} -#endif - -#if defined(PNG_sCAL_SUPPORTED) -#ifdef PNG_FLOATING_POINT_SUPPORTED -png_uint_32 PNGAPI -png_get_sCAL(png_structp png_ptr, png_infop info_ptr, - int *unit, double *width, double *height) -{ - if (png_ptr != NULL && info_ptr != NULL && - (info_ptr->valid & PNG_INFO_sCAL)) - { - *unit = info_ptr->scal_unit; - *width = info_ptr->scal_pixel_width; - *height = info_ptr->scal_pixel_height; - return (PNG_INFO_sCAL); - } - return(0); -} -#else -#ifdef PNG_FIXED_POINT_SUPPORTED -png_uint_32 PNGAPI -png_get_sCAL_s(png_structp png_ptr, png_infop info_ptr, - int *unit, png_charpp width, png_charpp height) -{ - if (png_ptr != NULL && info_ptr != NULL && - (info_ptr->valid & PNG_INFO_sCAL)) - { - *unit = info_ptr->scal_unit; - *width = info_ptr->scal_s_width; - *height = info_ptr->scal_s_height; - return (PNG_INFO_sCAL); - } - return(0); -} -#endif -#endif -#endif - -#if defined(PNG_pHYs_SUPPORTED) -png_uint_32 PNGAPI -png_get_pHYs(png_structp png_ptr, png_infop info_ptr, - png_uint_32 *res_x, png_uint_32 *res_y, int *unit_type) -{ - png_uint_32 retval = 0; - - if (png_ptr != NULL && info_ptr != NULL && - (info_ptr->valid & PNG_INFO_pHYs)) - { - png_debug1(1, "in %s retrieval function\n", "pHYs"); - if (res_x != NULL) - { - *res_x = info_ptr->x_pixels_per_unit; - retval |= PNG_INFO_pHYs; - } - if (res_y != NULL) - { - *res_y = info_ptr->y_pixels_per_unit; - retval |= PNG_INFO_pHYs; - } - if (unit_type != NULL) - { - *unit_type = (int)info_ptr->phys_unit_type; - retval |= PNG_INFO_pHYs; - } - } - return (retval); -} -#endif - -png_uint_32 PNGAPI -png_get_PLTE(png_structp png_ptr, png_infop info_ptr, png_colorp *palette, - int *num_palette) -{ - if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_PLTE) - && palette != NULL) - { - png_debug1(1, "in %s retrieval function\n", "PLTE"); - *palette = info_ptr->palette; - *num_palette = info_ptr->num_palette; - png_debug1(3, "num_palette = %d\n", *num_palette); - return (PNG_INFO_PLTE); - } - return (0); -} - -#if defined(PNG_sBIT_SUPPORTED) -png_uint_32 PNGAPI -png_get_sBIT(png_structp png_ptr, png_infop info_ptr, png_color_8p *sig_bit) -{ - if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_sBIT) - && sig_bit != NULL) - { - png_debug1(1, "in %s retrieval function\n", "sBIT"); - *sig_bit = &(info_ptr->sig_bit); - return (PNG_INFO_sBIT); - } - return (0); -} -#endif - -#if defined(PNG_TEXT_SUPPORTED) -png_uint_32 PNGAPI -png_get_text(png_structp png_ptr, png_infop info_ptr, png_textp *text_ptr, - int *num_text) -{ - if (png_ptr != NULL && info_ptr != NULL && info_ptr->num_text > 0) - { - png_debug1(1, "in %s retrieval function\n", - (png_ptr->chunk_name[0] == '\0' ? "text" - : (png_const_charp)png_ptr->chunk_name)); - if (text_ptr != NULL) - *text_ptr = info_ptr->text; - if (num_text != NULL) - *num_text = info_ptr->num_text; - return ((png_uint_32)info_ptr->num_text); - } - if (num_text != NULL) - *num_text = 0; - return(0); -} -#endif - -#if defined(PNG_tIME_SUPPORTED) -png_uint_32 PNGAPI -png_get_tIME(png_structp png_ptr, png_infop info_ptr, png_timep *mod_time) -{ - if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_tIME) - && mod_time != NULL) - { - png_debug1(1, "in %s retrieval function\n", "tIME"); - *mod_time = &(info_ptr->mod_time); - return (PNG_INFO_tIME); - } - return (0); -} -#endif - -#if defined(PNG_tRNS_SUPPORTED) -png_uint_32 PNGAPI -png_get_tRNS(png_structp png_ptr, png_infop info_ptr, - png_bytep *trans, int *num_trans, png_color_16p *trans_values) -{ - png_uint_32 retval = 0; - if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_tRNS)) - { - png_debug1(1, "in %s retrieval function\n", "tRNS"); - if (info_ptr->color_type == PNG_COLOR_TYPE_PALETTE) - { - if (trans != NULL) - { - *trans = info_ptr->trans; - retval |= PNG_INFO_tRNS; - } - if (trans_values != NULL) - *trans_values = &(info_ptr->trans_values); - } - else /* if (info_ptr->color_type != PNG_COLOR_TYPE_PALETTE) */ - { - if (trans_values != NULL) - { - *trans_values = &(info_ptr->trans_values); - retval |= PNG_INFO_tRNS; - } - if(trans != NULL) - *trans = NULL; - } - if(num_trans != NULL) - { - *num_trans = info_ptr->num_trans; - retval |= PNG_INFO_tRNS; - } - } - return (retval); -} -#endif - -#if defined(PNG_UNKNOWN_CHUNKS_SUPPORTED) -png_uint_32 PNGAPI -png_get_unknown_chunks(png_structp png_ptr, png_infop info_ptr, - png_unknown_chunkpp unknowns) -{ - if (png_ptr != NULL && info_ptr != NULL && unknowns != NULL) - *unknowns = info_ptr->unknown_chunks; - return ((png_uint_32)info_ptr->unknown_chunks_num); -} -#endif - -#if defined(PNG_READ_RGB_TO_GRAY_SUPPORTED) -png_byte PNGAPI -png_get_rgb_to_gray_status (png_structp png_ptr) -{ - return (png_byte)(png_ptr? png_ptr->rgb_to_gray_status : 0); -} -#endif - -#if defined(PNG_USER_CHUNKS_SUPPORTED) -png_voidp PNGAPI -png_get_user_chunk_ptr(png_structp png_ptr) -{ - return (png_ptr? png_ptr->user_chunk_ptr : NULL); -} -#endif - -#ifdef PNG_WRITE_SUPPORTED -png_uint_32 PNGAPI -png_get_compression_buffer_size(png_structp png_ptr) -{ - return (png_uint_32)(png_ptr? png_ptr->zbuf_size : 0L); -} -#endif - -#ifndef PNG_1_0_X -#ifdef PNG_ASSEMBLER_CODE_SUPPORTED -/* this function was added to libpng 1.2.0 and should exist by default */ -png_uint_32 PNGAPI -png_get_asm_flags (png_structp png_ptr) -{ - return (png_uint_32)(png_ptr? png_ptr->asm_flags : 0L); -} - -/* this function was added to libpng 1.2.0 and should exist by default */ -png_uint_32 PNGAPI -png_get_asm_flagmask (int flag_select) -{ - png_uint_32 settable_asm_flags = 0; - - if (flag_select & PNG_SELECT_READ) - settable_asm_flags |= - PNG_ASM_FLAG_MMX_READ_COMBINE_ROW | - PNG_ASM_FLAG_MMX_READ_INTERLACE | - PNG_ASM_FLAG_MMX_READ_FILTER_SUB | - PNG_ASM_FLAG_MMX_READ_FILTER_UP | - PNG_ASM_FLAG_MMX_READ_FILTER_AVG | - PNG_ASM_FLAG_MMX_READ_FILTER_PAETH ; - /* no non-MMX flags yet */ - -#if 0 - /* GRR: no write-flags yet, either, but someday... */ - if (flag_select & PNG_SELECT_WRITE) - settable_asm_flags |= - PNG_ASM_FLAG_MMX_WRITE_ [whatever] ; -#endif /* 0 */ - - return settable_asm_flags; /* _theoretically_ settable capabilities only */ -} -#endif /* PNG_ASSEMBLER_CODE_SUPPORTED */ - - -#if defined(PNG_ASSEMBLER_CODE_SUPPORTED) - /* GRR: could add this: && defined(PNG_MMX_CODE_SUPPORTED) */ -/* this function was added to libpng 1.2.0 */ -png_uint_32 PNGAPI -png_get_mmx_flagmask (int flag_select, int *compilerID) -{ - png_uint_32 settable_mmx_flags = 0; - - if (flag_select & PNG_SELECT_READ) - settable_mmx_flags |= - PNG_ASM_FLAG_MMX_READ_COMBINE_ROW | - PNG_ASM_FLAG_MMX_READ_INTERLACE | - PNG_ASM_FLAG_MMX_READ_FILTER_SUB | - PNG_ASM_FLAG_MMX_READ_FILTER_UP | - PNG_ASM_FLAG_MMX_READ_FILTER_AVG | - PNG_ASM_FLAG_MMX_READ_FILTER_PAETH ; -#if 0 - /* GRR: no MMX write support yet, but someday... */ - if (flag_select & PNG_SELECT_WRITE) - settable_mmx_flags |= - PNG_ASM_FLAG_MMX_WRITE_ [whatever] ; -#endif /* 0 */ - - if (compilerID != NULL) { -#ifdef PNG_USE_PNGVCRD - *compilerID = 1; /* MSVC */ -#else -#ifdef PNG_USE_PNGGCCRD - *compilerID = 2; /* gcc/gas */ -#else - *compilerID = -1; /* unknown (i.e., no asm/MMX code compiled) */ -#endif -#endif - } - - return settable_mmx_flags; /* _theoretically_ settable capabilities only */ -} - -/* this function was added to libpng 1.2.0 */ -png_byte PNGAPI -png_get_mmx_bitdepth_threshold (png_structp png_ptr) -{ - return (png_byte)(png_ptr? png_ptr->mmx_bitdepth_threshold : 0); -} - -/* this function was added to libpng 1.2.0 */ -png_uint_32 PNGAPI -png_get_mmx_rowbytes_threshold (png_structp png_ptr) -{ - return (png_uint_32)(png_ptr? png_ptr->mmx_rowbytes_threshold : 0L); -} -#endif /* ?PNG_ASSEMBLER_CODE_SUPPORTED */ - -#ifdef PNG_SET_USER_LIMITS_SUPPORTED -/* these functions were added to libpng 1.2.6 */ -png_uint_32 PNGAPI -png_get_user_width_max (png_structp png_ptr) -{ - return (png_ptr? png_ptr->user_width_max : 0); -} -png_uint_32 PNGAPI -png_get_user_height_max (png_structp png_ptr) -{ - return (png_ptr? png_ptr->user_height_max : 0); -} -#endif /* ?PNG_SET_USER_LIMITS_SUPPORTED */ - -#endif /* ?PNG_1_0_X */ diff --git a/wxWidgets/src/png/pngmem.c b/wxWidgets/src/png/pngmem.c deleted file mode 100644 index 2682394ab7..0000000000 --- a/wxWidgets/src/png/pngmem.c +++ /dev/null @@ -1,595 +0,0 @@ - -/* pngmem.c - stub functions for memory allocation - * - * libpng version 1.2.7 - September 12, 2004 - * For conditions of distribution and use, see copyright notice in png.h - * Copyright (c) 1998-2004 Glenn Randers-Pehrson - * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) - * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) - * - * This file provides a location for all memory allocation. Users who - * need special memory handling are expected to supply replacement - * functions for png_malloc() and png_free(), and to use - * png_create_read_struct_2() and png_create_write_struct_2() to - * identify the replacement functions. - */ - -#define PNG_INTERNAL -#include "png.h" - -/* Borland DOS special memory handler */ -#if defined(__TURBOC__) && !defined(_Windows) && !defined(__FLAT__) -/* if you change this, be sure to change the one in png.h also */ - -/* Allocate memory for a png_struct. The malloc and memset can be replaced - by a single call to calloc() if this is thought to improve performance. */ -png_voidp /* PRIVATE */ -png_create_struct(int type) -{ -#ifdef PNG_USER_MEM_SUPPORTED - return (png_create_struct_2(type, png_malloc_ptr_NULL, png_voidp_NULL)); -} - -/* Alternate version of png_create_struct, for use with user-defined malloc. */ -png_voidp /* PRIVATE */ -png_create_struct_2(int type, png_malloc_ptr malloc_fn, png_voidp mem_ptr) -{ -#endif /* PNG_USER_MEM_SUPPORTED */ - png_size_t size; - png_voidp struct_ptr; - - if (type == PNG_STRUCT_INFO) - size = png_sizeof(png_info); - else if (type == PNG_STRUCT_PNG) - size = png_sizeof(png_struct); - else - return (png_get_copyright(NULL)); - -#ifdef PNG_USER_MEM_SUPPORTED - if(malloc_fn != NULL) - { - png_struct dummy_struct; - png_structp png_ptr = &dummy_struct; - png_ptr->mem_ptr=mem_ptr; - struct_ptr = (*(malloc_fn))(png_ptr, (png_uint_32)size); - } - else -#endif /* PNG_USER_MEM_SUPPORTED */ - struct_ptr = (png_voidp)farmalloc(size); - if (struct_ptr != NULL) - png_memset(struct_ptr, 0, size); - return (struct_ptr); -} - -/* Free memory allocated by a png_create_struct() call */ -void /* PRIVATE */ -png_destroy_struct(png_voidp struct_ptr) -{ -#ifdef PNG_USER_MEM_SUPPORTED - png_destroy_struct_2(struct_ptr, png_free_ptr_NULL, png_voidp_NULL); -} - -/* Free memory allocated by a png_create_struct() call */ -void /* PRIVATE */ -png_destroy_struct_2(png_voidp struct_ptr, png_free_ptr free_fn, - png_voidp mem_ptr) -{ -#endif - if (struct_ptr != NULL) - { -#ifdef PNG_USER_MEM_SUPPORTED - if(free_fn != NULL) - { - png_struct dummy_struct; - png_structp png_ptr = &dummy_struct; - png_ptr->mem_ptr=mem_ptr; - (*(free_fn))(png_ptr, struct_ptr); - return; - } -#endif /* PNG_USER_MEM_SUPPORTED */ - farfree (struct_ptr); - } -} - -/* Allocate memory. For reasonable files, size should never exceed - * 64K. However, zlib may allocate more then 64K if you don't tell - * it not to. See zconf.h and png.h for more information. zlib does - * need to allocate exactly 64K, so whatever you call here must - * have the ability to do that. - * - * Borland seems to have a problem in DOS mode for exactly 64K. - * It gives you a segment with an offset of 8 (perhaps to store its - * memory stuff). zlib doesn't like this at all, so we have to - * detect and deal with it. This code should not be needed in - * Windows or OS/2 modes, and only in 16 bit mode. This code has - * been updated by Alexander Lehmann for version 0.89 to waste less - * memory. - * - * Note that we can't use png_size_t for the "size" declaration, - * since on some systems a png_size_t is a 16-bit quantity, and as a - * result, we would be truncating potentially larger memory requests - * (which should cause a fatal error) and introducing major problems. - */ - -png_voidp PNGAPI -png_malloc(png_structp png_ptr, png_uint_32 size) -{ - png_voidp ret; - - if (png_ptr == NULL || size == 0) - return (NULL); - -#ifdef PNG_USER_MEM_SUPPORTED - if(png_ptr->malloc_fn != NULL) - ret = ((png_voidp)(*(png_ptr->malloc_fn))(png_ptr, (png_size_t)size)); - else - ret = (png_malloc_default(png_ptr, size)); - if (ret == NULL && (png_ptr->flags&PNG_FLAG_MALLOC_NULL_MEM_OK) == 0) - png_error(png_ptr, "Out of memory!"); - return (ret); -} - -png_voidp PNGAPI -png_malloc_default(png_structp png_ptr, png_uint_32 size) -{ - png_voidp ret; -#endif /* PNG_USER_MEM_SUPPORTED */ - -#ifdef PNG_MAX_MALLOC_64K - if (size > (png_uint_32)65536L) - { - png_warning(png_ptr, "Cannot Allocate > 64K"); - ret = NULL; - } - else -#endif - - if (size != (size_t)size) - ret = NULL; - else if (size == (png_uint_32)65536L) - { - if (png_ptr->offset_table == NULL) - { - /* try to see if we need to do any of this fancy stuff */ - ret = farmalloc(size); - if (ret == NULL || ((png_size_t)ret & 0xffff)) - { - int num_blocks; - png_uint_32 total_size; - png_bytep table; - int i; - png_byte huge * hptr; - - if (ret != NULL) - { - farfree(ret); - ret = NULL; - } - - if(png_ptr->zlib_window_bits > 14) - num_blocks = (int)(1 << (png_ptr->zlib_window_bits - 14)); - else - num_blocks = 1; - if (png_ptr->zlib_mem_level >= 7) - num_blocks += (int)(1 << (png_ptr->zlib_mem_level - 7)); - else - num_blocks++; - - total_size = ((png_uint_32)65536L) * (png_uint_32)num_blocks+16; - - table = farmalloc(total_size); - - if (table == NULL) - { -#ifndef PNG_USER_MEM_SUPPORTED - if ((png_ptr->flags&PNG_FLAG_MALLOC_NULL_MEM_OK) == 0) - png_error(png_ptr, "Out Of Memory."); /* Note "O" and "M" */ - else - png_warning(png_ptr, "Out Of Memory."); -#endif - return (NULL); - } - - if ((png_size_t)table & 0xfff0) - { -#ifndef PNG_USER_MEM_SUPPORTED - if ((png_ptr->flags&PNG_FLAG_MALLOC_NULL_MEM_OK) == 0) - png_error(png_ptr, - "Farmalloc didn't return normalized pointer"); - else - png_warning(png_ptr, - "Farmalloc didn't return normalized pointer"); -#endif - return (NULL); - } - - png_ptr->offset_table = table; - png_ptr->offset_table_ptr = farmalloc(num_blocks * - png_sizeof (png_bytep)); - - if (png_ptr->offset_table_ptr == NULL) - { -#ifndef PNG_USER_MEM_SUPPORTED - if ((png_ptr->flags&PNG_FLAG_MALLOC_NULL_MEM_OK) == 0) - png_error(png_ptr, "Out Of memory."); /* Note "O" and "M" */ - else - png_warning(png_ptr, "Out Of memory."); -#endif - return (NULL); - } - - hptr = (png_byte huge *)table; - if ((png_size_t)hptr & 0xf) - { - hptr = (png_byte huge *)((long)(hptr) & 0xfffffff0L); - hptr = hptr + 16L; /* "hptr += 16L" fails on Turbo C++ 3.0 */ - } - for (i = 0; i < num_blocks; i++) - { - png_ptr->offset_table_ptr[i] = (png_bytep)hptr; - hptr = hptr + (png_uint_32)65536L; /* "+=" fails on TC++3.0 */ - } - - png_ptr->offset_table_number = num_blocks; - png_ptr->offset_table_count = 0; - png_ptr->offset_table_count_free = 0; - } - } - - if (png_ptr->offset_table_count >= png_ptr->offset_table_number) - { -#ifndef PNG_USER_MEM_SUPPORTED - if ((png_ptr->flags&PNG_FLAG_MALLOC_NULL_MEM_OK) == 0) - png_error(png_ptr, "Out of Memory."); /* Note "o" and "M" */ - else - png_warning(png_ptr, "Out of Memory."); -#endif - return (NULL); - } - - ret = png_ptr->offset_table_ptr[png_ptr->offset_table_count++]; - } - else - ret = farmalloc(size); - -#ifndef PNG_USER_MEM_SUPPORTED - if (ret == NULL) - { - if ((png_ptr->flags&PNG_FLAG_MALLOC_NULL_MEM_OK) == 0) - png_error(png_ptr, "Out of memory."); /* Note "o" and "m" */ - else - png_warning(png_ptr, "Out of memory."); /* Note "o" and "m" */ - } -#endif - - return (ret); -} - -/* free a pointer allocated by png_malloc(). In the default - configuration, png_ptr is not used, but is passed in case it - is needed. If ptr is NULL, return without taking any action. */ -void PNGAPI -png_free(png_structp png_ptr, png_voidp ptr) -{ - if (png_ptr == NULL || ptr == NULL) - return; - -#ifdef PNG_USER_MEM_SUPPORTED - if (png_ptr->free_fn != NULL) - { - (*(png_ptr->free_fn))(png_ptr, ptr); - return; - } - else png_free_default(png_ptr, ptr); -} - -void PNGAPI -png_free_default(png_structp png_ptr, png_voidp ptr) -{ -#endif /* PNG_USER_MEM_SUPPORTED */ - - if (png_ptr->offset_table != NULL) - { - int i; - - for (i = 0; i < png_ptr->offset_table_count; i++) - { - if (ptr == png_ptr->offset_table_ptr[i]) - { - ptr = NULL; - png_ptr->offset_table_count_free++; - break; - } - } - if (png_ptr->offset_table_count_free == png_ptr->offset_table_count) - { - farfree(png_ptr->offset_table); - farfree(png_ptr->offset_table_ptr); - png_ptr->offset_table = NULL; - png_ptr->offset_table_ptr = NULL; - } - } - - if (ptr != NULL) - { - farfree(ptr); - } -} - -#else /* Not the Borland DOS special memory handler */ - -/* Allocate memory for a png_struct or a png_info. The malloc and - memset can be replaced by a single call to calloc() if this is thought - to improve performance noticably. */ -png_voidp /* PRIVATE */ -png_create_struct(int type) -{ -#ifdef PNG_USER_MEM_SUPPORTED - return (png_create_struct_2(type, png_malloc_ptr_NULL, png_voidp_NULL)); -} - -/* Allocate memory for a png_struct or a png_info. The malloc and - memset can be replaced by a single call to calloc() if this is thought - to improve performance noticably. */ -png_voidp /* PRIVATE */ -png_create_struct_2(int type, png_malloc_ptr malloc_fn, png_voidp mem_ptr) -{ -#endif /* PNG_USER_MEM_SUPPORTED */ - png_size_t size; - png_voidp struct_ptr; - - if (type == PNG_STRUCT_INFO) - size = png_sizeof(png_info); - else if (type == PNG_STRUCT_PNG) - size = png_sizeof(png_struct); - else - return (NULL); - -#ifdef PNG_USER_MEM_SUPPORTED - if(malloc_fn != NULL) - { - png_struct dummy_struct; - png_structp png_ptr = &dummy_struct; - png_ptr->mem_ptr=mem_ptr; - struct_ptr = (*(malloc_fn))(png_ptr, size); - if (struct_ptr != NULL) - png_memset(struct_ptr, 0, size); - return (struct_ptr); - } -#endif /* PNG_USER_MEM_SUPPORTED */ - -#if defined(__TURBOC__) && !defined(__FLAT__) - struct_ptr = (png_voidp)farmalloc(size); -#else -# if defined(_MSC_VER) && defined(MAXSEG_64K) - struct_ptr = (png_voidp)halloc(size,1); -# else - struct_ptr = (png_voidp)malloc(size); -# endif -#endif - if (struct_ptr != NULL) - png_memset(struct_ptr, 0, size); - - return (struct_ptr); -} - - -/* Free memory allocated by a png_create_struct() call */ -void /* PRIVATE */ -png_destroy_struct(png_voidp struct_ptr) -{ -#ifdef PNG_USER_MEM_SUPPORTED - png_destroy_struct_2(struct_ptr, png_free_ptr_NULL, png_voidp_NULL); -} - -/* Free memory allocated by a png_create_struct() call */ -void /* PRIVATE */ -png_destroy_struct_2(png_voidp struct_ptr, png_free_ptr free_fn, - png_voidp mem_ptr) -{ -#endif /* PNG_USER_MEM_SUPPORTED */ - if (struct_ptr != NULL) - { -#ifdef PNG_USER_MEM_SUPPORTED - if(free_fn != NULL) - { - png_struct dummy_struct; - png_structp png_ptr = &dummy_struct; - png_ptr->mem_ptr=mem_ptr; - (*(free_fn))(png_ptr, struct_ptr); - return; - } -#endif /* PNG_USER_MEM_SUPPORTED */ -#if defined(__TURBOC__) && !defined(__FLAT__) - farfree(struct_ptr); -#else -# if defined(_MSC_VER) && defined(MAXSEG_64K) - hfree(struct_ptr); -# else - free(struct_ptr); -# endif -#endif - } -} - -/* Allocate memory. For reasonable files, size should never exceed - 64K. However, zlib may allocate more then 64K if you don't tell - it not to. See zconf.h and png.h for more information. zlib does - need to allocate exactly 64K, so whatever you call here must - have the ability to do that. */ - -png_voidp PNGAPI -png_malloc(png_structp png_ptr, png_uint_32 size) -{ - png_voidp ret; - -#ifdef PNG_USER_MEM_SUPPORTED - if (png_ptr == NULL || size == 0) - return (NULL); - - if(png_ptr->malloc_fn != NULL) - ret = ((png_voidp)(*(png_ptr->malloc_fn))(png_ptr, (png_size_t)size)); - else - ret = (png_malloc_default(png_ptr, size)); - if (ret == NULL && (png_ptr->flags&PNG_FLAG_MALLOC_NULL_MEM_OK) == 0) - png_error(png_ptr, "Out of Memory!"); - return (ret); -} - -png_voidp PNGAPI -png_malloc_default(png_structp png_ptr, png_uint_32 size) -{ - png_voidp ret; -#endif /* PNG_USER_MEM_SUPPORTED */ - - if (png_ptr == NULL || size == 0) - return (NULL); - -#ifdef PNG_MAX_MALLOC_64K - if (size > (png_uint_32)65536L) - { -#ifndef PNG_USER_MEM_SUPPORTED - if(png_ptr->flags&PNG_FLAG_MALLOC_NULL_MEM_OK) == 0) - png_error(png_ptr, "Cannot Allocate > 64K"); - else -#endif - return NULL; - } -#endif - - /* Check for overflow */ -#if defined(__TURBOC__) && !defined(__FLAT__) - if (size != (unsigned long)size) - ret = NULL; - else - ret = farmalloc(size); -#else -# if defined(_MSC_VER) && defined(MAXSEG_64K) - if (size != (unsigned long)size) - ret = NULL; - else - ret = halloc(size, 1); -# else - if (size != (size_t)size) - ret = NULL; - else - ret = malloc((size_t)size); -# endif -#endif - -#ifndef PNG_USER_MEM_SUPPORTED - if (ret == NULL && (png_ptr->flags&PNG_FLAG_MALLOC_NULL_MEM_OK) == 0) - png_error(png_ptr, "Out of Memory"); -#endif - - return (ret); -} - -/* Free a pointer allocated by png_malloc(). If ptr is NULL, return - without taking any action. */ -void PNGAPI -png_free(png_structp png_ptr, png_voidp ptr) -{ - if (png_ptr == NULL || ptr == NULL) - return; - -#ifdef PNG_USER_MEM_SUPPORTED - if (png_ptr->free_fn != NULL) - { - (*(png_ptr->free_fn))(png_ptr, ptr); - return; - } - else png_free_default(png_ptr, ptr); -} -void PNGAPI -png_free_default(png_structp png_ptr, png_voidp ptr) -{ - if (png_ptr == NULL || ptr == NULL) - return; - -#endif /* PNG_USER_MEM_SUPPORTED */ - -#if defined(__TURBOC__) && !defined(__FLAT__) - farfree(ptr); -#else -# if defined(_MSC_VER) && defined(MAXSEG_64K) - hfree(ptr); -# else - free(ptr); -# endif -#endif -} - -#endif /* Not Borland DOS special memory handler */ - -#if defined(PNG_1_0_X) -# define png_malloc_warn png_malloc -#else -/* This function was added at libpng version 1.2.3. The png_malloc_warn() - * function will set up png_malloc() to issue a png_warning and return NULL - * instead of issuing a png_error, if it fails to allocate the requested - * memory. - */ -png_voidp PNGAPI -png_malloc_warn(png_structp png_ptr, png_uint_32 size) -{ - png_voidp ptr; - png_uint_32 save_flags=png_ptr->flags; - - png_ptr->flags|=PNG_FLAG_MALLOC_NULL_MEM_OK; - ptr = (png_voidp)png_malloc((png_structp)png_ptr, size); - png_ptr->flags=save_flags; - return(ptr); -} -#endif - -png_voidp PNGAPI -png_memcpy_check (png_structp png_ptr, png_voidp s1, png_voidp s2, - png_uint_32 length) -{ - png_size_t size; - - size = (png_size_t)length; - if ((png_uint_32)size != length) - png_error(png_ptr,"Overflow in png_memcpy_check."); - - return(png_memcpy (s1, s2, size)); -} - -png_voidp PNGAPI -png_memset_check (png_structp png_ptr, png_voidp s1, int value, - png_uint_32 length) -{ - png_size_t size; - - size = (png_size_t)length; - if ((png_uint_32)size != length) - png_error(png_ptr,"Overflow in png_memset_check."); - - return (png_memset (s1, value, size)); - -} - -#ifdef PNG_USER_MEM_SUPPORTED -/* This function is called when the application wants to use another method - * of allocating and freeing memory. - */ -void PNGAPI -png_set_mem_fn(png_structp png_ptr, png_voidp mem_ptr, png_malloc_ptr - malloc_fn, png_free_ptr free_fn) -{ - png_ptr->mem_ptr = mem_ptr; - png_ptr->malloc_fn = malloc_fn; - png_ptr->free_fn = free_fn; -} - -/* This function returns a pointer to the mem_ptr associated with the user - * functions. The application should free any memory associated with this - * pointer before png_write_destroy and png_read_destroy are called. - */ -png_voidp PNGAPI -png_get_mem_ptr(png_structp png_ptr) -{ - return ((png_voidp)png_ptr->mem_ptr); -} -#endif /* PNG_USER_MEM_SUPPORTED */ diff --git a/wxWidgets/src/png/pngnow.png b/wxWidgets/src/png/pngnow.png deleted file mode 100644 index 82793ebddb7863266a66ffc6ab2c01ca32100808..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2069 zcmWkudpuN&7T#yD z0ALXk%;6bOV2GtAMuxod+KXid08{XL`q<{m10|OLLYbYp~ zqD01zCx~Qa;aTH3$83tYNL5@^&dW%qu3E?~lv;*N57-E2|bs(K#(iIEOmeFx% zkcfvMOG`)&LHQ673#pIPl0s5bu0h@0>CO<}7a`Ws2_Xc#K~M$^F+q|Eqco5dLWna2 z#X^t(LKqoD8nRJmzN=KPsmsFupvRG!&XgFV8A;Y6t95Zm1LFa^q z^92erLk2B|aULIYLrE_dC!DV+A~6Qa3B~AUAmL0W(=n6@Y2+%tkPyj9RsagyA*csN zrps7?xTc~3G=mlSYRm(ZDb=D31>#001TxH*!;$k@LY&S-QNy%At*T6qc|mvuj(MT{ zShXyF6!Ad#Eru11piDK&6sbyVIXSpO33CD}%6q-XYOk*K|bUdDgx`AW{hwjYa zM<-xjEZA^`|H~$2a>8bLQKZ} zLB^Jd#VHvwfGx?~A>ERiCUg3J?OJcAAZbdf6Hk&Nk_fY$mS?2o%GPH}1d{E{WQll1 z=-8g42GdW4aQykf``V&Q6W}O#EGzZC`E*NWZcMk35*qfRc}Z6Nnc{k=W$S9olPI;+ z@nk_TpA-koOx36tuc^5+8y2dJKCX$4z2CENV(>!in*_$fq1N2jW1W6k7j=WW!K2we zQx6hfTZ3TdyW^y&(Mek}jvhFo%!~{*FP%!sE17a%?j{}9boS=;RS0g0Vl+OX*4!KG zS9cV3_T@Rcztag#Ba8Akz?VEN{KY|&-cj^8X4hI9rOS7jb^I*rs9{W6y2#E2G^qzi zdmWmqMl3bFs8=?8X$*f<{;;}lLq--wF|=g=DWXjt<5enf565lt)AmHV zIxOb73llA}$8Ct~8-~_=j#_ZB`OnsJr4>ai);+T_!|ZPhrkXB?{B)};+#9l2+7C4G z(7Hc=^#UXHmZ|>h%+um(yvmbWw|yz{+FO@id!cP~py}<7RoWpJ*Fa-`$lS+tJjBR& z6tlD4Ti8JxCZ9NMtT44qLLkP~+BFVn!|dbm^=AtK$C64)M~7nwq6^V!syIo2Oxw z>Q`G3RCIQRk}|{IuYEXq#p2PEEha{j+{?DX0X|%93;f$J-{g|;y0D)gO{G>+cUcD` z4y@ax<21CZK45QAznB)#Ufr}OXGc|jX9Ltdv+b8XbyW6-6`@zUuVY!hSGtpO`!`Qz z&NQEk%buN|_~W2YVMOhus;$a%yh2m*KG^m|>9yn4nuBHYyEpCJ)0$=kK9Wtr0td+%|?D^-C{{MH<3%xF3Nr{}sKhiFd5L0;yj%{mN`D2E@j zb9elGv{mRmpa=e4(SIT%(x!E1a$=RXWcVrny?jLXA=RCjub+PYvh*imzV73lzO2;z z^IhX}vi&XOSKIaiO6bz9{*4VIPX4pcSiyJsOr)&7MIV0tt;fiC&DW%|Q{u`km5!dp z!Uvmke~-D&46c>G#Z1ofQ!2y69!2#V?{T-pgjb1Z<)$Z0{jJ!Cd*WSVOiYG2O~X$e zkOZV!x9`)jqV>P+UU{SXLBcfJe~UZ${fApm5?rT^HZwk-)*@r4(symdMMs05ch4L& zKD%kQ5%->$aqgk4nHpEI84+blJ(2ds3O8Z;4>JTe4@PSyKg=thMLwxcsc|nVEJ)aH z*B04qWpUia=q@`HDRXoAnzt<~x%EzDW7^4`nuh7CO5MicxId`hJsvyinB5bmk2>6A rInt*5>ynshr7qiTo&3Aj@9hWbNS~fK{3iQ`;bQ_J+;C1~K%(-0k;znQ diff --git a/wxWidgets/src/png/pngpread.c b/wxWidgets/src/png/pngpread.c deleted file mode 100644 index bbf2e14ad0..0000000000 --- a/wxWidgets/src/png/pngpread.c +++ /dev/null @@ -1,1573 +0,0 @@ - -/* pngpread.c - read a png file in push mode - * - * libpng version 1.2.7 - September 12, 2004 - * For conditions of distribution and use, see copyright notice in png.h - * Copyright (c) 1998-2004 Glenn Randers-Pehrson - * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) - * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) - */ - -#define PNG_INTERNAL -#include "png.h" - -#ifdef PNG_PROGRESSIVE_READ_SUPPORTED - -/* push model modes */ -#define PNG_READ_SIG_MODE 0 -#define PNG_READ_CHUNK_MODE 1 -#define PNG_READ_IDAT_MODE 2 -#define PNG_SKIP_MODE 3 -#define PNG_READ_tEXt_MODE 4 -#define PNG_READ_zTXt_MODE 5 -#define PNG_READ_DONE_MODE 6 -#define PNG_READ_iTXt_MODE 7 -#define PNG_ERROR_MODE 8 - -void PNGAPI -png_process_data(png_structp png_ptr, png_infop info_ptr, - png_bytep buffer, png_size_t buffer_size) -{ - png_push_restore_buffer(png_ptr, buffer, buffer_size); - - while (png_ptr->buffer_size) - { - png_process_some_data(png_ptr, info_ptr); - } -} - -/* What we do with the incoming data depends on what we were previously - * doing before we ran out of data... - */ -void /* PRIVATE */ -png_process_some_data(png_structp png_ptr, png_infop info_ptr) -{ - switch (png_ptr->process_mode) - { - case PNG_READ_SIG_MODE: - { - png_push_read_sig(png_ptr, info_ptr); - break; - } - case PNG_READ_CHUNK_MODE: - { - png_push_read_chunk(png_ptr, info_ptr); - break; - } - case PNG_READ_IDAT_MODE: - { - png_push_read_IDAT(png_ptr); - break; - } -#if defined(PNG_READ_tEXt_SUPPORTED) - case PNG_READ_tEXt_MODE: - { - png_push_read_tEXt(png_ptr, info_ptr); - break; - } -#endif -#if defined(PNG_READ_zTXt_SUPPORTED) - case PNG_READ_zTXt_MODE: - { - png_push_read_zTXt(png_ptr, info_ptr); - break; - } -#endif -#if defined(PNG_READ_iTXt_SUPPORTED) - case PNG_READ_iTXt_MODE: - { - png_push_read_iTXt(png_ptr, info_ptr); - break; - } -#endif - case PNG_SKIP_MODE: - { - png_push_crc_finish(png_ptr); - break; - } - default: - { - png_ptr->buffer_size = 0; - break; - } - } -} - -/* Read any remaining signature bytes from the stream and compare them with - * the correct PNG signature. It is possible that this routine is called - * with bytes already read from the signature, either because they have been - * checked by the calling application, or because of multiple calls to this - * routine. - */ -void /* PRIVATE */ -png_push_read_sig(png_structp png_ptr, png_infop info_ptr) -{ - png_size_t num_checked = png_ptr->sig_bytes, - num_to_check = 8 - num_checked; - - if (png_ptr->buffer_size < num_to_check) - { - num_to_check = png_ptr->buffer_size; - } - - png_push_fill_buffer(png_ptr, &(info_ptr->signature[num_checked]), - num_to_check); - png_ptr->sig_bytes = (png_byte)(png_ptr->sig_bytes+num_to_check); - - if (png_sig_cmp(info_ptr->signature, num_checked, num_to_check)) - { - if (num_checked < 4 && - png_sig_cmp(info_ptr->signature, num_checked, num_to_check - 4)) - png_error(png_ptr, "Not a PNG file"); - else - png_error(png_ptr, "PNG file corrupted by ASCII conversion"); - } - else - { - if (png_ptr->sig_bytes >= 8) - { - png_ptr->process_mode = PNG_READ_CHUNK_MODE; - } - } -} - -void /* PRIVATE */ -png_push_read_chunk(png_structp png_ptr, png_infop info_ptr) -{ -#ifdef PNG_USE_LOCAL_ARRAYS - PNG_IHDR; - PNG_IDAT; - PNG_IEND; - PNG_PLTE; -#if defined(PNG_READ_bKGD_SUPPORTED) - PNG_bKGD; -#endif -#if defined(PNG_READ_cHRM_SUPPORTED) - PNG_cHRM; -#endif -#if defined(PNG_READ_gAMA_SUPPORTED) - PNG_gAMA; -#endif -#if defined(PNG_READ_hIST_SUPPORTED) - PNG_hIST; -#endif -#if defined(PNG_READ_iCCP_SUPPORTED) - PNG_iCCP; -#endif -#if defined(PNG_READ_iTXt_SUPPORTED) - PNG_iTXt; -#endif -#if defined(PNG_READ_oFFs_SUPPORTED) - PNG_oFFs; -#endif -#if defined(PNG_READ_pCAL_SUPPORTED) - PNG_pCAL; -#endif -#if defined(PNG_READ_pHYs_SUPPORTED) - PNG_pHYs; -#endif -#if defined(PNG_READ_sBIT_SUPPORTED) - PNG_sBIT; -#endif -#if defined(PNG_READ_sCAL_SUPPORTED) - PNG_sCAL; -#endif -#if defined(PNG_READ_sRGB_SUPPORTED) - PNG_sRGB; -#endif -#if defined(PNG_READ_sPLT_SUPPORTED) - PNG_sPLT; -#endif -#if defined(PNG_READ_tEXt_SUPPORTED) - PNG_tEXt; -#endif -#if defined(PNG_READ_tIME_SUPPORTED) - PNG_tIME; -#endif -#if defined(PNG_READ_tRNS_SUPPORTED) - PNG_tRNS; -#endif -#if defined(PNG_READ_zTXt_SUPPORTED) - PNG_zTXt; -#endif -#endif /* PNG_USE_LOCAL_ARRAYS */ - /* First we make sure we have enough data for the 4 byte chunk name - * and the 4 byte chunk length before proceeding with decoding the - * chunk data. To fully decode each of these chunks, we also make - * sure we have enough data in the buffer for the 4 byte CRC at the - * end of every chunk (except IDAT, which is handled separately). - */ - if (!(png_ptr->mode & PNG_HAVE_CHUNK_HEADER)) - { - png_byte chunk_length[4]; - - if (png_ptr->buffer_size < 8) - { - png_push_save_buffer(png_ptr); - return; - } - - png_push_fill_buffer(png_ptr, chunk_length, 4); - png_ptr->push_length = png_get_uint_31(png_ptr,chunk_length); - png_reset_crc(png_ptr); - png_crc_read(png_ptr, png_ptr->chunk_name, 4); - png_ptr->mode |= PNG_HAVE_CHUNK_HEADER; - } - - if (!png_memcmp(png_ptr->chunk_name, png_IHDR, 4)) - { - if (png_ptr->push_length + 4 > png_ptr->buffer_size) - { - png_push_save_buffer(png_ptr); - return; - } - png_handle_IHDR(png_ptr, info_ptr, png_ptr->push_length); - } - else if (!png_memcmp(png_ptr->chunk_name, png_IEND, 4)) - { - if (png_ptr->push_length + 4 > png_ptr->buffer_size) - { - png_push_save_buffer(png_ptr); - return; - } - png_handle_IEND(png_ptr, info_ptr, png_ptr->push_length); - - png_ptr->process_mode = PNG_READ_DONE_MODE; - png_push_have_end(png_ptr, info_ptr); - } -#ifdef PNG_HANDLE_AS_UNKNOWN_SUPPORTED - else if (png_handle_as_unknown(png_ptr, png_ptr->chunk_name)) - { - if (png_ptr->push_length + 4 > png_ptr->buffer_size) - { - png_push_save_buffer(png_ptr); - return; - } - if (!png_memcmp(png_ptr->chunk_name, png_IDAT, 4)) - png_ptr->mode |= PNG_HAVE_IDAT; - png_handle_unknown(png_ptr, info_ptr, png_ptr->push_length); - if (!png_memcmp(png_ptr->chunk_name, png_PLTE, 4)) - png_ptr->mode |= PNG_HAVE_PLTE; - else if (!png_memcmp(png_ptr->chunk_name, png_IDAT, 4)) - { - if (!(png_ptr->mode & PNG_HAVE_IHDR)) - png_error(png_ptr, "Missing IHDR before IDAT"); - else if (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE && - !(png_ptr->mode & PNG_HAVE_PLTE)) - png_error(png_ptr, "Missing PLTE before IDAT"); - } - } -#endif - else if (!png_memcmp(png_ptr->chunk_name, png_PLTE, 4)) - { - if (png_ptr->push_length + 4 > png_ptr->buffer_size) - { - png_push_save_buffer(png_ptr); - return; - } - png_handle_PLTE(png_ptr, info_ptr, png_ptr->push_length); - } - else if (!png_memcmp(png_ptr->chunk_name, (png_bytep)png_IDAT, 4)) - { - /* If we reach an IDAT chunk, this means we have read all of the - * header chunks, and we can start reading the image (or if this - * is called after the image has been read - we have an error). - */ - if (!(png_ptr->mode & PNG_HAVE_IHDR)) - png_error(png_ptr, "Missing IHDR before IDAT"); - else if (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE && - !(png_ptr->mode & PNG_HAVE_PLTE)) - png_error(png_ptr, "Missing PLTE before IDAT"); - - if (png_ptr->mode & PNG_HAVE_IDAT) - { - if (png_ptr->push_length == 0) - return; - - if (png_ptr->mode & PNG_AFTER_IDAT) - png_error(png_ptr, "Too many IDAT's found"); - } - - png_ptr->idat_size = png_ptr->push_length; - png_ptr->mode |= PNG_HAVE_IDAT; - png_ptr->process_mode = PNG_READ_IDAT_MODE; - png_push_have_info(png_ptr, info_ptr); - png_ptr->zstream.avail_out = (uInt)png_ptr->irowbytes; - png_ptr->zstream.next_out = png_ptr->row_buf; - return; - } -#if defined(PNG_READ_gAMA_SUPPORTED) - else if (!png_memcmp(png_ptr->chunk_name, png_gAMA, 4)) - { - if (png_ptr->push_length + 4 > png_ptr->buffer_size) - { - png_push_save_buffer(png_ptr); - return; - } - png_handle_gAMA(png_ptr, info_ptr, png_ptr->push_length); - } -#endif -#if defined(PNG_READ_sBIT_SUPPORTED) - else if (!png_memcmp(png_ptr->chunk_name, png_sBIT, 4)) - { - if (png_ptr->push_length + 4 > png_ptr->buffer_size) - { - png_push_save_buffer(png_ptr); - return; - } - png_handle_sBIT(png_ptr, info_ptr, png_ptr->push_length); - } -#endif -#if defined(PNG_READ_cHRM_SUPPORTED) - else if (!png_memcmp(png_ptr->chunk_name, png_cHRM, 4)) - { - if (png_ptr->push_length + 4 > png_ptr->buffer_size) - { - png_push_save_buffer(png_ptr); - return; - } - png_handle_cHRM(png_ptr, info_ptr, png_ptr->push_length); - } -#endif -#if defined(PNG_READ_sRGB_SUPPORTED) - else if (!png_memcmp(png_ptr->chunk_name, png_sRGB, 4)) - { - if (png_ptr->push_length + 4 > png_ptr->buffer_size) - { - png_push_save_buffer(png_ptr); - return; - } - png_handle_sRGB(png_ptr, info_ptr, png_ptr->push_length); - } -#endif -#if defined(PNG_READ_iCCP_SUPPORTED) - else if (!png_memcmp(png_ptr->chunk_name, png_iCCP, 4)) - { - if (png_ptr->push_length + 4 > png_ptr->buffer_size) - { - png_push_save_buffer(png_ptr); - return; - } - png_handle_iCCP(png_ptr, info_ptr, png_ptr->push_length); - } -#endif -#if defined(PNG_READ_sPLT_SUPPORTED) - else if (!png_memcmp(png_ptr->chunk_name, png_sPLT, 4)) - { - if (png_ptr->push_length + 4 > png_ptr->buffer_size) - { - png_push_save_buffer(png_ptr); - return; - } - png_handle_sPLT(png_ptr, info_ptr, png_ptr->push_length); - } -#endif -#if defined(PNG_READ_tRNS_SUPPORTED) - else if (!png_memcmp(png_ptr->chunk_name, png_tRNS, 4)) - { - if (png_ptr->push_length + 4 > png_ptr->buffer_size) - { - png_push_save_buffer(png_ptr); - return; - } - png_handle_tRNS(png_ptr, info_ptr, png_ptr->push_length); - } -#endif -#if defined(PNG_READ_bKGD_SUPPORTED) - else if (!png_memcmp(png_ptr->chunk_name, png_bKGD, 4)) - { - if (png_ptr->push_length + 4 > png_ptr->buffer_size) - { - png_push_save_buffer(png_ptr); - return; - } - png_handle_bKGD(png_ptr, info_ptr, png_ptr->push_length); - } -#endif -#if defined(PNG_READ_hIST_SUPPORTED) - else if (!png_memcmp(png_ptr->chunk_name, png_hIST, 4)) - { - if (png_ptr->push_length + 4 > png_ptr->buffer_size) - { - png_push_save_buffer(png_ptr); - return; - } - png_handle_hIST(png_ptr, info_ptr, png_ptr->push_length); - } -#endif -#if defined(PNG_READ_pHYs_SUPPORTED) - else if (!png_memcmp(png_ptr->chunk_name, png_pHYs, 4)) - { - if (png_ptr->push_length + 4 > png_ptr->buffer_size) - { - png_push_save_buffer(png_ptr); - return; - } - png_handle_pHYs(png_ptr, info_ptr, png_ptr->push_length); - } -#endif -#if defined(PNG_READ_oFFs_SUPPORTED) - else if (!png_memcmp(png_ptr->chunk_name, png_oFFs, 4)) - { - if (png_ptr->push_length + 4 > png_ptr->buffer_size) - { - png_push_save_buffer(png_ptr); - return; - } - png_handle_oFFs(png_ptr, info_ptr, png_ptr->push_length); - } -#endif -#if defined(PNG_READ_pCAL_SUPPORTED) - else if (!png_memcmp(png_ptr->chunk_name, png_pCAL, 4)) - { - if (png_ptr->push_length + 4 > png_ptr->buffer_size) - { - png_push_save_buffer(png_ptr); - return; - } - png_handle_pCAL(png_ptr, info_ptr, png_ptr->push_length); - } -#endif -#if defined(PNG_READ_sCAL_SUPPORTED) - else if (!png_memcmp(png_ptr->chunk_name, png_sCAL, 4)) - { - if (png_ptr->push_length + 4 > png_ptr->buffer_size) - { - png_push_save_buffer(png_ptr); - return; - } - png_handle_sCAL(png_ptr, info_ptr, png_ptr->push_length); - } -#endif -#if defined(PNG_READ_tIME_SUPPORTED) - else if (!png_memcmp(png_ptr->chunk_name, png_tIME, 4)) - { - if (png_ptr->push_length + 4 > png_ptr->buffer_size) - { - png_push_save_buffer(png_ptr); - return; - } - png_handle_tIME(png_ptr, info_ptr, png_ptr->push_length); - } -#endif -#if defined(PNG_READ_tEXt_SUPPORTED) - else if (!png_memcmp(png_ptr->chunk_name, png_tEXt, 4)) - { - if (png_ptr->push_length + 4 > png_ptr->buffer_size) - { - png_push_save_buffer(png_ptr); - return; - } - png_push_handle_tEXt(png_ptr, info_ptr, png_ptr->push_length); - } -#endif -#if defined(PNG_READ_zTXt_SUPPORTED) - else if (!png_memcmp(png_ptr->chunk_name, png_zTXt, 4)) - { - if (png_ptr->push_length + 4 > png_ptr->buffer_size) - { - png_push_save_buffer(png_ptr); - return; - } - png_push_handle_zTXt(png_ptr, info_ptr, png_ptr->push_length); - } -#endif -#if defined(PNG_READ_iTXt_SUPPORTED) - else if (!png_memcmp(png_ptr->chunk_name, png_iTXt, 4)) - { - if (png_ptr->push_length + 4 > png_ptr->buffer_size) - { - png_push_save_buffer(png_ptr); - return; - } - png_push_handle_iTXt(png_ptr, info_ptr, png_ptr->push_length); - } -#endif - else - { - if (png_ptr->push_length + 4 > png_ptr->buffer_size) - { - png_push_save_buffer(png_ptr); - return; - } - png_push_handle_unknown(png_ptr, info_ptr, png_ptr->push_length); - } - - png_ptr->mode &= ~PNG_HAVE_CHUNK_HEADER; -} - -void /* PRIVATE */ -png_push_crc_skip(png_structp png_ptr, png_uint_32 skip) -{ - png_ptr->process_mode = PNG_SKIP_MODE; - png_ptr->skip_length = skip; -} - -void /* PRIVATE */ -png_push_crc_finish(png_structp png_ptr) -{ - if (png_ptr->skip_length && png_ptr->save_buffer_size) - { - png_size_t save_size; - - if (png_ptr->skip_length < (png_uint_32)png_ptr->save_buffer_size) - save_size = (png_size_t)png_ptr->skip_length; - else - save_size = png_ptr->save_buffer_size; - - png_calculate_crc(png_ptr, png_ptr->save_buffer_ptr, save_size); - - png_ptr->skip_length -= save_size; - png_ptr->buffer_size -= save_size; - png_ptr->save_buffer_size -= save_size; - png_ptr->save_buffer_ptr += save_size; - } - if (png_ptr->skip_length && png_ptr->current_buffer_size) - { - png_size_t save_size; - - if (png_ptr->skip_length < (png_uint_32)png_ptr->current_buffer_size) - save_size = (png_size_t)png_ptr->skip_length; - else - save_size = png_ptr->current_buffer_size; - - png_calculate_crc(png_ptr, png_ptr->current_buffer_ptr, save_size); - - png_ptr->skip_length -= save_size; - png_ptr->buffer_size -= save_size; - png_ptr->current_buffer_size -= save_size; - png_ptr->current_buffer_ptr += save_size; - } - if (!png_ptr->skip_length) - { - if (png_ptr->buffer_size < 4) - { - png_push_save_buffer(png_ptr); - return; - } - - png_crc_finish(png_ptr, 0); - png_ptr->process_mode = PNG_READ_CHUNK_MODE; - } -} - -void PNGAPI -png_push_fill_buffer(png_structp png_ptr, png_bytep buffer, png_size_t length) -{ - png_bytep ptr; - - ptr = buffer; - if (png_ptr->save_buffer_size) - { - png_size_t save_size; - - if (length < png_ptr->save_buffer_size) - save_size = length; - else - save_size = png_ptr->save_buffer_size; - - png_memcpy(ptr, png_ptr->save_buffer_ptr, save_size); - length -= save_size; - ptr += save_size; - png_ptr->buffer_size -= save_size; - png_ptr->save_buffer_size -= save_size; - png_ptr->save_buffer_ptr += save_size; - } - if (length && png_ptr->current_buffer_size) - { - png_size_t save_size; - - if (length < png_ptr->current_buffer_size) - save_size = length; - else - save_size = png_ptr->current_buffer_size; - - png_memcpy(ptr, png_ptr->current_buffer_ptr, save_size); - png_ptr->buffer_size -= save_size; - png_ptr->current_buffer_size -= save_size; - png_ptr->current_buffer_ptr += save_size; - } -} - -void /* PRIVATE */ -png_push_save_buffer(png_structp png_ptr) -{ - if (png_ptr->save_buffer_size) - { - if (png_ptr->save_buffer_ptr != png_ptr->save_buffer) - { - png_size_t i,istop; - png_bytep sp; - png_bytep dp; - - istop = png_ptr->save_buffer_size; - for (i = 0, sp = png_ptr->save_buffer_ptr, dp = png_ptr->save_buffer; - i < istop; i++, sp++, dp++) - { - *dp = *sp; - } - } - } - if (png_ptr->save_buffer_size + png_ptr->current_buffer_size > - png_ptr->save_buffer_max) - { - png_size_t new_max; - png_bytep old_buffer; - - if (png_ptr->save_buffer_size > PNG_SIZE_MAX - - (png_ptr->current_buffer_size + 256)) - { - png_error(png_ptr, "Potential overflow of save_buffer"); - } - new_max = png_ptr->save_buffer_size + png_ptr->current_buffer_size + 256; - old_buffer = png_ptr->save_buffer; - png_ptr->save_buffer = (png_bytep)png_malloc(png_ptr, - (png_uint_32)new_max); - png_memcpy(png_ptr->save_buffer, old_buffer, png_ptr->save_buffer_size); - png_free(png_ptr, old_buffer); - png_ptr->save_buffer_max = new_max; - } - if (png_ptr->current_buffer_size) - { - png_memcpy(png_ptr->save_buffer + png_ptr->save_buffer_size, - png_ptr->current_buffer_ptr, png_ptr->current_buffer_size); - png_ptr->save_buffer_size += png_ptr->current_buffer_size; - png_ptr->current_buffer_size = 0; - } - png_ptr->save_buffer_ptr = png_ptr->save_buffer; - png_ptr->buffer_size = 0; -} - -void /* PRIVATE */ -png_push_restore_buffer(png_structp png_ptr, png_bytep buffer, - png_size_t buffer_length) -{ - png_ptr->current_buffer = buffer; - png_ptr->current_buffer_size = buffer_length; - png_ptr->buffer_size = buffer_length + png_ptr->save_buffer_size; - png_ptr->current_buffer_ptr = png_ptr->current_buffer; -} - -void /* PRIVATE */ -png_push_read_IDAT(png_structp png_ptr) -{ -#ifdef PNG_USE_LOCAL_ARRAYS - PNG_IDAT; -#endif - if (!(png_ptr->mode & PNG_HAVE_CHUNK_HEADER)) - { - png_byte chunk_length[4]; - - if (png_ptr->buffer_size < 8) - { - png_push_save_buffer(png_ptr); - return; - } - - png_push_fill_buffer(png_ptr, chunk_length, 4); - png_ptr->push_length = png_get_uint_31(png_ptr,chunk_length); - png_reset_crc(png_ptr); - png_crc_read(png_ptr, png_ptr->chunk_name, 4); - png_ptr->mode |= PNG_HAVE_CHUNK_HEADER; - - if (png_memcmp(png_ptr->chunk_name, (png_bytep)png_IDAT, 4)) - { - png_ptr->process_mode = PNG_READ_CHUNK_MODE; - if (!(png_ptr->flags & PNG_FLAG_ZLIB_FINISHED)) - png_error(png_ptr, "Not enough compressed data"); - return; - } - - png_ptr->idat_size = png_ptr->push_length; - } - if (png_ptr->idat_size && png_ptr->save_buffer_size) - { - png_size_t save_size; - - if (png_ptr->idat_size < (png_uint_32)png_ptr->save_buffer_size) - { - save_size = (png_size_t)png_ptr->idat_size; - /* check for overflow */ - if((png_uint_32)save_size != png_ptr->idat_size) - png_error(png_ptr, "save_size overflowed in pngpread"); - } - else - save_size = png_ptr->save_buffer_size; - - png_calculate_crc(png_ptr, png_ptr->save_buffer_ptr, save_size); - if (!(png_ptr->flags & PNG_FLAG_ZLIB_FINISHED)) - png_process_IDAT_data(png_ptr, png_ptr->save_buffer_ptr, save_size); - png_ptr->idat_size -= save_size; - png_ptr->buffer_size -= save_size; - png_ptr->save_buffer_size -= save_size; - png_ptr->save_buffer_ptr += save_size; - } - if (png_ptr->idat_size && png_ptr->current_buffer_size) - { - png_size_t save_size; - - if (png_ptr->idat_size < (png_uint_32)png_ptr->current_buffer_size) - { - save_size = (png_size_t)png_ptr->idat_size; - /* check for overflow */ - if((png_uint_32)save_size != png_ptr->idat_size) - png_error(png_ptr, "save_size overflowed in pngpread"); - } - else - save_size = png_ptr->current_buffer_size; - - png_calculate_crc(png_ptr, png_ptr->current_buffer_ptr, save_size); - if (!(png_ptr->flags & PNG_FLAG_ZLIB_FINISHED)) - png_process_IDAT_data(png_ptr, png_ptr->current_buffer_ptr, save_size); - - png_ptr->idat_size -= save_size; - png_ptr->buffer_size -= save_size; - png_ptr->current_buffer_size -= save_size; - png_ptr->current_buffer_ptr += save_size; - } - if (!png_ptr->idat_size) - { - if (png_ptr->buffer_size < 4) - { - png_push_save_buffer(png_ptr); - return; - } - - png_crc_finish(png_ptr, 0); - png_ptr->mode &= ~PNG_HAVE_CHUNK_HEADER; - png_ptr->mode |= PNG_AFTER_IDAT; - } -} - -void /* PRIVATE */ -png_process_IDAT_data(png_structp png_ptr, png_bytep buffer, - png_size_t buffer_length) -{ - int ret; - - if ((png_ptr->flags & PNG_FLAG_ZLIB_FINISHED) && buffer_length) - png_error(png_ptr, "Extra compression data"); - - png_ptr->zstream.next_in = buffer; - png_ptr->zstream.avail_in = (uInt)buffer_length; - for(;;) - { - ret = inflate(&png_ptr->zstream, Z_PARTIAL_FLUSH); - if (ret != Z_OK) - { - if (ret == Z_STREAM_END) - { - if (png_ptr->zstream.avail_in) - png_error(png_ptr, "Extra compressed data"); - if (!(png_ptr->zstream.avail_out)) - { - png_push_process_row(png_ptr); - } - - png_ptr->mode |= PNG_AFTER_IDAT; - png_ptr->flags |= PNG_FLAG_ZLIB_FINISHED; - break; - } - else if (ret == Z_BUF_ERROR) - break; - else - png_error(png_ptr, "Decompression Error"); - } - if (!(png_ptr->zstream.avail_out)) - { - if (( -#if defined(PNG_READ_INTERLACING_SUPPORTED) - png_ptr->interlaced && png_ptr->pass > 6) || - (!png_ptr->interlaced && -#endif - png_ptr->row_number == png_ptr->num_rows)) - { - if (png_ptr->zstream.avail_in) - png_warning(png_ptr, "Too much data in IDAT chunks"); - png_ptr->flags |= PNG_FLAG_ZLIB_FINISHED; - break; - } - png_push_process_row(png_ptr); - png_ptr->zstream.avail_out = (uInt)png_ptr->irowbytes; - png_ptr->zstream.next_out = png_ptr->row_buf; - } - else - break; - } -} - -void /* PRIVATE */ -png_push_process_row(png_structp png_ptr) -{ - png_ptr->row_info.color_type = png_ptr->color_type; - png_ptr->row_info.width = png_ptr->iwidth; - png_ptr->row_info.channels = png_ptr->channels; - png_ptr->row_info.bit_depth = png_ptr->bit_depth; - png_ptr->row_info.pixel_depth = png_ptr->pixel_depth; - - png_ptr->row_info.rowbytes = PNG_ROWBYTES(png_ptr->row_info.pixel_depth, - png_ptr->row_info.width); - - png_read_filter_row(png_ptr, &(png_ptr->row_info), - png_ptr->row_buf + 1, png_ptr->prev_row + 1, - (int)(png_ptr->row_buf[0])); - - png_memcpy_check(png_ptr, png_ptr->prev_row, png_ptr->row_buf, - png_ptr->rowbytes + 1); - - if (png_ptr->transformations) - png_do_read_transformations(png_ptr); - -#if defined(PNG_READ_INTERLACING_SUPPORTED) - /* blow up interlaced rows to full size */ - if (png_ptr->interlaced && (png_ptr->transformations & PNG_INTERLACE)) - { - if (png_ptr->pass < 6) -/* old interface (pre-1.0.9): - png_do_read_interlace(&(png_ptr->row_info), - png_ptr->row_buf + 1, png_ptr->pass, png_ptr->transformations); - */ - png_do_read_interlace(png_ptr); - - switch (png_ptr->pass) - { - case 0: - { - int i; - for (i = 0; i < 8 && png_ptr->pass == 0; i++) - { - png_push_have_row(png_ptr, png_ptr->row_buf + 1); - png_read_push_finish_row(png_ptr); /* updates png_ptr->pass */ - } - if (png_ptr->pass == 2) /* pass 1 might be empty */ - { - for (i = 0; i < 4 && png_ptr->pass == 2; i++) - { - png_push_have_row(png_ptr, png_bytep_NULL); - png_read_push_finish_row(png_ptr); - } - } - if (png_ptr->pass == 4 && png_ptr->height <= 4) - { - for (i = 0; i < 2 && png_ptr->pass == 4; i++) - { - png_push_have_row(png_ptr, png_bytep_NULL); - png_read_push_finish_row(png_ptr); - } - } - if (png_ptr->pass == 6 && png_ptr->height <= 4) - { - png_push_have_row(png_ptr, png_bytep_NULL); - png_read_push_finish_row(png_ptr); - } - break; - } - case 1: - { - int i; - for (i = 0; i < 8 && png_ptr->pass == 1; i++) - { - png_push_have_row(png_ptr, png_ptr->row_buf + 1); - png_read_push_finish_row(png_ptr); - } - if (png_ptr->pass == 2) /* skip top 4 generated rows */ - { - for (i = 0; i < 4 && png_ptr->pass == 2; i++) - { - png_push_have_row(png_ptr, png_bytep_NULL); - png_read_push_finish_row(png_ptr); - } - } - break; - } - case 2: - { - int i; - for (i = 0; i < 4 && png_ptr->pass == 2; i++) - { - png_push_have_row(png_ptr, png_ptr->row_buf + 1); - png_read_push_finish_row(png_ptr); - } - for (i = 0; i < 4 && png_ptr->pass == 2; i++) - { - png_push_have_row(png_ptr, png_bytep_NULL); - png_read_push_finish_row(png_ptr); - } - if (png_ptr->pass == 4) /* pass 3 might be empty */ - { - for (i = 0; i < 2 && png_ptr->pass == 4; i++) - { - png_push_have_row(png_ptr, png_bytep_NULL); - png_read_push_finish_row(png_ptr); - } - } - break; - } - case 3: - { - int i; - for (i = 0; i < 4 && png_ptr->pass == 3; i++) - { - png_push_have_row(png_ptr, png_ptr->row_buf + 1); - png_read_push_finish_row(png_ptr); - } - if (png_ptr->pass == 4) /* skip top two generated rows */ - { - for (i = 0; i < 2 && png_ptr->pass == 4; i++) - { - png_push_have_row(png_ptr, png_bytep_NULL); - png_read_push_finish_row(png_ptr); - } - } - break; - } - case 4: - { - int i; - for (i = 0; i < 2 && png_ptr->pass == 4; i++) - { - png_push_have_row(png_ptr, png_ptr->row_buf + 1); - png_read_push_finish_row(png_ptr); - } - for (i = 0; i < 2 && png_ptr->pass == 4; i++) - { - png_push_have_row(png_ptr, png_bytep_NULL); - png_read_push_finish_row(png_ptr); - } - if (png_ptr->pass == 6) /* pass 5 might be empty */ - { - png_push_have_row(png_ptr, png_bytep_NULL); - png_read_push_finish_row(png_ptr); - } - break; - } - case 5: - { - int i; - for (i = 0; i < 2 && png_ptr->pass == 5; i++) - { - png_push_have_row(png_ptr, png_ptr->row_buf + 1); - png_read_push_finish_row(png_ptr); - } - if (png_ptr->pass == 6) /* skip top generated row */ - { - png_push_have_row(png_ptr, png_bytep_NULL); - png_read_push_finish_row(png_ptr); - } - break; - } - case 6: - { - png_push_have_row(png_ptr, png_ptr->row_buf + 1); - png_read_push_finish_row(png_ptr); - if (png_ptr->pass != 6) - break; - png_push_have_row(png_ptr, png_bytep_NULL); - png_read_push_finish_row(png_ptr); - } - } - } - else -#endif - { - png_push_have_row(png_ptr, png_ptr->row_buf + 1); - png_read_push_finish_row(png_ptr); - } -} - -void /* PRIVATE */ -png_read_push_finish_row(png_structp png_ptr) -{ -#ifdef PNG_USE_LOCAL_ARRAYS - /* arrays to facilitate easy interlacing - use pass (0 - 6) as index */ - - /* start of interlace block */ - const int FARDATA png_pass_start[] = {0, 4, 0, 2, 0, 1, 0}; - - /* offset to next interlace block */ - const int FARDATA png_pass_inc[] = {8, 8, 4, 4, 2, 2, 1}; - - /* start of interlace block in the y direction */ - const int FARDATA png_pass_ystart[] = {0, 0, 4, 0, 2, 0, 1}; - - /* offset to next interlace block in the y direction */ - const int FARDATA png_pass_yinc[] = {8, 8, 8, 4, 4, 2, 2}; - - /* Width of interlace block. This is not currently used - if you need - * it, uncomment it here and in png.h - const int FARDATA png_pass_width[] = {8, 4, 4, 2, 2, 1, 1}; - */ - - /* Height of interlace block. This is not currently used - if you need - * it, uncomment it here and in png.h - const int FARDATA png_pass_height[] = {8, 8, 4, 4, 2, 2, 1}; - */ -#endif - - png_ptr->row_number++; - if (png_ptr->row_number < png_ptr->num_rows) - return; - - if (png_ptr->interlaced) - { - png_ptr->row_number = 0; - png_memset_check(png_ptr, png_ptr->prev_row, 0, - png_ptr->rowbytes + 1); - do - { - png_ptr->pass++; - if ((png_ptr->pass == 1 && png_ptr->width < 5) || - (png_ptr->pass == 3 && png_ptr->width < 3) || - (png_ptr->pass == 5 && png_ptr->width < 2)) - png_ptr->pass++; - - if (png_ptr->pass > 7) - png_ptr->pass--; - if (png_ptr->pass >= 7) - break; - - png_ptr->iwidth = (png_ptr->width + - png_pass_inc[png_ptr->pass] - 1 - - png_pass_start[png_ptr->pass]) / - png_pass_inc[png_ptr->pass]; - - png_ptr->irowbytes = PNG_ROWBYTES(png_ptr->pixel_depth, - png_ptr->iwidth) + 1; - - if (png_ptr->transformations & PNG_INTERLACE) - break; - - png_ptr->num_rows = (png_ptr->height + - png_pass_yinc[png_ptr->pass] - 1 - - png_pass_ystart[png_ptr->pass]) / - png_pass_yinc[png_ptr->pass]; - - } while (png_ptr->iwidth == 0 || png_ptr->num_rows == 0); - } -} - -#if defined(PNG_READ_tEXt_SUPPORTED) -void /* PRIVATE */ -png_push_handle_tEXt(png_structp png_ptr, png_infop info_ptr, png_uint_32 - length) -{ - if (!(png_ptr->mode & PNG_HAVE_IHDR) || (png_ptr->mode & PNG_HAVE_IEND)) - { - png_error(png_ptr, "Out of place tEXt"); - /* to quiet some compiler warnings */ - if(info_ptr == NULL) return; - } - -#ifdef PNG_MAX_MALLOC_64K - png_ptr->skip_length = 0; /* This may not be necessary */ - - if (length > (png_uint_32)65535L) /* Can't hold entire string in memory */ - { - png_warning(png_ptr, "tEXt chunk too large to fit in memory"); - png_ptr->skip_length = length - (png_uint_32)65535L; - length = (png_uint_32)65535L; - } -#endif - - png_ptr->current_text = (png_charp)png_malloc(png_ptr, - (png_uint_32)(length+1)); - png_ptr->current_text[length] = '\0'; - png_ptr->current_text_ptr = png_ptr->current_text; - png_ptr->current_text_size = (png_size_t)length; - png_ptr->current_text_left = (png_size_t)length; - png_ptr->process_mode = PNG_READ_tEXt_MODE; -} - -void /* PRIVATE */ -png_push_read_tEXt(png_structp png_ptr, png_infop info_ptr) -{ - if (png_ptr->buffer_size && png_ptr->current_text_left) - { - png_size_t text_size; - - if (png_ptr->buffer_size < png_ptr->current_text_left) - text_size = png_ptr->buffer_size; - else - text_size = png_ptr->current_text_left; - png_crc_read(png_ptr, (png_bytep)png_ptr->current_text_ptr, text_size); - png_ptr->current_text_left -= text_size; - png_ptr->current_text_ptr += text_size; - } - if (!(png_ptr->current_text_left)) - { - png_textp text_ptr; - png_charp text; - png_charp key; - int ret; - - if (png_ptr->buffer_size < 4) - { - png_push_save_buffer(png_ptr); - return; - } - - png_push_crc_finish(png_ptr); - -#if defined(PNG_MAX_MALLOC_64K) - if (png_ptr->skip_length) - return; -#endif - - key = png_ptr->current_text; - - for (text = key; *text; text++) - /* empty loop */ ; - - if (text != key + png_ptr->current_text_size) - text++; - - text_ptr = (png_textp)png_malloc(png_ptr, - (png_uint_32)png_sizeof(png_text)); - text_ptr->compression = PNG_TEXT_COMPRESSION_NONE; - text_ptr->key = key; -#ifdef PNG_iTXt_SUPPORTED - text_ptr->lang = NULL; - text_ptr->lang_key = NULL; -#endif - text_ptr->text = text; - - ret = png_set_text_2(png_ptr, info_ptr, text_ptr, 1); - - png_free(png_ptr, key); - png_free(png_ptr, text_ptr); - png_ptr->current_text = NULL; - - if (ret) - png_warning(png_ptr, "Insufficient memory to store text chunk."); - } -} -#endif - -#if defined(PNG_READ_zTXt_SUPPORTED) -void /* PRIVATE */ -png_push_handle_zTXt(png_structp png_ptr, png_infop info_ptr, png_uint_32 - length) -{ - if (!(png_ptr->mode & PNG_HAVE_IHDR) || (png_ptr->mode & PNG_HAVE_IEND)) - { - png_error(png_ptr, "Out of place zTXt"); - /* to quiet some compiler warnings */ - if(info_ptr == NULL) return; - } - -#ifdef PNG_MAX_MALLOC_64K - /* We can't handle zTXt chunks > 64K, since we don't have enough space - * to be able to store the uncompressed data. Actually, the threshold - * is probably around 32K, but it isn't as definite as 64K is. - */ - if (length > (png_uint_32)65535L) - { - png_warning(png_ptr, "zTXt chunk too large to fit in memory"); - png_push_crc_skip(png_ptr, length); - return; - } -#endif - - png_ptr->current_text = (png_charp)png_malloc(png_ptr, - (png_uint_32)(length+1)); - png_ptr->current_text[length] = '\0'; - png_ptr->current_text_ptr = png_ptr->current_text; - png_ptr->current_text_size = (png_size_t)length; - png_ptr->current_text_left = (png_size_t)length; - png_ptr->process_mode = PNG_READ_zTXt_MODE; -} - -void /* PRIVATE */ -png_push_read_zTXt(png_structp png_ptr, png_infop info_ptr) -{ - if (png_ptr->buffer_size && png_ptr->current_text_left) - { - png_size_t text_size; - - if (png_ptr->buffer_size < (png_uint_32)png_ptr->current_text_left) - text_size = png_ptr->buffer_size; - else - text_size = png_ptr->current_text_left; - png_crc_read(png_ptr, (png_bytep)png_ptr->current_text_ptr, text_size); - png_ptr->current_text_left -= text_size; - png_ptr->current_text_ptr += text_size; - } - if (!(png_ptr->current_text_left)) - { - png_textp text_ptr; - png_charp text; - png_charp key; - int ret; - png_size_t text_size, key_size; - - if (png_ptr->buffer_size < 4) - { - png_push_save_buffer(png_ptr); - return; - } - - png_push_crc_finish(png_ptr); - - key = png_ptr->current_text; - - for (text = key; *text; text++) - /* empty loop */ ; - - /* zTXt can't have zero text */ - if (text == key + png_ptr->current_text_size) - { - png_ptr->current_text = NULL; - png_free(png_ptr, key); - return; - } - - text++; - - if (*text != PNG_TEXT_COMPRESSION_zTXt) /* check compression byte */ - { - png_ptr->current_text = NULL; - png_free(png_ptr, key); - return; - } - - text++; - - png_ptr->zstream.next_in = (png_bytep )text; - png_ptr->zstream.avail_in = (uInt)(png_ptr->current_text_size - - (text - key)); - png_ptr->zstream.next_out = png_ptr->zbuf; - png_ptr->zstream.avail_out = (uInt)png_ptr->zbuf_size; - - key_size = text - key; - text_size = 0; - text = NULL; - ret = Z_STREAM_END; - - while (png_ptr->zstream.avail_in) - { - ret = inflate(&png_ptr->zstream, Z_PARTIAL_FLUSH); - if (ret != Z_OK && ret != Z_STREAM_END) - { - inflateReset(&png_ptr->zstream); - png_ptr->zstream.avail_in = 0; - png_ptr->current_text = NULL; - png_free(png_ptr, key); - png_free(png_ptr, text); - return; - } - if (!(png_ptr->zstream.avail_out) || ret == Z_STREAM_END) - { - if (text == NULL) - { - text = (png_charp)png_malloc(png_ptr, - (png_uint_32)(png_ptr->zbuf_size - png_ptr->zstream.avail_out - + key_size + 1)); - png_memcpy(text + key_size, png_ptr->zbuf, - png_ptr->zbuf_size - png_ptr->zstream.avail_out); - png_memcpy(text, key, key_size); - text_size = key_size + png_ptr->zbuf_size - - png_ptr->zstream.avail_out; - *(text + text_size) = '\0'; - } - else - { - png_charp tmp; - - tmp = text; - text = (png_charp)png_malloc(png_ptr, text_size + - (png_uint_32)(png_ptr->zbuf_size - png_ptr->zstream.avail_out - + 1)); - png_memcpy(text, tmp, text_size); - png_free(png_ptr, tmp); - png_memcpy(text + text_size, png_ptr->zbuf, - png_ptr->zbuf_size - png_ptr->zstream.avail_out); - text_size += png_ptr->zbuf_size - png_ptr->zstream.avail_out; - *(text + text_size) = '\0'; - } - if (ret != Z_STREAM_END) - { - png_ptr->zstream.next_out = png_ptr->zbuf; - png_ptr->zstream.avail_out = (uInt)png_ptr->zbuf_size; - } - } - else - { - break; - } - - if (ret == Z_STREAM_END) - break; - } - - inflateReset(&png_ptr->zstream); - png_ptr->zstream.avail_in = 0; - - if (ret != Z_STREAM_END) - { - png_ptr->current_text = NULL; - png_free(png_ptr, key); - png_free(png_ptr, text); - return; - } - - png_ptr->current_text = NULL; - png_free(png_ptr, key); - key = text; - text += key_size; - - text_ptr = (png_textp)png_malloc(png_ptr, - (png_uint_32)png_sizeof(png_text)); - text_ptr->compression = PNG_TEXT_COMPRESSION_zTXt; - text_ptr->key = key; -#ifdef PNG_iTXt_SUPPORTED - text_ptr->lang = NULL; - text_ptr->lang_key = NULL; -#endif - text_ptr->text = text; - - ret = png_set_text_2(png_ptr, info_ptr, text_ptr, 1); - - png_free(png_ptr, key); - png_free(png_ptr, text_ptr); - - if (ret) - png_warning(png_ptr, "Insufficient memory to store text chunk."); - } -} -#endif - -#if defined(PNG_READ_iTXt_SUPPORTED) -void /* PRIVATE */ -png_push_handle_iTXt(png_structp png_ptr, png_infop info_ptr, png_uint_32 - length) -{ - if (!(png_ptr->mode & PNG_HAVE_IHDR) || (png_ptr->mode & PNG_HAVE_IEND)) - { - png_error(png_ptr, "Out of place iTXt"); - /* to quiet some compiler warnings */ - if(info_ptr == NULL) return; - } - -#ifdef PNG_MAX_MALLOC_64K - png_ptr->skip_length = 0; /* This may not be necessary */ - - if (length > (png_uint_32)65535L) /* Can't hold entire string in memory */ - { - png_warning(png_ptr, "iTXt chunk too large to fit in memory"); - png_ptr->skip_length = length - (png_uint_32)65535L; - length = (png_uint_32)65535L; - } -#endif - - png_ptr->current_text = (png_charp)png_malloc(png_ptr, - (png_uint_32)(length+1)); - png_ptr->current_text[length] = '\0'; - png_ptr->current_text_ptr = png_ptr->current_text; - png_ptr->current_text_size = (png_size_t)length; - png_ptr->current_text_left = (png_size_t)length; - png_ptr->process_mode = PNG_READ_iTXt_MODE; -} - -void /* PRIVATE */ -png_push_read_iTXt(png_structp png_ptr, png_infop info_ptr) -{ - - if (png_ptr->buffer_size && png_ptr->current_text_left) - { - png_size_t text_size; - - if (png_ptr->buffer_size < png_ptr->current_text_left) - text_size = png_ptr->buffer_size; - else - text_size = png_ptr->current_text_left; - png_crc_read(png_ptr, (png_bytep)png_ptr->current_text_ptr, text_size); - png_ptr->current_text_left -= text_size; - png_ptr->current_text_ptr += text_size; - } - if (!(png_ptr->current_text_left)) - { - png_textp text_ptr; - png_charp key; - int comp_flag; - png_charp lang; - png_charp lang_key; - png_charp text; - int ret; - - if (png_ptr->buffer_size < 4) - { - png_push_save_buffer(png_ptr); - return; - } - - png_push_crc_finish(png_ptr); - -#if defined(PNG_MAX_MALLOC_64K) - if (png_ptr->skip_length) - return; -#endif - - key = png_ptr->current_text; - - for (lang = key; *lang; lang++) - /* empty loop */ ; - - if (lang != key + png_ptr->current_text_size) - lang++; - - comp_flag = *lang++; - lang++; /* skip comp_type, always zero */ - - for (lang_key = lang; *lang_key; lang_key++) - /* empty loop */ ; - lang_key++; /* skip NUL separator */ - - for (text = lang_key; *text; text++) - /* empty loop */ ; - - if (text != key + png_ptr->current_text_size) - text++; - - text_ptr = (png_textp)png_malloc(png_ptr, - (png_uint_32)png_sizeof(png_text)); - text_ptr->compression = comp_flag + 2; - text_ptr->key = key; - text_ptr->lang = lang; - text_ptr->lang_key = lang_key; - text_ptr->text = text; - text_ptr->text_length = 0; - text_ptr->itxt_length = png_strlen(text); - - ret = png_set_text_2(png_ptr, info_ptr, text_ptr, 1); - - png_ptr->current_text = NULL; - - png_free(png_ptr, text_ptr); - if (ret) - png_warning(png_ptr, "Insufficient memory to store iTXt chunk."); - } -} -#endif - -/* This function is called when we haven't found a handler for this - * chunk. If there isn't a problem with the chunk itself (ie a bad chunk - * name or a critical chunk), the chunk is (currently) silently ignored. - */ -void /* PRIVATE */ -png_push_handle_unknown(png_structp png_ptr, png_infop info_ptr, png_uint_32 - length) -{ - png_uint_32 skip=0; - png_check_chunk_name(png_ptr, png_ptr->chunk_name); - - if (!(png_ptr->chunk_name[0] & 0x20)) - { -#if defined(PNG_READ_UNKNOWN_CHUNKS_SUPPORTED) - if(png_handle_as_unknown(png_ptr, png_ptr->chunk_name) != - PNG_HANDLE_CHUNK_ALWAYS -#if defined(PNG_READ_USER_CHUNKS_SUPPORTED) - && png_ptr->read_user_chunk_fn == NULL -#endif - ) -#endif - png_chunk_error(png_ptr, "unknown critical chunk"); - - /* to quiet compiler warnings about unused info_ptr */ - if (info_ptr == NULL) - return; - } - -#if defined(PNG_READ_UNKNOWN_CHUNKS_SUPPORTED) - if (png_ptr->flags & PNG_FLAG_KEEP_UNKNOWN_CHUNKS) - { - png_unknown_chunk chunk; - -#ifdef PNG_MAX_MALLOC_64K - if (length > (png_uint_32)65535L) - { - png_warning(png_ptr, "unknown chunk too large to fit in memory"); - skip = length - (png_uint_32)65535L; - length = (png_uint_32)65535L; - } -#endif - - png_strcpy((png_charp)chunk.name, (png_charp)png_ptr->chunk_name); - chunk.data = (png_bytep)png_malloc(png_ptr, length); - png_crc_read(png_ptr, chunk.data, length); - chunk.size = length; -#if defined(PNG_READ_USER_CHUNKS_SUPPORTED) - if(png_ptr->read_user_chunk_fn != NULL) - { - /* callback to user unknown chunk handler */ - if ((*(png_ptr->read_user_chunk_fn)) (png_ptr, &chunk) <= 0) - { - if (!(png_ptr->chunk_name[0] & 0x20)) - if(png_handle_as_unknown(png_ptr, png_ptr->chunk_name) != - PNG_HANDLE_CHUNK_ALWAYS) - png_chunk_error(png_ptr, "unknown critical chunk"); - } - png_set_unknown_chunks(png_ptr, info_ptr, &chunk, 1); - } - else -#endif - png_set_unknown_chunks(png_ptr, info_ptr, &chunk, 1); - png_free(png_ptr, chunk.data); - } - else -#endif - skip=length; - png_push_crc_skip(png_ptr, skip); -} - -void /* PRIVATE */ -png_push_have_info(png_structp png_ptr, png_infop info_ptr) -{ - if (png_ptr->info_fn != NULL) - (*(png_ptr->info_fn))(png_ptr, info_ptr); -} - -void /* PRIVATE */ -png_push_have_end(png_structp png_ptr, png_infop info_ptr) -{ - if (png_ptr->end_fn != NULL) - (*(png_ptr->end_fn))(png_ptr, info_ptr); -} - -void /* PRIVATE */ -png_push_have_row(png_structp png_ptr, png_bytep row) -{ - if (png_ptr->row_fn != NULL) - (*(png_ptr->row_fn))(png_ptr, row, png_ptr->row_number, - (int)png_ptr->pass); -} - -void PNGAPI -png_progressive_combine_row (png_structp png_ptr, - png_bytep old_row, png_bytep new_row) -{ -#ifdef PNG_USE_LOCAL_ARRAYS - const int FARDATA png_pass_dsp_mask[7] = - {0xff, 0x0f, 0xff, 0x33, 0xff, 0x55, 0xff}; -#endif - if (new_row != NULL) /* new_row must == png_ptr->row_buf here. */ - png_combine_row(png_ptr, old_row, png_pass_dsp_mask[png_ptr->pass]); -} - -void PNGAPI -png_set_progressive_read_fn(png_structp png_ptr, png_voidp progressive_ptr, - png_progressive_info_ptr info_fn, png_progressive_row_ptr row_fn, - png_progressive_end_ptr end_fn) -{ - png_ptr->info_fn = info_fn; - png_ptr->row_fn = row_fn; - png_ptr->end_fn = end_fn; - - png_set_read_fn(png_ptr, progressive_ptr, png_push_fill_buffer); -} - -png_voidp PNGAPI -png_get_progressive_ptr(png_structp png_ptr) -{ - return png_ptr->io_ptr; -} -#endif /* PNG_PROGRESSIVE_READ_SUPPORTED */ diff --git a/wxWidgets/src/png/pngread.c b/wxWidgets/src/png/pngread.c deleted file mode 100644 index 22240227d6..0000000000 --- a/wxWidgets/src/png/pngread.c +++ /dev/null @@ -1,1453 +0,0 @@ - -/* pngread.c - read a PNG file - * - * libpng 1.2.7 - September 12, 2004 - * For conditions of distribution and use, see copyright notice in png.h - * Copyright (c) 1998-2004 Glenn Randers-Pehrson - * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) - * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) - * - * This file contains routines that an application calls directly to - * read a PNG file or stream. - */ - -#define PNG_INTERNAL -#include "png.h" - -/* Create a PNG structure for reading, and allocate any memory needed. */ -png_structp PNGAPI -png_create_read_struct(png_const_charp user_png_ver, png_voidp error_ptr, - png_error_ptr error_fn, png_error_ptr warn_fn) -{ - -#ifdef PNG_USER_MEM_SUPPORTED - return (png_create_read_struct_2(user_png_ver, error_ptr, error_fn, - warn_fn, png_voidp_NULL, png_malloc_ptr_NULL, png_free_ptr_NULL)); -} - -/* Alternate create PNG structure for reading, and allocate any memory needed. */ -png_structp PNGAPI -png_create_read_struct_2(png_const_charp user_png_ver, png_voidp error_ptr, - png_error_ptr error_fn, png_error_ptr warn_fn, png_voidp mem_ptr, - png_malloc_ptr malloc_fn, png_free_ptr free_fn) -{ -#endif /* PNG_USER_MEM_SUPPORTED */ - - png_structp png_ptr; - -#ifdef PNG_SETJMP_SUPPORTED -#ifdef USE_FAR_KEYWORD - jmp_buf jmpbuf; -#endif -#endif - - int i; - - png_debug(1, "in png_create_read_struct\n"); -#ifdef PNG_USER_MEM_SUPPORTED - png_ptr = (png_structp)png_create_struct_2(PNG_STRUCT_PNG, - (png_malloc_ptr)malloc_fn, (png_voidp)mem_ptr); -#else - png_ptr = (png_structp)png_create_struct(PNG_STRUCT_PNG); -#endif - if (png_ptr == NULL) - return (NULL); - -#if !defined(PNG_1_0_X) -#ifdef PNG_ASSEMBLER_CODE_SUPPORTED - png_init_mmx_flags(png_ptr); /* 1.2.0 addition */ -#endif -#endif /* PNG_1_0_X */ - - /* added at libpng-1.2.6 */ -#ifdef PNG_SET_USER_LIMITS_SUPPORTED - png_ptr->user_width_max=PNG_USER_WIDTH_MAX; - png_ptr->user_height_max=PNG_USER_HEIGHT_MAX; -#endif - -#ifdef PNG_SETJMP_SUPPORTED -#ifdef USE_FAR_KEYWORD - if (setjmp(jmpbuf)) -#else - if (setjmp(png_ptr->jmpbuf)) -#endif - { - png_free(png_ptr, png_ptr->zbuf); - png_ptr->zbuf=NULL; -#ifdef PNG_USER_MEM_SUPPORTED - png_destroy_struct_2((png_voidp)png_ptr, - (png_free_ptr)free_fn, (png_voidp)mem_ptr); -#else - png_destroy_struct((png_voidp)png_ptr); -#endif - return (NULL); - } -#ifdef USE_FAR_KEYWORD - png_memcpy(png_ptr->jmpbuf,jmpbuf,png_sizeof(jmp_buf)); -#endif -#endif - -#ifdef PNG_USER_MEM_SUPPORTED - png_set_mem_fn(png_ptr, mem_ptr, malloc_fn, free_fn); -#endif - - png_set_error_fn(png_ptr, error_ptr, error_fn, warn_fn); - - i=0; - do - { - if(user_png_ver[i] != png_libpng_ver[i]) - png_ptr->flags |= PNG_FLAG_LIBRARY_MISMATCH; - } while (png_libpng_ver[i++]); - - if (png_ptr->flags & PNG_FLAG_LIBRARY_MISMATCH) - { - /* Libpng 0.90 and later are binary incompatible with libpng 0.89, so - * we must recompile any applications that use any older library version. - * For versions after libpng 1.0, we will be compatible, so we need - * only check the first digit. - */ - if (user_png_ver == NULL || user_png_ver[0] != png_libpng_ver[0] || - (user_png_ver[0] == '1' && user_png_ver[2] != png_libpng_ver[2]) || - (user_png_ver[0] == '0' && user_png_ver[2] < '9')) - { -#if !defined(PNG_NO_STDIO) && !defined(_WIN32_WCE) - char msg[80]; - if (user_png_ver) - { - sprintf(msg, "Application was compiled with png.h from libpng-%.20s", - user_png_ver); - png_warning(png_ptr, msg); - } - sprintf(msg, "Application is running with png.c from libpng-%.20s", - png_libpng_ver); - png_warning(png_ptr, msg); -#endif -#ifdef PNG_ERROR_NUMBERS_SUPPORTED - png_ptr->flags=0; -#endif - png_error(png_ptr, - "Incompatible libpng version in application and library"); - } - } - - /* initialize zbuf - compression buffer */ - png_ptr->zbuf_size = PNG_ZBUF_SIZE; - png_ptr->zbuf = (png_bytep)png_malloc(png_ptr, - (png_uint_32)png_ptr->zbuf_size); - png_ptr->zstream.zalloc = png_zalloc; - png_ptr->zstream.zfree = png_zfree; - png_ptr->zstream.opaque = (voidpf)png_ptr; - - switch (inflateInit(&png_ptr->zstream)) - { - case Z_OK: /* Do nothing */ break; - case Z_MEM_ERROR: - case Z_STREAM_ERROR: png_error(png_ptr, "zlib memory error"); break; - case Z_VERSION_ERROR: png_error(png_ptr, "zlib version error"); break; - default: png_error(png_ptr, "Unknown zlib error"); - } - - png_ptr->zstream.next_out = png_ptr->zbuf; - png_ptr->zstream.avail_out = (uInt)png_ptr->zbuf_size; - - png_set_read_fn(png_ptr, png_voidp_NULL, png_rw_ptr_NULL); - -#ifdef PNG_SETJMP_SUPPORTED -/* Applications that neglect to set up their own setjmp() and then encounter - a png_error() will longjmp here. Since the jmpbuf is then meaningless we - abort instead of returning. */ -#ifdef USE_FAR_KEYWORD - if (setjmp(jmpbuf)) - PNG_ABORT(); - png_memcpy(png_ptr->jmpbuf,jmpbuf,png_sizeof(jmp_buf)); -#else - if (setjmp(png_ptr->jmpbuf)) - PNG_ABORT(); -#endif -#endif - return (png_ptr); -} - -/* Initialize PNG structure for reading, and allocate any memory needed. - This interface is deprecated in favour of the png_create_read_struct(), - and it will eventually disappear. */ -#undef png_read_init -void PNGAPI -png_read_init(png_structp png_ptr) -{ - /* We only come here via pre-1.0.7-compiled applications */ - png_read_init_2(png_ptr, "1.0.6 or earlier", 0, 0); -} - -void PNGAPI -png_read_init_2(png_structp png_ptr, png_const_charp user_png_ver, - png_size_t png_struct_size, png_size_t png_info_size) -{ - /* We only come here via pre-1.0.12-compiled applications */ -#if !defined(PNG_NO_STDIO) && !defined(_WIN32_WCE) - if(png_sizeof(png_struct) > png_struct_size || - png_sizeof(png_info) > png_info_size) - { - char msg[80]; - png_ptr->warning_fn=NULL; - if (user_png_ver) - { - sprintf(msg, "Application was compiled with png.h from libpng-%.20s", - user_png_ver); - png_warning(png_ptr, msg); - } - sprintf(msg, "Application is running with png.c from libpng-%.20s", - png_libpng_ver); - png_warning(png_ptr, msg); - } -#endif - if(png_sizeof(png_struct) > png_struct_size) - { - png_ptr->error_fn=NULL; -#ifdef PNG_ERROR_NUMBERS_SUPPORTED - png_ptr->flags=0; -#endif - png_error(png_ptr, - "The png struct allocated by the application for reading is too small."); - } - if(png_sizeof(png_info) > png_info_size) - { - png_ptr->error_fn=NULL; -#ifdef PNG_ERROR_NUMBERS_SUPPORTED - png_ptr->flags=0; -#endif - png_error(png_ptr, - "The info struct allocated by application for reading is too small."); - } - png_read_init_3(&png_ptr, user_png_ver, png_struct_size); -} - -void PNGAPI -png_read_init_3(png_structpp ptr_ptr, png_const_charp user_png_ver, - png_size_t png_struct_size) -{ -#ifdef PNG_SETJMP_SUPPORTED - jmp_buf tmp_jmp; /* to save current jump buffer */ -#endif - - int i=0; - - png_structp png_ptr=*ptr_ptr; - - do - { - if(user_png_ver[i] != png_libpng_ver[i]) - { -#ifdef PNG_LEGACY_SUPPORTED - png_ptr->flags |= PNG_FLAG_LIBRARY_MISMATCH; -#else - png_ptr->warning_fn=NULL; - png_warning(png_ptr, - "Application uses deprecated png_read_init() and should be recompiled."); - break; -#endif - } - } while (png_libpng_ver[i++]); - - png_debug(1, "in png_read_init_3\n"); - -#ifdef PNG_SETJMP_SUPPORTED - /* save jump buffer and error functions */ - png_memcpy(tmp_jmp, png_ptr->jmpbuf, png_sizeof (jmp_buf)); -#endif - - if(png_sizeof(png_struct) > png_struct_size) - { - png_destroy_struct(png_ptr); - *ptr_ptr = (png_structp)png_create_struct(PNG_STRUCT_PNG); - png_ptr = *ptr_ptr; - } - - /* reset all variables to 0 */ - png_memset(png_ptr, 0, png_sizeof (png_struct)); - -#ifdef PNG_SETJMP_SUPPORTED - /* restore jump buffer */ - png_memcpy(png_ptr->jmpbuf, tmp_jmp, png_sizeof (jmp_buf)); -#endif - - /* added at libpng-1.2.6 */ -#ifdef PNG_SET_USER_LIMITS_SUPPORTED - png_ptr->user_width_max=PNG_USER_WIDTH_MAX; - png_ptr->user_height_max=PNG_USER_HEIGHT_MAX; -#endif - - /* initialize zbuf - compression buffer */ - png_ptr->zbuf_size = PNG_ZBUF_SIZE; - png_ptr->zbuf = (png_bytep)png_malloc(png_ptr, - (png_uint_32)png_ptr->zbuf_size); - png_ptr->zstream.zalloc = png_zalloc; - png_ptr->zstream.zfree = png_zfree; - png_ptr->zstream.opaque = (voidpf)png_ptr; - - switch (inflateInit(&png_ptr->zstream)) - { - case Z_OK: /* Do nothing */ break; - case Z_MEM_ERROR: - case Z_STREAM_ERROR: png_error(png_ptr, "zlib memory"); break; - case Z_VERSION_ERROR: png_error(png_ptr, "zlib version"); break; - default: png_error(png_ptr, "Unknown zlib error"); - } - - png_ptr->zstream.next_out = png_ptr->zbuf; - png_ptr->zstream.avail_out = (uInt)png_ptr->zbuf_size; - - png_set_read_fn(png_ptr, png_voidp_NULL, png_rw_ptr_NULL); -} - -#ifndef PNG_NO_SEQUENTIAL_READ_SUPPORTED -/* Read the information before the actual image data. This has been - * changed in v0.90 to allow reading a file that already has the magic - * bytes read from the stream. You can tell libpng how many bytes have - * been read from the beginning of the stream (up to the maximum of 8) - * via png_set_sig_bytes(), and we will only check the remaining bytes - * here. The application can then have access to the signature bytes we - * read if it is determined that this isn't a valid PNG file. - */ -void PNGAPI -png_read_info(png_structp png_ptr, png_infop info_ptr) -{ - png_debug(1, "in png_read_info\n"); - /* If we haven't checked all of the PNG signature bytes, do so now. */ - if (png_ptr->sig_bytes < 8) - { - png_size_t num_checked = png_ptr->sig_bytes, - num_to_check = 8 - num_checked; - - png_read_data(png_ptr, &(info_ptr->signature[num_checked]), num_to_check); - png_ptr->sig_bytes = 8; - - if (png_sig_cmp(info_ptr->signature, num_checked, num_to_check)) - { - if (num_checked < 4 && - png_sig_cmp(info_ptr->signature, num_checked, num_to_check - 4)) - png_error(png_ptr, "Not a PNG file"); - else - png_error(png_ptr, "PNG file corrupted by ASCII conversion"); - } - if (num_checked < 3) - png_ptr->mode |= PNG_HAVE_PNG_SIGNATURE; - } - - for(;;) - { -#ifdef PNG_USE_LOCAL_ARRAYS - PNG_IHDR; - PNG_IDAT; - PNG_IEND; - PNG_PLTE; -#if defined(PNG_READ_bKGD_SUPPORTED) - PNG_bKGD; -#endif -#if defined(PNG_READ_cHRM_SUPPORTED) - PNG_cHRM; -#endif -#if defined(PNG_READ_gAMA_SUPPORTED) - PNG_gAMA; -#endif -#if defined(PNG_READ_hIST_SUPPORTED) - PNG_hIST; -#endif -#if defined(PNG_READ_iCCP_SUPPORTED) - PNG_iCCP; -#endif -#if defined(PNG_READ_iTXt_SUPPORTED) - PNG_iTXt; -#endif -#if defined(PNG_READ_oFFs_SUPPORTED) - PNG_oFFs; -#endif -#if defined(PNG_READ_pCAL_SUPPORTED) - PNG_pCAL; -#endif -#if defined(PNG_READ_pHYs_SUPPORTED) - PNG_pHYs; -#endif -#if defined(PNG_READ_sBIT_SUPPORTED) - PNG_sBIT; -#endif -#if defined(PNG_READ_sCAL_SUPPORTED) - PNG_sCAL; -#endif -#if defined(PNG_READ_sPLT_SUPPORTED) - PNG_sPLT; -#endif -#if defined(PNG_READ_sRGB_SUPPORTED) - PNG_sRGB; -#endif -#if defined(PNG_READ_tEXt_SUPPORTED) - PNG_tEXt; -#endif -#if defined(PNG_READ_tIME_SUPPORTED) - PNG_tIME; -#endif -#if defined(PNG_READ_tRNS_SUPPORTED) - PNG_tRNS; -#endif -#if defined(PNG_READ_zTXt_SUPPORTED) - PNG_zTXt; -#endif -#endif /* PNG_GLOBAL_ARRAYS */ - png_byte chunk_length[4]; - png_uint_32 length; - - png_read_data(png_ptr, chunk_length, 4); - length = png_get_uint_31(png_ptr,chunk_length); - - png_reset_crc(png_ptr); - png_crc_read(png_ptr, png_ptr->chunk_name, 4); - - png_debug2(0, "Reading %s chunk, length=%lu.\n", png_ptr->chunk_name, - length); - - /* This should be a binary subdivision search or a hash for - * matching the chunk name rather than a linear search. - */ - if (!png_memcmp(png_ptr->chunk_name, png_IHDR, 4)) - png_handle_IHDR(png_ptr, info_ptr, length); - else if (!png_memcmp(png_ptr->chunk_name, png_IEND, 4)) - png_handle_IEND(png_ptr, info_ptr, length); -#ifdef PNG_HANDLE_AS_UNKNOWN_SUPPORTED - else if (png_handle_as_unknown(png_ptr, png_ptr->chunk_name)) - { - if (!png_memcmp(png_ptr->chunk_name, png_IDAT, 4)) - png_ptr->mode |= PNG_HAVE_IDAT; - png_handle_unknown(png_ptr, info_ptr, length); - if (!png_memcmp(png_ptr->chunk_name, png_PLTE, 4)) - png_ptr->mode |= PNG_HAVE_PLTE; - else if (!png_memcmp(png_ptr->chunk_name, png_IDAT, 4)) - { - if (!(png_ptr->mode & PNG_HAVE_IHDR)) - png_error(png_ptr, "Missing IHDR before IDAT"); - else if (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE && - !(png_ptr->mode & PNG_HAVE_PLTE)) - png_error(png_ptr, "Missing PLTE before IDAT"); - break; - } - } -#endif - else if (!png_memcmp(png_ptr->chunk_name, png_PLTE, 4)) - png_handle_PLTE(png_ptr, info_ptr, length); - else if (!png_memcmp(png_ptr->chunk_name, png_IDAT, 4)) - { - if (!(png_ptr->mode & PNG_HAVE_IHDR)) - png_error(png_ptr, "Missing IHDR before IDAT"); - else if (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE && - !(png_ptr->mode & PNG_HAVE_PLTE)) - png_error(png_ptr, "Missing PLTE before IDAT"); - - png_ptr->idat_size = length; - png_ptr->mode |= PNG_HAVE_IDAT; - break; - } -#if defined(PNG_READ_bKGD_SUPPORTED) - else if (!png_memcmp(png_ptr->chunk_name, png_bKGD, 4)) - png_handle_bKGD(png_ptr, info_ptr, length); -#endif -#if defined(PNG_READ_cHRM_SUPPORTED) - else if (!png_memcmp(png_ptr->chunk_name, png_cHRM, 4)) - png_handle_cHRM(png_ptr, info_ptr, length); -#endif -#if defined(PNG_READ_gAMA_SUPPORTED) - else if (!png_memcmp(png_ptr->chunk_name, png_gAMA, 4)) - png_handle_gAMA(png_ptr, info_ptr, length); -#endif -#if defined(PNG_READ_hIST_SUPPORTED) - else if (!png_memcmp(png_ptr->chunk_name, png_hIST, 4)) - png_handle_hIST(png_ptr, info_ptr, length); -#endif -#if defined(PNG_READ_oFFs_SUPPORTED) - else if (!png_memcmp(png_ptr->chunk_name, png_oFFs, 4)) - png_handle_oFFs(png_ptr, info_ptr, length); -#endif -#if defined(PNG_READ_pCAL_SUPPORTED) - else if (!png_memcmp(png_ptr->chunk_name, png_pCAL, 4)) - png_handle_pCAL(png_ptr, info_ptr, length); -#endif -#if defined(PNG_READ_sCAL_SUPPORTED) - else if (!png_memcmp(png_ptr->chunk_name, png_sCAL, 4)) - png_handle_sCAL(png_ptr, info_ptr, length); -#endif -#if defined(PNG_READ_pHYs_SUPPORTED) - else if (!png_memcmp(png_ptr->chunk_name, png_pHYs, 4)) - png_handle_pHYs(png_ptr, info_ptr, length); -#endif -#if defined(PNG_READ_sBIT_SUPPORTED) - else if (!png_memcmp(png_ptr->chunk_name, png_sBIT, 4)) - png_handle_sBIT(png_ptr, info_ptr, length); -#endif -#if defined(PNG_READ_sRGB_SUPPORTED) - else if (!png_memcmp(png_ptr->chunk_name, png_sRGB, 4)) - png_handle_sRGB(png_ptr, info_ptr, length); -#endif -#if defined(PNG_READ_iCCP_SUPPORTED) - else if (!png_memcmp(png_ptr->chunk_name, png_iCCP, 4)) - png_handle_iCCP(png_ptr, info_ptr, length); -#endif -#if defined(PNG_READ_sPLT_SUPPORTED) - else if (!png_memcmp(png_ptr->chunk_name, png_sPLT, 4)) - png_handle_sPLT(png_ptr, info_ptr, length); -#endif -#if defined(PNG_READ_tEXt_SUPPORTED) - else if (!png_memcmp(png_ptr->chunk_name, png_tEXt, 4)) - png_handle_tEXt(png_ptr, info_ptr, length); -#endif -#if defined(PNG_READ_tIME_SUPPORTED) - else if (!png_memcmp(png_ptr->chunk_name, png_tIME, 4)) - png_handle_tIME(png_ptr, info_ptr, length); -#endif -#if defined(PNG_READ_tRNS_SUPPORTED) - else if (!png_memcmp(png_ptr->chunk_name, png_tRNS, 4)) - png_handle_tRNS(png_ptr, info_ptr, length); -#endif -#if defined(PNG_READ_zTXt_SUPPORTED) - else if (!png_memcmp(png_ptr->chunk_name, png_zTXt, 4)) - png_handle_zTXt(png_ptr, info_ptr, length); -#endif -#if defined(PNG_READ_iTXt_SUPPORTED) - else if (!png_memcmp(png_ptr->chunk_name, png_iTXt, 4)) - png_handle_iTXt(png_ptr, info_ptr, length); -#endif - else - png_handle_unknown(png_ptr, info_ptr, length); - } -} -#endif /* PNG_NO_SEQUENTIAL_READ_SUPPORTED */ - -/* optional call to update the users info_ptr structure */ -void PNGAPI -png_read_update_info(png_structp png_ptr, png_infop info_ptr) -{ - png_debug(1, "in png_read_update_info\n"); - if (!(png_ptr->flags & PNG_FLAG_ROW_INIT)) - png_read_start_row(png_ptr); - else - png_warning(png_ptr, - "Ignoring extra png_read_update_info() call; row buffer not reallocated"); - png_read_transform_info(png_ptr, info_ptr); -} - -#ifndef PNG_NO_SEQUENTIAL_READ_SUPPORTED -/* Initialize palette, background, etc, after transformations - * are set, but before any reading takes place. This allows - * the user to obtain a gamma-corrected palette, for example. - * If the user doesn't call this, we will do it ourselves. - */ -void PNGAPI -png_start_read_image(png_structp png_ptr) -{ - png_debug(1, "in png_start_read_image\n"); - if (!(png_ptr->flags & PNG_FLAG_ROW_INIT)) - png_read_start_row(png_ptr); -} -#endif /* PNG_NO_SEQUENTIAL_READ_SUPPORTED */ - -#ifndef PNG_NO_SEQUENTIAL_READ_SUPPORTED -void PNGAPI -png_read_row(png_structp png_ptr, png_bytep row, png_bytep dsp_row) -{ -#ifdef PNG_USE_LOCAL_ARRAYS - PNG_IDAT; - const int png_pass_dsp_mask[7] = {0xff, 0x0f, 0xff, 0x33, 0xff, 0x55, 0xff}; - const int png_pass_mask[7] = {0x80, 0x08, 0x88, 0x22, 0xaa, 0x55, 0xff}; -#endif - int ret; - png_debug2(1, "in png_read_row (row %lu, pass %d)\n", - png_ptr->row_number, png_ptr->pass); - if (!(png_ptr->flags & PNG_FLAG_ROW_INIT)) - png_read_start_row(png_ptr); - if (png_ptr->row_number == 0 && png_ptr->pass == 0) - { - /* check for transforms that have been set but were defined out */ -#if defined(PNG_WRITE_INVERT_SUPPORTED) && !defined(PNG_READ_INVERT_SUPPORTED) - if (png_ptr->transformations & PNG_INVERT_MONO) - png_warning(png_ptr, "PNG_READ_INVERT_SUPPORTED is not defined."); -#endif -#if defined(PNG_WRITE_FILLER_SUPPORTED) && !defined(PNG_READ_FILLER_SUPPORTED) - if (png_ptr->transformations & PNG_FILLER) - png_warning(png_ptr, "PNG_READ_FILLER_SUPPORTED is not defined."); -#endif -#if defined(PNG_WRITE_PACKSWAP_SUPPORTED) && !defined(PNG_READ_PACKSWAP_SUPPORTED) - if (png_ptr->transformations & PNG_PACKSWAP) - png_warning(png_ptr, "PNG_READ_PACKSWAP_SUPPORTED is not defined."); -#endif -#if defined(PNG_WRITE_PACK_SUPPORTED) && !defined(PNG_READ_PACK_SUPPORTED) - if (png_ptr->transformations & PNG_PACK) - png_warning(png_ptr, "PNG_READ_PACK_SUPPORTED is not defined."); -#endif -#if defined(PNG_WRITE_SHIFT_SUPPORTED) && !defined(PNG_READ_SHIFT_SUPPORTED) - if (png_ptr->transformations & PNG_SHIFT) - png_warning(png_ptr, "PNG_READ_SHIFT_SUPPORTED is not defined."); -#endif -#if defined(PNG_WRITE_BGR_SUPPORTED) && !defined(PNG_READ_BGR_SUPPORTED) - if (png_ptr->transformations & PNG_BGR) - png_warning(png_ptr, "PNG_READ_BGR_SUPPORTED is not defined."); -#endif -#if defined(PNG_WRITE_SWAP_SUPPORTED) && !defined(PNG_READ_SWAP_SUPPORTED) - if (png_ptr->transformations & PNG_SWAP_BYTES) - png_warning(png_ptr, "PNG_READ_SWAP_SUPPORTED is not defined."); -#endif - } - -#if defined(PNG_READ_INTERLACING_SUPPORTED) - /* if interlaced and we do not need a new row, combine row and return */ - if (png_ptr->interlaced && (png_ptr->transformations & PNG_INTERLACE)) - { - switch (png_ptr->pass) - { - case 0: - if (png_ptr->row_number & 0x07) - { - if (dsp_row != NULL) - png_combine_row(png_ptr, dsp_row, - png_pass_dsp_mask[png_ptr->pass]); - png_read_finish_row(png_ptr); - return; - } - break; - case 1: - if ((png_ptr->row_number & 0x07) || png_ptr->width < 5) - { - if (dsp_row != NULL) - png_combine_row(png_ptr, dsp_row, - png_pass_dsp_mask[png_ptr->pass]); - png_read_finish_row(png_ptr); - return; - } - break; - case 2: - if ((png_ptr->row_number & 0x07) != 4) - { - if (dsp_row != NULL && (png_ptr->row_number & 4)) - png_combine_row(png_ptr, dsp_row, - png_pass_dsp_mask[png_ptr->pass]); - png_read_finish_row(png_ptr); - return; - } - break; - case 3: - if ((png_ptr->row_number & 3) || png_ptr->width < 3) - { - if (dsp_row != NULL) - png_combine_row(png_ptr, dsp_row, - png_pass_dsp_mask[png_ptr->pass]); - png_read_finish_row(png_ptr); - return; - } - break; - case 4: - if ((png_ptr->row_number & 3) != 2) - { - if (dsp_row != NULL && (png_ptr->row_number & 2)) - png_combine_row(png_ptr, dsp_row, - png_pass_dsp_mask[png_ptr->pass]); - png_read_finish_row(png_ptr); - return; - } - break; - case 5: - if ((png_ptr->row_number & 1) || png_ptr->width < 2) - { - if (dsp_row != NULL) - png_combine_row(png_ptr, dsp_row, - png_pass_dsp_mask[png_ptr->pass]); - png_read_finish_row(png_ptr); - return; - } - break; - case 6: - if (!(png_ptr->row_number & 1)) - { - png_read_finish_row(png_ptr); - return; - } - break; - } - } -#endif - - if (!(png_ptr->mode & PNG_HAVE_IDAT)) - png_error(png_ptr, "Invalid attempt to read row data"); - - png_ptr->zstream.next_out = png_ptr->row_buf; - png_ptr->zstream.avail_out = (uInt)png_ptr->irowbytes; - do - { - if (!(png_ptr->zstream.avail_in)) - { - while (!png_ptr->idat_size) - { - png_byte chunk_length[4]; - - png_crc_finish(png_ptr, 0); - - png_read_data(png_ptr, chunk_length, 4); - png_ptr->idat_size = png_get_uint_31(png_ptr,chunk_length); - - png_reset_crc(png_ptr); - png_crc_read(png_ptr, png_ptr->chunk_name, 4); - if (png_memcmp(png_ptr->chunk_name, png_IDAT, 4)) - png_error(png_ptr, "Not enough image data"); - } - png_ptr->zstream.avail_in = (uInt)png_ptr->zbuf_size; - png_ptr->zstream.next_in = png_ptr->zbuf; - if (png_ptr->zbuf_size > png_ptr->idat_size) - png_ptr->zstream.avail_in = (uInt)png_ptr->idat_size; - png_crc_read(png_ptr, png_ptr->zbuf, - (png_size_t)png_ptr->zstream.avail_in); - png_ptr->idat_size -= png_ptr->zstream.avail_in; - } - ret = inflate(&png_ptr->zstream, Z_PARTIAL_FLUSH); - if (ret == Z_STREAM_END) - { - if (png_ptr->zstream.avail_out || png_ptr->zstream.avail_in || - png_ptr->idat_size) - png_error(png_ptr, "Extra compressed data"); - png_ptr->mode |= PNG_AFTER_IDAT; - png_ptr->flags |= PNG_FLAG_ZLIB_FINISHED; - break; - } - if (ret != Z_OK) - png_error(png_ptr, png_ptr->zstream.msg ? png_ptr->zstream.msg : - "Decompression error"); - - } while (png_ptr->zstream.avail_out); - - png_ptr->row_info.color_type = png_ptr->color_type; - png_ptr->row_info.width = png_ptr->iwidth; - png_ptr->row_info.channels = png_ptr->channels; - png_ptr->row_info.bit_depth = png_ptr->bit_depth; - png_ptr->row_info.pixel_depth = png_ptr->pixel_depth; - png_ptr->row_info.rowbytes = PNG_ROWBYTES(png_ptr->row_info.pixel_depth, - png_ptr->row_info.width); - - if(png_ptr->row_buf[0]) - png_read_filter_row(png_ptr, &(png_ptr->row_info), - png_ptr->row_buf + 1, png_ptr->prev_row + 1, - (int)(png_ptr->row_buf[0])); - - png_memcpy_check(png_ptr, png_ptr->prev_row, png_ptr->row_buf, - png_ptr->rowbytes + 1); - -#if defined(PNG_MNG_FEATURES_SUPPORTED) - if((png_ptr->mng_features_permitted & PNG_FLAG_MNG_FILTER_64) && - (png_ptr->filter_type == PNG_INTRAPIXEL_DIFFERENCING)) - { - /* Intrapixel differencing */ - png_do_read_intrapixel(&(png_ptr->row_info), png_ptr->row_buf + 1); - } -#endif - - if (png_ptr->transformations) - png_do_read_transformations(png_ptr); - -#if defined(PNG_READ_INTERLACING_SUPPORTED) - /* blow up interlaced rows to full size */ - if (png_ptr->interlaced && - (png_ptr->transformations & PNG_INTERLACE)) - { - if (png_ptr->pass < 6) -/* old interface (pre-1.0.9): - png_do_read_interlace(&(png_ptr->row_info), - png_ptr->row_buf + 1, png_ptr->pass, png_ptr->transformations); - */ - png_do_read_interlace(png_ptr); - - if (dsp_row != NULL) - png_combine_row(png_ptr, dsp_row, - png_pass_dsp_mask[png_ptr->pass]); - if (row != NULL) - png_combine_row(png_ptr, row, - png_pass_mask[png_ptr->pass]); - } - else -#endif - { - if (row != NULL) - png_combine_row(png_ptr, row, 0xff); - if (dsp_row != NULL) - png_combine_row(png_ptr, dsp_row, 0xff); - } - png_read_finish_row(png_ptr); - - if (png_ptr->read_row_fn != NULL) - (*(png_ptr->read_row_fn))(png_ptr, png_ptr->row_number, png_ptr->pass); -} -#endif /* PNG_NO_SEQUENTIAL_READ_SUPPORTED */ - -#ifndef PNG_NO_SEQUENTIAL_READ_SUPPORTED -/* Read one or more rows of image data. If the image is interlaced, - * and png_set_interlace_handling() has been called, the rows need to - * contain the contents of the rows from the previous pass. If the - * image has alpha or transparency, and png_handle_alpha()[*] has been - * called, the rows contents must be initialized to the contents of the - * screen. - * - * "row" holds the actual image, and pixels are placed in it - * as they arrive. If the image is displayed after each pass, it will - * appear to "sparkle" in. "display_row" can be used to display a - * "chunky" progressive image, with finer detail added as it becomes - * available. If you do not want this "chunky" display, you may pass - * NULL for display_row. If you do not want the sparkle display, and - * you have not called png_handle_alpha(), you may pass NULL for rows. - * If you have called png_handle_alpha(), and the image has either an - * alpha channel or a transparency chunk, you must provide a buffer for - * rows. In this case, you do not have to provide a display_row buffer - * also, but you may. If the image is not interlaced, or if you have - * not called png_set_interlace_handling(), the display_row buffer will - * be ignored, so pass NULL to it. - * - * [*] png_handle_alpha() does not exist yet, as of libpng version 1.2.7 - */ - -void PNGAPI -png_read_rows(png_structp png_ptr, png_bytepp row, - png_bytepp display_row, png_uint_32 num_rows) -{ - png_uint_32 i; - png_bytepp rp; - png_bytepp dp; - - png_debug(1, "in png_read_rows\n"); - rp = row; - dp = display_row; - if (rp != NULL && dp != NULL) - for (i = 0; i < num_rows; i++) - { - png_bytep rptr = *rp++; - png_bytep dptr = *dp++; - - png_read_row(png_ptr, rptr, dptr); - } - else if(rp != NULL) - for (i = 0; i < num_rows; i++) - { - png_bytep rptr = *rp; - png_read_row(png_ptr, rptr, png_bytep_NULL); - rp++; - } - else if(dp != NULL) - for (i = 0; i < num_rows; i++) - { - png_bytep dptr = *dp; - png_read_row(png_ptr, png_bytep_NULL, dptr); - dp++; - } -} -#endif /* PNG_NO_SEQUENTIAL_READ_SUPPORTED */ - -#ifndef PNG_NO_SEQUENTIAL_READ_SUPPORTED -/* Read the entire image. If the image has an alpha channel or a tRNS - * chunk, and you have called png_handle_alpha()[*], you will need to - * initialize the image to the current image that PNG will be overlaying. - * We set the num_rows again here, in case it was incorrectly set in - * png_read_start_row() by a call to png_read_update_info() or - * png_start_read_image() if png_set_interlace_handling() wasn't called - * prior to either of these functions like it should have been. You can - * only call this function once. If you desire to have an image for - * each pass of a interlaced image, use png_read_rows() instead. - * - * [*] png_handle_alpha() does not exist yet, as of libpng version 1.2.7 - */ -void PNGAPI -png_read_image(png_structp png_ptr, png_bytepp image) -{ - png_uint_32 i,image_height; - int pass, j; - png_bytepp rp; - - png_debug(1, "in png_read_image\n"); - -#ifdef PNG_READ_INTERLACING_SUPPORTED - pass = png_set_interlace_handling(png_ptr); -#else - if (png_ptr->interlaced) - png_error(png_ptr, - "Cannot read interlaced image -- interlace handler disabled."); - pass = 1; -#endif - - - image_height=png_ptr->height; - png_ptr->num_rows = image_height; /* Make sure this is set correctly */ - - for (j = 0; j < pass; j++) - { - rp = image; - for (i = 0; i < image_height; i++) - { - png_read_row(png_ptr, *rp, png_bytep_NULL); - rp++; - } - } -} -#endif /* PNG_NO_SEQUENTIAL_READ_SUPPORTED */ - -#ifndef PNG_NO_SEQUENTIAL_READ_SUPPORTED -/* Read the end of the PNG file. Will not read past the end of the - * file, will verify the end is accurate, and will read any comments - * or time information at the end of the file, if info is not NULL. - */ -void PNGAPI -png_read_end(png_structp png_ptr, png_infop info_ptr) -{ - png_byte chunk_length[4]; - png_uint_32 length; - - png_debug(1, "in png_read_end\n"); - png_crc_finish(png_ptr, 0); /* Finish off CRC from last IDAT chunk */ - - do - { -#ifdef PNG_USE_LOCAL_ARRAYS - PNG_IHDR; - PNG_IDAT; - PNG_IEND; - PNG_PLTE; -#if defined(PNG_READ_bKGD_SUPPORTED) - PNG_bKGD; -#endif -#if defined(PNG_READ_cHRM_SUPPORTED) - PNG_cHRM; -#endif -#if defined(PNG_READ_gAMA_SUPPORTED) - PNG_gAMA; -#endif -#if defined(PNG_READ_hIST_SUPPORTED) - PNG_hIST; -#endif -#if defined(PNG_READ_iCCP_SUPPORTED) - PNG_iCCP; -#endif -#if defined(PNG_READ_iTXt_SUPPORTED) - PNG_iTXt; -#endif -#if defined(PNG_READ_oFFs_SUPPORTED) - PNG_oFFs; -#endif -#if defined(PNG_READ_pCAL_SUPPORTED) - PNG_pCAL; -#endif -#if defined(PNG_READ_pHYs_SUPPORTED) - PNG_pHYs; -#endif -#if defined(PNG_READ_sBIT_SUPPORTED) - PNG_sBIT; -#endif -#if defined(PNG_READ_sCAL_SUPPORTED) - PNG_sCAL; -#endif -#if defined(PNG_READ_sPLT_SUPPORTED) - PNG_sPLT; -#endif -#if defined(PNG_READ_sRGB_SUPPORTED) - PNG_sRGB; -#endif -#if defined(PNG_READ_tEXt_SUPPORTED) - PNG_tEXt; -#endif -#if defined(PNG_READ_tIME_SUPPORTED) - PNG_tIME; -#endif -#if defined(PNG_READ_tRNS_SUPPORTED) - PNG_tRNS; -#endif -#if defined(PNG_READ_zTXt_SUPPORTED) - PNG_zTXt; -#endif -#endif /* PNG_GLOBAL_ARRAYS */ - - png_read_data(png_ptr, chunk_length, 4); - length = png_get_uint_31(png_ptr,chunk_length); - - png_reset_crc(png_ptr); - png_crc_read(png_ptr, png_ptr->chunk_name, 4); - - png_debug1(0, "Reading %s chunk.\n", png_ptr->chunk_name); - - if (!png_memcmp(png_ptr->chunk_name, png_IHDR, 4)) - png_handle_IHDR(png_ptr, info_ptr, length); - else if (!png_memcmp(png_ptr->chunk_name, png_IEND, 4)) - png_handle_IEND(png_ptr, info_ptr, length); -#ifdef PNG_HANDLE_AS_UNKNOWN_SUPPORTED - else if (png_handle_as_unknown(png_ptr, png_ptr->chunk_name)) - { - if (!png_memcmp(png_ptr->chunk_name, png_IDAT, 4)) - { - if (length > 0 || png_ptr->mode & PNG_AFTER_IDAT) - png_error(png_ptr, "Too many IDAT's found"); - } - else - png_ptr->mode |= PNG_AFTER_IDAT; - png_handle_unknown(png_ptr, info_ptr, length); - if (!png_memcmp(png_ptr->chunk_name, png_PLTE, 4)) - png_ptr->mode |= PNG_HAVE_PLTE; - } -#endif - else if (!png_memcmp(png_ptr->chunk_name, png_IDAT, 4)) - { - /* Zero length IDATs are legal after the last IDAT has been - * read, but not after other chunks have been read. - */ - if (length > 0 || png_ptr->mode & PNG_AFTER_IDAT) - png_error(png_ptr, "Too many IDAT's found"); - png_crc_finish(png_ptr, length); - } - else if (!png_memcmp(png_ptr->chunk_name, png_PLTE, 4)) - png_handle_PLTE(png_ptr, info_ptr, length); -#if defined(PNG_READ_bKGD_SUPPORTED) - else if (!png_memcmp(png_ptr->chunk_name, png_bKGD, 4)) - png_handle_bKGD(png_ptr, info_ptr, length); -#endif -#if defined(PNG_READ_cHRM_SUPPORTED) - else if (!png_memcmp(png_ptr->chunk_name, png_cHRM, 4)) - png_handle_cHRM(png_ptr, info_ptr, length); -#endif -#if defined(PNG_READ_gAMA_SUPPORTED) - else if (!png_memcmp(png_ptr->chunk_name, png_gAMA, 4)) - png_handle_gAMA(png_ptr, info_ptr, length); -#endif -#if defined(PNG_READ_hIST_SUPPORTED) - else if (!png_memcmp(png_ptr->chunk_name, png_hIST, 4)) - png_handle_hIST(png_ptr, info_ptr, length); -#endif -#if defined(PNG_READ_oFFs_SUPPORTED) - else if (!png_memcmp(png_ptr->chunk_name, png_oFFs, 4)) - png_handle_oFFs(png_ptr, info_ptr, length); -#endif -#if defined(PNG_READ_pCAL_SUPPORTED) - else if (!png_memcmp(png_ptr->chunk_name, png_pCAL, 4)) - png_handle_pCAL(png_ptr, info_ptr, length); -#endif -#if defined(PNG_READ_sCAL_SUPPORTED) - else if (!png_memcmp(png_ptr->chunk_name, png_sCAL, 4)) - png_handle_sCAL(png_ptr, info_ptr, length); -#endif -#if defined(PNG_READ_pHYs_SUPPORTED) - else if (!png_memcmp(png_ptr->chunk_name, png_pHYs, 4)) - png_handle_pHYs(png_ptr, info_ptr, length); -#endif -#if defined(PNG_READ_sBIT_SUPPORTED) - else if (!png_memcmp(png_ptr->chunk_name, png_sBIT, 4)) - png_handle_sBIT(png_ptr, info_ptr, length); -#endif -#if defined(PNG_READ_sRGB_SUPPORTED) - else if (!png_memcmp(png_ptr->chunk_name, png_sRGB, 4)) - png_handle_sRGB(png_ptr, info_ptr, length); -#endif -#if defined(PNG_READ_iCCP_SUPPORTED) - else if (!png_memcmp(png_ptr->chunk_name, png_iCCP, 4)) - png_handle_iCCP(png_ptr, info_ptr, length); -#endif -#if defined(PNG_READ_sPLT_SUPPORTED) - else if (!png_memcmp(png_ptr->chunk_name, png_sPLT, 4)) - png_handle_sPLT(png_ptr, info_ptr, length); -#endif -#if defined(PNG_READ_tEXt_SUPPORTED) - else if (!png_memcmp(png_ptr->chunk_name, png_tEXt, 4)) - png_handle_tEXt(png_ptr, info_ptr, length); -#endif -#if defined(PNG_READ_tIME_SUPPORTED) - else if (!png_memcmp(png_ptr->chunk_name, png_tIME, 4)) - png_handle_tIME(png_ptr, info_ptr, length); -#endif -#if defined(PNG_READ_tRNS_SUPPORTED) - else if (!png_memcmp(png_ptr->chunk_name, png_tRNS, 4)) - png_handle_tRNS(png_ptr, info_ptr, length); -#endif -#if defined(PNG_READ_zTXt_SUPPORTED) - else if (!png_memcmp(png_ptr->chunk_name, png_zTXt, 4)) - png_handle_zTXt(png_ptr, info_ptr, length); -#endif -#if defined(PNG_READ_iTXt_SUPPORTED) - else if (!png_memcmp(png_ptr->chunk_name, png_iTXt, 4)) - png_handle_iTXt(png_ptr, info_ptr, length); -#endif - else - png_handle_unknown(png_ptr, info_ptr, length); - } while (!(png_ptr->mode & PNG_HAVE_IEND)); -} -#endif /* PNG_NO_SEQUENTIAL_READ_SUPPORTED */ - -/* free all memory used by the read */ -void PNGAPI -png_destroy_read_struct(png_structpp png_ptr_ptr, png_infopp info_ptr_ptr, - png_infopp end_info_ptr_ptr) -{ - png_structp png_ptr = NULL; - png_infop info_ptr = NULL, end_info_ptr = NULL; -#ifdef PNG_USER_MEM_SUPPORTED - png_free_ptr free_fn; - png_voidp mem_ptr; -#endif - - png_debug(1, "in png_destroy_read_struct\n"); - if (png_ptr_ptr != NULL) - png_ptr = *png_ptr_ptr; - - if (info_ptr_ptr != NULL) - info_ptr = *info_ptr_ptr; - - if (end_info_ptr_ptr != NULL) - end_info_ptr = *end_info_ptr_ptr; - -#ifdef PNG_USER_MEM_SUPPORTED - free_fn = png_ptr->free_fn; - mem_ptr = png_ptr->mem_ptr; -#endif - - png_read_destroy(png_ptr, info_ptr, end_info_ptr); - - if (info_ptr != NULL) - { -#if defined(PNG_TEXT_SUPPORTED) - png_free_data(png_ptr, info_ptr, PNG_FREE_TEXT, -1); -#endif - -#ifdef PNG_USER_MEM_SUPPORTED - png_destroy_struct_2((png_voidp)info_ptr, (png_free_ptr)free_fn, - (png_voidp)mem_ptr); -#else - png_destroy_struct((png_voidp)info_ptr); -#endif - *info_ptr_ptr = NULL; - } - - if (end_info_ptr != NULL) - { -#if defined(PNG_READ_TEXT_SUPPORTED) - png_free_data(png_ptr, end_info_ptr, PNG_FREE_TEXT, -1); -#endif -#ifdef PNG_USER_MEM_SUPPORTED - png_destroy_struct_2((png_voidp)end_info_ptr, (png_free_ptr)free_fn, - (png_voidp)mem_ptr); -#else - png_destroy_struct((png_voidp)end_info_ptr); -#endif - *end_info_ptr_ptr = NULL; - } - - if (png_ptr != NULL) - { -#ifdef PNG_USER_MEM_SUPPORTED - png_destroy_struct_2((png_voidp)png_ptr, (png_free_ptr)free_fn, - (png_voidp)mem_ptr); -#else - png_destroy_struct((png_voidp)png_ptr); -#endif - *png_ptr_ptr = NULL; - } -} - -/* free all memory used by the read (old method) */ -void /* PRIVATE */ -png_read_destroy(png_structp png_ptr, png_infop info_ptr, png_infop end_info_ptr) -{ -#ifdef PNG_SETJMP_SUPPORTED - jmp_buf tmp_jmp; -#endif - png_error_ptr error_fn; - png_error_ptr warning_fn; - png_voidp error_ptr; -#ifdef PNG_USER_MEM_SUPPORTED - png_free_ptr free_fn; -#endif - - png_debug(1, "in png_read_destroy\n"); - if (info_ptr != NULL) - png_info_destroy(png_ptr, info_ptr); - - if (end_info_ptr != NULL) - png_info_destroy(png_ptr, end_info_ptr); - - png_free(png_ptr, png_ptr->zbuf); - png_free(png_ptr, png_ptr->big_row_buf); - png_free(png_ptr, png_ptr->prev_row); -#if defined(PNG_READ_DITHER_SUPPORTED) - png_free(png_ptr, png_ptr->palette_lookup); - png_free(png_ptr, png_ptr->dither_index); -#endif -#if defined(PNG_READ_GAMMA_SUPPORTED) - png_free(png_ptr, png_ptr->gamma_table); -#endif -#if defined(PNG_READ_BACKGROUND_SUPPORTED) - png_free(png_ptr, png_ptr->gamma_from_1); - png_free(png_ptr, png_ptr->gamma_to_1); -#endif -#ifdef PNG_FREE_ME_SUPPORTED - if (png_ptr->free_me & PNG_FREE_PLTE) - png_zfree(png_ptr, png_ptr->palette); - png_ptr->free_me &= ~PNG_FREE_PLTE; -#else - if (png_ptr->flags & PNG_FLAG_FREE_PLTE) - png_zfree(png_ptr, png_ptr->palette); - png_ptr->flags &= ~PNG_FLAG_FREE_PLTE; -#endif -#if defined(PNG_tRNS_SUPPORTED) || \ - defined(PNG_READ_EXPAND_SUPPORTED) || defined(PNG_READ_BACKGROUND_SUPPORTED) -#ifdef PNG_FREE_ME_SUPPORTED - if (png_ptr->free_me & PNG_FREE_TRNS) - png_free(png_ptr, png_ptr->trans); - png_ptr->free_me &= ~PNG_FREE_TRNS; -#else - if (png_ptr->flags & PNG_FLAG_FREE_TRNS) - png_free(png_ptr, png_ptr->trans); - png_ptr->flags &= ~PNG_FLAG_FREE_TRNS; -#endif -#endif -#if defined(PNG_READ_hIST_SUPPORTED) -#ifdef PNG_FREE_ME_SUPPORTED - if (png_ptr->free_me & PNG_FREE_HIST) - png_free(png_ptr, png_ptr->hist); - png_ptr->free_me &= ~PNG_FREE_HIST; -#else - if (png_ptr->flags & PNG_FLAG_FREE_HIST) - png_free(png_ptr, png_ptr->hist); - png_ptr->flags &= ~PNG_FLAG_FREE_HIST; -#endif -#endif -#if defined(PNG_READ_GAMMA_SUPPORTED) - if (png_ptr->gamma_16_table != NULL) - { - int i; - int istop = (1 << (8 - png_ptr->gamma_shift)); - for (i = 0; i < istop; i++) - { - png_free(png_ptr, png_ptr->gamma_16_table[i]); - } - png_free(png_ptr, png_ptr->gamma_16_table); - } -#if defined(PNG_READ_BACKGROUND_SUPPORTED) - if (png_ptr->gamma_16_from_1 != NULL) - { - int i; - int istop = (1 << (8 - png_ptr->gamma_shift)); - for (i = 0; i < istop; i++) - { - png_free(png_ptr, png_ptr->gamma_16_from_1[i]); - } - png_free(png_ptr, png_ptr->gamma_16_from_1); - } - if (png_ptr->gamma_16_to_1 != NULL) - { - int i; - int istop = (1 << (8 - png_ptr->gamma_shift)); - for (i = 0; i < istop; i++) - { - png_free(png_ptr, png_ptr->gamma_16_to_1[i]); - } - png_free(png_ptr, png_ptr->gamma_16_to_1); - } -#endif -#endif -#if defined(PNG_TIME_RFC1123_SUPPORTED) - png_free(png_ptr, png_ptr->time_buffer); -#endif - - inflateEnd(&png_ptr->zstream); -#ifdef PNG_PROGRESSIVE_READ_SUPPORTED - png_free(png_ptr, png_ptr->save_buffer); -#endif - -#ifdef PNG_PROGRESSIVE_READ_SUPPORTED -#ifdef PNG_TEXT_SUPPORTED - png_free(png_ptr, png_ptr->current_text); -#endif /* PNG_TEXT_SUPPORTED */ -#endif /* PNG_PROGRESSIVE_READ_SUPPORTED */ - - /* Save the important info out of the png_struct, in case it is - * being used again. - */ -#ifdef PNG_SETJMP_SUPPORTED - png_memcpy(tmp_jmp, png_ptr->jmpbuf, png_sizeof (jmp_buf)); -#endif - - error_fn = png_ptr->error_fn; - warning_fn = png_ptr->warning_fn; - error_ptr = png_ptr->error_ptr; -#ifdef PNG_USER_MEM_SUPPORTED - free_fn = png_ptr->free_fn; -#endif - - png_memset(png_ptr, 0, png_sizeof (png_struct)); - - png_ptr->error_fn = error_fn; - png_ptr->warning_fn = warning_fn; - png_ptr->error_ptr = error_ptr; -#ifdef PNG_USER_MEM_SUPPORTED - png_ptr->free_fn = free_fn; -#endif - -#ifdef PNG_SETJMP_SUPPORTED - png_memcpy(png_ptr->jmpbuf, tmp_jmp, png_sizeof (jmp_buf)); -#endif - -} - -void PNGAPI -png_set_read_status_fn(png_structp png_ptr, png_read_status_ptr read_row_fn) -{ - png_ptr->read_row_fn = read_row_fn; -} - - -#ifndef PNG_NO_SEQUENTIAL_READ_SUPPORTED -#if defined(PNG_INFO_IMAGE_SUPPORTED) -void PNGAPI -png_read_png(png_structp png_ptr, png_infop info_ptr, - int transforms, - voidp params) -{ - int row; - -#if defined(PNG_READ_INVERT_ALPHA_SUPPORTED) - /* invert the alpha channel from opacity to transparency - */ - if (transforms & PNG_TRANSFORM_INVERT_ALPHA) - png_set_invert_alpha(png_ptr); -#endif - - /* png_read_info() gives us all of the information from the - * PNG file before the first IDAT (image data chunk). - */ - png_read_info(png_ptr, info_ptr); - if (info_ptr->height > PNG_UINT_32_MAX/png_sizeof(png_bytep)) - png_error(png_ptr,"Image is too high to process with png_read_png()"); - - /* -------------- image transformations start here ------------------- */ - -#if defined(PNG_READ_16_TO_8_SUPPORTED) - /* tell libpng to strip 16 bit/color files down to 8 bits per color - */ - if (transforms & PNG_TRANSFORM_STRIP_16) - png_set_strip_16(png_ptr); -#endif - -#if defined(PNG_READ_STRIP_ALPHA_SUPPORTED) - /* Strip alpha bytes from the input data without combining with - * the background (not recommended). - */ - if (transforms & PNG_TRANSFORM_STRIP_ALPHA) - png_set_strip_alpha(png_ptr); -#endif - -#if defined(PNG_READ_PACK_SUPPORTED) && !defined(PNG_READ_EXPAND_SUPPORTED) - /* Extract multiple pixels with bit depths of 1, 2, or 4 from a single - * byte into separate bytes (useful for paletted and grayscale images). - */ - if (transforms & PNG_TRANSFORM_PACKING) - png_set_packing(png_ptr); -#endif - -#if defined(PNG_READ_PACKSWAP_SUPPORTED) - /* Change the order of packed pixels to least significant bit first - * (not useful if you are using png_set_packing). - */ - if (transforms & PNG_TRANSFORM_PACKSWAP) - png_set_packswap(png_ptr); -#endif - -#if defined(PNG_READ_EXPAND_SUPPORTED) - /* Expand paletted colors into true RGB triplets - * Expand grayscale images to full 8 bits from 1, 2, or 4 bits/pixel - * Expand paletted or RGB images with transparency to full alpha - * channels so the data will be available as RGBA quartets. - */ - if (transforms & PNG_TRANSFORM_EXPAND) - if ((png_ptr->bit_depth < 8) || - (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE) || - (png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS))) - png_set_expand(png_ptr); -#endif - - /* We don't handle background color or gamma transformation or dithering. - */ - -#if defined(PNG_READ_INVERT_SUPPORTED) - /* invert monochrome files to have 0 as white and 1 as black - */ - if (transforms & PNG_TRANSFORM_INVERT_MONO) - png_set_invert_mono(png_ptr); -#endif - -#if defined(PNG_READ_SHIFT_SUPPORTED) - /* If you want to shift the pixel values from the range [0,255] or - * [0,65535] to the original [0,7] or [0,31], or whatever range the - * colors were originally in: - */ - if ((transforms & PNG_TRANSFORM_SHIFT) - && png_get_valid(png_ptr, info_ptr, PNG_INFO_sBIT)) - { - png_color_8p sig_bit; - - png_get_sBIT(png_ptr, info_ptr, &sig_bit); - png_set_shift(png_ptr, sig_bit); - } -#endif - -#if defined(PNG_READ_BGR_SUPPORTED) - /* flip the RGB pixels to BGR (or RGBA to BGRA) - */ - if (transforms & PNG_TRANSFORM_BGR) - png_set_bgr(png_ptr); -#endif - -#if defined(PNG_READ_SWAP_ALPHA_SUPPORTED) - /* swap the RGBA or GA data to ARGB or AG (or BGRA to ABGR) - */ - if (transforms & PNG_TRANSFORM_SWAP_ALPHA) - png_set_swap_alpha(png_ptr); -#endif - -#if defined(PNG_READ_SWAP_SUPPORTED) - /* swap bytes of 16 bit files to least significant byte first - */ - if (transforms & PNG_TRANSFORM_SWAP_ENDIAN) - png_set_swap(png_ptr); -#endif - - /* We don't handle adding filler bytes */ - - /* Optional call to gamma correct and add the background to the palette - * and update info structure. REQUIRED if you are expecting libpng to - * update the palette for you (i.e., you selected such a transform above). - */ - png_read_update_info(png_ptr, info_ptr); - - /* -------------- image transformations end here ------------------- */ - -#ifdef PNG_FREE_ME_SUPPORTED - png_free_data(png_ptr, info_ptr, PNG_FREE_ROWS, 0); -#endif - if(info_ptr->row_pointers == NULL) - { - info_ptr->row_pointers = (png_bytepp)png_malloc(png_ptr, - info_ptr->height * png_sizeof(png_bytep)); -#ifdef PNG_FREE_ME_SUPPORTED - info_ptr->free_me |= PNG_FREE_ROWS; -#endif - for (row = 0; row < (int)info_ptr->height; row++) - { - info_ptr->row_pointers[row] = (png_bytep)png_malloc(png_ptr, - png_get_rowbytes(png_ptr, info_ptr)); - } - } - - png_read_image(png_ptr, info_ptr->row_pointers); - info_ptr->valid |= PNG_INFO_IDAT; - - /* read rest of file, and get additional chunks in info_ptr - REQUIRED */ - png_read_end(png_ptr, info_ptr); - - if(transforms == 0 || params == NULL) - /* quiet compiler warnings */ return; - -} -#endif -#endif /* PNG_NO_SEQUENTIAL_READ_SUPPORTED */ diff --git a/wxWidgets/src/png/pngrio.c b/wxWidgets/src/png/pngrio.c deleted file mode 100644 index 806f791981..0000000000 --- a/wxWidgets/src/png/pngrio.c +++ /dev/null @@ -1,161 +0,0 @@ - -/* pngrio.c - functions for data input - * - * libpng 1.2.7 - September 12, 2004 - * For conditions of distribution and use, see copyright notice in png.h - * Copyright (c) 1998-2004 Glenn Randers-Pehrson - * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) - * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) - * - * This file provides a location for all input. Users who need - * special handling are expected to write a function that has the same - * arguments as this and performs a similar function, but that possibly - * has a different input method. Note that you shouldn't change this - * function, but rather write a replacement function and then make - * libpng use it at run time with png_set_read_fn(...). - */ - -#define PNG_INTERNAL -#include "png.h" - -/* Read the data from whatever input you are using. The default routine - reads from a file pointer. Note that this routine sometimes gets called - with very small lengths, so you should implement some kind of simple - buffering if you are using unbuffered reads. This should never be asked - to read more then 64K on a 16 bit machine. */ -void /* PRIVATE */ -png_read_data(png_structp png_ptr, png_bytep data, png_size_t length) -{ - png_debug1(4,"reading %d bytes\n", (int)length); - if (png_ptr->read_data_fn != NULL) - (*(png_ptr->read_data_fn))(png_ptr, data, length); - else - png_error(png_ptr, "Call to NULL read function"); -} - -#if !defined(PNG_NO_STDIO) -/* This is the function that does the actual reading of data. If you are - not reading from a standard C stream, you should create a replacement - read_data function and use it at run time with png_set_read_fn(), rather - than changing the library. */ -#ifndef USE_FAR_KEYWORD -void PNGAPI -png_default_read_data(png_structp png_ptr, png_bytep data, png_size_t length) -{ - png_size_t check; - - /* fread() returns 0 on error, so it is OK to store this in a png_size_t - * instead of an int, which is what fread() actually returns. - */ -#if defined(_WIN32_WCE) - if ( !ReadFile((HANDLE)(png_ptr->io_ptr), data, length, &check, NULL) ) - check = 0; -#else - check = (png_size_t)fread(data, (png_size_t)1, length, - (png_FILE_p)png_ptr->io_ptr); -#endif - - if (check != length) - png_error(png_ptr, "Read Error"); -} -#else -/* this is the model-independent version. Since the standard I/O library - can't handle far buffers in the medium and small models, we have to copy - the data. -*/ - -#define NEAR_BUF_SIZE 1024 -#define MIN(a,b) (a <= b ? a : b) - -static void /* PRIVATE */ -png_default_read_data(png_structp png_ptr, png_bytep data, png_size_t length) -{ - int check; - png_byte *n_data; - png_FILE_p io_ptr; - - /* Check if data really is near. If so, use usual code. */ - n_data = (png_byte *)CVT_PTR_NOCHECK(data); - io_ptr = (png_FILE_p)CVT_PTR(png_ptr->io_ptr); - if ((png_bytep)n_data == data) - { -#if defined(_WIN32_WCE) - if ( !ReadFile((HANDLE)(png_ptr->io_ptr), data, length, &check, NULL) ) - check = 0; -#else - check = fread(n_data, 1, length, io_ptr); -#endif - } - else - { - png_byte buf[NEAR_BUF_SIZE]; - png_size_t read, remaining, err; - check = 0; - remaining = length; - do - { - read = MIN(NEAR_BUF_SIZE, remaining); -#if defined(_WIN32_WCE) - if ( !ReadFile((HANDLE)(io_ptr), buf, read, &err, NULL) ) - err = 0; -#else - err = fread(buf, (png_size_t)1, read, io_ptr); -#endif - png_memcpy(data, buf, read); /* copy far buffer to near buffer */ - if(err != read) - break; - else - check += err; - data += read; - remaining -= read; - } - while (remaining != 0); - } - if ((png_uint_32)check != (png_uint_32)length) - png_error(png_ptr, "read Error"); -} -#endif -#endif - -/* This function allows the application to supply a new input function - for libpng if standard C streams aren't being used. - - This function takes as its arguments: - png_ptr - pointer to a png input data structure - io_ptr - pointer to user supplied structure containing info about - the input functions. May be NULL. - read_data_fn - pointer to a new input function that takes as its - arguments a pointer to a png_struct, a pointer to - a location where input data can be stored, and a 32-bit - unsigned int that is the number of bytes to be read. - To exit and output any fatal error messages the new write - function should call png_error(png_ptr, "Error msg"). */ -void PNGAPI -png_set_read_fn(png_structp png_ptr, png_voidp io_ptr, - png_rw_ptr read_data_fn) -{ - png_ptr->io_ptr = io_ptr; - -#if !defined(PNG_NO_STDIO) - if (read_data_fn != NULL) - png_ptr->read_data_fn = read_data_fn; - else - png_ptr->read_data_fn = png_default_read_data; -#else - png_ptr->read_data_fn = read_data_fn; -#endif - - /* It is an error to write to a read device */ - if (png_ptr->write_data_fn != NULL) - { - png_ptr->write_data_fn = NULL; - png_warning(png_ptr, - "It's an error to set both read_data_fn and write_data_fn in the "); - png_warning(png_ptr, - "same structure. Resetting write_data_fn to NULL."); - } - -#if defined(PNG_WRITE_FLUSH_SUPPORTED) - png_ptr->output_flush_fn = NULL; -#endif -} diff --git a/wxWidgets/src/png/pngrtran.c b/wxWidgets/src/png/pngrtran.c deleted file mode 100644 index b914d0e653..0000000000 --- a/wxWidgets/src/png/pngrtran.c +++ /dev/null @@ -1,4177 +0,0 @@ - -/* pngrtran.c - transforms the data in a row for PNG readers - * - * libpng version 1.2.7 - September 12, 2004 - * For conditions of distribution and use, see copyright notice in png.h - * Copyright (c) 1998-2004 Glenn Randers-Pehrson - * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) - * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) - * - * This file contains functions optionally called by an application - * in order to tell libpng how to handle data when reading a PNG. - * Transformations that are used in both reading and writing are - * in pngtrans.c. - */ - -#define PNG_INTERNAL -#include "png.h" - -/* Set the action on getting a CRC error for an ancillary or critical chunk. */ -void PNGAPI -png_set_crc_action(png_structp png_ptr, int crit_action, int ancil_action) -{ - png_debug(1, "in png_set_crc_action\n"); - /* Tell libpng how we react to CRC errors in critical chunks */ - switch (crit_action) - { - case PNG_CRC_NO_CHANGE: /* leave setting as is */ - break; - case PNG_CRC_WARN_USE: /* warn/use data */ - png_ptr->flags &= ~PNG_FLAG_CRC_CRITICAL_MASK; - png_ptr->flags |= PNG_FLAG_CRC_CRITICAL_USE; - break; - case PNG_CRC_QUIET_USE: /* quiet/use data */ - png_ptr->flags &= ~PNG_FLAG_CRC_CRITICAL_MASK; - png_ptr->flags |= PNG_FLAG_CRC_CRITICAL_USE | - PNG_FLAG_CRC_CRITICAL_IGNORE; - break; - case PNG_CRC_WARN_DISCARD: /* not a valid action for critical data */ - png_warning(png_ptr, "Can't discard critical data on CRC error."); - case PNG_CRC_ERROR_QUIT: /* error/quit */ - case PNG_CRC_DEFAULT: - default: - png_ptr->flags &= ~PNG_FLAG_CRC_CRITICAL_MASK; - break; - } - - switch (ancil_action) - { - case PNG_CRC_NO_CHANGE: /* leave setting as is */ - break; - case PNG_CRC_WARN_USE: /* warn/use data */ - png_ptr->flags &= ~PNG_FLAG_CRC_ANCILLARY_MASK; - png_ptr->flags |= PNG_FLAG_CRC_ANCILLARY_USE; - break; - case PNG_CRC_QUIET_USE: /* quiet/use data */ - png_ptr->flags &= ~PNG_FLAG_CRC_ANCILLARY_MASK; - png_ptr->flags |= PNG_FLAG_CRC_ANCILLARY_USE | - PNG_FLAG_CRC_ANCILLARY_NOWARN; - break; - case PNG_CRC_ERROR_QUIT: /* error/quit */ - png_ptr->flags &= ~PNG_FLAG_CRC_ANCILLARY_MASK; - png_ptr->flags |= PNG_FLAG_CRC_ANCILLARY_NOWARN; - break; - case PNG_CRC_WARN_DISCARD: /* warn/discard data */ - case PNG_CRC_DEFAULT: - default: - png_ptr->flags &= ~PNG_FLAG_CRC_ANCILLARY_MASK; - break; - } -} - -#if defined(PNG_READ_BACKGROUND_SUPPORTED) && \ - defined(PNG_FLOATING_POINT_SUPPORTED) -/* handle alpha and tRNS via a background color */ -void PNGAPI -png_set_background(png_structp png_ptr, - png_color_16p background_color, int background_gamma_code, - int need_expand, double background_gamma) -{ - png_debug(1, "in png_set_background\n"); - if (background_gamma_code == PNG_BACKGROUND_GAMMA_UNKNOWN) - { - png_warning(png_ptr, "Application must supply a known background gamma"); - return; - } - - png_ptr->transformations |= PNG_BACKGROUND; - png_memcpy(&(png_ptr->background), background_color, - png_sizeof(png_color_16)); - png_ptr->background_gamma = (float)background_gamma; - png_ptr->background_gamma_type = (png_byte)(background_gamma_code); - png_ptr->transformations |= (need_expand ? PNG_BACKGROUND_EXPAND : 0); - - /* Note: if need_expand is set and color_type is either RGB or RGB_ALPHA - * (in which case need_expand is superfluous anyway), the background color - * might actually be gray yet not be flagged as such. This is not a problem - * for the current code, which uses PNG_BACKGROUND_IS_GRAY only to - * decide when to do the png_do_gray_to_rgb() transformation. - */ - if ((need_expand && !(png_ptr->color_type & PNG_COLOR_MASK_COLOR)) || - (!need_expand && background_color->red == background_color->green && - background_color->red == background_color->blue)) - png_ptr->mode |= PNG_BACKGROUND_IS_GRAY; -} -#endif - -#if defined(PNG_READ_16_TO_8_SUPPORTED) -/* strip 16 bit depth files to 8 bit depth */ -void PNGAPI -png_set_strip_16(png_structp png_ptr) -{ - png_debug(1, "in png_set_strip_16\n"); - png_ptr->transformations |= PNG_16_TO_8; -} -#endif - -#if defined(PNG_READ_STRIP_ALPHA_SUPPORTED) -void PNGAPI -png_set_strip_alpha(png_structp png_ptr) -{ - png_debug(1, "in png_set_strip_alpha\n"); - png_ptr->transformations |= PNG_STRIP_ALPHA; -} -#endif - -#if defined(PNG_READ_DITHER_SUPPORTED) -/* Dither file to 8 bit. Supply a palette, the current number - * of elements in the palette, the maximum number of elements - * allowed, and a histogram if possible. If the current number - * of colors is greater then the maximum number, the palette will be - * modified to fit in the maximum number. "full_dither" indicates - * whether we need a dithering cube set up for RGB images, or if we - * simply are reducing the number of colors in a paletted image. - */ - -typedef struct png_dsort_struct -{ - struct png_dsort_struct FAR * next; - png_byte left; - png_byte right; -} png_dsort; -typedef png_dsort FAR * png_dsortp; -typedef png_dsort FAR * FAR * png_dsortpp; - -void PNGAPI -png_set_dither(png_structp png_ptr, png_colorp palette, - int num_palette, int maximum_colors, png_uint_16p histogram, - int full_dither) -{ - png_debug(1, "in png_set_dither\n"); - png_ptr->transformations |= PNG_DITHER; - - if (!full_dither) - { - int i; - - png_ptr->dither_index = (png_bytep)png_malloc(png_ptr, - (png_uint_32)(num_palette * png_sizeof (png_byte))); - for (i = 0; i < num_palette; i++) - png_ptr->dither_index[i] = (png_byte)i; - } - - if (num_palette > maximum_colors) - { - if (histogram != NULL) - { - /* This is easy enough, just throw out the least used colors. - Perhaps not the best solution, but good enough. */ - - int i; - - /* initialize an array to sort colors */ - png_ptr->dither_sort = (png_bytep)png_malloc(png_ptr, - (png_uint_32)(num_palette * png_sizeof (png_byte))); - - /* initialize the dither_sort array */ - for (i = 0; i < num_palette; i++) - png_ptr->dither_sort[i] = (png_byte)i; - - /* Find the least used palette entries by starting a - bubble sort, and running it until we have sorted - out enough colors. Note that we don't care about - sorting all the colors, just finding which are - least used. */ - - for (i = num_palette - 1; i >= maximum_colors; i--) - { - int done; /* to stop early if the list is pre-sorted */ - int j; - - done = 1; - for (j = 0; j < i; j++) - { - if (histogram[png_ptr->dither_sort[j]] - < histogram[png_ptr->dither_sort[j + 1]]) - { - png_byte t; - - t = png_ptr->dither_sort[j]; - png_ptr->dither_sort[j] = png_ptr->dither_sort[j + 1]; - png_ptr->dither_sort[j + 1] = t; - done = 0; - } - } - if (done) - break; - } - - /* swap the palette around, and set up a table, if necessary */ - if (full_dither) - { - int j = num_palette; - - /* put all the useful colors within the max, but don't - move the others */ - for (i = 0; i < maximum_colors; i++) - { - if ((int)png_ptr->dither_sort[i] >= maximum_colors) - { - do - j--; - while ((int)png_ptr->dither_sort[j] >= maximum_colors); - palette[i] = palette[j]; - } - } - } - else - { - int j = num_palette; - - /* move all the used colors inside the max limit, and - develop a translation table */ - for (i = 0; i < maximum_colors; i++) - { - /* only move the colors we need to */ - if ((int)png_ptr->dither_sort[i] >= maximum_colors) - { - png_color tmp_color; - - do - j--; - while ((int)png_ptr->dither_sort[j] >= maximum_colors); - - tmp_color = palette[j]; - palette[j] = palette[i]; - palette[i] = tmp_color; - /* indicate where the color went */ - png_ptr->dither_index[j] = (png_byte)i; - png_ptr->dither_index[i] = (png_byte)j; - } - } - - /* find closest color for those colors we are not using */ - for (i = 0; i < num_palette; i++) - { - if ((int)png_ptr->dither_index[i] >= maximum_colors) - { - int min_d, k, min_k, d_index; - - /* find the closest color to one we threw out */ - d_index = png_ptr->dither_index[i]; - min_d = PNG_COLOR_DIST(palette[d_index], palette[0]); - for (k = 1, min_k = 0; k < maximum_colors; k++) - { - int d; - - d = PNG_COLOR_DIST(palette[d_index], palette[k]); - - if (d < min_d) - { - min_d = d; - min_k = k; - } - } - /* point to closest color */ - png_ptr->dither_index[i] = (png_byte)min_k; - } - } - } - png_free(png_ptr, png_ptr->dither_sort); - png_ptr->dither_sort=NULL; - } - else - { - /* This is much harder to do simply (and quickly). Perhaps - we need to go through a median cut routine, but those - don't always behave themselves with only a few colors - as input. So we will just find the closest two colors, - and throw out one of them (chosen somewhat randomly). - [We don't understand this at all, so if someone wants to - work on improving it, be our guest - AED, GRP] - */ - int i; - int max_d; - int num_new_palette; - png_dsortp t; - png_dsortpp hash; - - t=NULL; - - /* initialize palette index arrays */ - png_ptr->index_to_palette = (png_bytep)png_malloc(png_ptr, - (png_uint_32)(num_palette * png_sizeof (png_byte))); - png_ptr->palette_to_index = (png_bytep)png_malloc(png_ptr, - (png_uint_32)(num_palette * png_sizeof (png_byte))); - - /* initialize the sort array */ - for (i = 0; i < num_palette; i++) - { - png_ptr->index_to_palette[i] = (png_byte)i; - png_ptr->palette_to_index[i] = (png_byte)i; - } - - hash = (png_dsortpp)png_malloc(png_ptr, (png_uint_32)(769 * - png_sizeof (png_dsortp))); - for (i = 0; i < 769; i++) - hash[i] = NULL; -/* png_memset(hash, 0, 769 * png_sizeof (png_dsortp)); */ - - num_new_palette = num_palette; - - /* initial wild guess at how far apart the farthest pixel - pair we will be eliminating will be. Larger - numbers mean more areas will be allocated, Smaller - numbers run the risk of not saving enough data, and - having to do this all over again. - - I have not done extensive checking on this number. - */ - max_d = 96; - - while (num_new_palette > maximum_colors) - { - for (i = 0; i < num_new_palette - 1; i++) - { - int j; - - for (j = i + 1; j < num_new_palette; j++) - { - int d; - - d = PNG_COLOR_DIST(palette[i], palette[j]); - - if (d <= max_d) - { - - t = (png_dsortp)png_malloc_warn(png_ptr, - (png_uint_32)(png_sizeof(png_dsort))); - if (t == NULL) - break; - t->next = hash[d]; - t->left = (png_byte)i; - t->right = (png_byte)j; - hash[d] = t; - } - } - if (t == NULL) - break; - } - - if (t != NULL) - for (i = 0; i <= max_d; i++) - { - if (hash[i] != NULL) - { - png_dsortp p; - - for (p = hash[i]; p; p = p->next) - { - if ((int)png_ptr->index_to_palette[p->left] - < num_new_palette && - (int)png_ptr->index_to_palette[p->right] - < num_new_palette) - { - int j, next_j; - - if (num_new_palette & 0x01) - { - j = p->left; - next_j = p->right; - } - else - { - j = p->right; - next_j = p->left; - } - - num_new_palette--; - palette[png_ptr->index_to_palette[j]] - = palette[num_new_palette]; - if (!full_dither) - { - int k; - - for (k = 0; k < num_palette; k++) - { - if (png_ptr->dither_index[k] == - png_ptr->index_to_palette[j]) - png_ptr->dither_index[k] = - png_ptr->index_to_palette[next_j]; - if ((int)png_ptr->dither_index[k] == - num_new_palette) - png_ptr->dither_index[k] = - png_ptr->index_to_palette[j]; - } - } - - png_ptr->index_to_palette[png_ptr->palette_to_index - [num_new_palette]] = png_ptr->index_to_palette[j]; - png_ptr->palette_to_index[png_ptr->index_to_palette[j]] - = png_ptr->palette_to_index[num_new_palette]; - - png_ptr->index_to_palette[j] = (png_byte)num_new_palette; - png_ptr->palette_to_index[num_new_palette] = (png_byte)j; - } - if (num_new_palette <= maximum_colors) - break; - } - if (num_new_palette <= maximum_colors) - break; - } - } - - for (i = 0; i < 769; i++) - { - if (hash[i] != NULL) - { - png_dsortp p = hash[i]; - while (p) - { - t = p->next; - png_free(png_ptr, p); - p = t; - } - } - hash[i] = 0; - } - max_d += 96; - } - png_free(png_ptr, hash); - png_free(png_ptr, png_ptr->palette_to_index); - png_free(png_ptr, png_ptr->index_to_palette); - png_ptr->palette_to_index=NULL; - png_ptr->index_to_palette=NULL; - } - num_palette = maximum_colors; - } - if (png_ptr->palette == NULL) - { - png_ptr->palette = palette; - } - png_ptr->num_palette = (png_uint_16)num_palette; - - if (full_dither) - { - int i; - png_bytep distance; - int total_bits = PNG_DITHER_RED_BITS + PNG_DITHER_GREEN_BITS + - PNG_DITHER_BLUE_BITS; - int num_red = (1 << PNG_DITHER_RED_BITS); - int num_green = (1 << PNG_DITHER_GREEN_BITS); - int num_blue = (1 << PNG_DITHER_BLUE_BITS); - png_size_t num_entries = ((png_size_t)1 << total_bits); - - png_ptr->palette_lookup = (png_bytep )png_malloc(png_ptr, - (png_uint_32)(num_entries * png_sizeof (png_byte))); - - png_memset(png_ptr->palette_lookup, 0, num_entries * - png_sizeof (png_byte)); - - distance = (png_bytep)png_malloc(png_ptr, (png_uint_32)(num_entries * - png_sizeof(png_byte))); - - png_memset(distance, 0xff, num_entries * png_sizeof(png_byte)); - - for (i = 0; i < num_palette; i++) - { - int ir, ig, ib; - int r = (palette[i].red >> (8 - PNG_DITHER_RED_BITS)); - int g = (palette[i].green >> (8 - PNG_DITHER_GREEN_BITS)); - int b = (palette[i].blue >> (8 - PNG_DITHER_BLUE_BITS)); - - for (ir = 0; ir < num_red; ir++) - { - /* int dr = abs(ir - r); */ - int dr = ((ir > r) ? ir - r : r - ir); - int index_r = (ir << (PNG_DITHER_BLUE_BITS + PNG_DITHER_GREEN_BITS)); - - for (ig = 0; ig < num_green; ig++) - { - /* int dg = abs(ig - g); */ - int dg = ((ig > g) ? ig - g : g - ig); - int dt = dr + dg; - int dm = ((dr > dg) ? dr : dg); - int index_g = index_r | (ig << PNG_DITHER_BLUE_BITS); - - for (ib = 0; ib < num_blue; ib++) - { - int d_index = index_g | ib; - /* int db = abs(ib - b); */ - int db = ((ib > b) ? ib - b : b - ib); - int dmax = ((dm > db) ? dm : db); - int d = dmax + dt + db; - - if (d < (int)distance[d_index]) - { - distance[d_index] = (png_byte)d; - png_ptr->palette_lookup[d_index] = (png_byte)i; - } - } - } - } - } - - png_free(png_ptr, distance); - } -} -#endif - -#if defined(PNG_READ_GAMMA_SUPPORTED) && defined(PNG_FLOATING_POINT_SUPPORTED) -/* Transform the image from the file_gamma to the screen_gamma. We - * only do transformations on images where the file_gamma and screen_gamma - * are not close reciprocals, otherwise it slows things down slightly, and - * also needlessly introduces small errors. - * - * We will turn off gamma transformation later if no semitransparent entries - * are present in the tRNS array for palette images. We can't do it here - * because we don't necessarily have the tRNS chunk yet. - */ -void PNGAPI -png_set_gamma(png_structp png_ptr, double scrn_gamma, double file_gamma) -{ - png_debug(1, "in png_set_gamma\n"); - if ((fabs(scrn_gamma * file_gamma - 1.0) > PNG_GAMMA_THRESHOLD) || - (png_ptr->color_type & PNG_COLOR_MASK_ALPHA) || - (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE)) - png_ptr->transformations |= PNG_GAMMA; - png_ptr->gamma = (float)file_gamma; - png_ptr->screen_gamma = (float)scrn_gamma; -} -#endif - -#if defined(PNG_READ_EXPAND_SUPPORTED) -/* Expand paletted images to RGB, expand grayscale images of - * less than 8-bit depth to 8-bit depth, and expand tRNS chunks - * to alpha channels. - */ -void PNGAPI -png_set_expand(png_structp png_ptr) -{ - png_debug(1, "in png_set_expand\n"); - png_ptr->transformations |= PNG_EXPAND; -} - -/* GRR 19990627: the following three functions currently are identical - * to png_set_expand(). However, it is entirely reasonable that someone - * might wish to expand an indexed image to RGB but *not* expand a single, - * fully transparent palette entry to a full alpha channel--perhaps instead - * convert tRNS to the grayscale/RGB format (16-bit RGB value), or replace - * the transparent color with a particular RGB value, or drop tRNS entirely. - * IOW, a future version of the library may make the transformations flag - * a bit more fine-grained, with separate bits for each of these three - * functions. - * - * More to the point, these functions make it obvious what libpng will be - * doing, whereas "expand" can (and does) mean any number of things. - */ - -/* Expand paletted images to RGB. */ -void PNGAPI -png_set_palette_to_rgb(png_structp png_ptr) -{ - png_debug(1, "in png_set_expand\n"); - png_ptr->transformations |= PNG_EXPAND; -} - -/* Expand grayscale images of less than 8-bit depth to 8 bits. */ -void PNGAPI -png_set_gray_1_2_4_to_8(png_structp png_ptr) -{ - png_debug(1, "in png_set_expand\n"); - png_ptr->transformations |= PNG_EXPAND; -} - -/* Expand tRNS chunks to alpha channels. */ -void PNGAPI -png_set_tRNS_to_alpha(png_structp png_ptr) -{ - png_debug(1, "in png_set_expand\n"); - png_ptr->transformations |= PNG_EXPAND; -} -#endif /* defined(PNG_READ_EXPAND_SUPPORTED) */ - -#if defined(PNG_READ_GRAY_TO_RGB_SUPPORTED) -void PNGAPI -png_set_gray_to_rgb(png_structp png_ptr) -{ - png_debug(1, "in png_set_gray_to_rgb\n"); - png_ptr->transformations |= PNG_GRAY_TO_RGB; -} -#endif - -#if defined(PNG_READ_RGB_TO_GRAY_SUPPORTED) -#if defined(PNG_FLOATING_POINT_SUPPORTED) -/* Convert a RGB image to a grayscale of the same width. This allows us, - * for example, to convert a 24 bpp RGB image into an 8 bpp grayscale image. - */ - -void PNGAPI -png_set_rgb_to_gray(png_structp png_ptr, int error_action, double red, - double green) -{ - int red_fixed = (int)((float)red*100000.0 + 0.5); - int green_fixed = (int)((float)green*100000.0 + 0.5); - png_set_rgb_to_gray_fixed(png_ptr, error_action, red_fixed, green_fixed); -} -#endif - -void PNGAPI -png_set_rgb_to_gray_fixed(png_structp png_ptr, int error_action, - png_fixed_point red, png_fixed_point green) -{ - png_debug(1, "in png_set_rgb_to_gray\n"); - switch(error_action) - { - case 1: png_ptr->transformations |= PNG_RGB_TO_GRAY; - break; - case 2: png_ptr->transformations |= PNG_RGB_TO_GRAY_WARN; - break; - case 3: png_ptr->transformations |= PNG_RGB_TO_GRAY_ERR; - } - if (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE) -#if defined(PNG_READ_EXPAND_SUPPORTED) - png_ptr->transformations |= PNG_EXPAND; -#else - { - png_warning(png_ptr, "Cannot do RGB_TO_GRAY without EXPAND_SUPPORTED."); - png_ptr->transformations &= ~PNG_RGB_TO_GRAY; - } -#endif - { - png_uint_16 red_int, green_int; - if(red < 0 || green < 0) - { - red_int = 6968; /* .212671 * 32768 + .5 */ - green_int = 23434; /* .715160 * 32768 + .5 */ - } - else if(red + green < 100000L) - { - red_int = (png_uint_16)(((png_uint_32)red*32768L)/100000L); - green_int = (png_uint_16)(((png_uint_32)green*32768L)/100000L); - } - else - { - png_warning(png_ptr, "ignoring out of range rgb_to_gray coefficients"); - red_int = 6968; - green_int = 23434; - } - png_ptr->rgb_to_gray_red_coeff = red_int; - png_ptr->rgb_to_gray_green_coeff = green_int; - png_ptr->rgb_to_gray_blue_coeff = (png_uint_16)(32768-red_int-green_int); - } -} -#endif - -#if defined(PNG_READ_USER_TRANSFORM_SUPPORTED) || \ - defined(PNG_WRITE_USER_TRANSFORM_SUPPORTED) || \ - defined(PNG_LEGACY_SUPPORTED) -void PNGAPI -png_set_read_user_transform_fn(png_structp png_ptr, png_user_transform_ptr - read_user_transform_fn) -{ - png_debug(1, "in png_set_read_user_transform_fn\n"); -#if defined(PNG_READ_USER_TRANSFORM_SUPPORTED) - png_ptr->transformations |= PNG_USER_TRANSFORM; - png_ptr->read_user_transform_fn = read_user_transform_fn; -#endif -#ifdef PNG_LEGACY_SUPPORTED - if(read_user_transform_fn) - png_warning(png_ptr, - "This version of libpng does not support user transforms"); -#endif -} -#endif - -/* Initialize everything needed for the read. This includes modifying - * the palette. - */ -void /* PRIVATE */ -png_init_read_transformations(png_structp png_ptr) -{ - png_debug(1, "in png_init_read_transformations\n"); -#if defined(PNG_USELESS_TESTS_SUPPORTED) - if(png_ptr != NULL) -#endif - { -#if defined(PNG_READ_BACKGROUND_SUPPORTED) || defined(PNG_READ_SHIFT_SUPPORTED) \ - || defined(PNG_READ_GAMMA_SUPPORTED) - int color_type = png_ptr->color_type; -#endif - -#if defined(PNG_READ_EXPAND_SUPPORTED) && defined(PNG_READ_BACKGROUND_SUPPORTED) - if ((png_ptr->transformations & PNG_BACKGROUND_EXPAND) && - (png_ptr->transformations & PNG_EXPAND)) - { - if (!(color_type & PNG_COLOR_MASK_COLOR)) /* i.e., GRAY or GRAY_ALPHA */ - { - /* expand background chunk. */ - switch (png_ptr->bit_depth) - { - case 1: - png_ptr->background.gray *= (png_uint_16)0xff; - png_ptr->background.red = png_ptr->background.green - = png_ptr->background.blue = png_ptr->background.gray; - break; - case 2: - png_ptr->background.gray *= (png_uint_16)0x55; - png_ptr->background.red = png_ptr->background.green - = png_ptr->background.blue = png_ptr->background.gray; - break; - case 4: - png_ptr->background.gray *= (png_uint_16)0x11; - png_ptr->background.red = png_ptr->background.green - = png_ptr->background.blue = png_ptr->background.gray; - break; - case 8: - case 16: - png_ptr->background.red = png_ptr->background.green - = png_ptr->background.blue = png_ptr->background.gray; - break; - } - } - else if (color_type == PNG_COLOR_TYPE_PALETTE) - { - png_ptr->background.red = - png_ptr->palette[png_ptr->background.index].red; - png_ptr->background.green = - png_ptr->palette[png_ptr->background.index].green; - png_ptr->background.blue = - png_ptr->palette[png_ptr->background.index].blue; - -#if defined(PNG_READ_INVERT_ALPHA_SUPPORTED) - if (png_ptr->transformations & PNG_INVERT_ALPHA) - { -#if defined(PNG_READ_EXPAND_SUPPORTED) - if (!(png_ptr->transformations & PNG_EXPAND)) -#endif - { - /* invert the alpha channel (in tRNS) unless the pixels are - going to be expanded, in which case leave it for later */ - int i,istop; - istop=(int)png_ptr->num_trans; - for (i=0; itrans[i] = (png_byte)(255 - png_ptr->trans[i]); - } - } -#endif - - } - } -#endif - -#if defined(PNG_READ_BACKGROUND_SUPPORTED) && defined(PNG_READ_GAMMA_SUPPORTED) - png_ptr->background_1 = png_ptr->background; -#endif -#if defined(PNG_READ_GAMMA_SUPPORTED) && defined(PNG_FLOATING_POINT_SUPPORTED) - - if ((color_type == PNG_COLOR_TYPE_PALETTE && png_ptr->num_trans != 0) - && (fabs(png_ptr->screen_gamma * png_ptr->gamma - 1.0) - < PNG_GAMMA_THRESHOLD)) - { - int i,k; - k=0; - for (i=0; inum_trans; i++) - { - if (png_ptr->trans[i] != 0 && png_ptr->trans[i] != 0xff) - k=1; /* partial transparency is present */ - } - if (k == 0) - png_ptr->transformations &= (~PNG_GAMMA); - } - - if (png_ptr->transformations & (PNG_GAMMA | PNG_RGB_TO_GRAY)) - { - png_build_gamma_table(png_ptr); -#if defined(PNG_READ_BACKGROUND_SUPPORTED) - if (png_ptr->transformations & PNG_BACKGROUND) - { - if (color_type == PNG_COLOR_TYPE_PALETTE) - { - /* could skip if no transparency and - */ - png_color back, back_1; - png_colorp palette = png_ptr->palette; - int num_palette = png_ptr->num_palette; - int i; - if (png_ptr->background_gamma_type == PNG_BACKGROUND_GAMMA_FILE) - { - back.red = png_ptr->gamma_table[png_ptr->background.red]; - back.green = png_ptr->gamma_table[png_ptr->background.green]; - back.blue = png_ptr->gamma_table[png_ptr->background.blue]; - - back_1.red = png_ptr->gamma_to_1[png_ptr->background.red]; - back_1.green = png_ptr->gamma_to_1[png_ptr->background.green]; - back_1.blue = png_ptr->gamma_to_1[png_ptr->background.blue]; - } - else - { - double g, gs; - - switch (png_ptr->background_gamma_type) - { - case PNG_BACKGROUND_GAMMA_SCREEN: - g = (png_ptr->screen_gamma); - gs = 1.0; - break; - case PNG_BACKGROUND_GAMMA_FILE: - g = 1.0 / (png_ptr->gamma); - gs = 1.0 / (png_ptr->gamma * png_ptr->screen_gamma); - break; - case PNG_BACKGROUND_GAMMA_UNIQUE: - g = 1.0 / (png_ptr->background_gamma); - gs = 1.0 / (png_ptr->background_gamma * - png_ptr->screen_gamma); - break; - default: - g = 1.0; /* back_1 */ - gs = 1.0; /* back */ - } - - if ( fabs(gs - 1.0) < PNG_GAMMA_THRESHOLD) - { - back.red = (png_byte)png_ptr->background.red; - back.green = (png_byte)png_ptr->background.green; - back.blue = (png_byte)png_ptr->background.blue; - } - else - { - back.red = (png_byte)(pow( - (double)png_ptr->background.red/255, gs) * 255.0 + .5); - back.green = (png_byte)(pow( - (double)png_ptr->background.green/255, gs) * 255.0 + .5); - back.blue = (png_byte)(pow( - (double)png_ptr->background.blue/255, gs) * 255.0 + .5); - } - - back_1.red = (png_byte)(pow( - (double)png_ptr->background.red/255, g) * 255.0 + .5); - back_1.green = (png_byte)(pow( - (double)png_ptr->background.green/255, g) * 255.0 + .5); - back_1.blue = (png_byte)(pow( - (double)png_ptr->background.blue/255, g) * 255.0 + .5); - } - for (i = 0; i < num_palette; i++) - { - if (i < (int)png_ptr->num_trans && png_ptr->trans[i] != 0xff) - { - if (png_ptr->trans[i] == 0) - { - palette[i] = back; - } - else /* if (png_ptr->trans[i] != 0xff) */ - { - png_byte v, w; - - v = png_ptr->gamma_to_1[palette[i].red]; - png_composite(w, v, png_ptr->trans[i], back_1.red); - palette[i].red = png_ptr->gamma_from_1[w]; - - v = png_ptr->gamma_to_1[palette[i].green]; - png_composite(w, v, png_ptr->trans[i], back_1.green); - palette[i].green = png_ptr->gamma_from_1[w]; - - v = png_ptr->gamma_to_1[palette[i].blue]; - png_composite(w, v, png_ptr->trans[i], back_1.blue); - palette[i].blue = png_ptr->gamma_from_1[w]; - } - } - else - { - palette[i].red = png_ptr->gamma_table[palette[i].red]; - palette[i].green = png_ptr->gamma_table[palette[i].green]; - palette[i].blue = png_ptr->gamma_table[palette[i].blue]; - } - } - } - /* if (png_ptr->background_gamma_type!=PNG_BACKGROUND_GAMMA_UNKNOWN) */ - else - /* color_type != PNG_COLOR_TYPE_PALETTE */ - { - double m = (double)(((png_uint_32)1 << png_ptr->bit_depth) - 1); - double g = 1.0; - double gs = 1.0; - - switch (png_ptr->background_gamma_type) - { - case PNG_BACKGROUND_GAMMA_SCREEN: - g = (png_ptr->screen_gamma); - gs = 1.0; - break; - case PNG_BACKGROUND_GAMMA_FILE: - g = 1.0 / (png_ptr->gamma); - gs = 1.0 / (png_ptr->gamma * png_ptr->screen_gamma); - break; - case PNG_BACKGROUND_GAMMA_UNIQUE: - g = 1.0 / (png_ptr->background_gamma); - gs = 1.0 / (png_ptr->background_gamma * - png_ptr->screen_gamma); - break; - } - - png_ptr->background_1.gray = (png_uint_16)(pow( - (double)png_ptr->background.gray / m, g) * m + .5); - png_ptr->background.gray = (png_uint_16)(pow( - (double)png_ptr->background.gray / m, gs) * m + .5); - - if ((png_ptr->background.red != png_ptr->background.green) || - (png_ptr->background.red != png_ptr->background.blue) || - (png_ptr->background.red != png_ptr->background.gray)) - { - /* RGB or RGBA with color background */ - png_ptr->background_1.red = (png_uint_16)(pow( - (double)png_ptr->background.red / m, g) * m + .5); - png_ptr->background_1.green = (png_uint_16)(pow( - (double)png_ptr->background.green / m, g) * m + .5); - png_ptr->background_1.blue = (png_uint_16)(pow( - (double)png_ptr->background.blue / m, g) * m + .5); - png_ptr->background.red = (png_uint_16)(pow( - (double)png_ptr->background.red / m, gs) * m + .5); - png_ptr->background.green = (png_uint_16)(pow( - (double)png_ptr->background.green / m, gs) * m + .5); - png_ptr->background.blue = (png_uint_16)(pow( - (double)png_ptr->background.blue / m, gs) * m + .5); - } - else - { - /* GRAY, GRAY ALPHA, RGB, or RGBA with gray background */ - png_ptr->background_1.red = png_ptr->background_1.green - = png_ptr->background_1.blue = png_ptr->background_1.gray; - png_ptr->background.red = png_ptr->background.green - = png_ptr->background.blue = png_ptr->background.gray; - } - } - } - else - /* transformation does not include PNG_BACKGROUND */ -#endif /* PNG_READ_BACKGROUND_SUPPORTED */ - if (color_type == PNG_COLOR_TYPE_PALETTE) - { - png_colorp palette = png_ptr->palette; - int num_palette = png_ptr->num_palette; - int i; - - for (i = 0; i < num_palette; i++) - { - palette[i].red = png_ptr->gamma_table[palette[i].red]; - palette[i].green = png_ptr->gamma_table[palette[i].green]; - palette[i].blue = png_ptr->gamma_table[palette[i].blue]; - } - } - } -#if defined(PNG_READ_BACKGROUND_SUPPORTED) - else -#endif -#endif /* PNG_READ_GAMMA_SUPPORTED && PNG_FLOATING_POINT_SUPPORTED */ -#if defined(PNG_READ_BACKGROUND_SUPPORTED) - /* No GAMMA transformation */ - if ((png_ptr->transformations & PNG_BACKGROUND) && - (color_type == PNG_COLOR_TYPE_PALETTE)) - { - int i; - int istop = (int)png_ptr->num_trans; - png_color back; - png_colorp palette = png_ptr->palette; - - back.red = (png_byte)png_ptr->background.red; - back.green = (png_byte)png_ptr->background.green; - back.blue = (png_byte)png_ptr->background.blue; - - for (i = 0; i < istop; i++) - { - if (png_ptr->trans[i] == 0) - { - palette[i] = back; - } - else if (png_ptr->trans[i] != 0xff) - { - /* The png_composite() macro is defined in png.h */ - png_composite(palette[i].red, palette[i].red, - png_ptr->trans[i], back.red); - png_composite(palette[i].green, palette[i].green, - png_ptr->trans[i], back.green); - png_composite(palette[i].blue, palette[i].blue, - png_ptr->trans[i], back.blue); - } - } - } -#endif /* PNG_READ_BACKGROUND_SUPPORTED */ - -#if defined(PNG_READ_SHIFT_SUPPORTED) - if ((png_ptr->transformations & PNG_SHIFT) && - (color_type == PNG_COLOR_TYPE_PALETTE)) - { - png_uint_16 i; - png_uint_16 istop = png_ptr->num_palette; - int sr = 8 - png_ptr->sig_bit.red; - int sg = 8 - png_ptr->sig_bit.green; - int sb = 8 - png_ptr->sig_bit.blue; - - if (sr < 0 || sr > 8) - sr = 0; - if (sg < 0 || sg > 8) - sg = 0; - if (sb < 0 || sb > 8) - sb = 0; - for (i = 0; i < istop; i++) - { - png_ptr->palette[i].red >>= sr; - png_ptr->palette[i].green >>= sg; - png_ptr->palette[i].blue >>= sb; - } - } -#endif /* PNG_READ_SHIFT_SUPPORTED */ - } -#if !defined(PNG_READ_GAMMA_SUPPORTED) && !defined(PNG_READ_SHIFT_SUPPORTED) \ - && !defined(PNG_READ_BACKGROUND_SUPPORTED) - if(png_ptr) - return; -#endif -} - -/* Modify the info structure to reflect the transformations. The - * info should be updated so a PNG file could be written with it, - * assuming the transformations result in valid PNG data. - */ -void /* PRIVATE */ -png_read_transform_info(png_structp png_ptr, png_infop info_ptr) -{ - png_debug(1, "in png_read_transform_info\n"); -#if defined(PNG_READ_EXPAND_SUPPORTED) - if (png_ptr->transformations & PNG_EXPAND) - { - if (info_ptr->color_type == PNG_COLOR_TYPE_PALETTE) - { - if (png_ptr->num_trans) - info_ptr->color_type = PNG_COLOR_TYPE_RGB_ALPHA; - else - info_ptr->color_type = PNG_COLOR_TYPE_RGB; - info_ptr->bit_depth = 8; - info_ptr->num_trans = 0; - } - else - { - if (png_ptr->num_trans) - info_ptr->color_type |= PNG_COLOR_MASK_ALPHA; - if (info_ptr->bit_depth < 8) - info_ptr->bit_depth = 8; - info_ptr->num_trans = 0; - } - } -#endif - -#if defined(PNG_READ_BACKGROUND_SUPPORTED) - if (png_ptr->transformations & PNG_BACKGROUND) - { - info_ptr->color_type &= ~PNG_COLOR_MASK_ALPHA; - info_ptr->num_trans = 0; - info_ptr->background = png_ptr->background; - } -#endif - -#if defined(PNG_READ_GAMMA_SUPPORTED) - if (png_ptr->transformations & PNG_GAMMA) - { -#ifdef PNG_FLOATING_POINT_SUPPORTED - info_ptr->gamma = png_ptr->gamma; -#endif -#ifdef PNG_FIXED_POINT_SUPPORTED - info_ptr->int_gamma = png_ptr->int_gamma; -#endif - } -#endif - -#if defined(PNG_READ_16_TO_8_SUPPORTED) - if ((png_ptr->transformations & PNG_16_TO_8) && (info_ptr->bit_depth == 16)) - info_ptr->bit_depth = 8; -#endif - -#if defined(PNG_READ_DITHER_SUPPORTED) - if (png_ptr->transformations & PNG_DITHER) - { - if (((info_ptr->color_type == PNG_COLOR_TYPE_RGB) || - (info_ptr->color_type == PNG_COLOR_TYPE_RGB_ALPHA)) && - png_ptr->palette_lookup && info_ptr->bit_depth == 8) - { - info_ptr->color_type = PNG_COLOR_TYPE_PALETTE; - } - } -#endif - -#if defined(PNG_READ_PACK_SUPPORTED) - if ((png_ptr->transformations & PNG_PACK) && (info_ptr->bit_depth < 8)) - info_ptr->bit_depth = 8; -#endif - -#if defined(PNG_READ_GRAY_TO_RGB_SUPPORTED) - if (png_ptr->transformations & PNG_GRAY_TO_RGB) - info_ptr->color_type |= PNG_COLOR_MASK_COLOR; -#endif - -#if defined(PNG_READ_RGB_TO_GRAY_SUPPORTED) - if (png_ptr->transformations & PNG_RGB_TO_GRAY) - info_ptr->color_type &= ~PNG_COLOR_MASK_COLOR; -#endif - - if (info_ptr->color_type == PNG_COLOR_TYPE_PALETTE) - info_ptr->channels = 1; - else if (info_ptr->color_type & PNG_COLOR_MASK_COLOR) - info_ptr->channels = 3; - else - info_ptr->channels = 1; - -#if defined(PNG_READ_STRIP_ALPHA_SUPPORTED) - if (png_ptr->transformations & PNG_STRIP_ALPHA) - info_ptr->color_type &= ~PNG_COLOR_MASK_ALPHA; -#endif - - if (info_ptr->color_type & PNG_COLOR_MASK_ALPHA) - info_ptr->channels++; - -#if defined(PNG_READ_FILLER_SUPPORTED) - /* STRIP_ALPHA and FILLER allowed: MASK_ALPHA bit stripped above */ - if ((png_ptr->transformations & PNG_FILLER) && - ((info_ptr->color_type == PNG_COLOR_TYPE_RGB) || - (info_ptr->color_type == PNG_COLOR_TYPE_GRAY))) - { - info_ptr->channels++; - /* if adding a true alpha channel not just filler */ -#if !defined(PNG_1_0_X) - if (png_ptr->transformations & PNG_ADD_ALPHA) - info_ptr->color_type |= PNG_COLOR_MASK_ALPHA; -#endif - } -#endif - -#if defined(PNG_USER_TRANSFORM_PTR_SUPPORTED) && \ -defined(PNG_READ_USER_TRANSFORM_SUPPORTED) - if(png_ptr->transformations & PNG_USER_TRANSFORM) - { - if(info_ptr->bit_depth < png_ptr->user_transform_depth) - info_ptr->bit_depth = png_ptr->user_transform_depth; - if(info_ptr->channels < png_ptr->user_transform_channels) - info_ptr->channels = png_ptr->user_transform_channels; - } -#endif - - info_ptr->pixel_depth = (png_byte)(info_ptr->channels * - info_ptr->bit_depth); - - info_ptr->rowbytes = PNG_ROWBYTES(info_ptr->pixel_depth,info_ptr->width); - -#if !defined(PNG_READ_EXPAND_SUPPORTED) - if(png_ptr) - return; -#endif -} - -/* Transform the row. The order of transformations is significant, - * and is very touchy. If you add a transformation, take care to - * decide how it fits in with the other transformations here. - */ -void /* PRIVATE */ -png_do_read_transformations(png_structp png_ptr) -{ - png_debug(1, "in png_do_read_transformations\n"); -#if !defined(PNG_USELESS_TESTS_SUPPORTED) - if (png_ptr->row_buf == NULL) - { -#if !defined(PNG_NO_STDIO) && !defined(_WIN32_WCE) - char msg[50]; - - sprintf(msg, "NULL row buffer for row %ld, pass %d", png_ptr->row_number, - png_ptr->pass); - png_error(png_ptr, msg); -#else - png_error(png_ptr, "NULL row buffer"); -#endif - } -#endif - -#if defined(PNG_READ_EXPAND_SUPPORTED) - if (png_ptr->transformations & PNG_EXPAND) - { - if (png_ptr->row_info.color_type == PNG_COLOR_TYPE_PALETTE) - { - png_do_expand_palette(&(png_ptr->row_info), png_ptr->row_buf + 1, - png_ptr->palette, png_ptr->trans, png_ptr->num_trans); - } - else - { - if (png_ptr->num_trans) - png_do_expand(&(png_ptr->row_info), png_ptr->row_buf + 1, - &(png_ptr->trans_values)); - else - png_do_expand(&(png_ptr->row_info), png_ptr->row_buf + 1, - NULL); - } - } -#endif - -#if defined(PNG_READ_STRIP_ALPHA_SUPPORTED) - if (png_ptr->transformations & PNG_STRIP_ALPHA) - png_do_strip_filler(&(png_ptr->row_info), png_ptr->row_buf + 1, - PNG_FLAG_FILLER_AFTER); -#endif - -#if defined(PNG_READ_RGB_TO_GRAY_SUPPORTED) - if (png_ptr->transformations & PNG_RGB_TO_GRAY) - { - int rgb_error = - png_do_rgb_to_gray(png_ptr, &(png_ptr->row_info), png_ptr->row_buf + 1); - if(rgb_error) - { - png_ptr->rgb_to_gray_status=1; - if(png_ptr->transformations == PNG_RGB_TO_GRAY_WARN) - png_warning(png_ptr, "png_do_rgb_to_gray found nongray pixel"); - if(png_ptr->transformations == PNG_RGB_TO_GRAY_ERR) - png_error(png_ptr, "png_do_rgb_to_gray found nongray pixel"); - } - } -#endif - -/* -From Andreas Dilger e-mail to png-implement, 26 March 1998: - - In most cases, the "simple transparency" should be done prior to doing - gray-to-RGB, or you will have to test 3x as many bytes to check if a - pixel is transparent. You would also need to make sure that the - transparency information is upgraded to RGB. - - To summarize, the current flow is: - - Gray + simple transparency -> compare 1 or 2 gray bytes and composite - with background "in place" if transparent, - convert to RGB if necessary - - Gray + alpha -> composite with gray background and remove alpha bytes, - convert to RGB if necessary - - To support RGB backgrounds for gray images we need: - - Gray + simple transparency -> convert to RGB + simple transparency, compare - 3 or 6 bytes and composite with background - "in place" if transparent (3x compare/pixel - compared to doing composite with gray bkgrnd) - - Gray + alpha -> convert to RGB + alpha, composite with background and - remove alpha bytes (3x float operations/pixel - compared with composite on gray background) - - Greg's change will do this. The reason it wasn't done before is for - performance, as this increases the per-pixel operations. If we would check - in advance if the background was gray or RGB, and position the gray-to-RGB - transform appropriately, then it would save a lot of work/time. - */ - -#if defined(PNG_READ_GRAY_TO_RGB_SUPPORTED) - /* if gray -> RGB, do so now only if background is non-gray; else do later - * for performance reasons */ - if ((png_ptr->transformations & PNG_GRAY_TO_RGB) && - !(png_ptr->mode & PNG_BACKGROUND_IS_GRAY)) - png_do_gray_to_rgb(&(png_ptr->row_info), png_ptr->row_buf + 1); -#endif - -#if defined(PNG_READ_BACKGROUND_SUPPORTED) - if ((png_ptr->transformations & PNG_BACKGROUND) && - ((png_ptr->num_trans != 0 ) || - (png_ptr->color_type & PNG_COLOR_MASK_ALPHA))) - png_do_background(&(png_ptr->row_info), png_ptr->row_buf + 1, - &(png_ptr->trans_values), &(png_ptr->background) -#if defined(PNG_READ_GAMMA_SUPPORTED) - , &(png_ptr->background_1), - png_ptr->gamma_table, png_ptr->gamma_from_1, - png_ptr->gamma_to_1, png_ptr->gamma_16_table, - png_ptr->gamma_16_from_1, png_ptr->gamma_16_to_1, - png_ptr->gamma_shift -#endif -); -#endif - -#if defined(PNG_READ_GAMMA_SUPPORTED) - if ((png_ptr->transformations & PNG_GAMMA) && -#if defined(PNG_READ_BACKGROUND_SUPPORTED) - !((png_ptr->transformations & PNG_BACKGROUND) && - ((png_ptr->num_trans != 0) || - (png_ptr->color_type & PNG_COLOR_MASK_ALPHA))) && -#endif - (png_ptr->color_type != PNG_COLOR_TYPE_PALETTE)) - png_do_gamma(&(png_ptr->row_info), png_ptr->row_buf + 1, - png_ptr->gamma_table, png_ptr->gamma_16_table, - png_ptr->gamma_shift); -#endif - -#if defined(PNG_READ_16_TO_8_SUPPORTED) - if (png_ptr->transformations & PNG_16_TO_8) - png_do_chop(&(png_ptr->row_info), png_ptr->row_buf + 1); -#endif - -#if defined(PNG_READ_DITHER_SUPPORTED) - if (png_ptr->transformations & PNG_DITHER) - { - png_do_dither((png_row_infop)&(png_ptr->row_info), png_ptr->row_buf + 1, - png_ptr->palette_lookup, png_ptr->dither_index); - if(png_ptr->row_info.rowbytes == (png_uint_32)0) - png_error(png_ptr, "png_do_dither returned rowbytes=0"); - } -#endif - -#if defined(PNG_READ_INVERT_SUPPORTED) - if (png_ptr->transformations & PNG_INVERT_MONO) - png_do_invert(&(png_ptr->row_info), png_ptr->row_buf + 1); -#endif - -#if defined(PNG_READ_SHIFT_SUPPORTED) - if (png_ptr->transformations & PNG_SHIFT) - png_do_unshift(&(png_ptr->row_info), png_ptr->row_buf + 1, - &(png_ptr->shift)); -#endif - -#if defined(PNG_READ_PACK_SUPPORTED) - if (png_ptr->transformations & PNG_PACK) - png_do_unpack(&(png_ptr->row_info), png_ptr->row_buf + 1); -#endif - -#if defined(PNG_READ_BGR_SUPPORTED) - if (png_ptr->transformations & PNG_BGR) - png_do_bgr(&(png_ptr->row_info), png_ptr->row_buf + 1); -#endif - -#if defined(PNG_READ_PACKSWAP_SUPPORTED) - if (png_ptr->transformations & PNG_PACKSWAP) - png_do_packswap(&(png_ptr->row_info), png_ptr->row_buf + 1); -#endif - -#if defined(PNG_READ_GRAY_TO_RGB_SUPPORTED) - /* if gray -> RGB, do so now only if we did not do so above */ - if ((png_ptr->transformations & PNG_GRAY_TO_RGB) && - (png_ptr->mode & PNG_BACKGROUND_IS_GRAY)) - png_do_gray_to_rgb(&(png_ptr->row_info), png_ptr->row_buf + 1); -#endif - -#if defined(PNG_READ_FILLER_SUPPORTED) - if (png_ptr->transformations & PNG_FILLER) - png_do_read_filler(&(png_ptr->row_info), png_ptr->row_buf + 1, - (png_uint_32)png_ptr->filler, png_ptr->flags); -#endif - -#if defined(PNG_READ_INVERT_ALPHA_SUPPORTED) - if (png_ptr->transformations & PNG_INVERT_ALPHA) - png_do_read_invert_alpha(&(png_ptr->row_info), png_ptr->row_buf + 1); -#endif - -#if defined(PNG_READ_SWAP_ALPHA_SUPPORTED) - if (png_ptr->transformations & PNG_SWAP_ALPHA) - png_do_read_swap_alpha(&(png_ptr->row_info), png_ptr->row_buf + 1); -#endif - -#if defined(PNG_READ_SWAP_SUPPORTED) - if (png_ptr->transformations & PNG_SWAP_BYTES) - png_do_swap(&(png_ptr->row_info), png_ptr->row_buf + 1); -#endif - -#if defined(PNG_READ_USER_TRANSFORM_SUPPORTED) - if (png_ptr->transformations & PNG_USER_TRANSFORM) - { - if(png_ptr->read_user_transform_fn != NULL) - (*(png_ptr->read_user_transform_fn)) /* user read transform function */ - (png_ptr, /* png_ptr */ - &(png_ptr->row_info), /* row_info: */ - /* png_uint_32 width; width of row */ - /* png_uint_32 rowbytes; number of bytes in row */ - /* png_byte color_type; color type of pixels */ - /* png_byte bit_depth; bit depth of samples */ - /* png_byte channels; number of channels (1-4) */ - /* png_byte pixel_depth; bits per pixel (depth*channels) */ - png_ptr->row_buf + 1); /* start of pixel data for row */ -#if defined(PNG_USER_TRANSFORM_PTR_SUPPORTED) - if(png_ptr->user_transform_depth) - png_ptr->row_info.bit_depth = png_ptr->user_transform_depth; - if(png_ptr->user_transform_channels) - png_ptr->row_info.channels = png_ptr->user_transform_channels; -#endif - png_ptr->row_info.pixel_depth = (png_byte)(png_ptr->row_info.bit_depth * - png_ptr->row_info.channels); - png_ptr->row_info.rowbytes = PNG_ROWBYTES(png_ptr->row_info.pixel_depth, - png_ptr->row_info.width); - } -#endif - -} - -#if defined(PNG_READ_PACK_SUPPORTED) -/* Unpack pixels of 1, 2, or 4 bits per pixel into 1 byte per pixel, - * without changing the actual values. Thus, if you had a row with - * a bit depth of 1, you would end up with bytes that only contained - * the numbers 0 or 1. If you would rather they contain 0 and 255, use - * png_do_shift() after this. - */ -void /* PRIVATE */ -png_do_unpack(png_row_infop row_info, png_bytep row) -{ - png_debug(1, "in png_do_unpack\n"); -#if defined(PNG_USELESS_TESTS_SUPPORTED) - if (row != NULL && row_info != NULL && row_info->bit_depth < 8) -#else - if (row_info->bit_depth < 8) -#endif - { - png_uint_32 i; - png_uint_32 row_width=row_info->width; - - switch (row_info->bit_depth) - { - case 1: - { - png_bytep sp = row + (png_size_t)((row_width - 1) >> 3); - png_bytep dp = row + (png_size_t)row_width - 1; - png_uint_32 shift = 7 - (int)((row_width + 7) & 0x07); - for (i = 0; i < row_width; i++) - { - *dp = (png_byte)((*sp >> shift) & 0x01); - if (shift == 7) - { - shift = 0; - sp--; - } - else - shift++; - - dp--; - } - break; - } - case 2: - { - - png_bytep sp = row + (png_size_t)((row_width - 1) >> 2); - png_bytep dp = row + (png_size_t)row_width - 1; - png_uint_32 shift = (int)((3 - ((row_width + 3) & 0x03)) << 1); - for (i = 0; i < row_width; i++) - { - *dp = (png_byte)((*sp >> shift) & 0x03); - if (shift == 6) - { - shift = 0; - sp--; - } - else - shift += 2; - - dp--; - } - break; - } - case 4: - { - png_bytep sp = row + (png_size_t)((row_width - 1) >> 1); - png_bytep dp = row + (png_size_t)row_width - 1; - png_uint_32 shift = (int)((1 - ((row_width + 1) & 0x01)) << 2); - for (i = 0; i < row_width; i++) - { - *dp = (png_byte)((*sp >> shift) & 0x0f); - if (shift == 4) - { - shift = 0; - sp--; - } - else - shift = 4; - - dp--; - } - break; - } - } - row_info->bit_depth = 8; - row_info->pixel_depth = (png_byte)(8 * row_info->channels); - row_info->rowbytes = row_width * row_info->channels; - } -} -#endif - -#if defined(PNG_READ_SHIFT_SUPPORTED) -/* Reverse the effects of png_do_shift. This routine merely shifts the - * pixels back to their significant bits values. Thus, if you have - * a row of bit depth 8, but only 5 are significant, this will shift - * the values back to 0 through 31. - */ -void /* PRIVATE */ -png_do_unshift(png_row_infop row_info, png_bytep row, png_color_8p sig_bits) -{ - png_debug(1, "in png_do_unshift\n"); - if ( -#if defined(PNG_USELESS_TESTS_SUPPORTED) - row != NULL && row_info != NULL && sig_bits != NULL && -#endif - row_info->color_type != PNG_COLOR_TYPE_PALETTE) - { - int shift[4]; - int channels = 0; - int c; - png_uint_16 value = 0; - png_uint_32 row_width = row_info->width; - - if (row_info->color_type & PNG_COLOR_MASK_COLOR) - { - shift[channels++] = row_info->bit_depth - sig_bits->red; - shift[channels++] = row_info->bit_depth - sig_bits->green; - shift[channels++] = row_info->bit_depth - sig_bits->blue; - } - else - { - shift[channels++] = row_info->bit_depth - sig_bits->gray; - } - if (row_info->color_type & PNG_COLOR_MASK_ALPHA) - { - shift[channels++] = row_info->bit_depth - sig_bits->alpha; - } - - for (c = 0; c < channels; c++) - { - if (shift[c] <= 0) - shift[c] = 0; - else - value = 1; - } - - if (!value) - return; - - switch (row_info->bit_depth) - { - case 2: - { - png_bytep bp; - png_uint_32 i; - png_uint_32 istop = row_info->rowbytes; - - for (bp = row, i = 0; i < istop; i++) - { - *bp >>= 1; - *bp++ &= 0x55; - } - break; - } - case 4: - { - png_bytep bp = row; - png_uint_32 i; - png_uint_32 istop = row_info->rowbytes; - png_byte mask = (png_byte)((((int)0xf0 >> shift[0]) & (int)0xf0) | - (png_byte)((int)0xf >> shift[0])); - - for (i = 0; i < istop; i++) - { - *bp >>= shift[0]; - *bp++ &= mask; - } - break; - } - case 8: - { - png_bytep bp = row; - png_uint_32 i; - png_uint_32 istop = row_width * channels; - - for (i = 0; i < istop; i++) - { - *bp++ >>= shift[i%channels]; - } - break; - } - case 16: - { - png_bytep bp = row; - png_uint_32 i; - png_uint_32 istop = channels * row_width; - - for (i = 0; i < istop; i++) - { - value = (png_uint_16)((*bp << 8) + *(bp + 1)); - value >>= shift[i%channels]; - *bp++ = (png_byte)(value >> 8); - *bp++ = (png_byte)(value & 0xff); - } - break; - } - } - } -} -#endif - -#if defined(PNG_READ_16_TO_8_SUPPORTED) -/* chop rows of bit depth 16 down to 8 */ -void /* PRIVATE */ -png_do_chop(png_row_infop row_info, png_bytep row) -{ - png_debug(1, "in png_do_chop\n"); -#if defined(PNG_USELESS_TESTS_SUPPORTED) - if (row != NULL && row_info != NULL && row_info->bit_depth == 16) -#else - if (row_info->bit_depth == 16) -#endif - { - png_bytep sp = row; - png_bytep dp = row; - png_uint_32 i; - png_uint_32 istop = row_info->width * row_info->channels; - - for (i = 0; i> 8)) >> 8; - * - * Approximate calculation with shift/add instead of multiply/divide: - * *dp = ((((png_uint_32)(*sp) << 8) | - * (png_uint_32)((int)(*(sp + 1)) - *sp)) + 128) >> 8; - * - * What we actually do to avoid extra shifting and conversion: - */ - - *dp = *sp + ((((int)(*(sp + 1)) - *sp) > 128) ? 1 : 0); -#else - /* Simply discard the low order byte */ - *dp = *sp; -#endif - } - row_info->bit_depth = 8; - row_info->pixel_depth = (png_byte)(8 * row_info->channels); - row_info->rowbytes = row_info->width * row_info->channels; - } -} -#endif - -#if defined(PNG_READ_SWAP_ALPHA_SUPPORTED) -void /* PRIVATE */ -png_do_read_swap_alpha(png_row_infop row_info, png_bytep row) -{ - png_debug(1, "in png_do_read_swap_alpha\n"); -#if defined(PNG_USELESS_TESTS_SUPPORTED) - if (row != NULL && row_info != NULL) -#endif - { - png_uint_32 row_width = row_info->width; - if (row_info->color_type == PNG_COLOR_TYPE_RGB_ALPHA) - { - /* This converts from RGBA to ARGB */ - if (row_info->bit_depth == 8) - { - png_bytep sp = row + row_info->rowbytes; - png_bytep dp = sp; - png_byte save; - png_uint_32 i; - - for (i = 0; i < row_width; i++) - { - save = *(--sp); - *(--dp) = *(--sp); - *(--dp) = *(--sp); - *(--dp) = *(--sp); - *(--dp) = save; - } - } - /* This converts from RRGGBBAA to AARRGGBB */ - else - { - png_bytep sp = row + row_info->rowbytes; - png_bytep dp = sp; - png_byte save[2]; - png_uint_32 i; - - for (i = 0; i < row_width; i++) - { - save[0] = *(--sp); - save[1] = *(--sp); - *(--dp) = *(--sp); - *(--dp) = *(--sp); - *(--dp) = *(--sp); - *(--dp) = *(--sp); - *(--dp) = *(--sp); - *(--dp) = *(--sp); - *(--dp) = save[0]; - *(--dp) = save[1]; - } - } - } - else if (row_info->color_type == PNG_COLOR_TYPE_GRAY_ALPHA) - { - /* This converts from GA to AG */ - if (row_info->bit_depth == 8) - { - png_bytep sp = row + row_info->rowbytes; - png_bytep dp = sp; - png_byte save; - png_uint_32 i; - - for (i = 0; i < row_width; i++) - { - save = *(--sp); - *(--dp) = *(--sp); - *(--dp) = save; - } - } - /* This converts from GGAA to AAGG */ - else - { - png_bytep sp = row + row_info->rowbytes; - png_bytep dp = sp; - png_byte save[2]; - png_uint_32 i; - - for (i = 0; i < row_width; i++) - { - save[0] = *(--sp); - save[1] = *(--sp); - *(--dp) = *(--sp); - *(--dp) = *(--sp); - *(--dp) = save[0]; - *(--dp) = save[1]; - } - } - } - } -} -#endif - -#if defined(PNG_READ_INVERT_ALPHA_SUPPORTED) -void /* PRIVATE */ -png_do_read_invert_alpha(png_row_infop row_info, png_bytep row) -{ - png_debug(1, "in png_do_read_invert_alpha\n"); -#if defined(PNG_USELESS_TESTS_SUPPORTED) - if (row != NULL && row_info != NULL) -#endif - { - png_uint_32 row_width = row_info->width; - if (row_info->color_type == PNG_COLOR_TYPE_RGB_ALPHA) - { - /* This inverts the alpha channel in RGBA */ - if (row_info->bit_depth == 8) - { - png_bytep sp = row + row_info->rowbytes; - png_bytep dp = sp; - png_uint_32 i; - - for (i = 0; i < row_width; i++) - { - *(--dp) = (png_byte)(255 - *(--sp)); - -/* This does nothing: - *(--dp) = *(--sp); - *(--dp) = *(--sp); - *(--dp) = *(--sp); - We can replace it with: -*/ - sp-=3; - dp=sp; - } - } - /* This inverts the alpha channel in RRGGBBAA */ - else - { - png_bytep sp = row + row_info->rowbytes; - png_bytep dp = sp; - png_uint_32 i; - - for (i = 0; i < row_width; i++) - { - *(--dp) = (png_byte)(255 - *(--sp)); - *(--dp) = (png_byte)(255 - *(--sp)); - -/* This does nothing: - *(--dp) = *(--sp); - *(--dp) = *(--sp); - *(--dp) = *(--sp); - *(--dp) = *(--sp); - *(--dp) = *(--sp); - *(--dp) = *(--sp); - We can replace it with: -*/ - sp-=6; - dp=sp; - } - } - } - else if (row_info->color_type == PNG_COLOR_TYPE_GRAY_ALPHA) - { - /* This inverts the alpha channel in GA */ - if (row_info->bit_depth == 8) - { - png_bytep sp = row + row_info->rowbytes; - png_bytep dp = sp; - png_uint_32 i; - - for (i = 0; i < row_width; i++) - { - *(--dp) = (png_byte)(255 - *(--sp)); - *(--dp) = *(--sp); - } - } - /* This inverts the alpha channel in GGAA */ - else - { - png_bytep sp = row + row_info->rowbytes; - png_bytep dp = sp; - png_uint_32 i; - - for (i = 0; i < row_width; i++) - { - *(--dp) = (png_byte)(255 - *(--sp)); - *(--dp) = (png_byte)(255 - *(--sp)); -/* - *(--dp) = *(--sp); - *(--dp) = *(--sp); -*/ - sp-=2; - dp=sp; - } - } - } - } -} -#endif - -#if defined(PNG_READ_FILLER_SUPPORTED) -/* Add filler channel if we have RGB color */ -void /* PRIVATE */ -png_do_read_filler(png_row_infop row_info, png_bytep row, - png_uint_32 filler, png_uint_32 flags) -{ - png_uint_32 i; - png_uint_32 row_width = row_info->width; - - png_byte hi_filler = (png_byte)((filler>>8) & 0xff); - png_byte lo_filler = (png_byte)(filler & 0xff); - - png_debug(1, "in png_do_read_filler\n"); - if ( -#if defined(PNG_USELESS_TESTS_SUPPORTED) - row != NULL && row_info != NULL && -#endif - row_info->color_type == PNG_COLOR_TYPE_GRAY) - { - if(row_info->bit_depth == 8) - { - /* This changes the data from G to GX */ - if (flags & PNG_FLAG_FILLER_AFTER) - { - png_bytep sp = row + (png_size_t)row_width; - png_bytep dp = sp + (png_size_t)row_width; - for (i = 1; i < row_width; i++) - { - *(--dp) = lo_filler; - *(--dp) = *(--sp); - } - *(--dp) = lo_filler; - row_info->channels = 2; - row_info->pixel_depth = 16; - row_info->rowbytes = row_width * 2; - } - /* This changes the data from G to XG */ - else - { - png_bytep sp = row + (png_size_t)row_width; - png_bytep dp = sp + (png_size_t)row_width; - for (i = 0; i < row_width; i++) - { - *(--dp) = *(--sp); - *(--dp) = lo_filler; - } - row_info->channels = 2; - row_info->pixel_depth = 16; - row_info->rowbytes = row_width * 2; - } - } - else if(row_info->bit_depth == 16) - { - /* This changes the data from GG to GGXX */ - if (flags & PNG_FLAG_FILLER_AFTER) - { - png_bytep sp = row + (png_size_t)row_width * 2; - png_bytep dp = sp + (png_size_t)row_width * 2; - for (i = 1; i < row_width; i++) - { - *(--dp) = hi_filler; - *(--dp) = lo_filler; - *(--dp) = *(--sp); - *(--dp) = *(--sp); - } - *(--dp) = hi_filler; - *(--dp) = lo_filler; - row_info->channels = 2; - row_info->pixel_depth = 32; - row_info->rowbytes = row_width * 4; - } - /* This changes the data from GG to XXGG */ - else - { - png_bytep sp = row + (png_size_t)row_width * 2; - png_bytep dp = sp + (png_size_t)row_width * 2; - for (i = 0; i < row_width; i++) - { - *(--dp) = *(--sp); - *(--dp) = *(--sp); - *(--dp) = hi_filler; - *(--dp) = lo_filler; - } - row_info->channels = 2; - row_info->pixel_depth = 32; - row_info->rowbytes = row_width * 4; - } - } - } /* COLOR_TYPE == GRAY */ - else if (row_info->color_type == PNG_COLOR_TYPE_RGB) - { - if(row_info->bit_depth == 8) - { - /* This changes the data from RGB to RGBX */ - if (flags & PNG_FLAG_FILLER_AFTER) - { - png_bytep sp = row + (png_size_t)row_width * 3; - png_bytep dp = sp + (png_size_t)row_width; - for (i = 1; i < row_width; i++) - { - *(--dp) = lo_filler; - *(--dp) = *(--sp); - *(--dp) = *(--sp); - *(--dp) = *(--sp); - } - *(--dp) = lo_filler; - row_info->channels = 4; - row_info->pixel_depth = 32; - row_info->rowbytes = row_width * 4; - } - /* This changes the data from RGB to XRGB */ - else - { - png_bytep sp = row + (png_size_t)row_width * 3; - png_bytep dp = sp + (png_size_t)row_width; - for (i = 0; i < row_width; i++) - { - *(--dp) = *(--sp); - *(--dp) = *(--sp); - *(--dp) = *(--sp); - *(--dp) = lo_filler; - } - row_info->channels = 4; - row_info->pixel_depth = 32; - row_info->rowbytes = row_width * 4; - } - } - else if(row_info->bit_depth == 16) - { - /* This changes the data from RRGGBB to RRGGBBXX */ - if (flags & PNG_FLAG_FILLER_AFTER) - { - png_bytep sp = row + (png_size_t)row_width * 6; - png_bytep dp = sp + (png_size_t)row_width * 2; - for (i = 1; i < row_width; i++) - { - *(--dp) = hi_filler; - *(--dp) = lo_filler; - *(--dp) = *(--sp); - *(--dp) = *(--sp); - *(--dp) = *(--sp); - *(--dp) = *(--sp); - *(--dp) = *(--sp); - *(--dp) = *(--sp); - } - *(--dp) = hi_filler; - *(--dp) = lo_filler; - row_info->channels = 4; - row_info->pixel_depth = 64; - row_info->rowbytes = row_width * 8; - } - /* This changes the data from RRGGBB to XXRRGGBB */ - else - { - png_bytep sp = row + (png_size_t)row_width * 6; - png_bytep dp = sp + (png_size_t)row_width * 2; - for (i = 0; i < row_width; i++) - { - *(--dp) = *(--sp); - *(--dp) = *(--sp); - *(--dp) = *(--sp); - *(--dp) = *(--sp); - *(--dp) = *(--sp); - *(--dp) = *(--sp); - *(--dp) = hi_filler; - *(--dp) = lo_filler; - } - row_info->channels = 4; - row_info->pixel_depth = 64; - row_info->rowbytes = row_width * 8; - } - } - } /* COLOR_TYPE == RGB */ -} -#endif - -#if defined(PNG_READ_GRAY_TO_RGB_SUPPORTED) -/* expand grayscale files to RGB, with or without alpha */ -void /* PRIVATE */ -png_do_gray_to_rgb(png_row_infop row_info, png_bytep row) -{ - png_uint_32 i; - png_uint_32 row_width = row_info->width; - - png_debug(1, "in png_do_gray_to_rgb\n"); - if (row_info->bit_depth >= 8 && -#if defined(PNG_USELESS_TESTS_SUPPORTED) - row != NULL && row_info != NULL && -#endif - !(row_info->color_type & PNG_COLOR_MASK_COLOR)) - { - if (row_info->color_type == PNG_COLOR_TYPE_GRAY) - { - if (row_info->bit_depth == 8) - { - png_bytep sp = row + (png_size_t)row_width - 1; - png_bytep dp = sp + (png_size_t)row_width * 2; - for (i = 0; i < row_width; i++) - { - *(dp--) = *sp; - *(dp--) = *sp; - *(dp--) = *(sp--); - } - } - else - { - png_bytep sp = row + (png_size_t)row_width * 2 - 1; - png_bytep dp = sp + (png_size_t)row_width * 4; - for (i = 0; i < row_width; i++) - { - *(dp--) = *sp; - *(dp--) = *(sp - 1); - *(dp--) = *sp; - *(dp--) = *(sp - 1); - *(dp--) = *(sp--); - *(dp--) = *(sp--); - } - } - } - else if (row_info->color_type == PNG_COLOR_TYPE_GRAY_ALPHA) - { - if (row_info->bit_depth == 8) - { - png_bytep sp = row + (png_size_t)row_width * 2 - 1; - png_bytep dp = sp + (png_size_t)row_width * 2; - for (i = 0; i < row_width; i++) - { - *(dp--) = *(sp--); - *(dp--) = *sp; - *(dp--) = *sp; - *(dp--) = *(sp--); - } - } - else - { - png_bytep sp = row + (png_size_t)row_width * 4 - 1; - png_bytep dp = sp + (png_size_t)row_width * 4; - for (i = 0; i < row_width; i++) - { - *(dp--) = *(sp--); - *(dp--) = *(sp--); - *(dp--) = *sp; - *(dp--) = *(sp - 1); - *(dp--) = *sp; - *(dp--) = *(sp - 1); - *(dp--) = *(sp--); - *(dp--) = *(sp--); - } - } - } - row_info->channels += (png_byte)2; - row_info->color_type |= PNG_COLOR_MASK_COLOR; - row_info->pixel_depth = (png_byte)(row_info->channels * - row_info->bit_depth); - row_info->rowbytes = PNG_ROWBYTES(row_info->pixel_depth,row_width); - } -} -#endif - -#if defined(PNG_READ_RGB_TO_GRAY_SUPPORTED) -/* reduce RGB files to grayscale, with or without alpha - * using the equation given in Poynton's ColorFAQ at - * - * Copyright (c) 1998-01-04 Charles Poynton poynton@inforamp.net - * - * Y = 0.212671 * R + 0.715160 * G + 0.072169 * B - * - * We approximate this with - * - * Y = 0.21268 * R + 0.7151 * G + 0.07217 * B - * - * which can be expressed with integers as - * - * Y = (6969 * R + 23434 * G + 2365 * B)/32768 - * - * The calculation is to be done in a linear colorspace. - * - * Other integer coefficents can be used via png_set_rgb_to_gray(). - */ -int /* PRIVATE */ -png_do_rgb_to_gray(png_structp png_ptr, png_row_infop row_info, png_bytep row) - -{ - png_uint_32 i; - - png_uint_32 row_width = row_info->width; - int rgb_error = 0; - - png_debug(1, "in png_do_rgb_to_gray\n"); - if ( -#if defined(PNG_USELESS_TESTS_SUPPORTED) - row != NULL && row_info != NULL && -#endif - (row_info->color_type & PNG_COLOR_MASK_COLOR)) - { - png_uint_32 rc = png_ptr->rgb_to_gray_red_coeff; - png_uint_32 gc = png_ptr->rgb_to_gray_green_coeff; - png_uint_32 bc = png_ptr->rgb_to_gray_blue_coeff; - - if (row_info->color_type == PNG_COLOR_TYPE_RGB) - { - if (row_info->bit_depth == 8) - { -#if defined(PNG_READ_GAMMA_SUPPORTED) || defined(PNG_READ_BACKGROUND_SUPPORTED) - if (png_ptr->gamma_from_1 != NULL && png_ptr->gamma_to_1 != NULL) - { - png_bytep sp = row; - png_bytep dp = row; - - for (i = 0; i < row_width; i++) - { - png_byte red = png_ptr->gamma_to_1[*(sp++)]; - png_byte green = png_ptr->gamma_to_1[*(sp++)]; - png_byte blue = png_ptr->gamma_to_1[*(sp++)]; - if(red != green || red != blue) - { - rgb_error |= 1; - *(dp++) = png_ptr->gamma_from_1[ - (rc*red+gc*green+bc*blue)>>15]; - } - else - *(dp++) = *(sp-1); - } - } - else -#endif - { - png_bytep sp = row; - png_bytep dp = row; - for (i = 0; i < row_width; i++) - { - png_byte red = *(sp++); - png_byte green = *(sp++); - png_byte blue = *(sp++); - if(red != green || red != blue) - { - rgb_error |= 1; - *(dp++) = (png_byte)((rc*red+gc*green+bc*blue)>>15); - } - else - *(dp++) = *(sp-1); - } - } - } - - else /* RGB bit_depth == 16 */ - { -#if defined(PNG_READ_GAMMA_SUPPORTED) || defined(PNG_READ_BACKGROUND_SUPPORTED) - if (png_ptr->gamma_16_to_1 != NULL && - png_ptr->gamma_16_from_1 != NULL) - { - png_bytep sp = row; - png_bytep dp = row; - for (i = 0; i < row_width; i++) - { - png_uint_16 red, green, blue, w; - - red = (png_uint_16)(((*(sp))<<8) | *(sp+1)); sp+=2; - green = (png_uint_16)(((*(sp))<<8) | *(sp+1)); sp+=2; - blue = (png_uint_16)(((*(sp))<<8) | *(sp+1)); sp+=2; - - if(red == green && red == blue) - w = red; - else - { - png_uint_16 red_1 = png_ptr->gamma_16_to_1[(red&0xff) >> - png_ptr->gamma_shift][red>>8]; - png_uint_16 green_1 = png_ptr->gamma_16_to_1[(green&0xff) >> - png_ptr->gamma_shift][green>>8]; - png_uint_16 blue_1 = png_ptr->gamma_16_to_1[(blue&0xff) >> - png_ptr->gamma_shift][blue>>8]; - png_uint_16 gray16 = (png_uint_16)((rc*red_1 + gc*green_1 - + bc*blue_1)>>15); - w = png_ptr->gamma_16_from_1[(gray16&0xff) >> - png_ptr->gamma_shift][gray16 >> 8]; - rgb_error |= 1; - } - - *(dp++) = (png_byte)((w>>8) & 0xff); - *(dp++) = (png_byte)(w & 0xff); - } - } - else -#endif - { - png_bytep sp = row; - png_bytep dp = row; - for (i = 0; i < row_width; i++) - { - png_uint_16 red, green, blue, gray16; - - red = (png_uint_16)(((*(sp))<<8) | *(sp+1)); sp+=2; - green = (png_uint_16)(((*(sp))<<8) | *(sp+1)); sp+=2; - blue = (png_uint_16)(((*(sp))<<8) | *(sp+1)); sp+=2; - - if(red != green || red != blue) - rgb_error |= 1; - gray16 = (png_uint_16)((rc*red + gc*green + bc*blue)>>15); - *(dp++) = (png_byte)((gray16>>8) & 0xff); - *(dp++) = (png_byte)(gray16 & 0xff); - } - } - } - } - if (row_info->color_type == PNG_COLOR_TYPE_RGB_ALPHA) - { - if (row_info->bit_depth == 8) - { -#if defined(PNG_READ_GAMMA_SUPPORTED) || defined(PNG_READ_BACKGROUND_SUPPORTED) - if (png_ptr->gamma_from_1 != NULL && png_ptr->gamma_to_1 != NULL) - { - png_bytep sp = row; - png_bytep dp = row; - for (i = 0; i < row_width; i++) - { - png_byte red = png_ptr->gamma_to_1[*(sp++)]; - png_byte green = png_ptr->gamma_to_1[*(sp++)]; - png_byte blue = png_ptr->gamma_to_1[*(sp++)]; - if(red != green || red != blue) - rgb_error |= 1; - *(dp++) = png_ptr->gamma_from_1 - [(rc*red + gc*green + bc*blue)>>15]; - *(dp++) = *(sp++); /* alpha */ - } - } - else -#endif - { - png_bytep sp = row; - png_bytep dp = row; - for (i = 0; i < row_width; i++) - { - png_byte red = *(sp++); - png_byte green = *(sp++); - png_byte blue = *(sp++); - if(red != green || red != blue) - rgb_error |= 1; - *(dp++) = (png_byte)((rc*red + gc*green + bc*blue)>>15); - *(dp++) = *(sp++); /* alpha */ - } - } - } - else /* RGBA bit_depth == 16 */ - { -#if defined(PNG_READ_GAMMA_SUPPORTED) || defined(PNG_READ_BACKGROUND_SUPPORTED) - if (png_ptr->gamma_16_to_1 != NULL && - png_ptr->gamma_16_from_1 != NULL) - { - png_bytep sp = row; - png_bytep dp = row; - for (i = 0; i < row_width; i++) - { - png_uint_16 red, green, blue, w; - - red = (png_uint_16)(((*(sp))<<8) | *(sp+1)); sp+=2; - green = (png_uint_16)(((*(sp))<<8) | *(sp+1)); sp+=2; - blue = (png_uint_16)(((*(sp))<<8) | *(sp+1)); sp+=2; - - if(red == green && red == blue) - w = red; - else - { - png_uint_16 red_1 = png_ptr->gamma_16_to_1[(red&0xff) >> - png_ptr->gamma_shift][red>>8]; - png_uint_16 green_1 = png_ptr->gamma_16_to_1[(green&0xff) >> - png_ptr->gamma_shift][green>>8]; - png_uint_16 blue_1 = png_ptr->gamma_16_to_1[(blue&0xff) >> - png_ptr->gamma_shift][blue>>8]; - png_uint_16 gray16 = (png_uint_16)((rc * red_1 - + gc * green_1 + bc * blue_1)>>15); - w = png_ptr->gamma_16_from_1[(gray16&0xff) >> - png_ptr->gamma_shift][gray16 >> 8]; - rgb_error |= 1; - } - - *(dp++) = (png_byte)((w>>8) & 0xff); - *(dp++) = (png_byte)(w & 0xff); - *(dp++) = *(sp++); /* alpha */ - *(dp++) = *(sp++); - } - } - else -#endif - { - png_bytep sp = row; - png_bytep dp = row; - for (i = 0; i < row_width; i++) - { - png_uint_16 red, green, blue, gray16; - red = (png_uint_16)((*(sp)<<8) | *(sp+1)); sp+=2; - green = (png_uint_16)((*(sp)<<8) | *(sp+1)); sp+=2; - blue = (png_uint_16)((*(sp)<<8) | *(sp+1)); sp+=2; - if(red != green || red != blue) - rgb_error |= 1; - gray16 = (png_uint_16)((rc*red + gc*green + bc*blue)>>15); - *(dp++) = (png_byte)((gray16>>8) & 0xff); - *(dp++) = (png_byte)(gray16 & 0xff); - *(dp++) = *(sp++); /* alpha */ - *(dp++) = *(sp++); - } - } - } - } - row_info->channels -= (png_byte)2; - row_info->color_type &= ~PNG_COLOR_MASK_COLOR; - row_info->pixel_depth = (png_byte)(row_info->channels * - row_info->bit_depth); - row_info->rowbytes = PNG_ROWBYTES(row_info->pixel_depth,row_width); - } - return rgb_error; -} -#endif - -/* Build a grayscale palette. Palette is assumed to be 1 << bit_depth - * large of png_color. This lets grayscale images be treated as - * paletted. Most useful for gamma correction and simplification - * of code. - */ -void PNGAPI -png_build_grayscale_palette(int bit_depth, png_colorp palette) -{ - int num_palette; - int color_inc; - int i; - int v; - - png_debug(1, "in png_do_build_grayscale_palette\n"); - if (palette == NULL) - return; - - switch (bit_depth) - { - case 1: - num_palette = 2; - color_inc = 0xff; - break; - case 2: - num_palette = 4; - color_inc = 0x55; - break; - case 4: - num_palette = 16; - color_inc = 0x11; - break; - case 8: - num_palette = 256; - color_inc = 1; - break; - default: - num_palette = 0; - color_inc = 0; - break; - } - - for (i = 0, v = 0; i < num_palette; i++, v += color_inc) - { - palette[i].red = (png_byte)v; - palette[i].green = (png_byte)v; - palette[i].blue = (png_byte)v; - } -} - -/* This function is currently unused. Do we really need it? */ -#if defined(PNG_READ_DITHER_SUPPORTED) && defined(PNG_CORRECT_PALETTE_SUPPORTED) -void /* PRIVATE */ -png_correct_palette(png_structp png_ptr, png_colorp palette, - int num_palette) -{ - png_debug(1, "in png_correct_palette\n"); -#if defined(PNG_READ_BACKGROUND_SUPPORTED) && \ - defined(PNG_READ_GAMMA_SUPPORTED) && defined(PNG_FLOATING_POINT_SUPPORTED) - if (png_ptr->transformations & (PNG_GAMMA | PNG_BACKGROUND)) - { - png_color back, back_1; - - if (png_ptr->background_gamma_type == PNG_BACKGROUND_GAMMA_FILE) - { - back.red = png_ptr->gamma_table[png_ptr->background.red]; - back.green = png_ptr->gamma_table[png_ptr->background.green]; - back.blue = png_ptr->gamma_table[png_ptr->background.blue]; - - back_1.red = png_ptr->gamma_to_1[png_ptr->background.red]; - back_1.green = png_ptr->gamma_to_1[png_ptr->background.green]; - back_1.blue = png_ptr->gamma_to_1[png_ptr->background.blue]; - } - else - { - double g; - - g = 1.0 / (png_ptr->background_gamma * png_ptr->screen_gamma); - - if (png_ptr->background_gamma_type == PNG_BACKGROUND_GAMMA_SCREEN || - fabs(g - 1.0) < PNG_GAMMA_THRESHOLD) - { - back.red = png_ptr->background.red; - back.green = png_ptr->background.green; - back.blue = png_ptr->background.blue; - } - else - { - back.red = - (png_byte)(pow((double)png_ptr->background.red/255, g) * - 255.0 + 0.5); - back.green = - (png_byte)(pow((double)png_ptr->background.green/255, g) * - 255.0 + 0.5); - back.blue = - (png_byte)(pow((double)png_ptr->background.blue/255, g) * - 255.0 + 0.5); - } - - g = 1.0 / png_ptr->background_gamma; - - back_1.red = - (png_byte)(pow((double)png_ptr->background.red/255, g) * - 255.0 + 0.5); - back_1.green = - (png_byte)(pow((double)png_ptr->background.green/255, g) * - 255.0 + 0.5); - back_1.blue = - (png_byte)(pow((double)png_ptr->background.blue/255, g) * - 255.0 + 0.5); - } - - if (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE) - { - png_uint_32 i; - - for (i = 0; i < (png_uint_32)num_palette; i++) - { - if (i < png_ptr->num_trans && png_ptr->trans[i] == 0) - { - palette[i] = back; - } - else if (i < png_ptr->num_trans && png_ptr->trans[i] != 0xff) - { - png_byte v, w; - - v = png_ptr->gamma_to_1[png_ptr->palette[i].red]; - png_composite(w, v, png_ptr->trans[i], back_1.red); - palette[i].red = png_ptr->gamma_from_1[w]; - - v = png_ptr->gamma_to_1[png_ptr->palette[i].green]; - png_composite(w, v, png_ptr->trans[i], back_1.green); - palette[i].green = png_ptr->gamma_from_1[w]; - - v = png_ptr->gamma_to_1[png_ptr->palette[i].blue]; - png_composite(w, v, png_ptr->trans[i], back_1.blue); - palette[i].blue = png_ptr->gamma_from_1[w]; - } - else - { - palette[i].red = png_ptr->gamma_table[palette[i].red]; - palette[i].green = png_ptr->gamma_table[palette[i].green]; - palette[i].blue = png_ptr->gamma_table[palette[i].blue]; - } - } - } - else - { - int i; - - for (i = 0; i < num_palette; i++) - { - if (palette[i].red == (png_byte)png_ptr->trans_values.gray) - { - palette[i] = back; - } - else - { - palette[i].red = png_ptr->gamma_table[palette[i].red]; - palette[i].green = png_ptr->gamma_table[palette[i].green]; - palette[i].blue = png_ptr->gamma_table[palette[i].blue]; - } - } - } - } - else -#endif -#if defined(PNG_READ_GAMMA_SUPPORTED) - if (png_ptr->transformations & PNG_GAMMA) - { - int i; - - for (i = 0; i < num_palette; i++) - { - palette[i].red = png_ptr->gamma_table[palette[i].red]; - palette[i].green = png_ptr->gamma_table[palette[i].green]; - palette[i].blue = png_ptr->gamma_table[palette[i].blue]; - } - } -#if defined(PNG_READ_BACKGROUND_SUPPORTED) - else -#endif -#endif -#if defined(PNG_READ_BACKGROUND_SUPPORTED) - if (png_ptr->transformations & PNG_BACKGROUND) - { - if (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE) - { - png_color back; - - back.red = (png_byte)png_ptr->background.red; - back.green = (png_byte)png_ptr->background.green; - back.blue = (png_byte)png_ptr->background.blue; - - for (i = 0; i < (int)png_ptr->num_trans; i++) - { - if (png_ptr->trans[i] == 0) - { - palette[i].red = back.red; - palette[i].green = back.green; - palette[i].blue = back.blue; - } - else if (png_ptr->trans[i] != 0xff) - { - png_composite(palette[i].red, png_ptr->palette[i].red, - png_ptr->trans[i], back.red); - png_composite(palette[i].green, png_ptr->palette[i].green, - png_ptr->trans[i], back.green); - png_composite(palette[i].blue, png_ptr->palette[i].blue, - png_ptr->trans[i], back.blue); - } - } - } - else /* assume grayscale palette (what else could it be?) */ - { - int i; - - for (i = 0; i < num_palette; i++) - { - if (i == (png_byte)png_ptr->trans_values.gray) - { - palette[i].red = (png_byte)png_ptr->background.red; - palette[i].green = (png_byte)png_ptr->background.green; - palette[i].blue = (png_byte)png_ptr->background.blue; - } - } - } - } -#endif -} -#endif - -#if defined(PNG_READ_BACKGROUND_SUPPORTED) -/* Replace any alpha or transparency with the supplied background color. - * "background" is already in the screen gamma, while "background_1" is - * at a gamma of 1.0. Paletted files have already been taken care of. - */ -void /* PRIVATE */ -png_do_background(png_row_infop row_info, png_bytep row, - png_color_16p trans_values, png_color_16p background -#if defined(PNG_READ_GAMMA_SUPPORTED) - , png_color_16p background_1, - png_bytep gamma_table, png_bytep gamma_from_1, png_bytep gamma_to_1, - png_uint_16pp gamma_16, png_uint_16pp gamma_16_from_1, - png_uint_16pp gamma_16_to_1, int gamma_shift -#endif - ) -{ - png_bytep sp, dp; - png_uint_32 i; - png_uint_32 row_width=row_info->width; - int shift; - - png_debug(1, "in png_do_background\n"); - if (background != NULL && -#if defined(PNG_USELESS_TESTS_SUPPORTED) - row != NULL && row_info != NULL && -#endif - (!(row_info->color_type & PNG_COLOR_MASK_ALPHA) || - (row_info->color_type != PNG_COLOR_TYPE_PALETTE && trans_values))) - { - switch (row_info->color_type) - { - case PNG_COLOR_TYPE_GRAY: - { - switch (row_info->bit_depth) - { - case 1: - { - sp = row; - shift = 7; - for (i = 0; i < row_width; i++) - { - if ((png_uint_16)((*sp >> shift) & 0x01) - == trans_values->gray) - { - *sp &= (png_byte)((0x7f7f >> (7 - shift)) & 0xff); - *sp |= (png_byte)(background->gray << shift); - } - if (!shift) - { - shift = 7; - sp++; - } - else - shift--; - } - break; - } - case 2: - { -#if defined(PNG_READ_GAMMA_SUPPORTED) - if (gamma_table != NULL) - { - sp = row; - shift = 6; - for (i = 0; i < row_width; i++) - { - if ((png_uint_16)((*sp >> shift) & 0x03) - == trans_values->gray) - { - *sp &= (png_byte)((0x3f3f >> (6 - shift)) & 0xff); - *sp |= (png_byte)(background->gray << shift); - } - else - { - png_byte p = (png_byte)((*sp >> shift) & 0x03); - png_byte g = (png_byte)((gamma_table [p | (p << 2) | - (p << 4) | (p << 6)] >> 6) & 0x03); - *sp &= (png_byte)((0x3f3f >> (6 - shift)) & 0xff); - *sp |= (png_byte)(g << shift); - } - if (!shift) - { - shift = 6; - sp++; - } - else - shift -= 2; - } - } - else -#endif - { - sp = row; - shift = 6; - for (i = 0; i < row_width; i++) - { - if ((png_uint_16)((*sp >> shift) & 0x03) - == trans_values->gray) - { - *sp &= (png_byte)((0x3f3f >> (6 - shift)) & 0xff); - *sp |= (png_byte)(background->gray << shift); - } - if (!shift) - { - shift = 6; - sp++; - } - else - shift -= 2; - } - } - break; - } - case 4: - { -#if defined(PNG_READ_GAMMA_SUPPORTED) - if (gamma_table != NULL) - { - sp = row; - shift = 4; - for (i = 0; i < row_width; i++) - { - if ((png_uint_16)((*sp >> shift) & 0x0f) - == trans_values->gray) - { - *sp &= (png_byte)((0xf0f >> (4 - shift)) & 0xff); - *sp |= (png_byte)(background->gray << shift); - } - else - { - png_byte p = (png_byte)((*sp >> shift) & 0x0f); - png_byte g = (png_byte)((gamma_table[p | - (p << 4)] >> 4) & 0x0f); - *sp &= (png_byte)((0xf0f >> (4 - shift)) & 0xff); - *sp |= (png_byte)(g << shift); - } - if (!shift) - { - shift = 4; - sp++; - } - else - shift -= 4; - } - } - else -#endif - { - sp = row; - shift = 4; - for (i = 0; i < row_width; i++) - { - if ((png_uint_16)((*sp >> shift) & 0x0f) - == trans_values->gray) - { - *sp &= (png_byte)((0xf0f >> (4 - shift)) & 0xff); - *sp |= (png_byte)(background->gray << shift); - } - if (!shift) - { - shift = 4; - sp++; - } - else - shift -= 4; - } - } - break; - } - case 8: - { -#if defined(PNG_READ_GAMMA_SUPPORTED) - if (gamma_table != NULL) - { - sp = row; - for (i = 0; i < row_width; i++, sp++) - { - if (*sp == trans_values->gray) - { - *sp = (png_byte)background->gray; - } - else - { - *sp = gamma_table[*sp]; - } - } - } - else -#endif - { - sp = row; - for (i = 0; i < row_width; i++, sp++) - { - if (*sp == trans_values->gray) - { - *sp = (png_byte)background->gray; - } - } - } - break; - } - case 16: - { -#if defined(PNG_READ_GAMMA_SUPPORTED) - if (gamma_16 != NULL) - { - sp = row; - for (i = 0; i < row_width; i++, sp += 2) - { - png_uint_16 v; - - v = (png_uint_16)(((*sp) << 8) + *(sp + 1)); - if (v == trans_values->gray) - { - /* background is already in screen gamma */ - *sp = (png_byte)((background->gray >> 8) & 0xff); - *(sp + 1) = (png_byte)(background->gray & 0xff); - } - else - { - v = gamma_16[*(sp + 1) >> gamma_shift][*sp]; - *sp = (png_byte)((v >> 8) & 0xff); - *(sp + 1) = (png_byte)(v & 0xff); - } - } - } - else -#endif - { - sp = row; - for (i = 0; i < row_width; i++, sp += 2) - { - png_uint_16 v; - - v = (png_uint_16)(((*sp) << 8) + *(sp + 1)); - if (v == trans_values->gray) - { - *sp = (png_byte)((background->gray >> 8) & 0xff); - *(sp + 1) = (png_byte)(background->gray & 0xff); - } - } - } - break; - } - } - break; - } - case PNG_COLOR_TYPE_RGB: - { - if (row_info->bit_depth == 8) - { -#if defined(PNG_READ_GAMMA_SUPPORTED) - if (gamma_table != NULL) - { - sp = row; - for (i = 0; i < row_width; i++, sp += 3) - { - if (*sp == trans_values->red && - *(sp + 1) == trans_values->green && - *(sp + 2) == trans_values->blue) - { - *sp = (png_byte)background->red; - *(sp + 1) = (png_byte)background->green; - *(sp + 2) = (png_byte)background->blue; - } - else - { - *sp = gamma_table[*sp]; - *(sp + 1) = gamma_table[*(sp + 1)]; - *(sp + 2) = gamma_table[*(sp + 2)]; - } - } - } - else -#endif - { - sp = row; - for (i = 0; i < row_width; i++, sp += 3) - { - if (*sp == trans_values->red && - *(sp + 1) == trans_values->green && - *(sp + 2) == trans_values->blue) - { - *sp = (png_byte)background->red; - *(sp + 1) = (png_byte)background->green; - *(sp + 2) = (png_byte)background->blue; - } - } - } - } - else /* if (row_info->bit_depth == 16) */ - { -#if defined(PNG_READ_GAMMA_SUPPORTED) - if (gamma_16 != NULL) - { - sp = row; - for (i = 0; i < row_width; i++, sp += 6) - { - png_uint_16 r = (png_uint_16)(((*sp) << 8) + *(sp + 1)); - png_uint_16 g = (png_uint_16)(((*(sp+2)) << 8) + *(sp+3)); - png_uint_16 b = (png_uint_16)(((*(sp+4)) << 8) + *(sp+5)); - if (r == trans_values->red && g == trans_values->green && - b == trans_values->blue) - { - /* background is already in screen gamma */ - *sp = (png_byte)((background->red >> 8) & 0xff); - *(sp + 1) = (png_byte)(background->red & 0xff); - *(sp + 2) = (png_byte)((background->green >> 8) & 0xff); - *(sp + 3) = (png_byte)(background->green & 0xff); - *(sp + 4) = (png_byte)((background->blue >> 8) & 0xff); - *(sp + 5) = (png_byte)(background->blue & 0xff); - } - else - { - png_uint_16 v = gamma_16[*(sp + 1) >> gamma_shift][*sp]; - *sp = (png_byte)((v >> 8) & 0xff); - *(sp + 1) = (png_byte)(v & 0xff); - v = gamma_16[*(sp + 3) >> gamma_shift][*(sp + 2)]; - *(sp + 2) = (png_byte)((v >> 8) & 0xff); - *(sp + 3) = (png_byte)(v & 0xff); - v = gamma_16[*(sp + 5) >> gamma_shift][*(sp + 4)]; - *(sp + 4) = (png_byte)((v >> 8) & 0xff); - *(sp + 5) = (png_byte)(v & 0xff); - } - } - } - else -#endif - { - sp = row; - for (i = 0; i < row_width; i++, sp += 6) - { - png_uint_16 r = (png_uint_16)(((*sp) << 8) + *(sp+1)); - png_uint_16 g = (png_uint_16)(((*(sp+2)) << 8) + *(sp+3)); - png_uint_16 b = (png_uint_16)(((*(sp+4)) << 8) + *(sp+5)); - - if (r == trans_values->red && g == trans_values->green && - b == trans_values->blue) - { - *sp = (png_byte)((background->red >> 8) & 0xff); - *(sp + 1) = (png_byte)(background->red & 0xff); - *(sp + 2) = (png_byte)((background->green >> 8) & 0xff); - *(sp + 3) = (png_byte)(background->green & 0xff); - *(sp + 4) = (png_byte)((background->blue >> 8) & 0xff); - *(sp + 5) = (png_byte)(background->blue & 0xff); - } - } - } - } - break; - } - case PNG_COLOR_TYPE_GRAY_ALPHA: - { - if (row_info->bit_depth == 8) - { -#if defined(PNG_READ_GAMMA_SUPPORTED) - if (gamma_to_1 != NULL && gamma_from_1 != NULL && - gamma_table != NULL) - { - sp = row; - dp = row; - for (i = 0; i < row_width; i++, sp += 2, dp++) - { - png_uint_16 a = *(sp + 1); - - if (a == 0xff) - { - *dp = gamma_table[*sp]; - } - else if (a == 0) - { - /* background is already in screen gamma */ - *dp = (png_byte)background->gray; - } - else - { - png_byte v, w; - - v = gamma_to_1[*sp]; - png_composite(w, v, a, background_1->gray); - *dp = gamma_from_1[w]; - } - } - } - else -#endif - { - sp = row; - dp = row; - for (i = 0; i < row_width; i++, sp += 2, dp++) - { - png_byte a = *(sp + 1); - - if (a == 0xff) - { - *dp = *sp; - } -#if defined(PNG_READ_GAMMA_SUPPORTED) - else if (a == 0) - { - *dp = (png_byte)background->gray; - } - else - { - png_composite(*dp, *sp, a, background_1->gray); - } -#else - *dp = (png_byte)background->gray; -#endif - } - } - } - else /* if (png_ptr->bit_depth == 16) */ - { -#if defined(PNG_READ_GAMMA_SUPPORTED) - if (gamma_16 != NULL && gamma_16_from_1 != NULL && - gamma_16_to_1 != NULL) - { - sp = row; - dp = row; - for (i = 0; i < row_width; i++, sp += 4, dp += 2) - { - png_uint_16 a = (png_uint_16)(((*(sp+2)) << 8) + *(sp+3)); - - if (a == (png_uint_16)0xffff) - { - png_uint_16 v; - - v = gamma_16[*(sp + 1) >> gamma_shift][*sp]; - *dp = (png_byte)((v >> 8) & 0xff); - *(dp + 1) = (png_byte)(v & 0xff); - } -#if defined(PNG_READ_GAMMA_SUPPORTED) - else if (a == 0) -#else - else -#endif - { - /* background is already in screen gamma */ - *dp = (png_byte)((background->gray >> 8) & 0xff); - *(dp + 1) = (png_byte)(background->gray & 0xff); - } -#if defined(PNG_READ_GAMMA_SUPPORTED) - else - { - png_uint_16 g, v, w; - - g = gamma_16_to_1[*(sp + 1) >> gamma_shift][*sp]; - png_composite_16(v, g, a, background_1->gray); - w = gamma_16_from_1[(v&0xff) >> gamma_shift][v >> 8]; - *dp = (png_byte)((w >> 8) & 0xff); - *(dp + 1) = (png_byte)(w & 0xff); - } -#endif - } - } - else -#endif - { - sp = row; - dp = row; - for (i = 0; i < row_width; i++, sp += 4, dp += 2) - { - png_uint_16 a = (png_uint_16)(((*(sp+2)) << 8) + *(sp+3)); - if (a == (png_uint_16)0xffff) - { - png_memcpy(dp, sp, 2); - } -#if defined(PNG_READ_GAMMA_SUPPORTED) - else if (a == 0) -#else - else -#endif - { - *dp = (png_byte)((background->gray >> 8) & 0xff); - *(dp + 1) = (png_byte)(background->gray & 0xff); - } -#if defined(PNG_READ_GAMMA_SUPPORTED) - else - { - png_uint_16 g, v; - - g = (png_uint_16)(((*sp) << 8) + *(sp + 1)); - png_composite_16(v, g, a, background_1->gray); - *dp = (png_byte)((v >> 8) & 0xff); - *(dp + 1) = (png_byte)(v & 0xff); - } -#endif - } - } - } - break; - } - case PNG_COLOR_TYPE_RGB_ALPHA: - { - if (row_info->bit_depth == 8) - { -#if defined(PNG_READ_GAMMA_SUPPORTED) - if (gamma_to_1 != NULL && gamma_from_1 != NULL && - gamma_table != NULL) - { - sp = row; - dp = row; - for (i = 0; i < row_width; i++, sp += 4, dp += 3) - { - png_byte a = *(sp + 3); - - if (a == 0xff) - { - *dp = gamma_table[*sp]; - *(dp + 1) = gamma_table[*(sp + 1)]; - *(dp + 2) = gamma_table[*(sp + 2)]; - } - else if (a == 0) - { - /* background is already in screen gamma */ - *dp = (png_byte)background->red; - *(dp + 1) = (png_byte)background->green; - *(dp + 2) = (png_byte)background->blue; - } - else - { - png_byte v, w; - - v = gamma_to_1[*sp]; - png_composite(w, v, a, background_1->red); - *dp = gamma_from_1[w]; - v = gamma_to_1[*(sp + 1)]; - png_composite(w, v, a, background_1->green); - *(dp + 1) = gamma_from_1[w]; - v = gamma_to_1[*(sp + 2)]; - png_composite(w, v, a, background_1->blue); - *(dp + 2) = gamma_from_1[w]; - } - } - } - else -#endif - { - sp = row; - dp = row; - for (i = 0; i < row_width; i++, sp += 4, dp += 3) - { - png_byte a = *(sp + 3); - - if (a == 0xff) - { - *dp = *sp; - *(dp + 1) = *(sp + 1); - *(dp + 2) = *(sp + 2); - } - else if (a == 0) - { - *dp = (png_byte)background->red; - *(dp + 1) = (png_byte)background->green; - *(dp + 2) = (png_byte)background->blue; - } - else - { - png_composite(*dp, *sp, a, background->red); - png_composite(*(dp + 1), *(sp + 1), a, - background->green); - png_composite(*(dp + 2), *(sp + 2), a, - background->blue); - } - } - } - } - else /* if (row_info->bit_depth == 16) */ - { -#if defined(PNG_READ_GAMMA_SUPPORTED) - if (gamma_16 != NULL && gamma_16_from_1 != NULL && - gamma_16_to_1 != NULL) - { - sp = row; - dp = row; - for (i = 0; i < row_width; i++, sp += 8, dp += 6) - { - png_uint_16 a = (png_uint_16)(((png_uint_16)(*(sp + 6)) - << 8) + (png_uint_16)(*(sp + 7))); - if (a == (png_uint_16)0xffff) - { - png_uint_16 v; - - v = gamma_16[*(sp + 1) >> gamma_shift][*sp]; - *dp = (png_byte)((v >> 8) & 0xff); - *(dp + 1) = (png_byte)(v & 0xff); - v = gamma_16[*(sp + 3) >> gamma_shift][*(sp + 2)]; - *(dp + 2) = (png_byte)((v >> 8) & 0xff); - *(dp + 3) = (png_byte)(v & 0xff); - v = gamma_16[*(sp + 5) >> gamma_shift][*(sp + 4)]; - *(dp + 4) = (png_byte)((v >> 8) & 0xff); - *(dp + 5) = (png_byte)(v & 0xff); - } - else if (a == 0) - { - /* background is already in screen gamma */ - *dp = (png_byte)((background->red >> 8) & 0xff); - *(dp + 1) = (png_byte)(background->red & 0xff); - *(dp + 2) = (png_byte)((background->green >> 8) & 0xff); - *(dp + 3) = (png_byte)(background->green & 0xff); - *(dp + 4) = (png_byte)((background->blue >> 8) & 0xff); - *(dp + 5) = (png_byte)(background->blue & 0xff); - } - else - { - png_uint_16 v, w, x; - - v = gamma_16_to_1[*(sp + 1) >> gamma_shift][*sp]; - png_composite_16(w, v, a, background_1->red); - x = gamma_16_from_1[((w&0xff) >> gamma_shift)][w >> 8]; - *dp = (png_byte)((x >> 8) & 0xff); - *(dp + 1) = (png_byte)(x & 0xff); - v = gamma_16_to_1[*(sp + 3) >> gamma_shift][*(sp + 2)]; - png_composite_16(w, v, a, background_1->green); - x = gamma_16_from_1[((w&0xff) >> gamma_shift)][w >> 8]; - *(dp + 2) = (png_byte)((x >> 8) & 0xff); - *(dp + 3) = (png_byte)(x & 0xff); - v = gamma_16_to_1[*(sp + 5) >> gamma_shift][*(sp + 4)]; - png_composite_16(w, v, a, background_1->blue); - x = gamma_16_from_1[(w & 0xff) >> gamma_shift][w >> 8]; - *(dp + 4) = (png_byte)((x >> 8) & 0xff); - *(dp + 5) = (png_byte)(x & 0xff); - } - } - } - else -#endif - { - sp = row; - dp = row; - for (i = 0; i < row_width; i++, sp += 8, dp += 6) - { - png_uint_16 a = (png_uint_16)(((png_uint_16)(*(sp + 6)) - << 8) + (png_uint_16)(*(sp + 7))); - if (a == (png_uint_16)0xffff) - { - png_memcpy(dp, sp, 6); - } - else if (a == 0) - { - *dp = (png_byte)((background->red >> 8) & 0xff); - *(dp + 1) = (png_byte)(background->red & 0xff); - *(dp + 2) = (png_byte)((background->green >> 8) & 0xff); - *(dp + 3) = (png_byte)(background->green & 0xff); - *(dp + 4) = (png_byte)((background->blue >> 8) & 0xff); - *(dp + 5) = (png_byte)(background->blue & 0xff); - } - else - { - png_uint_16 v; - - png_uint_16 r = (png_uint_16)(((*sp) << 8) + *(sp + 1)); - png_uint_16 g = (png_uint_16)(((*(sp + 2)) << 8) - + *(sp + 3)); - png_uint_16 b = (png_uint_16)(((*(sp + 4)) << 8) - + *(sp + 5)); - - png_composite_16(v, r, a, background->red); - *dp = (png_byte)((v >> 8) & 0xff); - *(dp + 1) = (png_byte)(v & 0xff); - png_composite_16(v, g, a, background->green); - *(dp + 2) = (png_byte)((v >> 8) & 0xff); - *(dp + 3) = (png_byte)(v & 0xff); - png_composite_16(v, b, a, background->blue); - *(dp + 4) = (png_byte)((v >> 8) & 0xff); - *(dp + 5) = (png_byte)(v & 0xff); - } - } - } - } - break; - } - } - - if (row_info->color_type & PNG_COLOR_MASK_ALPHA) - { - row_info->color_type &= ~PNG_COLOR_MASK_ALPHA; - row_info->channels--; - row_info->pixel_depth = (png_byte)(row_info->channels * - row_info->bit_depth); - row_info->rowbytes = PNG_ROWBYTES(row_info->pixel_depth,row_width); - } - } -} -#endif - -#if defined(PNG_READ_GAMMA_SUPPORTED) -/* Gamma correct the image, avoiding the alpha channel. Make sure - * you do this after you deal with the transparency issue on grayscale - * or RGB images. If your bit depth is 8, use gamma_table, if it - * is 16, use gamma_16_table and gamma_shift. Build these with - * build_gamma_table(). - */ -void /* PRIVATE */ -png_do_gamma(png_row_infop row_info, png_bytep row, - png_bytep gamma_table, png_uint_16pp gamma_16_table, - int gamma_shift) -{ - png_bytep sp; - png_uint_32 i; - png_uint_32 row_width=row_info->width; - - png_debug(1, "in png_do_gamma\n"); - if ( -#if defined(PNG_USELESS_TESTS_SUPPORTED) - row != NULL && row_info != NULL && -#endif - ((row_info->bit_depth <= 8 && gamma_table != NULL) || - (row_info->bit_depth == 16 && gamma_16_table != NULL))) - { - switch (row_info->color_type) - { - case PNG_COLOR_TYPE_RGB: - { - if (row_info->bit_depth == 8) - { - sp = row; - for (i = 0; i < row_width; i++) - { - *sp = gamma_table[*sp]; - sp++; - *sp = gamma_table[*sp]; - sp++; - *sp = gamma_table[*sp]; - sp++; - } - } - else /* if (row_info->bit_depth == 16) */ - { - sp = row; - for (i = 0; i < row_width; i++) - { - png_uint_16 v; - - v = gamma_16_table[*(sp + 1) >> gamma_shift][*sp]; - *sp = (png_byte)((v >> 8) & 0xff); - *(sp + 1) = (png_byte)(v & 0xff); - sp += 2; - v = gamma_16_table[*(sp + 1) >> gamma_shift][*sp]; - *sp = (png_byte)((v >> 8) & 0xff); - *(sp + 1) = (png_byte)(v & 0xff); - sp += 2; - v = gamma_16_table[*(sp + 1) >> gamma_shift][*sp]; - *sp = (png_byte)((v >> 8) & 0xff); - *(sp + 1) = (png_byte)(v & 0xff); - sp += 2; - } - } - break; - } - case PNG_COLOR_TYPE_RGB_ALPHA: - { - if (row_info->bit_depth == 8) - { - sp = row; - for (i = 0; i < row_width; i++) - { - *sp = gamma_table[*sp]; - sp++; - *sp = gamma_table[*sp]; - sp++; - *sp = gamma_table[*sp]; - sp++; - sp++; - } - } - else /* if (row_info->bit_depth == 16) */ - { - sp = row; - for (i = 0; i < row_width; i++) - { - png_uint_16 v = gamma_16_table[*(sp + 1) >> gamma_shift][*sp]; - *sp = (png_byte)((v >> 8) & 0xff); - *(sp + 1) = (png_byte)(v & 0xff); - sp += 2; - v = gamma_16_table[*(sp + 1) >> gamma_shift][*sp]; - *sp = (png_byte)((v >> 8) & 0xff); - *(sp + 1) = (png_byte)(v & 0xff); - sp += 2; - v = gamma_16_table[*(sp + 1) >> gamma_shift][*sp]; - *sp = (png_byte)((v >> 8) & 0xff); - *(sp + 1) = (png_byte)(v & 0xff); - sp += 4; - } - } - break; - } - case PNG_COLOR_TYPE_GRAY_ALPHA: - { - if (row_info->bit_depth == 8) - { - sp = row; - for (i = 0; i < row_width; i++) - { - *sp = gamma_table[*sp]; - sp += 2; - } - } - else /* if (row_info->bit_depth == 16) */ - { - sp = row; - for (i = 0; i < row_width; i++) - { - png_uint_16 v = gamma_16_table[*(sp + 1) >> gamma_shift][*sp]; - *sp = (png_byte)((v >> 8) & 0xff); - *(sp + 1) = (png_byte)(v & 0xff); - sp += 4; - } - } - break; - } - case PNG_COLOR_TYPE_GRAY: - { - if (row_info->bit_depth == 2) - { - sp = row; - for (i = 0; i < row_width; i += 4) - { - int a = *sp & 0xc0; - int b = *sp & 0x30; - int c = *sp & 0x0c; - int d = *sp & 0x03; - - *sp = (png_byte)( - ((((int)gamma_table[a|(a>>2)|(a>>4)|(a>>6)]) ) & 0xc0)| - ((((int)gamma_table[(b<<2)|b|(b>>2)|(b>>4)])>>2) & 0x30)| - ((((int)gamma_table[(c<<4)|(c<<2)|c|(c>>2)])>>4) & 0x0c)| - ((((int)gamma_table[(d<<6)|(d<<4)|(d<<2)|d])>>6) )); - sp++; - } - } - if (row_info->bit_depth == 4) - { - sp = row; - for (i = 0; i < row_width; i += 2) - { - int msb = *sp & 0xf0; - int lsb = *sp & 0x0f; - - *sp = (png_byte)((((int)gamma_table[msb | (msb >> 4)]) & 0xf0) - | (((int)gamma_table[(lsb << 4) | lsb]) >> 4)); - sp++; - } - } - else if (row_info->bit_depth == 8) - { - sp = row; - for (i = 0; i < row_width; i++) - { - *sp = gamma_table[*sp]; - sp++; - } - } - else if (row_info->bit_depth == 16) - { - sp = row; - for (i = 0; i < row_width; i++) - { - png_uint_16 v = gamma_16_table[*(sp + 1) >> gamma_shift][*sp]; - *sp = (png_byte)((v >> 8) & 0xff); - *(sp + 1) = (png_byte)(v & 0xff); - sp += 2; - } - } - break; - } - } - } -} -#endif - -#if defined(PNG_READ_EXPAND_SUPPORTED) -/* Expands a palette row to an RGB or RGBA row depending - * upon whether you supply trans and num_trans. - */ -void /* PRIVATE */ -png_do_expand_palette(png_row_infop row_info, png_bytep row, - png_colorp palette, png_bytep trans, int num_trans) -{ - int shift, value; - png_bytep sp, dp; - png_uint_32 i; - png_uint_32 row_width=row_info->width; - - png_debug(1, "in png_do_expand_palette\n"); - if ( -#if defined(PNG_USELESS_TESTS_SUPPORTED) - row != NULL && row_info != NULL && -#endif - row_info->color_type == PNG_COLOR_TYPE_PALETTE) - { - if (row_info->bit_depth < 8) - { - switch (row_info->bit_depth) - { - case 1: - { - sp = row + (png_size_t)((row_width - 1) >> 3); - dp = row + (png_size_t)row_width - 1; - shift = 7 - (int)((row_width + 7) & 0x07); - for (i = 0; i < row_width; i++) - { - if ((*sp >> shift) & 0x01) - *dp = 1; - else - *dp = 0; - if (shift == 7) - { - shift = 0; - sp--; - } - else - shift++; - - dp--; - } - break; - } - case 2: - { - sp = row + (png_size_t)((row_width - 1) >> 2); - dp = row + (png_size_t)row_width - 1; - shift = (int)((3 - ((row_width + 3) & 0x03)) << 1); - for (i = 0; i < row_width; i++) - { - value = (*sp >> shift) & 0x03; - *dp = (png_byte)value; - if (shift == 6) - { - shift = 0; - sp--; - } - else - shift += 2; - - dp--; - } - break; - } - case 4: - { - sp = row + (png_size_t)((row_width - 1) >> 1); - dp = row + (png_size_t)row_width - 1; - shift = (int)((row_width & 0x01) << 2); - for (i = 0; i < row_width; i++) - { - value = (*sp >> shift) & 0x0f; - *dp = (png_byte)value; - if (shift == 4) - { - shift = 0; - sp--; - } - else - shift += 4; - - dp--; - } - break; - } - } - row_info->bit_depth = 8; - row_info->pixel_depth = 8; - row_info->rowbytes = row_width; - } - switch (row_info->bit_depth) - { - case 8: - { - if (trans != NULL) - { - sp = row + (png_size_t)row_width - 1; - dp = row + (png_size_t)(row_width << 2) - 1; - - for (i = 0; i < row_width; i++) - { - if ((int)(*sp) >= num_trans) - *dp-- = 0xff; - else - *dp-- = trans[*sp]; - *dp-- = palette[*sp].blue; - *dp-- = palette[*sp].green; - *dp-- = palette[*sp].red; - sp--; - } - row_info->bit_depth = 8; - row_info->pixel_depth = 32; - row_info->rowbytes = row_width * 4; - row_info->color_type = 6; - row_info->channels = 4; - } - else - { - sp = row + (png_size_t)row_width - 1; - dp = row + (png_size_t)(row_width * 3) - 1; - - for (i = 0; i < row_width; i++) - { - *dp-- = palette[*sp].blue; - *dp-- = palette[*sp].green; - *dp-- = palette[*sp].red; - sp--; - } - row_info->bit_depth = 8; - row_info->pixel_depth = 24; - row_info->rowbytes = row_width * 3; - row_info->color_type = 2; - row_info->channels = 3; - } - break; - } - } - } -} - -/* If the bit depth < 8, it is expanded to 8. Also, if the - * transparency value is supplied, an alpha channel is built. - */ -void /* PRIVATE */ -png_do_expand(png_row_infop row_info, png_bytep row, - png_color_16p trans_value) -{ - int shift, value; - png_bytep sp, dp; - png_uint_32 i; - png_uint_32 row_width=row_info->width; - - png_debug(1, "in png_do_expand\n"); -#if defined(PNG_USELESS_TESTS_SUPPORTED) - if (row != NULL && row_info != NULL) -#endif - { - if (row_info->color_type == PNG_COLOR_TYPE_GRAY) - { - png_uint_16 gray = (png_uint_16)(trans_value ? trans_value->gray : 0); - - if (row_info->bit_depth < 8) - { - switch (row_info->bit_depth) - { - case 1: - { - gray = (png_uint_16)(gray*0xff); - sp = row + (png_size_t)((row_width - 1) >> 3); - dp = row + (png_size_t)row_width - 1; - shift = 7 - (int)((row_width + 7) & 0x07); - for (i = 0; i < row_width; i++) - { - if ((*sp >> shift) & 0x01) - *dp = 0xff; - else - *dp = 0; - if (shift == 7) - { - shift = 0; - sp--; - } - else - shift++; - - dp--; - } - break; - } - case 2: - { - gray = (png_uint_16)(gray*0x55); - sp = row + (png_size_t)((row_width - 1) >> 2); - dp = row + (png_size_t)row_width - 1; - shift = (int)((3 - ((row_width + 3) & 0x03)) << 1); - for (i = 0; i < row_width; i++) - { - value = (*sp >> shift) & 0x03; - *dp = (png_byte)(value | (value << 2) | (value << 4) | - (value << 6)); - if (shift == 6) - { - shift = 0; - sp--; - } - else - shift += 2; - - dp--; - } - break; - } - case 4: - { - gray = (png_uint_16)(gray*0x11); - sp = row + (png_size_t)((row_width - 1) >> 1); - dp = row + (png_size_t)row_width - 1; - shift = (int)((1 - ((row_width + 1) & 0x01)) << 2); - for (i = 0; i < row_width; i++) - { - value = (*sp >> shift) & 0x0f; - *dp = (png_byte)(value | (value << 4)); - if (shift == 4) - { - shift = 0; - sp--; - } - else - shift = 4; - - dp--; - } - break; - } - } - row_info->bit_depth = 8; - row_info->pixel_depth = 8; - row_info->rowbytes = row_width; - } - - if (trans_value != NULL) - { - if (row_info->bit_depth == 8) - { - sp = row + (png_size_t)row_width - 1; - dp = row + (png_size_t)(row_width << 1) - 1; - for (i = 0; i < row_width; i++) - { - if (*sp == gray) - *dp-- = 0; - else - *dp-- = 0xff; - *dp-- = *sp--; - } - } - else if (row_info->bit_depth == 16) - { - sp = row + row_info->rowbytes - 1; - dp = row + (row_info->rowbytes << 1) - 1; - for (i = 0; i < row_width; i++) - { - if (((png_uint_16)*(sp) | - ((png_uint_16)*(sp - 1) << 8)) == gray) - { - *dp-- = 0; - *dp-- = 0; - } - else - { - *dp-- = 0xff; - *dp-- = 0xff; - } - *dp-- = *sp--; - *dp-- = *sp--; - } - } - row_info->color_type = PNG_COLOR_TYPE_GRAY_ALPHA; - row_info->channels = 2; - row_info->pixel_depth = (png_byte)(row_info->bit_depth << 1); - row_info->rowbytes = PNG_ROWBYTES(row_info->pixel_depth, - row_width); - } - } - else if (row_info->color_type == PNG_COLOR_TYPE_RGB && trans_value) - { - if (row_info->bit_depth == 8) - { - sp = row + (png_size_t)row_info->rowbytes - 1; - dp = row + (png_size_t)(row_width << 2) - 1; - for (i = 0; i < row_width; i++) - { - if (*(sp - 2) == trans_value->red && - *(sp - 1) == trans_value->green && - *(sp - 0) == trans_value->blue) - *dp-- = 0; - else - *dp-- = 0xff; - *dp-- = *sp--; - *dp-- = *sp--; - *dp-- = *sp--; - } - } - else if (row_info->bit_depth == 16) - { - sp = row + row_info->rowbytes - 1; - dp = row + (png_size_t)(row_width << 3) - 1; - for (i = 0; i < row_width; i++) - { - if ((((png_uint_16)*(sp - 4) | - ((png_uint_16)*(sp - 5) << 8)) == trans_value->red) && - (((png_uint_16)*(sp - 2) | - ((png_uint_16)*(sp - 3) << 8)) == trans_value->green) && - (((png_uint_16)*(sp - 0) | - ((png_uint_16)*(sp - 1) << 8)) == trans_value->blue)) - { - *dp-- = 0; - *dp-- = 0; - } - else - { - *dp-- = 0xff; - *dp-- = 0xff; - } - *dp-- = *sp--; - *dp-- = *sp--; - *dp-- = *sp--; - *dp-- = *sp--; - *dp-- = *sp--; - *dp-- = *sp--; - } - } - row_info->color_type = PNG_COLOR_TYPE_RGB_ALPHA; - row_info->channels = 4; - row_info->pixel_depth = (png_byte)(row_info->bit_depth << 2); - row_info->rowbytes = PNG_ROWBYTES(row_info->pixel_depth,row_width); - } - } -} -#endif - -#if defined(PNG_READ_DITHER_SUPPORTED) -void /* PRIVATE */ -png_do_dither(png_row_infop row_info, png_bytep row, - png_bytep palette_lookup, png_bytep dither_lookup) -{ - png_bytep sp, dp; - png_uint_32 i; - png_uint_32 row_width=row_info->width; - - png_debug(1, "in png_do_dither\n"); -#if defined(PNG_USELESS_TESTS_SUPPORTED) - if (row != NULL && row_info != NULL) -#endif - { - if (row_info->color_type == PNG_COLOR_TYPE_RGB && - palette_lookup && row_info->bit_depth == 8) - { - int r, g, b, p; - sp = row; - dp = row; - for (i = 0; i < row_width; i++) - { - r = *sp++; - g = *sp++; - b = *sp++; - - /* this looks real messy, but the compiler will reduce - it down to a reasonable formula. For example, with - 5 bits per color, we get: - p = (((r >> 3) & 0x1f) << 10) | - (((g >> 3) & 0x1f) << 5) | - ((b >> 3) & 0x1f); - */ - p = (((r >> (8 - PNG_DITHER_RED_BITS)) & - ((1 << PNG_DITHER_RED_BITS) - 1)) << - (PNG_DITHER_GREEN_BITS + PNG_DITHER_BLUE_BITS)) | - (((g >> (8 - PNG_DITHER_GREEN_BITS)) & - ((1 << PNG_DITHER_GREEN_BITS) - 1)) << - (PNG_DITHER_BLUE_BITS)) | - ((b >> (8 - PNG_DITHER_BLUE_BITS)) & - ((1 << PNG_DITHER_BLUE_BITS) - 1)); - - *dp++ = palette_lookup[p]; - } - row_info->color_type = PNG_COLOR_TYPE_PALETTE; - row_info->channels = 1; - row_info->pixel_depth = row_info->bit_depth; - row_info->rowbytes = PNG_ROWBYTES(row_info->pixel_depth,row_width); - } - else if (row_info->color_type == PNG_COLOR_TYPE_RGB_ALPHA && - palette_lookup != NULL && row_info->bit_depth == 8) - { - int r, g, b, p; - sp = row; - dp = row; - for (i = 0; i < row_width; i++) - { - r = *sp++; - g = *sp++; - b = *sp++; - sp++; - - p = (((r >> (8 - PNG_DITHER_RED_BITS)) & - ((1 << PNG_DITHER_RED_BITS) - 1)) << - (PNG_DITHER_GREEN_BITS + PNG_DITHER_BLUE_BITS)) | - (((g >> (8 - PNG_DITHER_GREEN_BITS)) & - ((1 << PNG_DITHER_GREEN_BITS) - 1)) << - (PNG_DITHER_BLUE_BITS)) | - ((b >> (8 - PNG_DITHER_BLUE_BITS)) & - ((1 << PNG_DITHER_BLUE_BITS) - 1)); - - *dp++ = palette_lookup[p]; - } - row_info->color_type = PNG_COLOR_TYPE_PALETTE; - row_info->channels = 1; - row_info->pixel_depth = row_info->bit_depth; - row_info->rowbytes = PNG_ROWBYTES(row_info->pixel_depth,row_width); - } - else if (row_info->color_type == PNG_COLOR_TYPE_PALETTE && - dither_lookup && row_info->bit_depth == 8) - { - sp = row; - for (i = 0; i < row_width; i++, sp++) - { - *sp = dither_lookup[*sp]; - } - } - } -} -#endif - -#ifdef PNG_FLOATING_POINT_SUPPORTED -#if defined(PNG_READ_GAMMA_SUPPORTED) -static int png_gamma_shift[] = - {0x10, 0x21, 0x42, 0x84, 0x110, 0x248, 0x550, 0xff0}; - -/* We build the 8- or 16-bit gamma tables here. Note that for 16-bit - * tables, we don't make a full table if we are reducing to 8-bit in - * the future. Note also how the gamma_16 tables are segmented so that - * we don't need to allocate > 64K chunks for a full 16-bit table. - */ -void /* PRIVATE */ -png_build_gamma_table(png_structp png_ptr) -{ - png_debug(1, "in png_build_gamma_table\n"); - if(png_ptr->gamma != 0.0) - { - if (png_ptr->bit_depth <= 8) - { - int i; - double g; - - if (png_ptr->screen_gamma > .000001) - g = 1.0 / (png_ptr->gamma * png_ptr->screen_gamma); - else - g = 1.0; - - png_ptr->gamma_table = (png_bytep)png_malloc(png_ptr, - (png_uint_32)256); - - for (i = 0; i < 256; i++) - { - png_ptr->gamma_table[i] = (png_byte)(pow((double)i / 255.0, - g) * 255.0 + .5); - } - -#if defined(PNG_READ_BACKGROUND_SUPPORTED) || \ - defined(PNG_READ_RGB_TO_GRAY_SUPPORTED) - if (png_ptr->transformations & ((PNG_BACKGROUND) | PNG_RGB_TO_GRAY)) - { - - g = 1.0 / (png_ptr->gamma); - - png_ptr->gamma_to_1 = (png_bytep)png_malloc(png_ptr, - (png_uint_32)256); - - for (i = 0; i < 256; i++) - { - png_ptr->gamma_to_1[i] = (png_byte)(pow((double)i / 255.0, - g) * 255.0 + .5); - } - - - png_ptr->gamma_from_1 = (png_bytep)png_malloc(png_ptr, - (png_uint_32)256); - - if(png_ptr->screen_gamma > 0.000001) - g = 1.0 / png_ptr->screen_gamma; - else - g = png_ptr->gamma; /* probably doing rgb_to_gray */ - - for (i = 0; i < 256; i++) - { - png_ptr->gamma_from_1[i] = (png_byte)(pow((double)i / 255.0, - g) * 255.0 + .5); - - } - } -#endif /* PNG_READ_BACKGROUND_SUPPORTED || PNG_RGB_TO_GRAY_SUPPORTED */ - } - else - { - double g; - int i, j, shift, num; - int sig_bit; - png_uint_32 ig; - - if (png_ptr->color_type & PNG_COLOR_MASK_COLOR) - { - sig_bit = (int)png_ptr->sig_bit.red; - if ((int)png_ptr->sig_bit.green > sig_bit) - sig_bit = png_ptr->sig_bit.green; - if ((int)png_ptr->sig_bit.blue > sig_bit) - sig_bit = png_ptr->sig_bit.blue; - } - else - { - sig_bit = (int)png_ptr->sig_bit.gray; - } - - if (sig_bit > 0) - shift = 16 - sig_bit; - else - shift = 0; - - if (png_ptr->transformations & PNG_16_TO_8) - { - if (shift < (16 - PNG_MAX_GAMMA_8)) - shift = (16 - PNG_MAX_GAMMA_8); - } - - if (shift > 8) - shift = 8; - if (shift < 0) - shift = 0; - - png_ptr->gamma_shift = (png_byte)shift; - - num = (1 << (8 - shift)); - - if (png_ptr->screen_gamma > .000001) - g = 1.0 / (png_ptr->gamma * png_ptr->screen_gamma); - else - g = 1.0; - - png_ptr->gamma_16_table = (png_uint_16pp)png_malloc(png_ptr, - (png_uint_32)(num * png_sizeof (png_uint_16p))); - - if (png_ptr->transformations & (PNG_16_TO_8 | PNG_BACKGROUND)) - { - double fin, fout; - png_uint_32 last, max; - - for (i = 0; i < num; i++) - { - png_ptr->gamma_16_table[i] = (png_uint_16p)png_malloc(png_ptr, - (png_uint_32)(256 * png_sizeof (png_uint_16))); - } - - g = 1.0 / g; - last = 0; - for (i = 0; i < 256; i++) - { - fout = ((double)i + 0.5) / 256.0; - fin = pow(fout, g); - max = (png_uint_32)(fin * (double)((png_uint_32)num << 8)); - while (last <= max) - { - png_ptr->gamma_16_table[(int)(last & (0xff >> shift))] - [(int)(last >> (8 - shift))] = (png_uint_16)( - (png_uint_16)i | ((png_uint_16)i << 8)); - last++; - } - } - while (last < ((png_uint_32)num << 8)) - { - png_ptr->gamma_16_table[(int)(last & (0xff >> shift))] - [(int)(last >> (8 - shift))] = (png_uint_16)65535L; - last++; - } - } - else - { - for (i = 0; i < num; i++) - { - png_ptr->gamma_16_table[i] = (png_uint_16p)png_malloc(png_ptr, - (png_uint_32)(256 * png_sizeof (png_uint_16))); - - ig = (((png_uint_32)i * (png_uint_32)png_gamma_shift[shift]) >> 4); - for (j = 0; j < 256; j++) - { - png_ptr->gamma_16_table[i][j] = - (png_uint_16)(pow((double)(ig + ((png_uint_32)j << 8)) / - 65535.0, g) * 65535.0 + .5); - } - } - } - -#if defined(PNG_READ_BACKGROUND_SUPPORTED) || \ - defined(PNG_READ_RGB_TO_GRAY_SUPPORTED) - if (png_ptr->transformations & (PNG_BACKGROUND | PNG_RGB_TO_GRAY)) - { - - g = 1.0 / (png_ptr->gamma); - - png_ptr->gamma_16_to_1 = (png_uint_16pp)png_malloc(png_ptr, - (png_uint_32)(num * png_sizeof (png_uint_16p ))); - - for (i = 0; i < num; i++) - { - png_ptr->gamma_16_to_1[i] = (png_uint_16p)png_malloc(png_ptr, - (png_uint_32)(256 * png_sizeof (png_uint_16))); - - ig = (((png_uint_32)i * - (png_uint_32)png_gamma_shift[shift]) >> 4); - for (j = 0; j < 256; j++) - { - png_ptr->gamma_16_to_1[i][j] = - (png_uint_16)(pow((double)(ig + ((png_uint_32)j << 8)) / - 65535.0, g) * 65535.0 + .5); - } - } - - if(png_ptr->screen_gamma > 0.000001) - g = 1.0 / png_ptr->screen_gamma; - else - g = png_ptr->gamma; /* probably doing rgb_to_gray */ - - png_ptr->gamma_16_from_1 = (png_uint_16pp)png_malloc(png_ptr, - (png_uint_32)(num * png_sizeof (png_uint_16p))); - - for (i = 0; i < num; i++) - { - png_ptr->gamma_16_from_1[i] = (png_uint_16p)png_malloc(png_ptr, - (png_uint_32)(256 * png_sizeof (png_uint_16))); - - ig = (((png_uint_32)i * - (png_uint_32)png_gamma_shift[shift]) >> 4); - for (j = 0; j < 256; j++) - { - png_ptr->gamma_16_from_1[i][j] = - (png_uint_16)(pow((double)(ig + ((png_uint_32)j << 8)) / - 65535.0, g) * 65535.0 + .5); - } - } - } -#endif /* PNG_READ_BACKGROUND_SUPPORTED || PNG_RGB_TO_GRAY_SUPPORTED */ - } - } -} -#endif -/* To do: install integer version of png_build_gamma_table here */ -#endif - -#if defined(PNG_MNG_FEATURES_SUPPORTED) -/* undoes intrapixel differencing */ -void /* PRIVATE */ -png_do_read_intrapixel(png_row_infop row_info, png_bytep row) -{ - png_debug(1, "in png_do_read_intrapixel\n"); - if ( -#if defined(PNG_USELESS_TESTS_SUPPORTED) - row != NULL && row_info != NULL && -#endif - (row_info->color_type & PNG_COLOR_MASK_COLOR)) - { - int bytes_per_pixel; - png_uint_32 row_width = row_info->width; - if (row_info->bit_depth == 8) - { - png_bytep rp; - png_uint_32 i; - - if (row_info->color_type == PNG_COLOR_TYPE_RGB) - bytes_per_pixel = 3; - else if (row_info->color_type == PNG_COLOR_TYPE_RGB_ALPHA) - bytes_per_pixel = 4; - else - return; - - for (i = 0, rp = row; i < row_width; i++, rp += bytes_per_pixel) - { - *(rp) = (png_byte)((256 + *rp + *(rp+1))&0xff); - *(rp+2) = (png_byte)((256 + *(rp+2) + *(rp+1))&0xff); - } - } - else if (row_info->bit_depth == 16) - { - png_bytep rp; - png_uint_32 i; - - if (row_info->color_type == PNG_COLOR_TYPE_RGB) - bytes_per_pixel = 6; - else if (row_info->color_type == PNG_COLOR_TYPE_RGB_ALPHA) - bytes_per_pixel = 8; - else - return; - - for (i = 0, rp = row; i < row_width; i++, rp += bytes_per_pixel) - { - png_uint_32 s0 = (*(rp ) << 8) | *(rp+1); - png_uint_32 s1 = (*(rp+2) << 8) | *(rp+3); - png_uint_32 s2 = (*(rp+4) << 8) | *(rp+5); - png_uint_32 red = (png_uint_32)((s0+s1+65536L) & 0xffffL); - png_uint_32 blue = (png_uint_32)((s2+s1+65536L) & 0xffffL); - *(rp ) = (png_byte)((red >> 8) & 0xff); - *(rp+1) = (png_byte)(red & 0xff); - *(rp+4) = (png_byte)((blue >> 8) & 0xff); - *(rp+5) = (png_byte)(blue & 0xff); - } - } - } -} -#endif /* PNG_MNG_FEATURES_SUPPORTED */ diff --git a/wxWidgets/src/png/pngrutil.c b/wxWidgets/src/png/pngrutil.c deleted file mode 100644 index b61664aa6c..0000000000 --- a/wxWidgets/src/png/pngrutil.c +++ /dev/null @@ -1,3124 +0,0 @@ -/* pngrutil.c - utilities to read a PNG file - * - * libpng version 1.2.7 - September 12, 2004 - * For conditions of distribution and use, see copyright notice in png.h - * Copyright (c) 1998-2004 Glenn Randers-Pehrson - * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) - * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) - * - * This file contains routines that are only called from within - * libpng itself during the course of reading an image. - */ - -#define PNG_INTERNAL -#include "png.h" - -#if defined(_WIN32_WCE) -/* strtod() function is not supported on WindowsCE */ -# ifdef PNG_FLOATING_POINT_SUPPORTED -__inline double strtod(const char *nptr, char **endptr) -{ - double result = 0; - int len; - wchar_t *str, *end; - - len = MultiByteToWideChar(CP_ACP, 0, nptr, -1, NULL, 0); - str = (wchar_t *)malloc(len * sizeof(wchar_t)); - if ( NULL != str ) - { - MultiByteToWideChar(CP_ACP, 0, nptr, -1, str, len); - result = wcstod(str, &end); - len = WideCharToMultiByte(CP_ACP, 0, end, -1, NULL, 0, NULL, NULL); - *endptr = (char *)nptr + (png_strlen(nptr) - len + 1); - free(str); - } - return result; -} -# endif -#endif - -png_uint_32 /* PRIVATE */ -png_get_uint_31(png_structp png_ptr, png_bytep buf) -{ - png_uint_32 i = png_get_uint_32(buf); - if (i > PNG_UINT_31_MAX) - png_error(png_ptr, "PNG unsigned integer out of range.\n"); - return (i); -} -#ifndef PNG_READ_BIG_ENDIAN_SUPPORTED -/* Grab an unsigned 32-bit integer from a buffer in big-endian format. */ -png_uint_32 /* PRIVATE */ -png_get_uint_32(png_bytep buf) -{ - png_uint_32 i = ((png_uint_32)(*buf) << 24) + - ((png_uint_32)(*(buf + 1)) << 16) + - ((png_uint_32)(*(buf + 2)) << 8) + - (png_uint_32)(*(buf + 3)); - - return (i); -} - -#if defined(PNG_READ_pCAL_SUPPORTED) || defined(PNG_READ_oFFs_SUPPORTED) -/* Grab a signed 32-bit integer from a buffer in big-endian format. The - * data is stored in the PNG file in two's complement format, and it is - * assumed that the machine format for signed integers is the same. */ -png_int_32 /* PRIVATE */ -png_get_int_32(png_bytep buf) -{ - png_int_32 i = ((png_int_32)(*buf) << 24) + - ((png_int_32)(*(buf + 1)) << 16) + - ((png_int_32)(*(buf + 2)) << 8) + - (png_int_32)(*(buf + 3)); - - return (i); -} -#endif /* PNG_READ_pCAL_SUPPORTED */ - -/* Grab an unsigned 16-bit integer from a buffer in big-endian format. */ -png_uint_16 /* PRIVATE */ -png_get_uint_16(png_bytep buf) -{ - png_uint_16 i = (png_uint_16)(((png_uint_16)(*buf) << 8) + - (png_uint_16)(*(buf + 1))); - - return (i); -} -#endif /* PNG_READ_BIG_ENDIAN_SUPPORTED */ - -/* Read data, and (optionally) run it through the CRC. */ -void /* PRIVATE */ -png_crc_read(png_structp png_ptr, png_bytep buf, png_size_t length) -{ - png_read_data(png_ptr, buf, length); - png_calculate_crc(png_ptr, buf, length); -} - -/* Optionally skip data and then check the CRC. Depending on whether we - are reading a ancillary or critical chunk, and how the program has set - things up, we may calculate the CRC on the data and print a message. - Returns '1' if there was a CRC error, '0' otherwise. */ -int /* PRIVATE */ -png_crc_finish(png_structp png_ptr, png_uint_32 skip) -{ - png_size_t i; - png_size_t istop = png_ptr->zbuf_size; - - for (i = (png_size_t)skip; i > istop; i -= istop) - { - png_crc_read(png_ptr, png_ptr->zbuf, png_ptr->zbuf_size); - } - if (i) - { - png_crc_read(png_ptr, png_ptr->zbuf, i); - } - - if (png_crc_error(png_ptr)) - { - if (((png_ptr->chunk_name[0] & 0x20) && /* Ancillary */ - !(png_ptr->flags & PNG_FLAG_CRC_ANCILLARY_NOWARN)) || - (!(png_ptr->chunk_name[0] & 0x20) && /* Critical */ - (png_ptr->flags & PNG_FLAG_CRC_CRITICAL_USE))) - { - png_chunk_warning(png_ptr, "CRC error"); - } - else - { - png_chunk_error(png_ptr, "CRC error"); - } - return (1); - } - - return (0); -} - -/* Compare the CRC stored in the PNG file with that calculated by libpng from - the data it has read thus far. */ -int /* PRIVATE */ -png_crc_error(png_structp png_ptr) -{ - png_byte crc_bytes[4]; - png_uint_32 crc; - int need_crc = 1; - - if (png_ptr->chunk_name[0] & 0x20) /* ancillary */ - { - if ((png_ptr->flags & PNG_FLAG_CRC_ANCILLARY_MASK) == - (PNG_FLAG_CRC_ANCILLARY_USE | PNG_FLAG_CRC_ANCILLARY_NOWARN)) - need_crc = 0; - } - else /* critical */ - { - if (png_ptr->flags & PNG_FLAG_CRC_CRITICAL_IGNORE) - need_crc = 0; - } - - png_read_data(png_ptr, crc_bytes, 4); - - if (need_crc) - { - crc = png_get_uint_32(crc_bytes); - return ((int)(crc != png_ptr->crc)); - } - else - return (0); -} - -#if defined(PNG_READ_zTXt_SUPPORTED) || defined(PNG_READ_iTXt_SUPPORTED) || \ - defined(PNG_READ_iCCP_SUPPORTED) -/* - * Decompress trailing data in a chunk. The assumption is that chunkdata - * points at an allocated area holding the contents of a chunk with a - * trailing compressed part. What we get back is an allocated area - * holding the original prefix part and an uncompressed version of the - * trailing part (the malloc area passed in is freed). - */ -png_charp /* PRIVATE */ -png_decompress_chunk(png_structp png_ptr, int comp_type, - png_charp chunkdata, png_size_t chunklength, - png_size_t prefix_size, png_size_t *newlength) -{ - static char msg[] = "Error decoding compressed text"; - png_charp text; - png_size_t text_size; - - if (comp_type == PNG_COMPRESSION_TYPE_BASE) - { - int ret = Z_OK; - png_ptr->zstream.next_in = (png_bytep)(chunkdata + prefix_size); - png_ptr->zstream.avail_in = (uInt)(chunklength - prefix_size); - png_ptr->zstream.next_out = png_ptr->zbuf; - png_ptr->zstream.avail_out = (uInt)png_ptr->zbuf_size; - - text_size = 0; - text = NULL; - - while (png_ptr->zstream.avail_in) - { - ret = inflate(&png_ptr->zstream, Z_PARTIAL_FLUSH); - if (ret != Z_OK && ret != Z_STREAM_END) - { - if (png_ptr->zstream.msg != NULL) - png_warning(png_ptr, png_ptr->zstream.msg); - else - png_warning(png_ptr, msg); - inflateReset(&png_ptr->zstream); - png_ptr->zstream.avail_in = 0; - - if (text == NULL) - { - text_size = prefix_size + png_sizeof(msg) + 1; - text = (png_charp)png_malloc_warn(png_ptr, text_size); - if (text == NULL) - { - png_free(png_ptr,chunkdata); - png_error(png_ptr,"Not enough memory to decompress chunk"); - } - png_memcpy(text, chunkdata, prefix_size); - } - - text[text_size - 1] = 0x00; - - /* Copy what we can of the error message into the text chunk */ - text_size = (png_size_t)(chunklength - (text - chunkdata) - 1); - text_size = png_sizeof(msg) > text_size ? text_size : - png_sizeof(msg); - png_memcpy(text + prefix_size, msg, text_size + 1); - break; - } - if (!png_ptr->zstream.avail_out || ret == Z_STREAM_END) - { - if (text == NULL) - { - text_size = prefix_size + - png_ptr->zbuf_size - png_ptr->zstream.avail_out; - text = (png_charp)png_malloc_warn(png_ptr, text_size + 1); - if (text == NULL) - { - png_free(png_ptr,chunkdata); - png_error(png_ptr,"Not enough memory to decompress chunk."); - } - png_memcpy(text + prefix_size, png_ptr->zbuf, - text_size - prefix_size); - png_memcpy(text, chunkdata, prefix_size); - *(text + text_size) = 0x00; - } - else - { - png_charp tmp; - - tmp = text; - text = (png_charp)png_malloc_warn(png_ptr, - (png_uint_32)(text_size + - png_ptr->zbuf_size - png_ptr->zstream.avail_out + 1)); - if (text == NULL) - { - png_free(png_ptr, tmp); - png_free(png_ptr, chunkdata); - png_error(png_ptr,"Not enough memory to decompress chunk.."); - } - png_memcpy(text, tmp, text_size); - png_free(png_ptr, tmp); - png_memcpy(text + text_size, png_ptr->zbuf, - (png_ptr->zbuf_size - png_ptr->zstream.avail_out)); - text_size += png_ptr->zbuf_size - png_ptr->zstream.avail_out; - *(text + text_size) = 0x00; - } - if (ret == Z_STREAM_END) - break; - else - { - png_ptr->zstream.next_out = png_ptr->zbuf; - png_ptr->zstream.avail_out = (uInt)png_ptr->zbuf_size; - } - } - } - if (ret != Z_STREAM_END) - { -#if !defined(PNG_NO_STDIO) && !defined(_WIN32_WCE) - char umsg[50]; - - if (ret == Z_BUF_ERROR) - sprintf(umsg,"Buffer error in compressed datastream in %s chunk", - (char *)png_ptr->chunk_name); - else if (ret == Z_DATA_ERROR) - sprintf(umsg,"Data error in compressed datastream in %s chunk", - (char *)png_ptr->chunk_name); - else - sprintf(umsg,"Incomplete compressed datastream in %s chunk", - (char *)png_ptr->chunk_name); - png_warning(png_ptr, umsg); -#else - png_warning(png_ptr, - "Incomplete compressed datastream in chunk other than IDAT"); -#endif - text_size=prefix_size; - if (text == NULL) - { - text = (png_charp)png_malloc_warn(png_ptr, text_size+1); - if (text == NULL) - { - png_free(png_ptr, chunkdata); - png_error(png_ptr,"Not enough memory for text."); - } - png_memcpy(text, chunkdata, prefix_size); - } - *(text + text_size) = 0x00; - } - - inflateReset(&png_ptr->zstream); - png_ptr->zstream.avail_in = 0; - - png_free(png_ptr, chunkdata); - chunkdata = text; - *newlength=text_size; - } - else /* if (comp_type != PNG_COMPRESSION_TYPE_BASE) */ - { -#if !defined(PNG_NO_STDIO) && !defined(_WIN32_WCE) - char umsg[50]; - - sprintf(umsg, "Unknown zTXt compression type %d", comp_type); - png_warning(png_ptr, umsg); -#else - png_warning(png_ptr, "Unknown zTXt compression type"); -#endif - - *(chunkdata + prefix_size) = 0x00; - *newlength=prefix_size; - } - - return chunkdata; -} -#endif - -/* read and check the IDHR chunk */ -void /* PRIVATE */ -png_handle_IHDR(png_structp png_ptr, png_infop info_ptr, png_uint_32 length) -{ - png_byte buf[13]; - png_uint_32 width, height; - int bit_depth, color_type, compression_type, filter_type; - int interlace_type; - - png_debug(1, "in png_handle_IHDR\n"); - - if (png_ptr->mode & PNG_HAVE_IHDR) - png_error(png_ptr, "Out of place IHDR"); - - /* check the length */ - if (length != 13) - png_error(png_ptr, "Invalid IHDR chunk"); - - png_ptr->mode |= PNG_HAVE_IHDR; - - png_crc_read(png_ptr, buf, 13); - png_crc_finish(png_ptr, 0); - - width = png_get_uint_31(png_ptr, buf); - height = png_get_uint_31(png_ptr, buf + 4); - bit_depth = buf[8]; - color_type = buf[9]; - compression_type = buf[10]; - filter_type = buf[11]; - interlace_type = buf[12]; - - /* set internal variables */ - png_ptr->width = width; - png_ptr->height = height; - png_ptr->bit_depth = (png_byte)bit_depth; - png_ptr->interlaced = (png_byte)interlace_type; - png_ptr->color_type = (png_byte)color_type; -#if defined(PNG_MNG_FEATURES_SUPPORTED) - png_ptr->filter_type = (png_byte)filter_type; -#endif - png_ptr->compression_type = (png_byte)compression_type; - - /* find number of channels */ - switch (png_ptr->color_type) - { - case PNG_COLOR_TYPE_GRAY: - case PNG_COLOR_TYPE_PALETTE: - png_ptr->channels = 1; - break; - case PNG_COLOR_TYPE_RGB: - png_ptr->channels = 3; - break; - case PNG_COLOR_TYPE_GRAY_ALPHA: - png_ptr->channels = 2; - break; - case PNG_COLOR_TYPE_RGB_ALPHA: - png_ptr->channels = 4; - break; - } - - /* set up other useful info */ - png_ptr->pixel_depth = (png_byte)(png_ptr->bit_depth * - png_ptr->channels); - png_ptr->rowbytes = PNG_ROWBYTES(png_ptr->pixel_depth,png_ptr->width); - png_debug1(3,"bit_depth = %d\n", png_ptr->bit_depth); - png_debug1(3,"channels = %d\n", png_ptr->channels); - png_debug1(3,"rowbytes = %lu\n", png_ptr->rowbytes); - png_set_IHDR(png_ptr, info_ptr, width, height, bit_depth, - color_type, interlace_type, compression_type, filter_type); -} - -/* read and check the palette */ -void /* PRIVATE */ -png_handle_PLTE(png_structp png_ptr, png_infop info_ptr, png_uint_32 length) -{ - png_color palette[PNG_MAX_PALETTE_LENGTH]; - int num, i; -#ifndef PNG_NO_POINTER_INDEXING - png_colorp pal_ptr; -#endif - - png_debug(1, "in png_handle_PLTE\n"); - - if (!(png_ptr->mode & PNG_HAVE_IHDR)) - png_error(png_ptr, "Missing IHDR before PLTE"); - else if (png_ptr->mode & PNG_HAVE_IDAT) - { - png_warning(png_ptr, "Invalid PLTE after IDAT"); - png_crc_finish(png_ptr, length); - return; - } - else if (png_ptr->mode & PNG_HAVE_PLTE) - png_error(png_ptr, "Duplicate PLTE chunk"); - - png_ptr->mode |= PNG_HAVE_PLTE; - - if (!(png_ptr->color_type&PNG_COLOR_MASK_COLOR)) - { - png_warning(png_ptr, - "Ignoring PLTE chunk in grayscale PNG"); - png_crc_finish(png_ptr, length); - return; - } -#if !defined(PNG_READ_OPT_PLTE_SUPPORTED) - if (png_ptr->color_type != PNG_COLOR_TYPE_PALETTE) - { - png_crc_finish(png_ptr, length); - return; - } -#endif - - if (length > 3*PNG_MAX_PALETTE_LENGTH || length % 3) - { - if (png_ptr->color_type != PNG_COLOR_TYPE_PALETTE) - { - png_warning(png_ptr, "Invalid palette chunk"); - png_crc_finish(png_ptr, length); - return; - } - else - { - png_error(png_ptr, "Invalid palette chunk"); - } - } - - num = (int)length / 3; - -#ifndef PNG_NO_POINTER_INDEXING - for (i = 0, pal_ptr = palette; i < num; i++, pal_ptr++) - { - png_byte buf[3]; - - png_crc_read(png_ptr, buf, 3); - pal_ptr->red = buf[0]; - pal_ptr->green = buf[1]; - pal_ptr->blue = buf[2]; - } -#else - for (i = 0; i < num; i++) - { - png_byte buf[3]; - - png_crc_read(png_ptr, buf, 3); - /* don't depend upon png_color being any order */ - palette[i].red = buf[0]; - palette[i].green = buf[1]; - palette[i].blue = buf[2]; - } -#endif - - /* If we actually NEED the PLTE chunk (ie for a paletted image), we do - whatever the normal CRC configuration tells us. However, if we - have an RGB image, the PLTE can be considered ancillary, so - we will act as though it is. */ -#if !defined(PNG_READ_OPT_PLTE_SUPPORTED) - if (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE) -#endif - { - png_crc_finish(png_ptr, 0); - } -#if !defined(PNG_READ_OPT_PLTE_SUPPORTED) - else if (png_crc_error(png_ptr)) /* Only if we have a CRC error */ - { - /* If we don't want to use the data from an ancillary chunk, - we have two options: an error abort, or a warning and we - ignore the data in this chunk (which should be OK, since - it's considered ancillary for a RGB or RGBA image). */ - if (!(png_ptr->flags & PNG_FLAG_CRC_ANCILLARY_USE)) - { - if (png_ptr->flags & PNG_FLAG_CRC_ANCILLARY_NOWARN) - { - png_chunk_error(png_ptr, "CRC error"); - } - else - { - png_chunk_warning(png_ptr, "CRC error"); - return; - } - } - /* Otherwise, we (optionally) emit a warning and use the chunk. */ - else if (!(png_ptr->flags & PNG_FLAG_CRC_ANCILLARY_NOWARN)) - { - png_chunk_warning(png_ptr, "CRC error"); - } - } -#endif - - png_set_PLTE(png_ptr, info_ptr, palette, num); - -#if defined(PNG_READ_tRNS_SUPPORTED) - if (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE) - { - if (info_ptr != NULL && (info_ptr->valid & PNG_INFO_tRNS)) - { - if (png_ptr->num_trans > (png_uint_16)num) - { - png_warning(png_ptr, "Truncating incorrect tRNS chunk length"); - png_ptr->num_trans = (png_uint_16)num; - } - if (info_ptr->num_trans > (png_uint_16)num) - { - png_warning(png_ptr, "Truncating incorrect info tRNS chunk length"); - info_ptr->num_trans = (png_uint_16)num; - } - } - } -#endif - -} - -void /* PRIVATE */ -png_handle_IEND(png_structp png_ptr, png_infop info_ptr, png_uint_32 length) -{ - png_debug(1, "in png_handle_IEND\n"); - - if (!(png_ptr->mode & PNG_HAVE_IHDR) || !(png_ptr->mode & PNG_HAVE_IDAT)) - { - png_error(png_ptr, "No image in file"); - } - - png_ptr->mode |= (PNG_AFTER_IDAT | PNG_HAVE_IEND); - - if (length != 0) - { - png_warning(png_ptr, "Incorrect IEND chunk length"); - } - png_crc_finish(png_ptr, length); - - if (&info_ptr == NULL) /* quiet compiler warnings about unused info_ptr */ - return; -} - -#if defined(PNG_READ_gAMA_SUPPORTED) -void /* PRIVATE */ -png_handle_gAMA(png_structp png_ptr, png_infop info_ptr, png_uint_32 length) -{ - png_fixed_point igamma; -#ifdef PNG_FLOATING_POINT_SUPPORTED - float file_gamma; -#endif - png_byte buf[4]; - - png_debug(1, "in png_handle_gAMA\n"); - - if (!(png_ptr->mode & PNG_HAVE_IHDR)) - png_error(png_ptr, "Missing IHDR before gAMA"); - else if (png_ptr->mode & PNG_HAVE_IDAT) - { - png_warning(png_ptr, "Invalid gAMA after IDAT"); - png_crc_finish(png_ptr, length); - return; - } - else if (png_ptr->mode & PNG_HAVE_PLTE) - /* Should be an error, but we can cope with it */ - png_warning(png_ptr, "Out of place gAMA chunk"); - - if (info_ptr != NULL && (info_ptr->valid & PNG_INFO_gAMA) -#if defined(PNG_READ_sRGB_SUPPORTED) - && !(info_ptr->valid & PNG_INFO_sRGB) -#endif - ) - { - png_warning(png_ptr, "Duplicate gAMA chunk"); - png_crc_finish(png_ptr, length); - return; - } - - if (length != 4) - { - png_warning(png_ptr, "Incorrect gAMA chunk length"); - png_crc_finish(png_ptr, length); - return; - } - - png_crc_read(png_ptr, buf, 4); - if (png_crc_finish(png_ptr, 0)) - return; - - igamma = (png_fixed_point)png_get_uint_32(buf); - /* check for zero gamma */ - if (igamma == 0) - { - png_warning(png_ptr, - "Ignoring gAMA chunk with gamma=0"); - return; - } - -#if defined(PNG_READ_sRGB_SUPPORTED) - if (info_ptr->valid & PNG_INFO_sRGB) - if (PNG_OUT_OF_RANGE(igamma, 45500L, 500)) - { - png_warning(png_ptr, - "Ignoring incorrect gAMA value when sRGB is also present"); -#ifndef PNG_NO_CONSOLE_IO - fprintf(stderr, "gamma = (%d/100000)\n", (int)igamma); -#endif - return; - } -#endif /* PNG_READ_sRGB_SUPPORTED */ - -#ifdef PNG_FLOATING_POINT_SUPPORTED - file_gamma = (float)igamma / (float)100000.0; -# ifdef PNG_READ_GAMMA_SUPPORTED - png_ptr->gamma = file_gamma; -# endif - png_set_gAMA(png_ptr, info_ptr, file_gamma); -#endif -#ifdef PNG_FIXED_POINT_SUPPORTED - png_set_gAMA_fixed(png_ptr, info_ptr, igamma); -#endif -} -#endif - -#if defined(PNG_READ_sBIT_SUPPORTED) -void /* PRIVATE */ -png_handle_sBIT(png_structp png_ptr, png_infop info_ptr, png_uint_32 length) -{ - png_size_t truelen; - png_byte buf[4]; - - png_debug(1, "in png_handle_sBIT\n"); - - buf[0] = buf[1] = buf[2] = buf[3] = 0; - - if (!(png_ptr->mode & PNG_HAVE_IHDR)) - png_error(png_ptr, "Missing IHDR before sBIT"); - else if (png_ptr->mode & PNG_HAVE_IDAT) - { - png_warning(png_ptr, "Invalid sBIT after IDAT"); - png_crc_finish(png_ptr, length); - return; - } - else if (png_ptr->mode & PNG_HAVE_PLTE) - { - /* Should be an error, but we can cope with it */ - png_warning(png_ptr, "Out of place sBIT chunk"); - } - if (info_ptr != NULL && (info_ptr->valid & PNG_INFO_sBIT)) - { - png_warning(png_ptr, "Duplicate sBIT chunk"); - png_crc_finish(png_ptr, length); - return; - } - - if (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE) - truelen = 3; - else - truelen = (png_size_t)png_ptr->channels; - - if (length != truelen || length > 4) - { - png_warning(png_ptr, "Incorrect sBIT chunk length"); - png_crc_finish(png_ptr, length); - return; - } - - png_crc_read(png_ptr, buf, truelen); - if (png_crc_finish(png_ptr, 0)) - return; - - if (png_ptr->color_type & PNG_COLOR_MASK_COLOR) - { - png_ptr->sig_bit.red = buf[0]; - png_ptr->sig_bit.green = buf[1]; - png_ptr->sig_bit.blue = buf[2]; - png_ptr->sig_bit.alpha = buf[3]; - } - else - { - png_ptr->sig_bit.gray = buf[0]; - png_ptr->sig_bit.red = buf[0]; - png_ptr->sig_bit.green = buf[0]; - png_ptr->sig_bit.blue = buf[0]; - png_ptr->sig_bit.alpha = buf[1]; - } - png_set_sBIT(png_ptr, info_ptr, &(png_ptr->sig_bit)); -} -#endif - -#if defined(PNG_READ_cHRM_SUPPORTED) -void /* PRIVATE */ -png_handle_cHRM(png_structp png_ptr, png_infop info_ptr, png_uint_32 length) -{ - png_byte buf[4]; -#ifdef PNG_FLOATING_POINT_SUPPORTED - float white_x, white_y, red_x, red_y, green_x, green_y, blue_x, blue_y; -#endif - png_fixed_point int_x_white, int_y_white, int_x_red, int_y_red, int_x_green, - int_y_green, int_x_blue, int_y_blue; - - png_uint_32 uint_x, uint_y; - - png_debug(1, "in png_handle_cHRM\n"); - - if (!(png_ptr->mode & PNG_HAVE_IHDR)) - png_error(png_ptr, "Missing IHDR before cHRM"); - else if (png_ptr->mode & PNG_HAVE_IDAT) - { - png_warning(png_ptr, "Invalid cHRM after IDAT"); - png_crc_finish(png_ptr, length); - return; - } - else if (png_ptr->mode & PNG_HAVE_PLTE) - /* Should be an error, but we can cope with it */ - png_warning(png_ptr, "Missing PLTE before cHRM"); - - if (info_ptr != NULL && (info_ptr->valid & PNG_INFO_cHRM) -#if defined(PNG_READ_sRGB_SUPPORTED) - && !(info_ptr->valid & PNG_INFO_sRGB) -#endif - ) - { - png_warning(png_ptr, "Duplicate cHRM chunk"); - png_crc_finish(png_ptr, length); - return; - } - - if (length != 32) - { - png_warning(png_ptr, "Incorrect cHRM chunk length"); - png_crc_finish(png_ptr, length); - return; - } - - png_crc_read(png_ptr, buf, 4); - uint_x = png_get_uint_32(buf); - - png_crc_read(png_ptr, buf, 4); - uint_y = png_get_uint_32(buf); - - if (uint_x > 80000L || uint_y > 80000L || - uint_x + uint_y > 100000L) - { - png_warning(png_ptr, "Invalid cHRM white point"); - png_crc_finish(png_ptr, 24); - return; - } - int_x_white = (png_fixed_point)uint_x; - int_y_white = (png_fixed_point)uint_y; - - png_crc_read(png_ptr, buf, 4); - uint_x = png_get_uint_32(buf); - - png_crc_read(png_ptr, buf, 4); - uint_y = png_get_uint_32(buf); - - if (uint_x > 80000L || uint_y > 80000L || - uint_x + uint_y > 100000L) - { - png_warning(png_ptr, "Invalid cHRM red point"); - png_crc_finish(png_ptr, 16); - return; - } - int_x_red = (png_fixed_point)uint_x; - int_y_red = (png_fixed_point)uint_y; - - png_crc_read(png_ptr, buf, 4); - uint_x = png_get_uint_32(buf); - - png_crc_read(png_ptr, buf, 4); - uint_y = png_get_uint_32(buf); - - if (uint_x > 80000L || uint_y > 80000L || - uint_x + uint_y > 100000L) - { - png_warning(png_ptr, "Invalid cHRM green point"); - png_crc_finish(png_ptr, 8); - return; - } - int_x_green = (png_fixed_point)uint_x; - int_y_green = (png_fixed_point)uint_y; - - png_crc_read(png_ptr, buf, 4); - uint_x = png_get_uint_32(buf); - - png_crc_read(png_ptr, buf, 4); - uint_y = png_get_uint_32(buf); - - if (uint_x > 80000L || uint_y > 80000L || - uint_x + uint_y > 100000L) - { - png_warning(png_ptr, "Invalid cHRM blue point"); - png_crc_finish(png_ptr, 0); - return; - } - int_x_blue = (png_fixed_point)uint_x; - int_y_blue = (png_fixed_point)uint_y; - -#ifdef PNG_FLOATING_POINT_SUPPORTED - white_x = (float)int_x_white / (float)100000.0; - white_y = (float)int_y_white / (float)100000.0; - red_x = (float)int_x_red / (float)100000.0; - red_y = (float)int_y_red / (float)100000.0; - green_x = (float)int_x_green / (float)100000.0; - green_y = (float)int_y_green / (float)100000.0; - blue_x = (float)int_x_blue / (float)100000.0; - blue_y = (float)int_y_blue / (float)100000.0; -#endif - -#if defined(PNG_READ_sRGB_SUPPORTED) - if (info_ptr->valid & PNG_INFO_sRGB) - { - if (PNG_OUT_OF_RANGE(int_x_white, 31270, 1000) || - PNG_OUT_OF_RANGE(int_y_white, 32900, 1000) || - PNG_OUT_OF_RANGE(int_x_red, 64000L, 1000) || - PNG_OUT_OF_RANGE(int_y_red, 33000, 1000) || - PNG_OUT_OF_RANGE(int_x_green, 30000, 1000) || - PNG_OUT_OF_RANGE(int_y_green, 60000L, 1000) || - PNG_OUT_OF_RANGE(int_x_blue, 15000, 1000) || - PNG_OUT_OF_RANGE(int_y_blue, 6000, 1000)) - { - - png_warning(png_ptr, - "Ignoring incorrect cHRM value when sRGB is also present"); -#ifndef PNG_NO_CONSOLE_IO -#ifdef PNG_FLOATING_POINT_SUPPORTED - fprintf(stderr,"wx=%f, wy=%f, rx=%f, ry=%f\n", - white_x, white_y, red_x, red_y); - fprintf(stderr,"gx=%f, gy=%f, bx=%f, by=%f\n", - green_x, green_y, blue_x, blue_y); -#else - fprintf(stderr,"wx=%ld, wy=%ld, rx=%ld, ry=%ld\n", - int_x_white, int_y_white, int_x_red, int_y_red); - fprintf(stderr,"gx=%ld, gy=%ld, bx=%ld, by=%ld\n", - int_x_green, int_y_green, int_x_blue, int_y_blue); -#endif -#endif /* PNG_NO_CONSOLE_IO */ - } - png_crc_finish(png_ptr, 0); - return; - } -#endif /* PNG_READ_sRGB_SUPPORTED */ - -#ifdef PNG_FLOATING_POINT_SUPPORTED - png_set_cHRM(png_ptr, info_ptr, - white_x, white_y, red_x, red_y, green_x, green_y, blue_x, blue_y); -#endif -#ifdef PNG_FIXED_POINT_SUPPORTED - png_set_cHRM_fixed(png_ptr, info_ptr, - int_x_white, int_y_white, int_x_red, int_y_red, int_x_green, - int_y_green, int_x_blue, int_y_blue); -#endif - if (png_crc_finish(png_ptr, 0)) - return; -} -#endif - -#if defined(PNG_READ_sRGB_SUPPORTED) -void /* PRIVATE */ -png_handle_sRGB(png_structp png_ptr, png_infop info_ptr, png_uint_32 length) -{ - int intent; - png_byte buf[1]; - - png_debug(1, "in png_handle_sRGB\n"); - - if (!(png_ptr->mode & PNG_HAVE_IHDR)) - png_error(png_ptr, "Missing IHDR before sRGB"); - else if (png_ptr->mode & PNG_HAVE_IDAT) - { - png_warning(png_ptr, "Invalid sRGB after IDAT"); - png_crc_finish(png_ptr, length); - return; - } - else if (png_ptr->mode & PNG_HAVE_PLTE) - /* Should be an error, but we can cope with it */ - png_warning(png_ptr, "Out of place sRGB chunk"); - - if (info_ptr != NULL && (info_ptr->valid & PNG_INFO_sRGB)) - { - png_warning(png_ptr, "Duplicate sRGB chunk"); - png_crc_finish(png_ptr, length); - return; - } - - if (length != 1) - { - png_warning(png_ptr, "Incorrect sRGB chunk length"); - png_crc_finish(png_ptr, length); - return; - } - - png_crc_read(png_ptr, buf, 1); - if (png_crc_finish(png_ptr, 0)) - return; - - intent = buf[0]; - /* check for bad intent */ - if (intent >= PNG_sRGB_INTENT_LAST) - { - png_warning(png_ptr, "Unknown sRGB intent"); - return; - } - -#if defined(PNG_READ_gAMA_SUPPORTED) && defined(PNG_READ_GAMMA_SUPPORTED) - if ((info_ptr->valid & PNG_INFO_gAMA)) - { - png_fixed_point igamma; -#ifdef PNG_FIXED_POINT_SUPPORTED - igamma=info_ptr->int_gamma; -#else -# ifdef PNG_FLOATING_POINT_SUPPORTED - igamma=(png_fixed_point)(info_ptr->gamma * 100000.); -# endif -#endif - if (PNG_OUT_OF_RANGE(igamma, 45500L, 500)) - { - png_warning(png_ptr, - "Ignoring incorrect gAMA value when sRGB is also present"); -#ifndef PNG_NO_CONSOLE_IO -# ifdef PNG_FIXED_POINT_SUPPORTED - fprintf(stderr,"incorrect gamma=(%d/100000)\n",(int)png_ptr->int_gamma); -# else -# ifdef PNG_FLOATING_POINT_SUPPORTED - fprintf(stderr,"incorrect gamma=%f\n",png_ptr->gamma); -# endif -# endif -#endif - } - } -#endif /* PNG_READ_gAMA_SUPPORTED */ - -#ifdef PNG_READ_cHRM_SUPPORTED -#ifdef PNG_FIXED_POINT_SUPPORTED - if (info_ptr->valid & PNG_INFO_cHRM) - if (PNG_OUT_OF_RANGE(info_ptr->int_x_white, 31270, 1000) || - PNG_OUT_OF_RANGE(info_ptr->int_y_white, 32900, 1000) || - PNG_OUT_OF_RANGE(info_ptr->int_x_red, 64000L, 1000) || - PNG_OUT_OF_RANGE(info_ptr->int_y_red, 33000, 1000) || - PNG_OUT_OF_RANGE(info_ptr->int_x_green, 30000, 1000) || - PNG_OUT_OF_RANGE(info_ptr->int_y_green, 60000L, 1000) || - PNG_OUT_OF_RANGE(info_ptr->int_x_blue, 15000, 1000) || - PNG_OUT_OF_RANGE(info_ptr->int_y_blue, 6000, 1000)) - { - png_warning(png_ptr, - "Ignoring incorrect cHRM value when sRGB is also present"); - } -#endif /* PNG_FIXED_POINT_SUPPORTED */ -#endif /* PNG_READ_cHRM_SUPPORTED */ - - png_set_sRGB_gAMA_and_cHRM(png_ptr, info_ptr, intent); -} -#endif /* PNG_READ_sRGB_SUPPORTED */ - -#if defined(PNG_READ_iCCP_SUPPORTED) -void /* PRIVATE */ -png_handle_iCCP(png_structp png_ptr, png_infop info_ptr, png_uint_32 length) -/* Note: this does not properly handle chunks that are > 64K under DOS */ -{ - png_charp chunkdata; - png_byte compression_type; - png_bytep pC; - png_charp profile; - png_uint_32 skip = 0; - png_uint_32 profile_size, profile_length; - png_size_t slength, prefix_length, data_length; - - png_debug(1, "in png_handle_iCCP\n"); - - if (!(png_ptr->mode & PNG_HAVE_IHDR)) - png_error(png_ptr, "Missing IHDR before iCCP"); - else if (png_ptr->mode & PNG_HAVE_IDAT) - { - png_warning(png_ptr, "Invalid iCCP after IDAT"); - png_crc_finish(png_ptr, length); - return; - } - else if (png_ptr->mode & PNG_HAVE_PLTE) - /* Should be an error, but we can cope with it */ - png_warning(png_ptr, "Out of place iCCP chunk"); - - if (info_ptr != NULL && (info_ptr->valid & PNG_INFO_iCCP)) - { - png_warning(png_ptr, "Duplicate iCCP chunk"); - png_crc_finish(png_ptr, length); - return; - } - -#ifdef PNG_MAX_MALLOC_64K - if (length > (png_uint_32)65535L) - { - png_warning(png_ptr, "iCCP chunk too large to fit in memory"); - skip = length - (png_uint_32)65535L; - length = (png_uint_32)65535L; - } -#endif - - chunkdata = (png_charp)png_malloc(png_ptr, length + 1); - slength = (png_size_t)length; - png_crc_read(png_ptr, (png_bytep)chunkdata, slength); - - if (png_crc_finish(png_ptr, skip)) - { - png_free(png_ptr, chunkdata); - return; - } - - chunkdata[slength] = 0x00; - - for (profile = chunkdata; *profile; profile++) - /* empty loop to find end of name */ ; - - ++profile; - - /* there should be at least one zero (the compression type byte) - following the separator, and we should be on it */ - if ( profile >= chunkdata + slength) - { - png_free(png_ptr, chunkdata); - png_warning(png_ptr, "Malformed iCCP chunk"); - return; - } - - /* compression_type should always be zero */ - compression_type = *profile++; - if (compression_type) - { - png_warning(png_ptr, "Ignoring nonzero compression type in iCCP chunk"); - compression_type=0x00; /* Reset it to zero (libpng-1.0.6 through 1.0.8 - wrote nonzero) */ - } - - prefix_length = profile - chunkdata; - chunkdata = png_decompress_chunk(png_ptr, compression_type, chunkdata, - slength, prefix_length, &data_length); - - profile_length = data_length - prefix_length; - - if ( prefix_length > data_length || profile_length < 4) - { - png_free(png_ptr, chunkdata); - png_warning(png_ptr, "Profile size field missing from iCCP chunk"); - return; - } - - /* Check the profile_size recorded in the first 32 bits of the ICC profile */ - pC = (png_bytep)(chunkdata+prefix_length); - profile_size = ((*(pC ))<<24) | - ((*(pC+1))<<16) | - ((*(pC+2))<< 8) | - ((*(pC+3)) ); - - if(profile_size < profile_length) - profile_length = profile_size; - - if(profile_size > profile_length) - { - png_free(png_ptr, chunkdata); - png_warning(png_ptr, "Ignoring truncated iCCP profile.\n"); - return; - } - - png_set_iCCP(png_ptr, info_ptr, chunkdata, compression_type, - chunkdata + prefix_length, profile_length); - png_free(png_ptr, chunkdata); -} -#endif /* PNG_READ_iCCP_SUPPORTED */ - -#if defined(PNG_READ_sPLT_SUPPORTED) -void /* PRIVATE */ -png_handle_sPLT(png_structp png_ptr, png_infop info_ptr, png_uint_32 length) -/* Note: this does not properly handle chunks that are > 64K under DOS */ -{ - png_bytep chunkdata; - png_bytep entry_start; - png_sPLT_t new_palette; -#ifdef PNG_NO_POINTER_INDEXING - png_sPLT_entryp pp; -#endif - int data_length, entry_size, i; - png_uint_32 skip = 0; - png_size_t slength; - - png_debug(1, "in png_handle_sPLT\n"); - - if (!(png_ptr->mode & PNG_HAVE_IHDR)) - png_error(png_ptr, "Missing IHDR before sPLT"); - else if (png_ptr->mode & PNG_HAVE_IDAT) - { - png_warning(png_ptr, "Invalid sPLT after IDAT"); - png_crc_finish(png_ptr, length); - return; - } - -#ifdef PNG_MAX_MALLOC_64K - if (length > (png_uint_32)65535L) - { - png_warning(png_ptr, "sPLT chunk too large to fit in memory"); - skip = length - (png_uint_32)65535L; - length = (png_uint_32)65535L; - } -#endif - - chunkdata = (png_bytep)png_malloc(png_ptr, length + 1); - slength = (png_size_t)length; - png_crc_read(png_ptr, (png_bytep)chunkdata, slength); - - if (png_crc_finish(png_ptr, skip)) - { - png_free(png_ptr, chunkdata); - return; - } - - chunkdata[slength] = 0x00; - - for (entry_start = chunkdata; *entry_start; entry_start++) - /* empty loop to find end of name */ ; - ++entry_start; - - /* a sample depth should follow the separator, and we should be on it */ - if (entry_start > chunkdata + slength) - { - png_free(png_ptr, chunkdata); - png_warning(png_ptr, "malformed sPLT chunk"); - return; - } - - new_palette.depth = *entry_start++; - entry_size = (new_palette.depth == 8 ? 6 : 10); - data_length = (slength - (entry_start - chunkdata)); - - /* integrity-check the data length */ - if (data_length % entry_size) - { - png_free(png_ptr, chunkdata); - png_warning(png_ptr, "sPLT chunk has bad length"); - return; - } - - new_palette.nentries = (png_uint_32) (data_length / entry_size); - if ((png_uint_32) new_palette.nentries > (png_uint_32) (PNG_SIZE_MAX / - png_sizeof(png_sPLT_entry))) - { - png_warning(png_ptr, "sPLT chunk too long"); - return; - } - new_palette.entries = (png_sPLT_entryp)png_malloc_warn( - png_ptr, new_palette.nentries * png_sizeof(png_sPLT_entry)); - if (new_palette.entries == NULL) - { - png_warning(png_ptr, "sPLT chunk requires too much memory"); - return; - } - -#ifndef PNG_NO_POINTER_INDEXING - for (i = 0; i < new_palette.nentries; i++) - { - png_sPLT_entryp pp = new_palette.entries + i; - - if (new_palette.depth == 8) - { - pp->red = *entry_start++; - pp->green = *entry_start++; - pp->blue = *entry_start++; - pp->alpha = *entry_start++; - } - else - { - pp->red = png_get_uint_16(entry_start); entry_start += 2; - pp->green = png_get_uint_16(entry_start); entry_start += 2; - pp->blue = png_get_uint_16(entry_start); entry_start += 2; - pp->alpha = png_get_uint_16(entry_start); entry_start += 2; - } - pp->frequency = png_get_uint_16(entry_start); entry_start += 2; - } -#else - pp = new_palette.entries; - for (i = 0; i < new_palette.nentries; i++) - { - - if (new_palette.depth == 8) - { - pp[i].red = *entry_start++; - pp[i].green = *entry_start++; - pp[i].blue = *entry_start++; - pp[i].alpha = *entry_start++; - } - else - { - pp[i].red = png_get_uint_16(entry_start); entry_start += 2; - pp[i].green = png_get_uint_16(entry_start); entry_start += 2; - pp[i].blue = png_get_uint_16(entry_start); entry_start += 2; - pp[i].alpha = png_get_uint_16(entry_start); entry_start += 2; - } - pp->frequency = png_get_uint_16(entry_start); entry_start += 2; - } -#endif - - /* discard all chunk data except the name and stash that */ - new_palette.name = (png_charp)chunkdata; - - png_set_sPLT(png_ptr, info_ptr, &new_palette, 1); - - png_free(png_ptr, chunkdata); - png_free(png_ptr, new_palette.entries); -} -#endif /* PNG_READ_sPLT_SUPPORTED */ - -#if defined(PNG_READ_tRNS_SUPPORTED) -void /* PRIVATE */ -png_handle_tRNS(png_structp png_ptr, png_infop info_ptr, png_uint_32 length) -{ - png_byte readbuf[PNG_MAX_PALETTE_LENGTH]; - - png_debug(1, "in png_handle_tRNS\n"); - - if (!(png_ptr->mode & PNG_HAVE_IHDR)) - png_error(png_ptr, "Missing IHDR before tRNS"); - else if (png_ptr->mode & PNG_HAVE_IDAT) - { - png_warning(png_ptr, "Invalid tRNS after IDAT"); - png_crc_finish(png_ptr, length); - return; - } - else if (info_ptr != NULL && (info_ptr->valid & PNG_INFO_tRNS)) - { - png_warning(png_ptr, "Duplicate tRNS chunk"); - png_crc_finish(png_ptr, length); - return; - } - - if (png_ptr->color_type == PNG_COLOR_TYPE_GRAY) - { - png_byte buf[2]; - - if (length != 2) - { - png_warning(png_ptr, "Incorrect tRNS chunk length"); - png_crc_finish(png_ptr, length); - return; - } - - png_crc_read(png_ptr, buf, 2); - png_ptr->num_trans = 1; - png_ptr->trans_values.gray = png_get_uint_16(buf); - } - else if (png_ptr->color_type == PNG_COLOR_TYPE_RGB) - { - png_byte buf[6]; - - if (length != 6) - { - png_warning(png_ptr, "Incorrect tRNS chunk length"); - png_crc_finish(png_ptr, length); - return; - } - png_crc_read(png_ptr, buf, (png_size_t)length); - png_ptr->num_trans = 1; - png_ptr->trans_values.red = png_get_uint_16(buf); - png_ptr->trans_values.green = png_get_uint_16(buf + 2); - png_ptr->trans_values.blue = png_get_uint_16(buf + 4); - } - else if (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE) - { - if (!(png_ptr->mode & PNG_HAVE_PLTE)) - { - /* Should be an error, but we can cope with it. */ - png_warning(png_ptr, "Missing PLTE before tRNS"); - } - if (length > (png_uint_32)png_ptr->num_palette || - length > PNG_MAX_PALETTE_LENGTH) - { - png_warning(png_ptr, "Incorrect tRNS chunk length"); - png_crc_finish(png_ptr, length); - return; - } - if (length == 0) - { - png_warning(png_ptr, "Zero length tRNS chunk"); - png_crc_finish(png_ptr, length); - return; - } - png_crc_read(png_ptr, readbuf, (png_size_t)length); - png_ptr->num_trans = (png_uint_16)length; - } - else - { - png_warning(png_ptr, "tRNS chunk not allowed with alpha channel"); - png_crc_finish(png_ptr, length); - return; - } - - if (png_crc_finish(png_ptr, 0)) - return; - - png_set_tRNS(png_ptr, info_ptr, readbuf, png_ptr->num_trans, - &(png_ptr->trans_values)); -} -#endif - -#if defined(PNG_READ_bKGD_SUPPORTED) -void /* PRIVATE */ -png_handle_bKGD(png_structp png_ptr, png_infop info_ptr, png_uint_32 length) -{ - png_size_t truelen; - png_byte buf[6]; - - png_debug(1, "in png_handle_bKGD\n"); - - if (!(png_ptr->mode & PNG_HAVE_IHDR)) - png_error(png_ptr, "Missing IHDR before bKGD"); - else if (png_ptr->mode & PNG_HAVE_IDAT) - { - png_warning(png_ptr, "Invalid bKGD after IDAT"); - png_crc_finish(png_ptr, length); - return; - } - else if (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE && - !(png_ptr->mode & PNG_HAVE_PLTE)) - { - png_warning(png_ptr, "Missing PLTE before bKGD"); - png_crc_finish(png_ptr, length); - return; - } - else if (info_ptr != NULL && (info_ptr->valid & PNG_INFO_bKGD)) - { - png_warning(png_ptr, "Duplicate bKGD chunk"); - png_crc_finish(png_ptr, length); - return; - } - - if (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE) - truelen = 1; - else if (png_ptr->color_type & PNG_COLOR_MASK_COLOR) - truelen = 6; - else - truelen = 2; - - if (length != truelen) - { - png_warning(png_ptr, "Incorrect bKGD chunk length"); - png_crc_finish(png_ptr, length); - return; - } - - png_crc_read(png_ptr, buf, truelen); - if (png_crc_finish(png_ptr, 0)) - return; - - /* We convert the index value into RGB components so that we can allow - * arbitrary RGB values for background when we have transparency, and - * so it is easy to determine the RGB values of the background color - * from the info_ptr struct. */ - if (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE) - { - png_ptr->background.index = buf[0]; - if(info_ptr->num_palette) - { - if(buf[0] > info_ptr->num_palette) - { - png_warning(png_ptr, "Incorrect bKGD chunk index value"); - return; - } - png_ptr->background.red = - (png_uint_16)png_ptr->palette[buf[0]].red; - png_ptr->background.green = - (png_uint_16)png_ptr->palette[buf[0]].green; - png_ptr->background.blue = - (png_uint_16)png_ptr->palette[buf[0]].blue; - } - } - else if (!(png_ptr->color_type & PNG_COLOR_MASK_COLOR)) /* GRAY */ - { - png_ptr->background.red = - png_ptr->background.green = - png_ptr->background.blue = - png_ptr->background.gray = png_get_uint_16(buf); - } - else - { - png_ptr->background.red = png_get_uint_16(buf); - png_ptr->background.green = png_get_uint_16(buf + 2); - png_ptr->background.blue = png_get_uint_16(buf + 4); - } - - png_set_bKGD(png_ptr, info_ptr, &(png_ptr->background)); -} -#endif - -#if defined(PNG_READ_hIST_SUPPORTED) -void /* PRIVATE */ -png_handle_hIST(png_structp png_ptr, png_infop info_ptr, png_uint_32 length) -{ - unsigned int num, i; - png_uint_16 readbuf[PNG_MAX_PALETTE_LENGTH]; - - png_debug(1, "in png_handle_hIST\n"); - - if (!(png_ptr->mode & PNG_HAVE_IHDR)) - png_error(png_ptr, "Missing IHDR before hIST"); - else if (png_ptr->mode & PNG_HAVE_IDAT) - { - png_warning(png_ptr, "Invalid hIST after IDAT"); - png_crc_finish(png_ptr, length); - return; - } - else if (!(png_ptr->mode & PNG_HAVE_PLTE)) - { - png_warning(png_ptr, "Missing PLTE before hIST"); - png_crc_finish(png_ptr, length); - return; - } - else if (info_ptr != NULL && (info_ptr->valid & PNG_INFO_hIST)) - { - png_warning(png_ptr, "Duplicate hIST chunk"); - png_crc_finish(png_ptr, length); - return; - } - - num = length / 2 ; - if (num != (unsigned int) png_ptr->num_palette || num > - (unsigned int) PNG_MAX_PALETTE_LENGTH) - { - png_warning(png_ptr, "Incorrect hIST chunk length"); - png_crc_finish(png_ptr, length); - return; - } - - for (i = 0; i < num; i++) - { - png_byte buf[2]; - - png_crc_read(png_ptr, buf, 2); - readbuf[i] = png_get_uint_16(buf); - } - - if (png_crc_finish(png_ptr, 0)) - return; - - png_set_hIST(png_ptr, info_ptr, readbuf); -} -#endif - -#if defined(PNG_READ_pHYs_SUPPORTED) -void /* PRIVATE */ -png_handle_pHYs(png_structp png_ptr, png_infop info_ptr, png_uint_32 length) -{ - png_byte buf[9]; - png_uint_32 res_x, res_y; - int unit_type; - - png_debug(1, "in png_handle_pHYs\n"); - - if (!(png_ptr->mode & PNG_HAVE_IHDR)) - png_error(png_ptr, "Missing IHDR before pHYs"); - else if (png_ptr->mode & PNG_HAVE_IDAT) - { - png_warning(png_ptr, "Invalid pHYs after IDAT"); - png_crc_finish(png_ptr, length); - return; - } - else if (info_ptr != NULL && (info_ptr->valid & PNG_INFO_pHYs)) - { - png_warning(png_ptr, "Duplicate pHYs chunk"); - png_crc_finish(png_ptr, length); - return; - } - - if (length != 9) - { - png_warning(png_ptr, "Incorrect pHYs chunk length"); - png_crc_finish(png_ptr, length); - return; - } - - png_crc_read(png_ptr, buf, 9); - if (png_crc_finish(png_ptr, 0)) - return; - - res_x = png_get_uint_32(buf); - res_y = png_get_uint_32(buf + 4); - unit_type = buf[8]; - png_set_pHYs(png_ptr, info_ptr, res_x, res_y, unit_type); -} -#endif - -#if defined(PNG_READ_oFFs_SUPPORTED) -void /* PRIVATE */ -png_handle_oFFs(png_structp png_ptr, png_infop info_ptr, png_uint_32 length) -{ - png_byte buf[9]; - png_int_32 offset_x, offset_y; - int unit_type; - - png_debug(1, "in png_handle_oFFs\n"); - - if (!(png_ptr->mode & PNG_HAVE_IHDR)) - png_error(png_ptr, "Missing IHDR before oFFs"); - else if (png_ptr->mode & PNG_HAVE_IDAT) - { - png_warning(png_ptr, "Invalid oFFs after IDAT"); - png_crc_finish(png_ptr, length); - return; - } - else if (info_ptr != NULL && (info_ptr->valid & PNG_INFO_oFFs)) - { - png_warning(png_ptr, "Duplicate oFFs chunk"); - png_crc_finish(png_ptr, length); - return; - } - - if (length != 9) - { - png_warning(png_ptr, "Incorrect oFFs chunk length"); - png_crc_finish(png_ptr, length); - return; - } - - png_crc_read(png_ptr, buf, 9); - if (png_crc_finish(png_ptr, 0)) - return; - - offset_x = png_get_int_32(buf); - offset_y = png_get_int_32(buf + 4); - unit_type = buf[8]; - png_set_oFFs(png_ptr, info_ptr, offset_x, offset_y, unit_type); -} -#endif - -#if defined(PNG_READ_pCAL_SUPPORTED) -/* read the pCAL chunk (described in the PNG Extensions document) */ -void /* PRIVATE */ -png_handle_pCAL(png_structp png_ptr, png_infop info_ptr, png_uint_32 length) -{ - png_charp purpose; - png_int_32 X0, X1; - png_byte type, nparams; - png_charp buf, units, endptr; - png_charpp params; - png_size_t slength; - int i; - - png_debug(1, "in png_handle_pCAL\n"); - - if (!(png_ptr->mode & PNG_HAVE_IHDR)) - png_error(png_ptr, "Missing IHDR before pCAL"); - else if (png_ptr->mode & PNG_HAVE_IDAT) - { - png_warning(png_ptr, "Invalid pCAL after IDAT"); - png_crc_finish(png_ptr, length); - return; - } - else if (info_ptr != NULL && (info_ptr->valid & PNG_INFO_pCAL)) - { - png_warning(png_ptr, "Duplicate pCAL chunk"); - png_crc_finish(png_ptr, length); - return; - } - - png_debug1(2, "Allocating and reading pCAL chunk data (%lu bytes)\n", - length + 1); - purpose = (png_charp)png_malloc_warn(png_ptr, length + 1); - if (purpose == NULL) - { - png_warning(png_ptr, "No memory for pCAL purpose."); - return; - } - slength = (png_size_t)length; - png_crc_read(png_ptr, (png_bytep)purpose, slength); - - if (png_crc_finish(png_ptr, 0)) - { - png_free(png_ptr, purpose); - return; - } - - purpose[slength] = 0x00; /* null terminate the last string */ - - png_debug(3, "Finding end of pCAL purpose string\n"); - for (buf = purpose; *buf; buf++) - /* empty loop */ ; - - endptr = purpose + slength; - - /* We need to have at least 12 bytes after the purpose string - in order to get the parameter information. */ - if (endptr <= buf + 12) - { - png_warning(png_ptr, "Invalid pCAL data"); - png_free(png_ptr, purpose); - return; - } - - png_debug(3, "Reading pCAL X0, X1, type, nparams, and units\n"); - X0 = png_get_int_32((png_bytep)buf+1); - X1 = png_get_int_32((png_bytep)buf+5); - type = buf[9]; - nparams = buf[10]; - units = buf + 11; - - png_debug(3, "Checking pCAL equation type and number of parameters\n"); - /* Check that we have the right number of parameters for known - equation types. */ - if ((type == PNG_EQUATION_LINEAR && nparams != 2) || - (type == PNG_EQUATION_BASE_E && nparams != 3) || - (type == PNG_EQUATION_ARBITRARY && nparams != 3) || - (type == PNG_EQUATION_HYPERBOLIC && nparams != 4)) - { - png_warning(png_ptr, "Invalid pCAL parameters for equation type"); - png_free(png_ptr, purpose); - return; - } - else if (type >= PNG_EQUATION_LAST) - { - png_warning(png_ptr, "Unrecognized equation type for pCAL chunk"); - } - - for (buf = units; *buf; buf++) - /* Empty loop to move past the units string. */ ; - - png_debug(3, "Allocating pCAL parameters array\n"); - params = (png_charpp)png_malloc_warn(png_ptr, (png_uint_32)(nparams - *png_sizeof(png_charp))) ; - if (params == NULL) - { - png_free(png_ptr, purpose); - png_warning(png_ptr, "No memory for pCAL params."); - return; - } - - /* Get pointers to the start of each parameter string. */ - for (i = 0; i < (int)nparams; i++) - { - buf++; /* Skip the null string terminator from previous parameter. */ - - png_debug1(3, "Reading pCAL parameter %d\n", i); - for (params[i] = buf; *buf != 0x00 && buf <= endptr; buf++) - /* Empty loop to move past each parameter string */ ; - - /* Make sure we haven't run out of data yet */ - if (buf > endptr) - { - png_warning(png_ptr, "Invalid pCAL data"); - png_free(png_ptr, purpose); - png_free(png_ptr, params); - return; - } - } - - png_set_pCAL(png_ptr, info_ptr, purpose, X0, X1, type, nparams, - units, params); - - png_free(png_ptr, purpose); - png_free(png_ptr, params); -} -#endif - -#if defined(PNG_READ_sCAL_SUPPORTED) -/* read the sCAL chunk */ -void /* PRIVATE */ -png_handle_sCAL(png_structp png_ptr, png_infop info_ptr, png_uint_32 length) -{ - png_charp buffer, ep; -#ifdef PNG_FLOATING_POINT_SUPPORTED - double width, height; - png_charp vp; -#else -#ifdef PNG_FIXED_POINT_SUPPORTED - png_charp swidth, sheight; -#endif -#endif - png_size_t slength; - - png_debug(1, "in png_handle_sCAL\n"); - - if (!(png_ptr->mode & PNG_HAVE_IHDR)) - png_error(png_ptr, "Missing IHDR before sCAL"); - else if (png_ptr->mode & PNG_HAVE_IDAT) - { - png_warning(png_ptr, "Invalid sCAL after IDAT"); - png_crc_finish(png_ptr, length); - return; - } - else if (info_ptr != NULL && (info_ptr->valid & PNG_INFO_sCAL)) - { - png_warning(png_ptr, "Duplicate sCAL chunk"); - png_crc_finish(png_ptr, length); - return; - } - - png_debug1(2, "Allocating and reading sCAL chunk data (%lu bytes)\n", - length + 1); - buffer = (png_charp)png_malloc_warn(png_ptr, length + 1); - if (buffer == NULL) - { - png_warning(png_ptr, "Out of memory while processing sCAL chunk"); - return; - } - slength = (png_size_t)length; - png_crc_read(png_ptr, (png_bytep)buffer, slength); - - if (png_crc_finish(png_ptr, 0)) - { - png_free(png_ptr, buffer); - return; - } - - buffer[slength] = 0x00; /* null terminate the last string */ - - ep = buffer + 1; /* skip unit byte */ - -#ifdef PNG_FLOATING_POINT_SUPPORTED - width = strtod(ep, &vp); - if (*vp) - { - png_warning(png_ptr, "malformed width string in sCAL chunk"); - return; - } -#else -#ifdef PNG_FIXED_POINT_SUPPORTED - swidth = (png_charp)png_malloc_warn(png_ptr, png_strlen(ep) + 1); - if (swidth == NULL) - { - png_warning(png_ptr, "Out of memory while processing sCAL chunk width"); - return; - } - png_memcpy(swidth, ep, (png_size_t)png_strlen(ep)); -#endif -#endif - - for (ep = buffer; *ep; ep++) - /* empty loop */ ; - ep++; - -#ifdef PNG_FLOATING_POINT_SUPPORTED - height = strtod(ep, &vp); - if (*vp) - { - png_warning(png_ptr, "malformed height string in sCAL chunk"); - return; - } -#else -#ifdef PNG_FIXED_POINT_SUPPORTED - sheight = (png_charp)png_malloc_warn(png_ptr, png_strlen(ep) + 1); - if (swidth == NULL) - { - png_warning(png_ptr, "Out of memory while processing sCAL chunk height"); - return; - } - png_memcpy(sheight, ep, (png_size_t)png_strlen(ep)); -#endif -#endif - - if (buffer + slength < ep -#ifdef PNG_FLOATING_POINT_SUPPORTED - || width <= 0. || height <= 0. -#endif - ) - { - png_warning(png_ptr, "Invalid sCAL data"); - png_free(png_ptr, buffer); -#if defined(PNG_FIXED_POINT_SUPPORTED) && !defined(PNG_FLOATING_POINT_SUPPORTED) - png_free(png_ptr, swidth); - png_free(png_ptr, sheight); -#endif - return; - } - - -#ifdef PNG_FLOATING_POINT_SUPPORTED - png_set_sCAL(png_ptr, info_ptr, buffer[0], width, height); -#else -#ifdef PNG_FIXED_POINT_SUPPORTED - png_set_sCAL_s(png_ptr, info_ptr, buffer[0], swidth, sheight); -#endif -#endif - - png_free(png_ptr, buffer); -#if defined(PNG_FIXED_POINT_SUPPORTED) && !defined(PNG_FLOATING_POINT_SUPPORTED) - png_free(png_ptr, swidth); - png_free(png_ptr, sheight); -#endif -} -#endif - -#if defined(PNG_READ_tIME_SUPPORTED) -void /* PRIVATE */ -png_handle_tIME(png_structp png_ptr, png_infop info_ptr, png_uint_32 length) -{ - png_byte buf[7]; - png_time mod_time; - - png_debug(1, "in png_handle_tIME\n"); - - if (!(png_ptr->mode & PNG_HAVE_IHDR)) - png_error(png_ptr, "Out of place tIME chunk"); - else if (info_ptr != NULL && (info_ptr->valid & PNG_INFO_tIME)) - { - png_warning(png_ptr, "Duplicate tIME chunk"); - png_crc_finish(png_ptr, length); - return; - } - - if (png_ptr->mode & PNG_HAVE_IDAT) - png_ptr->mode |= PNG_AFTER_IDAT; - - if (length != 7) - { - png_warning(png_ptr, "Incorrect tIME chunk length"); - png_crc_finish(png_ptr, length); - return; - } - - png_crc_read(png_ptr, buf, 7); - if (png_crc_finish(png_ptr, 0)) - return; - - mod_time.second = buf[6]; - mod_time.minute = buf[5]; - mod_time.hour = buf[4]; - mod_time.day = buf[3]; - mod_time.month = buf[2]; - mod_time.year = png_get_uint_16(buf); - - png_set_tIME(png_ptr, info_ptr, &mod_time); -} -#endif - -#if defined(PNG_READ_tEXt_SUPPORTED) -/* Note: this does not properly handle chunks that are > 64K under DOS */ -void /* PRIVATE */ -png_handle_tEXt(png_structp png_ptr, png_infop info_ptr, png_uint_32 length) -{ - png_textp text_ptr; - png_charp key; - png_charp text; - png_uint_32 skip = 0; - png_size_t slength; - int ret; - - png_debug(1, "in png_handle_tEXt\n"); - - if (!(png_ptr->mode & PNG_HAVE_IHDR)) - png_error(png_ptr, "Missing IHDR before tEXt"); - - if (png_ptr->mode & PNG_HAVE_IDAT) - png_ptr->mode |= PNG_AFTER_IDAT; - -#ifdef PNG_MAX_MALLOC_64K - if (length > (png_uint_32)65535L) - { - png_warning(png_ptr, "tEXt chunk too large to fit in memory"); - skip = length - (png_uint_32)65535L; - length = (png_uint_32)65535L; - } -#endif - - key = (png_charp)png_malloc_warn(png_ptr, length + 1); - if (key == NULL) - { - png_warning(png_ptr, "No memory to process text chunk."); - return; - } - slength = (png_size_t)length; - png_crc_read(png_ptr, (png_bytep)key, slength); - - if (png_crc_finish(png_ptr, skip)) - { - png_free(png_ptr, key); - return; - } - - key[slength] = 0x00; - - for (text = key; *text; text++) - /* empty loop to find end of key */ ; - - if (text != key + slength) - text++; - - text_ptr = (png_textp)png_malloc_warn(png_ptr, - (png_uint_32)png_sizeof(png_text)); - if (text_ptr == NULL) - { - png_warning(png_ptr, "Not enough memory to process text chunk."); - png_free(png_ptr, key); - return; - } - text_ptr->compression = PNG_TEXT_COMPRESSION_NONE; - text_ptr->key = key; -#ifdef PNG_iTXt_SUPPORTED - text_ptr->lang = NULL; - text_ptr->lang_key = NULL; - text_ptr->itxt_length = 0; -#endif - text_ptr->text = text; - text_ptr->text_length = png_strlen(text); - - ret=png_set_text_2(png_ptr, info_ptr, text_ptr, 1); - - png_free(png_ptr, key); - png_free(png_ptr, text_ptr); - if (ret) - png_warning(png_ptr, "Insufficient memory to process text chunk."); -} -#endif - -#if defined(PNG_READ_zTXt_SUPPORTED) -/* note: this does not correctly handle chunks that are > 64K under DOS */ -void /* PRIVATE */ -png_handle_zTXt(png_structp png_ptr, png_infop info_ptr, png_uint_32 length) -{ - png_textp text_ptr; - png_charp chunkdata; - png_charp text; - int comp_type; - int ret; - png_size_t slength, prefix_len, data_len; - - png_debug(1, "in png_handle_zTXt\n"); - if (!(png_ptr->mode & PNG_HAVE_IHDR)) - png_error(png_ptr, "Missing IHDR before zTXt"); - - if (png_ptr->mode & PNG_HAVE_IDAT) - png_ptr->mode |= PNG_AFTER_IDAT; - -#ifdef PNG_MAX_MALLOC_64K - /* We will no doubt have problems with chunks even half this size, but - there is no hard and fast rule to tell us where to stop. */ - if (length > (png_uint_32)65535L) - { - png_warning(png_ptr,"zTXt chunk too large to fit in memory"); - png_crc_finish(png_ptr, length); - return; - } -#endif - - chunkdata = (png_charp)png_malloc_warn(png_ptr, length + 1); - if (chunkdata == NULL) - { - png_warning(png_ptr,"Out of memory processing zTXt chunk."); - return; - } - slength = (png_size_t)length; - png_crc_read(png_ptr, (png_bytep)chunkdata, slength); - if (png_crc_finish(png_ptr, 0)) - { - png_free(png_ptr, chunkdata); - return; - } - - chunkdata[slength] = 0x00; - - for (text = chunkdata; *text; text++) - /* empty loop */ ; - - /* zTXt must have some text after the chunkdataword */ - if (text == chunkdata + slength) - { - comp_type = PNG_TEXT_COMPRESSION_NONE; - png_warning(png_ptr, "Zero length zTXt chunk"); - } - else - { - comp_type = *(++text); - if (comp_type != PNG_TEXT_COMPRESSION_zTXt) - { - png_warning(png_ptr, "Unknown compression type in zTXt chunk"); - comp_type = PNG_TEXT_COMPRESSION_zTXt; - } - text++; /* skip the compression_method byte */ - } - prefix_len = text - chunkdata; - - chunkdata = (png_charp)png_decompress_chunk(png_ptr, comp_type, chunkdata, - (png_size_t)length, prefix_len, &data_len); - - text_ptr = (png_textp)png_malloc_warn(png_ptr, - (png_uint_32)png_sizeof(png_text)); - if (text_ptr == NULL) - { - png_warning(png_ptr,"Not enough memory to process zTXt chunk."); - png_free(png_ptr, chunkdata); - return; - } - text_ptr->compression = comp_type; - text_ptr->key = chunkdata; -#ifdef PNG_iTXt_SUPPORTED - text_ptr->lang = NULL; - text_ptr->lang_key = NULL; - text_ptr->itxt_length = 0; -#endif - text_ptr->text = chunkdata + prefix_len; - text_ptr->text_length = data_len; - - ret=png_set_text_2(png_ptr, info_ptr, text_ptr, 1); - - png_free(png_ptr, text_ptr); - png_free(png_ptr, chunkdata); - if (ret) - png_error(png_ptr, "Insufficient memory to store zTXt chunk."); -} -#endif - -#if defined(PNG_READ_iTXt_SUPPORTED) -/* note: this does not correctly handle chunks that are > 64K under DOS */ -void /* PRIVATE */ -png_handle_iTXt(png_structp png_ptr, png_infop info_ptr, png_uint_32 length) -{ - png_textp text_ptr; - png_charp chunkdata; - png_charp key, lang, text, lang_key; - int comp_flag; - int comp_type = 0; - int ret; - png_size_t slength, prefix_len, data_len; - - png_debug(1, "in png_handle_iTXt\n"); - - if (!(png_ptr->mode & PNG_HAVE_IHDR)) - png_error(png_ptr, "Missing IHDR before iTXt"); - - if (png_ptr->mode & PNG_HAVE_IDAT) - png_ptr->mode |= PNG_AFTER_IDAT; - -#ifdef PNG_MAX_MALLOC_64K - /* We will no doubt have problems with chunks even half this size, but - there is no hard and fast rule to tell us where to stop. */ - if (length > (png_uint_32)65535L) - { - png_warning(png_ptr,"iTXt chunk too large to fit in memory"); - png_crc_finish(png_ptr, length); - return; - } -#endif - - chunkdata = (png_charp)png_malloc_warn(png_ptr, length + 1); - if (chunkdata == NULL) - { - png_warning(png_ptr, "No memory to process iTXt chunk."); - return; - } - slength = (png_size_t)length; - png_crc_read(png_ptr, (png_bytep)chunkdata, slength); - if (png_crc_finish(png_ptr, 0)) - { - png_free(png_ptr, chunkdata); - return; - } - - chunkdata[slength] = 0x00; - - for (lang = chunkdata; *lang; lang++) - /* empty loop */ ; - lang++; /* skip NUL separator */ - - /* iTXt must have a language tag (possibly empty), two compression bytes, - translated keyword (possibly empty), and possibly some text after the - keyword */ - - if (lang >= chunkdata + slength) - { - comp_flag = PNG_TEXT_COMPRESSION_NONE; - png_warning(png_ptr, "Zero length iTXt chunk"); - } - else - { - comp_flag = *lang++; - comp_type = *lang++; - } - - for (lang_key = lang; *lang_key; lang_key++) - /* empty loop */ ; - lang_key++; /* skip NUL separator */ - - for (text = lang_key; *text; text++) - /* empty loop */ ; - text++; /* skip NUL separator */ - - prefix_len = text - chunkdata; - - key=chunkdata; - if (comp_flag) - chunkdata = png_decompress_chunk(png_ptr, comp_type, chunkdata, - (size_t)length, prefix_len, &data_len); - else - data_len=png_strlen(chunkdata + prefix_len); - text_ptr = (png_textp)png_malloc_warn(png_ptr, - (png_uint_32)png_sizeof(png_text)); - if (text_ptr == NULL) - { - png_warning(png_ptr,"Not enough memory to process iTXt chunk."); - png_free(png_ptr, chunkdata); - return; - } - text_ptr->compression = (int)comp_flag + 1; - text_ptr->lang_key = chunkdata+(lang_key-key); - text_ptr->lang = chunkdata+(lang-key); - text_ptr->itxt_length = data_len; - text_ptr->text_length = 0; - text_ptr->key = chunkdata; - text_ptr->text = chunkdata + prefix_len; - - ret=png_set_text_2(png_ptr, info_ptr, text_ptr, 1); - - png_free(png_ptr, text_ptr); - png_free(png_ptr, chunkdata); - if (ret) - png_error(png_ptr, "Insufficient memory to store iTXt chunk."); -} -#endif - -/* This function is called when we haven't found a handler for a - chunk. If there isn't a problem with the chunk itself (ie bad - chunk name, CRC, or a critical chunk), the chunk is silently ignored - -- unless the PNG_FLAG_UNKNOWN_CHUNKS_SUPPORTED flag is on in which - case it will be saved away to be written out later. */ -void /* PRIVATE */ -png_handle_unknown(png_structp png_ptr, png_infop info_ptr, png_uint_32 length) -{ - png_uint_32 skip = 0; - - png_debug(1, "in png_handle_unknown\n"); - - if (png_ptr->mode & PNG_HAVE_IDAT) - { -#ifdef PNG_USE_LOCAL_ARRAYS - PNG_IDAT; -#endif - if (png_memcmp(png_ptr->chunk_name, png_IDAT, 4)) /* not an IDAT */ - png_ptr->mode |= PNG_AFTER_IDAT; - } - - png_check_chunk_name(png_ptr, png_ptr->chunk_name); - - if (!(png_ptr->chunk_name[0] & 0x20)) - { -#if defined(PNG_READ_UNKNOWN_CHUNKS_SUPPORTED) - if(png_handle_as_unknown(png_ptr, png_ptr->chunk_name) != - PNG_HANDLE_CHUNK_ALWAYS -#if defined(PNG_READ_USER_CHUNKS_SUPPORTED) - && png_ptr->read_user_chunk_fn == NULL -#endif - ) -#endif - png_chunk_error(png_ptr, "unknown critical chunk"); - } - -#if defined(PNG_READ_UNKNOWN_CHUNKS_SUPPORTED) - if (png_ptr->flags & PNG_FLAG_KEEP_UNKNOWN_CHUNKS) - { - png_unknown_chunk chunk; - -#ifdef PNG_MAX_MALLOC_64K - if (length > (png_uint_32)65535L) - { - png_warning(png_ptr, "unknown chunk too large to fit in memory"); - skip = length - (png_uint_32)65535L; - length = (png_uint_32)65535L; - } -#endif - png_strcpy((png_charp)chunk.name, (png_charp)png_ptr->chunk_name); - chunk.data = (png_bytep)png_malloc(png_ptr, length); - chunk.size = (png_size_t)length; - png_crc_read(png_ptr, (png_bytep)chunk.data, length); -#if defined(PNG_READ_USER_CHUNKS_SUPPORTED) - if(png_ptr->read_user_chunk_fn != NULL) - { - /* callback to user unknown chunk handler */ - if ((*(png_ptr->read_user_chunk_fn)) (png_ptr, &chunk) <= 0) - { - if (!(png_ptr->chunk_name[0] & 0x20)) - if(png_handle_as_unknown(png_ptr, png_ptr->chunk_name) != - PNG_HANDLE_CHUNK_ALWAYS) - { - png_free(png_ptr, chunk.data); - png_chunk_error(png_ptr, "unknown critical chunk"); - } - png_set_unknown_chunks(png_ptr, info_ptr, &chunk, 1); - } - } - else -#endif - png_set_unknown_chunks(png_ptr, info_ptr, &chunk, 1); - png_free(png_ptr, chunk.data); - } - else -#endif - skip = length; - - png_crc_finish(png_ptr, skip); - -#if !defined(PNG_READ_USER_CHUNKS_SUPPORTED) - if (&info_ptr == NULL) /* quiet compiler warnings about unused info_ptr */ - return; -#endif -} - -/* This function is called to verify that a chunk name is valid. - This function can't have the "critical chunk check" incorporated - into it, since in the future we will need to be able to call user - functions to handle unknown critical chunks after we check that - the chunk name itself is valid. */ - -#define isnonalpha(c) ((c) < 65 || (c) > 122 || ((c) > 90 && (c) < 97)) - -void /* PRIVATE */ -png_check_chunk_name(png_structp png_ptr, png_bytep chunk_name) -{ - png_debug(1, "in png_check_chunk_name\n"); - if (isnonalpha(chunk_name[0]) || isnonalpha(chunk_name[1]) || - isnonalpha(chunk_name[2]) || isnonalpha(chunk_name[3])) - { - png_chunk_error(png_ptr, "invalid chunk type"); - } -} - -/* Combines the row recently read in with the existing pixels in the - row. This routine takes care of alpha and transparency if requested. - This routine also handles the two methods of progressive display - of interlaced images, depending on the mask value. - The mask value describes which pixels are to be combined with - the row. The pattern always repeats every 8 pixels, so just 8 - bits are needed. A one indicates the pixel is to be combined, - a zero indicates the pixel is to be skipped. This is in addition - to any alpha or transparency value associated with the pixel. If - you want all pixels to be combined, pass 0xff (255) in mask. */ -#ifndef PNG_HAVE_ASSEMBLER_COMBINE_ROW -void /* PRIVATE */ -png_combine_row(png_structp png_ptr, png_bytep row, int mask) -{ - png_debug(1,"in png_combine_row\n"); - if (mask == 0xff) - { - png_memcpy(row, png_ptr->row_buf + 1, - PNG_ROWBYTES(png_ptr->row_info.pixel_depth, png_ptr->width)); - } - else - { - switch (png_ptr->row_info.pixel_depth) - { - case 1: - { - png_bytep sp = png_ptr->row_buf + 1; - png_bytep dp = row; - int s_inc, s_start, s_end; - int m = 0x80; - int shift; - png_uint_32 i; - png_uint_32 row_width = png_ptr->width; - -#if defined(PNG_READ_PACKSWAP_SUPPORTED) - if (png_ptr->transformations & PNG_PACKSWAP) - { - s_start = 0; - s_end = 7; - s_inc = 1; - } - else -#endif - { - s_start = 7; - s_end = 0; - s_inc = -1; - } - - shift = s_start; - - for (i = 0; i < row_width; i++) - { - if (m & mask) - { - int value; - - value = (*sp >> shift) & 0x01; - *dp &= (png_byte)((0x7f7f >> (7 - shift)) & 0xff); - *dp |= (png_byte)(value << shift); - } - - if (shift == s_end) - { - shift = s_start; - sp++; - dp++; - } - else - shift += s_inc; - - if (m == 1) - m = 0x80; - else - m >>= 1; - } - break; - } - case 2: - { - png_bytep sp = png_ptr->row_buf + 1; - png_bytep dp = row; - int s_start, s_end, s_inc; - int m = 0x80; - int shift; - png_uint_32 i; - png_uint_32 row_width = png_ptr->width; - int value; - -#if defined(PNG_READ_PACKSWAP_SUPPORTED) - if (png_ptr->transformations & PNG_PACKSWAP) - { - s_start = 0; - s_end = 6; - s_inc = 2; - } - else -#endif - { - s_start = 6; - s_end = 0; - s_inc = -2; - } - - shift = s_start; - - for (i = 0; i < row_width; i++) - { - if (m & mask) - { - value = (*sp >> shift) & 0x03; - *dp &= (png_byte)((0x3f3f >> (6 - shift)) & 0xff); - *dp |= (png_byte)(value << shift); - } - - if (shift == s_end) - { - shift = s_start; - sp++; - dp++; - } - else - shift += s_inc; - if (m == 1) - m = 0x80; - else - m >>= 1; - } - break; - } - case 4: - { - png_bytep sp = png_ptr->row_buf + 1; - png_bytep dp = row; - int s_start, s_end, s_inc; - int m = 0x80; - int shift; - png_uint_32 i; - png_uint_32 row_width = png_ptr->width; - int value; - -#if defined(PNG_READ_PACKSWAP_SUPPORTED) - if (png_ptr->transformations & PNG_PACKSWAP) - { - s_start = 0; - s_end = 4; - s_inc = 4; - } - else -#endif - { - s_start = 4; - s_end = 0; - s_inc = -4; - } - shift = s_start; - - for (i = 0; i < row_width; i++) - { - if (m & mask) - { - value = (*sp >> shift) & 0xf; - *dp &= (png_byte)((0xf0f >> (4 - shift)) & 0xff); - *dp |= (png_byte)(value << shift); - } - - if (shift == s_end) - { - shift = s_start; - sp++; - dp++; - } - else - shift += s_inc; - if (m == 1) - m = 0x80; - else - m >>= 1; - } - break; - } - default: - { - png_bytep sp = png_ptr->row_buf + 1; - png_bytep dp = row; - png_size_t pixel_bytes = (png_ptr->row_info.pixel_depth >> 3); - png_uint_32 i; - png_uint_32 row_width = png_ptr->width; - png_byte m = 0x80; - - - for (i = 0; i < row_width; i++) - { - if (m & mask) - { - png_memcpy(dp, sp, pixel_bytes); - } - - sp += pixel_bytes; - dp += pixel_bytes; - - if (m == 1) - m = 0x80; - else - m >>= 1; - } - break; - } - } - } -} -#endif /* !PNG_HAVE_ASSEMBLER_COMBINE_ROW */ - -#ifdef PNG_READ_INTERLACING_SUPPORTED -#ifndef PNG_HAVE_ASSEMBLER_READ_INTERLACE /* else in pngvcrd.c, pnggccrd.c */ -/* OLD pre-1.0.9 interface: -void png_do_read_interlace(png_row_infop row_info, png_bytep row, int pass, - png_uint_32 transformations) - */ -void /* PRIVATE */ -png_do_read_interlace(png_structp png_ptr) -{ - png_row_infop row_info = &(png_ptr->row_info); - png_bytep row = png_ptr->row_buf + 1; - int pass = png_ptr->pass; - png_uint_32 transformations = png_ptr->transformations; -#ifdef PNG_USE_LOCAL_ARRAYS - /* arrays to facilitate easy interlacing - use pass (0 - 6) as index */ - /* offset to next interlace block */ - const int png_pass_inc[7] = {8, 8, 4, 4, 2, 2, 1}; -#endif - - png_debug(1,"in png_do_read_interlace (stock C version)\n"); - if (row != NULL && row_info != NULL) - { - png_uint_32 final_width; - - final_width = row_info->width * png_pass_inc[pass]; - - switch (row_info->pixel_depth) - { - case 1: - { - png_bytep sp = row + (png_size_t)((row_info->width - 1) >> 3); - png_bytep dp = row + (png_size_t)((final_width - 1) >> 3); - int sshift, dshift; - int s_start, s_end, s_inc; - int jstop = png_pass_inc[pass]; - png_byte v; - png_uint_32 i; - int j; - -#if defined(PNG_READ_PACKSWAP_SUPPORTED) - if (transformations & PNG_PACKSWAP) - { - sshift = (int)((row_info->width + 7) & 0x07); - dshift = (int)((final_width + 7) & 0x07); - s_start = 7; - s_end = 0; - s_inc = -1; - } - else -#endif - { - sshift = 7 - (int)((row_info->width + 7) & 0x07); - dshift = 7 - (int)((final_width + 7) & 0x07); - s_start = 0; - s_end = 7; - s_inc = 1; - } - - for (i = 0; i < row_info->width; i++) - { - v = (png_byte)((*sp >> sshift) & 0x01); - for (j = 0; j < jstop; j++) - { - *dp &= (png_byte)((0x7f7f >> (7 - dshift)) & 0xff); - *dp |= (png_byte)(v << dshift); - if (dshift == s_end) - { - dshift = s_start; - dp--; - } - else - dshift += s_inc; - } - if (sshift == s_end) - { - sshift = s_start; - sp--; - } - else - sshift += s_inc; - } - break; - } - case 2: - { - png_bytep sp = row + (png_uint_32)((row_info->width - 1) >> 2); - png_bytep dp = row + (png_uint_32)((final_width - 1) >> 2); - int sshift, dshift; - int s_start, s_end, s_inc; - int jstop = png_pass_inc[pass]; - png_uint_32 i; - -#if defined(PNG_READ_PACKSWAP_SUPPORTED) - if (transformations & PNG_PACKSWAP) - { - sshift = (int)(((row_info->width + 3) & 0x03) << 1); - dshift = (int)(((final_width + 3) & 0x03) << 1); - s_start = 6; - s_end = 0; - s_inc = -2; - } - else -#endif - { - sshift = (int)((3 - ((row_info->width + 3) & 0x03)) << 1); - dshift = (int)((3 - ((final_width + 3) & 0x03)) << 1); - s_start = 0; - s_end = 6; - s_inc = 2; - } - - for (i = 0; i < row_info->width; i++) - { - png_byte v; - int j; - - v = (png_byte)((*sp >> sshift) & 0x03); - for (j = 0; j < jstop; j++) - { - *dp &= (png_byte)((0x3f3f >> (6 - dshift)) & 0xff); - *dp |= (png_byte)(v << dshift); - if (dshift == s_end) - { - dshift = s_start; - dp--; - } - else - dshift += s_inc; - } - if (sshift == s_end) - { - sshift = s_start; - sp--; - } - else - sshift += s_inc; - } - break; - } - case 4: - { - png_bytep sp = row + (png_size_t)((row_info->width - 1) >> 1); - png_bytep dp = row + (png_size_t)((final_width - 1) >> 1); - int sshift, dshift; - int s_start, s_end, s_inc; - png_uint_32 i; - int jstop = png_pass_inc[pass]; - -#if defined(PNG_READ_PACKSWAP_SUPPORTED) - if (transformations & PNG_PACKSWAP) - { - sshift = (int)(((row_info->width + 1) & 0x01) << 2); - dshift = (int)(((final_width + 1) & 0x01) << 2); - s_start = 4; - s_end = 0; - s_inc = -4; - } - else -#endif - { - sshift = (int)((1 - ((row_info->width + 1) & 0x01)) << 2); - dshift = (int)((1 - ((final_width + 1) & 0x01)) << 2); - s_start = 0; - s_end = 4; - s_inc = 4; - } - - for (i = 0; i < row_info->width; i++) - { - png_byte v = (png_byte)((*sp >> sshift) & 0xf); - int j; - - for (j = 0; j < jstop; j++) - { - *dp &= (png_byte)((0xf0f >> (4 - dshift)) & 0xff); - *dp |= (png_byte)(v << dshift); - if (dshift == s_end) - { - dshift = s_start; - dp--; - } - else - dshift += s_inc; - } - if (sshift == s_end) - { - sshift = s_start; - sp--; - } - else - sshift += s_inc; - } - break; - } - default: - { - png_size_t pixel_bytes = (row_info->pixel_depth >> 3); - png_bytep sp = row + (png_size_t)(row_info->width - 1) * pixel_bytes; - png_bytep dp = row + (png_size_t)(final_width - 1) * pixel_bytes; - - int jstop = png_pass_inc[pass]; - png_uint_32 i; - - for (i = 0; i < row_info->width; i++) - { - png_byte v[8]; - int j; - - png_memcpy(v, sp, pixel_bytes); - for (j = 0; j < jstop; j++) - { - png_memcpy(dp, v, pixel_bytes); - dp -= pixel_bytes; - } - sp -= pixel_bytes; - } - break; - } - } - row_info->width = final_width; - row_info->rowbytes = PNG_ROWBYTES(row_info->pixel_depth,final_width); - } -#if !defined(PNG_READ_PACKSWAP_SUPPORTED) - if (&transformations == NULL) /* silence compiler warning */ - return; -#endif -} -#endif /* !PNG_HAVE_ASSEMBLER_READ_INTERLACE */ -#endif /* PNG_READ_INTERLACING_SUPPORTED */ - -#ifndef PNG_HAVE_ASSEMBLER_READ_FILTER_ROW -void /* PRIVATE */ -png_read_filter_row(png_structp png_ptr, png_row_infop row_info, png_bytep row, - png_bytep prev_row, int filter) -{ - png_debug(1, "in png_read_filter_row\n"); - png_debug2(2,"row = %lu, filter = %d\n", png_ptr->row_number, filter); - switch (filter) - { - case PNG_FILTER_VALUE_NONE: - break; - case PNG_FILTER_VALUE_SUB: - { - png_uint_32 i; - png_uint_32 istop = row_info->rowbytes; - png_uint_32 bpp = (row_info->pixel_depth + 7) >> 3; - png_bytep rp = row + bpp; - png_bytep lp = row; - - for (i = bpp; i < istop; i++) - { - *rp = (png_byte)(((int)(*rp) + (int)(*lp++)) & 0xff); - rp++; - } - break; - } - case PNG_FILTER_VALUE_UP: - { - png_uint_32 i; - png_uint_32 istop = row_info->rowbytes; - png_bytep rp = row; - png_bytep pp = prev_row; - - for (i = 0; i < istop; i++) - { - *rp = (png_byte)(((int)(*rp) + (int)(*pp++)) & 0xff); - rp++; - } - break; - } - case PNG_FILTER_VALUE_AVG: - { - png_uint_32 i; - png_bytep rp = row; - png_bytep pp = prev_row; - png_bytep lp = row; - png_uint_32 bpp = (row_info->pixel_depth + 7) >> 3; - png_uint_32 istop = row_info->rowbytes - bpp; - - for (i = 0; i < bpp; i++) - { - *rp = (png_byte)(((int)(*rp) + - ((int)(*pp++) / 2 )) & 0xff); - rp++; - } - - for (i = 0; i < istop; i++) - { - *rp = (png_byte)(((int)(*rp) + - (int)(*pp++ + *lp++) / 2 ) & 0xff); - rp++; - } - break; - } - case PNG_FILTER_VALUE_PAETH: - { - png_uint_32 i; - png_bytep rp = row; - png_bytep pp = prev_row; - png_bytep lp = row; - png_bytep cp = prev_row; - png_uint_32 bpp = (row_info->pixel_depth + 7) >> 3; - png_uint_32 istop=row_info->rowbytes - bpp; - - for (i = 0; i < bpp; i++) - { - *rp = (png_byte)(((int)(*rp) + (int)(*pp++)) & 0xff); - rp++; - } - - for (i = 0; i < istop; i++) /* use leftover rp,pp */ - { - int a, b, c, pa, pb, pc, p; - - a = *lp++; - b = *pp++; - c = *cp++; - - p = b - c; - pc = a - c; - -#ifdef PNG_USE_ABS - pa = abs(p); - pb = abs(pc); - pc = abs(p + pc); -#else - pa = p < 0 ? -p : p; - pb = pc < 0 ? -pc : pc; - pc = (p + pc) < 0 ? -(p + pc) : p + pc; -#endif - - /* - if (pa <= pb && pa <= pc) - p = a; - else if (pb <= pc) - p = b; - else - p = c; - */ - - p = (pa <= pb && pa <=pc) ? a : (pb <= pc) ? b : c; - - *rp = (png_byte)(((int)(*rp) + p) & 0xff); - rp++; - } - break; - } - default: - png_warning(png_ptr, "Ignoring bad adaptive filter type"); - *row=0; - break; - } -} -#endif /* !PNG_HAVE_ASSEMBLER_READ_FILTER_ROW */ - -void /* PRIVATE */ -png_read_finish_row(png_structp png_ptr) -{ -#ifdef PNG_USE_LOCAL_ARRAYS - /* arrays to facilitate easy interlacing - use pass (0 - 6) as index */ - - /* start of interlace block */ - const int png_pass_start[7] = {0, 4, 0, 2, 0, 1, 0}; - - /* offset to next interlace block */ - const int png_pass_inc[7] = {8, 8, 4, 4, 2, 2, 1}; - - /* start of interlace block in the y direction */ - const int png_pass_ystart[7] = {0, 0, 4, 0, 2, 0, 1}; - - /* offset to next interlace block in the y direction */ - const int png_pass_yinc[7] = {8, 8, 8, 4, 4, 2, 2}; -#endif - - png_debug(1, "in png_read_finish_row\n"); - png_ptr->row_number++; - if (png_ptr->row_number < png_ptr->num_rows) - return; - - if (png_ptr->interlaced) - { - png_ptr->row_number = 0; - png_memset_check(png_ptr, png_ptr->prev_row, 0, png_ptr->rowbytes + 1); - do - { - png_ptr->pass++; - if (png_ptr->pass >= 7) - break; - png_ptr->iwidth = (png_ptr->width + - png_pass_inc[png_ptr->pass] - 1 - - png_pass_start[png_ptr->pass]) / - png_pass_inc[png_ptr->pass]; - - png_ptr->irowbytes = PNG_ROWBYTES(png_ptr->pixel_depth, - png_ptr->iwidth) + 1; - - if (!(png_ptr->transformations & PNG_INTERLACE)) - { - png_ptr->num_rows = (png_ptr->height + - png_pass_yinc[png_ptr->pass] - 1 - - png_pass_ystart[png_ptr->pass]) / - png_pass_yinc[png_ptr->pass]; - if (!(png_ptr->num_rows)) - continue; - } - else /* if (png_ptr->transformations & PNG_INTERLACE) */ - break; - } while (png_ptr->iwidth == 0); - - if (png_ptr->pass < 7) - return; - } - - if (!(png_ptr->flags & PNG_FLAG_ZLIB_FINISHED)) - { -#ifdef PNG_USE_LOCAL_ARRAYS - PNG_IDAT; -#endif - char extra; - int ret; - - png_ptr->zstream.next_out = (Byte *)&extra; - png_ptr->zstream.avail_out = (uInt)1; - for(;;) - { - if (!(png_ptr->zstream.avail_in)) - { - while (!png_ptr->idat_size) - { - png_byte chunk_length[4]; - - png_crc_finish(png_ptr, 0); - - png_read_data(png_ptr, chunk_length, 4); - png_ptr->idat_size = png_get_uint_31(png_ptr, chunk_length); - png_reset_crc(png_ptr); - png_crc_read(png_ptr, png_ptr->chunk_name, 4); - if (png_memcmp(png_ptr->chunk_name, (png_bytep)png_IDAT, 4)) - png_error(png_ptr, "Not enough image data"); - - } - png_ptr->zstream.avail_in = (uInt)png_ptr->zbuf_size; - png_ptr->zstream.next_in = png_ptr->zbuf; - if (png_ptr->zbuf_size > png_ptr->idat_size) - png_ptr->zstream.avail_in = (uInt)png_ptr->idat_size; - png_crc_read(png_ptr, png_ptr->zbuf, png_ptr->zstream.avail_in); - png_ptr->idat_size -= png_ptr->zstream.avail_in; - } - ret = inflate(&png_ptr->zstream, Z_PARTIAL_FLUSH); - if (ret == Z_STREAM_END) - { - if (!(png_ptr->zstream.avail_out) || png_ptr->zstream.avail_in || - png_ptr->idat_size) - png_warning(png_ptr, "Extra compressed data"); - png_ptr->mode |= PNG_AFTER_IDAT; - png_ptr->flags |= PNG_FLAG_ZLIB_FINISHED; - break; - } - if (ret != Z_OK) - png_error(png_ptr, png_ptr->zstream.msg ? png_ptr->zstream.msg : - "Decompression Error"); - - if (!(png_ptr->zstream.avail_out)) - { - png_warning(png_ptr, "Extra compressed data."); - png_ptr->mode |= PNG_AFTER_IDAT; - png_ptr->flags |= PNG_FLAG_ZLIB_FINISHED; - break; - } - - } - png_ptr->zstream.avail_out = 0; - } - - if (png_ptr->idat_size || png_ptr->zstream.avail_in) - png_warning(png_ptr, "Extra compression data"); - - inflateReset(&png_ptr->zstream); - - png_ptr->mode |= PNG_AFTER_IDAT; -} - -void /* PRIVATE */ -png_read_start_row(png_structp png_ptr) -{ -#ifdef PNG_USE_LOCAL_ARRAYS - /* arrays to facilitate easy interlacing - use pass (0 - 6) as index */ - - /* start of interlace block */ - const int png_pass_start[7] = {0, 4, 0, 2, 0, 1, 0}; - - /* offset to next interlace block */ - const int png_pass_inc[7] = {8, 8, 4, 4, 2, 2, 1}; - - /* start of interlace block in the y direction */ - const int png_pass_ystart[7] = {0, 0, 4, 0, 2, 0, 1}; - - /* offset to next interlace block in the y direction */ - const int png_pass_yinc[7] = {8, 8, 8, 4, 4, 2, 2}; -#endif - - int max_pixel_depth; - png_uint_32 row_bytes; - - png_debug(1, "in png_read_start_row\n"); - png_ptr->zstream.avail_in = 0; - png_init_read_transformations(png_ptr); - if (png_ptr->interlaced) - { - if (!(png_ptr->transformations & PNG_INTERLACE)) - png_ptr->num_rows = (png_ptr->height + png_pass_yinc[0] - 1 - - png_pass_ystart[0]) / png_pass_yinc[0]; - else - png_ptr->num_rows = png_ptr->height; - - png_ptr->iwidth = (png_ptr->width + - png_pass_inc[png_ptr->pass] - 1 - - png_pass_start[png_ptr->pass]) / - png_pass_inc[png_ptr->pass]; - - row_bytes = PNG_ROWBYTES(png_ptr->pixel_depth,png_ptr->iwidth) + 1; - - png_ptr->irowbytes = (png_size_t)row_bytes; - if((png_uint_32)png_ptr->irowbytes != row_bytes) - png_error(png_ptr, "Rowbytes overflow in png_read_start_row"); - } - else - { - png_ptr->num_rows = png_ptr->height; - png_ptr->iwidth = png_ptr->width; - png_ptr->irowbytes = png_ptr->rowbytes + 1; - } - max_pixel_depth = png_ptr->pixel_depth; - -#if defined(PNG_READ_PACK_SUPPORTED) - if ((png_ptr->transformations & PNG_PACK) && png_ptr->bit_depth < 8) - max_pixel_depth = 8; -#endif - -#if defined(PNG_READ_EXPAND_SUPPORTED) - if (png_ptr->transformations & PNG_EXPAND) - { - if (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE) - { - if (png_ptr->num_trans) - max_pixel_depth = 32; - else - max_pixel_depth = 24; - } - else if (png_ptr->color_type == PNG_COLOR_TYPE_GRAY) - { - if (max_pixel_depth < 8) - max_pixel_depth = 8; - if (png_ptr->num_trans) - max_pixel_depth *= 2; - } - else if (png_ptr->color_type == PNG_COLOR_TYPE_RGB) - { - if (png_ptr->num_trans) - { - max_pixel_depth *= 4; - max_pixel_depth /= 3; - } - } - } -#endif - -#if defined(PNG_READ_FILLER_SUPPORTED) - if (png_ptr->transformations & (PNG_FILLER)) - { - if (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE) - max_pixel_depth = 32; - else if (png_ptr->color_type == PNG_COLOR_TYPE_GRAY) - { - if (max_pixel_depth <= 8) - max_pixel_depth = 16; - else - max_pixel_depth = 32; - } - else if (png_ptr->color_type == PNG_COLOR_TYPE_RGB) - { - if (max_pixel_depth <= 32) - max_pixel_depth = 32; - else - max_pixel_depth = 64; - } - } -#endif - -#if defined(PNG_READ_GRAY_TO_RGB_SUPPORTED) - if (png_ptr->transformations & PNG_GRAY_TO_RGB) - { - if ( -#if defined(PNG_READ_EXPAND_SUPPORTED) - (png_ptr->num_trans && (png_ptr->transformations & PNG_EXPAND)) || -#endif -#if defined(PNG_READ_FILLER_SUPPORTED) - (png_ptr->transformations & (PNG_FILLER)) || -#endif - png_ptr->color_type == PNG_COLOR_TYPE_GRAY_ALPHA) - { - if (max_pixel_depth <= 16) - max_pixel_depth = 32; - else - max_pixel_depth = 64; - } - else - { - if (max_pixel_depth <= 8) - { - if (png_ptr->color_type == PNG_COLOR_TYPE_RGB_ALPHA) - max_pixel_depth = 32; - else - max_pixel_depth = 24; - } - else if (png_ptr->color_type == PNG_COLOR_TYPE_RGB_ALPHA) - max_pixel_depth = 64; - else - max_pixel_depth = 48; - } - } -#endif - -#if defined(PNG_READ_USER_TRANSFORM_SUPPORTED) && \ -defined(PNG_USER_TRANSFORM_PTR_SUPPORTED) - if(png_ptr->transformations & PNG_USER_TRANSFORM) - { - int user_pixel_depth=png_ptr->user_transform_depth* - png_ptr->user_transform_channels; - if(user_pixel_depth > max_pixel_depth) - max_pixel_depth=user_pixel_depth; - } -#endif - - /* align the width on the next larger 8 pixels. Mainly used - for interlacing */ - row_bytes = ((png_ptr->width + 7) & ~((png_uint_32)7)); - /* calculate the maximum bytes needed, adding a byte and a pixel - for safety's sake */ - row_bytes = PNG_ROWBYTES(max_pixel_depth,row_bytes) + - 1 + ((max_pixel_depth + 7) >> 3); -#ifdef PNG_MAX_MALLOC_64K - if (row_bytes > (png_uint_32)65536L) - png_error(png_ptr, "This image requires a row greater than 64KB"); -#endif - png_ptr->big_row_buf = (png_bytep)png_malloc(png_ptr, row_bytes+64); - png_ptr->row_buf = png_ptr->big_row_buf+32; -#if defined(PNG_DEBUG) && defined(PNG_USE_PNGGCCRD) - png_ptr->row_buf_size = row_bytes; -#endif - -#ifdef PNG_MAX_MALLOC_64K - if ((png_uint_32)png_ptr->rowbytes + 1 > (png_uint_32)65536L) - png_error(png_ptr, "This image requires a row greater than 64KB"); -#endif - if ((png_uint_32)png_ptr->rowbytes + 1 > PNG_SIZE_MAX) - png_error(png_ptr, "Row has too many bytes to allocate in memory."); - png_ptr->prev_row = (png_bytep)png_malloc(png_ptr, (png_uint_32)( - png_ptr->rowbytes + 1)); - - png_memset_check(png_ptr, png_ptr->prev_row, 0, png_ptr->rowbytes + 1); - - png_debug1(3, "width = %lu,\n", png_ptr->width); - png_debug1(3, "height = %lu,\n", png_ptr->height); - png_debug1(3, "iwidth = %lu,\n", png_ptr->iwidth); - png_debug1(3, "num_rows = %lu\n", png_ptr->num_rows); - png_debug1(3, "rowbytes = %lu,\n", png_ptr->rowbytes); - png_debug1(3, "irowbytes = %lu,\n", png_ptr->irowbytes); - - png_ptr->flags |= PNG_FLAG_ROW_INIT; -} diff --git a/wxWidgets/src/png/pngset.c b/wxWidgets/src/png/pngset.c deleted file mode 100644 index b9677a12dd..0000000000 --- a/wxWidgets/src/png/pngset.c +++ /dev/null @@ -1,1219 +0,0 @@ - -/* pngset.c - storage of image information into info struct - * - * libpng 1.2.7 - September 12, 2004 - * For conditions of distribution and use, see copyright notice in png.h - * Copyright (c) 1998-2004 Glenn Randers-Pehrson - * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) - * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) - * - * The functions here are used during reads to store data from the file - * into the info struct, and during writes to store application data - * into the info struct for writing into the file. This abstracts the - * info struct and allows us to change the structure in the future. - */ - -#define PNG_INTERNAL -#include "png.h" - -#if defined(PNG_bKGD_SUPPORTED) -void PNGAPI -png_set_bKGD(png_structp png_ptr, png_infop info_ptr, png_color_16p background) -{ - png_debug1(1, "in %s storage function\n", "bKGD"); - if (png_ptr == NULL || info_ptr == NULL) - return; - - png_memcpy(&(info_ptr->background), background, png_sizeof(png_color_16)); - info_ptr->valid |= PNG_INFO_bKGD; -} -#endif - -#if defined(PNG_cHRM_SUPPORTED) -#ifdef PNG_FLOATING_POINT_SUPPORTED -void PNGAPI -png_set_cHRM(png_structp png_ptr, png_infop info_ptr, - double white_x, double white_y, double red_x, double red_y, - double green_x, double green_y, double blue_x, double blue_y) -{ - png_debug1(1, "in %s storage function\n", "cHRM"); - if (png_ptr == NULL || info_ptr == NULL) - return; - - if (white_x < 0.0 || white_y < 0.0 || - red_x < 0.0 || red_y < 0.0 || - green_x < 0.0 || green_y < 0.0 || - blue_x < 0.0 || blue_y < 0.0) - { - png_warning(png_ptr, - "Ignoring attempt to set negative chromaticity value"); - return; - } - if (white_x > 21474.83 || white_y > 21474.83 || - red_x > 21474.83 || red_y > 21474.83 || - green_x > 21474.83 || green_y > 21474.83 || - blue_x > 21474.83 || blue_y > 21474.83) - { - png_warning(png_ptr, - "Ignoring attempt to set chromaticity value exceeding 21474.83"); - return; - } - - info_ptr->x_white = (float)white_x; - info_ptr->y_white = (float)white_y; - info_ptr->x_red = (float)red_x; - info_ptr->y_red = (float)red_y; - info_ptr->x_green = (float)green_x; - info_ptr->y_green = (float)green_y; - info_ptr->x_blue = (float)blue_x; - info_ptr->y_blue = (float)blue_y; -#ifdef PNG_FIXED_POINT_SUPPORTED - info_ptr->int_x_white = (png_fixed_point)(white_x*100000.+0.5); - info_ptr->int_y_white = (png_fixed_point)(white_y*100000.+0.5); - info_ptr->int_x_red = (png_fixed_point)( red_x*100000.+0.5); - info_ptr->int_y_red = (png_fixed_point)( red_y*100000.+0.5); - info_ptr->int_x_green = (png_fixed_point)(green_x*100000.+0.5); - info_ptr->int_y_green = (png_fixed_point)(green_y*100000.+0.5); - info_ptr->int_x_blue = (png_fixed_point)( blue_x*100000.+0.5); - info_ptr->int_y_blue = (png_fixed_point)( blue_y*100000.+0.5); -#endif - info_ptr->valid |= PNG_INFO_cHRM; -} -#endif -#ifdef PNG_FIXED_POINT_SUPPORTED -void PNGAPI -png_set_cHRM_fixed(png_structp png_ptr, png_infop info_ptr, - png_fixed_point white_x, png_fixed_point white_y, png_fixed_point red_x, - png_fixed_point red_y, png_fixed_point green_x, png_fixed_point green_y, - png_fixed_point blue_x, png_fixed_point blue_y) -{ - png_debug1(1, "in %s storage function\n", "cHRM"); - if (png_ptr == NULL || info_ptr == NULL) - return; - - if (white_x < 0 || white_y < 0 || - red_x < 0 || red_y < 0 || - green_x < 0 || green_y < 0 || - blue_x < 0 || blue_y < 0) - { - png_warning(png_ptr, - "Ignoring attempt to set negative chromaticity value"); - return; - } - if (white_x > (double) PNG_UINT_31_MAX || - white_y > (double) PNG_UINT_31_MAX || - red_x > (double) PNG_UINT_31_MAX || - red_y > (double) PNG_UINT_31_MAX || - green_x > (double) PNG_UINT_31_MAX || - green_y > (double) PNG_UINT_31_MAX || - blue_x > (double) PNG_UINT_31_MAX || - blue_y > (double) PNG_UINT_31_MAX) - { - png_warning(png_ptr, - "Ignoring attempt to set chromaticity value exceeding 21474.83"); - return; - } - info_ptr->int_x_white = white_x; - info_ptr->int_y_white = white_y; - info_ptr->int_x_red = red_x; - info_ptr->int_y_red = red_y; - info_ptr->int_x_green = green_x; - info_ptr->int_y_green = green_y; - info_ptr->int_x_blue = blue_x; - info_ptr->int_y_blue = blue_y; -#ifdef PNG_FLOATING_POINT_SUPPORTED - info_ptr->x_white = (float)(white_x/100000.); - info_ptr->y_white = (float)(white_y/100000.); - info_ptr->x_red = (float)( red_x/100000.); - info_ptr->y_red = (float)( red_y/100000.); - info_ptr->x_green = (float)(green_x/100000.); - info_ptr->y_green = (float)(green_y/100000.); - info_ptr->x_blue = (float)( blue_x/100000.); - info_ptr->y_blue = (float)( blue_y/100000.); -#endif - info_ptr->valid |= PNG_INFO_cHRM; -} -#endif -#endif - -#if defined(PNG_gAMA_SUPPORTED) -#ifdef PNG_FLOATING_POINT_SUPPORTED -void PNGAPI -png_set_gAMA(png_structp png_ptr, png_infop info_ptr, double file_gamma) -{ - double gamma; - png_debug1(1, "in %s storage function\n", "gAMA"); - if (png_ptr == NULL || info_ptr == NULL) - return; - - /* Check for overflow */ - if (file_gamma > 21474.83) - { - png_warning(png_ptr, "Limiting gamma to 21474.83"); - gamma=21474.83; - } - else - gamma=file_gamma; - info_ptr->gamma = (float)gamma; -#ifdef PNG_FIXED_POINT_SUPPORTED - info_ptr->int_gamma = (int)(gamma*100000.+.5); -#endif - info_ptr->valid |= PNG_INFO_gAMA; - if(gamma == 0.0) - png_warning(png_ptr, "Setting gamma=0"); -} -#endif -void PNGAPI -png_set_gAMA_fixed(png_structp png_ptr, png_infop info_ptr, png_fixed_point - int_gamma) -{ - png_fixed_point gamma; - - png_debug1(1, "in %s storage function\n", "gAMA"); - if (png_ptr == NULL || info_ptr == NULL) - return; - - if (int_gamma > (png_fixed_point) PNG_UINT_31_MAX) - { - png_warning(png_ptr, "Limiting gamma to 21474.83"); - gamma=PNG_UINT_31_MAX; - } - else - { - if (int_gamma < 0) - { - png_warning(png_ptr, "Setting negative gamma to zero"); - gamma=0; - } - else - gamma=int_gamma; - } -#ifdef PNG_FLOATING_POINT_SUPPORTED - info_ptr->gamma = (float)(gamma/100000.); -#endif -#ifdef PNG_FIXED_POINT_SUPPORTED - info_ptr->int_gamma = gamma; -#endif - info_ptr->valid |= PNG_INFO_gAMA; - if(gamma == 0) - png_warning(png_ptr, "Setting gamma=0"); -} -#endif - -#if defined(PNG_hIST_SUPPORTED) -void PNGAPI -png_set_hIST(png_structp png_ptr, png_infop info_ptr, png_uint_16p hist) -{ - int i; - - png_debug1(1, "in %s storage function\n", "hIST"); - if (png_ptr == NULL || info_ptr == NULL) - return; - if (info_ptr->num_palette == 0) - { - png_warning(png_ptr, - "Palette size 0, hIST allocation skipped."); - return; - } - -#ifdef PNG_FREE_ME_SUPPORTED - png_free_data(png_ptr, info_ptr, PNG_FREE_HIST, 0); -#endif - /* Changed from info->num_palette to 256 in version 1.2.1 */ - png_ptr->hist = (png_uint_16p)png_malloc_warn(png_ptr, - (png_uint_32)(256 * png_sizeof (png_uint_16))); - if (png_ptr->hist == NULL) - { - png_warning(png_ptr, "Insufficient memory for hIST chunk data."); - return; - } - - for (i = 0; i < info_ptr->num_palette; i++) - png_ptr->hist[i] = hist[i]; - info_ptr->hist = png_ptr->hist; - info_ptr->valid |= PNG_INFO_hIST; - -#ifdef PNG_FREE_ME_SUPPORTED - info_ptr->free_me |= PNG_FREE_HIST; -#else - png_ptr->flags |= PNG_FLAG_FREE_HIST; -#endif -} -#endif - -void PNGAPI -png_set_IHDR(png_structp png_ptr, png_infop info_ptr, - png_uint_32 width, png_uint_32 height, int bit_depth, - int color_type, int interlace_type, int compression_type, - int filter_type) -{ - png_debug1(1, "in %s storage function\n", "IHDR"); - if (png_ptr == NULL || info_ptr == NULL) - return; - - /* check for width and height valid values */ - if (width == 0 || height == 0) - png_error(png_ptr, "Image width or height is zero in IHDR"); -#ifdef PNG_SET_USER_LIMITS_SUPPORTED - if (width > png_ptr->user_width_max || height > png_ptr->user_height_max) - png_error(png_ptr, "image size exceeds user limits in IHDR"); -#else - if (width > PNG_USER_WIDTH_MAX || height > PNG_USER_HEIGHT_MAX) - png_error(png_ptr, "image size exceeds user limits in IHDR"); -#endif - if (width > PNG_UINT_31_MAX || height > PNG_UINT_31_MAX) - png_error(png_ptr, "Invalid image size in IHDR"); - if ( width > (PNG_UINT_32_MAX - >> 3) /* 8-byte RGBA pixels */ - - 64 /* bigrowbuf hack */ - - 1 /* filter byte */ - - 7*8 /* rounding of width to multiple of 8 pixels */ - - 8) /* extra max_pixel_depth pad */ - png_warning(png_ptr, "Width is too large for libpng to process pixels"); - - /* check other values */ - if (bit_depth != 1 && bit_depth != 2 && bit_depth != 4 && - bit_depth != 8 && bit_depth != 16) - png_error(png_ptr, "Invalid bit depth in IHDR"); - - if (color_type < 0 || color_type == 1 || - color_type == 5 || color_type > 6) - png_error(png_ptr, "Invalid color type in IHDR"); - - if (((color_type == PNG_COLOR_TYPE_PALETTE) && bit_depth > 8) || - ((color_type == PNG_COLOR_TYPE_RGB || - color_type == PNG_COLOR_TYPE_GRAY_ALPHA || - color_type == PNG_COLOR_TYPE_RGB_ALPHA) && bit_depth < 8)) - png_error(png_ptr, "Invalid color type/bit depth combination in IHDR"); - - if (interlace_type >= PNG_INTERLACE_LAST) - png_error(png_ptr, "Unknown interlace method in IHDR"); - - if (compression_type != PNG_COMPRESSION_TYPE_BASE) - png_error(png_ptr, "Unknown compression method in IHDR"); - -#if defined(PNG_MNG_FEATURES_SUPPORTED) - /* Accept filter_method 64 (intrapixel differencing) only if - * 1. Libpng was compiled with PNG_MNG_FEATURES_SUPPORTED and - * 2. Libpng did not read a PNG signature (this filter_method is only - * used in PNG datastreams that are embedded in MNG datastreams) and - * 3. The application called png_permit_mng_features with a mask that - * included PNG_FLAG_MNG_FILTER_64 and - * 4. The filter_method is 64 and - * 5. The color_type is RGB or RGBA - */ - if((png_ptr->mode&PNG_HAVE_PNG_SIGNATURE)&&png_ptr->mng_features_permitted) - png_warning(png_ptr,"MNG features are not allowed in a PNG datastream\n"); - if(filter_type != PNG_FILTER_TYPE_BASE) - { - if(!((png_ptr->mng_features_permitted & PNG_FLAG_MNG_FILTER_64) && - (filter_type == PNG_INTRAPIXEL_DIFFERENCING) && - ((png_ptr->mode&PNG_HAVE_PNG_SIGNATURE) == 0) && - (color_type == PNG_COLOR_TYPE_RGB || - color_type == PNG_COLOR_TYPE_RGB_ALPHA))) - png_error(png_ptr, "Unknown filter method in IHDR"); - if(png_ptr->mode&PNG_HAVE_PNG_SIGNATURE) - png_warning(png_ptr, "Invalid filter method in IHDR"); - } -#else - if(filter_type != PNG_FILTER_TYPE_BASE) - png_error(png_ptr, "Unknown filter method in IHDR"); -#endif - - info_ptr->width = width; - info_ptr->height = height; - info_ptr->bit_depth = (png_byte)bit_depth; - info_ptr->color_type =(png_byte) color_type; - info_ptr->compression_type = (png_byte)compression_type; - info_ptr->filter_type = (png_byte)filter_type; - info_ptr->interlace_type = (png_byte)interlace_type; - if (info_ptr->color_type == PNG_COLOR_TYPE_PALETTE) - info_ptr->channels = 1; - else if (info_ptr->color_type & PNG_COLOR_MASK_COLOR) - info_ptr->channels = 3; - else - info_ptr->channels = 1; - if (info_ptr->color_type & PNG_COLOR_MASK_ALPHA) - info_ptr->channels++; - info_ptr->pixel_depth = (png_byte)(info_ptr->channels * info_ptr->bit_depth); - - /* check for potential overflow */ - if ( width > (PNG_UINT_32_MAX - >> 3) /* 8-byte RGBA pixels */ - - 64 /* bigrowbuf hack */ - - 1 /* filter byte */ - - 7*8 /* rounding of width to multiple of 8 pixels */ - - 8) /* extra max_pixel_depth pad */ - info_ptr->rowbytes = (png_size_t)0; - else - info_ptr->rowbytes = PNG_ROWBYTES(info_ptr->pixel_depth,width); -} - -#if defined(PNG_oFFs_SUPPORTED) -void PNGAPI -png_set_oFFs(png_structp png_ptr, png_infop info_ptr, - png_int_32 offset_x, png_int_32 offset_y, int unit_type) -{ - png_debug1(1, "in %s storage function\n", "oFFs"); - if (png_ptr == NULL || info_ptr == NULL) - return; - - info_ptr->x_offset = offset_x; - info_ptr->y_offset = offset_y; - info_ptr->offset_unit_type = (png_byte)unit_type; - info_ptr->valid |= PNG_INFO_oFFs; -} -#endif - -#if defined(PNG_pCAL_SUPPORTED) -void PNGAPI -png_set_pCAL(png_structp png_ptr, png_infop info_ptr, - png_charp purpose, png_int_32 X0, png_int_32 X1, int type, int nparams, - png_charp units, png_charpp params) -{ - png_uint_32 length; - int i; - - png_debug1(1, "in %s storage function\n", "pCAL"); - if (png_ptr == NULL || info_ptr == NULL) - return; - - length = png_strlen(purpose) + 1; - png_debug1(3, "allocating purpose for info (%lu bytes)\n", length); - info_ptr->pcal_purpose = (png_charp)png_malloc_warn(png_ptr, length); - if (info_ptr->pcal_purpose == NULL) - { - png_warning(png_ptr, "Insufficient memory for pCAL purpose."); - return; - } - png_memcpy(info_ptr->pcal_purpose, purpose, (png_size_t)length); - - png_debug(3, "storing X0, X1, type, and nparams in info\n"); - info_ptr->pcal_X0 = X0; - info_ptr->pcal_X1 = X1; - info_ptr->pcal_type = (png_byte)type; - info_ptr->pcal_nparams = (png_byte)nparams; - - length = png_strlen(units) + 1; - png_debug1(3, "allocating units for info (%lu bytes)\n", length); - info_ptr->pcal_units = (png_charp)png_malloc_warn(png_ptr, length); - if (info_ptr->pcal_units == NULL) - { - png_warning(png_ptr, "Insufficient memory for pCAL units."); - return; - } - png_memcpy(info_ptr->pcal_units, units, (png_size_t)length); - - info_ptr->pcal_params = (png_charpp)png_malloc_warn(png_ptr, - (png_uint_32)((nparams + 1) * png_sizeof(png_charp))); - if (info_ptr->pcal_params == NULL) - { - png_warning(png_ptr, "Insufficient memory for pCAL params."); - return; - } - - info_ptr->pcal_params[nparams] = NULL; - - for (i = 0; i < nparams; i++) - { - length = png_strlen(params[i]) + 1; - png_debug2(3, "allocating parameter %d for info (%lu bytes)\n", i, length); - info_ptr->pcal_params[i] = (png_charp)png_malloc_warn(png_ptr, length); - if (info_ptr->pcal_params[i] == NULL) - { - png_warning(png_ptr, "Insufficient memory for pCAL parameter."); - return; - } - png_memcpy(info_ptr->pcal_params[i], params[i], (png_size_t)length); - } - - info_ptr->valid |= PNG_INFO_pCAL; -#ifdef PNG_FREE_ME_SUPPORTED - info_ptr->free_me |= PNG_FREE_PCAL; -#endif -} -#endif - -#if defined(PNG_READ_sCAL_SUPPORTED) || defined(PNG_WRITE_sCAL_SUPPORTED) -#ifdef PNG_FLOATING_POINT_SUPPORTED -void PNGAPI -png_set_sCAL(png_structp png_ptr, png_infop info_ptr, - int unit, double width, double height) -{ - png_debug1(1, "in %s storage function\n", "sCAL"); - if (png_ptr == NULL || info_ptr == NULL) - return; - - info_ptr->scal_unit = (png_byte)unit; - info_ptr->scal_pixel_width = width; - info_ptr->scal_pixel_height = height; - - info_ptr->valid |= PNG_INFO_sCAL; -} -#else -#ifdef PNG_FIXED_POINT_SUPPORTED -void PNGAPI -png_set_sCAL_s(png_structp png_ptr, png_infop info_ptr, - int unit, png_charp swidth, png_charp sheight) -{ - png_uint_32 length; - - png_debug1(1, "in %s storage function\n", "sCAL"); - if (png_ptr == NULL || info_ptr == NULL) - return; - - info_ptr->scal_unit = (png_byte)unit; - - length = png_strlen(swidth) + 1; - png_debug1(3, "allocating unit for info (%d bytes)\n", length); - info_ptr->scal_s_width = (png_charp)png_malloc_warn(png_ptr, length); - if (info_ptr->scal_s_width == NULL) - { - png_warning(png_ptr, "Memory allocation failed while processing sCAL."); - } - png_memcpy(info_ptr->scal_s_width, swidth, (png_size_t)length); - - length = png_strlen(sheight) + 1; - png_debug1(3, "allocating unit for info (%d bytes)\n", length); - info_ptr->scal_s_height = (png_charp)png_malloc_warn(png_ptr, length); - if (info_ptr->scal_s_height == NULL) - { - png_free (png_ptr, info_ptr->scal_s_width); - png_warning(png_ptr, "Memory allocation failed while processing sCAL."); - } - png_memcpy(info_ptr->scal_s_height, sheight, (png_size_t)length); - - info_ptr->valid |= PNG_INFO_sCAL; -#ifdef PNG_FREE_ME_SUPPORTED - info_ptr->free_me |= PNG_FREE_SCAL; -#endif -} -#endif -#endif -#endif - -#if defined(PNG_pHYs_SUPPORTED) -void PNGAPI -png_set_pHYs(png_structp png_ptr, png_infop info_ptr, - png_uint_32 res_x, png_uint_32 res_y, int unit_type) -{ - png_debug1(1, "in %s storage function\n", "pHYs"); - if (png_ptr == NULL || info_ptr == NULL) - return; - - info_ptr->x_pixels_per_unit = res_x; - info_ptr->y_pixels_per_unit = res_y; - info_ptr->phys_unit_type = (png_byte)unit_type; - info_ptr->valid |= PNG_INFO_pHYs; -} -#endif - -void PNGAPI -png_set_PLTE(png_structp png_ptr, png_infop info_ptr, - png_colorp palette, int num_palette) -{ - - png_debug1(1, "in %s storage function\n", "PLTE"); - if (png_ptr == NULL || info_ptr == NULL) - return; - - /* - * It may not actually be necessary to set png_ptr->palette here; - * we do it for backward compatibility with the way the png_handle_tRNS - * function used to do the allocation. - */ -#ifdef PNG_FREE_ME_SUPPORTED - png_free_data(png_ptr, info_ptr, PNG_FREE_PLTE, 0); -#endif - - /* Changed in libpng-1.2.1 to allocate 256 instead of num_palette entries, - in case of an invalid PNG file that has too-large sample values. */ - png_ptr->palette = (png_colorp)png_malloc(png_ptr, - 256 * png_sizeof(png_color)); - png_memset(png_ptr->palette, 0, 256 * png_sizeof(png_color)); - png_memcpy(png_ptr->palette, palette, num_palette * png_sizeof (png_color)); - info_ptr->palette = png_ptr->palette; - info_ptr->num_palette = png_ptr->num_palette = (png_uint_16)num_palette; - -#ifdef PNG_FREE_ME_SUPPORTED - info_ptr->free_me |= PNG_FREE_PLTE; -#else - png_ptr->flags |= PNG_FLAG_FREE_PLTE; -#endif - - info_ptr->valid |= PNG_INFO_PLTE; -} - -#if defined(PNG_sBIT_SUPPORTED) -void PNGAPI -png_set_sBIT(png_structp png_ptr, png_infop info_ptr, - png_color_8p sig_bit) -{ - png_debug1(1, "in %s storage function\n", "sBIT"); - if (png_ptr == NULL || info_ptr == NULL) - return; - - png_memcpy(&(info_ptr->sig_bit), sig_bit, png_sizeof (png_color_8)); - info_ptr->valid |= PNG_INFO_sBIT; -} -#endif - -#if defined(PNG_sRGB_SUPPORTED) -void PNGAPI -png_set_sRGB(png_structp png_ptr, png_infop info_ptr, int intent) -{ - png_debug1(1, "in %s storage function\n", "sRGB"); - if (png_ptr == NULL || info_ptr == NULL) - return; - - info_ptr->srgb_intent = (png_byte)intent; - info_ptr->valid |= PNG_INFO_sRGB; -} - -void PNGAPI -png_set_sRGB_gAMA_and_cHRM(png_structp png_ptr, png_infop info_ptr, - int intent) -{ -#if defined(PNG_gAMA_SUPPORTED) -#ifdef PNG_FLOATING_POINT_SUPPORTED - float file_gamma; -#endif -#ifdef PNG_FIXED_POINT_SUPPORTED - png_fixed_point int_file_gamma; -#endif -#endif -#if defined(PNG_cHRM_SUPPORTED) -#ifdef PNG_FLOATING_POINT_SUPPORTED - float white_x, white_y, red_x, red_y, green_x, green_y, blue_x, blue_y; -#endif -#ifdef PNG_FIXED_POINT_SUPPORTED - png_fixed_point int_white_x, int_white_y, int_red_x, int_red_y, int_green_x, - int_green_y, int_blue_x, int_blue_y; -#endif -#endif - png_debug1(1, "in %s storage function\n", "sRGB_gAMA_and_cHRM"); - if (png_ptr == NULL || info_ptr == NULL) - return; - - png_set_sRGB(png_ptr, info_ptr, intent); - -#if defined(PNG_gAMA_SUPPORTED) -#ifdef PNG_FLOATING_POINT_SUPPORTED - file_gamma = (float).45455; - png_set_gAMA(png_ptr, info_ptr, file_gamma); -#endif -#ifdef PNG_FIXED_POINT_SUPPORTED - int_file_gamma = 45455L; - png_set_gAMA_fixed(png_ptr, info_ptr, int_file_gamma); -#endif -#endif - -#if defined(PNG_cHRM_SUPPORTED) -#ifdef PNG_FIXED_POINT_SUPPORTED - int_white_x = 31270L; - int_white_y = 32900L; - int_red_x = 64000L; - int_red_y = 33000L; - int_green_x = 30000L; - int_green_y = 60000L; - int_blue_x = 15000L; - int_blue_y = 6000L; - - png_set_cHRM_fixed(png_ptr, info_ptr, - int_white_x, int_white_y, int_red_x, int_red_y, int_green_x, int_green_y, - int_blue_x, int_blue_y); -#endif -#ifdef PNG_FLOATING_POINT_SUPPORTED - white_x = (float).3127; - white_y = (float).3290; - red_x = (float).64; - red_y = (float).33; - green_x = (float).30; - green_y = (float).60; - blue_x = (float).15; - blue_y = (float).06; - - png_set_cHRM(png_ptr, info_ptr, - white_x, white_y, red_x, red_y, green_x, green_y, blue_x, blue_y); -#endif -#endif -} -#endif - - -#if defined(PNG_iCCP_SUPPORTED) -void PNGAPI -png_set_iCCP(png_structp png_ptr, png_infop info_ptr, - png_charp name, int compression_type, - png_charp profile, png_uint_32 proflen) -{ - png_charp new_iccp_name; - png_charp new_iccp_profile; - - png_debug1(1, "in %s storage function\n", "iCCP"); - if (png_ptr == NULL || info_ptr == NULL || name == NULL || profile == NULL) - return; - - new_iccp_name = (png_charp)png_malloc_warn(png_ptr, png_strlen(name)+1); - if (new_iccp_name == NULL) - { - png_warning(png_ptr, "Insufficient memory to process iCCP chunk."); - return; - } - png_strcpy(new_iccp_name, name); - new_iccp_profile = (png_charp)png_malloc_warn(png_ptr, proflen); - if (new_iccp_profile == NULL) - { - png_free (png_ptr, new_iccp_name); - png_warning(png_ptr, "Insufficient memory to process iCCP profile."); - return; - } - png_memcpy(new_iccp_profile, profile, (png_size_t)proflen); - - png_free_data(png_ptr, info_ptr, PNG_FREE_ICCP, 0); - - info_ptr->iccp_proflen = proflen; - info_ptr->iccp_name = new_iccp_name; - info_ptr->iccp_profile = new_iccp_profile; - /* Compression is always zero but is here so the API and info structure - * does not have to change if we introduce multiple compression types */ - info_ptr->iccp_compression = (png_byte)compression_type; -#ifdef PNG_FREE_ME_SUPPORTED - info_ptr->free_me |= PNG_FREE_ICCP; -#endif - info_ptr->valid |= PNG_INFO_iCCP; -} -#endif - -#if defined(PNG_TEXT_SUPPORTED) -void PNGAPI -png_set_text(png_structp png_ptr, png_infop info_ptr, png_textp text_ptr, - int num_text) -{ - int ret; - ret=png_set_text_2(png_ptr, info_ptr, text_ptr, num_text); - if (ret) - png_error(png_ptr, "Insufficient memory to store text"); -} - -int /* PRIVATE */ -png_set_text_2(png_structp png_ptr, png_infop info_ptr, png_textp text_ptr, - int num_text) -{ - int i; - - png_debug1(1, "in %s storage function\n", (png_ptr->chunk_name[0] == '\0' ? - "text" : (png_const_charp)png_ptr->chunk_name)); - - if (png_ptr == NULL || info_ptr == NULL || num_text == 0) - return(0); - - /* Make sure we have enough space in the "text" array in info_struct - * to hold all of the incoming text_ptr objects. - */ - if (info_ptr->num_text + num_text > info_ptr->max_text) - { - if (info_ptr->text != NULL) - { - png_textp old_text; - int old_max; - - old_max = info_ptr->max_text; - info_ptr->max_text = info_ptr->num_text + num_text + 8; - old_text = info_ptr->text; - info_ptr->text = (png_textp)png_malloc_warn(png_ptr, - (png_uint_32)(info_ptr->max_text * png_sizeof (png_text))); - if (info_ptr->text == NULL) - { - png_free(png_ptr, old_text); - return(1); - } - png_memcpy(info_ptr->text, old_text, (png_size_t)(old_max * - png_sizeof(png_text))); - png_free(png_ptr, old_text); - } - else - { - info_ptr->max_text = num_text + 8; - info_ptr->num_text = 0; - info_ptr->text = (png_textp)png_malloc_warn(png_ptr, - (png_uint_32)(info_ptr->max_text * png_sizeof (png_text))); - if (info_ptr->text == NULL) - return(1); -#ifdef PNG_FREE_ME_SUPPORTED - info_ptr->free_me |= PNG_FREE_TEXT; -#endif - } - png_debug1(3, "allocated %d entries for info_ptr->text\n", - info_ptr->max_text); - } - for (i = 0; i < num_text; i++) - { - png_size_t text_length,key_len; - png_size_t lang_len,lang_key_len; - png_textp textp = &(info_ptr->text[info_ptr->num_text]); - - if (text_ptr[i].key == NULL) - continue; - - key_len = png_strlen(text_ptr[i].key); - - if(text_ptr[i].compression <= 0) - { - lang_len = 0; - lang_key_len = 0; - } - else -#ifdef PNG_iTXt_SUPPORTED - { - /* set iTXt data */ - if (text_ptr[i].lang != NULL) - lang_len = png_strlen(text_ptr[i].lang); - else - lang_len = 0; - if (text_ptr[i].lang_key != NULL) - lang_key_len = png_strlen(text_ptr[i].lang_key); - else - lang_key_len = 0; - } -#else - { - png_warning(png_ptr, "iTXt chunk not supported."); - continue; - } -#endif - - if (text_ptr[i].text == NULL || text_ptr[i].text[0] == '\0') - { - text_length = 0; -#ifdef PNG_iTXt_SUPPORTED - if(text_ptr[i].compression > 0) - textp->compression = PNG_ITXT_COMPRESSION_NONE; - else -#endif - textp->compression = PNG_TEXT_COMPRESSION_NONE; - } - else - { - text_length = png_strlen(text_ptr[i].text); - textp->compression = text_ptr[i].compression; - } - - textp->key = (png_charp)png_malloc_warn(png_ptr, - (png_uint_32)(key_len + text_length + lang_len + lang_key_len + 4)); - if (textp->key == NULL) - return(1); - png_debug2(2, "Allocated %lu bytes at %x in png_set_text\n", - (png_uint_32)(key_len + lang_len + lang_key_len + text_length + 4), - (int)textp->key); - - png_memcpy(textp->key, text_ptr[i].key, - (png_size_t)(key_len)); - *(textp->key+key_len) = '\0'; -#ifdef PNG_iTXt_SUPPORTED - if (text_ptr[i].compression > 0) - { - textp->lang=textp->key + key_len + 1; - png_memcpy(textp->lang, text_ptr[i].lang, lang_len); - *(textp->lang+lang_len) = '\0'; - textp->lang_key=textp->lang + lang_len + 1; - png_memcpy(textp->lang_key, text_ptr[i].lang_key, lang_key_len); - *(textp->lang_key+lang_key_len) = '\0'; - textp->text=textp->lang_key + lang_key_len + 1; - } - else -#endif - { -#ifdef PNG_iTXt_SUPPORTED - textp->lang=NULL; - textp->lang_key=NULL; -#endif - textp->text=textp->key + key_len + 1; - } - if(text_length) - png_memcpy(textp->text, text_ptr[i].text, - (png_size_t)(text_length)); - *(textp->text+text_length) = '\0'; - -#ifdef PNG_iTXt_SUPPORTED - if(textp->compression > 0) - { - textp->text_length = 0; - textp->itxt_length = text_length; - } - else -#endif - { - textp->text_length = text_length; -#ifdef PNG_iTXt_SUPPORTED - textp->itxt_length = 0; -#endif - } - info_ptr->text[info_ptr->num_text]= *textp; - info_ptr->num_text++; - png_debug1(3, "transferred text chunk %d\n", info_ptr->num_text); - } - return(0); -} -#endif - -#if defined(PNG_tIME_SUPPORTED) -void PNGAPI -png_set_tIME(png_structp png_ptr, png_infop info_ptr, png_timep mod_time) -{ - png_debug1(1, "in %s storage function\n", "tIME"); - if (png_ptr == NULL || info_ptr == NULL || - (png_ptr->mode & PNG_WROTE_tIME)) - return; - - png_memcpy(&(info_ptr->mod_time), mod_time, png_sizeof (png_time)); - info_ptr->valid |= PNG_INFO_tIME; -} -#endif - -#if defined(PNG_tRNS_SUPPORTED) -void PNGAPI -png_set_tRNS(png_structp png_ptr, png_infop info_ptr, - png_bytep trans, int num_trans, png_color_16p trans_values) -{ - png_debug1(1, "in %s storage function\n", "tRNS"); - if (png_ptr == NULL || info_ptr == NULL) - return; - - if (trans != NULL) - { - /* - * It may not actually be necessary to set png_ptr->trans here; - * we do it for backward compatibility with the way the png_handle_tRNS - * function used to do the allocation. - */ -#ifdef PNG_FREE_ME_SUPPORTED - png_free_data(png_ptr, info_ptr, PNG_FREE_TRNS, 0); -#endif - /* Changed from num_trans to 256 in version 1.2.1 */ - png_ptr->trans = info_ptr->trans = (png_bytep)png_malloc(png_ptr, - (png_uint_32)256); - png_memcpy(info_ptr->trans, trans, (png_size_t)num_trans); -#ifdef PNG_FREE_ME_SUPPORTED - info_ptr->free_me |= PNG_FREE_TRNS; -#else - png_ptr->flags |= PNG_FLAG_FREE_TRNS; -#endif - } - - if (trans_values != NULL) - { - png_memcpy(&(info_ptr->trans_values), trans_values, - png_sizeof(png_color_16)); - if (num_trans == 0) - num_trans = 1; - } - info_ptr->num_trans = (png_uint_16)num_trans; - info_ptr->valid |= PNG_INFO_tRNS; -} -#endif - -#if defined(PNG_sPLT_SUPPORTED) -void PNGAPI -png_set_sPLT(png_structp png_ptr, - png_infop info_ptr, png_sPLT_tp entries, int nentries) -{ - png_sPLT_tp np; - int i; - - np = (png_sPLT_tp)png_malloc_warn(png_ptr, - (info_ptr->splt_palettes_num + nentries) * png_sizeof(png_sPLT_t)); - if (np == NULL) - { - png_warning(png_ptr, "No memory for sPLT palettes."); - return; - } - - png_memcpy(np, info_ptr->splt_palettes, - info_ptr->splt_palettes_num * png_sizeof(png_sPLT_t)); - png_free(png_ptr, info_ptr->splt_palettes); - info_ptr->splt_palettes=NULL; - - for (i = 0; i < nentries; i++) - { - png_sPLT_tp to = np + info_ptr->splt_palettes_num + i; - png_sPLT_tp from = entries + i; - - to->name = (png_charp)png_malloc(png_ptr, - png_strlen(from->name) + 1); - /* TODO: use png_malloc_warn */ - png_strcpy(to->name, from->name); - to->entries = (png_sPLT_entryp)png_malloc(png_ptr, - from->nentries * png_sizeof(png_sPLT_t)); - /* TODO: use png_malloc_warn */ - png_memcpy(to->entries, from->entries, - from->nentries * png_sizeof(png_sPLT_t)); - to->nentries = from->nentries; - to->depth = from->depth; - } - - info_ptr->splt_palettes = np; - info_ptr->splt_palettes_num += nentries; - info_ptr->valid |= PNG_INFO_sPLT; -#ifdef PNG_FREE_ME_SUPPORTED - info_ptr->free_me |= PNG_FREE_SPLT; -#endif -} -#endif /* PNG_sPLT_SUPPORTED */ - -#if defined(PNG_UNKNOWN_CHUNKS_SUPPORTED) -void PNGAPI -png_set_unknown_chunks(png_structp png_ptr, - png_infop info_ptr, png_unknown_chunkp unknowns, int num_unknowns) -{ - png_unknown_chunkp np; - int i; - - if (png_ptr == NULL || info_ptr == NULL || num_unknowns == 0) - return; - - np = (png_unknown_chunkp)png_malloc_warn(png_ptr, - (info_ptr->unknown_chunks_num + num_unknowns) * - png_sizeof(png_unknown_chunk)); - if (np == NULL) - { - png_warning(png_ptr, "Out of memory while processing unknown chunk."); - return; - } - - png_memcpy(np, info_ptr->unknown_chunks, - info_ptr->unknown_chunks_num * png_sizeof(png_unknown_chunk)); - png_free(png_ptr, info_ptr->unknown_chunks); - info_ptr->unknown_chunks=NULL; - - for (i = 0; i < num_unknowns; i++) - { - png_unknown_chunkp to = np + info_ptr->unknown_chunks_num + i; - png_unknown_chunkp from = unknowns + i; - - png_strncpy((png_charp)to->name, (png_charp)from->name, 5); - to->data = (png_bytep)png_malloc_warn(png_ptr, from->size); - if (to->data == NULL) - { - png_warning(png_ptr, "Out of memory processing unknown chunk."); - } - else - { - png_memcpy(to->data, from->data, from->size); - to->size = from->size; - - /* note our location in the read or write sequence */ - to->location = (png_byte)(png_ptr->mode & 0xff); - } - } - - info_ptr->unknown_chunks = np; - info_ptr->unknown_chunks_num += num_unknowns; -#ifdef PNG_FREE_ME_SUPPORTED - info_ptr->free_me |= PNG_FREE_UNKN; -#endif -} -void PNGAPI -png_set_unknown_chunk_location(png_structp png_ptr, png_infop info_ptr, - int chunk, int location) -{ - if(png_ptr != NULL && info_ptr != NULL && chunk >= 0 && chunk < - (int)info_ptr->unknown_chunks_num) - info_ptr->unknown_chunks[chunk].location = (png_byte)location; -} -#endif - -#if defined(PNG_READ_EMPTY_PLTE_SUPPORTED) || \ - defined(PNG_WRITE_EMPTY_PLTE_SUPPORTED) -void PNGAPI -png_permit_empty_plte (png_structp png_ptr, int empty_plte_permitted) -{ - /* This function is deprecated in favor of png_permit_mng_features() - and will be removed from libpng-2.0.0 */ - png_debug(1, "in png_permit_empty_plte, DEPRECATED.\n"); - if (png_ptr == NULL) - return; - png_ptr->mng_features_permitted = (png_byte) - ((png_ptr->mng_features_permitted & (~(PNG_FLAG_MNG_EMPTY_PLTE))) | - ((empty_plte_permitted & PNG_FLAG_MNG_EMPTY_PLTE))); -} -#endif - -#if defined(PNG_MNG_FEATURES_SUPPORTED) -png_uint_32 PNGAPI -png_permit_mng_features (png_structp png_ptr, png_uint_32 mng_features) -{ - png_debug(1, "in png_permit_mng_features\n"); - if (png_ptr == NULL) - return (png_uint_32)0; - png_ptr->mng_features_permitted = - (png_byte)(mng_features & PNG_ALL_MNG_FEATURES); - return (png_uint_32)png_ptr->mng_features_permitted; -} -#endif - -#if defined(PNG_UNKNOWN_CHUNKS_SUPPORTED) -void PNGAPI -png_set_keep_unknown_chunks(png_structp png_ptr, int keep, png_bytep - chunk_list, int num_chunks) -{ - png_bytep new_list, p; - int i, old_num_chunks; - if (num_chunks == 0) - { - if(keep == PNG_HANDLE_CHUNK_ALWAYS || keep == PNG_HANDLE_CHUNK_IF_SAFE) - png_ptr->flags |= PNG_FLAG_KEEP_UNKNOWN_CHUNKS; - else - png_ptr->flags &= ~PNG_FLAG_KEEP_UNKNOWN_CHUNKS; - - if(keep == PNG_HANDLE_CHUNK_ALWAYS) - png_ptr->flags |= PNG_FLAG_KEEP_UNSAFE_CHUNKS; - else - png_ptr->flags &= ~PNG_FLAG_KEEP_UNSAFE_CHUNKS; - return; - } - if (chunk_list == NULL) - return; - old_num_chunks=png_ptr->num_chunk_list; - new_list=(png_bytep)png_malloc(png_ptr, - (png_uint_32)(5*(num_chunks+old_num_chunks))); - if(png_ptr->chunk_list != NULL) - { - png_memcpy(new_list, png_ptr->chunk_list, - (png_size_t)(5*old_num_chunks)); - png_free(png_ptr, png_ptr->chunk_list); - png_ptr->chunk_list=NULL; - } - png_memcpy(new_list+5*old_num_chunks, chunk_list, - (png_size_t)(5*num_chunks)); - for (p=new_list+5*old_num_chunks+4, i=0; inum_chunk_list=old_num_chunks+num_chunks; - png_ptr->chunk_list=new_list; -#ifdef PNG_FREE_ME_SUPPORTED - png_ptr->free_me |= PNG_FREE_LIST; -#endif -} -#endif - -#if defined(PNG_READ_USER_CHUNKS_SUPPORTED) -void PNGAPI -png_set_read_user_chunk_fn(png_structp png_ptr, png_voidp user_chunk_ptr, - png_user_chunk_ptr read_user_chunk_fn) -{ - png_debug(1, "in png_set_read_user_chunk_fn\n"); - png_ptr->read_user_chunk_fn = read_user_chunk_fn; - png_ptr->user_chunk_ptr = user_chunk_ptr; -} -#endif - -#if defined(PNG_INFO_IMAGE_SUPPORTED) -void PNGAPI -png_set_rows(png_structp png_ptr, png_infop info_ptr, png_bytepp row_pointers) -{ - png_debug1(1, "in %s storage function\n", "rows"); - - if (png_ptr == NULL || info_ptr == NULL) - return; - - if(info_ptr->row_pointers && (info_ptr->row_pointers != row_pointers)) - png_free_data(png_ptr, info_ptr, PNG_FREE_ROWS, 0); - info_ptr->row_pointers = row_pointers; - if(row_pointers) - info_ptr->valid |= PNG_INFO_IDAT; -} -#endif - -#ifdef PNG_WRITE_SUPPORTED -void PNGAPI -png_set_compression_buffer_size(png_structp png_ptr, png_uint_32 size) -{ - if(png_ptr->zbuf) - png_free(png_ptr, png_ptr->zbuf); - png_ptr->zbuf_size = (png_size_t)size; - png_ptr->zbuf = (png_bytep)png_malloc(png_ptr, size); - png_ptr->zstream.next_out = png_ptr->zbuf; - png_ptr->zstream.avail_out = (uInt)png_ptr->zbuf_size; -} -#endif - -void PNGAPI -png_set_invalid(png_structp png_ptr, png_infop info_ptr, int mask) -{ - if (png_ptr && info_ptr) - info_ptr->valid &= ~(mask); -} - - -#ifndef PNG_1_0_X -#ifdef PNG_ASSEMBLER_CODE_SUPPORTED -/* this function was added to libpng 1.2.0 and should always exist by default */ -void PNGAPI -png_set_asm_flags (png_structp png_ptr, png_uint_32 asm_flags) -{ - png_uint_32 settable_asm_flags; - png_uint_32 settable_mmx_flags; - - settable_mmx_flags = -#ifdef PNG_HAVE_ASSEMBLER_COMBINE_ROW - PNG_ASM_FLAG_MMX_READ_COMBINE_ROW | -#endif -#ifdef PNG_HAVE_ASSEMBLER_READ_INTERLACE - PNG_ASM_FLAG_MMX_READ_INTERLACE | -#endif -#ifdef PNG_HAVE_ASSEMBLER_READ_FILTER_ROW - PNG_ASM_FLAG_MMX_READ_FILTER_SUB | - PNG_ASM_FLAG_MMX_READ_FILTER_UP | - PNG_ASM_FLAG_MMX_READ_FILTER_AVG | - PNG_ASM_FLAG_MMX_READ_FILTER_PAETH | -#endif - 0; - - /* could be some non-MMX ones in the future, but not currently: */ - settable_asm_flags = settable_mmx_flags; - - if (!(png_ptr->asm_flags & PNG_ASM_FLAG_MMX_SUPPORT_COMPILED) || - !(png_ptr->asm_flags & PNG_ASM_FLAG_MMX_SUPPORT_IN_CPU)) - { - /* clear all MMX flags if MMX isn't supported */ - settable_asm_flags &= ~settable_mmx_flags; - png_ptr->asm_flags &= ~settable_mmx_flags; - } - - /* we're replacing the settable bits with those passed in by the user, - * so first zero them out of the master copy, then logical-OR in the - * allowed subset that was requested */ - - png_ptr->asm_flags &= ~settable_asm_flags; /* zero them */ - png_ptr->asm_flags |= (asm_flags & settable_asm_flags); /* set them */ -} -#endif /* ?PNG_ASSEMBLER_CODE_SUPPORTED */ - -#ifdef PNG_ASSEMBLER_CODE_SUPPORTED -/* this function was added to libpng 1.2.0 */ -void PNGAPI -png_set_mmx_thresholds (png_structp png_ptr, - png_byte mmx_bitdepth_threshold, - png_uint_32 mmx_rowbytes_threshold) -{ - png_ptr->mmx_bitdepth_threshold = mmx_bitdepth_threshold; - png_ptr->mmx_rowbytes_threshold = mmx_rowbytes_threshold; -} -#endif /* ?PNG_ASSEMBLER_CODE_SUPPORTED */ - -#ifdef PNG_SET_USER_LIMITS_SUPPORTED -/* this function was added to libpng 1.2.6 */ -void PNGAPI -png_set_user_limits (png_structp png_ptr, png_uint_32 user_width_max, - png_uint_32 user_height_max) -{ - /* Images with dimensions larger than these limits will be - * rejected by png_set_IHDR(). To accept any PNG datastream - * regardless of dimensions, set both limits to 0x7ffffffL. - */ - png_ptr->user_width_max = user_width_max; - png_ptr->user_height_max = user_height_max; -} -#endif /* ?PNG_SET_USER_LIMITS_SUPPORTED */ - -#endif /* ?PNG_1_0_X */ diff --git a/wxWidgets/src/png/pngtest.c b/wxWidgets/src/png/pngtest.c deleted file mode 100644 index 431c85dd35..0000000000 --- a/wxWidgets/src/png/pngtest.c +++ /dev/null @@ -1,1554 +0,0 @@ - -/* pngtest.c - a simple test program to test libpng - * - * libpng 1.2.7 - September 12, 2004 - * For conditions of distribution and use, see copyright notice in png.h - * Copyright (c) 1998-2004 Glenn Randers-Pehrson - * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) - * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) - * - * This program reads in a PNG image, writes it out again, and then - * compares the two files. If the files are identical, this shows that - * the basic chunk handling, filtering, and (de)compression code is working - * properly. It does not currently test all of the transforms, although - * it probably should. - * - * The program will report "FAIL" in certain legitimate cases: - * 1) when the compression level or filter selection method is changed. - * 2) when the maximum IDAT size (PNG_ZBUF_SIZE in pngconf.h) is not 8192. - * 3) unknown unsafe-to-copy ancillary chunks or unknown critical chunks - * exist in the input file. - * 4) others not listed here... - * In these cases, it is best to check with another tool such as "pngcheck" - * to see what the differences between the two files are. - * - * If a filename is given on the command-line, then this file is used - * for the input, rather than the default "pngtest.png". This allows - * testing a wide variety of files easily. You can also test a number - * of files at once by typing "pngtest -m file1.png file2.png ..." - */ - -#include "png.h" - -#if defined(_WIN32_WCE) -# if _WIN32_WCE < 211 - __error__ (f|w)printf functions are not supported on old WindowsCE.; -# endif -# include -# include -# define READFILE(file, data, length, check) \ - if (ReadFile(file, data, length, &check,NULL)) check = 0 -# define WRITEFILE(file, data, length, check)) \ - if (WriteFile(file, data, length, &check, NULL)) check = 0 -# define FCLOSE(file) CloseHandle(file) -#else -# include -# include -# include -# define READFILE(file, data, length, check) \ - check=(png_size_t)fread(data,(png_size_t)1,length,file) -# define WRITEFILE(file, data, length, check) \ - check=(png_size_t)fwrite(data,(png_size_t)1, length, file) -# define FCLOSE(file) fclose(file) -#endif - -#if defined(PNG_NO_STDIO) -# if defined(_WIN32_WCE) - typedef HANDLE png_FILE_p; -# else - typedef FILE * png_FILE_p; -# endif -#endif - -/* Makes pngtest verbose so we can find problems (needs to be before png.h) */ -#ifndef PNG_DEBUG -# define PNG_DEBUG 0 -#endif - -#if !PNG_DEBUG -# define SINGLE_ROWBUF_ALLOC /* makes buffer overruns easier to nail */ -#endif - -/* Turn on CPU timing -#define PNGTEST_TIMING -*/ - -#ifdef PNG_NO_FLOATING_POINT_SUPPORTED -#undef PNGTEST_TIMING -#endif - -#ifdef PNGTEST_TIMING -static float t_start, t_stop, t_decode, t_encode, t_misc; -#include -#endif - -/* Define png_jmpbuf() in case we are using a pre-1.0.6 version of libpng */ -#ifndef png_jmpbuf -# define png_jmpbuf(png_ptr) png_ptr->jmpbuf -#endif - -#ifdef PNGTEST_TIMING -static float t_start, t_stop, t_decode, t_encode, t_misc; -#if !defined(PNG_tIME_SUPPORTED) -#include -#endif -#endif - -#if defined(PNG_TIME_RFC1123_SUPPORTED) -static int tIME_chunk_present=0; -static char tIME_string[30] = "no tIME chunk present in file"; -#endif - -static int verbose = 0; - -int test_one_file PNGARG((PNG_CONST char *inname, PNG_CONST char *outname)); - -#ifdef __TURBOC__ -#include -#endif - -/* defined so I can write to a file on gui/windowing platforms */ -/* #define STDERR stderr */ -#define STDERR stdout /* for DOS */ - -/* example of using row callbacks to make a simple progress meter */ -static int status_pass=1; -static int status_dots_requested=0; -static int status_dots=1; - -void -#ifdef PNG_1_0_X -PNGAPI -#endif -read_row_callback(png_structp png_ptr, png_uint_32 row_number, int pass); -void -#ifdef PNG_1_0_X -PNGAPI -#endif -read_row_callback(png_structp png_ptr, png_uint_32 row_number, int pass) -{ - if(png_ptr == NULL || row_number > PNG_UINT_31_MAX) return; - if(status_pass != pass) - { - fprintf(stdout,"\n Pass %d: ",pass); - status_pass = pass; - status_dots = 31; - } - status_dots--; - if(status_dots == 0) - { - fprintf(stdout, "\n "); - status_dots=30; - } - fprintf(stdout, "r"); -} - -void -#ifdef PNG_1_0_X -PNGAPI -#endif -write_row_callback(png_structp png_ptr, png_uint_32 row_number, int pass); -void -#ifdef PNG_1_0_X -PNGAPI -#endif -write_row_callback(png_structp png_ptr, png_uint_32 row_number, int pass) -{ - if(png_ptr == NULL || row_number > PNG_UINT_31_MAX || pass > 7) return; - fprintf(stdout, "w"); -} - - -#if defined(PNG_READ_USER_TRANSFORM_SUPPORTED) -/* Example of using user transform callback (we don't transform anything, - but merely examine the row filters. We set this to 256 rather than - 5 in case illegal filter values are present.) */ -static png_uint_32 filters_used[256]; -void -#ifdef PNG_1_0_X -PNGAPI -#endif -count_filters(png_structp png_ptr, png_row_infop row_info, png_bytep data); -void -#ifdef PNG_1_0_X -PNGAPI -#endif -count_filters(png_structp png_ptr, png_row_infop row_info, png_bytep data) -{ - if(png_ptr != NULL && row_info != NULL) - ++filters_used[*(data-1)]; -} -#endif - -#if defined(PNG_WRITE_USER_TRANSFORM_SUPPORTED) -/* example of using user transform callback (we don't transform anything, - but merely count the zero samples) */ - -static png_uint_32 zero_samples; - -void -#ifdef PNG_1_0_X -PNGAPI -#endif -count_zero_samples(png_structp png_ptr, png_row_infop row_info, png_bytep data); -void -#ifdef PNG_1_0_X -PNGAPI -#endif -count_zero_samples(png_structp png_ptr, png_row_infop row_info, png_bytep data) -{ - png_bytep dp = data; - if(png_ptr == NULL)return; - - /* contents of row_info: - * png_uint_32 width width of row - * png_uint_32 rowbytes number of bytes in row - * png_byte color_type color type of pixels - * png_byte bit_depth bit depth of samples - * png_byte channels number of channels (1-4) - * png_byte pixel_depth bits per pixel (depth*channels) - */ - - - /* counts the number of zero samples (or zero pixels if color_type is 3 */ - - if(row_info->color_type == 0 || row_info->color_type == 3) - { - int pos=0; - png_uint_32 n, nstop; - for (n=0, nstop=row_info->width; nbit_depth == 1) - { - if(((*dp << pos++ ) & 0x80) == 0) zero_samples++; - if(pos == 8) - { - pos = 0; - dp++; - } - } - if(row_info->bit_depth == 2) - { - if(((*dp << (pos+=2)) & 0xc0) == 0) zero_samples++; - if(pos == 8) - { - pos = 0; - dp++; - } - } - if(row_info->bit_depth == 4) - { - if(((*dp << (pos+=4)) & 0xf0) == 0) zero_samples++; - if(pos == 8) - { - pos = 0; - dp++; - } - } - if(row_info->bit_depth == 8) - if(*dp++ == 0) zero_samples++; - if(row_info->bit_depth == 16) - { - if((*dp | *(dp+1)) == 0) zero_samples++; - dp+=2; - } - } - } - else /* other color types */ - { - png_uint_32 n, nstop; - int channel; - int color_channels = row_info->channels; - if(row_info->color_type > 3)color_channels--; - - for (n=0, nstop=row_info->width; nbit_depth == 8) - if(*dp++ == 0) zero_samples++; - if(row_info->bit_depth == 16) - { - if((*dp | *(dp+1)) == 0) zero_samples++; - dp+=2; - } - } - if(row_info->color_type > 3) - { - dp++; - if(row_info->bit_depth == 16)dp++; - } - } - } -} -#endif /* PNG_WRITE_USER_TRANSFORM_SUPPORTED */ - -static int wrote_question = 0; - -#if defined(PNG_NO_STDIO) -/* START of code to validate stdio-free compilation */ -/* These copies of the default read/write functions come from pngrio.c and */ -/* pngwio.c. They allow "don't include stdio" testing of the library. */ -/* This is the function that does the actual reading of data. If you are - not reading from a standard C stream, you should create a replacement - read_data function and use it at run time with png_set_read_fn(), rather - than changing the library. */ - -#ifndef USE_FAR_KEYWORD -static void -pngtest_read_data(png_structp png_ptr, png_bytep data, png_size_t length) -{ - png_size_t check; - - /* fread() returns 0 on error, so it is OK to store this in a png_size_t - * instead of an int, which is what fread() actually returns. - */ - READFILE((png_FILE_p)png_ptr->io_ptr, data, length, check); - - if (check != length) - { - png_error(png_ptr, "Read Error!"); - } -} -#else -/* this is the model-independent version. Since the standard I/O library - can't handle far buffers in the medium and small models, we have to copy - the data. -*/ - -#define NEAR_BUF_SIZE 1024 -#define MIN(a,b) (a <= b ? a : b) - -static void -pngtest_read_data(png_structp png_ptr, png_bytep data, png_size_t length) -{ - int check; - png_byte *n_data; - png_FILE_p io_ptr; - - /* Check if data really is near. If so, use usual code. */ - n_data = (png_byte *)CVT_PTR_NOCHECK(data); - io_ptr = (png_FILE_p)CVT_PTR(png_ptr->io_ptr); - if ((png_bytep)n_data == data) - { - READFILE(io_ptr, n_data, length, check); - } - else - { - png_byte buf[NEAR_BUF_SIZE]; - png_size_t read, remaining, err; - check = 0; - remaining = length; - do - { - read = MIN(NEAR_BUF_SIZE, remaining); - READFILE(io_ptr, buf, 1, err); - png_memcpy(data, buf, read); /* copy far buffer to near buffer */ - if(err != read) - break; - else - check += err; - data += read; - remaining -= read; - } - while (remaining != 0); - } - if (check != length) - { - png_error(png_ptr, "read Error"); - } -} -#endif /* USE_FAR_KEYWORD */ - -#if defined(PNG_WRITE_FLUSH_SUPPORTED) -static void -pngtest_flush(png_structp png_ptr) -{ -#if !defined(_WIN32_WCE) - png_FILE_p io_ptr; - io_ptr = (png_FILE_p)CVT_PTR((png_ptr->io_ptr)); - if (io_ptr != NULL) - fflush(io_ptr); -#endif -} -#endif - -/* This is the function that does the actual writing of data. If you are - not writing to a standard C stream, you should create a replacement - write_data function and use it at run time with png_set_write_fn(), rather - than changing the library. */ -#ifndef USE_FAR_KEYWORD -static void -pngtest_write_data(png_structp png_ptr, png_bytep data, png_size_t length) -{ - png_uint_32 check; - - WRITEFILE((png_FILE_p)png_ptr->io_ptr, data, length, check); - if (check != length) - { - png_error(png_ptr, "Write Error"); - } -} -#else -/* this is the model-independent version. Since the standard I/O library - can't handle far buffers in the medium and small models, we have to copy - the data. -*/ - -#define NEAR_BUF_SIZE 1024 -#define MIN(a,b) (a <= b ? a : b) - -static void -pngtest_write_data(png_structp png_ptr, png_bytep data, png_size_t length) -{ - png_uint_32 check; - png_byte *near_data; /* Needs to be "png_byte *" instead of "png_bytep" */ - png_FILE_p io_ptr; - - /* Check if data really is near. If so, use usual code. */ - near_data = (png_byte *)CVT_PTR_NOCHECK(data); - io_ptr = (png_FILE_p)CVT_PTR(png_ptr->io_ptr); - if ((png_bytep)near_data == data) - { - WRITEFILE(io_ptr, near_data, length, check); - } - else - { - png_byte buf[NEAR_BUF_SIZE]; - png_size_t written, remaining, err; - check = 0; - remaining = length; - do - { - written = MIN(NEAR_BUF_SIZE, remaining); - png_memcpy(buf, data, written); /* copy far buffer to near buffer */ - WRITEFILE(io_ptr, buf, written, err); - if (err != written) - break; - else - check += err; - data += written; - remaining -= written; - } - while (remaining != 0); - } - if (check != length) - { - png_error(png_ptr, "Write Error"); - } -} - -#endif /* USE_FAR_KEYWORD */ - -/* This function is called when there is a warning, but the library thinks - * it can continue anyway. Replacement functions don't have to do anything - * here if you don't want to. In the default configuration, png_ptr is - * not used, but it is passed in case it may be useful. - */ -static void -pngtest_warning(png_structp png_ptr, png_const_charp message) -{ - PNG_CONST char *name = "UNKNOWN (ERROR!)"; - if (png_ptr != NULL && png_ptr->error_ptr != NULL) - name = png_ptr->error_ptr; - fprintf(STDERR, "%s: libpng warning: %s\n", name, message); -} - -/* This is the default error handling function. Note that replacements for - * this function MUST NOT RETURN, or the program will likely crash. This - * function is used by default, or if the program supplies NULL for the - * error function pointer in png_set_error_fn(). - */ -static void -pngtest_error(png_structp png_ptr, png_const_charp message) -{ - pngtest_warning(png_ptr, message); - /* We can return because png_error calls the default handler, which is - * actually OK in this case. */ -} -#endif /* PNG_NO_STDIO */ -/* END of code to validate stdio-free compilation */ - -/* START of code to validate memory allocation and deallocation */ -#if defined(PNG_USER_MEM_SUPPORTED) && PNG_DEBUG - -/* Allocate memory. For reasonable files, size should never exceed - 64K. However, zlib may allocate more then 64K if you don't tell - it not to. See zconf.h and png.h for more information. zlib does - need to allocate exactly 64K, so whatever you call here must - have the ability to do that. - - This piece of code can be compiled to validate max 64K allocations - by setting MAXSEG_64K in zlib zconf.h *or* PNG_MAX_MALLOC_64K. */ -typedef struct memory_information -{ - png_uint_32 size; - png_voidp pointer; - struct memory_information FAR *next; -} memory_information; -typedef memory_information FAR *memory_infop; - -static memory_infop pinformation = NULL; -static int current_allocation = 0; -static int maximum_allocation = 0; -static int total_allocation = 0; -static int num_allocations = 0; - -png_voidp png_debug_malloc PNGARG((png_structp png_ptr, png_uint_32 size)); -void png_debug_free PNGARG((png_structp png_ptr, png_voidp ptr)); - -png_voidp -png_debug_malloc(png_structp png_ptr, png_uint_32 size) -{ - - /* png_malloc has already tested for NULL; png_create_struct calls - png_debug_malloc directly, with png_ptr == NULL which is OK */ - - if (size == 0) - return (NULL); - - /* This calls the library allocator twice, once to get the requested - buffer and once to get a new free list entry. */ - { - /* Disable malloc_fn and free_fn */ - memory_infop pinfo; - png_set_mem_fn(png_ptr, NULL, NULL, NULL); - pinfo = (memory_infop)png_malloc(png_ptr, - (png_uint_32)png_sizeof (*pinfo)); - pinfo->size = size; - current_allocation += size; - total_allocation += size; - num_allocations ++; - if (current_allocation > maximum_allocation) - maximum_allocation = current_allocation; - pinfo->pointer = (png_voidp)png_malloc(png_ptr, size); - /* Restore malloc_fn and free_fn */ - png_set_mem_fn(png_ptr, png_voidp_NULL, (png_malloc_ptr)png_debug_malloc, - (png_free_ptr)png_debug_free); - if (size != 0 && pinfo->pointer == NULL) - { - current_allocation -= size; - total_allocation -= size; - png_error(png_ptr, - "out of memory in pngtest->png_debug_malloc."); - } - pinfo->next = pinformation; - pinformation = pinfo; - /* Make sure the caller isn't assuming zeroed memory. */ - png_memset(pinfo->pointer, 0xdd, pinfo->size); - if(verbose) - printf("png_malloc %lu bytes at %x\n",size,pinfo->pointer); - assert(pinfo->size != 12345678); - return (png_voidp)(pinfo->pointer); - } -} - -/* Free a pointer. It is removed from the list at the same time. */ -void -png_debug_free(png_structp png_ptr, png_voidp ptr) -{ - if (png_ptr == NULL) - fprintf(STDERR, "NULL pointer to png_debug_free.\n"); - if (ptr == 0) - { -#if 0 /* This happens all the time. */ - fprintf(STDERR, "WARNING: freeing NULL pointer\n"); -#endif - return; - } - - /* Unlink the element from the list. */ - { - memory_infop FAR *ppinfo = &pinformation; - for (;;) - { - memory_infop pinfo = *ppinfo; - if (pinfo->pointer == ptr) - { - *ppinfo = pinfo->next; - current_allocation -= pinfo->size; - if (current_allocation < 0) - fprintf(STDERR, "Duplicate free of memory\n"); - /* We must free the list element too, but first kill - the memory that is to be freed. */ - png_memset(ptr, 0x55, pinfo->size); - png_free_default(png_ptr, pinfo); - pinfo=NULL; - break; - } - if (pinfo->next == NULL) - { - fprintf(STDERR, "Pointer %x not found\n", (unsigned int)ptr); - break; - } - ppinfo = &pinfo->next; - } - } - - /* Finally free the data. */ - if(verbose) - printf("Freeing %x\n",ptr); - png_free_default(png_ptr, ptr); - ptr=NULL; -} -#endif /* PNG_USER_MEM_SUPPORTED && PNG_DEBUG */ -/* END of code to test memory allocation/deallocation */ - -/* Test one file */ -int -test_one_file(PNG_CONST char *inname, PNG_CONST char *outname) -{ - static png_FILE_p fpin; - static png_FILE_p fpout; /* "static" prevents setjmp corruption */ - png_structp read_ptr; - png_infop read_info_ptr, end_info_ptr; -#ifdef PNG_WRITE_SUPPORTED - png_structp write_ptr; - png_infop write_info_ptr; - png_infop write_end_info_ptr; -#else - png_structp write_ptr = NULL; - png_infop write_info_ptr = NULL; - png_infop write_end_info_ptr = NULL; -#endif - png_bytep row_buf; - png_uint_32 y; - png_uint_32 width, height; - int num_pass, pass; - int bit_depth, color_type; -#ifdef PNG_SETJMP_SUPPORTED -#ifdef USE_FAR_KEYWORD - jmp_buf jmpbuf; -#endif -#endif - -#if defined(_WIN32_WCE) - TCHAR path[MAX_PATH]; -#endif - char inbuf[256], outbuf[256]; - - row_buf = NULL; - -#if defined(_WIN32_WCE) - MultiByteToWideChar(CP_ACP, 0, inname, -1, path, MAX_PATH); - if ((fpin = CreateFile(path, GENERIC_READ, 0, NULL, OPEN_EXISTING, 0, NULL)) == INVALID_HANDLE_VALUE) -#else - if ((fpin = fopen(inname, "rb")) == NULL) -#endif - { - fprintf(STDERR, "Could not find input file %s\n", inname); - return (1); - } - -#if defined(_WIN32_WCE) - MultiByteToWideChar(CP_ACP, 0, outname, -1, path, MAX_PATH); - if ((fpout = CreateFile(path, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0, NULL)) == INVALID_HANDLE_VALUE) -#else - if ((fpout = fopen(outname, "wb")) == NULL) -#endif - { - fprintf(STDERR, "Could not open output file %s\n", outname); - FCLOSE(fpin); - return (1); - } - - png_debug(0, "Allocating read and write structures\n"); -#if defined(PNG_USER_MEM_SUPPORTED) && PNG_DEBUG - read_ptr = png_create_read_struct_2(PNG_LIBPNG_VER_STRING, png_voidp_NULL, - png_error_ptr_NULL, png_error_ptr_NULL, png_voidp_NULL, - (png_malloc_ptr)png_debug_malloc, (png_free_ptr)png_debug_free); -#else - read_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING, png_voidp_NULL, - png_error_ptr_NULL, png_error_ptr_NULL); -#endif -#if defined(PNG_NO_STDIO) - png_set_error_fn(read_ptr, (png_voidp)inname, pngtest_error, - pngtest_warning); -#endif -#ifdef PNG_WRITE_SUPPORTED -#if defined(PNG_USER_MEM_SUPPORTED) && PNG_DEBUG - write_ptr = png_create_write_struct_2(PNG_LIBPNG_VER_STRING, png_voidp_NULL, - png_error_ptr_NULL, png_error_ptr_NULL, png_voidp_NULL, - (png_malloc_ptr)png_debug_malloc, (png_free_ptr)png_debug_free); -#else - write_ptr = png_create_write_struct(PNG_LIBPNG_VER_STRING, png_voidp_NULL, - png_error_ptr_NULL, png_error_ptr_NULL); -#endif -#if defined(PNG_NO_STDIO) - png_set_error_fn(write_ptr, (png_voidp)inname, pngtest_error, - pngtest_warning); -#endif -#endif - png_debug(0, "Allocating read_info, write_info and end_info structures\n"); - read_info_ptr = png_create_info_struct(read_ptr); - end_info_ptr = png_create_info_struct(read_ptr); -#ifdef PNG_WRITE_SUPPORTED - write_info_ptr = png_create_info_struct(write_ptr); - write_end_info_ptr = png_create_info_struct(write_ptr); -#endif - -#ifdef PNG_SETJMP_SUPPORTED - png_debug(0, "Setting jmpbuf for read struct\n"); -#ifdef USE_FAR_KEYWORD - if (setjmp(jmpbuf)) -#else - if (setjmp(png_jmpbuf(read_ptr))) -#endif - { - fprintf(STDERR, "%s -> %s: libpng read error\n", inname, outname); - if (row_buf) - png_free(read_ptr, row_buf); - png_destroy_read_struct(&read_ptr, &read_info_ptr, &end_info_ptr); -#ifdef PNG_WRITE_SUPPORTED - png_destroy_info_struct(write_ptr, &write_end_info_ptr); - png_destroy_write_struct(&write_ptr, &write_info_ptr); -#endif - FCLOSE(fpin); - FCLOSE(fpout); - return (1); - } -#ifdef USE_FAR_KEYWORD - png_memcpy(png_jmpbuf(read_ptr),jmpbuf,png_sizeof(jmp_buf)); -#endif - -#ifdef PNG_WRITE_SUPPORTED - png_debug(0, "Setting jmpbuf for write struct\n"); -#ifdef USE_FAR_KEYWORD - if (setjmp(jmpbuf)) -#else - if (setjmp(png_jmpbuf(write_ptr))) -#endif - { - fprintf(STDERR, "%s -> %s: libpng write error\n", inname, outname); - png_destroy_read_struct(&read_ptr, &read_info_ptr, &end_info_ptr); - png_destroy_info_struct(write_ptr, &write_end_info_ptr); -#ifdef PNG_WRITE_SUPPORTED - png_destroy_write_struct(&write_ptr, &write_info_ptr); -#endif - FCLOSE(fpin); - FCLOSE(fpout); - return (1); - } -#ifdef USE_FAR_KEYWORD - png_memcpy(png_jmpbuf(write_ptr),jmpbuf,png_sizeof(jmp_buf)); -#endif -#endif -#endif - - png_debug(0, "Initializing input and output streams\n"); -#if !defined(PNG_NO_STDIO) - png_init_io(read_ptr, fpin); -# ifdef PNG_WRITE_SUPPORTED - png_init_io(write_ptr, fpout); -# endif -#else - png_set_read_fn(read_ptr, (png_voidp)fpin, pngtest_read_data); -# ifdef PNG_WRITE_SUPPORTED - png_set_write_fn(write_ptr, (png_voidp)fpout, pngtest_write_data, -# if defined(PNG_WRITE_FLUSH_SUPPORTED) - pngtest_flush); -# else - NULL); -# endif -# endif -#endif - if(status_dots_requested == 1) - { -#ifdef PNG_WRITE_SUPPORTED - png_set_write_status_fn(write_ptr, write_row_callback); -#endif - png_set_read_status_fn(read_ptr, read_row_callback); - } - else - { -#ifdef PNG_WRITE_SUPPORTED - png_set_write_status_fn(write_ptr, png_write_status_ptr_NULL); -#endif - png_set_read_status_fn(read_ptr, png_read_status_ptr_NULL); - } - -#if defined(PNG_READ_USER_TRANSFORM_SUPPORTED) - { - int i; - for(i=0; i<256; i++) - filters_used[i]=0; - png_set_read_user_transform_fn(read_ptr, count_filters); - } -#endif -#if defined(PNG_WRITE_USER_TRANSFORM_SUPPORTED) - zero_samples=0; - png_set_write_user_transform_fn(write_ptr, count_zero_samples); -#endif - -#if defined(PNG_READ_UNKNOWN_CHUNKS_SUPPORTED) -# ifndef PNG_HANDLE_CHUNK_ALWAYS -# define PNG_HANDLE_CHUNK_ALWAYS 3 -# endif - png_set_keep_unknown_chunks(read_ptr, PNG_HANDLE_CHUNK_ALWAYS, - png_bytep_NULL, 0); -#endif -#if defined(PNG_WRITE_UNKNOWN_CHUNKS_SUPPORTED) -# ifndef PNG_HANDLE_CHUNK_IF_SAFE -# define PNG_HANDLE_CHUNK_IF_SAFE 2 -# endif - png_set_keep_unknown_chunks(write_ptr, PNG_HANDLE_CHUNK_IF_SAFE, - png_bytep_NULL, 0); -#endif - - png_debug(0, "Reading info struct\n"); - png_read_info(read_ptr, read_info_ptr); - - png_debug(0, "Transferring info struct\n"); - { - int interlace_type, compression_type, filter_type; - - if (png_get_IHDR(read_ptr, read_info_ptr, &width, &height, &bit_depth, - &color_type, &interlace_type, &compression_type, &filter_type)) - { - png_set_IHDR(write_ptr, write_info_ptr, width, height, bit_depth, -#if defined(PNG_WRITE_INTERLACING_SUPPORTED) - color_type, interlace_type, compression_type, filter_type); -#else - color_type, PNG_INTERLACE_NONE, compression_type, filter_type); -#endif - } - } -#if defined(PNG_FIXED_POINT_SUPPORTED) -#if defined(PNG_cHRM_SUPPORTED) - { - png_fixed_point white_x, white_y, red_x, red_y, green_x, green_y, blue_x, - blue_y; - if (png_get_cHRM_fixed(read_ptr, read_info_ptr, &white_x, &white_y, &red_x, - &red_y, &green_x, &green_y, &blue_x, &blue_y)) - { - png_set_cHRM_fixed(write_ptr, write_info_ptr, white_x, white_y, red_x, - red_y, green_x, green_y, blue_x, blue_y); - } - } -#endif -#if defined(PNG_gAMA_SUPPORTED) - { - png_fixed_point gamma; - - if (png_get_gAMA_fixed(read_ptr, read_info_ptr, &gamma)) - { - png_set_gAMA_fixed(write_ptr, write_info_ptr, gamma); - } - } -#endif -#else /* Use floating point versions */ -#if defined(PNG_FLOATING_POINT_SUPPORTED) -#if defined(PNG_cHRM_SUPPORTED) - { - double white_x, white_y, red_x, red_y, green_x, green_y, blue_x, - blue_y; - if (png_get_cHRM(read_ptr, read_info_ptr, &white_x, &white_y, &red_x, - &red_y, &green_x, &green_y, &blue_x, &blue_y)) - { - png_set_cHRM(write_ptr, write_info_ptr, white_x, white_y, red_x, - red_y, green_x, green_y, blue_x, blue_y); - } - } -#endif -#if defined(PNG_gAMA_SUPPORTED) - { - double gamma; - - if (png_get_gAMA(read_ptr, read_info_ptr, &gamma)) - { - png_set_gAMA(write_ptr, write_info_ptr, gamma); - } - } -#endif -#endif /* floating point */ -#endif /* fixed point */ -#if defined(PNG_iCCP_SUPPORTED) - { - png_charp name; - png_charp profile; - png_uint_32 proflen; - int compression_type; - - if (png_get_iCCP(read_ptr, read_info_ptr, &name, &compression_type, - &profile, &proflen)) - { - png_set_iCCP(write_ptr, write_info_ptr, name, compression_type, - profile, proflen); - } - } -#endif -#if defined(PNG_sRGB_SUPPORTED) - { - int intent; - - if (png_get_sRGB(read_ptr, read_info_ptr, &intent)) - { - png_set_sRGB(write_ptr, write_info_ptr, intent); - } - } -#endif - { - png_colorp palette; - int num_palette; - - if (png_get_PLTE(read_ptr, read_info_ptr, &palette, &num_palette)) - { - png_set_PLTE(write_ptr, write_info_ptr, palette, num_palette); - } - } -#if defined(PNG_bKGD_SUPPORTED) - { - png_color_16p background; - - if (png_get_bKGD(read_ptr, read_info_ptr, &background)) - { - png_set_bKGD(write_ptr, write_info_ptr, background); - } - } -#endif -#if defined(PNG_hIST_SUPPORTED) - { - png_uint_16p hist; - - if (png_get_hIST(read_ptr, read_info_ptr, &hist)) - { - png_set_hIST(write_ptr, write_info_ptr, hist); - } - } -#endif -#if defined(PNG_oFFs_SUPPORTED) - { - png_int_32 offset_x, offset_y; - int unit_type; - - if (png_get_oFFs(read_ptr, read_info_ptr,&offset_x,&offset_y,&unit_type)) - { - png_set_oFFs(write_ptr, write_info_ptr, offset_x, offset_y, unit_type); - } - } -#endif -#if defined(PNG_pCAL_SUPPORTED) - { - png_charp purpose, units; - png_charpp params; - png_int_32 X0, X1; - int type, nparams; - - if (png_get_pCAL(read_ptr, read_info_ptr, &purpose, &X0, &X1, &type, - &nparams, &units, ¶ms)) - { - png_set_pCAL(write_ptr, write_info_ptr, purpose, X0, X1, type, - nparams, units, params); - } - } -#endif -#if defined(PNG_pHYs_SUPPORTED) - { - png_uint_32 res_x, res_y; - int unit_type; - - if (png_get_pHYs(read_ptr, read_info_ptr, &res_x, &res_y, &unit_type)) - { - png_set_pHYs(write_ptr, write_info_ptr, res_x, res_y, unit_type); - } - } -#endif -#if defined(PNG_sBIT_SUPPORTED) - { - png_color_8p sig_bit; - - if (png_get_sBIT(read_ptr, read_info_ptr, &sig_bit)) - { - png_set_sBIT(write_ptr, write_info_ptr, sig_bit); - } - } -#endif -#if defined(PNG_sCAL_SUPPORTED) -#ifdef PNG_FLOATING_POINT_SUPPORTED - { - int unit; - double scal_width, scal_height; - - if (png_get_sCAL(read_ptr, read_info_ptr, &unit, &scal_width, - &scal_height)) - { - png_set_sCAL(write_ptr, write_info_ptr, unit, scal_width, scal_height); - } - } -#else -#ifdef PNG_FIXED_POINT_SUPPORTED - { - int unit; - png_charp scal_width, scal_height; - - if (png_get_sCAL_s(read_ptr, read_info_ptr, &unit, &scal_width, - &scal_height)) - { - png_set_sCAL_s(write_ptr, write_info_ptr, unit, scal_width, scal_height); - } - } -#endif -#endif -#endif -#if defined(PNG_TEXT_SUPPORTED) - { - png_textp text_ptr; - int num_text; - - if (png_get_text(read_ptr, read_info_ptr, &text_ptr, &num_text) > 0) - { - png_debug1(0, "Handling %d iTXt/tEXt/zTXt chunks\n", num_text); - png_set_text(write_ptr, write_info_ptr, text_ptr, num_text); - } - } -#endif -#if defined(PNG_tIME_SUPPORTED) - { - png_timep mod_time; - - if (png_get_tIME(read_ptr, read_info_ptr, &mod_time)) - { - png_set_tIME(write_ptr, write_info_ptr, mod_time); -#if defined(PNG_TIME_RFC1123_SUPPORTED) - /* we have to use png_strcpy instead of "=" because the string - pointed to by png_convert_to_rfc1123() gets free'ed before - we use it */ - png_strcpy(tIME_string,png_convert_to_rfc1123(read_ptr, mod_time)); - tIME_chunk_present++; -#endif /* PNG_TIME_RFC1123_SUPPORTED */ - } - } -#endif -#if defined(PNG_tRNS_SUPPORTED) - { - png_bytep trans; - int num_trans; - png_color_16p trans_values; - - if (png_get_tRNS(read_ptr, read_info_ptr, &trans, &num_trans, - &trans_values)) - { - png_set_tRNS(write_ptr, write_info_ptr, trans, num_trans, - trans_values); - } - } -#endif -#if defined(PNG_WRITE_UNKNOWN_CHUNKS_SUPPORTED) - { - png_unknown_chunkp unknowns; - int num_unknowns = (int)png_get_unknown_chunks(read_ptr, read_info_ptr, - &unknowns); - if (num_unknowns) - { - png_size_t i; - png_set_unknown_chunks(write_ptr, write_info_ptr, unknowns, - num_unknowns); - /* copy the locations from the read_info_ptr. The automatically - generated locations in write_info_ptr are wrong because we - haven't written anything yet */ - for (i = 0; i < (png_size_t)num_unknowns; i++) - png_set_unknown_chunk_location(write_ptr, write_info_ptr, i, - unknowns[i].location); - } - } -#endif - -#ifdef PNG_WRITE_SUPPORTED - png_debug(0, "\nWriting info struct\n"); - -/* If we wanted, we could write info in two steps: - png_write_info_before_PLTE(write_ptr, write_info_ptr); - */ - png_write_info(write_ptr, write_info_ptr); -#endif - -#ifdef SINGLE_ROWBUF_ALLOC - png_debug(0, "\nAllocating row buffer..."); - row_buf = (png_bytep)png_malloc(read_ptr, - png_get_rowbytes(read_ptr, read_info_ptr)); - png_debug1(0, "0x%08lx\n\n", (unsigned long)row_buf); -#endif /* SINGLE_ROWBUF_ALLOC */ - png_debug(0, "Writing row data\n"); - -#if defined(PNG_READ_INTERLACING_SUPPORTED) || \ - defined(PNG_WRITE_INTERLACING_SUPPORTED) - num_pass = png_set_interlace_handling(read_ptr); -# ifdef PNG_WRITE_SUPPORTED - png_set_interlace_handling(write_ptr); -# endif -#else - num_pass=1; -#endif - -#ifdef PNGTEST_TIMING - t_stop = (float)clock(); - t_misc += (t_stop - t_start); - t_start = t_stop; -#endif - for (pass = 0; pass < num_pass; pass++) - { - png_debug1(0, "Writing row data for pass %d\n",pass); - for (y = 0; y < height; y++) - { -#ifndef SINGLE_ROWBUF_ALLOC - png_debug2(0, "\nAllocating row buffer (pass %d, y = %ld)...", pass,y); - row_buf = (png_bytep)png_malloc(read_ptr, - png_get_rowbytes(read_ptr, read_info_ptr)); - png_debug2(0, "0x%08lx (%ld bytes)\n", (unsigned long)row_buf, - png_get_rowbytes(read_ptr, read_info_ptr)); -#endif /* !SINGLE_ROWBUF_ALLOC */ - png_read_rows(read_ptr, (png_bytepp)&row_buf, png_bytepp_NULL, 1); - -#ifdef PNG_WRITE_SUPPORTED -#ifdef PNGTEST_TIMING - t_stop = (float)clock(); - t_decode += (t_stop - t_start); - t_start = t_stop; -#endif - png_write_rows(write_ptr, (png_bytepp)&row_buf, 1); -#ifdef PNGTEST_TIMING - t_stop = (float)clock(); - t_encode += (t_stop - t_start); - t_start = t_stop; -#endif -#endif /* PNG_WRITE_SUPPORTED */ - -#ifndef SINGLE_ROWBUF_ALLOC - png_debug2(0, "Freeing row buffer (pass %d, y = %ld)\n\n", pass, y); - png_free(read_ptr, row_buf); -#endif /* !SINGLE_ROWBUF_ALLOC */ - } - } - -#if defined(PNG_READ_UNKNOWN_CHUNKS_SUPPORTED) - png_free_data(read_ptr, read_info_ptr, PNG_FREE_UNKN, -1); -#endif -#if defined(PNG_WRITE_UNKNOWN_CHUNKS_SUPPORTED) - png_free_data(write_ptr, write_info_ptr, PNG_FREE_UNKN, -1); -#endif - - png_debug(0, "Reading and writing end_info data\n"); - - png_read_end(read_ptr, end_info_ptr); -#if defined(PNG_TEXT_SUPPORTED) - { - png_textp text_ptr; - int num_text; - - if (png_get_text(read_ptr, end_info_ptr, &text_ptr, &num_text) > 0) - { - png_debug1(0, "Handling %d iTXt/tEXt/zTXt chunks\n", num_text); - png_set_text(write_ptr, write_end_info_ptr, text_ptr, num_text); - } - } -#endif -#if defined(PNG_tIME_SUPPORTED) - { - png_timep mod_time; - - if (png_get_tIME(read_ptr, end_info_ptr, &mod_time)) - { - png_set_tIME(write_ptr, write_end_info_ptr, mod_time); -#if defined(PNG_TIME_RFC1123_SUPPORTED) - /* we have to use png_strcpy instead of "=" because the string - pointed to by png_convert_to_rfc1123() gets free'ed before - we use it */ - png_strcpy(tIME_string,png_convert_to_rfc1123(read_ptr, mod_time)); - tIME_chunk_present++; -#endif /* PNG_TIME_RFC1123_SUPPORTED */ - } - } -#endif -#if defined(PNG_WRITE_UNKNOWN_CHUNKS_SUPPORTED) - { - png_unknown_chunkp unknowns; - int num_unknowns; - num_unknowns = (int)png_get_unknown_chunks(read_ptr, end_info_ptr, - &unknowns); - if (num_unknowns) - { - png_size_t i; - png_set_unknown_chunks(write_ptr, write_end_info_ptr, unknowns, - num_unknowns); - /* copy the locations from the read_info_ptr. The automatically - generated locations in write_end_info_ptr are wrong because we - haven't written the end_info yet */ - for (i = 0; i < (png_size_t)num_unknowns; i++) - png_set_unknown_chunk_location(write_ptr, write_end_info_ptr, i, - unknowns[i].location); - } - } -#endif -#ifdef PNG_WRITE_SUPPORTED - png_write_end(write_ptr, write_end_info_ptr); -#endif - -#ifdef PNG_EASY_ACCESS_SUPPORTED - if(verbose) - { - png_uint_32 iwidth, iheight; - iwidth = png_get_image_width(write_ptr, write_info_ptr); - iheight = png_get_image_height(write_ptr, write_info_ptr); - fprintf(STDERR, "Image width = %lu, height = %lu\n", - iwidth, iheight); - } -#endif - - png_debug(0, "Destroying data structs\n"); -#ifdef SINGLE_ROWBUF_ALLOC - png_debug(1, "destroying row_buf for read_ptr\n"); - png_free(read_ptr, row_buf); - row_buf=NULL; -#endif /* SINGLE_ROWBUF_ALLOC */ - png_debug(1, "destroying read_ptr, read_info_ptr, end_info_ptr\n"); - png_destroy_read_struct(&read_ptr, &read_info_ptr, &end_info_ptr); -#ifdef PNG_WRITE_SUPPORTED - png_debug(1, "destroying write_end_info_ptr\n"); - png_destroy_info_struct(write_ptr, &write_end_info_ptr); - png_debug(1, "destroying write_ptr, write_info_ptr\n"); - png_destroy_write_struct(&write_ptr, &write_info_ptr); -#endif - png_debug(0, "Destruction complete.\n"); - - FCLOSE(fpin); - FCLOSE(fpout); - - png_debug(0, "Opening files for comparison\n"); -#if defined(_WIN32_WCE) - MultiByteToWideChar(CP_ACP, 0, inname, -1, path, MAX_PATH); - if ((fpin = CreateFile(path, GENERIC_READ, 0, NULL, OPEN_EXISTING, 0, NULL)) == INVALID_HANDLE_VALUE) -#else - if ((fpin = fopen(inname, "rb")) == NULL) -#endif - { - fprintf(STDERR, "Could not find file %s\n", inname); - return (1); - } - -#if defined(_WIN32_WCE) - MultiByteToWideChar(CP_ACP, 0, outname, -1, path, MAX_PATH); - if ((fpout = CreateFile(path, GENERIC_READ, 0, NULL, OPEN_EXISTING, 0, NULL)) == INVALID_HANDLE_VALUE) -#else - if ((fpout = fopen(outname, "rb")) == NULL) -#endif - { - fprintf(STDERR, "Could not find file %s\n", outname); - FCLOSE(fpin); - return (1); - } - - for(;;) - { - png_size_t num_in, num_out; - - READFILE(fpin, inbuf, 1, num_in); - READFILE(fpout, outbuf, 1, num_out); - - if (num_in != num_out) - { - fprintf(STDERR, "\nFiles %s and %s are of a different size\n", - inname, outname); - if(wrote_question == 0) - { - fprintf(STDERR, - " Was %s written with the same maximum IDAT chunk size (%d bytes),", - inname,PNG_ZBUF_SIZE); - fprintf(STDERR, - "\n filtering heuristic (libpng default), compression"); - fprintf(STDERR, - " level (zlib default),\n and zlib version (%s)?\n\n", - ZLIB_VERSION); - wrote_question=1; - } - FCLOSE(fpin); - FCLOSE(fpout); - return (0); - } - - if (!num_in) - break; - - if (png_memcmp(inbuf, outbuf, num_in)) - { - fprintf(STDERR, "\nFiles %s and %s are different\n", inname, outname); - if(wrote_question == 0) - { - fprintf(STDERR, - " Was %s written with the same maximum IDAT chunk size (%d bytes),", - inname,PNG_ZBUF_SIZE); - fprintf(STDERR, - "\n filtering heuristic (libpng default), compression"); - fprintf(STDERR, - " level (zlib default),\n and zlib version (%s)?\n\n", - ZLIB_VERSION); - wrote_question=1; - } - FCLOSE(fpin); - FCLOSE(fpout); - return (0); - } - } - - FCLOSE(fpin); - FCLOSE(fpout); - - return (0); -} - -/* input and output filenames */ -#ifdef RISCOS -static PNG_CONST char *inname = "pngtest/png"; -static PNG_CONST char *outname = "pngout/png"; -#else -static PNG_CONST char *inname = "pngtest.png"; -static PNG_CONST char *outname = "pngout.png"; -#endif - -int -main(int argc, char *argv[]) -{ - int multiple = 0; - int ierror = 0; - - fprintf(STDERR, "Testing libpng version %s\n", PNG_LIBPNG_VER_STRING); - fprintf(STDERR, " with zlib version %s\n", ZLIB_VERSION); - fprintf(STDERR,"%s",png_get_copyright(NULL)); - /* Show the version of libpng used in building the library */ - fprintf(STDERR," library (%lu):%s", png_access_version_number(), - png_get_header_version(NULL)); - /* Show the version of libpng used in building the application */ - fprintf(STDERR," pngtest (%lu):%s", (unsigned long)PNG_LIBPNG_VER, - PNG_HEADER_VERSION_STRING); - fprintf(STDERR," png_sizeof(png_struct)=%ld, png_sizeof(png_info)=%ld\n", - (long)png_sizeof(png_struct), (long)png_sizeof(png_info)); - - /* Do some consistency checking on the memory allocation settings, I'm - not sure this matters, but it is nice to know, the first of these - tests should be impossible because of the way the macros are set - in pngconf.h */ -#if defined(MAXSEG_64K) && !defined(PNG_MAX_MALLOC_64K) - fprintf(STDERR, " NOTE: Zlib compiled for max 64k, libpng not\n"); -#endif - /* I think the following can happen. */ -#if !defined(MAXSEG_64K) && defined(PNG_MAX_MALLOC_64K) - fprintf(STDERR, " NOTE: libpng compiled for max 64k, zlib not\n"); -#endif - - if (strcmp(png_libpng_ver, PNG_LIBPNG_VER_STRING)) - { - fprintf(STDERR, - "Warning: versions are different between png.h and png.c\n"); - fprintf(STDERR, " png.h version: %s\n", PNG_LIBPNG_VER_STRING); - fprintf(STDERR, " png.c version: %s\n\n", png_libpng_ver); - ++ierror; - } - - if (argc > 1) - { - if (strcmp(argv[1], "-m") == 0) - { - multiple = 1; - status_dots_requested = 0; - } - else if (strcmp(argv[1], "-mv") == 0 || - strcmp(argv[1], "-vm") == 0 ) - { - multiple = 1; - verbose = 1; - status_dots_requested = 1; - } - else if (strcmp(argv[1], "-v") == 0) - { - verbose = 1; - status_dots_requested = 1; - inname = argv[2]; - } - else - { - inname = argv[1]; - status_dots_requested = 0; - } - } - - if (!multiple && argc == 3+verbose) - outname = argv[2+verbose]; - - if ((!multiple && argc > 3+verbose) || (multiple && argc < 2)) - { - fprintf(STDERR, - "usage: %s [infile.png] [outfile.png]\n\t%s -m {infile.png}\n", - argv[0], argv[0]); - fprintf(STDERR, - " reads/writes one PNG file (without -m) or multiple files (-m)\n"); - fprintf(STDERR, - " with -m %s is used as a temporary file\n", outname); - exit(1); - } - - if (multiple) - { - int i; -#if defined(PNG_USER_MEM_SUPPORTED) && PNG_DEBUG - int allocation_now = current_allocation; -#endif - for (i=2; isize, - (unsigned int) pinfo->pointer); - pinfo = pinfo->next; - } - } -#endif - } -#if defined(PNG_USER_MEM_SUPPORTED) && PNG_DEBUG - fprintf(STDERR, " Current memory allocation: %10d bytes\n", - current_allocation); - fprintf(STDERR, " Maximum memory allocation: %10d bytes\n", - maximum_allocation); - fprintf(STDERR, " Total memory allocation: %10d bytes\n", - total_allocation); - fprintf(STDERR, " Number of allocations: %10d\n", - num_allocations); -#endif - } - else - { - int i; - for (i=0; i<3; ++i) - { - int kerror; -#if defined(PNG_USER_MEM_SUPPORTED) && PNG_DEBUG - int allocation_now = current_allocation; -#endif - if (i == 1) status_dots_requested = 1; - else if(verbose == 0)status_dots_requested = 0; - if (i == 0 || verbose == 1 || ierror != 0) - fprintf(STDERR, "Testing %s:",inname); - kerror = test_one_file(inname, outname); - if(kerror == 0) - { - if(verbose == 1 || i == 2) - { -#if defined(PNG_READ_USER_TRANSFORM_SUPPORTED) - int k; -#endif -#if defined(PNG_WRITE_USER_TRANSFORM_SUPPORTED) - fprintf(STDERR, "\n PASS (%lu zero samples)\n",zero_samples); -#else - fprintf(STDERR, " PASS\n"); -#endif -#if defined(PNG_READ_USER_TRANSFORM_SUPPORTED) - for (k=0; k<256; k++) - if(filters_used[k]) - fprintf(STDERR, " Filter %d was used %lu times\n", - k,filters_used[k]); -#endif -#if defined(PNG_TIME_RFC1123_SUPPORTED) - if(tIME_chunk_present != 0) - fprintf(STDERR, " tIME = %s\n",tIME_string); -#endif /* PNG_TIME_RFC1123_SUPPORTED */ - } - } - else - { - if(verbose == 0 && i != 2) - fprintf(STDERR, "Testing %s:",inname); - fprintf(STDERR, " FAIL\n"); - ierror += kerror; - } -#if defined(PNG_USER_MEM_SUPPORTED) && PNG_DEBUG - if (allocation_now != current_allocation) - fprintf(STDERR, "MEMORY ERROR: %d bytes lost\n", - current_allocation-allocation_now); - if (current_allocation != 0) - { - memory_infop pinfo = pinformation; - - fprintf(STDERR, "MEMORY ERROR: %d bytes still allocated\n", - current_allocation); - while (pinfo != NULL) - { - fprintf(STDERR," %lu bytes at %x\n", - pinfo->size, (unsigned int)pinfo->pointer); - pinfo = pinfo->next; - } - } -#endif - } -#if defined(PNG_USER_MEM_SUPPORTED) && PNG_DEBUG - fprintf(STDERR, " Current memory allocation: %10d bytes\n", - current_allocation); - fprintf(STDERR, " Maximum memory allocation: %10d bytes\n", - maximum_allocation); - fprintf(STDERR, " Total memory allocation: %10d bytes\n", - total_allocation); - fprintf(STDERR, " Number of allocations: %10d\n", - num_allocations); -#endif - } - -#ifdef PNGTEST_TIMING - t_stop = (float)clock(); - t_misc += (t_stop - t_start); - t_start = t_stop; - fprintf(STDERR," CPU time used = %.3f seconds", - (t_misc+t_decode+t_encode)/(float)CLOCKS_PER_SEC); - fprintf(STDERR," (decoding %.3f,\n", - t_decode/(float)CLOCKS_PER_SEC); - fprintf(STDERR," encoding %.3f ,", - t_encode/(float)CLOCKS_PER_SEC); - fprintf(STDERR," other %.3f seconds)\n\n", - t_misc/(float)CLOCKS_PER_SEC); -#endif - - if (ierror == 0) - fprintf(STDERR, "libpng passes test\n"); - else - fprintf(STDERR, "libpng FAILS test\n"); - return (int)(ierror != 0); -} - -/* Generate a compiler error if there is an old png.h in the search path. */ -typedef version_1_2_7 your_png_h_is_not_version_1_2_7; diff --git a/wxWidgets/src/png/pngtest.png b/wxWidgets/src/png/pngtest.png deleted file mode 100644 index f3a6df4483fc9d020c028d4e4f417767bfa72877..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8574 zcmV-^A%WhBP) z000SeMObuHX>@F508max+yQwt001AiNklO)sr#@4<(ul(br`VbraBmuhk@3?%j97U znXm>WOoQH`mkmQV#Dgk$0iE!|kWKC(UZ$ifRdrR{?y-0LgGZ$*Gb7{uBI5Vw`}_VL z{2^pm*wxREhAV)-c=gTo8wWkR0{G-;xXP6%b;|g zqv8I@RW)^t7%eD~>nQ>F*f4b!06nYt@O07vs6LIyqkVe<@%GI=8WyVu!(s*S(Wtjd zU(82uRNY!T->v-XN2ArS$X5V=dGn1YqyG7%{PGt7XU7MtdHKc8=PzFjmdlKMM?UM^ zob$|iirnz{`J^*FIa-}hE}4{WHg{nFts1NPT7|xL{NGPcRH-}Z&ORBqPLzDn!OJ*ST}> zsq;*)JZ0ti6+7x~Kj$aL=b^rKPwfk=f2HdiZa6`2T=xibJt!J~uT>R;Q>-WuGr z>+kD`02wfMflFU=HkosFJX+0N)tk;s`c_j_0VTpgzwk;lMDRY`trmcRH5e^iTso}L zSR)vfk!8Zs)3G@}KJdl}&u6aFG!TgtM$iI<%`sXitMK~Zh0#o0vVhXw#p$H%4EJ)< zKvegiUUY;EfakNabNKY4^Rw~1)3XMnGcGROU~Q3Z$tOp{)u?Y*kA}Tf&#DuEgPuJ< zdC*_IZS#MlC?WsWU;dMp2Yq`2w{6F3yXAdFiR2%R`l~FHwVxszgShFX5T7G=b4mM=VIbo_#Z_>Y62CfQ-2%~=COJAeNI2!g&<}MtD*f6g=O-we(h1e-_b-s>1&W{gPQ&&xI z4Q{e@r0Y83e2s2by@`>FOULnOaGd^zVPV;`niwO)B41gfH?f2O1Dg+S4X&?u5LyYB zuA&MNYcxt=S~{*id9>0hqh}3u6KRNuWC+O?2{3mx*67=VySkZ0B7ugU(P#uE$?S#* zA3nP<^U`hNs1O=L-7qMUC0zeN6G4f*GI$lH`!?sJg8@$`B`(yg)nK%6bkOr3pG^n% z_bowhLx3&VU^x2Ow&-EjORV01z*P*z~kq$j`Q_qeI7o$ z=uAsL(~_}ob#?znsBz2tN5E=nXC^$K&CNm2o+B`syUmU$t1!O#y{8xR0e8r)Tx#MV9OqJICk4J;^N$F?LZW%`z)Sc6#*Ki zt{TM1>}`sBZL26De?02@1_uE zB1KZ8o?We9AN1@>tL*%;tn$JtLWryZ|`ahk7ujjJ0ZgU~?b1D{?xE?te% z89p?ePD-v^jnVMz@k4+9d#%p;PGiE)*gfJpB<0RQ*0Ko zN{BHMiCnr0=WD7E$(7#310sUf>5}&Es%|K9MPbz2HST;pgJgyZqc|vXjz{~%2F|7> zu4)LeMo8F1VKqi{iXJ0aC8LK=FFIGQ!iT`a!5+Sj_z;;of9R`*xvy~{<=4YKgVtb8 z((!u2I%@;@5C}11)O8Gf=fo$M?j*)YCP_n+vf|_CQ_f~rNG4d7OqbSzM({q;YaK;l z75&1T1N`0Tq!VMTL}0j|V{@SjaXfQX$5o+Ix_Z{ch*3ge3?O7#vSxK15fQ9X^sT{% z+fL|>4k)2O4QCTak!Qr1G?8T~4b&Ob4TKnHb!<-V7xvu8fFP}HE;nNrxf&e}_s`qN z`L*8^$e%pud)1z;*np2UR%^0$qd$B$c}EA-Bvhox16rpo5S#0}77?D`@Mez>_VHyP zrWLyto0e4=e>|R;lZQk9sw07ft~`D|doM5k#>1)g^|?-9QbaOPBFsv6`1Im>(nrH$ z5sy14})f%DGQXERs5HrYR< z+&S@+2mO^~3DKODZv5$`JE=l^s|)_K{Qn@ilKy}69KKQdMSgrVEKZb==SoIT9`s*J ze!sJ<=bPlosP9FSN1#xeA~(l{5kkUe@(|<3Z2sk2#`(_Voa=aI3YCTDkTm^D^rDv zzRjnIaL}`ez@$vIwp0aa5J{nN9h++Is?l9p{AO7{Jszz>4Ail~*O7f|n9Ln@0}lrl zA5y|KxpLKbb`8{=9UrWk049g~Kf9fQCyk~6-^DndUOHD;b1cAz_j}Y$rT)l~< zeI3W^n#G%Bvpw!V9d{l+n{*;zjpm}AaEOud+_7gBv4O!}obz;fN+f^KFHYc&?cwVbjtU@cniXSY za_Q+6nz?IQ&|i-pS-nyjl)gsDutwTo>A!2Sm)8!W7O9lZsGC&Wsq1u%eT>Y@n!;#8XmE9G4@}0D zt0=6($H=3D!TEZu7@7IH#@7L@HNK8aU8*$E=8Sd3wVE9DY(5LsvrX2#i8@9k z6ZWmas0^)=F?={E{IIaAL1E5~%KDHIV?$u8wG(66iNh zx^(qa0AsE(iR6kioNq8XqpBm5GO;Culo}MXA!YUTvG}YfrLK^UXv!Ap>$_nP0OW&WC9xZH67M=^aL8ls=N1 z4C{28xu+@UObDT&@-?~AOs}d+GRcidU$yL+=Em~2=MbY3+vC#RoMXaUXk=qyB9YA> zcWF9AswO6DVcKF}1cuh4G|bByYgFR8yrLi_8Ij22=M$p^as~JIEkrN^zG^6|gvypa zRrc3WozB>7$ELZSV@5I#H#L1{?2!o+I=SbBO7EF_zv0Q1E>IYg%FS|( zn|yL{c?i%D*)MWjh?G7UEmGB?;o{Qcd`*a{(5sYCH|g72OM4Tk6kXK~`fb)D{ZKMx z{lZWvO=udRCU7|0<%U9CS_$J@oAn3 zK195a7_FJR(3-kbHdjg|%R(Zv0oXP~y*tW_P*}~yrDI-sKAk&!XfP^E!Fo(f*)(8` z+JJ^ax)H511MuPLq@%JdX`ulvSb(_;kLRv3zD~9~HmP>6b#ld3h*TkvE5YPy1OEFM z-5V!ub4BTDOeS19PmGDKmoyt&t)?Z6F}9%jwLNvd-gw2*`LQvQ2ng0}!qW)V^I6%M zJ72AVeyh}G+vO^a)ugC`i@AFmTTJlINzYxNXOo!{5sEyy;KC?$mS}M401Bs*vSadO zZIwXXM0|+T^;pj)<)M&F)=kH8{r=pQ!9&O>(EEOCP4G!m2l3F@rX4fLZCsWfiVdpeDh=b^RJ+cq5NbXPukz!|x(*upZIZ zG16B6Q~b+DH+%^I&m1CeG@&44B z-$Cx2w9)#I7zyp}(3x<4=?-slfB@z$j9)GMe;4xFr29pF^5~#AjuD*qv+<=nd6fb6 zM<;jDcm6DYmOsn4m0Zc_LBH^ihQ;|eefE#0^76+fHdp=OzIkem>ZhzM!{&mkS_rGI zXH|&(rh&npL4*O5@~vb3S=l$F$W{O2!@=0sF}FsTI?v>?g4m!`hBzU%oR8tY=?@D< zSp~ERxsv?Va@?!(M^T>pj}|55PyYMxm%}~#KX<<;+b@3`d3N#dgzz=_Htgyh;$q1n zF4-2yvMyh~T<~JC;0GnQmzU}*p63Gjr2K&}L9290Gl9H+f&#&iOw~*&^gUn?JNln}Ich)7j<8duADCjZI&= z3LC*_jaEW*k&C$-yoztErDxT7k(<%5XIt)SBs2}B55$;I#$5CU)?EYbkw~nsq2L?$ z!qj;rOLo6}gDLq=mHlYgn+^-pS1lA)$4KQHv=&Yt49_QXH~ZNe`bAz7xmnT{st~X( zDR}Dq)4LR{L`K8HoQnvD1B>&KJ)`jZCna(6t^r8?OZpFMJ^oNBVE0H`Bu|@%cX<>)h zG#mVB-K6E~n0EO_GK6acP1*%;bv^bWoP@~i;>{KWc!RQ)NN$u2dR9N&Gir2m39U}` z03RZ;X>dMu8RRP21sCF|$n}U8Lmf}ucrtg7*5E{h>Z0u!u0nl28t#ouTiXf&3ZwHU zM??SkbYkLL6fPM?OJaWS+iO;LZUmLd2EFOqd}>tIUz>ys;r_nG`Gk&_RVs$Zw#Iy0 z!EERU06sP|=fX*har!FQ@-A{GE!XC1(6jpCU@sps$#?0r{&?BK$)J+&#lTvAvPQH zAqYnY`BS5YA%sY52{IzE zZ*%fYvu71oJ~ebac|M($K1@T5Cwz+?yWXI~J@e4y$_QD%XBBf7X3s9B$7?3WH`?s7 z3S*t6bT!lszU88x3jliHVeQS(=ayIGR%+9J1#}{)q?iabQLz8Fg`VWHE5MpW$K~jx1v`mr0rl!W` z2JgLU;_;gz7f6m(1Z$0YoI#!|&Heqvda6Ujv}wGMYH?MFe0Vx}?Nq*#gS@<|#>0I( zGD;&M;z>;-H+OZ@R&UnQv*7Dge6}W|XH(}*jBpi_(q-K%(>4rdS>$vwXSkPI;CzUf zT%mHwPmf3b*~RQ|GIzIbAk@*RO!9Rrb0RUd>lK@JNi3%CmR>iTqWk%@+}!QKzQroRg|rddmS_HKixr!mmwnA z7GDE#5y^IhEL$eWlO;0}mS3@0Ms~Ni`M_wFoetHDRG0qEiv=RE!xm;YIjn9Mwz^$j zMp(uO%O(Hzxo1hl?CuaF{J?0soh^R6U;Ommz1^K(%|HL;dTu*i)QcE@BAqT@v*d$& zhV88_UM?1duwZvPL(3Mjy@d$;^$)h`(gC`3yRcX+`I`8X<#Jh=?QEOw)~$Q*c5lAk zVhMDYYgT32tuev}c9*z_gnG&DPM3fFRrwFE>hYZzldh`I3acrs-mLO9kqhdY4O1o& z1T=L>-AGzUT&bqPhZE=sUr=yf*Xbp))5;w_(NTNSgEvZ)k=bJ?6tpc%G^SR=N<+eWlMzWUE zmBvt#0g-v>@F7q-kCBLTj@rBY>gOM=iahU!5YMbh%nU6Vmsbw&Yx4H_LpLu-=3}F* zn3zntQe^Ftt#J?~DdrZH=qqZ?;o-(5*L`-rj^s*EnI_bc!-2iUdWCm1BRkuoj(+^t zN5*8tWrr`mYM49E%a@TwTq4~q7O^45C0{L<>_~=^ZN9H}FuNHq>#uMx0$Ux}$#&4& z8QpF=*1J2xa+wHri{+9pUPiW9BHLRmA}r#P%hJz6T>g4@TZ$Kp1)*A?v#;5=_l_dV zO6dF~lME%G^)}mCG6in)V4g^1$ucfkEF$-e5M!r(_)nLeY>U#rM2XPtc5htCOmyLu z|8KAMy(O@nbul|z>?$GtHnL<{{i>{f@!rY~i}Ts?mTb}O zZn2=DS;CfN>~3%I;}3H7?`hnN8outp))xLnWLrAyYN1OPz0-wdm*o-`aarBl-r0V+ zSWt(^Ru^JirUe0hV0P}EO+FizRXw}^U(8RxS}cf5fF<{KcYd<7-R1KyU(l5;mMs%! zSA_rd+2<_j5SOj(ZLjU^E?Y~`I^&D5z-)I}(xvltq_YKE?X_IKu8S;#ttD(_*PqL_ zU>l*k)j@9yVG+r)Okd31tr-2CS?+r_qu1K(x=wK8jVWLx!)jr;XMqgg(l%UOGk3l< zHR-smaffvXnPn;2$W=MengM;24AzZiQ`WUGr zPwUv=e9hdYt8_KvnM=)|A-37KVA=?zZmy#&opHnFr@!0V1#X+D(3bRXv>?1@v){RR zpt~}NON#E+7Q1?j-JLG?)HZf^m%sgC>Ot-BJ3pLzbJ{E{z21eW+k!*64U z?QR0!x3-drpu2?Sa`D&qcDHr5Md=sGKJExF>lB@QU=&)mbXkR8#3hUIuRs6Co>hO7 zZDse&c9)lRL}gq2=!1JWzhGCxPB-K1-^#=PQ-yz6EaE@?=mYaV?(JsV%in^~CB(0> zMsrUIAuh?XF3T>sYC&8s+0D9$2-^bEg%FplH@W~_5wfhix#%Wev$eHkcU!3HCI9<# z_fK)j;=Pq^c6aXm?cm-|I^88NUo^Z}M1J#f!DnB*7|X#BvFX&#UmX{4)IG zA})XV!+ZLESJ*DU2>j6Q^3?)%w;?P#6h9D_bg7q17Rv=4z`aB3 zg`IAfZg)v|5$Sf8nC%p*>YXl&ua}fx)U%h1xG7A&v$D4{jM?7(>C2Z5-`mOfzRqwj z7j)_JGJeHZaY+>dA;P`wWV^qwcUZC{29n};y6j|K^wu_U8QI!`UA;}GlXkm}dY6$ZsUmR~RFZo!Up`RB>MKmPS^UjFmV-+t$^m{qEO@^CO+m!4c*Gbw%h zID!NM75SRm9*N<)YYuK>C~MnSlg!`r%0DiQ=Hak7S@-BgUK>t)65<}pM4`fE|8xb4ZRkjjuGE9?CFdqLTDQ5$c6-*kwCVF#8od$ zA|l(C9{cH~8$X}j{n({<#n^-rIk%hX6)tm5(7*ikq$%Fn>$olI?qbZ%)ce%I7x>X)V zJ$o|P&yQ2guZh6ENl$06CLxmty@WEBz6Js3!tBX-Hu@$E{=EvmNB!dbU|>fgf^&g+ zC23t6obK zUX_EMJsIxj$23q_!^5Xz^G!;4lPDn{7WT1D36kBn%1p~@I`{SYx1m|SSEWWW95E#e z#t38vA!W|%27#N3CQC;xWmh0km^(kdNq*goE##qn+>x{kQ`d>*8zcBSyaw#tB^Pt| z_|p0Fj}Hga5F&-m2eb0qJxd`(s`31~|MB_n$YOo3Zqm}%-nS1qiLE`m0U4yOJ(ALM zlhS38b#G1NbTT)0DLPlue>f=o8iQElFIo$x-Qm?8Ps(_cR3XkjJe_pv7%MIBW=g&b zd9R&a*U?#(SU^?@d6se2Tz8OIqmb6lRw0q)s}Px7y2HC3D*{Q;_xJ78w(SLVOhwpB zUvCPlSN_dZ@3+Z^rxWwdpZf0PJvWrz-E|AZ@PtpBxRRuHD(Ck0_lG!4M<9iI_Hxe^Z$D zpIP2Hsp(mDa{M>@r!N-~Ba(pkua^n@2X=P_mdn}aU(~-C|N1xoH7=K5{sHIxCn?{! zvqybfFDZ*Bkpc$`hkK}y6x5CzbEPVtutGhsmR1maE|;tALppG4DYJDWn~N!4`pXHsi_VCJxXDJxCx0>6mK2j| zAZfwd$NP_2dF{Jz(M(*w#`BO46r)2eP^2-halrRltp!AbZB3a4wnyFL)Wsr>NmgP> zjytKyrVqAYK^T($U$Ui{ct}F(s(GAivrKo<86K?tA8rU&BlmN~0000007*qoM6N<$ Ef`FLc{r~^~ diff --git a/wxWidgets/src/png/pngtrans.c b/wxWidgets/src/png/pngtrans.c deleted file mode 100644 index f279f9e790..0000000000 --- a/wxWidgets/src/png/pngtrans.c +++ /dev/null @@ -1,644 +0,0 @@ - -/* pngtrans.c - transforms the data in a row (used by both readers and writers) - * - * libpng 1.2.7 - September 12, 2004 - * For conditions of distribution and use, see copyright notice in png.h - * Copyright (c) 1998-2004 Glenn Randers-Pehrson - * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) - * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) - */ - -#define PNG_INTERNAL -#include "png.h" - -#if defined(PNG_READ_BGR_SUPPORTED) || defined(PNG_WRITE_BGR_SUPPORTED) -/* turn on BGR-to-RGB mapping */ -void PNGAPI -png_set_bgr(png_structp png_ptr) -{ - png_debug(1, "in png_set_bgr\n"); - png_ptr->transformations |= PNG_BGR; -} -#endif - -#if defined(PNG_READ_SWAP_SUPPORTED) || defined(PNG_WRITE_SWAP_SUPPORTED) -/* turn on 16 bit byte swapping */ -void PNGAPI -png_set_swap(png_structp png_ptr) -{ - png_debug(1, "in png_set_swap\n"); - if (png_ptr->bit_depth == 16) - png_ptr->transformations |= PNG_SWAP_BYTES; -} -#endif - -#if defined(PNG_READ_PACK_SUPPORTED) || defined(PNG_WRITE_PACK_SUPPORTED) -/* turn on pixel packing */ -void PNGAPI -png_set_packing(png_structp png_ptr) -{ - png_debug(1, "in png_set_packing\n"); - if (png_ptr->bit_depth < 8) - { - png_ptr->transformations |= PNG_PACK; - png_ptr->usr_bit_depth = 8; - } -} -#endif - -#if defined(PNG_READ_PACKSWAP_SUPPORTED)||defined(PNG_WRITE_PACKSWAP_SUPPORTED) -/* turn on packed pixel swapping */ -void PNGAPI -png_set_packswap(png_structp png_ptr) -{ - png_debug(1, "in png_set_packswap\n"); - if (png_ptr->bit_depth < 8) - png_ptr->transformations |= PNG_PACKSWAP; -} -#endif - -#if defined(PNG_READ_SHIFT_SUPPORTED) || defined(PNG_WRITE_SHIFT_SUPPORTED) -void PNGAPI -png_set_shift(png_structp png_ptr, png_color_8p true_bits) -{ - png_debug(1, "in png_set_shift\n"); - png_ptr->transformations |= PNG_SHIFT; - png_ptr->shift = *true_bits; -} -#endif - -#if defined(PNG_READ_INTERLACING_SUPPORTED) || \ - defined(PNG_WRITE_INTERLACING_SUPPORTED) -int PNGAPI -png_set_interlace_handling(png_structp png_ptr) -{ - png_debug(1, "in png_set_interlace handling\n"); - if (png_ptr->interlaced) - { - png_ptr->transformations |= PNG_INTERLACE; - return (7); - } - - return (1); -} -#endif - -#if defined(PNG_READ_FILLER_SUPPORTED) || defined(PNG_WRITE_FILLER_SUPPORTED) -/* Add a filler byte on read, or remove a filler or alpha byte on write. - * The filler type has changed in v0.95 to allow future 2-byte fillers - * for 48-bit input data, as well as to avoid problems with some compilers - * that don't like bytes as parameters. - */ -void PNGAPI -png_set_filler(png_structp png_ptr, png_uint_32 filler, int filler_loc) -{ - png_debug(1, "in png_set_filler\n"); - png_ptr->transformations |= PNG_FILLER; - png_ptr->filler = (png_byte)filler; - if (filler_loc == PNG_FILLER_AFTER) - png_ptr->flags |= PNG_FLAG_FILLER_AFTER; - else - png_ptr->flags &= ~PNG_FLAG_FILLER_AFTER; - - /* This should probably go in the "do_read_filler" routine. - * I attempted to do that in libpng-1.0.1a but that caused problems - * so I restored it in libpng-1.0.2a - */ - - if (png_ptr->color_type == PNG_COLOR_TYPE_RGB) - { - png_ptr->usr_channels = 4; - } - - /* Also I added this in libpng-1.0.2a (what happens when we expand - * a less-than-8-bit grayscale to GA? */ - - if (png_ptr->color_type == PNG_COLOR_TYPE_GRAY && png_ptr->bit_depth >= 8) - { - png_ptr->usr_channels = 2; - } -} - -#if !defined(PNG_1_0_X) -/* Added to libpng-1.2.7 */ -void PNGAPI -png_set_add_alpha(png_structp png_ptr, png_uint_32 filler, int filler_loc) -{ - png_debug(1, "in png_set_add_alpha\n"); - png_set_filler(png_ptr, filler, filler_loc); - png_ptr->transformations |= PNG_ADD_ALPHA; -} -#endif - -#endif - -#if defined(PNG_READ_SWAP_ALPHA_SUPPORTED) || \ - defined(PNG_WRITE_SWAP_ALPHA_SUPPORTED) -void PNGAPI -png_set_swap_alpha(png_structp png_ptr) -{ - png_debug(1, "in png_set_swap_alpha\n"); - png_ptr->transformations |= PNG_SWAP_ALPHA; -} -#endif - -#if defined(PNG_READ_INVERT_ALPHA_SUPPORTED) || \ - defined(PNG_WRITE_INVERT_ALPHA_SUPPORTED) -void PNGAPI -png_set_invert_alpha(png_structp png_ptr) -{ - png_debug(1, "in png_set_invert_alpha\n"); - png_ptr->transformations |= PNG_INVERT_ALPHA; -} -#endif - -#if defined(PNG_READ_INVERT_SUPPORTED) || defined(PNG_WRITE_INVERT_SUPPORTED) -void PNGAPI -png_set_invert_mono(png_structp png_ptr) -{ - png_debug(1, "in png_set_invert_mono\n"); - png_ptr->transformations |= PNG_INVERT_MONO; -} - -/* invert monochrome grayscale data */ -void /* PRIVATE */ -png_do_invert(png_row_infop row_info, png_bytep row) -{ - png_debug(1, "in png_do_invert\n"); - /* This test removed from libpng version 1.0.13 and 1.2.0: - * if (row_info->bit_depth == 1 && - */ -#if defined(PNG_USELESS_TESTS_SUPPORTED) - if (row == NULL || row_info == NULL) - return; -#endif - if (row_info->color_type == PNG_COLOR_TYPE_GRAY) - { - png_bytep rp = row; - png_uint_32 i; - png_uint_32 istop = row_info->rowbytes; - - for (i = 0; i < istop; i++) - { - *rp = (png_byte)(~(*rp)); - rp++; - } - } - else if (row_info->color_type == PNG_COLOR_TYPE_GRAY_ALPHA && - row_info->bit_depth == 8) - { - png_bytep rp = row; - png_uint_32 i; - png_uint_32 istop = row_info->rowbytes; - - for (i = 0; i < istop; i+=2) - { - *rp = (png_byte)(~(*rp)); - rp+=2; - } - } - else if (row_info->color_type == PNG_COLOR_TYPE_GRAY_ALPHA && - row_info->bit_depth == 16) - { - png_bytep rp = row; - png_uint_32 i; - png_uint_32 istop = row_info->rowbytes; - - for (i = 0; i < istop; i+=4) - { - *rp = (png_byte)(~(*rp)); - *(rp+1) = (png_byte)(~(*(rp+1))); - rp+=4; - } - } -} -#endif - -#if defined(PNG_READ_SWAP_SUPPORTED) || defined(PNG_WRITE_SWAP_SUPPORTED) -/* swaps byte order on 16 bit depth images */ -void /* PRIVATE */ -png_do_swap(png_row_infop row_info, png_bytep row) -{ - png_debug(1, "in png_do_swap\n"); - if ( -#if defined(PNG_USELESS_TESTS_SUPPORTED) - row != NULL && row_info != NULL && -#endif - row_info->bit_depth == 16) - { - png_bytep rp = row; - png_uint_32 i; - png_uint_32 istop= row_info->width * row_info->channels; - - for (i = 0; i < istop; i++, rp += 2) - { - png_byte t = *rp; - *rp = *(rp + 1); - *(rp + 1) = t; - } - } -} -#endif - -#if defined(PNG_READ_PACKSWAP_SUPPORTED)||defined(PNG_WRITE_PACKSWAP_SUPPORTED) -static png_byte onebppswaptable[256] = { - 0x00, 0x80, 0x40, 0xC0, 0x20, 0xA0, 0x60, 0xE0, - 0x10, 0x90, 0x50, 0xD0, 0x30, 0xB0, 0x70, 0xF0, - 0x08, 0x88, 0x48, 0xC8, 0x28, 0xA8, 0x68, 0xE8, - 0x18, 0x98, 0x58, 0xD8, 0x38, 0xB8, 0x78, 0xF8, - 0x04, 0x84, 0x44, 0xC4, 0x24, 0xA4, 0x64, 0xE4, - 0x14, 0x94, 0x54, 0xD4, 0x34, 0xB4, 0x74, 0xF4, - 0x0C, 0x8C, 0x4C, 0xCC, 0x2C, 0xAC, 0x6C, 0xEC, - 0x1C, 0x9C, 0x5C, 0xDC, 0x3C, 0xBC, 0x7C, 0xFC, - 0x02, 0x82, 0x42, 0xC2, 0x22, 0xA2, 0x62, 0xE2, - 0x12, 0x92, 0x52, 0xD2, 0x32, 0xB2, 0x72, 0xF2, - 0x0A, 0x8A, 0x4A, 0xCA, 0x2A, 0xAA, 0x6A, 0xEA, - 0x1A, 0x9A, 0x5A, 0xDA, 0x3A, 0xBA, 0x7A, 0xFA, - 0x06, 0x86, 0x46, 0xC6, 0x26, 0xA6, 0x66, 0xE6, - 0x16, 0x96, 0x56, 0xD6, 0x36, 0xB6, 0x76, 0xF6, - 0x0E, 0x8E, 0x4E, 0xCE, 0x2E, 0xAE, 0x6E, 0xEE, - 0x1E, 0x9E, 0x5E, 0xDE, 0x3E, 0xBE, 0x7E, 0xFE, - 0x01, 0x81, 0x41, 0xC1, 0x21, 0xA1, 0x61, 0xE1, - 0x11, 0x91, 0x51, 0xD1, 0x31, 0xB1, 0x71, 0xF1, - 0x09, 0x89, 0x49, 0xC9, 0x29, 0xA9, 0x69, 0xE9, - 0x19, 0x99, 0x59, 0xD9, 0x39, 0xB9, 0x79, 0xF9, - 0x05, 0x85, 0x45, 0xC5, 0x25, 0xA5, 0x65, 0xE5, - 0x15, 0x95, 0x55, 0xD5, 0x35, 0xB5, 0x75, 0xF5, - 0x0D, 0x8D, 0x4D, 0xCD, 0x2D, 0xAD, 0x6D, 0xED, - 0x1D, 0x9D, 0x5D, 0xDD, 0x3D, 0xBD, 0x7D, 0xFD, - 0x03, 0x83, 0x43, 0xC3, 0x23, 0xA3, 0x63, 0xE3, - 0x13, 0x93, 0x53, 0xD3, 0x33, 0xB3, 0x73, 0xF3, - 0x0B, 0x8B, 0x4B, 0xCB, 0x2B, 0xAB, 0x6B, 0xEB, - 0x1B, 0x9B, 0x5B, 0xDB, 0x3B, 0xBB, 0x7B, 0xFB, - 0x07, 0x87, 0x47, 0xC7, 0x27, 0xA7, 0x67, 0xE7, - 0x17, 0x97, 0x57, 0xD7, 0x37, 0xB7, 0x77, 0xF7, - 0x0F, 0x8F, 0x4F, 0xCF, 0x2F, 0xAF, 0x6F, 0xEF, - 0x1F, 0x9F, 0x5F, 0xDF, 0x3F, 0xBF, 0x7F, 0xFF -}; - -static png_byte twobppswaptable[256] = { - 0x00, 0x40, 0x80, 0xC0, 0x10, 0x50, 0x90, 0xD0, - 0x20, 0x60, 0xA0, 0xE0, 0x30, 0x70, 0xB0, 0xF0, - 0x04, 0x44, 0x84, 0xC4, 0x14, 0x54, 0x94, 0xD4, - 0x24, 0x64, 0xA4, 0xE4, 0x34, 0x74, 0xB4, 0xF4, - 0x08, 0x48, 0x88, 0xC8, 0x18, 0x58, 0x98, 0xD8, - 0x28, 0x68, 0xA8, 0xE8, 0x38, 0x78, 0xB8, 0xF8, - 0x0C, 0x4C, 0x8C, 0xCC, 0x1C, 0x5C, 0x9C, 0xDC, - 0x2C, 0x6C, 0xAC, 0xEC, 0x3C, 0x7C, 0xBC, 0xFC, - 0x01, 0x41, 0x81, 0xC1, 0x11, 0x51, 0x91, 0xD1, - 0x21, 0x61, 0xA1, 0xE1, 0x31, 0x71, 0xB1, 0xF1, - 0x05, 0x45, 0x85, 0xC5, 0x15, 0x55, 0x95, 0xD5, - 0x25, 0x65, 0xA5, 0xE5, 0x35, 0x75, 0xB5, 0xF5, - 0x09, 0x49, 0x89, 0xC9, 0x19, 0x59, 0x99, 0xD9, - 0x29, 0x69, 0xA9, 0xE9, 0x39, 0x79, 0xB9, 0xF9, - 0x0D, 0x4D, 0x8D, 0xCD, 0x1D, 0x5D, 0x9D, 0xDD, - 0x2D, 0x6D, 0xAD, 0xED, 0x3D, 0x7D, 0xBD, 0xFD, - 0x02, 0x42, 0x82, 0xC2, 0x12, 0x52, 0x92, 0xD2, - 0x22, 0x62, 0xA2, 0xE2, 0x32, 0x72, 0xB2, 0xF2, - 0x06, 0x46, 0x86, 0xC6, 0x16, 0x56, 0x96, 0xD6, - 0x26, 0x66, 0xA6, 0xE6, 0x36, 0x76, 0xB6, 0xF6, - 0x0A, 0x4A, 0x8A, 0xCA, 0x1A, 0x5A, 0x9A, 0xDA, - 0x2A, 0x6A, 0xAA, 0xEA, 0x3A, 0x7A, 0xBA, 0xFA, - 0x0E, 0x4E, 0x8E, 0xCE, 0x1E, 0x5E, 0x9E, 0xDE, - 0x2E, 0x6E, 0xAE, 0xEE, 0x3E, 0x7E, 0xBE, 0xFE, - 0x03, 0x43, 0x83, 0xC3, 0x13, 0x53, 0x93, 0xD3, - 0x23, 0x63, 0xA3, 0xE3, 0x33, 0x73, 0xB3, 0xF3, - 0x07, 0x47, 0x87, 0xC7, 0x17, 0x57, 0x97, 0xD7, - 0x27, 0x67, 0xA7, 0xE7, 0x37, 0x77, 0xB7, 0xF7, - 0x0B, 0x4B, 0x8B, 0xCB, 0x1B, 0x5B, 0x9B, 0xDB, - 0x2B, 0x6B, 0xAB, 0xEB, 0x3B, 0x7B, 0xBB, 0xFB, - 0x0F, 0x4F, 0x8F, 0xCF, 0x1F, 0x5F, 0x9F, 0xDF, - 0x2F, 0x6F, 0xAF, 0xEF, 0x3F, 0x7F, 0xBF, 0xFF -}; - -static png_byte fourbppswaptable[256] = { - 0x00, 0x10, 0x20, 0x30, 0x40, 0x50, 0x60, 0x70, - 0x80, 0x90, 0xA0, 0xB0, 0xC0, 0xD0, 0xE0, 0xF0, - 0x01, 0x11, 0x21, 0x31, 0x41, 0x51, 0x61, 0x71, - 0x81, 0x91, 0xA1, 0xB1, 0xC1, 0xD1, 0xE1, 0xF1, - 0x02, 0x12, 0x22, 0x32, 0x42, 0x52, 0x62, 0x72, - 0x82, 0x92, 0xA2, 0xB2, 0xC2, 0xD2, 0xE2, 0xF2, - 0x03, 0x13, 0x23, 0x33, 0x43, 0x53, 0x63, 0x73, - 0x83, 0x93, 0xA3, 0xB3, 0xC3, 0xD3, 0xE3, 0xF3, - 0x04, 0x14, 0x24, 0x34, 0x44, 0x54, 0x64, 0x74, - 0x84, 0x94, 0xA4, 0xB4, 0xC4, 0xD4, 0xE4, 0xF4, - 0x05, 0x15, 0x25, 0x35, 0x45, 0x55, 0x65, 0x75, - 0x85, 0x95, 0xA5, 0xB5, 0xC5, 0xD5, 0xE5, 0xF5, - 0x06, 0x16, 0x26, 0x36, 0x46, 0x56, 0x66, 0x76, - 0x86, 0x96, 0xA6, 0xB6, 0xC6, 0xD6, 0xE6, 0xF6, - 0x07, 0x17, 0x27, 0x37, 0x47, 0x57, 0x67, 0x77, - 0x87, 0x97, 0xA7, 0xB7, 0xC7, 0xD7, 0xE7, 0xF7, - 0x08, 0x18, 0x28, 0x38, 0x48, 0x58, 0x68, 0x78, - 0x88, 0x98, 0xA8, 0xB8, 0xC8, 0xD8, 0xE8, 0xF8, - 0x09, 0x19, 0x29, 0x39, 0x49, 0x59, 0x69, 0x79, - 0x89, 0x99, 0xA9, 0xB9, 0xC9, 0xD9, 0xE9, 0xF9, - 0x0A, 0x1A, 0x2A, 0x3A, 0x4A, 0x5A, 0x6A, 0x7A, - 0x8A, 0x9A, 0xAA, 0xBA, 0xCA, 0xDA, 0xEA, 0xFA, - 0x0B, 0x1B, 0x2B, 0x3B, 0x4B, 0x5B, 0x6B, 0x7B, - 0x8B, 0x9B, 0xAB, 0xBB, 0xCB, 0xDB, 0xEB, 0xFB, - 0x0C, 0x1C, 0x2C, 0x3C, 0x4C, 0x5C, 0x6C, 0x7C, - 0x8C, 0x9C, 0xAC, 0xBC, 0xCC, 0xDC, 0xEC, 0xFC, - 0x0D, 0x1D, 0x2D, 0x3D, 0x4D, 0x5D, 0x6D, 0x7D, - 0x8D, 0x9D, 0xAD, 0xBD, 0xCD, 0xDD, 0xED, 0xFD, - 0x0E, 0x1E, 0x2E, 0x3E, 0x4E, 0x5E, 0x6E, 0x7E, - 0x8E, 0x9E, 0xAE, 0xBE, 0xCE, 0xDE, 0xEE, 0xFE, - 0x0F, 0x1F, 0x2F, 0x3F, 0x4F, 0x5F, 0x6F, 0x7F, - 0x8F, 0x9F, 0xAF, 0xBF, 0xCF, 0xDF, 0xEF, 0xFF -}; - -/* swaps pixel packing order within bytes */ -void /* PRIVATE */ -png_do_packswap(png_row_infop row_info, png_bytep row) -{ - png_debug(1, "in png_do_packswap\n"); - if ( -#if defined(PNG_USELESS_TESTS_SUPPORTED) - row != NULL && row_info != NULL && -#endif - row_info->bit_depth < 8) - { - png_bytep rp, end, table; - - end = row + row_info->rowbytes; - - if (row_info->bit_depth == 1) - table = onebppswaptable; - else if (row_info->bit_depth == 2) - table = twobppswaptable; - else if (row_info->bit_depth == 4) - table = fourbppswaptable; - else - return; - - for (rp = row; rp < end; rp++) - *rp = table[*rp]; - } -} -#endif /* PNG_READ_PACKSWAP_SUPPORTED or PNG_WRITE_PACKSWAP_SUPPORTED */ - -#if defined(PNG_WRITE_FILLER_SUPPORTED) || \ - defined(PNG_READ_STRIP_ALPHA_SUPPORTED) -/* remove filler or alpha byte(s) */ -void /* PRIVATE */ -png_do_strip_filler(png_row_infop row_info, png_bytep row, png_uint_32 flags) -{ - png_debug(1, "in png_do_strip_filler\n"); -#if defined(PNG_USELESS_TESTS_SUPPORTED) - if (row != NULL && row_info != NULL) -#endif - { - png_bytep sp=row; - png_bytep dp=row; - png_uint_32 row_width=row_info->width; - png_uint_32 i; - - if (row_info->color_type == PNG_COLOR_TYPE_RGB && - row_info->channels == 4) - { - if (row_info->bit_depth == 8) - { - /* This converts from RGBX or RGBA to RGB */ - if (flags & PNG_FLAG_FILLER_AFTER) - { - dp+=3; sp+=4; - for (i = 1; i < row_width; i++) - { - *dp++ = *sp++; - *dp++ = *sp++; - *dp++ = *sp++; - sp++; - } - } - /* This converts from XRGB or ARGB to RGB */ - else - { - for (i = 0; i < row_width; i++) - { - sp++; - *dp++ = *sp++; - *dp++ = *sp++; - *dp++ = *sp++; - } - } - row_info->pixel_depth = 24; - row_info->rowbytes = row_width * 3; - } - else /* if (row_info->bit_depth == 16) */ - { - if (flags & PNG_FLAG_FILLER_AFTER) - { - /* This converts from RRGGBBXX or RRGGBBAA to RRGGBB */ - sp += 8; dp += 6; - for (i = 1; i < row_width; i++) - { - /* This could be (although png_memcpy is probably slower): - png_memcpy(dp, sp, 6); - sp += 8; - dp += 6; - */ - - *dp++ = *sp++; - *dp++ = *sp++; - *dp++ = *sp++; - *dp++ = *sp++; - *dp++ = *sp++; - *dp++ = *sp++; - sp += 2; - } - } - else - { - /* This converts from XXRRGGBB or AARRGGBB to RRGGBB */ - for (i = 0; i < row_width; i++) - { - /* This could be (although png_memcpy is probably slower): - png_memcpy(dp, sp, 6); - sp += 8; - dp += 6; - */ - - sp+=2; - *dp++ = *sp++; - *dp++ = *sp++; - *dp++ = *sp++; - *dp++ = *sp++; - *dp++ = *sp++; - *dp++ = *sp++; - } - } - row_info->pixel_depth = 48; - row_info->rowbytes = row_width * 6; - } - row_info->channels = 3; - } - else if (row_info->color_type == PNG_COLOR_TYPE_GRAY && - row_info->channels == 2) - { - if (row_info->bit_depth == 8) - { - /* This converts from GX or GA to G */ - if (flags & PNG_FLAG_FILLER_AFTER) - { - for (i = 0; i < row_width; i++) - { - *dp++ = *sp++; - sp++; - } - } - /* This converts from XG or AG to G */ - else - { - for (i = 0; i < row_width; i++) - { - sp++; - *dp++ = *sp++; - } - } - row_info->pixel_depth = 8; - row_info->rowbytes = row_width; - } - else /* if (row_info->bit_depth == 16) */ - { - if (flags & PNG_FLAG_FILLER_AFTER) - { - /* This converts from GGXX or GGAA to GG */ - sp += 4; dp += 2; - for (i = 1; i < row_width; i++) - { - *dp++ = *sp++; - *dp++ = *sp++; - sp += 2; - } - } - else - { - /* This converts from XXGG or AAGG to GG */ - for (i = 0; i < row_width; i++) - { - sp += 2; - *dp++ = *sp++; - *dp++ = *sp++; - } - } - row_info->pixel_depth = 16; - row_info->rowbytes = row_width * 2; - } - row_info->channels = 1; - } - } -} -#endif - -#if defined(PNG_READ_BGR_SUPPORTED) || defined(PNG_WRITE_BGR_SUPPORTED) -/* swaps red and blue bytes within a pixel */ -void /* PRIVATE */ -png_do_bgr(png_row_infop row_info, png_bytep row) -{ - png_debug(1, "in png_do_bgr\n"); - if ( -#if defined(PNG_USELESS_TESTS_SUPPORTED) - row != NULL && row_info != NULL && -#endif - (row_info->color_type & PNG_COLOR_MASK_COLOR)) - { - png_uint_32 row_width = row_info->width; - if (row_info->bit_depth == 8) - { - if (row_info->color_type == PNG_COLOR_TYPE_RGB) - { - png_bytep rp; - png_uint_32 i; - - for (i = 0, rp = row; i < row_width; i++, rp += 3) - { - png_byte save = *rp; - *rp = *(rp + 2); - *(rp + 2) = save; - } - } - else if (row_info->color_type == PNG_COLOR_TYPE_RGB_ALPHA) - { - png_bytep rp; - png_uint_32 i; - - for (i = 0, rp = row; i < row_width; i++, rp += 4) - { - png_byte save = *rp; - *rp = *(rp + 2); - *(rp + 2) = save; - } - } - } - else if (row_info->bit_depth == 16) - { - if (row_info->color_type == PNG_COLOR_TYPE_RGB) - { - png_bytep rp; - png_uint_32 i; - - for (i = 0, rp = row; i < row_width; i++, rp += 6) - { - png_byte save = *rp; - *rp = *(rp + 4); - *(rp + 4) = save; - save = *(rp + 1); - *(rp + 1) = *(rp + 5); - *(rp + 5) = save; - } - } - else if (row_info->color_type == PNG_COLOR_TYPE_RGB_ALPHA) - { - png_bytep rp; - png_uint_32 i; - - for (i = 0, rp = row; i < row_width; i++, rp += 8) - { - png_byte save = *rp; - *rp = *(rp + 4); - *(rp + 4) = save; - save = *(rp + 1); - *(rp + 1) = *(rp + 5); - *(rp + 5) = save; - } - } - } - } -} -#endif /* PNG_READ_BGR_SUPPORTED or PNG_WRITE_BGR_SUPPORTED */ - -#if defined(PNG_READ_USER_TRANSFORM_SUPPORTED) || \ - defined(PNG_WRITE_USER_TRANSFORM_SUPPORTED) || \ - defined(PNG_LEGACY_SUPPORTED) -void PNGAPI -png_set_user_transform_info(png_structp png_ptr, png_voidp - user_transform_ptr, int user_transform_depth, int user_transform_channels) -{ - png_debug(1, "in png_set_user_transform_info\n"); -#if defined(PNG_USER_TRANSFORM_PTR_SUPPORTED) - png_ptr->user_transform_ptr = user_transform_ptr; - png_ptr->user_transform_depth = (png_byte)user_transform_depth; - png_ptr->user_transform_channels = (png_byte)user_transform_channels; -#else - if(user_transform_ptr || user_transform_depth || user_transform_channels) - png_warning(png_ptr, - "This version of libpng does not support user transform info"); -#endif -} -#endif - -/* This function returns a pointer to the user_transform_ptr associated with - * the user transform functions. The application should free any memory - * associated with this pointer before png_write_destroy and png_read_destroy - * are called. - */ -png_voidp PNGAPI -png_get_user_transform_ptr(png_structp png_ptr) -{ -#if defined(PNG_USER_TRANSFORM_PTR_SUPPORTED) - return ((png_voidp)png_ptr->user_transform_ptr); -#else - if(png_ptr) - return (NULL); - return (NULL); -#endif -} diff --git a/wxWidgets/src/png/pngvcrd.c b/wxWidgets/src/png/pngvcrd.c deleted file mode 100644 index b6fea2e35f..0000000000 --- a/wxWidgets/src/png/pngvcrd.c +++ /dev/null @@ -1,3903 +0,0 @@ -/* pngvcrd.c - mixed C/assembler version of utilities to read a PNG file - * - * For Intel x86 CPU and Microsoft Visual C++ compiler - * - * libpng version 1.2.7 - September 12, 2004 - * For conditions of distribution and use, see copyright notice in png.h - * Copyright (c) 1998-2004 Glenn Randers-Pehrson - * Copyright (c) 1998, Intel Corporation - * - * Contributed by Nirav Chhatrapati, Intel Corporation, 1998 - * Interface to libpng contributed by Gilles Vollant, 1999 - * - * - * In png_do_read_interlace() in libpng versions 1.0.3a through 1.0.4d, - * a sign error in the post-MMX cleanup code for each pixel_depth resulted - * in bad pixels at the beginning of some rows of some images, and also - * (due to out-of-range memory reads and writes) caused heap corruption - * when compiled with MSVC 6.0. The error was fixed in version 1.0.4e. - * - * [png_read_filter_row_mmx_avg() bpp == 2 bugfix, GRR 20000916] - * - * [runtime MMX configuration, GRR 20010102] - * - */ - -#define PNG_INTERNAL -#include "png.h" - -#if defined(PNG_ASSEMBLER_CODE_SUPPORTED) && defined(PNG_USE_PNGVCRD) - -static int mmx_supported=2; - - -int PNGAPI -png_mmx_support(void) -{ - int mmx_supported_local = 0; - _asm { - push ebx /*CPUID will trash these */ - push ecx - push edx - - pushfd /*Save Eflag to stack */ - pop eax /*Get Eflag from stack into eax */ - mov ecx, eax /*Make another copy of Eflag in ecx */ - xor eax, 0x200000 /*Toggle ID bit in Eflag [i.e. bit(21)] */ - push eax /*Save modified Eflag back to stack */ - - popfd /*Restored modified value back to Eflag reg */ - pushfd /*Save Eflag to stack */ - pop eax /*Get Eflag from stack */ - push ecx /* save original Eflag to stack */ - popfd /* restore original Eflag */ - xor eax, ecx /*Compare the new Eflag with the original Eflag */ - jz NOT_SUPPORTED /*If the same, CPUID instruction is not supported, */ - /*skip following instructions and jump to */ - /*NOT_SUPPORTED label */ - - xor eax, eax /*Set eax to zero */ - - _asm _emit 0x0f /*CPUID instruction (two bytes opcode) */ - _asm _emit 0xa2 - - cmp eax, 1 /*make sure eax return non-zero value */ - jl NOT_SUPPORTED /*If eax is zero, mmx not supported */ - - xor eax, eax /*set eax to zero */ - inc eax /*Now increment eax to 1. This instruction is */ - /*faster than the instruction "mov eax, 1" */ - - _asm _emit 0x0f /*CPUID instruction */ - _asm _emit 0xa2 - - and edx, 0x00800000 /*mask out all bits but mmx bit(24) */ - cmp edx, 0 /* 0 = mmx not supported */ - jz NOT_SUPPORTED /* non-zero = Yes, mmx IS supported */ - - mov mmx_supported_local, 1 /*set return value to 1 */ - -NOT_SUPPORTED: - mov eax, mmx_supported_local /*move return value to eax */ - pop edx /*CPUID trashed these */ - pop ecx - pop ebx - } - - /*mmx_supported_local=0; // test code for force don't support MMX */ - /*printf("MMX : %u (1=MMX supported)\n",mmx_supported_local); */ - - mmx_supported = mmx_supported_local; - return mmx_supported_local; -} - -/* Combines the row recently read in with the previous row. - This routine takes care of alpha and transparency if requested. - This routine also handles the two methods of progressive display - of interlaced images, depending on the mask value. - The mask value describes which pixels are to be combined with - the row. The pattern always repeats every 8 pixels, so just 8 - bits are needed. A one indicates the pixel is to be combined; a - zero indicates the pixel is to be skipped. This is in addition - to any alpha or transparency value associated with the pixel. If - you want all pixels to be combined, pass 0xff (255) in mask. */ - -/* Use this routine for x86 platform - uses faster MMX routine if machine - supports MMX */ - -void /* PRIVATE */ -png_combine_row(png_structp png_ptr, png_bytep row, int mask) -{ -#ifdef PNG_USE_LOCAL_ARRAYS - const int png_pass_inc[7] = {8, 8, 4, 4, 2, 2, 1}; -#endif - - png_debug(1,"in png_combine_row_asm\n"); - - if (mmx_supported == 2) { -#if !defined(PNG_1_0_X) - /* this should have happened in png_init_mmx_flags() already */ - png_warning(png_ptr, "asm_flags may not have been initialized"); -#endif - png_mmx_support(); - } - - if (mask == 0xff) - { - png_memcpy(row, png_ptr->row_buf + 1, - (png_size_t)PNG_ROWBYTES(png_ptr->row_info.pixel_depth, - png_ptr->width)); - } - /* GRR: add "else if (mask == 0)" case? - * or does png_combine_row() not even get called in that case? */ - else - { - switch (png_ptr->row_info.pixel_depth) - { - case 1: - { - png_bytep sp; - png_bytep dp; - int s_inc, s_start, s_end; - int m; - int shift; - png_uint_32 i; - - sp = png_ptr->row_buf + 1; - dp = row; - m = 0x80; -#if defined(PNG_READ_PACKSWAP_SUPPORTED) - if (png_ptr->transformations & PNG_PACKSWAP) - { - s_start = 0; - s_end = 7; - s_inc = 1; - } - else -#endif - { - s_start = 7; - s_end = 0; - s_inc = -1; - } - - shift = s_start; - - for (i = 0; i < png_ptr->width; i++) - { - if (m & mask) - { - int value; - - value = (*sp >> shift) & 0x1; - *dp &= (png_byte)((0x7f7f >> (7 - shift)) & 0xff); - *dp |= (png_byte)(value << shift); - } - - if (shift == s_end) - { - shift = s_start; - sp++; - dp++; - } - else - shift += s_inc; - - if (m == 1) - m = 0x80; - else - m >>= 1; - } - break; - } - - case 2: - { - png_bytep sp; - png_bytep dp; - int s_start, s_end, s_inc; - int m; - int shift; - png_uint_32 i; - int value; - - sp = png_ptr->row_buf + 1; - dp = row; - m = 0x80; -#if defined(PNG_READ_PACKSWAP_SUPPORTED) - if (png_ptr->transformations & PNG_PACKSWAP) - { - s_start = 0; - s_end = 6; - s_inc = 2; - } - else -#endif - { - s_start = 6; - s_end = 0; - s_inc = -2; - } - - shift = s_start; - - for (i = 0; i < png_ptr->width; i++) - { - if (m & mask) - { - value = (*sp >> shift) & 0x3; - *dp &= (png_byte)((0x3f3f >> (6 - shift)) & 0xff); - *dp |= (png_byte)(value << shift); - } - - if (shift == s_end) - { - shift = s_start; - sp++; - dp++; - } - else - shift += s_inc; - if (m == 1) - m = 0x80; - else - m >>= 1; - } - break; - } - - case 4: - { - png_bytep sp; - png_bytep dp; - int s_start, s_end, s_inc; - int m; - int shift; - png_uint_32 i; - int value; - - sp = png_ptr->row_buf + 1; - dp = row; - m = 0x80; -#if defined(PNG_READ_PACKSWAP_SUPPORTED) - if (png_ptr->transformations & PNG_PACKSWAP) - { - s_start = 0; - s_end = 4; - s_inc = 4; - } - else -#endif - { - s_start = 4; - s_end = 0; - s_inc = -4; - } - shift = s_start; - - for (i = 0; i < png_ptr->width; i++) - { - if (m & mask) - { - value = (*sp >> shift) & 0xf; - *dp &= (png_byte)((0xf0f >> (4 - shift)) & 0xff); - *dp |= (png_byte)(value << shift); - } - - if (shift == s_end) - { - shift = s_start; - sp++; - dp++; - } - else - shift += s_inc; - if (m == 1) - m = 0x80; - else - m >>= 1; - } - break; - } - - case 8: - { - png_bytep srcptr; - png_bytep dstptr; - png_uint_32 len; - int m; - int diff, unmask; - - __int64 mask0=0x0102040810204080; - -#if !defined(PNG_1_0_X) - if ((png_ptr->asm_flags & PNG_ASM_FLAG_MMX_READ_COMBINE_ROW) - /* && mmx_supported */ ) -#else - if (mmx_supported) -#endif - { - srcptr = png_ptr->row_buf + 1; - dstptr = row; - m = 0x80; - unmask = ~mask; - len = png_ptr->width &~7; /*reduce to multiple of 8 */ - diff = png_ptr->width & 7; /*amount lost */ - - _asm - { - movd mm7, unmask /*load bit pattern */ - psubb mm6,mm6 /*zero mm6 */ - punpcklbw mm7,mm7 - punpcklwd mm7,mm7 - punpckldq mm7,mm7 /*fill register with 8 masks */ - - movq mm0,mask0 - - pand mm0,mm7 /*nonzero if keep byte */ - pcmpeqb mm0,mm6 /*zeros->1s, v versa */ - - mov ecx,len /*load length of line (pixels) */ - mov esi,srcptr /*load source */ - mov ebx,dstptr /*load dest */ - cmp ecx,0 /*lcr */ - je mainloop8end - -mainloop8: - movq mm4,[esi] - pand mm4,mm0 - movq mm6,mm0 - pandn mm6,[ebx] - por mm4,mm6 - movq [ebx],mm4 - - add esi,8 /*inc by 8 bytes processed */ - add ebx,8 - sub ecx,8 /*dec by 8 pixels processed */ - - ja mainloop8 -mainloop8end: - - mov ecx,diff - cmp ecx,0 - jz end8 - - mov edx,mask - sal edx,24 /*make low byte the high byte */ - -secondloop8: - sal edx,1 /*move high bit to CF */ - jnc skip8 /*if CF = 0 */ - mov al,[esi] - mov [ebx],al -skip8: - inc esi - inc ebx - - dec ecx - jnz secondloop8 -end8: - emms - } - } - else /* mmx not supported - use modified C routine */ - { - register unsigned int incr1, initial_val, final_val; - png_size_t pixel_bytes; - png_uint_32 i; - register int disp = png_pass_inc[png_ptr->pass]; - int offset_table[7] = {0, 4, 0, 2, 0, 1, 0}; - - pixel_bytes = (png_ptr->row_info.pixel_depth >> 3); - srcptr = png_ptr->row_buf + 1 + offset_table[png_ptr->pass]* - pixel_bytes; - dstptr = row + offset_table[png_ptr->pass]*pixel_bytes; - initial_val = offset_table[png_ptr->pass]*pixel_bytes; - final_val = png_ptr->width*pixel_bytes; - incr1 = (disp)*pixel_bytes; - for (i = initial_val; i < final_val; i += incr1) - { - png_memcpy(dstptr, srcptr, pixel_bytes); - srcptr += incr1; - dstptr += incr1; - } - } /* end of else */ - - break; - } /* end 8 bpp */ - - case 16: - { - png_bytep srcptr; - png_bytep dstptr; - png_uint_32 len; - int unmask, diff; - __int64 mask1=0x0101020204040808, - mask0=0x1010202040408080; - -#if !defined(PNG_1_0_X) - if ((png_ptr->asm_flags & PNG_ASM_FLAG_MMX_READ_COMBINE_ROW) - /* && mmx_supported */ ) -#else - if (mmx_supported) -#endif - { - srcptr = png_ptr->row_buf + 1; - dstptr = row; - - unmask = ~mask; - len = (png_ptr->width)&~7; - diff = (png_ptr->width)&7; - _asm - { - movd mm7, unmask /*load bit pattern */ - psubb mm6,mm6 /*zero mm6 */ - punpcklbw mm7,mm7 - punpcklwd mm7,mm7 - punpckldq mm7,mm7 /*fill register with 8 masks */ - - movq mm0,mask0 - movq mm1,mask1 - - pand mm0,mm7 - pand mm1,mm7 - - pcmpeqb mm0,mm6 - pcmpeqb mm1,mm6 - - mov ecx,len /*load length of line */ - mov esi,srcptr /*load source */ - mov ebx,dstptr /*load dest */ - cmp ecx,0 /*lcr */ - jz mainloop16end - -mainloop16: - movq mm4,[esi] - pand mm4,mm0 - movq mm6,mm0 - movq mm7,[ebx] - pandn mm6,mm7 - por mm4,mm6 - movq [ebx],mm4 - - movq mm5,[esi+8] - pand mm5,mm1 - movq mm7,mm1 - movq mm6,[ebx+8] - pandn mm7,mm6 - por mm5,mm7 - movq [ebx+8],mm5 - - add esi,16 /*inc by 16 bytes processed */ - add ebx,16 - sub ecx,8 /*dec by 8 pixels processed */ - - ja mainloop16 - -mainloop16end: - mov ecx,diff - cmp ecx,0 - jz end16 - - mov edx,mask - sal edx,24 /*make low byte the high byte */ -secondloop16: - sal edx,1 /*move high bit to CF */ - jnc skip16 /*if CF = 0 */ - mov ax,[esi] - mov [ebx],ax -skip16: - add esi,2 - add ebx,2 - - dec ecx - jnz secondloop16 -end16: - emms - } - } - else /* mmx not supported - use modified C routine */ - { - register unsigned int incr1, initial_val, final_val; - png_size_t pixel_bytes; - png_uint_32 i; - register int disp = png_pass_inc[png_ptr->pass]; - int offset_table[7] = {0, 4, 0, 2, 0, 1, 0}; - - pixel_bytes = (png_ptr->row_info.pixel_depth >> 3); - srcptr = png_ptr->row_buf + 1 + offset_table[png_ptr->pass]* - pixel_bytes; - dstptr = row + offset_table[png_ptr->pass]*pixel_bytes; - initial_val = offset_table[png_ptr->pass]*pixel_bytes; - final_val = png_ptr->width*pixel_bytes; - incr1 = (disp)*pixel_bytes; - for (i = initial_val; i < final_val; i += incr1) - { - png_memcpy(dstptr, srcptr, pixel_bytes); - srcptr += incr1; - dstptr += incr1; - } - } /* end of else */ - - break; - } /* end 16 bpp */ - - case 24: - { - png_bytep srcptr; - png_bytep dstptr; - png_uint_32 len; - int unmask, diff; - - __int64 mask2=0x0101010202020404, /*24bpp */ - mask1=0x0408080810101020, - mask0=0x2020404040808080; - - srcptr = png_ptr->row_buf + 1; - dstptr = row; - - unmask = ~mask; - len = (png_ptr->width)&~7; - diff = (png_ptr->width)&7; - -#if !defined(PNG_1_0_X) - if ((png_ptr->asm_flags & PNG_ASM_FLAG_MMX_READ_COMBINE_ROW) - /* && mmx_supported */ ) -#else - if (mmx_supported) -#endif - { - _asm - { - movd mm7, unmask /*load bit pattern */ - psubb mm6,mm6 /*zero mm6 */ - punpcklbw mm7,mm7 - punpcklwd mm7,mm7 - punpckldq mm7,mm7 /*fill register with 8 masks */ - - movq mm0,mask0 - movq mm1,mask1 - movq mm2,mask2 - - pand mm0,mm7 - pand mm1,mm7 - pand mm2,mm7 - - pcmpeqb mm0,mm6 - pcmpeqb mm1,mm6 - pcmpeqb mm2,mm6 - - mov ecx,len /*load length of line */ - mov esi,srcptr /*load source */ - mov ebx,dstptr /*load dest */ - cmp ecx,0 - jz mainloop24end - -mainloop24: - movq mm4,[esi] - pand mm4,mm0 - movq mm6,mm0 - movq mm7,[ebx] - pandn mm6,mm7 - por mm4,mm6 - movq [ebx],mm4 - - - movq mm5,[esi+8] - pand mm5,mm1 - movq mm7,mm1 - movq mm6,[ebx+8] - pandn mm7,mm6 - por mm5,mm7 - movq [ebx+8],mm5 - - movq mm6,[esi+16] - pand mm6,mm2 - movq mm4,mm2 - movq mm7,[ebx+16] - pandn mm4,mm7 - por mm6,mm4 - movq [ebx+16],mm6 - - add esi,24 /*inc by 24 bytes processed */ - add ebx,24 - sub ecx,8 /*dec by 8 pixels processed */ - - ja mainloop24 - -mainloop24end: - mov ecx,diff - cmp ecx,0 - jz end24 - - mov edx,mask - sal edx,24 /*make low byte the high byte */ -secondloop24: - sal edx,1 /*move high bit to CF */ - jnc skip24 /*if CF = 0 */ - mov ax,[esi] - mov [ebx],ax - xor eax,eax - mov al,[esi+2] - mov [ebx+2],al -skip24: - add esi,3 - add ebx,3 - - dec ecx - jnz secondloop24 - -end24: - emms - } - } - else /* mmx not supported - use modified C routine */ - { - register unsigned int incr1, initial_val, final_val; - png_size_t pixel_bytes; - png_uint_32 i; - register int disp = png_pass_inc[png_ptr->pass]; - int offset_table[7] = {0, 4, 0, 2, 0, 1, 0}; - - pixel_bytes = (png_ptr->row_info.pixel_depth >> 3); - srcptr = png_ptr->row_buf + 1 + offset_table[png_ptr->pass]* - pixel_bytes; - dstptr = row + offset_table[png_ptr->pass]*pixel_bytes; - initial_val = offset_table[png_ptr->pass]*pixel_bytes; - final_val = png_ptr->width*pixel_bytes; - incr1 = (disp)*pixel_bytes; - for (i = initial_val; i < final_val; i += incr1) - { - png_memcpy(dstptr, srcptr, pixel_bytes); - srcptr += incr1; - dstptr += incr1; - } - } /* end of else */ - - break; - } /* end 24 bpp */ - - case 32: - { - png_bytep srcptr; - png_bytep dstptr; - png_uint_32 len; - int unmask, diff; - - __int64 mask3=0x0101010102020202, /*32bpp */ - mask2=0x0404040408080808, - mask1=0x1010101020202020, - mask0=0x4040404080808080; - - srcptr = png_ptr->row_buf + 1; - dstptr = row; - - unmask = ~mask; - len = (png_ptr->width)&~7; - diff = (png_ptr->width)&7; - -#if !defined(PNG_1_0_X) - if ((png_ptr->asm_flags & PNG_ASM_FLAG_MMX_READ_COMBINE_ROW) - /* && mmx_supported */ ) -#else - if (mmx_supported) -#endif - { - _asm - { - movd mm7, unmask /*load bit pattern */ - psubb mm6,mm6 /*zero mm6 */ - punpcklbw mm7,mm7 - punpcklwd mm7,mm7 - punpckldq mm7,mm7 /*fill register with 8 masks */ - - movq mm0,mask0 - movq mm1,mask1 - movq mm2,mask2 - movq mm3,mask3 - - pand mm0,mm7 - pand mm1,mm7 - pand mm2,mm7 - pand mm3,mm7 - - pcmpeqb mm0,mm6 - pcmpeqb mm1,mm6 - pcmpeqb mm2,mm6 - pcmpeqb mm3,mm6 - - mov ecx,len /*load length of line */ - mov esi,srcptr /*load source */ - mov ebx,dstptr /*load dest */ - - cmp ecx,0 /*lcr */ - jz mainloop32end - -mainloop32: - movq mm4,[esi] - pand mm4,mm0 - movq mm6,mm0 - movq mm7,[ebx] - pandn mm6,mm7 - por mm4,mm6 - movq [ebx],mm4 - - movq mm5,[esi+8] - pand mm5,mm1 - movq mm7,mm1 - movq mm6,[ebx+8] - pandn mm7,mm6 - por mm5,mm7 - movq [ebx+8],mm5 - - movq mm6,[esi+16] - pand mm6,mm2 - movq mm4,mm2 - movq mm7,[ebx+16] - pandn mm4,mm7 - por mm6,mm4 - movq [ebx+16],mm6 - - movq mm7,[esi+24] - pand mm7,mm3 - movq mm5,mm3 - movq mm4,[ebx+24] - pandn mm5,mm4 - por mm7,mm5 - movq [ebx+24],mm7 - - add esi,32 /*inc by 32 bytes processed */ - add ebx,32 - sub ecx,8 /*dec by 8 pixels processed */ - - ja mainloop32 - -mainloop32end: - mov ecx,diff - cmp ecx,0 - jz end32 - - mov edx,mask - sal edx,24 /*make low byte the high byte */ -secondloop32: - sal edx,1 /*move high bit to CF */ - jnc skip32 /*if CF = 0 */ - mov eax,[esi] - mov [ebx],eax -skip32: - add esi,4 - add ebx,4 - - dec ecx - jnz secondloop32 - -end32: - emms - } - } - else /* mmx _not supported - Use modified C routine */ - { - register unsigned int incr1, initial_val, final_val; - png_size_t pixel_bytes; - png_uint_32 i; - register int disp = png_pass_inc[png_ptr->pass]; - int offset_table[7] = {0, 4, 0, 2, 0, 1, 0}; - - pixel_bytes = (png_ptr->row_info.pixel_depth >> 3); - srcptr = png_ptr->row_buf + 1 + offset_table[png_ptr->pass]* - pixel_bytes; - dstptr = row + offset_table[png_ptr->pass]*pixel_bytes; - initial_val = offset_table[png_ptr->pass]*pixel_bytes; - final_val = png_ptr->width*pixel_bytes; - incr1 = (disp)*pixel_bytes; - for (i = initial_val; i < final_val; i += incr1) - { - png_memcpy(dstptr, srcptr, pixel_bytes); - srcptr += incr1; - dstptr += incr1; - } - } /* end of else */ - - break; - } /* end 32 bpp */ - - case 48: - { - png_bytep srcptr; - png_bytep dstptr; - png_uint_32 len; - int unmask, diff; - - __int64 mask5=0x0101010101010202, - mask4=0x0202020204040404, - mask3=0x0404080808080808, - mask2=0x1010101010102020, - mask1=0x2020202040404040, - mask0=0x4040808080808080; - -#if !defined(PNG_1_0_X) - if ((png_ptr->asm_flags & PNG_ASM_FLAG_MMX_READ_COMBINE_ROW) - /* && mmx_supported */ ) -#else - if (mmx_supported) -#endif - { - srcptr = png_ptr->row_buf + 1; - dstptr = row; - - unmask = ~mask; - len = (png_ptr->width)&~7; - diff = (png_ptr->width)&7; - _asm - { - movd mm7, unmask /*load bit pattern */ - psubb mm6,mm6 /*zero mm6 */ - punpcklbw mm7,mm7 - punpcklwd mm7,mm7 - punpckldq mm7,mm7 /*fill register with 8 masks */ - - movq mm0,mask0 - movq mm1,mask1 - movq mm2,mask2 - movq mm3,mask3 - movq mm4,mask4 - movq mm5,mask5 - - pand mm0,mm7 - pand mm1,mm7 - pand mm2,mm7 - pand mm3,mm7 - pand mm4,mm7 - pand mm5,mm7 - - pcmpeqb mm0,mm6 - pcmpeqb mm1,mm6 - pcmpeqb mm2,mm6 - pcmpeqb mm3,mm6 - pcmpeqb mm4,mm6 - pcmpeqb mm5,mm6 - - mov ecx,len /*load length of line */ - mov esi,srcptr /*load source */ - mov ebx,dstptr /*load dest */ - - cmp ecx,0 - jz mainloop48end - -mainloop48: - movq mm7,[esi] - pand mm7,mm0 - movq mm6,mm0 - pandn mm6,[ebx] - por mm7,mm6 - movq [ebx],mm7 - - movq mm6,[esi+8] - pand mm6,mm1 - movq mm7,mm1 - pandn mm7,[ebx+8] - por mm6,mm7 - movq [ebx+8],mm6 - - movq mm6,[esi+16] - pand mm6,mm2 - movq mm7,mm2 - pandn mm7,[ebx+16] - por mm6,mm7 - movq [ebx+16],mm6 - - movq mm7,[esi+24] - pand mm7,mm3 - movq mm6,mm3 - pandn mm6,[ebx+24] - por mm7,mm6 - movq [ebx+24],mm7 - - movq mm6,[esi+32] - pand mm6,mm4 - movq mm7,mm4 - pandn mm7,[ebx+32] - por mm6,mm7 - movq [ebx+32],mm6 - - movq mm7,[esi+40] - pand mm7,mm5 - movq mm6,mm5 - pandn mm6,[ebx+40] - por mm7,mm6 - movq [ebx+40],mm7 - - add esi,48 /*inc by 32 bytes processed */ - add ebx,48 - sub ecx,8 /*dec by 8 pixels processed */ - - ja mainloop48 -mainloop48end: - - mov ecx,diff - cmp ecx,0 - jz end48 - - mov edx,mask - sal edx,24 /*make low byte the high byte */ - -secondloop48: - sal edx,1 /*move high bit to CF */ - jnc skip48 /*if CF = 0 */ - mov eax,[esi] - mov [ebx],eax -skip48: - add esi,4 - add ebx,4 - - dec ecx - jnz secondloop48 - -end48: - emms - } - } - else /* mmx _not supported - Use modified C routine */ - { - register unsigned int incr1, initial_val, final_val; - png_size_t pixel_bytes; - png_uint_32 i; - register int disp = png_pass_inc[png_ptr->pass]; - int offset_table[7] = {0, 4, 0, 2, 0, 1, 0}; - - pixel_bytes = (png_ptr->row_info.pixel_depth >> 3); - srcptr = png_ptr->row_buf + 1 + offset_table[png_ptr->pass]* - pixel_bytes; - dstptr = row + offset_table[png_ptr->pass]*pixel_bytes; - initial_val = offset_table[png_ptr->pass]*pixel_bytes; - final_val = png_ptr->width*pixel_bytes; - incr1 = (disp)*pixel_bytes; - for (i = initial_val; i < final_val; i += incr1) - { - png_memcpy(dstptr, srcptr, pixel_bytes); - srcptr += incr1; - dstptr += incr1; - } - } /* end of else */ - - break; - } /* end 48 bpp */ - - default: - { - png_bytep sptr; - png_bytep dp; - png_size_t pixel_bytes; - int offset_table[7] = {0, 4, 0, 2, 0, 1, 0}; - unsigned int i; - register int disp = png_pass_inc[png_ptr->pass]; /* get the offset */ - register unsigned int incr1, initial_val, final_val; - - pixel_bytes = (png_ptr->row_info.pixel_depth >> 3); - sptr = png_ptr->row_buf + 1 + offset_table[png_ptr->pass]* - pixel_bytes; - dp = row + offset_table[png_ptr->pass]*pixel_bytes; - initial_val = offset_table[png_ptr->pass]*pixel_bytes; - final_val = png_ptr->width*pixel_bytes; - incr1 = (disp)*pixel_bytes; - for (i = initial_val; i < final_val; i += incr1) - { - png_memcpy(dp, sptr, pixel_bytes); - sptr += incr1; - dp += incr1; - } - break; - } - } /* end switch (png_ptr->row_info.pixel_depth) */ - } /* end if (non-trivial mask) */ - -} /* end png_combine_row() */ - - -#if defined(PNG_READ_INTERLACING_SUPPORTED) - -void /* PRIVATE */ -png_do_read_interlace(png_structp png_ptr) -{ - png_row_infop row_info = &(png_ptr->row_info); - png_bytep row = png_ptr->row_buf + 1; - int pass = png_ptr->pass; - png_uint_32 transformations = png_ptr->transformations; -#ifdef PNG_USE_LOCAL_ARRAYS - const int png_pass_inc[7] = {8, 8, 4, 4, 2, 2, 1}; -#endif - - png_debug(1,"in png_do_read_interlace\n"); - - if (mmx_supported == 2) { -#if !defined(PNG_1_0_X) - /* this should have happened in png_init_mmx_flags() already */ - png_warning(png_ptr, "asm_flags may not have been initialized"); -#endif - png_mmx_support(); - } - - if (row != NULL && row_info != NULL) - { - png_uint_32 final_width; - - final_width = row_info->width * png_pass_inc[pass]; - - switch (row_info->pixel_depth) - { - case 1: - { - png_bytep sp, dp; - int sshift, dshift; - int s_start, s_end, s_inc; - png_byte v; - png_uint_32 i; - int j; - - sp = row + (png_size_t)((row_info->width - 1) >> 3); - dp = row + (png_size_t)((final_width - 1) >> 3); -#if defined(PNG_READ_PACKSWAP_SUPPORTED) - if (transformations & PNG_PACKSWAP) - { - sshift = (int)((row_info->width + 7) & 7); - dshift = (int)((final_width + 7) & 7); - s_start = 7; - s_end = 0; - s_inc = -1; - } - else -#endif - { - sshift = 7 - (int)((row_info->width + 7) & 7); - dshift = 7 - (int)((final_width + 7) & 7); - s_start = 0; - s_end = 7; - s_inc = 1; - } - - for (i = row_info->width; i; i--) - { - v = (png_byte)((*sp >> sshift) & 0x1); - for (j = 0; j < png_pass_inc[pass]; j++) - { - *dp &= (png_byte)((0x7f7f >> (7 - dshift)) & 0xff); - *dp |= (png_byte)(v << dshift); - if (dshift == s_end) - { - dshift = s_start; - dp--; - } - else - dshift += s_inc; - } - if (sshift == s_end) - { - sshift = s_start; - sp--; - } - else - sshift += s_inc; - } - break; - } - - case 2: - { - png_bytep sp, dp; - int sshift, dshift; - int s_start, s_end, s_inc; - png_uint_32 i; - - sp = row + (png_size_t)((row_info->width - 1) >> 2); - dp = row + (png_size_t)((final_width - 1) >> 2); -#if defined(PNG_READ_PACKSWAP_SUPPORTED) - if (transformations & PNG_PACKSWAP) - { - sshift = (png_size_t)(((row_info->width + 3) & 3) << 1); - dshift = (png_size_t)(((final_width + 3) & 3) << 1); - s_start = 6; - s_end = 0; - s_inc = -2; - } - else -#endif - { - sshift = (png_size_t)((3 - ((row_info->width + 3) & 3)) << 1); - dshift = (png_size_t)((3 - ((final_width + 3) & 3)) << 1); - s_start = 0; - s_end = 6; - s_inc = 2; - } - - for (i = row_info->width; i; i--) - { - png_byte v; - int j; - - v = (png_byte)((*sp >> sshift) & 0x3); - for (j = 0; j < png_pass_inc[pass]; j++) - { - *dp &= (png_byte)((0x3f3f >> (6 - dshift)) & 0xff); - *dp |= (png_byte)(v << dshift); - if (dshift == s_end) - { - dshift = s_start; - dp--; - } - else - dshift += s_inc; - } - if (sshift == s_end) - { - sshift = s_start; - sp--; - } - else - sshift += s_inc; - } - break; - } - - case 4: - { - png_bytep sp, dp; - int sshift, dshift; - int s_start, s_end, s_inc; - png_uint_32 i; - - sp = row + (png_size_t)((row_info->width - 1) >> 1); - dp = row + (png_size_t)((final_width - 1) >> 1); -#if defined(PNG_READ_PACKSWAP_SUPPORTED) - if (transformations & PNG_PACKSWAP) - { - sshift = (png_size_t)(((row_info->width + 1) & 1) << 2); - dshift = (png_size_t)(((final_width + 1) & 1) << 2); - s_start = 4; - s_end = 0; - s_inc = -4; - } - else -#endif - { - sshift = (png_size_t)((1 - ((row_info->width + 1) & 1)) << 2); - dshift = (png_size_t)((1 - ((final_width + 1) & 1)) << 2); - s_start = 0; - s_end = 4; - s_inc = 4; - } - - for (i = row_info->width; i; i--) - { - png_byte v; - int j; - - v = (png_byte)((*sp >> sshift) & 0xf); - for (j = 0; j < png_pass_inc[pass]; j++) - { - *dp &= (png_byte)((0xf0f >> (4 - dshift)) & 0xff); - *dp |= (png_byte)(v << dshift); - if (dshift == s_end) - { - dshift = s_start; - dp--; - } - else - dshift += s_inc; - } - if (sshift == s_end) - { - sshift = s_start; - sp--; - } - else - sshift += s_inc; - } - break; - } - - default: /* This is the place where the routine is modified */ - { - __int64 const4 = 0x0000000000FFFFFF; - /* __int64 const5 = 0x000000FFFFFF0000; // unused... */ - __int64 const6 = 0x00000000000000FF; - png_bytep sptr, dp; - png_uint_32 i; - png_size_t pixel_bytes; - int width = row_info->width; - - pixel_bytes = (row_info->pixel_depth >> 3); - - sptr = row + (width - 1) * pixel_bytes; - dp = row + (final_width - 1) * pixel_bytes; - /* New code by Nirav Chhatrapati - Intel Corporation */ - /* sign fix by GRR */ - /* NOTE: there is NO MMX code for 48-bit and 64-bit images */ - - // use MMX routine if machine supports it -#if !defined(PNG_1_0_X) - if ((png_ptr->asm_flags & PNG_ASM_FLAG_MMX_READ_INTERLACE) - /* && mmx_supported */ ) -#else - if (mmx_supported) -#endif - { - if (pixel_bytes == 3) - { - if (((pass == 0) || (pass == 1)) && width) - { - _asm - { - mov esi, sptr - mov edi, dp - mov ecx, width - sub edi, 21 /* (png_pass_inc[pass] - 1)*pixel_bytes */ -loop_pass0: - movd mm0, [esi] ; X X X X X v2 v1 v0 - pand mm0, const4 ; 0 0 0 0 0 v2 v1 v0 - movq mm1, mm0 ; 0 0 0 0 0 v2 v1 v0 - psllq mm0, 16 ; 0 0 0 v2 v1 v0 0 0 - movq mm2, mm0 ; 0 0 0 v2 v1 v0 0 0 - psllq mm0, 24 ; v2 v1 v0 0 0 0 0 0 - psrlq mm1, 8 ; 0 0 0 0 0 0 v2 v1 - por mm0, mm2 ; v2 v1 v0 v2 v1 v0 0 0 - por mm0, mm1 ; v2 v1 v0 v2 v1 v0 v2 v1 - movq mm3, mm0 ; v2 v1 v0 v2 v1 v0 v2 v1 - psllq mm0, 16 ; v0 v2 v1 v0 v2 v1 0 0 - movq mm4, mm3 ; v2 v1 v0 v2 v1 v0 v2 v1 - punpckhdq mm3, mm0 ; v0 v2 v1 v0 v2 v1 v0 v2 - movq [edi+16] , mm4 - psrlq mm0, 32 ; 0 0 0 0 v0 v2 v1 v0 - movq [edi+8] , mm3 - punpckldq mm0, mm4 ; v1 v0 v2 v1 v0 v2 v1 v0 - sub esi, 3 - movq [edi], mm0 - sub edi, 24 - /*sub esi, 3 */ - dec ecx - jnz loop_pass0 - EMMS - } - } - else if (((pass == 2) || (pass == 3)) && width) - { - _asm - { - mov esi, sptr - mov edi, dp - mov ecx, width - sub edi, 9 /* (png_pass_inc[pass] - 1)*pixel_bytes */ -loop_pass2: - movd mm0, [esi] ; X X X X X v2 v1 v0 - pand mm0, const4 ; 0 0 0 0 0 v2 v1 v0 - movq mm1, mm0 ; 0 0 0 0 0 v2 v1 v0 - psllq mm0, 16 ; 0 0 0 v2 v1 v0 0 0 - movq mm2, mm0 ; 0 0 0 v2 v1 v0 0 0 - psllq mm0, 24 ; v2 v1 v0 0 0 0 0 0 - psrlq mm1, 8 ; 0 0 0 0 0 0 v2 v1 - por mm0, mm2 ; v2 v1 v0 v2 v1 v0 0 0 - por mm0, mm1 ; v2 v1 v0 v2 v1 v0 v2 v1 - movq [edi+4], mm0 ; move to memory - psrlq mm0, 16 ; 0 0 v2 v1 v0 v2 v1 v0 - movd [edi], mm0 ; move to memory - sub esi, 3 - sub edi, 12 - dec ecx - jnz loop_pass2 - EMMS - } - } - else if (width) /* && ((pass == 4) || (pass == 5)) */ - { - int width_mmx = ((width >> 1) << 1) - 8; - if (width_mmx < 0) - width_mmx = 0; - width -= width_mmx; /* 8 or 9 pix, 24 or 27 bytes */ - if (width_mmx) - { - _asm - { - mov esi, sptr - mov edi, dp - mov ecx, width_mmx - sub esi, 3 - sub edi, 9 -loop_pass4: - movq mm0, [esi] ; X X v2 v1 v0 v5 v4 v3 - movq mm7, mm0 ; X X v2 v1 v0 v5 v4 v3 - movq mm6, mm0 ; X X v2 v1 v0 v5 v4 v3 - psllq mm0, 24 ; v1 v0 v5 v4 v3 0 0 0 - pand mm7, const4 ; 0 0 0 0 0 v5 v4 v3 - psrlq mm6, 24 ; 0 0 0 X X v2 v1 v0 - por mm0, mm7 ; v1 v0 v5 v4 v3 v5 v4 v3 - movq mm5, mm6 ; 0 0 0 X X v2 v1 v0 - psllq mm6, 8 ; 0 0 X X v2 v1 v0 0 - movq [edi], mm0 ; move quad to memory - psrlq mm5, 16 ; 0 0 0 0 0 X X v2 - pand mm5, const6 ; 0 0 0 0 0 0 0 v2 - por mm6, mm5 ; 0 0 X X v2 v1 v0 v2 - movd [edi+8], mm6 ; move double to memory - sub esi, 6 - sub edi, 12 - sub ecx, 2 - jnz loop_pass4 - EMMS - } - } - - sptr -= width_mmx*3; - dp -= width_mmx*6; - for (i = width; i; i--) - { - png_byte v[8]; - int j; - - png_memcpy(v, sptr, 3); - for (j = 0; j < png_pass_inc[pass]; j++) - { - png_memcpy(dp, v, 3); - dp -= 3; - } - sptr -= 3; - } - } - } /* end of pixel_bytes == 3 */ - - else if (pixel_bytes == 1) - { - if (((pass == 0) || (pass == 1)) && width) - { - int width_mmx = ((width >> 2) << 2); - width -= width_mmx; - if (width_mmx) - { - _asm - { - mov esi, sptr - mov edi, dp - mov ecx, width_mmx - sub edi, 31 - sub esi, 3 -loop1_pass0: - movd mm0, [esi] ; X X X X v0 v1 v2 v3 - movq mm1, mm0 ; X X X X v0 v1 v2 v3 - punpcklbw mm0, mm0 ; v0 v0 v1 v1 v2 v2 v3 v3 - movq mm2, mm0 ; v0 v0 v1 v1 v2 v2 v3 v3 - punpcklwd mm0, mm0 ; v2 v2 v2 v2 v3 v3 v3 v3 - movq mm3, mm0 ; v2 v2 v2 v2 v3 v3 v3 v3 - punpckldq mm0, mm0 ; v3 v3 v3 v3 v3 v3 v3 v3 - punpckhdq mm3, mm3 ; v2 v2 v2 v2 v2 v2 v2 v2 - movq [edi], mm0 ; move to memory v3 - punpckhwd mm2, mm2 ; v0 v0 v0 v0 v1 v1 v1 v1 - movq [edi+8], mm3 ; move to memory v2 - movq mm4, mm2 ; v0 v0 v0 v0 v1 v1 v1 v1 - punpckldq mm2, mm2 ; v1 v1 v1 v1 v1 v1 v1 v1 - punpckhdq mm4, mm4 ; v0 v0 v0 v0 v0 v0 v0 v0 - movq [edi+16], mm2 ; move to memory v1 - movq [edi+24], mm4 ; move to memory v0 - sub esi, 4 - sub edi, 32 - sub ecx, 4 - jnz loop1_pass0 - EMMS - } - } - - sptr -= width_mmx; - dp -= width_mmx*8; - for (i = width; i; i--) - { - int j; - - /* I simplified this part in version 1.0.4e - * here and in several other instances where - * pixel_bytes == 1 -- GR-P - * - * Original code: - * - * png_byte v[8]; - * png_memcpy(v, sptr, pixel_bytes); - * for (j = 0; j < png_pass_inc[pass]; j++) - * { - * png_memcpy(dp, v, pixel_bytes); - * dp -= pixel_bytes; - * } - * sptr -= pixel_bytes; - * - * Replacement code is in the next three lines: - */ - - for (j = 0; j < png_pass_inc[pass]; j++) - *dp-- = *sptr; - sptr--; - } - } - else if (((pass == 2) || (pass == 3)) && width) - { - int width_mmx = ((width >> 2) << 2); - width -= width_mmx; - if (width_mmx) - { - _asm - { - mov esi, sptr - mov edi, dp - mov ecx, width_mmx - sub edi, 15 - sub esi, 3 -loop1_pass2: - movd mm0, [esi] ; X X X X v0 v1 v2 v3 - punpcklbw mm0, mm0 ; v0 v0 v1 v1 v2 v2 v3 v3 - movq mm1, mm0 ; v0 v0 v1 v1 v2 v2 v3 v3 - punpcklwd mm0, mm0 ; v2 v2 v2 v2 v3 v3 v3 v3 - punpckhwd mm1, mm1 ; v0 v0 v0 v0 v1 v1 v1 v1 - movq [edi], mm0 ; move to memory v2 and v3 - sub esi, 4 - movq [edi+8], mm1 ; move to memory v1 and v0 - sub edi, 16 - sub ecx, 4 - jnz loop1_pass2 - EMMS - } - } - - sptr -= width_mmx; - dp -= width_mmx*4; - for (i = width; i; i--) - { - int j; - - for (j = 0; j < png_pass_inc[pass]; j++) - { - *dp-- = *sptr; - } - sptr --; - } - } - else if (width) /* && ((pass == 4) || (pass == 5))) */ - { - int width_mmx = ((width >> 3) << 3); - width -= width_mmx; - if (width_mmx) - { - _asm - { - mov esi, sptr - mov edi, dp - mov ecx, width_mmx - sub edi, 15 - sub esi, 7 -loop1_pass4: - movq mm0, [esi] ; v0 v1 v2 v3 v4 v5 v6 v7 - movq mm1, mm0 ; v0 v1 v2 v3 v4 v5 v6 v7 - punpcklbw mm0, mm0 ; v4 v4 v5 v5 v6 v6 v7 v7 - /*movq mm1, mm0 ; v0 v0 v1 v1 v2 v2 v3 v3 */ - punpckhbw mm1, mm1 ;v0 v0 v1 v1 v2 v2 v3 v3 - movq [edi+8], mm1 ; move to memory v0 v1 v2 and v3 - sub esi, 8 - movq [edi], mm0 ; move to memory v4 v5 v6 and v7 - /*sub esi, 4 */ - sub edi, 16 - sub ecx, 8 - jnz loop1_pass4 - EMMS - } - } - - sptr -= width_mmx; - dp -= width_mmx*2; - for (i = width; i; i--) - { - int j; - - for (j = 0; j < png_pass_inc[pass]; j++) - { - *dp-- = *sptr; - } - sptr --; - } - } - } /* end of pixel_bytes == 1 */ - - else if (pixel_bytes == 2) - { - if (((pass == 0) || (pass == 1)) && width) - { - int width_mmx = ((width >> 1) << 1); - width -= width_mmx; - if (width_mmx) - { - _asm - { - mov esi, sptr - mov edi, dp - mov ecx, width_mmx - sub esi, 2 - sub edi, 30 -loop2_pass0: - movd mm0, [esi] ; X X X X v1 v0 v3 v2 - punpcklwd mm0, mm0 ; v1 v0 v1 v0 v3 v2 v3 v2 - movq mm1, mm0 ; v1 v0 v1 v0 v3 v2 v3 v2 - punpckldq mm0, mm0 ; v3 v2 v3 v2 v3 v2 v3 v2 - punpckhdq mm1, mm1 ; v1 v0 v1 v0 v1 v0 v1 v0 - movq [edi], mm0 - movq [edi + 8], mm0 - movq [edi + 16], mm1 - movq [edi + 24], mm1 - sub esi, 4 - sub edi, 32 - sub ecx, 2 - jnz loop2_pass0 - EMMS - } - } - - sptr -= (width_mmx*2 - 2); /* sign fixed */ - dp -= (width_mmx*16 - 2); /* sign fixed */ - for (i = width; i; i--) - { - png_byte v[8]; - int j; - sptr -= 2; - png_memcpy(v, sptr, 2); - for (j = 0; j < png_pass_inc[pass]; j++) - { - dp -= 2; - png_memcpy(dp, v, 2); - } - } - } - else if (((pass == 2) || (pass == 3)) && width) - { - int width_mmx = ((width >> 1) << 1) ; - width -= width_mmx; - if (width_mmx) - { - _asm - { - mov esi, sptr - mov edi, dp - mov ecx, width_mmx - sub esi, 2 - sub edi, 14 -loop2_pass2: - movd mm0, [esi] ; X X X X v1 v0 v3 v2 - punpcklwd mm0, mm0 ; v1 v0 v1 v0 v3 v2 v3 v2 - movq mm1, mm0 ; v1 v0 v1 v0 v3 v2 v3 v2 - punpckldq mm0, mm0 ; v3 v2 v3 v2 v3 v2 v3 v2 - punpckhdq mm1, mm1 ; v1 v0 v1 v0 v1 v0 v1 v0 - movq [edi], mm0 - sub esi, 4 - movq [edi + 8], mm1 - /*sub esi, 4 */ - sub edi, 16 - sub ecx, 2 - jnz loop2_pass2 - EMMS - } - } - - sptr -= (width_mmx*2 - 2); /* sign fixed */ - dp -= (width_mmx*8 - 2); /* sign fixed */ - for (i = width; i; i--) - { - png_byte v[8]; - int j; - sptr -= 2; - png_memcpy(v, sptr, 2); - for (j = 0; j < png_pass_inc[pass]; j++) - { - dp -= 2; - png_memcpy(dp, v, 2); - } - } - } - else if (width) /* pass == 4 or 5 */ - { - int width_mmx = ((width >> 1) << 1) ; - width -= width_mmx; - if (width_mmx) - { - _asm - { - mov esi, sptr - mov edi, dp - mov ecx, width_mmx - sub esi, 2 - sub edi, 6 -loop2_pass4: - movd mm0, [esi] ; X X X X v1 v0 v3 v2 - punpcklwd mm0, mm0 ; v1 v0 v1 v0 v3 v2 v3 v2 - sub esi, 4 - movq [edi], mm0 - sub edi, 8 - sub ecx, 2 - jnz loop2_pass4 - EMMS - } - } - - sptr -= (width_mmx*2 - 2); /* sign fixed */ - dp -= (width_mmx*4 - 2); /* sign fixed */ - for (i = width; i; i--) - { - png_byte v[8]; - int j; - sptr -= 2; - png_memcpy(v, sptr, 2); - for (j = 0; j < png_pass_inc[pass]; j++) - { - dp -= 2; - png_memcpy(dp, v, 2); - } - } - } - } /* end of pixel_bytes == 2 */ - - else if (pixel_bytes == 4) - { - if (((pass == 0) || (pass == 1)) && width) - { - int width_mmx = ((width >> 1) << 1) ; - width -= width_mmx; - if (width_mmx) - { - _asm - { - mov esi, sptr - mov edi, dp - mov ecx, width_mmx - sub esi, 4 - sub edi, 60 -loop4_pass0: - movq mm0, [esi] ; v3 v2 v1 v0 v7 v6 v5 v4 - movq mm1, mm0 ; v3 v2 v1 v0 v7 v6 v5 v4 - punpckldq mm0, mm0 ; v7 v6 v5 v4 v7 v6 v5 v4 - punpckhdq mm1, mm1 ; v3 v2 v1 v0 v3 v2 v1 v0 - movq [edi], mm0 - movq [edi + 8], mm0 - movq [edi + 16], mm0 - movq [edi + 24], mm0 - movq [edi+32], mm1 - movq [edi + 40], mm1 - movq [edi+ 48], mm1 - sub esi, 8 - movq [edi + 56], mm1 - sub edi, 64 - sub ecx, 2 - jnz loop4_pass0 - EMMS - } - } - - sptr -= (width_mmx*4 - 4); /* sign fixed */ - dp -= (width_mmx*32 - 4); /* sign fixed */ - for (i = width; i; i--) - { - png_byte v[8]; - int j; - sptr -= 4; - png_memcpy(v, sptr, 4); - for (j = 0; j < png_pass_inc[pass]; j++) - { - dp -= 4; - png_memcpy(dp, v, 4); - } - } - } - else if (((pass == 2) || (pass == 3)) && width) - { - int width_mmx = ((width >> 1) << 1) ; - width -= width_mmx; - if (width_mmx) - { - _asm - { - mov esi, sptr - mov edi, dp - mov ecx, width_mmx - sub esi, 4 - sub edi, 28 -loop4_pass2: - movq mm0, [esi] ; v3 v2 v1 v0 v7 v6 v5 v4 - movq mm1, mm0 ; v3 v2 v1 v0 v7 v6 v5 v4 - punpckldq mm0, mm0 ; v7 v6 v5 v4 v7 v6 v5 v4 - punpckhdq mm1, mm1 ; v3 v2 v1 v0 v3 v2 v1 v0 - movq [edi], mm0 - movq [edi + 8], mm0 - movq [edi+16], mm1 - movq [edi + 24], mm1 - sub esi, 8 - sub edi, 32 - sub ecx, 2 - jnz loop4_pass2 - EMMS - } - } - - sptr -= (width_mmx*4 - 4); /* sign fixed */ - dp -= (width_mmx*16 - 4); /* sign fixed */ - for (i = width; i; i--) - { - png_byte v[8]; - int j; - sptr -= 4; - png_memcpy(v, sptr, 4); - for (j = 0; j < png_pass_inc[pass]; j++) - { - dp -= 4; - png_memcpy(dp, v, 4); - } - } - } - else if (width) /* pass == 4 or 5 */ - { - int width_mmx = ((width >> 1) << 1) ; - width -= width_mmx; - if (width_mmx) - { - _asm - { - mov esi, sptr - mov edi, dp - mov ecx, width_mmx - sub esi, 4 - sub edi, 12 -loop4_pass4: - movq mm0, [esi] ; v3 v2 v1 v0 v7 v6 v5 v4 - movq mm1, mm0 ; v3 v2 v1 v0 v7 v6 v5 v4 - punpckldq mm0, mm0 ; v7 v6 v5 v4 v7 v6 v5 v4 - punpckhdq mm1, mm1 ; v3 v2 v1 v0 v3 v2 v1 v0 - movq [edi], mm0 - sub esi, 8 - movq [edi + 8], mm1 - sub edi, 16 - sub ecx, 2 - jnz loop4_pass4 - EMMS - } - } - - sptr -= (width_mmx*4 - 4); /* sign fixed */ - dp -= (width_mmx*8 - 4); /* sign fixed */ - for (i = width; i; i--) - { - png_byte v[8]; - int j; - sptr -= 4; - png_memcpy(v, sptr, 4); - for (j = 0; j < png_pass_inc[pass]; j++) - { - dp -= 4; - png_memcpy(dp, v, 4); - } - } - } - - } /* end of pixel_bytes == 4 */ - - else if (pixel_bytes == 6) - { - for (i = width; i; i--) - { - png_byte v[8]; - int j; - png_memcpy(v, sptr, 6); - for (j = 0; j < png_pass_inc[pass]; j++) - { - png_memcpy(dp, v, 6); - dp -= 6; - } - sptr -= 6; - } - } /* end of pixel_bytes == 6 */ - - else - { - for (i = width; i; i--) - { - png_byte v[8]; - int j; - png_memcpy(v, sptr, pixel_bytes); - for (j = 0; j < png_pass_inc[pass]; j++) - { - png_memcpy(dp, v, pixel_bytes); - dp -= pixel_bytes; - } - sptr-= pixel_bytes; - } - } - } /* end of mmx_supported */ - - else /* MMX not supported: use modified C code - takes advantage - * of inlining of memcpy for a constant */ - { - if (pixel_bytes == 1) - { - for (i = width; i; i--) - { - int j; - for (j = 0; j < png_pass_inc[pass]; j++) - *dp-- = *sptr; - sptr--; - } - } - else if (pixel_bytes == 3) - { - for (i = width; i; i--) - { - png_byte v[8]; - int j; - png_memcpy(v, sptr, pixel_bytes); - for (j = 0; j < png_pass_inc[pass]; j++) - { - png_memcpy(dp, v, pixel_bytes); - dp -= pixel_bytes; - } - sptr -= pixel_bytes; - } - } - else if (pixel_bytes == 2) - { - for (i = width; i; i--) - { - png_byte v[8]; - int j; - png_memcpy(v, sptr, pixel_bytes); - for (j = 0; j < png_pass_inc[pass]; j++) - { - png_memcpy(dp, v, pixel_bytes); - dp -= pixel_bytes; - } - sptr -= pixel_bytes; - } - } - else if (pixel_bytes == 4) - { - for (i = width; i; i--) - { - png_byte v[8]; - int j; - png_memcpy(v, sptr, pixel_bytes); - for (j = 0; j < png_pass_inc[pass]; j++) - { - png_memcpy(dp, v, pixel_bytes); - dp -= pixel_bytes; - } - sptr -= pixel_bytes; - } - } - else if (pixel_bytes == 6) - { - for (i = width; i; i--) - { - png_byte v[8]; - int j; - png_memcpy(v, sptr, pixel_bytes); - for (j = 0; j < png_pass_inc[pass]; j++) - { - png_memcpy(dp, v, pixel_bytes); - dp -= pixel_bytes; - } - sptr -= pixel_bytes; - } - } - else - { - for (i = width; i; i--) - { - png_byte v[8]; - int j; - png_memcpy(v, sptr, pixel_bytes); - for (j = 0; j < png_pass_inc[pass]; j++) - { - png_memcpy(dp, v, pixel_bytes); - dp -= pixel_bytes; - } - sptr -= pixel_bytes; - } - } - - } /* end of MMX not supported */ - break; - } - } /* end switch (row_info->pixel_depth) */ - - row_info->width = final_width; - - row_info->rowbytes = PNG_ROWBYTES(row_info->pixel_depth,final_width); - } - -} - -#endif /* PNG_READ_INTERLACING_SUPPORTED */ - - -/* These variables are utilized in the functions below. They are declared */ -/* globally here to ensure alignment on 8-byte boundaries. */ - -union uAll { - __int64 use; - double align; -} LBCarryMask = {0x0101010101010101}, - HBClearMask = {0x7f7f7f7f7f7f7f7f}, - ActiveMask, ActiveMask2, ActiveMaskEnd, ShiftBpp, ShiftRem; - - -/* Optimized code for PNG Average filter decoder */ -void /* PRIVATE */ -png_read_filter_row_mmx_avg(png_row_infop row_info, png_bytep row - , png_bytep prev_row) -{ - int bpp; - png_uint_32 FullLength; - png_uint_32 MMXLength; - /*png_uint_32 len; */ - int diff; - - bpp = (row_info->pixel_depth + 7) >> 3; /* Get # bytes per pixel */ - FullLength = row_info->rowbytes; /* # of bytes to filter */ - _asm { - /* Init address pointers and offset */ - mov edi, row /* edi ==> Avg(x) */ - xor ebx, ebx /* ebx ==> x */ - mov edx, edi - mov esi, prev_row /* esi ==> Prior(x) */ - sub edx, bpp /* edx ==> Raw(x-bpp) */ - - xor eax, eax - /* Compute the Raw value for the first bpp bytes */ - /* Raw(x) = Avg(x) + (Prior(x)/2) */ -davgrlp: - mov al, [esi + ebx] /* Load al with Prior(x) */ - inc ebx - shr al, 1 /* divide by 2 */ - add al, [edi+ebx-1] /* Add Avg(x); -1 to offset inc ebx */ - cmp ebx, bpp - mov [edi+ebx-1], al /* Write back Raw(x); */ - /* mov does not affect flags; -1 to offset inc ebx */ - jb davgrlp - /* get # of bytes to alignment */ - mov diff, edi /* take start of row */ - add diff, ebx /* add bpp */ - add diff, 0xf /* add 7 + 8 to incr past alignment boundary */ - and diff, 0xfffffff8 /* mask to alignment boundary */ - sub diff, edi /* subtract from start ==> value ebx at alignment */ - jz davggo - /* fix alignment */ - /* Compute the Raw value for the bytes upto the alignment boundary */ - /* Raw(x) = Avg(x) + ((Raw(x-bpp) + Prior(x))/2) */ - xor ecx, ecx -davglp1: - xor eax, eax - mov cl, [esi + ebx] /* load cl with Prior(x) */ - mov al, [edx + ebx] /* load al with Raw(x-bpp) */ - add ax, cx - inc ebx - shr ax, 1 /* divide by 2 */ - add al, [edi+ebx-1] /* Add Avg(x); -1 to offset inc ebx */ - cmp ebx, diff /* Check if at alignment boundary */ - mov [edi+ebx-1], al /* Write back Raw(x); */ - /* mov does not affect flags; -1 to offset inc ebx */ - jb davglp1 /* Repeat until at alignment boundary */ -davggo: - mov eax, FullLength - mov ecx, eax - sub eax, ebx /* subtract alignment fix */ - and eax, 0x00000007 /* calc bytes over mult of 8 */ - sub ecx, eax /* drop over bytes from original length */ - mov MMXLength, ecx - } /* end _asm block */ - /* Now do the math for the rest of the row */ - switch ( bpp ) - { - case 3: - { - ActiveMask.use = 0x0000000000ffffff; - ShiftBpp.use = 24; /* == 3 * 8 */ - ShiftRem.use = 40; /* == 64 - 24 */ - _asm { - /* Re-init address pointers and offset */ - movq mm7, ActiveMask - mov ebx, diff /* ebx ==> x = offset to alignment boundary */ - movq mm5, LBCarryMask - mov edi, row /* edi ==> Avg(x) */ - movq mm4, HBClearMask - mov esi, prev_row /* esi ==> Prior(x) */ - /* PRIME the pump (load the first Raw(x-bpp) data set */ - movq mm2, [edi + ebx - 8] /* Load previous aligned 8 bytes */ - /* (we correct position in loop below) */ -davg3lp: - movq mm0, [edi + ebx] /* Load mm0 with Avg(x) */ - /* Add (Prev_row/2) to Average */ - movq mm3, mm5 - psrlq mm2, ShiftRem /* Correct position Raw(x-bpp) data */ - movq mm1, [esi + ebx] /* Load mm1 with Prior(x) */ - movq mm6, mm7 - pand mm3, mm1 /* get lsb for each prev_row byte */ - psrlq mm1, 1 /* divide prev_row bytes by 2 */ - pand mm1, mm4 /* clear invalid bit 7 of each byte */ - paddb mm0, mm1 /* add (Prev_row/2) to Avg for each byte */ - /* Add 1st active group (Raw(x-bpp)/2) to Average with LBCarry */ - movq mm1, mm3 /* now use mm1 for getting LBCarrys */ - pand mm1, mm2 /* get LBCarrys for each byte where both */ - /* lsb's were == 1 (Only valid for active group) */ - psrlq mm2, 1 /* divide raw bytes by 2 */ - pand mm2, mm4 /* clear invalid bit 7 of each byte */ - paddb mm2, mm1 /* add LBCarrys to (Raw(x-bpp)/2) for each byte */ - pand mm2, mm6 /* Leave only Active Group 1 bytes to add to Avg */ - paddb mm0, mm2 /* add (Raw/2) + LBCarrys to Avg for each Active */ - /* byte */ - /* Add 2nd active group (Raw(x-bpp)/2) to Average with LBCarry */ - psllq mm6, ShiftBpp /* shift the mm6 mask to cover bytes 3-5 */ - movq mm2, mm0 /* mov updated Raws to mm2 */ - psllq mm2, ShiftBpp /* shift data to position correctly */ - movq mm1, mm3 /* now use mm1 for getting LBCarrys */ - pand mm1, mm2 /* get LBCarrys for each byte where both */ - /* lsb's were == 1 (Only valid for active group) */ - psrlq mm2, 1 /* divide raw bytes by 2 */ - pand mm2, mm4 /* clear invalid bit 7 of each byte */ - paddb mm2, mm1 /* add LBCarrys to (Raw(x-bpp)/2) for each byte */ - pand mm2, mm6 /* Leave only Active Group 2 bytes to add to Avg */ - paddb mm0, mm2 /* add (Raw/2) + LBCarrys to Avg for each Active */ - /* byte */ - - /* Add 3rd active group (Raw(x-bpp)/2) to Average with LBCarry */ - psllq mm6, ShiftBpp /* shift the mm6 mask to cover the last two */ - /* bytes */ - movq mm2, mm0 /* mov updated Raws to mm2 */ - psllq mm2, ShiftBpp /* shift data to position correctly */ - /* Data only needs to be shifted once here to */ - /* get the correct x-bpp offset. */ - movq mm1, mm3 /* now use mm1 for getting LBCarrys */ - pand mm1, mm2 /* get LBCarrys for each byte where both */ - /* lsb's were == 1 (Only valid for active group) */ - psrlq mm2, 1 /* divide raw bytes by 2 */ - pand mm2, mm4 /* clear invalid bit 7 of each byte */ - paddb mm2, mm1 /* add LBCarrys to (Raw(x-bpp)/2) for each byte */ - pand mm2, mm6 /* Leave only Active Group 2 bytes to add to Avg */ - add ebx, 8 - paddb mm0, mm2 /* add (Raw/2) + LBCarrys to Avg for each Active */ - /* byte */ - - /* Now ready to write back to memory */ - movq [edi + ebx - 8], mm0 - /* Move updated Raw(x) to use as Raw(x-bpp) for next loop */ - cmp ebx, MMXLength - movq mm2, mm0 /* mov updated Raw(x) to mm2 */ - jb davg3lp - } /* end _asm block */ - } - break; - - case 6: - case 4: - case 7: - case 5: - { - ActiveMask.use = 0xffffffffffffffff; /* use shift below to clear */ - /* appropriate inactive bytes */ - ShiftBpp.use = bpp << 3; - ShiftRem.use = 64 - ShiftBpp.use; - _asm { - movq mm4, HBClearMask - /* Re-init address pointers and offset */ - mov ebx, diff /* ebx ==> x = offset to alignment boundary */ - /* Load ActiveMask and clear all bytes except for 1st active group */ - movq mm7, ActiveMask - mov edi, row /* edi ==> Avg(x) */ - psrlq mm7, ShiftRem - mov esi, prev_row /* esi ==> Prior(x) */ - movq mm6, mm7 - movq mm5, LBCarryMask - psllq mm6, ShiftBpp /* Create mask for 2nd active group */ - /* PRIME the pump (load the first Raw(x-bpp) data set */ - movq mm2, [edi + ebx - 8] /* Load previous aligned 8 bytes */ - /* (we correct position in loop below) */ -davg4lp: - movq mm0, [edi + ebx] - psrlq mm2, ShiftRem /* shift data to position correctly */ - movq mm1, [esi + ebx] - /* Add (Prev_row/2) to Average */ - movq mm3, mm5 - pand mm3, mm1 /* get lsb for each prev_row byte */ - psrlq mm1, 1 /* divide prev_row bytes by 2 */ - pand mm1, mm4 /* clear invalid bit 7 of each byte */ - paddb mm0, mm1 /* add (Prev_row/2) to Avg for each byte */ - /* Add 1st active group (Raw(x-bpp)/2) to Average with LBCarry */ - movq mm1, mm3 /* now use mm1 for getting LBCarrys */ - pand mm1, mm2 /* get LBCarrys for each byte where both */ - /* lsb's were == 1 (Only valid for active group) */ - psrlq mm2, 1 /* divide raw bytes by 2 */ - pand mm2, mm4 /* clear invalid bit 7 of each byte */ - paddb mm2, mm1 /* add LBCarrys to (Raw(x-bpp)/2) for each byte */ - pand mm2, mm7 /* Leave only Active Group 1 bytes to add to Avg */ - paddb mm0, mm2 /* add (Raw/2) + LBCarrys to Avg for each Active */ - /* byte */ - /* Add 2nd active group (Raw(x-bpp)/2) to Average with LBCarry */ - movq mm2, mm0 /* mov updated Raws to mm2 */ - psllq mm2, ShiftBpp /* shift data to position correctly */ - add ebx, 8 - movq mm1, mm3 /* now use mm1 for getting LBCarrys */ - pand mm1, mm2 /* get LBCarrys for each byte where both */ - /* lsb's were == 1 (Only valid for active group) */ - psrlq mm2, 1 /* divide raw bytes by 2 */ - pand mm2, mm4 /* clear invalid bit 7 of each byte */ - paddb mm2, mm1 /* add LBCarrys to (Raw(x-bpp)/2) for each byte */ - pand mm2, mm6 /* Leave only Active Group 2 bytes to add to Avg */ - paddb mm0, mm2 /* add (Raw/2) + LBCarrys to Avg for each Active */ - /* byte */ - cmp ebx, MMXLength - /* Now ready to write back to memory */ - movq [edi + ebx - 8], mm0 - /* Prep Raw(x-bpp) for next loop */ - movq mm2, mm0 /* mov updated Raws to mm2 */ - jb davg4lp - } /* end _asm block */ - } - break; - case 2: - { - ActiveMask.use = 0x000000000000ffff; - ShiftBpp.use = 16; /* == 2 * 8 [BUGFIX] */ - ShiftRem.use = 48; /* == 64 - 16 [BUGFIX] */ - _asm { - /* Load ActiveMask */ - movq mm7, ActiveMask - /* Re-init address pointers and offset */ - mov ebx, diff /* ebx ==> x = offset to alignment boundary */ - movq mm5, LBCarryMask - mov edi, row /* edi ==> Avg(x) */ - movq mm4, HBClearMask - mov esi, prev_row /* esi ==> Prior(x) */ - /* PRIME the pump (load the first Raw(x-bpp) data set */ - movq mm2, [edi + ebx - 8] /* Load previous aligned 8 bytes */ - /* (we correct position in loop below) */ -davg2lp: - movq mm0, [edi + ebx] - psrlq mm2, ShiftRem /* shift data to position correctly [BUGFIX] */ - movq mm1, [esi + ebx] - /* Add (Prev_row/2) to Average */ - movq mm3, mm5 - pand mm3, mm1 /* get lsb for each prev_row byte */ - psrlq mm1, 1 /* divide prev_row bytes by 2 */ - pand mm1, mm4 /* clear invalid bit 7 of each byte */ - movq mm6, mm7 - paddb mm0, mm1 /* add (Prev_row/2) to Avg for each byte */ - /* Add 1st active group (Raw(x-bpp)/2) to Average with LBCarry */ - movq mm1, mm3 /* now use mm1 for getting LBCarrys */ - pand mm1, mm2 /* get LBCarrys for each byte where both */ - /* lsb's were == 1 (Only valid for active group) */ - psrlq mm2, 1 /* divide raw bytes by 2 */ - pand mm2, mm4 /* clear invalid bit 7 of each byte */ - paddb mm2, mm1 /* add LBCarrys to (Raw(x-bpp)/2) for each byte */ - pand mm2, mm6 /* Leave only Active Group 1 bytes to add to Avg */ - paddb mm0, mm2 /* add (Raw/2) + LBCarrys to Avg for each Active byte */ - /* Add 2nd active group (Raw(x-bpp)/2) to Average with LBCarry */ - psllq mm6, ShiftBpp /* shift the mm6 mask to cover bytes 2 & 3 */ - movq mm2, mm0 /* mov updated Raws to mm2 */ - psllq mm2, ShiftBpp /* shift data to position correctly */ - movq mm1, mm3 /* now use mm1 for getting LBCarrys */ - pand mm1, mm2 /* get LBCarrys for each byte where both */ - /* lsb's were == 1 (Only valid for active group) */ - psrlq mm2, 1 /* divide raw bytes by 2 */ - pand mm2, mm4 /* clear invalid bit 7 of each byte */ - paddb mm2, mm1 /* add LBCarrys to (Raw(x-bpp)/2) for each byte */ - pand mm2, mm6 /* Leave only Active Group 2 bytes to add to Avg */ - paddb mm0, mm2 /* add (Raw/2) + LBCarrys to Avg for each Active byte */ - - /* Add rdd active group (Raw(x-bpp)/2) to Average with LBCarry */ - psllq mm6, ShiftBpp /* shift the mm6 mask to cover bytes 4 & 5 */ - movq mm2, mm0 /* mov updated Raws to mm2 */ - psllq mm2, ShiftBpp /* shift data to position correctly */ - /* Data only needs to be shifted once here to */ - /* get the correct x-bpp offset. */ - movq mm1, mm3 /* now use mm1 for getting LBCarrys */ - pand mm1, mm2 /* get LBCarrys for each byte where both */ - /* lsb's were == 1 (Only valid for active group) */ - psrlq mm2, 1 /* divide raw bytes by 2 */ - pand mm2, mm4 /* clear invalid bit 7 of each byte */ - paddb mm2, mm1 /* add LBCarrys to (Raw(x-bpp)/2) for each byte */ - pand mm2, mm6 /* Leave only Active Group 2 bytes to add to Avg */ - paddb mm0, mm2 /* add (Raw/2) + LBCarrys to Avg for each Active byte */ - - /* Add 4th active group (Raw(x-bpp)/2) to Average with LBCarry */ - psllq mm6, ShiftBpp /* shift the mm6 mask to cover bytes 6 & 7 */ - movq mm2, mm0 /* mov updated Raws to mm2 */ - psllq mm2, ShiftBpp /* shift data to position correctly */ - /* Data only needs to be shifted once here to */ - /* get the correct x-bpp offset. */ - add ebx, 8 - movq mm1, mm3 /* now use mm1 for getting LBCarrys */ - pand mm1, mm2 /* get LBCarrys for each byte where both */ - /* lsb's were == 1 (Only valid for active group) */ - psrlq mm2, 1 /* divide raw bytes by 2 */ - pand mm2, mm4 /* clear invalid bit 7 of each byte */ - paddb mm2, mm1 /* add LBCarrys to (Raw(x-bpp)/2) for each byte */ - pand mm2, mm6 /* Leave only Active Group 2 bytes to add to Avg */ - paddb mm0, mm2 /* add (Raw/2) + LBCarrys to Avg for each Active byte */ - - cmp ebx, MMXLength - /* Now ready to write back to memory */ - movq [edi + ebx - 8], mm0 - /* Prep Raw(x-bpp) for next loop */ - movq mm2, mm0 /* mov updated Raws to mm2 */ - jb davg2lp - } /* end _asm block */ - } - break; - - case 1: /* bpp == 1 */ - { - _asm { - /* Re-init address pointers and offset */ - mov ebx, diff /* ebx ==> x = offset to alignment boundary */ - mov edi, row /* edi ==> Avg(x) */ - cmp ebx, FullLength /* Test if offset at end of array */ - jnb davg1end - /* Do Paeth decode for remaining bytes */ - mov esi, prev_row /* esi ==> Prior(x) */ - mov edx, edi - xor ecx, ecx /* zero ecx before using cl & cx in loop below */ - sub edx, bpp /* edx ==> Raw(x-bpp) */ -davg1lp: - /* Raw(x) = Avg(x) + ((Raw(x-bpp) + Prior(x))/2) */ - xor eax, eax - mov cl, [esi + ebx] /* load cl with Prior(x) */ - mov al, [edx + ebx] /* load al with Raw(x-bpp) */ - add ax, cx - inc ebx - shr ax, 1 /* divide by 2 */ - add al, [edi+ebx-1] /* Add Avg(x); -1 to offset inc ebx */ - cmp ebx, FullLength /* Check if at end of array */ - mov [edi+ebx-1], al /* Write back Raw(x); */ - /* mov does not affect flags; -1 to offset inc ebx */ - jb davg1lp -davg1end: - } /* end _asm block */ - } - return; - - case 8: /* bpp == 8 */ - { - _asm { - /* Re-init address pointers and offset */ - mov ebx, diff /* ebx ==> x = offset to alignment boundary */ - movq mm5, LBCarryMask - mov edi, row /* edi ==> Avg(x) */ - movq mm4, HBClearMask - mov esi, prev_row /* esi ==> Prior(x) */ - /* PRIME the pump (load the first Raw(x-bpp) data set */ - movq mm2, [edi + ebx - 8] /* Load previous aligned 8 bytes */ - /* (NO NEED to correct position in loop below) */ -davg8lp: - movq mm0, [edi + ebx] - movq mm3, mm5 - movq mm1, [esi + ebx] - add ebx, 8 - pand mm3, mm1 /* get lsb for each prev_row byte */ - psrlq mm1, 1 /* divide prev_row bytes by 2 */ - pand mm3, mm2 /* get LBCarrys for each byte where both */ - /* lsb's were == 1 */ - psrlq mm2, 1 /* divide raw bytes by 2 */ - pand mm1, mm4 /* clear invalid bit 7 of each byte */ - paddb mm0, mm3 /* add LBCarrys to Avg for each byte */ - pand mm2, mm4 /* clear invalid bit 7 of each byte */ - paddb mm0, mm1 /* add (Prev_row/2) to Avg for each byte */ - paddb mm0, mm2 /* add (Raw/2) to Avg for each byte */ - cmp ebx, MMXLength - movq [edi + ebx - 8], mm0 - movq mm2, mm0 /* reuse as Raw(x-bpp) */ - jb davg8lp - } /* end _asm block */ - } - break; - default: /* bpp greater than 8 */ - { - _asm { - movq mm5, LBCarryMask - /* Re-init address pointers and offset */ - mov ebx, diff /* ebx ==> x = offset to alignment boundary */ - mov edi, row /* edi ==> Avg(x) */ - movq mm4, HBClearMask - mov edx, edi - mov esi, prev_row /* esi ==> Prior(x) */ - sub edx, bpp /* edx ==> Raw(x-bpp) */ -davgAlp: - movq mm0, [edi + ebx] - movq mm3, mm5 - movq mm1, [esi + ebx] - pand mm3, mm1 /* get lsb for each prev_row byte */ - movq mm2, [edx + ebx] - psrlq mm1, 1 /* divide prev_row bytes by 2 */ - pand mm3, mm2 /* get LBCarrys for each byte where both */ - /* lsb's were == 1 */ - psrlq mm2, 1 /* divide raw bytes by 2 */ - pand mm1, mm4 /* clear invalid bit 7 of each byte */ - paddb mm0, mm3 /* add LBCarrys to Avg for each byte */ - pand mm2, mm4 /* clear invalid bit 7 of each byte */ - paddb mm0, mm1 /* add (Prev_row/2) to Avg for each byte */ - add ebx, 8 - paddb mm0, mm2 /* add (Raw/2) to Avg for each byte */ - cmp ebx, MMXLength - movq [edi + ebx - 8], mm0 - jb davgAlp - } /* end _asm block */ - } - break; - } /* end switch ( bpp ) */ - - _asm { - /* MMX acceleration complete now do clean-up */ - /* Check if any remaining bytes left to decode */ - mov ebx, MMXLength /* ebx ==> x = offset bytes remaining after MMX */ - mov edi, row /* edi ==> Avg(x) */ - cmp ebx, FullLength /* Test if offset at end of array */ - jnb davgend - /* Do Paeth decode for remaining bytes */ - mov esi, prev_row /* esi ==> Prior(x) */ - mov edx, edi - xor ecx, ecx /* zero ecx before using cl & cx in loop below */ - sub edx, bpp /* edx ==> Raw(x-bpp) */ -davglp2: - /* Raw(x) = Avg(x) + ((Raw(x-bpp) + Prior(x))/2) */ - xor eax, eax - mov cl, [esi + ebx] /* load cl with Prior(x) */ - mov al, [edx + ebx] /* load al with Raw(x-bpp) */ - add ax, cx - inc ebx - shr ax, 1 /* divide by 2 */ - add al, [edi+ebx-1] /* Add Avg(x); -1 to offset inc ebx */ - cmp ebx, FullLength /* Check if at end of array */ - mov [edi+ebx-1], al /* Write back Raw(x); */ - /* mov does not affect flags; -1 to offset inc ebx */ - jb davglp2 -davgend: - emms /* End MMX instructions; prep for possible FP instrs. */ - } /* end _asm block */ -} - -/* Optimized code for PNG Paeth filter decoder */ -void /* PRIVATE */ -png_read_filter_row_mmx_paeth(png_row_infop row_info, png_bytep row, - png_bytep prev_row) -{ - png_uint_32 FullLength; - png_uint_32 MMXLength; - /*png_uint_32 len; */ - int bpp; - int diff; - /*int ptemp; */ - int patemp, pbtemp, pctemp; - - bpp = (row_info->pixel_depth + 7) >> 3; /* Get # bytes per pixel */ - FullLength = row_info->rowbytes; /* # of bytes to filter */ - _asm - { - xor ebx, ebx /* ebx ==> x offset */ - mov edi, row - xor edx, edx /* edx ==> x-bpp offset */ - mov esi, prev_row - xor eax, eax - - /* Compute the Raw value for the first bpp bytes */ - /* Note: the formula works out to be always */ - /* Paeth(x) = Raw(x) + Prior(x) where x < bpp */ -dpthrlp: - mov al, [edi + ebx] - add al, [esi + ebx] - inc ebx - cmp ebx, bpp - mov [edi + ebx - 1], al - jb dpthrlp - /* get # of bytes to alignment */ - mov diff, edi /* take start of row */ - add diff, ebx /* add bpp */ - xor ecx, ecx - add diff, 0xf /* add 7 + 8 to incr past alignment boundary */ - and diff, 0xfffffff8 /* mask to alignment boundary */ - sub diff, edi /* subtract from start ==> value ebx at alignment */ - jz dpthgo - /* fix alignment */ -dpthlp1: - xor eax, eax - /* pav = p - a = (a + b - c) - a = b - c */ - mov al, [esi + ebx] /* load Prior(x) into al */ - mov cl, [esi + edx] /* load Prior(x-bpp) into cl */ - sub eax, ecx /* subtract Prior(x-bpp) */ - mov patemp, eax /* Save pav for later use */ - xor eax, eax - /* pbv = p - b = (a + b - c) - b = a - c */ - mov al, [edi + edx] /* load Raw(x-bpp) into al */ - sub eax, ecx /* subtract Prior(x-bpp) */ - mov ecx, eax - /* pcv = p - c = (a + b - c) -c = (a - c) + (b - c) = pav + pbv */ - add eax, patemp /* pcv = pav + pbv */ - /* pc = abs(pcv) */ - test eax, 0x80000000 - jz dpthpca - neg eax /* reverse sign of neg values */ -dpthpca: - mov pctemp, eax /* save pc for later use */ - /* pb = abs(pbv) */ - test ecx, 0x80000000 - jz dpthpba - neg ecx /* reverse sign of neg values */ -dpthpba: - mov pbtemp, ecx /* save pb for later use */ - /* pa = abs(pav) */ - mov eax, patemp - test eax, 0x80000000 - jz dpthpaa - neg eax /* reverse sign of neg values */ -dpthpaa: - mov patemp, eax /* save pa for later use */ - /* test if pa <= pb */ - cmp eax, ecx - jna dpthabb - /* pa > pb; now test if pb <= pc */ - cmp ecx, pctemp - jna dpthbbc - /* pb > pc; Raw(x) = Paeth(x) + Prior(x-bpp) */ - mov cl, [esi + edx] /* load Prior(x-bpp) into cl */ - jmp dpthpaeth -dpthbbc: - /* pb <= pc; Raw(x) = Paeth(x) + Prior(x) */ - mov cl, [esi + ebx] /* load Prior(x) into cl */ - jmp dpthpaeth -dpthabb: - /* pa <= pb; now test if pa <= pc */ - cmp eax, pctemp - jna dpthabc - /* pa > pc; Raw(x) = Paeth(x) + Prior(x-bpp) */ - mov cl, [esi + edx] /* load Prior(x-bpp) into cl */ - jmp dpthpaeth -dpthabc: - /* pa <= pc; Raw(x) = Paeth(x) + Raw(x-bpp) */ - mov cl, [edi + edx] /* load Raw(x-bpp) into cl */ -dpthpaeth: - inc ebx - inc edx - /* Raw(x) = (Paeth(x) + Paeth_Predictor( a, b, c )) mod 256 */ - add [edi + ebx - 1], cl - cmp ebx, diff - jb dpthlp1 -dpthgo: - mov ecx, FullLength - mov eax, ecx - sub eax, ebx /* subtract alignment fix */ - and eax, 0x00000007 /* calc bytes over mult of 8 */ - sub ecx, eax /* drop over bytes from original length */ - mov MMXLength, ecx - } /* end _asm block */ - /* Now do the math for the rest of the row */ - switch ( bpp ) - { - case 3: - { - ActiveMask.use = 0x0000000000ffffff; - ActiveMaskEnd.use = 0xffff000000000000; - ShiftBpp.use = 24; /* == bpp(3) * 8 */ - ShiftRem.use = 40; /* == 64 - 24 */ - _asm - { - mov ebx, diff - mov edi, row - mov esi, prev_row - pxor mm0, mm0 - /* PRIME the pump (load the first Raw(x-bpp) data set */ - movq mm1, [edi+ebx-8] -dpth3lp: - psrlq mm1, ShiftRem /* shift last 3 bytes to 1st 3 bytes */ - movq mm2, [esi + ebx] /* load b=Prior(x) */ - punpcklbw mm1, mm0 /* Unpack High bytes of a */ - movq mm3, [esi+ebx-8] /* Prep c=Prior(x-bpp) bytes */ - punpcklbw mm2, mm0 /* Unpack High bytes of b */ - psrlq mm3, ShiftRem /* shift last 3 bytes to 1st 3 bytes */ - /* pav = p - a = (a + b - c) - a = b - c */ - movq mm4, mm2 - punpcklbw mm3, mm0 /* Unpack High bytes of c */ - /* pbv = p - b = (a + b - c) - b = a - c */ - movq mm5, mm1 - psubw mm4, mm3 - pxor mm7, mm7 - /* pcv = p - c = (a + b - c) -c = (a - c) + (b - c) = pav + pbv */ - movq mm6, mm4 - psubw mm5, mm3 - - /* pa = abs(p-a) = abs(pav) */ - /* pb = abs(p-b) = abs(pbv) */ - /* pc = abs(p-c) = abs(pcv) */ - pcmpgtw mm0, mm4 /* Create mask pav bytes < 0 */ - paddw mm6, mm5 - pand mm0, mm4 /* Only pav bytes < 0 in mm7 */ - pcmpgtw mm7, mm5 /* Create mask pbv bytes < 0 */ - psubw mm4, mm0 - pand mm7, mm5 /* Only pbv bytes < 0 in mm0 */ - psubw mm4, mm0 - psubw mm5, mm7 - pxor mm0, mm0 - pcmpgtw mm0, mm6 /* Create mask pcv bytes < 0 */ - pand mm0, mm6 /* Only pav bytes < 0 in mm7 */ - psubw mm5, mm7 - psubw mm6, mm0 - /* test pa <= pb */ - movq mm7, mm4 - psubw mm6, mm0 - pcmpgtw mm7, mm5 /* pa > pb? */ - movq mm0, mm7 - /* use mm7 mask to merge pa & pb */ - pand mm5, mm7 - /* use mm0 mask copy to merge a & b */ - pand mm2, mm0 - pandn mm7, mm4 - pandn mm0, mm1 - paddw mm7, mm5 - paddw mm0, mm2 - /* test ((pa <= pb)? pa:pb) <= pc */ - pcmpgtw mm7, mm6 /* pab > pc? */ - pxor mm1, mm1 - pand mm3, mm7 - pandn mm7, mm0 - paddw mm7, mm3 - pxor mm0, mm0 - packuswb mm7, mm1 - movq mm3, [esi + ebx] /* load c=Prior(x-bpp) */ - pand mm7, ActiveMask - movq mm2, mm3 /* load b=Prior(x) step 1 */ - paddb mm7, [edi + ebx] /* add Paeth predictor with Raw(x) */ - punpcklbw mm3, mm0 /* Unpack High bytes of c */ - movq [edi + ebx], mm7 /* write back updated value */ - movq mm1, mm7 /* Now mm1 will be used as Raw(x-bpp) */ - /* Now do Paeth for 2nd set of bytes (3-5) */ - psrlq mm2, ShiftBpp /* load b=Prior(x) step 2 */ - punpcklbw mm1, mm0 /* Unpack High bytes of a */ - pxor mm7, mm7 - punpcklbw mm2, mm0 /* Unpack High bytes of b */ - /* pbv = p - b = (a + b - c) - b = a - c */ - movq mm5, mm1 - /* pav = p - a = (a + b - c) - a = b - c */ - movq mm4, mm2 - psubw mm5, mm3 - psubw mm4, mm3 - /* pcv = p - c = (a + b - c) -c = (a - c) + (b - c) = */ - /* pav + pbv = pbv + pav */ - movq mm6, mm5 - paddw mm6, mm4 - - /* pa = abs(p-a) = abs(pav) */ - /* pb = abs(p-b) = abs(pbv) */ - /* pc = abs(p-c) = abs(pcv) */ - pcmpgtw mm0, mm5 /* Create mask pbv bytes < 0 */ - pcmpgtw mm7, mm4 /* Create mask pav bytes < 0 */ - pand mm0, mm5 /* Only pbv bytes < 0 in mm0 */ - pand mm7, mm4 /* Only pav bytes < 0 in mm7 */ - psubw mm5, mm0 - psubw mm4, mm7 - psubw mm5, mm0 - psubw mm4, mm7 - pxor mm0, mm0 - pcmpgtw mm0, mm6 /* Create mask pcv bytes < 0 */ - pand mm0, mm6 /* Only pav bytes < 0 in mm7 */ - psubw mm6, mm0 - /* test pa <= pb */ - movq mm7, mm4 - psubw mm6, mm0 - pcmpgtw mm7, mm5 /* pa > pb? */ - movq mm0, mm7 - /* use mm7 mask to merge pa & pb */ - pand mm5, mm7 - /* use mm0 mask copy to merge a & b */ - pand mm2, mm0 - pandn mm7, mm4 - pandn mm0, mm1 - paddw mm7, mm5 - paddw mm0, mm2 - /* test ((pa <= pb)? pa:pb) <= pc */ - pcmpgtw mm7, mm6 /* pab > pc? */ - movq mm2, [esi + ebx] /* load b=Prior(x) */ - pand mm3, mm7 - pandn mm7, mm0 - pxor mm1, mm1 - paddw mm7, mm3 - pxor mm0, mm0 - packuswb mm7, mm1 - movq mm3, mm2 /* load c=Prior(x-bpp) step 1 */ - pand mm7, ActiveMask - punpckhbw mm2, mm0 /* Unpack High bytes of b */ - psllq mm7, ShiftBpp /* Shift bytes to 2nd group of 3 bytes */ - /* pav = p - a = (a + b - c) - a = b - c */ - movq mm4, mm2 - paddb mm7, [edi + ebx] /* add Paeth predictor with Raw(x) */ - psllq mm3, ShiftBpp /* load c=Prior(x-bpp) step 2 */ - movq [edi + ebx], mm7 /* write back updated value */ - movq mm1, mm7 - punpckhbw mm3, mm0 /* Unpack High bytes of c */ - psllq mm1, ShiftBpp /* Shift bytes */ - /* Now mm1 will be used as Raw(x-bpp) */ - /* Now do Paeth for 3rd, and final, set of bytes (6-7) */ - pxor mm7, mm7 - punpckhbw mm1, mm0 /* Unpack High bytes of a */ - psubw mm4, mm3 - /* pbv = p - b = (a + b - c) - b = a - c */ - movq mm5, mm1 - /* pcv = p - c = (a + b - c) -c = (a - c) + (b - c) = pav + pbv */ - movq mm6, mm4 - psubw mm5, mm3 - pxor mm0, mm0 - paddw mm6, mm5 - - /* pa = abs(p-a) = abs(pav) */ - /* pb = abs(p-b) = abs(pbv) */ - /* pc = abs(p-c) = abs(pcv) */ - pcmpgtw mm0, mm4 /* Create mask pav bytes < 0 */ - pcmpgtw mm7, mm5 /* Create mask pbv bytes < 0 */ - pand mm0, mm4 /* Only pav bytes < 0 in mm7 */ - pand mm7, mm5 /* Only pbv bytes < 0 in mm0 */ - psubw mm4, mm0 - psubw mm5, mm7 - psubw mm4, mm0 - psubw mm5, mm7 - pxor mm0, mm0 - pcmpgtw mm0, mm6 /* Create mask pcv bytes < 0 */ - pand mm0, mm6 /* Only pav bytes < 0 in mm7 */ - psubw mm6, mm0 - /* test pa <= pb */ - movq mm7, mm4 - psubw mm6, mm0 - pcmpgtw mm7, mm5 /* pa > pb? */ - movq mm0, mm7 - /* use mm0 mask copy to merge a & b */ - pand mm2, mm0 - /* use mm7 mask to merge pa & pb */ - pand mm5, mm7 - pandn mm0, mm1 - pandn mm7, mm4 - paddw mm0, mm2 - paddw mm7, mm5 - /* test ((pa <= pb)? pa:pb) <= pc */ - pcmpgtw mm7, mm6 /* pab > pc? */ - pand mm3, mm7 - pandn mm7, mm0 - paddw mm7, mm3 - pxor mm1, mm1 - packuswb mm1, mm7 - /* Step ebx to next set of 8 bytes and repeat loop til done */ - add ebx, 8 - pand mm1, ActiveMaskEnd - paddb mm1, [edi + ebx - 8] /* add Paeth predictor with Raw(x) */ - - cmp ebx, MMXLength - pxor mm0, mm0 /* pxor does not affect flags */ - movq [edi + ebx - 8], mm1 /* write back updated value */ - /* mm1 will be used as Raw(x-bpp) next loop */ - /* mm3 ready to be used as Prior(x-bpp) next loop */ - jb dpth3lp - } /* end _asm block */ - } - break; - - case 6: - case 7: - case 5: - { - ActiveMask.use = 0x00000000ffffffff; - ActiveMask2.use = 0xffffffff00000000; - ShiftBpp.use = bpp << 3; /* == bpp * 8 */ - ShiftRem.use = 64 - ShiftBpp.use; - _asm - { - mov ebx, diff - mov edi, row - mov esi, prev_row - /* PRIME the pump (load the first Raw(x-bpp) data set */ - movq mm1, [edi+ebx-8] - pxor mm0, mm0 -dpth6lp: - /* Must shift to position Raw(x-bpp) data */ - psrlq mm1, ShiftRem - /* Do first set of 4 bytes */ - movq mm3, [esi+ebx-8] /* read c=Prior(x-bpp) bytes */ - punpcklbw mm1, mm0 /* Unpack Low bytes of a */ - movq mm2, [esi + ebx] /* load b=Prior(x) */ - punpcklbw mm2, mm0 /* Unpack Low bytes of b */ - /* Must shift to position Prior(x-bpp) data */ - psrlq mm3, ShiftRem - /* pav = p - a = (a + b - c) - a = b - c */ - movq mm4, mm2 - punpcklbw mm3, mm0 /* Unpack Low bytes of c */ - /* pbv = p - b = (a + b - c) - b = a - c */ - movq mm5, mm1 - psubw mm4, mm3 - pxor mm7, mm7 - /* pcv = p - c = (a + b - c) -c = (a - c) + (b - c) = pav + pbv */ - movq mm6, mm4 - psubw mm5, mm3 - /* pa = abs(p-a) = abs(pav) */ - /* pb = abs(p-b) = abs(pbv) */ - /* pc = abs(p-c) = abs(pcv) */ - pcmpgtw mm0, mm4 /* Create mask pav bytes < 0 */ - paddw mm6, mm5 - pand mm0, mm4 /* Only pav bytes < 0 in mm7 */ - pcmpgtw mm7, mm5 /* Create mask pbv bytes < 0 */ - psubw mm4, mm0 - pand mm7, mm5 /* Only pbv bytes < 0 in mm0 */ - psubw mm4, mm0 - psubw mm5, mm7 - pxor mm0, mm0 - pcmpgtw mm0, mm6 /* Create mask pcv bytes < 0 */ - pand mm0, mm6 /* Only pav bytes < 0 in mm7 */ - psubw mm5, mm7 - psubw mm6, mm0 - /* test pa <= pb */ - movq mm7, mm4 - psubw mm6, mm0 - pcmpgtw mm7, mm5 /* pa > pb? */ - movq mm0, mm7 - /* use mm7 mask to merge pa & pb */ - pand mm5, mm7 - /* use mm0 mask copy to merge a & b */ - pand mm2, mm0 - pandn mm7, mm4 - pandn mm0, mm1 - paddw mm7, mm5 - paddw mm0, mm2 - /* test ((pa <= pb)? pa:pb) <= pc */ - pcmpgtw mm7, mm6 /* pab > pc? */ - pxor mm1, mm1 - pand mm3, mm7 - pandn mm7, mm0 - paddw mm7, mm3 - pxor mm0, mm0 - packuswb mm7, mm1 - movq mm3, [esi + ebx - 8] /* load c=Prior(x-bpp) */ - pand mm7, ActiveMask - psrlq mm3, ShiftRem - movq mm2, [esi + ebx] /* load b=Prior(x) step 1 */ - paddb mm7, [edi + ebx] /* add Paeth predictor with Raw(x) */ - movq mm6, mm2 - movq [edi + ebx], mm7 /* write back updated value */ - movq mm1, [edi+ebx-8] - psllq mm6, ShiftBpp - movq mm5, mm7 - psrlq mm1, ShiftRem - por mm3, mm6 - psllq mm5, ShiftBpp - punpckhbw mm3, mm0 /* Unpack High bytes of c */ - por mm1, mm5 - /* Do second set of 4 bytes */ - punpckhbw mm2, mm0 /* Unpack High bytes of b */ - punpckhbw mm1, mm0 /* Unpack High bytes of a */ - /* pav = p - a = (a + b - c) - a = b - c */ - movq mm4, mm2 - /* pbv = p - b = (a + b - c) - b = a - c */ - movq mm5, mm1 - psubw mm4, mm3 - pxor mm7, mm7 - /* pcv = p - c = (a + b - c) -c = (a - c) + (b - c) = pav + pbv */ - movq mm6, mm4 - psubw mm5, mm3 - /* pa = abs(p-a) = abs(pav) */ - /* pb = abs(p-b) = abs(pbv) */ - /* pc = abs(p-c) = abs(pcv) */ - pcmpgtw mm0, mm4 /* Create mask pav bytes < 0 */ - paddw mm6, mm5 - pand mm0, mm4 /* Only pav bytes < 0 in mm7 */ - pcmpgtw mm7, mm5 /* Create mask pbv bytes < 0 */ - psubw mm4, mm0 - pand mm7, mm5 /* Only pbv bytes < 0 in mm0 */ - psubw mm4, mm0 - psubw mm5, mm7 - pxor mm0, mm0 - pcmpgtw mm0, mm6 /* Create mask pcv bytes < 0 */ - pand mm0, mm6 /* Only pav bytes < 0 in mm7 */ - psubw mm5, mm7 - psubw mm6, mm0 - /* test pa <= pb */ - movq mm7, mm4 - psubw mm6, mm0 - pcmpgtw mm7, mm5 /* pa > pb? */ - movq mm0, mm7 - /* use mm7 mask to merge pa & pb */ - pand mm5, mm7 - /* use mm0 mask copy to merge a & b */ - pand mm2, mm0 - pandn mm7, mm4 - pandn mm0, mm1 - paddw mm7, mm5 - paddw mm0, mm2 - /* test ((pa <= pb)? pa:pb) <= pc */ - pcmpgtw mm7, mm6 /* pab > pc? */ - pxor mm1, mm1 - pand mm3, mm7 - pandn mm7, mm0 - pxor mm1, mm1 - paddw mm7, mm3 - pxor mm0, mm0 - /* Step ex to next set of 8 bytes and repeat loop til done */ - add ebx, 8 - packuswb mm1, mm7 - paddb mm1, [edi + ebx - 8] /* add Paeth predictor with Raw(x) */ - cmp ebx, MMXLength - movq [edi + ebx - 8], mm1 /* write back updated value */ - /* mm1 will be used as Raw(x-bpp) next loop */ - jb dpth6lp - } /* end _asm block */ - } - break; - - case 4: - { - ActiveMask.use = 0x00000000ffffffff; - _asm { - mov ebx, diff - mov edi, row - mov esi, prev_row - pxor mm0, mm0 - /* PRIME the pump (load the first Raw(x-bpp) data set */ - movq mm1, [edi+ebx-8] /* Only time should need to read */ - /* a=Raw(x-bpp) bytes */ -dpth4lp: - /* Do first set of 4 bytes */ - movq mm3, [esi+ebx-8] /* read c=Prior(x-bpp) bytes */ - punpckhbw mm1, mm0 /* Unpack Low bytes of a */ - movq mm2, [esi + ebx] /* load b=Prior(x) */ - punpcklbw mm2, mm0 /* Unpack High bytes of b */ - /* pav = p - a = (a + b - c) - a = b - c */ - movq mm4, mm2 - punpckhbw mm3, mm0 /* Unpack High bytes of c */ - /* pbv = p - b = (a + b - c) - b = a - c */ - movq mm5, mm1 - psubw mm4, mm3 - pxor mm7, mm7 - /* pcv = p - c = (a + b - c) -c = (a - c) + (b - c) = pav + pbv */ - movq mm6, mm4 - psubw mm5, mm3 - /* pa = abs(p-a) = abs(pav) */ - /* pb = abs(p-b) = abs(pbv) */ - /* pc = abs(p-c) = abs(pcv) */ - pcmpgtw mm0, mm4 /* Create mask pav bytes < 0 */ - paddw mm6, mm5 - pand mm0, mm4 /* Only pav bytes < 0 in mm7 */ - pcmpgtw mm7, mm5 /* Create mask pbv bytes < 0 */ - psubw mm4, mm0 - pand mm7, mm5 /* Only pbv bytes < 0 in mm0 */ - psubw mm4, mm0 - psubw mm5, mm7 - pxor mm0, mm0 - pcmpgtw mm0, mm6 /* Create mask pcv bytes < 0 */ - pand mm0, mm6 /* Only pav bytes < 0 in mm7 */ - psubw mm5, mm7 - psubw mm6, mm0 - /* test pa <= pb */ - movq mm7, mm4 - psubw mm6, mm0 - pcmpgtw mm7, mm5 /* pa > pb? */ - movq mm0, mm7 - /* use mm7 mask to merge pa & pb */ - pand mm5, mm7 - /* use mm0 mask copy to merge a & b */ - pand mm2, mm0 - pandn mm7, mm4 - pandn mm0, mm1 - paddw mm7, mm5 - paddw mm0, mm2 - /* test ((pa <= pb)? pa:pb) <= pc */ - pcmpgtw mm7, mm6 /* pab > pc? */ - pxor mm1, mm1 - pand mm3, mm7 - pandn mm7, mm0 - paddw mm7, mm3 - pxor mm0, mm0 - packuswb mm7, mm1 - movq mm3, [esi + ebx] /* load c=Prior(x-bpp) */ - pand mm7, ActiveMask - movq mm2, mm3 /* load b=Prior(x) step 1 */ - paddb mm7, [edi + ebx] /* add Paeth predictor with Raw(x) */ - punpcklbw mm3, mm0 /* Unpack High bytes of c */ - movq [edi + ebx], mm7 /* write back updated value */ - movq mm1, mm7 /* Now mm1 will be used as Raw(x-bpp) */ - /* Do second set of 4 bytes */ - punpckhbw mm2, mm0 /* Unpack Low bytes of b */ - punpcklbw mm1, mm0 /* Unpack Low bytes of a */ - /* pav = p - a = (a + b - c) - a = b - c */ - movq mm4, mm2 - /* pbv = p - b = (a + b - c) - b = a - c */ - movq mm5, mm1 - psubw mm4, mm3 - pxor mm7, mm7 - /* pcv = p - c = (a + b - c) -c = (a - c) + (b - c) = pav + pbv */ - movq mm6, mm4 - psubw mm5, mm3 - /* pa = abs(p-a) = abs(pav) */ - /* pb = abs(p-b) = abs(pbv) */ - /* pc = abs(p-c) = abs(pcv) */ - pcmpgtw mm0, mm4 /* Create mask pav bytes < 0 */ - paddw mm6, mm5 - pand mm0, mm4 /* Only pav bytes < 0 in mm7 */ - pcmpgtw mm7, mm5 /* Create mask pbv bytes < 0 */ - psubw mm4, mm0 - pand mm7, mm5 /* Only pbv bytes < 0 in mm0 */ - psubw mm4, mm0 - psubw mm5, mm7 - pxor mm0, mm0 - pcmpgtw mm0, mm6 /* Create mask pcv bytes < 0 */ - pand mm0, mm6 /* Only pav bytes < 0 in mm7 */ - psubw mm5, mm7 - psubw mm6, mm0 - /* test pa <= pb */ - movq mm7, mm4 - psubw mm6, mm0 - pcmpgtw mm7, mm5 /* pa > pb? */ - movq mm0, mm7 - /* use mm7 mask to merge pa & pb */ - pand mm5, mm7 - /* use mm0 mask copy to merge a & b */ - pand mm2, mm0 - pandn mm7, mm4 - pandn mm0, mm1 - paddw mm7, mm5 - paddw mm0, mm2 - /* test ((pa <= pb)? pa:pb) <= pc */ - pcmpgtw mm7, mm6 /* pab > pc? */ - pxor mm1, mm1 - pand mm3, mm7 - pandn mm7, mm0 - pxor mm1, mm1 - paddw mm7, mm3 - pxor mm0, mm0 - /* Step ex to next set of 8 bytes and repeat loop til done */ - add ebx, 8 - packuswb mm1, mm7 - paddb mm1, [edi + ebx - 8] /* add Paeth predictor with Raw(x) */ - cmp ebx, MMXLength - movq [edi + ebx - 8], mm1 /* write back updated value */ - /* mm1 will be used as Raw(x-bpp) next loop */ - jb dpth4lp - } /* end _asm block */ - } - break; - case 8: /* bpp == 8 */ - { - ActiveMask.use = 0x00000000ffffffff; - _asm { - mov ebx, diff - mov edi, row - mov esi, prev_row - pxor mm0, mm0 - /* PRIME the pump (load the first Raw(x-bpp) data set */ - movq mm1, [edi+ebx-8] /* Only time should need to read */ - /* a=Raw(x-bpp) bytes */ -dpth8lp: - /* Do first set of 4 bytes */ - movq mm3, [esi+ebx-8] /* read c=Prior(x-bpp) bytes */ - punpcklbw mm1, mm0 /* Unpack Low bytes of a */ - movq mm2, [esi + ebx] /* load b=Prior(x) */ - punpcklbw mm2, mm0 /* Unpack Low bytes of b */ - /* pav = p - a = (a + b - c) - a = b - c */ - movq mm4, mm2 - punpcklbw mm3, mm0 /* Unpack Low bytes of c */ - /* pbv = p - b = (a + b - c) - b = a - c */ - movq mm5, mm1 - psubw mm4, mm3 - pxor mm7, mm7 - /* pcv = p - c = (a + b - c) -c = (a - c) + (b - c) = pav + pbv */ - movq mm6, mm4 - psubw mm5, mm3 - /* pa = abs(p-a) = abs(pav) */ - /* pb = abs(p-b) = abs(pbv) */ - /* pc = abs(p-c) = abs(pcv) */ - pcmpgtw mm0, mm4 /* Create mask pav bytes < 0 */ - paddw mm6, mm5 - pand mm0, mm4 /* Only pav bytes < 0 in mm7 */ - pcmpgtw mm7, mm5 /* Create mask pbv bytes < 0 */ - psubw mm4, mm0 - pand mm7, mm5 /* Only pbv bytes < 0 in mm0 */ - psubw mm4, mm0 - psubw mm5, mm7 - pxor mm0, mm0 - pcmpgtw mm0, mm6 /* Create mask pcv bytes < 0 */ - pand mm0, mm6 /* Only pav bytes < 0 in mm7 */ - psubw mm5, mm7 - psubw mm6, mm0 - /* test pa <= pb */ - movq mm7, mm4 - psubw mm6, mm0 - pcmpgtw mm7, mm5 /* pa > pb? */ - movq mm0, mm7 - /* use mm7 mask to merge pa & pb */ - pand mm5, mm7 - /* use mm0 mask copy to merge a & b */ - pand mm2, mm0 - pandn mm7, mm4 - pandn mm0, mm1 - paddw mm7, mm5 - paddw mm0, mm2 - /* test ((pa <= pb)? pa:pb) <= pc */ - pcmpgtw mm7, mm6 /* pab > pc? */ - pxor mm1, mm1 - pand mm3, mm7 - pandn mm7, mm0 - paddw mm7, mm3 - pxor mm0, mm0 - packuswb mm7, mm1 - movq mm3, [esi+ebx-8] /* read c=Prior(x-bpp) bytes */ - pand mm7, ActiveMask - movq mm2, [esi + ebx] /* load b=Prior(x) */ - paddb mm7, [edi + ebx] /* add Paeth predictor with Raw(x) */ - punpckhbw mm3, mm0 /* Unpack High bytes of c */ - movq [edi + ebx], mm7 /* write back updated value */ - movq mm1, [edi+ebx-8] /* read a=Raw(x-bpp) bytes */ - - /* Do second set of 4 bytes */ - punpckhbw mm2, mm0 /* Unpack High bytes of b */ - punpckhbw mm1, mm0 /* Unpack High bytes of a */ - /* pav = p - a = (a + b - c) - a = b - c */ - movq mm4, mm2 - /* pbv = p - b = (a + b - c) - b = a - c */ - movq mm5, mm1 - psubw mm4, mm3 - pxor mm7, mm7 - /* pcv = p - c = (a + b - c) -c = (a - c) + (b - c) = pav + pbv */ - movq mm6, mm4 - psubw mm5, mm3 - /* pa = abs(p-a) = abs(pav) */ - /* pb = abs(p-b) = abs(pbv) */ - /* pc = abs(p-c) = abs(pcv) */ - pcmpgtw mm0, mm4 /* Create mask pav bytes < 0 */ - paddw mm6, mm5 - pand mm0, mm4 /* Only pav bytes < 0 in mm7 */ - pcmpgtw mm7, mm5 /* Create mask pbv bytes < 0 */ - psubw mm4, mm0 - pand mm7, mm5 /* Only pbv bytes < 0 in mm0 */ - psubw mm4, mm0 - psubw mm5, mm7 - pxor mm0, mm0 - pcmpgtw mm0, mm6 /* Create mask pcv bytes < 0 */ - pand mm0, mm6 /* Only pav bytes < 0 in mm7 */ - psubw mm5, mm7 - psubw mm6, mm0 - /* test pa <= pb */ - movq mm7, mm4 - psubw mm6, mm0 - pcmpgtw mm7, mm5 /* pa > pb? */ - movq mm0, mm7 - /* use mm7 mask to merge pa & pb */ - pand mm5, mm7 - /* use mm0 mask copy to merge a & b */ - pand mm2, mm0 - pandn mm7, mm4 - pandn mm0, mm1 - paddw mm7, mm5 - paddw mm0, mm2 - /* test ((pa <= pb)? pa:pb) <= pc */ - pcmpgtw mm7, mm6 /* pab > pc? */ - pxor mm1, mm1 - pand mm3, mm7 - pandn mm7, mm0 - pxor mm1, mm1 - paddw mm7, mm3 - pxor mm0, mm0 - /* Step ex to next set of 8 bytes and repeat loop til done */ - add ebx, 8 - packuswb mm1, mm7 - paddb mm1, [edi + ebx - 8] /* add Paeth predictor with Raw(x) */ - cmp ebx, MMXLength - movq [edi + ebx - 8], mm1 /* write back updated value */ - /* mm1 will be used as Raw(x-bpp) next loop */ - jb dpth8lp - } /* end _asm block */ - } - break; - - case 1: /* bpp = 1 */ - case 2: /* bpp = 2 */ - default: /* bpp > 8 */ - { - _asm { - mov ebx, diff - cmp ebx, FullLength - jnb dpthdend - mov edi, row - mov esi, prev_row - /* Do Paeth decode for remaining bytes */ - mov edx, ebx - xor ecx, ecx /* zero ecx before using cl & cx in loop below */ - sub edx, bpp /* Set edx = ebx - bpp */ -dpthdlp: - xor eax, eax - /* pav = p - a = (a + b - c) - a = b - c */ - mov al, [esi + ebx] /* load Prior(x) into al */ - mov cl, [esi + edx] /* load Prior(x-bpp) into cl */ - sub eax, ecx /* subtract Prior(x-bpp) */ - mov patemp, eax /* Save pav for later use */ - xor eax, eax - /* pbv = p - b = (a + b - c) - b = a - c */ - mov al, [edi + edx] /* load Raw(x-bpp) into al */ - sub eax, ecx /* subtract Prior(x-bpp) */ - mov ecx, eax - /* pcv = p - c = (a + b - c) -c = (a - c) + (b - c) = pav + pbv */ - add eax, patemp /* pcv = pav + pbv */ - /* pc = abs(pcv) */ - test eax, 0x80000000 - jz dpthdpca - neg eax /* reverse sign of neg values */ -dpthdpca: - mov pctemp, eax /* save pc for later use */ - /* pb = abs(pbv) */ - test ecx, 0x80000000 - jz dpthdpba - neg ecx /* reverse sign of neg values */ -dpthdpba: - mov pbtemp, ecx /* save pb for later use */ - /* pa = abs(pav) */ - mov eax, patemp - test eax, 0x80000000 - jz dpthdpaa - neg eax /* reverse sign of neg values */ -dpthdpaa: - mov patemp, eax /* save pa for later use */ - /* test if pa <= pb */ - cmp eax, ecx - jna dpthdabb - /* pa > pb; now test if pb <= pc */ - cmp ecx, pctemp - jna dpthdbbc - /* pb > pc; Raw(x) = Paeth(x) + Prior(x-bpp) */ - mov cl, [esi + edx] /* load Prior(x-bpp) into cl */ - jmp dpthdpaeth -dpthdbbc: - /* pb <= pc; Raw(x) = Paeth(x) + Prior(x) */ - mov cl, [esi + ebx] /* load Prior(x) into cl */ - jmp dpthdpaeth -dpthdabb: - /* pa <= pb; now test if pa <= pc */ - cmp eax, pctemp - jna dpthdabc - /* pa > pc; Raw(x) = Paeth(x) + Prior(x-bpp) */ - mov cl, [esi + edx] /* load Prior(x-bpp) into cl */ - jmp dpthdpaeth -dpthdabc: - /* pa <= pc; Raw(x) = Paeth(x) + Raw(x-bpp) */ - mov cl, [edi + edx] /* load Raw(x-bpp) into cl */ -dpthdpaeth: - inc ebx - inc edx - /* Raw(x) = (Paeth(x) + Paeth_Predictor( a, b, c )) mod 256 */ - add [edi + ebx - 1], cl - cmp ebx, FullLength - jb dpthdlp -dpthdend: - } /* end _asm block */ - } - return; /* No need to go further with this one */ - } /* end switch ( bpp ) */ - _asm - { - /* MMX acceleration complete now do clean-up */ - /* Check if any remaining bytes left to decode */ - mov ebx, MMXLength - cmp ebx, FullLength - jnb dpthend - mov edi, row - mov esi, prev_row - /* Do Paeth decode for remaining bytes */ - mov edx, ebx - xor ecx, ecx /* zero ecx before using cl & cx in loop below */ - sub edx, bpp /* Set edx = ebx - bpp */ -dpthlp2: - xor eax, eax - /* pav = p - a = (a + b - c) - a = b - c */ - mov al, [esi + ebx] /* load Prior(x) into al */ - mov cl, [esi + edx] /* load Prior(x-bpp) into cl */ - sub eax, ecx /* subtract Prior(x-bpp) */ - mov patemp, eax /* Save pav for later use */ - xor eax, eax - /* pbv = p - b = (a + b - c) - b = a - c */ - mov al, [edi + edx] /* load Raw(x-bpp) into al */ - sub eax, ecx /* subtract Prior(x-bpp) */ - mov ecx, eax - /* pcv = p - c = (a + b - c) -c = (a - c) + (b - c) = pav + pbv */ - add eax, patemp /* pcv = pav + pbv */ - /* pc = abs(pcv) */ - test eax, 0x80000000 - jz dpthpca2 - neg eax /* reverse sign of neg values */ -dpthpca2: - mov pctemp, eax /* save pc for later use */ - /* pb = abs(pbv) */ - test ecx, 0x80000000 - jz dpthpba2 - neg ecx /* reverse sign of neg values */ -dpthpba2: - mov pbtemp, ecx /* save pb for later use */ - /* pa = abs(pav) */ - mov eax, patemp - test eax, 0x80000000 - jz dpthpaa2 - neg eax /* reverse sign of neg values */ -dpthpaa2: - mov patemp, eax /* save pa for later use */ - /* test if pa <= pb */ - cmp eax, ecx - jna dpthabb2 - /* pa > pb; now test if pb <= pc */ - cmp ecx, pctemp - jna dpthbbc2 - /* pb > pc; Raw(x) = Paeth(x) + Prior(x-bpp) */ - mov cl, [esi + edx] /* load Prior(x-bpp) into cl */ - jmp dpthpaeth2 -dpthbbc2: - /* pb <= pc; Raw(x) = Paeth(x) + Prior(x) */ - mov cl, [esi + ebx] /* load Prior(x) into cl */ - jmp dpthpaeth2 -dpthabb2: - /* pa <= pb; now test if pa <= pc */ - cmp eax, pctemp - jna dpthabc2 - /* pa > pc; Raw(x) = Paeth(x) + Prior(x-bpp) */ - mov cl, [esi + edx] /* load Prior(x-bpp) into cl */ - jmp dpthpaeth2 -dpthabc2: - /* pa <= pc; Raw(x) = Paeth(x) + Raw(x-bpp) */ - mov cl, [edi + edx] /* load Raw(x-bpp) into cl */ -dpthpaeth2: - inc ebx - inc edx - /* Raw(x) = (Paeth(x) + Paeth_Predictor( a, b, c )) mod 256 */ - add [edi + ebx - 1], cl - cmp ebx, FullLength - jb dpthlp2 -dpthend: - emms /* End MMX instructions; prep for possible FP instrs. */ - } /* end _asm block */ -} - -/* Optimized code for PNG Sub filter decoder */ -void /* PRIVATE */ -png_read_filter_row_mmx_sub(png_row_infop row_info, png_bytep row) -{ - /*int test; */ - int bpp; - png_uint_32 FullLength; - png_uint_32 MMXLength; - int diff; - - bpp = (row_info->pixel_depth + 7) >> 3; /* Get # bytes per pixel */ - FullLength = row_info->rowbytes - bpp; /* # of bytes to filter */ - _asm { - mov edi, row - mov esi, edi /* lp = row */ - add edi, bpp /* rp = row + bpp */ - xor eax, eax - /* get # of bytes to alignment */ - mov diff, edi /* take start of row */ - add diff, 0xf /* add 7 + 8 to incr past */ - /* alignment boundary */ - xor ebx, ebx - and diff, 0xfffffff8 /* mask to alignment boundary */ - sub diff, edi /* subtract from start ==> value */ - /* ebx at alignment */ - jz dsubgo - /* fix alignment */ -dsublp1: - mov al, [esi+ebx] - add [edi+ebx], al - inc ebx - cmp ebx, diff - jb dsublp1 -dsubgo: - mov ecx, FullLength - mov edx, ecx - sub edx, ebx /* subtract alignment fix */ - and edx, 0x00000007 /* calc bytes over mult of 8 */ - sub ecx, edx /* drop over bytes from length */ - mov MMXLength, ecx - } /* end _asm block */ - - /* Now do the math for the rest of the row */ - switch ( bpp ) - { - case 3: - { - ActiveMask.use = 0x0000ffffff000000; - ShiftBpp.use = 24; /* == 3 * 8 */ - ShiftRem.use = 40; /* == 64 - 24 */ - _asm { - mov edi, row - movq mm7, ActiveMask /* Load ActiveMask for 2nd active byte group */ - mov esi, edi /* lp = row */ - add edi, bpp /* rp = row + bpp */ - movq mm6, mm7 - mov ebx, diff - psllq mm6, ShiftBpp /* Move mask in mm6 to cover 3rd active */ - /* byte group */ - /* PRIME the pump (load the first Raw(x-bpp) data set */ - movq mm1, [edi+ebx-8] -dsub3lp: - psrlq mm1, ShiftRem /* Shift data for adding 1st bpp bytes */ - /* no need for mask; shift clears inactive bytes */ - /* Add 1st active group */ - movq mm0, [edi+ebx] - paddb mm0, mm1 - /* Add 2nd active group */ - movq mm1, mm0 /* mov updated Raws to mm1 */ - psllq mm1, ShiftBpp /* shift data to position correctly */ - pand mm1, mm7 /* mask to use only 2nd active group */ - paddb mm0, mm1 - /* Add 3rd active group */ - movq mm1, mm0 /* mov updated Raws to mm1 */ - psllq mm1, ShiftBpp /* shift data to position correctly */ - pand mm1, mm6 /* mask to use only 3rd active group */ - add ebx, 8 - paddb mm0, mm1 - cmp ebx, MMXLength - movq [edi+ebx-8], mm0 /* Write updated Raws back to array */ - /* Prep for doing 1st add at top of loop */ - movq mm1, mm0 - jb dsub3lp - } /* end _asm block */ - } - break; - - case 1: - { - /* Placed here just in case this is a duplicate of the */ - /* non-MMX code for the SUB filter in png_read_filter_row below */ - // - /* png_bytep rp; */ - /* png_bytep lp; */ - /* png_uint_32 i; */ - /* bpp = (row_info->pixel_depth + 7) >> 3; */ - /* for (i = (png_uint_32)bpp, rp = row + bpp, lp = row; */ - /* i < row_info->rowbytes; i++, rp++, lp++) */ - /* { */ - /* *rp = (png_byte)(((int)(*rp) + (int)(*lp)) & 0xff); */ - /* } */ - _asm { - mov ebx, diff - mov edi, row - cmp ebx, FullLength - jnb dsub1end - mov esi, edi /* lp = row */ - xor eax, eax - add edi, bpp /* rp = row + bpp */ -dsub1lp: - mov al, [esi+ebx] - add [edi+ebx], al - inc ebx - cmp ebx, FullLength - jb dsub1lp -dsub1end: - } /* end _asm block */ - } - return; - - case 6: - case 7: - case 4: - case 5: - { - ShiftBpp.use = bpp << 3; - ShiftRem.use = 64 - ShiftBpp.use; - _asm { - mov edi, row - mov ebx, diff - mov esi, edi /* lp = row */ - add edi, bpp /* rp = row + bpp */ - /* PRIME the pump (load the first Raw(x-bpp) data set */ - movq mm1, [edi+ebx-8] -dsub4lp: - psrlq mm1, ShiftRem /* Shift data for adding 1st bpp bytes */ - /* no need for mask; shift clears inactive bytes */ - movq mm0, [edi+ebx] - paddb mm0, mm1 - /* Add 2nd active group */ - movq mm1, mm0 /* mov updated Raws to mm1 */ - psllq mm1, ShiftBpp /* shift data to position correctly */ - /* there is no need for any mask */ - /* since shift clears inactive bits/bytes */ - add ebx, 8 - paddb mm0, mm1 - cmp ebx, MMXLength - movq [edi+ebx-8], mm0 - movq mm1, mm0 /* Prep for doing 1st add at top of loop */ - jb dsub4lp - } /* end _asm block */ - } - break; - - case 2: - { - ActiveMask.use = 0x00000000ffff0000; - ShiftBpp.use = 16; /* == 2 * 8 */ - ShiftRem.use = 48; /* == 64 - 16 */ - _asm { - movq mm7, ActiveMask /* Load ActiveMask for 2nd active byte group */ - mov ebx, diff - movq mm6, mm7 - mov edi, row - psllq mm6, ShiftBpp /* Move mask in mm6 to cover 3rd active */ - /* byte group */ - mov esi, edi /* lp = row */ - movq mm5, mm6 - add edi, bpp /* rp = row + bpp */ - psllq mm5, ShiftBpp /* Move mask in mm5 to cover 4th active */ - /* byte group */ - /* PRIME the pump (load the first Raw(x-bpp) data set */ - movq mm1, [edi+ebx-8] -dsub2lp: - /* Add 1st active group */ - psrlq mm1, ShiftRem /* Shift data for adding 1st bpp bytes */ - /* no need for mask; shift clears inactive */ - /* bytes */ - movq mm0, [edi+ebx] - paddb mm0, mm1 - /* Add 2nd active group */ - movq mm1, mm0 /* mov updated Raws to mm1 */ - psllq mm1, ShiftBpp /* shift data to position correctly */ - pand mm1, mm7 /* mask to use only 2nd active group */ - paddb mm0, mm1 - /* Add 3rd active group */ - movq mm1, mm0 /* mov updated Raws to mm1 */ - psllq mm1, ShiftBpp /* shift data to position correctly */ - pand mm1, mm6 /* mask to use only 3rd active group */ - paddb mm0, mm1 - /* Add 4th active group */ - movq mm1, mm0 /* mov updated Raws to mm1 */ - psllq mm1, ShiftBpp /* shift data to position correctly */ - pand mm1, mm5 /* mask to use only 4th active group */ - add ebx, 8 - paddb mm0, mm1 - cmp ebx, MMXLength - movq [edi+ebx-8], mm0 /* Write updated Raws back to array */ - movq mm1, mm0 /* Prep for doing 1st add at top of loop */ - jb dsub2lp - } /* end _asm block */ - } - break; - case 8: - { - _asm { - mov edi, row - mov ebx, diff - mov esi, edi /* lp = row */ - add edi, bpp /* rp = row + bpp */ - mov ecx, MMXLength - movq mm7, [edi+ebx-8] /* PRIME the pump (load the first */ - /* Raw(x-bpp) data set */ - and ecx, 0x0000003f /* calc bytes over mult of 64 */ -dsub8lp: - movq mm0, [edi+ebx] /* Load Sub(x) for 1st 8 bytes */ - paddb mm0, mm7 - movq mm1, [edi+ebx+8] /* Load Sub(x) for 2nd 8 bytes */ - movq [edi+ebx], mm0 /* Write Raw(x) for 1st 8 bytes */ - /* Now mm0 will be used as Raw(x-bpp) for */ - /* the 2nd group of 8 bytes. This will be */ - /* repeated for each group of 8 bytes with */ - /* the 8th group being used as the Raw(x-bpp) */ - /* for the 1st group of the next loop. */ - paddb mm1, mm0 - movq mm2, [edi+ebx+16] /* Load Sub(x) for 3rd 8 bytes */ - movq [edi+ebx+8], mm1 /* Write Raw(x) for 2nd 8 bytes */ - paddb mm2, mm1 - movq mm3, [edi+ebx+24] /* Load Sub(x) for 4th 8 bytes */ - movq [edi+ebx+16], mm2 /* Write Raw(x) for 3rd 8 bytes */ - paddb mm3, mm2 - movq mm4, [edi+ebx+32] /* Load Sub(x) for 5th 8 bytes */ - movq [edi+ebx+24], mm3 /* Write Raw(x) for 4th 8 bytes */ - paddb mm4, mm3 - movq mm5, [edi+ebx+40] /* Load Sub(x) for 6th 8 bytes */ - movq [edi+ebx+32], mm4 /* Write Raw(x) for 5th 8 bytes */ - paddb mm5, mm4 - movq mm6, [edi+ebx+48] /* Load Sub(x) for 7th 8 bytes */ - movq [edi+ebx+40], mm5 /* Write Raw(x) for 6th 8 bytes */ - paddb mm6, mm5 - movq mm7, [edi+ebx+56] /* Load Sub(x) for 8th 8 bytes */ - movq [edi+ebx+48], mm6 /* Write Raw(x) for 7th 8 bytes */ - add ebx, 64 - paddb mm7, mm6 - cmp ebx, ecx - movq [edi+ebx-8], mm7 /* Write Raw(x) for 8th 8 bytes */ - jb dsub8lp - cmp ebx, MMXLength - jnb dsub8lt8 -dsub8lpA: - movq mm0, [edi+ebx] - add ebx, 8 - paddb mm0, mm7 - cmp ebx, MMXLength - movq [edi+ebx-8], mm0 /* use -8 to offset early add to ebx */ - movq mm7, mm0 /* Move calculated Raw(x) data to mm1 to */ - /* be the new Raw(x-bpp) for the next loop */ - jb dsub8lpA -dsub8lt8: - } /* end _asm block */ - } - break; - - default: /* bpp greater than 8 bytes */ - { - _asm { - mov ebx, diff - mov edi, row - mov esi, edi /* lp = row */ - add edi, bpp /* rp = row + bpp */ -dsubAlp: - movq mm0, [edi+ebx] - movq mm1, [esi+ebx] - add ebx, 8 - paddb mm0, mm1 - cmp ebx, MMXLength - movq [edi+ebx-8], mm0 /* mov does not affect flags; -8 to offset */ - /* add ebx */ - jb dsubAlp - } /* end _asm block */ - } - break; - - } /* end switch ( bpp ) */ - - _asm { - mov ebx, MMXLength - mov edi, row - cmp ebx, FullLength - jnb dsubend - mov esi, edi /* lp = row */ - xor eax, eax - add edi, bpp /* rp = row + bpp */ -dsublp2: - mov al, [esi+ebx] - add [edi+ebx], al - inc ebx - cmp ebx, FullLength - jb dsublp2 -dsubend: - emms /* End MMX instructions; prep for possible FP instrs. */ - } /* end _asm block */ -} - -/* Optimized code for PNG Up filter decoder */ -void /* PRIVATE */ -png_read_filter_row_mmx_up(png_row_infop row_info, png_bytep row, - png_bytep prev_row) -{ - png_uint_32 len; - len = row_info->rowbytes; /* # of bytes to filter */ - _asm { - mov edi, row - /* get # of bytes to alignment */ - mov ecx, edi - xor ebx, ebx - add ecx, 0x7 - xor eax, eax - and ecx, 0xfffffff8 - mov esi, prev_row - sub ecx, edi - jz dupgo - /* fix alignment */ -duplp1: - mov al, [edi+ebx] - add al, [esi+ebx] - inc ebx - cmp ebx, ecx - mov [edi + ebx-1], al /* mov does not affect flags; -1 to offset inc ebx */ - jb duplp1 -dupgo: - mov ecx, len - mov edx, ecx - sub edx, ebx /* subtract alignment fix */ - and edx, 0x0000003f /* calc bytes over mult of 64 */ - sub ecx, edx /* drop over bytes from length */ - /* Unrolled loop - use all MMX registers and interleave to reduce */ - /* number of branch instructions (loops) and reduce partial stalls */ -duploop: - movq mm1, [esi+ebx] - movq mm0, [edi+ebx] - movq mm3, [esi+ebx+8] - paddb mm0, mm1 - movq mm2, [edi+ebx+8] - movq [edi+ebx], mm0 - paddb mm2, mm3 - movq mm5, [esi+ebx+16] - movq [edi+ebx+8], mm2 - movq mm4, [edi+ebx+16] - movq mm7, [esi+ebx+24] - paddb mm4, mm5 - movq mm6, [edi+ebx+24] - movq [edi+ebx+16], mm4 - paddb mm6, mm7 - movq mm1, [esi+ebx+32] - movq [edi+ebx+24], mm6 - movq mm0, [edi+ebx+32] - movq mm3, [esi+ebx+40] - paddb mm0, mm1 - movq mm2, [edi+ebx+40] - movq [edi+ebx+32], mm0 - paddb mm2, mm3 - movq mm5, [esi+ebx+48] - movq [edi+ebx+40], mm2 - movq mm4, [edi+ebx+48] - movq mm7, [esi+ebx+56] - paddb mm4, mm5 - movq mm6, [edi+ebx+56] - movq [edi+ebx+48], mm4 - add ebx, 64 - paddb mm6, mm7 - cmp ebx, ecx - movq [edi+ebx-8], mm6 /* (+56)movq does not affect flags; */ - /* -8 to offset add ebx */ - jb duploop - - cmp edx, 0 /* Test for bytes over mult of 64 */ - jz dupend - - - /* 2 lines added by lcreeve@netins.net */ - /* (mail 11 Jul 98 in png-implement list) */ - cmp edx, 8 /*test for less than 8 bytes */ - jb duplt8 - - - add ecx, edx - and edx, 0x00000007 /* calc bytes over mult of 8 */ - sub ecx, edx /* drop over bytes from length */ - jz duplt8 - /* Loop using MMX registers mm0 & mm1 to update 8 bytes simultaneously */ -duplpA: - movq mm1, [esi+ebx] - movq mm0, [edi+ebx] - add ebx, 8 - paddb mm0, mm1 - cmp ebx, ecx - movq [edi+ebx-8], mm0 /* movq does not affect flags; -8 to offset add ebx */ - jb duplpA - cmp edx, 0 /* Test for bytes over mult of 8 */ - jz dupend -duplt8: - xor eax, eax - add ecx, edx /* move over byte count into counter */ - /* Loop using x86 registers to update remaining bytes */ -duplp2: - mov al, [edi + ebx] - add al, [esi + ebx] - inc ebx - cmp ebx, ecx - mov [edi + ebx-1], al /* mov does not affect flags; -1 to offset inc ebx */ - jb duplp2 -dupend: - /* Conversion of filtered row completed */ - emms /* End MMX instructions; prep for possible FP instrs. */ - } /* end _asm block */ -} - - -/* Optimized png_read_filter_row routines */ -void /* PRIVATE */ -png_read_filter_row(png_structp png_ptr, png_row_infop row_info, png_bytep - row, png_bytep prev_row, int filter) -{ -#ifdef PNG_DEBUG - char filnm[10]; -#endif - - if (mmx_supported == 2) { -#if !defined(PNG_1_0_X) - /* this should have happened in png_init_mmx_flags() already */ - png_warning(png_ptr, "asm_flags may not have been initialized"); -#endif - png_mmx_support(); - } - -#ifdef PNG_DEBUG - png_debug(1, "in png_read_filter_row\n"); - switch (filter) - { - case 0: sprintf(filnm, "none"); - break; -#if !defined(PNG_1_0_X) - case 1: sprintf(filnm, "sub-%s", - (png_ptr->asm_flags & PNG_ASM_FLAG_MMX_READ_FILTER_SUB)? "MMX" : "x86"); - break; - case 2: sprintf(filnm, "up-%s", - (png_ptr->asm_flags & PNG_ASM_FLAG_MMX_READ_FILTER_UP)? "MMX" : "x86"); - break; - case 3: sprintf(filnm, "avg-%s", - (png_ptr->asm_flags & PNG_ASM_FLAG_MMX_READ_FILTER_AVG)? "MMX" : "x86"); - break; - case 4: sprintf(filnm, "Paeth-%s", - (png_ptr->asm_flags & PNG_ASM_FLAG_MMX_READ_FILTER_PAETH)? "MMX":"x86"); - break; -#else - case 1: sprintf(filnm, "sub"); - break; - case 2: sprintf(filnm, "up"); - break; - case 3: sprintf(filnm, "avg"); - break; - case 4: sprintf(filnm, "Paeth"); - break; -#endif - default: sprintf(filnm, "unknw"); - break; - } - png_debug2(0,"row=%5d, %s, ", png_ptr->row_number, filnm); - png_debug2(0, "pd=%2d, b=%d, ", (int)row_info->pixel_depth, - (int)((row_info->pixel_depth + 7) >> 3)); - png_debug1(0,"len=%8d, ", row_info->rowbytes); -#endif /* PNG_DEBUG */ - - switch (filter) - { - case PNG_FILTER_VALUE_NONE: - break; - - case PNG_FILTER_VALUE_SUB: - { -#if !defined(PNG_1_0_X) - if ((png_ptr->asm_flags & PNG_ASM_FLAG_MMX_READ_FILTER_SUB) && - (row_info->pixel_depth >= png_ptr->mmx_bitdepth_threshold) && - (row_info->rowbytes >= png_ptr->mmx_rowbytes_threshold)) -#else - if (mmx_supported) -#endif - { - png_read_filter_row_mmx_sub(row_info, row); - } - else - { - png_uint_32 i; - png_uint_32 istop = row_info->rowbytes; - png_uint_32 bpp = (row_info->pixel_depth + 7) >> 3; - png_bytep rp = row + bpp; - png_bytep lp = row; - - for (i = bpp; i < istop; i++) - { - *rp = (png_byte)(((int)(*rp) + (int)(*lp++)) & 0xff); - rp++; - } - } - break; - } - - case PNG_FILTER_VALUE_UP: - { -#if !defined(PNG_1_0_X) - if ((png_ptr->asm_flags & PNG_ASM_FLAG_MMX_READ_FILTER_UP) && - (row_info->pixel_depth >= png_ptr->mmx_bitdepth_threshold) && - (row_info->rowbytes >= png_ptr->mmx_rowbytes_threshold)) -#else - if (mmx_supported) -#endif - { - png_read_filter_row_mmx_up(row_info, row, prev_row); - } - else - { - png_uint_32 i; - png_uint_32 istop = row_info->rowbytes; - png_bytep rp = row; - png_bytep pp = prev_row; - - for (i = 0; i < istop; ++i) - { - *rp = (png_byte)(((int)(*rp) + (int)(*pp++)) & 0xff); - rp++; - } - } - break; - } - - case PNG_FILTER_VALUE_AVG: - { -#if !defined(PNG_1_0_X) - if ((png_ptr->asm_flags & PNG_ASM_FLAG_MMX_READ_FILTER_AVG) && - (row_info->pixel_depth >= png_ptr->mmx_bitdepth_threshold) && - (row_info->rowbytes >= png_ptr->mmx_rowbytes_threshold)) -#else - if (mmx_supported) -#endif - { - png_read_filter_row_mmx_avg(row_info, row, prev_row); - } - else - { - png_uint_32 i; - png_bytep rp = row; - png_bytep pp = prev_row; - png_bytep lp = row; - png_uint_32 bpp = (row_info->pixel_depth + 7) >> 3; - png_uint_32 istop = row_info->rowbytes - bpp; - - for (i = 0; i < bpp; i++) - { - *rp = (png_byte)(((int)(*rp) + - ((int)(*pp++) >> 1)) & 0xff); - rp++; - } - - for (i = 0; i < istop; i++) - { - *rp = (png_byte)(((int)(*rp) + - ((int)(*pp++ + *lp++) >> 1)) & 0xff); - rp++; - } - } - break; - } - - case PNG_FILTER_VALUE_PAETH: - { -#if !defined(PNG_1_0_X) - if ((png_ptr->asm_flags & PNG_ASM_FLAG_MMX_READ_FILTER_PAETH) && - (row_info->pixel_depth >= png_ptr->mmx_bitdepth_threshold) && - (row_info->rowbytes >= png_ptr->mmx_rowbytes_threshold)) -#else - if (mmx_supported) -#endif - { - png_read_filter_row_mmx_paeth(row_info, row, prev_row); - } - else - { - png_uint_32 i; - png_bytep rp = row; - png_bytep pp = prev_row; - png_bytep lp = row; - png_bytep cp = prev_row; - png_uint_32 bpp = (row_info->pixel_depth + 7) >> 3; - png_uint_32 istop=row_info->rowbytes - bpp; - - for (i = 0; i < bpp; i++) - { - *rp = (png_byte)(((int)(*rp) + (int)(*pp++)) & 0xff); - rp++; - } - - for (i = 0; i < istop; i++) /* use leftover rp,pp */ - { - int a, b, c, pa, pb, pc, p; - - a = *lp++; - b = *pp++; - c = *cp++; - - p = b - c; - pc = a - c; - -#ifdef PNG_USE_ABS - pa = abs(p); - pb = abs(pc); - pc = abs(p + pc); -#else - pa = p < 0 ? -p : p; - pb = pc < 0 ? -pc : pc; - pc = (p + pc) < 0 ? -(p + pc) : p + pc; -#endif - - /* - if (pa <= pb && pa <= pc) - p = a; - else if (pb <= pc) - p = b; - else - p = c; - */ - - p = (pa <= pb && pa <=pc) ? a : (pb <= pc) ? b : c; - - *rp = (png_byte)(((int)(*rp) + p) & 0xff); - rp++; - } - } - break; - } - - default: - png_warning(png_ptr, "Ignoring bad row filter type"); - *row=0; - break; - } -} - -#endif /* PNG_ASSEMBLER_CODE_SUPPORTED && PNG_USE_PNGVCRD */ diff --git a/wxWidgets/src/png/pngwio.c b/wxWidgets/src/png/pngwio.c deleted file mode 100644 index adc57b3091..0000000000 --- a/wxWidgets/src/png/pngwio.c +++ /dev/null @@ -1,228 +0,0 @@ - -/* pngwio.c - functions for data output - * - * libpng 1.2.7 - September 12, 2004 - * For conditions of distribution and use, see copyright notice in png.h - * Copyright (c) 1998-2004 Glenn Randers-Pehrson - * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) - * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) - * - * This file provides a location for all output. Users who need - * special handling are expected to write functions that have the same - * arguments as these and perform similar functions, but that possibly - * use different output methods. Note that you shouldn't change these - * functions, but rather write replacement functions and then change - * them at run time with png_set_write_fn(...). - */ - -#define PNG_INTERNAL -#include "png.h" -#ifdef PNG_WRITE_SUPPORTED - -/* Write the data to whatever output you are using. The default routine - writes to a file pointer. Note that this routine sometimes gets called - with very small lengths, so you should implement some kind of simple - buffering if you are using unbuffered writes. This should never be asked - to write more than 64K on a 16 bit machine. */ - -void /* PRIVATE */ -png_write_data(png_structp png_ptr, png_bytep data, png_size_t length) -{ - if (png_ptr->write_data_fn != NULL ) - (*(png_ptr->write_data_fn))(png_ptr, data, length); - else - png_error(png_ptr, "Call to NULL write function"); -} - -#if !defined(PNG_NO_STDIO) -/* This is the function that does the actual writing of data. If you are - not writing to a standard C stream, you should create a replacement - write_data function and use it at run time with png_set_write_fn(), rather - than changing the library. */ -#ifndef USE_FAR_KEYWORD -void PNGAPI -png_default_write_data(png_structp png_ptr, png_bytep data, png_size_t length) -{ - png_uint_32 check; - -#if defined(_WIN32_WCE) - if ( !WriteFile((HANDLE)(png_ptr->io_ptr), data, length, &check, NULL) ) - check = 0; -#else - check = fwrite(data, 1, length, (png_FILE_p)(png_ptr->io_ptr)); -#endif - if (check != length) - png_error(png_ptr, "Write Error"); -} -#else -/* this is the model-independent version. Since the standard I/O library - can't handle far buffers in the medium and small models, we have to copy - the data. -*/ - -#define NEAR_BUF_SIZE 1024 -#define MIN(a,b) (a <= b ? a : b) - -void PNGAPI -png_default_write_data(png_structp png_ptr, png_bytep data, png_size_t length) -{ - png_uint_32 check; - png_byte *near_data; /* Needs to be "png_byte *" instead of "png_bytep" */ - png_FILE_p io_ptr; - - /* Check if data really is near. If so, use usual code. */ - near_data = (png_byte *)CVT_PTR_NOCHECK(data); - io_ptr = (png_FILE_p)CVT_PTR(png_ptr->io_ptr); - if ((png_bytep)near_data == data) - { -#if defined(_WIN32_WCE) - if ( !WriteFile(io_ptr, near_data, length, &check, NULL) ) - check = 0; -#else - check = fwrite(near_data, 1, length, io_ptr); -#endif - } - else - { - png_byte buf[NEAR_BUF_SIZE]; - png_size_t written, remaining, err; - check = 0; - remaining = length; - do - { - written = MIN(NEAR_BUF_SIZE, remaining); - png_memcpy(buf, data, written); /* copy far buffer to near buffer */ -#if defined(_WIN32_WCE) - if ( !WriteFile(io_ptr, buf, written, &err, NULL) ) - err = 0; -#else - err = fwrite(buf, 1, written, io_ptr); -#endif - if (err != written) - break; - else - check += err; - data += written; - remaining -= written; - } - while (remaining != 0); - } - if (check != length) - png_error(png_ptr, "Write Error"); -} - -#endif -#endif - -/* This function is called to output any data pending writing (normally - to disk). After png_flush is called, there should be no data pending - writing in any buffers. */ -#if defined(PNG_WRITE_FLUSH_SUPPORTED) -void /* PRIVATE */ -png_flush(png_structp png_ptr) -{ - if (png_ptr->output_flush_fn != NULL) - (*(png_ptr->output_flush_fn))(png_ptr); -} - -#if !defined(PNG_NO_STDIO) -void PNGAPI -png_default_flush(png_structp png_ptr) -{ -#if !defined(_WIN32_WCE) - png_FILE_p io_ptr; - io_ptr = (png_FILE_p)CVT_PTR((png_ptr->io_ptr)); - if (io_ptr != NULL) - fflush(io_ptr); -#endif -} -#endif -#endif - -/* This function allows the application to supply new output functions for - libpng if standard C streams aren't being used. - - This function takes as its arguments: - png_ptr - pointer to a png output data structure - io_ptr - pointer to user supplied structure containing info about - the output functions. May be NULL. - write_data_fn - pointer to a new output function that takes as its - arguments a pointer to a png_struct, a pointer to - data to be written, and a 32-bit unsigned int that is - the number of bytes to be written. The new write - function should call png_error(png_ptr, "Error msg") - to exit and output any fatal error messages. - flush_data_fn - pointer to a new flush function that takes as its - arguments a pointer to a png_struct. After a call to - the flush function, there should be no data in any buffers - or pending transmission. If the output method doesn't do - any buffering of ouput, a function prototype must still be - supplied although it doesn't have to do anything. If - PNG_WRITE_FLUSH_SUPPORTED is not defined at libpng compile - time, output_flush_fn will be ignored, although it must be - supplied for compatibility. */ -void PNGAPI -png_set_write_fn(png_structp png_ptr, png_voidp io_ptr, - png_rw_ptr write_data_fn, png_flush_ptr output_flush_fn) -{ - png_ptr->io_ptr = io_ptr; - -#if !defined(PNG_NO_STDIO) - if (write_data_fn != NULL) - png_ptr->write_data_fn = write_data_fn; - else - png_ptr->write_data_fn = png_default_write_data; -#else - png_ptr->write_data_fn = write_data_fn; -#endif - -#if defined(PNG_WRITE_FLUSH_SUPPORTED) -#if !defined(PNG_NO_STDIO) - if (output_flush_fn != NULL) - png_ptr->output_flush_fn = output_flush_fn; - else - png_ptr->output_flush_fn = png_default_flush; -#else - png_ptr->output_flush_fn = output_flush_fn; -#endif -#endif /* PNG_WRITE_FLUSH_SUPPORTED */ - - /* It is an error to read while writing a png file */ - if (png_ptr->read_data_fn != NULL) - { - png_ptr->read_data_fn = NULL; - png_warning(png_ptr, - "Attempted to set both read_data_fn and write_data_fn in"); - png_warning(png_ptr, - "the same structure. Resetting read_data_fn to NULL."); - } -} - -#if defined(USE_FAR_KEYWORD) -#if defined(_MSC_VER) -void *png_far_to_near(png_structp png_ptr,png_voidp ptr, int check) -{ - void *near_ptr; - void FAR *far_ptr; - FP_OFF(near_ptr) = FP_OFF(ptr); - far_ptr = (void FAR *)near_ptr; - if(check != 0) - if(FP_SEG(ptr) != FP_SEG(far_ptr)) - png_error(png_ptr,"segment lost in conversion"); - return(near_ptr); -} -# else -void *png_far_to_near(png_structp png_ptr,png_voidp ptr, int check) -{ - void *near_ptr; - void FAR *far_ptr; - near_ptr = (void FAR *)ptr; - far_ptr = (void FAR *)near_ptr; - if(check != 0) - if(far_ptr != ptr) - png_error(png_ptr,"segment lost in conversion"); - return(near_ptr); -} -# endif -# endif -#endif /* PNG_WRITE_SUPPORTED */ diff --git a/wxWidgets/src/png/pngwrite.c b/wxWidgets/src/png/pngwrite.c deleted file mode 100644 index f422173bf2..0000000000 --- a/wxWidgets/src/png/pngwrite.c +++ /dev/null @@ -1,1464 +0,0 @@ - -/* pngwrite.c - general routines to write a PNG file - * - * libpng 1.2.7 - September 12, 2004 - * For conditions of distribution and use, see copyright notice in png.h - * Copyright (c) 1998-2004 Glenn Randers-Pehrson - * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) - * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) - */ - -/* get internal access to png.h */ -#define PNG_INTERNAL -#include "png.h" -#ifdef PNG_WRITE_SUPPORTED - -/* Writes all the PNG information. This is the suggested way to use the - * library. If you have a new chunk to add, make a function to write it, - * and put it in the correct location here. If you want the chunk written - * after the image data, put it in png_write_end(). I strongly encourage - * you to supply a PNG_INFO_ flag, and check info_ptr->valid before writing - * the chunk, as that will keep the code from breaking if you want to just - * write a plain PNG file. If you have long comments, I suggest writing - * them in png_write_end(), and compressing them. - */ -void PNGAPI -png_write_info_before_PLTE(png_structp png_ptr, png_infop info_ptr) -{ - png_debug(1, "in png_write_info_before_PLTE\n"); - if (!(png_ptr->mode & PNG_WROTE_INFO_BEFORE_PLTE)) - { - png_write_sig(png_ptr); /* write PNG signature */ -#if defined(PNG_MNG_FEATURES_SUPPORTED) - if((png_ptr->mode&PNG_HAVE_PNG_SIGNATURE)&&(png_ptr->mng_features_permitted)) - { - png_warning(png_ptr,"MNG features are not allowed in a PNG datastream\n"); - png_ptr->mng_features_permitted=0; - } -#endif - /* write IHDR information. */ - png_write_IHDR(png_ptr, info_ptr->width, info_ptr->height, - info_ptr->bit_depth, info_ptr->color_type, info_ptr->compression_type, - info_ptr->filter_type, -#if defined(PNG_WRITE_INTERLACING_SUPPORTED) - info_ptr->interlace_type); -#else - 0); -#endif - /* the rest of these check to see if the valid field has the appropriate - flag set, and if it does, writes the chunk. */ -#if defined(PNG_WRITE_gAMA_SUPPORTED) - if (info_ptr->valid & PNG_INFO_gAMA) - { -# ifdef PNG_FLOATING_POINT_SUPPORTED - png_write_gAMA(png_ptr, info_ptr->gamma); -#else -#ifdef PNG_FIXED_POINT_SUPPORTED - png_write_gAMA_fixed(png_ptr, info_ptr->int_gamma); -# endif -#endif - } -#endif -#if defined(PNG_WRITE_sRGB_SUPPORTED) - if (info_ptr->valid & PNG_INFO_sRGB) - png_write_sRGB(png_ptr, (int)info_ptr->srgb_intent); -#endif -#if defined(PNG_WRITE_iCCP_SUPPORTED) - if (info_ptr->valid & PNG_INFO_iCCP) - png_write_iCCP(png_ptr, info_ptr->iccp_name, PNG_COMPRESSION_TYPE_BASE, - info_ptr->iccp_profile, (int)info_ptr->iccp_proflen); -#endif -#if defined(PNG_WRITE_sBIT_SUPPORTED) - if (info_ptr->valid & PNG_INFO_sBIT) - png_write_sBIT(png_ptr, &(info_ptr->sig_bit), info_ptr->color_type); -#endif -#if defined(PNG_WRITE_cHRM_SUPPORTED) - if (info_ptr->valid & PNG_INFO_cHRM) - { -#ifdef PNG_FLOATING_POINT_SUPPORTED - png_write_cHRM(png_ptr, - info_ptr->x_white, info_ptr->y_white, - info_ptr->x_red, info_ptr->y_red, - info_ptr->x_green, info_ptr->y_green, - info_ptr->x_blue, info_ptr->y_blue); -#else -# ifdef PNG_FIXED_POINT_SUPPORTED - png_write_cHRM_fixed(png_ptr, - info_ptr->int_x_white, info_ptr->int_y_white, - info_ptr->int_x_red, info_ptr->int_y_red, - info_ptr->int_x_green, info_ptr->int_y_green, - info_ptr->int_x_blue, info_ptr->int_y_blue); -# endif -#endif - } -#endif -#if defined(PNG_WRITE_UNKNOWN_CHUNKS_SUPPORTED) - if (info_ptr->unknown_chunks_num) - { - png_unknown_chunk *up; - - png_debug(5, "writing extra chunks\n"); - - for (up = info_ptr->unknown_chunks; - up < info_ptr->unknown_chunks + info_ptr->unknown_chunks_num; - up++) - { - int keep=png_handle_as_unknown(png_ptr, up->name); - if (keep != PNG_HANDLE_CHUNK_NEVER && - up->location && !(up->location & PNG_HAVE_PLTE) && - !(up->location & PNG_HAVE_IDAT) && - ((up->name[3] & 0x20) || keep == PNG_HANDLE_CHUNK_ALWAYS || - (png_ptr->flags & PNG_FLAG_KEEP_UNSAFE_CHUNKS))) - { - png_write_chunk(png_ptr, up->name, up->data, up->size); - } - } - } -#endif - png_ptr->mode |= PNG_WROTE_INFO_BEFORE_PLTE; - } -} - -void PNGAPI -png_write_info(png_structp png_ptr, png_infop info_ptr) -{ -#if defined(PNG_WRITE_TEXT_SUPPORTED) || defined(PNG_WRITE_sPLT_SUPPORTED) - int i; -#endif - - png_debug(1, "in png_write_info\n"); - - png_write_info_before_PLTE(png_ptr, info_ptr); - - if (info_ptr->valid & PNG_INFO_PLTE) - png_write_PLTE(png_ptr, info_ptr->palette, - (png_uint_32)info_ptr->num_palette); - else if (info_ptr->color_type == PNG_COLOR_TYPE_PALETTE) - png_error(png_ptr, "Valid palette required for paletted images\n"); - -#if defined(PNG_WRITE_tRNS_SUPPORTED) - if (info_ptr->valid & PNG_INFO_tRNS) - { -#if defined(PNG_WRITE_INVERT_ALPHA_SUPPORTED) - /* invert the alpha channel (in tRNS) */ - if ((png_ptr->transformations & PNG_INVERT_ALPHA) && - info_ptr->color_type == PNG_COLOR_TYPE_PALETTE) - { - int j; - for (j=0; j<(int)info_ptr->num_trans; j++) - info_ptr->trans[j] = (png_byte)(255 - info_ptr->trans[j]); - } -#endif - png_write_tRNS(png_ptr, info_ptr->trans, &(info_ptr->trans_values), - info_ptr->num_trans, info_ptr->color_type); - } -#endif -#if defined(PNG_WRITE_bKGD_SUPPORTED) - if (info_ptr->valid & PNG_INFO_bKGD) - png_write_bKGD(png_ptr, &(info_ptr->background), info_ptr->color_type); -#endif -#if defined(PNG_WRITE_hIST_SUPPORTED) - if (info_ptr->valid & PNG_INFO_hIST) - png_write_hIST(png_ptr, info_ptr->hist, info_ptr->num_palette); -#endif -#if defined(PNG_WRITE_oFFs_SUPPORTED) - if (info_ptr->valid & PNG_INFO_oFFs) - png_write_oFFs(png_ptr, info_ptr->x_offset, info_ptr->y_offset, - info_ptr->offset_unit_type); -#endif -#if defined(PNG_WRITE_pCAL_SUPPORTED) - if (info_ptr->valid & PNG_INFO_pCAL) - png_write_pCAL(png_ptr, info_ptr->pcal_purpose, info_ptr->pcal_X0, - info_ptr->pcal_X1, info_ptr->pcal_type, info_ptr->pcal_nparams, - info_ptr->pcal_units, info_ptr->pcal_params); -#endif -#if defined(PNG_WRITE_sCAL_SUPPORTED) - if (info_ptr->valid & PNG_INFO_sCAL) -#if defined(PNG_FLOATING_POINT_SUPPORTED) && !defined(PNG_NO_STDIO) - png_write_sCAL(png_ptr, (int)info_ptr->scal_unit, - info_ptr->scal_pixel_width, info_ptr->scal_pixel_height); -#else -#ifdef PNG_FIXED_POINT_SUPPORTED - png_write_sCAL_s(png_ptr, (int)info_ptr->scal_unit, - info_ptr->scal_s_width, info_ptr->scal_s_height); -#else - png_warning(png_ptr, - "png_write_sCAL not supported; sCAL chunk not written.\n"); -#endif -#endif -#endif -#if defined(PNG_WRITE_pHYs_SUPPORTED) - if (info_ptr->valid & PNG_INFO_pHYs) - png_write_pHYs(png_ptr, info_ptr->x_pixels_per_unit, - info_ptr->y_pixels_per_unit, info_ptr->phys_unit_type); -#endif -#if defined(PNG_WRITE_tIME_SUPPORTED) - if (info_ptr->valid & PNG_INFO_tIME) - { - png_write_tIME(png_ptr, &(info_ptr->mod_time)); - png_ptr->mode |= PNG_WROTE_tIME; - } -#endif -#if defined(PNG_WRITE_sPLT_SUPPORTED) - if (info_ptr->valid & PNG_INFO_sPLT) - for (i = 0; i < (int)info_ptr->splt_palettes_num; i++) - png_write_sPLT(png_ptr, info_ptr->splt_palettes + i); -#endif -#if defined(PNG_WRITE_TEXT_SUPPORTED) - /* Check to see if we need to write text chunks */ - for (i = 0; i < info_ptr->num_text; i++) - { - png_debug2(2, "Writing header text chunk %d, type %d\n", i, - info_ptr->text[i].compression); - /* an internationalized chunk? */ - if (info_ptr->text[i].compression > 0) - { -#if defined(PNG_WRITE_iTXt_SUPPORTED) - /* write international chunk */ - png_write_iTXt(png_ptr, - info_ptr->text[i].compression, - info_ptr->text[i].key, - info_ptr->text[i].lang, - info_ptr->text[i].lang_key, - info_ptr->text[i].text); -#else - png_warning(png_ptr, "Unable to write international text\n"); -#endif - /* Mark this chunk as written */ - info_ptr->text[i].compression = PNG_TEXT_COMPRESSION_NONE_WR; - } - /* If we want a compressed text chunk */ - else if (info_ptr->text[i].compression == PNG_TEXT_COMPRESSION_zTXt) - { -#if defined(PNG_WRITE_zTXt_SUPPORTED) - /* write compressed chunk */ - png_write_zTXt(png_ptr, info_ptr->text[i].key, - info_ptr->text[i].text, 0, - info_ptr->text[i].compression); -#else - png_warning(png_ptr, "Unable to write compressed text\n"); -#endif - /* Mark this chunk as written */ - info_ptr->text[i].compression = PNG_TEXT_COMPRESSION_zTXt_WR; - } - else if (info_ptr->text[i].compression == PNG_TEXT_COMPRESSION_NONE) - { -#if defined(PNG_WRITE_tEXt_SUPPORTED) - /* write uncompressed chunk */ - png_write_tEXt(png_ptr, info_ptr->text[i].key, - info_ptr->text[i].text, - 0); -#else - png_warning(png_ptr, "Unable to write uncompressed text\n"); -#endif - /* Mark this chunk as written */ - info_ptr->text[i].compression = PNG_TEXT_COMPRESSION_NONE_WR; - } - } -#endif -#if defined(PNG_WRITE_UNKNOWN_CHUNKS_SUPPORTED) - if (info_ptr->unknown_chunks_num) - { - png_unknown_chunk *up; - - png_debug(5, "writing extra chunks\n"); - - for (up = info_ptr->unknown_chunks; - up < info_ptr->unknown_chunks + info_ptr->unknown_chunks_num; - up++) - { - int keep=png_handle_as_unknown(png_ptr, up->name); - if (keep != PNG_HANDLE_CHUNK_NEVER && - up->location && (up->location & PNG_HAVE_PLTE) && - !(up->location & PNG_HAVE_IDAT) && - ((up->name[3] & 0x20) || keep == PNG_HANDLE_CHUNK_ALWAYS || - (png_ptr->flags & PNG_FLAG_KEEP_UNSAFE_CHUNKS))) - { - png_write_chunk(png_ptr, up->name, up->data, up->size); - } - } - } -#endif -} - -/* Writes the end of the PNG file. If you don't want to write comments or - * time information, you can pass NULL for info. If you already wrote these - * in png_write_info(), do not write them again here. If you have long - * comments, I suggest writing them here, and compressing them. - */ -void PNGAPI -png_write_end(png_structp png_ptr, png_infop info_ptr) -{ - png_debug(1, "in png_write_end\n"); - if (!(png_ptr->mode & PNG_HAVE_IDAT)) - png_error(png_ptr, "No IDATs written into file"); - - /* see if user wants us to write information chunks */ - if (info_ptr != NULL) - { -#if defined(PNG_WRITE_TEXT_SUPPORTED) - int i; /* local index variable */ -#endif -#if defined(PNG_WRITE_tIME_SUPPORTED) - /* check to see if user has supplied a time chunk */ - if ((info_ptr->valid & PNG_INFO_tIME) && - !(png_ptr->mode & PNG_WROTE_tIME)) - png_write_tIME(png_ptr, &(info_ptr->mod_time)); -#endif -#if defined(PNG_WRITE_TEXT_SUPPORTED) - /* loop through comment chunks */ - for (i = 0; i < info_ptr->num_text; i++) - { - png_debug2(2, "Writing trailer text chunk %d, type %d\n", i, - info_ptr->text[i].compression); - /* an internationalized chunk? */ - if (info_ptr->text[i].compression > 0) - { -#if defined(PNG_WRITE_iTXt_SUPPORTED) - /* write international chunk */ - png_write_iTXt(png_ptr, - info_ptr->text[i].compression, - info_ptr->text[i].key, - info_ptr->text[i].lang, - info_ptr->text[i].lang_key, - info_ptr->text[i].text); -#else - png_warning(png_ptr, "Unable to write international text\n"); -#endif - /* Mark this chunk as written */ - info_ptr->text[i].compression = PNG_TEXT_COMPRESSION_NONE_WR; - } - else if (info_ptr->text[i].compression >= PNG_TEXT_COMPRESSION_zTXt) - { -#if defined(PNG_WRITE_zTXt_SUPPORTED) - /* write compressed chunk */ - png_write_zTXt(png_ptr, info_ptr->text[i].key, - info_ptr->text[i].text, 0, - info_ptr->text[i].compression); -#else - png_warning(png_ptr, "Unable to write compressed text\n"); -#endif - /* Mark this chunk as written */ - info_ptr->text[i].compression = PNG_TEXT_COMPRESSION_zTXt_WR; - } - else if (info_ptr->text[i].compression == PNG_TEXT_COMPRESSION_NONE) - { -#if defined(PNG_WRITE_tEXt_SUPPORTED) - /* write uncompressed chunk */ - png_write_tEXt(png_ptr, info_ptr->text[i].key, - info_ptr->text[i].text, 0); -#else - png_warning(png_ptr, "Unable to write uncompressed text\n"); -#endif - - /* Mark this chunk as written */ - info_ptr->text[i].compression = PNG_TEXT_COMPRESSION_NONE_WR; - } - } -#endif -#if defined(PNG_WRITE_UNKNOWN_CHUNKS_SUPPORTED) - if (info_ptr->unknown_chunks_num) - { - png_unknown_chunk *up; - - png_debug(5, "writing extra chunks\n"); - - for (up = info_ptr->unknown_chunks; - up < info_ptr->unknown_chunks + info_ptr->unknown_chunks_num; - up++) - { - int keep=png_handle_as_unknown(png_ptr, up->name); - if (keep != PNG_HANDLE_CHUNK_NEVER && - up->location && (up->location & PNG_AFTER_IDAT) && - ((up->name[3] & 0x20) || keep == PNG_HANDLE_CHUNK_ALWAYS || - (png_ptr->flags & PNG_FLAG_KEEP_UNSAFE_CHUNKS))) - { - png_write_chunk(png_ptr, up->name, up->data, up->size); - } - } - } -#endif - } - - png_ptr->mode |= PNG_AFTER_IDAT; - - /* write end of PNG file */ - png_write_IEND(png_ptr); -#if 0 -/* This flush, added in libpng-1.0.8, causes some applications to crash - because they do not set png_ptr->output_flush_fn */ - png_flush(png_ptr); -#endif -} - -#if defined(PNG_WRITE_tIME_SUPPORTED) -#if !defined(_WIN32_WCE) -/* "time.h" functions are not supported on WindowsCE */ -void PNGAPI -png_convert_from_struct_tm(png_timep ptime, struct tm FAR * ttime) -{ - png_debug(1, "in png_convert_from_struct_tm\n"); - ptime->year = (png_uint_16)(1900 + ttime->tm_year); - ptime->month = (png_byte)(ttime->tm_mon + 1); - ptime->day = (png_byte)ttime->tm_mday; - ptime->hour = (png_byte)ttime->tm_hour; - ptime->minute = (png_byte)ttime->tm_min; - ptime->second = (png_byte)ttime->tm_sec; -} - -void PNGAPI -png_convert_from_time_t(png_timep ptime, time_t ttime) -{ - struct tm *tbuf; - - png_debug(1, "in png_convert_from_time_t\n"); - tbuf = gmtime(&ttime); - png_convert_from_struct_tm(ptime, tbuf); -} -#endif -#endif - -/* Initialize png_ptr structure, and allocate any memory needed */ -png_structp PNGAPI -png_create_write_struct(png_const_charp user_png_ver, png_voidp error_ptr, - png_error_ptr error_fn, png_error_ptr warn_fn) -{ -#ifdef PNG_USER_MEM_SUPPORTED - return (png_create_write_struct_2(user_png_ver, error_ptr, error_fn, - warn_fn, png_voidp_NULL, png_malloc_ptr_NULL, png_free_ptr_NULL)); -} - -/* Alternate initialize png_ptr structure, and allocate any memory needed */ -png_structp PNGAPI -png_create_write_struct_2(png_const_charp user_png_ver, png_voidp error_ptr, - png_error_ptr error_fn, png_error_ptr warn_fn, png_voidp mem_ptr, - png_malloc_ptr malloc_fn, png_free_ptr free_fn) -{ -#endif /* PNG_USER_MEM_SUPPORTED */ - png_structp png_ptr; -#ifdef PNG_SETJMP_SUPPORTED -#ifdef USE_FAR_KEYWORD - jmp_buf jmpbuf; -#endif -#endif - int i; - png_debug(1, "in png_create_write_struct\n"); -#ifdef PNG_USER_MEM_SUPPORTED - png_ptr = (png_structp)png_create_struct_2(PNG_STRUCT_PNG, - (png_malloc_ptr)malloc_fn, (png_voidp)mem_ptr); -#else - png_ptr = (png_structp)png_create_struct(PNG_STRUCT_PNG); -#endif /* PNG_USER_MEM_SUPPORTED */ - if (png_ptr == NULL) - return (NULL); - -#if !defined(PNG_1_0_X) -#ifdef PNG_ASSEMBLER_CODE_SUPPORTED - png_init_mmx_flags(png_ptr); /* 1.2.0 addition */ -#endif -#endif /* PNG_1_0_X */ - - /* added at libpng-1.2.6 */ -#ifdef PNG_SET_USER_LIMITS_SUPPORTED - png_ptr->user_width_max=PNG_USER_WIDTH_MAX; - png_ptr->user_height_max=PNG_USER_HEIGHT_MAX; -#endif - -#ifdef PNG_SETJMP_SUPPORTED -#ifdef USE_FAR_KEYWORD - if (setjmp(jmpbuf)) -#else - if (setjmp(png_ptr->jmpbuf)) -#endif - { - png_free(png_ptr, png_ptr->zbuf); - png_ptr->zbuf=NULL; - png_destroy_struct(png_ptr); - return (NULL); - } -#ifdef USE_FAR_KEYWORD - png_memcpy(png_ptr->jmpbuf,jmpbuf,png_sizeof(jmp_buf)); -#endif -#endif - -#ifdef PNG_USER_MEM_SUPPORTED - png_set_mem_fn(png_ptr, mem_ptr, malloc_fn, free_fn); -#endif /* PNG_USER_MEM_SUPPORTED */ - png_set_error_fn(png_ptr, error_ptr, error_fn, warn_fn); - - i=0; - do - { - if(user_png_ver[i] != png_libpng_ver[i]) - png_ptr->flags |= PNG_FLAG_LIBRARY_MISMATCH; - } while (png_libpng_ver[i++]); - - if (png_ptr->flags & PNG_FLAG_LIBRARY_MISMATCH) - { - /* Libpng 0.90 and later are binary incompatible with libpng 0.89, so - * we must recompile any applications that use any older library version. - * For versions after libpng 1.0, we will be compatible, so we need - * only check the first digit. - */ - if (user_png_ver == NULL || user_png_ver[0] != png_libpng_ver[0] || - (user_png_ver[0] == '1' && user_png_ver[2] != png_libpng_ver[2]) || - (user_png_ver[0] == '0' && user_png_ver[2] < '9')) - { -#if !defined(PNG_NO_STDIO) && !defined(_WIN32_WCE) - char msg[80]; - if (user_png_ver) - { - sprintf(msg, "Application was compiled with png.h from libpng-%.20s", - user_png_ver); - png_warning(png_ptr, msg); - } - sprintf(msg, "Application is running with png.c from libpng-%.20s", - png_libpng_ver); - png_warning(png_ptr, msg); -#endif -#ifdef PNG_ERROR_NUMBERS_SUPPORTED - png_ptr->flags=0; -#endif - png_error(png_ptr, - "Incompatible libpng version in application and library"); - } - } - - /* initialize zbuf - compression buffer */ - png_ptr->zbuf_size = PNG_ZBUF_SIZE; - png_ptr->zbuf = (png_bytep)png_malloc(png_ptr, - (png_uint_32)png_ptr->zbuf_size); - - png_set_write_fn(png_ptr, png_voidp_NULL, png_rw_ptr_NULL, - png_flush_ptr_NULL); - -#if defined(PNG_WRITE_WEIGHTED_FILTER_SUPPORTED) - png_set_filter_heuristics(png_ptr, PNG_FILTER_HEURISTIC_DEFAULT, - 1, png_doublep_NULL, png_doublep_NULL); -#endif - -#ifdef PNG_SETJMP_SUPPORTED -/* Applications that neglect to set up their own setjmp() and then encounter - a png_error() will longjmp here. Since the jmpbuf is then meaningless we - abort instead of returning. */ -#ifdef USE_FAR_KEYWORD - if (setjmp(jmpbuf)) - PNG_ABORT(); - png_memcpy(png_ptr->jmpbuf,jmpbuf,png_sizeof(jmp_buf)); -#else - if (setjmp(png_ptr->jmpbuf)) - PNG_ABORT(); -#endif -#endif - return (png_ptr); -} - -/* Initialize png_ptr structure, and allocate any memory needed */ -#undef png_write_init -void PNGAPI -png_write_init(png_structp png_ptr) -{ - /* We only come here via pre-1.0.7-compiled applications */ - png_write_init_2(png_ptr, "1.0.6 or earlier", 0, 0); -} - -void PNGAPI -png_write_init_2(png_structp png_ptr, png_const_charp user_png_ver, - png_size_t png_struct_size, png_size_t png_info_size) -{ - /* We only come here via pre-1.0.12-compiled applications */ -#if !defined(PNG_NO_STDIO) && !defined(_WIN32_WCE) - if(png_sizeof(png_struct) > png_struct_size || - png_sizeof(png_info) > png_info_size) - { - char msg[80]; - png_ptr->warning_fn=NULL; - if (user_png_ver) - { - sprintf(msg, "Application was compiled with png.h from libpng-%.20s", - user_png_ver); - png_warning(png_ptr, msg); - } - sprintf(msg, "Application is running with png.c from libpng-%.20s", - png_libpng_ver); - png_warning(png_ptr, msg); - } -#endif - if(png_sizeof(png_struct) > png_struct_size) - { - png_ptr->error_fn=NULL; -#ifdef PNG_ERROR_NUMBERS_SUPPORTED - png_ptr->flags=0; -#endif - png_error(png_ptr, - "The png struct allocated by the application for writing is too small."); - } - if(png_sizeof(png_info) > png_info_size) - { - png_ptr->error_fn=NULL; -#ifdef PNG_ERROR_NUMBERS_SUPPORTED - png_ptr->flags=0; -#endif - png_error(png_ptr, - "The info struct allocated by the application for writing is too small."); - } - png_write_init_3(&png_ptr, user_png_ver, png_struct_size); -} - - -void PNGAPI -png_write_init_3(png_structpp ptr_ptr, png_const_charp user_png_ver, - png_size_t png_struct_size) -{ - png_structp png_ptr=*ptr_ptr; -#ifdef PNG_SETJMP_SUPPORTED - jmp_buf tmp_jmp; /* to save current jump buffer */ -#endif - int i = 0; - do - { - if (user_png_ver[i] != png_libpng_ver[i]) - { -#ifdef PNG_LEGACY_SUPPORTED - png_ptr->flags |= PNG_FLAG_LIBRARY_MISMATCH; -#else - png_ptr->warning_fn=NULL; - png_warning(png_ptr, - "Application uses deprecated png_write_init() and should be recompiled."); - break; -#endif - } - } while (png_libpng_ver[i++]); - - png_debug(1, "in png_write_init_3\n"); - -#ifdef PNG_SETJMP_SUPPORTED - /* save jump buffer and error functions */ - png_memcpy(tmp_jmp, png_ptr->jmpbuf, png_sizeof (jmp_buf)); -#endif - - if (png_sizeof(png_struct) > png_struct_size) - { - png_destroy_struct(png_ptr); - png_ptr = (png_structp)png_create_struct(PNG_STRUCT_PNG); - *ptr_ptr = png_ptr; - } - - /* reset all variables to 0 */ - png_memset(png_ptr, 0, png_sizeof (png_struct)); - - /* added at libpng-1.2.6 */ -#ifdef PNG_SET_USER_LIMITS_SUPPORTED - png_ptr->user_width_max=PNG_USER_WIDTH_MAX; - png_ptr->user_height_max=PNG_USER_HEIGHT_MAX; -#endif - -#if !defined(PNG_1_0_X) -#ifdef PNG_ASSEMBLER_CODE_SUPPORTED - png_init_mmx_flags(png_ptr); /* 1.2.0 addition */ -#endif -#endif /* PNG_1_0_X */ - -#ifdef PNG_SETJMP_SUPPORTED - /* restore jump buffer */ - png_memcpy(png_ptr->jmpbuf, tmp_jmp, png_sizeof (jmp_buf)); -#endif - - png_set_write_fn(png_ptr, png_voidp_NULL, png_rw_ptr_NULL, - png_flush_ptr_NULL); - - /* initialize zbuf - compression buffer */ - png_ptr->zbuf_size = PNG_ZBUF_SIZE; - png_ptr->zbuf = (png_bytep)png_malloc(png_ptr, - (png_uint_32)png_ptr->zbuf_size); - -#if defined(PNG_WRITE_WEIGHTED_FILTER_SUPPORTED) - png_set_filter_heuristics(png_ptr, PNG_FILTER_HEURISTIC_DEFAULT, - 1, png_doublep_NULL, png_doublep_NULL); -#endif -} - -/* Write a few rows of image data. If the image is interlaced, - * either you will have to write the 7 sub images, or, if you - * have called png_set_interlace_handling(), you will have to - * "write" the image seven times. - */ -void PNGAPI -png_write_rows(png_structp png_ptr, png_bytepp row, - png_uint_32 num_rows) -{ - png_uint_32 i; /* row counter */ - png_bytepp rp; /* row pointer */ - - png_debug(1, "in png_write_rows\n"); - /* loop through the rows */ - for (i = 0, rp = row; i < num_rows; i++, rp++) - { - png_write_row(png_ptr, *rp); - } -} - -/* Write the image. You only need to call this function once, even - * if you are writing an interlaced image. - */ -void PNGAPI -png_write_image(png_structp png_ptr, png_bytepp image) -{ - png_uint_32 i; /* row index */ - int pass, num_pass; /* pass variables */ - png_bytepp rp; /* points to current row */ - - png_debug(1, "in png_write_image\n"); -#if defined(PNG_WRITE_INTERLACING_SUPPORTED) - /* intialize interlace handling. If image is not interlaced, - this will set pass to 1 */ - num_pass = png_set_interlace_handling(png_ptr); -#else - num_pass = 1; -#endif - /* loop through passes */ - for (pass = 0; pass < num_pass; pass++) - { - /* loop through image */ - for (i = 0, rp = image; i < png_ptr->height; i++, rp++) - { - png_write_row(png_ptr, *rp); - } - } -} - -/* called by user to write a row of image data */ -void PNGAPI -png_write_row(png_structp png_ptr, png_bytep row) -{ - png_debug2(1, "in png_write_row (row %ld, pass %d)\n", - png_ptr->row_number, png_ptr->pass); - /* initialize transformations and other stuff if first time */ - if (png_ptr->row_number == 0 && png_ptr->pass == 0) - { - /* make sure we wrote the header info */ - if (!(png_ptr->mode & PNG_WROTE_INFO_BEFORE_PLTE)) - png_error(png_ptr, - "png_write_info was never called before png_write_row."); - - /* check for transforms that have been set but were defined out */ -#if !defined(PNG_WRITE_INVERT_SUPPORTED) && defined(PNG_READ_INVERT_SUPPORTED) - if (png_ptr->transformations & PNG_INVERT_MONO) - png_warning(png_ptr, "PNG_WRITE_INVERT_SUPPORTED is not defined."); -#endif -#if !defined(PNG_WRITE_FILLER_SUPPORTED) && defined(PNG_READ_FILLER_SUPPORTED) - if (png_ptr->transformations & PNG_FILLER) - png_warning(png_ptr, "PNG_WRITE_FILLER_SUPPORTED is not defined."); -#endif -#if !defined(PNG_WRITE_PACKSWAP_SUPPORTED) && defined(PNG_READ_PACKSWAP_SUPPORTED) - if (png_ptr->transformations & PNG_PACKSWAP) - png_warning(png_ptr, "PNG_WRITE_PACKSWAP_SUPPORTED is not defined."); -#endif -#if !defined(PNG_WRITE_PACK_SUPPORTED) && defined(PNG_READ_PACK_SUPPORTED) - if (png_ptr->transformations & PNG_PACK) - png_warning(png_ptr, "PNG_WRITE_PACK_SUPPORTED is not defined."); -#endif -#if !defined(PNG_WRITE_SHIFT_SUPPORTED) && defined(PNG_READ_SHIFT_SUPPORTED) - if (png_ptr->transformations & PNG_SHIFT) - png_warning(png_ptr, "PNG_WRITE_SHIFT_SUPPORTED is not defined."); -#endif -#if !defined(PNG_WRITE_BGR_SUPPORTED) && defined(PNG_READ_BGR_SUPPORTED) - if (png_ptr->transformations & PNG_BGR) - png_warning(png_ptr, "PNG_WRITE_BGR_SUPPORTED is not defined."); -#endif -#if !defined(PNG_WRITE_SWAP_SUPPORTED) && defined(PNG_READ_SWAP_SUPPORTED) - if (png_ptr->transformations & PNG_SWAP_BYTES) - png_warning(png_ptr, "PNG_WRITE_SWAP_SUPPORTED is not defined."); -#endif - - png_write_start_row(png_ptr); - } - -#if defined(PNG_WRITE_INTERLACING_SUPPORTED) - /* if interlaced and not interested in row, return */ - if (png_ptr->interlaced && (png_ptr->transformations & PNG_INTERLACE)) - { - switch (png_ptr->pass) - { - case 0: - if (png_ptr->row_number & 0x07) - { - png_write_finish_row(png_ptr); - return; - } - break; - case 1: - if ((png_ptr->row_number & 0x07) || png_ptr->width < 5) - { - png_write_finish_row(png_ptr); - return; - } - break; - case 2: - if ((png_ptr->row_number & 0x07) != 4) - { - png_write_finish_row(png_ptr); - return; - } - break; - case 3: - if ((png_ptr->row_number & 0x03) || png_ptr->width < 3) - { - png_write_finish_row(png_ptr); - return; - } - break; - case 4: - if ((png_ptr->row_number & 0x03) != 2) - { - png_write_finish_row(png_ptr); - return; - } - break; - case 5: - if ((png_ptr->row_number & 0x01) || png_ptr->width < 2) - { - png_write_finish_row(png_ptr); - return; - } - break; - case 6: - if (!(png_ptr->row_number & 0x01)) - { - png_write_finish_row(png_ptr); - return; - } - break; - } - } -#endif - - /* set up row info for transformations */ - png_ptr->row_info.color_type = png_ptr->color_type; - png_ptr->row_info.width = png_ptr->usr_width; - png_ptr->row_info.channels = png_ptr->usr_channels; - png_ptr->row_info.bit_depth = png_ptr->usr_bit_depth; - png_ptr->row_info.pixel_depth = (png_byte)(png_ptr->row_info.bit_depth * - png_ptr->row_info.channels); - - png_ptr->row_info.rowbytes = PNG_ROWBYTES(png_ptr->row_info.pixel_depth, - png_ptr->row_info.width); - - png_debug1(3, "row_info->color_type = %d\n", png_ptr->row_info.color_type); - png_debug1(3, "row_info->width = %lu\n", png_ptr->row_info.width); - png_debug1(3, "row_info->channels = %d\n", png_ptr->row_info.channels); - png_debug1(3, "row_info->bit_depth = %d\n", png_ptr->row_info.bit_depth); - png_debug1(3, "row_info->pixel_depth = %d\n", png_ptr->row_info.pixel_depth); - png_debug1(3, "row_info->rowbytes = %lu\n", png_ptr->row_info.rowbytes); - - /* Copy user's row into buffer, leaving room for filter byte. */ - png_memcpy_check(png_ptr, png_ptr->row_buf + 1, row, - png_ptr->row_info.rowbytes); - -#if defined(PNG_WRITE_INTERLACING_SUPPORTED) - /* handle interlacing */ - if (png_ptr->interlaced && png_ptr->pass < 6 && - (png_ptr->transformations & PNG_INTERLACE)) - { - png_do_write_interlace(&(png_ptr->row_info), - png_ptr->row_buf + 1, png_ptr->pass); - /* this should always get caught above, but still ... */ - if (!(png_ptr->row_info.width)) - { - png_write_finish_row(png_ptr); - return; - } - } -#endif - - /* handle other transformations */ - if (png_ptr->transformations) - png_do_write_transformations(png_ptr); - -#if defined(PNG_MNG_FEATURES_SUPPORTED) - /* Write filter_method 64 (intrapixel differencing) only if - * 1. Libpng was compiled with PNG_MNG_FEATURES_SUPPORTED and - * 2. Libpng did not write a PNG signature (this filter_method is only - * used in PNG datastreams that are embedded in MNG datastreams) and - * 3. The application called png_permit_mng_features with a mask that - * included PNG_FLAG_MNG_FILTER_64 and - * 4. The filter_method is 64 and - * 5. The color_type is RGB or RGBA - */ - if((png_ptr->mng_features_permitted & PNG_FLAG_MNG_FILTER_64) && - (png_ptr->filter_type == PNG_INTRAPIXEL_DIFFERENCING)) - { - /* Intrapixel differencing */ - png_do_write_intrapixel(&(png_ptr->row_info), png_ptr->row_buf + 1); - } -#endif - - /* Find a filter if necessary, filter the row and write it out. */ - png_write_find_filter(png_ptr, &(png_ptr->row_info)); - - if (png_ptr->write_row_fn != NULL) - (*(png_ptr->write_row_fn))(png_ptr, png_ptr->row_number, png_ptr->pass); -} - -#if defined(PNG_WRITE_FLUSH_SUPPORTED) -/* Set the automatic flush interval or 0 to turn flushing off */ -void PNGAPI -png_set_flush(png_structp png_ptr, int nrows) -{ - png_debug(1, "in png_set_flush\n"); - png_ptr->flush_dist = (nrows < 0 ? 0 : nrows); -} - -/* flush the current output buffers now */ -void PNGAPI -png_write_flush(png_structp png_ptr) -{ - int wrote_IDAT; - - png_debug(1, "in png_write_flush\n"); - /* We have already written out all of the data */ - if (png_ptr->row_number >= png_ptr->num_rows) - return; - - do - { - int ret; - - /* compress the data */ - ret = deflate(&png_ptr->zstream, Z_SYNC_FLUSH); - wrote_IDAT = 0; - - /* check for compression errors */ - if (ret != Z_OK) - { - if (png_ptr->zstream.msg != NULL) - png_error(png_ptr, png_ptr->zstream.msg); - else - png_error(png_ptr, "zlib error"); - } - - if (!(png_ptr->zstream.avail_out)) - { - /* write the IDAT and reset the zlib output buffer */ - png_write_IDAT(png_ptr, png_ptr->zbuf, - png_ptr->zbuf_size); - png_ptr->zstream.next_out = png_ptr->zbuf; - png_ptr->zstream.avail_out = (uInt)png_ptr->zbuf_size; - wrote_IDAT = 1; - } - } while(wrote_IDAT == 1); - - /* If there is any data left to be output, write it into a new IDAT */ - if (png_ptr->zbuf_size != png_ptr->zstream.avail_out) - { - /* write the IDAT and reset the zlib output buffer */ - png_write_IDAT(png_ptr, png_ptr->zbuf, - png_ptr->zbuf_size - png_ptr->zstream.avail_out); - png_ptr->zstream.next_out = png_ptr->zbuf; - png_ptr->zstream.avail_out = (uInt)png_ptr->zbuf_size; - } - png_ptr->flush_rows = 0; - png_flush(png_ptr); -} -#endif /* PNG_WRITE_FLUSH_SUPPORTED */ - -/* free all memory used by the write */ -void PNGAPI -png_destroy_write_struct(png_structpp png_ptr_ptr, png_infopp info_ptr_ptr) -{ - png_structp png_ptr = NULL; - png_infop info_ptr = NULL; -#ifdef PNG_USER_MEM_SUPPORTED - png_free_ptr free_fn = NULL; - png_voidp mem_ptr = NULL; -#endif - - png_debug(1, "in png_destroy_write_struct\n"); - if (png_ptr_ptr != NULL) - { - png_ptr = *png_ptr_ptr; -#ifdef PNG_USER_MEM_SUPPORTED - free_fn = png_ptr->free_fn; - mem_ptr = png_ptr->mem_ptr; -#endif - } - - if (info_ptr_ptr != NULL) - info_ptr = *info_ptr_ptr; - - if (info_ptr != NULL) - { - png_free_data(png_ptr, info_ptr, PNG_FREE_ALL, -1); - -#if defined(PNG_UNKNOWN_CHUNKS_SUPPORTED) - if (png_ptr->num_chunk_list) - { - png_free(png_ptr, png_ptr->chunk_list); - png_ptr->chunk_list=NULL; - png_ptr->num_chunk_list=0; - } -#endif - -#ifdef PNG_USER_MEM_SUPPORTED - png_destroy_struct_2((png_voidp)info_ptr, (png_free_ptr)free_fn, - (png_voidp)mem_ptr); -#else - png_destroy_struct((png_voidp)info_ptr); -#endif - *info_ptr_ptr = NULL; - } - - if (png_ptr != NULL) - { - png_write_destroy(png_ptr); -#ifdef PNG_USER_MEM_SUPPORTED - png_destroy_struct_2((png_voidp)png_ptr, (png_free_ptr)free_fn, - (png_voidp)mem_ptr); -#else - png_destroy_struct((png_voidp)png_ptr); -#endif - *png_ptr_ptr = NULL; - } -} - - -/* Free any memory used in png_ptr struct (old method) */ -void /* PRIVATE */ -png_write_destroy(png_structp png_ptr) -{ -#ifdef PNG_SETJMP_SUPPORTED - jmp_buf tmp_jmp; /* save jump buffer */ -#endif - png_error_ptr error_fn; - png_error_ptr warning_fn; - png_voidp error_ptr; -#ifdef PNG_USER_MEM_SUPPORTED - png_free_ptr free_fn; -#endif - - png_debug(1, "in png_write_destroy\n"); - /* free any memory zlib uses */ - deflateEnd(&png_ptr->zstream); - - /* free our memory. png_free checks NULL for us. */ - png_free(png_ptr, png_ptr->zbuf); - png_free(png_ptr, png_ptr->row_buf); - png_free(png_ptr, png_ptr->prev_row); - png_free(png_ptr, png_ptr->sub_row); - png_free(png_ptr, png_ptr->up_row); - png_free(png_ptr, png_ptr->avg_row); - png_free(png_ptr, png_ptr->paeth_row); - -#if defined(PNG_TIME_RFC1123_SUPPORTED) - png_free(png_ptr, png_ptr->time_buffer); -#endif - -#if defined(PNG_WRITE_WEIGHTED_FILTER_SUPPORTED) - png_free(png_ptr, png_ptr->prev_filters); - png_free(png_ptr, png_ptr->filter_weights); - png_free(png_ptr, png_ptr->inv_filter_weights); - png_free(png_ptr, png_ptr->filter_costs); - png_free(png_ptr, png_ptr->inv_filter_costs); -#endif - -#ifdef PNG_SETJMP_SUPPORTED - /* reset structure */ - png_memcpy(tmp_jmp, png_ptr->jmpbuf, png_sizeof (jmp_buf)); -#endif - - error_fn = png_ptr->error_fn; - warning_fn = png_ptr->warning_fn; - error_ptr = png_ptr->error_ptr; -#ifdef PNG_USER_MEM_SUPPORTED - free_fn = png_ptr->free_fn; -#endif - - png_memset(png_ptr, 0, png_sizeof (png_struct)); - - png_ptr->error_fn = error_fn; - png_ptr->warning_fn = warning_fn; - png_ptr->error_ptr = error_ptr; -#ifdef PNG_USER_MEM_SUPPORTED - png_ptr->free_fn = free_fn; -#endif - -#ifdef PNG_SETJMP_SUPPORTED - png_memcpy(png_ptr->jmpbuf, tmp_jmp, png_sizeof (jmp_buf)); -#endif -} - -/* Allow the application to select one or more row filters to use. */ -void PNGAPI -png_set_filter(png_structp png_ptr, int method, int filters) -{ - png_debug(1, "in png_set_filter\n"); -#if defined(PNG_MNG_FEATURES_SUPPORTED) - if((png_ptr->mng_features_permitted & PNG_FLAG_MNG_FILTER_64) && - (method == PNG_INTRAPIXEL_DIFFERENCING)) - method = PNG_FILTER_TYPE_BASE; -#endif - if (method == PNG_FILTER_TYPE_BASE) - { - switch (filters & (PNG_ALL_FILTERS | 0x07)) - { - case 5: - case 6: - case 7: png_warning(png_ptr, "Unknown row filter for method 0"); - case PNG_FILTER_VALUE_NONE: png_ptr->do_filter=PNG_FILTER_NONE; break; - case PNG_FILTER_VALUE_SUB: png_ptr->do_filter=PNG_FILTER_SUB; break; - case PNG_FILTER_VALUE_UP: png_ptr->do_filter=PNG_FILTER_UP; break; - case PNG_FILTER_VALUE_AVG: png_ptr->do_filter=PNG_FILTER_AVG; break; - case PNG_FILTER_VALUE_PAETH: png_ptr->do_filter=PNG_FILTER_PAETH;break; - default: png_ptr->do_filter = (png_byte)filters; break; - } - - /* If we have allocated the row_buf, this means we have already started - * with the image and we should have allocated all of the filter buffers - * that have been selected. If prev_row isn't already allocated, then - * it is too late to start using the filters that need it, since we - * will be missing the data in the previous row. If an application - * wants to start and stop using particular filters during compression, - * it should start out with all of the filters, and then add and - * remove them after the start of compression. - */ - if (png_ptr->row_buf != NULL) - { - if ((png_ptr->do_filter & PNG_FILTER_SUB) && png_ptr->sub_row == NULL) - { - png_ptr->sub_row = (png_bytep)png_malloc(png_ptr, - (png_ptr->rowbytes + 1)); - png_ptr->sub_row[0] = PNG_FILTER_VALUE_SUB; - } - - if ((png_ptr->do_filter & PNG_FILTER_UP) && png_ptr->up_row == NULL) - { - if (png_ptr->prev_row == NULL) - { - png_warning(png_ptr, "Can't add Up filter after starting"); - png_ptr->do_filter &= ~PNG_FILTER_UP; - } - else - { - png_ptr->up_row = (png_bytep)png_malloc(png_ptr, - (png_ptr->rowbytes + 1)); - png_ptr->up_row[0] = PNG_FILTER_VALUE_UP; - } - } - - if ((png_ptr->do_filter & PNG_FILTER_AVG) && png_ptr->avg_row == NULL) - { - if (png_ptr->prev_row == NULL) - { - png_warning(png_ptr, "Can't add Average filter after starting"); - png_ptr->do_filter &= ~PNG_FILTER_AVG; - } - else - { - png_ptr->avg_row = (png_bytep)png_malloc(png_ptr, - (png_ptr->rowbytes + 1)); - png_ptr->avg_row[0] = PNG_FILTER_VALUE_AVG; - } - } - - if ((png_ptr->do_filter & PNG_FILTER_PAETH) && - png_ptr->paeth_row == NULL) - { - if (png_ptr->prev_row == NULL) - { - png_warning(png_ptr, "Can't add Paeth filter after starting"); - png_ptr->do_filter &= (png_byte)(~PNG_FILTER_PAETH); - } - else - { - png_ptr->paeth_row = (png_bytep)png_malloc(png_ptr, - (png_ptr->rowbytes + 1)); - png_ptr->paeth_row[0] = PNG_FILTER_VALUE_PAETH; - } - } - - if (png_ptr->do_filter == PNG_NO_FILTERS) - png_ptr->do_filter = PNG_FILTER_NONE; - } - } - else - png_error(png_ptr, "Unknown custom filter method"); -} - -/* This allows us to influence the way in which libpng chooses the "best" - * filter for the current scanline. While the "minimum-sum-of-absolute- - * differences metric is relatively fast and effective, there is some - * question as to whether it can be improved upon by trying to keep the - * filtered data going to zlib more consistent, hopefully resulting in - * better compression. - */ -#if defined(PNG_WRITE_WEIGHTED_FILTER_SUPPORTED) /* GRR 970116 */ -void PNGAPI -png_set_filter_heuristics(png_structp png_ptr, int heuristic_method, - int num_weights, png_doublep filter_weights, - png_doublep filter_costs) -{ - int i; - - png_debug(1, "in png_set_filter_heuristics\n"); - if (heuristic_method >= PNG_FILTER_HEURISTIC_LAST) - { - png_warning(png_ptr, "Unknown filter heuristic method"); - return; - } - - if (heuristic_method == PNG_FILTER_HEURISTIC_DEFAULT) - { - heuristic_method = PNG_FILTER_HEURISTIC_UNWEIGHTED; - } - - if (num_weights < 0 || filter_weights == NULL || - heuristic_method == PNG_FILTER_HEURISTIC_UNWEIGHTED) - { - num_weights = 0; - } - - png_ptr->num_prev_filters = (png_byte)num_weights; - png_ptr->heuristic_method = (png_byte)heuristic_method; - - if (num_weights > 0) - { - if (png_ptr->prev_filters == NULL) - { - png_ptr->prev_filters = (png_bytep)png_malloc(png_ptr, - (png_uint_32)(png_sizeof(png_byte) * num_weights)); - - /* To make sure that the weighting starts out fairly */ - for (i = 0; i < num_weights; i++) - { - png_ptr->prev_filters[i] = 255; - } - } - - if (png_ptr->filter_weights == NULL) - { - png_ptr->filter_weights = (png_uint_16p)png_malloc(png_ptr, - (png_uint_32)(png_sizeof(png_uint_16) * num_weights)); - - png_ptr->inv_filter_weights = (png_uint_16p)png_malloc(png_ptr, - (png_uint_32)(png_sizeof(png_uint_16) * num_weights)); - for (i = 0; i < num_weights; i++) - { - png_ptr->inv_filter_weights[i] = - png_ptr->filter_weights[i] = PNG_WEIGHT_FACTOR; - } - } - - for (i = 0; i < num_weights; i++) - { - if (filter_weights[i] < 0.0) - { - png_ptr->inv_filter_weights[i] = - png_ptr->filter_weights[i] = PNG_WEIGHT_FACTOR; - } - else - { - png_ptr->inv_filter_weights[i] = - (png_uint_16)((double)PNG_WEIGHT_FACTOR*filter_weights[i]+0.5); - png_ptr->filter_weights[i] = - (png_uint_16)((double)PNG_WEIGHT_FACTOR/filter_weights[i]+0.5); - } - } - } - - /* If, in the future, there are other filter methods, this would - * need to be based on png_ptr->filter. - */ - if (png_ptr->filter_costs == NULL) - { - png_ptr->filter_costs = (png_uint_16p)png_malloc(png_ptr, - (png_uint_32)(png_sizeof(png_uint_16) * PNG_FILTER_VALUE_LAST)); - - png_ptr->inv_filter_costs = (png_uint_16p)png_malloc(png_ptr, - (png_uint_32)(png_sizeof(png_uint_16) * PNG_FILTER_VALUE_LAST)); - - for (i = 0; i < PNG_FILTER_VALUE_LAST; i++) - { - png_ptr->inv_filter_costs[i] = - png_ptr->filter_costs[i] = PNG_COST_FACTOR; - } - } - - /* Here is where we set the relative costs of the different filters. We - * should take the desired compression level into account when setting - * the costs, so that Paeth, for instance, has a high relative cost at low - * compression levels, while it has a lower relative cost at higher - * compression settings. The filter types are in order of increasing - * relative cost, so it would be possible to do this with an algorithm. - */ - for (i = 0; i < PNG_FILTER_VALUE_LAST; i++) - { - if (filter_costs == NULL || filter_costs[i] < 0.0) - { - png_ptr->inv_filter_costs[i] = - png_ptr->filter_costs[i] = PNG_COST_FACTOR; - } - else if (filter_costs[i] >= 1.0) - { - png_ptr->inv_filter_costs[i] = - (png_uint_16)((double)PNG_COST_FACTOR / filter_costs[i] + 0.5); - png_ptr->filter_costs[i] = - (png_uint_16)((double)PNG_COST_FACTOR * filter_costs[i] + 0.5); - } - } -} -#endif /* PNG_WRITE_WEIGHTED_FILTER_SUPPORTED */ - -void PNGAPI -png_set_compression_level(png_structp png_ptr, int level) -{ - png_debug(1, "in png_set_compression_level\n"); - png_ptr->flags |= PNG_FLAG_ZLIB_CUSTOM_LEVEL; - png_ptr->zlib_level = level; -} - -void PNGAPI -png_set_compression_mem_level(png_structp png_ptr, int mem_level) -{ - png_debug(1, "in png_set_compression_mem_level\n"); - png_ptr->flags |= PNG_FLAG_ZLIB_CUSTOM_MEM_LEVEL; - png_ptr->zlib_mem_level = mem_level; -} - -void PNGAPI -png_set_compression_strategy(png_structp png_ptr, int strategy) -{ - png_debug(1, "in png_set_compression_strategy\n"); - png_ptr->flags |= PNG_FLAG_ZLIB_CUSTOM_STRATEGY; - png_ptr->zlib_strategy = strategy; -} - -void PNGAPI -png_set_compression_window_bits(png_structp png_ptr, int window_bits) -{ - if (window_bits > 15) - png_warning(png_ptr, "Only compression windows <= 32k supported by PNG"); - else if (window_bits < 8) - png_warning(png_ptr, "Only compression windows >= 256 supported by PNG"); -#ifndef WBITS_8_OK - /* avoid libpng bug with 256-byte windows */ - if (window_bits == 8) - { - png_warning(png_ptr, "Compression window is being reset to 512"); - window_bits=9; - } -#endif - png_ptr->flags |= PNG_FLAG_ZLIB_CUSTOM_WINDOW_BITS; - png_ptr->zlib_window_bits = window_bits; -} - -void PNGAPI -png_set_compression_method(png_structp png_ptr, int method) -{ - png_debug(1, "in png_set_compression_method\n"); - if (method != 8) - png_warning(png_ptr, "Only compression method 8 is supported by PNG"); - png_ptr->flags |= PNG_FLAG_ZLIB_CUSTOM_METHOD; - png_ptr->zlib_method = method; -} - -void PNGAPI -png_set_write_status_fn(png_structp png_ptr, png_write_status_ptr write_row_fn) -{ - png_ptr->write_row_fn = write_row_fn; -} - -#if defined(PNG_WRITE_USER_TRANSFORM_SUPPORTED) -void PNGAPI -png_set_write_user_transform_fn(png_structp png_ptr, png_user_transform_ptr - write_user_transform_fn) -{ - png_debug(1, "in png_set_write_user_transform_fn\n"); - png_ptr->transformations |= PNG_USER_TRANSFORM; - png_ptr->write_user_transform_fn = write_user_transform_fn; -} -#endif - - -#if defined(PNG_INFO_IMAGE_SUPPORTED) -void PNGAPI -png_write_png(png_structp png_ptr, png_infop info_ptr, - int transforms, voidp params) -{ -#if defined(PNG_WRITE_INVERT_ALPHA_SUPPORTED) - /* invert the alpha channel from opacity to transparency */ - if (transforms & PNG_TRANSFORM_INVERT_ALPHA) - png_set_invert_alpha(png_ptr); -#endif - - /* Write the file header information. */ - png_write_info(png_ptr, info_ptr); - - /* ------ these transformations don't touch the info structure ------- */ - -#if defined(PNG_WRITE_INVERT_SUPPORTED) - /* invert monochrome pixels */ - if (transforms & PNG_TRANSFORM_INVERT_MONO) - png_set_invert_mono(png_ptr); -#endif - -#if defined(PNG_WRITE_SHIFT_SUPPORTED) - /* Shift the pixels up to a legal bit depth and fill in - * as appropriate to correctly scale the image. - */ - if ((transforms & PNG_TRANSFORM_SHIFT) - && (info_ptr->valid & PNG_INFO_sBIT)) - png_set_shift(png_ptr, &info_ptr->sig_bit); -#endif - -#if defined(PNG_WRITE_PACK_SUPPORTED) - /* pack pixels into bytes */ - if (transforms & PNG_TRANSFORM_PACKING) - png_set_packing(png_ptr); -#endif - -#if defined(PNG_WRITE_SWAP_ALPHA_SUPPORTED) - /* swap location of alpha bytes from ARGB to RGBA */ - if (transforms & PNG_TRANSFORM_SWAP_ALPHA) - png_set_swap_alpha(png_ptr); -#endif - -#if defined(PNG_WRITE_FILLER_SUPPORTED) - /* Get rid of filler (OR ALPHA) bytes, pack XRGB/RGBX/ARGB/RGBA into - * RGB (4 channels -> 3 channels). The second parameter is not used. - */ - if (transforms & PNG_TRANSFORM_STRIP_FILLER) - png_set_filler(png_ptr, 0, PNG_FILLER_BEFORE); -#endif - -#if defined(PNG_WRITE_BGR_SUPPORTED) - /* flip BGR pixels to RGB */ - if (transforms & PNG_TRANSFORM_BGR) - png_set_bgr(png_ptr); -#endif - -#if defined(PNG_WRITE_SWAP_SUPPORTED) - /* swap bytes of 16-bit files to most significant byte first */ - if (transforms & PNG_TRANSFORM_SWAP_ENDIAN) - png_set_swap(png_ptr); -#endif - -#if defined(PNG_WRITE_PACKSWAP_SUPPORTED) - /* swap bits of 1, 2, 4 bit packed pixel formats */ - if (transforms & PNG_TRANSFORM_PACKSWAP) - png_set_packswap(png_ptr); -#endif - - /* ----------------------- end of transformations ------------------- */ - - /* write the bits */ - if (info_ptr->valid & PNG_INFO_IDAT) - png_write_image(png_ptr, info_ptr->row_pointers); - - /* It is REQUIRED to call this to finish writing the rest of the file */ - png_write_end(png_ptr, info_ptr); - - if(transforms == 0 || params == NULL) - /* quiet compiler warnings */ return; -} -#endif -#endif /* PNG_WRITE_SUPPORTED */ diff --git a/wxWidgets/src/png/pngwtran.c b/wxWidgets/src/png/pngwtran.c deleted file mode 100644 index 94d8ecc1ce..0000000000 --- a/wxWidgets/src/png/pngwtran.c +++ /dev/null @@ -1,563 +0,0 @@ - -/* pngwtran.c - transforms the data in a row for PNG writers - * - * libpng version 1.2.7 - September 12, 2004 - * For conditions of distribution and use, see copyright notice in png.h - * Copyright (c) 1998-2004 Glenn Randers-Pehrson - * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) - * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) - */ - -#define PNG_INTERNAL -#include "png.h" -#ifdef PNG_WRITE_SUPPORTED - -/* Transform the data according to the user's wishes. The order of - * transformations is significant. - */ -void /* PRIVATE */ -png_do_write_transformations(png_structp png_ptr) -{ - png_debug(1, "in png_do_write_transformations\n"); - - if (png_ptr == NULL) - return; - -#if defined(PNG_WRITE_USER_TRANSFORM_SUPPORTED) - if (png_ptr->transformations & PNG_USER_TRANSFORM) - if(png_ptr->write_user_transform_fn != NULL) - (*(png_ptr->write_user_transform_fn)) /* user write transform function */ - (png_ptr, /* png_ptr */ - &(png_ptr->row_info), /* row_info: */ - /* png_uint_32 width; width of row */ - /* png_uint_32 rowbytes; number of bytes in row */ - /* png_byte color_type; color type of pixels */ - /* png_byte bit_depth; bit depth of samples */ - /* png_byte channels; number of channels (1-4) */ - /* png_byte pixel_depth; bits per pixel (depth*channels) */ - png_ptr->row_buf + 1); /* start of pixel data for row */ -#endif -#if defined(PNG_WRITE_FILLER_SUPPORTED) - if (png_ptr->transformations & PNG_FILLER) - png_do_strip_filler(&(png_ptr->row_info), png_ptr->row_buf + 1, - png_ptr->flags); -#endif -#if defined(PNG_WRITE_PACKSWAP_SUPPORTED) - if (png_ptr->transformations & PNG_PACKSWAP) - png_do_packswap(&(png_ptr->row_info), png_ptr->row_buf + 1); -#endif -#if defined(PNG_WRITE_PACK_SUPPORTED) - if (png_ptr->transformations & PNG_PACK) - png_do_pack(&(png_ptr->row_info), png_ptr->row_buf + 1, - (png_uint_32)png_ptr->bit_depth); -#endif -#if defined(PNG_WRITE_SWAP_SUPPORTED) - if (png_ptr->transformations & PNG_SWAP_BYTES) - png_do_swap(&(png_ptr->row_info), png_ptr->row_buf + 1); -#endif -#if defined(PNG_WRITE_SHIFT_SUPPORTED) - if (png_ptr->transformations & PNG_SHIFT) - png_do_shift(&(png_ptr->row_info), png_ptr->row_buf + 1, - &(png_ptr->shift)); -#endif -#if defined(PNG_WRITE_INVERT_ALPHA_SUPPORTED) - if (png_ptr->transformations & PNG_INVERT_ALPHA) - png_do_write_invert_alpha(&(png_ptr->row_info), png_ptr->row_buf + 1); -#endif -#if defined(PNG_WRITE_SWAP_ALPHA_SUPPORTED) - if (png_ptr->transformations & PNG_SWAP_ALPHA) - png_do_write_swap_alpha(&(png_ptr->row_info), png_ptr->row_buf + 1); -#endif -#if defined(PNG_WRITE_BGR_SUPPORTED) - if (png_ptr->transformations & PNG_BGR) - png_do_bgr(&(png_ptr->row_info), png_ptr->row_buf + 1); -#endif -#if defined(PNG_WRITE_INVERT_SUPPORTED) - if (png_ptr->transformations & PNG_INVERT_MONO) - png_do_invert(&(png_ptr->row_info), png_ptr->row_buf + 1); -#endif -} - -#if defined(PNG_WRITE_PACK_SUPPORTED) -/* Pack pixels into bytes. Pass the true bit depth in bit_depth. The - * row_info bit depth should be 8 (one pixel per byte). The channels - * should be 1 (this only happens on grayscale and paletted images). - */ -void /* PRIVATE */ -png_do_pack(png_row_infop row_info, png_bytep row, png_uint_32 bit_depth) -{ - png_debug(1, "in png_do_pack\n"); - if (row_info->bit_depth == 8 && -#if defined(PNG_USELESS_TESTS_SUPPORTED) - row != NULL && row_info != NULL && -#endif - row_info->channels == 1) - { - switch ((int)bit_depth) - { - case 1: - { - png_bytep sp, dp; - int mask, v; - png_uint_32 i; - png_uint_32 row_width = row_info->width; - - sp = row; - dp = row; - mask = 0x80; - v = 0; - - for (i = 0; i < row_width; i++) - { - if (*sp != 0) - v |= mask; - sp++; - if (mask > 1) - mask >>= 1; - else - { - mask = 0x80; - *dp = (png_byte)v; - dp++; - v = 0; - } - } - if (mask != 0x80) - *dp = (png_byte)v; - break; - } - case 2: - { - png_bytep sp, dp; - int shift, v; - png_uint_32 i; - png_uint_32 row_width = row_info->width; - - sp = row; - dp = row; - shift = 6; - v = 0; - for (i = 0; i < row_width; i++) - { - png_byte value; - - value = (png_byte)(*sp & 0x03); - v |= (value << shift); - if (shift == 0) - { - shift = 6; - *dp = (png_byte)v; - dp++; - v = 0; - } - else - shift -= 2; - sp++; - } - if (shift != 6) - *dp = (png_byte)v; - break; - } - case 4: - { - png_bytep sp, dp; - int shift, v; - png_uint_32 i; - png_uint_32 row_width = row_info->width; - - sp = row; - dp = row; - shift = 4; - v = 0; - for (i = 0; i < row_width; i++) - { - png_byte value; - - value = (png_byte)(*sp & 0x0f); - v |= (value << shift); - - if (shift == 0) - { - shift = 4; - *dp = (png_byte)v; - dp++; - v = 0; - } - else - shift -= 4; - - sp++; - } - if (shift != 4) - *dp = (png_byte)v; - break; - } - } - row_info->bit_depth = (png_byte)bit_depth; - row_info->pixel_depth = (png_byte)(bit_depth * row_info->channels); - row_info->rowbytes = PNG_ROWBYTES(row_info->pixel_depth, - row_info->width); - } -} -#endif - -#if defined(PNG_WRITE_SHIFT_SUPPORTED) -/* Shift pixel values to take advantage of whole range. Pass the - * true number of bits in bit_depth. The row should be packed - * according to row_info->bit_depth. Thus, if you had a row of - * bit depth 4, but the pixels only had values from 0 to 7, you - * would pass 3 as bit_depth, and this routine would translate the - * data to 0 to 15. - */ -void /* PRIVATE */ -png_do_shift(png_row_infop row_info, png_bytep row, png_color_8p bit_depth) -{ - png_debug(1, "in png_do_shift\n"); -#if defined(PNG_USELESS_TESTS_SUPPORTED) - if (row != NULL && row_info != NULL && -#else - if ( -#endif - row_info->color_type != PNG_COLOR_TYPE_PALETTE) - { - int shift_start[4], shift_dec[4]; - int channels = 0; - - if (row_info->color_type & PNG_COLOR_MASK_COLOR) - { - shift_start[channels] = row_info->bit_depth - bit_depth->red; - shift_dec[channels] = bit_depth->red; - channels++; - shift_start[channels] = row_info->bit_depth - bit_depth->green; - shift_dec[channels] = bit_depth->green; - channels++; - shift_start[channels] = row_info->bit_depth - bit_depth->blue; - shift_dec[channels] = bit_depth->blue; - channels++; - } - else - { - shift_start[channels] = row_info->bit_depth - bit_depth->gray; - shift_dec[channels] = bit_depth->gray; - channels++; - } - if (row_info->color_type & PNG_COLOR_MASK_ALPHA) - { - shift_start[channels] = row_info->bit_depth - bit_depth->alpha; - shift_dec[channels] = bit_depth->alpha; - channels++; - } - - /* with low row depths, could only be grayscale, so one channel */ - if (row_info->bit_depth < 8) - { - png_bytep bp = row; - png_uint_32 i; - png_byte mask; - png_uint_32 row_bytes = row_info->rowbytes; - - if (bit_depth->gray == 1 && row_info->bit_depth == 2) - mask = 0x55; - else if (row_info->bit_depth == 4 && bit_depth->gray == 3) - mask = 0x11; - else - mask = 0xff; - - for (i = 0; i < row_bytes; i++, bp++) - { - png_uint_16 v; - int j; - - v = *bp; - *bp = 0; - for (j = shift_start[0]; j > -shift_dec[0]; j -= shift_dec[0]) - { - if (j > 0) - *bp |= (png_byte)((v << j) & 0xff); - else - *bp |= (png_byte)((v >> (-j)) & mask); - } - } - } - else if (row_info->bit_depth == 8) - { - png_bytep bp = row; - png_uint_32 i; - png_uint_32 istop = channels * row_info->width; - - for (i = 0; i < istop; i++, bp++) - { - - png_uint_16 v; - int j; - int c = (int)(i%channels); - - v = *bp; - *bp = 0; - for (j = shift_start[c]; j > -shift_dec[c]; j -= shift_dec[c]) - { - if (j > 0) - *bp |= (png_byte)((v << j) & 0xff); - else - *bp |= (png_byte)((v >> (-j)) & 0xff); - } - } - } - else - { - png_bytep bp; - png_uint_32 i; - png_uint_32 istop = channels * row_info->width; - - for (bp = row, i = 0; i < istop; i++) - { - int c = (int)(i%channels); - png_uint_16 value, v; - int j; - - v = (png_uint_16)(((png_uint_16)(*bp) << 8) + *(bp + 1)); - value = 0; - for (j = shift_start[c]; j > -shift_dec[c]; j -= shift_dec[c]) - { - if (j > 0) - value |= (png_uint_16)((v << j) & (png_uint_16)0xffff); - else - value |= (png_uint_16)((v >> (-j)) & (png_uint_16)0xffff); - } - *bp++ = (png_byte)(value >> 8); - *bp++ = (png_byte)(value & 0xff); - } - } - } -} -#endif - -#if defined(PNG_WRITE_SWAP_ALPHA_SUPPORTED) -void /* PRIVATE */ -png_do_write_swap_alpha(png_row_infop row_info, png_bytep row) -{ - png_debug(1, "in png_do_write_swap_alpha\n"); -#if defined(PNG_USELESS_TESTS_SUPPORTED) - if (row != NULL && row_info != NULL) -#endif - { - if (row_info->color_type == PNG_COLOR_TYPE_RGB_ALPHA) - { - /* This converts from ARGB to RGBA */ - if (row_info->bit_depth == 8) - { - png_bytep sp, dp; - png_uint_32 i; - png_uint_32 row_width = row_info->width; - for (i = 0, sp = dp = row; i < row_width; i++) - { - png_byte save = *(sp++); - *(dp++) = *(sp++); - *(dp++) = *(sp++); - *(dp++) = *(sp++); - *(dp++) = save; - } - } - /* This converts from AARRGGBB to RRGGBBAA */ - else - { - png_bytep sp, dp; - png_uint_32 i; - png_uint_32 row_width = row_info->width; - - for (i = 0, sp = dp = row; i < row_width; i++) - { - png_byte save[2]; - save[0] = *(sp++); - save[1] = *(sp++); - *(dp++) = *(sp++); - *(dp++) = *(sp++); - *(dp++) = *(sp++); - *(dp++) = *(sp++); - *(dp++) = *(sp++); - *(dp++) = *(sp++); - *(dp++) = save[0]; - *(dp++) = save[1]; - } - } - } - else if (row_info->color_type == PNG_COLOR_TYPE_GRAY_ALPHA) - { - /* This converts from AG to GA */ - if (row_info->bit_depth == 8) - { - png_bytep sp, dp; - png_uint_32 i; - png_uint_32 row_width = row_info->width; - - for (i = 0, sp = dp = row; i < row_width; i++) - { - png_byte save = *(sp++); - *(dp++) = *(sp++); - *(dp++) = save; - } - } - /* This converts from AAGG to GGAA */ - else - { - png_bytep sp, dp; - png_uint_32 i; - png_uint_32 row_width = row_info->width; - - for (i = 0, sp = dp = row; i < row_width; i++) - { - png_byte save[2]; - save[0] = *(sp++); - save[1] = *(sp++); - *(dp++) = *(sp++); - *(dp++) = *(sp++); - *(dp++) = save[0]; - *(dp++) = save[1]; - } - } - } - } -} -#endif - -#if defined(PNG_WRITE_INVERT_ALPHA_SUPPORTED) -void /* PRIVATE */ -png_do_write_invert_alpha(png_row_infop row_info, png_bytep row) -{ - png_debug(1, "in png_do_write_invert_alpha\n"); -#if defined(PNG_USELESS_TESTS_SUPPORTED) - if (row != NULL && row_info != NULL) -#endif - { - if (row_info->color_type == PNG_COLOR_TYPE_RGB_ALPHA) - { - /* This inverts the alpha channel in RGBA */ - if (row_info->bit_depth == 8) - { - png_bytep sp, dp; - png_uint_32 i; - png_uint_32 row_width = row_info->width; - for (i = 0, sp = dp = row; i < row_width; i++) - { - *(dp++) = *(sp++); - *(dp++) = *(sp++); - *(dp++) = *(sp++); - *(dp++) = (png_byte)(255 - *(sp++)); - } - } - /* This inverts the alpha channel in RRGGBBAA */ - else - { - png_bytep sp, dp; - png_uint_32 i; - png_uint_32 row_width = row_info->width; - - for (i = 0, sp = dp = row; i < row_width; i++) - { - *(dp++) = *(sp++); - *(dp++) = *(sp++); - *(dp++) = *(sp++); - *(dp++) = *(sp++); - *(dp++) = *(sp++); - *(dp++) = *(sp++); - *(dp++) = (png_byte)(255 - *(sp++)); - *(dp++) = (png_byte)(255 - *(sp++)); - } - } - } - else if (row_info->color_type == PNG_COLOR_TYPE_GRAY_ALPHA) - { - /* This inverts the alpha channel in GA */ - if (row_info->bit_depth == 8) - { - png_bytep sp, dp; - png_uint_32 i; - png_uint_32 row_width = row_info->width; - - for (i = 0, sp = dp = row; i < row_width; i++) - { - *(dp++) = *(sp++); - *(dp++) = (png_byte)(255 - *(sp++)); - } - } - /* This inverts the alpha channel in GGAA */ - else - { - png_bytep sp, dp; - png_uint_32 i; - png_uint_32 row_width = row_info->width; - - for (i = 0, sp = dp = row; i < row_width; i++) - { - *(dp++) = *(sp++); - *(dp++) = *(sp++); - *(dp++) = (png_byte)(255 - *(sp++)); - *(dp++) = (png_byte)(255 - *(sp++)); - } - } - } - } -} -#endif - -#if defined(PNG_MNG_FEATURES_SUPPORTED) -/* undoes intrapixel differencing */ -void /* PRIVATE */ -png_do_write_intrapixel(png_row_infop row_info, png_bytep row) -{ - png_debug(1, "in png_do_write_intrapixel\n"); - if ( -#if defined(PNG_USELESS_TESTS_SUPPORTED) - row != NULL && row_info != NULL && -#endif - (row_info->color_type & PNG_COLOR_MASK_COLOR)) - { - int bytes_per_pixel; - png_uint_32 row_width = row_info->width; - if (row_info->bit_depth == 8) - { - png_bytep rp; - png_uint_32 i; - - if (row_info->color_type == PNG_COLOR_TYPE_RGB) - bytes_per_pixel = 3; - else if (row_info->color_type == PNG_COLOR_TYPE_RGB_ALPHA) - bytes_per_pixel = 4; - else - return; - - for (i = 0, rp = row; i < row_width; i++, rp += bytes_per_pixel) - { - *(rp) = (png_byte)((*rp - *(rp+1))&0xff); - *(rp+2) = (png_byte)((*(rp+2) - *(rp+1))&0xff); - } - } - else if (row_info->bit_depth == 16) - { - png_bytep rp; - png_uint_32 i; - - if (row_info->color_type == PNG_COLOR_TYPE_RGB) - bytes_per_pixel = 6; - else if (row_info->color_type == PNG_COLOR_TYPE_RGB_ALPHA) - bytes_per_pixel = 8; - else - return; - - for (i = 0, rp = row; i < row_width; i++, rp += bytes_per_pixel) - { - png_uint_32 s0 = (*(rp ) << 8) | *(rp+1); - png_uint_32 s1 = (*(rp+2) << 8) | *(rp+3); - png_uint_32 s2 = (*(rp+4) << 8) | *(rp+5); - png_uint_32 red = (png_uint_32)((s0-s1) & 0xffffL); - png_uint_32 blue = (png_uint_32)((s2-s1) & 0xffffL); - *(rp ) = (png_byte)((red >> 8) & 0xff); - *(rp+1) = (png_byte)(red & 0xff); - *(rp+4) = (png_byte)((blue >> 8) & 0xff); - *(rp+5) = (png_byte)(blue & 0xff); - } - } - } -} -#endif /* PNG_MNG_FEATURES_SUPPORTED */ -#endif /* PNG_WRITE_SUPPORTED */ diff --git a/wxWidgets/src/png/pngwutil.c b/wxWidgets/src/png/pngwutil.c deleted file mode 100644 index 17938d2278..0000000000 --- a/wxWidgets/src/png/pngwutil.c +++ /dev/null @@ -1,2726 +0,0 @@ - -/* pngwutil.c - utilities to write a PNG file - * - * libpng version 1.2.7 - September 12, 2004 - * For conditions of distribution and use, see copyright notice in png.h - * Copyright (c) 1998-2004 Glenn Randers-Pehrson - * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) - * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) - */ - -#define PNG_INTERNAL -#include "png.h" -#ifdef PNG_WRITE_SUPPORTED - -/* Place a 32-bit number into a buffer in PNG byte order. We work - * with unsigned numbers for convenience, although one supported - * ancillary chunk uses signed (two's complement) numbers. - */ -void /* PRIVATE */ -png_save_uint_32(png_bytep buf, png_uint_32 i) -{ - buf[0] = (png_byte)((i >> 24) & 0xff); - buf[1] = (png_byte)((i >> 16) & 0xff); - buf[2] = (png_byte)((i >> 8) & 0xff); - buf[3] = (png_byte)(i & 0xff); -} - -#if defined(PNG_WRITE_pCAL_SUPPORTED) || defined(PNG_WRITE_oFFs_SUPPORTED) -/* The png_save_int_32 function assumes integers are stored in two's - * complement format. If this isn't the case, then this routine needs to - * be modified to write data in two's complement format. - */ -void /* PRIVATE */ -png_save_int_32(png_bytep buf, png_int_32 i) -{ - buf[0] = (png_byte)((i >> 24) & 0xff); - buf[1] = (png_byte)((i >> 16) & 0xff); - buf[2] = (png_byte)((i >> 8) & 0xff); - buf[3] = (png_byte)(i & 0xff); -} -#endif - -/* Place a 16-bit number into a buffer in PNG byte order. - * The parameter is declared unsigned int, not png_uint_16, - * just to avoid potential problems on pre-ANSI C compilers. - */ -void /* PRIVATE */ -png_save_uint_16(png_bytep buf, unsigned int i) -{ - buf[0] = (png_byte)((i >> 8) & 0xff); - buf[1] = (png_byte)(i & 0xff); -} - -/* Write a PNG chunk all at once. The type is an array of ASCII characters - * representing the chunk name. The array must be at least 4 bytes in - * length, and does not need to be null terminated. To be safe, pass the - * pre-defined chunk names here, and if you need a new one, define it - * where the others are defined. The length is the length of the data. - * All the data must be present. If that is not possible, use the - * png_write_chunk_start(), png_write_chunk_data(), and png_write_chunk_end() - * functions instead. - */ -void PNGAPI -png_write_chunk(png_structp png_ptr, png_bytep chunk_name, - png_bytep data, png_size_t length) -{ - png_write_chunk_start(png_ptr, chunk_name, (png_uint_32)length); - png_write_chunk_data(png_ptr, data, length); - png_write_chunk_end(png_ptr); -} - -/* Write the start of a PNG chunk. The type is the chunk type. - * The total_length is the sum of the lengths of all the data you will be - * passing in png_write_chunk_data(). - */ -void PNGAPI -png_write_chunk_start(png_structp png_ptr, png_bytep chunk_name, - png_uint_32 length) -{ - png_byte buf[4]; - png_debug2(0, "Writing %s chunk (%lu bytes)\n", chunk_name, length); - - /* write the length */ - png_save_uint_32(buf, length); - png_write_data(png_ptr, buf, (png_size_t)4); - - /* write the chunk name */ - png_write_data(png_ptr, chunk_name, (png_size_t)4); - /* reset the crc and run it over the chunk name */ - png_reset_crc(png_ptr); - png_calculate_crc(png_ptr, chunk_name, (png_size_t)4); -} - -/* Write the data of a PNG chunk started with png_write_chunk_start(). - * Note that multiple calls to this function are allowed, and that the - * sum of the lengths from these calls *must* add up to the total_length - * given to png_write_chunk_start(). - */ -void PNGAPI -png_write_chunk_data(png_structp png_ptr, png_bytep data, png_size_t length) -{ - /* write the data, and run the CRC over it */ - if (data != NULL && length > 0) - { - png_calculate_crc(png_ptr, data, length); - png_write_data(png_ptr, data, length); - } -} - -/* Finish a chunk started with png_write_chunk_start(). */ -void PNGAPI -png_write_chunk_end(png_structp png_ptr) -{ - png_byte buf[4]; - - /* write the crc */ - png_save_uint_32(buf, png_ptr->crc); - - png_write_data(png_ptr, buf, (png_size_t)4); -} - -/* Simple function to write the signature. If we have already written - * the magic bytes of the signature, or more likely, the PNG stream is - * being embedded into another stream and doesn't need its own signature, - * we should call png_set_sig_bytes() to tell libpng how many of the - * bytes have already been written. - */ -void /* PRIVATE */ -png_write_sig(png_structp png_ptr) -{ - png_byte png_signature[8] = {137, 80, 78, 71, 13, 10, 26, 10}; - /* write the rest of the 8 byte signature */ - png_write_data(png_ptr, &png_signature[png_ptr->sig_bytes], - (png_size_t)8 - png_ptr->sig_bytes); - if(png_ptr->sig_bytes < 3) - png_ptr->mode |= PNG_HAVE_PNG_SIGNATURE; -} - -#if defined(PNG_WRITE_TEXT_SUPPORTED) || defined(PNG_WRITE_iCCP_SUPPORTED) -/* - * This pair of functions encapsulates the operation of (a) compressing a - * text string, and (b) issuing it later as a series of chunk data writes. - * The compression_state structure is shared context for these functions - * set up by the caller in order to make the whole mess thread-safe. - */ - -typedef struct -{ - char *input; /* the uncompressed input data */ - int input_len; /* its length */ - int num_output_ptr; /* number of output pointers used */ - int max_output_ptr; /* size of output_ptr */ - png_charpp output_ptr; /* array of pointers to output */ -} compression_state; - -/* compress given text into storage in the png_ptr structure */ -static int /* PRIVATE */ -png_text_compress(png_structp png_ptr, - png_charp text, png_size_t text_len, int compression, - compression_state *comp) -{ - int ret; - - comp->num_output_ptr = comp->max_output_ptr = 0; - comp->output_ptr = NULL; - comp->input = NULL; - - /* we may just want to pass the text right through */ - if (compression == PNG_TEXT_COMPRESSION_NONE) - { - comp->input = text; - comp->input_len = text_len; - return((int)text_len); - } - - if (compression >= PNG_TEXT_COMPRESSION_LAST) - { -#if !defined(PNG_NO_STDIO) && !defined(_WIN32_WCE) - char msg[50]; - sprintf(msg, "Unknown compression type %d", compression); - png_warning(png_ptr, msg); -#else - png_warning(png_ptr, "Unknown compression type"); -#endif - } - - /* We can't write the chunk until we find out how much data we have, - * which means we need to run the compressor first and save the - * output. This shouldn't be a problem, as the vast majority of - * comments should be reasonable, but we will set up an array of - * malloc'd pointers to be sure. - * - * If we knew the application was well behaved, we could simplify this - * greatly by assuming we can always malloc an output buffer large - * enough to hold the compressed text ((1001 * text_len / 1000) + 12) - * and malloc this directly. The only time this would be a bad idea is - * if we can't malloc more than 64K and we have 64K of random input - * data, or if the input string is incredibly large (although this - * wouldn't cause a failure, just a slowdown due to swapping). - */ - - /* set up the compression buffers */ - png_ptr->zstream.avail_in = (uInt)text_len; - png_ptr->zstream.next_in = (Bytef *)text; - png_ptr->zstream.avail_out = (uInt)png_ptr->zbuf_size; - png_ptr->zstream.next_out = (Bytef *)png_ptr->zbuf; - - /* this is the same compression loop as in png_write_row() */ - do - { - /* compress the data */ - ret = deflate(&png_ptr->zstream, Z_NO_FLUSH); - if (ret != Z_OK) - { - /* error */ - if (png_ptr->zstream.msg != NULL) - png_error(png_ptr, png_ptr->zstream.msg); - else - png_error(png_ptr, "zlib error"); - } - /* check to see if we need more room */ - if (!png_ptr->zstream.avail_out && png_ptr->zstream.avail_in) - { - /* make sure the output array has room */ - if (comp->num_output_ptr >= comp->max_output_ptr) - { - int old_max; - - old_max = comp->max_output_ptr; - comp->max_output_ptr = comp->num_output_ptr + 4; - if (comp->output_ptr != NULL) - { - png_charpp old_ptr; - - old_ptr = comp->output_ptr; - comp->output_ptr = (png_charpp)png_malloc(png_ptr, - (png_uint_32)(comp->max_output_ptr * - png_sizeof (png_charpp))); - png_memcpy(comp->output_ptr, old_ptr, old_max - * png_sizeof (png_charp)); - png_free(png_ptr, old_ptr); - } - else - comp->output_ptr = (png_charpp)png_malloc(png_ptr, - (png_uint_32)(comp->max_output_ptr * - png_sizeof (png_charp))); - } - - /* save the data */ - comp->output_ptr[comp->num_output_ptr] = (png_charp)png_malloc(png_ptr, - (png_uint_32)png_ptr->zbuf_size); - png_memcpy(comp->output_ptr[comp->num_output_ptr], png_ptr->zbuf, - png_ptr->zbuf_size); - comp->num_output_ptr++; - - /* and reset the buffer */ - png_ptr->zstream.avail_out = (uInt)png_ptr->zbuf_size; - png_ptr->zstream.next_out = png_ptr->zbuf; - } - /* continue until we don't have any more to compress */ - } while (png_ptr->zstream.avail_in); - - /* finish the compression */ - do - { - /* tell zlib we are finished */ - ret = deflate(&png_ptr->zstream, Z_FINISH); - - if (ret == Z_OK) - { - /* check to see if we need more room */ - if (!(png_ptr->zstream.avail_out)) - { - /* check to make sure our output array has room */ - if (comp->num_output_ptr >= comp->max_output_ptr) - { - int old_max; - - old_max = comp->max_output_ptr; - comp->max_output_ptr = comp->num_output_ptr + 4; - if (comp->output_ptr != NULL) - { - png_charpp old_ptr; - - old_ptr = comp->output_ptr; - /* This could be optimized to realloc() */ - comp->output_ptr = (png_charpp)png_malloc(png_ptr, - (png_uint_32)(comp->max_output_ptr * - png_sizeof (png_charpp))); - png_memcpy(comp->output_ptr, old_ptr, - old_max * png_sizeof (png_charp)); - png_free(png_ptr, old_ptr); - } - else - comp->output_ptr = (png_charpp)png_malloc(png_ptr, - (png_uint_32)(comp->max_output_ptr * - png_sizeof (png_charp))); - } - - /* save off the data */ - comp->output_ptr[comp->num_output_ptr] = - (png_charp)png_malloc(png_ptr, (png_uint_32)png_ptr->zbuf_size); - png_memcpy(comp->output_ptr[comp->num_output_ptr], png_ptr->zbuf, - png_ptr->zbuf_size); - comp->num_output_ptr++; - - /* and reset the buffer pointers */ - png_ptr->zstream.avail_out = (uInt)png_ptr->zbuf_size; - png_ptr->zstream.next_out = png_ptr->zbuf; - } - } - else if (ret != Z_STREAM_END) - { - /* we got an error */ - if (png_ptr->zstream.msg != NULL) - png_error(png_ptr, png_ptr->zstream.msg); - else - png_error(png_ptr, "zlib error"); - } - } while (ret != Z_STREAM_END); - - /* text length is number of buffers plus last buffer */ - text_len = png_ptr->zbuf_size * comp->num_output_ptr; - if (png_ptr->zstream.avail_out < png_ptr->zbuf_size) - text_len += png_ptr->zbuf_size - (png_size_t)png_ptr->zstream.avail_out; - - return((int)text_len); -} - -/* ship the compressed text out via chunk writes */ -static void /* PRIVATE */ -png_write_compressed_data_out(png_structp png_ptr, compression_state *comp) -{ - int i; - - /* handle the no-compression case */ - if (comp->input) - { - png_write_chunk_data(png_ptr, (png_bytep)comp->input, - (png_size_t)comp->input_len); - return; - } - - /* write saved output buffers, if any */ - for (i = 0; i < comp->num_output_ptr; i++) - { - png_write_chunk_data(png_ptr,(png_bytep)comp->output_ptr[i], - png_ptr->zbuf_size); - png_free(png_ptr, comp->output_ptr[i]); - comp->output_ptr[i]=NULL; - } - if (comp->max_output_ptr != 0) - png_free(png_ptr, comp->output_ptr); - comp->output_ptr=NULL; - /* write anything left in zbuf */ - if (png_ptr->zstream.avail_out < (png_uint_32)png_ptr->zbuf_size) - png_write_chunk_data(png_ptr, png_ptr->zbuf, - png_ptr->zbuf_size - png_ptr->zstream.avail_out); - - /* reset zlib for another zTXt/iTXt or the image data */ - deflateReset(&png_ptr->zstream); - -} -#endif - -/* Write the IHDR chunk, and update the png_struct with the necessary - * information. Note that the rest of this code depends upon this - * information being correct. - */ -void /* PRIVATE */ -png_write_IHDR(png_structp png_ptr, png_uint_32 width, png_uint_32 height, - int bit_depth, int color_type, int compression_type, int filter_type, - int interlace_type) -{ -#ifdef PNG_USE_LOCAL_ARRAYS - PNG_IHDR; -#endif - png_byte buf[13]; /* buffer to store the IHDR info */ - - png_debug(1, "in png_write_IHDR\n"); - /* Check that we have valid input data from the application info */ - switch (color_type) - { - case PNG_COLOR_TYPE_GRAY: - switch (bit_depth) - { - case 1: - case 2: - case 4: - case 8: - case 16: png_ptr->channels = 1; break; - default: png_error(png_ptr,"Invalid bit depth for grayscale image"); - } - break; - case PNG_COLOR_TYPE_RGB: - if (bit_depth != 8 && bit_depth != 16) - png_error(png_ptr, "Invalid bit depth for RGB image"); - png_ptr->channels = 3; - break; - case PNG_COLOR_TYPE_PALETTE: - switch (bit_depth) - { - case 1: - case 2: - case 4: - case 8: png_ptr->channels = 1; break; - default: png_error(png_ptr, "Invalid bit depth for paletted image"); - } - break; - case PNG_COLOR_TYPE_GRAY_ALPHA: - if (bit_depth != 8 && bit_depth != 16) - png_error(png_ptr, "Invalid bit depth for grayscale+alpha image"); - png_ptr->channels = 2; - break; - case PNG_COLOR_TYPE_RGB_ALPHA: - if (bit_depth != 8 && bit_depth != 16) - png_error(png_ptr, "Invalid bit depth for RGBA image"); - png_ptr->channels = 4; - break; - default: - png_error(png_ptr, "Invalid image color type specified"); - } - - if (compression_type != PNG_COMPRESSION_TYPE_BASE) - { - png_warning(png_ptr, "Invalid compression type specified"); - compression_type = PNG_COMPRESSION_TYPE_BASE; - } - - /* Write filter_method 64 (intrapixel differencing) only if - * 1. Libpng was compiled with PNG_MNG_FEATURES_SUPPORTED and - * 2. Libpng did not write a PNG signature (this filter_method is only - * used in PNG datastreams that are embedded in MNG datastreams) and - * 3. The application called png_permit_mng_features with a mask that - * included PNG_FLAG_MNG_FILTER_64 and - * 4. The filter_method is 64 and - * 5. The color_type is RGB or RGBA - */ - if ( -#if defined(PNG_MNG_FEATURES_SUPPORTED) - !((png_ptr->mng_features_permitted & PNG_FLAG_MNG_FILTER_64) && - ((png_ptr->mode&PNG_HAVE_PNG_SIGNATURE) == 0) && - (color_type == PNG_COLOR_TYPE_RGB || - color_type == PNG_COLOR_TYPE_RGB_ALPHA) && - (filter_type == PNG_INTRAPIXEL_DIFFERENCING)) && -#endif - filter_type != PNG_FILTER_TYPE_BASE) - { - png_warning(png_ptr, "Invalid filter type specified"); - filter_type = PNG_FILTER_TYPE_BASE; - } - -#ifdef PNG_WRITE_INTERLACING_SUPPORTED - if (interlace_type != PNG_INTERLACE_NONE && - interlace_type != PNG_INTERLACE_ADAM7) - { - png_warning(png_ptr, "Invalid interlace type specified"); - interlace_type = PNG_INTERLACE_ADAM7; - } -#else - interlace_type=PNG_INTERLACE_NONE; -#endif - - /* save off the relevent information */ - png_ptr->bit_depth = (png_byte)bit_depth; - png_ptr->color_type = (png_byte)color_type; - png_ptr->interlaced = (png_byte)interlace_type; -#if defined(PNG_MNG_FEATURES_SUPPORTED) - png_ptr->filter_type = (png_byte)filter_type; -#endif - png_ptr->compression_type = (png_byte)compression_type; - png_ptr->width = width; - png_ptr->height = height; - - png_ptr->pixel_depth = (png_byte)(bit_depth * png_ptr->channels); - png_ptr->rowbytes = PNG_ROWBYTES(png_ptr->pixel_depth, width); - /* set the usr info, so any transformations can modify it */ - png_ptr->usr_width = png_ptr->width; - png_ptr->usr_bit_depth = png_ptr->bit_depth; - png_ptr->usr_channels = png_ptr->channels; - - /* pack the header information into the buffer */ - png_save_uint_32(buf, width); - png_save_uint_32(buf + 4, height); - buf[8] = (png_byte)bit_depth; - buf[9] = (png_byte)color_type; - buf[10] = (png_byte)compression_type; - buf[11] = (png_byte)filter_type; - buf[12] = (png_byte)interlace_type; - - /* write the chunk */ - png_write_chunk(png_ptr, (png_bytep)png_IHDR, buf, (png_size_t)13); - - /* initialize zlib with PNG info */ - png_ptr->zstream.zalloc = png_zalloc; - png_ptr->zstream.zfree = png_zfree; - png_ptr->zstream.opaque = (voidpf)png_ptr; - if (!(png_ptr->do_filter)) - { - if (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE || - png_ptr->bit_depth < 8) - png_ptr->do_filter = PNG_FILTER_NONE; - else - png_ptr->do_filter = PNG_ALL_FILTERS; - } - if (!(png_ptr->flags & PNG_FLAG_ZLIB_CUSTOM_STRATEGY)) - { - if (png_ptr->do_filter != PNG_FILTER_NONE) - png_ptr->zlib_strategy = Z_FILTERED; - else - png_ptr->zlib_strategy = Z_DEFAULT_STRATEGY; - } - if (!(png_ptr->flags & PNG_FLAG_ZLIB_CUSTOM_LEVEL)) - png_ptr->zlib_level = Z_DEFAULT_COMPRESSION; - if (!(png_ptr->flags & PNG_FLAG_ZLIB_CUSTOM_MEM_LEVEL)) - png_ptr->zlib_mem_level = 8; - if (!(png_ptr->flags & PNG_FLAG_ZLIB_CUSTOM_WINDOW_BITS)) - png_ptr->zlib_window_bits = 15; - if (!(png_ptr->flags & PNG_FLAG_ZLIB_CUSTOM_METHOD)) - png_ptr->zlib_method = 8; - deflateInit2(&png_ptr->zstream, png_ptr->zlib_level, - png_ptr->zlib_method, png_ptr->zlib_window_bits, - png_ptr->zlib_mem_level, png_ptr->zlib_strategy); - png_ptr->zstream.next_out = png_ptr->zbuf; - png_ptr->zstream.avail_out = (uInt)png_ptr->zbuf_size; - - png_ptr->mode = PNG_HAVE_IHDR; -} - -/* write the palette. We are careful not to trust png_color to be in the - * correct order for PNG, so people can redefine it to any convenient - * structure. - */ -void /* PRIVATE */ -png_write_PLTE(png_structp png_ptr, png_colorp palette, png_uint_32 num_pal) -{ -#ifdef PNG_USE_LOCAL_ARRAYS - PNG_PLTE; -#endif - png_uint_32 i; - png_colorp pal_ptr; - png_byte buf[3]; - - png_debug(1, "in png_write_PLTE\n"); - if (( -#if defined(PNG_MNG_FEATURES_SUPPORTED) - !(png_ptr->mng_features_permitted & PNG_FLAG_MNG_EMPTY_PLTE) && -#endif - num_pal == 0) || num_pal > 256) - { - if (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE) - { - png_error(png_ptr, "Invalid number of colors in palette"); - } - else - { - png_warning(png_ptr, "Invalid number of colors in palette"); - return; - } - } - - if (!(png_ptr->color_type&PNG_COLOR_MASK_COLOR)) - { - png_warning(png_ptr, - "Ignoring request to write a PLTE chunk in grayscale PNG"); - return; - } - - png_ptr->num_palette = (png_uint_16)num_pal; - png_debug1(3, "num_palette = %d\n", png_ptr->num_palette); - - png_write_chunk_start(png_ptr, (png_bytep)png_PLTE, num_pal * 3); -#ifndef PNG_NO_POINTER_INDEXING - for (i = 0, pal_ptr = palette; i < num_pal; i++, pal_ptr++) - { - buf[0] = pal_ptr->red; - buf[1] = pal_ptr->green; - buf[2] = pal_ptr->blue; - png_write_chunk_data(png_ptr, buf, (png_size_t)3); - } -#else - /* This is a little slower but some buggy compilers need to do this instead */ - pal_ptr=palette; - for (i = 0; i < num_pal; i++) - { - buf[0] = pal_ptr[i].red; - buf[1] = pal_ptr[i].green; - buf[2] = pal_ptr[i].blue; - png_write_chunk_data(png_ptr, buf, (png_size_t)3); - } -#endif - png_write_chunk_end(png_ptr); - png_ptr->mode |= PNG_HAVE_PLTE; -} - -/* write an IDAT chunk */ -void /* PRIVATE */ -png_write_IDAT(png_structp png_ptr, png_bytep data, png_size_t length) -{ -#ifdef PNG_USE_LOCAL_ARRAYS - PNG_IDAT; -#endif - png_debug(1, "in png_write_IDAT\n"); - - /* Optimize the CMF field in the zlib stream. */ - /* This hack of the zlib stream is compliant to the stream specification. */ - if (!(png_ptr->mode & PNG_HAVE_IDAT) && - png_ptr->compression_type == PNG_COMPRESSION_TYPE_BASE) - { - unsigned int z_cmf = data[0]; /* zlib compression method and flags */ - if ((z_cmf & 0x0f) == 8 && (z_cmf & 0xf0) <= 0x70) - { - /* Avoid memory underflows and multiplication overflows. */ - /* The conditions below are practically always satisfied; - however, they still must be checked. */ - if (length >= 2 && - png_ptr->height < 16384 && png_ptr->width < 16384) - { - png_uint_32 uncompressed_idat_size = png_ptr->height * - ((png_ptr->width * - png_ptr->channels * png_ptr->bit_depth + 15) >> 3); - unsigned int z_cinfo = z_cmf >> 4; - unsigned int half_z_window_size = 1 << (z_cinfo + 7); - while (uncompressed_idat_size <= half_z_window_size && - half_z_window_size >= 256) - { - z_cinfo--; - half_z_window_size >>= 1; - } - z_cmf = (z_cmf & 0x0f) | (z_cinfo << 4); - if (data[0] != (png_byte)z_cmf) - { - data[0] = (png_byte)z_cmf; - data[1] &= 0xe0; - data[1] += (png_byte)(0x1f - ((z_cmf << 8) + data[1]) % 0x1f); - } - } - } - else - png_error(png_ptr, - "Invalid zlib compression method or flags in IDAT"); - } - - png_write_chunk(png_ptr, (png_bytep)png_IDAT, data, length); - png_ptr->mode |= PNG_HAVE_IDAT; -} - -/* write an IEND chunk */ -void /* PRIVATE */ -png_write_IEND(png_structp png_ptr) -{ -#ifdef PNG_USE_LOCAL_ARRAYS - PNG_IEND; -#endif - png_debug(1, "in png_write_IEND\n"); - png_write_chunk(png_ptr, (png_bytep)png_IEND, png_bytep_NULL, - (png_size_t)0); - png_ptr->mode |= PNG_HAVE_IEND; -} - -#if defined(PNG_WRITE_gAMA_SUPPORTED) -/* write a gAMA chunk */ -#ifdef PNG_FLOATING_POINT_SUPPORTED -void /* PRIVATE */ -png_write_gAMA(png_structp png_ptr, double file_gamma) -{ -#ifdef PNG_USE_LOCAL_ARRAYS - PNG_gAMA; -#endif - png_uint_32 igamma; - png_byte buf[4]; - - png_debug(1, "in png_write_gAMA\n"); - /* file_gamma is saved in 1/100,000ths */ - igamma = (png_uint_32)(file_gamma * 100000.0 + 0.5); - png_save_uint_32(buf, igamma); - png_write_chunk(png_ptr, (png_bytep)png_gAMA, buf, (png_size_t)4); -} -#endif -#ifdef PNG_FIXED_POINT_SUPPORTED -void /* PRIVATE */ -png_write_gAMA_fixed(png_structp png_ptr, png_fixed_point file_gamma) -{ -#ifdef PNG_USE_LOCAL_ARRAYS - PNG_gAMA; -#endif - png_byte buf[4]; - - png_debug(1, "in png_write_gAMA\n"); - /* file_gamma is saved in 1/100,000ths */ - png_save_uint_32(buf, (png_uint_32)file_gamma); - png_write_chunk(png_ptr, (png_bytep)png_gAMA, buf, (png_size_t)4); -} -#endif -#endif - -#if defined(PNG_WRITE_sRGB_SUPPORTED) -/* write a sRGB chunk */ -void /* PRIVATE */ -png_write_sRGB(png_structp png_ptr, int srgb_intent) -{ -#ifdef PNG_USE_LOCAL_ARRAYS - PNG_sRGB; -#endif - png_byte buf[1]; - - png_debug(1, "in png_write_sRGB\n"); - if(srgb_intent >= PNG_sRGB_INTENT_LAST) - png_warning(png_ptr, - "Invalid sRGB rendering intent specified"); - buf[0]=(png_byte)srgb_intent; - png_write_chunk(png_ptr, (png_bytep)png_sRGB, buf, (png_size_t)1); -} -#endif - -#if defined(PNG_WRITE_iCCP_SUPPORTED) -/* write an iCCP chunk */ -void /* PRIVATE */ -png_write_iCCP(png_structp png_ptr, png_charp name, int compression_type, - png_charp profile, int profile_len) -{ -#ifdef PNG_USE_LOCAL_ARRAYS - PNG_iCCP; -#endif - png_size_t name_len; - png_charp new_name; - compression_state comp; - - png_debug(1, "in png_write_iCCP\n"); - if (name == NULL || (name_len = png_check_keyword(png_ptr, name, - &new_name)) == 0) - { - png_warning(png_ptr, "Empty keyword in iCCP chunk"); - return; - } - - if (compression_type != PNG_COMPRESSION_TYPE_BASE) - png_warning(png_ptr, "Unknown compression type in iCCP chunk"); - - if (profile == NULL) - profile_len = 0; - - if (profile_len) - profile_len = png_text_compress(png_ptr, profile, (png_size_t)profile_len, - PNG_COMPRESSION_TYPE_BASE, &comp); - - /* make sure we include the NULL after the name and the compression type */ - png_write_chunk_start(png_ptr, (png_bytep)png_iCCP, - (png_uint_32)name_len+profile_len+2); - new_name[name_len+1]=0x00; - png_write_chunk_data(png_ptr, (png_bytep)new_name, name_len + 2); - - if (profile_len) - png_write_compressed_data_out(png_ptr, &comp); - - png_write_chunk_end(png_ptr); - png_free(png_ptr, new_name); -} -#endif - -#if defined(PNG_WRITE_sPLT_SUPPORTED) -/* write a sPLT chunk */ -void /* PRIVATE */ -png_write_sPLT(png_structp png_ptr, png_sPLT_tp spalette) -{ -#ifdef PNG_USE_LOCAL_ARRAYS - PNG_sPLT; -#endif - png_size_t name_len; - png_charp new_name; - png_byte entrybuf[10]; - int entry_size = (spalette->depth == 8 ? 6 : 10); - int palette_size = entry_size * spalette->nentries; - png_sPLT_entryp ep; -#ifdef PNG_NO_POINTER_INDEXING - int i; -#endif - - png_debug(1, "in png_write_sPLT\n"); - if (spalette->name == NULL || (name_len = png_check_keyword(png_ptr, - spalette->name, &new_name))==0) - { - png_warning(png_ptr, "Empty keyword in sPLT chunk"); - return; - } - - /* make sure we include the NULL after the name */ - png_write_chunk_start(png_ptr, (png_bytep)png_sPLT, - (png_uint_32)(name_len + 2 + palette_size)); - png_write_chunk_data(png_ptr, (png_bytep)new_name, name_len + 1); - png_write_chunk_data(png_ptr, (png_bytep)&spalette->depth, 1); - - /* loop through each palette entry, writing appropriately */ -#ifndef PNG_NO_POINTER_INDEXING - for (ep = spalette->entries; epentries+spalette->nentries; ep++) - { - if (spalette->depth == 8) - { - entrybuf[0] = (png_byte)ep->red; - entrybuf[1] = (png_byte)ep->green; - entrybuf[2] = (png_byte)ep->blue; - entrybuf[3] = (png_byte)ep->alpha; - png_save_uint_16(entrybuf + 4, ep->frequency); - } - else - { - png_save_uint_16(entrybuf + 0, ep->red); - png_save_uint_16(entrybuf + 2, ep->green); - png_save_uint_16(entrybuf + 4, ep->blue); - png_save_uint_16(entrybuf + 6, ep->alpha); - png_save_uint_16(entrybuf + 8, ep->frequency); - } - png_write_chunk_data(png_ptr, entrybuf, (png_size_t)entry_size); - } -#else - ep=spalette->entries; - for (i=0; i>spalette->nentries; i++) - { - if (spalette->depth == 8) - { - entrybuf[0] = (png_byte)ep[i].red; - entrybuf[1] = (png_byte)ep[i].green; - entrybuf[2] = (png_byte)ep[i].blue; - entrybuf[3] = (png_byte)ep[i].alpha; - png_save_uint_16(entrybuf + 4, ep[i].frequency); - } - else - { - png_save_uint_16(entrybuf + 0, ep[i].red); - png_save_uint_16(entrybuf + 2, ep[i].green); - png_save_uint_16(entrybuf + 4, ep[i].blue); - png_save_uint_16(entrybuf + 6, ep[i].alpha); - png_save_uint_16(entrybuf + 8, ep[i].frequency); - } - png_write_chunk_data(png_ptr, entrybuf, entry_size); - } -#endif - - png_write_chunk_end(png_ptr); - png_free(png_ptr, new_name); -} -#endif - -#if defined(PNG_WRITE_sBIT_SUPPORTED) -/* write the sBIT chunk */ -void /* PRIVATE */ -png_write_sBIT(png_structp png_ptr, png_color_8p sbit, int color_type) -{ -#ifdef PNG_USE_LOCAL_ARRAYS - PNG_sBIT; -#endif - png_byte buf[4]; - png_size_t size; - - png_debug(1, "in png_write_sBIT\n"); - /* make sure we don't depend upon the order of PNG_COLOR_8 */ - if (color_type & PNG_COLOR_MASK_COLOR) - { - png_byte maxbits; - - maxbits = (png_byte)(color_type==PNG_COLOR_TYPE_PALETTE ? 8 : - png_ptr->usr_bit_depth); - if (sbit->red == 0 || sbit->red > maxbits || - sbit->green == 0 || sbit->green > maxbits || - sbit->blue == 0 || sbit->blue > maxbits) - { - png_warning(png_ptr, "Invalid sBIT depth specified"); - return; - } - buf[0] = sbit->red; - buf[1] = sbit->green; - buf[2] = sbit->blue; - size = 3; - } - else - { - if (sbit->gray == 0 || sbit->gray > png_ptr->usr_bit_depth) - { - png_warning(png_ptr, "Invalid sBIT depth specified"); - return; - } - buf[0] = sbit->gray; - size = 1; - } - - if (color_type & PNG_COLOR_MASK_ALPHA) - { - if (sbit->alpha == 0 || sbit->alpha > png_ptr->usr_bit_depth) - { - png_warning(png_ptr, "Invalid sBIT depth specified"); - return; - } - buf[size++] = sbit->alpha; - } - - png_write_chunk(png_ptr, (png_bytep)png_sBIT, buf, size); -} -#endif - -#if defined(PNG_WRITE_cHRM_SUPPORTED) -/* write the cHRM chunk */ -#ifdef PNG_FLOATING_POINT_SUPPORTED -void /* PRIVATE */ -png_write_cHRM(png_structp png_ptr, double white_x, double white_y, - double red_x, double red_y, double green_x, double green_y, - double blue_x, double blue_y) -{ -#ifdef PNG_USE_LOCAL_ARRAYS - PNG_cHRM; -#endif - png_byte buf[32]; - png_uint_32 itemp; - - png_debug(1, "in png_write_cHRM\n"); - /* each value is saved in 1/100,000ths */ - if (white_x < 0 || white_x > 0.8 || white_y < 0 || white_y > 0.8 || - white_x + white_y > 1.0) - { - png_warning(png_ptr, "Invalid cHRM white point specified"); -#if !defined(PNG_NO_CONSOLE_IO) - fprintf(stderr,"white_x=%f, white_y=%f\n",white_x, white_y); -#endif - return; - } - itemp = (png_uint_32)(white_x * 100000.0 + 0.5); - png_save_uint_32(buf, itemp); - itemp = (png_uint_32)(white_y * 100000.0 + 0.5); - png_save_uint_32(buf + 4, itemp); - - if (red_x < 0 || red_x > 0.8 || red_y < 0 || red_y > 0.8 || - red_x + red_y > 1.0) - { - png_warning(png_ptr, "Invalid cHRM red point specified"); - return; - } - itemp = (png_uint_32)(red_x * 100000.0 + 0.5); - png_save_uint_32(buf + 8, itemp); - itemp = (png_uint_32)(red_y * 100000.0 + 0.5); - png_save_uint_32(buf + 12, itemp); - - if (green_x < 0 || green_x > 0.8 || green_y < 0 || green_y > 0.8 || - green_x + green_y > 1.0) - { - png_warning(png_ptr, "Invalid cHRM green point specified"); - return; - } - itemp = (png_uint_32)(green_x * 100000.0 + 0.5); - png_save_uint_32(buf + 16, itemp); - itemp = (png_uint_32)(green_y * 100000.0 + 0.5); - png_save_uint_32(buf + 20, itemp); - - if (blue_x < 0 || blue_x > 0.8 || blue_y < 0 || blue_y > 0.8 || - blue_x + blue_y > 1.0) - { - png_warning(png_ptr, "Invalid cHRM blue point specified"); - return; - } - itemp = (png_uint_32)(blue_x * 100000.0 + 0.5); - png_save_uint_32(buf + 24, itemp); - itemp = (png_uint_32)(blue_y * 100000.0 + 0.5); - png_save_uint_32(buf + 28, itemp); - - png_write_chunk(png_ptr, (png_bytep)png_cHRM, buf, (png_size_t)32); -} -#endif -#ifdef PNG_FIXED_POINT_SUPPORTED -void /* PRIVATE */ -png_write_cHRM_fixed(png_structp png_ptr, png_fixed_point white_x, - png_fixed_point white_y, png_fixed_point red_x, png_fixed_point red_y, - png_fixed_point green_x, png_fixed_point green_y, png_fixed_point blue_x, - png_fixed_point blue_y) -{ -#ifdef PNG_USE_LOCAL_ARRAYS - PNG_cHRM; -#endif - png_byte buf[32]; - - png_debug(1, "in png_write_cHRM\n"); - /* each value is saved in 1/100,000ths */ - if (white_x > 80000L || white_y > 80000L || white_x + white_y > 100000L) - { - png_warning(png_ptr, "Invalid fixed cHRM white point specified"); -#if !defined(PNG_NO_CONSOLE_IO) - fprintf(stderr,"white_x=%ld, white_y=%ld\n",white_x, white_y); -#endif - return; - } - png_save_uint_32(buf, (png_uint_32)white_x); - png_save_uint_32(buf + 4, (png_uint_32)white_y); - - if (red_x > 80000L || red_y > 80000L || red_x + red_y > 100000L) - { - png_warning(png_ptr, "Invalid cHRM fixed red point specified"); - return; - } - png_save_uint_32(buf + 8, (png_uint_32)red_x); - png_save_uint_32(buf + 12, (png_uint_32)red_y); - - if (green_x > 80000L || green_y > 80000L || green_x + green_y > 100000L) - { - png_warning(png_ptr, "Invalid fixed cHRM green point specified"); - return; - } - png_save_uint_32(buf + 16, (png_uint_32)green_x); - png_save_uint_32(buf + 20, (png_uint_32)green_y); - - if (blue_x > 80000L || blue_y > 80000L || blue_x + blue_y > 100000L) - { - png_warning(png_ptr, "Invalid fixed cHRM blue point specified"); - return; - } - png_save_uint_32(buf + 24, (png_uint_32)blue_x); - png_save_uint_32(buf + 28, (png_uint_32)blue_y); - - png_write_chunk(png_ptr, (png_bytep)png_cHRM, buf, (png_size_t)32); -} -#endif -#endif - -#if defined(PNG_WRITE_tRNS_SUPPORTED) -/* write the tRNS chunk */ -void /* PRIVATE */ -png_write_tRNS(png_structp png_ptr, png_bytep trans, png_color_16p tran, - int num_trans, int color_type) -{ -#ifdef PNG_USE_LOCAL_ARRAYS - PNG_tRNS; -#endif - png_byte buf[6]; - - png_debug(1, "in png_write_tRNS\n"); - if (color_type == PNG_COLOR_TYPE_PALETTE) - { - if (num_trans <= 0 || num_trans > (int)png_ptr->num_palette) - { - png_warning(png_ptr,"Invalid number of transparent colors specified"); - return; - } - /* write the chunk out as it is */ - png_write_chunk(png_ptr, (png_bytep)png_tRNS, trans, (png_size_t)num_trans); - } - else if (color_type == PNG_COLOR_TYPE_GRAY) - { - /* one 16 bit value */ - if(tran->gray >= (1 << png_ptr->bit_depth)) - { - png_warning(png_ptr, - "Ignoring attempt to write tRNS chunk out-of-range for bit_depth"); - return; - } - png_save_uint_16(buf, tran->gray); - png_write_chunk(png_ptr, (png_bytep)png_tRNS, buf, (png_size_t)2); - } - else if (color_type == PNG_COLOR_TYPE_RGB) - { - /* three 16 bit values */ - png_save_uint_16(buf, tran->red); - png_save_uint_16(buf + 2, tran->green); - png_save_uint_16(buf + 4, tran->blue); - if(png_ptr->bit_depth == 8 && (buf[0] | buf[2] | buf[4])) - { - png_warning(png_ptr, - "Ignoring attempt to write 16-bit tRNS chunk when bit_depth is 8"); - return; - } - png_write_chunk(png_ptr, (png_bytep)png_tRNS, buf, (png_size_t)6); - } - else - { - png_warning(png_ptr, "Can't write tRNS with an alpha channel"); - } -} -#endif - -#if defined(PNG_WRITE_bKGD_SUPPORTED) -/* write the background chunk */ -void /* PRIVATE */ -png_write_bKGD(png_structp png_ptr, png_color_16p back, int color_type) -{ -#ifdef PNG_USE_LOCAL_ARRAYS - PNG_bKGD; -#endif - png_byte buf[6]; - - png_debug(1, "in png_write_bKGD\n"); - if (color_type == PNG_COLOR_TYPE_PALETTE) - { - if ( -#if defined(PNG_MNG_FEATURES_SUPPORTED) - (png_ptr->num_palette || - (!(png_ptr->mng_features_permitted & PNG_FLAG_MNG_EMPTY_PLTE))) && -#endif - back->index > png_ptr->num_palette) - { - png_warning(png_ptr, "Invalid background palette index"); - return; - } - buf[0] = back->index; - png_write_chunk(png_ptr, (png_bytep)png_bKGD, buf, (png_size_t)1); - } - else if (color_type & PNG_COLOR_MASK_COLOR) - { - png_save_uint_16(buf, back->red); - png_save_uint_16(buf + 2, back->green); - png_save_uint_16(buf + 4, back->blue); - if(png_ptr->bit_depth == 8 && (buf[0] | buf[2] | buf[4])) - { - png_warning(png_ptr, - "Ignoring attempt to write 16-bit bKGD chunk when bit_depth is 8"); - return; - } - png_write_chunk(png_ptr, (png_bytep)png_bKGD, buf, (png_size_t)6); - } - else - { - if(back->gray >= (1 << png_ptr->bit_depth)) - { - png_warning(png_ptr, - "Ignoring attempt to write bKGD chunk out-of-range for bit_depth"); - return; - } - png_save_uint_16(buf, back->gray); - png_write_chunk(png_ptr, (png_bytep)png_bKGD, buf, (png_size_t)2); - } -} -#endif - -#if defined(PNG_WRITE_hIST_SUPPORTED) -/* write the histogram */ -void /* PRIVATE */ -png_write_hIST(png_structp png_ptr, png_uint_16p hist, int num_hist) -{ -#ifdef PNG_USE_LOCAL_ARRAYS - PNG_hIST; -#endif - int i; - png_byte buf[3]; - - png_debug(1, "in png_write_hIST\n"); - if (num_hist > (int)png_ptr->num_palette) - { - png_debug2(3, "num_hist = %d, num_palette = %d\n", num_hist, - png_ptr->num_palette); - png_warning(png_ptr, "Invalid number of histogram entries specified"); - return; - } - - png_write_chunk_start(png_ptr, (png_bytep)png_hIST, (png_uint_32)(num_hist * 2)); - for (i = 0; i < num_hist; i++) - { - png_save_uint_16(buf, hist[i]); - png_write_chunk_data(png_ptr, buf, (png_size_t)2); - } - png_write_chunk_end(png_ptr); -} -#endif - -#if defined(PNG_WRITE_TEXT_SUPPORTED) || defined(PNG_WRITE_pCAL_SUPPORTED) || \ - defined(PNG_WRITE_iCCP_SUPPORTED) || defined(PNG_WRITE_sPLT_SUPPORTED) -/* Check that the tEXt or zTXt keyword is valid per PNG 1.0 specification, - * and if invalid, correct the keyword rather than discarding the entire - * chunk. The PNG 1.0 specification requires keywords 1-79 characters in - * length, forbids leading or trailing whitespace, multiple internal spaces, - * and the non-break space (0x80) from ISO 8859-1. Returns keyword length. - * - * The new_key is allocated to hold the corrected keyword and must be freed - * by the calling routine. This avoids problems with trying to write to - * static keywords without having to have duplicate copies of the strings. - */ -png_size_t /* PRIVATE */ -png_check_keyword(png_structp png_ptr, png_charp key, png_charpp new_key) -{ - png_size_t key_len; - png_charp kp, dp; - int kflag; - int kwarn=0; - - png_debug(1, "in png_check_keyword\n"); - *new_key = NULL; - - if (key == NULL || (key_len = png_strlen(key)) == 0) - { - png_warning(png_ptr, "zero length keyword"); - return ((png_size_t)0); - } - - png_debug1(2, "Keyword to be checked is '%s'\n", key); - - *new_key = (png_charp)png_malloc_warn(png_ptr, (png_uint_32)(key_len + 2)); - if (*new_key == NULL) - { - png_warning(png_ptr, "Out of memory while procesing keyword"); - return ((png_size_t)0); - } - - /* Replace non-printing characters with a blank and print a warning */ - for (kp = key, dp = *new_key; *kp != '\0'; kp++, dp++) - { - if (*kp < 0x20 || (*kp > 0x7E && (png_byte)*kp < 0xA1)) - { -#if !defined(PNG_NO_STDIO) && !defined(_WIN32_WCE) - char msg[40]; - - sprintf(msg, "invalid keyword character 0x%02X", *kp); - png_warning(png_ptr, msg); -#else - png_warning(png_ptr, "invalid character in keyword"); -#endif - *dp = ' '; - } - else - { - *dp = *kp; - } - } - *dp = '\0'; - - /* Remove any trailing white space. */ - kp = *new_key + key_len - 1; - if (*kp == ' ') - { - png_warning(png_ptr, "trailing spaces removed from keyword"); - - while (*kp == ' ') - { - *(kp--) = '\0'; - key_len--; - } - } - - /* Remove any leading white space. */ - kp = *new_key; - if (*kp == ' ') - { - png_warning(png_ptr, "leading spaces removed from keyword"); - - while (*kp == ' ') - { - kp++; - key_len--; - } - } - - png_debug1(2, "Checking for multiple internal spaces in '%s'\n", kp); - - /* Remove multiple internal spaces. */ - for (kflag = 0, dp = *new_key; *kp != '\0'; kp++) - { - if (*kp == ' ' && kflag == 0) - { - *(dp++) = *kp; - kflag = 1; - } - else if (*kp == ' ') - { - key_len--; - kwarn=1; - } - else - { - *(dp++) = *kp; - kflag = 0; - } - } - *dp = '\0'; - if(kwarn) - png_warning(png_ptr, "extra interior spaces removed from keyword"); - - if (key_len == 0) - { - png_free(png_ptr, *new_key); - *new_key=NULL; - png_warning(png_ptr, "Zero length keyword"); - } - - if (key_len > 79) - { - png_warning(png_ptr, "keyword length must be 1 - 79 characters"); - new_key[79] = '\0'; - key_len = 79; - } - - return (key_len); -} -#endif - -#if defined(PNG_WRITE_tEXt_SUPPORTED) -/* write a tEXt chunk */ -void /* PRIVATE */ -png_write_tEXt(png_structp png_ptr, png_charp key, png_charp text, - png_size_t text_len) -{ -#ifdef PNG_USE_LOCAL_ARRAYS - PNG_tEXt; -#endif - png_size_t key_len; - png_charp new_key; - - png_debug(1, "in png_write_tEXt\n"); - if (key == NULL || (key_len = png_check_keyword(png_ptr, key, &new_key))==0) - { - png_warning(png_ptr, "Empty keyword in tEXt chunk"); - return; - } - - if (text == NULL || *text == '\0') - text_len = 0; - else - text_len = png_strlen(text); - - /* make sure we include the 0 after the key */ - png_write_chunk_start(png_ptr, (png_bytep)png_tEXt, (png_uint_32)key_len+text_len+1); - /* - * We leave it to the application to meet PNG-1.0 requirements on the - * contents of the text. PNG-1.0 through PNG-1.2 discourage the use of - * any non-Latin-1 characters except for NEWLINE. ISO PNG will forbid them. - * The NUL character is forbidden by PNG-1.0 through PNG-1.2 and ISO PNG. - */ - png_write_chunk_data(png_ptr, (png_bytep)new_key, key_len + 1); - if (text_len) - png_write_chunk_data(png_ptr, (png_bytep)text, text_len); - - png_write_chunk_end(png_ptr); - png_free(png_ptr, new_key); -} -#endif - -#if defined(PNG_WRITE_zTXt_SUPPORTED) -/* write a compressed text chunk */ -void /* PRIVATE */ -png_write_zTXt(png_structp png_ptr, png_charp key, png_charp text, - png_size_t text_len, int compression) -{ -#ifdef PNG_USE_LOCAL_ARRAYS - PNG_zTXt; -#endif - png_size_t key_len; - char buf[1]; - png_charp new_key; - compression_state comp; - - png_debug(1, "in png_write_zTXt\n"); - - if (key == NULL || (key_len = png_check_keyword(png_ptr, key, &new_key))==0) - { - png_warning(png_ptr, "Empty keyword in zTXt chunk"); - return; - } - - if (text == NULL || *text == '\0' || compression==PNG_TEXT_COMPRESSION_NONE) - { - png_write_tEXt(png_ptr, new_key, text, (png_size_t)0); - png_free(png_ptr, new_key); - return; - } - - text_len = png_strlen(text); - - png_free(png_ptr, new_key); - - /* compute the compressed data; do it now for the length */ - text_len = png_text_compress(png_ptr, text, text_len, compression, - &comp); - - /* write start of chunk */ - png_write_chunk_start(png_ptr, (png_bytep)png_zTXt, (png_uint_32) - (key_len+text_len+2)); - /* write key */ - png_write_chunk_data(png_ptr, (png_bytep)key, key_len + 1); - buf[0] = (png_byte)compression; - /* write compression */ - png_write_chunk_data(png_ptr, (png_bytep)buf, (png_size_t)1); - /* write the compressed data */ - png_write_compressed_data_out(png_ptr, &comp); - - /* close the chunk */ - png_write_chunk_end(png_ptr); -} -#endif - -#if defined(PNG_WRITE_iTXt_SUPPORTED) -/* write an iTXt chunk */ -void /* PRIVATE */ -png_write_iTXt(png_structp png_ptr, int compression, png_charp key, - png_charp lang, png_charp lang_key, png_charp text) -{ -#ifdef PNG_USE_LOCAL_ARRAYS - PNG_iTXt; -#endif - png_size_t lang_len, key_len, lang_key_len, text_len; - png_charp new_lang, new_key; - png_byte cbuf[2]; - compression_state comp; - - png_debug(1, "in png_write_iTXt\n"); - - if (key == NULL || (key_len = png_check_keyword(png_ptr, key, &new_key))==0) - { - png_warning(png_ptr, "Empty keyword in iTXt chunk"); - return; - } - if (lang == NULL || (lang_len = png_check_keyword(png_ptr, lang, &new_lang))==0) - { - png_warning(png_ptr, "Empty language field in iTXt chunk"); - new_lang = NULL; - lang_len = 0; - } - - if (lang_key == NULL) - lang_key_len = 0; - else - lang_key_len = png_strlen(lang_key); - - if (text == NULL) - text_len = 0; - else - text_len = png_strlen(text); - - /* compute the compressed data; do it now for the length */ - text_len = png_text_compress(png_ptr, text, text_len, compression-2, - &comp); - - - /* make sure we include the compression flag, the compression byte, - * and the NULs after the key, lang, and lang_key parts */ - - png_write_chunk_start(png_ptr, (png_bytep)png_iTXt, - (png_uint_32)( - 5 /* comp byte, comp flag, terminators for key, lang and lang_key */ - + key_len - + lang_len - + lang_key_len - + text_len)); - - /* - * We leave it to the application to meet PNG-1.0 requirements on the - * contents of the text. PNG-1.0 through PNG-1.2 discourage the use of - * any non-Latin-1 characters except for NEWLINE. ISO PNG will forbid them. - * The NUL character is forbidden by PNG-1.0 through PNG-1.2 and ISO PNG. - */ - png_write_chunk_data(png_ptr, (png_bytep)new_key, key_len + 1); - - /* set the compression flag */ - if (compression == PNG_ITXT_COMPRESSION_NONE || \ - compression == PNG_TEXT_COMPRESSION_NONE) - cbuf[0] = 0; - else /* compression == PNG_ITXT_COMPRESSION_zTXt */ - cbuf[0] = 1; - /* set the compression method */ - cbuf[1] = 0; - png_write_chunk_data(png_ptr, cbuf, 2); - - cbuf[0] = 0; - png_write_chunk_data(png_ptr, (new_lang ? (png_bytep)new_lang : cbuf), lang_len + 1); - png_write_chunk_data(png_ptr, (lang_key ? (png_bytep)lang_key : cbuf), lang_key_len + 1); - png_write_compressed_data_out(png_ptr, &comp); - - png_write_chunk_end(png_ptr); - png_free(png_ptr, new_key); - if (new_lang) - png_free(png_ptr, new_lang); -} -#endif - -#if defined(PNG_WRITE_oFFs_SUPPORTED) -/* write the oFFs chunk */ -void /* PRIVATE */ -png_write_oFFs(png_structp png_ptr, png_int_32 x_offset, png_int_32 y_offset, - int unit_type) -{ -#ifdef PNG_USE_LOCAL_ARRAYS - PNG_oFFs; -#endif - png_byte buf[9]; - - png_debug(1, "in png_write_oFFs\n"); - if (unit_type >= PNG_OFFSET_LAST) - png_warning(png_ptr, "Unrecognized unit type for oFFs chunk"); - - png_save_int_32(buf, x_offset); - png_save_int_32(buf + 4, y_offset); - buf[8] = (png_byte)unit_type; - - png_write_chunk(png_ptr, (png_bytep)png_oFFs, buf, (png_size_t)9); -} -#endif - -#if defined(PNG_WRITE_pCAL_SUPPORTED) -/* write the pCAL chunk (described in the PNG extensions document) */ -void /* PRIVATE */ -png_write_pCAL(png_structp png_ptr, png_charp purpose, png_int_32 X0, - png_int_32 X1, int type, int nparams, png_charp units, png_charpp params) -{ -#ifdef PNG_USE_LOCAL_ARRAYS - PNG_pCAL; -#endif - png_size_t purpose_len, units_len, total_len; - png_uint_32p params_len; - png_byte buf[10]; - png_charp new_purpose; - int i; - - png_debug1(1, "in png_write_pCAL (%d parameters)\n", nparams); - if (type >= PNG_EQUATION_LAST) - png_warning(png_ptr, "Unrecognized equation type for pCAL chunk"); - - purpose_len = png_check_keyword(png_ptr, purpose, &new_purpose) + 1; - png_debug1(3, "pCAL purpose length = %d\n", (int)purpose_len); - units_len = png_strlen(units) + (nparams == 0 ? 0 : 1); - png_debug1(3, "pCAL units length = %d\n", (int)units_len); - total_len = purpose_len + units_len + 10; - - params_len = (png_uint_32p)png_malloc(png_ptr, (png_uint_32)(nparams - *png_sizeof(png_uint_32))); - - /* Find the length of each parameter, making sure we don't count the - null terminator for the last parameter. */ - for (i = 0; i < nparams; i++) - { - params_len[i] = png_strlen(params[i]) + (i == nparams - 1 ? 0 : 1); - png_debug2(3, "pCAL parameter %d length = %lu\n", i, params_len[i]); - total_len += (png_size_t)params_len[i]; - } - - png_debug1(3, "pCAL total length = %d\n", (int)total_len); - png_write_chunk_start(png_ptr, (png_bytep)png_pCAL, (png_uint_32)total_len); - png_write_chunk_data(png_ptr, (png_bytep)new_purpose, purpose_len); - png_save_int_32(buf, X0); - png_save_int_32(buf + 4, X1); - buf[8] = (png_byte)type; - buf[9] = (png_byte)nparams; - png_write_chunk_data(png_ptr, buf, (png_size_t)10); - png_write_chunk_data(png_ptr, (png_bytep)units, (png_size_t)units_len); - - png_free(png_ptr, new_purpose); - - for (i = 0; i < nparams; i++) - { - png_write_chunk_data(png_ptr, (png_bytep)params[i], - (png_size_t)params_len[i]); - } - - png_free(png_ptr, params_len); - png_write_chunk_end(png_ptr); -} -#endif - -#if defined(PNG_WRITE_sCAL_SUPPORTED) -/* write the sCAL chunk */ -#if defined(PNG_FLOATING_POINT_SUPPORTED) && !defined(PNG_NO_STDIO) -void /* PRIVATE */ -png_write_sCAL(png_structp png_ptr, int unit, double width,double height) -{ -#ifdef PNG_USE_LOCAL_ARRAYS - PNG_sCAL; -#endif - png_size_t total_len; - char wbuf[32], hbuf[32]; - png_byte bunit = unit; - - png_debug(1, "in png_write_sCAL\n"); - -#if defined(_WIN32_WCE) -/* sprintf() function is not supported on WindowsCE */ - { - wchar_t wc_buf[32]; - swprintf(wc_buf, TEXT("%12.12e"), width); - WideCharToMultiByte(CP_ACP, 0, wc_buf, -1, wbuf, 32, NULL, NULL); - swprintf(wc_buf, TEXT("%12.12e"), height); - WideCharToMultiByte(CP_ACP, 0, wc_buf, -1, hbuf, 32, NULL, NULL); - } -#else - sprintf(wbuf, "%12.12e", width); - sprintf(hbuf, "%12.12e", height); -#endif - total_len = 1 + png_strlen(wbuf)+1 + png_strlen(hbuf); - - png_debug1(3, "sCAL total length = %d\n", (int)total_len); - png_write_chunk_start(png_ptr, (png_bytep)png_sCAL, (png_uint_32)total_len); - png_write_chunk_data(png_ptr, (png_bytep)&bunit, 1); - png_write_chunk_data(png_ptr, (png_bytep)wbuf, png_strlen(wbuf)+1); - png_write_chunk_data(png_ptr, (png_bytep)hbuf, png_strlen(hbuf)); - - png_write_chunk_end(png_ptr); -} -#else -#ifdef PNG_FIXED_POINT_SUPPORTED -void /* PRIVATE */ -png_write_sCAL_s(png_structp png_ptr, int unit, png_charp width, - png_charp height) -{ -#ifdef PNG_USE_LOCAL_ARRAYS - PNG_sCAL; -#endif - png_size_t total_len; - char wbuf[32], hbuf[32]; - png_byte bunit = unit; - - png_debug(1, "in png_write_sCAL_s\n"); - - png_strcpy(wbuf,(const char *)width); - png_strcpy(hbuf,(const char *)height); - total_len = 1 + png_strlen(wbuf)+1 + png_strlen(hbuf); - - png_debug1(3, "sCAL total length = %d\n", total_len); - png_write_chunk_start(png_ptr, (png_bytep)png_sCAL, (png_uint_32)total_len); - png_write_chunk_data(png_ptr, (png_bytep)&bunit, 1); - png_write_chunk_data(png_ptr, (png_bytep)wbuf, png_strlen(wbuf)+1); - png_write_chunk_data(png_ptr, (png_bytep)hbuf, png_strlen(hbuf)); - - png_write_chunk_end(png_ptr); -} -#endif -#endif -#endif - -#if defined(PNG_WRITE_pHYs_SUPPORTED) -/* write the pHYs chunk */ -void /* PRIVATE */ -png_write_pHYs(png_structp png_ptr, png_uint_32 x_pixels_per_unit, - png_uint_32 y_pixels_per_unit, - int unit_type) -{ -#ifdef PNG_USE_LOCAL_ARRAYS - PNG_pHYs; -#endif - png_byte buf[9]; - - png_debug(1, "in png_write_pHYs\n"); - if (unit_type >= PNG_RESOLUTION_LAST) - png_warning(png_ptr, "Unrecognized unit type for pHYs chunk"); - - png_save_uint_32(buf, x_pixels_per_unit); - png_save_uint_32(buf + 4, y_pixels_per_unit); - buf[8] = (png_byte)unit_type; - - png_write_chunk(png_ptr, (png_bytep)png_pHYs, buf, (png_size_t)9); -} -#endif - -#if defined(PNG_WRITE_tIME_SUPPORTED) -/* Write the tIME chunk. Use either png_convert_from_struct_tm() - * or png_convert_from_time_t(), or fill in the structure yourself. - */ -void /* PRIVATE */ -png_write_tIME(png_structp png_ptr, png_timep mod_time) -{ -#ifdef PNG_USE_LOCAL_ARRAYS - PNG_tIME; -#endif - png_byte buf[7]; - - png_debug(1, "in png_write_tIME\n"); - if (mod_time->month > 12 || mod_time->month < 1 || - mod_time->day > 31 || mod_time->day < 1 || - mod_time->hour > 23 || mod_time->second > 60) - { - png_warning(png_ptr, "Invalid time specified for tIME chunk"); - return; - } - - png_save_uint_16(buf, mod_time->year); - buf[2] = mod_time->month; - buf[3] = mod_time->day; - buf[4] = mod_time->hour; - buf[5] = mod_time->minute; - buf[6] = mod_time->second; - - png_write_chunk(png_ptr, (png_bytep)png_tIME, buf, (png_size_t)7); -} -#endif - -/* initializes the row writing capability of libpng */ -void /* PRIVATE */ -png_write_start_row(png_structp png_ptr) -{ -#ifdef PNG_USE_LOCAL_ARRAYS - /* arrays to facilitate easy interlacing - use pass (0 - 6) as index */ - - /* start of interlace block */ - int png_pass_start[7] = {0, 4, 0, 2, 0, 1, 0}; - - /* offset to next interlace block */ - int png_pass_inc[7] = {8, 8, 4, 4, 2, 2, 1}; - - /* start of interlace block in the y direction */ - int png_pass_ystart[7] = {0, 0, 4, 0, 2, 0, 1}; - - /* offset to next interlace block in the y direction */ - int png_pass_yinc[7] = {8, 8, 8, 4, 4, 2, 2}; -#endif - - png_size_t buf_size; - - png_debug(1, "in png_write_start_row\n"); - buf_size = (png_size_t)(PNG_ROWBYTES( - png_ptr->usr_channels*png_ptr->usr_bit_depth,png_ptr->width)+1); - - /* set up row buffer */ - png_ptr->row_buf = (png_bytep)png_malloc(png_ptr, (png_uint_32)buf_size); - png_ptr->row_buf[0] = PNG_FILTER_VALUE_NONE; - - /* set up filtering buffer, if using this filter */ - if (png_ptr->do_filter & PNG_FILTER_SUB) - { - png_ptr->sub_row = (png_bytep)png_malloc(png_ptr, - (png_ptr->rowbytes + 1)); - png_ptr->sub_row[0] = PNG_FILTER_VALUE_SUB; - } - - /* We only need to keep the previous row if we are using one of these. */ - if (png_ptr->do_filter & (PNG_FILTER_AVG | PNG_FILTER_UP | PNG_FILTER_PAETH)) - { - /* set up previous row buffer */ - png_ptr->prev_row = (png_bytep)png_malloc(png_ptr, (png_uint_32)buf_size); - png_memset(png_ptr->prev_row, 0, buf_size); - - if (png_ptr->do_filter & PNG_FILTER_UP) - { - png_ptr->up_row = (png_bytep )png_malloc(png_ptr, - (png_ptr->rowbytes + 1)); - png_ptr->up_row[0] = PNG_FILTER_VALUE_UP; - } - - if (png_ptr->do_filter & PNG_FILTER_AVG) - { - png_ptr->avg_row = (png_bytep)png_malloc(png_ptr, - (png_ptr->rowbytes + 1)); - png_ptr->avg_row[0] = PNG_FILTER_VALUE_AVG; - } - - if (png_ptr->do_filter & PNG_FILTER_PAETH) - { - png_ptr->paeth_row = (png_bytep )png_malloc(png_ptr, - (png_ptr->rowbytes + 1)); - png_ptr->paeth_row[0] = PNG_FILTER_VALUE_PAETH; - } - } - -#ifdef PNG_WRITE_INTERLACING_SUPPORTED - /* if interlaced, we need to set up width and height of pass */ - if (png_ptr->interlaced) - { - if (!(png_ptr->transformations & PNG_INTERLACE)) - { - png_ptr->num_rows = (png_ptr->height + png_pass_yinc[0] - 1 - - png_pass_ystart[0]) / png_pass_yinc[0]; - png_ptr->usr_width = (png_ptr->width + png_pass_inc[0] - 1 - - png_pass_start[0]) / png_pass_inc[0]; - } - else - { - png_ptr->num_rows = png_ptr->height; - png_ptr->usr_width = png_ptr->width; - } - } - else -#endif - { - png_ptr->num_rows = png_ptr->height; - png_ptr->usr_width = png_ptr->width; - } - png_ptr->zstream.avail_out = (uInt)png_ptr->zbuf_size; - png_ptr->zstream.next_out = png_ptr->zbuf; -} - -/* Internal use only. Called when finished processing a row of data. */ -void /* PRIVATE */ -png_write_finish_row(png_structp png_ptr) -{ -#ifdef PNG_USE_LOCAL_ARRAYS - /* arrays to facilitate easy interlacing - use pass (0 - 6) as index */ - - /* start of interlace block */ - int png_pass_start[7] = {0, 4, 0, 2, 0, 1, 0}; - - /* offset to next interlace block */ - int png_pass_inc[7] = {8, 8, 4, 4, 2, 2, 1}; - - /* start of interlace block in the y direction */ - int png_pass_ystart[7] = {0, 0, 4, 0, 2, 0, 1}; - - /* offset to next interlace block in the y direction */ - int png_pass_yinc[7] = {8, 8, 8, 4, 4, 2, 2}; -#endif - - int ret; - - png_debug(1, "in png_write_finish_row\n"); - /* next row */ - png_ptr->row_number++; - - /* see if we are done */ - if (png_ptr->row_number < png_ptr->num_rows) - return; - -#ifdef PNG_WRITE_INTERLACING_SUPPORTED - /* if interlaced, go to next pass */ - if (png_ptr->interlaced) - { - png_ptr->row_number = 0; - if (png_ptr->transformations & PNG_INTERLACE) - { - png_ptr->pass++; - } - else - { - /* loop until we find a non-zero width or height pass */ - do - { - png_ptr->pass++; - if (png_ptr->pass >= 7) - break; - png_ptr->usr_width = (png_ptr->width + - png_pass_inc[png_ptr->pass] - 1 - - png_pass_start[png_ptr->pass]) / - png_pass_inc[png_ptr->pass]; - png_ptr->num_rows = (png_ptr->height + - png_pass_yinc[png_ptr->pass] - 1 - - png_pass_ystart[png_ptr->pass]) / - png_pass_yinc[png_ptr->pass]; - if (png_ptr->transformations & PNG_INTERLACE) - break; - } while (png_ptr->usr_width == 0 || png_ptr->num_rows == 0); - - } - - /* reset the row above the image for the next pass */ - if (png_ptr->pass < 7) - { - if (png_ptr->prev_row != NULL) - png_memset(png_ptr->prev_row, 0, - (png_size_t)(PNG_ROWBYTES(png_ptr->usr_channels* - png_ptr->usr_bit_depth,png_ptr->width))+1); - return; - } - } -#endif - - /* if we get here, we've just written the last row, so we need - to flush the compressor */ - do - { - /* tell the compressor we are done */ - ret = deflate(&png_ptr->zstream, Z_FINISH); - /* check for an error */ - if (ret == Z_OK) - { - /* check to see if we need more room */ - if (!(png_ptr->zstream.avail_out)) - { - png_write_IDAT(png_ptr, png_ptr->zbuf, png_ptr->zbuf_size); - png_ptr->zstream.next_out = png_ptr->zbuf; - png_ptr->zstream.avail_out = (uInt)png_ptr->zbuf_size; - } - } - else if (ret != Z_STREAM_END) - { - if (png_ptr->zstream.msg != NULL) - png_error(png_ptr, png_ptr->zstream.msg); - else - png_error(png_ptr, "zlib error"); - } - } while (ret != Z_STREAM_END); - - /* write any extra space */ - if (png_ptr->zstream.avail_out < png_ptr->zbuf_size) - { - png_write_IDAT(png_ptr, png_ptr->zbuf, png_ptr->zbuf_size - - png_ptr->zstream.avail_out); - } - - deflateReset(&png_ptr->zstream); -} - -#if defined(PNG_WRITE_INTERLACING_SUPPORTED) -/* Pick out the correct pixels for the interlace pass. - * The basic idea here is to go through the row with a source - * pointer and a destination pointer (sp and dp), and copy the - * correct pixels for the pass. As the row gets compacted, - * sp will always be >= dp, so we should never overwrite anything. - * See the default: case for the easiest code to understand. - */ -void /* PRIVATE */ -png_do_write_interlace(png_row_infop row_info, png_bytep row, int pass) -{ -#ifdef PNG_USE_LOCAL_ARRAYS - /* arrays to facilitate easy interlacing - use pass (0 - 6) as index */ - - /* start of interlace block */ - int png_pass_start[7] = {0, 4, 0, 2, 0, 1, 0}; - - /* offset to next interlace block */ - int png_pass_inc[7] = {8, 8, 4, 4, 2, 2, 1}; -#endif - - png_debug(1, "in png_do_write_interlace\n"); - /* we don't have to do anything on the last pass (6) */ -#if defined(PNG_USELESS_TESTS_SUPPORTED) - if (row != NULL && row_info != NULL && pass < 6) -#else - if (pass < 6) -#endif - { - /* each pixel depth is handled separately */ - switch (row_info->pixel_depth) - { - case 1: - { - png_bytep sp; - png_bytep dp; - int shift; - int d; - int value; - png_uint_32 i; - png_uint_32 row_width = row_info->width; - - dp = row; - d = 0; - shift = 7; - for (i = png_pass_start[pass]; i < row_width; - i += png_pass_inc[pass]) - { - sp = row + (png_size_t)(i >> 3); - value = (int)(*sp >> (7 - (int)(i & 0x07))) & 0x01; - d |= (value << shift); - - if (shift == 0) - { - shift = 7; - *dp++ = (png_byte)d; - d = 0; - } - else - shift--; - - } - if (shift != 7) - *dp = (png_byte)d; - break; - } - case 2: - { - png_bytep sp; - png_bytep dp; - int shift; - int d; - int value; - png_uint_32 i; - png_uint_32 row_width = row_info->width; - - dp = row; - shift = 6; - d = 0; - for (i = png_pass_start[pass]; i < row_width; - i += png_pass_inc[pass]) - { - sp = row + (png_size_t)(i >> 2); - value = (*sp >> ((3 - (int)(i & 0x03)) << 1)) & 0x03; - d |= (value << shift); - - if (shift == 0) - { - shift = 6; - *dp++ = (png_byte)d; - d = 0; - } - else - shift -= 2; - } - if (shift != 6) - *dp = (png_byte)d; - break; - } - case 4: - { - png_bytep sp; - png_bytep dp; - int shift; - int d; - int value; - png_uint_32 i; - png_uint_32 row_width = row_info->width; - - dp = row; - shift = 4; - d = 0; - for (i = png_pass_start[pass]; i < row_width; - i += png_pass_inc[pass]) - { - sp = row + (png_size_t)(i >> 1); - value = (*sp >> ((1 - (int)(i & 0x01)) << 2)) & 0x0f; - d |= (value << shift); - - if (shift == 0) - { - shift = 4; - *dp++ = (png_byte)d; - d = 0; - } - else - shift -= 4; - } - if (shift != 4) - *dp = (png_byte)d; - break; - } - default: - { - png_bytep sp; - png_bytep dp; - png_uint_32 i; - png_uint_32 row_width = row_info->width; - png_size_t pixel_bytes; - - /* start at the beginning */ - dp = row; - /* find out how many bytes each pixel takes up */ - pixel_bytes = (row_info->pixel_depth >> 3); - /* loop through the row, only looking at the pixels that - matter */ - for (i = png_pass_start[pass]; i < row_width; - i += png_pass_inc[pass]) - { - /* find out where the original pixel is */ - sp = row + (png_size_t)i * pixel_bytes; - /* move the pixel */ - if (dp != sp) - png_memcpy(dp, sp, pixel_bytes); - /* next pixel */ - dp += pixel_bytes; - } - break; - } - } - /* set new row width */ - row_info->width = (row_info->width + - png_pass_inc[pass] - 1 - - png_pass_start[pass]) / - png_pass_inc[pass]; - row_info->rowbytes = PNG_ROWBYTES(row_info->pixel_depth, - row_info->width); - } -} -#endif - -/* This filters the row, chooses which filter to use, if it has not already - * been specified by the application, and then writes the row out with the - * chosen filter. - */ -#define PNG_MAXSUM (~((png_uint_32)0) >> 1) -#define PNG_HISHIFT 10 -#define PNG_LOMASK ((png_uint_32)0xffffL) -#define PNG_HIMASK ((png_uint_32)(~PNG_LOMASK >> PNG_HISHIFT)) -void /* PRIVATE */ -png_write_find_filter(png_structp png_ptr, png_row_infop row_info) -{ - png_bytep prev_row, best_row, row_buf; - png_uint_32 mins, bpp; - png_byte filter_to_do = png_ptr->do_filter; - png_uint_32 row_bytes = row_info->rowbytes; -#if defined(PNG_WRITE_WEIGHTED_FILTER_SUPPORTED) - int num_p_filters = (int)png_ptr->num_prev_filters; -#endif - - png_debug(1, "in png_write_find_filter\n"); - /* find out how many bytes offset each pixel is */ - bpp = (row_info->pixel_depth + 7) >> 3; - - prev_row = png_ptr->prev_row; - best_row = row_buf = png_ptr->row_buf; - mins = PNG_MAXSUM; - - /* The prediction method we use is to find which method provides the - * smallest value when summing the absolute values of the distances - * from zero, using anything >= 128 as negative numbers. This is known - * as the "minimum sum of absolute differences" heuristic. Other - * heuristics are the "weighted minimum sum of absolute differences" - * (experimental and can in theory improve compression), and the "zlib - * predictive" method (not implemented yet), which does test compressions - * of lines using different filter methods, and then chooses the - * (series of) filter(s) that give minimum compressed data size (VERY - * computationally expensive). - * - * GRR 980525: consider also - * (1) minimum sum of absolute differences from running average (i.e., - * keep running sum of non-absolute differences & count of bytes) - * [track dispersion, too? restart average if dispersion too large?] - * (1b) minimum sum of absolute differences from sliding average, probably - * with window size <= deflate window (usually 32K) - * (2) minimum sum of squared differences from zero or running average - * (i.e., ~ root-mean-square approach) - */ - - - /* We don't need to test the 'no filter' case if this is the only filter - * that has been chosen, as it doesn't actually do anything to the data. - */ - if ((filter_to_do & PNG_FILTER_NONE) && - filter_to_do != PNG_FILTER_NONE) - { - png_bytep rp; - png_uint_32 sum = 0; - png_uint_32 i; - int v; - - for (i = 0, rp = row_buf + 1; i < row_bytes; i++, rp++) - { - v = *rp; - sum += (v < 128) ? v : 256 - v; - } - -#if defined(PNG_WRITE_WEIGHTED_FILTER_SUPPORTED) - if (png_ptr->heuristic_method == PNG_FILTER_HEURISTIC_WEIGHTED) - { - png_uint_32 sumhi, sumlo; - int j; - sumlo = sum & PNG_LOMASK; - sumhi = (sum >> PNG_HISHIFT) & PNG_HIMASK; /* Gives us some footroom */ - - /* Reduce the sum if we match any of the previous rows */ - for (j = 0; j < num_p_filters; j++) - { - if (png_ptr->prev_filters[j] == PNG_FILTER_VALUE_NONE) - { - sumlo = (sumlo * png_ptr->filter_weights[j]) >> - PNG_WEIGHT_SHIFT; - sumhi = (sumhi * png_ptr->filter_weights[j]) >> - PNG_WEIGHT_SHIFT; - } - } - - /* Factor in the cost of this filter (this is here for completeness, - * but it makes no sense to have a "cost" for the NONE filter, as - * it has the minimum possible computational cost - none). - */ - sumlo = (sumlo * png_ptr->filter_costs[PNG_FILTER_VALUE_NONE]) >> - PNG_COST_SHIFT; - sumhi = (sumhi * png_ptr->filter_costs[PNG_FILTER_VALUE_NONE]) >> - PNG_COST_SHIFT; - - if (sumhi > PNG_HIMASK) - sum = PNG_MAXSUM; - else - sum = (sumhi << PNG_HISHIFT) + sumlo; - } -#endif - mins = sum; - } - - /* sub filter */ - if (filter_to_do == PNG_FILTER_SUB) - /* it's the only filter so no testing is needed */ - { - png_bytep rp, lp, dp; - png_uint_32 i; - for (i = 0, rp = row_buf + 1, dp = png_ptr->sub_row + 1; i < bpp; - i++, rp++, dp++) - { - *dp = *rp; - } - for (lp = row_buf + 1; i < row_bytes; - i++, rp++, lp++, dp++) - { - *dp = (png_byte)(((int)*rp - (int)*lp) & 0xff); - } - best_row = png_ptr->sub_row; - } - - else if (filter_to_do & PNG_FILTER_SUB) - { - png_bytep rp, dp, lp; - png_uint_32 sum = 0, lmins = mins; - png_uint_32 i; - int v; - -#if defined(PNG_WRITE_WEIGHTED_FILTER_SUPPORTED) - /* We temporarily increase the "minimum sum" by the factor we - * would reduce the sum of this filter, so that we can do the - * early exit comparison without scaling the sum each time. - */ - if (png_ptr->heuristic_method == PNG_FILTER_HEURISTIC_WEIGHTED) - { - int j; - png_uint_32 lmhi, lmlo; - lmlo = lmins & PNG_LOMASK; - lmhi = (lmins >> PNG_HISHIFT) & PNG_HIMASK; - - for (j = 0; j < num_p_filters; j++) - { - if (png_ptr->prev_filters[j] == PNG_FILTER_VALUE_SUB) - { - lmlo = (lmlo * png_ptr->inv_filter_weights[j]) >> - PNG_WEIGHT_SHIFT; - lmhi = (lmhi * png_ptr->inv_filter_weights[j]) >> - PNG_WEIGHT_SHIFT; - } - } - - lmlo = (lmlo * png_ptr->inv_filter_costs[PNG_FILTER_VALUE_SUB]) >> - PNG_COST_SHIFT; - lmhi = (lmhi * png_ptr->inv_filter_costs[PNG_FILTER_VALUE_SUB]) >> - PNG_COST_SHIFT; - - if (lmhi > PNG_HIMASK) - lmins = PNG_MAXSUM; - else - lmins = (lmhi << PNG_HISHIFT) + lmlo; - } -#endif - - for (i = 0, rp = row_buf + 1, dp = png_ptr->sub_row + 1; i < bpp; - i++, rp++, dp++) - { - v = *dp = *rp; - - sum += (v < 128) ? v : 256 - v; - } - for (lp = row_buf + 1; i < row_bytes; - i++, rp++, lp++, dp++) - { - v = *dp = (png_byte)(((int)*rp - (int)*lp) & 0xff); - - sum += (v < 128) ? v : 256 - v; - - if (sum > lmins) /* We are already worse, don't continue. */ - break; - } - -#if defined(PNG_WRITE_WEIGHTED_FILTER_SUPPORTED) - if (png_ptr->heuristic_method == PNG_FILTER_HEURISTIC_WEIGHTED) - { - int j; - png_uint_32 sumhi, sumlo; - sumlo = sum & PNG_LOMASK; - sumhi = (sum >> PNG_HISHIFT) & PNG_HIMASK; - - for (j = 0; j < num_p_filters; j++) - { - if (png_ptr->prev_filters[j] == PNG_FILTER_VALUE_SUB) - { - sumlo = (sumlo * png_ptr->inv_filter_weights[j]) >> - PNG_WEIGHT_SHIFT; - sumhi = (sumhi * png_ptr->inv_filter_weights[j]) >> - PNG_WEIGHT_SHIFT; - } - } - - sumlo = (sumlo * png_ptr->inv_filter_costs[PNG_FILTER_VALUE_SUB]) >> - PNG_COST_SHIFT; - sumhi = (sumhi * png_ptr->inv_filter_costs[PNG_FILTER_VALUE_SUB]) >> - PNG_COST_SHIFT; - - if (sumhi > PNG_HIMASK) - sum = PNG_MAXSUM; - else - sum = (sumhi << PNG_HISHIFT) + sumlo; - } -#endif - - if (sum < mins) - { - mins = sum; - best_row = png_ptr->sub_row; - } - } - - /* up filter */ - if (filter_to_do == PNG_FILTER_UP) - { - png_bytep rp, dp, pp; - png_uint_32 i; - - for (i = 0, rp = row_buf + 1, dp = png_ptr->up_row + 1, - pp = prev_row + 1; i < row_bytes; - i++, rp++, pp++, dp++) - { - *dp = (png_byte)(((int)*rp - (int)*pp) & 0xff); - } - best_row = png_ptr->up_row; - } - - else if (filter_to_do & PNG_FILTER_UP) - { - png_bytep rp, dp, pp; - png_uint_32 sum = 0, lmins = mins; - png_uint_32 i; - int v; - - -#if defined(PNG_WRITE_WEIGHTED_FILTER_SUPPORTED) - if (png_ptr->heuristic_method == PNG_FILTER_HEURISTIC_WEIGHTED) - { - int j; - png_uint_32 lmhi, lmlo; - lmlo = lmins & PNG_LOMASK; - lmhi = (lmins >> PNG_HISHIFT) & PNG_HIMASK; - - for (j = 0; j < num_p_filters; j++) - { - if (png_ptr->prev_filters[j] == PNG_FILTER_VALUE_UP) - { - lmlo = (lmlo * png_ptr->inv_filter_weights[j]) >> - PNG_WEIGHT_SHIFT; - lmhi = (lmhi * png_ptr->inv_filter_weights[j]) >> - PNG_WEIGHT_SHIFT; - } - } - - lmlo = (lmlo * png_ptr->inv_filter_costs[PNG_FILTER_VALUE_UP]) >> - PNG_COST_SHIFT; - lmhi = (lmhi * png_ptr->inv_filter_costs[PNG_FILTER_VALUE_UP]) >> - PNG_COST_SHIFT; - - if (lmhi > PNG_HIMASK) - lmins = PNG_MAXSUM; - else - lmins = (lmhi << PNG_HISHIFT) + lmlo; - } -#endif - - for (i = 0, rp = row_buf + 1, dp = png_ptr->up_row + 1, - pp = prev_row + 1; i < row_bytes; i++) - { - v = *dp++ = (png_byte)(((int)*rp++ - (int)*pp++) & 0xff); - - sum += (v < 128) ? v : 256 - v; - - if (sum > lmins) /* We are already worse, don't continue. */ - break; - } - -#if defined(PNG_WRITE_WEIGHTED_FILTER_SUPPORTED) - if (png_ptr->heuristic_method == PNG_FILTER_HEURISTIC_WEIGHTED) - { - int j; - png_uint_32 sumhi, sumlo; - sumlo = sum & PNG_LOMASK; - sumhi = (sum >> PNG_HISHIFT) & PNG_HIMASK; - - for (j = 0; j < num_p_filters; j++) - { - if (png_ptr->prev_filters[j] == PNG_FILTER_VALUE_UP) - { - sumlo = (sumlo * png_ptr->filter_weights[j]) >> - PNG_WEIGHT_SHIFT; - sumhi = (sumhi * png_ptr->filter_weights[j]) >> - PNG_WEIGHT_SHIFT; - } - } - - sumlo = (sumlo * png_ptr->filter_costs[PNG_FILTER_VALUE_UP]) >> - PNG_COST_SHIFT; - sumhi = (sumhi * png_ptr->filter_costs[PNG_FILTER_VALUE_UP]) >> - PNG_COST_SHIFT; - - if (sumhi > PNG_HIMASK) - sum = PNG_MAXSUM; - else - sum = (sumhi << PNG_HISHIFT) + sumlo; - } -#endif - - if (sum < mins) - { - mins = sum; - best_row = png_ptr->up_row; - } - } - - /* avg filter */ - if (filter_to_do == PNG_FILTER_AVG) - { - png_bytep rp, dp, pp, lp; - png_uint_32 i; - for (i = 0, rp = row_buf + 1, dp = png_ptr->avg_row + 1, - pp = prev_row + 1; i < bpp; i++) - { - *dp++ = (png_byte)(((int)*rp++ - ((int)*pp++ / 2)) & 0xff); - } - for (lp = row_buf + 1; i < row_bytes; i++) - { - *dp++ = (png_byte)(((int)*rp++ - (((int)*pp++ + (int)*lp++) / 2)) - & 0xff); - } - best_row = png_ptr->avg_row; - } - - else if (filter_to_do & PNG_FILTER_AVG) - { - png_bytep rp, dp, pp, lp; - png_uint_32 sum = 0, lmins = mins; - png_uint_32 i; - int v; - -#if defined(PNG_WRITE_WEIGHTED_FILTER_SUPPORTED) - if (png_ptr->heuristic_method == PNG_FILTER_HEURISTIC_WEIGHTED) - { - int j; - png_uint_32 lmhi, lmlo; - lmlo = lmins & PNG_LOMASK; - lmhi = (lmins >> PNG_HISHIFT) & PNG_HIMASK; - - for (j = 0; j < num_p_filters; j++) - { - if (png_ptr->prev_filters[j] == PNG_FILTER_VALUE_AVG) - { - lmlo = (lmlo * png_ptr->inv_filter_weights[j]) >> - PNG_WEIGHT_SHIFT; - lmhi = (lmhi * png_ptr->inv_filter_weights[j]) >> - PNG_WEIGHT_SHIFT; - } - } - - lmlo = (lmlo * png_ptr->inv_filter_costs[PNG_FILTER_VALUE_AVG]) >> - PNG_COST_SHIFT; - lmhi = (lmhi * png_ptr->inv_filter_costs[PNG_FILTER_VALUE_AVG]) >> - PNG_COST_SHIFT; - - if (lmhi > PNG_HIMASK) - lmins = PNG_MAXSUM; - else - lmins = (lmhi << PNG_HISHIFT) + lmlo; - } -#endif - - for (i = 0, rp = row_buf + 1, dp = png_ptr->avg_row + 1, - pp = prev_row + 1; i < bpp; i++) - { - v = *dp++ = (png_byte)(((int)*rp++ - ((int)*pp++ / 2)) & 0xff); - - sum += (v < 128) ? v : 256 - v; - } - for (lp = row_buf + 1; i < row_bytes; i++) - { - v = *dp++ = - (png_byte)(((int)*rp++ - (((int)*pp++ + (int)*lp++) / 2)) & 0xff); - - sum += (v < 128) ? v : 256 - v; - - if (sum > lmins) /* We are already worse, don't continue. */ - break; - } - -#if defined(PNG_WRITE_WEIGHTED_FILTER_SUPPORTED) - if (png_ptr->heuristic_method == PNG_FILTER_HEURISTIC_WEIGHTED) - { - int j; - png_uint_32 sumhi, sumlo; - sumlo = sum & PNG_LOMASK; - sumhi = (sum >> PNG_HISHIFT) & PNG_HIMASK; - - for (j = 0; j < num_p_filters; j++) - { - if (png_ptr->prev_filters[j] == PNG_FILTER_VALUE_NONE) - { - sumlo = (sumlo * png_ptr->filter_weights[j]) >> - PNG_WEIGHT_SHIFT; - sumhi = (sumhi * png_ptr->filter_weights[j]) >> - PNG_WEIGHT_SHIFT; - } - } - - sumlo = (sumlo * png_ptr->filter_costs[PNG_FILTER_VALUE_AVG]) >> - PNG_COST_SHIFT; - sumhi = (sumhi * png_ptr->filter_costs[PNG_FILTER_VALUE_AVG]) >> - PNG_COST_SHIFT; - - if (sumhi > PNG_HIMASK) - sum = PNG_MAXSUM; - else - sum = (sumhi << PNG_HISHIFT) + sumlo; - } -#endif - - if (sum < mins) - { - mins = sum; - best_row = png_ptr->avg_row; - } - } - - /* Paeth filter */ - if (filter_to_do == PNG_FILTER_PAETH) - { - png_bytep rp, dp, pp, cp, lp; - png_uint_32 i; - for (i = 0, rp = row_buf + 1, dp = png_ptr->paeth_row + 1, - pp = prev_row + 1; i < bpp; i++) - { - *dp++ = (png_byte)(((int)*rp++ - (int)*pp++) & 0xff); - } - - for (lp = row_buf + 1, cp = prev_row + 1; i < row_bytes; i++) - { - int a, b, c, pa, pb, pc, p; - - b = *pp++; - c = *cp++; - a = *lp++; - - p = b - c; - pc = a - c; - -#ifdef PNG_USE_ABS - pa = abs(p); - pb = abs(pc); - pc = abs(p + pc); -#else - pa = p < 0 ? -p : p; - pb = pc < 0 ? -pc : pc; - pc = (p + pc) < 0 ? -(p + pc) : p + pc; -#endif - - p = (pa <= pb && pa <=pc) ? a : (pb <= pc) ? b : c; - - *dp++ = (png_byte)(((int)*rp++ - p) & 0xff); - } - best_row = png_ptr->paeth_row; - } - - else if (filter_to_do & PNG_FILTER_PAETH) - { - png_bytep rp, dp, pp, cp, lp; - png_uint_32 sum = 0, lmins = mins; - png_uint_32 i; - int v; - -#if defined(PNG_WRITE_WEIGHTED_FILTER_SUPPORTED) - if (png_ptr->heuristic_method == PNG_FILTER_HEURISTIC_WEIGHTED) - { - int j; - png_uint_32 lmhi, lmlo; - lmlo = lmins & PNG_LOMASK; - lmhi = (lmins >> PNG_HISHIFT) & PNG_HIMASK; - - for (j = 0; j < num_p_filters; j++) - { - if (png_ptr->prev_filters[j] == PNG_FILTER_VALUE_PAETH) - { - lmlo = (lmlo * png_ptr->inv_filter_weights[j]) >> - PNG_WEIGHT_SHIFT; - lmhi = (lmhi * png_ptr->inv_filter_weights[j]) >> - PNG_WEIGHT_SHIFT; - } - } - - lmlo = (lmlo * png_ptr->inv_filter_costs[PNG_FILTER_VALUE_PAETH]) >> - PNG_COST_SHIFT; - lmhi = (lmhi * png_ptr->inv_filter_costs[PNG_FILTER_VALUE_PAETH]) >> - PNG_COST_SHIFT; - - if (lmhi > PNG_HIMASK) - lmins = PNG_MAXSUM; - else - lmins = (lmhi << PNG_HISHIFT) + lmlo; - } -#endif - - for (i = 0, rp = row_buf + 1, dp = png_ptr->paeth_row + 1, - pp = prev_row + 1; i < bpp; i++) - { - v = *dp++ = (png_byte)(((int)*rp++ - (int)*pp++) & 0xff); - - sum += (v < 128) ? v : 256 - v; - } - - for (lp = row_buf + 1, cp = prev_row + 1; i < row_bytes; i++) - { - int a, b, c, pa, pb, pc, p; - - b = *pp++; - c = *cp++; - a = *lp++; - -#ifndef PNG_SLOW_PAETH - p = b - c; - pc = a - c; -#ifdef PNG_USE_ABS - pa = abs(p); - pb = abs(pc); - pc = abs(p + pc); -#else - pa = p < 0 ? -p : p; - pb = pc < 0 ? -pc : pc; - pc = (p + pc) < 0 ? -(p + pc) : p + pc; -#endif - p = (pa <= pb && pa <=pc) ? a : (pb <= pc) ? b : c; -#else /* PNG_SLOW_PAETH */ - p = a + b - c; - pa = abs(p - a); - pb = abs(p - b); - pc = abs(p - c); - if (pa <= pb && pa <= pc) - p = a; - else if (pb <= pc) - p = b; - else - p = c; -#endif /* PNG_SLOW_PAETH */ - - v = *dp++ = (png_byte)(((int)*rp++ - p) & 0xff); - - sum += (v < 128) ? v : 256 - v; - - if (sum > lmins) /* We are already worse, don't continue. */ - break; - } - -#if defined(PNG_WRITE_WEIGHTED_FILTER_SUPPORTED) - if (png_ptr->heuristic_method == PNG_FILTER_HEURISTIC_WEIGHTED) - { - int j; - png_uint_32 sumhi, sumlo; - sumlo = sum & PNG_LOMASK; - sumhi = (sum >> PNG_HISHIFT) & PNG_HIMASK; - - for (j = 0; j < num_p_filters; j++) - { - if (png_ptr->prev_filters[j] == PNG_FILTER_VALUE_PAETH) - { - sumlo = (sumlo * png_ptr->filter_weights[j]) >> - PNG_WEIGHT_SHIFT; - sumhi = (sumhi * png_ptr->filter_weights[j]) >> - PNG_WEIGHT_SHIFT; - } - } - - sumlo = (sumlo * png_ptr->filter_costs[PNG_FILTER_VALUE_PAETH]) >> - PNG_COST_SHIFT; - sumhi = (sumhi * png_ptr->filter_costs[PNG_FILTER_VALUE_PAETH]) >> - PNG_COST_SHIFT; - - if (sumhi > PNG_HIMASK) - sum = PNG_MAXSUM; - else - sum = (sumhi << PNG_HISHIFT) + sumlo; - } -#endif - - if (sum < mins) - { - best_row = png_ptr->paeth_row; - } - } - - /* Do the actual writing of the filtered row data from the chosen filter. */ - - png_write_filtered_row(png_ptr, best_row); - -#if defined(PNG_WRITE_WEIGHTED_FILTER_SUPPORTED) - /* Save the type of filter we picked this time for future calculations */ - if (png_ptr->num_prev_filters > 0) - { - int j; - for (j = 1; j < num_p_filters; j++) - { - png_ptr->prev_filters[j] = png_ptr->prev_filters[j - 1]; - } - png_ptr->prev_filters[j] = best_row[0]; - } -#endif -} - - -/* Do the actual writing of a previously filtered row. */ -void /* PRIVATE */ -png_write_filtered_row(png_structp png_ptr, png_bytep filtered_row) -{ - png_debug(1, "in png_write_filtered_row\n"); - png_debug1(2, "filter = %d\n", filtered_row[0]); - /* set up the zlib input buffer */ - - png_ptr->zstream.next_in = filtered_row; - png_ptr->zstream.avail_in = (uInt)png_ptr->row_info.rowbytes + 1; - /* repeat until we have compressed all the data */ - do - { - int ret; /* return of zlib */ - - /* compress the data */ - ret = deflate(&png_ptr->zstream, Z_NO_FLUSH); - /* check for compression errors */ - if (ret != Z_OK) - { - if (png_ptr->zstream.msg != NULL) - png_error(png_ptr, png_ptr->zstream.msg); - else - png_error(png_ptr, "zlib error"); - } - - /* see if it is time to write another IDAT */ - if (!(png_ptr->zstream.avail_out)) - { - /* write the IDAT and reset the zlib output buffer */ - png_write_IDAT(png_ptr, png_ptr->zbuf, png_ptr->zbuf_size); - png_ptr->zstream.next_out = png_ptr->zbuf; - png_ptr->zstream.avail_out = (uInt)png_ptr->zbuf_size; - } - /* repeat until all data has been compressed */ - } while (png_ptr->zstream.avail_in); - - /* swap the current and previous rows */ - if (png_ptr->prev_row != NULL) - { - png_bytep tptr; - - tptr = png_ptr->prev_row; - png_ptr->prev_row = png_ptr->row_buf; - png_ptr->row_buf = tptr; - } - - /* finish row - updates counters and flushes zlib if last row */ - png_write_finish_row(png_ptr); - -#if defined(PNG_WRITE_FLUSH_SUPPORTED) - png_ptr->flush_rows++; - - if (png_ptr->flush_dist > 0 && - png_ptr->flush_rows >= png_ptr->flush_dist) - { - png_write_flush(png_ptr); - } -#endif -} -#endif /* PNG_WRITE_SUPPORTED */ diff --git a/wxWidgets/src/png/projects/beos/x86-shared.proj b/wxWidgets/src/png/projects/beos/x86-shared.proj deleted file mode 100644 index 1ef178ad6321c056e076c323e8a4aa4f880e4a9b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 7699 zcmeHL%Wl&^6ul;fma0_)s?EUi6$`pR zLPC57Yd(Z8$chzTz=~bDV>?Y+MYL*y8WCT49-g^lpE(}Q9N*oy#S%dNLs8{*fUR#T zFS!69pQEY#h>JR=l*+9Zma~{@0UylstL^pkiQ3;!CCFwKydYQ26;on^UaVC2RC!^}=R|8;uHm)c{8&9(#K!#WEU_)p&{zQQ zI|uN-uvp$Z*j-6ixlS6CA6c|r^%~S|;BNj2Bv_BX!CF{Kka}IJR8p$UY29DOHgO7k zToO3|b4}fMxRJ%JzKi#dFo+=lbG2iO@aLIA!*!=1||K zu1UEz2yYYpK7X%r(*$@pk2f=z(w(1cXC@(FkaE@NrAMmA3~)UMMGCCxyu+1DM#{}@YF=NX-o6RUL{5ai?@fRG%* zke8@(%RHc+KoQI7wkEJ_ZH1#J0!vKCL|}>4%w%ARz}z_&Tq%Y(+M4Yx)sfdOK8SY4 zBRR)`MI034u(4nX9D5?LqyY372(I1H&bCn}gjl>u!6JjiQSFR6rLl}hUi_GtyZ%Py z@b7)~SDCtboSU+HtcpMPl^kOw!wNjE3K2|qL7%K0I>Rwqp bJSb^cqEDsxYP%03sU-{~4E)aw#9PcCWlLU7 diff --git a/wxWidgets/src/png/projects/beos/x86-shared.txt b/wxWidgets/src/png/projects/beos/x86-shared.txt deleted file mode 100644 index 0cd4d9db4c..0000000000 --- a/wxWidgets/src/png/projects/beos/x86-shared.txt +++ /dev/null @@ -1,22 +0,0 @@ -This project builds a shared library version of libpng on x86 BeOS. - -It defines PNG_USE_PNGGCCRD, which activates the assembly code in -pnggccrd.c; this hasn't been extensively tested on BeOS. - -To install: - -1) build - - Note: As of version 1.0.10, you'll get a fair number of warnings when - you compile pnggccrd.c. As far as I know, these are harmless, - but it would be better if someone fixed them. - -2) copy and png.h, pngconf.h somewhere; /boot/home/config/include (which - you'll have to make) is a good choice - -3) copy libpng.so to /boot/home/config/lib - -4) build your libpng.so applications (remember to include libz.a as - well when you link) - -- Chris Herborth, March 27, 2001 diff --git a/wxWidgets/src/png/projects/beos/x86-static.proj b/wxWidgets/src/png/projects/beos/x86-static.proj deleted file mode 100644 index 468febe6a242933a5c2523c94b25190ef1e6d81c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 7699 zcmeHL%Wl&^6uoW?Emf-qRH>B;YIlfMi9tvRA+bo45Rm$?(zIP#&UoUQ_%RwgkBUtf zNJxm!V9htM<_ogoBUrI3cWkFgtB5`l)QI@XGh>hM*ykRPW{&UnyFw8l_o|@s8oaFdu}m2_XZ+yaFH0^R4!zF!C2ZY^ypcEcD_Wz(vN*DEZ6W_Z-1_wEMVv6%nY$DQrB1j z@H+?aA-_=C+1p-DSGZ2bF`2_#sJzrn+>l_2$|ST3hjnbVrTgneQc z__!!)0Op#y?{FiFOMM5gA7Hs~U)&nlPoObBi&%EIfEzQ!rDk2Qz- zK6OpXwSIW(==b?Yg_|b8y*a#?#*+U2bmhb(M6)foj@LIc0bxX@GltCTf#tbMJL9x6 zjC=1X!S8TIOZEJQjq5y?rfXz3X@=T0+NPut=vDi&t@s~f$?80#b8=)gF9U*{OaTbV zAq;tmPHtESv>hm7I^EO+mW_>Y^jKht=@<(vv6>kVED@Mn$AUA(@P?bS-KjeC+{Fjc z_Gl#MD6oi)ViYzKEP-Q>1(p+?=qoed{l@4nHsamT4wh-o+p+tkT5V=48+UCBf~yhCbsae>--`yS(GHv zCJZDD^fM4^kR_4g!G3w48G1lfOoE6%_*iPdSEofplJ|?af!UEzptN7U2z3VbpG*zP zU0f$$fT=>vQ)Rm{8lQP>i$ht9WD(4vEZWjtv!R=`i!*#??3aoC79;uOc - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -[Version Info] -IncludeVerInfo=0 -AutoIncBuild=0 -MajorVer=1 -MinorVer=0 -Release=0 -Build=0 -Debug=0 -PreRelease=0 -Special=0 -Private=0 -DLL=1 -Locale=2057 -CodePage=1252 - -[Version Info Keys] -CompanyName= -FileDescription= -FileVersion=1.0.0.0 -InternalName= -LegalCopyright= -LegalTrademarks= -OriginalFilename= -ProductName= -ProductVersion= -Comments= - -[HistoryLists\hlIncludePath] -Count=18 -Item0=..\..;..\..\..\zlib;$(BCB)\include -Item1=..\..;P:\My Documents\Source\PNG+ZLib\zlib;$(BCB)\include -Item2=..\..;..\Source\ThirdParty\PortableNetworkGraphics\external;..\Source\ThirdParty\PortableNetworkGraphics;..\Source\ThirdParty\ZLibCompression\external;$(BCB)\include -Item3=..\Source\ThirdParty\PortableNetworkGraphics\external;..\Source\ThirdParty\PortableNetworkGraphics;..\Source\ThirdParty\ZLibCompression\external;$(BCB)\include -Item4=..\Source\ThirdParty\PortableNetworkGraphics\external;..\Source\ThirdParty\PortableNetworkGraphics;..\Source\ThirdParty\ZLibCompression;$(BCB)\include -Item5=..\Source\ThirdParty\PortableNetworkGraphics;..\Source\ThirdParty\ZLibCompression;$(BCB)\include -Item6=..\Source\ThirdParty\PortableNetworkGraphics;P:\Development\Source\ThirdParty\ZLibCompression;$(BCB)\include -Item7=..\Source\ThirdParty\PortableNetworkGraphics;$(BCB)\include -Item8=$(BCB)\include -Item9=..\Source;..\Source\General\Templates;..\Source\SIMUtilities;$(BCB)\include;$(BCB)\include\vcl -Item10=P:\Development\Source\;P:\Development\Source\General\Templates\;P:\Development\Source\SIMUtilities\;$(BCB)\include;$(BCB)\include\vcl -Item11=P:\Development\Source;P:\Development\Source\General\Templates\;P:\Development\Source\SIMUtilities\;$(BCB)\include;$(BCB)\include\vcl -Item12=P:\Development\Source\General\Templates\;P:\Development\Source\SIMUtilities\;$(BCB)\include;$(BCB)\include\vcl -Item13=P:\Development\Source\General\Templates\;P:\Development\Source\SIMUtilities;$(BCB)\include;$(BCB)\include\vcl -Item14=P:\Development\Source\General\Templates\;$(BCB)\include;$(BCB)\include\vcl -Item15=P:\Development\Source\General\Templates;$(BCB)\include;$(BCB)\include\vcl -Item16=P:\Development\Source;$(BCB)\include;$(BCB)\include\vcl -Item17=$(BCB)\include;$(BCB)\include\vcl - -[HistoryLists\hlLibraryPath] -Count=10 -Item0=..\..;$(BCB)\lib\obj;$(BCB)\lib -Item1=..\..;..\Source\ThirdParty\PortableNetworkGraphics\external;..\Source\ThirdParty\PortableNetworkGraphics;$(BCB)\lib\obj;$(BCB)\lib -Item2=..\Source\ThirdParty\PortableNetworkGraphics\external;..\Source\ThirdParty\PortableNetworkGraphics;$(BCB)\lib\obj;$(BCB)\lib -Item3=..\Source\ThirdParty\PortableNetworkGraphics;$(BCB)\lib\obj;$(BCB)\lib -Item4=$(BCB)\lib\obj;$(BCB)\lib -Item5=..\Source\SIMUtilities;..\Source;$(BCB)\lib\obj;$(BCB)\lib -Item6=P:\Development\Source\SIMUtilities\;P:\Development\Source\;$(BCB)\lib\obj;$(BCB)\lib -Item7=P:\Development\Source\SIMUtilities;P:\Development\Source\;$(BCB)\lib\obj;$(BCB)\lib -Item8=P:\Development\Source\;$(BCB)\lib\obj;$(BCB)\lib -Item9=P:\Development\Source;$(BCB)\lib\obj;$(BCB)\lib - -[HistoryLists\hlDebugSourcePath] -Count=1 -Item0=$(BCB)\source\vcl - -[HistoryLists\hlConditionals] -Count=20 -Item0=ZLIB_DLL;Z_PREFIX;PNG_BUILD_DLL;PNG_NO_MODULEDEF -Item1=_DEBUG;ZLIB_DLL;Z_PREFIX;PNG_BUILD_DLL;PNG_NO_MODULEDEF -Item2=PNG_BUILD_DLL;ZLIB_DLL;_DEBUG;PNG_NO_MODULEDEF -Item3=PNG_BUILD_DLL;ZLIB_DLL;_DEBUG;PNG_DEBUG=5;PNG_NO_MODULEDEF;PNG_NO_GLOBAL_ARRAYS -Item4=PNG_BUILD_DLL;ZLIB_DLL;_DEBUG;PNG_DEBUG=5;PNG_NO_MODULEDEF;PNG_SETJMP_NOT_SUPPORTED;PNG_DEBUG_FILE=stderr -Item5=PNG_BUILD_DLL;ZLIB_DLL;_DEBUG;PNG_DEBUG;PNG_NO_MODULEDEF;PNG_SETJMP_NOT_SUPPORTED -Item6=PNG_BUILD_DLL;ZLIB_DLL;_DEBUG;PNG_DEBUG=5;PNG_NO_MODULEDEF;PNG_SETJMP_NOT_SUPPORTED -Item7=PNG_BUILD_DLL;ZLIB_DLL;_DEBUG;PNG_DEBUG=5;PNG_NO_MODULEDEF -Item8=PNG_BUILD_DLL;ZLIB_DLL;_DEBUG;PNG_DEBUG=5 -Item9=PNG_BUILD_DLL;ZLIB_DLL;_DEBUG -Item10=PNG_BUILD_DLL;ZLIB_DLL -Item11=PNG_BUILD_DLL -Item12=PNG_DLL;PNG_BUILD_DLL;ZLIB_DLL -Item13=PNG_DLL;PNG_BUILD_DLL;PNG_NO_GLOBAL_ARRAYS;ZLIB_DLL -Item14=PNG_DLL;PNG_BUILD_DLL;PNG_NO_GLOBAL_ARRAYS -Item15=PNG_DLL;PNG_BUILD_DLL -Item16=PNG_DLL;PNG_BUILD_DLL;PNG_MODULEDEF -Item17=_HTML_FORM -Item18=_DEBUG;_HTML_FORM -Item19=_DEBUG - -[HistoryLists\hlIntOutputDir] -Count=2 -Item0=..\Obj -Item1=P:\Development\Obj - -[Debugging] -DebugSourceDirs= - -[Parameters] -RunParams= -HostApplication=P:\Development\Executables\LibPNGTestApp.exe -RemoteHost= -RemotePath= -RemoteDebug=0 - -[Compiler] -ShowInfoMsgs=0 -LinkDebugVcl=0 -LinkCGLIB=0 - - \ No newline at end of file diff --git a/wxWidgets/src/png/projects/cbuilder5/libpng.cpp b/wxWidgets/src/png/projects/cbuilder5/libpng.cpp deleted file mode 100644 index 4e2f274d41..0000000000 --- a/wxWidgets/src/png/projects/cbuilder5/libpng.cpp +++ /dev/null @@ -1,29 +0,0 @@ -//--------------------------------------------------------------------------- -#include -//--------------------------------------------------------------------------- -// Important note about DLL memory management when your DLL uses the -// static version of the RunTime Library: -// -// If your DLL exports any functions that pass String objects (or structs/ -// classes containing nested Strings) as parameter or function results, -// you will need to add the library MEMMGR.LIB to both the DLL project and -// any other projects that use the DLL. You will also need to use MEMMGR.LIB -// if any other projects which use the DLL will be performing new or delete -// operations on any non-TObject-derived classes which are exported from the -// DLL. Adding MEMMGR.LIB to your project will change the DLL and its calling -// EXE's to use the BORLNDMM.DLL as their memory manager. In these cases, -// the file BORLNDMM.DLL should be deployed along with your DLL. -// -// To avoid using BORLNDMM.DLL, pass string information using "char *" or -// ShortString parameters. -// -// If your DLL uses the dynamic version of the RTL, you do not need to -// explicitly add MEMMGR.LIB as this will be done implicitly for you -//--------------------------------------------------------------------------- - -int WINAPI DllEntryPoint(HINSTANCE, unsigned long, void*) -{ - return 1; -} -//--------------------------------------------------------------------------- - \ No newline at end of file diff --git a/wxWidgets/src/png/projects/cbuilder5/libpng.readme.txt b/wxWidgets/src/png/projects/cbuilder5/libpng.readme.txt deleted file mode 100644 index c99c1e9a77..0000000000 --- a/wxWidgets/src/png/projects/cbuilder5/libpng.readme.txt +++ /dev/null @@ -1,25 +0,0 @@ -Project files to build libpng using Borland C++ Builder v5.0 - -In order to build and use libpng, please follow these steps: - - 1). Install zlib in a directory at the same level with libpng. - - 2). In a console window, go to the zlib directory and type: - make -f win32\Makefile.bor - After performing this step, you should have a file named - zlib.lib in the zlib directory. - - 3). Add the following conditional define to your project: - PNG_USE_DLL - - 4). Add libpng.lib or libpngstat.lib to the project. - Build the project. - - 5). If the build fails, add the paths to png.h and zlib.h to - your include path, and restart the build. - -By default, the libpng project uses zlib as a static library. If -you wish to use zlib as a DLL, please read the important notes from -the zlib DLL FAQ, found inside the zlib distribution. - -See the libpng documentation for instructions on how to use the code. diff --git a/wxWidgets/src/png/projects/cbuilder5/libpngstat.bpf b/wxWidgets/src/png/projects/cbuilder5/libpngstat.bpf deleted file mode 100644 index fbc5c406c5..0000000000 --- a/wxWidgets/src/png/projects/cbuilder5/libpngstat.bpf +++ /dev/null @@ -1,22 +0,0 @@ -USEUNIT("..\..\png.c"); -USEUNIT("..\..\pngerror.c"); -USEUNIT("..\..\pngget.c"); -USEUNIT("..\..\pngmem.c"); -USEUNIT("..\..\pngpread.c"); -USEUNIT("..\..\pngread.c"); -USEUNIT("..\..\pngrio.c"); -USEUNIT("..\..\pngrtran.c"); -USEUNIT("..\..\pngrutil.c"); -USEUNIT("..\..\pngset.c"); -USEUNIT("..\..\pngtrans.c"); -USEUNIT("..\..\pngwio.c"); -USEUNIT("..\..\pngwrite.c"); -USEUNIT("..\..\pngwtran.c"); -USEUNIT("..\..\pngwutil.c"); -USELIB("..\..\..\zlib\zlib.lib"); -//--------------------------------------------------------------------------- -#define Library - -// To add a file to the library use the Project menu 'Add to Project'. - - \ No newline at end of file diff --git a/wxWidgets/src/png/projects/cbuilder5/libpngstat.bpr b/wxWidgets/src/png/projects/cbuilder5/libpngstat.bpr deleted file mode 100644 index 9a51ecc88a..0000000000 --- a/wxWidgets/src/png/projects/cbuilder5/libpngstat.bpr +++ /dev/null @@ -1,109 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -[Version Info] -IncludeVerInfo=0 -AutoIncBuild=0 -MajorVer=1 -MinorVer=0 -Release=0 -Build=0 -Debug=0 -PreRelease=0 -Special=0 -Private=0 -DLL=0 -Locale=2057 -CodePage=1252 - -[Version Info Keys] -CompanyName= -FileDescription= -FileVersion=1.0.0.0 -InternalName= -LegalCopyright= -LegalTrademarks= -OriginalFilename= -ProductName= -ProductVersion=1.0.0.0 -Comments= - -[HistoryLists\hlIncludePath] -Count=2 -Item0=..\..;P:\My Documents\Source\PNG+ZLib\zlib;$(BCB)\include -Item1=..\..;$(BCB)\include;$(BCB)\include\vcl - -[HistoryLists\hlLibraryPath] -Count=1 -Item0=..\..;$(BCB)\lib\obj;$(BCB)\lib - -[HistoryLists\hlDebugSourcePath] -Count=1 -Item0=$(BCB)\source\vcl - -[HistoryLists\hlConditionals] -Count=1 -Item0=_DEBUG - -[HistoryLists\hlTlibPageSize] -Count=1 -Item0=0x0010 - -[Debugging] -DebugSourceDirs=$(BCB)\source\vcl - -[Parameters] -RunParams= -HostApplication= -RemoteHost= -RemotePath= -RemoteDebug=0 - -[Compiler] -ShowInfoMsgs=0 -LinkDebugVcl=0 -LinkCGLIB=0 - -[Language] -ActiveLang= -ProjectLang= -RootDir= - - \ No newline at end of file diff --git a/wxWidgets/src/png/projects/cbuilder5/zlib.readme.txt b/wxWidgets/src/png/projects/cbuilder5/zlib.readme.txt deleted file mode 100644 index cb6a7a81ea..0000000000 --- a/wxWidgets/src/png/projects/cbuilder5/zlib.readme.txt +++ /dev/null @@ -1,14 +0,0 @@ -The project that builds libpng under Borland C++ Builder does not -explicitly build zlib. By taking this decision, there is no need -to update the libpng project each time when there is a change in -the list of zlib source files. After all, this list is private to -zlib, and applications (such as libpng) should not assume anything -about it. - -If you wish to contribute a project that builds zlib under Borland -C++ Builder, please submit it to the zlib developers, not to the -libpng developers. - -By default, the libpng project uses zlib as a static library. If -you wish to use zlib as a DLL, please read the important notes from -the zlib DLL FAQ, found inside the zlib distribution. diff --git a/wxWidgets/src/png/projects/netware.txt b/wxWidgets/src/png/projects/netware.txt deleted file mode 100644 index 178361da8f..0000000000 --- a/wxWidgets/src/png/projects/netware.txt +++ /dev/null @@ -1,6 +0,0 @@ -A set of project files is available for Netware. Get -libpng-1.2.5-project-netware.zip from a libpng distribution -site such as http://libpng.sourceforge.net - -Put the zip file in this directory (projects) and then run -"unzip -a libpng-1.2.5-project-netware.zip" diff --git a/wxWidgets/src/png/projects/visualc6/README.txt b/wxWidgets/src/png/projects/visualc6/README.txt deleted file mode 100644 index 6da12e4f95..0000000000 --- a/wxWidgets/src/png/projects/visualc6/README.txt +++ /dev/null @@ -1,64 +0,0 @@ -Microsoft Developer Studio Project File, Format Version 6.00 for libpng. - -Copyright (C) 2000-2004 Simon-Pierre Cadieux. -Copyright (C) 2004 Cosmin Truta. -For conditions of distribution and use, see copyright notice in png.h - - -Assumptions: -* The libpng source files are in ..\.. -* The zlib source files are in ..\..\..\zlib -* The zlib project files are in ..\..\..\zlib\projects\visualc6 - - -To use: - -1) On the main menu, select "File | Open Workspace". - Open "libpng.dsw". - -2) Select "Build | Set Active Configuration". - Choose the configuration you wish to build. - (Choose libpng or pngtest; zlib will be built automatically.) - -3) Select "Build | Clean". - -4) Select "Build | Build ... (F7)". Ignore warning messages about - not being able to find certain include files (e.g. alloc.h). - -5) If you built the sample program (pngtest), - select "Build | Execute ... (Ctrl+F5)". - - -This project builds the libpng binaries as follows: - -* Win32_DLL_Release\libpng13.dll DLL build -* Win32_DLL_Debug\libpng13d.dll DLL build (debug version) -* Win32_DLL_ASM_Release\libpng13.dll DLL build using ASM code -* Win32_DLL_ASM_Debug\libpng13d.dll DLL build using ASM (debug version) -* Win32_DLL_VB\libpng13vb.dll DLL build for Visual Basic, using stdcall -* Win32_LIB_Release\libpng.lib static build -* Win32_LIB_Debug\libpngd.lib static build (debug version) -* Win32_LIB_ASM_Release\libpng.lib static build using ASM code -* Win32_LIB_ASM_Debug\libpngd.lib static build using ASM (debug version) - - -Notes: - -If you change anything in the source files, or select different compiler -settings, please change the DLL name to something different than any of -the above names. - -Also, make sure that DLLFNAME_POSTFIX and (PRIVATEBUILD or SPECIALBUILD) -are defined when compiling the resource file. DLLFNAME_POSTFIX contains -the trailing letters that come after the version number. PRIVATEBUILD -and/or SPECIALBUILD store information describing the type of change made -in the VERSIONINFO structure. Please refer to MSDN for more information -on the used macros and the nature of their content. For an example on -how to define these macros, look at the resource compiler settings for -the "Win32 DLL VB" configuration. - -All DLLs built by this project use the Microsoft dynamic C runtime library -MSVCRT.DLL (MSVCRTD.DLL for debug versions). If you distribute any of the -above mentioned libraries you should also include this DLL in your package. -For a list of files that are redistributable in Visual C++ 6.0, see -Common\Redist\Redist.txt on Disc 1 of the Visual C++ 6.0 product CDs. diff --git a/wxWidgets/src/png/projects/visualc6/libpng.dsp b/wxWidgets/src/png/projects/visualc6/libpng.dsp deleted file mode 100644 index 73a3766f72..0000000000 --- a/wxWidgets/src/png/projects/visualc6/libpng.dsp +++ /dev/null @@ -1,507 +0,0 @@ -# Microsoft Developer Studio Project File - Name="libpng" - 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=libpng - 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 "libpng.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 "libpng.mak" CFG="libpng - Win32 DLL Release" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "libpng - Win32 DLL Release" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "libpng - Win32 DLL Debug" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "libpng - Win32 DLL ASM Release" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "libpng - Win32 DLL ASM Debug" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "libpng - Win32 DLL VB" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "libpng - Win32 LIB Release" (based on "Win32 (x86) Static Library") -!MESSAGE "libpng - Win32 LIB Debug" (based on "Win32 (x86) Static Library") -!MESSAGE "libpng - Win32 LIB ASM Release" (based on "Win32 (x86) Static Library") -!MESSAGE "libpng - Win32 LIB ASM Debug" (based on "Win32 (x86) Static Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" - -!IF "$(CFG)" == "libpng - Win32 DLL Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "libpng___Win32_DLL_Release" -# PROP BASE Intermediate_Dir "libpng___Win32_DLL_Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Win32_DLL_Release" -# PROP Intermediate_Dir "Win32_DLL_Release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -CPP=cl.exe -# ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /FD /c -# SUBTRACT BASE CPP /YX /Yc /Yu -# ADD CPP /nologo /MD /W3 /O2 /I "..\.." /I "..\..\..\zlib" /D "WIN32" /D "NDEBUG" /D "PNG_BUILD_DLL" /D "ZLIB_DLL" /FD /c -# SUBTRACT CPP /YX /Yc /Yu -MTL=midl.exe -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -RSC=rc.exe -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /i "..\.." /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 /nologo /dll /machine:I386 -# ADD LINK32 zlib1.lib /nologo /dll /machine:I386 /out:"Win32_DLL_Release\libpng13.dll" /libpath:"..\..\..\zlib\projects\visualc6\Win32_DLL_Release" - -!ELSEIF "$(CFG)" == "libpng - Win32 DLL Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "libpng___Win32_DLL_Release" -# PROP BASE Intermediate_Dir "libpng___Win32_DLL_Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Win32_DLL_Debug" -# PROP Intermediate_Dir "Win32_DLL_Debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -CPP=cl.exe -# ADD BASE CPP /nologo /MDd /W3 /Gm /ZI /Od /D "WIN32" /D "_DEBUG" /FD /GZ /c -# SUBTRACT BASE CPP /YX /Yc /Yu -# ADD CPP /nologo /MDd /W3 /Gm /ZI /Od /I "..\.." /I "..\..\..\zlib" /D "WIN32" /D "_DEBUG" /D "DEBUG" /D PNG_DEBUG=1 /D "PNG_BUILD_DLL" /D "ZLIB_DLL" /FD /GZ /c -# SUBTRACT CPP /YX /Yc /Yu -MTL=midl.exe -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -RSC=rc.exe -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /i "..\.." /d "_DEBUG" /d PNG_DEBUG=1 -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 /nologo /dll /debug /machine:I386 /pdbtype:sept -# ADD LINK32 zlib1d.lib /nologo /dll /debug /machine:I386 /out:"Win32_DLL_Debug\libpng13d.dll" /libpath:"..\..\..\zlib\projects\visualc6\Win32_DLL_Debug" - -!ELSEIF "$(CFG)" == "libpng - Win32 DLL ASM Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "libpng___Win32_DLL_ASM_Release" -# PROP BASE Intermediate_Dir "libpng___Win32_DLL_ASM_Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Win32_DLL_ASM_Release" -# PROP Intermediate_Dir "Win32_DLL_ASM_Release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -CPP=cl.exe -# ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /FD /c -# SUBTRACT BASE CPP /YX /Yc /Yu -# ADD CPP /nologo /MD /W3 /O2 /I "..\.." /I "..\..\..\zlib" /D "WIN32" /D "NDEBUG" /D "PNG_USE_PNGVCRD" /D "PNG_BUILD_DLL" /D "ZLIB_DLL" /FD /c -# SUBTRACT CPP /YX /Yc /Yu -MTL=midl.exe -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -RSC=rc.exe -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /i "..\.." /d "NDEBUG" /d "PNG_USE_PNGVCRD" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 /nologo /dll /machine:I386 -# ADD LINK32 zlib1.lib /nologo /dll /machine:I386 /out:"Win32_DLL_ASM_Release\libpng13.dll" /libpath:"..\..\..\zlib\projects\visualc6\Win32_DLL_ASM_Release" - -!ELSEIF "$(CFG)" == "libpng - Win32 DLL ASM Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "libpng___Win32_DLL_ASM_Debug" -# PROP BASE Intermediate_Dir "libpng___Win32_DLL_ASM_Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Win32_DLL_ASM_Debug" -# PROP Intermediate_Dir "Win32_DLL_ASM_Debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -CPP=cl.exe -# ADD BASE CPP /nologo /MDd /W3 /Gm /ZI /Od /D "WIN32" /D "_DEBUG" /FD /GZ /c -# SUBTRACT BASE CPP /YX /Yc /Yu -# ADD CPP /nologo /MDd /W3 /Gm /ZI /Od /I "..\.." /I "..\..\..\zlib" /D "WIN32" /D "_DEBUG" /D "DEBUG" /D PNG_DEBUG=1 /D "PNG_USE_PNGVCRD" /D "PNG_BUILD_DLL" /D "ZLIB_DLL" /FD /GZ /c -# SUBTRACT CPP /YX /Yc /Yu -MTL=midl.exe -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -RSC=rc.exe -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /i "..\.." /d "_DEBUG" /d PNG_DEBUG=1 /d "PNG_USE_PNGVCRD" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 /nologo /dll /debug /machine:I386 /pdbtype:sept -# ADD LINK32 zlib1d.lib /nologo /dll /debug /machine:I386 /out:"Win32_DLL_ASM_Debug\libpng13d.dll" /libpath:"..\..\..\zlib\projects\visualc6\Win32_DLL_ASM_Debug" - -!ELSEIF "$(CFG)" == "libpng - Win32 DLL VB" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "libpng___Win32_DLL_VB" -# PROP BASE Intermediate_Dir "libpng___Win32_DLL_VB" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Win32_DLL_VB" -# PROP Intermediate_Dir "Win32_DLL_VB" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -CPP=cl.exe -# ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /FD /c -# SUBTRACT BASE CPP /YX /Yc /Yu -# ADD CPP /nologo /MD /W3 /O2 /I "..\.." /I "..\..\..\zlib" /D "WIN32" /D "NDEBUG" /D "PNG_BUILD_DLL" /D "ZLIB_DLL" /D PNGAPI=__stdcall /D "PNG_NO_MODULEDEF" /FD /c -# SUBTRACT CPP /YX /Yc /Yu -MTL=midl.exe -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -RSC=rc.exe -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /i "..\.." /d "NDEBUG" /dDLLFNAME_POSTFIX=""""VB"""" /dSPECIALBUILD=""""__stdcall calling convention used for exported functions"""" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 /nologo /dll /machine:I386 -# ADD LINK32 zlib1.lib /nologo /dll /machine:I386 /out:"Win32_DLL_VB\libpng13vb.dll" /libpath:"..\..\..\zlib\projects\visualc6\Win32_DLL_Release" -# Begin Special Build Tool -OutDir=.\Win32_DLL_VB -TargetName=libpng13vb -SOURCE="$(InputPath)" -PostBuild_Cmds=echo Deleting $(targetname) import library and export file (Not required for VB projects) del $(outdir)\$(targetname).lib del $(outdir)\$(targetname).exp -# End Special Build Tool - -!ELSEIF "$(CFG)" == "libpng - Win32 LIB Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "libpng___Win32_LIB_Release" -# PROP BASE Intermediate_Dir "libpng___Win32_LIB_Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Win32_LIB_Release" -# PROP Intermediate_Dir "Win32_LIB_Release" -# PROP Target_Dir "" -CPP=cl.exe -# ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /FD /c -# SUBTRACT BASE CPP /YX /Yc /Yu -# ADD CPP /nologo /MD /W3 /O2 /I "..\.." /I "..\..\..\zlib" /D "WIN32" /D "NDEBUG" /FD /c -# SUBTRACT CPP /YX /Yc /Yu -RSC=rc.exe -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /i "..\.." /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo - -!ELSEIF "$(CFG)" == "libpng - Win32 LIB Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "libpng___Win32_LIB_Debug" -# PROP BASE Intermediate_Dir "libpng___Win32_LIB_Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Win32_LIB_Debug" -# PROP Intermediate_Dir "Win32_LIB_Debug" -# PROP Target_Dir "" -CPP=cl.exe -# ADD BASE CPP /nologo /MDd /W3 /Gm /ZI /Od /D "WIN32" /D "_DEBUG" /FD /GZ /c -# SUBTRACT BASE CPP /YX /Yc /Yu -# ADD CPP /nologo /MDd /W3 /Gm /ZI /Od /I "..\.." /I "..\..\..\zlib" /D "WIN32" /D "_DEBUG" /D "DEBUG" /D PNG_DEBUG=1 /FD /GZ /c -# SUBTRACT CPP /YX /Yc /Yu -RSC=rc.exe -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo /out:"Win32_LIB_Debug\libpngd.lib" - -!ELSEIF "$(CFG)" == "libpng - Win32 LIB ASM Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "libpng___Win32_LIB_ASM_Release" -# PROP BASE Intermediate_Dir "libpng___Win32_LIB_ASM_Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Win32_LIB_ASM_Release" -# PROP Intermediate_Dir "Win32_LIB_ASM_Release" -# PROP Target_Dir "" -CPP=cl.exe -# ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /FD /c -# SUBTRACT BASE CPP /YX /Yc /Yu -# ADD CPP /nologo /MD /W3 /O2 /I "..\.." /I "..\..\..\zlib" /D "WIN32" /D "NDEBUG" /D "PNG_USE_PNGVCRD" /FD /c -# SUBTRACT CPP /YX /Yc /Yu -RSC=rc.exe -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /i "..\.." /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo - -!ELSEIF "$(CFG)" == "libpng - Win32 LIB ASM Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "libpng___Win32_LIB_ASM_Debug" -# PROP BASE Intermediate_Dir "libpng___Win32_LIB_ASM_Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Win32_LIB_ASM_Debug" -# PROP Intermediate_Dir "Win32_LIB_ASM_Debug" -# PROP Target_Dir "" -CPP=cl.exe -# ADD BASE CPP /nologo /MDd /W3 /Gm /ZI /Od /D "WIN32" /D "_DEBUG" /FD /GZ /c -# SUBTRACT BASE CPP /YX /Yc /Yu -# ADD CPP /nologo /MDd /W3 /Gm /ZI /Od /I "..\.." /I "..\..\..\zlib" /D "WIN32" /D "_DEBUG" /D "DEBUG" /D PNG_DEBUG=1 /D "PNG_USE_PNGVCRD" /FD /GZ /c -# SUBTRACT CPP /YX /Yc /Yu -RSC=rc.exe -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo /out:"Win32_LIB_ASM_Debug\libpngd.lib" - -!ENDIF - -# Begin Target - -# Name "libpng - Win32 DLL Release" -# Name "libpng - Win32 DLL Debug" -# Name "libpng - Win32 DLL ASM Release" -# Name "libpng - Win32 DLL ASM Debug" -# Name "libpng - Win32 DLL VB" -# Name "libpng - Win32 LIB Release" -# Name "libpng - Win32 LIB Debug" -# Name "libpng - Win32 LIB ASM Release" -# Name "libpng - Win32 LIB ASM Debug" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=..\..\png.c -# End Source File -# Begin Source File - -SOURCE=..\..\pngerror.c -# End Source File -# Begin Source File - -SOURCE=..\..\pngget.c -# End Source File -# Begin Source File - -SOURCE=..\..\pngmem.c -# End Source File -# Begin Source File - -SOURCE=..\..\pngpread.c -# End Source File -# Begin Source File - -SOURCE=..\..\pngread.c -# End Source File -# Begin Source File - -SOURCE=..\..\pngrio.c -# End Source File -# Begin Source File - -SOURCE=..\..\pngrtran.c -# End Source File -# Begin Source File - -SOURCE=..\..\pngrutil.c -# End Source File -# Begin Source File - -SOURCE=..\..\pngset.c -# End Source File -# Begin Source File - -SOURCE=..\..\pngtrans.c -# End Source File -# Begin Source File - -SOURCE=..\..\pngvcrd.c - -!IF "$(CFG)" == "libpng - Win32 DLL Release" - -# PROP Exclude_From_Build 1 - -!ELSEIF "$(CFG)" == "libpng - Win32 DLL Debug" - -# PROP Exclude_From_Build 1 - -!ELSEIF "$(CFG)" == "libpng - Win32 DLL ASM Release" - -!ELSEIF "$(CFG)" == "libpng - Win32 DLL ASM Debug" - -!ELSEIF "$(CFG)" == "libpng - Win32 DLL VB" - -# PROP Exclude_From_Build 1 - -!ELSEIF "$(CFG)" == "libpng - Win32 LIB Release" - -# PROP Exclude_From_Build 1 - -!ELSEIF "$(CFG)" == "libpng - Win32 LIB Debug" - -# PROP Exclude_From_Build 1 - -!ELSEIF "$(CFG)" == "libpng - Win32 LIB ASM Release" - -!ELSEIF "$(CFG)" == "libpng - Win32 LIB ASM Debug" - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\..\scripts\pngw32.def - -!IF "$(CFG)" == "libpng - Win32 DLL Release" - -!ELSEIF "$(CFG)" == "libpng - Win32 DLL Debug" - -!ELSEIF "$(CFG)" == "libpng - Win32 DLL ASM Release" - -!ELSEIF "$(CFG)" == "libpng - Win32 DLL ASM Debug" - -!ELSEIF "$(CFG)" == "libpng - Win32 DLL VB" - -# PROP Exclude_From_Build 1 - -!ELSEIF "$(CFG)" == "libpng - Win32 LIB Release" - -# PROP Exclude_From_Build 1 - -!ELSEIF "$(CFG)" == "libpng - Win32 LIB Debug" - -# PROP Exclude_From_Build 1 - -!ELSEIF "$(CFG)" == "libpng - Win32 LIB ASM Release" - -# PROP Exclude_From_Build 1 - -!ELSEIF "$(CFG)" == "libpng - Win32 LIB ASM Debug" - -# PROP Exclude_From_Build 1 - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\..\pngwio.c -# End Source File -# Begin Source File - -SOURCE=..\..\pngwrite.c -# End Source File -# Begin Source File - -SOURCE=..\..\pngwtran.c -# End Source File -# Begin Source File - -SOURCE=..\..\pngwutil.c -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=..\..\png.h -# End Source File -# Begin Source File - -SOURCE=..\..\pngconf.h -# End Source File -# End Group -# Begin Group "Resource Files" - -# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" -# Begin Source File - -SOURCE=..\..\scripts\pngw32.rc - -!IF "$(CFG)" == "libpng - Win32 DLL Release" - -!ELSEIF "$(CFG)" == "libpng - Win32 DLL Debug" - -!ELSEIF "$(CFG)" == "libpng - Win32 DLL ASM Release" - -!ELSEIF "$(CFG)" == "libpng - Win32 DLL ASM Debug" - -!ELSEIF "$(CFG)" == "libpng - Win32 DLL VB" - -!ELSEIF "$(CFG)" == "libpng - Win32 LIB Release" - -# PROP Exclude_From_Build 1 - -!ELSEIF "$(CFG)" == "libpng - Win32 LIB Debug" - -# PROP Exclude_From_Build 1 - -!ELSEIF "$(CFG)" == "libpng - Win32 LIB ASM Release" - -# PROP Exclude_From_Build 1 - -!ELSEIF "$(CFG)" == "libpng - Win32 LIB ASM Debug" - -# PROP Exclude_From_Build 1 - -!ENDIF - -# End Source File -# End Group -# Begin Source File - -SOURCE=.\README.txt -# End Source File -# End Target -# End Project diff --git a/wxWidgets/src/png/projects/visualc6/pngtest.dsp b/wxWidgets/src/png/projects/visualc6/pngtest.dsp deleted file mode 100644 index a1be73cd02..0000000000 --- a/wxWidgets/src/png/projects/visualc6/pngtest.dsp +++ /dev/null @@ -1,314 +0,0 @@ -# Microsoft Developer Studio Project File - Name="pngtest" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Console Application" 0x0103 - -CFG=pngtest - 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 "pngtest.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 "pngtest.mak" CFG="pngtest - Win32 DLL Release" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "pngtest - Win32 DLL Release" (based on "Win32 (x86) Console Application") -!MESSAGE "pngtest - Win32 DLL Debug" (based on "Win32 (x86) Console Application") -!MESSAGE "pngtest - Win32 DLL ASM Release" (based on "Win32 (x86) Console Application") -!MESSAGE "pngtest - Win32 DLL ASM Debug" (based on "Win32 (x86) Console Application") -!MESSAGE "pngtest - Win32 LIB Release" (based on "Win32 (x86) Console Application") -!MESSAGE "pngtest - Win32 LIB Debug" (based on "Win32 (x86) Console Application") -!MESSAGE "pngtest - Win32 LIB ASM Release" (based on "Win32 (x86) Console Application") -!MESSAGE "pngtest - Win32 LIB ASM Debug" (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)" == "pngtest - Win32 DLL Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "pngtest___Win32_DLL_Release" -# PROP BASE Intermediate_Dir "pngtest___Win32_DLL_Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Win32_DLL_Release" -# PROP Intermediate_Dir "Win32_DLL_Release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /O2 /D "WIN32" /D "NDEBUG" /FD /c -# SUBTRACT BASE CPP /YX -# ADD CPP /nologo /MD /W3 /O2 /I "..\..\..\zlib" /D "WIN32" /D "NDEBUG" /D "PNG_DLL" /D "PNG_NO_STDIO" /D "PNG_NO_GLOBAL_ARRAYS" /FD /c -# SUBTRACT CPP /YX -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 /nologo /subsystem:console /machine:I386 -# ADD LINK32 Win32_DLL_Release\libpng13.lib ..\..\..\zlib\projects\visualc6\Win32_DLL_Release\zlib1.lib /nologo /subsystem:console /machine:I386 -# Begin Special Build Tool -OutDir=.\Win32_DLL_Release -SOURCE="$(InputPath)" -PostBuild_Desc=[Run Test] -PostBuild_Cmds=set path=$(outdir);..\..\..\zlib\projects\visualc6\Win32_DLL_Release; $(outdir)\pngtest.exe ..\..\pngtest.png -# End Special Build Tool - -!ELSEIF "$(CFG)" == "pngtest - Win32 DLL Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "pngtest___Win32_DLL_Debug" -# PROP BASE Intermediate_Dir "pngtest___Win32_DLL_Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Win32_DLL_Debug" -# PROP Intermediate_Dir "Win32_DLL_Debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /ZI /Od /D "WIN32" /D "_DEBUG" /FD /GZ /c -# SUBTRACT BASE CPP /YX -# ADD CPP /nologo /MDd /W3 /Gm /ZI /Od /I "..\..\..\zlib" /D "WIN32" /D "_DEBUG" /D "PNG_DLL" /D "PNG_NO_STDIO" /D "PNG_NO_GLOBAL_ARRAYS" /FD /GZ /c -# SUBTRACT CPP /YX -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept -# ADD LINK32 Win32_DLL_Debug\libpng13d.lib ..\..\..\zlib\projects\visualc6\Win32_DLL_Debug\zlib1d.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept -# Begin Special Build Tool -OutDir=.\Win32_DLL_Debug -SOURCE="$(InputPath)" -PostBuild_Desc=[Run Test] -PostBuild_Cmds=set path=$(outdir);..\..\..\zlib\projects\visualc6\Win32_DLL_Debug; $(outdir)\pngtest.exe ..\..\pngtest.png -# End Special Build Tool - -!ELSEIF "$(CFG)" == "pngtest - Win32 DLL ASM Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "pngtest___Win32_DLL_ASM_Release" -# PROP BASE Intermediate_Dir "pngtest___Win32_DLL_ASM_Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Win32_DLL_ASM_Release" -# PROP Intermediate_Dir "Win32_DLL_ASM_Release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /O2 /D "WIN32" /D "NDEBUG" /FD /c -# SUBTRACT BASE CPP /YX -# ADD CPP /nologo /MD /W3 /O2 /I "..\..\..\zlib" /D "WIN32" /D "NDEBUG" /D "PNG_DLL" /D "PNG_NO_STDIO" /D "PNG_NO_GLOBAL_ARRAYS" /FD /c -# SUBTRACT CPP /YX -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 /nologo /subsystem:console /machine:I386 -# ADD LINK32 Win32_DLL_ASM_Release\libpng13.lib ..\..\..\zlib\projects\visualc6\Win32_DLL_ASM_Release\zlib1.lib /nologo /subsystem:console /machine:I386 -# Begin Special Build Tool -OutDir=.\Win32_DLL_ASM_Release -SOURCE="$(InputPath)" -PostBuild_Desc=[Run Test] -PostBuild_Cmds=set path=$(outdir);..\..\..\zlib\projects\visualc6\Win32_DLL_ASM_Release; $(outdir)\pngtest.exe ..\..\pngtest.png -# End Special Build Tool - -!ELSEIF "$(CFG)" == "pngtest - Win32 DLL ASM Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "pngtest___Win32_DLL_ASM_Debug" -# PROP BASE Intermediate_Dir "pngtest___Win32_DLL_ASM_Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Win32_DLL_ASM_Debug" -# PROP Intermediate_Dir "Win32_DLL_ASM_Debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /ZI /Od /D "WIN32" /D "_DEBUG" /FD /GZ /c -# SUBTRACT BASE CPP /YX -# ADD CPP /nologo /MDd /W3 /Gm /ZI /Od /I "..\..\..\zlib" /D "WIN32" /D "_DEBUG" /D "PNG_DLL" /D "PNG_NO_STDIO" /D "PNG_NO_GLOBAL_ARRAYS" /FD /GZ /c -# SUBTRACT CPP /YX -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept -# ADD LINK32 Win32_DLL_ASM_Debug\libpng13d.lib ..\..\..\zlib\projects\visualc6\Win32_DLL_ASM_Debug\zlib1d.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept -# Begin Special Build Tool -OutDir=.\Win32_DLL_ASM_Debug -SOURCE="$(InputPath)" -PostBuild_Desc=[Run Test] -PostBuild_Cmds=set path=$(outdir);..\..\..\zlib\projects\visualc6\Win32_DLL_ASM_Debug; $(outdir)\pngtest.exe ..\..\pngtest.png -# End Special Build Tool - -!ELSEIF "$(CFG)" == "pngtest - Win32 LIB Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "pngtest___Win32_LIB_Release" -# PROP BASE Intermediate_Dir "pngtest___Win32_LIB_Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Win32_LIB_Release" -# PROP Intermediate_Dir "Win32_LIB_Release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /O2 /D "WIN32" /D "NDEBUG" /FD /c -# SUBTRACT BASE CPP /YX -# ADD CPP /nologo /MD /W3 /O2 /I "..\..\..\zlib" /D "WIN32" /D "NDEBUG" /FD /c -# SUBTRACT CPP /YX -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 /nologo /subsystem:console /machine:I386 -# ADD LINK32 Win32_LIB_Release\libpng.lib ..\..\..\zlib\projects\visualc6\Win32_LIB_Release\zlib.lib /nologo /subsystem:console /machine:I386 -# Begin Special Build Tool -OutDir=.\Win32_LIB_Release -SOURCE="$(InputPath)" -PostBuild_Desc=[Run Test] -PostBuild_Cmds=$(outdir)\pngtest.exe ..\..\pngtest.png -# End Special Build Tool - -!ELSEIF "$(CFG)" == "pngtest - Win32 LIB Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "pngtest___Win32_LIB_Debug" -# PROP BASE Intermediate_Dir "pngtest___Win32_LIB_Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Win32_LIB_Debug" -# PROP Intermediate_Dir "Win32_LIB_Debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /ZI /Od /D "WIN32" /D "_DEBUG" /FD /GZ /c -# SUBTRACT BASE CPP /YX -# ADD CPP /nologo /MDd /W3 /Gm /ZI /Od /I "..\..\..\zlib" /D "WIN32" /D "_DEBUG" /FD /GZ /c -# SUBTRACT CPP /YX -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept -# ADD LINK32 Win32_LIB_Debug\libpngd.lib ..\..\..\zlib\projects\visualc6\Win32_LIB_Debug\zlibd.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept -# Begin Special Build Tool -OutDir=.\Win32_LIB_Debug -SOURCE="$(InputPath)" -PostBuild_Desc=[Run Test] -PostBuild_Cmds=$(outdir)\pngtest.exe ..\..\pngtest.png -# End Special Build Tool - -!ELSEIF "$(CFG)" == "pngtest - Win32 LIB ASM Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "pngtest___Win32_LIB_ASM_Release" -# PROP BASE Intermediate_Dir "pngtest___Win32_LIB_ASM_Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Win32_LIB_ASM_Release" -# PROP Intermediate_Dir "Win32_LIB_ASM_Release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /O2 /D "WIN32" /D "NDEBUG" /FD /c -# SUBTRACT BASE CPP /YX -# ADD CPP /nologo /MD /W3 /O2 /I "..\..\..\zlib" /D "WIN32" /D "NDEBUG" /FD /c -# SUBTRACT CPP /YX -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 /nologo /subsystem:console /machine:I386 -# ADD LINK32 Win32_LIB_ASM_Release\libpng.lib ..\..\..\zlib\projects\visualc6\Win32_LIB_ASM_Release\zlib.lib /nologo /subsystem:console /machine:I386 -# Begin Special Build Tool -OutDir=.\Win32_LIB_ASM_Release -SOURCE="$(InputPath)" -PostBuild_Desc=[Run Test] -PostBuild_Cmds=$(outdir)\pngtest.exe ..\..\pngtest.png -# End Special Build Tool - -!ELSEIF "$(CFG)" == "pngtest - Win32 LIB ASM Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "pngtest___Win32_LIB_ASM_Debug" -# PROP BASE Intermediate_Dir "pngtest___Win32_LIB_ASM_Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Win32_LIB_ASM_Debug" -# PROP Intermediate_Dir "Win32_LIB_ASM_Debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /ZI /Od /D "WIN32" /D "_DEBUG" /FD /GZ /c -# SUBTRACT BASE CPP /YX -# ADD CPP /nologo /MDd /W3 /Gm /ZI /Od /I "..\..\..\zlib" /D "WIN32" /D "_DEBUG" /FD /GZ /c -# SUBTRACT CPP /YX -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept -# ADD LINK32 Win32_LIB_ASM_Debug\libpngd.lib ..\..\..\zlib\projects\visualc6\Win32_LIB_ASM_Debug\zlibd.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept -# Begin Special Build Tool -OutDir=.\Win32_LIB_ASM_Debug -SOURCE="$(InputPath)" -PostBuild_Desc=[Run Test] -PostBuild_Cmds=$(outdir)\pngtest.exe ..\..\pngtest.png -# End Special Build Tool - -!ENDIF - -# Begin Target - -# Name "pngtest - Win32 DLL Release" -# Name "pngtest - Win32 DLL Debug" -# Name "pngtest - Win32 DLL ASM Release" -# Name "pngtest - Win32 DLL ASM Debug" -# Name "pngtest - Win32 LIB Release" -# Name "pngtest - Win32 LIB Debug" -# Name "pngtest - Win32 LIB ASM Release" -# Name "pngtest - Win32 LIB ASM Debug" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=..\..\pngtest.c -# End Source File -# End Group -# End Target -# End Project diff --git a/wxWidgets/src/png/projects/wince.txt b/wxWidgets/src/png/projects/wince.txt deleted file mode 100644 index a1a26c0bc6..0000000000 --- a/wxWidgets/src/png/projects/wince.txt +++ /dev/null @@ -1,6 +0,0 @@ -A set of project files is available for WinCE. Get -libpng-1.2.5-project-wince.zip from a libpng distribution -site such as http://libpng.sourceforge.net - -Put the zip file in this directory (projects) and then run -"unzip -a libpng-1.2.5-project-wince.zip" diff --git a/wxWidgets/src/png/scripts/SCOPTIONS.ppc b/wxWidgets/src/png/scripts/SCOPTIONS.ppc deleted file mode 100644 index 2c3503e9eb..0000000000 --- a/wxWidgets/src/png/scripts/SCOPTIONS.ppc +++ /dev/null @@ -1,7 +0,0 @@ -OPTIMIZE -OPTPEEP -OPTTIME -OPTSCHED -AUTOREGISTER -PARMS=REGISTERS -INCLUDEDIR=hlp:ppc/include diff --git a/wxWidgets/src/png/scripts/descrip.mms b/wxWidgets/src/png/scripts/descrip.mms deleted file mode 100644 index 3584b0d782..0000000000 --- a/wxWidgets/src/png/scripts/descrip.mms +++ /dev/null @@ -1,52 +0,0 @@ - -cc_defs = /inc=$(ZLIBSRC) -c_deb = - -.ifdef __DECC__ -pref = /prefix=all -.endif - - - -OBJS = png.obj, pngset.obj, pngget.obj, pngrutil.obj, pngtrans.obj,\ - pngwutil.obj, pngread.obj, pngmem.obj, pngwrite.obj, pngrtran.obj,\ - pngwtran.obj, pngrio.obj, pngwio.obj, pngerror.obj, pngpread.obj - - -CFLAGS= $(C_DEB) $(CC_DEFS) $(PREF) - -all : pngtest.exe libpng.olb - @ write sys$output " pngtest available" - -libpng.olb : libpng.olb($(OBJS)) - @ write sys$output " Libpng available" - - -pngtest.exe : pngtest.obj libpng.olb - link pngtest,libpng.olb/lib,$(ZLIBSRC)libz.olb/lib - -test : pngtest.exe - run pngtest - -clean : - delete *.obj;*,*.exe;* - - -# Other dependencies. -png.obj : png.h, pngconf.h -pngpread.obj : png.h, pngconf.h -pngset.obj : png.h, pngconf.h -pngget.obj : png.h, pngconf.h -pngread.obj : png.h, pngconf.h -pngrtran.obj : png.h, pngconf.h -pngrutil.obj : png.h, pngconf.h -pngerror.obj : png.h, pngconf.h -pngmem.obj : png.h, pngconf.h -pngrio.obj : png.h, pngconf.h -pngwio.obj : png.h, pngconf.h -pngtest.obj : png.h, pngconf.h -pngtrans.obj : png.h, pngconf.h -pngwrite.obj : png.h, pngconf.h -pngwtran.obj : png.h, pngconf.h -pngwutil.obj : png.h, pngconf.h - diff --git a/wxWidgets/src/png/scripts/libpng-config-body.in b/wxWidgets/src/png/scripts/libpng-config-body.in deleted file mode 100644 index b466432d54..0000000000 --- a/wxWidgets/src/png/scripts/libpng-config-body.in +++ /dev/null @@ -1,96 +0,0 @@ - -usage() -{ - cat < libpng.pc - -libpng-config: - ( cat scripts/libpng-config-head.in; \ - echo prefix=\"$(prefix)\"; \ - echo libdir=\"$(LIBPATH)\"; \ - echo I_opts=\"-I$(INCPATH)/$(LIBNAME)\"; \ - echo L_opts=\"-L$(LIBPATH)\"; \ - echo R_opts=\"-R$(LIBPATH)\"; \ - echo ccopts=\"-xtarget=ultra\"; \ - echo ldopts=\"-xtarget=ultra\"; \ - echo libs=\"-lpng12 -lz -lm\"; \ - cat scripts/libpng-config-body.in ) > libpng-config - chmod +x libpng-config - -$(LIBNAME).so: $(LIBNAME).so.$(PNGMAJ) - ln -f -s $(LIBNAME).so.$(PNGMAJ) $(LIBNAME).so - -$(LIBNAME).so.$(PNGMAJ): $(LIBNAME).so.$(PNGVER) - ln -f -s $(LIBNAME).so.$(PNGVER) $(LIBNAME).so.$(PNGMAJ) - -$(LIBNAME).so.$(PNGVER): $(OBJSDLL) - @case "`type ld`" in *ucb*) \ - echo; \ - echo '## WARNING:'; \ - echo '## The commands "CC" and "LD" must NOT refer to /usr/ucb/cc'; \ - echo '## and /usr/ucb/ld. If they do, you need to adjust your PATH'; \ - echo '## environment variable to put /usr/ccs/bin ahead of /usr/ucb.'; \ - echo '## The environment variable LD_LIBRARY_PATH should not be set'; \ - echo '## at all. If it is, things are likely to break because of'; \ - echo '## the libucb dependency that is created.'; \ - echo; \ - ;; \ - esac - $(LD) -G -L$(ZLIBLIB) -R$(ZLIBLIB) -h $(LIBNAME).so.$(PNGMAJ) \ - -o $(LIBNAME).so.$(PNGVER) $(OBJSDLL) - -libpng.so.3.$(PNGMIN): $(OBJS) - $(LD) -G -L$(ZLIBLIB) -R$(ZLIBLIB) -h libpng.so.3 \ - -o libpng.so.3.$(PNGMIN) $(OBJSDLL) - -pngtest: pngtest.o $(LIBNAME).so - $(CC) -o pngtest $(CFLAGS) pngtest.o $(LDFLAGS) - -test: pngtest - ./pngtest - -install-headers: png.h pngconf.h - -@if [ ! -d $(DI) ]; then mkdir $(DI); fi - -@if [ ! -d $(DI)/$(LIBNAME) ]; then mkdir $(DI)/$(LIBNAME); fi - cp png.h pngconf.h $(DI)/$(LIBNAME) - chmod 644 $(DI)/$(LIBNAME)/png.h $(DI)/$(LIBNAME)/pngconf.h - -@/bin/rm -f $(DI)/png.h $(DI)/pngconf.h - -@/bin/rm $(DI)/libpng - (cd $(DI); ln -f -s $(LIBNAME) libpng; ln -f -s $(LIBNAME)/* .) - -install-static: install-headers libpng.a - -@if [ ! -d $(DL) ]; then mkdir $(DL); fi - cp libpng.a $(DL)/$(LIBNAME).a - chmod 644 $(DL)/$(LIBNAME).a - -@/bin/rm -f $(DL)/libpng.a - (cd $(DL); ln -f -s $(LIBNAME).a libpng.a) - -install-shared: install-headers $(LIBNAME).so.$(PNGVER) libpng.pc \ - libpng.so.3.$(PNGMIN) - -@if [ ! -d $(DL) ]; then mkdir $(DL); fi - -@/bin/rm -f $(DL)/$(LIBNAME).so.$(PNGVER)* $(DL)/$(LIBNAME).so - -@/bin/rm -f $(DL)/$(LIBNAME).so.$(PNGMAJ) - -@/bin/rm -f $(DL)/libpng.so - -@/bin/rm -f $(DL)/libpng.so.3 - -@/bin/rm -f $(DL)/libpng.so.3.$(PNGVER)* - cp $(LIBNAME).so.$(PNGVER) $(DL) - cp libpng.so.3.$(PNGMIN) $(DL) - chmod 755 $(DL)/$(LIBNAME).so.$(PNGVER) - chmod 755 $(DL)/libpng.so.3.$(PNGMIN) - (cd $(DL); \ - ln -f -s libpng.so.3.$(PNGMIN) libpng.so.3; \ - ln -f -s libpng.so.3 libpng.so; \ - ln -f -s $(LIBNAME).so.$(PNGVER) $(LIBNAME).so.$(PNGMAJ); \ - ln -f -s $(LIBNAME).so.$(PNGMAJ) $(LIBNAME).so) - -@if [ ! -d $(DL)/pkgconfig ]; then mkdir $(DL)/pkgconfig; fi - -@/bin/rm -f $(DL)/pkgconfig/libpng12.pc - -@/bin/rm -f $(DL)/pkgconfig/libpng.pc - cp libpng.pc $(DL)/pkgconfig/libpng12.pc - chmod 644 $(DL)/pkgconfig/libpng12.pc - (cd $(DL)/pkgconfig; ln -f -s libpng12.pc libpng.pc) - -install-man: libpng.3 libpngpf.3 png.5 - -@if [ ! -d $(DM) ]; then mkdir $(DM); fi - -@if [ ! -d $(DM)/man3 ]; then mkdir $(DM)/man3; fi - -@/bin/rm -f $(DM)/man3/libpng.3 - -@/bin/rm -f $(DM)/man3/libpngpf.3 - cp libpng.3 $(DM)/man3 - cp libpngpf.3 $(DM)/man3 - -@if [ ! -d $(DM)/man5 ]; then mkdir $(DM)/man5; fi - -@/bin/rm -f $(DM)/man5/png.5 - cp png.5 $(DM)/man5 - -install-config: libpng-config - -@if [ ! -d $(DB) ]; then mkdir $(DB); fi - -@/bin/rm -f $(DB)/libpng-config - -@/bin/rm -f $(DB)/libpng12-config - cp libpng-config $(DB)/libpng12-config - chmod 755 $(DB)/libpng12-config - (cd $(DB); ln -f -s libpng12-config libpng-config) - -install: install-static install-shared install-man install-config - -# If you installed in $(DESTDIR), test-installed won't work until you -# move the library to its final location. Use test-dd to test it -# before then. - -test-dd: - echo - echo Testing installed dynamic shared library in $(DL). - $(CC) $(SUN_CC_FLAGS) -I$(DI) -I$(ZLIBINC) \ - `$(BINPATH)/libpng12-config --cflags` pngtest.c \ - -o pngtestd -L$(DL) -R$(DL) `$(BINPATH)/libpng12-config --ldflags` \ - $(SUN_LD_FLAGS) -L$(ZLIBLIB) -R$(ZLIBLIB) - ./pngtestd pngtest.png - -test-installed: - echo - echo Testing installed dynamic shared library. - $(CC) $(SUN_CC_FLAGS) -I$(ZLIBINC) \ - `$(BINPATH)/libpng12-config --cflags` pngtest.c \ - -o pngtesti `$(BINPATH)/libpng12-config --ldflags` \ - $(SUN_LD_FLAGS) -L$(ZLIBLIB) -R$(ZLIBLIB) - ./pngtesti pngtest.png - -clean: - /bin/rm -f *.o libpng.a pngtest pngtesti pngout.png \ - libpng-config $(LIBNAME).so $(LIBNAME).so.$(PNGMAJ)* \ - libpng.so.3.$(PNGMIN) \ - libpng.pc - -DOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO -writelock: - chmod a-w *.[ch35] $(DOCS) scripts/* - -# DO NOT DELETE THIS LINE -- make depend depends on it. - -png.o png.pic.o: png.h pngconf.h -pngerror.o pngerror.pic.o: png.h pngconf.h -pngrio.o pngrio.pic.o: png.h pngconf.h -pngwio.o pngwio.pic.o: png.h pngconf.h -pngmem.o pngmem.pic.o: png.h pngconf.h -pngset.o pngset.pic.o: png.h pngconf.h -pngget.o pngget.pic.o: png.h pngconf.h -pngread.o pngread.pic.o: png.h pngconf.h -pngrtran.o pngrtran.pic.o: png.h pngconf.h -pngrutil.o pngrutil.pic.o: png.h pngconf.h -pngtrans.o pngtrans.pic.o: png.h pngconf.h -pngwrite.o pngwrite.pic.o: png.h pngconf.h -pngwtran.o pngwtran.pic.o: png.h pngconf.h -pngwutil.o pngwutil.pic.o: png.h pngconf.h -pngpread.o pngpread.pic.o: png.h pngconf.h - -pngtest.o: png.h pngconf.h diff --git a/wxWidgets/src/png/scripts/makefile.64sunu b/wxWidgets/src/png/scripts/makefile.64sunu deleted file mode 100644 index 8ee4d56576..0000000000 --- a/wxWidgets/src/png/scripts/makefile.64sunu +++ /dev/null @@ -1,236 +0,0 @@ -# makefile for libpng on Solaris 2.x with cc -# Contributed by William L. Sebok, based on makefile.linux -# Copyright (C) 2002 Glenn Randers-Pehrson -# Copyright (C) 1998 Greg Roelofs -# Copyright (C) 1996, 1997 Andreas Dilger -# For conditions of distribution and use, see copyright notice in png.h - -CC=cc -SUN_CC_FLAGS=-fast -xtarget=ultra -xarch=v9 -SUN_LD_FLAGS=-fast -xtarget=ultra -xarch=v9 - -# where make install puts libpng.a, libpng12.so and libpng12/png.h -prefix=/a - -# Where the zlib library and include files are located -# Changing these to ../zlib poses a security risk. If you want -# to have zlib in an adjacent directory, specify the full path instead of "..". -#ZLIBLIB=../zlib -#ZLIBINC=../zlib - -ZLIBLIB=/usr/lib -ZLIBINC=/usr/include - -WARNMORE=-Wwrite-strings -Wpointer-arith -Wshadow \ - -Wmissing-declarations -Wtraditional -Wcast-align \ - -Wstrict-prototypes -Wmissing-prototypes #-Wconversion -CFLAGS=-I$(ZLIBINC) $(SUN_CC_FLAGS) \ - # $(WARNMORE) -g -DPNG_DEBUG=5 -LDFLAGS=-L. -R. $(SUN_LD_FLAGS) -L$(ZLIBLIB) -R$(ZLIBLIB) -lpng12 -lz -lm - -#RANLIB=ranlib -RANLIB=echo - -LIBNAME=libpng12 -PNGMAJ = 0 -PNGMIN = 1.2.7 -PNGVER = $(PNGMAJ).$(PNGMIN) - -INCPATH=$(prefix)/include -LIBPATH=$(prefix)/lib -MANPATH=$(prefix)/man -BINPATH=$(prefix)/bin - -# override DESTDIR= on the make install command line to easily support -# installing into a temporary location. Example: -# -# make install DESTDIR=/tmp/build/libpng -# -# If you're going to install into a temporary location -# via DESTDIR, $(DESTDIR)$(prefix) must already exist before -# you execute make install. -DESTDIR= - -DB=$(DESTDIR)$(BINPATH) -DI=$(DESTDIR)$(INCPATH) -DL=$(DESTDIR)$(LIBPATH) -DM=$(DESTDIR)$(MANPATH) - -OBJS = png.o pngset.o pngget.o pngrutil.o pngtrans.o pngwutil.o \ - pngread.o pngrio.o pngwio.o pngwrite.o pngrtran.o \ - pngwtran.o pngmem.o pngerror.o pngpread.o - -OBJSDLL = $(OBJS:.o=.pic.o) - -.SUFFIXES: .c .o .pic.o - -.c.pic.o: - $(CC) -c $(CFLAGS) -KPIC -o $@ $*.c - -all: libpng.a $(LIBNAME).so pngtest libpng.pc libpng-config - -libpng.a: $(OBJS) - ar rc $@ $(OBJS) - $(RANLIB) $@ - -libpng.pc: - cat scripts/libpng.pc.in | sed -e s\!@PREFIX@!$(prefix)! > libpng.pc - -libpng-config: - ( cat scripts/libpng-config-head.in; \ - echo prefix=\"$(prefix)\"; \ - echo libdir=\"$(LIBPATH)\"; \ - echo I_opts=\"-I$(INCPATH)/$(LIBNAME)\"; \ - echo L_opts=\"-L$(LIBPATH)\"; \ - echo R_opts=\"-R$(LIBPATH)\"; \ - echo ccopts=\"-xtarget=ultra -xarch=v9\"; \ - echo ldopts=\"-xtarget=ultra -xarch=v9\"; \ - echo libs=\"-lpng12 -lz -lm\"; \ - cat scripts/libpng-config-body.in ) > libpng-config - chmod +x libpng-config - -$(LIBNAME).so: $(LIBNAME).so.$(PNGMAJ) - ln -f -s $(LIBNAME).so.$(PNGMAJ) $(LIBNAME).so - -$(LIBNAME).so.$(PNGMAJ): $(LIBNAME).so.$(PNGVER) - ln -f -s $(LIBNAME).so.$(PNGVER) $(LIBNAME).so.$(PNGMAJ) - -$(LIBNAME).so.$(PNGVER): $(OBJSDLL) - @case "`type ld`" in *ucb*) \ - echo; \ - echo '## WARNING:'; \ - echo '## The commands "CC" and "LD" must NOT refer to /usr/ucb/cc'; \ - echo '## and /usr/ucb/ld. If they do, you need to adjust your PATH'; \ - echo '## environment variable to put /usr/ccs/bin ahead of /usr/ucb.'; \ - echo '## The environment variable LD_LIBRARY_PATH should not be set'; \ - echo '## at all. If it is, things are likely to break because of'; \ - echo '## the libucb dependency that is created.'; \ - echo; \ - ;; \ - esac - $(LD) -G -L$(ZLIBLIB) -R$(ZLIBLIB) -h $(LIBNAME).so.$(PNGMAJ) \ - -o $(LIBNAME).so.$(PNGVER) $(OBJSDLL) - -libpng.so.3.$(PNGMIN): $(OBJSDLL) - $(LD) -G -L$(ZLIBLIB) -R$(ZLIBLIB) -h libpng.so.3 \ - -o libpng.so.3.$(PNGMIN) $(OBJSDLL) - -pngtest: pngtest.o $(LIBNAME).so - $(CC) -o pngtest $(CFLAGS) pngtest.o $(LDFLAGS) - -test: pngtest - ./pngtest - -install-headers: png.h pngconf.h - -@if [ ! -d $(DI) ]; then mkdir $(DI); fi - -@if [ ! -d $(DI)/$(LIBNAME) ]; then mkdir $(DI)/$(LIBNAME); fi - cp png.h pngconf.h $(DI)/$(LIBNAME) - chmod 644 $(DI)/$(LIBNAME)/png.h $(DI)/$(LIBNAME)/pngconf.h - -@/bin/rm -f $(DI)/png.h $(DI)/pngconf.h - -@/bin/rm $(DI)/libpng - (cd $(DI); ln -f -s $(LIBNAME) libpng; ln -f -s $(LIBNAME)/* .) - -install-static: install-headers libpng.a - -@if [ ! -d $(DL) ]; then mkdir $(DL); fi - cp libpng.a $(DL)/$(LIBNAME).a - chmod 644 $(DL)/$(LIBNAME).a - -@/bin/rm -f $(DL)/libpng.a - (cd $(DL); ln -f -s $(LIBNAME).a libpng.a) - -install-shared: install-headers $(LIBNAME).so.$(PNGVER) libpng.pc \ - libpng.so.3.$(PNGMIN) - -@if [ ! -d $(DL) ]; then mkdir $(DL); fi - -@/bin/rm -f $(DL)/$(LIBNAME).so.$(PNGMAJ).$(PNGVER)* - -@/bin/rm -f $(DL)/$(LIBNAME).so - -@/bin/rm -f $(DL)/$(LIBNAME).so.$(PNGMAJ) - -@/bin/rm -f $(DL)/libpng.so - -@/bin/rm -f $(DL)/libpng.so.3 - -@/bin/rm -f $(DL)/libpng.so.3.$(PNGVER)* - cp $(LIBNAME).so.$(PNGVER) $(DL) - cp libpng.so.3.$(PNGMIN) $(DL) - chmod 755 $(DL)/$(LIBNAME).so.$(PNGVER) - chmod 755 $(DL)/libpng.so.3.$(PNGMIN) - (cd $(DL); \ - ln -f -s libpng.so.3.$(PNGMIN) libpng.so.3; \ - ln -f -s libpng.so.3 libpng.so; \ - ln -f -s $(LIBNAME).so.$(PNGVER) $(LIBNAME).so.$(PNGMAJ); \ - ln -f -s $(LIBNAME).so.$(PNGMAJ) $(LIBNAME).so) - -@if [ ! -d $(DL)/pkgconfig ]; then mkdir $(DL)/pkgconfig; fi - -@/bin/rm -f $(DL)/pkgconfig/$(LIBNAME).pc - -@/bin/rm -f $(DL)/pkgconfig/libpng.pc - cp libpng.pc $(DL)/pkgconfig/$(LIBNAME).pc - chmod 644 $(DL)/pkgconfig/$(LIBNAME).pc - (cd $(DL)/pkgconfig; ln -f -s $(LIBNAME).pc libpng.pc) - -install-man: libpng.3 libpngpf.3 png.5 - -@if [ ! -d $(DM) ]; then mkdir $(DM); fi - -@if [ ! -d $(DM)/man3 ]; then mkdir $(DM)/man3; fi - -@/bin/rm -f $(DM)/man3/libpng.3 - -@/bin/rm -f $(DM)/man3/libpngpf.3 - cp libpng.3 $(DM)/man3 - cp libpngpf.3 $(DM)/man3 - -@if [ ! -d $(DM)/man5 ]; then mkdir $(DM)/man5; fi - -@/bin/rm -f $(DM)/man5/png.5 - cp png.5 $(DM)/man5 - -install-config: libpng-config - -@if [ ! -d $(DB) ]; then mkdir $(DB); fi - -@/bin/rm -f $(DB)/libpng-config - -@/bin/rm -f $(DB)/$(LIBNAME)-config - cp libpng-config $(DB)/$(LIBNAME)-config - chmod 755 $(DB)/$(LIBNAME)-config - (cd $(DB); ln -f -s $(LIBNAME)-config libpng-config) - -install: install-static install-shared install-man install-config - -# If you installed in $(DESTDIR), test-installed won't work until you -# move the library to its final location. Use test-dd to test it -# before then. - -test-dd: - echo - echo Testing installed dynamic shared library in $(DL). - $(CC) $(SUN_CC_FLAGS) -I$(DI) -I$(ZLIBINC) \ - `$(BINPATH)/libpng12-config --cflags` pngtest.c \ - -o pngtestd -L$(DL) -R$(DL) `$(BINPATH)/libpng12-config --ldflags` \ - $(SUN_LD_FLAGS) -L$(ZLIBLIB) -R$(ZLIBLIB) - ./pngtestd pngtest.png - -test-installed: - echo - echo Testing installed dynamic shared library. - $(CC) $(SUN_CC_FLAGS) -I$(ZLIBINC) \ - `$(BINPATH)/libpng12-config --cflags` pngtest.c \ - -o pngtesti `$(BINPATH)/libpng12-config --ldflags ` \ - $(SUN_LD_FLAGS) -L$(ZLIBLIB) -R$(ZLIBLIB) - ./pngtesti pngtest.png - -clean: - /bin/rm -f *.o libpng.a pngtest pngtesti pngout.png \ - libpng-config $(LIBNAME).so $(LIBNAME).so.$(PNGMAJ)* \ - libpng.so.3.$(PNGMIN) \ - libpng.pc - -DOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO -writelock: - chmod a-w *.[ch35] $(DOCS) scripts/* - -# DO NOT DELETE THIS LINE -- make depend depends on it. - -png.o png.pic.o: png.h pngconf.h -pngerror.o pngerror.pic.o: png.h pngconf.h -pngrio.o pngrio.pic.o: png.h pngconf.h -pngwio.o pngwio.pic.o: png.h pngconf.h -pngmem.o pngmem.pic.o: png.h pngconf.h -pngset.o pngset.pic.o: png.h pngconf.h -pngget.o pngget.pic.o: png.h pngconf.h -pngread.o pngread.pic.o: png.h pngconf.h -pngrtran.o pngrtran.pic.o: png.h pngconf.h -pngrutil.o pngrutil.pic.o: png.h pngconf.h -pngtrans.o pngtrans.pic.o: png.h pngconf.h -pngwrite.o pngwrite.pic.o: png.h pngconf.h -pngwtran.o pngwtran.pic.o: png.h pngconf.h -pngwutil.o pngwutil.pic.o: png.h pngconf.h -pngpread.o pngpread.pic.o: png.h pngconf.h - -pngtest.o: png.h pngconf.h diff --git a/wxWidgets/src/png/scripts/makefile.acorn b/wxWidgets/src/png/scripts/makefile.acorn deleted file mode 100644 index 470cf89b16..0000000000 --- a/wxWidgets/src/png/scripts/makefile.acorn +++ /dev/null @@ -1,51 +0,0 @@ -# Project: libpng - - -# Toolflags: -CCflags = -c -depend !Depend -IC:,Zlib: -g -throwback -DRISCOS -fnah -C++flags = -c -depend !Depend -IC: -throwback -Linkflags = -aif -c++ -o $@ -ObjAsmflags = -throwback -NoCache -depend !Depend -CMHGflags = -LibFileflags = -c -l -o $@ -Squeezeflags = -o $@ - - -# Final targets: -@.libpng-lib: @.o.png @.o.pngerror @.o.pngrio @.o.pngwio @.o.pngmem \ - @.o.pngpread @.o.pngset @.o.pngget @.o.pngread @.o.pngrtran \ - @.o.pngrutil @.o.pngtrans @.o.pngwrite @.o.pngwtran @.o.pngwutil - LibFile $(LibFileflags) @.o.png @.o.pngerror @.o.pngrio @.o.pngrtran \ - @.o.pngmem @.o.pngpread @.o.pngset @.o.pngget @.o.pngread @.o.pngwio \ - @.o.pngrutil @.o.pngtrans @.o.pngwrite @.o.pngwtran @.o.pngwutil -@.mm-libpng-lib: @.mm.png @.mm.pngerror @.mm.pngrio @.mm.pngwio @.mm.pngmem \ - @.mm.pngpread @.mm.pngset @.mm.pngget @.mm.pngread @.mm.pngrtran \ - @.mm.pngrutil @.mm.pngtrans @.mm.pngwrite @.mm.pngwtran @.mm.pngwutil - LibFile $(LibFileflags) @.mm.png @.mm.pngerror @.mm.pngrio \ - @.mm.pngwio @.mm.pngmem @.mm.pngpread @.mm.pngset @.mm.pngget \ - @.mm.pngread @.mm.pngrtran @.mm.pngrutil @.mm.pngtrans @.mm.pngwrite \ - @.mm.pngwtran @.mm.pngwutil - - -# User-editable dependencies: -# (C) Copyright 1997 Tom Tanner -Test: @.pngtest - .pngtest - @remove .pngtest - -#It would be nice if you could stop "make" listing from here on! -@.pngtest: @.o.pngtest @.libpng-lib C:o.Stubs Zlib:zlib_lib - Link $(Linkflags) @.o.pngtest @.libpng-lib C:o.Stubs Zlib:zlib_lib - -.SUFFIXES: .o .mm .c - -.c.mm: - MemCheck.CC cc $(ccflags) -o $@ LibPng:$< -.c.o: - cc $(ccflags) -o $@ $< - - -# Static dependencies: - - -# Dynamic dependencies: diff --git a/wxWidgets/src/png/scripts/makefile.aix b/wxWidgets/src/png/scripts/makefile.aix deleted file mode 100644 index a1e474d14d..0000000000 --- a/wxWidgets/src/png/scripts/makefile.aix +++ /dev/null @@ -1,111 +0,0 @@ -# makefile for libpng using gcc (generic, static library) -# Copyright (C) 2002 Glenn Randers-Pehrson -# Copyright (C) 2000 Cosmin Truta -# Copyright (C) 2000 Marc O. Gloor (AIX support added, from makefile.gcc) -# Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc. -# For conditions of distribution and use, see copyright notice in png.h - -# Location of the zlib library and include files -ZLIBINC = ../zlib -ZLIBLIB = ../zlib - -# Compiler, linker, lib and other tools -CC = gcc -LD = $(CC) -AR = ar rcs -RANLIB = ranlib -RM = rm -f - -LIBNAME=libpng12 -PNGMAJ = 0 -PNGMIN = 1.2.7 -PNGVER = $(PNGMAJ).$(PNGMIN) - -prefix=/usr/local -INCPATH=$(prefix)/include -LIBPATH=$(prefix)/lib - -# override DESTDIR= on the make install command line to easily support -# installing into a temporary location. Example: -# -# make install DESTDIR=/tmp/build/libpng -# -# If you're going to install into a temporary location -# via DESTDIR, $(DESTDIR)$(prefix) must already exist before -# you execute make install. -DESTDIR= - -DI=$(DESTDIR)$(INCPATH) -DL=$(DESTDIR)$(LIBPATH) - -CDEBUG = -g -DPNG_DEBUG=5 -LDDEBUG = -CRELEASE = -O2 -LDRELEASE = -s -WARNMORE=-Wall -CFLAGS = -I$(ZLIBINC) $(WARNMORE) $(CRELEASE) -LDFLAGS = -L. -L$(ZLIBLIB) -lpng12 -lz -lm $(LDRELEASE) - -# File extensions -O=.o -A=.a -E= - -# Variables -OBJS = png$(O) pngerror$(O) pngget$(O) pngmem$(O) pngpread$(O) \ - pngread$(O) pngrio$(O) pngrtran$(O) pngrutil$(O) pngset$(O) \ - pngtrans$(O) pngwio$(O) pngwrite$(O) pngwtran$(O) pngwutil$(O) - -# Targets -all: $(LIBNAME)$(A) pngtest$(E) - -$(LIBNAME)$(A): $(OBJS) - $(AR) $@ $(OBJS) - $(RANLIB) $@ - -test: pngtest$(E) - ./pngtest$(E) - -pngtest$(E): pngtest$(O) $(LIBNAME)$(A) - $(LD) -o $@ pngtest$(O) $(LDFLAGS) - -install: $(LIBNAME)$(A) - -@if [ ! -d $(DI) ]; then mkdir $(DI); fi - -@if [ ! -d $(DI)/$(LIBNAME) ]; then mkdir $(DI)/$(LIBNAME); fi - -@if [ ! -d $(DL) ]; then mkdir $(DL); fi - -@rm -f $(DI)/$(LIBNAME)/png.h - -@rm -f $(DI)/$(LIBNAME)/pngconf.h - -@rm -f $(DI)/png.h - -@rm -f $(DI)/pngconf.h - cp png.h pngconf.h $(DI)/$(LIBNAME) - chmod 644 $(DI)/$(LIBNAME)/png.h \ - $(DI)/$(LIBNAME)/pngconf.h - -@rm -rf $(DI)/libpng - (cd $(DI); ln -f -s $(LIBNAME) libpng; ln -f -s $(LIBNAME)/* .) - -@rm -f $(DL)/$(LIBNAME)$(A) - -@rm -f $(DL)/libpng$(A) - cp $(LIBNAME)$(A) $(DL)/$(LIBNAME)$(A) - chmod 644 $(DL)/$(LIBNAME)$(A) - (cd $(DL); ln -f -s $(LIBNAME)$(A) libpng$(A)) - (cd $(DI); ln -f -s libpng/* .;) - -clean: - /bin/rm -f *.o $(LIBNAME)$(A) pngtest pngout.png - -png$(O): png.h pngconf.h -pngerror$(O): png.h pngconf.h -pngget$(O): png.h pngconf.h -pngmem$(O): png.h pngconf.h -pngpread$(O): png.h pngconf.h -pngread$(O): png.h pngconf.h -pngrio$(O): png.h pngconf.h -pngrtran$(O): png.h pngconf.h -pngrutil$(O): png.h pngconf.h -pngset$(O): png.h pngconf.h -pngtest$(O): png.h pngconf.h -pngtrans$(O): png.h pngconf.h -pngwio$(O): png.h pngconf.h -pngwrite$(O): png.h pngconf.h -pngwtran$(O): png.h pngconf.h -pngwutil$(O): png.h pngconf.h - diff --git a/wxWidgets/src/png/scripts/makefile.amiga b/wxWidgets/src/png/scripts/makefile.amiga deleted file mode 100644 index 79cb42499f..0000000000 --- a/wxWidgets/src/png/scripts/makefile.amiga +++ /dev/null @@ -1,48 +0,0 @@ -# Commodore Amiga Makefile -# makefile for libpng and SAS C V6.5x compiler -# Copyright (C) 1995-2000 Wolf Faust -# For conditions of distribution and use, see copyright notice in png.h -# -# Note: Use #define PNG_READ_BIG_ENDIAN_SUPPORTED in pngconf.h -# -# Location/path of zlib include files -ZLIB=/zlib -#compiler -CC=sc -#compiler flags -# WARNING: a bug in V6.51 causes bad code with OPTGO -# So use V6.55 or set NOOPTGO!!!!!!!!! -CFLAGS= NOSTKCHK PARMS=REG OPTIMIZE OPTGO OPTPEEP OPTINLOCAL OPTINL\ - OPTLOOP OPTRDEP=4 OPTDEP=4 OPTCOMP=4 INCLUDEDIR=$(ZLIB) \ - DEFINE=PNG_INTERNAL -#linker flags -LDFLAGS= SD ND BATCH -#link libs -LDLIBS= libpng.lib libgz.lib LIB:scm.lib LIB:sc.lib Lib:amiga.lib -# linker -LN= slink -# file deletion command -RM= delete quiet -# library (.lib) file creation command -AR= oml -# make directory command -MKDIR= makedir - -OBJS = png.o pngset.o pngget.o pngrutil.o pngtrans.o pngwutil.o \ - pngread.o pngrio.o pngwio.o pngwrite.o pngrtran.o \ - pngwtran.o pngmem.o pngerror.o pngpread.o - -all: libpng.lib pngtest - -libpng.lib: $(OBJS) --$(RM) libpng.lib -$(AR) libpng.lib r $(OBJS) - -pngtest: pngtest.o libpng.lib -$(LN) libpng.pc - -libpng-config: - ( cat scripts/libpng-config-head.in; \ - echo prefix=\"$(prefix)\"; \ - echo I_opts=\"-I$(INCPATH)/$(LIBNAME)\"; \ - echo libs=\"-lpng12 -lz -lm\"; \ - cat scripts/libpng-config-body.in ) > libpng-config - chmod +x libpng-config - -$(LIBNAME).so: $(LIBNAME).so.$(PNGMAJ) - ln -sf $(LIBNAME).so.$(PNGMAJ) $(LIBNAME).so - cp $(LIBNAME).so* /boot/home/config/lib - -$(LIBNAME).so.$(PNGMAJ): $(LIBNAME).so.$(PNGVER) - ln -sf $(LIBNAME).so.$(PNGVER) $(LIBNAME).so.$(PNGMAJ) - -$(LIBNAME).so.$(PNGVER): $(OBJSDLL) - $(CC) -nostart -Wl,-soname,$(LIBNAME).so.$(PNGMAJ) -o \ - $(LIBNAME).so.$(PNGVER) $(OBJSDLL) - -libpng.so.3.$(PNGMIN): $(OBJSDLL) - $(CC) -nostart -Wl,-soname,libpng.so.3 -o \ - libpng.so.3.$(PNGMIN) $(OBJSDLL) - -pngtest: pngtest.o $(LIBNAME).so - $(CC) -L$(ZLIBLIB) -lz -lpng12 -o pngtest pngtest.o - -test: pngtest - ./pngtest - -install-headers: png.h pngconf.h - -@if [ ! -d $(DI) ]; then mkdir $(DI); fi - -@if [ ! -d $(DI)/$(LIBNAME) ]; then mkdir $(DI)/$(LIBNAME); fi - cp png.h pngconf.h $(DI)/$(LIBNAME) - chmod 644 $(DI)/$(LIBNAME)/png.h $(DI)/$(LIBNAME)/pngconf.h - -@/bin/rm -f $(DI)/png.h $(DI)/pngconf.h - -@/bin/rm -f $(DI)/libpng - (cd $(DI); ln -sf $(LIBNAME) libpng; ln -sf $(LIBNAME)/* .) - -install-static: install-headers libpng.a - -@if [ ! -d $(DL) ]; then mkdir $(DL); fi - cp libpng.a $(DL)/$(LIBNAME).a - chmod 644 $(DL)/$(LIBNAME).a - -@/bin/rm -f $(DL)/libpng.a - (cd $(DL); ln -sf $(LIBNAME).a libpng.a) - -install-shared: install-headers $(LIBNAME).so.$(PNGVER) libpng.pc \ - libpng.so.3.$(PNGMIN) - -@if [ ! -d $(DL) ]; then mkdir $(DL); fi - -@/bin/rm -f $(DL)/$(LIBNAME).so.$(PNGVER)* $(DL)/$(LIBNAME).so - -@/bin/rm -f $(DL)/$(LIBNAME).so.$(PNGMAJ) - -@/bin/rm -f $(DL)/libpng.so - -@/bin/rm -f $(DL)/libpng.so.3 - -@/bin/rm -f $(DL)/libpng.so.3.$(PNGMIN)* - cp $(LIBNAME).so.$(PNGVER) $(DL) - cp libpng.so.3.$(PNGMIN) $(DL) - chmod 755 $(DL)/$(LIBNAME).so.$(PNGVER) - chmod 755 $(DL)/libpng.so.3.$(PNGMIN) - (cd $(DL); \ - ln -sf libpng.so.3.$(PNGMIN) libpng.so.3; \ - ln -sf libpng.so.3 libpng.so; \ - ln -sf $(LIBNAME).so.$(PNGVER) $(LIBNAME).so.$(PNGMAJ); \ - ln -sf $(LIBNAME).so.$(PNGMAJ) $(LIBNAME).so) - -@if [ ! -d $(DL)/pkgconfig ]; then mkdir $(DL)/pkgconfig; fi - -@/bin/rm -f $(DL)/pkgconfig/$(LIBNAME).pc - -@/bin/rm -f $(DL)/pkgconfig/libpng.pc - cp libpng.pc $(DL)/pkgconfig/$(LIBNAME).pc - chmod 644 $(DL)/pkgconfig/$(LIBNAME).pc - (cd $(DL)/pkgconfig; ln -sf $(LIBNAME).pc libpng.pc) - -install-man: libpng.3 libpngpf.3 png.5 - -@if [ ! -d $(DM) ]; then mkdir $(DM); fi - -@if [ ! -d $(DM)/man3 ]; then mkdir $(DM)/man3; fi - -@/bin/rm -f $(DM)/man3/libpng.3 - -@/bin/rm -f $(DM)/man3/libpngpf.3 - cp libpng.3 $(DM)/man3 - cp libpngpf.3 $(DM)/man3 - -@if [ ! -d $(DM)/man5 ]; then mkdir $(DM)/man5; fi - -@/bin/rm -f $(DM)/man5/png.5 - cp png.5 $(DM)/man5 - -install-config: libpng-config - -@if [ ! -d $(DB) ]; then mkdir $(DB); fi - -@/bin/rm -f $(DB)/libpng-config - -@/bin/rm -f $(DB)/$(LIBNAME)-config - cp libpng-config $(DB)/$(LIBNAME)-config - chmod 755 $(DB)/$(LIBNAME)-config - (cd $(DB); ln -sf $(LIBNAME)-config libpng-config) - -install: install-static install-shared install-man install-config - -# If you installed in $(DESTDIR), test-installed won't work until you -# move the library to its final location. Use test-dd to test it -# before then. - -test-dd: - echo - echo Testing installed dynamic shared library in $(DL). - $(CC) -I$(DI) $(CFLAGS) \ - `$(BINPATH)/libpng12-config --cflags` pngtest.c \ - -L$(DL) -L$(ZLIBLIB) -W1,-rpath $(ZLIBLIB):$(DL) \ - -o pngtestd `$(BINPATH)/libpng12-config --ldflags` - ./pngtestd pngtest.png - -test-installed: - $(CC) $(CFLAGS) \ - `$(BINPATH)/libpng12-config --cflags` pngtest.c \ - -L$(ZLIBLIB) -Wl,-rpath,$(ZLIBLIB) \ - -o pngtesti `$(BINPATH)/libpng12-config --ldflags` - ./pngtesti pngtest.png - -clean: - /bin/rm -f *.o libpng.a pngtest pngout.png libpng-config \ - $(LIBNAME).so $(LIBNAME).so.$(PNGMAJ)* pngtesti \ - libpng.so.3.$(PNGMIN) \ - libpng.pc - -# DO NOT DELETE THIS LINE -- make depend depends on it. - -png.o png.pic.o: png.h pngconf.h -pngerror.o pngerror.pic.o: png.h pngconf.h -pngrio.o pngrio.pic.o: png.h pngconf.h -pngwio.o pngwio.pic.o: png.h pngconf.h -pngmem.o pngmem.pic.o: png.h pngconf.h -pngset.o pngset.pic.o: png.h pngconf.h -pngget.o pngget.pic.o: png.h pngconf.h -pngread.o pngread.pic.o: png.h pngconf.h -pngrtran.o pngrtran.pic.o: png.h pngconf.h -pngrutil.o pngrutil.pic.o: png.h pngconf.h -pngtrans.o pngtrans.pic.o: png.h pngconf.h -pngwrite.o pngwrite.pic.o: png.h pngconf.h -pngwtran.o pngwtran.pic.o: png.h pngconf.h -pngwutil.o pngwutil.pic.o: png.h pngconf.h -pngpread.o pngpread.pic.o: png.h pngconf.h -pngtest.o: png.h pngconf.h diff --git a/wxWidgets/src/png/scripts/makefile.bor b/wxWidgets/src/png/scripts/makefile.bor deleted file mode 100644 index a5651aa3f8..0000000000 --- a/wxWidgets/src/png/scripts/makefile.bor +++ /dev/null @@ -1,162 +0,0 @@ -# Makefile for libpng -# 16-bit Borland C++ (Note: All modules are compiled in C mode) -# To build the library, do: -# "make -fmakefile.bor -DMODEL=c" -# or: "make -fmakefile.bor -DMODEL=l" -# -# ------------ Borland C++ ------------ - -### Absolutely necessary for this makefile to work -.AUTODEPEND - -## Where zlib.h, zconf.h and zlib_MODEL.lib are -ZLIB_DIR=..\zlib - - -## Compiler, linker and lib stuff -CC=bcc -LD=bcc -LIB=tlib - -!ifndef MODEL -MODEL=l -!endif - -MODEL_ARG=-m$(MODEL) - -#TARGET_CPU=3 -# 2 = 286, 3 = 386, etc. -!ifndef TARGET_CPU -TARGET_CPU=2 -!endif - -# Use this if you don't want Borland's fancy exception handling -# (for Borland C++ 4.0 or later) -#NOEHLIB=noeh$(MODEL).lib - -!ifdef DEBUG -CDEBUG=-v -LDEBUG=-v -!else -CDEBUG= -LDEBUG= -!endif - -# STACKOFLOW=1 -!ifdef STACKOFLOW -CDEBUG=$(CDEBUG) -N -LDEBUG=$(LDEBUG) -N -!endif - -# -X- turn on dependency generation in the object file -# -w set all warnings on -# -O2 optimize for speed -# -Z global optimization -CFLAGS=-O2 -Z -X- -w -I$(ZLIB_DIR) -$(TARGET_CPU) $(MODEL_ARG) $(CDEBUG) - -# -M generate map file -LDFLAGS=-M -L$(ZLIB_DIR) $(MODEL_ARG) $(LDEBUG) - - -## Variables -OBJS = \ - png.obj \ - pngerror.obj \ - pngget.obj \ - pngmem.obj \ - pngpread.obj \ - pngread.obj \ - pngrio.obj \ - pngrtran.obj \ - pngrutil.obj \ - pngset.obj \ - pngtrans.obj \ - pngwio.obj \ - pngwrite.obj \ - pngwtran.obj \ - pngwutil.obj - -LIBOBJS = \ - +png.obj \ - +pngerror.obj \ - +pngget.obj \ - +pngmem.obj \ - +pngpread.obj \ - +pngread.obj \ - +pngrio.obj \ - +pngrtran.obj \ - +pngrutil.obj \ - +pngset.obj \ - +pngtrans.obj \ - +pngwio.obj \ - +pngwrite.obj \ - +pngwtran.obj \ - +pngwutil.obj - -LIBNAME=libpng$(MODEL).lib - - -## Implicit rules -# Braces let make "batch" calls to the compiler, -# 2 calls instead of 12; space is important. -.c.obj: - $(CC) $(CFLAGS) -c {$*.c } - -.c.exe: - $(CC) $(CFLAGS) $(LDFLAGS) $*.c $(LIBNAME) zlib_$(MODEL).lib $(NOEHLIB) - - -## Major targets -all: libpng pngtest - -libpng: $(LIBNAME) - -pngtest: pngtest$(MODEL).exe - -test: pngtest$(MODEL).exe - pngtest$(MODEL) - - -## Minor Targets - -png.obj: png.c -pngerror.obj: pngerror.c -pngget.obj: pngget.c -pngmem.obj: pngmem.c -pngpread.obj: pngpread.c -pngread.obj: pngread.c -pngrio.obj: pngrio.c -pngrtran.obj: pngrtran.c -pngrutil.obj: pngrutil.c -pngset.obj: pngset.c -pngtrans.obj: pngtrans.c -pngwio.obj: pngwio.c -pngwrite.obj: pngwrite.c -pngwtran.obj: pngwtran.c -pngwutil.obj: pngwutil.c - - -$(LIBNAME): $(OBJS) - -del $(LIBNAME) - $(LIB) $(LIBNAME) @&&| -$(LIBOBJS), libpng$(MODEL) -| - - -pngtest$(MODEL).obj: pngtest.c - $(CC) $(CFLAGS) -opngtest$(MODEL) -c pngtest.c - -pngtest$(MODEL).exe: pngtest$(MODEL).obj - $(LD) $(LDFLAGS) pngtest$(MODEL).obj $(LIBNAME) zlib_$(MODEL).lib $(NOEHLIB) - - -# Clean up anything else you want -clean: - -del *.obj - -del *.exe - -del *.lib - -del *.lst - -del *.map - - -# End of makefile for libpng diff --git a/wxWidgets/src/png/scripts/makefile.cygwin b/wxWidgets/src/png/scripts/makefile.cygwin deleted file mode 100644 index bb0d7b6295..0000000000 --- a/wxWidgets/src/png/scripts/makefile.cygwin +++ /dev/null @@ -1,315 +0,0 @@ -# makefile for cygwin on x86 -# Builds both dll (with import lib) and static lib versions -# of the library, and builds two copies of pngtest: one -# statically linked and one dynamically linked. -# -# Copyright (C) 2002 Soren Anderson, Charles Wilson, and Glenn Randers-Pehrson -# based on makefile for linux-elf w/mmx by: -# Copyright (C) 1998-2000 Greg Roelofs -# Copyright (C) 1996, 1997 Andreas Dilger -# For conditions of distribution and use, see copyright notice in png.h - -# This makefile intends to support building outside the src directory -# if desired. When invoking it, specify an argument to SRCDIR on the -# command line that points to the top of the directory where your source -# is located. - -ifdef SRCDIR -VPATH = $(SRCDIR) -else -SRCDIR = . -endif - -# Override DESTDIR= on the make install command line to easily support -# installing into a temporary location. Example: -# -# make install DESTDIR=/tmp/build/libpng -# -# If you're going to install into a temporary location -# via DESTDIR, $(DESTDIR)$(prefix) must already exist before -# you execute make install. - -DESTDIR= - -# To enable assembler optimizations, add '-DPNG_USE_PNGGCCRD' to -# $CFLAGS, and include pnggccrd.o in $OBJS, below, and in the dependency -# list at the bottom of this makefile. - -CC=gcc -ifdef MINGW -MINGW_CCFLAGS=-mno-cygwin -I/usr/include/mingw -MINGW_LDFLAGS=-mno-cygwin -L/usr/lib/mingw -endif - -# Where "make install" puts libpng*.a, *png*.dll, png.h, and pngconf.h -ifndef prefix -prefix=/usr -$(warning You haven't specified a 'prefix=' location. Defaulting to "/usr") -endif - -# Where the zlib library and include files are located -ZLIBLIB= /usr/lib -ZLIBINC= -#ZLIBLIB=../zlib -#ZLIBINC=../zlib - -ALIGN= -# for i386: -#ALIGN=-malign-loops=2 -malign-functions=2 - -WARNMORE=-Wwrite-strings -Wpointer-arith -Wshadow \ - -Wmissing-declarations -Wtraditional -Wcast-align \ - -Wstrict-prototypes -Wmissing-prototypes #-Wconversion - -### if you use the asm, add pnggccrd.o to the OBJS list -### -### if you don't need thread safety, but want the asm accel -#CFLAGS= $(strip $(MINGW_CCFLAGS) -DPNG_THREAD_UNSAFE_OK -DPNG_USE_PNGGCCRD \ -# $(addprefix -I,$(ZLIBINC)) -Wall -O3 $(ALIGN) -funroll-loops \ -# -fomit-frame-pointer) # $(WARNMORE) -g -DPNG_DEBUG=5 -### if you need thread safety and want (minimal) asm accel -#CFLAGS= $(strip $(MINGW_CCFLAGS) -DPNG_USE_PNGGCCRD $(addprefix -I,$(ZLIBINC)) \ -# -Wall -O3 $(ALIGN) -funroll-loops \ -# -fomit-frame-pointer) # $(WARNMORE) -g -DPNG_DEBUG=5 -### Normal (non-asm) compilation -CFLAGS= $(strip $(MINGW_CCFLAGS) $(addprefix -I,$(ZLIBINC)) \ - -Wall -O3 $(ALIGN) -funroll-loops \ - -fomit-frame-pointer) # $(WARNMORE) -g -DPNG_DEBUG=5 - -LIBNAME = libpng12 -PNGMAJ = 0 -CYGDLL = 12 -PNGMIN = 1.2.7 -PNGVER = $(PNGMAJ).$(PNGMIN) - -SHAREDLIB=cygpng$(CYGDLL).dll -STATLIB=libpng.a -IMPLIB=libpng.dll.a -SHAREDDEF=libpng.def -LIBS=$(SHAREDLIB) $(STATLIB) -EXE=.exe - -LDFLAGS=$(strip -L. $(MINGW_LDFLAGS) -lpng $(addprefix -L,$(ZLIBLIB)) -lz) -LDSFLAGS=$(strip -shared -L. $(MINGW_LDFLAGS) -Wl,--export-all) -LDEXTRA=-Wl,--out-implib=$(IMPLIB) $(addprefix -L,$(ZLIBLIB)) -lz - -MKDIR=/bin/mkdir -pv -RANLIB=ranlib -#RANLIB=echo - -INCPATH=$(prefix)/include -LIBPATH=$(prefix)/lib - -BINPATH=$(prefix)/bin -MANPATH=$(prefix)/man -MAN3PATH=$(MANPATH)/man3 -MAN5PATH=$(MANPATH)/man5 - -# cosmetic: shortened strings: -S =$(SRCDIR) -D =$(DESTDIR) -DB =$(D)$(BINPATH) -DI =$(D)$(INCPATH) -DL =$(D)$(LIBPATH) - -OBJS = png.o pngset.o pngget.o pngrutil.o pngtrans.o pngwutil.o \ - pngread.o pngrio.o pngwio.o pngwrite.o pngrtran.o \ - pngwtran.o pngmem.o pngerror.o pngpread.o # pnggccrd.o - -OBJSDLL = $(OBJS:.o=.pic.o) - -.SUFFIXES: .c .o .pic.o - -%.o : %.c - $(CC) -c $(CFLAGS) -o $@ $< -%.pic.o : CFLAGS += -DPNG_BUILD_DLL -%.pic.o : %.c - $(CC) -c $(CFLAGS) -o $@ $< - -all: all-static all-shared libpng.pc libpng-config libpng.pc libpng-config - -# Make this to verify that "make [...] install" will do what you want. -buildsetup-tell: - @echo VPATH is set to: \"$(VPATH)\" - @echo prefix is set to: \"$(prefix)\" - @echo -e INCPATH,LIBPATH, etc. are set to:'\n' \ - $(addprefix $(D),$(INCPATH)'\n' $(LIBPATH)'\n' $(BINPATH)'\n' \ - $(MANPATH)'\n' $(MAN3PATH)'\n' $(MAN5PATH)'\n')'\n' - -libpng.pc: scripts/libpng.pc.in - @echo -e Making pkg-config file for this libpng installation..'\n' \ - using PREFIX=\"$(prefix)\"'\n' - cat $(S)/scripts/libpng.pc.in | sed -e s\!@PREFIX@!$(prefix)! | \ - sed -e s/-lm// > libpng.pc - -libpng-config: scripts/libpng-config-head.in scripts/libpng-config-body.in - @echo -e Making $(LIBNAME) libpng-config file for this libpng \ - installation..'\n' using PREFIX=\"$(prefix)\"'\n' - ( cat $(S)/scripts/libpng-config-head.in; \ - echo prefix=\"$(prefix)\"; \ - echo I_opts=\"-I$(INCPATH)/$(LIBNAME)\"; \ - echo L_opts=\"-L$(LIBPATH)\"; \ - echo libs=\"-lpng$(CYGDLL) -lz\"; \ - cat $(S)/scripts/libpng-config-body.in ) > libpng-config - chmod +x libpng-config - -static: all-static -shared: all-shared -all-static: $(STATLIB) pngtest-stat$(EXE) -all-shared: $(SHAREDLIB) pngtest$(EXE) - -pnggccrd.o: pnggccrd.c png.h pngconf.h - @echo "" - @echo ' You can ignore the "control reaches end of non-void function"' - @echo ' warning and " defined but not used" warnings:' - @echo "" - $(CC) -c $(CFLAGS) -o $@ $< - -pnggccrd.pic.o: pnggccrd.c png.h pngconf.h - @echo "" - @echo ' You can ignore the "control reaches end of non-void function"' - @echo ' warning and " defined but not used" warnings:' - @echo "" - $(CC) -c $(CFLAGS) -DPNG_BUILD_DLL -o $@ $< - -$(STATLIB): $(OBJS) - ar rc $@ $(OBJS) - $(RANLIB) $@ - -$(SHAREDDEF): scripts/png32ms.def - cat $< | sed -e '1{G;s/^\(.*\)\(\n\)/EXPORTS/;};2,/^EXPORTS/d' | \ - sed -e 's/\([^;]*\);/;/' > $@ - -$(SHAREDLIB): $(OBJSDLL) $(SHAREDDEF) - $(CC) $(LDSFLAGS) -o $@ $(OBJSDLL) -L. $(LDEXTRA) - -pngtest$(EXE): pngtest.pic.o $(SHAREDLIB) - $(CC) $(CFLAGS) $< $(LDFLAGS) -o $@ - -pngtest-stat$(EXE): pngtest.o $(STATLIB) - $(CC) -static $(CFLAGS) $< $(LDFLAGS) -o $@ - -pngtest.pic.o: pngtest.c - $(CC) $(CFLAGS) -c $< -o $@ - -pngtest.o: pngtest.c - $(CC) $(CFLAGS) -c $< -o $@ - -test: test-static test-shared - -test-static: pngtest-stat$(EXE) - ./pngtest-stat $(S)/pngtest.png - -test-shared: pngtest$(EXE) - ./pngtest $(S)/pngtest.png - -install-static: $(STATLIB) install-headers install-man - -@if [ ! -d $(DL) ]; then $(MKDIR) $(DL); fi - install -m 644 $(STATLIB) $(DL)/$(LIBNAME).a - -@rm -f $(DL)/$(STATLIB) - (cd $(DL); ln -sf $(LIBNAME).a $(STATLIB)) - -install-shared: $(SHAREDLIB) libpng.pc libpng-config install-headers install-man - -@if [ ! -d $(DL) ]; then $(MKDIR) $(DL); fi - -@if [ ! -d $(DB) ]; then $(MKDIR) $(DB); fi - -@if [ ! -d $(DL)/pkgconfig ]; then $(MKDIR) $(DL)/pkgconfig; fi - -@/bin/rm -f $(DL)/pkgconfig/$(LIBNAME).pc - -@/bin/rm -f $(DL)/pkgconfig/libpng.pc - install -m 644 $(IMPLIB) $(DL)/$(LIBNAME).dll.a - -@rm -f $(DL)/$(IMPLIB) - (cd $(DL); ln -sf $(LIBNAME).dll.a $(IMPLIB)) - install -s -m 755 $(SHAREDLIB) $(DB) - install -m 644 libpng.pc $(DL)/pkgconfig/$(LIBNAME).pc - (cd $(DL)/pkgconfig; ln -sf $(LIBNAME).pc libpng.pc) - -install-headers: - -@if [ ! -d $(DI) ]; then $(MKDIR) $(DI); fi - -@if [ ! -d $(DI)/$(LIBNAME) ]; then $(MKDIR) $(DI)/$(LIBNAME); fi - -@rm -f $(DI)/png.h - -@rm -f $(DI)/pngconf.h - install -m 644 $(S)/png.h $(S)/pngconf.h $(DI)/$(LIBNAME) - -@rm -f $(DI)/libpng - (cd $(DI); ln -sf $(LIBNAME) libpng; ln -sf $(LIBNAME)/* .) - -install-man: - -@if [ ! -d $(D)$(MAN3PATH) ]; then $(MKDIR) $(D)$(MAN3PATH); fi - -@if [ ! -d $(D)$(MAN5PATH) ]; then $(MKDIR) $(D)$(MAN5PATH); fi - install -m 644 $(S)/libpngpf.3 $(S)/libpng.3 $(D)$(MAN3PATH) - install -m 644 $(S)/png.5 $(D)$(MAN5PATH) - -install-config: libpng-config - -@if [ ! -d $(DB) ]; then mkdir $(DB); fi - -@/bin/rm -f $(DB)/libpng-config - -@/bin/rm -f $(DB)/$(LIBNAME)-config - cp libpng-config $(DB)/$(LIBNAME)-config - chmod 755 $(DB)/$(LIBNAME)-config - (cd $(DB); ln -sf $(LIBNAME)-config libpng-config) - -# Run this to verify that a future `configure' run will pick up the settings -# you want. -test-config-install: SHELL=/bin/bash -test-config-install: $(DB)/libpng-config - @echo -e Testing libpng-config functions...'\n' - @ for TYRA in LDFLAGS CPPFLAGS CFLAGS LIBS VERSION; \ - do \ - printf "(%d)\t %10s =%s\n" $$(($$gytiu + 1)) $$TYRA \ - "$$($(DB)/libpng-config `echo --$$TYRA |tr '[:upper:]' '[:lower:]'`)"; \ - gytiu=$$(( $$gytiu + 1 )); \ - done - -install: install-static install-shared install-man install-config - -# If you installed in $(DESTDIR), test-installed won't work until you -# move the library to its final location. Use test-dd to test it -# before then. - -test-dd: - echo - echo Testing installed dynamic shared library in $(DL). - $(CC) -I$(DI) $(CFLAGS) \ - `$(BINPATH)/libpng12-config --cflags` pngtest.c \ - -L$(DL) -L$(ZLIBLIB) \ - -o pngtestd `$(BINPATH)/libpng12-config --ldflags` - ./pngtestd pngtest.png - -test-installed: - $(CC) $(CFLAGS) \ - `$(BINPATH)/libpng12-config --cflags` pngtest.c \ - -L$(ZLIBLIB) \ - -o pngtesti$(EXE) `$(BINPATH)/libpng12-config --ldflags` - ./pngtesti$(EXE) pngtest.png - -clean: - /bin/rm -f *.pic.o *.o $(STATLIB) $(IMPLIB) $(SHAREDLIB) \ - pngtest-stat$(EXE) pngtest$(EXE) pngout.png $(SHAREDDEF) \ - libpng-config libpng.pc pngtesti$(EXE) - -DOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO -writelock: - chmod a-w *.[ch35] $(DOCS) scripts/* - -.PHONY: buildsetup-tell libpng.pc libpng-config test-config-install clean - -# DO NOT DELETE THIS LINE -- make depend depends on it. - -png.o png.pic.o: png.h pngconf.h png.c -pngerror.o pngerror.pic.o: png.h pngconf.h pngerror.c -pngrio.o pngrio.pic.o: png.h pngconf.h pngrio.c -pngwio.o pngwio.pic.o: png.h pngconf.h pngwio.c -pngmem.o pngmem.pic.o: png.h pngconf.h pngmem.c -pngset.o pngset.pic.o: png.h pngconf.h pngset.c -pngget.o pngget.pic.o: png.h pngconf.h pngget.c -pngread.o pngread.pic.o: png.h pngconf.h pngread.c -pngrtran.o pngrtran.pic.o: png.h pngconf.h pngrtran.c -pngrutil.o pngrutil.pic.o: png.h pngconf.h pngrutil.c -pngtrans.o pngtrans.pic.o: png.h pngconf.h pngtrans.c -pngwrite.o pngwrite.pic.o: png.h pngconf.h pngwrite.c -pngwtran.o pngwtran.pic.o: png.h pngconf.h pngwtran.c -pngwutil.o pngwutil.pic.o: png.h pngconf.h pngwutil.c -pngpread.o pngpread.pic.o: png.h pngconf.h pngpread.c - -pngtest.o: png.h pngconf.h pngtest.c -pngtest-stat.o: png.h pngconf.h pngtest.c - - - diff --git a/wxWidgets/src/png/scripts/makefile.darwin b/wxWidgets/src/png/scripts/makefile.darwin deleted file mode 100644 index 935eb98f41..0000000000 --- a/wxWidgets/src/png/scripts/makefile.darwin +++ /dev/null @@ -1,216 +0,0 @@ -# makefile for libpng on Darwin / Mac OS X -# Copyright (C) 2002,2004 Glenn Randers-Pehrson -# Copyright (C) 2001 Christoph Pfisterer -# derived from makefile.linux: -# Copyright (C) 1998, 1999 Greg Roelofs -# Copyright (C) 1996, 1997 Andreas Dilger -# For conditions of distribution and use, see copyright notice in png.h - -# where "make install" puts libpng.a, libpng12.dylib, png.h and pngconf.h -prefix=/usr/local - -# Where the zlib library and include files are located -#ZLIBLIB=/usr/local/lib -#ZLIBINC=/usr/local/include -ZLIBLIB=../zlib -ZLIBINC=../zlib - -CC=cc -CFLAGS=-I$(ZLIBINC) -Wall -O3 -funroll-loops -LDFLAGS=-L. -L$(ZLIBLIB) -lpng12 -lz - -#RANLIB=echo -RANLIB=ranlib - -PNGMAJ = 0 -PNGMIN = 1.2.7 -PNGVER = $(PNGMAJ).$(PNGMIN) -LIBNAME = libpng12 - -INCPATH=$(prefix)/include -LIBPATH=$(prefix)/lib -MANPATH=$(prefix)/man -BINPATH=$(prefix)/bin - -# override DESTDIR= on the make install command line to easily support -# installing into a temporary location. Example: -# -# make install DESTDIR=/tmp/build/libpng -# -# If you're going to install into a temporary location -# via DESTDIR, $(DESTDIR)$(prefix) must already exist before -# you execute make install. -DESTDIR= - -DB=$(DESTDIR)$(BINPATH) -DI=$(DESTDIR)$(INCPATH) -DL=$(DESTDIR)$(LIBPATH) -DM=$(DESTDIR)$(MANPATH) - -OBJS = png.o pngset.o pngget.o pngrutil.o pngtrans.o pngwutil.o \ - pngread.o pngrio.o pngwio.o pngwrite.o pngrtran.o \ - pngwtran.o pngmem.o pngerror.o pngpread.o - -OBJSDLL = $(OBJS:.o=.pic.o) - -.SUFFIXES: .c .o .pic.o - -.c.pic.o: - $(CC) -c $(CFLAGS) -fno-common -o $@ $*.c - -all: libpng.a $(LIBNAME).dylib pngtest libpng.pc libpng-config - -libpng.a: $(OBJS) - ar rc $@ $(OBJS) - $(RANLIB) $@ - -libpng.pc: - cat scripts/libpng.pc.in | sed -e s\!@PREFIX@!$(prefix)! | \ - sed -e s/-lm// > libpng.pc - -libpng-config: - ( cat scripts/libpng-config-head.in; \ - echo prefix=\"$(prefix)\"; \ - echo I_opts=\"-I$(INCPATH)/$(LIBNAME)\"; \ - echo L_opts=\"-L$(LIBPATH)\"; \ - echo libs=\"-lpng12 -lz\"; \ - cat scripts/libpng-config-body.in ) > libpng-config - chmod +x libpng-config - -$(LIBNAME).dylib: $(LIBNAME).$(PNGMAJ).dylib - ln -sf $(LIBNAME).$(PNGMAJ).dylib $(LIBNAME).dylib - -$(LIBNAME).$(PNGMAJ).dylib: $(LIBNAME).$(PNGVER).dylib - ln -sf $(LIBNAME).$(PNGVER).dylib $(LIBNAME).$(PNGMAJ).dylib - -$(LIBNAME).$(PNGVER).dylib: $(OBJSDLL) - $(CC) -dynamiclib \ - -install_name $(LIBPATH)/$(LIBNAME).$(PNGMAJ).dylib \ - -current_version $(PNGVER) -compatibility_version $(PNGVER) \ - -o $(LIBNAME).$(PNGVER).dylib \ - $(OBJSDLL) -L$(ZLIBLIB) -lz - -libpng.3.$(PNGMIN).dylib: $(OBJSDLL) - $(CC) -dynamiclib \ - -install_name $(LIBPATH)/libpng.3.dylib \ - -current_version 3 -compatibility_version 3 \ - -o libpng.3.$(PNGMIN).dylib \ - $(OBJSDLL) -L$(ZLIBLIB) -lz - -pngtest: pngtest.o $(LIBNAME).dylib - $(CC) -o pngtest $(CFLAGS) pngtest.o $(LDFLAGS) - -test: pngtest - ./pngtest - -install-headers: png.h pngconf.h - -@if [ ! -d $(DI) ]; then mkdir $(DI); fi - -@if [ ! -d $(DI)/$(LIBNAME) ]; then mkdir $(DI)/$(LIBNAME); fi - cp png.h pngconf.h $(DI)/$(LIBNAME) - chmod 644 $(DI)/$(LIBNAME)/png.h $(DI)/$(LIBNAME)/pngconf.h - -@/bin/rm -f $(DI)/png.h $(DI)/pngconf.h - -@/bin/rm -f $(DI)/libpng - (cd $(DI); ln -sf $(LIBNAME) libpng; ln -sf $(LIBNAME)/* .) - -install-static: install-headers libpng.a - -@if [ ! -d $(DL) ]; then mkdir $(DL); fi - cp libpng.a $(DL)/$(LIBNAME).a - chmod 644 $(DL)/$(LIBNAME).a - $(RANLIB) $(DL)/$(LIBNAME).a - -@/bin/rm -f $(DL)/libpng.a - (cd $(DL); ln -sf $(LIBNAME).a libpng.a) - -install-shared: install-headers $(LIBNAME).dylib libpng.pc \ - libpng.3.$(PNGMIN).dylib - -@if [ ! -d $(DL) ]; then mkdir $(DL); fi - -@/bin/rm -f $(DL)/$(LIBNAME).$(PNGVER)*.dylib - -@/bin/rm -f $(DL)/$(LIBNAME).$(PNGMAJ)*.dylib - -@/bin/rm -f $(DL)/$(LIBNAME).dylib - -@/bin/rm -f $(DL)/libpng.dylib - -@/bin/rm -f $(DL)/libpng.3.dylib - -@/bin/rm -f $(DL)/libpng.3.$(PNGMIN)*.dylib - cp $(LIBNAME).$(PNGVER).dylib $(DL) - cp libpng.3.$(PNGMIN).dylib $(DL) - chmod 755 $(DL)/$(LIBNAME).$(PNGVER).dylib - chmod 755 $(DL)/libpng.3.$(PNGMIN).dylib - (cd $(DL); \ - ln -sf libpng.3.$(PNGMIN).dylib libpng.3.dylib; \ - ln -sf libpng.3.dylib libpng.dylib; \ - ln -sf $(LIBNAME).$(PNGVER).dylib $(LIBNAME).$(PNGMAJ).dylib; \ - ln -sf $(LIBNAME).$(PNGMAJ).dylib $(LIBNAME).dylib) - -@if [ ! -d $(DL)/pkgconfig ]; then mkdir $(DL)/pkgconfig; fi - -@/bin/rm -f $(DL)/pkgconfig/$(LIBNAME).pc - -@/bin/rm -f $(DL)/pkgconfig/libpng.pc - cp libpng.pc $(DL)/pkgconfig/$(LIBNAME).pc - chmod 644 $(DL)/pkgconfig/$(LIBNAME).pc - (cd $(DL)/pkgconfig; ln -sf $(LIBNAME).pc libpng.pc) - -install-man: libpng.3 libpngpf.3 png.5 - -@if [ ! -d $(DM) ]; then mkdir $(DM); fi - -@if [ ! -d $(DM)/man3 ]; then mkdir $(DM)/man3; fi - -@/bin/rm -f $(DM)/man3/libpng.3 - -@/bin/rm -f $(DM)/man3/libpngpf.3 - cp libpng.3 $(DM)/man3 - cp libpngpf.3 $(DM)/man3 - -@if [ ! -d $(DM)/man5 ]; then mkdir $(DM)/man5; fi - -@/bin/rm -f $(DM)/man5/png.5 - cp png.5 $(DM)/man5 - -install-config: libpng-config - -@if [ ! -d $(DB) ]; then mkdir $(DB); fi - -@/bin/rm -f $(DB)/libpng-config - -@/bin/rm -f $(DB)/$(LIBNAME)-config - cp libpng-config $(DB)/$(LIBNAME)-config - chmod 755 $(DB)/$(LIBNAME)-config - (cd $(DB); ln -sf $(LIBNAME)-config libpng-config) - -install: install-static install-shared install-man install-config - -# If you installed in $(DESTDIR), test-installed won't work until you -# move the library to its final location. Use test-dd to test it -# before then. - -test-dd: - echo - echo Testing installed dynamic shared library in $(DL). - $(CC) -I$(DI) -I$(ZLIBINC) \ - `$(BINPATH)/libpng12-config --cflags` pngtest.c \ - -L$(DL) -L$(ZLIBLIB) \ - -o pngtestd `$(BINPATH)/libpng12-config --ldflags` - ./pngtestd pngtest.png - -test-installed: - $(CC) $(CFLAGS) \ - `$(BINPATH)/libpng12-config --cflags` pngtest.c \ - -L$(ZLIBLIB) \ - -o pngtesti `$(BINPATH)/libpng12-config --ldflags` - ./pngtesti pngtest.png - -clean: - rm -f *.o libpng.a pngtest pngout.png libpng-config \ - libpng.3.$(PNGMIN).dylib \ - libpng.pc $(LIBNAME).*dylib pngtesti - -DOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO -writelock: - chmod a-w *.[ch35] $(DOCS) scripts/* - -# DO NOT DELETE THIS LINE -- make depend depends on it. - -png.o png.pic.o: png.h pngconf.h -pngerror.o pngerror.pic.o: png.h pngconf.h -pngrio.o pngrio.pic.o: png.h pngconf.h -pngwio.o pngwio.pic.o: png.h pngconf.h -pngmem.o pngmem.pic.o: png.h pngconf.h -pngset.o pngset.pic.o: png.h pngconf.h -pngget.o pngget.pic.o: png.h pngconf.h -pngread.o pngread.pic.o: png.h pngconf.h -pngrtran.o pngrtran.pic.o: png.h pngconf.h -pngrutil.o pngrutil.pic.o: png.h pngconf.h -pngtrans.o pngtrans.pic.o: png.h pngconf.h -pngwrite.o pngwrite.pic.o: png.h pngconf.h -pngwtran.o pngwtran.pic.o: png.h pngconf.h -pngwutil.o pngwutil.pic.o: png.h pngconf.h -pngpread.o pngpread.pic.o: png.h pngconf.h - -pngtest.o: png.h pngconf.h diff --git a/wxWidgets/src/png/scripts/makefile.dec b/wxWidgets/src/png/scripts/makefile.dec deleted file mode 100644 index 09b51587eb..0000000000 --- a/wxWidgets/src/png/scripts/makefile.dec +++ /dev/null @@ -1,196 +0,0 @@ -# makefile for libpng on DEC Alpha Unix -# Copyright (C) 2000-2002 Glenn Randers-Pehrson -# Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc. -# For conditions of distribution and use, see copyright notice in png.h - -# where make install puts libpng.a and png.h -prefix=/usr/local -INCPATH=$(prefix)/include -LIBPATH=$(prefix)/lib -MANPATH=$(prefix)/man -BINPATH=$(prefix)/bin - -# override DESTDIR= on the make install command line to easily support -# installing into a temporary location. Example: -# -# make install DESTDIR=/tmp/build/libpng -# -# If you're going to install into a temporary location -# via DESTDIR, $(DESTDIR)$(prefix) must already exist before -# you execute make install. -DESTDIR= - -DB=$(DESTDIR)$(BINPATH) -DI=$(DESTDIR)$(INCPATH) -DL=$(DESTDIR)$(LIBPATH) -DM=$(DESTDIR)$(MANPATH) - -# Where the zlib library and include files are located -#ZLIBLIB=/usr/local/lib -#ZLIBINC=/usr/local/include -ZLIBLIB=../zlib -ZLIBINC=../zlib - -PNGMAJ = 0 -PNGMIN = 1.2.7 -PNGVER = $(PNGMAJ).$(PNGMIN) -LIBNAME = libpng12 - -CC=cc -CFLAGS=-std -w1 -I$(ZLIBINC) -O # -g -DPNG_DEBUG=1 -LDFLAGS=-L$(ZLIBLIB) -rpath $(ZLIBLIB) libpng.a -lz -lm - -#RANLIB=echo -RANLIB=ranlib - -OBJS = png.o pngset.o pngget.o pngrutil.o pngtrans.o pngwutil.o \ - pngread.o pngrio.o pngwio.o pngwrite.o pngrtran.o \ - pngwtran.o pngmem.o pngerror.o pngpread.o - -all: $(LIBNAME).so libpng.a pngtest libpng.pc libpng-config - -libpng.a: $(OBJS) - ar rc $@ $(OBJS) - $(RANLIB) $@ - -libpng.pc: - cat scripts/libpng.pc.in | sed -e s\!@PREFIX@!$(prefix)! > libpng.pc - -libpng-config: - ( cat scripts/libpng-config-head.in; \ - echo prefix=\"$(prefix)\"; \ - echo I_opts=\"-I$(INCPATH)/$(LIBNAME)\"; \ - echo ccopts=\"-std\"; \ - echo L_opts=\"-L$(LIBPATH)\"; \ - echo libs=\"-lpng12 -lz -lm\"; \ - cat scripts/libpng-config-body.in ) > libpng-config - chmod +x libpng-config - -$(LIBNAME).so: $(LIBNAME).so.$(PNGMAJ) - ln -f -s $(LIBNAME).so.$(PNGMAJ) $(LIBNAME).so - -$(LIBNAME).so.$(PNGMAJ): $(LIBNAME).so.$(PNGVER) - ln -f -s $(LIBNAME).so.$(PNGVER) $(LIBNAME).so.$(PNGMAJ) - -$(LIBNAME).so.$(PNGVER): $(OBJS) - $(CC) -shared -o $@ $(OBJS) -L$(ZLIBLIB) \ - -soname $(LIBNAME).so.$(PNGMAJ) - -libpng.so.3.$(PNGMIN): $(OBJS) - $(CC) -shared -o $@ $(OBJS) -L$(ZLIBLIB) \ - -soname libpng.so.3 - -pngtest: pngtest.o libpng.a - $(CC) -o pngtest $(CFLAGS) pngtest.o $(LDFLAGS) - -test: pngtest - ./pngtest - -install-headers: png.h pngconf.h - -@if [ ! -d $(DI) ]; then mkdir $(DI); fi - -@if [ ! -d $(DI)/$(LIBNAME) ]; then mkdir $(DI)/$(LIBNAME); fi - cp png.h pngconf.h $(DI)/$(LIBNAME) - chmod 644 $(DI)/$(LIBNAME)/png.h $(DI)/$(LIBNAME)/pngconf.h - -@/bin/rm -f $(DI)/png.h $(DI)/pngconf.h - -@/bin/rm -f $(DI)/libpng - (cd $(DI); ln -sf $(LIBNAME) libpng; ln -sf $(LIBNAME)/* .) - -install-static: install-headers libpng.a - -@if [ ! -d $(DL) ]; then mkdir $(DL); fi - cp libpng.a $(DL)/$(LIBNAME).a - chmod 644 $(DL)/$(LIBNAME).a - -@/bin/rm -f $(DL)/libpng.a - (cd $(DL); ln -sf $(LIBNAME).a libpng.a) - -install-shared: install-headers $(LIBNAME).so.$(PNGVER) libpng.pc \ - libpng.so.3.$(PNGMIN) - -@if [ ! -d $(DL) ]; then mkdir $(DL); fi - -@/bin/rm -f $(DL)/$(LIBNAME).so.$(PNGVER)* $(DL)/$(LIBNAME).so - -@/bin/rm -f $(DL)/$(LIBNAME).so.$(PNGMAJ) - -@/bin/rm -f $(DL)/libpng.so - -@/bin/rm -f $(DL)/libpng.so.3 - -@/bin/rm -f $(DL)/libpng.so.3.$(PNGMIN)* - cp $(LIBNAME).so.$(PNGVER) $(DL) - cp libpng.so.3.$(PNGMIN) $(DL) - chmod 755 $(DL)/$(LIBNAME).so.$(PNGVER) - chmod 755 $(DL)/libpng.so.3.$(PNGMIN) - (cd $(DL); \ - ln -f -s libpng.so.3.$(PNGMIN) libpng.so.3; \ - ln -f -s libpng.so.3 libpng.so; \ - ln -sf $(LIBNAME).so.$(PNGVER) $(LIBNAME).so.$(PNGMAJ); \ - ln -sf $(LIBNAME).so.$(PNGMAJ) $(LIBNAME).so) - -@if [ ! -d $(DL)/pkgconfig ]; then mkdir $(DL)/pkgconfig; fi - -@/bin/rm -f $(DL)/pkgconfig/$(LIBNAME).pc - -@/bin/rm -f $(DL)/pkgconfig/libpng.pc - cp libpng.pc $(DL)/pkgconfig/$(LIBNAME).pc - chmod 644 $(DL)/pkgconfig/$(LIBNAME).pc - (cd $(DL)/pkgconfig; ln -sf $(LIBNAME).pc libpng.pc) - -install-man: libpng.3 libpngpf.3 png.5 - -@if [ ! -d $(DM) ]; then mkdir $(DM); fi - -@if [ ! -d $(DM)/man3 ]; then mkdir $(DM)/man3; fi - -@/bin/rm -f $(DM)/man3/libpng.3 - -@/bin/rm -f $(DM)/man3/libpngpf.3 - cp libpng.3 $(DM)/man3 - cp libpngpf.3 $(DM)/man3 - -@if [ ! -d $(DM)/man5 ]; then mkdir $(DM)/man5; fi - -@/bin/rm -f $(DM)/man5/png.5 - cp png.5 $(DM)/man5 - -install-config: libpng-config - -@if [ ! -d $(DB) ]; then mkdir $(DB); fi - -@/bin/rm -f $(DB)/libpng-config - -@/bin/rm -f $(DB)/$(LIBNAME)-config - cp libpng-config $(DB)/$(LIBNAME)-config - chmod 755 $(DB)/$(LIBNAME)-config - (cd $(DB); ln -sf $(LIBNAME)-config libpng-config) - -install: install-static install-shared install-man install-config - -# If you installed in $(DESTDIR), test-installed won't work until you -# move the library to its final location. Use test-dd to test it -# before then. - -test-dd: - echo - echo Testing installed dynamic shared library in $(DL). - $(CC) -w1 -I$(DI) -I$(ZLIBINC) \ - `$(BINPATH)/libpng12-config --cflags` pngtest.c \ - -L$(DL) -L$(ZLIBLIB) -R$(ZLIBLIB) -R$(DL) \ - -o pngtestd `$(BINPATH)/libpng12-config --ldflags` - ./pngtestd pngtest.png - -test-installed: - echo - echo Testing installed dynamic shared library. - $(CC) -w1 -I$(ZLIBINC) \ - `$(BINPATH)/libpng12-config --cflags` pngtest.c \ - -L$(ZLIBLIB) -R$(ZLIBLIB) \ - -o pngtesti `$(BINPATH)/libpng12-config --ldflags` - ./pngtesti pngtest.png - -clean: - /bin/rm -f *.o libpng.a pngtest pngtesti pngout.png \ - libpng-config $(LIBNAME).so $(LIBNAME).so.$(PNGMAJ)* \ - libpng.so.3.$(PNGMIN) \ - libpng.pc - -# DO NOT DELETE THIS LINE -- make depend depends on it. - -png.o: png.h pngconf.h -pngerror.o: png.h pngconf.h -pngrio.o: png.h pngconf.h -pngwio.o: png.h pngconf.h -pngmem.o: png.h pngconf.h -pngset.o: png.h pngconf.h -pngget.o: png.h pngconf.h -pngread.o: png.h pngconf.h -pngrtran.o: png.h pngconf.h -pngrutil.o: png.h pngconf.h -pngtest.o: png.h pngconf.h -pngtrans.o: png.h pngconf.h -pngwrite.o: png.h pngconf.h -pngwtran.o: png.h pngconf.h -pngwutil.o: png.h pngconf.h -pngpread.o: png.h pngconf.h - diff --git a/wxWidgets/src/png/scripts/makefile.dj2 b/wxWidgets/src/png/scripts/makefile.dj2 deleted file mode 100644 index 09045c2755..0000000000 --- a/wxWidgets/src/png/scripts/makefile.dj2 +++ /dev/null @@ -1,55 +0,0 @@ -# DJGPP (DOS gcc) makefile for libpng -# Copyright (C) 2002 Glenn Randers-Pehrson -# Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc. -# For conditions of distribution and use, see copyright notice in png.h - -# where make install will put libpng.a and png.h -#prefix=/usr/local -prefix=. -INCPATH=$(prefix)/include -LIBPATH=$(prefix)/lib - -CC=gcc -CFLAGS=-I../zlib -O -LDFLAGS=-L. -L../zlib/ -lpng -lz -lm - -RANLIB=ranlib - -OBJS = png.o pngset.o pngget.o pngrutil.o pngtrans.o pngwutil.o \ - pngread.o pngrio.o pngwio.o pngwrite.o pngrtran.o pngwtran.o \ - pngmem.o pngerror.o pngpread.o - -all: libpng.a pngtest - -libpng.a: $(OBJS) - ar rc $@ $(OBJS) - $(RANLIB) $@ - -pngtest: pngtest.o libpng.a - $(CC) -o pngtest $(CFLAGS) pngtest.o $(LDFLAGS) - coff2exe pngtest - -test: pngtest - ./pngtest -clean: - rm -f *.o libpng.a pngtest pngout.png - -# DO NOT DELETE THIS LINE -- make depend depends on it. - -png.o: png.h pngconf.h -pngerror.o: png.h pngconf.h -pngrio.o: png.h pngconf.h -pngwio.o: png.h pngconf.h -pngmem.o: png.h pngconf.h -pngset.o: png.h pngconf.h -pngget.o: png.h pngconf.h -pngread.o: png.h pngconf.h -pngpread.o: png.h pngconf.h -pngrtran.o: png.h pngconf.h -pngrutil.o: png.h pngconf.h -pngtest.o: png.h pngconf.h -pngtrans.o: png.h pngconf.h -pngwrite.o: png.h pngconf.h -pngwtran.o: png.h pngconf.h -pngwutil.o: png.h pngconf.h - diff --git a/wxWidgets/src/png/scripts/makefile.freebsd b/wxWidgets/src/png/scripts/makefile.freebsd deleted file mode 100644 index d7d5faedd8..0000000000 --- a/wxWidgets/src/png/scripts/makefile.freebsd +++ /dev/null @@ -1,48 +0,0 @@ -# makefile for libpng under FreeBSD -# Copyright (C) 2002 Glenn Randers-Pehrson and Andrey A. Chernov -# For conditions of distribution and use, see copyright notice in png.h - -PREFIX?= /usr/local -SHLIB_VER?= 5 - -LIB= png -SHLIB_MAJOR= ${SHLIB_VER} -SHLIB_MINOR= 0 -NOPROFILE= YES -NOOBJ= YES - -# where make install puts libpng.a and png.h -DESTDIR= ${PREFIX} -LIBDIR= /lib -INCS= png.h pngconf.h -INCSDIR= /include/libpng -INCDIR= ${INCSDIR} # for 4.x bsd.lib.mk -MAN= libpng.3 libpngpf.3 png.5 -MANDIR= /man/man -SYMLINKS= libpng/png.h ${INCSDIR}/../png.h \ - libpng/pngconf.h ${INCSDIR}/../pngconf.h -LDADD+= -lm -lz -DPADD+= ${LIBM} ${LIBZ} - -CFLAGS+= -I. -DPNG_USE_PNGGCCRD -.if (${MACHINE_ARCH} != "i386") -CFLAGS+= -DPNG_NO_ASSEMBLER_CODE -.endif - -SRCS= png.c pngset.c pngget.c pngrutil.c pngtrans.c pngwutil.c \ - pngread.c pngrio.c pngwio.c pngwrite.c pngrtran.c \ - pngwtran.c pngmem.c pngerror.c pngpread.c pnggccrd.c - -pngtest: pngtest.o libpng.a - ${CC} ${CFLAGS} -L. -static -o pngtest pngtest.o -lpng -lz -lm - -CLEANFILES= pngtest pngtest.o pngout.png - -test: pngtest - ./pngtest - -DOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO -writelock: - chmod a-w *.[ch35] $(DOCS) scripts/* - -.include diff --git a/wxWidgets/src/png/scripts/makefile.gcc b/wxWidgets/src/png/scripts/makefile.gcc deleted file mode 100644 index f7fc368744..0000000000 --- a/wxWidgets/src/png/scripts/makefile.gcc +++ /dev/null @@ -1,66 +0,0 @@ -# makefile for libpng using gcc (generic, static library) -# Copyright (C) 2000 Cosmin Truta -# Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc. -# For conditions of distribution and use, see copyright notice in png.h - -# Location of the zlib library and include files -ZLIBINC = ../zlib -ZLIBLIB = ../zlib - -# Compiler, linker, lib and other tools -CC = gcc -LD = $(CC) -AR = ar rcs -RANLIB = ranlib -RM = rm -f - -CDEBUG = -g -DPNG_DEBUG=5 -LDDEBUG = -CRELEASE = -O2 -LDRELEASE = -s -CFLAGS = -I$(ZLIBINC) -Wall $(CRELEASE) -LDFLAGS = -L. -L$(ZLIBLIB) -lpng -lz -lm $(LDRELEASE) - -# File extensions -O=.o -A=.a -E= - -# Variables -OBJS = png$(O) pngerror$(O) pngget$(O) pngmem$(O) pngpread$(O) \ - pngread$(O) pngrio$(O) pngrtran$(O) pngrutil$(O) pngset$(O) \ - pngtrans$(O) pngwio$(O) pngwrite$(O) pngwtran$(O) pngwutil$(O) - -# Targets -all: libpng$(A) pngtest$(E) - -libpng$(A): $(OBJS) - $(AR) $@ $(OBJS) - $(RANLIB) $@ - -test: pngtest$(E) - ./pngtest$(E) - -pngtest$(E): pngtest$(O) libpng$(A) - $(LD) -o $@ pngtest$(O) $(LDFLAGS) - -clean: - $(RM) *$(O) libpng$(A) pngtest$(E) pngout.png - -png$(O): png.h pngconf.h -pngerror$(O): png.h pngconf.h -pngget$(O): png.h pngconf.h -pngmem$(O): png.h pngconf.h -pngpread$(O): png.h pngconf.h -pngread$(O): png.h pngconf.h -pngrio$(O): png.h pngconf.h -pngrtran$(O): png.h pngconf.h -pngrutil$(O): png.h pngconf.h -pngset$(O): png.h pngconf.h -pngtest$(O): png.h pngconf.h -pngtrans$(O): png.h pngconf.h -pngwio$(O): png.h pngconf.h -pngwrite$(O): png.h pngconf.h -pngwtran$(O): png.h pngconf.h -pngwutil$(O): png.h pngconf.h - diff --git a/wxWidgets/src/png/scripts/makefile.gcmmx b/wxWidgets/src/png/scripts/makefile.gcmmx deleted file mode 100644 index fc4b797ca3..0000000000 --- a/wxWidgets/src/png/scripts/makefile.gcmmx +++ /dev/null @@ -1,260 +0,0 @@ -# makefile for libpng.a and libpng12.so on Linux ELF with gcc using MMX -# assembler code -# Copyright 2002 Greg Roelofs and Glenn Randers-Pehrson -# Copyright 1998-2001 Greg Roelofs -# Copyright 1996-1997 Andreas Dilger -# For conditions of distribution and use, see copyright notice in png.h - -# CAUTION: Do not use this makefile with gcc versions 2.7.2.2 and earlier. - -# WARNING: The assembler code in pnggccrd.c may not be thread safe. - -# NOTE: When testing MMX performance on a multitasking system, make sure -# there are no floating-point programs (e.g., SETI@Home) running in -# the background! Context switches between MMX and FPU are expensive. - -LIBNAME = libpng12 -PNGMAJ = 0 -PNGMIN = 1.2.7 -PNGVER = $(PNGMAJ).$(PNGMIN) - -CC=gcc - -# where "make install" puts libpng12.a, libpng12.so*, -# libpng12/png.h and libpng12/pngconf.h -# Prefix must be a full pathname. -prefix=/usr/local - -# Where the zlib library and include files are located. -#ZLIBLIB=/usr/local/lib -#ZLIBINC=/usr/local/include -ZLIBLIB=../zlib -ZLIBINC=../zlib - -ALIGN= -# for i386: -#ALIGN=-malign-loops=2 -malign-functions=2 - -WARNMORE=-Wwrite-strings -Wpointer-arith -Wshadow \ - -Wmissing-declarations -Wtraditional -Wcast-align \ - -Wstrict-prototypes -Wmissing-prototypes #-Wconversion - -# for pgcc version 2.95.1, -O3 is buggy; don't use it. - -# Remove -DPNG_THREAD_UNSAFE_OK if you need thread safety -### for generic gcc: -CFLAGS=-DPNG_THREAD_UNSAFE_OK -DPNG_USE_PNGGCCRD -I$(ZLIBINC) -Wall \ - -O3 $(ALIGN) -funroll-loops \ - -fomit-frame-pointer # $(WARNMORE) -g -DPNG_DEBUG=5 -### for gcc 2.95.2 on 686: -#CFLAGS=-DPNG_THREAD_UNSAFE_OK -DPNG_USE_PNGGCCRD -I$(ZLIBINC) -Wall -O3 \ -# -mcpu=i686 -malign-double -ffast-math -fstrict-aliasing \ -# $(ALIGN) -funroll-loops -funroll-all-loops -fomit-frame-pointer -### for gcc 2.7.2.3 on 486 and up: -#CFLAGS=-DPNG_THREAD_UNSAFE_OK -DPNG_USE_PNGGCCRD -I$(ZLIBINC) -Wall -O3 \ -# -m486 -malign-double -ffast-math \ -# $(ALIGN) -funroll-loops -funroll-all-loops -fomit-frame-pointer - -LDFLAGS=-L. -Wl,-rpath,. -L$(ZLIBLIB) -Wl,-rpath,$(ZLIBLIB) -lpng12 -lz -lm -LDFLAGS_A=-L$(ZLIBLIB) -Wl,-rpath,$(ZLIBLIB) libpng.a -lz -lm - -RANLIB=ranlib -#RANLIB=echo - -INCPATH=$(prefix)/include -LIBPATH=$(prefix)/lib -MANPATH=$(prefix)/man -BINPATH=$(prefix)/bin - -# override DESTDIR= on the make install command line to easily support -# installing into a temporary location. Example: -# -# make install DESTDIR=/tmp/build/libpng -# -# If you're going to install into a temporary location -# via DESTDIR, $(DESTDIR)$(prefix) must already exist before -# you execute make install. -DESTDIR= - -DB=$(DESTDIR)$(BINPATH) -DI=$(DESTDIR)$(INCPATH) -DL=$(DESTDIR)$(LIBPATH) -DM=$(DESTDIR)$(MANPATH) - -OBJS = png.o pngset.o pngget.o pngrutil.o pngtrans.o pngwutil.o \ - pngread.o pngrio.o pngwio.o pngwrite.o pngrtran.o \ - pngwtran.o pngmem.o pngerror.o pngpread.o pnggccrd.o - -OBJSDLL = $(OBJS:.o=.pic.o) - -.SUFFIXES: .c .o .pic.o - -.c.pic.o: - $(CC) -c $(CFLAGS) -fPIC -o $@ $*.c - -all: libpng.a $(LIBNAME).so pngtest pngtest-static libpng.pc libpng-config - -libpng.a: $(OBJS) - ar rc $@ $(OBJS) - $(RANLIB) $@ - -libpng.pc: - cat scripts/libpng.pc.in | sed -e s\!@PREFIX@!$(prefix)! > libpng.pc - -libpng-config: - ( cat scripts/libpng-config-head.in; \ - echo prefix=\"$(prefix)\"; \ - echo I_opts=\"-I$(INCPATH)/$(LIBNAME)\"; \ - echo cppflags=\"-DPNG_THREAD_UNSAFE_OK -DPNG_USE_PNGGCCRD\"; \ - echo L_opts=\"-L$(LIBPATH)\"; \ - echo R_opts=\"-Wl,-rpath,$(LIBPATH)\"; \ - echo libs=\"-lpng12 -lz -lm\"; \ - cat scripts/libpng-config-body.in ) > libpng-config - chmod +x libpng-config - -pnggccrd.o: pnggccrd.c png.h pngconf.h - $(CC) -c $(CFLAGS) -o $@ $*.c - -pnggccrd.pic.o: pnggccrd.c png.h pngconf.h - $(CC) -c $(CFLAGS) -fPIC -o $@ pnggccrd.c - -$(LIBNAME).so: $(LIBNAME).so.$(PNGMAJ) - ln -sf $(LIBNAME).so.$(PNGMAJ) $(LIBNAME).so - -$(LIBNAME).so.$(PNGMAJ): $(LIBNAME).so.$(PNGVER) - ln -sf $(LIBNAME).so.$(PNGVER) $(LIBNAME).so.$(PNGMAJ) - -$(LIBNAME).so.$(PNGVER): $(OBJSDLL) - $(CC) -shared -Wl,-soname,$(LIBNAME).so.$(PNGMAJ) \ - -o $(LIBNAME).so.$(PNGVER) \ - $(OBJSDLL) - -libpng.so.3.$(PNGMIN): $(OBJSDLL) - $(CC) -shared -Wl,-soname,libpng.so.3 \ - -o libpng.so.3.$(PNGMIN) \ - $(OBJSDLL) - -pngtest: pngtest.o $(LIBNAME).so - $(CC) -o pngtest $(CFLAGS) pngtest.o $(LDFLAGS) - -pngtest-static: pngtest.o libpng.a - $(CC) -o pngtest-static $(CFLAGS) pngtest.o $(LDFLAGS_A) - -test: pngtest pngtest-static - @echo "" - @echo " Running pngtest dynamically linked with $(LIBNAME).so:" - @echo "" - ./pngtest - @echo "" - @echo " Running pngtest statically linked with libpng.a:" - @echo "" - ./pngtest-static - -install-headers: png.h pngconf.h - -@if [ ! -d $(DI) ]; then mkdir $(DI); fi - -@if [ ! -d $(DI)/$(LIBNAME) ]; then mkdir $(DI)/$(LIBNAME); fi - cp png.h pngconf.h $(DI)/$(LIBNAME) - chmod 644 $(DI)/$(LIBNAME)/png.h $(DI)/$(LIBNAME)/pngconf.h - -@/bin/rm -f $(DI)/png.h $(DI)/pngconf.h - -@/bin/rm -f $(DI)/libpng - (cd $(DI); ln -sf $(LIBNAME) libpng; ln -sf $(LIBNAME)/* .) - -install-static: install-headers libpng.a - -@if [ ! -d $(DL) ]; then mkdir $(DL); fi - cp libpng.a $(DL)/$(LIBNAME).a - chmod 644 $(DL)/$(LIBNAME).a - -@/bin/rm -f $(DL)/libpng.a - (cd $(DL); ln -sf $(LIBNAME).a libpng.a) - -install-shared: install-headers $(LIBNAME).so.$(PNGVER) libpng.pc \ - libpng.so.3.$(PNGMIN) - -@if [ ! -d $(DL) ]; then mkdir $(DL); fi - -@/bin/rm -f $(DL)/$(LIBNAME).so.$(PNGVER)* $(DL)/$(LIBNAME).so - -@/bin/rm -f $(DL)/$(LIBNAME).so.$(PNGMAJ) - -@/bin/rm -f $(DL)/libpng.so - -@/bin/rm -f $(DL)/libpng.so.3 - -@/bin/rm -f $(DL)/libpng.so.3.$(PNGMIN)* - cp $(LIBNAME).so.$(PNGVER) $(DL) - cp libpng.so.3.$(PNGMIN) $(DL) - chmod 755 $(DL)/$(LIBNAME).so.$(PNGVER) - chmod 755 $(DL)/libpng.so.3.$(PNGMIN) - (cd $(DL); \ - ln -sf libpng.so.3.$(PNGMIN) libpng.so.3; \ - ln -sf libpng.so.3 libpng.so; \ - ln -sf $(LIBNAME).so.$(PNGVER) $(LIBNAME).so.$(PNGMAJ); \ - ln -sf $(LIBNAME).so.$(PNGMAJ) $(LIBNAME).so) - -@if [ ! -d $(DL)/pkgconfig ]; then mkdir $(DL)/pkgconfig; fi - -@/bin/rm -f $(DL)/pkgconfig/$(LIBNAME).pc - -@/bin/rm -f $(DL)/pkgconfig/libpng.pc - cp libpng.pc $(DL)/pkgconfig/$(LIBNAME).pc - chmod 644 $(DL)/pkgconfig/$(LIBNAME).pc - (cd $(DL)/pkgconfig; ln -sf $(LIBNAME).pc libpng.pc) - -install-man: libpng.3 libpngpf.3 png.5 - -@if [ ! -d $(DM) ]; then mkdir $(DM); fi - -@if [ ! -d $(DM)/man3 ]; then mkdir $(DM)/man3; fi - -@/bin/rm -f $(DM)/man3/libpng.3 - -@/bin/rm -f $(DM)/man3/libpngpf.3 - cp libpng.3 $(DM)/man3 - cp libpngpf.3 $(DM)/man3 - -@if [ ! -d $(DM)/man5 ]; then mkdir $(DM)/man5; fi - -@/bin/rm -f $(DM)/man5/png.5 - cp png.5 $(DM)/man5 - -install-config: libpng-config - -@if [ ! -d $(DB) ]; then mkdir $(DB); fi - -@/bin/rm -f $(DB)/libpng-config - -@/bin/rm -f $(DB)/$(LIBNAME)-config - cp libpng-config $(DB)/$(LIBNAME)-config - chmod 755 $(DB)/$(LIBNAME)-config - (cd $(DB); ln -sf $(LIBNAME)-config libpng-config) - -install: install-static install-shared install-man install-config - -# If you installed in $(DESTDIR), test-installed won't work until you -# move the library to its final location. Use test-dd to test it -# before then. - -test-dd: - echo - echo Testing installed dynamic shared library in $(DL). - $(CC) -I$(DI) -I$(ZLIBINC) \ - `$(BINPATH)/libpng12-config --cflags` pngtest.c \ - -L$(DL) -L$(ZLIBLIB) -W1, -rpath,$(DL) -Wl,-rpath,$(ZLIBLIB) \ - -o pngtestd `$(BINPATH)/libpng12-config --ldflags` - ./pngtestd pngtest.png - -test-installed: - $(CC) -I$(ZLIBINC) \ - `$(BINPATH)/libpng12-config --cflags` pngtest.c \ - -L$(ZLIBLIB) -Wl,-rpath,$(ZLIBLIB) \ - -o pngtesti `$(BINPATH)/libpng12-config --ldflags` - ./pngtesti pngtest.png - -clean: - /bin/rm -f *.o libpng.a pngtest pngout.png libpng-config \ - $(LIBNAME).so $(LIBNAME).so.$(PNGMAJ)* pngtest-static pngtesti \ - libpng.so.3.$(PNGMIN) \ - libpng.pc - -DOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO -writelock: - chmod a-w *.[ch35] $(DOCS) scripts/* - -png.o png.pic.o: png.h pngconf.h png.c -pngerror.o pngerror.pic.o: png.h pngconf.h pngerror.c -pngrio.o pngrio.pic.o: png.h pngconf.h pngrio.c -pngwio.o pngwio.pic.o: png.h pngconf.h pngwio.c -pngmem.o pngmem.pic.o: png.h pngconf.h pngmem.c -pngset.o pngset.pic.o: png.h pngconf.h pngset.c -pngget.o pngget.pic.o: png.h pngconf.h pngget.c -pngread.o pngread.pic.o: png.h pngconf.h pngread.c -pngrtran.o pngrtran.pic.o: png.h pngconf.h pngrtran.c -pngrutil.o pngrutil.pic.o: png.h pngconf.h pngrutil.c -pngtrans.o pngtrans.pic.o: png.h pngconf.h pngtrans.c -pngwrite.o pngwrite.pic.o: png.h pngconf.h pngwrite.c -pngwtran.o pngwtran.pic.o: png.h pngconf.h pngwtran.c -pngwutil.o pngwutil.pic.o: png.h pngconf.h pngwutil.c -pngpread.o pngpread.pic.o: png.h pngconf.h pngpread.c - -pngtest.o: png.h pngconf.h pngtest.c diff --git a/wxWidgets/src/png/scripts/makefile.hp64 b/wxWidgets/src/png/scripts/makefile.hp64 deleted file mode 100644 index 9f64b0d0a3..0000000000 --- a/wxWidgets/src/png/scripts/makefile.hp64 +++ /dev/null @@ -1,216 +0,0 @@ -# makefile for libpng, HPUX (10.20 and 11.00) using the ANSI/C product. -# Copyright (C) 1999-2002 Glenn Randers-Pehrson -# Copyright (C) 1995 Guy Eric Schalnat, Group 42 -# contributed by Jim Rice and updated by Chris Schleicher, Hewlett Packard -# For conditions of distribution and use, see copyright notice in png.h - -# Where the zlib library and include files are located -ZLIBLIB=/opt/zlib/lib -ZLIBINC=/opt/zlib/include - -# Note that if you plan to build a libpng shared library, zlib must also -# be a shared library, which zlib's configure does not do. After running -# zlib's configure, edit the appropriate lines of makefile to read: -# CFLAGS=-O1 -DHAVE_UNISTD -DUSE_MAP -fPIC \ -# LDSHARED=ld -b -# SHAREDLIB=libz.sl - -CC=cc -CFLAGS=-I$(ZLIBINC) -O -Ae -Wl,+vnocompatwarnings +DD64 \ --D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 +Z -DHAVE_UNISTD_H -DUSE_MMAP -# Caution: be sure you have built zlib with the same CFLAGS. -CCFLAGS=-I$(ZLIBINC) -O -Ae -Wl,+vnocompatwarnings +DD64 \ --D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 +Z -DHAVE_UNISTD_H -DUSE_MMAP - -LDFLAGS=-L. -L$(ZLIBLIB) -lpng -lz -lm - -RANLIB=ranlib - -PNGMAJ = 0 -PNGMIN = 1.2.7 -PNGVER = $(PNGMAJ).$(PNGMIN) -LIBNAME = libpng12 - -# where make install puts libpng.a, libpng12.sl, and png.h -prefix=/opt/libpng -INCPATH=$(prefix)/include -LIBPATH=$(prefix)/lib -MANPATH=$(prefix)/man -BINPATH=$(prefix)/bin - -# override DESTDIR= on the make install command line to easily support -# installing into a temporary location. Example: -# -# make install DESTDIR=/tmp/build/libpng -# -# If you're going to install into a temporary location -# via DESTDIR, $(DESTDIR)$(prefix) must already exist before -# you execute make install. -DESTDIR= - -DB=$(DESTDIR)$(BINPATH) -DI=$(DESTDIR)$(INCPATH) -DL=$(DESTDIR)$(LIBPATH) -DM=$(DESTDIR)$(MANPATH) - -OBJS = png.o pngset.o pngget.o pngrutil.o pngtrans.o pngwutil.o \ - pngread.o pngrio.o pngwio.o pngwrite.o pngrtran.o \ - pngwtran.o pngmem.o pngerror.o pngpread.o - -OBJSDLL = $(OBJS:.o=.pic.o) - -.SUFFIXES: .c .o .pic.o - -.c.pic.o: - $(CC) -c $(CFLAGS) +z -o $@ $*.c - -all: libpng.a $(LIBNAME).sl pngtest libpng.pc libpng-config - -libpng.a: $(OBJS) - ar rc $@ $(OBJS) - $(RANLIB) $@ - -libpng.pc: - cat scripts/libpng.pc.in | sed -e s\!@PREFIX@!$(prefix)! > libpng.pc - -libpng-config: - ( cat scripts/libpng-config-head.in; \ - echo prefix=\"$(prefix)\"; \ - echo I_opts=\"-I$(INCPATH)/$(LIBNAME)\"; \ - echo ccopts=\"-Ae +DA1.1 +DS2.0\"; \ - echo L_opts=\"-L$(LIBPATH)\"; \ - echo libs=\"-lpng12 -lz -lm\"; \ - cat scripts/libpng-config-body.in ) > libpng-config - chmod +x libpng-config - -$(LIBNAME).sl: $(LIBNAME).sl.$(PNGMAJ) - ln -sf $(LIBNAME).sl.$(PNGMAJ) $(LIBNAME).sl - -$(LIBNAME).sl.$(PNGMAJ): $(LIBNAME).sl.$(PNGVER) - ln -sf $(LIBNAME).sl.$(PNGVER) $(LIBNAME).sl.$(PNGMAJ) - -$(LIBNAME).sl.$(PNGVER): $(OBJSDLL) - $(LD) -b +s \ - +h $(LIBNAME).sl.$(PNGMAJ) -o $(LIBNAME).sl.$(PNGVER) $(OBJSDLL) - -libpng.sl.3.$(PNGMIN): $(OBJSDLL) - $(LD) -b +s \ - +h libpng.sl.3 -o libpng.sl.3.$(PNGMIN) $(OBJSDLL) - -pngtest: pngtest.o libpng.a - $(CC) -o pngtest $(CCFLAGS) pngtest.o $(LDFLAGS) - -test: pngtest - ./pngtest - -install-headers: png.h pngconf.h - -@if [ ! -d $(DI) ]; then mkdir $(DI); fi - -@if [ ! -d $(DI)/$(LIBNAME) ]; then mkdir $(DI)/$(LIBNAME); fi - cp png.h pngconf.h $(DI)/$(LIBNAME) - chmod 644 $(DI)/$(LIBNAME)/png.h $(DI)/$(LIBNAME)/pngconf.h - -@/bin/rm -f $(DI)/png.h $(DI)/pngconf.h - -@/bin/rm -f $(DI)/libpng - (cd $(DI); ln -sf $(LIBNAME) libpng; ln -sf $(LIBNAME)/* .) - -install-static: install-headers libpng.a - -@if [ ! -d $(DL) ]; then mkdir $(DL); fi - cp libpng.a $(DL)/$(LIBNAME).a - chmod 644 $(DL)/$(LIBNAME).a - -@/bin/rm -f $(DL)/libpng.a - (cd $(DL); ln -sf $(LIBNAME).a libpng.a) - -install-shared: install-headers $(LIBNAME).sl.$(PNGVER) libpng.pc \ - libpng.sl.3.$(PNGMIN) - -@if [ ! -d $(DL) ]; then mkdir $(DL); fi - -@/bin/rm -f $(DL)/$(LIBNAME).sl.$(PNGVER)* $(DL)/$(LIBNAME).sl - -@/bin/rm -f $(DL)/$(LIBNAME).sl.$(PNGMAJ) - -@/bin/rm -f $(DL)/libpng.sl - -@/bin/rm -f $(DL)/libpng.sl.3 - -@/bin/rm -f $(DL)/libpng.sl.3.$(PNGMIN)* - cp $(LIBNAME).sl.$(PNGVER) $(DL) - cp libpng.sl.3.$(PNGMIN) $(DL) - chmod 755 $(DL)/$(LIBNAME).sl.$(PNGVER) - chmod 755 $(DL)/libpng.sl.3.$(PNGMIN) - (cd $(DL); \ - ln -sf libpng.sl.3.$(PNGMIN) libpng.sl.3; \ - ln -sf libpng.sl.3 libpng.sl; \ - ln -sf $(LIBNAME).sl.$(PNGVER) $(LIBNAME).sl.$(PNGMAJ); \ - ln -sf $(LIBNAME).sl.$(PNGMAJ) $(LIBNAME).sl) - -@if [ ! -d $(DL)/pkgconfig ]; then mkdir $(DL)/pkgconfig; fi - -@/bin/rm -f $(DL)/pkgconfig/$(LIBNAME).pc - -@/bin/rm -f $(DL)/pkgconfig/libpng.pc - cp libpng.pc $(DL)/pkgconfig/$(LIBNAME).pc - chmod 644 $(DL)/pkgconfig/$(LIBNAME).pc - (cd $(DL)/pkgconfig; ln -sf $(LIBNAME).pc libpng.pc) - -install-man: libpng.3 libpngpf.3 png.5 - -@if [ ! -d $(DM) ]; then mkdir $(DM); fi - -@if [ ! -d $(DM)/man3 ]; then mkdir $(DM)/man3; fi - -@/bin/rm -f $(DM)/man3/libpng.3 - -@/bin/rm -f $(DM)/man3/libpngpf.3 - cp libpng.3 $(DM)/man3 - cp libpngpf.3 $(DM)/man3 - -@if [ ! -d $(DM)/man5 ]; then mkdir $(DM)/man5; fi - -@/bin/rm -f $(DM)/man5/png.5 - cp png.5 $(DM)/man5 - -install-config: libpng-config - -@if [ ! -d $(DB) ]; then mkdir $(DB); fi - -@/bin/rm -f $(DB)/libpng-config - -@/bin/rm -f $(DB)/$(LIBNAME)-config - cp libpng-config $(DB)/$(LIBNAME)-config - chmod 755 $(DB)/$(LIBNAME)-config - (cd $(DB); ln -sf $(LIBNAME)-config libpng-config) - -install: install-static install-shared install-man install-config - -# If you installed in $(DESTDIR), test-installed won't work until you -# move the library to its final location. Use test-dd to test it -# before then. - -test-dd: - echo - echo Testing installed dynamic shared library in $(DL). - $(CC) -I$(DI) -I$(ZLIBINC) $(CCFLAGS) \ - `$(BINPATH)/libpng12-config --cflags` pngtest.c \ - -L$(DL) -L$(ZLIBLIB) \ - -o pngtestd `$(BINPATH)/libpng12-config --ldflags` - ./pngtestd pngtest.png - -test-installed: - echo - echo Testing installed dynamic shared library. - $(CC) $(CCFLAGS) \ - `$(BINPATH)/libpng12-config --cflags` pngtest.c \ - -L$(ZLIBLIB) \ - -o pngtesti `$(BINPATH)/libpng12-config --ldflags` - ./pngtesti pngtest.png - -clean: - /bin/rm -f *.o libpng.a pngtest pngtesti pngout.png \ - libpng-config $(LIBNAME).sl $(LIBNAME).sl.$(PNGMAJ)* \ - libpng.sl.3.$(PNGMIN) \ - libpng.pc - -DOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO -writelock: - chmod a-w *.[ch35] $(DOCS) scripts/* - -# DO NOT DELETE THIS LINE -- make depend depends on it. - -png.o: png.h pngconf.h -pngerror.o: png.h pngconf.h -pngrio.o: png.h pngconf.h -pngwio.o: png.h pngconf.h -pngmem.o: png.h pngconf.h -pngset.o: png.h pngconf.h -pngget.o: png.h pngconf.h -pngread.o: png.h pngconf.h -pngrtran.o: png.h pngconf.h -pngrutil.o: png.h pngconf.h -pngtest.o: png.h pngconf.h -pngtrans.o: png.h pngconf.h -pngwrite.o: png.h pngconf.h -pngwtran.o: png.h pngconf.h -pngwutil.o: png.h pngconf.h -pngpread.o: png.h pngconf.h diff --git a/wxWidgets/src/png/scripts/makefile.hpgcc b/wxWidgets/src/png/scripts/makefile.hpgcc deleted file mode 100644 index fd79e1bf3d..0000000000 --- a/wxWidgets/src/png/scripts/makefile.hpgcc +++ /dev/null @@ -1,228 +0,0 @@ -# makefile for libpng on HP-UX using GCC with the HP ANSI/C linker. -# Copyright (C) 2002, Glenn Randers-Pehrson -# Copyright (C) 2001, Laurent faillie -# Copyright (C) 1998, 1999 Greg Roelofs -# Copyright (C) 1996, 1997 Andreas Dilger -# For conditions of distribution and use, see copyright notice in png.h - -CC=gcc -LD=ld - -# where "make install" puts libpng.a, libpng.sl*, png.h and pngconf.h -prefix=/usr/local - -# Where the zlib library and include files are located -ZLIBLIB=/opt/zlib/lib -ZLIBINC=/opt/zlib/include - -# Note that if you plan to build a libpng shared library, zlib must also -# be a shared library, which zlib's configure does not do. After running -# zlib's configure, edit the appropriate lines of makefile to read: -# CFLAGS=-O1 -DHAVE_UNISTD -DUSE_MAP -fPIC \ -# LDSHARED=ld -b -# SHAREDLIB=libz.sl - -ALIGN= -# for i386: -#ALIGN=-malign-loops=2 -malign-functions=2 - -WARNMORE=-Wwrite-strings -Wpointer-arith -Wshadow \ - -Wmissing-declarations -Wtraditional -Wcast-align \ - -Wstrict-prototypes -Wmissing-prototypes #-Wconversion - -# for pgcc version 2.95.1, -O3 is buggy; don't use it. - -CFLAGS=-I$(ZLIBINC) -Wall -O3 -funroll-loops \ - $(ALIGN) # $(WARNMORE) -g -DPNG_DEBUG=5 -#LDFLAGS=-L. -Wl,-rpath,. -L$(ZLIBLIB) -Wl,-rpath,$(ZLIBLIB) -lpng12 -lz -lm -LDFLAGS=-L. -L$(ZLIBLIB) -lpng12 -lz -lm - -RANLIB=ranlib -#RANLIB=echo - -PNGMAJ = 0 -PNGMIN = 1.2.7 -PNGVER = $(PNGMAJ).$(PNGMIN) -LIBNAME = libpng12 - -INCPATH=$(prefix)/include -LIBPATH=$(prefix)/lib -MANPATH=$(prefix)/man -BINPATH=$(prefix)/bin - -# override DESTDIR= on the make install command line to easily support -# installing into a temporary location. Example: -# -# make install DESTDIR=/tmp/build/libpng -# -# If you're going to install into a temporary location -# via DESTDIR, $(DESTDIR)$(prefix) must already exist before -# you execute make install. -DESTDIR= - -DB=$(DESTDIR)$(BINPATH) -DI=$(DESTDIR)$(INCPATH) -DL=$(DESTDIR)$(LIBPATH) -DM=$(DESTDIR)$(MANPATH) - -OBJS = png.o pngset.o pngget.o pngrutil.o pngtrans.o pngwutil.o \ - pngread.o pngrio.o pngwio.o pngwrite.o pngrtran.o \ - pngwtran.o pngmem.o pngerror.o pngpread.o - -OBJSDLL = $(OBJS:.o=.pic.o) - -.SUFFIXES: .c .o .pic.o - -.c.pic.o: - $(CC) -c $(CFLAGS) -fPIC -o $@ $*.c - -all: libpng.a $(LIBNAME).sl pngtest libpng.pc libpng-config - -libpng.a: $(OBJS) - ar rc $@ $(OBJS) - $(RANLIB) $@ - -libpng.pc: - cat scripts/libpng.pc.in | sed -e s\!@PREFIX@!$(prefix)! > libpng.pc - -libpng-config: - ( cat scripts/libpng-config-head.in; \ - echo prefix=\"$(prefix)\"; \ - echo I_opts=\"-I$(INCPATH)/$(LIBNAME)\"; \ - echo libs=\"-lpng12 -lz -lm\"; \ - cat scripts/libpng-config-body.in ) > libpng-config - chmod +x libpng-config - -$(LIBNAME).sl: $(LIBNAME).sl.$(PNGMAJ) - ln -sf $(LIBNAME).sl.$(PNGMAJ) $(LIBNAME).sl - -$(LIBNAME).sl.$(PNGMAJ): $(LIBNAME).sl.$(PNGVER) - ln -sf $(LIBNAME).sl.$(PNGVER) $(LIBNAME).sl.$(PNGMAJ) - -$(LIBNAME).sl.$(PNGVER): $(OBJSDLL) - $(LD) -b +s \ - +h $(LIBNAME).sl.$(PNGMAJ) -o $(LIBNAME).sl.$(PNGVER) $(OBJSDLL) - -libpng.sl.3.$(PNGMIN): $(OBJSDLL) - $(LD) -b +s \ - +h libpng.sl.3 -o libpng.sl.3.$(PNGMIN) $(OBJSDLL) - -pngtest: pngtest.o $(LIBNAME).sl - $(CC) -o pngtest $(CFLAGS) pngtest.o $(LDFLAGS) - -test: pngtest - ./pngtest - - -install-headers: png.h pngconf.h - -@if [ ! -d $(DI) ]; then mkdir $(DI); fi - -@if [ ! -d $(DI)/$(LIBNAME) ]; then mkdir $(DI)/$(LIBNAME); fi - cp png.h pngconf.h $(DI)/$(LIBNAME) - chmod 644 $(DI)/$(LIBNAME)/png.h $(DI)/$(LIBNAME)/pngconf.h - -@/bin/rm -f $(DI)/png.h $(DI)/pngconf.h - -@/bin/rm -f $(DI)/libpng - (cd $(DI); ln -sf $(LIBNAME) libpng; ln -sf $(LIBNAME)/* .) - -install-static: install-headers libpng.a - -@if [ ! -d $(DL) ]; then mkdir $(DL); fi - cp libpng.a $(DL)/$(LIBNAME).a - chmod 644 $(DL)/$(LIBNAME).a - -@/bin/rm -f $(DL)/libpng.a - (cd $(DL); ln -sf $(LIBNAME).a libpng.a) - -install-shared: install-headers $(LIBNAME).sl.$(PNGVER) libpng.pc \ - libpng.sl.3.$(PNGMIN) - -@if [ ! -d $(DL) ]; then mkdir $(DL); fi - -@/bin/rm -f $(DL)/$(LIBNAME).sl.$(PNGVER)* $(DL)/$(LIBNAME).sl - -@/bin/rm -f $(DL)/$(LIBNAME).sl.$(PNGMAJ) - -@/bin/rm -f $(DL)/libpng.sl - -@/bin/rm -f $(DL)/libpng.sl.3 - -@/bin/rm -f $(DL)/libpng.sl.3.$(PNGMIN)* - cp $(LIBNAME).sl.$(PNGVER) $(DL) - cp libpng.sl.3.$(PNGMIN) $(DL) - chmod 755 $(DL)/$(LIBNAME).sl.$(PNGVER) - chmod 755 $(DL)/libpng.sl.3.$(PNGMIN) - (cd $(DL); \ - ln -sf libpng.sl.3.$(PNGMIN) libpng.sl.3; \ - ln -sf libpng.sl.3 libpng.sl; \ - ln -sf $(LIBNAME).sl.$(PNGVER) $(LIBNAME).sl.$(PNGMAJ); \ - ln -sf $(LIBNAME).sl.$(PNGMAJ) $(LIBNAME).sl) - -@if [ ! -d $(DL)/pkgconfig ]; then mkdir $(DL)/pkgconfig; fi - -@/bin/rm -f $(DL)/pkgconfig/$(LIBNAME).pc - -@/bin/rm -f $(DL)/pkgconfig/libpng.pc - cp libpng.pc $(DL)/pkgconfig/$(LIBNAME).pc - chmod 644 $(DL)/pkgconfig/$(LIBNAME).pc - (cd $(DL)/pkgconfig; ln -sf $(LIBNAME).pc libpng.pc) - -install-man: libpng.3 libpngpf.3 png.5 - -@if [ ! -d $(DM) ]; then mkdir $(DM); fi - -@if [ ! -d $(DM)/man3 ]; then mkdir $(DM)/man3; fi - -@/bin/rm -f $(DM)/man3/libpng.3 - -@/bin/rm -f $(DM)/man3/libpngpf.3 - cp libpng.3 $(DM)/man3 - cp libpngpf.3 $(DM)/man3 - -@if [ ! -d $(DM)/man5 ]; then mkdir $(DM)/man5; fi - -@/bin/rm -f $(DM)/man5/png.5 - cp png.5 $(DM)/man5 - -install-config: libpng-config - -@if [ ! -d $(DB) ]; then mkdir $(DB); fi - -@/bin/rm -f $(DB)/libpng-config - -@/bin/rm -f $(DB)/$(LIBNAME)-config - cp libpng-config $(DB)/$(LIBNAME)-config - chmod 755 $(DB)/$(LIBNAME)-config - (cd $(DB); ln -sf $(LIBNAME)-config libpng-config) - -install: install-static install-shared install-man install-config - -# If you installed in $(DESTDIR), test-installed won't work until you -# move the library to its final location. Use test-dd to test it -# before then. - -test-dd: - echo - echo Testing installed dynamic shared library in $(DL). - $(CC) -I$(DI) -I$(ZLIBINC) \ - `$(BINPATH)/libpng12-config --cflags` pngtest.c \ - -L$(DL) -L$(ZLIBLIB) -W1,-rpath,$(DL) -Wl,-rpath,$(ZLIBLIB) \ - -o pngtestd `$(BINPATH)/libpng12-config --ldflags` - ./pngtestd pngtest.png - -test-installed: - echo - echo Testing installed dynamic shared library. - $(CC) -I$(ZLIBINC) \ - `$(BINPATH)/libpng12-config --cflags` pngtest.c \ - -L$(ZLIBLIB) -Wl,-rpath,$(ZLIBLIB) \ - -o pngtesti `$(BINPATH)/libpng12-config --ldflags` - ./pngtesti pngtest.png - -clean: - /bin/rm -f *.o libpng.a pngtest pngtesti pngout.png \ - libpng-config $(LIBNAME).sl $(LIBNAME).sl.$(PNGMAJ)* \ - libpng.sl.3.$(PNGMIN) \ - libpng.pc - -DOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO -writelock: - chmod a-w *.[ch35] $(DOCS) scripts/* - -# DO NOT DELETE THIS LINE -- make depend depends on it. - -png.o png.pic.o: png.h pngconf.h -pngerror.o pngerror.pic.o: png.h pngconf.h -pngrio.o pngrio.pic.o: png.h pngconf.h -pngwio.o pngwio.pic.o: png.h pngconf.h -pngmem.o pngmem.pic.o: png.h pngconf.h -pngset.o pngset.pic.o: png.h pngconf.h -pngget.o pngget.pic.o: png.h pngconf.h -pngread.o pngread.pic.o: png.h pngconf.h -pngrtran.o pngrtran.pic.o: png.h pngconf.h -pngrutil.o pngrutil.pic.o: png.h pngconf.h -pngtrans.o pngtrans.pic.o: png.h pngconf.h -pngwrite.o pngwrite.pic.o: png.h pngconf.h -pngwtran.o pngwtran.pic.o: png.h pngconf.h -pngwutil.o pngwutil.pic.o: png.h pngconf.h -pngpread.o pngpread.pic.o: png.h pngconf.h - -pngtest.o: png.h pngconf.h diff --git a/wxWidgets/src/png/scripts/makefile.hpux b/wxWidgets/src/png/scripts/makefile.hpux deleted file mode 100644 index 53f99b5100..0000000000 --- a/wxWidgets/src/png/scripts/makefile.hpux +++ /dev/null @@ -1,213 +0,0 @@ -# makefile for libpng, HPUX (10.20 and 11.00) using the ANSI/C product. -# Copyright (C) 1999-2002 Glenn Randers-Pehrson -# Copyright (C) 1995 Guy Eric Schalnat, Group 42 -# contributed by Jim Rice and updated by Chris Schleicher, Hewlett Packard -# For conditions of distribution and use, see copyright notice in png.h - -# Where the zlib library and include files are located -ZLIBLIB=/opt/zlib/lib -ZLIBINC=/opt/zlib/include - -# Note that if you plan to build a libpng shared library, zlib must also -# be a shared library, which zlib's configure does not do. After running -# zlib's configure, edit the appropriate lines of makefile to read: -# CFLAGS=-O1 -DHAVE_UNISTD -DUSE_MAP -fPIC \ -# LDSHARED=ld -b -# SHAREDLIB=libz.sl - -CC=cc -CFLAGS=-I$(ZLIBINC) -O -Ae +DA1.1 +DS2.0 -# Caution: be sure you have built zlib with the same CFLAGS. -CCFLAGS=-I$(ZLIBINC) -O -Ae +DA1.1 +DS2.0 -LDFLAGS=-L. -L$(ZLIBLIB) -lpng -lz -lm - -RANLIB=ranlib - -PNGMAJ = 0 -PNGMIN = 1.2.7 -PNGVER = $(PNGMAJ).$(PNGMIN) -LIBNAME = libpng12 - -# where make install puts libpng.a, libpng12.sl, and png.h -prefix=/opt/libpng -INCPATH=$(prefix)/include -LIBPATH=$(prefix)/lib -MANPATH=$(prefix)/man -BINPATH=$(prefix)/bin - -# override DESTDIR= on the make install command line to easily support -# installing into a temporary location. Example: -# -# make install DESTDIR=/tmp/build/libpng -# -# If you're going to install into a temporary location -# via DESTDIR, $(DESTDIR)$(prefix) must already exist before -# you execute make install. -DESTDIR= - -DB=$(DESTDIR)$(BINPATH) -DI=$(DESTDIR)$(INCPATH) -DL=$(DESTDIR)$(LIBPATH) -DM=$(DESTDIR)$(MANPATH) - -OBJS = png.o pngset.o pngget.o pngrutil.o pngtrans.o pngwutil.o \ - pngread.o pngrio.o pngwio.o pngwrite.o pngrtran.o \ - pngwtran.o pngmem.o pngerror.o pngpread.o - -OBJSDLL = $(OBJS:.o=.pic.o) - -.SUFFIXES: .c .o .pic.o - -.c.pic.o: - $(CC) -c $(CFLAGS) +z -o $@ $*.c - -all: libpng.a $(LIBNAME).sl pngtest libpng.pc libpng-config - -libpng.a: $(OBJS) - ar rc $@ $(OBJS) - $(RANLIB) $@ - -libpng.pc: - cat scripts/libpng.pc.in | sed -e s\!@PREFIX@!$(prefix)! > libpng.pc - -libpng-config: - ( cat scripts/libpng-config-head.in; \ - echo prefix=\"$(prefix)\"; \ - echo I_opts=\"-I$(INCPATH)/$(LIBNAME)\"; \ - echo ccopts=\"-Ae +DA1.1 +DS2.0\"; \ - echo L_opts=\"-L$(LIBPATH)\"; \ - echo libs=\"-lpng12 -lz -lm\"; \ - cat scripts/libpng-config-body.in ) > libpng-config - chmod +x libpng-config - -$(LIBNAME).sl: $(LIBNAME).sl.$(PNGMAJ) - ln -sf $(LIBNAME).sl.$(PNGMAJ) $(LIBNAME).sl - -$(LIBNAME).sl.$(PNGMAJ): $(LIBNAME).sl.$(PNGVER) - ln -sf $(LIBNAME).sl.$(PNGVER) $(LIBNAME).sl.$(PNGMAJ) - -$(LIBNAME).sl.$(PNGVER): $(OBJSDLL) - $(LD) -b +s \ - +h $(LIBNAME).sl.$(PNGMAJ) -o $(LIBNAME).sl.$(PNGVER) $(OBJSDLL) - -libpng.sl.3.$(PNGMIN): $(OBJSDLL) - $(LD) -b +s \ - +h libpng.sl.3 -o libpng.sl.3.$(PNGMIN) $(OBJSDLL) - -pngtest: pngtest.o libpng.a - $(CC) -o pngtest $(CCFLAGS) pngtest.o $(LDFLAGS) - -test: pngtest - ./pngtest - -install-headers: png.h pngconf.h - -@if [ ! -d $(DI) ]; then mkdir $(DI); fi - -@if [ ! -d $(DI)/$(LIBNAME) ]; then mkdir $(DI)/$(LIBNAME); fi - cp png.h pngconf.h $(DI)/$(LIBNAME) - chmod 644 $(DI)/$(LIBNAME)/png.h $(DI)/$(LIBNAME)/pngconf.h - -@/bin/rm -f $(DI)/png.h $(DI)/pngconf.h - -@/bin/rm -f $(DI)/libpng - (cd $(DI); ln -sf $(LIBNAME) libpng; ln -sf $(LIBNAME)/* .) - -install-static: install-headers libpng.a - -@if [ ! -d $(DL) ]; then mkdir $(DL); fi - cp libpng.a $(DL)/$(LIBNAME).a - chmod 644 $(DL)/$(LIBNAME).a - -@/bin/rm -f $(DL)/libpng.a - (cd $(DL); ln -sf $(LIBNAME).a libpng.a) - -install-shared: install-headers $(LIBNAME).sl.$(PNGVER) libpng.pc \ - libpng.sl.3.$(PNGMIN) - -@if [ ! -d $(DL) ]; then mkdir $(DL); fi - -@/bin/rm -f $(DL)/$(LIBNAME).sl.$(PNGVER)* $(DL)/$(LIBNAME).sl - -@/bin/rm -f $(DL)/$(LIBNAME).sl.$(PNGMAJ) - -@/bin/rm -f $(DL)/libpng.sl - -@/bin/rm -f $(DL)/libpng.sl.3 - -@/bin/rm -f $(DL)/libpng.sl.3.$(PNGMIN)* - cp $(LIBNAME).sl.$(PNGVER) $(DL) - cp libpng.sl.3.$(PNGMIN) $(DL) - chmod 755 $(DL)/$(LIBNAME).sl.$(PNGVER) - chmod 755 $(DL)/libpng.sl.3.$(PNGMIN) - (cd $(DL); \ - ln -sf libpng.sl.3.$(PNGMIN) libpng.sl.3; \ - ln -sf libpng.sl.3 libpng.sl; \ - ln -sf $(LIBNAME).sl.$(PNGVER) $(LIBNAME).sl.$(PNGMAJ); \ - ln -sf $(LIBNAME).sl.$(PNGMAJ) $(LIBNAME).sl) - -@if [ ! -d $(DL)/pkgconfig ]; then mkdir $(DL)/pkgconfig; fi - -@/bin/rm -f $(DL)/pkgconfig/$(LIBNAME).pc - -@/bin/rm -f $(DL)/pkgconfig/libpng.pc - cp libpng.pc $(DL)/pkgconfig/$(LIBNAME).pc - chmod 644 $(DL)/pkgconfig/$(LIBNAME).pc - (cd $(DL)/pkgconfig; ln -sf $(LIBNAME).pc libpng.pc) - -install-man: libpng.3 libpngpf.3 png.5 - -@if [ ! -d $(DM) ]; then mkdir $(DM); fi - -@if [ ! -d $(DM)/man3 ]; then mkdir $(DM)/man3; fi - -@/bin/rm -f $(DM)/man3/libpng.3 - -@/bin/rm -f $(DM)/man3/libpngpf.3 - cp libpng.3 $(DM)/man3 - cp libpngpf.3 $(DM)/man3 - -@if [ ! -d $(DM)/man5 ]; then mkdir $(DM)/man5; fi - -@/bin/rm -f $(DM)/man5/png.5 - cp png.5 $(DM)/man5 - -install-config: libpng-config - -@if [ ! -d $(DB) ]; then mkdir $(DB); fi - -@/bin/rm -f $(DB)/libpng-config - -@/bin/rm -f $(DB)/$(LIBNAME)-config - cp libpng-config $(DB)/$(LIBNAME)-config - chmod 755 $(DB)/$(LIBNAME)-config - (cd $(DB); ln -sf $(LIBNAME)-config libpng-config) - -install: install-static install-shared install-man install-config - -# If you installed in $(DESTDIR), test-installed won't work until you -# move the library to its final location. Use test-dd to test it -# before then. - -test-dd: - echo - echo Testing installed dynamic shared library in $(DL). - $(CC) -I$(DI) -I$(ZLIBINC) $(CCFLAGS) \ - `$(BINPATH)/libpng12-config --cflags` pngtest.c \ - -L$(DL) -L$(ZLIBLIB) \ - -o pngtestd `$(BINPATH)/libpng12-config --ldflags` - ./pngtestd pngtest.png - -test-installed: - echo - echo Testing installed dynamic shared library. - $(CC) $(CCFLAGS) \ - `$(BINPATH)/libpng12-config --cflags` pngtest.c \ - -L$(ZLIBLIB) \ - -o pngtesti `$(BINPATH)/libpng12-config --ldflags` - ./pngtesti pngtest.png - -clean: - /bin/rm -f *.o libpng.a pngtest pngtesti pngout.png \ - libpng-config $(LIBNAME).sl $(LIBNAME).sl.$(PNGMAJ)* \ - libpng.sl.3.$(PNGMIN) \ - libpng.pc - -DOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO -writelock: - chmod a-w *.[ch35] $(DOCS) scripts/* - -# DO NOT DELETE THIS LINE -- make depend depends on it. - -png.o: png.h pngconf.h -pngerror.o: png.h pngconf.h -pngrio.o: png.h pngconf.h -pngwio.o: png.h pngconf.h -pngmem.o: png.h pngconf.h -pngset.o: png.h pngconf.h -pngget.o: png.h pngconf.h -pngread.o: png.h pngconf.h -pngrtran.o: png.h pngconf.h -pngrutil.o: png.h pngconf.h -pngtest.o: png.h pngconf.h -pngtrans.o: png.h pngconf.h -pngwrite.o: png.h pngconf.h -pngwtran.o: png.h pngconf.h -pngwutil.o: png.h pngconf.h -pngpread.o: png.h pngconf.h diff --git a/wxWidgets/src/png/scripts/makefile.ibmc b/wxWidgets/src/png/scripts/makefile.ibmc deleted file mode 100644 index f09a62c9e3..0000000000 --- a/wxWidgets/src/png/scripts/makefile.ibmc +++ /dev/null @@ -1,71 +0,0 @@ -# Makefile for libpng (static) -# IBM C version 3.x for Win32 and OS/2 -# Copyright (C) 2000 Cosmin Truta -# For conditions of distribution and use, see copyright notice in png.h -# Notes: -# Derived from makefile.std -# All modules are compiled in C mode -# Tested under Win32, expected to work under OS/2 -# Can be easily adapted for IBM VisualAge/C++ for AIX - -# Location of the zlib library and include files -ZLIBINC = ../zlib -ZLIBLIB = ../zlib - -# Compiler, linker, lib and other tools -CC = icc -LD = ilink -AR = ilib -RM = del - -CFLAGS = -I$(ZLIBINC) -Mc -O2 -W3 -LDFLAGS = - -# File extensions -O=.obj -A=.lib -E=.exe - -# Variables -OBJS = png$(O) pngerror$(O) pngget$(O) pngmem$(O) pngpread$(O) \ - pngread$(O) pngrio$(O) pngrtran$(O) pngrutil$(O) pngset$(O) \ - pngtrans$(O) pngwio$(O) pngwrite$(O) pngwtran$(O) pngwutil$(O) - -LIBS = libpng$(A) $(ZLIBLIB)/zlib$(A) - -# Targets -all: libpng$(A) pngtest$(E) - -libpng$(A): $(OBJS) - $(AR) -out:$@ $(OBJS) - -test: pngtest$(E) - pngtest$(E) - -pngtest: pngtest$(E) - -pngtest$(E): pngtest$(O) libpng$(A) - $(LD) $(LDFLAGS) pngtest$(O) $(LIBS) - -clean: - $(RM) *$(O) - $(RM) libpng$(A) - $(RM) pngtest$(E) - $(RM) pngout.png - -png$(O): png.h pngconf.h -pngerror$(O): png.h pngconf.h -pngget$(O): png.h pngconf.h -pngmem$(O): png.h pngconf.h -pngpread$(O): png.h pngconf.h -pngread$(O): png.h pngconf.h -pngrio$(O): png.h pngconf.h -pngrtran$(O): png.h pngconf.h -pngrutil$(O): png.h pngconf.h -pngset$(O): png.h pngconf.h -pngtest$(O): png.h pngconf.h -pngtrans$(O): png.h pngconf.h -pngwio$(O): png.h pngconf.h -pngwrite$(O): png.h pngconf.h -pngwtran$(O): png.h pngconf.h -pngwutil$(O): png.h pngconf.h diff --git a/wxWidgets/src/png/scripts/makefile.intel b/wxWidgets/src/png/scripts/makefile.intel deleted file mode 100644 index 1cabe779b2..0000000000 --- a/wxWidgets/src/png/scripts/makefile.intel +++ /dev/null @@ -1,114 +0,0 @@ -# Makefile for libpng -# Microsoft Visual C++ with Intel C/C++ Compiler 4.0 and later - -# Copyright (C) 2000, Pawel Mrochen, based on makefile.msc which is -# copyright 1995 Guy Eric Schalnat, Group 42, Inc. -# For conditions of distribution and use, see copyright notice in png.h - -# To use, do "nmake /f scripts\makefile.intel" - - -# ------------------- Intel C/C++ Compiler 4.0 and later ------------------- - -# Caution: the assembler code was introduced at libpng version 1.0.4 and has -# not yet been thoroughly tested. - -# Use assembler code -ASMCODE=-DPNG_USE_PNGVCRD - -# Where the zlib library and include files are located -ZLIBLIB=..\zlib -ZLIBINC=..\zlib - -# Target CPU -CPU=6 # Pentium II -#CPU=5 # Pentium - -# Calling convention -CALLING=r # __fastcall -#CALLING=z # __stdcall -#CALLING=d # __cdecl - -# Uncomment next to put error messages in a file -#ERRFILE=>>pngerrs - -# -------------------------------------------------------------------------- - - -CC=icl -c -CFLAGS=-O2 -G$(CPU)$(CALLING) -Qip -Qunroll4 -I$(ZLIBINC) $(ASMCODE) -nologo -LD=link -LDFLAGS=/SUBSYSTEM:CONSOLE /NOLOGO - -O=.obj - -OBJS=png$(O) pngset$(O) pngget$(O) pngrutil$(O) pngtrans$(O) pngwutil$(O) \ -pngmem$(O) pngpread$(O) pngread$(O) pngerror$(O) pngwrite$(O) \ -pngrtran$(O) pngwtran$(O) pngrio$(O) pngwio$(O) pngvcrd$(O) - - -all: test - -png$(O): png.h pngconf.h - $(CC) $(CFLAGS) $*.c $(ERRFILE) - -pngset$(O): png.h pngconf.h - $(CC) $(CFLAGS) $*.c $(ERRFILE) - -pngget$(O): png.h pngconf.h - $(CC) $(CFLAGS) $*.c $(ERRFILE) - -pngread$(O): png.h pngconf.h - $(CC) $(CFLAGS) $*.c $(ERRFILE) - -pngpread$(O): png.h pngconf.h - $(CC) $(CFLAGS) $*.c $(ERRFILE) - -pngrtran$(O): png.h pngconf.h - $(CC) $(CFLAGS) $*.c $(ERRFILE) - -pngrutil$(O): png.h pngconf.h - $(CC) $(CFLAGS) $*.c $(ERRFILE) - -pngvcrd$(O): png.h pngconf.h - $(CC) $(CFLAGS) $*.c $(ERRFILE) - -pngerror$(O): png.h pngconf.h - $(CC) $(CFLAGS) $*.c $(ERRFILE) - -pngmem$(O): png.h pngconf.h - $(CC) $(CFLAGS) $*.c $(ERRFILE) - -pngrio$(O): png.h pngconf.h - $(CC) $(CFLAGS) $*.c $(ERRFILE) - -pngwio$(O): png.h pngconf.h - $(CC) $(CFLAGS) $*.c $(ERRFILE) - -pngtest$(O): png.h pngconf.h - $(CC) $(CFLAGS) $*.c $(ERRFILE) - -pngtrans$(O): png.h pngconf.h - $(CC) $(CFLAGS) $*.c $(ERRFILE) - -pngwrite$(O): png.h pngconf.h - $(CC) $(CFLAGS) $*.c $(ERRFILE) - -pngwtran$(O): png.h pngconf.h - $(CC) $(CFLAGS) $*.c $(ERRFILE) - -pngwutil$(O): png.h pngconf.h - $(CC) $(CFLAGS) $*.c $(ERRFILE) - -libpng.lib: $(OBJS) - if exist libpng.lib del libpng.lib - lib /NOLOGO /OUT:libpng.lib $(OBJS) - -pngtest.exe: pngtest.obj libpng.lib - $(LD) $(LDFLAGS) /OUT:pngtest.exe pngtest.obj libpng.lib $(ZLIBLIB)\zlib.lib - -test: pngtest.exe - pngtest.exe - - -# End of makefile for libpng diff --git a/wxWidgets/src/png/scripts/makefile.knr b/wxWidgets/src/png/scripts/makefile.knr deleted file mode 100644 index 44ee538a33..0000000000 --- a/wxWidgets/src/png/scripts/makefile.knr +++ /dev/null @@ -1,99 +0,0 @@ -# makefile for libpng -# Copyright (C) 2002 Glenn Randers-Pehrson -# Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc. -# For conditions of distribution and use, see copyright notice in png.h - -# This makefile requires the file ansi2knr.c, which you can get -# from the Ghostscript ftp site at ftp://ftp.cs.wisc.edu/ghost/ -# If you have libjpeg, you probably already have ansi2knr.c in the jpeg -# source distribution. - -# where make install puts libpng.a and png.h -prefix=/usr/local -INCPATH=$(prefix)/include -LIBPATH=$(prefix)/lib - -# override DESTDIR= on the make install command line to easily support -# installing into a temporary location. Example: -# -# make install DESTDIR=/tmp/build/libpng -# -# If you're going to install into a temporary location -# via DESTDIR, $(DESTDIR)$(prefix) must already exist before -# you execute make install. -DESTDIR= - -CC=cc -CFLAGS=-I../zlib -O -LDFLAGS=-L. -L../zlib/ -lpng -lz -lm -# flags for ansi2knr -ANSI2KNRFLAGS= - -RANLIB=ranlib -#RANLIB=echo - -OBJS = png.o pngset.o pngget.o pngrutil.o pngtrans.o pngwutil.o \ - pngread.o pngrio.o pngwio.o pngwrite.o pngrtran.o \ - pngwtran.o pngmem.o pngerror.o pngpread.o - -all: ansi2knr libpng.a pngtest - -# general rule to allow ansi2knr to work -.c.o: - ./ansi2knr $*.c T$*.c - $(CC) $(CFLAGS) -c T$*.c - rm -f T$*.c $*.o - mv T$*.o $*.o - -ansi2knr: ansi2knr.c - $(CC) $(CFLAGS) $(ANSI2KNRFLAGS) -o ansi2knr ansi2knr.c - -libpng.a: ansi2knr $(OBJS) - ar rc $@ $(OBJS) - $(RANLIB) $@ - -pngtest: pngtest.o libpng.a - $(CC) -o pngtest $(CFLAGS) pngtest.o $(LDFLAGS) - -test: pngtest - ./pngtest - -install: libpng.a - -@mkdir $(DESTDIR)$(INCPATH) - -@mkdir $(DESTDIR)$(INCPATH)/libpng - -@mkdir $(DESTDIR)$(LIBPATH) - -@rm -f $(DESTDIR)$(INCPATH)/png.h - -@rm -f $(DESTDIR)$(INCPATH)/pngconf.h - cp png.h $(DESTDIR)$(INCPATH)/libpng - cp pngconf.h $(DESTDIR)$(INCPATH)/libpng - chmod 644 $(DESTDIR)$(INCPATH)/libpng/png.h - chmod 644 $(DESTDIR)$(INCPATH)/libpng/pngconf.h - (cd $(DESTDIR)$(INCPATH); ln -f -s libpng/* .) - cp libpng.a $(DESTDIR)$(LIBPATH) - chmod 644 $(DESTDIR)$(LIBPATH)/libpng.a - -clean: - rm -f *.o libpng.a pngtest pngout.png ansi2knr - -DOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO -writelock: - chmod a-w *.[ch35] $(DOCS) scripts/* - -# DO NOT DELETE THIS LINE -- make depend depends on it. - -png.o: png.h pngconf.h -pngerror.o: png.h pngconf.h -pngrio.o: png.h pngconf.h -pngwio.o: png.h pngconf.h -pngmem.o: png.h pngconf.h -pngset.o: png.h pngconf.h -pngget.o: png.h pngconf.h -pngread.o: png.h pngconf.h -pngpread.o: png.h pngconf.h -pngrtran.o: png.h pngconf.h -pngrutil.o: png.h pngconf.h -pngtest.o: png.h pngconf.h -pngtrans.o: png.h pngconf.h -pngwrite.o: png.h pngconf.h -pngwtran.o: png.h pngconf.h -pngwutil.o: png.h pngconf.h diff --git a/wxWidgets/src/png/scripts/makefile.linux b/wxWidgets/src/png/scripts/makefile.linux deleted file mode 100644 index 67edfd977a..0000000000 --- a/wxWidgets/src/png/scripts/makefile.linux +++ /dev/null @@ -1,234 +0,0 @@ -# makefile for libpng.a and libpng12.so on Linux ELF with gcc -# Copyright (C) 1998, 1999, 2002 Greg Roelofs and Glenn Randers-Pehrson -# Copyright (C) 1996, 1997 Andreas Dilger -# For conditions of distribution and use, see copyright notice in png.h - -LIBNAME = libpng12 -PNGMAJ = 0 -PNGMIN = 1.2.7 -PNGVER = $(PNGMAJ).$(PNGMIN) - -CC=gcc - -# where "make install" puts libpng12.a, libpng12.so*, -# libpng12/png.h and libpng12/pngconf.h -# Prefix must be a full pathname. -prefix=/usr/local - -# Where the zlib library and include files are located. -#ZLIBLIB=/usr/local/lib -#ZLIBINC=/usr/local/include -ZLIBLIB=../zlib -ZLIBINC=../zlib - -ALIGN= -# for i386: -#ALIGN=-malign-loops=2 -malign-functions=2 - -WARNMORE=-Wwrite-strings -Wpointer-arith -Wshadow \ - -Wmissing-declarations -Wtraditional -Wcast-align \ - -Wstrict-prototypes -Wmissing-prototypes #-Wconversion - -# for pgcc version 2.95.1, -O3 is buggy; don't use it. - -CFLAGS=-I$(ZLIBINC) -Wall -O3 -funroll-loops \ - $(ALIGN) # $(WARNMORE) -g -DPNG_DEBUG=5 - -LDFLAGS=-L. -Wl,-rpath,. -L$(ZLIBLIB) -Wl,-rpath,$(ZLIBLIB) -lpng12 -lz -lm -LDFLAGS_A=-L$(ZLIBLIB) -Wl,-rpath,$(ZLIBLIB) libpng.a -lz -lm - -RANLIB=ranlib -#RANLIB=echo - -INCPATH=$(prefix)/include -LIBPATH=$(prefix)/lib -MANPATH=$(prefix)/man -BINPATH=$(prefix)/bin - -# override DESTDIR= on the make install command line to easily support -# installing into a temporary location. Example: -# -# make install DESTDIR=/tmp/build/libpng -# -# If you're going to install into a temporary location -# via DESTDIR, $(DESTDIR)$(prefix) must already exist before -# you execute make install. -DESTDIR= - -DB=$(DESTDIR)$(BINPATH) -DI=$(DESTDIR)$(INCPATH) -DL=$(DESTDIR)$(LIBPATH) -DM=$(DESTDIR)$(MANPATH) - -OBJS = png.o pngset.o pngget.o pngrutil.o pngtrans.o pngwutil.o \ - pngread.o pngrio.o pngwio.o pngwrite.o pngrtran.o \ - pngwtran.o pngmem.o pngerror.o pngpread.o - -OBJSDLL = $(OBJS:.o=.pic.o) - -.SUFFIXES: .c .o .pic.o - -.c.pic.o: - $(CC) -c $(CFLAGS) -fPIC -o $@ $*.c - -all: libpng.a $(LIBNAME).so pngtest pngtest-static libpng.pc libpng-config - -libpng.a: $(OBJS) - ar rc $@ $(OBJS) - $(RANLIB) $@ - -libpng.pc: - cat scripts/libpng.pc.in | sed -e s\!@PREFIX@!$(prefix)! > libpng.pc - -libpng-config: - ( cat scripts/libpng-config-head.in; \ - echo prefix=\"$(prefix)\"; \ - echo I_opts=\"-I$(INCPATH)/$(LIBNAME)\"; \ - echo L_opts=\"-L$(LIBPATH)\"; \ - echo R_opts=\"-Wl,-rpath,$(LIBPATH)\"; \ - echo libs=\"-lpng12 -lz -lm\"; \ - cat scripts/libpng-config-body.in ) > libpng-config - chmod +x libpng-config - -$(LIBNAME).so: $(LIBNAME).so.$(PNGMAJ) - ln -sf $(LIBNAME).so.$(PNGMAJ) $(LIBNAME).so - -$(LIBNAME).so.$(PNGMAJ): $(LIBNAME).so.$(PNGVER) - ln -sf $(LIBNAME).so.$(PNGVER) $(LIBNAME).so.$(PNGMAJ) - -$(LIBNAME).so.$(PNGVER): $(OBJSDLL) - $(CC) -shared -Wl,-soname,$(LIBNAME).so.$(PNGMAJ) \ - -o $(LIBNAME).so.$(PNGVER) \ - $(OBJSDLL) - -libpng.so.3.$(PNGMIN): $(OBJSDLL) - $(CC) -shared -Wl,-soname,libpng.so.3 \ - -o libpng.so.3.$(PNGMIN) \ - $(OBJSDLL) - -pngtest: pngtest.o $(LIBNAME).so - $(CC) -o pngtest $(CFLAGS) pngtest.o $(LDFLAGS) - -pngtest-static: pngtest.o libpng.a - $(CC) -o pngtest-static $(CFLAGS) pngtest.o $(LDFLAGS_A) - -test: pngtest pngtest-static - @echo "" - @echo " Running pngtest dynamically linked with $(LIBNAME).so:" - @echo "" - ./pngtest - @echo "" - @echo " Running pngtest statically linked with libpng.a:" - @echo "" - ./pngtest-static - -install-headers: png.h pngconf.h - -@if [ ! -d $(DI) ]; then mkdir $(DI); fi - -@if [ ! -d $(DI)/$(LIBNAME) ]; then mkdir $(DI)/$(LIBNAME); fi - cp png.h pngconf.h $(DI)/$(LIBNAME) - chmod 644 $(DI)/$(LIBNAME)/png.h $(DI)/$(LIBNAME)/pngconf.h - -@/bin/rm -f $(DI)/png.h $(DI)/pngconf.h - -@/bin/rm -f $(DI)/libpng - (cd $(DI); ln -sf $(LIBNAME) libpng; ln -sf $(LIBNAME)/* .) - -install-static: install-headers libpng.a - -@if [ ! -d $(DL) ]; then mkdir $(DL); fi - cp libpng.a $(DL)/$(LIBNAME).a - chmod 644 $(DL)/$(LIBNAME).a - -@/bin/rm -f $(DL)/libpng.a - (cd $(DL); ln -sf $(LIBNAME).a libpng.a) - -install-shared: install-headers $(LIBNAME).so.$(PNGVER) libpng.pc \ - libpng.so.3.$(PNGMIN) - -@if [ ! -d $(DL) ]; then mkdir $(DL); fi - -@/bin/rm -f $(DL)/$(LIBNAME).so.$(PNGVER)* $(DL)/$(LIBNAME).so - -@/bin/rm -f $(DL)/$(LIBNAME).so.$(PNGMAJ) - -@/bin/rm -f $(DL)/libpng.so - -@/bin/rm -f $(DL)/libpng.so.3 - -@/bin/rm -f $(DL)/libpng.so.3.$(PNGMIN)* - cp $(LIBNAME).so.$(PNGVER) $(DL) - cp libpng.so.3.$(PNGMIN) $(DL) - chmod 755 $(DL)/$(LIBNAME).so.$(PNGVER) - chmod 755 $(DL)/libpng.so.3.$(PNGMIN) - (cd $(DL); \ - ln -sf libpng.so.3.$(PNGMIN) libpng.so.3; \ - ln -sf libpng.so.3 libpng.so; \ - ln -sf $(LIBNAME).so.$(PNGVER) $(LIBNAME).so.$(PNGMAJ); \ - ln -sf $(LIBNAME).so.$(PNGMAJ) $(LIBNAME).so) - -@if [ ! -d $(DL)/pkgconfig ]; then mkdir $(DL)/pkgconfig; fi - -@/bin/rm -f $(DL)/pkgconfig/$(LIBNAME).pc - -@/bin/rm -f $(DL)/pkgconfig/libpng.pc - cp libpng.pc $(DL)/pkgconfig/$(LIBNAME).pc - chmod 644 $(DL)/pkgconfig/$(LIBNAME).pc - (cd $(DL)/pkgconfig; ln -sf $(LIBNAME).pc libpng.pc) - -install-man: libpng.3 libpngpf.3 png.5 - -@if [ ! -d $(DM) ]; then mkdir $(DM); fi - -@if [ ! -d $(DM)/man3 ]; then mkdir $(DM)/man3; fi - -@/bin/rm -f $(DM)/man3/libpng.3 - -@/bin/rm -f $(DM)/man3/libpngpf.3 - cp libpng.3 $(DM)/man3 - cp libpngpf.3 $(DM)/man3 - -@if [ ! -d $(DM)/man5 ]; then mkdir $(DM)/man5; fi - -@/bin/rm -f $(DM)/man5/png.5 - cp png.5 $(DM)/man5 - -install-config: libpng-config - -@if [ ! -d $(DB) ]; then mkdir $(DB); fi - -@/bin/rm -f $(DB)/libpng-config - -@/bin/rm -f $(DB)/$(LIBNAME)-config - cp libpng-config $(DB)/$(LIBNAME)-config - chmod 755 $(DB)/$(LIBNAME)-config - (cd $(DB); ln -sf $(LIBNAME)-config libpng-config) - -install: install-static install-shared install-man install-config - -# If you installed in $(DESTDIR), test-installed won't work until you -# move the library to its final location. Use test-dd to test it -# before then. - -test-dd: - echo - echo Testing installed dynamic shared library in $(DL). - $(CC) -I$(DI) -I$(ZLIBINC) \ - `$(BINPATH)/libpng12-config --cflags` pngtest.c \ - -L$(DL) -L$(ZLIBLIB) -W1, -rpath,$(DL) -Wl,-rpath,$(ZLIBLIB) \ - -o pngtestd `$(BINPATH)/libpng12-config --ldflags` - ./pngtestd pngtest.png - -test-installed: - $(CC) -I$(ZLIBINC) \ - `$(BINPATH)/libpng12-config --cflags` pngtest.c \ - -L$(ZLIBLIB) -Wl,-rpath,$(ZLIBLIB) \ - -o pngtesti `$(BINPATH)/libpng12-config --ldflags` - ./pngtesti pngtest.png - -clean: - /bin/rm -f *.o libpng.a pngtest pngout.png libpng-config \ - $(LIBNAME).so $(LIBNAME).so.$(PNGMAJ)* pngtest-static pngtesti \ - libpng.so.3.$(PNGMIN) \ - libpng.pc - -DOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO -writelock: - chmod a-w *.[ch35] $(DOCS) scripts/* - -# DO NOT DELETE THIS LINE -- make depend depends on it. - -png.o png.pic.o: png.h pngconf.h -pngerror.o pngerror.pic.o: png.h pngconf.h -pngrio.o pngrio.pic.o: png.h pngconf.h -pngwio.o pngwio.pic.o: png.h pngconf.h -pngmem.o pngmem.pic.o: png.h pngconf.h -pngset.o pngset.pic.o: png.h pngconf.h -pngget.o pngget.pic.o: png.h pngconf.h -pngread.o pngread.pic.o: png.h pngconf.h -pngrtran.o pngrtran.pic.o: png.h pngconf.h -pngrutil.o pngrutil.pic.o: png.h pngconf.h -pngtrans.o pngtrans.pic.o: png.h pngconf.h -pngwrite.o pngwrite.pic.o: png.h pngconf.h -pngwtran.o pngwtran.pic.o: png.h pngconf.h -pngwutil.o pngwutil.pic.o: png.h pngconf.h -pngpread.o pngpread.pic.o: png.h pngconf.h - -pngtest.o: png.h pngconf.h diff --git a/wxWidgets/src/png/scripts/makefile.macosx b/wxWidgets/src/png/scripts/makefile.macosx deleted file mode 100644 index a9e8c0479c..0000000000 --- a/wxWidgets/src/png/scripts/makefile.macosx +++ /dev/null @@ -1,190 +0,0 @@ -# makefile for libpng, MACOS X -# Copyright (C) 2002 Glenn Randers-Pehrson -# Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc. -# Modified by Karin Kosina 20011010: -# build shared library (*.dylib) -# For conditions of distribution and use, see copyright notice in png.h - -# where make install puts libpng.a and png.h -prefix=/usr/local - -# Where the zlib library and include files are located -#ZLIBLIB=/usr/local/lib -#ZLIBINC=/usr/local/include -ZLIBLIB=../zlib -ZLIBINC=../zlib - -CC=cc - -PNGMAJ = 0 -PNGMIN = 1.2.4 -PNGVER = $(PNGMAJ).$(PNGMIN) - -CFLAGS=-fno-common -I$(ZLIBINC) -O # -g -DPNG_DEBUG=5 -LDFLAGS=-L. -L$(ZLIBLIB) -lpng -lz -LDSHARED=cc -lz -dynamiclib -compatibility_version $(PNGVER) \ --current_version $(PNGVER) - -LIBNAME=libpng12 -SHAREDLIB_POSTFIX=dylib -INCPATH=$(prefix)/include -LIBPATH=$(prefix)/lib -MANPATH=$(prefix)/man -BINPATH=$(prefix)/bin - -# override DESTDIR= on the make install command line to easily support -# installing into a temporary location. Example: -# -# make install DESTDIR=/tmp/build/libpng -# -# If you're going to install into a temporary location -# via DESTDIR, $(DESTDIR)$(prefix) must already exist before -# you execute make install. -DESTDIR= - -DB=$(DESTDIR)$(BINPATH) -DI=$(DESTDIR)$(INCPATH) -DL=$(DESTDIR)$(LIBPATH) -DM=$(DESTDIR)$(MANPATH) - -#RANLIB=echo -RANLIB=ranlib - -OBJS = png.o pngset.o pngget.o pngrutil.o pngtrans.o pngwutil.o \ - pngread.o pngrio.o pngwio.o pngwrite.o pngrtran.o \ - pngwtran.o pngmem.o pngerror.o pngpread.o - -all: libpng.a pngtest shared libpng.pc libpng-config - -shared: $(LIBNAME).$(PNGVER).$(SHAREDLIB_POSTFIX) - -libpng.pc: - cat scripts/libpng.pc.in | sed -e s\!@PREFIX@!$(prefix)! | \ - sed -e s/-lm// > libpng.pc - -libpng-config: - ( cat scripts/libpng-config-head.in; \ - echo prefix=\"$(prefix)\"; \ - echo cppflags=\"-I$(INCPATH)/$(LIBNAME)\"; \ - echo cflags=\"\"; \ - echo ldflags=\"-L$(LIBPATH)\"; \ - echo libs=\"-lpng12 -lz\"; \ - cat scripts/libpng-config-body.in ) > libpng-config - chmod +x libpng-config - -libpng.a: $(OBJS) - ar rc $@ $(OBJS) - $(RANLIB) $@ - -$(LIBNAME).$(PNGVER).$(SHAREDLIB_POSTFIX): $(OBJS) - $(LDSHARED) -o $@ $(OBJS) - -pngtest: pngtest.o libpng.a - $(CC) -o pngtest $(CFLAGS) pngtest.o $(LDFLAGS) - -test: pngtest - ./pngtest - -install-headers: png.h pngconf.h - -@if [ ! -d $(DI) ]; then mkdir $(DI); fi - -@if [ ! -d $(DI)/$(LIBNAME) ]; then mkdir $(DI)/$(LIBNAME); fi - cp png.h pngconf.h $(DI)/$(LIBNAME) - chmod 644 $(DI)/$(LIBNAME)/png.h $(DI)/$(LIBNAME)/pngconf.h - -@/bin/rm -f $(DI)/png.h $(DI)/pngconf.h - -@/bin/rm -f $(DI)/libpng - (cd $(DI); ln -f -s $(LIBNAME) libpng; ln -f -s $(LIBNAME)/* .) - -install-static: install-headers libpng.a - -@if [ ! -d $(DL) ]; then mkdir $(DL); fi - cp libpng.a $(DL)/$(LIBNAME).a - chmod 644 $(DL)/$(LIBNAME).a - -@/bin/rm -f $(DL)/libpng.a - (cd $(DL); ln -f -s $(LIBNAME).a libpng.a) - -install-shared: install-headers $(LIBNAME).$(PNGVER).$(SHAREDLIB_POSTFIX) libpng.pc - -@if [ ! -d $(DL) ]; then mkdir $(DL); fi - -@/bin/rm -f \ - $(DL)/$(LIBNAME).$(PNGMAJ)*.$(SHAREDLIB_POSTFIX) - -@/bin/rm -f $(DL)/$(LIBNAME).$(SHAREDLIB_POSTFIX) - -@/bin/rm -f libpng.$(SHARED_POSTFIX) - -@/bin/rm -f libpng.3.$(SHARED_POSTFIX) - -@/bin/rm -f libpng.3.*.$(SHARED_POSTFIX) - cp $(LIBNAME).$(PNGVER).$(SHAREDLIB_POSTFIX) $(DL) - chmod 755 $(DL)/$(LIBNAME).$(PNGVER).$(SHAREDLIB_POSTFIX) - (cd $(DL); \ - ln -f -s $(LIBNAME).$(PNGVER).$(SHARED_POSTFIX) \ - libpng.$(SHARED_POSTFIX); \ - ln -f -s $(LIBNAME).$(PNGVER).$(SHARED_POSTFIX) \ - libpng.3.$(SHARED_POSTFIX); \ - ln -f -s $(LIBNAME).$(PNGVER).$(SHARED_POSTFIX) \ - libpng.3.$(PNGMIN).$(SHARED_POSTFIX); \ - ln -f -s $(LIBNAME).$(PNGVER).$(SHAREDLIB_POSTFIX) \ - $(LIBNAME).$(PNGMAJ).$(SHAREDLIB_POSTFIX); \ - ln -f -s $(LIBNAME).$(PNGMAJ).$(SHAREDLIB_POSTFIX) \ - $(LIBNAME).$(SHAREDLIB_POSTFIX)) - -@if [ ! -d $(DL)/pkgconfig ]; then mkdir $(DL)/pkgconfig; fi - -@/bin/rm -f $(DL)/pkgconfig/$(LIBNAME).pc - -@/bin/rm -f $(DL)/pkgconfig/libpng.pc - cp libpng.pc $(DL)/pkgconfig/$(LIBNAME).pc - chmod 644 $(DL)/pkgconfig/$(LIBNAME).pc - (cd $(DL)/pkgconfig; ln -f -s $(LIBNAME).pc libpng.pc) - -install-man: libpng.3 libpngpf.3 png.5 - -@if [ ! -d $(DM) ]; then mkdir $(DM); fi - -@if [ ! -d $(DM)/man3 ]; then mkdir $(DM)/man3; fi - -@/bin/rm -f $(DM)/man3/libpng.3 - -@/bin/rm -f $(DM)/man3/libpngpf.3 - cp libpng.3 $(DM)/man3 - cp libpngpf.3 $(DM)/man3 - -@if [ ! -d $(DM)/man5 ]; then mkdir $(DM)/man5; fi - -@/bin/rm -f $(DM)/man5/png.5 - cp png.5 $(DM)/man5 - -install-config: libpng-config - -@if [ ! -d $(DB) ]; then mkdir $(DB); fi - -@/bin/rm -f $(DB)/libpng-config - -@/bin/rm -f $(DB)/$(LIBNAME)-config - cp libpng-config $(DB)/$(LIBNAME)-config - chmod 755 $(DB)/$(LIBNAME)-config - (cd $(DB); ln -sf $(LIBNAME)-config libpng-config) - -install: install-static install-shared install-man install-config - -# If you installed in $(DESTDIR), test-installed won't work until you -# move the library to its final location. - -test-installed: - $(CC) $(CFLAGS) \ - `$(BINPATH)/libpng12-config --cppflags --cflags` pngtest.c \ - -L$(ZLIBLIB) \ - -o pngtesti `$(BINPATH)/libpng12-config --ldflags --libs` - ./pngtesti pngtest.png - -clean: - rm -f *.o libpng.a pngtest pngout.png libpng.pc libpng-config \ - $(LIBNAME).$(PNGVER).$(SHAREDLIB_POSTFIX) \ - $(LIBNAME).$(SHAREDLIB_POSTFIX) - -DOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO -writelock: - chmod a-w *.[ch35] $(DOCS) scripts/* - -# DO NOT DELETE THIS LINE -- make depend depends on it. - -png.o: png.h pngconf.h -pngerror.o: png.h pngconf.h -pngrio.o: png.h pngconf.h -pngwio.o: png.h pngconf.h -pngmem.o: png.h pngconf.h -pngset.o: png.h pngconf.h -pngget.o: png.h pngconf.h -pngread.o: png.h pngconf.h -pngrtran.o: png.h pngconf.h -pngrutil.o: png.h pngconf.h -pngtest.o: png.h pngconf.h -pngtrans.o: png.h pngconf.h -pngwrite.o: png.h pngconf.h -pngwtran.o: png.h pngconf.h -pngwutil.o: png.h pngconf.h -pngpread.o: png.h pngconf.h - diff --git a/wxWidgets/src/png/scripts/makefile.mips b/wxWidgets/src/png/scripts/makefile.mips deleted file mode 100644 index f1a557df7f..0000000000 --- a/wxWidgets/src/png/scripts/makefile.mips +++ /dev/null @@ -1,83 +0,0 @@ -# makefile for libpng -# Copyright (C) Glenn Randers-Pehrson -# Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc. -# For conditions of distribution and use, see copyright notice in png.h - -# where make install puts libpng.a and png.h -prefix=/usr/local -INCPATH=$(prefix)/include -LIBPATH=$(prefix)/lib - -# override DESTDIR= on the make install command line to easily support -# installing into a temporary location. Example: -# -# make install DESTDIR=/tmp/build/libpng -# -# If you're going to install into a temporary location -# via DESTDIR, $(DESTDIR)$(prefix) must already exist before -# you execute make install. -DESTDIR= - -CC=cc -CFLAGS=-I../zlib -O -systype sysv -DSYSV -w -Dmips -#CFLAGS=-O -LDFLAGS=-L. -L../zlib/ -lpng -lz -lm - -#RANLIB=ranlib -RANLIB=echo - -OBJS = png.o pngset.o pngget.o pngrutil.o pngtrans.o pngwutil.o \ - pngread.o pngrio.o pngwio.o pngwrite.o pngrtran.o \ - pngwtran.o pngmem.o pngerror.o pngpread.o - -all: libpng.a pngtest - -libpng.a: $(OBJS) - ar rc $@ $(OBJS) - $(RANLIB) $@ - -pngtest: pngtest.o libpng.a - $(CC) -o pngtest $(CFLAGS) pngtest.o $(LDFLAGS) - -test: pngtest - ./pngtest - -install: libpng.a - -@mkdir $(DESTDIR)$(INCPATH) - -@mkdir $(DESTDIR)$(INCPATH)/libpng - -@mkdir $(DESTDIR)$(LIBPATH) - -@rm -f $(DESTDIR)$(INCPATH)/png.h - -@rm -f $(DESTDIR)$(INCPATH)/pngconf.h - cp png.h $(DESTDIR)$(INCPATH)/libpng - cp pngconf.h $(DESTDIR)$(INCPATH)/libpng - chmod 644 $(DESTDIR)$(INCPATH)/libpng/png.h - chmod 644 $(DESTDIR)$(INCPATH)/libpng/pngconf.h - (cd $(DESTDIR)$(INCPATH); ln -f -s libpng/* .) - cp libpng.a $(DESTDIR)$(LIBPATH) - chmod 644 $(DESTDIR)$(LIBPATH)/libpng.a - -clean: - rm -f *.o libpng.a pngtest pngout.png - -DOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO -writelock: - chmod a-w *.[ch35] $(DOCS) scripts/* - -# DO NOT DELETE THIS LINE -- make depend depends on it. - -png.o: png.h pngconf.h -pngerror.o: png.h pngconf.h -pngrio.o: png.h pngconf.h -pngwio.o: png.h pngconf.h -pngmem.o: png.h pngconf.h -pngset.o: png.h pngconf.h -pngget.o: png.h pngconf.h -pngread.o: png.h pngconf.h -pngpread.o: png.h pngconf.h -pngrtran.o: png.h pngconf.h -pngrutil.o: png.h pngconf.h -pngtest.o: png.h pngconf.h -pngtrans.o: png.h pngconf.h -pngwrite.o: png.h pngconf.h -pngwtran.o: png.h pngconf.h -pngwutil.o: png.h pngconf.h diff --git a/wxWidgets/src/png/scripts/makefile.msc b/wxWidgets/src/png/scripts/makefile.msc deleted file mode 100644 index 1cbfd91498..0000000000 --- a/wxWidgets/src/png/scripts/makefile.msc +++ /dev/null @@ -1,86 +0,0 @@ -# makefile for libpng -# Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc. -# For conditions of distribution and use, see copyright notice in png.h -# Assumes that zlib.lib, zconf.h, and zlib.h have been copied to ..\zlib - -# -------- Microsoft C 5.1 and later, does not use assembler code -------- -MODEL=L -CFLAGS=-Oait -Gs -nologo -W3 -A$(MODEL) -I..\zlib -#-Ox generates bad code with MSC 5.1 -CC=cl -LD=link -LDFLAGS=/e/st:0x1500/noe -O=.obj - -#uncomment next to put error messages in a file -ERRFILE= >> pngerrs - -# variables -OBJS1 = png$(O) pngset$(O) pngget$(O) pngrutil$(O) pngtrans$(O) pngwutil$(O) -OBJS2 = pngmem$(O) pngpread$(O) pngread$(O) pngerror$(O) pngwrite$(O) -OBJS3 = pngrtran$(O) pngwtran$(O) pngrio$(O) pngwio$(O) - -all: libpng.lib - -png$(O): png.h pngconf.h - $(CC) -c $(CFLAGS) $*.c $(ERRFILE) - -pngset$(O): png.h pngconf.h - $(CC) -c $(CFLAGS) $*.c $(ERRFILE) - -pngget$(O): png.h pngconf.h - $(CC) -c $(CFLAGS) $*.c $(ERRFILE) - -pngread$(O): png.h pngconf.h - $(CC) -c $(CFLAGS) $*.c $(ERRFILE) - -pngpread$(O): png.h pngconf.h - $(CC) -c $(CFLAGS) $*.c $(ERRFILE) - -pngrtran$(O): png.h pngconf.h - $(CC) -c $(CFLAGS) $*.c $(ERRFILE) - -pngrutil$(O): png.h pngconf.h - $(CC) -c $(CFLAGS) $*.c $(ERRFILE) - -pngerror$(O): png.h pngconf.h - $(CC) -c $(CFLAGS) $*.c $(ERRFILE) - -pngmem$(O): png.h pngconf.h - $(CC) -c $(CFLAGS) $*.c $(ERRFILE) - -pngrio$(O): png.h pngconf.h - $(CC) -c $(CFLAGS) $*.c $(ERRFILE) - -pngwio$(O): png.h pngconf.h - $(CC) -c $(CFLAGS) $*.c $(ERRFILE) - -pngtest$(O): png.h pngconf.h - $(CC) -c $(CFLAGS) $*.c $(ERRFILE) - -pngtrans$(O): png.h pngconf.h - $(CC) -c $(CFLAGS) $*.c $(ERRFILE) - -pngwrite$(O): png.h pngconf.h - $(CC) -c $(CFLAGS) $*.c $(ERRFILE) - -pngwtran$(O): png.h pngconf.h - $(CC) -c $(CFLAGS) $*.c $(ERRFILE) - -pngwutil$(O): png.h pngconf.h - $(CC) -c $(CFLAGS) $*.c $(ERRFILE) - -libpng.lib: $(OBJS1) $(OBJS2) $(OBJS3) - del libpng.lib - lib libpng $(OBJS1); - lib libpng $(OBJS2); - lib libpng $(OBJS3); - -pngtest.exe: pngtest.obj libpng.lib - $(LD) $(LDFLAGS) pngtest.obj,,,libpng.lib ..\zlib\zlib.lib ; - -test: pngtest.exe - pngtest - -# End of makefile for libpng - diff --git a/wxWidgets/src/png/scripts/makefile.ne12bsd b/wxWidgets/src/png/scripts/makefile.ne12bsd deleted file mode 100644 index 32d53720c5..0000000000 --- a/wxWidgets/src/png/scripts/makefile.ne12bsd +++ /dev/null @@ -1,44 +0,0 @@ -# makefile for libpng for NetBSD for the standard -# make obj && make depend && make && make test -# make includes && make install -# Copyright (C) 2002 Patrick R.L. Welche -# For conditions of distribution and use, see copyright notice in png.h - -# You should also run makefile.netbsd - -LOCALBASE?=/usr/local -LIBDIR= ${LOCALBASE}/lib -MANDIR= ${LOCALBASE}/man -INCSDIR=${LOCALBASE}/include/libpng12 - -LIB= png12 -SHLIB_MAJOR= 0 -SHLIB_MINOR= 1.2.7 -SRCS= pnggccrd.c png.c pngset.c pngget.c pngrutil.c pngtrans.c pngwutil.c \ - pngread.c pngrio.c pngwio.c pngwrite.c pngrtran.c \ - pngwtran.c pngmem.c pngerror.c pngpread.c -INCS= png.h pngconf.h -MAN= libpng.3 libpngpf.3 png.5 - -CPPFLAGS+=-I${.CURDIR} -DPNG_USE_PNGGCCRD - -# something like this for mmx assembler, but it core dumps for me at the moment -# .if ${MACHINE_ARCH} == "i386" -# CPPFLAGS+=-DPNG_THREAD_UNSAFE_OK -# MKLINT= no -# .else - CPPFLAGS+=-DPNG_NO_ASSEMBLER_CODE -# .endif - -CLEANFILES+=pngtest.o pngtest - -pngtest.o: pngtest.c - ${CC} -c ${CPPFLAGS} ${CFLAGS} ${.ALLSRC} -o ${.TARGET} - -pngtest: pngtest.o libpng.a - ${CC} ${LDFLAGS} ${.ALLSRC} -o${.TARGET} -lz -lm - -test: pngtest - cd ${.CURDIR} && ${.OBJDIR}/pngtest - -.include diff --git a/wxWidgets/src/png/scripts/makefile.netbsd b/wxWidgets/src/png/scripts/makefile.netbsd deleted file mode 100644 index dc0b8b4590..0000000000 --- a/wxWidgets/src/png/scripts/makefile.netbsd +++ /dev/null @@ -1,44 +0,0 @@ -# makefile for libpng for NetBSD for the standard -# make obj && make depend && make && make test -# make includes && make install -# Copyright (C) 2002 Patrick R.L. Welche -# For conditions of distribution and use, see copyright notice in png.h - -# You should also run makefile.ne0bsd - -LOCALBASE?=/usr/local -LIBDIR= ${LOCALBASE}/lib -MANDIR= ${LOCALBASE}/man -INCSDIR=${LOCALBASE}/include/libpng - -LIB= png -SHLIB_MAJOR= 3 -SHLIB_MINOR= 1.2.7 -SRCS= pnggccrd.c png.c pngset.c pngget.c pngrutil.c pngtrans.c pngwutil.c \ - pngread.c pngrio.c pngwio.c pngwrite.c pngrtran.c \ - pngwtran.c pngmem.c pngerror.c pngpread.c -INCS= png.h pngconf.h -MAN= libpng.3 libpngpf.3 png.5 - -CPPFLAGS+=-I${.CURDIR} -DPNG_USE_PNGGCCRD - -# something like this for mmx assembler, but it core dumps for me at the moment -# .if ${MACHINE_ARCH} == "i386" -# CPPFLAGS+=-DPNG_THREAD_UNSAFE_OK -# MKLINT= no -# .else - CPPFLAGS+=-DPNG_NO_ASSEMBLER_CODE -# .endif - -CLEANFILES+=pngtest.o pngtest - -pngtest.o: pngtest.c - ${CC} -c ${CPPFLAGS} ${CFLAGS} ${.ALLSRC} -o ${.TARGET} - -pngtest: pngtest.o libpng.a - ${CC} ${LDFLAGS} ${.ALLSRC} -o${.TARGET} -lz -lm - -test: pngtest - cd ${.CURDIR} && ${.OBJDIR}/pngtest - -.include diff --git a/wxWidgets/src/png/scripts/makefile.openbsd b/wxWidgets/src/png/scripts/makefile.openbsd deleted file mode 100644 index 4cac2fa0f3..0000000000 --- a/wxWidgets/src/png/scripts/makefile.openbsd +++ /dev/null @@ -1,72 +0,0 @@ -# makefile for libpng -# Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc. -# For conditions of distribution and use, see copyright notice in png.h - -PREFIX?= /usr/local -LIBDIR= ${PREFIX}/lib -MANDIR= ${PREFIX}/man/cat - -SHLIB_MAJOR= 0 -SHLIB_MINOR= 1.2.7 - -LIB= png -SRCS= png.c pngerror.c pnggccrd.c pngget.c pngmem.c pngpread.c \ - pngread.c pngrio.c pngrtran.c pngrutil.c pngset.c pngtrans.c \ - pngwio.c pngwrite.c pngwtran.c pngwutil.c - -HDRS= png.h pngconf.h - -CFLAGS+= -Wall -CPPFLAGS+= -I${.CURDIR} -DPNG_NO_ASSEMBLER_CODE -DPNG_USE_PNGGCCRD - -NOPROFILE= Yes - -CLEANFILES+= pngtest.o pngtest - -MAN= libpng.3 libpngpf.3 png.5 -DOCS= ANNOUNCE CHANGES LICENSE README libpng.txt - -pngtest.o: pngtest.c - ${CC} ${CPPFLAGS} ${CFLAGS} -c ${.ALLSRC} -o ${.TARGET} - -pngtest: pngtest.o - ${CC} ${LDFLAGS} ${.ALLSRC} -o ${.TARGET} -L${.OBJDIR} -lpng -lz -lm - -test: pngtest - cd ${.OBJDIR} && env \ - LD_LIBRARY_PATH="${.OBJDIR}" ${.OBJDIR}/pngtest - -beforeinstall: - if [ ! -d ${DESTDIR}${PREFIX}/include/libpng ]; then \ - ${INSTALL} -d -o root -g wheel ${DESTDIR}${PREFIX}/include/libpng; \ - fi - if [ ! -d ${DESTDIR}${LIBDIR} ]; then \ - ${INSTALL} -d -o root -g wheel ${DESTDIR}${LIBDIR}; \ - fi - if [ ! -d ${DESTDIR}${LIBDIR}/debug ]; then \ - ${INSTALL} -d -o root -g wheel ${DESTDIR}${LIBDIR}/debug; \ - fi - if [ ! -d ${DESTDIR}${MANDIR}3 ]; then \ - ${INSTALL} -d -o root -g wheel ${DESTDIR}${MANDIR}3; \ - fi - if [ ! -d ${DESTDIR}${MANDIR}5 ]; then \ - ${INSTALL} -d -o root -g wheel ${DESTDIR}${MANDIR}5; \ - fi - if [ ! -d ${DESTDIR}${PREFIX}/share/doc/png ]; then \ - ${INSTALL} -d -o root -g wheel ${DESTDIR}${PREFIX}/share/doc/png; \ - fi - -afterinstall: - @rm -f ${DESTDIR}${LIBDIR}/libpng_pic.a - @rm -f ${DESTDIR}${LIBDIR}/debug/libpng.a - @rm -f ${DESTDIR}${PREFIX}/include/png.h - @rm -f ${DESTDIR}${PREFIX}/include/pngconf.h - @rmdir ${DESTDIR}${LIBDIR}/debug 2>/dev/null || true - ${INSTALL} ${INSTALL_COPY} -o ${SHAREOWN} -g ${SHAREGRP} \ - -m ${NONBINMODE} ${HDRS} ${DESTDIR}${PREFIX}/include/libpng - ${INSTALL} ${INSTALL_COPY} -o ${SHAREOWN} -g ${SHAREGRP} \ - -m ${NONBINMODE} ${HDRS} ${DESTDIR}${PREFIX}/include - ${INSTALL} ${INSTALL_COPY} -o ${SHAREOWN} -g ${SHAREGRP} \ - -m ${NONBINMODE} ${DOCS} ${DESTDIR}${PREFIX}/share/doc/png - -.include diff --git a/wxWidgets/src/png/scripts/makefile.os2 b/wxWidgets/src/png/scripts/makefile.os2 deleted file mode 100644 index 588067d25f..0000000000 --- a/wxWidgets/src/png/scripts/makefile.os2 +++ /dev/null @@ -1,69 +0,0 @@ -# makefile for libpng on OS/2 with gcc -# For conditions of distribution and use, see copyright notice in png.h - -# Related files: pngos2.def - -CC=gcc -Zomf -s - -# Where the zlib library and include files are located -ZLIBLIB=../zlib -ZLIBINC=../zlib - -WARNMORE=-Wwrite-strings -Wpointer-arith -Wshadow \ - -Wmissing-declarations -Wtraditional -Wcast-align \ - -Wstrict-prototypes -Wmissing-prototypes #-Wconversion -CFLAGS=-I$(ZLIBINC) -Wall -O6 -funroll-loops -malign-loops=2 \ - -malign-functions=2 #$(WARNMORE) -g -DPNG_DEBUG=5 -LDFLAGS=-L. -L$(ZLIBLIB) -lpng -lzdll -Zcrtdll -AR=emxomfar - -PNGLIB=png.lib -IMPLIB=emximp -SHAREDLIB=png.dll -SHAREDLIBIMP=pngdll.lib - -OBJS = png.o pngset.o pngget.o pngrutil.o pngtrans.o pngwutil.o \ - pngread.o pngrio.o pngwio.o pngwrite.o pngrtran.o \ - pngwtran.o pngmem.o pngerror.o pngpread.o - -.SUFFIXES: .c .o - -all: $(PNGLIB) $(SHAREDLIB) $(SHAREDLIBIMP) - -$(PNGLIB): $(OBJS) - $(AR) rc $@ $(OBJS) - -$(SHAREDLIB): $(OBJS) pngos2.def - $(CC) $(LDFLAGS) -Zdll -o $@ $^ - -$(SHAREDLIBIMP): pngos2.def - $(IMPLIB) -o $@ $^ - -pngtest.exe: pngtest.o png.dll pngdll.lib - $(CC) -o $@ $(CFLAGS) $< $(LDFLAGS) - -test: pngtest.exe - ./pngtest.exe - -clean: - rm -f *.o $(PNGLIB) png.dll pngdll.lib pngtest.exe pngout.png - -# DO NOT DELETE THIS LINE -- make depend depends on it. - -png.o png.pic.o: png.h pngconf.h -pngerror.o pngerror.pic.o: png.h pngconf.h -pngrio.o pngrio.pic.o: png.h pngconf.h -pngwio.o pngwio.pic.o: png.h pngconf.h -pngmem.o pngmem.pic.o: png.h pngconf.h -pngset.o pngset.pic.o: png.h pngconf.h -pngget.o pngget.pic.o: png.h pngconf.h -pngread.o pngread.pic.o: png.h pngconf.h -pngrtran.o pngrtran.pic.o: png.h pngconf.h -pngrutil.o pngrutil.pic.o: png.h pngconf.h -pngtrans.o pngtrans.pic.o: png.h pngconf.h -pngwrite.o pngwrite.pic.o: png.h pngconf.h -pngwtran.o pngwtran.pic.o: png.h pngconf.h -pngwutil.o pngwutil.pic.o: png.h pngconf.h -pngpread.o pngpread.pic.o: png.h pngconf.h - -pngtest.o: png.h pngconf.h diff --git a/wxWidgets/src/png/scripts/makefile.sco b/wxWidgets/src/png/scripts/makefile.sco deleted file mode 100644 index b37e72dd5d..0000000000 --- a/wxWidgets/src/png/scripts/makefile.sco +++ /dev/null @@ -1,212 +0,0 @@ -# makefile for SCO OSr5 ELF and Unixware 7 with Native cc -# Contributed by Mike Hopkirk (hops@sco.com) modified from Makefile.lnx -# force ELF build dynamic linking, SONAME setting in lib and RPATH in app -# Copyright (C) 2002 Glenn Randers-Pehrson -# Copyright (C) 1998 Greg Roelofs -# Copyright (C) 1996, 1997 Andreas Dilger -# For conditions of distribution and use, see copyright notice in png.h - -CC=cc - -# where make install puts libpng.a, libpng.so*, and png.h -prefix=/usr/local - -# Where the zlib library and include files are located -#ZLIBLIB=/usr/local/lib -#ZLIBINC=/usr/local/include -ZLIBLIB=../zlib -ZLIBINC=../zlib - -CFLAGS= -dy -belf -I$(ZLIBINC) -O3 -LDFLAGS=-L. -L$(ZLIBLIB) -lpng12 -lz -lm - -#RANLIB=ranlib -RANLIB=echo - -PNGMAJ = 0 -PNGMIN = 1.2.7 -PNGVER = $(PNGMAJ).$(PNGMIN) -LIBNAME = libpng12 - -INCPATH=$(prefix)/include/libpng -LIBPATH=$(prefix)/lib -MANPATH=$(prefix)/man -BINPATH=$(prefix)/bin - -# override DESTDIR= on the make install command line to easily support -# installing into a temporary location. Example: -# -# make install DESTDIR=/tmp/build/libpng -# -# If you're going to install into a temporary location -# via DESTDIR, $(DESTDIR)$(prefix) must already exist before -# you execute make install. -DESTDIR= - -DB=$(DESTDIR)$(BINPATH) -DI=$(DESTDIR)$(INCPATH) -DL=$(DESTDIR)$(LIBPATH) -DM=$(DESTDIR)$(MANPATH) - -OBJS = png.o pngset.o pngget.o pngrutil.o pngtrans.o pngwutil.o \ - pngread.o pngrio.o pngwio.o pngwrite.o pngrtran.o \ - pngwtran.o pngmem.o pngerror.o pngpread.o - -OBJSDLL = $(OBJS:.o=.pic.o) - -.SUFFIXES: .c .o .pic.o - -.c.pic.o: - $(CC) -c $(CFLAGS) -KPIC -o $@ $*.c - -all: libpng.a $(LIBNAME).so pngtest libpng.pc libpng-config - -libpng.a: $(OBJS) - ar rc $@ $(OBJS) - $(RANLIB) $@ - -libpng.pc: - cat scripts/libpng.pc.in | sed -e s\!@PREFIX@!$(prefix)! > libpng.pc - -libpng-config: - ( cat scripts/libpng-config-head.in; \ - echo prefix=\"$(prefix)\"; \ - echo I_opts=\"-I$(INCPATH)/$(LIBNAME)\"; \ - echo ccopts=\"-belf\"; \ - echo L_opts=\"-L$(LIBPATH)\"; \ - echo libs=\"-lpng12 -lz -lm\"; \ - cat scripts/libpng-config-body.in ) > libpng-config - chmod +x libpng-config - -$(LIBNAME).so: $(LIBNAME).so.$(PNGMAJ) - ln -f -s $(LIBNAME).so.$(PNGMAJ) $(LIBNAME).so - -$(LIBNAME).so.$(PNGMAJ): $(LIBNAME).so.$(PNGVER) - ln -f -s $(LIBNAME).so.$(PNGVER) $(LIBNAME).so.$(PNGMAJ) - -$(LIBNAME).so.$(PNGVER): $(OBJSDLL) - $(CC) -G -Wl,-h,$(LIBNAME).so.$(PNGMAJ) -o $(LIBNAME).so.$(PNGVER) \ - $(OBJSDLL) - -libpng.so.3.$(PNGMIN): $(OBJSDLL) - $(CC) -G -Wl,-h,libpng.so.3 -o libpng.so.3.$(PNGMIN) \ - $(OBJSDLL) - -pngtest: pngtest.o $(LIBNAME).so - LD_RUN_PATH=.:$(ZLIBLIB) $(CC) -o pngtest $(CFLAGS) pngtest.o $(LDFLAGS) - -test: pngtest - ./pngtest - -install-headers: png.h pngconf.h - -@if [ ! -d $(DI) ]; then mkdir $(DI); fi - -@if [ ! -d $(DI)/$(LIBNAME) ]; then mkdir $(DI)/$(LIBNAME); fi - -@/bin/rm -f $(DI)/png.h - -@/bin/rm -f $(DI)/pngconf.h - cp png.h pngconf.h $(DI)/$(LIBNAME) - chmod 644 $(DI)/$(LIBNAME)/png.h $(DI)/$(LIBNAME)/pngconf.h - -@/bin/rm -f $(DI)/png.h $(DI)/pngconf.h - -@/bin/rm -f $(DI)/libpng - (cd $(DI); ln -f -s $(LIBNAME) libpng; ln -f -s $(LIBNAME)/* .) - -install-static: install-headers libpng.a - -@if [ ! -d $(DL) ]; then mkdir $(DL); fi - cp libpng.a $(DL)/$(LIBNAME).a - chmod 644 $(DL)/$(LIBNAME).a - -@/bin/rm -f $(DL)/libpng.a - (cd $(DL); ln -f -s $(LIBNAME).a libpng.a) - -install-shared: install-headers $(LIBNAME).so.$(PNGVER) libpng.pc \ - libpng.so.3.$(PNGMIN) - -@if [ ! -d $(DL) ]; then mkdir $(DL); fi - -@/bin/rm -f $(DL)/$(LIBNAME).so.$(PNGVER)* $(DL)/$(LIBNAME).so - -@/bin/rm -f $(DL)/$(LIBNAME).so.$(PNGMAJ) - -@/bin/rm -f $(DL)/libpng.so - -@/bin/rm -f $(DL)/libpng.so.3 - -@/bin/rm -f $(DL)/libpng.so.3.$(PNGMIN)* - cp $(LIBNAME).so.$(PNGVER) $(DL) - cp libpng.so.3.$(PNGMIN) $(DL) - chmod 755 $(DL)/$(LIBNAME).so.$(PNGVER) - chmod 755 $(DL)/libpng.so.3.$(PNGMIN) - (cd $(DL); \ - ln -f -s libpng.so.3.$(PNGMIN) libpng.so.3; \ - ln -f -s libpng.so.3 libpng.so; \ - ln -f -s $(LIBNAME).so.$(PNGVER) $(LIBNAME).so.$(PNGMAJ); \ - ln -f -s $(LIBNAME).so.$(PNGMAJ) $(LIBNAME).so) - -@if [ ! -d $(DL)/pkgconfig ]; then mkdir $(DL)/pkgconfig; fi - -@/bin/rm -f $(DL)/pkgconfig/$(LIBNAME).pc - -@/bin/rm -f $(DL)/pkgconfig/libpng.pc - cp libpng.pc $(DL)/pkgconfig/$(LIBNAME).pc - chmod 644 $(DL)/pkgconfig/$(LIBNAME).pc - (cd $(DL)/pkgconfig; ln -f -s $(LIBNAME).pc libpng.pc) - -install-man: libpng.3 libpngpf.3 png.5 - -@if [ ! -d $(DM) ]; then mkdir $(DM); fi - -@if [ ! -d $(DM)/man3 ]; then mkdir $(DM)/man3; fi - -@/bin/rm -f $(DM)/man3/libpng.3 - -@/bin/rm -f $(DM)/man3/libpngpf.3 - cp libpng.3 $(DM)/man3 - cp libpngpf.3 $(DM)/man3 - -@if [ ! -d $(DM)/man5 ]; then mkdir $(DM)/man5; fi - -@/bin/rm -f $(DM)/man5/png.5 - cp png.5 $(DM)/man5 - -install-config: libpng-config - -@if [ ! -d $(DB) ]; then mkdir $(DB); fi - -@/bin/rm -f $(DB)/libpng-config - -@/bin/rm -f $(DB)/$(LIBNAME)-config - cp libpng-config $(DB)/$(LIBNAME)-config - chmod 755 $(DB)/$(LIBNAME)-config - (cd $(DB); ln -f -s $(LIBNAME)-config libpng-config) - -install: install-static install-shared install-man install-config - -# If you installed in $(DESTDIR), test-installed won't work until you -# move the library to its final location. Use test-dd to test it -# before then. - -test-dd: - echo - echo Testing installed dynamic shared library in $(DL). - $(CC) -I$(DI) $(CFLAGS) \ - `$(BINPATH)/libpng12-config --cflags` pngtest.c \ - -L$(DL) -L$(ZLIBLIB) \ - -o pngtestd `$(BINPATH)/libpng12-config --ldflags` - ./pngtestd pngtest.png - -test-installed: - $(CC) $(CFLAGS) \ - `$(BINPATH)/libpng12-config --cflags` pngtest.c \ - -L$(ZLIBLIB) \ - -o pngtesti `$(BINPATH)/libpng12-config --ldflags` - ./pngtesti pngtest.png - -clean: - /bin/rm -f *.o libpng.a pngtest pngout.png libpng-config \ - $(LIBNAME).so $(LIBNAME).so.$(PNGMAJ)* pngtest-static pngtesti \ - libpng.so.3.$(PNGMIN) \ - libpng.pc - -DOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO -writelock: - chmod a-w *.[ch35] $(DOCS) scripts/* - -# DO NOT DELETE THIS LINE -- make depend depends on it. - -png.o png.pic.o: png.h pngconf.h -pngerror.o pngerror.pic.o: png.h pngconf.h -pngrio.o pngrio.pic.o: png.h pngconf.h -pngwio.o pngwio.pic.o: png.h pngconf.h -pngmem.o pngmem.pic.o: png.h pngconf.h -pngset.o pngset.pic.o: png.h pngconf.h -pngget.o pngget.pic.o: png.h pngconf.h -pngread.o pngread.pic.o: png.h pngconf.h -pngrtran.o pngrtran.pic.o: png.h pngconf.h -pngrutil.o pngrutil.pic.o: png.h pngconf.h -pngtrans.o pngtrans.pic.o: png.h pngconf.h -pngwrite.o pngwrite.pic.o: png.h pngconf.h -pngwtran.o pngwtran.pic.o: png.h pngconf.h -pngwutil.o pngwutil.pic.o: png.h pngconf.h -pngpread.o pngpread.pic.o: png.h pngconf.h - -pngtest.o: png.h pngconf.h diff --git a/wxWidgets/src/png/scripts/makefile.sggcc b/wxWidgets/src/png/scripts/makefile.sggcc deleted file mode 100644 index 0902697848..0000000000 --- a/wxWidgets/src/png/scripts/makefile.sggcc +++ /dev/null @@ -1,224 +0,0 @@ -# makefile for libpng.a and libpng12.so, SGI IRIX with 'cc' -# Copyright (C) 2001-2002 Glenn Randers-Pehrson -# Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc. -# For conditions of distribution and use, see copyright notice in png.h - -# Where make install puts libpng.a, libpng12.so, and libpng12/png.h -# Prefix must be a full pathname. - -prefix=/usr/local - -# Where the zlib library and include files are located -#ZLIBLIB=/usr/local/lib32 -#ZLIBINC=/usr/local/include -#ZLIBLIB=/usr/local/lib -#ZLIBINC=/usr/local/include -ZLIBLIB=../zlib -ZLIBINC=../zlib - -LIBNAME=libpng12 -PNGMAJ = 0 -PNGMIN = 1.2.7 -PNGVER = $(PNGMAJ).$(PNGMIN) -CC=gcc - -# ABI can be blank to use default for your system, -32, -o32, -n32, or -64 -# See "man abi". zlib must be built with the same ABI. -ABI= - -WARNMORE= # -g -DPNG_DEBUG=5 -CFLAGS=$(ABI) -I$(ZLIBINC) -O2 $(WARNMORE) -fPIC -mabi=n32 -LDFLAGS=$(ABI) -L. -L$(ZLIBLIB) -lpng -lz -lm -LDSHARED=cc $(ABI) -shared -soname $(LIBNAME).so.$(PNGMAJ) \ - -set_version sgi$(PNGMAJ).0 -LDLEGACY=cc $(ABI) -shared -soname libpng.so.3 \ - -set_version sgi$3.0 -# See "man dso" for info about shared objects - -RANLIB=echo -#RANLIB=ranlib - -INCPATH=$(prefix)/include -LIBPATH=$(prefix)/lib -#LIBPATH=$(prefix)/lib32 -MANPATH=$(prefix)/man -BINPATH=$(prefix)/bin - -# override DESTDIR= on the make install command line to easily support -# installing into a temporary location. Example: -# -# make install DESTDIR=/tmp/build/libpng -# -# If you're going to install into a temporary location -# via DESTDIR, $(DESTDIR)$(prefix) must already exist before -# you execute make install. -DESTDIR= - -DB=$(DESTDIR)$(BINPATH) -DI=$(DESTDIR)$(INCPATH) -DL=$(DESTDIR)$(LIBPATH) -DM=$(DESTDIR)$(MANPATH) - -OBJS = pnggccrd.o png.o pngset.o pngget.o pngrutil.o pngtrans.o pngwutil.o \ - pngread.o pngrio.o pngwio.o pngwrite.o pngrtran.o \ - pngwtran.o pngmem.o pngerror.o pngpread.o - -all: libpng.a pngtest shared libpng.pc libpng-config - -libpng.a: $(OBJS) - ar rc $@ $(OBJS) - $(RANLIB) $@ - -shared: $(LIBNAME).so.$(PNGVER) - -libpng.pc: - cat scripts/libpng.pc.in | sed -e s\!@PREFIX@!$(prefix)! > libpng.pc - -libpng-config: - ( cat scripts/libpng-config-head.in; \ - echo prefix=\"$(prefix)\"; \ - echo I_opts=\"-I$(INCPATH)/$(LIBNAME)\"; \ - echo ccopts=\"$(ABI)\"; \ - echo ldopts=\"$(ABI)\"; \ - echo L_opts=\"-L$(LIBPATH)\"; \ - echo libdir=\"$(LIBPATH)\"; \ - echo libs=\"-lpng12 -lz -lm\"; \ - cat scripts/libpng-config-body.in ) > libpng-config - chmod +x libpng-config - -$(LIBNAME).so: $(LIBNAME).so.$(PNGMAJ) - ln -sf $(LIBNAME).so.$(PNGMAJ) $(LIBNAME).so - -$(LIBNAME).so.$(PNGMAJ): $(LIBNAME).so.$(PNGVER) - ln -sf $(LIBNAME).so.$(PNGVER) $(LIBNAME).so.$(PNGMAJ) - -$(LIBNAME).so.$(PNGVER): $(OBJS) - $(LDSHARED) -o $@ $(OBJS) - rm -f $(LIBNAME).so $(LIBNAME).so.$(PNGMAJ) - -libpng.so.3.$(PNGMIN): $(OBJS) - $(LDLEGACY) -o $@ $(OBJS) - -pngtest: pngtest.o libpng.a - $(CC) -o pngtest $(CFLAGS) pngtest.o $(LDFLAGS) - -test: pngtest - echo - echo Testing local static library. - ./pngtest - -install-headers: png.h pngconf.h - -@if [ ! -d $(DI) ]; then mkdir $(DI); fi - -@if [ ! -d $(DI)/$(LIBNAME) ]; then mkdir $(DI)/$(LIBNAME); fi - cp png.h pngconf.h $(DI)/$(LIBNAME) - chmod 644 $(DI)/$(LIBNAME)/png.h $(DI)/$(LIBNAME)/pngconf.h - -@/bin/rm -f $(DI)/png.h $(DI)/pngconf.h - -@/bin/rm -f $(DI)/libpng - (cd $(DI); ln -sf $(LIBNAME) libpng; ln -sf $(LIBNAME)/* .) - -install-static: install-headers libpng.a - -@if [ ! -d $(DL) ]; then mkdir $(DL); fi - cp libpng.a $(DL)/$(LIBNAME).a - chmod 644 $(DL)/$(LIBNAME).a - -@/bin/rm -f $(DL)/libpng.a - (cd $(DL); ln -sf $(LIBNAME).a libpng.a) - -install-shared: install-headers $(LIBNAME).so.$(PNGVER) libpng.pc \ - libpng.so.3.$(PNGMIN) - -@if [ ! -d $(DL) ]; then mkdir $(DL); fi - -@/bin/rm -f $(DL)/$(LIBNAME).so.$(PNGVER)* $(DL)/$(LIBNAME).so - -@/bin/rm -f $(DL)/$(LIBNAME).so.$(PNGMAJ) - -@/bin/rm -f $(DL)/libpng.so - -@/bin/rm -f $(DL)/libpng.so.3 - -@/bin/rm -f $(DL)/libpng.so.3.$(PNGMIN)* - cp $(LIBNAME).so.$(PNGVER) $(DL) - cp libpng.so.3.$(PNGMIN) $(DL) - chmod 755 $(DL)/$(LIBNAME).so.$(PNGVER) - chmod 755 $(DL)/libpng.so.3.$(PNGMIN) - (cd $(DL); \ - ln -sf libpng.so.3.$(PNGMIN) libpng.so.3; \ - ln -sf libpng.so.3 libpng.so; \ - ln -sf $(LIBNAME).so.$(PNGVER) $(LIBNAME).so.$(PNGMAJ); \ - ln -sf $(LIBNAME).so.$(PNGMAJ) $(LIBNAME).so) - -@if [ ! -d $(DL)/pkgconfig ]; then mkdir $(DL)/pkgconfig; fi - -@/bin/rm -f $(DL)/pkgconfig/$(LIBNAME).pc - -@/bin/rm -f $(DL)/pkgconfig/libpng.pc - cp libpng.pc $(DL)/pkgconfig/$(LIBNAME).pc - chmod 644 $(DL)/pkgconfig/$(LIBNAME).pc - (cd $(DL)/pkgconfig; ln -sf $(LIBNAME).pc libpng.pc) - -install-man: libpng.3 libpngpf.3 png.5 - -@if [ ! -d $(DM) ]; then mkdir $(DM); fi - -@if [ ! -d $(DM)/man3 ]; then mkdir $(DM)/man3; fi - -@/bin/rm -f $(DM)/man3/libpng.3 - -@/bin/rm -f $(DM)/man3/libpngpf.3 - cp libpng.3 $(DM)/man3 - cp libpngpf.3 $(DM)/man3 - -@if [ ! -d $(DM)/man5 ]; then mkdir $(DM)/man5; fi - -@/bin/rm -f $(DM)/man5/png.5 - cp png.5 $(DM)/man5 - -install-config: libpng-config - -@if [ ! -d $(DB) ]; then mkdir $(DB); fi - -@/bin/rm -f $(DB)/libpng-config - -@/bin/rm -f $(DB)/$(LIBNAME)-config - cp libpng-config $(DB)/$(LIBNAME)-config - chmod 755 $(DB)/$(LIBNAME)-config - (cd $(DB); ln -sf $(LIBNAME)-config libpng-config) - -install: install-static install-shared install-man install-config - -# If you installed in $(DESTDIR), test-installed won't work until you -# move the library to its final location. Use test-dd to test it -# before then. - -test-dd: - echo - echo Testing installed dynamic shared library in $(DL). - $(CC) -I$(DI) -I$(ZLIBINC) \ - `$(BINPATH)/libpng12-config --cflags` pngtest.c \ - -L$(DL) -L$(ZLIBLIB) \ - -rpath $(ZLIBLIB):$(DL)\ - -o pngtestd `$(BINPATH)/libpng12-config --ldflags` - ./pngtestd pngtest.png - -test-installed: - echo - echo Testing installed dynamic shared library. - $(CC) -I$(ZLIBINC) \ - `$(BINPATH)/libpng12-config --cflags` pngtest.c \ - -L$(ZLIBLIB) \ - -rpath $(ZLIBLIB):`$(BINPATH)/libpng12-config --libdir` \ - -o pngtesti `$(BINPATH)/libpng12-config --ldflags` - ./pngtesti pngtest.png - -clean: - rm -f *.o libpng.a pngtest pngtesti pngout.png libpng.pc libpng-config \ - $(LIBNAME).so $(LIBNAME).so.$(PNGMAJ)* \ - libpng.so.3.$(PNGMIN) \ - so_locations - -DOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO -writelock: - chmod a-w *.[ch35] $(DOCS) scripts/* - -# DO NOT DELETE THIS LINE -- make depend depends on it. - -png.o: png.h pngconf.h -pngerror.o: png.h pngconf.h -pngrio.o: png.h pngconf.h -pngwio.o: png.h pngconf.h -pngmem.o: png.h pngconf.h -pngset.o: png.h pngconf.h -pngget.o: png.h pngconf.h -pngread.o: png.h pngconf.h -pngrtran.o: png.h pngconf.h -pngrutil.o: png.h pngconf.h -pngtest.o: png.h pngconf.h -pngtrans.o: png.h pngconf.h -pngwrite.o: png.h pngconf.h -pngwtran.o: png.h pngconf.h -pngwutil.o: png.h pngconf.h -pngpread.o: png.h pngconf.h -pnggccrd.o: png.h pngconf.h - diff --git a/wxWidgets/src/png/scripts/makefile.sgi b/wxWidgets/src/png/scripts/makefile.sgi deleted file mode 100644 index e3d29b5437..0000000000 --- a/wxWidgets/src/png/scripts/makefile.sgi +++ /dev/null @@ -1,230 +0,0 @@ -# makefile for libpng.a and libpng12.so, SGI IRIX with 'cc' -# Copyright (C) 2001-2002 Glenn Randers-Pehrson -# Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc. -# For conditions of distribution and use, see copyright notice in png.h - -LIBNAME=libpng12 -PNGMAJ = 0 -PNGMIN = 1.2.7 -PNGVER = $(PNGMAJ).$(PNGMIN) - -# Where make install puts libpng.a, libpng12.so, and libpng12/png.h -# Prefix must be a full pathname. - -prefix=/usr/local - -# Where the zlib library and include files are located -#ZLIBLIB=/usr/local/lib32 -#ZLIBINC=/usr/local/include -#ZLIBLIB=/usr/local/lib -#ZLIBINC=/usr/local/include -ZLIBLIB=../zlib -ZLIBINC=../zlib - -CC=cc - -# ABI can be blank to use default for your system, -32, -o32, -n32, or -64 -# See "man abi". zlib must be built with the same ABI. -ABI= - -WARNMORE=-fullwarn -# Note: -KPIC is the default anyhow -#CFLAGS= $(ABI) -I$(ZLIBINC) -O $(WARNMORE) -KPIC -DPNG_USE_PNGGCCRD # -g -DPNG_DEBUG=5 -CFLAGS=$(ABI) -I$(ZLIBINC) -O $(WARNMORE) -DPNG_USE_PNGGCCRD \ - -DPNG_NO_ASSEMBLER_CODE -LDFLAGS_A=$(ABI) -L. -L$(ZLIBLIB) -lpng12 -lz -lm -LDFLAGS=$(ABI) -L. -L$(ZLIBLIB) -lpng -lz -lm -LDSHARED=cc $(ABI) -shared -soname $(LIBNAME).so.$(PNGMAJ) \ - -set_version sgi$(PNGMAJ).0 -LDLEGACY=cc $(ABI) -shared -soname libpng.so.3 \ - -set_version sgi$3.0 -# See "man dso" for info about shared objects - -RANLIB=echo -#RANLIB=ranlib - -INCPATH=$(prefix)/include -LIBPATH=$(prefix)/lib -#LIBPATH=$(prefix)/lib32 -MANPATH=$(prefix)/man -BINPATH=$(prefix)/bin - -# override DESTDIR= on the make install command line to easily support -# installing into a temporary location. Example: -# -# make install DESTDIR=/tmp/build/libpng -# -# If you're going to install into a temporary location -# via DESTDIR, $(DESTDIR)$(prefix) must already exist before -# you execute make install. -DESTDIR= - -DB=$(DESTDIR)$(BINPATH) -DI=$(DESTDIR)$(INCPATH) -DL=$(DESTDIR)$(LIBPATH) -DM=$(DESTDIR)$(MANPATH) - -OBJS = pnggccrd.o png.o pngset.o pngget.o pngrutil.o pngtrans.o pngwutil.o \ - pngread.o pngrio.o pngwio.o pngwrite.o pngrtran.o \ - pngwtran.o pngmem.o pngerror.o pngpread.o - -all: libpng.a pngtest shared libpng.pc libpng-config - -libpng.a: $(OBJS) - ar rc $@ $(OBJS) - $(RANLIB) $@ - -shared: $(LIBNAME).so.$(PNGVER) - -libpng.pc: - cat scripts/libpng.pc.in | sed -e s\!@PREFIX@!$(prefix)! > libpng.pc - -libpng-config: - ( cat scripts/libpng-config-head.in; \ - echo prefix=\"$(prefix)\"; \ - echo I_opts=\"-I$(INCPATH)/$(LIBNAME)\"; \ - echo cppflags=\"-DPNG_USE_PNGGCCRD -DPNG_NO_ASSEMBLER_CODE\"; \ - echo ccopts=\"$(ABI)\"; \ - echo ldopts=\"$(ABI)\"; \ - echo L_opts=\"-L$(LIBPATH)\"; \ - echo libdir=\"$(LIBPATH)\"; \ - echo libs=\"-lpng12 -lz -lm\"; \ - cat scripts/libpng-config-body.in ) > libpng-config - chmod +x libpng-config - -$(LIBNAME).so: $(LIBNAME).so.$(PNGMAJ) - ln -sf $(LIBNAME).so.$(PNGMAJ) $(LIBNAME).so - -$(LIBNAME).so.$(PNGMAJ): $(LIBNAME).so.$(PNGVER) - ln -sf $(LIBNAME).so.$(PNGVER) $(LIBNAME).so.$(PNGMAJ) - -$(LIBNAME).so.$(PNGVER): $(OBJS) - $(LDSHARED) -o $@ $(OBJS) - rm -f $(LIBNAME).so $(LIBNAME).so.$(PNGMAJ) - -libpng.so.3.$(PNGMIN): $(OBJS) - $(LDLEGACY) -o $@ $(OBJS) - -pngtest: pngtest.o libpng.a - $(CC) -o pngtest $(CFLAGS) pngtest.o $(LDFLAGS) - -test: pngtest - echo - echo Testing local static library. - ./pngtest - -install-headers: png.h pngconf.h - -@if [ ! -d $(DI) ]; then mkdir $(DI); fi - -@if [ ! -d $(DI)/$(LIBNAME) ]; then mkdir $(DI)/$(LIBNAME); fi - cp png.h pngconf.h $(DI)/$(LIBNAME) - chmod 644 $(DI)/$(LIBNAME)/png.h $(DI)/$(LIBNAME)/pngconf.h - -@/bin/rm -f $(DI)/png.h $(DI)/pngconf.h - -@/bin/rm -f $(DI)/libpng - (cd $(DI); ln -sf $(LIBNAME) libpng; ln -sf $(LIBNAME)/* .) - -install-static: install-headers libpng.a - -@if [ ! -d $(DL) ]; then mkdir $(DL); fi - cp libpng.a $(DL)/$(LIBNAME).a - chmod 644 $(DL)/$(LIBNAME).a - -@/bin/rm -f $(DL)/libpng.a - (cd $(DL); ln -sf $(LIBNAME).a libpng.a) - -install-shared: install-headers $(LIBNAME).so.$(PNGVER) libpng.pc \ - libpng.so.3.$(PNGMIN) - -@if [ ! -d $(DL) ]; then mkdir $(DL); fi - -@/bin/rm -f $(DL)/$(LIBNAME).so.$(PNGVER)* $(DL)/$(LIBNAME).so - -@/bin/rm -f $(DL)/$(LIBNAME).so.$(PNGMAJ) - -@/bin/rm -f $(DL)/libpng.so - -@/bin/rm -f $(DL)/libpng.so.3 - -@/bin/rm -f $(DL)/libpng.so.3.$(PNGMIN)* - cp $(LIBNAME).so.$(PNGVER) $(DL) - cp libpng.so.3.$(PNGMIN) $(DL) - chmod 755 $(DL)/$(LIBNAME).so.$(PNGVER) - chmod 755 $(DL)/libpng.so.3.$(PNGMIN) - (cd $(DL); \ - ln -sf libpng.so.3.$(PNGMIN) libpng.so.3; \ - ln -sf libpng.so.3 libpng.so; \ - ln -sf $(LIBNAME).so.$(PNGVER) $(LIBNAME).so.$(PNGMAJ); \ - ln -sf $(LIBNAME).so.$(PNGMAJ) $(LIBNAME).so) - -@if [ ! -d $(DL)/pkgconfig ]; then mkdir $(DL)/pkgconfig; fi - -@/bin/rm -f $(DL)/pkgconfig/$(LIBNAME).pc - -@/bin/rm -f $(DL)/pkgconfig/libpng.pc - cp libpng.pc $(DL)/pkgconfig/$(LIBNAME).pc - chmod 644 $(DL)/pkgconfig/$(LIBNAME).pc - (cd $(DL)/pkgconfig; ln -sf $(LIBNAME).pc libpng.pc) - -install-man: libpng.3 libpngpf.3 png.5 - -@if [ ! -d $(DM) ]; then mkdir $(DM); fi - -@if [ ! -d $(DM)/man3 ]; then mkdir $(DM)/man3; fi - -@/bin/rm -f $(DM)/man3/libpng.3 - -@/bin/rm -f $(DM)/man3/libpngpf.3 - cp libpng.3 $(DM)/man3 - cp libpngpf.3 $(DM)/man3 - -@if [ ! -d $(DM)/man5 ]; then mkdir $(DM)/man5; fi - -@/bin/rm -f $(DM)/man5/png.5 - cp png.5 $(DM)/man5 - -install-config: libpng-config - -@if [ ! -d $(DB) ]; then mkdir $(DB); fi - -@/bin/rm -f $(DB)/libpng-config - -@/bin/rm -f $(DB)/$(LIBNAME)-config - cp libpng-config $(DB)/$(LIBNAME)-config - chmod 755 $(DB)/$(LIBNAME)-config - (cd $(DB); ln -sf $(LIBNAME)-config libpng-config) - -install: install-static install-shared install-man install-config - -# If you installed in $(DESTDIR), test-installed won't work until you -# move the library to its final location. Use test-dd to test it -# before then. - -test-dd: - echo - echo Testing installed dynamic shared library in $(DL). - $(CC) -I$(DI) -I$(ZLIBINC) \ - `$(BINPATH)/libpng12-config --cflags` pngtest.c \ - -L$(DL) -L$(ZLIBLIB) \ - -rpath $(ZLIBLIB):$(DL) \ - -o pngtestd `$(BINPATH)/libpng12-config --ldflags` - ./pngtestd pngtest.png - -test-installed: - echo - echo Testing installed dynamic shared library. - $(CC) -I$(ZLIBINC) \ - `$(BINPATH)/libpng12-config --cflags` pngtest.c \ - -L$(ZLIBLIB) \ - -rpath $(ZLIBLIB):`$(BINPATH)/libpng12-config --libdir` \ - -o pngtesti `$(BINPATH)/libpng12-config --ldflags` - ./pngtesti pngtest.png - -clean: - rm -f *.o libpng.a pngtest pngtesti pngout.png libpng.pc libpng-config \ - $(LIBNAME).so $(LIBNAME).so.$(PNGMAJ)* \ - libpng.so.3.$(PNGMIN) \ - so_locations - -DOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO -writelock: - chmod a-w *.[ch35] $(DOCS) scripts/* - -# DO NOT DELETE THIS LINE -- make depend depends on it. - -png.o: png.h pngconf.h -pngerror.o: png.h pngconf.h -pngrio.o: png.h pngconf.h -pngwio.o: png.h pngconf.h -pngmem.o: png.h pngconf.h -pngset.o: png.h pngconf.h -pngget.o: png.h pngconf.h -pngread.o: png.h pngconf.h -pngrtran.o: png.h pngconf.h -pngrutil.o: png.h pngconf.h -pngtest.o: png.h pngconf.h -pngtrans.o: png.h pngconf.h -pngwrite.o: png.h pngconf.h -pngwtran.o: png.h pngconf.h -pngwutil.o: png.h pngconf.h -pngpread.o: png.h pngconf.h -pnggccrd.o: png.h pngconf.h - diff --git a/wxWidgets/src/png/scripts/makefile.so9 b/wxWidgets/src/png/scripts/makefile.so9 deleted file mode 100644 index c907deda91..0000000000 --- a/wxWidgets/src/png/scripts/makefile.so9 +++ /dev/null @@ -1,234 +0,0 @@ -# makefile for libpng on Solaris 9 (beta) with Forte cc -# Updated by Chad Schrock for Solaris 9 -# Contributed by William L. Sebok, based on makefile.linux -# Copyright (C) 2002 Glenn Randers-Pehrson -# Copyright (C) 1998-2001 Greg Roelofs -# Copyright (C) 1996-1997 Andreas Dilger -# For conditions of distribution and use, see copyright notice in png.h - -# gcc 2.95 doesn't work. -CC=cc - -# Where make install puts libpng.a, libpng.so*, and png.h -prefix=/usr/local - -# Where the zlib library and include files are located -# Changing these to ../zlib poses a security risk. If you want -# to have zlib in an adjacent directory, specify the full path instead of "..". -#ZLIBLIB=../zlib -#ZLIBINC=../zlib -#ZLIBLIB=/usr/local/lib -#ZLIBINC=/usr/local/include -#Use the preinstalled zlib that comes with Solaris 9: -ZLIBLIB=/usr/lib -ZLIBINC=/usr/include - -#WARNMORE=-Wwrite-strings -Wpointer-arith -Wshadow \ - -Wmissing-declarations -Wtraditional -Wcast-align \ - -Wstrict-prototypes -Wmissing-prototypes #-Wconversion -#CFLAGS=-I$(ZLIBINC) -Wall -O3 $(WARNMORE) -g -DPNG_DEBUG=5 -CFLAGS=-I$(ZLIBINC) -O3 -LDFLAGS=-L. -R. -L$(ZLIBLIB) -R$(ZLIBLIB) -lpng12 -lz -lm - -#RANLIB=ranlib -RANLIB=echo - -PNGMAJ = 0 -PNGMIN = 1.2.7 -PNGVER = $(PNGMAJ).$(PNGMIN) -LIBNAME = libpng12 - -INCPATH=$(prefix)/include -LIBPATH=$(prefix)/lib -MANPATH=$(prefix)/man -BINPATH=$(prefix)/bin - -# override DESTDIR= on the make install command line to easily support -# installing into a temporary location. Example: -# -# make install DESTDIR=/tmp/build/libpng -# -# If you're going to install into a temporary location -# via DESTDIR, $(DESTDIR)$(prefix) must already exist before -# you execute make install. -DESTDIR= - -DB=$(DESTDIR)$(BINPATH) -DI=$(DESTDIR)$(INCPATH) -DL=$(DESTDIR)$(LIBPATH) -DM=$(DESTDIR)$(MANPATH) - -OBJS = png.o pngset.o pngget.o pngrutil.o pngtrans.o pngwutil.o \ - pngread.o pngrio.o pngwio.o pngwrite.o pngrtran.o \ - pngwtran.o pngmem.o pngerror.o pngpread.o - -OBJSDLL = $(OBJS:.o=.pic.o) - -.SUFFIXES: .c .o .pic.o - -.c.pic.o: - $(CC) -c $(CFLAGS) -KPIC -o $@ $*.c - -all: libpng.a $(LIBNAME).so pngtest libpng.pc libpng-config - -libpng.a: $(OBJS) - ar rc $@ $(OBJS) - $(RANLIB) $@ - -libpng.pc: - cat scripts/libpng.pc.in | sed -e s\!@PREFIX@!$(prefix)! > libpng.pc - -libpng-config: - ( cat scripts/libpng-config-head.in; \ - echo prefix=\"$(prefix)\"; \ - echo I_opts=\"-I$(INCPATH)/$(LIBNAME)\"; \ - echo L_opts=\"-L$(LIBPATH)\"; \ - echo R_opts=\"-R$(LIBPATH)\"; \ - echo libs=\"-lpng12 -lz -lm\"; \ - cat scripts/libpng-config-body.in ) > libpng-config - chmod +x libpng-config - -$(LIBNAME).so: $(LIBNAME).so.$(PNGMAJ) - ln -f -s $(LIBNAME).so.$(PNGMAJ) $(LIBNAME).so - -$(LIBNAME).so.$(PNGMAJ): $(LIBNAME).so.$(PNGVER) - ln -f -s $(LIBNAME).so.$(PNGVER) $(LIBNAME).so.$(PNGMAJ) - -$(LIBNAME).so.$(PNGVER): $(OBJSDLL) - @case "`type ld`" in *ucb*) \ - echo; \ - echo '## WARNING:'; \ - echo '## The commands "CC" and "LD" must NOT refer to /usr/ucb/cc'; \ - echo '## and /usr/ucb/ld. If they do, you need to adjust your PATH'; \ - echo '## environment variable to put /usr/ccs/bin ahead of /usr/ucb.'; \ - echo '## The environment variable LD_LIBRARY_PATH should not be set'; \ - echo '## at all. If it is, things are likely to break because of'; \ - echo '## the libucb dependency that is created.'; \ - echo; \ - ;; \ - esac - $(LD) -G -h $(LIBNAME).so.$(PNGMAJ) \ - -o $(LIBNAME).so.$(PNGVER) $(OBJSDLL) - -libpng.so.3.$(PNGMIN): $(OBJS) - $(LD) -G -h libpng.so.3 \ - -o libpng.so.3.$(PNGMIN) $(OBJSDLL) - -pngtest: pngtest.o $(LIBNAME).so - $(CC) -o pngtest $(CFLAGS) pngtest.o $(LDFLAGS) - -test: pngtest - ./pngtest - -install-headers: png.h pngconf.h - -@if [ ! -d $(DI) ]; then mkdir $(DI); fi - -@if [ ! -d $(DI)/$(LIBNAME) ]; then mkdir $(DI)/$(LIBNAME); fi - cp png.h pngconf.h $(DI)/$(LIBNAME) - chmod 644 $(DI)/$(LIBNAME)/png.h $(DI)/$(LIBNAME)/pngconf.h - -@/bin/rm -f $(DI)/png.h $(DI)/pngconf.h - -@/bin/rm -f $(DI)/libpng - (cd $(DI); ln -f -s $(LIBNAME) libpng; ln -f -s $(LIBNAME)/* .) - -install-static: install-headers libpng.a - -@if [ ! -d $(DL) ]; then mkdir $(DL); fi - cp libpng.a $(DL)/$(LIBNAME).a - chmod 644 $(DL)/$(LIBNAME).a - -@/bin/rm -f $(DL)/libpng.a - (cd $(DL); ln -f -s $(LIBNAME).a libpng.a) - -install-shared: install-headers $(LIBNAME).so.$(PNGVER) libpng.pc \ - libpng.so.3.$(PNGMIN) - -@if [ ! -d $(DL) ]; then mkdir $(DL); fi - -@/bin/rm -f $(DL)/$(LIBNAME).so.$(PNGVER)* $(DL)/$(LIBNAME).so - -@/bin/rm -f $(DL)/$(LIBNAME).so.$(PNGMAJ) - -@/bin/rm -f $(DL)/libpng.so - -@/bin/rm -f $(DL)/libpng.so.3 - -@/bin/rm -f $(DL)/libpng.so.3.$(PNGMIN)* - cp $(LIBNAME).so.$(PNGVER) $(DL) - cp libpng.so.3.$(PNGMIN) $(DL) - chmod 755 $(DL)/$(LIBNAME).so.$(PNGVER) - chmod 755 $(DL)/libpng.so.3.$(PNGMIN) - (cd $(DL); \ - ln -f -s libpng.so.3.$(PNGMIN) libpng.so.3; \ - ln -f -s libpng.so.3 libpng.so; \ - ln -f -s $(LIBNAME).so.$(PNGVER) $(LIBNAME).so.$(PNGMAJ); \ - ln -f -s $(LIBNAME).so.$(PNGMAJ) $(LIBNAME).so) - -@if [ ! -d $(DL)/pkgconfig ]; then mkdir $(DL)/pkgconfig; fi - -@/bin/rm -f $(DL)/pkgconfig/$(LIBNAME).pc - -@/bin/rm -f $(DL)/pkgconfig/libpng.pc - cp libpng.pc $(DL)/pkgconfig/$(LIBNAME).pc - chmod 644 $(DL)/pkgconfig/$(LIBNAME).pc - (cd $(DL)/pkgconfig; ln -f -s $(LIBNAME).pc libpng.pc) - -install-man: libpng.3 libpngpf.3 png.5 - -@if [ ! -d $(DM) ]; then mkdir $(DM); fi - -@if [ ! -d $(DM)/man3 ]; then mkdir $(DM)/man3; fi - -@/bin/rm -f $(DM)/man3/libpng.3 - -@/bin/rm -f $(DM)/man3/libpngpf.3 - cp libpng.3 $(DM)/man3 - cp libpngpf.3 $(DM)/man3 - -@if [ ! -d $(DM)/man5 ]; then mkdir $(DM)/man5; fi - -@/bin/rm -f $(DM)/man5/png.5 - cp png.5 $(DM)/man5 - -install-config: libpng-config - -@if [ ! -d $(DB) ]; then mkdir $(DB); fi - -@/bin/rm -f $(DB)/libpng-config - -@/bin/rm -f $(DB)/$(LIBNAME)-config - cp libpng-config $(DB)/$(LIBNAME)-config - chmod 755 $(DB)/$(LIBNAME)-config - (cd $(DB); ln -f -s $(LIBNAME)-config libpng-config) - -install: install-static install-shared install-man install-config - -# If you installed in $(DESTDIR), test-installed won't work until you -# move the library to its final location. Use test-dd to test it -# before then. - -test-dd: - echo - echo Testing installed dynamic shared library in $(DL). - $(CC) -I$(DI) -I$(ZLIBINC) \ - `$(BINPATH)/libpng12-config --cflags` pngtest.c \ - -o pngtestd `$(BINPATH)/libpng12-config --ldflags` \ - -L$(DL) -L$(ZLIBLIB) -R$(ZLIBLIB) -R$(DL) - ./pngtestd pngtest.png - -test-installed: - echo - echo Testing installed dynamic shared library. - $(CC) -I$(ZLIBINC) \ - `$(BINPATH)/libpng12-config --cflags` pngtest.c \ - -o pngtesti `$(BINPATH)/libpng12-config --ldflags` \ - -L$(ZLIBLIB) -R$(ZLIBLIB) - ./pngtesti pngtest.png - -clean: - /bin/rm -f *.o libpng.a pngtest pngtesti pngout.png \ - libpng-config $(LIBNAME).so $(LIBNAME).so.$(PNGMAJ)* \ - libpng.so.3.$(PNGMIN) \ - libpng.pc - -DOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO -writelock: - chmod a-w *.[ch35] $(DOCS) scripts/* - -# DO NOT DELETE THIS LINE -- make depend depends on it. - -png.o png.pic.o: png.h pngconf.h -pngerror.o pngerror.pic.o: png.h pngconf.h -pngrio.o pngrio.pic.o: png.h pngconf.h -pngwio.o pngwio.pic.o: png.h pngconf.h -pngmem.o pngmem.pic.o: png.h pngconf.h -pngset.o pngset.pic.o: png.h pngconf.h -pngget.o pngget.pic.o: png.h pngconf.h -pngread.o pngread.pic.o: png.h pngconf.h -pngrtran.o pngrtran.pic.o: png.h pngconf.h -pngrutil.o pngrutil.pic.o: png.h pngconf.h -pngtrans.o pngtrans.pic.o: png.h pngconf.h -pngwrite.o pngwrite.pic.o: png.h pngconf.h -pngwtran.o pngwtran.pic.o: png.h pngconf.h -pngwutil.o pngwutil.pic.o: png.h pngconf.h -pngpread.o pngpread.pic.o: png.h pngconf.h - -pngtest.o: png.h pngconf.h diff --git a/wxWidgets/src/png/scripts/makefile.solaris b/wxWidgets/src/png/scripts/makefile.solaris deleted file mode 100644 index 8455c33f6d..0000000000 --- a/wxWidgets/src/png/scripts/makefile.solaris +++ /dev/null @@ -1,231 +0,0 @@ -# makefile for libpng on Solaris 2.x with gcc -# Copyright (C) 2004 Glenn Randers-Pehrson -# Contributed by William L. Sebok, based on makefile.linux -# Copyright (C) 1998 Greg Roelofs -# Copyright (C) 1996, 1997 Andreas Dilger -# For conditions of distribution and use, see copyright notice in png.h - -CC=gcc - -# Where make install puts libpng.a, libpng12.so*, and png.h -prefix=/usr/local - -# Where the zlib library and include files are located -# Changing these to ../zlib poses a security risk. If you want -# to have zlib in an adjacent directory, specify the full path instead of "..". -#ZLIBLIB=../zlib -#ZLIBINC=../zlib - -ZLIBLIB=/usr/local/lib -ZLIBINC=/usr/local/include - -WARNMORE=-Wwrite-strings -Wpointer-arith -Wshadow \ - -Wmissing-declarations -Wtraditional -Wcast-align \ - -Wstrict-prototypes -Wmissing-prototypes #-Wconversion -CFLAGS=-I$(ZLIBINC) -Wall -O \ - # $(WARNMORE) -g -DPNG_DEBUG=5 -LDFLAGS=-L. -R. -L$(ZLIBLIB) -R$(ZLIBLIB) -lpng12 -lz -lm - -#RANLIB=ranlib -RANLIB=echo - -PNGMAJ = 0 -PNGMIN = 1.2.7 -PNGVER = $(PNGMAJ).$(PNGMIN) -LIBNAME = libpng12 - -INCPATH=$(prefix)/include -LIBPATH=$(prefix)/lib -MANPATH=$(prefix)/man -BINPATH=$(prefix)/bin - -# override DESTDIR= on the make install command line to easily support -# installing into a temporary location. Example: -# -# make install DESTDIR=/tmp/build/libpng -# -# If you're going to install into a temporary location -# via DESTDIR, $(DESTDIR)$(prefix) must already exist before -# you execute make install. -DESTDIR= - -DB=$(DESTDIR)$(BINPATH) -DI=$(DESTDIR)$(INCPATH) -DL=$(DESTDIR)$(LIBPATH) -DM=$(DESTDIR)$(MANPATH) - -OBJS = png.o pngset.o pngget.o pngrutil.o pngtrans.o pngwutil.o \ - pngread.o pngrio.o pngwio.o pngwrite.o pngrtran.o \ - pngwtran.o pngmem.o pngerror.o pngpread.o - -OBJSDLL = $(OBJS:.o=.pic.o) - -.SUFFIXES: .c .o .pic.o - -.c.pic.o: - $(CC) -c $(CFLAGS) -fPIC -o $@ $*.c - -all: libpng.a $(LIBNAME).so pngtest libpng.pc libpng-config - -libpng.a: $(OBJS) - ar rc $@ $(OBJS) - $(RANLIB) $@ - -libpng.pc: - cat scripts/libpng.pc.in | sed -e s\!@PREFIX@!$(prefix)! > libpng.pc - -libpng-config: - ( cat scripts/libpng-config-head.in; \ - echo prefix=\"$(prefix)\"; \ - echo I_opts=\"-I$(INCPATH)/$(LIBNAME)\"; \ - echo cppflags=\"-DPNG_USE_PNGGCCRD -DPNG_NO_ASSEMBLER_CODE\"; \ - echo L_opts=\"-L$(LIBPATH)\"; \ - echo R_opts=\"-R$(LIBPATH)\"; \ - echo libs=\"-lpng12 -lz -lm\"; \ - cat scripts/libpng-config-body.in ) > libpng-config - chmod +x libpng-config - -$(LIBNAME).so: $(LIBNAME).so.$(PNGMAJ) - ln -f -s $(LIBNAME).so.$(PNGMAJ) $(LIBNAME).so - -$(LIBNAME).so.$(PNGMAJ): $(LIBNAME).so.$(PNGVER) - ln -f -s $(LIBNAME).so.$(PNGVER) $(LIBNAME).so.$(PNGMAJ) - -$(LIBNAME).so.$(PNGVER): $(OBJSDLL) - @case "`type ld`" in *ucb*) \ - echo; \ - echo '## WARNING:'; \ - echo '## The commands "CC" and "LD" must NOT refer to /usr/ucb/cc'; \ - echo '## and /usr/ucb/ld. If they do, you need to adjust your PATH'; \ - echo '## environment variable to put /usr/ccs/bin ahead of /usr/ucb.'; \ - echo '## The environment variable LD_LIBRARY_PATH should not be set'; \ - echo '## at all. If it is, things are likely to break because of'; \ - echo '## the libucb dependency that is created.'; \ - echo; \ - ;; \ - esac - $(LD) -G -h $(LIBNAME).so.$(PNGMAJ) \ - -o $(LIBNAME).so.$(PNGVER) $(OBJSDLL) - -libpng.so.3.$(PNGMIN): $(OBJS) - $(LD) -G -h libpng.so.3 \ - -o libpng.so.3.$(PNGMIN) $(OBJSDLL) - -pngtest: pngtest.o $(LIBNAME).so - $(CC) -o pngtest $(CFLAGS) pngtest.o $(LDFLAGS) - -test: pngtest - ./pngtest - -install-headers: png.h pngconf.h - -@if [ ! -d $(DI) ]; then mkdir $(DI); fi - -@if [ ! -d $(DI)/$(LIBNAME) ]; then mkdir $(DI)/$(LIBNAME); fi - cp png.h pngconf.h $(DI)/$(LIBNAME) - chmod 644 $(DI)/$(LIBNAME)/png.h $(DI)/$(LIBNAME)/pngconf.h - -@/bin/rm -f $(DI)/png.h $(DI)/pngconf.h - -@/bin/rm -f $(DI)/libpng - (cd $(DI); ln -f -s $(LIBNAME) libpng; ln -f -s $(LIBNAME)/* .) - -install-static: install-headers libpng.a - -@if [ ! -d $(DL) ]; then mkdir $(DL); fi - cp libpng.a $(DL)/$(LIBNAME).a - chmod 644 $(DL)/$(LIBNAME).a - -@/bin/rm -f $(DL)/libpng.a - (cd $(DL); ln -f -s $(LIBNAME).a libpng.a) - -install-shared: install-headers $(LIBNAME).so.$(PNGVER) libpng.pc \ - libpng.so.3.$(PNGMIN) - -@if [ ! -d $(DL) ]; then mkdir $(DL); fi - -@/bin/rm -f $(DL)/$(LIBNAME).so.$(PNGVER)* $(DL)/$(LIBNAME).so - -@/bin/rm -f $(DL)/$(LIBNAME).so.$(PNGMAJ) - -@/bin/rm -f $(DL)/libpng.so - -@/bin/rm -f $(DL)/libpng.so.3 - -@/bin/rm -f $(DL)/libpng.so.3.$(PNGMIN)* - cp $(LIBNAME).so.$(PNGVER) $(DL) - cp libpng.so.3.$(PNGMIN) $(DL) - chmod 755 $(DL)/$(LIBNAME).so.$(PNGVER) - chmod 755 $(DL)/libpng.so.3.$(PNGMIN) - (cd $(DL); \ - ln -f -s libpng.so.3.$(PNGMIN) libpng.so.3; \ - ln -f -s libpng.so.3 libpng.so; \ - ln -f -s $(LIBNAME).so.$(PNGVER) $(LIBNAME).so; \ - ln -f -s $(LIBNAME).so.$(PNGVER) $(LIBNAME).so.$(PNGMAJ)) - -@if [ ! -d $(DL)/pkgconfig ]; then mkdir $(DL)/pkgconfig; fi - -@/bin/rm -f $(DL)/pkgconfig/$(LIBNAME).pc - -@/bin/rm -f $(DL)/pkgconfig/libpng.pc - cp libpng.pc $(DL)/pkgconfig/$(LIBNAME).pc - chmod 644 $(DL)/pkgconfig/$(LIBNAME).pc - (cd $(DL)/pkgconfig; ln -f -s $(LIBNAME).pc libpng.pc) - -install-man: libpng.3 libpngpf.3 png.5 - -@if [ ! -d $(DM) ]; then mkdir $(DM); fi - -@if [ ! -d $(DM)/man3 ]; then mkdir $(DM)/man3; fi - -@/bin/rm -f $(DM)/man3/libpng.3 - -@/bin/rm -f $(DM)/man3/libpngpf.3 - cp libpng.3 $(DM)/man3 - cp libpngpf.3 $(DM)/man3 - -@if [ ! -d $(DM)/man5 ]; then mkdir $(DM)/man5; fi - -@/bin/rm -f $(DM)/man5/png.5 - cp png.5 $(DM)/man5 - -install-config: libpng-config - -@if [ ! -d $(DB) ]; then mkdir $(DB); fi - -@/bin/rm -f $(DB)/libpng-config - -@/bin/rm -f $(DB)/$(LIBNAME)-config - cp libpng-config $(DB)/$(LIBNAME)-config - chmod 755 $(DB)/$(LIBNAME)-config - (cd $(DB); ln -s -f $(LIBNAME)-config libpng-config) - -install: install-static install-shared install-man install-config - -# If you installed in $(DESTDIR), test-installed won't work until you -# move the library to its final location. Use test-dd to test it -# before then. - -test-dd: - echo - echo Testing installed dynamic shared library in $(DL). - $(CC) -I$(DI) -I$(ZLIBINC) \ - `$(BINPATH)/libpng12-config --cflags` pngtest.c \ - -o pngtestd `$(BINPATH)/libpng12-config --ldflags` \ - -L$(DL) -L$(ZLIBLIB) -R$(ZLIBLIB) -R$(DL) - ./pngtestd pngtest.png - -test-installed: - echo - echo Testing installed dynamic shared library. - $(CC) -I$(ZLIBINC) \ - `$(BINPATH)/libpng12-config --cflags` pngtest.c \ - -o pngtesti `$(BINPATH)/libpng12-config --ldflags` \ - -L$(ZLIBLIB) -R$(ZLIBLIB) - ./pngtesti pngtest.png - -clean: - /bin/rm -f *.o libpng.a pngtest pngtesti pngout.png \ - libpng-config $(LIBNAME).so $(LIBNAME).so.$(PNGMAJ)* \ - libpng.so.3.$(PNGMIN) \ - libpng.pc - -DOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO -writelock: - chmod a-w *.[ch35] $(DOCS) scripts/* - -# DO NOT DELETE THIS LINE -- make depend depends on it. - -png.o png.pic.o: png.h pngconf.h -pngerror.o pngerror.pic.o: png.h pngconf.h -pngrio.o pngrio.pic.o: png.h pngconf.h -pngwio.o pngwio.pic.o: png.h pngconf.h -pngmem.o pngmem.pic.o: png.h pngconf.h -pngset.o pngset.pic.o: png.h pngconf.h -pngget.o pngget.pic.o: png.h pngconf.h -pngread.o pngread.pic.o: png.h pngconf.h -pngrtran.o pngrtran.pic.o: png.h pngconf.h -pngrutil.o pngrutil.pic.o: png.h pngconf.h -pngtrans.o pngtrans.pic.o: png.h pngconf.h -pngwrite.o pngwrite.pic.o: png.h pngconf.h -pngwtran.o pngwtran.pic.o: png.h pngconf.h -pngwutil.o pngwutil.pic.o: png.h pngconf.h -pngpread.o pngpread.pic.o: png.h pngconf.h - -pngtest.o: png.h pngconf.h diff --git a/wxWidgets/src/png/scripts/makefile.std b/wxWidgets/src/png/scripts/makefile.std deleted file mode 100644 index 5d1f5290d1..0000000000 --- a/wxWidgets/src/png/scripts/makefile.std +++ /dev/null @@ -1,89 +0,0 @@ -# makefile for libpng -# Copyright (C) 2002 Glenn Randers-Pehrson -# Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc. -# For conditions of distribution and use, see copyright notice in png.h - -# where make install puts libpng.a and png.h -prefix=/usr/local -INCPATH=$(prefix)/include -LIBPATH=$(prefix)/lib - -# override DESTDIR= on the make install command line to easily support -# installing into a temporary location. Example: -# -# make install DESTDIR=/tmp/build/libpng -# -# If you're going to install into a temporary location -# via DESTDIR, $(DESTDIR)$(prefix) must already exist before -# you execute make install. -DESTDIR= - -# Where the zlib library and include files are located -#ZLIBLIB=/usr/local/lib -#ZLIBINC=/usr/local/include -ZLIBLIB=../zlib -ZLIBINC=../zlib - -CC=cc -CFLAGS=-I$(ZLIBINC) -O # -g -DPNG_DEBUG=5 -LDFLAGS=-L. -L$(ZLIBLIB) -lpng -lz -lm - -#RANLIB=echo -RANLIB=ranlib - -OBJS = png.o pngset.o pngget.o pngrutil.o pngtrans.o pngwutil.o \ - pngread.o pngrio.o pngwio.o pngwrite.o pngrtran.o \ - pngwtran.o pngmem.o pngerror.o pngpread.o - -all: libpng.a pngtest - -libpng.a: $(OBJS) - ar rc $@ $(OBJS) - $(RANLIB) $@ - -pngtest: pngtest.o libpng.a - $(CC) -o pngtest $(CFLAGS) pngtest.o $(LDFLAGS) - -test: pngtest - ./pngtest - -install: libpng.a - -@mkdir $(DESTDIR)$(INCPATH) - -@mkdir $(DESTDIR)$(INCPATH)/libpng - -@mkdir $(DESTDIR)$(LIBPATH) - -@rm -f $(DESTDIR)$(INCPATH)/png.h - -@rm -f $(DESTDIR)$(INCPATH)/pngconf.h - cp png.h $(DESTDIR)$(INCPATH)/libpng - cp pngconf.h $(DESTDIR)$(INCPATH)/libpng - chmod 644 $(DESTDIR)$(INCPATH)/libpng/png.h - chmod 644 $(DESTDIR)$(INCPATH)/libpng/pngconf.h - (cd $(DESTDIR)$(INCPATH); ln -f -s libpng/* .) - cp libpng.a $(DESTDIR)$(LIBPATH) - chmod 644 $(DESTDIR)$(LIBPATH)/libpng.a - -clean: - rm -f *.o libpng.a pngtest pngout.png - -DOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO -writelock: - chmod a-w *.[ch35] $(DOCS) scripts/* - -# DO NOT DELETE THIS LINE -- make depend depends on it. - -png.o: png.h pngconf.h -pngerror.o: png.h pngconf.h -pngrio.o: png.h pngconf.h -pngwio.o: png.h pngconf.h -pngmem.o: png.h pngconf.h -pngset.o: png.h pngconf.h -pngget.o: png.h pngconf.h -pngread.o: png.h pngconf.h -pngrtran.o: png.h pngconf.h -pngrutil.o: png.h pngconf.h -pngtest.o: png.h pngconf.h -pngtrans.o: png.h pngconf.h -pngwrite.o: png.h pngconf.h -pngwtran.o: png.h pngconf.h -pngwutil.o: png.h pngconf.h -pngpread.o: png.h pngconf.h - diff --git a/wxWidgets/src/png/scripts/makefile.sunos b/wxWidgets/src/png/scripts/makefile.sunos deleted file mode 100644 index 70a6e88af7..0000000000 --- a/wxWidgets/src/png/scripts/makefile.sunos +++ /dev/null @@ -1,93 +0,0 @@ -# makefile for libpng -# Copyright (C) 2002 Glenn Randers-Pehrson -# Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc. -# For conditions of distribution and use, see copyright notice in png.h - -# where make install puts libpng.a and png.h -prefix=/usr/local -INCPATH=$(prefix)/include -LIBPATH=$(prefix)/lib - -# override DESTDIR= on the make install command line to easily support -# installing into a temporary location. Example: -# -# make install DESTDIR=/tmp/build/libpng -# -# If you're going to install into a temporary location -# via DESTDIR, $(DESTDIR)$(prefix) must already exist before -# you execute make install. -DESTDIR= - -# Where the zlib library and include files are located -#ZLIBLIB=/usr/local/lib -#ZLIBINC=/usr/local/include -ZLIBLIB=../zlib -ZLIBINC=../zlib - - -WARNMORE=-Wwrite-strings -Wpointer-arith -Wshadow -Wconversion \ - -Wmissing-declarations -Wtraditional -Wcast-align \ - -Wstrict-prototypes -Wmissing-prototypes -CC=gcc -CFLAGS=-I$(ZLIBINC) -O # $(WARNMORE) -DPNG_DEBUG=5 -LDFLAGS=-L. -L$(ZLIBLIB) -lpng -lz -lm - -RANLIB=ranlib -#RANLIB=echo - -OBJS = png.o pngset.o pngget.o pngrutil.o pngtrans.o pngwutil.o \ - pngread.o pngrio.o pngwio.o pngwrite.o pngrtran.o \ - pngwtran.o pngmem.o pngerror.o pngpread.o - -all: libpng.a pngtest - -libpng.a: $(OBJS) - ar rc $@ $(OBJS) - $(RANLIB) $@ - -pngtest: pngtest.o libpng.a - $(CC) -o pngtest $(CFLAGS) pngtest.o $(LDFLAGS) - -test: pngtest - ./pngtest - -install: libpng.a - -@mkdir $(DESTDIR)$(INCPATH) - -@mkdir $(DESTDIR)$(INCPATH)/libpng - -@mkdir $(DESTDIR)$(LIBPATH) - -@rm -f $(DESTDIR)$(INCPATH)/png.h - -@rm -f $(DESTDIR)$(INCPATH)/pngconf.h - cp png.h $(DESTDIR)$(INCPATH)/libpng - cp pngconf.h $(DESTDIR)$(INCPATH)/libpng - chmod 644 $(DESTDIR)$(INCPATH)/libpng/png.h - chmod 644 $(DESTDIR)$(INCPATH)/libpng/pngconf.h - (cd $(DESTDIR)$(INCPATH); ln -f -s libpng/* .) - cp libpng.a $(DESTDIR)$(LIBPATH) - chmod 644 $(DESTDIR)$(LIBPATH)/libpng.a - -clean: - rm -f *.o libpng.a pngtest pngout.png - -DOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO -writelock: - chmod a-w *.[ch35] $(DOCS) scripts/* - -# DO NOT DELETE THIS LINE -- make depend depends on it. - -png.o: png.h pngconf.h -pngerror.o: png.h pngconf.h -pngrio.o: png.h pngconf.h -pngwio.o: png.h pngconf.h -pngmem.o: png.h pngconf.h -pngset.o: png.h pngconf.h -pngget.o: png.h pngconf.h -pngread.o: png.h pngconf.h -pngrtran.o: png.h pngconf.h -pngrutil.o: png.h pngconf.h -pngtest.o: png.h pngconf.h -pngtrans.o: png.h pngconf.h -pngwrite.o: png.h pngconf.h -pngwtran.o: png.h pngconf.h -pngwutil.o: png.h pngconf.h -pngpread.o: png.h pngconf.h - diff --git a/wxWidgets/src/png/scripts/makefile.tc3 b/wxWidgets/src/png/scripts/makefile.tc3 deleted file mode 100644 index 21435a68ed..0000000000 --- a/wxWidgets/src/png/scripts/makefile.tc3 +++ /dev/null @@ -1,89 +0,0 @@ -# Makefile for libpng -# TurboC/C++ (Note: All modules are compiled in C mode) - -# To use, do "make -fmakefile.tc3" - -# ----- Turbo C 3.00 (can be modified to work with earlier versions) ----- - -MODEL=l -CFLAGS=-O2 -Z -m$(MODEL) -I..\zlib -#CFLAGS=-D_NO_PROTO -O2 -Z -m$(MODEL) -I..\zlib # Turbo C older than 3.00 -CC=tcc -LD=tcc -LIB=tlib -LDFLAGS=-m$(MODEL) -L..\zlib -O=.obj -E=.exe - -# variables -OBJS1 = png$(O) pngset$(O) pngget$(O) pngrutil$(O) pngtrans$(O) pngwutil$(O) -OBJS2 = pngmem$(O) pngpread$(O) pngread$(O) pngerror$(O) pngwrite$(O) -OBJS3 = pngrtran$(O) pngwtran$(O) pngrio$(O) pngwio$(O) -OBJSL1 = +png$(O) +pngset$(O) +pngget$(O) +pngrutil$(O) +pngtrans$(O) -OBJSL2 = +pngwutil$(O) +pngmem$(O) +pngpread$(O) +pngread$(O) +pngerror$(O) -OBJSL3 = +pngwrite$(O) +pngrtran$(O) +pngwtran$(O) +pngrio$(O) +pngwio$(O) - -all: libpng$(MODEL).lib pngtest$(E) - -pngtest: pngtest$(E) - -test: pngtest$(E) - pngtest$(E) - -png$(O): png.h pngconf.h - $(CC) -c $(CFLAGS) $*.c - -pngset$(O): png.h pngconf.h - $(CC) -c $(CFLAGS) $*.c - -pngget$(O): png.h pngconf.h - $(CC) -c $(CFLAGS) $*.c - -pngread$(O): png.h pngconf.h - $(CC) -c $(CFLAGS) $*.c - -pngpread$(O): png.h pngconf.h - $(CC) -c $(CFLAGS) $*.c - -pngrtran$(O): png.h pngconf.h - $(CC) -c $(CFLAGS) $*.c - -pngrutil$(O): png.h pngconf.h - $(CC) -c $(CFLAGS) $*.c - -pngerror$(O): png.h pngconf.h - $(CC) -c $(CFLAGS) $*.c - -pngmem$(O): png.h pngconf.h - $(CC) -c $(CFLAGS) $*.c - -pngrio$(O): png.h pngconf.h - $(CC) -c $(CFLAGS) $*.c - -pngwio$(O): png.h pngconf.h - $(CC) -c $(CFLAGS) $*.c - -pngtest$(O): png.h pngconf.h - $(CC) -c $(CFLAGS) $*.c - -pngtrans$(O): png.h pngconf.h - $(CC) -c $(CFLAGS) $*.c - -pngwrite$(O): png.h pngconf.h - $(CC) -c $(CFLAGS) $*.c - -pngwtran$(O): png.h pngconf.h - $(CC) -c $(CFLAGS) $*.c - -pngwutil$(O): png.h pngconf.h - $(CC) -c $(CFLAGS) $*.c - -libpng$(MODEL).lib: $(OBJS1) $(OBJS2) $(OBJS3) - $(LIB) libpng$(MODEL) +$(OBJSL1) - $(LIB) libpng$(MODEL) +$(OBJSL2) - $(LIB) libpng$(MODEL) +$(OBJSL3) - -pngtest$(E): pngtest$(O) libpng$(MODEL).lib - $(LD) $(LDFLAGS) pngtest.obj libpng$(MODEL).lib zlib_$(MODEL).lib - -# End of makefile for libpng diff --git a/wxWidgets/src/png/scripts/makefile.vcawin32 b/wxWidgets/src/png/scripts/makefile.vcawin32 deleted file mode 100644 index 4c2f3cc0ee..0000000000 --- a/wxWidgets/src/png/scripts/makefile.vcawin32 +++ /dev/null @@ -1,103 +0,0 @@ -# makefile for libpng -# Copyright (C) 1998 Tim Wegner -# For conditions of distribution and use, see copyright notice in png.h -# Assumes that zlib.lib, zconf.h, and zlib.h have been copied to ..\zlib -# To use, do "nmake /f scripts\makefile.vcawin32" - -# -------- Microsoft Visual C++ 5.0 and later, uses assembler code -------- -# If you don't want to use assembler (MMX) code, use makefile.vcwin32 instead. - -# Compiler, linker, librarian, and other tools -CC = cl -LD = link -AR = lib -CFLAGS = -DPNG_USE_PNGVCRD -nologo -MD -O2 -W3 -I..\zlib -LDFLAGS = -nologo -ARFLAGS = -nologo -RM = del - -# File extensions -O=.obj - -#uncomment next to put error messages in a file -#ERRFILE= >> pngerrs.log - -# Variables -OBJS1 = png$(O) pngerror$(O) pngget$(O) pngmem$(O) pngpread$(O) -OBJS2 = pngread$(O) pngrio$(O) pngrtran$(O) pngrutil$(O) pngset$(O) -OBJS3 = pngtrans$(O) pngwio$(O) pngwrite$(O) pngwtran$(O) pngwutil$(O) -OBJS4 = pngvcrd$(O) -OBJS = $(OBJS1) $(OBJS2) $(OBJS3) $(OBJS4) - -# Targets -all: libpng.lib - -png$(O): png.h pngconf.h - $(CC) -c $(CFLAGS) $*.c $(ERRFILE) - -pngset$(O): png.h pngconf.h - $(CC) -c $(CFLAGS) $*.c $(ERRFILE) - -pngget$(O): png.h pngconf.h - $(CC) -c $(CFLAGS) $*.c $(ERRFILE) - -pngread$(O): png.h pngconf.h - $(CC) -c $(CFLAGS) $*.c $(ERRFILE) - -pngpread$(O): png.h pngconf.h - $(CC) -c $(CFLAGS) $*.c $(ERRFILE) - -pngrtran$(O): png.h pngconf.h - $(CC) -c $(CFLAGS) $*.c $(ERRFILE) - -pngrutil$(O): png.h pngconf.h - $(CC) -c $(CFLAGS) $*.c $(ERRFILE) - -pngerror$(O): png.h pngconf.h - $(CC) -c $(CFLAGS) $*.c $(ERRFILE) - -pngmem$(O): png.h pngconf.h - $(CC) -c $(CFLAGS) $*.c $(ERRFILE) - -pngrio$(O): png.h pngconf.h - $(CC) -c $(CFLAGS) $*.c $(ERRFILE) - -pngwio$(O): png.h pngconf.h - $(CC) -c $(CFLAGS) $*.c $(ERRFILE) - -pngtest$(O): png.h pngconf.h - $(CC) -c $(CFLAGS) $*.c $(ERRFILE) - -pngtrans$(O): png.h pngconf.h - $(CC) -c $(CFLAGS) $*.c $(ERRFILE) - -pngwrite$(O): png.h pngconf.h - $(CC) -c $(CFLAGS) $*.c $(ERRFILE) - -pngwtran$(O): png.h pngconf.h - $(CC) -c $(CFLAGS) $*.c $(ERRFILE) - -pngwutil$(O): png.h pngconf.h - $(CC) -c $(CFLAGS) $*.c $(ERRFILE) - -pngvcrd$(O): png.h pngconf.h - $(CC) -c $(CFLAGS) $*.c $(ERRFILE) - -libpng.lib: $(OBJS) - -$(RM) $@ - $(AR) $(ARFLAGS) -out:$@ $(OBJS) $(ERRFILE) - -pngtest.exe: pngtest$(O) libpng.lib - $(LD) $(LDFLAGS) -out:$@ pngtest$(O) libpng.lib ..\zlib\zlib.lib $(ERRFILE) - -test: pngtest.exe - pngtest - -clean: - -$(RM) *$(O) - -$(RM) libpng.lib - -$(RM) pngtest.exe - -$(RM) pngout.png - -# End of makefile for libpng - diff --git a/wxWidgets/src/png/scripts/makefile.vcwin32 b/wxWidgets/src/png/scripts/makefile.vcwin32 deleted file mode 100644 index d23d81296c..0000000000 --- a/wxWidgets/src/png/scripts/makefile.vcwin32 +++ /dev/null @@ -1,99 +0,0 @@ -# makefile for libpng -# Copyright (C) 1998 Tim Wegner -# For conditions of distribution and use, see copyright notice in png.h -# Assumes that zlib.lib, zconf.h, and zlib.h have been copied to ..\zlib -# To use, do "nmake /f scripts\makefile.vcwin32" - -# -------- Microsoft Visual C++ 2.0 and later, no assembler code -------- -# If you want to use assembler (MMX) code, use makefile.vcawin32 instead. - -# Compiler, linker, librarian, and other tools -CC = cl -LD = link -AR = lib -CFLAGS = -nologo -MD -O2 -W3 -I..\zlib -LDFLAGS = -nologo -ARFLAGS = -nologo -RM = del - -# File extensions -O=.obj - -#uncomment next to put error messages in a file -#ERRFILE= >> pngerrs.log - -# Variables -OBJS1 = png$(O) pngerror$(O) pngget$(O) pngmem$(O) pngpread$(O) -OBJS2 = pngread$(O) pngrio$(O) pngrtran$(O) pngrutil$(O) pngset$(O) -OBJS3 = pngtrans$(O) pngwio$(O) pngwrite$(O) pngwtran$(O) pngwutil$(O) -OBJS = $(OBJS1) $(OBJS2) $(OBJS3) - -# Targets -all: libpng.lib - -png$(O): png.h pngconf.h - $(CC) -c $(CFLAGS) $*.c $(ERRFILE) - -pngset$(O): png.h pngconf.h - $(CC) -c $(CFLAGS) $*.c $(ERRFILE) - -pngget$(O): png.h pngconf.h - $(CC) -c $(CFLAGS) $*.c $(ERRFILE) - -pngread$(O): png.h pngconf.h - $(CC) -c $(CFLAGS) $*.c $(ERRFILE) - -pngpread$(O): png.h pngconf.h - $(CC) -c $(CFLAGS) $*.c $(ERRFILE) - -pngrtran$(O): png.h pngconf.h - $(CC) -c $(CFLAGS) $*.c $(ERRFILE) - -pngrutil$(O): png.h pngconf.h - $(CC) -c $(CFLAGS) $*.c $(ERRFILE) - -pngerror$(O): png.h pngconf.h - $(CC) -c $(CFLAGS) $*.c $(ERRFILE) - -pngmem$(O): png.h pngconf.h - $(CC) -c $(CFLAGS) $*.c $(ERRFILE) - -pngrio$(O): png.h pngconf.h - $(CC) -c $(CFLAGS) $*.c $(ERRFILE) - -pngwio$(O): png.h pngconf.h - $(CC) -c $(CFLAGS) $*.c $(ERRFILE) - -pngtest$(O): png.h pngconf.h - $(CC) -c $(CFLAGS) $*.c $(ERRFILE) - -pngtrans$(O): png.h pngconf.h - $(CC) -c $(CFLAGS) $*.c $(ERRFILE) - -pngwrite$(O): png.h pngconf.h - $(CC) -c $(CFLAGS) $*.c $(ERRFILE) - -pngwtran$(O): png.h pngconf.h - $(CC) -c $(CFLAGS) $*.c $(ERRFILE) - -pngwutil$(O): png.h pngconf.h - $(CC) -c $(CFLAGS) $*.c $(ERRFILE) - -libpng.lib: $(OBJS) - -$(RM) $@ - $(AR) $(ARFLAGS) -out:$@ $(OBJS) $(ERRFILE) - -pngtest.exe: pngtest$(O) libpng.lib - $(LD) $(LDFLAGS) -out:$@ pngtest$(O) libpng.lib ..\zlib\zlib.lib $(ERRFILE) - -test: pngtest.exe - pngtest - -clean: - -$(RM) *$(O) - -$(RM) libpng.lib - -$(RM) pngtest.exe - -$(RM) pngout.png - -# End of makefile for libpng - diff --git a/wxWidgets/src/png/scripts/makefile.watcom b/wxWidgets/src/png/scripts/makefile.watcom deleted file mode 100644 index 5e860fc06c..0000000000 --- a/wxWidgets/src/png/scripts/makefile.watcom +++ /dev/null @@ -1,109 +0,0 @@ -# Makefile for libpng -# Watcom C/C++ 10.0 and later, 32-bit protected mode, flat memory model - -# Copyright (C) 2000, Pawel Mrochen, based on makefile.msc which is -# copyright 1995 Guy Eric Schalnat, Group 42, Inc. -# For conditions of distribution and use, see copyright notice in png.h - -# To use, do "wmake /f scripts\makefile.watcom" - - -# ---------------------- Watcom C/C++ 10.0 and later ----------------------- - -# Where the zlib library and include files are located -ZLIBLIB=..\zlib -ZLIBINC=..\zlib - -# Target OS -OS=DOS -#OS=NT - -# Target CPU -CPU=6 # Pentium Pro -#CPU=5 # Pentium - -# Calling convention -CALLING=r # registers -#CALLING=s # stack - -# Uncomment next to put error messages in a file -#ERRFILE=>>pngerrs - -# -------------------------------------------------------------------------- - - -CC=wcc386 -CFLAGS=-$(CPU)$(CALLING) -fp$(CPU) -fpi87 -oneatx -mf -bt=$(OS) -i=$(ZLIBINC) -zq -LD=wcl386 -LDFLAGS=-zq - -O=.obj - -OBJS1=png$(O) pngset$(O) pngget$(O) pngrutil$(O) pngtrans$(O) pngwutil$(O) -OBJS2=pngmem$(O) pngpread$(O) pngread$(O) pngerror$(O) pngwrite$(O) -OBJS3=pngrtran$(O) pngwtran$(O) pngrio$(O) pngwio$(O) - - -all: test - -png$(O): png.h pngconf.h - $(CC) $(CFLAGS) $*.c $(ERRFILE) - -pngset$(O): png.h pngconf.h - $(CC) $(CFLAGS) $*.c $(ERRFILE) - -pngget$(O): png.h pngconf.h - $(CC) $(CFLAGS) $*.c $(ERRFILE) - -pngread$(O): png.h pngconf.h - $(CC) $(CFLAGS) $*.c $(ERRFILE) - -pngpread$(O): png.h pngconf.h - $(CC) $(CFLAGS) $*.c $(ERRFILE) - -pngrtran$(O): png.h pngconf.h - $(CC) $(CFLAGS) $*.c $(ERRFILE) - -pngrutil$(O): png.h pngconf.h - $(CC) $(CFLAGS) $*.c $(ERRFILE) - -pngerror$(O): png.h pngconf.h - $(CC) $(CFLAGS) $*.c $(ERRFILE) - -pngmem$(O): png.h pngconf.h - $(CC) $(CFLAGS) $*.c $(ERRFILE) - -pngrio$(O): png.h pngconf.h - $(CC) $(CFLAGS) $*.c $(ERRFILE) - -pngwio$(O): png.h pngconf.h - $(CC) $(CFLAGS) $*.c $(ERRFILE) - -pngtest$(O): png.h pngconf.h - $(CC) $(CFLAGS) $*.c $(ERRFILE) - -pngtrans$(O): png.h pngconf.h - $(CC) $(CFLAGS) $*.c $(ERRFILE) - -pngwrite$(O): png.h pngconf.h - $(CC) $(CFLAGS) $*.c $(ERRFILE) - -pngwtran$(O): png.h pngconf.h - $(CC) $(CFLAGS) $*.c $(ERRFILE) - -pngwutil$(O): png.h pngconf.h - $(CC) $(CFLAGS) $*.c $(ERRFILE) - -libpng.lib: $(OBJS1) $(OBJS2) $(OBJS3) - wlib -b -c -n -q libpng.lib $(OBJS1) - wlib -b -c -q libpng.lib $(OBJS2) - wlib -b -c -q libpng.lib $(OBJS3) - -pngtest.exe: pngtest.obj libpng.lib - $(LD) $(LDFLAGS) pngtest.obj libpng.lib $(ZLIBLIB)\zlib.lib - -test: pngtest.exe .symbolic - pngtest.exe - - -# End of makefile for libpng diff --git a/wxWidgets/src/png/scripts/makevms.com b/wxWidgets/src/png/scripts/makevms.com deleted file mode 100644 index b9e389555e..0000000000 --- a/wxWidgets/src/png/scripts/makevms.com +++ /dev/null @@ -1,144 +0,0 @@ -$! make libpng under VMS -$! -$! -$! Check for MMK/MMS -$! -$! This procedure accepts one parameter (contrib), which causes it to build -$! the programs from the contrib directory instead of libpng. -$! -$ p1 = f$edit(p1,"UPCASE") -$ if p1 .eqs. "CONTRIB" -$ then -$ set def [.contrib.gregbook] -$ @makevms -$ set def [-.pngminus] -$ @makevms -$ set def [--] -$ exit -$ endif -$ Make = "" -$ If F$Search ("Sys$System:MMS.EXE") .nes. "" Then Make = "MMS" -$ If F$Type (MMK) .eqs. "STRING" Then Make = "MMK" -$! -$! Look for the compiler used -$! -$ zlibsrc = "[-.zlib]" -$ ccopt="/include=''zlibsrc'" -$ if f$getsyi("HW_MODEL").ge.1024 -$ then -$ ccopt = "/prefix=all"+ccopt -$ comp = "__decc__=1" -$ if f$trnlnm("SYS").eqs."" then define sys sys$library: -$ else -$ if f$search("SYS$SYSTEM:DECC$COMPILER.EXE").eqs."" -$ then -$ if f$trnlnm("SYS").eqs."" then define sys sys$library: -$ if f$search("SYS$SYSTEM:VAXC.EXE").eqs."" -$ then -$ comp = "__gcc__=1" -$ CC :== GCC -$ else -$ comp = "__vaxc__=1" -$ endif -$ else -$ if f$trnlnm("SYS").eqs."" then define sys decc$library_include: -$ ccopt = "/decc/prefix=all"+ccopt -$ comp = "__decc__=1" -$ endif -$ endif -$! -$! Build the thing plain or with mms/mmk -$! -$ write sys$output "Compiling Libpng sources ..." -$ if make.eqs."" -$ then -$ dele pngtest.obj;* -$ CALL MAKE png.OBJ "cc ''CCOPT' png" - - png.c png.h pngconf.h -$ CALL MAKE pngpread.OBJ "cc ''CCOPT' pngpread" - - pngpread.c png.h pngconf.h -$ CALL MAKE pngset.OBJ "cc ''CCOPT' pngset" - - pngset.c png.h pngconf.h -$ CALL MAKE pngget.OBJ "cc ''CCOPT' pngget" - - pngget.c png.h pngconf.h -$ CALL MAKE pngread.OBJ "cc ''CCOPT' pngread" - - pngread.c png.h pngconf.h -$ CALL MAKE pngpread.OBJ "cc ''CCOPT' pngpread" - - pngpread.c png.h pngconf.h -$ CALL MAKE pngrtran.OBJ "cc ''CCOPT' pngrtran" - - pngrtran.c png.h pngconf.h -$ CALL MAKE pngrutil.OBJ "cc ''CCOPT' pngrutil" - - pngrutil.c png.h pngconf.h -$ CALL MAKE pngerror.OBJ "cc ''CCOPT' pngerror" - - pngerror.c png.h pngconf.h -$ CALL MAKE pngmem.OBJ "cc ''CCOPT' pngmem" - - pngmem.c png.h pngconf.h -$ CALL MAKE pngrio.OBJ "cc ''CCOPT' pngrio" - - pngrio.c png.h pngconf.h -$ CALL MAKE pngwio.OBJ "cc ''CCOPT' pngwio" - - pngwio.c png.h pngconf.h -$ CALL MAKE pngtrans.OBJ "cc ''CCOPT' pngtrans" - - pngtrans.c png.h pngconf.h -$ CALL MAKE pngwrite.OBJ "cc ''CCOPT' pngwrite" - - pngwrite.c png.h pngconf.h -$ CALL MAKE pngwtran.OBJ "cc ''CCOPT' pngwtran" - - pngwtran.c png.h pngconf.h -$ CALL MAKE pngwutil.OBJ "cc ''CCOPT' pngwutil" - - pngwutil.c png.h pngconf.h -$ write sys$output "Building Libpng ..." -$ CALL MAKE libpng.OLB "lib/crea libpng.olb *.obj" *.OBJ -$ write sys$output "Building pngtest..." -$ CALL MAKE pngtest.OBJ "cc ''CCOPT' pngtest" - - pngtest.c png.h pngconf.h -$ call make pngtest.exe - - "LINK pngtest,libpng.olb/lib,''zlibsrc'libz.olb/lib" - - pngtest.obj libpng.olb -$ write sys$output "Testing Libpng..." -$ run pngtest -$ else -$ if f$search("DESCRIP.MMS") .eqs. "" then copy/nolog [.SCRIPTS]DESCRIP.MMS [] -$ 'make'/macro=('comp',zlibsrc='zlibsrc') -$ endif -$ write sys$output "Libpng build completed" -$ exit -$! -$! -$MAKE: SUBROUTINE !SUBROUTINE TO CHECK DEPENDENCIES -$ V = 'F$Verify(0) -$! P1 = What we are trying to make -$! P2 = Command to make it -$! P3 - P8 What it depends on -$ -$ If F$Search(P1) .Eqs. "" Then Goto Makeit -$ Time = F$CvTime(F$File(P1,"RDT")) -$arg=3 -$Loop: -$ Argument = P'arg -$ If Argument .Eqs. "" Then Goto Exit -$ El=0 -$Loop2: -$ File = F$Element(El," ",Argument) -$ If File .Eqs. " " Then Goto Endl -$ AFile = "" -$Loop3: -$ OFile = AFile -$ AFile = F$Search(File) -$ If AFile .Eqs. "" .Or. AFile .Eqs. OFile Then Goto NextEl -$ If F$CvTime(F$File(AFile,"RDT")) .Ges. Time Then Goto Makeit -$ Goto Loop3 -$NextEL: -$ El = El + 1 -$ Goto Loop2 -$EndL: -$ arg=arg+1 -$ If arg .Le. 8 Then Goto Loop -$ Goto Exit -$ -$Makeit: -$ VV=F$VERIFY(0) -$ write sys$output P2 -$ 'P2 -$ VV='F$Verify(VV) -$Exit: -$ If V Then Set Verify -$ENDSUBROUTINE diff --git a/wxWidgets/src/png/scripts/pngos2.def b/wxWidgets/src/png/scripts/pngos2.def deleted file mode 100644 index 1b75bc6036..0000000000 --- a/wxWidgets/src/png/scripts/pngos2.def +++ /dev/null @@ -1,248 +0,0 @@ -;---------------------------------------- -; PNG.LIB module definition file for OS/2 -;---------------------------------------- - -; Version 1.2.7 - -LIBRARY PNG -DESCRIPTION "PNG image compression library for OS/2" -CODE PRELOAD MOVEABLE DISCARDABLE -DATA PRELOAD MOVEABLE MULTIPLE - -EXPORTS - - - png_build_grayscale_palette - png_check_sig - png_chunk_error - png_chunk_warning - png_convert_from_struct_tm - png_convert_from_time_t - png_create_info_struct - png_create_read_struct - png_create_write_struct - png_data_freer - png_destroy_info_struct - png_destroy_read_struct - png_destroy_write_struct - png_error - png_free - png_free_data - png_get_IHDR - png_get_PLTE - png_get_bKGD - png_get_bit_depth - png_get_cHRM - png_get_cHRM_fixed - png_get_channels - png_get_color_type - png_get_compression_buffer_size - png_get_compression_type - png_get_copyright - png_get_error_ptr - png_get_filter_type - png_get_gAMA - png_get_gAMA_fixed - png_get_hIST - png_get_header_ver - png_get_header_version - png_get_iCCP - png_get_image_height - png_get_image_width - png_get_interlace_type - png_get_io_ptr - png_get_libpng_ver - png_get_oFFs - png_get_pCAL - png_get_pHYs - png_get_pixel_aspect_ratio - png_get_pixels_per_meter - png_get_progressive_ptr - png_get_rgb_to_gray_status - png_get_rowbytes - png_get_rows - png_get_sBIT - png_get_sCAL - png_get_sPLT - png_get_sRGB - png_get_signature - png_get_tIME - png_get_tRNS - png_get_text - png_get_unknown_chunks - png_get_user_chunk_ptr - png_get_user_transform_ptr - png_get_valid - png_get_x_offset_microns - png_get_x_offset_pixels - png_get_x_pixels_per_meter - png_get_y_offset_microns - png_get_y_offset_pixels - png_get_y_pixels_per_meter - png_malloc - png_memcpy_check - png_memset_check - png_permit_empty_plte - png_process_data - png_progressive_combine_row - png_read_end - png_read_image - png_read_info - png_read_init ; deprecated - png_read_png - png_read_row - png_read_rows - png_read_update_info - png_reset_zstream - png_set_IHDR - png_set_PLTE - png_set_bKGD - png_set_background - png_set_bgr - png_set_cHRM - png_set_cHRM_fixed - png_set_compression_buffer_size - png_set_compression_level - png_set_compression_mem_level - png_set_compression_method - png_set_compression_strategy - png_set_compression_window_bits - png_set_crc_action - png_set_dither - png_set_error_fn - png_set_expand - png_set_filler - png_set_filter - png_set_filter_heuristics - png_set_flush - png_set_gAMA - png_set_gAMA_fixed - png_set_gamma - png_set_gray_1_2_4_to_8 - png_set_gray_to_rgb - png_set_hIST - png_set_iCCP - png_set_interlace_handling - png_set_invert_alpha - png_set_invert_mono - png_set_keep_unknown_chunks - png_set_oFFs - png_set_pCAL - png_set_pHYs - png_set_packing - png_set_packswap - png_set_palette_to_rgb - png_set_progressive_read_fn - png_set_read_fn - png_set_read_status_fn - png_set_read_user_chunk_fn - png_set_read_user_transform_fn - png_set_rgb_to_gray - png_set_rgb_to_gray_fixed - png_set_rows - png_set_sBIT - png_set_sCAL - png_set_sPLT - png_set_sRGB - png_set_sRGB_gAMA_and_cHRM - png_set_shift - png_set_sig_bytes - png_set_strip_16 - png_set_strip_alpha - png_set_swap - png_set_swap_alpha - png_set_tIME - png_set_tRNS - png_set_tRNS_to_alpha - png_set_text - png_set_unknown_chunk_location - png_set_unknown_chunks - png_set_user_transform_info - png_set_write_fn - png_set_write_status_fn - png_set_write_user_transform_fn - png_sig_cmp - png_start_read_image - png_warning - png_write_chunk - png_write_chunk_data - png_write_chunk_end - png_write_chunk_start - png_write_end - png_write_flush - png_write_image - png_write_info - png_write_info_before_PLTE - png_write_init ; deprecated - png_write_png - png_write_row - png_write_rows - png_read_init_2 - png_write_init_2 - png_access_version_number - png_init_io - png_convert_to_rfc1123 - png_set_invalid - -; Added at version 1.2.0: - png_mmx_support - png_permit_empty_plte - png_permit_mng_features - png_get_mmx_flagmask - png_get_asm_flagmask - png_get_asm_flags - png_get_mmx_bitdepth_threshold - png_get_mmx_rowbytes_threshold - png_set_asm_flags - png_init_mmx_flags - -; Added at version 1.2.2: - png_handle_as_unknown - -; Added at version 1.2.2 and deleted from 1.2.3: -; png_zalloc -; png_zfree - -; Added at version 1.2.4 - png_malloc_warn - -; Added at version 1.2.6 - png_set_user_limits - png_get_user_height_max - png_get_user_width_max -; Added at version 1.2.7 - png_set_add_alpha - -; These are not present when libpng is compiled with PNG_NO_GLOBAL_ARRAYS - png_libpng_ver - png_pass_start - png_pass_inc - png_pass_ystart - png_pass_yinc - png_pass_mask - png_pass_dsp_mask -; png_pass_width -; png_pass_height - -; These are not present when libpng is compiled with PNG_NO_GLOBAL_ARRAYS - png_IHDR - png_IDAT - png_IEND - png_PLTE - png_bKGD - png_cHRM - png_gAMA - png_hIST - png_iCCP - png_iTXt - png_oFFs - png_pCAL - png_pHYs - png_sBIT - png_sCAL - png_sPLT - png_sRGB - png_tEXt - png_tIME - png_tRNS - png_zTXt diff --git a/wxWidgets/src/png/scripts/pngw32.def b/wxWidgets/src/png/scripts/pngw32.def deleted file mode 100644 index 5bff2d2ab8..0000000000 --- a/wxWidgets/src/png/scripts/pngw32.def +++ /dev/null @@ -1,227 +0,0 @@ -;------------------------------------------ -; LIBPNG module definition file for Windows -;------------------------------------------ - -LIBRARY -DESCRIPTION "PNG image compression library for Windows" - -EXPORTS -;Version 1.2.7 - png_build_grayscale_palette @1 - png_check_sig @2 - png_chunk_error @3 - png_chunk_warning @4 - png_convert_from_struct_tm @5 - png_convert_from_time_t @6 - png_create_info_struct @7 - png_create_read_struct @8 - png_create_write_struct @9 - png_data_freer @10 - png_destroy_info_struct @11 - png_destroy_read_struct @12 - png_destroy_write_struct @13 - png_error @14 - png_free @15 - png_free_data @16 - png_get_IHDR @17 - png_get_PLTE @18 - png_get_bKGD @19 - png_get_bit_depth @20 - png_get_cHRM @21 - png_get_cHRM_fixed @22 - png_get_channels @23 - png_get_color_type @24 - png_get_compression_buffer_size @25 - png_get_compression_type @26 - png_get_copyright @27 - png_get_error_ptr @28 - png_get_filter_type @29 - png_get_gAMA @30 - png_get_gAMA_fixed @31 - png_get_hIST @32 - png_get_header_ver @33 - png_get_header_version @34 - png_get_iCCP @35 - png_get_image_height @36 - png_get_image_width @37 - png_get_interlace_type @38 - png_get_io_ptr @39 - png_get_libpng_ver @40 - png_get_oFFs @41 - png_get_pCAL @42 - png_get_pHYs @43 - png_get_pixel_aspect_ratio @44 - png_get_pixels_per_meter @45 - png_get_progressive_ptr @46 - png_get_rgb_to_gray_status @47 - png_get_rowbytes @48 - png_get_rows @49 - png_get_sBIT @50 - png_get_sCAL @51 - png_get_sPLT @52 - png_get_sRGB @53 - png_get_signature @54 - png_get_tIME @55 - png_get_tRNS @56 - png_get_text @57 - png_get_unknown_chunks @58 - png_get_user_chunk_ptr @59 - png_get_user_transform_ptr @60 - png_get_valid @61 - png_get_x_offset_microns @62 - png_get_x_offset_pixels @63 - png_get_x_pixels_per_meter @64 - png_get_y_offset_microns @65 - png_get_y_offset_pixels @66 - png_get_y_pixels_per_meter @67 - png_malloc @68 - png_memcpy_check @69 - png_memset_check @70 -; png_permit_empty_plte is deprecated - png_permit_empty_plte @71 - png_process_data @72 - png_progressive_combine_row @73 - png_read_end @74 - png_read_image @75 - png_read_info @76 -; png_read_init is deprecated - png_read_init @77 - png_read_png @78 - png_read_row @79 - png_read_rows @80 - png_read_update_info @81 - png_reset_zstream @82 - png_set_IHDR @83 - png_set_PLTE @84 - png_set_bKGD @85 - png_set_background @86 - png_set_bgr @87 - png_set_cHRM @88 - png_set_cHRM_fixed @89 - png_set_compression_buffer_size @90 - png_set_compression_level @91 - png_set_compression_mem_level @92 - png_set_compression_method @93 - png_set_compression_strategy @94 - png_set_compression_window_bits @95 - png_set_crc_action @96 - png_set_dither @97 - png_set_error_fn @98 - png_set_expand @99 - png_set_filler @100 - png_set_filter @101 - png_set_filter_heuristics @102 - png_set_flush @103 - png_set_gAMA @104 - png_set_gAMA_fixed @105 - png_set_gamma @106 - png_set_gray_1_2_4_to_8 @107 - png_set_gray_to_rgb @108 - png_set_hIST @109 - png_set_iCCP @110 - png_set_interlace_handling @111 - png_set_invert_alpha @112 - png_set_invert_mono @113 - png_set_keep_unknown_chunks @114 - png_set_oFFs @115 - png_set_pCAL @116 - png_set_pHYs @117 - png_set_packing @118 - png_set_packswap @119 - png_set_palette_to_rgb @120 - png_set_progressive_read_fn @121 - png_set_read_fn @122 - png_set_read_status_fn @123 - png_set_read_user_chunk_fn @124 - png_set_read_user_transform_fn @125 - png_set_rgb_to_gray @126 - png_set_rgb_to_gray_fixed @127 - png_set_rows @128 - png_set_sBIT @129 - png_set_sCAL @130 - png_set_sPLT @131 - png_set_sRGB @132 - png_set_sRGB_gAMA_and_cHRM @133 - png_set_shift @134 - png_set_sig_bytes @135 - png_set_strip_16 @136 - png_set_strip_alpha @137 - png_set_swap @138 - png_set_swap_alpha @139 - png_set_tIME @140 - png_set_tRNS @141 - png_set_tRNS_to_alpha @142 - png_set_text @143 - png_set_unknown_chunk_location @144 - png_set_unknown_chunks @145 - png_set_user_transform_info @146 - png_set_write_fn @147 - png_set_write_status_fn @148 - png_set_write_user_transform_fn @149 - png_sig_cmp @150 - png_start_read_image @151 - png_warning @152 - png_write_chunk @153 - png_write_chunk_data @154 - png_write_chunk_end @155 - png_write_chunk_start @156 - png_write_end @157 - png_write_flush @158 - png_write_image @159 - png_write_info @160 - png_write_info_before_PLTE @161 -; png_write_init is deprecated - png_write_init @162 - png_write_png @163 - png_write_row @164 - png_write_rows @165 -; png_read_init_2 and png_write_init_2 are deprecated. - png_read_init_2 @166 - png_write_init_2 @167 - png_access_version_number @168 -; png_sig_bytes @169 -; png_libpng_ver @170 - png_init_io @171 - png_convert_to_rfc1123 @172 - png_set_invalid @173 -; Added at version 1.0.12 -; For compatiblity with 1.0.7-1.0.11 - png_info_init @174 - png_read_init_3 @175 - png_write_init_3 @176 - png_info_init_3 @177 - png_destroy_struct @178 -; Added at version 1.2.0 -; For use with PNG_USER_MEM_SUPPORTED - png_destroy_struct_2 @179 - png_create_read_struct_2 @180 - png_create_write_struct_2 @181 - png_malloc_default @182 - png_free_default @183 -; MNG features - png_permit_mng_features @184 -; MMX support - png_mmx_support @185 - png_get_mmx_flagmask @186 - png_get_asm_flagmask @187 - png_get_asm_flags @188 - png_get_mmx_bitdepth_threshold @189 - png_get_mmx_rowbytes_threshold @190 - png_set_asm_flags @191 - png_init_mmx_flags @192 -; Strip error numbers - png_set_strip_error_numbers @193 -; Added at version 1.2.2 - png_handle_as_unknown @194 -; Added at version 1.2.2 and deleted from 1.2.3 -; png_zalloc @195 -; png_zfree @196 -; Added at version 1.2.4 - png_malloc_warn @195 -; Added at version 1.2.6 - png_malloc_warn @195 - png_get_user_height_max @196 - png_get_user_width_max @197 - png_set_user_limits @198 -; Added at version 1.2.7 - png_set_add_alpha @199 diff --git a/wxWidgets/src/png/scripts/pngw32.rc b/wxWidgets/src/png/scripts/pngw32.rc deleted file mode 100644 index e69d732b32..0000000000 --- a/wxWidgets/src/png/scripts/pngw32.rc +++ /dev/null @@ -1,95 +0,0 @@ -#define PNG_VERSION_INFO_ONLY - -#include -#include "../png.h" - -#define _QUOTE(x) # x -#define QUOTE(x) _QUOTE(x) - -#define PNG_LIBPNG_DLLFNAME "LIBPNG" - -#if defined(DLLFNAME_POSTFIX) && !defined(PRIVATEBUILD) && !defined(SPECIALBUILD) -# error PRIVATEBUILD or SPECIALBUILD must be defined as a string describing the type of change brought to the standard library -#endif /* defined(DLLFNAME_POSTFIX)... */ - -#if defined(PNG_USE_PNGVCRD) -# if !defined(SPECIALBUILD) -# define SPECIALBUILD "Use MMX instructions" -# endif /* SPECIALBUILD */ -#endif - -#if defined(PNG_DEBUG) && (PNG_DEBUG > 0) -# define VS_DEBUG VS_FF_DEBUG -# ifndef DLLFNAME_POSTFIX -# define DLLFNAME_POSTFIX "D" -# endif /* DLLFNAME_POSTFIX */ -# ifndef COMMENTS -# define COMMENTS "PNG_DEBUG=" QUOTE(PNG_DEBUG) -# endif /* COMMENTS */ -#else -# define VS_DEBUG 0 -# ifndef DLLFNAME_POSTFIX -# define DLLFNAME_POSTFIX -# endif /* DLLFNAME_POSTFIX */ -#endif /* defined(DEBUG)... */ - -#ifdef PRIVATEBUILD -# define VS_PRIVATEBUILD VS_FF_PRIVATEBUILD -#else -# define VS_PRIVATEBUILD 0 -#endif /* PRIVATEBUILD */ - -#ifdef SPECIALBUILD -# define VS_SPECIALBUILD VS_FF_SPECIALBUILD -#else -# define VS_SPECIALBUILD 0 -#endif /* SPECIALBUILD */ - -#if ((PNG_LIBPNG_BUILD_TYPE & PNG_LIBPNG_BUILD_TYPEMASK) != \ - PNG_LIBPNG_BUILD_STABLE) -# define VS_PRERELEASE VS_FF_PRERELEASE -# define VS_PATCHED 0 -#else -# define VS_PRERELEASE 0 -# if (PNG_LIBPNG_BUILD_TYPE & PNG_LIBPNG_BUILD_PATCHED) -# define VS_PATCHED VS_FF_PATCHED -# else -# define VS_PATCHED 0 -# endif -#endif - -VS_VERSION_INFO VERSIONINFO -FILEVERSION PNG_LIBPNG_VER_MAJOR, PNG_LIBPNG_VER_MINOR, PNG_LIBPNG_VER_RELEASE, PNG_LIBPNG_VER_BUILD -PRODUCTVERSION PNG_LIBPNG_VER_MAJOR, PNG_LIBPNG_VER_MINOR, PNG_LIBPNG_VER_RELEASE, PNG_LIBPNG_VER_BUILD -FILEFLAGSMASK VS_FFI_FILEFLAGSMASK -FILEFLAGS VS_DEBUG | VS_PRIVATEBUILD | VS_SPECIALBUILD | VS_PRERELEASE | VS_PATCHED -FILEOS VOS__WINDOWS32 -FILETYPE VFT_DLL -FILESUBTYPE VFT2_UNKNOWN -BEGIN - BLOCK "StringFileInfo" - BEGIN BLOCK "040904E4" /* Language type = U.S English(0x0409) and Character Set = Windows, Multilingual(0x04E4) */ - BEGIN -#ifdef COMMENTS - VALUE "Comments", COMMENTS "\000" -#endif /* COMMENTS */ - VALUE "FileDescription", "PNG image compression library\000" - VALUE "FileVersion", PNG_LIBPNG_VER_STRING "\000" - VALUE "InternalName", PNG_LIBPNG_DLLFNAME QUOTE(PNG_LIBPNG_VER_DLLNUM) DLLFNAME_POSTFIX " (Windows 32 bit)\000" - VALUE "LegalCopyright", "\251 1998-2004 Glenn Randers-Pehrson et al.\000" - VALUE "OriginalFilename", PNG_LIBPNG_DLLFNAME QUOTE(PNG_LIBPNG_VER_DLLNUM) DLLFNAME_POSTFIX ".DLL\000" -#ifdef PRIVATEBUILD - VALUE "PrivateBuild", PRIVATEBUILD -#endif /* PRIVATEBUILD */ - VALUE "ProductName", "LibPNG\000" - VALUE "ProductVersion", "1\000" -#ifdef SPECIALBUILD - VALUE "SpecialBuild", SPECIALBUILD -#endif /* SPECIALBUILD */ - END - END - BLOCK "VarFileInfo" - BEGIN - VALUE "Translation", 0x0409, 0x04E4 - END -END diff --git a/wxWidgets/src/png/scripts/smakefile.ppc b/wxWidgets/src/png/scripts/smakefile.ppc deleted file mode 100644 index e5c0278411..0000000000 --- a/wxWidgets/src/png/scripts/smakefile.ppc +++ /dev/null @@ -1,30 +0,0 @@ -# Amiga powerUP (TM) Makefile -# makefile for libpng and SAS C V6.58/7.00 PPC compiler -# Copyright (C) 1998 by Andreas R. Kleinert -# For conditions of distribution and use, see copyright notice in png.h - -CC = scppc -CFLAGS = NOSTKCHK NOSINT OPTIMIZE OPTGO OPTPEEP OPTINLOCAL OPTINL IDIR /zlib \ - OPTLOOP OPTRDEP=8 OPTDEP=8 OPTCOMP=8 -LIBNAME = libpng.a -AR = ppc-amigaos-ar -AR_FLAGS = cr -RANLIB = ppc-amigaos-ranlib -LDFLAGS = -r -o -LDLIBS = ../zlib/libzip.a LIB:scppc.a -LN = ppc-amigaos-ld -RM = delete quiet -MKDIR = makedir - -OBJS = png.o pngset.o pngget.o pngrutil.o pngtrans.o pngwutil.o pngread.o \ -pngerror.o pngpread.o pngwrite.o pngrtran.o pngwtran.o pngrio.o pngwio.o pngmem.o - -all: $(LIBNAME) pngtest - -$(LIBNAME): $(OBJS) - $(AR) $(AR_FLAGS) $@ $(OBJS) - $(RANLIB) $@ - -pngtest: pngtest.o $(LIBNAME) - $(LN) $(LDFLAGS) pngtest LIB:c_ppc.o pngtest.o $(LIBNAME) $(LDLIBS) \ -LIB:end.o diff --git a/wxWidgets/src/regex/COPYRIGHT b/wxWidgets/src/regex/COPYRIGHT deleted file mode 100644 index 451789ff36..0000000000 --- a/wxWidgets/src/regex/COPYRIGHT +++ /dev/null @@ -1,86 +0,0 @@ -This regular expression package was originally developed by Henry Spencer. -It bears the following copyright notice: - -********************************************************************** - -Copyright (c) 1998, 1999 Henry Spencer. All rights reserved. - -Development of this software was funded, in part, by Cray Research Inc., -UUNET Communications Services Inc., Sun Microsystems Inc., and Scriptics -Corporation, none of whom are responsible for the results. The author -thanks all of them. - -Redistribution and use in source and binary forms -- with or without -modification -- are permitted for any purpose, provided that -redistributions in source form retain this entire copyright notice and -indicate the origin and nature of any modifications. - -I'd appreciate being given credit for this package in the documentation -of software which uses it, but that is not a requirement. - -THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, -INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL -HENRY SPENCER BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; -OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR -OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -********************************************************************** - -wxWindows adopted the code out of Tcl 8.4.5. Portions of regc_locale.c -and re_syntax.n were developed by Tcl developers other than Henry Spencer; -these files bear the Tcl copyright and license notice: - -********************************************************************** - -This software is copyrighted by the Regents of the University of -California, Sun Microsystems, Inc., Scriptics Corporation, ActiveState -Corporation and other parties. The following terms apply to all files -associated with the software unless explicitly disclaimed in -individual files. - -The authors hereby grant permission to use, copy, modify, distribute, -and license this software and its documentation for any purpose, provided -that existing copyright notices are retained in all copies and that this -notice is included verbatim in any distributions. No written agreement, -license, or royalty fee is required for any of the authorized uses. -Modifications to this software may be copyrighted by their authors -and need not follow the licensing terms described here, provided that -the new terms are clearly indicated on the first page of each file where -they apply. - -IN NO EVENT SHALL THE AUTHORS OR DISTRIBUTORS BE LIABLE TO ANY PARTY -FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES -ARISING OUT OF THE USE OF THIS SOFTWARE, ITS DOCUMENTATION, OR ANY -DERIVATIVES THEREOF, EVEN IF THE AUTHORS HAVE BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. - -THE AUTHORS AND DISTRIBUTORS SPECIFICALLY DISCLAIM ANY WARRANTIES, -INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. THIS SOFTWARE -IS PROVIDED ON AN "AS IS" BASIS, AND THE AUTHORS AND DISTRIBUTORS HAVE -NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR -MODIFICATIONS. - -GOVERNMENT USE: If you are acquiring this software on behalf of the -U.S. government, the Government shall have only "Restricted Rights" -in the software and related documentation as defined in the Federal -Acquisition Regulations (FARs) in Clause 52.227.19 (c) (2). If you -are acquiring the software on behalf of the Department of Defense, the -software shall be classified as "Commercial Computer Software" and the -Government shall have only "Restricted Rights" as defined in Clause -252.227-7013 (c) (1) of DFARs. Notwithstanding the foregoing, the -authors grant the U.S. Government and others acting in its behalf -permission to use and distribute the software in accordance with the -terms specified in this license. - -********************************************************************** - -The wxWindows license applies to further modifications to regcustom.h -and regc_locale.c. - -**************************************************************************** diff --git a/wxWidgets/src/regex/README b/wxWidgets/src/regex/README deleted file mode 100644 index 6c763a5556..0000000000 --- a/wxWidgets/src/regex/README +++ /dev/null @@ -1,41 +0,0 @@ -wxWindows regex ---------------- -This is a version of Henry Spencer's regex, which was taken from the -source of TCL (Toolkit Command Language). It implements POSIX regular -expressions and also supports Unicode and some Perl5 extensions. - -The modifications made by the wxWindows team are as follows: - -regcustom.h ------------ -Types and constants appropriate for our use of the library are defined -here. - -regex.h -------- -This is unmodified. Note though, that a portion of it (clearly marked) -is copied from regcustom.h as part of the build process. - -regc_locale.c -------------- -This module provides character classifications. - -The current version from Tcl supports only a Unicode build. The -original code from Henry Spencer, on the other hand, was ASCII only. -Therefore, in order to support both, code from the ASCII version has been -incorporated into the Unicode version, conditionally compiled depending -on wxUSE_UNICODE. - -The only non-trivial dependencies were: Tcl_UniCharToUpper, -Tcl_UniCharToLower and Tcl_UniCharToTitle. The implementations of these -have also been incorporated (from Tcl). These in turn depend only the data -tables in tclUniData.c (which is unmodified). At some point wxWindows -may have it's own Unicode character classification code, at which point -these should be used instead. - -Other dependencies (on Tcl_DString) have been eliminated using wxWindows -wxChar functions. - -The ASCII version has also been extended to support character -classifications based on the current locale rather than ASCII only. - diff --git a/wxWidgets/src/regex/re_syntax.n b/wxWidgets/src/regex/re_syntax.n deleted file mode 100644 index f37bb85abd..0000000000 --- a/wxWidgets/src/regex/re_syntax.n +++ /dev/null @@ -1,970 +0,0 @@ -'\" -'\" Copyright (c) 1998 Sun Microsystems, Inc. -'\" Copyright (c) 1999 Scriptics Corporation -'\" -'\" This software is copyrighted by the Regents of the University of -'\" California, Sun Microsystems, Inc., Scriptics Corporation, ActiveState -'\" Corporation and other parties. The following terms apply to all files -'\" associated with the software unless explicitly disclaimed in -'\" individual files. -'\" -'\" The authors hereby grant permission to use, copy, modify, distribute, -'\" and license this software and its documentation for any purpose, provided -'\" that existing copyright notices are retained in all copies and that this -'\" notice is included verbatim in any distributions. No written agreement, -'\" license, or royalty fee is required for any of the authorized uses. -'\" Modifications to this software may be copyrighted by their authors -'\" and need not follow the licensing terms described here, provided that -'\" the new terms are clearly indicated on the first page of each file where -'\" they apply. -'\" -'\" IN NO EVENT SHALL THE AUTHORS OR DISTRIBUTORS BE LIABLE TO ANY PARTY -'\" FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES -'\" ARISING OUT OF THE USE OF THIS SOFTWARE, ITS DOCUMENTATION, OR ANY -'\" DERIVATIVES THEREOF, EVEN IF THE AUTHORS HAVE BEEN ADVISED OF THE -'\" POSSIBILITY OF SUCH DAMAGE. -'\" -'\" THE AUTHORS AND DISTRIBUTORS SPECIFICALLY DISCLAIM ANY WARRANTIES, -'\" INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, -'\" FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. THIS SOFTWARE -'\" IS PROVIDED ON AN "AS IS" BASIS, AND THE AUTHORS AND DISTRIBUTORS HAVE -'\" NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR -'\" MODIFICATIONS. -'\" -'\" GOVERNMENT USE: If you are acquiring this software on behalf of the -'\" U.S. government, the Government shall have only "Restricted Rights" -'\" in the software and related documentation as defined in the Federal -'\" Acquisition Regulations (FARs) in Clause 52.227.19 (c) (2). If you -'\" are acquiring the software on behalf of the Department of Defense, the -'\" software shall be classified as "Commercial Computer Software" and the -'\" Government shall have only "Restricted Rights" as defined in Clause -'\" 252.227-7013 (c) (1) of DFARs. Notwithstanding the foregoing, the -'\" authors grant the U.S. Government and others acting in its behalf -'\" permission to use and distribute the software in accordance with the -'\" terms specified in this license. -'\" -'\" RCS: @(#) Id: re_syntax.n,v 1.3 1999/07/14 19:09:36 jpeek Exp -'\" -.so man.macros -.TH re_syntax n "8.1" Tcl "Tcl Built-In Commands" -.BS -.SH NAME -re_syntax \- Syntax of Tcl regular expressions. -.BE - -.SH DESCRIPTION -.PP -A \fIregular expression\fR describes strings of characters. -It's a pattern that matches certain strings and doesn't match others. - -.SH "DIFFERENT FLAVORS OF REs" -Regular expressions (``RE''s), as defined by POSIX, come in two -flavors: \fIextended\fR REs (``EREs'') and \fIbasic\fR REs (``BREs''). -EREs are roughly those of the traditional \fIegrep\fR, while BREs are -roughly those of the traditional \fIed\fR. This implementation adds -a third flavor, \fIadvanced\fR REs (``AREs''), basically EREs with -some significant extensions. -.PP -This manual page primarily describes AREs. BREs mostly exist for -backward compatibility in some old programs; they will be discussed at -the end. POSIX EREs are almost an exact subset of AREs. Features of -AREs that are not present in EREs will be indicated. - -.SH "REGULAR EXPRESSION SYNTAX" -.PP -Tcl regular expressions are implemented using the package written by -Henry Spencer, based on the 1003.2 spec and some (not quite all) of -the Perl5 extensions (thanks, Henry!). Much of the description of -regular expressions below is copied verbatim from his manual entry. -.PP -An ARE is one or more \fIbranches\fR, -separated by `\fB|\fR', -matching anything that matches any of the branches. -.PP -A branch is zero or more \fIconstraints\fR or \fIquantified atoms\fR, -concatenated. -It matches a match for the first, followed by a match for the second, etc; -an empty branch matches the empty string. -.PP -A quantified atom is an \fIatom\fR possibly followed -by a single \fIquantifier\fR. -Without a quantifier, it matches a match for the atom. -The quantifiers, -and what a so-quantified atom matches, are: -.RS 2 -.TP 6 -\fB*\fR -a sequence of 0 or more matches of the atom -.TP -\fB+\fR -a sequence of 1 or more matches of the atom -.TP -\fB?\fR -a sequence of 0 or 1 matches of the atom -.TP -\fB{\fIm\fB}\fR -a sequence of exactly \fIm\fR matches of the atom -.TP -\fB{\fIm\fB,}\fR -a sequence of \fIm\fR or more matches of the atom -.TP -\fB{\fIm\fB,\fIn\fB}\fR -a sequence of \fIm\fR through \fIn\fR (inclusive) matches of the atom; -\fIm\fR may not exceed \fIn\fR -.TP -\fB*? +? ?? {\fIm\fB}? {\fIm\fB,}? {\fIm\fB,\fIn\fB}?\fR -\fInon-greedy\fR quantifiers, -which match the same possibilities, -but prefer the smallest number rather than the largest number -of matches (see MATCHING) -.RE -.PP -The forms using -\fB{\fR and \fB}\fR -are known as \fIbound\fRs. -The numbers -\fIm\fR and \fIn\fR are unsigned decimal integers -with permissible values from 0 to 255 inclusive. -.PP -An atom is one of: -.RS 2 -.TP 6 -\fB(\fIre\fB)\fR -(where \fIre\fR is any regular expression) -matches a match for -\fIre\fR, with the match noted for possible reporting -.TP -\fB(?:\fIre\fB)\fR -as previous, -but does no reporting -(a ``non-capturing'' set of parentheses) -.TP -\fB()\fR -matches an empty string, -noted for possible reporting -.TP -\fB(?:)\fR -matches an empty string, -without reporting -.TP -\fB[\fIchars\fB]\fR -a \fIbracket expression\fR, -matching any one of the \fIchars\fR (see BRACKET EXPRESSIONS for more detail) -.TP - \fB.\fR -matches any single character -.TP -\fB\e\fIk\fR -(where \fIk\fR is a non-alphanumeric character) -matches that character taken as an ordinary character, -e.g. \e\e matches a backslash character -.TP -\fB\e\fIc\fR -where \fIc\fR is alphanumeric -(possibly followed by other characters), -an \fIescape\fR (AREs only), -see ESCAPES below -.TP -\fB{\fR -when followed by a character other than a digit, -matches the left-brace character `\fB{\fR'; -when followed by a digit, it is the beginning of a -\fIbound\fR (see above) -.TP -\fIx\fR -where \fIx\fR is -a single character with no other significance, matches that character. -.RE -.PP -A \fIconstraint\fR matches an empty string when specific conditions -are met. -A constraint may not be followed by a quantifier. -The simple constraints are as follows; some more constraints are -described later, under ESCAPES. -.RS 2 -.TP 8 -\fB^\fR -matches at the beginning of a line -.TP -\fB$\fR -matches at the end of a line -.TP -\fB(?=\fIre\fB)\fR -\fIpositive lookahead\fR (AREs only), matches at any point -where a substring matching \fIre\fR begins -.TP -\fB(?!\fIre\fB)\fR -\fInegative lookahead\fR (AREs only), matches at any point -where no substring matching \fIre\fR begins -.RE -.PP -The lookahead constraints may not contain back references (see later), -and all parentheses within them are considered non-capturing. -.PP -An RE may not end with `\fB\e\fR'. - -.SH "BRACKET EXPRESSIONS" -A \fIbracket expression\fR is a list of characters enclosed in `\fB[\|]\fR'. -It normally matches any single character from the list (but see below). -If the list begins with `\fB^\fR', -it matches any single character -(but see below) \fInot\fR from the rest of the list. -.PP -If two characters in the list are separated by `\fB\-\fR', -this is shorthand -for the full \fIrange\fR of characters between those two (inclusive) in the -collating sequence, -e.g. -\fB[0\-9]\fR -in ASCII matches any decimal digit. -Two ranges may not share an -endpoint, so e.g. -\fBa\-c\-e\fR -is illegal. -Ranges are very collating-sequence-dependent, -and portable programs should avoid relying on them. -.PP -To include a literal -\fB]\fR -or -\fB\-\fR -in the list, -the simplest method is to -enclose it in -\fB[.\fR and \fB.]\fR -to make it a collating element (see below). -Alternatively, -make it the first character -(following a possible `\fB^\fR'), -or (AREs only) precede it with `\fB\e\fR'. -Alternatively, for `\fB\-\fR', -make it the last character, -or the second endpoint of a range. -To use a literal -\fB\-\fR -as the first endpoint of a range, -make it a collating element -or (AREs only) precede it with `\fB\e\fR'. -With the exception of these, some combinations using -\fB[\fR -(see next -paragraphs), and escapes, -all other special characters lose their -special significance within a bracket expression. -.PP -Within a bracket expression, a collating element (a character, -a multi-character sequence that collates as if it were a single character, -or a collating-sequence name for either) -enclosed in -\fB[.\fR and \fB.]\fR -stands for the -sequence of characters of that collating element. -The sequence is a single element of the bracket expression's list. -A bracket expression in a locale that has -multi-character collating elements -can thus match more than one character. -.VS 8.2 -So (insidiously), a bracket expression that starts with \fB^\fR -can match multi-character collating elements even if none of them -appear in the bracket expression! -(\fINote:\fR Tcl currently has no multi-character collating elements. -This information is only for illustration.) -.PP -For example, assume the collating sequence includes a \fBch\fR -multi-character collating element. -Then the RE \fB[[.ch.]]*c\fR (zero or more \fBch\fP's followed by \fBc\fP) -matches the first five characters of `\fBchchcc\fR'. -Also, the RE \fB[^c]b\fR matches all of `\fBchb\fR' -(because \fB[^c]\fR matches the multi-character \fBch\fR). -.VE 8.2 -.PP -Within a bracket expression, a collating element enclosed in -\fB[=\fR -and -\fB=]\fR -is an equivalence class, standing for the sequences of characters -of all collating elements equivalent to that one, including itself. -(If there are no other equivalent collating elements, -the treatment is as if the enclosing delimiters were `\fB[.\fR'\& -and `\fB.]\fR'.) -For example, if -\fBo\fR -and -\fB\o'o^'\fR -are the members of an equivalence class, -then `\fB[[=o=]]\fR', `\fB[[=\o'o^'=]]\fR', -and `\fB[o\o'o^']\fR'\& -are all synonymous. -An equivalence class may not be an endpoint -of a range. -.VS 8.2 -(\fINote:\fR -Tcl currently implements only the Unicode locale. -It doesn't define any equivalence classes. -The examples above are just illustrations.) -.VE 8.2 -.PP -Within a bracket expression, the name of a \fIcharacter class\fR enclosed -in -\fB[:\fR -and -\fB:]\fR -stands for the list of all characters -(not all collating elements!) -belonging to that -class. -Standard character classes are: -.PP -.RS -.ne 5 -.nf -.ta 3c -\fBalpha\fR A letter. -\fBupper\fR An upper-case letter. -\fBlower\fR A lower-case letter. -\fBdigit\fR A decimal digit. -\fBxdigit\fR A hexadecimal digit. -\fBalnum\fR An alphanumeric (letter or digit). -\fBprint\fR An alphanumeric (same as alnum). -\fBblank\fR A space or tab character. -\fBspace\fR A character producing white space in displayed text. -\fBpunct\fR A punctuation character. -\fBgraph\fR A character with a visible representation. -\fBcntrl\fR A control character. -.fi -.RE -.PP -A locale may provide others. -.VS 8.2 -(Note that the current Tcl implementation has only one locale: -the Unicode locale.) -.VE 8.2 -A character class may not be used as an endpoint of a range. -.PP -There are two special cases of bracket expressions: -the bracket expressions -\fB[[:<:]]\fR -and -\fB[[:>:]]\fR -are constraints, matching empty strings at -the beginning and end of a word respectively. -'\" note, discussion of escapes below references this definition of word -A word is defined as a sequence of -word characters -that is neither preceded nor followed by -word characters. -A word character is an -\fIalnum\fR -character -or an underscore -(\fB_\fR). -These special bracket expressions are deprecated; -users of AREs should use constraint escapes instead (see below). -.SH ESCAPES -Escapes (AREs only), which begin with a -\fB\e\fR -followed by an alphanumeric character, -come in several varieties: -character entry, class shorthands, constraint escapes, and back references. -A -\fB\e\fR -followed by an alphanumeric character but not constituting -a valid escape is illegal in AREs. -In EREs, there are no escapes: -outside a bracket expression, -a -\fB\e\fR -followed by an alphanumeric character merely stands for that -character as an ordinary character, -and inside a bracket expression, -\fB\e\fR -is an ordinary character. -(The latter is the one actual incompatibility between EREs and AREs.) -.PP -Character-entry escapes (AREs only) exist to make it easier to specify -non-printing and otherwise inconvenient characters in REs: -.RS 2 -.TP 5 -\fB\ea\fR -alert (bell) character, as in C -.TP -\fB\eb\fR -backspace, as in C -.TP -\fB\eB\fR -synonym for -\fB\e\fR -to help reduce backslash doubling in some -applications where there are multiple levels of backslash processing -.TP -\fB\ec\fIX\fR -(where X is any character) the character whose -low-order 5 bits are the same as those of -\fIX\fR, -and whose other bits are all zero -.TP -\fB\ee\fR -the character whose collating-sequence name -is `\fBESC\fR', -or failing that, the character with octal value 033 -.TP -\fB\ef\fR -formfeed, as in C -.TP -\fB\en\fR -newline, as in C -.TP -\fB\er\fR -carriage return, as in C -.TP -\fB\et\fR -horizontal tab, as in C -.TP -\fB\eu\fIwxyz\fR -(where -\fIwxyz\fR -is exactly four hexadecimal digits) -the Unicode character -\fBU+\fIwxyz\fR -in the local byte ordering -.TP -\fB\eU\fIstuvwxyz\fR -(where -\fIstuvwxyz\fR -is exactly eight hexadecimal digits) -reserved for a somewhat-hypothetical Unicode extension to 32 bits -.TP -\fB\ev\fR -vertical tab, as in C -are all available. -.TP -\fB\ex\fIhhh\fR -(where -\fIhhh\fR -is any sequence of hexadecimal digits) -the character whose hexadecimal value is -\fB0x\fIhhh\fR -(a single character no matter how many hexadecimal digits are used). -.TP -\fB\e0\fR -the character whose value is -\fB0\fR -.TP -\fB\e\fIxy\fR -(where -\fIxy\fR -is exactly two octal digits, -and is not a -\fIback reference\fR (see below)) -the character whose octal value is -\fB0\fIxy\fR -.TP -\fB\e\fIxyz\fR -(where -\fIxyz\fR -is exactly three octal digits, -and is not a -back reference (see below)) -the character whose octal value is -\fB0\fIxyz\fR -.RE -.PP -Hexadecimal digits are `\fB0\fR'-`\fB9\fR', `\fBa\fR'-`\fBf\fR', -and `\fBA\fR'-`\fBF\fR'. -Octal digits are `\fB0\fR'-`\fB7\fR'. -.PP -The character-entry escapes are always taken as ordinary characters. -For example, -\fB\e135\fR -is -\fB]\fR -in ASCII, -but -\fB\e135\fR -does not terminate a bracket expression. -Beware, however, that some applications (e.g., C compilers) interpret -such sequences themselves before the regular-expression package -gets to see them, which may require doubling (quadrupling, etc.) the `\fB\e\fR'. -.PP -Class-shorthand escapes (AREs only) provide shorthands for certain commonly-used -character classes: -.RS 2 -.TP 10 -\fB\ed\fR -\fB[[:digit:]]\fR -.TP -\fB\es\fR -\fB[[:space:]]\fR -.TP -\fB\ew\fR -\fB[[:alnum:]_]\fR -(note underscore) -.TP -\fB\eD\fR -\fB[^[:digit:]]\fR -.TP -\fB\eS\fR -\fB[^[:space:]]\fR -.TP -\fB\eW\fR -\fB[^[:alnum:]_]\fR -(note underscore) -.RE -.PP -Within bracket expressions, `\fB\ed\fR', `\fB\es\fR', -and `\fB\ew\fR'\& -lose their outer brackets, -and `\fB\eD\fR', `\fB\eS\fR', -and `\fB\eW\fR'\& -are illegal. -.VS 8.2 -(So, for example, \fB[a-c\ed]\fR is equivalent to \fB[a-c[:digit:]]\fR. -Also, \fB[a-c\eD]\fR, which is equivalent to \fB[a-c^[:digit:]]\fR, is illegal.) -.VE 8.2 -.PP -A constraint escape (AREs only) is a constraint, -matching the empty string if specific conditions are met, -written as an escape: -.RS 2 -.TP 6 -\fB\eA\fR -matches only at the beginning of the string -(see MATCHING, below, for how this differs from `\fB^\fR') -.TP -\fB\em\fR -matches only at the beginning of a word -.TP -\fB\eM\fR -matches only at the end of a word -.TP -\fB\ey\fR -matches only at the beginning or end of a word -.TP -\fB\eY\fR -matches only at a point that is not the beginning or end of a word -.TP -\fB\eZ\fR -matches only at the end of the string -(see MATCHING, below, for how this differs from `\fB$\fR') -.TP -\fB\e\fIm\fR -(where -\fIm\fR -is a nonzero digit) a \fIback reference\fR, see below -.TP -\fB\e\fImnn\fR -(where -\fIm\fR -is a nonzero digit, and -\fInn\fR -is some more digits, -and the decimal value -\fImnn\fR -is not greater than the number of closing capturing parentheses seen so far) -a \fIback reference\fR, see below -.RE -.PP -A word is defined as in the specification of -\fB[[:<:]]\fR -and -\fB[[:>:]]\fR -above. -Constraint escapes are illegal within bracket expressions. -.PP -A back reference (AREs only) matches the same string matched by the parenthesized -subexpression specified by the number, -so that (e.g.) -\fB([bc])\e1\fR -matches -\fBbb\fR -or -\fBcc\fR -but not `\fBbc\fR'. -The subexpression must entirely precede the back reference in the RE. -Subexpressions are numbered in the order of their leading parentheses. -Non-capturing parentheses do not define subexpressions. -.PP -There is an inherent historical ambiguity between octal character-entry -escapes and back references, which is resolved by heuristics, -as hinted at above. -A leading zero always indicates an octal escape. -A single non-zero digit, not followed by another digit, -is always taken as a back reference. -A multi-digit sequence not starting with a zero is taken as a back -reference if it comes after a suitable subexpression -(i.e. the number is in the legal range for a back reference), -and otherwise is taken as octal. -.SH "METASYNTAX" -In addition to the main syntax described above, there are some special -forms and miscellaneous syntactic facilities available. -.PP -Normally the flavor of RE being used is specified by -application-dependent means. -However, this can be overridden by a \fIdirector\fR. -If an RE of any flavor begins with `\fB***:\fR', -the rest of the RE is an ARE. -If an RE of any flavor begins with `\fB***=\fR', -the rest of the RE is taken to be a literal string, -with all characters considered ordinary characters. -.PP -An ARE may begin with \fIembedded options\fR: -a sequence -\fB(?\fIxyz\fB)\fR -(where -\fIxyz\fR -is one or more alphabetic characters) -specifies options affecting the rest of the RE. -These supplement, and can override, -any options specified by the application. -The available option letters are: -.RS 2 -.TP 3 -\fBb\fR -rest of RE is a BRE -.TP 3 -\fBc\fR -case-sensitive matching (usual default) -.TP 3 -\fBe\fR -rest of RE is an ERE -.TP 3 -\fBi\fR -case-insensitive matching (see MATCHING, below) -.TP 3 -\fBm\fR -historical synonym for -\fBn\fR -.TP 3 -\fBn\fR -newline-sensitive matching (see MATCHING, below) -.TP 3 -\fBp\fR -partial newline-sensitive matching (see MATCHING, below) -.TP 3 -\fBq\fR -rest of RE is a literal (``quoted'') string, all ordinary characters -.TP 3 -\fBs\fR -non-newline-sensitive matching (usual default) -.TP 3 -\fBt\fR -tight syntax (usual default; see below) -.TP 3 -\fBw\fR -inverse partial newline-sensitive (``weird'') matching (see MATCHING, below) -.TP 3 -\fBx\fR -expanded syntax (see below) -.RE -.PP -Embedded options take effect at the -\fB)\fR -terminating the sequence. -They are available only at the start of an ARE, -and may not be used later within it. -.PP -In addition to the usual (\fItight\fR) RE syntax, in which all characters are -significant, there is an \fIexpanded\fR syntax, -available in all flavors of RE -with the \fB-expanded\fR switch, or in AREs with the embedded x option. -In the expanded syntax, -white-space characters are ignored -and all characters between a -\fB#\fR -and the following newline (or the end of the RE) are ignored, -permitting paragraphing and commenting a complex RE. -There are three exceptions to that basic rule: -.RS 2 -.PP -a white-space character or `\fB#\fR' preceded by `\fB\e\fR' is retained -.PP -white space or `\fB#\fR' within a bracket expression is retained -.PP -white space and comments are illegal within multi-character symbols -like the ARE `\fB(?:\fR' or the BRE `\fB\e(\fR' -.RE -.PP -Expanded-syntax white-space characters are blank, tab, newline, and -.VS 8.2 -any character that belongs to the \fIspace\fR character class. -.VE 8.2 -.PP -Finally, in an ARE, -outside bracket expressions, the sequence `\fB(?#\fIttt\fB)\fR' -(where -\fIttt\fR -is any text not containing a `\fB)\fR') -is a comment, -completely ignored. -Again, this is not allowed between the characters of -multi-character symbols like `\fB(?:\fR'. -Such comments are more a historical artifact than a useful facility, -and their use is deprecated; -use the expanded syntax instead. -.PP -\fINone\fR of these metasyntax extensions is available if the application -(or an initial -\fB***=\fR -director) -has specified that the user's input be treated as a literal string -rather than as an RE. -.SH MATCHING -In the event that an RE could match more than one substring of a given -string, -the RE matches the one starting earliest in the string. -If the RE could match more than one substring starting at that point, -its choice is determined by its \fIpreference\fR: -either the longest substring, or the shortest. -.PP -Most atoms, and all constraints, have no preference. -A parenthesized RE has the same preference (possibly none) as the RE. -A quantified atom with quantifier -\fB{\fIm\fB}\fR -or -\fB{\fIm\fB}?\fR -has the same preference (possibly none) as the atom itself. -A quantified atom with other normal quantifiers (including -\fB{\fIm\fB,\fIn\fB}\fR -with -\fIm\fR -equal to -\fIn\fR) -prefers longest match. -A quantified atom with other non-greedy quantifiers (including -\fB{\fIm\fB,\fIn\fB}?\fR -with -\fIm\fR -equal to -\fIn\fR) -prefers shortest match. -A branch has the same preference as the first quantified atom in it -which has a preference. -An RE consisting of two or more branches connected by the -\fB|\fR -operator prefers longest match. -.PP -Subject to the constraints imposed by the rules for matching the whole RE, -subexpressions also match the longest or shortest possible substrings, -based on their preferences, -with subexpressions starting earlier in the RE taking priority over -ones starting later. -Note that outer subexpressions thus take priority over -their component subexpressions. -.PP -Note that the quantifiers -\fB{1,1}\fR -and -\fB{1,1}?\fR -can be used to force longest and shortest preference, respectively, -on a subexpression or a whole RE. -.PP -Match lengths are measured in characters, not collating elements. -An empty string is considered longer than no match at all. -For example, -\fBbb*\fR -matches the three middle characters of `\fBabbbc\fR', -\fB(week|wee)(night|knights)\fR -matches all ten characters of `\fBweeknights\fR', -when -\fB(.*).*\fR -is matched against -\fBabc\fR -the parenthesized subexpression -matches all three characters, and -when -\fB(a*)*\fR -is matched against -\fBbc\fR -both the whole RE and the parenthesized -subexpression match an empty string. -.PP -If case-independent matching is specified, -the effect is much as if all case distinctions had vanished from the -alphabet. -When an alphabetic that exists in multiple cases appears as an -ordinary character outside a bracket expression, it is effectively -transformed into a bracket expression containing both cases, -so that -\fBx\fR -becomes `\fB[xX]\fR'. -When it appears inside a bracket expression, all case counterparts -of it are added to the bracket expression, so that -\fB[x]\fR -becomes -\fB[xX]\fR -and -\fB[^x]\fR -becomes `\fB[^xX]\fR'. -.PP -If newline-sensitive matching is specified, \fB.\fR -and bracket expressions using -\fB^\fR -will never match the newline character -(so that matches will never cross newlines unless the RE -explicitly arranges it) -and -\fB^\fR -and -\fB$\fR -will match the empty string after and before a newline -respectively, in addition to matching at beginning and end of string -respectively. -ARE -\fB\eA\fR -and -\fB\eZ\fR -continue to match beginning or end of string \fIonly\fR. -.PP -If partial newline-sensitive matching is specified, -this affects \fB.\fR -and bracket expressions -as with newline-sensitive matching, but not -\fB^\fR -and `\fB$\fR'. -.PP -If inverse partial newline-sensitive matching is specified, -this affects -\fB^\fR -and -\fB$\fR -as with -newline-sensitive matching, -but not \fB.\fR -and bracket expressions. -This isn't very useful but is provided for symmetry. -.SH "LIMITS AND COMPATIBILITY" -No particular limit is imposed on the length of REs. -Programs intended to be highly portable should not employ REs longer -than 256 bytes, -as a POSIX-compliant implementation can refuse to accept such REs. -.PP -The only feature of AREs that is actually incompatible with -POSIX EREs is that -\fB\e\fR -does not lose its special -significance inside bracket expressions. -All other ARE features use syntax which is illegal or has -undefined or unspecified effects in POSIX EREs; -the -\fB***\fR -syntax of directors likewise is outside the POSIX -syntax for both BREs and EREs. -.PP -Many of the ARE extensions are borrowed from Perl, but some have -been changed to clean them up, and a few Perl extensions are not present. -Incompatibilities of note include `\fB\eb\fR', `\fB\eB\fR', -the lack of special treatment for a trailing newline, -the addition of complemented bracket expressions to the things -affected by newline-sensitive matching, -the restrictions on parentheses and back references in lookahead constraints, -and the longest/shortest-match (rather than first-match) matching semantics. -.PP -The matching rules for REs containing both normal and non-greedy quantifiers -have changed since early beta-test versions of this package. -(The new rules are much simpler and cleaner, -but don't work as hard at guessing the user's real intentions.) -.PP -Henry Spencer's original 1986 \fIregexp\fR package, -still in widespread use (e.g., in pre-8.1 releases of Tcl), -implemented an early version of today's EREs. -There are four incompatibilities between \fIregexp\fR's near-EREs -(`RREs' for short) and AREs. -In roughly increasing order of significance: -.PP -.RS -In AREs, -\fB\e\fR -followed by an alphanumeric character is either an -escape or an error, -while in RREs, it was just another way of writing the -alphanumeric. -This should not be a problem because there was no reason to write -such a sequence in RREs. -.PP -\fB{\fR -followed by a digit in an ARE is the beginning of a bound, -while in RREs, -\fB{\fR -was always an ordinary character. -Such sequences should be rare, -and will often result in an error because following characters -will not look like a valid bound. -.PP -In AREs, -\fB\e\fR -remains a special character within `\fB[\|]\fR', -so a literal -\fB\e\fR -within -\fB[\|]\fR -must be written `\fB\e\e\fR'. -\fB\e\e\fR -also gives a literal -\fB\e\fR -within -\fB[\|]\fR -in RREs, -but only truly paranoid programmers routinely doubled the backslash. -.PP -AREs report the longest/shortest match for the RE, -rather than the first found in a specified search order. -This may affect some RREs which were written in the expectation that -the first match would be reported. -(The careful crafting of RREs to optimize the search order for fast -matching is obsolete (AREs examine all possible matches -in parallel, and their performance is largely insensitive to their -complexity) but cases where the search order was exploited to deliberately -find a match which was \fInot\fR the longest/shortest will need rewriting.) -.RE - -.SH "BASIC REGULAR EXPRESSIONS" -BREs differ from EREs in several respects. `\fB|\fR', `\fB+\fR', -and -\fB?\fR -are ordinary characters and there is no equivalent -for their functionality. -The delimiters for bounds are -\fB\e{\fR -and `\fB\e}\fR', -with -\fB{\fR -and -\fB}\fR -by themselves ordinary characters. -The parentheses for nested subexpressions are -\fB\e(\fR -and `\fB\e)\fR', -with -\fB(\fR -and -\fB)\fR -by themselves ordinary characters. -\fB^\fR -is an ordinary character except at the beginning of the -RE or the beginning of a parenthesized subexpression, -\fB$\fR -is an ordinary character except at the end of the -RE or the end of a parenthesized subexpression, -and -\fB*\fR -is an ordinary character if it appears at the beginning of the -RE or the beginning of a parenthesized subexpression -(after a possible leading `\fB^\fR'). -Finally, -single-digit back references are available, -and -\fB\e<\fR -and -\fB\e>\fR -are synonyms for -\fB[[:<:]]\fR -and -\fB[[:>:]]\fR -respectively; -no other escapes are available. - -.SH "SEE ALSO" -RegExp(3), regexp(n), regsub(n), lsearch(n), switch(n), text(n) - -.SH KEYWORDS -match, regular expression, string diff --git a/wxWidgets/src/regex/regc_color.c b/wxWidgets/src/regex/regc_color.c deleted file mode 100644 index b3df484f08..0000000000 --- a/wxWidgets/src/regex/regc_color.c +++ /dev/null @@ -1,778 +0,0 @@ -/* - * colorings of characters - * This file is #included by regcomp.c. - * - * Copyright (c) 1998, 1999 Henry Spencer. All rights reserved. - * - * Development of this software was funded, in part, by Cray Research Inc., - * UUNET Communications Services Inc., Sun Microsystems Inc., and Scriptics - * Corporation, none of whom are responsible for the results. The author - * thanks all of them. - * - * Redistribution and use in source and binary forms -- with or without - * modification -- are permitted for any purpose, provided that - * redistributions in source form retain this entire copyright notice and - * indicate the origin and nature of any modifications. - * - * I'd appreciate being given credit for this package in the documentation - * of software which uses it, but that is not a requirement. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL - * HENRY SPENCER BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; - * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * - * - * Note that there are some incestuous relationships between this code and - * NFA arc maintenance, which perhaps ought to be cleaned up sometime. - */ - - - -#define CISERR() VISERR(cm->v) -#define CERR(e) VERR(cm->v, (e)) - - - -/* - - initcm - set up new colormap - ^ static VOID initcm(struct vars *, struct colormap *); - */ -static VOID -initcm(v, cm) -struct vars *v; -struct colormap *cm; -{ - int i; - int j; - union tree *t; - union tree *nextt; - struct colordesc *cd; - - cm->magic = CMMAGIC; - cm->v = v; - - cm->ncds = NINLINECDS; - cm->cd = cm->cdspace; - cm->max = 0; - cm->free = 0; - - cd = cm->cd; /* cm->cd[WHITE] */ - cd->sub = NOSUB; - cd->arcs = NULL; - cd->flags = 0; - cd->nchrs = CHR_MAX - CHR_MIN + 1; - - /* upper levels of tree */ - for (t = &cm->tree[0], j = NBYTS-1; j > 0; t = nextt, j--) { - nextt = t + 1; - for (i = BYTTAB-1; i >= 0; i--) - t->tptr[i] = nextt; - } - /* bottom level is solid white */ - t = &cm->tree[NBYTS-1]; - for (i = BYTTAB-1; i >= 0; i--) - t->tcolor[i] = WHITE; - cd->block = t; -} - -/* - - freecm - free dynamically-allocated things in a colormap - ^ static VOID freecm(struct colormap *); - */ -static VOID -freecm(cm) -struct colormap *cm; -{ - size_t i; - union tree *cb; - - cm->magic = 0; - if (NBYTS > 1) - cmtreefree(cm, cm->tree, 0); - for (i = 1; i <= cm->max; i++) /* skip WHITE */ - if (!UNUSEDCOLOR(&cm->cd[i])) { - cb = cm->cd[i].block; - if (cb != NULL) - FREE(cb); - } - if (cm->cd != cm->cdspace) - FREE(cm->cd); -} - -/* - - cmtreefree - free a non-terminal part of a colormap tree - ^ static VOID cmtreefree(struct colormap *, union tree *, int); - */ -static VOID -cmtreefree(cm, tree, level) -struct colormap *cm; -union tree *tree; -int level; /* level number (top == 0) of this block */ -{ - int i; - union tree *t; - union tree *fillt = &cm->tree[level+1]; - union tree *cb; - - assert(level < NBYTS-1); /* this level has pointers */ - for (i = BYTTAB-1; i >= 0; i--) { - t = tree->tptr[i]; - assert(t != NULL); - if (t != fillt) { - if (level < NBYTS-2) { /* more pointer blocks below */ - cmtreefree(cm, t, level+1); - FREE(t); - } else { /* color block below */ - cb = cm->cd[t->tcolor[0]].block; - if (t != cb) /* not a solid block */ - FREE(t); - } - } - } -} - -/* - - setcolor - set the color of a character in a colormap - ^ static color setcolor(struct colormap *, pchr, pcolor); - */ -static color /* previous color */ -setcolor(cm, c, co) -struct colormap *cm; -pchr c; -pcolor co; -{ - uchr uc = c; - int shift; - int level; - int b; - int bottom; - union tree *t; - union tree *newt; - union tree *fillt; - union tree *lastt; - union tree *cb; - color prev; - - assert(cm->magic == CMMAGIC); - if (CISERR() || co == COLORLESS) - return COLORLESS; - - t = cm->tree; - for (level = 0, shift = BYTBITS * (NBYTS - 1); shift > 0; - level++, shift -= BYTBITS) { - b = (uc >> shift) & BYTMASK; - lastt = t; - t = lastt->tptr[b]; - assert(t != NULL); - fillt = &cm->tree[level+1]; - bottom = (shift <= BYTBITS) ? 1 : 0; - cb = (bottom) ? cm->cd[t->tcolor[0]].block : fillt; - if (t == fillt || t == cb) { /* must allocate a new block */ - newt = (union tree *)MALLOC((bottom) ? - sizeof(struct colors) : sizeof(struct ptrs)); - if (newt == NULL) { - CERR(REG_ESPACE); - return COLORLESS; - } - if (bottom) - memcpy(VS(newt->tcolor), VS(t->tcolor), - BYTTAB*sizeof(color)); - else - memcpy(VS(newt->tptr), VS(t->tptr), - BYTTAB*sizeof(union tree *)); - t = newt; - lastt->tptr[b] = t; - } - } - - b = uc & BYTMASK; - prev = t->tcolor[b]; - t->tcolor[b] = (color)co; - return prev; -} - -/* - - maxcolor - report largest color number in use - ^ static color maxcolor(struct colormap *); - */ -static color -maxcolor(cm) -struct colormap *cm; -{ - if (CISERR()) - return COLORLESS; - - return (color)cm->max; -} - -/* - - newcolor - find a new color (must be subject of setcolor at once) - * Beware: may relocate the colordescs. - ^ static color newcolor(struct colormap *); - */ -static color /* COLORLESS for error */ -newcolor(cm) -struct colormap *cm; -{ - struct colordesc *cd; - struct colordesc *new; - size_t n; - - if (CISERR()) - return COLORLESS; - - if (cm->free != 0) { - assert(cm->free > 0); - assert((size_t)cm->free < cm->ncds); - cd = &cm->cd[cm->free]; - assert(UNUSEDCOLOR(cd)); - assert(cd->arcs == NULL); - cm->free = cd->sub; - } else if (cm->max < cm->ncds - 1) { - cm->max++; - cd = &cm->cd[cm->max]; - } else { - /* oops, must allocate more */ - n = cm->ncds * 2; - if (cm->cd == cm->cdspace) { - new = (struct colordesc *)MALLOC(n * - sizeof(struct colordesc)); - if (new != NULL) - memcpy(VS(new), VS(cm->cdspace), cm->ncds * - sizeof(struct colordesc)); - } else - new = (struct colordesc *)REALLOC(cm->cd, - n * sizeof(struct colordesc)); - if (new == NULL) { - CERR(REG_ESPACE); - return COLORLESS; - } - cm->cd = new; - cm->ncds = n; - assert(cm->max < cm->ncds - 1); - cm->max++; - cd = &cm->cd[cm->max]; - } - - cd->nchrs = 0; - cd->sub = NOSUB; - cd->arcs = NULL; - cd->flags = 0; - cd->block = NULL; - - return (color)(cd - cm->cd); -} - -/* - - freecolor - free a color (must have no arcs or subcolor) - ^ static VOID freecolor(struct colormap *, pcolor); - */ -static VOID -freecolor(cm, co) -struct colormap *cm; -pcolor co; -{ - struct colordesc *cd = &cm->cd[co]; - color pco, nco; /* for freelist scan */ - - assert(co >= 0); - if (co == WHITE) - return; - - assert(cd->arcs == NULL); - assert(cd->sub == NOSUB); - assert(cd->nchrs == 0); - cd->flags = FREECOL; - if (cd->block != NULL) { - FREE(cd->block); - cd->block = NULL; /* just paranoia */ - } - - if ((size_t)co == cm->max) { - while (cm->max > WHITE && UNUSEDCOLOR(&cm->cd[cm->max])) - cm->max--; - assert(cm->free >= 0); - while ((size_t)cm->free > cm->max) - cm->free = cm->cd[cm->free].sub; - if (cm->free > 0) { - assert(cm->free < cm->max); - pco = cm->free; - nco = cm->cd[pco].sub; - while (nco > 0) - if ((size_t)nco > cm->max) { - /* take this one out of freelist */ - nco = cm->cd[nco].sub; - cm->cd[pco].sub = nco; - } else { - assert(nco < cm->max); - pco = nco; - nco = cm->cd[pco].sub; - } - } - } else { - cd->sub = cm->free; - cm->free = (color)(cd - cm->cd); - } -} - -/* - - pseudocolor - allocate a false color, to be managed by other means - ^ static color pseudocolor(struct colormap *); - */ -static color -pseudocolor(cm) -struct colormap *cm; -{ - color co; - - co = newcolor(cm); - if (CISERR()) - return COLORLESS; - cm->cd[co].nchrs = 1; - cm->cd[co].flags = PSEUDO; - return co; -} - -/* - - subcolor - allocate a new subcolor (if necessary) to this chr - ^ static color subcolor(struct colormap *, pchr c); - */ -static color -subcolor(cm, c) -struct colormap *cm; -pchr c; -{ - color co; /* current color of c */ - color sco; /* new subcolor */ - - co = GETCOLOR(cm, c); - sco = newsub(cm, co); - if (CISERR()) - return COLORLESS; - assert(sco != COLORLESS); - - if (co == sco) /* already in an open subcolor */ - return co; /* rest is redundant */ - cm->cd[co].nchrs--; - cm->cd[sco].nchrs++; - setcolor(cm, c, sco); - return sco; -} - -/* - - newsub - allocate a new subcolor (if necessary) for a color - ^ static color newsub(struct colormap *, pcolor); - */ -static color -newsub(cm, co) -struct colormap *cm; -pcolor co; -{ - color sco; /* new subcolor */ - - sco = cm->cd[co].sub; - if (sco == NOSUB) { /* color has no open subcolor */ - if (cm->cd[co].nchrs == 1) /* optimization */ - return co; - sco = newcolor(cm); /* must create subcolor */ - if (sco == COLORLESS) { - assert(CISERR()); - return COLORLESS; - } - cm->cd[co].sub = sco; - cm->cd[sco].sub = sco; /* open subcolor points to self */ - } - assert(sco != NOSUB); - - return sco; -} - -/* - - subrange - allocate new subcolors to this range of chrs, fill in arcs - ^ static VOID subrange(struct vars *, pchr, pchr, struct state *, - ^ struct state *); - */ -static VOID -subrange(v, from, to, lp, rp) -struct vars *v; -pchr from; -pchr to; -struct state *lp; -struct state *rp; -{ - uchr uf; - int i; - - assert(from <= to); - - /* first, align "from" on a tree-block boundary */ - uf = (uchr)from; - i = (int)( ((uf + BYTTAB-1) & (uchr)~BYTMASK) - uf ); - for (; from <= to && i > 0; i--, from++) - newarc(v->nfa, PLAIN, subcolor(v->cm, from), lp, rp); - if (from > to) /* didn't reach a boundary */ - return; - - /* deal with whole blocks */ - for (; to - from >= BYTTAB; from += BYTTAB) - subblock(v, from, lp, rp); - - /* clean up any remaining partial table */ - for (; from <= to; from++) - newarc(v->nfa, PLAIN, subcolor(v->cm, from), lp, rp); -} - -/* - - subblock - allocate new subcolors for one tree block of chrs, fill in arcs - ^ static VOID subblock(struct vars *, pchr, struct state *, struct state *); - */ -static VOID -subblock(v, start, lp, rp) -struct vars *v; -pchr start; /* first of BYTTAB chrs */ -struct state *lp; -struct state *rp; -{ - uchr uc = start; - struct colormap *cm = v->cm; - int shift; - int level; - int i; - int b = 0; - union tree *t; - union tree *cb; - union tree *fillt; - union tree *lastt = NULL; - int previ; - int ndone; - color co; - color sco; - - assert((uc % BYTTAB) == 0); - - /* find its color block, making new pointer blocks as needed */ - t = cm->tree; - fillt = NULL; - for (level = 0, shift = BYTBITS * (NBYTS - 1); shift > 0; - level++, shift -= BYTBITS) { - b = (uc >> shift) & BYTMASK; - lastt = t; - t = lastt->tptr[b]; - assert(t != NULL); - fillt = &cm->tree[level+1]; - if (t == fillt && shift > BYTBITS) { /* need new ptr block */ - t = (union tree *)MALLOC(sizeof(struct ptrs)); - if (t == NULL) { - CERR(REG_ESPACE); - return; - } - memcpy(VS(t->tptr), VS(fillt->tptr), - BYTTAB*sizeof(union tree *)); - lastt->tptr[b] = t; - } - } - - /* special cases: fill block or solid block */ - co = t->tcolor[0]; - cb = cm->cd[co].block; - if (t == fillt || t == cb) { - /* either way, we want a subcolor solid block */ - sco = newsub(cm, co); - t = cm->cd[sco].block; - if (t == NULL) { /* must set it up */ - t = (union tree *)MALLOC(sizeof(struct colors)); - if (t == NULL) { - CERR(REG_ESPACE); - return; - } - for (i = 0; i < BYTTAB; i++) - t->tcolor[i] = sco; - cm->cd[sco].block = t; - } - /* find loop must have run at least once */ - lastt->tptr[b] = t; - newarc(v->nfa, PLAIN, sco, lp, rp); - cm->cd[co].nchrs -= BYTTAB; - cm->cd[sco].nchrs += BYTTAB; - return; - } - - /* general case, a mixed block to be altered */ - i = 0; - while (i < BYTTAB) { - co = t->tcolor[i]; - sco = newsub(cm, co); - newarc(v->nfa, PLAIN, sco, lp, rp); - previ = i; - do { - t->tcolor[i++] = sco; - } while (i < BYTTAB && t->tcolor[i] == co); - ndone = i - previ; - cm->cd[co].nchrs -= ndone; - cm->cd[sco].nchrs += ndone; - } -} - -/* - - okcolors - promote subcolors to full colors - ^ static VOID okcolors(struct nfa *, struct colormap *); - */ -static VOID -okcolors(nfa, cm) -struct nfa *nfa; -struct colormap *cm; -{ - struct colordesc *cd; - struct colordesc *end = CDEND(cm); - struct colordesc *scd; - struct arc *a; - color co; - color sco; - - for (cd = cm->cd, co = 0; cd < end; cd++, co++) { - sco = cd->sub; - if (UNUSEDCOLOR(cd) || sco == NOSUB) { - /* has no subcolor, no further action */ - } else if (sco == co) { - /* is subcolor, let parent deal with it */ - } else if (cd->nchrs == 0) { - /* parent empty, its arcs change color to subcolor */ - cd->sub = NOSUB; - scd = &cm->cd[sco]; - assert(scd->nchrs > 0); - assert(scd->sub == sco); - scd->sub = NOSUB; - while ((a = cd->arcs) != NULL) { - assert(a->co == co); - /* uncolorchain(cm, a); */ - cd->arcs = a->colorchain; - a->co = sco; - /* colorchain(cm, a); */ - a->colorchain = scd->arcs; - scd->arcs = a; - } - freecolor(cm, co); - } else { - /* parent's arcs must gain parallel subcolor arcs */ - cd->sub = NOSUB; - scd = &cm->cd[sco]; - assert(scd->nchrs > 0); - assert(scd->sub == sco); - scd->sub = NOSUB; - for (a = cd->arcs; a != NULL; a = a->colorchain) { - assert(a->co == co); - newarc(nfa, a->type, sco, a->from, a->to); - } - } - } -} - -/* - - colorchain - add this arc to the color chain of its color - ^ static VOID colorchain(struct colormap *, struct arc *); - */ -static VOID -colorchain(cm, a) -struct colormap *cm; -struct arc *a; -{ - struct colordesc *cd = &cm->cd[a->co]; - - a->colorchain = cd->arcs; - cd->arcs = a; -} - -/* - - uncolorchain - delete this arc from the color chain of its color - ^ static VOID uncolorchain(struct colormap *, struct arc *); - */ -static VOID -uncolorchain(cm, a) -struct colormap *cm; -struct arc *a; -{ - struct colordesc *cd = &cm->cd[a->co]; - struct arc *aa; - - aa = cd->arcs; - if (aa == a) /* easy case */ - cd->arcs = a->colorchain; - else { - for (; aa != NULL && aa->colorchain != a; aa = aa->colorchain) - continue; - assert(aa != NULL); - aa->colorchain = a->colorchain; - } - a->colorchain = NULL; /* paranoia */ -} - -/* - - singleton - is this character in its own color? - ^ static int singleton(struct colormap *, pchr c); - */ -static int /* predicate */ -singleton(cm, c) -struct colormap *cm; -pchr c; -{ - color co; /* color of c */ - - co = GETCOLOR(cm, c); - if (cm->cd[co].nchrs == 1 && cm->cd[co].sub == NOSUB) - return 1; - return 0; -} - -/* - - rainbow - add arcs of all full colors (but one) between specified states - ^ static VOID rainbow(struct nfa *, struct colormap *, int, pcolor, - ^ struct state *, struct state *); - */ -static VOID -rainbow(nfa, cm, type, but, from, to) -struct nfa *nfa; -struct colormap *cm; -int type; -pcolor but; /* COLORLESS if no exceptions */ -struct state *from; -struct state *to; -{ - struct colordesc *cd; - struct colordesc *end = CDEND(cm); - color co; - - for (cd = cm->cd, co = 0; cd < end && !CISERR(); cd++, co++) - if (!UNUSEDCOLOR(cd) && cd->sub != co && co != but && - !(cd->flags&PSEUDO)) - newarc(nfa, type, co, from, to); -} - -/* - - colorcomplement - add arcs of complementary colors - * The calling sequence ought to be reconciled with cloneouts(). - ^ static VOID colorcomplement(struct nfa *, struct colormap *, int, - ^ struct state *, struct state *, struct state *); - */ -static VOID -colorcomplement(nfa, cm, type, of, from, to) -struct nfa *nfa; -struct colormap *cm; -int type; -struct state *of; /* complements of this guy's PLAIN outarcs */ -struct state *from; -struct state *to; -{ - struct colordesc *cd; - struct colordesc *end = CDEND(cm); - color co; - - assert(of != from); - for (cd = cm->cd, co = 0; cd < end && !CISERR(); cd++, co++) - if (!UNUSEDCOLOR(cd) && !(cd->flags&PSEUDO)) - if (findarc(of, PLAIN, co) == NULL) - newarc(nfa, type, co, from, to); -} - - - -#ifdef REG_DEBUG -/* - ^ #ifdef REG_DEBUG - */ - -/* - - dumpcolors - debugging output - ^ static VOID dumpcolors(struct colormap *, FILE *); - */ -static VOID -dumpcolors(cm, f) -struct colormap *cm; -FILE *f; -{ - struct colordesc *cd; - struct colordesc *end; - color co; - chr c; - char *has; - - fprintf(f, "max %ld\n", (long)cm->max); - if (NBYTS > 1) - fillcheck(cm, cm->tree, 0, f); - end = CDEND(cm); - for (cd = cm->cd + 1, co = 1; cd < end; cd++, co++) /* skip 0 */ - if (!UNUSEDCOLOR(cd)) { - assert(cd->nchrs > 0); - has = (cd->block != NULL) ? "#" : ""; - if (cd->flags&PSEUDO) - fprintf(f, "#%2ld%s(ps): ", (long)co, has); - else - fprintf(f, "#%2ld%s(%2d): ", (long)co, - has, cd->nchrs); - /* it's hard to do this more efficiently */ - for (c = CHR_MIN; c < CHR_MAX; c++) - if (GETCOLOR(cm, c) == co) - dumpchr(c, f); - assert(c == CHR_MAX); - if (GETCOLOR(cm, c) == co) - dumpchr(c, f); - fprintf(f, "\n"); - } -} - -/* - - fillcheck - check proper filling of a tree - ^ static VOID fillcheck(struct colormap *, union tree *, int, FILE *); - */ -static VOID -fillcheck(cm, tree, level, f) -struct colormap *cm; -union tree *tree; -int level; /* level number (top == 0) of this block */ -FILE *f; -{ - int i; - union tree *t; - union tree *fillt = &cm->tree[level+1]; - - assert(level < NBYTS-1); /* this level has pointers */ - for (i = BYTTAB-1; i >= 0; i--) { - t = tree->tptr[i]; - if (t == NULL) - fprintf(f, "NULL found in filled tree!\n"); - else if (t == fillt) - {} - else if (level < NBYTS-2) /* more pointer blocks below */ - fillcheck(cm, t, level+1, f); - } -} - -/* - - dumpchr - print a chr - * Kind of char-centric but works well enough for debug use. - ^ static VOID dumpchr(pchr, FILE *); - */ -static VOID -dumpchr(c, f) -pchr c; -FILE *f; -{ - if (c == '\\') - fprintf(f, "\\\\"); - else if (c > ' ' && c <= '~') - putc((char)c, f); - else - fprintf(f, "\\u%04lx", (long)c); -} - -/* - ^ #endif - */ -#endif /* ifdef REG_DEBUG */ diff --git a/wxWidgets/src/regex/regc_cvec.c b/wxWidgets/src/regex/regc_cvec.c deleted file mode 100644 index d2d56fc70a..0000000000 --- a/wxWidgets/src/regex/regc_cvec.c +++ /dev/null @@ -1,208 +0,0 @@ -/* - * Utility functions for handling cvecs - * This file is #included by regcomp.c. - * - * Copyright (c) 1998, 1999 Henry Spencer. All rights reserved. - * - * Development of this software was funded, in part, by Cray Research Inc., - * UUNET Communications Services Inc., Sun Microsystems Inc., and Scriptics - * Corporation, none of whom are responsible for the results. The author - * thanks all of them. - * - * Redistribution and use in source and binary forms -- with or without - * modification -- are permitted for any purpose, provided that - * redistributions in source form retain this entire copyright notice and - * indicate the origin and nature of any modifications. - * - * I'd appreciate being given credit for this package in the documentation - * of software which uses it, but that is not a requirement. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL - * HENRY SPENCER BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; - * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -/* - - newcvec - allocate a new cvec - ^ static struct cvec *newcvec(int, int, int); - */ -static struct cvec * -newcvec(nchrs, nranges, nmcces) - int nchrs; /* to hold this many chrs... */ - int nranges; /* ... and this many ranges... */ - int nmcces; /* ... and this many MCCEs */ -{ - size_t n; - size_t nc; - struct cvec *cv; - - nc = (size_t)nchrs + (size_t)nmcces*(MAXMCCE+1) + (size_t)nranges*2; - n = sizeof(struct cvec) + (size_t)(nmcces-1)*sizeof(chr *) - + nc*sizeof(chr); - cv = (struct cvec *)MALLOC(n); - if (cv == NULL) { - return NULL; - } - cv->chrspace = nchrs; - cv->chrs = (chr *)&cv->mcces[nmcces]; /* chrs just after MCCE ptrs */ - cv->mccespace = nmcces; - cv->ranges = cv->chrs + nchrs + nmcces*(MAXMCCE+1); - cv->rangespace = nranges; - return clearcvec(cv); -} - -/* - - clearcvec - clear a possibly-new cvec - * Returns pointer as convenience. - ^ static struct cvec *clearcvec(struct cvec *); - */ -static struct cvec * -clearcvec(cv) - struct cvec *cv; /* character vector */ -{ - int i; - - assert(cv != NULL); - cv->nchrs = 0; - assert(cv->chrs == (chr *)&cv->mcces[cv->mccespace]); - cv->nmcces = 0; - cv->nmccechrs = 0; - cv->nranges = 0; - for (i = 0; i < cv->mccespace; i++) { - cv->mcces[i] = NULL; - } - - return cv; -} - -/* - - addchr - add a chr to a cvec - ^ static VOID addchr(struct cvec *, pchr); - */ -static VOID -addchr(cv, c) - struct cvec *cv; /* character vector */ - pchr c; /* character to add */ -{ - assert(cv->nchrs < cv->chrspace - cv->nmccechrs); - cv->chrs[cv->nchrs++] = (chr)c; -} - -/* - - addrange - add a range to a cvec - ^ static VOID addrange(struct cvec *, pchr, pchr); - */ -static VOID -addrange(cv, from, to) - struct cvec *cv; /* character vector */ - pchr from; /* first character of range */ - pchr to; /* last character of range */ -{ - assert(cv->nranges < cv->rangespace); - cv->ranges[cv->nranges*2] = (chr)from; - cv->ranges[cv->nranges*2 + 1] = (chr)to; - cv->nranges++; -} - -/* - - addmcce - add an MCCE to a cvec - ^ static VOID addmcce(struct cvec *, chr *, chr *); - */ -static VOID -addmcce(cv, startp, endp) - struct cvec *cv; /* character vector */ - chr *startp; /* beginning of text */ - chr *endp; /* just past end of text */ -{ - int len; - int i; - chr *s; - chr *d; - - if (startp == NULL && endp == NULL) { - return; - } - len = endp - startp; - assert(len > 0); - assert(cv->nchrs + len < cv->chrspace - cv->nmccechrs); - assert(cv->nmcces < cv->mccespace); - d = &cv->chrs[cv->chrspace - cv->nmccechrs - len - 1]; - cv->mcces[cv->nmcces++] = d; - for (s = startp, i = len; i > 0; s++, i--) { - *d++ = *s; - } - *d++ = 0; /* endmarker */ - assert(d == &cv->chrs[cv->chrspace - cv->nmccechrs]); - cv->nmccechrs += len + 1; -} - -/* - - haschr - does a cvec contain this chr? - ^ static int haschr(struct cvec *, pchr); - */ -static int /* predicate */ -haschr(cv, c) - struct cvec *cv; /* character vector */ - pchr c; /* character to test for */ -{ - int i; - chr *p; - - for (p = cv->chrs, i = cv->nchrs; i > 0; p++, i--) { - if (*p == c) { - return 1; - } - } - for (p = cv->ranges, i = cv->nranges; i > 0; p += 2, i--) { - if ((*p <= c) && (c <= *(p+1))) { - return 1; - } - } - return 0; -} - -/* - - getcvec - get a cvec, remembering it as v->cv - ^ static struct cvec *getcvec(struct vars *, int, int, int); - */ -static struct cvec * -getcvec(v, nchrs, nranges, nmcces) - struct vars *v; /* context */ - int nchrs; /* to hold this many chrs... */ - int nranges; /* ... and this many ranges... */ - int nmcces; /* ... and this many MCCEs */ -{ - if (v->cv != NULL && nchrs <= v->cv->chrspace && - nranges <= v->cv->rangespace && nmcces <= v->cv->mccespace) { - return clearcvec(v->cv); - } - - if (v->cv != NULL) { - freecvec(v->cv); - } - v->cv = newcvec(nchrs, nranges, nmcces); - if (v->cv == NULL) { - ERR(REG_ESPACE); - } - - return v->cv; -} - -/* - - freecvec - free a cvec - ^ static VOID freecvec(struct cvec *); - */ -static VOID -freecvec(cv) - struct cvec *cv; /* character vector */ -{ - FREE(cv); -} diff --git a/wxWidgets/src/regex/regc_lex.c b/wxWidgets/src/regex/regc_lex.c deleted file mode 100644 index 1acc3f4cae..0000000000 --- a/wxWidgets/src/regex/regc_lex.c +++ /dev/null @@ -1,1061 +0,0 @@ -/* - * lexical analyzer - * This file is #included by regcomp.c. - * - * Copyright (c) 1998, 1999 Henry Spencer. All rights reserved. - * - * Development of this software was funded, in part, by Cray Research Inc., - * UUNET Communications Services Inc., Sun Microsystems Inc., and Scriptics - * Corporation, none of whom are responsible for the results. The author - * thanks all of them. - * - * Redistribution and use in source and binary forms -- with or without - * modification -- are permitted for any purpose, provided that - * redistributions in source form retain this entire copyright notice and - * indicate the origin and nature of any modifications. - * - * I'd appreciate being given credit for this package in the documentation - * of software which uses it, but that is not a requirement. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL - * HENRY SPENCER BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; - * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -/* scanning macros (know about v) */ -#define ATEOS() (v->now >= v->stop) -#define HAVE(n) (v->stop - v->now >= (n)) -#define NEXT1(c) (!ATEOS() && *v->now == CHR(c)) -#define NEXT2(a,b) (HAVE(2) && *v->now == CHR(a) && *(v->now+1) == CHR(b)) -#define NEXT3(a,b,c) (HAVE(3) && *v->now == CHR(a) && \ - *(v->now+1) == CHR(b) && \ - *(v->now+2) == CHR(c)) -#define SET(c) (v->nexttype = (c)) -#define SETV(c, n) (v->nexttype = (c), v->nextvalue = (n)) -#define RET(c) return (SET(c), 1) -#define RETV(c, n) return (SETV(c, n), 1) -#define FAILW(e) return (ERR(e), 0) /* ERR does SET(EOS) */ -#define LASTTYPE(t) (v->lasttype == (t)) - -/* lexical contexts */ -#define L_ERE 1 /* mainline ERE/ARE */ -#define L_BRE 2 /* mainline BRE */ -#define L_Q 3 /* REG_QUOTE */ -#define L_EBND 4 /* ERE/ARE bound */ -#define L_BBND 5 /* BRE bound */ -#define L_BRACK 6 /* brackets */ -#define L_CEL 7 /* collating element */ -#define L_ECL 8 /* equivalence class */ -#define L_CCL 9 /* character class */ -#define INTOCON(c) (v->lexcon = (c)) -#define INCON(con) (v->lexcon == (con)) - -/* construct pointer past end of chr array */ -#define ENDOF(array) ((array) + sizeof(array)/sizeof(chr)) - -/* - - lexstart - set up lexical stuff, scan leading options - ^ static VOID lexstart(struct vars *); - */ -static VOID -lexstart(v) -struct vars *v; -{ - prefixes(v); /* may turn on new type bits etc. */ - NOERR(); - - if (v->cflags®_QUOTE) { - assert(!(v->cflags&(REG_ADVANCED|REG_EXPANDED|REG_NEWLINE))); - INTOCON(L_Q); - } else if (v->cflags®_EXTENDED) { - assert(!(v->cflags®_QUOTE)); - INTOCON(L_ERE); - } else { - assert(!(v->cflags&(REG_QUOTE|REG_ADVF))); - INTOCON(L_BRE); - } - - v->nexttype = EMPTY; /* remember we were at the start */ - next(v); /* set up the first token */ -} - -/* - - prefixes - implement various special prefixes - ^ static VOID prefixes(struct vars *); - */ -static VOID -prefixes(v) -struct vars *v; -{ - /* literal string doesn't get any of this stuff */ - if (v->cflags®_QUOTE) - return; - - /* initial "***" gets special things */ - if (HAVE(4) && NEXT3('*', '*', '*')) - switch (*(v->now + 3)) { - case CHR('?'): /* "***?" error, msg shows version */ - ERR(REG_BADPAT); - return; /* proceed no further */ - break; - case CHR('='): /* "***=" shifts to literal string */ - NOTE(REG_UNONPOSIX); - v->cflags |= REG_QUOTE; - v->cflags &= ~(REG_ADVANCED|REG_EXPANDED|REG_NEWLINE); - v->now += 4; - return; /* and there can be no more prefixes */ - break; - case CHR(':'): /* "***:" shifts to AREs */ - NOTE(REG_UNONPOSIX); - v->cflags |= REG_ADVANCED; - v->now += 4; - break; - default: /* otherwise *** is just an error */ - ERR(REG_BADRPT); - return; - break; - } - - /* BREs and EREs don't get embedded options */ - if ((v->cflags®_ADVANCED) != REG_ADVANCED) - return; - - /* embedded options (AREs only) */ - if (HAVE(3) && NEXT2('(', '?') && iscalpha(*(v->now + 2))) { - NOTE(REG_UNONPOSIX); - v->now += 2; - for (; !ATEOS() && iscalpha(*v->now); v->now++) - switch (*v->now) { - case CHR('b'): /* BREs (but why???) */ - v->cflags &= ~(REG_ADVANCED|REG_QUOTE); - break; - case CHR('c'): /* case sensitive */ - v->cflags &= ~REG_ICASE; - break; - case CHR('e'): /* plain EREs */ - v->cflags |= REG_EXTENDED; - v->cflags &= ~(REG_ADVF|REG_QUOTE); - break; - case CHR('i'): /* case insensitive */ - v->cflags |= REG_ICASE; - break; - case CHR('m'): /* Perloid synonym for n */ - case CHR('n'): /* \n affects ^ $ . [^ */ - v->cflags |= REG_NEWLINE; - break; - case CHR('p'): /* ~Perl, \n affects . [^ */ - v->cflags |= REG_NLSTOP; - v->cflags &= ~REG_NLANCH; - break; - case CHR('q'): /* literal string */ - v->cflags |= REG_QUOTE; - v->cflags &= ~REG_ADVANCED; - break; - case CHR('s'): /* single line, \n ordinary */ - v->cflags &= ~REG_NEWLINE; - break; - case CHR('t'): /* tight syntax */ - v->cflags &= ~REG_EXPANDED; - break; - case CHR('w'): /* weird, \n affects ^ $ only */ - v->cflags &= ~REG_NLSTOP; - v->cflags |= REG_NLANCH; - break; - case CHR('x'): /* expanded syntax */ - v->cflags |= REG_EXPANDED; - break; - default: - ERR(REG_BADOPT); - return; - } - if (!NEXT1(')')) { - ERR(REG_BADOPT); - return; - } - v->now++; - if (v->cflags®_QUOTE) - v->cflags &= ~(REG_EXPANDED|REG_NEWLINE); - } -} - -/* - - lexnest - "call a subroutine", interpolating string at the lexical level - * Note, this is not a very general facility. There are a number of - * implicit assumptions about what sorts of strings can be subroutines. - ^ static VOID lexnest(struct vars *, chr *, chr *); - */ -static VOID -lexnest(v, beginp, endp) -struct vars *v; -chr *beginp; /* start of interpolation */ -chr *endp; /* one past end of interpolation */ -{ - assert(v->savenow == NULL); /* only one level of nesting */ - v->savenow = v->now; - v->savestop = v->stop; - v->now = beginp; - v->stop = endp; -} - -/* - * string constants to interpolate as expansions of things like \d - */ -static chr backd[] = { /* \d */ - CHR('['), CHR('['), CHR(':'), - CHR('d'), CHR('i'), CHR('g'), CHR('i'), CHR('t'), - CHR(':'), CHR(']'), CHR(']') -}; -static chr backD[] = { /* \D */ - CHR('['), CHR('^'), CHR('['), CHR(':'), - CHR('d'), CHR('i'), CHR('g'), CHR('i'), CHR('t'), - CHR(':'), CHR(']'), CHR(']') -}; -static chr brbackd[] = { /* \d within brackets */ - CHR('['), CHR(':'), - CHR('d'), CHR('i'), CHR('g'), CHR('i'), CHR('t'), - CHR(':'), CHR(']') -}; -static chr backs[] = { /* \s */ - CHR('['), CHR('['), CHR(':'), - CHR('s'), CHR('p'), CHR('a'), CHR('c'), CHR('e'), - CHR(':'), CHR(']'), CHR(']') -}; -static chr backS[] = { /* \S */ - CHR('['), CHR('^'), CHR('['), CHR(':'), - CHR('s'), CHR('p'), CHR('a'), CHR('c'), CHR('e'), - CHR(':'), CHR(']'), CHR(']') -}; -static chr brbacks[] = { /* \s within brackets */ - CHR('['), CHR(':'), - CHR('s'), CHR('p'), CHR('a'), CHR('c'), CHR('e'), - CHR(':'), CHR(']') -}; -static chr backw[] = { /* \w */ - CHR('['), CHR('['), CHR(':'), - CHR('a'), CHR('l'), CHR('n'), CHR('u'), CHR('m'), - CHR(':'), CHR(']'), CHR('_'), CHR(']') -}; -static chr backW[] = { /* \W */ - CHR('['), CHR('^'), CHR('['), CHR(':'), - CHR('a'), CHR('l'), CHR('n'), CHR('u'), CHR('m'), - CHR(':'), CHR(']'), CHR('_'), CHR(']') -}; -static chr brbackw[] = { /* \w within brackets */ - CHR('['), CHR(':'), - CHR('a'), CHR('l'), CHR('n'), CHR('u'), CHR('m'), - CHR(':'), CHR(']'), CHR('_') -}; - -/* - - lexword - interpolate a bracket expression for word characters - * Possibly ought to inquire whether there is a "word" character class. - ^ static VOID lexword(struct vars *); - */ -static VOID -lexword(v) -struct vars *v; -{ - lexnest(v, backw, ENDOF(backw)); -} - -/* - - next - get next token - ^ static int next(struct vars *); - */ -static int /* 1 normal, 0 failure */ -next(v) -struct vars *v; -{ - chr c; - - /* errors yield an infinite sequence of failures */ - if (ISERR()) - return 0; /* the error has set nexttype to EOS */ - - /* remember flavor of last token */ - v->lasttype = v->nexttype; - - /* REG_BOSONLY */ - if (v->nexttype == EMPTY && (v->cflags®_BOSONLY)) { - /* at start of a REG_BOSONLY RE */ - RETV(SBEGIN, 0); /* same as \A */ - } - - /* if we're nested and we've hit end, return to outer level */ - if (v->savenow != NULL && ATEOS()) { - v->now = v->savenow; - v->stop = v->savestop; - v->savenow = v->savestop = NULL; - } - - /* skip white space etc. if appropriate (not in literal or []) */ - if (v->cflags®_EXPANDED) - switch (v->lexcon) { - case L_ERE: - case L_BRE: - case L_EBND: - case L_BBND: - skip(v); - break; - } - - /* handle EOS, depending on context */ - if (ATEOS()) { - switch (v->lexcon) { - case L_ERE: - case L_BRE: - case L_Q: - RET(EOS); - break; - case L_EBND: - case L_BBND: - FAILW(REG_EBRACE); - break; - case L_BRACK: - case L_CEL: - case L_ECL: - case L_CCL: - FAILW(REG_EBRACK); - break; - } - assert(NOTREACHED); - } - - /* okay, time to actually get a character */ - c = *v->now++; - - /* deal with the easy contexts, punt EREs to code below */ - switch (v->lexcon) { - case L_BRE: /* punt BREs to separate function */ - return brenext(v, c); - break; - case L_ERE: /* see below */ - break; - case L_Q: /* literal strings are easy */ - RETV(PLAIN, c); - break; - case L_BBND: /* bounds are fairly simple */ - case L_EBND: - switch (c) { - case CHR('0'): case CHR('1'): case CHR('2'): case CHR('3'): - case CHR('4'): case CHR('5'): case CHR('6'): case CHR('7'): - case CHR('8'): case CHR('9'): - RETV(DIGIT, (chr)DIGITVAL(c)); - break; - case CHR(','): - RET(','); - break; - case CHR('}'): /* ERE bound ends with } */ - if (INCON(L_EBND)) { - INTOCON(L_ERE); - if ((v->cflags®_ADVF) && NEXT1('?')) { - v->now++; - NOTE(REG_UNONPOSIX); - RETV('}', 0); - } - RETV('}', 1); - } else - FAILW(REG_BADBR); - break; - case CHR('\\'): /* BRE bound ends with \} */ - if (INCON(L_BBND) && NEXT1('}')) { - v->now++; - INTOCON(L_BRE); - RET('}'); - } else - FAILW(REG_BADBR); - break; - default: - FAILW(REG_BADBR); - break; - } - assert(NOTREACHED); - break; - case L_BRACK: /* brackets are not too hard */ - switch (c) { - case CHR(']'): - if (LASTTYPE('[')) - RETV(PLAIN, c); - else { - INTOCON((v->cflags®_EXTENDED) ? - L_ERE : L_BRE); - RET(']'); - } - break; - case CHR('\\'): - NOTE(REG_UBBS); - if (!(v->cflags®_ADVF)) - RETV(PLAIN, c); - NOTE(REG_UNONPOSIX); - if (ATEOS()) - FAILW(REG_EESCAPE); - (DISCARD)lexescape(v); - switch (v->nexttype) { /* not all escapes okay here */ - case PLAIN: - return 1; - break; - case CCLASS: - switch (v->nextvalue) { - case 'd': - lexnest(v, brbackd, ENDOF(brbackd)); - break; - case 's': - lexnest(v, brbacks, ENDOF(brbacks)); - break; - case 'w': - lexnest(v, brbackw, ENDOF(brbackw)); - break; - default: - FAILW(REG_EESCAPE); - break; - } - /* lexnest done, back up and try again */ - v->nexttype = v->lasttype; - return next(v); - break; - } - /* not one of the acceptable escapes */ - FAILW(REG_EESCAPE); - break; - case CHR('-'): - if (LASTTYPE('[') || NEXT1(']')) - RETV(PLAIN, c); - else - RETV(RANGE, c); - break; - case CHR('['): - if (ATEOS()) - FAILW(REG_EBRACK); - switch (*v->now++) { - case CHR('.'): - INTOCON(L_CEL); - /* might or might not be locale-specific */ - RET(COLLEL); - break; - case CHR('='): - INTOCON(L_ECL); - NOTE(REG_ULOCALE); - RET(ECLASS); - break; - case CHR(':'): - INTOCON(L_CCL); - NOTE(REG_ULOCALE); - RET(CCLASS); - break; - default: /* oops */ - v->now--; - RETV(PLAIN, c); - break; - } - assert(NOTREACHED); - break; - default: - RETV(PLAIN, c); - break; - } - assert(NOTREACHED); - break; - case L_CEL: /* collating elements are easy */ - if (c == CHR('.') && NEXT1(']')) { - v->now++; - INTOCON(L_BRACK); - RETV(END, '.'); - } else - RETV(PLAIN, c); - break; - case L_ECL: /* ditto equivalence classes */ - if (c == CHR('=') && NEXT1(']')) { - v->now++; - INTOCON(L_BRACK); - RETV(END, '='); - } else - RETV(PLAIN, c); - break; - case L_CCL: /* ditto character classes */ - if (c == CHR(':') && NEXT1(']')) { - v->now++; - INTOCON(L_BRACK); - RETV(END, ':'); - } else - RETV(PLAIN, c); - break; - default: - assert(NOTREACHED); - break; - } - - /* that got rid of everything except EREs and AREs */ - assert(INCON(L_ERE)); - - /* deal with EREs and AREs, except for backslashes */ - switch (c) { - case CHR('|'): - RET('|'); - break; - case CHR('*'): - if ((v->cflags®_ADVF) && NEXT1('?')) { - v->now++; - NOTE(REG_UNONPOSIX); - RETV('*', 0); - } - RETV('*', 1); - break; - case CHR('+'): - if ((v->cflags®_ADVF) && NEXT1('?')) { - v->now++; - NOTE(REG_UNONPOSIX); - RETV('+', 0); - } - RETV('+', 1); - break; - case CHR('?'): - if ((v->cflags®_ADVF) && NEXT1('?')) { - v->now++; - NOTE(REG_UNONPOSIX); - RETV('?', 0); - } - RETV('?', 1); - break; - case CHR('{'): /* bounds start or plain character */ - if (v->cflags®_EXPANDED) - skip(v); - if (ATEOS() || !iscdigit(*v->now)) { - NOTE(REG_UBRACES); - NOTE(REG_UUNSPEC); - RETV(PLAIN, c); - } else { - NOTE(REG_UBOUNDS); - INTOCON(L_EBND); - RET('{'); - } - assert(NOTREACHED); - break; - case CHR('('): /* parenthesis, or advanced extension */ - if ((v->cflags®_ADVF) && NEXT1('?')) { - NOTE(REG_UNONPOSIX); - v->now++; - switch (*v->now++) { - case CHR(':'): /* non-capturing paren */ - RETV('(', 0); - break; - case CHR('#'): /* comment */ - while (!ATEOS() && *v->now != CHR(')')) - v->now++; - if (!ATEOS()) - v->now++; - assert(v->nexttype == v->lasttype); - return next(v); - break; - case CHR('='): /* positive lookahead */ - NOTE(REG_ULOOKAHEAD); - RETV(LACON, 1); - break; - case CHR('!'): /* negative lookahead */ - NOTE(REG_ULOOKAHEAD); - RETV(LACON, 0); - break; - default: - FAILW(REG_BADRPT); - break; - } - assert(NOTREACHED); - } - if (v->cflags®_NOSUB) - RETV('(', 0); /* all parens non-capturing */ - else - RETV('(', 1); - break; - case CHR(')'): - if (LASTTYPE('(')) { - NOTE(REG_UUNSPEC); - } - RETV(')', c); - break; - case CHR('['): /* easy except for [[:<:]] and [[:>:]] */ - if (HAVE(6) && *(v->now+0) == CHR('[') && - *(v->now+1) == CHR(':') && - (*(v->now+2) == CHR('<') || - *(v->now+2) == CHR('>')) && - *(v->now+3) == CHR(':') && - *(v->now+4) == CHR(']') && - *(v->now+5) == CHR(']')) { - c = *(v->now+2); - v->now += 6; - NOTE(REG_UNONPOSIX); - RET((c == CHR('<')) ? '<' : '>'); - } - INTOCON(L_BRACK); - if (NEXT1('^')) { - v->now++; - RETV('[', 0); - } - RETV('[', 1); - break; - case CHR('.'): - RET('.'); - break; - case CHR('^'): - RET('^'); - break; - case CHR('$'): - RET('$'); - break; - case CHR('\\'): /* mostly punt backslashes to code below */ - if (ATEOS()) - FAILW(REG_EESCAPE); - break; - default: /* ordinary character */ - RETV(PLAIN, c); - break; - } - - /* ERE/ARE backslash handling; backslash already eaten */ - assert(!ATEOS()); - if (!(v->cflags®_ADVF)) { /* only AREs have non-trivial escapes */ - if (iscalnum(*v->now)) { - NOTE(REG_UBSALNUM); - NOTE(REG_UUNSPEC); - } - RETV(PLAIN, *v->now++); - } - (DISCARD)lexescape(v); - if (ISERR()) - FAILW(REG_EESCAPE); - if (v->nexttype == CCLASS) { /* fudge at lexical level */ - switch (v->nextvalue) { - case 'd': lexnest(v, backd, ENDOF(backd)); break; - case 'D': lexnest(v, backD, ENDOF(backD)); break; - case 's': lexnest(v, backs, ENDOF(backs)); break; - case 'S': lexnest(v, backS, ENDOF(backS)); break; - case 'w': lexnest(v, backw, ENDOF(backw)); break; - case 'W': lexnest(v, backW, ENDOF(backW)); break; - default: - assert(NOTREACHED); - FAILW(REG_ASSERT); - break; - } - /* lexnest done, back up and try again */ - v->nexttype = v->lasttype; - return next(v); - } - /* otherwise, lexescape has already done the work */ - return !ISERR(); -} - -/* - - lexescape - parse an ARE backslash escape (backslash already eaten) - * Note slightly nonstandard use of the CCLASS type code. - ^ static int lexescape(struct vars *); - */ -static int /* not actually used, but convenient for RETV */ -lexescape(v) -struct vars *v; -{ - chr c; - static chr alert[] = { - CHR('a'), CHR('l'), CHR('e'), CHR('r'), CHR('t') - }; - static chr esc[] = { - CHR('E'), CHR('S'), CHR('C') - }; - chr *save; - - assert(v->cflags®_ADVF); - - assert(!ATEOS()); - c = *v->now++; - if (!iscalnum(c)) - RETV(PLAIN, c); - - NOTE(REG_UNONPOSIX); - switch (c) { - case CHR('a'): - RETV(PLAIN, chrnamed(v, alert, ENDOF(alert), CHR('\007'))); - break; - case CHR('A'): - RETV(SBEGIN, 0); - break; - case CHR('b'): - RETV(PLAIN, CHR('\b')); - break; - case CHR('B'): - RETV(PLAIN, CHR('\\')); - break; - case CHR('c'): - NOTE(REG_UUNPORT); - if (ATEOS()) - FAILW(REG_EESCAPE); - RETV(PLAIN, (chr)(*v->now++ & 037)); - break; - case CHR('d'): - NOTE(REG_ULOCALE); - RETV(CCLASS, 'd'); - break; - case CHR('D'): - NOTE(REG_ULOCALE); - RETV(CCLASS, 'D'); - break; - case CHR('e'): - NOTE(REG_UUNPORT); - RETV(PLAIN, chrnamed(v, esc, ENDOF(esc), CHR('\033'))); - break; - case CHR('f'): - RETV(PLAIN, CHR('\f')); - break; - case CHR('m'): - RET('<'); - break; - case CHR('M'): - RET('>'); - break; - case CHR('n'): - RETV(PLAIN, CHR('\n')); - break; - case CHR('r'): - RETV(PLAIN, CHR('\r')); - break; - case CHR('s'): - NOTE(REG_ULOCALE); - RETV(CCLASS, 's'); - break; - case CHR('S'): - NOTE(REG_ULOCALE); - RETV(CCLASS, 'S'); - break; - case CHR('t'): - RETV(PLAIN, CHR('\t')); - break; - case CHR('u'): - c = lexdigits(v, 16, 4, 4); - if (ISERR()) - FAILW(REG_EESCAPE); - RETV(PLAIN, c); - break; - case CHR('U'): - c = lexdigits(v, 16, 8, 8); - if (ISERR()) - FAILW(REG_EESCAPE); - RETV(PLAIN, c); - break; - case CHR('v'): - RETV(PLAIN, CHR('\v')); - break; - case CHR('w'): - NOTE(REG_ULOCALE); - RETV(CCLASS, 'w'); - break; - case CHR('W'): - NOTE(REG_ULOCALE); - RETV(CCLASS, 'W'); - break; - case CHR('x'): - NOTE(REG_UUNPORT); - c = lexdigits(v, 16, 1, 255); /* REs >255 long outside spec */ - if (ISERR()) - FAILW(REG_EESCAPE); - RETV(PLAIN, c); - break; - case CHR('y'): - NOTE(REG_ULOCALE); - RETV(WBDRY, 0); - break; - case CHR('Y'): - NOTE(REG_ULOCALE); - RETV(NWBDRY, 0); - break; - case CHR('Z'): - RETV(SEND, 0); - break; - case CHR('1'): case CHR('2'): case CHR('3'): case CHR('4'): - case CHR('5'): case CHR('6'): case CHR('7'): case CHR('8'): - case CHR('9'): - save = v->now; - v->now--; /* put first digit back */ - c = lexdigits(v, 10, 1, 255); /* REs >255 long outside spec */ - if (ISERR()) - FAILW(REG_EESCAPE); - /* ugly heuristic (first test is "exactly 1 digit?") */ - if (v->now - save == 0 || (int)c <= v->nsubexp) { - NOTE(REG_UBACKREF); - RETV(BACKREF, (chr)c); - } - /* oops, doesn't look like it's a backref after all... */ - v->now = save; - /* and fall through into octal number */ - case CHR('0'): - NOTE(REG_UUNPORT); - v->now--; /* put first digit back */ - c = lexdigits(v, 8, 1, 3); - if (ISERR()) - FAILW(REG_EESCAPE); - RETV(PLAIN, c); - break; - default: - assert(iscalpha(c)); - FAILW(REG_EESCAPE); /* unknown alphabetic escape */ - break; - } - assert(NOTREACHED); -} - -/* - - lexdigits - slurp up digits and return chr value - ^ static chr lexdigits(struct vars *, int, int, int); - */ -static chr /* chr value; errors signalled via ERR */ -lexdigits(v, base, minlen, maxlen) -struct vars *v; -int base; -int minlen; -int maxlen; -{ - uchr n; /* unsigned to avoid overflow misbehavior */ - int len; - chr c; - int d; - CONST uchr ub = (uchr) base; - - n = 0; - for (len = 0; len < maxlen && !ATEOS(); len++) { - c = *v->now++; - switch (c) { - case CHR('0'): case CHR('1'): case CHR('2'): case CHR('3'): - case CHR('4'): case CHR('5'): case CHR('6'): case CHR('7'): - case CHR('8'): case CHR('9'): - d = DIGITVAL(c); - break; - case CHR('a'): case CHR('A'): d = 10; break; - case CHR('b'): case CHR('B'): d = 11; break; - case CHR('c'): case CHR('C'): d = 12; break; - case CHR('d'): case CHR('D'): d = 13; break; - case CHR('e'): case CHR('E'): d = 14; break; - case CHR('f'): case CHR('F'): d = 15; break; - default: - v->now--; /* oops, not a digit at all */ - d = -1; - break; - } - - if (d >= base) { /* not a plausible digit */ - v->now--; - d = -1; - } - if (d < 0) - break; /* NOTE BREAK OUT */ - n = n*ub + (uchr)d; - } - if (len < minlen) - ERR(REG_EESCAPE); - - return (chr)n; -} - -/* - - brenext - get next BRE token - * This is much like EREs except for all the stupid backslashes and the - * context-dependency of some things. - ^ static int brenext(struct vars *, pchr); - */ -static int /* 1 normal, 0 failure */ -brenext(v, pc) -struct vars *v; -pchr pc; -{ - chr c = (chr)pc; - - switch (c) { - case CHR('*'): - if (LASTTYPE(EMPTY) || LASTTYPE('(') || LASTTYPE('^')) - RETV(PLAIN, c); - RET('*'); - break; - case CHR('['): - if (HAVE(6) && *(v->now+0) == CHR('[') && - *(v->now+1) == CHR(':') && - (*(v->now+2) == CHR('<') || - *(v->now+2) == CHR('>')) && - *(v->now+3) == CHR(':') && - *(v->now+4) == CHR(']') && - *(v->now+5) == CHR(']')) { - c = *(v->now+2); - v->now += 6; - NOTE(REG_UNONPOSIX); - RET((c == CHR('<')) ? '<' : '>'); - } - INTOCON(L_BRACK); - if (NEXT1('^')) { - v->now++; - RETV('[', 0); - } - RETV('[', 1); - break; - case CHR('.'): - RET('.'); - break; - case CHR('^'): - if (LASTTYPE(EMPTY)) - RET('^'); - if (LASTTYPE('(')) { - NOTE(REG_UUNSPEC); - RET('^'); - } - RETV(PLAIN, c); - break; - case CHR('$'): - if (v->cflags®_EXPANDED) - skip(v); - if (ATEOS()) - RET('$'); - if (NEXT2('\\', ')')) { - NOTE(REG_UUNSPEC); - RET('$'); - } - RETV(PLAIN, c); - break; - case CHR('\\'): - break; /* see below */ - default: - RETV(PLAIN, c); - break; - } - - assert(c == CHR('\\')); - - if (ATEOS()) - FAILW(REG_EESCAPE); - - c = *v->now++; - switch (c) { - case CHR('{'): - INTOCON(L_BBND); - NOTE(REG_UBOUNDS); - RET('{'); - break; - case CHR('('): - RETV('(', 1); - break; - case CHR(')'): - RETV(')', c); - break; - case CHR('<'): - NOTE(REG_UNONPOSIX); - RET('<'); - break; - case CHR('>'): - NOTE(REG_UNONPOSIX); - RET('>'); - break; - case CHR('1'): case CHR('2'): case CHR('3'): case CHR('4'): - case CHR('5'): case CHR('6'): case CHR('7'): case CHR('8'): - case CHR('9'): - NOTE(REG_UBACKREF); - RETV(BACKREF, (chr)DIGITVAL(c)); - break; - default: - if (iscalnum(c)) { - NOTE(REG_UBSALNUM); - NOTE(REG_UUNSPEC); - } - RETV(PLAIN, c); - break; - } - - assert(NOTREACHED); -} - -/* - - skip - skip white space and comments in expanded form - ^ static VOID skip(struct vars *); - */ -static VOID -skip(v) -struct vars *v; -{ - chr *start = v->now; - - assert(v->cflags®_EXPANDED); - - for (;;) { - while (!ATEOS() && iscspace(*v->now)) - v->now++; - if (ATEOS() || *v->now != CHR('#')) - break; /* NOTE BREAK OUT */ - assert(NEXT1('#')); - while (!ATEOS() && *v->now != CHR('\n')) - v->now++; - /* leave the newline to be picked up by the iscspace loop */ - } - - if (v->now != start) - NOTE(REG_UNONPOSIX); -} - -/* - - newline - return the chr for a newline - * This helps confine use of CHR to this source file. - ^ static chr newline(NOPARMS); - */ -static chr -newline() -{ - return CHR('\n'); -} - -/* - - ch - return the chr sequence for regc_locale.c's fake collating element ch - * This helps confine use of CHR to this source file. Beware that the caller - * knows how long the sequence is. - ^ #ifdef REG_DEBUG - ^ static chr *ch(NOPARMS); - ^ #endif - */ -#ifdef REG_DEBUG -static chr * -ch() -{ - static chr chstr[] = { CHR('c'), CHR('h'), CHR('\0') }; - - return chstr; -} -#endif - -/* - - chrnamed - return the chr known by a given (chr string) name - * The code is a bit clumsy, but this routine gets only such specialized - * use that it hardly matters. - ^ static chr chrnamed(struct vars *, chr *, chr *, pchr); - */ -static chr -chrnamed(v, startp, endp, lastresort) -struct vars *v; -chr *startp; /* start of name */ -chr *endp; /* just past end of name */ -pchr lastresort; /* what to return if name lookup fails */ -{ - celt c; - int errsave; - int e; - struct cvec *cv; - - errsave = v->err; - v->err = 0; - c = element(v, startp, endp); - e = v->err; - v->err = errsave; - - if (e != 0) - return (chr)lastresort; - - cv = range(v, c, c, 0); - if (cv->nchrs == 0) - return (chr)lastresort; - return cv->chrs[0]; -} diff --git a/wxWidgets/src/regex/regc_locale.c b/wxWidgets/src/regex/regc_locale.c deleted file mode 100644 index 0369f2f9de..0000000000 --- a/wxWidgets/src/regex/regc_locale.c +++ /dev/null @@ -1,1178 +0,0 @@ -/* - * regc_locale.c -- - * - * This file contains the Unicode locale specific regexp routines. - * This file is #included by regcomp.c. - * - * Copyright (c) 1998 by Scriptics Corporation. - * - * See the file "license.terms" for information on usage and redistribution - * of this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: regc_locale.c 65053 2010-07-23 11:56:53Z VZ $ - * - * wxWidgets: - * The Scriptics license can be found in the file COPYRIGHT. Modifications - * for wxWidgets are under the wxWidgets licence, see README for details. - */ - -#define CONST const - -/* ASCII character-name table */ - -static struct cname { - chr *name; - char code; -} cnames[] = { - {wxT("NUL"), '\0'}, - {wxT("SOH"), '\001'}, - {wxT("STX"), '\002'}, - {wxT("ETX"), '\003'}, - {wxT("EOT"), '\004'}, - {wxT("ENQ"), '\005'}, - {wxT("ACK"), '\006'}, - {wxT("BEL"), '\007'}, - {wxT("alert"), '\007'}, - {wxT("BS"), '\010'}, - {wxT("backspace"), '\b'}, - {wxT("HT"), '\011'}, - {wxT("tab"), '\t'}, - {wxT("LF"), '\012'}, - {wxT("newline"), '\n'}, - {wxT("VT"), '\013'}, - {wxT("vertical-tab"), '\v'}, - {wxT("FF"), '\014'}, - {wxT("form-feed"), '\f'}, - {wxT("CR"), '\015'}, - {wxT("carriage-return"), '\r'}, - {wxT("SO"), '\016'}, - {wxT("SI"), '\017'}, - {wxT("DLE"), '\020'}, - {wxT("DC1"), '\021'}, - {wxT("DC2"), '\022'}, - {wxT("DC3"), '\023'}, - {wxT("DC4"), '\024'}, - {wxT("NAK"), '\025'}, - {wxT("SYN"), '\026'}, - {wxT("ETB"), '\027'}, - {wxT("CAN"), '\030'}, - {wxT("EM"), '\031'}, - {wxT("SUB"), '\032'}, - {wxT("ESC"), '\033'}, - {wxT("IS4"), '\034'}, - {wxT("FS"), '\034'}, - {wxT("IS3"), '\035'}, - {wxT("GS"), '\035'}, - {wxT("IS2"), '\036'}, - {wxT("RS"), '\036'}, - {wxT("IS1"), '\037'}, - {wxT("US"), '\037'}, - {wxT("space"), ' '}, - {wxT("exclamation-mark"), '!'}, - {wxT("quotation-mark"), '"'}, - {wxT("number-sign"), '#'}, - {wxT("dollar-sign"), '$'}, - {wxT("percent-sign"), '%'}, - {wxT("ampersand"), '&'}, - {wxT("apostrophe"), '\''}, - {wxT("left-parenthesis"), '('}, - {wxT("right-parenthesis"), ')'}, - {wxT("asterisk"), '*'}, - {wxT("plus-sign"), '+'}, - {wxT("comma"), ','}, - {wxT("hyphen"), '-'}, - {wxT("hyphen-minus"), '-'}, - {wxT("period"), '.'}, - {wxT("full-stop"), '.'}, - {wxT("slash"), '/'}, - {wxT("solidus"), '/'}, - {wxT("zero"), '0'}, - {wxT("one"), '1'}, - {wxT("two"), '2'}, - {wxT("three"), '3'}, - {wxT("four"), '4'}, - {wxT("five"), '5'}, - {wxT("six"), '6'}, - {wxT("seven"), '7'}, - {wxT("eight"), '8'}, - {wxT("nine"), '9'}, - {wxT("colon"), ':'}, - {wxT("semicolon"), ';'}, - {wxT("less-than-sign"), '<'}, - {wxT("equals-sign"), '='}, - {wxT("greater-than-sign"), '>'}, - {wxT("question-mark"), '?'}, - {wxT("commercial-at"), '@'}, - {wxT("left-square-bracket"), '['}, - {wxT("backslash"), '\\'}, - {wxT("reverse-solidus"), '\\'}, - {wxT("right-square-bracket"), ']'}, - {wxT("circumflex"), '^'}, - {wxT("circumflex-accent"), '^'}, - {wxT("underscore"), '_'}, - {wxT("low-line"), '_'}, - {wxT("grave-accent"), '`'}, - {wxT("left-brace"), '{'}, - {wxT("left-curly-bracket"), '{'}, - {wxT("vertical-line"), '|'}, - {wxT("right-brace"), '}'}, - {wxT("right-curly-bracket"), '}'}, - {wxT("tilde"), '~'}, - {wxT("DEL"), '\177'}, - {NULL, 0} -}; - -#if wxUSE_UNICODE - -/* Unicode character-class tables */ - -typedef struct crange { - chr start; - chr end; -} crange; - -/* - * Declarations of Unicode character ranges. This code - * is automatically generated by the tools/uniClass.tcl script - * and used in generic/regc_locale.c. Do not modify by hand. - */ - -/* Unicode: alphabetic characters */ - -static crange alphaRangeTable[] = { - {0x0041, 0x005a}, {0x0061, 0x007a}, {0x00c0, 0x00d6}, {0x00d8, 0x00f6}, - {0x00f8, 0x021f}, {0x0222, 0x0233}, {0x0250, 0x02ad}, {0x02b0, 0x02b8}, - {0x02bb, 0x02c1}, {0x02e0, 0x02e4}, {0x0388, 0x038a}, {0x038e, 0x03a1}, - {0x03a3, 0x03ce}, {0x03d0, 0x03d7}, {0x03da, 0x03f5}, {0x0400, 0x0481}, - {0x048c, 0x04c4}, {0x04d0, 0x04f5}, {0x0531, 0x0556}, {0x0561, 0x0587}, - {0x05d0, 0x05ea}, {0x05f0, 0x05f2}, {0x0621, 0x063a}, {0x0640, 0x064a}, - {0x0671, 0x06d3}, {0x06fa, 0x06fc}, {0x0712, 0x072c}, {0x0780, 0x07a5}, - {0x0905, 0x0939}, {0x0958, 0x0961}, {0x0985, 0x098c}, {0x0993, 0x09a8}, - {0x09aa, 0x09b0}, {0x09b6, 0x09b9}, {0x09df, 0x09e1}, {0x0a05, 0x0a0a}, - {0x0a13, 0x0a28}, {0x0a2a, 0x0a30}, {0x0a59, 0x0a5c}, {0x0a72, 0x0a74}, - {0x0a85, 0x0a8b}, {0x0a8f, 0x0a91}, {0x0a93, 0x0aa8}, {0x0aaa, 0x0ab0}, - {0x0ab5, 0x0ab9}, {0x0b05, 0x0b0c}, {0x0b13, 0x0b28}, {0x0b2a, 0x0b30}, - {0x0b36, 0x0b39}, {0x0b5f, 0x0b61}, {0x0b85, 0x0b8a}, {0x0b8e, 0x0b90}, - {0x0b92, 0x0b95}, {0x0ba8, 0x0baa}, {0x0bae, 0x0bb5}, {0x0bb7, 0x0bb9}, - {0x0c05, 0x0c0c}, {0x0c0e, 0x0c10}, {0x0c12, 0x0c28}, {0x0c2a, 0x0c33}, - {0x0c35, 0x0c39}, {0x0c85, 0x0c8c}, {0x0c8e, 0x0c90}, {0x0c92, 0x0ca8}, - {0x0caa, 0x0cb3}, {0x0cb5, 0x0cb9}, {0x0d05, 0x0d0c}, {0x0d0e, 0x0d10}, - {0x0d12, 0x0d28}, {0x0d2a, 0x0d39}, {0x0d85, 0x0d96}, {0x0d9a, 0x0db1}, - {0x0db3, 0x0dbb}, {0x0dc0, 0x0dc6}, {0x0e01, 0x0e30}, {0x0e40, 0x0e46}, - {0x0e94, 0x0e97}, {0x0e99, 0x0e9f}, {0x0ea1, 0x0ea3}, {0x0ead, 0x0eb0}, - {0x0ec0, 0x0ec4}, {0x0f40, 0x0f47}, {0x0f49, 0x0f6a}, {0x0f88, 0x0f8b}, - {0x1000, 0x1021}, {0x1023, 0x1027}, {0x1050, 0x1055}, {0x10a0, 0x10c5}, - {0x10d0, 0x10f6}, {0x1100, 0x1159}, {0x115f, 0x11a2}, {0x11a8, 0x11f9}, - {0x1200, 0x1206}, {0x1208, 0x1246}, {0x124a, 0x124d}, {0x1250, 0x1256}, - {0x125a, 0x125d}, {0x1260, 0x1286}, {0x128a, 0x128d}, {0x1290, 0x12ae}, - {0x12b2, 0x12b5}, {0x12b8, 0x12be}, {0x12c2, 0x12c5}, {0x12c8, 0x12ce}, - {0x12d0, 0x12d6}, {0x12d8, 0x12ee}, {0x12f0, 0x130e}, {0x1312, 0x1315}, - {0x1318, 0x131e}, {0x1320, 0x1346}, {0x1348, 0x135a}, {0x13a0, 0x13f4}, - {0x1401, 0x166c}, {0x166f, 0x1676}, {0x1681, 0x169a}, {0x16a0, 0x16ea}, - {0x1780, 0x17b3}, {0x1820, 0x1877}, {0x1880, 0x18a8}, {0x1e00, 0x1e9b}, - {0x1ea0, 0x1ef9}, {0x1f00, 0x1f15}, {0x1f18, 0x1f1d}, {0x1f20, 0x1f45}, - {0x1f48, 0x1f4d}, {0x1f50, 0x1f57}, {0x1f5f, 0x1f7d}, {0x1f80, 0x1fb4}, - {0x1fb6, 0x1fbc}, {0x1fc2, 0x1fc4}, {0x1fc6, 0x1fcc}, {0x1fd0, 0x1fd3}, - {0x1fd6, 0x1fdb}, {0x1fe0, 0x1fec}, {0x1ff2, 0x1ff4}, {0x1ff6, 0x1ffc}, - {0x210a, 0x2113}, {0x2119, 0x211d}, {0x212a, 0x212d}, {0x212f, 0x2131}, - {0x2133, 0x2139}, {0x3031, 0x3035}, {0x3041, 0x3094}, {0x30a1, 0x30fa}, - {0x30fc, 0x30fe}, {0x3105, 0x312c}, {0x3131, 0x318e}, {0x31a0, 0x31b7}, - {0x3400, 0x4db5}, {0x4e00, 0x9fa5}, {0xa000, 0xa48c}, {0xac00, 0xd7a3}, - {0xf900, 0xfa2d}, {0xfb00, 0xfb06}, {0xfb13, 0xfb17}, {0xfb1f, 0xfb28}, - {0xfb2a, 0xfb36}, {0xfb38, 0xfb3c}, {0xfb46, 0xfbb1}, {0xfbd3, 0xfd3d}, - {0xfd50, 0xfd8f}, {0xfd92, 0xfdc7}, {0xfdf0, 0xfdfb}, {0xfe70, 0xfe72}, - {0xfe76, 0xfefc}, {0xff21, 0xff3a}, {0xff41, 0xff5a}, {0xff66, 0xffbe}, - {0xffc2, 0xffc7}, {0xffca, 0xffcf}, {0xffd2, 0xffd7}, {0xffda, 0xffdc} -}; - -#define NUM_ALPHA_RANGE (sizeof(alphaRangeTable)/sizeof(crange)) - -static chr alphaCharTable[] = { - 0x00aa, 0x00b5, 0x00ba, 0x02d0, 0x02d1, 0x02ee, 0x037a, 0x0386, 0x038c, - 0x04c7, 0x04c8, 0x04cb, 0x04cc, 0x04f8, 0x04f9, 0x0559, 0x06d5, 0x06e5, - 0x06e6, 0x0710, 0x093d, 0x0950, 0x098f, 0x0990, 0x09b2, 0x09dc, 0x09dd, - 0x09f0, 0x09f1, 0x0a0f, 0x0a10, 0x0a32, 0x0a33, 0x0a35, 0x0a36, 0x0a38, - 0x0a39, 0x0a5e, 0x0a8d, 0x0ab2, 0x0ab3, 0x0abd, 0x0ad0, 0x0ae0, 0x0b0f, - 0x0b10, 0x0b32, 0x0b33, 0x0b3d, 0x0b5c, 0x0b5d, 0x0b99, 0x0b9a, 0x0b9c, - 0x0b9e, 0x0b9f, 0x0ba3, 0x0ba4, 0x0c60, 0x0c61, 0x0cde, 0x0ce0, 0x0ce1, - 0x0d60, 0x0d61, 0x0dbd, 0x0e32, 0x0e33, 0x0e81, 0x0e82, 0x0e84, 0x0e87, - 0x0e88, 0x0e8a, 0x0e8d, 0x0ea5, 0x0ea7, 0x0eaa, 0x0eab, 0x0eb2, 0x0eb3, - 0x0ebd, 0x0ec6, 0x0edc, 0x0edd, 0x0f00, 0x1029, 0x102a, 0x1248, 0x1258, - 0x1288, 0x12b0, 0x12c0, 0x1310, 0x1f59, 0x1f5b, 0x1f5d, 0x1fbe, 0x207f, - 0x2102, 0x2107, 0x2115, 0x2124, 0x2126, 0x2128, 0x3005, 0x3006, 0x309d, - 0x309e, 0xfb1d, 0xfb3e, 0xfb40, 0xfb41, 0xfb43, 0xfb44, 0xfe74, 0xfffe -}; - -#define NUM_ALPHA_CHAR (sizeof(alphaCharTable)/sizeof(chr)) - -/* Unicode: decimal digit characters */ - -static crange digitRangeTable[] = { - {0x0030, 0x0039}, {0x0660, 0x0669}, {0x06f0, 0x06f9}, {0x0966, 0x096f}, - {0x09e6, 0x09ef}, {0x0a66, 0x0a6f}, {0x0ae6, 0x0aef}, {0x0b66, 0x0b6f}, - {0x0be7, 0x0bef}, {0x0c66, 0x0c6f}, {0x0ce6, 0x0cef}, {0x0d66, 0x0d6f}, - {0x0e50, 0x0e59}, {0x0ed0, 0x0ed9}, {0x0f20, 0x0f29}, {0x1040, 0x1049}, - {0x1369, 0x1371}, {0x17e0, 0x17e9}, {0x1810, 0x1819}, {0xff10, 0xff19} -}; - -#define NUM_DIGIT_RANGE (sizeof(digitRangeTable)/sizeof(crange)) - -/* no singletons of digit characters */ - -/* Unicode: punctuation characters */ - -static crange punctRangeTable[] = { - {0x0021, 0x0023}, {0x0025, 0x002a}, {0x002c, 0x002f}, {0x005b, 0x005d}, - {0x055a, 0x055f}, {0x066a, 0x066d}, {0x0700, 0x070d}, {0x0f04, 0x0f12}, - {0x0f3a, 0x0f3d}, {0x104a, 0x104f}, {0x1361, 0x1368}, {0x16eb, 0x16ed}, - {0x17d4, 0x17da}, {0x1800, 0x180a}, {0x2010, 0x2027}, {0x2030, 0x2043}, - {0x2048, 0x204d}, {0x3001, 0x3003}, {0x3008, 0x3011}, {0x3014, 0x301f}, - {0xfe30, 0xfe44}, {0xfe49, 0xfe52}, {0xfe54, 0xfe61}, {0xff01, 0xff03}, - {0xff05, 0xff0a}, {0xff0c, 0xff0f}, {0xff3b, 0xff3d}, {0xff61, 0xff65} -}; - -#define NUM_PUNCT_RANGE (sizeof(punctRangeTable)/sizeof(crange)) - -static chr punctCharTable[] = { - 0x003a, 0x003b, 0x003f, 0x0040, 0x005f, 0x007b, 0x007d, 0x00a1, 0x00ab, - 0x00ad, 0x00b7, 0x00bb, 0x00bf, 0x037e, 0x0387, 0x0589, 0x058a, 0x05be, - 0x05c0, 0x05c3, 0x05f3, 0x05f4, 0x060c, 0x061b, 0x061f, 0x06d4, 0x0964, - 0x0965, 0x0970, 0x0df4, 0x0e4f, 0x0e5a, 0x0e5b, 0x0f85, 0x10fb, 0x166d, - 0x166e, 0x169b, 0x169c, 0x17dc, 0x2045, 0x2046, 0x207d, 0x207e, 0x208d, - 0x208e, 0x2329, 0x232a, 0x3030, 0x30fb, 0xfd3e, 0xfd3f, 0xfe63, 0xfe68, - 0xfe6a, 0xfe6b, 0xff1a, 0xff1b, 0xff1f, 0xff20, 0xff3f, 0xff5b, 0xff5d -}; - -#define NUM_PUNCT_CHAR (sizeof(punctCharTable)/sizeof(chr)) - -/* Unicode: white space characters */ - -static crange spaceRangeTable[] = { - {0x0009, 0x000d}, {0x2000, 0x200b} -}; - -#define NUM_SPACE_RANGE (sizeof(spaceRangeTable)/sizeof(crange)) - -static chr spaceCharTable[] = { - 0x0020, 0x00a0, 0x1680, 0x2028, 0x2029, 0x202f, 0x3000 -}; - -#define NUM_SPACE_CHAR (sizeof(spaceCharTable)/sizeof(chr)) - -/* Unicode: lowercase characters */ - -static crange lowerRangeTable[] = { - {0x0061, 0x007a}, {0x00df, 0x00f6}, {0x00f8, 0x00ff}, {0x017e, 0x0180}, - {0x0199, 0x019b}, {0x01bd, 0x01bf}, {0x0250, 0x02ad}, {0x03ac, 0x03ce}, - {0x03d5, 0x03d7}, {0x03ef, 0x03f3}, {0x0430, 0x045f}, {0x0561, 0x0587}, - {0x1e95, 0x1e9b}, {0x1f00, 0x1f07}, {0x1f10, 0x1f15}, {0x1f20, 0x1f27}, - {0x1f30, 0x1f37}, {0x1f40, 0x1f45}, {0x1f50, 0x1f57}, {0x1f60, 0x1f67}, - {0x1f70, 0x1f7d}, {0x1f80, 0x1f87}, {0x1f90, 0x1f97}, {0x1fa0, 0x1fa7}, - {0x1fb0, 0x1fb4}, {0x1fc2, 0x1fc4}, {0x1fd0, 0x1fd3}, {0x1fe0, 0x1fe7}, - {0x1ff2, 0x1ff4}, {0xfb00, 0xfb06}, {0xfb13, 0xfb17}, {0xff41, 0xff5a} -}; - -#define NUM_LOWER_RANGE (sizeof(lowerRangeTable)/sizeof(crange)) - -static chr lowerCharTable[] = { - 0x00aa, 0x00b5, 0x00ba, 0x0101, 0x0103, 0x0105, 0x0107, 0x0109, 0x010b, - 0x010d, 0x010f, 0x0111, 0x0113, 0x0115, 0x0117, 0x0119, 0x011b, 0x011d, - 0x011f, 0x0121, 0x0123, 0x0125, 0x0127, 0x0129, 0x012b, 0x012d, 0x012f, - 0x0131, 0x0133, 0x0135, 0x0137, 0x0138, 0x013a, 0x013c, 0x013e, 0x0140, - 0x0142, 0x0144, 0x0146, 0x0148, 0x0149, 0x014b, 0x014d, 0x014f, 0x0151, - 0x0153, 0x0155, 0x0157, 0x0159, 0x015b, 0x015d, 0x015f, 0x0161, 0x0163, - 0x0165, 0x0167, 0x0169, 0x016b, 0x016d, 0x016f, 0x0171, 0x0173, 0x0175, - 0x0177, 0x017a, 0x017c, 0x0183, 0x0185, 0x0188, 0x018c, 0x018d, 0x0192, - 0x0195, 0x019e, 0x01a1, 0x01a3, 0x01a5, 0x01a8, 0x01aa, 0x01ab, 0x01ad, - 0x01b0, 0x01b4, 0x01b6, 0x01b9, 0x01ba, 0x01c6, 0x01c9, 0x01cc, 0x01ce, - 0x01d0, 0x01d2, 0x01d4, 0x01d6, 0x01d8, 0x01da, 0x01dc, 0x01dd, 0x01df, - 0x01e1, 0x01e3, 0x01e5, 0x01e7, 0x01e9, 0x01eb, 0x01ed, 0x01ef, 0x01f0, - 0x01f3, 0x01f5, 0x01f9, 0x01fb, 0x01fd, 0x01ff, 0x0201, 0x0203, 0x0205, - 0x0207, 0x0209, 0x020b, 0x020d, 0x020f, 0x0211, 0x0213, 0x0215, 0x0217, - 0x0219, 0x021b, 0x021d, 0x021f, 0x0223, 0x0225, 0x0227, 0x0229, 0x022b, - 0x022d, 0x022f, 0x0231, 0x0233, 0x0390, 0x03d0, 0x03d1, 0x03db, 0x03dd, - 0x03df, 0x03e1, 0x03e3, 0x03e5, 0x03e7, 0x03e9, 0x03eb, 0x03ed, 0x03f5, - 0x0461, 0x0463, 0x0465, 0x0467, 0x0469, 0x046b, 0x046d, 0x046f, 0x0471, - 0x0473, 0x0475, 0x0477, 0x0479, 0x047b, 0x047d, 0x047f, 0x0481, 0x048d, - 0x048f, 0x0491, 0x0493, 0x0495, 0x0497, 0x0499, 0x049b, 0x049d, 0x049f, - 0x04a1, 0x04a3, 0x04a5, 0x04a7, 0x04a9, 0x04ab, 0x04ad, 0x04af, 0x04b1, - 0x04b3, 0x04b5, 0x04b7, 0x04b9, 0x04bb, 0x04bd, 0x04bf, 0x04c2, 0x04c4, - 0x04c8, 0x04cc, 0x04d1, 0x04d3, 0x04d5, 0x04d7, 0x04d9, 0x04db, 0x04dd, - 0x04df, 0x04e1, 0x04e3, 0x04e5, 0x04e7, 0x04e9, 0x04eb, 0x04ed, 0x04ef, - 0x04f1, 0x04f3, 0x04f5, 0x04f9, 0x1e01, 0x1e03, 0x1e05, 0x1e07, 0x1e09, - 0x1e0b, 0x1e0d, 0x1e0f, 0x1e11, 0x1e13, 0x1e15, 0x1e17, 0x1e19, 0x1e1b, - 0x1e1d, 0x1e1f, 0x1e21, 0x1e23, 0x1e25, 0x1e27, 0x1e29, 0x1e2b, 0x1e2d, - 0x1e2f, 0x1e31, 0x1e33, 0x1e35, 0x1e37, 0x1e39, 0x1e3b, 0x1e3d, 0x1e3f, - 0x1e41, 0x1e43, 0x1e45, 0x1e47, 0x1e49, 0x1e4b, 0x1e4d, 0x1e4f, 0x1e51, - 0x1e53, 0x1e55, 0x1e57, 0x1e59, 0x1e5b, 0x1e5d, 0x1e5f, 0x1e61, 0x1e63, - 0x1e65, 0x1e67, 0x1e69, 0x1e6b, 0x1e6d, 0x1e6f, 0x1e71, 0x1e73, 0x1e75, - 0x1e77, 0x1e79, 0x1e7b, 0x1e7d, 0x1e7f, 0x1e81, 0x1e83, 0x1e85, 0x1e87, - 0x1e89, 0x1e8b, 0x1e8d, 0x1e8f, 0x1e91, 0x1e93, 0x1ea1, 0x1ea3, 0x1ea5, - 0x1ea7, 0x1ea9, 0x1eab, 0x1ead, 0x1eaf, 0x1eb1, 0x1eb3, 0x1eb5, 0x1eb7, - 0x1eb9, 0x1ebb, 0x1ebd, 0x1ebf, 0x1ec1, 0x1ec3, 0x1ec5, 0x1ec7, 0x1ec9, - 0x1ecb, 0x1ecd, 0x1ecf, 0x1ed1, 0x1ed3, 0x1ed5, 0x1ed7, 0x1ed9, 0x1edb, - 0x1edd, 0x1edf, 0x1ee1, 0x1ee3, 0x1ee5, 0x1ee7, 0x1ee9, 0x1eeb, 0x1eed, - 0x1eef, 0x1ef1, 0x1ef3, 0x1ef5, 0x1ef7, 0x1ef9, 0x1fb6, 0x1fb7, 0x1fbe, - 0x1fc6, 0x1fc7, 0x1fd6, 0x1fd7, 0x1ff6, 0x1ff7, 0x207f, 0x210a, 0x210e, - 0x210f, 0x2113, 0x212f, 0x2134, 0x2139 -}; - -#define NUM_LOWER_CHAR (sizeof(lowerCharTable)/sizeof(chr)) - -/* Unicode: uppercase characters */ - -static crange upperRangeTable[] = { - {0x0041, 0x005a}, {0x00c0, 0x00d6}, {0x00d8, 0x00de}, {0x0189, 0x018b}, - {0x018e, 0x0191}, {0x0196, 0x0198}, {0x01b1, 0x01b3}, {0x01f6, 0x01f8}, - {0x0388, 0x038a}, {0x0391, 0x03a1}, {0x03a3, 0x03ab}, {0x03d2, 0x03d4}, - {0x0400, 0x042f}, {0x0531, 0x0556}, {0x10a0, 0x10c5}, {0x1f08, 0x1f0f}, - {0x1f18, 0x1f1d}, {0x1f28, 0x1f2f}, {0x1f38, 0x1f3f}, {0x1f48, 0x1f4d}, - {0x1f68, 0x1f6f}, {0x1fb8, 0x1fbb}, {0x1fc8, 0x1fcb}, {0x1fd8, 0x1fdb}, - {0x1fe8, 0x1fec}, {0x1ff8, 0x1ffb}, {0x210b, 0x210d}, {0x2110, 0x2112}, - {0x2119, 0x211d}, {0x212a, 0x212d}, {0xff21, 0xff3a} -}; - -#define NUM_UPPER_RANGE (sizeof(upperRangeTable)/sizeof(crange)) - -static chr upperCharTable[] = { - 0x0100, 0x0102, 0x0104, 0x0106, 0x0108, 0x010a, 0x010c, 0x010e, 0x0110, - 0x0112, 0x0114, 0x0116, 0x0118, 0x011a, 0x011c, 0x011e, 0x0120, 0x0122, - 0x0124, 0x0126, 0x0128, 0x012a, 0x012c, 0x012e, 0x0130, 0x0132, 0x0134, - 0x0136, 0x0139, 0x013b, 0x013d, 0x013f, 0x0141, 0x0143, 0x0145, 0x0147, - 0x014a, 0x014c, 0x014e, 0x0150, 0x0152, 0x0154, 0x0156, 0x0158, 0x015a, - 0x015c, 0x015e, 0x0160, 0x0162, 0x0164, 0x0166, 0x0168, 0x016a, 0x016c, - 0x016e, 0x0170, 0x0172, 0x0174, 0x0176, 0x0178, 0x0179, 0x017b, 0x017d, - 0x0181, 0x0182, 0x0184, 0x0186, 0x0187, 0x0193, 0x0194, 0x019c, 0x019d, - 0x019f, 0x01a0, 0x01a2, 0x01a4, 0x01a6, 0x01a7, 0x01a9, 0x01ac, 0x01ae, - 0x01af, 0x01b5, 0x01b7, 0x01b8, 0x01bc, 0x01c4, 0x01c7, 0x01ca, 0x01cd, - 0x01cf, 0x01d1, 0x01d3, 0x01d5, 0x01d7, 0x01d9, 0x01db, 0x01de, 0x01e0, - 0x01e2, 0x01e4, 0x01e6, 0x01e8, 0x01ea, 0x01ec, 0x01ee, 0x01f1, 0x01f4, - 0x01fa, 0x01fc, 0x01fe, 0x0200, 0x0202, 0x0204, 0x0206, 0x0208, 0x020a, - 0x020c, 0x020e, 0x0210, 0x0212, 0x0214, 0x0216, 0x0218, 0x021a, 0x021c, - 0x021e, 0x0222, 0x0224, 0x0226, 0x0228, 0x022a, 0x022c, 0x022e, 0x0230, - 0x0232, 0x0386, 0x038c, 0x038e, 0x038f, 0x03da, 0x03dc, 0x03de, 0x03e0, - 0x03e2, 0x03e4, 0x03e6, 0x03e8, 0x03ea, 0x03ec, 0x03ee, 0x03f4, 0x0460, - 0x0462, 0x0464, 0x0466, 0x0468, 0x046a, 0x046c, 0x046e, 0x0470, 0x0472, - 0x0474, 0x0476, 0x0478, 0x047a, 0x047c, 0x047e, 0x0480, 0x048c, 0x048e, - 0x0490, 0x0492, 0x0494, 0x0496, 0x0498, 0x049a, 0x049c, 0x049e, 0x04a0, - 0x04a2, 0x04a4, 0x04a6, 0x04a8, 0x04aa, 0x04ac, 0x04ae, 0x04b0, 0x04b2, - 0x04b4, 0x04b6, 0x04b8, 0x04ba, 0x04bc, 0x04be, 0x04c0, 0x04c1, 0x04c3, - 0x04c7, 0x04cb, 0x04d0, 0x04d2, 0x04d4, 0x04d6, 0x04d8, 0x04da, 0x04dc, - 0x04de, 0x04e0, 0x04e2, 0x04e4, 0x04e6, 0x04e8, 0x04ea, 0x04ec, 0x04ee, - 0x04f0, 0x04f2, 0x04f4, 0x04f8, 0x1e00, 0x1e02, 0x1e04, 0x1e06, 0x1e08, - 0x1e0a, 0x1e0c, 0x1e0e, 0x1e10, 0x1e12, 0x1e14, 0x1e16, 0x1e18, 0x1e1a, - 0x1e1c, 0x1e1e, 0x1e20, 0x1e22, 0x1e24, 0x1e26, 0x1e28, 0x1e2a, 0x1e2c, - 0x1e2e, 0x1e30, 0x1e32, 0x1e34, 0x1e36, 0x1e38, 0x1e3a, 0x1e3c, 0x1e3e, - 0x1e40, 0x1e42, 0x1e44, 0x1e46, 0x1e48, 0x1e4a, 0x1e4c, 0x1e4e, 0x1e50, - 0x1e52, 0x1e54, 0x1e56, 0x1e58, 0x1e5a, 0x1e5c, 0x1e5e, 0x1e60, 0x1e62, - 0x1e64, 0x1e66, 0x1e68, 0x1e6a, 0x1e6c, 0x1e6e, 0x1e70, 0x1e72, 0x1e74, - 0x1e76, 0x1e78, 0x1e7a, 0x1e7c, 0x1e7e, 0x1e80, 0x1e82, 0x1e84, 0x1e86, - 0x1e88, 0x1e8a, 0x1e8c, 0x1e8e, 0x1e90, 0x1e92, 0x1e94, 0x1ea0, 0x1ea2, - 0x1ea4, 0x1ea6, 0x1ea8, 0x1eaa, 0x1eac, 0x1eae, 0x1eb0, 0x1eb2, 0x1eb4, - 0x1eb6, 0x1eb8, 0x1eba, 0x1ebc, 0x1ebe, 0x1ec0, 0x1ec2, 0x1ec4, 0x1ec6, - 0x1ec8, 0x1eca, 0x1ecc, 0x1ece, 0x1ed0, 0x1ed2, 0x1ed4, 0x1ed6, 0x1ed8, - 0x1eda, 0x1edc, 0x1ede, 0x1ee0, 0x1ee2, 0x1ee4, 0x1ee6, 0x1ee8, 0x1eea, - 0x1eec, 0x1eee, 0x1ef0, 0x1ef2, 0x1ef4, 0x1ef6, 0x1ef8, 0x1f59, 0x1f5b, - 0x1f5d, 0x1f5f, 0x2102, 0x2107, 0x2115, 0x2124, 0x2126, 0x2128, 0x2130, - 0x2131, 0x2133 -}; - -#define NUM_UPPER_CHAR (sizeof(upperCharTable)/sizeof(chr)) - -/* Unicode: unicode print characters excluding space */ - -static crange graphRangeTable[] = { - {0x0021, 0x007e}, {0x00a0, 0x011f}, {0x0121, 0x021f}, {0x0222, 0x0233}, - {0x0250, 0x02ad}, {0x02b0, 0x02ee}, {0x0300, 0x031f}, {0x0321, 0x034e}, - {0x0360, 0x0362}, {0x0384, 0x038a}, {0x038e, 0x03a1}, {0x03a3, 0x03ce}, - {0x03d0, 0x03d7}, {0x03da, 0x03f5}, {0x0400, 0x041f}, {0x0421, 0x0486}, - {0x048c, 0x04c4}, {0x04d0, 0x04f5}, {0x0531, 0x0556}, {0x0559, 0x055f}, - {0x0561, 0x0587}, {0x0591, 0x05a1}, {0x05a3, 0x05b9}, {0x05bb, 0x05c4}, - {0x05d0, 0x05ea}, {0x05f0, 0x05f4}, {0x0621, 0x063a}, {0x0640, 0x0655}, - {0x0660, 0x066d}, {0x0670, 0x06ed}, {0x06f0, 0x06fe}, {0x0700, 0x070d}, - {0x0710, 0x071f}, {0x0721, 0x072c}, {0x0730, 0x074a}, {0x0780, 0x07b0}, - {0x0901, 0x0903}, {0x0905, 0x091f}, {0x0921, 0x0939}, {0x093c, 0x094d}, - {0x0950, 0x0954}, {0x0958, 0x0970}, {0x0981, 0x0983}, {0x0985, 0x098c}, - {0x0993, 0x09a8}, {0x09aa, 0x09b0}, {0x09b6, 0x09b9}, {0x09be, 0x09c4}, - {0x09cb, 0x09cd}, {0x09df, 0x09e3}, {0x09e6, 0x09fa}, {0x0a05, 0x0a0a}, - {0x0a13, 0x0a1f}, {0x0a21, 0x0a28}, {0x0a2a, 0x0a30}, {0x0a3e, 0x0a42}, - {0x0a4b, 0x0a4d}, {0x0a59, 0x0a5c}, {0x0a66, 0x0a74}, {0x0a81, 0x0a83}, - {0x0a85, 0x0a8b}, {0x0a8f, 0x0a91}, {0x0a93, 0x0aa8}, {0x0aaa, 0x0ab0}, - {0x0ab5, 0x0ab9}, {0x0abc, 0x0ac5}, {0x0ac7, 0x0ac9}, {0x0acb, 0x0acd}, - {0x0ae6, 0x0aef}, {0x0b01, 0x0b03}, {0x0b05, 0x0b0c}, {0x0b13, 0x0b1f}, - {0x0b21, 0x0b28}, {0x0b2a, 0x0b30}, {0x0b36, 0x0b39}, {0x0b3c, 0x0b43}, - {0x0b4b, 0x0b4d}, {0x0b5f, 0x0b61}, {0x0b66, 0x0b70}, {0x0b85, 0x0b8a}, - {0x0b8e, 0x0b90}, {0x0b92, 0x0b95}, {0x0ba8, 0x0baa}, {0x0bae, 0x0bb5}, - {0x0bb7, 0x0bb9}, {0x0bbe, 0x0bc2}, {0x0bc6, 0x0bc8}, {0x0bca, 0x0bcd}, - {0x0be7, 0x0bf2}, {0x0c01, 0x0c03}, {0x0c05, 0x0c0c}, {0x0c0e, 0x0c10}, - {0x0c12, 0x0c1f}, {0x0c21, 0x0c28}, {0x0c2a, 0x0c33}, {0x0c35, 0x0c39}, - {0x0c3e, 0x0c44}, {0x0c46, 0x0c48}, {0x0c4a, 0x0c4d}, {0x0c66, 0x0c6f}, - {0x0c85, 0x0c8c}, {0x0c8e, 0x0c90}, {0x0c92, 0x0ca8}, {0x0caa, 0x0cb3}, - {0x0cb5, 0x0cb9}, {0x0cbe, 0x0cc4}, {0x0cc6, 0x0cc8}, {0x0cca, 0x0ccd}, - {0x0ce6, 0x0cef}, {0x0d05, 0x0d0c}, {0x0d0e, 0x0d10}, {0x0d12, 0x0d1f}, - {0x0d21, 0x0d28}, {0x0d2a, 0x0d39}, {0x0d3e, 0x0d43}, {0x0d46, 0x0d48}, - {0x0d4a, 0x0d4d}, {0x0d66, 0x0d6f}, {0x0d85, 0x0d96}, {0x0d9a, 0x0db1}, - {0x0db3, 0x0dbb}, {0x0dc0, 0x0dc6}, {0x0dcf, 0x0dd4}, {0x0dd8, 0x0ddf}, - {0x0df2, 0x0df4}, {0x0e01, 0x0e1f}, {0x0e21, 0x0e3a}, {0x0e3f, 0x0e5b}, - {0x0e94, 0x0e97}, {0x0e99, 0x0e9f}, {0x0ea1, 0x0ea3}, {0x0ead, 0x0eb9}, - {0x0ebb, 0x0ebd}, {0x0ec0, 0x0ec4}, {0x0ec8, 0x0ecd}, {0x0ed0, 0x0ed9}, - {0x0f00, 0x0f1f}, {0x0f21, 0x0f47}, {0x0f49, 0x0f6a}, {0x0f71, 0x0f8b}, - {0x0f90, 0x0f97}, {0x0f99, 0x0fbc}, {0x0fbe, 0x0fcc}, {0x1000, 0x101f}, - {0x1023, 0x1027}, {0x102c, 0x1032}, {0x1036, 0x1039}, {0x1040, 0x1059}, - {0x10a0, 0x10c5}, {0x10d0, 0x10f6}, {0x1100, 0x111f}, {0x1121, 0x1159}, - {0x115f, 0x11a2}, {0x11a8, 0x11f9}, {0x1200, 0x1206}, {0x1208, 0x121f}, - {0x1221, 0x1246}, {0x124a, 0x124d}, {0x1250, 0x1256}, {0x125a, 0x125d}, - {0x1260, 0x1286}, {0x128a, 0x128d}, {0x1290, 0x12ae}, {0x12b2, 0x12b5}, - {0x12b8, 0x12be}, {0x12c2, 0x12c5}, {0x12c8, 0x12ce}, {0x12d0, 0x12d6}, - {0x12d8, 0x12ee}, {0x12f0, 0x130e}, {0x1312, 0x1315}, {0x1318, 0x131e}, - {0x1321, 0x1346}, {0x1348, 0x135a}, {0x1361, 0x137c}, {0x13a0, 0x13f4}, - {0x1401, 0x141f}, {0x1421, 0x151f}, {0x1521, 0x161f}, {0x1621, 0x1676}, - {0x1680, 0x169c}, {0x16a0, 0x16f0}, {0x1780, 0x17dc}, {0x17e0, 0x17e9}, - {0x1800, 0x180a}, {0x1810, 0x1819}, {0x1821, 0x1877}, {0x1880, 0x18a9}, - {0x1e00, 0x1e1f}, {0x1e21, 0x1e9b}, {0x1ea0, 0x1ef9}, {0x1f00, 0x1f15}, - {0x1f18, 0x1f1d}, {0x1f21, 0x1f45}, {0x1f48, 0x1f4d}, {0x1f50, 0x1f57}, - {0x1f5f, 0x1f7d}, {0x1f80, 0x1fb4}, {0x1fb6, 0x1fc4}, {0x1fc6, 0x1fd3}, - {0x1fd6, 0x1fdb}, {0x1fdd, 0x1fef}, {0x1ff2, 0x1ff4}, {0x1ff6, 0x1ffe}, - {0x2000, 0x200b}, {0x2010, 0x201f}, {0x2021, 0x2029}, {0x202f, 0x2046}, - {0x2048, 0x204d}, {0x2074, 0x208e}, {0x20a0, 0x20af}, {0x20d0, 0x20e3}, - {0x2100, 0x211f}, {0x2121, 0x213a}, {0x2153, 0x2183}, {0x2190, 0x21f3}, - {0x2200, 0x221f}, {0x2221, 0x22f1}, {0x2300, 0x231f}, {0x2321, 0x237b}, - {0x237d, 0x239a}, {0x2400, 0x241f}, {0x2421, 0x2426}, {0x2440, 0x244a}, - {0x2460, 0x24ea}, {0x2500, 0x251f}, {0x2521, 0x2595}, {0x25a0, 0x25f7}, - {0x2600, 0x2613}, {0x2619, 0x261f}, {0x2621, 0x2671}, {0x2701, 0x2704}, - {0x2706, 0x2709}, {0x270c, 0x271f}, {0x2721, 0x2727}, {0x2729, 0x274b}, - {0x274f, 0x2752}, {0x2758, 0x275e}, {0x2761, 0x2767}, {0x2776, 0x2794}, - {0x2798, 0x27af}, {0x27b1, 0x27be}, {0x2800, 0x281f}, {0x2821, 0x28ff}, - {0x2e80, 0x2e99}, {0x2e9b, 0x2ef3}, {0x2f00, 0x2f1f}, {0x2f21, 0x2fd5}, - {0x2ff0, 0x2ffb}, {0x3000, 0x301f}, {0x3021, 0x303a}, {0x3041, 0x3094}, - {0x3099, 0x309e}, {0x30a1, 0x30fe}, {0x3105, 0x311f}, {0x3121, 0x312c}, - {0x3131, 0x318e}, {0x3190, 0x31b7}, {0x3200, 0x321c}, {0x3221, 0x3243}, - {0x3260, 0x327b}, {0x327f, 0x32b0}, {0x32c0, 0x32cb}, {0x32d0, 0x32fe}, - {0x3300, 0x331f}, {0x3321, 0x3376}, {0x337b, 0x33dd}, {0x33e0, 0x33fe}, - {0x3400, 0x341f}, {0x3421, 0x351f}, {0x3521, 0x361f}, {0x3621, 0x371f}, - {0x3721, 0x381f}, {0x3821, 0x391f}, {0x3921, 0x3a1f}, {0x3a21, 0x3b1f}, - {0x3b21, 0x3c1f}, {0x3c21, 0x3d1f}, {0x3d21, 0x3e1f}, {0x3e21, 0x3f1f}, - {0x3f21, 0x401f}, {0x4021, 0x411f}, {0x4121, 0x421f}, {0x4221, 0x431f}, - {0x4321, 0x441f}, {0x4421, 0x451f}, {0x4521, 0x461f}, {0x4621, 0x471f}, - {0x4721, 0x481f}, {0x4821, 0x491f}, {0x4921, 0x4a1f}, {0x4a21, 0x4b1f}, - {0x4b21, 0x4c1f}, {0x4c21, 0x4d1f}, {0x4d21, 0x4db5}, {0x4e00, 0x4e1f}, - {0x4e21, 0x4f1f}, {0x4f21, 0x501f}, {0x5021, 0x511f}, {0x5121, 0x521f}, - {0x5221, 0x531f}, {0x5321, 0x541f}, {0x5421, 0x551f}, {0x5521, 0x561f}, - {0x5621, 0x571f}, {0x5721, 0x581f}, {0x5821, 0x591f}, {0x5921, 0x5a1f}, - {0x5a21, 0x5b1f}, {0x5b21, 0x5c1f}, {0x5c21, 0x5d1f}, {0x5d21, 0x5e1f}, - {0x5e21, 0x5f1f}, {0x5f21, 0x601f}, {0x6021, 0x611f}, {0x6121, 0x621f}, - {0x6221, 0x631f}, {0x6321, 0x641f}, {0x6421, 0x651f}, {0x6521, 0x661f}, - {0x6621, 0x671f}, {0x6721, 0x681f}, {0x6821, 0x691f}, {0x6921, 0x6a1f}, - {0x6a21, 0x6b1f}, {0x6b21, 0x6c1f}, {0x6c21, 0x6d1f}, {0x6d21, 0x6e1f}, - {0x6e21, 0x6f1f}, {0x6f21, 0x701f}, {0x7021, 0x711f}, {0x7121, 0x721f}, - {0x7221, 0x731f}, {0x7321, 0x741f}, {0x7421, 0x751f}, {0x7521, 0x761f}, - {0x7621, 0x771f}, {0x7721, 0x781f}, {0x7821, 0x791f}, {0x7921, 0x7a1f}, - {0x7a21, 0x7b1f}, {0x7b21, 0x7c1f}, {0x7c21, 0x7d1f}, {0x7d21, 0x7e1f}, - {0x7e21, 0x7f1f}, {0x7f21, 0x801f}, {0x8021, 0x811f}, {0x8121, 0x821f}, - {0x8221, 0x831f}, {0x8321, 0x841f}, {0x8421, 0x851f}, {0x8521, 0x861f}, - {0x8621, 0x871f}, {0x8721, 0x881f}, {0x8821, 0x891f}, {0x8921, 0x8a1f}, - {0x8a21, 0x8b1f}, {0x8b21, 0x8c1f}, {0x8c21, 0x8d1f}, {0x8d21, 0x8e1f}, - {0x8e21, 0x8f1f}, {0x8f21, 0x901f}, {0x9021, 0x911f}, {0x9121, 0x921f}, - {0x9221, 0x931f}, {0x9321, 0x941f}, {0x9421, 0x951f}, {0x9521, 0x961f}, - {0x9621, 0x971f}, {0x9721, 0x981f}, {0x9821, 0x991f}, {0x9921, 0x9a1f}, - {0x9a21, 0x9b1f}, {0x9b21, 0x9c1f}, {0x9c21, 0x9d1f}, {0x9d21, 0x9e1f}, - {0x9e21, 0x9f1f}, {0x9f21, 0x9fa5}, {0xa000, 0xa01f}, {0xa021, 0xa11f}, - {0xa121, 0xa21f}, {0xa221, 0xa31f}, {0xa321, 0xa41f}, {0xa421, 0xa48c}, - {0xa490, 0xa4a1}, {0xa4a4, 0xa4b3}, {0xa4b5, 0xa4c0}, {0xa4c2, 0xa4c4}, - {0xac00, 0xac1f}, {0xac21, 0xad1f}, {0xad21, 0xae1f}, {0xae21, 0xaf1f}, - {0xaf21, 0xb01f}, {0xb021, 0xb11f}, {0xb121, 0xb21f}, {0xb221, 0xb31f}, - {0xb321, 0xb41f}, {0xb421, 0xb51f}, {0xb521, 0xb61f}, {0xb621, 0xb71f}, - {0xb721, 0xb81f}, {0xb821, 0xb91f}, {0xb921, 0xba1f}, {0xba21, 0xbb1f}, - {0xbb21, 0xbc1f}, {0xbc21, 0xbd1f}, {0xbd21, 0xbe1f}, {0xbe21, 0xbf1f}, - {0xbf21, 0xc01f}, {0xc021, 0xc11f}, {0xc121, 0xc21f}, {0xc221, 0xc31f}, - {0xc321, 0xc41f}, {0xc421, 0xc51f}, {0xc521, 0xc61f}, {0xc621, 0xc71f}, - {0xc721, 0xc81f}, {0xc821, 0xc91f}, {0xc921, 0xca1f}, {0xca21, 0xcb1f}, - {0xcb21, 0xcc1f}, {0xcc21, 0xcd1f}, {0xcd21, 0xce1f}, {0xce21, 0xcf1f}, - {0xcf21, 0xd01f}, {0xd021, 0xd11f}, {0xd121, 0xd21f}, {0xd221, 0xd31f}, - {0xd321, 0xd41f}, {0xd421, 0xd51f}, {0xd521, 0xd61f}, {0xd621, 0xd71f}, - {0xd721, 0xd7a3}, {0xf900, 0xf91f}, {0xf921, 0xfa1f}, {0xfa21, 0xfa2d}, - {0xfb00, 0xfb06}, {0xfb13, 0xfb17}, {0xfb1d, 0xfb1f}, {0xfb21, 0xfb36}, - {0xfb38, 0xfb3c}, {0xfb46, 0xfbb1}, {0xfbd3, 0xfc1f}, {0xfc21, 0xfd1f}, - {0xfd21, 0xfd3f}, {0xfd50, 0xfd8f}, {0xfd92, 0xfdc7}, {0xfdf0, 0xfdfb}, - {0xfe21, 0xfe23}, {0xfe30, 0xfe44}, {0xfe49, 0xfe52}, {0xfe54, 0xfe66}, - {0xfe68, 0xfe6b}, {0xfe70, 0xfe72}, {0xfe76, 0xfefc}, {0xff01, 0xff1f}, - {0xff21, 0xff5e}, {0xff61, 0xffbe}, {0xffc2, 0xffc7}, {0xffca, 0xffcf}, - {0xffd2, 0xffd7}, {0xffda, 0xffdc}, {0xffe0, 0xffe6}, {0xffe8, 0xffee}, - {0xfffc, 0xffff} -}; - -#define NUM_GRAPH_RANGE (sizeof(graphRangeTable)/sizeof(crange)) - -static chr graphCharTable[] = { - 0x0374, 0x0375, 0x037a, 0x037e, 0x038c, 0x0488, 0x0489, 0x04c7, 0x04c8, - 0x04cb, 0x04cc, 0x04f8, 0x04f9, 0x0589, 0x058a, 0x060c, 0x061b, 0x061f, - 0x098f, 0x0990, 0x09b2, 0x09bc, 0x09c7, 0x09c8, 0x09d7, 0x09dc, 0x09dd, - 0x0a02, 0x0a0f, 0x0a10, 0x0a32, 0x0a33, 0x0a35, 0x0a36, 0x0a38, 0x0a39, - 0x0a3c, 0x0a47, 0x0a48, 0x0a5e, 0x0a8d, 0x0ab2, 0x0ab3, 0x0ad0, 0x0ae0, - 0x0b0f, 0x0b10, 0x0b32, 0x0b33, 0x0b47, 0x0b48, 0x0b56, 0x0b57, 0x0b5c, - 0x0b5d, 0x0b82, 0x0b83, 0x0b99, 0x0b9a, 0x0b9c, 0x0b9e, 0x0b9f, 0x0ba3, - 0x0ba4, 0x0bd7, 0x0c55, 0x0c56, 0x0c60, 0x0c61, 0x0c82, 0x0c83, 0x0cd5, - 0x0cd6, 0x0cde, 0x0ce0, 0x0ce1, 0x0d02, 0x0d03, 0x0d57, 0x0d60, 0x0d61, - 0x0d82, 0x0d83, 0x0dbd, 0x0dca, 0x0dd6, 0x0e81, 0x0e82, 0x0e84, 0x0e87, - 0x0e88, 0x0e8a, 0x0e8d, 0x0ea5, 0x0ea7, 0x0eaa, 0x0eab, 0x0ec6, 0x0edc, - 0x0edd, 0x0fcf, 0x1021, 0x1029, 0x102a, 0x10fb, 0x1248, 0x1258, 0x1288, - 0x12b0, 0x12c0, 0x1310, 0x1f59, 0x1f5b, 0x1f5d, 0x2070, 0x274d, 0x2756, - 0x303e, 0x303f, 0xa4c6, 0xfb3e, 0xfb40, 0xfb41, 0xfb43, 0xfb44, 0xfe74 -}; - -#define NUM_GRAPH_CHAR (sizeof(graphCharTable)/sizeof(chr)) - -/* - * End of auto-generated Unicode character ranges declarations. - */ - -/* - * Supply implementations for some tcl functions that this module depends on - * to make it self contained - */ - -#include "tclUniData.c" -#define Tcl_UniChar wxChar - -/* - * Compute the uppercase equivalent of the given Unicode character. - * Taken from tcl. - */ - -Tcl_UniChar Tcl_UniCharToUpper(int ch) -{ - int info = GetUniCharInfo(ch); - - if (GetCaseType(info) & 0x04) { - return (Tcl_UniChar) (ch - GetDelta(info)); - } else { - return ch; - } -} - -/* - * Compute the lowercase equivalent of the given Unicode character. - * Taken from tcl. - */ - -Tcl_UniChar Tcl_UniCharToLower(int ch) -{ - int info = GetUniCharInfo(ch); - - if (GetCaseType(info) & 0x02) { - return (Tcl_UniChar) (ch + GetDelta(info)); - } else { - return ch; - } -} - -/* - * Compute the titlecase equivalent of the given Unicode character. - * Taken from tcl. - */ - -Tcl_UniChar Tcl_UniCharToTitle(int ch) -{ - int info = GetUniCharInfo(ch); - int mode = GetCaseType(info); - - if (mode & 0x1) { - /* - * Subtract or add one depending on the original case. - */ - - return (Tcl_UniChar) (ch + ((mode & 0x4) ? -1 : 1)); - } else if (mode == 0x4) { - return (Tcl_UniChar) (ch - GetDelta(info)); - } else { - return ch; - } -} - -#else /* wxUSE_UNICODE */ - -#include - -typedef int (*isfunc_t)(int); - -/* ASCII character-class table */ -static struct cclass { - char *name; - char *chars; - int hasch; - isfunc_t isfunc; -} cclasses[] = { - {"alnum", "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz\ -0123456789", 1, isalnum}, - {"alpha", "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz", - 1, isalpha}, - {"blank", " \t", 0, NULL}, - {"cntrl", "\007\b\t\n\v\f\r\1\2\3\4\5\6\16\17\20\21\22\23\24\ -\25\26\27\30\31\32\33\34\35\36\37\177", 0, iscntrl}, - {"digit", "0123456789", 0, isdigit}, - {"graph", "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz\ -0123456789!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~", - 1, isgraph}, - {"lower", "abcdefghijklmnopqrstuvwxyz", - 1, islower}, - {"print", "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz\ -0123456789!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~ ", - 1, isprint}, - {"punct", "!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~", - 0, ispunct}, - {"space", "\t\n\v\f\r ", 0, isspace}, - {"upper", "ABCDEFGHIJKLMNOPQRSTUVWXYZ", - 0, isupper}, - {"xdigit", "0123456789ABCDEFabcdef", - 0, isxdigit}, - {NULL, 0, 0, NULL} -}; - -/* - * Supply implementations for some tcl functions that this module depends on - * to make it self contained - */ - -#define Tcl_UniChar wxChar -Tcl_UniChar Tcl_UniCharToUpper(int ch) { return wxToupper(ch); } -Tcl_UniChar Tcl_UniCharToLower(int ch) { return wxTolower(ch); } -Tcl_UniChar Tcl_UniCharToTitle(int ch) { return wxToupper(ch); } - -#endif /* !wxUSE_UNICODE */ - -#define CH NOCELT - -/* - - nmcces - how many distinct MCCEs are there? - ^ static int nmcces(struct vars *); - */ -static int -nmcces(v) - struct vars *v; /* context */ -{ - /* - * No multi-character collating elements defined at the moment. - */ - return 0; -} - -/* - - nleaders - how many chrs can be first chrs of MCCEs? - ^ static int nleaders(struct vars *); - */ -static int -nleaders(v) - struct vars *v; /* context */ -{ - return 0; -} - -/* - - allmcces - return a cvec with all the MCCEs of the locale - ^ static struct cvec *allmcces(struct vars *, struct cvec *); - */ -static struct cvec * -allmcces(v, cv) - struct vars *v; /* context */ - struct cvec *cv; /* this is supposed to have enough room */ -{ - return clearcvec(cv); -} - -/* - - element - map collating-element name to celt - ^ static celt element(struct vars *, chr *, chr *); - */ -static celt -element(v, startp, endp) - struct vars *v; /* context */ - chr *startp; /* points to start of name */ - chr *endp; /* points just past end of name */ -{ - struct cname *cn; - size_t len; - - /* generic: one-chr names stand for themselves */ - assert(startp < endp); - len = endp - startp; - if (len == 1) { - return *startp; - } - - NOTE(REG_ULOCALE); - - /* search table */ - for (cn=cnames; cn->name!=NULL; cn++) { - if (wxStrlen_(cn->name)==len && wxStrncmp(cn->name, startp, len)==0) { - break; /* NOTE BREAK OUT */ - } - } - if (cn->name != NULL) { - return CHR(cn->code); - } - - /* couldn't find it */ - ERR(REG_ECOLLATE); - return 0; -} - -/* - - range - supply cvec for a range, including legality check - ^ static struct cvec *range(struct vars *, celt, celt, int); - */ -static struct cvec * -range(v, a, b, cases) - struct vars *v; /* context */ - celt a; /* range start */ - celt b; /* range end, might equal a */ - int cases; /* case-independent? */ -{ - int nchrs; - struct cvec *cv; - celt c, lc, uc, tc; - - if (a != b && !before(a, b)) { - ERR(REG_ERANGE); - return NULL; - } - - if (!cases) { /* easy version */ - cv = getcvec(v, 0, 1, 0); - NOERRN(); - addrange(cv, a, b); - return cv; - } - - /* - * When case-independent, it's hard to decide when cvec ranges are - * usable, so for now at least, we won't try. We allocate enough - * space for two case variants plus a little extra for the two - * title case variants. - */ - - nchrs = (b - a + 1)*2 + 4; - - cv = getcvec(v, nchrs, 0, 0); - NOERRN(); - - for (c=a; c<=b; c++) { - addchr(cv, c); - lc = Tcl_UniCharToLower((chr)c); - uc = Tcl_UniCharToUpper((chr)c); - tc = Tcl_UniCharToTitle((chr)c); - if (c != lc) { - addchr(cv, lc); - } - if (c != uc) { - addchr(cv, uc); - } - if (c != tc && tc != uc) { - addchr(cv, tc); - } - } - - return cv; -} - -/* - - before - is celt x before celt y, for purposes of range legality? - ^ static int before(celt, celt); - */ -static int /* predicate */ -before(x, y) - celt x, y; /* collating elements */ -{ - /* trivial because no MCCEs */ - if (x < y) { - return 1; - } - return 0; -} - -/* - - eclass - supply cvec for an equivalence class - * Must include case counterparts on request. - ^ static struct cvec *eclass(struct vars *, celt, int); - */ -static struct cvec * -eclass(v, c, cases) - struct vars *v; /* context */ - celt c; /* Collating element representing - * the equivalence class. */ - int cases; /* all cases? */ -{ - struct cvec *cv; - - /* crude fake equivalence class for testing */ - if ((v->cflags®_FAKE) && c == 'x') { - cv = getcvec(v, 4, 0, 0); - addchr(cv, (chr)'x'); - addchr(cv, (chr)'y'); - if (cases) { - addchr(cv, (chr)'X'); - addchr(cv, (chr)'Y'); - } - return cv; - } - - /* otherwise, none */ - if (cases) { - return allcases(v, c); - } - cv = getcvec(v, 1, 0, 0); - assert(cv != NULL); - addchr(cv, (chr)c); - return cv; -} - -#if wxUSE_UNICODE - -/* - - cclass - supply cvec for a character class - * Must include case counterparts on request. - ^ static struct cvec *cclass(struct vars *, chr *, chr *, int); - */ -static struct cvec * -cclass(v, startp, endp, cases) - struct vars *v; /* context */ - chr *startp; /* where the name starts */ - chr *endp; /* just past the end of the name */ - int cases; /* case-independent? */ -{ - size_t len; - struct cvec *cv = NULL; - CONST chr *np; - chr **namePtr; - int i, index; - - /* - * The following arrays define the valid character class names. - */ - - static chr *classNames[] = { - wxT("alnum"), wxT("alpha"), wxT("ascii"), wxT("blank"), wxT("cntrl"), wxT("digit"), wxT("graph"), - wxT("lower"), wxT("print"), wxT("punct"), wxT("space"), wxT("upper"), wxT("xdigit"), NULL - }; - - enum classes { - CC_ALNUM, CC_ALPHA, CC_ASCII, CC_BLANK, CC_CNTRL, CC_DIGIT, CC_GRAPH, - CC_LOWER, CC_PRINT, CC_PUNCT, CC_SPACE, CC_UPPER, CC_XDIGIT - }; - - - /* - * Extract the class name - */ - - len = endp - startp; - np = startp; - - /* - * Remap lower and upper to alpha if the match is case insensitive. - */ - - if (cases && len == 5 && (wxStrncmp(wxT("lower"), np, 5) == 0 - || wxStrncmp(wxT("upper"), np, 5) == 0)) { - np = wxT("alpha"); - } - - /* - * Map the name to the corresponding enumerated value. - */ - - index = -1; - for (namePtr=classNames,i=0 ; *namePtr!=NULL ; namePtr++,i++) { - if ((wxStrlen_(*namePtr) == len) && (wxStrncmp(*namePtr, np, len) == 0)) { - index = i; - break; - } - } - if (index == -1) { - ERR(REG_ECTYPE); - return NULL; - } - - /* - * Now compute the character class contents. - */ - - switch((enum classes) index) { - case CC_PRINT: - case CC_ALNUM: - cv = getcvec(v, NUM_ALPHA_CHAR, NUM_DIGIT_RANGE + NUM_ALPHA_RANGE, 0); - if (cv) { - for (i=0 ; iname != NULL; cc++) - if (wxStrlen_(cc->name) == len && wxStrncmp(cc->name, np, len) == 0) - break; /* NOTE BREAK OUT */ - if (cc->name == NULL) { - ERR(REG_ECTYPE); - return NULL; - } - - loc = setlocale(LC_CTYPE, NULL); - - if (!cc->isfunc || loc == NULL || strcmp(loc, "C") == 0) - { - /* set up vector */ - cv = getcvec(v, (int)strlen(cc->chars), 0, 0); - if (cv == NULL) { - ERR(REG_ESPACE); - return NULL; - } - - /* fill it in */ - for (p = cc->chars; *p != '\0'; p++) - addchr(cv, (chr)*p); - } - else - { - count = 0; - for (i = 0; i < 256; i++) - if (cc->isfunc(i)) - buf[count++] = i; - - /* set up vector */ - cv = getcvec(v, count, 0, 0); - if (cv == NULL) { - ERR(REG_ESPACE); - return NULL; - } - - /* fill it in */ - for (i = 0; i < count; i++) - addchr(cv, buf[i]); - } - - return cv; -} - -#endif /* !wxUSE_UNICODE */ - - -/* - - allcases - supply cvec for all case counterparts of a chr (including itself) - * This is a shortcut, preferably an efficient one, for simple characters; - * messy cases are done via range(). - ^ static struct cvec *allcases(struct vars *, pchr); - */ -static struct cvec * -allcases(v, pc) - struct vars *v; /* context */ - pchr pc; /* character to get case equivs of */ -{ - struct cvec *cv; - chr c = (chr)pc; - chr lc, uc, tc; - - lc = Tcl_UniCharToLower((chr)c); - uc = Tcl_UniCharToUpper((chr)c); - tc = Tcl_UniCharToTitle((chr)c); - - if (tc != uc) { - cv = getcvec(v, 3, 0, 0); - addchr(cv, tc); - } else { - cv = getcvec(v, 2, 0, 0); - } - addchr(cv, lc); - if (lc != uc) { - addchr(cv, uc); - } - return cv; -} - -/* - - cmp - chr-substring compare - * Backrefs need this. It should preferably be efficient. - * Note that it does not need to report anything except equal/unequal. - * Note also that the length is exact, and the comparison should not - * stop at embedded NULs! - ^ static int cmp(CONST chr *, CONST chr *, size_t); - */ -static int /* 0 for equal, nonzero for unequal */ -cmp(x, y, len) - CONST chr *x, *y; /* strings to compare */ - size_t len; /* exact length of comparison */ -{ - return memcmp(VS(x), VS(y), len*sizeof(chr)); -} - -/* - - casecmp - case-independent chr-substring compare - * REG_ICASE backrefs need this. It should preferably be efficient. - * Note that it does not need to report anything except equal/unequal. - * Note also that the length is exact, and the comparison should not - * stop at embedded NULs! - ^ static int casecmp(CONST chr *, CONST chr *, size_t); - */ -static int /* 0 for equal, nonzero for unequal */ -casecmp(x, y, len) - CONST chr *x, *y; /* strings to compare */ - size_t len; /* exact length of comparison */ -{ - for (; len > 0; len--, x++, y++) { - if ((*x!=*y) && (Tcl_UniCharToLower(*x) != Tcl_UniCharToLower(*y))) { - return 1; - } - } - return 0; -} diff --git a/wxWidgets/src/regex/regc_nfa.c b/wxWidgets/src/regex/regc_nfa.c deleted file mode 100644 index 5f65c8d83a..0000000000 --- a/wxWidgets/src/regex/regc_nfa.c +++ /dev/null @@ -1,1582 +0,0 @@ -/* - * NFA utilities. - * This file is #included by regcomp.c. - * - * Copyright (c) 1998, 1999 Henry Spencer. All rights reserved. - * - * Development of this software was funded, in part, by Cray Research Inc., - * UUNET Communications Services Inc., Sun Microsystems Inc., and Scriptics - * Corporation, none of whom are responsible for the results. The author - * thanks all of them. - * - * Redistribution and use in source and binary forms -- with or without - * modification -- are permitted for any purpose, provided that - * redistributions in source form retain this entire copyright notice and - * indicate the origin and nature of any modifications. - * - * I'd appreciate being given credit for this package in the documentation - * of software which uses it, but that is not a requirement. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL - * HENRY SPENCER BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; - * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * - * - * One or two things that technically ought to be in here - * are actually in color.c, thanks to some incestuous relationships in - * the color chains. - */ - -#define NISERR() VISERR(nfa->v) -#define NERR(e) VERR(nfa->v, (e)) - - -/* - - newnfa - set up an NFA - ^ static struct nfa *newnfa(struct vars *, struct colormap *, struct nfa *); - */ -static struct nfa * /* the NFA, or NULL */ -newnfa(v, cm, parent) -struct vars *v; -struct colormap *cm; -struct nfa *parent; /* NULL if primary NFA */ -{ - struct nfa *nfa; - - nfa = (struct nfa *)MALLOC(sizeof(struct nfa)); - if (nfa == NULL) - return NULL; - - nfa->states = NULL; - nfa->slast = NULL; - nfa->free = NULL; - nfa->nstates = 0; - nfa->cm = cm; - nfa->v = v; - nfa->bos[0] = nfa->bos[1] = COLORLESS; - nfa->eos[0] = nfa->eos[1] = COLORLESS; - nfa->post = newfstate(nfa, '@'); /* number 0 */ - nfa->pre = newfstate(nfa, '>'); /* number 1 */ - nfa->parent = parent; - - nfa->init = newstate(nfa); /* may become invalid later */ - nfa->final = newstate(nfa); - if (ISERR()) { - freenfa(nfa); - return NULL; - } - rainbow(nfa, nfa->cm, PLAIN, COLORLESS, nfa->pre, nfa->init); - newarc(nfa, '^', 1, nfa->pre, nfa->init); - newarc(nfa, '^', 0, nfa->pre, nfa->init); - rainbow(nfa, nfa->cm, PLAIN, COLORLESS, nfa->final, nfa->post); - newarc(nfa, '$', 1, nfa->final, nfa->post); - newarc(nfa, '$', 0, nfa->final, nfa->post); - - if (ISERR()) { - freenfa(nfa); - return NULL; - } - return nfa; -} - -/* - - freenfa - free an entire NFA - ^ static VOID freenfa(struct nfa *); - */ -static VOID -freenfa(nfa) -struct nfa *nfa; -{ - struct state *s; - - while ((s = nfa->states) != NULL) { - s->nins = s->nouts = 0; /* don't worry about arcs */ - freestate(nfa, s); - } - while ((s = nfa->free) != NULL) { - nfa->free = s->next; - destroystate(nfa, s); - } - - nfa->slast = NULL; - nfa->nstates = -1; - nfa->pre = NULL; - nfa->post = NULL; - FREE(nfa); -} - -/* - - newstate - allocate an NFA state, with zero flag value - ^ static struct state *newstate(struct nfa *); - */ -static struct state * /* NULL on error */ -newstate(nfa) -struct nfa *nfa; -{ - struct state *s; - - if (nfa->free != NULL) { - s = nfa->free; - nfa->free = s->next; - } else { - s = (struct state *)MALLOC(sizeof(struct state)); - if (s == NULL) { - NERR(REG_ESPACE); - return NULL; - } - s->oas.next = NULL; - s->free = NULL; - s->noas = 0; - } - - assert(nfa->nstates >= 0); - s->no = nfa->nstates++; - s->flag = 0; - if (nfa->states == NULL) - nfa->states = s; - s->nins = 0; - s->ins = NULL; - s->nouts = 0; - s->outs = NULL; - s->tmp = NULL; - s->next = NULL; - if (nfa->slast != NULL) { - assert(nfa->slast->next == NULL); - nfa->slast->next = s; - } - s->prev = nfa->slast; - nfa->slast = s; - return s; -} - -/* - - newfstate - allocate an NFA state with a specified flag value - ^ static struct state *newfstate(struct nfa *, int flag); - */ -static struct state * /* NULL on error */ -newfstate(nfa, flag) -struct nfa *nfa; -int flag; -{ - struct state *s; - - s = newstate(nfa); - if (s != NULL) - s->flag = (char)flag; - return s; -} - -/* - - dropstate - delete a state's inarcs and outarcs and free it - ^ static VOID dropstate(struct nfa *, struct state *); - */ -static VOID -dropstate(nfa, s) -struct nfa *nfa; -struct state *s; -{ - struct arc *a; - - while ((a = s->ins) != NULL) - freearc(nfa, a); - while ((a = s->outs) != NULL) - freearc(nfa, a); - freestate(nfa, s); -} - -/* - - freestate - free a state, which has no in-arcs or out-arcs - ^ static VOID freestate(struct nfa *, struct state *); - */ -static VOID -freestate(nfa, s) -struct nfa *nfa; -struct state *s; -{ - assert(s != NULL); - assert(s->nins == 0 && s->nouts == 0); - - s->no = FREESTATE; - s->flag = 0; - if (s->next != NULL) - s->next->prev = s->prev; - else { - assert(s == nfa->slast); - nfa->slast = s->prev; - } - if (s->prev != NULL) - s->prev->next = s->next; - else { - assert(s == nfa->states); - nfa->states = s->next; - } - s->prev = NULL; - s->next = nfa->free; /* don't delete it, put it on the free list */ - nfa->free = s; -} - -/* - - destroystate - really get rid of an already-freed state - ^ static VOID destroystate(struct nfa *, struct state *); - */ -static VOID -destroystate(nfa, s) -struct nfa *nfa; -struct state *s; -{ - struct arcbatch *ab; - struct arcbatch *abnext; - - assert(s->no == FREESTATE); - for (ab = s->oas.next; ab != NULL; ab = abnext) { - abnext = ab->next; - FREE(ab); - } - s->ins = NULL; - s->outs = NULL; - s->next = NULL; - FREE(s); -} - -/* - - newarc - set up a new arc within an NFA - ^ static VOID newarc(struct nfa *, int, pcolor, struct state *, - ^ struct state *); - */ -static VOID -newarc(nfa, t, co, from, to) -struct nfa *nfa; -int t; -pcolor co; -struct state *from; -struct state *to; -{ - struct arc *a; - - assert(from != NULL && to != NULL); - - /* check for duplicates */ - for (a = from->outs; a != NULL; a = a->outchain) - if (a->to == to && a->co == co && a->type == t) - return; - - a = allocarc(nfa, from); - if (NISERR()) - return; - assert(a != NULL); - - a->type = t; - a->co = (color)co; - a->to = to; - a->from = from; - - /* - * Put the new arc on the beginning, not the end, of the chains. - * Not only is this easier, it has the very useful side effect that - * deleting the most-recently-added arc is the cheapest case rather - * than the most expensive one. - */ - a->inchain = to->ins; - to->ins = a; - a->outchain = from->outs; - from->outs = a; - - from->nouts++; - to->nins++; - - if (COLORED(a) && nfa->parent == NULL) - colorchain(nfa->cm, a); - - return; -} - -/* - - allocarc - allocate a new out-arc within a state - ^ static struct arc *allocarc(struct nfa *, struct state *); - */ -static struct arc * /* NULL for failure */ -allocarc(nfa, s) -struct nfa *nfa; -struct state *s; -{ - struct arc *a; - struct arcbatch *new; - int i; - - /* shortcut */ - if (s->free == NULL && s->noas < ABSIZE) { - a = &s->oas.a[s->noas]; - s->noas++; - return a; - } - - /* if none at hand, get more */ - if (s->free == NULL) { - new = (struct arcbatch *)MALLOC(sizeof(struct arcbatch)); - if (new == NULL) { - NERR(REG_ESPACE); - return NULL; - } - new->next = s->oas.next; - s->oas.next = new; - - for (i = 0; i < ABSIZE; i++) { - new->a[i].type = 0; - new->a[i].freechain = &new->a[i+1]; - } - new->a[ABSIZE-1].freechain = NULL; - s->free = &new->a[0]; - } - assert(s->free != NULL); - - a = s->free; - s->free = a->freechain; - return a; -} - -/* - - freearc - free an arc - ^ static VOID freearc(struct nfa *, struct arc *); - */ -static VOID -freearc(nfa, victim) -struct nfa *nfa; -struct arc *victim; -{ - struct state *from = victim->from; - struct state *to = victim->to; - struct arc *a; - - assert(victim->type != 0); - - /* take it off color chain if necessary */ - if (COLORED(victim) && nfa->parent == NULL) - uncolorchain(nfa->cm, victim); - - /* take it off source's out-chain */ - assert(from != NULL); - assert(from->outs != NULL); - a = from->outs; - if (a == victim) /* simple case: first in chain */ - from->outs = victim->outchain; - else { - for (; a != NULL && a->outchain != victim; a = a->outchain) - continue; - assert(a != NULL); - a->outchain = victim->outchain; - } - from->nouts--; - - /* take it off target's in-chain */ - assert(to != NULL); - assert(to->ins != NULL); - a = to->ins; - if (a == victim) /* simple case: first in chain */ - to->ins = victim->inchain; - else { - for (; a != NULL && a->inchain != victim; a = a->inchain) - continue; - assert(a != NULL); - a->inchain = victim->inchain; - } - to->nins--; - - /* clean up and place on free list */ - victim->type = 0; - victim->from = NULL; /* precautions... */ - victim->to = NULL; - victim->inchain = NULL; - victim->outchain = NULL; - victim->freechain = from->free; - from->free = victim; -} - -/* - - findarc - find arc, if any, from given source with given type and color - * If there is more than one such arc, the result is random. - ^ static struct arc *findarc(struct state *, int, pcolor); - */ -static struct arc * -findarc(s, type, co) -struct state *s; -int type; -pcolor co; -{ - struct arc *a; - - for (a = s->outs; a != NULL; a = a->outchain) - if (a->type == type && a->co == co) - return a; - return NULL; -} - -/* - - cparc - allocate a new arc within an NFA, copying details from old one - ^ static VOID cparc(struct nfa *, struct arc *, struct state *, - ^ struct state *); - */ -static VOID -cparc(nfa, oa, from, to) -struct nfa *nfa; -struct arc *oa; -struct state *from; -struct state *to; -{ - newarc(nfa, oa->type, oa->co, from, to); -} - -/* - - moveins - move all in arcs of a state to another state - * You might think this could be done better by just updating the - * existing arcs, and you would be right if it weren't for the desire - * for duplicate suppression, which makes it easier to just make new - * ones to exploit the suppression built into newarc. - ^ static VOID moveins(struct nfa *, struct state *, struct state *); - */ -static VOID -moveins(nfa, old, new) -struct nfa *nfa; -struct state *old; -struct state *new; -{ - struct arc *a; - - assert(old != new); - - while ((a = old->ins) != NULL) { - cparc(nfa, a, a->from, new); - freearc(nfa, a); - } - assert(old->nins == 0); - assert(old->ins == NULL); -} - -/* - - copyins - copy all in arcs of a state to another state - ^ static VOID copyins(struct nfa *, struct state *, struct state *); - */ -static VOID -copyins(nfa, old, new) -struct nfa *nfa; -struct state *old; -struct state *new; -{ - struct arc *a; - - assert(old != new); - - for (a = old->ins; a != NULL; a = a->inchain) - cparc(nfa, a, a->from, new); -} - -/* - - moveouts - move all out arcs of a state to another state - ^ static VOID moveouts(struct nfa *, struct state *, struct state *); - */ -static VOID -moveouts(nfa, old, new) -struct nfa *nfa; -struct state *old; -struct state *new; -{ - struct arc *a; - - assert(old != new); - - while ((a = old->outs) != NULL) { - cparc(nfa, a, new, a->to); - freearc(nfa, a); - } -} - -/* - - copyouts - copy all out arcs of a state to another state - ^ static VOID copyouts(struct nfa *, struct state *, struct state *); - */ -static VOID -copyouts(nfa, old, new) -struct nfa *nfa; -struct state *old; -struct state *new; -{ - struct arc *a; - - assert(old != new); - - for (a = old->outs; a != NULL; a = a->outchain) - cparc(nfa, a, new, a->to); -} - -/* - - cloneouts - copy out arcs of a state to another state pair, modifying type - ^ static VOID cloneouts(struct nfa *, struct state *, struct state *, - ^ struct state *, int); - */ -static VOID -cloneouts(nfa, old, from, to, type) -struct nfa *nfa; -struct state *old; -struct state *from; -struct state *to; -int type; -{ - struct arc *a; - - assert(old != from); - - for (a = old->outs; a != NULL; a = a->outchain) - newarc(nfa, type, a->co, from, to); -} - -/* - - delsub - delete a sub-NFA, updating subre pointers if necessary - * This uses a recursive traversal of the sub-NFA, marking already-seen - * states using their tmp pointer. - ^ static VOID delsub(struct nfa *, struct state *, struct state *); - */ -static VOID -delsub(nfa, lp, rp) -struct nfa *nfa; -struct state *lp; /* the sub-NFA goes from here... */ -struct state *rp; /* ...to here, *not* inclusive */ -{ - assert(lp != rp); - - rp->tmp = rp; /* mark end */ - - deltraverse(nfa, lp, lp); - assert(lp->nouts == 0 && rp->nins == 0); /* did the job */ - assert(lp->no != FREESTATE && rp->no != FREESTATE); /* no more */ - - rp->tmp = NULL; /* unmark end */ - lp->tmp = NULL; /* and begin, marked by deltraverse */ -} - -/* - - deltraverse - the recursive heart of delsub - * This routine's basic job is to destroy all out-arcs of the state. - ^ static VOID deltraverse(struct nfa *, struct state *, struct state *); - */ -static VOID -deltraverse(nfa, leftend, s) -struct nfa *nfa; -struct state *leftend; -struct state *s; -{ - struct arc *a; - struct state *to; - - if (s->nouts == 0) - return; /* nothing to do */ - if (s->tmp != NULL) - return; /* already in progress */ - - s->tmp = s; /* mark as in progress */ - - while ((a = s->outs) != NULL) { - to = a->to; - deltraverse(nfa, leftend, to); - assert(to->nouts == 0 || to->tmp != NULL); - freearc(nfa, a); - if (to->nins == 0 && to->tmp == NULL) { - assert(to->nouts == 0); - freestate(nfa, to); - } - } - - assert(s->no != FREESTATE); /* we're still here */ - assert(s == leftend || s->nins != 0); /* and still reachable */ - assert(s->nouts == 0); /* but have no outarcs */ - - s->tmp = NULL; /* we're done here */ -} - -/* - - dupnfa - duplicate sub-NFA - * Another recursive traversal, this time using tmp to point to duplicates - * as well as mark already-seen states. (You knew there was a reason why - * it's a state pointer, didn't you? :-)) - ^ static VOID dupnfa(struct nfa *, struct state *, struct state *, - ^ struct state *, struct state *); - */ -static VOID -dupnfa(nfa, start, stop, from, to) -struct nfa *nfa; -struct state *start; /* duplicate of subNFA starting here */ -struct state *stop; /* and stopping here */ -struct state *from; /* stringing duplicate from here */ -struct state *to; /* to here */ -{ - if (start == stop) { - newarc(nfa, EMPTY, 0, from, to); - return; - } - - stop->tmp = to; - duptraverse(nfa, start, from); - /* done, except for clearing out the tmp pointers */ - - stop->tmp = NULL; - cleartraverse(nfa, start); -} - -/* - - duptraverse - recursive heart of dupnfa - ^ static VOID duptraverse(struct nfa *, struct state *, struct state *); - */ -static VOID -duptraverse(nfa, s, stmp) -struct nfa *nfa; -struct state *s; -struct state *stmp; /* s's duplicate, or NULL */ -{ - struct arc *a; - - if (s->tmp != NULL) - return; /* already done */ - - s->tmp = (stmp == NULL) ? newstate(nfa) : stmp; - if (s->tmp == NULL) { - assert(NISERR()); - return; - } - - for (a = s->outs; a != NULL && !NISERR(); a = a->outchain) { - duptraverse(nfa, a->to, (struct state *)NULL); - assert(a->to->tmp != NULL); - cparc(nfa, a, s->tmp, a->to->tmp); - } -} - -/* - - cleartraverse - recursive cleanup for algorithms that leave tmp ptrs set - ^ static VOID cleartraverse(struct nfa *, struct state *); - */ -static VOID -cleartraverse(nfa, s) -struct nfa *nfa; -struct state *s; -{ - struct arc *a; - - if (s->tmp == NULL) - return; - s->tmp = NULL; - - for (a = s->outs; a != NULL; a = a->outchain) - cleartraverse(nfa, a->to); -} - -/* - - specialcolors - fill in special colors for an NFA - ^ static VOID specialcolors(struct nfa *); - */ -static VOID -specialcolors(nfa) -struct nfa *nfa; -{ - /* false colors for BOS, BOL, EOS, EOL */ - if (nfa->parent == NULL) { - nfa->bos[0] = pseudocolor(nfa->cm); - nfa->bos[1] = pseudocolor(nfa->cm); - nfa->eos[0] = pseudocolor(nfa->cm); - nfa->eos[1] = pseudocolor(nfa->cm); - } else { - assert(nfa->parent->bos[0] != COLORLESS); - nfa->bos[0] = nfa->parent->bos[0]; - assert(nfa->parent->bos[1] != COLORLESS); - nfa->bos[1] = nfa->parent->bos[1]; - assert(nfa->parent->eos[0] != COLORLESS); - nfa->eos[0] = nfa->parent->eos[0]; - assert(nfa->parent->eos[1] != COLORLESS); - nfa->eos[1] = nfa->parent->eos[1]; - } -} - -/* - - optimize - optimize an NFA - ^ static long optimize(struct nfa *, FILE *); - */ -static long /* re_info bits */ -optimize(nfa, f) -struct nfa *nfa; -FILE *f; /* for debug output; NULL none */ -{ - int verbose = (f != NULL) ? 1 : 0; - - if (verbose) - fprintf(f, "\ninitial cleanup:\n"); - cleanup(nfa); /* may simplify situation */ - if (verbose) - dumpnfa(nfa, f); - if (verbose) - fprintf(f, "\nempties:\n"); - fixempties(nfa, f); /* get rid of EMPTY arcs */ - if (verbose) - fprintf(f, "\nconstraints:\n"); - pullback(nfa, f); /* pull back constraints backward */ - pushfwd(nfa, f); /* push fwd constraints forward */ - if (verbose) - fprintf(f, "\nfinal cleanup:\n"); - cleanup(nfa); /* final tidying */ - return analyze(nfa); /* and analysis */ -} - -/* - - pullback - pull back constraints backward to (with luck) eliminate them - ^ static VOID pullback(struct nfa *, FILE *); - */ -static VOID -pullback(nfa, f) -struct nfa *nfa; -FILE *f; /* for debug output; NULL none */ -{ - struct state *s; - struct state *nexts; - struct arc *a; - struct arc *nexta; - int progress; - - /* find and pull until there are no more */ - do { - progress = 0; - for (s = nfa->states; s != NULL && !NISERR(); s = nexts) { - nexts = s->next; - for (a = s->outs; a != NULL && !NISERR(); a = nexta) { - nexta = a->outchain; - if (a->type == '^' || a->type == BEHIND) - if (pull(nfa, a)) - progress = 1; - assert(nexta == NULL || s->no != FREESTATE); - } - } - if (progress && f != NULL) - dumpnfa(nfa, f); - } while (progress && !NISERR()); - if (NISERR()) - return; - - for (a = nfa->pre->outs; a != NULL; a = nexta) { - nexta = a->outchain; - if (a->type == '^') { - assert(a->co == 0 || a->co == 1); - newarc(nfa, PLAIN, nfa->bos[a->co], a->from, a->to); - freearc(nfa, a); - } - } -} - -/* - - pull - pull a back constraint backward past its source state - * A significant property of this function is that it deletes at most - * one state -- the constraint's from state -- and only if the constraint - * was that state's last outarc. - ^ static int pull(struct nfa *, struct arc *); - */ -static int /* 0 couldn't, 1 could */ -pull(nfa, con) -struct nfa *nfa; -struct arc *con; -{ - struct state *from = con->from; - struct state *to = con->to; - struct arc *a; - struct arc *nexta; - struct state *s; - - if (from == to) { /* circular constraint is pointless */ - freearc(nfa, con); - return 1; - } - if (from->flag) /* can't pull back beyond start */ - return 0; - if (from->nins == 0) { /* unreachable */ - freearc(nfa, con); - return 1; - } - - /* first, clone from state if necessary to avoid other outarcs */ - if (from->nouts > 1) { - s = newstate(nfa); - if (NISERR()) - return 0; - assert(to != from); /* con is not an inarc */ - copyins(nfa, from, s); /* duplicate inarcs */ - cparc(nfa, con, s, to); /* move constraint arc */ - freearc(nfa, con); - from = s; - con = from->outs; - } - assert(from->nouts == 1); - - /* propagate the constraint into the from state's inarcs */ - for (a = from->ins; a != NULL; a = nexta) { - nexta = a->inchain; - switch (combine(con, a)) { - case INCOMPATIBLE: /* destroy the arc */ - freearc(nfa, a); - break; - case SATISFIED: /* no action needed */ - break; - case COMPATIBLE: /* swap the two arcs, more or less */ - s = newstate(nfa); - if (NISERR()) - return 0; - cparc(nfa, a, s, to); /* anticipate move */ - cparc(nfa, con, a->from, s); - if (NISERR()) - return 0; - freearc(nfa, a); - break; - default: - assert(NOTREACHED); - break; - } - } - - /* remaining inarcs, if any, incorporate the constraint */ - moveins(nfa, from, to); - dropstate(nfa, from); /* will free the constraint */ - return 1; -} - -/* - - pushfwd - push forward constraints forward to (with luck) eliminate them - ^ static VOID pushfwd(struct nfa *, FILE *); - */ -static VOID -pushfwd(nfa, f) -struct nfa *nfa; -FILE *f; /* for debug output; NULL none */ -{ - struct state *s; - struct state *nexts; - struct arc *a; - struct arc *nexta; - int progress; - - /* find and push until there are no more */ - do { - progress = 0; - for (s = nfa->states; s != NULL && !NISERR(); s = nexts) { - nexts = s->next; - for (a = s->ins; a != NULL && !NISERR(); a = nexta) { - nexta = a->inchain; - if (a->type == '$' || a->type == AHEAD) - if (push(nfa, a)) - progress = 1; - assert(nexta == NULL || s->no != FREESTATE); - } - } - if (progress && f != NULL) - dumpnfa(nfa, f); - } while (progress && !NISERR()); - if (NISERR()) - return; - - for (a = nfa->post->ins; a != NULL; a = nexta) { - nexta = a->inchain; - if (a->type == '$') { - assert(a->co == 0 || a->co == 1); - newarc(nfa, PLAIN, nfa->eos[a->co], a->from, a->to); - freearc(nfa, a); - } - } -} - -/* - - push - push a forward constraint forward past its destination state - * A significant property of this function is that it deletes at most - * one state -- the constraint's to state -- and only if the constraint - * was that state's last inarc. - ^ static int push(struct nfa *, struct arc *); - */ -static int /* 0 couldn't, 1 could */ -push(nfa, con) -struct nfa *nfa; -struct arc *con; -{ - struct state *from = con->from; - struct state *to = con->to; - struct arc *a; - struct arc *nexta; - struct state *s; - - if (to == from) { /* circular constraint is pointless */ - freearc(nfa, con); - return 1; - } - if (to->flag) /* can't push forward beyond end */ - return 0; - if (to->nouts == 0) { /* dead end */ - freearc(nfa, con); - return 1; - } - - /* first, clone to state if necessary to avoid other inarcs */ - if (to->nins > 1) { - s = newstate(nfa); - if (NISERR()) - return 0; - copyouts(nfa, to, s); /* duplicate outarcs */ - cparc(nfa, con, from, s); /* move constraint */ - freearc(nfa, con); - to = s; - con = to->ins; - } - assert(to->nins == 1); - - /* propagate the constraint into the to state's outarcs */ - for (a = to->outs; a != NULL; a = nexta) { - nexta = a->outchain; - switch (combine(con, a)) { - case INCOMPATIBLE: /* destroy the arc */ - freearc(nfa, a); - break; - case SATISFIED: /* no action needed */ - break; - case COMPATIBLE: /* swap the two arcs, more or less */ - s = newstate(nfa); - if (NISERR()) - return 0; - cparc(nfa, con, s, a->to); /* anticipate move */ - cparc(nfa, a, from, s); - if (NISERR()) - return 0; - freearc(nfa, a); - break; - default: - assert(NOTREACHED); - break; - } - } - - /* remaining outarcs, if any, incorporate the constraint */ - moveouts(nfa, to, from); - dropstate(nfa, to); /* will free the constraint */ - return 1; -} - -/* - - combine - constraint lands on an arc, what happens? - ^ #def INCOMPATIBLE 1 // destroys arc - ^ #def SATISFIED 2 // constraint satisfied - ^ #def COMPATIBLE 3 // compatible but not satisfied yet - ^ static int combine(struct arc *, struct arc *); - */ - -/* FIXME Required for CW 8 on Mac since it's not in limits.h */ -#ifndef __CHAR_BIT__ -#define __CHAR_BIT__ 8 -#endif - - -static int -combine(con, a) -struct arc *con; -struct arc *a; -{ -# define CA(ct,at) (((ct)<type, a->type)) { - case CA('^', PLAIN): /* newlines are handled separately */ - case CA('$', PLAIN): - return INCOMPATIBLE; - break; - case CA(AHEAD, PLAIN): /* color constraints meet colors */ - case CA(BEHIND, PLAIN): - if (con->co == a->co) - return SATISFIED; - return INCOMPATIBLE; - break; - case CA('^', '^'): /* collision, similar constraints */ - case CA('$', '$'): - case CA(AHEAD, AHEAD): - case CA(BEHIND, BEHIND): - if (con->co == a->co) /* true duplication */ - return SATISFIED; - return INCOMPATIBLE; - break; - case CA('^', BEHIND): /* collision, dissimilar constraints */ - case CA(BEHIND, '^'): - case CA('$', AHEAD): - case CA(AHEAD, '$'): - return INCOMPATIBLE; - break; - case CA('^', '$'): /* constraints passing each other */ - case CA('^', AHEAD): - case CA(BEHIND, '$'): - case CA(BEHIND, AHEAD): - case CA('$', '^'): - case CA('$', BEHIND): - case CA(AHEAD, '^'): - case CA(AHEAD, BEHIND): - case CA('^', LACON): - case CA(BEHIND, LACON): - case CA('$', LACON): - case CA(AHEAD, LACON): - return COMPATIBLE; - break; - } - assert(NOTREACHED); - return INCOMPATIBLE; /* for benefit of blind compilers */ -} - -/* - - fixempties - get rid of EMPTY arcs - ^ static VOID fixempties(struct nfa *, FILE *); - */ -static VOID -fixempties(nfa, f) -struct nfa *nfa; -FILE *f; /* for debug output; NULL none */ -{ - struct state *s; - struct state *nexts; - struct arc *a; - struct arc *nexta; - int progress; - - /* find and eliminate empties until there are no more */ - do { - progress = 0; - for (s = nfa->states; s != NULL && !NISERR(); s = nexts) { - nexts = s->next; - for (a = s->outs; a != NULL && !NISERR(); a = nexta) { - nexta = a->outchain; - if (a->type == EMPTY && unempty(nfa, a)) - progress = 1; - assert(nexta == NULL || s->no != FREESTATE); - } - } - if (progress && f != NULL) - dumpnfa(nfa, f); - } while (progress && !NISERR()); -} - -/* - - unempty - optimize out an EMPTY arc, if possible - * Actually, as it stands this function always succeeds, but the return - * value is kept with an eye on possible future changes. - ^ static int unempty(struct nfa *, struct arc *); - */ -static int /* 0 couldn't, 1 could */ -unempty(nfa, a) -struct nfa *nfa; -struct arc *a; -{ - struct state *from = a->from; - struct state *to = a->to; - int usefrom; /* work on from, as opposed to to? */ - - assert(a->type == EMPTY); - assert(from != nfa->pre && to != nfa->post); - - if (from == to) { /* vacuous loop */ - freearc(nfa, a); - return 1; - } - - /* decide which end to work on */ - usefrom = 1; /* default: attack from */ - if (from->nouts > to->nins) - usefrom = 0; - else if (from->nouts == to->nins) { - /* decide on secondary issue: move/copy fewest arcs */ - if (from->nins > to->nouts) - usefrom = 0; - } - - freearc(nfa, a); - if (usefrom) { - if (from->nouts == 0) { - /* was the state's only outarc */ - moveins(nfa, from, to); - freestate(nfa, from); - } else - copyins(nfa, from, to); - } else { - if (to->nins == 0) { - /* was the state's only inarc */ - moveouts(nfa, to, from); - freestate(nfa, to); - } else - copyouts(nfa, to, from); - } - - return 1; -} - -/* - - cleanup - clean up NFA after optimizations - ^ static VOID cleanup(struct nfa *); - */ -static VOID -cleanup(nfa) -struct nfa *nfa; -{ - struct state *s; - struct state *nexts; - int n; - - /* clear out unreachable or dead-end states */ - /* use pre to mark reachable, then post to mark can-reach-post */ - markreachable(nfa, nfa->pre, (struct state *)NULL, nfa->pre); - markcanreach(nfa, nfa->post, nfa->pre, nfa->post); - for (s = nfa->states; s != NULL; s = nexts) { - nexts = s->next; - if (s->tmp != nfa->post && !s->flag) - dropstate(nfa, s); - } - assert(nfa->post->nins == 0 || nfa->post->tmp == nfa->post); - cleartraverse(nfa, nfa->pre); - assert(nfa->post->nins == 0 || nfa->post->tmp == NULL); - /* the nins==0 (final unreachable) case will be caught later */ - - /* renumber surviving states */ - n = 0; - for (s = nfa->states; s != NULL; s = s->next) - s->no = n++; - nfa->nstates = n; -} - -/* - - markreachable - recursive marking of reachable states - ^ static VOID markreachable(struct nfa *, struct state *, struct state *, - ^ struct state *); - */ -static VOID -markreachable(nfa, s, okay, mark) -struct nfa *nfa; -struct state *s; -struct state *okay; /* consider only states with this mark */ -struct state *mark; /* the value to mark with */ -{ - struct arc *a; - - if (s->tmp != okay) - return; - s->tmp = mark; - - for (a = s->outs; a != NULL; a = a->outchain) - markreachable(nfa, a->to, okay, mark); -} - -/* - - markcanreach - recursive marking of states which can reach here - ^ static VOID markcanreach(struct nfa *, struct state *, struct state *, - ^ struct state *); - */ -static VOID -markcanreach(nfa, s, okay, mark) -struct nfa *nfa; -struct state *s; -struct state *okay; /* consider only states with this mark */ -struct state *mark; /* the value to mark with */ -{ - struct arc *a; - - if (s->tmp != okay) - return; - s->tmp = mark; - - for (a = s->ins; a != NULL; a = a->inchain) - markcanreach(nfa, a->from, okay, mark); -} - -/* - - analyze - ascertain potentially-useful facts about an optimized NFA - ^ static long analyze(struct nfa *); - */ -static long /* re_info bits to be ORed in */ -analyze(nfa) -struct nfa *nfa; -{ - struct arc *a; - struct arc *aa; - - if (nfa->pre->outs == NULL) - return REG_UIMPOSSIBLE; - for (a = nfa->pre->outs; a != NULL; a = a->outchain) - for (aa = a->to->outs; aa != NULL; aa = aa->outchain) - if (aa->to == nfa->post) - return REG_UEMPTYMATCH; - return 0; -} - -/* - - compact - compact an NFA - ^ static VOID compact(struct nfa *, struct cnfa *); - */ -static VOID -compact(nfa, cnfa) -struct nfa *nfa; -struct cnfa *cnfa; -{ - struct state *s; - struct arc *a; - size_t nstates; - size_t narcs; - struct carc *ca; - struct carc *first; - - assert (!NISERR()); - - nstates = 0; - narcs = 0; - for (s = nfa->states; s != NULL; s = s->next) { - nstates++; - narcs += 1 + s->nouts + 1; - /* 1 as a fake for flags, nouts for arcs, 1 as endmarker */ - } - - cnfa->states = (struct carc **)MALLOC(nstates * sizeof(struct carc *)); - cnfa->arcs = (struct carc *)MALLOC(narcs * sizeof(struct carc)); - if (cnfa->states == NULL || cnfa->arcs == NULL) { - if (cnfa->states != NULL) - FREE(cnfa->states); - if (cnfa->arcs != NULL) - FREE(cnfa->arcs); - NERR(REG_ESPACE); - return; - } - cnfa->nstates = nstates; - cnfa->pre = nfa->pre->no; - cnfa->post = nfa->post->no; - cnfa->bos[0] = nfa->bos[0]; - cnfa->bos[1] = nfa->bos[1]; - cnfa->eos[0] = nfa->eos[0]; - cnfa->eos[1] = nfa->eos[1]; - cnfa->ncolors = maxcolor(nfa->cm) + 1; - cnfa->flags = 0; - - ca = cnfa->arcs; - for (s = nfa->states; s != NULL; s = s->next) { - assert((size_t)s->no < nstates); - cnfa->states[s->no] = ca; - ca->co = 0; /* clear and skip flags "arc" */ - ca++; - first = ca; - for (a = s->outs; a != NULL; a = a->outchain) - switch (a->type) { - case PLAIN: - ca->co = a->co; - ca->to = a->to->no; - ca++; - break; - case LACON: - assert(s->no != cnfa->pre); - ca->co = (color)(cnfa->ncolors + a->co); - ca->to = a->to->no; - ca++; - cnfa->flags |= HASLACONS; - break; - default: - assert(NOTREACHED); - break; - } - carcsort(first, ca-1); - ca->co = COLORLESS; - ca->to = 0; - ca++; - } - assert(ca == &cnfa->arcs[narcs]); - assert(cnfa->nstates != 0); - - /* mark no-progress states */ - for (a = nfa->pre->outs; a != NULL; a = a->outchain) - cnfa->states[a->to->no]->co = 1; - cnfa->states[nfa->pre->no]->co = 1; -} - -/* - - carcsort - sort compacted-NFA arcs by color - * Really dumb algorithm, but if the list is long enough for that to matter, - * you're in real trouble anyway. - ^ static VOID carcsort(struct carc *, struct carc *); - */ -static VOID -carcsort(first, last) -struct carc *first; -struct carc *last; -{ - struct carc *p; - struct carc *q; - struct carc tmp; - - if (last - first <= 1) - return; - - for (p = first; p <= last; p++) - for (q = p; q <= last; q++) - if (p->co > q->co || - (p->co == q->co && p->to > q->to)) { - assert(p != q); - tmp = *p; - *p = *q; - *q = tmp; - } -} - -/* - - freecnfa - free a compacted NFA - ^ static VOID freecnfa(struct cnfa *); - */ -static VOID -freecnfa(cnfa) -struct cnfa *cnfa; -{ - assert(cnfa->nstates != 0); /* not empty already */ - cnfa->nstates = 0; - FREE(cnfa->states); - FREE(cnfa->arcs); -} - -/* - - dumpnfa - dump an NFA in human-readable form - ^ static VOID dumpnfa(struct nfa *, FILE *); - */ -static VOID -dumpnfa(nfa, f) -struct nfa *nfa; -FILE *f; -{ -#ifdef REG_DEBUG - struct state *s; - - fprintf(f, "pre %d, post %d", nfa->pre->no, nfa->post->no); - if (nfa->bos[0] != COLORLESS) - fprintf(f, ", bos [%ld]", (long)nfa->bos[0]); - if (nfa->bos[1] != COLORLESS) - fprintf(f, ", bol [%ld]", (long)nfa->bos[1]); - if (nfa->eos[0] != COLORLESS) - fprintf(f, ", eos [%ld]", (long)nfa->eos[0]); - if (nfa->eos[1] != COLORLESS) - fprintf(f, ", eol [%ld]", (long)nfa->eos[1]); - fprintf(f, "\n"); - for (s = nfa->states; s != NULL; s = s->next) - dumpstate(s, f); - if (nfa->parent == NULL) - dumpcolors(nfa->cm, f); - fflush(f); -#endif -} - -#ifdef REG_DEBUG /* subordinates of dumpnfa */ -/* - ^ #ifdef REG_DEBUG - */ - -/* - - dumpstate - dump an NFA state in human-readable form - ^ static VOID dumpstate(struct state *, FILE *); - */ -static VOID -dumpstate(s, f) -struct state *s; -FILE *f; -{ - struct arc *a; - - fprintf(f, "%d%s%c", s->no, (s->tmp != NULL) ? "T" : "", - (s->flag) ? s->flag : '.'); - if (s->prev != NULL && s->prev->next != s) - fprintf(f, "\tstate chain bad\n"); - if (s->nouts == 0) - fprintf(f, "\tno out arcs\n"); - else - dumparcs(s, f); - fflush(f); - for (a = s->ins; a != NULL; a = a->inchain) { - if (a->to != s) - fprintf(f, "\tlink from %d to %d on %d's in-chain\n", - a->from->no, a->to->no, s->no); - } -} - -/* - - dumparcs - dump out-arcs in human-readable form - ^ static VOID dumparcs(struct state *, FILE *); - */ -static VOID -dumparcs(s, f) -struct state *s; -FILE *f; -{ - int pos; - - assert(s->nouts > 0); - /* printing arcs in reverse order is usually clearer */ - pos = dumprarcs(s->outs, s, f, 1); - if (pos != 1) - fprintf(f, "\n"); -} - -/* - - dumprarcs - dump remaining outarcs, recursively, in reverse order - ^ static int dumprarcs(struct arc *, struct state *, FILE *, int); - */ -static int /* resulting print position */ -dumprarcs(a, s, f, pos) -struct arc *a; -struct state *s; -FILE *f; -int pos; /* initial print position */ -{ - if (a->outchain != NULL) - pos = dumprarcs(a->outchain, s, f, pos); - dumparc(a, s, f); - if (pos == 5) { - fprintf(f, "\n"); - pos = 1; - } else - pos++; - return pos; -} - -/* - - dumparc - dump one outarc in readable form, including prefixing tab - ^ static VOID dumparc(struct arc *, struct state *, FILE *); - */ -static VOID -dumparc(a, s, f) -struct arc *a; -struct state *s; -FILE *f; -{ - struct arc *aa; - struct arcbatch *ab; - - fprintf(f, "\t"); - switch (a->type) { - case PLAIN: - fprintf(f, "[%ld]", (long)a->co); - break; - case AHEAD: - fprintf(f, ">%ld>", (long)a->co); - break; - case BEHIND: - fprintf(f, "<%ld<", (long)a->co); - break; - case LACON: - fprintf(f, ":%ld:", (long)a->co); - break; - case '^': - case '$': - fprintf(f, "%c%d", a->type, (int)a->co); - break; - case EMPTY: - break; - default: - fprintf(f, "0x%x/0%lo", a->type, (long)a->co); - break; - } - if (a->from != s) - fprintf(f, "?%d?", a->from->no); - for (ab = &a->from->oas; ab != NULL; ab = ab->next) { - for (aa = &ab->a[0]; aa < &ab->a[ABSIZE]; aa++) - if (aa == a) - break; /* NOTE BREAK OUT */ - if (aa < &ab->a[ABSIZE]) /* propagate break */ - break; /* NOTE BREAK OUT */ - } - if (ab == NULL) - fprintf(f, "?!?"); /* not in allocated space */ - fprintf(f, "->"); - if (a->to == NULL) { - fprintf(f, "NULL"); - return; - } - fprintf(f, "%d", a->to->no); - for (aa = a->to->ins; aa != NULL; aa = aa->inchain) - if (aa == a) - break; /* NOTE BREAK OUT */ - if (aa == NULL) - fprintf(f, "?!?"); /* missing from in-chain */ -} - -/* - ^ #endif - */ -#endif /* ifdef REG_DEBUG */ - -/* - - dumpcnfa - dump a compacted NFA in human-readable form - ^ static VOID dumpcnfa(struct cnfa *, FILE *); - */ -static VOID -dumpcnfa(cnfa, f) -struct cnfa *cnfa; -FILE *f; -{ -#ifdef REG_DEBUG - int st; - - fprintf(f, "pre %d, post %d", cnfa->pre, cnfa->post); - if (cnfa->bos[0] != COLORLESS) - fprintf(f, ", bos [%ld]", (long)cnfa->bos[0]); - if (cnfa->bos[1] != COLORLESS) - fprintf(f, ", bol [%ld]", (long)cnfa->bos[1]); - if (cnfa->eos[0] != COLORLESS) - fprintf(f, ", eos [%ld]", (long)cnfa->eos[0]); - if (cnfa->eos[1] != COLORLESS) - fprintf(f, ", eol [%ld]", (long)cnfa->eos[1]); - if (cnfa->flags&HASLACONS) - fprintf(f, ", haslacons"); - fprintf(f, "\n"); - for (st = 0; st < cnfa->nstates; st++) - dumpcstate(st, cnfa->states[st], cnfa, f); - fflush(f); -#endif -} - -#ifdef REG_DEBUG /* subordinates of dumpcnfa */ -/* - ^ #ifdef REG_DEBUG - */ - -/* - - dumpcstate - dump a compacted-NFA state in human-readable form - ^ static VOID dumpcstate(int, struct carc *, struct cnfa *, FILE *); - */ -static VOID -dumpcstate(st, ca, cnfa, f) -int st; -struct carc *ca; -struct cnfa *cnfa; -FILE *f; -{ - int i; - int pos; - - fprintf(f, "%d%s", st, (ca[0].co) ? ":" : "."); - pos = 1; - for (i = 1; ca[i].co != COLORLESS; i++) { - if (ca[i].co < cnfa->ncolors) - fprintf(f, "\t[%ld]->%d", (long)ca[i].co, ca[i].to); - else - fprintf(f, "\t:%ld:->%d", (long)ca[i].co-cnfa->ncolors, - ca[i].to); - if (pos == 5) { - fprintf(f, "\n"); - pos = 1; - } else - pos++; - } - if (i == 1 || pos != 1) - fprintf(f, "\n"); - fflush(f); -} - -/* - ^ #endif - */ -#endif /* ifdef REG_DEBUG */ diff --git a/wxWidgets/src/regex/regcomp.c b/wxWidgets/src/regex/regcomp.c deleted file mode 100644 index 4ad457ff95..0000000000 --- a/wxWidgets/src/regex/regcomp.c +++ /dev/null @@ -1,2179 +0,0 @@ -/* - * re_*comp and friends - compile REs - * This file #includes several others (see the bottom). - * - * Copyright (c) 1998, 1999 Henry Spencer. All rights reserved. - * - * Development of this software was funded, in part, by Cray Research Inc., - * UUNET Communications Services Inc., Sun Microsystems Inc., and Scriptics - * Corporation, none of whom are responsible for the results. The author - * thanks all of them. - * - * Redistribution and use in source and binary forms -- with or without - * modification -- are permitted for any purpose, provided that - * redistributions in source form retain this entire copyright notice and - * indicate the origin and nature of any modifications. - * - * I'd appreciate being given credit for this package in the documentation - * of software which uses it, but that is not a requirement. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL - * HENRY SPENCER BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; - * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "regguts.h" - -/* - * forward declarations, up here so forward datatypes etc. are defined early - */ -/* =====^!^===== begin forwards =====^!^===== */ -/* automatically gathered by fwd; do not hand-edit */ -/* === regcomp.c === */ -int compile _ANSI_ARGS_((regex_t *, CONST chr *, size_t, int)); -static VOID moresubs _ANSI_ARGS_((struct vars *, int)); -static int freev _ANSI_ARGS_((struct vars *, int)); -static VOID makesearch _ANSI_ARGS_((struct vars *, struct nfa *)); -static struct subre *parse _ANSI_ARGS_((struct vars *, int, int, struct state *, struct state *)); -static struct subre *parsebranch _ANSI_ARGS_((struct vars *, int, int, struct state *, struct state *, int)); -static VOID parseqatom _ANSI_ARGS_((struct vars *, int, int, struct state *, struct state *, struct subre *)); -static VOID nonword _ANSI_ARGS_((struct vars *, int, struct state *, struct state *)); -static VOID word _ANSI_ARGS_((struct vars *, int, struct state *, struct state *)); -static int scannum _ANSI_ARGS_((struct vars *)); -static VOID repeat _ANSI_ARGS_((struct vars *, struct state *, struct state *, int, int)); -static VOID bracket _ANSI_ARGS_((struct vars *, struct state *, struct state *)); -static VOID cbracket _ANSI_ARGS_((struct vars *, struct state *, struct state *)); -static VOID brackpart _ANSI_ARGS_((struct vars *, struct state *, struct state *)); -static chr *scanplain _ANSI_ARGS_((struct vars *)); -static VOID leaders _ANSI_ARGS_((struct vars *, struct cvec *)); -static VOID onechr _ANSI_ARGS_((struct vars *, pchr, struct state *, struct state *)); -static VOID dovec _ANSI_ARGS_((struct vars *, struct cvec *, struct state *, struct state *)); -static celt nextleader _ANSI_ARGS_((struct vars *, pchr, pchr)); -static VOID wordchrs _ANSI_ARGS_((struct vars *)); -static struct subre *subre _ANSI_ARGS_((struct vars *, int, int, struct state *, struct state *)); -static VOID freesubre _ANSI_ARGS_((struct vars *, struct subre *)); -static VOID freesrnode _ANSI_ARGS_((struct vars *, struct subre *)); -static VOID optst _ANSI_ARGS_((struct vars *, struct subre *)); -static int numst _ANSI_ARGS_((struct subre *, int)); -static VOID markst _ANSI_ARGS_((struct subre *)); -static VOID cleanst _ANSI_ARGS_((struct vars *)); -static long nfatree _ANSI_ARGS_((struct vars *, struct subre *, FILE *)); -static long nfanode _ANSI_ARGS_((struct vars *, struct subre *, FILE *)); -static int newlacon _ANSI_ARGS_((struct vars *, struct state *, struct state *, int)); -static VOID freelacons _ANSI_ARGS_((struct subre *, int)); -static VOID rfree _ANSI_ARGS_((regex_t *)); -static VOID dump _ANSI_ARGS_((regex_t *, FILE *)); -static VOID dumpst _ANSI_ARGS_((struct subre *, FILE *, int)); -static VOID stdump _ANSI_ARGS_((struct subre *, FILE *, int)); -static char *stid _ANSI_ARGS_((struct subre *, char *, size_t)); -/* === regc_lex.c === */ -static VOID lexstart _ANSI_ARGS_((struct vars *)); -static VOID prefixes _ANSI_ARGS_((struct vars *)); -static VOID lexnest _ANSI_ARGS_((struct vars *, chr *, chr *)); -static VOID lexword _ANSI_ARGS_((struct vars *)); -static int next _ANSI_ARGS_((struct vars *)); -static int lexescape _ANSI_ARGS_((struct vars *)); -static chr lexdigits _ANSI_ARGS_((struct vars *, int, int, int)); -static int brenext _ANSI_ARGS_((struct vars *, pchr)); -static VOID skip _ANSI_ARGS_((struct vars *)); -static chr newline _ANSI_ARGS_((NOPARMS)); -#ifdef REG_DEBUG -static chr *ch _ANSI_ARGS_((NOPARMS)); -#endif -static chr chrnamed _ANSI_ARGS_((struct vars *, chr *, chr *, pchr)); -/* === regc_color.c === */ -static VOID initcm _ANSI_ARGS_((struct vars *, struct colormap *)); -static VOID freecm _ANSI_ARGS_((struct colormap *)); -static VOID cmtreefree _ANSI_ARGS_((struct colormap *, union tree *, int)); -static color setcolor _ANSI_ARGS_((struct colormap *, pchr, pcolor)); -static color maxcolor _ANSI_ARGS_((struct colormap *)); -static color newcolor _ANSI_ARGS_((struct colormap *)); -static VOID freecolor _ANSI_ARGS_((struct colormap *, pcolor)); -static color pseudocolor _ANSI_ARGS_((struct colormap *)); -static color subcolor _ANSI_ARGS_((struct colormap *, pchr c)); -static color newsub _ANSI_ARGS_((struct colormap *, pcolor)); -static VOID subrange _ANSI_ARGS_((struct vars *, pchr, pchr, struct state *, struct state *)); -static VOID subblock _ANSI_ARGS_((struct vars *, pchr, struct state *, struct state *)); -static VOID okcolors _ANSI_ARGS_((struct nfa *, struct colormap *)); -static VOID colorchain _ANSI_ARGS_((struct colormap *, struct arc *)); -static VOID uncolorchain _ANSI_ARGS_((struct colormap *, struct arc *)); -static int singleton _ANSI_ARGS_((struct colormap *, pchr c)); -static VOID rainbow _ANSI_ARGS_((struct nfa *, struct colormap *, int, pcolor, struct state *, struct state *)); -static VOID colorcomplement _ANSI_ARGS_((struct nfa *, struct colormap *, int, struct state *, struct state *, struct state *)); -#ifdef REG_DEBUG -static VOID dumpcolors _ANSI_ARGS_((struct colormap *, FILE *)); -static VOID fillcheck _ANSI_ARGS_((struct colormap *, union tree *, int, FILE *)); -static VOID dumpchr _ANSI_ARGS_((pchr, FILE *)); -#endif -/* === regc_nfa.c === */ -static struct nfa *newnfa _ANSI_ARGS_((struct vars *, struct colormap *, struct nfa *)); -static VOID freenfa _ANSI_ARGS_((struct nfa *)); -static struct state *newstate _ANSI_ARGS_((struct nfa *)); -static struct state *newfstate _ANSI_ARGS_((struct nfa *, int flag)); -static VOID dropstate _ANSI_ARGS_((struct nfa *, struct state *)); -static VOID freestate _ANSI_ARGS_((struct nfa *, struct state *)); -static VOID destroystate _ANSI_ARGS_((struct nfa *, struct state *)); -static VOID newarc _ANSI_ARGS_((struct nfa *, int, pcolor, struct state *, struct state *)); -static struct arc *allocarc _ANSI_ARGS_((struct nfa *, struct state *)); -static VOID freearc _ANSI_ARGS_((struct nfa *, struct arc *)); -static struct arc *findarc _ANSI_ARGS_((struct state *, int, pcolor)); -static VOID cparc _ANSI_ARGS_((struct nfa *, struct arc *, struct state *, struct state *)); -static VOID moveins _ANSI_ARGS_((struct nfa *, struct state *, struct state *)); -static VOID copyins _ANSI_ARGS_((struct nfa *, struct state *, struct state *)); -static VOID moveouts _ANSI_ARGS_((struct nfa *, struct state *, struct state *)); -static VOID copyouts _ANSI_ARGS_((struct nfa *, struct state *, struct state *)); -static VOID cloneouts _ANSI_ARGS_((struct nfa *, struct state *, struct state *, struct state *, int)); -static VOID delsub _ANSI_ARGS_((struct nfa *, struct state *, struct state *)); -static VOID deltraverse _ANSI_ARGS_((struct nfa *, struct state *, struct state *)); -static VOID dupnfa _ANSI_ARGS_((struct nfa *, struct state *, struct state *, struct state *, struct state *)); -static VOID duptraverse _ANSI_ARGS_((struct nfa *, struct state *, struct state *)); -static VOID cleartraverse _ANSI_ARGS_((struct nfa *, struct state *)); -static VOID specialcolors _ANSI_ARGS_((struct nfa *)); -static long optimize _ANSI_ARGS_((struct nfa *, FILE *)); -static VOID pullback _ANSI_ARGS_((struct nfa *, FILE *)); -static int pull _ANSI_ARGS_((struct nfa *, struct arc *)); -static VOID pushfwd _ANSI_ARGS_((struct nfa *, FILE *)); -static int push _ANSI_ARGS_((struct nfa *, struct arc *)); -#define INCOMPATIBLE 1 /* destroys arc */ -#define SATISFIED 2 /* constraint satisfied */ -#define COMPATIBLE 3 /* compatible but not satisfied yet */ -static int combine _ANSI_ARGS_((struct arc *, struct arc *)); -static VOID fixempties _ANSI_ARGS_((struct nfa *, FILE *)); -static int unempty _ANSI_ARGS_((struct nfa *, struct arc *)); -static VOID cleanup _ANSI_ARGS_((struct nfa *)); -static VOID markreachable _ANSI_ARGS_((struct nfa *, struct state *, struct state *, struct state *)); -static VOID markcanreach _ANSI_ARGS_((struct nfa *, struct state *, struct state *, struct state *)); -static long analyze _ANSI_ARGS_((struct nfa *)); -static VOID compact _ANSI_ARGS_((struct nfa *, struct cnfa *)); -static VOID carcsort _ANSI_ARGS_((struct carc *, struct carc *)); -static VOID freecnfa _ANSI_ARGS_((struct cnfa *)); -static VOID dumpnfa _ANSI_ARGS_((struct nfa *, FILE *)); -#ifdef REG_DEBUG -static VOID dumpstate _ANSI_ARGS_((struct state *, FILE *)); -static VOID dumparcs _ANSI_ARGS_((struct state *, FILE *)); -static int dumprarcs _ANSI_ARGS_((struct arc *, struct state *, FILE *, int)); -static VOID dumparc _ANSI_ARGS_((struct arc *, struct state *, FILE *)); -#endif -static VOID dumpcnfa _ANSI_ARGS_((struct cnfa *, FILE *)); -#ifdef REG_DEBUG -static VOID dumpcstate _ANSI_ARGS_((int, struct carc *, struct cnfa *, FILE *)); -#endif -/* === regc_cvec.c === */ -static struct cvec *newcvec _ANSI_ARGS_((int, int, int)); -static struct cvec *clearcvec _ANSI_ARGS_((struct cvec *)); -static VOID addchr _ANSI_ARGS_((struct cvec *, pchr)); -static VOID addrange _ANSI_ARGS_((struct cvec *, pchr, pchr)); -static VOID addmcce _ANSI_ARGS_((struct cvec *, chr *, chr *)); -static int haschr _ANSI_ARGS_((struct cvec *, pchr)); -static struct cvec *getcvec _ANSI_ARGS_((struct vars *, int, int, int)); -static VOID freecvec _ANSI_ARGS_((struct cvec *)); -/* === regc_locale.c === */ -static int nmcces _ANSI_ARGS_((struct vars *)); -static int nleaders _ANSI_ARGS_((struct vars *)); -static struct cvec *allmcces _ANSI_ARGS_((struct vars *, struct cvec *)); -static celt element _ANSI_ARGS_((struct vars *, chr *, chr *)); -static struct cvec *range _ANSI_ARGS_((struct vars *, celt, celt, int)); -static int before _ANSI_ARGS_((celt, celt)); -static struct cvec *eclass _ANSI_ARGS_((struct vars *, celt, int)); -static struct cvec *cclass _ANSI_ARGS_((struct vars *, chr *, chr *, int)); -static struct cvec *allcases _ANSI_ARGS_((struct vars *, pchr)); -static int cmp _ANSI_ARGS_((CONST chr *, CONST chr *, size_t)); -static int casecmp _ANSI_ARGS_((CONST chr *, CONST chr *, size_t)); -/* automatically gathered by fwd; do not hand-edit */ -/* =====^!^===== end forwards =====^!^===== */ - - - -/* internal variables, bundled for easy passing around */ -struct vars { - regex_t *re; - chr *now; /* scan pointer into string */ - chr *stop; /* end of string */ - chr *savenow; /* saved now and stop for "subroutine call" */ - chr *savestop; - int err; /* error code (0 if none) */ - int cflags; /* copy of compile flags */ - int lasttype; /* type of previous token */ - int nexttype; /* type of next token */ - chr nextvalue; /* value (if any) of next token */ - int lexcon; /* lexical context type (see lex.c) */ - int nsubexp; /* subexpression count */ - struct subre **subs; /* subRE pointer vector */ - size_t nsubs; /* length of vector */ - struct subre *sub10[10]; /* initial vector, enough for most */ - struct nfa *nfa; /* the NFA */ - struct colormap *cm; /* character color map */ - color nlcolor; /* color of newline */ - struct state *wordchrs; /* state in nfa holding word-char outarcs */ - struct subre *tree; /* subexpression tree */ - struct subre *treechain; /* all tree nodes allocated */ - struct subre *treefree; /* any free tree nodes */ - int ntree; /* number of tree nodes */ - struct cvec *cv; /* interface cvec */ - struct cvec *cv2; /* utility cvec */ - struct cvec *mcces; /* collating-element information */ -# define ISCELEADER(v,c) (v->mcces != NULL && haschr(v->mcces, (c))) - struct state *mccepbegin; /* in nfa, start of MCCE prototypes */ - struct state *mccepend; /* in nfa, end of MCCE prototypes */ - struct subre *lacons; /* lookahead-constraint vector */ - int nlacons; /* size of lacons */ -}; - -/* parsing macros; most know that `v' is the struct vars pointer */ -#define NEXT() (next(v)) /* advance by one token */ -#define SEE(t) (v->nexttype == (t)) /* is next token this? */ -#define EAT(t) (SEE(t) && next(v)) /* if next is this, swallow it */ -#define VISERR(vv) ((vv)->err != 0) /* have we seen an error yet? */ -#define ISERR() VISERR(v) -#define VERR(vv,e) ((vv)->nexttype = EOS, ((vv)->err) ? (vv)->err :\ - ((vv)->err = (e))) -#define ERR(e) VERR(v, e) /* record an error */ -#define NOERR() {if (ISERR()) return;} /* if error seen, return */ -#define NOERRN() {if (ISERR()) return NULL;} /* NOERR with retval */ -#define NOERRZ() {if (ISERR()) return 0;} /* NOERR with retval */ -#define INSIST(c, e) ((c) ? 0 : ERR(e)) /* if condition false, error */ -#define NOTE(b) (v->re->re_info |= (b)) /* note visible condition */ -#define EMPTYARC(x, y) newarc(v->nfa, EMPTY, 0, x, y) - -/* token type codes, some also used as NFA arc types */ -#define EMPTY 'n' /* no token present */ -#define EOS 'e' /* end of string */ -#define PLAIN 'p' /* ordinary character */ -#define DIGIT 'd' /* digit (in bound) */ -#define BACKREF 'b' /* back reference */ -#define COLLEL 'I' /* start of [. */ -#define ECLASS 'E' /* start of [= */ -#define CCLASS 'C' /* start of [: */ -#define END 'X' /* end of [. [= [: */ -#define RANGE 'R' /* - within [] which might be range delim. */ -#define LACON 'L' /* lookahead constraint subRE */ -#define AHEAD 'a' /* color-lookahead arc */ -#define BEHIND 'r' /* color-lookbehind arc */ -#define WBDRY 'w' /* word boundary constraint */ -#define NWBDRY 'W' /* non-word-boundary constraint */ -#define SBEGIN 'A' /* beginning of string (even if not BOL) */ -#define SEND 'Z' /* end of string (even if not EOL) */ -#define PREFER 'P' /* length preference */ - -/* is an arc colored, and hence on a color chain? */ -#define COLORED(a) ((a)->type == PLAIN || (a)->type == AHEAD || \ - (a)->type == BEHIND) - - - -/* static function list */ -static struct fns functions = { - rfree, /* regfree insides */ -}; - - - -/* - - compile - compile regular expression - ^ int compile(regex_t *, CONST chr *, size_t, int); - */ -int -compile(re, string, len, flags) -regex_t *re; -CONST chr *string; -size_t len; -int flags; -{ - struct vars var; - struct vars *v = &var; - struct guts *g; - int i; - size_t j; - FILE *debug = (flags®_PROGRESS) ? stdout : (FILE *)NULL; -# define CNOERR() { if (ISERR()) return freev(v, v->err); } - - /* sanity checks */ - - if (re == NULL || string == NULL) - return REG_INVARG; - if ((flags®_QUOTE) && - (flags&(REG_ADVANCED|REG_EXPANDED|REG_NEWLINE))) - return REG_INVARG; - if (!(flags®_EXTENDED) && (flags®_ADVF)) - return REG_INVARG; - - /* initial setup (after which freev() is callable) */ - v->re = re; - v->now = (chr *)string; - v->stop = v->now + len; - v->savenow = v->savestop = NULL; - v->err = 0; - v->cflags = flags; - v->nsubexp = 0; - v->subs = v->sub10; - v->nsubs = 10; - for (j = 0; j < v->nsubs; j++) - v->subs[j] = NULL; - v->nfa = NULL; - v->cm = NULL; - v->nlcolor = COLORLESS; - v->wordchrs = NULL; - v->tree = NULL; - v->treechain = NULL; - v->treefree = NULL; - v->cv = NULL; - v->cv2 = NULL; - v->mcces = NULL; - v->lacons = NULL; - v->nlacons = 0; - re->re_magic = REMAGIC; - re->re_info = 0; /* bits get set during parse */ - re->re_csize = sizeof(chr); - re->re_guts = NULL; - re->re_fns = VS(&functions); - - /* more complex setup, malloced things */ - re->re_guts = VS(MALLOC(sizeof(struct guts))); - if (re->re_guts == NULL) - return freev(v, REG_ESPACE); - g = (struct guts *)re->re_guts; - g->tree = NULL; - initcm(v, &g->cmap); - v->cm = &g->cmap; - g->lacons = NULL; - g->nlacons = 0; - ZAPCNFA(g->search); - v->nfa = newnfa(v, v->cm, (struct nfa *)NULL); - CNOERR(); - v->cv = newcvec(100, 20, 10); - if (v->cv == NULL) - return freev(v, REG_ESPACE); - i = nmcces(v); - if (i > 0) { - v->mcces = newcvec(nleaders(v), 0, i); - CNOERR(); - v->mcces = allmcces(v, v->mcces); - leaders(v, v->mcces); - addmcce(v->mcces, (chr *)NULL, (chr *)NULL); /* dummy */ - } - CNOERR(); - - /* parsing */ - lexstart(v); /* also handles prefixes */ - if ((v->cflags®_NLSTOP) || (v->cflags®_NLANCH)) { - /* assign newline a unique color */ - v->nlcolor = subcolor(v->cm, newline()); - okcolors(v->nfa, v->cm); - } - CNOERR(); - v->tree = parse(v, EOS, PLAIN, v->nfa->init, v->nfa->final); - assert(SEE(EOS)); /* even if error; ISERR() => SEE(EOS) */ - CNOERR(); - assert(v->tree != NULL); - - /* finish setup of nfa and its subre tree */ - specialcolors(v->nfa); - CNOERR(); - if (debug != NULL) { - fprintf(debug, "\n\n\n========= RAW ==========\n"); - dumpnfa(v->nfa, debug); - dumpst(v->tree, debug, 1); - } - optst(v, v->tree); - v->ntree = numst(v->tree, 1); - markst(v->tree); - cleanst(v); - if (debug != NULL) { - fprintf(debug, "\n\n\n========= TREE FIXED ==========\n"); - dumpst(v->tree, debug, 1); - } - - /* build compacted NFAs for tree and lacons */ - re->re_info |= nfatree(v, v->tree, debug); - CNOERR(); - assert(v->nlacons == 0 || v->lacons != NULL); - for (i = 1; i < v->nlacons; i++) { - if (debug != NULL) - fprintf(debug, "\n\n\n========= LA%d ==========\n", i); - nfanode(v, &v->lacons[i], debug); - } - CNOERR(); - if (v->tree->flags&SHORTER) - NOTE(REG_USHORTEST); - - /* build compacted NFAs for tree, lacons, fast search */ - if (debug != NULL) - fprintf(debug, "\n\n\n========= SEARCH ==========\n"); - /* can sacrifice main NFA now, so use it as work area */ - (DISCARD)optimize(v->nfa, debug); - CNOERR(); - makesearch(v, v->nfa); - CNOERR(); - compact(v->nfa, &g->search); - CNOERR(); - - /* looks okay, package it up */ - re->re_nsub = v->nsubexp; - v->re = NULL; /* freev no longer frees re */ - g->magic = GUTSMAGIC; - g->cflags = v->cflags; - g->info = re->re_info; - g->nsub = re->re_nsub; - g->tree = v->tree; - v->tree = NULL; - g->ntree = v->ntree; - g->compare = (v->cflags®_ICASE) ? casecmp : cmp; - g->lacons = v->lacons; - v->lacons = NULL; - g->nlacons = v->nlacons; - - if (flags®_DUMP) - dump(re, stdout); - - assert(v->err == 0); - return freev(v, 0); -} - -/* - - moresubs - enlarge subRE vector - ^ static VOID moresubs(struct vars *, int); - */ -static VOID -moresubs(v, wanted) -struct vars *v; -int wanted; /* want enough room for this one */ -{ - struct subre **p; - size_t n; - - assert(wanted > 0 && (size_t)wanted >= v->nsubs); - n = (size_t)wanted * 3 / 2 + 1; - if (v->subs == v->sub10) { - p = (struct subre **)MALLOC(n * sizeof(struct subre *)); - if (p != NULL) - memcpy(VS(p), VS(v->subs), - v->nsubs * sizeof(struct subre *)); - } else - p = (struct subre **)REALLOC(v->subs, n*sizeof(struct subre *)); - if (p == NULL) { - ERR(REG_ESPACE); - return; - } - v->subs = p; - for (p = &v->subs[v->nsubs]; v->nsubs < n; p++, v->nsubs++) - *p = NULL; - assert(v->nsubs == n); - assert((size_t)wanted < v->nsubs); -} - -/* - - freev - free vars struct's substructures where necessary - * Optionally does error-number setting, and always returns error code - * (if any), to make error-handling code terser. - ^ static int freev(struct vars *, int); - */ -static int -freev(v, err) -struct vars *v; -int err; -{ - if (v->re != NULL) - rfree(v->re); - if (v->subs != v->sub10) - FREE(v->subs); - if (v->nfa != NULL) - freenfa(v->nfa); - if (v->tree != NULL) - freesubre(v, v->tree); - if (v->treechain != NULL) - cleanst(v); - if (v->cv != NULL) - freecvec(v->cv); - if (v->cv2 != NULL) - freecvec(v->cv2); - if (v->mcces != NULL) - freecvec(v->mcces); - if (v->lacons != NULL) - freelacons(v->lacons, v->nlacons); - ERR(err); /* nop if err==0 */ - - return v->err; -} - -/* - - makesearch - turn an NFA into a search NFA (implicit prepend of .*?) - * NFA must have been optimize()d already. - ^ static VOID makesearch(struct vars *, struct nfa *); - */ -static VOID -makesearch(v, nfa) -struct vars *v; -struct nfa *nfa; -{ - struct arc *a; - struct arc *b; - struct state *pre = nfa->pre; - struct state *s; - struct state *s2; - struct state *slist; - - /* no loops are needed if it's anchored */ - for (a = pre->outs; a != NULL; a = a->outchain) { - assert(a->type == PLAIN); - if (a->co != nfa->bos[0] && a->co != nfa->bos[1]) - break; - } - if (a != NULL) { - /* add implicit .* in front */ - rainbow(nfa, v->cm, PLAIN, COLORLESS, pre, pre); - - /* and ^* and \A* too -- not always necessary, but harmless */ - newarc(nfa, PLAIN, nfa->bos[0], pre, pre); - newarc(nfa, PLAIN, nfa->bos[1], pre, pre); - } - - /* - * Now here's the subtle part. Because many REs have no lookback - * constraints, often knowing when you were in the pre state tells - * you little; it's the next state(s) that are informative. But - * some of them may have other inarcs, i.e. it may be possible to - * make actual progress and then return to one of them. We must - * de-optimize such cases, splitting each such state into progress - * and no-progress states. - */ - - /* first, make a list of the states */ - slist = NULL; - for (a = pre->outs; a != NULL; a = a->outchain) { - s = a->to; - for (b = s->ins; b != NULL; b = b->inchain) - if (b->from != pre) - break; - if (b != NULL) { /* must be split */ - if (s->tmp == NULL) { /* if not already in the list */ - /* (fixes bugs 505048, 230589, */ - /* 840258, 504785) */ - s->tmp = slist; - slist = s; - } - } - } - - /* do the splits */ - for (s = slist; s != NULL; s = s2) { - s2 = newstate(nfa); - copyouts(nfa, s, s2); - for (a = s->ins; a != NULL; a = b) { - b = a->inchain; - if (a->from != pre) { - cparc(nfa, a, a->from, s2); - freearc(nfa, a); - } - } - s2 = s->tmp; - s->tmp = NULL; /* clean up while we're at it */ - } -} - -/* - - parse - parse an RE - * This is actually just the top level, which parses a bunch of branches - * tied together with '|'. They appear in the tree as the left children - * of a chain of '|' subres. - ^ static struct subre *parse(struct vars *, int, int, struct state *, - ^ struct state *); - */ -static struct subre * -parse(v, stopper, type, init, final) -struct vars *v; -int stopper; /* EOS or ')' */ -int type; /* LACON (lookahead subRE) or PLAIN */ -struct state *init; /* initial state */ -struct state *final; /* final state */ -{ - struct state *left; /* scaffolding for branch */ - struct state *right; - struct subre *branches; /* top level */ - struct subre *branch; /* current branch */ - struct subre *t; /* temporary */ - int firstbranch; /* is this the first branch? */ - - assert(stopper == ')' || stopper == EOS); - - branches = subre(v, '|', LONGER, init, final); - NOERRN(); - branch = branches; - firstbranch = 1; - do { /* a branch */ - if (!firstbranch) { - /* need a place to hang it */ - branch->right = subre(v, '|', LONGER, init, final); - NOERRN(); - branch = branch->right; - } - firstbranch = 0; - left = newstate(v->nfa); - right = newstate(v->nfa); - NOERRN(); - EMPTYARC(init, left); - EMPTYARC(right, final); - NOERRN(); - branch->left = parsebranch(v, stopper, type, left, right, 0); - NOERRN(); - branch->flags |= UP(branch->flags | branch->left->flags); - if ((branch->flags &~ branches->flags) != 0) /* new flags */ - for (t = branches; t != branch; t = t->right) - t->flags |= branch->flags; - } while (EAT('|')); - assert(SEE(stopper) || SEE(EOS)); - - if (!SEE(stopper)) { - assert(stopper == ')' && SEE(EOS)); - ERR(REG_EPAREN); - } - - /* optimize out simple cases */ - if (branch == branches) { /* only one branch */ - assert(branch->right == NULL); - t = branch->left; - branch->left = NULL; - freesubre(v, branches); - branches = t; - } else if (!MESSY(branches->flags)) { /* no interesting innards */ - freesubre(v, branches->left); - branches->left = NULL; - freesubre(v, branches->right); - branches->right = NULL; - branches->op = '='; - } - - return branches; -} - -/* - - parsebranch - parse one branch of an RE - * This mostly manages concatenation, working closely with parseqatom(). - * Concatenated things are bundled up as much as possible, with separate - * ',' nodes introduced only when necessary due to substructure. - ^ static struct subre *parsebranch(struct vars *, int, int, struct state *, - ^ struct state *, int); - */ -static struct subre * -parsebranch(v, stopper, type, left, right, partial) -struct vars *v; -int stopper; /* EOS or ')' */ -int type; /* LACON (lookahead subRE) or PLAIN */ -struct state *left; /* leftmost state */ -struct state *right; /* rightmost state */ -int partial; /* is this only part of a branch? */ -{ - struct state *lp; /* left end of current construct */ - int seencontent; /* is there anything in this branch yet? */ - struct subre *t; - - lp = left; - seencontent = 0; - t = subre(v, '=', 0, left, right); /* op '=' is tentative */ - NOERRN(); - while (!SEE('|') && !SEE(stopper) && !SEE(EOS)) { - if (seencontent) { /* implicit concat operator */ - lp = newstate(v->nfa); - NOERRN(); - moveins(v->nfa, right, lp); - } - seencontent = 1; - - /* NB, recursion in parseqatom() may swallow rest of branch */ - parseqatom(v, stopper, type, lp, right, t); - } - - if (!seencontent) { /* empty branch */ - if (!partial) - NOTE(REG_UUNSPEC); - assert(lp == left); - EMPTYARC(left, right); - } - - return t; -} - -/* - - parseqatom - parse one quantified atom or constraint of an RE - * The bookkeeping near the end cooperates very closely with parsebranch(); - * in particular, it contains a recursion that can involve parsing the rest - * of the branch, making this function's name somewhat inaccurate. - ^ static VOID parseqatom(struct vars *, int, int, struct state *, - ^ struct state *, struct subre *); - */ -static VOID -parseqatom(v, stopper, type, lp, rp, top) -struct vars *v; -int stopper; /* EOS or ')' */ -int type; /* LACON (lookahead subRE) or PLAIN */ -struct state *lp; /* left state to hang it on */ -struct state *rp; /* right state to hang it on */ -struct subre *top; /* subtree top */ -{ - struct state *s; /* temporaries for new states */ - struct state *s2; -# define ARCV(t, val) newarc(v->nfa, t, val, lp, rp) - int m, n; - struct subre *atom; /* atom's subtree */ - struct subre *t; - int cap; /* capturing parens? */ - int pos; /* positive lookahead? */ - int subno; /* capturing-parens or backref number */ - int atomtype; - int qprefer; /* quantifier short/long preference */ - int f; - struct subre **atomp; /* where the pointer to atom is */ - - /* initial bookkeeping */ - atom = NULL; - assert(lp->nouts == 0); /* must string new code */ - assert(rp->nins == 0); /* between lp and rp */ - subno = 0; /* just to shut lint up */ - - /* an atom or constraint... */ - atomtype = v->nexttype; - switch (atomtype) { - /* first, constraints, which end by returning */ - case '^': - ARCV('^', 1); - if (v->cflags®_NLANCH) - ARCV(BEHIND, v->nlcolor); - NEXT(); - return; - break; - case '$': - ARCV('$', 1); - if (v->cflags®_NLANCH) - ARCV(AHEAD, v->nlcolor); - NEXT(); - return; - break; - case SBEGIN: - ARCV('^', 1); /* BOL */ - ARCV('^', 0); /* or BOS */ - NEXT(); - return; - break; - case SEND: - ARCV('$', 1); /* EOL */ - ARCV('$', 0); /* or EOS */ - NEXT(); - return; - break; - case '<': - wordchrs(v); /* does NEXT() */ - s = newstate(v->nfa); - NOERR(); - nonword(v, BEHIND, lp, s); - word(v, AHEAD, s, rp); - return; - break; - case '>': - wordchrs(v); /* does NEXT() */ - s = newstate(v->nfa); - NOERR(); - word(v, BEHIND, lp, s); - nonword(v, AHEAD, s, rp); - return; - break; - case WBDRY: - wordchrs(v); /* does NEXT() */ - s = newstate(v->nfa); - NOERR(); - nonword(v, BEHIND, lp, s); - word(v, AHEAD, s, rp); - s = newstate(v->nfa); - NOERR(); - word(v, BEHIND, lp, s); - nonword(v, AHEAD, s, rp); - return; - break; - case NWBDRY: - wordchrs(v); /* does NEXT() */ - s = newstate(v->nfa); - NOERR(); - word(v, BEHIND, lp, s); - word(v, AHEAD, s, rp); - s = newstate(v->nfa); - NOERR(); - nonword(v, BEHIND, lp, s); - nonword(v, AHEAD, s, rp); - return; - break; - case LACON: /* lookahead constraint */ - pos = v->nextvalue; - NEXT(); - s = newstate(v->nfa); - s2 = newstate(v->nfa); - NOERR(); - t = parse(v, ')', LACON, s, s2); - freesubre(v, t); /* internal structure irrelevant */ - assert(SEE(')') || ISERR()); - NEXT(); - n = newlacon(v, s, s2, pos); - NOERR(); - ARCV(LACON, n); - return; - break; - /* then errors, to get them out of the way */ - case '*': - case '+': - case '?': - case '{': - ERR(REG_BADRPT); - return; - break; - default: - ERR(REG_ASSERT); - return; - break; - /* then plain characters, and minor variants on that theme */ - case ')': /* unbalanced paren */ - if ((v->cflags®_ADVANCED) != REG_EXTENDED) { - ERR(REG_EPAREN); - return; - } - /* legal in EREs due to specification botch */ - NOTE(REG_UPBOTCH); - /* fallthrough into case PLAIN */ - case PLAIN: - onechr(v, v->nextvalue, lp, rp); - okcolors(v->nfa, v->cm); - NOERR(); - NEXT(); - break; - case '[': - if (v->nextvalue == 1) - bracket(v, lp, rp); - else - cbracket(v, lp, rp); - assert(SEE(']') || ISERR()); - NEXT(); - break; - case '.': - rainbow(v->nfa, v->cm, PLAIN, - (v->cflags®_NLSTOP) ? v->nlcolor : COLORLESS, - lp, rp); - NEXT(); - break; - /* and finally the ugly stuff */ - case '(': /* value flags as capturing or non */ - cap = (type == LACON) ? 0 : v->nextvalue; - if (cap) { - v->nsubexp++; - subno = v->nsubexp; - if ((size_t)subno >= v->nsubs) - moresubs(v, subno); - assert((size_t)subno < v->nsubs); - } else - atomtype = PLAIN; /* something that's not '(' */ - NEXT(); - /* need new endpoints because tree will contain pointers */ - s = newstate(v->nfa); - s2 = newstate(v->nfa); - NOERR(); - EMPTYARC(lp, s); - EMPTYARC(s2, rp); - NOERR(); - atom = parse(v, ')', PLAIN, s, s2); - assert(SEE(')') || ISERR()); - NEXT(); - NOERR(); - if (cap) { - v->subs[subno] = atom; - t = subre(v, '(', atom->flags|CAP, lp, rp); - NOERR(); - t->subno = subno; - t->left = atom; - atom = t; - } - /* postpone everything else pending possible {0} */ - break; - case BACKREF: /* the Feature From The Black Lagoon */ - INSIST(type != LACON, REG_ESUBREG); - INSIST(v->nextvalue < v->nsubs, REG_ESUBREG); - INSIST(v->subs[(int)v->nextvalue] != NULL, REG_ESUBREG); - NOERR(); - assert(v->nextvalue > 0); - atom = subre(v, 'b', BACKR, lp, rp); - subno = v->nextvalue; - atom->subno = subno; - EMPTYARC(lp, rp); /* temporarily, so there's something */ - NEXT(); - break; - } - - /* ...and an atom may be followed by a quantifier */ - switch (v->nexttype) { - case '*': - m = 0; - n = INFINITY; - qprefer = (v->nextvalue) ? LONGER : SHORTER; - NEXT(); - break; - case '+': - m = 1; - n = INFINITY; - qprefer = (v->nextvalue) ? LONGER : SHORTER; - NEXT(); - break; - case '?': - m = 0; - n = 1; - qprefer = (v->nextvalue) ? LONGER : SHORTER; - NEXT(); - break; - case '{': - NEXT(); - m = scannum(v); - if (EAT(',')) { - if (SEE(DIGIT)) - n = scannum(v); - else - n = INFINITY; - if (m > n) { - ERR(REG_BADBR); - return; - } - /* {m,n} exercises preference, even if it's {m,m} */ - qprefer = (v->nextvalue) ? LONGER : SHORTER; - } else { - n = m; - /* {m} passes operand's preference through */ - qprefer = 0; - } - if (!SEE('}')) { /* catches errors too */ - ERR(REG_BADBR); - return; - } - NEXT(); - break; - default: /* no quantifier */ - m = n = 1; - qprefer = 0; - break; - } - - /* annoying special case: {0} or {0,0} cancels everything */ - if (m == 0 && n == 0) { - if (atom != NULL) - freesubre(v, atom); - if (atomtype == '(') - v->subs[subno] = NULL; - delsub(v->nfa, lp, rp); - EMPTYARC(lp, rp); - return; - } - - /* if not a messy case, avoid hard part */ - assert(!MESSY(top->flags)); - f = top->flags | qprefer | ((atom != NULL) ? atom->flags : 0); - if (atomtype != '(' && atomtype != BACKREF && !MESSY(UP(f))) { - if (!(m == 1 && n == 1)) - repeat(v, lp, rp, m, n); - if (atom != NULL) - freesubre(v, atom); - top->flags = f; - return; - } - - /* - * hard part: something messy - * That is, capturing parens, back reference, short/long clash, or - * an atom with substructure containing one of those. - */ - - /* now we'll need a subre for the contents even if they're boring */ - if (atom == NULL) { - atom = subre(v, '=', 0, lp, rp); - NOERR(); - } - - /* - * prepare a general-purpose state skeleton - * - * ---> [s] ---prefix---> [begin] ---atom---> [end] ----rest---> [rp] - * / / - * [lp] ----> [s2] ----bypass--------------------- - * - * where bypass is an empty, and prefix is some repetitions of atom - */ - s = newstate(v->nfa); /* first, new endpoints for the atom */ - s2 = newstate(v->nfa); - NOERR(); - moveouts(v->nfa, lp, s); - moveins(v->nfa, rp, s2); - NOERR(); - atom->begin = s; - atom->end = s2; - s = newstate(v->nfa); /* and spots for prefix and bypass */ - s2 = newstate(v->nfa); - NOERR(); - EMPTYARC(lp, s); - EMPTYARC(lp, s2); - NOERR(); - - /* break remaining subRE into x{...} and what follows */ - t = subre(v, '.', COMBINE(qprefer, atom->flags), lp, rp); - t->left = atom; - atomp = &t->left; - /* here we should recurse... but we must postpone that to the end */ - - /* split top into prefix and remaining */ - assert(top->op == '=' && top->left == NULL && top->right == NULL); - top->left = subre(v, '=', top->flags, top->begin, lp); - top->op = '.'; - top->right = t; - - /* if it's a backref, now is the time to replicate the subNFA */ - if (atomtype == BACKREF) { - assert(atom->begin->nouts == 1); /* just the EMPTY */ - delsub(v->nfa, atom->begin, atom->end); - assert(v->subs[subno] != NULL); - /* and here's why the recursion got postponed: it must */ - /* wait until the skeleton is filled in, because it may */ - /* hit a backref that wants to copy the filled-in skeleton */ - dupnfa(v->nfa, v->subs[subno]->begin, v->subs[subno]->end, - atom->begin, atom->end); - NOERR(); - } - - /* it's quantifier time; first, turn x{0,...} into x{1,...}|empty */ - if (m == 0) { - EMPTYARC(s2, atom->end); /* the bypass */ - assert(PREF(qprefer) != 0); - f = COMBINE(qprefer, atom->flags); - t = subre(v, '|', f, lp, atom->end); - NOERR(); - t->left = atom; - t->right = subre(v, '|', PREF(f), s2, atom->end); - NOERR(); - t->right->left = subre(v, '=', 0, s2, atom->end); - NOERR(); - *atomp = t; - atomp = &t->left; - m = 1; - } - - /* deal with the rest of the quantifier */ - if (atomtype == BACKREF) { - /* special case: backrefs have internal quantifiers */ - EMPTYARC(s, atom->begin); /* empty prefix */ - /* just stuff everything into atom */ - repeat(v, atom->begin, atom->end, m, n); - atom->min = (short)m; - atom->max = (short)n; - atom->flags |= COMBINE(qprefer, atom->flags); - } else if (m == 1 && n == 1) { - /* no/vacuous quantifier: done */ - EMPTYARC(s, atom->begin); /* empty prefix */ - } else { - /* turn x{m,n} into x{m-1,n-1}x, with capturing */ - /* parens in only second x */ - dupnfa(v->nfa, atom->begin, atom->end, s, atom->begin); - assert(m >= 1 && m != INFINITY && n >= 1); - repeat(v, s, atom->begin, m-1, (n == INFINITY) ? n : n-1); - f = COMBINE(qprefer, atom->flags); - t = subre(v, '.', f, s, atom->end); /* prefix and atom */ - NOERR(); - t->left = subre(v, '=', PREF(f), s, atom->begin); - NOERR(); - t->right = atom; - *atomp = t; - } - - /* and finally, look after that postponed recursion */ - t = top->right; - if (!(SEE('|') || SEE(stopper) || SEE(EOS))) - t->right = parsebranch(v, stopper, type, atom->end, rp, 1); - else { - EMPTYARC(atom->end, rp); - t->right = subre(v, '=', 0, atom->end, rp); - } - assert(SEE('|') || SEE(stopper) || SEE(EOS)); - t->flags |= COMBINE(t->flags, t->right->flags); - top->flags |= COMBINE(top->flags, t->flags); -} - -/* - - nonword - generate arcs for non-word-character ahead or behind - ^ static VOID nonword(struct vars *, int, struct state *, struct state *); - */ -static VOID -nonword(v, dir, lp, rp) -struct vars *v; -int dir; /* AHEAD or BEHIND */ -struct state *lp; -struct state *rp; -{ - int anchor = (dir == AHEAD) ? '$' : '^'; - - assert(dir == AHEAD || dir == BEHIND); - newarc(v->nfa, anchor, 1, lp, rp); - newarc(v->nfa, anchor, 0, lp, rp); - colorcomplement(v->nfa, v->cm, dir, v->wordchrs, lp, rp); - /* (no need for special attention to \n) */ -} - -/* - - word - generate arcs for word character ahead or behind - ^ static VOID word(struct vars *, int, struct state *, struct state *); - */ -static VOID -word(v, dir, lp, rp) -struct vars *v; -int dir; /* AHEAD or BEHIND */ -struct state *lp; -struct state *rp; -{ - assert(dir == AHEAD || dir == BEHIND); - cloneouts(v->nfa, v->wordchrs, lp, rp, dir); - /* (no need for special attention to \n) */ -} - -/* - - scannum - scan a number - ^ static int scannum(struct vars *); - */ -static int /* value, <= DUPMAX */ -scannum(v) -struct vars *v; -{ - int n = 0; - - while (SEE(DIGIT) && n < DUPMAX) { - n = n*10 + v->nextvalue; - NEXT(); - } - if (SEE(DIGIT) || n > DUPMAX) { - ERR(REG_BADBR); - return 0; - } - return n; -} - -/* - - repeat - replicate subNFA for quantifiers - * The duplication sequences used here are chosen carefully so that any - * pointers starting out pointing into the subexpression end up pointing into - * the last occurrence. (Note that it may not be strung between the same - * left and right end states, however!) This used to be important for the - * subRE tree, although the important bits are now handled by the in-line - * code in parse(), and when this is called, it doesn't matter any more. - ^ static VOID repeat(struct vars *, struct state *, struct state *, int, int); - */ -static VOID -repeat(v, lp, rp, m, n) -struct vars *v; -struct state *lp; -struct state *rp; -int m; -int n; -{ -# define SOME 2 -# define INF 3 -# define PAIR(x, y) ((x)*4 + (y)) -# define REDUCE(x) ( ((x) == INFINITY) ? INF : (((x) > 1) ? SOME : (x)) ) - CONST int rm = REDUCE(m); - CONST int rn = REDUCE(n); - struct state *s; - struct state *s2; - - switch (PAIR(rm, rn)) { - case PAIR(0, 0): /* empty string */ - delsub(v->nfa, lp, rp); - EMPTYARC(lp, rp); - break; - case PAIR(0, 1): /* do as x| */ - EMPTYARC(lp, rp); - break; - case PAIR(0, SOME): /* do as x{1,n}| */ - repeat(v, lp, rp, 1, n); - NOERR(); - EMPTYARC(lp, rp); - break; - case PAIR(0, INF): /* loop x around */ - s = newstate(v->nfa); - NOERR(); - moveouts(v->nfa, lp, s); - moveins(v->nfa, rp, s); - EMPTYARC(lp, s); - EMPTYARC(s, rp); - break; - case PAIR(1, 1): /* no action required */ - break; - case PAIR(1, SOME): /* do as x{0,n-1}x = (x{1,n-1}|)x */ - s = newstate(v->nfa); - NOERR(); - moveouts(v->nfa, lp, s); - dupnfa(v->nfa, s, rp, lp, s); - NOERR(); - repeat(v, lp, s, 1, n-1); - NOERR(); - EMPTYARC(lp, s); - break; - case PAIR(1, INF): /* add loopback arc */ - s = newstate(v->nfa); - s2 = newstate(v->nfa); - NOERR(); - moveouts(v->nfa, lp, s); - moveins(v->nfa, rp, s2); - EMPTYARC(lp, s); - EMPTYARC(s2, rp); - EMPTYARC(s2, s); - break; - case PAIR(SOME, SOME): /* do as x{m-1,n-1}x */ - s = newstate(v->nfa); - NOERR(); - moveouts(v->nfa, lp, s); - dupnfa(v->nfa, s, rp, lp, s); - NOERR(); - repeat(v, lp, s, m-1, n-1); - break; - case PAIR(SOME, INF): /* do as x{m-1,}x */ - s = newstate(v->nfa); - NOERR(); - moveouts(v->nfa, lp, s); - dupnfa(v->nfa, s, rp, lp, s); - NOERR(); - repeat(v, lp, s, m-1, n); - break; - default: - ERR(REG_ASSERT); - break; - } -} - -/* - - bracket - handle non-complemented bracket expression - * Also called from cbracket for complemented bracket expressions. - ^ static VOID bracket(struct vars *, struct state *, struct state *); - */ -static VOID -bracket(v, lp, rp) -struct vars *v; -struct state *lp; -struct state *rp; -{ - assert(SEE('[')); - NEXT(); - while (!SEE(']') && !SEE(EOS)) - brackpart(v, lp, rp); - assert(SEE(']') || ISERR()); - okcolors(v->nfa, v->cm); -} - -/* - - cbracket - handle complemented bracket expression - * We do it by calling bracket() with dummy endpoints, and then complementing - * the result. The alternative would be to invoke rainbow(), and then delete - * arcs as the b.e. is seen... but that gets messy. - ^ static VOID cbracket(struct vars *, struct state *, struct state *); - */ -static VOID -cbracket(v, lp, rp) -struct vars *v; -struct state *lp; -struct state *rp; -{ - struct state *left = newstate(v->nfa); - struct state *right = newstate(v->nfa); - struct state *s; - struct arc *a; /* arc from lp */ - struct arc *ba; /* arc from left, from bracket() */ - struct arc *pa; /* MCCE-prototype arc */ - color co; - chr *p; - int i; - - NOERR(); - bracket(v, left, right); - if (v->cflags®_NLSTOP) - newarc(v->nfa, PLAIN, v->nlcolor, left, right); - NOERR(); - - assert(lp->nouts == 0); /* all outarcs will be ours */ - - /* easy part of complementing */ - colorcomplement(v->nfa, v->cm, PLAIN, left, lp, rp); - NOERR(); - if (v->mcces == NULL) { /* no MCCEs -- we're done */ - dropstate(v->nfa, left); - assert(right->nins == 0); - freestate(v->nfa, right); - return; - } - - /* but complementing gets messy in the presence of MCCEs... */ - NOTE(REG_ULOCALE); - for (p = v->mcces->chrs, i = v->mcces->nchrs; i > 0; p++, i--) { - co = GETCOLOR(v->cm, *p); - a = findarc(lp, PLAIN, co); - ba = findarc(left, PLAIN, co); - if (ba == NULL) { - assert(a != NULL); - freearc(v->nfa, a); - } else { - assert(a == NULL); - } - s = newstate(v->nfa); - NOERR(); - newarc(v->nfa, PLAIN, co, lp, s); - NOERR(); - pa = findarc(v->mccepbegin, PLAIN, co); - assert(pa != NULL); - if (ba == NULL) { /* easy case, need all of them */ - cloneouts(v->nfa, pa->to, s, rp, PLAIN); - newarc(v->nfa, '$', 1, s, rp); - newarc(v->nfa, '$', 0, s, rp); - colorcomplement(v->nfa, v->cm, AHEAD, pa->to, s, rp); - } else { /* must be selective */ - if (findarc(ba->to, '$', 1) == NULL) { - newarc(v->nfa, '$', 1, s, rp); - newarc(v->nfa, '$', 0, s, rp); - colorcomplement(v->nfa, v->cm, AHEAD, pa->to, - s, rp); - } - for (pa = pa->to->outs; pa != NULL; pa = pa->outchain) - if (findarc(ba->to, PLAIN, pa->co) == NULL) - newarc(v->nfa, PLAIN, pa->co, s, rp); - if (s->nouts == 0) /* limit of selectivity: none */ - dropstate(v->nfa, s); /* frees arc too */ - } - NOERR(); - } - - delsub(v->nfa, left, right); - assert(left->nouts == 0); - freestate(v->nfa, left); - assert(right->nins == 0); - freestate(v->nfa, right); -} - -/* - - brackpart - handle one item (or range) within a bracket expression - ^ static VOID brackpart(struct vars *, struct state *, struct state *); - */ -static VOID -brackpart(v, lp, rp) -struct vars *v; -struct state *lp; -struct state *rp; -{ - celt startc; - celt endc; - struct cvec *cv; - chr *startp; - chr *endp; - chr c[1]; - - /* parse something, get rid of special cases, take shortcuts */ - switch (v->nexttype) { - case RANGE: /* a-b-c or other botch */ - ERR(REG_ERANGE); - return; - break; - case PLAIN: - c[0] = v->nextvalue; - NEXT(); - /* shortcut for ordinary chr (not range, not MCCE leader) */ - if (!SEE(RANGE) && !ISCELEADER(v, c[0])) { - onechr(v, c[0], lp, rp); - return; - } - startc = element(v, c, c+1); - NOERR(); - break; - case COLLEL: - startp = v->now; - endp = scanplain(v); - INSIST(startp < endp, REG_ECOLLATE); - NOERR(); - startc = element(v, startp, endp); - NOERR(); - break; - case ECLASS: - startp = v->now; - endp = scanplain(v); - INSIST(startp < endp, REG_ECOLLATE); - NOERR(); - startc = element(v, startp, endp); - NOERR(); - cv = eclass(v, startc, (v->cflags®_ICASE)); - NOERR(); - dovec(v, cv, lp, rp); - return; - break; - case CCLASS: - startp = v->now; - endp = scanplain(v); - INSIST(startp < endp, REG_ECTYPE); - NOERR(); - cv = cclass(v, startp, endp, (v->cflags®_ICASE)); - NOERR(); - dovec(v, cv, lp, rp); - return; - break; - default: - ERR(REG_ASSERT); - return; - break; - } - - if (SEE(RANGE)) { - NEXT(); - switch (v->nexttype) { - case PLAIN: - case RANGE: - c[0] = v->nextvalue; - NEXT(); - endc = element(v, c, c+1); - NOERR(); - break; - case COLLEL: - startp = v->now; - endp = scanplain(v); - INSIST(startp < endp, REG_ECOLLATE); - NOERR(); - endc = element(v, startp, endp); - NOERR(); - break; - default: - ERR(REG_ERANGE); - return; - break; - } - } else - endc = startc; - - /* - * Ranges are unportable. Actually, standard C does - * guarantee that digits are contiguous, but making - * that an exception is just too complicated. - */ - if (startc != endc) - NOTE(REG_UUNPORT); - cv = range(v, startc, endc, (v->cflags®_ICASE)); - NOERR(); - dovec(v, cv, lp, rp); -} - -/* - - scanplain - scan PLAIN contents of [. etc. - * Certain bits of trickery in lex.c know that this code does not try - * to look past the final bracket of the [. etc. - ^ static chr *scanplain(struct vars *); - */ -static chr * /* just after end of sequence */ -scanplain(v) -struct vars *v; -{ - chr *endp; - - assert(SEE(COLLEL) || SEE(ECLASS) || SEE(CCLASS)); - NEXT(); - - endp = v->now; - while (SEE(PLAIN)) { - endp = v->now; - NEXT(); - } - - assert(SEE(END) || ISERR()); - NEXT(); - - return endp; -} - -/* - - leaders - process a cvec of collating elements to also include leaders - * Also gives all characters involved their own colors, which is almost - * certainly necessary, and sets up little disconnected subNFA. - ^ static VOID leaders(struct vars *, struct cvec *); - */ -static VOID -leaders(v, cv) -struct vars *v; -struct cvec *cv; -{ - int mcce; - chr *p; - chr leader; - struct state *s; - struct arc *a; - - v->mccepbegin = newstate(v->nfa); - v->mccepend = newstate(v->nfa); - NOERR(); - - for (mcce = 0; mcce < cv->nmcces; mcce++) { - p = cv->mcces[mcce]; - leader = *p; - if (!haschr(cv, leader)) { - addchr(cv, leader); - s = newstate(v->nfa); - newarc(v->nfa, PLAIN, subcolor(v->cm, leader), - v->mccepbegin, s); - okcolors(v->nfa, v->cm); - } else { - a = findarc(v->mccepbegin, PLAIN, - GETCOLOR(v->cm, leader)); - assert(a != NULL); - s = a->to; - assert(s != v->mccepend); - } - p++; - assert(*p != 0 && *(p+1) == 0); /* only 2-char MCCEs for now */ - newarc(v->nfa, PLAIN, subcolor(v->cm, *p), s, v->mccepend); - okcolors(v->nfa, v->cm); - } -} - -/* - - onechr - fill in arcs for a plain character, and possible case complements - * This is mostly a shortcut for efficient handling of the common case. - ^ static VOID onechr(struct vars *, pchr, struct state *, struct state *); - */ -static VOID -onechr(v, c, lp, rp) -struct vars *v; -pchr c; -struct state *lp; -struct state *rp; -{ - if (!(v->cflags®_ICASE)) { - newarc(v->nfa, PLAIN, subcolor(v->cm, c), lp, rp); - return; - } - - /* rats, need general case anyway... */ - dovec(v, allcases(v, c), lp, rp); -} - -/* - - dovec - fill in arcs for each element of a cvec - * This one has to handle the messy cases, like MCCEs and MCCE leaders. - ^ static VOID dovec(struct vars *, struct cvec *, struct state *, - ^ struct state *); - */ -static VOID -dovec(v, cv, lp, rp) -struct vars *v; -struct cvec *cv; -struct state *lp; -struct state *rp; -{ - chr ch, from, to; - celt ce; - chr *p; - int i; - color co; - struct cvec *leads; - struct arc *a; - struct arc *pa; /* arc in prototype */ - struct state *s; - struct state *ps; /* state in prototype */ - - /* need a place to store leaders, if any */ - if (nmcces(v) > 0) { - assert(v->mcces != NULL); - if (v->cv2 == NULL || v->cv2->nchrs < v->mcces->nchrs) { - if (v->cv2 != NULL) - free(v->cv2); - v->cv2 = newcvec(v->mcces->nchrs, 0, v->mcces->nmcces); - NOERR(); - leads = v->cv2; - } else - leads = clearcvec(v->cv2); - } else - leads = NULL; - - /* first, get the ordinary characters out of the way */ - for (p = cv->chrs, i = cv->nchrs; i > 0; p++, i--) { - ch = *p; - if (!ISCELEADER(v, ch)) - newarc(v->nfa, PLAIN, subcolor(v->cm, ch), lp, rp); - else { - assert(singleton(v->cm, ch)); - assert(leads != NULL); - if (!haschr(leads, ch)) - addchr(leads, ch); - } - } - - /* and the ranges */ - for (p = cv->ranges, i = cv->nranges; i > 0; p += 2, i--) { - from = *p; - to = *(p+1); - while (from <= to && (ce = nextleader(v, from, to)) != NOCELT) { - if (from < ce) - subrange(v, from, ce - 1, lp, rp); - assert(singleton(v->cm, ce)); - assert(leads != NULL); - if (!haschr(leads, ce)) - addchr(leads, ce); - from = ce + 1; - } - if (from <= to) - subrange(v, from, to, lp, rp); - } - - if ((leads == NULL || leads->nchrs == 0) && cv->nmcces == 0) - return; - - /* deal with the MCCE leaders */ - NOTE(REG_ULOCALE); - for (p = leads->chrs, i = leads->nchrs; i > 0; p++, i--) { - co = GETCOLOR(v->cm, *p); - a = findarc(lp, PLAIN, co); - if (a != NULL) - s = a->to; - else { - s = newstate(v->nfa); - NOERR(); - newarc(v->nfa, PLAIN, co, lp, s); - NOERR(); - } - pa = findarc(v->mccepbegin, PLAIN, co); - assert(pa != NULL); - ps = pa->to; - newarc(v->nfa, '$', 1, s, rp); - newarc(v->nfa, '$', 0, s, rp); - colorcomplement(v->nfa, v->cm, AHEAD, ps, s, rp); - NOERR(); - } - - /* and the MCCEs */ - for (i = 0; i < cv->nmcces; i++) { - p = cv->mcces[i]; - assert(singleton(v->cm, *p)); - if (!singleton(v->cm, *p)) { - ERR(REG_ASSERT); - return; - } - ch = *p++; - co = GETCOLOR(v->cm, ch); - a = findarc(lp, PLAIN, co); - if (a != NULL) - s = a->to; - else { - s = newstate(v->nfa); - NOERR(); - newarc(v->nfa, PLAIN, co, lp, s); - NOERR(); - } - assert(*p != 0); /* at least two chars */ - assert(singleton(v->cm, *p)); - ch = *p++; - co = GETCOLOR(v->cm, ch); - assert(*p == 0); /* and only two, for now */ - newarc(v->nfa, PLAIN, co, s, rp); - NOERR(); - } -} - -/* - - nextleader - find next MCCE leader within range - ^ static celt nextleader(struct vars *, pchr, pchr); - */ -static celt /* NOCELT means none */ -nextleader(v, from, to) -struct vars *v; -pchr from; -pchr to; -{ - int i; - chr *p; - chr ch; - celt it = NOCELT; - - if (v->mcces == NULL) - return it; - - for (i = v->mcces->nchrs, p = v->mcces->chrs; i > 0; i--, p++) { - ch = *p; - if (from <= ch && ch <= to) - if (it == NOCELT || ch < it) - it = ch; - } - return it; -} - -/* - - wordchrs - set up word-chr list for word-boundary stuff, if needed - * The list is kept as a bunch of arcs between two dummy states; it's - * disposed of by the unreachable-states sweep in NFA optimization. - * Does NEXT(). Must not be called from any unusual lexical context. - * This should be reconciled with the \w etc. handling in lex.c, and - * should be cleaned up to reduce dependencies on input scanning. - ^ static VOID wordchrs(struct vars *); - */ -static VOID -wordchrs(v) -struct vars *v; -{ - struct state *left; - struct state *right; - - if (v->wordchrs != NULL) { - NEXT(); /* for consistency */ - return; - } - - left = newstate(v->nfa); - right = newstate(v->nfa); - NOERR(); - /* fine point: implemented with [::], and lexer will set REG_ULOCALE */ - lexword(v); - NEXT(); - assert(v->savenow != NULL && SEE('[')); - bracket(v, left, right); - assert((v->savenow != NULL && SEE(']')) || ISERR()); - NEXT(); - NOERR(); - v->wordchrs = left; -} - -/* - - subre - allocate a subre - ^ static struct subre *subre(struct vars *, int, int, struct state *, - ^ struct state *); - */ -static struct subre * -subre(v, op, flags, begin, end) -struct vars *v; -int op; -int flags; -struct state *begin; -struct state *end; -{ - struct subre *ret; - - ret = v->treefree; - if (ret != NULL) - v->treefree = ret->left; - else { - ret = (struct subre *)MALLOC(sizeof(struct subre)); - if (ret == NULL) { - ERR(REG_ESPACE); - return NULL; - } - ret->chain = v->treechain; - v->treechain = ret; - } - - assert(strchr("|.b(=", op) != NULL); - - ret->op = op; - ret->flags = flags; - ret->retry = 0; - ret->subno = 0; - ret->min = ret->max = 1; - ret->left = NULL; - ret->right = NULL; - ret->begin = begin; - ret->end = end; - ZAPCNFA(ret->cnfa); - - return ret; -} - -/* - - freesubre - free a subRE subtree - ^ static VOID freesubre(struct vars *, struct subre *); - */ -static VOID -freesubre(v, sr) -struct vars *v; /* might be NULL */ -struct subre *sr; -{ - if (sr == NULL) - return; - - if (sr->left != NULL) - freesubre(v, sr->left); - if (sr->right != NULL) - freesubre(v, sr->right); - - freesrnode(v, sr); -} - -/* - - freesrnode - free one node in a subRE subtree - ^ static VOID freesrnode(struct vars *, struct subre *); - */ -static VOID -freesrnode(v, sr) -struct vars *v; /* might be NULL */ -struct subre *sr; -{ - if (sr == NULL) - return; - - if (!NULLCNFA(sr->cnfa)) - freecnfa(&sr->cnfa); - sr->flags = 0; - - if (v != NULL) { - sr->left = v->treefree; - v->treefree = sr; - } else - FREE(sr); -} - -/* - - optst - optimize a subRE subtree - ^ static VOID optst(struct vars *, struct subre *); - */ -static VOID -optst(v, t) -struct vars *v; -struct subre *t; -{ - if (t == NULL) - return; - - /* recurse through children */ - if (t->left != NULL) - optst(v, t->left); - if (t->right != NULL) - optst(v, t->right); -} - -/* - - numst - number tree nodes (assigning retry indexes) - ^ static int numst(struct subre *, int); - */ -static int /* next number */ -numst(t, start) -struct subre *t; -int start; /* starting point for subtree numbers */ -{ - int i; - - assert(t != NULL); - - i = start; - t->retry = (short)i++; - if (t->left != NULL) - i = numst(t->left, i); - if (t->right != NULL) - i = numst(t->right, i); - return i; -} - -/* - - markst - mark tree nodes as INUSE - ^ static VOID markst(struct subre *); - */ -static VOID -markst(t) -struct subre *t; -{ - assert(t != NULL); - - t->flags |= INUSE; - if (t->left != NULL) - markst(t->left); - if (t->right != NULL) - markst(t->right); -} - -/* - - cleanst - free any tree nodes not marked INUSE - ^ static VOID cleanst(struct vars *); - */ -static VOID -cleanst(v) -struct vars *v; -{ - struct subre *t; - struct subre *next; - - for (t = v->treechain; t != NULL; t = next) { - next = t->chain; - if (!(t->flags&INUSE)) - FREE(t); - } - v->treechain = NULL; - v->treefree = NULL; /* just on general principles */ -} - -/* - - nfatree - turn a subRE subtree into a tree of compacted NFAs - ^ static long nfatree(struct vars *, struct subre *, FILE *); - */ -static long /* optimize results from top node */ -nfatree(v, t, f) -struct vars *v; -struct subre *t; -FILE *f; /* for debug output */ -{ - assert(t != NULL && t->begin != NULL); - - if (t->left != NULL) - (DISCARD)nfatree(v, t->left, f); - if (t->right != NULL) - (DISCARD)nfatree(v, t->right, f); - - return nfanode(v, t, f); -} - -/* - - nfanode - do one NFA for nfatree - ^ static long nfanode(struct vars *, struct subre *, FILE *); - */ -static long /* optimize results */ -nfanode(v, t, f) -struct vars *v; -struct subre *t; -FILE *f; /* for debug output */ -{ - struct nfa *nfa; - long ret = 0; - char idbuf[50]; - - assert(t->begin != NULL); - - if (f != NULL) - fprintf(f, "\n\n\n========= TREE NODE %s ==========\n", - stid(t, idbuf, sizeof(idbuf))); - nfa = newnfa(v, v->cm, v->nfa); - NOERRZ(); - dupnfa(nfa, t->begin, t->end, nfa->init, nfa->final); - if (!ISERR()) { - specialcolors(nfa); - ret = optimize(nfa, f); - } - if (!ISERR()) - compact(nfa, &t->cnfa); - - freenfa(nfa); - return ret; -} - -/* - - newlacon - allocate a lookahead-constraint subRE - ^ static int newlacon(struct vars *, struct state *, struct state *, int); - */ -static int /* lacon number */ -newlacon(v, begin, end, pos) -struct vars *v; -struct state *begin; -struct state *end; -int pos; -{ - int n; - struct subre *sub; - - if (v->nlacons == 0) { - v->lacons = (struct subre *)MALLOC(2 * sizeof(struct subre)); - n = 1; /* skip 0th */ - v->nlacons = 2; - } else { - v->lacons = (struct subre *)REALLOC(v->lacons, - (v->nlacons+1)*sizeof(struct subre)); - n = v->nlacons++; - } - if (v->lacons == NULL) { - ERR(REG_ESPACE); - return 0; - } - sub = &v->lacons[n]; - sub->begin = begin; - sub->end = end; - sub->subno = pos; - ZAPCNFA(sub->cnfa); - return n; -} - -/* - - freelacons - free lookahead-constraint subRE vector - ^ static VOID freelacons(struct subre *, int); - */ -static VOID -freelacons(subs, n) -struct subre *subs; -int n; -{ - struct subre *sub; - int i; - - assert(n > 0); - for (sub = subs + 1, i = n - 1; i > 0; sub++, i--) /* no 0th */ - if (!NULLCNFA(sub->cnfa)) - freecnfa(&sub->cnfa); - FREE(subs); -} - -/* - - rfree - free a whole RE (insides of regfree) - ^ static VOID rfree(regex_t *); - */ -static VOID -rfree(re) -regex_t *re; -{ - struct guts *g; - - if (re == NULL || re->re_magic != REMAGIC) - return; - - re->re_magic = 0; /* invalidate RE */ - g = (struct guts *)re->re_guts; - re->re_guts = NULL; - re->re_fns = NULL; - g->magic = 0; - freecm(&g->cmap); - if (g->tree != NULL) - freesubre((struct vars *)NULL, g->tree); - if (g->lacons != NULL) - freelacons(g->lacons, g->nlacons); - if (!NULLCNFA(g->search)) - freecnfa(&g->search); - FREE(g); -} - -/* - - dump - dump an RE in human-readable form - ^ static VOID dump(regex_t *, FILE *); - */ -static VOID -dump(re, f) -regex_t *re; -FILE *f; -{ -#ifdef REG_DEBUG - struct guts *g; - int i; - - if (re->re_magic != REMAGIC) - fprintf(f, "bad magic number (0x%x not 0x%x)\n", re->re_magic, - REMAGIC); - if (re->re_guts == NULL) { - fprintf(f, "NULL guts!!!\n"); - return; - } - g = (struct guts *)re->re_guts; - if (g->magic != GUTSMAGIC) - fprintf(f, "bad guts magic number (0x%x not 0x%x)\n", g->magic, - GUTSMAGIC); - - fprintf(f, "\n\n\n========= DUMP ==========\n"); - fprintf(f, "nsub %d, info 0%lo, csize %d, ntree %d\n", - re->re_nsub, re->re_info, re->re_csize, g->ntree); - - dumpcolors(&g->cmap, f); - if (!NULLCNFA(g->search)) { - printf("\nsearch:\n"); - dumpcnfa(&g->search, f); - } - for (i = 1; i < g->nlacons; i++) { - fprintf(f, "\nla%d (%s):\n", i, - (g->lacons[i].subno) ? "positive" : "negative"); - dumpcnfa(&g->lacons[i].cnfa, f); - } - fprintf(f, "\n"); - dumpst(g->tree, f, 0); -#endif -} - -/* - - dumpst - dump a subRE tree - ^ static VOID dumpst(struct subre *, FILE *, int); - */ -static VOID -dumpst(t, f, nfapresent) -struct subre *t; -FILE *f; -int nfapresent; /* is the original NFA still around? */ -{ - if (t == NULL) - fprintf(f, "null tree\n"); - else - stdump(t, f, nfapresent); - fflush(f); -} - -/* - - stdump - recursive guts of dumpst - ^ static VOID stdump(struct subre *, FILE *, int); - */ -static VOID -stdump(t, f, nfapresent) -struct subre *t; -FILE *f; -int nfapresent; /* is the original NFA still around? */ -{ - char idbuf[50]; - - fprintf(f, "%s. `%c'", stid(t, idbuf, sizeof(idbuf)), t->op); - if (t->flags&LONGER) - fprintf(f, " longest"); - if (t->flags&SHORTER) - fprintf(f, " shortest"); - if (t->flags&MIXED) - fprintf(f, " hasmixed"); - if (t->flags&CAP) - fprintf(f, " hascapture"); - if (t->flags&BACKR) - fprintf(f, " hasbackref"); - if (!(t->flags&INUSE)) - fprintf(f, " UNUSED"); - if (t->subno != 0) - fprintf(f, " (#%d)", t->subno); - if (t->min != 1 || t->max != 1) { - fprintf(f, " {%d,", t->min); - if (t->max != INFINITY) - fprintf(f, "%d", t->max); - fprintf(f, "}"); - } - if (nfapresent) - fprintf(f, " %ld-%ld", (long)t->begin->no, (long)t->end->no); - if (t->left != NULL) - fprintf(f, " L:%s", stid(t->left, idbuf, sizeof(idbuf))); - if (t->right != NULL) - fprintf(f, " R:%s", stid(t->right, idbuf, sizeof(idbuf))); - if (!NULLCNFA(t->cnfa)) { - fprintf(f, "\n"); - dumpcnfa(&t->cnfa, f); - fprintf(f, "\n"); - } - if (t->left != NULL) - stdump(t->left, f, nfapresent); - if (t->right != NULL) - stdump(t->right, f, nfapresent); -} - -/* - - stid - identify a subtree node for dumping - ^ static char *stid(struct subre *, char *, size_t); - */ -static char * /* points to buf or constant string */ -stid(t, buf, bufsize) -struct subre *t; -char *buf; -size_t bufsize; -{ - /* big enough for hex int or decimal t->retry? */ - if (bufsize < sizeof(int)*2 + 3 || bufsize < sizeof(t->retry)*3 + 1) - return "unable"; - if (t->retry != 0) - sprintf(buf, "%d", t->retry); - else - sprintf(buf, "0x%x", (int)(wxUIntPtr)(t)); /* may lose bits, that's okay */ - return buf; -} - -#include "regc_lex.c" -#include "regc_color.c" -#include "regc_nfa.c" -#include "regc_cvec.c" -#include "regc_locale.c" diff --git a/wxWidgets/src/regex/regcustom.h b/wxWidgets/src/regex/regcustom.h deleted file mode 100644 index cd77bf6dbe..0000000000 --- a/wxWidgets/src/regex/regcustom.h +++ /dev/null @@ -1,126 +0,0 @@ -/* - * Copyright (c) 1998, 1999 Henry Spencer. All rights reserved. - * - * Development of this software was funded, in part, by Cray Research Inc., - * UUNET Communications Services Inc., Sun Microsystems Inc., and Scriptics - * Corporation, none of whom are responsible for the results. The author - * thanks all of them. - * - * Redistribution and use in source and binary forms -- with or without - * modification -- are permitted for any purpose, provided that - * redistributions in source form retain this entire copyright notice and - * indicate the origin and nature of any modifications. - * - * I'd appreciate being given credit for this package in the documentation - * of software which uses it, but that is not a requirement. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL - * HENRY SPENCER BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; - * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -/* overrides for regguts.h definitions, if any */ -/* regguts only includes standard headers if NULL is not defined, so do it - * ourselves here */ -#include -#include -#include -#include -#include - -/* must include this after ctype.h inclusion for CodeWarrior/Mac */ -#include "wx/defs.h" -#include "wx/wxchar.h" - -/* - * Do not insert extras between the "begin" and "end" lines -- this - * chunk is automatically extracted to be fitted into regex.h. - */ -/* --- begin --- */ -/* ensure certain things don't sneak in from system headers */ -#ifdef __REG_WIDE_T -#undef __REG_WIDE_T -#endif -#ifdef __REG_WIDE_COMPILE -#undef __REG_WIDE_COMPILE -#endif -#ifdef __REG_WIDE_EXEC -#undef __REG_WIDE_EXEC -#endif -#ifdef __REG_REGOFF_T -#undef __REG_REGOFF_T -#endif -#ifdef __REG_VOID_T -#undef __REG_VOID_T -#endif -#ifdef __REG_CONST -#undef __REG_CONST -#endif -#ifdef __REG_NOFRONT -#undef __REG_NOFRONT -#endif -#ifdef __REG_NOCHAR -#undef __REG_NOCHAR -#endif -#if wxUSE_UNICODE -# define __REG_WIDE_T wxChar -# define __REG_WIDE_COMPILE wx_re_comp -# define __REG_WIDE_EXEC wx_re_exec -# define __REG_NOCHAR /* don't want the char versions */ -#endif -#define __REG_NOFRONT /* don't want regcomp() and regexec() */ -#define _ANSI_ARGS_(x) x -/* --- end --- */ - -/* internal character type and related */ -typedef wxChar chr; /* the type itself */ -typedef int pchr; /* what it promotes to */ -typedef unsigned uchr; /* unsigned type that will hold a chr */ -typedef int celt; /* type to hold chr, MCCE number, or NOCELT */ -#define NOCELT (-1) /* celt value which is not valid chr or MCCE */ -#define UCHAR(c) ((unsigned char) (c)) -#define CHR(c) (UCHAR(c)) /* turn char literal into chr literal */ -#define DIGITVAL(c) ((c)-'0') /* turn chr digit into its value */ -#if !wxUSE_UNICODE -# define CHRBITS 8 /* bits in a chr; must not use sizeof */ -# define CHR_MIN 0x00 /* smallest and largest chr; the value */ -# define CHR_MAX 0xff /* CHR_MAX-CHR_MIN+1 should fit in uchr */ -#elif SIZEOF_WCHAR_T == 4 -# define CHRBITS 32 /* bits in a chr; must not use sizeof */ -# define CHR_MIN 0x00000000 /* smallest and largest chr; the value */ -# define CHR_MAX 0xffffffff /* CHR_MAX-CHR_MIN+1 should fit in uchr */ -#else -# define CHRBITS 16 /* bits in a chr; must not use sizeof */ -# define CHR_MIN 0x0000 /* smallest and largest chr; the value */ -# define CHR_MAX 0xffff /* CHR_MAX-CHR_MIN+1 should fit in uchr */ -#endif - -/* - * I'm using isalpha et al. instead of wxIsalpha since BCC 5.5's iswalpha - * seems not to work on Windows 9x? Note that these are only used by the - * lexer, and although they must work for wxChars, they need only return - * true for characters within the ascii range. - */ -#define iscalnum(x) ((wxUChar)(x) < 128 && isalnum(x)) -#define iscalpha(x) ((wxUChar)(x) < 128 && isalpha(x)) -#define iscdigit(x) ((wxUChar)(x) < 128 && isdigit(x)) -#define iscspace(x) ((wxUChar)(x) < 128 && isspace(x)) - -/* name the external functions */ -#define compile wx_re_comp -#define exec wx_re_exec - -/* enable/disable debugging code (by whether REG_DEBUG is defined or not) */ -#if 0 /* no debug unless requested by makefile */ -#define REG_DEBUG /* */ -#endif - -/* and pick up the standard header */ -#include "regex.h" diff --git a/wxWidgets/src/regex/rege_dfa.c b/wxWidgets/src/regex/rege_dfa.c deleted file mode 100644 index 843c5d31b2..0000000000 --- a/wxWidgets/src/regex/rege_dfa.c +++ /dev/null @@ -1,683 +0,0 @@ -/* - * DFA routines - * This file is #included by regexec.c. - * - * Copyright (c) 1998, 1999 Henry Spencer. All rights reserved. - * - * Development of this software was funded, in part, by Cray Research Inc., - * UUNET Communications Services Inc., Sun Microsystems Inc., and Scriptics - * Corporation, none of whom are responsible for the results. The author - * thanks all of them. - * - * Redistribution and use in source and binary forms -- with or without - * modification -- are permitted for any purpose, provided that - * redistributions in source form retain this entire copyright notice and - * indicate the origin and nature of any modifications. - * - * I'd appreciate being given credit for this package in the documentation - * of software which uses it, but that is not a requirement. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL - * HENRY SPENCER BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; - * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -/* - - longest - longest-preferred matching engine - ^ static chr *longest(struct vars *, struct dfa *, chr *, chr *, int *); - */ -static chr * /* endpoint, or NULL */ -longest(v, d, start, stop, hitstopp) -struct vars *v; /* used only for debug and exec flags */ -struct dfa *d; -chr *start; /* where the match should start */ -chr *stop; /* match must end at or before here */ -int *hitstopp; /* record whether hit v->stop, if non-NULL */ -{ - chr *cp; - chr *realstop = (stop == v->stop) ? stop : stop + 1; - color co; - struct sset *css; - struct sset *ss; - chr *post; - int i; - struct colormap *cm = d->cm; - - /* initialize */ - css = initialize(v, d, start); - cp = start; - if (hitstopp != NULL) - *hitstopp = 0; - - /* startup */ - FDEBUG(("+++ startup +++\n")); - if (cp == v->start) { - co = d->cnfa->bos[(v->eflags®_NOTBOL) ? 0 : 1]; - FDEBUG(("color %ld\n", (long)co)); - } else { - co = GETCOLOR(cm, *(cp - 1)); - FDEBUG(("char %c, color %ld\n", (char)*(cp-1), (long)co)); - } - css = miss(v, d, css, co, cp, start); - if (css == NULL) - return NULL; - css->lastseen = cp; - - /* main loop */ - if (v->eflags®_FTRACE) - while (cp < realstop) { - FDEBUG(("+++ at c%d +++\n", css - d->ssets)); - co = GETCOLOR(cm, *cp); - FDEBUG(("char %c, color %ld\n", (char)*cp, (long)co)); - ss = css->outs[co]; - if (ss == NULL) { - ss = miss(v, d, css, co, cp+1, start); - if (ss == NULL) - break; /* NOTE BREAK OUT */ - } - cp++; - ss->lastseen = cp; - css = ss; - } - else - while (cp < realstop) { - co = GETCOLOR(cm, *cp); - ss = css->outs[co]; - if (ss == NULL) { - ss = miss(v, d, css, co, cp+1, start); - if (ss == NULL) - break; /* NOTE BREAK OUT */ - } - cp++; - ss->lastseen = cp; - css = ss; - } - - /* shutdown */ - FDEBUG(("+++ shutdown at c%d +++\n", css - d->ssets)); - if (cp == v->stop && stop == v->stop) { - if (hitstopp != NULL) - *hitstopp = 1; - co = d->cnfa->eos[(v->eflags®_NOTEOL) ? 0 : 1]; - FDEBUG(("color %ld\n", (long)co)); - ss = miss(v, d, css, co, cp, start); - /* special case: match ended at eol? */ - if (ss != NULL && (ss->flags&POSTSTATE)) - return cp; - else if (ss != NULL) - ss->lastseen = cp; /* to be tidy */ - } - - /* find last match, if any */ - post = d->lastpost; - for (ss = d->ssets, i = d->nssused; i > 0; ss++, i--) - if ((ss->flags&POSTSTATE) && post != ss->lastseen && - (post == NULL || post < ss->lastseen)) - post = ss->lastseen; - if (post != NULL) /* found one */ - return post - 1; - - return NULL; -} - -/* - - shortest - shortest-preferred matching engine - ^ static chr *shortest(struct vars *, struct dfa *, chr *, chr *, chr *, - ^ chr **, int *); - */ -static chr * /* endpoint, or NULL */ -shortest(v, d, start, min, max, coldp, hitstopp) -struct vars *v; -struct dfa *d; -chr *start; /* where the match should start */ -chr *min; /* match must end at or after here */ -chr *max; /* match must end at or before here */ -chr **coldp; /* store coldstart pointer here, if nonNULL */ -int *hitstopp; /* record whether hit v->stop, if non-NULL */ -{ - chr *cp; - chr *realmin = (min == v->stop) ? min : min + 1; - chr *realmax = (max == v->stop) ? max : max + 1; - color co; - struct sset *css; - struct sset *ss; - struct colormap *cm = d->cm; - - /* initialize */ - css = initialize(v, d, start); - cp = start; - if (hitstopp != NULL) - *hitstopp = 0; - - /* startup */ - FDEBUG(("--- startup ---\n")); - if (cp == v->start) { - co = d->cnfa->bos[(v->eflags®_NOTBOL) ? 0 : 1]; - FDEBUG(("color %ld\n", (long)co)); - } else { - co = GETCOLOR(cm, *(cp - 1)); - FDEBUG(("char %c, color %ld\n", (char)*(cp-1), (long)co)); - } - css = miss(v, d, css, co, cp, start); - if (css == NULL) - return NULL; - css->lastseen = cp; - ss = css; - - /* main loop */ - if (v->eflags®_FTRACE) - while (cp < realmax) { - FDEBUG(("--- at c%d ---\n", css - d->ssets)); - co = GETCOLOR(cm, *cp); - FDEBUG(("char %c, color %ld\n", (char)*cp, (long)co)); - ss = css->outs[co]; - if (ss == NULL) { - ss = miss(v, d, css, co, cp+1, start); - if (ss == NULL) - break; /* NOTE BREAK OUT */ - } - cp++; - ss->lastseen = cp; - css = ss; - if ((ss->flags&POSTSTATE) && cp >= realmin) - break; /* NOTE BREAK OUT */ - } - else - while (cp < realmax) { - co = GETCOLOR(cm, *cp); - ss = css->outs[co]; - if (ss == NULL) { - ss = miss(v, d, css, co, cp+1, start); - if (ss == NULL) - break; /* NOTE BREAK OUT */ - } - cp++; - ss->lastseen = cp; - css = ss; - if ((ss->flags&POSTSTATE) && cp >= realmin) - break; /* NOTE BREAK OUT */ - } - - if (ss == NULL) - return NULL; - - if (coldp != NULL) /* report last no-progress state set, if any */ - *coldp = lastcold(v, d); - - if ((ss->flags&POSTSTATE) && cp > min) { - assert(cp >= realmin); - cp--; - } else if (cp == v->stop && max == v->stop) { - co = d->cnfa->eos[(v->eflags®_NOTEOL) ? 0 : 1]; - FDEBUG(("color %ld\n", (long)co)); - ss = miss(v, d, css, co, cp, start); - /* match might have ended at eol */ - if ((ss == NULL || !(ss->flags&POSTSTATE)) && hitstopp != NULL) - *hitstopp = 1; - } - - if (ss == NULL || !(ss->flags&POSTSTATE)) - return NULL; - - return cp; -} - -/* - - lastcold - determine last point at which no progress had been made - ^ static chr *lastcold(struct vars *, struct dfa *); - */ -static chr * /* endpoint, or NULL */ -lastcold(v, d) -struct vars *v; -struct dfa *d; -{ - struct sset *ss; - chr *nopr; - int i; - - nopr = d->lastnopr; - if (nopr == NULL) - nopr = v->start; - for (ss = d->ssets, i = d->nssused; i > 0; ss++, i--) - if ((ss->flags&NOPROGRESS) && nopr < ss->lastseen) - nopr = ss->lastseen; - return nopr; -} - -/* - - newdfa - set up a fresh DFA - ^ static struct dfa *newdfa(struct vars *, struct cnfa *, - ^ struct colormap *, struct smalldfa *); - */ - -/* FIXME Required for CW 8 on Mac since it's not in limits.h */ -#ifndef __CHAR_BIT__ -#define __CHAR_BIT__ 8 -#endif - -static struct dfa * -newdfa(v, cnfa, cm, small) -struct vars *v; -struct cnfa *cnfa; -struct colormap *cm; -struct smalldfa *small; /* preallocated space, may be NULL */ -{ - struct dfa *d; - size_t nss = cnfa->nstates * 2; - int wordsper = (cnfa->nstates + UBITS - 1) / UBITS; - struct smalldfa *smallwas = small; - - assert(cnfa != NULL && cnfa->nstates != 0); - - if (nss <= FEWSTATES && cnfa->ncolors <= FEWCOLORS) { - assert(wordsper == 1); - if (small == NULL) { - small = (struct smalldfa *)MALLOC( - sizeof(struct smalldfa)); - if (small == NULL) { - ERR(REG_ESPACE); - return NULL; - } - } - d = &small->dfa; - d->ssets = small->ssets; - d->statesarea = small->statesarea; - d->work = &d->statesarea[nss]; - d->outsarea = small->outsarea; - d->incarea = small->incarea; - d->cptsmalloced = 0; - d->mallocarea = (smallwas == NULL) ? (char *)small : NULL; - } else { - d = (struct dfa *)MALLOC(sizeof(struct dfa)); - if (d == NULL) { - ERR(REG_ESPACE); - return NULL; - } - d->ssets = (struct sset *)MALLOC(nss * sizeof(struct sset)); - d->statesarea = (unsigned *)MALLOC((nss+WORK) * wordsper * - sizeof(unsigned)); - d->work = &d->statesarea[nss * wordsper]; - d->outsarea = (struct sset **)MALLOC(nss * cnfa->ncolors * - sizeof(struct sset *)); - d->incarea = (struct arcp *)MALLOC(nss * cnfa->ncolors * - sizeof(struct arcp)); - d->cptsmalloced = 1; - d->mallocarea = (char *)d; - if (d->ssets == NULL || d->statesarea == NULL || - d->outsarea == NULL || d->incarea == NULL) { - freedfa(d); - ERR(REG_ESPACE); - return NULL; - } - } - - d->nssets = (v->eflags®_SMALL) ? 7 : nss; - d->nssused = 0; - d->nstates = cnfa->nstates; - d->ncolors = cnfa->ncolors; - d->wordsper = wordsper; - d->cnfa = cnfa; - d->cm = cm; - d->lastpost = NULL; - d->lastnopr = NULL; - d->search = d->ssets; - - /* initialization of sset fields is done as needed */ - - return d; -} - -/* - - freedfa - free a DFA - ^ static VOID freedfa(struct dfa *); - */ -static VOID -freedfa(d) -struct dfa *d; -{ - if (d->cptsmalloced) { - if (d->ssets != NULL) - FREE(d->ssets); - if (d->statesarea != NULL) - FREE(d->statesarea); - if (d->outsarea != NULL) - FREE(d->outsarea); - if (d->incarea != NULL) - FREE(d->incarea); - } - - if (d->mallocarea != NULL) - FREE(d->mallocarea); -} - -/* - - hash - construct a hash code for a bitvector - * There are probably better ways, but they're more expensive. - ^ static unsigned hash(unsigned *, int); - */ -static unsigned -hash(uv, n) -unsigned *uv; -int n; -{ - int i; - unsigned h; - - h = 0; - for (i = 0; i < n; i++) - h ^= uv[i]; - return h; -} - -/* - - initialize - hand-craft a cache entry for startup, otherwise get ready - ^ static struct sset *initialize(struct vars *, struct dfa *, chr *); - */ -static struct sset * -initialize(v, d, start) -struct vars *v; /* used only for debug flags */ -struct dfa *d; -chr *start; -{ - struct sset *ss; - int i; - - /* is previous one still there? */ - if (d->nssused > 0 && (d->ssets[0].flags&STARTER)) - ss = &d->ssets[0]; - else { /* no, must (re)build it */ - ss = getvacant(v, d, start, start); - for (i = 0; i < d->wordsper; i++) - ss->states[i] = 0; - BSET(ss->states, d->cnfa->pre); - ss->hash = HASH(ss->states, d->wordsper); - assert(d->cnfa->pre != d->cnfa->post); - ss->flags = STARTER|LOCKED|NOPROGRESS; - /* lastseen dealt with below */ - } - - for (i = 0; i < d->nssused; i++) - d->ssets[i].lastseen = NULL; - ss->lastseen = start; /* maybe untrue, but harmless */ - d->lastpost = NULL; - d->lastnopr = NULL; - return ss; -} - -/* - - miss - handle a cache miss - ^ static struct sset *miss(struct vars *, struct dfa *, struct sset *, - ^ pcolor, chr *, chr *); - */ -static struct sset * /* NULL if goes to empty set */ -miss(v, d, css, co, cp, start) -struct vars *v; /* used only for debug flags */ -struct dfa *d; -struct sset *css; -pcolor co; -chr *cp; /* next chr */ -chr *start; /* where the attempt got started */ -{ - struct cnfa *cnfa = d->cnfa; - int i; - unsigned h; - struct carc *ca; - struct sset *p; - int ispost; - int noprogress; - int gotstate; - int dolacons; - int sawlacons; - - /* for convenience, we can be called even if it might not be a miss */ - if (css->outs[co] != NULL) { - FDEBUG(("hit\n")); - return css->outs[co]; - } - FDEBUG(("miss\n")); - - /* first, what set of states would we end up in? */ - for (i = 0; i < d->wordsper; i++) - d->work[i] = 0; - ispost = 0; - noprogress = 1; - gotstate = 0; - for (i = 0; i < d->nstates; i++) - if (ISBSET(css->states, i)) - for (ca = cnfa->states[i]+1; ca->co != COLORLESS; ca++) - if (ca->co == co) { - BSET(d->work, ca->to); - gotstate = 1; - if (ca->to == cnfa->post) - ispost = 1; - if (!cnfa->states[ca->to]->co) - noprogress = 0; - FDEBUG(("%d -> %d\n", i, ca->to)); - } - dolacons = (gotstate) ? (cnfa->flags&HASLACONS) : 0; - sawlacons = 0; - while (dolacons) { /* transitive closure */ - dolacons = 0; - for (i = 0; i < d->nstates; i++) - if (ISBSET(d->work, i)) - for (ca = cnfa->states[i]+1; ca->co != COLORLESS; - ca++) { - if (ca->co <= cnfa->ncolors) - continue; /* NOTE CONTINUE */ - sawlacons = 1; - if (ISBSET(d->work, ca->to)) - continue; /* NOTE CONTINUE */ - if (!lacon(v, cnfa, cp, ca->co)) - continue; /* NOTE CONTINUE */ - BSET(d->work, ca->to); - dolacons = 1; - if (ca->to == cnfa->post) - ispost = 1; - if (!cnfa->states[ca->to]->co) - noprogress = 0; - FDEBUG(("%d :> %d\n", i, ca->to)); - } - } - if (!gotstate) - return NULL; - h = HASH(d->work, d->wordsper); - - /* next, is that in the cache? */ - for (p = d->ssets, i = d->nssused; i > 0; p++, i--) - if (HIT(h, d->work, p, d->wordsper)) { - FDEBUG(("cached c%d\n", p - d->ssets)); - break; /* NOTE BREAK OUT */ - } - if (i == 0) { /* nope, need a new cache entry */ - p = getvacant(v, d, cp, start); - assert(p != css); - for (i = 0; i < d->wordsper; i++) - p->states[i] = d->work[i]; - p->hash = h; - p->flags = (ispost) ? POSTSTATE : 0; - if (noprogress) - p->flags |= NOPROGRESS; - /* lastseen to be dealt with by caller */ - } - - if (!sawlacons) { /* lookahead conds. always cache miss */ - FDEBUG(("c%d[%d]->c%d\n", css - d->ssets, co, p - d->ssets)); - css->outs[co] = p; - css->inchain[co] = p->ins; - p->ins.ss = css; - p->ins.co = (color)co; - } - return p; -} - -/* - - lacon - lookahead-constraint checker for miss() - ^ static int lacon(struct vars *, struct cnfa *, chr *, pcolor); - */ -static int /* predicate: constraint satisfied? */ -lacon(v, pcnfa, cp, co) -struct vars *v; -struct cnfa *pcnfa; /* parent cnfa */ -chr *cp; -pcolor co; /* "color" of the lookahead constraint */ -{ - int n; - struct subre *sub; - struct dfa *d; - struct smalldfa sd; - chr *end; - - n = co - pcnfa->ncolors; - assert(n < v->g->nlacons && v->g->lacons != NULL); - FDEBUG(("=== testing lacon %d\n", n)); - sub = &v->g->lacons[n]; - d = newdfa(v, &sub->cnfa, &v->g->cmap, &sd); - if (d == NULL) { - ERR(REG_ESPACE); - return 0; - } - end = longest(v, d, cp, v->stop, (int *)NULL); - freedfa(d); - FDEBUG(("=== lacon %d match %d\n", n, (end != NULL))); - return (sub->subno) ? (end != NULL) : (end == NULL); -} - -/* - - getvacant - get a vacant state set - * This routine clears out the inarcs and outarcs, but does not otherwise - * clear the innards of the state set -- that's up to the caller. - ^ static struct sset *getvacant(struct vars *, struct dfa *, chr *, chr *); - */ -static struct sset * -getvacant(v, d, cp, start) -struct vars *v; /* used only for debug flags */ -struct dfa *d; -chr *cp; -chr *start; -{ - int i; - struct sset *ss; - struct sset *p; - struct arcp ap; - struct arcp lastap; - color co; - - ss = pickss(v, d, cp, start); - assert(!(ss->flags&LOCKED)); - - /* clear out its inarcs, including self-referential ones */ - ap = ss->ins; - while ((p = ap.ss) != NULL) { - co = ap.co; - FDEBUG(("zapping c%d's %ld outarc\n", p - d->ssets, (long)co)); - p->outs[co] = NULL; - ap = p->inchain[co]; - p->inchain[co].ss = NULL; /* paranoia */ - } - ss->ins.ss = NULL; - - /* take it off the inarc chains of the ssets reached by its outarcs */ - for (i = 0; i < d->ncolors; i++) { - p = ss->outs[i]; - assert(p != ss); /* not self-referential */ - if (p == NULL) - continue; /* NOTE CONTINUE */ - FDEBUG(("del outarc %d from c%d's in chn\n", i, p - d->ssets)); - if (p->ins.ss == ss && p->ins.co == i) - p->ins = ss->inchain[i]; - else { - assert(p->ins.ss != NULL); - for (ap = p->ins; ap.ss != NULL && - !(ap.ss == ss && ap.co == i); - ap = ap.ss->inchain[ap.co]) - lastap = ap; - assert(ap.ss != NULL); - lastap.ss->inchain[lastap.co] = ss->inchain[i]; - } - ss->outs[i] = NULL; - ss->inchain[i].ss = NULL; - } - - /* if ss was a success state, may need to remember location */ - if ((ss->flags&POSTSTATE) && ss->lastseen != d->lastpost && - (d->lastpost == NULL || d->lastpost < ss->lastseen)) - d->lastpost = ss->lastseen; - - /* likewise for a no-progress state */ - if ((ss->flags&NOPROGRESS) && ss->lastseen != d->lastnopr && - (d->lastnopr == NULL || d->lastnopr < ss->lastseen)) - d->lastnopr = ss->lastseen; - - return ss; -} - -/* - - pickss - pick the next stateset to be used - ^ static struct sset *pickss(struct vars *, struct dfa *, chr *, chr *); - */ -static struct sset * -pickss(v, d, cp, start) -struct vars *v; /* used only for debug flags */ -struct dfa *d; -chr *cp; -chr *start; -{ - int i; - struct sset *ss; - struct sset *end; - chr *ancient; - - /* shortcut for cases where cache isn't full */ - if (d->nssused < d->nssets) { - i = d->nssused; - d->nssused++; - ss = &d->ssets[i]; - FDEBUG(("new c%d\n", i)); - /* set up innards */ - ss->states = &d->statesarea[i * d->wordsper]; - ss->flags = 0; - ss->ins.ss = NULL; - ss->ins.co = WHITE; /* give it some value */ - ss->outs = &d->outsarea[i * d->ncolors]; - ss->inchain = &d->incarea[i * d->ncolors]; - for (i = 0; i < d->ncolors; i++) { - ss->outs[i] = NULL; - ss->inchain[i].ss = NULL; - } - return ss; - } - - /* look for oldest, or old enough anyway */ - if (cp - start > d->nssets*2/3) /* oldest 33% are expendable */ - ancient = cp - d->nssets*2/3; - else - ancient = start; - for (ss = d->search, end = &d->ssets[d->nssets]; ss < end; ss++) - if ((ss->lastseen == NULL || ss->lastseen < ancient) && - !(ss->flags&LOCKED)) { - d->search = ss + 1; - FDEBUG(("replacing c%d\n", ss - d->ssets)); - return ss; - } - for (ss = d->ssets, end = d->search; ss < end; ss++) - if ((ss->lastseen == NULL || ss->lastseen < ancient) && - !(ss->flags&LOCKED)) { - d->search = ss + 1; - FDEBUG(("replacing c%d\n", ss - d->ssets)); - return ss; - } - - /* nobody's old enough?!? -- something's really wrong */ - FDEBUG(("can't find victim to replace!\n")); - assert(NOTREACHED); - ERR(REG_ASSERT); - return d->ssets; -} diff --git a/wxWidgets/src/regex/regerror.c b/wxWidgets/src/regex/regerror.c deleted file mode 100644 index 7646ba2fb6..0000000000 --- a/wxWidgets/src/regex/regerror.c +++ /dev/null @@ -1,109 +0,0 @@ -/* - * regerror - error-code expansion - * - * Copyright (c) 1998, 1999 Henry Spencer. All rights reserved. - * - * Development of this software was funded, in part, by Cray Research Inc., - * UUNET Communications Services Inc., Sun Microsystems Inc., and Scriptics - * Corporation, none of whom are responsible for the results. The author - * thanks all of them. - * - * Redistribution and use in source and binary forms -- with or without - * modification -- are permitted for any purpose, provided that - * redistributions in source form retain this entire copyright notice and - * indicate the origin and nature of any modifications. - * - * I'd appreciate being given credit for this package in the documentation - * of software which uses it, but that is not a requirement. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL - * HENRY SPENCER BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; - * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "regguts.h" - -/* unknown-error explanation */ -static char unk[] = "*** unknown regex error code 0x%x ***"; - -/* struct to map among codes, code names, and explanations */ -static struct rerr { - int code; - char *name; - char *explain; -} rerrs[] = { - /* the actual table is built from regex.h */ -# include "regerrs.h" - { -1, "", "oops" }, /* explanation special-cased in code */ -}; - -/* - - regerror - the interface to error numbers - */ -/* ARGSUSED */ -size_t /* actual space needed (including NUL) */ -wx_regerror(rxerrcode, preg, errbuf, errbuf_size) -int rxerrcode; /* error code, or REG_ATOI or REG_ITOA */ -CONST regex_t *preg; /* associated regex_t (unused at present) */ -char *errbuf; /* result buffer (unless errbuf_size==0) */ -size_t errbuf_size; /* available space in errbuf, can be 0 */ -{ - struct rerr *r; - char *msg; - char convbuf[sizeof(unk)+50]; /* 50 = plenty for int */ - size_t len; - int icode; - - switch (rxerrcode) { - case REG_ATOI: /* convert name to number */ - for (r = rerrs; r->code >= 0; r++) - if (strcmp(r->name, errbuf) == 0) - break; - sprintf(convbuf, "%d", r->code); /* -1 for unknown */ - msg = convbuf; - break; - case REG_ITOA: /* convert number to name */ - icode = atoi(errbuf); /* not our problem if this fails */ - for (r = rerrs; r->code >= 0; r++) - if (r->code == icode) - break; - if (r->code >= 0) - msg = r->name; - else { /* unknown; tell him the number */ - sprintf(convbuf, "REG_%u", (unsigned)icode); - msg = convbuf; - } - break; - default: /* a real, normal error code */ - for (r = rerrs; r->code >= 0; r++) - if (r->code == rxerrcode) - break; - if (r->code >= 0) - msg = r->explain; - else { /* unknown; say so */ - sprintf(convbuf, unk, rxerrcode); - msg = convbuf; - } - break; - } - - len = strlen(msg) + 1; /* space needed, including NUL */ - if (errbuf_size > 0) { - if (errbuf_size > len) - strcpy(errbuf, msg); - else { /* truncate to fit */ - strncpy(errbuf, msg, errbuf_size-1); - errbuf[errbuf_size-1] = '\0'; - } - } - - return len; -} diff --git a/wxWidgets/src/regex/regerrs.h b/wxWidgets/src/regex/regerrs.h deleted file mode 100644 index a3d98b6818..0000000000 --- a/wxWidgets/src/regex/regerrs.h +++ /dev/null @@ -1,18 +0,0 @@ -{ REG_OKAY, "REG_OKAY", "no errors detected" }, -{ REG_NOMATCH, "REG_NOMATCH", "failed to match" }, -{ REG_BADPAT, "REG_BADPAT", "invalid regexp (reg version 0.8)" }, -{ REG_ECOLLATE, "REG_ECOLLATE", "invalid collating element" }, -{ REG_ECTYPE, "REG_ECTYPE", "invalid character class" }, -{ REG_EESCAPE, "REG_EESCAPE", "invalid escape \\ sequence" }, -{ REG_ESUBREG, "REG_ESUBREG", "invalid backreference number" }, -{ REG_EBRACK, "REG_EBRACK", "brackets [] not balanced" }, -{ REG_EPAREN, "REG_EPAREN", "parentheses () not balanced" }, -{ REG_EBRACE, "REG_EBRACE", "braces {} not balanced" }, -{ REG_BADBR, "REG_BADBR", "invalid repetition count(s)" }, -{ REG_ERANGE, "REG_ERANGE", "invalid character range" }, -{ REG_ESPACE, "REG_ESPACE", "out of memory" }, -{ REG_BADRPT, "REG_BADRPT", "quantifier operand invalid" }, -{ REG_ASSERT, "REG_ASSERT", "\"can't happen\" -- you found a bug" }, -{ REG_INVARG, "REG_INVARG", "invalid argument to regex function" }, -{ REG_MIXED, "REG_MIXED", "character widths of regex and string differ" }, -{ REG_BADOPT, "REG_BADOPT", "invalid embedded option" }, diff --git a/wxWidgets/src/regex/regex.dsp b/wxWidgets/src/regex/regex.dsp deleted file mode 100644 index 6a0fd60b40..0000000000 --- a/wxWidgets/src/regex/regex.dsp +++ /dev/null @@ -1,378 +0,0 @@ -# Microsoft Developer Studio Project File - Name="regex" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Static Library" 0x0104 - -CFG=regex - 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 "regex.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 "regex.mak" CFG="regex - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "regex - Win32 Release" (based on "Win32 (x86) Static Library") -!MESSAGE "regex - Win32 Debug" (based on "Win32 (x86) Static Library") -!MESSAGE "regex - Win32 Release DLL" (based on "Win32 (x86) Static Library") -!MESSAGE "regex - Win32 Debug DLL" (based on "Win32 (x86) Static Library") -!MESSAGE "regex - Win32 Release Unicode" (based on "Win32 (x86) Static Library") -!MESSAGE "regex - Win32 Debug Unicode" (based on "Win32 (x86) Static Library") -!MESSAGE "regex - Win32 Release With Debug Info" (based on "Win32 (x86) Static Library") -!MESSAGE "regex - Win32 Debug Unicode DLL" (based on "Win32 (x86) Static Library") -!MESSAGE "regex - Win32 Release Unicode DLL" (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)" == "regex - 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 Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c -# ADD CPP /nologo /MD /W4 /O1 /I "." /I "../../lib/msw" /I "../../include" /D "WIN32" /D "_WINDOWS" /D "__WINDOWS__" /D "__WXMSW__" /D "__WIN95__" /D "__WIN32__" /D WINVER=0x0400 /D "STRICT" /FD /c -# ADD BASE RSC /l 0x809 /d "NDEBUG" -# ADD RSC /l 0x809 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo /out:"..\..\lib\regex.lib" - -!ELSEIF "$(CFG)" == "regex - 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 Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c -# ADD CPP /nologo /MDd /W4 /Gm /Zi /Od /I "." /I "../../lib/mswd" /I "../../include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "__WINDOWS__" /D "__WXMSW__" /D "__WXDEBUG__" /D "__WIN95__" /D "__WIN32__" /D WINVER=0x0400 /D "STRICT" /YX /FD /GZ /c -# ADD BASE RSC /l 0x809 /d "_DEBUG" -# ADD RSC /l 0x809 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo /out:"..\..\lib\regexd.lib" - -!ELSEIF "$(CFG)" == "regex - Win32 Release DLL" - -# 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 Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c -# ADD CPP /nologo /MD /W4 /O1 /I "." /I "../../lib/msw" /I "../../include" /D "WIN32" /D "_WINDOWS" /D "__WINDOWS__" /D "__WXMSW__" /D "__WIN95__" /D "__WIN32__" /D WINVER=0x0400 /D "STRICT" /FD /c -# ADD BASE RSC /l 0x809 /d "NDEBUG" -# ADD RSC /l 0x809 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo /out:"..\..\lib\regex.lib" - -!ELSEIF "$(CFG)" == "regex - Win32 Debug DLL" - -# 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 Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c -# ADD CPP /nologo /MDd /W4 /Gm /Zi /Od /I "." /I "../../lib/mswd" /I "../../include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "__WINDOWS__" /D "__WXMSW__" /D "__WXDEBUG__" /D "__WIN95__" /D "__WIN32__" /D WINVER=0x0400 /D "STRICT" /YX /FD /GZ /c -# ADD BASE RSC /l 0x809 /d "_DEBUG" -# ADD RSC /l 0x809 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo /out:"..\..\lib\regexd.lib" - -!ELSEIF "$(CFG)" == "regex - Win32 Release Unicode" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "regex___Win32_Release_Unicode" -# PROP BASE Intermediate_Dir "regex___Win32_Release_Unicode" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "regex___Win32_Release_Unicode" -# PROP Intermediate_Dir "regex___Win32_Release_Unicode" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MD /O1 /I "." /D "WIN32" /D "_WINDOWS" /D "__WINDOWS__" /D "__WXMSW__" /D "__WIN95__" /D "__WIN32__" /D WINVER=0x0400 /D "STRICT" /FD /c -# SUBTRACT BASE CPP /YX -# ADD CPP /nologo /MD /W4 /O1 /I "." /I "../../lib/mswu" /I "../../include" /D "WIN32" /D "_WINDOWS" /D "_UNICODE" /D "UNICODE" /D "wxUSE_UNICODE" /D "__WINDOWS__" /D "__WXMSW__" /D "__WIN95__" /D "__WIN32__" /D WINVER=0x0400 /D "STRICT" /FD /c -# ADD BASE RSC /l 0x809 /d "NDEBUG" -# ADD RSC /l 0x809 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo /out:"..\..\lib\regex.lib" -# ADD LIB32 /nologo /out:"..\..\lib\regexu.lib" - -!ELSEIF "$(CFG)" == "regex - Win32 Debug Unicode" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "regex___Win32_Debug_Unicode" -# PROP BASE Intermediate_Dir "regex___Win32_Debug_Unicode" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "regex___Win32_Debug_Unicode" -# PROP Intermediate_Dir "regex___Win32_Debug_Unicode" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MDd /Gm /Zi /Od /I "." /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "__WINDOWS__" /D "__WXMSW__" /D "__WXDEBUG__" /D "__WIN95__" /D "__WIN32__" /D WINVER=0x0400 /D "STRICT" /YX /FD /GZ /c -# ADD CPP /nologo /MDd /W4 /Gm /Zi /Od /I "." /I "../../lib/mswud" /I "../../include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "__WINDOWS__" /D "_UNICODE" /D "UNICODE" /D "wxUSE_UNICODE" /D "__WXMSW__" /D "__WXDEBUG__" /D "__WIN95__" /D "__WIN32__" /D WINVER=0x0400 /D "STRICT" /YX /FD /GZ /c -# ADD BASE RSC /l 0x809 /d "_DEBUG" -# ADD RSC /l 0x809 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo /out:"..\..\lib\regexd.lib" -# ADD LIB32 /nologo /out:"..\..\lib\regexud.lib" - -!ELSEIF "$(CFG)" == "regex - Win32 Release With Debug Info" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "regex___Win32_Release_With_Debug_Info" -# PROP BASE Intermediate_Dir "regex___Win32_Release_With_Debug_Info" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "regex___Win32_Release_With_Debug_Info" -# PROP Intermediate_Dir "regex___Win32_Release_With_Debug_Info" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MD /O1 /I "." /D "WIN32" /D "_WINDOWS" /D "__WINDOWS__" /D "__WXMSW__" /D "__WIN95__" /D "__WIN32__" /D WINVER=0x0400 /D "STRICT" /FD /c -# SUBTRACT BASE CPP /YX -# ADD CPP /nologo /MD /W4 /Zi /O1 /I "." /I "../../lib/msw" /I "../../include" /D "WIN32" /D "_WINDOWS" /D "__WINDOWS__" /D "__WXMSW__" /D "__WIN95__" /D "__WIN32__" /D WINVER=0x0400 /D "STRICT" /FD /c -# ADD BASE RSC /l 0x809 /d "NDEBUG" -# ADD RSC /l 0x809 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo /out:"..\..\lib\regex.lib" -# ADD LIB32 /nologo /out:"..\..\lib\regex.lib" - -!ELSEIF "$(CFG)" == "regex - Win32 Debug Unicode DLL" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "regex___Win32_Debug_Unicode_DLL" -# PROP BASE Intermediate_Dir "regex___Win32_Debug_Unicode_DLL" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "regex___Win32_Debug_Unicode_DLL" -# PROP Intermediate_Dir "regex___Win32_Debug_Unicode_DLL" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MDd /W4 /Gm /Zi /Od /I "." /I "../../lib/mswud" /I "../../include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "__WINDOWS__" /D "_UNICODE" /D "UNICODE" /D "wxUSE_UNICODE" /D "__WXMSW__" /D "__WXDEBUG__" /D "__WIN95__" /D "__WIN32__" /D WINVER=0x0400 /D "STRICT" /YX /FD /GZ /c -# ADD CPP /nologo /MDd /W4 /Gm /Zi /Od /I "." /I "../../lib/mswud" /I "../../include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "__WINDOWS__" /D "_UNICODE" /D "UNICODE" /D "wxUSE_UNICODE" /D "__WXMSW__" /D "__WXDEBUG__" /D "__WIN95__" /D "__WIN32__" /D WINVER=0x0400 /D "STRICT" /YX /FD /GZ /c -# ADD BASE RSC /l 0x809 /d "_DEBUG" -# ADD RSC /l 0x809 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo /out:"..\..\lib\regexud.lib" -# ADD LIB32 /nologo /out:"..\..\lib\regexud.lib" - -!ELSEIF "$(CFG)" == "regex - Win32 Release Unicode DLL" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "regex___Win32_Release_Unicode_DLL" -# PROP BASE Intermediate_Dir "regex___Win32_Release_Unicode_DLL" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "regex___Win32_Release_Unicode_DLL" -# PROP Intermediate_Dir "regex___Win32_Release_Unicode_DLL" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MD /W4 /O1 /I "." /I "../../lib/mswu" /I "../../include" /D "WIN32" /D "_WINDOWS" /D "_UNICODE" /D "UNICODE" /D "wxUSE_UNICODE" /D "__WINDOWS__" /D "__WXMSW__" /D "__WIN95__" /D "__WIN32__" /D WINVER=0x0400 /D "STRICT" /FD /c -# ADD CPP /nologo /MD /W4 /O1 /I "." /I "../../lib/mswu" /I "../../include" /D "WIN32" /D "_WINDOWS" /D "_UNICODE" /D "UNICODE" /D "wxUSE_UNICODE" /D "__WINDOWS__" /D "__WXMSW__" /D "__WIN95__" /D "__WIN32__" /D WINVER=0x0400 /D "STRICT" /FD /c -# ADD BASE RSC /l 0x809 /d "NDEBUG" -# ADD RSC /l 0x809 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo /out:"..\..\lib\regexu.lib" -# ADD LIB32 /nologo /out:"..\..\lib\regexu.lib" - -!ENDIF - -# Begin Target - -# Name "regex - Win32 Release" -# Name "regex - Win32 Debug" -# Name "regex - Win32 Release DLL" -# Name "regex - Win32 Debug DLL" -# Name "regex - Win32 Release Unicode" -# Name "regex - Win32 Debug Unicode" -# Name "regex - Win32 Release With Debug Info" -# Name "regex - Win32 Debug Unicode DLL" -# Name "regex - Win32 Release Unicode DLL" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=.\regcomp.c -# End Source File -# Begin Source File - -SOURCE=.\regerror.c -# End Source File -# Begin Source File - -SOURCE=.\regexec.c -# End Source File -# Begin Source File - -SOURCE=.\regfree.c -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=.\regcustom.h -# End Source File -# Begin Source File - -SOURCE=.\regerrs.h -# End Source File -# Begin Source File - -SOURCE=.\regex.h -# End Source File -# Begin Source File - -SOURCE=.\regguts.h -# End Source File -# Begin Source File - -SOURCE=..\..\include\wx\msw\setup.h - -!IF "$(CFG)" == "regex - Win32 Release" - -# Begin Custom Build - Creating ..\..\lib\msw\wx\setup.h from $(InputPath) -InputPath=..\..\include\wx\msw\setup.h - -"../../lib/msw/wx/setup.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - copy "$(InputPath)" ..\..\lib\msw\wx\setup.h - -# End Custom Build - -!ELSEIF "$(CFG)" == "regex - Win32 Debug" - -# Begin Custom Build - Creating ..\..\lib\mswd\wx\setup.h from $(InputPath) -InputPath=..\..\include\wx\msw\setup.h - -"../../lib/mswd/wx/setup.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - copy "$(InputPath)" ..\..\lib\mswd\wx\setup.h - -# End Custom Build - -!ELSEIF "$(CFG)" == "regex - Win32 Release Unicode" - -# Begin Custom Build - Creating ..\..\lib\mswu\wx\setup.h from $(InputPath) -InputPath=..\..\include\wx\msw\setup.h - -"../../lib/mswu/wx/setup.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - copy "$(InputPath)" ..\..\lib\mswu\wx\setup.h - -# End Custom Build - -!ELSEIF "$(CFG)" == "regex - Win32 Debug Unicode" - -# Begin Custom Build - Creating ..\..\lib\mswud\wx\setup.h from $(InputPath) -InputPath=..\..\include\wx\msw\setup.h - -"../../lib/mswud/wx/setup.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - copy "$(InputPath)" ..\..\lib\mswud\wx\setup.h - -# End Custom Build - -!ELSEIF "$(CFG)" == "regex - Win32 Release With Debug Info" - -# Begin Custom Build - Creating ..\..\lib\msw\wx\setup.h from $(InputPath) -InputPath=..\..\include\wx\msw\setup.h - -"../../lib/msw/wx/setup.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - copy "$(InputPath)" ..\..\lib\msw\wx\setup.h - -# End Custom Build - -!ELSEIF "$(CFG)" == "regex - Win32 Debug Unicode DLL" - -# Begin Custom Build - Creating ..\..\lib\mswud\wx\setup.h from $(InputPath) -InputPath=..\..\include\wx\msw\setup.h - -"../../lib/mswud/wx/setup.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - copy "$(InputPath)" ..\..\lib\mswud\wx\setup.h - -# End Custom Build - -!ELSEIF "$(CFG)" == "regex - Win32 Release Unicode DLL" - -# Begin Custom Build - Creating ..\..\lib\mswu\wx\setup.h from $(InputPath) -InputPath=..\..\include\wx\msw\setup.h - -"../../lib/mswu/wx/setup.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - copy "$(InputPath)" ..\..\lib\mswu\wx\setup.h - -# End Custom Build - -!ENDIF - -# End Source File -# End Group -# End Target -# End Project diff --git a/wxWidgets/src/regex/regex.h b/wxWidgets/src/regex/regex.h deleted file mode 100644 index 0120ac3018..0000000000 --- a/wxWidgets/src/regex/regex.h +++ /dev/null @@ -1,337 +0,0 @@ -#ifndef _REGEX_H_ -#define _REGEX_H_ /* never again */ -/* - * regular expressions - * - * Copyright (c) 1998, 1999 Henry Spencer. All rights reserved. - * - * Development of this software was funded, in part, by Cray Research Inc., - * UUNET Communications Services Inc., Sun Microsystems Inc., and Scriptics - * Corporation, none of whom are responsible for the results. The author - * thanks all of them. - * - * Redistribution and use in source and binary forms -- with or without - * modification -- are permitted for any purpose, provided that - * redistributions in source form retain this entire copyright notice and - * indicate the origin and nature of any modifications. - * - * I'd appreciate being given credit for this package in the documentation - * of software which uses it, but that is not a requirement. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL - * HENRY SPENCER BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; - * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * - * - * Prototypes etc. marked with "^" within comments get gathered up (and - * possibly edited) by the regfwd program and inserted near the bottom of - * this file. - * - * We offer the option of declaring one wide-character version of the - * RE functions as well as the char versions. To do that, define - * __REG_WIDE_T to the type of wide characters (unfortunately, there - * is no consensus that wchar_t is suitable) and __REG_WIDE_COMPILE and - * __REG_WIDE_EXEC to the names to be used for the compile and execute - * functions (suggestion: re_Xcomp and re_Xexec, where X is a letter - * suggestive of the wide type, e.g. re_ucomp and re_uexec for Unicode). - * For cranky old compilers, it may be necessary to do something like: - * #define __REG_WIDE_COMPILE(a,b,c,d) re_Xcomp(a,b,c,d) - * #define __REG_WIDE_EXEC(a,b,c,d,e,f,g) re_Xexec(a,b,c,d,e,f,g) - * rather than just #defining the names as parameterless macros. - * - * For some specialized purposes, it may be desirable to suppress the - * declarations of the "front end" functions, regcomp() and regexec(), - * or of the char versions of the compile and execute functions. To - * suppress the front-end functions, define __REG_NOFRONT. To suppress - * the char versions, define __REG_NOCHAR. - * - * The right place to do those defines (and some others you may want, see - * below) would be . If you don't have control of that file, - * the right place to add your own defines to this file is marked below. - * This is normally done automatically, by the makefile and regmkhdr, based - * on the contents of regcustom.h. - */ - - - -/* - * voodoo for C++ - */ -#ifdef __cplusplus -extern "C" { -#endif - - - -/* - * Add your own defines, if needed, here. - */ - - - -/* - * Location where a chunk of regcustom.h is automatically spliced into - * this file (working from its prototype, regproto.h). - */ -/* --- begin --- */ -/* ensure certain things don't sneak in from system headers */ -#ifdef __REG_WIDE_T -#undef __REG_WIDE_T -#endif -#ifdef __REG_WIDE_COMPILE -#undef __REG_WIDE_COMPILE -#endif -#ifdef __REG_WIDE_EXEC -#undef __REG_WIDE_EXEC -#endif -#ifdef __REG_REGOFF_T -#undef __REG_REGOFF_T -#endif -#ifdef __REG_VOID_T -#undef __REG_VOID_T -#endif -#ifdef __REG_CONST -#undef __REG_CONST -#endif -#ifdef __REG_NOFRONT -#undef __REG_NOFRONT -#endif -#ifdef __REG_NOCHAR -#undef __REG_NOCHAR -#endif -#if wxUSE_UNICODE -# define __REG_WIDE_T wxChar -# define __REG_WIDE_COMPILE wx_re_comp -# define __REG_WIDE_EXEC wx_re_exec -# define __REG_NOCHAR /* don't want the char versions */ -#endif -#define __REG_NOFRONT /* don't want regcomp() and regexec() */ -#define _ANSI_ARGS_(x) x -/* --- end --- */ - - -/* - * interface types etc. - */ - -/* - * regoff_t has to be large enough to hold either off_t or ssize_t, - * and must be signed; it's only a guess that long is suitable, so we - * offer an override. - */ -#ifdef __REG_REGOFF_T -typedef __REG_REGOFF_T regoff_t; -#else -typedef long regoff_t; -#endif - -/* - * For benefit of old compilers, we offer the option of - * overriding the `void' type used to declare nonexistent return types. - */ -#ifdef __REG_VOID_T -typedef __REG_VOID_T re_void; -#else -typedef void re_void; -#endif - -/* - * Also for benefit of old compilers, can supply a macro - * which expands to a substitute for `const'. - */ -#ifndef __REG_CONST -#define __REG_CONST const -#endif - - - -/* - * other interface types - */ - -/* the biggie, a compiled RE (or rather, a front end to same) */ -typedef struct { - int re_magic; /* magic number */ - size_t re_nsub; /* number of subexpressions */ - long re_info; /* information about RE */ -# define REG_UBACKREF 000001 -# define REG_ULOOKAHEAD 000002 -# define REG_UBOUNDS 000004 -# define REG_UBRACES 000010 -# define REG_UBSALNUM 000020 -# define REG_UPBOTCH 000040 -# define REG_UBBS 000100 -# define REG_UNONPOSIX 000200 -# define REG_UUNSPEC 000400 -# define REG_UUNPORT 001000 -# define REG_ULOCALE 002000 -# define REG_UEMPTYMATCH 004000 -# define REG_UIMPOSSIBLE 010000 -# define REG_USHORTEST 020000 - int re_csize; /* sizeof(character) */ - char *re_endp; /* backward compatibility kludge */ - /* the rest is opaque pointers to hidden innards */ - char *re_guts; /* `char *' is more portable than `void *' */ - char *re_fns; -} regex_t; - -/* result reporting (may acquire more fields later) */ -typedef struct { - regoff_t rm_so; /* start of substring */ - regoff_t rm_eo; /* end of substring */ -} regmatch_t; - -/* supplementary control and reporting */ -typedef struct { - regmatch_t rm_extend; /* see REG_EXPECT */ -} rm_detail_t; - - - -/* - * compilation - ^ #ifndef __REG_NOCHAR - ^ int re_comp(regex_t *, __REG_CONST char *, size_t, int); - ^ #endif - ^ #ifndef __REG_NOFRONT - ^ int regcomp(regex_t *, __REG_CONST char *, int); - ^ #endif - ^ #ifdef __REG_WIDE_T - ^ int __REG_WIDE_COMPILE(regex_t *, __REG_CONST __REG_WIDE_T *, size_t, int); - ^ #endif - */ -#define REG_BASIC 000000 /* BREs (convenience) */ -#define REG_EXTENDED 000001 /* EREs */ -#define REG_ADVF 000002 /* advanced features in EREs */ -#define REG_ADVANCED 000003 /* AREs (which are also EREs) */ -#define REG_QUOTE 000004 /* no special characters, none */ -#define REG_NOSPEC REG_QUOTE /* historical synonym */ -#define REG_ICASE 000010 /* ignore case */ -#define REG_NOSUB 000020 /* don't care about subexpressions */ -#define REG_EXPANDED 000040 /* expanded format, white space & comments */ -#define REG_NLSTOP 000100 /* \n doesn't match . or [^ ] */ -#define REG_NLANCH 000200 /* ^ matches after \n, $ before */ -#define REG_NEWLINE 000300 /* newlines are line terminators */ -#define REG_PEND 000400 /* ugh -- backward-compatibility hack */ -#define REG_EXPECT 001000 /* report details on partial/limited matches */ -#define REG_BOSONLY 002000 /* temporary kludge for BOS-only matches */ -#define REG_DUMP 004000 /* none of your business :-) */ -#define REG_FAKE 010000 /* none of your business :-) */ -#define REG_PROGRESS 020000 /* none of your business :-) */ - - - -/* - * execution - ^ #ifndef __REG_NOCHAR - ^ int re_exec(regex_t *, __REG_CONST char *, size_t, - ^ rm_detail_t *, size_t, regmatch_t [], int); - ^ #endif - ^ #ifndef __REG_NOFRONT - ^ int regexec(regex_t *, __REG_CONST char *, size_t, regmatch_t [], int); - ^ #endif - ^ #ifdef __REG_WIDE_T - ^ int __REG_WIDE_EXEC(regex_t *, __REG_CONST __REG_WIDE_T *, size_t, - ^ rm_detail_t *, size_t, regmatch_t [], int); - ^ #endif - */ -#define REG_NOTBOL 0001 /* BOS is not BOL */ -#define REG_NOTEOL 0002 /* EOS is not EOL */ -#define REG_STARTEND 0004 /* backward compatibility kludge */ -#define REG_FTRACE 0010 /* none of your business */ -#define REG_MTRACE 0020 /* none of your business */ -#define REG_SMALL 0040 /* none of your business */ - - - -/* - * misc generics (may be more functions here eventually) - ^ re_void regfree(regex_t *); - */ - - - -/* - * error reporting - * Be careful if modifying the list of error codes -- the table used by - * regerror() is generated automatically from this file! - * - * Note that there is no wide-char variant of regerror at this time; what - * kind of character is used for error reports is independent of what kind - * is used in matching. - * - ^ extern size_t regerror(int, __REG_CONST regex_t *, char *, size_t); - */ -#define REG_OKAY 0 /* no errors detected */ -#define REG_NOMATCH 1 /* failed to match */ -#define REG_BADPAT 2 /* invalid regexp */ -#define REG_ECOLLATE 3 /* invalid collating element */ -#define REG_ECTYPE 4 /* invalid character class */ -#define REG_EESCAPE 5 /* invalid escape \ sequence */ -#define REG_ESUBREG 6 /* invalid backreference number */ -#define REG_EBRACK 7 /* brackets [] not balanced */ -#define REG_EPAREN 8 /* parentheses () not balanced */ -#define REG_EBRACE 9 /* braces {} not balanced */ -#define REG_BADBR 10 /* invalid repetition count(s) */ -#define REG_ERANGE 11 /* invalid character range */ -#define REG_ESPACE 12 /* out of memory */ -#define REG_BADRPT 13 /* quantifier operand invalid */ -#define REG_ASSERT 15 /* "can't happen" -- you found a bug */ -#define REG_INVARG 16 /* invalid argument to regex function */ -#define REG_MIXED 17 /* character widths of regex and string differ */ -#define REG_BADOPT 18 /* invalid embedded option */ -/* two specials for debugging and testing */ -#define REG_ATOI 101 /* convert error-code name to number */ -#define REG_ITOA 102 /* convert error-code number to name */ - - - -/* - * the prototypes, as possibly munched by regfwd - */ -/* =====^!^===== begin forwards =====^!^===== */ -/* automatically gathered by fwd; do not hand-edit */ -/* === regproto.h === */ -#ifndef __REG_NOCHAR -int wx_re_comp _ANSI_ARGS_((regex_t *, __REG_CONST char *, size_t, int)); -#endif -#ifndef __REG_NOFRONT -int regcomp _ANSI_ARGS_((regex_t *, __REG_CONST char *, int)); -#endif -#ifdef __REG_WIDE_T -int __REG_WIDE_COMPILE _ANSI_ARGS_((regex_t *, __REG_CONST __REG_WIDE_T *, size_t, int)); -#endif -#ifndef __REG_NOCHAR -int wx_re_exec _ANSI_ARGS_((regex_t *, __REG_CONST char *, size_t, rm_detail_t *, size_t, regmatch_t [], int)); -#endif -#ifndef __REG_NOFRONT -int regexec _ANSI_ARGS_((regex_t *, __REG_CONST char *, size_t, regmatch_t [], int)); -#endif -#ifdef __REG_WIDE_T -int __REG_WIDE_EXEC _ANSI_ARGS_((regex_t *, __REG_CONST __REG_WIDE_T *, size_t, rm_detail_t *, size_t, regmatch_t [], int)); -#endif -re_void wx_regfree _ANSI_ARGS_((regex_t *)); -extern size_t wx_regerror _ANSI_ARGS_((int, __REG_CONST regex_t *, char *, size_t)); -/* automatically gathered by fwd; do not hand-edit */ -/* =====^!^===== end forwards =====^!^===== */ - - - -/* - * more C++ voodoo - */ -#ifdef __cplusplus -} -#endif - - - -#endif diff --git a/wxWidgets/src/regex/regexM8.xml b/wxWidgets/src/regex/regexM8.xml deleted file mode 100644 index 81e3f14ac7..0000000000 --- a/wxWidgets/src/regex/regexM8.xml +++ /dev/null @@ -1,2418 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -]> - - - - - PPC - - - - UserSourceTrees - - - AlwaysSearchUserPathstrue - InterpretDOSAndUnixPathstrue - RequireFrameworkStyleIncludesfalse - UserSearchPaths - - SearchPath - Path: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path../../include - PathFormatUnix - PathRootProject - - Recursivefalse - FrameworkPathfalse - HostFlagsAll - - - SystemSearchPaths - - SearchPath - PathMSL - PathFormatWindows - PathRootCodeWarrior - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:MacOS Support: - PathFormatMacOS - PathRootCodeWarrior - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - - - MWRuntimeSettings_WorkingDirectory - MWRuntimeSettings_CommandLine - MWRuntimeSettings_HostApplication - Path - PathFormatGeneric - PathRootAbsolute - - MWRuntimeSettings_EnvVars - - - LinkerMacOS PPC Linker - PreLinker - PostLinker - TargetnamePPC - OutputDirectory - Path:::lib: - PathFormatMacOS - PathRootProject - - SaveEntriesUsingRelativePathsfalse - - - FileMappings - - FileTypeAPPL - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypeAppl - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypeMMLB - FileExtension - CompilerLib Import PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeMPLF - FileExtension - CompilerLib Import PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeMWCD - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypeRSRC - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.bh - CompilerBalloon Help - EditLanguageBalloon Help - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.c - CompilerMW C/C++ PPC - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.c++ - CompilerMW C/C++ PPC - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.cc - CompilerMW C/C++ PPC - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.cp - CompilerMW C/C++ PPC - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.cpp - CompilerMW C/C++ PPC - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.exp - Compiler - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.h - CompilerMW C/C++ PPC - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMaketrue - - - FileTypeTEXT - FileExtension.p - CompilerMW Pascal PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.pas - CompilerMW Pascal PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.pch - CompilerMW C/C++ PPC - EditLanguageC/C++ - Precompiletrue - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.pch++ - CompilerMW C/C++ PPC - EditLanguageC/C++ - Precompiletrue - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.ppu - CompilerMW Pascal PPC - EditLanguage - Precompiletrue - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.r - CompilerRez - EditLanguageRez - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.s - CompilerPPCAsm - EditLanguageBalloon Help - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeXCOF - FileExtension - CompilerXCOFF Import PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypedocu - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypersrc - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypeshlb - FileExtension - CompilerPEF Import PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypestub - FileExtension - CompilerPEF Import PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileExtension.doc - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFilefalse - IgnoredByMaketrue - - - FileExtension.o - CompilerXCOFF Import PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileExtension.ppob - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileExtension.rsrc - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - - - CacheModDatestrue - DumpBrowserInfofalse - CacheSubprojectstrue - UseThirdPartyDebuggerfalse - BrowserGenerator1 - DebuggerAppPath - Path - PathFormatGeneric - PathRootAbsolute - - DebuggerCmdLineArgs - DebuggerWorkingDir - Path - PathFormatGeneric - PathRootAbsolute - - CodeCompletionPrefixFileNameMacHeaders.c - CodeCompletionMacroFileNameMacOS_Carbon_C++_Macros.h - - - ConsoleEncoding0 - LogSystemMessagestrue - AutoTargetDLLsfalse - StopAtWatchpointstrue - PauseWhileRunningfalse - PauseInterval5 - PauseUIFlags0 - AltExePath - Path - PathFormatGeneric - PathRootAbsolute - - StopAtTempBPOnLaunchtrue - CacheSymbolicstrue - TempBPFunctionNamemain - TempBPType0 - - - Enabledfalse - ConnectionName - DownloadPath - LaunchRemoteAppfalse - RemoteAppPath - CoreID0 - JTAGClockSpeed8000 - IsMultiCorefalse - OSDownloadfalse - UseGlobalOSDownloadfalse - OSDownloadConnectionName - OSDownloadPath - AltDownloadfalse - AltDownloadConnectionName - - - OtherExecutables - - - CustomColor1 - Red0 - Green32767 - Blue0 - - CustomColor2 - Red0 - Green32767 - Blue0 - - CustomColor3 - Red0 - Green32767 - Blue0 - - CustomColor4 - Red0 - Green32767 - Blue0 - - - - MWFrontEnd_C_cplusplus0 - MWFrontEnd_C_checkprotos0 - MWFrontEnd_C_arm0 - MWFrontEnd_C_trigraphs0 - MWFrontEnd_C_onlystdkeywords0 - MWFrontEnd_C_enumsalwaysint0 - MWFrontEnd_C_mpwpointerstyle0 - MWFrontEnd_C_prefixname - MWFrontEnd_C_ansistrict0 - MWFrontEnd_C_mpwcnewline0 - MWFrontEnd_C_wchar_type1 - MWFrontEnd_C_enableexceptions1 - MWFrontEnd_C_dontreusestrings0 - MWFrontEnd_C_poolstrings0 - MWFrontEnd_C_dontinline0 - MWFrontEnd_C_useRTTI1 - MWFrontEnd_C_multibyteaware0 - MWFrontEnd_C_unsignedchars0 - MWFrontEnd_C_autoinline0 - MWFrontEnd_C_booltruefalse1 - MWFrontEnd_C_inlinelevel0 - MWFrontEnd_C_ecplusplus0 - MWFrontEnd_C_objective_c0 - MWFrontEnd_C_defer_codegen0 - MWFrontEnd_C_templateparser0 - MWFrontEnd_C_c990 - MWFrontEnd_C_bottomupinline1 - - - MWWarning_C_warn_illpragma0 - MWWarning_C_warn_emptydecl0 - MWWarning_C_warn_possunwant0 - MWWarning_C_warn_unusedvar0 - MWWarning_C_warn_unusedarg0 - MWWarning_C_warn_extracomma0 - MWWarning_C_pedantic0 - MWWarning_C_warningerrors0 - MWWarning_C_warn_hidevirtual0 - MWWarning_C_warn_implicitconv0 - MWWarning_C_warn_notinlined0 - MWWarning_C_warn_structclass0 - - - MWFTP_Post_hostName - MWFTP_Post_username - MWFTP_Post_password0ÿÀ°¯p"²¸ - MWFTP_Post_remoteDir - MWFTP_Post_ftp_PathVersion1 - MWFTP_Post_ftp_PathType0 - MWFTP_Post_ftp_PathFormat0 - MWFTP_Post_ftp_tree - MWFTP_Post_uploadDir - MWFTP_Post_ftp_port21 - MWFTP_Post_SendBin1 - MWFTP_Post_ShouldLog1 - - - MWCommandLine_Java_clsName - MWCommandLine_Java_args - - - MWVJavaDebugging_Protocol1 - MWVJavaDebugging_JDKVersion1 - MWVJavaDebugging_TimeOut25 - MWVJavaDebugging_SupportSlowDevicesfalse - MWVJavaDebugging_UseRemoteLaunchAgentfalse - MWVJavaDebugging_LaunchVMasServerfalse - - - MWJava_Language_optimizefalse - MWJava_Language_warnDeprecatedfalse - MWJava_Language_emitMapfalse - MWJava_Language_strictFileNamesfalse - MWJava_Language_strictFileHierarchyfalse - MWJava_Language_1_1_Compatiblefalse - MWJava_Language_emitHeaders0 - MWJava_Language_headerTypeJNINativeHeaders - MWJava_Language_packageFilter - MWJava_Language_genCommentstrue - MWJava_Language_genHeadersfalse - MWJava_Language_enableAssertsfalse - MWJava_Language_targetVM1.1 - - - Manifest-JAD Attributes - - AttributeMain-Class - ValueAuto-Generated - - - - - MWJava_MRJAppBuilder_outFileMRJApplication - MWJava_MRJAppBuilder_mergefalse - MWJava_MRJAppBuilder_quitMenutrue - MWJava_MRJAppBuilder_growfalse - MWJava_MRJAppBuilder_stdoutTypeConsole - MWJava_MRJAppBuilder_stderrTypeConsole - MWJava_MRJAppBuilder_stdinTypeConsole - MWJava_MRJAppBuilder_appIconPVersion0 - MWJava_MRJAppBuilder_appIconPType0 - MWJava_MRJAppBuilder_appIconPFormat0 - MWJava_MRJAppBuilder_appIconPTree - MWJava_MRJAppBuilder_appIconFile - MWJava_MRJAppBuilder_splashScreenPVersion0 - MWJava_MRJAppBuilder_splashScreenPType0 - MWJava_MRJAppBuilder_splashScreenPFormat0 - MWJava_MRJAppBuilder_splashScreenPTree - MWJava_MRJAppBuilder_splashScreenPICTFile - MWJava_MRJAppBuilder_aboutName - MWJava_MRJAppBuilder_stdoutPVersion0 - MWJava_MRJAppBuilder_stdoutPType0 - MWJava_MRJAppBuilder_stdoutPFormat0 - MWJava_MRJAppBuilder_stdoutPTree - MWJava_MRJAppBuilder_stdoutFile - MWJava_MRJAppBuilder_stdoutAppendfalse - MWJava_MRJAppBuilder_stderrPType0 - MWJava_MRJAppBuilder_stderrPFormat0 - MWJava_MRJAppBuilder_stderrPTree - MWJava_MRJAppBuilder_stderrFile - MWJava_MRJAppBuilder_stderrAppendfalse - MWJava_MRJAppBuilder_stdinPType0 - MWJava_MRJAppBuilder_stdinPFormat0 - MWJava_MRJAppBuilder_stdinPTree - MWJava_MRJAppBuilder_stdinFile - - - MWJava_Output_outputtypeJarFile - MWJava_Output_outfileJavaClasses.jar - MWJava_Output_ftype1514754080 - MWJava_Output_fcreator1297570384 - MWJava_Output_compress0 - MWJava_Output_genManifest0 - MWJava_Output_trunctypeFront - MWJava_Output_deleteClasses0 - MWJava_Output_consoleApp1 - MWJava_Output_preverify0 - MWJava_Output_genJad0 - MWJava_Output_obfuscate0 - - - MWJava_Proj_projtypeApplet - MWJava_Proj_mainClassName - MWJava_Proj_HTMLAppCreator1145457748 - MWJava_Proj_HTMLAppNameMetrowerks Java - MWJava_Proj_PathVersion1 - MWJava_Proj_PathType0 - MWJava_Proj_PathFormat0 - MWJava_Proj_tree - MWJava_Proj_HTMLAppWin32NameInternet Explorer - MWJava_Proj_compress0 - MWJava_Proj_simulator0 - MWJava_Proj_useVM\000\000macosx - MWJava_Proj_vmarguments - MWJava_Proj_vmName - MWJava_Proj_simPropFile - - - MWJavaDoc_Proj_Version1 - MWJavaDoc_Proj_Deprecated1 - MWJavaDoc_Proj_Author1 - MWJavaDoc_Proj_Index1 - MWJavaDoc_Proj_Tree1 - MWJavaDoc_Proj_SunResolveToSame0 - MWJavaDoc_Proj_Shortnames1 - MWJavaDoc_Proj_Folder0 - MWJavaDoc_Proj_GenerateAPILinks0 - MWJavaDoc_Proj_scopePublic - MWJavaDoc_Proj_fcreator1229278547 - MWJavaDoc_Proj_encodingName - MWJavaDoc_Proj_decodingName - MWJavaDoc_Proj_javaPackagePathhttp://java.sun.com/products/jdk/1.1/docs/api/ - - - MWMerge_MacOS_projectTypeApplication - MWMerge_MacOS_outputNameMerge Out - MWMerge_MacOS_outputCreator???? - MWMerge_MacOS_outputTypeAPPL - MWMerge_MacOS_suppressWarning0 - MWMerge_MacOS_copyFragments1 - MWMerge_MacOS_copyResources1 - MWMerge_MacOS_flattenResource0 - MWMerge_MacOS_flatFileNamea.rsrc - MWMerge_MacOS_flatFileOutputPath - Path: - PathFormatMacOS - PathRootProject - - MWMerge_MacOS_skipResources - DLGX - ckid - Proj - WSPC - - - - FileLockedfalse - ResourcesMapIsReadOnlyfalse - PrinterDriverIsMultiFinderCompatiblefalse - Invisiblefalse - HasBundlefalse - NameLockedfalse - Stationeryfalse - HasCustomIconfalse - Sharedfalse - HasBeenInitedfalse - Label0 - Comments - - - MWMacOSPackager_UsePackager0 - MWMacOSPackager_FolderToPackage - Path - PathFormatMacOS - PathRootAbsolute - - MWMacOSPackager_CreateClassicAlias0 - MWMacOSPackager_ClassicAliasMethodUseTargetOutput - MWMacOSPackager_ClassicAliasPath - Path - PathFormatMacOS - PathRootAbsolute - - MWMacOSPackager_CreatePkgInfo0 - MWMacOSPackager_PkgCreatorType???? - MWMacOSPackager_PkgFileTypeAPPL - - - MWCodeGen_PPC_structalignmentPPC_mw - MWCodeGen_PPC_tracebacktablesInline - MWCodeGen_PPC_processorGeneric - MWCodeGen_PPC_function_align4 - MWCodeGen_PPC_tocdata1 - MWCodeGen_PPC_largetoc0 - MWCodeGen_PPC_profiler0 - MWCodeGen_PPC_vectortocdata0 - MWCodeGen_PPC_poolconst0 - MWCodeGen_PPC_peephole1 - MWCodeGen_PPC_readonlystrings0 - MWCodeGen_PPC_linkerpoolsstrings0 - MWCodeGen_PPC_volatileasm0 - MWCodeGen_PPC_schedule0 - MWCodeGen_PPC_altivec0 - MWCodeGen_PPC_altivec_move_block0 - MWCodeGen_PPC_strictIEEEfp0 - MWCodeGen_PPC_fpcontract1 - MWCodeGen_PPC_genfsel0 - MWCodeGen_PPC_orderedfpcmp0 - - - MWCodeGen_MachO_structalignmentPPC_mw - MWCodeGen_MachO_profiler_enumOff - MWCodeGen_MachO_processorGeneric - MWCodeGen_MachO_function_align4 - MWCodeGen_MachO_common0 - MWCodeGen_MachO_peephole1 - MWCodeGen_MachO_readonlystrings0 - MWCodeGen_MachO_linkerpoolsstrings1 - MWCodeGen_MachO_volatileasm0 - MWCodeGen_MachO_schedule0 - MWCodeGen_MachO_altivec0 - MWCodeGen_MachO_vecmove0 - MWCodeGen_MachO_fp_ieee_strict0 - MWCodeGen_MachO_fpcontract1 - MWCodeGen_MachO_genfsel0 - MWCodeGen_MachO_fp_cmps_ordered0 - - - MWDisassembler_PPC_showcode1 - MWDisassembler_PPC_extended1 - MWDisassembler_PPC_mix0 - MWDisassembler_PPC_nohex0 - MWDisassembler_PPC_showdata1 - MWDisassembler_PPC_showexceptions1 - MWDisassembler_PPC_showsym0 - MWDisassembler_PPC_shownames1 - - - GlobalOptimizer_PPC_optimizationlevelLevel2 - GlobalOptimizer_PPC_optforSpeed - - - MWLinker_PPC_linksym1 - MWLinker_PPC_symfullpath1 - MWLinker_PPC_linkmap1 - MWLinker_PPC_nolinkwarnings0 - MWLinker_PPC_dontdeadstripinitcode0 - MWLinker_PPC_permitmultdefs0 - MWLinker_PPC_linkmodeFast - MWLinker_PPC_initname - MWLinker_PPC_mainname__start - MWLinker_PPC_termname - - - MWLinker_MacOSX_linksym0 - MWLinker_MacOSX_symfullpath0 - MWLinker_MacOSX_nolinkwarnings0 - MWLinker_MacOSX_linkmap0 - MWLinker_MacOSX_dontdeadstripinitcode0 - MWLinker_MacOSX_permitmultdefs1 - MWLinker_MacOSX_use_objectivec_semantics0 - MWLinker_MacOSX_strip_debug_symbols0 - MWLinker_MacOSX_split_segs0 - MWLinker_MacOSX_report_msl_overloads0 - MWLinker_MacOSX_objects_follow_linkorder0 - MWLinker_MacOSX_linkmodeFast - MWLinker_MacOSX_exportsReferencedGlobals - MWLinker_MacOSX_sortcodeNone - MWLinker_MacOSX_mainnamestart - - - MWProject_MacOSX_typeLibrary - MWProject_MacOSX_outfilezlib_PPC.lib - MWProject_MacOSX_filecreator???? - MWProject_MacOSX_filetype???? - MWProject_MacOSX_vmaddress0 - MWProject_MacOSX_usedefaultvmaddr1 - MWProject_MacOSX_flatrsrc0 - MWProject_MacOSX_flatrsrcfilename - MWProject_MacOSX_flatrsrcoutputdir - Path: - PathFormatMacOS - PathRootProject - - MWProject_MacOSX_installpath./ - MWProject_MacOSX_dont_prebind0 - MWProject_MacOSX_flat_namespace0 - MWProject_MacOSX_frameworkversionA - MWProject_MacOSX_currentversion0 - MWProject_MacOSX_flat_oldimpversion0 - - - MWLinker_MachO_exportsNone - MWLinker_MachO_mainnamestart - MWLinker_MachO_currentversion0 - MWLinker_MachO_compatibleversion0 - MWLinker_MachO_symfullpath0 - MWLinker_MachO_supresswarnings0 - MWLinker_MachO_multisymerror0 - MWLinker_MachO_prebind1 - MWLinker_MachO_deadstrip1 - MWLinker_MachO_objectivecsemantics0 - MWLinker_MachO_whichfileloaded0 - MWLinker_MachO_whyfileloaded0 - MWLinker_MachO_readonlyrelocsErrors - MWLinker_MachO_undefinedsymbolsErrors - MWLinker_MachO_twolevelnamespace1 - MWLinker_MachO_stripdebugsymbols0 - - - MWProject_MachO_typeExecutable - MWProject_MachO_outfilea.exe - MWProject_MachO_filecreator???? - MWProject_MachO_filetypeMEXE - MWProject_MachO_vmaddress4096 - MWProject_MachO_flatrsrc1 - MWProject_MachO_flatrsrcfilenamea.rsrc - MWProject_MachO_flatrsrcoutputdir - Path: - PathFormatMacOS - PathRootProject - - MWProject_MachO_installpath./ - MWProject_MachO_frameworkversion - - - MWPEF_exportsNone - MWPEF_libfolder0 - MWPEF_sortcodeNone - MWPEF_expandbss0 - MWPEF_sharedata0 - MWPEF_olddefversion0 - MWPEF_oldimpversion0 - MWPEF_currentversion0 - MWPEF_fragmentname - MWPEF_collapsereloads0 - - - MWProject_PPC_typeLibrary - MWProject_PPC_outfileregex_PPC.lib - MWProject_PPC_filecreator???? - MWProject_PPC_filetype???? - MWProject_PPC_size0 - MWProject_PPC_minsize0 - MWProject_PPC_stacksize0 - MWProject_PPC_flags0 - MWProject_PPC_symfilename - MWProject_PPC_rsrcname - MWProject_PPC_rsrcheaderNative - MWProject_PPC_rsrctype???? - MWProject_PPC_rsrcid0 - MWProject_PPC_rsrcflags0 - MWProject_PPC_rsrcstore0 - MWProject_PPC_rsrcmerge0 - MWProject_PPC_flatrsrc0 - MWProject_PPC_flatrsrcoutputdir - Path: - PathFormatMacOS - PathRootProject - - MWProject_PPC_flatrsrcfilename - - - MWAssembler_PPC_auxheader0 - MWAssembler_PPC_symmodeMac - MWAssembler_PPC_dialectPPC - MWAssembler_PPC_prefixfile - MWAssembler_PPC_typecheck0 - MWAssembler_PPC_warnings0 - MWAssembler_PPC_casesensitive0 - - - PList_OutputTypeFile - PList_OutputEncodingUTF-8 - PList_Prefix - PList_FileFilenameInfo.plist - PList_FileDirectory - Path: - PathFormatMacOS - PathRootProject - - PList_ResourceTypeplst - PList_ResourceID0 - PList_ResourceName - - - MWRez_Language_maxwidth80 - MWRez_Language_scriptRoman - MWRez_Language_alignmentAlign1 - MWRez_Language_filtermodeFilterSkip - MWRez_Language_suppresswarnings0 - MWRez_Language_escapecontrolchars1 - MWRez_Language_prefixname - MWRez_Language_filteredtypes'CODE' 'DATA' 'PICT' - - - MWWinRC_prefixname - - - MWCodeGen_X86_processorGeneric - MWCodeGen_X86_alignmentbytes8 - MWCodeGen_X86_exceptionsZeroOverhead - MWCodeGen_X86_name_manglingMWWin32 - MWCodeGen_X86_use_extinst0 - MWCodeGen_X86_extinst_mmx0 - MWCodeGen_X86_extinst_3dnow0 - MWCodeGen_X86_use_mmx_3dnow_convention0 - MWCodeGen_X86_extinst_cmov0 - MWCodeGen_X86_extinst_sse0 - MWCodeGen_X86_extinst_sse20 - MWCodeGen_X86_intrinsics0 - MWCodeGen_X86_optimizeasm0 - MWCodeGen_X86_disableopts0 - MWCodeGen_X86_profile0 - MWLinker_X86_runtimeCustom - MWCodeGen_X86_readonlystrings0 - - - MWLinker_X86_subsysmajorid4 - MWLinker_X86_subsysminorid0 - MWCOFF_X86_opsysmajorid4 - MWCOFF_X86_opsysminorid0 - MWLinker_X86_usrmajorid0 - MWLinker_X86_usrminorid0 - MWProject_X86_maxstacksize1024 - MWProject_X86_minstacksize4 - MWProject_X86_size1024 - MWProject_X86_minsize4 - MWCOFF_X86_coff_flags0 - MWCOFF_X86_dll_flags0 - MWProject_X86_baseaddress4194304 - MWCOFF_X86_filealign512 - MWCOFF_X86_sectionalign4096 - - - PDisasmX86_showHeaderstrue - PDisasmX86_showSectHeaderstrue - PDisasmX86_showSymTabtrue - PDisasmX86_showCodetrue - PDisasmX86_showDatatrue - PDisasmX86_showDebugfalse - PDisasmX86_showExceptionsfalse - PDisasmX86_showRawfalse - PDisasmX86_showAllRawfalse - PDisasmX86_showSourcefalse - PDisasmX86_showRelocationtrue - PDisasmX86_showHextrue - PDisasmX86_showCommentsfalse - PDisasmX86_showSymDefstrue - PDisasmX86_unmangletrue - PDisasmX86_verbosetrue - PDisasmX86_resolveRelocstrue - PDisasmX86_resolveLocalsfalse - - - MWDebugger_X86_Exceptions - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - - - - GlobalOptimizer_X86_optimizationlevelLevel0 - GlobalOptimizer_X86_optforSpeed - - - MWLinker_X86_entrypointusageDefault - MWLinker_X86_entrypoint - MWLinker_X86_subsystemWinGUI - MWLinker_X86_commandfile - MWLinker_X86_generatemap0 - MWLinker_X86_linksym0 - MWLinker_X86_linkCV1 - MWLinker_X86_symfullpathfalse - MWLinker_X86_linkdebugtrue - MWLinker_X86_checksumfalse - MWLinker_X86_zero_init_bssfalse - MWLinker_X86_mergedatafalse - MWLinker_X86_usedefaultlibsfalse - MWLinker_X86_adddefaultlibsfalse - MWLinker_X86_nowarningsfalse - MWLinker_X86_verbosefalse - - - MWProject_X86_typeApplication - MWProject_X86_outfileNONAME.EXE - MWProject_X86_importlib - MWProject_X86_setimportlibdirfalse - MWProject_X86_dontgenerateimportlibfalse - MWProject_X86_oldformatlibfalse - MWProject_X86_replaceobjextensionfalse - MWProject_X86_copyallfilesfalse - - - - Name - regcomp.c - Unix - Text - - - - Name - regfree.c - Unix - Text - - - - Name - regerror.c - Unix - Text - - - - Name - regexec.c - Unix - Text - - - - - - Name - regcomp.c - Unix - - - Name - regfree.c - Unix - - - Name - regerror.c - Unix - - - Name - regexec.c - Unix - - - - - Mach-O - - - - UserSourceTrees - - - AlwaysSearchUserPathstrue - InterpretDOSAndUnixPathstrue - RequireFrameworkStyleIncludesfalse - UserSearchPaths - - SearchPath - Path: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path../../include - PathFormatUnix - PathRootProject - - Recursivefalse - FrameworkPathfalse - HostFlagsAll - - - SystemSearchPaths - - SearchPath - PathMacOS X Support/Headers/(wchar_t Support fix) - PathFormatUnix - PathRootCodeWarrior - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Pathusr/include - PathFormatUnix - PathRootOS X Volume - - Recursivefalse - FrameworkPathfalse - HostFlagsAll - - - SearchPath - PathMSL/MSL_C - PathFormatUnix - PathRootCodeWarrior - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - PathMSL/MSL_C++ - PathFormatUnix - PathRootCodeWarrior - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - PathMacOS X Support - PathFormatUnix - PathRootCodeWarrior - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - - - MWRuntimeSettings_WorkingDirectory - MWRuntimeSettings_CommandLine - MWRuntimeSettings_HostApplication - Path - PathFormatGeneric - PathRootAbsolute - - MWRuntimeSettings_EnvVars - - - LinkerMacOS X PPC Linker - PreLinker - PostLinker - TargetnameMach-O - OutputDirectory - Path:::lib: - PathFormatMacOS - PathRootProject - - SaveEntriesUsingRelativePathsfalse - - - FileMappings - - FileTypeAPPL - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypeAppl - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypeMDYL - FileExtension - CompilerMachO Importer - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeMLIB - FileExtension - CompilerMachO Importer - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeMMLB - FileExtension - CompilerMachO Importer - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeMPLF - FileExtension - CompilerMachO Importer - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeMWCD - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypeRSRC - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.arr - Compiler - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.axp - Compiler - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.c - CompilerMW C/C++ PPC Mac OS X - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.c++ - CompilerMW C/C++ PPC Mac OS X - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.cc - CompilerMW C/C++ PPC Mac OS X - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.cp - CompilerMW C/C++ PPC Mac OS X - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.cpp - CompilerMW C/C++ PPC Mac OS X - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.exp - Compiler - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.h - CompilerMW C/C++ PPC Mac OS X - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMaketrue - - - FileTypeTEXT - FileExtension.h++ - CompilerMW C/C++ PPC Mac OS X - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMaketrue - - - FileTypeTEXT - FileExtension.hpp - CompilerMW C/C++ PPC Mac OS X - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMaketrue - - - FileTypeTEXT - FileExtension.lcf - Compiler - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.m - CompilerMW C/C++ PPC Mac OS X - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.mm - CompilerMW C/C++ PPC Mac OS X - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.pch - CompilerMW C/C++ PPC Mac OS X - EditLanguageC/C++ - Precompiletrue - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.pch++ - CompilerMW C/C++ PPC Mac OS X - EditLanguageC/C++ - Precompiletrue - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.pchm - CompilerMW C/C++ PPC Mac OS X - EditLanguageC/C++ - Precompiletrue - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.pchmm - CompilerMW C/C++ PPC Mac OS X - EditLanguageC/C++ - Precompiletrue - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.plc - CompilerProperty List Compiler - EditLanguageProperty List - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.ploc - CompilerProperty List Compiler - EditLanguageProperty List - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.r - CompilerRez - EditLanguageRez - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.wke - Compiler - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypedocu - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypersrc - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileExtension.a - CompilerMachO Importer - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileExtension.doc - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFilefalse - IgnoredByMaketrue - - - FileExtension.dylib - CompilerMachO Importer - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileExtension.gif - CompilerCopy To Package - EditLanguage - Precompilefalse - Launchabletrue - ResourceFilefalse - IgnoredByMaketrue - - - FileExtension.icns - CompilerCopy To Package - EditLanguage - Precompilefalse - Launchabletrue - ResourceFilefalse - IgnoredByMaketrue - - - FileExtension.jpg - CompilerCopy To Package - EditLanguage - Precompilefalse - Launchabletrue - ResourceFilefalse - IgnoredByMaketrue - - - FileExtension.lib - CompilerMachO Importer - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileExtension.nib - CompilerCopy To Package - EditLanguage - Precompilefalse - Launchabletrue - ResourceFilefalse - IgnoredByMaketrue - - - FileExtension.pl - CompilerPerl Tool - EditLanguagePerl - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileExtension.plist - CompilerCopy To Package - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMaketrue - - - FileExtension.ppob - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileExtension.psh - CompilerShell Tool - EditLanguage - Precompiletrue - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileExtension.rsrc - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileExtension.sh - CompilerShell Tool - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileExtension.strings - CompilerCopy To Package - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMaketrue - - - FileExtension.tiff - CompilerCopy To Package - EditLanguage - Precompilefalse - Launchabletrue - ResourceFilefalse - IgnoredByMaketrue - - - - - CacheModDatestrue - DumpBrowserInfofalse - CacheSubprojectstrue - UseThirdPartyDebuggerfalse - BrowserGenerator1 - DebuggerAppPath - Path - PathFormatGeneric - PathRootAbsolute - - DebuggerCmdLineArgs - DebuggerWorkingDir - Path - PathFormatGeneric - PathRootAbsolute - - CodeCompletionPrefixFileNameMacHeaders.c - CodeCompletionMacroFileNameMacOS_Carbon_C++_Macros.h - - - ConsoleEncoding0 - LogSystemMessagestrue - AutoTargetDLLsfalse - StopAtWatchpointstrue - PauseWhileRunningfalse - PauseInterval5 - PauseUIFlags0 - AltExePath - Path - PathFormatGeneric - PathRootAbsolute - - StopAtTempBPOnLaunchtrue - CacheSymbolicstrue - TempBPFunctionNamemain - TempBPType0 - - - Enabledfalse - ConnectionName - DownloadPath - LaunchRemoteAppfalse - RemoteAppPath - CoreID0 - JTAGClockSpeed8000 - IsMultiCorefalse - OSDownloadfalse - UseGlobalOSDownloadfalse - OSDownloadConnectionName - OSDownloadPath - AltDownloadfalse - AltDownloadConnectionName - - - OtherExecutables - - - CustomColor1 - Red0 - Green32767 - Blue0 - - CustomColor2 - Red0 - Green32767 - Blue0 - - CustomColor3 - Red0 - Green32767 - Blue0 - - CustomColor4 - Red0 - Green32767 - Blue0 - - - - MWFrontEnd_C_cplusplus0 - MWFrontEnd_C_checkprotos0 - MWFrontEnd_C_arm0 - MWFrontEnd_C_trigraphs0 - MWFrontEnd_C_onlystdkeywords0 - MWFrontEnd_C_enumsalwaysint0 - MWFrontEnd_C_mpwpointerstyle0 - MWFrontEnd_C_prefixnamewx_cwc.pch - MWFrontEnd_C_ansistrict0 - MWFrontEnd_C_mpwcnewline0 - MWFrontEnd_C_wchar_type1 - MWFrontEnd_C_enableexceptions1 - MWFrontEnd_C_dontreusestrings0 - MWFrontEnd_C_poolstrings0 - MWFrontEnd_C_dontinline0 - MWFrontEnd_C_useRTTI1 - MWFrontEnd_C_multibyteaware0 - MWFrontEnd_C_unsignedchars0 - MWFrontEnd_C_autoinline0 - MWFrontEnd_C_booltruefalse1 - MWFrontEnd_C_inlinelevel0 - MWFrontEnd_C_ecplusplus0 - MWFrontEnd_C_objective_c0 - MWFrontEnd_C_defer_codegen0 - MWFrontEnd_C_templateparser0 - MWFrontEnd_C_c990 - MWFrontEnd_C_bottomupinline1 - - - MWWarning_C_warn_illpragma0 - MWWarning_C_warn_emptydecl0 - MWWarning_C_warn_possunwant0 - MWWarning_C_warn_unusedvar0 - MWWarning_C_warn_unusedarg0 - MWWarning_C_warn_extracomma0 - MWWarning_C_pedantic0 - MWWarning_C_warningerrors0 - MWWarning_C_warn_hidevirtual0 - MWWarning_C_warn_implicitconv0 - MWWarning_C_warn_notinlined0 - MWWarning_C_warn_structclass0 - - - MWFTP_Post_hostName - MWFTP_Post_username - MWFTP_Post_password0ÿÀ°¯p"²¸ - MWFTP_Post_remoteDir - MWFTP_Post_ftp_PathVersion1 - MWFTP_Post_ftp_PathType0 - MWFTP_Post_ftp_PathFormat0 - MWFTP_Post_ftp_tree - MWFTP_Post_uploadDir - MWFTP_Post_ftp_port21 - MWFTP_Post_SendBin1 - MWFTP_Post_ShouldLog1 - - - MWCommandLine_Java_clsName - MWCommandLine_Java_args - - - MWVJavaDebugging_Protocol1 - MWVJavaDebugging_JDKVersion1 - MWVJavaDebugging_TimeOut25 - MWVJavaDebugging_SupportSlowDevicesfalse - MWVJavaDebugging_UseRemoteLaunchAgentfalse - MWVJavaDebugging_LaunchVMasServerfalse - - - MWJava_Language_optimizefalse - MWJava_Language_warnDeprecatedfalse - MWJava_Language_emitMapfalse - MWJava_Language_strictFileNamesfalse - MWJava_Language_strictFileHierarchyfalse - MWJava_Language_1_1_Compatiblefalse - MWJava_Language_emitHeaders0 - MWJava_Language_headerTypeJNINativeHeaders - MWJava_Language_packageFilter - MWJava_Language_genCommentstrue - MWJava_Language_genHeadersfalse - MWJava_Language_enableAssertsfalse - MWJava_Language_targetVM1.1 - - - Manifest-JAD Attributes - - AttributeMain-Class - ValueAuto-Generated - - - - - MWJava_MRJAppBuilder_outFileMRJApplication - MWJava_MRJAppBuilder_mergefalse - MWJava_MRJAppBuilder_quitMenutrue - MWJava_MRJAppBuilder_growfalse - MWJava_MRJAppBuilder_stdoutTypeConsole - MWJava_MRJAppBuilder_stderrTypeConsole - MWJava_MRJAppBuilder_stdinTypeConsole - MWJava_MRJAppBuilder_appIconPVersion0 - MWJava_MRJAppBuilder_appIconPType0 - MWJava_MRJAppBuilder_appIconPFormat0 - MWJava_MRJAppBuilder_appIconPTree - MWJava_MRJAppBuilder_appIconFile - MWJava_MRJAppBuilder_splashScreenPVersion0 - MWJava_MRJAppBuilder_splashScreenPType0 - MWJava_MRJAppBuilder_splashScreenPFormat0 - MWJava_MRJAppBuilder_splashScreenPTree - MWJava_MRJAppBuilder_splashScreenPICTFile - MWJava_MRJAppBuilder_aboutName - MWJava_MRJAppBuilder_stdoutPVersion0 - MWJava_MRJAppBuilder_stdoutPType0 - MWJava_MRJAppBuilder_stdoutPFormat0 - MWJava_MRJAppBuilder_stdoutPTree - MWJava_MRJAppBuilder_stdoutFile - MWJava_MRJAppBuilder_stdoutAppendfalse - MWJava_MRJAppBuilder_stderrPType0 - MWJava_MRJAppBuilder_stderrPFormat0 - MWJava_MRJAppBuilder_stderrPTree - MWJava_MRJAppBuilder_stderrFile - MWJava_MRJAppBuilder_stderrAppendfalse - MWJava_MRJAppBuilder_stdinPType0 - MWJava_MRJAppBuilder_stdinPFormat0 - MWJava_MRJAppBuilder_stdinPTree - MWJava_MRJAppBuilder_stdinFile - - - MWJava_Output_outputtypeJarFile - MWJava_Output_outfileJavaClasses.jar - MWJava_Output_ftype1514754080 - MWJava_Output_fcreator1297570384 - MWJava_Output_compress0 - MWJava_Output_genManifest0 - MWJava_Output_trunctypeFront - MWJava_Output_deleteClasses0 - MWJava_Output_consoleApp1 - MWJava_Output_preverify0 - MWJava_Output_genJad0 - MWJava_Output_obfuscate0 - - - MWJava_Proj_projtypeApplet - MWJava_Proj_mainClassName - MWJava_Proj_HTMLAppCreator1145457748 - MWJava_Proj_HTMLAppNameMetrowerks Java - MWJava_Proj_PathVersion1 - MWJava_Proj_PathType0 - MWJava_Proj_PathFormat0 - MWJava_Proj_tree - MWJava_Proj_HTMLAppWin32NameInternet Explorer - MWJava_Proj_compress0 - MWJava_Proj_simulator0 - MWJava_Proj_useVM\000\000macosx - MWJava_Proj_vmarguments - MWJava_Proj_vmName - MWJava_Proj_simPropFile - - - MWJavaDoc_Proj_Version1 - MWJavaDoc_Proj_Deprecated1 - MWJavaDoc_Proj_Author1 - MWJavaDoc_Proj_Index1 - MWJavaDoc_Proj_Tree1 - MWJavaDoc_Proj_SunResolveToSame0 - MWJavaDoc_Proj_Shortnames1 - MWJavaDoc_Proj_Folder0 - MWJavaDoc_Proj_GenerateAPILinks0 - MWJavaDoc_Proj_scopePublic - MWJavaDoc_Proj_fcreator1229278547 - MWJavaDoc_Proj_encodingName - MWJavaDoc_Proj_decodingName - MWJavaDoc_Proj_javaPackagePathhttp://java.sun.com/products/jdk/1.1/docs/api/ - - - MWMerge_MacOS_projectTypeApplication - MWMerge_MacOS_outputNameMerge Out - MWMerge_MacOS_outputCreator???? - MWMerge_MacOS_outputTypeAPPL - MWMerge_MacOS_suppressWarning0 - MWMerge_MacOS_copyFragments1 - MWMerge_MacOS_copyResources1 - MWMerge_MacOS_flattenResource0 - MWMerge_MacOS_flatFileNamea.rsrc - MWMerge_MacOS_flatFileOutputPath - Path: - PathFormatMacOS - PathRootProject - - MWMerge_MacOS_skipResources - DLGX - ckid - Proj - WSPC - - - - FileLockedfalse - ResourcesMapIsReadOnlyfalse - PrinterDriverIsMultiFinderCompatiblefalse - Invisiblefalse - HasBundlefalse - NameLockedfalse - Stationeryfalse - HasCustomIconfalse - Sharedfalse - HasBeenInitedfalse - Label0 - Comments - - - MWMacOSPackager_UsePackager0 - MWMacOSPackager_FolderToPackage - Path - PathFormatMacOS - PathRootAbsolute - - MWMacOSPackager_CreateClassicAlias0 - MWMacOSPackager_ClassicAliasMethodUseTargetOutput - MWMacOSPackager_ClassicAliasPath - Path - PathFormatMacOS - PathRootAbsolute - - MWMacOSPackager_CreatePkgInfo0 - MWMacOSPackager_PkgCreatorType???? - MWMacOSPackager_PkgFileTypeAPPL - - - MWCodeGen_PPC_structalignmentPPC_mw - MWCodeGen_PPC_tracebacktablesInline - MWCodeGen_PPC_processorGeneric - MWCodeGen_PPC_function_align4 - MWCodeGen_PPC_tocdata1 - MWCodeGen_PPC_largetoc0 - MWCodeGen_PPC_profiler0 - MWCodeGen_PPC_vectortocdata0 - MWCodeGen_PPC_poolconst0 - MWCodeGen_PPC_peephole1 - MWCodeGen_PPC_readonlystrings0 - MWCodeGen_PPC_linkerpoolsstrings0 - MWCodeGen_PPC_volatileasm0 - MWCodeGen_PPC_schedule0 - MWCodeGen_PPC_altivec0 - MWCodeGen_PPC_altivec_move_block0 - MWCodeGen_PPC_strictIEEEfp0 - MWCodeGen_PPC_fpcontract1 - MWCodeGen_PPC_genfsel0 - MWCodeGen_PPC_orderedfpcmp0 - - - MWCodeGen_MachO_structalignmentPPC_mw - MWCodeGen_MachO_profiler_enumOff - MWCodeGen_MachO_processorGeneric - MWCodeGen_MachO_function_align4 - MWCodeGen_MachO_common0 - MWCodeGen_MachO_peephole1 - MWCodeGen_MachO_readonlystrings0 - MWCodeGen_MachO_linkerpoolsstrings1 - MWCodeGen_MachO_volatileasm0 - MWCodeGen_MachO_schedule0 - MWCodeGen_MachO_altivec0 - MWCodeGen_MachO_vecmove0 - MWCodeGen_MachO_fp_ieee_strict0 - MWCodeGen_MachO_fpcontract1 - MWCodeGen_MachO_genfsel0 - MWCodeGen_MachO_fp_cmps_ordered0 - - - MWDisassembler_PPC_showcode1 - MWDisassembler_PPC_extended1 - MWDisassembler_PPC_mix0 - MWDisassembler_PPC_nohex0 - MWDisassembler_PPC_showdata1 - MWDisassembler_PPC_showexceptions1 - MWDisassembler_PPC_showsym0 - MWDisassembler_PPC_shownames1 - - - GlobalOptimizer_PPC_optimizationlevelLevel2 - GlobalOptimizer_PPC_optforSpeed - - - MWLinker_PPC_linksym1 - MWLinker_PPC_symfullpath1 - MWLinker_PPC_linkmap1 - MWLinker_PPC_nolinkwarnings0 - MWLinker_PPC_dontdeadstripinitcode0 - MWLinker_PPC_permitmultdefs0 - MWLinker_PPC_linkmodeFast - MWLinker_PPC_initname - MWLinker_PPC_mainname__start - MWLinker_PPC_termname - - - MWLinker_MacOSX_linksym0 - MWLinker_MacOSX_symfullpath0 - MWLinker_MacOSX_nolinkwarnings0 - MWLinker_MacOSX_linkmap0 - MWLinker_MacOSX_dontdeadstripinitcode0 - MWLinker_MacOSX_permitmultdefs1 - MWLinker_MacOSX_use_objectivec_semantics0 - MWLinker_MacOSX_strip_debug_symbols0 - MWLinker_MacOSX_split_segs0 - MWLinker_MacOSX_report_msl_overloads0 - MWLinker_MacOSX_objects_follow_linkorder0 - MWLinker_MacOSX_linkmodeFast - MWLinker_MacOSX_exportsReferencedGlobals - MWLinker_MacOSX_sortcodeNone - MWLinker_MacOSX_mainnamestart - - - MWProject_MacOSX_typeLibrary - MWProject_MacOSX_outfileregex_MACH.lib - MWProject_MacOSX_filecreator???? - MWProject_MacOSX_filetype???? - MWProject_MacOSX_vmaddress0 - MWProject_MacOSX_usedefaultvmaddr1 - MWProject_MacOSX_flatrsrc0 - MWProject_MacOSX_flatrsrcfilename - MWProject_MacOSX_flatrsrcoutputdir - Path: - PathFormatMacOS - PathRootProject - - MWProject_MacOSX_installpath./ - MWProject_MacOSX_dont_prebind0 - MWProject_MacOSX_flat_namespace0 - MWProject_MacOSX_frameworkversionA - MWProject_MacOSX_currentversion0 - MWProject_MacOSX_flat_oldimpversion0 - - - MWLinker_MachO_exportsNone - MWLinker_MachO_mainnamestart - MWLinker_MachO_currentversion0 - MWLinker_MachO_compatibleversion0 - MWLinker_MachO_symfullpath0 - MWLinker_MachO_supresswarnings0 - MWLinker_MachO_multisymerror0 - MWLinker_MachO_prebind1 - MWLinker_MachO_deadstrip1 - MWLinker_MachO_objectivecsemantics0 - MWLinker_MachO_whichfileloaded0 - MWLinker_MachO_whyfileloaded0 - MWLinker_MachO_readonlyrelocsErrors - MWLinker_MachO_undefinedsymbolsErrors - MWLinker_MachO_twolevelnamespace1 - MWLinker_MachO_stripdebugsymbols0 - - - MWProject_MachO_typeExecutable - MWProject_MachO_outfilea.exe - MWProject_MachO_filecreator???? - MWProject_MachO_filetypeMEXE - MWProject_MachO_vmaddress4096 - MWProject_MachO_flatrsrc1 - MWProject_MachO_flatrsrcfilenamea.rsrc - MWProject_MachO_flatrsrcoutputdir - Path: - PathFormatMacOS - PathRootProject - - MWProject_MachO_installpath./ - MWProject_MachO_frameworkversion - - - MWPEF_exportsNone - MWPEF_libfolder0 - MWPEF_sortcodeNone - MWPEF_expandbss0 - MWPEF_sharedata0 - MWPEF_olddefversion0 - MWPEF_oldimpversion0 - MWPEF_currentversion0 - MWPEF_fragmentname - MWPEF_collapsereloads0 - - - MWProject_PPC_typeLibrary - MWProject_PPC_outfileregex_PPC.lib - MWProject_PPC_filecreator???? - MWProject_PPC_filetype???? - MWProject_PPC_size0 - MWProject_PPC_minsize0 - MWProject_PPC_stacksize0 - MWProject_PPC_flags0 - MWProject_PPC_symfilename - MWProject_PPC_rsrcname - MWProject_PPC_rsrcheaderNative - MWProject_PPC_rsrctype???? - MWProject_PPC_rsrcid0 - MWProject_PPC_rsrcflags0 - MWProject_PPC_rsrcstore0 - MWProject_PPC_rsrcmerge0 - MWProject_PPC_flatrsrc0 - MWProject_PPC_flatrsrcoutputdir - Path: - PathFormatMacOS - PathRootProject - - MWProject_PPC_flatrsrcfilename - - - MWAssembler_PPC_auxheader0 - MWAssembler_PPC_symmodeMac - MWAssembler_PPC_dialectPPC - MWAssembler_PPC_prefixfile - MWAssembler_PPC_typecheck0 - MWAssembler_PPC_warnings0 - MWAssembler_PPC_casesensitive0 - - - PList_OutputTypeFile - PList_OutputEncodingUTF-8 - PList_Prefix - PList_FileFilenameInfo.plist - PList_FileDirectory - Path: - PathFormatMacOS - PathRootProject - - PList_ResourceTypeplst - PList_ResourceID0 - PList_ResourceName - - - MWRez_Language_maxwidth80 - MWRez_Language_scriptRoman - MWRez_Language_alignmentAlign1 - MWRez_Language_filtermodeFilterSkip - MWRez_Language_suppresswarnings0 - MWRez_Language_escapecontrolchars1 - MWRez_Language_prefixname - MWRez_Language_filteredtypes'CODE' 'DATA' 'PICT' - - - MWWinRC_prefixname - - - MWCodeGen_X86_processorGeneric - MWCodeGen_X86_alignmentbytes8 - MWCodeGen_X86_exceptionsZeroOverhead - MWCodeGen_X86_name_manglingMWWin32 - MWCodeGen_X86_use_extinst0 - MWCodeGen_X86_extinst_mmx0 - MWCodeGen_X86_extinst_3dnow0 - MWCodeGen_X86_use_mmx_3dnow_convention0 - MWCodeGen_X86_extinst_cmov0 - MWCodeGen_X86_extinst_sse0 - MWCodeGen_X86_extinst_sse20 - MWCodeGen_X86_intrinsics0 - MWCodeGen_X86_optimizeasm0 - MWCodeGen_X86_disableopts0 - MWCodeGen_X86_profile0 - MWLinker_X86_runtimeCustom - MWCodeGen_X86_readonlystrings0 - - - MWLinker_X86_subsysmajorid4 - MWLinker_X86_subsysminorid0 - MWCOFF_X86_opsysmajorid4 - MWCOFF_X86_opsysminorid0 - MWLinker_X86_usrmajorid0 - MWLinker_X86_usrminorid0 - MWProject_X86_maxstacksize1024 - MWProject_X86_minstacksize4 - MWProject_X86_size1024 - MWProject_X86_minsize4 - MWCOFF_X86_coff_flags0 - MWCOFF_X86_dll_flags0 - MWProject_X86_baseaddress4194304 - MWCOFF_X86_filealign512 - MWCOFF_X86_sectionalign4096 - - - PDisasmX86_showHeaderstrue - PDisasmX86_showSectHeaderstrue - PDisasmX86_showSymTabtrue - PDisasmX86_showCodetrue - PDisasmX86_showDatatrue - PDisasmX86_showDebugfalse - PDisasmX86_showExceptionsfalse - PDisasmX86_showRawfalse - PDisasmX86_showAllRawfalse - PDisasmX86_showSourcefalse - PDisasmX86_showRelocationtrue - PDisasmX86_showHextrue - PDisasmX86_showCommentsfalse - PDisasmX86_showSymDefstrue - PDisasmX86_unmangletrue - PDisasmX86_verbosetrue - PDisasmX86_resolveRelocstrue - PDisasmX86_resolveLocalsfalse - - - MWDebugger_X86_Exceptions - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - - - - GlobalOptimizer_X86_optimizationlevelLevel0 - GlobalOptimizer_X86_optforSpeed - - - MWLinker_X86_entrypointusageDefault - MWLinker_X86_entrypoint - MWLinker_X86_subsystemWinGUI - MWLinker_X86_commandfile - MWLinker_X86_generatemap0 - MWLinker_X86_linksym0 - MWLinker_X86_linkCV1 - MWLinker_X86_symfullpathfalse - MWLinker_X86_linkdebugtrue - MWLinker_X86_checksumfalse - MWLinker_X86_zero_init_bssfalse - MWLinker_X86_mergedatafalse - MWLinker_X86_usedefaultlibsfalse - MWLinker_X86_adddefaultlibsfalse - MWLinker_X86_nowarningsfalse - MWLinker_X86_verbosefalse - - - MWProject_X86_typeApplication - MWProject_X86_outfileNONAME.EXE - MWProject_X86_importlib - MWProject_X86_setimportlibdirfalse - MWProject_X86_dontgenerateimportlibfalse - MWProject_X86_oldformatlibfalse - MWProject_X86_replaceobjextensionfalse - MWProject_X86_copyallfilesfalse - - - - Name - regcomp.c - Unix - Text - - - - Name - regfree.c - Unix - Text - - - - Name - regerror.c - Unix - Text - - - - Name - regexec.c - Unix - Text - - - - - - Name - regcomp.c - Unix - - - Name - regfree.c - Unix - - - Name - regerror.c - Unix - - - Name - regexec.c - Unix - - - - - - - PPC - Mach-O - - - - - PPC - Name - regcomp.c - Unix - - - PPC - Name - regfree.c - Unix - - - PPC - Name - regerror.c - Unix - - - PPC - Name - regexec.c - Unix - - - - diff --git a/wxWidgets/src/regex/regexec.c b/wxWidgets/src/regex/regexec.c deleted file mode 100644 index 41d49bdab5..0000000000 --- a/wxWidgets/src/regex/regexec.c +++ /dev/null @@ -1,1038 +0,0 @@ -/* - * re_*exec and friends - match REs - * - * Copyright (c) 1998, 1999 Henry Spencer. All rights reserved. - * - * Development of this software was funded, in part, by Cray Research Inc., - * UUNET Communications Services Inc., Sun Microsystems Inc., and Scriptics - * Corporation, none of whom are responsible for the results. The author - * thanks all of them. - * - * Redistribution and use in source and binary forms -- with or without - * modification -- are permitted for any purpose, provided that - * redistributions in source form retain this entire copyright notice and - * indicate the origin and nature of any modifications. - * - * I'd appreciate being given credit for this package in the documentation - * of software which uses it, but that is not a requirement. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL - * HENRY SPENCER BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; - * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "regguts.h" - - - -/* lazy-DFA representation */ -struct arcp { /* "pointer" to an outarc */ - struct sset *ss; - color co; -}; - -struct sset { /* state set */ - unsigned *states; /* pointer to bitvector */ - unsigned hash; /* hash of bitvector */ -# define HASH(bv, nw) (((nw) == 1) ? *(bv) : hash(bv, nw)) -# define HIT(h,bv,ss,nw) ((ss)->hash == (h) && ((nw) == 1 || \ - memcmp(VS(bv), VS((ss)->states), (nw)*sizeof(unsigned)) == 0)) - int flags; -# define STARTER 01 /* the initial state set */ -# define POSTSTATE 02 /* includes the goal state */ -# define LOCKED 04 /* locked in cache */ -# define NOPROGRESS 010 /* zero-progress state set */ - struct arcp ins; /* chain of inarcs pointing here */ - chr *lastseen; /* last entered on arrival here */ - struct sset **outs; /* outarc vector indexed by color */ - struct arcp *inchain; /* chain-pointer vector for outarcs */ -}; - -struct dfa { - int nssets; /* size of cache */ - int nssused; /* how many entries occupied yet */ - int nstates; /* number of states */ - int ncolors; /* length of outarc and inchain vectors */ - int wordsper; /* length of state-set bitvectors */ - struct sset *ssets; /* state-set cache */ - unsigned *statesarea; /* bitvector storage */ - unsigned *work; /* pointer to work area within statesarea */ - struct sset **outsarea; /* outarc-vector storage */ - struct arcp *incarea; /* inchain storage */ - struct cnfa *cnfa; - struct colormap *cm; - chr *lastpost; /* location of last cache-flushed success */ - chr *lastnopr; /* location of last cache-flushed NOPROGRESS */ - struct sset *search; /* replacement-search-pointer memory */ - int cptsmalloced; /* were the areas individually malloced? */ - char *mallocarea; /* self, or master malloced area, or NULL */ -}; - -#define WORK 1 /* number of work bitvectors needed */ - -/* setup for non-malloc allocation for small cases */ -#define FEWSTATES 20 /* must be less than UBITS */ -#define FEWCOLORS 15 -struct smalldfa { - struct dfa dfa; - struct sset ssets[FEWSTATES*2]; - unsigned statesarea[FEWSTATES*2 + WORK]; - struct sset *outsarea[FEWSTATES*2 * FEWCOLORS]; - struct arcp incarea[FEWSTATES*2 * FEWCOLORS]; -}; -#define DOMALLOC ((struct smalldfa *)NULL) /* force malloc */ - - - -/* internal variables, bundled for easy passing around */ -struct vars { - regex_t *re; - struct guts *g; - int eflags; /* copies of arguments */ - size_t nmatch; - regmatch_t *pmatch; - rm_detail_t *details; - chr *start; /* start of string */ - chr *stop; /* just past end of string */ - int err; /* error code if any (0 none) */ - regoff_t *mem; /* memory vector for backtracking */ - struct smalldfa dfa1; - struct smalldfa dfa2; -}; -#define VISERR(vv) ((vv)->err != 0) /* have we seen an error yet? */ -#define ISERR() VISERR(v) -#define VERR(vv,e) (((vv)->err) ? (vv)->err : ((vv)->err = (e))) -#define ERR(e) VERR(v, e) /* record an error */ -#define NOERR() {if (ISERR()) return v->err;} /* if error seen, return it */ -#define OFF(p) ((p) - v->start) -#define LOFF(p) ((long)OFF(p)) - - - -/* - * forward declarations - */ -/* =====^!^===== begin forwards =====^!^===== */ -/* automatically gathered by fwd; do not hand-edit */ -/* === regexec.c === */ -int exec _ANSI_ARGS_((regex_t *, CONST chr *, size_t, rm_detail_t *, size_t, regmatch_t [], int)); -static int find _ANSI_ARGS_((struct vars *, struct cnfa *, struct colormap *)); -static int cfind _ANSI_ARGS_((struct vars *, struct cnfa *, struct colormap *)); -static int cfindloop _ANSI_ARGS_((struct vars *, struct cnfa *, struct colormap *, struct dfa *, struct dfa *, chr **)); -static VOID zapsubs _ANSI_ARGS_((regmatch_t *, size_t)); -static VOID zapmem _ANSI_ARGS_((struct vars *, struct subre *)); -static VOID subset _ANSI_ARGS_((struct vars *, struct subre *, chr *, chr *)); -static int dissect _ANSI_ARGS_((struct vars *, struct subre *, chr *, chr *)); -static int condissect _ANSI_ARGS_((struct vars *, struct subre *, chr *, chr *)); -static int altdissect _ANSI_ARGS_((struct vars *, struct subre *, chr *, chr *)); -static int cdissect _ANSI_ARGS_((struct vars *, struct subre *, chr *, chr *)); -static int ccondissect _ANSI_ARGS_((struct vars *, struct subre *, chr *, chr *)); -static int crevdissect _ANSI_ARGS_((struct vars *, struct subre *, chr *, chr *)); -static int cbrdissect _ANSI_ARGS_((struct vars *, struct subre *, chr *, chr *)); -static int caltdissect _ANSI_ARGS_((struct vars *, struct subre *, chr *, chr *)); -/* === rege_dfa.c === */ -static chr *longest _ANSI_ARGS_((struct vars *, struct dfa *, chr *, chr *, int *)); -static chr *shortest _ANSI_ARGS_((struct vars *, struct dfa *, chr *, chr *, chr *, chr **, int *)); -static chr *lastcold _ANSI_ARGS_((struct vars *, struct dfa *)); -static struct dfa *newdfa _ANSI_ARGS_((struct vars *, struct cnfa *, struct colormap *, struct smalldfa *)); -static VOID freedfa _ANSI_ARGS_((struct dfa *)); -static unsigned hash _ANSI_ARGS_((unsigned *, int)); -static struct sset *initialize _ANSI_ARGS_((struct vars *, struct dfa *, chr *)); -static struct sset *miss _ANSI_ARGS_((struct vars *, struct dfa *, struct sset *, pcolor, chr *, chr *)); -static int lacon _ANSI_ARGS_((struct vars *, struct cnfa *, chr *, pcolor)); -static struct sset *getvacant _ANSI_ARGS_((struct vars *, struct dfa *, chr *, chr *)); -static struct sset *pickss _ANSI_ARGS_((struct vars *, struct dfa *, chr *, chr *)); -/* automatically gathered by fwd; do not hand-edit */ -/* =====^!^===== end forwards =====^!^===== */ - - - -/* - - exec - match regular expression - ^ int exec(regex_t *, CONST chr *, size_t, rm_detail_t *, - ^ size_t, regmatch_t [], int); - */ -int -exec(re, string, len, details, nmatch, pmatch, flags) -regex_t *re; -CONST chr *string; -size_t len; -rm_detail_t *details; -size_t nmatch; -regmatch_t pmatch[]; -int flags; -{ - struct vars var; - register struct vars *v = &var; - int st; - size_t n; - int backref; -# define LOCALMAT 20 - regmatch_t mat[LOCALMAT]; -# define LOCALMEM 40 - regoff_t mem[LOCALMEM]; - - /* sanity checks */ - if (re == NULL || string == NULL || re->re_magic != REMAGIC) - return REG_INVARG; - if (re->re_csize != sizeof(chr)) - return REG_MIXED; - - /* setup */ - v->re = re; - v->g = (struct guts *)re->re_guts; - if ((v->g->cflags®_EXPECT) && details == NULL) - return REG_INVARG; - if (v->g->info®_UIMPOSSIBLE) - return REG_NOMATCH; - backref = (v->g->info®_UBACKREF) ? 1 : 0; - v->eflags = flags; - if (v->g->cflags®_NOSUB) - nmatch = 0; /* override client */ - v->nmatch = nmatch; - if (backref) { - /* need work area */ - if (v->g->nsub + 1 <= LOCALMAT) - v->pmatch = mat; - else - v->pmatch = (regmatch_t *)MALLOC((v->g->nsub + 1) * - sizeof(regmatch_t)); - if (v->pmatch == NULL) - return REG_ESPACE; - v->nmatch = v->g->nsub + 1; - } else - v->pmatch = pmatch; - v->details = details; - v->start = (chr *)string; - v->stop = (chr *)string + len; - v->err = 0; - if (backref) { - /* need retry memory */ - assert(v->g->ntree >= 0); - n = (size_t)v->g->ntree; - if (n <= LOCALMEM) - v->mem = mem; - else - v->mem = (regoff_t *)MALLOC(n*sizeof(regoff_t)); - if (v->mem == NULL) { - if (v->pmatch != pmatch && v->pmatch != mat) - FREE(v->pmatch); - return REG_ESPACE; - } - } else - v->mem = NULL; - - /* do it */ - assert(v->g->tree != NULL); - if (backref) - st = cfind(v, &v->g->tree->cnfa, &v->g->cmap); - else - st = find(v, &v->g->tree->cnfa, &v->g->cmap); - - /* copy (portion of) match vector over if necessary */ - if (st == REG_OKAY && v->pmatch != pmatch && nmatch > 0) { - zapsubs(pmatch, nmatch); - n = (nmatch < v->nmatch) ? nmatch : v->nmatch; - memcpy(VS(pmatch), VS(v->pmatch), n*sizeof(regmatch_t)); - } - - /* clean up */ - if (v->pmatch != pmatch && v->pmatch != mat) - FREE(v->pmatch); - if (v->mem != NULL && v->mem != mem) - FREE(v->mem); - return st; -} - -/* - - find - find a match for the main NFA (no-complications case) - ^ static int find(struct vars *, struct cnfa *, struct colormap *); - */ -static int -find(v, cnfa, cm) -struct vars *v; -struct cnfa *cnfa; -struct colormap *cm; -{ - struct dfa *s; - struct dfa *d; - chr *begin; - chr *end = NULL; - chr *cold; - chr *open; /* open and close of range of possible starts */ - chr *close; - int hitend; - int shorter = (v->g->tree->flags&SHORTER) ? 1 : 0; - - /* first, a shot with the search RE */ - s = newdfa(v, &v->g->search, cm, &v->dfa1); - assert(!(ISERR() && s != NULL)); - NOERR(); - MDEBUG(("\nsearch at %ld\n", LOFF(v->start))); - cold = NULL; - close = shortest(v, s, v->start, v->start, v->stop, &cold, (int *)NULL); - freedfa(s); - NOERR(); - if (v->g->cflags®_EXPECT) { - assert(v->details != NULL); - if (cold != NULL) - v->details->rm_extend.rm_so = OFF(cold); - else - v->details->rm_extend.rm_so = OFF(v->stop); - v->details->rm_extend.rm_eo = OFF(v->stop); /* unknown */ - } - if (close == NULL) /* not found */ - return REG_NOMATCH; - if (v->nmatch == 0) /* found, don't need exact location */ - return REG_OKAY; - - /* find starting point and match */ - assert(cold != NULL); - open = cold; - cold = NULL; - MDEBUG(("between %ld and %ld\n", LOFF(open), LOFF(close))); - d = newdfa(v, cnfa, cm, &v->dfa1); - assert(!(ISERR() && d != NULL)); - NOERR(); - for (begin = open; begin <= close; begin++) { - MDEBUG(("\nfind trying at %ld\n", LOFF(begin))); - if (shorter) - end = shortest(v, d, begin, begin, v->stop, - (chr **)NULL, &hitend); - else - end = longest(v, d, begin, v->stop, &hitend); - NOERR(); - if (hitend && cold == NULL) - cold = begin; - if (end != NULL) - break; /* NOTE BREAK OUT */ - } - assert(end != NULL); /* search RE succeeded so loop should */ - freedfa(d); - - /* and pin down details */ - assert(v->nmatch > 0); - v->pmatch[0].rm_so = OFF(begin); - v->pmatch[0].rm_eo = OFF(end); - if (v->g->cflags®_EXPECT) { - if (cold != NULL) - v->details->rm_extend.rm_so = OFF(cold); - else - v->details->rm_extend.rm_so = OFF(v->stop); - v->details->rm_extend.rm_eo = OFF(v->stop); /* unknown */ - } - if (v->nmatch == 1) /* no need for submatches */ - return REG_OKAY; - - /* submatches */ - zapsubs(v->pmatch, v->nmatch); - return dissect(v, v->g->tree, begin, end); -} - -/* - - cfind - find a match for the main NFA (with complications) - ^ static int cfind(struct vars *, struct cnfa *, struct colormap *); - */ -static int -cfind(v, cnfa, cm) -struct vars *v; -struct cnfa *cnfa; -struct colormap *cm; -{ - struct dfa *s; - struct dfa *d; - chr *cold; - int ret; - - s = newdfa(v, &v->g->search, cm, &v->dfa1); - NOERR(); - d = newdfa(v, cnfa, cm, &v->dfa2); - if (ISERR()) { - assert(d == NULL); - freedfa(s); - return v->err; - } - - ret = cfindloop(v, cnfa, cm, d, s, &cold); - - freedfa(d); - freedfa(s); - NOERR(); - if (v->g->cflags®_EXPECT) { - assert(v->details != NULL); - if (cold != NULL) - v->details->rm_extend.rm_so = OFF(cold); - else - v->details->rm_extend.rm_so = OFF(v->stop); - v->details->rm_extend.rm_eo = OFF(v->stop); /* unknown */ - } - return ret; -} - -/* - - cfindloop - the heart of cfind - ^ static int cfindloop(struct vars *, struct cnfa *, struct colormap *, - ^ struct dfa *, struct dfa *, chr **); - */ -static int -cfindloop(v, cnfa, cm, d, s, coldp) -struct vars *v; -struct cnfa *cnfa; -struct colormap *cm; -struct dfa *d; -struct dfa *s; -chr **coldp; /* where to put coldstart pointer */ -{ - chr *begin; - chr *end; - chr *cold; - chr *open; /* open and close of range of possible starts */ - chr *close; - chr *estart; - chr *estop; - int er; - int shorter = v->g->tree->flags&SHORTER; - int hitend; - - assert(d != NULL && s != NULL); - cold = NULL; - close = v->start; - do { - MDEBUG(("\ncsearch at %ld\n", LOFF(close))); - close = shortest(v, s, close, close, v->stop, &cold, (int *)NULL); - if (close == NULL) - break; /* NOTE BREAK */ - assert(cold != NULL); - open = cold; - cold = NULL; - MDEBUG(("cbetween %ld and %ld\n", LOFF(open), LOFF(close))); - for (begin = open; begin <= close; begin++) { - MDEBUG(("\ncfind trying at %ld\n", LOFF(begin))); - estart = begin; - estop = v->stop; - for (;;) { - if (shorter) - end = shortest(v, d, begin, estart, - estop, (chr **)NULL, &hitend); - else - end = longest(v, d, begin, estop, - &hitend); - if (hitend && cold == NULL) - cold = begin; - if (end == NULL) - break; /* NOTE BREAK OUT */ - MDEBUG(("tentative end %ld\n", LOFF(end))); - zapsubs(v->pmatch, v->nmatch); - zapmem(v, v->g->tree); - er = cdissect(v, v->g->tree, begin, end); - if (er == REG_OKAY) { - if (v->nmatch > 0) { - v->pmatch[0].rm_so = OFF(begin); - v->pmatch[0].rm_eo = OFF(end); - } - *coldp = cold; - return REG_OKAY; - } - if (er != REG_NOMATCH) { - ERR(er); - return er; - } - if ((shorter) ? end == estop : end == begin) { - /* no point in trying again */ - *coldp = cold; - return REG_NOMATCH; - } - /* go around and try again */ - if (shorter) - estart = end + 1; - else - estop = end - 1; - } - } - } while (close < v->stop); - - *coldp = cold; - return REG_NOMATCH; -} - -/* - - zapsubs - initialize the subexpression matches to "no match" - ^ static VOID zapsubs(regmatch_t *, size_t); - */ -static VOID -zapsubs(p, n) -regmatch_t *p; -size_t n; -{ - size_t i; - - for (i = n-1; i > 0; i--) { - p[i].rm_so = -1; - p[i].rm_eo = -1; - } -} - -/* - - zapmem - initialize the retry memory of a subtree to zeros - ^ static VOID zapmem(struct vars *, struct subre *); - */ -static VOID -zapmem(v, t) -struct vars *v; -struct subre *t; -{ - if (t == NULL) - return; - - assert(v->mem != NULL); - v->mem[t->retry] = 0; - if (t->op == '(') { - assert(t->subno > 0); - v->pmatch[t->subno].rm_so = -1; - v->pmatch[t->subno].rm_eo = -1; - } - - if (t->left != NULL) - zapmem(v, t->left); - if (t->right != NULL) - zapmem(v, t->right); -} - -/* - - subset - set any subexpression relevant to a successful subre - ^ static VOID subset(struct vars *, struct subre *, chr *, chr *); - */ -static VOID -subset(v, sub, begin, end) -struct vars *v; -struct subre *sub; -chr *begin; -chr *end; -{ - int n = sub->subno; - - assert(n > 0); - if ((size_t)n >= v->nmatch) - return; - - MDEBUG(("setting %d\n", n)); - v->pmatch[n].rm_so = OFF(begin); - v->pmatch[n].rm_eo = OFF(end); -} - -/* - - dissect - determine subexpression matches (uncomplicated case) - ^ static int dissect(struct vars *, struct subre *, chr *, chr *); - */ -static int /* regexec return code */ -dissect(v, t, begin, end) -struct vars *v; -struct subre *t; -chr *begin; /* beginning of relevant substring */ -chr *end; /* end of same */ -{ - assert(t != NULL); - MDEBUG(("dissect %ld-%ld\n", LOFF(begin), LOFF(end))); - - switch (t->op) { - case '=': /* terminal node */ - assert(t->left == NULL && t->right == NULL); - return REG_OKAY; /* no action, parent did the work */ - break; - case '|': /* alternation */ - assert(t->left != NULL); - return altdissect(v, t, begin, end); - break; - case 'b': /* back ref -- shouldn't be calling us! */ - return REG_ASSERT; - break; - case '.': /* concatenation */ - assert(t->left != NULL && t->right != NULL); - return condissect(v, t, begin, end); - break; - case '(': /* capturing */ - assert(t->left != NULL && t->right == NULL); - assert(t->subno > 0); - subset(v, t, begin, end); - return dissect(v, t->left, begin, end); - break; - default: - return REG_ASSERT; - break; - } -} - -/* - - condissect - determine concatenation subexpression matches (uncomplicated) - ^ static int condissect(struct vars *, struct subre *, chr *, chr *); - */ -static int /* regexec return code */ -condissect(v, t, begin, end) -struct vars *v; -struct subre *t; -chr *begin; /* beginning of relevant substring */ -chr *end; /* end of same */ -{ - struct dfa *d; - struct dfa *d2; - chr *mid; - int i; - int shorter = (t->left->flags&SHORTER) ? 1 : 0; - chr *stop = (shorter) ? end : begin; - - assert(t->op == '.'); - assert(t->left != NULL && t->left->cnfa.nstates > 0); - assert(t->right != NULL && t->right->cnfa.nstates > 0); - - d = newdfa(v, &t->left->cnfa, &v->g->cmap, &v->dfa1); - NOERR(); - d2 = newdfa(v, &t->right->cnfa, &v->g->cmap, &v->dfa2); - if (ISERR()) { - assert(d2 == NULL); - freedfa(d); - return v->err; - } - - /* pick a tentative midpoint */ - if (shorter) - mid = shortest(v, d, begin, begin, end, (chr **)NULL, - (int *)NULL); - else - mid = longest(v, d, begin, end, (int *)NULL); - if (mid == NULL) { - freedfa(d); - freedfa(d2); - return REG_ASSERT; - } - MDEBUG(("tentative midpoint %ld\n", LOFF(mid))); - - /* iterate until satisfaction or failure */ - while (longest(v, d2, mid, end, (int *)NULL) != end) { - /* that midpoint didn't work, find a new one */ - if (mid == stop) { - /* all possibilities exhausted! */ - MDEBUG(("no midpoint!\n")); - freedfa(d); - freedfa(d2); - return REG_ASSERT; - } - if (shorter) - mid = shortest(v, d, begin, mid+1, end, (chr **)NULL, - (int *)NULL); - else - mid = longest(v, d, begin, mid-1, (int *)NULL); - if (mid == NULL) { - /* failed to find a new one! */ - MDEBUG(("failed midpoint!\n")); - freedfa(d); - freedfa(d2); - return REG_ASSERT; - } - MDEBUG(("new midpoint %ld\n", LOFF(mid))); - } - - /* satisfaction */ - MDEBUG(("successful\n")); - freedfa(d); - freedfa(d2); - i = dissect(v, t->left, begin, mid); - if (i != REG_OKAY) - return i; - return dissect(v, t->right, mid, end); -} - -/* - - altdissect - determine alternative subexpression matches (uncomplicated) - ^ static int altdissect(struct vars *, struct subre *, chr *, chr *); - */ -static int /* regexec return code */ -altdissect(v, t, begin, end) -struct vars *v; -struct subre *t; -chr *begin; /* beginning of relevant substring */ -chr *end; /* end of same */ -{ - struct dfa *d; - int i; - - assert(t != NULL); - assert(t->op == '|'); - - for (i = 0; t != NULL; t = t->right, i++) { - MDEBUG(("trying %dth\n", i)); - assert(t->left != NULL && t->left->cnfa.nstates > 0); - d = newdfa(v, &t->left->cnfa, &v->g->cmap, &v->dfa1); - if (ISERR()) - return v->err; - if (longest(v, d, begin, end, (int *)NULL) == end) { - MDEBUG(("success\n")); - freedfa(d); - return dissect(v, t->left, begin, end); - } - freedfa(d); - } - return REG_ASSERT; /* none of them matched?!? */ -} - -/* - - cdissect - determine subexpression matches (with complications) - * The retry memory stores the offset of the trial midpoint from begin, - * plus 1 so that 0 uniquely means "clean slate". - ^ static int cdissect(struct vars *, struct subre *, chr *, chr *); - */ -static int /* regexec return code */ -cdissect(v, t, begin, end) -struct vars *v; -struct subre *t; -chr *begin; /* beginning of relevant substring */ -chr *end; /* end of same */ -{ - int er; - - assert(t != NULL); - MDEBUG(("cdissect %ld-%ld %c\n", LOFF(begin), LOFF(end), t->op)); - - switch (t->op) { - case '=': /* terminal node */ - assert(t->left == NULL && t->right == NULL); - return REG_OKAY; /* no action, parent did the work */ - break; - case '|': /* alternation */ - assert(t->left != NULL); - return caltdissect(v, t, begin, end); - break; - case 'b': /* back ref -- shouldn't be calling us! */ - assert(t->left == NULL && t->right == NULL); - return cbrdissect(v, t, begin, end); - break; - case '.': /* concatenation */ - assert(t->left != NULL && t->right != NULL); - return ccondissect(v, t, begin, end); - break; - case '(': /* capturing */ - assert(t->left != NULL && t->right == NULL); - assert(t->subno > 0); - er = cdissect(v, t->left, begin, end); - if (er == REG_OKAY) - subset(v, t, begin, end); - return er; - break; - default: - return REG_ASSERT; - break; - } -} - -/* - - ccondissect - concatenation subexpression matches (with complications) - * The retry memory stores the offset of the trial midpoint from begin, - * plus 1 so that 0 uniquely means "clean slate". - ^ static int ccondissect(struct vars *, struct subre *, chr *, chr *); - */ -static int /* regexec return code */ -ccondissect(v, t, begin, end) -struct vars *v; -struct subre *t; -chr *begin; /* beginning of relevant substring */ -chr *end; /* end of same */ -{ - struct dfa *d; - struct dfa *d2; - chr *mid; - int er; - - assert(t->op == '.'); - assert(t->left != NULL && t->left->cnfa.nstates > 0); - assert(t->right != NULL && t->right->cnfa.nstates > 0); - - if (t->left->flags&SHORTER) /* reverse scan */ - return crevdissect(v, t, begin, end); - - d = newdfa(v, &t->left->cnfa, &v->g->cmap, DOMALLOC); - if (ISERR()) - return v->err; - d2 = newdfa(v, &t->right->cnfa, &v->g->cmap, DOMALLOC); - if (ISERR()) { - freedfa(d); - return v->err; - } - MDEBUG(("cconcat %d\n", t->retry)); - - /* pick a tentative midpoint */ - if (v->mem[t->retry] == 0) { - mid = longest(v, d, begin, end, (int *)NULL); - if (mid == NULL) { - freedfa(d); - freedfa(d2); - return REG_NOMATCH; - } - MDEBUG(("tentative midpoint %ld\n", LOFF(mid))); - v->mem[t->retry] = (mid - begin) + 1; - } else { - mid = begin + (v->mem[t->retry] - 1); - MDEBUG(("working midpoint %ld\n", LOFF(mid))); - } - - /* iterate until satisfaction or failure */ - for (;;) { - /* try this midpoint on for size */ - er = cdissect(v, t->left, begin, mid); - if (er == REG_OKAY && - longest(v, d2, mid, end, (int *)NULL) == end && - (er = cdissect(v, t->right, mid, end)) == - REG_OKAY) - break; /* NOTE BREAK OUT */ - if (er != REG_OKAY && er != REG_NOMATCH) { - freedfa(d); - freedfa(d2); - return er; - } - - /* that midpoint didn't work, find a new one */ - if (mid == begin) { - /* all possibilities exhausted */ - MDEBUG(("%d no midpoint\n", t->retry)); - freedfa(d); - freedfa(d2); - return REG_NOMATCH; - } - mid = longest(v, d, begin, mid-1, (int *)NULL); - if (mid == NULL) { - /* failed to find a new one */ - MDEBUG(("%d failed midpoint\n", t->retry)); - freedfa(d); - freedfa(d2); - return REG_NOMATCH; - } - MDEBUG(("%d: new midpoint %ld\n", t->retry, LOFF(mid))); - v->mem[t->retry] = (mid - begin) + 1; - zapmem(v, t->left); - zapmem(v, t->right); - } - - /* satisfaction */ - MDEBUG(("successful\n")); - freedfa(d); - freedfa(d2); - return REG_OKAY; -} - -/* - - crevdissect - determine backref shortest-first subexpression matches - * The retry memory stores the offset of the trial midpoint from begin, - * plus 1 so that 0 uniquely means "clean slate". - ^ static int crevdissect(struct vars *, struct subre *, chr *, chr *); - */ -static int /* regexec return code */ -crevdissect(v, t, begin, end) -struct vars *v; -struct subre *t; -chr *begin; /* beginning of relevant substring */ -chr *end; /* end of same */ -{ - struct dfa *d; - struct dfa *d2; - chr *mid; - int er; - - assert(t->op == '.'); - assert(t->left != NULL && t->left->cnfa.nstates > 0); - assert(t->right != NULL && t->right->cnfa.nstates > 0); - assert(t->left->flags&SHORTER); - - /* concatenation -- need to split the substring between parts */ - d = newdfa(v, &t->left->cnfa, &v->g->cmap, DOMALLOC); - if (ISERR()) - return v->err; - d2 = newdfa(v, &t->right->cnfa, &v->g->cmap, DOMALLOC); - if (ISERR()) { - freedfa(d); - return v->err; - } - MDEBUG(("crev %d\n", t->retry)); - - /* pick a tentative midpoint */ - if (v->mem[t->retry] == 0) { - mid = shortest(v, d, begin, begin, end, (chr **)NULL, (int *)NULL); - if (mid == NULL) { - freedfa(d); - freedfa(d2); - return REG_NOMATCH; - } - MDEBUG(("tentative midpoint %ld\n", LOFF(mid))); - v->mem[t->retry] = (mid - begin) + 1; - } else { - mid = begin + (v->mem[t->retry] - 1); - MDEBUG(("working midpoint %ld\n", LOFF(mid))); - } - - /* iterate until satisfaction or failure */ - for (;;) { - /* try this midpoint on for size */ - er = cdissect(v, t->left, begin, mid); - if (er == REG_OKAY && - longest(v, d2, mid, end, (int *)NULL) == end && - (er = cdissect(v, t->right, mid, end)) == - REG_OKAY) - break; /* NOTE BREAK OUT */ - if (er != REG_OKAY && er != REG_NOMATCH) { - freedfa(d); - freedfa(d2); - return er; - } - - /* that midpoint didn't work, find a new one */ - if (mid == end) { - /* all possibilities exhausted */ - MDEBUG(("%d no midpoint\n", t->retry)); - freedfa(d); - freedfa(d2); - return REG_NOMATCH; - } - mid = shortest(v, d, begin, mid+1, end, (chr **)NULL, (int *)NULL); - if (mid == NULL) { - /* failed to find a new one */ - MDEBUG(("%d failed midpoint\n", t->retry)); - freedfa(d); - freedfa(d2); - return REG_NOMATCH; - } - MDEBUG(("%d: new midpoint %ld\n", t->retry, LOFF(mid))); - v->mem[t->retry] = (mid - begin) + 1; - zapmem(v, t->left); - zapmem(v, t->right); - } - - /* satisfaction */ - MDEBUG(("successful\n")); - freedfa(d); - freedfa(d2); - return REG_OKAY; -} - -/* - - cbrdissect - determine backref subexpression matches - ^ static int cbrdissect(struct vars *, struct subre *, chr *, chr *); - */ -static int /* regexec return code */ -cbrdissect(v, t, begin, end) -struct vars *v; -struct subre *t; -chr *begin; /* beginning of relevant substring */ -chr *end; /* end of same */ -{ - int i; - int n = t->subno; - size_t len; - chr *paren; - chr *p; - chr *stop; - int min = t->min; - int max = t->max; - - assert(t != NULL); - assert(t->op == 'b'); - assert(n >= 0); - assert((size_t)n < v->nmatch); - - MDEBUG(("cbackref n%d %d{%d-%d}\n", t->retry, n, min, max)); - - if (v->pmatch[n].rm_so == -1) - return REG_NOMATCH; - paren = v->start + v->pmatch[n].rm_so; - len = v->pmatch[n].rm_eo - v->pmatch[n].rm_so; - - /* no room to maneuver -- retries are pointless */ - if (v->mem[t->retry]) - return REG_NOMATCH; - v->mem[t->retry] = 1; - - /* special-case zero-length string */ - if (len == 0) { - if (begin == end) - return REG_OKAY; - return REG_NOMATCH; - } - - /* and too-short string */ - assert(end >= begin); - if ((size_t)(end - begin) < len) - return REG_NOMATCH; - stop = end - len; - - /* count occurrences */ - i = 0; - for (p = begin; p <= stop && (i < max || max == INFINITY); p += len) { - if ((*v->g->compare)(paren, p, len) != 0) - break; - i++; - } - MDEBUG(("cbackref found %d\n", i)); - - /* and sort it out */ - if (p != end) /* didn't consume all of it */ - return REG_NOMATCH; - if (min <= i && (i <= max || max == INFINITY)) - return REG_OKAY; - return REG_NOMATCH; /* out of range */ -} - -/* - - caltdissect - determine alternative subexpression matches (w. complications) - ^ static int caltdissect(struct vars *, struct subre *, chr *, chr *); - */ -static int /* regexec return code */ -caltdissect(v, t, begin, end) -struct vars *v; -struct subre *t; -chr *begin; /* beginning of relevant substring */ -chr *end; /* end of same */ -{ - struct dfa *d; - int er; -# define UNTRIED 0 /* not yet tried at all */ -# define TRYING 1 /* top matched, trying submatches */ -# define TRIED 2 /* top didn't match or submatches exhausted */ - - if (t == NULL) - return REG_NOMATCH; - assert(t->op == '|'); - if (v->mem[t->retry] == TRIED) - return caltdissect(v, t->right, begin, end); - - MDEBUG(("calt n%d\n", t->retry)); - assert(t->left != NULL); - - if (v->mem[t->retry] == UNTRIED) { - d = newdfa(v, &t->left->cnfa, &v->g->cmap, DOMALLOC); - if (ISERR()) - return v->err; - if (longest(v, d, begin, end, (int *)NULL) != end) { - freedfa(d); - v->mem[t->retry] = TRIED; - return caltdissect(v, t->right, begin, end); - } - freedfa(d); - MDEBUG(("calt matched\n")); - v->mem[t->retry] = TRYING; - } - - er = cdissect(v, t->left, begin, end); - if (er != REG_NOMATCH) - return er; - - v->mem[t->retry] = TRIED; - return caltdissect(v, t->right, begin, end); -} - - - -#include "rege_dfa.c" diff --git a/wxWidgets/src/regex/regfree.c b/wxWidgets/src/regex/regfree.c deleted file mode 100644 index d4590075a4..0000000000 --- a/wxWidgets/src/regex/regfree.c +++ /dev/null @@ -1,53 +0,0 @@ -/* - * regfree - free an RE - * - * Copyright (c) 1998, 1999 Henry Spencer. All rights reserved. - * - * Development of this software was funded, in part, by Cray Research Inc., - * UUNET Communications Services Inc., Sun Microsystems Inc., and Scriptics - * Corporation, none of whom are responsible for the results. The author - * thanks all of them. - * - * Redistribution and use in source and binary forms -- with or without - * modification -- are permitted for any purpose, provided that - * redistributions in source form retain this entire copyright notice and - * indicate the origin and nature of any modifications. - * - * I'd appreciate being given credit for this package in the documentation - * of software which uses it, but that is not a requirement. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL - * HENRY SPENCER BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; - * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * - * - * You might think that this could be incorporated into regcomp.c, and - * that would be a reasonable idea... except that this is a generic - * function (with a generic name), applicable to all compiled REs - * regardless of the size of their characters, whereas the stuff in - * regcomp.c gets compiled once per character size. - */ - -#include "regguts.h" - -/* - - regfree - free an RE (generic function, punts to RE-specific function) - * - * Ignoring invocation with NULL is a convenience. - */ -VOID -wx_regfree(re) -regex_t *re; -{ - if (re == NULL) - return; - (*((struct fns *)re->re_fns)->free)(re); -} diff --git a/wxWidgets/src/regex/regfronts.c b/wxWidgets/src/regex/regfronts.c deleted file mode 100644 index 82f48e2abc..0000000000 --- a/wxWidgets/src/regex/regfronts.c +++ /dev/null @@ -1,83 +0,0 @@ -/* - * regcomp and regexec - front ends to re_ routines - * - * Mostly for implementation of backward-compatibility kludges. Note - * that these routines exist ONLY in char versions. - * - * Copyright (c) 1998, 1999 Henry Spencer. All rights reserved. - * - * Development of this software was funded, in part, by Cray Research Inc., - * UUNET Communications Services Inc., Sun Microsystems Inc., and Scriptics - * Corporation, none of whom are responsible for the results. The author - * thanks all of them. - * - * Redistribution and use in source and binary forms -- with or without - * modification -- are permitted for any purpose, provided that - * redistributions in source form retain this entire copyright notice and - * indicate the origin and nature of any modifications. - * - * I'd appreciate being given credit for this package in the documentation - * of software which uses it, but that is not a requirement. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL - * HENRY SPENCER BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; - * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "regguts.h" - -/* - - regcomp - compile regular expression - */ -int -regcomp(re, str, flags) -regex_t *re; -CONST char *str; -int flags; -{ - size_t len; - int f = flags; - - if (f®_PEND) { - len = re->re_endp - str; - f &= ~REG_PEND; - } else - len = strlen(str); - - return re_comp(re, str, len, f); -} - -/* - - regexec - execute regular expression - */ -int -regexec(re, str, nmatch, pmatch, flags) -regex_t *re; -CONST char *str; -size_t nmatch; -regmatch_t pmatch[]; -int flags; -{ - CONST char *start; - size_t len; - int f = flags; - - if (f®_STARTEND) { - start = str + pmatch[0].rm_so; - len = pmatch[0].rm_eo - pmatch[0].rm_so; - f &= ~REG_STARTEND; - } else { - start = str; - len = strlen(str); - } - - return re_exec(re, start, len, nmatch, pmatch, f); -} diff --git a/wxWidgets/src/regex/regguts.h b/wxWidgets/src/regex/regguts.h deleted file mode 100644 index be5041d920..0000000000 --- a/wxWidgets/src/regex/regguts.h +++ /dev/null @@ -1,416 +0,0 @@ -/* - * Internal interface definitions, etc., for the reg package - * - * Copyright (c) 1998, 1999 Henry Spencer. All rights reserved. - * - * Development of this software was funded, in part, by Cray Research Inc., - * UUNET Communications Services Inc., Sun Microsystems Inc., and Scriptics - * Corporation, none of whom are responsible for the results. The author - * thanks all of them. - * - * Redistribution and use in source and binary forms -- with or without - * modification -- are permitted for any purpose, provided that - * redistributions in source form retain this entire copyright notice and - * indicate the origin and nature of any modifications. - * - * I'd appreciate being given credit for this package in the documentation - * of software which uses it, but that is not a requirement. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL - * HENRY SPENCER BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; - * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - - - -/* - * Environmental customization. It should not (I hope) be necessary to - * alter the file you are now reading -- regcustom.h should handle it all, - * given care here and elsewhere. - */ -#include "regcustom.h" - -/* - * Things that regcustom.h might override. - */ - -/* standard header files (NULL is a reasonable indicator for them) */ -#ifndef NULL -#include -#include -#include -#include -#include -#endif - -/* assertions */ -#ifndef assert -# ifndef REG_DEBUG -# define NDEBUG /* no assertions */ -# endif -#include -#endif - -/* voids */ -#ifndef VOID -#define VOID void /* for function return values */ -#endif -#ifndef DISCARD -#define DISCARD VOID /* for throwing values away */ -#endif -#ifndef PVOID -#define PVOID VOID * /* generic pointer */ -#endif -#ifndef VS -#define VS(x) ((PVOID)(x)) /* cast something to generic ptr */ -#endif -#ifndef NOPARMS -#define NOPARMS VOID /* for empty parm lists */ -#endif - -/* const */ -#ifndef CONST -#define CONST const /* for old compilers, might be empty */ -#endif - -/* function-pointer declarator */ -#ifndef FUNCPTR -#if __STDC__ >= 1 -#define FUNCPTR(name, args) (*name)args -#else -#define FUNCPTR(name, args) (*name)() -#endif -#endif - -/* memory allocation */ -#ifndef MALLOC -#define MALLOC(n) malloc(n) -#endif -#ifndef REALLOC -#define REALLOC(p, n) realloc(VS(p), n) -#endif -#ifndef FREE -#define FREE(p) free(VS(p)) -#endif - -/* want size of a char in bits, and max value in bounded quantifiers */ -#ifndef CHAR_BIT -#include -#endif -#ifndef _POSIX2_RE_DUP_MAX -#define _POSIX2_RE_DUP_MAX 255 /* normally from */ -#endif - - - -/* - * misc - */ - -#define NOTREACHED 0 -#define xxx 1 - -#define DUPMAX _POSIX2_RE_DUP_MAX -#define INFINITY (DUPMAX+1) - -#define REMAGIC 0xfed7 /* magic number for main struct */ - - - -/* - * debugging facilities - */ -#ifdef REG_DEBUG -/* FDEBUG does finite-state tracing */ -#define FDEBUG(arglist) { if (v->eflags®_FTRACE) printf arglist; } -/* MDEBUG does higher-level tracing */ -#define MDEBUG(arglist) { if (v->eflags®_MTRACE) printf arglist; } -#else -#define FDEBUG(arglist) {} -#define MDEBUG(arglist) {} -#endif - - - -/* - * bitmap manipulation - */ -#define UBITS (CHAR_BIT * sizeof(unsigned)) -#define BSET(uv, sn) ((uv)[(sn)/UBITS] |= (unsigned)1 << ((sn)%UBITS)) -#define ISBSET(uv, sn) ((uv)[(sn)/UBITS] & ((unsigned)1 << ((sn)%UBITS))) - - - -/* - * We dissect a chr into byts for colormap table indexing. Here we define - * a byt, which will be the same as a byte on most machines... The exact - * size of a byt is not critical, but about 8 bits is good, and extraction - * of 8-bit chunks is sometimes especially fast. - */ -#ifndef BYTBITS -#define BYTBITS 8 /* bits in a byt */ -#endif -#define BYTTAB (1<flags&FREECOL) - union tree *block; /* block of solid color, if any */ -}; - -/* the color map itself */ -struct colormap { - int magic; -# define CMMAGIC 0x876 - struct vars *v; /* for compile error reporting */ - size_t ncds; /* number of colordescs */ - size_t max; /* highest in use */ - color free; /* beginning of free chain (if non-0) */ - struct colordesc *cd; -# define CDEND(cm) (&(cm)->cd[(cm)->max + 1]) -# define NINLINECDS ((size_t)10) - struct colordesc cdspace[NINLINECDS]; - union tree tree[NBYTS]; /* tree top, plus fill blocks */ -}; - -/* optimization magic to do fast chr->color mapping */ -#define B0(c) ((c) & BYTMASK) -#define B1(c) (((c)>>BYTBITS) & BYTMASK) -#define B2(c) (((c)>>(2*BYTBITS)) & BYTMASK) -#define B3(c) (((c)>>(3*BYTBITS)) & BYTMASK) -#if NBYTS == 1 -#define GETCOLOR(cm, c) ((cm)->tree->tcolor[B0(c)]) -#endif -/* beware, for NBYTS>1, GETCOLOR() is unsafe -- 2nd arg used repeatedly */ -#if NBYTS == 2 -#define GETCOLOR(cm, c) ((cm)->tree->tptr[B1(c)]->tcolor[B0(c)]) -#endif -#if NBYTS == 4 -#define GETCOLOR(cm, c) ((cm)->tree->tptr[B3(c)]->tptr[B2(c)]->tptr[B1(c)]->tcolor[B0(c)]) -#endif - - - -/* - * Interface definitions for locale-interface functions in locale.c. - * Multi-character collating elements (MCCEs) cause most of the trouble. - */ -struct cvec { - int nchrs; /* number of chrs */ - int chrspace; /* number of chrs possible */ - chr *chrs; /* pointer to vector of chrs */ - int nranges; /* number of ranges (chr pairs) */ - int rangespace; /* number of chrs possible */ - chr *ranges; /* pointer to vector of chr pairs */ - int nmcces; /* number of MCCEs */ - int mccespace; /* number of MCCEs possible */ - int nmccechrs; /* number of chrs used for MCCEs */ - chr *mcces[1]; /* pointers to 0-terminated MCCEs */ - /* and both batches of chrs are on the end */ -}; - -/* caution: this value cannot be changed easily */ -#define MAXMCCE 2 /* length of longest MCCE */ - - - -/* - * definitions for NFA internal representation - * - * Having a "from" pointer within each arc may seem redundant, but it - * saves a lot of hassle. - */ -struct state; - -struct arc { - int type; -# define ARCFREE '\0' - color co; - struct state *from; /* where it's from (and contained within) */ - struct state *to; /* where it's to */ - struct arc *outchain; /* *from's outs chain or free chain */ -# define freechain outchain - struct arc *inchain; /* *to's ins chain */ - struct arc *colorchain; /* color's arc chain */ -}; - -struct arcbatch { /* for bulk allocation of arcs */ - struct arcbatch *next; -# define ABSIZE 10 - struct arc a[ABSIZE]; -}; - -struct state { - int no; -# define FREESTATE (-1) - char flag; /* marks special states */ - int nins; /* number of inarcs */ - struct arc *ins; /* chain of inarcs */ - int nouts; /* number of outarcs */ - struct arc *outs; /* chain of outarcs */ - struct arc *free; /* chain of free arcs */ - struct state *tmp; /* temporary for traversal algorithms */ - struct state *next; /* chain for traversing all */ - struct state *prev; /* back chain */ - struct arcbatch oas; /* first arcbatch, avoid malloc in easy case */ - int noas; /* number of arcs used in first arcbatch */ -}; - -struct nfa { - struct state *pre; /* pre-initial state */ - struct state *init; /* initial state */ - struct state *final; /* final state */ - struct state *post; /* post-final state */ - int nstates; /* for numbering states */ - struct state *states; /* state-chain header */ - struct state *slast; /* tail of the chain */ - struct state *free; /* free list */ - struct colormap *cm; /* the color map */ - color bos[2]; /* colors, if any, assigned to BOS and BOL */ - color eos[2]; /* colors, if any, assigned to EOS and EOL */ - struct vars *v; /* simplifies compile error reporting */ - struct nfa *parent; /* parent NFA, if any */ -}; - - - -/* - * definitions for compacted NFA - */ -struct carc { - color co; /* COLORLESS is list terminator */ - int to; /* state number */ -}; - -struct cnfa { - int nstates; /* number of states */ - int ncolors; /* number of colors */ - int flags; -# define HASLACONS 01 /* uses lookahead constraints */ - int pre; /* setup state number */ - int post; /* teardown state number */ - color bos[2]; /* colors, if any, assigned to BOS and BOL */ - color eos[2]; /* colors, if any, assigned to EOS and EOL */ - struct carc **states; /* vector of pointers to outarc lists */ - struct carc *arcs; /* the area for the lists */ -}; -#define ZAPCNFA(cnfa) ((cnfa).nstates = 0) -#define NULLCNFA(cnfa) ((cnfa).nstates == 0) - - - -/* - * subexpression tree - */ -struct subre { - char op; /* '|', '.' (concat), 'b' (backref), '(', '=' */ - char flags; -# define LONGER 01 /* prefers longer match */ -# define SHORTER 02 /* prefers shorter match */ -# define MIXED 04 /* mixed preference below */ -# define CAP 010 /* capturing parens below */ -# define BACKR 020 /* back reference below */ -# define INUSE 0100 /* in use in final tree */ -# define LOCAL 03 /* bits which may not propagate up */ -# define LMIX(f) ((f)<<2) /* LONGER -> MIXED */ -# define SMIX(f) ((f)<<1) /* SHORTER -> MIXED */ -# define UP(f) (((f)&~LOCAL) | (LMIX(f) & SMIX(f) & MIXED)) -# define MESSY(f) ((f)&(MIXED|CAP|BACKR)) -# define PREF(f) ((f)&LOCAL) -# define PREF2(f1, f2) ((PREF(f1) != 0) ? PREF(f1) : PREF(f2)) -# define COMBINE(f1, f2) (UP((f1)|(f2)) | PREF2(f1, f2)) - short retry; /* index into retry memory */ - int subno; /* subexpression number (for 'b' and '(') */ - short min; /* min repetitions, for backref only */ - short max; /* max repetitions, for backref only */ - struct subre *left; /* left child, if any (also freelist chain) */ - struct subre *right; /* right child, if any */ - struct state *begin; /* outarcs from here... */ - struct state *end; /* ...ending in inarcs here */ - struct cnfa cnfa; /* compacted NFA, if any */ - struct subre *chain; /* for bookkeeping and error cleanup */ -}; - - - -/* - * table of function pointers for generic manipulation functions - * A regex_t's re_fns points to one of these. - */ -struct fns { - VOID FUNCPTR(free, (regex_t *)); -}; - - - -/* - * the insides of a regex_t, hidden behind a void * - */ -struct guts { - int magic; -# define GUTSMAGIC 0xfed9 - int cflags; /* copy of compile flags */ - long info; /* copy of re_info */ - size_t nsub; /* copy of re_nsub */ - struct subre *tree; - struct cnfa search; /* for fast preliminary search */ - int ntree; - struct colormap cmap; - int FUNCPTR(compare, (CONST chr *, CONST chr *, size_t)); - struct subre *lacons; /* lookahead-constraint vector */ - int nlacons; /* size of lacons */ -}; diff --git a/wxWidgets/src/regex/splice.sh b/wxWidgets/src/regex/splice.sh deleted file mode 100644 index d8dc441fbd..0000000000 --- a/wxWidgets/src/regex/splice.sh +++ /dev/null @@ -1,69 +0,0 @@ -#!/bin/sh -############################################################################# -# Name: splice -# Purpose: Splice a marked section of regcustom.h into regex.h -# Author: Mike Wetherell -# RCS-ID: $Id: splice.sh 25868 2004-02-19 17:28:56Z VS $ -# Copyright: (c) 2004 Mike Wetherell -# Licence: wxWindows licence -############################################################################# - -# -# Works by greping for the marks then passing their line numbers to sed. Which -# is slighly the long way round, but allows some error checking. -# - -SRC=regcustom.h -DST=regex.h -MARK1='^/\* --- begin --- \*/$' -MARK2='^/\* --- end --- \*/$' -PROG=`basename $0` -TMP=$DST.tmp - -# findline(pattern, file) -# Prints the line number of the 1st line matching the pattern in the file -# -findline() { - if ! LINE=`grep -n -- "$1" "$2"`; then - echo "$PROG: marker '$1' not found in '$2'" >&2 - return 1 - fi - echo $LINE | sed -n '1s/[^0-9].*//p' # take just the line number -} - -# findmarkers([out] line1, [out] line2, pattern1, pattern2, file) -# Returns (via the variables named in the 1st two parameters) the line -# numbers of the lines matching the patterns in file. Checks pattern1 comes -# before pattern2. -# -findmarkers() { - if ! LINE1=`findline "$3" "$5"` || ! LINE2=`findline "$4" "$5"`; then - return 1 - fi - if [ $LINE1 -ge $LINE2 ]; then - echo "$PROG: marker '$3' not before '$4' in '$5'" >&2 - return 1 - fi - eval $1=$LINE1 - eval $2=$LINE2 -} - -# find markers -# -if findmarkers SRCLINE1 SRCLINE2 "$MARK1" "$MARK2" $SRC && - findmarkers DSTLINE1 DSTLINE2 "$MARK1" "$MARK2" $DST -then - # do splice - # - if (sed $DSTLINE1,\$d $DST && - sed -n $SRCLINE1,${SRCLINE2}p $SRC && - sed 1,${DSTLINE2}d $DST) > $TMP - then - mv $TMP $DST - exit 0 - else - rm $TMP - fi -fi - -exit 1 diff --git a/wxWidgets/src/regex/tclUniData.c b/wxWidgets/src/regex/tclUniData.c deleted file mode 100644 index 99a28b0ea9..0000000000 --- a/wxWidgets/src/regex/tclUniData.c +++ /dev/null @@ -1,904 +0,0 @@ -/* - * tclUniData.c -- - * - * Declarations of Unicode character information tables. This file is - * automatically generated by the tools/uniParse.tcl script. Do not - * modify this file by hand. - * - * Copyright (c) 1998 by Scriptics Corporation. - * All rights reserved. - * - * RCS: @(#) $Id: tclUniData.c 25866 2004-02-19 16:57:15Z VS $ - */ - -/* - * A 16-bit Unicode character is split into two parts in order to index - * into the following tables. The lower OFFSET_BITS comprise an offset - * into a page of characters. The upper bits comprise the page number. - */ - -#define OFFSET_BITS 5 - -/* - * The pageMap is indexed by page number and returns an alternate page number - * that identifies a unique page of characters. Many Unicode characters map - * to the same alternate page number. - */ - -static unsigned char pageMap[] = { - 0, 1, 2, 3, 0, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 7, 15, 16, 17, - 18, 19, 20, 21, 22, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 7, 32, - 7, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 47, - 48, 49, 50, 51, 52, 35, 47, 53, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, - 58, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 80, 81, - 84, 85, 80, 86, 87, 88, 89, 90, 91, 92, 35, 93, 94, 95, 35, 96, 97, - 98, 99, 100, 101, 102, 35, 47, 103, 104, 35, 35, 105, 106, 107, 47, - 47, 108, 47, 47, 109, 47, 110, 111, 47, 112, 47, 113, 114, 115, 116, - 114, 47, 117, 118, 35, 47, 47, 119, 90, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 120, 121, 47, 47, 122, - 35, 35, 35, 35, 47, 123, 124, 125, 126, 47, 127, 128, 47, 129, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 7, 7, 7, 7, 130, 7, 7, 131, 132, 133, 134, - 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, - 149, 150, 151, 152, 153, 154, 155, 156, 156, 156, 156, 156, 156, 156, - 157, 158, 159, 160, 161, 162, 35, 35, 35, 160, 163, 164, 165, 166, - 167, 168, 169, 160, 160, 160, 160, 170, 171, 172, 173, 174, 160, 160, - 175, 35, 35, 35, 35, 176, 177, 178, 179, 180, 181, 35, 35, 160, 160, - 160, 160, 160, 160, 160, 160, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 182, 160, 160, 155, 160, 160, 160, 160, 160, 160, 170, 183, 184, 185, - 90, 47, 186, 90, 47, 187, 188, 189, 47, 47, 190, 128, 35, 35, 191, - 192, 193, 194, 192, 195, 196, 197, 160, 160, 160, 198, 160, 160, 199, - 197, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 200, 35, 35, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 201, 35, 35, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 202, 203, 204, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 205, 35, 35, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, - 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, - 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, - 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, - 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 207, 207, - 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, - 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, - 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, - 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, - 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, - 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, - 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, - 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, - 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, - 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, - 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, - 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, - 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, - 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, - 207, 207, 47, 47, 47, 47, 47, 47, 47, 47, 47, 208, 35, 35, 35, 35, - 35, 35, 209, 210, 211, 47, 47, 212, 213, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 214, 215, 47, 216, 47, 217, 218, 35, 219, 220, 221, 47, - 47, 47, 222, 223, 2, 224, 225, 226, 227, 228, 229, 230, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 231, 35, 232, 233, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 208, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 47, 234, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 235, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, - 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, - 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, - 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, - 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, - 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, - 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, - 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, - 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, - 207, 207, 207, 236, 207, 207, 207, 207, 207, 207, 207, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35 -}; - -/* - * The groupMap is indexed by combining the alternate page number with - * the page offset and returns a group number that identifies a unique - * set of character attributes. - */ - -static unsigned char groupMap[] = { - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 3, 3, 4, 3, 3, 3, 5, 6, 3, 7, 3, 8, - 3, 3, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 3, 3, 7, 7, 7, 3, 3, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 5, 3, 6, 11, 12, 11, 13, 13, 13, 13, 13, 13, - 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, - 13, 13, 13, 5, 7, 6, 7, 1, 2, 3, 4, 4, 4, 4, 14, 14, 11, 14, 15, 16, - 7, 8, 14, 11, 14, 7, 17, 17, 11, 18, 14, 3, 11, 17, 15, 19, 17, 17, - 17, 3, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 10, 7, 10, 10, 10, 10, 10, 10, 10, 15, - 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, - 13, 13, 13, 13, 13, 13, 7, 13, 13, 13, 13, 13, 13, 13, 20, 21, 22, - 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, - 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, - 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 23, 24, 21, 22, 21, - 22, 21, 22, 15, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, - 22, 21, 22, 15, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, - 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, - 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 25, - 21, 22, 21, 22, 21, 22, 26, 15, 27, 21, 22, 21, 22, 28, 21, 22, 29, - 29, 21, 22, 15, 30, 31, 32, 21, 22, 29, 33, 34, 35, 36, 21, 22, 15, - 15, 35, 37, 15, 38, 21, 22, 21, 22, 21, 22, 39, 21, 22, 39, 15, 15, - 21, 22, 39, 21, 22, 40, 40, 21, 22, 21, 22, 41, 21, 22, 15, 42, 21, - 22, 15, 43, 42, 42, 42, 42, 44, 45, 46, 44, 45, 46, 44, 45, 46, 21, - 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 47, 21, - 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, - 15, 44, 45, 46, 21, 22, 48, 49, 21, 22, 21, 22, 21, 22, 21, 22, 0, - 0, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, - 21, 22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 15, 15, 15, 50, 51, 15, 52, 52, 15, 53, 15, - 54, 15, 15, 15, 15, 52, 15, 15, 55, 15, 15, 15, 15, 56, 57, 15, 15, - 15, 15, 15, 57, 15, 15, 58, 15, 15, 59, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 60, 15, 15, 60, 15, 15, 15, 15, 60, 15, 61, 61, 15, 15, - 15, 15, 15, 15, 62, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 0, 0, 63, - 63, 63, 63, 63, 63, 63, 63, 63, 11, 11, 63, 63, 63, 63, 63, 63, 63, - 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 63, 63, 11, - 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 63, 63, 63, 63, - 63, 11, 11, 11, 11, 11, 11, 11, 11, 11, 63, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, - 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, - 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 65, 64, 64, 64, 64, 64, 64, - 64, 64, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 64, - 64, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 11, - 0, 0, 0, 0, 63, 0, 0, 0, 3, 0, 0, 0, 0, 0, 11, 11, 66, 3, 67, 67, 67, - 0, 68, 0, 69, 69, 15, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 0, 10, 10, 10, 10, 10, 10, 10, 10, 10, 70, 71, - 71, 71, 15, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, - 13, 13, 13, 72, 13, 13, 13, 13, 13, 13, 13, 13, 13, 73, 74, 74, 0, - 75, 76, 77, 77, 77, 78, 79, 15, 0, 0, 21, 22, 21, 22, 21, 22, 21, 22, - 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 80, 81, 47, - 15, 82, 83, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 84, 84, 84, 84, 84, 84, 84, - 84, 84, 84, 84, 84, 84, 84, 84, 84, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, - 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, - 13, 13, 13, 13, 13, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, - 81, 81, 81, 81, 21, 22, 14, 64, 64, 64, 64, 0, 85, 85, 0, 0, 21, 22, - 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, - 22, 77, 21, 22, 21, 22, 0, 0, 21, 22, 0, 0, 21, 22, 0, 0, 0, 21, 22, - 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, - 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, - 21, 22, 0, 0, 21, 22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 86, 86, 86, 86, - 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, - 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, - 0, 0, 63, 3, 3, 3, 3, 3, 3, 0, 87, 87, 87, 87, 87, 87, 87, 87, 87, - 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, - 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 15, 0, 3, 8, 0, 0, - 0, 0, 0, 0, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, - 64, 64, 64, 0, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, - 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 0, 64, 64, 64, 3, 64, 3, 64, - 64, 3, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 0, 0, 0, 0, 0, 42, 42, 42, 3, 3, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 3, 0, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 0, 0, 0, 0, 0, 63, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 3, 3, 3, 3, 0, 0, 64, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 3, 42, 64, - 64, 64, 64, 64, 64, 64, 85, 85, 64, 64, 64, 64, 64, 64, 63, 63, 64, - 64, 14, 64, 64, 64, 64, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 42, 42, - 42, 14, 14, 0, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 0, 88, 42, - 64, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 0, 0, 0, 64, 64, 64, 64, - 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, - 64, 64, 64, 64, 64, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 42, 42, 42, 42, 42, 42, 64, 64, 64, 64, 64, 64, 64, - 64, 64, 64, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 64, - 64, 89, 0, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 0, 0, 64, 42, 89, 89, 89, 64, 64, 64, 64, 64, 64, - 64, 64, 89, 89, 89, 89, 64, 0, 0, 42, 64, 64, 64, 64, 0, 0, 0, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 64, 64, 3, 3, 9, 9, 9, 9, 9, 9, - 9, 9, 9, 9, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 64, - 89, 89, 0, 42, 42, 42, 42, 42, 42, 42, 42, 0, 0, 42, 42, 0, 0, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 0, 42, 42, 42, 42, 42, 42, 42, 0, 42, 0, 0, 0, 42, - 42, 42, 42, 0, 0, 64, 0, 89, 89, 89, 64, 64, 64, 64, 0, 0, 89, 89, - 0, 0, 89, 89, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 89, 0, 0, 0, 0, 42, 42, - 0, 42, 42, 42, 64, 64, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 42, 42, - 4, 4, 17, 17, 17, 17, 17, 17, 14, 0, 0, 0, 0, 0, 0, 0, 64, 0, 0, 42, - 42, 42, 42, 42, 42, 0, 0, 0, 0, 42, 42, 0, 0, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 0, - 42, 42, 42, 42, 42, 42, 42, 0, 42, 42, 0, 42, 42, 0, 42, 42, 0, 0, - 64, 0, 89, 89, 89, 64, 64, 0, 0, 0, 0, 64, 64, 0, 0, 64, 64, 64, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 42, 42, 42, 42, 0, 42, 0, 0, 0, 0, 0, - 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 64, 64, 42, 42, 42, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 64, 64, 89, 0, 42, 42, 42, 42, 42, 42, 42, - 0, 42, 0, 42, 42, 42, 0, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 0, 42, 42, 42, 42, 42, - 42, 42, 0, 42, 42, 0, 42, 42, 42, 42, 42, 0, 0, 64, 42, 89, 89, 89, - 64, 64, 64, 64, 64, 0, 64, 64, 89, 0, 89, 89, 64, 0, 0, 42, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 42, 0, 0, 0, 0, 0, 9, 9, 9, 9, - 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 0, 42, 42, 42, 42, 42, 42, 42, 0, 42, - 42, 0, 0, 42, 42, 42, 42, 0, 0, 64, 42, 89, 64, 89, 64, 64, 64, 0, - 0, 0, 89, 89, 0, 0, 89, 89, 64, 0, 0, 0, 0, 0, 0, 0, 0, 64, 89, 0, - 0, 0, 0, 42, 42, 0, 42, 42, 42, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, - 9, 9, 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 64, 89, - 0, 42, 42, 42, 42, 42, 42, 0, 0, 0, 42, 42, 42, 0, 42, 42, 42, 42, - 0, 0, 0, 42, 42, 0, 42, 0, 42, 42, 0, 0, 0, 42, 42, 0, 0, 0, 42, 42, - 42, 0, 0, 0, 42, 42, 42, 42, 42, 42, 42, 42, 0, 42, 42, 42, 0, 0, 0, - 0, 89, 89, 64, 89, 89, 0, 0, 0, 89, 89, 89, 0, 89, 89, 89, 64, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 89, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 17, 17, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 89, 89, 89, 0, 42, 42, 42, 42, 42, 42, 42, 42, 0, 42, - 42, 42, 0, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 0, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 0, 42, 42, 42, 42, 42, 0, 0, 0, 0, 64, 64, 64, 89, 89, - 89, 89, 0, 64, 64, 64, 0, 64, 64, 64, 64, 0, 0, 0, 0, 0, 0, 0, 64, - 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 42, 42, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, - 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 89, - 89, 0, 42, 42, 42, 42, 42, 42, 42, 42, 0, 42, 42, 42, 0, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 0, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 0, 42, 42, 42, - 42, 42, 0, 0, 0, 0, 89, 64, 89, 89, 89, 89, 89, 0, 64, 89, 89, 0, 89, - 89, 64, 64, 0, 0, 0, 0, 0, 0, 0, 89, 89, 0, 0, 0, 0, 0, 0, 0, 42, 0, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 0, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 0, 0, 0, 0, 89, 89, 89, 64, 64, - 64, 0, 0, 89, 89, 89, 0, 89, 89, 89, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 89, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 89, 89, 0, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 0, 0, 0, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 0, 42, 42, 42, 42, 42, 42, 42, 42, 42, 0, 42, 0, 0, - 42, 42, 42, 42, 42, 42, 42, 0, 0, 0, 64, 0, 0, 0, 0, 89, 89, 89, 64, - 64, 64, 0, 64, 0, 89, 89, 89, 89, 89, 89, 89, 89, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 89, 89, 3, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 64, 42, 42, 64, 64, 64, 64, 64, 64, 64, 0, 0, 0, 0, 4, 42, 42, - 42, 42, 42, 42, 63, 64, 64, 64, 64, 64, 64, 64, 64, 3, 9, 9, 9, 9, - 9, 9, 9, 9, 9, 9, 3, 3, 0, 0, 0, 0, 0, 42, 42, 0, 42, 0, 0, 42, 42, - 0, 42, 0, 0, 42, 0, 0, 0, 0, 0, 0, 42, 42, 42, 42, 0, 42, 42, 42, 42, - 42, 42, 42, 0, 42, 42, 42, 0, 42, 0, 42, 0, 0, 42, 42, 0, 42, 42, 42, - 42, 64, 42, 42, 64, 64, 64, 64, 64, 64, 0, 64, 64, 42, 0, 0, 42, 42, - 42, 42, 42, 0, 63, 0, 64, 64, 64, 64, 64, 64, 0, 0, 9, 9, 9, 9, 9, - 9, 9, 9, 9, 9, 0, 0, 42, 42, 0, 0, 42, 14, 14, 14, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 14, 14, 14, 14, 14, 64, 64, 14, 14, 14, - 14, 14, 14, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 17, 17, 17, 17, 17, 17, 17, - 17, 17, 17, 14, 64, 14, 64, 14, 64, 5, 6, 5, 6, 89, 89, 42, 42, 42, - 42, 42, 42, 42, 42, 0, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 0, 0, 0, 0, 0, 0, 64, 64, 64, 64, 64, 64, 64, - 64, 64, 64, 64, 64, 64, 64, 89, 64, 64, 64, 64, 64, 3, 64, 64, 42, - 42, 42, 42, 0, 0, 0, 0, 64, 64, 64, 64, 64, 64, 64, 64, 0, 64, 64, - 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, - 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, - 0, 14, 14, 14, 14, 14, 14, 14, 14, 64, 14, 14, 14, 14, 14, 14, 0, 0, - 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 42, 42, 0, 42, - 42, 42, 42, 42, 0, 42, 42, 0, 89, 64, 64, 64, 64, 89, 64, 0, 0, 0, - 64, 64, 89, 64, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 3, - 3, 3, 3, 3, 3, 42, 42, 42, 42, 42, 42, 89, 89, 64, 64, 0, 0, 0, 0, - 0, 0, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, - 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, - 77, 77, 77, 77, 77, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 0, 0, 0, 0, 3, 0, 0, 0, 0, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 0, - 0, 0, 0, 0, 42, 42, 42, 42, 0, 0, 0, 0, 0, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 0, 0, 0, 0, 0, 0, 42, 42, 42, - 42, 42, 42, 42, 0, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 0, 42, 0, 42, 42, 42, 42, 0, 0, 42, 42, 42, 42, 42, 42, 42, - 0, 42, 0, 42, 42, 42, 42, 0, 0, 42, 42, 42, 42, 42, 42, 42, 0, 42, - 0, 42, 42, 42, 42, 0, 0, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 0, 42, 0, 42, 42, 42, 42, 0, 0, 42, 42, 42, 42, 42, 42, - 42, 0, 42, 0, 42, 42, 42, 42, 0, 0, 42, 42, 42, 42, 42, 42, 42, 0, - 42, 42, 42, 42, 42, 42, 42, 0, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 0, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 0, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 0, 0, 0, 0, 0, 0, 3, 3, 3, 3, 3, 3, 3, - 3, 9, 9, 9, 9, 9, 9, 9, 9, 9, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, - 17, 0, 0, 0, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 3, 3, 42, 42, 42, 42, 42, - 42, 42, 42, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 5, 6, 0, 0, 0, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 3, 3, 3, 90, 90, 90, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 89, 89, 89, 64, 64, 64, 64, 64, 64, 64, 89, 89, 89, 89, 89, - 89, 89, 89, 64, 89, 89, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, - 3, 3, 3, 3, 3, 3, 3, 4, 3, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 3, - 3, 3, 3, 3, 8, 3, 3, 3, 3, 88, 88, 88, 88, 0, 9, 9, 9, 9, 9, 9, 9, - 9, 9, 9, 0, 0, 0, 0, 0, 0, 42, 42, 42, 63, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 0, 0, 0, 0, 0, 0, 0, - 0, 42, 42, 42, 42, 42, 42, 42, 42, 42, 64, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 22, 21, 22, 21, 22, 21, - 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 15, 15, - 15, 15, 15, 91, 0, 0, 0, 0, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, - 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 0, - 0, 0, 0, 0, 0, 92, 92, 92, 92, 92, 92, 92, 92, 93, 93, 93, 93, 93, - 93, 93, 93, 92, 92, 92, 92, 92, 92, 0, 0, 93, 93, 93, 93, 93, 93, 0, - 0, 92, 92, 92, 92, 92, 92, 92, 92, 93, 93, 93, 93, 93, 93, 93, 93, - 92, 92, 92, 92, 92, 92, 92, 92, 93, 93, 93, 93, 93, 93, 93, 93, 92, - 92, 92, 92, 92, 92, 0, 0, 93, 93, 93, 93, 93, 93, 0, 0, 15, 92, 15, - 92, 15, 92, 15, 92, 0, 93, 0, 93, 0, 93, 0, 93, 92, 92, 92, 92, 92, - 92, 92, 92, 93, 93, 93, 93, 93, 93, 93, 93, 94, 94, 95, 95, 95, 95, - 96, 96, 97, 97, 98, 98, 99, 99, 0, 0, 92, 92, 92, 92, 92, 92, 92, 92, - 100, 100, 100, 100, 100, 100, 100, 100, 92, 92, 92, 92, 92, 92, 92, - 92, 100, 100, 100, 100, 100, 100, 100, 100, 92, 92, 92, 92, 92, 92, - 92, 92, 100, 100, 100, 100, 100, 100, 100, 100, 92, 92, 15, 101, 15, - 0, 15, 15, 93, 93, 102, 102, 103, 11, 104, 11, 11, 11, 15, 101, 15, - 0, 15, 15, 105, 105, 105, 105, 103, 11, 11, 11, 92, 92, 15, 15, 0, - 0, 15, 15, 93, 93, 106, 106, 0, 11, 11, 11, 92, 92, 15, 15, 15, 107, - 15, 15, 93, 93, 108, 108, 109, 11, 11, 11, 0, 0, 15, 101, 15, 0, 15, - 15, 110, 110, 111, 111, 103, 11, 11, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 88, 88, 88, 88, 8, 8, 8, 8, 8, 8, 3, 3, 16, 19, 5, 16, 16, - 19, 5, 16, 3, 3, 3, 3, 3, 3, 3, 3, 112, 113, 88, 88, 88, 88, 88, 2, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 16, 19, 3, 3, 3, 3, 12, 12, 3, 3, 3, 7, - 5, 6, 0, 3, 3, 3, 3, 3, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 88, 88, 88, 88, 88, 88, 17, - 0, 0, 0, 17, 17, 17, 17, 17, 17, 7, 7, 7, 5, 6, 15, 17, 17, 17, 17, - 17, 17, 17, 17, 17, 17, 7, 7, 7, 5, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, - 64, 64, 64, 85, 85, 85, 85, 64, 85, 85, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 14, 77, - 14, 14, 14, 14, 77, 14, 14, 15, 77, 77, 77, 15, 15, 77, 77, 77, 15, - 14, 77, 14, 14, 14, 77, 77, 77, 77, 77, 14, 14, 14, 14, 14, 14, 77, - 14, 114, 14, 77, 14, 115, 116, 77, 77, 14, 15, 77, 77, 14, 77, 15, - 42, 42, 42, 42, 15, 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, - 17, 17, 17, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, - 117, 117, 117, 117, 117, 118, 118, 118, 118, 118, 118, 118, 118, 118, - 118, 118, 118, 118, 118, 118, 118, 90, 90, 90, 90, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 7, 7, 7, 7, 7, 14, 14, 14, 14, 14, 7, 7, 14, 14, - 14, 14, 7, 14, 14, 7, 14, 14, 7, 14, 14, 14, 14, 14, 14, 14, 7, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 7, 7, 14, 14, 7, - 14, 7, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, - 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, - 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 14, 14, 14, 14, 14, 14, 14, 14, 7, 7, 7, 7, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 7, 7, 14, 14, 14, 14, 14, 14, 14, 5, 6, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 0, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 0, 0, 0, 0, 0, 14, 14, 14, 14, 14, 14, 14, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 17, 17, 17, 17, 17, 17, 17, - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, - 17, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 119, 119, 119, 119, 119, 119, - 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, - 119, 119, 119, 119, 119, 119, 120, 120, 120, 120, 120, 120, 120, 120, - 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, - 120, 120, 120, 120, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 7, 14, 14, 14, 14, 14, 14, 14, 14, 14, 7, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 0, 0, 0, 0, 0, 0, 0, 0, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 0, 0, 0, 0, 0, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 7, 14, 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, - 14, 14, 14, 0, 14, 14, 14, 14, 0, 0, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 0, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 0, 14, 0, 14, 14, 14, 14, 0, 0, 0, 14, 0, 14, 14, - 14, 14, 14, 14, 14, 0, 0, 14, 14, 14, 14, 14, 14, 14, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, - 17, 17, 17, 14, 0, 0, 0, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 0, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 0, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 0, 14, 14, 14, 14, 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 0, - 0, 0, 0, 2, 3, 3, 3, 14, 63, 42, 90, 5, 6, 5, 6, 5, 6, 5, 6, 5, 6, - 14, 14, 5, 6, 5, 6, 5, 6, 5, 6, 8, 5, 6, 6, 14, 90, 90, 90, 90, 90, - 90, 90, 90, 90, 64, 64, 64, 64, 64, 64, 8, 63, 63, 63, 63, 63, 14, - 14, 90, 90, 90, 0, 0, 0, 14, 14, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 0, 0, 0, 0, 64, 64, - 11, 11, 63, 63, 0, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 12, 63, - 63, 63, 0, 0, 0, 0, 0, 0, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 0, 0, 0, 0, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 0, 14, 14, 17, 17, 17, - 17, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 0, 0, 0, 17, 17, 17, 17, 17, 17, 17, 17, 17, - 17, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 0, 0, 0, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 0, 0, 0, 0, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 0, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 0, 0, 0, 0, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 0, 0, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 42, 42, 42, 42, 42, 42, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 0, 0, 0, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 0, 0, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 0, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 0, 14, 14, 14, 0, 14, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 42, 42, 42, 42, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 121, 121, 121, 121, 121, 121, 121, - 121, 121, 121, 121, 121, 121, 121, 121, 121, 121, 121, 121, 121, 121, - 121, 121, 121, 121, 121, 121, 121, 121, 121, 121, 121, 122, 122, 122, - 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, - 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, - 122, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 15, 15, 15, 15, - 15, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 15, 15, 15, 15, 0, - 0, 0, 0, 0, 42, 64, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 7, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 0, 42, 42, 42, 42, - 42, 0, 42, 0, 42, 42, 0, 42, 42, 0, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 5, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 0, 0, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 0, 0, 0, 0, 64, 64, 64, 64, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 8, 8, 12, 12, 5, 6, 5, 6, 5, - 6, 5, 6, 5, 6, 5, 6, 5, 6, 5, 6, 0, 0, 0, 0, 3, 3, 3, 3, 12, 12, 12, - 3, 3, 3, 0, 3, 3, 3, 3, 8, 5, 6, 5, 6, 5, 6, 3, 3, 3, 7, 8, 7, 7, 7, - 0, 3, 4, 3, 3, 0, 0, 0, 0, 42, 42, 42, 0, 42, 0, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 0, 0, 88, 0, 3, 3, 3, 4, 3, 3, 3, 5, 6, 3, 7, 3, 8, 3, 3, 9, 9, 9, - 9, 9, 9, 9, 9, 9, 9, 3, 3, 7, 7, 7, 3, 11, 13, 13, 13, 13, 13, 13, - 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, - 13, 13, 13, 5, 7, 6, 7, 0, 0, 3, 5, 6, 3, 12, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 63, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 63, - 63, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 0, 0, 0, - 42, 42, 42, 42, 42, 42, 0, 0, 42, 42, 42, 42, 42, 42, 0, 0, 42, 42, - 42, 42, 42, 42, 0, 0, 42, 42, 42, 0, 0, 0, 4, 4, 7, 11, 14, 4, 4, 0, - 14, 7, 7, 7, 7, 14, 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 88, 88, 88, 14, - 14, 42, 17, 42, 42, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 123, 123, 123, - 126, 126, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 89, 64, 14, 14, 14, - 14, 14, 0, 0, 77, 77, 15, 15, 77, 15, 15, 77, 77, 15, 77, 77, 15, 77, - 77, 15, 15, 77, 15, 15, 77, 77, 15, 77, 77, 15, 77, 77, 15, 15, 77, - 15, 15, 77, 77, 15, 77, 77, 15, 77, 77, 15, 15, 77, 77, 15, 15, 77, - 15, 15, 77, 77, 15, 15, 77, 15, 15, 77, 77, 15, 15, 9, 9, 9, 42, 42, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 88, 0, 88, 88, 88, 88, 88, 88, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 122, 122, - 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, - 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, - 122 -}; - -/* - * Each group represents a unique set of character attributes. The attributes - * are encoded into a 32-bit value as follows: - * - * Bits 0-4 Character category: see the constants listed below. - * - * Bits 5-7 Case delta type: 000 = identity - * 010 = add delta for lower - * 011 = add delta for lower, add 1 for title - * 100 = sutract delta for title/upper - * 101 = sub delta for upper, sub 1 for title - * 110 = sub delta for upper, add delta for lower - * - * Bits 8-21 Reserved for future use. - * - * Bits 22-31 Case delta: delta for case conversions. This should be the - * highest field so we can easily sign extend. - */ - -static int groups[] = { - 0, 15, 12, 25, 27, 21, 22, 26, 20, 9, 134217793, 28, 19, 134217858, - 29, 2, 23, 11, 1178599554, 24, -507510654, 4194369, 4194434, -834666431, - 973078658, -507510719, 1258291330, 880803905, 864026689, 859832385, - 331350081, 847249473, 851443777, 868220993, -406847358, 884998209, - 876609601, 893386817, 897581121, 914358337, 910164033, 918552641, - 5, -234880894, 8388705, 4194499, 8388770, 331350146, -406847423, - -234880959, 880803970, 864026754, 859832450, 847249538, 851443842, - 868221058, 876609666, 884998274, 893386882, 897581186, 914358402, - 910164098, 918552706, 4, 6, -352321402, 159383617, 155189313, - 268435521, 264241217, 159383682, 155189378, 130023554, 268435586, - 264241282, 260046978, 239075458, 1, 197132418, 226492546, 360710274, - 335544450, -251658175, 402653314, 335544385, 7, 201326657, 201326722, - 16, 8, 10, 247464066, -33554302, -33554367, -310378366, -360710014, - -419430270, -536870782, -469761918, -528482174, -33554365, -37748606, - -310378431, -37748669, 155189378, -360710079, -419430335, -29359998, - -469761983, -29360063, -536870847, -528482239, 13, 14, -1463812031, - -801111999, -293601215, 67108938, 67109002, 109051997, 109052061, - 18, 17, 8388673, 12582977, 8388738, 12583042 -}; - -/* - * The following constants are used to determine the category of a - * Unicode character. - */ - -#define UNICODE_CATEGORY_MASK 0X1F - -enum { - UNASSIGNED, - UPPERCASE_LETTER, - LOWERCASE_LETTER, - TITLECASE_LETTER, - MODIFIER_LETTER, - OTHER_LETTER, - NON_SPACING_MARK, - ENCLOSING_MARK, - COMBINING_SPACING_MARK, - DECIMAL_DIGIT_NUMBER, - LETTER_NUMBER, - OTHER_NUMBER, - SPACE_SEPARATOR, - LINE_SEPARATOR, - PARAGRAPH_SEPARATOR, - CONTROL, - FORMAT, - PRIVATE_USE, - SURROGATE, - CONNECTOR_PUNCTUATION, - DASH_PUNCTUATION, - OPEN_PUNCTUATION, - CLOSE_PUNCTUATION, - INITIAL_QUOTE_PUNCTUATION, - FINAL_QUOTE_PUNCTUATION, - OTHER_PUNCTUATION, - MATH_SYMBOL, - CURRENCY_SYMBOL, - MODIFIER_SYMBOL, - OTHER_SYMBOL -}; - -/* - * The following macros extract the fields of the character info. The - * GetDelta() macro is complicated because we can't rely on the C compiler - * to do sign extension on right shifts. - */ - -#define GetCaseType(info) (((info) & 0xE0) >> 5) -#define GetCategory(info) ((info) & 0x1F) -#define GetDelta(info) (((info) > 0) ? ((info) >> 22) : (~(~((info)) >> 22))) - -/* - * This macro extracts the information about a character from the - * Unicode character tables. - */ - -#define GetUniCharInfo(ch) (groups[groupMap[(pageMap[(((int)(ch)) & 0xffff) >> OFFSET_BITS] << OFFSET_BITS) | ((ch) & ((1 << OFFSET_BITS)-1))]]) - diff --git a/wxWidgets/src/richtext/richtextbuffer.cpp b/wxWidgets/src/richtext/richtextbuffer.cpp deleted file mode 100644 index 60db1dbcc3..0000000000 --- a/wxWidgets/src/richtext/richtextbuffer.cpp +++ /dev/null @@ -1,9757 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/richtext/richtextbuffer.cpp -// Purpose: Buffer for wxRichTextCtrl -// Author: Julian Smart -// Modified by: -// Created: 2005-09-30 -// RCS-ID: $Id: richtextbuffer.cpp 67111 2011-03-02 20:55:16Z JS $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_RICHTEXT - -#include "wx/richtext/richtextbuffer.h" - -#ifndef WX_PRECOMP - #include "wx/dc.h" - #include "wx/intl.h" - #include "wx/log.h" - #include "wx/dataobj.h" - #include "wx/module.h" -#endif - -#include "wx/settings.h" -#include "wx/filename.h" -#include "wx/clipbrd.h" -#include "wx/wfstream.h" -#include "wx/mstream.h" -#include "wx/sstream.h" -#include "wx/textfile.h" - -#include "wx/richtext/richtextctrl.h" -#include "wx/richtext/richtextstyles.h" - -#include "wx/listimpl.cpp" - -WX_DEFINE_LIST(wxRichTextObjectList) -WX_DEFINE_LIST(wxRichTextLineList) - -// Switch off if the platform doesn't like it for some reason -#define wxRICHTEXT_USE_OPTIMIZED_DRAWING 1 - -const wxChar wxRichTextLineBreakChar = (wxChar) 29; - -// Use GetPartialTextExtents for platforms that support it natively -#define wxRICHTEXT_USE_PARTIAL_TEXT_EXTENTS 1 - -// Use global array for binary compatibility; in 2.9+ it will be done more elegantly -#if wxRICHTEXT_USE_PARTIAL_TEXT_EXTENTS -wxArrayInt g_GlobalPartialTextExtents; -bool g_UseGlobalPartialTextExtents = false; -#endif - - -// Helpers for efficiency - -inline void wxCheckSetFont(wxDC& dc, const wxFont& font) -{ - const wxFont& font1 = dc.GetFont(); - if (font1.IsOk() && font.IsOk()) - { - if (font1.GetPointSize() == font.GetPointSize() && - font1.GetFamily() == font.GetFamily() && - font1.GetStyle() == font.GetStyle() && - font1.GetWeight() == font.GetWeight() && - font1.GetUnderlined() == font.GetUnderlined() && - font1.GetFaceName() == font.GetFaceName()) - return; - } - dc.SetFont(font); -} - -inline void wxCheckSetPen(wxDC& dc, const wxPen& pen) -{ - const wxPen& pen1 = dc.GetPen(); - if (pen1.IsOk() && pen.IsOk()) - { - if (pen1.GetWidth() == pen.GetWidth() && - pen1.GetStyle() == pen.GetStyle() && - pen1.GetColour() == pen.GetColour()) - return; - } - dc.SetPen(pen); -} - -inline void wxCheckSetBrush(wxDC& dc, const wxBrush& brush) -{ - const wxBrush& brush1 = dc.GetBrush(); - if (brush1.IsOk() && brush.IsOk()) - { - if (brush1.GetStyle() == brush.GetStyle() && - brush1.GetColour() == brush.GetColour()) - return; - } - dc.SetBrush(brush); -} - -// Functions that set properties without using the accessors - -inline void wxFontSetPointSize(wxFont& font, int pointSize) -{ - if (font.Ok() && font.GetPointSize() != pointSize) - { - wxFont tempFont(pointSize, font.GetFamily(), font.GetStyle(), font.GetWeight(), font.GetUnderlined(), font.GetFaceName(), font.GetEncoding()); - font = tempFont; - } -} - -inline void wxFontSetStyle(wxFont& font, int fontStyle) -{ - if (font.Ok() && font.GetStyle() != fontStyle) - { - wxFont tempFont(font.GetPointSize(), font.GetFamily(), fontStyle, font.GetWeight(), font.GetUnderlined(), font.GetFaceName(), font.GetEncoding()); - font = tempFont; - } -} - -inline void wxFontSetWeight(wxFont& font, int fontWeight) -{ - if (font.Ok() && font.GetWeight() != fontWeight) - { - wxFont tempFont(font.GetPointSize(), font.GetFamily(), font.GetStyle(), fontWeight, font.GetUnderlined(), font.GetFaceName(), font.GetEncoding()); - font = tempFont; - } -} - -inline void wxFontSetUnderlined(wxFont& font, bool underlined) -{ - if (font.Ok() && font.GetUnderlined() != underlined) - { - wxFont tempFont(font.GetPointSize(), font.GetFamily(), font.GetStyle(), font.GetWeight(), underlined, font.GetFaceName(), font.GetEncoding()); - font = tempFont; - } -} - -inline void wxFontSetFaceName(wxFont& font, const wxString& faceName) -{ - if (font.Ok() && font.GetFaceName() != faceName) - { - wxFont tempFont(font.GetPointSize(), font.GetFamily(), font.GetStyle(), font.GetWeight(), font.GetUnderlined(), faceName, font.GetEncoding()); - font = tempFont; - } -} - -/*! - * wxRichTextObject - * This is the base for drawable objects. - */ - -IMPLEMENT_CLASS(wxRichTextObject, wxObject) - -wxRichTextObject::wxRichTextObject(wxRichTextObject* parent) -{ - m_dirty = false; - m_refCount = 1; - m_parent = parent; - m_leftMargin = 0; - m_rightMargin = 0; - m_topMargin = 0; - m_bottomMargin = 0; - m_descent = 0; -} - -wxRichTextObject::~wxRichTextObject() -{ -} - -void wxRichTextObject::Dereference() -{ - m_refCount --; - if (m_refCount <= 0) - delete this; -} - -/// Copy -void wxRichTextObject::Copy(const wxRichTextObject& obj) -{ - m_size = obj.m_size; - m_pos = obj.m_pos; - m_dirty = obj.m_dirty; - m_range = obj.m_range; - m_attributes = obj.m_attributes; - m_descent = obj.m_descent; -} - -void wxRichTextObject::SetMargins(int margin) -{ - m_leftMargin = m_rightMargin = m_topMargin = m_bottomMargin = margin; -} - -void wxRichTextObject::SetMargins(int leftMargin, int rightMargin, int topMargin, int bottomMargin) -{ - m_leftMargin = leftMargin; - m_rightMargin = rightMargin; - m_topMargin = topMargin; - m_bottomMargin = bottomMargin; -} - -// Convert units in tenths of a millimetre to device units -int wxRichTextObject::ConvertTenthsMMToPixels(wxDC& dc, int units) -{ - int p = ConvertTenthsMMToPixels(dc.GetPPI().x, units); - - // Unscale - wxRichTextBuffer* buffer = GetBuffer(); - if (buffer) - p = (int) ((double)p / buffer->GetScale()); - return p; -} - -// Convert units in tenths of a millimetre to device units -int wxRichTextObject::ConvertTenthsMMToPixels(int ppi, int units) -{ - // There are ppi pixels in 254.1 "1/10 mm" - - double pixels = ((double) units * (double)ppi) / 254.1; - - return (int) pixels; -} - -/// Dump to output stream for debugging -void wxRichTextObject::Dump(wxTextOutputStream& stream) -{ - stream << GetClassInfo()->GetClassName() << wxT("\n"); - stream << wxString::Format(wxT("Size: %d,%d. Position: %d,%d, Range: %ld,%ld"), m_size.x, m_size.y, m_pos.x, m_pos.y, m_range.GetStart(), m_range.GetEnd()) << wxT("\n"); - stream << wxString::Format(wxT("Text colour: %d,%d,%d."), (int) m_attributes.GetTextColour().Red(), (int) m_attributes.GetTextColour().Green(), (int) m_attributes.GetTextColour().Blue()) << wxT("\n"); -} - -/// Gets the containing buffer -wxRichTextBuffer* wxRichTextObject::GetBuffer() const -{ - const wxRichTextObject* obj = this; - while (obj && !obj->IsKindOf(CLASSINFO(wxRichTextBuffer))) - obj = obj->GetParent(); - return wxDynamicCast(obj, wxRichTextBuffer); -} - -/*! - * wxRichTextCompositeObject - * This is the base for drawable objects. - */ - -IMPLEMENT_CLASS(wxRichTextCompositeObject, wxRichTextObject) - -wxRichTextCompositeObject::wxRichTextCompositeObject(wxRichTextObject* parent): - wxRichTextObject(parent) -{ -} - -wxRichTextCompositeObject::~wxRichTextCompositeObject() -{ - DeleteChildren(); -} - -/// Get the nth child -wxRichTextObject* wxRichTextCompositeObject::GetChild(size_t n) const -{ - wxASSERT ( n < m_children.GetCount() ); - - return m_children.Item(n)->GetData(); -} - -/// Append a child, returning the position -size_t wxRichTextCompositeObject::AppendChild(wxRichTextObject* child) -{ - m_children.Append(child); - child->SetParent(this); - return m_children.GetCount() - 1; -} - -/// Insert the child in front of the given object, or at the beginning -bool wxRichTextCompositeObject::InsertChild(wxRichTextObject* child, wxRichTextObject* inFrontOf) -{ - if (inFrontOf) - { - wxRichTextObjectList::compatibility_iterator node = m_children.Find(inFrontOf); - m_children.Insert(node, child); - } - else - m_children.Insert(child); - child->SetParent(this); - - return true; -} - -/// Delete the child -bool wxRichTextCompositeObject::RemoveChild(wxRichTextObject* child, bool deleteChild) -{ - wxRichTextObjectList::compatibility_iterator node = m_children.Find(child); - if (node) - { - wxRichTextObject* obj = node->GetData(); - m_children.Erase(node); - if (deleteChild) - delete obj; - - return true; - } - return false; -} - -/// Delete all children -bool wxRichTextCompositeObject::DeleteChildren() -{ - wxRichTextObjectList::compatibility_iterator node = m_children.GetFirst(); - while (node) - { - wxRichTextObjectList::compatibility_iterator oldNode = node; - - wxRichTextObject* child = node->GetData(); - child->Dereference(); // Only delete if reference count is zero - - node = node->GetNext(); - m_children.Erase(oldNode); - } - - return true; -} - -/// Get the child count -size_t wxRichTextCompositeObject::GetChildCount() const -{ - return m_children.GetCount(); -} - -/// Copy -void wxRichTextCompositeObject::Copy(const wxRichTextCompositeObject& obj) -{ - wxRichTextObject::Copy(obj); - - DeleteChildren(); - - wxRichTextObjectList::compatibility_iterator node = obj.m_children.GetFirst(); - while (node) - { - wxRichTextObject* child = node->GetData(); - wxRichTextObject* newChild = child->Clone(); - newChild->SetParent(this); - m_children.Append(newChild); - - node = node->GetNext(); - } -} - -/// Hit-testing: returns a flag indicating hit test details, plus -/// information about position -int wxRichTextCompositeObject::HitTest(wxDC& dc, const wxPoint& pt, long& textPosition) -{ - wxRichTextObjectList::compatibility_iterator node = m_children.GetFirst(); - while (node) - { - wxRichTextObject* child = node->GetData(); - - int ret = child->HitTest(dc, pt, textPosition); - if (ret != wxRICHTEXT_HITTEST_NONE) - return ret; - - node = node->GetNext(); - } - - textPosition = GetRange().GetEnd()-1; - return wxRICHTEXT_HITTEST_AFTER|wxRICHTEXT_HITTEST_OUTSIDE; -} - -/// Finds the absolute position and row height for the given character position -bool wxRichTextCompositeObject::FindPosition(wxDC& dc, long index, wxPoint& pt, int* height, bool forceLineStart) -{ - wxRichTextObjectList::compatibility_iterator node = m_children.GetFirst(); - while (node) - { - wxRichTextObject* child = node->GetData(); - - if (child->FindPosition(dc, index, pt, height, forceLineStart)) - return true; - - node = node->GetNext(); - } - - return false; -} - -/// Calculate range -void wxRichTextCompositeObject::CalculateRange(long start, long& end) -{ - long current = start; - long lastEnd = current; - - wxRichTextObjectList::compatibility_iterator node = m_children.GetFirst(); - while (node) - { - wxRichTextObject* child = node->GetData(); - long childEnd = 0; - - child->CalculateRange(current, childEnd); - lastEnd = childEnd; - - current = childEnd + 1; - - node = node->GetNext(); - } - - end = lastEnd; - - // An object with no children has zero length - if (m_children.GetCount() == 0) - end --; - - m_range.SetRange(start, end); -} - -/// Delete range from layout. -bool wxRichTextCompositeObject::DeleteRange(const wxRichTextRange& range) -{ - wxRichTextObjectList::compatibility_iterator node = m_children.GetFirst(); - - while (node) - { - wxRichTextObject* obj = (wxRichTextObject*) node->GetData(); - wxRichTextObjectList::compatibility_iterator next = node->GetNext(); - - // Delete the range in each paragraph - - // When a chunk has been deleted, internally the content does not - // now match the ranges. - // However, so long as deletion is not done on the same object twice this is OK. - // If you may delete content from the same object twice, recalculate - // the ranges inbetween DeleteRange calls by calling CalculateRanges, and - // adjust the range you're deleting accordingly. - - if (!obj->GetRange().IsOutside(range)) - { - obj->DeleteRange(range); - - // Delete an empty object, or paragraph within this range. - if (obj->IsEmpty() || - (range.GetStart() <= obj->GetRange().GetStart() && range.GetEnd() >= obj->GetRange().GetEnd())) - { - // An empty paragraph has length 1, so won't be deleted unless the - // whole range is deleted. - RemoveChild(obj, true); - } - } - - node = next; - } - - return true; -} - -/// Get any text in this object for the given range -wxString wxRichTextCompositeObject::GetTextForRange(const wxRichTextRange& range) const -{ - wxString text; - wxRichTextObjectList::compatibility_iterator node = m_children.GetFirst(); - while (node) - { - wxRichTextObject* child = node->GetData(); - wxRichTextRange childRange = range; - if (!child->GetRange().IsOutside(range)) - { - childRange.LimitTo(child->GetRange()); - - wxString childText = child->GetTextForRange(childRange); - - text += childText; - } - node = node->GetNext(); - } - - return text; -} - -/// Recursively merge all pieces that can be merged. -bool wxRichTextCompositeObject::Defragment() -{ - wxRichTextObjectList::compatibility_iterator node = m_children.GetFirst(); - while (node) - { - wxRichTextObject* child = node->GetData(); - wxRichTextCompositeObject* composite = wxDynamicCast(child, wxRichTextCompositeObject); - if (composite) - composite->Defragment(); - - if (node->GetNext()) - { - wxRichTextObject* nextChild = node->GetNext()->GetData(); - if (child->CanMerge(nextChild) && child->Merge(nextChild)) - { - nextChild->Dereference(); - m_children.Erase(node->GetNext()); - - // Don't set node -- we'll see if we can merge again with the next - // child. - } - else - { - node = node->GetNext(); - } - } - else - node = node->GetNext(); - } - - return true; -} - -/// Dump to output stream for debugging -void wxRichTextCompositeObject::Dump(wxTextOutputStream& stream) -{ - wxRichTextObjectList::compatibility_iterator node = m_children.GetFirst(); - while (node) - { - wxRichTextObject* child = node->GetData(); - child->Dump(stream); - node = node->GetNext(); - } -} - - -/*! - * wxRichTextBox - * This defines a 2D space to lay out objects - */ - -IMPLEMENT_DYNAMIC_CLASS(wxRichTextBox, wxRichTextCompositeObject) - -wxRichTextBox::wxRichTextBox(wxRichTextObject* parent): - wxRichTextCompositeObject(parent) -{ -} - -/// Draw the item -bool wxRichTextBox::Draw(wxDC& dc, const wxRichTextRange& range, const wxRichTextRange& selectionRange, const wxRect& WXUNUSED(rect), int descent, int style) -{ - wxRichTextObjectList::compatibility_iterator node = m_children.GetFirst(); - while (node) - { - wxRichTextObject* child = node->GetData(); - - wxRect childRect = wxRect(child->GetPosition(), child->GetCachedSize()); - child->Draw(dc, range, selectionRange, childRect, descent, style); - - node = node->GetNext(); - } - return true; -} - -/// Lay the item out -bool wxRichTextBox::Layout(wxDC& dc, const wxRect& rect, int style) -{ - wxRichTextObjectList::compatibility_iterator node = m_children.GetFirst(); - while (node) - { - wxRichTextObject* child = node->GetData(); - child->Layout(dc, rect, style); - - node = node->GetNext(); - } - m_dirty = false; - return true; -} - -/// Get/set the size for the given range. Assume only has one child. -bool wxRichTextBox::GetRangeSize(const wxRichTextRange& range, wxSize& size, int& descent, wxDC& dc, int flags, wxPoint position) const -{ - wxRichTextObjectList::compatibility_iterator node = m_children.GetFirst(); - if (node) - { - wxRichTextObject* child = node->GetData(); - return child->GetRangeSize(range, size, descent, dc, flags, position); - } - else - return false; -} - -/// Copy -void wxRichTextBox::Copy(const wxRichTextBox& obj) -{ - wxRichTextCompositeObject::Copy(obj); -} - - -/*! - * wxRichTextParagraphLayoutBox - * This box knows how to lay out paragraphs. - */ - -IMPLEMENT_DYNAMIC_CLASS(wxRichTextParagraphLayoutBox, wxRichTextBox) - -wxRichTextParagraphLayoutBox::wxRichTextParagraphLayoutBox(wxRichTextObject* parent): - wxRichTextBox(parent) -{ - Init(); -} - -/// Initialize the object. -void wxRichTextParagraphLayoutBox::Init() -{ - m_ctrl = NULL; - - // For now, assume is the only box and has no initial size. - m_range = wxRichTextRange(0, -1); - - m_invalidRange.SetRange(-1, -1); - m_leftMargin = 4; - m_rightMargin = 4; - m_topMargin = 4; - m_bottomMargin = 4; - m_partialParagraph = false; -} - -/// Draw the item -bool wxRichTextParagraphLayoutBox::Draw(wxDC& dc, const wxRichTextRange& range, const wxRichTextRange& selectionRange, const wxRect& rect, int descent, int style) -{ - wxRichTextObjectList::compatibility_iterator node = m_children.GetFirst(); - while (node) - { - wxRichTextParagraph* child = wxDynamicCast(node->GetData(), wxRichTextParagraph); - wxASSERT (child != NULL); - - if (child && !child->GetRange().IsOutside(range)) - { - wxRect childRect(child->GetPosition(), child->GetCachedSize()); - - if (((style & wxRICHTEXT_DRAW_IGNORE_CACHE) == 0) && childRect.GetTop() > rect.GetBottom()) - { - // Stop drawing - break; - } - else if (((style & wxRICHTEXT_DRAW_IGNORE_CACHE) == 0) && childRect.GetBottom() < rect.GetTop()) - { - // Skip - } - else - child->Draw(dc, range, selectionRange, rect, descent, style); - } - - node = node->GetNext(); - } - return true; -} - -/// Lay the item out -bool wxRichTextParagraphLayoutBox::Layout(wxDC& dc, const wxRect& rect, int style) -{ - wxRect availableSpace; - bool formatRect = (style & wxRICHTEXT_LAYOUT_SPECIFIED_RECT) == wxRICHTEXT_LAYOUT_SPECIFIED_RECT; - - // If only laying out a specific area, the passed rect has a different meaning: - // the visible part of the buffer. This is used in wxRichTextCtrl::OnSize, - // so that during a size, only the visible part will be relaid out, or - // it would take too long causing flicker. As an approximation, we assume that - // everything up to the start of the visible area is laid out correctly. - if (formatRect) - { - availableSpace = wxRect(0 + m_leftMargin, - 0 + m_topMargin, - rect.width - m_leftMargin - m_rightMargin, - rect.height); - - // Invalidate the part of the buffer from the first visible line - // to the end. If other parts of the buffer are currently invalid, - // then they too will be taken into account if they are above - // the visible point. - long startPos = 0; - wxRichTextLine* line = GetLineAtYPosition(rect.y); - if (line) - startPos = line->GetAbsoluteRange().GetStart(); - - Invalidate(wxRichTextRange(startPos, GetRange().GetEnd())); - } - else - availableSpace = wxRect(rect.x + m_leftMargin, - rect.y + m_topMargin, - rect.width - m_leftMargin - m_rightMargin, - rect.height - m_topMargin - m_bottomMargin); - - int maxWidth = 0; - - wxRichTextObjectList::compatibility_iterator node = m_children.GetFirst(); - - bool layoutAll = true; - - // Get invalid range, rounding to paragraph start/end. - wxRichTextRange invalidRange = GetInvalidRange(true); - - if (invalidRange == wxRICHTEXT_NONE && !formatRect) - return true; - - if (invalidRange == wxRICHTEXT_ALL) - layoutAll = true; - else // If we know what range is affected, start laying out from that point on. - if (invalidRange.GetStart() >= GetRange().GetStart()) - { - wxRichTextParagraph* firstParagraph = GetParagraphAtPosition(invalidRange.GetStart()); - if (firstParagraph) - { - wxRichTextObjectList::compatibility_iterator firstNode = m_children.Find(firstParagraph); - wxRichTextObjectList::compatibility_iterator previousNode; - if ( firstNode ) - previousNode = firstNode->GetPrevious(); - if (firstNode) - { - if (previousNode) - { - wxRichTextParagraph* previousParagraph = wxDynamicCast(previousNode->GetData(), wxRichTextParagraph); - availableSpace.y = previousParagraph->GetPosition().y + previousParagraph->GetCachedSize().y; - } - - // Now we're going to start iterating from the first affected paragraph. - node = firstNode; - - layoutAll = false; - } - } - } - - // A way to force speedy rest-of-buffer layout (the 'else' below) - bool forceQuickLayout = false; - - while (node) - { - // Assume this box only contains paragraphs - - wxRichTextParagraph* child = wxDynamicCast(node->GetData(), wxRichTextParagraph); - wxCHECK_MSG( child, false, _T("Unknown object in layout") ); - - // TODO: what if the child hasn't been laid out (e.g. involved in Undo) but still has 'old' lines - if ( !forceQuickLayout && - (layoutAll || - child->GetLines().IsEmpty() || - !child->GetRange().IsOutside(invalidRange)) ) - { - child->Layout(dc, availableSpace, style); - - // Layout must set the cached size - availableSpace.y += child->GetCachedSize().y; - maxWidth = wxMax(maxWidth, child->GetCachedSize().x); - - // If we're just formatting the visible part of the buffer, - // and we're now past the bottom of the window, start quick - // layout. - if (formatRect && child->GetPosition().y > rect.GetBottom()) - forceQuickLayout = true; - } - else - { - // We're outside the immediately affected range, so now let's just - // move everything up or down. This assumes that all the children have previously - // been laid out and have wrapped line lists associated with them. - // TODO: check all paragraphs before the affected range. - - int inc = availableSpace.y - child->GetPosition().y; - - while (node) - { - wxRichTextParagraph* child = wxDynamicCast(node->GetData(), wxRichTextParagraph); - if (child) - { - if (child->GetLines().GetCount() == 0) - child->Layout(dc, availableSpace, style); - else - child->SetPosition(wxPoint(child->GetPosition().x, child->GetPosition().y + inc)); - - availableSpace.y += child->GetCachedSize().y; - maxWidth = wxMax(maxWidth, child->GetCachedSize().x); - } - - node = node->GetNext(); - } - break; - } - - node = node->GetNext(); - } - - SetCachedSize(wxSize(maxWidth, availableSpace.y)); - - m_dirty = false; - m_invalidRange = wxRICHTEXT_NONE; - - return true; -} - -/// Copy -void wxRichTextParagraphLayoutBox::Copy(const wxRichTextParagraphLayoutBox& obj) -{ - wxRichTextBox::Copy(obj); - - m_partialParagraph = obj.m_partialParagraph; - m_defaultAttributes = obj.m_defaultAttributes; -} - -/// Get/set the size for the given range. -bool wxRichTextParagraphLayoutBox::GetRangeSize(const wxRichTextRange& range, wxSize& size, int& descent, wxDC& dc, int flags, wxPoint position) const -{ - wxSize sz; - - wxRichTextObjectList::compatibility_iterator startPara = wxRichTextObjectList::compatibility_iterator(); - wxRichTextObjectList::compatibility_iterator endPara = wxRichTextObjectList::compatibility_iterator(); - - // First find the first paragraph whose starting position is within the range. - wxRichTextObjectList::compatibility_iterator node = m_children.GetFirst(); - while (node) - { - // child is a paragraph - wxRichTextObject* child = node->GetData(); - const wxRichTextRange& r = child->GetRange(); - - if (r.GetStart() <= range.GetStart() && r.GetEnd() >= range.GetStart()) - { - startPara = node; - break; - } - - node = node->GetNext(); - } - - // Next find the last paragraph containing part of the range - node = m_children.GetFirst(); - while (node) - { - // child is a paragraph - wxRichTextObject* child = node->GetData(); - const wxRichTextRange& r = child->GetRange(); - - if (r.GetStart() <= range.GetEnd() && r.GetEnd() >= range.GetEnd()) - { - endPara = node; - break; - } - - node = node->GetNext(); - } - - if (!startPara || !endPara) - return false; - - // Now we can add up the sizes - for (node = startPara; node ; node = node->GetNext()) - { - // child is a paragraph - wxRichTextObject* child = node->GetData(); - const wxRichTextRange& childRange = child->GetRange(); - wxRichTextRange rangeToFind = range; - rangeToFind.LimitTo(childRange); - - wxSize childSize; - - int childDescent = 0; - child->GetRangeSize(rangeToFind, childSize, childDescent, dc, flags, position); - - descent = wxMax(childDescent, descent); - - sz.x = wxMax(sz.x, childSize.x); - sz.y += childSize.y; - - if (node == endPara) - break; - } - - size = sz; - - return true; -} - -/// Get the paragraph at the given position -wxRichTextParagraph* wxRichTextParagraphLayoutBox::GetParagraphAtPosition(long pos, bool caretPosition) const -{ - if (caretPosition) - pos ++; - - // First find the first paragraph whose starting position is within the range. - wxRichTextObjectList::compatibility_iterator node = m_children.GetFirst(); - while (node) - { - // child is a paragraph - wxRichTextParagraph* child = wxDynamicCast(node->GetData(), wxRichTextParagraph); - wxASSERT (child != NULL); - - // Return first child in buffer if position is -1 - // if (pos == -1) - // return child; - - if (child->GetRange().Contains(pos)) - return child; - - node = node->GetNext(); - } - return NULL; -} - -/// Get the line at the given position -wxRichTextLine* wxRichTextParagraphLayoutBox::GetLineAtPosition(long pos, bool caretPosition) const -{ - if (caretPosition) - pos ++; - - // First find the first paragraph whose starting position is within the range. - wxRichTextObjectList::compatibility_iterator node = m_children.GetFirst(); - while (node) - { - wxRichTextObject* obj = (wxRichTextObject*) node->GetData(); - if (obj->GetRange().Contains(pos)) - { - // child is a paragraph - wxRichTextParagraph* child = wxDynamicCast(obj, wxRichTextParagraph); - wxASSERT (child != NULL); - - wxRichTextLineList::compatibility_iterator node2 = child->GetLines().GetFirst(); - while (node2) - { - wxRichTextLine* line = node2->GetData(); - - wxRichTextRange range = line->GetAbsoluteRange(); - - if (range.Contains(pos) || - - // If the position is end-of-paragraph, then return the last line of - // of the paragraph. - ((range.GetEnd() == child->GetRange().GetEnd()-1) && (pos == child->GetRange().GetEnd()))) - return line; - - node2 = node2->GetNext(); - } - } - - node = node->GetNext(); - } - - int lineCount = GetLineCount(); - if (lineCount > 0) - return GetLineForVisibleLineNumber(lineCount-1); - else - return NULL; -} - -/// Get the line at the given y pixel position, or the last line. -wxRichTextLine* wxRichTextParagraphLayoutBox::GetLineAtYPosition(int y) const -{ - wxRichTextObjectList::compatibility_iterator node = m_children.GetFirst(); - while (node) - { - wxRichTextParagraph* child = wxDynamicCast(node->GetData(), wxRichTextParagraph); - wxASSERT (child != NULL); - - wxRichTextLineList::compatibility_iterator node2 = child->GetLines().GetFirst(); - while (node2) - { - wxRichTextLine* line = node2->GetData(); - - wxRect rect(line->GetRect()); - - if (y <= rect.GetBottom()) - return line; - - node2 = node2->GetNext(); - } - - node = node->GetNext(); - } - - // Return last line - int lineCount = GetLineCount(); - if (lineCount > 0) - return GetLineForVisibleLineNumber(lineCount-1); - else - return NULL; -} - -/// Get the number of visible lines -int wxRichTextParagraphLayoutBox::GetLineCount() const -{ - int count = 0; - - wxRichTextObjectList::compatibility_iterator node = m_children.GetFirst(); - while (node) - { - wxRichTextParagraph* child = wxDynamicCast(node->GetData(), wxRichTextParagraph); - wxASSERT (child != NULL); - - count += child->GetLines().GetCount(); - node = node->GetNext(); - } - return count; -} - - -/// Get the paragraph for a given line -wxRichTextParagraph* wxRichTextParagraphLayoutBox::GetParagraphForLine(wxRichTextLine* line) const -{ - return GetParagraphAtPosition(line->GetAbsoluteRange().GetStart()); -} - -/// Get the line size at the given position -wxSize wxRichTextParagraphLayoutBox::GetLineSizeAtPosition(long pos, bool caretPosition) const -{ - wxRichTextLine* line = GetLineAtPosition(pos, caretPosition); - if (line) - { - return line->GetSize(); - } - else - return wxSize(0, 0); -} - - -/// Convenience function to add a paragraph of text -wxRichTextRange wxRichTextParagraphLayoutBox::AddParagraph(const wxString& text, wxTextAttrEx* paraStyle) -{ - // Don't use the base style, just the default style, and the base style will - // be combined at display time. - // Divide into paragraph and character styles. - - wxTextAttrEx defaultCharStyle; - wxTextAttrEx defaultParaStyle; - - // If the default style is a named paragraph style, don't apply any character formatting - // to the initial text string. - if (GetDefaultStyle().HasParagraphStyleName() && GetStyleSheet()) - { - wxRichTextParagraphStyleDefinition* def = GetStyleSheet()->FindParagraphStyle(GetDefaultStyle().GetParagraphStyleName()); - if (def) - defaultParaStyle = def->GetStyleMergedWithBase(GetStyleSheet()); - } - else - wxRichTextSplitParaCharStyles(GetDefaultStyle(), defaultParaStyle, defaultCharStyle); - - wxTextAttrEx* pStyle = paraStyle ? paraStyle : (wxTextAttrEx*) & defaultParaStyle; - wxTextAttrEx* cStyle = & defaultCharStyle; - - wxRichTextParagraph* para = new wxRichTextParagraph(text, this, pStyle, cStyle); - - AppendChild(para); - - UpdateRanges(); - SetDirty(true); - - return para->GetRange(); -} - -/// Adds multiple paragraphs, based on newlines. -wxRichTextRange wxRichTextParagraphLayoutBox::AddParagraphs(const wxString& text, wxTextAttrEx* paraStyle) -{ - // Don't use the base style, just the default style, and the base style will - // be combined at display time. - // Divide into paragraph and character styles. - - wxTextAttrEx defaultCharStyle; - wxTextAttrEx defaultParaStyle; - - // If the default style is a named paragraph style, don't apply any character formatting - // to the initial text string. - if (GetDefaultStyle().HasParagraphStyleName() && GetStyleSheet()) - { - wxRichTextParagraphStyleDefinition* def = GetStyleSheet()->FindParagraphStyle(GetDefaultStyle().GetParagraphStyleName()); - if (def) - defaultParaStyle = def->GetStyleMergedWithBase(GetStyleSheet()); - } - else - wxRichTextSplitParaCharStyles(GetDefaultStyle(), defaultParaStyle, defaultCharStyle); - - wxTextAttrEx* pStyle = paraStyle ? paraStyle : (wxTextAttrEx*) & defaultParaStyle; - wxTextAttrEx* cStyle = & defaultCharStyle; - - wxRichTextParagraph* firstPara = NULL; - wxRichTextParagraph* lastPara = NULL; - - wxRichTextRange range(-1, -1); - - size_t i = 0; - size_t len = text.length(); - wxString line; - wxRichTextParagraph* para = new wxRichTextParagraph(wxEmptyString, this, pStyle, cStyle); - - AppendChild(para); - - firstPara = para; - lastPara = para; - - while (i < len) - { - wxChar ch = text[i]; - if (ch == wxT('\n') || ch == wxT('\r')) - { - if (i != (len-1)) - { - wxRichTextPlainText* plainText = (wxRichTextPlainText*) para->GetChildren().GetFirst()->GetData(); - plainText->SetText(line); - - para = new wxRichTextParagraph(wxEmptyString, this, pStyle, cStyle); - - AppendChild(para); - - lastPara = para; - line = wxEmptyString; - } - } - else - line += ch; - - i ++; - } - - if (!line.empty()) - { - wxRichTextPlainText* plainText = (wxRichTextPlainText*) para->GetChildren().GetFirst()->GetData(); - plainText->SetText(line); - } - - UpdateRanges(); - - SetDirty(false); - - return wxRichTextRange(firstPara->GetRange().GetStart(), lastPara->GetRange().GetEnd()); -} - -/// Convenience function to add an image -wxRichTextRange wxRichTextParagraphLayoutBox::AddImage(const wxImage& image, wxTextAttrEx* paraStyle) -{ - // Don't use the base style, just the default style, and the base style will - // be combined at display time. - // Divide into paragraph and character styles. - - wxTextAttrEx defaultCharStyle; - wxTextAttrEx defaultParaStyle; - - // If the default style is a named paragraph style, don't apply any character formatting - // to the initial text string. - if (GetDefaultStyle().HasParagraphStyleName() && GetStyleSheet()) - { - wxRichTextParagraphStyleDefinition* def = GetStyleSheet()->FindParagraphStyle(GetDefaultStyle().GetParagraphStyleName()); - if (def) - defaultParaStyle = def->GetStyleMergedWithBase(GetStyleSheet()); - } - else - wxRichTextSplitParaCharStyles(GetDefaultStyle(), defaultParaStyle, defaultCharStyle); - - wxTextAttrEx* pStyle = paraStyle ? paraStyle : (wxTextAttrEx*) & defaultParaStyle; - wxTextAttrEx* cStyle = & defaultCharStyle; - - wxRichTextParagraph* para = new wxRichTextParagraph(this, pStyle); - AppendChild(para); - para->AppendChild(new wxRichTextImage(image, this, cStyle)); - - UpdateRanges(); - SetDirty(true); - - return para->GetRange(); -} - - -/// Insert fragment into this box at the given position. If partialParagraph is true, -/// it is assumed that the last (or only) paragraph is just a piece of data with no paragraph -/// marker. - -bool wxRichTextParagraphLayoutBox::InsertFragment(long position, wxRichTextParagraphLayoutBox& fragment) -{ - SetDirty(true); - - // First, find the first paragraph whose starting position is within the range. - wxRichTextParagraph* para = GetParagraphAtPosition(position); - if (para) - { - wxTextAttrEx originalAttr = para->GetAttributes(); - - wxRichTextObjectList::compatibility_iterator node = m_children.Find(para); - - // Now split at this position, returning the object to insert the new - // ones in front of. - wxRichTextObject* nextObject = para->SplitAt(position); - - // Special case: partial paragraph, just one paragraph. Might be a small amount of - // text, for example, so let's optimize. - - if (fragment.GetPartialParagraph() && fragment.GetChildren().GetCount() == 1) - { - // Add the first para to this para... - wxRichTextObjectList::compatibility_iterator firstParaNode = fragment.GetChildren().GetFirst(); - if (!firstParaNode) - return false; - - // Iterate through the fragment paragraph inserting the content into this paragraph. - wxRichTextParagraph* firstPara = wxDynamicCast(firstParaNode->GetData(), wxRichTextParagraph); - wxASSERT (firstPara != NULL); - - wxRichTextObjectList::compatibility_iterator objectNode = firstPara->GetChildren().GetFirst(); - while (objectNode) - { - wxRichTextObject* newObj = objectNode->GetData()->Clone(); - - if (!nextObject) - { - // Append - para->AppendChild(newObj); - } - else - { - // Insert before nextObject - para->InsertChild(newObj, nextObject); - } - - objectNode = objectNode->GetNext(); - } - - return true; - } - else - { - // Procedure for inserting a fragment consisting of a number of - // paragraphs: - // - // 1. Remove and save the content that's after the insertion point, for adding - // back once we've added the fragment. - // 2. Add the content from the first fragment paragraph to the current - // paragraph. - // 3. Add remaining fragment paragraphs after the current paragraph. - // 4. Add back the saved content from the first paragraph. If partialParagraph - // is true, add it to the last paragraph added and not a new one. - - // 1. Remove and save objects after split point. - wxList savedObjects; - if (nextObject) - para->MoveToList(nextObject, savedObjects); - - // 2. Add the content from the 1st fragment paragraph. - wxRichTextObjectList::compatibility_iterator firstParaNode = fragment.GetChildren().GetFirst(); - if (!firstParaNode) - return false; - - wxRichTextParagraph* firstPara = wxDynamicCast(firstParaNode->GetData(), wxRichTextParagraph); - wxASSERT(firstPara != NULL); - - if (!(fragment.GetAttributes().GetFlags() & wxTEXT_ATTR_KEEP_FIRST_PARA_STYLE)) - para->SetAttributes(firstPara->GetAttributes()); - - // Save empty paragraph attributes for appending later - // These are character attributes deliberately set for a new paragraph. Without this, - // we couldn't pass default attributes when appending a new paragraph. - wxTextAttrEx emptyParagraphAttributes; - - wxRichTextObjectList::compatibility_iterator objectNode = firstPara->GetChildren().GetFirst(); - - if (objectNode && firstPara->GetChildren().GetCount() == 1 && objectNode->GetData()->IsEmpty()) - emptyParagraphAttributes = objectNode->GetData()->GetAttributes(); - - while (objectNode) - { - wxRichTextObject* newObj = objectNode->GetData()->Clone(); - - // Append - para->AppendChild(newObj); - - objectNode = objectNode->GetNext(); - } - - // 3. Add remaining fragment paragraphs after the current paragraph. - wxRichTextObjectList::compatibility_iterator nextParagraphNode = node->GetNext(); - wxRichTextObject* nextParagraph = NULL; - if (nextParagraphNode) - nextParagraph = nextParagraphNode->GetData(); - - wxRichTextObjectList::compatibility_iterator i = fragment.GetChildren().GetFirst()->GetNext(); - wxRichTextParagraph* finalPara = para; - - bool needExtraPara = (!i || !fragment.GetPartialParagraph()); - - while (i) - { - wxRichTextParagraph* para = wxDynamicCast(i->GetData(), wxRichTextParagraph); - wxASSERT( para != NULL ); - - finalPara = (wxRichTextParagraph*) para->Clone(); - - if (nextParagraph) - InsertChild(finalPara, nextParagraph); - else - AppendChild(finalPara); - - i = i->GetNext(); - } - - // If there was only one paragraph, or we have full paragraphs in our fragment, - // we need to insert a new one. - if (needExtraPara) - { - finalPara = new wxRichTextParagraph; - - if (nextParagraph) - InsertChild(finalPara, nextParagraph); - else - AppendChild(finalPara); - } - - // 4. Add back the remaining content. - if (finalPara) - { - if (nextObject) - finalPara->MoveFromList(savedObjects); - - // Ensure there's at least one object - if (finalPara->GetChildCount() == 0) - { - wxRichTextPlainText* text = new wxRichTextPlainText(wxEmptyString); - text->SetAttributes(emptyParagraphAttributes); - - finalPara->AppendChild(text); - } - } - - if ((fragment.GetAttributes().GetFlags() & wxTEXT_ATTR_KEEP_FIRST_PARA_STYLE) && firstPara) - finalPara->SetAttributes(firstPara->GetAttributes()); - else if (finalPara && finalPara != para) - finalPara->SetAttributes(originalAttr); - - return true; - } - } - else - { - // Append - wxRichTextObjectList::compatibility_iterator i = fragment.GetChildren().GetFirst(); - while (i) - { - wxRichTextParagraph* para = wxDynamicCast(i->GetData(), wxRichTextParagraph); - wxASSERT( para != NULL ); - - AppendChild(para->Clone()); - - i = i->GetNext(); - } - - return true; - } -} - -/// Make a copy of the fragment corresponding to the given range, putting it in 'fragment'. -/// If there was an incomplete paragraph at the end, partialParagraph is set to true. -bool wxRichTextParagraphLayoutBox::CopyFragment(const wxRichTextRange& range, wxRichTextParagraphLayoutBox& fragment) -{ - wxRichTextObjectList::compatibility_iterator i = GetChildren().GetFirst(); - while (i) - { - wxRichTextParagraph* para = wxDynamicCast(i->GetData(), wxRichTextParagraph); - wxASSERT( para != NULL ); - - if (!para->GetRange().IsOutside(range)) - { - fragment.AppendChild(para->Clone()); - } - i = i->GetNext(); - } - - // Now top and tail the first and last paragraphs in our new fragment (which might be the same). - if (!fragment.IsEmpty()) - { - wxRichTextRange topTailRange(range); - - wxRichTextParagraph* firstPara = wxDynamicCast(fragment.GetChildren().GetFirst()->GetData(), wxRichTextParagraph); - wxASSERT( firstPara != NULL ); - - // Chop off the start of the paragraph - if (topTailRange.GetStart() > firstPara->GetRange().GetStart()) - { - wxRichTextRange r(firstPara->GetRange().GetStart(), topTailRange.GetStart()-1); - firstPara->DeleteRange(r); - - // Make sure the numbering is correct - long end; - fragment.CalculateRange(firstPara->GetRange().GetStart(), end); - - // Now, we've deleted some positions, so adjust the range - // accordingly. - topTailRange.SetEnd(topTailRange.GetEnd() - r.GetLength()); - } - - wxRichTextParagraph* lastPara = wxDynamicCast(fragment.GetChildren().GetLast()->GetData(), wxRichTextParagraph); - wxASSERT( lastPara != NULL ); - - if (topTailRange.GetEnd() < (lastPara->GetRange().GetEnd()-1)) - { - wxRichTextRange r(topTailRange.GetEnd()+1, lastPara->GetRange().GetEnd()-1); /* -1 since actual text ends 1 position before end of para marker */ - lastPara->DeleteRange(r); - - // Make sure the numbering is correct - long end; - fragment.CalculateRange(firstPara->GetRange().GetStart(), end); - - // We only have part of a paragraph at the end - fragment.SetPartialParagraph(true); - } - else - { - if (topTailRange.GetEnd() == (lastPara->GetRange().GetEnd() - 1)) - // We have a partial paragraph (don't save last new paragraph marker) - fragment.SetPartialParagraph(true); - else - // We have a complete paragraph - fragment.SetPartialParagraph(false); - } - } - - return true; -} - -/// Given a position, get the number of the visible line (potentially many to a paragraph), -/// starting from zero at the start of the buffer. -long wxRichTextParagraphLayoutBox::GetVisibleLineNumber(long pos, bool caretPosition, bool startOfLine) const -{ - if (caretPosition) - pos ++; - - int lineCount = 0; - - wxRichTextObjectList::compatibility_iterator node = m_children.GetFirst(); - while (node) - { - wxRichTextParagraph* child = wxDynamicCast(node->GetData(), wxRichTextParagraph); - wxASSERT( child != NULL ); - - if (child->GetRange().Contains(pos) || pos == child->GetRange().GetStart()) - { - wxRichTextLineList::compatibility_iterator node2 = child->GetLines().GetFirst(); - while (node2) - { - wxRichTextLine* line = node2->GetData(); - wxRichTextRange lineRange = line->GetAbsoluteRange(); - - if (lineRange.Contains(pos)) - { - // If the caret is displayed at the end of the previous wrapped line, - // we want to return the line it's _displayed_ at (not the actual line - // containing the position). - if (lineRange.GetStart() == pos && !startOfLine && child->GetRange().GetStart() != pos) - return lineCount - 1; - else - return lineCount; - } - - lineCount ++; - - node2 = node2->GetNext(); - } - // If we didn't find it in the lines, it must be - // the last position of the paragraph. So return the last line. - return lineCount-1; - } - else - lineCount += child->GetLines().GetCount(); - - node = node->GetNext(); - } - - // Not found - return -1; -} - -/// Given a line number, get the corresponding wxRichTextLine object. -wxRichTextLine* wxRichTextParagraphLayoutBox::GetLineForVisibleLineNumber(long lineNumber) const -{ - int lineCount = 0; - - wxRichTextObjectList::compatibility_iterator node = m_children.GetFirst(); - while (node) - { - wxRichTextParagraph* child = wxDynamicCast(node->GetData(), wxRichTextParagraph); - wxASSERT(child != NULL); - - if (lineNumber < (int) (child->GetLines().GetCount() + lineCount)) - { - wxRichTextLineList::compatibility_iterator node2 = child->GetLines().GetFirst(); - while (node2) - { - wxRichTextLine* line = node2->GetData(); - - if (lineCount == lineNumber) - return line; - - lineCount ++; - - node2 = node2->GetNext(); - } - } - else - lineCount += child->GetLines().GetCount(); - - node = node->GetNext(); - } - - // Didn't find it - return NULL; -} - -/// Delete range from layout. -bool wxRichTextParagraphLayoutBox::DeleteRange(const wxRichTextRange& range) -{ - wxRichTextObjectList::compatibility_iterator node = m_children.GetFirst(); - - wxRichTextParagraph* firstPara = NULL; - while (node) - { - wxRichTextParagraph* obj = wxDynamicCast(node->GetData(), wxRichTextParagraph); - wxASSERT (obj != NULL); - - wxRichTextObjectList::compatibility_iterator next = node->GetNext(); - - // Delete the range in each paragraph - - if (!obj->GetRange().IsOutside(range)) - { - wxRichTextRange thisRange = obj->GetRange(); - wxTextAttrEx thisAttr = obj->GetAttributes(); - - // Deletes the content of this object within the given range - obj->DeleteRange(range); - - // If the whole paragraph is within the range to delete, - // delete the whole thing. - if (range.GetStart() <= thisRange.GetStart() && range.GetEnd() >= thisRange.GetEnd()) - { - // Delete the whole object - RemoveChild(obj, true); - obj = NULL; - } - else if (!firstPara) - firstPara = obj; - - // If the range includes the paragraph end, we need to join this - // and the next paragraph. - if (range.GetEnd() <= thisRange.GetEnd()) - { - // We need to move the objects from the next paragraph - // to this paragraph - - wxRichTextParagraph* nextParagraph = NULL; - if ((range.GetEnd() < thisRange.GetEnd()) && obj) - nextParagraph = obj; - else - { - // We're ending at the end of the paragraph, so merge the _next_ paragraph. - if (next) - nextParagraph = wxDynamicCast(next->GetData(), wxRichTextParagraph); - } - - bool applyFinalParagraphStyle = firstPara && nextParagraph && nextParagraph != firstPara; - - wxTextAttrEx nextParaAttr; - if (applyFinalParagraphStyle) - { - // Special case when deleting the end of a paragraph - use _this_ paragraph's style, - // not the next one. - if (range.GetStart() == range.GetEnd() && range.GetStart() == thisRange.GetEnd()) - nextParaAttr = thisAttr; - else - nextParaAttr = nextParagraph->GetAttributes(); - } - - if (firstPara && nextParagraph && firstPara != nextParagraph) - { - // Move the objects to the previous para - wxRichTextObjectList::compatibility_iterator node1 = nextParagraph->GetChildren().GetFirst(); - - while (node1) - { - wxRichTextObject* obj1 = node1->GetData(); - - firstPara->AppendChild(obj1); - - wxRichTextObjectList::compatibility_iterator next1 = node1->GetNext(); - nextParagraph->GetChildren().Erase(node1); - - node1 = next1; - } - - // Delete the paragraph - RemoveChild(nextParagraph, true); - } - - // Avoid empty paragraphs - if (firstPara && firstPara->GetChildren().GetCount() == 0) - { - wxRichTextPlainText* text = new wxRichTextPlainText(wxEmptyString); - firstPara->AppendChild(text); - } - - if (applyFinalParagraphStyle) - firstPara->SetAttributes(nextParaAttr); - - return true; - } - } - - node = next; - } - - return true; -} - -/// Get any text in this object for the given range -wxString wxRichTextParagraphLayoutBox::GetTextForRange(const wxRichTextRange& range) const -{ - int lineCount = 0; - wxString text; - wxRichTextObjectList::compatibility_iterator node = m_children.GetFirst(); - while (node) - { - wxRichTextObject* child = node->GetData(); - if (!child->GetRange().IsOutside(range)) - { - wxRichTextRange childRange = range; - childRange.LimitTo(child->GetRange()); - - wxString childText = child->GetTextForRange(childRange); - - text += childText; - - if ((childRange.GetEnd() == child->GetRange().GetEnd()) && node->GetNext()) - text += wxT("\n"); - - lineCount ++; - } - node = node->GetNext(); - } - - return text; -} - -/// Get all the text -wxString wxRichTextParagraphLayoutBox::GetText() const -{ - return GetTextForRange(GetRange()); -} - -/// Get the paragraph by number -wxRichTextParagraph* wxRichTextParagraphLayoutBox::GetParagraphAtLine(long paragraphNumber) const -{ - if ((size_t) paragraphNumber >= GetChildCount()) - return NULL; - - return (wxRichTextParagraph*) GetChild((size_t) paragraphNumber); -} - -/// Get the length of the paragraph -int wxRichTextParagraphLayoutBox::GetParagraphLength(long paragraphNumber) const -{ - wxRichTextParagraph* para = GetParagraphAtLine(paragraphNumber); - if (para) - return para->GetRange().GetLength() - 1; // don't include newline - else - return 0; -} - -/// Get the text of the paragraph -wxString wxRichTextParagraphLayoutBox::GetParagraphText(long paragraphNumber) const -{ - wxRichTextParagraph* para = GetParagraphAtLine(paragraphNumber); - if (para) - return para->GetTextForRange(para->GetRange()); - else - return wxEmptyString; -} - -/// Convert zero-based line column and paragraph number to a position. -long wxRichTextParagraphLayoutBox::XYToPosition(long x, long y) const -{ - wxRichTextParagraph* para = GetParagraphAtLine(y); - if (para) - { - return para->GetRange().GetStart() + x; - } - else - return -1; -} - -/// Convert zero-based position to line column and paragraph number -bool wxRichTextParagraphLayoutBox::PositionToXY(long pos, long* x, long* y) const -{ - wxRichTextParagraph* para = GetParagraphAtPosition(pos); - if (para) - { - int count = 0; - wxRichTextObjectList::compatibility_iterator node = m_children.GetFirst(); - while (node) - { - wxRichTextObject* child = node->GetData(); - if (child == para) - break; - count ++; - node = node->GetNext(); - } - - *y = count; - *x = pos - para->GetRange().GetStart(); - - return true; - } - else - return false; -} - -/// Get the leaf object in a paragraph at this position. -/// Given a line number, get the corresponding wxRichTextLine object. -wxRichTextObject* wxRichTextParagraphLayoutBox::GetLeafObjectAtPosition(long position) const -{ - wxRichTextParagraph* para = GetParagraphAtPosition(position); - if (para) - { - wxRichTextObjectList::compatibility_iterator node = para->GetChildren().GetFirst(); - - while (node) - { - wxRichTextObject* child = node->GetData(); - if (child->GetRange().Contains(position)) - return child; - - node = node->GetNext(); - } - if (position == para->GetRange().GetEnd() && para->GetChildCount() > 0) - return para->GetChildren().GetLast()->GetData(); - } - return NULL; -} - -/// Set character or paragraph text attributes: apply character styles only to immediate text nodes -bool wxRichTextParagraphLayoutBox::SetStyle(const wxRichTextRange& range, const wxRichTextAttr& style, int flags) -{ - bool characterStyle = false; - bool paragraphStyle = false; - - if (style.IsCharacterStyle()) - characterStyle = true; - if (style.IsParagraphStyle()) - paragraphStyle = true; - - bool withUndo = ((flags & wxRICHTEXT_SETSTYLE_WITH_UNDO) != 0); - bool applyMinimal = ((flags & wxRICHTEXT_SETSTYLE_OPTIMIZE) != 0); - bool parasOnly = ((flags & wxRICHTEXT_SETSTYLE_PARAGRAPHS_ONLY) != 0); - bool charactersOnly = ((flags & wxRICHTEXT_SETSTYLE_CHARACTERS_ONLY) != 0); - bool resetExistingStyle = ((flags & wxRICHTEXT_SETSTYLE_RESET) != 0); - bool removeStyle = ((flags & wxRICHTEXT_SETSTYLE_REMOVE) != 0); - - // Apply paragraph style first, if any - wxRichTextAttr wholeStyle(style); - - if (!removeStyle && wholeStyle.HasParagraphStyleName() && GetStyleSheet()) - { - wxRichTextParagraphStyleDefinition* def = GetStyleSheet()->FindParagraphStyle(wholeStyle.GetParagraphStyleName()); - if (def) - wxRichTextApplyStyle(wholeStyle, def->GetStyleMergedWithBase(GetStyleSheet())); - } - - // Limit the attributes to be set to the content to only character attributes. - wxRichTextAttr characterAttributes(wholeStyle); - characterAttributes.SetFlags(characterAttributes.GetFlags() & (wxTEXT_ATTR_CHARACTER)); - - if (!removeStyle && characterAttributes.HasCharacterStyleName() && GetStyleSheet()) - { - wxRichTextCharacterStyleDefinition* def = GetStyleSheet()->FindCharacterStyle(characterAttributes.GetCharacterStyleName()); - if (def) - wxRichTextApplyStyle(characterAttributes, def->GetStyleMergedWithBase(GetStyleSheet())); - } - - // If we are associated with a control, make undoable; otherwise, apply immediately - // to the data. - - bool haveControl = (GetRichTextCtrl() != NULL); - - wxRichTextAction* action = NULL; - - if (haveControl && withUndo) - { - action = new wxRichTextAction(NULL, _("Change Style"), wxRICHTEXT_CHANGE_STYLE, & GetRichTextCtrl()->GetBuffer(), GetRichTextCtrl()); - action->SetRange(range); - action->SetPosition(GetRichTextCtrl()->GetCaretPosition()); - } - - wxRichTextObjectList::compatibility_iterator node = m_children.GetFirst(); - while (node) - { - wxRichTextParagraph* para = wxDynamicCast(node->GetData(), wxRichTextParagraph); - wxASSERT (para != NULL); - - if (para && para->GetChildCount() > 0) - { - // Stop searching if we're beyond the range of interest - if (para->GetRange().GetStart() > range.GetEnd()) - break; - - if (!para->GetRange().IsOutside(range)) - { - // We'll be using a copy of the paragraph to make style changes, - // not updating the buffer directly. - wxRichTextParagraph* newPara wxDUMMY_INITIALIZE(NULL); - - if (haveControl && withUndo) - { - newPara = new wxRichTextParagraph(*para); - action->GetNewParagraphs().AppendChild(newPara); - - // Also store the old ones for Undo - action->GetOldParagraphs().AppendChild(new wxRichTextParagraph(*para)); - } - else - newPara = para; - - // If we're specifying paragraphs only, then we really mean character formatting - // to be included in the paragraph style - if ((paragraphStyle || parasOnly) && !charactersOnly) - { - if (removeStyle) - { - // Removes the given style from the paragraph - wxRichTextRemoveStyle(newPara->GetAttributes(), style); - } - else if (resetExistingStyle) - newPara->GetAttributes() = wholeStyle; - else - { - if (applyMinimal) - { - // Only apply attributes that will make a difference to the combined - // style as seen on the display - wxRichTextAttr combinedAttr(para->GetCombinedAttributes()); - wxRichTextApplyStyle(newPara->GetAttributes(), wholeStyle, & combinedAttr); - } - else - wxRichTextApplyStyle(newPara->GetAttributes(), wholeStyle); - } - } - - // When applying paragraph styles dynamically, don't change the text objects' attributes - // since they will computed as needed. Only apply the character styling if it's _only_ - // character styling. This policy is subject to change and might be put under user control. - - // Hm. we might well be applying a mix of paragraph and character styles, in which - // case we _do_ want to apply character styles regardless of what para styles are set. - // But if we're applying a paragraph style, which has some character attributes, but - // we only want the paragraphs to hold this character style, then we _don't_ want to - // apply the character style. So we need to be able to choose. - - if (!parasOnly && (characterStyle|charactersOnly) && range.GetStart() != newPara->GetRange().GetEnd()) - { - wxRichTextRange childRange(range); - childRange.LimitTo(newPara->GetRange()); - - // Find the starting position and if necessary split it so - // we can start applying a different style. - // TODO: check that the style actually changes or is different - // from style outside of range - wxRichTextObject* firstObject wxDUMMY_INITIALIZE(NULL); - wxRichTextObject* lastObject wxDUMMY_INITIALIZE(NULL); - - if (childRange.GetStart() == newPara->GetRange().GetStart()) - firstObject = newPara->GetChildren().GetFirst()->GetData(); - else - firstObject = newPara->SplitAt(range.GetStart()); - - // Increment by 1 because we're apply the style one _after_ the split point - long splitPoint = childRange.GetEnd(); - if (splitPoint != newPara->GetRange().GetEnd()) - splitPoint ++; - - // Find last object - if (splitPoint == newPara->GetRange().GetEnd()) - lastObject = newPara->GetChildren().GetLast()->GetData(); - else - // lastObject is set as a side-effect of splitting. It's - // returned as the object before the new object. - (void) newPara->SplitAt(splitPoint, & lastObject); - - wxASSERT(firstObject != NULL); - wxASSERT(lastObject != NULL); - - if (!firstObject || !lastObject) - continue; - - wxRichTextObjectList::compatibility_iterator firstNode = newPara->GetChildren().Find(firstObject); - wxRichTextObjectList::compatibility_iterator lastNode = newPara->GetChildren().Find(lastObject); - - wxASSERT(firstNode); - wxASSERT(lastNode); - - wxRichTextObjectList::compatibility_iterator node2 = firstNode; - - while (node2) - { - wxRichTextObject* child = node2->GetData(); - - if (removeStyle) - { - // Removes the given style from the paragraph - wxRichTextRemoveStyle(child->GetAttributes(), style); - } - else if (resetExistingStyle) - child->GetAttributes() = characterAttributes; - else - { - if (applyMinimal) - { - // Only apply attributes that will make a difference to the combined - // style as seen on the display - wxRichTextAttr combinedAttr(newPara->GetCombinedAttributes(child->GetAttributes())); - wxRichTextApplyStyle(child->GetAttributes(), characterAttributes, & combinedAttr); - } - else - wxRichTextApplyStyle(child->GetAttributes(), characterAttributes); - } - - if (node2 == lastNode) - break; - - node2 = node2->GetNext(); - } - } - } - } - - node = node->GetNext(); - } - - // Do action, or delay it until end of batch. - if (haveControl && withUndo) - GetRichTextCtrl()->GetBuffer().SubmitAction(action); - - return true; -} - -/// Set text attributes -bool wxRichTextParagraphLayoutBox::SetStyle(const wxRichTextRange& range, const wxTextAttrEx& style, int flags) -{ - wxRichTextAttr richStyle = style; - return SetStyle(range, richStyle, flags); -} - -/// Get the text attributes for this position. -bool wxRichTextParagraphLayoutBox::GetStyle(long position, wxTextAttrEx& style) -{ - return DoGetStyle(position, style, true); -} - -/// Get the text attributes for this position. -bool wxRichTextParagraphLayoutBox::GetStyle(long position, wxRichTextAttr& style) -{ - wxTextAttrEx textAttrEx(style); - if (GetStyle(position, textAttrEx)) - { - style = textAttrEx; - return true; - } - else - return false; -} - -/// Get the content (uncombined) attributes for this position. -bool wxRichTextParagraphLayoutBox::GetUncombinedStyle(long position, wxTextAttrEx& style) -{ - return DoGetStyle(position, style, false); -} - -bool wxRichTextParagraphLayoutBox::GetUncombinedStyle(long position, wxRichTextAttr& style) -{ - wxTextAttrEx textAttrEx(style); - if (GetUncombinedStyle(position, textAttrEx)) - { - style = textAttrEx; - return true; - } - else - return false; -} - -/// Implementation helper for GetStyle. If combineStyles is true, combine base, paragraph and -/// context attributes. -bool wxRichTextParagraphLayoutBox::DoGetStyle(long position, wxTextAttrEx& style, bool combineStyles) -{ - wxRichTextObject* obj wxDUMMY_INITIALIZE(NULL); - - if (style.IsParagraphStyle()) - { - obj = GetParagraphAtPosition(position); - if (obj) - { - if (combineStyles) - { - // Start with the base style - style = GetAttributes(); - - // Apply the paragraph style - wxRichTextApplyStyle(style, obj->GetAttributes()); - } - else - style = obj->GetAttributes(); - - return true; - } - } - else - { - obj = GetLeafObjectAtPosition(position); - if (obj) - { - if (combineStyles) - { - wxRichTextParagraph* para = wxDynamicCast(obj->GetParent(), wxRichTextParagraph); - style = para ? para->GetCombinedAttributes(obj->GetAttributes()) : obj->GetAttributes(); - } - else - style = obj->GetAttributes(); - - return true; - } - } - return false; -} - -static bool wxHasStyle(long flags, long style) -{ - return (flags & style) != 0; -} - -/// Combines 'style' with 'currentStyle' for the purpose of summarising the attributes of a range of -/// content. -bool wxRichTextParagraphLayoutBox::CollectStyle(wxTextAttrEx& currentStyle, const wxTextAttrEx& style, long& multipleStyleAttributes, int& multipleTextEffectAttributes) -{ - if (style.HasFont()) - { - if (style.HasFontSize() && !wxHasStyle(multipleStyleAttributes, wxTEXT_ATTR_FONT_SIZE)) - { - if (currentStyle.GetFont().Ok() && currentStyle.HasFontSize()) - { - if (currentStyle.GetFont().GetPointSize() != style.GetFont().GetPointSize()) - { - // Clash of style - mark as such - multipleStyleAttributes |= wxTEXT_ATTR_FONT_SIZE; - currentStyle.SetFlags(currentStyle.GetFlags() & ~wxTEXT_ATTR_FONT_SIZE); - } - } - else - { - if (!currentStyle.GetFont().Ok()) - wxSetFontPreservingStyles(currentStyle, *wxNORMAL_FONT); - wxFont font(currentStyle.GetFont()); - wxFontSetPointSize(font, style.GetFont().GetPointSize()); - - wxSetFontPreservingStyles(currentStyle, font); - currentStyle.SetFlags(currentStyle.GetFlags() | wxTEXT_ATTR_FONT_SIZE); - } - } - - if (style.HasFontItalic() && !wxHasStyle(multipleStyleAttributes, wxTEXT_ATTR_FONT_ITALIC)) - { - if (currentStyle.GetFont().Ok() && currentStyle.HasFontItalic()) - { - if (currentStyle.GetFont().GetStyle() != style.GetFont().GetStyle()) - { - // Clash of style - mark as such - multipleStyleAttributes |= wxTEXT_ATTR_FONT_ITALIC; - currentStyle.SetFlags(currentStyle.GetFlags() & ~wxTEXT_ATTR_FONT_ITALIC); - } - } - else - { - if (!currentStyle.GetFont().Ok()) - wxSetFontPreservingStyles(currentStyle, *wxNORMAL_FONT); - wxFont font(currentStyle.GetFont()); - wxFontSetStyle(font, style.GetFont().GetStyle()); - wxSetFontPreservingStyles(currentStyle, font); - currentStyle.SetFlags(currentStyle.GetFlags() | wxTEXT_ATTR_FONT_ITALIC); - } - } - - if (style.HasFontWeight() && !wxHasStyle(multipleStyleAttributes, wxTEXT_ATTR_FONT_WEIGHT)) - { - if (currentStyle.GetFont().Ok() && currentStyle.HasFontWeight()) - { - if (currentStyle.GetFont().GetWeight() != style.GetFont().GetWeight()) - { - // Clash of style - mark as such - multipleStyleAttributes |= wxTEXT_ATTR_FONT_WEIGHT; - currentStyle.SetFlags(currentStyle.GetFlags() & ~wxTEXT_ATTR_FONT_WEIGHT); - } - } - else - { - if (!currentStyle.GetFont().Ok()) - wxSetFontPreservingStyles(currentStyle, *wxNORMAL_FONT); - wxFont font(currentStyle.GetFont()); - wxFontSetWeight(font, style.GetFont().GetWeight()); - wxSetFontPreservingStyles(currentStyle, font); - currentStyle.SetFlags(currentStyle.GetFlags() | wxTEXT_ATTR_FONT_WEIGHT); - } - } - - if (style.HasFontFaceName() && !wxHasStyle(multipleStyleAttributes, wxTEXT_ATTR_FONT_FACE)) - { - if (currentStyle.GetFont().Ok() && currentStyle.HasFontFaceName()) - { - wxString faceName1(currentStyle.GetFont().GetFaceName()); - wxString faceName2(style.GetFont().GetFaceName()); - - if (faceName1 != faceName2) - { - // Clash of style - mark as such - multipleStyleAttributes |= wxTEXT_ATTR_FONT_FACE; - currentStyle.SetFlags(currentStyle.GetFlags() & ~wxTEXT_ATTR_FONT_FACE); - } - } - else - { - if (!currentStyle.GetFont().Ok()) - wxSetFontPreservingStyles(currentStyle, *wxNORMAL_FONT); - wxFont font(currentStyle.GetFont()); - wxFontSetFaceName(font, style.GetFont().GetFaceName()); - wxSetFontPreservingStyles(currentStyle, font); - currentStyle.SetFlags(currentStyle.GetFlags() | wxTEXT_ATTR_FONT_FACE); - } - } - - if (style.HasFontUnderlined() && !wxHasStyle(multipleStyleAttributes, wxTEXT_ATTR_FONT_UNDERLINE)) - { - if (currentStyle.GetFont().Ok() && currentStyle.HasFontUnderlined()) - { - if (currentStyle.GetFont().GetUnderlined() != style.GetFont().GetUnderlined()) - { - // Clash of style - mark as such - multipleStyleAttributes |= wxTEXT_ATTR_FONT_UNDERLINE; - currentStyle.SetFlags(currentStyle.GetFlags() & ~wxTEXT_ATTR_FONT_UNDERLINE); - } - } - else - { - if (!currentStyle.GetFont().Ok()) - wxSetFontPreservingStyles(currentStyle, *wxNORMAL_FONT); - wxFont font(currentStyle.GetFont()); - wxFontSetUnderlined(font, style.GetFont().GetUnderlined()); - wxSetFontPreservingStyles(currentStyle, font); - currentStyle.SetFlags(currentStyle.GetFlags() | wxTEXT_ATTR_FONT_UNDERLINE); - } - } - } - - if (style.HasTextColour() && !wxHasStyle(multipleStyleAttributes, wxTEXT_ATTR_TEXT_COLOUR)) - { - if (currentStyle.HasTextColour()) - { - if (currentStyle.GetTextColour() != style.GetTextColour()) - { - // Clash of style - mark as such - multipleStyleAttributes |= wxTEXT_ATTR_TEXT_COLOUR; - currentStyle.SetFlags(currentStyle.GetFlags() & ~wxTEXT_ATTR_TEXT_COLOUR); - } - } - else - currentStyle.SetTextColour(style.GetTextColour()); - } - - if (style.HasBackgroundColour() && !wxHasStyle(multipleStyleAttributes, wxTEXT_ATTR_BACKGROUND_COLOUR)) - { - if (currentStyle.HasBackgroundColour()) - { - if (currentStyle.GetBackgroundColour() != style.GetBackgroundColour()) - { - // Clash of style - mark as such - multipleStyleAttributes |= wxTEXT_ATTR_BACKGROUND_COLOUR; - currentStyle.SetFlags(currentStyle.GetFlags() & ~wxTEXT_ATTR_BACKGROUND_COLOUR); - } - } - else - currentStyle.SetBackgroundColour(style.GetBackgroundColour()); - } - - if (style.HasAlignment() && !wxHasStyle(multipleStyleAttributes, wxTEXT_ATTR_ALIGNMENT)) - { - if (currentStyle.HasAlignment()) - { - if (currentStyle.GetAlignment() != style.GetAlignment()) - { - // Clash of style - mark as such - multipleStyleAttributes |= wxTEXT_ATTR_ALIGNMENT; - currentStyle.SetFlags(currentStyle.GetFlags() & ~wxTEXT_ATTR_ALIGNMENT); - } - } - else - currentStyle.SetAlignment(style.GetAlignment()); - } - - if (style.HasTabs() && !wxHasStyle(multipleStyleAttributes, wxTEXT_ATTR_TABS)) - { - if (currentStyle.HasTabs()) - { - if (!wxRichTextTabsEq(currentStyle.GetTabs(), style.GetTabs())) - { - // Clash of style - mark as such - multipleStyleAttributes |= wxTEXT_ATTR_TABS; - currentStyle.SetFlags(currentStyle.GetFlags() & ~wxTEXT_ATTR_TABS); - } - } - else - currentStyle.SetTabs(style.GetTabs()); - } - - if (style.HasLeftIndent() && !wxHasStyle(multipleStyleAttributes, wxTEXT_ATTR_LEFT_INDENT)) - { - if (currentStyle.HasLeftIndent()) - { - if (currentStyle.GetLeftIndent() != style.GetLeftIndent() || currentStyle.GetLeftSubIndent() != style.GetLeftSubIndent()) - { - // Clash of style - mark as such - multipleStyleAttributes |= wxTEXT_ATTR_LEFT_INDENT; - currentStyle.SetFlags(currentStyle.GetFlags() & ~wxTEXT_ATTR_LEFT_INDENT); - } - } - else - currentStyle.SetLeftIndent(style.GetLeftIndent(), style.GetLeftSubIndent()); - } - - if (style.HasRightIndent() && !wxHasStyle(multipleStyleAttributes, wxTEXT_ATTR_RIGHT_INDENT)) - { - if (currentStyle.HasRightIndent()) - { - if (currentStyle.GetRightIndent() != style.GetRightIndent()) - { - // Clash of style - mark as such - multipleStyleAttributes |= wxTEXT_ATTR_RIGHT_INDENT; - currentStyle.SetFlags(currentStyle.GetFlags() & ~wxTEXT_ATTR_RIGHT_INDENT); - } - } - else - currentStyle.SetRightIndent(style.GetRightIndent()); - } - - if (style.HasParagraphSpacingAfter() && !wxHasStyle(multipleStyleAttributes, wxTEXT_ATTR_PARA_SPACING_AFTER)) - { - if (currentStyle.HasParagraphSpacingAfter()) - { - if (currentStyle.GetParagraphSpacingAfter() != style.GetParagraphSpacingAfter()) - { - // Clash of style - mark as such - multipleStyleAttributes |= wxTEXT_ATTR_PARA_SPACING_AFTER; - currentStyle.SetFlags(currentStyle.GetFlags() & ~wxTEXT_ATTR_PARA_SPACING_AFTER); - } - } - else - currentStyle.SetParagraphSpacingAfter(style.GetParagraphSpacingAfter()); - } - - if (style.HasParagraphSpacingBefore() && !wxHasStyle(multipleStyleAttributes, wxTEXT_ATTR_PARA_SPACING_BEFORE)) - { - if (currentStyle.HasParagraphSpacingBefore()) - { - if (currentStyle.GetParagraphSpacingBefore() != style.GetParagraphSpacingBefore()) - { - // Clash of style - mark as such - multipleStyleAttributes |= wxTEXT_ATTR_PARA_SPACING_BEFORE; - currentStyle.SetFlags(currentStyle.GetFlags() & ~wxTEXT_ATTR_PARA_SPACING_BEFORE); - } - } - else - currentStyle.SetParagraphSpacingBefore(style.GetParagraphSpacingBefore()); - } - - if (style.HasLineSpacing() && !wxHasStyle(multipleStyleAttributes, wxTEXT_ATTR_LINE_SPACING)) - { - if (currentStyle.HasLineSpacing()) - { - if (currentStyle.GetLineSpacing() != style.GetLineSpacing()) - { - // Clash of style - mark as such - multipleStyleAttributes |= wxTEXT_ATTR_LINE_SPACING; - currentStyle.SetFlags(currentStyle.GetFlags() & ~wxTEXT_ATTR_LINE_SPACING); - } - } - else - currentStyle.SetLineSpacing(style.GetLineSpacing()); - } - - if (style.HasCharacterStyleName() && !wxHasStyle(multipleStyleAttributes, wxTEXT_ATTR_CHARACTER_STYLE_NAME)) - { - if (currentStyle.HasCharacterStyleName()) - { - if (currentStyle.GetCharacterStyleName() != style.GetCharacterStyleName()) - { - // Clash of style - mark as such - multipleStyleAttributes |= wxTEXT_ATTR_CHARACTER_STYLE_NAME; - currentStyle.SetFlags(currentStyle.GetFlags() & ~wxTEXT_ATTR_CHARACTER_STYLE_NAME); - } - } - else - currentStyle.SetCharacterStyleName(style.GetCharacterStyleName()); - } - - if (style.HasParagraphStyleName() && !wxHasStyle(multipleStyleAttributes, wxTEXT_ATTR_PARAGRAPH_STYLE_NAME)) - { - if (currentStyle.HasParagraphStyleName()) - { - if (currentStyle.GetParagraphStyleName() != style.GetParagraphStyleName()) - { - // Clash of style - mark as such - multipleStyleAttributes |= wxTEXT_ATTR_PARAGRAPH_STYLE_NAME; - currentStyle.SetFlags(currentStyle.GetFlags() & ~wxTEXT_ATTR_PARAGRAPH_STYLE_NAME); - } - } - else - currentStyle.SetParagraphStyleName(style.GetParagraphStyleName()); - } - - if (style.HasListStyleName() && !wxHasStyle(multipleStyleAttributes, wxTEXT_ATTR_LIST_STYLE_NAME)) - { - if (currentStyle.HasListStyleName()) - { - if (currentStyle.GetListStyleName() != style.GetListStyleName()) - { - // Clash of style - mark as such - multipleStyleAttributes |= wxTEXT_ATTR_LIST_STYLE_NAME; - currentStyle.SetFlags(currentStyle.GetFlags() & ~wxTEXT_ATTR_LIST_STYLE_NAME); - } - } - else - currentStyle.SetListStyleName(style.GetListStyleName()); - } - - if (style.HasBulletStyle() && !wxHasStyle(multipleStyleAttributes, wxTEXT_ATTR_BULLET_STYLE)) - { - if (currentStyle.HasBulletStyle()) - { - if (currentStyle.GetBulletStyle() != style.GetBulletStyle()) - { - // Clash of style - mark as such - multipleStyleAttributes |= wxTEXT_ATTR_BULLET_STYLE; - currentStyle.SetFlags(currentStyle.GetFlags() & ~wxTEXT_ATTR_BULLET_STYLE); - } - } - else - currentStyle.SetBulletStyle(style.GetBulletStyle()); - } - - if (style.HasBulletNumber() && !wxHasStyle(multipleStyleAttributes, wxTEXT_ATTR_BULLET_NUMBER)) - { - if (currentStyle.HasBulletNumber()) - { - if (currentStyle.GetBulletNumber() != style.GetBulletNumber()) - { - // Clash of style - mark as such - multipleStyleAttributes |= wxTEXT_ATTR_BULLET_NUMBER; - currentStyle.SetFlags(currentStyle.GetFlags() & ~wxTEXT_ATTR_BULLET_NUMBER); - } - } - else - currentStyle.SetBulletNumber(style.GetBulletNumber()); - } - - if (style.HasBulletText() && !wxHasStyle(multipleStyleAttributes, wxTEXT_ATTR_BULLET_TEXT)) - { - if (currentStyle.HasBulletText()) - { - if (currentStyle.GetBulletText() != style.GetBulletText()) - { - // Clash of style - mark as such - multipleStyleAttributes |= wxTEXT_ATTR_BULLET_TEXT; - currentStyle.SetFlags(currentStyle.GetFlags() & ~wxTEXT_ATTR_BULLET_TEXT); - } - } - else - { - currentStyle.SetBulletText(style.GetBulletText()); - currentStyle.SetBulletFont(style.GetBulletFont()); - } - } - - if (style.HasBulletName() && !wxHasStyle(multipleStyleAttributes, wxTEXT_ATTR_BULLET_NAME)) - { - if (currentStyle.HasBulletName()) - { - if (currentStyle.GetBulletName() != style.GetBulletName()) - { - // Clash of style - mark as such - multipleStyleAttributes |= wxTEXT_ATTR_BULLET_NAME; - currentStyle.SetFlags(currentStyle.GetFlags() & ~wxTEXT_ATTR_BULLET_NAME); - } - } - else - { - currentStyle.SetBulletName(style.GetBulletName()); - } - } - - if (style.HasURL() && !wxHasStyle(multipleStyleAttributes, wxTEXT_ATTR_URL)) - { - if (currentStyle.HasURL()) - { - if (currentStyle.GetURL() != style.GetURL()) - { - // Clash of style - mark as such - multipleStyleAttributes |= wxTEXT_ATTR_URL; - currentStyle.SetFlags(currentStyle.GetFlags() & ~wxTEXT_ATTR_URL); - } - } - else - { - currentStyle.SetURL(style.GetURL()); - } - } - - if (style.HasTextEffects() && !wxHasStyle(multipleStyleAttributes, wxTEXT_ATTR_EFFECTS)) - { - if (currentStyle.HasTextEffects()) - { - // We need to find the bits in the new style that are different: - // just look at those bits that are specified by the new style. - - int currentRelevantTextEffects = currentStyle.GetTextEffects() & style.GetTextEffectFlags(); - int newRelevantTextEffects = style.GetTextEffects() & style.GetTextEffectFlags(); - - if (currentRelevantTextEffects != newRelevantTextEffects) - { - // Find the text effects that were different, using XOR - int differentEffects = currentRelevantTextEffects ^ newRelevantTextEffects; - - // Clash of style - mark as such - multipleTextEffectAttributes |= differentEffects; - currentStyle.SetTextEffectFlags(currentStyle.GetTextEffectFlags() & ~differentEffects); - } - } - else - { - currentStyle.SetTextEffects(style.GetTextEffects()); - currentStyle.SetTextEffectFlags(style.GetTextEffectFlags()); - } - } - - if (style.HasOutlineLevel() && !wxHasStyle(multipleStyleAttributes, wxTEXT_ATTR_OUTLINE_LEVEL)) - { - if (currentStyle.HasOutlineLevel()) - { - if (currentStyle.GetOutlineLevel() != style.GetOutlineLevel()) - { - // Clash of style - mark as such - multipleStyleAttributes |= wxTEXT_ATTR_OUTLINE_LEVEL; - currentStyle.SetFlags(currentStyle.GetFlags() & ~wxTEXT_ATTR_OUTLINE_LEVEL); - } - } - else - currentStyle.SetOutlineLevel(style.GetOutlineLevel()); - } - - return true; -} - -/// Combines 'style' with 'currentStyle' for the purpose of summarising the attributes of a range of -/// content. This version also takes account of attributes *not* being specified, which is just as important -/// as collecting attributes which are both present and common to all examined objects. -bool wxCollectStyle2(wxTextAttrEx& currentStyle, const wxTextAttrEx& style, long& multipleStyleAttributes, int& multipleTextEffectAttributes, long& absentStyleAttributes, int& absentTextEffectAttributes) -{ - absentStyleAttributes |= (~style.GetFlags() & wxTEXT_ATTR_ALL); - absentTextEffectAttributes |= (~style.GetTextEffectFlags() & 0xFFFF); - - if (style.HasFont()) - { - if (style.HasFontSize() && !wxHasStyle(multipleStyleAttributes|absentStyleAttributes, wxTEXT_ATTR_FONT_SIZE)) - { - if (currentStyle.GetFont().Ok() && currentStyle.HasFontSize()) - { - if (currentStyle.GetFont().GetPointSize() != style.GetFont().GetPointSize()) - { - // Clash of style - mark as such - multipleStyleAttributes |= wxTEXT_ATTR_FONT_SIZE; - currentStyle.SetFlags(currentStyle.GetFlags() & ~wxTEXT_ATTR_FONT_SIZE); - } - } - else - { - if (!currentStyle.GetFont().Ok()) - wxSetFontPreservingStyles(currentStyle, *wxNORMAL_FONT); - wxFont font(currentStyle.GetFont()); - wxFontSetPointSize(font, style.GetFont().GetPointSize()); - - wxSetFontPreservingStyles(currentStyle, font); - currentStyle.SetFlags(currentStyle.GetFlags() | wxTEXT_ATTR_FONT_SIZE); - } - } - - if (style.HasFontItalic() && !wxHasStyle(multipleStyleAttributes|absentStyleAttributes, wxTEXT_ATTR_FONT_ITALIC)) - { - if (currentStyle.GetFont().Ok() && currentStyle.HasFontItalic()) - { - if (currentStyle.GetFont().GetStyle() != style.GetFont().GetStyle()) - { - // Clash of style - mark as such - multipleStyleAttributes |= wxTEXT_ATTR_FONT_ITALIC; - currentStyle.SetFlags(currentStyle.GetFlags() & ~wxTEXT_ATTR_FONT_ITALIC); - } - } - else - { - if (!currentStyle.GetFont().Ok()) - wxSetFontPreservingStyles(currentStyle, *wxNORMAL_FONT); - wxFont font(currentStyle.GetFont()); - wxFontSetStyle(font, style.GetFont().GetStyle()); - wxSetFontPreservingStyles(currentStyle, font); - currentStyle.SetFlags(currentStyle.GetFlags() | wxTEXT_ATTR_FONT_ITALIC); - } - } - - if (style.HasFontWeight() && !wxHasStyle(multipleStyleAttributes|absentStyleAttributes, wxTEXT_ATTR_FONT_WEIGHT)) - { - if (currentStyle.GetFont().Ok() && currentStyle.HasFontWeight()) - { - if (currentStyle.GetFont().GetWeight() != style.GetFont().GetWeight()) - { - // Clash of style - mark as such - multipleStyleAttributes |= wxTEXT_ATTR_FONT_WEIGHT; - currentStyle.SetFlags(currentStyle.GetFlags() & ~wxTEXT_ATTR_FONT_WEIGHT); - } - } - else - { - if (!currentStyle.GetFont().Ok()) - wxSetFontPreservingStyles(currentStyle, *wxNORMAL_FONT); - wxFont font(currentStyle.GetFont()); - wxFontSetWeight(font, style.GetFont().GetWeight()); - wxSetFontPreservingStyles(currentStyle, font); - currentStyle.SetFlags(currentStyle.GetFlags() | wxTEXT_ATTR_FONT_WEIGHT); - } - } - - if (style.HasFontFaceName() && !wxHasStyle(multipleStyleAttributes|absentStyleAttributes, wxTEXT_ATTR_FONT_FACE)) - { - if (currentStyle.GetFont().Ok() && currentStyle.HasFontFaceName()) - { - wxString faceName1(currentStyle.GetFont().GetFaceName()); - wxString faceName2(style.GetFont().GetFaceName()); - - if (faceName1 != faceName2) - { - // Clash of style - mark as such - multipleStyleAttributes |= wxTEXT_ATTR_FONT_FACE; - currentStyle.SetFlags(currentStyle.GetFlags() & ~wxTEXT_ATTR_FONT_FACE); - } - } - else - { - if (!currentStyle.GetFont().Ok()) - wxSetFontPreservingStyles(currentStyle, *wxNORMAL_FONT); - wxFont font(currentStyle.GetFont()); - wxFontSetFaceName(font, style.GetFont().GetFaceName()); - wxSetFontPreservingStyles(currentStyle, font); - currentStyle.SetFlags(currentStyle.GetFlags() | wxTEXT_ATTR_FONT_FACE); - } - } - - if (style.HasFontUnderlined() && !wxHasStyle(multipleStyleAttributes|absentStyleAttributes, wxTEXT_ATTR_FONT_UNDERLINE)) - { - if (currentStyle.GetFont().Ok() && currentStyle.HasFontUnderlined()) - { - if (currentStyle.GetFont().GetUnderlined() != style.GetFont().GetUnderlined()) - { - // Clash of style - mark as such - multipleStyleAttributes |= wxTEXT_ATTR_FONT_UNDERLINE; - currentStyle.SetFlags(currentStyle.GetFlags() & ~wxTEXT_ATTR_FONT_UNDERLINE); - } - } - else - { - if (!currentStyle.GetFont().Ok()) - wxSetFontPreservingStyles(currentStyle, *wxNORMAL_FONT); - wxFont font(currentStyle.GetFont()); - wxFontSetUnderlined(font, style.GetFont().GetUnderlined()); - wxSetFontPreservingStyles(currentStyle, font); - currentStyle.SetFlags(currentStyle.GetFlags() | wxTEXT_ATTR_FONT_UNDERLINE); - } - } - } - - if (style.HasTextColour() && !wxHasStyle(multipleStyleAttributes|absentStyleAttributes, wxTEXT_ATTR_TEXT_COLOUR)) - { - if (currentStyle.HasTextColour()) - { - if (currentStyle.GetTextColour() != style.GetTextColour()) - { - // Clash of style - mark as such - multipleStyleAttributes |= wxTEXT_ATTR_TEXT_COLOUR; - currentStyle.SetFlags(currentStyle.GetFlags() & ~wxTEXT_ATTR_TEXT_COLOUR); - } - } - else - currentStyle.SetTextColour(style.GetTextColour()); - } - - if (style.HasBackgroundColour() && !wxHasStyle(multipleStyleAttributes|absentStyleAttributes, wxTEXT_ATTR_BACKGROUND_COLOUR)) - { - if (currentStyle.HasBackgroundColour()) - { - if (currentStyle.GetBackgroundColour() != style.GetBackgroundColour()) - { - // Clash of style - mark as such - multipleStyleAttributes |= wxTEXT_ATTR_BACKGROUND_COLOUR; - currentStyle.SetFlags(currentStyle.GetFlags() & ~wxTEXT_ATTR_BACKGROUND_COLOUR); - } - } - else - currentStyle.SetBackgroundColour(style.GetBackgroundColour()); - } - - if (style.HasAlignment() && !wxHasStyle(multipleStyleAttributes|absentStyleAttributes, wxTEXT_ATTR_ALIGNMENT)) - { - if (currentStyle.HasAlignment()) - { - if (currentStyle.GetAlignment() != style.GetAlignment()) - { - // Clash of style - mark as such - multipleStyleAttributes |= wxTEXT_ATTR_ALIGNMENT; - currentStyle.SetFlags(currentStyle.GetFlags() & ~wxTEXT_ATTR_ALIGNMENT); - } - } - else - currentStyle.SetAlignment(style.GetAlignment()); - } - - if (style.HasTabs() && !wxHasStyle(multipleStyleAttributes|absentStyleAttributes, wxTEXT_ATTR_TABS)) - { - if (currentStyle.HasTabs()) - { - if (!wxRichTextTabsEq(currentStyle.GetTabs(), style.GetTabs())) - { - // Clash of style - mark as such - multipleStyleAttributes |= wxTEXT_ATTR_TABS; - currentStyle.SetFlags(currentStyle.GetFlags() & ~wxTEXT_ATTR_TABS); - } - } - else - currentStyle.SetTabs(style.GetTabs()); - } - - if (style.HasLeftIndent() && !wxHasStyle(multipleStyleAttributes|absentStyleAttributes, wxTEXT_ATTR_LEFT_INDENT)) - { - if (currentStyle.HasLeftIndent()) - { - if (currentStyle.GetLeftIndent() != style.GetLeftIndent() || currentStyle.GetLeftSubIndent() != style.GetLeftSubIndent()) - { - // Clash of style - mark as such - multipleStyleAttributes |= wxTEXT_ATTR_LEFT_INDENT; - currentStyle.SetFlags(currentStyle.GetFlags() & ~wxTEXT_ATTR_LEFT_INDENT); - } - } - else - currentStyle.SetLeftIndent(style.GetLeftIndent(), style.GetLeftSubIndent()); - } - - if (style.HasRightIndent() && !wxHasStyle(multipleStyleAttributes|absentStyleAttributes, wxTEXT_ATTR_RIGHT_INDENT)) - { - if (currentStyle.HasRightIndent()) - { - if (currentStyle.GetRightIndent() != style.GetRightIndent()) - { - // Clash of style - mark as such - multipleStyleAttributes |= wxTEXT_ATTR_RIGHT_INDENT; - currentStyle.SetFlags(currentStyle.GetFlags() & ~wxTEXT_ATTR_RIGHT_INDENT); - } - } - else - currentStyle.SetRightIndent(style.GetRightIndent()); - } - - if (style.HasParagraphSpacingAfter() && !wxHasStyle(multipleStyleAttributes|absentStyleAttributes, wxTEXT_ATTR_PARA_SPACING_AFTER)) - { - if (currentStyle.HasParagraphSpacingAfter()) - { - if (currentStyle.GetParagraphSpacingAfter() != style.GetParagraphSpacingAfter()) - { - // Clash of style - mark as such - multipleStyleAttributes |= wxTEXT_ATTR_PARA_SPACING_AFTER; - currentStyle.SetFlags(currentStyle.GetFlags() & ~wxTEXT_ATTR_PARA_SPACING_AFTER); - } - } - else - currentStyle.SetParagraphSpacingAfter(style.GetParagraphSpacingAfter()); - } - - if (style.HasParagraphSpacingBefore() && !wxHasStyle(multipleStyleAttributes|absentStyleAttributes, wxTEXT_ATTR_PARA_SPACING_BEFORE)) - { - if (currentStyle.HasParagraphSpacingBefore()) - { - if (currentStyle.GetParagraphSpacingBefore() != style.GetParagraphSpacingBefore()) - { - // Clash of style - mark as such - multipleStyleAttributes |= wxTEXT_ATTR_PARA_SPACING_BEFORE; - currentStyle.SetFlags(currentStyle.GetFlags() & ~wxTEXT_ATTR_PARA_SPACING_BEFORE); - } - } - else - currentStyle.SetParagraphSpacingBefore(style.GetParagraphSpacingBefore()); - } - - if (style.HasLineSpacing() && !wxHasStyle(multipleStyleAttributes|absentStyleAttributes, wxTEXT_ATTR_LINE_SPACING)) - { - if (currentStyle.HasLineSpacing()) - { - if (currentStyle.GetLineSpacing() != style.GetLineSpacing()) - { - // Clash of style - mark as such - multipleStyleAttributes |= wxTEXT_ATTR_LINE_SPACING; - currentStyle.SetFlags(currentStyle.GetFlags() & ~wxTEXT_ATTR_LINE_SPACING); - } - } - else - currentStyle.SetLineSpacing(style.GetLineSpacing()); - } - - if (style.HasCharacterStyleName() && !wxHasStyle(multipleStyleAttributes|absentStyleAttributes, wxTEXT_ATTR_CHARACTER_STYLE_NAME)) - { - if (currentStyle.HasCharacterStyleName()) - { - if (currentStyle.GetCharacterStyleName() != style.GetCharacterStyleName()) - { - // Clash of style - mark as such - multipleStyleAttributes |= wxTEXT_ATTR_CHARACTER_STYLE_NAME; - currentStyle.SetFlags(currentStyle.GetFlags() & ~wxTEXT_ATTR_CHARACTER_STYLE_NAME); - } - } - else - currentStyle.SetCharacterStyleName(style.GetCharacterStyleName()); - } - - if (style.HasParagraphStyleName() && !wxHasStyle(multipleStyleAttributes|absentStyleAttributes, wxTEXT_ATTR_PARAGRAPH_STYLE_NAME)) - { - if (currentStyle.HasParagraphStyleName()) - { - if (currentStyle.GetParagraphStyleName() != style.GetParagraphStyleName()) - { - // Clash of style - mark as such - multipleStyleAttributes |= wxTEXT_ATTR_PARAGRAPH_STYLE_NAME; - currentStyle.SetFlags(currentStyle.GetFlags() & ~wxTEXT_ATTR_PARAGRAPH_STYLE_NAME); - } - } - else - currentStyle.SetParagraphStyleName(style.GetParagraphStyleName()); - } - - if (style.HasListStyleName() && !wxHasStyle(multipleStyleAttributes|absentStyleAttributes, wxTEXT_ATTR_LIST_STYLE_NAME)) - { - if (currentStyle.HasListStyleName()) - { - if (currentStyle.GetListStyleName() != style.GetListStyleName()) - { - // Clash of style - mark as such - multipleStyleAttributes |= wxTEXT_ATTR_LIST_STYLE_NAME; - currentStyle.SetFlags(currentStyle.GetFlags() & ~wxTEXT_ATTR_LIST_STYLE_NAME); - } - } - else - currentStyle.SetListStyleName(style.GetListStyleName()); - } - - if (style.HasBulletStyle() && !wxHasStyle(multipleStyleAttributes|absentStyleAttributes, wxTEXT_ATTR_BULLET_STYLE)) - { - if (currentStyle.HasBulletStyle()) - { - if (currentStyle.GetBulletStyle() != style.GetBulletStyle()) - { - // Clash of style - mark as such - multipleStyleAttributes |= wxTEXT_ATTR_BULLET_STYLE; - currentStyle.SetFlags(currentStyle.GetFlags() & ~wxTEXT_ATTR_BULLET_STYLE); - } - } - else - currentStyle.SetBulletStyle(style.GetBulletStyle()); - } - - if (style.HasBulletNumber() && !wxHasStyle(multipleStyleAttributes|absentStyleAttributes, wxTEXT_ATTR_BULLET_NUMBER)) - { - if (currentStyle.HasBulletNumber()) - { - if (currentStyle.GetBulletNumber() != style.GetBulletNumber()) - { - // Clash of style - mark as such - multipleStyleAttributes |= wxTEXT_ATTR_BULLET_NUMBER; - currentStyle.SetFlags(currentStyle.GetFlags() & ~wxTEXT_ATTR_BULLET_NUMBER); - } - } - else - currentStyle.SetBulletNumber(style.GetBulletNumber()); - } - - if (style.HasBulletText() && !wxHasStyle(multipleStyleAttributes|absentStyleAttributes, wxTEXT_ATTR_BULLET_TEXT)) - { - if (currentStyle.HasBulletText()) - { - if (currentStyle.GetBulletText() != style.GetBulletText()) - { - // Clash of style - mark as such - multipleStyleAttributes |= wxTEXT_ATTR_BULLET_TEXT; - currentStyle.SetFlags(currentStyle.GetFlags() & ~wxTEXT_ATTR_BULLET_TEXT); - } - } - else - { - currentStyle.SetBulletText(style.GetBulletText()); - currentStyle.SetBulletFont(style.GetBulletFont()); - } - } - - if (style.HasBulletName() && !wxHasStyle(multipleStyleAttributes|absentStyleAttributes, wxTEXT_ATTR_BULLET_NAME)) - { - if (currentStyle.HasBulletName()) - { - if (currentStyle.GetBulletName() != style.GetBulletName()) - { - // Clash of style - mark as such - multipleStyleAttributes |= wxTEXT_ATTR_BULLET_NAME; - currentStyle.SetFlags(currentStyle.GetFlags() & ~wxTEXT_ATTR_BULLET_NAME); - } - } - else - { - currentStyle.SetBulletName(style.GetBulletName()); - } - } - - if (style.HasURL() && !wxHasStyle(multipleStyleAttributes|absentStyleAttributes, wxTEXT_ATTR_URL)) - { - if (currentStyle.HasURL()) - { - if (currentStyle.GetURL() != style.GetURL()) - { - // Clash of style - mark as such - multipleStyleAttributes |= wxTEXT_ATTR_URL; - currentStyle.SetFlags(currentStyle.GetFlags() & ~wxTEXT_ATTR_URL); - } - } - else - { - currentStyle.SetURL(style.GetURL()); - } - } - - if (style.HasTextEffects() && !wxHasStyle(multipleStyleAttributes|absentStyleAttributes, wxTEXT_ATTR_EFFECTS)) - { - if (currentStyle.HasTextEffects()) - { - // We need to find the bits in the new style that are different: - // just look at those bits that are specified by the new style. - - // We need to remove the bits and flags that are not common between current style - // and new style. In so doing we need to take account of the styles absent from one or more of the - // previous styles. - - int currentRelevantTextEffects = currentStyle.GetTextEffects() & style.GetTextEffectFlags(); - int newRelevantTextEffects = style.GetTextEffects() & style.GetTextEffectFlags(); - - if (currentRelevantTextEffects != newRelevantTextEffects) - { - // Find the text effects that were different, using XOR - int differentEffects = currentRelevantTextEffects ^ newRelevantTextEffects; - - // Clash of style - mark as such - multipleTextEffectAttributes |= differentEffects; - currentStyle.SetTextEffectFlags(currentStyle.GetTextEffectFlags() & ~differentEffects); - } - } - else - { - currentStyle.SetTextEffects(style.GetTextEffects()); - currentStyle.SetTextEffectFlags(style.GetTextEffectFlags()); - } - - // Mask out the flags and values that cannot be common because they were absent in one or more objecrs - // that we've looked at so far - currentStyle.SetTextEffects(currentStyle.GetTextEffects() & ~absentTextEffectAttributes); - currentStyle.SetTextEffectFlags(currentStyle.GetTextEffectFlags() & ~absentTextEffectAttributes); - - if (currentStyle.GetTextEffectFlags() == 0) - currentStyle.SetFlags(currentStyle.GetFlags() & ~wxTEXT_ATTR_EFFECTS); - } - - if (style.HasOutlineLevel() && !wxHasStyle(multipleStyleAttributes|absentStyleAttributes, wxTEXT_ATTR_OUTLINE_LEVEL)) - { - if (currentStyle.HasOutlineLevel()) - { - if (currentStyle.GetOutlineLevel() != style.GetOutlineLevel()) - { - // Clash of style - mark as such - multipleStyleAttributes |= wxTEXT_ATTR_OUTLINE_LEVEL; - currentStyle.SetFlags(currentStyle.GetFlags() & ~wxTEXT_ATTR_OUTLINE_LEVEL); - } - } - else - currentStyle.SetOutlineLevel(style.GetOutlineLevel()); - } - - return true; -} - -/// Get the combined style for a range - if any attribute is different within the range, -/// that attribute is not present within the flags. -/// *** Note that this is not recursive, and so assumes that content inside a paragraph is not itself -/// nested. -bool wxRichTextParagraphLayoutBox::GetStyleForRange(const wxRichTextRange& range, wxTextAttrEx& style) -{ - style = wxTextAttrEx(); - - // The attributes that aren't valid because of multiple styles within the range - long multipleStyleAttributes = 0; - int multipleTextEffectAttributes = 0; - long absentStyleAttributesPara = 0; - long absentStyleAttributesChar = 0; - int absentTextEffectAttributesPara = 0; - int absentTextEffectAttributesChar = 0; - - wxRichTextObjectList::compatibility_iterator node = GetChildren().GetFirst(); - while (node) - { - wxRichTextParagraph* para = (wxRichTextParagraph*) node->GetData(); - if (!(para->GetRange().GetStart() > range.GetEnd() || para->GetRange().GetEnd() < range.GetStart())) - { - if (para->GetChildren().GetCount() == 0) - { - wxTextAttrEx paraStyle = para->GetCombinedAttributes(); - - wxCollectStyle2(style, paraStyle, multipleStyleAttributes, multipleTextEffectAttributes, absentStyleAttributesPara, absentTextEffectAttributesPara); - } - else - { - wxRichTextRange paraRange(para->GetRange()); - paraRange.LimitTo(range); - - // First collect paragraph attributes only - wxTextAttrEx paraStyle = para->GetCombinedAttributes(); - paraStyle.SetFlags(paraStyle.GetFlags() & wxTEXT_ATTR_PARAGRAPH); - - wxCollectStyle2(style, paraStyle, multipleStyleAttributes, multipleTextEffectAttributes, absentStyleAttributesPara, absentTextEffectAttributesPara); - - wxRichTextObjectList::compatibility_iterator childNode = para->GetChildren().GetFirst(); - - while (childNode) - { - wxRichTextObject* child = childNode->GetData(); - if (!(child->GetRange().GetStart() > range.GetEnd() || child->GetRange().GetEnd() < range.GetStart())) - { - wxTextAttrEx childStyle = para->GetCombinedAttributes(child->GetAttributes()); - - // Now collect character attributes only - childStyle.SetFlags(childStyle.GetFlags() & wxTEXT_ATTR_CHARACTER); - - wxCollectStyle2(style, childStyle, multipleStyleAttributes, multipleTextEffectAttributes, absentStyleAttributesChar, absentTextEffectAttributesChar); - } - - childNode = childNode->GetNext(); - } - } - } - node = node->GetNext(); - } - return true; -} - -/// Set default style -bool wxRichTextParagraphLayoutBox::SetDefaultStyle(const wxTextAttrEx& style) -{ - m_defaultAttributes = style; - return true; -} - -/// Test if this whole range has character attributes of the specified kind. If any -/// of the attributes are different within the range, the test fails. You -/// can use this to implement, for example, bold button updating. style must have -/// flags indicating which attributes are of interest. -bool wxRichTextParagraphLayoutBox::HasCharacterAttributes(const wxRichTextRange& range, const wxRichTextAttr& style) const -{ - int foundCount = 0; - int matchingCount = 0; - - wxRichTextObjectList::compatibility_iterator node = m_children.GetFirst(); - while (node) - { - wxRichTextParagraph* para = wxDynamicCast(node->GetData(), wxRichTextParagraph); - wxASSERT (para != NULL); - - if (para) - { - // Stop searching if we're beyond the range of interest - if (para->GetRange().GetStart() > range.GetEnd()) - return foundCount == matchingCount && foundCount != 0; - - if (!para->GetRange().IsOutside(range)) - { - wxRichTextObjectList::compatibility_iterator node2 = para->GetChildren().GetFirst(); - - while (node2) - { - wxRichTextObject* child = node2->GetData(); - // Allow for empty string if no buffer - wxRichTextRange childRange = child->GetRange(); - if (childRange.GetLength() == 0 && GetRange().GetLength() == 1) - childRange.SetEnd(childRange.GetEnd()+1); - - if (!childRange.IsOutside(range) && child->IsKindOf(CLASSINFO(wxRichTextPlainText))) - { - foundCount ++; - wxTextAttrEx textAttr = para->GetCombinedAttributes(child->GetAttributes()); - - if (wxTextAttrEqPartial(textAttr, style, style.GetFlags())) - matchingCount ++; - } - - node2 = node2->GetNext(); - } - } - } - - node = node->GetNext(); - } - - return foundCount == matchingCount && foundCount != 0; -} - -bool wxRichTextParagraphLayoutBox::HasCharacterAttributes(const wxRichTextRange& range, const wxTextAttrEx& style) const -{ - wxRichTextAttr richStyle = style; - return HasCharacterAttributes(range, richStyle); -} - -/// Test if this whole range has paragraph attributes of the specified kind. If any -/// of the attributes are different within the range, the test fails. You -/// can use this to implement, for example, centering button updating. style must have -/// flags indicating which attributes are of interest. -bool wxRichTextParagraphLayoutBox::HasParagraphAttributes(const wxRichTextRange& range, const wxRichTextAttr& style) const -{ - int foundCount = 0; - int matchingCount = 0; - - wxRichTextObjectList::compatibility_iterator node = m_children.GetFirst(); - while (node) - { - wxRichTextParagraph* para = wxDynamicCast(node->GetData(), wxRichTextParagraph); - wxASSERT (para != NULL); - - if (para) - { - // Stop searching if we're beyond the range of interest - if (para->GetRange().GetStart() > range.GetEnd()) - return foundCount == matchingCount && foundCount != 0; - - if (!para->GetRange().IsOutside(range)) - { - wxTextAttrEx textAttr = GetAttributes(); - // Apply the paragraph style - wxRichTextApplyStyle(textAttr, para->GetAttributes()); - - foundCount ++; - if (wxTextAttrEqPartial(textAttr, style, style.GetFlags())) - matchingCount ++; - } - } - - node = node->GetNext(); - } - return foundCount == matchingCount && foundCount != 0; -} - -bool wxRichTextParagraphLayoutBox::HasParagraphAttributes(const wxRichTextRange& range, const wxTextAttrEx& style) const -{ - wxRichTextAttr richStyle = style; - return HasParagraphAttributes(range, richStyle); -} - -void wxRichTextParagraphLayoutBox::Clear() -{ - DeleteChildren(); -} - -void wxRichTextParagraphLayoutBox::Reset() -{ - Clear(); - - wxRichTextBuffer* buffer = wxDynamicCast(this, wxRichTextBuffer); - if (buffer && GetRichTextCtrl()) - { - wxRichTextEvent event(wxEVT_COMMAND_RICHTEXT_BUFFER_RESET, GetRichTextCtrl()->GetId()); - event.SetEventObject(GetRichTextCtrl()); - - buffer->SendEvent(event, true); - } - - AddParagraph(wxEmptyString); - - Invalidate(wxRICHTEXT_ALL); -} - -/// Invalidate the buffer. With no argument, invalidates whole buffer. -void wxRichTextParagraphLayoutBox::Invalidate(const wxRichTextRange& invalidRange) -{ - SetDirty(true); - - if (invalidRange == wxRICHTEXT_ALL) - { - m_invalidRange = wxRICHTEXT_ALL; - return; - } - - // Already invalidating everything - if (m_invalidRange == wxRICHTEXT_ALL) - return; - - if ((invalidRange.GetStart() < m_invalidRange.GetStart()) || m_invalidRange.GetStart() == -1) - m_invalidRange.SetStart(invalidRange.GetStart()); - if (invalidRange.GetEnd() > m_invalidRange.GetEnd()) - m_invalidRange.SetEnd(invalidRange.GetEnd()); -} - -/// Get invalid range, rounding to entire paragraphs if argument is true. -wxRichTextRange wxRichTextParagraphLayoutBox::GetInvalidRange(bool wholeParagraphs) const -{ - if (m_invalidRange == wxRICHTEXT_ALL || m_invalidRange == wxRICHTEXT_NONE) - return m_invalidRange; - - wxRichTextRange range = m_invalidRange; - - if (wholeParagraphs) - { - wxRichTextParagraph* para1 = GetParagraphAtPosition(range.GetStart()); - wxRichTextParagraph* para2 = GetParagraphAtPosition(range.GetEnd()); - if (para1) - range.SetStart(para1->GetRange().GetStart()); - if (para2) - range.SetEnd(para2->GetRange().GetEnd()); - } - return range; -} - -/// Apply the style sheet to the buffer, for example if the styles have changed. -bool wxRichTextParagraphLayoutBox::ApplyStyleSheet(wxRichTextStyleSheet* styleSheet) -{ - wxASSERT(styleSheet != NULL); - if (!styleSheet) - return false; - - int foundCount = 0; - - wxRichTextAttr attr(GetBasicStyle()); - if (GetBasicStyle().HasParagraphStyleName()) - { - wxRichTextParagraphStyleDefinition* paraDef = styleSheet->FindParagraphStyle(GetBasicStyle().GetParagraphStyleName()); - if (paraDef) - { - attr.Apply(paraDef->GetStyleMergedWithBase(styleSheet)); - SetBasicStyle(attr); - foundCount ++; - } - } - - if (GetBasicStyle().HasCharacterStyleName()) - { - wxRichTextCharacterStyleDefinition* charDef = styleSheet->FindCharacterStyle(GetBasicStyle().GetCharacterStyleName()); - if (charDef) - { - attr.Apply(charDef->GetStyleMergedWithBase(styleSheet)); - SetBasicStyle(attr); - foundCount ++; - } - } - - wxRichTextObjectList::compatibility_iterator node = m_children.GetFirst(); - while (node) - { - wxRichTextParagraph* para = wxDynamicCast(node->GetData(), wxRichTextParagraph); - wxASSERT (para != NULL); - - if (para) - { - // Combine paragraph and list styles. If there is a list style in the original attributes, - // the current indentation overrides anything else and is used to find the item indentation. - // Also, for applying paragraph styles, consider having 2 modes: (1) we merge with what we have, - // thereby taking into account all user changes, (2) reset the style completely (except for indentation/list - // exception as above). - // Problem: when changing from one list style to another, there's a danger that the level info will get lost. - // So when changing a list style interactively, could retrieve level based on current style, then - // set appropriate indent and apply new style. - - int outline = -1; - int num = -1; - if (para->GetAttributes().HasOutlineLevel()) - outline = para->GetAttributes().GetOutlineLevel(); - if (para->GetAttributes().HasBulletNumber()) - num = para->GetAttributes().GetBulletNumber(); - - if (!para->GetAttributes().GetParagraphStyleName().IsEmpty() && !para->GetAttributes().GetListStyleName().IsEmpty()) - { - int currentIndent = para->GetAttributes().GetLeftIndent(); - - wxRichTextParagraphStyleDefinition* paraDef = styleSheet->FindParagraphStyle(para->GetAttributes().GetParagraphStyleName()); - wxRichTextListStyleDefinition* listDef = styleSheet->FindListStyle(para->GetAttributes().GetListStyleName()); - if (paraDef && !listDef) - { - para->GetAttributes() = paraDef->GetStyleMergedWithBase(styleSheet); - foundCount ++; - } - else if (listDef && !paraDef) - { - // Set overall style defined for the list style definition - para->GetAttributes() = listDef->GetStyleMergedWithBase(styleSheet); - - // Apply the style for this level - wxRichTextApplyStyle(para->GetAttributes(), * listDef->GetLevelAttributes(listDef->FindLevelForIndent(currentIndent))); - foundCount ++; - } - else if (listDef && paraDef) - { - // Combines overall list style, style for level, and paragraph style - para->GetAttributes() = listDef->CombineWithParagraphStyle(currentIndent, paraDef->GetStyleMergedWithBase(styleSheet)); - foundCount ++; - } - } - else if (para->GetAttributes().GetParagraphStyleName().IsEmpty() && !para->GetAttributes().GetListStyleName().IsEmpty()) - { - int currentIndent = para->GetAttributes().GetLeftIndent(); - - wxRichTextListStyleDefinition* listDef = styleSheet->FindListStyle(para->GetAttributes().GetListStyleName()); - - // Overall list definition style - para->GetAttributes() = listDef->GetStyleMergedWithBase(styleSheet); - - // Style for this level - wxRichTextApplyStyle(para->GetAttributes(), * listDef->GetLevelAttributes(listDef->FindLevelForIndent(currentIndent))); - - foundCount ++; - } - else if (!para->GetAttributes().GetParagraphStyleName().IsEmpty() && para->GetAttributes().GetListStyleName().IsEmpty()) - { - wxRichTextParagraphStyleDefinition* def = styleSheet->FindParagraphStyle(para->GetAttributes().GetParagraphStyleName()); - if (def) - { - para->GetAttributes() = def->GetStyleMergedWithBase(styleSheet); - foundCount ++; - } - } - - if (outline != -1) - para->GetAttributes().SetOutlineLevel(outline); - if (num != -1) - para->GetAttributes().SetBulletNumber(num); - } - - node = node->GetNext(); - } - return foundCount != 0; -} - -/// Set list style -bool wxRichTextParagraphLayoutBox::SetListStyle(const wxRichTextRange& range, wxRichTextListStyleDefinition* def, int flags, int startFrom, int specifiedLevel) -{ - wxRichTextStyleSheet* styleSheet = GetStyleSheet(); - - bool withUndo = ((flags & wxRICHTEXT_SETSTYLE_WITH_UNDO) != 0); - // bool applyMinimal = ((flags & wxRICHTEXT_SETSTYLE_OPTIMIZE) != 0); - bool specifyLevel = ((flags & wxRICHTEXT_SETSTYLE_SPECIFY_LEVEL) != 0); - bool renumber = ((flags & wxRICHTEXT_SETSTYLE_RENUMBER) != 0); - - // Current number, if numbering - int n = startFrom; - - wxASSERT (!specifyLevel || (specifyLevel && (specifiedLevel >= 0))); - - // If we are associated with a control, make undoable; otherwise, apply immediately - // to the data. - - bool haveControl = (GetRichTextCtrl() != NULL); - - wxRichTextAction* action = NULL; - - if (haveControl && withUndo) - { - action = new wxRichTextAction(NULL, _("Change List Style"), wxRICHTEXT_CHANGE_STYLE, & GetRichTextCtrl()->GetBuffer(), GetRichTextCtrl()); - action->SetRange(range); - action->SetPosition(GetRichTextCtrl()->GetCaretPosition()); - } - - wxRichTextObjectList::compatibility_iterator node = m_children.GetFirst(); - while (node) - { - wxRichTextParagraph* para = wxDynamicCast(node->GetData(), wxRichTextParagraph); - wxASSERT (para != NULL); - - if (para && para->GetChildCount() > 0) - { - // Stop searching if we're beyond the range of interest - if (para->GetRange().GetStart() > range.GetEnd()) - break; - - if (!para->GetRange().IsOutside(range)) - { - // We'll be using a copy of the paragraph to make style changes, - // not updating the buffer directly. - wxRichTextParagraph* newPara wxDUMMY_INITIALIZE(NULL); - - if (haveControl && withUndo) - { - newPara = new wxRichTextParagraph(*para); - action->GetNewParagraphs().AppendChild(newPara); - - // Also store the old ones for Undo - action->GetOldParagraphs().AppendChild(new wxRichTextParagraph(*para)); - } - else - newPara = para; - - if (def) - { - int thisIndent = newPara->GetAttributes().GetLeftIndent(); - int thisLevel = specifyLevel ? specifiedLevel : def->FindLevelForIndent(thisIndent); - - // How is numbering going to work? - // If we are renumbering, or numbering for the first time, we need to keep - // track of the number for each level. But we might be simply applying a different - // list style. - // In Word, applying a style to several paragraphs, even if at different levels, - // reverts the level back to the same one. So we could do the same here. - // Renumbering will need to be done when we promote/demote a paragraph. - - // Apply the overall list style, and item style for this level - wxTextAttrEx listStyle(def->GetCombinedStyleForLevel(thisLevel, styleSheet)); - wxRichTextApplyStyle(newPara->GetAttributes(), listStyle); - - // Now we need to do numbering - if (renumber) - { - newPara->GetAttributes().SetBulletNumber(n); - } - - n ++; - } - else if (!newPara->GetAttributes().GetListStyleName().IsEmpty()) - { - // if def is NULL, remove list style, applying any associated paragraph style - // to restore the attributes - - newPara->GetAttributes().SetListStyleName(wxEmptyString); - newPara->GetAttributes().SetLeftIndent(0, 0); - newPara->GetAttributes().SetBulletText(wxEmptyString); - - // Eliminate the main list-related attributes - newPara->GetAttributes().SetFlags(newPara->GetAttributes().GetFlags() & ~wxTEXT_ATTR_LEFT_INDENT & ~wxTEXT_ATTR_BULLET_STYLE & ~wxTEXT_ATTR_BULLET_NUMBER & ~wxTEXT_ATTR_BULLET_TEXT & wxTEXT_ATTR_LIST_STYLE_NAME); - - if (styleSheet && !newPara->GetAttributes().GetParagraphStyleName().IsEmpty()) - { - wxRichTextParagraphStyleDefinition* def = styleSheet->FindParagraphStyle(newPara->GetAttributes().GetParagraphStyleName()); - if (def) - { - newPara->GetAttributes() = def->GetStyleMergedWithBase(styleSheet); - } - } - } - } - } - - node = node->GetNext(); - } - - // Do action, or delay it until end of batch. - if (haveControl && withUndo) - GetRichTextCtrl()->GetBuffer().SubmitAction(action); - - return true; -} - -bool wxRichTextParagraphLayoutBox::SetListStyle(const wxRichTextRange& range, const wxString& defName, int flags, int startFrom, int specifiedLevel) -{ - if (GetStyleSheet()) - { - wxRichTextListStyleDefinition* def = GetStyleSheet()->FindListStyle(defName); - if (def) - return SetListStyle(range, def, flags, startFrom, specifiedLevel); - } - return false; -} - -/// Clear list for given range -bool wxRichTextParagraphLayoutBox::ClearListStyle(const wxRichTextRange& range, int flags) -{ - return SetListStyle(range, NULL, flags); -} - -/// Number/renumber any list elements in the given range -bool wxRichTextParagraphLayoutBox::NumberList(const wxRichTextRange& range, wxRichTextListStyleDefinition* def, int flags, int startFrom, int specifiedLevel) -{ - return DoNumberList(range, range, 0, def, flags, startFrom, specifiedLevel); -} - -/// Number/renumber any list elements in the given range. Also do promotion or demotion of items, if specified -bool wxRichTextParagraphLayoutBox::DoNumberList(const wxRichTextRange& range, const wxRichTextRange& promotionRange, int promoteBy, - wxRichTextListStyleDefinition* def, int flags, int startFrom, int specifiedLevel) -{ - wxRichTextStyleSheet* styleSheet = GetStyleSheet(); - - bool withUndo = ((flags & wxRICHTEXT_SETSTYLE_WITH_UNDO) != 0); - // bool applyMinimal = ((flags & wxRICHTEXT_SETSTYLE_OPTIMIZE) != 0); -#ifdef __WXDEBUG__ - bool specifyLevel = ((flags & wxRICHTEXT_SETSTYLE_SPECIFY_LEVEL) != 0); -#endif - - bool renumber = ((flags & wxRICHTEXT_SETSTYLE_RENUMBER) != 0); - - // Max number of levels - const int maxLevels = 10; - - // The level we're looking at now - int currentLevel = -1; - - // The item number for each level - int levels[maxLevels]; - int i; - - // Reset all numbering - for (i = 0; i < maxLevels; i++) - { - if (startFrom != -1) - levels[i] = startFrom-1; - else if (renumber) // start again - levels[i] = 0; - else - levels[i] = -1; // start from the number we found, if any - } - - wxASSERT(!specifyLevel || (specifyLevel && (specifiedLevel >= 0))); - - // If we are associated with a control, make undoable; otherwise, apply immediately - // to the data. - - bool haveControl = (GetRichTextCtrl() != NULL); - - wxRichTextAction* action = NULL; - - if (haveControl && withUndo) - { - action = new wxRichTextAction(NULL, _("Renumber List"), wxRICHTEXT_CHANGE_STYLE, & GetRichTextCtrl()->GetBuffer(), GetRichTextCtrl()); - action->SetRange(range); - action->SetPosition(GetRichTextCtrl()->GetCaretPosition()); - } - - wxRichTextObjectList::compatibility_iterator node = m_children.GetFirst(); - while (node) - { - wxRichTextParagraph* para = wxDynamicCast(node->GetData(), wxRichTextParagraph); - wxASSERT (para != NULL); - - if (para && para->GetChildCount() > 0) - { - // Stop searching if we're beyond the range of interest - if (para->GetRange().GetStart() > range.GetEnd()) - break; - - if (!para->GetRange().IsOutside(range)) - { - // We'll be using a copy of the paragraph to make style changes, - // not updating the buffer directly. - wxRichTextParagraph* newPara wxDUMMY_INITIALIZE(NULL); - - if (haveControl && withUndo) - { - newPara = new wxRichTextParagraph(*para); - action->GetNewParagraphs().AppendChild(newPara); - - // Also store the old ones for Undo - action->GetOldParagraphs().AppendChild(new wxRichTextParagraph(*para)); - } - else - newPara = para; - - wxRichTextListStyleDefinition* defToUse = def; - if (!defToUse) - { - if (styleSheet && !newPara->GetAttributes().GetListStyleName().IsEmpty()) - defToUse = styleSheet->FindListStyle(newPara->GetAttributes().GetListStyleName()); - } - - if (defToUse) - { - int thisIndent = newPara->GetAttributes().GetLeftIndent(); - int thisLevel = defToUse->FindLevelForIndent(thisIndent); - - // If we've specified a level to apply to all, change the level. - if (specifiedLevel != -1) - thisLevel = specifiedLevel; - - // Do promotion if specified - if ((promoteBy != 0) && !para->GetRange().IsOutside(promotionRange)) - { - thisLevel = thisLevel - promoteBy; - if (thisLevel < 0) - thisLevel = 0; - if (thisLevel > 9) - thisLevel = 9; - } - - // Apply the overall list style, and item style for this level - wxTextAttrEx listStyle(defToUse->GetCombinedStyleForLevel(thisLevel, styleSheet)); - wxRichTextApplyStyle(newPara->GetAttributes(), listStyle); - - // OK, we've (re)applied the style, now let's get the numbering right. - - if (currentLevel == -1) - currentLevel = thisLevel; - - // Same level as before, do nothing except increment level's number afterwards - if (currentLevel == thisLevel) - { - } - // A deeper level: start renumbering all levels after current level - else if (thisLevel > currentLevel) - { - for (i = currentLevel+1; i <= thisLevel; i++) - { - levels[i] = 0; - } - currentLevel = thisLevel; - } - else if (thisLevel < currentLevel) - { - currentLevel = thisLevel; - } - - // Use the current numbering if -1 and we have a bullet number already - if (levels[currentLevel] == -1) - { - if (newPara->GetAttributes().HasBulletNumber()) - levels[currentLevel] = newPara->GetAttributes().GetBulletNumber(); - else - levels[currentLevel] = 1; - } - else - { - levels[currentLevel] ++; - } - - newPara->GetAttributes().SetBulletNumber(levels[currentLevel]); - - // Create the bullet text if an outline list - if (listStyle.GetBulletStyle() & wxTEXT_ATTR_BULLET_STYLE_OUTLINE) - { - wxString text; - for (i = 0; i <= currentLevel; i++) - { - if (!text.IsEmpty()) - text += wxT("."); - text += wxString::Format(wxT("%d"), levels[i]); - } - newPara->GetAttributes().SetBulletText(text); - } - } - } - } - - node = node->GetNext(); - } - - // Do action, or delay it until end of batch. - if (haveControl && withUndo) - GetRichTextCtrl()->GetBuffer().SubmitAction(action); - - return true; -} - -bool wxRichTextParagraphLayoutBox::NumberList(const wxRichTextRange& range, const wxString& defName, int flags, int startFrom, int specifiedLevel) -{ - if (GetStyleSheet()) - { - wxRichTextListStyleDefinition* def = NULL; - if (!defName.IsEmpty()) - def = GetStyleSheet()->FindListStyle(defName); - return NumberList(range, def, flags, startFrom, specifiedLevel); - } - return false; -} - -/// Promote the list items within the given range. promoteBy can be a positive or negative number, e.g. 1 or -1 -bool wxRichTextParagraphLayoutBox::PromoteList(int promoteBy, const wxRichTextRange& range, wxRichTextListStyleDefinition* def, int flags, int specifiedLevel) -{ - // TODO - // One strategy is to first work out the range within which renumbering must occur. Then could pass these two ranges - // to NumberList with a flag indicating promotion is required within one of the ranges. - // Find first and last paragraphs in range. Then for first, calculate new indentation and look back until we find - // a paragraph that either has no list style, or has one that is different or whose indentation is less. - // We start renumbering from the para after that different para we found. We specify that the numbering of that - // list position will start from 1. - // Similarly, we look after the last para in the promote range for an indentation that is less (or no list style). - // We can end the renumbering at this point. - - // For now, only renumber within the promotion range. - - return DoNumberList(range, range, promoteBy, def, flags, 1, specifiedLevel); -} - -bool wxRichTextParagraphLayoutBox::PromoteList(int promoteBy, const wxRichTextRange& range, const wxString& defName, int flags, int specifiedLevel) -{ - if (GetStyleSheet()) - { - wxRichTextListStyleDefinition* def = NULL; - if (!defName.IsEmpty()) - def = GetStyleSheet()->FindListStyle(defName); - return PromoteList(promoteBy, range, def, flags, specifiedLevel); - } - return false; -} - -/// Fills in the attributes for numbering a paragraph after previousParagraph. It also finds the -/// position of the paragraph that it had to start looking from. -bool wxRichTextParagraphLayoutBox::FindNextParagraphNumber(wxRichTextParagraph* previousParagraph, wxRichTextAttr& attr) const -{ - if (!previousParagraph->GetAttributes().HasFlag(wxTEXT_ATTR_BULLET_STYLE) || previousParagraph->GetAttributes().GetBulletStyle() == wxTEXT_ATTR_BULLET_STYLE_NONE) - return false; - - wxRichTextStyleSheet* styleSheet = GetStyleSheet(); - if (styleSheet && !previousParagraph->GetAttributes().GetListStyleName().IsEmpty()) - { - wxRichTextListStyleDefinition* def = styleSheet->FindListStyle(previousParagraph->GetAttributes().GetListStyleName()); - if (def) - { - // int thisIndent = previousParagraph->GetAttributes().GetLeftIndent(); - // int thisLevel = def->FindLevelForIndent(thisIndent); - - bool isOutline = (previousParagraph->GetAttributes().GetBulletStyle() & wxTEXT_ATTR_BULLET_STYLE_OUTLINE) != 0; - - attr.SetFlags(previousParagraph->GetAttributes().GetFlags() & (wxTEXT_ATTR_BULLET_STYLE|wxTEXT_ATTR_BULLET_NUMBER|wxTEXT_ATTR_BULLET_TEXT|wxTEXT_ATTR_BULLET_NAME)); - if (previousParagraph->GetAttributes().HasBulletName()) - attr.SetBulletName(previousParagraph->GetAttributes().GetBulletName()); - attr.SetBulletStyle(previousParagraph->GetAttributes().GetBulletStyle()); - attr.SetListStyleName(previousParagraph->GetAttributes().GetListStyleName()); - - int nextNumber = previousParagraph->GetAttributes().GetBulletNumber() + 1; - attr.SetBulletNumber(nextNumber); - - if (isOutline) - { - wxString text = previousParagraph->GetAttributes().GetBulletText(); - if (!text.IsEmpty()) - { - int pos = text.Find(wxT('.'), true); - if (pos != wxNOT_FOUND) - { - text = text.Mid(0, text.Length() - pos - 1); - } - else - text = wxEmptyString; - if (!text.IsEmpty()) - text += wxT("."); - text += wxString::Format(wxT("%d"), nextNumber); - attr.SetBulletText(text); - } - } - - return true; - } - else - return false; - } - else - return false; -} - -/*! - * wxRichTextParagraph - * This object represents a single paragraph (or in a straight text editor, a line). - */ - -IMPLEMENT_DYNAMIC_CLASS(wxRichTextParagraph, wxRichTextBox) - -wxArrayInt wxRichTextParagraph::sm_defaultTabs; - -wxRichTextParagraph::wxRichTextParagraph(wxRichTextObject* parent, wxTextAttrEx* style): - wxRichTextBox(parent) -{ - if (style) - SetAttributes(*style); -} - -wxRichTextParagraph::wxRichTextParagraph(const wxString& text, wxRichTextObject* parent, wxTextAttrEx* paraStyle, wxTextAttrEx* charStyle): - wxRichTextBox(parent) -{ - if (paraStyle) - SetAttributes(*paraStyle); - - AppendChild(new wxRichTextPlainText(text, this, charStyle)); -} - -wxRichTextParagraph::~wxRichTextParagraph() -{ - ClearLines(); -} - -/// Draw the item -bool wxRichTextParagraph::Draw(wxDC& dc, const wxRichTextRange& range, const wxRichTextRange& selectionRange, const wxRect& rect, int WXUNUSED(descent), int style) -{ - wxTextAttrEx attr = GetCombinedAttributes(); - - // Draw the bullet, if any - if (attr.GetBulletStyle() != wxTEXT_ATTR_BULLET_STYLE_NONE) - { - if (attr.GetLeftSubIndent() != 0) - { - int spaceBeforePara = ConvertTenthsMMToPixels(dc, attr.GetParagraphSpacingBefore()); - int leftIndent = ConvertTenthsMMToPixels(dc, attr.GetLeftIndent()); - - wxTextAttrEx bulletAttr(GetCombinedAttributes()); - - // Combine with the font of the first piece of content, if one is specified - if (GetChildren().GetCount() > 0) - { - wxRichTextObject* firstObj = (wxRichTextObject*) GetChildren().GetFirst()->GetData(); - if (firstObj->GetAttributes().HasFont()) - { - wxRichTextApplyStyle(bulletAttr, firstObj->GetAttributes()); - } - } - - // Get line height from first line, if any - wxRichTextLine* line = m_cachedLines.GetFirst() ? (wxRichTextLine* ) m_cachedLines.GetFirst()->GetData() : (wxRichTextLine*) NULL; - - wxPoint linePos; - int lineHeight wxDUMMY_INITIALIZE(0); - if (line) - { - lineHeight = line->GetSize().y; - linePos = line->GetPosition() + GetPosition(); - } - else - { - wxFont font; - if (bulletAttr.GetFont().Ok()) - font = bulletAttr.GetFont(); - else - font = (*wxNORMAL_FONT); - - wxCheckSetFont(dc, font); - - lineHeight = dc.GetCharHeight(); - linePos = GetPosition(); - linePos.y += spaceBeforePara; - } - - wxRect bulletRect(GetPosition().x + leftIndent, linePos.y, linePos.x - (GetPosition().x + leftIndent), lineHeight); - - if (attr.GetBulletStyle() & wxTEXT_ATTR_BULLET_STYLE_BITMAP) - { - if (wxRichTextBuffer::GetRenderer()) - wxRichTextBuffer::GetRenderer()->DrawBitmapBullet(this, dc, bulletAttr, bulletRect); - } - else if (attr.GetBulletStyle() & wxTEXT_ATTR_BULLET_STYLE_STANDARD) - { - if (wxRichTextBuffer::GetRenderer()) - wxRichTextBuffer::GetRenderer()->DrawStandardBullet(this, dc, bulletAttr, bulletRect); - } - else - { - wxString bulletText = GetBulletText(); - - if (!bulletText.empty() && wxRichTextBuffer::GetRenderer()) - wxRichTextBuffer::GetRenderer()->DrawTextBullet(this, dc, bulletAttr, bulletRect, bulletText); - } - } - } - - // Draw the range for each line, one object at a time. - - wxRichTextLineList::compatibility_iterator node = m_cachedLines.GetFirst(); - while (node) - { - wxRichTextLine* line = node->GetData(); - wxRichTextRange lineRange = line->GetAbsoluteRange(); - - // Lines are specified relative to the paragraph - - wxPoint linePosition = line->GetPosition() + GetPosition(); - - // Don't draw if off the screen - if (((style & wxRICHTEXT_DRAW_IGNORE_CACHE) != 0) || ((linePosition.y + line->GetSize().y) >= rect.y && linePosition.y <= rect.y + rect.height)) - { - wxPoint objectPosition = linePosition; - int maxDescent = line->GetDescent(); - - // Loop through objects until we get to the one within range - wxRichTextObjectList::compatibility_iterator node2 = m_children.GetFirst(); - - int i = 0; - while (node2) - { - wxRichTextObject* child = node2->GetData(); - - if (child->GetRange().GetLength() > 0 && !child->GetRange().IsOutside(lineRange) && !lineRange.IsOutside(range)) - { - // Draw this part of the line at the correct position - wxRichTextRange objectRange(child->GetRange()); - objectRange.LimitTo(lineRange); - - wxSize objectSize; - -#if wxRICHTEXT_USE_OPTIMIZED_LINE_DRAWING && wxRICHTEXT_USE_PARTIAL_TEXT_EXTENTS - if (i < (int) line->GetObjectSizes().GetCount()) - { - objectSize.x = line->GetObjectSizes()[(size_t) i]; - } - else -#endif - { - int descent = 0; - child->GetRangeSize(objectRange, objectSize, descent, dc, wxRICHTEXT_UNFORMATTED, objectPosition); - } - - // Use the child object's width, but the whole line's height - wxRect childRect(objectPosition, wxSize(objectSize.x, line->GetSize().y)); - child->Draw(dc, objectRange, selectionRange, childRect, maxDescent, style); - - objectPosition.x += objectSize.x; - i ++; - } - else if (child->GetRange().GetStart() > lineRange.GetEnd()) - // Can break out of inner loop now since we've passed this line's range - break; - - node2 = node2->GetNext(); - } - } - - node = node->GetNext(); - } - - return true; -} - -// Get the range width using partial extents calculated for the whole paragraph. -static int wxRichTextGetRangeWidth(const wxRichTextParagraph& para, const wxRichTextRange& range, const wxArrayInt& partialExtents) -{ - wxASSERT(partialExtents.GetCount() >= (size_t) range.GetLength()); - - if (partialExtents.GetCount() < (size_t) range.GetLength()) - return 0; - - int leftMostPos = 0; - if (range.GetStart() - para.GetRange().GetStart() > 0) - leftMostPos = partialExtents[range.GetStart() - para.GetRange().GetStart() - 1]; - - int rightMostPos = partialExtents[range.GetEnd() - para.GetRange().GetStart()]; - - int w = rightMostPos - leftMostPos; - - return w; -} - -static wxDC* g_globalDC = NULL; - -/// Lay the item out -bool wxRichTextParagraph::Layout(wxDC& dc, const wxRect& rect, int style) -{ - wxTextAttrEx attr = GetCombinedAttributes(); - - // ClearLines(); - - // Increase the size of the paragraph due to spacing - int spaceBeforePara = ConvertTenthsMMToPixels(dc, attr.GetParagraphSpacingBefore()); - int spaceAfterPara = ConvertTenthsMMToPixels(dc, attr.GetParagraphSpacingAfter()); - int leftIndent = ConvertTenthsMMToPixels(dc, attr.GetLeftIndent()); - int leftSubIndent = ConvertTenthsMMToPixels(dc, attr.GetLeftSubIndent()); - int rightIndent = ConvertTenthsMMToPixels(dc, attr.GetRightIndent()); - - int lineSpacing = 0; - - // Let's assume line spacing of 10 is normal, 15 is 1.5, 20 is 2, etc. - if (attr.HasLineSpacing() && attr.GetLineSpacing() > 0 && attr.GetFont().Ok()) - { - wxCheckSetFont(dc, attr.GetFont()); - lineSpacing = (int) (double(dc.GetCharHeight()) * (double(attr.GetLineSpacing())/10.0 - 1.0)); - } - - // Available space for text on each line differs. - int availableTextSpaceFirstLine = rect.GetWidth() - leftIndent - rightIndent; - - // Bullets start the text at the same position as subsequent lines - if (attr.GetBulletStyle() != wxTEXT_ATTR_BULLET_STYLE_NONE) - availableTextSpaceFirstLine -= leftSubIndent; - - int availableTextSpaceSubsequentLines = rect.GetWidth() - leftIndent - rightIndent - leftSubIndent; - - // Start position for each line relative to the paragraph - int startPositionFirstLine = leftIndent; - int startPositionSubsequentLines = leftIndent + leftSubIndent; - - // If we have a bullet in this paragraph, the start position for the first line's text - // is actually leftIndent + leftSubIndent. - if (attr.GetBulletStyle() != wxTEXT_ATTR_BULLET_STYLE_NONE) - startPositionFirstLine = startPositionSubsequentLines; - - long lastEndPos = GetRange().GetStart()-1; - long lastCompletedEndPos = lastEndPos; - - int currentWidth = 0; - SetPosition(rect.GetPosition()); - - wxPoint currentPosition(0, spaceBeforePara); // We will calculate lines relative to paragraph - int lineHeight = 0; - int maxWidth = 0; - int maxDescent = 0; - int maxAscent = 0; - int lineCount = 0; - - wxRichTextObjectList::compatibility_iterator node; - -#if wxRICHTEXT_USE_PARTIAL_TEXT_EXTENTS - wxUnusedVar(style); - - g_GlobalPartialTextExtents.Clear(); - g_UseGlobalPartialTextExtents = true; - - wxSize paraSize; - int paraDescent; - - // This calculates the partial text extents - GetRangeSize(GetRange(), paraSize, paraDescent, dc, wxRICHTEXT_UNFORMATTED|wxRICHTEXT_CACHE_SIZE, rect.GetPosition()); - g_UseGlobalPartialTextExtents = false; -#else - node = m_children.GetFirst(); - while (node) - { - wxRichTextObject* child = node->GetData(); - - child->SetCachedSize(wxDefaultSize); - child->Layout(dc, rect, style); - - node = node->GetNext(); - } - -#endif - - // Split up lines - - // We may need to go back to a previous child, in which case create the new line, - // find the child corresponding to the start position of the string, and - // continue. - - node = m_children.GetFirst(); - while (node) - { - wxRichTextObject* child = node->GetData(); - - if (child->GetRange().GetLength() == 0) - { - node = node->GetNext(); - continue; - } - - // If this is e.g. a composite text box, it will need to be laid out itself. - // But if just a text fragment or image, for example, this will - // do nothing. NB: won't we need to set the position after layout? - // since for example if position is dependent on vertical line size, we - // can't tell the position until the size is determined. So possibly introduce - // another layout phase. - - // Available width depends on whether we're on the first or subsequent lines - int availableSpaceForText = (lineCount == 0 ? availableTextSpaceFirstLine : availableTextSpaceSubsequentLines); - - currentPosition.x = (lineCount == 0 ? startPositionFirstLine : startPositionSubsequentLines); - - // We may only be looking at part of a child, if we searched back for wrapping - // and found a suitable point some way into the child. So get the size for the fragment - // if necessary. - - long nextBreakPos = GetFirstLineBreakPosition(lastEndPos+1); - long lastPosToUse = child->GetRange().GetEnd(); - bool lineBreakInThisObject = (nextBreakPos > -1 && nextBreakPos <= child->GetRange().GetEnd()); - - if (lineBreakInThisObject) - lastPosToUse = nextBreakPos; - - wxSize childSize; - int childDescent = 0; - - if ((nextBreakPos == -1) && (lastEndPos == child->GetRange().GetStart() - 1)) // i.e. we want to get the whole thing - { - childSize = child->GetCachedSize(); - childDescent = child->GetDescent(); - } - else - { -#if wxRICHTEXT_USE_PARTIAL_TEXT_EXTENTS - // Get height only, then the width using the partial extents - GetRangeSize(wxRichTextRange(lastEndPos+1, lastPosToUse), childSize, childDescent, dc, wxRICHTEXT_UNFORMATTED|wxRICHTEXT_HEIGHT_ONLY); - childSize.x = wxRichTextGetRangeWidth(*this, wxRichTextRange(lastEndPos+1, lastPosToUse), g_GlobalPartialTextExtents); -#else - GetRangeSize(wxRichTextRange(lastEndPos+1, lastPosToUse), childSize, childDescent, dc, wxRICHTEXT_UNFORMATTED, rect.GetPosition()); -#endif - } - - // Cases: - // 1) There was a line break BEFORE the natural break - // 2) There was a line break AFTER the natural break - // 3) The child still fits (carry on) - - if ((lineBreakInThisObject && (childSize.x + currentWidth <= availableSpaceForText)) || - (childSize.x + currentWidth > availableSpaceForText)) - { - long wrapPosition = 0; - - // Find a place to wrap. This may walk back to previous children, - // for example if a word spans several objects. - if (!FindWrapPosition(wxRichTextRange(lastCompletedEndPos+1, child->GetRange().GetEnd()), dc, availableSpaceForText, wrapPosition)) - { - // If the function failed, just cut it off at the end of this child. - wrapPosition = child->GetRange().GetEnd(); - } - - // FindWrapPosition can still return a value that will put us in an endless wrapping loop - if (wrapPosition <= lastCompletedEndPos) - wrapPosition = wxMax(lastCompletedEndPos+1,child->GetRange().GetEnd()); - - // wxLogDebug(wxT("Split at %ld"), wrapPosition); - - // Let's find the actual size of the current line now - wxSize actualSize; - wxRichTextRange actualRange(lastCompletedEndPos+1, wrapPosition); - - /// Use previous descent, not the wrapping descent we just found, since this may be too big - /// for the fragment we're about to add. - childDescent = maxDescent; - -#if wxRICHTEXT_USE_PARTIAL_TEXT_EXTENTS - // Get height only, then the width using the partial extents - GetRangeSize(actualRange, actualSize, childDescent, dc, wxRICHTEXT_UNFORMATTED|wxRICHTEXT_HEIGHT_ONLY); - actualSize.x = wxRichTextGetRangeWidth(*this, actualRange, g_GlobalPartialTextExtents); -#else - GetRangeSize(actualRange, actualSize, childDescent, dc, wxRICHTEXT_UNFORMATTED); -#endif - - currentWidth = actualSize.x; - maxDescent = wxMax(childDescent, maxDescent); - maxAscent = wxMax(actualSize.y-childDescent, maxAscent); - lineHeight = maxDescent + maxAscent; - - // Add a new line - wxRichTextLine* line = AllocateLine(lineCount); - - // Set relative range so we won't have to change line ranges when paragraphs are moved - line->SetRange(wxRichTextRange(actualRange.GetStart() - GetRange().GetStart(), actualRange.GetEnd() - GetRange().GetStart())); - line->SetPosition(currentPosition); - line->SetSize(wxSize(currentWidth, lineHeight)); - line->SetDescent(maxDescent); - - // Now move down a line. TODO: add margins, spacing - currentPosition.y += lineHeight; - currentPosition.y += lineSpacing; - currentWidth = 0; - maxDescent = 0; - maxAscent = 0; - maxWidth = wxMax(maxWidth, currentWidth); - - lineCount ++; - - // TODO: account for zero-length objects, such as fields - wxASSERT(wrapPosition > lastCompletedEndPos); - - lastEndPos = wrapPosition; - lastCompletedEndPos = lastEndPos; - - lineHeight = 0; - - // May need to set the node back to a previous one, due to searching back in wrapping - wxRichTextObject* childAfterWrapPosition = FindObjectAtPosition(wrapPosition+1); - if (childAfterWrapPosition) - node = m_children.Find(childAfterWrapPosition); - else - node = node->GetNext(); - } - else - { - // We still fit, so don't add a line, and keep going - currentWidth += childSize.x; - maxDescent = wxMax(childDescent, maxDescent); - maxAscent = wxMax(childSize.y-childDescent, maxAscent); - lineHeight = maxDescent + maxAscent; - - maxWidth = wxMax(maxWidth, currentWidth); - lastEndPos = child->GetRange().GetEnd(); - - node = node->GetNext(); - } - } - - // Add the last line - it's the current pos -> last para pos - // Substract -1 because the last position is always the end-paragraph position. - if (lastCompletedEndPos <= GetRange().GetEnd()-1) - { - currentPosition.x = (lineCount == 0 ? startPositionFirstLine : startPositionSubsequentLines); - - wxRichTextLine* line = AllocateLine(lineCount); - - wxRichTextRange actualRange(lastCompletedEndPos+1, GetRange().GetEnd()-1); - - // Set relative range so we won't have to change line ranges when paragraphs are moved - line->SetRange(wxRichTextRange(actualRange.GetStart() - GetRange().GetStart(), actualRange.GetEnd() - GetRange().GetStart())); - - line->SetPosition(currentPosition); - - if (lineHeight == 0) - { - if (attr.GetFont().Ok()) - wxCheckSetFont(dc, attr.GetFont()); - lineHeight = dc.GetCharHeight(); - } - if (maxDescent == 0) - { - int w, h; - dc.GetTextExtent(wxT("X"), & w, &h, & maxDescent); - } - - line->SetSize(wxSize(currentWidth, lineHeight)); - line->SetDescent(maxDescent); - currentPosition.y += lineHeight; - currentPosition.y += lineSpacing; - lineCount ++; - } - - // Remove remaining unused line objects, if any - ClearUnusedLines(lineCount); - - // Apply styles to wrapped lines - g_globalDC = & dc; - ApplyParagraphStyle(attr, rect); - g_globalDC = NULL; - - SetCachedSize(wxSize(maxWidth, currentPosition.y + spaceAfterPara)); - - m_dirty = false; - -#if wxRICHTEXT_USE_PARTIAL_TEXT_EXTENTS -#if wxRICHTEXT_USE_OPTIMIZED_LINE_DRAWING - // Use the text extents to calculate the size of each fragment in each line - wxRichTextLineList::compatibility_iterator lineNode = m_cachedLines.GetFirst(); - while (lineNode) - { - wxRichTextLine* line = lineNode->GetData(); - wxRichTextRange lineRange = line->GetAbsoluteRange(); - - // Loop through objects until we get to the one within range - wxRichTextObjectList::compatibility_iterator node2 = m_children.GetFirst(); - - while (node2) - { - wxRichTextObject* child = node2->GetData(); - - if (child->GetRange().GetLength() > 0 && !child->GetRange().IsOutside(lineRange)) - { - wxRichTextRange rangeToUse = lineRange; - rangeToUse.LimitTo(child->GetRange()); - - // Find the size of the child from the text extents, and store in an array - // for drawing later - int left = 0; - if (rangeToUse.GetStart() > GetRange().GetStart()) - left = g_GlobalPartialTextExtents[(rangeToUse.GetStart()-1) - GetRange().GetStart()]; - int right = g_GlobalPartialTextExtents[rangeToUse.GetEnd() - GetRange().GetStart()]; - int sz = right - left; - line->GetObjectSizes().Add(sz); - } - else if (child->GetRange().GetStart() > lineRange.GetEnd()) - // Can break out of inner loop now since we've passed this line's range - break; - - node2 = node2->GetNext(); - } - - lineNode = lineNode->GetNext(); - } -#endif - - g_GlobalPartialTextExtents.Clear(); -#endif - - return true; -} - -/// Apply paragraph styles, such as centering, to wrapped lines -void wxRichTextParagraph::ApplyParagraphStyle(const wxTextAttrEx& attr, const wxRect& rect) -{ - if (!attr.HasAlignment()) - return; - - wxRichTextLineList::compatibility_iterator node = m_cachedLines.GetFirst(); - while (node) - { - wxRichTextLine* line = node->GetData(); - - wxPoint pos = line->GetPosition(); - wxSize size = line->GetSize(); - - // centering, right-justification - if (attr.HasAlignment() && GetAttributes().GetAlignment() == wxTEXT_ALIGNMENT_CENTRE) - { - int rightIndent = ConvertTenthsMMToPixels(* g_globalDC, attr.GetRightIndent()); - pos.x = (rect.GetWidth() - pos.x - rightIndent - size.x)/2 + pos.x; - line->SetPosition(pos); - } - else if (attr.HasAlignment() && GetAttributes().GetAlignment() == wxTEXT_ALIGNMENT_RIGHT) - { - int rightIndent = ConvertTenthsMMToPixels(* g_globalDC, attr.GetRightIndent()); - pos.x = rect.GetWidth() - size.x - rightIndent; - line->SetPosition(pos); - } - - node = node->GetNext(); - } -} - -/// Insert text at the given position -bool wxRichTextParagraph::InsertText(long pos, const wxString& text) -{ - wxRichTextObject* childToUse = NULL; - wxRichTextObjectList::compatibility_iterator nodeToUse = wxRichTextObjectList::compatibility_iterator(); - - wxRichTextObjectList::compatibility_iterator node = m_children.GetFirst(); - while (node) - { - wxRichTextObject* child = node->GetData(); - if (child->GetRange().Contains(pos) && child->GetRange().GetLength() > 0) - { - childToUse = child; - nodeToUse = node; - break; - } - - node = node->GetNext(); - } - - if (childToUse) - { - wxRichTextPlainText* textObject = wxDynamicCast(childToUse, wxRichTextPlainText); - if (textObject) - { - int posInString = pos - textObject->GetRange().GetStart(); - - wxString newText = textObject->GetText().Mid(0, posInString) + - text + textObject->GetText().Mid(posInString); - textObject->SetText(newText); - - int textLength = text.length(); - - textObject->SetRange(wxRichTextRange(textObject->GetRange().GetStart(), - textObject->GetRange().GetEnd() + textLength)); - - // Increment the end range of subsequent fragments in this paragraph. - // We'll set the paragraph range itself at a higher level. - - wxRichTextObjectList::compatibility_iterator node = nodeToUse->GetNext(); - while (node) - { - wxRichTextObject* child = node->GetData(); - child->SetRange(wxRichTextRange(textObject->GetRange().GetStart() + textLength, - textObject->GetRange().GetEnd() + textLength)); - - node = node->GetNext(); - } - - return true; - } - else - { - // TODO: if not a text object, insert at closest position, e.g. in front of it - } - } - else - { - // Add at end. - // Don't pass parent initially to suppress auto-setting of parent range. - // We'll do that at a higher level. - wxRichTextPlainText* textObject = new wxRichTextPlainText(text, this); - - AppendChild(textObject); - return true; - } - - return false; -} - -void wxRichTextParagraph::Copy(const wxRichTextParagraph& obj) -{ - wxRichTextBox::Copy(obj); -} - -/// Clear the cached lines -void wxRichTextParagraph::ClearLines() -{ - WX_CLEAR_LIST(wxRichTextLineList, m_cachedLines); -} - -/// Get/set the object size for the given range. Returns false if the range -/// is invalid for this object. -bool wxRichTextParagraph::GetRangeSize(const wxRichTextRange& range, wxSize& size, int& descent, wxDC& dc, int flags, wxPoint position) const -{ - if (!range.IsWithin(GetRange())) - return false; - - if (flags & wxRICHTEXT_UNFORMATTED) - { - // Just use unformatted data, assume no line breaks - // TODO: take into account line breaks - - wxSize sz; - - wxRichTextObjectList::compatibility_iterator node = m_children.GetFirst(); - while (node) - { - wxRichTextObject* child = node->GetData(); - if (!child->GetRange().IsOutside(range)) - { - wxSize childSize; - - wxRichTextRange rangeToUse = range; - rangeToUse.LimitTo(child->GetRange()); - int childDescent = 0; - - // At present wxRICHTEXT_HEIGHT_ONLY is only fast if we're already cached the size, - // but it's only going to be used after caching has taken place. - if ((flags & wxRICHTEXT_HEIGHT_ONLY) && child->GetCachedSize().y != 0) - { - childDescent = child->GetDescent(); - childSize = child->GetCachedSize(); - - sz.y = wxMax(sz.y, childSize.y); - sz.x += childSize.x; - descent = wxMax(descent, childDescent); - } - else if (child->GetRangeSize(rangeToUse, childSize, childDescent, dc, flags, wxPoint(position.x + sz.x, position.y))) - { - sz.y = wxMax(sz.y, childSize.y); - sz.x += childSize.x; - descent = wxMax(descent, childDescent); - - if ((flags & wxRICHTEXT_CACHE_SIZE) && (rangeToUse == child->GetRange())) - { - child->SetCachedSize(childSize); - child->SetDescent(childDescent); - } - } - } - - node = node->GetNext(); - } - size = sz; - } - else - { - // Use formatted data, with line breaks - wxSize sz; - - // We're going to loop through each line, and then for each line, - // call GetRangeSize for the fragment that comprises that line. - // Only we have to do that multiple times within the line, because - // the line may be broken into pieces. For now ignore line break commands - // (so we can assume that getting the unformatted size for a fragment - // within a line is the actual size) - - wxRichTextLineList::compatibility_iterator node = m_cachedLines.GetFirst(); - while (node) - { - wxRichTextLine* line = node->GetData(); - wxRichTextRange lineRange = line->GetAbsoluteRange(); - if (!lineRange.IsOutside(range)) - { - wxSize lineSize; - - wxRichTextObjectList::compatibility_iterator node2 = m_children.GetFirst(); - while (node2) - { - wxRichTextObject* child = node2->GetData(); - - if (!child->GetRange().IsOutside(lineRange)) - { - wxRichTextRange rangeToUse = lineRange; - rangeToUse.LimitTo(child->GetRange()); - - wxSize childSize; - int childDescent = 0; - if (child->GetRangeSize(rangeToUse, childSize, childDescent, dc, flags, wxPoint(position.x + sz.x, position.y))) - { - lineSize.y = wxMax(lineSize.y, childSize.y); - lineSize.x += childSize.x; - } - descent = wxMax(descent, childDescent); - } - - node2 = node2->GetNext(); - } - - // Increase size by a line (TODO: paragraph spacing) - sz.y += lineSize.y; - sz.x = wxMax(sz.x, lineSize.x); - } - node = node->GetNext(); - } - size = sz; - } - return true; -} - -/// Finds the absolute position and row height for the given character position -bool wxRichTextParagraph::FindPosition(wxDC& dc, long index, wxPoint& pt, int* height, bool forceLineStart) -{ - if (index == -1) - { - wxRichTextLine* line = ((wxRichTextParagraphLayoutBox*)GetParent())->GetLineAtPosition(0); - if (line) - *height = line->GetSize().y; - else - *height = dc.GetCharHeight(); - - // -1 means 'the start of the buffer'. - pt = GetPosition(); - if (line) - pt = pt + line->GetPosition(); - - return true; - } - - // The final position in a paragraph is taken to mean the position - // at the start of the next paragraph. - if (index == GetRange().GetEnd()) - { - wxRichTextParagraphLayoutBox* parent = wxDynamicCast(GetParent(), wxRichTextParagraphLayoutBox); - wxASSERT( parent != NULL ); - - // Find the height at the next paragraph, if any - wxRichTextLine* line = parent->GetLineAtPosition(index + 1); - if (line) - { - *height = line->GetSize().y; - pt = line->GetAbsolutePosition(); - } - else - { - *height = dc.GetCharHeight(); - int indent = ConvertTenthsMMToPixels(dc, m_attributes.GetLeftIndent()); - pt = wxPoint(indent, GetCachedSize().y); - } - - return true; - } - - if (index < GetRange().GetStart() || index > GetRange().GetEnd()) - return false; - - wxRichTextLineList::compatibility_iterator node = m_cachedLines.GetFirst(); - while (node) - { - wxRichTextLine* line = node->GetData(); - wxRichTextRange lineRange = line->GetAbsoluteRange(); - if (index >= lineRange.GetStart() && index <= lineRange.GetEnd()) - { - // If this is the last point in the line, and we're forcing the - // returned value to be the start of the next line, do the required - // thing. - if (index == lineRange.GetEnd() && forceLineStart) - { - if (node->GetNext()) - { - wxRichTextLine* nextLine = node->GetNext()->GetData(); - *height = nextLine->GetSize().y; - pt = nextLine->GetAbsolutePosition(); - return true; - } - } - - pt.y = line->GetPosition().y + GetPosition().y; - - wxRichTextRange r(lineRange.GetStart(), index); - wxSize rangeSize; - int descent = 0; - - // We find the size of the line up to this point, - // then we can add this size to the line start position and - // paragraph start position to find the actual position. - - if (GetRangeSize(r, rangeSize, descent, dc, wxRICHTEXT_UNFORMATTED, line->GetPosition()+ GetPosition())) - { - pt.x = line->GetPosition().x + GetPosition().x + rangeSize.x; - *height = line->GetSize().y; - - return true; - } - - } - - node = node->GetNext(); - } - - return false; -} - -/// Hit-testing: returns a flag indicating hit test details, plus -/// information about position -int wxRichTextParagraph::HitTest(wxDC& dc, const wxPoint& pt, long& textPosition) -{ - wxPoint paraPos = GetPosition(); - - wxRichTextLineList::compatibility_iterator node = m_cachedLines.GetFirst(); - while (node) - { - wxRichTextLine* line = node->GetData(); - wxPoint linePos = paraPos + line->GetPosition(); - wxSize lineSize = line->GetSize(); - wxRichTextRange lineRange = line->GetAbsoluteRange(); - - if (pt.y <= linePos.y + lineSize.y) - { - if (pt.x < linePos.x) - { - textPosition = lineRange.GetStart(); - return wxRICHTEXT_HITTEST_BEFORE|wxRICHTEXT_HITTEST_OUTSIDE; - } - else if (pt.x >= (linePos.x + lineSize.x)) - { - textPosition = lineRange.GetEnd(); - return wxRICHTEXT_HITTEST_AFTER|wxRICHTEXT_HITTEST_OUTSIDE; - } - else - { -#if wxRICHTEXT_USE_PARTIAL_TEXT_EXTENTS - g_GlobalPartialTextExtents.Clear(); - g_UseGlobalPartialTextExtents = true; - - wxSize paraSize; - int paraDescent; - - // This calculates the partial text extents - GetRangeSize(lineRange, paraSize, paraDescent, dc, wxRICHTEXT_UNFORMATTED, linePos); - g_UseGlobalPartialTextExtents = false; - - int lastX = linePos.x; - size_t i; - for (i = 0; i < g_GlobalPartialTextExtents.GetCount(); i++) - { - int nextX = g_GlobalPartialTextExtents[i] + linePos.x; - - if (pt.x >= lastX && pt.x <= nextX) - { - textPosition = i + lineRange.GetStart(); // minus 1? - - g_GlobalPartialTextExtents.Clear(); - - // So now we know it's between i-1 and i. - // Let's see if we can be more precise about - // which side of the position it's on. - - int midPoint = (nextX - lastX)/2 + lastX; - if (pt.x >= midPoint) - return wxRICHTEXT_HITTEST_AFTER; - else - return wxRICHTEXT_HITTEST_BEFORE; - } - - lastX = nextX; - } - - g_GlobalPartialTextExtents.Clear(); -#else - long i; - int lastX = linePos.x; - for (i = lineRange.GetStart(); i <= lineRange.GetEnd(); i++) - { - wxSize childSize; - int descent = 0; - - wxRichTextRange rangeToUse(lineRange.GetStart(), i); - - GetRangeSize(rangeToUse, childSize, descent, dc, wxRICHTEXT_UNFORMATTED, linePos); - - int nextX = childSize.x + linePos.x; - - if (pt.x >= lastX && pt.x <= nextX) - { - textPosition = i; - - // So now we know it's between i-1 and i. - // Let's see if we can be more precise about - // which side of the position it's on. - - int midPoint = (nextX - lastX)/2 + lastX; - if (pt.x >= midPoint) - return wxRICHTEXT_HITTEST_AFTER; - else - return wxRICHTEXT_HITTEST_BEFORE; - } - else - { - lastX = nextX; - } - } -#endif - } - } - - node = node->GetNext(); - } - - return wxRICHTEXT_HITTEST_NONE; -} - -/// Split an object at this position if necessary, and return -/// the previous object, or NULL if inserting at beginning. -wxRichTextObject* wxRichTextParagraph::SplitAt(long pos, wxRichTextObject** previousObject) -{ - wxRichTextObjectList::compatibility_iterator node = m_children.GetFirst(); - while (node) - { - wxRichTextObject* child = node->GetData(); - - if (pos == child->GetRange().GetStart()) - { - if (previousObject) - { - if (node->GetPrevious()) - *previousObject = node->GetPrevious()->GetData(); - else - *previousObject = NULL; - } - - return child; - } - - if (child->GetRange().Contains(pos)) - { - // This should create a new object, transferring part of - // the content to the old object and the rest to the new object. - wxRichTextObject* newObject = child->DoSplit(pos); - - // If we couldn't split this object, just insert in front of it. - if (!newObject) - { - // Maybe this is an empty string, try the next one - // return child; - } - else - { - // Insert the new object after 'child' - if (node->GetNext()) - m_children.Insert(node->GetNext(), newObject); - else - m_children.Append(newObject); - newObject->SetParent(this); - - if (previousObject) - *previousObject = child; - - return newObject; - } - } - - node = node->GetNext(); - } - if (previousObject) - *previousObject = NULL; - return NULL; -} - -/// Move content to a list from obj on -void wxRichTextParagraph::MoveToList(wxRichTextObject* obj, wxList& list) -{ - wxRichTextObjectList::compatibility_iterator node = m_children.Find(obj); - while (node) - { - wxRichTextObject* child = node->GetData(); - list.Append(child); - - wxRichTextObjectList::compatibility_iterator oldNode = node; - - node = node->GetNext(); - - m_children.DeleteNode(oldNode); - } -} - -/// Add content back from list -void wxRichTextParagraph::MoveFromList(wxList& list) -{ - for (wxList::compatibility_iterator node = list.GetFirst(); node; node = node->GetNext()) - { - AppendChild((wxRichTextObject*) node->GetData()); - } -} - -/// Calculate range -void wxRichTextParagraph::CalculateRange(long start, long& end) -{ - wxRichTextCompositeObject::CalculateRange(start, end); - - // Add one for end of paragraph - end ++; - - m_range.SetRange(start, end); -} - -/// Find the object at the given position -wxRichTextObject* wxRichTextParagraph::FindObjectAtPosition(long position) -{ - wxRichTextObjectList::compatibility_iterator node = m_children.GetFirst(); - while (node) - { - wxRichTextObject* obj = node->GetData(); - if (obj->GetRange().Contains(position)) - return obj; - - node = node->GetNext(); - } - return NULL; -} - -/// Get the plain text searching from the start or end of the range. -/// The resulting string may be shorter than the range given. -bool wxRichTextParagraph::GetContiguousPlainText(wxString& text, const wxRichTextRange& range, bool fromStart) -{ - text = wxEmptyString; - - if (fromStart) - { - wxRichTextObjectList::compatibility_iterator node = m_children.GetFirst(); - while (node) - { - wxRichTextObject* obj = node->GetData(); - if (!obj->GetRange().IsOutside(range)) - { - wxRichTextPlainText* textObj = wxDynamicCast(obj, wxRichTextPlainText); - if (textObj) - { - text += textObj->GetTextForRange(range); - } - else - { - text += wxT(" "); - } - } - - node = node->GetNext(); - } - } - else - { - wxRichTextObjectList::compatibility_iterator node = m_children.GetLast(); - while (node) - { - wxRichTextObject* obj = node->GetData(); - if (!obj->GetRange().IsOutside(range)) - { - wxRichTextPlainText* textObj = wxDynamicCast(obj, wxRichTextPlainText); - if (textObj) - { - text = textObj->GetTextForRange(range) + text; - } - else - { - text = wxT(" ") + text; - } - } - - node = node->GetPrevious(); - } - } - - return true; -} - -/// Find a suitable wrap position. -bool wxRichTextParagraph::FindWrapPosition(const wxRichTextRange& range, wxDC& dc, int availableSpace, long& wrapPosition) -{ - if (range.GetLength() <= 0) - return false; - - // Find the first position where the line exceeds the available space. - wxSize sz; - long breakPosition = range.GetEnd(); - -#if wxRICHTEXT_USE_PARTIAL_TEXT_EXTENTS - if (g_GlobalPartialTextExtents.GetCount() >= (size_t) (GetRange().GetLength()-1)) // the final position in a paragraph is the newline - { - int widthBefore; - - if (range.GetStart() > GetRange().GetStart()) - widthBefore = g_GlobalPartialTextExtents[range.GetStart() - GetRange().GetStart() - 1]; - else - widthBefore = 0; - - size_t i; - for (i = (size_t) range.GetStart(); i <= (size_t) range.GetEnd(); i++) - { - int widthFromStartOfThisRange = g_GlobalPartialTextExtents[i - GetRange().GetStart()] - widthBefore; - - if (widthFromStartOfThisRange > availableSpace) - { - breakPosition = i-1; - break; - } - } - } - else -#endif - { - // Binary chop for speed - long minPos = range.GetStart(); - long maxPos = range.GetEnd(); - while (true) - { - if (minPos == maxPos) - { - int descent = 0; - GetRangeSize(wxRichTextRange(range.GetStart(), minPos), sz, descent, dc, wxRICHTEXT_UNFORMATTED); - - if (sz.x > availableSpace) - breakPosition = minPos - 1; - break; - } - else if ((maxPos - minPos) == 1) - { - int descent = 0; - GetRangeSize(wxRichTextRange(range.GetStart(), minPos), sz, descent, dc, wxRICHTEXT_UNFORMATTED); - - if (sz.x > availableSpace) - breakPosition = minPos - 1; - else - { - GetRangeSize(wxRichTextRange(range.GetStart(), maxPos), sz, descent, dc, wxRICHTEXT_UNFORMATTED); - if (sz.x > availableSpace) - breakPosition = maxPos-1; - } - break; - } - else - { - long nextPos = minPos + ((maxPos - minPos) / 2); - - int descent = 0; - GetRangeSize(wxRichTextRange(range.GetStart(), nextPos), sz, descent, dc, wxRICHTEXT_UNFORMATTED); - - if (sz.x > availableSpace) - { - maxPos = nextPos; - } - else - { - minPos = nextPos; - } - } - } - } - - // Now we know the last position on the line. - // Let's try to find a word break. - - wxString plainText; - if (GetContiguousPlainText(plainText, wxRichTextRange(range.GetStart(), breakPosition), false)) - { - int newLinePos = plainText.Find(wxRichTextLineBreakChar); - if (newLinePos != wxNOT_FOUND) - { - breakPosition = wxMax(0, range.GetStart() + newLinePos); - } - else - { - int spacePos = plainText.Find(wxT(' '), true); - int tabPos = plainText.Find(wxT('\t'), true); - int pos = wxMax(spacePos, tabPos); - if (pos != wxNOT_FOUND) - { - int positionsFromEndOfString = plainText.length() - pos - 1; - breakPosition = breakPosition - positionsFromEndOfString; - } - } - } - - wrapPosition = breakPosition; - - return true; -} - -/// Get the bullet text for this paragraph. -wxString wxRichTextParagraph::GetBulletText() -{ - if (GetAttributes().GetBulletStyle() == wxTEXT_ATTR_BULLET_STYLE_NONE || - (GetAttributes().GetBulletStyle() & wxTEXT_ATTR_BULLET_STYLE_BITMAP)) - return wxEmptyString; - - int number = GetAttributes().GetBulletNumber(); - - wxString text; - if ((GetAttributes().GetBulletStyle() & wxTEXT_ATTR_BULLET_STYLE_ARABIC) || (GetAttributes().GetBulletStyle() & wxTEXT_ATTR_BULLET_STYLE_OUTLINE)) - { - text.Printf(wxT("%d"), number); - } - else if (GetAttributes().GetBulletStyle() & wxTEXT_ATTR_BULLET_STYLE_LETTERS_UPPER) - { - // TODO: Unicode, and also check if number > 26 - text.Printf(wxT("%c"), (wxChar) (number+64)); - } - else if (GetAttributes().GetBulletStyle() & wxTEXT_ATTR_BULLET_STYLE_LETTERS_LOWER) - { - // TODO: Unicode, and also check if number > 26 - text.Printf(wxT("%c"), (wxChar) (number+96)); - } - else if (GetAttributes().GetBulletStyle() & wxTEXT_ATTR_BULLET_STYLE_ROMAN_UPPER) - { - text = wxRichTextDecimalToRoman(number); - } - else if (GetAttributes().GetBulletStyle() & wxTEXT_ATTR_BULLET_STYLE_ROMAN_LOWER) - { - text = wxRichTextDecimalToRoman(number); - text.MakeLower(); - } - else if (GetAttributes().GetBulletStyle() & wxTEXT_ATTR_BULLET_STYLE_SYMBOL) - { - text = GetAttributes().GetBulletText(); - } - - if (GetAttributes().GetBulletStyle() & wxTEXT_ATTR_BULLET_STYLE_OUTLINE) - { - // The outline style relies on the text being computed statically, - // since it depends on other levels points (e.g. 1.2.1.1). So normally the bullet text - // should be stored in the attributes; if not, just use the number for this - // level, as previously computed. - if (!GetAttributes().GetBulletText().IsEmpty()) - text = GetAttributes().GetBulletText(); - } - - if (GetAttributes().GetBulletStyle() & wxTEXT_ATTR_BULLET_STYLE_PARENTHESES) - { - text = wxT("(") + text + wxT(")"); - } - else if (GetAttributes().GetBulletStyle() & wxTEXT_ATTR_BULLET_STYLE_RIGHT_PARENTHESIS) - { - text = text + wxT(")"); - } - - if (GetAttributes().GetBulletStyle() & wxTEXT_ATTR_BULLET_STYLE_PERIOD) - { - text += wxT("."); - } - - return text; -} - -/// Allocate or reuse a line object -wxRichTextLine* wxRichTextParagraph::AllocateLine(int pos) -{ - if (pos < (int) m_cachedLines.GetCount()) - { - wxRichTextLine* line = m_cachedLines.Item(pos)->GetData(); - line->Init(this); - return line; - } - else - { - wxRichTextLine* line = new wxRichTextLine(this); - m_cachedLines.Append(line); - return line; - } -} - -/// Clear remaining unused line objects, if any -bool wxRichTextParagraph::ClearUnusedLines(int lineCount) -{ - int cachedLineCount = m_cachedLines.GetCount(); - if ((int) cachedLineCount > lineCount) - { - for (int i = 0; i < (int) (cachedLineCount - lineCount); i ++) - { - wxRichTextLineList::compatibility_iterator node = m_cachedLines.GetLast(); - wxRichTextLine* line = node->GetData(); - m_cachedLines.Erase(node); - delete line; - } - } - return true; -} - -/// Get combined attributes of the base style, paragraph style and character style. We use this to dynamically -/// retrieve the actual style. -wxTextAttrEx wxRichTextParagraph::GetCombinedAttributes(const wxTextAttrEx& contentStyle) const -{ - wxTextAttrEx attr; - wxRichTextBuffer* buf = wxDynamicCast(GetParent(), wxRichTextBuffer); - if (buf) - { - attr = buf->GetBasicStyle(); - wxRichTextApplyStyle(attr, GetAttributes()); - } - else - attr = GetAttributes(); - - wxRichTextApplyStyle(attr, contentStyle); - return attr; -} - -/// Get combined attributes of the base style and paragraph style. -wxTextAttrEx wxRichTextParagraph::GetCombinedAttributes() const -{ - wxTextAttrEx attr; - wxRichTextBuffer* buf = wxDynamicCast(GetParent(), wxRichTextBuffer); - if (buf) - { - attr = buf->GetBasicStyle(); - wxRichTextApplyStyle(attr, GetAttributes()); - } - else - attr = GetAttributes(); - - return attr; -} - -/// Create default tabstop array -void wxRichTextParagraph::InitDefaultTabs() -{ - // create a default tab list at 10 mm each. - for (int i = 0; i < 20; ++i) - { - sm_defaultTabs.Add(i*100); - } -} - -/// Clear default tabstop array -void wxRichTextParagraph::ClearDefaultTabs() -{ - sm_defaultTabs.Clear(); -} - -/// Get the first position from pos that has a line break character. -long wxRichTextParagraph::GetFirstLineBreakPosition(long pos) -{ - wxRichTextObjectList::compatibility_iterator node = m_children.GetFirst(); - while (node) - { - wxRichTextObject* obj = node->GetData(); - if (pos >= obj->GetRange().GetStart() && pos <= obj->GetRange().GetEnd()) - { - wxRichTextPlainText* textObj = wxDynamicCast(obj, wxRichTextPlainText); - if (textObj) - { - long breakPos = textObj->GetFirstLineBreakPosition(pos); - if (breakPos > -1) - return breakPos; - } - } - node = node->GetNext(); - } - return -1; -} - -/*! - * wxRichTextLine - * This object represents a line in a paragraph, and stores - * offsets from the start of the paragraph representing the - * start and end positions of the line. - */ - -wxRichTextLine::wxRichTextLine(wxRichTextParagraph* parent) -{ - Init(parent); -} - -/// Initialisation -void wxRichTextLine::Init(wxRichTextParagraph* parent) -{ - m_parent = parent; - m_range.SetRange(-1, -1); - m_pos = wxPoint(0, 0); - m_size = wxSize(0, 0); - m_descent = 0; -#if wxRICHTEXT_USE_OPTIMIZED_LINE_DRAWING - m_objectSizes.Clear(); -#endif -} - -/// Copy -void wxRichTextLine::Copy(const wxRichTextLine& obj) -{ - m_range = obj.m_range; -#if wxRICHTEXT_USE_OPTIMIZED_LINE_DRAWING - m_objectSizes = obj.m_objectSizes; -#endif -} - -/// Get the absolute object position -wxPoint wxRichTextLine::GetAbsolutePosition() const -{ - return m_parent->GetPosition() + m_pos; -} - -/// Get the absolute range -wxRichTextRange wxRichTextLine::GetAbsoluteRange() const -{ - wxRichTextRange range(m_range.GetStart() + m_parent->GetRange().GetStart(), 0); - range.SetEnd(range.GetStart() + m_range.GetLength()-1); - return range; -} - -/*! - * wxRichTextPlainText - * This object represents a single piece of text. - */ - -IMPLEMENT_DYNAMIC_CLASS(wxRichTextPlainText, wxRichTextObject) - -wxRichTextPlainText::wxRichTextPlainText(const wxString& text, wxRichTextObject* parent, wxTextAttrEx* style): - wxRichTextObject(parent) -{ - if (style) - SetAttributes(*style); - - m_text = text; -} - -#define USE_KERNING_FIX 1 - -// If insufficient tabs are defined, this is the tab width used -#define WIDTH_FOR_DEFAULT_TABS 50 - -/// Draw the item -bool wxRichTextPlainText::Draw(wxDC& dc, const wxRichTextRange& range, const wxRichTextRange& selectionRange, const wxRect& rect, int descent, int WXUNUSED(style)) -{ - wxRichTextParagraph* para = wxDynamicCast(GetParent(), wxRichTextParagraph); - wxASSERT (para != NULL); - - wxTextAttrEx textAttr(para ? para->GetCombinedAttributes(GetAttributes()) : GetAttributes()); - - int offset = GetRange().GetStart(); - - // Replace line break characters with spaces - wxString str = m_text; - wxString toRemove = wxRichTextLineBreakChar; - str.Replace(toRemove, wxT(" ")); - if (textAttr.HasTextEffects() && (textAttr.GetTextEffects() & wxTEXT_ATTR_EFFECT_CAPITALS)) - str.MakeUpper(); - - long len = range.GetLength(); - wxString stringChunk = str.Mid(range.GetStart() - offset, (size_t) len); - - wxFont textFont = textAttr.GetFont(); - if (textFont.Ok()) - wxCheckSetFont(dc, textFont); - - int charHeight = dc.GetCharHeight(); - - int x, y; - if ( textFont.Ok() ) - { - if ( textAttr.HasTextEffects() && (textAttr.GetTextEffects() & wxTEXT_ATTR_EFFECT_SUPERSCRIPT) ) - { - double size = static_cast(textFont.GetPointSize()) / wxSCRIPT_MUL_FACTOR; - textFont.SetPointSize( static_cast(size) ); - x = rect.x; - y = rect.y; - wxCheckSetFont(dc, textFont); - } - else if ( textAttr.HasTextEffects() && (textAttr.GetTextEffects() & wxTEXT_ATTR_EFFECT_SUBSCRIPT) ) - { - double size = static_cast(textFont.GetPointSize()) / wxSCRIPT_MUL_FACTOR; - textFont.SetPointSize( static_cast(size) ); - x = rect.x; - int sub_height = static_cast( static_cast(charHeight) / wxSCRIPT_MUL_FACTOR); - y = rect.y + (rect.height - sub_height + (descent - m_descent)); - wxCheckSetFont(dc, textFont); - } - else - { - x = rect.x; - y = rect.y + (rect.height - charHeight - (descent - m_descent)); - } - } - else - { - x = rect.x; - y = rect.y + (rect.height - charHeight - (descent - m_descent)); - } - - // Test for the optimized situations where all is selected, or none - // is selected. - - // (a) All selected. - if (selectionRange.GetStart() <= range.GetStart() && selectionRange.GetEnd() >= range.GetEnd()) - { - DrawTabbedString(dc, textAttr, rect, stringChunk, x, y, true); - } - // (b) None selected. - else if (selectionRange.GetEnd() < range.GetStart() || selectionRange.GetStart() > range.GetEnd()) - { - // Draw all unselected - DrawTabbedString(dc, textAttr, rect, stringChunk, x, y, false); - } - else - { - // (c) Part selected, part not - // Let's draw unselected chunk, selected chunk, then unselected chunk. - - dc.SetBackgroundMode(wxTRANSPARENT); - - // 1. Initial unselected chunk, if any, up until start of selection. - if (selectionRange.GetStart() > range.GetStart() && selectionRange.GetStart() <= range.GetEnd()) - { - int r1 = range.GetStart(); - int s1 = selectionRange.GetStart()-1; - int fragmentLen = s1 - r1 + 1; - if (fragmentLen < 0) - wxLogDebug(wxT("Mid(%d, %d"), (int)(r1 - offset), (int)fragmentLen); - wxString stringFragment = str.Mid(r1 - offset, fragmentLen); - - DrawTabbedString(dc, textAttr, rect, stringFragment, x, y, false); - -#if USE_KERNING_FIX - if (stringChunk.Find(wxT("\t")) == wxNOT_FOUND) - { - // Compensate for kerning difference - wxString stringFragment2(str.Mid(r1 - offset, fragmentLen+1)); - wxString stringFragment3(str.Mid(r1 - offset + fragmentLen, 1)); - - wxCoord w1, h1, w2, h2, w3, h3; - dc.GetTextExtent(stringFragment, & w1, & h1); - dc.GetTextExtent(stringFragment2, & w2, & h2); - dc.GetTextExtent(stringFragment3, & w3, & h3); - - int kerningDiff = (w1 + w3) - w2; - x = x - kerningDiff; - } -#endif - } - - // 2. Selected chunk, if any. - if (selectionRange.GetEnd() >= range.GetStart()) - { - int s1 = wxMax(selectionRange.GetStart(), range.GetStart()); - int s2 = wxMin(selectionRange.GetEnd(), range.GetEnd()); - - int fragmentLen = s2 - s1 + 1; - if (fragmentLen < 0) - wxLogDebug(wxT("Mid(%d, %d"), (int)(s1 - offset), (int)fragmentLen); - wxString stringFragment = str.Mid(s1 - offset, fragmentLen); - - DrawTabbedString(dc, textAttr, rect, stringFragment, x, y, true); - -#if USE_KERNING_FIX - if (stringChunk.Find(wxT("\t")) == wxNOT_FOUND) - { - // Compensate for kerning difference - wxString stringFragment2(str.Mid(s1 - offset, fragmentLen+1)); - wxString stringFragment3(str.Mid(s1 - offset + fragmentLen, 1)); - - wxCoord w1, h1, w2, h2, w3, h3; - dc.GetTextExtent(stringFragment, & w1, & h1); - dc.GetTextExtent(stringFragment2, & w2, & h2); - dc.GetTextExtent(stringFragment3, & w3, & h3); - - int kerningDiff = (w1 + w3) - w2; - x = x - kerningDiff; - } -#endif - } - - // 3. Remaining unselected chunk, if any - if (selectionRange.GetEnd() < range.GetEnd()) - { - int s2 = wxMin(selectionRange.GetEnd()+1, range.GetEnd()); - int r2 = range.GetEnd(); - - int fragmentLen = r2 - s2 + 1; - if (fragmentLen < 0) - wxLogDebug(wxT("Mid(%d, %d"), (int)(s2 - offset), (int)fragmentLen); - wxString stringFragment = str.Mid(s2 - offset, fragmentLen); - - DrawTabbedString(dc, textAttr, rect, stringFragment, x, y, false); - } - } - - return true; -} - -bool wxRichTextPlainText::DrawTabbedString(wxDC& dc, const wxTextAttrEx& attr, const wxRect& rect,wxString& str, wxCoord& x, wxCoord& y, bool selected) -{ - bool hasTabs = (str.Find(wxT('\t')) != wxNOT_FOUND); - - wxArrayInt tabArray; - int tabCount; - if (hasTabs) - { - if (attr.GetTabs().IsEmpty()) - tabArray = wxRichTextParagraph::GetDefaultTabs(); - else - tabArray = attr.GetTabs(); - tabCount = tabArray.GetCount(); - - for (int i = 0; i < tabCount; ++i) - { - int pos = tabArray[i]; - pos = ConvertTenthsMMToPixels(dc, pos); - tabArray[i] = pos; - } - } - else - tabCount = 0; - - int nextTabPos = -1; - int tabPos = -1; - wxCoord w, h; - - if (selected) - { - wxColour highlightColour(wxSystemSettings::GetColour(wxSYS_COLOUR_HIGHLIGHT)); - wxColour highlightTextColour(wxSystemSettings::GetColour(wxSYS_COLOUR_HIGHLIGHTTEXT)); - - wxCheckSetBrush(dc, wxBrush(highlightColour)); - wxCheckSetPen(dc, wxPen(highlightColour)); - dc.SetTextForeground(highlightTextColour); - dc.SetBackgroundMode(wxTRANSPARENT); - } - else - { - dc.SetTextForeground(attr.GetTextColour()); - - if (attr.HasFlag(wxTEXT_ATTR_BACKGROUND_COLOUR) && attr.GetBackgroundColour().IsOk()) - { - dc.SetBackgroundMode(wxSOLID); - dc.SetTextBackground(attr.GetBackgroundColour()); - } - else - dc.SetBackgroundMode(wxTRANSPARENT); - } - - wxCoord x_orig = GetParent()->GetPosition().x; - while (hasTabs) - { - // the string has a tab - // break up the string at the Tab - wxString stringChunk = str.BeforeFirst(wxT('\t')); - str = str.AfterFirst(wxT('\t')); - dc.GetTextExtent(stringChunk, & w, & h); - tabPos = x + w; - bool not_found = true; - for (int i = 0; i < tabCount && not_found; ++i) - { - nextTabPos = tabArray.Item(i) + x_orig; - // Find the next tab position. - // Even if we're at the end of the tab array, we must still draw the chunk. - - if (nextTabPos > tabPos || (i == (tabCount - 1))) - { - if (nextTabPos <= tabPos) - { - int defaultTabWidth = ConvertTenthsMMToPixels(dc, WIDTH_FOR_DEFAULT_TABS); - nextTabPos = tabPos + defaultTabWidth; - } - - not_found = false; - if (selected) - { - w = nextTabPos - x; - wxRect selRect(x, rect.y, w, rect.GetHeight()); - dc.DrawRectangle(selRect); - } - dc.DrawText(stringChunk, x, y); - - if (attr.HasTextEffects() && (attr.GetTextEffects() & wxTEXT_ATTR_EFFECT_STRIKETHROUGH)) - { - wxPen oldPen = dc.GetPen(); - wxCheckSetPen(dc, wxPen(attr.GetTextColour(), 1)); - dc.DrawLine(x, (int) (y+(h/2)+0.5), x+w, (int) (y+(h/2)+0.5)); - wxCheckSetPen(dc, oldPen); - } - - x = nextTabPos; - } - } - hasTabs = (str.Find(wxT('\t')) != wxNOT_FOUND); - } - - if (!str.IsEmpty()) - { - dc.GetTextExtent(str, & w, & h); - if (selected) - { - wxRect selRect(x, rect.y, w, rect.GetHeight()); - dc.DrawRectangle(selRect); - } - dc.DrawText(str, x, y); - - if (attr.HasTextEffects() && (attr.GetTextEffects() & wxTEXT_ATTR_EFFECT_STRIKETHROUGH)) - { - wxPen oldPen = dc.GetPen(); - wxCheckSetPen(dc, wxPen(attr.GetTextColour(), 1)); - dc.DrawLine(x, (int) (y+(h/2)+0.5), x+w, (int) (y+(h/2)+0.5)); - wxCheckSetPen(dc, oldPen); - } - - x += w; - } - return true; - -} - -/// Lay the item out -bool wxRichTextPlainText::Layout(wxDC& dc, const wxRect& WXUNUSED(rect), int WXUNUSED(style)) -{ - // Only lay out if we haven't already cached the size - if (m_size.x == -1) - GetRangeSize(GetRange(), m_size, m_descent, dc, 0, GetParent() ? GetParent()->GetPosition() : wxPoint(0, 0)); - - return true; -} - -/// Copy -void wxRichTextPlainText::Copy(const wxRichTextPlainText& obj) -{ - wxRichTextObject::Copy(obj); - - m_text = obj.m_text; -} - -/// Get/set the object size for the given range. Returns false if the range -/// is invalid for this object. -bool wxRichTextPlainText::GetRangeSize(const wxRichTextRange& range, wxSize& size, int& descent, wxDC& dc, int WXUNUSED(flags), wxPoint position) const -{ - if (!range.IsWithin(GetRange())) - return false; - - wxRichTextParagraph* para = wxDynamicCast(GetParent(), wxRichTextParagraph); - wxASSERT (para != NULL); - - int relativeX = position.x - GetParent()->GetPosition().x; - - wxTextAttrEx textAttr(para ? para->GetCombinedAttributes(GetAttributes()) : GetAttributes()); - - // Always assume unformatted text, since at this level we have no knowledge - // of line breaks - and we don't need it, since we'll calculate size within - // formatted text by doing it in chunks according to the line ranges - - bool bScript(false); - wxFont font(textAttr.GetFont()); - if (font.Ok()) - { - if ( textAttr.HasTextEffects() && ( (textAttr.GetTextEffects() & wxTEXT_ATTR_EFFECT_SUPERSCRIPT) - || (textAttr.GetTextEffects() & wxTEXT_ATTR_EFFECT_SUBSCRIPT) ) ) - { - wxFont textFont = font; - double size = static_cast(textFont.GetPointSize()) / wxSCRIPT_MUL_FACTOR; - textFont.SetPointSize( static_cast(size) ); - wxCheckSetFont(dc, textFont); - bScript = true; - } - else - { - wxCheckSetFont(dc, font); - } - } - - int startPos = range.GetStart() - GetRange().GetStart(); - long len = range.GetLength(); - -#if wxRICHTEXT_USE_PARTIAL_TEXT_EXTENTS - wxArrayInt textExtents; -#endif - bool haveDescent = false; - - wxString str(m_text); - wxString toReplace = wxRichTextLineBreakChar; - str.Replace(toReplace, wxT(" ")); - - wxString stringChunk = str.Mid(startPos, (size_t) len); - - if (textAttr.HasTextEffects() && (textAttr.GetTextEffects() & wxTEXT_ATTR_EFFECT_CAPITALS)) - stringChunk.MakeUpper(); - - wxCoord w, h; - int width = 0; - if (stringChunk.Find(wxT('\t')) != wxNOT_FOUND) - { - // the string has a tab - wxArrayInt tabArray; - if (textAttr.GetTabs().IsEmpty()) - tabArray = wxRichTextParagraph::GetDefaultTabs(); - else - tabArray = textAttr.GetTabs(); - - int tabCount = tabArray.GetCount(); - - for (int i = 0; i < tabCount; ++i) - { - int pos = tabArray[i]; - pos = ((wxRichTextPlainText*) this)->ConvertTenthsMMToPixels(dc, pos); - tabArray[i] = pos; - } - - int nextTabPos = -1; - - while (stringChunk.Find(wxT('\t')) >= 0) - { - int absoluteWidth = 0; - - // the string has a tab - // break up the string at the Tab - wxString stringFragment = stringChunk.BeforeFirst(wxT('\t')); - stringChunk = stringChunk.AfterFirst(wxT('\t')); - -#if wxRICHTEXT_USE_PARTIAL_TEXT_EXTENTS - if (g_UseGlobalPartialTextExtents) - { - int oldWidth; - if (textExtents.GetCount() > 0) - oldWidth = textExtents[textExtents.GetCount()-1]; - else - oldWidth = 0; - - // Add these partial extents - wxArrayInt p; - dc.GetPartialTextExtents(stringFragment, p); - size_t j; - for (j = 0; j < p.GetCount(); j++) - textExtents.Add(oldWidth + p[j]); - - if (textExtents.GetCount() > 0) - absoluteWidth = textExtents[textExtents.GetCount()-1] + relativeX; - else - absoluteWidth = relativeX; - } - else -#endif - { - dc.GetTextExtent(stringFragment, & w, & h, & descent); - width += w; - absoluteWidth = width + position.x; - haveDescent = true; - } - - bool notFound = true; - for (int i = 0; i < tabCount && notFound; ++i) - { - nextTabPos = tabArray.Item(i); - - // Find the next tab position. - // Even if we're at the end of the tab array, we must still process the chunk. - - if (nextTabPos > absoluteWidth || (i == (tabCount - 1))) - { - if (nextTabPos <= absoluteWidth) - { - int defaultTabWidth = ((wxRichTextPlainText*) this)->ConvertTenthsMMToPixels(dc, WIDTH_FOR_DEFAULT_TABS); - nextTabPos = absoluteWidth + defaultTabWidth; - } - - notFound = false; - - width = nextTabPos - relativeX; - -#if wxRICHTEXT_USE_PARTIAL_TEXT_EXTENTS - if (g_UseGlobalPartialTextExtents) - textExtents.Add(width); -#endif - } - } - } - } - - if (!stringChunk.IsEmpty()) - { -#if wxRICHTEXT_USE_PARTIAL_TEXT_EXTENTS - if (g_UseGlobalPartialTextExtents) - { - int oldWidth; - if (textExtents.GetCount() > 0) - oldWidth = textExtents[textExtents.GetCount()-1]; - else - oldWidth = 0; - - // Add these partial extents - wxArrayInt p; - dc.GetPartialTextExtents(stringChunk, p); - size_t j; - for (j = 0; j < p.GetCount(); j++) - textExtents.Add(oldWidth + p[j]); - } - else -#endif - { - dc.GetTextExtent(stringChunk, & w, & h, & descent); - width += w; - haveDescent = true; - } - } - -#if wxRICHTEXT_USE_PARTIAL_TEXT_EXTENTS - if (g_UseGlobalPartialTextExtents) - { - // Now add this child's extents to the global extents - int lastExtent = 0; - if (g_GlobalPartialTextExtents.GetCount() > 0) - lastExtent = g_GlobalPartialTextExtents[g_GlobalPartialTextExtents.GetCount()-1]; - - size_t j; - for (j = 0; j < textExtents.GetCount(); j++) - g_GlobalPartialTextExtents.Add(lastExtent + textExtents[j]); - - int charHeight = dc.GetCharHeight(); - if (textExtents.GetCount() > 0) - w = textExtents[textExtents.GetCount()-1]; - else - w = 0; - size = wxSize(w, charHeight); - } - else -#endif - { - size = wxSize(width, dc.GetCharHeight()); - } - - if (!haveDescent) - dc.GetTextExtent(wxT("X"), & w, & h, & descent); - - if ( bScript ) - dc.SetFont(font); - - return true; -} - -/// Do a split, returning an object containing the second part, and setting -/// the first part in 'this'. -wxRichTextObject* wxRichTextPlainText::DoSplit(long pos) -{ - long index = pos - GetRange().GetStart(); - - if (index < 0 || index >= (int) m_text.length()) - return NULL; - - wxString firstPart = m_text.Mid(0, index); - wxString secondPart = m_text.Mid(index); - - m_text = firstPart; - - wxRichTextPlainText* newObject = new wxRichTextPlainText(secondPart); - newObject->SetAttributes(GetAttributes()); - - newObject->SetRange(wxRichTextRange(pos, GetRange().GetEnd())); - GetRange().SetEnd(pos-1); - - return newObject; -} - -/// Calculate range -void wxRichTextPlainText::CalculateRange(long start, long& end) -{ - end = start + m_text.length() - 1; - m_range.SetRange(start, end); -} - -/// Delete range -bool wxRichTextPlainText::DeleteRange(const wxRichTextRange& range) -{ - wxRichTextRange r = range; - - r.LimitTo(GetRange()); - - if (r.GetStart() == GetRange().GetStart() && r.GetEnd() == GetRange().GetEnd()) - { - m_text.Empty(); - return true; - } - - long startIndex = r.GetStart() - GetRange().GetStart(); - long len = r.GetLength(); - - m_text = m_text.Mid(0, startIndex) + m_text.Mid(startIndex+len); - return true; -} - -/// Get text for the given range. -wxString wxRichTextPlainText::GetTextForRange(const wxRichTextRange& range) const -{ - wxRichTextRange r = range; - - r.LimitTo(GetRange()); - - long startIndex = r.GetStart() - GetRange().GetStart(); - long len = r.GetLength(); - - return m_text.Mid(startIndex, len); -} - -/// Returns true if this object can merge itself with the given one. -bool wxRichTextPlainText::CanMerge(wxRichTextObject* object) const -{ - return object->GetClassInfo() == CLASSINFO(wxRichTextPlainText) && - (m_text.empty() || ((GetAttributes().GetFlags() == object->GetAttributes().GetFlags()) && wxTextAttrEqPartial(GetAttributes(), object->GetAttributes(), GetAttributes().GetFlags()))); -} - -/// Returns true if this object merged itself with the given one. -/// The calling code will then delete the given object. -bool wxRichTextPlainText::Merge(wxRichTextObject* object) -{ - wxRichTextPlainText* textObject = wxDynamicCast(object, wxRichTextPlainText); - wxASSERT( textObject != NULL ); - - if (textObject) - { - bool isEmpty = m_text.IsEmpty(); - m_text += textObject->GetText(); - // Don't keep an empty object's attributes - if (isEmpty) - m_attributes = textObject->GetAttributes(); - else - wxRichTextApplyStyle(m_attributes, textObject->GetAttributes()); - return true; - } - else - return false; -} - -/// Dump to output stream for debugging -void wxRichTextPlainText::Dump(wxTextOutputStream& stream) -{ - wxRichTextObject::Dump(stream); - stream << m_text << wxT("\n"); -} - -/// Get the first position from pos that has a line break character. -long wxRichTextPlainText::GetFirstLineBreakPosition(long pos) -{ - int i; - int len = m_text.length(); - int startPos = pos - m_range.GetStart(); - for (i = startPos; i < len; i++) - { - wxChar ch = m_text[i]; - if (ch == wxRichTextLineBreakChar) - { - return i + m_range.GetStart(); - } - } - return -1; -} - -/*! - * wxRichTextBuffer - * This is a kind of box, used to represent the whole buffer - */ - -IMPLEMENT_DYNAMIC_CLASS(wxRichTextBuffer, wxRichTextParagraphLayoutBox) - -wxList wxRichTextBuffer::sm_handlers; -wxRichTextRenderer* wxRichTextBuffer::sm_renderer = NULL; -int wxRichTextBuffer::sm_bulletRightMargin = 20; -float wxRichTextBuffer::sm_bulletProportion = (float) 0.3; - -/// Initialisation -void wxRichTextBuffer::Init() -{ - m_commandProcessor = new wxCommandProcessor; - m_styleSheet = NULL; - m_modified = false; - m_batchedCommandDepth = 0; - m_batchedCommand = NULL; - m_suppressUndo = 0; - m_handlerFlags = 0; - m_scale = 1.0; -} - -/// Initialisation -wxRichTextBuffer::~wxRichTextBuffer() -{ - delete m_commandProcessor; - delete m_batchedCommand; - - ClearStyleStack(); - ClearEventHandlers(); -} - -void wxRichTextBuffer::ResetAndClearCommands() -{ - Reset(); - - GetCommandProcessor()->ClearCommands(); - - Modify(false); - Invalidate(wxRICHTEXT_ALL); -} - -void wxRichTextBuffer::Copy(const wxRichTextBuffer& obj) -{ - wxRichTextParagraphLayoutBox::Copy(obj); - - m_styleSheet = obj.m_styleSheet; - m_modified = obj.m_modified; - m_batchedCommandDepth = obj.m_batchedCommandDepth; - m_batchedCommand = obj.m_batchedCommand; - m_suppressUndo = obj.m_suppressUndo; -} - -/// Push style sheet to top of stack -bool wxRichTextBuffer::PushStyleSheet(wxRichTextStyleSheet* styleSheet) -{ - if (m_styleSheet) - styleSheet->InsertSheet(m_styleSheet); - - SetStyleSheet(styleSheet); - - return true; -} - -/// Pop style sheet from top of stack -wxRichTextStyleSheet* wxRichTextBuffer::PopStyleSheet() -{ - if (m_styleSheet) - { - wxRichTextStyleSheet* oldSheet = m_styleSheet; - m_styleSheet = oldSheet->GetNextSheet(); - oldSheet->Unlink(); - - return oldSheet; - } - else - return NULL; -} - -/// Submit command to insert paragraphs -bool wxRichTextBuffer::InsertParagraphsWithUndo(long pos, const wxRichTextParagraphLayoutBox& paragraphs, wxRichTextCtrl* ctrl, int WXUNUSED(flags)) -{ - wxRichTextAction* action = new wxRichTextAction(NULL, _("Insert Text"), wxRICHTEXT_INSERT, this, ctrl, false); - - action->GetNewParagraphs() = paragraphs; - - action->SetPosition(pos); - - wxRichTextRange range = wxRichTextRange(pos, pos + paragraphs.GetRange().GetEnd() - 1); - if (!paragraphs.GetPartialParagraph()) - range.SetEnd(range.GetEnd()+1); - - // Set the range we'll need to delete in Undo - action->SetRange(range); - - SubmitAction(action); - - return true; -} - -/// Submit command to insert the given text -bool wxRichTextBuffer::InsertTextWithUndo(long pos, const wxString& text, wxRichTextCtrl* ctrl, int flags) -{ - wxRichTextAction* action = new wxRichTextAction(NULL, _("Insert Text"), wxRICHTEXT_INSERT, this, ctrl, false); - - wxTextAttrEx* p = NULL; - wxTextAttrEx paraAttr; - if (flags & wxRICHTEXT_INSERT_WITH_PREVIOUS_PARAGRAPH_STYLE) - { - // Get appropriate paragraph style - paraAttr = GetStyleForNewParagraph(pos, false, false); - if (!paraAttr.IsDefault()) - p = & paraAttr; - } - - action->GetNewParagraphs().AddParagraphs(text, p); - - int length = action->GetNewParagraphs().GetRange().GetLength(); - - if (text.length() > 0 && text.Last() != wxT('\n')) - { - // Don't count the newline when undoing - length --; - action->GetNewParagraphs().SetPartialParagraph(true); - } - else if (text.length() > 0 && text.Last() == wxT('\n')) - length --; - - action->SetPosition(pos); - - // Set the range we'll need to delete in Undo - action->SetRange(wxRichTextRange(pos, pos + length - 1)); - - SubmitAction(action); - - return true; -} - -/// Submit command to insert the given text -bool wxRichTextBuffer::InsertNewlineWithUndo(long pos, wxRichTextCtrl* ctrl, int flags) -{ - wxRichTextAction* action = new wxRichTextAction(NULL, _("Insert Text"), wxRICHTEXT_INSERT, this, ctrl, false); - - wxTextAttrEx* p = NULL; - wxTextAttrEx paraAttr; - if (flags & wxRICHTEXT_INSERT_WITH_PREVIOUS_PARAGRAPH_STYLE) - { - paraAttr = GetStyleForNewParagraph(pos, false, true /* look for next paragraph style */); - if (!paraAttr.IsDefault()) - p = & paraAttr; - } - - wxTextAttrEx attr(GetDefaultStyle()); - - wxRichTextParagraph* newPara = new wxRichTextParagraph(wxEmptyString, this, & attr); - action->GetNewParagraphs().AppendChild(newPara); - action->GetNewParagraphs().UpdateRanges(); - action->GetNewParagraphs().SetPartialParagraph(false); - wxRichTextParagraph* para = GetParagraphAtPosition(pos, false); - long pos1 = pos; - - if (p) - newPara->SetAttributes(*p); - - if (flags & wxRICHTEXT_INSERT_INTERACTIVE) - { - if (para && para->GetRange().GetEnd() == pos) - pos1 ++; - - // Now see if we need to number the paragraph. - if (newPara->GetAttributes().HasBulletNumber()) - { - wxRichTextAttr numberingAttr; - if (FindNextParagraphNumber(para, numberingAttr)) - wxRichTextApplyStyle(newPara->GetAttributes(), (const wxRichTextAttr&) numberingAttr); - } - } - - action->SetPosition(pos); - - // Use the default character style - if (!GetDefaultStyle().IsDefault() && newPara->GetChildren().GetFirst()) - { - // Check whether the default style merely reflects the paragraph/basic style, - // in which case don't apply it. - wxTextAttrEx defaultStyle(GetDefaultStyle()); - wxTextAttrEx toApply; - if (para) - { - wxRichTextAttr combinedAttr = para->GetCombinedAttributes(); - wxTextAttrEx newAttr; - // This filters out attributes that are accounted for by the current - // paragraph/basic style - wxRichTextApplyStyle(toApply, defaultStyle, & combinedAttr); - } - else - toApply = defaultStyle; - - if (!toApply.IsDefault()) - newPara->GetChildren().GetFirst()->GetData()->SetAttributes(toApply); - } - - // Set the range we'll need to delete in Undo - action->SetRange(wxRichTextRange(pos1, pos1)); - - SubmitAction(action); - - return true; -} - -/// Submit command to insert the given image -bool wxRichTextBuffer::InsertImageWithUndo(long pos, const wxRichTextImageBlock& imageBlock, wxRichTextCtrl* ctrl, int flags) -{ - wxRichTextAction* action = new wxRichTextAction(NULL, _("Insert Image"), wxRICHTEXT_INSERT, this, ctrl, false); - - wxTextAttrEx* p = NULL; - wxTextAttrEx paraAttr; - if (flags & wxRICHTEXT_INSERT_WITH_PREVIOUS_PARAGRAPH_STYLE) - { - paraAttr = GetStyleForNewParagraph(pos); - if (!paraAttr.IsDefault()) - p = & paraAttr; - } - - wxTextAttrEx attr(GetDefaultStyle()); - - wxRichTextParagraph* newPara = new wxRichTextParagraph(this, & attr); - if (p) - newPara->SetAttributes(*p); - - wxRichTextImage* imageObject = new wxRichTextImage(imageBlock, newPara); - newPara->AppendChild(imageObject); - action->GetNewParagraphs().AppendChild(newPara); - action->GetNewParagraphs().UpdateRanges(); - - action->GetNewParagraphs().SetPartialParagraph(true); - - action->SetPosition(pos); - - // Set the range we'll need to delete in Undo - action->SetRange(wxRichTextRange(pos, pos)); - - SubmitAction(action); - - return true; -} - -/// Get the style that is appropriate for a new paragraph at this position. -/// If the previous paragraph has a paragraph style name, look up the next-paragraph -/// style. -wxRichTextAttr wxRichTextBuffer::GetStyleForNewParagraph(long pos, bool caretPosition, bool lookUpNewParaStyle) const -{ - wxRichTextParagraph* para = GetParagraphAtPosition(pos, caretPosition); - if (para) - { - wxRichTextAttr attr; - bool foundAttributes = false; - - // Look for a matching paragraph style - if (lookUpNewParaStyle && !para->GetAttributes().GetParagraphStyleName().IsEmpty() && GetStyleSheet()) - { - wxRichTextParagraphStyleDefinition* paraDef = GetStyleSheet()->FindParagraphStyle(para->GetAttributes().GetParagraphStyleName()); - if (paraDef) - { - // If we're not at the end of the paragraph, then we apply THIS style, and not the designated next style. - if (para->GetRange().GetEnd() == pos && !paraDef->GetNextStyle().IsEmpty()) - { - wxRichTextParagraphStyleDefinition* nextParaDef = GetStyleSheet()->FindParagraphStyle(paraDef->GetNextStyle()); - if (nextParaDef) - { - foundAttributes = true; - attr = nextParaDef->GetStyleMergedWithBase(GetStyleSheet()); - } - } - - // If we didn't find the 'next style', use this style instead. - if (!foundAttributes) - { - foundAttributes = true; - attr = paraDef->GetStyleMergedWithBase(GetStyleSheet()); - } - } - } - - // Also apply list style if present - if (lookUpNewParaStyle && !para->GetAttributes().GetListStyleName().IsEmpty() && GetStyleSheet()) - { - wxRichTextListStyleDefinition* listDef = GetStyleSheet()->FindListStyle(para->GetAttributes().GetListStyleName()); - if (listDef) - { - int thisIndent = para->GetAttributes().GetLeftIndent(); - int thisLevel = para->GetAttributes().HasOutlineLevel() ? para->GetAttributes().GetOutlineLevel() : listDef->FindLevelForIndent(thisIndent); - - // Apply the overall list style, and item style for this level - wxTextAttrEx listStyle(listDef->GetCombinedStyleForLevel(thisLevel, GetStyleSheet())); - wxRichTextApplyStyle(attr, listStyle); - attr.SetOutlineLevel(thisLevel); - if (para->GetAttributes().HasBulletNumber()) - attr.SetBulletNumber(para->GetAttributes().GetBulletNumber()); - } - } - - if (!foundAttributes) - { - attr = para->GetAttributes(); - int flags = attr.GetFlags(); - - // Eliminate character styles - flags &= ( (~ wxTEXT_ATTR_FONT) | - (~ wxTEXT_ATTR_TEXT_COLOUR) | - (~ wxTEXT_ATTR_BACKGROUND_COLOUR) ); - attr.SetFlags(flags); - } - - return attr; - } - else - return wxRichTextAttr(); -} - -/// Submit command to delete this range -bool wxRichTextBuffer::DeleteRangeWithUndo(const wxRichTextRange& range, wxRichTextCtrl* ctrl) -{ - wxRichTextAction* action = new wxRichTextAction(NULL, _("Delete"), wxRICHTEXT_DELETE, this, ctrl); - - action->SetPosition(ctrl->GetCaretPosition()); - - // Set the range to delete - action->SetRange(range); - - // Copy the fragment that we'll need to restore in Undo - CopyFragment(range, action->GetOldParagraphs()); - - // See if we're deleting a paragraph marker, in which case we need to - // make a note not to copy the attributes from the 2nd paragraph to the 1st. - if (range.GetStart() == range.GetEnd()) - { - wxRichTextParagraph* para = GetParagraphAtPosition(range.GetStart()); - if (para && para->GetRange().GetEnd() == range.GetEnd()) - { - wxRichTextParagraph* nextPara = GetParagraphAtPosition(range.GetStart()+1); - if (nextPara && nextPara != para) - { - action->GetOldParagraphs().GetChildren().GetFirst()->GetData()->SetAttributes(nextPara->GetAttributes()); - action->GetOldParagraphs().GetAttributes().SetFlags(action->GetOldParagraphs().GetAttributes().GetFlags() | wxTEXT_ATTR_KEEP_FIRST_PARA_STYLE); - } - } - } - - SubmitAction(action); - - return true; -} - -/// Collapse undo/redo commands -bool wxRichTextBuffer::BeginBatchUndo(const wxString& cmdName) -{ - if (m_batchedCommandDepth == 0) - { - wxASSERT(m_batchedCommand == NULL); - if (m_batchedCommand) - { - GetCommandProcessor()->Store(m_batchedCommand); - } - m_batchedCommand = new wxRichTextCommand(cmdName); - } - - m_batchedCommandDepth ++; - - return true; -} - -/// Collapse undo/redo commands -bool wxRichTextBuffer::EndBatchUndo() -{ - m_batchedCommandDepth --; - - wxASSERT(m_batchedCommandDepth >= 0); - wxASSERT(m_batchedCommand != NULL); - - if (m_batchedCommandDepth == 0) - { - GetCommandProcessor()->Store(m_batchedCommand); - m_batchedCommand = NULL; - } - - return true; -} - -/// Submit immediately, or delay according to whether collapsing is on -bool wxRichTextBuffer::SubmitAction(wxRichTextAction* action) -{ - if (BatchingUndo() && m_batchedCommand && !SuppressingUndo()) - { - wxRichTextCommand* cmd = new wxRichTextCommand(action->GetName()); - cmd->AddAction(action); - cmd->Do(); - cmd->GetActions().Clear(); - delete cmd; - - m_batchedCommand->AddAction(action); - } - else - { - wxRichTextCommand* cmd = new wxRichTextCommand(action->GetName()); - cmd->AddAction(action); - - // Only store it if we're not suppressing undo. - return GetCommandProcessor()->Submit(cmd, !SuppressingUndo()); - } - - return true; -} - -/// Begin suppressing undo/redo commands. -bool wxRichTextBuffer::BeginSuppressUndo() -{ - m_suppressUndo ++; - - return true; -} - -/// End suppressing undo/redo commands. -bool wxRichTextBuffer::EndSuppressUndo() -{ - m_suppressUndo --; - - return true; -} - -/// Begin using a style -bool wxRichTextBuffer::BeginStyle(const wxTextAttrEx& style) -{ - wxTextAttrEx newStyle(GetDefaultStyle()); - - // Save the old default style - m_attributeStack.Append((wxObject*) new wxTextAttrEx(GetDefaultStyle())); - - wxRichTextApplyStyle(newStyle, style); - newStyle.SetFlags(style.GetFlags()|newStyle.GetFlags()); - - SetDefaultStyle(newStyle); - - return true; -} - -/// End the style -bool wxRichTextBuffer::EndStyle() -{ - if (!m_attributeStack.GetFirst()) - { - wxLogDebug(_("Too many EndStyle calls!")); - return false; - } - - wxList::compatibility_iterator node = m_attributeStack.GetLast(); - wxTextAttrEx* attr = (wxTextAttrEx*)node->GetData(); - m_attributeStack.Erase(node); - - SetDefaultStyle(*attr); - - delete attr; - return true; -} - -/// End all styles -bool wxRichTextBuffer::EndAllStyles() -{ - while (m_attributeStack.GetCount() != 0) - EndStyle(); - return true; -} - -/// Clear the style stack -void wxRichTextBuffer::ClearStyleStack() -{ - for (wxList::compatibility_iterator node = m_attributeStack.GetFirst(); node; node = node->GetNext()) - delete (wxTextAttrEx*) node->GetData(); - m_attributeStack.Clear(); -} - -/// Begin using bold -bool wxRichTextBuffer::BeginBold() -{ - wxFont font(GetBasicStyle().GetFont()); - font.SetWeight(wxBOLD); - - wxTextAttrEx attr; - attr.SetFont(font,wxTEXT_ATTR_FONT_WEIGHT); - - return BeginStyle(attr); -} - -/// Begin using italic -bool wxRichTextBuffer::BeginItalic() -{ - wxFont font(GetBasicStyle().GetFont()); - font.SetStyle(wxITALIC); - - wxTextAttrEx attr; - attr.SetFont(font, wxTEXT_ATTR_FONT_ITALIC); - - return BeginStyle(attr); -} - -/// Begin using underline -bool wxRichTextBuffer::BeginUnderline() -{ - wxFont font(GetBasicStyle().GetFont()); - font.SetUnderlined(true); - - wxTextAttrEx attr; - attr.SetFont(font, wxTEXT_ATTR_FONT_UNDERLINE); - - return BeginStyle(attr); -} - -/// Begin using point size -bool wxRichTextBuffer::BeginFontSize(int pointSize) -{ - wxFont font(GetBasicStyle().GetFont()); - font.SetPointSize(pointSize); - - wxTextAttrEx attr; - attr.SetFont(font, wxTEXT_ATTR_FONT_SIZE); - - return BeginStyle(attr); -} - -/// Begin using this font -bool wxRichTextBuffer::BeginFont(const wxFont& font) -{ - wxTextAttrEx attr; - attr.SetFlags(wxTEXT_ATTR_FONT); - attr.SetFont(font); - - return BeginStyle(attr); -} - -/// Begin using this colour -bool wxRichTextBuffer::BeginTextColour(const wxColour& colour) -{ - wxTextAttrEx attr; - attr.SetFlags(wxTEXT_ATTR_TEXT_COLOUR); - attr.SetTextColour(colour); - - return BeginStyle(attr); -} - -/// Begin using alignment -bool wxRichTextBuffer::BeginAlignment(wxTextAttrAlignment alignment) -{ - wxTextAttrEx attr; - attr.SetFlags(wxTEXT_ATTR_ALIGNMENT); - attr.SetAlignment(alignment); - - return BeginStyle(attr); -} - -/// Begin left indent -bool wxRichTextBuffer::BeginLeftIndent(int leftIndent, int leftSubIndent) -{ - wxTextAttrEx attr; - attr.SetFlags(wxTEXT_ATTR_LEFT_INDENT); - attr.SetLeftIndent(leftIndent, leftSubIndent); - - return BeginStyle(attr); -} - -/// Begin right indent -bool wxRichTextBuffer::BeginRightIndent(int rightIndent) -{ - wxTextAttrEx attr; - attr.SetFlags(wxTEXT_ATTR_RIGHT_INDENT); - attr.SetRightIndent(rightIndent); - - return BeginStyle(attr); -} - -/// Begin paragraph spacing -bool wxRichTextBuffer::BeginParagraphSpacing(int before, int after) -{ - long flags = 0; - if (before != 0) - flags |= wxTEXT_ATTR_PARA_SPACING_BEFORE; - if (after != 0) - flags |= wxTEXT_ATTR_PARA_SPACING_AFTER; - - wxTextAttrEx attr; - attr.SetFlags(flags); - attr.SetParagraphSpacingBefore(before); - attr.SetParagraphSpacingAfter(after); - - return BeginStyle(attr); -} - -/// Begin line spacing -bool wxRichTextBuffer::BeginLineSpacing(int lineSpacing) -{ - wxTextAttrEx attr; - attr.SetFlags(wxTEXT_ATTR_LINE_SPACING); - attr.SetLineSpacing(lineSpacing); - - return BeginStyle(attr); -} - -/// Begin numbered bullet -bool wxRichTextBuffer::BeginNumberedBullet(int bulletNumber, int leftIndent, int leftSubIndent, int bulletStyle) -{ - wxTextAttrEx attr; - attr.SetFlags(wxTEXT_ATTR_BULLET_STYLE|wxTEXT_ATTR_LEFT_INDENT); - attr.SetBulletStyle(bulletStyle); - attr.SetBulletNumber(bulletNumber); - attr.SetLeftIndent(leftIndent, leftSubIndent); - - return BeginStyle(attr); -} - -/// Begin symbol bullet -bool wxRichTextBuffer::BeginSymbolBullet(const wxString& symbol, int leftIndent, int leftSubIndent, int bulletStyle) -{ - wxTextAttrEx attr; - attr.SetFlags(wxTEXT_ATTR_BULLET_STYLE|wxTEXT_ATTR_LEFT_INDENT); - attr.SetBulletStyle(bulletStyle); - attr.SetLeftIndent(leftIndent, leftSubIndent); - attr.SetBulletText(symbol); - - return BeginStyle(attr); -} - -/// Begin standard bullet -bool wxRichTextBuffer::BeginStandardBullet(const wxString& bulletName, int leftIndent, int leftSubIndent, int bulletStyle) -{ - wxTextAttrEx attr; - attr.SetFlags(wxTEXT_ATTR_BULLET_STYLE|wxTEXT_ATTR_LEFT_INDENT); - attr.SetBulletStyle(bulletStyle); - attr.SetLeftIndent(leftIndent, leftSubIndent); - attr.SetBulletName(bulletName); - - return BeginStyle(attr); -} - -/// Begin named character style -bool wxRichTextBuffer::BeginCharacterStyle(const wxString& characterStyle) -{ - if (GetStyleSheet()) - { - wxRichTextCharacterStyleDefinition* def = GetStyleSheet()->FindCharacterStyle(characterStyle); - if (def) - { - wxTextAttrEx attr = def->GetStyleMergedWithBase(GetStyleSheet()); - return BeginStyle(attr); - } - } - return false; -} - -/// Begin named paragraph style -bool wxRichTextBuffer::BeginParagraphStyle(const wxString& paragraphStyle) -{ - if (GetStyleSheet()) - { - wxRichTextParagraphStyleDefinition* def = GetStyleSheet()->FindParagraphStyle(paragraphStyle); - if (def) - { - wxTextAttrEx attr = def->GetStyleMergedWithBase(GetStyleSheet()); - return BeginStyle(attr); - } - } - return false; -} - -/// Begin named list style -bool wxRichTextBuffer::BeginListStyle(const wxString& listStyle, int level, int number) -{ - if (GetStyleSheet()) - { - wxRichTextListStyleDefinition* def = GetStyleSheet()->FindListStyle(listStyle); - if (def) - { - wxTextAttrEx attr(def->GetCombinedStyleForLevel(level)); - - attr.SetBulletNumber(number); - - return BeginStyle(attr); - } - } - return false; -} - -/// Begin URL -bool wxRichTextBuffer::BeginURL(const wxString& url, const wxString& characterStyle) -{ - wxTextAttrEx attr; - - if (!characterStyle.IsEmpty() && GetStyleSheet()) - { - wxRichTextCharacterStyleDefinition* def = GetStyleSheet()->FindCharacterStyle(characterStyle); - if (def) - { - attr = def->GetStyleMergedWithBase(GetStyleSheet()); - } - } - attr.SetURL(url); - - return BeginStyle(attr); -} - -/// Adds a handler to the end -void wxRichTextBuffer::AddHandler(wxRichTextFileHandler *handler) -{ - sm_handlers.Append(handler); -} - -/// Inserts a handler at the front -void wxRichTextBuffer::InsertHandler(wxRichTextFileHandler *handler) -{ - sm_handlers.Insert( handler ); -} - -/// Removes a handler -bool wxRichTextBuffer::RemoveHandler(const wxString& name) -{ - wxRichTextFileHandler *handler = FindHandler(name); - if (handler) - { - sm_handlers.DeleteObject(handler); - delete handler; - return true; - } - else - return false; -} - -/// Finds a handler by filename or, if supplied, type -wxRichTextFileHandler *wxRichTextBuffer::FindHandlerFilenameOrType(const wxString& filename, int imageType) -{ - if (imageType != wxRICHTEXT_TYPE_ANY) - return FindHandler(imageType); - else if (!filename.IsEmpty()) - { - wxString path, file, ext; - wxSplitPath(filename, & path, & file, & ext); - return FindHandler(ext, imageType); - } - else - return NULL; -} - - -/// Finds a handler by name -wxRichTextFileHandler* wxRichTextBuffer::FindHandler(const wxString& name) -{ - wxList::compatibility_iterator node = sm_handlers.GetFirst(); - while (node) - { - wxRichTextFileHandler *handler = (wxRichTextFileHandler*)node->GetData(); - if (handler->GetName().Lower() == name.Lower()) return handler; - - node = node->GetNext(); - } - return NULL; -} - -/// Finds a handler by extension and type -wxRichTextFileHandler* wxRichTextBuffer::FindHandler(const wxString& extension, int type) -{ - wxList::compatibility_iterator node = sm_handlers.GetFirst(); - while (node) - { - wxRichTextFileHandler *handler = (wxRichTextFileHandler*)node->GetData(); - if ( handler->GetExtension().Lower() == extension.Lower() && - (type == wxRICHTEXT_TYPE_ANY || handler->GetType() == type) ) - return handler; - node = node->GetNext(); - } - return 0; -} - -/// Finds a handler by type -wxRichTextFileHandler* wxRichTextBuffer::FindHandler(int type) -{ - wxList::compatibility_iterator node = sm_handlers.GetFirst(); - while (node) - { - wxRichTextFileHandler *handler = (wxRichTextFileHandler *)node->GetData(); - if (handler->GetType() == type) return handler; - node = node->GetNext(); - } - return NULL; -} - -void wxRichTextBuffer::InitStandardHandlers() -{ - if (!FindHandler(wxRICHTEXT_TYPE_TEXT)) - AddHandler(new wxRichTextPlainTextHandler); -} - -void wxRichTextBuffer::CleanUpHandlers() -{ - wxList::compatibility_iterator node = sm_handlers.GetFirst(); - while (node) - { - wxRichTextFileHandler* handler = (wxRichTextFileHandler*)node->GetData(); - wxList::compatibility_iterator next = node->GetNext(); - delete handler; - node = next; - } - - sm_handlers.Clear(); -} - -wxString wxRichTextBuffer::GetExtWildcard(bool combine, bool save, wxArrayInt* types) -{ - if (types) - types->Clear(); - - wxString wildcard; - - wxList::compatibility_iterator node = GetHandlers().GetFirst(); - int count = 0; - while (node) - { - wxRichTextFileHandler* handler = (wxRichTextFileHandler*) node->GetData(); - if (handler->IsVisible() && ((save && handler->CanSave()) || (!save && handler->CanLoad()))) - { - if (combine) - { - if (count > 0) - wildcard += wxT(";"); - wildcard += wxT("*.") + handler->GetExtension(); - } - else - { - if (count > 0) - wildcard += wxT("|"); - wildcard += handler->GetName(); - wildcard += wxT(" "); - wildcard += _("files"); - wildcard += wxT(" (*."); - wildcard += handler->GetExtension(); - wildcard += wxT(")|*."); - wildcard += handler->GetExtension(); - if (types) - types->Add(handler->GetType()); - } - count ++; - } - - node = node->GetNext(); - } - - if (combine) - wildcard = wxT("(") + wildcard + wxT(")|") + wildcard; - return wildcard; -} - -/// Load a file -bool wxRichTextBuffer::LoadFile(const wxString& filename, int type) -{ - wxRichTextFileHandler* handler = FindHandlerFilenameOrType(filename, type); - if (handler) - { - SetDefaultStyle(wxTextAttrEx()); - handler->SetFlags(GetHandlerFlags()); - bool success = handler->LoadFile(this, filename); - Invalidate(wxRICHTEXT_ALL); - return success; - } - else - return false; -} - -/// Save a file -bool wxRichTextBuffer::SaveFile(const wxString& filename, int type) -{ - wxRichTextFileHandler* handler = FindHandlerFilenameOrType(filename, type); - if (handler) - { - handler->SetFlags(GetHandlerFlags()); - return handler->SaveFile(this, filename); - } - else - return false; -} - -/// Load from a stream -bool wxRichTextBuffer::LoadFile(wxInputStream& stream, int type) -{ - wxRichTextFileHandler* handler = FindHandler(type); - if (handler) - { - SetDefaultStyle(wxTextAttrEx()); - handler->SetFlags(GetHandlerFlags()); - bool success = handler->LoadFile(this, stream); - Invalidate(wxRICHTEXT_ALL); - return success; - } - else - return false; -} - -/// Save to a stream -bool wxRichTextBuffer::SaveFile(wxOutputStream& stream, int type) -{ - wxRichTextFileHandler* handler = FindHandler(type); - if (handler) - { - handler->SetFlags(GetHandlerFlags()); - return handler->SaveFile(this, stream); - } - else - return false; -} - -/// Copy the range to the clipboard -bool wxRichTextBuffer::CopyToClipboard(const wxRichTextRange& range) -{ - bool success = false; -#if wxUSE_CLIPBOARD && wxUSE_DATAOBJ - - if (!wxTheClipboard->IsOpened() && wxTheClipboard->Open()) - { - wxTheClipboard->Clear(); - - // Add composite object - - wxDataObjectComposite* compositeObject = new wxDataObjectComposite(); - - { - wxString text = GetTextForRange(range); - -#ifdef __WXMSW__ - text = wxTextFile::Translate(text, wxTextFileType_Dos); -#endif - - compositeObject->Add(new wxTextDataObject(text), false /* not preferred */); - } - - // Add rich text buffer data object. This needs the XML handler to be present. - - if (FindHandler(wxRICHTEXT_TYPE_XML)) - { - wxRichTextBuffer* richTextBuf = new wxRichTextBuffer; - CopyFragment(range, *richTextBuf); - - compositeObject->Add(new wxRichTextBufferDataObject(richTextBuf), true /* preferred */); - } - - if (wxTheClipboard->SetData(compositeObject)) - success = true; - - wxTheClipboard->Close(); - } - -#else - wxUnusedVar(range); -#endif - return success; -} - -/// Paste the clipboard content to the buffer -bool wxRichTextBuffer::PasteFromClipboard(long position) -{ - bool success = false; -#if wxUSE_CLIPBOARD && wxUSE_DATAOBJ - if (CanPasteFromClipboard()) - { - if (wxTheClipboard->Open()) - { - if (wxTheClipboard->IsSupported(wxDataFormat(wxRichTextBufferDataObject::GetRichTextBufferFormatId()))) - { - wxRichTextBufferDataObject data; - wxTheClipboard->GetData(data); - wxRichTextBuffer* richTextBuffer = data.GetRichTextBuffer(); - if (richTextBuffer) - { - InsertParagraphsWithUndo(position+1, *richTextBuffer, GetRichTextCtrl(), 0); - if (GetRichTextCtrl()) - GetRichTextCtrl()->ShowPosition(position + richTextBuffer->GetRange().GetEnd()); - delete richTextBuffer; - } - } - else if (wxTheClipboard->IsSupported(wxDF_TEXT) || wxTheClipboard->IsSupported(wxDF_UNICODETEXT)) - { - wxTextDataObject data; - wxTheClipboard->GetData(data); - wxString text(data.GetText()); -#ifdef __WXMSW__ - wxString text2; - text2.Alloc(text.Length()+1); - size_t i; - for (i = 0; i < text.Length(); i++) - { - wxChar ch = text[i]; - if (ch != wxT('\r')) - text2 += ch; - } -#else - wxString text2 = text; -#endif - InsertTextWithUndo(position+1, text2, GetRichTextCtrl(), wxRICHTEXT_INSERT_WITH_PREVIOUS_PARAGRAPH_STYLE); - - if (GetRichTextCtrl()) - GetRichTextCtrl()->ShowPosition(position + text2.Length()); - - success = true; - } - else if (wxTheClipboard->IsSupported(wxDF_BITMAP)) - { - wxBitmapDataObject data; - wxTheClipboard->GetData(data); - wxBitmap bitmap(data.GetBitmap()); - wxImage image(bitmap.ConvertToImage()); - - wxRichTextAction* action = new wxRichTextAction(NULL, _("Insert Image"), wxRICHTEXT_INSERT, this, GetRichTextCtrl(), false); - - action->GetNewParagraphs().AddImage(image); - - if (action->GetNewParagraphs().GetChildCount() == 1) - action->GetNewParagraphs().SetPartialParagraph(true); - - action->SetPosition(position+1); - - // Set the range we'll need to delete in Undo - action->SetRange(wxRichTextRange(position+1, position+1)); - - SubmitAction(action); - - success = true; - } - wxTheClipboard->Close(); - } - } -#else - wxUnusedVar(position); -#endif - return success; -} - -/// Can we paste from the clipboard? -bool wxRichTextBuffer::CanPasteFromClipboard() const -{ - bool canPaste = false; -#if wxUSE_CLIPBOARD && wxUSE_DATAOBJ - if (!wxTheClipboard->IsOpened() && wxTheClipboard->Open()) - { - if (wxTheClipboard->IsSupported(wxDF_TEXT) || wxTheClipboard->IsSupported(wxDF_UNICODETEXT) || - wxTheClipboard->IsSupported(wxDataFormat(wxRichTextBufferDataObject::GetRichTextBufferFormatId())) || - wxTheClipboard->IsSupported(wxDF_BITMAP)) - { - canPaste = true; - } - wxTheClipboard->Close(); - } -#endif - return canPaste; -} - -/// Dumps contents of buffer for debugging purposes -void wxRichTextBuffer::Dump() -{ - wxString text; - { - wxStringOutputStream stream(& text); - wxTextOutputStream textStream(stream); - Dump(textStream); - } - - wxLogDebug(text); -} - -/// Add an event handler -bool wxRichTextBuffer::AddEventHandler(wxEvtHandler* handler) -{ - m_eventHandlers.Append(handler); - return true; -} - -/// Remove an event handler -bool wxRichTextBuffer::RemoveEventHandler(wxEvtHandler* handler, bool deleteHandler) -{ - wxList::compatibility_iterator node = m_eventHandlers.Find(handler); - if (node) - { - m_eventHandlers.Erase(node); - if (deleteHandler) - delete handler; - - return true; - } - else - return false; -} - -/// Clear event handlers -void wxRichTextBuffer::ClearEventHandlers() -{ - m_eventHandlers.Clear(); -} - -/// Send event to event handlers. If sendToAll is true, will send to all event handlers, -/// otherwise will stop at the first successful one. -bool wxRichTextBuffer::SendEvent(wxEvent& event, bool sendToAll) -{ - bool success = false; - for (wxList::compatibility_iterator node = m_eventHandlers.GetFirst(); node; node = node->GetNext()) - { - wxEvtHandler* handler = (wxEvtHandler*) node->GetData(); - if (handler->ProcessEvent(event)) - { - success = true; - if (!sendToAll) - return true; - } - } - return success; -} - -/// Set style sheet and notify of the change -bool wxRichTextBuffer::SetStyleSheetAndNotify(wxRichTextStyleSheet* sheet) -{ - wxRichTextStyleSheet* oldSheet = GetStyleSheet(); - - wxWindowID id = wxID_ANY; - if (GetRichTextCtrl()) - id = GetRichTextCtrl()->GetId(); - - wxRichTextEvent event(wxEVT_COMMAND_RICHTEXT_STYLESHEET_REPLACING, id); - event.SetEventObject(GetRichTextCtrl()); - event.SetOldStyleSheet(oldSheet); - event.SetNewStyleSheet(sheet); - event.Allow(); - - if (SendEvent(event) && !event.IsAllowed()) - { - if (sheet != oldSheet) - delete sheet; - - return false; - } - - if (oldSheet && oldSheet != sheet) - delete oldSheet; - - SetStyleSheet(sheet); - - event.SetEventType(wxEVT_COMMAND_RICHTEXT_STYLESHEET_REPLACED); - event.SetOldStyleSheet(NULL); - event.Allow(); - - return SendEvent(event); -} - -/// Set renderer, deleting old one -void wxRichTextBuffer::SetRenderer(wxRichTextRenderer* renderer) -{ - if (sm_renderer) - delete sm_renderer; - sm_renderer = renderer; -} - -bool wxRichTextStdRenderer::DrawStandardBullet(wxRichTextParagraph* paragraph, wxDC& dc, const wxTextAttrEx& bulletAttr, const wxRect& rect) -{ - if (bulletAttr.GetTextColour().Ok()) - { - wxCheckSetPen(dc, wxPen(bulletAttr.GetTextColour())); - wxCheckSetBrush(dc, wxBrush(bulletAttr.GetTextColour())); - } - else - { - wxCheckSetPen(dc, *wxBLACK_PEN); - wxCheckSetBrush(dc, *wxBLACK_BRUSH); - } - - wxFont font; - if (bulletAttr.GetFont().Ok()) - font = bulletAttr.GetFont(); - else - font = (*wxNORMAL_FONT); - - wxCheckSetFont(dc, font); - - int charHeight = dc.GetCharHeight(); - - int bulletWidth = (int) (((float) charHeight) * wxRichTextBuffer::GetBulletProportion()); - int bulletHeight = bulletWidth; - - int x = rect.x; - - // Calculate the top position of the character (as opposed to the whole line height) - int y = rect.y + (rect.height - charHeight); - - // Calculate where the bullet should be positioned - y = y + (charHeight+1)/2 - (bulletHeight+1)/2; - - // The margin between a bullet and text. - int margin = paragraph->ConvertTenthsMMToPixels(dc, wxRichTextBuffer::GetBulletRightMargin()); - - if (bulletAttr.GetBulletStyle() & wxTEXT_ATTR_BULLET_STYLE_ALIGN_RIGHT) - x = rect.x + rect.width - bulletWidth - margin; - else if (bulletAttr.GetBulletStyle() & wxTEXT_ATTR_BULLET_STYLE_ALIGN_CENTRE) - x = x + (rect.width)/2 - bulletWidth/2; - - if (bulletAttr.GetBulletName() == wxT("standard/square")) - { - dc.DrawRectangle(x, y, bulletWidth, bulletHeight); - } - else if (bulletAttr.GetBulletName() == wxT("standard/diamond")) - { - wxPoint pts[5]; - pts[0].x = x; pts[0].y = y + bulletHeight/2; - pts[1].x = x + bulletWidth/2; pts[1].y = y; - pts[2].x = x + bulletWidth; pts[2].y = y + bulletHeight/2; - pts[3].x = x + bulletWidth/2; pts[3].y = y + bulletHeight; - - dc.DrawPolygon(4, pts); - } - else if (bulletAttr.GetBulletName() == wxT("standard/triangle")) - { - wxPoint pts[3]; - pts[0].x = x; pts[0].y = y; - pts[1].x = x + bulletWidth; pts[1].y = y + bulletHeight/2; - pts[2].x = x; pts[2].y = y + bulletHeight; - - dc.DrawPolygon(3, pts); - } - else if (bulletAttr.GetBulletName() == wxT("standard/circle-outline")) - { - wxCheckSetBrush(dc, *wxTRANSPARENT_BRUSH); - dc.DrawEllipse(x, y, bulletWidth, bulletHeight); - } - else // "standard/circle", and catch-all - { - dc.DrawEllipse(x, y, bulletWidth, bulletHeight); - } - - return true; -} - -bool wxRichTextStdRenderer::DrawTextBullet(wxRichTextParagraph* paragraph, wxDC& dc, const wxTextAttrEx& attr, const wxRect& rect, const wxString& text) -{ - if (!text.empty()) - { - wxFont font; - if ((attr.GetBulletStyle() & wxTEXT_ATTR_BULLET_STYLE_SYMBOL) && !attr.GetBulletFont().IsEmpty() && attr.GetFont().Ok()) - { - font = (*wxTheFontList->FindOrCreateFont(attr.GetFont().GetPointSize(), attr.GetFont().GetFamily(), - attr.GetFont().GetStyle(), attr.GetFont().GetWeight(), attr.GetFont().GetUnderlined(), - attr.GetBulletFont())); - } - else if (attr.GetFont().Ok()) - font = attr.GetFont(); - else - font = (*wxNORMAL_FONT); - - wxCheckSetFont(dc, font); - - if (attr.GetTextColour().Ok()) - dc.SetTextForeground(attr.GetTextColour()); - - dc.SetBackgroundMode(wxTRANSPARENT); - - int charHeight = dc.GetCharHeight(); - wxCoord tw, th; - dc.GetTextExtent(text, & tw, & th); - - int x = rect.x; - - // Calculate the top position of the character (as opposed to the whole line height) - int y = rect.y + (rect.height - charHeight); - - // The margin between a bullet and text. - int margin = paragraph->ConvertTenthsMMToPixels(dc, wxRichTextBuffer::GetBulletRightMargin()); - - if (attr.GetBulletStyle() & wxTEXT_ATTR_BULLET_STYLE_ALIGN_RIGHT) - x = (rect.x + rect.width) - tw - margin; - else if (attr.GetBulletStyle() & wxTEXT_ATTR_BULLET_STYLE_ALIGN_CENTRE) - x = x + (rect.width)/2 - tw/2; - - dc.DrawText(text, x, y); - - return true; - } - else - return false; -} - -bool wxRichTextStdRenderer::DrawBitmapBullet(wxRichTextParagraph* WXUNUSED(paragraph), wxDC& WXUNUSED(dc), const wxTextAttrEx& WXUNUSED(attr), const wxRect& WXUNUSED(rect)) -{ - // Currently unimplemented. The intention is to store bitmaps by name in a media store associated - // with the buffer. The store will allow retrieval from memory, disk or other means. - return false; -} - -/// Enumerate the standard bullet names currently supported -bool wxRichTextStdRenderer::EnumerateStandardBulletNames(wxArrayString& bulletNames) -{ - bulletNames.Add(wxTRANSLATE("standard/circle")); - bulletNames.Add(wxTRANSLATE("standard/circle-outline")); - bulletNames.Add(wxTRANSLATE("standard/square")); - bulletNames.Add(wxTRANSLATE("standard/diamond")); - bulletNames.Add(wxTRANSLATE("standard/triangle")); - - return true; -} - -/* - * Module to initialise and clean up handlers - */ - -class wxRichTextModule: public wxModule -{ -DECLARE_DYNAMIC_CLASS(wxRichTextModule) -public: - wxRichTextModule() {} - bool OnInit() - { - wxRichTextBuffer::SetRenderer(new wxRichTextStdRenderer); - wxRichTextBuffer::InitStandardHandlers(); - wxRichTextParagraph::InitDefaultTabs(); - return true; - } - void OnExit() - { - wxRichTextBuffer::CleanUpHandlers(); - wxRichTextDecimalToRoman(-1); - wxRichTextParagraph::ClearDefaultTabs(); - wxRichTextCtrl::ClearAvailableFontNames(); - wxRichTextBuffer::SetRenderer(NULL); - } -}; - -IMPLEMENT_DYNAMIC_CLASS(wxRichTextModule, wxModule) - - -// If the richtext lib is dynamically loaded after the app has already started -// (such as from wxPython) then the built-in module system will not init this -// module. Provide this function to do it manually. -void wxRichTextModuleInit() -{ - wxModule* module = new wxRichTextModule; - module->Init(); - wxModule::RegisterModule(module); -} - - -/*! - * Commands for undo/redo - * - */ - -wxRichTextCommand::wxRichTextCommand(const wxString& name, wxRichTextCommandId id, wxRichTextBuffer* buffer, - wxRichTextCtrl* ctrl, bool ignoreFirstTime): wxCommand(true, name) -{ - /* wxRichTextAction* action = */ new wxRichTextAction(this, name, id, buffer, ctrl, ignoreFirstTime); -} - -wxRichTextCommand::wxRichTextCommand(const wxString& name): wxCommand(true, name) -{ -} - -wxRichTextCommand::~wxRichTextCommand() -{ - ClearActions(); -} - -void wxRichTextCommand::AddAction(wxRichTextAction* action) -{ - if (!m_actions.Member(action)) - m_actions.Append(action); -} - -bool wxRichTextCommand::Do() -{ - for (wxList::compatibility_iterator node = m_actions.GetFirst(); node; node = node->GetNext()) - { - wxRichTextAction* action = (wxRichTextAction*) node->GetData(); - action->Do(); - } - - return true; -} - -bool wxRichTextCommand::Undo() -{ - for (wxList::compatibility_iterator node = m_actions.GetLast(); node; node = node->GetPrevious()) - { - wxRichTextAction* action = (wxRichTextAction*) node->GetData(); - action->Undo(); - } - - return true; -} - -void wxRichTextCommand::ClearActions() -{ - WX_CLEAR_LIST(wxList, m_actions); -} - -/*! - * Individual action - * - */ - -wxRichTextAction::wxRichTextAction(wxRichTextCommand* cmd, const wxString& name, wxRichTextCommandId id, wxRichTextBuffer* buffer, - wxRichTextCtrl* ctrl, bool ignoreFirstTime) -{ - m_buffer = buffer; - m_ignoreThis = ignoreFirstTime; - m_cmdId = id; - m_position = -1; - m_ctrl = ctrl; - m_name = name; - m_newParagraphs.SetDefaultStyle(buffer->GetDefaultStyle()); - m_newParagraphs.SetBasicStyle(buffer->GetBasicStyle()); - if (cmd) - cmd->AddAction(this); -} - -wxRichTextAction::~wxRichTextAction() -{ -} - -// Create arrays to be used in refresh optimization -void wxRichTextAction::CalculateRefreshOptimizations(wxArrayInt& optimizationLineCharPositions, wxArrayInt& optimizationLineYPositions) -{ - // Store a list of line start character and y positions so we can figure out which area - // we need to refresh - -#if wxRICHTEXT_USE_OPTIMIZED_DRAWING - // NOTE: we're assuming that the buffer is laid out correctly at this point. - // If we had several actions, which only invalidate and leave layout until the - // paint handler is called, then this might not be true. So we may need to switch - // optimisation on only when we're simply adding text and not simultaneously - // deleting a selection, for example. Or, we make sure the buffer is laid out correctly - // first, but of course this means we'll be doing it twice. - if (!m_buffer->GetDirty() && m_ctrl) // can only do optimisation if the buffer is already laid out correctly - { - wxSize clientSize = m_ctrl->GetClientSize(); - wxPoint firstVisiblePt = m_ctrl->GetFirstVisiblePoint(); - int lastY = firstVisiblePt.y + clientSize.y; - - wxRichTextParagraph* para = m_buffer->GetParagraphAtPosition(GetRange().GetStart()); - wxRichTextObjectList::compatibility_iterator node = m_buffer->GetChildren().Find(para); - while (node) - { - wxRichTextParagraph* child = (wxRichTextParagraph*) node->GetData(); - wxRichTextLineList::compatibility_iterator node2 = child->GetLines().GetFirst(); - while (node2) - { - wxRichTextLine* line = node2->GetData(); - wxPoint pt = line->GetAbsolutePosition(); - wxRichTextRange range = line->GetAbsoluteRange(); - - if (pt.y > lastY) - { - node2 = wxRichTextLineList::compatibility_iterator(); - node = wxRichTextObjectList::compatibility_iterator(); - } - else if (range.GetStart() > GetPosition() && pt.y >= firstVisiblePt.y) - { - optimizationLineCharPositions.Add(range.GetStart()); - optimizationLineYPositions.Add(pt.y); - } - - if (node2) - node2 = node2->GetNext(); - } - - if (node) - node = node->GetNext(); - } - } -#endif -} - -bool g_ActionInDo = false; - -bool wxRichTextAction::Do() -{ - m_buffer->Modify(true); - - switch (m_cmdId) - { - case wxRICHTEXT_INSERT: - { - // Store a list of line start character and y positions so we can figure out which area - // we need to refresh - wxArrayInt optimizationLineCharPositions; - wxArrayInt optimizationLineYPositions; - -#if wxRICHTEXT_USE_OPTIMIZED_DRAWING - CalculateRefreshOptimizations(optimizationLineCharPositions, optimizationLineYPositions); -#endif - - m_buffer->InsertFragment(GetRange().GetStart(), m_newParagraphs); - m_buffer->UpdateRanges(); - m_buffer->Invalidate(wxRichTextRange(wxMax(0, GetRange().GetStart()-1), GetRange().GetEnd())); - - long newCaretPosition = GetPosition() + m_newParagraphs.GetRange().GetLength(); - - // Character position to caret position - newCaretPosition --; - - // Don't take into account the last newline - if (m_newParagraphs.GetPartialParagraph()) - newCaretPosition --; - else - if (m_newParagraphs.GetChildren().GetCount() > 1) - { - wxRichTextObject* p = (wxRichTextObject*) m_newParagraphs.GetChildren().GetLast()->GetData(); - if (p->GetRange().GetLength() == 1) - newCaretPosition --; - } - - newCaretPosition = wxMin(newCaretPosition, (m_buffer->GetRange().GetEnd()-1)); - - g_ActionInDo = true; - UpdateAppearance(newCaretPosition, true /* send update event */, & optimizationLineCharPositions, & optimizationLineYPositions); - - wxRichTextEvent cmdEvent( - wxEVT_COMMAND_RICHTEXT_CONTENT_INSERTED, - m_ctrl ? m_ctrl->GetId() : -1); - cmdEvent.SetEventObject(m_ctrl ? (wxObject*) m_ctrl : (wxObject*) m_buffer); - cmdEvent.SetRange(GetRange()); - cmdEvent.SetPosition(GetRange().GetStart()); - - m_buffer->SendEvent(cmdEvent); - - break; - } - case wxRICHTEXT_DELETE: - { - // Store a list of line start character and y positions so we can figure out which area - // we need to refresh - wxArrayInt optimizationLineCharPositions; - wxArrayInt optimizationLineYPositions; - -#if wxRICHTEXT_USE_OPTIMIZED_DRAWING - CalculateRefreshOptimizations(optimizationLineCharPositions, optimizationLineYPositions); -#endif - - m_buffer->DeleteRange(GetRange()); - m_buffer->UpdateRanges(); - m_buffer->Invalidate(wxRichTextRange(GetRange().GetStart(), GetRange().GetStart())); - - long caretPos = GetRange().GetStart()-1; - if (caretPos >= m_buffer->GetRange().GetEnd()) - caretPos --; - - g_ActionInDo = true; - UpdateAppearance(caretPos, true /* send update event */, & optimizationLineCharPositions, & optimizationLineYPositions); - - wxRichTextEvent cmdEvent( - wxEVT_COMMAND_RICHTEXT_CONTENT_DELETED, - m_ctrl ? m_ctrl->GetId() : -1); - cmdEvent.SetEventObject(m_ctrl ? (wxObject*) m_ctrl : (wxObject*) m_buffer); - cmdEvent.SetRange(GetRange()); - cmdEvent.SetPosition(GetRange().GetStart()); - - m_buffer->SendEvent(cmdEvent); - - break; - } - case wxRICHTEXT_CHANGE_STYLE: - { - ApplyParagraphs(GetNewParagraphs()); - m_buffer->Invalidate(GetRange()); - - UpdateAppearance(GetPosition()); - - wxRichTextEvent cmdEvent( - wxEVT_COMMAND_RICHTEXT_STYLE_CHANGED, - m_ctrl ? m_ctrl->GetId() : -1); - cmdEvent.SetEventObject(m_ctrl ? (wxObject*) m_ctrl : (wxObject*) m_buffer); - cmdEvent.SetRange(GetRange()); - cmdEvent.SetPosition(GetRange().GetStart()); - - m_buffer->SendEvent(cmdEvent); - - break; - } - default: - break; - } - - return true; -} - -bool wxRichTextAction::Undo() -{ - m_buffer->Modify(true); - - switch (m_cmdId) - { - case wxRICHTEXT_INSERT: - { - // Store a list of line start character and y positions so we can figure out which area - // we need to refresh - wxArrayInt optimizationLineCharPositions; - wxArrayInt optimizationLineYPositions; - -#if wxRICHTEXT_USE_OPTIMIZED_DRAWING - CalculateRefreshOptimizations(optimizationLineCharPositions, optimizationLineYPositions); -#endif - - m_buffer->DeleteRange(GetRange()); - m_buffer->UpdateRanges(); - m_buffer->Invalidate(wxRichTextRange(GetRange().GetStart(), GetRange().GetStart())); - - long newCaretPosition = GetPosition() - 1; - - g_ActionInDo = false; - UpdateAppearance(newCaretPosition, true /* send update event */, & optimizationLineCharPositions, & optimizationLineYPositions); - - wxRichTextEvent cmdEvent( - wxEVT_COMMAND_RICHTEXT_CONTENT_DELETED, - m_ctrl ? m_ctrl->GetId() : -1); - cmdEvent.SetEventObject(m_ctrl ? (wxObject*) m_ctrl : (wxObject*) m_buffer); - cmdEvent.SetRange(GetRange()); - cmdEvent.SetPosition(GetRange().GetStart()); - - m_buffer->SendEvent(cmdEvent); - - break; - } - case wxRICHTEXT_DELETE: - { - // Store a list of line start character and y positions so we can figure out which area - // we need to refresh - wxArrayInt optimizationLineCharPositions; - wxArrayInt optimizationLineYPositions; - -#if wxRICHTEXT_USE_OPTIMIZED_DRAWING - CalculateRefreshOptimizations(optimizationLineCharPositions, optimizationLineYPositions); -#endif - - m_buffer->InsertFragment(GetRange().GetStart(), m_oldParagraphs); - m_buffer->UpdateRanges(); - m_buffer->Invalidate(GetRange()); - - g_ActionInDo = false; - UpdateAppearance(GetPosition(), true /* send update event */, & optimizationLineCharPositions, & optimizationLineYPositions); - - wxRichTextEvent cmdEvent( - wxEVT_COMMAND_RICHTEXT_CONTENT_INSERTED, - m_ctrl ? m_ctrl->GetId() : -1); - cmdEvent.SetEventObject(m_ctrl ? (wxObject*) m_ctrl : (wxObject*) m_buffer); - cmdEvent.SetRange(GetRange()); - cmdEvent.SetPosition(GetRange().GetStart()); - - m_buffer->SendEvent(cmdEvent); - - break; - } - case wxRICHTEXT_CHANGE_STYLE: - { - ApplyParagraphs(GetOldParagraphs()); - m_buffer->Invalidate(GetRange()); - - UpdateAppearance(GetPosition()); - - wxRichTextEvent cmdEvent( - wxEVT_COMMAND_RICHTEXT_STYLE_CHANGED, - m_ctrl ? m_ctrl->GetId() : -1); - cmdEvent.SetEventObject(m_ctrl ? (wxObject*) m_ctrl : (wxObject*) m_buffer); - cmdEvent.SetRange(GetRange()); - cmdEvent.SetPosition(GetRange().GetStart()); - - m_buffer->SendEvent(cmdEvent); - - break; - } - default: - break; - } - - return true; -} - -/// Update the control appearance -void wxRichTextAction::UpdateAppearance(long caretPosition, bool sendUpdateEvent, wxArrayInt* optimizationLineCharPositions, wxArrayInt* optimizationLineYPositions) -{ - if (m_ctrl) - { - m_ctrl->SetCaretPosition(caretPosition); - if (!m_ctrl->IsFrozen()) - { - m_ctrl->LayoutContent(); - -#if wxRICHTEXT_USE_OPTIMIZED_DRAWING - // Find refresh rectangle if we are in a position to optimise refresh - if ((m_cmdId == wxRICHTEXT_INSERT || m_cmdId == wxRICHTEXT_DELETE) && optimizationLineCharPositions) - { - size_t i; - - wxSize clientSize = m_ctrl->GetClientSize(); - wxPoint firstVisiblePt = m_ctrl->GetFirstVisiblePoint(); - - // Start/end positions - int firstY = 0; - int lastY = firstVisiblePt.y + clientSize.y; - - bool foundEnd = false; - - // position offset - how many characters were inserted or deleted - int positionOffset = GetRange().GetLength(); - - // Determine whether this is Do or Undo, and adjust positionOffset accordingly - if ((m_cmdId == wxRICHTEXT_DELETE && g_ActionInDo) || (m_cmdId == wxRICHTEXT_INSERT && !g_ActionInDo)) - positionOffset = - positionOffset; - - // find the first line which is being drawn at the same position as it was - // before. Since we're talking about a simple insertion, we can assume - // that the rest of the window does not need to be redrawn. - - wxRichTextParagraph* para = m_buffer->GetParagraphAtPosition(GetPosition()); - if (para) - { - // Find line containing GetPosition(). - wxRichTextLine* line = NULL; - wxRichTextLineList::compatibility_iterator node2 = para->GetLines().GetFirst(); - while (node2) - { - wxRichTextLine* l = node2->GetData(); - wxRichTextRange range = l->GetAbsoluteRange(); - if (range.Contains(GetRange().GetStart()-1)) - { - line = l; - break; - } - node2 = node2->GetNext(); - } - - if (line) - { - // Step back a couple of lines to where we can be sure of reformatting correctly - wxRichTextLineList::compatibility_iterator lineNode = para->GetLines().Find(line); - if (lineNode) - { - lineNode = lineNode->GetPrevious(); - if (lineNode) - { - line = (wxRichTextLine*) lineNode->GetData(); - lineNode = lineNode->GetPrevious(); - if (lineNode) - line = (wxRichTextLine*) lineNode->GetData(); - } - } - - firstY = line->GetAbsolutePosition().y; - } - } - - // find the first line which is being drawn at the same position as it was - // before. Since we're talking about a simple insertion, we can assume - // that the rest of the window does not need to be redrawn. - - wxRichTextObjectList::compatibility_iterator node = m_buffer->GetChildren().Find(para); - while (node) - { - wxRichTextParagraph* child = (wxRichTextParagraph*) node->GetData(); - wxRichTextLineList::compatibility_iterator node2 = child->GetLines().GetFirst(); - while (node2) - { - wxRichTextLine* line = node2->GetData(); - wxPoint pt = line->GetAbsolutePosition(); - wxRichTextRange range = line->GetAbsoluteRange(); - - // we want to find the first line that is in the same position - // as before. This will mean we're at the end of the changed text. - - if (pt.y > lastY) // going past the end of the window, no more info - { - node2 = wxRichTextLineList::compatibility_iterator(); - node = wxRichTextObjectList::compatibility_iterator(); - } - // Detect last line in the buffer - else if (!node2->GetNext() && para->GetRange().Contains(m_buffer->GetRange().GetEnd())) - { - // If deleting text, make sure we refresh below as well as above - if (positionOffset >= 0) - { - foundEnd = true; - lastY = pt.y + line->GetSize().y; - } - - node2 = wxRichTextLineList::compatibility_iterator(); - node = wxRichTextObjectList::compatibility_iterator(); - - break; - } - else - { - // search for this line being at the same position as before - for (i = 0; i < optimizationLineCharPositions->GetCount(); i++) - { - if (((*optimizationLineCharPositions)[i] + positionOffset == range.GetStart()) && - ((*optimizationLineYPositions)[i] == pt.y)) - { - // Stop, we're now the same as we were - foundEnd = true; - lastY = pt.y; - - node2 = wxRichTextLineList::compatibility_iterator(); - node = wxRichTextObjectList::compatibility_iterator(); - - break; - } - } - } - - if (node2) - node2 = node2->GetNext(); - } - - if (node) - node = node->GetNext(); - } - - firstY = wxMax(firstVisiblePt.y, firstY); - if (!foundEnd) - lastY = firstVisiblePt.y + clientSize.y; - - // Convert to device coordinates - wxRect rect(m_ctrl->GetPhysicalPoint(wxPoint(firstVisiblePt.x, firstY)), wxSize(clientSize.x, lastY - firstY)); - m_ctrl->RefreshRect(rect, false); - } - else -#endif - { - m_ctrl->Refresh(false); - } - -#if wxRICHTEXT_USE_OWN_CARET - m_ctrl->PositionCaret(); -#endif - if (sendUpdateEvent) - m_ctrl->SendTextUpdatedEvent(); - } - } -} - -/// Replace the buffer paragraphs with the new ones. -void wxRichTextAction::ApplyParagraphs(const wxRichTextParagraphLayoutBox& fragment) -{ - wxRichTextObjectList::compatibility_iterator node = fragment.GetChildren().GetFirst(); - while (node) - { - wxRichTextParagraph* para = wxDynamicCast(node->GetData(), wxRichTextParagraph); - wxASSERT (para != NULL); - - // We'll replace the existing paragraph by finding the paragraph at this position, - // delete its node data, and setting a copy as the new node data. - // TODO: make more efficient by simply swapping old and new paragraph objects. - - wxRichTextParagraph* existingPara = m_buffer->GetParagraphAtPosition(para->GetRange().GetStart()); - if (existingPara) - { - wxRichTextObjectList::compatibility_iterator bufferParaNode = m_buffer->GetChildren().Find(existingPara); - if (bufferParaNode) - { - wxRichTextParagraph* newPara = new wxRichTextParagraph(*para); - newPara->SetParent(m_buffer); - - bufferParaNode->SetData(newPara); - - delete existingPara; - } - } - - node = node->GetNext(); - } -} - - -/*! - * wxRichTextRange - * This stores beginning and end positions for a range of data. - */ - -/// Limit this range to be within 'range' -bool wxRichTextRange::LimitTo(const wxRichTextRange& range) -{ - if (m_start < range.m_start) - m_start = range.m_start; - - if (m_end > range.m_end) - m_end = range.m_end; - - return true; -} - -/*! - * wxRichTextImage implementation - * This object represents an image. - */ - -IMPLEMENT_DYNAMIC_CLASS(wxRichTextImage, wxRichTextObject) - -wxRichTextImage::wxRichTextImage(const wxImage& image, wxRichTextObject* parent, wxTextAttrEx* charStyle): - wxRichTextObject(parent) -{ - m_image = image; - if (charStyle) - SetAttributes(*charStyle); -} - -wxRichTextImage::wxRichTextImage(const wxRichTextImageBlock& imageBlock, wxRichTextObject* parent, wxTextAttrEx* charStyle): - wxRichTextObject(parent) -{ - m_imageBlock = imageBlock; - m_imageBlock.Load(m_image); - if (charStyle) - SetAttributes(*charStyle); -} - -/// Load wxImage from the block -bool wxRichTextImage::LoadFromBlock() -{ - m_imageBlock.Load(m_image); - return m_imageBlock.Ok(); -} - -/// Make block from the wxImage -bool wxRichTextImage::MakeBlock() -{ - if (m_imageBlock.GetImageType() == wxBITMAP_TYPE_ANY || m_imageBlock.GetImageType() == -1) - m_imageBlock.SetImageType(wxBITMAP_TYPE_PNG); - - m_imageBlock.MakeImageBlock(m_image, m_imageBlock.GetImageType()); - return m_imageBlock.Ok(); -} - - -/// Draw the item -bool wxRichTextImage::Draw(wxDC& dc, const wxRichTextRange& range, const wxRichTextRange& selectionRange, const wxRect& rect, int WXUNUSED(descent), int WXUNUSED(style)) -{ - if (!m_image.Ok() && m_imageBlock.Ok()) - LoadFromBlock(); - - if (!m_image.Ok()) - return false; - - if (m_image.Ok() && !m_bitmap.Ok()) - m_bitmap = wxBitmap(m_image); - - int y = rect.y + (rect.height - m_image.GetHeight()); - - if (m_bitmap.Ok()) - dc.DrawBitmap(m_bitmap, rect.x, y, true); - - if (selectionRange.Contains(range.GetStart())) - { - wxCheckSetBrush(dc, *wxBLACK_BRUSH); - wxCheckSetPen(dc, *wxBLACK_PEN); - dc.SetLogicalFunction(wxINVERT); - dc.DrawRectangle(rect); - dc.SetLogicalFunction(wxCOPY); - } - - return true; -} - -/// Lay the item out -bool wxRichTextImage::Layout(wxDC& WXUNUSED(dc), const wxRect& rect, int WXUNUSED(style)) -{ - if (!m_image.Ok()) - LoadFromBlock(); - - if (m_image.Ok()) - { - SetCachedSize(wxSize(m_image.GetWidth(), m_image.GetHeight())); - SetPosition(rect.GetPosition()); - } - - return true; -} - -/// Get/set the object size for the given range. Returns false if the range -/// is invalid for this object. -bool wxRichTextImage::GetRangeSize(const wxRichTextRange& range, wxSize& size, int& WXUNUSED(descent), wxDC& WXUNUSED(dc), int WXUNUSED(flags), wxPoint WXUNUSED(position)) const -{ - if (!range.IsWithin(GetRange())) - return false; - - if (!m_image.Ok()) - ((wxRichTextImage*) this)->LoadFromBlock(); - -#if wxRICHTEXT_USE_PARTIAL_TEXT_EXTENTS - if (g_UseGlobalPartialTextExtents) - { - // Now add this child's extents to the global extents - int lastExtent = 0; - if (g_GlobalPartialTextExtents.GetCount() > 0) - lastExtent = g_GlobalPartialTextExtents[g_GlobalPartialTextExtents.GetCount()-1]; - - int thisExtent; - - if (m_image.Ok()) - thisExtent = lastExtent + m_image.GetWidth(); - else - thisExtent = lastExtent; - - g_GlobalPartialTextExtents.Add(thisExtent); - } -#endif - - if (!m_image.Ok()) - return false; - - size.x = m_image.GetWidth(); - size.y = m_image.GetHeight(); - - return true; -} - -/// Copy -void wxRichTextImage::Copy(const wxRichTextImage& obj) -{ - wxRichTextObject::Copy(obj); - - m_image = obj.m_image; - m_imageBlock = obj.m_imageBlock; -} - -/*! - * Utilities - * - */ - -/// Compare two attribute objects -bool wxTextAttrEq(const wxTextAttrEx& attr1, const wxTextAttrEx& attr2) -{ - return (attr1 == attr2); -} - -bool wxTextAttrEq(const wxTextAttrEx& attr1, const wxRichTextAttr& attr2) -{ - return ( - attr1.GetTextColour() == attr2.GetTextColour() && - attr1.GetBackgroundColour() == attr2.GetBackgroundColour() && - attr1.GetFont().GetPointSize() == attr2.GetFontSize() && - attr1.GetFont().GetStyle() == attr2.GetFontStyle() && - attr1.GetFont().GetWeight() == attr2.GetFontWeight() && - attr1.GetFont().GetFaceName() == attr2.GetFontFaceName() && - attr1.GetFont().GetUnderlined() == attr2.GetFontUnderlined() && - attr1.GetTextEffects() == attr2.GetTextEffects() && - attr1.GetTextEffectFlags() == attr2.GetTextEffectFlags() && - attr1.GetAlignment() == attr2.GetAlignment() && - attr1.GetLeftIndent() == attr2.GetLeftIndent() && - attr1.GetRightIndent() == attr2.GetRightIndent() && - attr1.GetLeftSubIndent() == attr2.GetLeftSubIndent() && - wxRichTextTabsEq(attr1.GetTabs(), attr2.GetTabs()) && - attr1.GetLineSpacing() == attr2.GetLineSpacing() && - attr1.GetParagraphSpacingAfter() == attr2.GetParagraphSpacingAfter() && - attr1.GetParagraphSpacingBefore() == attr2.GetParagraphSpacingBefore() && - attr1.GetBulletStyle() == attr2.GetBulletStyle() && - attr1.GetBulletNumber() == attr2.GetBulletNumber() && - attr1.GetBulletText() == attr2.GetBulletText() && - attr1.GetBulletName() == attr2.GetBulletName() && - attr1.GetBulletFont() == attr2.GetBulletFont() && - attr1.GetOutlineLevel() == attr2.GetOutlineLevel() && - attr1.GetCharacterStyleName() == attr2.GetCharacterStyleName() && - attr1.GetParagraphStyleName() == attr2.GetParagraphStyleName() && - attr1.GetListStyleName() == attr2.GetListStyleName() && - attr1.HasPageBreak() == attr2.HasPageBreak()); -} - -/// Compare two attribute objects, but take into account the flags -/// specifying attributes of interest. -bool wxTextAttrEqPartial(const wxTextAttrEx& attr1, const wxTextAttrEx& attr2, int flags) -{ - if ((flags & wxTEXT_ATTR_TEXT_COLOUR) && attr1.GetTextColour() != attr2.GetTextColour()) - return false; - - if ((flags & wxTEXT_ATTR_BACKGROUND_COLOUR) && attr1.GetBackgroundColour() != attr2.GetBackgroundColour()) - return false; - - if ((flags & wxTEXT_ATTR_FONT_FACE) && attr1.GetFont().Ok() && attr2.GetFont().Ok() && - attr1.GetFont().GetFaceName() != attr2.GetFont().GetFaceName()) - return false; - - if ((flags & wxTEXT_ATTR_FONT_SIZE) && attr1.GetFont().Ok() && attr2.GetFont().Ok() && - attr1.GetFont().GetPointSize() != attr2.GetFont().GetPointSize()) - return false; - - if ((flags & wxTEXT_ATTR_FONT_WEIGHT) && attr1.GetFont().Ok() && attr2.GetFont().Ok() && - attr1.GetFont().GetWeight() != attr2.GetFont().GetWeight()) - return false; - - if ((flags & wxTEXT_ATTR_FONT_ITALIC) && attr1.GetFont().Ok() && attr2.GetFont().Ok() && - attr1.GetFont().GetStyle() != attr2.GetFont().GetStyle()) - return false; - - if ((flags & wxTEXT_ATTR_FONT_UNDERLINE) && attr1.GetFont().Ok() && attr2.GetFont().Ok() && - attr1.GetFont().GetUnderlined() != attr2.GetFont().GetUnderlined()) - return false; - - if ((flags & wxTEXT_ATTR_URL) && attr1.GetURL() != attr2.GetURL()) - return false; - - if ((flags & wxTEXT_ATTR_ALIGNMENT) && attr1.GetAlignment() != attr2.GetAlignment()) - return false; - - if ((flags & wxTEXT_ATTR_LEFT_INDENT) && - ((attr1.GetLeftIndent() != attr2.GetLeftIndent()) || (attr1.GetLeftSubIndent() != attr2.GetLeftSubIndent()))) - return false; - - if ((flags & wxTEXT_ATTR_RIGHT_INDENT) && - (attr1.GetRightIndent() != attr2.GetRightIndent())) - return false; - - if ((flags & wxTEXT_ATTR_PARA_SPACING_AFTER) && - (attr1.GetParagraphSpacingAfter() != attr2.GetParagraphSpacingAfter())) - return false; - - if ((flags & wxTEXT_ATTR_PARA_SPACING_BEFORE) && - (attr1.GetParagraphSpacingBefore() != attr2.GetParagraphSpacingBefore())) - return false; - - if ((flags & wxTEXT_ATTR_LINE_SPACING) && - (attr1.GetLineSpacing() != attr2.GetLineSpacing())) - return false; - - if ((flags & wxTEXT_ATTR_CHARACTER_STYLE_NAME) && - (attr1.GetCharacterStyleName() != attr2.GetCharacterStyleName())) - return false; - - if ((flags & wxTEXT_ATTR_PARAGRAPH_STYLE_NAME) && - (attr1.GetParagraphStyleName() != attr2.GetParagraphStyleName())) - return false; - - if ((flags & wxTEXT_ATTR_LIST_STYLE_NAME) && - (attr1.GetListStyleName() != attr2.GetListStyleName())) - return false; - - if ((flags & wxTEXT_ATTR_BULLET_STYLE) && - (attr1.GetBulletStyle() != attr2.GetBulletStyle())) - return false; - - if ((flags & wxTEXT_ATTR_BULLET_NUMBER) && - (attr1.GetBulletNumber() != attr2.GetBulletNumber())) - return false; - - if ((flags & wxTEXT_ATTR_BULLET_TEXT) && - (attr1.GetBulletText() != attr2.GetBulletText()) && - (attr1.GetBulletFont() != attr2.GetBulletFont())) - return false; - - if ((flags & wxTEXT_ATTR_BULLET_NAME) && - (attr1.GetBulletName() != attr2.GetBulletName())) - return false; - - if ((flags & wxTEXT_ATTR_TABS) && - !wxRichTextTabsEq(attr1.GetTabs(), attr2.GetTabs())) - return false; - - if ((flags & wxTEXT_ATTR_PAGE_BREAK) && - (attr1.HasPageBreak() != attr2.HasPageBreak())) - return false; - - if (flags & wxTEXT_ATTR_EFFECTS) - { - if (attr1.HasTextEffects() != attr2.HasTextEffects()) - return false; - if (!wxRichTextBitlistsEqPartial(attr1.GetTextEffects(), attr2.GetTextEffects(), attr2.GetTextEffectFlags())) - return false; - } - - if ((flags & wxTEXT_ATTR_OUTLINE_LEVEL) && - (attr1.GetOutlineLevel() != attr2.GetOutlineLevel())) - return false; - - return true; -} - -bool wxTextAttrEqPartial(const wxTextAttrEx& attr1, const wxRichTextAttr& attr2, int flags) -{ - if ((flags & wxTEXT_ATTR_TEXT_COLOUR) && attr1.GetTextColour() != attr2.GetTextColour()) - return false; - - if ((flags & wxTEXT_ATTR_BACKGROUND_COLOUR) && attr1.GetBackgroundColour() != attr2.GetBackgroundColour()) - return false; - - if ((flags & (wxTEXT_ATTR_FONT)) && !attr1.GetFont().Ok()) - return false; - - if ((flags & wxTEXT_ATTR_FONT_FACE) && attr1.GetFont().Ok() && - attr1.GetFont().GetFaceName() != attr2.GetFontFaceName()) - return false; - - if ((flags & wxTEXT_ATTR_FONT_SIZE) && attr1.GetFont().Ok() && - attr1.GetFont().GetPointSize() != attr2.GetFontSize()) - return false; - - if ((flags & wxTEXT_ATTR_FONT_WEIGHT) && attr1.GetFont().Ok() && - attr1.GetFont().GetWeight() != attr2.GetFontWeight()) - return false; - - if ((flags & wxTEXT_ATTR_FONT_ITALIC) && attr1.GetFont().Ok() && - attr1.GetFont().GetStyle() != attr2.GetFontStyle()) - return false; - - if ((flags & wxTEXT_ATTR_FONT_UNDERLINE) && attr1.GetFont().Ok() && - attr1.GetFont().GetUnderlined() != attr2.GetFontUnderlined()) - return false; - - if ((flags & wxTEXT_ATTR_URL) && attr1.GetURL() != attr2.GetURL()) - return false; - - if ((flags & wxTEXT_ATTR_ALIGNMENT) && attr1.GetAlignment() != attr2.GetAlignment()) - return false; - - if ((flags & wxTEXT_ATTR_LEFT_INDENT) && - ((attr1.GetLeftIndent() != attr2.GetLeftIndent()) || (attr1.GetLeftSubIndent() != attr2.GetLeftSubIndent()))) - return false; - - if ((flags & wxTEXT_ATTR_RIGHT_INDENT) && - (attr1.GetRightIndent() != attr2.GetRightIndent())) - return false; - - if ((flags & wxTEXT_ATTR_PARA_SPACING_AFTER) && - (attr1.GetParagraphSpacingAfter() != attr2.GetParagraphSpacingAfter())) - return false; - - if ((flags & wxTEXT_ATTR_PARA_SPACING_BEFORE) && - (attr1.GetParagraphSpacingBefore() != attr2.GetParagraphSpacingBefore())) - return false; - - if ((flags & wxTEXT_ATTR_LINE_SPACING) && - (attr1.GetLineSpacing() != attr2.GetLineSpacing())) - return false; - - if ((flags & wxTEXT_ATTR_CHARACTER_STYLE_NAME) && - (attr1.GetCharacterStyleName() != attr2.GetCharacterStyleName())) - return false; - - if ((flags & wxTEXT_ATTR_PARAGRAPH_STYLE_NAME) && - (attr1.GetParagraphStyleName() != attr2.GetParagraphStyleName())) - return false; - - if ((flags & wxTEXT_ATTR_LIST_STYLE_NAME) && - (attr1.GetListStyleName() != attr2.GetListStyleName())) - return false; - - if ((flags & wxTEXT_ATTR_BULLET_STYLE) && - (attr1.GetBulletStyle() != attr2.GetBulletStyle())) - return false; - - if ((flags & wxTEXT_ATTR_BULLET_NUMBER) && - (attr1.GetBulletNumber() != attr2.GetBulletNumber())) - return false; - - if ((flags & wxTEXT_ATTR_BULLET_TEXT) && - (attr1.GetBulletText() != attr2.GetBulletText()) && - (attr1.GetBulletFont() != attr2.GetBulletFont())) - return false; - - if ((flags & wxTEXT_ATTR_BULLET_NAME) && - (attr1.GetBulletName() != attr2.GetBulletName())) - return false; - - if ((flags & wxTEXT_ATTR_TABS) && - !wxRichTextTabsEq(attr1.GetTabs(), attr2.GetTabs())) - return false; - - if ((flags & wxTEXT_ATTR_PAGE_BREAK) && - (attr1.HasPageBreak() != attr2.HasPageBreak())) - return false; - - if (flags & wxTEXT_ATTR_EFFECTS) - { - if (attr1.HasTextEffects() != attr2.HasTextEffects()) - return false; - if (!wxRichTextBitlistsEqPartial(attr1.GetTextEffects(), attr2.GetTextEffects(), attr2.GetTextEffectFlags())) - return false; - } - - if ((flags & wxTEXT_ATTR_OUTLINE_LEVEL) && - (attr1.GetOutlineLevel() != attr2.GetOutlineLevel())) - return false; - - return true; -} - -/// Compare tabs -bool wxRichTextTabsEq(const wxArrayInt& tabs1, const wxArrayInt& tabs2) -{ - if (tabs1.GetCount() != tabs2.GetCount()) - return false; - - size_t i; - for (i = 0; i < tabs1.GetCount(); i++) - { - if (tabs1[i] != tabs2[i]) - return false; - } - return true; -} - -bool wxResetIncompatibleBits(int mask, const int srcFlags, int& destFlags, int& destBits) -{ - if ((srcFlags & mask) && (destFlags & mask)) - { - destBits &= ~mask; - destFlags &= ~mask; - } - - return true; -} - -/// Apply one style to another -bool wxRichTextApplyStyle(wxTextAttrEx& destStyle, const wxTextAttrEx& style) -{ - // Whole font - if (style.GetFont().Ok() && ((style.GetFlags() & (wxTEXT_ATTR_FONT)) == (wxTEXT_ATTR_FONT))) - destStyle.SetFont(style.GetFont()); - else if (style.GetFont().Ok() && !destStyle.GetFont().Ok()) - { - long oldFlags = destStyle.GetFlags(); - destStyle.SetFont(style.GetFont()); - destStyle.SetFlags(oldFlags | (style.GetFlags() & wxTEXT_ATTR_FONT)); - } - else if (style.GetFont().Ok() && destStyle.GetFont().Ok()) - { - int fontSize = destStyle.GetFont().GetPointSize(); - int fontFamily = destStyle.GetFont().GetFamily(); - int fontStyle = destStyle.GetFont().GetStyle(); - int fontWeight = destStyle.GetFont().GetWeight(); - bool fontUnderlined = destStyle.GetFont().GetUnderlined(); - wxString fontFaceName = destStyle.GetFont().GetFaceName(); - - if (style.GetFlags() & wxTEXT_ATTR_FONT_FACE) - { - destStyle.SetFlags(destStyle.GetFlags() | wxTEXT_ATTR_FONT_FACE); - fontFaceName = style.GetFont().GetFaceName(); - } - - if (style.GetFlags() & wxTEXT_ATTR_FONT_SIZE) - { - destStyle.SetFlags(destStyle.GetFlags() | wxTEXT_ATTR_FONT_SIZE); - fontSize = style.GetFont().GetPointSize(); - } - - if (style.GetFlags() & wxTEXT_ATTR_FONT_ITALIC) - { - destStyle.SetFlags(destStyle.GetFlags() | wxTEXT_ATTR_FONT_ITALIC); - fontStyle = style.GetFont().GetStyle(); - } - - if (style.GetFlags() & wxTEXT_ATTR_FONT_WEIGHT) - { - destStyle.SetFlags(destStyle.GetFlags() | wxTEXT_ATTR_FONT_WEIGHT); - fontWeight = style.GetFont().GetWeight(); - } - - if (style.GetFlags() & wxTEXT_ATTR_FONT_UNDERLINE) - { - destStyle.SetFlags(destStyle.GetFlags() | wxTEXT_ATTR_FONT_UNDERLINE); - fontUnderlined = style.GetFont().GetUnderlined(); - } - - int oldFlags = destStyle.GetFlags(); - - destStyle.SetFont(wxFont(fontSize, fontFamily, fontStyle, fontWeight, fontUnderlined, fontFaceName)); - destStyle.SetFlags(oldFlags); - } - - if ( style.GetTextColour().Ok() && style.HasTextColour()) - destStyle.SetTextColour(style.GetTextColour()); - - if ( style.GetBackgroundColour().Ok() && style.HasBackgroundColour()) - destStyle.SetBackgroundColour(style.GetBackgroundColour()); - - if (style.HasAlignment()) - destStyle.SetAlignment(style.GetAlignment()); - - if (style.HasTabs()) - destStyle.SetTabs(style.GetTabs()); - - if (style.HasLeftIndent()) - destStyle.SetLeftIndent(style.GetLeftIndent(), style.GetLeftSubIndent()); - - if (style.HasRightIndent()) - destStyle.SetRightIndent(style.GetRightIndent()); - - if (style.HasParagraphSpacingAfter()) - destStyle.SetParagraphSpacingAfter(style.GetParagraphSpacingAfter()); - - if (style.HasParagraphSpacingBefore()) - destStyle.SetParagraphSpacingBefore(style.GetParagraphSpacingBefore()); - - if (style.HasLineSpacing()) - destStyle.SetLineSpacing(style.GetLineSpacing()); - - if (style.HasCharacterStyleName()) - destStyle.SetCharacterStyleName(style.GetCharacterStyleName()); - - if (style.HasParagraphStyleName()) - destStyle.SetParagraphStyleName(style.GetParagraphStyleName()); - - if (style.HasListStyleName()) - destStyle.SetListStyleName(style.GetListStyleName()); - - if (style.HasBulletStyle()) - destStyle.SetBulletStyle(style.GetBulletStyle()); - - if (style.HasBulletText()) - { - destStyle.SetBulletText(style.GetBulletText()); - destStyle.SetBulletFont(style.GetBulletFont()); - } - - if (style.HasBulletName()) - destStyle.SetBulletName(style.GetBulletName()); - - if (style.HasBulletNumber()) - destStyle.SetBulletNumber(style.GetBulletNumber()); - - if (style.HasURL()) - destStyle.SetURL(style.GetURL()); - - if (style.HasPageBreak()) - destStyle.SetPageBreak(); - - if (style.HasTextEffects()) - { - int destBits = destStyle.GetTextEffects(); - int destFlags = destStyle.GetTextEffectFlags(); - - int srcBits = style.GetTextEffects(); - int srcFlags = style.GetTextEffectFlags(); - - // Reset incompatible bits in the destination - wxResetIncompatibleBits((wxTEXT_ATTR_EFFECT_SUPERSCRIPT|wxTEXT_ATTR_EFFECT_SUBSCRIPT), srcFlags, destFlags, destBits); - wxResetIncompatibleBits((wxTEXT_ATTR_EFFECT_CAPITALS|wxTEXT_ATTR_EFFECT_SMALL_CAPITALS), srcFlags, destFlags, destBits); - wxResetIncompatibleBits((wxTEXT_ATTR_EFFECT_STRIKETHROUGH|wxTEXT_ATTR_EFFECT_DOUBLE_STRIKETHROUGH), srcFlags, destFlags, destBits); - - wxRichTextCombineBitlists(destBits, srcBits, destFlags, srcFlags); - - destStyle.SetTextEffects(destBits); - destStyle.SetTextEffectFlags(destFlags); - } - - if (style.HasOutlineLevel()) - destStyle.SetOutlineLevel(style.GetOutlineLevel()); - - return true; -} - -bool wxRichTextApplyStyle(wxRichTextAttr& destStyle, const wxTextAttrEx& style) -{ - wxTextAttrEx destStyle2 = destStyle; - wxRichTextApplyStyle(destStyle2, style); - destStyle = destStyle2; - return true; -} - -bool wxRichTextApplyStyle(wxRichTextAttr& destStyle, const wxRichTextAttr& style, wxRichTextAttr* compareWith) -{ - destStyle = destStyle.Combine(style, compareWith); - return true; -} - -bool wxRichTextApplyStyle(wxTextAttrEx& destStyle, const wxRichTextAttr& style, wxRichTextAttr* compareWith) -{ - // Whole font. Avoiding setting individual attributes if possible, since - // it recreates the font each time. - if (((style.GetFlags() & (wxTEXT_ATTR_FONT)) == (wxTEXT_ATTR_FONT)) && !compareWith) - { - destStyle.SetFont(wxFont(style.GetFontSize(), destStyle.GetFont().Ok() ? destStyle.GetFont().GetFamily() : wxDEFAULT, - style.GetFontStyle(), style.GetFontWeight(), style.GetFontUnderlined(), style.GetFontFaceName())); - } - else if (style.GetFlags() & (wxTEXT_ATTR_FONT)) - { - int fontSize = 12; - int fontFamily = wxDEFAULT; - int fontStyle = wxNORMAL; - int fontWeight = wxNORMAL; - bool fontUnderlined = false; - wxString fontFaceName; - if (destStyle.GetFont().Ok()) - { - fontSize = destStyle.GetFont().GetPointSize(); - fontFamily = destStyle.GetFont().GetFamily(); - fontStyle = destStyle.GetFont().GetStyle(); - fontWeight = destStyle.GetFont().GetWeight(); - fontUnderlined = destStyle.GetFont().GetUnderlined(); - fontFaceName = destStyle.GetFont().GetFaceName(); - } - - if (style.GetFlags() & wxTEXT_ATTR_FONT_FACE) - { - if (compareWith && compareWith->HasFontFaceName() && compareWith->GetFontFaceName() == style.GetFontFaceName()) - { - // The same as currently displayed, so don't set - } - else - { - destStyle.SetFlags(destStyle.GetFlags() | wxTEXT_ATTR_FONT_FACE); - fontFaceName = style.GetFontFaceName(); - } - } - if (style.GetFlags() & wxTEXT_ATTR_FONT_SIZE) - { - if (compareWith && compareWith->HasFontSize() && compareWith->GetFontSize() == style.GetFontSize()) - { - // The same as currently displayed, so don't set - } - else - { - destStyle.SetFlags(destStyle.GetFlags() | wxTEXT_ATTR_FONT_SIZE); - fontSize = style.GetFontSize(); - } - } - - if (style.GetFlags() & wxTEXT_ATTR_FONT_ITALIC) - { - if (compareWith && compareWith->HasFontItalic() && compareWith->GetFontStyle() == style.GetFontStyle()) - { - // The same as currently displayed, so don't set - } - else - { - destStyle.SetFlags(destStyle.GetFlags() | wxTEXT_ATTR_FONT_ITALIC); - fontStyle = style.GetFontStyle(); - } - } - - if (style.GetFlags() & wxTEXT_ATTR_FONT_WEIGHT) - { - if (compareWith && compareWith->HasFontWeight() && compareWith->GetFontWeight() == style.GetFontWeight()) - { - // The same as currently displayed, so don't set - } - else - { - destStyle.SetFlags(destStyle.GetFlags() | wxTEXT_ATTR_FONT_WEIGHT); - fontWeight = style.GetFontWeight(); - } - } - - if (style.GetFlags() & wxTEXT_ATTR_FONT_UNDERLINE) - { - if (compareWith && compareWith->HasFontUnderlined() && compareWith->GetFontUnderlined() == style.GetFontUnderlined()) - { - // The same as currently displayed, so don't set - } - else - { - destStyle.SetFlags(destStyle.GetFlags() | wxTEXT_ATTR_FONT_UNDERLINE); - fontUnderlined = style.GetFontUnderlined(); - } - } - - wxFont font(fontSize, fontFamily, fontStyle, fontWeight, fontUnderlined, fontFaceName); - - if (font != destStyle.GetFont()) - { - int oldFlags = destStyle.GetFlags(); - - destStyle.SetFont(font); - destStyle.SetFlags(oldFlags); - } - } - - if (style.GetTextColour().Ok() && style.HasTextColour()) - { - if (!(compareWith && compareWith->HasTextColour() && compareWith->GetTextColour() == style.GetTextColour())) - destStyle.SetTextColour(style.GetTextColour()); - } - - if (style.GetBackgroundColour().Ok() && style.HasBackgroundColour()) - { - if (!(compareWith && compareWith->HasBackgroundColour() && compareWith->GetBackgroundColour() == style.GetBackgroundColour())) - destStyle.SetBackgroundColour(style.GetBackgroundColour()); - } - - if (style.HasAlignment()) - { - if (!(compareWith && compareWith->HasAlignment() && compareWith->GetAlignment() == style.GetAlignment())) - destStyle.SetAlignment(style.GetAlignment()); - } - - if (style.HasTabs()) - { - if (!(compareWith && compareWith->HasTabs() && wxRichTextTabsEq(compareWith->GetTabs(), style.GetTabs()))) - destStyle.SetTabs(style.GetTabs()); - } - - if (style.HasLeftIndent()) - { - if (!(compareWith && compareWith->HasLeftIndent() && compareWith->GetLeftIndent() == style.GetLeftIndent() - && compareWith->GetLeftSubIndent() == style.GetLeftSubIndent())) - destStyle.SetLeftIndent(style.GetLeftIndent(), style.GetLeftSubIndent()); - } - - if (style.HasRightIndent()) - { - if (!(compareWith && compareWith->HasRightIndent() && compareWith->GetRightIndent() == style.GetRightIndent())) - destStyle.SetRightIndent(style.GetRightIndent()); - } - - if (style.HasParagraphSpacingAfter()) - { - if (!(compareWith && compareWith->HasParagraphSpacingAfter() && compareWith->GetParagraphSpacingAfter() == style.GetParagraphSpacingAfter())) - destStyle.SetParagraphSpacingAfter(style.GetParagraphSpacingAfter()); - } - - if (style.HasParagraphSpacingBefore()) - { - if (!(compareWith && compareWith->HasParagraphSpacingBefore() && compareWith->GetParagraphSpacingBefore() == style.GetParagraphSpacingBefore())) - destStyle.SetParagraphSpacingBefore(style.GetParagraphSpacingBefore()); - } - - if (style.HasLineSpacing()) - { - if (!(compareWith && compareWith->HasLineSpacing() && compareWith->GetLineSpacing() == style.GetLineSpacing())) - destStyle.SetLineSpacing(style.GetLineSpacing()); - } - - if (style.HasCharacterStyleName()) - { - if (!(compareWith && compareWith->HasCharacterStyleName() && compareWith->GetCharacterStyleName() == style.GetCharacterStyleName())) - destStyle.SetCharacterStyleName(style.GetCharacterStyleName()); - } - - if (style.HasParagraphStyleName()) - { - if (!(compareWith && compareWith->HasParagraphStyleName() && compareWith->GetParagraphStyleName() == style.GetParagraphStyleName())) - destStyle.SetParagraphStyleName(style.GetParagraphStyleName()); - } - - if (style.HasListStyleName()) - { - if (!(compareWith && compareWith->HasListStyleName() && compareWith->GetListStyleName() == style.GetListStyleName())) - destStyle.SetListStyleName(style.GetListStyleName()); - } - - if (style.HasBulletStyle()) - { - if (!(compareWith && compareWith->HasBulletStyle() && compareWith->GetBulletStyle() == style.GetBulletStyle())) - destStyle.SetBulletStyle(style.GetBulletStyle()); - } - - if (style.HasBulletText()) - { - if (!(compareWith && compareWith->HasBulletText() && compareWith->GetBulletText() == style.GetBulletText())) - { - destStyle.SetBulletText(style.GetBulletText()); - destStyle.SetBulletFont(style.GetBulletFont()); - } - } - - if (style.HasBulletNumber()) - { - if (!(compareWith && compareWith->HasBulletNumber() && compareWith->GetBulletNumber() == style.GetBulletNumber())) - destStyle.SetBulletNumber(style.GetBulletNumber()); - } - - if (style.HasBulletName()) - { - if (!(compareWith && compareWith->HasBulletName() && compareWith->GetBulletName() == style.GetBulletName())) - destStyle.SetBulletName(style.GetBulletName()); - } - - if (style.HasURL()) - { - if (!(compareWith && compareWith->HasURL() && compareWith->GetURL() == style.GetURL())) - destStyle.SetURL(style.GetURL()); - } - - if (style.HasPageBreak()) - { - if (!(compareWith && compareWith->HasPageBreak())) - destStyle.SetPageBreak(); - } - - if (style.HasTextEffects()) - { - if (!(compareWith && compareWith->HasTextEffects() && compareWith->GetTextEffects() == style.GetTextEffects())) - { - int destBits = destStyle.GetTextEffects(); - int destFlags = destStyle.GetTextEffectFlags(); - - int srcBits = style.GetTextEffects(); - int srcFlags = style.GetTextEffectFlags(); - - // Reset incompatible bits in the destination - wxResetIncompatibleBits((wxTEXT_ATTR_EFFECT_SUPERSCRIPT|wxTEXT_ATTR_EFFECT_SUBSCRIPT), srcFlags, destFlags, destBits); - wxResetIncompatibleBits((wxTEXT_ATTR_EFFECT_CAPITALS|wxTEXT_ATTR_EFFECT_SMALL_CAPITALS), srcFlags, destFlags, destBits); - wxResetIncompatibleBits((wxTEXT_ATTR_EFFECT_STRIKETHROUGH|wxTEXT_ATTR_EFFECT_DOUBLE_STRIKETHROUGH), srcFlags, destFlags, destBits); - - wxRichTextCombineBitlists(destBits, srcBits, destFlags, srcFlags); - - destStyle.SetTextEffects(destBits); - destStyle.SetTextEffectFlags(destFlags); - } - } - - if (style.HasOutlineLevel()) - { - if (!(compareWith && compareWith->HasOutlineLevel() && compareWith->GetOutlineLevel() == style.GetOutlineLevel())) - destStyle.SetOutlineLevel(style.GetOutlineLevel()); - } - - return true; -} - -// Remove attributes -bool wxRichTextRemoveStyle(wxTextAttrEx& destStyle, const wxRichTextAttr& style) -{ - int flags = style.GetFlags(); - int destFlags = destStyle.GetFlags(); - - destStyle.SetFlags(destFlags & ~flags); - - return true; -} - -/// Combine two bitlists, specifying the bits of interest with separate flags. -bool wxRichTextCombineBitlists(int& valueA, int valueB, int& flagsA, int flagsB) -{ - // We want to apply B's bits to A, taking into account each's flags which indicate which bits - // are to be taken into account. A zero in B's bits should reset that bit in A but only if B's flags - // indicate it. - - // First, reset the 0 bits from B. We make a mask so we're only dealing with B's zero - // bits at this point, ignoring any 1 bits in B or 0 bits in B that are not relevant. - int valueA2 = ~(~valueB & flagsB) & valueA; - - // Now combine the 1 bits. - int valueA3 = (valueB & flagsB) | valueA2; - - valueA = valueA3; - flagsA = (flagsA | flagsB); - - return true; -} - -/// Compare two bitlists -bool wxRichTextBitlistsEqPartial(int valueA, int valueB, int flags) -{ - int relevantBitsA = valueA & flags; - int relevantBitsB = valueB & flags; - return (relevantBitsA != relevantBitsB); -} - -/// Split into paragraph and character styles -bool wxRichTextSplitParaCharStyles(const wxTextAttrEx& style, wxTextAttrEx& parStyle, wxTextAttrEx& charStyle) -{ - wxTextAttrEx defaultCharStyle1(style); - wxTextAttrEx defaultParaStyle1(style); - defaultCharStyle1.SetFlags(defaultCharStyle1.GetFlags()&wxTEXT_ATTR_CHARACTER); - defaultParaStyle1.SetFlags(defaultParaStyle1.GetFlags()&wxTEXT_ATTR_PARAGRAPH); - - wxRichTextApplyStyle(charStyle, defaultCharStyle1); - wxRichTextApplyStyle(parStyle, defaultParaStyle1); - - return true; -} - -void wxSetFontPreservingStyles(wxTextAttr& attr, const wxFont& font) -{ - long flags = attr.GetFlags(); - attr.SetFont(font); - attr.SetFlags(flags); -} - -/// Convert a decimal to Roman numerals -wxString wxRichTextDecimalToRoman(long n) -{ - static wxArrayInt decimalNumbers; - static wxArrayString romanNumbers; - - // Clean up arrays - if (n == -1) - { - decimalNumbers.Clear(); - romanNumbers.Clear(); - return wxEmptyString; - } - - if (decimalNumbers.GetCount() == 0) - { - #define wxRichTextAddDecRom(n, r) decimalNumbers.Add(n); romanNumbers.Add(r); - - wxRichTextAddDecRom(1000, wxT("M")); - wxRichTextAddDecRom(900, wxT("CM")); - wxRichTextAddDecRom(500, wxT("D")); - wxRichTextAddDecRom(400, wxT("CD")); - wxRichTextAddDecRom(100, wxT("C")); - wxRichTextAddDecRom(90, wxT("XC")); - wxRichTextAddDecRom(50, wxT("L")); - wxRichTextAddDecRom(40, wxT("XL")); - wxRichTextAddDecRom(10, wxT("X")); - wxRichTextAddDecRom(9, wxT("IX")); - wxRichTextAddDecRom(5, wxT("V")); - wxRichTextAddDecRom(4, wxT("IV")); - wxRichTextAddDecRom(1, wxT("I")); - } - - int i = 0; - wxString roman; - - while (n > 0 && i < 13) - { - if (n >= decimalNumbers[i]) - { - n -= decimalNumbers[i]; - roman += romanNumbers[i]; - } - else - { - i ++; - } - } - if (roman.IsEmpty()) - roman = wxT("0"); - return roman; -} - -/*! - * wxRichTextAttr stores attributes without a wxFont object, so is a much more - * efficient way to query styles. - */ - -// ctors -wxRichTextAttr::wxRichTextAttr(const wxColour& colText, - const wxColour& colBack, - wxTextAttrAlignment alignment): m_textAlignment(alignment), m_colText(colText), m_colBack(colBack) -{ - Init(); - - if (m_colText.Ok()) m_flags |= wxTEXT_ATTR_TEXT_COLOUR; - if (m_colBack.Ok()) m_flags |= wxTEXT_ATTR_BACKGROUND_COLOUR; - if (alignment != wxTEXT_ALIGNMENT_DEFAULT) - m_flags |= wxTEXT_ATTR_ALIGNMENT; -} - -wxRichTextAttr::wxRichTextAttr(const wxTextAttrEx& attr) -{ - Init(); - - (*this) = attr; -} - -wxRichTextAttr::wxRichTextAttr(const wxRichTextAttr& attr) -{ - Copy(attr); -} - -// operations -void wxRichTextAttr::Init() -{ - m_textAlignment = wxTEXT_ALIGNMENT_DEFAULT; - m_flags = 0; - m_leftIndent = 0; - m_leftSubIndent = 0; - m_rightIndent = 0; - - m_fontSize = 12; - m_fontStyle = wxNORMAL; - m_fontWeight = wxNORMAL; - m_fontUnderlined = false; - - m_paragraphSpacingAfter = 0; - m_paragraphSpacingBefore = 0; - m_lineSpacing = 0; - m_bulletStyle = wxTEXT_ATTR_BULLET_STYLE_NONE; - m_textEffects = wxTEXT_ATTR_EFFECT_NONE; - m_textEffectFlags = wxTEXT_ATTR_EFFECT_NONE; - m_outlineLevel = 0; - m_bulletNumber = 0; -} - -// Copy -void wxRichTextAttr::Copy(const wxRichTextAttr& attr) -{ - m_colText = attr.m_colText; - m_colBack = attr.m_colBack; - m_textAlignment = attr.m_textAlignment; - m_leftIndent = attr.m_leftIndent; - m_leftSubIndent = attr.m_leftSubIndent; - m_rightIndent = attr.m_rightIndent; - m_tabs = attr.m_tabs; - m_flags = attr.m_flags; - - m_fontSize = attr.m_fontSize; - m_fontStyle = attr.m_fontStyle; - m_fontWeight = attr.m_fontWeight; - m_fontUnderlined = attr.m_fontUnderlined; - m_fontFaceName = attr.m_fontFaceName; - m_textEffects = attr.m_textEffects; - m_textEffectFlags = attr.m_textEffectFlags; - - m_paragraphSpacingAfter = attr.m_paragraphSpacingAfter; - m_paragraphSpacingBefore = attr.m_paragraphSpacingBefore; - m_lineSpacing = attr.m_lineSpacing; - m_characterStyleName = attr.m_characterStyleName; - m_paragraphStyleName = attr.m_paragraphStyleName; - m_listStyleName = attr.m_listStyleName; - m_bulletStyle = attr.m_bulletStyle; - m_bulletNumber = attr.m_bulletNumber; - m_bulletText = attr.m_bulletText; - m_bulletFont = attr.m_bulletFont; - m_bulletName = attr.m_bulletName; - m_outlineLevel = attr.m_outlineLevel; - - m_urlTarget = attr.m_urlTarget; -} - -// operators -void wxRichTextAttr::operator= (const wxRichTextAttr& attr) -{ - Copy(attr); -} - -// operators -void wxRichTextAttr::operator= (const wxTextAttrEx& attr) -{ - m_flags = attr.GetFlags(); - - m_colText = attr.GetTextColour(); - m_colBack = attr.GetBackgroundColour(); - m_textAlignment = attr.GetAlignment(); - m_leftIndent = attr.GetLeftIndent(); - m_leftSubIndent = attr.GetLeftSubIndent(); - m_rightIndent = attr.GetRightIndent(); - m_tabs = attr.GetTabs(); - m_textEffects = attr.GetTextEffects(); - m_textEffectFlags = attr.GetTextEffectFlags(); - - m_paragraphSpacingAfter = attr.GetParagraphSpacingAfter(); - m_paragraphSpacingBefore = attr.GetParagraphSpacingBefore(); - m_lineSpacing = attr.GetLineSpacing(); - m_characterStyleName = attr.GetCharacterStyleName(); - m_paragraphStyleName = attr.GetParagraphStyleName(); - m_listStyleName = attr.GetListStyleName(); - m_bulletStyle = attr.GetBulletStyle(); - m_bulletNumber = attr.GetBulletNumber(); - m_bulletText = attr.GetBulletText(); - m_bulletName = attr.GetBulletName(); - m_bulletFont = attr.GetBulletFont(); - m_outlineLevel = attr.GetOutlineLevel(); - - m_urlTarget = attr.GetURL(); - - if (attr.GetFont().Ok()) - GetFontAttributes(attr.GetFont()); -} - -// Making a wxTextAttrEx object. -wxRichTextAttr::operator wxTextAttrEx () const -{ - wxTextAttrEx attr; - attr.SetTextColour(GetTextColour()); - attr.SetBackgroundColour(GetBackgroundColour()); - attr.SetAlignment(GetAlignment()); - attr.SetTabs(GetTabs()); - attr.SetLeftIndent(GetLeftIndent(), GetLeftSubIndent()); - attr.SetRightIndent(GetRightIndent()); - if (HasFont()) - attr.SetFont(CreateFont()); - - attr.SetParagraphSpacingAfter(m_paragraphSpacingAfter); - attr.SetParagraphSpacingBefore(m_paragraphSpacingBefore); - attr.SetLineSpacing(m_lineSpacing); - attr.SetBulletStyle(m_bulletStyle); - attr.SetBulletNumber(m_bulletNumber); - attr.SetBulletText(m_bulletText); - attr.SetBulletName(m_bulletName); - attr.SetBulletFont(m_bulletFont); - attr.SetCharacterStyleName(m_characterStyleName); - attr.SetParagraphStyleName(m_paragraphStyleName); - attr.SetListStyleName(m_listStyleName); - attr.SetTextEffects(m_textEffects); - attr.SetTextEffectFlags(m_textEffectFlags); - attr.SetOutlineLevel(m_outlineLevel); - - attr.SetURL(m_urlTarget); - - attr.SetFlags(GetFlags()); // Important: set after SetFont and others, since they set flags - return attr; -} - -// Equality test -bool wxRichTextAttr::operator== (const wxRichTextAttr& attr) const -{ - return GetFlags() == attr.GetFlags() && - - GetTextColour() == attr.GetTextColour() && - GetBackgroundColour() == attr.GetBackgroundColour() && - - GetAlignment() == attr.GetAlignment() && - GetLeftIndent() == attr.GetLeftIndent() && - GetLeftSubIndent() == attr.GetLeftSubIndent() && - GetRightIndent() == attr.GetRightIndent() && - wxRichTextTabsEq(GetTabs(), attr.GetTabs()) && - - GetParagraphSpacingAfter() == attr.GetParagraphSpacingAfter() && - GetParagraphSpacingBefore() == attr.GetParagraphSpacingBefore() && - GetLineSpacing() == attr.GetLineSpacing() && - GetCharacterStyleName() == attr.GetCharacterStyleName() && - GetParagraphStyleName() == attr.GetParagraphStyleName() && - GetListStyleName() == attr.GetListStyleName() && - - GetBulletStyle() == attr.GetBulletStyle() && - GetBulletText() == attr.GetBulletText() && - GetBulletNumber() == attr.GetBulletNumber() && - GetBulletFont() == attr.GetBulletFont() && - GetBulletName() == attr.GetBulletName() && - - GetTextEffects() == attr.GetTextEffects() && - GetTextEffectFlags() == attr.GetTextEffectFlags() && - - GetOutlineLevel() == attr.GetOutlineLevel() && - - GetFontSize() == attr.GetFontSize() && - GetFontStyle() == attr.GetFontStyle() && - GetFontWeight() == attr.GetFontWeight() && - GetFontUnderlined() == attr.GetFontUnderlined() && - GetFontFaceName() == attr.GetFontFaceName() && - - GetURL() == attr.GetURL(); -} - -// Create font from font attributes. -wxFont wxRichTextAttr::CreateFont() const -{ - wxFont font(m_fontSize, wxDEFAULT, m_fontStyle, m_fontWeight, m_fontUnderlined, m_fontFaceName); - return font; -} - -// Get attributes from font. -bool wxRichTextAttr::GetFontAttributes(const wxFont& font) -{ - if (!font.Ok()) - return false; - - m_fontSize = font.GetPointSize(); - m_fontStyle = font.GetStyle(); - m_fontWeight = font.GetWeight(); - m_fontUnderlined = font.GetUnderlined(); - m_fontFaceName = font.GetFaceName(); - - return true; -} - -wxRichTextAttr wxRichTextAttr::Combine(const wxRichTextAttr& style, const wxRichTextAttr* compareWith) const -{ - wxRichTextAttr destStyle = (*this); - destStyle.Apply(style, compareWith); - - return destStyle; -} - -bool wxRichTextAttr::Apply(const wxRichTextAttr& style, const wxRichTextAttr* compareWith) -{ - wxRichTextAttr& destStyle = (*this); - - if (style.HasFontWeight()) - { - if (!(compareWith && compareWith->HasFontWeight() && compareWith->GetFontWeight() == style.GetFontWeight())) - destStyle.SetFontWeight(style.GetFontWeight()); - } - - if (style.HasFontSize()) - { - if (!(compareWith && compareWith->HasFontSize() && compareWith->GetFontSize() == style.GetFontSize())) - destStyle.SetFontSize(style.GetFontSize()); - } - - if (style.HasFontItalic()) - { - if (!(compareWith && compareWith->HasFontItalic() && compareWith->GetFontStyle() == style.GetFontStyle())) - destStyle.SetFontStyle(style.GetFontStyle()); - } - - if (style.HasFontUnderlined()) - { - if (!(compareWith && compareWith->HasFontUnderlined() && compareWith->GetFontUnderlined() == style.GetFontUnderlined())) - destStyle.SetFontUnderlined(style.GetFontUnderlined()); - } - - if (style.HasFontFaceName()) - { - if (!(compareWith && compareWith->HasFontFaceName() && compareWith->GetFontFaceName() == style.GetFontFaceName())) - destStyle.SetFontFaceName(style.GetFontFaceName()); - } - - if (style.GetTextColour().Ok() && style.HasTextColour()) - { - if (!(compareWith && compareWith->HasTextColour() && compareWith->GetTextColour() == style.GetTextColour())) - destStyle.SetTextColour(style.GetTextColour()); - } - - if (style.GetBackgroundColour().Ok() && style.HasBackgroundColour()) - { - if (!(compareWith && compareWith->HasBackgroundColour() && compareWith->GetBackgroundColour() == style.GetBackgroundColour())) - destStyle.SetBackgroundColour(style.GetBackgroundColour()); - } - - if (style.HasAlignment()) - { - if (!(compareWith && compareWith->HasAlignment() && compareWith->GetAlignment() == style.GetAlignment())) - destStyle.SetAlignment(style.GetAlignment()); - } - - if (style.HasTabs()) - { - if (!(compareWith && compareWith->HasTabs() && wxRichTextTabsEq(compareWith->GetTabs(), style.GetTabs()))) - destStyle.SetTabs(style.GetTabs()); - } - - if (style.HasLeftIndent()) - { - if (!(compareWith && compareWith->HasLeftIndent() && compareWith->GetLeftIndent() == style.GetLeftIndent() - && compareWith->GetLeftSubIndent() == style.GetLeftSubIndent())) - destStyle.SetLeftIndent(style.GetLeftIndent(), style.GetLeftSubIndent()); - } - - if (style.HasRightIndent()) - { - if (!(compareWith && compareWith->HasRightIndent() && compareWith->GetRightIndent() == style.GetRightIndent())) - destStyle.SetRightIndent(style.GetRightIndent()); - } - - if (style.HasParagraphSpacingAfter()) - { - if (!(compareWith && compareWith->HasParagraphSpacingAfter() && compareWith->GetParagraphSpacingAfter() == style.GetParagraphSpacingAfter())) - destStyle.SetParagraphSpacingAfter(style.GetParagraphSpacingAfter()); - } - - if (style.HasParagraphSpacingBefore()) - { - if (!(compareWith && compareWith->HasParagraphSpacingBefore() && compareWith->GetParagraphSpacingBefore() == style.GetParagraphSpacingBefore())) - destStyle.SetParagraphSpacingBefore(style.GetParagraphSpacingBefore()); - } - - if (style.HasLineSpacing()) - { - if (!(compareWith && compareWith->HasLineSpacing() && compareWith->GetLineSpacing() == style.GetLineSpacing())) - destStyle.SetLineSpacing(style.GetLineSpacing()); - } - - if (style.HasCharacterStyleName()) - { - if (!(compareWith && compareWith->HasCharacterStyleName() && compareWith->GetCharacterStyleName() == style.GetCharacterStyleName())) - destStyle.SetCharacterStyleName(style.GetCharacterStyleName()); - } - - if (style.HasParagraphStyleName()) - { - if (!(compareWith && compareWith->HasParagraphStyleName() && compareWith->GetParagraphStyleName() == style.GetParagraphStyleName())) - destStyle.SetParagraphStyleName(style.GetParagraphStyleName()); - } - - if (style.HasListStyleName()) - { - if (!(compareWith && compareWith->HasListStyleName() && compareWith->GetListStyleName() == style.GetListStyleName())) - destStyle.SetListStyleName(style.GetListStyleName()); - } - - if (style.HasBulletStyle()) - { - if (!(compareWith && compareWith->HasBulletStyle() && compareWith->GetBulletStyle() == style.GetBulletStyle())) - destStyle.SetBulletStyle(style.GetBulletStyle()); - } - - if (style.HasBulletText()) - { - if (!(compareWith && compareWith->HasBulletText() && compareWith->GetBulletText() == style.GetBulletText())) - { - destStyle.SetBulletText(style.GetBulletText()); - destStyle.SetBulletFont(style.GetBulletFont()); - } - } - - if (style.HasBulletNumber()) - { - if (!(compareWith && compareWith->HasBulletNumber() && compareWith->GetBulletNumber() == style.GetBulletNumber())) - destStyle.SetBulletNumber(style.GetBulletNumber()); - } - - if (style.HasBulletName()) - { - if (!(compareWith && compareWith->HasBulletName() && compareWith->GetBulletName() == style.GetBulletName())) - destStyle.SetBulletName(style.GetBulletName()); - } - - if (style.HasURL()) - { - if (!(compareWith && compareWith->HasURL() && compareWith->GetURL() == style.GetURL())) - destStyle.SetURL(style.GetURL()); - } - - if (style.HasPageBreak()) - { - if (!(compareWith && compareWith->HasPageBreak())) - destStyle.SetPageBreak(); - } - - if (style.HasTextEffects()) - { - if (!(compareWith && compareWith->HasTextEffects() && compareWith->GetTextEffects() == style.GetTextEffects())) - { - int destBits = destStyle.GetTextEffects(); - int destFlags = destStyle.GetTextEffectFlags(); - - int srcBits = style.GetTextEffects(); - int srcFlags = style.GetTextEffectFlags(); - - wxRichTextCombineBitlists(destBits, srcBits, destFlags, srcFlags); - - destStyle.SetTextEffects(destBits); - destStyle.SetTextEffectFlags(destFlags); - } - } - - if (style.HasOutlineLevel()) - { - if (!(compareWith && compareWith->HasOutlineLevel() && compareWith->GetOutlineLevel() == style.GetOutlineLevel())) - destStyle.SetOutlineLevel(style.GetOutlineLevel()); - } - - return true; -} - -/*! - * wxTextAttrEx is an extended version of wxTextAttr with more paragraph attributes. - */ - -wxTextAttrEx::wxTextAttrEx(const wxTextAttrEx& attr): wxTextAttr() -{ - Copy(attr); -} - -// Initialise this object. -void wxTextAttrEx::Init() -{ - m_paragraphSpacingAfter = 0; - m_paragraphSpacingBefore = 0; - m_lineSpacing = 0; - m_bulletStyle = wxTEXT_ATTR_BULLET_STYLE_NONE; - m_textEffects = wxTEXT_ATTR_EFFECT_NONE; - m_textEffectFlags = wxTEXT_ATTR_EFFECT_NONE; - m_bulletNumber = 0; - m_outlineLevel = 0; -} - -// Copy -void wxTextAttrEx::Copy(const wxTextAttrEx& attr) -{ - wxTextAttr::operator= (attr); - - m_paragraphSpacingAfter = attr.m_paragraphSpacingAfter; - m_paragraphSpacingBefore = attr.m_paragraphSpacingBefore; - m_lineSpacing = attr.m_lineSpacing; - m_characterStyleName = attr.m_characterStyleName; - m_paragraphStyleName = attr.m_paragraphStyleName; - m_listStyleName = attr.m_listStyleName; - m_bulletStyle = attr.m_bulletStyle; - m_bulletNumber = attr.m_bulletNumber; - m_bulletText = attr.m_bulletText; - m_bulletFont = attr.m_bulletFont; - m_bulletName = attr.m_bulletName; - m_urlTarget = attr.m_urlTarget; - m_textEffects = attr.m_textEffects; - m_textEffectFlags = attr.m_textEffectFlags; - m_outlineLevel = attr.m_outlineLevel; -} - -// Assignment from a wxTextAttrEx object -void wxTextAttrEx::operator= (const wxTextAttrEx& attr) -{ - Copy(attr); -} - -// Assignment from a wxTextAttr object. -void wxTextAttrEx::operator= (const wxTextAttr& attr) -{ - wxTextAttr::operator= (attr); -} - -// Equality test -bool wxTextAttrEx::operator== (const wxTextAttrEx& attr) const -{ - return ( - GetFlags() == attr.GetFlags() && - GetTextColour() == attr.GetTextColour() && - GetBackgroundColour() == attr.GetBackgroundColour() && - GetFont() == attr.GetFont() && - GetTextEffects() == attr.GetTextEffects() && - GetTextEffectFlags() == attr.GetTextEffectFlags() && - GetAlignment() == attr.GetAlignment() && - GetLeftIndent() == attr.GetLeftIndent() && - GetRightIndent() == attr.GetRightIndent() && - GetLeftSubIndent() == attr.GetLeftSubIndent() && - wxRichTextTabsEq(GetTabs(), attr.GetTabs()) && - GetLineSpacing() == attr.GetLineSpacing() && - GetParagraphSpacingAfter() == attr.GetParagraphSpacingAfter() && - GetParagraphSpacingBefore() == attr.GetParagraphSpacingBefore() && - GetBulletStyle() == attr.GetBulletStyle() && - GetBulletNumber() == attr.GetBulletNumber() && - GetBulletText() == attr.GetBulletText() && - GetBulletName() == attr.GetBulletName() && - GetBulletFont() == attr.GetBulletFont() && - GetCharacterStyleName() == attr.GetCharacterStyleName() && - GetParagraphStyleName() == attr.GetParagraphStyleName() && - GetListStyleName() == attr.GetListStyleName() && - GetOutlineLevel() == attr.GetOutlineLevel() && - GetURL() == attr.GetURL()); -} - -wxTextAttrEx wxTextAttrEx::CombineEx(const wxTextAttrEx& attr, - const wxTextAttrEx& attrDef, - const wxTextCtrlBase *text) -{ - wxTextAttrEx newAttr; - - // If attr specifies the complete font, just use that font, overriding all - // default font attributes. - if ((attr.GetFlags() & wxTEXT_ATTR_FONT) == wxTEXT_ATTR_FONT) - newAttr.SetFont(attr.GetFont()); - else - { - // First find the basic, default font - long flags = 0; - - wxFont font; - if (attrDef.HasFont()) - { - flags = (attrDef.GetFlags() & wxTEXT_ATTR_FONT); - font = attrDef.GetFont(); - } - else - { - if (text) - font = text->GetFont(); - - // We leave flags at 0 because no font attributes have been specified yet - } - if (!font.Ok()) - font = *wxNORMAL_FONT; - - // Otherwise, if there are font attributes in attr, apply them - if (attr.GetFlags() & wxTEXT_ATTR_FONT) - { - if (attr.HasFontSize()) - { - flags |= wxTEXT_ATTR_FONT_SIZE; - wxFontSetPointSize(font, attr.GetFont().GetPointSize()); - } - if (attr.HasFontItalic()) - { - flags |= wxTEXT_ATTR_FONT_ITALIC;; - wxFontSetStyle(font, attr.GetFont().GetStyle()); - } - if (attr.HasFontWeight()) - { - flags |= wxTEXT_ATTR_FONT_WEIGHT; - wxFontSetWeight(font, attr.GetFont().GetWeight()); - } - if (attr.HasFontFaceName()) - { - flags |= wxTEXT_ATTR_FONT_FACE; - wxFontSetFaceName(font, attr.GetFont().GetFaceName()); - } - if (attr.HasFontUnderlined()) - { - flags |= wxTEXT_ATTR_FONT_UNDERLINE; - wxFontSetUnderlined(font, attr.GetFont().GetUnderlined()); - } - newAttr.SetFont(font); - newAttr.SetFlags(newAttr.GetFlags()|flags); - } - } - - // TODO: should really check we are specifying these in the flags, - // before setting them, as per above; or we will set them willy-nilly. - // However, we should also check whether this is the intention - // as per wxTextAttr::Combine, i.e. always to have valid colours - // in the style. - wxColour colFg = attr.GetTextColour(); - if ( !colFg.Ok() ) - { - colFg = attrDef.GetTextColour(); - - if ( text && !colFg.Ok() ) - colFg = text->GetForegroundColour(); - } - - wxColour colBg = attr.GetBackgroundColour(); - if ( !colBg.Ok() ) - { - colBg = attrDef.GetBackgroundColour(); - - if ( text && !colBg.Ok() ) - colBg = text->GetBackgroundColour(); - } - - newAttr.SetTextColour(colFg); - newAttr.SetBackgroundColour(colBg); - - if (attr.HasAlignment()) - newAttr.SetAlignment(attr.GetAlignment()); - else if (attrDef.HasAlignment()) - newAttr.SetAlignment(attrDef.GetAlignment()); - - if (attr.HasTabs()) - newAttr.SetTabs(attr.GetTabs()); - else if (attrDef.HasTabs()) - newAttr.SetTabs(attrDef.GetTabs()); - - if (attr.HasLeftIndent()) - newAttr.SetLeftIndent(attr.GetLeftIndent(), attr.GetLeftSubIndent()); - else if (attrDef.HasLeftIndent()) - newAttr.SetLeftIndent(attrDef.GetLeftIndent(), attr.GetLeftSubIndent()); - - if (attr.HasRightIndent()) - newAttr.SetRightIndent(attr.GetRightIndent()); - else if (attrDef.HasRightIndent()) - newAttr.SetRightIndent(attrDef.GetRightIndent()); - - // NEW ATTRIBUTES - - if (attr.HasParagraphSpacingAfter()) - newAttr.SetParagraphSpacingAfter(attr.GetParagraphSpacingAfter()); - - if (attr.HasParagraphSpacingBefore()) - newAttr.SetParagraphSpacingBefore(attr.GetParagraphSpacingBefore()); - - if (attr.HasLineSpacing()) - newAttr.SetLineSpacing(attr.GetLineSpacing()); - - if (attr.HasCharacterStyleName()) - newAttr.SetCharacterStyleName(attr.GetCharacterStyleName()); - - if (attr.HasParagraphStyleName()) - newAttr.SetParagraphStyleName(attr.GetParagraphStyleName()); - - if (attr.HasListStyleName()) - newAttr.SetListStyleName(attr.GetListStyleName()); - - if (attr.HasBulletStyle()) - newAttr.SetBulletStyle(attr.GetBulletStyle()); - - if (attr.HasBulletNumber()) - newAttr.SetBulletNumber(attr.GetBulletNumber()); - - if (attr.HasBulletName()) - newAttr.SetBulletName(attr.GetBulletName()); - - if (attr.HasBulletText()) - { - newAttr.SetBulletText(attr.GetBulletText()); - newAttr.SetBulletFont(attr.GetBulletFont()); - } - - if (attr.HasURL()) - newAttr.SetURL(attr.GetURL()); - - if (attr.HasTextEffects()) - { - newAttr.SetTextEffects(attr.GetTextEffects()); - newAttr.SetTextEffectFlags(attr.GetTextEffectFlags()); - } - - if (attr.HasOutlineLevel()) - newAttr.SetOutlineLevel(attr.GetOutlineLevel()); - - return newAttr; -} - - -/*! - * wxRichTextFileHandler - * Base class for file handlers - */ - -IMPLEMENT_CLASS(wxRichTextFileHandler, wxObject) - -#if wxUSE_STREAMS -bool wxRichTextFileHandler::LoadFile(wxRichTextBuffer *buffer, const wxString& filename) -{ - wxFFileInputStream stream(filename); - if (stream.Ok()) - return LoadFile(buffer, stream); - - return false; -} - -bool wxRichTextFileHandler::SaveFile(wxRichTextBuffer *buffer, const wxString& filename) -{ - wxFFileOutputStream stream(filename); - if (stream.Ok()) - return SaveFile(buffer, stream); - - return false; -} -#endif // wxUSE_STREAMS - -/// Can we handle this filename (if using files)? By default, checks the extension. -bool wxRichTextFileHandler::CanHandle(const wxString& filename) const -{ - wxString path, file, ext; - wxSplitPath(filename, & path, & file, & ext); - - return (ext.Lower() == GetExtension()); -} - -/*! - * wxRichTextTextHandler - * Plain text handler - */ - -IMPLEMENT_CLASS(wxRichTextPlainTextHandler, wxRichTextFileHandler) - -#if wxUSE_STREAMS -bool wxRichTextPlainTextHandler::DoLoadFile(wxRichTextBuffer *buffer, wxInputStream& stream) -{ - if (!stream.IsOk()) - return false; - - wxString str; - int lastCh = 0; - - while (!stream.Eof()) - { - int ch = stream.GetC(); - - if (!stream.Eof()) - { - if (ch == 10 && lastCh != 13) - str += wxT('\n'); - - if (ch > 0 && ch != 10) - str += wxChar(ch); - - lastCh = ch; - } - } - - buffer->ResetAndClearCommands(); - buffer->Clear(); - buffer->AddParagraphs(str); - buffer->UpdateRanges(); - - return true; -} - -bool wxRichTextPlainTextHandler::DoSaveFile(wxRichTextBuffer *buffer, wxOutputStream& stream) -{ - if (!stream.IsOk()) - return false; - - wxString text = buffer->GetText(); - - wxString newLine = wxRichTextLineBreakChar; - text.Replace(newLine, wxT("\n")); - - wxCharBuffer buf = text.ToAscii(); - - stream.Write((const char*) buf, text.length()); - return true; -} -#endif // wxUSE_STREAMS - -/* - * Stores information about an image, in binary in-memory form - */ - -wxRichTextImageBlock::wxRichTextImageBlock() -{ - Init(); -} - -wxRichTextImageBlock::wxRichTextImageBlock(const wxRichTextImageBlock& block):wxObject() -{ - Init(); - Copy(block); -} - -wxRichTextImageBlock::~wxRichTextImageBlock() -{ - if (m_data) - { - delete[] m_data; - m_data = NULL; - } -} - -void wxRichTextImageBlock::Init() -{ - m_data = NULL; - m_dataSize = 0; - m_imageType = -1; -} - -void wxRichTextImageBlock::Clear() -{ - delete[] m_data; - m_data = NULL; - m_dataSize = 0; - m_imageType = -1; -} - - -// Load the original image into a memory block. -// If the image is not a JPEG, we must convert it into a JPEG -// to conserve space. -// If it's not a JPEG we can make use of 'image', already scaled, so we don't have to -// load the image a 2nd time. - -bool wxRichTextImageBlock::MakeImageBlock(const wxString& filename, int imageType, wxImage& image, bool convertToJPEG) -{ - m_imageType = imageType; - - wxString filenameToRead(filename); - bool removeFile = false; - - if (imageType == -1) - return false; // Could not determine image type - - if ((imageType != wxBITMAP_TYPE_JPEG) && convertToJPEG) - { - wxString tempFile; - bool success = wxGetTempFileName(_("image"), tempFile) ; - - wxASSERT(success); - - wxUnusedVar(success); - - image.SaveFile(tempFile, wxBITMAP_TYPE_JPEG); - filenameToRead = tempFile; - removeFile = true; - - m_imageType = wxBITMAP_TYPE_JPEG; - } - wxFile file; - if (!file.Open(filenameToRead)) - return false; - - m_dataSize = (size_t) file.Length(); - file.Close(); - - if (m_data) - delete[] m_data; - m_data = ReadBlock(filenameToRead, m_dataSize); - - if (removeFile) - wxRemoveFile(filenameToRead); - - return (m_data != NULL); -} - -// Make an image block from the wxImage in the given -// format. -bool wxRichTextImageBlock::MakeImageBlock(wxImage& image, int imageType, int quality) -{ - m_imageType = imageType; - image.SetOption(wxT("quality"), quality); - - if (imageType == -1) - return false; // Could not determine image type - - wxString tempFile; - bool success = wxGetTempFileName(_("image"), tempFile) ; - - wxASSERT(success); - wxUnusedVar(success); - - if (!image.SaveFile(tempFile, m_imageType)) - { - if (wxFileExists(tempFile)) - wxRemoveFile(tempFile); - return false; - } - - wxFile file; - if (!file.Open(tempFile)) - return false; - - m_dataSize = (size_t) file.Length(); - file.Close(); - - if (m_data) - delete[] m_data; - m_data = ReadBlock(tempFile, m_dataSize); - - wxRemoveFile(tempFile); - - return (m_data != NULL); -} - - -// Write to a file -bool wxRichTextImageBlock::Write(const wxString& filename) -{ - return WriteBlock(filename, m_data, m_dataSize); -} - -void wxRichTextImageBlock::Copy(const wxRichTextImageBlock& block) -{ - m_imageType = block.m_imageType; - if (m_data) - { - delete[] m_data; - m_data = NULL; - } - m_dataSize = block.m_dataSize; - if (m_dataSize == 0) - return; - - m_data = new unsigned char[m_dataSize]; - unsigned int i; - for (i = 0; i < m_dataSize; i++) - m_data[i] = block.m_data[i]; -} - -//// Operators -void wxRichTextImageBlock::operator=(const wxRichTextImageBlock& block) -{ - Copy(block); -} - -// Load a wxImage from the block -bool wxRichTextImageBlock::Load(wxImage& image) -{ - if (!m_data) - return false; - - // Read in the image. -#if wxUSE_STREAMS - wxMemoryInputStream mstream(m_data, m_dataSize); - bool success = image.LoadFile(mstream, GetImageType()); -#else - wxString tempFile; - bool success = wxGetTempFileName(_("image"), tempFile) ; - wxASSERT(success); - - if (!WriteBlock(tempFile, m_data, m_dataSize)) - { - return false; - } - success = image.LoadFile(tempFile, GetImageType()); - wxRemoveFile(tempFile); -#endif - - return success; -} - -// Array used in DecToHex conversion routine. -static char hexArray[] = "0123456789ABCDEF"; - -// Convert decimal integer to 2-character hex string -inline void wxRichTextDecToHex(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]; -} - -inline int wxRichTextHexToDec(const wxChar* buf) -{ - int firstDigit, secondDigit; - - if (buf[0] >= wxT('A')) - firstDigit = buf[0] - wxT('A') + 10; - else - firstDigit = buf[0] - wxT('0'); - - if (buf[1] >= wxT('A')) - secondDigit = buf[1] - wxT('A') + 10; - else - secondDigit = buf[1] - wxT('0'); - - return (firstDigit & 0xF) * 16 + (secondDigit & 0xF ); -} - - -// Write data in hex to a stream -bool wxRichTextImageBlock::WriteHex(wxOutputStream& stream) -{ - const int bufSize = 512; - char buf[bufSize+1]; - - int left = m_dataSize; - int n, i, j; - j = 0; - while (left > 0) - { - if (left*2 > bufSize) - { - n = bufSize; left -= (bufSize/2); - } - else - { - n = left*2; left = 0; - } - - char* b = buf; - for (i = 0; i < (n/2); i++) - { - wxRichTextDecToHex(m_data[j], b); - b += 2; j ++; - } - - buf[n] = 0; - stream.Write((const char*) buf, n); - } - return true; -} - -// Read data in hex from a stream -bool wxRichTextImageBlock::ReadHex(wxInputStream& stream, int length, int imageType) -{ - int dataSize = length/2; - - if (m_data) - delete[] m_data; - - wxChar str[2]; - m_data = new unsigned char[dataSize]; - int i; - for (i = 0; i < dataSize; i ++) - { - str[0] = stream.GetC(); - str[1] = stream.GetC(); - - m_data[i] = (unsigned char)wxRichTextHexToDec(str); - } - - m_dataSize = dataSize; - m_imageType = imageType; - - return true; -} - -// Allocate and read from stream as a block of memory -unsigned char* wxRichTextImageBlock::ReadBlock(wxInputStream& stream, size_t size) -{ - unsigned char* block = new unsigned char[size]; - if (!block) - return NULL; - - stream.Read(block, size); - - return block; -} - -unsigned char* wxRichTextImageBlock::ReadBlock(const wxString& filename, size_t size) -{ - wxFileInputStream stream(filename); - if (!stream.Ok()) - return NULL; - - return ReadBlock(stream, size); -} - -// Write memory block to stream -bool wxRichTextImageBlock::WriteBlock(wxOutputStream& stream, unsigned char* block, size_t size) -{ - stream.Write((void*) block, size); - return stream.IsOk(); - -} - -// Write memory block to file -bool wxRichTextImageBlock::WriteBlock(const wxString& filename, unsigned char* block, size_t size) -{ - wxFileOutputStream outStream(filename); - if (!outStream.Ok()) - return false; - - return WriteBlock(outStream, block, size); -} - -// Gets the extension for the block's type -wxString wxRichTextImageBlock::GetExtension() const -{ - wxImageHandler* handler = wxImage::FindHandler(GetImageType()); - if (handler) - return handler->GetExtension(); - else - return wxEmptyString; -} - -#if wxUSE_DATAOBJ - -/*! - * The data object for a wxRichTextBuffer - */ - -const wxChar *wxRichTextBufferDataObject::ms_richTextBufferFormatId = wxT("wxShape"); - -wxRichTextBufferDataObject::wxRichTextBufferDataObject(wxRichTextBuffer* richTextBuffer) -{ - m_richTextBuffer = richTextBuffer; - - // this string should uniquely identify our format, but is otherwise - // arbitrary - m_formatRichTextBuffer.SetId(GetRichTextBufferFormatId()); - - SetFormat(m_formatRichTextBuffer); -} - -wxRichTextBufferDataObject::~wxRichTextBufferDataObject() -{ - delete m_richTextBuffer; -} - -// after a call to this function, the richTextBuffer is owned by the caller and it -// is responsible for deleting it! -wxRichTextBuffer* wxRichTextBufferDataObject::GetRichTextBuffer() -{ - wxRichTextBuffer* richTextBuffer = m_richTextBuffer; - m_richTextBuffer = NULL; - - return richTextBuffer; -} - -wxDataFormat wxRichTextBufferDataObject::GetPreferredFormat(Direction WXUNUSED(dir)) const -{ - return m_formatRichTextBuffer; -} - -size_t wxRichTextBufferDataObject::GetDataSize() const -{ - if (!m_richTextBuffer) - return 0; - - wxString bufXML; - - { - wxStringOutputStream stream(& bufXML); - if (!m_richTextBuffer->SaveFile(stream, wxRICHTEXT_TYPE_XML)) - { - wxLogError(wxT("Could not write the buffer to an XML stream.\nYou may have forgotten to add the XML file handler.")); - return 0; - } - } - -#if wxUSE_UNICODE - wxCharBuffer buffer = bufXML.mb_str(wxConvUTF8); - return strlen(buffer) + 1; -#else - return bufXML.Length()+1; -#endif -} - -bool wxRichTextBufferDataObject::GetDataHere(void *pBuf) const -{ - if (!pBuf || !m_richTextBuffer) - return false; - - wxString bufXML; - - { - wxStringOutputStream stream(& bufXML); - if (!m_richTextBuffer->SaveFile(stream, wxRICHTEXT_TYPE_XML)) - { - wxLogError(wxT("Could not write the buffer to an XML stream.\nYou may have forgotten to add the XML file handler.")); - return 0; - } - } - -#if wxUSE_UNICODE - wxCharBuffer buffer = bufXML.mb_str(wxConvUTF8); - size_t len = strlen(buffer); - memcpy((char*) pBuf, (const char*) buffer, len); - ((char*) pBuf)[len] = 0; -#else - size_t len = bufXML.Length(); - memcpy((char*) pBuf, (const char*) bufXML.c_str(), len); - ((char*) pBuf)[len] = 0; -#endif - - return true; -} - -bool wxRichTextBufferDataObject::SetData(size_t WXUNUSED(len), const void *buf) -{ - delete m_richTextBuffer; - m_richTextBuffer = NULL; - - wxString bufXML((const char*) buf, wxConvUTF8); - - m_richTextBuffer = new wxRichTextBuffer; - - wxStringInputStream stream(bufXML); - if (!m_richTextBuffer->LoadFile(stream, wxRICHTEXT_TYPE_XML)) - { - wxLogError(wxT("Could not read the buffer from an XML stream.\nYou may have forgotten to add the XML file handler.")); - - delete m_richTextBuffer; - m_richTextBuffer = NULL; - - return false; - } - return true; -} - -#endif - // wxUSE_DATAOBJ - -#endif - // wxUSE_RICHTEXT diff --git a/wxWidgets/src/richtext/richtextbulletspage.cpp b/wxWidgets/src/richtext/richtextbulletspage.cpp deleted file mode 100644 index bba4172742..0000000000 --- a/wxWidgets/src/richtext/richtextbulletspage.cpp +++ /dev/null @@ -1,964 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/richtext/richtextbulletspage.cpp -// Purpose: -// Author: Julian Smart -// Modified by: -// Created: 10/4/2006 10:32:31 AM -// RCS-ID: $Id: richtextbulletspage.cpp 66266 2010-11-26 16:31:44Z JS $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#if wxUSE_RICHTEXT - -#include "wx/spinctrl.h" -#include "wx/richtext/richtextbulletspage.h" -#include "wx/richtext/richtextsymboldlg.h" -#include "wx/utils.h" - -/*! - * wxRichTextBulletsPage type definition - */ - -IMPLEMENT_DYNAMIC_CLASS( wxRichTextBulletsPage, wxPanel ) - -/*! - * wxRichTextBulletsPage event table definition - */ - -BEGIN_EVENT_TABLE( wxRichTextBulletsPage, wxPanel ) - -////@begin wxRichTextBulletsPage event table entries - EVT_LISTBOX( ID_RICHTEXTBULLETSPAGE_STYLELISTBOX, wxRichTextBulletsPage::OnStylelistboxSelected ) - - EVT_CHECKBOX( ID_RICHTEXTBULLETSPAGE_PERIODCTRL, wxRichTextBulletsPage::OnPeriodctrlClick ) - EVT_UPDATE_UI( ID_RICHTEXTBULLETSPAGE_PERIODCTRL, wxRichTextBulletsPage::OnPeriodctrlUpdate ) - - EVT_CHECKBOX( ID_RICHTEXTBULLETSPAGE_PARENTHESESCTRL, wxRichTextBulletsPage::OnParenthesesctrlClick ) - EVT_UPDATE_UI( ID_RICHTEXTBULLETSPAGE_PARENTHESESCTRL, wxRichTextBulletsPage::OnParenthesesctrlUpdate ) - - EVT_CHECKBOX( ID_RICHTEXTBULLETSPAGE_RIGHTPARENTHESISCTRL, wxRichTextBulletsPage::OnRightParenthesisCtrlClick ) - EVT_UPDATE_UI( ID_RICHTEXTBULLETSPAGE_RIGHTPARENTHESISCTRL, wxRichTextBulletsPage::OnRightParenthesisCtrlUpdate ) - - EVT_COMBOBOX( ID_RICHTEXTBULLETSPAGE_BULLETALIGNMENTCTRL, wxRichTextBulletsPage::OnBulletAlignmentCtrlSelected ) - - EVT_UPDATE_UI( ID_RICHTEXTBULLETSPAGE_SYMBOLSTATIC, wxRichTextBulletsPage::OnSymbolstaticUpdate ) - - EVT_COMBOBOX( ID_RICHTEXTBULLETSPAGE_SYMBOLCTRL, wxRichTextBulletsPage::OnSymbolctrlSelected ) - EVT_TEXT( ID_RICHTEXTBULLETSPAGE_SYMBOLCTRL, wxRichTextBulletsPage::OnSymbolctrlUpdated ) - EVT_UPDATE_UI( ID_RICHTEXTBULLETSPAGE_SYMBOLCTRL, wxRichTextBulletsPage::OnSymbolctrlUpdate ) - - EVT_BUTTON( ID_RICHTEXTBULLETSPAGE_CHOOSE_SYMBOL, wxRichTextBulletsPage::OnChooseSymbolClick ) - EVT_UPDATE_UI( ID_RICHTEXTBULLETSPAGE_CHOOSE_SYMBOL, wxRichTextBulletsPage::OnChooseSymbolUpdate ) - - EVT_COMBOBOX( ID_RICHTEXTBULLETSPAGE_SYMBOLFONTCTRL, wxRichTextBulletsPage::OnSymbolfontctrlSelected ) - EVT_TEXT( ID_RICHTEXTBULLETSPAGE_SYMBOLFONTCTRL, wxRichTextBulletsPage::OnSymbolfontctrlUpdated ) - EVT_UPDATE_UI( ID_RICHTEXTBULLETSPAGE_SYMBOLFONTCTRL, wxRichTextBulletsPage::OnSymbolfontctrlUIUpdate ) - - EVT_UPDATE_UI( ID_RICHTEXTBULLETSPAGE_NAMESTATIC, wxRichTextBulletsPage::OnNamestaticUpdate ) - - EVT_COMBOBOX( ID_RICHTEXTBULLETSPAGE_NAMECTRL, wxRichTextBulletsPage::OnNamectrlSelected ) - EVT_TEXT( ID_RICHTEXTBULLETSPAGE_NAMECTRL, wxRichTextBulletsPage::OnNamectrlUpdated ) - EVT_UPDATE_UI( ID_RICHTEXTBULLETSPAGE_NAMECTRL, wxRichTextBulletsPage::OnNamectrlUIUpdate ) - - EVT_UPDATE_UI( ID_RICHTEXTBULLETSPAGE_NUMBERSTATIC, wxRichTextBulletsPage::OnNumberstaticUpdate ) - - EVT_SPINCTRL( ID_RICHTEXTBULLETSPAGE_NUMBERCTRL, wxRichTextBulletsPage::OnNumberctrlUpdated ) - EVT_SPIN_UP( ID_RICHTEXTBULLETSPAGE_NUMBERCTRL, wxRichTextBulletsPage::OnNumberctrlUp ) - EVT_SPIN_DOWN( ID_RICHTEXTBULLETSPAGE_NUMBERCTRL, wxRichTextBulletsPage::OnNumberctrlDown ) - EVT_TEXT( ID_RICHTEXTBULLETSPAGE_NUMBERCTRL, wxRichTextBulletsPage::OnNumberctrlTextUpdated ) - EVT_UPDATE_UI( ID_RICHTEXTBULLETSPAGE_NUMBERCTRL, wxRichTextBulletsPage::OnNumberctrlUpdate ) - -////@end wxRichTextBulletsPage event table entries - -END_EVENT_TABLE() - -/*! - * wxRichTextBulletsPage constructors - */ - -wxRichTextBulletsPage::wxRichTextBulletsPage( ) -{ - Init(); -} - -wxRichTextBulletsPage::wxRichTextBulletsPage( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style ) -{ - Init(); - Create(parent, id, pos, size, style); -} - -/*! - * Initialise members - */ - -void wxRichTextBulletsPage::Init() -{ - m_hasBulletStyle = false; - m_hasBulletNumber = false; - m_hasBulletSymbol = false; - m_dontUpdate = false; - -////@begin wxRichTextBulletsPage member initialisation - m_styleListBox = NULL; - m_periodCtrl = NULL; - m_parenthesesCtrl = NULL; - m_rightParenthesisCtrl = NULL; - m_bulletAlignmentCtrl = NULL; - m_symbolCtrl = NULL; - m_symbolFontCtrl = NULL; - m_bulletNameCtrl = NULL; - m_numberCtrl = NULL; - m_previewCtrl = NULL; -////@end wxRichTextBulletsPage member initialisation -} - -/*! - * wxRichTextBulletsPage creator - */ - -bool wxRichTextBulletsPage::Create( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style ) -{ -////@begin wxRichTextBulletsPage creation - wxPanel::Create( parent, id, pos, size, style ); - - CreateControls(); - if (GetSizer()) - { - GetSizer()->SetSizeHints(this); - } - Centre(); -////@end wxRichTextBulletsPage creation - return true; -} - -/*! - * Control creation for wxRichTextBulletsPage - */ - -void wxRichTextBulletsPage::CreateControls() -{ -////@begin wxRichTextBulletsPage content construction - wxRichTextBulletsPage* itemPanel1 = this; - - wxBoxSizer* itemBoxSizer2 = new wxBoxSizer(wxVERTICAL); - itemPanel1->SetSizer(itemBoxSizer2); - - wxBoxSizer* itemBoxSizer3 = new wxBoxSizer(wxVERTICAL); - itemBoxSizer2->Add(itemBoxSizer3, 1, wxGROW|wxALL, 5); - - wxBoxSizer* itemBoxSizer4 = new wxBoxSizer(wxHORIZONTAL); - itemBoxSizer3->Add(itemBoxSizer4, 0, wxGROW, 5); - - wxBoxSizer* itemBoxSizer5 = new wxBoxSizer(wxVERTICAL); - itemBoxSizer4->Add(itemBoxSizer5, 0, wxGROW, 5); - - wxStaticText* itemStaticText6 = new wxStaticText( itemPanel1, wxID_STATIC, _("&Bullet style:"), wxDefaultPosition, wxDefaultSize, 0 ); - itemBoxSizer5->Add(itemStaticText6, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP|wxADJUST_MINSIZE, 5); - - wxArrayString m_styleListBoxStrings; - m_styleListBox = new wxListBox( itemPanel1, ID_RICHTEXTBULLETSPAGE_STYLELISTBOX, wxDefaultPosition, wxSize(-1, 90), m_styleListBoxStrings, wxLB_SINGLE ); - m_styleListBox->SetHelpText(_("The available bullet styles.")); - if (wxRichTextBulletsPage::ShowToolTips()) - m_styleListBox->SetToolTip(_("The available bullet styles.")); - itemBoxSizer5->Add(m_styleListBox, 1, wxGROW|wxALL, 5); - - wxBoxSizer* itemBoxSizer8 = new wxBoxSizer(wxHORIZONTAL); - itemBoxSizer5->Add(itemBoxSizer8, 0, wxGROW, 5); - - m_periodCtrl = new wxCheckBox( itemPanel1, ID_RICHTEXTBULLETSPAGE_PERIODCTRL, _("Peri&od"), wxDefaultPosition, wxDefaultSize, 0 ); - m_periodCtrl->SetValue(false); - m_periodCtrl->SetHelpText(_("Check to add a period after the bullet.")); - if (wxRichTextBulletsPage::ShowToolTips()) - m_periodCtrl->SetToolTip(_("Check to add a period after the bullet.")); - itemBoxSizer8->Add(m_periodCtrl, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); - - m_parenthesesCtrl = new wxCheckBox( itemPanel1, ID_RICHTEXTBULLETSPAGE_PARENTHESESCTRL, _("(*)"), wxDefaultPosition, wxDefaultSize, 0 ); - m_parenthesesCtrl->SetValue(false); - m_parenthesesCtrl->SetHelpText(_("Check to enclose the bullet in parentheses.")); - if (wxRichTextBulletsPage::ShowToolTips()) - m_parenthesesCtrl->SetToolTip(_("Check to enclose the bullet in parentheses.")); - itemBoxSizer8->Add(m_parenthesesCtrl, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); - - m_rightParenthesisCtrl = new wxCheckBox( itemPanel1, ID_RICHTEXTBULLETSPAGE_RIGHTPARENTHESISCTRL, _("*)"), wxDefaultPosition, wxDefaultSize, 0 ); - m_rightParenthesisCtrl->SetValue(false); - m_rightParenthesisCtrl->SetHelpText(_("Check to add a right parenthesis.")); - if (wxRichTextBulletsPage::ShowToolTips()) - m_rightParenthesisCtrl->SetToolTip(_("Check to add a right parenthesis.")); - itemBoxSizer8->Add(m_rightParenthesisCtrl, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); - - itemBoxSizer5->Add(5, 5, 0, wxALIGN_CENTER_HORIZONTAL, 5); - - wxStaticText* itemStaticText13 = new wxStaticText( itemPanel1, wxID_STATIC, _("Bullet &Alignment:"), wxDefaultPosition, wxDefaultSize, 0 ); - itemBoxSizer5->Add(itemStaticText13, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP|wxADJUST_MINSIZE, 5); - - wxArrayString m_bulletAlignmentCtrlStrings; - m_bulletAlignmentCtrlStrings.Add(_("Left")); - m_bulletAlignmentCtrlStrings.Add(_("Centre")); - m_bulletAlignmentCtrlStrings.Add(_("Right")); - m_bulletAlignmentCtrl = new wxComboBox( itemPanel1, ID_RICHTEXTBULLETSPAGE_BULLETALIGNMENTCTRL, _("Left"), wxDefaultPosition, wxSize(60, -1), m_bulletAlignmentCtrlStrings, wxCB_READONLY ); - m_bulletAlignmentCtrl->SetStringSelection(_("Left")); - m_bulletAlignmentCtrl->SetHelpText(_("The bullet character.")); - if (wxRichTextBulletsPage::ShowToolTips()) - m_bulletAlignmentCtrl->SetToolTip(_("The bullet character.")); - itemBoxSizer5->Add(m_bulletAlignmentCtrl, 0, wxGROW|wxALL|wxFIXED_MINSIZE, 5); - - itemBoxSizer4->Add(2, 1, 1, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM, 5); - - wxStaticLine* itemStaticLine16 = new wxStaticLine( itemPanel1, wxID_STATIC, wxDefaultPosition, wxDefaultSize, wxLI_VERTICAL ); - itemBoxSizer4->Add(itemStaticLine16, 0, wxGROW|wxLEFT|wxRIGHT, 5); - - itemBoxSizer4->Add(2, 1, 1, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM, 5); - - wxBoxSizer* itemBoxSizer18 = new wxBoxSizer(wxVERTICAL); - itemBoxSizer4->Add(itemBoxSizer18, 0, wxGROW, 5); - - wxBoxSizer* itemBoxSizer19 = new wxBoxSizer(wxHORIZONTAL); - itemBoxSizer18->Add(itemBoxSizer19, 0, wxGROW, 5); - - wxStaticText* itemStaticText20 = new wxStaticText( itemPanel1, ID_RICHTEXTBULLETSPAGE_SYMBOLSTATIC, _("&Symbol:"), wxDefaultPosition, wxDefaultSize, 0 ); - itemBoxSizer19->Add(itemStaticText20, 0, wxALIGN_CENTER_VERTICAL|wxALL|wxADJUST_MINSIZE, 5); - - wxArrayString m_symbolCtrlStrings; - m_symbolCtrl = new wxComboBox( itemPanel1, ID_RICHTEXTBULLETSPAGE_SYMBOLCTRL, _T(""), wxDefaultPosition, wxSize(60, -1), m_symbolCtrlStrings, wxCB_DROPDOWN ); - m_symbolCtrl->SetHelpText(_("The bullet character.")); - if (wxRichTextBulletsPage::ShowToolTips()) - m_symbolCtrl->SetToolTip(_("The bullet character.")); - itemBoxSizer19->Add(m_symbolCtrl, 0, wxALIGN_CENTER_VERTICAL|wxALL|wxFIXED_MINSIZE, 5); - - wxButton* itemButton22 = new wxButton( itemPanel1, ID_RICHTEXTBULLETSPAGE_CHOOSE_SYMBOL, _("Ch&oose..."), wxDefaultPosition, wxDefaultSize, 0 ); - itemButton22->SetHelpText(_("Click to browse for a symbol.")); - if (wxRichTextBulletsPage::ShowToolTips()) - itemButton22->SetToolTip(_("Click to browse for a symbol.")); - itemBoxSizer19->Add(itemButton22, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); - - itemBoxSizer18->Add(5, 5, 0, wxALIGN_CENTER_HORIZONTAL, 5); - - wxStaticText* itemStaticText24 = new wxStaticText( itemPanel1, ID_RICHTEXTBULLETSPAGE_SYMBOLSTATIC, _("Symbol &font:"), wxDefaultPosition, wxDefaultSize, 0 ); - itemBoxSizer18->Add(itemStaticText24, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP|wxADJUST_MINSIZE, 5); - - wxArrayString m_symbolFontCtrlStrings; - m_symbolFontCtrl = new wxComboBox( itemPanel1, ID_RICHTEXTBULLETSPAGE_SYMBOLFONTCTRL, _T(""), wxDefaultPosition, wxDefaultSize, m_symbolFontCtrlStrings, wxCB_DROPDOWN ); - m_symbolFontCtrl->SetHelpText(_("Available fonts.")); - if (wxRichTextBulletsPage::ShowToolTips()) - m_symbolFontCtrl->SetToolTip(_("Available fonts.")); - itemBoxSizer18->Add(m_symbolFontCtrl, 0, wxGROW|wxALL, 5); - - itemBoxSizer18->Add(5, 5, 1, wxALIGN_CENTER_HORIZONTAL, 5); - - wxStaticText* itemStaticText27 = new wxStaticText( itemPanel1, ID_RICHTEXTBULLETSPAGE_NAMESTATIC, _("S&tandard bullet name:"), wxDefaultPosition, wxDefaultSize, 0 ); - itemBoxSizer18->Add(itemStaticText27, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP|wxADJUST_MINSIZE, 5); - - wxArrayString m_bulletNameCtrlStrings; - m_bulletNameCtrl = new wxComboBox( itemPanel1, ID_RICHTEXTBULLETSPAGE_NAMECTRL, _T(""), wxDefaultPosition, wxDefaultSize, m_bulletNameCtrlStrings, wxCB_DROPDOWN ); - m_bulletNameCtrl->SetHelpText(_("A standard bullet name.")); - if (wxRichTextBulletsPage::ShowToolTips()) - m_bulletNameCtrl->SetToolTip(_("A standard bullet name.")); - itemBoxSizer18->Add(m_bulletNameCtrl, 0, wxGROW|wxALL, 5); - - itemBoxSizer18->Add(5, 5, 1, wxALIGN_CENTER_HORIZONTAL, 5); - - wxStaticText* itemStaticText30 = new wxStaticText( itemPanel1, ID_RICHTEXTBULLETSPAGE_NUMBERSTATIC, _("&Number:"), wxDefaultPosition, wxDefaultSize, 0 ); - itemBoxSizer18->Add(itemStaticText30, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP|wxADJUST_MINSIZE, 5); - - m_numberCtrl = new wxSpinCtrl( itemPanel1, ID_RICHTEXTBULLETSPAGE_NUMBERCTRL, _T("0"), wxDefaultPosition, wxSize(50, -1), wxSP_ARROW_KEYS, 0, 100000, 0 ); - m_numberCtrl->SetHelpText(_("The list item number.")); - if (wxRichTextBulletsPage::ShowToolTips()) - m_numberCtrl->SetToolTip(_("The list item number.")); - itemBoxSizer18->Add(m_numberCtrl, 0, wxGROW|wxALL, 5); - - itemBoxSizer3->Add(5, 5, 0, wxALIGN_CENTER_HORIZONTAL, 5); - - m_previewCtrl = new wxRichTextCtrl( itemPanel1, ID_RICHTEXTBULLETSPAGE_PREVIEW_CTRL, wxEmptyString, wxDefaultPosition, wxSize(350, 100), wxVSCROLL|wxTE_READONLY ); - m_previewCtrl->SetHelpText(_("Shows a preview of the bullet settings.")); - if (wxRichTextBulletsPage::ShowToolTips()) - m_previewCtrl->SetToolTip(_("Shows a preview of the bullet settings.")); - itemBoxSizer3->Add(m_previewCtrl, 1, wxGROW|wxALL, 5); - -////@end wxRichTextBulletsPage content construction - - if (wxGetDisplaySize().y < 600) - m_previewCtrl->SetMinSize(wxSize(350, 50)); - - m_styleListBox->Append(_("(None)")); - m_styleListBox->Append(_("Arabic")); - m_styleListBox->Append(_("Upper case letters")); - m_styleListBox->Append(_("Lower case letters")); - m_styleListBox->Append(_("Upper case roman numerals")); - m_styleListBox->Append(_("Lower case roman numerals")); - m_styleListBox->Append(_("Numbered outline")); - m_styleListBox->Append(_("Symbol")); - m_styleListBox->Append(_("Bitmap")); - m_styleListBox->Append(_("Standard")); - - m_symbolCtrl->Append(_("*")); - m_symbolCtrl->Append(_("-")); - m_symbolCtrl->Append(_(">")); - m_symbolCtrl->Append(_("+")); - m_symbolCtrl->Append(_("~")); - - wxArrayString standardBulletNames; - if (wxRichTextBuffer::GetRenderer()) - wxRichTextBuffer::GetRenderer()->EnumerateStandardBulletNames(standardBulletNames); - - size_t i; - for (i = 0; i < standardBulletNames.GetCount(); i++) - m_bulletNameCtrl->Append(wxGetTranslation(standardBulletNames[i])); - - wxArrayString facenames = wxRichTextCtrl::GetAvailableFontNames(); - facenames.Sort(); - - m_symbolFontCtrl->Append(facenames); -} - -/// Transfer data from/to window -bool wxRichTextBulletsPage::TransferDataFromWindow() -{ - wxPanel::TransferDataFromWindow(); - - wxTextAttrEx* attr = GetAttributes(); - - int index = m_styleListBox->GetSelection(); - if (index < 1) - { - m_hasBulletStyle = false; - m_hasBulletNumber = false; - m_hasBulletSymbol = false; - attr->SetBulletStyle(wxTEXT_ATTR_BULLET_STYLE_NONE); - attr->SetFlags(attr->GetFlags() & ~(wxTEXT_ATTR_BULLET_STYLE|wxTEXT_ATTR_BULLET_NUMBER|wxTEXT_ATTR_BULLET_TEXT|wxTEXT_ATTR_BULLET_NAME)); - } - else - { - m_hasBulletStyle = true; - } - - if (m_hasBulletStyle) - { - long bulletStyle = wxRICHTEXT_BULLETINDEX_NONE; - - if (index == wxRICHTEXT_BULLETINDEX_ARABIC) - bulletStyle |= wxTEXT_ATTR_BULLET_STYLE_ARABIC; - - else if (index == wxRICHTEXT_BULLETINDEX_UPPER_CASE) - bulletStyle |= wxTEXT_ATTR_BULLET_STYLE_LETTERS_UPPER; - - else if (index == wxRICHTEXT_BULLETINDEX_LOWER_CASE) - bulletStyle |= wxTEXT_ATTR_BULLET_STYLE_LETTERS_LOWER; - - else if (index == wxRICHTEXT_BULLETINDEX_UPPER_CASE_ROMAN) - bulletStyle |= wxTEXT_ATTR_BULLET_STYLE_ROMAN_UPPER; - - else if (index == wxRICHTEXT_BULLETINDEX_LOWER_CASE_ROMAN) - bulletStyle |= wxTEXT_ATTR_BULLET_STYLE_ROMAN_LOWER; - - else if (index == wxRICHTEXT_BULLETINDEX_OUTLINE) - bulletStyle |= wxTEXT_ATTR_BULLET_STYLE_OUTLINE; - - else if (index == wxRICHTEXT_BULLETINDEX_SYMBOL) - bulletStyle |= wxTEXT_ATTR_BULLET_STYLE_SYMBOL; - - else if (index == wxRICHTEXT_BULLETINDEX_BITMAP) - bulletStyle |= wxTEXT_ATTR_BULLET_STYLE_BITMAP; - - else if (index == wxRICHTEXT_BULLETINDEX_STANDARD) - { - bulletStyle |= wxTEXT_ATTR_BULLET_STYLE_STANDARD; - wxArrayString standardBulletNames; - if (wxRichTextBuffer::GetRenderer() && m_bulletNameCtrl->GetSelection() != wxNOT_FOUND) - { - int sel = m_bulletNameCtrl->GetSelection(); - wxString selName = m_bulletNameCtrl->GetString(sel); - - // Try to get the untranslated name using the current selection index of the combobox. - // into account. - wxRichTextBuffer::GetRenderer()->EnumerateStandardBulletNames(standardBulletNames); - if (sel < (int) standardBulletNames.GetCount() && m_bulletNameCtrl->GetValue() == selName) - attr->SetBulletName(standardBulletNames[sel]); - else - attr->SetBulletName(m_bulletNameCtrl->GetValue()); - } - else - attr->SetBulletName(m_bulletNameCtrl->GetValue()); - } - - if (m_parenthesesCtrl->GetValue()) - bulletStyle |= wxTEXT_ATTR_BULLET_STYLE_PARENTHESES; - if (m_rightParenthesisCtrl->GetValue()) - bulletStyle |= wxTEXT_ATTR_BULLET_STYLE_RIGHT_PARENTHESIS; - if (m_periodCtrl->GetValue()) - bulletStyle |= wxTEXT_ATTR_BULLET_STYLE_PERIOD; - - if (m_bulletAlignmentCtrl->GetSelection() == 1) - bulletStyle |= wxTEXT_ATTR_BULLET_STYLE_ALIGN_CENTRE; - else if (m_bulletAlignmentCtrl->GetSelection() == 2) - bulletStyle |= wxTEXT_ATTR_BULLET_STYLE_ALIGN_RIGHT; - // Left is implied - - attr->SetBulletStyle(bulletStyle); - } - - if (m_hasBulletNumber) - { - attr->SetBulletNumber(m_numberCtrl->GetValue()); - } - - if (m_hasBulletSymbol) - { - attr->SetBulletText(m_symbolCtrl->GetValue()); - attr->SetBulletFont(m_symbolFontCtrl->GetValue()); - } - - return true; -} - -bool wxRichTextBulletsPage::TransferDataToWindow() -{ - m_dontUpdate = true; - - wxPanel::TransferDataToWindow(); - - wxTextAttrEx* attr = GetAttributes(); - - if (attr->HasBulletStyle()) - { - m_hasBulletStyle = true; - int index = wxRICHTEXT_BULLETINDEX_NONE; - - if (attr->GetBulletStyle() & wxTEXT_ATTR_BULLET_STYLE_ARABIC) - index = wxRICHTEXT_BULLETINDEX_ARABIC; - - else if (attr->GetBulletStyle() & wxTEXT_ATTR_BULLET_STYLE_LETTERS_UPPER) - index = wxRICHTEXT_BULLETINDEX_UPPER_CASE; - - else if (attr->GetBulletStyle() & wxTEXT_ATTR_BULLET_STYLE_LETTERS_LOWER) - index = wxRICHTEXT_BULLETINDEX_LOWER_CASE; - - else if (attr->GetBulletStyle() & wxTEXT_ATTR_BULLET_STYLE_ROMAN_UPPER) - index = wxRICHTEXT_BULLETINDEX_UPPER_CASE_ROMAN; - - else if (attr->GetBulletStyle() & wxTEXT_ATTR_BULLET_STYLE_ROMAN_LOWER) - index = wxRICHTEXT_BULLETINDEX_LOWER_CASE_ROMAN; - - else if (attr->GetBulletStyle() & wxTEXT_ATTR_BULLET_STYLE_OUTLINE) - index = wxRICHTEXT_BULLETINDEX_OUTLINE; - - else if (attr->GetBulletStyle() & wxTEXT_ATTR_BULLET_STYLE_SYMBOL) - index = wxRICHTEXT_BULLETINDEX_SYMBOL; - - else if (attr->GetBulletStyle() & wxTEXT_ATTR_BULLET_STYLE_BITMAP) - index = wxRICHTEXT_BULLETINDEX_BITMAP; - - else if (attr->GetBulletStyle() & wxTEXT_ATTR_BULLET_STYLE_STANDARD) - index = wxRICHTEXT_BULLETINDEX_STANDARD; - - m_styleListBox->SetSelection(index); - - if (attr->GetBulletStyle() & wxTEXT_ATTR_BULLET_STYLE_PARENTHESES) - m_parenthesesCtrl->SetValue(true); - else - m_parenthesesCtrl->SetValue(false); - - if (attr->GetBulletStyle() & wxTEXT_ATTR_BULLET_STYLE_RIGHT_PARENTHESIS) - m_rightParenthesisCtrl->SetValue(true); - else - m_rightParenthesisCtrl->SetValue(false); - - if (attr->GetBulletStyle() & wxTEXT_ATTR_BULLET_STYLE_PERIOD) - m_periodCtrl->SetValue(true); - else - m_periodCtrl->SetValue(false); - - if (attr->GetBulletStyle() & wxTEXT_ATTR_BULLET_STYLE_ALIGN_CENTRE) - m_bulletAlignmentCtrl->SetSelection(1); - else if (attr->GetBulletStyle() & wxTEXT_ATTR_BULLET_STYLE_ALIGN_RIGHT) - m_bulletAlignmentCtrl->SetSelection(2); - else - m_bulletAlignmentCtrl->SetSelection(0); - } - else - { - m_hasBulletStyle = false; - m_styleListBox->SetSelection(-1); - m_bulletAlignmentCtrl->SetSelection(-1); - } - - if (attr->HasBulletText()) - { - m_symbolCtrl->SetValue(attr->GetBulletText()); - m_symbolFontCtrl->SetValue(attr->GetBulletFont()); - } - else - m_symbolCtrl->SetValue(wxEmptyString); - - if (attr->HasBulletNumber()) - m_numberCtrl->SetValue(attr->GetBulletNumber()); - else - m_numberCtrl->SetValue(0); - - if (attr->HasBulletName()) - { - wxArrayString standardBulletNames; - if (wxRichTextBuffer::GetRenderer()) - { - // Try to set the control by index in order to take translated combo control strings - // into account. - wxRichTextBuffer::GetRenderer()->EnumerateStandardBulletNames(standardBulletNames); - int idx = standardBulletNames.Index(attr->GetBulletName()); - if (idx != -1 && idx < (int) m_bulletNameCtrl->GetCount()) - m_bulletNameCtrl->SetSelection(idx); - else - m_bulletNameCtrl->SetValue(attr->GetBulletName()); - } - else - m_bulletNameCtrl->SetValue(attr->GetBulletName()); - } - else - m_bulletNameCtrl->SetValue(wxEmptyString); - - UpdatePreview(); - - m_dontUpdate = false; - - return true; -} - -/// Updates the bullet preview -void wxRichTextBulletsPage::UpdatePreview() -{ - static const wxChar* s_para1 = wxT("Lorem ipsum dolor sit amet, consectetuer adipiscing elit. \ -Nullam ante sapien, vestibulum nonummy, pulvinar sed, luctus ut, lacus.\n"); - - static const wxChar* s_para2 = wxT("Duis pharetra consequat dui. Cum sociis natoque penatibus \ -et magnis dis parturient montes, nascetur ridiculus mus. Nullam vitae justo id mauris lobortis interdum.\n"); - - static const wxChar* s_para3 = wxT("Integer convallis dolor at augue \ -iaculis malesuada. Donec bibendum ipsum ut ante porta fringilla.\n"); - - TransferDataFromWindow(); - wxTextAttrEx attr(*GetAttributes()); - attr.SetFlags(attr.GetFlags() & - (wxTEXT_ATTR_BULLET_STYLE|wxTEXT_ATTR_BULLET_NUMBER|wxTEXT_ATTR_BULLET_TEXT|wxTEXT_ATTR_BULLET_NAME| - wxTEXT_ATTR_ALIGNMENT|wxTEXT_ATTR_LEFT_INDENT|wxTEXT_ATTR_RIGHT_INDENT|wxTEXT_ATTR_PARA_SPACING_BEFORE|wxTEXT_ATTR_PARA_SPACING_AFTER| - wxTEXT_ATTR_LINE_SPACING)); - - wxFont font(m_previewCtrl->GetFont()); - font.SetPointSize(9); - m_previewCtrl->SetFont(font); - - wxTextAttrEx normalParaAttr; - normalParaAttr.SetFont(font); - normalParaAttr.SetTextColour(wxColour(wxT("LIGHT GREY"))); - - m_previewCtrl->Freeze(); - m_previewCtrl->Clear(); - - m_previewCtrl->BeginStyle(normalParaAttr); - m_previewCtrl->WriteText(s_para1); - m_previewCtrl->EndStyle(); - - m_previewCtrl->BeginStyle(attr); - m_previewCtrl->WriteText(s_para2); - m_previewCtrl->EndStyle(); - - m_previewCtrl->BeginStyle(normalParaAttr); - m_previewCtrl->WriteText(s_para3); - m_previewCtrl->EndStyle(); - - m_previewCtrl->NumberList(wxRichTextRange(0, m_previewCtrl->GetLastPosition()+1)); - - m_previewCtrl->Thaw(); -} - -wxTextAttrEx* wxRichTextBulletsPage::GetAttributes() -{ - return wxRichTextFormattingDialog::GetDialogAttributes(this); -} - -/*! - * Should we show tooltips? - */ - -bool wxRichTextBulletsPage::ShowToolTips() -{ - return wxRichTextFormattingDialog::ShowToolTips(); -} - -/*! - * Get bitmap resources - */ - -wxBitmap wxRichTextBulletsPage::GetBitmapResource( const wxString& name ) -{ - // Bitmap retrieval -////@begin wxRichTextBulletsPage bitmap retrieval - wxUnusedVar(name); - return wxNullBitmap; -////@end wxRichTextBulletsPage bitmap retrieval -} - -/*! - * Get icon resources - */ - -wxIcon wxRichTextBulletsPage::GetIconResource( const wxString& name ) -{ - // Icon retrieval -////@begin wxRichTextBulletsPage icon retrieval - wxUnusedVar(name); - return wxNullIcon; -////@end wxRichTextBulletsPage icon retrieval -} - -/*! - * wxEVT_COMMAND_LISTBOX_SELECTED event handler for ID_RICHTEXTBULLETSPAGE_STYLELISTBOX - */ - -void wxRichTextBulletsPage::OnStylelistboxSelected( wxCommandEvent& WXUNUSED(event) ) -{ - if (!m_dontUpdate) - { - m_hasBulletStyle = true; - - if (m_styleListBox->GetSelection() == wxRICHTEXT_BULLETINDEX_SYMBOL) - m_hasBulletSymbol = true; - - UpdatePreview(); - } -} - -/*! - * wxEVT_COMMAND_COMBOBOX_SELECTED event handler for ID_RICHTEXTBULLETSPAGE_SYMBOLCTRL - */ - -void wxRichTextBulletsPage::OnSymbolctrlSelected( wxCommandEvent& WXUNUSED(event) ) -{ - if (!m_dontUpdate) - { - m_hasBulletSymbol = true; - UpdatePreview(); - } -} - -/*! - * wxEVT_COMMAND_TEXT_UPDATED event handler for ID_RICHTEXTBULLETSPAGE_SYMBOLCTRL - */ - -void wxRichTextBulletsPage::OnSymbolctrlUpdated( wxCommandEvent& WXUNUSED(event) ) -{ - if (!m_dontUpdate) - { - m_hasBulletSymbol = true; - UpdatePreview(); - } -} - -/*! - * wxEVT_UPDATE_UI event handler for ID_RICHTEXTBULLETSPAGE_SYMBOLCTRL - */ - -void wxRichTextBulletsPage::OnSymbolctrlUpdate( wxUpdateUIEvent& event ) -{ - OnSymbolUpdate(event); -} - -/*! - * wxEVT_COMMAND_SPINCTRL_UPDATED event handler for ID_RICHTEXTBULLETSPAGE_NUMBERCTRL - */ - -void wxRichTextBulletsPage::OnNumberctrlUpdated( wxSpinEvent& WXUNUSED(event) ) -{ - if (!m_dontUpdate) - { - m_hasBulletNumber = true; - UpdatePreview(); - } -} - -/*! - * wxEVT_SCROLL_LINEUP event handler for ID_RICHTEXTBULLETSPAGE_NUMBERCTRL - */ - -void wxRichTextBulletsPage::OnNumberctrlUp( wxSpinEvent& WXUNUSED(event) ) -{ - if (!m_dontUpdate) - { - m_hasBulletNumber = true; - UpdatePreview(); - } -} - -/*! - * wxEVT_SCROLL_LINEDOWN event handler for ID_RICHTEXTBULLETSPAGE_NUMBERCTRL - */ - -void wxRichTextBulletsPage::OnNumberctrlDown( wxSpinEvent& WXUNUSED(event) ) -{ - if (!m_dontUpdate) - { - m_hasBulletNumber = true; - UpdatePreview(); - } -} - -/*! - * wxEVT_COMMAND_TEXT_UPDATED event handler for ID_RICHTEXTBULLETSPAGE_NUMBERCTRL - */ - -void wxRichTextBulletsPage::OnNumberctrlTextUpdated( wxCommandEvent& WXUNUSED(event) ) -{ - if (!m_dontUpdate) - { - m_hasBulletNumber = true; - UpdatePreview(); - } -} - -/*! - * wxEVT_UPDATE_UI event handler for ID_RICHTEXTBULLETSPAGE_NUMBERCTRL - */ - -void wxRichTextBulletsPage::OnNumberctrlUpdate( wxUpdateUIEvent& event ) -{ - OnNumberUpdate(event); -} - -/*! - * wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_RICHTEXTBULLETSPAGE_PARENTHESESCTRL - */ - -void wxRichTextBulletsPage::OnParenthesesctrlClick( wxCommandEvent& WXUNUSED(event) ) -{ - if (!m_dontUpdate) - { - m_hasBulletStyle = true; - UpdatePreview(); - } -} - -/*! - * wxEVT_UPDATE_UI event handler for ID_RICHTEXTBULLETSPAGE_PARENTHESESCTRL - */ - -void wxRichTextBulletsPage::OnParenthesesctrlUpdate( wxUpdateUIEvent& event ) -{ - int sel = m_styleListBox->GetSelection(); - event.Enable(m_hasBulletStyle && (sel != wxRICHTEXT_BULLETINDEX_SYMBOL && - sel != wxRICHTEXT_BULLETINDEX_BITMAP && - sel != wxRICHTEXT_BULLETINDEX_NONE)); -} - -/*! - * wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_RICHTEXTBULLETSPAGE_PERIODCTRL - */ - -void wxRichTextBulletsPage::OnPeriodctrlClick( wxCommandEvent& WXUNUSED(event) ) -{ - if (!m_dontUpdate) - { - m_hasBulletStyle = true; - UpdatePreview(); - } -} - -/*! - * wxEVT_UPDATE_UI event handler for ID_RICHTEXTBULLETSPAGE_PERIODCTRL - */ - -void wxRichTextBulletsPage::OnPeriodctrlUpdate( wxUpdateUIEvent& event ) -{ - int sel = m_styleListBox->GetSelection(); - event.Enable(m_hasBulletStyle && (sel != wxRICHTEXT_BULLETINDEX_SYMBOL && - sel != wxRICHTEXT_BULLETINDEX_BITMAP && - sel != wxRICHTEXT_BULLETINDEX_NONE)); -} - -/*! - * wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_RICHTEXTBULLETSPAGE_CHOOSE_SYMBOL - */ - -void wxRichTextBulletsPage::OnChooseSymbolClick( wxCommandEvent& WXUNUSED(event) ) -{ - int sel = m_styleListBox->GetSelection(); - if (m_hasBulletStyle && sel == wxRICHTEXT_BULLETINDEX_SYMBOL) - { - wxString symbol = m_symbolCtrl->GetValue(); - wxString fontName = m_symbolFontCtrl->GetValue(); - wxSymbolPickerDialog dlg(symbol, fontName, fontName, this); - - if (dlg.ShowModal() == wxID_OK) - { - m_dontUpdate = true; - - m_symbolCtrl->SetValue(dlg.GetSymbol()); - m_symbolFontCtrl->SetValue(dlg.GetFontName()); - - UpdatePreview(); - - m_dontUpdate = false; - } - } -} - -/*! - * wxEVT_UPDATE_UI event handler for ID_RICHTEXTBULLETSPAGE_CHOOSE_SYMBOL - */ - -void wxRichTextBulletsPage::OnChooseSymbolUpdate( wxUpdateUIEvent& event ) -{ - OnSymbolUpdate(event); -} -/*! - * wxEVT_COMMAND_COMBOBOX_SELECTED event handler for ID_RICHTEXTBULLETSPAGE_SYMBOLFONTCTRL - */ - -void wxRichTextBulletsPage::OnSymbolfontctrlSelected( wxCommandEvent& WXUNUSED(event) ) -{ - if (m_dontUpdate) - return; - UpdatePreview(); -} - -/*! - * wxEVT_COMMAND_TEXT_UPDATED event handler for ID_RICHTEXTBULLETSPAGE_SYMBOLFONTCTRL - */ - -void wxRichTextBulletsPage::OnSymbolfontctrlUpdated( wxCommandEvent& WXUNUSED(event) ) -{ - if (m_dontUpdate) - return; - UpdatePreview(); -} - - -/*! - * wxEVT_UPDATE_UI event handler for ID_RICHTEXTBULLETSPAGE_SYMBOLFONTCTRL - */ - -void wxRichTextBulletsPage::OnSymbolfontctrlUIUpdate( wxUpdateUIEvent& event ) -{ - OnSymbolUpdate(event); -} - -/// Update for symbol-related controls -void wxRichTextBulletsPage::OnSymbolUpdate( wxUpdateUIEvent& event ) -{ - int sel = m_styleListBox->GetSelection(); - event.Enable(m_hasBulletStyle && (sel == wxRICHTEXT_BULLETINDEX_SYMBOL)); -} - -/// Update for number-related controls -void wxRichTextBulletsPage::OnNumberUpdate( wxUpdateUIEvent& event ) -{ - int sel = m_styleListBox->GetSelection(); - event.Enable( m_hasBulletStyle && (sel != wxRICHTEXT_BULLETINDEX_SYMBOL && - sel != wxRICHTEXT_BULLETINDEX_BITMAP && - sel != wxRICHTEXT_BULLETINDEX_STANDARD && - sel != wxRICHTEXT_BULLETINDEX_NONE)); -} - -/// Update for standard bullet-related controls -void wxRichTextBulletsPage::OnStandardBulletUpdate( wxUpdateUIEvent& event ) -{ - int sel = m_styleListBox->GetSelection(); - event.Enable( sel == wxRICHTEXT_BULLETINDEX_STANDARD ); -} - - -/*! - * wxEVT_UPDATE_UI event handler for ID_RICHTEXTBULLETSPAGE_SYMBOLSTATIC - */ - -void wxRichTextBulletsPage::OnSymbolstaticUpdate( wxUpdateUIEvent& event ) -{ - OnSymbolUpdate(event); -} - - -/*! - * wxEVT_UPDATE_UI event handler for ID_RICHTEXTBULLETSPAGE_NUMBERSTATIC - */ - -void wxRichTextBulletsPage::OnNumberstaticUpdate( wxUpdateUIEvent& event ) -{ - OnNumberUpdate(event); -} - -/*! - * wxEVT_UPDATE_UI event handler for ID_RICHTEXTBULLETSPAGE_NAMESTATIC - */ - -void wxRichTextBulletsPage::OnNamestaticUpdate( wxUpdateUIEvent& event ) -{ - OnStandardBulletUpdate(event); -} - - -/*! - * wxEVT_COMMAND_COMBOBOX_SELECTED event handler for ID_RICHTEXTBULLETSPAGE_NAMECTRL - */ - -void wxRichTextBulletsPage::OnNamectrlSelected( wxCommandEvent& WXUNUSED(event) ) -{ - if (m_dontUpdate) - return; - UpdatePreview(); -} - -/*! - * wxEVT_COMMAND_TEXT_UPDATED event handler for ID_RICHTEXTBULLETSPAGE_NAMECTRL - */ - -void wxRichTextBulletsPage::OnNamectrlUpdated( wxCommandEvent& WXUNUSED(event) ) -{ - if (m_dontUpdate) - return; - UpdatePreview(); -} - -/*! - * wxEVT_UPDATE_UI event handler for ID_RICHTEXTBULLETSPAGE_NAMECTRL - */ - -void wxRichTextBulletsPage::OnNamectrlUIUpdate( wxUpdateUIEvent& event ) -{ - OnStandardBulletUpdate(event); -} - -#endif // wxUSE_RICHTEXT -/*! - * wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_RICHTEXTBULLETSPAGE_RIGHT_PARENTHESIS_CTRL - */ - -void wxRichTextBulletsPage::OnRightParenthesisCtrlClick( wxCommandEvent& WXUNUSED(event) ) -{ - if (!m_dontUpdate) - { - m_hasBulletStyle = true; - UpdatePreview(); - } -} - -/*! - * wxEVT_UPDATE_UI event handler for ID_RICHTEXTBULLETSPAGE_RIGHT_PARENTHESIS_CTRL - */ - -void wxRichTextBulletsPage::OnRightParenthesisCtrlUpdate( wxUpdateUIEvent& event ) -{ - int sel = m_styleListBox->GetSelection(); - event.Enable(m_hasBulletStyle && (sel != wxRICHTEXT_BULLETINDEX_SYMBOL && - sel != wxRICHTEXT_BULLETINDEX_BITMAP && - sel != wxRICHTEXT_BULLETINDEX_NONE)); -} - -/*! - * wxEVT_COMMAND_COMBOBOX_SELECTED event handler for ID_COMBOBOX - */ - -void wxRichTextBulletsPage::OnBulletAlignmentCtrlSelected( wxCommandEvent& WXUNUSED(event) ) -{ - if (m_dontUpdate) - return; - UpdatePreview(); -} - - diff --git a/wxWidgets/src/richtext/richtextctrl.cpp b/wxWidgets/src/richtext/richtextctrl.cpp deleted file mode 100644 index 4d88e500f7..0000000000 --- a/wxWidgets/src/richtext/richtextctrl.cpp +++ /dev/null @@ -1,3706 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/richtext/richeditctrl.cpp -// Purpose: A rich edit control -// Author: Julian Smart -// Modified by: -// Created: 2005-09-30 -// RCS-ID: $Id: richtextctrl.cpp 67025 2011-02-25 17:28:13Z JS $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_RICHTEXT - -#include "wx/richtext/richtextctrl.h" -#include "wx/richtext/richtextstyles.h" - -#ifndef WX_PRECOMP - #include "wx/wx.h" - #include "wx/settings.h" -#endif - -#include "wx/timer.h" -#include "wx/textfile.h" -#include "wx/ffile.h" -#include "wx/filename.h" -#include "wx/dcbuffer.h" -#include "wx/arrimpl.cpp" -#include "wx/fontenum.h" -#include "wx/accel.h" - -// DLL options compatibility check: -#include "wx/app.h" - -// Refresh the area affected by a selection change -bool wxRichTextCtrlRefreshForSelectionChange(wxRichTextCtrl& ctrl, const wxRichTextRange& oldSelection, const wxRichTextRange& newSelection); - -WX_CHECK_BUILD_OPTIONS("wxRichTextCtrl") - -DEFINE_EVENT_TYPE(wxEVT_COMMAND_RICHTEXT_LEFT_CLICK) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_RICHTEXT_MIDDLE_CLICK) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_RICHTEXT_RIGHT_CLICK) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_RICHTEXT_LEFT_DCLICK) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_RICHTEXT_RETURN) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_RICHTEXT_CHARACTER) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_RICHTEXT_DELETE) - -DEFINE_EVENT_TYPE(wxEVT_COMMAND_RICHTEXT_STYLESHEET_REPLACING) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_RICHTEXT_STYLESHEET_REPLACED) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_RICHTEXT_STYLESHEET_CHANGING) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_RICHTEXT_STYLESHEET_CHANGED) - -DEFINE_EVENT_TYPE(wxEVT_COMMAND_RICHTEXT_CONTENT_INSERTED) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_RICHTEXT_CONTENT_DELETED) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_RICHTEXT_STYLE_CHANGED) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_RICHTEXT_SELECTION_CHANGED) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_RICHTEXT_BUFFER_RESET) - -#if wxRICHTEXT_USE_OWN_CARET - -class wxRichTextCaret; -class wxRichTextCaretTimer: public wxTimer -{ - public: - wxRichTextCaretTimer(wxRichTextCaret* caret) - { - m_caret = caret; - } - virtual void Notify(); - wxRichTextCaret* m_caret; -}; - -/*! - * wxRichTextCaret - * - * This implements a non-flashing cursor in case there - * are platform-specific problems with the generic caret. - * wxRICHTEXT_USE_OWN_CARET is set in richtextbuffer.h. - */ - -class wxRichTextCaret: public wxCaret -{ -public: - // ctors - // ----- - // default - use Create() - wxRichTextCaret(): m_timer(this) { Init(); } - // creates a block caret associated with the given window - wxRichTextCaret(wxRichTextCtrl *window, int width, int height) - : wxCaret(window, width, height), m_timer(this) { Init(); m_richTextCtrl = window; } - wxRichTextCaret(wxRichTextCtrl *window, const wxSize& size) - : wxCaret(window, size), m_timer(this) { Init(); m_richTextCtrl = window; } - - virtual ~wxRichTextCaret(); - - // implementation - // -------------- - - // called by wxWindow (not using the event tables) - virtual void OnSetFocus(); - virtual void OnKillFocus(); - - // draw the caret on the given DC - void DoDraw(wxDC *dc); - - // get the visible count - int GetVisibleCount() const { return m_countVisible; } - - // delay repositioning - bool GetNeedsUpdate() const { return m_needsUpdate; } - void SetNeedsUpdate(bool needsUpdate = true ) { m_needsUpdate = needsUpdate; } - - void Notify(); - -protected: - virtual void DoShow(); - virtual void DoHide(); - virtual void DoMove(); - virtual void DoSize(); - - // refresh the caret - void Refresh(); - -private: - void Init(); - - int m_xOld, - m_yOld; - bool m_hasFocus; // true => our window has focus - bool m_needsUpdate; // must be repositioned - bool m_flashOn; - wxRichTextCaretTimer m_timer; - wxRichTextCtrl* m_richTextCtrl; -}; -#endif - -IMPLEMENT_CLASS( wxRichTextCtrl, wxTextCtrlBase ) - -IMPLEMENT_CLASS( wxRichTextEvent, wxNotifyEvent ) - -BEGIN_EVENT_TABLE( wxRichTextCtrl, wxTextCtrlBase ) - EVT_PAINT(wxRichTextCtrl::OnPaint) - EVT_ERASE_BACKGROUND(wxRichTextCtrl::OnEraseBackground) - EVT_IDLE(wxRichTextCtrl::OnIdle) - EVT_SCROLLWIN(wxRichTextCtrl::OnScroll) - EVT_LEFT_DOWN(wxRichTextCtrl::OnLeftClick) - EVT_MOTION(wxRichTextCtrl::OnMoveMouse) - EVT_LEFT_UP(wxRichTextCtrl::OnLeftUp) - EVT_RIGHT_DOWN(wxRichTextCtrl::OnRightClick) - EVT_MIDDLE_DOWN(wxRichTextCtrl::OnMiddleClick) - EVT_LEFT_DCLICK(wxRichTextCtrl::OnLeftDClick) - EVT_CHAR(wxRichTextCtrl::OnChar) - EVT_KEY_DOWN(wxRichTextCtrl::OnChar) - EVT_SIZE(wxRichTextCtrl::OnSize) - EVT_SET_FOCUS(wxRichTextCtrl::OnSetFocus) - EVT_KILL_FOCUS(wxRichTextCtrl::OnKillFocus) - EVT_MOUSE_CAPTURE_LOST(wxRichTextCtrl::OnCaptureLost) - EVT_CONTEXT_MENU(wxRichTextCtrl::OnContextMenu) - - EVT_MENU(wxID_UNDO, wxRichTextCtrl::OnUndo) - EVT_UPDATE_UI(wxID_UNDO, wxRichTextCtrl::OnUpdateUndo) - - EVT_MENU(wxID_REDO, wxRichTextCtrl::OnRedo) - EVT_UPDATE_UI(wxID_REDO, wxRichTextCtrl::OnUpdateRedo) - - EVT_MENU(wxID_COPY, wxRichTextCtrl::OnCopy) - EVT_UPDATE_UI(wxID_COPY, wxRichTextCtrl::OnUpdateCopy) - - EVT_MENU(wxID_PASTE, wxRichTextCtrl::OnPaste) - EVT_UPDATE_UI(wxID_PASTE, wxRichTextCtrl::OnUpdatePaste) - - EVT_MENU(wxID_CUT, wxRichTextCtrl::OnCut) - EVT_UPDATE_UI(wxID_CUT, wxRichTextCtrl::OnUpdateCut) - - EVT_MENU(wxID_CLEAR, wxRichTextCtrl::OnClear) - EVT_UPDATE_UI(wxID_CLEAR, wxRichTextCtrl::OnUpdateClear) - - EVT_MENU(wxID_SELECTALL, wxRichTextCtrl::OnSelectAll) - EVT_UPDATE_UI(wxID_SELECTALL, wxRichTextCtrl::OnUpdateSelectAll) -END_EVENT_TABLE() - -/*! - * wxRichTextCtrl - */ - -wxArrayString wxRichTextCtrl::sm_availableFontNames; - -wxRichTextCtrl::wxRichTextCtrl() - : wxScrollHelper(this) -{ - Init(); -} - -wxRichTextCtrl::wxRichTextCtrl(wxWindow* parent, - wxWindowID id, - const wxString& value, - const wxPoint& pos, - const wxSize& size, - long style, - const wxValidator& validator, - const wxString& name) - : wxScrollHelper(this) -{ - Init(); - Create(parent, id, value, pos, size, style, validator, name); -} - -/// Creation -bool wxRichTextCtrl::Create( wxWindow* parent, wxWindowID id, const wxString& value, const wxPoint& pos, const wxSize& size, long style, - const wxValidator& validator, const wxString& name) -{ - if ((style & wxBORDER_MASK) == wxBORDER_DEFAULT) -#ifdef __WXMSW__ - style |= GetThemedBorderStyle(); -#else - style |= wxBORDER_SUNKEN; -#endif - - if (!wxTextCtrlBase::Create(parent, id, pos, size, - style|wxFULL_REPAINT_ON_RESIZE, - validator, name)) - return false; - - if (!GetFont().Ok()) - { - SetFont(wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT)); - } - - // No physical scrolling, so we can preserve margins - EnableScrolling(false, false); - - if (style & wxTE_READONLY) - SetEditable(false); - - // The base attributes must all have default values - wxTextAttrEx attributes; - attributes.SetFont(GetFont()); - attributes.SetTextColour(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT)); - attributes.SetAlignment(wxTEXT_ALIGNMENT_LEFT); - attributes.SetLineSpacing(10); - attributes.SetParagraphSpacingAfter(10); - attributes.SetParagraphSpacingBefore(0); - - SetBasicStyle(attributes); - - // The default attributes will be merged with base attributes, so - // can be empty to begin with - wxTextAttrEx defaultAttributes; - SetDefaultStyle(defaultAttributes); - - SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW)); - SetBackgroundStyle(wxBG_STYLE_CUSTOM); - - GetBuffer().Reset(); - GetBuffer().SetRichTextCtrl(this); - -#if wxRICHTEXT_USE_OWN_CARET - SetCaret(new wxRichTextCaret(this, wxRICHTEXT_DEFAULT_CARET_WIDTH, 16)); -#else - SetCaret(new wxCaret(this, wxRICHTEXT_DEFAULT_CARET_WIDTH, 16)); -#endif - - // Tell the sizers to use the given or best size - SetInitialSize(size); - -#if wxRICHTEXT_BUFFERED_PAINTING - // Create a buffer - RecreateBuffer(size); -#endif - - m_textCursor = wxCursor(wxCURSOR_IBEAM); - m_urlCursor = wxCursor(wxCURSOR_HAND); - - SetCursor(m_textCursor); - - if (!value.IsEmpty()) - SetValue(value); - - GetBuffer().AddEventHandler(this); - - // Accelerators - wxAcceleratorEntry entries[6]; - - entries[0].Set(wxACCEL_CMD, (int) 'C', wxID_COPY); - entries[1].Set(wxACCEL_CMD, (int) 'X', wxID_CUT); - entries[2].Set(wxACCEL_CMD, (int) 'V', wxID_PASTE); - entries[3].Set(wxACCEL_CMD, (int) 'A', wxID_SELECTALL); - entries[4].Set(wxACCEL_CMD, (int) 'Z', wxID_UNDO); - entries[5].Set(wxACCEL_CMD, (int) 'Y', wxID_REDO); - - wxAcceleratorTable accel(6, entries); - SetAcceleratorTable(accel); - - m_contextMenu = new wxMenu; - m_contextMenu->Append(wxID_UNDO, _("&Undo")); - m_contextMenu->Append(wxID_REDO, _("&Redo")); - m_contextMenu->AppendSeparator(); - m_contextMenu->Append(wxID_CUT, _("Cu&t")); - m_contextMenu->Append(wxID_COPY, _("&Copy")); - m_contextMenu->Append(wxID_PASTE, _("&Paste")); - m_contextMenu->Append(wxID_CLEAR, _("&Delete")); - m_contextMenu->AppendSeparator(); - m_contextMenu->Append(wxID_SELECTALL, _("Select &All")); - - return true; -} - -wxRichTextCtrl::~wxRichTextCtrl() -{ - GetBuffer().RemoveEventHandler(this); - - delete m_contextMenu; -} - -/// Member initialisation -void wxRichTextCtrl::Init() -{ - m_freezeCount = 0; - m_contextMenu = NULL; - m_caret = NULL; - m_caretPosition = -1; - m_selectionRange.SetRange(-2, -2); - m_selectionAnchor = -2; - m_editable = true; - m_caretAtLineStart = false; - m_dragging = false; - m_fullLayoutRequired = false; - m_fullLayoutTime = 0; - m_fullLayoutSavedPosition = 0; - m_delayedLayoutThreshold = wxRICHTEXT_DEFAULT_DELAYED_LAYOUT_THRESHOLD; - m_caretPositionForDefaultStyle = -2; -} - -/// Call Freeze to prevent refresh -void wxRichTextCtrl::Freeze() -{ - m_freezeCount ++; -} - -/// Call Thaw to refresh -void wxRichTextCtrl::Thaw() -{ - m_freezeCount --; - - if (m_freezeCount == 0) - { - if (GetBuffer().GetDirty()) - LayoutContent(); - else - SetupScrollbars(); - - Refresh(false); - } -} - -/// Clear all text -void wxRichTextCtrl::Clear() -{ - m_buffer.ResetAndClearCommands(); - m_buffer.SetDirty(true); - m_caretPosition = -1; - m_caretPositionForDefaultStyle = -2; - m_caretAtLineStart = false; - m_selectionRange.SetRange(-2, -2); - - Scroll(0,0); - - if (m_freezeCount == 0) - { - LayoutContent(); - Refresh(false); - } - SendTextUpdatedEvent(); -} - -/// Painting -void wxRichTextCtrl::OnPaint(wxPaintEvent& WXUNUSED(event)) -{ -#if !wxRICHTEXT_USE_OWN_CARET - if (GetCaret() && !IsFrozen()) - GetCaret()->Hide(); -#endif - - { -#if wxRICHTEXT_BUFFERED_PAINTING - wxBufferedPaintDC dc(this, m_bufferBitmap); -#else - wxPaintDC dc(this); -#endif - PrepareDC(dc); - - if (IsFrozen()) - { - return; - } - - dc.SetFont(GetFont()); - - // Paint the background - PaintBackground(dc); - - // wxRect drawingArea(GetLogicalPoint(wxPoint(0, 0)), GetClientSize()); - - wxRect drawingArea(GetUpdateRegion().GetBox()); - drawingArea.SetPosition(GetLogicalPoint(drawingArea.GetPosition())); - - wxRect availableSpace(GetClientSize()); - if (GetBuffer().GetDirty()) - { - GetBuffer().Layout(dc, availableSpace, wxRICHTEXT_FIXED_WIDTH|wxRICHTEXT_VARIABLE_HEIGHT); - GetBuffer().SetDirty(false); - SetupScrollbars(); - } - - wxRect clipRect(availableSpace); - clipRect.x += GetBuffer().GetLeftMargin(); - clipRect.y += GetBuffer().GetTopMargin(); - clipRect.width -= (GetBuffer().GetLeftMargin() + GetBuffer().GetRightMargin()); - clipRect.height -= (GetBuffer().GetTopMargin() + GetBuffer().GetBottomMargin()); - clipRect.SetPosition(GetLogicalPoint(clipRect.GetPosition())); - dc.SetClippingRegion(clipRect); - - GetBuffer().Draw(dc, GetBuffer().GetRange(), GetInternalSelectionRange(), drawingArea, 0 /* descent */, 0 /* flags */); - - dc.DestroyClippingRegion(); - -#if wxRICHTEXT_USE_OWN_CARET - if (GetCaret()->IsVisible()) - { - ((wxRichTextCaret*) GetCaret())->DoDraw(& dc); - } -#endif - - } - -#if !wxRICHTEXT_USE_OWN_CARET - if (GetCaret()) - GetCaret()->Show(); - PositionCaret(); -#endif -} - -// Empty implementation, to prevent flicker -void wxRichTextCtrl::OnEraseBackground(wxEraseEvent& WXUNUSED(event)) -{ -} - -void wxRichTextCtrl::OnSetFocus(wxFocusEvent& WXUNUSED(event)) -{ - if (GetCaret()) - { -#if !wxRICHTEXT_USE_OWN_CARET - PositionCaret(); -#endif - GetCaret()->Show(); - } - -#if defined(__WXGTK__) && !wxRICHTEXT_USE_OWN_CARET - // Work around dropouts when control is focused - if (!IsFrozen()) - { - Refresh(false); - } -#endif -} - -void wxRichTextCtrl::OnKillFocus(wxFocusEvent& WXUNUSED(event)) -{ - if (GetCaret()) - GetCaret()->Hide(); - -#if defined(__WXGTK__) && !wxRICHTEXT_USE_OWN_CARET - // Work around dropouts when control is focused - if (!IsFrozen()) - { - Refresh(false); - } -#endif -} - -void wxRichTextCtrl::OnCaptureLost(wxMouseCaptureLostEvent& WXUNUSED(event)) -{ - m_dragging = false; -} - -/// Left-click -void wxRichTextCtrl::OnLeftClick(wxMouseEvent& event) -{ - SetFocus(); - - wxClientDC dc(this); - PrepareDC(dc); - dc.SetFont(GetFont()); - - long position = 0; - int hit = GetBuffer().HitTest(dc, event.GetLogicalPosition(dc), position); - - if (hit != wxRICHTEXT_HITTEST_NONE) - { - m_dragStart = event.GetLogicalPosition(dc); - m_dragging = true; - CaptureMouse(); - - bool caretAtLineStart = false; - - if (hit & wxRICHTEXT_HITTEST_BEFORE) - { - // If we're at the start of a line (but not first in para) - // then we should keep the caret showing at the start of the line - // by showing the m_caretAtLineStart flag. - wxRichTextParagraph* para = GetBuffer().GetParagraphAtPosition(position); - wxRichTextLine* line = GetBuffer().GetLineAtPosition(position); - - if (line && para && line->GetAbsoluteRange().GetStart() == position && para->GetRange().GetStart() != position) - caretAtLineStart = true; - position --; - } - - long oldCaretPos = m_caretPosition; - - MoveCaret(position, caretAtLineStart); - SetDefaultStyleToCursorStyle(); - - if (event.ShiftDown()) - { - if (m_selectionRange.GetStart() == -2) - ExtendSelection(oldCaretPos, m_caretPosition, wxRICHTEXT_SHIFT_DOWN); - else - ExtendSelection(m_caretPosition, m_caretPosition, wxRICHTEXT_SHIFT_DOWN); - } - else - SelectNone(); - } - - event.Skip(); -} - -/// Left-up -void wxRichTextCtrl::OnLeftUp(wxMouseEvent& event) -{ - if (m_dragging) - { - m_dragging = false; - if (GetCapture() == this) - ReleaseMouse(); - - // See if we clicked on a URL - wxClientDC dc(this); - PrepareDC(dc); - dc.SetFont(GetFont()); - - long position = 0; - wxPoint logicalPt = event.GetLogicalPosition(dc); - int hit = GetBuffer().HitTest(dc, logicalPt, position); - - if ((hit != wxRICHTEXT_HITTEST_NONE) && !(hit & wxRICHTEXT_HITTEST_OUTSIDE)) - { - wxTextAttrEx attr; - if (GetStyle(position, attr)) - { - if (attr.HasFlag(wxTEXT_ATTR_URL)) - { - wxString urlTarget = attr.GetURL(); - if (!urlTarget.IsEmpty()) - { - wxMouseEvent mouseEvent(event); - - long startPos = 0, endPos = 0; - wxRichTextObject* obj = GetBuffer().GetLeafObjectAtPosition(position); - if (obj) - { - startPos = obj->GetRange().GetStart(); - endPos = obj->GetRange().GetEnd(); - } - - wxTextUrlEvent urlEvent(GetId(), mouseEvent, startPos, endPos); - InitCommandEvent(urlEvent); - - urlEvent.SetString(urlTarget); - - GetEventHandler()->ProcessEvent(urlEvent); - } - } - } - } - } -} - -/// Left-click -void wxRichTextCtrl::OnMoveMouse(wxMouseEvent& event) -{ - wxClientDC dc(this); - PrepareDC(dc); - dc.SetFont(GetFont()); - - long position = 0; - wxPoint logicalPt = event.GetLogicalPosition(dc); - int hit = GetBuffer().HitTest(dc, logicalPt, position); - - // See if we need to change the cursor - - { - if (hit != wxRICHTEXT_HITTEST_NONE && !(hit & wxRICHTEXT_HITTEST_OUTSIDE)) - { - wxTextAttrEx attr; - if (GetStyle(position, attr)) - { - if (attr.HasFlag(wxTEXT_ATTR_URL)) - { - SetCursor(m_urlCursor); - } - else if (!attr.HasFlag(wxTEXT_ATTR_URL)) - { - SetCursor(m_textCursor); - } - } - } - else - SetCursor(m_textCursor); - } - - if (!event.Dragging()) - { - event.Skip(); - return; - } - - if (m_dragging && hit != wxRICHTEXT_HITTEST_NONE) - { - // TODO: test closeness - - bool caretAtLineStart = false; - - if (hit & wxRICHTEXT_HITTEST_BEFORE) - { - // If we're at the start of a line (but not first in para) - // then we should keep the caret showing at the start of the line - // by showing the m_caretAtLineStart flag. - wxRichTextParagraph* para = GetBuffer().GetParagraphAtPosition(position); - wxRichTextLine* line = GetBuffer().GetLineAtPosition(position); - - if (line && para && line->GetAbsoluteRange().GetStart() == position && para->GetRange().GetStart() != position) - caretAtLineStart = true; - position --; - } - - if (m_caretPosition != position) - { - ExtendSelection(m_caretPosition, position, wxRICHTEXT_SHIFT_DOWN); - - MoveCaret(position, caretAtLineStart); - SetDefaultStyleToCursorStyle(); - } - } -} - -/// Right-click -void wxRichTextCtrl::OnRightClick(wxMouseEvent& event) -{ - SetFocus(); - event.Skip(); -} - -/// Left-double-click -void wxRichTextCtrl::OnLeftDClick(wxMouseEvent& event) -{ - SelectWord(GetCaretPosition()+1); - event.Skip(); -} - -/// Middle-click -void wxRichTextCtrl::OnMiddleClick(wxMouseEvent& event) -{ - event.Skip(); -} - -/// Key press -void wxRichTextCtrl::OnChar(wxKeyEvent& event) -{ - int flags = 0; - if (event.CmdDown()) - flags |= wxRICHTEXT_CTRL_DOWN; - if (event.ShiftDown()) - flags |= wxRICHTEXT_SHIFT_DOWN; - if (event.AltDown()) - flags |= wxRICHTEXT_ALT_DOWN; - - if (event.GetEventType() == wxEVT_KEY_DOWN) - { - if (event.GetKeyCode() == WXK_LEFT || - event.GetKeyCode() == WXK_RIGHT || - event.GetKeyCode() == WXK_UP || - event.GetKeyCode() == WXK_DOWN || - event.GetKeyCode() == WXK_HOME || - event.GetKeyCode() == WXK_PAGEUP || - event.GetKeyCode() == WXK_PAGEDOWN || - event.GetKeyCode() == WXK_END || - - event.GetKeyCode() == WXK_NUMPAD_LEFT || - event.GetKeyCode() == WXK_NUMPAD_RIGHT || - event.GetKeyCode() == WXK_NUMPAD_UP || - event.GetKeyCode() == WXK_NUMPAD_DOWN || - event.GetKeyCode() == WXK_NUMPAD_HOME || - event.GetKeyCode() == WXK_NUMPAD_PAGEUP || - event.GetKeyCode() == WXK_NUMPAD_PAGEDOWN || - event.GetKeyCode() == WXK_NUMPAD_END) - { - KeyboardNavigate(event.GetKeyCode(), flags); - return; - } - - long keycode = event.GetKeyCode(); - switch ( keycode ) - { - case WXK_ESCAPE: - case WXK_START: - case WXK_LBUTTON: - case WXK_RBUTTON: - case WXK_CANCEL: - case WXK_MBUTTON: - case WXK_CLEAR: - case WXK_SHIFT: - case WXK_ALT: - case WXK_CONTROL: - case WXK_MENU: - case WXK_PAUSE: - case WXK_CAPITAL: - case WXK_END: - case WXK_HOME: - case WXK_LEFT: - case WXK_UP: - case WXK_RIGHT: - case WXK_DOWN: - case WXK_SELECT: - case WXK_PRINT: - case WXK_EXECUTE: - case WXK_SNAPSHOT: - case WXK_INSERT: - case WXK_HELP: - case WXK_F1: - case WXK_F2: - case WXK_F3: - case WXK_F4: - case WXK_F5: - case WXK_F6: - case WXK_F7: - case WXK_F8: - case WXK_F9: - case WXK_F10: - case WXK_F11: - case WXK_F12: - case WXK_F13: - case WXK_F14: - case WXK_F15: - case WXK_F16: - case WXK_F17: - case WXK_F18: - case WXK_F19: - case WXK_F20: - case WXK_F21: - case WXK_F22: - case WXK_F23: - case WXK_F24: - case WXK_NUMLOCK: - case WXK_SCROLL: - case WXK_PAGEUP: - case WXK_PAGEDOWN: - case WXK_NUMPAD_F1: - case WXK_NUMPAD_F2: - case WXK_NUMPAD_F3: - case WXK_NUMPAD_F4: - case WXK_NUMPAD_HOME: - case WXK_NUMPAD_LEFT: - case WXK_NUMPAD_UP: - case WXK_NUMPAD_RIGHT: - case WXK_NUMPAD_DOWN: - case WXK_NUMPAD_PAGEUP: - case WXK_NUMPAD_PAGEDOWN: - case WXK_NUMPAD_END: - case WXK_NUMPAD_BEGIN: - case WXK_NUMPAD_INSERT: - case WXK_WINDOWS_LEFT: - { - return; - } - default: - { - } - } - - // Must process this before translation, otherwise it's translated into a WXK_DELETE event. - if (event.CmdDown() && event.GetKeyCode() == WXK_BACK) - { - BeginBatchUndo(_("Delete Text")); - - long newPos = m_caretPosition; - - bool processed = DeleteSelectedContent(& newPos); - - // Submit range in character positions, which are greater than caret positions, - // so subtract 1 for deleted character and add 1 for conversion to character position. - if (newPos > -1) - { - if (event.CmdDown()) - { - long pos = wxRichTextCtrl::FindNextWordPosition(-1); - if (pos < newPos) - { - GetBuffer().DeleteRangeWithUndo(wxRichTextRange(pos+1, newPos), this); - processed = true; - } - } - - if (!processed) - GetBuffer().DeleteRangeWithUndo(wxRichTextRange(newPos, newPos), this); - } - - EndBatchUndo(); - - if (GetLastPosition() == -1) - { - GetBuffer().Reset(); - - m_caretPosition = -1; - PositionCaret(); - SetDefaultStyleToCursorStyle(); - } - - ScrollIntoView(m_caretPosition, WXK_LEFT); - - wxRichTextEvent cmdEvent( - wxEVT_COMMAND_RICHTEXT_DELETE, - GetId()); - cmdEvent.SetEventObject(this); - cmdEvent.SetFlags(flags); - cmdEvent.SetPosition(m_caretPosition+1); - GetEventHandler()->ProcessEvent(cmdEvent); - - Update(); - } - else - event.Skip(); - - return; - } - - // all the other keys modify the controls contents which shouldn't be - // possible if we're read-only - if ( !IsEditable() ) - { - event.Skip(); - return; - } - - if (event.GetKeyCode() == WXK_RETURN) - { - BeginBatchUndo(_("Insert Text")); - - long newPos = m_caretPosition; - - DeleteSelectedContent(& newPos); - - if (event.ShiftDown()) - { - wxString text; - text = wxRichTextLineBreakChar; - GetBuffer().InsertTextWithUndo(newPos+1, text, this); - m_caretAtLineStart = true; - PositionCaret(); - } - else - GetBuffer().InsertNewlineWithUndo(newPos+1, this, wxRICHTEXT_INSERT_WITH_PREVIOUS_PARAGRAPH_STYLE|wxRICHTEXT_INSERT_INTERACTIVE); - - EndBatchUndo(); - SetDefaultStyleToCursorStyle(); - - ScrollIntoView(m_caretPosition, WXK_RIGHT); - - wxRichTextEvent cmdEvent( - wxEVT_COMMAND_RICHTEXT_RETURN, - GetId()); - cmdEvent.SetEventObject(this); - cmdEvent.SetFlags(flags); - cmdEvent.SetPosition(newPos+1); - - if (!GetEventHandler()->ProcessEvent(cmdEvent)) - { - // Generate conventional event - wxCommandEvent textEvent(wxEVT_COMMAND_TEXT_ENTER, GetId()); - InitCommandEvent(textEvent); - - GetEventHandler()->ProcessEvent(textEvent); - } - Update(); - } - else if (event.GetKeyCode() == WXK_BACK) - { - BeginBatchUndo(_("Delete Text")); - - long newPos = m_caretPosition; - - bool processed = DeleteSelectedContent(& newPos); - - // Submit range in character positions, which are greater than caret positions, - // so subtract 1 for deleted character and add 1 for conversion to character position. - if (newPos > -1) - { - if (event.CmdDown()) - { - long pos = wxRichTextCtrl::FindNextWordPosition(-1); - if (pos < newPos) - { - GetBuffer().DeleteRangeWithUndo(wxRichTextRange(pos+1, newPos), this); - processed = true; - } - } - - if (!processed) - GetBuffer().DeleteRangeWithUndo(wxRichTextRange(newPos, newPos), this); - } - - EndBatchUndo(); - - if (GetLastPosition() == -1) - { - GetBuffer().Reset(); - - m_caretPosition = -1; - PositionCaret(); - SetDefaultStyleToCursorStyle(); - } - - ScrollIntoView(m_caretPosition, WXK_LEFT); - - wxRichTextEvent cmdEvent( - wxEVT_COMMAND_RICHTEXT_DELETE, - GetId()); - cmdEvent.SetEventObject(this); - cmdEvent.SetFlags(flags); - cmdEvent.SetPosition(m_caretPosition+1); - GetEventHandler()->ProcessEvent(cmdEvent); - - Update(); - } - else if (event.GetKeyCode() == WXK_DELETE) - { - BeginBatchUndo(_("Delete Text")); - - long newPos = m_caretPosition; - - bool processed = DeleteSelectedContent(& newPos); - - // Submit range in character positions, which are greater than caret positions, - if (newPos < GetBuffer().GetRange().GetEnd()+1) - { - if (event.CmdDown()) - { - long pos = wxRichTextCtrl::FindNextWordPosition(1); - if (pos != -1 && (pos > newPos)) - { - GetBuffer().DeleteRangeWithUndo(wxRichTextRange(newPos+1, pos), this); - processed = true; - } - } - - if (!processed && newPos < (GetLastPosition()-1)) - GetBuffer().DeleteRangeWithUndo(wxRichTextRange(newPos+1, newPos+1), this); - } - - EndBatchUndo(); - - if (GetLastPosition() == -1) - { - GetBuffer().Reset(); - - m_caretPosition = -1; - PositionCaret(); - SetDefaultStyleToCursorStyle(); - } - - wxRichTextEvent cmdEvent( - wxEVT_COMMAND_RICHTEXT_DELETE, - GetId()); - cmdEvent.SetEventObject(this); - cmdEvent.SetFlags(flags); - cmdEvent.SetPosition(m_caretPosition+1); - GetEventHandler()->ProcessEvent(cmdEvent); - - Update(); - } - else - { - long keycode = event.GetKeyCode(); - switch ( keycode ) - { - case WXK_ESCAPE: - { - event.Skip(); - return; - } - - default: - { -#ifdef __WXMAC__ - if (event.CmdDown()) -#else - // Fixes AltGr+key with European input languages on Windows - if ((event.CmdDown() && !event.AltDown()) || (event.AltDown() && !event.CmdDown())) -#endif - { - event.Skip(); - return; - } - - wxRichTextEvent cmdEvent( - wxEVT_COMMAND_RICHTEXT_CHARACTER, - GetId()); - cmdEvent.SetEventObject(this); - cmdEvent.SetFlags(flags); -#if wxUSE_UNICODE - cmdEvent.SetCharacter(event.GetUnicodeKey()); -#else - cmdEvent.SetCharacter((wxChar) keycode); -#endif - cmdEvent.SetPosition(m_caretPosition+1); - - if (keycode == wxT('\t')) - { - // See if we need to promote or demote the selection or paragraph at the cursor - // position, instead of inserting a tab. - long pos = GetAdjustedCaretPosition(GetCaretPosition()); - wxRichTextParagraph* para = GetBuffer().GetParagraphAtPosition(pos); - if (para && para->GetRange().GetStart() == pos && para->GetAttributes().HasListStyleName()) - { - wxRichTextRange range; - if (HasSelection()) - range = GetSelectionRange(); - else - range = para->GetRange().FromInternal(); - - int promoteBy = event.ShiftDown() ? 1 : -1; - - PromoteList(promoteBy, range, NULL); - - GetEventHandler()->ProcessEvent(cmdEvent); - - return; - } - } - - BeginBatchUndo(_("Insert Text")); - - long newPos = m_caretPosition; - DeleteSelectedContent(& newPos); - -#if wxUSE_UNICODE - wxString str = event.GetUnicodeKey(); -#else - wxString str = (wxChar) event.GetKeyCode(); -#endif - GetBuffer().InsertTextWithUndo(newPos+1, str, this, 0); - - EndBatchUndo(); - - SetDefaultStyleToCursorStyle(); - ScrollIntoView(m_caretPosition, WXK_RIGHT); - - GetEventHandler()->ProcessEvent(cmdEvent); - - Update(); - } - } - } -} - -/// Delete content if there is a selection, e.g. when pressing a key. -bool wxRichTextCtrl::DeleteSelectedContent(long* newPos) -{ - if (HasSelection()) - { - long pos = m_selectionRange.GetStart(); - wxRichTextRange range = m_selectionRange; - - // SelectAll causes more to be selected than doing it interactively, - // and causes a new paragraph to be inserted. So for multiline buffers, - // don't delete the final position. - if (range.GetEnd() == GetLastPosition() && GetNumberOfLines() > 0) - range.SetEnd(range.GetEnd()-1); - - GetBuffer().DeleteRangeWithUndo(range, this); - m_selectionRange.SetRange(-2, -2); - - if (newPos) - *newPos = pos-1; - return true; - } - else - return false; -} - -/// Keyboard navigation - -/* - -Left: left one character -Right: right one character -Up: up one line -Down: down one line -Ctrl-Left: left one word -Ctrl-Right: right one word -Ctrl-Up: previous paragraph start -Ctrl-Down: next start of paragraph -Home: start of line -End: end of line -Ctrl-Home: start of document -Ctrl-End: end of document -Page-Up: Up a screen -Page-Down: Down a screen - -Maybe: - -Ctrl-Alt-PgUp: Start of window -Ctrl-Alt-PgDn: End of window -F8: Start selection mode -Esc: End selection mode - -Adding Shift does the above but starts/extends selection. - - - */ - -bool wxRichTextCtrl::KeyboardNavigate(int keyCode, int flags) -{ - bool success = false; - - if (keyCode == WXK_RIGHT || keyCode == WXK_NUMPAD_RIGHT) - { - if (flags & wxRICHTEXT_CTRL_DOWN) - success = WordRight(1, flags); - else - success = MoveRight(1, flags); - } - else if (keyCode == WXK_LEFT || keyCode == WXK_NUMPAD_LEFT) - { - if (flags & wxRICHTEXT_CTRL_DOWN) - success = WordLeft(1, flags); - else - success = MoveLeft(1, flags); - } - else if (keyCode == WXK_UP || keyCode == WXK_NUMPAD_UP) - { - if (flags & wxRICHTEXT_CTRL_DOWN) - success = MoveToParagraphStart(flags); - else - success = MoveUp(1, flags); - } - else if (keyCode == WXK_DOWN || keyCode == WXK_NUMPAD_DOWN) - { - if (flags & wxRICHTEXT_CTRL_DOWN) - success = MoveToParagraphEnd(flags); - else - success = MoveDown(1, flags); - } - else if (keyCode == WXK_PAGEUP || keyCode == WXK_NUMPAD_PAGEUP) - { - success = PageUp(1, flags); - } - else if (keyCode == WXK_PAGEDOWN || keyCode == WXK_NUMPAD_PAGEDOWN) - { - success = PageDown(1, flags); - } - else if (keyCode == WXK_HOME || keyCode == WXK_NUMPAD_HOME) - { - if (flags & wxRICHTEXT_CTRL_DOWN) - success = MoveHome(flags); - else - success = MoveToLineStart(flags); - } - else if (keyCode == WXK_END || keyCode == WXK_NUMPAD_END) - { - if (flags & wxRICHTEXT_CTRL_DOWN) - success = MoveEnd(flags); - else - success = MoveToLineEnd(flags); - } - - if (success) - { - ScrollIntoView(m_caretPosition, keyCode); - SetDefaultStyleToCursorStyle(); - } - - return success; -} - -/// Extend the selection. Selections are in caret positions. -bool wxRichTextCtrl::ExtendSelection(long oldPos, long newPos, int flags) -{ - if (flags & wxRICHTEXT_SHIFT_DOWN) - { - if (oldPos == newPos) - return false; - - wxRichTextRange oldSelection = m_selectionRange; - - // If not currently selecting, start selecting - if (m_selectionRange.GetStart() == -2) - { - m_selectionAnchor = oldPos; - - if (oldPos > newPos) - m_selectionRange.SetRange(newPos+1, oldPos); - else - m_selectionRange.SetRange(oldPos+1, newPos); - } - else - { - // Always ensure that the selection range start is greater than - // the end. - if (newPos > m_selectionAnchor) - m_selectionRange.SetRange(m_selectionAnchor+1, newPos); - else if (newPos == m_selectionAnchor) - m_selectionRange = wxRichTextRange(-2, -2); - else - m_selectionRange.SetRange(newPos+1, m_selectionAnchor); - } - - wxRichTextCtrlRefreshForSelectionChange(*this, oldSelection, m_selectionRange); - - if (m_selectionRange.GetStart() > m_selectionRange.GetEnd()) - { - wxLogDebug(wxT("Strange selection range")); - } - - return true; - } - else - return false; -} - -/// Scroll into view, returning true if we scrolled. -/// This takes a _caret_ position. -bool wxRichTextCtrl::ScrollIntoView(long position, int keyCode) -{ - wxRichTextLine* line = GetVisibleLineForCaretPosition(position); - - if (!line) - return false; - - int ppuX, ppuY; - GetScrollPixelsPerUnit(& ppuX, & ppuY); - - int startXUnits, startYUnits; - GetViewStart(& startXUnits, & startYUnits); - int startY = startYUnits * ppuY; - - int sx = 0, sy = 0; - GetVirtualSize(& sx, & sy); - int sxUnits = 0; - int syUnits = 0; - if (ppuY != 0) - syUnits = sy/ppuY; - - wxRect rect = line->GetRect(); - - bool scrolled = false; - - wxSize clientSize = GetClientSize(); - clientSize.y -= GetBuffer().GetBottomMargin(); - - if (GetWindowStyle() & wxRE_CENTRE_CARET) - { - int y = rect.y - GetClientSize().y/2; - int yUnits = (int) (0.5 + ((float) y)/(float) ppuY); - if (y >= 0 && (y + clientSize.y) < GetBuffer().GetCachedSize().y) - { - if (startYUnits != yUnits) - { - SetScrollbars(ppuX, ppuY, sxUnits, syUnits, 0, yUnits); - scrolled = true; - } -#if !wxRICHTEXT_USE_OWN_CARET - if (scrolled) -#endif - PositionCaret(); - - return scrolled; - } - } - - // Going down - if (keyCode == WXK_DOWN || keyCode == WXK_NUMPAD_DOWN || - keyCode == WXK_RIGHT || keyCode == WXK_NUMPAD_RIGHT || - keyCode == WXK_END || keyCode == WXK_NUMPAD_END || - keyCode == WXK_PAGEDOWN || keyCode == WXK_NUMPAD_PAGEDOWN) - { - if ((rect.y + rect.height) > (clientSize.y + startY)) - { - // Make it scroll so this item is at the bottom - // of the window - int y = rect.y - (clientSize.y - rect.height); - int yUnits = (int) (0.5 + ((float) y)/(float) ppuY); - - // If we're still off the screen, scroll another line down - if ((rect.y + rect.height) > (clientSize.y + (yUnits*ppuY))) - yUnits ++; - - if (startYUnits != yUnits) - { - SetScrollbars(ppuX, ppuY, sxUnits, syUnits, 0, yUnits); - scrolled = true; - } - } - else if (rect.y < (startY + GetBuffer().GetTopMargin())) - { - // Make it scroll so this item is at the top - // of the window - int y = rect.y - GetBuffer().GetTopMargin(); - int yUnits = (int) (0.5 + ((float) y)/(float) ppuY); - - if (startYUnits != yUnits) - { - SetScrollbars(ppuX, ppuY, sxUnits, syUnits, 0, yUnits); - scrolled = true; - } - } - } - // Going up - else if (keyCode == WXK_UP || keyCode == WXK_NUMPAD_UP || - keyCode == WXK_LEFT || keyCode == WXK_NUMPAD_LEFT || - keyCode == WXK_HOME || keyCode == WXK_NUMPAD_HOME || - keyCode == WXK_PAGEUP || keyCode == WXK_NUMPAD_PAGEUP ) - { - if (rect.y < (startY + GetBuffer().GetBottomMargin())) - { - // Make it scroll so this item is at the top - // of the window - int y = rect.y - GetBuffer().GetTopMargin(); - int yUnits = (int) (0.5 + ((float) y)/(float) ppuY); - - if (startYUnits != yUnits) - { - SetScrollbars(ppuX, ppuY, sxUnits, syUnits, 0, yUnits); - scrolled = true; - } - } - else if ((rect.y + rect.height) > (clientSize.y + startY)) - { - // Make it scroll so this item is at the bottom - // of the window - int y = rect.y - (clientSize.y - rect.height); - int yUnits = (int) (0.5 + ((float) y)/(float) ppuY); - - // If we're still off the screen, scroll another line down - if ((rect.y + rect.height) > (clientSize.y + (yUnits*ppuY))) - yUnits ++; - - if (startYUnits != yUnits) - { - SetScrollbars(ppuX, ppuY, sxUnits, syUnits, 0, yUnits); - scrolled = true; - } - } - } - -#if !wxRICHTEXT_USE_OWN_CARET - if (scrolled) -#endif - PositionCaret(); - - return scrolled; -} - -/// Is the given position visible on the screen? -bool wxRichTextCtrl::IsPositionVisible(long pos) const -{ - wxRichTextLine* line = GetVisibleLineForCaretPosition(pos-1); - - if (!line) - return false; - - int ppuX, ppuY; - GetScrollPixelsPerUnit(& ppuX, & ppuY); - - int startX, startY; - GetViewStart(& startX, & startY); - startX = 0; - startY = startY * ppuY; - - wxRect rect = line->GetRect(); - wxSize clientSize = GetClientSize(); - clientSize.y -= GetBuffer().GetBottomMargin(); - - return (rect.GetTop() >= (startY + GetBuffer().GetTopMargin())) && (rect.GetBottom() <= (startY + clientSize.y)); -} - -void wxRichTextCtrl::SetCaretPosition(long position, bool showAtLineStart) -{ - m_caretPosition = position; - m_caretAtLineStart = showAtLineStart; -} - -/// Move caret one visual step forward: this may mean setting a flag -/// and keeping the same position if we're going from the end of one line -/// to the start of the next, which may be the exact same caret position. -void wxRichTextCtrl::MoveCaretForward(long oldPosition) -{ - wxRichTextParagraph* para = GetBuffer().GetParagraphAtPosition(oldPosition); - - // Only do the check if we're not at the end of the paragraph (where things work OK - // anyway) - if (para && (oldPosition != para->GetRange().GetEnd() - 1)) - { - wxRichTextLine* line = GetBuffer().GetLineAtPosition(oldPosition); - - if (line) - { - wxRichTextRange lineRange = line->GetAbsoluteRange(); - - // We're at the end of a line. See whether we need to - // stay at the same actual caret position but change visual - // position, or not. - if (oldPosition == lineRange.GetEnd()) - { - if (m_caretAtLineStart) - { - // We're already at the start of the line, so actually move on now. - m_caretPosition = oldPosition + 1; - m_caretAtLineStart = false; - } - else - { - // We're showing at the end of the line, so keep to - // the same position but indicate that we're to show - // at the start of the next line. - m_caretPosition = oldPosition; - m_caretAtLineStart = true; - } - SetDefaultStyleToCursorStyle(); - return; - } - } - } - m_caretPosition ++; - SetDefaultStyleToCursorStyle(); -} - -/// Move caret one visual step backward: this may mean setting a flag -/// and keeping the same position if we're going from the end of one line -/// to the start of the next, which may be the exact same caret position. -void wxRichTextCtrl::MoveCaretBack(long oldPosition) -{ - wxRichTextParagraph* para = GetBuffer().GetParagraphAtPosition(oldPosition); - - // Only do the check if we're not at the start of the paragraph (where things work OK - // anyway) - if (para && (oldPosition != para->GetRange().GetStart())) - { - wxRichTextLine* line = GetBuffer().GetLineAtPosition(oldPosition); - - if (line) - { - wxRichTextRange lineRange = line->GetAbsoluteRange(); - - // We're at the start of a line. See whether we need to - // stay at the same actual caret position but change visual - // position, or not. - if (oldPosition == lineRange.GetStart()) - { - m_caretPosition = oldPosition-1; - m_caretAtLineStart = true; - return; - } - else if (oldPosition == lineRange.GetEnd()) - { - if (m_caretAtLineStart) - { - // We're at the start of the line, so keep the same caret position - // but clear the start-of-line flag. - m_caretPosition = oldPosition; - m_caretAtLineStart = false; - } - else - { - // We're showing at the end of the line, so go back - // to the previous character position. - m_caretPosition = oldPosition - 1; - } - SetDefaultStyleToCursorStyle(); - return; - } - } - } - m_caretPosition --; - SetDefaultStyleToCursorStyle(); -} - -/// Move right -bool wxRichTextCtrl::MoveRight(int noPositions, int flags) -{ - long endPos = GetBuffer().GetRange().GetEnd(); - - if (m_caretPosition + noPositions < endPos) - { - long oldPos = m_caretPosition; - long newPos = m_caretPosition + noPositions; - - bool extendSel = ExtendSelection(m_caretPosition, newPos, flags); - if (!extendSel) - SelectNone(); - - // Determine by looking at oldPos and m_caretPosition whether - // we moved from the end of a line to the start of the next line, in which case - // we want to adjust the caret position such that it is positioned at the - // start of the next line, rather than jumping past the first character of the - // line. - if (noPositions == 1 && !extendSel) - MoveCaretForward(oldPos); - else - SetCaretPosition(newPos); - - PositionCaret(); - SetDefaultStyleToCursorStyle(); - - return true; - } - else - return false; -} - -/// Move left -bool wxRichTextCtrl::MoveLeft(int noPositions, int flags) -{ - long startPos = -1; - - if (m_caretPosition > startPos - noPositions + 1) - { - long oldPos = m_caretPosition; - long newPos = m_caretPosition - noPositions; - bool extendSel = ExtendSelection(m_caretPosition, newPos, flags); - if (!extendSel) - SelectNone(); - - if (noPositions == 1 && !extendSel) - MoveCaretBack(oldPos); - else - SetCaretPosition(newPos); - - PositionCaret(); - SetDefaultStyleToCursorStyle(); - - return true; - } - else - return false; -} - -/// Move up -bool wxRichTextCtrl::MoveUp(int noLines, int flags) -{ - return MoveDown(- noLines, flags); -} - -/// Move up -bool wxRichTextCtrl::MoveDown(int noLines, int flags) -{ - if (!GetCaret()) - return false; - - long lineNumber = GetBuffer().GetVisibleLineNumber(m_caretPosition, true, m_caretAtLineStart); - wxPoint pt = GetCaret()->GetPosition(); - long newLine = lineNumber + noLines; - - if (lineNumber != -1) - { - if (noLines > 0) - { - long lastLine = GetBuffer().GetVisibleLineNumber(GetBuffer().GetRange().GetEnd()); - - if (newLine > lastLine) - return false; - } - else - { - if (newLine < 0) - return false; - } - } - - wxRichTextLine* lineObj = GetBuffer().GetLineForVisibleLineNumber(newLine); - if (lineObj) - { - pt.y = lineObj->GetAbsolutePosition().y + 2; - } - else - return false; - - long newPos = 0; - wxClientDC dc(this); - PrepareDC(dc); - dc.SetFont(GetFont()); - - int hitTest = GetBuffer().HitTest(dc, pt, newPos); - - if (hitTest != wxRICHTEXT_HITTEST_NONE) - { - // If end of previous line, and hitTest is wxRICHTEXT_HITTEST_BEFORE, - // we want to be at the end of the last line but with m_caretAtLineStart set to true, - // so we view the caret at the start of the line. - bool caretLineStart = false; - if (hitTest & wxRICHTEXT_HITTEST_BEFORE) - { - wxRichTextLine* thisLine = GetBuffer().GetLineAtPosition(newPos-1); - wxRichTextRange lineRange; - if (thisLine) - lineRange = thisLine->GetAbsoluteRange(); - - if (thisLine && (newPos-1) == lineRange.GetEnd()) - { - newPos --; - caretLineStart = true; - } - else - { - wxRichTextParagraph* para = GetBuffer().GetParagraphAtPosition(newPos); - if (para && para->GetRange().GetStart() == newPos) - newPos --; - } - } - - long newSelEnd = newPos; - - bool extendSel = ExtendSelection(m_caretPosition, newSelEnd, flags); - if (!extendSel) - SelectNone(); - - SetCaretPosition(newPos, caretLineStart); - PositionCaret(); - SetDefaultStyleToCursorStyle(); - - return true; - } - - return false; -} - -/// Move to the end of the paragraph -bool wxRichTextCtrl::MoveToParagraphEnd(int flags) -{ - wxRichTextParagraph* para = GetBuffer().GetParagraphAtPosition(m_caretPosition, true); - if (para) - { - long newPos = para->GetRange().GetEnd() - 1; - bool extendSel = ExtendSelection(m_caretPosition, newPos, flags); - if (!extendSel) - SelectNone(); - - SetCaretPosition(newPos); - PositionCaret(); - SetDefaultStyleToCursorStyle(); - - return true; - } - - return false; -} - -/// Move to the start of the paragraph -bool wxRichTextCtrl::MoveToParagraphStart(int flags) -{ - wxRichTextParagraph* para = GetBuffer().GetParagraphAtPosition(m_caretPosition, true); - if (para) - { - long newPos = para->GetRange().GetStart() - 1; - bool extendSel = ExtendSelection(m_caretPosition, newPos, flags); - if (!extendSel) - SelectNone(); - - SetCaretPosition(newPos); - PositionCaret(); - SetDefaultStyleToCursorStyle(); - - return true; - } - - return false; -} - -/// Move to the end of the line -bool wxRichTextCtrl::MoveToLineEnd(int flags) -{ - wxRichTextLine* line = GetVisibleLineForCaretPosition(m_caretPosition); - - if (line) - { - wxRichTextRange lineRange = line->GetAbsoluteRange(); - long newPos = lineRange.GetEnd(); - bool extendSel = ExtendSelection(m_caretPosition, newPos, flags); - if (!extendSel) - SelectNone(); - - SetCaretPosition(newPos); - PositionCaret(); - SetDefaultStyleToCursorStyle(); - - return true; - } - - return false; -} - -/// Move to the start of the line -bool wxRichTextCtrl::MoveToLineStart(int flags) -{ - wxRichTextLine* line = GetVisibleLineForCaretPosition(m_caretPosition); - if (line) - { - wxRichTextRange lineRange = line->GetAbsoluteRange(); - long newPos = lineRange.GetStart()-1; - - bool extendSel = ExtendSelection(m_caretPosition, newPos, flags); - if (!extendSel) - SelectNone(); - - wxRichTextParagraph* para = GetBuffer().GetParagraphForLine(line); - - SetCaretPosition(newPos, para->GetRange().GetStart() != lineRange.GetStart()); - PositionCaret(); - SetDefaultStyleToCursorStyle(); - - return true; - } - - return false; -} - -/// Move to the start of the buffer -bool wxRichTextCtrl::MoveHome(int flags) -{ - if (m_caretPosition != -1) - { - bool extendSel = ExtendSelection(m_caretPosition, -1, flags); - if (!extendSel) - SelectNone(); - - SetCaretPosition(-1); - PositionCaret(); - SetDefaultStyleToCursorStyle(); - - return true; - } - else - return false; -} - -/// Move to the end of the buffer -bool wxRichTextCtrl::MoveEnd(int flags) -{ - long endPos = GetBuffer().GetRange().GetEnd()-1; - - if (m_caretPosition != endPos) - { - bool extendSel = ExtendSelection(m_caretPosition, endPos, flags); - if (!extendSel) - SelectNone(); - - SetCaretPosition(endPos); - PositionCaret(); - SetDefaultStyleToCursorStyle(); - - return true; - } - else - return false; -} - -/// Move noPages pages up -bool wxRichTextCtrl::PageUp(int noPages, int flags) -{ - return PageDown(- noPages, flags); -} - -/// Move noPages pages down -bool wxRichTextCtrl::PageDown(int noPages, int flags) -{ - // Calculate which line occurs noPages * screen height further down. - wxRichTextLine* line = GetVisibleLineForCaretPosition(m_caretPosition); - if (line) - { - wxSize clientSize = GetClientSize(); - int newY = line->GetAbsolutePosition().y + noPages*clientSize.y; - - wxRichTextLine* newLine = GetBuffer().GetLineAtYPosition(newY); - if (newLine) - { - wxRichTextRange lineRange = newLine->GetAbsoluteRange(); - long pos = lineRange.GetStart()-1; - if (pos != m_caretPosition) - { - wxRichTextParagraph* para = GetBuffer().GetParagraphForLine(newLine); - - bool extendSel = ExtendSelection(m_caretPosition, pos, flags); - if (!extendSel) - SelectNone(); - - SetCaretPosition(pos, para->GetRange().GetStart() != lineRange.GetStart()); - PositionCaret(); - SetDefaultStyleToCursorStyle(); - - return true; - } - } - } - - return false; -} - -static bool wxRichTextCtrlIsWhitespace(const wxString& str) -{ - return str == wxT(" ") || str == wxT("\t"); -} - -// Finds the caret position for the next word -long wxRichTextCtrl::FindNextWordPosition(int direction) const -{ - long endPos = GetBuffer().GetRange().GetEnd(); - - if (direction > 0) - { - long i = m_caretPosition+1+direction; // +1 for conversion to character pos - - // First skip current text to space - while (i < endPos && i > -1) - { - // i is in character, not caret positions - wxString text = GetBuffer().GetTextForRange(wxRichTextRange(i, i)); - wxRichTextLine* line = GetBuffer().GetLineAtPosition(i, false); - if (line && (i == line->GetAbsoluteRange().GetEnd())) - { - break; - } - else if (!wxRichTextCtrlIsWhitespace(text) && !text.empty()) - i += direction; - else - { - break; - } - } - while (i < endPos && i > -1) - { - // i is in character, not caret positions - wxString text = GetBuffer().GetTextForRange(wxRichTextRange(i, i)); - wxRichTextLine* line = GetBuffer().GetLineAtPosition(i, false); - if (line && (i == line->GetAbsoluteRange().GetEnd())) - return wxMax(-1, i); - - if (text.empty()) // End of paragraph, or maybe an image - return wxMax(-1, i - 1); - else if (wxRichTextCtrlIsWhitespace(text) || text.empty()) - i += direction; - else - { - // Convert to caret position - return wxMax(-1, i - 1); - } - } - if (i >= endPos) - return endPos-1; - return i-1; - } - else - { - long i = m_caretPosition; - - // First skip white space - while (i < endPos && i > -1) - { - // i is in character, not caret positions - wxString text = GetBuffer().GetTextForRange(wxRichTextRange(i, i)); - wxRichTextLine* line = GetBuffer().GetLineAtPosition(i, false); - - if (text.empty() || (line && (i == line->GetAbsoluteRange().GetStart()))) // End of paragraph, or maybe an image - break; - else if (wxRichTextCtrlIsWhitespace(text) || text.empty()) - i += direction; - else - break; - } - // Next skip current text to space - while (i < endPos && i > -1) - { - // i is in character, not caret positions - wxString text = GetBuffer().GetTextForRange(wxRichTextRange(i, i)); - wxRichTextLine* line = GetBuffer().GetLineAtPosition(i, false); - if (line && line->GetAbsoluteRange().GetStart() == i) - return i-1; - - if (!wxRichTextCtrlIsWhitespace(text) /* && !text.empty() */) - i += direction; - else - { - return i; - } - } - if (i < -1) - return -1; - return i; - } -} - -/// Move n words left -bool wxRichTextCtrl::WordLeft(int WXUNUSED(n), int flags) -{ - long pos = FindNextWordPosition(-1); - if (pos != m_caretPosition) - { - wxRichTextParagraph* para = GetBuffer().GetParagraphAtPosition(pos, true); - - bool extendSel = ExtendSelection(m_caretPosition, pos, flags); - if (!extendSel) - SelectNone(); - - SetCaretPosition(pos, para->GetRange().GetStart() != pos); - PositionCaret(); - SetDefaultStyleToCursorStyle(); - - return true; - } - - return false; -} - -/// Move n words right -bool wxRichTextCtrl::WordRight(int WXUNUSED(n), int flags) -{ - long pos = FindNextWordPosition(1); - if (pos != m_caretPosition) - { - wxRichTextParagraph* para = GetBuffer().GetParagraphAtPosition(pos, true); - - bool extendSel = ExtendSelection(m_caretPosition, pos, flags); - if (!extendSel) - SelectNone(); - - SetCaretPosition(pos, para->GetRange().GetStart() != pos); - PositionCaret(); - SetDefaultStyleToCursorStyle(); - - return true; - } - - return false; -} - -/// Sizing -void wxRichTextCtrl::OnSize(wxSizeEvent& event) -{ - // Only do sizing optimization for large buffers - if (GetBuffer().GetRange().GetEnd() > m_delayedLayoutThreshold) - { - m_fullLayoutRequired = true; - m_fullLayoutTime = wxGetLocalTimeMillis(); - m_fullLayoutSavedPosition = GetFirstVisiblePosition(); - LayoutContent(true /* onlyVisibleRect */); - } - else - GetBuffer().Invalidate(wxRICHTEXT_ALL); - -#if wxRICHTEXT_BUFFERED_PAINTING - RecreateBuffer(); -#endif - - event.Skip(); -} - -/// Idle-time processing -void wxRichTextCtrl::OnIdle(wxIdleEvent& event) -{ -#if wxRICHTEXT_USE_OWN_CARET - if (((wxRichTextCaret*) GetCaret())->GetNeedsUpdate()) - { - ((wxRichTextCaret*) GetCaret())->SetNeedsUpdate(false); - PositionCaret(); - GetCaret()->Show(); - } -#endif - - const int layoutInterval = wxRICHTEXT_DEFAULT_LAYOUT_INTERVAL; - - if (m_fullLayoutRequired && (wxGetLocalTimeMillis() > (m_fullLayoutTime + layoutInterval))) - { - m_fullLayoutRequired = false; - m_fullLayoutTime = 0; - GetBuffer().Invalidate(wxRICHTEXT_ALL); - ShowPosition(m_fullLayoutSavedPosition); - Refresh(false); - } - - if (m_caretPositionForDefaultStyle != -2) - { - // If the caret position has changed, no longer reflect the default style - // in the UI. - if (GetCaretPosition() != m_caretPositionForDefaultStyle) - m_caretPositionForDefaultStyle = -2; - } - - event.Skip(); -} - -/// Scrolling -void wxRichTextCtrl::OnScroll(wxScrollWinEvent& event) -{ -#if wxRICHTEXT_USE_OWN_CARET - if (!((wxRichTextCaret*) GetCaret())->GetNeedsUpdate()) - { - GetCaret()->Hide(); - ((wxRichTextCaret*) GetCaret())->SetNeedsUpdate(); - } -#endif - - event.Skip(); -} - -/// Set up scrollbars, e.g. after a resize -void wxRichTextCtrl::SetupScrollbars(bool atTop) -{ - if (m_freezeCount) - return; - - if (GetBuffer().IsEmpty()) - { - SetScrollbars(0, 0, 0, 0, 0, 0); - return; - } - - // TODO: reimplement scrolling so we scroll by line, not by fixed number - // of pixels. See e.g. wxVScrolledWindow for ideas. - int pixelsPerUnit = 5; - wxSize clientSize = GetClientSize(); - - int maxHeight = GetBuffer().GetCachedSize().y + GetBuffer().GetTopMargin(); - - // Round up so we have at least maxHeight pixels - int unitsY = (int) (((float)maxHeight/(float)pixelsPerUnit) + 0.5); - - int startX = 0, startY = 0; - if (!atTop) - GetViewStart(& startX, & startY); - - int maxPositionX = 0; // wxMax(sz.x - clientSize.x, 0); - int maxPositionY = (int) ((((float)(wxMax((unitsY*pixelsPerUnit) - clientSize.y, 0)))/((float)pixelsPerUnit)) + 0.5); - - int newStartX = wxMin(maxPositionX, startX); - int newStartY = wxMin(maxPositionY, startY); - - int oldPPUX, oldPPUY; - int oldStartX, oldStartY; - int oldVirtualSizeX = 0, oldVirtualSizeY = 0; - GetScrollPixelsPerUnit(& oldPPUX, & oldPPUY); - GetViewStart(& oldStartX, & oldStartY); - GetVirtualSize(& oldVirtualSizeX, & oldVirtualSizeY); - if (oldPPUY > 0) - oldVirtualSizeY /= oldPPUY; - - if (oldPPUX == 0 && oldPPUY == pixelsPerUnit && oldVirtualSizeY == unitsY && oldStartX == newStartX && oldStartY == newStartY) - return; - - // Move to previous scroll position if - // possible - SetScrollbars(0, pixelsPerUnit, 0, unitsY, newStartX, newStartY); -} - -/// Paint the background -void wxRichTextCtrl::PaintBackground(wxDC& dc) -{ - wxColour backgroundColour = GetBackgroundColour(); - if (!backgroundColour.Ok()) - backgroundColour = wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE); - - // Clear the background - dc.SetBrush(wxBrush(backgroundColour)); - dc.SetPen(*wxTRANSPARENT_PEN); - wxRect windowRect(GetClientSize()); - windowRect.x -= 2; windowRect.y -= 2; - windowRect.width += 4; windowRect.height += 4; - - // We need to shift the rectangle to take into account - // scrolling. Converting device to logical coordinates. - CalcUnscrolledPosition(windowRect.x, windowRect.y, & windowRect.x, & windowRect.y); - dc.DrawRectangle(windowRect); -} - -#if wxRICHTEXT_BUFFERED_PAINTING -/// Recreate buffer bitmap if necessary -bool wxRichTextCtrl::RecreateBuffer(const wxSize& size) -{ - wxSize sz = size; - if (sz == wxDefaultSize) - sz = GetClientSize(); - - if (sz.x < 1 || sz.y < 1) - return false; - - if (!m_bufferBitmap.Ok() || m_bufferBitmap.GetWidth() < sz.x || m_bufferBitmap.GetHeight() < sz.y) - m_bufferBitmap = wxBitmap(sz.x, sz.y); - return m_bufferBitmap.Ok(); -} -#endif - -// ---------------------------------------------------------------------------- -// file IO functions -// ---------------------------------------------------------------------------- - -bool wxRichTextCtrl::DoLoadFile(const wxString& filename, int fileType) -{ - bool success = GetBuffer().LoadFile(filename, fileType); - if (success) - m_filename = filename; - - DiscardEdits(); - SetInsertionPoint(0); - LayoutContent(); - PositionCaret(); - SetupScrollbars(true); - Refresh(false); - SendTextUpdatedEvent(); - - if (success) - return true; - else - { - wxLogError(_("File couldn't be loaded.")); - - return false; - } -} - -bool wxRichTextCtrl::DoSaveFile(const wxString& filename, int fileType) -{ - if (GetBuffer().SaveFile(filename, fileType)) - { - m_filename = filename; - - DiscardEdits(); - - return true; - } - - wxLogError(_("The text couldn't be saved.")); - - return false; -} - -// ---------------------------------------------------------------------------- -// wxRichTextCtrl specific functionality -// ---------------------------------------------------------------------------- - -/// Add a new paragraph of text to the end of the buffer -wxRichTextRange wxRichTextCtrl::AddParagraph(const wxString& text) -{ - wxRichTextRange range = GetBuffer().AddParagraph(text); - LayoutContent(); - return range; -} - -/// Add an image -wxRichTextRange wxRichTextCtrl::AddImage(const wxImage& image) -{ - wxRichTextRange range = GetBuffer().AddImage(image); - LayoutContent(); - return range; -} - -// ---------------------------------------------------------------------------- -// selection and ranges -// ---------------------------------------------------------------------------- - -void wxRichTextCtrl::SelectAll() -{ - SetSelection(-1, -1); -} - -/// Select none -void wxRichTextCtrl::SelectNone() -{ - if (!(GetSelectionRange() == wxRichTextRange(-2, -2))) - { - wxRichTextRange oldSelection = m_selectionRange; - - m_selectionRange = wxRichTextRange(-2, -2); - - wxRichTextCtrlRefreshForSelectionChange(*this, oldSelection, m_selectionRange); - } - m_selectionAnchor = -2; -} - -static bool wxIsWordDelimiter(const wxString& text) -{ - return !text.IsEmpty() && !wxIsalnum(text[0]); -} - -/// Select the word at the given character position -bool wxRichTextCtrl::SelectWord(long position) -{ - if (position < 0 || position > GetBuffer().GetRange().GetEnd()) - return false; - - wxRichTextParagraph* para = GetBuffer().GetParagraphAtPosition(position); - if (!para) - return false; - - if (position == para->GetRange().GetEnd()) - position --; - - long positionStart = position; - long positionEnd = position; - - for (positionStart = position; positionStart >= para->GetRange().GetStart(); positionStart --) - { - wxString text = GetBuffer().GetTextForRange(wxRichTextRange(positionStart, positionStart)); - if (wxIsWordDelimiter(text)) - { - positionStart ++; - break; - } - } - if (positionStart < para->GetRange().GetStart()) - positionStart = para->GetRange().GetStart(); - - for (positionEnd = position; positionEnd < para->GetRange().GetEnd(); positionEnd ++) - { - wxString text = GetBuffer().GetTextForRange(wxRichTextRange(positionEnd, positionEnd)); - if (wxIsWordDelimiter(text)) - { - positionEnd --; - break; - } - } - if (positionEnd >= para->GetRange().GetEnd()) - positionEnd = para->GetRange().GetEnd(); - - if (positionEnd < positionStart) - return false; - - SetSelection(positionStart, positionEnd+1); - - if (positionStart >= 0) - { - MoveCaret(positionStart-1, true); - SetDefaultStyleToCursorStyle(); - } - - return true; -} - -wxString wxRichTextCtrl::GetStringSelection() const -{ - long from, to; - GetSelection(&from, &to); - - return GetRange(from, to); -} - -// ---------------------------------------------------------------------------- -// hit testing -// ---------------------------------------------------------------------------- - -wxTextCtrlHitTestResult -wxRichTextCtrl::HitTest(const wxPoint& pt, wxTextCoord *x, wxTextCoord *y) const -{ - // implement in terms of the other overload as the native ports typically - // can get the position and not (x, y) pair directly (although wxUniv - // directly gets x and y -- and so overrides this method as well) - long pos; - wxTextCtrlHitTestResult rc = HitTest(pt, &pos); - - if ( rc != wxTE_HT_UNKNOWN ) - { - PositionToXY(pos, x, y); - } - - return rc; -} - -wxTextCtrlHitTestResult -wxRichTextCtrl::HitTest(const wxPoint& pt, - long * pos) const -{ - wxClientDC dc((wxRichTextCtrl*) this); - ((wxRichTextCtrl*)this)->PrepareDC(dc); - - // Buffer uses logical position (relative to start of buffer) - // so convert - wxPoint pt2 = GetLogicalPoint(pt); - - int hit = ((wxRichTextCtrl*)this)->GetBuffer().HitTest(dc, pt2, *pos); - - if ((hit & wxRICHTEXT_HITTEST_BEFORE) && (hit & wxRICHTEXT_HITTEST_OUTSIDE)) - return wxTE_HT_BEFORE; - else if ((hit & wxRICHTEXT_HITTEST_AFTER) && (hit & wxRICHTEXT_HITTEST_OUTSIDE)) - return wxTE_HT_BEYOND; - else if (hit & (wxRICHTEXT_HITTEST_BEFORE|wxRICHTEXT_HITTEST_AFTER)) - return wxTE_HT_ON_TEXT; - - return wxTE_HT_UNKNOWN; -} - -// ---------------------------------------------------------------------------- -// set/get the controls text -// ---------------------------------------------------------------------------- - -wxString wxRichTextCtrl::GetValue() const -{ - return GetBuffer().GetText(); -} - -wxString wxRichTextCtrl::GetRange(long from, long to) const -{ - // Public API for range is different from internals - return GetBuffer().GetTextForRange(wxRichTextRange(from, to-1)); -} - -void wxRichTextCtrl::DoSetValue(const wxString& value, int flags) -{ - // Don't call Clear here, since it always sends a text updated event - m_buffer.ResetAndClearCommands(); - m_buffer.SetDirty(true); - m_caretPosition = -1; - m_caretPositionForDefaultStyle = -2; - m_caretAtLineStart = false; - m_selectionRange.SetRange(-2, -2); - - Scroll(0,0); - - if (m_freezeCount == 0) - { - LayoutContent(); - Refresh(false); - } - - if (!value.IsEmpty()) - { - // Remove empty paragraph - GetBuffer().Clear(); - DoWriteText(value, flags); - - // for compatibility, don't move the cursor when doing SetValue() - SetInsertionPoint(0); - } - else - { - // still send an event for consistency - if (flags & SetValue_SendEvent) - SendTextUpdatedEvent(); - } - DiscardEdits(); -} - -void wxRichTextCtrl::WriteText(const wxString& value) -{ - DoWriteText(value); -} - -void wxRichTextCtrl::DoWriteText(const wxString& value, int flags) -{ - wxString valueUnix = wxTextFile::Translate(value, wxTextFileType_Unix); - - GetBuffer().InsertTextWithUndo(m_caretPosition+1, valueUnix, this, wxRICHTEXT_INSERT_WITH_PREVIOUS_PARAGRAPH_STYLE); - - if ( flags & SetValue_SendEvent ) - SendTextUpdatedEvent(); -} - -void wxRichTextCtrl::AppendText(const wxString& text) -{ - SetInsertionPointEnd(); - - WriteText(text); -} - -/// Write an image at the current insertion point -bool wxRichTextCtrl::WriteImage(const wxImage& image, int bitmapType) -{ - wxRichTextImageBlock imageBlock; - - wxImage image2 = image; - if (imageBlock.MakeImageBlock(image2, bitmapType)) - return WriteImage(imageBlock); - - return false; -} - -bool wxRichTextCtrl::WriteImage(const wxString& filename, int bitmapType) -{ - wxRichTextImageBlock imageBlock; - - wxImage image; - if (imageBlock.MakeImageBlock(filename, bitmapType, image, false)) - return WriteImage(imageBlock); - - return false; -} - -bool wxRichTextCtrl::WriteImage(const wxRichTextImageBlock& imageBlock) -{ - return GetBuffer().InsertImageWithUndo(m_caretPosition+1, imageBlock, this); -} - -bool wxRichTextCtrl::WriteImage(const wxBitmap& bitmap, int bitmapType) -{ - if (bitmap.Ok()) - { - wxRichTextImageBlock imageBlock; - - wxImage image = bitmap.ConvertToImage(); - if (image.Ok() && imageBlock.MakeImageBlock(image, bitmapType)) - return WriteImage(imageBlock); - } - - return false; -} - -/// Insert a newline (actually paragraph) at the current insertion point. -bool wxRichTextCtrl::Newline() -{ - return GetBuffer().InsertNewlineWithUndo(m_caretPosition+1, this, wxRICHTEXT_INSERT_WITH_PREVIOUS_PARAGRAPH_STYLE); -} - -/// Insert a line break at the current insertion point. -bool wxRichTextCtrl::LineBreak() -{ - wxString text; - text = wxRichTextLineBreakChar; - return GetBuffer().InsertTextWithUndo(m_caretPosition+1, text, this); -} - -// ---------------------------------------------------------------------------- -// Clipboard operations -// ---------------------------------------------------------------------------- - -void wxRichTextCtrl::Copy() -{ - if (CanCopy()) - { - wxRichTextRange range = GetInternalSelectionRange(); - GetBuffer().CopyToClipboard(range); - } -} - -void wxRichTextCtrl::Cut() -{ - if (CanCut()) - { - wxRichTextRange range = GetInternalSelectionRange(); - GetBuffer().CopyToClipboard(range); - - DeleteSelectedContent(); - LayoutContent(); - Refresh(false); - } -} - -void wxRichTextCtrl::Paste() -{ - if (CanPaste()) - { - BeginBatchUndo(_("Paste")); - - long newPos = m_caretPosition; - DeleteSelectedContent(& newPos); - - GetBuffer().PasteFromClipboard(newPos); - - EndBatchUndo(); - } -} - -void wxRichTextCtrl::DeleteSelection() -{ - if (CanDeleteSelection()) - { - DeleteSelectedContent(); - } -} - -bool wxRichTextCtrl::HasSelection() const -{ - return m_selectionRange.GetStart() != -2 && m_selectionRange.GetEnd() != -2; -} - -bool wxRichTextCtrl::CanCopy() const -{ - // Can copy if there's a selection - return HasSelection(); -} - -bool wxRichTextCtrl::CanCut() const -{ - return HasSelection() && IsEditable(); -} - -bool wxRichTextCtrl::CanPaste() const -{ - if ( !IsEditable() ) - return false; - - return GetBuffer().CanPasteFromClipboard(); -} - -bool wxRichTextCtrl::CanDeleteSelection() const -{ - return HasSelection() && IsEditable(); -} - - -// ---------------------------------------------------------------------------- -// Accessors -// ---------------------------------------------------------------------------- - -void wxRichTextCtrl::SetContextMenu(wxMenu* menu) -{ - if (m_contextMenu && m_contextMenu != menu) - delete m_contextMenu; - m_contextMenu = menu; -} - -void wxRichTextCtrl::SetEditable(bool editable) -{ - m_editable = editable; -} - -void wxRichTextCtrl::SetInsertionPoint(long pos) -{ - SelectNone(); - - m_caretPosition = pos - 1; - - PositionCaret(); - - SetDefaultStyleToCursorStyle(); -} - -void wxRichTextCtrl::SetInsertionPointEnd() -{ - long pos = GetLastPosition(); - SetInsertionPoint(pos); -} - -long wxRichTextCtrl::GetInsertionPoint() const -{ - return m_caretPosition+1; -} - -wxTextPos wxRichTextCtrl::GetLastPosition() const -{ - return GetBuffer().GetRange().GetEnd(); -} - -// If the return values from and to are the same, there is no -// selection. -void wxRichTextCtrl::GetSelection(long* from, long* to) const -{ - *from = m_selectionRange.GetStart(); - *to = m_selectionRange.GetEnd(); - if ((*to) != -1 && (*to) != -2) - (*to) ++; -} - -bool wxRichTextCtrl::IsEditable() const -{ - return m_editable; -} - -// ---------------------------------------------------------------------------- -// selection -// ---------------------------------------------------------------------------- - -void wxRichTextCtrl::SetSelection(long from, long to) -{ - // if from and to are both -1, it means (in wxWidgets) that all text should - // be selected. - if ( (from == -1) && (to == -1) ) - { - from = 0; - to = GetLastPosition()+1; - } - - DoSetSelection(from, to); -} - -void wxRichTextCtrl::DoSetSelection(long from, long to, bool WXUNUSED(scrollCaret)) -{ - if (from == to) - { - SelectNone(); - } - else - { - wxRichTextRange oldSelection = m_selectionRange; - m_selectionAnchor = from-1; - m_selectionRange.SetRange(from, to-1); - - m_caretPosition = wxMax(-1, to-1); - - wxRichTextCtrlRefreshForSelectionChange(*this, oldSelection, m_selectionRange); - PositionCaret(); - } -} - -// ---------------------------------------------------------------------------- -// Editing -// ---------------------------------------------------------------------------- - -void wxRichTextCtrl::Replace(long WXUNUSED(from), long WXUNUSED(to), - const wxString& value) -{ - BeginBatchUndo(_("Replace")); - - DeleteSelectedContent(); - - DoWriteText(value, SetValue_SelectionOnly); - - EndBatchUndo(); -} - -void wxRichTextCtrl::Remove(long from, long to) -{ - SelectNone(); - - GetBuffer().DeleteRangeWithUndo(wxRichTextRange(from, to-1), this); - - LayoutContent(); - if (!IsFrozen()) - Refresh(false); -} - -bool wxRichTextCtrl::IsModified() const -{ - return m_buffer.IsModified(); -} - -void wxRichTextCtrl::MarkDirty() -{ - m_buffer.Modify(true); -} - -void wxRichTextCtrl::DiscardEdits() -{ - m_caretPositionForDefaultStyle = -2; - m_buffer.Modify(false); - m_buffer.GetCommandProcessor()->ClearCommands(); -} - -int wxRichTextCtrl::GetNumberOfLines() const -{ - return GetBuffer().GetParagraphCount(); -} - -// ---------------------------------------------------------------------------- -// Positions <-> coords -// ---------------------------------------------------------------------------- - -long wxRichTextCtrl::XYToPosition(long x, long y) const -{ - return GetBuffer().XYToPosition(x, y); -} - -bool wxRichTextCtrl::PositionToXY(long pos, long *x, long *y) const -{ - return GetBuffer().PositionToXY(pos, x, y); -} - -// ---------------------------------------------------------------------------- -// -// ---------------------------------------------------------------------------- - -void wxRichTextCtrl::ShowPosition(long pos) -{ - if (!IsPositionVisible(pos)) - ScrollIntoView(pos-1, WXK_DOWN); -} - -int wxRichTextCtrl::GetLineLength(long lineNo) const -{ - return GetBuffer().GetParagraphLength(lineNo); -} - -wxString wxRichTextCtrl::GetLineText(long lineNo) const -{ - return GetBuffer().GetParagraphText(lineNo); -} - -// ---------------------------------------------------------------------------- -// Undo/redo -// ---------------------------------------------------------------------------- - -void wxRichTextCtrl::Undo() -{ - if (CanUndo()) - { - GetCommandProcessor()->Undo(); - } -} - -void wxRichTextCtrl::Redo() -{ - if (CanRedo()) - { - GetCommandProcessor()->Redo(); - } -} - -bool wxRichTextCtrl::CanUndo() const -{ - return GetCommandProcessor()->CanUndo() && IsEditable(); -} - -bool wxRichTextCtrl::CanRedo() const -{ - return GetCommandProcessor()->CanRedo() && IsEditable(); -} - -// ---------------------------------------------------------------------------- -// implementation details -// ---------------------------------------------------------------------------- - -void wxRichTextCtrl::Command(wxCommandEvent& event) -{ - SetValue(event.GetString()); - GetEventHandler()->ProcessEvent(event); -} - -void wxRichTextCtrl::OnDropFiles(wxDropFilesEvent& event) -{ - // By default, load the first file into the text window. - if (event.GetNumberOfFiles() > 0) - { - LoadFile(event.GetFiles()[0]); - } -} - -wxSize wxRichTextCtrl::DoGetBestSize() const -{ - return wxSize(10, 10); -} - -// ---------------------------------------------------------------------------- -// standard handlers for standard edit menu events -// ---------------------------------------------------------------------------- - -void wxRichTextCtrl::OnCut(wxCommandEvent& WXUNUSED(event)) -{ - Cut(); -} - -void wxRichTextCtrl::OnClear(wxCommandEvent& WXUNUSED(event)) -{ - DeleteSelection(); -} - -void wxRichTextCtrl::OnCopy(wxCommandEvent& WXUNUSED(event)) -{ - Copy(); -} - -void wxRichTextCtrl::OnPaste(wxCommandEvent& WXUNUSED(event)) -{ - Paste(); -} - -void wxRichTextCtrl::OnUndo(wxCommandEvent& WXUNUSED(event)) -{ - Undo(); -} - -void wxRichTextCtrl::OnRedo(wxCommandEvent& WXUNUSED(event)) -{ - Redo(); -} - -void wxRichTextCtrl::OnUpdateCut(wxUpdateUIEvent& event) -{ - event.Enable( CanCut() ); -} - -void wxRichTextCtrl::OnUpdateCopy(wxUpdateUIEvent& event) -{ - event.Enable( CanCopy() ); -} - -void wxRichTextCtrl::OnUpdateClear(wxUpdateUIEvent& event) -{ - event.Enable( CanDeleteSelection() ); -} - -void wxRichTextCtrl::OnUpdatePaste(wxUpdateUIEvent& event) -{ - event.Enable( CanPaste() ); -} - -void wxRichTextCtrl::OnUpdateUndo(wxUpdateUIEvent& event) -{ - event.Enable( CanUndo() ); - event.SetText( GetCommandProcessor()->GetUndoMenuLabel() ); -} - -void wxRichTextCtrl::OnUpdateRedo(wxUpdateUIEvent& event) -{ - event.Enable( CanRedo() ); - event.SetText( GetCommandProcessor()->GetRedoMenuLabel() ); -} - -void wxRichTextCtrl::OnSelectAll(wxCommandEvent& WXUNUSED(event)) -{ - if (GetLastPosition() > 0) - SelectAll(); -} - -void wxRichTextCtrl::OnUpdateSelectAll(wxUpdateUIEvent& event) -{ - event.Enable(GetLastPosition() > 0); -} - -void wxRichTextCtrl::OnContextMenu(wxContextMenuEvent& event) -{ - if (event.GetEventObject() != this) - { - event.Skip(); - return; - } - - if (m_contextMenu) - PopupMenu(m_contextMenu); - return; -} - -bool wxRichTextCtrl::SetStyle(long start, long end, const wxTextAttrEx& style) -{ - return GetBuffer().SetStyle(wxRichTextRange(start, end-1), style); -} - -bool wxRichTextCtrl::SetStyle(long start, long end, const wxTextAttr& style) -{ - return GetBuffer().SetStyle(wxRichTextRange(start, end-1), wxTextAttrEx(style)); -} - -bool wxRichTextCtrl::SetStyle(const wxRichTextRange& range, const wxRichTextAttr& style) -{ - return GetBuffer().SetStyle(range.ToInternal(), style); -} - -// extended style setting operation with flags including: -// wxRICHTEXT_SETSTYLE_WITH_UNDO, wxRICHTEXT_SETSTYLE_OPTIMIZE, wxRICHTEXT_SETSTYLE_PARAGRAPHS_ONLY. -// see richtextbuffer.h for more details. -bool wxRichTextCtrl::SetStyleEx(long start, long end, const wxTextAttrEx& style, int flags) -{ - return GetBuffer().SetStyle(wxRichTextRange(start, end-1), style, flags); -} - -bool wxRichTextCtrl::SetStyleEx(const wxRichTextRange& range, const wxTextAttrEx& style, int flags) -{ - return GetBuffer().SetStyle(range.ToInternal(), style, flags); -} - -bool wxRichTextCtrl::SetStyleEx(const wxRichTextRange& range, const wxRichTextAttr& style, int flags) -{ - return GetBuffer().SetStyle(range.ToInternal(), style, flags); -} - -bool wxRichTextCtrl::SetDefaultStyle(const wxTextAttrEx& style) -{ - return GetBuffer().SetDefaultStyle(style); -} - -bool wxRichTextCtrl::SetDefaultStyle(const wxTextAttr& style) -{ - return GetBuffer().SetDefaultStyle(wxTextAttrEx(style)); -} - -const wxTextAttrEx& wxRichTextCtrl::GetDefaultStyleEx() const -{ - return GetBuffer().GetDefaultStyle(); -} - -const wxTextAttr& wxRichTextCtrl::GetDefaultStyle() const -{ - return GetBuffer().GetDefaultStyle(); -} - -bool wxRichTextCtrl::GetStyle(long position, wxTextAttr& style) -{ - wxTextAttrEx attr(style); - if (GetBuffer().GetStyle(position, attr)) - { - style = attr; - return true; - } - else - return false; -} - -bool wxRichTextCtrl::GetStyle(long position, wxTextAttrEx& style) -{ - return GetBuffer().GetStyle(position, style); -} - -bool wxRichTextCtrl::GetStyle(long position, wxRichTextAttr& style) -{ - return GetBuffer().GetStyle(position, style); -} - -// get the common set of styles for the range -bool wxRichTextCtrl::GetStyleForRange(const wxRichTextRange& range, wxRichTextAttr& style) -{ - wxTextAttrEx styleEx; - if (GetBuffer().GetStyleForRange(range.ToInternal(), styleEx)) - { - style = styleEx; - return true; - } - else - return false; -} - -bool wxRichTextCtrl::GetStyleForRange(const wxRichTextRange& range, wxTextAttrEx& style) -{ - return GetBuffer().GetStyleForRange(range.ToInternal(), style); -} - -/// Get the content (uncombined) attributes for this position. - -bool wxRichTextCtrl::GetUncombinedStyle(long position, wxTextAttr& style) -{ - wxTextAttrEx attr(style); - if (GetBuffer().GetUncombinedStyle(position, attr)) - { - style = attr; - return true; - } - else - return false; -} - -bool wxRichTextCtrl::GetUncombinedStyle(long position, wxTextAttrEx& style) -{ - return GetBuffer().GetUncombinedStyle(position, style); -} - -bool wxRichTextCtrl::GetUncombinedStyle(long position, wxRichTextAttr& style) -{ - return GetBuffer().GetUncombinedStyle(position, style); -} - -/// Set font, and also the buffer attributes -bool wxRichTextCtrl::SetFont(const wxFont& font) -{ - wxControl::SetFont(font); - - wxTextAttrEx attr = GetBuffer().GetAttributes(); - attr.SetFont(font); - GetBuffer().SetBasicStyle(attr); - - GetBuffer().Invalidate(wxRICHTEXT_ALL); - Refresh(false); - - return true; -} - -/// Transform logical to physical -wxPoint wxRichTextCtrl::GetPhysicalPoint(const wxPoint& ptLogical) const -{ - wxPoint pt; - CalcScrolledPosition(ptLogical.x, ptLogical.y, & pt.x, & pt.y); - - return pt; -} - -/// Transform physical to logical -wxPoint wxRichTextCtrl::GetLogicalPoint(const wxPoint& ptPhysical) const -{ - wxPoint pt; - CalcUnscrolledPosition(ptPhysical.x, ptPhysical.y, & pt.x, & pt.y); - - return pt; -} - -/// Position the caret -void wxRichTextCtrl::PositionCaret() -{ - if (!GetCaret()) - return; - - wxRect caretRect; - if (GetCaretPositionForIndex(GetCaretPosition(), caretRect)) - { - wxPoint newPt = caretRect.GetPosition(); - wxSize newSz = caretRect.GetSize(); - wxPoint pt = GetPhysicalPoint(newPt); - if (GetCaret()->GetPosition() != pt || GetCaret()->GetSize() != newSz) - { - //wxLogDebug(wxT("Positioning caret %d, %d"), pt.x, pt.y); - GetCaret()->Hide(); - if (GetCaret()->GetSize() != newSz) - GetCaret()->SetSize(newSz); - - int halfSize = newSz.y/2; - // If the caret is beyond the margin, hide it by moving it out of the way - if (((pt.y + halfSize) < GetBuffer().GetTopMargin()) || ((pt.y + halfSize) > (GetClientSize().y - GetBuffer().GetBottomMargin()))) - pt.y = -200; - - GetCaret()->Move(pt); - GetCaret()->Show(); - } - } -} - -/// Get the caret height and position for the given character position -bool wxRichTextCtrl::GetCaretPositionForIndex(long position, wxRect& rect) -{ - wxClientDC dc(this); - dc.SetFont(GetFont()); - - PrepareDC(dc); - - wxPoint pt; - int height = 0; - - if (GetBuffer().FindPosition(dc, position, pt, & height, m_caretAtLineStart)) - { - // Caret height can't be zero - if (height == 0) - height = dc.GetCharHeight(); - - rect = wxRect(pt, wxSize(wxRICHTEXT_DEFAULT_CARET_WIDTH, height)); - return true; - } - - return false; -} - -/// Gets the line for the visible caret position. If the caret is -/// shown at the very end of the line, it means the next character is actually -/// on the following line. So let's get the line we're expecting to find -/// if this is the case. -wxRichTextLine* wxRichTextCtrl::GetVisibleLineForCaretPosition(long caretPosition) const -{ - wxRichTextLine* line = GetBuffer().GetLineAtPosition(caretPosition, true); - wxRichTextParagraph* para = GetBuffer().GetParagraphAtPosition(caretPosition, true); - if (line) - { - wxRichTextRange lineRange = line->GetAbsoluteRange(); - if (caretPosition == lineRange.GetStart()-1 && - (para->GetRange().GetStart() != lineRange.GetStart())) - { - if (!m_caretAtLineStart) - line = GetBuffer().GetLineAtPosition(caretPosition-1, true); - } - } - return line; -} - - -/// Move the caret to the given character position -bool wxRichTextCtrl::MoveCaret(long pos, bool showAtLineStart) -{ - if (GetBuffer().GetDirty()) - LayoutContent(); - - if (pos <= GetBuffer().GetRange().GetEnd()) - { - SetCaretPosition(pos, showAtLineStart); - - PositionCaret(); - - return true; - } - else - return false; -} - -/// Layout the buffer: which we must do before certain operations, such as -/// setting the caret position. -bool wxRichTextCtrl::LayoutContent(bool onlyVisibleRect) -{ - if (GetBuffer().GetDirty() || onlyVisibleRect) - { - wxRect availableSpace(GetClientSize()); - if (availableSpace.width == 0) - availableSpace.width = 10; - if (availableSpace.height == 0) - availableSpace.height = 10; - - int flags = wxRICHTEXT_FIXED_WIDTH|wxRICHTEXT_VARIABLE_HEIGHT; - if (onlyVisibleRect) - { - flags |= wxRICHTEXT_LAYOUT_SPECIFIED_RECT; - availableSpace.SetPosition(GetLogicalPoint(wxPoint(0, 0))); - } - - wxClientDC dc(this); - dc.SetFont(GetFont()); - - PrepareDC(dc); - - GetBuffer().Defragment(); - GetBuffer().UpdateRanges(); // If items were deleted, ranges need recalculation - GetBuffer().Layout(dc, availableSpace, flags); - GetBuffer().SetDirty(false); - - if (!IsFrozen()) - SetupScrollbars(); - } - - return true; -} - -/// Is all of the selection bold? -bool wxRichTextCtrl::IsSelectionBold() -{ - if (HasSelection()) - { - wxRichTextAttr attr; - wxRichTextRange range = GetSelectionRange(); - attr.SetFlags(wxTEXT_ATTR_FONT_WEIGHT); - attr.SetFontWeight(wxBOLD); - - return HasCharacterAttributes(range, attr); - } - else - { - // If no selection, then we need to combine current style with default style - // to see what the effect would be if we started typing. - wxRichTextAttr attr; - attr.SetFlags(wxTEXT_ATTR_FONT_WEIGHT); - - long pos = GetAdjustedCaretPosition(GetCaretPosition()); - if (GetStyle(pos, attr)) - { - if (IsDefaultStyleShowing()) - wxRichTextApplyStyle(attr, GetDefaultStyleEx()); - return attr.GetFontWeight() == wxBOLD; - } - } - return false; -} - -/// Is all of the selection italics? -bool wxRichTextCtrl::IsSelectionItalics() -{ - if (HasSelection()) - { - wxRichTextRange range = GetSelectionRange(); - wxRichTextAttr attr; - attr.SetFlags(wxTEXT_ATTR_FONT_ITALIC); - attr.SetFontStyle(wxITALIC); - - return HasCharacterAttributes(range, attr); - } - else - { - // If no selection, then we need to combine current style with default style - // to see what the effect would be if we started typing. - wxRichTextAttr attr; - attr.SetFlags(wxTEXT_ATTR_FONT_ITALIC); - - long pos = GetAdjustedCaretPosition(GetCaretPosition()); - if (GetStyle(pos, attr)) - { - if (IsDefaultStyleShowing()) - wxRichTextApplyStyle(attr, GetDefaultStyleEx()); - return attr.GetFontStyle() == wxITALIC; - } - } - return false; -} - -/// Is all of the selection underlined? -bool wxRichTextCtrl::IsSelectionUnderlined() -{ - if (HasSelection()) - { - wxRichTextRange range = GetSelectionRange(); - wxRichTextAttr attr; - attr.SetFlags(wxTEXT_ATTR_FONT_UNDERLINE); - attr.SetFontUnderlined(true); - - return HasCharacterAttributes(range, attr); - } - else - { - // If no selection, then we need to combine current style with default style - // to see what the effect would be if we started typing. - wxRichTextAttr attr; - attr.SetFlags(wxTEXT_ATTR_FONT_UNDERLINE); - long pos = GetAdjustedCaretPosition(GetCaretPosition()); - - if (GetStyle(pos, attr)) - { - if (IsDefaultStyleShowing()) - wxRichTextApplyStyle(attr, GetDefaultStyleEx()); - return attr.GetFontUnderlined(); - } - } - return false; -} - -/// Apply bold to the selection -bool wxRichTextCtrl::ApplyBoldToSelection() -{ - wxRichTextAttr attr; - attr.SetFlags(wxTEXT_ATTR_FONT_WEIGHT); - attr.SetFontWeight(IsSelectionBold() ? wxNORMAL : wxBOLD); - - if (HasSelection()) - return SetStyleEx(GetSelectionRange(), attr, wxRICHTEXT_SETSTYLE_WITH_UNDO|wxRICHTEXT_SETSTYLE_OPTIMIZE|wxRICHTEXT_SETSTYLE_CHARACTERS_ONLY); - else - { - wxRichTextAttr current = GetDefaultStyleEx(); - current.Apply(attr); - SetAndShowDefaultStyle(current); - } - return true; -} - -/// Apply italic to the selection -bool wxRichTextCtrl::ApplyItalicToSelection() -{ - wxRichTextAttr attr; - attr.SetFlags(wxTEXT_ATTR_FONT_ITALIC); - attr.SetFontStyle(IsSelectionItalics() ? wxNORMAL : wxITALIC); - - if (HasSelection()) - return SetStyleEx(GetSelectionRange(), attr, wxRICHTEXT_SETSTYLE_WITH_UNDO|wxRICHTEXT_SETSTYLE_OPTIMIZE|wxRICHTEXT_SETSTYLE_CHARACTERS_ONLY); - else - { - wxRichTextAttr current = GetDefaultStyleEx(); - current.Apply(attr); - SetAndShowDefaultStyle(current); - } - return true; -} - -/// Apply underline to the selection -bool wxRichTextCtrl::ApplyUnderlineToSelection() -{ - wxRichTextAttr attr; - attr.SetFlags(wxTEXT_ATTR_FONT_UNDERLINE); - attr.SetFontUnderlined(!IsSelectionUnderlined()); - - if (HasSelection()) - return SetStyleEx(GetSelectionRange(), attr, wxRICHTEXT_SETSTYLE_WITH_UNDO|wxRICHTEXT_SETSTYLE_OPTIMIZE|wxRICHTEXT_SETSTYLE_CHARACTERS_ONLY); - else - { - wxRichTextAttr current = GetDefaultStyleEx(); - current.Apply(attr); - SetAndShowDefaultStyle(current); - } - return true; -} - -/// Is all of the selection aligned according to the specified flag? -bool wxRichTextCtrl::IsSelectionAligned(wxTextAttrAlignment alignment) -{ - wxRichTextRange range; - if (HasSelection()) - range = GetSelectionRange(); - else - range = wxRichTextRange(GetCaretPosition()+1, GetCaretPosition()+2); - - wxRichTextAttr attr; - attr.SetAlignment(alignment); - - return HasParagraphAttributes(range, attr); -} - -/// Apply alignment to the selection -bool wxRichTextCtrl::ApplyAlignmentToSelection(wxTextAttrAlignment alignment) -{ - wxRichTextAttr attr; - attr.SetAlignment(alignment); - if (HasSelection()) - return SetStyle(GetSelectionRange(), attr); - else - { - wxRichTextParagraph* para = GetBuffer().GetParagraphAtPosition(GetCaretPosition()+1); - if (para) - return SetStyleEx(para->GetRange().FromInternal(), attr, wxRICHTEXT_SETSTYLE_WITH_UNDO|wxRICHTEXT_SETSTYLE_OPTIMIZE|wxRICHTEXT_SETSTYLE_PARAGRAPHS_ONLY); - } - return true; -} - -/// Apply a named style to the selection -bool wxRichTextCtrl::ApplyStyle(wxRichTextStyleDefinition* def) -{ - // Flags are defined within each definition, so only certain - // attributes are applied. - wxRichTextAttr attr(GetStyleSheet() ? def->GetStyleMergedWithBase(GetStyleSheet()) : def->GetStyle()); - - int flags = wxRICHTEXT_SETSTYLE_WITH_UNDO|wxRICHTEXT_SETSTYLE_OPTIMIZE|wxRICHTEXT_SETSTYLE_RESET; - - if (def->IsKindOf(CLASSINFO(wxRichTextListStyleDefinition))) - { - flags |= wxRICHTEXT_SETSTYLE_PARAGRAPHS_ONLY; - - wxRichTextRange range; - - if (HasSelection()) - range = GetSelectionRange(); - else - { - long pos = GetAdjustedCaretPosition(GetCaretPosition()); - range = wxRichTextRange(pos, pos+1); - } - - return SetListStyle(range, (wxRichTextListStyleDefinition*) def, flags); - } - - bool isPara = false; - - // Make sure the attr has the style name - if (def->IsKindOf(CLASSINFO(wxRichTextParagraphStyleDefinition))) - { - isPara = true; - attr.SetParagraphStyleName(def->GetName()); - - // If applying a paragraph style, we only want the paragraph nodes to adopt these - // attributes, and not the leaf nodes. This will allow the content (e.g. text) - // to change its style independently. - flags |= wxRICHTEXT_SETSTYLE_PARAGRAPHS_ONLY; - } - else - attr.SetCharacterStyleName(def->GetName()); - - if (HasSelection()) - return SetStyleEx(GetSelectionRange(), attr, flags); - else - { - wxRichTextAttr current = GetDefaultStyleEx(); - wxRichTextAttr defaultStyle(attr); - if (isPara) - { - // Don't apply extra character styles since they are already implied - // in the paragraph style - defaultStyle.SetFlags(defaultStyle.GetFlags() & ~wxTEXT_ATTR_CHARACTER); - } - current.Apply(defaultStyle); - SetAndShowDefaultStyle(current); - - // If it's a paragraph style, we want to apply the style to the - // current paragraph even if we didn't select any text. - if (isPara) - { - long pos = GetAdjustedCaretPosition(GetCaretPosition()); - wxRichTextParagraph* para = GetBuffer().GetParagraphAtPosition(pos); - if (para) - { - return SetStyleEx(para->GetRange().FromInternal(), attr, flags); - } - } - return true; - } -} - -/// Apply the style sheet to the buffer, for example if the styles have changed. -bool wxRichTextCtrl::ApplyStyleSheet(wxRichTextStyleSheet* styleSheet) -{ - if (!styleSheet) - styleSheet = GetBuffer().GetStyleSheet(); - if (!styleSheet) - return false; - - if (GetBuffer().ApplyStyleSheet(styleSheet)) - { - GetBuffer().Invalidate(wxRICHTEXT_ALL); - Refresh(false); - return true; - } - else - return false; -} - -/// Sets the default style to the style under the cursor -bool wxRichTextCtrl::SetDefaultStyleToCursorStyle() -{ - wxTextAttrEx attr; - attr.SetFlags(wxTEXT_ATTR_CHARACTER); - - // If at the start of a paragraph, use the next position. - long pos = GetAdjustedCaretPosition(GetCaretPosition()); - - if (GetUncombinedStyle(pos, attr)) - { - SetDefaultStyle(attr); - return true; - } - - return false; -} - -/// Returns the first visible position in the current view -long wxRichTextCtrl::GetFirstVisiblePosition() const -{ - wxRichTextLine* line = GetBuffer().GetLineAtYPosition(GetLogicalPoint(wxPoint(0, 0)).y); - if (line) - return line->GetAbsoluteRange().GetStart(); - else - return 0; -} - -/// Get the first visible point in the window -wxPoint wxRichTextCtrl::GetFirstVisiblePoint() const -{ - int ppuX, ppuY; - int startXUnits, startYUnits; - - GetScrollPixelsPerUnit(& ppuX, & ppuY); - GetViewStart(& startXUnits, & startYUnits); - - return wxPoint(startXUnits * ppuX, startYUnits * ppuY); -} - -/// The adjusted caret position is the character position adjusted to take -/// into account whether we're at the start of a paragraph, in which case -/// style information should be taken from the next position, not current one. -long wxRichTextCtrl::GetAdjustedCaretPosition(long caretPos) const -{ - wxRichTextParagraph* para = GetBuffer().GetParagraphAtPosition(caretPos+1); - - if (para && (caretPos+1 == para->GetRange().GetStart())) - caretPos ++; - return caretPos; -} - -/// Get/set the selection range in character positions. -1, -1 means no selection. -/// The range is in API convention, i.e. a single character selection is denoted -/// by (n, n+1) -wxRichTextRange wxRichTextCtrl::GetSelectionRange() const -{ - wxRichTextRange range = GetInternalSelectionRange(); - if (range != wxRichTextRange(-2,-2) && range != wxRichTextRange(-1,-1)) - range.SetEnd(range.GetEnd() + 1); - return range; -} - -void wxRichTextCtrl::SetSelectionRange(const wxRichTextRange& range) -{ - SetSelection(range.GetStart(), range.GetEnd()); -} - -/// Set list style -bool wxRichTextCtrl::SetListStyle(const wxRichTextRange& range, wxRichTextListStyleDefinition* def, int flags, int startFrom, int specifiedLevel) -{ - return GetBuffer().SetListStyle(range.ToInternal(), def, flags, startFrom, specifiedLevel); -} - -bool wxRichTextCtrl::SetListStyle(const wxRichTextRange& range, const wxString& defName, int flags, int startFrom, int specifiedLevel) -{ - return GetBuffer().SetListStyle(range.ToInternal(), defName, flags, startFrom, specifiedLevel); -} - -/// Clear list for given range -bool wxRichTextCtrl::ClearListStyle(const wxRichTextRange& range, int flags) -{ - return GetBuffer().ClearListStyle(range.ToInternal(), flags); -} - -/// Number/renumber any list elements in the given range -bool wxRichTextCtrl::NumberList(const wxRichTextRange& range, wxRichTextListStyleDefinition* def, int flags, int startFrom, int specifiedLevel) -{ - return GetBuffer().NumberList(range.ToInternal(), def, flags, startFrom, specifiedLevel); -} - -bool wxRichTextCtrl::NumberList(const wxRichTextRange& range, const wxString& defName, int flags, int startFrom, int specifiedLevel) -{ - return GetBuffer().NumberList(range.ToInternal(), defName, flags, startFrom, specifiedLevel); -} - -/// Promote the list items within the given range. promoteBy can be a positive or negative number, e.g. 1 or -1 -bool wxRichTextCtrl::PromoteList(int promoteBy, const wxRichTextRange& range, wxRichTextListStyleDefinition* def, int flags, int specifiedLevel) -{ - return GetBuffer().PromoteList(promoteBy, range.ToInternal(), def, flags, specifiedLevel); -} - -bool wxRichTextCtrl::PromoteList(int promoteBy, const wxRichTextRange& range, const wxString& defName, int flags, int specifiedLevel) -{ - return GetBuffer().PromoteList(promoteBy, range.ToInternal(), defName, flags, specifiedLevel); -} - -/// Deletes the content in the given range -bool wxRichTextCtrl::Delete(const wxRichTextRange& range) -{ - return GetBuffer().DeleteRangeWithUndo(range.ToInternal(), this); -} - -const wxArrayString& wxRichTextCtrl::GetAvailableFontNames() -{ - if (sm_availableFontNames.GetCount() == 0) - { - sm_availableFontNames = wxFontEnumerator::GetFacenames(); - sm_availableFontNames.Sort(); - } - return sm_availableFontNames; -} - -void wxRichTextCtrl::ClearAvailableFontNames() -{ - sm_availableFontNames.Clear(); -} - -// Refresh the area affected by a selection change -bool wxRichTextCtrlRefreshForSelectionChange(wxRichTextCtrl& ctrl, const wxRichTextRange& oldSelection, const wxRichTextRange& newSelection) -{ - // Calculate the refresh rectangle - just the affected lines - long firstPos, lastPos; - if (oldSelection.GetStart() == -2 && newSelection.GetStart() != -2) - { - firstPos = newSelection.GetStart(); - lastPos = newSelection.GetEnd(); - } - else if (oldSelection.GetStart() != -2 && newSelection.GetStart() == -2) - { - firstPos = oldSelection.GetStart(); - lastPos = oldSelection.GetEnd(); - } - else if (oldSelection.GetStart() == -2 && newSelection.GetStart() == -2) - { - return false; - } - else - { - firstPos = wxMin(oldSelection.GetStart(), newSelection.GetStart()); - lastPos = wxMax(oldSelection.GetEnd(), newSelection.GetEnd()); - } - - wxRichTextLine* firstLine = ctrl.GetBuffer().GetLineAtPosition(firstPos); - wxRichTextLine* lastLine = ctrl.GetBuffer().GetLineAtPosition(lastPos); - - if (firstLine && lastLine) - { - wxSize clientSize = ctrl.GetClientSize(); - wxPoint pt1 = ctrl.GetPhysicalPoint(firstLine->GetAbsolutePosition()); - wxPoint pt2 = ctrl.GetPhysicalPoint(lastLine->GetAbsolutePosition()) + wxPoint(0, lastLine->GetSize().y); - - pt1.x = 0; - pt1.y = wxMax(0, pt1.y); - pt2.x = 0; - pt2.y = wxMin(clientSize.y, pt2.y); - - wxRect rect(pt1, wxSize(clientSize.x, pt2.y - pt1.y)); - ctrl.RefreshRect(rect, false); - } - else - ctrl.Refresh(false); - - return true; -} - -#if wxRICHTEXT_USE_OWN_CARET - -// ---------------------------------------------------------------------------- -// initialization and destruction -// ---------------------------------------------------------------------------- - -void wxRichTextCaret::Init() -{ - m_hasFocus = true; - - m_xOld = - m_yOld = -1; - m_richTextCtrl = NULL; - m_needsUpdate = false; - m_flashOn = true; -} - -wxRichTextCaret::~wxRichTextCaret() -{ - if (m_timer.IsRunning()) - m_timer.Stop(); -} - -// ---------------------------------------------------------------------------- -// showing/hiding/moving the caret (base class interface) -// ---------------------------------------------------------------------------- - -void wxRichTextCaret::DoShow() -{ - m_flashOn = true; - - if (!m_timer.IsRunning()) - m_timer.Start(GetBlinkTime()); - - Refresh(); -} - -void wxRichTextCaret::DoHide() -{ - if (m_timer.IsRunning()) - m_timer.Stop(); - - Refresh(); -} - -void wxRichTextCaret::DoMove() -{ - if (IsVisible()) - { - Refresh(); - - if (m_xOld != -1 && m_yOld != -1) - { - if (m_richTextCtrl) - { - wxRect rect(GetPosition(), GetSize()); - m_richTextCtrl->RefreshRect(rect, false); - } - } - } - - m_xOld = m_x; - m_yOld = m_y; -} - -void wxRichTextCaret::DoSize() -{ - int countVisible = m_countVisible; - if (countVisible > 0) - { - m_countVisible = 0; - DoHide(); - } - - if (countVisible > 0) - { - m_countVisible = countVisible; - DoShow(); - } -} - -// ---------------------------------------------------------------------------- -// handling the focus -// ---------------------------------------------------------------------------- - -void wxRichTextCaret::OnSetFocus() -{ - m_hasFocus = true; - - if ( IsVisible() ) - Refresh(); -} - -void wxRichTextCaret::OnKillFocus() -{ - m_hasFocus = false; -} - -// ---------------------------------------------------------------------------- -// drawing the caret -// ---------------------------------------------------------------------------- - -void wxRichTextCaret::Refresh() -{ - if (m_richTextCtrl) - { - wxRect rect(GetPosition(), GetSize()); - m_richTextCtrl->RefreshRect(rect, false); - } -} - -void wxRichTextCaret::DoDraw(wxDC *dc) -{ - dc->SetPen( *wxBLACK_PEN ); - - dc->SetBrush(*(m_hasFocus ? wxBLACK_BRUSH : wxTRANSPARENT_BRUSH)); - dc->SetPen(*wxBLACK_PEN); - - wxPoint pt(m_x, m_y); - - if (m_richTextCtrl) - { - pt = m_richTextCtrl->GetLogicalPoint(pt); - } - if (IsVisible() && m_flashOn) - dc->DrawRectangle(pt.x, pt.y, m_width, m_height); -} - -void wxRichTextCaret::Notify() -{ - m_flashOn = !m_flashOn; - Refresh(); -} - -void wxRichTextCaretTimer::Notify() -{ - m_caret->Notify(); -} - -#endif - // wxRICHTEXT_USE_OWN_CARET -#endif - // wxUSE_RICHTEXT diff --git a/wxWidgets/src/richtext/richtextdialogs.pjd b/wxWidgets/src/richtext/richtextdialogs.pjd deleted file mode 100644 index 878c11e2de..0000000000 --- a/wxWidgets/src/richtext/richtextdialogs.pjd +++ /dev/null @@ -1,14780 +0,0 @@ - - -
- 0 - "" - "" - "" - "" - "" - 0 - 0 - 0 - 1 - 1 - 1 - 1 - 0 - "Julian Smart" - "(c) Julian Smart" - "" - 0 - 1 - 0 - 0 - "<All platforms>" - "<Any>" - "Standard" - "///////////////////////////////////////////////////////////////////////////// -// Name: %HEADER-FILENAME% -// Purpose: -// Author: %AUTHOR% -// Modified by: -// Created: %DATE% -// RCS-ID: -// Copyright: %COPYRIGHT% -// Licence: -///////////////////////////////////////////////////////////////////////////// - -" - "///////////////////////////////////////////////////////////////////////////// -// Name: %SOURCE-FILENAME% -// Purpose: -// Author: %AUTHOR% -// Modified by: -// Created: %DATE% -// RCS-ID: -// Copyright: %COPYRIGHT% -// Licence: -///////////////////////////////////////////////////////////////////////////// - -" - "///////////////////////////////////////////////////////////////////////////// -// Name: %SYMBOLS-FILENAME% -// Purpose: Symbols file -// Author: %AUTHOR% -// Modified by: -// Created: %DATE% -// RCS-ID: -// Copyright: %COPYRIGHT% -// Licence: -///////////////////////////////////////////////////////////////////////////// - -" - "#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma interface "%HEADER-FILENAME%" -#endif - -" - "#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma implementation "%HEADER-FILENAME%" -#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 - -" - " /// %BODY% -" - " -/*! - * %BODY% - */ - -" - "app_resources.h" - "app_resources.cpp" - "AppResources" - "app.h" - "app.cpp" - "Application" - 0 - "" - "<None>" - "iso-8859-1" - "utf-8" - "utf-8" - "" - 0 - 0 - 4 - " " - "" - 0 - 0 - 1 - 0 - 1 - 1 - 0 - 1 - 0 - 0 -
- - - "" - "data-document" - "" - "" - 0 - 1 - 0 - 0 - - "Configurations" - "config-data-document" - "" - "" - 0 - 1 - 0 - 0 - "" - 1 - -8519680 - "" - "Debug" - "ANSI" - "Static" - "Modular" - "GUI" - "wxMSW" - "Default" - "Dynamic" - "Yes" - "No" - "Yes" - "No" - "No" - "Yes" - "Yes" - "Yes" - "Yes" - "Yes" - "sys" - "Yes" - "%EXECUTABLE%" - "" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%WXVERSION%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - 0 - 1 - - - - - - - "Projects" - "root-document" - "" - "project" - 1 - 1 - 0 - 1 - - "Windows" - "html-document" - "" - "dialogsfolder" - 1 - 1 - 0 - 1 - - "wxRichTextFontPage" - "dialog-document" - "" - "dialog" - 0 - 1 - 0 - 0 - "2/10/2006" - "wbDialogProxy" - 10000 - 0 - "" - 0 - "" - "Standard" - 0 - 0 - "ID_RICHTEXTFONTPAGE" - 10000 - "wxRichTextFontPage" - "wxPanel" - "wxPanel" - "richtextfontpage.cpp" - "../../include/wx/richtext/richtextfontpage.h" - "" - "wxRichTextFontPage" - 1 - "" - 0 - "" - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - "" - "" - "" - "" - "" - "" - "Tiled" - 0 - 0 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 1 - 0 - 0 - 0 - "" - 0 - 1 - -1 - -1 - 400 - 300 - 0 - "" - - "wxBoxSizer V" - "dialog-control-document" - "" - "sizer" - 0 - 1 - 0 - 0 - "wbBoxSizerProxy" - "Vertical" - "" - "Centre" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "<Any platform>" - - "wxBoxSizer V" - "dialog-control-document" - "" - "sizer" - 0 - 1 - 0 - 0 - "2/10/2006" - "wbBoxSizerProxy" - "Vertical" - "" - "Expand" - "Centre" - 1 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "<Any platform>" - - "wxBoxSizer H" - "dialog-control-document" - "" - "sizer" - 0 - 1 - 0 - 0 - "2/10/2006" - "wbBoxSizerProxy" - "Horizontal" - "" - "Expand" - "Centre" - 1 - 5 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "<Any platform>" - - "wxBoxSizer V" - "dialog-control-document" - "" - "sizer" - 0 - 1 - 0 - 0 - "2/10/2006" - "wbBoxSizerProxy" - "Vertical" - "" - "Centre" - "Expand" - 1 - 5 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "<Any platform>" - - "wxStaticText: wxID_STATIC" - "dialog-control-document" - "" - "statictext" - 0 - 1 - 0 - 0 - "2/10/2006" - "wbStaticTextProxy" - "wxID_STATIC" - 5105 - "" - "wxStaticText" - "wxStaticText" - 1 - 0 - "" - "" - "" - "&Font:" - -1 - "" - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - "" - "" - "" - "" - "" - "" - "" - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Left" - "Centre" - 0 - 5 - 1 - 1 - 1 - 0 - 0 - 1 - 0 - "" - "" - - - "wxTextCtrl: ID_RICHTEXTFONTPAGE_FACETEXTCTRL" - "dialog-control-document" - "" - "textctrl" - 0 - 1 - 0 - 0 - "2/10/2006" - "wbTextCtrlProxy" - "wxEVT_COMMAND_TEXT_UPDATED|OnFaceTextCtrlUpdated" - "ID_RICHTEXTFONTPAGE_FACETEXTCTRL" - 10001 - "" - "wxTextCtrl" - "wxTextCtrl" - 1 - 0 - "" - "" - "m_faceTextCtrl" - "" - 0 - "Type a font name." - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - "" - "" - "" - "" - "" - "" - "" - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Expand" - "Centre" - 0 - 5 - 1 - 1 - 1 - 0 - 0 - 0 - 0 - "" - "" - 0 - - - "wxRichTextFontListBox: ID_RICHTEXTFONTPAGE_FACELISTBOX" - "dialog-control-document" - "" - "foreign" - 0 - 1 - 0 - 0 - "2/10/2006" - "wbForeignCtrlProxy" - "ID_RICHTEXTFONTPAGE_FACELISTBOX" - 10002 - "" - "wxRichTextFontListBox" - "wxWindow" - 1 - 0 - "" - "" - "m_faceListBox" - 1 - "Lists the available fonts." - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - "" - "" - "" - "" - "" - "" - "" - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - 200 - 100 - "Expand" - "Centre" - 1 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 1 - "" - "" - "" - - - - "wxBoxSizer V" - "dialog-control-document" - "" - "sizer" - 0 - 1 - 0 - 0 - "2/10/2006" - "wbBoxSizerProxy" - "Vertical" - "" - "Centre" - "Expand" - 0 - 5 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "<Any platform>" - - "wxStaticText: wxID_STATIC" - "dialog-control-document" - "" - "statictext" - 0 - 1 - 0 - 0 - "2/10/2006" - "wbStaticTextProxy" - "wxID_STATIC" - 5105 - "" - "wxStaticText" - "wxStaticText" - 1 - 0 - "" - "" - "" - "&Size:" - -1 - "" - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - "" - "" - "" - "" - "" - "" - "" - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Left" - "Centre" - 0 - 5 - 1 - 1 - 1 - 0 - 0 - 1 - 0 - "" - "" - - - "wxTextCtrl: ID_RICHTEXTFONTPAGE_SIZETEXTCTRL" - "dialog-control-document" - "" - "textctrl" - 0 - 1 - 0 - 0 - "2/10/2006" - "wbTextCtrlProxy" - "wxEVT_COMMAND_TEXT_UPDATED|OnSizeTextCtrlUpdated" - "ID_RICHTEXTFONTPAGE_SIZETEXTCTRL" - 10005 - "" - "wxTextCtrl" - "wxTextCtrl" - 1 - 0 - "" - "" - "m_sizeTextCtrl" - "" - 0 - "Type a size in points." - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - "" - "" - "" - "" - "" - "" - "" - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - 50 - -1 - "Expand" - "Centre" - 0 - 5 - 1 - 1 - 1 - 0 - 0 - 0 - 0 - "" - "" - 0 - - - "wxListBox: ID_RICHTEXTFONTPAGE_SIZELISTBOX" - "dialog-control-document" - "" - "listbox" - 0 - 1 - 0 - 0 - "2/10/2006" - "wbListBoxProxy" - "wxEVT_COMMAND_LISTBOX_SELECTED|OnSizeListBoxSelected" - "ID_RICHTEXTFONTPAGE_SIZELISTBOX" - 10006 - "" - "wxListBox" - "wxListBox" - 1 - 0 - "" - "" - "m_sizeListBox" - "" - "" - "Lists font sizes in points." - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - "" - "" - "" - "" - "" - "" - "" - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - 50 - -1 - "Centre" - "Centre" - 1 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 1 - "" - "" - - - - - "wxBoxSizer H" - "dialog-control-document" - "" - "sizer" - 0 - 1 - 0 - 0 - "2/10/2006" - "wbBoxSizerProxy" - "Horizontal" - "" - "Expand" - "Centre" - 0 - 5 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "<Any platform>" - - "wxBoxSizer V" - "dialog-control-document" - "" - "sizer" - 0 - 1 - 0 - 0 - "2/10/2006" - "wbBoxSizerProxy" - "Vertical" - "" - "Centre" - "Expand" - 0 - 5 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "<Any platform>" - - "wxStaticText: wxID_STATIC" - "dialog-control-document" - "" - "statictext" - 0 - 1 - 0 - 0 - "2/10/2006" - "wbStaticTextProxy" - "wxID_STATIC" - 5105 - "" - "wxStaticText" - "wxStaticText" - 1 - 0 - "" - "" - "" - "Font st&yle:" - -1 - "" - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - "" - "" - "" - "" - "" - "" - "" - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Left" - "Centre" - 0 - 5 - 1 - 1 - 1 - 0 - 0 - 1 - 0 - "" - "" - - - "wxComboBox: ID_RICHTEXTFONTPAGE_STYLECTRL" - "dialog-control-document" - "" - "combobox" - 0 - 1 - 0 - 0 - "2/10/2006" - "wbComboBoxProxy" - "wxEVT_COMMAND_COMBOBOX_SELECTED|OnStyleCtrlSelected" - "ID_RICHTEXTFONTPAGE_STYLECTRL" - 10007 - "" - "wxComboBox" - "wxComboBox" - 1 - 0 - "" - "" - "m_styleCtrl" - "" - "" - "Select regular or italic style." - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - "" - "" - "" - "" - "" - "" - "" - 0 - 0 - 1 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - 110 - -1 - "Expand" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "" - "" - - - - "wxBoxSizer V" - "dialog-control-document" - "" - "sizer" - 0 - 1 - 0 - 0 - "2/10/2006" - "wbBoxSizerProxy" - "Vertical" - "" - "Centre" - "Expand" - 0 - 5 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "<Any platform>" - - "wxStaticText: wxID_STATIC" - "dialog-control-document" - "" - "statictext" - 0 - 1 - 0 - 0 - "2/10/2006" - "wbStaticTextProxy" - "wxID_STATIC" - 5105 - "" - "wxStaticText" - "wxStaticText" - 1 - 0 - "" - "" - "" - "Font &weight:" - -1 - "" - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - "" - "" - "" - "" - "" - "" - "" - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Left" - "Centre" - 0 - 5 - 1 - 1 - 1 - 0 - 0 - 1 - 0 - "" - "" - - - "wxComboBox: ID_RICHTEXTFONTPAGE_WEIGHTCTRL" - "dialog-control-document" - "" - "combobox" - 0 - 1 - 0 - 0 - "2/10/2006" - "wbComboBoxProxy" - "wxEVT_COMMAND_COMBOBOX_SELECTED|OnWeightCtrlSelected" - "ID_RICHTEXTFONTPAGE_WEIGHTCTRL" - 10004 - "" - "wxComboBox" - "wxComboBox" - 1 - 0 - "" - "" - "m_weightCtrl" - "" - "" - "Select regular or bold." - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - "" - "" - "" - "" - "" - "" - "" - 0 - 0 - 1 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - 110 - -1 - "Expand" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "" - "" - - - - "wxBoxSizer V" - "dialog-control-document" - "" - "sizer" - 0 - 1 - 0 - 0 - "2/10/2006" - "wbBoxSizerProxy" - "Vertical" - "" - "Centre" - "Expand" - 0 - 5 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "<Any platform>" - - "wxStaticText: wxID_STATIC" - "dialog-control-document" - "" - "statictext" - 0 - 1 - 0 - 0 - "2/10/2006" - "wbStaticTextProxy" - "wxID_STATIC" - 5105 - "" - "wxStaticText" - "wxStaticText" - 1 - 0 - "" - "" - "" - "&Underlining:" - -1 - "" - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - "" - "" - "" - "" - "" - "" - "" - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Left" - "Centre" - 0 - 5 - 1 - 1 - 1 - 0 - 0 - 1 - 0 - "" - "" - - - "wxComboBox: ID_RICHTEXTFONTPAGE_UNDERLINING_CTRL" - "dialog-control-document" - "" - "combobox" - 0 - 1 - 0 - 0 - "2/10/2006" - "wbComboBoxProxy" - "wxEVT_COMMAND_COMBOBOX_SELECTED|OnUnderliningCtrlSelected|||wxRichTextFontPage" - "ID_RICHTEXTFONTPAGE_UNDERLINING_CTRL" - 10008 - "" - "wxComboBox" - "wxComboBox" - 1 - 0 - "" - "" - "m_underliningCtrl" - "" - "" - "Select underlining or no underlining." - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - "" - "" - "" - "" - "" - "" - "" - 0 - 0 - 1 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - 110 - -1 - "Expand" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "" - "" - - - - "Spacer" - "dialog-control-document" - "" - "spacer" - 0 - 1 - 0 - 0 - "wbSpacerProxy" - 0 - 0 - "Centre" - "Centre" - 1 - 5 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "<Any platform>" - - - "wxBoxSizer V" - "dialog-control-document" - "" - "sizer" - 0 - 1 - 0 - 0 - "2/10/2006" - "wbBoxSizerProxy" - "Vertical" - "" - "Centre" - "Expand" - 0 - 5 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "<Any platform>" - - "wxStaticText: wxID_STATIC" - "dialog-control-document" - "" - "statictext" - 0 - 1 - 0 - 0 - "2/10/2006" - "wbStaticTextProxy" - "wxID_STATIC" - 5105 - "" - "wxStaticText" - "wxStaticText" - 1 - 0 - "" - "" - "" - "&Colour:" - -1 - "" - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - "" - "" - "" - "" - "" - "" - "" - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Left" - "Centre" - 0 - 5 - 1 - 1 - 1 - 0 - 0 - 1 - 0 - "" - "" - - - "wxRichTextColourSwatchCtrl: ID_RICHTEXTFONTPAGE_COLOURCTRL" - "dialog-control-document" - "" - "foreign" - 0 - 1 - 0 - 0 - "2/10/2006" - "wbForeignCtrlProxy" - "ID_RICHTEXTFONTPAGE_COLOURCTRL" - 10009 - "" - "wxRichTextColourSwatchCtrl" - "wxWindow" - 1 - 0 - "" - "" - "m_colourCtrl" - 1 - "Click to change the text colour." - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - "" - "" - "" - "" - "" - "" - "" - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - 40 - 20 - "Expand" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "" - "" - "" - - - - "wxBoxSizer V" - "dialog-control-document" - "" - "sizer" - 0 - 1 - 0 - 0 - "wbBoxSizerProxy" - "Vertical" - "" - "Centre" - "Expand" - 0 - 5 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "<Any platform>" - - "wxStaticText: wxID_STATIC" - "dialog-control-document" - "" - "statictext" - 0 - 1 - 0 - 0 - "wbStaticTextProxy" - "wxID_STATIC" - 5105 - "" - "wxStaticText" - "wxStaticText" - 1 - 0 - "" - "" - "" - "&Bg colour:" - -1 - "" - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - "" - "" - "" - "" - "" - "" - "" - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Left" - "Centre" - 0 - 5 - 1 - 1 - 1 - 0 - 0 - 1 - 0 - "" - "" - - - "wxRichTextColourSwatchCtrl: ID_RICHTEXTFONTPAGE_BGCOLOURCTRL" - "dialog-control-document" - "" - "foreign" - 0 - 1 - 0 - 0 - "wbForeignCtrlProxy" - "ID_RICHTEXTFONTPAGE_BGCOLOURCTRL" - 10014 - "" - "wxRichTextColourSwatchCtrl" - "wxWindow" - 1 - 0 - "" - "" - "m_bgColourCtrl" - 1 - "Click to change the text background colour." - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - "" - "" - "" - "" - "" - "" - "" - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - 40 - 20 - "Expand" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "" - "" - "" - - - - - "wxBoxSizer H" - "dialog-control-document" - "" - "sizer" - 0 - 1 - 0 - 0 - "8/11/2006" - "wbBoxSizerProxy" - "Horizontal" - "" - "Expand" - "Centre" - 0 - 5 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "<Any platform>" - - "wxCheckBox: ID_RICHTEXTFONTPAGE_STRIKETHROUGHCTRL" - "dialog-control-document" - "" - "checkbox" - 0 - 1 - 0 - 0 - "8/11/2006" - "wbCheckBoxProxy" - "wxEVT_COMMAND_CHECKBOX_CLICKED|OnStrikethroughctrlClick" - "ID_RICHTEXTFONTPAGE_STRIKETHROUGHCTRL" - 10010 - "" - "wxCheckBox" - "wxCheckBox" - 1 - 0 - "" - "" - "m_strikethroughCtrl" - "&Strikethrough" - 0 - "Check to show a line through the text." - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - 0 - 0 - 1 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Centre" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "" - "" - - - "wxCheckBox: ID_RICHTEXTFONTPAGE_CAPSCTRL" - "dialog-control-document" - "" - "checkbox" - 0 - 1 - 0 - 0 - "8/11/2006" - "wbCheckBoxProxy" - "wxEVT_COMMAND_CHECKBOX_CLICKED|OnCapsctrlClick" - "ID_RICHTEXTFONTPAGE_CAPSCTRL" - 10011 - "" - "wxCheckBox" - "wxCheckBox" - 1 - 0 - "" - "" - "m_capitalsCtrl" - "Ca&pitals" - 0 - "Check to show the text in capitals." - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - 0 - 0 - 1 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Centre" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "" - "" - - - "wxCheckBox: ID_RICHTEXTFONTPAGE_SUPERSCRIPT" - "dialog-control-document" - "" - "checkbox" - 0 - 1 - 0 - 0 - "10/4/2008" - "wbCheckBoxProxy" - "wxEVT_COMMAND_CHECKBOX_CLICKED|OnRichtextfontpageSuperscriptClick|NONE||wxRichTextFontPage" - "ID_RICHTEXTFONTPAGE_SUPERSCRIPT" - 10012 - "" - "wxCheckBox" - "wxCheckBox" - 1 - 0 - "" - "" - "m_superscriptCtrl" - "Supe&rscript" - 0 - "Check to show the text in superscript." - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - 0 - 0 - 1 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Centre" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "" - "" - - - "wxCheckBox: ID_RICHTEXTFONTPAGE_SUBSCRIPT" - "dialog-control-document" - "" - "checkbox" - 0 - 1 - 0 - 0 - "10/4/2008" - "wbCheckBoxProxy" - "wxEVT_COMMAND_CHECKBOX_CLICKED|OnRichtextfontpageSubscriptClick|NONE||wxRichTextFontPage" - "ID_RICHTEXTFONTPAGE_SUBSCRIPT" - 10013 - "" - "wxCheckBox" - "wxCheckBox" - 1 - 0 - "" - "" - "m_subscriptCtrl" - "Subscrip&t" - 0 - "Check to show the text in subscript." - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - 0 - 0 - 1 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Centre" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "" - "" - - - - "Spacer" - "dialog-control-document" - "" - "spacer" - 0 - 1 - 0 - 0 - "3/10/2006" - "wbSpacerProxy" - 5 - 5 - "Centre" - "Centre" - 0 - 5 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "<Any platform>" - - - "wxRichTextFontPreviewCtrl: ID_RICHTEXTFONTPAGE_PREVIEWCTRL" - "dialog-control-document" - "" - "foreign" - 0 - 1 - 0 - 0 - "2/10/2006" - "wbForeignCtrlProxy" - "ID_RICHTEXTFONTPAGE_PREVIEWCTRL" - 10003 - "" - "wxRichTextFontPreviewCtrl" - "wxWindow" - 1 - 0 - "" - "" - "m_previewCtrl" - 1 - "Shows a preview of the font settings." - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - "" - "" - "" - "" - "" - "" - "" - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - 100 - 60 - "Expand" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "" - "" - "" - - - - - - "wxRichTextIndentsSpacingPage" - "dialog-document" - "" - "dialog" - 0 - 1 - 0 - 0 - "3/10/2006" - "wbDialogProxy" - 10100 - 0 - "" - 0 - "" - "Standard" - 0 - 0 - "ID_RICHTEXTINDENTSSPACINGPAGE" - 10100 - "wxRichTextIndentsSpacingPage" - "wxPanel" - "wxPanel" - "richtextindentspage.cpp" - "../../include/wx/richtext/richtextindentspage.h" - "" - "wxRichTextFontPage" - 1 - "" - 0 - "" - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - "" - "" - "" - "" - "" - "" - "Tiled" - 0 - 0 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 1 - 0 - 0 - 0 - "" - 0 - 1 - -1 - -1 - 400 - 300 - 0 - "" - - "wxBoxSizer V" - "dialog-control-document" - "" - "sizer" - 0 - 1 - 0 - 0 - "3/10/2006" - "wbBoxSizerProxy" - "Vertical" - "" - "Centre" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "<Any platform>" - - "wxBoxSizer V" - "dialog-control-document" - "" - "sizer" - 0 - 1 - 0 - 0 - "3/10/2006" - "wbBoxSizerProxy" - "Vertical" - "" - "Expand" - "Centre" - 1 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "<Any platform>" - - "wxBoxSizer H" - "dialog-control-document" - "" - "sizer" - 0 - 1 - 0 - 0 - "3/10/2006" - "wbBoxSizerProxy" - "Horizontal" - "" - "Expand" - "Centre" - 0 - 5 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "<Any platform>" - - "wxBoxSizer V" - "dialog-control-document" - "" - "sizer" - 0 - 1 - 0 - 0 - "3/10/2006" - "wbBoxSizerProxy" - "Vertical" - "" - "Centre" - "Expand" - 0 - 5 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "<Any platform>" - - "wxStaticText: wxID_STATIC" - "dialog-control-document" - "" - "statictext" - 0 - 1 - 0 - 0 - "3/10/2006" - "wbStaticTextProxy" - "wxID_STATIC" - 5105 - "" - "wxStaticText" - "wxStaticText" - 1 - 0 - "" - "" - "" - "&Alignment" - -1 - "" - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - "" - "" - "" - "" - "" - "" - "" - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Left" - "Centre" - 0 - 5 - 1 - 1 - 1 - 0 - 0 - 1 - 0 - "" - "" - - - "wxBoxSizer H" - "dialog-control-document" - "" - "sizer" - 0 - 1 - 0 - 0 - "3/10/2006" - "wbBoxSizerProxy" - "Horizontal" - "" - "Centre" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "<Any platform>" - - "Spacer" - "dialog-control-document" - "" - "spacer" - 0 - 1 - 0 - 0 - "3/10/2006" - "wbSpacerProxy" - 5 - 5 - "Centre" - "Centre" - 0 - 5 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "<Any platform>" - - - "wxBoxSizer V" - "dialog-control-document" - "" - "sizer" - 0 - 1 - 0 - 0 - "3/10/2006" - "wbBoxSizerProxy" - "Vertical" - "" - "Left" - "Centre" - 0 - 5 - 0 - 0 - 1 - 0 - 0 - 0 - 0 - "<Any platform>" - - "wxRadioButton: ID_RICHTEXTINDENTSSPACINGPAGE_ALIGNMENT_LEFT" - "dialog-control-document" - "" - "radiobutton" - 0 - 1 - 0 - 0 - "3/10/2006" - "wbRadioButtonProxy" - "wxEVT_COMMAND_RADIOBUTTON_SELECTED|OnAlignmentLeftSelected" - "ID_RICHTEXTINDENTSSPACINGPAGE_ALIGNMENT_LEFT" - 10102 - "" - "wxRadioButton" - "wxRadioButton" - 1 - 0 - "" - "" - "m_alignmentLeft" - "&Left" - 0 - "Left-align text." - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - "" - "" - "" - "" - "" - "" - "" - 1 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Left" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "" - "" - - - "wxRadioButton: ID_RICHTEXTINDENTSSPACINGPAGE_ALIGNMENT_RIGHT" - "dialog-control-document" - "" - "radiobutton" - 0 - 1 - 0 - 0 - "3/10/2006" - "wbRadioButtonProxy" - "wxEVT_COMMAND_RADIOBUTTON_SELECTED|OnAlignmentRightSelected" - "ID_RICHTEXTINDENTSSPACINGPAGE_ALIGNMENT_RIGHT" - 10110 - "" - "wxRadioButton" - "wxRadioButton" - 1 - 0 - "" - "" - "m_alignmentRight" - "&Right" - 0 - "Right-align text." - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - "" - "" - "" - "" - "" - "" - "" - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Left" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "" - "" - - - "wxRadioButton: ID_RICHTEXTINDENTSSPACINGPAGE_ALIGNMENT_JUSTIFIED" - "dialog-control-document" - "" - "radiobutton" - 0 - 1 - 0 - 0 - "3/10/2006" - "wbRadioButtonProxy" - "wxEVT_COMMAND_RADIOBUTTON_SELECTED|OnAlignmentJustifiedSelected" - "ID_RICHTEXTINDENTSSPACINGPAGE_ALIGNMENT_JUSTIFIED" - 10111 - "" - "wxRadioButton" - "wxRadioButton" - 1 - 0 - "" - "" - "m_alignmentJustified" - "&Justified" - 0 - "Justify text left and right." - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - "" - "" - "" - "" - "" - "" - "" - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Left" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "" - "" - - - "wxRadioButton: ID_RICHTEXTINDENTSSPACINGPAGE_ALIGNMENT_CENTRED" - "dialog-control-document" - "" - "radiobutton" - 0 - 1 - 0 - 0 - "3/10/2006" - "wbRadioButtonProxy" - "wxEVT_COMMAND_RADIOBUTTON_SELECTED|OnAlignmentCentredSelected" - "ID_RICHTEXTINDENTSSPACINGPAGE_ALIGNMENT_CENTRED" - 10112 - "" - "wxRadioButton" - "wxRadioButton" - 1 - 0 - "" - "" - "m_alignmentCentred" - "Cen&tred" - 0 - "Centre text." - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - "" - "" - "" - "" - "" - "" - "" - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Left" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "" - "" - - - "wxRadioButton: ID_RICHTEXTINDENTSSPACINGPAGE_ALIGNMENT_INDETERMINATE" - "dialog-control-document" - "" - "radiobutton" - 0 - 1 - 0 - 0 - "3/10/2006" - "wbRadioButtonProxy" - "wxEVT_COMMAND_RADIOBUTTON_SELECTED|OnAlignmentIndeterminateSelected" - "ID_RICHTEXTINDENTSSPACINGPAGE_ALIGNMENT_INDETERMINATE" - 10101 - "" - "wxRadioButton" - "wxRadioButton" - 1 - 0 - "" - "" - "m_alignmentIndeterminate" - "&Indeterminate" - 0 - "Use the current alignment setting." - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - "" - "" - "" - "" - "" - "" - "" - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Left" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "" - "" - - - - - - "Spacer" - "dialog-control-document" - "" - "spacer" - 0 - 1 - 0 - 0 - "3/10/2006" - "wbSpacerProxy" - 2 - 1 - "Centre" - "Centre" - 1 - 5 - 0 - 0 - 1 - 1 - 0 - 0 - 0 - "<Any platform>" - - - "wxStaticLine: wxID_STATIC" - "dialog-control-document" - "" - "staticline" - 0 - 1 - 0 - 0 - "3/10/2006" - "wbStaticLineProxy" - "wxID_STATIC" - 5105 - "" - "wxStaticLine" - "wxStaticLine" - 1 - 0 - "" - "" - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - 0 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Expand" - "Expand" - 0 - 5 - 1 - 0 - 0 - 1 - 0 - 0 - 0 - - - "Spacer" - "dialog-control-document" - "" - "spacer" - 0 - 1 - 0 - 0 - "3/10/2006" - "wbSpacerProxy" - 2 - 1 - "Centre" - "Centre" - 1 - 5 - 0 - 0 - 1 - 1 - 0 - 0 - 0 - "<Any platform>" - - - "wxBoxSizer V" - "dialog-control-document" - "" - "sizer" - 0 - 1 - 0 - 0 - "3/10/2006" - "wbBoxSizerProxy" - "Vertical" - "" - "Centre" - "Expand" - 0 - 5 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "<Any platform>" - - "wxStaticText: wxID_STATIC" - "dialog-control-document" - "" - "statictext" - 0 - 1 - 0 - 0 - "3/10/2006" - "wbStaticTextProxy" - "wxID_STATIC" - 5105 - "" - "wxStaticText" - "wxStaticText" - 1 - 0 - "" - "" - "" - "&Indentation (tenths of a mm)" - -1 - "" - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - "" - "" - "" - "" - "" - "" - "" - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Left" - "Centre" - 0 - 5 - 1 - 1 - 1 - 0 - 0 - 1 - 0 - "" - "" - - - "wxBoxSizer H" - "dialog-control-document" - "" - "sizer" - 0 - 1 - 0 - 0 - "3/10/2006" - "wbBoxSizerProxy" - "Horizontal" - "" - "Left" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "<Any platform>" - - "Spacer" - "dialog-control-document" - "" - "spacer" - 0 - 1 - 0 - 0 - "3/10/2006" - "wbSpacerProxy" - 5 - 5 - "Centre" - "Centre" - 0 - 5 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "<Any platform>" - - - "wxFlexGridSizer" - "dialog-control-document" - "" - "sizer" - 0 - 1 - 0 - 0 - "3/10/2006" - "wbFlexGridSizerProxy" - "" - "" - 2 - 4 - 0 - 0 - "" - "<Any platform>" - "Centre" - "Centre" - 0 - 5 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - - "wxStaticText: wxID_STATIC" - "dialog-control-document" - "" - "statictext" - 0 - 1 - 0 - 0 - "3/10/2006" - "wbStaticTextProxy" - "wxID_STATIC" - 5105 - "" - "wxStaticText" - "wxStaticText" - 1 - 0 - "" - "" - "" - "&Left:" - -1 - "" - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - "" - "" - "" - "" - "" - "" - "" - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Right" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 1 - 0 - "" - "" - - - "wxBoxSizer H" - "dialog-control-document" - "" - "sizer" - 0 - 1 - 0 - 0 - "3/10/2006" - "wbBoxSizerProxy" - "Horizontal" - "" - "Expand" - "Centre" - 0 - 5 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "<Any platform>" - - "wxTextCtrl: ID_RICHTEXTINDENTSSPACINGPAGE_INDENT_LEFT" - "dialog-control-document" - "" - "textctrl" - 0 - 1 - 0 - 0 - "3/10/2006" - "wbTextCtrlProxy" - "wxEVT_COMMAND_TEXT_UPDATED|OnIndentLeftUpdated" - "ID_RICHTEXTINDENTSSPACINGPAGE_INDENT_LEFT" - 10103 - "" - "wxTextCtrl" - "wxTextCtrl" - 1 - 0 - "" - "" - "m_indentLeft" - "" - 0 - "The left indent." - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - "" - "" - "" - "" - "" - "" - "" - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - 50 - -1 - "Centre" - "Centre" - 1 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "" - "" - - - - "wxStaticText: wxID_STATIC" - "dialog-control-document" - "" - "statictext" - 0 - 1 - 0 - 0 - "3/10/2006" - "wbStaticTextProxy" - "wxID_STATIC" - 5105 - "" - "wxStaticText" - "wxStaticText" - 1 - 0 - "" - "" - "" - "Left (&first line):" - -1 - "" - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - "" - "" - "" - "" - "" - "" - "" - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Right" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 1 - 0 - "" - "" - - - "wxBoxSizer H" - "dialog-control-document" - "" - "sizer" - 0 - 1 - 0 - 0 - "3/10/2006" - "wbBoxSizerProxy" - "Horizontal" - "" - "Expand" - "Centre" - 0 - 5 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "<Any platform>" - - "wxTextCtrl: ID_RICHTEXTINDENTSSPACINGPAGE_INDENT_LEFT_FIRST" - "dialog-control-document" - "" - "textctrl" - 0 - 1 - 0 - 0 - "3/10/2006" - "wbTextCtrlProxy" - "wxEVT_COMMAND_TEXT_UPDATED|OnIndentLeftFirstUpdated" - "ID_RICHTEXTINDENTSSPACINGPAGE_INDENT_LEFT_FIRST" - 10104 - "" - "wxTextCtrl" - "wxTextCtrl" - 1 - 0 - "" - "" - "m_indentLeftFirst" - "" - 0 - "The first line indent." - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - "" - "" - "" - "" - "" - "" - "" - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - 50 - -1 - "Centre" - "Centre" - 1 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "" - "" - 0 - - - - "wxStaticText: wxID_STATIC" - "dialog-control-document" - "" - "statictext" - 0 - 1 - 0 - 0 - "3/10/2006" - "wbStaticTextProxy" - "wxID_STATIC" - 5105 - "" - "wxStaticText" - "wxStaticText" - 1 - 0 - "" - "" - "" - "&Right:" - -1 - "" - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - "" - "" - "" - "" - "" - "" - "" - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Right" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 1 - 0 - "" - "" - - - "wxBoxSizer H" - "dialog-control-document" - "" - "sizer" - 0 - 1 - 0 - 0 - "3/10/2006" - "wbBoxSizerProxy" - "Horizontal" - "" - "Expand" - "Centre" - 0 - 5 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "<Any platform>" - - "wxTextCtrl: ID_RICHTEXTINDENTSSPACINGPAGE_INDENT_RIGHT" - "dialog-control-document" - "" - "textctrl" - 0 - 1 - 0 - 0 - "3/10/2006" - "wbTextCtrlProxy" - "wxEVT_COMMAND_TEXT_UPDATED|OnIndentRightUpdated" - "ID_RICHTEXTINDENTSSPACINGPAGE_INDENT_RIGHT" - 10113 - "" - "wxTextCtrl" - "wxTextCtrl" - 1 - 0 - "" - "" - "m_indentRight" - "" - 0 - "The right indent." - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - "" - "" - "" - "" - "" - "" - "" - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - 50 - -1 - "Centre" - "Centre" - 1 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "" - "" - 0 - - - - "wxStaticText: wxID_STATIC" - "dialog-control-document" - "" - "statictext" - 0 - 1 - 0 - 0 - "10/11/2006" - "wbStaticTextProxy" - "wxID_STATIC" - 5105 - "" - "wxStaticText" - "wxStaticText" - 1 - 0 - "" - "" - "" - "&Outline level:" - -1 - "" - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - "" - "" - "" - "" - "" - "" - "" - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Right" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 1 - 0 - "" - "" - - - "wxComboBox: ID_RICHTEXTINDENTSSPACINGPAGE_OUTLINELEVEL" - "dialog-control-document" - "" - "combobox" - 0 - 1 - 0 - 0 - "10/11/2006" - "wbComboBoxProxy" - "wxEVT_COMMAND_COMBOBOX_SELECTED|OnRichtextOutlinelevelSelected" - "ID_RICHTEXTINDENTSSPACINGPAGE_OUTLINELEVEL" - 10105 - "" - "wxComboBox" - "wxComboBox" - 1 - 0 - "" - "" - "m_outlineLevelCtrl" - "Normal|1|2|3|4|5|6|7|8|9" - "Normal" - "The outline level." - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - "" - "" - "" - "" - "" - "" - "" - 0 - 0 - 1 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - 90 - -1 - "Expand" - "Centre" - 1 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "" - "" - - - - - - "Spacer" - "dialog-control-document" - "" - "spacer" - 0 - 1 - 0 - 0 - "3/10/2006" - "wbSpacerProxy" - 2 - 1 - "Centre" - "Centre" - 1 - 5 - 0 - 0 - 1 - 1 - 0 - 0 - 0 - "<Any platform>" - - - "wxStaticLine: wxID_STATIC" - "dialog-control-document" - "" - "staticline" - 0 - 1 - 0 - 0 - "3/10/2006" - "wbStaticLineProxy" - "wxID_STATIC" - 5105 - "" - "wxStaticLine" - "wxStaticLine" - 1 - 0 - "" - "" - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - 0 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Expand" - "Expand" - 0 - 5 - 0 - 0 - 1 - 1 - 0 - 0 - 0 - - - "Spacer" - "dialog-control-document" - "" - "spacer" - 0 - 1 - 0 - 0 - "3/10/2006" - "wbSpacerProxy" - 2 - 1 - "Centre" - "Centre" - 1 - 5 - 0 - 0 - 1 - 1 - 0 - 0 - 0 - "<Any platform>" - - - "wxBoxSizer V" - "dialog-control-document" - "" - "sizer" - 0 - 1 - 0 - 0 - "3/10/2006" - "wbBoxSizerProxy" - "Vertical" - "" - "Centre" - "Expand" - 0 - 5 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "<Any platform>" - - "wxStaticText: wxID_STATIC" - "dialog-control-document" - "" - "statictext" - 0 - 1 - 0 - 0 - "3/10/2006" - "wbStaticTextProxy" - "wxID_STATIC" - 5105 - "" - "wxStaticText" - "wxStaticText" - 1 - 0 - "" - "" - "" - "&Spacing (tenths of a mm)" - -1 - "" - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - "" - "" - "" - "" - "" - "" - "" - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Left" - "Centre" - 0 - 5 - 1 - 1 - 1 - 0 - 0 - 1 - 0 - "" - "" - - - "wxBoxSizer H" - "dialog-control-document" - "" - "sizer" - 0 - 1 - 0 - 0 - "3/10/2006" - "wbBoxSizerProxy" - "Horizontal" - "" - "Left" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "<Any platform>" - - "Spacer" - "dialog-control-document" - "" - "spacer" - 0 - 1 - 0 - 0 - "3/10/2006" - "wbSpacerProxy" - 5 - 5 - "Centre" - "Centre" - 0 - 5 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "<Any platform>" - - - "wxFlexGridSizer" - "dialog-control-document" - "" - "sizer" - 0 - 1 - 0 - 0 - "3/10/2006" - "wbFlexGridSizerProxy" - "1" - "" - 2 - 3 - 0 - 0 - "" - "<Any platform>" - "Centre" - "Centre" - 0 - 5 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - - "wxStaticText: wxID_STATIC" - "dialog-control-document" - "" - "statictext" - 0 - 1 - 0 - 0 - "3/10/2006" - "wbStaticTextProxy" - "wxID_STATIC" - 5105 - "" - "wxStaticText" - "wxStaticText" - 1 - 0 - "" - "" - "" - "&Before a paragraph:" - -1 - "" - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - "" - "" - "" - "" - "" - "" - "" - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Right" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 1 - 0 - "" - "" - - - "wxBoxSizer H" - "dialog-control-document" - "" - "sizer" - 0 - 1 - 0 - 0 - "3/10/2006" - "wbBoxSizerProxy" - "Horizontal" - "" - "Expand" - "Centre" - 0 - 5 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "<Any platform>" - - "wxTextCtrl: ID_RICHTEXTINDENTSSPACINGPAGE_SPACING_BEFORE" - "dialog-control-document" - "" - "textctrl" - 0 - 1 - 0 - 0 - "3/10/2006" - "wbTextCtrlProxy" - "wxEVT_COMMAND_TEXT_UPDATED|OnSpacingBeforeUpdated" - "ID_RICHTEXTINDENTSSPACINGPAGE_SPACING_BEFORE" - 10114 - "" - "wxTextCtrl" - "wxTextCtrl" - 1 - 0 - "" - "" - "m_spacingBefore" - "" - 0 - "The spacing before the paragraph." - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - "" - "" - "" - "" - "" - "" - "" - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - 50 - -1 - "Centre" - "Centre" - 1 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "" - "" - - - - "wxStaticText: wxID_STATIC" - "dialog-control-document" - "" - "statictext" - 0 - 1 - 0 - 0 - "3/10/2006" - "wbStaticTextProxy" - "wxID_STATIC" - 5105 - "" - "wxStaticText" - "wxStaticText" - 1 - 0 - "" - "" - "" - "&After a paragraph:" - -1 - "" - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - "" - "" - "" - "" - "" - "" - "" - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Right" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 1 - 0 - "" - "" - - - "wxBoxSizer H" - "dialog-control-document" - "" - "sizer" - 0 - 1 - 0 - 0 - "3/10/2006" - "wbBoxSizerProxy" - "Horizontal" - "" - "Expand" - "Centre" - 1 - 5 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "<Any platform>" - - "wxTextCtrl: ID_RICHTEXTINDENTSSPACINGPAGE_SPACING_AFTER" - "dialog-control-document" - "" - "textctrl" - 0 - 1 - 0 - 0 - "3/10/2006" - "wbTextCtrlProxy" - "wxEVT_COMMAND_TEXT_UPDATED|OnSpacingAfterUpdated" - "ID_RICHTEXTINDENTSSPACINGPAGE_SPACING_AFTER" - 10116 - "" - "wxTextCtrl" - "wxTextCtrl" - 1 - 0 - "" - "" - "m_spacingAfter" - "" - 0 - "" - "The spacing after the paragraph." - "" - "" - "" - 0 - 1 - "<Any platform>" - "" - "" - "" - "" - "" - "" - "" - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - 50 - -1 - "Centre" - "Centre" - 1 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "" - "" - 0 - - - - "wxStaticText: wxID_STATIC" - "dialog-control-document" - "" - "statictext" - 0 - 1 - 0 - 0 - "3/10/2006" - "wbStaticTextProxy" - "wxID_STATIC" - 5105 - "" - "wxStaticText" - "wxStaticText" - 1 - 0 - "" - "" - "" - "L&ine spacing:" - -1 - "" - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - "" - "" - "" - "" - "" - "" - "" - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Right" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 1 - 0 - "" - "" - - - "wxBoxSizer H" - "dialog-control-document" - "" - "sizer" - 0 - 1 - 0 - 0 - "3/10/2006" - "wbBoxSizerProxy" - "Horizontal" - "" - "Expand" - "Centre" - 0 - 5 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "<Any platform>" - - "wxComboBox: ID_RICHTEXTINDENTSSPACINGPAGE_SPACING_LINE" - "dialog-control-document" - "" - "combobox" - 0 - 1 - 0 - 0 - "3/10/2006" - "wbComboBoxProxy" - "wxEVT_COMMAND_COMBOBOX_SELECTED|OnSpacingLineSelected" - "ID_RICHTEXTINDENTSSPACINGPAGE_SPACING_LINE" - 10115 - "" - "wxComboBox" - "wxComboBox" - 1 - 0 - "" - "" - "m_spacingLine" - "Single|1.1|1.2|1.3|1.4|1.5|1.6|1.7|1.8|1.9|2" - "Single" - "The line spacing." - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - "" - "" - "" - "" - "" - "" - "" - 0 - 0 - 1 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - 90 - -1 - "Centre" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "" - "" - - - - - - - - "Spacer" - "dialog-control-document" - "" - "spacer" - 0 - 1 - 0 - 0 - "3/10/2006" - "wbSpacerProxy" - 5 - 5 - "Centre" - "Centre" - 0 - 5 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "<Any platform>" - - - "wxRichTextCtrl: ID_RICHTEXTINDENTSSPACINGPAGE_PREVIEW_CTRL" - "dialog-control-document" - "" - "foreign" - 0 - 1 - 0 - 0 - "3/10/2006" - "wbForeignCtrlProxy" - "ID_RICHTEXTINDENTSSPACINGPAGE_PREVIEW_CTRL" - 10109 - "" - "wxRichTextCtrl" - "wxWindow" - 1 - 0 - "" - "" - "m_previewCtrl" - 1 - "Shows a preview of the paragraph settings." - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - "" - "" - "" - "" - "" - "" - "" - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 1 - 0 - "wxTE_READONLY" - -1 - -1 - 350 - 100 - "Centre" - "Centre" - 1 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "%PARENT%, %ID%, wxEmptyString, %POSITION%, %SIZE%, %STYLE%" - "" - "" - - - - - - "wxRichTextTabsPage" - "dialog-document" - "" - "dialog" - 0 - 1 - 0 - 0 - "4/10/2006" - "wbDialogProxy" - 10200 - 0 - "" - 0 - "" - "Standard" - 0 - 0 - "ID_RICHTEXTTABSPAGE" - 10200 - "wxRichTextTabsPage" - "wxPanel" - "wxPanel" - "richtexttabspage.cpp" - "../../include/wx/richtext/richtexttabspage.h" - "" - "wxRichTextFontPage" - 1 - "" - 0 - "" - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - "" - "" - "" - "" - "" - "" - "Tiled" - 0 - 0 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 1 - 0 - 0 - 0 - "" - 0 - 1 - -1 - -1 - 400 - 300 - 0 - "" - - "wxBoxSizer V" - "dialog-control-document" - "" - "sizer" - 0 - 1 - 0 - 0 - "4/10/2006" - "wbBoxSizerProxy" - "Vertical" - "" - "Centre" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "<Any platform>" - - "wxBoxSizer V" - "dialog-control-document" - "" - "sizer" - 0 - 1 - 0 - 0 - "4/10/2006" - "wbBoxSizerProxy" - "Vertical" - "" - "Expand" - "Centre" - 1 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "<Any platform>" - - "wxBoxSizer H" - "dialog-control-document" - "" - "sizer" - 0 - 1 - 0 - 0 - "4/10/2006" - "wbBoxSizerProxy" - "Horizontal" - "" - "Expand" - "Centre" - 1 - 5 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "<Any platform>" - - "wxBoxSizer V" - "dialog-control-document" - "" - "sizer" - 0 - 1 - 0 - 0 - "4/10/2006" - "wbBoxSizerProxy" - "Vertical" - "" - "Centre" - "Expand" - 0 - 5 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "<Any platform>" - - "wxStaticText: wxID_STATIC" - "dialog-control-document" - "" - "statictext" - 0 - 1 - 0 - 0 - "4/10/2006" - "wbStaticTextProxy" - "wxID_STATIC" - 5105 - "" - "wxStaticText" - "wxStaticText" - 1 - 0 - "" - "" - "" - "&Position (tenths of a mm):" - -1 - "" - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - "" - "" - "" - "" - "" - "" - "" - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Left" - "Centre" - 0 - 5 - 1 - 1 - 1 - 0 - 0 - 1 - 0 - "" - "" - - - "wxTextCtrl: ID_RICHTEXTTABSPAGE_TABEDIT" - "dialog-control-document" - "" - "textctrl" - 0 - 1 - 0 - 0 - "4/10/2006" - "wbTextCtrlProxy" - "ID_RICHTEXTTABSPAGE_TABEDIT" - 10213 - "" - "wxTextCtrl" - "wxTextCtrl" - 1 - 0 - "" - "" - "m_tabEditCtrl" - "" - 0 - "The tab position." - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - "" - "" - "" - "" - "" - "" - "" - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Expand" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "" - "" - 0 - - - "wxListBox: ID_RICHTEXTTABSPAGE_TABLIST" - "dialog-control-document" - "" - "listbox" - 0 - 1 - 0 - 0 - "4/10/2006" - "wbListBoxProxy" - "wxEVT_COMMAND_LISTBOX_SELECTED|OnTablistSelected" - "ID_RICHTEXTTABSPAGE_TABLIST" - 10214 - "" - "wxListBox" - "wxListBox" - 1 - 0 - "" - "" - "m_tabListCtrl" - "The tab positions." - "" - "" - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - "" - "" - "" - "" - "" - "" - "" - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - 80 - 180 - "Expand" - "Centre" - 1 - 5 - 1 - 1 - 0 - 1 - 0 - 0 - 0 - "" - "" - - - - "Spacer" - "dialog-control-document" - "" - "spacer" - 0 - 1 - 0 - 0 - "4/10/2006" - "wbSpacerProxy" - 2 - 1 - "Centre" - "Centre" - 1 - 5 - 0 - 0 - 1 - 1 - 0 - 0 - 0 - "<Any platform>" - - - "wxBoxSizer V" - "dialog-control-document" - "" - "sizer" - 0 - 1 - 0 - 0 - "4/10/2006" - "wbBoxSizerProxy" - "Vertical" - "" - "Centre" - "Expand" - 0 - 5 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "<Any platform>" - - "wxStaticText: wxID_STATIC" - "dialog-control-document" - "" - "statictext" - 0 - 1 - 0 - 0 - "4/10/2006" - "wbStaticTextProxy" - "wxID_STATIC" - 5105 - "" - "wxStaticText" - "wxStaticText" - 1 - 0 - "" - "" - "" - "" - -1 - "" - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - "" - "" - "" - "" - "" - "" - "" - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Centre" - "Centre" - 0 - 5 - 0 - 0 - 0 - 1 - 0 - 1 - 0 - "" - "" - - - "wxButton: ID_RICHTEXTTABSPAGE_NEW_TAB" - "dialog-control-document" - "" - "dialogcontrol" - 0 - 1 - 0 - 0 - "4/10/2006" - "wbButtonProxy" - "wxEVT_COMMAND_BUTTON_CLICKED|OnNewTabClick" - "wxEVT_UPDATE_UI|OnNewTabUpdate" - "ID_RICHTEXTTABSPAGE_NEW_TAB" - 10201 - "" - "wxButton" - "wxButton" - 1 - 0 - "" - "" - "" - "&New" - 0 - "Click to create a new tab position." - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Expand" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "" - "" - - - "wxButton: ID_RICHTEXTTABSPAGE_DELETE_TAB" - "dialog-control-document" - "" - "dialogcontrol" - 0 - 1 - 0 - 0 - "4/10/2006" - "wbButtonProxy" - "wxEVT_COMMAND_BUTTON_CLICKED|OnDeleteTabClick" - "wxEVT_UPDATE_UI|OnDeleteTabUpdate" - "ID_RICHTEXTTABSPAGE_DELETE_TAB" - 10202 - "" - "wxButton" - "wxButton" - 1 - 0 - "" - "" - "" - "&Delete" - 0 - "Click to delete the selected tab position." - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Expand" - "Centre" - 0 - 5 - 1 - 1 - 0 - 1 - 0 - 0 - 0 - "" - "" - - - "wxButton: ID_RICHTEXTTABSPAGE_DELETE_ALL_TABS" - "dialog-control-document" - "" - "dialogcontrol" - 0 - 1 - 0 - 0 - "4/10/2006" - "wbButtonProxy" - "wxEVT_COMMAND_BUTTON_CLICKED|OnDeleteAllTabsClick" - "wxEVT_UPDATE_UI|OnDeleteAllTabsUpdate" - "ID_RICHTEXTTABSPAGE_DELETE_ALL_TABS" - 10203 - "" - "wxButton" - "wxButton" - 1 - 0 - "" - "" - "" - "Delete A&ll" - 0 - "Click to delete all tab positions." - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Expand" - "Centre" - 0 - 5 - 1 - 1 - 0 - 1 - 0 - 0 - 0 - "" - "" - - - - - - - - "wxRichTextBulletsPage" - "dialog-document" - "" - "dialog" - 0 - 1 - 0 - 0 - "4/10/2006" - "wbDialogProxy" - 10300 - 0 - "" - 0 - "" - "Standard" - 0 - 0 - "ID_RICHTEXTBULLETSPAGE" - 10300 - "wxRichTextBulletsPage" - "wxPanel" - "wxPanel" - "richtextbulletspage.cpp" - "../../include/wx/richtext/richtextbulletspage.h" - "" - "wxRichTextBulletsPage" - 1 - "" - 0 - "" - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - "" - "" - "" - "" - "" - "" - "Tiled" - 0 - 0 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 1 - 0 - 0 - 0 - "" - 0 - 1 - -1 - -1 - 400 - 300 - 0 - "" - - "wxBoxSizer V" - "dialog-control-document" - "" - "sizer" - 0 - 1 - 0 - 0 - "4/10/2006" - "wbBoxSizerProxy" - "Vertical" - "" - "Centre" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "<Any platform>" - - "wxBoxSizer V" - "dialog-control-document" - "" - "sizer" - 0 - 1 - 0 - 0 - "4/10/2006" - "wbBoxSizerProxy" - "Vertical" - "" - "Expand" - "Centre" - 1 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "<Any platform>" - - "wxBoxSizer H" - "dialog-control-document" - "" - "sizer" - 0 - 1 - 0 - 0 - "4/10/2006" - "wbBoxSizerProxy" - "Horizontal" - "" - "Expand" - "Centre" - 0 - 5 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "<Any platform>" - - "wxBoxSizer V" - "dialog-control-document" - "" - "sizer" - 0 - 1 - 0 - 0 - "4/10/2006" - "wbBoxSizerProxy" - "Vertical" - "" - "Centre" - "Expand" - 0 - 5 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "<Any platform>" - - "wxStaticText: wxID_STATIC" - "dialog-control-document" - "" - "statictext" - 0 - 1 - 0 - 0 - "4/10/2006" - "wbStaticTextProxy" - "wxID_STATIC" - 5105 - "" - "wxStaticText" - "wxStaticText" - 1 - 0 - "" - "" - "" - "&Bullet style:" - -1 - "" - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - "" - "" - "" - "" - "" - "" - "" - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Left" - "Centre" - 0 - 5 - 1 - 1 - 1 - 0 - 0 - 1 - 0 - "" - "" - - - "wxListBox: ID_RICHTEXTBULLETSPAGE_STYLELISTBOX" - "dialog-control-document" - "" - "listbox" - 0 - 1 - 0 - 0 - "20/10/2006" - "wbListBoxProxy" - "wxEVT_COMMAND_LISTBOX_SELECTED|OnStylelistboxSelected" - "ID_RICHTEXTBULLETSPAGE_STYLELISTBOX" - 10305 - "" - "wxListBox" - "wxListBox" - 1 - 0 - "" - "" - "m_styleListBox" - "" - "" - "The available bullet styles." - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - "" - "" - "" - "" - "" - "" - "" - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - 90 - "Expand" - "Centre" - 1 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "" - "" - - - "wxBoxSizer H" - "dialog-control-document" - "" - "sizer" - 0 - 1 - 0 - 0 - "20/10/2006" - "wbBoxSizerProxy" - "Horizontal" - "" - "Expand" - "Centre" - 0 - 5 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "<Any platform>" - - "wxCheckBox: ID_RICHTEXTBULLETSPAGE_PERIODCTRL" - "dialog-control-document" - "" - "checkbox" - 0 - 1 - 0 - 0 - "20/10/2006" - "wbCheckBoxProxy" - "wxEVT_COMMAND_CHECKBOX_CLICKED|OnPeriodctrlClick" - "wxEVT_UPDATE_UI|OnPeriodctrlUpdate" - "ID_RICHTEXTBULLETSPAGE_PERIODCTRL" - 10313 - "" - "wxCheckBox" - "wxCheckBox" - 1 - 0 - "" - "" - "m_periodCtrl" - "Peri&od" - 0 - "Check to add a period after the bullet." - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Left" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "" - "" - - - "wxCheckBox: ID_RICHTEXTBULLETSPAGE_PARENTHESESCTRL" - "dialog-control-document" - "" - "checkbox" - 0 - 1 - 0 - 0 - "25/10/2006" - "wbCheckBoxProxy" - "wxEVT_COMMAND_CHECKBOX_CLICKED|OnParenthesesctrlClick" - "wxEVT_UPDATE_UI|OnParenthesesctrlUpdate" - "ID_RICHTEXTBULLETSPAGE_PARENTHESESCTRL" - 10311 - "" - "wxCheckBox" - "wxCheckBox" - 1 - 0 - "" - "" - "m_parenthesesCtrl" - "(*)" - 0 - "Check to enclose the bullet in parentheses." - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Left" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "" - "" - - - "wxCheckBox: ID_RICHTEXTBULLETSPAGE_RIGHTPARENTHESISCTRL" - "dialog-control-document" - "" - "checkbox" - 0 - 1 - 0 - 0 - "25/10/2006" - "wbCheckBoxProxy" - "wxEVT_COMMAND_CHECKBOX_CLICKED|OnRightParenthesisCtrlClick" - "wxEVT_UPDATE_UI|OnRightParenthesisCtrlUpdate" - "ID_RICHTEXTBULLETSPAGE_RIGHTPARENTHESISCTRL" - 10306 - "" - "wxCheckBox" - "wxCheckBox" - 1 - 0 - "" - "" - "m_rightParenthesisCtrl" - "*)" - 0 - "Check to add a right parenthesis." - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Left" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "" - "" - - - - "Spacer" - "dialog-control-document" - "" - "spacer" - 0 - 1 - 0 - 0 - "20/10/2006" - "wbSpacerProxy" - 5 - 5 - "Centre" - "Centre" - 0 - 5 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "<Any platform>" - - - "wxStaticText: wxID_STATIC" - "dialog-control-document" - "" - "statictext" - 0 - 1 - 0 - 0 - "25/10/2006" - "wbStaticTextProxy" - "wxID_STATIC" - 5105 - "" - "wxStaticText" - "wxStaticText" - 1 - 0 - "" - "" - "" - "Bullet &Alignment:" - -1 - "" - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - "" - "" - "" - "" - "" - "" - "" - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Left" - "Centre" - 0 - 5 - 1 - 1 - 1 - 0 - 0 - 1 - 0 - "" - "" - - - "wxComboBox: ID_RICHTEXTBULLETSPAGE_BULLETALIGNMENTCTRL" - "dialog-control-document" - "" - "combobox" - 0 - 1 - 0 - 0 - "25/10/2006" - "wbComboBoxProxy" - "wxEVT_COMMAND_COMBOBOX_SELECTED|OnBulletAlignmentCtrlSelected" - "ID_RICHTEXTBULLETSPAGE_BULLETALIGNMENTCTRL" - 10315 - "" - "wxComboBox" - "wxComboBox" - 1 - 0 - "" - "" - "m_bulletAlignmentCtrl" - "Left|Centre|Right" - "Left" - "The bullet character." - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - "" - "" - "" - "" - "" - "" - "" - 0 - 0 - 1 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - 60 - -1 - "Expand" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 1 - "" - "" - - - - "Spacer" - "dialog-control-document" - "" - "spacer" - 0 - 1 - 0 - 0 - "7/10/2006" - "wbSpacerProxy" - 2 - 1 - "Centre" - "Centre" - 1 - 5 - 0 - 0 - 1 - 1 - 0 - 0 - 0 - "<Any platform>" - - - "wxStaticLine: wxID_STATIC" - "dialog-control-document" - "" - "staticline" - 0 - 1 - 0 - 0 - "7/10/2006" - "wbStaticLineProxy" - "wxID_STATIC" - 5105 - "" - "wxStaticLine" - "wxStaticLine" - 1 - 0 - "" - "" - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - 0 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Expand" - "Expand" - 0 - 5 - 1 - 1 - 0 - 0 - 0 - 0 - 0 - - - "Spacer" - "dialog-control-document" - "" - "spacer" - 0 - 1 - 0 - 0 - "4/10/2006" - "wbSpacerProxy" - 2 - 1 - "Centre" - "Centre" - 1 - 5 - 0 - 0 - 1 - 1 - 0 - 0 - 0 - "<Any platform>" - - - "wxBoxSizer V" - "dialog-control-document" - "" - "sizer" - 0 - 1 - 0 - 0 - "7/10/2006" - "wbBoxSizerProxy" - "Vertical" - "" - "Centre" - "Expand" - 0 - 5 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "<Any platform>" - - "wxBoxSizer H" - "dialog-control-document" - "" - "sizer" - 0 - 1 - 0 - 0 - "7/10/2006" - "wbBoxSizerProxy" - "Horizontal" - "" - "Expand" - "Centre" - 0 - 5 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "<Any platform>" - - "wxStaticText: ID_RICHTEXTBULLETSPAGE_SYMBOLSTATIC" - "dialog-control-document" - "" - "statictext" - 0 - 1 - 0 - 0 - "29/4/2008" - "wbStaticTextProxy" - "wxEVT_UPDATE_UI|OnSymbolstaticUpdate" - "ID_RICHTEXTBULLETSPAGE_SYMBOLSTATIC" - 10301 - "" - "wxStaticText" - "wxStaticText" - 1 - 0 - "" - "" - "" - "&Symbol:" - -1 - "" - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - "" - "" - "" - "" - "" - "" - "" - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Left" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 1 - 0 - "" - "" - - - "wxComboBox: ID_RICHTEXTBULLETSPAGE_SYMBOLCTRL" - "dialog-control-document" - "" - "combobox" - 0 - 1 - 0 - 0 - "7/10/2006" - "wbComboBoxProxy" - "wxEVT_COMMAND_COMBOBOX_SELECTED|OnSymbolctrlSelected" - "wxEVT_COMMAND_TEXT_UPDATED|OnSymbolctrlUpdated" - "wxEVT_UPDATE_UI|OnSymbolctrlUpdate" - "ID_RICHTEXTBULLETSPAGE_SYMBOLCTRL" - 10307 - "" - "wxComboBox" - "wxComboBox" - 1 - 0 - "" - "" - "m_symbolCtrl" - "" - "" - "The bullet character." - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - "" - "" - "" - "" - "" - "" - "" - 0 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - 60 - -1 - "Expand" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 1 - "" - "" - - - "wxButton: ID_RICHTEXTBULLETSPAGE_CHOOSE_SYMBOL" - "dialog-control-document" - "" - "dialogcontrol" - 0 - 1 - 0 - 0 - "7/10/2006" - "wbButtonProxy" - "wxEVT_COMMAND_BUTTON_CLICKED|OnChooseSymbolClick" - "wxEVT_UPDATE_UI|OnChooseSymbolUpdate" - "ID_RICHTEXTBULLETSPAGE_CHOOSE_SYMBOL" - 10308 - "" - "wxButton" - "wxButton" - 1 - 0 - "" - "" - "" - "Ch&oose..." - 0 - "Click to browse for a symbol." - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Centre" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "" - "" - - - - "Spacer" - "dialog-control-document" - "" - "spacer" - 0 - 1 - 0 - 0 - "7/10/2006" - "wbSpacerProxy" - 5 - 5 - "Centre" - "Centre" - 0 - 5 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "<Any platform>" - - - "wxStaticText: ID_RICHTEXTBULLETSPAGE_SYMBOLSTATIC" - "dialog-control-document" - "" - "statictext" - 0 - 1 - 0 - 0 - "7/10/2006" - "wbStaticTextProxy" - "wxEVT_UPDATE_UI|OnSymbolstaticUpdate" - "ID_RICHTEXTBULLETSPAGE_SYMBOLSTATIC" - 10301 - "" - "wxStaticText" - "wxStaticText" - 1 - 0 - "" - "" - "" - "Symbol &font:" - -1 - "" - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - "" - "" - "" - "" - "" - "" - "" - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Left" - "Centre" - 0 - 5 - 1 - 1 - 1 - 0 - 0 - 1 - 0 - "" - "" - - - "wxComboBox: ID_RICHTEXTBULLETSPAGE_SYMBOLFONTCTRL" - "dialog-control-document" - "" - "combobox" - 0 - 1 - 0 - 0 - "7/10/2006" - "wbComboBoxProxy" - "wxEVT_COMMAND_COMBOBOX_SELECTED|OnSymbolfontctrlSelected" - "wxEVT_COMMAND_TEXT_UPDATED|OnSymbolfontctrlUpdated" - "wxEVT_UPDATE_UI|OnSymbolfontctrlUIUpdate" - "ID_RICHTEXTBULLETSPAGE_SYMBOLFONTCTRL" - 10309 - "" - "wxComboBox" - "wxComboBox" - 1 - 0 - "" - "" - "m_symbolFontCtrl" - "" - "" - "Available fonts." - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - "" - "" - "" - "" - "" - "" - "" - 0 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Expand" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "" - "" - - - "Spacer" - "dialog-control-document" - "" - "spacer" - 0 - 1 - 0 - 0 - "20/10/2006" - "wbSpacerProxy" - 5 - 5 - "Centre" - "Centre" - 1 - 5 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "<Any platform>" - - - "wxStaticText: ID_RICHTEXTBULLETSPAGE_NAMESTATIC" - "dialog-control-document" - "" - "statictext" - 0 - 1 - 0 - 0 - "20/10/2006" - "wbStaticTextProxy" - "wxEVT_UPDATE_UI|OnNamestaticUpdate" - "ID_RICHTEXTBULLETSPAGE_NAMESTATIC" - 10303 - "" - "wxStaticText" - "wxStaticText" - 1 - 0 - "" - "" - "" - "S&tandard bullet name:" - -1 - "" - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - "" - "" - "" - "" - "" - "" - "" - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Left" - "Centre" - 0 - 5 - 1 - 1 - 1 - 0 - 0 - 1 - 0 - "" - "" - - - "wxComboBox: ID_RICHTEXTBULLETSPAGE_NAMECTRL" - "dialog-control-document" - "" - "combobox" - 0 - 1 - 0 - 0 - "20/10/2006" - "wbComboBoxProxy" - "wxEVT_COMMAND_COMBOBOX_SELECTED|OnNamectrlSelected" - "wxEVT_COMMAND_TEXT_UPDATED|OnNamectrlUpdated" - "wxEVT_UPDATE_UI|OnNamectrlUIUpdate" - "ID_RICHTEXTBULLETSPAGE_NAMECTRL" - 10304 - "" - "wxComboBox" - "wxComboBox" - 1 - 0 - "" - "" - "m_bulletNameCtrl" - "" - "" - "A standard bullet name." - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - "" - "" - "" - "" - "" - "" - "" - 0 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Expand" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "" - "" - - - "Spacer" - "dialog-control-document" - "" - "spacer" - 0 - 1 - 0 - 0 - "25/10/2006" - "wbSpacerProxy" - 5 - 5 - "Centre" - "Centre" - 1 - 5 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "<Any platform>" - - - "wxStaticText: ID_RICHTEXTBULLETSPAGE_NUMBERSTATIC" - "dialog-control-document" - "" - "statictext" - 0 - 1 - 0 - 0 - "25/10/2006" - "wbStaticTextProxy" - "wxEVT_UPDATE_UI|OnNumberstaticUpdate" - "ID_RICHTEXTBULLETSPAGE_NUMBERSTATIC" - 10302 - "" - "wxStaticText" - "wxStaticText" - 1 - 0 - "" - "" - "" - "&Number:" - -1 - "" - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - "" - "" - "" - "" - "" - "" - "" - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Left" - "Centre" - 0 - 5 - 1 - 1 - 1 - 0 - 0 - 1 - 0 - "" - "" - - - "wxSpinCtrl: ID_RICHTEXTBULLETSPAGE_NUMBERCTRL" - "dialog-control-document" - "" - "spinctrl" - 0 - 1 - 0 - 0 - "25/10/2006" - "wbSpinCtrlProxy" - "wxEVT_COMMAND_SPINCTRL_UPDATED|OnNumberctrlUpdated" - "wxEVT_SCROLL_LINEUP|OnNumberctrlUp" - "wxEVT_SCROLL_LINEDOWN|OnNumberctrlDown" - "wxEVT_COMMAND_TEXT_UPDATED|OnNumberctrlTextUpdated" - "wxEVT_UPDATE_UI|OnNumberctrlUpdate" - "ID_RICHTEXTBULLETSPAGE_NUMBERCTRL" - 10310 - "" - "wxSpinCtrl" - "wxSpinCtrl" - 1 - 0 - "" - "" - "m_numberCtrl" - 0 - 100000 - 0 - "The list item number." - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - "" - "" - "" - "" - "" - "" - "" - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - 50 - -1 - "Expand" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "" - "" - - - - - "Spacer" - "dialog-control-document" - "" - "spacer" - 0 - 1 - 0 - 0 - "4/10/2006" - "wbSpacerProxy" - 5 - 5 - "Centre" - "Centre" - 0 - 5 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "<Any platform>" - - - "wxRichTextCtrl: ID_RICHTEXTBULLETSPAGE_PREVIEW_CTRL" - "dialog-control-document" - "" - "foreign" - 0 - 1 - 0 - 0 - "4/10/2006" - "wbForeignCtrlProxy" - "ID_RICHTEXTBULLETSPAGE_PREVIEW_CTRL" - 10314 - "" - "wxRichTextCtrl" - "wxWindow" - 1 - 0 - "" - "" - "m_previewCtrl" - 1 - "Shows a preview of the bullet settings." - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - "" - "" - "" - "" - "" - "" - "" - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 1 - 0 - "wxTE_READONLY" - -1 - -1 - 350 - 100 - "Expand" - "Centre" - 1 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "%PARENT%, %ID%, wxEmptyString, %POSITION%, %SIZE%, %STYLE%" - "" - "" - - - - - - "wxRichTextStylePage" - "dialog-document" - "" - "dialog" - 0 - 1 - 0 - 0 - "5/10/2006" - "wbDialogProxy" - 10400 - 0 - "" - 0 - "" - "Standard" - 0 - 0 - "ID_RICHTEXTSTYLEPAGE" - 10403 - "wxRichTextStylePage" - "wxPanel" - "wxPanel" - "richtextstylepage.cpp" - "../../include/wx/richtext/richtextstylepage.h" - "" - "wxRichTextStylePage" - 1 - "" - 0 - "" - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - "" - "" - "" - "" - "" - "" - "Tiled" - 0 - 0 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 1 - 0 - 0 - 0 - "" - 0 - 1 - -1 - -1 - 400 - 300 - 0 - "" - - "wxBoxSizer V" - "dialog-control-document" - "" - "sizer" - 0 - 1 - 0 - 0 - "5/10/2006" - "wbBoxSizerProxy" - "Vertical" - "" - 0 - 0 - 0 - "<Any platform>" - - "wxBoxSizer V" - "dialog-control-document" - "" - "sizer" - 0 - 1 - 0 - 0 - "5/10/2006" - "wbBoxSizerProxy" - "Vertical" - "" - "Expand" - "Centre" - 1 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "<Any platform>" - - "wxBoxSizer H" - "dialog-control-document" - "" - "sizer" - 0 - 1 - 0 - 0 - "5/10/2006" - "wbBoxSizerProxy" - "Horizontal" - "" - "Expand" - "Centre" - 0 - 5 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "<Any platform>" - - "wxBoxSizer V" - "dialog-control-document" - "" - "sizer" - 0 - 1 - 0 - 0 - "5/10/2006" - "wbBoxSizerProxy" - "Vertical" - "" - "Centre" - "Expand" - 1 - 5 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "<Any platform>" - - "wxStaticText: wxID_STATIC" - "dialog-control-document" - "" - "statictext" - 0 - 1 - 0 - 0 - "5/10/2006" - "wbStaticTextProxy" - "wxID_STATIC" - 5105 - "" - "wxStaticText" - "wxStaticText" - 1 - 0 - "" - "" - "" - "&Style:" - -1 - "" - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - "" - "" - "" - "" - "" - "" - "" - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Left" - "Centre" - 0 - 5 - 1 - 1 - 1 - 0 - 0 - 1 - 0 - "" - "" - - - "wxTextCtrl: ID_RICHTEXTSTYLEPAGE_STYLE_NAME" - "dialog-control-document" - "" - "textctrl" - 0 - 1 - 0 - 0 - "5/10/2006" - "wbTextCtrlProxy" - "ID_RICHTEXTSTYLEPAGE_STYLE_NAME" - 10404 - "" - "wxTextCtrl" - "wxTextCtrl" - 1 - 0 - "" - "" - "m_styleName" - "" - 0 - "The style name." - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - "" - "" - "" - "" - "" - "" - "" - 0 - 0 - 0 - 0 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - 300 - -1 - "Expand" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "" - "" - - - "wxStaticText: wxID_STATIC" - "dialog-control-document" - "" - "statictext" - 0 - 1 - 0 - 0 - "5/10/2006" - "wbStaticTextProxy" - "wxID_STATIC" - 5105 - "" - "wxStaticText" - "wxStaticText" - 1 - 0 - "" - "" - "" - "&Based on:" - -1 - "" - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - "" - "" - "" - "" - "" - "" - "" - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Left" - "Centre" - 0 - 5 - 1 - 1 - 1 - 0 - 0 - 1 - 0 - "" - "" - - - "wxComboBox: ID_RICHTEXTSTYLEPAGE_BASED_ON" - "dialog-control-document" - "" - "combobox" - 0 - 1 - 0 - 0 - "5/10/2006" - "wbComboBoxProxy" - "ID_RICHTEXTSTYLEPAGE_BASED_ON" - 10405 - "" - "wxComboBox" - "wxComboBox" - 1 - 0 - "" - "" - "m_basedOn" - "" - "" - "The style on which this style is based." - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - "" - "" - "" - "" - "" - "" - "" - 0 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - 300 - -1 - "Expand" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "" - "" - - - "wxStaticText: wxID_STATIC" - "dialog-control-document" - "" - "statictext" - 0 - 1 - 0 - 0 - "5/10/2006" - "wbStaticTextProxy" - "wxID_STATIC" - 5105 - "" - "wxStaticText" - "wxStaticText" - 1 - 0 - "" - "" - "" - "&Next style:" - -1 - "" - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - "" - "" - "" - "" - "" - "" - "" - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Left" - "Centre" - 0 - 5 - 1 - 1 - 1 - 0 - 0 - 1 - 0 - "" - "" - - - "wxComboBox: ID_RICHTEXTSTYLEPAGE_NEXT_STYLE" - "dialog-control-document" - "" - "combobox" - 0 - 1 - 0 - 0 - "5/10/2006" - "wbComboBoxProxy" - "wxEVT_UPDATE_UI|OnNextStyleUpdate" - "ID_RICHTEXTSTYLEPAGE_NEXT_STYLE" - 10406 - "" - "wxComboBox" - "wxComboBox" - 1 - 0 - "" - "" - "m_nextStyle" - "" - "" - "The default style for the next paragraph." - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - "" - "" - "" - "" - "" - "" - "" - 0 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - 300 - -1 - "Expand" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "" - "" - - - - - "Spacer" - "dialog-control-document" - "" - "spacer" - 0 - 1 - 0 - 0 - "5/10/2006" - "wbSpacerProxy" - 5 - 5 - "Centre" - "Centre" - 1 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "<Any platform>" - - - - - - "wxSymbolPickerDialog" - "dialog-document" - "" - "dialog" - 0 - 1 - 0 - 0 - "5/10/2006" - "wbDialogProxy" - 10600 - 0 - "" - 0 - "" - "Standard" - 0 - 0 - "m_fontName|wxString|FontName||0" - "m_symbol|wxString|Symbol||0" - "m_fromUnicode|bool|FromUnicode|true|0" - "m_normalTextFontName|wxString|NormalTextFontName|" - "ID_SYMBOLPICKERDIALOG" - 10600 - "wxSymbolPickerDialog" - "wxDialog" - "wxDialog" - "richtextsymboldlg.cpp" - "../../include/wx/richtext/richtextsymboldlg.h" - "" - "Symbols" - 1 - "" - 0 - "" - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - "" - "" - "" - "" - "" - "" - "Tiled" - 1 - 0 - 1 - 0 - 0 - 0 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 1 - 0 - "" - 1 - 1 - -1 - -1 - 400 - 300 - 0 - "" - - "wxBoxSizer V" - "dialog-control-document" - "" - "sizer" - 0 - 1 - 0 - 0 - "5/10/2006" - "wbBoxSizerProxy" - "Vertical" - "" - "Centre" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "<Any platform>" - - "wxBoxSizer V" - "dialog-control-document" - "" - "sizer" - 0 - 1 - 0 - 0 - "5/10/2006" - "wbBoxSizerProxy" - "Vertical" - "" - "Expand" - "Centre" - 1 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "<Any platform>" - - "wxBoxSizer H" - "dialog-control-document" - "" - "sizer" - 0 - 1 - 0 - 0 - "5/10/2006" - "wbBoxSizerProxy" - "Horizontal" - "" - "Expand" - "Centre" - 0 - 5 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "<Any platform>" - - "wxBoxSizer H" - "dialog-control-document" - "" - "sizer" - 0 - 1 - 0 - 0 - "5/10/2006" - "wbBoxSizerProxy" - "Horizontal" - "" - "Centre" - "Expand" - 1 - 5 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "<Any platform>" - - "wxStaticText: wxID_STATIC" - "dialog-control-document" - "" - "statictext" - 0 - 1 - 0 - 0 - "5/10/2006" - "wbStaticTextProxy" - "wxID_STATIC" - 5105 - "" - "wxStaticText" - "wxStaticText" - 1 - 0 - "" - "" - "" - "&Font:" - -1 - "" - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - "" - "" - "" - "" - "" - "" - "" - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Left" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 1 - 0 - "" - "" - - - "wxComboBox: ID_SYMBOLPICKERDIALOG_FONT" - "dialog-control-document" - "" - "combobox" - 0 - 1 - 0 - 0 - "5/10/2006" - "wbComboBoxProxy" - "wxEVT_COMMAND_COMBOBOX_SELECTED|OnFontCtrlSelected" - "ID_SYMBOLPICKERDIALOG_FONT" - 10602 - "" - "wxComboBox" - "wxComboBox" - 1 - 0 - "" - "" - "m_fontCtrl" - "" - "" - "The font from which to take the symbol." - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - "" - "" - "" - "" - "" - "" - "" - 0 - 0 - 1 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - 240 - -1 - "Expand" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "" - "" - - - "Spacer" - "dialog-control-document" - "" - "spacer" - 0 - 1 - 0 - 0 - "6/10/2006" - "wbSpacerProxy" - 5 - 5 - "Centre" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "<Any platform>" - - - "wxStaticText: wxID_STATIC" - "dialog-control-document" - "" - "statictext" - 0 - 1 - 0 - 0 - "6/10/2006" - "wbStaticTextProxy" - "wxID_STATIC" - 5105 - "" - "wxStaticText" - "wxStaticText" - 1 - 0 - "" - "" - "" - "&Subset:" - -1 - "" - "" - "" - "" - "" - 0 - 1 - "__UNICODE__" - "" - "" - "" - "" - "" - "" - "" - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Centre" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 1 - 0 - "" - "" - - - "wxComboBox: ID_SYMBOLPICKERDIALOG_SUBSET" - "dialog-control-document" - "" - "combobox" - 0 - 1 - 0 - 0 - "6/10/2006" - "wbComboBoxProxy" - "wxEVT_COMMAND_COMBOBOX_SELECTED|OnSubsetSelected" - "ID_SYMBOLPICKERDIALOG_SUBSET" - 10605 - "" - "wxComboBox" - "wxComboBox" - 1 - 0 - "" - "" - "m_subsetCtrl" - "" - "" - "Shows a Unicode subset." - "" - "" - "" - "" - 0 - 1 - "__UNICODE__" - "" - "" - "" - "" - "" - "" - "" - 0 - 0 - 1 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Centre" - "Centre" - 1 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "" - "" - - - - - "wxSymbolListCtrl: ID_SYMBOLPICKERDIALOG_LISTCTRL" - "dialog-control-document" - "" - "foreign" - 0 - 1 - 0 - 0 - "5/10/2006" - "wbForeignCtrlProxy" - "ID_SYMBOLPICKERDIALOG_LISTCTRL" - 10608 - "" - "wxSymbolListCtrl" - "wxWindow" - 1 - 0 - "" - "" - "m_symbolsCtrl" - 1 - "" - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - "" - "" - "" - "" - "" - "" - "" - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - 500 - 220 - "Expand" - "Centre" - 1 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "" - "" - "" - - - "wxBoxSizer H" - "dialog-control-document" - "" - "sizer" - 0 - 1 - 0 - 0 - "5/10/2006" - "wbBoxSizerProxy" - "Horizontal" - "" - "Expand" - "Centre" - 0 - 5 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "<Any platform>" - - "wxStaticText: wxID_STATIC" - "dialog-control-document" - "" - "statictext" - 0 - 1 - 0 - 0 - "6/10/2006" - "wbStaticTextProxy" - "wxID_STATIC" - 5105 - "" - "wxStaticText" - "wxStaticText" - 1 - 0 - "" - "" - "m_symbolStaticCtrl" - "xxxx" - -1 - "" - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - "" - "" - "" - "" - "" - "" - "" - 0 - 0 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - 40 - -1 - "Centre" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 1 - 0 - "" - "" - - - "Spacer" - "dialog-control-document" - "" - "spacer" - 0 - 1 - 0 - 0 - "6/10/2006" - "wbSpacerProxy" - 5 - 5 - "Centre" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "<Any platform>" - - - "wxStaticText: wxID_STATIC" - "dialog-control-document" - "" - "statictext" - 0 - 1 - 0 - 0 - "5/10/2006" - "wbStaticTextProxy" - "wxID_STATIC" - 5105 - "" - "wxStaticText" - "wxStaticText" - 1 - 0 - "" - "" - "" - "&Character code:" - -1 - "" - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - "" - "" - "" - "" - "" - "" - "" - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Centre" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 1 - 0 - "" - "" - - - "wxTextCtrl: ID_SYMBOLPICKERDIALOG_CHARACTERCODE" - "dialog-control-document" - "" - "textctrl" - 0 - 1 - 0 - 0 - "5/10/2006" - "wbTextCtrlProxy" - "ID_SYMBOLPICKERDIALOG_CHARACTERCODE" - 10601 - "" - "wxTextCtrl" - "wxTextCtrl" - 1 - 0 - "" - "" - "m_characterCodeCtrl" - "" - 0 - "The character code." - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - "" - "" - "" - "" - "" - "" - "" - 0 - 0 - 0 - 0 - 1 - 0 - 0 - 0 - 0 - 0 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - 140 - -1 - "Centre" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "" - "" - 0 - - - "Spacer" - "dialog-control-document" - "" - "spacer" - 0 - 1 - 0 - 0 - "5/10/2006" - "wbSpacerProxy" - 5 - 5 - "Centre" - "Centre" - 1 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "<Any platform>" - - - "wxStaticText: wxID_STATIC" - "dialog-control-document" - "" - "statictext" - 0 - 1 - 0 - 0 - "5/10/2006" - "wbStaticTextProxy" - "wxID_STATIC" - 5105 - "" - "wxStaticText" - "wxStaticText" - 1 - 0 - "" - "" - "" - "&From:" - -1 - "" - "" - "" - "" - "" - 0 - 1 - "__UNICODE__" - "" - "" - "" - "" - "" - "" - "" - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Centre" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 1 - 0 - "" - "" - - - "wxComboBox: ID_SYMBOLPICKERDIALOG_FROM" - "dialog-control-document" - "" - "combobox" - 0 - 1 - 0 - 0 - "5/10/2006" - "wbComboBoxProxy" - "wxEVT_COMMAND_COMBOBOX_SELECTED|OnFromUnicodeSelected" - "ID_SYMBOLPICKERDIALOG_FROM" - 10603 - "" - "wxComboBox" - "wxComboBox" - 1 - 0 - "" - "" - "m_fromUnicodeCtrl" - "ASCII|Unicode" - "Unicode" - "The range to show." - "" - "" - "" - "" - 0 - 1 - "__UNICODE__" - "" - "" - "" - "" - "" - "" - "" - 0 - 0 - 1 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Centre" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "" - "" - - - - "wxBoxSizer H" - "dialog-control-document" - "" - "sizer" - 0 - 1 - 0 - 0 - "5/10/2006" - "wbBoxSizerProxy" - "Horizontal" - "" - "Expand" - "Centre" - 0 - 5 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "__WXMSW__,__WXGTK__,__WXPM__,__WXMGL__,__WXMOTIF__,__WXCOCOA__,__WXX11__,__WXPALMOS__" - - "Spacer" - "dialog-control-document" - "" - "spacer" - 0 - 1 - 0 - 0 - "5/10/2006" - "wbSpacerProxy" - 5 - 5 - "Centre" - "Centre" - 1 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "<Any platform>" - - - "wxButton: wxID_OK" - "dialog-control-document" - "" - "dialogcontrol" - 0 - 1 - 0 - 0 - "5/10/2006" - "wbButtonProxy" - "wxEVT_UPDATE_UI|OnOkUpdate" - "wxID_OK" - 5100 - "" - "wxButton" - "wxButton" - 1 - 0 - "" - "" - "" - "Insert" - 1 - "Inserts the chosen symbol." - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Centre" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "" - "" - - - "wxButton: wxID_CANCEL" - "dialog-control-document" - "" - "dialogcontrol" - 0 - 1 - 0 - 0 - "5/10/2006" - "wbButtonProxy" - "wxID_CANCEL" - 5101 - "" - "wxButton" - "wxButton" - 1 - 0 - "" - "" - "" - "Close" - 0 - "Closes the dialog without inserting a symbol." - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Centre" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "" - "" - - - - "wxBoxSizer H" - "dialog-control-document" - "" - "sizer" - 0 - 1 - 0 - 0 - "5/10/2006" - "wbBoxSizerProxy" - "Horizontal" - "" - "Expand" - "Centre" - 0 - 5 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "__WXMAC__" - - "Spacer" - "dialog-control-document" - "" - "spacer" - 0 - 1 - 0 - 0 - "5/10/2006" - "wbSpacerProxy" - 5 - 5 - "Centre" - "Centre" - 1 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "<Any platform>" - - - "wxButton: wxID_CANCEL" - "dialog-control-document" - "" - "dialogcontrol" - 0 - 1 - 0 - 0 - "5/10/2006" - "wbButtonProxy" - "wxID_CANCEL" - 5101 - "" - "wxButton" - "wxButton" - 1 - 0 - "" - "" - "" - "Close" - 0 - "Closes the dialog without inserting a symbol." - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Centre" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "" - "" - - - "wxButton: wxID_OK" - "dialog-control-document" - "" - "dialogcontrol" - 0 - 1 - 0 - 0 - "5/10/2006" - "wbButtonProxy" - "wxEVT_UPDATE_UI|OnOkUpdate" - "wxID_OK" - 5100 - "" - "wxButton" - "wxButton" - 1 - 0 - "" - "" - "" - "Insert" - 1 - "Inserts the chosen symbol." - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Centre" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "" - "" - - - - - - - "wxRichTextStyleOrganiserDialog" - "dialog-document" - "" - "dialog" - 0 - 1 - 0 - 0 - "5/10/2006" - "wbDialogProxy" - 10500 - 0 - "" - 0 - "" - "Standard" - 0 - 0 - "ID_RICHTEXTSTYLEORGANISERDIALOG" - 10500 - "wxRichTextStyleOrganiserDialog" - "wxDialog" - "wxDialog" - "richtextstyledlg.cpp" - "../../include/wx/richtext/richtextstyledlg.h" - "" - "Style Organiser" - 1 - "" - 0 - "" - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - "" - "" - "" - "" - "" - "" - "Tiled" - 1 - 0 - 1 - 1 - 0 - 0 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 1 - 0 - "" - 1 - 1 - -1 - -1 - 400 - 300 - 0 - "" - 0 - - "wxBoxSizer V" - "dialog-control-document" - "" - "sizer" - 0 - 1 - 0 - 0 - "wbBoxSizerProxy" - "Vertical" - "" - "Centre" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "<Any platform>" - - "wxBoxSizer V" - "dialog-control-document" - "" - "sizer" - 0 - 1 - 0 - 0 - "5/10/2006" - "wbBoxSizerProxy" - "Vertical" - "m_innerSizer" - "Expand" - "Centre" - 1 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "<Any platform>" - - "wxBoxSizer H" - "dialog-control-document" - "" - "sizer" - 0 - 1 - 0 - 0 - "5/10/2006" - "wbBoxSizerProxy" - "Horizontal" - "m_buttonSizerParent" - "Expand" - "Centre" - 1 - 5 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "<Any platform>" - - "wxBoxSizer V" - "dialog-control-document" - "" - "sizer" - 0 - 1 - 0 - 0 - "5/10/2006" - "wbBoxSizerProxy" - "Vertical" - "" - "Centre" - "Expand" - 1 - 5 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "<Any platform>" - - "wxStaticText: wxID_STATIC" - "dialog-control-document" - "" - "statictext" - 0 - 1 - 0 - 0 - "5/10/2006" - "wbStaticTextProxy" - "wxID_STATIC" - 5105 - "" - "wxStaticText" - "wxStaticText" - 1 - 0 - "" - "" - "" - "&Styles:" - -1 - "" - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - "" - "" - "" - "" - "" - "" - "" - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Left" - "Centre" - 0 - 5 - 1 - 1 - 1 - 0 - 0 - 1 - 0 - "" - "" - - - "wxRichTextStyleListCtrl: ID_RICHTEXTSTYLEORGANISERDIALOG_STYLES" - "dialog-control-document" - "" - "foreign" - 0 - 1 - 0 - 0 - "5/10/2006" - "wbForeignCtrlProxy" - "ID_RICHTEXTSTYLEORGANISERDIALOG_STYLES" - 10501 - "" - "wxRichTextStyleListCtrl" - "wxWindow" - 1 - 0 - "" - "" - "m_stylesListBox" - 1 - "The available styles." - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - "" - "" - "" - "" - "" - "" - "" - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "listCtrlStyle" - -1 - -1 - 280 - 260 - "Expand" - "Centre" - 1 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "" - "" - "" - - - - "wxBoxSizer V" - "dialog-control-document" - "" - "sizer" - 0 - 1 - 0 - 0 - "18/10/2006" - "wbBoxSizerProxy" - "Vertical" - "" - "Centre" - "Expand" - 0 - 5 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "<Any platform>" - - "wxStaticText: ID_RICHTEXTSTYLEORGANISERDIALOG_CURRENT_STYLE" - "dialog-control-document" - "" - "statictext" - 0 - 1 - 0 - 0 - "18/10/2006" - "wbStaticTextProxy" - "ID_RICHTEXTSTYLEORGANISERDIALOG_CURRENT_STYLE" - 10510 - "" - "wxStaticText" - "wxStaticText" - 1 - 0 - "" - "" - "" - " " - -1 - "" - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - "" - "" - "" - "" - "" - "" - "" - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Expand" - "Centre" - 0 - 5 - 1 - 1 - 1 - 0 - 0 - 1 - 0 - "" - "" - - - "wxRichTextCtrl: ID_RICHTEXTSTYLEORGANISERDIALOG_PREVIEW" - "dialog-control-document" - "" - "foreign" - 0 - 1 - 0 - 0 - "18/10/2006" - "wbForeignCtrlProxy" - "ID_RICHTEXTSTYLEORGANISERDIALOG_PREVIEW" - 10509 - "" - "wxRichTextCtrl" - "wxWindow" - 1 - 0 - "" - "" - "m_previewCtrl" - 1 - "The style preview." - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - "" - "" - "" - "" - "" - "" - "" - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 1 - 0 - "wxTE_READONLY" - -1 - -1 - 250 - 200 - "Expand" - "Centre" - 1 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "%PARENT%, %ID%, wxEmptyString, %POSITION%, %SIZE%, %STYLE%" - "" - "" - - - - "wxBoxSizer V" - "dialog-control-document" - "" - "sizer" - 0 - 1 - 0 - 0 - "5/10/2006" - "wbBoxSizerProxy" - "Vertical" - "m_buttonSizer" - "Centre" - "Expand" - 0 - 5 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "<Any platform>" - - "wxStaticText: wxID_STATIC" - "dialog-control-document" - "" - "statictext" - 0 - 1 - 0 - 0 - "18/10/2006" - "wbStaticTextProxy" - "wxID_STATIC" - 5105 - "" - "wxStaticText" - "wxStaticText" - 1 - 0 - "" - "" - "" - " " - -1 - "" - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - "" - "" - "" - "" - "" - "" - "" - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Left" - "Centre" - 0 - 5 - 1 - 1 - 1 - 0 - 0 - 1 - 0 - "" - "" - - - "wxButton: ID_RICHTEXTSTYLEORGANISERDIALOG_NEW_CHAR" - "dialog-control-document" - "" - "dialogcontrol" - 0 - 1 - 0 - 0 - "5/10/2006" - "wbButtonProxy" - "wxEVT_COMMAND_BUTTON_CLICKED|OnNewCharClick" - "wxEVT_UPDATE_UI|OnNewCharUpdate" - "ID_RICHTEXTSTYLEORGANISERDIALOG_NEW_CHAR" - 10504 - "" - "wxButton" - "wxButton" - 1 - 0 - "" - "" - "m_newCharacter" - "New &Character Style..." - 0 - "Click to create a new character style." - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Expand" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "" - "" - - - "wxButton: ID_RICHTEXTSTYLEORGANISERDIALOG_NEW_PARA" - "dialog-control-document" - "" - "dialogcontrol" - 0 - 1 - 0 - 0 - "17/10/2006" - "wbButtonProxy" - "wxEVT_COMMAND_BUTTON_CLICKED|OnNewParaClick" - "wxEVT_UPDATE_UI|OnNewParaUpdate" - "ID_RICHTEXTSTYLEORGANISERDIALOG_NEW_PARA" - 10505 - "" - "wxButton" - "wxButton" - 1 - 0 - "" - "" - "m_newParagraph" - "New &Paragraph Style..." - 0 - "Click to create a new paragraph style." - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Expand" - "Centre" - 0 - 5 - 1 - 1 - 0 - 1 - 0 - 0 - 0 - "" - "" - - - "wxButton: ID_RICHTEXTSTYLEORGANISERDIALOG_NEW_LIST" - "dialog-control-document" - "" - "dialogcontrol" - 0 - 1 - 0 - 0 - "17/10/2006" - "wbButtonProxy" - "wxEVT_COMMAND_BUTTON_CLICKED|OnNewListClick" - "wxEVT_UPDATE_UI|OnNewListUpdate" - "ID_RICHTEXTSTYLEORGANISERDIALOG_NEW_LIST" - 10508 - "" - "wxButton" - "wxButton" - 1 - 0 - "" - "" - "m_newList" - "New &List Style..." - 0 - "Click to create a new list style." - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Expand" - "Centre" - 0 - 5 - 1 - 1 - 0 - 1 - 0 - 0 - 0 - "" - "" - - - "Spacer" - "dialog-control-document" - "" - "spacer" - 0 - 1 - 0 - 0 - "17/10/2006" - "wbSpacerProxy" - 5 - 5 - "Centre" - "Centre" - 1 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "<Any platform>" - - - "wxButton: ID_RICHTEXTSTYLEORGANISERDIALOG_APPLY" - "dialog-control-document" - "" - "dialogcontrol" - 0 - 1 - 0 - 0 - "17/10/2006" - "wbButtonProxy" - "wxEVT_COMMAND_BUTTON_CLICKED|OnApplyClick" - "wxEVT_UPDATE_UI|OnApplyUpdate" - "ID_RICHTEXTSTYLEORGANISERDIALOG_APPLY" - 10503 - "" - "wxButton" - "wxButton" - 1 - 0 - "" - "" - "m_applyStyle" - "&Apply Style" - 0 - "Click to apply the selected style." - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Expand" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "" - "" - - - "wxButton: ID_RICHTEXTSTYLEORGANISERDIALOG_RENAME" - "dialog-control-document" - "" - "dialogcontrol" - 0 - 1 - 0 - 0 - "17/10/2006" - "wbButtonProxy" - "wxEVT_COMMAND_BUTTON_CLICKED|OnRenameClick" - "wxEVT_UPDATE_UI|OnRenameUpdate" - "ID_RICHTEXTSTYLEORGANISERDIALOG_RENAME" - 10502 - "" - "wxButton" - "wxButton" - 1 - 0 - "" - "" - "m_renameStyle" - "&Rename Style..." - 0 - "Click to rename the selected style." - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Expand" - "Centre" - 0 - 5 - 1 - 1 - 0 - 1 - 0 - 0 - 0 - "" - "" - - - "wxButton: ID_RICHTEXTSTYLEORGANISERDIALOG_EDIT" - "dialog-control-document" - "" - "dialogcontrol" - 0 - 1 - 0 - 0 - "5/10/2006" - "wbButtonProxy" - "wxEVT_COMMAND_BUTTON_CLICKED|OnEditClick" - "wxEVT_UPDATE_UI|OnEditUpdate" - "ID_RICHTEXTSTYLEORGANISERDIALOG_EDIT" - 10506 - "" - "wxButton" - "wxButton" - 1 - 0 - "" - "" - "m_editStyle" - "&Edit Style..." - 0 - "Click to edit the selected style." - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Expand" - "Centre" - 0 - 5 - 1 - 1 - 0 - 1 - 0 - 0 - 0 - "" - "" - - - "wxButton: ID_RICHTEXTSTYLEORGANISERDIALOG_DELETE" - "dialog-control-document" - "" - "dialogcontrol" - 0 - 1 - 0 - 0 - "5/10/2006" - "wbButtonProxy" - "wxEVT_COMMAND_BUTTON_CLICKED|OnDeleteClick" - "wxEVT_UPDATE_UI|OnDeleteUpdate" - "ID_RICHTEXTSTYLEORGANISERDIALOG_DELETE" - 10507 - "" - "wxButton" - "wxButton" - 1 - 0 - "" - "" - "m_deleteStyle" - "&Delete Style..." - 0 - "Click to delete the selected style." - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Expand" - "Centre" - 0 - 5 - 1 - 1 - 0 - 1 - 0 - 0 - 0 - "" - "" - - - "Spacer" - "dialog-control-document" - "" - "spacer" - 0 - 1 - 0 - 0 - "18/10/2006" - "wbSpacerProxy" - 5 - 5 - "Centre" - "Centre" - 1 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "<Any platform>" - - - "wxButton: wxID_CANCEL" - "dialog-control-document" - "" - "dialogcontrol" - 0 - 1 - 0 - 0 - "18/10/2006" - "wbButtonProxy" - "wxID_CANCEL" - 5101 - "" - "wxButton" - "wxButton" - 1 - 0 - "" - "" - "m_closeButton" - "Close" - 1 - "Click to close this window." - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Expand" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "" - "" - - - - - "wxBoxSizer H" - "dialog-control-document" - "" - "sizer" - 0 - 1 - 0 - 0 - "18/10/2006" - "wbBoxSizerProxy" - "Horizontal" - "m_bottomButtonSizer" - "Expand" - "Centre" - 0 - 5 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "<Any platform>" - - "wxCheckBox: ID_RICHTEXTSTYLEORGANISERDIALOG_RESTART_NUMBERING" - "dialog-control-document" - "" - "checkbox" - 0 - 1 - 0 - 0 - "18/10/2006" - "wbCheckBoxProxy" - "ID_RICHTEXTSTYLEORGANISERDIALOG_RESTART_NUMBERING" - 10511 - "" - "wxCheckBox" - "wxCheckBox" - 1 - 0 - "" - "" - "m_restartNumberingCtrl" - "&Restart numbering" - 0 - "Check to restart numbering." - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Centre" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "" - "" - - - "Spacer" - "dialog-control-document" - "" - "spacer" - 0 - 1 - 0 - 0 - "18/10/2006" - "wbSpacerProxy" - 5 - 5 - "Centre" - "Centre" - 1 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "<Any platform>" - - - "wxButton: wxID_OK" - "dialog-control-document" - "" - "dialogcontrol" - 0 - 1 - 0 - 0 - "18/10/2006" - "wbButtonProxy" - "wxID_OK" - 5100 - "" - "wxButton" - "wxButton" - 1 - 0 - "" - "" - "m_okButton" - "OK" - 1 - "Click to confirm your selection." - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Expand" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "" - "" - - - "wxButton: wxID_CANCEL" - "dialog-control-document" - "" - "dialogcontrol" - 0 - 1 - 0 - 0 - "18/10/2006" - "wbButtonProxy" - "wxID_CANCEL" - 5101 - "" - "wxButton" - "wxButton" - 1 - 0 - "" - "" - "m_cancelButton" - "Cancel" - 0 - "Click to cancel this window." - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Expand" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "" - "" - - - - - - - "wxRichTextListStylePage" - "dialog-document" - "" - "dialog" - 0 - 1 - 0 - 0 - "18/10/2006" - "wbDialogProxy" - 10600 - 0 - "" - 0 - "" - "Standard" - 0 - 0 - "ID_RICHTEXTLISTSTYLEPAGE" - 10616 - "wxRichTextListStylePage" - "wxPanel" - "wxPanel" - "richtextliststylepage.cpp" - "../../include/wx/richtext/richtextliststylepage.h" - "" - "wxRichTextListStylePage" - 1 - "" - 0 - "" - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - "" - "" - "" - "" - "" - "" - "Tiled" - 0 - 0 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 1 - 0 - 0 - 0 - "" - 0 - 1 - -1 - -1 - 400 - 300 - 0 - "" - 0 - - "wxBoxSizer V" - "dialog-control-document" - "" - "sizer" - 0 - 1 - 0 - 0 - "18/10/2006" - "wbBoxSizerProxy" - "Vertical" - "" - "Centre" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "<Any platform>" - - "wxBoxSizer V" - "dialog-control-document" - "" - "sizer" - 0 - 1 - 0 - 0 - "18/10/2006" - "wbBoxSizerProxy" - "Vertical" - "" - "Expand" - "Centre" - 1 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "<Any platform>" - - "wxBoxSizer H" - "dialog-control-document" - "" - "sizer" - 0 - 1 - 0 - 0 - "18/10/2006" - "wbBoxSizerProxy" - "Horizontal" - "" - "Centre" - "Centre" - 0 - 5 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "<Any platform>" - - "wxStaticText: wxID_STATIC" - "dialog-control-document" - "" - "statictext" - 0 - 1 - 0 - 0 - "18/10/2006" - "wbStaticTextProxy" - "wxID_STATIC" - 5105 - "" - "wxStaticText" - "wxStaticText" - 1 - 0 - "" - "" - "" - "&List level:" - -1 - "" - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - "" - "" - "" - "" - "" - "" - "" - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Centre" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 1 - 0 - "" - "" - - - "wxSpinCtrl: ID_RICHTEXTLISTSTYLEPAGE_LEVEL" - "dialog-control-document" - "" - "spinctrl" - 0 - 1 - 0 - 0 - "18/10/2006" - "wbSpinCtrlProxy" - "wxEVT_COMMAND_SPINCTRL_UPDATED|OnLevelUpdated" - "wxEVT_SCROLL_LINEUP|OnLevelUp" - "wxEVT_SCROLL_LINEDOWN|OnLevelDown" - "wxEVT_COMMAND_TEXT_UPDATED|OnLevelTextUpdated" - "wxEVT_UPDATE_UI|OnLevelUIUpdate" - "ID_RICHTEXTLISTSTYLEPAGE_LEVEL" - 10617 - "" - "wxSpinCtrl" - "wxSpinCtrl" - 1 - 0 - "" - "" - "m_levelCtrl" - 1 - 10 - 1 - "Selects the list level to edit." - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - "" - "" - "" - "" - "" - "" - "" - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - 60 - -1 - "Centre" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "" - "" - - - "Spacer" - "dialog-control-document" - "" - "spacer" - 0 - 1 - 0 - 0 - "18/10/2006" - "wbSpacerProxy" - 5 - 5 - "Centre" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "<Any platform>" - - - "wxButton: ID_RICHTEXTLISTSTYLEPAGE_CHOOSE_FONT" - "dialog-control-document" - "" - "dialogcontrol" - 0 - 1 - 0 - 0 - "18/10/2006" - "wbButtonProxy" - "wxEVT_COMMAND_BUTTON_CLICKED|OnChooseFontClick" - "ID_RICHTEXTLISTSTYLEPAGE_CHOOSE_FONT" - 10604 - "" - "wxButton" - "wxButton" - 1 - 0 - "" - "" - "" - "&Font for Level..." - 0 - "Click to choose the font for this level." - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Centre" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "" - "" - - - - "wxNotebook: ID_RICHTEXTLISTSTYLEPAGE_NOTEBOOK" - "dialog-control-document" - "" - "notebook" - 0 - 1 - 0 - 0 - "18/10/2006" - "wbNotebookProxy" - "ID_RICHTEXTLISTSTYLEPAGE_NOTEBOOK" - 10618 - "" - "wxNotebook" - "wxNotebook" - 1 - 0 - "" - "" - "" - 0 - "" - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - "" - "" - "" - "" - "" - "" - "" - 1 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Expand" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "" - "" - - "wxPanel: ID_RICHTEXTLISTSTYLEPAGE_BULLETS" - "dialog-control-document" - "" - "panel" - 0 - 1 - 0 - 0 - "18/10/2006" - "wbPanelProxy" - "ID_RICHTEXTLISTSTYLEPAGE_BULLETS" - 10619 - "" - "wxPanel" - "wxPanel" - 0 - 0 - "" - "" - "" - "Bullet style" - "" - "" - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - "" - "" - "" - "" - "" - "" - "Tiled" - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 1 - 0 - 0 - 0 - "" - 1 - -1 - -1 - -1 - -1 - "Centre" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "" - "" - "" - 0 - - "wxBoxSizer V" - "dialog-control-document" - "" - "sizer" - 0 - 1 - 0 - 0 - "18/10/2006" - "wbBoxSizerProxy" - "Vertical" - "" - "Centre" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "<Any platform>" - - "wxBoxSizer H" - "dialog-control-document" - "" - "sizer" - 0 - 1 - 0 - 0 - "18/10/2006" - "wbBoxSizerProxy" - "Horizontal" - "" - "Expand" - "Centre" - 1 - 5 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "<Any platform>" - - "wxBoxSizer V" - "dialog-control-document" - "" - "sizer" - 0 - 1 - 0 - 0 - "18/10/2006" - "wbBoxSizerProxy" - "Vertical" - "" - "Centre" - "Expand" - 0 - 5 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "<Any platform>" - - "wxStaticText: wxID_STATIC" - "dialog-control-document" - "" - "statictext" - 0 - 1 - 0 - 0 - "18/10/2006" - "wbStaticTextProxy" - "wxID_STATIC" - 5105 - "" - "wxStaticText" - "wxStaticText" - 1 - 0 - "" - "" - "" - "&Bullet style:" - -1 - "" - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - "" - "" - "" - "" - "" - "" - "" - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Left" - "Centre" - 0 - 5 - 1 - 1 - 1 - 0 - 0 - 1 - 0 - "" - "" - - - "wxListBox: ID_RICHTEXTLISTSTYLEPAGE_STYLELISTBOX" - "dialog-control-document" - "" - "listbox" - 0 - 1 - 0 - 0 - "18/10/2006" - "wbListBoxProxy" - "wxEVT_COMMAND_LISTBOX_SELECTED|OnStylelistboxSelected" - "ID_RICHTEXTLISTSTYLEPAGE_STYLELISTBOX" - 10620 - "" - "wxListBox" - "wxListBox" - 1 - 0 - "" - "" - "m_styleListBox" - "" - "" - "The available bullet styles." - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - "" - "" - "" - "" - "" - "" - "" - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - 90 - "Expand" - "Centre" - 1 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "" - "" - - - "wxBoxSizer H" - "dialog-control-document" - "" - "sizer" - 0 - 1 - 0 - 0 - "20/10/2006" - "wbBoxSizerProxy" - "Horizontal" - "" - "Expand" - "Centre" - 0 - 5 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "<Any platform>" - - "wxCheckBox: ID_RICHTEXTLISTSTYLEPAGE_PERIODCTRL" - "dialog-control-document" - "" - "checkbox" - 0 - 1 - 0 - 0 - "20/10/2006" - "wbCheckBoxProxy" - "wxEVT_COMMAND_CHECKBOX_CLICKED|OnPeriodctrlClick" - "wxEVT_UPDATE_UI|OnPeriodctrlUpdate" - "ID_RICHTEXTLISTSTYLEPAGE_PERIODCTRL" - 10627 - "" - "wxCheckBox" - "wxCheckBox" - 1 - 0 - "" - "" - "m_periodCtrl" - "Peri&od" - 0 - "Check to add a period after the bullet." - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Left" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "" - "" - - - "wxCheckBox: ID_RICHTEXTLISTSTYLEPAGE_PARENTHESESCTRL" - "dialog-control-document" - "" - "checkbox" - 0 - 1 - 0 - 0 - "20/10/2006" - "wbCheckBoxProxy" - "wxEVT_COMMAND_CHECKBOX_CLICKED|OnParenthesesctrlClick" - "wxEVT_UPDATE_UI|OnParenthesesctrlUpdate" - "ID_RICHTEXTLISTSTYLEPAGE_PARENTHESESCTRL" - 10626 - "" - "wxCheckBox" - "wxCheckBox" - 1 - 0 - "" - "" - "m_parenthesesCtrl" - "(*)" - 0 - "Check to enclose the bullet in parentheses." - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Left" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "" - "" - - - "wxCheckBox: ID_RICHTEXTLISTSTYLEPAGE_RIGHTPARENTHESISCTRL" - "dialog-control-document" - "" - "checkbox" - 0 - 1 - 0 - 0 - "25/10/2006" - "wbCheckBoxProxy" - "wxEVT_COMMAND_CHECKBOX_CLICKED|OnRightParenthesisCtrlClick" - "wxEVT_UPDATE_UI|OnRightParenthesisCtrlUpdate" - "ID_RICHTEXTLISTSTYLEPAGE_RIGHTPARENTHESISCTRL" - 10602 - "" - "wxCheckBox" - "wxCheckBox" - 1 - 0 - "" - "" - "m_rightParenthesisCtrl" - "*)" - 0 - "Check to add a right parenthesis." - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Left" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "" - "" - - - - "Spacer" - "dialog-control-document" - "" - "spacer" - 0 - 1 - 0 - 0 - "25/10/2006" - "wbSpacerProxy" - 2 - 1 - "Centre" - "Centre" - 0 - 5 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "<Any platform>" - - - "wxStaticText: wxID_STATIC" - "dialog-control-document" - "" - "statictext" - 0 - 1 - 0 - 0 - "25/10/2006" - "wbStaticTextProxy" - "wxID_STATIC" - 5105 - "" - "wxStaticText" - "wxStaticText" - 1 - 0 - "" - "" - "" - "Bullet &Alignment:" - -1 - "" - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - "" - "" - "" - "" - "" - "" - "" - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Left" - "Centre" - 0 - 5 - 1 - 1 - 1 - 0 - 0 - 1 - 0 - "" - "" - - - "wxComboBox: ID_RICHTEXTLISTSTYLEPAGE_BULLETALIGNMENTCTRL" - "dialog-control-document" - "" - "combobox" - 0 - 1 - 0 - 0 - "25/10/2006" - "wbComboBoxProxy" - "wxEVT_COMMAND_COMBOBOX_SELECTED|OnBulletAlignmentCtrlSelected" - "ID_RICHTEXTLISTSTYLEPAGE_BULLETALIGNMENTCTRL" - 10603 - "" - "wxComboBox" - "wxComboBox" - 1 - 0 - "" - "" - "m_bulletAlignmentCtrl" - "Left|Centre|Right" - "Left" - "The bullet character." - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - "" - "" - "" - "" - "" - "" - "" - 0 - 0 - 1 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - 60 - -1 - "Expand" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 1 - "" - "" - - - - "Spacer" - "dialog-control-document" - "" - "spacer" - 0 - 1 - 0 - 0 - "18/10/2006" - "wbSpacerProxy" - 2 - 1 - "Centre" - "Centre" - 1 - 5 - 0 - 0 - 1 - 1 - 0 - 0 - 0 - "<Any platform>" - - - "wxStaticLine: wxID_STATIC" - "dialog-control-document" - "" - "staticline" - 0 - 1 - 0 - 0 - "18/10/2006" - "wbStaticLineProxy" - "wxID_STATIC" - 5105 - "" - "wxStaticLine" - "wxStaticLine" - 1 - 0 - "" - "" - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - 0 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Expand" - "Expand" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - - - "Spacer" - "dialog-control-document" - "" - "spacer" - 0 - 1 - 0 - 0 - "18/10/2006" - "wbSpacerProxy" - 2 - 1 - "Centre" - "Centre" - 1 - 5 - 0 - 0 - 1 - 1 - 0 - 0 - 0 - "<Any platform>" - - - "wxBoxSizer V" - "dialog-control-document" - "" - "sizer" - 0 - 1 - 0 - 0 - "18/10/2006" - "wbBoxSizerProxy" - "Vertical" - "" - "Centre" - "Expand" - 0 - 5 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "<Any platform>" - - "wxStaticText: ID_RICHTEXTLISTSTYLEPAGE_SYMBOLSTATIC" - "dialog-control-document" - "" - "statictext" - 0 - 1 - 0 - 0 - "18/10/2006" - "wbStaticTextProxy" - "wxEVT_UPDATE_UI|OnSymbolstaticUpdate" - "ID_RICHTEXTLISTSTYLEPAGE_SYMBOLSTATIC" - 10621 - "" - "wxStaticText" - "wxStaticText" - 1 - 0 - "" - "" - "" - "&Symbol:" - -1 - "" - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - "" - "" - "" - "" - "" - "" - "" - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Left" - "Centre" - 0 - 5 - 1 - 1 - 1 - 0 - 0 - 1 - 0 - "" - "" - - - "wxBoxSizer H" - "dialog-control-document" - "" - "sizer" - 0 - 1 - 0 - 0 - "18/10/2006" - "wbBoxSizerProxy" - "Horizontal" - "" - "Expand" - "Centre" - 0 - 5 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "<Any platform>" - - "wxComboBox: ID_RICHTEXTLISTSTYLEPAGE_SYMBOLCTRL" - "dialog-control-document" - "" - "combobox" - 0 - 1 - 0 - 0 - "18/10/2006" - "wbComboBoxProxy" - "wxEVT_COMMAND_COMBOBOX_SELECTED|OnSymbolctrlSelected" - "wxEVT_COMMAND_TEXT_UPDATED|OnSymbolctrlUpdated" - "wxEVT_UPDATE_UI|OnSymbolctrlUIUpdate" - "ID_RICHTEXTLISTSTYLEPAGE_SYMBOLCTRL" - 10622 - "" - "wxComboBox" - "wxComboBox" - 1 - 0 - "" - "" - "m_symbolCtrl" - "" - "" - "The bullet character." - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - "" - "" - "" - "" - "" - "" - "" - 0 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - 60 - -1 - "Expand" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 1 - "" - "" - - - "wxButton: ID_RICHTEXTLISTSTYLEPAGE_CHOOSE_SYMBOL" - "dialog-control-document" - "" - "dialogcontrol" - 0 - 1 - 0 - 0 - "18/10/2006" - "wbButtonProxy" - "wxEVT_COMMAND_BUTTON_CLICKED|OnChooseSymbolClick" - "wxEVT_UPDATE_UI|OnChooseSymbolUpdate" - "ID_RICHTEXTLISTSTYLEPAGE_CHOOSE_SYMBOL" - 10623 - "" - "wxButton" - "wxButton" - 1 - 0 - "" - "" - "" - "Ch&oose..." - 0 - "Click to browse for a symbol." - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Centre" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "" - "" - - - - "Spacer" - "dialog-control-document" - "" - "spacer" - 0 - 1 - 0 - 0 - "18/10/2006" - "wbSpacerProxy" - 5 - 5 - "Centre" - "Centre" - 0 - 5 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "<Any platform>" - - - "wxStaticText: ID_RICHTEXTLISTSTYLEPAGE_SYMBOLSTATIC" - "dialog-control-document" - "" - "statictext" - 0 - 1 - 0 - 0 - "18/10/2006" - "wbStaticTextProxy" - "wxEVT_UPDATE_UI|OnSymbolstaticUpdate" - "ID_RICHTEXTLISTSTYLEPAGE_SYMBOLSTATIC" - 10624 - "" - "wxStaticText" - "wxStaticText" - 1 - 0 - "" - "" - "" - "Symbol &font:" - -1 - "" - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - "" - "" - "" - "" - "" - "" - "" - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Left" - "Centre" - 0 - 5 - 1 - 1 - 1 - 0 - 0 - 1 - 0 - "" - "" - - - "wxComboBox: ID_RICHTEXTLISTSTYLEPAGE_SYMBOLFONTCTRL" - "dialog-control-document" - "" - "combobox" - 0 - 1 - 0 - 0 - "20/10/2006" - "wbComboBoxProxy" - "wxEVT_COMMAND_COMBOBOX_SELECTED|OnSymbolfontctrlSelected" - "wxEVT_COMMAND_TEXT_UPDATED|OnSymbolfontctrlUpdated" - "wxEVT_UPDATE_UI|OnSymbolfontctrlUIUpdate" - "ID_RICHTEXTLISTSTYLEPAGE_SYMBOLFONTCTRL" - 10625 - "" - "wxComboBox" - "wxComboBox" - 1 - 0 - "" - "" - "m_symbolFontCtrl" - "" - "" - "" - "Available fonts." - "" - "" - "" - 0 - 1 - "<Any platform>" - "" - "" - "" - "" - "" - "" - "" - 0 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Expand" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "" - "" - - - "Spacer" - "dialog-control-document" - "" - "spacer" - 0 - 1 - 0 - 0 - "20/10/2006" - "wbSpacerProxy" - 5 - 5 - "Centre" - "Centre" - 1 - 5 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "<Any platform>" - - - "wxStaticText: ID_RICHTEXTLISTSTYLEPAGE_NAMESTATIC" - "dialog-control-document" - "" - "statictext" - 0 - 1 - 0 - 0 - "20/10/2006" - "wbStaticTextProxy" - "wxEVT_UPDATE_UI|OnNamestaticUpdate" - "ID_RICHTEXTLISTSTYLEPAGE_NAMESTATIC" - 10600 - "" - "wxStaticText" - "wxStaticText" - 1 - 0 - "" - "" - "" - "S&tandard bullet name:" - -1 - "" - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - "" - "" - "" - "" - "" - "" - "" - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Left" - "Centre" - 0 - 5 - 1 - 1 - 1 - 0 - 0 - 1 - 0 - "" - "" - - - "wxComboBox: ID_RICHTEXTLISTSTYLEPAGE_NAMECTRL" - "dialog-control-document" - "" - "combobox" - 0 - 1 - 0 - 0 - "20/10/2006" - "wbComboBoxProxy" - "wxEVT_COMMAND_COMBOBOX_SELECTED|OnNamectrlSelected" - "wxEVT_COMMAND_TEXT_UPDATED|OnNamectrlUpdated" - "wxEVT_UPDATE_UI|OnNamectrlUIUpdate" - "ID_RICHTEXTLISTSTYLEPAGE_NAMECTRL" - 10601 - "" - "wxComboBox" - "wxComboBox" - 1 - 0 - "" - "" - "m_bulletNameCtrl" - "" - "" - "A standard bullet name." - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - "" - "" - "" - "" - "" - "" - "" - 0 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Expand" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "" - "" - - - - - - - "wxPanel: ID_RICHTEXTLISTSTYLEPAGE_SPACING" - "dialog-control-document" - "" - "panel" - 0 - 1 - 0 - 0 - "18/10/2006" - "wbPanelProxy" - "ID_RICHTEXTLISTSTYLEPAGE_SPACING" - 10628 - "" - "wxPanel" - "wxPanel" - 0 - 0 - "" - "" - "" - "Spacing" - "" - "" - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - "" - "" - "" - "" - "" - "" - "Tiled" - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 1 - 0 - 0 - 0 - "" - 1 - -1 - -1 - -1 - -1 - "Centre" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "" - "" - "" - 0 - - "wxBoxSizer V" - "dialog-control-document" - "" - "sizer" - 0 - 1 - 0 - 0 - "18/10/2006" - "wbBoxSizerProxy" - "Vertical" - "" - "Centre" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "<Any platform>" - - "wxBoxSizer H" - "dialog-control-document" - "" - "sizer" - 0 - 1 - 0 - 0 - "18/10/2006" - "wbBoxSizerProxy" - "Horizontal" - "" - "Expand" - "Centre" - 0 - 5 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "<Any platform>" - - "wxBoxSizer V" - "dialog-control-document" - "" - "sizer" - 0 - 1 - 0 - 0 - "18/10/2006" - "wbBoxSizerProxy" - "Vertical" - "" - "Centre" - "Expand" - 0 - 5 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "<Any platform>" - - "wxStaticText: wxID_STATIC" - "dialog-control-document" - "" - "statictext" - 0 - 1 - 0 - 0 - "18/10/2006" - "wbStaticTextProxy" - "wxID_STATIC" - 5105 - "" - "wxStaticText" - "wxStaticText" - 1 - 0 - "" - "" - "" - "&Alignment" - -1 - "" - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - "" - "" - "" - "" - "" - "" - "" - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Left" - "Centre" - 0 - 5 - 1 - 1 - 1 - 0 - 0 - 1 - 0 - "" - "" - - - "wxBoxSizer H" - "dialog-control-document" - "" - "sizer" - 0 - 1 - 0 - 0 - "18/10/2006" - "wbBoxSizerProxy" - "Horizontal" - "" - "Centre" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "<Any platform>" - - "Spacer" - "dialog-control-document" - "" - "spacer" - 0 - 1 - 0 - 0 - "18/10/2006" - "wbSpacerProxy" - 5 - 5 - "Centre" - "Centre" - 0 - 5 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "<Any platform>" - - - "wxBoxSizer V" - "dialog-control-document" - "" - "sizer" - 0 - 1 - 0 - 0 - "18/10/2006" - "wbBoxSizerProxy" - "Vertical" - "" - "Left" - "Centre" - 0 - 5 - 0 - 0 - 1 - 0 - 0 - 0 - 0 - "<Any platform>" - - "wxRadioButton: ID_RICHTEXTLISTSTYLEPAGE_ALIGNLEFT" - "dialog-control-document" - "" - "radiobutton" - 0 - 1 - 0 - 0 - "18/10/2006" - "wbRadioButtonProxy" - "wxEVT_COMMAND_RADIOBUTTON_SELECTED|OnRichtextliststylepageAlignleftSelected" - "ID_RICHTEXTLISTSTYLEPAGE_ALIGNLEFT" - 10629 - "" - "wxRadioButton" - "wxRadioButton" - 1 - 0 - "" - "" - "m_alignmentLeft" - "&Left" - 0 - "Left-align text." - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - "" - "" - "" - "" - "" - "" - "" - 1 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Left" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "" - "" - - - "wxRadioButton: ID_RICHTEXTLISTSTYLEPAGE_ALIGNRIGHT" - "dialog-control-document" - "" - "radiobutton" - 0 - 1 - 0 - 0 - "18/10/2006" - "wbRadioButtonProxy" - "wxEVT_COMMAND_RADIOBUTTON_SELECTED|OnRichtextliststylepageAlignrightSelected" - "ID_RICHTEXTLISTSTYLEPAGE_ALIGNRIGHT" - 10630 - "" - "wxRadioButton" - "wxRadioButton" - 1 - 0 - "" - "" - "m_alignmentRight" - "&Right" - 0 - "Right-align text." - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - "" - "" - "" - "" - "" - "" - "" - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Left" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "" - "" - - - "wxRadioButton: ID_RICHTEXTLISTSTYLEPAGE_JUSTIFIED" - "dialog-control-document" - "" - "radiobutton" - 0 - 1 - 0 - 0 - "18/10/2006" - "wbRadioButtonProxy" - "wxEVT_COMMAND_RADIOBUTTON_SELECTED|OnRichtextliststylepageJustifiedSelected" - "ID_RICHTEXTLISTSTYLEPAGE_JUSTIFIED" - 10631 - "" - "wxRadioButton" - "wxRadioButton" - 1 - 0 - "" - "" - "m_alignmentJustified" - "&Justified" - 0 - "Justify text left and right." - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - "" - "" - "" - "" - "" - "" - "" - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Left" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "" - "" - - - "wxRadioButton: ID_RICHTEXTLISTSTYLEPAGE_CENTERED" - "dialog-control-document" - "" - "radiobutton" - 0 - 1 - 0 - 0 - "18/10/2006" - "wbRadioButtonProxy" - "wxEVT_COMMAND_RADIOBUTTON_SELECTED|OnRichtextliststylepageCenteredSelected" - "ID_RICHTEXTLISTSTYLEPAGE_CENTERED" - 10632 - "" - "wxRadioButton" - "wxRadioButton" - 1 - 0 - "" - "" - "m_alignmentCentred" - "Cen&tred" - 0 - "Centre text." - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - "" - "" - "" - "" - "" - "" - "" - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Left" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "" - "" - - - "wxRadioButton: ID_RICHTEXTLISTSTYLEPAGE_ALIGNINDETERMINATE" - "dialog-control-document" - "" - "radiobutton" - 0 - 1 - 0 - 0 - "18/10/2006" - "wbRadioButtonProxy" - "wxEVT_COMMAND_RADIOBUTTON_SELECTED|OnRichtextliststylepageAlignindeterminateSelected" - "ID_RICHTEXTLISTSTYLEPAGE_ALIGNINDETERMINATE" - 10633 - "" - "wxRadioButton" - "wxRadioButton" - 1 - 0 - "" - "" - "m_alignmentIndeterminate" - "&Indeterminate" - 0 - "Use the current alignment setting." - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - "" - "" - "" - "" - "" - "" - "" - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Left" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "" - "" - - - - - - "Spacer" - "dialog-control-document" - "" - "spacer" - 0 - 1 - 0 - 0 - "18/10/2006" - "wbSpacerProxy" - 2 - 1 - "Centre" - "Centre" - 1 - 5 - 0 - 0 - 1 - 1 - 0 - 0 - 0 - "<Any platform>" - - - "wxStaticLine: wxID_STATIC" - "dialog-control-document" - "" - "staticline" - 0 - 1 - 0 - 0 - "18/10/2006" - "wbStaticLineProxy" - "wxID_STATIC" - 5105 - "" - "wxStaticLine" - "wxStaticLine" - 1 - 0 - "" - "" - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - 0 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Expand" - "Expand" - 0 - 5 - 1 - 0 - 0 - 1 - 0 - 0 - 0 - - - "Spacer" - "dialog-control-document" - "" - "spacer" - 0 - 1 - 0 - 0 - "18/10/2006" - "wbSpacerProxy" - 2 - 1 - "Centre" - "Centre" - 1 - 5 - 0 - 0 - 1 - 1 - 0 - 0 - 0 - "<Any platform>" - - - "wxBoxSizer V" - "dialog-control-document" - "" - "sizer" - 0 - 1 - 0 - 0 - "18/10/2006" - "wbBoxSizerProxy" - "Vertical" - "" - "Centre" - "Expand" - 0 - 5 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "<Any platform>" - - "wxStaticText: wxID_STATIC" - "dialog-control-document" - "" - "statictext" - 0 - 1 - 0 - 0 - "18/10/2006" - "wbStaticTextProxy" - "wxID_STATIC" - 5105 - "" - "wxStaticText" - "wxStaticText" - 1 - 0 - "" - "" - "" - "&Indentation (tenths of a mm)" - -1 - "" - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - "" - "" - "" - "" - "" - "" - "" - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Left" - "Centre" - 0 - 5 - 1 - 1 - 1 - 0 - 0 - 1 - 0 - "" - "" - - - "wxBoxSizer H" - "dialog-control-document" - "" - "sizer" - 0 - 1 - 0 - 0 - "18/10/2006" - "wbBoxSizerProxy" - "Horizontal" - "" - "Left" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "<Any platform>" - - "Spacer" - "dialog-control-document" - "" - "spacer" - 0 - 1 - 0 - 0 - "18/10/2006" - "wbSpacerProxy" - 5 - 5 - "Centre" - "Centre" - 0 - 5 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "<Any platform>" - - - "wxFlexGridSizer" - "dialog-control-document" - "" - "sizer" - 0 - 1 - 0 - 0 - "18/10/2006" - "wbFlexGridSizerProxy" - "" - "" - 2 - 2 - 0 - 0 - "" - "<Any platform>" - "Centre" - "Centre" - 0 - 5 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - - "wxStaticText: wxID_STATIC" - "dialog-control-document" - "" - "statictext" - 0 - 1 - 0 - 0 - "18/10/2006" - "wbStaticTextProxy" - "wxID_STATIC" - 5105 - "" - "wxStaticText" - "wxStaticText" - 1 - 0 - "" - "" - "" - "&Left:" - -1 - "" - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - "" - "" - "" - "" - "" - "" - "" - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Right" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 1 - 0 - "" - "" - - - "wxBoxSizer H" - "dialog-control-document" - "" - "sizer" - 0 - 1 - 0 - 0 - "18/10/2006" - "wbBoxSizerProxy" - "Horizontal" - "" - "Centre" - "Centre" - 0 - 5 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "<Any platform>" - - "wxTextCtrl: ID_RICHTEXTLISTSTYLEPAGE_INDENTLEFT" - "dialog-control-document" - "" - "textctrl" - 0 - 1 - 0 - 0 - "18/10/2006" - "wbTextCtrlProxy" - "wxEVT_COMMAND_TEXT_UPDATED|OnIndentLeftUpdated" - "ID_RICHTEXTLISTSTYLEPAGE_INDENTLEFT" - 10634 - "" - "wxTextCtrl" - "wxTextCtrl" - 1 - 0 - "" - "" - "m_indentLeft" - "" - 0 - "The left indent." - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - "" - "" - "" - "" - "" - "" - "" - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - 50 - -1 - "Centre" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "" - "" - 0 - - - - "wxStaticText: wxID_STATIC" - "dialog-control-document" - "" - "statictext" - 0 - 1 - 0 - 0 - "18/10/2006" - "wbStaticTextProxy" - "wxID_STATIC" - 5105 - "" - "wxStaticText" - "wxStaticText" - 1 - 0 - "" - "" - "" - "Left (&first line):" - -1 - "" - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - "" - "" - "" - "" - "" - "" - "" - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Right" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 1 - 0 - "" - "" - - - "wxBoxSizer H" - "dialog-control-document" - "" - "sizer" - 0 - 1 - 0 - 0 - "18/10/2006" - "wbBoxSizerProxy" - "Horizontal" - "" - "Centre" - "Centre" - 0 - 5 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "<Any platform>" - - "wxTextCtrl: ID_RICHTEXTLISTSTYLEPAGE_INDENTFIRSTLINE" - "dialog-control-document" - "" - "textctrl" - 0 - 1 - 0 - 0 - "18/10/2006" - "wbTextCtrlProxy" - "wxEVT_COMMAND_TEXT_UPDATED|OnIndentFirstLineUpdated" - "ID_RICHTEXTLISTSTYLEPAGE_INDENTFIRSTLINE" - 10635 - "" - "wxTextCtrl" - "wxTextCtrl" - 1 - 0 - "" - "" - "m_indentLeftFirst" - "" - 0 - "The first line indent." - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - "" - "" - "" - "" - "" - "" - "" - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - 50 - -1 - "Centre" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "" - "" - 0 - - - - "wxStaticText: wxID_STATIC" - "dialog-control-document" - "" - "statictext" - 0 - 1 - 0 - 0 - "18/10/2006" - "wbStaticTextProxy" - "wxID_STATIC" - 5105 - "" - "wxStaticText" - "wxStaticText" - 1 - 0 - "" - "" - "" - "&Right:" - -1 - "" - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - "" - "" - "" - "" - "" - "" - "" - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Right" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 1 - 0 - "" - "" - - - "wxBoxSizer H" - "dialog-control-document" - "" - "sizer" - 0 - 1 - 0 - 0 - "18/10/2006" - "wbBoxSizerProxy" - "Horizontal" - "" - "Centre" - "Centre" - 0 - 5 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "<Any platform>" - - "wxTextCtrl: ID_RICHTEXTLISTSTYLEPAGE_INDENTRIGHT" - "dialog-control-document" - "" - "textctrl" - 0 - 1 - 0 - 0 - "18/10/2006" - "wbTextCtrlProxy" - "wxEVT_COMMAND_TEXT_UPDATED|OnIndentRightUpdated" - "ID_RICHTEXTLISTSTYLEPAGE_INDENTRIGHT" - 10636 - "" - "wxTextCtrl" - "wxTextCtrl" - 1 - 0 - "" - "" - "m_indentRight" - "" - 0 - "The right indent." - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - "" - "" - "" - "" - "" - "" - "" - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - 50 - -1 - "Centre" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "" - "" - 0 - - - - - - - "Spacer" - "dialog-control-document" - "" - "spacer" - 0 - 1 - 0 - 0 - "18/10/2006" - "wbSpacerProxy" - 2 - 1 - "Centre" - "Centre" - 1 - 5 - 0 - 0 - 1 - 1 - 0 - 0 - 0 - "<Any platform>" - - - "wxStaticLine: wxID_STATIC" - "dialog-control-document" - "" - "staticline" - 0 - 1 - 0 - 0 - "18/10/2006" - "wbStaticLineProxy" - "wxID_STATIC" - 5105 - "" - "wxStaticLine" - "wxStaticLine" - 1 - 0 - "" - "" - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - 0 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Expand" - "Expand" - 0 - 5 - 0 - 0 - 1 - 1 - 0 - 0 - 0 - - - "Spacer" - "dialog-control-document" - "" - "spacer" - 0 - 1 - 0 - 0 - "18/10/2006" - "wbSpacerProxy" - 2 - 1 - "Centre" - "Centre" - 1 - 5 - 0 - 0 - 1 - 1 - 0 - 0 - 0 - "<Any platform>" - - - "wxBoxSizer V" - "dialog-control-document" - "" - "sizer" - 0 - 1 - 0 - 0 - "18/10/2006" - "wbBoxSizerProxy" - "Vertical" - "" - "Centre" - "Expand" - 0 - 5 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "<Any platform>" - - "wxStaticText: wxID_STATIC" - "dialog-control-document" - "" - "statictext" - 0 - 1 - 0 - 0 - "18/10/2006" - "wbStaticTextProxy" - "wxID_STATIC" - 5105 - "" - "wxStaticText" - "wxStaticText" - 1 - 0 - "" - "" - "" - "&Spacing (tenths of a mm)" - -1 - "" - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - "" - "" - "" - "" - "" - "" - "" - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Left" - "Centre" - 0 - 5 - 1 - 1 - 1 - 0 - 0 - 1 - 0 - "" - "" - - - "wxBoxSizer H" - "dialog-control-document" - "" - "sizer" - 0 - 1 - 0 - 0 - "18/10/2006" - "wbBoxSizerProxy" - "Horizontal" - "" - "Left" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "<Any platform>" - - "Spacer" - "dialog-control-document" - "" - "spacer" - 0 - 1 - 0 - 0 - "18/10/2006" - "wbSpacerProxy" - 5 - 5 - "Centre" - "Centre" - 0 - 5 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "<Any platform>" - - - "wxFlexGridSizer" - "dialog-control-document" - "" - "sizer" - 0 - 1 - 0 - 0 - "18/10/2006" - "wbFlexGridSizerProxy" - "" - "" - 2 - 2 - 0 - 0 - "" - "<Any platform>" - "Centre" - "Centre" - 0 - 5 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - - "wxStaticText: wxID_STATIC" - "dialog-control-document" - "" - "statictext" - 0 - 1 - 0 - 0 - "18/10/2006" - "wbStaticTextProxy" - "wxID_STATIC" - 5105 - "" - "wxStaticText" - "wxStaticText" - 1 - 0 - "" - "" - "" - "Before a paragraph:" - -1 - "" - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - "" - "" - "" - "" - "" - "" - "" - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Right" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 1 - 0 - "" - "" - - - "wxBoxSizer H" - "dialog-control-document" - "" - "sizer" - 0 - 1 - 0 - 0 - "18/10/2006" - "wbBoxSizerProxy" - "Horizontal" - "" - "Centre" - "Centre" - 0 - 5 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "<Any platform>" - - "wxTextCtrl: ID_RICHTEXTLISTSTYLEPAGE_SPACINGBEFORE" - "dialog-control-document" - "" - "textctrl" - 0 - 1 - 0 - 0 - "18/10/2006" - "wbTextCtrlProxy" - "wxEVT_COMMAND_TEXT_UPDATED|OnSpacingBeforeUpdated" - "ID_RICHTEXTLISTSTYLEPAGE_SPACINGBEFORE" - 10637 - "" - "wxTextCtrl" - "wxTextCtrl" - 1 - 0 - "" - "" - "m_spacingBefore" - "" - 0 - "The spacing before the paragraph." - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - "" - "" - "" - "" - "" - "" - "" - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - 50 - -1 - "Centre" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "" - "" - 0 - - - - "wxStaticText: wxID_STATIC" - "dialog-control-document" - "" - "statictext" - 0 - 1 - 0 - 0 - "18/10/2006" - "wbStaticTextProxy" - "wxID_STATIC" - 5105 - "" - "wxStaticText" - "wxStaticText" - 1 - 0 - "" - "" - "" - "After a paragraph:" - -1 - "" - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - "" - "" - "" - "" - "" - "" - "" - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Right" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 1 - 0 - "" - "" - - - "wxBoxSizer H" - "dialog-control-document" - "" - "sizer" - 0 - 1 - 0 - 0 - "18/10/2006" - "wbBoxSizerProxy" - "Horizontal" - "" - "Centre" - "Centre" - 0 - 5 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "<Any platform>" - - "wxTextCtrl: ID_RICHTEXTLISTSTYLEPAGE_SPACINGAFTER" - "dialog-control-document" - "" - "textctrl" - 0 - 1 - 0 - 0 - "18/10/2006" - "wbTextCtrlProxy" - "wxEVT_COMMAND_TEXT_UPDATED|OnSpacingAfterUpdated" - "ID_RICHTEXTLISTSTYLEPAGE_SPACINGAFTER" - 10638 - "" - "wxTextCtrl" - "wxTextCtrl" - 1 - 0 - "" - "" - "m_spacingAfter" - "" - 0 - "The spacing after the paragraph." - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - "" - "" - "" - "" - "" - "" - "" - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - 50 - -1 - "Centre" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "" - "" - 0 - - - - "wxStaticText: wxID_STATIC" - "dialog-control-document" - "" - "statictext" - 0 - 1 - 0 - 0 - "18/10/2006" - "wbStaticTextProxy" - "wxID_STATIC" - 5105 - "" - "wxStaticText" - "wxStaticText" - 1 - 0 - "" - "" - "" - "Line spacing:" - -1 - "" - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - "" - "" - "" - "" - "" - "" - "" - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Right" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 1 - 0 - "" - "" - - - "wxBoxSizer H" - "dialog-control-document" - "" - "sizer" - 0 - 1 - 0 - 0 - "18/10/2006" - "wbBoxSizerProxy" - "Horizontal" - "" - "Centre" - "Centre" - 0 - 5 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "<Any platform>" - - "wxComboBox: ID_RICHTEXTLISTSTYLEPAGE_LINESPACING" - "dialog-control-document" - "" - "combobox" - 0 - 1 - 0 - 0 - "18/10/2006" - "wbComboBoxProxy" - "wxEVT_COMMAND_COMBOBOX_SELECTED|OnLineSpacingSelected" - "ID_RICHTEXTLISTSTYLEPAGE_LINESPACING" - 10639 - "" - "wxComboBox" - "wxComboBox" - 1 - 0 - "" - "" - "m_spacingLine" - "Single|1.5|2" - "Single" - "The line spacing." - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - "" - "" - "" - "" - "" - "" - "" - 0 - 0 - 1 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Centre" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "" - "" - - - - - - - - - - - "wxRichTextCtrl: ID_RICHTEXTLISTSTYLEPAGE_RICHTEXTCTRL" - "dialog-control-document" - "" - "foreign" - 0 - 1 - 0 - 0 - "18/10/2006" - "wbForeignCtrlProxy" - "ID_RICHTEXTLISTSTYLEPAGE_RICHTEXTCTRL" - 10640 - "" - "wxRichTextCtrl" - "wxWindow" - 1 - 0 - "" - "" - "m_previewCtrl" - 1 - "Shows a preview of the bullet settings." - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - "" - "" - "" - "" - "" - "" - "" - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 1 - 0 - "wxTE_READONLY" - -1 - -1 - 350 - 100 - "Expand" - "Centre" - 1 - 5 - 1 - 1 - 0 - 1 - 0 - 0 - 0 - "%PARENT%, %ID%, wxEmptyString, %POSITION%, %SIZE%, %STYLE%" - "" - "" - - - - - - - "Sources" - "html-document" - "" - "sourcesfolder" - 1 - 1 - 0 - 1 - - - "Images" - "html-document" - "" - "bitmapsfolder" - 1 - 1 - 0 - 1 - - - "Resources" - "html-document" - "" - "bitmapsfolder" - 1 - 1 - 0 - 1 - - - - -
diff --git a/wxWidgets/src/richtext/richtextfontpage.cpp b/wxWidgets/src/richtext/richtextfontpage.cpp deleted file mode 100644 index 2a05cbae5e..0000000000 --- a/wxWidgets/src/richtext/richtextfontpage.cpp +++ /dev/null @@ -1,862 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/richtext/richeditfontpage.cpp -// Purpose: Font page for wxRichTextFormattingDialog -// Author: Julian Smart -// Modified by: -// Created: 2006-10-02 -// RCS-ID: $Id: richtextfontpage.cpp 62052 2009-09-24 07:36:00Z JS $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#include "wx/richtext/richtextfontpage.h" - -/*! - * wxRichTextFontPage type definition - */ - -IMPLEMENT_DYNAMIC_CLASS( wxRichTextFontPage, wxPanel ) - -/*! - * wxRichTextFontPage event table definition - */ - -BEGIN_EVENT_TABLE( wxRichTextFontPage, wxPanel ) - EVT_LISTBOX( ID_RICHTEXTFONTPAGE_FACELISTBOX, wxRichTextFontPage::OnFaceListBoxSelected ) - EVT_BUTTON( ID_RICHTEXTFONTPAGE_COLOURCTRL, wxRichTextFontPage::OnColourClicked ) - EVT_BUTTON( ID_RICHTEXTFONTPAGE_BGCOLOURCTRL, wxRichTextFontPage::OnColourClicked ) - -////@begin wxRichTextFontPage event table entries - EVT_TEXT( ID_RICHTEXTFONTPAGE_FACETEXTCTRL, wxRichTextFontPage::OnFaceTextCtrlUpdated ) - - EVT_TEXT( ID_RICHTEXTFONTPAGE_SIZETEXTCTRL, wxRichTextFontPage::OnSizeTextCtrlUpdated ) - - EVT_LISTBOX( ID_RICHTEXTFONTPAGE_SIZELISTBOX, wxRichTextFontPage::OnSizeListBoxSelected ) - - EVT_COMBOBOX( ID_RICHTEXTFONTPAGE_STYLECTRL, wxRichTextFontPage::OnStyleCtrlSelected ) - - EVT_COMBOBOX( ID_RICHTEXTFONTPAGE_WEIGHTCTRL, wxRichTextFontPage::OnWeightCtrlSelected ) - - EVT_COMBOBOX( ID_RICHTEXTFONTPAGE_UNDERLINING_CTRL, wxRichTextFontPage::OnUnderliningCtrlSelected ) - - EVT_CHECKBOX( ID_RICHTEXTFONTPAGE_STRIKETHROUGHCTRL, wxRichTextFontPage::OnStrikethroughctrlClick ) - - EVT_CHECKBOX( ID_RICHTEXTFONTPAGE_CAPSCTRL, wxRichTextFontPage::OnCapsctrlClick ) - - EVT_CHECKBOX( ID_RICHTEXTFONTPAGE_SUPERSCRIPT, wxRichTextFontPage::OnRichtextfontpageSuperscriptClick ) - - EVT_CHECKBOX( ID_RICHTEXTFONTPAGE_SUBSCRIPT, wxRichTextFontPage::OnRichtextfontpageSubscriptClick ) - -////@end wxRichTextFontPage event table entries - -END_EVENT_TABLE() - -/*! - * wxRichTextFontPage constructors - */ - -wxRichTextFontPage::wxRichTextFontPage( ) -{ - Init(); -} - -wxRichTextFontPage::wxRichTextFontPage( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style ) -{ - Init(); - Create(parent, id, pos, size, style); -} - -/*! - * Initialise members - */ - -void wxRichTextFontPage::Init() -{ - m_dontUpdate = false; - m_colourPresent = false; - m_bgColourPresent = false; - -////@begin wxRichTextFontPage member initialisation - m_faceTextCtrl = NULL; - m_faceListBox = NULL; - m_sizeTextCtrl = NULL; - m_sizeListBox = NULL; - m_styleCtrl = NULL; - m_weightCtrl = NULL; - m_underliningCtrl = NULL; - m_colourCtrl = NULL; - m_bgColourCtrl = NULL; - m_strikethroughCtrl = NULL; - m_capitalsCtrl = NULL; - m_superscriptCtrl = NULL; - m_subscriptCtrl = NULL; - m_previewCtrl = NULL; -////@end wxRichTextFontPage member initialisation -} - -/*! - * wxRichTextFontPage creator - */ - -bool wxRichTextFontPage::Create( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style ) -{ -////@begin wxRichTextFontPage creation - wxPanel::Create( parent, id, pos, size, style ); - - CreateControls(); - if (GetSizer()) - { - GetSizer()->SetSizeHints(this); - } - Centre(); -////@end wxRichTextFontPage creation - return true; -} - -/*! - * Control creation for wxRichTextFontPage - */ - -void wxRichTextFontPage::CreateControls() -{ -////@begin wxRichTextFontPage content construction - wxRichTextFontPage* itemPanel1 = this; - - wxBoxSizer* itemBoxSizer2 = new wxBoxSizer(wxVERTICAL); - itemPanel1->SetSizer(itemBoxSizer2); - - wxBoxSizer* itemBoxSizer3 = new wxBoxSizer(wxVERTICAL); - itemBoxSizer2->Add(itemBoxSizer3, 1, wxGROW|wxALL, 5); - - wxBoxSizer* itemBoxSizer4 = new wxBoxSizer(wxHORIZONTAL); - itemBoxSizer3->Add(itemBoxSizer4, 1, wxGROW, 5); - - wxBoxSizer* itemBoxSizer5 = new wxBoxSizer(wxVERTICAL); - itemBoxSizer4->Add(itemBoxSizer5, 1, wxGROW, 5); - - wxStaticText* itemStaticText6 = new wxStaticText( itemPanel1, wxID_STATIC, _("&Font:"), wxDefaultPosition, wxDefaultSize, 0 ); - itemBoxSizer5->Add(itemStaticText6, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP|wxADJUST_MINSIZE, 5); - - m_faceTextCtrl = new wxTextCtrl( itemPanel1, ID_RICHTEXTFONTPAGE_FACETEXTCTRL, _T(""), wxDefaultPosition, wxDefaultSize, 0 ); - m_faceTextCtrl->SetHelpText(_("Type a font name.")); - if (wxRichTextFontPage::ShowToolTips()) - m_faceTextCtrl->SetToolTip(_("Type a font name.")); - itemBoxSizer5->Add(m_faceTextCtrl, 0, wxGROW|wxLEFT|wxRIGHT|wxTOP, 5); - - m_faceListBox = new wxRichTextFontListBox( itemPanel1, ID_RICHTEXTFONTPAGE_FACELISTBOX, wxDefaultPosition, wxSize(200, 100), 0 ); - m_faceListBox->SetHelpText(_("Lists the available fonts.")); - if (wxRichTextFontPage::ShowToolTips()) - m_faceListBox->SetToolTip(_("Lists the available fonts.")); - itemBoxSizer5->Add(m_faceListBox, 1, wxGROW|wxALL|wxFIXED_MINSIZE, 5); - - wxBoxSizer* itemBoxSizer9 = new wxBoxSizer(wxVERTICAL); - itemBoxSizer4->Add(itemBoxSizer9, 0, wxGROW, 5); - - wxStaticText* itemStaticText10 = new wxStaticText( itemPanel1, wxID_STATIC, _("&Size:"), wxDefaultPosition, wxDefaultSize, 0 ); - itemBoxSizer9->Add(itemStaticText10, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP|wxADJUST_MINSIZE, 5); - - m_sizeTextCtrl = new wxTextCtrl( itemPanel1, ID_RICHTEXTFONTPAGE_SIZETEXTCTRL, _T(""), wxDefaultPosition, wxSize(50, -1), 0 ); - m_sizeTextCtrl->SetHelpText(_("Type a size in points.")); - if (wxRichTextFontPage::ShowToolTips()) - m_sizeTextCtrl->SetToolTip(_("Type a size in points.")); - itemBoxSizer9->Add(m_sizeTextCtrl, 0, wxGROW|wxLEFT|wxRIGHT|wxTOP, 5); - - wxArrayString m_sizeListBoxStrings; - m_sizeListBox = new wxListBox( itemPanel1, ID_RICHTEXTFONTPAGE_SIZELISTBOX, wxDefaultPosition, wxSize(50, -1), m_sizeListBoxStrings, wxLB_SINGLE ); - m_sizeListBox->SetHelpText(_("Lists font sizes in points.")); - if (wxRichTextFontPage::ShowToolTips()) - m_sizeListBox->SetToolTip(_("Lists font sizes in points.")); - itemBoxSizer9->Add(m_sizeListBox, 1, wxALIGN_CENTER_HORIZONTAL|wxALL|wxFIXED_MINSIZE, 5); - - wxBoxSizer* itemBoxSizer13 = new wxBoxSizer(wxHORIZONTAL); - itemBoxSizer3->Add(itemBoxSizer13, 0, wxGROW, 5); - - wxBoxSizer* itemBoxSizer14 = new wxBoxSizer(wxVERTICAL); - itemBoxSizer13->Add(itemBoxSizer14, 0, wxGROW, 5); - - wxStaticText* itemStaticText15 = new wxStaticText( itemPanel1, wxID_STATIC, _("Font st&yle:"), wxDefaultPosition, wxDefaultSize, 0 ); - itemBoxSizer14->Add(itemStaticText15, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP|wxADJUST_MINSIZE, 5); - - wxArrayString m_styleCtrlStrings; - m_styleCtrl = new wxComboBox( itemPanel1, ID_RICHTEXTFONTPAGE_STYLECTRL, _T(""), wxDefaultPosition, wxSize(110, -1), m_styleCtrlStrings, wxCB_READONLY ); - m_styleCtrl->SetHelpText(_("Select regular or italic style.")); - if (wxRichTextFontPage::ShowToolTips()) - m_styleCtrl->SetToolTip(_("Select regular or italic style.")); - itemBoxSizer14->Add(m_styleCtrl, 0, wxGROW|wxALL, 5); - - wxBoxSizer* itemBoxSizer17 = new wxBoxSizer(wxVERTICAL); - itemBoxSizer13->Add(itemBoxSizer17, 0, wxGROW, 5); - - wxStaticText* itemStaticText18 = new wxStaticText( itemPanel1, wxID_STATIC, _("Font &weight:"), wxDefaultPosition, wxDefaultSize, 0 ); - itemBoxSizer17->Add(itemStaticText18, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP|wxADJUST_MINSIZE, 5); - - wxArrayString m_weightCtrlStrings; - m_weightCtrl = new wxComboBox( itemPanel1, ID_RICHTEXTFONTPAGE_WEIGHTCTRL, _T(""), wxDefaultPosition, wxSize(110, -1), m_weightCtrlStrings, wxCB_READONLY ); - m_weightCtrl->SetHelpText(_("Select regular or bold.")); - if (wxRichTextFontPage::ShowToolTips()) - m_weightCtrl->SetToolTip(_("Select regular or bold.")); - itemBoxSizer17->Add(m_weightCtrl, 0, wxGROW|wxALL, 5); - - wxBoxSizer* itemBoxSizer20 = new wxBoxSizer(wxVERTICAL); - itemBoxSizer13->Add(itemBoxSizer20, 0, wxGROW, 5); - - wxStaticText* itemStaticText21 = new wxStaticText( itemPanel1, wxID_STATIC, _("&Underlining:"), wxDefaultPosition, wxDefaultSize, 0 ); - itemBoxSizer20->Add(itemStaticText21, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP|wxADJUST_MINSIZE, 5); - - wxArrayString m_underliningCtrlStrings; - m_underliningCtrl = new wxComboBox( itemPanel1, ID_RICHTEXTFONTPAGE_UNDERLINING_CTRL, _T(""), wxDefaultPosition, wxSize(110, -1), m_underliningCtrlStrings, wxCB_READONLY ); - m_underliningCtrl->SetHelpText(_("Select underlining or no underlining.")); - if (wxRichTextFontPage::ShowToolTips()) - m_underliningCtrl->SetToolTip(_("Select underlining or no underlining.")); - itemBoxSizer20->Add(m_underliningCtrl, 0, wxGROW|wxALL, 5); - - itemBoxSizer13->Add(0, 0, 1, wxALIGN_CENTER_VERTICAL, 5); - - wxBoxSizer* itemBoxSizer24 = new wxBoxSizer(wxVERTICAL); - itemBoxSizer13->Add(itemBoxSizer24, 0, wxGROW, 5); - - wxStaticText* itemStaticText25 = new wxStaticText( itemPanel1, wxID_STATIC, _("&Colour:"), wxDefaultPosition, wxDefaultSize, 0 ); - itemBoxSizer24->Add(itemStaticText25, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP|wxADJUST_MINSIZE, 5); - - m_colourCtrl = new wxRichTextColourSwatchCtrl( itemPanel1, ID_RICHTEXTFONTPAGE_COLOURCTRL, wxDefaultPosition, wxSize(40, 20), 0 ); - m_colourCtrl->SetHelpText(_("Click to change the text colour.")); - if (wxRichTextFontPage::ShowToolTips()) - m_colourCtrl->SetToolTip(_("Click to change the text colour.")); - itemBoxSizer24->Add(m_colourCtrl, 0, wxGROW|wxALL, 5); - - wxBoxSizer* itemBoxSizer27 = new wxBoxSizer(wxVERTICAL); - itemBoxSizer13->Add(itemBoxSizer27, 0, wxGROW, 5); - - wxStaticText* itemStaticText28 = new wxStaticText( itemPanel1, wxID_STATIC, _("&Bg colour:"), wxDefaultPosition, wxDefaultSize, 0 ); - itemBoxSizer27->Add(itemStaticText28, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP|wxADJUST_MINSIZE, 5); - - m_bgColourCtrl = new wxRichTextColourSwatchCtrl( itemPanel1, ID_RICHTEXTFONTPAGE_BGCOLOURCTRL, wxDefaultPosition, wxSize(40, 20), 0 ); - m_bgColourCtrl->SetHelpText(_("Click to change the text background colour.")); - if (wxRichTextFontPage::ShowToolTips()) - m_bgColourCtrl->SetToolTip(_("Click to change the text background colour.")); - itemBoxSizer27->Add(m_bgColourCtrl, 0, wxGROW|wxALL, 5); - - wxBoxSizer* itemBoxSizer30 = new wxBoxSizer(wxHORIZONTAL); - itemBoxSizer3->Add(itemBoxSizer30, 0, wxGROW, 5); - - m_strikethroughCtrl = new wxCheckBox( itemPanel1, ID_RICHTEXTFONTPAGE_STRIKETHROUGHCTRL, _("&Strikethrough"), wxDefaultPosition, wxDefaultSize, wxCHK_3STATE ); - m_strikethroughCtrl->SetValue(false); - m_strikethroughCtrl->SetHelpText(_("Check to show a line through the text.")); - if (wxRichTextFontPage::ShowToolTips()) - m_strikethroughCtrl->SetToolTip(_("Check to show a line through the text.")); - itemBoxSizer30->Add(m_strikethroughCtrl, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); - - m_capitalsCtrl = new wxCheckBox( itemPanel1, ID_RICHTEXTFONTPAGE_CAPSCTRL, _("Ca&pitals"), wxDefaultPosition, wxDefaultSize, wxCHK_3STATE ); - m_capitalsCtrl->SetValue(false); - m_capitalsCtrl->SetHelpText(_("Check to show the text in capitals.")); - if (wxRichTextFontPage::ShowToolTips()) - m_capitalsCtrl->SetToolTip(_("Check to show the text in capitals.")); - itemBoxSizer30->Add(m_capitalsCtrl, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); - - m_superscriptCtrl = new wxCheckBox( itemPanel1, ID_RICHTEXTFONTPAGE_SUPERSCRIPT, _("Supe&rscript"), wxDefaultPosition, wxDefaultSize, wxCHK_3STATE ); - m_superscriptCtrl->SetValue(false); - m_superscriptCtrl->SetHelpText(_("Check to show the text in superscript.")); - if (wxRichTextFontPage::ShowToolTips()) - m_superscriptCtrl->SetToolTip(_("Check to show the text in superscript.")); - itemBoxSizer30->Add(m_superscriptCtrl, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); - - m_subscriptCtrl = new wxCheckBox( itemPanel1, ID_RICHTEXTFONTPAGE_SUBSCRIPT, _("Subscrip&t"), wxDefaultPosition, wxDefaultSize, wxCHK_3STATE ); - m_subscriptCtrl->SetValue(false); - m_subscriptCtrl->SetHelpText(_("Check to show the text in subscript.")); - if (wxRichTextFontPage::ShowToolTips()) - m_subscriptCtrl->SetToolTip(_("Check to show the text in subscript.")); - itemBoxSizer30->Add(m_subscriptCtrl, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); - - itemBoxSizer3->Add(5, 5, 0, wxALIGN_CENTER_HORIZONTAL, 5); - - m_previewCtrl = new wxRichTextFontPreviewCtrl( itemPanel1, ID_RICHTEXTFONTPAGE_PREVIEWCTRL, wxDefaultPosition, wxSize(100, 60), 0 ); - m_previewCtrl->SetHelpText(_("Shows a preview of the font settings.")); - if (wxRichTextFontPage::ShowToolTips()) - m_previewCtrl->SetToolTip(_("Shows a preview of the font settings.")); - itemBoxSizer3->Add(m_previewCtrl, 0, wxGROW|wxALL, 5); - -////@end wxRichTextFontPage content construction - - m_faceListBox->UpdateFonts(); - - m_styleCtrl->Append(_("Regular")); - m_styleCtrl->Append(_("Italic")); - - m_weightCtrl->Append(_("Regular")); - m_weightCtrl->Append(_("Bold")); - - m_underliningCtrl->Append(_("Not underlined")); - m_underliningCtrl->Append(_("Underlined")); - - wxString nStr; - int i; - for (i = 8; i < 40; i++) - { - nStr.Printf(wxT("%d"), i); - m_sizeListBox->Append(nStr); - } - m_sizeListBox->Append(wxT("48")); - m_sizeListBox->Append(wxT("72")); -} - -/// Transfer data from/to window -bool wxRichTextFontPage::TransferDataFromWindow() -{ - wxPanel::TransferDataFromWindow(); - - wxTextAttrEx* attr = GetAttributes(); - - if (m_faceListBox->GetSelection() != wxNOT_FOUND) - { - wxString faceName = m_faceListBox->GetFaceName(m_faceListBox->GetSelection()); - if (!faceName.IsEmpty()) - { - wxFont font(attr->GetFont().Ok() ? attr->GetFont() : *wxNORMAL_FONT); - font.SetFaceName(faceName); - wxSetFontPreservingStyles(*attr, font); - attr->SetFlags(attr->GetFlags() | wxTEXT_ATTR_FONT_FACE); - } - } - else - attr->SetFlags(attr->GetFlags() & (~ wxTEXT_ATTR_FONT_FACE)); - - wxString strSize = m_sizeTextCtrl->GetValue(); - if (!strSize.IsEmpty()) - { - int sz = wxAtoi(strSize); - if (sz > 0) - { - wxFont font(attr->GetFont().Ok() ? attr->GetFont() : *wxNORMAL_FONT); - font.SetPointSize(sz); - wxSetFontPreservingStyles(*attr, font); - attr->SetFlags(attr->GetFlags() | wxTEXT_ATTR_FONT_SIZE); - } - } - else - attr->SetFlags(attr->GetFlags() & (~ wxTEXT_ATTR_FONT_SIZE)); - - if (m_styleCtrl->GetSelection() != wxNOT_FOUND) - { - int style; - if (m_styleCtrl->GetStringSelection() == _("Italic")) - style = wxITALIC; - else - style = wxNORMAL; - - wxFont font(attr->GetFont().Ok() ? attr->GetFont() : *wxNORMAL_FONT); - font.SetStyle(style); - wxSetFontPreservingStyles(*attr, font); - attr->SetFlags(attr->GetFlags() | wxTEXT_ATTR_FONT_ITALIC); - } - else - attr->SetFlags(attr->GetFlags() & (~ wxTEXT_ATTR_FONT_ITALIC)); - - if (m_weightCtrl->GetSelection() != wxNOT_FOUND) - { - int weight; - if (m_weightCtrl->GetStringSelection() == _("Bold")) - weight = wxBOLD; - else - weight = wxNORMAL; - - wxFont font(attr->GetFont().Ok() ? attr->GetFont() : *wxNORMAL_FONT); - font.SetWeight(weight); - wxSetFontPreservingStyles(*attr, font); - attr->SetFlags(attr->GetFlags() | wxTEXT_ATTR_FONT_WEIGHT); - } - else - attr->SetFlags(attr->GetFlags() & (~ wxTEXT_ATTR_FONT_WEIGHT)); - - if (m_underliningCtrl->GetSelection() != wxNOT_FOUND) - { - bool underlined; - if (m_underliningCtrl->GetStringSelection() == _("Underlined")) - underlined = true; - else - underlined = false; - - wxFont font(attr->GetFont().Ok() ? attr->GetFont() : *wxNORMAL_FONT); - font.SetUnderlined(underlined); - wxSetFontPreservingStyles(*attr, font); - attr->SetFlags(attr->GetFlags() | wxTEXT_ATTR_FONT_UNDERLINE); - } - else - attr->SetFlags(attr->GetFlags() & (~ wxTEXT_ATTR_FONT_UNDERLINE)); - - if (m_colourPresent) - { - attr->SetTextColour(m_colourCtrl->GetBackgroundColour()); - } - else - attr->SetFlags(attr->GetFlags() & (~ wxTEXT_ATTR_TEXT_COLOUR)); - - if (m_bgColourPresent) - { - attr->SetBackgroundColour(m_bgColourCtrl->GetBackgroundColour()); - } - else - attr->SetFlags(attr->GetFlags() & (~ wxTEXT_ATTR_BACKGROUND_COLOUR)); - - if (m_strikethroughCtrl->Get3StateValue() != wxCHK_UNDETERMINED) - { - attr->SetTextEffectFlags(attr->GetTextEffectFlags() | wxTEXT_ATTR_EFFECT_STRIKETHROUGH); - - if (m_strikethroughCtrl->Get3StateValue() == wxCHK_CHECKED) - attr->SetTextEffects(attr->GetTextEffects() | wxTEXT_ATTR_EFFECT_STRIKETHROUGH); - else - attr->SetTextEffects(attr->GetTextEffects() & ~wxTEXT_ATTR_EFFECT_STRIKETHROUGH); - } - - if (m_capitalsCtrl->Get3StateValue() != wxCHK_UNDETERMINED) - { - attr->SetTextEffectFlags(attr->GetTextEffectFlags() | wxTEXT_ATTR_EFFECT_CAPITALS); - - if (m_capitalsCtrl->Get3StateValue() == wxCHK_CHECKED) - attr->SetTextEffects(attr->GetTextEffects() | wxTEXT_ATTR_EFFECT_CAPITALS); - else - attr->SetTextEffects(attr->GetTextEffects() & ~wxTEXT_ATTR_EFFECT_CAPITALS); - } - - if (m_superscriptCtrl->Get3StateValue() == wxCHK_CHECKED) - { - attr->SetTextEffectFlags(attr->GetTextEffectFlags() | wxTEXT_ATTR_EFFECT_SUPERSCRIPT); - attr->SetTextEffects(attr->GetTextEffects() | wxTEXT_ATTR_EFFECT_SUPERSCRIPT); - attr->SetTextEffects(attr->GetTextEffects() & ~wxTEXT_ATTR_EFFECT_SUBSCRIPT); - } - else if (m_subscriptCtrl->Get3StateValue() == wxCHK_CHECKED) - { - attr->SetTextEffectFlags(attr->GetTextEffectFlags() | wxTEXT_ATTR_EFFECT_SUBSCRIPT); - attr->SetTextEffects(attr->GetTextEffects() | wxTEXT_ATTR_EFFECT_SUBSCRIPT); - attr->SetTextEffects(attr->GetTextEffects() & ~wxTEXT_ATTR_EFFECT_SUPERSCRIPT); - } - else - { - // If they are undetermined, we don't want to include these flags in the text effects - the objects - // should retain their original style. - attr->SetTextEffectFlags(attr->GetTextEffectFlags() & ~(wxTEXT_ATTR_EFFECT_SUBSCRIPT|wxTEXT_ATTR_EFFECT_SUPERSCRIPT) ); - } - - return true; -} - -bool wxRichTextFontPage::TransferDataToWindow() -{ - wxPanel::TransferDataToWindow(); - - m_dontUpdate = true; - wxTextAttrEx* attr = GetAttributes(); - - if (attr->HasFont() && attr->HasFontFaceName()) - { - m_faceTextCtrl->SetValue(attr->GetFont().GetFaceName()); - m_faceListBox->SetFaceNameSelection(attr->GetFont().GetFaceName()); - } - else - { - m_faceTextCtrl->SetValue(wxEmptyString); - m_faceListBox->SetFaceNameSelection(wxEmptyString); - } - - if (attr->HasFont() && attr->HasFontSize()) - { - wxString strSize = wxString::Format(wxT("%d"), attr->GetFont().GetPointSize()); - m_sizeTextCtrl->SetValue(strSize); - if (m_sizeListBox->FindString(strSize) != wxNOT_FOUND) - m_sizeListBox->SetStringSelection(strSize); - } - else - { - m_sizeTextCtrl->SetValue(wxEmptyString); - m_sizeListBox->SetSelection(wxNOT_FOUND); - } - - if (attr->HasFont() && attr->HasFontWeight()) - { - if (attr->GetFont().GetWeight() == wxBOLD) - m_weightCtrl->SetSelection(1); - else - m_weightCtrl->SetSelection(0); - } - else - { - m_weightCtrl->SetSelection(wxNOT_FOUND); - } - - if (attr->HasFont() && attr->HasFontItalic()) - { - if (attr->GetFont().GetStyle() == wxITALIC) - m_styleCtrl->SetSelection(1); - else - m_styleCtrl->SetSelection(0); - } - else - { - m_styleCtrl->SetSelection(wxNOT_FOUND); - } - - if (attr->HasFont() && attr->HasFontUnderlined()) - { - if (attr->GetFont().GetUnderlined()) - m_underliningCtrl->SetSelection(1); - else - m_underliningCtrl->SetSelection(0); - } - else - { - m_underliningCtrl->SetSelection(wxNOT_FOUND); - } - - if (attr->HasTextColour()) - { - m_colourCtrl->SetColour(attr->GetTextColour()); - m_colourPresent = true; - } - - if (attr->HasBackgroundColour()) - { - m_bgColourCtrl->SetColour(attr->GetBackgroundColour()); - m_bgColourPresent = true; - } - - if (attr->HasTextEffects()) - { - if (attr->GetTextEffectFlags() & wxTEXT_ATTR_EFFECT_STRIKETHROUGH) - { - if (attr->GetTextEffects() & wxTEXT_ATTR_EFFECT_STRIKETHROUGH) - m_strikethroughCtrl->Set3StateValue(wxCHK_CHECKED); - else - m_strikethroughCtrl->Set3StateValue(wxCHK_UNCHECKED); - } - else - m_strikethroughCtrl->Set3StateValue(wxCHK_UNDETERMINED); - - if (attr->GetTextEffectFlags() & wxTEXT_ATTR_EFFECT_CAPITALS) - { - if (attr->GetTextEffects() & wxTEXT_ATTR_EFFECT_CAPITALS) - m_capitalsCtrl->Set3StateValue(wxCHK_CHECKED); - else - m_capitalsCtrl->Set3StateValue(wxCHK_UNCHECKED); - } - else - m_capitalsCtrl->Set3StateValue(wxCHK_UNDETERMINED); - - if ( attr->GetTextEffectFlags() & (wxTEXT_ATTR_EFFECT_SUPERSCRIPT | wxTEXT_ATTR_EFFECT_SUBSCRIPT) ) - { - if (attr->GetTextEffects() & wxTEXT_ATTR_EFFECT_SUPERSCRIPT) - { - m_superscriptCtrl->Set3StateValue(wxCHK_CHECKED); - m_subscriptCtrl->Set3StateValue(wxCHK_UNCHECKED); - } - else if (attr->GetTextEffects() & wxTEXT_ATTR_EFFECT_SUBSCRIPT) - { - m_superscriptCtrl->Set3StateValue(wxCHK_UNCHECKED); - m_subscriptCtrl->Set3StateValue(wxCHK_CHECKED); - } - else - { - m_superscriptCtrl->Set3StateValue(wxCHK_UNCHECKED); - m_subscriptCtrl->Set3StateValue(wxCHK_UNCHECKED); - } - } - else - { - m_superscriptCtrl->Set3StateValue(wxCHK_UNDETERMINED); - m_subscriptCtrl->Set3StateValue(wxCHK_UNDETERMINED); - } - } - else - { - m_strikethroughCtrl->Set3StateValue(wxCHK_UNDETERMINED); - m_capitalsCtrl->Set3StateValue(wxCHK_UNDETERMINED); - m_superscriptCtrl->Set3StateValue(wxCHK_UNDETERMINED); - m_subscriptCtrl->Set3StateValue(wxCHK_UNDETERMINED); - } - - UpdatePreview(); - - m_dontUpdate = false; - - return true; -} - -wxTextAttrEx* wxRichTextFontPage::GetAttributes() -{ - return wxRichTextFormattingDialog::GetDialogAttributes(this); -} - -/// Updates the font preview -void wxRichTextFontPage::UpdatePreview() -{ - wxRichTextAttr attr; - - if (m_colourPresent) - m_previewCtrl->SetForegroundColour(m_colourCtrl->GetColour()); - - if (m_bgColourPresent) - m_previewCtrl->SetBackgroundColour(m_bgColourCtrl->GetColour()); - - if (m_faceListBox->GetSelection() != wxNOT_FOUND) - { - wxString faceName = m_faceListBox->GetFaceName(m_faceListBox->GetSelection()); - attr.SetFontFaceName(faceName); - } - - wxString strSize = m_sizeTextCtrl->GetValue(); - if (!strSize.IsEmpty()) - { - int sz = wxAtoi(strSize); - if (sz > 0) - attr.SetFontSize(sz); - } - - if (m_styleCtrl->GetSelection() != wxNOT_FOUND) - { - int style; - if (m_styleCtrl->GetStringSelection() == _("Italic")) - style = wxITALIC; - else - style = wxNORMAL; - - attr.SetFontStyle(style); - } - - if (m_weightCtrl->GetSelection() != wxNOT_FOUND) - { - int weight; - if (m_weightCtrl->GetStringSelection() == _("Bold")) - weight = wxBOLD; - else - weight = wxNORMAL; - - attr.SetFontWeight(weight); - } - - if (m_underliningCtrl->GetSelection() != wxNOT_FOUND) - { - bool underlined; - if (m_underliningCtrl->GetStringSelection() == _("Underlined")) - underlined = true; - else - underlined = false; - - attr.SetFontUnderlined(underlined); - } - - int textEffects = 0; - - if (m_strikethroughCtrl->Get3StateValue() == wxCHK_CHECKED) - { - textEffects |= wxTEXT_ATTR_EFFECT_STRIKETHROUGH; - } - - if (m_capitalsCtrl->Get3StateValue() == wxCHK_CHECKED) - { - textEffects |= wxTEXT_ATTR_EFFECT_CAPITALS; - } - - if ( m_superscriptCtrl->Get3StateValue() == wxCHK_CHECKED ) - textEffects |= wxTEXT_ATTR_EFFECT_SUPERSCRIPT; - else if ( m_subscriptCtrl->Get3StateValue() == wxCHK_CHECKED ) - textEffects |= wxTEXT_ATTR_EFFECT_SUBSCRIPT; - - wxFont font = attr.CreateFont(); - m_previewCtrl->SetFont(font); - m_previewCtrl->SetTextEffects(textEffects); - m_previewCtrl->Refresh(); -} - -/*! - * Should we show tooltips? - */ - -bool wxRichTextFontPage::ShowToolTips() -{ - return wxRichTextFormattingDialog::ShowToolTips(); -} - -/*! - * Get bitmap resources - */ - -wxBitmap wxRichTextFontPage::GetBitmapResource( const wxString& name ) -{ - // Bitmap retrieval -////@begin wxRichTextFontPage bitmap retrieval - wxUnusedVar(name); - return wxNullBitmap; -////@end wxRichTextFontPage bitmap retrieval -} - -/*! - * Get icon resources - */ - -wxIcon wxRichTextFontPage::GetIconResource( const wxString& name ) -{ - // Icon retrieval -////@begin wxRichTextFontPage icon retrieval - wxUnusedVar(name); - return wxNullIcon; -////@end wxRichTextFontPage icon retrieval -} - -/*! - * wxEVT_COMMAND_TEXT_UPDATED event handler for ID_RICHTEXTFONTPAGE_FACETEXTCTRL - */ - -void wxRichTextFontPage::OnFaceTextCtrlUpdated( wxCommandEvent& WXUNUSED(event) ) -{ - if (m_dontUpdate) - return; - - wxString facename = m_faceTextCtrl->GetValue(); - if (!facename.IsEmpty()) - { - if (m_faceListBox->HasFaceName(facename)) - { - m_faceListBox->SetFaceNameSelection(facename); - UpdatePreview(); - } - else - { - // Try to find a partial match - const wxArrayString& arr = m_faceListBox->GetFaceNames(); - size_t i; - for (i = 0; i < arr.GetCount(); i++) - { - if (arr[i].Mid(0, facename.Length()).Lower() == facename.Lower()) - { - m_faceListBox->ScrollToLine(i); - break; - } - } - } - } -} - - -/*! - * wxEVT_COMMAND_TEXT_UPDATED event handler for ID_RICHTEXTFONTPAGE_SIZETEXTCTRL - */ - -void wxRichTextFontPage::OnSizeTextCtrlUpdated( wxCommandEvent& WXUNUSED(event) ) -{ - if (m_dontUpdate) - return; - - wxString strSize = m_sizeTextCtrl->GetValue(); - if (!strSize.IsEmpty() && m_sizeListBox->FindString(strSize) != wxNOT_FOUND) - m_sizeListBox->SetStringSelection(strSize); - UpdatePreview(); -} - - -/*! - * wxEVT_COMMAND_LISTBOX_SELECTED event handler for ID_RICHTEXTFONTPAGE_SIZELISTBOX - */ - -void wxRichTextFontPage::OnSizeListBoxSelected( wxCommandEvent& event ) -{ - m_dontUpdate = true; - - m_sizeTextCtrl->SetValue(event.GetString()); - - m_dontUpdate = false; - - UpdatePreview(); -} - -/*! - * wxEVT_COMMAND_LISTBOX_SELECTED event handler for ID_RICHTEXTFONTPAGE_FACELISTBOX - */ - -void wxRichTextFontPage::OnFaceListBoxSelected( wxCommandEvent& WXUNUSED(event) ) -{ - m_dontUpdate = true; - - m_faceTextCtrl->SetValue(m_faceListBox->GetFaceName(m_faceListBox->GetSelection())); - - m_dontUpdate = false; - - UpdatePreview(); -} - -/*! - * wxEVT_COMMAND_COMBOBOX_SELECTED event handler for ID_RICHTEXTFONTPAGE_STYLECTRL - */ - -void wxRichTextFontPage::OnStyleCtrlSelected( wxCommandEvent& WXUNUSED(event) ) -{ - UpdatePreview(); -} - - -/*! - * wxEVT_COMMAND_COMBOBOX_SELECTED event handler for ID_RICHTEXTFONTPAGE_UNDERLINING_CTRL - */ - -void wxRichTextFontPage::OnUnderliningCtrlSelected( wxCommandEvent& WXUNUSED(event) ) -{ - UpdatePreview(); -} - - -/*! - * wxEVT_COMMAND_COMBOBOX_SELECTED event handler for ID_RICHTEXTFONTPAGE_WEIGHTCTRL - */ - -void wxRichTextFontPage::OnWeightCtrlSelected( wxCommandEvent& WXUNUSED(event) ) -{ - UpdatePreview(); -} - -void wxRichTextFontPage::OnColourClicked( wxCommandEvent& event ) -{ - if (event.GetId() == m_colourCtrl->GetId()) - m_colourPresent = true; - else if (event.GetId() == m_bgColourCtrl->GetId()) - m_bgColourPresent = true; - - UpdatePreview(); -} -/*! - * wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_RICHTEXTFONTPAGE_STRIKETHROUGHCTRL - */ - -void wxRichTextFontPage::OnStrikethroughctrlClick( wxCommandEvent& WXUNUSED(event) ) -{ - UpdatePreview(); -} - -/*! - * wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_RICHTEXTFONTPAGE_CAPSCTRL - */ - -void wxRichTextFontPage::OnCapsctrlClick( wxCommandEvent& WXUNUSED(event) ) -{ - UpdatePreview(); -} - -/*! - * wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_RICHTEXTFONTPAGE_SUPERSCRIPT - */ - -void wxRichTextFontPage::OnRichtextfontpageSuperscriptClick( wxCommandEvent& WXUNUSED(event) ) -{ - if ( m_superscriptCtrl->Get3StateValue() == wxCHK_CHECKED) - m_subscriptCtrl->Set3StateValue( wxCHK_UNCHECKED ); - - UpdatePreview(); -} - -/*! - * wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_RICHTEXTFONTPAGE_SUBSCRIPT - */ - -void wxRichTextFontPage::OnRichtextfontpageSubscriptClick( wxCommandEvent& WXUNUSED(event) ) -{ - if ( m_subscriptCtrl->Get3StateValue() == wxCHK_CHECKED) - m_superscriptCtrl->Set3StateValue( wxCHK_UNCHECKED ); - - UpdatePreview(); -} diff --git a/wxWidgets/src/richtext/richtextformatdlg.cpp b/wxWidgets/src/richtext/richtextformatdlg.cpp deleted file mode 100644 index 038958028c..0000000000 --- a/wxWidgets/src/richtext/richtextformatdlg.cpp +++ /dev/null @@ -1,659 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/richtext/richtextformatdlg.cpp -// Purpose: Formatting dialog for wxRichTextCtrl -// Author: Julian Smart -// Modified by: -// Created: 2006-10-01 -// RCS-ID: $Id: richtextformatdlg.cpp 62010 2009-09-22 10:03:45Z JS $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_RICHTEXT - -#include "wx/richtext/richtextformatdlg.h" - -#ifndef WX_PRECOMP - #include "wx/listbox.h" - #include "wx/combobox.h" - #include "wx/textctrl.h" - #include "wx/sizer.h" - #include "wx/stattext.h" - #include "wx/statline.h" - #include "wx/radiobut.h" - #include "wx/icon.h" - #include "wx/bitmap.h" - #include "wx/dcclient.h" - #include "wx/frame.h" - #include "wx/checkbox.h" - #include "wx/button.h" -#endif // WX_PRECOMP - -#include "wx/bookctrl.h" -#include "wx/colordlg.h" -#include "wx/settings.h" -#include "wx/module.h" -#include "wx/imaglist.h" - -#include "wx/richtext/richtextctrl.h" -#include "wx/richtext/richtextstyles.h" - -#ifdef __WXMAC__ -#include "../../src/richtext/richtextfontpage.cpp" -#include "../../src/richtext/richtextindentspage.cpp" -#include "../../src/richtext/richtexttabspage.cpp" -#include "../../src/richtext/richtextbulletspage.cpp" -#include "../../src/richtext/richtextstylepage.cpp" -#include "../../src/richtext/richtextliststylepage.cpp" -#else -#include "richtextfontpage.cpp" -#include "richtextindentspage.cpp" -#include "richtexttabspage.cpp" -#include "richtextbulletspage.cpp" -// Digital Mars can't cope with this much code -#ifndef __DMC__ - #include "richtextliststylepage.cpp" -#endif -#include "richtextstylepage.cpp" -#endif - -#if 0 // def __WXMAC__ -#define wxRICHTEXT_USE_TOOLBOOK true -#else -#define wxRICHTEXT_USE_TOOLBOOK false -#endif - -bool wxRichTextFormattingDialog::sm_showToolTips = false; - -IMPLEMENT_CLASS(wxRichTextFormattingDialog, wxPropertySheetDialog) - -BEGIN_EVENT_TABLE(wxRichTextFormattingDialog, wxPropertySheetDialog) - EVT_BOOKCTRL_PAGE_CHANGED(wxID_ANY, wxRichTextFormattingDialog::OnTabChanged) -END_EVENT_TABLE() - -wxRichTextFormattingDialogFactory* wxRichTextFormattingDialog::ms_FormattingDialogFactory = NULL; - -void wxRichTextFormattingDialog::Init() -{ - m_imageList = NULL; - m_styleDefinition = NULL; - m_styleSheet = NULL; -} - -wxRichTextFormattingDialog::~wxRichTextFormattingDialog() -{ - delete m_imageList; - delete m_styleDefinition; -} - -bool wxRichTextFormattingDialog::Create(long flags, wxWindow* parent, const wxString& title, wxWindowID id, - const wxPoint& pos, const wxSize& sz, long style) -{ - SetExtraStyle(wxDIALOG_EX_CONTEXTHELP|wxWS_EX_VALIDATE_RECURSIVELY); - - int resizeBorder = wxRESIZE_BORDER; - - GetFormattingDialogFactory()->SetSheetStyle(this); - -#ifdef __WXMAC__ - SetWindowVariant(wxWINDOW_VARIANT_SMALL); -#endif - - wxPropertySheetDialog::Create(parent, id, title, pos, sz, - style | (int)wxPlatform::IfNot(wxOS_WINDOWS_CE, resizeBorder) - ); - - GetFormattingDialogFactory()->CreateButtons(this); - GetFormattingDialogFactory()->CreatePages(flags, this); - - LayoutDialog(); - - return true; -} - -/// Get attributes from the given range -bool wxRichTextFormattingDialog::GetStyle(wxRichTextCtrl* ctrl, const wxRichTextRange& range) -{ - if (ctrl->GetBuffer().GetStyleForRange(range.ToInternal(), m_attributes)) - return UpdateDisplay(); - else - return false; -} - -/// Apply attributes to the given range, only applying if necessary (wxRICHTEXT_SETSTYLE_OPTIMIZE) -bool wxRichTextFormattingDialog::ApplyStyle(wxRichTextCtrl* ctrl, const wxRichTextRange& range, int flags) -{ - return ctrl->SetStyleEx(range, m_attributes, flags); -} - -/// Set the attributes and optionally update the display -bool wxRichTextFormattingDialog::SetStyle(const wxTextAttrEx& style, bool update) -{ - m_attributes = style; - if (update) - UpdateDisplay(); - return true; -} - -/// Set the style definition and optionally update the display -bool wxRichTextFormattingDialog::SetStyleDefinition(const wxRichTextStyleDefinition& styleDef, wxRichTextStyleSheet* sheet, bool update) -{ - m_styleSheet = sheet; - - if (m_styleDefinition) - delete m_styleDefinition; - m_styleDefinition = styleDef.Clone(); - - return SetStyle(m_styleDefinition->GetStyle(), update); -} - -/// Transfers the data and from to the window -bool wxRichTextFormattingDialog::TransferDataToWindow() -{ - if (m_styleDefinition) - m_attributes = m_styleDefinition->GetStyle(); - - if (!wxPropertySheetDialog::TransferDataToWindow()) - return false; - - return true; -} - -bool wxRichTextFormattingDialog::TransferDataFromWindow() -{ - if (!wxPropertySheetDialog::TransferDataFromWindow()) - return false; - - if (m_styleDefinition) - m_styleDefinition->GetStyle() = m_attributes; - - return true; -} - -/// Update the display -bool wxRichTextFormattingDialog::UpdateDisplay() -{ - return TransferDataToWindow(); -} - -/// Apply the styles when a different tab is selected, so the previews are -/// up to date -void wxRichTextFormattingDialog::OnTabChanged(wxBookCtrlEvent& event) -{ - if (GetBookCtrl() != event.GetEventObject()) - { - event.Skip(); - return; - } - - int oldPageId = event.GetOldSelection(); - if (oldPageId != -1) - { - wxWindow* page = GetBookCtrl()->GetPage(oldPageId); - if (page) - page->TransferDataFromWindow(); - } - - int pageId = event.GetSelection(); - if (pageId != -1) - { - wxWindow* page = GetBookCtrl()->GetPage(pageId); - if (page) - page->TransferDataToWindow(); - } -} - -/// Respond to help command -void wxRichTextFormattingDialog::OnHelp(wxCommandEvent& event) -{ - int selPage = GetBookCtrl()->GetSelection(); - if (selPage != wxNOT_FOUND) - { - int pageId = m_pageIds[selPage]; - if (!GetFormattingDialogFactory()->ShowHelp(pageId, this)) - event.Skip(); - } -} - -void wxRichTextFormattingDialog::SetFormattingDialogFactory(wxRichTextFormattingDialogFactory* factory) -{ - if (ms_FormattingDialogFactory) - delete ms_FormattingDialogFactory; - ms_FormattingDialogFactory = factory; -} - -/*! - * Factory for formatting dialog - */ - -/// Create all pages, under the dialog's book control, also calling AddPage -bool wxRichTextFormattingDialogFactory::CreatePages(long pages, wxRichTextFormattingDialog* dialog) -{ - if (dialog->GetImageList()) - dialog->GetBookCtrl()->SetImageList(dialog->GetImageList()); - - int availablePageCount = GetPageIdCount(); - int i; - bool selected = false; - for (i = 0; i < availablePageCount; i ++) - { - int pageId = GetPageId(i); - if (pageId != -1 && (pages & pageId)) - { - wxString title; - wxPanel* panel = CreatePage(pageId, title, dialog); - wxASSERT( panel != NULL ); - if (panel) - { - int imageIndex = GetPageImage(pageId); - dialog->GetBookCtrl()->AddPage(panel, title, !selected, imageIndex); - selected = true; - - dialog->AddPageId(pageId); - } - } - } - - return true; -} - -/// Create a page, given a page identifier -wxPanel* wxRichTextFormattingDialogFactory::CreatePage(int page, wxString& title, wxRichTextFormattingDialog* dialog) -{ - if (page == wxRICHTEXT_FORMAT_STYLE_EDITOR) - { - wxRichTextStylePage* page = new wxRichTextStylePage(dialog->GetBookCtrl(), wxID_ANY); - title = _("Style"); - return page; - } - else if (page == wxRICHTEXT_FORMAT_FONT) - { - wxRichTextFontPage* page = new wxRichTextFontPage(dialog->GetBookCtrl(), wxID_ANY); - title = _("Font"); - return page; - } - else if (page == wxRICHTEXT_FORMAT_INDENTS_SPACING) - { - wxRichTextIndentsSpacingPage* page = new wxRichTextIndentsSpacingPage(dialog->GetBookCtrl(), wxID_ANY); - title = _("Indents && Spacing"); - return page; - } - else if (page == wxRICHTEXT_FORMAT_TABS) - { - wxRichTextTabsPage* page = new wxRichTextTabsPage(dialog->GetBookCtrl(), wxID_ANY); - title = _("Tabs"); - return page; - } - else if (page == wxRICHTEXT_FORMAT_BULLETS) - { - wxRichTextBulletsPage* page = new wxRichTextBulletsPage(dialog->GetBookCtrl(), wxID_ANY); - title = _("Bullets"); - return page; - } -#ifndef __DMC__ - else if (page == wxRICHTEXT_FORMAT_LIST_STYLE) - { - wxRichTextListStylePage* page = new wxRichTextListStylePage(dialog->GetBookCtrl(), wxID_ANY); - title = _("List Style"); - return page; - } -#endif - else - return NULL; -} - -/// Enumerate all available page identifiers -int wxRichTextFormattingDialogFactory::GetPageId(int i) const -{ - int pages[] = { - wxRICHTEXT_FORMAT_STYLE_EDITOR, - wxRICHTEXT_FORMAT_FONT, - wxRICHTEXT_FORMAT_INDENTS_SPACING, - wxRICHTEXT_FORMAT_BULLETS, - wxRICHTEXT_FORMAT_TABS, - wxRICHTEXT_FORMAT_LIST_STYLE }; - - if (i < 0 || i > 5) - return -1; - - return pages[i]; -} - -/// Get the number of available page identifiers -int wxRichTextFormattingDialogFactory::GetPageIdCount() const -{ -#ifdef __DMC__ - return 5; -#else - return 6; -#endif -} - -/// Set the sheet style, called at the start of wxRichTextFormattingDialog::Create -bool wxRichTextFormattingDialogFactory::SetSheetStyle(wxRichTextFormattingDialog* dialog) -{ - bool useToolBook = wxRICHTEXT_USE_TOOLBOOK; - if (useToolBook) - { - int sheetStyle = wxPROPSHEET_SHRINKTOFIT; -#ifdef __WXMAC__ - sheetStyle |= wxPROPSHEET_BUTTONTOOLBOOK; -#else - sheetStyle |= wxPROPSHEET_TOOLBOOK; -#endif - - dialog->SetSheetStyle(sheetStyle); - dialog->SetSheetInnerBorder(0); - dialog->SetSheetOuterBorder(0); - } - - return true; -} - -/// Create the main dialog buttons -bool wxRichTextFormattingDialogFactory::CreateButtons(wxRichTextFormattingDialog* dialog) -{ - bool useToolBook = wxRICHTEXT_USE_TOOLBOOK; - - // If using a toolbook, also follow Mac style and don't create buttons - int flags = wxOK|wxCANCEL; -#ifndef __WXWINCE__ - if (dialog->GetWindowStyleFlag() & wxRICHTEXT_FORMAT_HELP_BUTTON) - flags |= wxHELP; -#endif - - if (!useToolBook) - dialog->CreateButtons(flags); - - return true; -} - -/* - * Module to initialise and clean up handlers - */ - -class wxRichTextFormattingDialogModule: public wxModule -{ -DECLARE_DYNAMIC_CLASS(wxRichTextFormattingDialogModule) -public: - wxRichTextFormattingDialogModule() {} - bool OnInit() { wxRichTextFormattingDialog::SetFormattingDialogFactory(new wxRichTextFormattingDialogFactory); return true; } - void OnExit() { wxRichTextFormattingDialog::SetFormattingDialogFactory(NULL); } -}; - -IMPLEMENT_DYNAMIC_CLASS(wxRichTextFormattingDialogModule, wxModule) - -/* - * Font preview control - */ - -BEGIN_EVENT_TABLE(wxRichTextFontPreviewCtrl, wxWindow) - EVT_PAINT(wxRichTextFontPreviewCtrl::OnPaint) -END_EVENT_TABLE() - -void wxRichTextFontPreviewCtrl::OnPaint(wxPaintEvent& WXUNUSED(event)) -{ - wxPaintDC dc(this); - - wxSize size = GetSize(); - wxFont font = GetFont(); - - if ((GetTextEffects() & wxTEXT_ATTR_EFFECT_SUPERSCRIPT) || (GetTextEffects() & wxTEXT_ATTR_EFFECT_SUBSCRIPT)) - { - double size = static_cast(font.GetPointSize()) / wxSCRIPT_MUL_FACTOR; - font.SetPointSize( static_cast(size) ); - } - - if ( font.Ok() ) - { - dc.SetFont(font); - // Calculate vertical and horizontal centre - long w = 0, h = 0; - - wxString text(_("ABCDEFGabcdefg12345")); - if (GetTextEffects() & wxTEXT_ATTR_EFFECT_CAPITALS) - text.MakeUpper(); - - dc.GetTextExtent( text, &w, &h); - int cx = wxMax(2, (size.x/2) - (w/2)); - int cy = wxMax(2, (size.y/2) - (h/2)); - - if ( GetTextEffects() & wxTEXT_ATTR_EFFECT_SUPERSCRIPT ) - cy -= h/2; - if ( GetTextEffects() & wxTEXT_ATTR_EFFECT_SUBSCRIPT ) - cy += h/2; - - dc.SetTextForeground(GetForegroundColour()); - dc.SetClippingRegion(2, 2, size.x-4, size.y-4); - dc.DrawText(text, cx, cy); - - if (GetTextEffects() & wxTEXT_ATTR_EFFECT_STRIKETHROUGH) - { - dc.SetPen(wxPen(GetForegroundColour(), 1)); - dc.DrawLine(cx, (int) (cy + h/2 + 0.5), cx + w, (int) (cy + h/2 + 0.5)); - } - - dc.DestroyClippingRegion(); - } -} - -// Helper for pages to get the top-level dialog -wxRichTextFormattingDialog* wxRichTextFormattingDialog::GetDialog(wxWindow* win) -{ - wxWindow* p = win->GetParent(); - while (p && !p->IsKindOf(CLASSINFO(wxRichTextFormattingDialog))) - p = p->GetParent(); - wxRichTextFormattingDialog* dialog = wxDynamicCast(p, wxRichTextFormattingDialog); - return dialog; -} - - -// Helper for pages to get the attributes -wxTextAttrEx* wxRichTextFormattingDialog::GetDialogAttributes(wxWindow* win) -{ - wxRichTextFormattingDialog* dialog = GetDialog(win); - if (dialog) - return & dialog->GetAttributes(); - else - return NULL; -} - -// Helper for pages to get the style -wxRichTextStyleDefinition* wxRichTextFormattingDialog::GetDialogStyleDefinition(wxWindow* win) -{ - wxRichTextFormattingDialog* dialog = GetDialog(win); - if (dialog) - return dialog->GetStyleDefinition(); - else - return NULL; -} - -/* - * A control for displaying a small preview of a colour or bitmap - */ - -BEGIN_EVENT_TABLE(wxRichTextColourSwatchCtrl, wxControl) - EVT_MOUSE_EVENTS(wxRichTextColourSwatchCtrl::OnMouseEvent) -END_EVENT_TABLE() - -IMPLEMENT_CLASS(wxRichTextColourSwatchCtrl, wxControl) - -wxRichTextColourSwatchCtrl::wxRichTextColourSwatchCtrl(wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style) -{ - if ((style & wxBORDER_MASK) == wxBORDER_DEFAULT) -#ifdef __WXMSW__ - style |= GetThemedBorderStyle(); -#else - style |= wxBORDER_SUNKEN; -#endif - wxControl::Create(parent, id, pos, size, style); - - SetColour(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW)); -} - -wxRichTextColourSwatchCtrl::~wxRichTextColourSwatchCtrl() -{ -} - -void wxRichTextColourSwatchCtrl::OnMouseEvent(wxMouseEvent& event) -{ - if (event.LeftDown()) - { - wxWindow* parent = GetParent(); - while (parent != NULL && !parent->IsKindOf(CLASSINFO(wxDialog)) && !parent->IsKindOf(CLASSINFO(wxFrame))) - parent = parent->GetParent(); - - wxColourData data; - data.SetChooseFull(true); - data.SetColour(m_colour); -#if wxUSE_COLOURDLG - wxColourDialog *dialog = new wxColourDialog(parent, &data); - // Crashes on wxMac (no m_peer) -#ifndef __WXMAC__ - dialog->SetTitle(_("Colour")); -#endif - if (dialog->ShowModal() == wxID_OK) - { - wxColourData retData = dialog->GetColourData(); - m_colour = retData.GetColour(); - SetBackgroundColour(m_colour); - } - dialog->Destroy(); -#endif // wxUSE_COLOURDLG - Refresh(); - - wxCommandEvent event(wxEVT_COMMAND_BUTTON_CLICKED, GetId()); - GetEventHandler()->ProcessEvent(event); - } -} - -#if wxUSE_HTML - -/*! - * wxRichTextFontListBox class declaration - * A listbox to display styles. - */ - -IMPLEMENT_CLASS(wxRichTextFontListBox, wxHtmlListBox) - -BEGIN_EVENT_TABLE(wxRichTextFontListBox, wxHtmlListBox) -END_EVENT_TABLE() - -wxRichTextFontListBox::wxRichTextFontListBox(wxWindow* parent, wxWindowID id, const wxPoint& pos, - const wxSize& size, long style) -{ - if ((style & wxBORDER_MASK) == wxBORDER_DEFAULT) -#ifdef __WXMSW__ - style |= GetThemedBorderStyle(); -#else - style |= wxBORDER_SUNKEN; -#endif - - Init(); - Create(parent, id, pos, size, style); -} - -bool wxRichTextFontListBox::Create(wxWindow* parent, wxWindowID id, const wxPoint& pos, - const wxSize& size, long style) -{ - return wxHtmlListBox::Create(parent, id, pos, size, style); -} - -wxRichTextFontListBox::~wxRichTextFontListBox() -{ -} - -/// Returns the HTML for this item -wxString wxRichTextFontListBox::OnGetItem(size_t n) const -{ - if (m_faceNames.GetCount() == 0) - return wxEmptyString; - - wxString str = CreateHTML(m_faceNames[n]); - return str; -} - -/// Get font name for index -wxString wxRichTextFontListBox::GetFaceName(size_t i) const -{ - return m_faceNames[i]; -} - -/// Set selection for string, returning the index. -int wxRichTextFontListBox::SetFaceNameSelection(const wxString& name) -{ - int i = m_faceNames.Index(name); - SetSelection(i); - - return i; -} - -/// Updates the font list -void wxRichTextFontListBox::UpdateFonts() -{ - wxArrayString facenames = wxRichTextCtrl::GetAvailableFontNames(); - m_faceNames = facenames; - m_faceNames.Sort(); - - SetItemCount(m_faceNames.GetCount()); - Refresh(); -} - -#if 0 -// Convert a colour to a 6-digit hex string -static wxString ColourToHexString(const wxColour& col) -{ - wxString hex; - - hex += wxDecToHex(col.Red()); - hex += wxDecToHex(col.Green()); - hex += wxDecToHex(col.Blue()); - - return hex; -} -#endif - -/// Creates a suitable HTML fragment for a definition -wxString wxRichTextFontListBox::CreateHTML(const wxString& facename) const -{ - wxString str = wxT("GetStyle().GetTextColour().Ok()) - str << wxT(" color=\"#") << ColourToHexString(def->GetStyle().GetTextColour()) << wxT("\""); -*/ - - str << wxT(">"); - - bool hasBold = false; - - if (hasBold) - str << wxT(""); - - str += facename; - - if (hasBold) - str << wxT(""); - - str << wxT(""); - - return str; -} - -#endif - // wxUSE_HTML - - -#endif - // wxUSE_RICHTEXT diff --git a/wxWidgets/src/richtext/richtexthtml.cpp b/wxWidgets/src/richtext/richtexthtml.cpp deleted file mode 100644 index 9858b10345..0000000000 --- a/wxWidgets/src/richtext/richtexthtml.cpp +++ /dev/null @@ -1,660 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/richtext/richtexthtml.cpp -// Purpose: HTML I/O for wxRichTextCtrl -// Author: Julian Smart -// Modified by: -// Created: 2005-09-30 -// RCS-ID: $Id: richtexthtml.cpp 64162 2010-04-27 16:10:27Z JS $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_RICHTEXT - -#include "wx/richtext/richtexthtml.h" -#include "wx/richtext/richtextstyles.h" - -#ifndef WX_PRECOMP -#endif - -#include "wx/filename.h" -#include "wx/wfstream.h" -#include "wx/txtstrm.h" - -#if wxUSE_FILESYSTEM -#include "wx/filesys.h" -#include "wx/fs_mem.h" -#endif - -IMPLEMENT_DYNAMIC_CLASS(wxRichTextHTMLHandler, wxRichTextFileHandler) - -int wxRichTextHTMLHandler::sm_fileCounter = 1; - -wxRichTextHTMLHandler::wxRichTextHTMLHandler(const wxString& name, const wxString& ext, int type) - : wxRichTextFileHandler(name, ext, type), m_buffer(NULL), m_font(false), m_inTable(false) -{ - m_fontSizeMapping.Add(8); - m_fontSizeMapping.Add(10); - m_fontSizeMapping.Add(13); - m_fontSizeMapping.Add(17); - m_fontSizeMapping.Add(22); - m_fontSizeMapping.Add(30); - m_fontSizeMapping.Add(100); -} - -/// Can we handle this filename (if using files)? By default, checks the extension. -bool wxRichTextHTMLHandler::CanHandle(const wxString& filename) const -{ - wxString path, file, ext; - wxSplitPath(filename, & path, & file, & ext); - - return (ext.Lower() == wxT("html") || ext.Lower() == wxT("htm")); -} - - -#if wxUSE_STREAMS -bool wxRichTextHTMLHandler::DoLoadFile(wxRichTextBuffer *WXUNUSED(buffer), wxInputStream& WXUNUSED(stream)) -{ - return false; -} - -/* - * We need to output only _changes_ in character formatting. - */ - -bool wxRichTextHTMLHandler::DoSaveFile(wxRichTextBuffer *buffer, wxOutputStream& stream) -{ - m_buffer = buffer; - - ClearTemporaryImageLocations(); - - buffer->Defragment(); - -#if wxUSE_UNICODE - wxCSConv* customEncoding = NULL; - wxMBConv* conv = NULL; - if (!GetEncoding().IsEmpty()) - { - customEncoding = new wxCSConv(GetEncoding()); - if (!customEncoding->IsOk()) - { - delete customEncoding; - customEncoding = NULL; - } - } - if (customEncoding) - conv = customEncoding; - else - conv = & wxConvUTF8; -#endif - - { -#if wxUSE_UNICODE - wxTextOutputStream str(stream, wxEOL_NATIVE, *conv); -#else - wxTextOutputStream str(stream, wxEOL_NATIVE); -#endif - - wxTextAttrEx currentParaStyle = buffer->GetAttributes(); - wxTextAttrEx currentCharStyle = buffer->GetAttributes(); - - if ((GetFlags() & wxRICHTEXT_HANDLER_NO_HEADER_FOOTER) == 0) - str << wxT("\n"); - - OutputFont(currentParaStyle, str); - - m_font = false; - m_inTable = false; - - m_indents.Clear(); - m_listTypes.Clear(); - - wxRichTextObjectList::compatibility_iterator node = buffer->GetChildren().GetFirst(); - while (node) - { - wxRichTextParagraph* para = wxDynamicCast(node->GetData(), wxRichTextParagraph); - wxASSERT (para != NULL); - - if (para) - { - wxTextAttrEx paraStyle(para->GetCombinedAttributes()); - - BeginParagraphFormatting(currentParaStyle, paraStyle, str); - - wxRichTextObjectList::compatibility_iterator node2 = para->GetChildren().GetFirst(); - while (node2) - { - wxRichTextObject* obj = node2->GetData(); - wxRichTextPlainText* textObj = wxDynamicCast(obj, wxRichTextPlainText); - if (textObj && !textObj->IsEmpty()) - { - wxTextAttrEx charStyle(para->GetCombinedAttributes(obj->GetAttributes())); - BeginCharacterFormatting(currentCharStyle, charStyle, paraStyle, str); - - wxString text = textObj->GetText(); - - if (charStyle.HasTextEffects() && (charStyle.GetTextEffects() & wxTEXT_ATTR_EFFECT_CAPITALS)) - text.MakeUpper(); - - wxString toReplace = wxRichTextLineBreakChar; - text.Replace(toReplace, wxT("
")); - - str << text; - - EndCharacterFormatting(currentCharStyle, charStyle, paraStyle, str); - } - - wxRichTextImage* image = wxDynamicCast(obj, wxRichTextImage); - if( image && (!image->IsEmpty() || image->GetImageBlock().GetData())) - WriteImage( image, stream ); - - node2 = node2->GetNext(); - } - - EndParagraphFormatting(currentParaStyle, paraStyle, str); - - str << wxT("\n"); - } - node = node->GetNext(); - } - - CloseLists(-1, str); - - str << wxT(""); - - if ((GetFlags() & wxRICHTEXT_HANDLER_NO_HEADER_FOOTER) == 0) - str << wxT(""); - - str << wxT("\n"); - } - -#if wxUSE_UNICODE - if (customEncoding) - delete customEncoding; -#endif - - m_buffer = NULL; - - return true; -} - -void wxRichTextHTMLHandler::BeginCharacterFormatting(const wxTextAttrEx& currentStyle, const wxTextAttrEx& thisStyle, const wxTextAttrEx& WXUNUSED(paraStyle), wxTextOutputStream& str) -{ - wxString style; - - // Is there any change in the font properties of the item? - if (thisStyle.GetFont().GetFaceName() != currentStyle.GetFont().GetFaceName()) - { - wxString faceName(thisStyle.GetFont().GetFaceName()); - style += wxString::Format(wxT(" face=\"%s\""), faceName.c_str()); - } - if (thisStyle.GetFont().GetPointSize() != currentStyle.GetFont().GetPointSize()) - style += wxString::Format(wxT(" size=\"%ld\""), PtToSize(thisStyle.GetFont().GetPointSize())); - if (thisStyle.GetTextColour() != currentStyle.GetTextColour() ) - { - wxString color(thisStyle.GetTextColour().GetAsString(wxC2S_HTML_SYNTAX)); - style += wxString::Format(wxT(" color=\"%s\""), color.c_str()); - } - - if (style.size()) - { - str << wxString::Format(wxT(""), style.c_str()); - m_font = true; - } - - if (thisStyle.GetFont().GetWeight() == wxBOLD) - str << wxT(""); - if (thisStyle.GetFont().GetStyle() == wxITALIC) - str << wxT(""); - if (thisStyle.GetFont().GetUnderlined()) - str << wxT(""); - - if (thisStyle.HasURL()) - str << wxT("
"); -} - -void wxRichTextHTMLHandler::EndCharacterFormatting(const wxTextAttrEx& WXUNUSED(currentStyle), const wxTextAttrEx& thisStyle, const wxTextAttrEx& WXUNUSED(paraStyle), wxTextOutputStream& stream) -{ - if (thisStyle.HasURL()) - stream << wxT(""); - - if (thisStyle.GetFont().GetUnderlined()) - stream << wxT(""); - if (thisStyle.GetFont().GetStyle() == wxITALIC) - stream << wxT(""); - if (thisStyle.GetFont().GetWeight() == wxBOLD) - stream << wxT(""); - - if (m_font) - { - m_font = false; - stream << wxT(""); - } -} - -/// Begin paragraph formatting -void wxRichTextHTMLHandler::BeginParagraphFormatting(const wxTextAttrEx& WXUNUSED(currentStyle), const wxTextAttrEx& thisStyle, wxTextOutputStream& str) -{ - if (thisStyle.HasPageBreak()) - { - str << wxT("
\n"); - } - - if (thisStyle.HasLeftIndent() && thisStyle.GetLeftIndent() != 0) - { - if (thisStyle.HasBulletStyle()) - { - int indent = thisStyle.GetLeftIndent(); - - // Close levels high than this - CloseLists(indent, str); - - if (m_indents.GetCount() > 0 && indent == m_indents.Last()) - { - // Same level, no need to start a new list - } - else if (m_indents.GetCount() == 0 || indent > m_indents.Last()) - { - m_indents.Add(indent); - - wxString tag; - int listType = TypeOfList(thisStyle, tag); - m_listTypes.Add(listType); - - // wxHTML needs an extra

before a list when using

...

in previous paragraphs. - // TODO: pass a flag that indicates we're using wxHTML. - str << wxT("

\n"); - - str << tag; - } - - str << wxT("

  • "); - } - else - { - CloseLists(-1, str); - - wxString align = GetAlignment(thisStyle); - str << wxString::Format(wxT("

    0.0)) - { - styleStr += wxString::Format(wxT("margin-left: %.2fmm; "), indentLeftMM); - } - float indentRightMM = thisStyle.GetRightIndent()/10.0; - if ((GetFlags() & wxRICHTEXT_HANDLER_USE_CSS) && thisStyle.HasRightIndent() && (indentRightMM > 0.0)) - { - styleStr += wxString::Format(wxT("margin-right: %.2fmm; "), indentRightMM); - } - // First line indentation - float firstLineIndentMM = - thisStyle.GetLeftSubIndent() / 10.0; - if ((GetFlags() & wxRICHTEXT_HANDLER_USE_CSS) && (firstLineIndentMM > 0.0)) - { - styleStr += wxString::Format(wxT("text-indent: %.2fmm; "), firstLineIndentMM); - } - - if (!styleStr.IsEmpty()) - str << wxT(" style=\"") << styleStr << wxT("\""); - - str << wxT(">"); - - // TODO: convert to pixels - int indentPixels = indentLeftMM*10/4; - - if ((GetFlags() & wxRICHTEXT_HANDLER_USE_CSS) == 0) - { - // Use a table to do indenting if we don't have CSS - str << wxString::Format(wxT("
    "), indentPixels); - m_inTable = true; - } - - if (((GetFlags() & wxRICHTEXT_HANDLER_USE_CSS) == 0) && (thisStyle.GetLeftSubIndent() < 0)) - { - str << SymbolicIndent( - thisStyle.GetLeftSubIndent()); - } - } - } - else - { - CloseLists(-1, str); - - wxString align = GetAlignment(thisStyle); - str << wxString::Format(wxT("

    "); - } - OutputFont(thisStyle, str); -} - -/// End paragraph formatting -void wxRichTextHTMLHandler::EndParagraphFormatting(const wxTextAttrEx& WXUNUSED(currentStyle), const wxTextAttrEx& thisStyle, wxTextOutputStream& stream) -{ - if (thisStyle.HasFont()) - stream << wxT(""); - - if (m_inTable) - { - stream << wxT("

    \n"); - m_inTable = false; - } - else if (!thisStyle.HasBulletStyle()) - stream << wxT("

    \n"); -} - -/// Closes lists to level (-1 means close all) -void wxRichTextHTMLHandler::CloseLists(int level, wxTextOutputStream& str) -{ - // Close levels high than this - int i = m_indents.GetCount()-1; - while (i >= 0) - { - int l = m_indents[i]; - if (l > level) - { - if (m_listTypes[i] == 0) - str << wxT(""); - else - str << wxT(""); - m_indents.RemoveAt(i); - m_listTypes.RemoveAt(i); - } - else - break; - i --; - } -} - -/// Output font tag -void wxRichTextHTMLHandler::OutputFont(const wxTextAttrEx& style, wxTextOutputStream& stream) -{ - if (style.HasFont()) - { - stream << wxString::Format(wxT(""); - } -} - -int wxRichTextHTMLHandler::TypeOfList( const wxTextAttrEx& thisStyle, wxString& tag ) -{ - // We can use number attribute of li tag but not all the browsers support it. - // also wxHtmlWindow doesn't support type attribute. - - bool m_is_ul = false; - if (thisStyle.GetBulletStyle() == (wxTEXT_ATTR_BULLET_STYLE_ARABIC|wxTEXT_ATTR_BULLET_STYLE_PERIOD)) - tag = wxT("
      "); - else if (thisStyle.GetBulletStyle() == wxTEXT_ATTR_BULLET_STYLE_LETTERS_UPPER) - tag = wxT("
        "); - else if (thisStyle.GetBulletStyle() == wxTEXT_ATTR_BULLET_STYLE_LETTERS_LOWER) - tag = wxT("
          "); - else if (thisStyle.GetBulletStyle() == wxTEXT_ATTR_BULLET_STYLE_ROMAN_UPPER) - tag = wxT("
            "); - else if (thisStyle.GetBulletStyle() == wxTEXT_ATTR_BULLET_STYLE_ROMAN_LOWER) - tag = wxT("
              "); - else - { - tag = wxT("
                "); - m_is_ul = true; - } - - if (m_is_ul) - return 1; - else - return 0; -} - -wxString wxRichTextHTMLHandler::GetAlignment( const wxTextAttrEx& thisStyle ) -{ - switch( thisStyle.GetAlignment() ) - { - case wxTEXT_ALIGNMENT_LEFT: - return wxT("left"); - case wxTEXT_ALIGNMENT_RIGHT: - return wxT("right"); - case wxTEXT_ALIGNMENT_CENTER: - return wxT("center"); - case wxTEXT_ALIGNMENT_JUSTIFIED: - return wxT("justify"); - default: - return wxT("left"); - } -} - -void wxRichTextHTMLHandler::WriteImage(wxRichTextImage* image, wxOutputStream& stream) -{ - wxTextOutputStream str(stream); - - str << wxT("GetImage().Ok() && image->GetImageBlock().GetData()) - image->LoadFromBlock(); - if (image->GetImage().Ok() && !image->GetImageBlock().GetData()) - image->MakeBlock(); - - if (image->GetImage().Ok()) - { - wxString ext(image->GetImageBlock().GetExtension()); - wxString tempFilename(wxString::Format(wxT("image%d.%s"), sm_fileCounter, (const wxChar*) ext)); - wxMemoryFSHandler::AddFile(tempFilename, image->GetImage(), image->GetImageBlock().GetImageType()); - - m_imageLocations.Add(tempFilename); - - str << wxT("memory:") << tempFilename; - } - else - str << wxT("memory:?"); - - sm_fileCounter ++; - } - else if (GetFlags() & wxRICHTEXT_HANDLER_SAVE_IMAGES_TO_FILES) - { - if (!image->GetImage().Ok() && image->GetImageBlock().GetData()) - image->LoadFromBlock(); - if (image->GetImage().Ok() && !image->GetImageBlock().GetData()) - image->MakeBlock(); - - if (image->GetImage().Ok()) - { - wxString tempDir(GetTempDir()); - if (tempDir.IsEmpty()) - tempDir = wxFileName::GetTempDir(); - - wxString ext(image->GetImageBlock().GetExtension()); - wxString tempFilename(wxString::Format(wxT("%s/image%d.%s"), (const wxChar*) tempDir, sm_fileCounter, (const wxChar*) ext)); - image->GetImageBlock().Write(tempFilename); - - m_imageLocations.Add(tempFilename); - - str << wxFileSystem::FileNameToURL(tempFilename); - } - else - str << wxT("file:?"); - - sm_fileCounter ++; - } - else // if (GetFlags() & wxRICHTEXT_HANDLER_SAVE_IMAGES_TO_BASE64) // this is implied -#endif - { - str << wxT("data:"); - str << GetMimeType(image->GetImageBlock().GetImageType()); - str << wxT(";base64,"); - - if (image->GetImage().Ok() && !image->GetImageBlock().GetData()) - image->MakeBlock(); - - wxChar* data = b64enc( image->GetImageBlock().GetData(), image->GetImageBlock().GetDataSize() ); - str << data; - - delete[] data; - } - - str << wxT("\" />"); -} - -long wxRichTextHTMLHandler::PtToSize(long size) -{ - int i; - int len = m_fontSizeMapping.GetCount(); - for (i = 0; i < len; i++) - if (size <= m_fontSizeMapping[i]) - return i+1; - return 7; -} - -wxString wxRichTextHTMLHandler::SymbolicIndent(long indent) -{ - wxString in; - for(;indent > 0; indent -= 20) - in.Append( wxT(" ") ); - return in; -} - -const wxChar* wxRichTextHTMLHandler::GetMimeType(int imageType) -{ - switch(imageType) - { - case wxBITMAP_TYPE_BMP: - return wxT("image/bmp"); - case wxBITMAP_TYPE_TIF: - return wxT("image/tiff"); - case wxBITMAP_TYPE_GIF: - return wxT("image/gif"); - case wxBITMAP_TYPE_PNG: - return wxT("image/png"); - case wxBITMAP_TYPE_JPEG: - return wxT("image/jpeg"); - default: - return wxT("image/unknown"); - } -} - -// exim-style base64 encoder -wxChar* wxRichTextHTMLHandler::b64enc( unsigned char* input, size_t in_len ) -{ - // elements of enc64 array must be 8 bit values - // otherwise encoder will fail - // hmmm.. Does wxT macro define a char as 16 bit value - // when compiling with UNICODE option? - static const wxChar enc64[] = wxT("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"); - wxChar* output = new wxChar[4*((in_len+2)/3)+1]; - wxChar* p = output; - - while( in_len-- > 0 ) - { - register wxChar a, b; - - a = *input++; - - *p++ = enc64[ (a >> 2) & 0x3f ]; - - if( in_len-- == 0 ) - { - *p++ = enc64[ (a << 4 ) & 0x30 ]; - *p++ = '='; - *p++ = '='; - break; - } - - b = *input++; - - *p++ = enc64[(( a << 4 ) | ((b >> 4) &0xf )) & 0x3f]; - - if( in_len-- == 0 ) - { - *p++ = enc64[ (b << 2) & 0x3f ]; - *p++ = '='; - break; - } - - a = *input++; - - *p++ = enc64[ ((( b << 2 ) & 0x3f ) | ((a >> 6)& 0x3)) & 0x3f ]; - - *p++ = enc64[ a & 0x3f ]; - } - *p = 0; - - return output; -} -#endif -// wxUSE_STREAMS - -/// Delete the in-memory or temporary files generated by the last operation -bool wxRichTextHTMLHandler::DeleteTemporaryImages() -{ - return DeleteTemporaryImages(GetFlags(), m_imageLocations); -} - -/// Delete the in-memory or temporary files generated by the last operation -bool wxRichTextHTMLHandler::DeleteTemporaryImages(int flags, const wxArrayString& imageLocations) -{ - size_t i; - for (i = 0; i < imageLocations.GetCount(); i++) - { - wxString location = imageLocations[i]; - - if (flags & wxRICHTEXT_HANDLER_SAVE_IMAGES_TO_MEMORY) - { -#if wxUSE_FILESYSTEM - wxMemoryFSHandler::RemoveFile(location); -#endif - } - else if (flags & wxRICHTEXT_HANDLER_SAVE_IMAGES_TO_FILES) - { - if (wxFileExists(location)) - wxRemoveFile(location); - } - } - - return true; -} - - -#endif -// wxUSE_RICHTEXT - diff --git a/wxWidgets/src/richtext/richtextindentspage.cpp b/wxWidgets/src/richtext/richtextindentspage.cpp deleted file mode 100644 index 40bc4ad6db..0000000000 --- a/wxWidgets/src/richtext/richtextindentspage.cpp +++ /dev/null @@ -1,727 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/richtext/richtextindentspage.cpp -// Purpose: -// Author: Julian Smart -// Modified by: -// Created: 10/3/2006 2:28:21 PM -// RCS-ID: $Id: richtextindentspage.cpp 64163 2010-04-27 16:16:21Z JS $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#if wxUSE_RICHTEXT - -#include "wx/richtext/richtextindentspage.h" - -/*! - * wxRichTextIndentsSpacingPage type definition - */ - -IMPLEMENT_DYNAMIC_CLASS( wxRichTextIndentsSpacingPage, wxPanel ) - -/*! - * wxRichTextIndentsSpacingPage event table definition - */ - -BEGIN_EVENT_TABLE( wxRichTextIndentsSpacingPage, wxPanel ) - -////@begin wxRichTextIndentsSpacingPage event table entries - EVT_RADIOBUTTON( ID_RICHTEXTINDENTSSPACINGPAGE_ALIGNMENT_LEFT, wxRichTextIndentsSpacingPage::OnAlignmentLeftSelected ) - - EVT_RADIOBUTTON( ID_RICHTEXTINDENTSSPACINGPAGE_ALIGNMENT_RIGHT, wxRichTextIndentsSpacingPage::OnAlignmentRightSelected ) - - EVT_RADIOBUTTON( ID_RICHTEXTINDENTSSPACINGPAGE_ALIGNMENT_JUSTIFIED, wxRichTextIndentsSpacingPage::OnAlignmentJustifiedSelected ) - - EVT_RADIOBUTTON( ID_RICHTEXTINDENTSSPACINGPAGE_ALIGNMENT_CENTRED, wxRichTextIndentsSpacingPage::OnAlignmentCentredSelected ) - - EVT_RADIOBUTTON( ID_RICHTEXTINDENTSSPACINGPAGE_ALIGNMENT_INDETERMINATE, wxRichTextIndentsSpacingPage::OnAlignmentIndeterminateSelected ) - - EVT_TEXT( ID_RICHTEXTINDENTSSPACINGPAGE_INDENT_LEFT, wxRichTextIndentsSpacingPage::OnIndentLeftUpdated ) - - EVT_TEXT( ID_RICHTEXTINDENTSSPACINGPAGE_INDENT_LEFT_FIRST, wxRichTextIndentsSpacingPage::OnIndentLeftFirstUpdated ) - - EVT_TEXT( ID_RICHTEXTINDENTSSPACINGPAGE_INDENT_RIGHT, wxRichTextIndentsSpacingPage::OnIndentRightUpdated ) - - EVT_COMBOBOX( ID_RICHTEXTINDENTSSPACINGPAGE_OUTLINELEVEL, wxRichTextIndentsSpacingPage::OnRichtextOutlinelevelSelected ) - - EVT_TEXT( ID_RICHTEXTINDENTSSPACINGPAGE_SPACING_BEFORE, wxRichTextIndentsSpacingPage::OnSpacingBeforeUpdated ) - - EVT_TEXT( ID_RICHTEXTINDENTSSPACINGPAGE_SPACING_AFTER, wxRichTextIndentsSpacingPage::OnSpacingAfterUpdated ) - - EVT_COMBOBOX( ID_RICHTEXTINDENTSSPACINGPAGE_SPACING_LINE, wxRichTextIndentsSpacingPage::OnSpacingLineSelected ) - -////@end wxRichTextIndentsSpacingPage event table entries - -END_EVENT_TABLE() - -/*! - * wxRichTextIndentsSpacingPage constructors - */ - -wxRichTextIndentsSpacingPage::wxRichTextIndentsSpacingPage( ) -{ - Init(); -} - -wxRichTextIndentsSpacingPage::wxRichTextIndentsSpacingPage( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style ) -{ - Init(); - Create(parent, id, pos, size, style); -} - -/*! - * Initialise members - */ - -void wxRichTextIndentsSpacingPage::Init() -{ - m_dontUpdate = false; - -////@begin wxRichTextIndentsSpacingPage member initialisation - m_alignmentLeft = NULL; - m_alignmentRight = NULL; - m_alignmentJustified = NULL; - m_alignmentCentred = NULL; - m_alignmentIndeterminate = NULL; - m_indentLeft = NULL; - m_indentLeftFirst = NULL; - m_indentRight = NULL; - m_outlineLevelCtrl = NULL; - m_spacingBefore = NULL; - m_spacingAfter = NULL; - m_spacingLine = NULL; - m_previewCtrl = NULL; -////@end wxRichTextIndentsSpacingPage member initialisation - -} - -/*! - * wxRichTextIndentsSpacingPage creator - */ - -bool wxRichTextIndentsSpacingPage::Create( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style ) -{ -////@begin wxRichTextIndentsSpacingPage creation - wxPanel::Create( parent, id, pos, size, style ); - - CreateControls(); - if (GetSizer()) - { - GetSizer()->SetSizeHints(this); - } - Centre(); -////@end wxRichTextIndentsSpacingPage creation - return true; -} - -/*! - * Control creation for wxRichTextIndentsSpacingPage - */ - -void wxRichTextIndentsSpacingPage::CreateControls() -{ -////@begin wxRichTextIndentsSpacingPage content construction - wxRichTextIndentsSpacingPage* itemPanel1 = this; - - wxBoxSizer* itemBoxSizer2 = new wxBoxSizer(wxVERTICAL); - itemPanel1->SetSizer(itemBoxSizer2); - - wxBoxSizer* itemBoxSizer3 = new wxBoxSizer(wxVERTICAL); - itemBoxSizer2->Add(itemBoxSizer3, 1, wxGROW|wxALL, 5); - - wxBoxSizer* itemBoxSizer4 = new wxBoxSizer(wxHORIZONTAL); - itemBoxSizer3->Add(itemBoxSizer4, 0, wxGROW, 5); - - wxBoxSizer* itemBoxSizer5 = new wxBoxSizer(wxVERTICAL); - itemBoxSizer4->Add(itemBoxSizer5, 0, wxGROW, 5); - - wxStaticText* itemStaticText6 = new wxStaticText( itemPanel1, wxID_STATIC, _("&Alignment"), wxDefaultPosition, wxDefaultSize, 0 ); - itemBoxSizer5->Add(itemStaticText6, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP|wxADJUST_MINSIZE, 5); - - wxBoxSizer* itemBoxSizer7 = new wxBoxSizer(wxHORIZONTAL); - itemBoxSizer5->Add(itemBoxSizer7, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5); - - itemBoxSizer7->Add(5, 5, 0, wxALIGN_CENTER_VERTICAL, 5); - - wxBoxSizer* itemBoxSizer9 = new wxBoxSizer(wxVERTICAL); - itemBoxSizer7->Add(itemBoxSizer9, 0, wxALIGN_CENTER_VERTICAL|wxTOP, 5); - - m_alignmentLeft = new wxRadioButton( itemPanel1, ID_RICHTEXTINDENTSSPACINGPAGE_ALIGNMENT_LEFT, _("&Left"), wxDefaultPosition, wxDefaultSize, wxRB_GROUP ); - m_alignmentLeft->SetValue(false); - m_alignmentLeft->SetHelpText(_("Left-align text.")); - if (wxRichTextIndentsSpacingPage::ShowToolTips()) - m_alignmentLeft->SetToolTip(_("Left-align text.")); - itemBoxSizer9->Add(m_alignmentLeft, 0, wxALIGN_LEFT|wxALL, 5); - - m_alignmentRight = new wxRadioButton( itemPanel1, ID_RICHTEXTINDENTSSPACINGPAGE_ALIGNMENT_RIGHT, _("&Right"), wxDefaultPosition, wxDefaultSize, 0 ); - m_alignmentRight->SetValue(false); - m_alignmentRight->SetHelpText(_("Right-align text.")); - if (wxRichTextIndentsSpacingPage::ShowToolTips()) - m_alignmentRight->SetToolTip(_("Right-align text.")); - itemBoxSizer9->Add(m_alignmentRight, 0, wxALIGN_LEFT|wxALL, 5); - - m_alignmentJustified = new wxRadioButton( itemPanel1, ID_RICHTEXTINDENTSSPACINGPAGE_ALIGNMENT_JUSTIFIED, _("&Justified"), wxDefaultPosition, wxDefaultSize, 0 ); - m_alignmentJustified->SetValue(false); - m_alignmentJustified->SetHelpText(_("Justify text left and right.")); - if (wxRichTextIndentsSpacingPage::ShowToolTips()) - m_alignmentJustified->SetToolTip(_("Justify text left and right.")); - itemBoxSizer9->Add(m_alignmentJustified, 0, wxALIGN_LEFT|wxALL, 5); - - m_alignmentCentred = new wxRadioButton( itemPanel1, ID_RICHTEXTINDENTSSPACINGPAGE_ALIGNMENT_CENTRED, _("Cen&tred"), wxDefaultPosition, wxDefaultSize, 0 ); - m_alignmentCentred->SetValue(false); - m_alignmentCentred->SetHelpText(_("Centre text.")); - if (wxRichTextIndentsSpacingPage::ShowToolTips()) - m_alignmentCentred->SetToolTip(_("Centre text.")); - itemBoxSizer9->Add(m_alignmentCentred, 0, wxALIGN_LEFT|wxALL, 5); - - m_alignmentIndeterminate = new wxRadioButton( itemPanel1, ID_RICHTEXTINDENTSSPACINGPAGE_ALIGNMENT_INDETERMINATE, _("&Indeterminate"), wxDefaultPosition, wxDefaultSize, 0 ); - m_alignmentIndeterminate->SetValue(false); - m_alignmentIndeterminate->SetHelpText(_("Use the current alignment setting.")); - if (wxRichTextIndentsSpacingPage::ShowToolTips()) - m_alignmentIndeterminate->SetToolTip(_("Use the current alignment setting.")); - itemBoxSizer9->Add(m_alignmentIndeterminate, 0, wxALIGN_LEFT|wxALL, 5); - - itemBoxSizer4->Add(2, 1, 1, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM, 5); - - wxStaticLine* itemStaticLine16 = new wxStaticLine( itemPanel1, wxID_STATIC, wxDefaultPosition, wxDefaultSize, wxLI_VERTICAL ); - itemBoxSizer4->Add(itemStaticLine16, 0, wxGROW|wxLEFT|wxBOTTOM, 5); - - itemBoxSizer4->Add(2, 1, 1, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM, 5); - - wxBoxSizer* itemBoxSizer18 = new wxBoxSizer(wxVERTICAL); - itemBoxSizer4->Add(itemBoxSizer18, 0, wxGROW, 5); - - wxStaticText* itemStaticText19 = new wxStaticText( itemPanel1, wxID_STATIC, _("&Indentation (tenths of a mm)"), wxDefaultPosition, wxDefaultSize, 0 ); - itemBoxSizer18->Add(itemStaticText19, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP|wxADJUST_MINSIZE, 5); - - wxBoxSizer* itemBoxSizer20 = new wxBoxSizer(wxHORIZONTAL); - itemBoxSizer18->Add(itemBoxSizer20, 0, wxALIGN_LEFT|wxALL, 5); - - itemBoxSizer20->Add(5, 5, 0, wxALIGN_CENTER_VERTICAL, 5); - - wxFlexGridSizer* itemFlexGridSizer22 = new wxFlexGridSizer(4, 2, 0, 0); - itemBoxSizer20->Add(itemFlexGridSizer22, 0, wxALIGN_CENTER_VERTICAL, 5); - - wxStaticText* itemStaticText23 = new wxStaticText( itemPanel1, wxID_STATIC, _("&Left:"), wxDefaultPosition, wxDefaultSize, 0 ); - itemFlexGridSizer22->Add(itemStaticText23, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxALL|wxADJUST_MINSIZE, 5); - - wxBoxSizer* itemBoxSizer24 = new wxBoxSizer(wxHORIZONTAL); - itemFlexGridSizer22->Add(itemBoxSizer24, 0, wxGROW|wxALIGN_CENTER_VERTICAL, 5); - - m_indentLeft = new wxTextCtrl( itemPanel1, ID_RICHTEXTINDENTSSPACINGPAGE_INDENT_LEFT, wxEmptyString, wxDefaultPosition, wxSize(50, -1), 0 ); - m_indentLeft->SetHelpText(_("The left indent.")); - if (wxRichTextIndentsSpacingPage::ShowToolTips()) - m_indentLeft->SetToolTip(_("The left indent.")); - itemBoxSizer24->Add(m_indentLeft, 1, wxALIGN_CENTER_VERTICAL|wxALL, 5); - - wxStaticText* itemStaticText26 = new wxStaticText( itemPanel1, wxID_STATIC, _("Left (&first line):"), wxDefaultPosition, wxDefaultSize, 0 ); - itemFlexGridSizer22->Add(itemStaticText26, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxALL|wxADJUST_MINSIZE, 5); - - wxBoxSizer* itemBoxSizer27 = new wxBoxSizer(wxHORIZONTAL); - itemFlexGridSizer22->Add(itemBoxSizer27, 0, wxGROW|wxALIGN_CENTER_VERTICAL, 5); - - m_indentLeftFirst = new wxTextCtrl( itemPanel1, ID_RICHTEXTINDENTSSPACINGPAGE_INDENT_LEFT_FIRST, wxEmptyString, wxDefaultPosition, wxSize(50, -1), 0 ); - m_indentLeftFirst->SetHelpText(_("The first line indent.")); - if (wxRichTextIndentsSpacingPage::ShowToolTips()) - m_indentLeftFirst->SetToolTip(_("The first line indent.")); - itemBoxSizer27->Add(m_indentLeftFirst, 1, wxALIGN_CENTER_VERTICAL|wxALL, 5); - - wxStaticText* itemStaticText29 = new wxStaticText( itemPanel1, wxID_STATIC, _("&Right:"), wxDefaultPosition, wxDefaultSize, 0 ); - itemFlexGridSizer22->Add(itemStaticText29, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxALL|wxADJUST_MINSIZE, 5); - - wxBoxSizer* itemBoxSizer30 = new wxBoxSizer(wxHORIZONTAL); - itemFlexGridSizer22->Add(itemBoxSizer30, 0, wxGROW|wxALIGN_CENTER_VERTICAL, 5); - - m_indentRight = new wxTextCtrl( itemPanel1, ID_RICHTEXTINDENTSSPACINGPAGE_INDENT_RIGHT, wxEmptyString, wxDefaultPosition, wxSize(50, -1), 0 ); - m_indentRight->SetHelpText(_("The right indent.")); - if (wxRichTextIndentsSpacingPage::ShowToolTips()) - m_indentRight->SetToolTip(_("The right indent.")); - itemBoxSizer30->Add(m_indentRight, 1, wxALIGN_CENTER_VERTICAL|wxALL, 5); - - wxStaticText* itemStaticText32 = new wxStaticText( itemPanel1, wxID_STATIC, _("&Outline level:"), wxDefaultPosition, wxDefaultSize, 0 ); - itemFlexGridSizer22->Add(itemStaticText32, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxALL|wxADJUST_MINSIZE, 5); - - wxArrayString m_outlineLevelCtrlStrings; - m_outlineLevelCtrlStrings.Add(_("Normal")); - m_outlineLevelCtrlStrings.Add(_("1")); - m_outlineLevelCtrlStrings.Add(_("2")); - m_outlineLevelCtrlStrings.Add(_("3")); - m_outlineLevelCtrlStrings.Add(_("4")); - m_outlineLevelCtrlStrings.Add(_("5")); - m_outlineLevelCtrlStrings.Add(_("6")); - m_outlineLevelCtrlStrings.Add(_("7")); - m_outlineLevelCtrlStrings.Add(_("8")); - m_outlineLevelCtrlStrings.Add(_("9")); - m_outlineLevelCtrl = new wxComboBox( itemPanel1, ID_RICHTEXTINDENTSSPACINGPAGE_OUTLINELEVEL, _("Normal"), wxDefaultPosition, wxSize(90, -1), m_outlineLevelCtrlStrings, wxCB_READONLY ); - m_outlineLevelCtrl->SetStringSelection(_("Normal")); - m_outlineLevelCtrl->SetHelpText(_("The outline level.")); - if (wxRichTextIndentsSpacingPage::ShowToolTips()) - m_outlineLevelCtrl->SetToolTip(_("The outline level.")); - itemFlexGridSizer22->Add(m_outlineLevelCtrl, 1, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5); - - itemBoxSizer4->Add(2, 1, 1, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM, 5); - - wxStaticLine* itemStaticLine35 = new wxStaticLine( itemPanel1, wxID_STATIC, wxDefaultPosition, wxDefaultSize, wxLI_VERTICAL ); - itemBoxSizer4->Add(itemStaticLine35, 0, wxGROW|wxTOP|wxBOTTOM, 5); - - itemBoxSizer4->Add(2, 1, 1, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM, 5); - - wxBoxSizer* itemBoxSizer37 = new wxBoxSizer(wxVERTICAL); - itemBoxSizer4->Add(itemBoxSizer37, 0, wxGROW, 5); - - wxStaticText* itemStaticText38 = new wxStaticText( itemPanel1, wxID_STATIC, _("&Spacing (tenths of a mm)"), wxDefaultPosition, wxDefaultSize, 0 ); - itemBoxSizer37->Add(itemStaticText38, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP|wxADJUST_MINSIZE, 5); - - wxBoxSizer* itemBoxSizer39 = new wxBoxSizer(wxHORIZONTAL); - itemBoxSizer37->Add(itemBoxSizer39, 0, wxALIGN_LEFT|wxALL, 5); - - itemBoxSizer39->Add(5, 5, 0, wxALIGN_CENTER_VERTICAL, 5); - - wxFlexGridSizer* itemFlexGridSizer41 = new wxFlexGridSizer(3, 2, 0, 0); - itemFlexGridSizer41->AddGrowableCol(1); - itemBoxSizer39->Add(itemFlexGridSizer41, 0, wxALIGN_CENTER_VERTICAL, 5); - - wxStaticText* itemStaticText42 = new wxStaticText( itemPanel1, wxID_STATIC, _("&Before a paragraph:"), wxDefaultPosition, wxDefaultSize, 0 ); - itemFlexGridSizer41->Add(itemStaticText42, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxALL|wxADJUST_MINSIZE, 5); - - wxBoxSizer* itemBoxSizer43 = new wxBoxSizer(wxHORIZONTAL); - itemFlexGridSizer41->Add(itemBoxSizer43, 0, wxGROW|wxALIGN_CENTER_VERTICAL, 5); - - m_spacingBefore = new wxTextCtrl( itemPanel1, ID_RICHTEXTINDENTSSPACINGPAGE_SPACING_BEFORE, wxEmptyString, wxDefaultPosition, wxSize(50, -1), 0 ); - m_spacingBefore->SetHelpText(_("The spacing before the paragraph.")); - if (wxRichTextIndentsSpacingPage::ShowToolTips()) - m_spacingBefore->SetToolTip(_("The spacing before the paragraph.")); - itemBoxSizer43->Add(m_spacingBefore, 1, wxALIGN_CENTER_VERTICAL|wxALL, 5); - - wxStaticText* itemStaticText45 = new wxStaticText( itemPanel1, wxID_STATIC, _("&After a paragraph:"), wxDefaultPosition, wxDefaultSize, 0 ); - itemFlexGridSizer41->Add(itemStaticText45, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxALL|wxADJUST_MINSIZE, 5); - - wxBoxSizer* itemBoxSizer46 = new wxBoxSizer(wxHORIZONTAL); - itemFlexGridSizer41->Add(itemBoxSizer46, 1, wxGROW|wxALIGN_CENTER_VERTICAL, 5); - - m_spacingAfter = new wxTextCtrl( itemPanel1, ID_RICHTEXTINDENTSSPACINGPAGE_SPACING_AFTER, wxEmptyString, wxDefaultPosition, wxSize(50, -1), 0 ); - if (wxRichTextIndentsSpacingPage::ShowToolTips()) - m_spacingAfter->SetToolTip(_("The spacing after the paragraph.")); - itemBoxSizer46->Add(m_spacingAfter, 1, wxALIGN_CENTER_VERTICAL|wxALL, 5); - - wxStaticText* itemStaticText48 = new wxStaticText( itemPanel1, wxID_STATIC, _("L&ine spacing:"), wxDefaultPosition, wxDefaultSize, 0 ); - itemFlexGridSizer41->Add(itemStaticText48, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxALL|wxADJUST_MINSIZE, 5); - - wxBoxSizer* itemBoxSizer49 = new wxBoxSizer(wxHORIZONTAL); - itemFlexGridSizer41->Add(itemBoxSizer49, 0, wxGROW|wxALIGN_CENTER_VERTICAL, 5); - - wxArrayString m_spacingLineStrings; - m_spacingLineStrings.Add(_("Single")); - m_spacingLineStrings.Add(_("1.1")); - m_spacingLineStrings.Add(_("1.2")); - m_spacingLineStrings.Add(_("1.3")); - m_spacingLineStrings.Add(_("1.4")); - m_spacingLineStrings.Add(_("1.5")); - m_spacingLineStrings.Add(_("1.6")); - m_spacingLineStrings.Add(_("1.7")); - m_spacingLineStrings.Add(_("1.8")); - m_spacingLineStrings.Add(_("1.9")); - m_spacingLineStrings.Add(_("2")); - m_spacingLine = new wxComboBox( itemPanel1, ID_RICHTEXTINDENTSSPACINGPAGE_SPACING_LINE, _("Single"), wxDefaultPosition, wxSize(90, -1), m_spacingLineStrings, wxCB_READONLY ); - m_spacingLine->SetStringSelection(_("Single")); - m_spacingLine->SetHelpText(_("The line spacing.")); - if (wxRichTextIndentsSpacingPage::ShowToolTips()) - m_spacingLine->SetToolTip(_("The line spacing.")); - itemBoxSizer49->Add(m_spacingLine, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); - - itemBoxSizer3->Add(5, 5, 0, wxALIGN_CENTER_HORIZONTAL, 5); - - m_previewCtrl = new wxRichTextCtrl( itemPanel1, ID_RICHTEXTINDENTSSPACINGPAGE_PREVIEW_CTRL, wxEmptyString, wxDefaultPosition, wxSize(350, 100), wxVSCROLL|wxTE_READONLY ); - m_previewCtrl->SetHelpText(_("Shows a preview of the paragraph settings.")); - if (wxRichTextIndentsSpacingPage::ShowToolTips()) - m_previewCtrl->SetToolTip(_("Shows a preview of the paragraph settings.")); - itemBoxSizer3->Add(m_previewCtrl, 1, wxALIGN_CENTER_HORIZONTAL|wxALL, 5); - -////@end wxRichTextIndentsSpacingPage content construction -} - -wxTextAttrEx* wxRichTextIndentsSpacingPage::GetAttributes() -{ - return wxRichTextFormattingDialog::GetDialogAttributes(this); -} - -/// Updates the font preview -void wxRichTextIndentsSpacingPage::UpdatePreview() -{ - static const wxChar* s_para1 = wxT("Lorem ipsum dolor sit amet, consectetuer adipiscing elit. \ -Nullam ante sapien, vestibulum nonummy, pulvinar sed, luctus ut, lacus.\n"); - - static const wxChar* s_para2 = wxT("Duis pharetra consequat dui. Cum sociis natoque penatibus \ -et magnis dis parturient montes, nascetur ridiculus mus. Nullam vitae justo id mauris lobortis interdum.\n"); - - static const wxChar* s_para3 = wxT("Integer convallis dolor at augue \ -iaculis malesuada. Donec bibendum ipsum ut ante porta fringilla.\n"); - - TransferDataFromWindow(); - wxTextAttrEx attr(*GetAttributes()); - attr.SetFlags(attr.GetFlags() & - (wxTEXT_ATTR_ALIGNMENT|wxTEXT_ATTR_LEFT_INDENT|wxTEXT_ATTR_RIGHT_INDENT|wxTEXT_ATTR_PARA_SPACING_BEFORE|wxTEXT_ATTR_PARA_SPACING_AFTER| - wxTEXT_ATTR_LINE_SPACING| - wxTEXT_ATTR_BULLET_STYLE|wxTEXT_ATTR_BULLET_NUMBER|wxTEXT_ATTR_BULLET_TEXT)); - - wxFont font(m_previewCtrl->GetFont()); - font.SetPointSize(9); - m_previewCtrl->SetFont(font); - - wxTextAttrEx normalParaAttr; - normalParaAttr.SetFont(font); - normalParaAttr.SetTextColour(wxColour(wxT("LIGHT GREY"))); - - m_previewCtrl->Freeze(); - m_previewCtrl->Clear(); - - m_previewCtrl->BeginStyle(normalParaAttr); - m_previewCtrl->WriteText(s_para1); - m_previewCtrl->EndStyle(); - - m_previewCtrl->BeginStyle(attr); - m_previewCtrl->WriteText(s_para2); - m_previewCtrl->EndStyle(); - - m_previewCtrl->BeginStyle(normalParaAttr); - m_previewCtrl->WriteText(s_para3); - m_previewCtrl->EndStyle(); - - m_previewCtrl->Thaw(); -} - -/// Transfer data from/to window -bool wxRichTextIndentsSpacingPage::TransferDataFromWindow() -{ - wxPanel::TransferDataFromWindow(); - - wxTextAttrEx* attr = GetAttributes(); - - if (m_alignmentLeft->GetValue()) - attr->SetAlignment(wxTEXT_ALIGNMENT_LEFT); - else if (m_alignmentCentred->GetValue()) - attr->SetAlignment(wxTEXT_ALIGNMENT_CENTRE); - else if (m_alignmentRight->GetValue()) - attr->SetAlignment(wxTEXT_ALIGNMENT_RIGHT); - else if (m_alignmentJustified->GetValue()) - attr->SetAlignment(wxTEXT_ALIGNMENT_JUSTIFIED); - else - { - attr->SetAlignment(wxTEXT_ALIGNMENT_DEFAULT); - attr->SetFlags(attr->GetFlags() & (~wxTEXT_ATTR_ALIGNMENT)); - } - - wxString leftIndent(m_indentLeft->GetValue()); - wxString leftFirstIndent(m_indentLeftFirst->GetValue()); - if (!leftIndent.empty()) - { - int visualLeftIndent = wxAtoi(leftIndent); - int visualLeftFirstIndent = wxAtoi(leftFirstIndent); - int actualLeftIndent = visualLeftFirstIndent; - int actualLeftSubIndent = visualLeftIndent - visualLeftFirstIndent; - - attr->SetLeftIndent(actualLeftIndent, actualLeftSubIndent); - } - else - attr->SetFlags(attr->GetFlags() & (~wxTEXT_ATTR_LEFT_INDENT)); - - wxString rightIndent(m_indentRight->GetValue()); - if (!rightIndent.empty()) - attr->SetRightIndent(wxAtoi(rightIndent)); - else - attr->SetFlags(attr->GetFlags() & (~wxTEXT_ATTR_RIGHT_INDENT)); - - wxString spacingAfter(m_spacingAfter->GetValue()); - if (!spacingAfter.empty()) - attr->SetParagraphSpacingAfter(wxAtoi(spacingAfter)); - else - attr->SetFlags(attr->GetFlags() & (~wxTEXT_ATTR_PARA_SPACING_AFTER)); - - wxString spacingBefore(m_spacingBefore->GetValue()); - if (!spacingBefore.empty()) - attr->SetParagraphSpacingBefore(wxAtoi(spacingBefore)); - else - attr->SetFlags(attr->GetFlags() & (~wxTEXT_ATTR_PARA_SPACING_BEFORE)); - - int spacingIndex = m_spacingLine->GetSelection(); - int lineSpacing = 0; - if (spacingIndex != -1) - lineSpacing = 10 + spacingIndex; - - if (lineSpacing == 0) - attr->SetFlags(attr->GetFlags() & (~wxTEXT_ATTR_LINE_SPACING)); - else - attr->SetLineSpacing(lineSpacing); - - int outlineLevel = m_outlineLevelCtrl->GetSelection(); - if (outlineLevel != wxNOT_FOUND) - attr->SetOutlineLevel(outlineLevel); - - return true; -} - -bool wxRichTextIndentsSpacingPage::TransferDataToWindow() -{ - m_dontUpdate = true; - - wxPanel::TransferDataToWindow(); - - wxTextAttrEx* attr = GetAttributes(); - - if (attr->HasAlignment()) - { - if (attr->GetAlignment() == wxTEXT_ALIGNMENT_LEFT) - m_alignmentLeft->SetValue(true); - else if (attr->GetAlignment() == wxTEXT_ALIGNMENT_RIGHT) - m_alignmentRight->SetValue(true); - else if (attr->GetAlignment() == wxTEXT_ALIGNMENT_CENTRE) - m_alignmentCentred->SetValue(true); - else if (attr->GetAlignment() == wxTEXT_ALIGNMENT_JUSTIFIED) - m_alignmentJustified->SetValue(true); - else - m_alignmentIndeterminate->SetValue(true); - } - else - m_alignmentIndeterminate->SetValue(true); - - if (attr->HasLeftIndent()) - { - wxString leftIndent(wxString::Format(wxT("%ld"), attr->GetLeftIndent() + attr->GetLeftSubIndent())); - wxString leftFirstIndent(wxString::Format(wxT("%ld"), attr->GetLeftIndent())); - - m_indentLeft->SetValue(leftIndent); - m_indentLeftFirst->SetValue(leftFirstIndent); - } - else - { - m_indentLeft->SetValue(wxEmptyString); - m_indentLeftFirst->SetValue(wxEmptyString); - } - - if (attr->HasRightIndent()) - { - wxString rightIndent(wxString::Format(wxT("%ld"), attr->GetRightIndent())); - - m_indentRight->SetValue(rightIndent); - } - else - m_indentRight->SetValue(wxEmptyString); - - if (attr->HasParagraphSpacingAfter()) - { - wxString spacingAfter(wxString::Format(wxT("%d"), attr->GetParagraphSpacingAfter())); - - m_spacingAfter->SetValue(spacingAfter); - } - else - m_spacingAfter->SetValue(wxEmptyString); - - if (attr->HasParagraphSpacingBefore()) - { - wxString spacingBefore(wxString::Format(wxT("%d"), attr->GetParagraphSpacingBefore())); - - m_spacingBefore->SetValue(spacingBefore); - } - else - m_spacingBefore->SetValue(wxEmptyString); - - if (attr->HasLineSpacing()) - { - int index = 0; - - int lineSpacing = attr->GetLineSpacing(); - if (lineSpacing >= 10 && lineSpacing <= 20) - index = lineSpacing - 10; - else - index = -1; - - m_spacingLine->SetSelection(index); - } - else - m_spacingLine->SetSelection(-1); - - if (attr->HasOutlineLevel()) - { - int outlineLevel = attr->GetOutlineLevel(); - if (outlineLevel < 0) - outlineLevel = 0; - if (outlineLevel > 9) - outlineLevel = 9; - - m_outlineLevelCtrl->SetSelection(outlineLevel); - } - else - m_outlineLevelCtrl->SetSelection(-1); - - UpdatePreview(); - - m_dontUpdate = false; - - return true; -} - - -/*! - * Should we show tooltips? - */ - -bool wxRichTextIndentsSpacingPage::ShowToolTips() -{ - return wxRichTextFormattingDialog::ShowToolTips(); -} - -/*! - * Get bitmap resources - */ - -wxBitmap wxRichTextIndentsSpacingPage::GetBitmapResource( const wxString& name ) -{ - // Bitmap retrieval -////@begin wxRichTextIndentsSpacingPage bitmap retrieval - wxUnusedVar(name); - return wxNullBitmap; -////@end wxRichTextIndentsSpacingPage bitmap retrieval -} - -/*! - * Get icon resources - */ - -wxIcon wxRichTextIndentsSpacingPage::GetIconResource( const wxString& name ) -{ - // Icon retrieval -////@begin wxRichTextIndentsSpacingPage icon retrieval - wxUnusedVar(name); - return wxNullIcon; -////@end wxRichTextIndentsSpacingPage icon retrieval -} -/*! - * wxEVT_COMMAND_RADIOBUTTON_SELECTED event handler for ID_RICHTEXTINDENTSSPACINGPAGE_ALIGNMENT_LEFT - */ - -void wxRichTextIndentsSpacingPage::OnAlignmentLeftSelected( wxCommandEvent& WXUNUSED(event) ) -{ - if (!m_dontUpdate) - UpdatePreview(); -} - - -/*! - * wxEVT_COMMAND_RADIOBUTTON_SELECTED event handler for ID_RICHTEXTINDENTSSPACINGPAGE_ALIGNMENT_RIGHT - */ - -void wxRichTextIndentsSpacingPage::OnAlignmentRightSelected( wxCommandEvent& WXUNUSED(event) ) -{ - if (!m_dontUpdate) - UpdatePreview(); -} - - -/*! - * wxEVT_COMMAND_RADIOBUTTON_SELECTED event handler for ID_RICHTEXTINDENTSSPACINGPAGE_ALIGNMENT_JUSTIFIED - */ - -void wxRichTextIndentsSpacingPage::OnAlignmentJustifiedSelected( wxCommandEvent& WXUNUSED(event) ) -{ - if (!m_dontUpdate) - UpdatePreview(); -} - - -/*! - * wxEVT_COMMAND_RADIOBUTTON_SELECTED event handler for ID_RICHTEXTINDENTSSPACINGPAGE_ALIGNMENT_CENTRED - */ - -void wxRichTextIndentsSpacingPage::OnAlignmentCentredSelected( wxCommandEvent& WXUNUSED(event) ) -{ - if (!m_dontUpdate) - UpdatePreview(); -} - - -/*! - * wxEVT_COMMAND_RADIOBUTTON_SELECTED event handler for ID_RICHTEXTINDENTSSPACINGPAGE_ALIGNMENT_INDETERMINATE - */ - -void wxRichTextIndentsSpacingPage::OnAlignmentIndeterminateSelected( wxCommandEvent& WXUNUSED(event) ) -{ - if (!m_dontUpdate) - UpdatePreview(); -} - - -/*! - * wxEVT_COMMAND_TEXT_UPDATED event handler for ID_RICHTEXTINDENTSSPACINGPAGE_INDENT_LEFT - */ - -void wxRichTextIndentsSpacingPage::OnIndentLeftUpdated( wxCommandEvent& WXUNUSED(event) ) -{ - if (!m_dontUpdate) - UpdatePreview(); -} - - -/*! - * wxEVT_COMMAND_TEXT_UPDATED event handler for ID_RICHTEXTINDENTSSPACINGPAGE_INDENT_LEFT_FIRST - */ - -void wxRichTextIndentsSpacingPage::OnIndentLeftFirstUpdated( wxCommandEvent& WXUNUSED(event) ) -{ - if (!m_dontUpdate) - UpdatePreview(); -} - - -/*! - * wxEVT_COMMAND_TEXT_UPDATED event handler for ID_RICHTEXTINDENTSSPACINGPAGE_INDENT_RIGHT - */ - -void wxRichTextIndentsSpacingPage::OnIndentRightUpdated( wxCommandEvent& WXUNUSED(event) ) -{ - if (!m_dontUpdate) - UpdatePreview(); -} - - -/*! - * wxEVT_COMMAND_TEXT_UPDATED event handler for ID_RICHTEXTINDENTSSPACINGPAGE_SPACING_BEFORE - */ - -void wxRichTextIndentsSpacingPage::OnSpacingBeforeUpdated( wxCommandEvent& WXUNUSED(event) ) -{ - if (!m_dontUpdate) - UpdatePreview(); -} - - -/*! - * wxEVT_COMMAND_TEXT_UPDATED event handler for ID_RICHTEXTINDENTSSPACINGPAGE_SPACING_AFTER - */ - -void wxRichTextIndentsSpacingPage::OnSpacingAfterUpdated( wxCommandEvent& WXUNUSED(event) ) -{ - if (!m_dontUpdate) - UpdatePreview(); -} - -/*! - * wxEVT_COMMAND_COMBOBOX_SELECTED event handler for ID_RICHTEXTINDENTSSPACINGPAGE_SPACING_LINE - */ - -void wxRichTextIndentsSpacingPage::OnSpacingLineSelected( wxCommandEvent& WXUNUSED(event) ) -{ - if (!m_dontUpdate) - UpdatePreview(); -} - -/*! - * wxEVT_COMMAND_COMBOBOX_SELECTED event handler for ID_RICHTEXTINDENTSSPACINGPAGE_OUTLINELEVEL - */ - -void wxRichTextIndentsSpacingPage::OnRichtextOutlinelevelSelected( wxCommandEvent& WXUNUSED(event) ) -{ - if (!m_dontUpdate) - UpdatePreview(); -} - -#endif // wxUSE_RICHTEXT diff --git a/wxWidgets/src/richtext/richtextliststylepage.cpp b/wxWidgets/src/richtext/richtextliststylepage.cpp deleted file mode 100644 index 3957d4e2fd..0000000000 --- a/wxWidgets/src/richtext/richtextliststylepage.cpp +++ /dev/null @@ -1,1361 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/richtext/richtextliststylepage.cpp -// Purpose: -// Author: Julian Smart -// Modified by: -// Created: 10/18/2006 11:36:37 AM -// RCS-ID: $Id: richtextliststylepage.cpp 54423 2008-06-29 17:04:04Z JS $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#include "wx/richtext/richtextliststylepage.h" - -////@begin XPM images -////@end XPM images - -/*! - * wxRichTextListStylePage type definition - */ - -IMPLEMENT_DYNAMIC_CLASS( wxRichTextListStylePage, wxPanel ) - -/*! - * wxRichTextListStylePage event table definition - */ - -BEGIN_EVENT_TABLE( wxRichTextListStylePage, wxPanel ) - -////@begin wxRichTextListStylePage event table entries - EVT_SPINCTRL( ID_RICHTEXTLISTSTYLEPAGE_LEVEL, wxRichTextListStylePage::OnLevelUpdated ) - EVT_SPIN_UP( ID_RICHTEXTLISTSTYLEPAGE_LEVEL, wxRichTextListStylePage::OnLevelUp ) - EVT_SPIN_DOWN( ID_RICHTEXTLISTSTYLEPAGE_LEVEL, wxRichTextListStylePage::OnLevelDown ) - EVT_TEXT( ID_RICHTEXTLISTSTYLEPAGE_LEVEL, wxRichTextListStylePage::OnLevelTextUpdated ) - EVT_UPDATE_UI( ID_RICHTEXTLISTSTYLEPAGE_LEVEL, wxRichTextListStylePage::OnLevelUIUpdate ) - - EVT_BUTTON( ID_RICHTEXTLISTSTYLEPAGE_CHOOSE_FONT, wxRichTextListStylePage::OnChooseFontClick ) - - EVT_LISTBOX( ID_RICHTEXTLISTSTYLEPAGE_STYLELISTBOX, wxRichTextListStylePage::OnStylelistboxSelected ) - - EVT_CHECKBOX( ID_RICHTEXTLISTSTYLEPAGE_PERIODCTRL, wxRichTextListStylePage::OnPeriodctrlClick ) - EVT_UPDATE_UI( ID_RICHTEXTLISTSTYLEPAGE_PERIODCTRL, wxRichTextListStylePage::OnPeriodctrlUpdate ) - - EVT_CHECKBOX( ID_RICHTEXTLISTSTYLEPAGE_PARENTHESESCTRL, wxRichTextListStylePage::OnParenthesesctrlClick ) - EVT_UPDATE_UI( ID_RICHTEXTLISTSTYLEPAGE_PARENTHESESCTRL, wxRichTextListStylePage::OnParenthesesctrlUpdate ) - - EVT_CHECKBOX( ID_RICHTEXTLISTSTYLEPAGE_RIGHTPARENTHESISCTRL, wxRichTextListStylePage::OnRightParenthesisCtrlClick ) - EVT_UPDATE_UI( ID_RICHTEXTLISTSTYLEPAGE_RIGHTPARENTHESISCTRL, wxRichTextListStylePage::OnRightParenthesisCtrlUpdate ) - - EVT_COMBOBOX( ID_RICHTEXTLISTSTYLEPAGE_BULLETALIGNMENTCTRL, wxRichTextListStylePage::OnBulletAlignmentCtrlSelected ) - - EVT_UPDATE_UI( ID_RICHTEXTLISTSTYLEPAGE_SYMBOLSTATIC, wxRichTextListStylePage::OnSymbolstaticUpdate ) - - EVT_COMBOBOX( ID_RICHTEXTLISTSTYLEPAGE_SYMBOLCTRL, wxRichTextListStylePage::OnSymbolctrlSelected ) - EVT_TEXT( ID_RICHTEXTLISTSTYLEPAGE_SYMBOLCTRL, wxRichTextListStylePage::OnSymbolctrlUpdated ) - EVT_UPDATE_UI( ID_RICHTEXTLISTSTYLEPAGE_SYMBOLCTRL, wxRichTextListStylePage::OnSymbolctrlUIUpdate ) - - EVT_BUTTON( ID_RICHTEXTLISTSTYLEPAGE_CHOOSE_SYMBOL, wxRichTextListStylePage::OnChooseSymbolClick ) - EVT_UPDATE_UI( ID_RICHTEXTLISTSTYLEPAGE_CHOOSE_SYMBOL, wxRichTextListStylePage::OnChooseSymbolUpdate ) - - EVT_COMBOBOX( ID_RICHTEXTLISTSTYLEPAGE_SYMBOLFONTCTRL, wxRichTextListStylePage::OnSymbolfontctrlSelected ) - EVT_TEXT( ID_RICHTEXTLISTSTYLEPAGE_SYMBOLFONTCTRL, wxRichTextListStylePage::OnSymbolfontctrlUpdated ) - EVT_UPDATE_UI( ID_RICHTEXTLISTSTYLEPAGE_SYMBOLFONTCTRL, wxRichTextListStylePage::OnSymbolfontctrlUIUpdate ) - - EVT_UPDATE_UI( ID_RICHTEXTLISTSTYLEPAGE_NAMESTATIC, wxRichTextListStylePage::OnNamestaticUpdate ) - - EVT_COMBOBOX( ID_RICHTEXTLISTSTYLEPAGE_NAMECTRL, wxRichTextListStylePage::OnNamectrlSelected ) - EVT_TEXT( ID_RICHTEXTLISTSTYLEPAGE_NAMECTRL, wxRichTextListStylePage::OnNamectrlUpdated ) - EVT_UPDATE_UI( ID_RICHTEXTLISTSTYLEPAGE_NAMECTRL, wxRichTextListStylePage::OnNamectrlUIUpdate ) - - EVT_RADIOBUTTON( ID_RICHTEXTLISTSTYLEPAGE_ALIGNLEFT, wxRichTextListStylePage::OnRichtextliststylepageAlignleftSelected ) - - EVT_RADIOBUTTON( ID_RICHTEXTLISTSTYLEPAGE_ALIGNRIGHT, wxRichTextListStylePage::OnRichtextliststylepageAlignrightSelected ) - - EVT_RADIOBUTTON( ID_RICHTEXTLISTSTYLEPAGE_JUSTIFIED, wxRichTextListStylePage::OnRichtextliststylepageJustifiedSelected ) - - EVT_RADIOBUTTON( ID_RICHTEXTLISTSTYLEPAGE_CENTERED, wxRichTextListStylePage::OnRichtextliststylepageCenteredSelected ) - - EVT_RADIOBUTTON( ID_RICHTEXTLISTSTYLEPAGE_ALIGNINDETERMINATE, wxRichTextListStylePage::OnRichtextliststylepageAlignindeterminateSelected ) - - EVT_TEXT( ID_RICHTEXTLISTSTYLEPAGE_INDENTLEFT, wxRichTextListStylePage::OnIndentLeftUpdated ) - - EVT_TEXT( ID_RICHTEXTLISTSTYLEPAGE_INDENTFIRSTLINE, wxRichTextListStylePage::OnIndentFirstLineUpdated ) - - EVT_TEXT( ID_RICHTEXTLISTSTYLEPAGE_INDENTRIGHT, wxRichTextListStylePage::OnIndentRightUpdated ) - - EVT_TEXT( ID_RICHTEXTLISTSTYLEPAGE_SPACINGBEFORE, wxRichTextListStylePage::OnSpacingBeforeUpdated ) - - EVT_TEXT( ID_RICHTEXTLISTSTYLEPAGE_SPACINGAFTER, wxRichTextListStylePage::OnSpacingAfterUpdated ) - - EVT_COMBOBOX( ID_RICHTEXTLISTSTYLEPAGE_LINESPACING, wxRichTextListStylePage::OnLineSpacingSelected ) - -////@end wxRichTextListStylePage event table entries - -END_EVENT_TABLE() - -/*! - * wxRichTextListStylePage constructors - */ - -wxRichTextListStylePage::wxRichTextListStylePage( ) -{ - Init(); -} - -wxRichTextListStylePage::wxRichTextListStylePage( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style ) -{ - Init(); - Create(parent, id, pos, size, style); -} - -/*! - * wxRichTextListStylePage creator - */ - -bool wxRichTextListStylePage::Create( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style ) -{ -////@begin wxRichTextListStylePage creation - wxPanel::Create( parent, id, pos, size, style ); - - CreateControls(); - if (GetSizer()) - { - GetSizer()->SetSizeHints(this); - } - Centre(); -////@end wxRichTextListStylePage creation - return true; -} - -/*! - * Member initialisation - */ - -void wxRichTextListStylePage::Init() -{ - m_dontUpdate = false; - m_currentLevel = 1; - -////@begin wxRichTextListStylePage member initialisation - m_levelCtrl = NULL; - m_styleListBox = NULL; - m_periodCtrl = NULL; - m_parenthesesCtrl = NULL; - m_rightParenthesisCtrl = NULL; - m_bulletAlignmentCtrl = NULL; - m_symbolCtrl = NULL; - m_symbolFontCtrl = NULL; - m_bulletNameCtrl = NULL; - m_alignmentLeft = NULL; - m_alignmentRight = NULL; - m_alignmentJustified = NULL; - m_alignmentCentred = NULL; - m_alignmentIndeterminate = NULL; - m_indentLeft = NULL; - m_indentLeftFirst = NULL; - m_indentRight = NULL; - m_spacingBefore = NULL; - m_spacingAfter = NULL; - m_spacingLine = NULL; - m_previewCtrl = NULL; -////@end wxRichTextListStylePage member initialisation -} - -/*! - * Control creation for wxRichTextListStylePage - */ - -void wxRichTextListStylePage::CreateControls() -{ -////@begin wxRichTextListStylePage content construction - wxRichTextListStylePage* itemPanel1 = this; - - wxBoxSizer* itemBoxSizer2 = new wxBoxSizer(wxVERTICAL); - itemPanel1->SetSizer(itemBoxSizer2); - - wxBoxSizer* itemBoxSizer3 = new wxBoxSizer(wxVERTICAL); - itemBoxSizer2->Add(itemBoxSizer3, 1, wxGROW|wxALL, 5); - - wxBoxSizer* itemBoxSizer4 = new wxBoxSizer(wxHORIZONTAL); - itemBoxSizer3->Add(itemBoxSizer4, 0, wxALIGN_CENTER_HORIZONTAL, 5); - - wxStaticText* itemStaticText5 = new wxStaticText( itemPanel1, wxID_STATIC, _("&List level:"), wxDefaultPosition, wxDefaultSize, 0 ); - itemBoxSizer4->Add(itemStaticText5, 0, wxALIGN_CENTER_VERTICAL|wxALL|wxADJUST_MINSIZE, 5); - - m_levelCtrl = new wxSpinCtrl( itemPanel1, ID_RICHTEXTLISTSTYLEPAGE_LEVEL, _T("1"), wxDefaultPosition, wxSize(60, -1), wxSP_ARROW_KEYS, 1, 10, 1 ); - m_levelCtrl->SetHelpText(_("Selects the list level to edit.")); - if (wxRichTextListStylePage::ShowToolTips()) - m_levelCtrl->SetToolTip(_("Selects the list level to edit.")); - itemBoxSizer4->Add(m_levelCtrl, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); - - itemBoxSizer4->Add(5, 5, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); - - wxButton* itemButton8 = new wxButton( itemPanel1, ID_RICHTEXTLISTSTYLEPAGE_CHOOSE_FONT, _("&Font for Level..."), wxDefaultPosition, wxDefaultSize, 0 ); - itemButton8->SetHelpText(_("Click to choose the font for this level.")); - if (wxRichTextListStylePage::ShowToolTips()) - itemButton8->SetToolTip(_("Click to choose the font for this level.")); - itemBoxSizer4->Add(itemButton8, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); - - wxNotebook* itemNotebook9 = new wxNotebook( itemPanel1, ID_RICHTEXTLISTSTYLEPAGE_NOTEBOOK, wxDefaultPosition, wxDefaultSize, wxNB_DEFAULT|wxNB_TOP ); - - wxPanel* itemPanel10 = new wxPanel( itemNotebook9, ID_RICHTEXTLISTSTYLEPAGE_BULLETS, wxDefaultPosition, wxDefaultSize, wxNO_BORDER|wxTAB_TRAVERSAL ); - wxBoxSizer* itemBoxSizer11 = new wxBoxSizer(wxVERTICAL); - itemPanel10->SetSizer(itemBoxSizer11); - - wxBoxSizer* itemBoxSizer12 = new wxBoxSizer(wxHORIZONTAL); - itemBoxSizer11->Add(itemBoxSizer12, 1, wxGROW, 5); - wxBoxSizer* itemBoxSizer13 = new wxBoxSizer(wxVERTICAL); - itemBoxSizer12->Add(itemBoxSizer13, 0, wxGROW, 5); - wxStaticText* itemStaticText14 = new wxStaticText( itemPanel10, wxID_STATIC, _("&Bullet style:"), wxDefaultPosition, wxDefaultSize, 0 ); - itemBoxSizer13->Add(itemStaticText14, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP|wxADJUST_MINSIZE, 5); - - wxArrayString m_styleListBoxStrings; - m_styleListBox = new wxListBox( itemPanel10, ID_RICHTEXTLISTSTYLEPAGE_STYLELISTBOX, wxDefaultPosition, wxSize(-1, 90), m_styleListBoxStrings, wxLB_SINGLE ); - m_styleListBox->SetHelpText(_("The available bullet styles.")); - if (wxRichTextListStylePage::ShowToolTips()) - m_styleListBox->SetToolTip(_("The available bullet styles.")); - itemBoxSizer13->Add(m_styleListBox, 1, wxGROW|wxALL, 5); - - wxBoxSizer* itemBoxSizer16 = new wxBoxSizer(wxHORIZONTAL); - itemBoxSizer13->Add(itemBoxSizer16, 0, wxGROW, 5); - m_periodCtrl = new wxCheckBox( itemPanel10, ID_RICHTEXTLISTSTYLEPAGE_PERIODCTRL, _("Peri&od"), wxDefaultPosition, wxDefaultSize, 0 ); - m_periodCtrl->SetValue(false); - m_periodCtrl->SetHelpText(_("Check to add a period after the bullet.")); - if (wxRichTextListStylePage::ShowToolTips()) - m_periodCtrl->SetToolTip(_("Check to add a period after the bullet.")); - itemBoxSizer16->Add(m_periodCtrl, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); - - m_parenthesesCtrl = new wxCheckBox( itemPanel10, ID_RICHTEXTLISTSTYLEPAGE_PARENTHESESCTRL, _("(*)"), wxDefaultPosition, wxDefaultSize, 0 ); - m_parenthesesCtrl->SetValue(false); - m_parenthesesCtrl->SetHelpText(_("Check to enclose the bullet in parentheses.")); - if (wxRichTextListStylePage::ShowToolTips()) - m_parenthesesCtrl->SetToolTip(_("Check to enclose the bullet in parentheses.")); - itemBoxSizer16->Add(m_parenthesesCtrl, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); - - m_rightParenthesisCtrl = new wxCheckBox( itemPanel10, ID_RICHTEXTLISTSTYLEPAGE_RIGHTPARENTHESISCTRL, _("*)"), wxDefaultPosition, wxDefaultSize, 0 ); - m_rightParenthesisCtrl->SetValue(false); - m_rightParenthesisCtrl->SetHelpText(_("Check to add a right parenthesis.")); - if (wxRichTextListStylePage::ShowToolTips()) - m_rightParenthesisCtrl->SetToolTip(_("Check to add a right parenthesis.")); - itemBoxSizer16->Add(m_rightParenthesisCtrl, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); - - itemBoxSizer13->Add(2, 1, 0, wxALIGN_CENTER_HORIZONTAL, 5); - - wxStaticText* itemStaticText21 = new wxStaticText( itemPanel10, wxID_STATIC, _("Bullet &Alignment:"), wxDefaultPosition, wxDefaultSize, 0 ); - itemBoxSizer13->Add(itemStaticText21, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP|wxADJUST_MINSIZE, 5); - - wxArrayString m_bulletAlignmentCtrlStrings; - m_bulletAlignmentCtrlStrings.Add(_("Left")); - m_bulletAlignmentCtrlStrings.Add(_("Centre")); - m_bulletAlignmentCtrlStrings.Add(_("Right")); - m_bulletAlignmentCtrl = new wxComboBox( itemPanel10, ID_RICHTEXTLISTSTYLEPAGE_BULLETALIGNMENTCTRL, _("Left"), wxDefaultPosition, wxSize(60, -1), m_bulletAlignmentCtrlStrings, wxCB_READONLY ); - m_bulletAlignmentCtrl->SetStringSelection(_("Left")); - m_bulletAlignmentCtrl->SetHelpText(_("The bullet character.")); - if (wxRichTextListStylePage::ShowToolTips()) - m_bulletAlignmentCtrl->SetToolTip(_("The bullet character.")); - itemBoxSizer13->Add(m_bulletAlignmentCtrl, 0, wxGROW|wxALL|wxFIXED_MINSIZE, 5); - - itemBoxSizer12->Add(2, 1, 1, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM, 5); - - wxStaticLine* itemStaticLine24 = new wxStaticLine( itemPanel10, wxID_STATIC, wxDefaultPosition, wxDefaultSize, wxLI_VERTICAL ); - itemBoxSizer12->Add(itemStaticLine24, 0, wxGROW|wxALL, 5); - - itemBoxSizer12->Add(2, 1, 1, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM, 5); - - wxBoxSizer* itemBoxSizer26 = new wxBoxSizer(wxVERTICAL); - itemBoxSizer12->Add(itemBoxSizer26, 0, wxGROW, 5); - wxStaticText* itemStaticText27 = new wxStaticText( itemPanel10, ID_RICHTEXTLISTSTYLEPAGE_SYMBOLSTATIC, _("&Symbol:"), wxDefaultPosition, wxDefaultSize, 0 ); - itemBoxSizer26->Add(itemStaticText27, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP|wxADJUST_MINSIZE, 5); - - wxBoxSizer* itemBoxSizer28 = new wxBoxSizer(wxHORIZONTAL); - itemBoxSizer26->Add(itemBoxSizer28, 0, wxGROW, 5); - wxArrayString m_symbolCtrlStrings; - m_symbolCtrl = new wxComboBox( itemPanel10, ID_RICHTEXTLISTSTYLEPAGE_SYMBOLCTRL, _T(""), wxDefaultPosition, wxSize(60, -1), m_symbolCtrlStrings, wxCB_DROPDOWN ); - m_symbolCtrl->SetHelpText(_("The bullet character.")); - if (wxRichTextListStylePage::ShowToolTips()) - m_symbolCtrl->SetToolTip(_("The bullet character.")); - itemBoxSizer28->Add(m_symbolCtrl, 0, wxALIGN_CENTER_VERTICAL|wxALL|wxFIXED_MINSIZE, 5); - - wxButton* itemButton30 = new wxButton( itemPanel10, ID_RICHTEXTLISTSTYLEPAGE_CHOOSE_SYMBOL, _("Ch&oose..."), wxDefaultPosition, wxDefaultSize, 0 ); - itemButton30->SetHelpText(_("Click to browse for a symbol.")); - if (wxRichTextListStylePage::ShowToolTips()) - itemButton30->SetToolTip(_("Click to browse for a symbol.")); - itemBoxSizer28->Add(itemButton30, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); - - itemBoxSizer26->Add(5, 5, 0, wxALIGN_CENTER_HORIZONTAL, 5); - - wxStaticText* itemStaticText32 = new wxStaticText( itemPanel10, ID_RICHTEXTLISTSTYLEPAGE_SYMBOLSTATIC, _("Symbol &font:"), wxDefaultPosition, wxDefaultSize, 0 ); - itemBoxSizer26->Add(itemStaticText32, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP|wxADJUST_MINSIZE, 5); - - wxArrayString m_symbolFontCtrlStrings; - m_symbolFontCtrl = new wxComboBox( itemPanel10, ID_RICHTEXTLISTSTYLEPAGE_SYMBOLFONTCTRL, _T(""), wxDefaultPosition, wxDefaultSize, m_symbolFontCtrlStrings, wxCB_DROPDOWN ); - if (wxRichTextListStylePage::ShowToolTips()) - m_symbolFontCtrl->SetToolTip(_("Available fonts.")); - itemBoxSizer26->Add(m_symbolFontCtrl, 0, wxGROW|wxALL, 5); - - itemBoxSizer26->Add(5, 5, 1, wxALIGN_CENTER_HORIZONTAL, 5); - - wxStaticText* itemStaticText35 = new wxStaticText( itemPanel10, ID_RICHTEXTLISTSTYLEPAGE_NAMESTATIC, _("S&tandard bullet name:"), wxDefaultPosition, wxDefaultSize, 0 ); - itemBoxSizer26->Add(itemStaticText35, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP|wxADJUST_MINSIZE, 5); - - wxArrayString m_bulletNameCtrlStrings; - m_bulletNameCtrl = new wxComboBox( itemPanel10, ID_RICHTEXTLISTSTYLEPAGE_NAMECTRL, _T(""), wxDefaultPosition, wxDefaultSize, m_bulletNameCtrlStrings, wxCB_DROPDOWN ); - m_bulletNameCtrl->SetHelpText(_("A standard bullet name.")); - if (wxRichTextListStylePage::ShowToolTips()) - m_bulletNameCtrl->SetToolTip(_("A standard bullet name.")); - itemBoxSizer26->Add(m_bulletNameCtrl, 0, wxGROW|wxALL, 5); - - itemNotebook9->AddPage(itemPanel10, _("Bullet style")); - - wxPanel* itemPanel37 = new wxPanel( itemNotebook9, ID_RICHTEXTLISTSTYLEPAGE_SPACING, wxDefaultPosition, wxDefaultSize, wxNO_BORDER|wxTAB_TRAVERSAL ); - wxBoxSizer* itemBoxSizer38 = new wxBoxSizer(wxVERTICAL); - itemPanel37->SetSizer(itemBoxSizer38); - - wxBoxSizer* itemBoxSizer39 = new wxBoxSizer(wxHORIZONTAL); - itemBoxSizer38->Add(itemBoxSizer39, 0, wxGROW, 5); - wxBoxSizer* itemBoxSizer40 = new wxBoxSizer(wxVERTICAL); - itemBoxSizer39->Add(itemBoxSizer40, 0, wxGROW, 5); - wxStaticText* itemStaticText41 = new wxStaticText( itemPanel37, wxID_STATIC, _("&Alignment"), wxDefaultPosition, wxDefaultSize, 0 ); - itemBoxSizer40->Add(itemStaticText41, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP|wxADJUST_MINSIZE, 5); - - wxBoxSizer* itemBoxSizer42 = new wxBoxSizer(wxHORIZONTAL); - itemBoxSizer40->Add(itemBoxSizer42, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5); - itemBoxSizer42->Add(5, 5, 0, wxALIGN_CENTER_VERTICAL, 5); - - wxBoxSizer* itemBoxSizer44 = new wxBoxSizer(wxVERTICAL); - itemBoxSizer42->Add(itemBoxSizer44, 0, wxALIGN_CENTER_VERTICAL|wxTOP, 5); - m_alignmentLeft = new wxRadioButton( itemPanel37, ID_RICHTEXTLISTSTYLEPAGE_ALIGNLEFT, _("&Left"), wxDefaultPosition, wxDefaultSize, wxRB_GROUP ); - m_alignmentLeft->SetValue(false); - m_alignmentLeft->SetHelpText(_("Left-align text.")); - if (wxRichTextListStylePage::ShowToolTips()) - m_alignmentLeft->SetToolTip(_("Left-align text.")); - itemBoxSizer44->Add(m_alignmentLeft, 0, wxALIGN_LEFT|wxALL, 5); - - m_alignmentRight = new wxRadioButton( itemPanel37, ID_RICHTEXTLISTSTYLEPAGE_ALIGNRIGHT, _("&Right"), wxDefaultPosition, wxDefaultSize, 0 ); - m_alignmentRight->SetValue(false); - m_alignmentRight->SetHelpText(_("Right-align text.")); - if (wxRichTextListStylePage::ShowToolTips()) - m_alignmentRight->SetToolTip(_("Right-align text.")); - itemBoxSizer44->Add(m_alignmentRight, 0, wxALIGN_LEFT|wxALL, 5); - - m_alignmentJustified = new wxRadioButton( itemPanel37, ID_RICHTEXTLISTSTYLEPAGE_JUSTIFIED, _("&Justified"), wxDefaultPosition, wxDefaultSize, 0 ); - m_alignmentJustified->SetValue(false); - m_alignmentJustified->SetHelpText(_("Justify text left and right.")); - if (wxRichTextListStylePage::ShowToolTips()) - m_alignmentJustified->SetToolTip(_("Justify text left and right.")); - itemBoxSizer44->Add(m_alignmentJustified, 0, wxALIGN_LEFT|wxALL, 5); - - m_alignmentCentred = new wxRadioButton( itemPanel37, ID_RICHTEXTLISTSTYLEPAGE_CENTERED, _("Cen&tred"), wxDefaultPosition, wxDefaultSize, 0 ); - m_alignmentCentred->SetValue(false); - m_alignmentCentred->SetHelpText(_("Centre text.")); - if (wxRichTextListStylePage::ShowToolTips()) - m_alignmentCentred->SetToolTip(_("Centre text.")); - itemBoxSizer44->Add(m_alignmentCentred, 0, wxALIGN_LEFT|wxALL, 5); - - m_alignmentIndeterminate = new wxRadioButton( itemPanel37, ID_RICHTEXTLISTSTYLEPAGE_ALIGNINDETERMINATE, _("&Indeterminate"), wxDefaultPosition, wxDefaultSize, 0 ); - m_alignmentIndeterminate->SetValue(false); - m_alignmentIndeterminate->SetHelpText(_("Use the current alignment setting.")); - if (wxRichTextListStylePage::ShowToolTips()) - m_alignmentIndeterminate->SetToolTip(_("Use the current alignment setting.")); - itemBoxSizer44->Add(m_alignmentIndeterminate, 0, wxALIGN_LEFT|wxALL, 5); - - itemBoxSizer39->Add(2, 1, 1, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM, 5); - - wxStaticLine* itemStaticLine51 = new wxStaticLine( itemPanel37, wxID_STATIC, wxDefaultPosition, wxDefaultSize, wxLI_VERTICAL ); - itemBoxSizer39->Add(itemStaticLine51, 0, wxGROW|wxLEFT|wxBOTTOM, 5); - - itemBoxSizer39->Add(2, 1, 1, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM, 5); - - wxBoxSizer* itemBoxSizer53 = new wxBoxSizer(wxVERTICAL); - itemBoxSizer39->Add(itemBoxSizer53, 0, wxGROW, 5); - wxStaticText* itemStaticText54 = new wxStaticText( itemPanel37, wxID_STATIC, _("&Indentation (tenths of a mm)"), wxDefaultPosition, wxDefaultSize, 0 ); - itemBoxSizer53->Add(itemStaticText54, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP|wxADJUST_MINSIZE, 5); - - wxBoxSizer* itemBoxSizer55 = new wxBoxSizer(wxHORIZONTAL); - itemBoxSizer53->Add(itemBoxSizer55, 0, wxALIGN_LEFT|wxALL, 5); - itemBoxSizer55->Add(5, 5, 0, wxALIGN_CENTER_VERTICAL, 5); - - wxFlexGridSizer* itemFlexGridSizer57 = new wxFlexGridSizer(2, 2, 0, 0); - itemBoxSizer55->Add(itemFlexGridSizer57, 0, wxALIGN_CENTER_VERTICAL, 5); - wxStaticText* itemStaticText58 = new wxStaticText( itemPanel37, wxID_STATIC, _("&Left:"), wxDefaultPosition, wxDefaultSize, 0 ); - itemFlexGridSizer57->Add(itemStaticText58, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxALL|wxADJUST_MINSIZE, 5); - - wxBoxSizer* itemBoxSizer59 = new wxBoxSizer(wxHORIZONTAL); - itemFlexGridSizer57->Add(itemBoxSizer59, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5); - m_indentLeft = new wxTextCtrl( itemPanel37, ID_RICHTEXTLISTSTYLEPAGE_INDENTLEFT, _T(""), wxDefaultPosition, wxSize(50, -1), 0 ); - m_indentLeft->SetHelpText(_("The left indent.")); - if (wxRichTextListStylePage::ShowToolTips()) - m_indentLeft->SetToolTip(_("The left indent.")); - itemBoxSizer59->Add(m_indentLeft, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); - - wxStaticText* itemStaticText61 = new wxStaticText( itemPanel37, wxID_STATIC, _("Left (&first line):"), wxDefaultPosition, wxDefaultSize, 0 ); - itemFlexGridSizer57->Add(itemStaticText61, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxALL|wxADJUST_MINSIZE, 5); - - wxBoxSizer* itemBoxSizer62 = new wxBoxSizer(wxHORIZONTAL); - itemFlexGridSizer57->Add(itemBoxSizer62, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5); - m_indentLeftFirst = new wxTextCtrl( itemPanel37, ID_RICHTEXTLISTSTYLEPAGE_INDENTFIRSTLINE, _T(""), wxDefaultPosition, wxSize(50, -1), 0 ); - m_indentLeftFirst->SetHelpText(_("The first line indent.")); - if (wxRichTextListStylePage::ShowToolTips()) - m_indentLeftFirst->SetToolTip(_("The first line indent.")); - itemBoxSizer62->Add(m_indentLeftFirst, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); - - wxStaticText* itemStaticText64 = new wxStaticText( itemPanel37, wxID_STATIC, _("&Right:"), wxDefaultPosition, wxDefaultSize, 0 ); - itemFlexGridSizer57->Add(itemStaticText64, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxALL|wxADJUST_MINSIZE, 5); - - wxBoxSizer* itemBoxSizer65 = new wxBoxSizer(wxHORIZONTAL); - itemFlexGridSizer57->Add(itemBoxSizer65, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5); - m_indentRight = new wxTextCtrl( itemPanel37, ID_RICHTEXTLISTSTYLEPAGE_INDENTRIGHT, _T(""), wxDefaultPosition, wxSize(50, -1), 0 ); - m_indentRight->SetHelpText(_("The right indent.")); - if (wxRichTextListStylePage::ShowToolTips()) - m_indentRight->SetToolTip(_("The right indent.")); - itemBoxSizer65->Add(m_indentRight, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); - - itemBoxSizer39->Add(2, 1, 1, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM, 5); - - wxStaticLine* itemStaticLine68 = new wxStaticLine( itemPanel37, wxID_STATIC, wxDefaultPosition, wxDefaultSize, wxLI_VERTICAL ); - itemBoxSizer39->Add(itemStaticLine68, 0, wxGROW|wxTOP|wxBOTTOM, 5); - - itemBoxSizer39->Add(2, 1, 1, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM, 5); - - wxBoxSizer* itemBoxSizer70 = new wxBoxSizer(wxVERTICAL); - itemBoxSizer39->Add(itemBoxSizer70, 0, wxGROW, 5); - wxStaticText* itemStaticText71 = new wxStaticText( itemPanel37, wxID_STATIC, _("&Spacing (tenths of a mm)"), wxDefaultPosition, wxDefaultSize, 0 ); - itemBoxSizer70->Add(itemStaticText71, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP|wxADJUST_MINSIZE, 5); - - wxBoxSizer* itemBoxSizer72 = new wxBoxSizer(wxHORIZONTAL); - itemBoxSizer70->Add(itemBoxSizer72, 0, wxALIGN_LEFT|wxALL, 5); - itemBoxSizer72->Add(5, 5, 0, wxALIGN_CENTER_VERTICAL, 5); - - wxFlexGridSizer* itemFlexGridSizer74 = new wxFlexGridSizer(2, 2, 0, 0); - itemBoxSizer72->Add(itemFlexGridSizer74, 0, wxALIGN_CENTER_VERTICAL, 5); - wxStaticText* itemStaticText75 = new wxStaticText( itemPanel37, wxID_STATIC, _("Before a paragraph:"), wxDefaultPosition, wxDefaultSize, 0 ); - itemFlexGridSizer74->Add(itemStaticText75, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxALL|wxADJUST_MINSIZE, 5); - - wxBoxSizer* itemBoxSizer76 = new wxBoxSizer(wxHORIZONTAL); - itemFlexGridSizer74->Add(itemBoxSizer76, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5); - m_spacingBefore = new wxTextCtrl( itemPanel37, ID_RICHTEXTLISTSTYLEPAGE_SPACINGBEFORE, _T(""), wxDefaultPosition, wxSize(50, -1), 0 ); - m_spacingBefore->SetHelpText(_("The spacing before the paragraph.")); - if (wxRichTextListStylePage::ShowToolTips()) - m_spacingBefore->SetToolTip(_("The spacing before the paragraph.")); - itemBoxSizer76->Add(m_spacingBefore, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); - - wxStaticText* itemStaticText78 = new wxStaticText( itemPanel37, wxID_STATIC, _("After a paragraph:"), wxDefaultPosition, wxDefaultSize, 0 ); - itemFlexGridSizer74->Add(itemStaticText78, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxALL|wxADJUST_MINSIZE, 5); - - wxBoxSizer* itemBoxSizer79 = new wxBoxSizer(wxHORIZONTAL); - itemFlexGridSizer74->Add(itemBoxSizer79, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5); - m_spacingAfter = new wxTextCtrl( itemPanel37, ID_RICHTEXTLISTSTYLEPAGE_SPACINGAFTER, _T(""), wxDefaultPosition, wxSize(50, -1), 0 ); - m_spacingAfter->SetHelpText(_("The spacing after the paragraph.")); - if (wxRichTextListStylePage::ShowToolTips()) - m_spacingAfter->SetToolTip(_("The spacing after the paragraph.")); - itemBoxSizer79->Add(m_spacingAfter, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); - - wxStaticText* itemStaticText81 = new wxStaticText( itemPanel37, wxID_STATIC, _("Line spacing:"), wxDefaultPosition, wxDefaultSize, 0 ); - itemFlexGridSizer74->Add(itemStaticText81, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxALL|wxADJUST_MINSIZE, 5); - - wxBoxSizer* itemBoxSizer82 = new wxBoxSizer(wxHORIZONTAL); - itemFlexGridSizer74->Add(itemBoxSizer82, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5); - wxArrayString m_spacingLineStrings; - m_spacingLineStrings.Add(_("Single")); - m_spacingLineStrings.Add(_("1.5")); - m_spacingLineStrings.Add(_("2")); - m_spacingLine = new wxComboBox( itemPanel37, ID_RICHTEXTLISTSTYLEPAGE_LINESPACING, _("Single"), wxDefaultPosition, wxDefaultSize, m_spacingLineStrings, wxCB_READONLY ); - m_spacingLine->SetStringSelection(_("Single")); - m_spacingLine->SetHelpText(_("The line spacing.")); - if (wxRichTextListStylePage::ShowToolTips()) - m_spacingLine->SetToolTip(_("The line spacing.")); - itemBoxSizer82->Add(m_spacingLine, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); - - itemNotebook9->AddPage(itemPanel37, _("Spacing")); - - itemBoxSizer3->Add(itemNotebook9, 0, wxGROW|wxALL, 5); - - m_previewCtrl = new wxRichTextCtrl( itemPanel1, ID_RICHTEXTLISTSTYLEPAGE_RICHTEXTCTRL, wxEmptyString, wxDefaultPosition, wxSize(350, 100), wxVSCROLL|wxTE_READONLY ); - m_previewCtrl->SetHelpText(_("Shows a preview of the bullet settings.")); - if (wxRichTextListStylePage::ShowToolTips()) - m_previewCtrl->SetToolTip(_("Shows a preview of the bullet settings.")); - itemBoxSizer3->Add(m_previewCtrl, 1, wxGROW|wxLEFT|wxRIGHT|wxBOTTOM, 5); - -////@end wxRichTextListStylePage content construction - - m_dontUpdate = true; - - m_styleListBox->Append(_("(None)")); - m_styleListBox->Append(_("Arabic")); - m_styleListBox->Append(_("Upper case letters")); - m_styleListBox->Append(_("Lower case letters")); - m_styleListBox->Append(_("Upper case roman numerals")); - m_styleListBox->Append(_("Lower case roman numerals")); - m_styleListBox->Append(_("Numbered outline")); - m_styleListBox->Append(_("Symbol")); - m_styleListBox->Append(_("Bitmap")); - m_styleListBox->Append(_("Standard")); - - m_symbolCtrl->Append(_("*")); - m_symbolCtrl->Append(_("-")); - m_symbolCtrl->Append(_(">")); - m_symbolCtrl->Append(_("+")); - m_symbolCtrl->Append(_("~")); - - wxArrayString standardBulletNames; - if (wxRichTextBuffer::GetRenderer()) - wxRichTextBuffer::GetRenderer()->EnumerateStandardBulletNames(standardBulletNames); - - m_bulletNameCtrl->Append(standardBulletNames); - wxArrayString facenames = wxRichTextCtrl::GetAvailableFontNames(); - facenames.Sort(); - - m_symbolFontCtrl->Append(facenames); - - m_levelCtrl->SetValue(m_currentLevel); - - m_dontUpdate = false; -} - -/// Updates the font preview -void wxRichTextListStylePage::UpdatePreview() -{ - static const wxChar* s_para1 = wxT("Lorem ipsum dolor sit amet, consectetuer adipiscing elit. \ -Nullam ante sapien, vestibulum nonummy, pulvinar sed, luctus ut, lacus.\n"); - - static const wxChar* s_para2 = wxT("Duis pharetra consequat dui. Nullam vitae justo id mauris lobortis interdum.\n"); - - static const wxChar* s_para3 = wxT("Integer convallis dolor at augue \ -iaculis malesuada. Donec bibendum ipsum ut ante porta fringilla.\n"); - - wxRichTextListStyleDefinition* def = wxDynamicCast(wxRichTextFormattingDialog::GetDialogStyleDefinition(this), - wxRichTextListStyleDefinition); - - wxRichTextStyleSheet* styleSheet = wxRichTextFormattingDialog::GetDialog(this)->GetStyleSheet(); - - wxTextAttrEx attr(styleSheet ? def->GetStyle() : def->GetStyleMergedWithBase(styleSheet)); - - attr.SetFlags(attr.GetFlags() & - (wxTEXT_ATTR_ALIGNMENT|wxTEXT_ATTR_LEFT_INDENT|wxTEXT_ATTR_RIGHT_INDENT|wxTEXT_ATTR_PARA_SPACING_BEFORE|wxTEXT_ATTR_PARA_SPACING_AFTER| - wxTEXT_ATTR_LINE_SPACING| - wxTEXT_ATTR_BULLET_STYLE|wxTEXT_ATTR_BULLET_NUMBER|wxTEXT_ATTR_BULLET_TEXT)); - - wxFont font(m_previewCtrl->GetFont()); - font.SetPointSize(9); - m_previewCtrl->SetFont(font); - - wxTextAttrEx normalParaAttr; - normalParaAttr.SetFont(font); - normalParaAttr.SetTextColour(wxColour(wxT("LIGHT GREY"))); - - m_previewCtrl->Freeze(); - m_previewCtrl->Clear(); - - m_previewCtrl->BeginStyle(normalParaAttr); - m_previewCtrl->WriteText(s_para1); - m_previewCtrl->EndStyle(); - - m_previewCtrl->BeginStyle(attr); - long listStart = m_previewCtrl->GetInsertionPoint() + 1; - - int i; - for (i = 0; i < 10; i++) - { - wxTextAttrEx levelAttr = * def->GetLevelAttributes(i); - levelAttr.SetBulletNumber(1); - m_previewCtrl->BeginStyle(levelAttr); - m_previewCtrl->WriteText(wxString::Format(wxT("List level %d. "), i+1) + s_para2); - m_previewCtrl->EndStyle(); - } - m_previewCtrl->EndStyle(); - long listEnd = m_previewCtrl->GetInsertionPoint(); - - m_previewCtrl->BeginStyle(normalParaAttr); - m_previewCtrl->WriteText(s_para3); - m_previewCtrl->EndStyle(); - - m_previewCtrl->NumberList(wxRichTextRange(listStart, listEnd), def); - - m_previewCtrl->Thaw(); -} - -/// Transfer data from/to window -bool wxRichTextListStylePage::TransferDataFromWindow() -{ - wxPanel::TransferDataFromWindow(); - - m_currentLevel = m_levelCtrl->GetValue(); - - wxRichTextAttr* attr = GetAttributesForSelection(); - - if (m_alignmentLeft->GetValue()) - attr->SetAlignment(wxTEXT_ALIGNMENT_LEFT); - else if (m_alignmentCentred->GetValue()) - attr->SetAlignment(wxTEXT_ALIGNMENT_CENTRE); - else if (m_alignmentRight->GetValue()) - attr->SetAlignment(wxTEXT_ALIGNMENT_RIGHT); - else if (m_alignmentJustified->GetValue()) - attr->SetAlignment(wxTEXT_ALIGNMENT_JUSTIFIED); - else - { - attr->SetAlignment(wxTEXT_ALIGNMENT_DEFAULT); - attr->SetFlags(attr->GetFlags() & (~wxTEXT_ATTR_ALIGNMENT)); - } - - wxString leftIndent(m_indentLeft->GetValue()); - wxString leftFirstIndent(m_indentLeftFirst->GetValue()); - if (!leftIndent.empty()) - { - int visualLeftIndent = wxAtoi(leftIndent); - int visualLeftFirstIndent = wxAtoi(leftFirstIndent); - int actualLeftIndent = visualLeftFirstIndent; - int actualLeftSubIndent = visualLeftIndent - visualLeftFirstIndent; - - attr->SetLeftIndent(actualLeftIndent, actualLeftSubIndent); - } - else - attr->SetFlags(attr->GetFlags() & (~wxTEXT_ATTR_LEFT_INDENT)); - - wxString rightIndent(m_indentRight->GetValue()); - if (!rightIndent.empty()) - attr->SetRightIndent(wxAtoi(rightIndent)); - else - attr->SetFlags(attr->GetFlags() & (~wxTEXT_ATTR_RIGHT_INDENT)); - - wxString spacingAfter(m_spacingAfter->GetValue()); - if (!spacingAfter.empty()) - attr->SetParagraphSpacingAfter(wxAtoi(spacingAfter)); - else - attr->SetFlags(attr->GetFlags() & (~wxTEXT_ATTR_PARA_SPACING_AFTER)); - - wxString spacingBefore(m_spacingBefore->GetValue()); - if (!spacingBefore.empty()) - attr->SetParagraphSpacingBefore(wxAtoi(spacingBefore)); - else - attr->SetFlags(attr->GetFlags() & (~wxTEXT_ATTR_PARA_SPACING_BEFORE)); - - int spacingIndex = m_spacingLine->GetSelection(); - int lineSpacing = 0; - if (spacingIndex == 0) - lineSpacing = 10; - else if (spacingIndex == 1) - lineSpacing = 15; - else if (spacingIndex == 2) - lineSpacing = 20; - - if (lineSpacing == 0) - attr->SetFlags(attr->GetFlags() & (~wxTEXT_ATTR_LINE_SPACING)); - else - attr->SetLineSpacing(lineSpacing); - - /// BULLETS - // if (m_hasBulletStyle) - { - long bulletStyle = 0; - - int index = m_styleListBox->GetSelection(); - if (index == wxRICHTEXT_BULLETINDEX_ARABIC) - bulletStyle |= wxTEXT_ATTR_BULLET_STYLE_ARABIC; - - else if (index == wxRICHTEXT_BULLETINDEX_UPPER_CASE) - bulletStyle |= wxTEXT_ATTR_BULLET_STYLE_LETTERS_UPPER; - - else if (index == wxRICHTEXT_BULLETINDEX_LOWER_CASE) - bulletStyle |= wxTEXT_ATTR_BULLET_STYLE_LETTERS_LOWER; - - else if (index == wxRICHTEXT_BULLETINDEX_UPPER_CASE_ROMAN) - bulletStyle |= wxTEXT_ATTR_BULLET_STYLE_ROMAN_UPPER; - - else if (index == wxRICHTEXT_BULLETINDEX_LOWER_CASE_ROMAN) - bulletStyle |= wxTEXT_ATTR_BULLET_STYLE_ROMAN_LOWER; - - else if (index == wxRICHTEXT_BULLETINDEX_OUTLINE) - bulletStyle |= wxTEXT_ATTR_BULLET_STYLE_OUTLINE; - - else if (index == wxRICHTEXT_BULLETINDEX_SYMBOL) - bulletStyle |= wxTEXT_ATTR_BULLET_STYLE_SYMBOL; - - else if (index == wxRICHTEXT_BULLETINDEX_BITMAP) - bulletStyle |= wxTEXT_ATTR_BULLET_STYLE_BITMAP; - - else if (index == wxRICHTEXT_BULLETINDEX_STANDARD) - { - bulletStyle |= wxTEXT_ATTR_BULLET_STYLE_STANDARD; - attr->SetBulletName(m_bulletNameCtrl->GetValue()); - } - - if (m_parenthesesCtrl->GetValue()) - bulletStyle |= wxTEXT_ATTR_BULLET_STYLE_PARENTHESES; - if (m_rightParenthesisCtrl->GetValue()) - bulletStyle |= wxTEXT_ATTR_BULLET_STYLE_RIGHT_PARENTHESIS; - if (m_periodCtrl->GetValue()) - bulletStyle |= wxTEXT_ATTR_BULLET_STYLE_PERIOD; - - if (m_bulletAlignmentCtrl->GetSelection() == 1) - bulletStyle |= wxTEXT_ATTR_BULLET_STYLE_ALIGN_CENTRE; - else if (m_bulletAlignmentCtrl->GetSelection() == 2) - bulletStyle |= wxTEXT_ATTR_BULLET_STYLE_ALIGN_RIGHT; - // Left is implied - - attr->SetBulletStyle(bulletStyle); - } - - // if (m_hasBulletSymbol) - { - attr->SetBulletText(m_symbolCtrl->GetValue()); - attr->SetBulletFont(m_symbolFontCtrl->GetValue()); - } - - return true; -} - -bool wxRichTextListStylePage::TransferDataToWindow() -{ - DoTransferDataToWindow(); - UpdatePreview(); - - return true; -} - -/// Just transfer to the window -void wxRichTextListStylePage::DoTransferDataToWindow() -{ - m_dontUpdate = true; - - wxPanel::TransferDataToWindow(); - - wxRichTextAttr* attr = GetAttributesForSelection(); - - if (attr->HasAlignment()) - { - if (attr->GetAlignment() == wxTEXT_ALIGNMENT_LEFT) - m_alignmentLeft->SetValue(true); - else if (attr->GetAlignment() == wxTEXT_ALIGNMENT_RIGHT) - m_alignmentRight->SetValue(true); - else if (attr->GetAlignment() == wxTEXT_ALIGNMENT_CENTRE) - m_alignmentCentred->SetValue(true); - else if (attr->GetAlignment() == wxTEXT_ALIGNMENT_JUSTIFIED) - m_alignmentJustified->SetValue(true); - else - m_alignmentIndeterminate->SetValue(true); - } - else - m_alignmentIndeterminate->SetValue(true); - - if (attr->HasLeftIndent()) - { - wxString leftIndent(wxString::Format(wxT("%ld"), attr->GetLeftIndent() + attr->GetLeftSubIndent())); - wxString leftFirstIndent(wxString::Format(wxT("%ld"), attr->GetLeftIndent())); - - m_indentLeft->SetValue(leftIndent); - m_indentLeftFirst->SetValue(leftFirstIndent); - } - else - { - m_indentLeft->SetValue(wxEmptyString); - m_indentLeftFirst->SetValue(wxEmptyString); - } - - if (attr->HasRightIndent()) - { - wxString rightIndent(wxString::Format(wxT("%ld"), attr->GetRightIndent())); - - m_indentRight->SetValue(rightIndent); - } - else - m_indentRight->SetValue(wxEmptyString); - - if (attr->HasParagraphSpacingAfter()) - { - wxString spacingAfter(wxString::Format(wxT("%d"), attr->GetParagraphSpacingAfter())); - - m_spacingAfter->SetValue(spacingAfter); - } - else - m_spacingAfter->SetValue(wxEmptyString); - - if (attr->HasParagraphSpacingBefore()) - { - wxString spacingBefore(wxString::Format(wxT("%d"), attr->GetParagraphSpacingBefore())); - - m_spacingBefore->SetValue(spacingBefore); - } - else - m_spacingBefore->SetValue(wxEmptyString); - - if (attr->HasLineSpacing()) - { - int index = 0; - - int lineSpacing = attr->GetLineSpacing(); - if (lineSpacing == 10) - index = 0; - else if (lineSpacing == 15) - index = 1; - else if (lineSpacing == 20) - index = 2; - else - index = -1; - - m_spacingLine->SetSelection(index); - } - else - m_spacingLine->SetSelection(-1); - - /// BULLETS - if (attr->HasBulletStyle()) - { - int index = 0; - if (attr->GetBulletStyle() & wxTEXT_ATTR_BULLET_STYLE_ARABIC) - index = wxRICHTEXT_BULLETINDEX_ARABIC; - - else if (attr->GetBulletStyle() & wxTEXT_ATTR_BULLET_STYLE_LETTERS_UPPER) - index = wxRICHTEXT_BULLETINDEX_UPPER_CASE; - - else if (attr->GetBulletStyle() & wxTEXT_ATTR_BULLET_STYLE_LETTERS_LOWER) - index = wxRICHTEXT_BULLETINDEX_LOWER_CASE; - - else if (attr->GetBulletStyle() & wxTEXT_ATTR_BULLET_STYLE_ROMAN_UPPER) - index = wxRICHTEXT_BULLETINDEX_UPPER_CASE_ROMAN; - - else if (attr->GetBulletStyle() & wxTEXT_ATTR_BULLET_STYLE_ROMAN_LOWER) - index = wxRICHTEXT_BULLETINDEX_LOWER_CASE_ROMAN; - - else if (attr->GetBulletStyle() & wxTEXT_ATTR_BULLET_STYLE_OUTLINE) - index = wxRICHTEXT_BULLETINDEX_OUTLINE; - - else if (attr->GetBulletStyle() & wxTEXT_ATTR_BULLET_STYLE_SYMBOL) - index = wxRICHTEXT_BULLETINDEX_SYMBOL; - - else if (attr->GetBulletStyle() & wxTEXT_ATTR_BULLET_STYLE_BITMAP) - index = wxRICHTEXT_BULLETINDEX_BITMAP; - - else if (attr->GetBulletStyle() & wxTEXT_ATTR_BULLET_STYLE_STANDARD) - index = wxRICHTEXT_BULLETINDEX_STANDARD; - - m_styleListBox->SetSelection(index); - - if (attr->GetBulletStyle() & wxTEXT_ATTR_BULLET_STYLE_PARENTHESES) - m_parenthesesCtrl->SetValue(true); - else - m_parenthesesCtrl->SetValue(false); - - if (attr->GetBulletStyle() & wxTEXT_ATTR_BULLET_STYLE_RIGHT_PARENTHESIS) - m_rightParenthesisCtrl->SetValue(true); - else - m_rightParenthesisCtrl->SetValue(false); - - if (attr->GetBulletStyle() & wxTEXT_ATTR_BULLET_STYLE_PERIOD) - m_periodCtrl->SetValue(true); - else - m_periodCtrl->SetValue(false); - - if (attr->GetBulletStyle() & wxTEXT_ATTR_BULLET_STYLE_ALIGN_CENTRE) - m_bulletAlignmentCtrl->SetSelection(1); - else if (attr->GetBulletStyle() & wxTEXT_ATTR_BULLET_STYLE_ALIGN_RIGHT) - m_bulletAlignmentCtrl->SetSelection(2); - else - m_bulletAlignmentCtrl->SetSelection(0); - } - else - { - m_styleListBox->SetSelection(-1); - m_bulletAlignmentCtrl->SetSelection(-1); - } - - if (attr->HasBulletText()) - { - m_symbolCtrl->SetValue(attr->GetBulletText()); - m_symbolFontCtrl->SetValue(attr->GetBulletFont()); - } - else - m_symbolCtrl->SetValue(wxEmptyString); - - if (attr->HasBulletName()) - m_bulletNameCtrl->SetValue(attr->GetBulletName()); - else - m_bulletNameCtrl->SetValue(wxEmptyString); - - m_dontUpdate = false; -} - -/// Get attributes for selected level -wxRichTextAttr* wxRichTextListStylePage::GetAttributesForSelection() -{ - wxRichTextListStyleDefinition* def = wxDynamicCast(wxRichTextFormattingDialog::GetDialogStyleDefinition(this), - wxRichTextListStyleDefinition); - - int value = m_levelCtrl->GetValue(); - - if (def) - return def->GetLevelAttributes(value-1); - else - return NULL; -} - -/// Just transfer from the window and update the preview -void wxRichTextListStylePage::TransferAndPreview() -{ - if (!m_dontUpdate) - { - TransferDataFromWindow(); - UpdatePreview(); - } -} - - -/*! - * wxEVT_COMMAND_SPINCTRL_UPDATED event handler for ID_RICHTEXTLISTSTYLEPAGE_LEVEL - */ - -void wxRichTextListStylePage::OnLevelUpdated( wxSpinEvent& WXUNUSED(event) ) -{ - if (!m_dontUpdate) - { - m_currentLevel = m_levelCtrl->GetValue(); - TransferDataToWindow(); - } -} - -/*! - * wxEVT_SCROLL_LINEUP event handler for ID_RICHTEXTLISTSTYLEPAGE_LEVEL - */ - -void wxRichTextListStylePage::OnLevelUp( wxSpinEvent& event ) -{ - if (!m_dontUpdate) - { - m_currentLevel = event.GetPosition(); - TransferDataToWindow(); - } -} - -/*! - * wxEVT_SCROLL_LINEDOWN event handler for ID_RICHTEXTLISTSTYLEPAGE_LEVEL - */ - -void wxRichTextListStylePage::OnLevelDown( wxSpinEvent& event ) -{ - if (!m_dontUpdate) - { - m_currentLevel = event.GetPosition(); - TransferDataToWindow(); - } -} - -/*! - * wxEVT_COMMAND_TEXT_UPDATED event handler for ID_RICHTEXTLISTSTYLEPAGE_LEVEL - */ - -void wxRichTextListStylePage::OnLevelTextUpdated( wxCommandEvent& WXUNUSED(event) ) -{ - // Can cause problems -#if 0 - if (!m_dontUpdate) - { - m_currentLevel = event.GetInt(); - TransferDataToWindow(); - } -#endif -} - -/*! - * wxEVT_UPDATE_UI event handler for ID_RICHTEXTLISTSTYLEPAGE_LEVEL - */ - -void wxRichTextListStylePage::OnLevelUIUpdate( wxUpdateUIEvent& event ) -{ -////@begin wxEVT_UPDATE_UI event handler for ID_RICHTEXTLISTSTYLEPAGE_LEVEL in wxRichTextListStylePage. - // Before editing this code, remove the block markers. - event.Skip(); -////@end wxEVT_UPDATE_UI event handler for ID_RICHTEXTLISTSTYLEPAGE_LEVEL in wxRichTextListStylePage. -} - -/*! - * wxEVT_COMMAND_LISTBOX_SELECTED event handler for ID_RICHTEXTLISTSTYLEPAGE_STYLELISTBOX - */ - -void wxRichTextListStylePage::OnStylelistboxSelected( wxCommandEvent& WXUNUSED(event) ) -{ - TransferAndPreview(); -} - -/*! - * wxEVT_UPDATE_UI event handler for ID_RICHTEXTLISTSTYLEPAGE_SYMBOLSTATIC - */ - -void wxRichTextListStylePage::OnSymbolstaticUpdate( wxUpdateUIEvent& event ) -{ - OnSymbolUpdate(event); -} - -/*! - * wxEVT_COMMAND_COMBOBOX_SELECTED event handler for ID_RICHTEXTBULLETSPAGE_SYMBOLCTRL - */ - -void wxRichTextListStylePage::OnSymbolctrlSelected( wxCommandEvent& WXUNUSED(event) ) -{ - TransferAndPreview(); -} - -/*! - * wxEVT_COMMAND_TEXT_UPDATED event handler for ID_RICHTEXTBULLETSPAGE_SYMBOLCTRL - */ - -void wxRichTextListStylePage::OnSymbolctrlUpdated( wxCommandEvent& WXUNUSED(event) ) -{ - TransferAndPreview(); -} - -/*! - * wxEVT_UPDATE_UI event handler for ID_RICHTEXTBULLETSPAGE_SYMBOLCTRL - */ - -void wxRichTextListStylePage::OnSymbolctrlUIUpdate( wxUpdateUIEvent& event ) -{ - OnSymbolUpdate(event); -} - -/*! - * wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_RICHTEXTBULLETSPAGE_CHOOSE_SYMBOL - */ - -void wxRichTextListStylePage::OnChooseSymbolClick( wxCommandEvent& WXUNUSED(event) ) -{ - int sel = m_styleListBox->GetSelection(); - if (sel == wxRICHTEXT_BULLETINDEX_SYMBOL) - { - wxString symbol = m_symbolCtrl->GetValue(); - wxString fontName = m_symbolFontCtrl->GetValue(); - wxSymbolPickerDialog dlg(symbol, fontName, fontName, this); - - if (dlg.ShowModal() == wxID_OK) - { - m_dontUpdate = true; - - m_symbolCtrl->SetValue(dlg.GetSymbol()); - m_symbolFontCtrl->SetValue(dlg.GetFontName()); - - TransferAndPreview(); - - m_dontUpdate = false; - } - } -} - -/*! - * wxEVT_UPDATE_UI event handler for ID_RICHTEXTBULLETSPAGE_CHOOSE_SYMBOL - */ - -void wxRichTextListStylePage::OnChooseSymbolUpdate( wxUpdateUIEvent& event ) -{ - OnSymbolUpdate(event); -} - -/*! - * wxEVT_COMMAND_COMBOBOX_SELECTED event handler for ID_RICHTEXTLISTSTYLEPAGE_SYMBOLFONTCTRL - */ - -void wxRichTextListStylePage::OnSymbolfontctrlSelected( wxCommandEvent& WXUNUSED(event) ) -{ - TransferAndPreview(); -} - -/*! - * wxEVT_COMMAND_TEXT_UPDATED event handler for ID_RICHTEXTLISTSTYLEPAGE_SYMBOLFONTCTRL - */ - -void wxRichTextListStylePage::OnSymbolfontctrlUpdated( wxCommandEvent& WXUNUSED(event) ) -{ - TransferAndPreview(); -} - -/*! - * wxEVT_UPDATE_UI event handler for ID_RICHTEXTLISTSTYLEPAGE_SYMBOLFONTCTRL - */ - -void wxRichTextListStylePage::OnSymbolfontctrlUIUpdate( wxUpdateUIEvent& event ) -{ - OnSymbolUpdate(event); -} - -/*! - * wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_RICHTEXTLISTSTYLEPAGE__PARENTHESESCTRL - */ - -void wxRichTextListStylePage::OnParenthesesctrlClick( wxCommandEvent& WXUNUSED(event) ) -{ - TransferAndPreview(); -} - -/*! - * wxEVT_UPDATE_UI event handler for ID_RICHTEXTLISTSTYLEPAGE__PARENTHESESCTRL - */ - -void wxRichTextListStylePage::OnParenthesesctrlUpdate( wxUpdateUIEvent& event ) -{ - int sel = m_styleListBox->GetSelection(); - event.Enable((sel != wxRICHTEXT_BULLETINDEX_SYMBOL && - sel != wxRICHTEXT_BULLETINDEX_BITMAP && - sel != wxRICHTEXT_BULLETINDEX_NONE)); -} - -/*! - * wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_RICHTEXTLISTSTYLEPAGE_PERIODCTRL - */ - -void wxRichTextListStylePage::OnPeriodctrlClick( wxCommandEvent& WXUNUSED(event) ) -{ - TransferAndPreview(); -} - -/*! - * wxEVT_UPDATE_UI event handler for ID_RICHTEXTLISTSTYLEPAGE_PERIODCTRL - */ - -void wxRichTextListStylePage::OnPeriodctrlUpdate( wxUpdateUIEvent& event ) -{ - int sel = m_styleListBox->GetSelection(); - event.Enable((sel != wxRICHTEXT_BULLETINDEX_SYMBOL && - sel != wxRICHTEXT_BULLETINDEX_BITMAP && - sel != wxRICHTEXT_BULLETINDEX_NONE)); -} - -/*! - * wxEVT_COMMAND_RADIOBUTTON_SELECTED event handler for ID_RICHTEXTLISTSTYLEPAGE_ALIGNLEFT - */ - -void wxRichTextListStylePage::OnRichtextliststylepageAlignleftSelected( wxCommandEvent& WXUNUSED(event) ) -{ - TransferAndPreview(); -} - -/*! - * wxEVT_COMMAND_RADIOBUTTON_SELECTED event handler for ID_RICHTEXTLISTSTYLEPAGE_ALIGNRIGHT - */ - -void wxRichTextListStylePage::OnRichtextliststylepageAlignrightSelected( wxCommandEvent& WXUNUSED(event) ) -{ - TransferAndPreview(); -} - -/*! - * wxEVT_COMMAND_RADIOBUTTON_SELECTED event handler for ID_RICHTEXTLISTSTYLEPAGE_JUSTIFIED - */ - -void wxRichTextListStylePage::OnRichtextliststylepageJustifiedSelected( wxCommandEvent& WXUNUSED(event) ) -{ - TransferAndPreview(); -} - -/*! - * wxEVT_COMMAND_RADIOBUTTON_SELECTED event handler for ID_RICHTEXTLISTSTYLEPAGE_CENTERED - */ - -void wxRichTextListStylePage::OnRichtextliststylepageCenteredSelected( wxCommandEvent& WXUNUSED(event) ) -{ - TransferAndPreview(); -} - -/*! - * wxEVT_COMMAND_RADIOBUTTON_SELECTED event handler for ID_RICHTEXTLISTSTYLEPAGE_ALIGNINDETERMINATE - */ - -void wxRichTextListStylePage::OnRichtextliststylepageAlignindeterminateSelected( wxCommandEvent& WXUNUSED(event) ) -{ - TransferAndPreview(); -} - -/*! - * wxEVT_COMMAND_TEXT_UPDATED event handler for ID_RICHTEXTLISTSTYLEPAGE_INDENTLEFT - */ - -void wxRichTextListStylePage::OnIndentLeftUpdated( wxCommandEvent& WXUNUSED(event) ) -{ - TransferAndPreview(); -} - -/*! - * wxEVT_COMMAND_TEXT_UPDATED event handler for ID_RICHTEXTLISTSTYLEPAGE_INDENTFIRSTLINE - */ - -void wxRichTextListStylePage::OnIndentFirstLineUpdated( wxCommandEvent& WXUNUSED(event) ) -{ - TransferAndPreview(); -} - -/*! - * wxEVT_COMMAND_TEXT_UPDATED event handler for ID_RICHTEXTLISTSTYLEPAGE_INDENTRIGHT - */ - -void wxRichTextListStylePage::OnIndentRightUpdated( wxCommandEvent& WXUNUSED(event) ) -{ - TransferAndPreview(); -} - -/*! - * wxEVT_COMMAND_TEXT_UPDATED event handler for ID_RICHTEXTLISTSTYLEPAGE_SPACINGBEFORE - */ - -void wxRichTextListStylePage::OnSpacingBeforeUpdated( wxCommandEvent& WXUNUSED(event) ) -{ - TransferAndPreview(); -} - -/*! - * wxEVT_COMMAND_TEXT_UPDATED event handler for ID_RICHTEXTLISTSTYLEPAGE_SPACINGAFTER - */ - -void wxRichTextListStylePage::OnSpacingAfterUpdated( wxCommandEvent& WXUNUSED(event) ) -{ - TransferAndPreview(); -} - -/*! - * wxEVT_COMMAND_COMBOBOX_SELECTED event handler for ID_RICHTEXTLISTSTYLEPAGE_LINESPACING - */ - -void wxRichTextListStylePage::OnLineSpacingSelected( wxCommandEvent& WXUNUSED(event) ) -{ - TransferAndPreview(); -} - -/*! - * Should we show tooltips? - */ - -bool wxRichTextListStylePage::ShowToolTips() -{ - return wxRichTextFormattingDialog::ShowToolTips(); -} - -/*! - * Get bitmap resources - */ - -wxBitmap wxRichTextListStylePage::GetBitmapResource( const wxString& name ) -{ - // Bitmap retrieval -////@begin wxRichTextListStylePage bitmap retrieval - wxUnusedVar(name); - return wxNullBitmap; -////@end wxRichTextListStylePage bitmap retrieval -} - -/*! - * Get icon resources - */ - -wxIcon wxRichTextListStylePage::GetIconResource( const wxString& name ) -{ - // Icon retrieval -////@begin wxRichTextListStylePage icon retrieval - wxUnusedVar(name); - return wxNullIcon; -////@end wxRichTextListStylePage icon retrieval -} - -/// Update for symbol-related controls -void wxRichTextListStylePage::OnSymbolUpdate( wxUpdateUIEvent& event ) -{ - int sel = m_styleListBox->GetSelection(); - event.Enable(sel == wxRICHTEXT_BULLETINDEX_SYMBOL); -} - -/// Update for number-related controls -void wxRichTextListStylePage::OnNumberUpdate( wxUpdateUIEvent& event ) -{ - int sel = m_styleListBox->GetSelection(); - event.Enable((sel != wxRICHTEXT_BULLETINDEX_SYMBOL && - sel != wxRICHTEXT_BULLETINDEX_BITMAP && - sel != wxRICHTEXT_BULLETINDEX_STANDARD && - sel != wxRICHTEXT_BULLETINDEX_NONE)); -} - -/// Update for standard bullet-related controls -void wxRichTextListStylePage::OnStandardBulletUpdate( wxUpdateUIEvent& event ) -{ - int sel = m_styleListBox->GetSelection(); - event.Enable( sel == wxRICHTEXT_BULLETINDEX_STANDARD ); -} - -/*! - * wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_RICHTEXTLISTSTYLEPAGE_CHOOSE_FONT - */ - -void wxRichTextListStylePage::OnChooseFontClick( wxCommandEvent& WXUNUSED(event) ) -{ - wxRichTextAttr* attr = GetAttributesForSelection(); - - int pages = wxRICHTEXT_FORMAT_FONT; - wxRichTextFormattingDialog formatDlg; - formatDlg.SetStyle(*attr, false); - formatDlg.Create(pages, this); - - if (formatDlg.ShowModal() == wxID_OK) - { - (*attr) = formatDlg.GetAttributes(); - TransferAndPreview(); - } -} -/*! - * wxEVT_UPDATE_UI event handler for ID_RICHTEXTLISTSTYLEPAGE_NAMESTATIC - */ - -void wxRichTextListStylePage::OnNamestaticUpdate( wxUpdateUIEvent& event ) -{ - OnStandardBulletUpdate(event); -} - -/*! - * wxEVT_COMMAND_COMBOBOX_SELECTED event handler for ID_RICHTEXTLISTSTYLEPAGE_NAMECTRL - */ - -void wxRichTextListStylePage::OnNamectrlSelected( wxCommandEvent& WXUNUSED(event) ) -{ - TransferAndPreview(); -} - -/*! - * wxEVT_COMMAND_TEXT_UPDATED event handler for ID_RICHTEXTLISTSTYLEPAGE_NAMECTRL - */ - -void wxRichTextListStylePage::OnNamectrlUpdated( wxCommandEvent& WXUNUSED(event) ) -{ - TransferAndPreview(); -} - -/*! - * wxEVT_UPDATE_UI event handler for ID_RICHTEXTLISTSTYLEPAGE_NAMECTRL - */ - -void wxRichTextListStylePage::OnNamectrlUIUpdate( wxUpdateUIEvent& event ) -{ - OnStandardBulletUpdate(event); -} -/*! - * wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_RICHTEXTLISTSTYLEPAGE_RIGHTPARENTHESISCTRL - */ - -void wxRichTextListStylePage::OnRightParenthesisCtrlClick( wxCommandEvent& WXUNUSED(event) ) -{ - TransferAndPreview(); -} - -/*! - * wxEVT_UPDATE_UI event handler for ID_RICHTEXTLISTSTYLEPAGE_RIGHTPARENTHESISCTRL - */ - -void wxRichTextListStylePage::OnRightParenthesisCtrlUpdate( wxUpdateUIEvent& event ) -{ - int sel = m_styleListBox->GetSelection(); - event.Enable((sel != wxRICHTEXT_BULLETINDEX_SYMBOL && - sel != wxRICHTEXT_BULLETINDEX_BITMAP && - sel != wxRICHTEXT_BULLETINDEX_NONE)); -} - -/*! - * wxEVT_COMMAND_COMBOBOX_SELECTED event handler for ID_RICHTEXTLISTSTYLEPAGE_BULLETALIGNMENTCTRL - */ - -void wxRichTextListStylePage::OnBulletAlignmentCtrlSelected( wxCommandEvent& WXUNUSED(event) ) -{ - TransferAndPreview(); -} - - diff --git a/wxWidgets/src/richtext/richtextprint.cpp b/wxWidgets/src/richtext/richtextprint.cpp deleted file mode 100644 index 2e60fa45b0..0000000000 --- a/wxWidgets/src/richtext/richtextprint.cpp +++ /dev/null @@ -1,707 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/richtext/richtextprint.cpp -// Purpose: Rich text printing classes -// Author: Julian Smart -// Created: 2006-10-24 -// RCS-ID: $Id: richtextprint.cpp 43603 2006-11-22 17:11:53Z JS $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// For compilers that support precompilation, includes "wx/wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_RICHTEXT && wxUSE_PRINTING_ARCHITECTURE && wxUSE_STREAMS - -#ifndef WX_PRECOMP - #include "wx/log.h" - #include "wx/intl.h" - #include "wx/dc.h" - #include "wx/settings.h" - #include "wx/msgdlg.h" -#endif - -#include "wx/datetime.h" -#include "wx/print.h" -#include "wx/printdlg.h" -#include "wx/richtext/richtextprint.h" -#include "wx/wfstream.h" - -/*! - * wxRichTextPrintout - */ - -wxRichTextPrintout::wxRichTextPrintout(const wxString& title) : wxPrintout(title) -{ - m_numPages = wxRICHTEXT_PRINT_MAX_PAGES; - - SetMargins(); // to default values -} - -wxRichTextPrintout::~wxRichTextPrintout() -{ -} - -void wxRichTextPrintout::OnPreparePrinting() -{ - wxBusyCursor wait; - - m_numPages = 1; - - m_pageBreaksStart.Clear(); - m_pageBreaksEnd.Clear(); - - int lastStartPos = 0; - - wxRect rect, headerRect, footerRect; - - /// Sets the DC scaling and returns important page rectangles - CalculateScaling(GetDC(), rect, headerRect, footerRect); - - if (GetRichTextBuffer()) - { - GetRichTextBuffer()->Invalidate(wxRICHTEXT_ALL); - - GetRichTextBuffer()->Layout(*GetDC(), rect, wxRICHTEXT_FIXED_WIDTH|wxRICHTEXT_VARIABLE_HEIGHT); - - // Now calculate the page breaks - - int yOffset = 0; - - wxRichTextLine* lastLine = NULL; - - wxRichTextObjectList::compatibility_iterator node = GetRichTextBuffer()->GetChildren().GetFirst(); - while (node) - { - // child is a paragraph - wxRichTextParagraph* child = wxDynamicCast(node->GetData(), wxRichTextParagraph); - wxASSERT (child != NULL); - - wxRichTextLineList::compatibility_iterator node2 = child->GetLines().GetFirst(); - while (node2) - { - wxRichTextLine* line = node2->GetData(); - - // Set the line to the page-adjusted position - line->SetPosition(wxPoint(line->GetPosition().x, line->GetPosition().y - yOffset)); - - int lineY = child->GetPosition().y + line->GetPosition().y; - - // Break the page if either we're going off the bottom, or this paragraph specifies - // an explicit page break - - if (((lineY + line->GetSize().y) > rect.GetBottom()) || - ((node2 == child->GetLines().GetFirst()) && child->GetAttributes().HasPageBreak())) - { - // New page starting at this line - int newY = rect.y; - - // We increase the offset by the difference between new and old positions - - int increaseOffsetBy = lineY - newY; - yOffset += increaseOffsetBy; - - line->SetPosition(wxPoint(line->GetPosition().x, newY - child->GetPosition().y)); - - if (!lastLine) - lastLine = line; - - m_pageBreaksStart.Add(lastStartPos); - m_pageBreaksEnd.Add(lastLine->GetAbsoluteRange().GetEnd()); - - lastStartPos = line->GetAbsoluteRange().GetStart(); - - m_numPages ++; - } - - lastLine = line; - - node2 = node2->GetNext(); - } - - node = node->GetNext(); - } - - // Closing page break - if (m_pageBreaksStart.GetCount() == 0 || (m_pageBreaksEnd[m_pageBreaksEnd.GetCount()-1] < (GetRichTextBuffer()->GetRange().GetEnd()-1))) - { - m_pageBreaksStart.Add(lastStartPos); - m_pageBreaksEnd.Add(GetRichTextBuffer()->GetRange().GetEnd()); - } - } -} - -bool wxRichTextPrintout::OnBeginDocument(int startPage, int endPage) -{ - if (!wxPrintout::OnBeginDocument(startPage, endPage)) return false; - - return true; -} - -bool wxRichTextPrintout::OnPrintPage(int page) -{ - wxDC *dc = GetDC(); - if (dc) - { - if (HasPage(page)) - RenderPage(dc, page); - return true; - } - else return false; -} - -void wxRichTextPrintout::GetPageInfo(int *minPage, int *maxPage, int *selPageFrom, int *selPageTo) -{ - *minPage = 1; - *maxPage = m_numPages; - *selPageFrom = 1; - *selPageTo = m_numPages; -} - -bool wxRichTextPrintout::HasPage(int pageNum) -{ - return pageNum > 0 && pageNum <= m_numPages; -} - -void wxRichTextPrintout::RenderPage(wxDC *dc, int page) -{ - if (!GetRichTextBuffer()) - return; - - wxBusyCursor wait; - - wxRect textRect, headerRect, footerRect; - - /// Sets the DC scaling and returns important page rectangles - CalculateScaling(dc, textRect, headerRect, footerRect); - - if (page > 1 || m_headerFooterData.GetShowOnFirstPage()) - { - if (m_headerFooterData.GetFont().Ok()) - dc->SetFont(m_headerFooterData.GetFont()); - else - dc->SetFont(*wxNORMAL_FONT); - if (m_headerFooterData.GetTextColour().Ok()) - dc->SetTextForeground(m_headerFooterData.GetTextColour()); - else - dc->SetTextForeground(*wxBLACK); - dc->SetBackgroundMode(wxTRANSPARENT); - - // Draw header, if any - wxRichTextOddEvenPage oddEven = ((page % 2) == 1) ? wxRICHTEXT_PAGE_ODD : wxRICHTEXT_PAGE_EVEN; - - wxString headerTextCentre = m_headerFooterData.GetHeaderText(oddEven, wxRICHTEXT_PAGE_CENTRE); - wxString headerTextLeft = m_headerFooterData.GetHeaderText(oddEven, wxRICHTEXT_PAGE_LEFT); - wxString headerTextRight = m_headerFooterData.GetHeaderText(oddEven, wxRICHTEXT_PAGE_RIGHT); - - if (!headerTextLeft.IsEmpty()) - { - SubstituteKeywords(headerTextLeft, GetTitle(), page, m_numPages); - - //int tx, ty; - //dc->GetTextExtent(headerTextLeft, & tx, & ty); - - int x = headerRect.GetLeft(); - int y = headerRect.GetX(); - dc->DrawText(headerTextLeft, x, y); - } - if (!headerTextCentre.IsEmpty()) - { - SubstituteKeywords(headerTextCentre, GetTitle(), page, m_numPages); - - int tx, ty; - dc->GetTextExtent(headerTextCentre, & tx, & ty); - - int x = headerRect.GetWidth()/2 - tx/2 + headerRect.GetLeft(); - int y = headerRect.GetY(); - dc->DrawText(headerTextCentre, x, y); - } - if (!headerTextRight.IsEmpty()) - { - SubstituteKeywords(headerTextRight, GetTitle(), page, m_numPages); - - int tx, ty; - dc->GetTextExtent(headerTextRight, & tx, & ty); - - int x = headerRect.GetRight() - tx; - int y = headerRect.GetY(); - dc->DrawText(headerTextRight, x, y); - } - - // Draw footer, if any - wxString footerTextCentre = m_headerFooterData.GetFooterText(oddEven, wxRICHTEXT_PAGE_CENTRE); - wxString footerTextLeft = m_headerFooterData.GetFooterText(oddEven, wxRICHTEXT_PAGE_LEFT); - wxString footerTextRight = m_headerFooterData.GetFooterText(oddEven, wxRICHTEXT_PAGE_RIGHT); - - if (!footerTextLeft.IsEmpty()) - { - SubstituteKeywords(footerTextLeft, GetTitle(), page, m_numPages); - - int tx, ty; - dc->GetTextExtent(footerTextLeft, & tx, & ty); - - int x = footerRect.GetLeft(); - int y = footerRect.GetBottom() - ty; - dc->DrawText(footerTextLeft, x, y); - } - if (!footerTextCentre.IsEmpty()) - { - SubstituteKeywords(footerTextCentre, GetTitle(), page, m_numPages); - - int tx, ty; - dc->GetTextExtent(footerTextCentre, & tx, & ty); - - int x = footerRect.GetWidth()/2 - tx/2 + footerRect.GetLeft(); - int y = footerRect.GetBottom() - ty; - dc->DrawText(footerTextCentre, x, y); - } - if (!footerTextRight.IsEmpty()) - { - SubstituteKeywords(footerTextRight, GetTitle(), page, m_numPages); - - int tx, ty; - dc->GetTextExtent(footerTextRight, & tx, & ty); - - int x = footerRect.GetRight() - tx; - int y = footerRect.GetBottom() - ty; - dc->DrawText(footerTextRight, x, y); - } - } - - wxRichTextRange rangeToDraw(m_pageBreaksStart[page-1], m_pageBreaksEnd[page-1]); - - GetRichTextBuffer()->Draw(*dc, rangeToDraw, wxRichTextRange(-1,-1), textRect, 0 /* descent */, wxRICHTEXT_DRAW_IGNORE_CACHE /* flags */); -} - -void wxRichTextPrintout::SetMargins(int top, int bottom, int left, int right) -{ - m_marginTop = top; - m_marginBottom = bottom; - m_marginLeft = left; - m_marginRight = right; -} - -/// Calculate scaling and rectangles, setting the device context scaling -void wxRichTextPrintout::CalculateScaling(wxDC* dc, wxRect& textRect, wxRect& headerRect, wxRect& footerRect) -{ - // Get the logical pixels per inch of screen and printer - int ppiScreenX, ppiScreenY; - GetPPIScreen(&ppiScreenX, &ppiScreenY); - int ppiPrinterX, ppiPrinterY; - GetPPIPrinter(&ppiPrinterX, &ppiPrinterY); - - // This scales the DC so that the printout roughly represents the - // the screen scaling. - float scale = (float)((float)ppiPrinterX/(float)ppiScreenX); - - // Now we have to check in case our real page size is reduced - // (e.g. because we're drawing to a print preview memory DC) - int pageWidth, pageHeight; - int w, h; - dc->GetSize(&w, &h); - GetPageSizePixels(&pageWidth, &pageHeight); - - // If printer pageWidth == current DC width, then this doesn't - // change. But w might be the preview bitmap width, so scale down. - float previewScale = (float)(w/(float)pageWidth); - float overallScale = scale * previewScale; - - // The dimensions used for indentation etc. have to be unscaled - // during printing to be correct when scaling is applied. - if (!IsPreview()) - m_richTextBuffer->SetScale(scale); - - // Calculate margins - int marginLeft = wxRichTextObject::ConvertTenthsMMToPixels(ppiPrinterX, m_marginLeft); - int marginTop = wxRichTextObject::ConvertTenthsMMToPixels(ppiPrinterX, m_marginTop); - int marginRight = wxRichTextObject::ConvertTenthsMMToPixels(ppiPrinterX, m_marginRight); - int marginBottom = wxRichTextObject::ConvertTenthsMMToPixels(ppiPrinterX, m_marginBottom); - - // Header and footer margins - int headerMargin = wxRichTextObject::ConvertTenthsMMToPixels(ppiPrinterX, m_headerFooterData.GetHeaderMargin()); - int footerMargin = wxRichTextObject::ConvertTenthsMMToPixels(ppiPrinterX, m_headerFooterData.GetFooterMargin()); - - dc->SetUserScale(overallScale, overallScale); - - wxRect rect((int) (marginLeft/scale), (int) (marginTop/scale), - (int) ((pageWidth - marginLeft - marginRight)/scale), (int)((pageHeight - marginTop - marginBottom)/scale)); - - headerRect = wxRect(0, 0, 0, 0); - - if (!m_headerFooterData.GetHeaderText(wxRICHTEXT_PAGE_ODD, wxRICHTEXT_PAGE_LEFT).IsEmpty() || - !m_headerFooterData.GetHeaderText(wxRICHTEXT_PAGE_ODD, wxRICHTEXT_PAGE_CENTRE).IsEmpty() || - !m_headerFooterData.GetHeaderText(wxRICHTEXT_PAGE_ODD, wxRICHTEXT_PAGE_RIGHT).IsEmpty() || - - !m_headerFooterData.GetHeaderText(wxRICHTEXT_PAGE_EVEN, wxRICHTEXT_PAGE_LEFT).IsEmpty() || - !m_headerFooterData.GetHeaderText(wxRICHTEXT_PAGE_EVEN, wxRICHTEXT_PAGE_CENTRE).IsEmpty() || - !m_headerFooterData.GetHeaderText(wxRICHTEXT_PAGE_EVEN, wxRICHTEXT_PAGE_RIGHT).IsEmpty()) - { - if (m_headerFooterData.GetFont().Ok()) - dc->SetFont(m_headerFooterData.GetFont()); - else - dc->SetFont(*wxNORMAL_FONT); - - int charHeight = dc->GetCharHeight(); - - int headerHeight = (int) (charHeight + headerMargin/scale); - - headerRect = wxRect(rect.x, rect.y, rect.width, headerHeight); - - rect.y += headerHeight; - rect.height -= headerHeight; - } - - footerRect = wxRect(0, 0, 0, 0); - - if (!m_headerFooterData.GetFooterText(wxRICHTEXT_PAGE_ODD, wxRICHTEXT_PAGE_LEFT).IsEmpty() || - !m_headerFooterData.GetFooterText(wxRICHTEXT_PAGE_ODD, wxRICHTEXT_PAGE_CENTRE).IsEmpty() || - !m_headerFooterData.GetFooterText(wxRICHTEXT_PAGE_ODD, wxRICHTEXT_PAGE_RIGHT).IsEmpty() || - - !m_headerFooterData.GetFooterText(wxRICHTEXT_PAGE_EVEN, wxRICHTEXT_PAGE_LEFT).IsEmpty() || - !m_headerFooterData.GetFooterText(wxRICHTEXT_PAGE_EVEN, wxRICHTEXT_PAGE_CENTRE).IsEmpty() || - !m_headerFooterData.GetFooterText(wxRICHTEXT_PAGE_EVEN, wxRICHTEXT_PAGE_RIGHT).IsEmpty()) - { - if (m_headerFooterData.GetFont().Ok()) - dc->SetFont(m_headerFooterData.GetFont()); - else - dc->SetFont(*wxNORMAL_FONT); - - int charHeight = dc->GetCharHeight(); - - int footerHeight = (int) (charHeight + footerMargin/scale); - - footerRect = wxRect(rect.x, rect.y + rect.height, rect.width, footerHeight); - - rect.height -= footerHeight; - } - - textRect = rect; -} - -bool wxRichTextPrintout::SubstituteKeywords(wxString& str, const wxString& title, int pageNum, int pageCount) -{ - wxString num; - - num.Printf(wxT("%i"), pageNum); - str.Replace(wxT("@PAGENUM@"), num); - - num.Printf(wxT("%lu"), (unsigned long) pageCount); - str.Replace(wxT("@PAGESCNT@"), num); - - wxDateTime now = wxDateTime::Now(); - - str.Replace(wxT("@DATE@"), now.FormatDate()); - str.Replace(wxT("@TIME@"), now.FormatTime()); - - str.Replace(wxT("@TITLE@"), title); - - return true; -} - -/*! - * wxRichTextPrinting - */ - -wxRichTextPrinting::wxRichTextPrinting(const wxString& name, wxWindow *parentWindow) -{ - m_richTextBufferPrinting = NULL; - m_richTextBufferPreview = NULL; - - m_parentWindow = parentWindow; - m_title = name; - m_printData = NULL; - - m_previewRect = wxRect(wxPoint(100, 100), wxSize(800, 800)); - - m_pageSetupData = new wxPageSetupDialogData; - m_pageSetupData->EnableMargins(true); - m_pageSetupData->SetMarginTopLeft(wxPoint(25, 25)); - m_pageSetupData->SetMarginBottomRight(wxPoint(25, 25)); -} - -wxRichTextPrinting::~wxRichTextPrinting() -{ - delete m_printData; - delete m_pageSetupData; - delete m_richTextBufferPrinting; - delete m_richTextBufferPreview; -} - -wxPrintData *wxRichTextPrinting::GetPrintData() -{ - if (m_printData == NULL) - m_printData = new wxPrintData(); - return m_printData; -} - -/// Set print and page setup data -void wxRichTextPrinting::SetPrintData(const wxPrintData& printData) -{ - (*GetPrintData()) = printData; -} - -void wxRichTextPrinting::SetPageSetupData(const wxPageSetupData& pageSetupData) -{ - (*GetPageSetupData()) = pageSetupData; -} - -/// Set the rich text buffer pointer, deleting the existing object if present -void wxRichTextPrinting::SetRichTextBufferPrinting(wxRichTextBuffer* buf) -{ - if (m_richTextBufferPrinting) - { - delete m_richTextBufferPrinting; - m_richTextBufferPrinting = NULL; - } - m_richTextBufferPrinting = buf; -} - -void wxRichTextPrinting::SetRichTextBufferPreview(wxRichTextBuffer* buf) -{ - if (m_richTextBufferPreview) - { - delete m_richTextBufferPreview; - m_richTextBufferPreview = NULL; - } - m_richTextBufferPreview = buf; -} - -bool wxRichTextPrinting::PreviewFile(const wxString& richTextFile) -{ - SetRichTextBufferPreview(new wxRichTextBuffer); - - if (!m_richTextBufferPreview->LoadFile(richTextFile)) - { - SetRichTextBufferPreview(NULL); - return false; - } - else - SetRichTextBufferPrinting(new wxRichTextBuffer(*m_richTextBufferPreview)); - - wxRichTextPrintout *p1 = CreatePrintout(); - p1->SetRichTextBuffer(m_richTextBufferPreview); - - wxRichTextPrintout *p2 = CreatePrintout(); - p2->SetRichTextBuffer(m_richTextBufferPrinting); - return DoPreview(p1, p2); -} - -bool wxRichTextPrinting::PreviewBuffer(const wxRichTextBuffer& buffer) -{ - SetRichTextBufferPreview(new wxRichTextBuffer(buffer)); - SetRichTextBufferPrinting(new wxRichTextBuffer(buffer)); - - wxRichTextPrintout *p1 = CreatePrintout(); - p1->SetRichTextBuffer(m_richTextBufferPreview); - - wxRichTextPrintout *p2 = CreatePrintout(); - p2->SetRichTextBuffer(m_richTextBufferPrinting); - - return DoPreview(p1, p2); -} - -bool wxRichTextPrinting::PrintFile(const wxString& richTextFile) -{ - SetRichTextBufferPrinting(new wxRichTextBuffer); - - if (!m_richTextBufferPrinting->LoadFile(richTextFile)) - { - SetRichTextBufferPrinting(NULL); - return false; - } - - wxRichTextPrintout *p = CreatePrintout(); - p->SetRichTextBuffer(m_richTextBufferPrinting); - - bool ret = DoPrint(p); - delete p; - return ret; -} - -bool wxRichTextPrinting::PrintBuffer(const wxRichTextBuffer& buffer) -{ - SetRichTextBufferPrinting(new wxRichTextBuffer(buffer)); - - wxRichTextPrintout *p = CreatePrintout(); - p->SetRichTextBuffer(m_richTextBufferPrinting); - - bool ret = DoPrint(p); - delete p; - return ret; -} - -bool wxRichTextPrinting::DoPreview(wxRichTextPrintout *printout1, wxRichTextPrintout *printout2) -{ - // Pass two printout objects: for preview, and possible printing. - wxPrintDialogData printDialogData(*GetPrintData()); - wxPrintPreview *preview = new wxPrintPreview(printout1, printout2, &printDialogData); - if (!preview->Ok()) - { - delete preview; - return false; - } - - wxPreviewFrame *frame = new wxPreviewFrame(preview, m_parentWindow, - m_title + _(" Preview"), - m_previewRect.GetPosition(), m_previewRect.GetSize()); - frame->Centre(wxBOTH); - frame->Initialize(); - frame->Show(true); - return true; -} - -bool wxRichTextPrinting::DoPrint(wxRichTextPrintout *printout) -{ - wxPrintDialogData printDialogData(*GetPrintData()); - wxPrinter printer(&printDialogData); - - if (!printer.Print(m_parentWindow, printout, true)) - { - return false; - } - - (*GetPrintData()) = printer.GetPrintDialogData().GetPrintData(); - return true; -} - -void wxRichTextPrinting::PageSetup() -{ - if (!GetPrintData()->Ok()) - { - wxLogError(_("There was a problem during page setup: you may need to set a default printer.")); - return; - } - - m_pageSetupData->SetPrintData(*GetPrintData()); - wxPageSetupDialog pageSetupDialog(m_parentWindow, m_pageSetupData); - - if (pageSetupDialog.ShowModal() == wxID_OK) - { - (*GetPrintData()) = pageSetupDialog.GetPageSetupData().GetPrintData(); - (*m_pageSetupData) = pageSetupDialog.GetPageSetupData(); - } -} - -wxRichTextPrintout *wxRichTextPrinting::CreatePrintout() -{ - wxRichTextPrintout *p = new wxRichTextPrintout(m_title); - - p->SetHeaderFooterData(GetHeaderFooterData()); - p->SetMargins(10*m_pageSetupData->GetMarginTopLeft().y, - 10*m_pageSetupData->GetMarginBottomRight().y, - 10*m_pageSetupData->GetMarginTopLeft().x, - 10*m_pageSetupData->GetMarginBottomRight().x); - - return p; -} - -/// Set/get header text, e.g. wxRICHTEXT_PAGE_ODD, wxRICHTEXT_PAGE_LEFT -void wxRichTextPrinting::SetHeaderText(const wxString& text, wxRichTextOddEvenPage page, wxRichTextPageLocation location) -{ - m_headerFooterData.SetHeaderText(text, page, location); -} - -wxString wxRichTextPrinting::GetHeaderText(wxRichTextOddEvenPage page, wxRichTextPageLocation location) const -{ - return m_headerFooterData.GetHeaderText(page, location); -} - -/// Set/get footer text, e.g. wxRICHTEXT_PAGE_ODD, wxRICHTEXT_PAGE_LEFT -void wxRichTextPrinting::SetFooterText(const wxString& text, wxRichTextOddEvenPage page, wxRichTextPageLocation location) -{ - m_headerFooterData.SetFooterText(text, page, location); -} - -wxString wxRichTextPrinting::GetFooterText(wxRichTextOddEvenPage page, wxRichTextPageLocation location) const -{ - return m_headerFooterData.GetFooterText(page, location); -} - -/*! - * Header/footer data - */ - -IMPLEMENT_CLASS(wxRichTextHeaderFooterData, wxObject) - -/// Copy -void wxRichTextHeaderFooterData::Copy(const wxRichTextHeaderFooterData& data) -{ - int i; - for (i = 0; i < 12; i++) - m_text[i] = data.m_text[i]; - m_font = data.m_font; - m_colour = data.m_colour; - m_headerMargin = data.m_headerMargin; - m_footerMargin = data.m_footerMargin; - m_showOnFirstPage = data.m_showOnFirstPage; -} - -/// Set/get text -void wxRichTextHeaderFooterData::SetText(const wxString& text, int headerFooter, wxRichTextOddEvenPage page, wxRichTextPageLocation location) -{ - int idx = headerFooter + (2 * (int) page) + (4 * (int) location); - wxASSERT( idx >= 0 && idx < 12 ); - - if (idx >= 0 && idx < 12) - m_text[idx] = text; -} - -wxString wxRichTextHeaderFooterData::GetText(int headerFooter, wxRichTextOddEvenPage page, wxRichTextPageLocation location) const -{ - int idx = headerFooter + (2 * (int) page) + (4 * (int) location); - wxASSERT( idx >= 0 && idx < 12 ); - - if (idx >= 0 && idx < 12) - return m_text[idx]; - else - return wxEmptyString; -} - -/// Set/get header text, e.g. wxRICHTEXT_PAGE_ODD, wxRICHTEXT_PAGE_LEFT -void wxRichTextHeaderFooterData::SetHeaderText(const wxString& text, wxRichTextOddEvenPage page, wxRichTextPageLocation location) -{ - if (page == wxRICHTEXT_PAGE_ALL) - { - SetText(text, 0, wxRICHTEXT_PAGE_ODD, location); - SetText(text, 0, wxRICHTEXT_PAGE_EVEN, location); - } - else - SetText(text, 0, page, location); -} - -wxString wxRichTextHeaderFooterData::GetHeaderText(wxRichTextOddEvenPage page, wxRichTextPageLocation location) const -{ - return GetText(0, page, location); -} - -/// Set/get footer text, e.g. wxRICHTEXT_PAGE_ODD, wxRICHTEXT_PAGE_LEFT -void wxRichTextHeaderFooterData::SetFooterText(const wxString& text, wxRichTextOddEvenPage page, wxRichTextPageLocation location) -{ - if (page == wxRICHTEXT_PAGE_ALL) - { - SetText(text, 1, wxRICHTEXT_PAGE_ODD, location); - SetText(text, 1, wxRICHTEXT_PAGE_EVEN, location); - } - else - SetText(text, 1, page, location); -} - -wxString wxRichTextHeaderFooterData::GetFooterText(wxRichTextOddEvenPage page, wxRichTextPageLocation location) const -{ - return GetText(1, page, location); -} - -/// Clear all text -void wxRichTextHeaderFooterData::Clear() -{ - int i; - for (i = 0; i < 12; i++) - m_text[i] = wxEmptyString; -} - -#endif // wxUSE_RICHTEXT & wxUSE_PRINTING_ARCHITECTURE - diff --git a/wxWidgets/src/richtext/richtextstyledlg.cpp b/wxWidgets/src/richtext/richtextstyledlg.cpp deleted file mode 100644 index be1002eee8..0000000000 --- a/wxWidgets/src/richtext/richtextstyledlg.cpp +++ /dev/null @@ -1,885 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/richtext/richtextstyledlg.cpp -// Purpose: -// Author: Julian Smart -// Modified by: -// Created: 10/5/2006 12:05:31 PM -// RCS-ID: $Id: richtextstyledlg.cpp 61185 2009-06-24 10:35:46Z JS $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// For compilers that support precompilation, includes "wx/wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ -#pragma hdrstop -#endif - -#if wxUSE_RICHTEXT - -#ifndef WX_PRECOMP -#include "wx/wx.h" -#endif - -#include "wx/richtext/richtextstyledlg.h" -#include "wx/richtext/richtextformatdlg.h" - -/*! - * wxRichTextStyleOrganiserDialog type definition - */ - -bool wxRichTextStyleOrganiserDialog::sm_showToolTips = false; - -IMPLEMENT_DYNAMIC_CLASS( wxRichTextStyleOrganiserDialog, wxDialog ) - -/*! - * wxRichTextStyleOrganiserDialog event table definition - */ - -BEGIN_EVENT_TABLE( wxRichTextStyleOrganiserDialog, wxDialog ) - - EVT_LISTBOX(wxID_ANY, wxRichTextStyleOrganiserDialog::OnListSelection) - -////@begin wxRichTextStyleOrganiserDialog event table entries - EVT_BUTTON( ID_RICHTEXTSTYLEORGANISERDIALOG_NEW_CHAR, wxRichTextStyleOrganiserDialog::OnNewCharClick ) - EVT_UPDATE_UI( ID_RICHTEXTSTYLEORGANISERDIALOG_NEW_CHAR, wxRichTextStyleOrganiserDialog::OnNewCharUpdate ) - - EVT_BUTTON( ID_RICHTEXTSTYLEORGANISERDIALOG_NEW_PARA, wxRichTextStyleOrganiserDialog::OnNewParaClick ) - EVT_UPDATE_UI( ID_RICHTEXTSTYLEORGANISERDIALOG_NEW_PARA, wxRichTextStyleOrganiserDialog::OnNewParaUpdate ) - - EVT_BUTTON( ID_RICHTEXTSTYLEORGANISERDIALOG_NEW_LIST, wxRichTextStyleOrganiserDialog::OnNewListClick ) - EVT_UPDATE_UI( ID_RICHTEXTSTYLEORGANISERDIALOG_NEW_LIST, wxRichTextStyleOrganiserDialog::OnNewListUpdate ) - - EVT_BUTTON( ID_RICHTEXTSTYLEORGANISERDIALOG_APPLY, wxRichTextStyleOrganiserDialog::OnApplyClick ) - EVT_UPDATE_UI( ID_RICHTEXTSTYLEORGANISERDIALOG_APPLY, wxRichTextStyleOrganiserDialog::OnApplyUpdate ) - - EVT_BUTTON( ID_RICHTEXTSTYLEORGANISERDIALOG_RENAME, wxRichTextStyleOrganiserDialog::OnRenameClick ) - EVT_UPDATE_UI( ID_RICHTEXTSTYLEORGANISERDIALOG_RENAME, wxRichTextStyleOrganiserDialog::OnRenameUpdate ) - - EVT_BUTTON( ID_RICHTEXTSTYLEORGANISERDIALOG_EDIT, wxRichTextStyleOrganiserDialog::OnEditClick ) - EVT_UPDATE_UI( ID_RICHTEXTSTYLEORGANISERDIALOG_EDIT, wxRichTextStyleOrganiserDialog::OnEditUpdate ) - - EVT_BUTTON( ID_RICHTEXTSTYLEORGANISERDIALOG_DELETE, wxRichTextStyleOrganiserDialog::OnDeleteClick ) - EVT_UPDATE_UI( ID_RICHTEXTSTYLEORGANISERDIALOG_DELETE, wxRichTextStyleOrganiserDialog::OnDeleteUpdate ) - -////@end wxRichTextStyleOrganiserDialog event table entries - -END_EVENT_TABLE() - -/*! - * wxRichTextStyleOrganiserDialog constructors - */ - -wxRichTextStyleOrganiserDialog::wxRichTextStyleOrganiserDialog( ) -{ - Init(); -} - -wxRichTextStyleOrganiserDialog::wxRichTextStyleOrganiserDialog( int flags, wxRichTextStyleSheet* sheet, wxRichTextCtrl* ctrl, wxWindow* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style ) -{ - Init(); - Create(flags, sheet, ctrl, parent, id, caption, pos, size, style); -} - -/*! - * Member initialisation for wxSymbolPickerDialog - */ - -void wxRichTextStyleOrganiserDialog::Init() -{ - m_richTextStyleSheet = NULL; - m_richTextCtrl = NULL; - m_dontUpdate = false; - m_flags = 0; - m_restartNumbering = true; - -////@begin wxRichTextStyleOrganiserDialog member initialisation - m_innerSizer = NULL; - m_buttonSizerParent = NULL; - m_stylesListBox = NULL; - m_previewCtrl = NULL; - m_buttonSizer = NULL; - m_newCharacter = NULL; - m_newParagraph = NULL; - m_newList = NULL; - m_applyStyle = NULL; - m_renameStyle = NULL; - m_editStyle = NULL; - m_deleteStyle = NULL; - m_closeButton = NULL; - m_bottomButtonSizer = NULL; - m_restartNumberingCtrl = NULL; - m_okButton = NULL; - m_cancelButton = NULL; -////@end wxRichTextStyleOrganiserDialog member initialisation -} - -/*! - * wxRichTextStyleOrganiserDialog creator - */ - -bool wxRichTextStyleOrganiserDialog::Create( int flags, wxRichTextStyleSheet* sheet, wxRichTextCtrl* ctrl, wxWindow* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style ) -{ - m_richTextStyleSheet = sheet; - m_richTextCtrl = ctrl; - m_flags = flags; - -////@begin wxRichTextStyleOrganiserDialog creation - SetExtraStyle(wxWS_EX_BLOCK_EVENTS|wxDIALOG_EX_CONTEXTHELP); - wxDialog::Create( parent, id, caption, pos, size, style ); - - CreateControls(); - if (GetSizer()) - { - GetSizer()->SetSizeHints(this); - } - Centre(); -////@end wxRichTextStyleOrganiserDialog creation - return true; -} - -/*! - * Control creation for wxRichTextStyleOrganiserDialog - */ - -void wxRichTextStyleOrganiserDialog::CreateControls() -{ -#ifdef __WXMAC__ - SetWindowVariant(wxWINDOW_VARIANT_SMALL); -#endif - - bool hideTypeSelector = false; - wxRichTextStyleListBox::wxRichTextStyleType typesToShow = wxRichTextStyleListBox::wxRICHTEXT_STYLE_ALL; - - if ((m_flags & wxRICHTEXT_ORGANISER_SHOW_CHARACTER) != 0) - { - typesToShow = wxRichTextStyleListBox::wxRICHTEXT_STYLE_CHARACTER; - hideTypeSelector = true; - } - else if ((m_flags & wxRICHTEXT_ORGANISER_SHOW_PARAGRAPH) != 0) - { - typesToShow = wxRichTextStyleListBox::wxRICHTEXT_STYLE_PARAGRAPH; - hideTypeSelector = true; - } - else if ((m_flags & wxRICHTEXT_ORGANISER_SHOW_LIST) != 0) - { - typesToShow = wxRichTextStyleListBox::wxRICHTEXT_STYLE_LIST; - hideTypeSelector = true; - } - else - { - // wxRICHTEXT_ORGANISER_SHOW_ALL is implied if the other styles aren't included - } - - long listCtrlStyle = 0; - if (hideTypeSelector) - listCtrlStyle = wxRICHTEXTSTYLELIST_HIDE_TYPE_SELECTOR; - -////@begin wxRichTextStyleOrganiserDialog content construction - wxRichTextStyleOrganiserDialog* itemDialog1 = this; - - wxBoxSizer* itemBoxSizer2 = new wxBoxSizer(wxVERTICAL); - itemDialog1->SetSizer(itemBoxSizer2); - - m_innerSizer = new wxBoxSizer(wxVERTICAL); - itemBoxSizer2->Add(m_innerSizer, 1, wxGROW|wxALL, 5); - - m_buttonSizerParent = new wxBoxSizer(wxHORIZONTAL); - m_innerSizer->Add(m_buttonSizerParent, 1, wxGROW, 5); - - wxBoxSizer* itemBoxSizer5 = new wxBoxSizer(wxVERTICAL); - m_buttonSizerParent->Add(itemBoxSizer5, 1, wxGROW, 5); - - wxStaticText* itemStaticText6 = new wxStaticText( itemDialog1, wxID_STATIC, _("&Styles:"), wxDefaultPosition, wxDefaultSize, 0 ); - itemBoxSizer5->Add(itemStaticText6, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP|wxADJUST_MINSIZE, 5); - - m_stylesListBox = new wxRichTextStyleListCtrl( itemDialog1, ID_RICHTEXTSTYLEORGANISERDIALOG_STYLES, wxDefaultPosition, wxSize(280, 260), listCtrlStyle ); - m_stylesListBox->SetHelpText(_("The available styles.")); - if (wxRichTextStyleOrganiserDialog::ShowToolTips()) - m_stylesListBox->SetToolTip(_("The available styles.")); - itemBoxSizer5->Add(m_stylesListBox, 1, wxGROW|wxALL, 5); - - wxBoxSizer* itemBoxSizer8 = new wxBoxSizer(wxVERTICAL); - m_buttonSizerParent->Add(itemBoxSizer8, 0, wxGROW, 5); - - wxStaticText* itemStaticText9 = new wxStaticText( itemDialog1, ID_RICHTEXTSTYLEORGANISERDIALOG_CURRENT_STYLE, _(" "), wxDefaultPosition, wxDefaultSize, 0 ); - itemBoxSizer8->Add(itemStaticText9, 0, wxGROW|wxLEFT|wxRIGHT|wxTOP|wxADJUST_MINSIZE, 5); - - m_previewCtrl = new wxRichTextCtrl( itemDialog1, ID_RICHTEXTSTYLEORGANISERDIALOG_PREVIEW, wxEmptyString, wxDefaultPosition, wxSize(250, 200), wxVSCROLL|wxTE_READONLY ); - m_previewCtrl->SetHelpText(_("The style preview.")); - if (wxRichTextStyleOrganiserDialog::ShowToolTips()) - m_previewCtrl->SetToolTip(_("The style preview.")); - itemBoxSizer8->Add(m_previewCtrl, 1, wxGROW|wxALL, 5); - - m_buttonSizer = new wxBoxSizer(wxVERTICAL); - m_buttonSizerParent->Add(m_buttonSizer, 0, wxGROW, 5); - - wxStaticText* itemStaticText12 = new wxStaticText( itemDialog1, wxID_STATIC, _(" "), wxDefaultPosition, wxDefaultSize, 0 ); - m_buttonSizer->Add(itemStaticText12, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP|wxADJUST_MINSIZE, 5); - - m_newCharacter = new wxButton( itemDialog1, ID_RICHTEXTSTYLEORGANISERDIALOG_NEW_CHAR, _("New &Character Style..."), wxDefaultPosition, wxDefaultSize, 0 ); - m_newCharacter->SetHelpText(_("Click to create a new character style.")); - if (wxRichTextStyleOrganiserDialog::ShowToolTips()) - m_newCharacter->SetToolTip(_("Click to create a new character style.")); - m_buttonSizer->Add(m_newCharacter, 0, wxGROW|wxALL, 5); - - m_newParagraph = new wxButton( itemDialog1, ID_RICHTEXTSTYLEORGANISERDIALOG_NEW_PARA, _("New &Paragraph Style..."), wxDefaultPosition, wxDefaultSize, 0 ); - m_newParagraph->SetHelpText(_("Click to create a new paragraph style.")); - if (wxRichTextStyleOrganiserDialog::ShowToolTips()) - m_newParagraph->SetToolTip(_("Click to create a new paragraph style.")); - m_buttonSizer->Add(m_newParagraph, 0, wxGROW|wxLEFT|wxRIGHT|wxBOTTOM, 5); - - m_newList = new wxButton( itemDialog1, ID_RICHTEXTSTYLEORGANISERDIALOG_NEW_LIST, _("New &List Style..."), wxDefaultPosition, wxDefaultSize, 0 ); - m_newList->SetHelpText(_("Click to create a new list style.")); - if (wxRichTextStyleOrganiserDialog::ShowToolTips()) - m_newList->SetToolTip(_("Click to create a new list style.")); - m_buttonSizer->Add(m_newList, 0, wxGROW|wxLEFT|wxRIGHT|wxBOTTOM, 5); - - m_buttonSizer->Add(5, 5, 1, wxALIGN_CENTER_HORIZONTAL|wxALL, 5); - - m_applyStyle = new wxButton( itemDialog1, ID_RICHTEXTSTYLEORGANISERDIALOG_APPLY, _("&Apply Style"), wxDefaultPosition, wxDefaultSize, 0 ); - m_applyStyle->SetHelpText(_("Click to apply the selected style.")); - if (wxRichTextStyleOrganiserDialog::ShowToolTips()) - m_applyStyle->SetToolTip(_("Click to apply the selected style.")); - m_buttonSizer->Add(m_applyStyle, 0, wxGROW|wxALL, 5); - - m_renameStyle = new wxButton( itemDialog1, ID_RICHTEXTSTYLEORGANISERDIALOG_RENAME, _("&Rename Style..."), wxDefaultPosition, wxDefaultSize, 0 ); - m_renameStyle->SetHelpText(_("Click to rename the selected style.")); - if (wxRichTextStyleOrganiserDialog::ShowToolTips()) - m_renameStyle->SetToolTip(_("Click to rename the selected style.")); - m_buttonSizer->Add(m_renameStyle, 0, wxGROW|wxLEFT|wxRIGHT|wxBOTTOM, 5); - - m_editStyle = new wxButton( itemDialog1, ID_RICHTEXTSTYLEORGANISERDIALOG_EDIT, _("&Edit Style..."), wxDefaultPosition, wxDefaultSize, 0 ); - m_editStyle->SetHelpText(_("Click to edit the selected style.")); - if (wxRichTextStyleOrganiserDialog::ShowToolTips()) - m_editStyle->SetToolTip(_("Click to edit the selected style.")); - m_buttonSizer->Add(m_editStyle, 0, wxGROW|wxLEFT|wxRIGHT|wxBOTTOM, 5); - - m_deleteStyle = new wxButton( itemDialog1, ID_RICHTEXTSTYLEORGANISERDIALOG_DELETE, _("&Delete Style..."), wxDefaultPosition, wxDefaultSize, 0 ); - m_deleteStyle->SetHelpText(_("Click to delete the selected style.")); - if (wxRichTextStyleOrganiserDialog::ShowToolTips()) - m_deleteStyle->SetToolTip(_("Click to delete the selected style.")); - m_buttonSizer->Add(m_deleteStyle, 0, wxGROW|wxLEFT|wxRIGHT|wxBOTTOM, 5); - - m_buttonSizer->Add(5, 5, 1, wxALIGN_CENTER_HORIZONTAL|wxALL, 5); - - m_closeButton = new wxButton( itemDialog1, wxID_CANCEL, _("Close"), wxDefaultPosition, wxDefaultSize, 0 ); - m_closeButton->SetDefault(); - m_closeButton->SetHelpText(_("Click to close this window.")); - if (wxRichTextStyleOrganiserDialog::ShowToolTips()) - m_closeButton->SetToolTip(_("Click to close this window.")); - m_buttonSizer->Add(m_closeButton, 0, wxGROW|wxALL, 5); - - m_bottomButtonSizer = new wxBoxSizer(wxHORIZONTAL); - m_innerSizer->Add(m_bottomButtonSizer, 0, wxGROW, 5); - - m_restartNumberingCtrl = new wxCheckBox( itemDialog1, ID_RICHTEXTSTYLEORGANISERDIALOG_RESTART_NUMBERING, _("&Restart numbering"), wxDefaultPosition, wxDefaultSize, 0 ); - m_restartNumberingCtrl->SetValue(false); - m_restartNumberingCtrl->SetHelpText(_("Check to restart numbering.")); - if (wxRichTextStyleOrganiserDialog::ShowToolTips()) - m_restartNumberingCtrl->SetToolTip(_("Check to restart numbering.")); - m_bottomButtonSizer->Add(m_restartNumberingCtrl, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); - - m_bottomButtonSizer->Add(5, 5, 1, wxALIGN_CENTER_VERTICAL|wxALL, 5); - - m_okButton = new wxButton( itemDialog1, wxID_OK, _("OK"), wxDefaultPosition, wxDefaultSize, 0 ); - m_okButton->SetDefault(); - m_okButton->SetHelpText(_("Click to confirm your selection.")); - if (wxRichTextStyleOrganiserDialog::ShowToolTips()) - m_okButton->SetToolTip(_("Click to confirm your selection.")); - m_bottomButtonSizer->Add(m_okButton, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); - - m_cancelButton = new wxButton( itemDialog1, wxID_CANCEL, _("Cancel"), wxDefaultPosition, wxDefaultSize, 0 ); - m_cancelButton->SetHelpText(_("Click to cancel this window.")); - if (wxRichTextStyleOrganiserDialog::ShowToolTips()) - m_cancelButton->SetToolTip(_("Click to cancel this window.")); - m_bottomButtonSizer->Add(m_cancelButton, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); - -////@end wxRichTextStyleOrganiserDialog content construction - - if ((m_flags & wxRICHTEXT_ORGANISER_CREATE_STYLES) == 0) - { - m_buttonSizer->Show(m_newCharacter, false); - m_buttonSizer->Show(m_newParagraph, false); - m_buttonSizer->Show(m_newList, false); - } - if ((m_flags & wxRICHTEXT_ORGANISER_DELETE_STYLES) == 0) - { - m_buttonSizer->Show(m_deleteStyle, false); - } - if ((m_flags & wxRICHTEXT_ORGANISER_APPLY_STYLES) == 0) - { - m_buttonSizer->Show(m_applyStyle, false); - } - if ((m_flags & wxRICHTEXT_ORGANISER_EDIT_STYLES) == 0) - { - m_buttonSizer->Show(m_editStyle, false); - } - if ((m_flags & wxRICHTEXT_ORGANISER_RENAME_STYLES) == 0) - { - m_buttonSizer->Show(m_renameStyle, false); - } - if ((m_flags & wxRICHTEXT_ORGANISER_RENUMBER) == 0) - { - m_bottomButtonSizer->Show(m_restartNumberingCtrl, false); - } - - if ((m_flags & wxRICHTEXT_ORGANISER_OK_CANCEL) == 0) - { - m_bottomButtonSizer->Show(m_okButton, false); - m_bottomButtonSizer->Show(m_cancelButton, false); - } - else - { - m_buttonSizer->Show(m_closeButton, false); - } - - // No buttons in the vertical group are shown, so hide the whole sizer - if ((m_flags & wxRICHTEXT_ORGANISER_ORGANISE) == 0) - { - m_buttonSizerParent->Show(m_buttonSizer, false); - } - - // No buttons in the horizontal group are shown, so hide the whole sizer - if ((m_flags & (wxRICHTEXT_ORGANISER_OK_CANCEL|wxRICHTEXT_ORGANISER_RENUMBER)) == 0) - { - m_innerSizer->Show(m_bottomButtonSizer, false); - } - - if (hideTypeSelector) - { - m_stylesListBox->GetStyleListBox()->SetStyleType(typesToShow); - } - - m_stylesListBox->SetStyleSheet(m_richTextStyleSheet); - m_stylesListBox->SetRichTextCtrl(m_richTextCtrl); - m_stylesListBox->UpdateStyles(); - m_stylesListBox->GetStyleListBox()->SetAutoSetSelection(false); // stop idle-time auto selection - if (m_stylesListBox->GetStyleListBox()->GetItemCount() > 0) - { - m_stylesListBox->GetStyleListBox()->SetSelection(0); - ShowPreview(); - } -} - -/*! - * Should we show tooltips? - */ - -/// Get selected style name or definition -wxString wxRichTextStyleOrganiserDialog::GetSelectedStyle() const -{ - wxRichTextStyleDefinition* def = GetSelectedStyleDefinition(); - if (def) - return def->GetName(); - else - return wxEmptyString; -} - -wxRichTextStyleDefinition* wxRichTextStyleOrganiserDialog::GetSelectedStyleDefinition() const -{ - int sel = m_stylesListBox->GetStyleListBox()->GetSelection(); - return m_stylesListBox->GetStyleListBox()->GetStyle(sel); -} - - -/// Transfer data from/to window -bool wxRichTextStyleOrganiserDialog::TransferDataFromWindow() -{ - if (!wxDialog::TransferDataFromWindow()) - return false; - - m_restartNumbering = m_restartNumberingCtrl->GetValue(); - - return true; -} - -bool wxRichTextStyleOrganiserDialog::TransferDataToWindow() -{ - if (!wxDialog::TransferDataToWindow()) - return false; - - m_restartNumberingCtrl->SetValue(m_restartNumbering); - - return true; -} - -/// Show preview for given or selected preview -void wxRichTextStyleOrganiserDialog::ShowPreview(int sel) -{ - static const wxChar* s_para1 = wxT("Lorem ipsum dolor sit amet, consectetuer adipiscing elit. \ -Nullam ante sapien, vestibulum nonummy, pulvinar sed, luctus ut, lacus.\n"); - - static const wxChar* s_para2List = wxT("Duis pharetra consequat dui. Nullam vitae justo id mauris lobortis interdum.\n"); - - static const wxChar* s_para2 = wxT("Duis pharetra consequat dui. Cum sociis natoque penatibus \ -et magnis dis parturient montes, nascetur ridiculus mus. Nullam vitae justo id mauris lobortis interdum.\n"); - - static const wxChar* s_para3 = wxT("Integer convallis dolor at augue \ -iaculis malesuada. Donec bibendum ipsum ut ante porta fringilla.\n"); - - if (sel == -1) - { - sel = m_stylesListBox->GetStyleListBox()->GetSelection(); - if (sel == -1) - return; - } - - wxRichTextStyleDefinition* def = m_stylesListBox->GetStyleListBox()->GetStyle(sel); - - wxRichTextListStyleDefinition* listDef = wxDynamicCast(def, wxRichTextListStyleDefinition); - - wxStaticText* labelCtrl = (wxStaticText*) FindWindow(ID_RICHTEXTSTYLEORGANISERDIALOG_CURRENT_STYLE); - if (labelCtrl) - labelCtrl->SetLabel(def->GetName() + wxT(":")); - - wxTextAttrEx attr(def->GetStyleMergedWithBase(GetStyleSheet())); - - wxFont font(m_previewCtrl->GetFont()); - font.SetPointSize(9); - m_previewCtrl->SetFont(font); - - wxTextAttrEx normalParaAttr; - normalParaAttr.SetFont(font); - normalParaAttr.SetTextColour(wxColour(wxT("LIGHT GREY"))); - - m_previewCtrl->Freeze(); - m_previewCtrl->Clear(); - - m_previewCtrl->BeginStyle(normalParaAttr); - m_previewCtrl->WriteText(s_para1); - m_previewCtrl->EndStyle(); - - m_previewCtrl->BeginStyle(attr); - - if (listDef) - { - long listStart = m_previewCtrl->GetInsertionPoint() + 1; - int i; - for (i = 0; i < 10; i++) - { - wxTextAttrEx levelAttr = * listDef->GetLevelAttributes(i); - levelAttr.SetBulletNumber(1); - m_previewCtrl->BeginStyle(levelAttr); - m_previewCtrl->WriteText(wxString::Format(wxT("List level %d. "), i+1) + s_para2List); - m_previewCtrl->EndStyle(); - } - long listEnd = m_previewCtrl->GetInsertionPoint(); - m_previewCtrl->NumberList(wxRichTextRange(listStart, listEnd), listDef); - } - else - { - m_previewCtrl->WriteText(s_para2); - } - - m_previewCtrl->EndStyle(); - - m_previewCtrl->BeginStyle(normalParaAttr); - m_previewCtrl->WriteText(s_para3); - m_previewCtrl->EndStyle(); - - m_previewCtrl->Thaw(); -} - -/// Clears the preview -void wxRichTextStyleOrganiserDialog::ClearPreview() -{ - m_previewCtrl->Clear(); - wxStaticText* labelCtrl = (wxStaticText*) FindWindow(ID_RICHTEXTSTYLEORGANISERDIALOG_CURRENT_STYLE); - if (labelCtrl) - labelCtrl->SetLabel(wxEmptyString); -} - -bool wxRichTextStyleOrganiserDialog::ApplyStyle(wxRichTextCtrl* ctrl) -{ - int sel = m_stylesListBox->GetStyleListBox()->GetSelection(); - if (sel == -1) - return false; - if (!ctrl) - ctrl = GetRichTextCtrl(); - if (!ctrl) - return false; - if (!ctrl->HasSelection()) - return false; - - - wxRichTextStyleDefinition* def = m_stylesListBox->GetStyleListBox()->GetStyle(sel); - wxRichTextListStyleDefinition* listDef = wxDynamicCast(def, wxRichTextListStyleDefinition); - - if (listDef && m_restartNumberingCtrl->GetValue()) - { - wxRichTextRange range = ctrl->GetSelectionRange(); - return ctrl->SetListStyle(range, listDef, wxRICHTEXT_SETSTYLE_WITH_UNDO|wxRICHTEXT_SETSTYLE_RENUMBER); - } - else - { - return ctrl->ApplyStyle(def); - } -} - -/*! - * Get bitmap resources - */ - -wxBitmap wxRichTextStyleOrganiserDialog::GetBitmapResource( const wxString& name ) -{ - // Bitmap retrieval -////@begin wxRichTextStyleOrganiserDialog bitmap retrieval - wxUnusedVar(name); - return wxNullBitmap; -////@end wxRichTextStyleOrganiserDialog bitmap retrieval -} - -/*! - * Get icon resources - */ - -wxIcon wxRichTextStyleOrganiserDialog::GetIconResource( const wxString& name ) -{ - // Icon retrieval -////@begin wxRichTextStyleOrganiserDialog icon retrieval - wxUnusedVar(name); - return wxNullIcon; -////@end wxRichTextStyleOrganiserDialog icon retrieval -} - -/*! - * wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_RICHTEXTSTYLEORGANISERDIALOG_APPLY - */ - -void wxRichTextStyleOrganiserDialog::OnApplyClick( wxCommandEvent& WXUNUSED(event) ) -{ - ApplyStyle(); -} - -/*! - * wxEVT_UPDATE_UI event handler for ID_RICHTEXTSTYLEORGANISERDIALOG_APPLY - */ - -void wxRichTextStyleOrganiserDialog::OnApplyUpdate( wxUpdateUIEvent& event ) -{ - event.Enable(((GetFlags() & wxRICHTEXT_ORGANISER_APPLY_STYLES) != 0) && m_stylesListBox->GetStyleListBox()->GetSelection() != wxNOT_FOUND); -} - - -/*! - * wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_RICHTEXTSTYLEORGANISERDIALOG_NEW_CHAR - */ - -void wxRichTextStyleOrganiserDialog::OnNewCharClick( wxCommandEvent& WXUNUSED(event) ) -{ - wxString styleName = wxGetTextFromUser(_("Enter a character style name"), _("New Style")); - if (!styleName.IsEmpty()) - { - if (GetStyleSheet()->FindCharacterStyle(styleName)) - { - wxMessageBox(_("Sorry, that name is taken. Please choose another."), _("New Style"), wxICON_EXCLAMATION|wxOK, this); - return; - } - - wxRichTextCharacterStyleDefinition* style = new wxRichTextCharacterStyleDefinition(styleName); - - int pages = wxRICHTEXT_FORMAT_FONT|wxRICHTEXT_FORMAT_STYLE_EDITOR; - wxRichTextFormattingDialog formatDlg; - formatDlg.SetStyleDefinition(*style, GetStyleSheet()); - formatDlg.Create(pages, this); - - if (formatDlg.ShowModal() == wxID_OK) - { - wxRichTextCharacterStyleDefinition* charDef = wxDynamicCast(formatDlg.GetStyleDefinition(), wxRichTextCharacterStyleDefinition); - - (*((wxRichTextCharacterStyleDefinition* ) style)) = (*charDef); - - GetStyleSheet()->AddCharacterStyle(style); - - m_stylesListBox->UpdateStyles(); - ShowPreview(); - } - else - delete style; - } -} - -/*! - * wxEVT_UPDATE_UI event handler for ID_RICHTEXTSTYLEORGANISERDIALOG_NEW_CHAR - */ - -void wxRichTextStyleOrganiserDialog::OnNewCharUpdate( wxUpdateUIEvent& event ) -{ - event.Enable((GetFlags() & wxRICHTEXT_ORGANISER_CREATE_STYLES) != 0); -} - - -/*! - * wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_RICHTEXTSTYLEORGANISERDIALOG_NEW_PARA - */ - -void wxRichTextStyleOrganiserDialog::OnNewParaClick( wxCommandEvent& WXUNUSED(event) ) -{ - wxString styleName = wxGetTextFromUser(_("Enter a paragraph style name"), _("New Style")); - if (!styleName.IsEmpty()) - { - if (GetStyleSheet()->FindParagraphStyle(styleName)) - { - wxMessageBox(_("Sorry, that name is taken. Please choose another."), _("New Style"), wxICON_EXCLAMATION|wxOK, this); - return; - } - - wxRichTextParagraphStyleDefinition* style = new wxRichTextParagraphStyleDefinition(styleName); - - int pages = wxRICHTEXT_FORMAT_STYLE_EDITOR|wxRICHTEXT_FORMAT_FONT|wxRICHTEXT_FORMAT_INDENTS_SPACING|wxRICHTEXT_FORMAT_TABS|wxRICHTEXT_FORMAT_BULLETS; - wxRichTextFormattingDialog formatDlg; - formatDlg.SetStyleDefinition(*style, GetStyleSheet()); - formatDlg.Create(pages, this); - - if (formatDlg.ShowModal() == wxID_OK) - { - wxRichTextParagraphStyleDefinition* paraDef = wxDynamicCast(formatDlg.GetStyleDefinition(), wxRichTextParagraphStyleDefinition); - - (*((wxRichTextParagraphStyleDefinition* ) style)) = (*paraDef); - - GetStyleSheet()->AddParagraphStyle(style); - - m_stylesListBox->UpdateStyles(); - ShowPreview(); - } - else - delete style; - } -} - -/*! - * wxEVT_UPDATE_UI event handler for ID_RICHTEXTSTYLEORGANISERDIALOG_NEW_PARA - */ - -void wxRichTextStyleOrganiserDialog::OnNewParaUpdate( wxUpdateUIEvent& event ) -{ - event.Enable((GetFlags() & wxRICHTEXT_ORGANISER_CREATE_STYLES) != 0); -} - - -/*! - * wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_RICHTEXTSTYLEORGANISERDIALOG_EDIT - */ - -void wxRichTextStyleOrganiserDialog::OnEditClick( wxCommandEvent& WXUNUSED(event) ) -{ - int sel = m_stylesListBox->GetStyleListBox()->GetSelection(); - if (sel != wxNOT_FOUND) - { - wxRichTextStyleDefinition* def = m_stylesListBox->GetStyleListBox()->GetStyle(sel); - - int pages = wxRICHTEXT_FORMAT_STYLE_EDITOR; - - if (def->IsKindOf(CLASSINFO(wxRichTextCharacterStyleDefinition))) - { - pages |= wxRICHTEXT_FORMAT_FONT; - } - else if (def->IsKindOf(CLASSINFO(wxRichTextListStyleDefinition))) - { - pages |= wxRICHTEXT_FORMAT_LIST_STYLE|wxRICHTEXT_FORMAT_FONT|wxRICHTEXT_FORMAT_INDENTS_SPACING; - } - else if (def->IsKindOf(CLASSINFO(wxRichTextParagraphStyleDefinition))) - { - pages |= wxRICHTEXT_FORMAT_FONT|wxRICHTEXT_FORMAT_INDENTS_SPACING|wxRICHTEXT_FORMAT_TABS|wxRICHTEXT_FORMAT_BULLETS; - } - - wxRichTextFormattingDialog formatDlg; - formatDlg.SetStyleDefinition(*def, GetStyleSheet()); - formatDlg.Create(pages, this); - - if (formatDlg.ShowModal() == wxID_OK) - { - wxRichTextParagraphStyleDefinition* paraDef = wxDynamicCast(formatDlg.GetStyleDefinition(), wxRichTextParagraphStyleDefinition); - wxRichTextCharacterStyleDefinition* charDef = wxDynamicCast(formatDlg.GetStyleDefinition(), wxRichTextCharacterStyleDefinition); - wxRichTextListStyleDefinition* listDef = wxDynamicCast(formatDlg.GetStyleDefinition(), wxRichTextListStyleDefinition); - - if (listDef) - { - (*((wxRichTextListStyleDefinition* ) def)) = (*listDef); - } - else if (paraDef) - { - (*((wxRichTextParagraphStyleDefinition* ) def)) = (*paraDef); - } - else - { - (*((wxRichTextCharacterStyleDefinition* ) def)) = (*charDef); - } - - m_stylesListBox->UpdateStyles(); - m_stylesListBox->GetStyleListBox()->SetSelection(sel); - ShowPreview(); - } - } -} - -/*! - * wxEVT_UPDATE_UI event handler for ID_RICHTEXTSTYLEORGANISERDIALOG_EDIT - */ - -void wxRichTextStyleOrganiserDialog::OnEditUpdate( wxUpdateUIEvent& event ) -{ - event.Enable(((GetFlags() & wxRICHTEXT_ORGANISER_EDIT_STYLES) != 0) && m_stylesListBox->GetStyleListBox()->GetSelection() != wxNOT_FOUND); -} - - -/*! - * wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_RICHTEXTSTYLEORGANISERDIALOG_DELETE - */ - -void wxRichTextStyleOrganiserDialog::OnDeleteClick( wxCommandEvent& WXUNUSED(event) ) -{ - int sel = m_stylesListBox->GetStyleListBox()->GetSelection(); - if (sel != wxNOT_FOUND) - { - wxRichTextStyleDefinition* def = m_stylesListBox->GetStyleListBox()->GetStyle(sel); - wxString name(def->GetName()); - if (wxYES == wxMessageBox(wxString::Format(_("Delete style %s?"), (const wxChar*) name), _("Delete Style"), wxYES_NO|wxICON_QUESTION, this)) - { - m_stylesListBox->GetStyleListBox()->SetItemCount(0); - - if (def->IsKindOf(CLASSINFO(wxRichTextListStyleDefinition))) - GetStyleSheet()->RemoveListStyle((wxRichTextListStyleDefinition*) def, true); - else if (def->IsKindOf(CLASSINFO(wxRichTextParagraphStyleDefinition))) - GetStyleSheet()->RemoveParagraphStyle((wxRichTextParagraphStyleDefinition*) def, true); - else if (def->IsKindOf(CLASSINFO(wxRichTextCharacterStyleDefinition))) - GetStyleSheet()->RemoveCharacterStyle((wxRichTextCharacterStyleDefinition*) def, true); - - m_stylesListBox->UpdateStyles(); - - if (m_stylesListBox->GetStyleListBox()->GetSelection() != -1) - ShowPreview(); - else - ClearPreview(); - } - } -} - -/*! - * wxEVT_UPDATE_UI event handler for ID_RICHTEXTSTYLEORGANISERDIALOG_DELETE - */ - -void wxRichTextStyleOrganiserDialog::OnDeleteUpdate( wxUpdateUIEvent& event ) -{ - event.Enable(((GetFlags() & wxRICHTEXT_ORGANISER_DELETE_STYLES) != 0) && m_stylesListBox->GetStyleListBox()->GetSelection() != wxNOT_FOUND); -} - -/*! - * wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_RICHTEXTSTYLEORGANISERDIALOG_NEW_LIST - */ - -void wxRichTextStyleOrganiserDialog::OnNewListClick( wxCommandEvent& WXUNUSED(event) ) -{ - wxString styleName = wxGetTextFromUser(_("Enter a list style name"), _("New Style")); - if (!styleName.IsEmpty()) - { - if (GetStyleSheet()->FindListStyle(styleName)) - { - wxMessageBox(_("Sorry, that name is taken. Please choose another."), _("New Style"), wxICON_EXCLAMATION|wxOK, this); - return; - } - - wxRichTextListStyleDefinition* style = new wxRichTextListStyleDefinition(styleName); - - // Initialize the style to make it easier to edit - int i; - for (i = 0; i < 10; i++) - { - wxString bulletSymbol; - if (i == 0) - bulletSymbol = wxT("*"); - else if (i == 1) - bulletSymbol = wxT("-"); - else if (i == 2) - bulletSymbol = wxT("*"); - else if (i == 3) - bulletSymbol = wxT("-"); - else - bulletSymbol = wxT("*"); - - style->SetAttributes(i, (i+1)*60, 60, wxTEXT_ATTR_BULLET_STYLE_SYMBOL, bulletSymbol); - } - - int pages = wxRICHTEXT_FORMAT_LIST_STYLE|wxRICHTEXT_FORMAT_STYLE_EDITOR|wxRICHTEXT_FORMAT_FONT|wxRICHTEXT_FORMAT_INDENTS_SPACING; - wxRichTextFormattingDialog formatDlg; - formatDlg.SetStyleDefinition(*style, GetStyleSheet()); - formatDlg.Create(pages, this); - - if (formatDlg.ShowModal() == wxID_OK) - { - wxRichTextListStyleDefinition* listDef = wxDynamicCast(formatDlg.GetStyleDefinition(), wxRichTextListStyleDefinition); - - (*((wxRichTextListStyleDefinition* ) style)) = (*listDef); - - GetStyleSheet()->AddListStyle(style); - - m_stylesListBox->UpdateStyles(); - ShowPreview(); - } - else - delete style; - } -} - -/*! - * wxEVT_UPDATE_UI event handler for ID_RICHTEXTSTYLEORGANISERDIALOG_NEW_LIST - */ - -void wxRichTextStyleOrganiserDialog::OnNewListUpdate( wxUpdateUIEvent& event ) -{ - event.Enable((GetFlags() & wxRICHTEXT_ORGANISER_CREATE_STYLES) != 0); -} - -/*! - * wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_RICHTEXTSTYLEORGANISERDIALOG_RENAME - */ - -void wxRichTextStyleOrganiserDialog::OnRenameClick( wxCommandEvent& WXUNUSED(event) ) -{ - int sel = m_stylesListBox->GetStyleListBox()->GetSelection(); - if (sel == -1) - return; - wxRichTextStyleDefinition* def = m_stylesListBox->GetStyleListBox()->GetStyle(sel); - if (!def) - return; - - wxString styleName = wxGetTextFromUser(_("Enter a new style name"), _("New Style"), def->GetName()); - if (!styleName.IsEmpty()) - { - if (styleName == def->GetName()) - return; - - if (GetStyleSheet()->FindParagraphStyle(styleName) || GetStyleSheet()->FindCharacterStyle(styleName) || GetStyleSheet()->FindListStyle(styleName)) - { - wxMessageBox(_("Sorry, that name is taken. Please choose another."), _("New Style"), wxICON_EXCLAMATION|wxOK, this); - return; - } - - def->SetName(styleName); - m_stylesListBox->UpdateStyles(); - } -} - -/*! - * wxEVT_UPDATE_UI event handler for ID_RICHTEXTSTYLEORGANISERDIALOG_RENAME - */ - -void wxRichTextStyleOrganiserDialog::OnRenameUpdate( wxUpdateUIEvent& event ) -{ - event.Enable(((GetFlags() & wxRICHTEXT_ORGANISER_RENAME_STYLES) != 0) && m_stylesListBox->GetStyleListBox()->GetSelection() != wxNOT_FOUND); -} - -/// List selection -void wxRichTextStyleOrganiserDialog::OnListSelection(wxCommandEvent& event) -{ - if (event.GetEventObject() == m_stylesListBox->GetStyleListBox()) - ShowPreview(); - else - event.Skip(); -} - -#endif - // wxUSE_RICHTEXT - diff --git a/wxWidgets/src/richtext/richtextstylepage.cpp b/wxWidgets/src/richtext/richtextstylepage.cpp deleted file mode 100644 index a881e387bb..0000000000 --- a/wxWidgets/src/richtext/richtextstylepage.cpp +++ /dev/null @@ -1,305 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/richtext/richtextstylepage.cpp -// Purpose: -// Author: Julian Smart -// Modified by: -// Created: 10/5/2006 11:34:55 AM -// RCS-ID: $Id: richtextstylepage.cpp 65919 2010-10-25 09:24:29Z JS $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#if wxUSE_RICHTEXT - -#include "wx/richtext/richtextstylepage.h" - -/*! - * wxRichTextStylePage type definition - */ - -IMPLEMENT_DYNAMIC_CLASS( wxRichTextStylePage, wxPanel ) - -/*! - * wxRichTextStylePage event table definition - */ - -BEGIN_EVENT_TABLE( wxRichTextStylePage, wxPanel ) - -////@begin wxRichTextStylePage event table entries - EVT_UPDATE_UI( ID_RICHTEXTSTYLEPAGE_NEXT_STYLE, wxRichTextStylePage::OnNextStyleUpdate ) - -////@end wxRichTextStylePage event table entries - -END_EVENT_TABLE() - -/*! - * wxRichTextStylePage constructors - */ - -wxRichTextStylePage::wxRichTextStylePage( ) -{ - Init(); -} - -wxRichTextStylePage::wxRichTextStylePage( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style ) -{ - Init(); - Create(parent, id, pos, size, style); -} - -/*! - * Initialise members - */ - -void wxRichTextStylePage::Init() -{ -////@begin wxRichTextStylePage member initialisation - m_styleName = NULL; - m_basedOn = NULL; - m_nextStyle = NULL; -////@end wxRichTextStylePage member initialisation -} - -/*! - * wxRichTextStylePage creator - */ - -bool wxRichTextStylePage::Create( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style ) -{ -////@begin wxRichTextStylePage creation - wxPanel::Create( parent, id, pos, size, style ); - - CreateControls(); - if (GetSizer()) - { - GetSizer()->SetSizeHints(this); - } - Centre(); -////@end wxRichTextStylePage creation - return true; -} - -/*! - * Control creation for wxRichTextStylePage - */ - -void wxRichTextStylePage::CreateControls() -{ -////@begin wxRichTextStylePage content construction - // Generated by DialogBlocks, 25/10/2010 10:21:49 (unregistered) - - wxRichTextStylePage* itemPanel1 = this; - - wxBoxSizer* itemBoxSizer2 = new wxBoxSizer(wxVERTICAL); - itemPanel1->SetSizer(itemBoxSizer2); - - wxBoxSizer* itemBoxSizer3 = new wxBoxSizer(wxVERTICAL); - itemBoxSizer2->Add(itemBoxSizer3, 1, wxGROW|wxALL, 5); - - wxBoxSizer* itemBoxSizer4 = new wxBoxSizer(wxHORIZONTAL); - itemBoxSizer3->Add(itemBoxSizer4, 0, wxGROW, 5); - - wxBoxSizer* itemBoxSizer5 = new wxBoxSizer(wxVERTICAL); - itemBoxSizer4->Add(itemBoxSizer5, 1, wxGROW, 5); - - wxStaticText* itemStaticText6 = new wxStaticText( itemPanel1, wxID_STATIC, _("&Style:"), wxDefaultPosition, wxDefaultSize, 0 ); - itemBoxSizer5->Add(itemStaticText6, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP|wxADJUST_MINSIZE, 5); - - m_styleName = new wxTextCtrl( itemPanel1, ID_RICHTEXTSTYLEPAGE_STYLE_NAME, wxEmptyString, wxDefaultPosition, wxSize(300, -1), wxTE_READONLY ); - m_styleName->SetHelpText(_("The style name.")); - if (wxRichTextStylePage::ShowToolTips()) - m_styleName->SetToolTip(_("The style name.")); - itemBoxSizer5->Add(m_styleName, 0, wxGROW|wxALL, 5); - - wxStaticText* itemStaticText8 = new wxStaticText( itemPanel1, wxID_STATIC, _("&Based on:"), wxDefaultPosition, wxDefaultSize, 0 ); - itemBoxSizer5->Add(itemStaticText8, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP|wxADJUST_MINSIZE, 5); - - wxArrayString m_basedOnStrings; - m_basedOn = new wxComboBox( itemPanel1, ID_RICHTEXTSTYLEPAGE_BASED_ON, wxEmptyString, wxDefaultPosition, wxSize(300, -1), m_basedOnStrings, wxCB_DROPDOWN ); - m_basedOn->SetHelpText(_("The style on which this style is based.")); - if (wxRichTextStylePage::ShowToolTips()) - m_basedOn->SetToolTip(_("The style on which this style is based.")); - itemBoxSizer5->Add(m_basedOn, 0, wxGROW|wxALL, 5); - - wxStaticText* itemStaticText10 = new wxStaticText( itemPanel1, wxID_STATIC, _("&Next style:"), wxDefaultPosition, wxDefaultSize, 0 ); - itemBoxSizer5->Add(itemStaticText10, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP|wxADJUST_MINSIZE, 5); - - wxArrayString m_nextStyleStrings; - m_nextStyle = new wxComboBox( itemPanel1, ID_RICHTEXTSTYLEPAGE_NEXT_STYLE, wxEmptyString, wxDefaultPosition, wxSize(300, -1), m_nextStyleStrings, wxCB_DROPDOWN ); - m_nextStyle->SetHelpText(_("The default style for the next paragraph.")); - if (wxRichTextStylePage::ShowToolTips()) - m_nextStyle->SetToolTip(_("The default style for the next paragraph.")); - itemBoxSizer5->Add(m_nextStyle, 0, wxGROW|wxALL, 5); - - itemBoxSizer3->Add(5, 5, 1, wxALIGN_CENTER_HORIZONTAL|wxALL, 5); - -////@end wxRichTextStylePage content construction -} - -/// Transfer data from/to window -bool wxRichTextStylePage::TransferDataFromWindow() -{ - wxPanel::TransferDataFromWindow(); - - wxRichTextStyleDefinition* def = wxRichTextFormattingDialog::GetDialogStyleDefinition(this); - if (def) - { - wxRichTextParagraphStyleDefinition* paraDef = wxDynamicCast(def, wxRichTextParagraphStyleDefinition); - if (paraDef) - paraDef->SetNextStyle(m_nextStyle->GetValue()); - - def->SetName(m_styleName->GetValue()); - def->SetBaseStyle(m_basedOn->GetValue()); - } - - return true; -} - -bool wxRichTextStylePage::TransferDataToWindow() -{ - wxPanel::TransferDataToWindow(); - - wxRichTextStyleDefinition* def = wxRichTextFormattingDialog::GetDialogStyleDefinition(this); - if (def) - { - wxRichTextParagraphStyleDefinition* paraDef = wxDynamicCast(def, wxRichTextParagraphStyleDefinition); - wxRichTextListStyleDefinition* listDef = wxDynamicCast(def, wxRichTextListStyleDefinition); - // wxRichTextCharacterStyleDefinition* charDef = wxDynamicCast(def, wxRichTextCharacterStyleDefinition); - wxRichTextStyleSheet* sheet = wxRichTextFormattingDialog::GetDialog(this)->GetStyleSheet(); - - m_styleName->SetValue(def->GetName()); - - m_nextStyle->Freeze(); - m_basedOn->Freeze(); - - if (listDef) - { - if (m_nextStyle->GetCount() == 0) - { - if (sheet) - { - size_t i; - for (i = 0; i < sheet->GetListStyleCount(); i++) - { - wxRichTextListStyleDefinition* p = wxDynamicCast(sheet->GetListStyle(i), wxRichTextListStyleDefinition); - if (p) - m_nextStyle->Append(p->GetName()); - } - } - } - m_nextStyle->SetValue(listDef->GetNextStyle()); - } - else if (paraDef) - { - if (m_nextStyle->GetCount() == 0) - { - if (sheet) - { - size_t i; - for (i = 0; i < sheet->GetParagraphStyleCount(); i++) - { - wxRichTextParagraphStyleDefinition* p = wxDynamicCast(sheet->GetParagraphStyle(i), wxRichTextParagraphStyleDefinition); - if (p) - m_nextStyle->Append(p->GetName()); - } - } - } - m_nextStyle->SetValue(paraDef->GetNextStyle()); - } - - if (m_basedOn->GetCount() == 0) - { - if (sheet) - { - if (listDef) - { - size_t i; - for (i = 0; i < sheet->GetListStyleCount(); i++) - { - wxRichTextListStyleDefinition* p = wxDynamicCast(sheet->GetListStyle(i), wxRichTextListStyleDefinition); - if (p) - m_basedOn->Append(p->GetName()); - } - } - else if (paraDef) - { - size_t i; - for (i = 0; i < sheet->GetParagraphStyleCount(); i++) - { - wxRichTextParagraphStyleDefinition* p = wxDynamicCast(sheet->GetParagraphStyle(i), wxRichTextParagraphStyleDefinition); - if (p) - m_basedOn->Append(p->GetName()); - } - } - else - { - size_t i; - for (i = 0; i < sheet->GetCharacterStyleCount(); i++) - { - wxRichTextCharacterStyleDefinition* p = wxDynamicCast(sheet->GetCharacterStyle(i), wxRichTextCharacterStyleDefinition); - if (p) - m_basedOn->Append(p->GetName()); - } - } - } - } - - m_nextStyle->Thaw(); - m_basedOn->Thaw(); - - m_basedOn->SetValue(def->GetBaseStyle()); - } - - return true; -} - -wxTextAttrEx* wxRichTextStylePage::GetAttributes() -{ - return wxRichTextFormattingDialog::GetDialogAttributes(this); -} - -/*! - * Should we show tooltips? - */ - -bool wxRichTextStylePage::ShowToolTips() -{ - return wxRichTextFormattingDialog::ShowToolTips(); -} - -/*! - * Get bitmap resources - */ - -wxBitmap wxRichTextStylePage::GetBitmapResource( const wxString& name ) -{ - // Bitmap retrieval -////@begin wxRichTextStylePage bitmap retrieval - wxUnusedVar(name); - return wxNullBitmap; -////@end wxRichTextStylePage bitmap retrieval -} - -/*! - * Get icon resources - */ - -wxIcon wxRichTextStylePage::GetIconResource( const wxString& name ) -{ - // Icon retrieval -////@begin wxRichTextStylePage icon retrieval - wxUnusedVar(name); - return wxNullIcon; -////@end wxRichTextStylePage icon retrieval -} -/*! - * wxEVT_UPDATE_UI event handler for ID_RICHTEXTSTYLEPAGE_NEXT_STYLE - */ - -void wxRichTextStylePage::OnNextStyleUpdate( wxUpdateUIEvent& event ) -{ - wxRichTextStyleDefinition* def = wxRichTextFormattingDialog::GetDialogStyleDefinition(this); - event.Enable(def->IsKindOf(CLASSINFO(wxRichTextParagraphStyleDefinition))); -} - -#endif // wxUSE_RICHTEXT diff --git a/wxWidgets/src/richtext/richtextstyles.cpp b/wxWidgets/src/richtext/richtextstyles.cpp deleted file mode 100644 index 70af34f381..0000000000 --- a/wxWidgets/src/richtext/richtextstyles.cpp +++ /dev/null @@ -1,1265 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/richtext/richtextstyles.cpp -// Purpose: Style management for wxRichTextCtrl -// Author: Julian Smart -// Modified by: -// Created: 2005-09-30 -// RCS-ID: $Id: richtextstyles.cpp 67222 2011-03-17 09:23:18Z JS $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_RICHTEXT - -#include "wx/richtext/richtextstyles.h" - -#ifndef WX_PRECOMP - #include "wx/wx.h" -#endif - -#include "wx/filename.h" -#include "wx/clipbrd.h" -#include "wx/wfstream.h" -#include "wx/settings.h" - -#include "wx/richtext/richtextctrl.h" - -IMPLEMENT_CLASS(wxRichTextStyleDefinition, wxObject) -IMPLEMENT_CLASS(wxRichTextCharacterStyleDefinition, wxRichTextStyleDefinition) -IMPLEMENT_CLASS(wxRichTextParagraphStyleDefinition, wxRichTextStyleDefinition) -IMPLEMENT_CLASS(wxRichTextListStyleDefinition, wxRichTextParagraphStyleDefinition) - -/*! - * A definition - */ - -void wxRichTextStyleDefinition::Copy(const wxRichTextStyleDefinition& def) -{ - m_name = def.m_name; - m_baseStyle = def.m_baseStyle; - m_style = def.m_style; - m_description = def.m_description; -} - -bool wxRichTextStyleDefinition::Eq(const wxRichTextStyleDefinition& def) const -{ - return (m_name == def.m_name && m_baseStyle == def.m_baseStyle && m_style == def.m_style); -} - -/// Gets the style combined with the base style -wxRichTextAttr wxRichTextStyleDefinition::GetStyleMergedWithBase(const wxRichTextStyleSheet* sheet) const -{ - if (m_baseStyle.IsEmpty()) - return m_style; - - bool isParaStyle = IsKindOf(CLASSINFO(wxRichTextParagraphStyleDefinition)); - bool isCharStyle = IsKindOf(CLASSINFO(wxRichTextCharacterStyleDefinition)); - bool isListStyle = IsKindOf(CLASSINFO(wxRichTextListStyleDefinition)); - - // Collect the styles, detecting loops - wxArrayString styleNames; - wxList styles; - const wxRichTextStyleDefinition* def = this; - while (def) - { - styles.Insert((wxObject*) def); - styleNames.Add(def->GetName()); - - wxString baseStyleName = def->GetBaseStyle(); - if (!baseStyleName.IsEmpty() && styleNames.Index(baseStyleName) == wxNOT_FOUND) - { - if (isParaStyle) - def = sheet->FindParagraphStyle(baseStyleName); - else if (isCharStyle) - def = sheet->FindCharacterStyle(baseStyleName); - else if (isListStyle) - def = sheet->FindListStyle(baseStyleName); - else - def = sheet->FindStyle(baseStyleName); - } - else - def = NULL; - } - - wxRichTextAttr attr; - wxList::compatibility_iterator node = styles.GetFirst(); - while (node) - { - wxRichTextStyleDefinition* def = (wxRichTextStyleDefinition*) node->GetData(); - attr.Apply(def->GetStyle(), NULL); - node = node->GetNext(); - } - - return attr; -} - -/*! - * Paragraph style definition - */ - -void wxRichTextParagraphStyleDefinition::Copy(const wxRichTextParagraphStyleDefinition& def) -{ - wxRichTextStyleDefinition::Copy(def); - - m_nextStyle = def.m_nextStyle; -} - -bool wxRichTextParagraphStyleDefinition::operator ==(const wxRichTextParagraphStyleDefinition& def) const -{ - return (Eq(def) && m_nextStyle == def.m_nextStyle); -} - -/*! - * List style definition - */ - -void wxRichTextListStyleDefinition::Copy(const wxRichTextListStyleDefinition& def) -{ - wxRichTextParagraphStyleDefinition::Copy(def); - - int i; - for (i = 0; i < 10; i++) - m_levelStyles[i] = def.m_levelStyles[i]; -} - -bool wxRichTextListStyleDefinition::operator ==(const wxRichTextListStyleDefinition& def) const -{ - if (!Eq(def)) - return false; - int i; - for (i = 0; i < 10; i++) - if (!(m_levelStyles[i] == def.m_levelStyles[i])) - return false; - - return true; -} - -/// Sets/gets the attributes for the given level -void wxRichTextListStyleDefinition::SetLevelAttributes(int i, const wxRichTextAttr& attr) -{ - wxASSERT( (i >= 0 && i < 10) ); - if (i >= 0 && i < 10) - m_levelStyles[i] = attr; -} - -const wxRichTextAttr* wxRichTextListStyleDefinition::GetLevelAttributes(int i) const -{ - wxASSERT( (i >= 0 && i < 10) ); - if (i >= 0 && i < 10) - return & m_levelStyles[i]; - else - return NULL; -} - -wxRichTextAttr* wxRichTextListStyleDefinition::GetLevelAttributes(int i) -{ - wxASSERT( (i >= 0 && i < 10) ); - if (i >= 0 && i < 10) - return & m_levelStyles[i]; - else - return NULL; -} - -/// Convenience function for setting the major attributes for a list level specification -void wxRichTextListStyleDefinition::SetAttributes(int i, int leftIndent, int leftSubIndent, int bulletStyle, const wxString& bulletSymbol) -{ - wxASSERT( (i >= 0 && i < 10) ); - if (i >= 0 && i < 10) - { - wxRichTextAttr attr; - - attr.SetBulletStyle(bulletStyle); - attr.SetLeftIndent(leftIndent, leftSubIndent); - - if (!bulletSymbol.IsEmpty()) - { - if (bulletStyle & wxTEXT_ATTR_BULLET_STYLE_SYMBOL) - attr.SetBulletText(bulletSymbol); - else - attr.SetBulletName(bulletSymbol); - } - - m_levelStyles[i] = attr; - } -} - -/// Finds the level corresponding to the given indentation -int wxRichTextListStyleDefinition::FindLevelForIndent(int indent) const -{ - int i; - for (i = 0; i < 10; i++) - { - if (indent < m_levelStyles[i].GetLeftIndent()) - { - if (i > 0) - return i - 1; - else - return 0; - } - } - return 9; -} - -/// Combine the list style with a paragraph style, using the given indent (from which -/// an appropriate level is found) -wxRichTextAttr wxRichTextListStyleDefinition::CombineWithParagraphStyle(int indent, const wxRichTextAttr& paraStyle, wxRichTextStyleSheet* styleSheet) -{ - int listLevel = FindLevelForIndent(indent); - - wxRichTextAttr attr(*GetLevelAttributes(listLevel)); - int oldLeftIndent = attr.GetLeftIndent(); - int oldLeftSubIndent = attr.GetLeftSubIndent(); - - // First apply the overall paragraph style, if any - if (styleSheet) - attr.Apply(GetStyleMergedWithBase(styleSheet)); - else - attr.Apply(GetStyle()); - - // Then apply paragraph style, e.g. from paragraph style definition - attr.Apply(paraStyle); - - // We override the indents according to the list definition - attr.SetLeftIndent(oldLeftIndent, oldLeftSubIndent); - - return attr; -} - -/// Combine the base and list style, using the given indent (from which -/// an appropriate level is found) -wxRichTextAttr wxRichTextListStyleDefinition::GetCombinedStyle(int indent, wxRichTextStyleSheet* styleSheet) -{ - int listLevel = FindLevelForIndent(indent); - return GetCombinedStyleForLevel(listLevel, styleSheet); -} - -/// Combine the base and list style, using the given indent (from which -/// an appropriate level is found) -wxRichTextAttr wxRichTextListStyleDefinition::GetCombinedStyleForLevel(int listLevel, wxRichTextStyleSheet* styleSheet) -{ - wxRichTextAttr attr(*GetLevelAttributes(listLevel)); - int oldLeftIndent = attr.GetLeftIndent(); - int oldLeftSubIndent = attr.GetLeftSubIndent(); - - // Apply the overall paragraph style, if any - if (styleSheet) - attr.Apply(GetStyleMergedWithBase(styleSheet)); - else - attr.Apply(GetStyle()); - - // We override the indents according to the list definition - attr.SetLeftIndent(oldLeftIndent, oldLeftSubIndent); - - return attr; -} - -/// Is this a numbered list? -bool wxRichTextListStyleDefinition::IsNumbered(int i) const -{ - return (0 != (GetLevelAttributes(i)->GetFlags() & - (wxTEXT_ATTR_BULLET_STYLE_ARABIC|wxTEXT_ATTR_BULLET_STYLE_LETTERS_UPPER|wxTEXT_ATTR_BULLET_STYLE_LETTERS_LOWER| - wxTEXT_ATTR_BULLET_STYLE_ROMAN_UPPER|wxTEXT_ATTR_BULLET_STYLE_ROMAN_LOWER))); -} - -/*! - * The style manager - */ - -IMPLEMENT_CLASS(wxRichTextStyleSheet, wxObject) - -wxRichTextStyleSheet::~wxRichTextStyleSheet() -{ - DeleteStyles(); - - if (m_nextSheet) - m_nextSheet->m_previousSheet = m_previousSheet; - - if (m_previousSheet) - m_previousSheet->m_nextSheet = m_nextSheet; - - m_previousSheet = NULL; - m_nextSheet = NULL; -} - -/// Initialisation -void wxRichTextStyleSheet::Init() -{ - m_previousSheet = NULL; - m_nextSheet = NULL; -} - -/// Add a definition to one of the style lists -bool wxRichTextStyleSheet::AddStyle(wxList& list, wxRichTextStyleDefinition* def) -{ - if (!list.Find(def)) - list.Append(def); - return true; -} - -/// Remove a style -bool wxRichTextStyleSheet::RemoveStyle(wxList& list, wxRichTextStyleDefinition* def, bool deleteStyle) -{ - wxList::compatibility_iterator node = list.Find(def); - if (node) - { - wxRichTextStyleDefinition* def = (wxRichTextStyleDefinition*) node->GetData(); - list.Erase(node); - if (deleteStyle) - delete def; - return true; - } - else - return false; -} - -/// Remove a style -bool wxRichTextStyleSheet::RemoveStyle(wxRichTextStyleDefinition* def, bool deleteStyle) -{ - if (RemoveParagraphStyle(def, deleteStyle)) - return true; - if (RemoveCharacterStyle(def, deleteStyle)) - return true; - if (RemoveListStyle(def, deleteStyle)) - return true; - return false; -} - -/// Find a definition by name -wxRichTextStyleDefinition* wxRichTextStyleSheet::FindStyle(const wxList& list, const wxString& name, bool recurse) const -{ - for (wxList::compatibility_iterator node = list.GetFirst(); node; node = node->GetNext()) - { - wxRichTextStyleDefinition* def = (wxRichTextStyleDefinition*) node->GetData(); - if (def->GetName().Lower() == name.Lower()) - return def; - } - - if (m_nextSheet && recurse) - return m_nextSheet->FindStyle(list, name, recurse); - - return NULL; -} - -/// Delete all styles -void wxRichTextStyleSheet::DeleteStyles() -{ - WX_CLEAR_LIST(wxList, m_characterStyleDefinitions); - WX_CLEAR_LIST(wxList, m_paragraphStyleDefinitions); - WX_CLEAR_LIST(wxList, m_listStyleDefinitions); -} - -/// Insert into list of style sheets -bool wxRichTextStyleSheet::InsertSheet(wxRichTextStyleSheet* before) -{ - m_previousSheet = before->m_previousSheet; - m_nextSheet = before; - - before->m_previousSheet = this; - return true; -} - -/// Append to list of style sheets -bool wxRichTextStyleSheet::AppendSheet(wxRichTextStyleSheet* after) -{ - wxRichTextStyleSheet* last = after; - while (last && last->m_nextSheet) - { - last = last->m_nextSheet; - } - - if (last) - { - m_previousSheet = last; - last->m_nextSheet = this; - - return true; - } - else - return false; -} - -/// Unlink from the list of style sheets -void wxRichTextStyleSheet::Unlink() -{ - if (m_previousSheet) - m_previousSheet->m_nextSheet = m_nextSheet; - if (m_nextSheet) - m_nextSheet->m_previousSheet = m_previousSheet; - - m_previousSheet = NULL; - m_nextSheet = NULL; -} - -/// Add a definition to the character style list -bool wxRichTextStyleSheet::AddCharacterStyle(wxRichTextCharacterStyleDefinition* def) -{ - def->GetStyle().SetCharacterStyleName(def->GetName()); - return AddStyle(m_characterStyleDefinitions, def); -} - -/// Add a definition to the paragraph style list -bool wxRichTextStyleSheet::AddParagraphStyle(wxRichTextParagraphStyleDefinition* def) -{ - def->GetStyle().SetParagraphStyleName(def->GetName()); - return AddStyle(m_paragraphStyleDefinitions, def); -} - -/// Add a definition to the list style list -bool wxRichTextStyleSheet::AddListStyle(wxRichTextListStyleDefinition* def) -{ - def->GetStyle().SetListStyleName(def->GetName()); - return AddStyle(m_listStyleDefinitions, def); -} - -/// Add a definition to the appropriate style list -bool wxRichTextStyleSheet::AddStyle(wxRichTextStyleDefinition* def) -{ - wxRichTextListStyleDefinition* listDef = wxDynamicCast(def, wxRichTextListStyleDefinition); - if (listDef) - return AddListStyle(listDef); - - wxRichTextParagraphStyleDefinition* paraDef = wxDynamicCast(def, wxRichTextParagraphStyleDefinition); - if (paraDef) - return AddParagraphStyle(paraDef); - - wxRichTextCharacterStyleDefinition* charDef = wxDynamicCast(def, wxRichTextCharacterStyleDefinition); - if (charDef) - return AddCharacterStyle(charDef); - - return false; -} - -/// Find any definition by name -wxRichTextStyleDefinition* wxRichTextStyleSheet::FindStyle(const wxString& name, bool recurse) const -{ - wxRichTextListStyleDefinition* listDef = FindListStyle(name, recurse); - if (listDef) - return listDef; - - wxRichTextParagraphStyleDefinition* paraDef = FindParagraphStyle(name, recurse); - if (paraDef) - return paraDef; - - wxRichTextCharacterStyleDefinition* charDef = FindCharacterStyle(name, recurse); - if (charDef) - return charDef; - - return NULL; -} - -/// Copy -void wxRichTextStyleSheet::Copy(const wxRichTextStyleSheet& sheet) -{ - DeleteStyles(); - - wxList::compatibility_iterator node; - - for (node = sheet.m_characterStyleDefinitions.GetFirst(); node; node = node->GetNext()) - { - wxRichTextCharacterStyleDefinition* def = (wxRichTextCharacterStyleDefinition*) node->GetData(); - AddCharacterStyle(new wxRichTextCharacterStyleDefinition(*def)); - } - - for (node = sheet.m_paragraphStyleDefinitions.GetFirst(); node; node = node->GetNext()) - { - wxRichTextParagraphStyleDefinition* def = (wxRichTextParagraphStyleDefinition*) node->GetData(); - AddParagraphStyle(new wxRichTextParagraphStyleDefinition(*def)); - } - - for (node = sheet.m_listStyleDefinitions.GetFirst(); node; node = node->GetNext()) - { - wxRichTextListStyleDefinition* def = (wxRichTextListStyleDefinition*) node->GetData(); - AddListStyle(new wxRichTextListStyleDefinition(*def)); - } - - SetName(sheet.GetName()); - SetDescription(sheet.GetDescription()); -} - -/// Equality -bool wxRichTextStyleSheet::operator==(const wxRichTextStyleSheet& WXUNUSED(sheet)) const -{ - // TODO - return false; -} - - -#if wxUSE_HTML - -// Functions for dealing with clashing names for different kinds of style. -// Returns "P", "C", or "L" (paragraph, character, list) for -// style name | type. -static wxString wxGetRichTextStyleType(const wxString& style) -{ - return style.AfterLast(wxT('|')); -} - -static wxString wxGetRichTextStyle(const wxString& style) -{ - return style.BeforeLast(wxT('|')); -} - -/*! - * wxRichTextStyleListBox: a listbox to display styles. - */ - -IMPLEMENT_CLASS(wxRichTextStyleListBox, wxHtmlListBox) - -BEGIN_EVENT_TABLE(wxRichTextStyleListBox, wxHtmlListBox) - EVT_LEFT_DOWN(wxRichTextStyleListBox::OnLeftDown) - EVT_LEFT_DCLICK(wxRichTextStyleListBox::OnLeftDoubleClick) - EVT_IDLE(wxRichTextStyleListBox::OnIdle) -END_EVENT_TABLE() - -wxRichTextStyleListBox::wxRichTextStyleListBox(wxWindow* parent, wxWindowID id, const wxPoint& pos, - const wxSize& size, long style) -{ - Init(); - Create(parent, id, pos, size, style); -} - -bool wxRichTextStyleListBox::Create(wxWindow* parent, wxWindowID id, const wxPoint& pos, - const wxSize& size, long style) -{ - return wxHtmlListBox::Create(parent, id, pos, size, style); -} - -wxRichTextStyleListBox::~wxRichTextStyleListBox() -{ -} - -/// Returns the HTML for this item -wxString wxRichTextStyleListBox::OnGetItem(size_t n) const -{ - if (!GetStyleSheet()) - return wxEmptyString; - - wxRichTextStyleDefinition* def = GetStyle(n); - if (def) - return CreateHTML(def); - - return wxEmptyString; -} - -// Get style for index -wxRichTextStyleDefinition* wxRichTextStyleListBox::GetStyle(size_t i) const -{ - if (!GetStyleSheet()) - return NULL; - - if (i >= m_styleNames.GetCount() /* || i < 0 */ ) - return NULL; - - wxString styleType = wxGetRichTextStyleType(m_styleNames[i]); - wxString style = wxGetRichTextStyle(m_styleNames[i]); - if (styleType == wxT("P")) - return GetStyleSheet()->FindParagraphStyle(style); - else if (styleType == wxT("C")) - return GetStyleSheet()->FindCharacterStyle(style); - else if (styleType == wxT("L")) - return GetStyleSheet()->FindListStyle(style); - else - return GetStyleSheet()->FindStyle(style); -} - -/// Updates the list -void wxRichTextStyleListBox::UpdateStyles() -{ - if (GetStyleSheet()) - { - int oldSel = GetSelection(); - - SetSelection(wxNOT_FOUND); - - m_styleNames.Clear(); - - size_t i; - if (GetStyleType() == wxRICHTEXT_STYLE_ALL || GetStyleType() == wxRICHTEXT_STYLE_PARAGRAPH) - { - for (i = 0; i < GetStyleSheet()->GetParagraphStyleCount(); i++) - m_styleNames.Add(GetStyleSheet()->GetParagraphStyle(i)->GetName() + wxT("|P")); - } - if (GetStyleType() == wxRICHTEXT_STYLE_ALL || GetStyleType() == wxRICHTEXT_STYLE_CHARACTER) - { - for (i = 0; i < GetStyleSheet()->GetCharacterStyleCount(); i++) - m_styleNames.Add(GetStyleSheet()->GetCharacterStyle(i)->GetName() + wxT("|C")); - } - if (GetStyleType() == wxRICHTEXT_STYLE_ALL || GetStyleType() == wxRICHTEXT_STYLE_LIST) - { - for (i = 0; i < GetStyleSheet()->GetListStyleCount(); i++) - m_styleNames.Add(GetStyleSheet()->GetListStyle(i)->GetName() + wxT("|L")); - } - - m_styleNames.Sort(); - SetItemCount(m_styleNames.GetCount()); - - Refresh(); - - int newSel = -1; - if (oldSel >= 0 && oldSel < (int) GetItemCount()) - newSel = oldSel; - else if (GetItemCount() > 0) - newSel = 0; - - if (newSel >= 0) - { - SetSelection(newSel); - SendSelectedEvent(); - } - } -} - -// Get index for style name -int wxRichTextStyleListBox::GetIndexForStyle(const wxString& name) const -{ - wxString s(name); - if (GetStyleType() == wxRICHTEXT_STYLE_PARAGRAPH) - s += wxT("|P"); - else if (GetStyleType() == wxRICHTEXT_STYLE_CHARACTER) - s += wxT("|C"); - else if (GetStyleType() == wxRICHTEXT_STYLE_LIST) - s += wxT("|L"); - else - { - if (m_styleNames.Index(s + wxT("|P")) != wxNOT_FOUND) - s += wxT("|P"); - else if (m_styleNames.Index(s + wxT("|C")) != wxNOT_FOUND) - s += wxT("|C"); - else if (m_styleNames.Index(s + wxT("|L")) != wxNOT_FOUND) - s += wxT("|L"); - } - return m_styleNames.Index(s); -} - -/// Set selection for string -int wxRichTextStyleListBox::SetStyleSelection(const wxString& name) -{ - int i = GetIndexForStyle(name); - if (i > -1) - SetSelection(i); - return i; -} - -// Convert a colour to a 6-digit hex string -static wxString ColourToHexString(const wxColour& col) -{ - wxString hex; - - hex += wxDecToHex(col.Red()); - hex += wxDecToHex(col.Green()); - hex += wxDecToHex(col.Blue()); - - return hex; -} - -/// Creates a suitable HTML fragment for a definition -wxString wxRichTextStyleListBox::CreateHTML(wxRichTextStyleDefinition* def) const -{ - // TODO: indicate list format for list style types - - wxString str; - - bool isCentred = false; - - wxRichTextAttr attr(def->GetStyleMergedWithBase(GetStyleSheet())); - - if (attr.HasAlignment() && attr.GetAlignment() == wxTEXT_ALIGNMENT_CENTRE) - isCentred = true; - - if (isCentred) - str << wxT("
                "); - - - str << wxT(""); - - if (attr.GetLeftIndent() > 0) - { - wxClientDC dc((wxWindow*) this); - - str << wxT(""); - } - - if (isCentred) - str << wxT("
                "); - else - str << wxT(""); - -#ifdef __WXMSW__ - int size = 2; -#else - int size = 3; -#endif - - // Guess a standard font size - int stdFontSize = 0; - - // First see if we have a default/normal style to base the size on - wxString normalTranslated(_("normal")); - wxString defaultTranslated(_("default")); - size_t i; - for (i = 0; i < GetStyleSheet()->GetParagraphStyleCount(); i++) - { - wxRichTextStyleDefinition* d = GetStyleSheet()->GetParagraphStyle(i); - wxString name = d->GetName().Lower(); - if (name.Find(wxT("normal")) != wxNOT_FOUND || name.Find(normalTranslated) != wxNOT_FOUND || - name.Find(wxT("default")) != wxNOT_FOUND || name.Find(defaultTranslated) != wxNOT_FOUND) - { - wxRichTextAttr attr2(d->GetStyleMergedWithBase(GetStyleSheet())); - if (attr2.HasFontSize()) - { - stdFontSize = attr2.GetFontSize(); - break; - } - } - } - - if (stdFontSize == 0) - { - // Look at sizes up to 20 points, and see which is the most common - wxArrayInt sizes; - size_t maxSize = 20; - for (i = 0; i <= maxSize; i++) - sizes.Add(0); - for (i = 0; i < m_styleNames.GetCount(); i++) - { - wxRichTextStyleDefinition* d = GetStyle(i); - if (d) - { - wxRichTextAttr attr2(d->GetStyleMergedWithBase(GetStyleSheet())); - if (attr2.HasFontSize()) - { - if (attr2.GetFontSize() <= (int) maxSize) - sizes[attr2.GetFontSize()] ++; - } - } - } - int mostCommonSize = 0; - for (i = 0; i <= maxSize; i++) - { - if (sizes[i] > mostCommonSize) - mostCommonSize = i; - } - if (mostCommonSize > 0) - stdFontSize = mostCommonSize; - } - - if (stdFontSize == 0) - stdFontSize = 12; - - int thisFontSize = ((attr.GetFlags() & wxTEXT_ATTR_FONT_SIZE) != 0) ? attr.GetFontSize() : stdFontSize; - - if (thisFontSize < stdFontSize) - size --; - else if (thisFontSize > stdFontSize) - size ++; - - str += wxT(""); - - bool hasBold = false; - bool hasItalic = false; - bool hasUnderline = false; - - if (attr.GetFontWeight() == wxBOLD) - hasBold = true; - if (attr.GetFontStyle() == wxITALIC) - hasItalic = true; - if (attr.GetFontUnderlined()) - hasUnderline = true; - - if (hasBold) - str << wxT(""); - if (hasItalic) - str << wxT(""); - if (hasUnderline) - str << wxT(""); - - str += def->GetName(); - - if (hasUnderline) - str << wxT(""); - if (hasItalic) - str << wxT(""); - if (hasBold) - str << wxT(""); - - if (isCentred) - str << wxT(""); - - str << wxT(""); - - str << wxT("
                "); - - if (isCentred) - str << wxT("
                "); - - return str; -} - -// Convert units in tends of a millimetre to device units -int wxRichTextStyleListBox::ConvertTenthsMMToPixels(wxDC& dc, int units) const -{ - int ppi = dc.GetPPI().x; - - // There are ppi pixels in 254.1 "1/10 mm" - - double pixels = ((double) units * (double)ppi) / 254.1; - - return (int) pixels; -} - -void wxRichTextStyleListBox::OnLeftDown(wxMouseEvent& event) -{ - wxVListBox::OnLeftDown(event); - - int item = HitTest(event.GetPosition()); - if (item != wxNOT_FOUND && GetApplyOnSelection()) - ApplyStyle(item); -} - -void wxRichTextStyleListBox::OnLeftDoubleClick(wxMouseEvent& event) -{ - wxVListBox::OnLeftDown(event); - - int item = HitTest(event.GetPosition()); - if (item != wxNOT_FOUND && !GetApplyOnSelection()) - ApplyStyle(item); -} - -/// Helper for listbox and combo control -wxString wxRichTextStyleListBox::GetStyleToShowInIdleTime(wxRichTextCtrl* ctrl, wxRichTextStyleType styleType) -{ - int adjustedCaretPos = ctrl->GetAdjustedCaretPosition(ctrl->GetCaretPosition()); - - wxString styleName; - - wxTextAttrEx attr; - ctrl->GetStyle(adjustedCaretPos, attr); - - // Take into account current default style just chosen by user - if (ctrl->IsDefaultStyleShowing()) - { - wxRichTextApplyStyle(attr, ctrl->GetDefaultStyleEx()); - - if ((styleType == wxRICHTEXT_STYLE_ALL || styleType == wxRICHTEXT_STYLE_CHARACTER) && - !attr.GetCharacterStyleName().IsEmpty()) - styleName = attr.GetCharacterStyleName(); - else if ((styleType == wxRICHTEXT_STYLE_ALL || styleType == wxRICHTEXT_STYLE_PARAGRAPH) && - !attr.GetParagraphStyleName().IsEmpty()) - styleName = attr.GetParagraphStyleName(); - else if ((styleType == wxRICHTEXT_STYLE_ALL || styleType == wxRICHTEXT_STYLE_LIST) && - !attr.GetListStyleName().IsEmpty()) - styleName = attr.GetListStyleName(); - } - else if ((styleType == wxRICHTEXT_STYLE_ALL || styleType == wxRICHTEXT_STYLE_CHARACTER) && - !attr.GetCharacterStyleName().IsEmpty()) - { - styleName = attr.GetCharacterStyleName(); - } - else if ((styleType == wxRICHTEXT_STYLE_ALL || styleType == wxRICHTEXT_STYLE_PARAGRAPH) && - !attr.GetParagraphStyleName().IsEmpty()) - { - styleName = attr.GetParagraphStyleName(); - } - else if ((styleType == wxRICHTEXT_STYLE_ALL || styleType == wxRICHTEXT_STYLE_LIST) && - !attr.GetListStyleName().IsEmpty()) - { - styleName = attr.GetListStyleName(); - } - - return styleName; -} - -/// Auto-select from style under caret in idle time -void wxRichTextStyleListBox::OnIdle(wxIdleEvent& event) -{ - if (CanAutoSetSelection() && GetRichTextCtrl() && IsShownOnScreen() && wxWindow::FindFocus() != this) - { - wxString styleName = GetStyleToShowInIdleTime(GetRichTextCtrl(), GetStyleType()); - - int sel = GetSelection(); - if (!styleName.IsEmpty()) - { - // Don't do the selection if it's already set - if (sel == GetIndexForStyle(styleName)) - return; - - SetStyleSelection(styleName); - } - else if (sel != -1) - SetSelection(-1); - } - event.Skip(); -} - -/// Do selection -void wxRichTextStyleListBox::ApplyStyle(int item) -{ - if ( item != wxNOT_FOUND ) - { - wxRichTextStyleDefinition* def = GetStyle(item); - if (def && GetRichTextCtrl()) - { - GetRichTextCtrl()->ApplyStyle(def); - GetRichTextCtrl()->SetFocus(); - } - } -} - -/*! - * wxRichTextStyleListCtrl class: manages a listbox and a choice control to - * switch shown style types - */ - -IMPLEMENT_CLASS(wxRichTextStyleListCtrl, wxControl) - -BEGIN_EVENT_TABLE(wxRichTextStyleListCtrl, wxControl) - EVT_CHOICE(wxID_ANY, wxRichTextStyleListCtrl::OnChooseType) - EVT_SIZE(wxRichTextStyleListCtrl::OnSize) -END_EVENT_TABLE() - -wxRichTextStyleListCtrl::wxRichTextStyleListCtrl(wxWindow* parent, wxWindowID id, const wxPoint& pos, - const wxSize& size, long style) -{ - Init(); - Create(parent, id, pos, size, style); -} - -bool wxRichTextStyleListCtrl::Create(wxWindow* parent, wxWindowID id, const wxPoint& pos, - const wxSize& size, long style) -{ - if ((style & wxBORDER_MASK) == wxBORDER_DEFAULT) -#ifdef __WXMSW__ - style |= GetThemedBorderStyle(); -#else - style |= wxBORDER_SUNKEN; -#endif - - wxControl::Create(parent, id, pos, size, style); - - SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW)); - if (size != wxDefaultSize) - SetInitialSize(size); - - bool showSelector = ((style & wxRICHTEXTSTYLELIST_HIDE_TYPE_SELECTOR) == 0); - - wxBorder listBoxStyle; - if (showSelector) - { -#ifdef __WXMSW__ - listBoxStyle = GetThemedBorderStyle(); -#else - listBoxStyle = wxBORDER_SUNKEN; -#endif - } - else - listBoxStyle = wxBORDER_NONE; - - m_styleListBox = new wxRichTextStyleListBox(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, listBoxStyle); - - wxBoxSizer* boxSizer = new wxBoxSizer(wxVERTICAL); - - if (showSelector) - { - wxArrayString choices; - choices.Add(_("All styles")); - choices.Add(_("Paragraph styles")); - choices.Add(_("Character styles")); - choices.Add(_("List styles")); - - m_styleChoice = new wxChoice(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, choices); - - boxSizer->Add(m_styleListBox, 1, wxALL|wxEXPAND, 5); - boxSizer->Add(m_styleChoice, 0, wxALL|wxEXPAND, 5); - } - else - { - boxSizer->Add(m_styleListBox, 1, wxALL|wxEXPAND, 0); - } - - SetSizer(boxSizer); - Layout(); - - m_dontUpdate = true; - - if (m_styleChoice) - { - int i = StyleTypeToIndex(m_styleListBox->GetStyleType()); - m_styleChoice->SetSelection(i); - } - - m_dontUpdate = false; - - return true; -} - -wxRichTextStyleListCtrl::~wxRichTextStyleListCtrl() -{ - -} - -/// React to style type choice -void wxRichTextStyleListCtrl::OnChooseType(wxCommandEvent& event) -{ - if (event.GetEventObject() != m_styleChoice) - event.Skip(); - else - { - if (m_dontUpdate) - return; - - wxRichTextStyleListBox::wxRichTextStyleType styleType = StyleIndexToType(event.GetSelection()); - m_styleListBox->SetSelection(-1); - m_styleListBox->SetStyleType(styleType); - } -} - -/// Lay out the controls -void wxRichTextStyleListCtrl::OnSize(wxSizeEvent& WXUNUSED(event)) -{ - if (GetAutoLayout()) - Layout(); -} - -/// Get the choice index for style type -int wxRichTextStyleListCtrl::StyleTypeToIndex(wxRichTextStyleListBox::wxRichTextStyleType styleType) -{ - if (styleType == wxRichTextStyleListBox::wxRICHTEXT_STYLE_ALL) - { - return 0; - } - else if (styleType == wxRichTextStyleListBox::wxRICHTEXT_STYLE_PARAGRAPH) - { - return 1; - } - else if (styleType == wxRichTextStyleListBox::wxRICHTEXT_STYLE_CHARACTER) - { - return 2; - } - else if (styleType == wxRichTextStyleListBox::wxRICHTEXT_STYLE_LIST) - { - return 3; - } - return 0; -} - -/// Get the style type for choice index -wxRichTextStyleListBox::wxRichTextStyleType wxRichTextStyleListCtrl::StyleIndexToType(int i) -{ - if (i == 1) - return wxRichTextStyleListBox::wxRICHTEXT_STYLE_PARAGRAPH; - else if (i == 2) - return wxRichTextStyleListBox::wxRICHTEXT_STYLE_CHARACTER; - else if (i == 3) - return wxRichTextStyleListBox::wxRICHTEXT_STYLE_LIST; - - return wxRichTextStyleListBox::wxRICHTEXT_STYLE_ALL; -} - -/// Associates the control with a style manager -void wxRichTextStyleListCtrl::SetStyleSheet(wxRichTextStyleSheet* styleSheet) -{ - if (m_styleListBox) - m_styleListBox->SetStyleSheet(styleSheet); -} - -wxRichTextStyleSheet* wxRichTextStyleListCtrl::GetStyleSheet() const -{ - if (m_styleListBox) - return m_styleListBox->GetStyleSheet(); - else - return NULL; -} - -/// Associates the control with a wxRichTextCtrl -void wxRichTextStyleListCtrl::SetRichTextCtrl(wxRichTextCtrl* ctrl) -{ - if (m_styleListBox) - m_styleListBox->SetRichTextCtrl(ctrl); -} - -wxRichTextCtrl* wxRichTextStyleListCtrl::GetRichTextCtrl() const -{ - if (m_styleListBox) - return m_styleListBox->GetRichTextCtrl(); - else - return NULL; -} - -/// Set/get the style type to display -void wxRichTextStyleListCtrl::SetStyleType(wxRichTextStyleListBox::wxRichTextStyleType styleType) -{ - if (m_styleListBox) - m_styleListBox->SetStyleType(styleType); - - m_dontUpdate = true; - - if (m_styleChoice) - { - int i = StyleTypeToIndex(m_styleListBox->GetStyleType()); - m_styleChoice->SetSelection(i); - } - - m_dontUpdate = false; -} - -wxRichTextStyleListBox::wxRichTextStyleType wxRichTextStyleListCtrl::GetStyleType() const -{ - if (m_styleListBox) - return m_styleListBox->GetStyleType(); - else - return wxRichTextStyleListBox::wxRICHTEXT_STYLE_ALL; -} - -/// Updates the style list box -void wxRichTextStyleListCtrl::UpdateStyles() -{ - if (m_styleListBox) - m_styleListBox->UpdateStyles(); -} - -#if wxUSE_COMBOCTRL - -/*! - * Style drop-down for a wxComboCtrl - */ - - -BEGIN_EVENT_TABLE(wxRichTextStyleComboPopup, wxRichTextStyleListBox) - EVT_MOTION(wxRichTextStyleComboPopup::OnMouseMove) - EVT_LEFT_DOWN(wxRichTextStyleComboPopup::OnMouseClick) -END_EVENT_TABLE() - -void wxRichTextStyleComboPopup::SetStringValue( const wxString& s ) -{ - m_value = SetStyleSelection(s); -} - -wxString wxRichTextStyleComboPopup::GetStringValue() const -{ - int sel = m_value; - if (sel > -1) - { - wxRichTextStyleDefinition* def = GetStyle(sel); - if (def) - return def->GetName(); - } - return wxEmptyString; -} - -// -// Popup event handlers -// - -// Mouse hot-tracking -void wxRichTextStyleComboPopup::OnMouseMove(wxMouseEvent& event) -{ - // Move selection to cursor if it is inside the popup - - int itemHere = wxRichTextStyleListBox::HitTest(event.GetPosition()); - if ( itemHere >= 0 ) - { - wxRichTextStyleListBox::SetSelection(itemHere); - m_itemHere = itemHere; - } - event.Skip(); -} - -// On mouse left, set the value and close the popup -void wxRichTextStyleComboPopup::OnMouseClick(wxMouseEvent& WXUNUSED(event)) -{ - if (m_itemHere >= 0) - m_value = m_itemHere; - - // Ordering is important, so we don't dismiss this popup accidentally - // by setting the focus elsewhere e.g. in ApplyStyle - Dismiss(); - - if (m_itemHere >= 0) - wxRichTextStyleListBox::ApplyStyle(m_itemHere); -} - -/*! - * wxRichTextStyleComboCtrl - * A combo for applying styles. - */ - -IMPLEMENT_CLASS(wxRichTextStyleComboCtrl, wxComboCtrl) - -BEGIN_EVENT_TABLE(wxRichTextStyleComboCtrl, wxComboCtrl) - EVT_IDLE(wxRichTextStyleComboCtrl::OnIdle) -END_EVENT_TABLE() - -bool wxRichTextStyleComboCtrl::Create(wxWindow* parent, wxWindowID id, const wxPoint& pos, - const wxSize& size, long style) -{ - if (!wxComboCtrl::Create(parent, id, wxEmptyString, pos, size, style)) - return false; - - SetPopupMaxHeight(400); - - m_stylePopup = new wxRichTextStyleComboPopup; - - SetPopupControl(m_stylePopup); - - return true; -} - -/// Auto-select from style under caret in idle time - -// TODO: must be able to show italic, bold, combinations -// in style box. Do we have a concept of automatic, temporary -// styles that are added whenever we wish to show a style -// that doesn't exist already? E.g. "Bold, Italic, Underline". -// Word seems to generate these things on the fly. -// If there's a named style already, it uses e.g. Heading1 + Bold, Italic -// If you unembolden text in a style that has bold, it uses the -// term "Not bold". -// TODO: order styles alphabetically. This means indexes can change, -// so need a different way to specify selections, i.e. by name. - -void wxRichTextStyleComboCtrl::OnIdle(wxIdleEvent& event) -{ - if (GetRichTextCtrl() && !IsPopupShown() && m_stylePopup && IsShownOnScreen() && wxWindow::FindFocus() != this) - { - wxString styleName = wxRichTextStyleListBox::GetStyleToShowInIdleTime(GetRichTextCtrl(), m_stylePopup->GetStyleType()); - - wxString currentValue = GetValue(); - if (!styleName.IsEmpty()) - { - // Don't do the selection if it's already set - if (currentValue == styleName) - return; - - SetValue(styleName); - } - else if (!currentValue.IsEmpty()) - SetValue(wxEmptyString); - } - event.Skip(); -} - -#endif - // wxUSE_COMBOCTRL - -#endif - // wxUSE_HTML - -#endif - // wxUSE_RICHTEXT diff --git a/wxWidgets/src/richtext/richtextsymboldlg.cpp b/wxWidgets/src/richtext/richtextsymboldlg.cpp deleted file mode 100644 index d1f5c0e86b..0000000000 --- a/wxWidgets/src/richtext/richtextsymboldlg.cpp +++ /dev/null @@ -1,1308 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/richtext/richtextsymboldlg.cpp -// Purpose: -// Author: Julian Smart -// Modified by: -// Created: 10/5/2006 3:11:58 PM -// RCS-ID: $Id: richtextsymboldlg.cpp 63745 2010-03-23 08:59:44Z JS $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// For compilers that support precompilation, includes "wx/wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_RICHTEXT - -#include "wx/richtext/richtextsymboldlg.h" - -#ifndef WX_PRECOMP - #include "wx/sizer.h" - #include "wx/stattext.h" - #include "wx/combobox.h" - #include "wx/button.h" - #include "wx/settings.h" - #include "wx/icon.h" - #include "wx/listbox.h" -#endif - -#include "wx/dcbuffer.h" - -// Only for cached font name -#include "wx/richtext/richtextctrl.h" - -/* Microsoft Unicode subset numbering - */ - -typedef enum -{ - U_BASIC_LATIN = 0, - U_LATIN_1_SUPPLEMENT = 1, - U_LATIN_EXTENDED_A = 2, - U_LATIN_EXTENDED_B = 3, - U_IPA_EXTENSIONS = 4, - U_SPACING_MODIFIER_LETTERS = 5, - U_COMBINING_DIACRITICAL_MARKS = 6, - U_BASIC_GREEK = 7, - U_GREEK_SYMBOLS_AND_COPTIC = 8, - U_CYRILLIC = 9, - U_ARMENIAN = 10, - U_HEBREW_EXTENDED = 12, - U_BASIC_HEBREW = 11, - U_BASIC_ARABIC = 13, - U_ARABIC_EXTENDED = 14, - U_DEVANAGARI = 15, - U_BENGALI = 16, - U_GURMUKHI = 17, - U_GUJARATI = 18, - U_ORIYA = 19, - U_TAMIL = 20, - U_TELUGU = 21, - U_KANNADA = 22, - U_MALAYALAM = 23, - U_THAI = 24, - U_LAO = 25, - U_GEORGIAN_EXTENDED = 27, - U_BASIC_GEORGIAN = 26, - U_HANGUL_JAMO = 28, - U_LATIN_EXTENDED_ADDITIONAL = 29, - U_GREEK_EXTENDED = 30, - U_GENERAL_PUNCTUATION = 31, - U_SUPERSCRIPTS_AND_SUBSCRIPTS = 32, - U_CURRENCY_SYMBOLS = 33, - U_COMBINING_DIACRITICAL_MARKS_FOR_SYMBOLS = 34, - U_LETTERLIKE_SYMBOLS = 35, - U_NUMBER_FORMS = 36, - U_ARROWS = 37, - U_MATHEMATICAL_OPERATORS = 38, - U_MISCELLANEOUS_TECHNICAL = 39, - U_CONTROL_PICTURES = 40, - U_OPTICAL_CHARACTER_RECOGNITION = 41, - U_ENCLOSED_ALPHANUMERICS = 42, - U_BOX_DRAWING = 43, - U_BLOCK_ELEMENTS = 44, - U_GEOMETRIC_SHAPES = 45, - U_MISCELLANEOUS_SYMBOLS = 46, - U_DINGBATS = 47, - U_CJK_SYMBOLS_AND_PUNCTUATION = 48, - U_HIRAGANA = 49, - U_KATAKANA = 50, - U_BOPOMOFO = 51, - U_HANGUL_COMPATIBILITY_JAMO = 52, - U_CJK_MISCELLANEOUS = 53, - U_ENCLOSED_CJK = 54, - U_CJK_COMPATIBILITY = 55, - U_HANGUL = 56, - U_HANGUL_SUPPLEMENTARY_A = 57, - U_HANGUL_SUPPLEMENTARY_B = 58, - U_CJK_UNIFIED_IDEOGRAPHS = 59, - U_PRIVATE_USE_AREA = 60, - U_CJK_COMPATIBILITY_IDEOGRAPHS = 61, - U_ALPHABETIC_PRESENTATION_FORMS = 62, - U_ARABIC_PRESENTATION_FORMS_A = 63, - U_COMBINING_HALF_MARKS = 64, - U_CJK_COMPATIBILITY_FORMS = 65, - U_SMALL_FORM_VARIANTS = 66, - U_ARABIC_PRESENTATION_FORMS_B = 67, - U_SPECIALS = 69, - U_HALFWIDTH_AND_FULLWIDTH_FORMS = 68, - U_LAST_PLUS_ONE -} wxUnicodeSubsetCodes; - -/* Unicode subsets */ -#ifdef __UNICODE__ - -static struct -{ - int m_low, m_high; - wxUnicodeSubsetCodes m_subset; - const wxChar* m_name; -} g_UnicodeSubsetTable[] = -{ - { 0x0000, 0x007E, - U_BASIC_LATIN, wxT("Basic Latin") }, - { 0x00A0, 0x00FF, - U_LATIN_1_SUPPLEMENT, wxT("Latin-1 Supplement") }, - { 0x0100, 0x017F, - U_LATIN_EXTENDED_A, wxT("Latin Extended-A") }, - { 0x0180, 0x024F, - U_LATIN_EXTENDED_B, wxT("Latin Extended-B") }, - { 0x0250, 0x02AF, - U_IPA_EXTENSIONS, wxT("IPA Extensions") }, - { 0x02B0, 0x02FF, - U_SPACING_MODIFIER_LETTERS, wxT("Spacing Modifier Letters") }, - { 0x0300, 0x036F, - U_COMBINING_DIACRITICAL_MARKS, wxT("Combining Diacritical Marks") }, - { 0x0370, 0x03CF, - U_BASIC_GREEK, wxT("Basic Greek") }, - { 0x03D0, 0x03FF, - U_GREEK_SYMBOLS_AND_COPTIC, wxT("Greek Symbols and Coptic") }, - { 0x0400, 0x04FF, - U_CYRILLIC, wxT("Cyrillic") }, - { 0x0530, 0x058F, - U_ARMENIAN, wxT("Armenian") }, - { 0x0590, 0x05CF, - U_HEBREW_EXTENDED, wxT("Hebrew Extended") }, - { 0x05D0, 0x05FF, - U_BASIC_HEBREW, wxT("Basic Hebrew") }, - { 0x0600, 0x0652, - U_BASIC_ARABIC, wxT("Basic Arabic") }, - { 0x0653, 0x06FF, - U_ARABIC_EXTENDED, wxT("Arabic Extended") }, - { 0x0900, 0x097F, - U_DEVANAGARI, wxT("Devanagari") }, - { 0x0980, 0x09FF, - U_BENGALI, wxT("Bengali") }, - { 0x0A00, 0x0A7F, - U_GURMUKHI, wxT("Gurmukhi") }, - { 0x0A80, 0x0AFF, - U_GUJARATI, wxT("Gujarati") }, - { 0x0B00, 0x0B7F, - U_ORIYA, wxT("Oriya") }, - { 0x0B80, 0x0BFF, - U_TAMIL, wxT("Tamil") }, - { 0x0C00, 0x0C7F, - U_TELUGU, wxT("Telugu") }, - { 0x0C80, 0x0CFF, - U_KANNADA, wxT("Kannada") }, - { 0x0D00, 0x0D7F, - U_MALAYALAM, wxT("Malayalam") }, - { 0x0E00, 0x0E7F, - U_THAI, wxT("Thai") }, - { 0x0E80, 0x0EFF, - U_LAO, wxT("Lao") }, - { 0x10A0, 0x10CF, - U_GEORGIAN_EXTENDED, wxT("Georgian Extended") }, - { 0x10D0, 0x10FF, - U_BASIC_GEORGIAN, wxT("Basic Georgian") }, - { 0x1100, 0x11FF, - U_HANGUL_JAMO, wxT("Hangul Jamo") }, - { 0x1E00, 0x1EFF, - U_LATIN_EXTENDED_ADDITIONAL, wxT("Latin Extended Additional") }, - { 0x1F00, 0x1FFF, - U_GREEK_EXTENDED, wxT("Greek Extended") }, - { 0x2000, 0x206F, - U_GENERAL_PUNCTUATION, wxT("General Punctuation") }, - { 0x2070, 0x209F, - U_SUPERSCRIPTS_AND_SUBSCRIPTS, wxT("Superscripts and Subscripts") }, - { 0x20A0, 0x20CF, - U_CURRENCY_SYMBOLS, wxT("Currency Symbols") }, - { 0x20D0, 0x20FF, - U_COMBINING_DIACRITICAL_MARKS_FOR_SYMBOLS, wxT("Combining Diacritical Marks for Symbols") }, - { 0x2100, 0x214F, - U_LETTERLIKE_SYMBOLS, wxT("Letterlike Symbols") }, - { 0x2150, 0x218F, - U_NUMBER_FORMS, wxT("Number Forms") }, - { 0x2190, 0x21FF, - U_ARROWS, wxT("Arrows") }, - { 0x2200, 0x22FF, - U_MATHEMATICAL_OPERATORS, wxT("Mathematical Operators") }, - { 0x2300, 0x23FF, - U_MISCELLANEOUS_TECHNICAL, wxT("Miscellaneous Technical") }, - { 0x2400, 0x243F, - U_CONTROL_PICTURES, wxT("Control Pictures") }, - { 0x2440, 0x245F, - U_OPTICAL_CHARACTER_RECOGNITION, wxT("Optical Character Recognition") }, - { 0x2460, 0x24FF, - U_ENCLOSED_ALPHANUMERICS, wxT("Enclosed Alphanumerics") }, - { 0x2500, 0x257F, - U_BOX_DRAWING, wxT("Box Drawing") }, - { 0x2580, 0x259F, - U_BLOCK_ELEMENTS, wxT("Block Elements") }, - { 0x25A0, 0x25FF, - U_GEOMETRIC_SHAPES, wxT("Geometric Shapes") }, - { 0x2600, 0x26FF, - U_MISCELLANEOUS_SYMBOLS, wxT("Miscellaneous Symbols") }, - { 0x2700, 0x27BF, - U_DINGBATS, wxT("Dingbats") }, - { 0x3000, 0x303F, - U_CJK_SYMBOLS_AND_PUNCTUATION, wxT("CJK Symbols and Punctuation") }, - { 0x3040, 0x309F, - U_HIRAGANA, wxT("Hiragana") }, - { 0x30A0, 0x30FF, - U_KATAKANA, wxT("Katakana") }, - { 0x3100, 0x312F, - U_BOPOMOFO, wxT("Bopomofo") }, - { 0x3130, 0x318F, - U_HANGUL_COMPATIBILITY_JAMO, wxT("Hangul Compatibility Jamo") }, - { 0x3190, 0x319F, - U_CJK_MISCELLANEOUS, wxT("CJK Miscellaneous") }, - { 0x3200, 0x32FF, - U_ENCLOSED_CJK, wxT("Enclosed CJK") }, - { 0x3300, 0x33FF, - U_CJK_COMPATIBILITY, wxT("CJK Compatibility") }, - { 0x3400, 0x4DB5, - U_CJK_UNIFIED_IDEOGRAPHS, wxT("CJK Unified Ideographs Extension A") }, - { 0x4E00, 0x9FFF, - U_CJK_UNIFIED_IDEOGRAPHS, wxT("CJK Unified Ideographs") }, - { 0xAC00, 0xD7A3, - U_HANGUL, wxT("Hangul Syllables") }, - { 0xE000, 0xF8FF, - U_PRIVATE_USE_AREA, wxT("Private Use Area") }, - { 0xF900, 0xFAFF, - U_CJK_COMPATIBILITY_IDEOGRAPHS, wxT("CJK Compatibility Ideographs") }, - { 0xFB00, 0xFB4F, - U_ALPHABETIC_PRESENTATION_FORMS, wxT("Alphabetic Presentation Forms") }, - { 0xFB50, 0xFDFF, - U_ARABIC_PRESENTATION_FORMS_A, wxT("Arabic Presentation Forms-A") }, - { 0xFE20, 0xFE2F, - U_COMBINING_HALF_MARKS, wxT("Combining Half Marks") }, - { 0xFE30, 0xFE4F, - U_CJK_COMPATIBILITY_FORMS, wxT("CJK Compatibility Forms") }, - { 0xFE50, 0xFE6F, - U_SMALL_FORM_VARIANTS, wxT("Small Form Variants") }, - { 0xFE70, 0xFEFE, - U_ARABIC_PRESENTATION_FORMS_B, wxT("Arabic Presentation Forms-B") }, - { 0xFEFF, 0xFEFF, - U_SPECIALS, wxT("Specials") }, - { 0xFF00, 0xFFEF, - U_HALFWIDTH_AND_FULLWIDTH_FORMS, wxT("Halfwidth and Fullwidth Forms") }, - { 0xFFF0, 0xFFFD, - U_SPECIALS, wxT("Specials") } -}; - -#endif // __UNICODE__ - -#if 0 -// Not yet used, but could be used to test under Win32 whether this subset is available -// for the given font. The Win32 function is allegedly not accurate, however. -bool wxSubsetValidForFont(int subsetIndex, FONTSIGNATURE *fontSig) -{ - return (fontSig->fsUsb[g_UnicodeSubsetTable[subsetIndex].m_subset/32] & (1 << (g_UnicodeSubsetTable[subsetIndex].m_subset % 32))); -} -#endif - -bool wxSymbolPickerDialog::sm_showToolTips = false; - -/*! - * wxSymbolPickerDialog type definition - */ - -IMPLEMENT_DYNAMIC_CLASS( wxSymbolPickerDialog, wxDialog ) - -/*! - * wxSymbolPickerDialog event table definition - */ - -BEGIN_EVENT_TABLE( wxSymbolPickerDialog, wxDialog ) - EVT_LISTBOX(ID_SYMBOLPICKERDIALOG_LISTCTRL, wxSymbolPickerDialog::OnSymbolSelected) - -////@begin wxSymbolPickerDialog event table entries - EVT_COMBOBOX( ID_SYMBOLPICKERDIALOG_FONT, wxSymbolPickerDialog::OnFontCtrlSelected ) - -#if defined(__UNICODE__) - EVT_COMBOBOX( ID_SYMBOLPICKERDIALOG_SUBSET, wxSymbolPickerDialog::OnSubsetSelected ) -#endif - -#if defined(__UNICODE__) - EVT_COMBOBOX( ID_SYMBOLPICKERDIALOG_FROM, wxSymbolPickerDialog::OnFromUnicodeSelected ) -#endif - -#if defined(__WXMSW__) || defined(__WXGTK__) || defined(__WXPM__) || defined(__WXMGL__) || defined(__WXMOTIF__) || defined(__WXCOCOA__) || defined(__WXX11__) || defined(__WXPALMOS__) - EVT_UPDATE_UI( wxID_OK, wxSymbolPickerDialog::OnOkUpdate ) -#endif - -#if defined(__WXMAC__) - EVT_UPDATE_UI( wxID_OK, wxSymbolPickerDialog::OnOkUpdate ) -#endif - -////@end wxSymbolPickerDialog event table entries - -END_EVENT_TABLE() - -/*! - * wxSymbolPickerDialog constructors - */ - -wxSymbolPickerDialog::wxSymbolPickerDialog( ) -{ - Init(); -} - -wxSymbolPickerDialog::wxSymbolPickerDialog( const wxString& symbol, const wxString& fontName, const wxString& normalTextFont, wxWindow* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style ) -{ - Init(); - Create(symbol, fontName, normalTextFont, parent, id, caption, pos, size, style); -} - -/*! - * wxSymbolPickerDialog creator - */ - -bool wxSymbolPickerDialog::Create( const wxString& symbol, const wxString& fontName, const wxString& normalTextFont, wxWindow* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style ) -{ - m_fontName = fontName; - m_normalTextFontName = normalTextFont; - m_symbol = symbol; - -////@begin wxSymbolPickerDialog creation - SetExtraStyle(wxWS_EX_BLOCK_EVENTS|wxDIALOG_EX_CONTEXTHELP); - wxDialog::Create( parent, id, caption, pos, size, style ); - - CreateControls(); - if (GetSizer()) - { - GetSizer()->SetSizeHints(this); - } - Centre(); -////@end wxSymbolPickerDialog creation - return true; -} - -/*! - * Member initialisation for wxSymbolPickerDialog - */ - -void wxSymbolPickerDialog::Init() -{ -////@begin wxSymbolPickerDialog member initialisation - m_fromUnicode = true; - m_fontCtrl = NULL; -#if defined(__UNICODE__) - m_subsetCtrl = NULL; -#endif - m_symbolsCtrl = NULL; - m_symbolStaticCtrl = NULL; - m_characterCodeCtrl = NULL; -#if defined(__UNICODE__) - m_fromUnicodeCtrl = NULL; -#endif -////@end wxSymbolPickerDialog member initialisation - m_dontUpdate = false; -} - -/*! - * Control creation for wxSymbolPickerDialog - */ - -void wxSymbolPickerDialog::CreateControls() -{ -#ifdef __WXMAC__ - SetWindowVariant(wxWINDOW_VARIANT_SMALL); -#endif - -////@begin wxSymbolPickerDialog content construction - wxSymbolPickerDialog* itemDialog1 = this; - - wxBoxSizer* itemBoxSizer2 = new wxBoxSizer(wxVERTICAL); - itemDialog1->SetSizer(itemBoxSizer2); - - wxBoxSizer* itemBoxSizer3 = new wxBoxSizer(wxVERTICAL); - itemBoxSizer2->Add(itemBoxSizer3, 1, wxGROW|wxALL, 5); - - wxBoxSizer* itemBoxSizer4 = new wxBoxSizer(wxHORIZONTAL); - itemBoxSizer3->Add(itemBoxSizer4, 0, wxGROW, 5); - - wxBoxSizer* itemBoxSizer5 = new wxBoxSizer(wxHORIZONTAL); - itemBoxSizer4->Add(itemBoxSizer5, 1, wxGROW, 5); - - wxStaticText* itemStaticText6 = new wxStaticText( itemDialog1, wxID_STATIC, _("&Font:"), wxDefaultPosition, wxDefaultSize, 0 ); - itemBoxSizer5->Add(itemStaticText6, 0, wxALIGN_CENTER_VERTICAL|wxALL|wxADJUST_MINSIZE, 5); - - wxArrayString m_fontCtrlStrings; - m_fontCtrl = new wxComboBox( itemDialog1, ID_SYMBOLPICKERDIALOG_FONT, wxEmptyString, wxDefaultPosition, wxSize(240, -1), m_fontCtrlStrings, wxCB_READONLY ); - m_fontCtrl->SetHelpText(_("The font from which to take the symbol.")); - if (wxSymbolPickerDialog::ShowToolTips()) - m_fontCtrl->SetToolTip(_("The font from which to take the symbol.")); - itemBoxSizer5->Add(m_fontCtrl, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); - - itemBoxSizer5->Add(5, 5, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); - -#if defined(__UNICODE__) - wxStaticText* itemStaticText9 = new wxStaticText( itemDialog1, wxID_STATIC, _("&Subset:"), wxDefaultPosition, wxDefaultSize, 0 ); - itemBoxSizer5->Add(itemStaticText9, 0, wxALIGN_CENTER_VERTICAL|wxALL|wxADJUST_MINSIZE, 5); - -#endif - -#if defined(__UNICODE__) - wxArrayString m_subsetCtrlStrings; - m_subsetCtrl = new wxComboBox( itemDialog1, ID_SYMBOLPICKERDIALOG_SUBSET, wxEmptyString, wxDefaultPosition, wxDefaultSize, m_subsetCtrlStrings, wxCB_READONLY ); - m_subsetCtrl->SetHelpText(_("Shows a Unicode subset.")); - if (wxSymbolPickerDialog::ShowToolTips()) - m_subsetCtrl->SetToolTip(_("Shows a Unicode subset.")); - itemBoxSizer5->Add(m_subsetCtrl, 1, wxALIGN_CENTER_VERTICAL|wxALL, 5); - -#endif - - m_symbolsCtrl = new wxSymbolListCtrl( itemDialog1, ID_SYMBOLPICKERDIALOG_LISTCTRL, wxDefaultPosition, wxSize(500, 220), 0 ); - itemBoxSizer3->Add(m_symbolsCtrl, 1, wxGROW|wxALL, 5); - - wxBoxSizer* itemBoxSizer12 = new wxBoxSizer(wxHORIZONTAL); - itemBoxSizer3->Add(itemBoxSizer12, 0, wxGROW, 5); - - m_symbolStaticCtrl = new wxStaticText( itemDialog1, wxID_STATIC, _("xxxx"), wxDefaultPosition, wxSize(40, -1), wxALIGN_CENTRE ); - itemBoxSizer12->Add(m_symbolStaticCtrl, 0, wxALIGN_CENTER_VERTICAL|wxALL|wxADJUST_MINSIZE, 5); - - itemBoxSizer12->Add(5, 5, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); - - wxStaticText* itemStaticText15 = new wxStaticText( itemDialog1, wxID_STATIC, _("&Character code:"), wxDefaultPosition, wxDefaultSize, 0 ); - itemBoxSizer12->Add(itemStaticText15, 0, wxALIGN_CENTER_VERTICAL|wxALL|wxADJUST_MINSIZE, 5); - - m_characterCodeCtrl = new wxTextCtrl( itemDialog1, ID_SYMBOLPICKERDIALOG_CHARACTERCODE, wxEmptyString, wxDefaultPosition, wxSize(140, -1), wxTE_READONLY|wxTE_CENTRE ); - m_characterCodeCtrl->SetHelpText(_("The character code.")); - if (wxSymbolPickerDialog::ShowToolTips()) - m_characterCodeCtrl->SetToolTip(_("The character code.")); - itemBoxSizer12->Add(m_characterCodeCtrl, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); - - itemBoxSizer12->Add(5, 5, 1, wxALIGN_CENTER_VERTICAL|wxALL, 5); - -#if defined(__UNICODE__) - wxStaticText* itemStaticText18 = new wxStaticText( itemDialog1, wxID_STATIC, _("&From:"), wxDefaultPosition, wxDefaultSize, 0 ); - itemBoxSizer12->Add(itemStaticText18, 0, wxALIGN_CENTER_VERTICAL|wxALL|wxADJUST_MINSIZE, 5); - -#endif - -#if defined(__UNICODE__) - wxArrayString m_fromUnicodeCtrlStrings; - m_fromUnicodeCtrlStrings.Add(_("ASCII")); - m_fromUnicodeCtrlStrings.Add(_("Unicode")); - m_fromUnicodeCtrl = new wxComboBox( itemDialog1, ID_SYMBOLPICKERDIALOG_FROM, _("Unicode"), wxDefaultPosition, wxDefaultSize, m_fromUnicodeCtrlStrings, wxCB_READONLY ); - m_fromUnicodeCtrl->SetStringSelection(_("Unicode")); - m_fromUnicodeCtrl->SetHelpText(_("The range to show.")); - if (wxSymbolPickerDialog::ShowToolTips()) - m_fromUnicodeCtrl->SetToolTip(_("The range to show.")); - itemBoxSizer12->Add(m_fromUnicodeCtrl, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); - -#endif - -#if defined(__WXMSW__) || defined(__WXGTK__) || defined(__WXPM__) || defined(__WXMGL__) || defined(__WXMOTIF__) || defined(__WXCOCOA__) || defined(__WXX11__) || defined(__WXPALMOS__) - wxBoxSizer* itemBoxSizer20 = new wxBoxSizer(wxHORIZONTAL); - itemBoxSizer3->Add(itemBoxSizer20, 0, wxGROW, 5); - - itemBoxSizer20->Add(5, 5, 1, wxALIGN_CENTER_VERTICAL|wxALL, 5); - - wxButton* itemButton22 = new wxButton( itemDialog1, wxID_OK, _("Insert"), wxDefaultPosition, wxDefaultSize, 0 ); - itemButton22->SetDefault(); - itemButton22->SetHelpText(_("Inserts the chosen symbol.")); - if (wxSymbolPickerDialog::ShowToolTips()) - itemButton22->SetToolTip(_("Inserts the chosen symbol.")); - itemBoxSizer20->Add(itemButton22, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); - - wxButton* itemButton23 = new wxButton( itemDialog1, wxID_CANCEL, _("Close"), wxDefaultPosition, wxDefaultSize, 0 ); - itemButton23->SetHelpText(_("Closes the dialog without inserting a symbol.")); - if (wxSymbolPickerDialog::ShowToolTips()) - itemButton23->SetToolTip(_("Closes the dialog without inserting a symbol.")); - itemBoxSizer20->Add(itemButton23, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); - -#endif - -#if defined(__WXMAC__) - wxBoxSizer* itemBoxSizer24 = new wxBoxSizer(wxHORIZONTAL); - itemBoxSizer3->Add(itemBoxSizer24, 0, wxGROW, 5); - - itemBoxSizer24->Add(5, 5, 1, wxALIGN_CENTER_VERTICAL|wxALL, 5); - - wxButton* itemButton26 = new wxButton( itemDialog1, wxID_CANCEL, _("Close"), wxDefaultPosition, wxDefaultSize, 0 ); - itemButton26->SetHelpText(_("Closes the dialog without inserting a symbol.")); - if (wxSymbolPickerDialog::ShowToolTips()) - itemButton26->SetToolTip(_("Closes the dialog without inserting a symbol.")); - itemBoxSizer24->Add(itemButton26, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); - - wxButton* itemButton27 = new wxButton( itemDialog1, wxID_OK, _("Insert"), wxDefaultPosition, wxDefaultSize, 0 ); - itemButton27->SetDefault(); - itemButton27->SetHelpText(_("Inserts the chosen symbol.")); - if (wxSymbolPickerDialog::ShowToolTips()) - itemButton27->SetToolTip(_("Inserts the chosen symbol.")); - itemBoxSizer24->Add(itemButton27, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); - -#endif - -////@end wxSymbolPickerDialog content construction - -} - -/// Data transfer -bool wxSymbolPickerDialog::TransferDataToWindow() -{ - m_dontUpdate = true; - - if (m_fontCtrl->GetCount() == 0) - { - wxArrayString faceNames = wxRichTextCtrl::GetAvailableFontNames(); - faceNames.Sort(); - - faceNames.Insert(_("(Normal text)"), 0); - m_fontCtrl->Append(faceNames); - } - - if (m_fontName.empty()) - m_fontCtrl->SetSelection(0); - else - { - if (m_fontCtrl->FindString(m_fontName) != wxNOT_FOUND) - m_fontCtrl->SetStringSelection(m_fontName); - else - m_fontCtrl->SetSelection(0); - } - -#if defined(__UNICODE__) - if (m_subsetCtrl->GetCount() == 0) - { - // Insert items into subset combo - int i; - for (i = 0; i < (int) (sizeof(g_UnicodeSubsetTable)/sizeof(g_UnicodeSubsetTable[0])); i++) - { - m_subsetCtrl->Append(g_UnicodeSubsetTable[i].m_name); - } - m_subsetCtrl->SetSelection(0); - } -#endif - -#if defined(__UNICODE__) - m_symbolsCtrl->SetUnicodeMode(m_fromUnicode); -#endif - - if (!m_symbol.empty()) - { - int sel = (int) m_symbol[0]; - m_symbolsCtrl->SetSelection(sel); - } - - UpdateSymbolDisplay(); - - m_dontUpdate = false; - - return true; -} - -void wxSymbolPickerDialog::UpdateSymbolDisplay(bool updateSymbolList, bool showAtSubset) -{ - wxFont font; - wxString fontNameToUse; - if (m_fontName.empty()) - fontNameToUse = m_normalTextFontName; - else - fontNameToUse = m_fontName; - - if (!fontNameToUse.empty()) - { - font = wxFont(14, wxDEFAULT, wxNORMAL, wxNORMAL, false, fontNameToUse); - } - else - font = *wxNORMAL_FONT; - - if (updateSymbolList) - { - m_symbolsCtrl->SetFont(font); - } - - if (!m_symbol.empty()) - { - m_symbolStaticCtrl->SetFont(font); - m_symbolStaticCtrl->SetLabel(m_symbol); - - int symbol = (int) m_symbol[0]; - m_characterCodeCtrl->SetValue(wxString::Format(wxT("%X hex (%d dec)"), symbol, symbol)); - } - else - { - m_symbolStaticCtrl->SetLabel(wxEmptyString); - m_characterCodeCtrl->SetValue(wxEmptyString); - } - -#if defined(__UNICODE__) - if (showAtSubset) - ShowAtSubset(); -#else - wxUnusedVar(showAtSubset); -#endif -} - -/// Show at the current subset selection -void wxSymbolPickerDialog::ShowAtSubset() -{ -#if defined(__UNICODE__) - if (m_fromUnicode) - { - int sel = m_subsetCtrl->GetSelection(); - int low = g_UnicodeSubsetTable[sel].m_low; - m_symbolsCtrl->EnsureVisible(low); - } -#endif -} - -// Handle font selection -void wxSymbolPickerDialog::OnFontCtrlSelected( wxCommandEvent& WXUNUSED(event) ) -{ - if (m_fontCtrl->GetSelection() == 0) - m_fontName = wxEmptyString; - else - m_fontName = m_fontCtrl->GetStringSelection(); - - UpdateSymbolDisplay(); -} - -/// Respond to symbol selection -void wxSymbolPickerDialog::OnSymbolSelected( wxCommandEvent& event ) -{ - if (m_dontUpdate) - return; - - int sel = event.GetSelection(); - if (sel == wxNOT_FOUND) - m_symbol = wxEmptyString; - else - { - m_symbol = wxEmptyString; - m_symbol << (wxChar) sel; - } - -#if defined(__UNICODE__) - if (sel != -1 && m_fromUnicode) - { - // Need to make the subset selection reflect the current symbol - int i; - for (i = 0; i < (int) (sizeof(g_UnicodeSubsetTable)/sizeof(g_UnicodeSubsetTable[0])); i++) - { - if (sel >= g_UnicodeSubsetTable[i].m_low && sel <= g_UnicodeSubsetTable[i].m_high) - { - m_dontUpdate = true; - m_subsetCtrl->SetSelection(i); - m_dontUpdate = false; - break; - } - } - } -#endif - - UpdateSymbolDisplay(false, false); -} - -#if defined(__UNICODE__) -// Handle Unicode/ASCII selection -void wxSymbolPickerDialog::OnFromUnicodeSelected( wxCommandEvent& WXUNUSED(event) ) -{ - if (m_dontUpdate) - return; - - m_fromUnicode = (m_fromUnicodeCtrl->GetSelection() == 1); - m_symbolsCtrl->SetUnicodeMode(m_fromUnicode); - UpdateSymbolDisplay(false); -} - -// Handle subset selection -void wxSymbolPickerDialog::OnSubsetSelected( wxCommandEvent& WXUNUSED(event) ) -{ - if (m_dontUpdate) - return; - - ShowAtSubset(); -} -#endif - -/*! - * wxEVT_UPDATE_UI event handler for wxID_OK - */ - -void wxSymbolPickerDialog::OnOkUpdate( wxUpdateUIEvent& event ) -{ - event.Enable(HasSelection()); -} - -/// Set Unicode mode -void wxSymbolPickerDialog::SetUnicodeMode(bool unicodeMode) -{ -#if defined(__UNICODE__) - m_dontUpdate = true; - m_fromUnicode = unicodeMode; - if (m_fromUnicodeCtrl) - m_fromUnicodeCtrl->SetSelection(m_fromUnicode ? 1 : 0); - UpdateSymbolDisplay(); - m_dontUpdate = false; -#else - wxUnusedVar(unicodeMode); -#endif -} - -/// Get the selected symbol character -int wxSymbolPickerDialog::GetSymbolChar() const -{ - if (m_symbol.empty()) - return -1; - else - return (int) m_symbol[0]; -} - - -/*! - * Get bitmap resources - */ - -wxBitmap wxSymbolPickerDialog::GetBitmapResource( const wxString& name ) -{ - // Bitmap retrieval -////@begin wxSymbolPickerDialog bitmap retrieval - wxUnusedVar(name); - return wxNullBitmap; -////@end wxSymbolPickerDialog bitmap retrieval -} - -/*! - * Get icon resources - */ - -wxIcon wxSymbolPickerDialog::GetIconResource( const wxString& name ) -{ - // Icon retrieval -////@begin wxSymbolPickerDialog icon retrieval - wxUnusedVar(name); - return wxNullIcon; -////@end wxSymbolPickerDialog icon retrieval -} - -/*! - * The scrolling symbol list. - */ - -// ---------------------------------------------------------------------------- -// event tables -// ---------------------------------------------------------------------------- - -BEGIN_EVENT_TABLE(wxSymbolListCtrl, wxVScrolledWindow) - EVT_PAINT(wxSymbolListCtrl::OnPaint) - EVT_SIZE(wxSymbolListCtrl::OnSize) - - EVT_KEY_DOWN(wxSymbolListCtrl::OnKeyDown) - EVT_LEFT_DOWN(wxSymbolListCtrl::OnLeftDown) - EVT_LEFT_DCLICK(wxSymbolListCtrl::OnLeftDClick) -END_EVENT_TABLE() - -// ============================================================================ -// implementation -// ============================================================================ - -IMPLEMENT_ABSTRACT_CLASS(wxSymbolListCtrl, wxVScrolledWindow) - -// ---------------------------------------------------------------------------- -// wxSymbolListCtrl creation -// ---------------------------------------------------------------------------- - -void wxSymbolListCtrl::Init() -{ - m_current = wxNOT_FOUND; - m_doubleBuffer = NULL; - m_cellSize = wxSize(40, 40); - m_minSymbolValue = 0; - m_maxSymbolValue = 255; - m_symbolsPerLine = 0; - m_unicodeMode = false; -} - -bool wxSymbolListCtrl::Create(wxWindow *parent, - wxWindowID id, - const wxPoint& pos, - const wxSize& size, - long style, - const wxString& name) -{ - style |= wxWANTS_CHARS | wxFULL_REPAINT_ON_RESIZE; - - if ((style & wxBORDER_MASK) == wxBORDER_DEFAULT) -#ifdef __WXMSW__ - style |= GetThemedBorderStyle(); -#else - style |= wxBORDER_SUNKEN; -#endif - - if ( !wxVScrolledWindow::Create(parent, id, pos, size, style, name) ) - return false; - - // make sure the native widget has the right colour since we do - // transparent drawing by default - SetBackgroundColour(GetBackgroundColour()); - m_colBgSel = wxSystemSettings::GetColour(wxSYS_COLOUR_HIGHLIGHT); - - // flicker-free drawing requires this - SetBackgroundStyle(wxBG_STYLE_CUSTOM); - - SetFont(*wxNORMAL_FONT); - - SetupCtrl(); - - return true; -} - -wxSymbolListCtrl::~wxSymbolListCtrl() -{ - delete m_doubleBuffer; -} - -// ---------------------------------------------------------------------------- -// selection handling -// ---------------------------------------------------------------------------- - -bool wxSymbolListCtrl::IsSelected(int item) const -{ - return item == m_current; -} - -bool wxSymbolListCtrl::DoSetCurrent(int current) -{ - wxASSERT_MSG( current == wxNOT_FOUND || - (current >= m_minSymbolValue && current <= m_maxSymbolValue), - _T("wxSymbolListCtrl::DoSetCurrent(): invalid symbol value") ); - - if ( current == m_current ) - { - // nothing to do - return false; - } - - if ( m_current != wxNOT_FOUND ) - RefreshLine(SymbolValueToLineNumber(m_current)); - - m_current = current; - - if ( m_current != wxNOT_FOUND ) - { - int lineNo = SymbolValueToLineNumber(m_current); - - // if the line is not visible at all, we scroll it into view but we - // don't need to refresh it -- it will be redrawn anyhow - if ( !IsVisible(lineNo) ) - { - ScrollToLine(lineNo); - } - else // line is at least partly visible - { - // it is, indeed, only partly visible, so scroll it into view to - // make it entirely visible - while ( unsigned(lineNo) == GetLastVisibleLine() && - ScrollToLine(GetVisibleBegin()+1) ) - ; - - // but in any case refresh it as even if it was only partly visible - // before we need to redraw it entirely as its background changed - RefreshLine(lineNo); - } - } - - return true; -} - -void wxSymbolListCtrl::SendSelectedEvent() -{ - wxCommandEvent event(wxEVT_COMMAND_LISTBOX_SELECTED, GetId()); - event.SetEventObject(this); - event.SetInt(m_current); - - (void)GetEventHandler()->ProcessEvent(event); -} - -void wxSymbolListCtrl::SetSelection(int selection) -{ - wxCHECK_RET( selection == wxNOT_FOUND || - (selection >= m_minSymbolValue && selection < m_maxSymbolValue), - _T("wxSymbolListCtrl::SetSelection(): invalid symbol value") ); - - DoSetCurrent(selection); -} - -// ---------------------------------------------------------------------------- -// wxSymbolListCtrl appearance parameters -// ---------------------------------------------------------------------------- - -void wxSymbolListCtrl::SetMargins(const wxPoint& pt) -{ - if ( pt != m_ptMargins ) - { - m_ptMargins = pt; - - Refresh(); - } -} - -void wxSymbolListCtrl::SetSelectionBackground(const wxColour& col) -{ - m_colBgSel = col; -} - -// ---------------------------------------------------------------------------- -// wxSymbolListCtrl painting -// ---------------------------------------------------------------------------- - -wxCoord wxSymbolListCtrl::OnGetLineHeight(size_t WXUNUSED(line)) const -{ - return m_cellSize.y + 2*m_ptMargins.y + 1 /* for divider */ ; -} - -// draws a line of symbols -void wxSymbolListCtrl::OnDrawItem(wxDC& dc, const wxRect& rect, size_t n) const -{ - wxColour oldTextColour = dc.GetTextForeground(); - int startSymbol = n*m_symbolsPerLine; - - int i; - for (i = 0; i < m_symbolsPerLine; i++) - { - bool resetColour = false; - int symbol = startSymbol+i; - if (symbol == m_current) - { - dc.SetBrush(wxBrush(m_colBgSel)); - - dc.SetTextForeground(wxSystemSettings::GetColour(wxSYS_COLOUR_HIGHLIGHTTEXT)); - resetColour = true; - - wxPen oldPen = dc.GetPen(); - dc.SetPen(*wxTRANSPARENT_PEN); - - dc.DrawRectangle(rect.x + i*m_cellSize.x, rect.y, m_cellSize.x, rect.y+rect.height); - dc.SetPen(oldPen); - } - - // Don't draw first line - if (i != 0) - dc.DrawLine(rect.x + i*m_cellSize.x, rect.y, i*m_cellSize.x, rect.y+rect.height); - - if (symbol >= m_minSymbolValue && symbol <= m_maxSymbolValue) - { - wxString text; - text << (wxChar) symbol; - - wxCoord w, h; - dc.GetTextExtent(text, & w, & h); - - int x = rect.x + i*m_cellSize.x + (m_cellSize.x - w)/2; - int y = rect.y + (m_cellSize.y - h)/2; - dc.DrawText(text, x, y); - } - - if (resetColour) - dc.SetTextForeground(oldTextColour); - } - - // Draw horizontal separator line - dc.DrawLine(rect.x, rect.y+rect.height-1, rect.x+rect.width, rect.y+rect.height-1); -} - -void wxSymbolListCtrl::OnPaint(wxPaintEvent& WXUNUSED(event)) -{ - // If size is larger, recalculate double buffer bitmap - wxSize clientSize = GetClientSize(); - - if ( !m_doubleBuffer || - clientSize.x > m_doubleBuffer->GetWidth() || - clientSize.y > m_doubleBuffer->GetHeight() ) - { - delete m_doubleBuffer; - m_doubleBuffer = new wxBitmap(clientSize.x+25,clientSize.y+25); - } - - wxBufferedPaintDC dc(this,*m_doubleBuffer); - - // the update rectangle - wxRect rectUpdate = GetUpdateClientRect(); - - // fill it with background colour - dc.SetBackground(GetBackgroundColour()); - dc.Clear(); - - // set the font to be displayed - dc.SetFont(GetFont()); - - // the bounding rectangle of the current line - wxRect rectLine; - rectLine.width = clientSize.x; - - dc.SetPen(wxPen(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT))); - dc.SetTextForeground(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT)); - dc.SetBackgroundMode(wxTRANSPARENT); - - // iterate over all visible lines - const size_t lineMax = GetVisibleEnd(); - for ( size_t line = GetFirstVisibleLine(); line < lineMax; line++ ) - { - const wxCoord hLine = OnGetLineHeight(line); - - rectLine.height = hLine; - - // and draw the ones which intersect the update rect - if ( rectLine.Intersects(rectUpdate) ) - { - // don't allow drawing outside of the lines rectangle - wxDCClipper clip(dc, rectLine); - - wxRect rect = rectLine; - rect.Deflate(m_ptMargins.x, m_ptMargins.y); - OnDrawItem(dc, rect, line); - } - else // no intersection - { - if ( rectLine.GetTop() > rectUpdate.GetBottom() ) - { - // we are already below the update rect, no need to continue - // further - break; - } - //else: the next line may intersect the update rect - } - - rectLine.y += hLine; - } -} - -// ============================================================================ -// wxSymbolListCtrl keyboard/mouse handling -// ============================================================================ - -void wxSymbolListCtrl::DoHandleItemClick(int item, int WXUNUSED(flags)) -{ - if (m_current != item) - { - m_current = item; - Refresh(); - SendSelectedEvent(); - } -} - -// ---------------------------------------------------------------------------- -// keyboard handling -// ---------------------------------------------------------------------------- - -void wxSymbolListCtrl::OnKeyDown(wxKeyEvent& event) -{ - // No keyboard interface for now - event.Skip(); -#if 0 - // flags for DoHandleItemClick() - int flags = ItemClick_Kbd; - - int currentLineNow = SymbolValueToLineNumber(m_current); - - int currentLine; - switch ( event.GetKeyCode() ) - { - case WXK_HOME: - currentLine = 0; - break; - - case WXK_END: - currentLine = GetLineCount() - 1; - break; - - case WXK_DOWN: - if ( currentLineNow == (int)GetLineCount() - 1 ) - return; - - currentLine = currentLineNow + 1; - break; - - case WXK_UP: - if ( m_current == wxNOT_FOUND ) - currentLine = GetLineCount() - 1; - else if ( currentLineNow != 0 ) - currentLine = currentLineNow - 1; - else // currentLineNow == 0 - return; - break; - - case WXK_PAGEDOWN: - PageDown(); - currentLine = GetFirstVisibleLine(); - break; - - case WXK_PAGEUP: - if ( currentLineNow == (int)GetFirstVisibleLine() ) - { - PageUp(); - } - - currentLine = GetFirstVisibleLine(); - break; - - case WXK_SPACE: - // hack: pressing space should work like a mouse click rather than - // like a keyboard arrow press, so trick DoHandleItemClick() in - // thinking we were clicked - flags &= ~ItemClick_Kbd; - currentLine = currentLineNow; - break; - -#ifdef __WXMSW__ - case WXK_TAB: - // Since we are using wxWANTS_CHARS we need to send navigation - // events for the tabs on MSW - { - wxNavigationKeyEvent ne; - ne.SetDirection(!event.ShiftDown()); - ne.SetCurrentFocus(this); - ne.SetEventObject(this); - GetParent()->GetEventHandler()->ProcessEvent(ne); - } - // fall through to default -#endif - default: - event.Skip(); - currentLine = 0; // just to silent the stupid compiler warnings - wxUnusedVar(currentNow); - return; - } - -#if 0 - if ( event.ShiftDown() ) - flags |= ItemClick_Shift; - if ( event.ControlDown() ) - flags |= ItemClick_Ctrl; - - DoHandleItemClick(current, flags); -#endif -#endif -} - -// ---------------------------------------------------------------------------- -// wxSymbolListCtrl mouse handling -// ---------------------------------------------------------------------------- - -void wxSymbolListCtrl::OnLeftDown(wxMouseEvent& event) -{ - SetFocus(); - - int item = HitTest(event.GetPosition()); - - if ( item != wxNOT_FOUND ) - { - int flags = 0; - if ( event.ShiftDown() ) - flags |= ItemClick_Shift; - - // under Mac Apple-click is used in the same way as Ctrl-click - // elsewhere -#ifdef __WXMAC__ - if ( event.MetaDown() ) -#else - if ( event.ControlDown() ) -#endif - flags |= ItemClick_Ctrl; - - DoHandleItemClick(item, flags); - } -} - -void wxSymbolListCtrl::OnLeftDClick(wxMouseEvent& eventMouse) -{ - int item = HitTest(eventMouse.GetPosition()); - if ( item != wxNOT_FOUND ) - { - - // if item double-clicked was not yet selected, then treat - // this event as a left-click instead - if ( item == m_current ) - { - wxCommandEvent event(wxEVT_COMMAND_LISTBOX_DOUBLECLICKED, GetId()); - event.SetEventObject(this); - event.SetInt(item); - - (void)GetEventHandler()->ProcessEvent(event); - } - else - { - OnLeftDown(eventMouse); - } - - } -} - -// calculate line number from symbol value -int wxSymbolListCtrl::SymbolValueToLineNumber(int item) -{ - return (int) (item/m_symbolsPerLine); -} - -// initialise control from current min/max values -void wxSymbolListCtrl::SetupCtrl(bool scrollToSelection) -{ - wxSize sz = GetClientSize(); - - m_symbolsPerLine = sz.x/(m_cellSize.x+m_ptMargins.x); - int noLines = (1 + SymbolValueToLineNumber(m_maxSymbolValue)); - - SetLineCount(noLines); - Refresh(); - - if (scrollToSelection && m_current != wxNOT_FOUND && m_current >= m_minSymbolValue && m_current <= m_maxSymbolValue) - { - ScrollToLine(SymbolValueToLineNumber(m_current)); - } -} - -// make this item visible -void wxSymbolListCtrl::EnsureVisible(int item) -{ - if (item != wxNOT_FOUND && item >= m_minSymbolValue && item <= m_maxSymbolValue) - { - ScrollToLine(SymbolValueToLineNumber(item)); - } -} - - -// hit testing -int wxSymbolListCtrl::HitTest(const wxPoint& pt) -{ - wxCoord lineHeight = OnGetLineHeight(0); - - int atLine = GetVisibleBegin() + (pt.y/lineHeight); - int symbol = (atLine*m_symbolsPerLine) + (pt.x/(m_cellSize.x+1)); - - if (symbol >= m_minSymbolValue && symbol <= m_maxSymbolValue) - return symbol; - - return -1; -} - -// Respond to size change -void wxSymbolListCtrl::OnSize(wxSizeEvent& event) -{ - SetupCtrl(); - event.Skip(); -} - -// set the current font -bool wxSymbolListCtrl::SetFont(const wxFont& font) -{ - wxVScrolledWindow::SetFont(font); - - SetupCtrl(); - - return true; -} - -// set Unicode/ASCII mode -void wxSymbolListCtrl::SetUnicodeMode(bool unicodeMode) -{ - bool changed = false; - if (unicodeMode && !m_unicodeMode) - { - changed = true; - - m_minSymbolValue = 0; - m_maxSymbolValue = 65535; - } - else if (!unicodeMode && m_unicodeMode) - { - changed = true; - m_minSymbolValue = 0; - m_maxSymbolValue = 255; - } - m_unicodeMode = unicodeMode; - - if (changed) - SetupCtrl(); -} - -// ---------------------------------------------------------------------------- -// use the same default attributes as wxListBox -// ---------------------------------------------------------------------------- - -//static -wxVisualAttributes -wxSymbolListCtrl::GetClassDefaultAttributes(wxWindowVariant variant) -{ - return wxListBox::GetClassDefaultAttributes(variant); -} - -#endif // wxUSE_RICHTEXT diff --git a/wxWidgets/src/richtext/richtexttabspage.cpp b/wxWidgets/src/richtext/richtexttabspage.cpp deleted file mode 100644 index 6782694e6c..0000000000 --- a/wxWidgets/src/richtext/richtexttabspage.cpp +++ /dev/null @@ -1,361 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/richtext/richtexttabspage.cpp -// Purpose: -// Author: Julian Smart -// Modified by: -// Created: 10/4/2006 8:03:20 AM -// RCS-ID: $Id: richtexttabspage.cpp 59814 2009-03-24 19:05:15Z JS $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#if wxUSE_RICHTEXT - -#include "wx/richtext/richtexttabspage.h" - -/*! - * wxRichTextTabsPage type definition - */ - -IMPLEMENT_DYNAMIC_CLASS( wxRichTextTabsPage, wxPanel ) - -/*! - * wxRichTextTabsPage event table definition - */ - -BEGIN_EVENT_TABLE( wxRichTextTabsPage, wxPanel ) - -////@begin wxRichTextTabsPage event table entries - EVT_LISTBOX( ID_RICHTEXTTABSPAGE_TABLIST, wxRichTextTabsPage::OnTablistSelected ) - - EVT_BUTTON( ID_RICHTEXTTABSPAGE_NEW_TAB, wxRichTextTabsPage::OnNewTabClick ) - EVT_UPDATE_UI( ID_RICHTEXTTABSPAGE_NEW_TAB, wxRichTextTabsPage::OnNewTabUpdate ) - - EVT_BUTTON( ID_RICHTEXTTABSPAGE_DELETE_TAB, wxRichTextTabsPage::OnDeleteTabClick ) - EVT_UPDATE_UI( ID_RICHTEXTTABSPAGE_DELETE_TAB, wxRichTextTabsPage::OnDeleteTabUpdate ) - - EVT_BUTTON( ID_RICHTEXTTABSPAGE_DELETE_ALL_TABS, wxRichTextTabsPage::OnDeleteAllTabsClick ) - EVT_UPDATE_UI( ID_RICHTEXTTABSPAGE_DELETE_ALL_TABS, wxRichTextTabsPage::OnDeleteAllTabsUpdate ) - -////@end wxRichTextTabsPage event table entries - -END_EVENT_TABLE() - -/*! - * wxRichTextTabsPage constructors - */ - -wxRichTextTabsPage::wxRichTextTabsPage( ) -{ - Init(); -} - -wxRichTextTabsPage::wxRichTextTabsPage( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style ) -{ - Init(); - Create(parent, id, pos, size, style); -} - -/*! - * Initialise members - */ - -void wxRichTextTabsPage::Init() -{ - m_tabsPresent = false; - -////@begin wxRichTextTabsPage member initialisation - m_tabEditCtrl = NULL; - m_tabListCtrl = NULL; -////@end wxRichTextTabsPage member initialisation -} - -/*! - * wxRichTextTabsPage creator - */ - -bool wxRichTextTabsPage::Create( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style ) -{ -////@begin wxRichTextTabsPage creation - wxPanel::Create( parent, id, pos, size, style ); - - CreateControls(); - if (GetSizer()) - { - GetSizer()->SetSizeHints(this); - } - Centre(); -////@end wxRichTextTabsPage creation - return true; -} - -/*! - * Control creation for wxRichTextTabsPage - */ - -void wxRichTextTabsPage::CreateControls() -{ -////@begin wxRichTextTabsPage content construction - wxRichTextTabsPage* itemPanel1 = this; - - wxBoxSizer* itemBoxSizer2 = new wxBoxSizer(wxVERTICAL); - itemPanel1->SetSizer(itemBoxSizer2); - - wxBoxSizer* itemBoxSizer3 = new wxBoxSizer(wxVERTICAL); - itemBoxSizer2->Add(itemBoxSizer3, 1, wxGROW|wxALL, 5); - - wxBoxSizer* itemBoxSizer4 = new wxBoxSizer(wxHORIZONTAL); - itemBoxSizer3->Add(itemBoxSizer4, 1, wxGROW, 5); - - wxBoxSizer* itemBoxSizer5 = new wxBoxSizer(wxVERTICAL); - itemBoxSizer4->Add(itemBoxSizer5, 0, wxGROW, 5); - - wxStaticText* itemStaticText6 = new wxStaticText( itemPanel1, wxID_STATIC, _("&Position (tenths of a mm):"), wxDefaultPosition, wxDefaultSize, 0 ); - itemBoxSizer5->Add(itemStaticText6, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP|wxADJUST_MINSIZE, 5); - - m_tabEditCtrl = new wxTextCtrl( itemPanel1, ID_RICHTEXTTABSPAGE_TABEDIT, _T(""), wxDefaultPosition, wxDefaultSize, 0 ); - m_tabEditCtrl->SetHelpText(_("The tab position.")); - if (wxRichTextTabsPage::ShowToolTips()) - m_tabEditCtrl->SetToolTip(_("The tab position.")); - itemBoxSizer5->Add(m_tabEditCtrl, 0, wxGROW|wxALL, 5); - - wxArrayString m_tabListCtrlStrings; - m_tabListCtrlStrings.Add(_("The tab positions.")); - m_tabListCtrl = new wxListBox( itemPanel1, ID_RICHTEXTTABSPAGE_TABLIST, wxDefaultPosition, wxSize(80, 180), m_tabListCtrlStrings, wxLB_SINGLE ); - itemBoxSizer5->Add(m_tabListCtrl, 1, wxGROW|wxLEFT|wxRIGHT|wxBOTTOM, 5); - - itemBoxSizer4->Add(2, 1, 1, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM, 5); - - wxBoxSizer* itemBoxSizer10 = new wxBoxSizer(wxVERTICAL); - itemBoxSizer4->Add(itemBoxSizer10, 0, wxGROW, 5); - - wxStaticText* itemStaticText11 = new wxStaticText( itemPanel1, wxID_STATIC, _T(""), wxDefaultPosition, wxDefaultSize, 0 ); - itemBoxSizer10->Add(itemStaticText11, 0, wxALIGN_CENTER_HORIZONTAL|wxBOTTOM|wxADJUST_MINSIZE, 5); - - wxButton* itemButton12 = new wxButton( itemPanel1, ID_RICHTEXTTABSPAGE_NEW_TAB, _("&New"), wxDefaultPosition, wxDefaultSize, 0 ); - itemButton12->SetHelpText(_("Click to create a new tab position.")); - if (wxRichTextTabsPage::ShowToolTips()) - itemButton12->SetToolTip(_("Click to create a new tab position.")); - itemBoxSizer10->Add(itemButton12, 0, wxGROW|wxALL, 5); - - wxButton* itemButton13 = new wxButton( itemPanel1, ID_RICHTEXTTABSPAGE_DELETE_TAB, _("&Delete"), wxDefaultPosition, wxDefaultSize, 0 ); - itemButton13->SetHelpText(_("Click to delete the selected tab position.")); - if (wxRichTextTabsPage::ShowToolTips()) - itemButton13->SetToolTip(_("Click to delete the selected tab position.")); - itemBoxSizer10->Add(itemButton13, 0, wxGROW|wxLEFT|wxRIGHT|wxBOTTOM, 5); - - wxButton* itemButton14 = new wxButton( itemPanel1, ID_RICHTEXTTABSPAGE_DELETE_ALL_TABS, _("Delete A&ll"), wxDefaultPosition, wxDefaultSize, 0 ); - itemButton14->SetHelpText(_("Click to delete all tab positions.")); - if (wxRichTextTabsPage::ShowToolTips()) - itemButton14->SetToolTip(_("Click to delete all tab positions.")); - itemBoxSizer10->Add(itemButton14, 0, wxGROW|wxLEFT|wxRIGHT|wxBOTTOM, 5); - -////@end wxRichTextTabsPage content construction -} - -/// Transfer data from/to window -bool wxRichTextTabsPage::TransferDataFromWindow() -{ - wxPanel::TransferDataFromWindow(); - - wxTextAttrEx* attr = GetAttributes(); - - if (m_tabsPresent) - { - wxArrayInt tabs; - size_t i; - for (i = 0; i < m_tabListCtrl->GetCount(); i++) - { - tabs.Add(wxAtoi(m_tabListCtrl->GetString(i))); - } - attr->SetTabs(tabs); - } - return true; -} - -bool wxRichTextTabsPage::TransferDataToWindow() -{ - wxPanel::TransferDataToWindow(); - - wxTextAttrEx* attr = GetAttributes(); - - m_tabListCtrl->Clear(); - m_tabEditCtrl->SetValue(wxEmptyString); - - if (attr->HasTabs()) - { - m_tabsPresent = true; - size_t i; - for (i = 0; i < attr->GetTabs().GetCount(); i++) - { - wxString s(wxString::Format(wxT("%d"), attr->GetTabs()[i])); - m_tabListCtrl->Append(s); - } - } - - return true; -} - -static int wxTabSortFunc(int* a, int* b) -{ - if ((*a) < (*b)) - return -1; - else if ((*b) < (*a)) - return 1; - else - return 0; -} - -/// Sorts the tab array -void wxRichTextTabsPage::SortTabs() -{ - wxArrayInt tabs; - size_t i; - for (i = 0; i < m_tabListCtrl->GetCount(); i++) - { - tabs.Add(wxAtoi(m_tabListCtrl->GetString(i))); - } - tabs.Sort(& wxTabSortFunc); - - m_tabListCtrl->Clear(); - for (i = 0; i < tabs.GetCount(); i++) - { - wxString s(wxString::Format(wxT("%d"), tabs[i])); - m_tabListCtrl->Append(s); - } -} - -wxTextAttrEx* wxRichTextTabsPage::GetAttributes() -{ - return wxRichTextFormattingDialog::GetDialogAttributes(this); -} - -/*! - * Should we show tooltips? - */ - -bool wxRichTextTabsPage::ShowToolTips() -{ - return wxRichTextFormattingDialog::ShowToolTips(); -} - -/*! - * Get bitmap resources - */ - -wxBitmap wxRichTextTabsPage::GetBitmapResource( const wxString& name ) -{ - // Bitmap retrieval -////@begin wxRichTextTabsPage bitmap retrieval - wxUnusedVar(name); - return wxNullBitmap; -////@end wxRichTextTabsPage bitmap retrieval -} - -/*! - * Get icon resources - */ - -wxIcon wxRichTextTabsPage::GetIconResource( const wxString& name ) -{ - // Icon retrieval -////@begin wxRichTextTabsPage icon retrieval - wxUnusedVar(name); - return wxNullIcon; -////@end wxRichTextTabsPage icon retrieval -} - -/*! - * wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_RICHTEXTTABSPAGE_NEW_TAB - */ - -void wxRichTextTabsPage::OnNewTabClick( wxCommandEvent& WXUNUSED(event) ) -{ - wxString str = m_tabEditCtrl->GetValue(); - if (!str.empty() && str.IsNumber()) - { - wxString s(wxString::Format(wxT("%d"), wxAtoi(str))); - - m_tabListCtrl->Append(s); - m_tabsPresent = true; - - SortTabs(); - } -} - -/*! - * wxEVT_UPDATE_UI event handler for ID_RICHTEXTTABSPAGE_NEW_TAB - */ - -void wxRichTextTabsPage::OnNewTabUpdate( wxUpdateUIEvent& event ) -{ - // This may be a bit expensive - consider updating New button when text - // changes in edit control - wxString str = m_tabEditCtrl->GetValue(); - if (!str.empty() && str.IsNumber()) - { - wxString s(wxString::Format(wxT("%d"), wxAtoi(str))); - event.Enable(m_tabListCtrl->FindString(s) == wxNOT_FOUND); - } - else - event.Enable(false); -} - - -/*! - * wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_RICHTEXTTABSPAGE_DELETE_TAB - */ - -void wxRichTextTabsPage::OnDeleteTabClick( wxCommandEvent& WXUNUSED(event) ) -{ - if (m_tabsPresent && m_tabListCtrl->GetCount() > 0 && m_tabListCtrl->GetSelection() != wxNOT_FOUND) - { - m_tabListCtrl->Delete(m_tabListCtrl->GetSelection()); - } -} - -/*! - * wxEVT_UPDATE_UI event handler for ID_RICHTEXTTABSPAGE_DELETE_TAB - */ - -void wxRichTextTabsPage::OnDeleteTabUpdate( wxUpdateUIEvent& event ) -{ - event.Enable( m_tabsPresent && m_tabListCtrl->GetCount() > 0 && m_tabListCtrl->GetSelection() != wxNOT_FOUND ); -} - - -/*! - * wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_RICHTEXTTABSPAGE_DELETE_ALL_TABS - */ - -void wxRichTextTabsPage::OnDeleteAllTabsClick( wxCommandEvent& WXUNUSED(event) ) -{ - if (m_tabsPresent && m_tabListCtrl->GetCount() > 0) - { - m_tabListCtrl->Clear(); - m_tabEditCtrl->SetValue(wxEmptyString); - } -} - -/*! - * wxEVT_UPDATE_UI event handler for ID_RICHTEXTTABSPAGE_DELETE_ALL_TABS - */ - -void wxRichTextTabsPage::OnDeleteAllTabsUpdate( wxUpdateUIEvent& event ) -{ - event.Enable( m_tabsPresent && m_tabListCtrl->GetCount() > 0 ); -} - - -/*! - * wxEVT_COMMAND_LISTBOX_SELECTED event handler for ID_RICHTEXTTABSPAGE_TABLIST - */ - -void wxRichTextTabsPage::OnTablistSelected( wxCommandEvent& WXUNUSED(event) ) -{ - wxString str = m_tabListCtrl->GetStringSelection(); - if (!str.empty()) - m_tabEditCtrl->SetValue(str); -} - -#endif // wxUSE_RICHTEXT diff --git a/wxWidgets/src/richtext/richtextxml.cpp b/wxWidgets/src/richtext/richtextxml.cpp deleted file mode 100644 index 34e78bc56e..0000000000 --- a/wxWidgets/src/richtext/richtextxml.cpp +++ /dev/null @@ -1,1358 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/richtext/richtextxml.cpp -// Purpose: XML and HTML I/O for wxRichTextCtrl -// Author: Julian Smart -// Modified by: -// Created: 2005-09-30 -// RCS-ID: $Id: richtextxml.cpp 67247 2011-03-19 12:27:23Z JS $ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_RICHTEXT && wxUSE_XML - -#include "wx/richtext/richtextxml.h" - -#ifndef WX_PRECOMP - #include "wx/intl.h" - #include "wx/module.h" -#endif - -#include "wx/filename.h" -#include "wx/clipbrd.h" -#include "wx/wfstream.h" -#include "wx/sstream.h" -#include "wx/txtstrm.h" -#include "wx/tokenzr.h" -#include "wx/xml/xml.h" - -IMPLEMENT_DYNAMIC_CLASS(wxRichTextXMLHandler, wxRichTextFileHandler) - -#if wxUSE_STREAMS -bool wxRichTextXMLHandler::DoLoadFile(wxRichTextBuffer *buffer, wxInputStream& stream) -{ - if (!stream.IsOk()) - return false; - - buffer->ResetAndClearCommands(); - buffer->Clear(); - - wxXmlDocument* xmlDoc = new wxXmlDocument; - bool success = true; - - // This is the encoding to convert to (memory encoding rather than file encoding) - wxString encoding(wxT("UTF-8")); - -#if !wxUSE_UNICODE && wxUSE_INTL - encoding = wxLocale::GetSystemEncodingName(); -#endif - - if (!xmlDoc->Load(stream, encoding)) - { - buffer->ResetAndClearCommands(); - success = false; - } - else - { - if (xmlDoc->GetRoot() && xmlDoc->GetRoot()->GetType() == wxXML_ELEMENT_NODE && xmlDoc->GetRoot()->GetName() == wxT("richtext")) - { - wxXmlNode* child = xmlDoc->GetRoot()->GetChildren(); - while (child) - { - if (child->GetType() == wxXML_ELEMENT_NODE) - { - wxString name = child->GetName(); - if (name == wxT("richtext-version")) - { - } - else - ImportXML(buffer, child); - } - - child = child->GetNext(); - } - } - else - { - success = false; - } - } - - delete xmlDoc; - - buffer->UpdateRanges(); - - return success; -} - -/// Recursively import an object -bool wxRichTextXMLHandler::ImportXML(wxRichTextBuffer* buffer, wxXmlNode* node) -{ - wxString name = node->GetName(); - - bool doneChildren = false; - - if (name == wxT("paragraphlayout")) - { - wxString partial = node->GetPropVal(wxT("partialparagraph"), wxEmptyString); - if (partial == wxT("true")) - buffer->SetPartialParagraph(true); - } - else if (name == wxT("paragraph")) - { - wxRichTextParagraph* para = new wxRichTextParagraph(buffer); - buffer->AppendChild(para); - - GetStyle(para->GetAttributes(), node, true); - - wxXmlNode* child = node->GetChildren(); - while (child) - { - wxString childName = child->GetName(); - if (childName == wxT("text")) - { - wxString text; - wxXmlNode* textChild = child->GetChildren(); - while (textChild) - { - if (textChild->GetType() == wxXML_TEXT_NODE || - textChild->GetType() == wxXML_CDATA_SECTION_NODE) - { - wxString text2 = textChild->GetContent(); - - // Strip whitespace from end - if (!text2.empty() && text2[text2.length()-1] == wxT('\n')) - text2 = text2.Mid(0, text2.length()-1); - - if (!text2.empty() && text2[0] == wxT('"')) - text2 = text2.Mid(1); - if (!text2.empty() && text2[text2.length()-1] == wxT('"')) - text2 = text2.Mid(0, text2.length() - 1); - - text += text2; - } - textChild = textChild->GetNext(); - } - - wxRichTextPlainText* textObject = new wxRichTextPlainText(text, para); - GetStyle(textObject->GetAttributes(), child, false); - - para->AppendChild(textObject); - } - else if (childName == wxT("symbol")) - { - // This is a symbol that XML can't read in the normal way - wxString text; - wxXmlNode* textChild = child->GetChildren(); - while (textChild) - { - if (textChild->GetType() == wxXML_TEXT_NODE || - textChild->GetType() == wxXML_CDATA_SECTION_NODE) - { - wxString text2 = textChild->GetContent(); - text += text2; - } - textChild = textChild->GetNext(); - } - - wxString actualText; - actualText << (wxChar) wxAtoi(text); - - wxRichTextPlainText* textObject = new wxRichTextPlainText(actualText, para); - GetStyle(textObject->GetAttributes(), child, false); - - para->AppendChild(textObject); - } - else if (childName == wxT("image")) - { - int imageType = wxBITMAP_TYPE_PNG; - wxString value = child->GetPropVal(wxT("imagetype"), wxEmptyString); - if (!value.empty()) - imageType = wxAtoi(value); - - wxString data; - - wxXmlNode* imageChild = child->GetChildren(); - while (imageChild) - { - wxString childName = imageChild->GetName(); - if (childName == wxT("data")) - { - wxXmlNode* dataChild = imageChild->GetChildren(); - while (dataChild) - { - data = dataChild->GetContent(); - // wxLogDebug(data); - dataChild = dataChild->GetNext(); - } - - } - imageChild = imageChild->GetNext(); - } - - if (!data.empty()) - { - wxRichTextImage* imageObj = new wxRichTextImage(para); - GetStyle(imageObj->GetAttributes(), child, false); - para->AppendChild(imageObj); - - wxStringInputStream strStream(data); - - imageObj->GetImageBlock().ReadHex(strStream, data.length(), imageType); - } - } - child = child->GetNext(); - } - - doneChildren = true; - } - else if (name == wxT("stylesheet")) - { - if (GetFlags() & wxRICHTEXT_HANDLER_INCLUDE_STYLESHEET) - { - wxRichTextStyleSheet* sheet = new wxRichTextStyleSheet; - wxString sheetName = node->GetPropVal(wxT("name"), wxEmptyString); - wxString sheetDescription = node->GetPropVal(wxT("description"), wxEmptyString); - sheet->SetName(sheetName); - sheet->SetDescription(sheetDescription); - - wxXmlNode* child = node->GetChildren(); - while (child) - { - ImportStyleDefinition(sheet, child); - - child = child->GetNext(); - } - - // Notify that styles have changed. If this is vetoed by the app, - // the new sheet will be deleted. If it is not vetoed, the - // old sheet will be deleted and replaced with the new one. - buffer->SetStyleSheetAndNotify(sheet); - } - doneChildren = true; - } - - if (!doneChildren) - { - wxXmlNode* child = node->GetChildren(); - while (child) - { - ImportXML(buffer, child); - child = child->GetNext(); - } - } - - return true; -} - -bool wxRichTextXMLHandler::ImportStyleDefinition(wxRichTextStyleSheet* sheet, wxXmlNode* node) -{ - wxString styleType = node->GetName(); - wxString styleName = node->GetPropVal(wxT("name"), wxEmptyString); - wxString baseStyleName = node->GetPropVal(wxT("basestyle"), wxEmptyString); - - if (styleName.IsEmpty()) - return false; - - if (styleType == wxT("characterstyle")) - { - wxRichTextCharacterStyleDefinition* def = new wxRichTextCharacterStyleDefinition(styleName); - def->SetBaseStyle(baseStyleName); - - wxXmlNode* child = node->GetChildren(); - while (child) - { - if (child->GetName() == wxT("style")) - { - wxTextAttrEx attr; - GetStyle(attr, child, false); - def->SetStyle(attr); - } - child = child->GetNext(); - } - - sheet->AddCharacterStyle(def); - } - else if (styleType == wxT("paragraphstyle")) - { - wxRichTextParagraphStyleDefinition* def = new wxRichTextParagraphStyleDefinition(styleName); - - wxString nextStyleName = node->GetPropVal(wxT("nextstyle"), wxEmptyString); - def->SetNextStyle(nextStyleName); - def->SetBaseStyle(baseStyleName); - - wxXmlNode* child = node->GetChildren(); - while (child) - { - if (child->GetName() == wxT("style")) - { - wxTextAttrEx attr; - GetStyle(attr, child, true); - def->SetStyle(attr); - } - child = child->GetNext(); - } - - sheet->AddParagraphStyle(def); - } - else if (styleType == wxT("liststyle")) - { - wxRichTextListStyleDefinition* def = new wxRichTextListStyleDefinition(styleName); - - wxString nextStyleName = node->GetPropVal(wxT("nextstyle"), wxEmptyString); - def->SetNextStyle(nextStyleName); - def->SetBaseStyle(baseStyleName); - - wxXmlNode* child = node->GetChildren(); - while (child) - { - if (child->GetName() == wxT("style")) - { - wxTextAttrEx attr; - GetStyle(attr, child, true); - - wxString styleLevel = child->GetPropVal(wxT("level"), wxEmptyString); - if (styleLevel.IsEmpty()) - { - def->SetStyle(attr); - } - else - { - int level = wxAtoi(styleLevel); - if (level > 0 && level <= 10) - { - def->SetLevelAttributes(level-1, attr); - } - } - } - child = child->GetNext(); - } - - sheet->AddListStyle(def); - } - - return true; -} - -//----------------------------------------------------------------------------- -// xml support routines -//----------------------------------------------------------------------------- - -bool wxRichTextXMLHandler::HasParam(wxXmlNode* node, const wxString& param) -{ - return (GetParamNode(node, param) != NULL); -} - -wxXmlNode *wxRichTextXMLHandler::GetParamNode(wxXmlNode* node, const wxString& param) -{ - wxCHECK_MSG(node, NULL, wxT("You can't access node data before it was initialized!")); - - wxXmlNode *n = node->GetChildren(); - - while (n) - { - if (n->GetType() == wxXML_ELEMENT_NODE && n->GetName() == param) - return n; - n = n->GetNext(); - } - return NULL; -} - - -wxString wxRichTextXMLHandler::GetNodeContent(wxXmlNode *node) -{ - wxXmlNode *n = node; - if (n == NULL) return wxEmptyString; - n = n->GetChildren(); - - while (n) - { - if (n->GetType() == wxXML_TEXT_NODE || - n->GetType() == wxXML_CDATA_SECTION_NODE) - return n->GetContent(); - n = n->GetNext(); - } - return wxEmptyString; -} - - -wxString wxRichTextXMLHandler::GetParamValue(wxXmlNode *node, const wxString& param) -{ - if (param.empty()) - return GetNodeContent(node); - else - return GetNodeContent(GetParamNode(node, param)); -} - -wxString wxRichTextXMLHandler::GetText(wxXmlNode *node, const wxString& param, bool WXUNUSED(translate)) -{ - wxXmlNode *parNode = GetParamNode(node, param); - if (!parNode) - parNode = node; - wxString str1(GetNodeContent(parNode)); - return str1; -} - -// For use with earlier versions of wxWidgets -#ifndef WXUNUSED_IN_UNICODE -#if wxUSE_UNICODE -#define WXUNUSED_IN_UNICODE(x) WXUNUSED(x) -#else -#define WXUNUSED_IN_UNICODE(x) x -#endif -#endif - -// write string to output: -inline static void OutputString(wxOutputStream& stream, const wxString& str, - wxMBConv *WXUNUSED_IN_UNICODE(convMem) = NULL, wxMBConv *convFile = NULL) -{ - if (str.empty()) return; -#if wxUSE_UNICODE - if (convFile) - { - const wxWX2MBbuf buf(str.mb_str(*convFile)); - stream.Write((const char*)buf, strlen((const char*)buf)); - } - else - { - const wxWX2MBbuf buf(str.mb_str(wxConvUTF8)); - stream.Write((const char*)buf, strlen((const char*)buf)); - } -#else - if ( convFile == NULL ) - stream.Write(str.mb_str(), str.Len()); - else - { - wxString str2(str.wc_str(*convMem), *convFile); - stream.Write(str2.mb_str(), str2.Len()); - } -#endif -} - -// Same as above, but create entities first. -// Translates '<' to "<", '>' to ">" and '&' to "&" -static void OutputStringEnt(wxOutputStream& stream, const wxString& str, - wxMBConv *convMem = NULL, wxMBConv *convFile = NULL) -{ - wxString buf; - size_t i, last, len; - wxChar c; - - len = str.Len(); - last = 0; - for (i = 0; i < len; i++) - { - c = str.GetChar(i); - - // Original code excluded "&" but we _do_ want to convert - // the ampersand beginning & because otherwise when read in, - // the original "&" becomes "&". - - if (c == wxT('<') || c == wxT('>') || c == wxT('"') || - (c == wxT('&') /* && (str.Mid(i+1, 4) != wxT("amp;")) */ )) - { - OutputString(stream, str.Mid(last, i - last), convMem, convFile); - switch (c) - { - case wxT('<'): - OutputString(stream, wxT("<"), NULL, NULL); - break; - case wxT('>'): - OutputString(stream, wxT(">"), NULL, NULL); - break; - case wxT('&'): - OutputString(stream, wxT("&"), NULL, NULL); - break; - case wxT('"'): - OutputString(stream, wxT("""), NULL, NULL); - break; - default: break; - } - last = i + 1; - } - else if (wxUChar(c) > 127) - { - OutputString(stream, str.Mid(last, i - last), convMem, convFile); - - wxString s(wxT("&#")); -#if wxUSE_UNICODE - s << (int) c; -#else - s << (int) wxUChar(c); -#endif - s << wxT(";"); - OutputString(stream, s, NULL, NULL); - last = i + 1; - } - } - OutputString(stream, str.Mid(last, i - last), convMem, convFile); -} - -static wxString AttributeToXML(const wxString& str) -{ - wxString str1; - size_t i, last, len; - wxChar c; - - len = str.Len(); - last = 0; - for (i = 0; i < len; i++) - { - c = str.GetChar(i); - - // Original code excluded "&" but we _do_ want to convert - // the ampersand beginning & because otherwise when read in, - // the original "&" becomes "&". - - if (c == wxT('<') || c == wxT('>') || c == wxT('"') || - (c == wxT('&') /* && (str.Mid(i+1, 4) != wxT("amp;")) */ )) - { - str1 += str.Mid(last, i - last); - switch (c) - { - case wxT('<'): - str1 += wxT("<"); - break; - case wxT('>'): - str1 += wxT(">"); - break; - case wxT('&'): - str1 += wxT("&"); - break; - case wxT('"'): - str1 += wxT("""); - break; - default: break; - } - last = i + 1; - } - else if (wxUChar(c) > 127) - { - str1 += str.Mid(last, i - last); - - wxString s(wxT("&#")); -#if wxUSE_UNICODE - s << (int) c; -#else - s << (int) wxUChar(c); -#endif - s << wxT(";"); - str1 += s; - last = i + 1; - } - } - str1 += str.Mid(last, i - last); - return str1; -} - -inline static void OutputIndentation(wxOutputStream& stream, int indent) -{ - wxString str = wxT("\n"); - for (int i = 0; i < indent; i++) - str << wxT(' ') << wxT(' '); - OutputString(stream, str, NULL, NULL); -} - -// Convert a colour to a 6-digit hex string -static wxString ColourToHexString(const wxColour& col) -{ - wxString hex; - - hex += wxDecToHex(col.Red()); - hex += wxDecToHex(col.Green()); - hex += wxDecToHex(col.Blue()); - - return hex; -} - -// Convert 6-digit hex string to a colour -static wxColour HexStringToColour(const wxString& hex) -{ - unsigned char r = (unsigned char)wxHexToDec(hex.Mid(0, 2)); - unsigned char g = (unsigned char)wxHexToDec(hex.Mid(2, 2)); - unsigned char b = (unsigned char)wxHexToDec(hex.Mid(4, 2)); - - return wxColour(r, g, b); -} - -bool wxRichTextXMLHandler::DoSaveFile(wxRichTextBuffer *buffer, wxOutputStream& stream) -{ - if (!stream.IsOk()) - return false; - - wxString version(wxT("1.0") ) ; - - bool deleteConvFile = false; - wxString fileEncoding; - wxMBConv* convFile = NULL; - -#if wxUSE_UNICODE - fileEncoding = wxT("UTF-8"); - convFile = & wxConvUTF8; -#else - fileEncoding = wxT("ISO-8859-1"); - convFile = & wxConvISO8859_1; -#endif - - // If SetEncoding has been called, change the output encoding. - if (!m_encoding.empty() && m_encoding.Lower() != fileEncoding.Lower()) - { - if (m_encoding == wxT("")) - { -#if wxUSE_INTL - fileEncoding = wxLocale::GetSystemEncodingName(); -#endif // wxUSE_INTL - } - else - { - fileEncoding = m_encoding; - } - - // GetSystemEncodingName may not have returned a name - if (fileEncoding.empty()) -#if wxUSE_UNICODE - fileEncoding = wxT("UTF-8"); -#else - fileEncoding = wxT("ISO-8859-1"); -#endif - convFile = new wxCSConv(fileEncoding); - deleteConvFile = true; - } - -#if !wxUSE_UNICODE - wxMBConv* convMem = wxConvCurrent; -#else - wxMBConv* convMem = NULL; -#endif - - wxString s ; - s.Printf(wxT("\n"), - (const wxChar*) version, (const wxChar*) fileEncoding ); - OutputString(stream, s, NULL, NULL); - OutputString(stream, wxT("") , NULL, NULL); - - int level = 1; - - if (buffer->GetStyleSheet() && (GetFlags() & wxRICHTEXT_HANDLER_INCLUDE_STYLESHEET)) - { - OutputIndentation(stream, level); - wxString nameAndDescr; - if (!buffer->GetStyleSheet()->GetName().IsEmpty()) - nameAndDescr << wxT(" name=\"") << buffer->GetStyleSheet()->GetName() << wxT("\""); - if (!buffer->GetStyleSheet()->GetDescription().IsEmpty()) - nameAndDescr << wxT(" description=\"") << buffer->GetStyleSheet()->GetDescription() << wxT("\""); - OutputString(stream, wxString(wxT(""), convMem, convFile); - - int i; - - for (i = 0; i < (int) buffer->GetStyleSheet()->GetCharacterStyleCount(); i++) - { - wxRichTextCharacterStyleDefinition* def = buffer->GetStyleSheet()->GetCharacterStyle(i); - ExportStyleDefinition(stream, convMem, convFile, def, level + 1); - } - - for (i = 0; i < (int) buffer->GetStyleSheet()->GetParagraphStyleCount(); i++) - { - wxRichTextParagraphStyleDefinition* def = buffer->GetStyleSheet()->GetParagraphStyle(i); - ExportStyleDefinition(stream, convMem, convFile, def, level + 1); - } - - for (i = 0; i < (int) buffer->GetStyleSheet()->GetListStyleCount(); i++) - { - wxRichTextListStyleDefinition* def = buffer->GetStyleSheet()->GetListStyle(i); - ExportStyleDefinition(stream, convMem, convFile, def, level + 1); - } - - OutputIndentation(stream, level); - OutputString(stream, wxT(""), convMem, convFile); - } - - - bool success = ExportXML(stream, convMem, convFile, *buffer, level); - - OutputString(stream, wxT("\n") , NULL, NULL); - OutputString(stream, wxT("\n"), NULL, NULL); - - if (deleteConvFile) - delete convFile; - - return success; -} - -/// Recursively export an object -bool wxRichTextXMLHandler::ExportXML(wxOutputStream& stream, wxMBConv* convMem, wxMBConv* convFile, wxRichTextObject& obj, int indent) -{ - wxString objectName; - if (obj.IsKindOf(CLASSINFO(wxRichTextParagraphLayoutBox))) - objectName = wxT("paragraphlayout"); - else if (obj.IsKindOf(CLASSINFO(wxRichTextParagraph))) - objectName = wxT("paragraph"); - else if (obj.IsKindOf(CLASSINFO(wxRichTextPlainText))) - objectName = wxT("text"); - else if (obj.IsKindOf(CLASSINFO(wxRichTextImage))) - objectName = wxT("image"); - else - objectName = wxT("object"); - - bool terminateTag = true; - - if (obj.IsKindOf(CLASSINFO(wxRichTextPlainText))) - { - wxRichTextPlainText& textObj = (wxRichTextPlainText&) obj; - - wxString style = CreateStyle(obj.GetAttributes(), false); - - int i; - int last = 0; - const wxString& text = textObj.GetText(); - int len = (int) text.Length(); - - if (len == 0) - { - i = 0; - OutputIndentation(stream, indent); - OutputString(stream, wxT("<") + objectName, convMem, convFile); - OutputString(stream, style + wxT(">"), convMem, convFile); - OutputString(stream, wxT(""), convMem, convFile); - } - else for (i = 0; i < len; i++) - { -#if wxUSE_UNICODE - int c = (int) text[i]; -#else - int c = (int) wxUChar(text[i]); -#endif - if ((c < 32 || c == 34) && /* c != 9 && */ c != 10 && c != 13) - { - if (i > 0) - { - wxString fragment(text.Mid(last, i-last)); - if (!fragment.IsEmpty()) - { - OutputIndentation(stream, indent); - OutputString(stream, wxT("<") + objectName, convMem, convFile); - - OutputString(stream, style + wxT(">"), convMem, convFile); - - if (!fragment.empty() && (fragment[0] == wxT(' ') || fragment[fragment.length()-1] == wxT(' '))) - { - OutputString(stream, wxT("\""), convMem, convFile); - OutputStringEnt(stream, fragment, convMem, convFile); - OutputString(stream, wxT("\""), convMem, convFile); - } - else - OutputStringEnt(stream, fragment, convMem, convFile); - - OutputString(stream, wxT(""), convMem, convFile); - } - } - - // Output this character as a number in a separate tag, because XML can't cope - // with entities below 32 except for 10 and 13 - last = i + 1; - OutputIndentation(stream, indent); - OutputString(stream, wxT(""), convMem, convFile); - OutputString(stream, wxString::Format(wxT("%d"), c), convMem, convFile); - - OutputString(stream, wxT(""), convMem, convFile); - } - } - - wxString fragment; - if (last == 0) - fragment = text; - else - fragment = text.Mid(last, i-last); - - if (last < len) - { - OutputIndentation(stream, indent); - OutputString(stream, wxT("<") + objectName, convMem, convFile); - - OutputString(stream, style + wxT(">"), convMem, convFile); - - if (!fragment.empty() && (fragment[0] == wxT(' ') || fragment[fragment.length()-1] == wxT(' '))) - { - OutputString(stream, wxT("\""), convMem, convFile); - OutputStringEnt(stream, fragment, convMem, convFile); - OutputString(stream, wxT("\""), convMem, convFile); - } - else - OutputStringEnt(stream, fragment, convMem, convFile); - } - else - terminateTag = false; - } - else if (obj.IsKindOf(CLASSINFO(wxRichTextImage))) - { - wxRichTextImage& imageObj = (wxRichTextImage&) obj; - - wxString style = CreateStyle(obj.GetAttributes(), false); - - if (imageObj.GetImage().Ok() && !imageObj.GetImageBlock().Ok()) - imageObj.MakeBlock(); - - OutputIndentation(stream, indent); - OutputString(stream, wxT("<") + objectName, convMem, convFile); - if (!imageObj.GetImageBlock().Ok()) - { - // No data - OutputString(stream, style + wxT(">"), convMem, convFile); - } - else - { - OutputString(stream, wxString::Format(wxT(" imagetype=\"%d\""), (int) imageObj.GetImageBlock().GetImageType()) + style + wxT(">")); - } - - OutputIndentation(stream, indent+1); - OutputString(stream, wxT(""), convMem, convFile); - - imageObj.GetImageBlock().WriteHex(stream); - - OutputString(stream, wxT(""), convMem, convFile); - } - else if (obj.IsKindOf(CLASSINFO(wxRichTextCompositeObject))) - { - OutputIndentation(stream, indent); - OutputString(stream, wxT("<") + objectName, convMem, convFile); - - bool isPara = false; - if (objectName == wxT("paragraph") || objectName == wxT("paragraphlayout")) - isPara = true; - - wxString style = CreateStyle(obj.GetAttributes(), isPara); - - if (objectName == wxT("paragraphlayout") && ((wxRichTextParagraphLayoutBox&) obj).GetPartialParagraph()) - style << wxT(" partialparagraph=\"true\""); - - OutputString(stream, style + wxT(">"), convMem, convFile); - - wxRichTextCompositeObject& composite = (wxRichTextCompositeObject&) obj; - size_t i; - for (i = 0; i < composite.GetChildCount(); i++) - { - wxRichTextObject* child = composite.GetChild(i); - ExportXML(stream, convMem, convFile, *child, indent+1); - } - } - - if (objectName != wxT("text")) - OutputIndentation(stream, indent); - - if (terminateTag) - OutputString(stream, wxT(""), convMem, convFile); - - return true; -} - -bool wxRichTextXMLHandler::ExportStyleDefinition(wxOutputStream& stream, wxMBConv* convMem, wxMBConv* convFile, wxRichTextStyleDefinition* def, int level) -{ - wxRichTextCharacterStyleDefinition* charDef = wxDynamicCast(def, wxRichTextCharacterStyleDefinition); - wxRichTextParagraphStyleDefinition* paraDef = wxDynamicCast(def, wxRichTextParagraphStyleDefinition); - wxRichTextListStyleDefinition* listDef = wxDynamicCast(def, wxRichTextListStyleDefinition); - - wxString baseStyle = def->GetBaseStyle(); - wxString baseStyleProp; - if (!baseStyle.IsEmpty()) - baseStyleProp = wxT(" basestyle=\"") + baseStyle + wxT("\""); - - wxString descr = def->GetDescription(); - wxString descrProp; - if (!descr.IsEmpty()) - descrProp = wxT(" description=\"") + descr + wxT("\""); - - if (charDef) - { - OutputIndentation(stream, level); - OutputString(stream, wxT(""), convMem, convFile); - - level ++; - - wxString style = CreateStyle(def->GetStyle(), false); - - OutputIndentation(stream, level); - OutputString(stream, wxT(""), convMem, convFile); - - level --; - - OutputIndentation(stream, level); - OutputString(stream, wxT(""), convMem, convFile); - } - else if (listDef) - { - OutputIndentation(stream, level); - - if (!listDef->GetNextStyle().IsEmpty()) - baseStyleProp << wxT(" nextstyle=\"") << listDef->GetNextStyle() << wxT("\""); - - OutputString(stream, wxT(""), convMem, convFile); - - level ++; - - wxString style = CreateStyle(def->GetStyle(), true); - - OutputIndentation(stream, level); - OutputString(stream, wxT(""), convMem, convFile); - - int i; - for (i = 0; i < 10; i ++) - { - wxRichTextAttr* levelAttr = listDef->GetLevelAttributes(i); - if (levelAttr) - { - wxString style = CreateStyle(*levelAttr, true); - wxString levelStr = wxString::Format(wxT(" level=\"%d\" "), (i+1)); - - OutputIndentation(stream, level); - OutputString(stream, wxT(""), convMem, convFile); - } - } - - level --; - - OutputIndentation(stream, level); - OutputString(stream, wxT(""), convMem, convFile); - } - else if (paraDef) - { - OutputIndentation(stream, level); - - if (!paraDef->GetNextStyle().IsEmpty()) - baseStyleProp << wxT(" nextstyle=\"") << paraDef->GetNextStyle() << wxT("\""); - - OutputString(stream, wxT(""), convMem, convFile); - - level ++; - - wxString style = CreateStyle(def->GetStyle(), false); - - OutputIndentation(stream, level); - OutputString(stream, wxT(""), convMem, convFile); - - level --; - - OutputIndentation(stream, level); - OutputString(stream, wxT(""), convMem, convFile); - } - - return true; -} - -/// Create style parameters -wxString wxRichTextXMLHandler::CreateStyle(const wxTextAttrEx& attr, bool isPara) -{ - wxString str; - if (attr.HasTextColour() && attr.GetTextColour().Ok()) - { - str << wxT(" textcolor=\"#") << ColourToHexString(attr.GetTextColour()) << wxT("\""); - } - if (attr.HasBackgroundColour() && attr.GetBackgroundColour().Ok()) - { - str << wxT(" bgcolor=\"#") << ColourToHexString(attr.GetBackgroundColour()) << wxT("\""); - } - - if (attr.GetFont().Ok()) - { - if (attr.HasFontSize()) - str << wxT(" fontsize=\"") << attr.GetFont().GetPointSize() << wxT("\""); - - //if (attr.HasFontFamily()) - // str << wxT(" fontfamily=\"") << attr.GetFont().GetFamily() << wxT("\""); - - if (attr.HasFontItalic()) - str << wxT(" fontstyle=\"") << attr.GetFont().GetStyle() << wxT("\""); - - if (attr.HasFontWeight()) - str << wxT(" fontweight=\"") << attr.GetFont().GetWeight() << wxT("\""); - - if (attr.HasFontUnderlined()) - str << wxT(" fontunderlined=\"") << (int) attr.GetFont().GetUnderlined() << wxT("\""); - - if (attr.HasFontFaceName()) - str << wxT(" fontface=\"") << attr.GetFont().GetFaceName() << wxT("\""); - } - - if (attr.HasTextEffects()) - { - str << wxT(" texteffects=\""); - str << attr.GetTextEffects(); - str << wxT("\""); - - str << wxT(" texteffectflags=\""); - str << attr.GetTextEffectFlags(); - str << wxT("\""); - } - - if (!attr.GetCharacterStyleName().empty()) - str << wxT(" characterstyle=\"") << wxString(attr.GetCharacterStyleName()) << wxT("\""); - - if (attr.HasURL()) - str << wxT(" url=\"") << AttributeToXML(attr.GetURL()) << wxT("\""); - - if (isPara) - { - if (attr.HasAlignment()) - str << wxT(" alignment=\"") << (int) attr.GetAlignment() << wxT("\""); - - if (attr.HasLeftIndent()) - { - str << wxT(" leftindent=\"") << (int) attr.GetLeftIndent() << wxT("\""); - str << wxT(" leftsubindent=\"") << (int) attr.GetLeftSubIndent() << wxT("\""); - } - - if (attr.HasRightIndent()) - str << wxT(" rightindent=\"") << (int) attr.GetRightIndent() << wxT("\""); - - if (attr.HasParagraphSpacingAfter()) - str << wxT(" parspacingafter=\"") << (int) attr.GetParagraphSpacingAfter() << wxT("\""); - - if (attr.HasParagraphSpacingBefore()) - str << wxT(" parspacingbefore=\"") << (int) attr.GetParagraphSpacingBefore() << wxT("\""); - - if (attr.HasLineSpacing()) - str << wxT(" linespacing=\"") << (int) attr.GetLineSpacing() << wxT("\""); - - if (attr.HasBulletStyle()) - str << wxT(" bulletstyle=\"") << (int) attr.GetBulletStyle() << wxT("\""); - - if (attr.HasBulletNumber()) - str << wxT(" bulletnumber=\"") << (int) attr.GetBulletNumber() << wxT("\""); - - if (attr.HasBulletText()) - { - // If using a bullet symbol, convert to integer in case it's a non-XML-friendly character. - // Otherwise, assume it's XML-friendly text such as outline numbering, e.g. 1.2.3.1 - if (!attr.GetBulletText().IsEmpty() && (attr.GetBulletStyle() & wxTEXT_ATTR_BULLET_STYLE_SYMBOL)) - str << wxT(" bulletsymbol=\"") << (int) (attr.GetBulletText()[0]) << wxT("\""); - else - str << wxT(" bullettext=\"") << attr.GetBulletText() << wxT("\""); - - str << wxT(" bulletfont=\"") << attr.GetBulletFont() << wxT("\""); - } - - if (attr.HasBulletName()) - str << wxT(" bulletname=\"") << attr.GetBulletName() << wxT("\""); - - if (!attr.GetParagraphStyleName().empty()) - str << wxT(" parstyle=\"") << wxString(attr.GetParagraphStyleName()) << wxT("\""); - - if (!attr.GetListStyleName().empty()) - str << wxT(" liststyle=\"") << wxString(attr.GetListStyleName()) << wxT("\""); - - if (attr.HasTabs()) - { - str << wxT(" tabs=\""); - size_t i; - for (i = 0; i < attr.GetTabs().GetCount(); i++) - { - if (i > 0) - str << wxT(","); - str << attr.GetTabs()[i]; - } - str << wxT("\""); - } - - if (attr.HasPageBreak()) - { - str << wxT(" pagebreak=\"1\""); - } - - if (attr.HasOutlineLevel()) - str << wxT(" outlinelevel=\"") << (int) attr.GetOutlineLevel() << wxT("\""); - - } - - return str; -} - -/// Replace face name with current name for platform. -/// TODO: introduce a virtual function or settable table to -/// do this comprehensively. -bool wxRichTextFixFaceName(wxString& facename) -{ - if (facename.IsEmpty()) - return false; - -#ifdef __WXMSW__ - if (facename == wxT("Times")) - { - facename = wxT("Times New Roman"); - return true; - } - else if (facename == wxT("Helvetica")) - { - facename = wxT("Arial"); - return true; - } - else if (facename == wxT("Courier")) - { - facename = wxT("Courier New"); - return true; - } - else - return false; -#else - if (facename == wxT("Times New Roman")) - { - facename = wxT("Times"); - return true; - } - else if (facename == wxT("Arial")) - { - facename = wxT("Helvetica"); - return true; - } - else if (facename == wxT("Courier New")) - { - facename = wxT("Courier"); - return true; - } - else - return false; -#endif -} - - -/// Get style parameters -bool wxRichTextXMLHandler::GetStyle(wxTextAttrEx& attr, wxXmlNode* node, bool isPara) -{ - wxString fontFacename; - int fontSize = 12; - int fontFamily = wxDEFAULT; - int fontWeight = wxNORMAL; - int fontStyle = wxNORMAL; - bool fontUnderlined = false; - int fontFlags = 0; - const wxString emptyString; // save a temporary string construction in GetPropVal - - fontFacename = node->GetPropVal(wxT("fontface"), emptyString); - if (!fontFacename.IsEmpty()) - { - fontFlags |= wxTEXT_ATTR_FONT_FACE; - - if (GetFlags() & wxRICHTEXT_HANDLER_CONVERT_FACENAMES) - wxRichTextFixFaceName(fontFacename); - } - - wxString value; - //value = node->GetPropVal(wxT("fontfamily"), emptyString); - //if (!value.empty()) - // fontFamily = wxAtoi(value); - - value = node->GetPropVal(wxT("fontstyle"), emptyString); - if (!value.empty()) - { - fontStyle = wxAtoi(value); - fontFlags |= wxTEXT_ATTR_FONT_ITALIC; - } - - value = node->GetPropVal(wxT("fontsize"), emptyString); - if (!value.empty()) - { - fontSize = wxAtoi(value); - fontFlags |= wxTEXT_ATTR_FONT_SIZE; - } - - value = node->GetPropVal(wxT("fontweight"), emptyString); - if (!value.empty()) - { - fontWeight = wxAtoi(value); - fontFlags |= wxTEXT_ATTR_FONT_WEIGHT; - } - - value = node->GetPropVal(wxT("fontunderlined"), emptyString); - if (!value.empty()) - { - fontUnderlined = wxAtoi(value) != 0; - fontFlags |= wxTEXT_ATTR_FONT_UNDERLINE; - } - - attr.SetFlags(fontFlags); - - // FindOrCreateFont is an expensive operation on GTK+ (because pango functions are called) - // so only use it on other platforms - if (attr.HasFlag(wxTEXT_ATTR_FONT)) -#ifdef __WXGTK__ - attr.SetFont(wxFont(fontSize, fontFamily, fontStyle, fontWeight, fontUnderlined, fontFacename)); -#else - attr.SetFont(* wxTheFontList->FindOrCreateFont(fontSize, fontFamily, fontStyle, fontWeight, fontUnderlined, fontFacename)); -#endif - - // Restore correct font flags - attr.SetFlags(fontFlags); - - value = node->GetPropVal(wxT("textcolor"), emptyString); - if (!value.empty()) - { - if (value[0] == wxT('#')) - attr.SetTextColour(HexStringToColour(value.Mid(1))); - else - attr.SetTextColour(value); - } - - value = node->GetPropVal(wxT("bgcolor"), emptyString); - if (!value.empty()) - { - if (value[0] == wxT('#')) - attr.SetBackgroundColour(HexStringToColour(value.Mid(1))); - else - attr.SetBackgroundColour(value); - } - - value = node->GetPropVal(wxT("characterstyle"), emptyString); - if (!value.empty()) - attr.SetCharacterStyleName(value); - - value = node->GetPropVal(wxT("texteffects"), emptyString); - if (!value.IsEmpty()) - { - attr.SetTextEffects(wxAtoi(value)); - } - - value = node->GetPropVal(wxT("texteffectflags"), emptyString); - if (!value.IsEmpty()) - { - attr.SetTextEffectFlags(wxAtoi(value)); - } - - value = node->GetPropVal(wxT("url"), emptyString); - if (!value.empty()) - attr.SetURL(value); - - // Set paragraph attributes - if (isPara) - { - value = node->GetPropVal(wxT("alignment"), emptyString); - if (!value.empty()) - attr.SetAlignment((wxTextAttrAlignment) wxAtoi(value)); - - int leftSubIndent = 0; - int leftIndent = 0; - bool hasLeftIndent = false; - - value = node->GetPropVal(wxT("leftindent"), emptyString); - if (!value.empty()) - { - leftIndent = wxAtoi(value); - hasLeftIndent = true; - } - - value = node->GetPropVal(wxT("leftsubindent"), emptyString); - if (!value.empty()) - { - leftSubIndent = wxAtoi(value); - hasLeftIndent = true; - } - - if (hasLeftIndent) - attr.SetLeftIndent(leftIndent, leftSubIndent); - - value = node->GetPropVal(wxT("rightindent"), emptyString); - if (!value.empty()) - attr.SetRightIndent(wxAtoi(value)); - - value = node->GetPropVal(wxT("parspacingbefore"), emptyString); - if (!value.empty()) - attr.SetParagraphSpacingBefore(wxAtoi(value)); - - value = node->GetPropVal(wxT("parspacingafter"), emptyString); - if (!value.empty()) - attr.SetParagraphSpacingAfter(wxAtoi(value)); - - value = node->GetPropVal(wxT("linespacing"), emptyString); - if (!value.empty()) - attr.SetLineSpacing(wxAtoi(value)); - - value = node->GetPropVal(wxT("bulletstyle"), emptyString); - if (!value.empty()) - attr.SetBulletStyle(wxAtoi(value)); - - value = node->GetPropVal(wxT("bulletnumber"), emptyString); - if (!value.empty()) - attr.SetBulletNumber(wxAtoi(value)); - - value = node->GetPropVal(wxT("bulletsymbol"), emptyString); - if (!value.empty()) - { - wxChar ch = wxAtoi(value); - wxString s; - s << ch; - attr.SetBulletText(s); - } - - value = node->GetPropVal(wxT("bullettext"), emptyString); - if (!value.empty()) - attr.SetBulletText(value); - - value = node->GetPropVal(wxT("bulletfont"), emptyString); - if (!value.empty()) - attr.SetBulletFont(value); - - value = node->GetPropVal(wxT("bulletname"), emptyString); - if (!value.empty()) - attr.SetBulletName(value); - - value = node->GetPropVal(wxT("parstyle"), emptyString); - if (!value.empty()) - attr.SetParagraphStyleName(value); - - value = node->GetPropVal(wxT("liststyle"), emptyString); - if (!value.empty()) - attr.SetListStyleName(value); - - value = node->GetPropVal(wxT("tabs"), emptyString); - if (!value.empty()) - { - wxArrayInt tabs; - wxStringTokenizer tkz(value, wxT(",")); - while (tkz.HasMoreTokens()) - { - wxString token = tkz.GetNextToken(); - tabs.Add(wxAtoi(token)); - } - attr.SetTabs(tabs); - } - - value = node->GetPropVal(wxT("pagebreak"), emptyString); - if (!value.IsEmpty()) - { - attr.SetPageBreak(wxAtoi(value) != 0); - } - - value = node->GetPropVal(wxT("outlinelevel"), emptyString); - if (!value.IsEmpty()) - { - attr.SetOutlineLevel(wxAtoi(value)); - } - } - - return true; -} - -#endif - // wxUSE_STREAMS - -#endif - // wxUSE_RICHTEXT && wxUSE_XML - diff --git a/wxWidgets/src/tiff/COPYRIGHT b/wxWidgets/src/tiff/COPYRIGHT deleted file mode 100644 index 8282186151..0000000000 --- a/wxWidgets/src/tiff/COPYRIGHT +++ /dev/null @@ -1,21 +0,0 @@ -Copyright (c) 1988-1997 Sam Leffler -Copyright (c) 1991-1997 Silicon Graphics, Inc. - -Permission to use, copy, modify, distribute, and sell this software and -its documentation for any purpose is hereby granted without fee, provided -that (i) the above copyright notices and this permission notice appear in -all copies of the software and related documentation, and (ii) the names of -Sam Leffler and Silicon Graphics may not be used in any advertising or -publicity relating to the software without the specific, prior written -permission of Sam Leffler and Silicon Graphics. - -THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, -EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY -WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - -IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR -ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, -OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF -LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE -OF THIS SOFTWARE. diff --git a/wxWidgets/src/tiff/MAKEFILE.VA b/wxWidgets/src/tiff/MAKEFILE.VA deleted file mode 100644 index 053d52532e..0000000000 --- a/wxWidgets/src/tiff/MAKEFILE.VA +++ /dev/null @@ -1,230 +0,0 @@ -# -# File: makefile.vc -# Author: David Webster -# Created: 2000 -# Updated: -# Copyright: c) 2000, BHM -# Licence: wxWindows Licence -# -# "%W% %G%" -# -# Makefile : Builds os2tiff.lib library for OS/2 3.0/4.0 - -# Suffixes -OBJSUFF=obj -SRCSUFF=cpp - -OS2FLAGS=/c /W2 /DOS232 /D__VISAGECPP__ /D__VISAGECPP30__ /DOS2_32 /Tdc /Q /N100 -OS2LINKFLAGS=/BASE:0x00010000 /PMTYPE:PM /NOE /NOD /ALIGN:16 -OS2LIBFLAGS=/NOL /NOE -OS2LIBS=CPPOM30.lib CPPOOC3.LIB OS2386.LIB - -!if "$(WXMAKINGDLL)" != "0" -EXTRADLLFLAGS=/DWXMAKINGDLL=1 /Ge- /D__OS2DLL__ -EXTRALNKFLAGS=/DLL -!endif - -# Change WXDIR or WXWIN to wherever wxWindows is found -WXDIR = $(WXWIN) - -OS2TIFFDIR=$(WXDIR)\src\tiff -OS2TIFFINC=$(WINTIFFDIR) -OS2TIFFLIB=$(WXDIR)\lib\os2tiff.lib - -!if "$(WXMAKINGDLL)" != "1" -OS2TIFFLIB=$(WXDIR)\lib\os2tiff.lib -!else -OS2TIFFLIB=$(WXDIR)\lib\os2tiff.dll -!endif - -INC=-I$(WXDIR)\src\TIFF -I$(OS2TIFFINC) - -!ifndef FINAL -FINAL=0 -!endif - -!if "$(NOPCH)" == "1" -PCH= -PRECOMP= -MAKEPRECOMP= -!else -PCH=$(WXLIBNAME).pch -PRECOMP=/Si$(PCH) -MAKEPRECOMP=/Fi$(PCH) -!endif - -!if "$(FINAL)" == "0" -!if "$(WXMAKINGDLL)" == "1" -D=DebugOS2DLL -!else -D=DebugOS2 -!endif -OPT = -DEBUG_FLAGS= /Ti /D__WXDEBUG__ #/Fb -LINK_DEBUG_FLAGS=/DEBUG -CRTFLAG=/Gm /Gd -!else -# /O1 - smallest code -# /O2 - fastest code -!if "$(WXMAKINGDLL)" == "1" -D=RelseOS2DLL -!else -D=RelseOS2 -!endif -OPT = /O+ /Oc /G5 -DEBUG_FLAGS= -LINK_DEBUG_FLAGS=/RELEASE -CRTFLAG=/Gm /Gd -!endif - -!if [md $(OS2TIFFDIR)\$D] -!endif - - -CPPFLAGS=$(OS2FLAGS) $(EXTRADLLFLAGS) $(DEBUG_FLAGS) $(PRECOMP) $(INC) $(OPT) $(CRTFLAG) -LINKFKAGS=$(OS2LINKFLAGS) $(EXTRALNKFLAGS) - -{..\tiff}.c{..\tiff\$D}.obj: - @echo $< - icc @<< -$(CPPFLAGS) /Fo$@ /Tp $< -<< - -OBJECTS = \ - ..\tiff\$D\tif_aux.obj \ - ..\tiff\$D\tif_close.obj \ - ..\tiff\$D\tif_codec.obj \ - ..\tiff\$D\tif_compress.obj \ - ..\tiff\$D\tif_dir.obj \ - ..\tiff\$D\tif_dirinfo.obj \ - ..\tiff\$D\tif_dirread.obj \ - ..\tiff\$D\tif_dirwrite.obj \ - ..\tiff\$D\tif_dumpmode.obj \ - ..\tiff\$D\tif_error.obj \ - ..\tiff\$D\tif_fax3.obj \ - ..\tiff\$D\tif_fax3sm.obj \ - ..\tiff\$D\tif_flush.obj \ - ..\tiff\$D\tif_getimage.obj \ - ..\tiff\$D\tif_jpeg.obj \ - ..\tiff\$D\tif_luv.obj \ - ..\tiff\$D\tif_lzw.obj \ - ..\tiff\$D\tif_next.obj \ - ..\tiff\$D\tif_open.obj \ - ..\tiff\$D\tif_os2.obj \ - ..\tiff\$D\tif_packbits.obj \ - ..\tiff\$D\tif_pixarlog.obj \ - ..\tiff\$D\tif_predict.obj \ - ..\tiff\$D\tif_print.obj \ - ..\tiff\$D\tif_read.obj \ - ..\tiff\$D\tif_strip.obj \ - ..\tiff\$D\tif_swab.obj \ - ..\tiff\$D\tif_thunder.obj \ - ..\tiff\$D\tif_tile.obj \ - ..\tiff\$D\tif_version.obj \ - ..\tiff\$D\tif_warning.obj \ - ..\tiff\$D\tif_write.obj \ - ..\tiff\$D\tif_zip.obj - -LIBOBJECTS = \ - tif_aux.obj \ - tif_close.obj \ - tif_codec.obj \ - tif_compress.obj \ - tif_dir.obj \ - tif_dirinfo.obj \ - tif_dirread.obj \ - tif_dirwrite.obj \ - tif_dumpmode.obj \ - tif_error.obj \ - tif_fax3.obj \ - tif_fax3sm.obj \ - tif_flush.obj \ - tif_getimage.obj \ - tif_jpeg.obj \ - tif_luv.obj \ - tif_lzw.obj \ - tif_next.obj \ - tif_open.obj \ - tif_os2.obj \ - tif_packbits.obj \ - tif_pixarlog.obj \ - tif_predict.obj \ - tif_print.obj \ - tif_read.obj \ - tif_strip.obj \ - tif_swab.obj \ - tif_thunder.obj \ - tif_tile.obj \ - tif_version.obj \ - tif_warning.obj \ - tif_write.obj \ - tif_zip.obj - -all: $(OBJECTS) $(OS2TIFFLIB) - -!if "$(WXMAKINGDLL)" != "1" - -$(WXDIR)\lib\os2tiff.lib: $(LIBOBJECTS) - touch $(WXDIR)\lib\os2tiff.lib - del $(WXDIR)\lib\os2tiff.lib - ilib $(OS2LIBFLAGS) $@ @<< - $**; -<< - del *.obj - -!else - -# Update the dynamic link library -$(WXDIR)\lib\os2tiff.dll: $(OBJECTS) - icc @<< - /B" $(LINKFLAGS)" /Fe$@ - $(LIBS) - $(OBJECTS) - $(WXDIR)\src\os2\os2tiff.def -<< - implib $(WXDIR)\lib\os2tiffd.lib $(WXDIR)\src\os2\os2tiff.def - -!endif - -clean: - del $(OS2TIFFLIB) - erase /N $(OS2TIFFDIR)\$D - rd $(OS2TIFFDIR)\$D - -cleanall: clean - -$(LIBOBJECTS): - copy ..\tiff\$D\tif_aux.obj - copy ..\tiff\$D\tif_close.obj - copy ..\tiff\$D\tif_codec.obj - copy ..\tiff\$D\tif_compress.obj - copy ..\tiff\$D\tif_dir.obj - copy ..\tiff\$D\tif_dirinfo.obj - copy ..\tiff\$D\tif_dirread.obj - copy ..\tiff\$D\tif_dirwrite.obj - copy ..\tiff\$D\tif_dumpmode.obj - copy ..\tiff\$D\tif_error.obj - copy ..\tiff\$D\tif_fax3.obj - copy ..\tiff\$D\tif_fax3sm.obj - copy ..\tiff\$D\tif_flush.obj - copy ..\tiff\$D\tif_getimage.obj - copy ..\tiff\$D\tif_jpeg.obj - copy ..\tiff\$D\tif_luv.obj - copy ..\tiff\$D\tif_lzw.obj - copy ..\tiff\$D\tif_next.obj - copy ..\tiff\$D\tif_open.obj - copy ..\tiff\$D\tif_os2.obj - copy ..\tiff\$D\tif_packbits.obj - copy ..\tiff\$D\tif_pixarlog.obj - copy ..\tiff\$D\tif_predict.obj - copy ..\tiff\$D\tif_print.obj - copy ..\tiff\$D\tif_read.obj - copy ..\tiff\$D\tif_strip.obj - copy ..\tiff\$D\tif_swab.obj - copy ..\tiff\$D\tif_thunder.obj - copy ..\tiff\$D\tif_tile.obj - copy ..\tiff\$D\tif_version.obj - copy ..\tiff\$D\tif_warning.obj - copy ..\tiff\$D\tif_write.obj - copy ..\tiff\$D\tif_zip.obj - diff --git a/wxWidgets/src/tiff/Makefile.lcc b/wxWidgets/src/tiff/Makefile.lcc deleted file mode 100644 index 0e763eb3fb..0000000000 --- a/wxWidgets/src/tiff/Makefile.lcc +++ /dev/null @@ -1,129 +0,0 @@ -# $Header$ -# -# Tag Image File Format Library -# -# Copyright (c) 1988-1997 Sam Leffler -# Copyright (c) 1991-1997 Silicon Graphics, Inc. -# -# Permission to use, copy, modify, distribute, and sell this software and -# its documentation for any purpose is hereby granted without fee, provided -# that (i) the above copyright notices and this permission notice appear in -# all copies of the software and related documentation, and (ii) the names of -# Sam Leffler and Silicon Graphics may not be used in any advertising or -# publicity relating to the software without the specific, prior written -# permission of Stanford and Silicon Graphics. -# -# THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, -# EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY -# WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. -# -# IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR -# ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, -# OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -# WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF -# LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE -# OF THIS SOFTWARE. -# -DESTDIR=. -# -INSTALL=install -NULL= - -IPATH= -I. -I../jpeg -CONF_LIBRARY=\ - ${NULL} -COPTS= -Oloop -cwagshf -d1 -b0 -v -DNDEBUG -rr -j135i -CFLAGS= ${COPTS} ${IPATH} ${CONF_LIBRARY} -# -INCS= tiff.h tiffio.h -SRCS= tif_fax3.c \ - tif_fax4.c \ - tif_aux.c \ - tif_atari.c \ - tif_ccittrle.c \ - tif_close.c \ - tif_compress.c \ - tif_dir.c \ - tif_dirinfo.c \ - tif_dirread.c \ - tif_dirwrite.c \ - tif_dumpmode.c \ - tif_error.c \ - tif_getimage.c \ - tif_jpeg.c \ - tif_flush.c \ - tif_lzw.c \ - tif_next.c \ - tif_open.c \ - tif_packbits.c \ - tif_print.c \ - tif_read.c \ - tif_swab.c \ - tif_strip.c \ - tif_thunder.c \ - tif_tile.c \ - tif_version.c \ - tif_warning.c \ - tif_write.c \ - ${NULL} -OBJS= tif_fax3.o \ - tif_fax4.o \ - tif_aux.o \ - tif_atari.o \ - tif_ccittrle.o \ - tif_close.o \ - tif_compress.o \ - tif_dir.o \ - tif_dirinfo.o \ - tif_dirread.o \ - tif_dirwrite.o \ - tif_dumpmode.o \ - tif_error.o \ - tif_getimage.o \ - tif_jpeg.o \ - tif_flush.o \ - tif_lzw.o \ - tif_next.o \ - tif_open.o \ - tif_packbits.o \ - tif_print.o \ - tif_read.o \ - tif_swab.o \ - tif_strip.o \ - tif_thunder.o \ - tif_tile.o \ - tif_version.o \ - tif_warning.o \ - tif_write.o \ - ${NULL} -ALL= tiffrnb.lib - -all: ${ALL} - -${ALL}: ${OBJS} - ${AR} ${ARFLAGS} $@ r $< - -${OBJS}: tiffio.h tiff.h tiffcomp.h tiffiop.h tiffconf.h -tif_fax3.o: tif_fax3.c g3states.h t4.h tif_fax3.h - -g3states.h: mkg3states.c t4.h - ${CC} -o mkg3states.ttp ${CFLAGS} mkg3states.c - ./mkg3states -c > g3states.h - -install: all installh - -for i in ${ALL}; do \ - ${INSTALL} -c -m 644 $$i ${DESTDIR}/lib/$$i; \ - done - -installh: ${INCS} - -for i in ${INCS}; do \ - h=`basename $$i`; \ - cmp -s $$i ${DESTDIR}/include/$$h || \ - ${INSTALL} -c -m 444 $$i ${DESTDIR}/include/$$h; \ - done - -clean: - rm -f ${ALL} ${OBJS} mkg3states.ttp mkg3states.o g3states.h - -tags: ${SRCS} - ${CTAGS} ${SRCS} diff --git a/wxWidgets/src/tiff/README b/wxWidgets/src/tiff/README deleted file mode 100644 index ecc2f84bcd..0000000000 --- a/wxWidgets/src/tiff/README +++ /dev/null @@ -1,61 +0,0 @@ -$Header$ - - -TIFF Software Distribution --------------------------- -This file is just a placeholder; all the documentation is now in -HTML in the html directory. To view the documentation point your -favorite WWW viewer at html/index.html; e.g. - - netscape html/index.html - -If you don't have an HTML viewer then you can read the HTML source -or fetch a PostScript version of this documentation from the directory - - ftp://ftp.sgi.com/graphics/tiff/doc - -If you can't hack either of these options then basically what you -want to do is: - - % ./configure - % make - % su - # make install - -If that doesn't do what you want, or something isn't clear then -sorry, but you're SOL. - - Sam Leffler (sam@engr.sgi.com) - - -Use and Copyright ------------------ -Silicon Graphics has seen fit to allow me to give this work away. It -is free. There is no support or guarantee of any sort as to its -operations, correctness, or whatever. If you do anything useful with -all or parts of it you need to honor the copyright notices. I would -also be interested in knowing about it and, hopefully, be acknowledged. - -The legal way of saying that is: - -Copyright (c) 1988-1997 Sam Leffler -Copyright (c) 1991-1997 Silicon Graphics, Inc. - -Permission to use, copy, modify, distribute, and sell this software and -its documentation for any purpose is hereby granted without fee, provided -that (i) the above copyright notices and this permission notice appear in -all copies of the software and related documentation, and (ii) the names of -Sam Leffler and Silicon Graphics may not be used in any advertising or -publicity relating to the software without the specific, prior written -permission of Sam Leffler and Silicon Graphics. - -THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, -EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY -WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - -IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR -ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, -OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF -LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE -OF THIS SOFTWARE. diff --git a/wxWidgets/src/tiff/TODO b/wxWidgets/src/tiff/TODO deleted file mode 100644 index be6be2abe8..0000000000 --- a/wxWidgets/src/tiff/TODO +++ /dev/null @@ -1,7 +0,0 @@ -# $Header$ - -o tiffcmp read data by strip/tile instead of scanline -o YCbCr sampling support -o extracate colorspace conversion support -o look at isolating all codecs from TIFF library -o JPEG colormode order dependency problem diff --git a/wxWidgets/src/tiff/VERSION b/wxWidgets/src/tiff/VERSION deleted file mode 100644 index 0ed63eab34..0000000000 --- a/wxWidgets/src/tiff/VERSION +++ /dev/null @@ -1 +0,0 @@ -3.6.1-3 diff --git a/wxWidgets/src/tiff/fax3sm_winnt.c b/wxWidgets/src/tiff/fax3sm_winnt.c deleted file mode 100644 index 564c9aa4d2..0000000000 --- a/wxWidgets/src/tiff/fax3sm_winnt.c +++ /dev/null @@ -1,1046 +0,0 @@ -/* WARNING, this file was automatically generated by the - mkg3states program */ -#include "tiff.h" -#include "tif_fax3.h" - const TIFFFaxTabEnt TIFFFaxMainTable[128] = { -12,7,0,3,1,0,5,3,1,3,1,0,2,3,0,3,1,0,4,3,1,3,1,0,1,4,0,3,1,0,5,3,1,3,1,0, -2,3,0,3,1,0,4,3,1,3,1,0,5,6,2,3,1,0,5,3,1,3,1,0,2,3,0,3,1,0,4,3,1,3,1,0, -1,4,0,3,1,0,5,3,1,3,1,0,2,3,0,3,1,0,4,3,1,3,1,0,5,7,3,3,1,0,5,3,1,3,1,0, -2,3,0,3,1,0,4,3,1,3,1,0,1,4,0,3,1,0,5,3,1,3,1,0,2,3,0,3,1,0,4,3,1,3,1,0, -4,6,2,3,1,0,5,3,1,3,1,0,2,3,0,3,1,0,4,3,1,3,1,0,1,4,0,3,1,0,5,3,1,3,1,0, -2,3,0,3,1,0,4,3,1,3,1,0,6,7,0,3,1,0,5,3,1,3,1,0,2,3,0,3,1,0,4,3,1,3,1,0, -1,4,0,3,1,0,5,3,1,3,1,0,2,3,0,3,1,0,4,3,1,3,1,0,5,6,2,3,1,0,5,3,1,3,1,0, -2,3,0,3,1,0,4,3,1,3,1,0,1,4,0,3,1,0,5,3,1,3,1,0,2,3,0,3,1,0,4,3,1,3,1,0, -4,7,3,3,1,0,5,3,1,3,1,0,2,3,0,3,1,0,4,3,1,3,1,0,1,4,0,3,1,0,5,3,1,3,1,0, -2,3,0,3,1,0,4,3,1,3,1,0,4,6,2,3,1,0,5,3,1,3,1,0,2,3,0,3,1,0,4,3,1,3,1,0, -1,4,0,3,1,0,5,3,1,3,1,0,2,3,0,3,1,0,4,3,1,3,1,0 -}; -const TIFFFaxTabEnt TIFFFaxWhiteTable[4096] = { -12,11,0,7,4,3,7,5,11,7,4,5,7,6,12,7,5,9,9,6,1664,7,4,6,7,7,20,9,5,128,7,7,24,7,6,14, -7,7,28,7,4,4,7,4,2,7,4,7,7,7,23,7,4,3,7,7,27,7,4,5,7,8,39,7,6,16,9,8,576,7,4,6, -7,7,19,7,5,8,7,8,55,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7,7,8,45,7,4,3,7,5,11,7,4,5, -7,8,53,7,5,9,9,8,448,7,4,6,7,8,35,9,5,128,7,8,51,7,6,15,7,8,63,7,4,4,7,4,2,7,4,7, -7,6,13,7,4,3,9,9,1472,7,4,5,7,8,43,7,6,17,9,9,1216,7,4,6,7,6,1,7,5,8,9,6,192,9,5,64, -7,5,10,7,4,4,7,4,2,7,4,7,7,8,29,7,4,3,7,5,11,7,4,5,7,6,12,7,5,9,9,6,1664,7,4,6, -7,8,33,9,5,128,7,8,49,7,6,14,7,8,61,7,4,4,7,4,2,7,4,7,7,8,47,7,4,3,7,8,59,7,4,5, -7,8,41,7,6,16,9,9,960,7,4,6,7,8,31,7,5,8,7,8,57,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7, -7,7,22,7,4,3,7,5,11,7,4,5,7,7,26,7,5,9,9,9,704,7,4,6,7,8,37,9,5,128,7,7,25,7,6,15, -9,8,320,7,4,4,7,4,2,7,4,7,7,6,13,7,4,3,7,7,18,7,4,5,7,7,21,7,6,17,9,7,256,7,4,6, -7,6,1,7,5,8,9,6,192,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7,11,11,1792,7,4,3,7,5,11,7,4,5, -7,6,12,7,5,9,9,6,1664,7,4,6,7,7,20,9,5,128,7,7,24,7,6,14,7,7,28,7,4,4,7,4,2,7,4,7, -7,7,23,7,4,3,7,7,27,7,4,5,7,8,40,7,6,16,9,9,832,7,4,6,7,7,19,7,5,8,7,8,56,9,5,64, -7,5,10,7,4,4,7,4,2,7,4,7,7,8,46,7,4,3,7,5,11,7,4,5,7,8,54,7,5,9,9,8,512,7,4,6, -7,8,36,9,5,128,7,8,52,7,6,15,7,8,0,7,4,4,7,4,2,7,4,7,7,6,13,7,4,3,9,9,1600,7,4,5, -7,8,44,7,6,17,9,9,1344,7,4,6,7,6,1,7,5,8,9,6,192,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7, -7,8,30,7,4,3,7,5,11,7,4,5,7,6,12,7,5,9,9,6,1664,7,4,6,7,8,34,9,5,128,7,8,50,7,6,14, -7,8,62,7,4,4,7,4,2,7,4,7,7,8,48,7,4,3,7,8,60,7,4,5,7,8,42,7,6,16,9,9,1088,7,4,6, -7,8,32,7,5,8,7,8,58,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7,7,7,22,7,4,3,7,5,11,7,4,5, -7,7,26,7,5,9,9,8,640,7,4,6,7,8,38,9,5,128,7,7,25,7,6,15,9,8,384,7,4,4,7,4,2,7,4,7, -7,6,13,7,4,3,7,7,18,7,4,5,7,7,21,7,6,17,9,7,256,7,4,6,7,6,1,7,5,8,9,6,192,9,5,64, -7,5,10,7,4,4,7,4,2,7,4,7,0,0,0,7,4,3,7,5,11,7,4,5,7,6,12,7,5,9,9,6,1664,7,4,6, -7,7,20,9,5,128,7,7,24,7,6,14,7,7,28,7,4,4,7,4,2,7,4,7,7,7,23,7,4,3,7,7,27,7,4,5, -7,8,39,7,6,16,9,8,576,7,4,6,7,7,19,7,5,8,7,8,55,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7, -7,8,45,7,4,3,7,5,11,7,4,5,7,8,53,7,5,9,9,8,448,7,4,6,7,8,35,9,5,128,7,8,51,7,6,15, -7,8,63,7,4,4,7,4,2,7,4,7,7,6,13,7,4,3,9,9,1536,7,4,5,7,8,43,7,6,17,9,9,1280,7,4,6, -7,6,1,7,5,8,9,6,192,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7,7,8,29,7,4,3,7,5,11,7,4,5, -7,6,12,7,5,9,9,6,1664,7,4,6,7,8,33,9,5,128,7,8,49,7,6,14,7,8,61,7,4,4,7,4,2,7,4,7, -7,8,47,7,4,3,7,8,59,7,4,5,7,8,41,7,6,16,9,9,1024,7,4,6,7,8,31,7,5,8,7,8,57,9,5,64, -7,5,10,7,4,4,7,4,2,7,4,7,7,7,22,7,4,3,7,5,11,7,4,5,7,7,26,7,5,9,9,9,768,7,4,6, -7,8,37,9,5,128,7,7,25,7,6,15,9,8,320,7,4,4,7,4,2,7,4,7,7,6,13,7,4,3,7,7,18,7,4,5, -7,7,21,7,6,17,9,7,256,7,4,6,7,6,1,7,5,8,9,6,192,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7, -11,11,1856,7,4,3,7,5,11,7,4,5,7,6,12,7,5,9,9,6,1664,7,4,6,7,7,20,9,5,128,7,7,24,7,6,14, -7,7,28,7,4,4,7,4,2,7,4,7,7,7,23,7,4,3,7,7,27,7,4,5,7,8,40,7,6,16,9,9,896,7,4,6, -7,7,19,7,5,8,7,8,56,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7,7,8,46,7,4,3,7,5,11,7,4,5, -7,8,54,7,5,9,9,8,512,7,4,6,7,8,36,9,5,128,7,8,52,7,6,15,7,8,0,7,4,4,7,4,2,7,4,7, -7,6,13,7,4,3,9,9,1728,7,4,5,7,8,44,7,6,17,9,9,1408,7,4,6,7,6,1,7,5,8,9,6,192,9,5,64, -7,5,10,7,4,4,7,4,2,7,4,7,7,8,30,7,4,3,7,5,11,7,4,5,7,6,12,7,5,9,9,6,1664,7,4,6, -7,8,34,9,5,128,7,8,50,7,6,14,7,8,62,7,4,4,7,4,2,7,4,7,7,8,48,7,4,3,7,8,60,7,4,5, -7,8,42,7,6,16,9,9,1152,7,4,6,7,8,32,7,5,8,7,8,58,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7, -7,7,22,7,4,3,7,5,11,7,4,5,7,7,26,7,5,9,9,8,640,7,4,6,7,8,38,9,5,128,7,7,25,7,6,15, -9,8,384,7,4,4,7,4,2,7,4,7,7,6,13,7,4,3,7,7,18,7,4,5,7,7,21,7,6,17,9,7,256,7,4,6, -7,6,1,7,5,8,9,6,192,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7,0,0,0,7,4,3,7,5,11,7,4,5, -7,6,12,7,5,9,9,6,1664,7,4,6,7,7,20,9,5,128,7,7,24,7,6,14,7,7,28,7,4,4,7,4,2,7,4,7, -7,7,23,7,4,3,7,7,27,7,4,5,7,8,39,7,6,16,9,8,576,7,4,6,7,7,19,7,5,8,7,8,55,9,5,64, -7,5,10,7,4,4,7,4,2,7,4,7,7,8,45,7,4,3,7,5,11,7,4,5,7,8,53,7,5,9,9,8,448,7,4,6, -7,8,35,9,5,128,7,8,51,7,6,15,7,8,63,7,4,4,7,4,2,7,4,7,7,6,13,7,4,3,9,9,1472,7,4,5, -7,8,43,7,6,17,9,9,1216,7,4,6,7,6,1,7,5,8,9,6,192,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7, -7,8,29,7,4,3,7,5,11,7,4,5,7,6,12,7,5,9,9,6,1664,7,4,6,7,8,33,9,5,128,7,8,49,7,6,14, -7,8,61,7,4,4,7,4,2,7,4,7,7,8,47,7,4,3,7,8,59,7,4,5,7,8,41,7,6,16,9,9,960,7,4,6, -7,8,31,7,5,8,7,8,57,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7,7,7,22,7,4,3,7,5,11,7,4,5, -7,7,26,7,5,9,9,9,704,7,4,6,7,8,37,9,5,128,7,7,25,7,6,15,9,8,320,7,4,4,7,4,2,7,4,7, -7,6,13,7,4,3,7,7,18,7,4,5,7,7,21,7,6,17,9,7,256,7,4,6,7,6,1,7,5,8,9,6,192,9,5,64, -7,5,10,7,4,4,7,4,2,7,4,7,11,12,2112,7,4,3,7,5,11,7,4,5,7,6,12,7,5,9,9,6,1664,7,4,6, -7,7,20,9,5,128,7,7,24,7,6,14,7,7,28,7,4,4,7,4,2,7,4,7,7,7,23,7,4,3,7,7,27,7,4,5, -7,8,40,7,6,16,9,9,832,7,4,6,7,7,19,7,5,8,7,8,56,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7, -7,8,46,7,4,3,7,5,11,7,4,5,7,8,54,7,5,9,9,8,512,7,4,6,7,8,36,9,5,128,7,8,52,7,6,15, -7,8,0,7,4,4,7,4,2,7,4,7,7,6,13,7,4,3,9,9,1600,7,4,5,7,8,44,7,6,17,9,9,1344,7,4,6, -7,6,1,7,5,8,9,6,192,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7,7,8,30,7,4,3,7,5,11,7,4,5, -7,6,12,7,5,9,9,6,1664,7,4,6,7,8,34,9,5,128,7,8,50,7,6,14,7,8,62,7,4,4,7,4,2,7,4,7, -7,8,48,7,4,3,7,8,60,7,4,5,7,8,42,7,6,16,9,9,1088,7,4,6,7,8,32,7,5,8,7,8,58,9,5,64, -7,5,10,7,4,4,7,4,2,7,4,7,7,7,22,7,4,3,7,5,11,7,4,5,7,7,26,7,5,9,9,8,640,7,4,6, -7,8,38,9,5,128,7,7,25,7,6,15,9,8,384,7,4,4,7,4,2,7,4,7,7,6,13,7,4,3,7,7,18,7,4,5, -7,7,21,7,6,17,9,7,256,7,4,6,7,6,1,7,5,8,9,6,192,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7, -0,0,0,7,4,3,7,5,11,7,4,5,7,6,12,7,5,9,9,6,1664,7,4,6,7,7,20,9,5,128,7,7,24,7,6,14, -7,7,28,7,4,4,7,4,2,7,4,7,7,7,23,7,4,3,7,7,27,7,4,5,7,8,39,7,6,16,9,8,576,7,4,6, -7,7,19,7,5,8,7,8,55,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7,7,8,45,7,4,3,7,5,11,7,4,5, -7,8,53,7,5,9,9,8,448,7,4,6,7,8,35,9,5,128,7,8,51,7,6,15,7,8,63,7,4,4,7,4,2,7,4,7, -7,6,13,7,4,3,9,9,1536,7,4,5,7,8,43,7,6,17,9,9,1280,7,4,6,7,6,1,7,5,8,9,6,192,9,5,64, -7,5,10,7,4,4,7,4,2,7,4,7,7,8,29,7,4,3,7,5,11,7,4,5,7,6,12,7,5,9,9,6,1664,7,4,6, -7,8,33,9,5,128,7,8,49,7,6,14,7,8,61,7,4,4,7,4,2,7,4,7,7,8,47,7,4,3,7,8,59,7,4,5, -7,8,41,7,6,16,9,9,1024,7,4,6,7,8,31,7,5,8,7,8,57,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7, -7,7,22,7,4,3,7,5,11,7,4,5,7,7,26,7,5,9,9,9,768,7,4,6,7,8,37,9,5,128,7,7,25,7,6,15, -9,8,320,7,4,4,7,4,2,7,4,7,7,6,13,7,4,3,7,7,18,7,4,5,7,7,21,7,6,17,9,7,256,7,4,6, -7,6,1,7,5,8,9,6,192,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7,11,12,2368,7,4,3,7,5,11,7,4,5, -7,6,12,7,5,9,9,6,1664,7,4,6,7,7,20,9,5,128,7,7,24,7,6,14,7,7,28,7,4,4,7,4,2,7,4,7, -7,7,23,7,4,3,7,7,27,7,4,5,7,8,40,7,6,16,9,9,896,7,4,6,7,7,19,7,5,8,7,8,56,9,5,64, -7,5,10,7,4,4,7,4,2,7,4,7,7,8,46,7,4,3,7,5,11,7,4,5,7,8,54,7,5,9,9,8,512,7,4,6, -7,8,36,9,5,128,7,8,52,7,6,15,7,8,0,7,4,4,7,4,2,7,4,7,7,6,13,7,4,3,9,9,1728,7,4,5, -7,8,44,7,6,17,9,9,1408,7,4,6,7,6,1,7,5,8,9,6,192,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7, -7,8,30,7,4,3,7,5,11,7,4,5,7,6,12,7,5,9,9,6,1664,7,4,6,7,8,34,9,5,128,7,8,50,7,6,14, -7,8,62,7,4,4,7,4,2,7,4,7,7,8,48,7,4,3,7,8,60,7,4,5,7,8,42,7,6,16,9,9,1152,7,4,6, -7,8,32,7,5,8,7,8,58,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7,7,7,22,7,4,3,7,5,11,7,4,5, -7,7,26,7,5,9,9,8,640,7,4,6,7,8,38,9,5,128,7,7,25,7,6,15,9,8,384,7,4,4,7,4,2,7,4,7, -7,6,13,7,4,3,7,7,18,7,4,5,7,7,21,7,6,17,9,7,256,7,4,6,7,6,1,7,5,8,9,6,192,9,5,64, -7,5,10,7,4,4,7,4,2,7,4,7,0,0,0,7,4,3,7,5,11,7,4,5,7,6,12,7,5,9,9,6,1664,7,4,6, -7,7,20,9,5,128,7,7,24,7,6,14,7,7,28,7,4,4,7,4,2,7,4,7,7,7,23,7,4,3,7,7,27,7,4,5, -7,8,39,7,6,16,9,8,576,7,4,6,7,7,19,7,5,8,7,8,55,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7, -7,8,45,7,4,3,7,5,11,7,4,5,7,8,53,7,5,9,9,8,448,7,4,6,7,8,35,9,5,128,7,8,51,7,6,15, -7,8,63,7,4,4,7,4,2,7,4,7,7,6,13,7,4,3,9,9,1472,7,4,5,7,8,43,7,6,17,9,9,1216,7,4,6, -7,6,1,7,5,8,9,6,192,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7,7,8,29,7,4,3,7,5,11,7,4,5, -7,6,12,7,5,9,9,6,1664,7,4,6,7,8,33,9,5,128,7,8,49,7,6,14,7,8,61,7,4,4,7,4,2,7,4,7, -7,8,47,7,4,3,7,8,59,7,4,5,7,8,41,7,6,16,9,9,960,7,4,6,7,8,31,7,5,8,7,8,57,9,5,64, -7,5,10,7,4,4,7,4,2,7,4,7,7,7,22,7,4,3,7,5,11,7,4,5,7,7,26,7,5,9,9,9,704,7,4,6, -7,8,37,9,5,128,7,7,25,7,6,15,9,8,320,7,4,4,7,4,2,7,4,7,7,6,13,7,4,3,7,7,18,7,4,5, -7,7,21,7,6,17,9,7,256,7,4,6,7,6,1,7,5,8,9,6,192,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7, -11,12,1984,7,4,3,7,5,11,7,4,5,7,6,12,7,5,9,9,6,1664,7,4,6,7,7,20,9,5,128,7,7,24,7,6,14, -7,7,28,7,4,4,7,4,2,7,4,7,7,7,23,7,4,3,7,7,27,7,4,5,7,8,40,7,6,16,9,9,832,7,4,6, -7,7,19,7,5,8,7,8,56,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7,7,8,46,7,4,3,7,5,11,7,4,5, -7,8,54,7,5,9,9,8,512,7,4,6,7,8,36,9,5,128,7,8,52,7,6,15,7,8,0,7,4,4,7,4,2,7,4,7, -7,6,13,7,4,3,9,9,1600,7,4,5,7,8,44,7,6,17,9,9,1344,7,4,6,7,6,1,7,5,8,9,6,192,9,5,64, -7,5,10,7,4,4,7,4,2,7,4,7,7,8,30,7,4,3,7,5,11,7,4,5,7,6,12,7,5,9,9,6,1664,7,4,6, -7,8,34,9,5,128,7,8,50,7,6,14,7,8,62,7,4,4,7,4,2,7,4,7,7,8,48,7,4,3,7,8,60,7,4,5, -7,8,42,7,6,16,9,9,1088,7,4,6,7,8,32,7,5,8,7,8,58,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7, -7,7,22,7,4,3,7,5,11,7,4,5,7,7,26,7,5,9,9,8,640,7,4,6,7,8,38,9,5,128,7,7,25,7,6,15, -9,8,384,7,4,4,7,4,2,7,4,7,7,6,13,7,4,3,7,7,18,7,4,5,7,7,21,7,6,17,9,7,256,7,4,6, -7,6,1,7,5,8,9,6,192,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7,0,0,0,7,4,3,7,5,11,7,4,5, -7,6,12,7,5,9,9,6,1664,7,4,6,7,7,20,9,5,128,7,7,24,7,6,14,7,7,28,7,4,4,7,4,2,7,4,7, -7,7,23,7,4,3,7,7,27,7,4,5,7,8,39,7,6,16,9,8,576,7,4,6,7,7,19,7,5,8,7,8,55,9,5,64, -7,5,10,7,4,4,7,4,2,7,4,7,7,8,45,7,4,3,7,5,11,7,4,5,7,8,53,7,5,9,9,8,448,7,4,6, -7,8,35,9,5,128,7,8,51,7,6,15,7,8,63,7,4,4,7,4,2,7,4,7,7,6,13,7,4,3,9,9,1536,7,4,5, -7,8,43,7,6,17,9,9,1280,7,4,6,7,6,1,7,5,8,9,6,192,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7, -7,8,29,7,4,3,7,5,11,7,4,5,7,6,12,7,5,9,9,6,1664,7,4,6,7,8,33,9,5,128,7,8,49,7,6,14, -7,8,61,7,4,4,7,4,2,7,4,7,7,8,47,7,4,3,7,8,59,7,4,5,7,8,41,7,6,16,9,9,1024,7,4,6, -7,8,31,7,5,8,7,8,57,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7,7,7,22,7,4,3,7,5,11,7,4,5, -7,7,26,7,5,9,9,9,768,7,4,6,7,8,37,9,5,128,7,7,25,7,6,15,9,8,320,7,4,4,7,4,2,7,4,7, -7,6,13,7,4,3,7,7,18,7,4,5,7,7,21,7,6,17,9,7,256,7,4,6,7,6,1,7,5,8,9,6,192,9,5,64, -7,5,10,7,4,4,7,4,2,7,4,7,11,11,1920,7,4,3,7,5,11,7,4,5,7,6,12,7,5,9,9,6,1664,7,4,6, -7,7,20,9,5,128,7,7,24,7,6,14,7,7,28,7,4,4,7,4,2,7,4,7,7,7,23,7,4,3,7,7,27,7,4,5, -7,8,40,7,6,16,9,9,896,7,4,6,7,7,19,7,5,8,7,8,56,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7, -7,8,46,7,4,3,7,5,11,7,4,5,7,8,54,7,5,9,9,8,512,7,4,6,7,8,36,9,5,128,7,8,52,7,6,15, -7,8,0,7,4,4,7,4,2,7,4,7,7,6,13,7,4,3,9,9,1728,7,4,5,7,8,44,7,6,17,9,9,1408,7,4,6, -7,6,1,7,5,8,9,6,192,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7,7,8,30,7,4,3,7,5,11,7,4,5, -7,6,12,7,5,9,9,6,1664,7,4,6,7,8,34,9,5,128,7,8,50,7,6,14,7,8,62,7,4,4,7,4,2,7,4,7, -7,8,48,7,4,3,7,8,60,7,4,5,7,8,42,7,6,16,9,9,1152,7,4,6,7,8,32,7,5,8,7,8,58,9,5,64, -7,5,10,7,4,4,7,4,2,7,4,7,7,7,22,7,4,3,7,5,11,7,4,5,7,7,26,7,5,9,9,8,640,7,4,6, -7,8,38,9,5,128,7,7,25,7,6,15,9,8,384,7,4,4,7,4,2,7,4,7,7,6,13,7,4,3,7,7,18,7,4,5, -7,7,21,7,6,17,9,7,256,7,4,6,7,6,1,7,5,8,9,6,192,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7, -0,0,0,7,4,3,7,5,11,7,4,5,7,6,12,7,5,9,9,6,1664,7,4,6,7,7,20,9,5,128,7,7,24,7,6,14, -7,7,28,7,4,4,7,4,2,7,4,7,7,7,23,7,4,3,7,7,27,7,4,5,7,8,39,7,6,16,9,8,576,7,4,6, -7,7,19,7,5,8,7,8,55,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7,7,8,45,7,4,3,7,5,11,7,4,5, -7,8,53,7,5,9,9,8,448,7,4,6,7,8,35,9,5,128,7,8,51,7,6,15,7,8,63,7,4,4,7,4,2,7,4,7, -7,6,13,7,4,3,9,9,1472,7,4,5,7,8,43,7,6,17,9,9,1216,7,4,6,7,6,1,7,5,8,9,6,192,9,5,64, -7,5,10,7,4,4,7,4,2,7,4,7,7,8,29,7,4,3,7,5,11,7,4,5,7,6,12,7,5,9,9,6,1664,7,4,6, -7,8,33,9,5,128,7,8,49,7,6,14,7,8,61,7,4,4,7,4,2,7,4,7,7,8,47,7,4,3,7,8,59,7,4,5, -7,8,41,7,6,16,9,9,960,7,4,6,7,8,31,7,5,8,7,8,57,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7, -7,7,22,7,4,3,7,5,11,7,4,5,7,7,26,7,5,9,9,9,704,7,4,6,7,8,37,9,5,128,7,7,25,7,6,15, -9,8,320,7,4,4,7,4,2,7,4,7,7,6,13,7,4,3,7,7,18,7,4,5,7,7,21,7,6,17,9,7,256,7,4,6, -7,6,1,7,5,8,9,6,192,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7,11,12,2240,7,4,3,7,5,11,7,4,5, -7,6,12,7,5,9,9,6,1664,7,4,6,7,7,20,9,5,128,7,7,24,7,6,14,7,7,28,7,4,4,7,4,2,7,4,7, -7,7,23,7,4,3,7,7,27,7,4,5,7,8,40,7,6,16,9,9,832,7,4,6,7,7,19,7,5,8,7,8,56,9,5,64, -7,5,10,7,4,4,7,4,2,7,4,7,7,8,46,7,4,3,7,5,11,7,4,5,7,8,54,7,5,9,9,8,512,7,4,6, -7,8,36,9,5,128,7,8,52,7,6,15,7,8,0,7,4,4,7,4,2,7,4,7,7,6,13,7,4,3,9,9,1600,7,4,5, -7,8,44,7,6,17,9,9,1344,7,4,6,7,6,1,7,5,8,9,6,192,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7, -7,8,30,7,4,3,7,5,11,7,4,5,7,6,12,7,5,9,9,6,1664,7,4,6,7,8,34,9,5,128,7,8,50,7,6,14, -7,8,62,7,4,4,7,4,2,7,4,7,7,8,48,7,4,3,7,8,60,7,4,5,7,8,42,7,6,16,9,9,1088,7,4,6, -7,8,32,7,5,8,7,8,58,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7,7,7,22,7,4,3,7,5,11,7,4,5, -7,7,26,7,5,9,9,8,640,7,4,6,7,8,38,9,5,128,7,7,25,7,6,15,9,8,384,7,4,4,7,4,2,7,4,7, -7,6,13,7,4,3,7,7,18,7,4,5,7,7,21,7,6,17,9,7,256,7,4,6,7,6,1,7,5,8,9,6,192,9,5,64, -7,5,10,7,4,4,7,4,2,7,4,7,0,0,0,7,4,3,7,5,11,7,4,5,7,6,12,7,5,9,9,6,1664,7,4,6, -7,7,20,9,5,128,7,7,24,7,6,14,7,7,28,7,4,4,7,4,2,7,4,7,7,7,23,7,4,3,7,7,27,7,4,5, -7,8,39,7,6,16,9,8,576,7,4,6,7,7,19,7,5,8,7,8,55,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7, -7,8,45,7,4,3,7,5,11,7,4,5,7,8,53,7,5,9,9,8,448,7,4,6,7,8,35,9,5,128,7,8,51,7,6,15, -7,8,63,7,4,4,7,4,2,7,4,7,7,6,13,7,4,3,9,9,1536,7,4,5,7,8,43,7,6,17,9,9,1280,7,4,6, -7,6,1,7,5,8,9,6,192,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7,7,8,29,7,4,3,7,5,11,7,4,5, -7,6,12,7,5,9,9,6,1664,7,4,6,7,8,33,9,5,128,7,8,49,7,6,14,7,8,61,7,4,4,7,4,2,7,4,7, -7,8,47,7,4,3,7,8,59,7,4,5,7,8,41,7,6,16,9,9,1024,7,4,6,7,8,31,7,5,8,7,8,57,9,5,64, -7,5,10,7,4,4,7,4,2,7,4,7,7,7,22,7,4,3,7,5,11,7,4,5,7,7,26,7,5,9,9,9,768,7,4,6, -7,8,37,9,5,128,7,7,25,7,6,15,9,8,320,7,4,4,7,4,2,7,4,7,7,6,13,7,4,3,7,7,18,7,4,5, -7,7,21,7,6,17,9,7,256,7,4,6,7,6,1,7,5,8,9,6,192,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7, -11,12,2496,7,4,3,7,5,11,7,4,5,7,6,12,7,5,9,9,6,1664,7,4,6,7,7,20,9,5,128,7,7,24,7,6,14, -7,7,28,7,4,4,7,4,2,7,4,7,7,7,23,7,4,3,7,7,27,7,4,5,7,8,40,7,6,16,9,9,896,7,4,6, -7,7,19,7,5,8,7,8,56,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7,7,8,46,7,4,3,7,5,11,7,4,5, -7,8,54,7,5,9,9,8,512,7,4,6,7,8,36,9,5,128,7,8,52,7,6,15,7,8,0,7,4,4,7,4,2,7,4,7, -7,6,13,7,4,3,9,9,1728,7,4,5,7,8,44,7,6,17,9,9,1408,7,4,6,7,6,1,7,5,8,9,6,192,9,5,64, -7,5,10,7,4,4,7,4,2,7,4,7,7,8,30,7,4,3,7,5,11,7,4,5,7,6,12,7,5,9,9,6,1664,7,4,6, -7,8,34,9,5,128,7,8,50,7,6,14,7,8,62,7,4,4,7,4,2,7,4,7,7,8,48,7,4,3,7,8,60,7,4,5, -7,8,42,7,6,16,9,9,1152,7,4,6,7,8,32,7,5,8,7,8,58,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7, -7,7,22,7,4,3,7,5,11,7,4,5,7,7,26,7,5,9,9,8,640,7,4,6,7,8,38,9,5,128,7,7,25,7,6,15, -9,8,384,7,4,4,7,4,2,7,4,7,7,6,13,7,4,3,7,7,18,7,4,5,7,7,21,7,6,17,9,7,256,7,4,6, -7,6,1,7,5,8,9,6,192,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7,12,11,0,7,4,3,7,5,11,7,4,5, -7,6,12,7,5,9,9,6,1664,7,4,6,7,7,20,9,5,128,7,7,24,7,6,14,7,7,28,7,4,4,7,4,2,7,4,7, -7,7,23,7,4,3,7,7,27,7,4,5,7,8,39,7,6,16,9,8,576,7,4,6,7,7,19,7,5,8,7,8,55,9,5,64, -7,5,10,7,4,4,7,4,2,7,4,7,7,8,45,7,4,3,7,5,11,7,4,5,7,8,53,7,5,9,9,8,448,7,4,6, -7,8,35,9,5,128,7,8,51,7,6,15,7,8,63,7,4,4,7,4,2,7,4,7,7,6,13,7,4,3,9,9,1472,7,4,5, -7,8,43,7,6,17,9,9,1216,7,4,6,7,6,1,7,5,8,9,6,192,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7, -7,8,29,7,4,3,7,5,11,7,4,5,7,6,12,7,5,9,9,6,1664,7,4,6,7,8,33,9,5,128,7,8,49,7,6,14, -7,8,61,7,4,4,7,4,2,7,4,7,7,8,47,7,4,3,7,8,59,7,4,5,7,8,41,7,6,16,9,9,960,7,4,6, -7,8,31,7,5,8,7,8,57,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7,7,7,22,7,4,3,7,5,11,7,4,5, -7,7,26,7,5,9,9,9,704,7,4,6,7,8,37,9,5,128,7,7,25,7,6,15,9,8,320,7,4,4,7,4,2,7,4,7, -7,6,13,7,4,3,7,7,18,7,4,5,7,7,21,7,6,17,9,7,256,7,4,6,7,6,1,7,5,8,9,6,192,9,5,64, -7,5,10,7,4,4,7,4,2,7,4,7,11,11,1792,7,4,3,7,5,11,7,4,5,7,6,12,7,5,9,9,6,1664,7,4,6, -7,7,20,9,5,128,7,7,24,7,6,14,7,7,28,7,4,4,7,4,2,7,4,7,7,7,23,7,4,3,7,7,27,7,4,5, -7,8,40,7,6,16,9,9,832,7,4,6,7,7,19,7,5,8,7,8,56,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7, -7,8,46,7,4,3,7,5,11,7,4,5,7,8,54,7,5,9,9,8,512,7,4,6,7,8,36,9,5,128,7,8,52,7,6,15, -7,8,0,7,4,4,7,4,2,7,4,7,7,6,13,7,4,3,9,9,1600,7,4,5,7,8,44,7,6,17,9,9,1344,7,4,6, -7,6,1,7,5,8,9,6,192,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7,7,8,30,7,4,3,7,5,11,7,4,5, -7,6,12,7,5,9,9,6,1664,7,4,6,7,8,34,9,5,128,7,8,50,7,6,14,7,8,62,7,4,4,7,4,2,7,4,7, -7,8,48,7,4,3,7,8,60,7,4,5,7,8,42,7,6,16,9,9,1088,7,4,6,7,8,32,7,5,8,7,8,58,9,5,64, -7,5,10,7,4,4,7,4,2,7,4,7,7,7,22,7,4,3,7,5,11,7,4,5,7,7,26,7,5,9,9,8,640,7,4,6, -7,8,38,9,5,128,7,7,25,7,6,15,9,8,384,7,4,4,7,4,2,7,4,7,7,6,13,7,4,3,7,7,18,7,4,5, -7,7,21,7,6,17,9,7,256,7,4,6,7,6,1,7,5,8,9,6,192,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7, -0,0,0,7,4,3,7,5,11,7,4,5,7,6,12,7,5,9,9,6,1664,7,4,6,7,7,20,9,5,128,7,7,24,7,6,14, -7,7,28,7,4,4,7,4,2,7,4,7,7,7,23,7,4,3,7,7,27,7,4,5,7,8,39,7,6,16,9,8,576,7,4,6, -7,7,19,7,5,8,7,8,55,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7,7,8,45,7,4,3,7,5,11,7,4,5, -7,8,53,7,5,9,9,8,448,7,4,6,7,8,35,9,5,128,7,8,51,7,6,15,7,8,63,7,4,4,7,4,2,7,4,7, -7,6,13,7,4,3,9,9,1536,7,4,5,7,8,43,7,6,17,9,9,1280,7,4,6,7,6,1,7,5,8,9,6,192,9,5,64, -7,5,10,7,4,4,7,4,2,7,4,7,7,8,29,7,4,3,7,5,11,7,4,5,7,6,12,7,5,9,9,6,1664,7,4,6, -7,8,33,9,5,128,7,8,49,7,6,14,7,8,61,7,4,4,7,4,2,7,4,7,7,8,47,7,4,3,7,8,59,7,4,5, -7,8,41,7,6,16,9,9,1024,7,4,6,7,8,31,7,5,8,7,8,57,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7, -7,7,22,7,4,3,7,5,11,7,4,5,7,7,26,7,5,9,9,9,768,7,4,6,7,8,37,9,5,128,7,7,25,7,6,15, -9,8,320,7,4,4,7,4,2,7,4,7,7,6,13,7,4,3,7,7,18,7,4,5,7,7,21,7,6,17,9,7,256,7,4,6, -7,6,1,7,5,8,9,6,192,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7,11,11,1856,7,4,3,7,5,11,7,4,5, -7,6,12,7,5,9,9,6,1664,7,4,6,7,7,20,9,5,128,7,7,24,7,6,14,7,7,28,7,4,4,7,4,2,7,4,7, -7,7,23,7,4,3,7,7,27,7,4,5,7,8,40,7,6,16,9,9,896,7,4,6,7,7,19,7,5,8,7,8,56,9,5,64, -7,5,10,7,4,4,7,4,2,7,4,7,7,8,46,7,4,3,7,5,11,7,4,5,7,8,54,7,5,9,9,8,512,7,4,6, -7,8,36,9,5,128,7,8,52,7,6,15,7,8,0,7,4,4,7,4,2,7,4,7,7,6,13,7,4,3,9,9,1728,7,4,5, -7,8,44,7,6,17,9,9,1408,7,4,6,7,6,1,7,5,8,9,6,192,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7, -7,8,30,7,4,3,7,5,11,7,4,5,7,6,12,7,5,9,9,6,1664,7,4,6,7,8,34,9,5,128,7,8,50,7,6,14, -7,8,62,7,4,4,7,4,2,7,4,7,7,8,48,7,4,3,7,8,60,7,4,5,7,8,42,7,6,16,9,9,1152,7,4,6, -7,8,32,7,5,8,7,8,58,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7,7,7,22,7,4,3,7,5,11,7,4,5, -7,7,26,7,5,9,9,8,640,7,4,6,7,8,38,9,5,128,7,7,25,7,6,15,9,8,384,7,4,4,7,4,2,7,4,7, -7,6,13,7,4,3,7,7,18,7,4,5,7,7,21,7,6,17,9,7,256,7,4,6,7,6,1,7,5,8,9,6,192,9,5,64, -7,5,10,7,4,4,7,4,2,7,4,7,0,0,0,7,4,3,7,5,11,7,4,5,7,6,12,7,5,9,9,6,1664,7,4,6, -7,7,20,9,5,128,7,7,24,7,6,14,7,7,28,7,4,4,7,4,2,7,4,7,7,7,23,7,4,3,7,7,27,7,4,5, -7,8,39,7,6,16,9,8,576,7,4,6,7,7,19,7,5,8,7,8,55,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7, -7,8,45,7,4,3,7,5,11,7,4,5,7,8,53,7,5,9,9,8,448,7,4,6,7,8,35,9,5,128,7,8,51,7,6,15, -7,8,63,7,4,4,7,4,2,7,4,7,7,6,13,7,4,3,9,9,1472,7,4,5,7,8,43,7,6,17,9,9,1216,7,4,6, -7,6,1,7,5,8,9,6,192,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7,7,8,29,7,4,3,7,5,11,7,4,5, -7,6,12,7,5,9,9,6,1664,7,4,6,7,8,33,9,5,128,7,8,49,7,6,14,7,8,61,7,4,4,7,4,2,7,4,7, -7,8,47,7,4,3,7,8,59,7,4,5,7,8,41,7,6,16,9,9,960,7,4,6,7,8,31,7,5,8,7,8,57,9,5,64, -7,5,10,7,4,4,7,4,2,7,4,7,7,7,22,7,4,3,7,5,11,7,4,5,7,7,26,7,5,9,9,9,704,7,4,6, -7,8,37,9,5,128,7,7,25,7,6,15,9,8,320,7,4,4,7,4,2,7,4,7,7,6,13,7,4,3,7,7,18,7,4,5, -7,7,21,7,6,17,9,7,256,7,4,6,7,6,1,7,5,8,9,6,192,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7, -11,12,2176,7,4,3,7,5,11,7,4,5,7,6,12,7,5,9,9,6,1664,7,4,6,7,7,20,9,5,128,7,7,24,7,6,14, -7,7,28,7,4,4,7,4,2,7,4,7,7,7,23,7,4,3,7,7,27,7,4,5,7,8,40,7,6,16,9,9,832,7,4,6, -7,7,19,7,5,8,7,8,56,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7,7,8,46,7,4,3,7,5,11,7,4,5, -7,8,54,7,5,9,9,8,512,7,4,6,7,8,36,9,5,128,7,8,52,7,6,15,7,8,0,7,4,4,7,4,2,7,4,7, -7,6,13,7,4,3,9,9,1600,7,4,5,7,8,44,7,6,17,9,9,1344,7,4,6,7,6,1,7,5,8,9,6,192,9,5,64, -7,5,10,7,4,4,7,4,2,7,4,7,7,8,30,7,4,3,7,5,11,7,4,5,7,6,12,7,5,9,9,6,1664,7,4,6, -7,8,34,9,5,128,7,8,50,7,6,14,7,8,62,7,4,4,7,4,2,7,4,7,7,8,48,7,4,3,7,8,60,7,4,5, -7,8,42,7,6,16,9,9,1088,7,4,6,7,8,32,7,5,8,7,8,58,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7, -7,7,22,7,4,3,7,5,11,7,4,5,7,7,26,7,5,9,9,8,640,7,4,6,7,8,38,9,5,128,7,7,25,7,6,15, -9,8,384,7,4,4,7,4,2,7,4,7,7,6,13,7,4,3,7,7,18,7,4,5,7,7,21,7,6,17,9,7,256,7,4,6, -7,6,1,7,5,8,9,6,192,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7,0,0,0,7,4,3,7,5,11,7,4,5, -7,6,12,7,5,9,9,6,1664,7,4,6,7,7,20,9,5,128,7,7,24,7,6,14,7,7,28,7,4,4,7,4,2,7,4,7, -7,7,23,7,4,3,7,7,27,7,4,5,7,8,39,7,6,16,9,8,576,7,4,6,7,7,19,7,5,8,7,8,55,9,5,64, -7,5,10,7,4,4,7,4,2,7,4,7,7,8,45,7,4,3,7,5,11,7,4,5,7,8,53,7,5,9,9,8,448,7,4,6, -7,8,35,9,5,128,7,8,51,7,6,15,7,8,63,7,4,4,7,4,2,7,4,7,7,6,13,7,4,3,9,9,1536,7,4,5, -7,8,43,7,6,17,9,9,1280,7,4,6,7,6,1,7,5,8,9,6,192,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7, -7,8,29,7,4,3,7,5,11,7,4,5,7,6,12,7,5,9,9,6,1664,7,4,6,7,8,33,9,5,128,7,8,49,7,6,14, -7,8,61,7,4,4,7,4,2,7,4,7,7,8,47,7,4,3,7,8,59,7,4,5,7,8,41,7,6,16,9,9,1024,7,4,6, -7,8,31,7,5,8,7,8,57,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7,7,7,22,7,4,3,7,5,11,7,4,5, -7,7,26,7,5,9,9,9,768,7,4,6,7,8,37,9,5,128,7,7,25,7,6,15,9,8,320,7,4,4,7,4,2,7,4,7, -7,6,13,7,4,3,7,7,18,7,4,5,7,7,21,7,6,17,9,7,256,7,4,6,7,6,1,7,5,8,9,6,192,9,5,64, -7,5,10,7,4,4,7,4,2,7,4,7,11,12,2432,7,4,3,7,5,11,7,4,5,7,6,12,7,5,9,9,6,1664,7,4,6, -7,7,20,9,5,128,7,7,24,7,6,14,7,7,28,7,4,4,7,4,2,7,4,7,7,7,23,7,4,3,7,7,27,7,4,5, -7,8,40,7,6,16,9,9,896,7,4,6,7,7,19,7,5,8,7,8,56,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7, -7,8,46,7,4,3,7,5,11,7,4,5,7,8,54,7,5,9,9,8,512,7,4,6,7,8,36,9,5,128,7,8,52,7,6,15, -7,8,0,7,4,4,7,4,2,7,4,7,7,6,13,7,4,3,9,9,1728,7,4,5,7,8,44,7,6,17,9,9,1408,7,4,6, -7,6,1,7,5,8,9,6,192,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7,7,8,30,7,4,3,7,5,11,7,4,5, -7,6,12,7,5,9,9,6,1664,7,4,6,7,8,34,9,5,128,7,8,50,7,6,14,7,8,62,7,4,4,7,4,2,7,4,7, -7,8,48,7,4,3,7,8,60,7,4,5,7,8,42,7,6,16,9,9,1152,7,4,6,7,8,32,7,5,8,7,8,58,9,5,64, -7,5,10,7,4,4,7,4,2,7,4,7,7,7,22,7,4,3,7,5,11,7,4,5,7,7,26,7,5,9,9,8,640,7,4,6, -7,8,38,9,5,128,7,7,25,7,6,15,9,8,384,7,4,4,7,4,2,7,4,7,7,6,13,7,4,3,7,7,18,7,4,5, -7,7,21,7,6,17,9,7,256,7,4,6,7,6,1,7,5,8,9,6,192,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7, -0,0,0,7,4,3,7,5,11,7,4,5,7,6,12,7,5,9,9,6,1664,7,4,6,7,7,20,9,5,128,7,7,24,7,6,14, -7,7,28,7,4,4,7,4,2,7,4,7,7,7,23,7,4,3,7,7,27,7,4,5,7,8,39,7,6,16,9,8,576,7,4,6, -7,7,19,7,5,8,7,8,55,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7,7,8,45,7,4,3,7,5,11,7,4,5, -7,8,53,7,5,9,9,8,448,7,4,6,7,8,35,9,5,128,7,8,51,7,6,15,7,8,63,7,4,4,7,4,2,7,4,7, -7,6,13,7,4,3,9,9,1472,7,4,5,7,8,43,7,6,17,9,9,1216,7,4,6,7,6,1,7,5,8,9,6,192,9,5,64, -7,5,10,7,4,4,7,4,2,7,4,7,7,8,29,7,4,3,7,5,11,7,4,5,7,6,12,7,5,9,9,6,1664,7,4,6, -7,8,33,9,5,128,7,8,49,7,6,14,7,8,61,7,4,4,7,4,2,7,4,7,7,8,47,7,4,3,7,8,59,7,4,5, -7,8,41,7,6,16,9,9,960,7,4,6,7,8,31,7,5,8,7,8,57,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7, -7,7,22,7,4,3,7,5,11,7,4,5,7,7,26,7,5,9,9,9,704,7,4,6,7,8,37,9,5,128,7,7,25,7,6,15, -9,8,320,7,4,4,7,4,2,7,4,7,7,6,13,7,4,3,7,7,18,7,4,5,7,7,21,7,6,17,9,7,256,7,4,6, -7,6,1,7,5,8,9,6,192,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7,11,12,2048,7,4,3,7,5,11,7,4,5, -7,6,12,7,5,9,9,6,1664,7,4,6,7,7,20,9,5,128,7,7,24,7,6,14,7,7,28,7,4,4,7,4,2,7,4,7, -7,7,23,7,4,3,7,7,27,7,4,5,7,8,40,7,6,16,9,9,832,7,4,6,7,7,19,7,5,8,7,8,56,9,5,64, -7,5,10,7,4,4,7,4,2,7,4,7,7,8,46,7,4,3,7,5,11,7,4,5,7,8,54,7,5,9,9,8,512,7,4,6, -7,8,36,9,5,128,7,8,52,7,6,15,7,8,0,7,4,4,7,4,2,7,4,7,7,6,13,7,4,3,9,9,1600,7,4,5, -7,8,44,7,6,17,9,9,1344,7,4,6,7,6,1,7,5,8,9,6,192,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7, -7,8,30,7,4,3,7,5,11,7,4,5,7,6,12,7,5,9,9,6,1664,7,4,6,7,8,34,9,5,128,7,8,50,7,6,14, -7,8,62,7,4,4,7,4,2,7,4,7,7,8,48,7,4,3,7,8,60,7,4,5,7,8,42,7,6,16,9,9,1088,7,4,6, -7,8,32,7,5,8,7,8,58,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7,7,7,22,7,4,3,7,5,11,7,4,5, -7,7,26,7,5,9,9,8,640,7,4,6,7,8,38,9,5,128,7,7,25,7,6,15,9,8,384,7,4,4,7,4,2,7,4,7, -7,6,13,7,4,3,7,7,18,7,4,5,7,7,21,7,6,17,9,7,256,7,4,6,7,6,1,7,5,8,9,6,192,9,5,64, -7,5,10,7,4,4,7,4,2,7,4,7,0,0,0,7,4,3,7,5,11,7,4,5,7,6,12,7,5,9,9,6,1664,7,4,6, -7,7,20,9,5,128,7,7,24,7,6,14,7,7,28,7,4,4,7,4,2,7,4,7,7,7,23,7,4,3,7,7,27,7,4,5, -7,8,39,7,6,16,9,8,576,7,4,6,7,7,19,7,5,8,7,8,55,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7, -7,8,45,7,4,3,7,5,11,7,4,5,7,8,53,7,5,9,9,8,448,7,4,6,7,8,35,9,5,128,7,8,51,7,6,15, -7,8,63,7,4,4,7,4,2,7,4,7,7,6,13,7,4,3,9,9,1536,7,4,5,7,8,43,7,6,17,9,9,1280,7,4,6, -7,6,1,7,5,8,9,6,192,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7,7,8,29,7,4,3,7,5,11,7,4,5, -7,6,12,7,5,9,9,6,1664,7,4,6,7,8,33,9,5,128,7,8,49,7,6,14,7,8,61,7,4,4,7,4,2,7,4,7, -7,8,47,7,4,3,7,8,59,7,4,5,7,8,41,7,6,16,9,9,1024,7,4,6,7,8,31,7,5,8,7,8,57,9,5,64, -7,5,10,7,4,4,7,4,2,7,4,7,7,7,22,7,4,3,7,5,11,7,4,5,7,7,26,7,5,9,9,9,768,7,4,6, -7,8,37,9,5,128,7,7,25,7,6,15,9,8,320,7,4,4,7,4,2,7,4,7,7,6,13,7,4,3,7,7,18,7,4,5, -7,7,21,7,6,17,9,7,256,7,4,6,7,6,1,7,5,8,9,6,192,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7, -11,11,1920,7,4,3,7,5,11,7,4,5,7,6,12,7,5,9,9,6,1664,7,4,6,7,7,20,9,5,128,7,7,24,7,6,14, -7,7,28,7,4,4,7,4,2,7,4,7,7,7,23,7,4,3,7,7,27,7,4,5,7,8,40,7,6,16,9,9,896,7,4,6, -7,7,19,7,5,8,7,8,56,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7,7,8,46,7,4,3,7,5,11,7,4,5, -7,8,54,7,5,9,9,8,512,7,4,6,7,8,36,9,5,128,7,8,52,7,6,15,7,8,0,7,4,4,7,4,2,7,4,7, -7,6,13,7,4,3,9,9,1728,7,4,5,7,8,44,7,6,17,9,9,1408,7,4,6,7,6,1,7,5,8,9,6,192,9,5,64, -7,5,10,7,4,4,7,4,2,7,4,7,7,8,30,7,4,3,7,5,11,7,4,5,7,6,12,7,5,9,9,6,1664,7,4,6, -7,8,34,9,5,128,7,8,50,7,6,14,7,8,62,7,4,4,7,4,2,7,4,7,7,8,48,7,4,3,7,8,60,7,4,5, -7,8,42,7,6,16,9,9,1152,7,4,6,7,8,32,7,5,8,7,8,58,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7, -7,7,22,7,4,3,7,5,11,7,4,5,7,7,26,7,5,9,9,8,640,7,4,6,7,8,38,9,5,128,7,7,25,7,6,15, -9,8,384,7,4,4,7,4,2,7,4,7,7,6,13,7,4,3,7,7,18,7,4,5,7,7,21,7,6,17,9,7,256,7,4,6, -7,6,1,7,5,8,9,6,192,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7,0,0,0,7,4,3,7,5,11,7,4,5, -7,6,12,7,5,9,9,6,1664,7,4,6,7,7,20,9,5,128,7,7,24,7,6,14,7,7,28,7,4,4,7,4,2,7,4,7, -7,7,23,7,4,3,7,7,27,7,4,5,7,8,39,7,6,16,9,8,576,7,4,6,7,7,19,7,5,8,7,8,55,9,5,64, -7,5,10,7,4,4,7,4,2,7,4,7,7,8,45,7,4,3,7,5,11,7,4,5,7,8,53,7,5,9,9,8,448,7,4,6, -7,8,35,9,5,128,7,8,51,7,6,15,7,8,63,7,4,4,7,4,2,7,4,7,7,6,13,7,4,3,9,9,1472,7,4,5, -7,8,43,7,6,17,9,9,1216,7,4,6,7,6,1,7,5,8,9,6,192,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7, -7,8,29,7,4,3,7,5,11,7,4,5,7,6,12,7,5,9,9,6,1664,7,4,6,7,8,33,9,5,128,7,8,49,7,6,14, -7,8,61,7,4,4,7,4,2,7,4,7,7,8,47,7,4,3,7,8,59,7,4,5,7,8,41,7,6,16,9,9,960,7,4,6, -7,8,31,7,5,8,7,8,57,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7,7,7,22,7,4,3,7,5,11,7,4,5, -7,7,26,7,5,9,9,9,704,7,4,6,7,8,37,9,5,128,7,7,25,7,6,15,9,8,320,7,4,4,7,4,2,7,4,7, -7,6,13,7,4,3,7,7,18,7,4,5,7,7,21,7,6,17,9,7,256,7,4,6,7,6,1,7,5,8,9,6,192,9,5,64, -7,5,10,7,4,4,7,4,2,7,4,7,11,12,2304,7,4,3,7,5,11,7,4,5,7,6,12,7,5,9,9,6,1664,7,4,6, -7,7,20,9,5,128,7,7,24,7,6,14,7,7,28,7,4,4,7,4,2,7,4,7,7,7,23,7,4,3,7,7,27,7,4,5, -7,8,40,7,6,16,9,9,832,7,4,6,7,7,19,7,5,8,7,8,56,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7, -7,8,46,7,4,3,7,5,11,7,4,5,7,8,54,7,5,9,9,8,512,7,4,6,7,8,36,9,5,128,7,8,52,7,6,15, -7,8,0,7,4,4,7,4,2,7,4,7,7,6,13,7,4,3,9,9,1600,7,4,5,7,8,44,7,6,17,9,9,1344,7,4,6, -7,6,1,7,5,8,9,6,192,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7,7,8,30,7,4,3,7,5,11,7,4,5, -7,6,12,7,5,9,9,6,1664,7,4,6,7,8,34,9,5,128,7,8,50,7,6,14,7,8,62,7,4,4,7,4,2,7,4,7, -7,8,48,7,4,3,7,8,60,7,4,5,7,8,42,7,6,16,9,9,1088,7,4,6,7,8,32,7,5,8,7,8,58,9,5,64, -7,5,10,7,4,4,7,4,2,7,4,7,7,7,22,7,4,3,7,5,11,7,4,5,7,7,26,7,5,9,9,8,640,7,4,6, -7,8,38,9,5,128,7,7,25,7,6,15,9,8,384,7,4,4,7,4,2,7,4,7,7,6,13,7,4,3,7,7,18,7,4,5, -7,7,21,7,6,17,9,7,256,7,4,6,7,6,1,7,5,8,9,6,192,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7, -0,0,0,7,4,3,7,5,11,7,4,5,7,6,12,7,5,9,9,6,1664,7,4,6,7,7,20,9,5,128,7,7,24,7,6,14, -7,7,28,7,4,4,7,4,2,7,4,7,7,7,23,7,4,3,7,7,27,7,4,5,7,8,39,7,6,16,9,8,576,7,4,6, -7,7,19,7,5,8,7,8,55,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7,7,8,45,7,4,3,7,5,11,7,4,5, -7,8,53,7,5,9,9,8,448,7,4,6,7,8,35,9,5,128,7,8,51,7,6,15,7,8,63,7,4,4,7,4,2,7,4,7, -7,6,13,7,4,3,9,9,1536,7,4,5,7,8,43,7,6,17,9,9,1280,7,4,6,7,6,1,7,5,8,9,6,192,9,5,64, -7,5,10,7,4,4,7,4,2,7,4,7,7,8,29,7,4,3,7,5,11,7,4,5,7,6,12,7,5,9,9,6,1664,7,4,6, -7,8,33,9,5,128,7,8,49,7,6,14,7,8,61,7,4,4,7,4,2,7,4,7,7,8,47,7,4,3,7,8,59,7,4,5, -7,8,41,7,6,16,9,9,1024,7,4,6,7,8,31,7,5,8,7,8,57,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7, -7,7,22,7,4,3,7,5,11,7,4,5,7,7,26,7,5,9,9,9,768,7,4,6,7,8,37,9,5,128,7,7,25,7,6,15, -9,8,320,7,4,4,7,4,2,7,4,7,7,6,13,7,4,3,7,7,18,7,4,5,7,7,21,7,6,17,9,7,256,7,4,6, -7,6,1,7,5,8,9,6,192,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7,11,12,2560,7,4,3,7,5,11,7,4,5, -7,6,12,7,5,9,9,6,1664,7,4,6,7,7,20,9,5,128,7,7,24,7,6,14,7,7,28,7,4,4,7,4,2,7,4,7, -7,7,23,7,4,3,7,7,27,7,4,5,7,8,40,7,6,16,9,9,896,7,4,6,7,7,19,7,5,8,7,8,56,9,5,64, -7,5,10,7,4,4,7,4,2,7,4,7,7,8,46,7,4,3,7,5,11,7,4,5,7,8,54,7,5,9,9,8,512,7,4,6, -7,8,36,9,5,128,7,8,52,7,6,15,7,8,0,7,4,4,7,4,2,7,4,7,7,6,13,7,4,3,9,9,1728,7,4,5, -7,8,44,7,6,17,9,9,1408,7,4,6,7,6,1,7,5,8,9,6,192,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7, -7,8,30,7,4,3,7,5,11,7,4,5,7,6,12,7,5,9,9,6,1664,7,4,6,7,8,34,9,5,128,7,8,50,7,6,14, -7,8,62,7,4,4,7,4,2,7,4,7,7,8,48,7,4,3,7,8,60,7,4,5,7,8,42,7,6,16,9,9,1152,7,4,6, -7,8,32,7,5,8,7,8,58,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7,7,7,22,7,4,3,7,5,11,7,4,5, -7,7,26,7,5,9,9,8,640,7,4,6,7,8,38,9,5,128,7,7,25,7,6,15,9,8,384,7,4,4,7,4,2,7,4,7, -7,6,13,7,4,3,7,7,18,7,4,5,7,7,21,7,6,17,9,7,256,7,4,6,7,6,1,7,5,8,9,6,192,9,5,64, -7,5,10,7,4,4,7,4,2,7,4,7 -}; -const TIFFFaxTabEnt TIFFFaxBlackTable[8192] = { -12,11,0,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,7,10,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,8,13,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,9,15,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,10,18,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,11,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,10,17,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,7,12,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,11,11,1792,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,7,10,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,11,23,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,11,20,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,11,25,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,7,11,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,8,14,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,7,12,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,0,0,0,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,10,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,8,13,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,10,12,128,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,12,56,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,7,11,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,12,30,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,12,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -11,11,1856,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,7,10,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,12,57,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,11,21,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,12,54,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,11,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,8,14,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,7,12,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,0,0,0,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,7,10,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,8,13,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,9,15,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,12,52,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,7,11,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,12,48,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,7,12,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,11,12,2112,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,10,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,12,44,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,12,36,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,10,12,384,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,7,11,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,8,14,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,12,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -0,0,0,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,7,10,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,8,13,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,12,28,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,12,60,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,11,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,12,40,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,7,12,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,11,12,2368,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,7,10,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,10,16,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,10,0,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -10,10,64,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,7,11,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,8,14,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,7,12,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,0,0,0,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,10,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,8,13,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,9,15,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,10,18,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,7,11,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,10,17,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,12,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -11,12,1984,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,7,10,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,12,50,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,12,34,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,10,13,1664,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,11,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,8,14,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,7,12,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,0,0,0,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,7,10,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,8,13,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,12,26,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -10,13,1408,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,7,11,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,12,32,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,7,12,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,11,11,1920,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,10,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,12,61,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,12,42,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,10,13,1024,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,7,11,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,8,14,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,12,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -0,0,0,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,7,10,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,8,13,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,9,15,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,10,13,768,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,11,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,12,62,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,7,12,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,11,12,2240,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,7,10,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,12,46,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,12,38,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -10,13,512,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,7,11,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,8,14,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,7,12,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,0,0,0,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,10,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,8,13,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,11,19,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,11,24,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,7,11,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,11,22,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,12,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -11,12,2496,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,7,10,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,10,16,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,10,0,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,10,10,64,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,11,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,8,14,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,7,12,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,12,11,0,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,7,10,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,8,13,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,9,15,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,10,18,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,7,11,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,10,17,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,7,12,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,11,11,1792,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,10,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,11,23,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,11,20,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,11,25,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,7,11,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,8,14,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,12,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -0,0,0,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,7,10,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,8,13,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -10,12,192,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,10,13,1280,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,11,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,12,31,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,7,12,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,11,11,1856,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,7,10,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,12,58,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,11,21,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -10,13,896,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,7,11,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,8,14,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,7,12,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,0,0,0,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,10,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,8,13,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,9,15,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,10,13,640,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,7,11,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,12,49,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,12,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -11,12,2176,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,7,10,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,12,45,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,12,37,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,10,12,448,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,11,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,8,14,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,7,12,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,0,0,0,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,7,10,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,8,13,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,12,29,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -10,13,1536,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,7,11,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,12,41,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,7,12,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,11,12,2432,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,10,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,10,16,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,10,0,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,10,10,64,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,7,11,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,8,14,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,12,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -0,0,0,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,7,10,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,8,13,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,9,15,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,10,18,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,11,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,10,17,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,7,12,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,11,12,2048,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,7,10,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,12,51,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,12,35,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -10,12,320,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,7,11,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,8,14,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,7,12,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,0,0,0,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,10,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,8,13,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,12,27,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,12,59,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,7,11,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,12,33,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,12,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -11,11,1920,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,7,10,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,10,12,256,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,12,43,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,10,13,1152,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,11,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,8,14,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,7,12,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,0,0,0,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,7,10,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,8,13,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,9,15,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,12,55,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,7,11,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,12,63,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,7,12,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,11,12,2304,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,10,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,12,47,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,12,39,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,12,53,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,7,11,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,8,14,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,12,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -0,0,0,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,7,10,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,8,13,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,11,19,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,11,24,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,11,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,11,22,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,7,12,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,11,12,2560,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,7,10,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,10,16,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,10,0,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -10,10,64,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,7,11,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,8,14,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,7,12,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,12,11,0,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,10,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,8,13,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,9,15,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,10,18,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,7,11,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,10,17,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,12,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -11,11,1792,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,7,10,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,11,23,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,11,20,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,11,25,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,11,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,8,14,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,7,12,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,0,0,0,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,7,10,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,8,13,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,10,12,128,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,12,56,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,7,11,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,12,30,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,7,12,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,11,11,1856,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,10,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,12,57,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,11,21,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,12,54,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,7,11,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,8,14,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,12,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -0,0,0,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,7,10,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,8,13,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,9,15,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,12,52,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,11,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,12,48,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,7,12,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,11,12,2112,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,7,10,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,12,44,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,12,36,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -10,12,384,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,7,11,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,8,14,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,7,12,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,0,0,0,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,10,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,8,13,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,12,28,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,12,60,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,7,11,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,12,40,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,12,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -11,12,2368,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,7,10,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,10,16,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,10,0,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,10,10,64,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,11,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,8,14,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,7,12,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,0,0,0,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,7,10,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,8,13,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,9,15,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,10,18,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,7,11,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,10,17,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,7,12,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,11,12,1984,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,10,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,12,50,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,12,34,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,10,13,1728,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,7,11,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,8,14,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,12,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -0,0,0,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,7,10,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,8,13,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,12,26,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,10,13,1472,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,11,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,12,32,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,7,12,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,11,11,1920,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,7,10,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,12,61,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,12,42,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -10,13,1088,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,7,11,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,8,14,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,7,12,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,0,0,0,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,10,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,8,13,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,9,15,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,10,13,832,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,7,11,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,12,62,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,12,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -11,12,2240,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,7,10,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,12,46,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,12,38,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,10,13,576,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,11,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,8,14,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,7,12,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,0,0,0,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,7,10,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,8,13,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,11,19,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,11,24,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,7,11,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,11,22,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,7,12,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,11,12,2496,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,10,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,10,16,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,10,0,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,10,10,64,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,7,11,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,8,14,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,12,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -12,11,0,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,7,10,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,8,13,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,9,15,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,10,18,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,11,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,10,17,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,7,12,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,11,11,1792,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,7,10,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,11,23,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,11,20,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,11,25,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,7,11,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,8,14,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,7,12,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,0,0,0,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,10,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,8,13,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,10,12,192,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,10,13,1344,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,7,11,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,12,31,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,12,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -11,11,1856,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,7,10,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,12,58,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,11,21,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,10,13,960,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,11,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,8,14,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,7,12,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,0,0,0,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,7,10,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,8,13,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,9,15,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -10,13,704,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,7,11,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,12,49,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,7,12,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,11,12,2176,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,10,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,12,45,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,12,37,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,10,12,448,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,7,11,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,8,14,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,12,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -0,0,0,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,7,10,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,8,13,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,12,29,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,10,13,1600,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,11,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,12,41,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,7,12,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,11,12,2432,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,7,10,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,10,16,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,10,0,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -10,10,64,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,7,11,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,8,14,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,7,12,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,0,0,0,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,10,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,8,13,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,9,15,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,10,18,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,7,11,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,10,17,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,12,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -11,12,2048,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,7,10,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,12,51,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,12,35,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,10,12,320,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,11,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,8,14,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,7,12,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,0,0,0,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,7,10,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,8,13,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,12,27,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,12,59,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,7,11,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,12,33,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,7,12,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,11,11,1920,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,10,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -10,12,256,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,12,43,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,10,13,1216,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,7,11,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,8,14,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,12,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -0,0,0,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,7,10,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,8,13,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,9,15,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,12,55,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,11,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,12,63,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,7,12,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,11,12,2304,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,7,10,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,12,47,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,12,39,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,12,53,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,7,11,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,8,14,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,7,12,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,0,0,0,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,10,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,8,13,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,11,19,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,11,24,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,7,11,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,11,22,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,12,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -11,12,2560,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,7,10,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,10,16,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,10,0,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,10,10,64,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,11,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,8,14,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,7,12,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2 -}; diff --git a/wxWidgets/src/tiff/libtiff.def b/wxWidgets/src/tiff/libtiff.def deleted file mode 100644 index 4aa8165ea9..0000000000 --- a/wxWidgets/src/tiff/libtiff.def +++ /dev/null @@ -1,102 +0,0 @@ -LIBRARY libtiff -EXPORTS TIFFOpen - TIFFGetVersion - TIFFClose - TIFFFlush - TIFFFlushData - TIFFGetField - TIFFVGetField - TIFFGetFieldDefaulted - TIFFVGetFieldDefaulted - TIFFGetTagListEntry - TIFFGetTagListCount - TIFFReadDirectory - TIFFScanlineSize - TIFFStripSize - TIFFVStripSize - TIFFRawStripSize - TIFFTileRowSize - TIFFTileSize - TIFFVTileSize - TIFFFileno - TIFFGetMode - TIFFIsTiled - TIFFIsByteSwapped - TIFFCIELabToRGBInit - TIFFCIELabToXYZ - TIFFXYZToRGB - TIFFYCbCrToRGBInit - TIFFYCbCrtoRGB - TIFFCurrentRow - TIFFCurrentDirectory - TIFFCurrentStrip - TIFFCurrentTile - TIFFDataWidth - TIFFReadBufferSetup - TIFFLastDirectory - TIFFSetDirectory - TIFFSetSubDirectory - TIFFUnlinkDirectory - TIFFSetField - TIFFVSetField - TIFFCheckpointDirectory - TIFFWriteDirectory - TIFFRewriteDirectory - TIFFPrintDirectory - TIFFReadScanline - TIFFWriteScanline - TIFFReadRGBAImage - TIFFReadRGBAImageOriented - TIFFPrintDirectory - TIFFReadScanline - TIFFWriteScanline - TIFFReadRGBAImage - TIFFFdOpen - TIFFClientOpen - TIFFFileName - TIFFError - TIFFWarning - TIFFSetErrorHandler - TIFFSetWarningHandler - TIFFComputeTile - TIFFCheckTile - TIFFNumberOfTiles - TIFFReadTile - TIFFWriteTile - TIFFComputeStrip - TIFFNumberOfStrips - TIFFRGBAImageBegin - TIFFRGBAImageEnd - TIFFReadEncodedStrip - TIFFReadRawStrip - TIFFReadEncodedTile - TIFFReadRawTile - TIFFReadRGBATile - TIFFReadRGBAStrip - TIFFWriteEncodedStrip - TIFFWriteRawStrip - TIFFWriteEncodedTile - TIFFWriteRawTile - TIFFSetWriteOffset - TIFFSwabDouble - TIFFSwabShort - TIFFSwabLong - TIFFSwabArrayOfShort - TIFFSwabArrayOfLong - TIFFSwabArrayOfDouble - TIFFReverseBits - TIFFGetBitRevTable - TIFFDefaultStripSize - TIFFDefaultTileSize - TIFFRasterScanlineSize - _TIFFmalloc - _TIFFrealloc - _TIFFfree - _TIFFmemset - _TIFFmemcpy - _TIFFmemcmp - TIFFCreateDirectory - TIFFDefaultStripSize - - - diff --git a/wxWidgets/src/tiff/makefile.vc b/wxWidgets/src/tiff/makefile.vc deleted file mode 100644 index 00ef34d0cb..0000000000 --- a/wxWidgets/src/tiff/makefile.vc +++ /dev/null @@ -1,93 +0,0 @@ -# -# Simple MS VC++ Makefile -# -# To build: -# C:\libtiff\libtiff> nmake /f makefile.vc all -# - -# -# Select _CONSOLE to build a library which reports errors to stderr, or -# _WINDOWED to build such that errors are reported via MessageBox(). -# -WINMODE = -DTIF_PLATFORM_CONSOLE -#WINMODE = -DTIF_PLATFORM_WINDOWED - -# Uncomment and edit following lines to enable JPEG support -#JPEG_SUPPORT = 1 -#JPEGDIR = d:/projects/jpeg-6b - -CC = cl -INCL = -I. -LIBS = -EXTRAFLAGS = - -!IFDEF JPEG_SUPPORT -INCL = $(INCL) -I$(JPEGDIR) -EXTRAFLAGS = $(EXTRAFLAGS) -DJPEG_SUPPORT -!ENDIF - -CFLAGS = /nologo /W3 $(INCL) $(WINMODE) $(EXTRAFLAGS) - -OBJ = \ - tif_aux.obj \ - tif_close.obj \ - tif_codec.obj \ - tif_color.obj \ - tif_compress.obj \ - tif_dir.obj \ - tif_dirinfo.obj \ - tif_dirread.obj \ - tif_dirwrite.obj \ - tif_dumpmode.obj \ - tif_error.obj \ - tif_extension.obj \ - tif_fax3.obj \ - fax3sm_winnt.obj \ - tif_getimage.obj \ - tif_jpeg.obj \ - tif_ojpeg.obj \ - tif_flush.obj \ - tif_luv.obj \ - tif_lzw.obj \ - tif_next.obj \ - tif_open.obj \ - tif_packbits.obj \ - tif_pixarlog.obj \ - tif_predict.obj \ - tif_print.obj \ - tif_read.obj \ - tif_swab.obj \ - tif_strip.obj \ - tif_thunder.obj \ - tif_tile.obj \ - tif_win32.obj \ - tif_version.obj \ - tif_warning.obj \ - tif_write.obj \ - tif_zip.obj - -VERSION = ..\VERSION -ALPHA = ..\dist\tiff.alpha - -default: libtiff.lib - -all: libtiff.lib libtiff.dll - -libtiff.lib: tiffvers.h $(OBJ) - lib /out:libtiff.lib $(OBJ) - -libtiff.dll: $(OBJ) - link /dll /def:libtiff.def /out:libtiff.dll /implib:libtiff_i.lib \ - $(OBJ) $(LIBS) - -tiffvers.h: $(VERSION) mkversion.c - $(CC) mkversion.c - if exist tiffvers.h del tiffvers.h - .\mkversion.exe -v $(VERSION) tiffvers.h - -clean: - del *.obj *.lib libtiff.dll - -tif_version.obj: tiffvers.h - - diff --git a/wxWidgets/src/tiff/mkg3states.c b/wxWidgets/src/tiff/mkg3states.c deleted file mode 100644 index 16ada83a1d..0000000000 --- a/wxWidgets/src/tiff/mkg3states.c +++ /dev/null @@ -1,436 +0,0 @@ -/* "$Header$ */ - -/* - * Copyright (c) 1991-1997 Sam Leffler - * Copyright (c) 1991-1997 Silicon Graphics, Inc. - * - * Permission to use, copy, modify, distribute, and sell this software and - * its documentation for any purpose is hereby granted without fee, provided - * that (i) the above copyright notices and this permission notice appear in - * all copies of the software and related documentation, and (ii) the names of - * Sam Leffler and Silicon Graphics may not be used in any advertising or - * publicity relating to the software without the specific, prior written - * permission of Sam Leffler and Silicon Graphics. - * - * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, - * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * - * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR - * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, - * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF - * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE - * OF THIS SOFTWARE. - */ - -/* Initialise fax decoder tables - * Decoder support is derived, with permission, from the code - * in Frank Cringle's viewfax program; - * Copyright (C) 1990, 1995 Frank D. Cringle. - */ -#if defined(unix) || defined(__unix) -#include "port.h" -#else -#include -#include -#include -#endif - -#include "tif_fax3.h" - -#define streq(a,b) (strcmp(a,b) == 0) - -/* NB: can't use names in tif_fax3.h 'cuz they are declared const */ -TIFFFaxTabEnt MainTable[128]; -TIFFFaxTabEnt WhiteTable[4096]; -TIFFFaxTabEnt BlackTable[8192]; - -struct proto { - uint16 code; /* right justified, lsb-first, zero filled */ - uint16 val; /* (pixel count)<<4 + code width */ -}; - -static struct proto Pass[] = { -{ 0x0008, 4 }, -{ 0, 0 } -}; - -static struct proto Horiz[] = { -{ 0x0004, 3 }, -{ 0, 0 } -}; - -static struct proto V0[] = { -{ 0x0001, 1 }, -{ 0, 0 } -}; - -static struct proto VR[] = { -{ 0x0006, (1<<4)+3 }, -{ 0x0030, (2<<4)+6 }, -{ 0x0060, (3<<4)+7 }, -{ 0, 0 } -}; - -static struct proto VL[] = { -{ 0x0002, (1<<4)+3 }, -{ 0x0010, (2<<4)+6 }, -{ 0x0020, (3<<4)+7 }, -{ 0, 0 } -}; - -static struct proto Ext[] = { -{ 0x0040, 7 }, -{ 0, 0 } -}; - -static struct proto EOLV[] = { -{ 0x0000, 7 }, -{ 0, 0 } -}; - -static struct proto MakeUpW[] = { -{ 0x001b, 1029 }, -{ 0x0009, 2053 }, -{ 0x003a, 3078 }, -{ 0x0076, 4103 }, -{ 0x006c, 5128 }, -{ 0x00ec, 6152 }, -{ 0x0026, 7176 }, -{ 0x00a6, 8200 }, -{ 0x0016, 9224 }, -{ 0x00e6, 10248 }, -{ 0x0066, 11273 }, -{ 0x0166, 12297 }, -{ 0x0096, 13321 }, -{ 0x0196, 14345 }, -{ 0x0056, 15369 }, -{ 0x0156, 16393 }, -{ 0x00d6, 17417 }, -{ 0x01d6, 18441 }, -{ 0x0036, 19465 }, -{ 0x0136, 20489 }, -{ 0x00b6, 21513 }, -{ 0x01b6, 22537 }, -{ 0x0032, 23561 }, -{ 0x0132, 24585 }, -{ 0x00b2, 25609 }, -{ 0x0006, 26630 }, -{ 0x01b2, 27657 }, -{ 0, 0 } -}; - -static struct proto MakeUpB[] = { -{ 0x03c0, 1034 }, -{ 0x0130, 2060 }, -{ 0x0930, 3084 }, -{ 0x0da0, 4108 }, -{ 0x0cc0, 5132 }, -{ 0x02c0, 6156 }, -{ 0x0ac0, 7180 }, -{ 0x06c0, 8205 }, -{ 0x16c0, 9229 }, -{ 0x0a40, 10253 }, -{ 0x1a40, 11277 }, -{ 0x0640, 12301 }, -{ 0x1640, 13325 }, -{ 0x09c0, 14349 }, -{ 0x19c0, 15373 }, -{ 0x05c0, 16397 }, -{ 0x15c0, 17421 }, -{ 0x0dc0, 18445 }, -{ 0x1dc0, 19469 }, -{ 0x0940, 20493 }, -{ 0x1940, 21517 }, -{ 0x0540, 22541 }, -{ 0x1540, 23565 }, -{ 0x0b40, 24589 }, -{ 0x1b40, 25613 }, -{ 0x04c0, 26637 }, -{ 0x14c0, 27661 }, -{ 0, 0 } -}; - -static struct proto MakeUp[] = { -{ 0x0080, 28683 }, -{ 0x0180, 29707 }, -{ 0x0580, 30731 }, -{ 0x0480, 31756 }, -{ 0x0c80, 32780 }, -{ 0x0280, 33804 }, -{ 0x0a80, 34828 }, -{ 0x0680, 35852 }, -{ 0x0e80, 36876 }, -{ 0x0380, 37900 }, -{ 0x0b80, 38924 }, -{ 0x0780, 39948 }, -{ 0x0f80, 40972 }, -{ 0, 0 } -}; - -static struct proto TermW[] = { -{ 0x00ac, 8 }, -{ 0x0038, 22 }, -{ 0x000e, 36 }, -{ 0x0001, 52 }, -{ 0x000d, 68 }, -{ 0x0003, 84 }, -{ 0x0007, 100 }, -{ 0x000f, 116 }, -{ 0x0019, 133 }, -{ 0x0005, 149 }, -{ 0x001c, 165 }, -{ 0x0002, 181 }, -{ 0x0004, 198 }, -{ 0x0030, 214 }, -{ 0x000b, 230 }, -{ 0x002b, 246 }, -{ 0x0015, 262 }, -{ 0x0035, 278 }, -{ 0x0072, 295 }, -{ 0x0018, 311 }, -{ 0x0008, 327 }, -{ 0x0074, 343 }, -{ 0x0060, 359 }, -{ 0x0010, 375 }, -{ 0x000a, 391 }, -{ 0x006a, 407 }, -{ 0x0064, 423 }, -{ 0x0012, 439 }, -{ 0x000c, 455 }, -{ 0x0040, 472 }, -{ 0x00c0, 488 }, -{ 0x0058, 504 }, -{ 0x00d8, 520 }, -{ 0x0048, 536 }, -{ 0x00c8, 552 }, -{ 0x0028, 568 }, -{ 0x00a8, 584 }, -{ 0x0068, 600 }, -{ 0x00e8, 616 }, -{ 0x0014, 632 }, -{ 0x0094, 648 }, -{ 0x0054, 664 }, -{ 0x00d4, 680 }, -{ 0x0034, 696 }, -{ 0x00b4, 712 }, -{ 0x0020, 728 }, -{ 0x00a0, 744 }, -{ 0x0050, 760 }, -{ 0x00d0, 776 }, -{ 0x004a, 792 }, -{ 0x00ca, 808 }, -{ 0x002a, 824 }, -{ 0x00aa, 840 }, -{ 0x0024, 856 }, -{ 0x00a4, 872 }, -{ 0x001a, 888 }, -{ 0x009a, 904 }, -{ 0x005a, 920 }, -{ 0x00da, 936 }, -{ 0x0052, 952 }, -{ 0x00d2, 968 }, -{ 0x004c, 984 }, -{ 0x00cc, 1000 }, -{ 0x002c, 1016 }, -{ 0, 0 } -}; - -static struct proto TermB[] = { -{ 0x03b0, 10 }, -{ 0x0002, 19 }, -{ 0x0003, 34 }, -{ 0x0001, 50 }, -{ 0x0006, 67 }, -{ 0x000c, 84 }, -{ 0x0004, 100 }, -{ 0x0018, 117 }, -{ 0x0028, 134 }, -{ 0x0008, 150 }, -{ 0x0010, 167 }, -{ 0x0050, 183 }, -{ 0x0070, 199 }, -{ 0x0020, 216 }, -{ 0x00e0, 232 }, -{ 0x0030, 249 }, -{ 0x03a0, 266 }, -{ 0x0060, 282 }, -{ 0x0040, 298 }, -{ 0x0730, 315 }, -{ 0x00b0, 331 }, -{ 0x01b0, 347 }, -{ 0x0760, 363 }, -{ 0x00a0, 379 }, -{ 0x0740, 395 }, -{ 0x00c0, 411 }, -{ 0x0530, 428 }, -{ 0x0d30, 444 }, -{ 0x0330, 460 }, -{ 0x0b30, 476 }, -{ 0x0160, 492 }, -{ 0x0960, 508 }, -{ 0x0560, 524 }, -{ 0x0d60, 540 }, -{ 0x04b0, 556 }, -{ 0x0cb0, 572 }, -{ 0x02b0, 588 }, -{ 0x0ab0, 604 }, -{ 0x06b0, 620 }, -{ 0x0eb0, 636 }, -{ 0x0360, 652 }, -{ 0x0b60, 668 }, -{ 0x05b0, 684 }, -{ 0x0db0, 700 }, -{ 0x02a0, 716 }, -{ 0x0aa0, 732 }, -{ 0x06a0, 748 }, -{ 0x0ea0, 764 }, -{ 0x0260, 780 }, -{ 0x0a60, 796 }, -{ 0x04a0, 812 }, -{ 0x0ca0, 828 }, -{ 0x0240, 844 }, -{ 0x0ec0, 860 }, -{ 0x01c0, 876 }, -{ 0x0e40, 892 }, -{ 0x0140, 908 }, -{ 0x01a0, 924 }, -{ 0x09a0, 940 }, -{ 0x0d40, 956 }, -{ 0x0340, 972 }, -{ 0x05a0, 988 }, -{ 0x0660, 1004 }, -{ 0x0e60, 1020 }, -{ 0, 0 } -}; - -static struct proto EOLH[] = { -{ 0x0000, 11 }, -{ 0, 0 } -}; - -static void -FillTable(TIFFFaxTabEnt *T, int Size, struct proto *P, int State) -{ - int limit = 1 << Size; - - while (P->val) { - int width = P->val & 15; - int param = P->val >> 4; - int incr = 1 << width; - int code; - for (code = P->code; code < limit; code += incr) { - TIFFFaxTabEnt *E = T+code; - E->State = State; - E->Width = width; - E->Param = param; - } - P++; - } -} - -static char* storage_class = ""; -static char* const_class = ""; -static int packoutput = 1; -static char* prebrace = ""; -static char* postbrace = ""; - -void -WriteTable(FILE* fd, const TIFFFaxTabEnt* T, int Size, const char* name) -{ - int i; - char* sep; - - fprintf(fd, "%s %s TIFFFaxTabEnt %s[%d] = {", - storage_class, const_class, name, Size); - if (packoutput) { - sep = "\n"; - for (i = 0; i < Size; i++) { - fprintf(fd, "%s%s%d,%d,%d%s", - sep, prebrace, T->State, T->Width, (int) T->Param, postbrace); - if (((i+1) % 12) == 0) - sep = ",\n"; - else - sep = ","; - T++; - } - } else { - sep = "\n "; - for (i = 0; i < Size; i++) { - fprintf(fd, "%s%s%3d,%3d,%4d%s", - sep, prebrace, T->State, T->Width, (int) T->Param, postbrace); - if (((i+1) % 6) == 0) - sep = ",\n "; - else - sep = ","; - T++; - } - } - fprintf(fd, "\n};\n"); -} - -/* initialise the huffman code tables */ -int -main(int argc, char* argv[]) -{ - FILE* fd; - char* outputfile; - int c; - extern int optind; - extern char* optarg; - - while ((c = getopt(argc, argv, "c:s:bp")) != -1) - switch (c) { - case 'c': - const_class = optarg; - break; - case 's': - storage_class = optarg; - break; - case 'p': - packoutput = 0; - break; - case 'b': - prebrace = "{"; - postbrace = "}"; - break; - case '?': - fprintf(stderr, - "usage: %s [-c const] [-s storage] [-p] [-b] file\n", - argv[0]); - return (-1); - } - outputfile = optind < argc ? argv[optind] : "g3states.h"; - fd = fopen(outputfile, "w"); - if (fd == NULL) { - fprintf(stderr, "%s: %s: Cannot create output file.\n", - argv[0], outputfile); - return (-2); - } - FillTable(MainTable, 7, Pass, S_Pass); - FillTable(MainTable, 7, Horiz, S_Horiz); - FillTable(MainTable, 7, V0, S_V0); - FillTable(MainTable, 7, VR, S_VR); - FillTable(MainTable, 7, VL, S_VL); - FillTable(MainTable, 7, Ext, S_Ext); - FillTable(MainTable, 7, EOLV, S_EOL); - FillTable(WhiteTable, 12, MakeUpW, S_MakeUpW); - FillTable(WhiteTable, 12, MakeUp, S_MakeUp); - FillTable(WhiteTable, 12, TermW, S_TermW); - FillTable(WhiteTable, 12, EOLH, S_EOL); - FillTable(BlackTable, 13, MakeUpB, S_MakeUpB); - FillTable(BlackTable, 13, MakeUp, S_MakeUp); - FillTable(BlackTable, 13, TermB, S_TermB); - FillTable(BlackTable, 13, EOLH, S_EOL); - - fprintf(fd, "/* WARNING, this file was automatically generated by the\n"); - fprintf(fd, " mkg3states program */\n"); - fprintf(fd, "#include \"tiff.h\"\n"); - fprintf(fd, "#include \"tif_fax3.h\"\n"); - WriteTable(fd, MainTable, 128, "TIFFFaxMainTable"); - WriteTable(fd, WhiteTable, 4096, "TIFFFaxWhiteTable"); - WriteTable(fd, BlackTable, 8192, "TIFFFaxBlackTable"); - fclose(fd); - return (0); -} diff --git a/wxWidgets/src/tiff/mkspans.c b/wxWidgets/src/tiff/mkspans.c deleted file mode 100644 index 16b999635d..0000000000 --- a/wxWidgets/src/tiff/mkspans.c +++ /dev/null @@ -1,72 +0,0 @@ -/* $Header$ */ - -/* - * Copyright (c) 1991-1997 Sam Leffler - * Copyright (c) 1991-1997 Silicon Graphics, Inc. - * - * Permission to use, copy, modify, distribute, and sell this software and - * its documentation for any purpose is hereby granted without fee, provided - * that (i) the above copyright notices and this permission notice appear in - * all copies of the software and related documentation, and (ii) the names of - * Sam Leffler and Silicon Graphics may not be used in any advertising or - * publicity relating to the software without the specific, prior written - * permission of Sam Leffler and Silicon Graphics. - * - * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, - * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * - * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR - * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, - * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF - * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE - * OF THIS SOFTWARE. - */ - -#include "tiffcomp.h" - -/* - * Hack program to construct tables used to find - * runs of zeros and ones in Group 3 Fax encoding. - */ - -dumparray(name, runs) - char *name; - unsigned char runs[256]; -{ - register int i; - register char *sep; - printf("static u_char %s[256] = {\n", name); - sep = " "; - for (i = 0; i < 256; i++) { - printf("%s%d", sep, runs[i]); - if (((i + 1) % 16) == 0) { - printf(", /* 0x%02x - 0x%02x */\n", i-15, i); - sep = " "; - } else - sep = ", "; - } - printf("\n};\n"); -} - -main() -{ - unsigned char runs[2][256]; - - memset(runs[0], 0, 256*sizeof (char)); - memset(runs[1], 0, 256*sizeof (char)); - { register int run, runlen, i; - runlen = 1; - for (run = 0x80; run != 0xff; run = (run>>1)|0x80) { - for (i = run-1; i >= 0; i--) { - runs[1][run|i] = runlen; - runs[0][(~(run|i)) & 0xff] = runlen; - } - runlen++; - } - runs[1][0xff] = runs[0][0] = 8; - } - dumparray("bruns", runs[0]); - dumparray("wruns", runs[1]); -} diff --git a/wxWidgets/src/tiff/mkversion.c b/wxWidgets/src/tiff/mkversion.c deleted file mode 100644 index 5e99f03df6..0000000000 --- a/wxWidgets/src/tiff/mkversion.c +++ /dev/null @@ -1,148 +0,0 @@ -/* "$Header$ */ - -/* - * Copyright (c) 1995-1997 Sam Leffler - * Copyright (c) 1995-1997 Silicon Graphics, Inc. - * - * Permission to use, copy, modify, distribute, and sell this software and - * its documentation for any purpose is hereby granted without fee, provided - * that (i) the above copyright notices and this permission notice appear in - * all copies of the software and related documentation, and (ii) the names of - * Sam Leffler and Silicon Graphics may not be used in any advertising or - * publicity relating to the software without the specific, prior written - * permission of Sam Leffler and Silicon Graphics. - * - * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, - * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * - * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR - * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, - * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF - * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE - * OF THIS SOFTWARE. - */ - -/* - * Generate a library version string for systems that - * do not have a shell (by default this is done with - * awk and echo from the Makefile). - * - * This was written by Peter Greenham for Acorn systems. - * - * Syntax: mkversion [-v version-file] [] - */ -#include -#include -#include - -static void -usage(void) -{ - fprintf(stderr, - "usage: mkversion [-v version-file]\n" - " [-r releasedate-file] [outfile]\n"); - exit(-1); -} - -static FILE* -openFile(char* filename) -{ - FILE* fd = fopen(filename, "r"); - if (fd == NULL) { - fprintf(stderr, "mkversion: %s: Could not open for reading.\n", - filename); - exit(-1); - } - return (fd); -} - -int -main(int argc, char* argv[]) -{ - char* versionFile = "../VERSION"; - char* releaseDateFile = "../RELEASE-DATE"; - char version[128]; - char rawReleaseDate[128]; - char tiffLibVersion[128]; - FILE* fd; - char* cp; - - argc--, argv++; - while (argc > 0 && argv[0][0] == '-') { - if (strcmp(argv[0], "-v") == 0) { - if (argc < 1) - usage(); - argc--, argv++; - versionFile = argv[0]; - } else if (strcmp(argv[0], "-r") == 0) { - if (argc < 1) - usage(); - argc--, argv++; - releaseDateFile = argv[0]; - } else - usage(); - argc--, argv++; - } - - /* - * Read the VERSION file. - */ - fd = openFile(versionFile); - if (fgets(version, sizeof (version)-1, fd) == NULL) { - fprintf(stderr, "mkversion: No version information in %s.\n", - versionFile); - exit(-1); - } - cp = strchr(version, '\n'); - if (cp) - *cp = '\0'; - fclose(fd); - - /* - * Read the RELEASE-DATE, and translate format to emit TIFFLIB_VERSION. - */ - fd = openFile(releaseDateFile); - if (fgets(rawReleaseDate, sizeof (rawReleaseDate)-1, fd) == NULL) { - fprintf(stderr, "mkversion: No release date information in %s.\n", - releaseDateFile); - exit(-1); - } - fclose(fd); - - sprintf( tiffLibVersion, "#define TIFFLIB_VERSION %4.4s%2.2s%2.2s", - rawReleaseDate+6, - rawReleaseDate+0, - rawReleaseDate+3 ); - - /* - * Emit the tiffvers.h file. - */ - if (argc > 0) { - fd = fopen(argv[0], "w"); - if (fd == NULL) { - fprintf(stderr, "mkversion: %s: Could not open for writing.\n", - argv[0]); - exit(-1); - } - } else - fd = stdout; - fprintf(fd, "#define TIFFLIB_VERSION_STR \"LIBTIFF, Version %s\\n", version); - fprintf(fd, "Copyright (c) 1988-1996 Sam Leffler\\n"); - fprintf(fd, "Copyright (c) 1991-1996 Silicon Graphics, Inc.\"\n"); - - fprintf( fd, - "/*\n" - " * This define can be used in code that requires\n" - " * compilation-related definitions specific to a\n" - " * version or versions of the library. Runtime\n" - " * version checking should be done based on the\n" - " * string returned by TIFFGetVersion.\n" - " */\n" ); - fprintf(fd, "%s\n", tiffLibVersion ); - - if (fd != stdout) - fclose(fd); - return (0); -} diff --git a/wxWidgets/src/tiff/port.h b/wxWidgets/src/tiff/port.h deleted file mode 100644 index 773d63a8a3..0000000000 --- a/wxWidgets/src/tiff/port.h +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Warning, this file was automatically created by the TIFF configure script - * Actually, it has been modified to use wxWidgets' values. - * VERSION: v3.5.2 - * DATE: Son Nov 28 15:15:07 GMT 1999 - * TARGET: - * CCOMPILER: - */ -#ifndef _PORT_ -#define _PORT_ 1 - -#ifdef __cplusplus -extern "C" { -#endif - -#include "wx/setup.h" - -#include -#define HOST_FILLORDER FILLORDER_LSB2MSB - -/* wxWidgets defines WORDS_BIGENDIAN */ -#ifdef WORDS_BIGENDIAN -#define HOST_BIGENDIAN 1 -#else -#define HOST_BIGENDIAN 0 -#endif - -/* wxWidgets defines its own reading and writing routines */ -/* #define HAVE_MMAP 1 */ - -#include -#include -#include -#include -#include - -typedef double dblparam_t; - -#ifdef __STRICT_ANSI__ -#define INLINE __inline__ -#else -#define INLINE inline -#endif - -#define GLOBALDATA(TYPE,NAME) extern TYPE NAME - -/* wxWidgets defines wxUSE_LIBJPEG */ -#if wxUSE_LIBJPEG -#define JPEG_SUPPORT -#endif - -/* wxWidgets defines wxUSE_ZLIB */ -#if wxUSE_ZLIB -#define ZIP_SUPPORT -#endif - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/wxWidgets/src/tiff/t4.h b/wxWidgets/src/tiff/t4.h deleted file mode 100644 index 5b347ca98a..0000000000 --- a/wxWidgets/src/tiff/t4.h +++ /dev/null @@ -1,285 +0,0 @@ -/* $Id: t4.h 30659 2004-11-19 22:29:47Z VZ $ */ - -/* - * Copyright (c) 1988-1997 Sam Leffler - * Copyright (c) 1991-1997 Silicon Graphics, Inc. - * - * Permission to use, copy, modify, distribute, and sell this software and - * its documentation for any purpose is hereby granted without fee, provided - * that (i) the above copyright notices and this permission notice appear in - * all copies of the software and related documentation, and (ii) the names of - * Sam Leffler and Silicon Graphics may not be used in any advertising or - * publicity relating to the software without the specific, prior written - * permission of Sam Leffler and Silicon Graphics. - * - * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, - * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * - * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR - * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, - * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF - * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE - * OF THIS SOFTWARE. - */ - -#ifndef _T4_ -#define _T4_ -/* - * CCITT T.4 1D Huffman runlength codes and - * related definitions. Given the small sizes - * of these tables it does not seem - * worthwhile to make code & length 8 bits. - */ -typedef struct tableentry { - unsigned short length; /* bit length of g3 code */ - unsigned short code; /* g3 code */ - short runlen; /* run length in bits */ -} tableentry; - -#define EOL 0x001 /* EOL code value - 0000 0000 0000 1 */ - -/* status values returned instead of a run length */ -#define G3CODE_EOL -1 /* NB: ACT_EOL - ACT_WRUNT */ -#define G3CODE_INVALID -2 /* NB: ACT_INVALID - ACT_WRUNT */ -#define G3CODE_EOF -3 /* end of input data */ -#define G3CODE_INCOMP -4 /* incomplete run code */ - -/* - * Note that these tables are ordered such that the - * index into the table is known to be either the - * run length, or (run length / 64) + a fixed offset. - * - * NB: The G3CODE_INVALID entries are only used - * during state generation (see mkg3states.c). - */ -#ifdef G3CODES -const tableentry TIFFFaxWhiteCodes[] = { - { 8, 0x35, 0 }, /* 0011 0101 */ - { 6, 0x7, 1 }, /* 0001 11 */ - { 4, 0x7, 2 }, /* 0111 */ - { 4, 0x8, 3 }, /* 1000 */ - { 4, 0xB, 4 }, /* 1011 */ - { 4, 0xC, 5 }, /* 1100 */ - { 4, 0xE, 6 }, /* 1110 */ - { 4, 0xF, 7 }, /* 1111 */ - { 5, 0x13, 8 }, /* 1001 1 */ - { 5, 0x14, 9 }, /* 1010 0 */ - { 5, 0x7, 10 }, /* 0011 1 */ - { 5, 0x8, 11 }, /* 0100 0 */ - { 6, 0x8, 12 }, /* 0010 00 */ - { 6, 0x3, 13 }, /* 0000 11 */ - { 6, 0x34, 14 }, /* 1101 00 */ - { 6, 0x35, 15 }, /* 1101 01 */ - { 6, 0x2A, 16 }, /* 1010 10 */ - { 6, 0x2B, 17 }, /* 1010 11 */ - { 7, 0x27, 18 }, /* 0100 111 */ - { 7, 0xC, 19 }, /* 0001 100 */ - { 7, 0x8, 20 }, /* 0001 000 */ - { 7, 0x17, 21 }, /* 0010 111 */ - { 7, 0x3, 22 }, /* 0000 011 */ - { 7, 0x4, 23 }, /* 0000 100 */ - { 7, 0x28, 24 }, /* 0101 000 */ - { 7, 0x2B, 25 }, /* 0101 011 */ - { 7, 0x13, 26 }, /* 0010 011 */ - { 7, 0x24, 27 }, /* 0100 100 */ - { 7, 0x18, 28 }, /* 0011 000 */ - { 8, 0x2, 29 }, /* 0000 0010 */ - { 8, 0x3, 30 }, /* 0000 0011 */ - { 8, 0x1A, 31 }, /* 0001 1010 */ - { 8, 0x1B, 32 }, /* 0001 1011 */ - { 8, 0x12, 33 }, /* 0001 0010 */ - { 8, 0x13, 34 }, /* 0001 0011 */ - { 8, 0x14, 35 }, /* 0001 0100 */ - { 8, 0x15, 36 }, /* 0001 0101 */ - { 8, 0x16, 37 }, /* 0001 0110 */ - { 8, 0x17, 38 }, /* 0001 0111 */ - { 8, 0x28, 39 }, /* 0010 1000 */ - { 8, 0x29, 40 }, /* 0010 1001 */ - { 8, 0x2A, 41 }, /* 0010 1010 */ - { 8, 0x2B, 42 }, /* 0010 1011 */ - { 8, 0x2C, 43 }, /* 0010 1100 */ - { 8, 0x2D, 44 }, /* 0010 1101 */ - { 8, 0x4, 45 }, /* 0000 0100 */ - { 8, 0x5, 46 }, /* 0000 0101 */ - { 8, 0xA, 47 }, /* 0000 1010 */ - { 8, 0xB, 48 }, /* 0000 1011 */ - { 8, 0x52, 49 }, /* 0101 0010 */ - { 8, 0x53, 50 }, /* 0101 0011 */ - { 8, 0x54, 51 }, /* 0101 0100 */ - { 8, 0x55, 52 }, /* 0101 0101 */ - { 8, 0x24, 53 }, /* 0010 0100 */ - { 8, 0x25, 54 }, /* 0010 0101 */ - { 8, 0x58, 55 }, /* 0101 1000 */ - { 8, 0x59, 56 }, /* 0101 1001 */ - { 8, 0x5A, 57 }, /* 0101 1010 */ - { 8, 0x5B, 58 }, /* 0101 1011 */ - { 8, 0x4A, 59 }, /* 0100 1010 */ - { 8, 0x4B, 60 }, /* 0100 1011 */ - { 8, 0x32, 61 }, /* 0011 0010 */ - { 8, 0x33, 62 }, /* 0011 0011 */ - { 8, 0x34, 63 }, /* 0011 0100 */ - { 5, 0x1B, 64 }, /* 1101 1 */ - { 5, 0x12, 128 }, /* 1001 0 */ - { 6, 0x17, 192 }, /* 0101 11 */ - { 7, 0x37, 256 }, /* 0110 111 */ - { 8, 0x36, 320 }, /* 0011 0110 */ - { 8, 0x37, 384 }, /* 0011 0111 */ - { 8, 0x64, 448 }, /* 0110 0100 */ - { 8, 0x65, 512 }, /* 0110 0101 */ - { 8, 0x68, 576 }, /* 0110 1000 */ - { 8, 0x67, 640 }, /* 0110 0111 */ - { 9, 0xCC, 704 }, /* 0110 0110 0 */ - { 9, 0xCD, 768 }, /* 0110 0110 1 */ - { 9, 0xD2, 832 }, /* 0110 1001 0 */ - { 9, 0xD3, 896 }, /* 0110 1001 1 */ - { 9, 0xD4, 960 }, /* 0110 1010 0 */ - { 9, 0xD5, 1024 }, /* 0110 1010 1 */ - { 9, 0xD6, 1088 }, /* 0110 1011 0 */ - { 9, 0xD7, 1152 }, /* 0110 1011 1 */ - { 9, 0xD8, 1216 }, /* 0110 1100 0 */ - { 9, 0xD9, 1280 }, /* 0110 1100 1 */ - { 9, 0xDA, 1344 }, /* 0110 1101 0 */ - { 9, 0xDB, 1408 }, /* 0110 1101 1 */ - { 9, 0x98, 1472 }, /* 0100 1100 0 */ - { 9, 0x99, 1536 }, /* 0100 1100 1 */ - { 9, 0x9A, 1600 }, /* 0100 1101 0 */ - { 6, 0x18, 1664 }, /* 0110 00 */ - { 9, 0x9B, 1728 }, /* 0100 1101 1 */ - { 11, 0x8, 1792 }, /* 0000 0001 000 */ - { 11, 0xC, 1856 }, /* 0000 0001 100 */ - { 11, 0xD, 1920 }, /* 0000 0001 101 */ - { 12, 0x12, 1984 }, /* 0000 0001 0010 */ - { 12, 0x13, 2048 }, /* 0000 0001 0011 */ - { 12, 0x14, 2112 }, /* 0000 0001 0100 */ - { 12, 0x15, 2176 }, /* 0000 0001 0101 */ - { 12, 0x16, 2240 }, /* 0000 0001 0110 */ - { 12, 0x17, 2304 }, /* 0000 0001 0111 */ - { 12, 0x1C, 2368 }, /* 0000 0001 1100 */ - { 12, 0x1D, 2432 }, /* 0000 0001 1101 */ - { 12, 0x1E, 2496 }, /* 0000 0001 1110 */ - { 12, 0x1F, 2560 }, /* 0000 0001 1111 */ - { 12, 0x1, G3CODE_EOL }, /* 0000 0000 0001 */ - { 9, 0x1, G3CODE_INVALID }, /* 0000 0000 1 */ - { 10, 0x1, G3CODE_INVALID }, /* 0000 0000 01 */ - { 11, 0x1, G3CODE_INVALID }, /* 0000 0000 001 */ - { 12, 0x0, G3CODE_INVALID }, /* 0000 0000 0000 */ -}; - -const tableentry TIFFFaxBlackCodes[] = { - { 10, 0x37, 0 }, /* 0000 1101 11 */ - { 3, 0x2, 1 }, /* 010 */ - { 2, 0x3, 2 }, /* 11 */ - { 2, 0x2, 3 }, /* 10 */ - { 3, 0x3, 4 }, /* 011 */ - { 4, 0x3, 5 }, /* 0011 */ - { 4, 0x2, 6 }, /* 0010 */ - { 5, 0x3, 7 }, /* 0001 1 */ - { 6, 0x5, 8 }, /* 0001 01 */ - { 6, 0x4, 9 }, /* 0001 00 */ - { 7, 0x4, 10 }, /* 0000 100 */ - { 7, 0x5, 11 }, /* 0000 101 */ - { 7, 0x7, 12 }, /* 0000 111 */ - { 8, 0x4, 13 }, /* 0000 0100 */ - { 8, 0x7, 14 }, /* 0000 0111 */ - { 9, 0x18, 15 }, /* 0000 1100 0 */ - { 10, 0x17, 16 }, /* 0000 0101 11 */ - { 10, 0x18, 17 }, /* 0000 0110 00 */ - { 10, 0x8, 18 }, /* 0000 0010 00 */ - { 11, 0x67, 19 }, /* 0000 1100 111 */ - { 11, 0x68, 20 }, /* 0000 1101 000 */ - { 11, 0x6C, 21 }, /* 0000 1101 100 */ - { 11, 0x37, 22 }, /* 0000 0110 111 */ - { 11, 0x28, 23 }, /* 0000 0101 000 */ - { 11, 0x17, 24 }, /* 0000 0010 111 */ - { 11, 0x18, 25 }, /* 0000 0011 000 */ - { 12, 0xCA, 26 }, /* 0000 1100 1010 */ - { 12, 0xCB, 27 }, /* 0000 1100 1011 */ - { 12, 0xCC, 28 }, /* 0000 1100 1100 */ - { 12, 0xCD, 29 }, /* 0000 1100 1101 */ - { 12, 0x68, 30 }, /* 0000 0110 1000 */ - { 12, 0x69, 31 }, /* 0000 0110 1001 */ - { 12, 0x6A, 32 }, /* 0000 0110 1010 */ - { 12, 0x6B, 33 }, /* 0000 0110 1011 */ - { 12, 0xD2, 34 }, /* 0000 1101 0010 */ - { 12, 0xD3, 35 }, /* 0000 1101 0011 */ - { 12, 0xD4, 36 }, /* 0000 1101 0100 */ - { 12, 0xD5, 37 }, /* 0000 1101 0101 */ - { 12, 0xD6, 38 }, /* 0000 1101 0110 */ - { 12, 0xD7, 39 }, /* 0000 1101 0111 */ - { 12, 0x6C, 40 }, /* 0000 0110 1100 */ - { 12, 0x6D, 41 }, /* 0000 0110 1101 */ - { 12, 0xDA, 42 }, /* 0000 1101 1010 */ - { 12, 0xDB, 43 }, /* 0000 1101 1011 */ - { 12, 0x54, 44 }, /* 0000 0101 0100 */ - { 12, 0x55, 45 }, /* 0000 0101 0101 */ - { 12, 0x56, 46 }, /* 0000 0101 0110 */ - { 12, 0x57, 47 }, /* 0000 0101 0111 */ - { 12, 0x64, 48 }, /* 0000 0110 0100 */ - { 12, 0x65, 49 }, /* 0000 0110 0101 */ - { 12, 0x52, 50 }, /* 0000 0101 0010 */ - { 12, 0x53, 51 }, /* 0000 0101 0011 */ - { 12, 0x24, 52 }, /* 0000 0010 0100 */ - { 12, 0x37, 53 }, /* 0000 0011 0111 */ - { 12, 0x38, 54 }, /* 0000 0011 1000 */ - { 12, 0x27, 55 }, /* 0000 0010 0111 */ - { 12, 0x28, 56 }, /* 0000 0010 1000 */ - { 12, 0x58, 57 }, /* 0000 0101 1000 */ - { 12, 0x59, 58 }, /* 0000 0101 1001 */ - { 12, 0x2B, 59 }, /* 0000 0010 1011 */ - { 12, 0x2C, 60 }, /* 0000 0010 1100 */ - { 12, 0x5A, 61 }, /* 0000 0101 1010 */ - { 12, 0x66, 62 }, /* 0000 0110 0110 */ - { 12, 0x67, 63 }, /* 0000 0110 0111 */ - { 10, 0xF, 64 }, /* 0000 0011 11 */ - { 12, 0xC8, 128 }, /* 0000 1100 1000 */ - { 12, 0xC9, 192 }, /* 0000 1100 1001 */ - { 12, 0x5B, 256 }, /* 0000 0101 1011 */ - { 12, 0x33, 320 }, /* 0000 0011 0011 */ - { 12, 0x34, 384 }, /* 0000 0011 0100 */ - { 12, 0x35, 448 }, /* 0000 0011 0101 */ - { 13, 0x6C, 512 }, /* 0000 0011 0110 0 */ - { 13, 0x6D, 576 }, /* 0000 0011 0110 1 */ - { 13, 0x4A, 640 }, /* 0000 0010 0101 0 */ - { 13, 0x4B, 704 }, /* 0000 0010 0101 1 */ - { 13, 0x4C, 768 }, /* 0000 0010 0110 0 */ - { 13, 0x4D, 832 }, /* 0000 0010 0110 1 */ - { 13, 0x72, 896 }, /* 0000 0011 1001 0 */ - { 13, 0x73, 960 }, /* 0000 0011 1001 1 */ - { 13, 0x74, 1024 }, /* 0000 0011 1010 0 */ - { 13, 0x75, 1088 }, /* 0000 0011 1010 1 */ - { 13, 0x76, 1152 }, /* 0000 0011 1011 0 */ - { 13, 0x77, 1216 }, /* 0000 0011 1011 1 */ - { 13, 0x52, 1280 }, /* 0000 0010 1001 0 */ - { 13, 0x53, 1344 }, /* 0000 0010 1001 1 */ - { 13, 0x54, 1408 }, /* 0000 0010 1010 0 */ - { 13, 0x55, 1472 }, /* 0000 0010 1010 1 */ - { 13, 0x5A, 1536 }, /* 0000 0010 1101 0 */ - { 13, 0x5B, 1600 }, /* 0000 0010 1101 1 */ - { 13, 0x64, 1664 }, /* 0000 0011 0010 0 */ - { 13, 0x65, 1728 }, /* 0000 0011 0010 1 */ - { 11, 0x8, 1792 }, /* 0000 0001 000 */ - { 11, 0xC, 1856 }, /* 0000 0001 100 */ - { 11, 0xD, 1920 }, /* 0000 0001 101 */ - { 12, 0x12, 1984 }, /* 0000 0001 0010 */ - { 12, 0x13, 2048 }, /* 0000 0001 0011 */ - { 12, 0x14, 2112 }, /* 0000 0001 0100 */ - { 12, 0x15, 2176 }, /* 0000 0001 0101 */ - { 12, 0x16, 2240 }, /* 0000 0001 0110 */ - { 12, 0x17, 2304 }, /* 0000 0001 0111 */ - { 12, 0x1C, 2368 }, /* 0000 0001 1100 */ - { 12, 0x1D, 2432 }, /* 0000 0001 1101 */ - { 12, 0x1E, 2496 }, /* 0000 0001 1110 */ - { 12, 0x1F, 2560 }, /* 0000 0001 1111 */ - { 12, 0x1, G3CODE_EOL }, /* 0000 0000 0001 */ - { 9, 0x1, G3CODE_INVALID }, /* 0000 0000 1 */ - { 10, 0x1, G3CODE_INVALID }, /* 0000 0000 01 */ - { 11, 0x1, G3CODE_INVALID }, /* 0000 0000 001 */ - { 12, 0x0, G3CODE_INVALID }, /* 0000 0000 0000 */ -}; -#else -extern const tableentry TIFFFaxWhiteCodes[]; -extern const tableentry TIFFFaxBlackCodes[]; -#endif -#endif /* _T4_ */ diff --git a/wxWidgets/src/tiff/tif_acorn.c b/wxWidgets/src/tiff/tif_acorn.c deleted file mode 100644 index 21458f0a45..0000000000 --- a/wxWidgets/src/tiff/tif_acorn.c +++ /dev/null @@ -1,519 +0,0 @@ -/* $Header$ */ - -/* - * Copyright (c) 1988-1997 Sam Leffler - * Copyright (c) 1991-1997 Silicon Graphics, Inc. - * - * Permission to use, copy, modify, distribute, and sell this software and - * its documentation for any purpose is hereby granted without fee, provided - * that (i) the above copyright notices and this permission notice appear in - * all copies of the software and related documentation, and (ii) the names of - * Sam Leffler and Silicon Graphics may not be used in any advertising or - * publicity relating to the software without the specific, prior written - * permission of Sam Leffler and Silicon Graphics. - * - * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, - * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * - * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR - * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, - * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF - * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE - * OF THIS SOFTWARE. - */ - -/* - * TIFF Library RISC OS specific Routines. - * Developed out of the Unix version. - * Peter Greenham, May 1995 - */ -#include "tiffiop.h" -#include -#include - -/* -Low-level file handling -~~~~~~~~~~~~~~~~~~~~~~~ -The functions in osfcn.h are unavailable when compiling under C, as it's a -C++ header. Therefore they have been implemented here. - -Now, why have I done it this way? - -The definitive API library for RISC OS is Jonathan Coxhead's OSLib, which -uses heavily optimised ARM assembler or even plain inline SWI calls for -maximum performance and minimum runtime size. However, I don't want to make -LIBTIFF need that to survive. Therefore I have also emulated the functions -using macros to _swi() and _swix() defined in the swis.h header, and -borrowing types from kernel.h, which is less efficient but doesn't need any -third-party libraries. - */ - -#ifdef INCLUDE_OSLIB - -#include "osfile.h" -#include "osgbpb.h" -#include "osargs.h" -#include "osfind.h" - -#else - -/* OSLIB EMULATION STARTS */ - -#include "kernel.h" -#include "swis.h" - -/* From oslib:types.h */ -typedef unsigned int bits; -typedef unsigned char byte; -#ifndef TRUE -#define TRUE 1 -#endif -#ifndef FALSE -#define FALSE 0 -#endif -#ifndef NULL -#define NULL 0 -#endif -#ifndef SKIP -#define SKIP 0 -#endif - -/* From oslib:os.h */ -typedef _kernel_oserror os_error; -typedef byte os_f; - -/* From oslib:osfile.h */ -#undef OS_File -#define OS_File 0x8 - -/* From oslib:osgbpb.h */ -#undef OS_GBPB -#define OS_GBPB 0xC -#undef OSGBPB_Write -#define OSGBPB_Write 0x2 -#undef OSGBPB_Read -#define OSGBPB_Read 0x4 - -extern os_error *xosgbpb_write (os_f file, - byte *data, - int size, - int *unwritten); -extern int osgbpb_write (os_f file, - byte *data, - int size); - -#define xosgbpb_write(file, data, size, unwritten) \ - (os_error*) _swix(OS_GBPB, _IN(0)|_IN(1)|_IN(2)|_IN(3)|_IN(4)|_OUT(3), \ - OSGBPB_WriteAt, \ - file, \ - data, \ - size, \ - unwritten) - -#define osgbpb_write(file, data, size) \ - _swi(OS_GBPB, _IN(0)|_IN(1)|_IN(2)|_IN(3)|_RETURN(3), \ - OSGBPB_Write, \ - file, \ - data, \ - size) - -extern os_error *xosgbpb_read (os_f file, - byte *buffer, - int size, - int *unread); -extern int osgbpb_read (os_f file, - byte *buffer, - int size); - -#define xosgbpb_read(file, buffer, size, unread) \ - (os_error*) _swix(OS_GBPB, _IN(0)|_IN(1)|_IN(2)|_IN(3)|_OUT(3), \ - OSGBPB_Read, \ - file, \ - buffer, \ - size, \ - unread) - -#define osgbpb_read(file, buffer, size) \ - _swi(OS_GBPB, _IN(0)|_IN(1)|_IN(2)|_IN(3)|_RETURN(3), \ - OSGBPB_Read, \ - file, \ - buffer, \ - size) - -/* From oslib:osfind.h */ -#undef OS_Find -#define OS_Find 0xD -#undef OSFind_Openin -#define OSFind_Openin 0x40 -#undef OSFind_Openout -#define OSFind_Openout 0x80 -#undef OSFind_Openup -#define OSFind_Openup 0xC0 -#undef OSFind_Close -#define OSFind_Close 0x0 - -#define xosfind_open(reason, file_name, path, file) \ - (os_error*) _swix(OS_Find, _IN(0)|_IN(1)|_IN(2)|_OUT(0), \ - reason, file_name, path, file) - -#define osfind_open(reason, file_name, path) \ - (os_f) _swi(OS_Find, _IN(0)|_IN(1)|_IN(2)|_RETURN(0), \ - reason, file_name, path) - -extern os_error *xosfind_openin (bits flags, - char *file_name, - char *path, - os_f *file); -extern os_f osfind_openin (bits flags, - char *file_name, - char *path); - -#define xosfind_openin(flags, file_name, path, file) \ - xosfind_open(flags | OSFind_Openin, file_name, path, file) - -#define osfind_openin(flags, file_name, path) \ - osfind_open(flags | OSFind_Openin, file_name, path) - -extern os_error *xosfind_openout (bits flags, - char *file_name, - char *path, - os_f *file); -extern os_f osfind_openout (bits flags, - char *file_name, - char *path); - -#define xosfind_openout(flags, file_name, path, file) \ - xosfind_open(flags | OSFind_Openout, file_name, path, file) - -#define osfind_openout(flags, file_name, path) \ - osfind_open(flags | OSFind_Openout, file_name, path) - -extern os_error *xosfind_openup (bits flags, - char *file_name, - char *path, - os_f *file); -extern os_f osfind_openup (bits flags, - char *file_name, - char *path); - -#define xosfind_openup(flags, file_name, path, file) \ - xosfind_open(flags | OSFind_Openup, file_name, path, file) - -#define osfind_openup(flags, file_name, path) \ - osfind_open(flags | OSFind_Openup, file_name, path) - -extern os_error *xosfind_close (os_f file); -extern void osfind_close (os_f file); - -#define xosfind_close(file) \ - (os_error*) _swix(OS_Find, _IN(0)|_IN(1), \ - OSFind_Close, \ - file) - -#define osfind_close(file) \ - (void) _swi(OS_Find, _IN(0)|_IN(1), \ - OSFind_Close, \ - file) - -/* From oslib:osargs.h */ -#undef OS_Args -#define OS_Args 0x9 -#undef OSArgs_ReadPtr -#define OSArgs_ReadPtr 0x0 -#undef OSArgs_SetPtr -#define OSArgs_SetPtr 0x1 -#undef OSArgs_ReadExt -#define OSArgs_ReadExt 0x2 - -extern os_error *xosargs_read_ptr (os_f file, - int *ptr); -extern int osargs_read_ptr (os_f file); - -#define xosargs_read_ptr(file, ptr) \ - (os_error*) _swix(OS_Args, _IN(0)|_IN(1)|_OUT(2), \ - OSArgs_ReadPtr, \ - file, \ - ptr) - -#define osargs_read_ptr(file) \ - _swi(OS_Args, _IN(0)|_IN(1)|_RETURN(2), \ - OSArgs_ReadPtr, \ - file) - -extern os_error *xosargs_set_ptr (os_f file, - int ptr); -extern void osargs_set_ptr (os_f file, - int ptr); - -#define xosargs_set_ptr(file, ptr) \ - (os_error*) _swix(OS_Args, _IN(0)|_IN(1)|_IN(2), \ - OSArgs_SetPtr, \ - file, \ - ptr) - -#define osargs_set_ptr(file, ptr) \ - (void) _swi(OS_Args, _IN(0)|_IN(1)|_IN(2), \ - OSArgs_SetPtr, \ - file, \ - ptr) - -extern os_error *xosargs_read_ext (os_f file, - int *ext); -extern int osargs_read_ext (os_f file); - -#define xosargs_read_ext(file, ext) \ - (os_error*) _swix(OS_Args, _IN(0)|_IN(1)|_OUT(2), \ - OSArgs_ReadExt, \ - file, \ - ext) - -#define osargs_read_ext(file) \ - _swi(OS_Args, _IN(0)|_IN(1)|_RETURN(2), \ - OSArgs_ReadExt, \ - file) - -/* OSLIB EMULATION ENDS */ - -#endif - -#ifndef __osfcn_h -/* Will be set or not during tiffcomp.h */ -/* You get this to compile under C++? Please say how! */ - -extern int open(const char* name, int flags, int mode) -{ - /* From what I can tell, should return <0 for failure */ - os_error* e = (os_error*) 1; /* Cheeky way to use a pointer eh? :-) */ - os_f file = (os_f) -1; - - flags = flags; - - switch(mode) - { - case O_RDONLY: - { - e = xosfind_openin(SKIP, name, SKIP, &file); - break; - } - case O_WRONLY: - case O_RDWR|O_CREAT: - case O_RDWR|O_CREAT|O_TRUNC: - { - e = xosfind_openout(SKIP, name, SKIP, &file); - break; - } - case O_RDWR: - { - e = xosfind_openup(SKIP, name, SKIP, &file); - break; - } - } - if (e) - { - file = (os_f) -1; - } - return (file); -} - -extern int close(int fd) -{ - return ((int) xosfind_close((os_f) fd)); -} - -extern int write(int fd, const char *buf, int nbytes) -{ - /* Returns number of bytes written */ - return (nbytes - osgbpb_write((os_f) fd, (const byte*) buf, nbytes)); -} - -extern int read(int fd, char *buf, int nbytes) -{ - /* Returns number of bytes read */ - return (nbytes - osgbpb_read((os_f) fd, (byte*) buf, nbytes)); -} - -extern off_t lseek(int fd, off_t offset, int whence) -{ - int absolute = 0; - - switch (whence) - { - case SEEK_SET: - { - absolute = (int) offset; - break; - } - case SEEK_CUR: - { - absolute = osargs_read_ptr((os_f) fd) + (int) offset; - break; - } - case SEEK_END: - { - absolute = osargs_read_ext((os_f) fd) + (int) offset; - break; - } - } - - osargs_set_ptr((os_f) fd, absolute); - - return ((off_t) osargs_read_ptr((os_f) fd)); -} -#endif - -static tsize_t -_tiffReadProc(thandle_t fd, tdata_t buf, tsize_t size) -{ - return ((tsize_t) read((int) fd, buf, (size_t) size)); -} - -static tsize_t -_tiffWriteProc(thandle_t fd, tdata_t buf, tsize_t size) -{ - return ((tsize_t) write((int) fd, buf, (size_t) size)); -} - -static toff_t -_tiffSeekProc(thandle_t fd, toff_t off, int whence) -{ - return ((toff_t) lseek((int) fd, (off_t) off, whence)); -} - -static int -_tiffCloseProc(thandle_t fd) -{ - return (close((int) fd)); -} - -static toff_t -_tiffSizeProc(thandle_t fd) -{ - return (lseek((int) fd, SEEK_END, SEEK_SET)); -} - -#ifdef HAVE_MMAP -#error "I didn't know Acorn had that!" -#endif - -/* !HAVE_MMAP */ -static int -_tiffMapProc(thandle_t fd, tdata_t* pbase, toff_t* psize) -{ - (void) fd; (void) pbase; (void) psize; - return (0); -} - -static void -_tiffUnmapProc(thandle_t fd, tdata_t base, toff_t size) -{ - (void) fd; (void) base; (void) size; -} - -/* - * Open a TIFF file descriptor for read/writing. - */ -TIFF* -TIFFFdOpen(int fd, const char* name, const char* mode) -{ - TIFF* tif; - - tif = TIFFClientOpen(name, mode, - (thandle_t) fd, - _tiffReadProc, _tiffWriteProc, - _tiffSeekProc, _tiffCloseProc, _tiffSizeProc, - _tiffMapProc, _tiffUnmapProc); - if (tif) - { - tif->tif_fd = fd; - } - return (tif); -} - -/* - * Open a TIFF file for read/writing. - */ -TIFF* -TIFFOpen(const char* name, const char* mode) -{ - static const char module[] = "TIFFOpen"; - int m, fd; - - m = _TIFFgetMode(mode, module); - - if (m == -1) - { - return ((TIFF*) 0); - } - - fd = open(name, 0, m); - - if (fd < 0) - { - TIFFError(module, "%s: Cannot open", name); - return ((TIFF *)0); - } - return (TIFFFdOpen(fd, name, mode)); -} - -void* -_TIFFmalloc(tsize_t s) -{ - return (malloc((size_t) s)); -} - -void -_TIFFfree(tdata_t p) -{ - free(p); -} - -void* -_TIFFrealloc(tdata_t p, tsize_t s) -{ - return (realloc(p, (size_t) s)); -} - -void -_TIFFmemset(tdata_t p, int v, tsize_t c) -{ - memset(p, v, (size_t) c); -} - -void -_TIFFmemcpy(tdata_t d, const tdata_t s, tsize_t c) -{ - memcpy(d, s, (size_t) c); -} - -int -_TIFFmemcmp(const tdata_t p1, const tdata_t p2, tsize_t c) -{ - return (memcmp(p1, p2, (size_t) c)); -} - -static void -acornWarningHandler(const char* module, const char* fmt, va_list ap) -{ - if (module != NULL) - { - fprintf(stderr, "%s: ", module); - } - fprintf(stderr, "Warning, "); - vfprintf(stderr, fmt, ap); - fprintf(stderr, ".\n"); -} -TIFFErrorHandler _TIFFwarningHandler = acornWarningHandler; - -static void -acornErrorHandler(const char* module, const char* fmt, va_list ap) -{ - if (module != NULL) - { - fprintf(stderr, "%s: ", module); - } - vfprintf(stderr, fmt, ap); - fprintf(stderr, ".\n"); -} -TIFFErrorHandler _TIFFerrorHandler = acornErrorHandler; diff --git a/wxWidgets/src/tiff/tif_apple.c b/wxWidgets/src/tiff/tif_apple.c deleted file mode 100644 index 86cf215451..0000000000 --- a/wxWidgets/src/tiff/tif_apple.c +++ /dev/null @@ -1,274 +0,0 @@ -/* $Header$ */ - -/* - * Copyright (c) 1988-1997 Sam Leffler - * Copyright (c) 1991-1997 Silicon Graphics, Inc. - * - * Permission to use, copy, modify, distribute, and sell this software and - * its documentation for any purpose is hereby granted without fee, provided - * that (i) the above copyright notices and this permission notice appear in - * all copies of the software and related documentation, and (ii) the names of - * Sam Leffler and Silicon Graphics may not be used in any advertising or - * publicity relating to the software without the specific, prior written - * permission of Sam Leffler and Silicon Graphics. - * - * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, - * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * - * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR - * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, - * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF - * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE - * OF THIS SOFTWARE. - */ - -/* - * TIFF Library Macintosh-specific routines. - * - * These routines use only Toolbox and high-level File Manager traps. - * They make no calls to the THINK C "unix" compatibility library. Also, - * malloc is not used directly but it is still referenced internally by - * the ANSI library in rare cases. Heap fragmentation by the malloc ring - * buffer is therefore minimized. - * - * O_RDONLY and O_RDWR are treated identically here. The tif_mode flag is - * checked in TIFFWriteCheck(). - * - * Create below fills in a blank creator signature and sets the file type - * to 'TIFF'. It is much better for the application to do this by Create'ing - * the file first and TIFFOpen'ing it later. - * --------- - * This code has been "Carbonized", and may not work with older MacOS versions. - * If so, grab the tif_apple.c out of an older libtiff distribution, like - * 3.5.5 from www.libtiff.org. - */ - -#include "tiffiop.h" -#include -#include -#include -#include - -#if defined(__PPCC__) || defined(__SC__) || defined(__MRC__) || defined(applec) -#define CtoPstr c2pstr -#endif - -static tsize_t -_tiffReadProc(thandle_t fd, tdata_t buf, tsize_t size) -{ - return (FSRead((short) fd, (long*) &size, (char*) buf) == noErr ? - size : (tsize_t) -1); -} - -static tsize_t -_tiffWriteProc(thandle_t fd, tdata_t buf, tsize_t size) -{ - return (FSWrite((short) fd, (long*) &size, (char*) buf) == noErr ? - size : (tsize_t) -1); -} - -static toff_t -_tiffSeekProc(thandle_t fd, toff_t off, int whence) -{ - long fpos, size; - - if (GetEOF((short) fd, &size) != noErr) - return EOF; - (void) GetFPos((short) fd, &fpos); - - switch (whence) { - case SEEK_CUR: - if (off + fpos > size) - SetEOF((short) fd, off + fpos); - if (SetFPos((short) fd, fsFromMark, off) != noErr) - return EOF; - break; - case SEEK_END: - if (off > 0) - SetEOF((short) fd, off + size); - if (SetFPos((short) fd, fsFromStart, off + size) != noErr) - return EOF; - break; - case SEEK_SET: - if (off > size) - SetEOF((short) fd, off); - if (SetFPos((short) fd, fsFromStart, off) != noErr) - return EOF; - break; - } - - return (toff_t)(GetFPos((short) fd, &fpos) == noErr ? fpos : EOF); -} - -static int -_tiffMapProc(thandle_t fd, tdata_t* pbase, toff_t* psize) -{ - return (0); -} - -static void -_tiffUnmapProc(thandle_t fd, tdata_t base, toff_t size) -{ -} - -static int -_tiffCloseProc(thandle_t fd) -{ - return (FSClose((short) fd)); -} - -static toff_t -_tiffSizeProc(thandle_t fd) -{ - long size; - - if (GetEOF((short) fd, &size) != noErr) { - TIFFError("_tiffSizeProc", "%s: Cannot get file size"); - return (-1L); - } - return ((toff_t) size); -} - -/* - * Open a TIFF file descriptor for read/writing. - */ -TIFF* -TIFFFdOpen(int fd, const char* name, const char* mode) -{ - TIFF* tif; - - tif = TIFFClientOpen(name, mode, (thandle_t) fd, - _tiffReadProc, _tiffWriteProc, _tiffSeekProc, _tiffCloseProc, - _tiffSizeProc, _tiffMapProc, _tiffUnmapProc); - if (tif) - tif->tif_fd = fd; - return (tif); -} - -static void ourc2pstr( char* inString ) -{ - int sLen = strlen( inString ); - BlockMoveData( inString, &inString[1], sLen ); - inString[0] = sLen; -} - -/* - * Open a TIFF file for read/writing. - */ -TIFF* -TIFFOpen(const char* name, const char* mode) -{ - static const char module[] = "TIFFOpen"; - Str255 pname; - FInfo finfo; - short fref; - OSErr err; - FSSpec fSpec; - - strcpy((char*) pname, name); - ourc2pstr((char*) pname); - - err = FSMakeFSSpec( 0, 0, pname, &fSpec ); - - switch (_TIFFgetMode(mode, module)) { - default: - return ((TIFF*) 0); - case O_RDWR | O_CREAT | O_TRUNC: - if (FSpGetFInfo(&fSpec, &finfo) == noErr) - FSpDelete(&fSpec); - /* fall through */ - case O_RDWR | O_CREAT: - if ((err = FSpGetFInfo(&fSpec, &finfo)) == fnfErr) { - if (FSpCreate(&fSpec, ' ', 'TIFF', smSystemScript) != noErr) - goto badCreate; - if (FSpOpenDF(&fSpec, fsRdWrPerm, &fref) != noErr) - goto badOpen; - } else if (err == noErr) { - if (FSpOpenDF(&fSpec, fsRdWrPerm, &fref) != noErr) - goto badOpen; - } else - goto badOpen; - break; - case O_RDONLY: - if (FSpOpenDF(&fSpec, fsRdPerm, &fref) != noErr) - goto badOpen; - break; - case O_RDWR: - if (FSpOpenDF(&fSpec, fsRdWrPerm, &fref) != noErr) - goto badOpen; - break; - } - return (TIFFFdOpen((int) fref, name, mode)); -badCreate: - TIFFError(module, "%s: Cannot create", name); - return ((TIFF*) 0); -badOpen: - TIFFError(module, "%s: Cannot open", name); - return ((TIFF*) 0); -} - -void -_TIFFmemset(tdata_t p, int v, tsize_t c) -{ - memset(p, v, (size_t) c); -} - -void -_TIFFmemcpy(tdata_t d, const tdata_t s, tsize_t c) -{ - memcpy(d, s, (size_t) c); -} - -int -_TIFFmemcmp(const tdata_t p1, const tdata_t p2, tsize_t c) -{ - return (memcmp(p1, p2, (size_t) c)); -} - -tdata_t -_TIFFmalloc(tsize_t s) -{ - return (NewPtr((size_t) s)); -} - -void -_TIFFfree(tdata_t p) -{ - DisposePtr(p); -} - -tdata_t -_TIFFrealloc(tdata_t p, tsize_t s) -{ - Ptr n = p; - - SetPtrSize(p, (size_t) s); - if (MemError() && (n = NewPtr((size_t) s)) != NULL) { - BlockMove(p, n, GetPtrSize(p)); - DisposePtr(p); - } - return ((tdata_t) n); -} - -static void -appleWarningHandler(const char* module, const char* fmt, va_list ap) -{ - if (module != NULL) - fprintf(stderr, "%s: ", module); - fprintf(stderr, "Warning, "); - vfprintf(stderr, fmt, ap); - fprintf(stderr, ".\n"); -} -TIFFErrorHandler _TIFFwarningHandler = appleWarningHandler; - -static void -appleErrorHandler(const char* module, const char* fmt, va_list ap) -{ - if (module != NULL) - fprintf(stderr, "%s: ", module); - vfprintf(stderr, fmt, ap); - fprintf(stderr, ".\n"); -} -TIFFErrorHandler _TIFFerrorHandler = appleErrorHandler; diff --git a/wxWidgets/src/tiff/tif_atari.c b/wxWidgets/src/tiff/tif_atari.c deleted file mode 100644 index 2c3efc865b..0000000000 --- a/wxWidgets/src/tiff/tif_atari.c +++ /dev/null @@ -1,243 +0,0 @@ -/* "$Header$" */ - -/* - * Copyright (c) 1988-1997 Sam Leffler - * Copyright (c) 1991-1997 Silicon Graphics, Inc. - * - * Permission to use, copy, modify, distribute, and sell this software and - * its documentation for any purpose is hereby granted without fee, provided - * that (i) the above copyright notices and this permission notice appear in - * all copies of the software and related documentation, and (ii) the names of - * Sam Leffler and Silicon Graphics may not be used in any advertising or - * publicity relating to the software without the specific, prior written - * permission of Sam Leffler and Silicon Graphics. - * - * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, - * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * - * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR - * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, - * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF - * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE - * OF THIS SOFTWARE. - */ - -/* - * TIFF Library ATARI-specific Routines. - */ -#include "tiffiop.h" -#if defined(__TURBOC__) -#include -#include -#else -#include -#include -#endif - -#ifndef O_ACCMODE -#define O_ACCMODE 3 -#endif - -#include - -#define AEFILNF -33 - -static tsize_t -_tiffReadProc(thandle_t fd, tdata_t buf, tsize_t size) -{ - long r; - - r = Fread((int) fd, size, buf); - if (r < 0) { - errno = (int)-r; - r = -1; - } - return r; -} - -static tsize_t -_tiffWriteProc(thandle_t fd, tdata_t buf, tsize_t size) -{ - long r; - - r = Fwrite((int) fd, size, buf); - if (r < 0) { - errno = (int)-r; - r = -1; - } - return r; -} - -static toff_t -_tiffSeekProc(thandle_t fd, off_t off, int whence) -{ - char buf[256]; - long current_off, expected_off, new_off; - - if (whence == SEEK_END || off <= 0) - return Fseek(off, (int) fd, whence); - current_off = Fseek(0, (int) fd, SEEK_CUR); /* find out where we are */ - if (whence == SEEK_SET) - expected_off = off; - else - expected_off = off + current_off; - new_off = Fseek(off, (int) fd, whence); - if (new_off == expected_off) - return new_off; - /* otherwise extend file -- zero filling the hole */ - if (new_off < 0) /* error? */ - new_off = Fseek(0, (int) fd, SEEK_END); /* go to eof */ - _TIFFmemset(buf, 0, sizeof(buf)); - while (expected_off > new_off) { - off = expected_off - new_off; - if (off > sizeof(buf)) - off = sizeof(buf); - if ((current_off = Fwrite((int) fd, off, buf)) != off) - return (current_off > 0) ? - new_off + current_off : new_off; - new_off += off; - } - return new_off; -} - -static int -_tiffCloseProc(thandle_t fd) -{ - long r; - - r = Fclose((int) fd); - if (r < 0) { - errno = (int)-r; - r = -1; - } - return (int)r; -} - -static toff_t -_tiffSizeProc(thandle_t fd) -{ - long pos, eof; - - pos = Fseek(0, (int) fd, SEEK_CUR); - eof = Fseek(0, (int) fd, SEEK_END); - Fseek(pos, (int) fd, SEEK_SET); - return eof; -} - -static int -_tiffMapProc(thandle_t fd, tdata_t* pbase, toff_t* psize) -{ - return (0); -} - -static void -_tiffUnmapProc(thandle_t fd, tdata_t base, toff_t size) -{ -} - -/* -* Open a TIFF file descriptor for read/writing. -*/ -TIFF* -TIFFFdOpen(int fd, const char* name, const char* mode) -{ - TIFF* tif; - - tif = TIFFClientOpen(name, mode, - (thandle_t) fd, - _tiffReadProc, _tiffWriteProc, _tiffSeekProc, _tiffCloseProc, - _tiffSizeProc, _tiffMapProc, _tiffUnmapProc); - if (tif) - tif->tif_fd = fd; - return (tif); -} - -/* -* Open a TIFF file for read/writing. -*/ -TIFF* -TIFFOpen(const char* name, const char* mode) -{ - static const char module[] = "TIFFOpen"; - int m; - long fd; - - m = _TIFFgetMode(mode, module); - if (m == -1) - return ((TIFF*)0); - if (m & O_TRUNC) { - fd = Fcreate(name, 0); - } else { - fd = Fopen(name, m & O_ACCMODE); - if (fd == AEFILNF && m & O_CREAT) - fd = Fcreate(name, 0); - } - if (fd < 0) - errno = (int)fd; - if (fd < 0) { - TIFFError(module, "%s: Cannot open", name); - return ((TIFF*)0); - } - return (TIFFFdOpen(fd, name, mode)); -} - -#include - -tdata_t -_TIFFmalloc(tsize_t s) -{ - return (malloc((size_t) s)); -} - -void -_TIFFfree(tdata_t p) -{ - free(p); -} - -tdata_t -_TIFFrealloc(tdata_t p, tsize_t s) -{ - return (realloc(p, (size_t) s)); -} - -void -_TIFFmemset(tdata_t p, int v, size_t c) -{ - memset(p, v, (size_t) c); -} - -void -_TIFFmemcpy(tdata_t d, const tdata_t s, size_t c) -{ - memcpy(d, s, (size_t) c); -} - -int -_TIFFmemcmp(const tdata_t p1, const tdata_t p2, tsize_t c) -{ - return (memcmp(p1, p2, (size_t) c)); -} - -static void -atariWarningHandler(const char* module, const char* fmt, va_list ap) -{ - if (module != NULL) - fprintf(stderr, "%s: ", module); - fprintf(stderr, "Warning, "); - vfprintf(stderr, fmt, ap); - fprintf(stderr, ".\n"); -} -TIFFErrorHandler _TIFFwarningHandler = atariWarningHandler; - -static void -atariErrorHandler(const char* module, const char* fmt, va_list ap) -{ - if (module != NULL) - fprintf(stderr, "%s: ", module); - vfprintf(stderr, fmt, ap); - fprintf(stderr, ".\n"); -} -TIFFErrorHandler _TIFFerrorHandler = atariErrorHandler; diff --git a/wxWidgets/src/tiff/tif_aux.c b/wxWidgets/src/tiff/tif_aux.c deleted file mode 100644 index e3f6e39a55..0000000000 --- a/wxWidgets/src/tiff/tif_aux.c +++ /dev/null @@ -1,248 +0,0 @@ -/* $Header$ */ - -/* - * Copyright (c) 1991-1997 Sam Leffler - * Copyright (c) 1991-1997 Silicon Graphics, Inc. - * - * Permission to use, copy, modify, distribute, and sell this software and - * its documentation for any purpose is hereby granted without fee, provided - * that (i) the above copyright notices and this permission notice appear in - * all copies of the software and related documentation, and (ii) the names of - * Sam Leffler and Silicon Graphics may not be used in any advertising or - * publicity relating to the software without the specific, prior written - * permission of Sam Leffler and Silicon Graphics. - * - * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, - * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * - * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR - * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, - * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF - * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE - * OF THIS SOFTWARE. - */ - -/* - * TIFF Library. - * - * Auxiliary Support Routines. - */ -#include "tiffiop.h" -#include "tif_predict.h" -#include - -static int -TIFFDefaultTransferFunction(TIFFDirectory* td) -{ - uint16 **tf = td->td_transferfunction; - tsize_t i, n, nbytes; - - tf[0] = tf[1] = tf[2] = 0; - if (td->td_bitspersample >= sizeof(tsize_t) * 8 - 2) - return 0; - - n = 1<td_bitspersample; - nbytes = n * sizeof (uint16); - if (!(tf[0] = (uint16 *)_TIFFmalloc(nbytes))) - return 0; - tf[0][0] = 0; - for (i = 1; i < n; i++) { - double t = (double)i/((double) n-1.); - tf[0][i] = (uint16)floor(65535.*pow(t, 2.2) + .5); - } - - if (td->td_samplesperpixel - td->td_extrasamples > 1) { - if (!(tf[1] = (uint16 *)_TIFFmalloc(nbytes))) - goto bad; - _TIFFmemcpy(tf[1], tf[0], nbytes); - if (!(tf[2] = (uint16 *)_TIFFmalloc(nbytes))) - goto bad; - _TIFFmemcpy(tf[2], tf[0], nbytes); - } - return 1; - -bad: - if (tf[0]) - _TIFFfree(tf[0]); - if (tf[1]) - _TIFFfree(tf[1]); - if (tf[2]) - _TIFFfree(tf[2]); - tf[0] = tf[1] = tf[2] = 0; - return 0; -} - -static int -TIFFDefaultRefBlackWhite(TIFFDirectory* td) -{ - int i; - - if (!(td->td_refblackwhite = (float *)_TIFFmalloc(6*sizeof (float)))) - return 0; - for (i = 0; i < 3; i++) { - td->td_refblackwhite[2*i+0] = 0; - td->td_refblackwhite[2*i+1] = (float)((1L<td_bitspersample)-1L); - } - return 1; -} - -/* - * Like TIFFGetField, but return any default - * value if the tag is not present in the directory. - * - * NB: We use the value in the directory, rather than - * explcit values so that defaults exist only one - * place in the library -- in TIFFDefaultDirectory. - */ -int -TIFFVGetFieldDefaulted(TIFF* tif, ttag_t tag, va_list ap) -{ - TIFFDirectory *td = &tif->tif_dir; - - if (TIFFVGetField(tif, tag, ap)) - return (1); - switch (tag) { - case TIFFTAG_SUBFILETYPE: - *va_arg(ap, uint32 *) = td->td_subfiletype; - return (1); - case TIFFTAG_BITSPERSAMPLE: - *va_arg(ap, uint16 *) = td->td_bitspersample; - return (1); - case TIFFTAG_THRESHHOLDING: - *va_arg(ap, uint16 *) = td->td_threshholding; - return (1); - case TIFFTAG_FILLORDER: - *va_arg(ap, uint16 *) = td->td_fillorder; - return (1); - case TIFFTAG_ORIENTATION: - *va_arg(ap, uint16 *) = td->td_orientation; - return (1); - case TIFFTAG_SAMPLESPERPIXEL: - *va_arg(ap, uint16 *) = td->td_samplesperpixel; - return (1); - case TIFFTAG_ROWSPERSTRIP: - *va_arg(ap, uint32 *) = td->td_rowsperstrip; - return (1); - case TIFFTAG_MINSAMPLEVALUE: - *va_arg(ap, uint16 *) = td->td_minsamplevalue; - return (1); - case TIFFTAG_MAXSAMPLEVALUE: - *va_arg(ap, uint16 *) = td->td_maxsamplevalue; - return (1); - case TIFFTAG_PLANARCONFIG: - *va_arg(ap, uint16 *) = td->td_planarconfig; - return (1); - case TIFFTAG_RESOLUTIONUNIT: - *va_arg(ap, uint16 *) = td->td_resolutionunit; - return (1); - case TIFFTAG_PREDICTOR: - { - TIFFPredictorState* sp = (TIFFPredictorState*) tif->tif_data; - *va_arg(ap, uint16*) = (uint16) sp->predictor; - return (1); - } - case TIFFTAG_DOTRANGE: - *va_arg(ap, uint16 *) = 0; - *va_arg(ap, uint16 *) = (1<td_bitspersample)-1; - return (1); - case TIFFTAG_INKSET: - *va_arg(ap, uint16 *) = td->td_inkset; - return (1); - case TIFFTAG_NUMBEROFINKS: - *va_arg(ap, uint16 *) = td->td_ninks; - return (1); - case TIFFTAG_EXTRASAMPLES: - *va_arg(ap, uint16 *) = td->td_extrasamples; - *va_arg(ap, uint16 **) = td->td_sampleinfo; - return (1); - case TIFFTAG_MATTEING: - *va_arg(ap, uint16 *) = - (td->td_extrasamples == 1 && - td->td_sampleinfo[0] == EXTRASAMPLE_ASSOCALPHA); - return (1); - case TIFFTAG_TILEDEPTH: - *va_arg(ap, uint32 *) = td->td_tiledepth; - return (1); - case TIFFTAG_DATATYPE: - *va_arg(ap, uint16 *) = td->td_sampleformat-1; - return (1); - case TIFFTAG_SAMPLEFORMAT: - *va_arg(ap, uint16 *) = td->td_sampleformat; - return(1); - case TIFFTAG_IMAGEDEPTH: - *va_arg(ap, uint32 *) = td->td_imagedepth; - return (1); - case TIFFTAG_YCBCRCOEFFICIENTS: - if (!td->td_ycbcrcoeffs) { - td->td_ycbcrcoeffs = (float *) - _TIFFmalloc(3*sizeof (float)); - if (!td->td_ycbcrcoeffs) - return (0); - /* defaults are from CCIR Recommendation 601-1 */ - td->td_ycbcrcoeffs[0] = 0.299f; - td->td_ycbcrcoeffs[1] = 0.587f; - td->td_ycbcrcoeffs[2] = 0.114f; - } - *va_arg(ap, float **) = td->td_ycbcrcoeffs; - return (1); - case TIFFTAG_YCBCRSUBSAMPLING: - *va_arg(ap, uint16 *) = td->td_ycbcrsubsampling[0]; - *va_arg(ap, uint16 *) = td->td_ycbcrsubsampling[1]; - return (1); - case TIFFTAG_YCBCRPOSITIONING: - *va_arg(ap, uint16 *) = td->td_ycbcrpositioning; - return (1); - case TIFFTAG_WHITEPOINT: - if (!td->td_whitepoint) { - td->td_whitepoint = (float *) - _TIFFmalloc(2 * sizeof (float)); - if (!td->td_whitepoint) - return (0); - /* TIFF 6.0 specification says that it is no default - value for the WhitePoint, but AdobePhotoshop TIFF - Technical Note tells that it should be CIE D50. */ - td->td_whitepoint[0] = - D50_X0 / (D50_X0 + D50_Y0 + D50_Z0); - td->td_whitepoint[1] = - D50_Y0 / (D50_X0 + D50_Y0 + D50_Z0); - } - *va_arg(ap, float **) = td->td_whitepoint; - return (1); - case TIFFTAG_TRANSFERFUNCTION: - if (!td->td_transferfunction[0] && - !TIFFDefaultTransferFunction(td)) { - TIFFError(tif->tif_name, "No space for \"TransferFunction\" tag"); - return (0); - } - *va_arg(ap, uint16 **) = td->td_transferfunction[0]; - if (td->td_samplesperpixel - td->td_extrasamples > 1) { - *va_arg(ap, uint16 **) = td->td_transferfunction[1]; - *va_arg(ap, uint16 **) = td->td_transferfunction[2]; - } - return (1); - case TIFFTAG_REFERENCEBLACKWHITE: - if (!td->td_refblackwhite && !TIFFDefaultRefBlackWhite(td)) - return (0); - *va_arg(ap, float **) = td->td_refblackwhite; - return (1); - } - return (0); -} - -/* - * Like TIFFGetField, but return any default - * value if the tag is not present in the directory. - */ -int -TIFFGetFieldDefaulted(TIFF* tif, ttag_t tag, ...) -{ - int ok; - va_list ap; - - va_start(ap, tag); - ok = TIFFVGetFieldDefaulted(tif, tag, ap); - va_end(ap); - return (ok); -} diff --git a/wxWidgets/src/tiff/tif_close.c b/wxWidgets/src/tiff/tif_close.c deleted file mode 100644 index ab7c628115..0000000000 --- a/wxWidgets/src/tiff/tif_close.c +++ /dev/null @@ -1,80 +0,0 @@ -/* $Header$ */ - -/* - * Copyright (c) 1988-1997 Sam Leffler - * Copyright (c) 1991-1997 Silicon Graphics, Inc. - * - * Permission to use, copy, modify, distribute, and sell this software and - * its documentation for any purpose is hereby granted without fee, provided - * that (i) the above copyright notices and this permission notice appear in - * all copies of the software and related documentation, and (ii) the names of - * Sam Leffler and Silicon Graphics may not be used in any advertising or - * publicity relating to the software without the specific, prior written - * permission of Sam Leffler and Silicon Graphics. - * - * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, - * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * - * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR - * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, - * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF - * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE - * OF THIS SOFTWARE. - */ - -/* - * TIFF Library. - */ -#include "tiffiop.h" - -void -TIFFClose(TIFF* tif) -{ - if (tif->tif_mode != O_RDONLY) - /* - * Flush buffered data and directory (if dirty). - */ - TIFFFlush(tif); - (*tif->tif_cleanup)(tif); - TIFFFreeDirectory(tif); - - if (tif->tif_dirlist) - _TIFFfree(tif->tif_dirlist); - - /* Clean up client info links */ - while( tif->tif_clientinfo ) - { - TIFFClientInfoLink *link = tif->tif_clientinfo; - - tif->tif_clientinfo = link->next; - _TIFFfree( link->name ); - _TIFFfree( link ); - } - - if (tif->tif_rawdata && (tif->tif_flags&TIFF_MYBUFFER)) - _TIFFfree(tif->tif_rawdata); - if (isMapped(tif)) - TIFFUnmapFileContents(tif, tif->tif_base, tif->tif_size); - (void) TIFFCloseFile(tif); - if (tif->tif_nfields > 0) - { - int i; - - for (i = 0; i < tif->tif_nfields; i++) - { - TIFFFieldInfo *fld = tif->tif_fieldinfo[i]; - if (fld->field_bit == FIELD_CUSTOM && - strncmp("Tag ", fld->field_name, 4) == 0) - { - _TIFFfree(fld->field_name); - _TIFFfree(fld); - } - } - - _TIFFfree(tif->tif_fieldinfo); - } - - _TIFFfree(tif); -} diff --git a/wxWidgets/src/tiff/tif_codec.c b/wxWidgets/src/tiff/tif_codec.c deleted file mode 100644 index cb9f6d7021..0000000000 --- a/wxWidgets/src/tiff/tif_codec.c +++ /dev/null @@ -1,150 +0,0 @@ -/* $Header$ */ - -/* - * Copyright (c) 1988-1997 Sam Leffler - * Copyright (c) 1991-1997 Silicon Graphics, Inc. - * - * Permission to use, copy, modify, distribute, and sell this software and - * its documentation for any purpose is hereby granted without fee, provided - * that (i) the above copyright notices and this permission notice appear in - * all copies of the software and related documentation, and (ii) the names of - * Sam Leffler and Silicon Graphics may not be used in any advertising or - * publicity relating to the software without the specific, prior written - * permission of Sam Leffler and Silicon Graphics. - * - * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, - * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * - * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR - * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, - * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF - * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE - * OF THIS SOFTWARE. - */ - -/* - * TIFF Library - * - * Builtin Compression Scheme Configuration Support. - */ -#include "tiffiop.h" - -static int NotConfigured(TIFF*, int); - -#ifndef LZW_SUPPORT -#define TIFFInitLZW NotConfigured -#endif -#ifndef PACKBITS_SUPPORT -#define TIFFInitPackbits NotConfigured -#endif -#ifndef THUNDER_SUPPORT -#define TIFFInitThunderScan NotConfigured -#endif -#ifndef NEXT_SUPPORT -#define TIFFInitNeXT NotConfigured -#endif -#ifndef JPEG_SUPPORT -#define TIFFInitJPEG NotConfigured -#endif -#ifndef OJPEG_SUPPORT -#define TIFFInitOJPEG NotConfigured -#endif -#ifndef CCITT_SUPPORT -#define TIFFInitCCITTRLE NotConfigured -#define TIFFInitCCITTRLEW NotConfigured -#define TIFFInitCCITTFax3 NotConfigured -#define TIFFInitCCITTFax4 NotConfigured -#endif -#ifndef JBIG_SUPPORT -#define TIFFInitJBIG NotConfigured -#endif -#ifndef ZIP_SUPPORT -#define TIFFInitZIP NotConfigured -#endif -#ifndef PIXARLOG_SUPPORT -#define TIFFInitPixarLog NotConfigured -#endif -#ifndef LOGLUV_SUPPORT -#define TIFFInitSGILog NotConfigured -#endif - -/* - * Compression schemes statically built into the library. - */ -#ifdef VMS -const TIFFCodec _TIFFBuiltinCODECS[] = { -#else -TIFFCodec _TIFFBuiltinCODECS[] = { -#endif - { "None", COMPRESSION_NONE, TIFFInitDumpMode }, - { "LZW", COMPRESSION_LZW, TIFFInitLZW }, - { "PackBits", COMPRESSION_PACKBITS, TIFFInitPackBits }, - { "ThunderScan", COMPRESSION_THUNDERSCAN,TIFFInitThunderScan }, - { "NeXT", COMPRESSION_NEXT, TIFFInitNeXT }, - { "JPEG", COMPRESSION_JPEG, TIFFInitJPEG }, - { "Old-style JPEG", COMPRESSION_OJPEG, TIFFInitOJPEG }, - { "CCITT RLE", COMPRESSION_CCITTRLE, TIFFInitCCITTRLE }, - { "CCITT RLE/W", COMPRESSION_CCITTRLEW, TIFFInitCCITTRLEW }, - { "CCITT Group 3", COMPRESSION_CCITTFAX3, TIFFInitCCITTFax3 }, - { "CCITT Group 4", COMPRESSION_CCITTFAX4, TIFFInitCCITTFax4 }, - { "ISO JBIG", COMPRESSION_JBIG, TIFFInitJBIG }, - { "Deflate", COMPRESSION_DEFLATE, TIFFInitZIP }, - { "AdobeDeflate", COMPRESSION_ADOBE_DEFLATE , TIFFInitZIP }, - { "PixarLog", COMPRESSION_PIXARLOG, TIFFInitPixarLog }, - { "SGILog", COMPRESSION_SGILOG, TIFFInitSGILog }, - { "SGILog24", COMPRESSION_SGILOG24, TIFFInitSGILog }, - { NULL } -}; - -static int -_notConfigured(TIFF* tif) -{ - const TIFFCodec* c = TIFFFindCODEC(tif->tif_dir.td_compression); - - TIFFError(tif->tif_name, - "%s compression support is not configured", c->name); - return (0); -} - -static int -NotConfigured(TIFF* tif, int scheme) -{ - (void) scheme; - - tif->tif_decodestatus = FALSE; - tif->tif_setupdecode = _notConfigured; - tif->tif_encodestatus = FALSE; - tif->tif_setupencode = _notConfigured; - return (1); -} - -/************************************************************************/ -/* TIFFIsCODECConfigured() */ -/************************************************************************/ - -/** - * Check whether we have working codec for the specific coding scheme. - * - * @return returns 1 if the codec is configured and working. Otherwise - * 0 will be returned. - */ - -int -TIFFIsCODECConfigured(uint16 scheme) -{ - const TIFFCodec* codec = TIFFFindCODEC(scheme); - - if(codec == NULL) { - return 0; - } - if(codec->init == NULL) { - return 0; - } - if(codec->init != NotConfigured){ - return 1; - } - return 0; -} - diff --git a/wxWidgets/src/tiff/tif_color.c b/wxWidgets/src/tiff/tif_color.c deleted file mode 100644 index ae830b07df..0000000000 --- a/wxWidgets/src/tiff/tif_color.c +++ /dev/null @@ -1,268 +0,0 @@ -/* $Header$ */ - -/* - * Copyright (c) 1988-1997 Sam Leffler - * Copyright (c) 1991-1997 Silicon Graphics, Inc. - * - * Permission to use, copy, modify, distribute, and sell this software and - * its documentation for any purpose is hereby granted without fee, provided - * that (i) the above copyright notices and this permission notice appear in - * all copies of the software and related documentation, and (ii) the names of - * Sam Leffler and Silicon Graphics may not be used in any advertising or - * publicity relating to the software without the specific, prior written - * permission of Sam Leffler and Silicon Graphics. - * - * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, - * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * - * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR - * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, - * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF - * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE - * OF THIS SOFTWARE. - */ - -/* - * CIE L*a*b* to CIE XYZ and CIE XYZ to RGB conversion routines are taken - * from the VIPS library (http://www.vips.ecs.soton.ac.uk) with - * the permission of John Cupitt, the VIPS author. - */ - -/* - * TIFF Library. - * - * Color space conversion routines. - */ - -#include "tiffiop.h" -#include - -/* - * Convert color value from the CIE L*a*b* 1976 space to CIE XYZ. - */ -void -TIFFCIELabToXYZ(TIFFCIELabToRGB *cielab, uint32 l, int32 a, int32 b, - float *X, float *Y, float *Z) -{ - float L = (float)l * 100.0F / 255.0F; - float cby, tmp; - - if( L < 8.856F ) { - *Y = (L * cielab->Y0) / 903.292F; - cby = 7.787F * (*Y / cielab->Y0) + 16.0F / 116.0F; - } else { - cby = (L + 16.0F) / 116.0F; - *Y = cielab->Y0 * cby * cby * cby; - } - - tmp = (float)a / 500.0F + cby; - if( tmp < 0.2069F ) - *X = cielab->X0 * (tmp - 0.13793F) / 7.787F; - else - *X = cielab->X0 * tmp * tmp * tmp; - - tmp = cby - (float)b / 200.0F; - if( tmp < 0.2069F ) - *Z = cielab->Z0 * (tmp - 0.13793F) / 7.787F; - else - *Z = cielab->Z0 * tmp * tmp * tmp; -} - -#define RINT(R) ((uint32)((R)>0?((R)+0.5):((R)-0.5))) -/* - * Convert color value from the XYZ space to RGB. - */ -void -TIFFXYZToRGB(TIFFCIELabToRGB *cielab, float X, float Y, float Z, - uint32 *r, uint32 *g, uint32 *b) -{ - int i; - float Yr, Yg, Yb; - float *matrix = &cielab->display.d_mat[0][0]; - - /* Multiply through the matrix to get luminosity values. */ - Yr = matrix[0] * X + matrix[1] * Y + matrix[2] * Z; - Yg = matrix[3] * X + matrix[4] * Y + matrix[5] * Z; - Yb = matrix[6] * X + matrix[7] * Y + matrix[8] * Z; - - /* Clip input */ - Yr = TIFFmax( Yr, cielab->display.d_Y0R ); - Yg = TIFFmax( Yg, cielab->display.d_Y0G ); - Yb = TIFFmax( Yb, cielab->display.d_Y0B ); - - /* Turn luminosity to colour value. */ - i = TIFFmin(cielab->range, - (int)((Yr - cielab->display.d_Y0R) / cielab->rstep)); - *r = RINT(cielab->Yr2r[i]); - - i = TIFFmin(cielab->range, - (int)((Yg - cielab->display.d_Y0G) / cielab->gstep)); - *g = RINT(cielab->Yg2g[i]); - - i = TIFFmin(cielab->range, - (int)((Yb - cielab->display.d_Y0B) / cielab->bstep)); - *b = RINT(cielab->Yb2b[i]); - - /* Clip output. */ - *r = TIFFmin( *r, cielab->display.d_Vrwr ); - *g = TIFFmin( *g, cielab->display.d_Vrwg ); - *b = TIFFmin( *b, cielab->display.d_Vrwb ); -} -#undef RINT - -/* - * Allocate conversion state structures and make look_up tables for - * the Yr,Yb,Yg <=> r,g,b conversions. - */ -int -TIFFCIELabToRGBInit(TIFFCIELabToRGB* cielab, - TIFFDisplay *display, float *refWhite) -{ - int i; - float gamma; - - cielab->range = CIELABTORGB_TABLE_RANGE; - - _TIFFmemcpy(&cielab->display, display, sizeof(TIFFDisplay)); - - /* Red */ - gamma = 1.0F / cielab->display.d_gammaR ; - cielab->rstep = - (cielab->display.d_YCR - cielab->display.d_Y0R) / cielab->range; - for(i = 0; i <= cielab->range; i++) { - cielab->Yr2r[i] = cielab->display.d_Vrwr - * ((float)pow((double)i / cielab->range, gamma)); - } - - /* Green */ - gamma = 1.0F / cielab->display.d_gammaG ; - cielab->gstep = - (cielab->display.d_YCR - cielab->display.d_Y0R) / cielab->range; - for(i = 0; i <= cielab->range; i++) { - cielab->Yg2g[i] = cielab->display.d_Vrwg - * ((float)pow((double)i / cielab->range, gamma)); - } - - /* Blue */ - gamma = 1.0F / cielab->display.d_gammaB ; - cielab->bstep = - (cielab->display.d_YCR - cielab->display.d_Y0R) / cielab->range; - for(i = 0; i <= cielab->range; i++) { - cielab->Yb2b[i] = cielab->display.d_Vrwb - * ((float)pow((double)i / cielab->range, gamma)); - } - - /* Init reference white point */ - cielab->X0 = refWhite[0]; - cielab->Y0 = refWhite[1]; - cielab->Z0 = refWhite[2]; - - return 0; -} - -/* - * Convert color value from the YCbCr space to CIE XYZ. - * The colorspace conversion algorithm comes from the IJG v5a code; - * see below for more information on how it works. - */ -#define SHIFT 16 -#define FIX(x) ((int32)((x) * (1L<(max)?(max):(f)) - -void -TIFFYCbCrtoRGB(TIFFYCbCrToRGB *ycbcr, uint32 Y, int32 Cb, int32 Cr, - uint32 *r, uint32 *g, uint32 *b) -{ - /* XXX: Only 8-bit YCbCr input supported for now */ - Y = CLAMP(Y, 0, 255), Cb = CLAMP(Cb, 0, 255), Cr = CLAMP(Cr, 0, 255); - - *r = ycbcr->clamptab[ycbcr->Y_tab[Y] + ycbcr->Cr_r_tab[Cr]]; - *g = ycbcr->clamptab[ycbcr->Y_tab[Y] - + (int)((ycbcr->Cb_g_tab[Cb] + ycbcr->Cr_g_tab[Cr]) >> SHIFT)]; - *b = ycbcr->clamptab[ycbcr->Y_tab[Y] + ycbcr->Cb_b_tab[Cb]]; -} - -/* - * Initialize the YCbCr->RGB conversion tables. The conversion - * is done according to the 6.0 spec: - * - * R = Y + Cr*(2 - 2*LumaRed) - * B = Y + Cb*(2 - 2*LumaBlue) - * G = Y - * - LumaBlue*Cb*(2-2*LumaBlue)/LumaGreen - * - LumaRed*Cr*(2-2*LumaRed)/LumaGreen - * - * To avoid floating point arithmetic the fractional constants that - * come out of the equations are represented as fixed point values - * in the range 0...2^16. We also eliminate multiplications by - * pre-calculating possible values indexed by Cb and Cr (this code - * assumes conversion is being done for 8-bit samples). - */ -int -TIFFYCbCrToRGBInit(TIFFYCbCrToRGB* ycbcr, float *luma, float *refBlackWhite) -{ - TIFFRGBValue* clamptab; - int i; - -#define LumaRed luma[0] -#define LumaGreen luma[1] -#define LumaBlue luma[2] - - clamptab = (TIFFRGBValue*)( - (tidata_t) ycbcr+TIFFroundup(sizeof (TIFFYCbCrToRGB), sizeof (long))); - _TIFFmemset(clamptab, 0, 256); /* v < 0 => 0 */ - ycbcr->clamptab = (clamptab += 256); - for (i = 0; i < 256; i++) - clamptab[i] = (TIFFRGBValue) i; - _TIFFmemset(clamptab+256, 255, 2*256); /* v > 255 => 255 */ - ycbcr->Cr_r_tab = (int*) (clamptab + 3*256); - ycbcr->Cb_b_tab = ycbcr->Cr_r_tab + 256; - ycbcr->Cr_g_tab = (int32*) (ycbcr->Cb_b_tab + 256); - ycbcr->Cb_g_tab = ycbcr->Cr_g_tab + 256; - ycbcr->Y_tab = ycbcr->Cb_g_tab + 256; - - { float f1 = 2-2*LumaRed; int32 D1 = FIX(f1); - float f2 = LumaRed*f1/LumaGreen; int32 D2 = -FIX(f2); - float f3 = 2-2*LumaBlue; int32 D3 = FIX(f3); - float f4 = LumaBlue*f3/LumaGreen; int32 D4 = -FIX(f4); - int x; - -#undef LumaBlue -#undef LumaGreen -#undef LumaRed - - /* - * i is the actual input pixel value in the range 0..255 - * Cb and Cr values are in the range -128..127 (actually - * they are in a range defined by the ReferenceBlackWhite - * tag) so there is some range shifting to do here when - * constructing tables indexed by the raw pixel data. - */ - for (i = 0, x = -128; i < 256; i++, x++) { - int32 Cr = (int32)Code2V(x, refBlackWhite[4] - 128.0F, - refBlackWhite[5] - 128.0F, 127); - int32 Cb = (int32)Code2V(x, refBlackWhite[2] - 128.0F, - refBlackWhite[3] - 128.0F, 127); - - ycbcr->Cr_r_tab[i] = (int32)((D1*Cr + ONE_HALF)>>SHIFT); - ycbcr->Cb_b_tab[i] = (int32)((D3*Cb + ONE_HALF)>>SHIFT); - ycbcr->Cr_g_tab[i] = D2*Cr; - ycbcr->Cb_g_tab[i] = D4*Cb + ONE_HALF; - ycbcr->Y_tab[i] = - (int32)Code2V(x + 128, refBlackWhite[0], refBlackWhite[1], 255); - } - } - - return 0; -} -#undef CLAMP -#undef Code2V -#undef SHIFT -#undef ONE_HALF -#undef FIX - - diff --git a/wxWidgets/src/tiff/tif_compress.c b/wxWidgets/src/tiff/tif_compress.c deleted file mode 100644 index dbc73c6f50..0000000000 --- a/wxWidgets/src/tiff/tif_compress.c +++ /dev/null @@ -1,235 +0,0 @@ -/* $Header$ */ - -/* - * Copyright (c) 1988-1997 Sam Leffler - * Copyright (c) 1991-1997 Silicon Graphics, Inc. - * - * Permission to use, copy, modify, distribute, and sell this software and - * its documentation for any purpose is hereby granted without fee, provided - * that (i) the above copyright notices and this permission notice appear in - * all copies of the software and related documentation, and (ii) the names of - * Sam Leffler and Silicon Graphics may not be used in any advertising or - * publicity relating to the software without the specific, prior written - * permission of Sam Leffler and Silicon Graphics. - * - * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, - * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * - * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR - * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, - * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF - * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE - * OF THIS SOFTWARE. - */ - -/* - * TIFF Library - * - * Compression Scheme Configuration Support. - */ -#include "tiffiop.h" - -static int -TIFFNoEncode(TIFF* tif, char* method) -{ - const TIFFCodec* c = TIFFFindCODEC(tif->tif_dir.td_compression); - - if (c) { - if (! strncmp(c->name, "LZW", 3) ){ - TIFFError(tif->tif_name, - "%s %s encoding is no longer implemented due to Unisys patent enforcement", - c->name, method); - } else { - TIFFError(tif->tif_name, "%s %s encoding is not implemented", - c->name, method); - } - } - else { - TIFFError(tif->tif_name, - "Compression scheme %u %s encoding is not implemented", - tif->tif_dir.td_compression, method); - } - return (-1); -} - -int -_TIFFNoRowEncode(TIFF* tif, tidata_t pp, tsize_t cc, tsample_t s) -{ - (void) pp; (void) cc; (void) s; - return (TIFFNoEncode(tif, "scanline")); -} - -int -_TIFFNoStripEncode(TIFF* tif, tidata_t pp, tsize_t cc, tsample_t s) -{ - (void) pp; (void) cc; (void) s; - return (TIFFNoEncode(tif, "strip")); -} - -int -_TIFFNoTileEncode(TIFF* tif, tidata_t pp, tsize_t cc, tsample_t s) -{ - (void) pp; (void) cc; (void) s; - return (TIFFNoEncode(tif, "tile")); -} - -static int -TIFFNoDecode(TIFF* tif, char* method) -{ - const TIFFCodec* c = TIFFFindCODEC(tif->tif_dir.td_compression); - - if (c) - TIFFError(tif->tif_name, "%s %s decoding is not implemented", - c->name, method); - else - TIFFError(tif->tif_name, - "Compression scheme %u %s decoding is not implemented", - tif->tif_dir.td_compression, method); - return (-1); -} - -int -_TIFFNoRowDecode(TIFF* tif, tidata_t pp, tsize_t cc, tsample_t s) -{ - (void) pp; (void) cc; (void) s; - return (TIFFNoDecode(tif, "scanline")); -} - -int -_TIFFNoStripDecode(TIFF* tif, tidata_t pp, tsize_t cc, tsample_t s) -{ - (void) pp; (void) cc; (void) s; - return (TIFFNoDecode(tif, "strip")); -} - -int -_TIFFNoTileDecode(TIFF* tif, tidata_t pp, tsize_t cc, tsample_t s) -{ - (void) pp; (void) cc; (void) s; - return (TIFFNoDecode(tif, "tile")); -} - -int -_TIFFNoSeek(TIFF* tif, uint32 off) -{ - (void) off; - TIFFError(tif->tif_name, - "Compression algorithm does not support random access"); - return (0); -} - -int -_TIFFNoPreCode(TIFF* tif, tsample_t s) -{ - (void) tif; (void) s; - return (1); -} - -static int _TIFFtrue(TIFF* tif) { (void) tif; return (1); } -static void _TIFFvoid(TIFF* tif) { (void) tif; } - -void -_TIFFSetDefaultCompressionState(TIFF* tif) -{ - tif->tif_decodestatus = TRUE; - tif->tif_setupdecode = _TIFFtrue; - tif->tif_predecode = _TIFFNoPreCode; - tif->tif_decoderow = _TIFFNoRowDecode; - tif->tif_decodestrip = _TIFFNoStripDecode; - tif->tif_decodetile = _TIFFNoTileDecode; - tif->tif_encodestatus = TRUE; - tif->tif_setupencode = _TIFFtrue; - tif->tif_preencode = _TIFFNoPreCode; - tif->tif_postencode = _TIFFtrue; - tif->tif_encoderow = _TIFFNoRowEncode; - tif->tif_encodestrip = _TIFFNoStripEncode; - tif->tif_encodetile = _TIFFNoTileEncode; - tif->tif_close = _TIFFvoid; - tif->tif_seek = _TIFFNoSeek; - tif->tif_cleanup = _TIFFvoid; - tif->tif_defstripsize = _TIFFDefaultStripSize; - tif->tif_deftilesize = _TIFFDefaultTileSize; - tif->tif_flags &= ~TIFF_NOBITREV; -} - -int -TIFFSetCompressionScheme(TIFF* tif, int scheme) -{ - const TIFFCodec *c = TIFFFindCODEC((uint16) scheme); - - _TIFFSetDefaultCompressionState(tif); - /* - * Don't treat an unknown compression scheme as an error. - * This permits applications to open files with data that - * the library does not have builtin support for, but which - * may still be meaningful. - */ - return (c ? (*c->init)(tif, scheme) : 1); -} - -/* - * Other compression schemes may be registered. Registered - * schemes can also override the builtin versions provided - * by this library. - */ -typedef struct _codec { - struct _codec* next; - TIFFCodec* info; -} codec_t; -static codec_t* registeredCODECS = NULL; - -const TIFFCodec* -TIFFFindCODEC(uint16 scheme) -{ - const TIFFCodec* c; - codec_t* cd; - - for (cd = registeredCODECS; cd; cd = cd->next) - if (cd->info->scheme == scheme) - return ((const TIFFCodec*) cd->info); - for (c = _TIFFBuiltinCODECS; c->name; c++) - if (c->scheme == scheme) - return (c); - return ((const TIFFCodec*) 0); -} - -TIFFCodec* -TIFFRegisterCODEC(uint16 scheme, const char* name, TIFFInitMethod init) -{ - codec_t* cd = (codec_t*) - _TIFFmalloc(sizeof (codec_t) + sizeof (TIFFCodec) + strlen(name)+1); - - if (cd != NULL) { - cd->info = (TIFFCodec*) ((tidata_t) cd + sizeof (codec_t)); - cd->info->name = (char*) - ((tidata_t) cd->info + sizeof (TIFFCodec)); - strcpy(cd->info->name, name); - cd->info->scheme = scheme; - cd->info->init = init; - cd->next = registeredCODECS; - registeredCODECS = cd; - } else { - TIFFError("TIFFRegisterCODEC", - "No space to register compression scheme %s", name); - return NULL; - } - return (cd->info); -} - -void -TIFFUnRegisterCODEC(TIFFCodec* c) -{ - codec_t* cd; - codec_t** pcd; - - for (pcd = ®isteredCODECS; (cd = *pcd); pcd = &cd->next) - if (cd->info == c) { - *pcd = cd->next; - _TIFFfree(cd); - return; - } - TIFFError("TIFFUnRegisterCODEC", - "Cannot remove compression scheme %s; not registered", c->name); -} diff --git a/wxWidgets/src/tiff/tif_dir.c b/wxWidgets/src/tiff/tif_dir.c deleted file mode 100644 index 7b9ae207e9..0000000000 --- a/wxWidgets/src/tiff/tif_dir.c +++ /dev/null @@ -1,1435 +0,0 @@ -/* $Header$ */ - -/* - * Copyright (c) 1988-1997 Sam Leffler - * Copyright (c) 1991-1997 Silicon Graphics, Inc. - * - * Permission to use, copy, modify, distribute, and sell this software and - * its documentation for any purpose is hereby granted without fee, provided - * that (i) the above copyright notices and this permission notice appear in - * all copies of the software and related documentation, and (ii) the names of - * Sam Leffler and Silicon Graphics may not be used in any advertising or - * publicity relating to the software without the specific, prior written - * permission of Sam Leffler and Silicon Graphics. - * - * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, - * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * - * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR - * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, - * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF - * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE - * OF THIS SOFTWARE. - */ - -/* - * TIFF Library. - * - * Directory Tag Get & Set Routines. - * (and also some miscellaneous stuff) - */ -#include "tiffiop.h" - -/* - * These are used in the backwards compatibility code... - */ -#define DATATYPE_VOID 0 /* !untyped data */ -#define DATATYPE_INT 1 /* !signed integer data */ -#define DATATYPE_UINT 2 /* !unsigned integer data */ -#define DATATYPE_IEEEFP 3 /* !IEEE floating point data */ - -static void -setByteArray(void** vpp, void* vp, size_t nmemb, size_t elem_size) -{ - if (*vpp) - _TIFFfree(*vpp), *vpp = 0; - if (vp) { - tsize_t bytes = nmemb * elem_size; - if (elem_size && bytes / elem_size == nmemb) - *vpp = (void*) _TIFFmalloc(bytes); - if (*vpp) - _TIFFmemcpy(*vpp, vp, bytes); - } -} -void _TIFFsetByteArray(void** vpp, void* vp, long n) - { setByteArray(vpp, vp, n, 1); } -void _TIFFsetString(char** cpp, char* cp) - { setByteArray((void**) cpp, (void*) cp, strlen(cp)+1, 1); } -void _TIFFsetNString(char** cpp, char* cp, long n) - { setByteArray((void**) cpp, (void*) cp, n, 1); } -void _TIFFsetShortArray(uint16** wpp, uint16* wp, long n) - { setByteArray((void**) wpp, (void*) wp, n, sizeof (uint16)); } -void _TIFFsetLongArray(uint32** lpp, uint32* lp, long n) - { setByteArray((void**) lpp, (void*) lp, n, sizeof (uint32)); } -void _TIFFsetFloatArray(float** fpp, float* fp, long n) - { setByteArray((void**) fpp, (void*) fp, n, sizeof (float)); } -void _TIFFsetDoubleArray(double** dpp, double* dp, long n) - { setByteArray((void**) dpp, (void*) dp, n, sizeof (double)); } - -/* - * Install extra samples information. - */ -static int -setExtraSamples(TIFFDirectory* td, va_list ap, int* v) -{ - uint16* va; - int i; - - *v = va_arg(ap, int); - if ((uint16) *v > td->td_samplesperpixel) - return (0); - va = va_arg(ap, uint16*); - if (*v > 0 && va == NULL) /* typically missing param */ - return (0); - for (i = 0; i < *v; i++) - if (va[i] > EXTRASAMPLE_UNASSALPHA) - return (0); - td->td_extrasamples = (uint16) *v; - _TIFFsetShortArray(&td->td_sampleinfo, va, td->td_extrasamples); - return (1); -} - -static int -checkInkNamesString(TIFF* tif, int slen, const char* s) -{ - TIFFDirectory* td = &tif->tif_dir; - int i = td->td_samplesperpixel; - - if (slen > 0) { - const char* ep = s+slen; - const char* cp = s; - for (; i > 0; i--) { - for (; *cp != '\0'; cp++) - if (cp >= ep) - goto bad; - cp++; /* skip \0 */ - } - return (cp-s); - } -bad: - TIFFError("TIFFSetField", - "%s: Invalid InkNames value; expecting %d names, found %d", - tif->tif_name, - td->td_samplesperpixel, - td->td_samplesperpixel-i); - return (0); -} - -static int -_TIFFVSetField(TIFF* tif, ttag_t tag, va_list ap) -{ - static const char module[] = "_TIFFVSetField"; - - TIFFDirectory* td = &tif->tif_dir; - int status = 1; - uint32 v32; - int i, v; - double d; - char* s; - - switch (tag) { - case TIFFTAG_SUBFILETYPE: - td->td_subfiletype = va_arg(ap, uint32); - break; - case TIFFTAG_IMAGEWIDTH: - td->td_imagewidth = va_arg(ap, uint32); - break; - case TIFFTAG_IMAGELENGTH: - td->td_imagelength = va_arg(ap, uint32); - break; - case TIFFTAG_BITSPERSAMPLE: - td->td_bitspersample = (uint16) va_arg(ap, int); - /* - * If the data require post-decoding processing - * to byte-swap samples, set it up here. Note - * that since tags are required to be ordered, - * compression code can override this behaviour - * in the setup method if it wants to roll the - * post decoding work in with its normal work. - */ - if (tif->tif_flags & TIFF_SWAB) { - if (td->td_bitspersample == 16) - tif->tif_postdecode = _TIFFSwab16BitData; - else if (td->td_bitspersample == 32) - tif->tif_postdecode = _TIFFSwab32BitData; - else if (td->td_bitspersample == 64) - tif->tif_postdecode = _TIFFSwab64BitData; - } - break; - case TIFFTAG_COMPRESSION: - v = va_arg(ap, int) & 0xffff; - /* - * If we're changing the compression scheme, - * the notify the previous module so that it - * can cleanup any state it's setup. - */ - if (TIFFFieldSet(tif, FIELD_COMPRESSION)) { - if (td->td_compression == v) - break; - (*tif->tif_cleanup)(tif); - tif->tif_flags &= ~TIFF_CODERSETUP; - } - /* - * Setup new compression routine state. - */ - if( (status = TIFFSetCompressionScheme(tif, v)) != 0 ) - td->td_compression = (uint16) v; - else - status = 0; - break; - case TIFFTAG_PHOTOMETRIC: - td->td_photometric = (uint16) va_arg(ap, int); - break; - case TIFFTAG_THRESHHOLDING: - td->td_threshholding = (uint16) va_arg(ap, int); - break; - case TIFFTAG_FILLORDER: - v = va_arg(ap, int); - if (v != FILLORDER_LSB2MSB && v != FILLORDER_MSB2LSB) - goto badvalue; - td->td_fillorder = (uint16) v; - break; - case TIFFTAG_DOCUMENTNAME: - _TIFFsetString(&td->td_documentname, va_arg(ap, char*)); - break; - case TIFFTAG_ARTIST: - _TIFFsetString(&td->td_artist, va_arg(ap, char*)); - break; - case TIFFTAG_DATETIME: - _TIFFsetString(&td->td_datetime, va_arg(ap, char*)); - break; - case TIFFTAG_HOSTCOMPUTER: - _TIFFsetString(&td->td_hostcomputer, va_arg(ap, char*)); - break; - case TIFFTAG_IMAGEDESCRIPTION: - _TIFFsetString(&td->td_imagedescription, va_arg(ap, char*)); - break; - case TIFFTAG_MAKE: - _TIFFsetString(&td->td_make, va_arg(ap, char*)); - break; - case TIFFTAG_MODEL: - _TIFFsetString(&td->td_model, va_arg(ap, char*)); - break; - case TIFFTAG_COPYRIGHT: - _TIFFsetString(&td->td_copyright, va_arg(ap, char*)); - break; - case TIFFTAG_ORIENTATION: - v = va_arg(ap, int); - if (v < ORIENTATION_TOPLEFT || ORIENTATION_LEFTBOT < v) { - TIFFWarning(tif->tif_name, - "Bad value %ld for \"%s\" tag ignored", - v, _TIFFFieldWithTag(tif, tag)->field_name); - } else - td->td_orientation = (uint16) v; - break; - case TIFFTAG_SAMPLESPERPIXEL: - /* XXX should cross check -- e.g. if pallette, then 1 */ - v = va_arg(ap, int); - if (v == 0) - goto badvalue; - td->td_samplesperpixel = (uint16) v; - break; - case TIFFTAG_ROWSPERSTRIP: - v32 = va_arg(ap, uint32); - if (v32 == 0) - goto badvalue32; - td->td_rowsperstrip = v32; - if (!TIFFFieldSet(tif, FIELD_TILEDIMENSIONS)) { - td->td_tilelength = v32; - td->td_tilewidth = td->td_imagewidth; - } - break; - case TIFFTAG_MINSAMPLEVALUE: - td->td_minsamplevalue = (uint16) va_arg(ap, int); - break; - case TIFFTAG_MAXSAMPLEVALUE: - td->td_maxsamplevalue = (uint16) va_arg(ap, int); - break; - case TIFFTAG_SMINSAMPLEVALUE: - td->td_sminsamplevalue = (double) va_arg(ap, dblparam_t); - break; - case TIFFTAG_SMAXSAMPLEVALUE: - td->td_smaxsamplevalue = (double) va_arg(ap, dblparam_t); - break; - case TIFFTAG_XRESOLUTION: - td->td_xresolution = (float) va_arg(ap, dblparam_t); - break; - case TIFFTAG_YRESOLUTION: - td->td_yresolution = (float) va_arg(ap, dblparam_t); - break; - case TIFFTAG_PLANARCONFIG: - v = va_arg(ap, int); - if (v != PLANARCONFIG_CONTIG && v != PLANARCONFIG_SEPARATE) - goto badvalue; - td->td_planarconfig = (uint16) v; - break; - case TIFFTAG_PAGENAME: - _TIFFsetString(&td->td_pagename, va_arg(ap, char*)); - break; - case TIFFTAG_XPOSITION: - td->td_xposition = (float) va_arg(ap, dblparam_t); - break; - case TIFFTAG_YPOSITION: - td->td_yposition = (float) va_arg(ap, dblparam_t); - break; - case TIFFTAG_RESOLUTIONUNIT: - v = va_arg(ap, int); - if (v < RESUNIT_NONE || RESUNIT_CENTIMETER < v) - goto badvalue; - td->td_resolutionunit = (uint16) v; - break; - case TIFFTAG_PAGENUMBER: - td->td_pagenumber[0] = (uint16) va_arg(ap, int); - td->td_pagenumber[1] = (uint16) va_arg(ap, int); - break; - case TIFFTAG_HALFTONEHINTS: - td->td_halftonehints[0] = (uint16) va_arg(ap, int); - td->td_halftonehints[1] = (uint16) va_arg(ap, int); - break; - case TIFFTAG_COLORMAP: - v32 = (uint32)(1L<td_bitspersample); - _TIFFsetShortArray(&td->td_colormap[0], va_arg(ap, uint16*), v32); - _TIFFsetShortArray(&td->td_colormap[1], va_arg(ap, uint16*), v32); - _TIFFsetShortArray(&td->td_colormap[2], va_arg(ap, uint16*), v32); - break; - case TIFFTAG_EXTRASAMPLES: - if (!setExtraSamples(td, ap, &v)) - goto badvalue; - break; - case TIFFTAG_MATTEING: - td->td_extrasamples = (uint16) (va_arg(ap, int) != 0); - if (td->td_extrasamples) { - uint16 sv = EXTRASAMPLE_ASSOCALPHA; - _TIFFsetShortArray(&td->td_sampleinfo, &sv, 1); - } - break; - case TIFFTAG_TILEWIDTH: - v32 = va_arg(ap, uint32); - if (v32 % 16) { - if (tif->tif_mode != O_RDONLY) - goto badvalue32; - TIFFWarning(tif->tif_name, - "Nonstandard tile width %d, convert file", v32); - } - td->td_tilewidth = v32; - tif->tif_flags |= TIFF_ISTILED; - break; - case TIFFTAG_TILELENGTH: - v32 = va_arg(ap, uint32); - if (v32 % 16) { - if (tif->tif_mode != O_RDONLY) - goto badvalue32; - TIFFWarning(tif->tif_name, - "Nonstandard tile length %d, convert file", v32); - } - td->td_tilelength = v32; - tif->tif_flags |= TIFF_ISTILED; - break; - case TIFFTAG_TILEDEPTH: - v32 = va_arg(ap, uint32); - if (v32 == 0) - goto badvalue32; - td->td_tiledepth = v32; - break; - case TIFFTAG_DATATYPE: - v = va_arg(ap, int); - switch (v) { - case DATATYPE_VOID: v = SAMPLEFORMAT_VOID; break; - case DATATYPE_INT: v = SAMPLEFORMAT_INT; break; - case DATATYPE_UINT: v = SAMPLEFORMAT_UINT; break; - case DATATYPE_IEEEFP: v = SAMPLEFORMAT_IEEEFP;break; - default: goto badvalue; - } - td->td_sampleformat = (uint16) v; - break; - case TIFFTAG_SAMPLEFORMAT: - v = va_arg(ap, int); - if (v < SAMPLEFORMAT_UINT || SAMPLEFORMAT_COMPLEXIEEEFP < v) - goto badvalue; - td->td_sampleformat = (uint16) v; - - /* Try to fix up the SWAB function for complex data. */ - if( td->td_sampleformat == SAMPLEFORMAT_COMPLEXINT - && td->td_bitspersample == 32 - && tif->tif_postdecode == _TIFFSwab32BitData ) - tif->tif_postdecode = _TIFFSwab16BitData; - else if( (td->td_sampleformat == SAMPLEFORMAT_COMPLEXINT - || td->td_sampleformat == SAMPLEFORMAT_COMPLEXIEEEFP) - && td->td_bitspersample == 64 - && tif->tif_postdecode == _TIFFSwab64BitData ) - tif->tif_postdecode = _TIFFSwab32BitData; - else if( td->td_sampleformat == SAMPLEFORMAT_COMPLEXIEEEFP - && td->td_bitspersample == 128 - && tif->tif_postdecode == NULL ) - tif->tif_postdecode = _TIFFSwab64BitData; - break; - case TIFFTAG_IMAGEDEPTH: - td->td_imagedepth = va_arg(ap, uint32); - break; - case TIFFTAG_STONITS: - d = va_arg(ap, dblparam_t); - if (d <= 0.) - goto badvaluedbl; - td->td_stonits = d; - break; - /* Begin Pixar Tags */ - case TIFFTAG_PIXAR_IMAGEFULLWIDTH: - td->td_imagefullwidth = va_arg(ap, uint32); - break; - case TIFFTAG_PIXAR_IMAGEFULLLENGTH: - td->td_imagefulllength = va_arg(ap, uint32); - break; - case TIFFTAG_PIXAR_TEXTUREFORMAT: - _TIFFsetString(&td->td_textureformat, va_arg(ap, char*)); - break; - case TIFFTAG_PIXAR_WRAPMODES: - _TIFFsetString(&td->td_wrapmodes, va_arg(ap, char*)); - break; - case TIFFTAG_PIXAR_FOVCOT: - td->td_fovcot = (float) va_arg(ap, dblparam_t); - break; - case TIFFTAG_PIXAR_MATRIX_WORLDTOSCREEN: - _TIFFsetFloatArray(&td->td_matrixWorldToScreen, - va_arg(ap, float*), 16); - break; - case TIFFTAG_PIXAR_MATRIX_WORLDTOCAMERA: - _TIFFsetFloatArray(&td->td_matrixWorldToCamera, - va_arg(ap, float*), 16); - break; - /* End Pixar Tags */ - - case TIFFTAG_SUBIFD: - if ((tif->tif_flags & TIFF_INSUBIFD) == 0) { - td->td_nsubifd = (uint16) va_arg(ap, int); - _TIFFsetLongArray(&td->td_subifd, va_arg(ap, uint32*), - (long) td->td_nsubifd); - } else { - TIFFError(module, "%s: Sorry, cannot nest SubIFDs", - tif->tif_name); - status = 0; - } - break; - case TIFFTAG_YCBCRCOEFFICIENTS: - _TIFFsetFloatArray(&td->td_ycbcrcoeffs, va_arg(ap, float*), 3); - break; - case TIFFTAG_YCBCRPOSITIONING: - td->td_ycbcrpositioning = (uint16) va_arg(ap, int); - break; - case TIFFTAG_YCBCRSUBSAMPLING: - td->td_ycbcrsubsampling[0] = (uint16) va_arg(ap, int); - td->td_ycbcrsubsampling[1] = (uint16) va_arg(ap, int); - break; - case TIFFTAG_WHITEPOINT: - _TIFFsetFloatArray(&td->td_whitepoint, va_arg(ap, float*), 2); - break; - case TIFFTAG_PRIMARYCHROMATICITIES: - _TIFFsetFloatArray(&td->td_primarychromas, va_arg(ap, float*), 6); - break; - case TIFFTAG_TRANSFERFUNCTION: - v = (td->td_samplesperpixel - td->td_extrasamples) > 1 ? 3 : 1; - for (i = 0; i < v; i++) - _TIFFsetShortArray(&td->td_transferfunction[i], - va_arg(ap, uint16*), 1L<td_bitspersample); - break; - case TIFFTAG_REFERENCEBLACKWHITE: - /* XXX should check for null range */ - _TIFFsetFloatArray(&td->td_refblackwhite, va_arg(ap, float*), 6); - break; - case TIFFTAG_INKSET: - td->td_inkset = (uint16) va_arg(ap, int); - break; - case TIFFTAG_DOTRANGE: - /* XXX should check for null range */ - td->td_dotrange[0] = (uint16) va_arg(ap, int); - td->td_dotrange[1] = (uint16) va_arg(ap, int); - break; - case TIFFTAG_INKNAMES: - i = va_arg(ap, int); - s = va_arg(ap, char*); - i = checkInkNamesString(tif, i, s); - status = i > 0; - if( i > 0 ) { - _TIFFsetNString(&td->td_inknames, s, i); - td->td_inknameslen = i; - } - break; - case TIFFTAG_NUMBEROFINKS: - td->td_ninks = (uint16) va_arg(ap, int); - break; - case TIFFTAG_TARGETPRINTER: - _TIFFsetString(&td->td_targetprinter, va_arg(ap, char*)); - break; - case TIFFTAG_ICCPROFILE: - td->td_profileLength = (uint32) va_arg(ap, uint32); - _TIFFsetByteArray(&td->td_profileData, va_arg(ap, void*), - td->td_profileLength); - break; - case TIFFTAG_PHOTOSHOP: - td->td_photoshopLength = (uint32) va_arg(ap, uint32); - _TIFFsetByteArray (&td->td_photoshopData, va_arg(ap, void*), - td->td_photoshopLength); - break; - case TIFFTAG_RICHTIFFIPTC: - td->td_richtiffiptcLength = (uint32) va_arg(ap, uint32); - _TIFFsetLongArray ((uint32**)&td->td_richtiffiptcData, - va_arg(ap, uint32*), - td->td_richtiffiptcLength); - break; - case TIFFTAG_XMLPACKET: - td->td_xmlpacketLength = (uint32) va_arg(ap, uint32); - _TIFFsetByteArray(&td->td_xmlpacketData, va_arg(ap, void*), - td->td_xmlpacketLength); - break; - default: { - const TIFFFieldInfo* fip = _TIFFFindFieldInfo(tif, tag, TIFF_ANY); - TIFFTagValue *tv; - int tv_size, iCustom; - - /* - * This can happen if multiple images are open with - * different codecs which have private tags. The - * global tag information table may then have tags - * that are valid for one file but not the other. - * If the client tries to set a tag that is not valid - * for the image's codec then we'll arrive here. This - * happens, for example, when tiffcp is used to convert - * between compression schemes and codec-specific tags - * are blindly copied. - */ - if( fip == NULL || fip->field_bit != FIELD_CUSTOM ) - { - TIFFError(module, - "%s: Invalid %stag \"%s\" (not supported by codec)", - tif->tif_name, isPseudoTag(tag) ? "pseudo-" : "", - _TIFFFieldWithTag(tif, tag)->field_name); - status = 0; - break; - } - - /* - * Find the existing entry for this custom value. - */ - tv = NULL; - for( iCustom = 0; iCustom < td->td_customValueCount; iCustom++ ) - { - if( td->td_customValues[iCustom].info == fip ) - { - tv = td->td_customValues + iCustom; - if( tv->value != NULL ) - _TIFFfree( tv->value ); - break; - } - } - - /* - * Grow the custom list if the entry was not found. - */ - if( tv == NULL ) - { - TIFFTagValue *new_customValues; - - td->td_customValueCount++; - new_customValues = (TIFFTagValue *) - _TIFFrealloc(td->td_customValues, - sizeof(TIFFTagValue) * td->td_customValueCount); - if (!new_customValues) { - TIFFError(module, - "%s: Failed to allocate space for list of custom values", - tif->tif_name); - status = 0; - goto end; - } - - td->td_customValues = new_customValues; - - tv = td->td_customValues + (td->td_customValueCount-1); - tv->info = fip; - tv->value = NULL; - tv->count = 0; - } - - /* - * Set custom value ... save a copy of the custom tag value. - */ - tv_size = TIFFDataWidth(fip->field_type); - if( fip->field_passcount ) - tv->count = (int) va_arg(ap, int); - else - tv->count = 1; - if( fip->field_passcount ) - { - tv->value = _TIFFmalloc(tv_size * tv->count); - if ( !tv->value ) { - va_end(ap); - return 0; - } - _TIFFmemcpy( tv->value, (void *) va_arg(ap,void*), - tv->count * tv_size ); - } - else if( fip->field_type == TIFF_ASCII ) - { - const char *value = (const char *) va_arg(ap,const char *); - tv->count = strlen(value)+1; - tv->value = _TIFFmalloc(tv->count); - if ( !tv->value ) { - va_end(ap); - return 0; - } - strcpy( tv->value, value ); - } - else - { - /* not supporting "pass by value" types yet */ - TIFFWarning(module, " ... pass by value not implemented."); - - tv->value = _TIFFmalloc(tv_size * tv->count); - if ( !tv->value ) { - va_end(ap); - return 0; - } - _TIFFmemset( tv->value, 0, tv->count * tv_size ); - status = 0; - } - } - } - if (status) { - TIFFSetFieldBit(tif, _TIFFFieldWithTag(tif, tag)->field_bit); - tif->tif_flags |= TIFF_DIRTYDIRECT; - } - -end: - va_end(ap); - return (status); -badvalue: - TIFFError(module, "%.1000s: Bad value %d for \"%s\"", - tif->tif_name, v, _TIFFFieldWithTag(tif, tag)->field_name); - va_end(ap); - return (0); -badvalue32: - TIFFError(module, "%.1000s: Bad value %ld for \"%s\"", - tif->tif_name, v32, _TIFFFieldWithTag(tif, tag)->field_name); - va_end(ap); - return (0); -badvaluedbl: - TIFFError(module, "%.1000s: Bad value %f for \"%s\"", - tif->tif_name, d, _TIFFFieldWithTag(tif, tag)->field_name); - va_end(ap); - return (0); -} - -/* - * Return 1/0 according to whether or not - * it is permissible to set the tag's value. - * Note that we allow ImageLength to be changed - * so that we can append and extend to images. - * Any other tag may not be altered once writing - * has commenced, unless its value has no effect - * on the format of the data that is written. - */ -static int -OkToChangeTag(TIFF* tif, ttag_t tag) -{ - const TIFFFieldInfo* fip = _TIFFFindFieldInfo(tif, tag, TIFF_ANY); - if (!fip) { /* unknown tag */ - TIFFError("TIFFSetField", "%s: Unknown %stag %u", - tif->tif_name, isPseudoTag(tag) ? "pseudo-" : "", tag); - return (0); - } - if (tag != TIFFTAG_IMAGELENGTH && (tif->tif_flags & TIFF_BEENWRITING) && - !fip->field_oktochange) { - /* - * Consult info table to see if tag can be changed - * after we've started writing. We only allow changes - * to those tags that don't/shouldn't affect the - * compression and/or format of the data. - */ - TIFFError("TIFFSetField", - "%s: Cannot modify tag \"%s\" while writing", - tif->tif_name, fip->field_name); - return (0); - } - return (1); -} - -/* - * Record the value of a field in the - * internal directory structure. The - * field will be written to the file - * when/if the directory structure is - * updated. - */ -int -TIFFSetField(TIFF* tif, ttag_t tag, ...) -{ - va_list ap; - int status; - - va_start(ap, tag); - status = TIFFVSetField(tif, tag, ap); - va_end(ap); - return (status); -} - -/* - * Like TIFFSetField, but taking a varargs - * parameter list. This routine is useful - * for building higher-level interfaces on - * top of the library. - */ -int -TIFFVSetField(TIFF* tif, ttag_t tag, va_list ap) -{ - return OkToChangeTag(tif, tag) ? - (*tif->tif_tagmethods.vsetfield)(tif, tag, ap) : 0; -} - -static int -_TIFFVGetField(TIFF* tif, ttag_t tag, va_list ap) -{ - TIFFDirectory* td = &tif->tif_dir; - int ret_val = 1; - - switch (tag) { - case TIFFTAG_SUBFILETYPE: - *va_arg(ap, uint32*) = td->td_subfiletype; - break; - case TIFFTAG_IMAGEWIDTH: - *va_arg(ap, uint32*) = td->td_imagewidth; - break; - case TIFFTAG_IMAGELENGTH: - *va_arg(ap, uint32*) = td->td_imagelength; - break; - case TIFFTAG_BITSPERSAMPLE: - *va_arg(ap, uint16*) = td->td_bitspersample; - break; - case TIFFTAG_COMPRESSION: - *va_arg(ap, uint16*) = td->td_compression; - break; - case TIFFTAG_PHOTOMETRIC: - *va_arg(ap, uint16*) = td->td_photometric; - break; - case TIFFTAG_THRESHHOLDING: - *va_arg(ap, uint16*) = td->td_threshholding; - break; - case TIFFTAG_FILLORDER: - *va_arg(ap, uint16*) = td->td_fillorder; - break; - case TIFFTAG_DOCUMENTNAME: - *va_arg(ap, char**) = td->td_documentname; - break; - case TIFFTAG_ARTIST: - *va_arg(ap, char**) = td->td_artist; - break; - case TIFFTAG_DATETIME: - *va_arg(ap, char**) = td->td_datetime; - break; - case TIFFTAG_HOSTCOMPUTER: - *va_arg(ap, char**) = td->td_hostcomputer; - break; - case TIFFTAG_IMAGEDESCRIPTION: - *va_arg(ap, char**) = td->td_imagedescription; - break; - case TIFFTAG_MAKE: - *va_arg(ap, char**) = td->td_make; - break; - case TIFFTAG_MODEL: - *va_arg(ap, char**) = td->td_model; - break; - case TIFFTAG_COPYRIGHT: - *va_arg(ap, char**) = td->td_copyright; - break; - case TIFFTAG_ORIENTATION: - *va_arg(ap, uint16*) = td->td_orientation; - break; - case TIFFTAG_SAMPLESPERPIXEL: - *va_arg(ap, uint16*) = td->td_samplesperpixel; - break; - case TIFFTAG_ROWSPERSTRIP: - *va_arg(ap, uint32*) = td->td_rowsperstrip; - break; - case TIFFTAG_MINSAMPLEVALUE: - *va_arg(ap, uint16*) = td->td_minsamplevalue; - break; - case TIFFTAG_MAXSAMPLEVALUE: - *va_arg(ap, uint16*) = td->td_maxsamplevalue; - break; - case TIFFTAG_SMINSAMPLEVALUE: - *va_arg(ap, double*) = td->td_sminsamplevalue; - break; - case TIFFTAG_SMAXSAMPLEVALUE: - *va_arg(ap, double*) = td->td_smaxsamplevalue; - break; - case TIFFTAG_XRESOLUTION: - *va_arg(ap, float*) = td->td_xresolution; - break; - case TIFFTAG_YRESOLUTION: - *va_arg(ap, float*) = td->td_yresolution; - break; - case TIFFTAG_PLANARCONFIG: - *va_arg(ap, uint16*) = td->td_planarconfig; - break; - case TIFFTAG_XPOSITION: - *va_arg(ap, float*) = td->td_xposition; - break; - case TIFFTAG_YPOSITION: - *va_arg(ap, float*) = td->td_yposition; - break; - case TIFFTAG_PAGENAME: - *va_arg(ap, char**) = td->td_pagename; - break; - case TIFFTAG_RESOLUTIONUNIT: - *va_arg(ap, uint16*) = td->td_resolutionunit; - break; - case TIFFTAG_PAGENUMBER: - *va_arg(ap, uint16*) = td->td_pagenumber[0]; - *va_arg(ap, uint16*) = td->td_pagenumber[1]; - break; - case TIFFTAG_HALFTONEHINTS: - *va_arg(ap, uint16*) = td->td_halftonehints[0]; - *va_arg(ap, uint16*) = td->td_halftonehints[1]; - break; - case TIFFTAG_COLORMAP: - *va_arg(ap, uint16**) = td->td_colormap[0]; - *va_arg(ap, uint16**) = td->td_colormap[1]; - *va_arg(ap, uint16**) = td->td_colormap[2]; - break; - case TIFFTAG_STRIPOFFSETS: - case TIFFTAG_TILEOFFSETS: - *va_arg(ap, uint32**) = td->td_stripoffset; - break; - case TIFFTAG_STRIPBYTECOUNTS: - case TIFFTAG_TILEBYTECOUNTS: - *va_arg(ap, uint32**) = td->td_stripbytecount; - break; - case TIFFTAG_MATTEING: - *va_arg(ap, uint16*) = - (td->td_extrasamples == 1 && - td->td_sampleinfo[0] == EXTRASAMPLE_ASSOCALPHA); - break; - case TIFFTAG_EXTRASAMPLES: - *va_arg(ap, uint16*) = td->td_extrasamples; - *va_arg(ap, uint16**) = td->td_sampleinfo; - break; - case TIFFTAG_TILEWIDTH: - *va_arg(ap, uint32*) = td->td_tilewidth; - break; - case TIFFTAG_TILELENGTH: - *va_arg(ap, uint32*) = td->td_tilelength; - break; - case TIFFTAG_TILEDEPTH: - *va_arg(ap, uint32*) = td->td_tiledepth; - break; - case TIFFTAG_DATATYPE: - switch (td->td_sampleformat) { - case SAMPLEFORMAT_UINT: - *va_arg(ap, uint16*) = DATATYPE_UINT; - break; - case SAMPLEFORMAT_INT: - *va_arg(ap, uint16*) = DATATYPE_INT; - break; - case SAMPLEFORMAT_IEEEFP: - *va_arg(ap, uint16*) = DATATYPE_IEEEFP; - break; - case SAMPLEFORMAT_VOID: - *va_arg(ap, uint16*) = DATATYPE_VOID; - break; - } - break; - case TIFFTAG_SAMPLEFORMAT: - *va_arg(ap, uint16*) = td->td_sampleformat; - break; - case TIFFTAG_IMAGEDEPTH: - *va_arg(ap, uint32*) = td->td_imagedepth; - break; - case TIFFTAG_STONITS: - *va_arg(ap, double*) = td->td_stonits; - break; - case TIFFTAG_SUBIFD: - *va_arg(ap, uint16*) = td->td_nsubifd; - *va_arg(ap, uint32**) = td->td_subifd; - break; - case TIFFTAG_YCBCRCOEFFICIENTS: - *va_arg(ap, float**) = td->td_ycbcrcoeffs; - break; - case TIFFTAG_YCBCRPOSITIONING: - *va_arg(ap, uint16*) = td->td_ycbcrpositioning; - break; - case TIFFTAG_YCBCRSUBSAMPLING: - *va_arg(ap, uint16*) = td->td_ycbcrsubsampling[0]; - *va_arg(ap, uint16*) = td->td_ycbcrsubsampling[1]; - break; - case TIFFTAG_WHITEPOINT: - *va_arg(ap, float**) = td->td_whitepoint; - break; - case TIFFTAG_PRIMARYCHROMATICITIES: - *va_arg(ap, float**) = td->td_primarychromas; - break; - case TIFFTAG_TRANSFERFUNCTION: - *va_arg(ap, uint16**) = td->td_transferfunction[0]; - if (td->td_samplesperpixel - td->td_extrasamples > 1) { - *va_arg(ap, uint16**) = td->td_transferfunction[1]; - *va_arg(ap, uint16**) = td->td_transferfunction[2]; - } - break; - case TIFFTAG_REFERENCEBLACKWHITE: - *va_arg(ap, float**) = td->td_refblackwhite; - break; - case TIFFTAG_INKSET: - *va_arg(ap, uint16*) = td->td_inkset; - break; - case TIFFTAG_DOTRANGE: - *va_arg(ap, uint16*) = td->td_dotrange[0]; - *va_arg(ap, uint16*) = td->td_dotrange[1]; - break; - case TIFFTAG_INKNAMES: - *va_arg(ap, char**) = td->td_inknames; - break; - case TIFFTAG_NUMBEROFINKS: - *va_arg(ap, uint16*) = td->td_ninks; - break; - case TIFFTAG_TARGETPRINTER: - *va_arg(ap, char**) = td->td_targetprinter; - break; - case TIFFTAG_ICCPROFILE: - *va_arg(ap, uint32*) = td->td_profileLength; - *va_arg(ap, void**) = td->td_profileData; - break; - case TIFFTAG_PHOTOSHOP: - *va_arg(ap, uint32*) = td->td_photoshopLength; - *va_arg(ap, void**) = td->td_photoshopData; - break; - case TIFFTAG_RICHTIFFIPTC: - *va_arg(ap, uint32*) = td->td_richtiffiptcLength; - *va_arg(ap, void**) = td->td_richtiffiptcData; - break; - case TIFFTAG_XMLPACKET: - *va_arg(ap, uint32*) = td->td_xmlpacketLength; - *va_arg(ap, void**) = td->td_xmlpacketData; - break; - /* Begin Pixar Tags */ - case TIFFTAG_PIXAR_IMAGEFULLWIDTH: - *va_arg(ap, uint32*) = td->td_imagefullwidth; - break; - case TIFFTAG_PIXAR_IMAGEFULLLENGTH: - *va_arg(ap, uint32*) = td->td_imagefulllength; - break; - case TIFFTAG_PIXAR_TEXTUREFORMAT: - *va_arg(ap, char**) = td->td_textureformat; - break; - case TIFFTAG_PIXAR_WRAPMODES: - *va_arg(ap, char**) = td->td_wrapmodes; - break; - case TIFFTAG_PIXAR_FOVCOT: - *va_arg(ap, float*) = td->td_fovcot; - break; - case TIFFTAG_PIXAR_MATRIX_WORLDTOSCREEN: - *va_arg(ap, float**) = td->td_matrixWorldToScreen; - break; - case TIFFTAG_PIXAR_MATRIX_WORLDTOCAMERA: - *va_arg(ap, float**) = td->td_matrixWorldToCamera; - break; - /* End Pixar Tags */ - - default: - { - const TIFFFieldInfo* fip = _TIFFFindFieldInfo(tif, tag, TIFF_ANY); - int i; - - /* - * This can happen if multiple images are open with - * different codecs which have private tags. The - * global tag information table may then have tags - * that are valid for one file but not the other. - * If the client tries to get a tag that is not valid - * for the image's codec then we'll arrive here. - */ - if( fip == NULL || fip->field_bit != FIELD_CUSTOM ) - { - TIFFError("_TIFFVGetField", - "%s: Invalid %stag \"%s\" (not supported by codec)", - tif->tif_name, isPseudoTag(tag) ? "pseudo-" : "", - _TIFFFieldWithTag(tif, tag)->field_name); - ret_val = 0; - break; - } - - /* - ** Do we have a custom value? - */ - ret_val = 0; - for( i = 0; i < td->td_customValueCount; i++ ) - { - TIFFTagValue *tv = td->td_customValues + i; - - if( tv->info->field_tag != tag ) - continue; - - if( fip->field_passcount ) - { - *va_arg(ap, u_short *) = (u_short) tv->count; - *va_arg(ap, void **) = tv->value; - ret_val = 1; - break; - } - else if( fip->field_type == TIFF_ASCII ) - { - *va_arg(ap, void **) = tv->value; - ret_val = 1; - break; - } - else - { - printf( "TIFFVGetField ... pass by value not imp.\n" ); - break; - } - } - } - } - return( ret_val ); -} - -/* - * Return the value of a field in the - * internal directory structure. - */ -int -TIFFGetField(TIFF* tif, ttag_t tag, ...) -{ - int status; - va_list ap; - - va_start(ap, tag); - status = TIFFVGetField(tif, tag, ap); - va_end(ap); - return (status); -} - -/* - * Like TIFFGetField, but taking a varargs - * parameter list. This routine is useful - * for building higher-level interfaces on - * top of the library. - */ -int -TIFFVGetField(TIFF* tif, ttag_t tag, va_list ap) -{ - const TIFFFieldInfo* fip = _TIFFFindFieldInfo(tif, tag, TIFF_ANY); - return (fip && (isPseudoTag(tag) || TIFFFieldSet(tif, fip->field_bit)) ? - (*tif->tif_tagmethods.vgetfield)(tif, tag, ap) : 0); -} - -#define CleanupField(member) { \ - if (td->member) { \ - _TIFFfree(td->member); \ - td->member = 0; \ - } \ -} - -/* - * Release storage associated with a directory. - */ -void -TIFFFreeDirectory(TIFF* tif) -{ - TIFFDirectory *td = &tif->tif_dir; - int i; - - CleanupField(td_colormap[0]); - CleanupField(td_colormap[1]); - CleanupField(td_colormap[2]); - CleanupField(td_documentname); - CleanupField(td_artist); - CleanupField(td_datetime); - CleanupField(td_hostcomputer); - CleanupField(td_imagedescription); - CleanupField(td_make); - CleanupField(td_model); - CleanupField(td_copyright); - CleanupField(td_pagename); - CleanupField(td_sampleinfo); - CleanupField(td_subifd); - CleanupField(td_ycbcrcoeffs); - CleanupField(td_inknames); - CleanupField(td_targetprinter); - CleanupField(td_whitepoint); - CleanupField(td_primarychromas); - CleanupField(td_refblackwhite); - CleanupField(td_transferfunction[0]); - CleanupField(td_transferfunction[1]); - CleanupField(td_transferfunction[2]); - CleanupField(td_profileData); - CleanupField(td_photoshopData); - CleanupField(td_richtiffiptcData); - CleanupField(td_xmlpacketData); - CleanupField(td_stripoffset); - CleanupField(td_stripbytecount); - /* Begin Pixar Tags */ - CleanupField(td_textureformat); - CleanupField(td_wrapmodes); - CleanupField(td_matrixWorldToScreen); - CleanupField(td_matrixWorldToCamera); - /* End Pixar Tags */ - - /* Cleanup custom tag values */ - for( i = 0; i < td->td_customValueCount; i++ ) - _TIFFfree( td->td_customValues[i].value ); - - if( td->td_customValues != NULL ) - _TIFFfree( td->td_customValues ); - -} -#undef CleanupField - -/* - * Client Tag extension support (from Niles Ritter). - */ -static TIFFExtendProc _TIFFextender = (TIFFExtendProc) NULL; - -TIFFExtendProc -TIFFSetTagExtender(TIFFExtendProc extender) -{ - TIFFExtendProc prev = _TIFFextender; - _TIFFextender = extender; - return (prev); -} - -/* - * Setup for a new directory. Should we automatically call - * TIFFWriteDirectory() if the current one is dirty? - * - * The newly created directory will not exist on the file till - * TIFFWriteDirectory(), TIFFFlush() or TIFFClose() is called. - */ -int -TIFFCreateDirectory(TIFF* tif) -{ - TIFFDefaultDirectory(tif); - tif->tif_diroff = 0; - tif->tif_nextdiroff = 0; - tif->tif_curoff = 0; - tif->tif_row = (uint32) -1; - tif->tif_curstrip = (tstrip_t) -1; - - return 0; -} - -/* - * Setup a default directory structure. - */ -int -TIFFDefaultDirectory(TIFF* tif) -{ - register TIFFDirectory* td = &tif->tif_dir; - - _TIFFSetupFieldInfo(tif); - _TIFFmemset(td, 0, sizeof (*td)); - td->td_fillorder = FILLORDER_MSB2LSB; - td->td_bitspersample = 1; - td->td_threshholding = THRESHHOLD_BILEVEL; - td->td_orientation = ORIENTATION_TOPLEFT; - td->td_samplesperpixel = 1; - td->td_rowsperstrip = (uint32) -1; - td->td_tilewidth = (uint32) -1; - td->td_tilelength = (uint32) -1; - td->td_tiledepth = 1; - td->td_resolutionunit = RESUNIT_INCH; - td->td_sampleformat = SAMPLEFORMAT_UINT; - td->td_imagedepth = 1; - td->td_ycbcrsubsampling[0] = 2; - td->td_ycbcrsubsampling[1] = 2; - td->td_ycbcrpositioning = YCBCRPOSITION_CENTERED; - td->td_inkset = INKSET_CMYK; - td->td_ninks = 4; - tif->tif_postdecode = _TIFFNoPostDecode; - tif->tif_tagmethods.vsetfield = _TIFFVSetField; - tif->tif_tagmethods.vgetfield = _TIFFVGetField; - tif->tif_tagmethods.printdir = NULL; - /* - * Give client code a chance to install their own - * tag extensions & methods, prior to compression overloads. - */ - if (_TIFFextender) - (*_TIFFextender)(tif); - (void) TIFFSetField(tif, TIFFTAG_COMPRESSION, COMPRESSION_NONE); - /* - * NB: The directory is marked dirty as a result of setting - * up the default compression scheme. However, this really - * isn't correct -- we want TIFF_DIRTYDIRECT to be set only - * if the user does something. We could just do the setup - * by hand, but it seems better to use the normal mechanism - * (i.e. TIFFSetField). - */ - tif->tif_flags &= ~TIFF_DIRTYDIRECT; - - /* - * As per http://bugzilla.remotesensing.org/show_bug.cgi?id=19 - * we clear the ISTILED flag when setting up a new directory. - * Should we also be clearing stuff like INSUBIFD? - */ - tif->tif_flags &= ~TIFF_ISTILED; - - return (1); -} - -static int -TIFFAdvanceDirectory(TIFF* tif, uint32* nextdir, toff_t* off) -{ - static const char module[] = "TIFFAdvanceDirectory"; - uint16 dircount; - if (isMapped(tif)) - { - toff_t poff=*nextdir; - if (poff+sizeof(uint16) > tif->tif_size) - { - TIFFError(module, "%s: Error fetching directory count", - tif->tif_name); - return (0); - } - _TIFFmemcpy(&dircount, tif->tif_base+poff, sizeof (uint16)); - if (tif->tif_flags & TIFF_SWAB) - TIFFSwabShort(&dircount); - poff+=sizeof (uint16)+dircount*sizeof (TIFFDirEntry); - if (off != NULL) - *off = poff; - if (((toff_t) (poff+sizeof (uint32))) > tif->tif_size) - { - TIFFError(module, "%s: Error fetching directory link", - tif->tif_name); - return (0); - } - _TIFFmemcpy(nextdir, tif->tif_base+poff, sizeof (uint32)); - if (tif->tif_flags & TIFF_SWAB) - TIFFSwabLong(nextdir); - return (1); - } - else - { - if (!SeekOK(tif, *nextdir) || - !ReadOK(tif, &dircount, sizeof (uint16))) { - TIFFError(module, "%s: Error fetching directory count", - tif->tif_name); - return (0); - } - if (tif->tif_flags & TIFF_SWAB) - TIFFSwabShort(&dircount); - if (off != NULL) - *off = TIFFSeekFile(tif, - dircount*sizeof (TIFFDirEntry), SEEK_CUR); - else - (void) TIFFSeekFile(tif, - dircount*sizeof (TIFFDirEntry), SEEK_CUR); - if (!ReadOK(tif, nextdir, sizeof (uint32))) { - TIFFError(module, "%s: Error fetching directory link", - tif->tif_name); - return (0); - } - if (tif->tif_flags & TIFF_SWAB) - TIFFSwabLong(nextdir); - return (1); - } -} - -/* - * Count the number of directories in a file. - */ -tdir_t -TIFFNumberOfDirectories(TIFF* tif) -{ - toff_t nextdir = tif->tif_header.tiff_diroff; - tdir_t n = 0; - - while (nextdir != 0 && TIFFAdvanceDirectory(tif, &nextdir, NULL)) - n++; - return (n); -} - -/* - * Set the n-th directory as the current directory. - * NB: Directories are numbered starting at 0. - */ -int -TIFFSetDirectory(TIFF* tif, tdir_t dirn) -{ - toff_t nextdir; - tdir_t n; - - nextdir = tif->tif_header.tiff_diroff; - for (n = dirn; n > 0 && nextdir != 0; n--) - if (!TIFFAdvanceDirectory(tif, &nextdir, NULL)) - return (0); - tif->tif_nextdiroff = nextdir; - /* - * Set curdir to the actual directory index. The - * -1 is because TIFFReadDirectory will increment - * tif_curdir after successfully reading the directory. - */ - tif->tif_curdir = (dirn - n) - 1; - /* - * Reset tif_dirnumber counter nad start new list of seen directories. - * We need this in order to prevent IFD loops. - */ - tif->tif_dirnumber = 0; - return (TIFFReadDirectory(tif)); -} - -/* - * Set the current directory to be the directory - * located at the specified file offset. This interface - * is used mainly to access directories linked with - * the SubIFD tag (e.g. thumbnail images). - */ -int -TIFFSetSubDirectory(TIFF* tif, uint32 diroff) -{ - tif->tif_nextdiroff = diroff; - /* - * Reset tif_dirnumber counter nad start new list of seen directories. - * We need this in order to prevent IFD loops. - */ - tif->tif_dirnumber = 0; - return (TIFFReadDirectory(tif)); -} - -/* - * Return file offset of the current directory. - */ -uint32 -TIFFCurrentDirOffset(TIFF* tif) -{ - return (tif->tif_diroff); -} - -/* - * Return an indication of whether or not we are - * at the last directory in the file. - */ -int -TIFFLastDirectory(TIFF* tif) -{ - return (tif->tif_nextdiroff == 0); -} - -/* - * Unlink the specified directory from the directory chain. - */ -int -TIFFUnlinkDirectory(TIFF* tif, tdir_t dirn) -{ - static const char module[] = "TIFFUnlinkDirectory"; - toff_t nextdir; - toff_t off; - tdir_t n; - - if (tif->tif_mode == O_RDONLY) { - TIFFError(module, "Can not unlink directory in read-only file"); - return (0); - } - /* - * Go to the directory before the one we want - * to unlink and nab the offset of the link - * field we'll need to patch. - */ - nextdir = tif->tif_header.tiff_diroff; - off = sizeof (uint16) + sizeof (uint16); - for (n = dirn-1; n > 0; n--) { - if (nextdir == 0) { - TIFFError(module, "Directory %d does not exist", dirn); - return (0); - } - if (!TIFFAdvanceDirectory(tif, &nextdir, &off)) - return (0); - } - /* - * Advance to the directory to be unlinked and fetch - * the offset of the directory that follows. - */ - if (!TIFFAdvanceDirectory(tif, &nextdir, NULL)) - return (0); - /* - * Go back and patch the link field of the preceding - * directory to point to the offset of the directory - * that follows. - */ - (void) TIFFSeekFile(tif, off, SEEK_SET); - if (tif->tif_flags & TIFF_SWAB) - TIFFSwabLong(&nextdir); - if (!WriteOK(tif, &nextdir, sizeof (uint32))) { - TIFFError(module, "Error writing directory link"); - return (0); - } - /* - * Leave directory state setup safely. We don't have - * facilities for doing inserting and removing directories, - * so it's safest to just invalidate everything. This - * means that the caller can only append to the directory - * chain. - */ - (*tif->tif_cleanup)(tif); - if ((tif->tif_flags & TIFF_MYBUFFER) && tif->tif_rawdata) { - _TIFFfree(tif->tif_rawdata); - tif->tif_rawdata = NULL; - tif->tif_rawcc = 0; - } - tif->tif_flags &= ~(TIFF_BEENWRITING|TIFF_BUFFERSETUP|TIFF_POSTENCODE); - TIFFFreeDirectory(tif); - TIFFDefaultDirectory(tif); - tif->tif_diroff = 0; /* force link on next write */ - tif->tif_nextdiroff = 0; /* next write must be at end */ - tif->tif_curoff = 0; - tif->tif_row = (uint32) -1; - tif->tif_curstrip = (tstrip_t) -1; - return (1); -} - -/* [BFC] - * - * Author: Bruce Cameron - * - * Set a table of tags that are to be replaced during directory process by the - * 'IGNORE' state - or return TRUE/FALSE for the requested tag such that - * 'ReadDirectory' can use the stored information. - */ -int -TIFFReassignTagToIgnore (enum TIFFIgnoreSense task, int TIFFtagID) -{ - static int TIFFignoretags [FIELD_LAST]; - static int tagcount = 0 ; - int i; /* Loop index */ - int j; /* Loop index */ - - switch (task) - { - case TIS_STORE: - if ( tagcount < (FIELD_LAST - 1) ) - { - for ( j = 0 ; j < tagcount ; ++j ) - { /* Do not add duplicate tag */ - if ( TIFFignoretags [j] == TIFFtagID ) - return (TRUE) ; - } - TIFFignoretags [tagcount++] = TIFFtagID ; - return (TRUE) ; - } - break ; - - case TIS_EXTRACT: - for ( i = 0 ; i < tagcount ; ++i ) - { - if ( TIFFignoretags [i] == TIFFtagID ) - return (TRUE) ; - } - break; - - case TIS_EMPTY: - tagcount = 0 ; /* Clear the list */ - return (TRUE) ; - - default: - break; - } - - return (FALSE); -} - diff --git a/wxWidgets/src/tiff/tif_dir.h b/wxWidgets/src/tiff/tif_dir.h deleted file mode 100644 index f173081094..0000000000 --- a/wxWidgets/src/tiff/tif_dir.h +++ /dev/null @@ -1,267 +0,0 @@ -/* $Header$ */ - -/* - * Copyright (c) 1988-1997 Sam Leffler - * Copyright (c) 1991-1997 Silicon Graphics, Inc. - * - * Permission to use, copy, modify, distribute, and sell this software and - * its documentation for any purpose is hereby granted without fee, provided - * that (i) the above copyright notices and this permission notice appear in - * all copies of the software and related documentation, and (ii) the names of - * Sam Leffler and Silicon Graphics may not be used in any advertising or - * publicity relating to the software without the specific, prior written - * permission of Sam Leffler and Silicon Graphics. - * - * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, - * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * - * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR - * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, - * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF - * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE - * OF THIS SOFTWARE. - */ - -#ifndef _TIFFDIR_ -#define _TIFFDIR_ -/* - * ``Library-private'' Directory-related Definitions. - */ - -/* - * Internal format of a TIFF directory entry. - */ -typedef struct { -#define FIELD_SETLONGS 4 - /* bit vector of fields that are set */ - u_long td_fieldsset[FIELD_SETLONGS]; - - uint32 td_imagewidth, td_imagelength, td_imagedepth; - uint32 td_tilewidth, td_tilelength, td_tiledepth; - uint32 td_subfiletype; - uint16 td_bitspersample; - uint16 td_sampleformat; - uint16 td_compression; - uint16 td_photometric; - uint16 td_threshholding; - uint16 td_fillorder; - uint16 td_orientation; - uint16 td_samplesperpixel; - uint32 td_rowsperstrip; - uint16 td_minsamplevalue, td_maxsamplevalue; - double td_sminsamplevalue, td_smaxsamplevalue; - float td_xresolution, td_yresolution; - uint16 td_resolutionunit; - uint16 td_planarconfig; - float td_xposition, td_yposition; - uint16 td_pagenumber[2]; - uint16* td_colormap[3]; - uint16 td_halftonehints[2]; - uint16 td_extrasamples; - uint16* td_sampleinfo; - double td_stonits; - char* td_documentname; - char* td_artist; - char* td_datetime; - char* td_hostcomputer; - char* td_imagedescription; - char* td_make; - char* td_model; - char* td_copyright; - char* td_pagename; - tstrip_t td_stripsperimage; - tstrip_t td_nstrips; /* size of offset & bytecount arrays */ - uint32* td_stripoffset; - uint32* td_stripbytecount; -#if SUBIFD_SUPPORT - uint16 td_nsubifd; - uint32* td_subifd; -#endif -#ifdef YCBCR_SUPPORT - float* td_ycbcrcoeffs; - uint16 td_ycbcrsubsampling[2]; - uint16 td_ycbcrpositioning; -#endif -#ifdef COLORIMETRY_SUPPORT - float* td_whitepoint; - float* td_primarychromas; - float* td_refblackwhite; - uint16* td_transferfunction[3]; -#endif -#ifdef CMYK_SUPPORT - uint16 td_inkset; - uint16 td_ninks; - uint16 td_dotrange[2]; - int td_inknameslen; - char* td_inknames; - char* td_targetprinter; -#endif -#ifdef ICC_SUPPORT - uint32 td_profileLength; - void *td_profileData; -#endif -#ifdef PHOTOSHOP_SUPPORT - uint32 td_photoshopLength; - void *td_photoshopData; -#endif -#ifdef IPTC_SUPPORT - uint32 td_richtiffiptcLength; - void *td_richtiffiptcData; -#endif - /* Begin Pixar Tag values. */ - uint32 td_imagefullwidth, td_imagefulllength; - char* td_textureformat; - char* td_wrapmodes; - float td_fovcot; - float* td_matrixWorldToScreen; - float* td_matrixWorldToCamera; - /* End Pixar Tag Values. */ - uint32 td_xmlpacketLength; - void *td_xmlpacketData; - int td_customValueCount; - TIFFTagValue *td_customValues; -} TIFFDirectory; - -/* - * Field flags used to indicate fields that have - * been set in a directory, and to reference fields - * when manipulating a directory. - */ - -/* - * FIELD_IGNORE is used to signify tags that are to - * be processed but otherwise ignored. This permits - * antiquated tags to be quietly read and discarded. - * Note that a bit *is* allocated for ignored tags; - * this is understood by the directory reading logic - * which uses this fact to avoid special-case handling - */ -#define FIELD_IGNORE 0 - -/* multi-item fields */ -#define FIELD_IMAGEDIMENSIONS 1 -#define FIELD_TILEDIMENSIONS 2 -#define FIELD_RESOLUTION 3 -#define FIELD_POSITION 4 - -/* single-item fields */ -#define FIELD_SUBFILETYPE 5 -#define FIELD_BITSPERSAMPLE 6 -#define FIELD_COMPRESSION 7 -#define FIELD_PHOTOMETRIC 8 -#define FIELD_THRESHHOLDING 9 -#define FIELD_FILLORDER 10 -#define FIELD_DOCUMENTNAME 11 -#define FIELD_IMAGEDESCRIPTION 12 -#define FIELD_MAKE 13 -#define FIELD_MODEL 14 -#define FIELD_ORIENTATION 15 -#define FIELD_SAMPLESPERPIXEL 16 -#define FIELD_ROWSPERSTRIP 17 -#define FIELD_MINSAMPLEVALUE 18 -#define FIELD_MAXSAMPLEVALUE 19 -#define FIELD_PLANARCONFIG 20 -#define FIELD_PAGENAME 21 -#define FIELD_RESOLUTIONUNIT 22 -#define FIELD_PAGENUMBER 23 -#define FIELD_STRIPBYTECOUNTS 24 -#define FIELD_STRIPOFFSETS 25 -#define FIELD_COLORMAP 26 -#define FIELD_ARTIST 27 -#define FIELD_DATETIME 28 -#define FIELD_HOSTCOMPUTER 29 -/* unused - was FIELD_SOFTWARE 30 */ -#define FIELD_EXTRASAMPLES 31 -#define FIELD_SAMPLEFORMAT 32 -#define FIELD_SMINSAMPLEVALUE 33 -#define FIELD_SMAXSAMPLEVALUE 34 -#define FIELD_IMAGEDEPTH 35 -#define FIELD_TILEDEPTH 36 -#define FIELD_HALFTONEHINTS 37 -#define FIELD_YCBCRCOEFFICIENTS 38 -#define FIELD_YCBCRSUBSAMPLING 39 -#define FIELD_YCBCRPOSITIONING 40 -#define FIELD_REFBLACKWHITE 41 -#define FIELD_WHITEPOINT 42 -#define FIELD_PRIMARYCHROMAS 43 -#define FIELD_TRANSFERFUNCTION 44 -#define FIELD_INKSET 45 -#define FIELD_INKNAMES 46 -#define FIELD_DOTRANGE 47 -#define FIELD_TARGETPRINTER 48 -#define FIELD_SUBIFD 49 -#define FIELD_NUMBEROFINKS 50 -#define FIELD_ICCPROFILE 51 -#define FIELD_PHOTOSHOP 52 -#define FIELD_RICHTIFFIPTC 53 -#define FIELD_STONITS 54 -/* Begin PIXAR */ -#define FIELD_IMAGEFULLWIDTH 55 -#define FIELD_IMAGEFULLLENGTH 56 -#define FIELD_TEXTUREFORMAT 57 -#define FIELD_WRAPMODES 58 -#define FIELD_FOVCOT 59 -#define FIELD_MATRIX_WORLDTOSCREEN 60 -#define FIELD_MATRIX_WORLDTOCAMERA 61 -#define FIELD_COPYRIGHT 62 -#define FIELD_XMLPACKET 63 -/* FIELD_CUSTOM (see tiffio.h) 65 */ -/* end of support for well-known tags; codec-private tags follow */ -#define FIELD_CODEC 66 /* base of codec-private tags */ - - -/* - * Pseudo-tags don't normally need field bits since they - * are not written to an output file (by definition). - * The library also has express logic to always query a - * codec for a pseudo-tag so allocating a field bit for - * one is a waste. If codec wants to promote the notion - * of a pseudo-tag being ``set'' or ``unset'' then it can - * do using internal state flags without polluting the - * field bit space defined for real tags. - */ -#define FIELD_PSEUDO 0 - -#define FIELD_LAST (32*FIELD_SETLONGS-1) - -#define TIFFExtractData(tif, type, v) \ - ((uint32) ((tif)->tif_header.tiff_magic == TIFF_BIGENDIAN ? \ - ((v) >> (tif)->tif_typeshift[type]) & (tif)->tif_typemask[type] : \ - (v) & (tif)->tif_typemask[type])) -#define TIFFInsertData(tif, type, v) \ - ((uint32) ((tif)->tif_header.tiff_magic == TIFF_BIGENDIAN ? \ - ((v) & (tif)->tif_typemask[type]) << (tif)->tif_typeshift[type] : \ - (v) & (tif)->tif_typemask[type])) - - -#define BITn(n) (((u_long)1L)<<((n)&0x1f)) -#define BITFIELDn(tif, n) ((tif)->tif_dir.td_fieldsset[(n)/32]) -#define TIFFFieldSet(tif, field) (BITFIELDn(tif, field) & BITn(field)) -#define TIFFSetFieldBit(tif, field) (BITFIELDn(tif, field) |= BITn(field)) -#define TIFFClrFieldBit(tif, field) (BITFIELDn(tif, field) &= ~BITn(field)) - -#define FieldSet(fields, f) (fields[(f)/32] & BITn(f)) -#define ResetFieldBit(fields, f) (fields[(f)/32] &= ~BITn(f)) - -#if defined(__cplusplus) -extern "C" { -#endif -extern void _TIFFSetupFieldInfo(TIFF*); -extern void _TIFFPrintFieldInfo(TIFF*, FILE*); -extern TIFFDataType _TIFFSampleToTagType(TIFF*); -extern const TIFFFieldInfo* _TIFFFindOrRegisterFieldInfo( TIFF *tif, - ttag_t tag, - TIFFDataType dt ); -extern TIFFFieldInfo* _TIFFCreateAnonFieldInfo( TIFF *tif, ttag_t tag, - TIFFDataType dt ); - -#define _TIFFMergeFieldInfo TIFFMergeFieldInfo -#define _TIFFFindFieldInfo TIFFFindFieldInfo -#define _TIFFFieldWithTag TIFFFieldWithTag - -#if defined(__cplusplus) -} -#endif -#endif /* _TIFFDIR_ */ diff --git a/wxWidgets/src/tiff/tif_dirinfo.c b/wxWidgets/src/tiff/tif_dirinfo.c deleted file mode 100644 index c8a02e1f69..0000000000 --- a/wxWidgets/src/tiff/tif_dirinfo.c +++ /dev/null @@ -1,486 +0,0 @@ -/* $Header$ */ - -/* - * Copyright (c) 1988-1997 Sam Leffler - * Copyright (c) 1991-1997 Silicon Graphics, Inc. - * - * Permission to use, copy, modify, distribute, and sell this software and - * its documentation for any purpose is hereby granted without fee, provided - * that (i) the above copyright notices and this permission notice appear in - * all copies of the software and related documentation, and (ii) the names of - * Sam Leffler and Silicon Graphics may not be used in any advertising or - * publicity relating to the software without the specific, prior written - * permission of Sam Leffler and Silicon Graphics. - * - * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, - * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * - * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR - * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, - * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF - * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE - * OF THIS SOFTWARE. - */ - -/* - * TIFF Library. - * - * Core Directory Tag Support. - */ -#include "tiffiop.h" -#include -#include -#include - -/* - * NB: NB: THIS ARRAY IS ASSUMED TO BE SORTED BY TAG. - * If a tag can have both LONG and SHORT types - * then the LONG must be placed before the SHORT for - * writing to work properly. - * - * NOTE: The second field (field_readcount) and third field (field_writecount) - * sometimes use the values TIFF_VARIABLE (-1), TIFF_VARIABLE2 (-3) - * and TIFFTAG_SPP (-2). The macros should be used but would throw off - * the formatting of the code, so please interprete the -1, -2 and -3 - * values accordingly. - */ -#ifndef VMS -static -#endif -const TIFFFieldInfo tiffFieldInfo[] = { - { TIFFTAG_SUBFILETYPE, 1, 1, TIFF_LONG, FIELD_SUBFILETYPE, - TRUE, FALSE, "SubfileType" }, -/* XXX SHORT for compatibility w/ old versions of the library */ - { TIFFTAG_SUBFILETYPE, 1, 1, TIFF_SHORT, FIELD_SUBFILETYPE, - TRUE, FALSE, "SubfileType" }, - { TIFFTAG_OSUBFILETYPE, 1, 1, TIFF_SHORT, FIELD_SUBFILETYPE, - TRUE, FALSE, "OldSubfileType" }, - { TIFFTAG_IMAGEWIDTH, 1, 1, TIFF_LONG, FIELD_IMAGEDIMENSIONS, - FALSE, FALSE, "ImageWidth" }, - { TIFFTAG_IMAGEWIDTH, 1, 1, TIFF_SHORT, FIELD_IMAGEDIMENSIONS, - FALSE, FALSE, "ImageWidth" }, - { TIFFTAG_IMAGELENGTH, 1, 1, TIFF_LONG, FIELD_IMAGEDIMENSIONS, - TRUE, FALSE, "ImageLength" }, - { TIFFTAG_IMAGELENGTH, 1, 1, TIFF_SHORT, FIELD_IMAGEDIMENSIONS, - TRUE, FALSE, "ImageLength" }, -/* XXX LONG for compatibility with some broken TIFF writers */ - { TIFFTAG_BITSPERSAMPLE, -1,-1, TIFF_LONG, FIELD_BITSPERSAMPLE, - FALSE, FALSE, "BitsPerSample" }, - { TIFFTAG_BITSPERSAMPLE, -1,-1, TIFF_SHORT, FIELD_BITSPERSAMPLE, - FALSE, FALSE, "BitsPerSample" }, -/* XXX LONG for compatibility with some broken TIFF writers */ - { TIFFTAG_COMPRESSION, -1, 1, TIFF_LONG, FIELD_COMPRESSION, - FALSE, FALSE, "Compression" }, - { TIFFTAG_COMPRESSION, -1, 1, TIFF_SHORT, FIELD_COMPRESSION, - FALSE, FALSE, "Compression" }, -/* XXX LONG for compatibility with some broken TIFF writers */ - { TIFFTAG_PHOTOMETRIC, 1, 1, TIFF_LONG, FIELD_PHOTOMETRIC, - FALSE, FALSE, "PhotometricInterpretation" }, - { TIFFTAG_PHOTOMETRIC, 1, 1, TIFF_SHORT, FIELD_PHOTOMETRIC, - FALSE, FALSE, "PhotometricInterpretation" }, - { TIFFTAG_THRESHHOLDING, 1, 1, TIFF_SHORT, FIELD_THRESHHOLDING, - TRUE, FALSE, "Threshholding" }, - { TIFFTAG_CELLWIDTH, 1, 1, TIFF_SHORT, FIELD_IGNORE, - TRUE, FALSE, "CellWidth" }, - { TIFFTAG_CELLLENGTH, 1, 1, TIFF_SHORT, FIELD_IGNORE, - TRUE, FALSE, "CellLength" }, - { TIFFTAG_FILLORDER, 1, 1, TIFF_SHORT, FIELD_FILLORDER, - FALSE, FALSE, "FillOrder" }, - { TIFFTAG_DOCUMENTNAME, -1,-1, TIFF_ASCII, FIELD_DOCUMENTNAME, - TRUE, FALSE, "DocumentName" }, - { TIFFTAG_IMAGEDESCRIPTION, -1,-1, TIFF_ASCII, FIELD_IMAGEDESCRIPTION, - TRUE, FALSE, "ImageDescription" }, - { TIFFTAG_MAKE, -1,-1, TIFF_ASCII, FIELD_MAKE, - TRUE, FALSE, "Make" }, - { TIFFTAG_MODEL, -1,-1, TIFF_ASCII, FIELD_MODEL, - TRUE, FALSE, "Model" }, - { TIFFTAG_STRIPOFFSETS, -1,-1, TIFF_LONG, FIELD_STRIPOFFSETS, - FALSE, FALSE, "StripOffsets" }, - { TIFFTAG_STRIPOFFSETS, -1,-1, TIFF_SHORT, FIELD_STRIPOFFSETS, - FALSE, FALSE, "StripOffsets" }, - { TIFFTAG_ORIENTATION, 1, 1, TIFF_SHORT, FIELD_ORIENTATION, - FALSE, FALSE, "Orientation" }, - { TIFFTAG_SAMPLESPERPIXEL, 1, 1, TIFF_SHORT, FIELD_SAMPLESPERPIXEL, - FALSE, FALSE, "SamplesPerPixel" }, - { TIFFTAG_ROWSPERSTRIP, 1, 1, TIFF_LONG, FIELD_ROWSPERSTRIP, - FALSE, FALSE, "RowsPerStrip" }, - { TIFFTAG_ROWSPERSTRIP, 1, 1, TIFF_SHORT, FIELD_ROWSPERSTRIP, - FALSE, FALSE, "RowsPerStrip" }, - { TIFFTAG_STRIPBYTECOUNTS, -1,-1, TIFF_LONG, FIELD_STRIPBYTECOUNTS, - FALSE, FALSE, "StripByteCounts" }, - { TIFFTAG_STRIPBYTECOUNTS, -1,-1, TIFF_SHORT, FIELD_STRIPBYTECOUNTS, - FALSE, FALSE, "StripByteCounts" }, - { TIFFTAG_MINSAMPLEVALUE, -2,-1, TIFF_SHORT, FIELD_MINSAMPLEVALUE, - TRUE, FALSE, "MinSampleValue" }, - { TIFFTAG_MAXSAMPLEVALUE, -2,-1, TIFF_SHORT, FIELD_MAXSAMPLEVALUE, - TRUE, FALSE, "MaxSampleValue" }, - { TIFFTAG_XRESOLUTION, 1, 1, TIFF_RATIONAL, FIELD_RESOLUTION, - FALSE, FALSE, "XResolution" }, - { TIFFTAG_YRESOLUTION, 1, 1, TIFF_RATIONAL, FIELD_RESOLUTION, - FALSE, FALSE, "YResolution" }, - { TIFFTAG_PLANARCONFIG, 1, 1, TIFF_SHORT, FIELD_PLANARCONFIG, - FALSE, FALSE, "PlanarConfiguration" }, - { TIFFTAG_PAGENAME, -1,-1, TIFF_ASCII, FIELD_PAGENAME, - TRUE, FALSE, "PageName" }, - { TIFFTAG_XPOSITION, 1, 1, TIFF_RATIONAL, FIELD_POSITION, - TRUE, FALSE, "XPosition" }, - { TIFFTAG_YPOSITION, 1, 1, TIFF_RATIONAL, FIELD_POSITION, - TRUE, FALSE, "YPosition" }, - { TIFFTAG_FREEOFFSETS, -1,-1, TIFF_LONG, FIELD_IGNORE, - FALSE, FALSE, "FreeOffsets" }, - { TIFFTAG_FREEBYTECOUNTS, -1,-1, TIFF_LONG, FIELD_IGNORE, - FALSE, FALSE, "FreeByteCounts" }, - { TIFFTAG_GRAYRESPONSEUNIT, 1, 1, TIFF_SHORT, FIELD_IGNORE, - TRUE, FALSE, "GrayResponseUnit" }, - { TIFFTAG_GRAYRESPONSECURVE,-1,-1, TIFF_SHORT, FIELD_IGNORE, - TRUE, FALSE, "GrayResponseCurve" }, - { TIFFTAG_RESOLUTIONUNIT, 1, 1, TIFF_SHORT, FIELD_RESOLUTIONUNIT, - FALSE, FALSE, "ResolutionUnit" }, - { TIFFTAG_PAGENUMBER, 2, 2, TIFF_SHORT, FIELD_PAGENUMBER, - TRUE, FALSE, "PageNumber" }, - { TIFFTAG_COLORRESPONSEUNIT, 1, 1, TIFF_SHORT, FIELD_IGNORE, - TRUE, FALSE, "ColorResponseUnit" }, - { TIFFTAG_TRANSFERFUNCTION, -1,-1, TIFF_SHORT, FIELD_TRANSFERFUNCTION, - TRUE, FALSE, "TransferFunction" }, - { TIFFTAG_SOFTWARE, -1,-1, TIFF_ASCII, FIELD_CUSTOM, - TRUE, FALSE, "Software" }, - { TIFFTAG_DATETIME, 20,20, TIFF_ASCII, FIELD_DATETIME, - TRUE, FALSE, "DateTime" }, - { TIFFTAG_ARTIST, -1,-1, TIFF_ASCII, FIELD_ARTIST, - TRUE, FALSE, "Artist" }, - { TIFFTAG_HOSTCOMPUTER, -1,-1, TIFF_ASCII, FIELD_HOSTCOMPUTER, - TRUE, FALSE, "HostComputer" }, - { TIFFTAG_WHITEPOINT, 2, 2, TIFF_RATIONAL,FIELD_WHITEPOINT, - TRUE, FALSE, "WhitePoint" }, - { TIFFTAG_PRIMARYCHROMATICITIES,6,6,TIFF_RATIONAL,FIELD_PRIMARYCHROMAS, - TRUE, FALSE, "PrimaryChromaticities" }, - { TIFFTAG_COLORMAP, -1,-1, TIFF_SHORT, FIELD_COLORMAP, - TRUE, FALSE, "ColorMap" }, - { TIFFTAG_HALFTONEHINTS, 2, 2, TIFF_SHORT, FIELD_HALFTONEHINTS, - TRUE, FALSE, "HalftoneHints" }, - { TIFFTAG_TILEWIDTH, 1, 1, TIFF_LONG, FIELD_TILEDIMENSIONS, - FALSE, FALSE, "TileWidth" }, - { TIFFTAG_TILEWIDTH, 1, 1, TIFF_SHORT, FIELD_TILEDIMENSIONS, - FALSE, FALSE, "TileWidth" }, - { TIFFTAG_TILELENGTH, 1, 1, TIFF_LONG, FIELD_TILEDIMENSIONS, - FALSE, FALSE, "TileLength" }, - { TIFFTAG_TILELENGTH, 1, 1, TIFF_SHORT, FIELD_TILEDIMENSIONS, - FALSE, FALSE, "TileLength" }, - { TIFFTAG_TILEOFFSETS, -1, 1, TIFF_LONG, FIELD_STRIPOFFSETS, - FALSE, FALSE, "TileOffsets" }, - { TIFFTAG_TILEBYTECOUNTS, -1, 1, TIFF_LONG, FIELD_STRIPBYTECOUNTS, - FALSE, FALSE, "TileByteCounts" }, - { TIFFTAG_TILEBYTECOUNTS, -1, 1, TIFF_SHORT, FIELD_STRIPBYTECOUNTS, - FALSE, FALSE, "TileByteCounts" }, - { TIFFTAG_SUBIFD, -1,-1, TIFF_LONG, FIELD_SUBIFD, - TRUE, TRUE, "SubIFD" }, - { TIFFTAG_INKSET, 1, 1, TIFF_SHORT, FIELD_INKSET, - FALSE, FALSE, "InkSet" }, - { TIFFTAG_INKNAMES, -1,-1, TIFF_ASCII, FIELD_INKNAMES, - TRUE, TRUE, "InkNames" }, - { TIFFTAG_NUMBEROFINKS, 1, 1, TIFF_SHORT, FIELD_NUMBEROFINKS, - TRUE, FALSE, "NumberOfInks" }, - { TIFFTAG_DOTRANGE, 2, 2, TIFF_SHORT, FIELD_DOTRANGE, - FALSE, FALSE, "DotRange" }, - { TIFFTAG_DOTRANGE, 2, 2, TIFF_BYTE, FIELD_DOTRANGE, - FALSE, FALSE, "DotRange" }, - { TIFFTAG_TARGETPRINTER, -1,-1, TIFF_ASCII, FIELD_TARGETPRINTER, - TRUE, FALSE, "TargetPrinter" }, - { TIFFTAG_EXTRASAMPLES, -1,-1, TIFF_SHORT, FIELD_EXTRASAMPLES, - FALSE, FALSE, "ExtraSamples" }, -/* XXX for bogus Adobe Photoshop v2.5 files */ - { TIFFTAG_EXTRASAMPLES, -1,-1, TIFF_BYTE, FIELD_EXTRASAMPLES, - FALSE, FALSE, "ExtraSamples" }, - { TIFFTAG_SAMPLEFORMAT, -1,-1, TIFF_SHORT, FIELD_SAMPLEFORMAT, - FALSE, FALSE, "SampleFormat" }, - { TIFFTAG_SMINSAMPLEVALUE, -2,-1, TIFF_ANY, FIELD_SMINSAMPLEVALUE, - TRUE, FALSE, "SMinSampleValue" }, - { TIFFTAG_SMAXSAMPLEVALUE, -2,-1, TIFF_ANY, FIELD_SMAXSAMPLEVALUE, - TRUE, FALSE, "SMaxSampleValue" }, - { TIFFTAG_YCBCRCOEFFICIENTS, 3, 3, TIFF_RATIONAL, FIELD_YCBCRCOEFFICIENTS, - FALSE, FALSE, "YCbCrCoefficients" }, - { TIFFTAG_YCBCRSUBSAMPLING, 2, 2, TIFF_SHORT, FIELD_YCBCRSUBSAMPLING, - FALSE, FALSE, "YCbCrSubsampling" }, - { TIFFTAG_YCBCRPOSITIONING, 1, 1, TIFF_SHORT, FIELD_YCBCRPOSITIONING, - FALSE, FALSE, "YCbCrPositioning" }, - { TIFFTAG_REFERENCEBLACKWHITE,6,6,TIFF_RATIONAL, FIELD_REFBLACKWHITE, - TRUE, FALSE, "ReferenceBlackWhite" }, -/* XXX temporarily accept LONG for backwards compatibility */ - { TIFFTAG_REFERENCEBLACKWHITE,6,6,TIFF_LONG, FIELD_REFBLACKWHITE, - TRUE, FALSE, "ReferenceBlackWhite" }, - { TIFFTAG_XMLPACKET, -1,-3, TIFF_UNDEFINED, FIELD_XMLPACKET, - FALSE, TRUE, "XMLPacket" }, -/* begin SGI tags */ - { TIFFTAG_MATTEING, 1, 1, TIFF_SHORT, FIELD_EXTRASAMPLES, - FALSE, FALSE, "Matteing" }, - { TIFFTAG_DATATYPE, -2,-1, TIFF_SHORT, FIELD_SAMPLEFORMAT, - FALSE, FALSE, "DataType" }, - { TIFFTAG_IMAGEDEPTH, 1, 1, TIFF_LONG, FIELD_IMAGEDEPTH, - FALSE, FALSE, "ImageDepth" }, - { TIFFTAG_IMAGEDEPTH, 1, 1, TIFF_SHORT, FIELD_IMAGEDEPTH, - FALSE, FALSE, "ImageDepth" }, - { TIFFTAG_TILEDEPTH, 1, 1, TIFF_LONG, FIELD_TILEDEPTH, - FALSE, FALSE, "TileDepth" }, - { TIFFTAG_TILEDEPTH, 1, 1, TIFF_SHORT, FIELD_TILEDEPTH, - FALSE, FALSE, "TileDepth" }, -/* end SGI tags */ -/* begin Pixar tags */ - { TIFFTAG_PIXAR_IMAGEFULLWIDTH, 1, 1, TIFF_LONG, FIELD_IMAGEFULLWIDTH, - TRUE, FALSE, "ImageFullWidth" }, - { TIFFTAG_PIXAR_IMAGEFULLLENGTH, 1, 1, TIFF_LONG, FIELD_IMAGEFULLLENGTH, - TRUE, FALSE, "ImageFullLength" }, - { TIFFTAG_PIXAR_TEXTUREFORMAT, -1,-1, TIFF_ASCII, FIELD_TEXTUREFORMAT, - TRUE, FALSE, "TextureFormat" }, - { TIFFTAG_PIXAR_WRAPMODES, -1,-1, TIFF_ASCII, FIELD_WRAPMODES, - TRUE, FALSE, "TextureWrapModes" }, - { TIFFTAG_PIXAR_FOVCOT, 1, 1, TIFF_FLOAT, FIELD_FOVCOT, - TRUE, FALSE, "FieldOfViewCotan" }, - { TIFFTAG_PIXAR_MATRIX_WORLDTOSCREEN, 16,16, TIFF_FLOAT, - FIELD_MATRIX_WORLDTOSCREEN, TRUE, FALSE, "MatrixWorldToScreen" }, - { TIFFTAG_PIXAR_MATRIX_WORLDTOCAMERA, 16,16, TIFF_FLOAT, - FIELD_MATRIX_WORLDTOCAMERA, TRUE, FALSE, "MatrixWorldToCamera" }, - { TIFFTAG_COPYRIGHT, -1,-1, TIFF_ASCII, FIELD_COPYRIGHT, - TRUE, FALSE, "Copyright" }, -/* end Pixar tags */ -#ifdef IPTC_SUPPORT -#ifdef PHOTOSHOP_SUPPORT - { TIFFTAG_RICHTIFFIPTC, -1,-1, TIFF_LONG, FIELD_RICHTIFFIPTC, - FALSE, TRUE, "RichTIFFIPTC" }, -#else - { TIFFTAG_RICHTIFFIPTC, -1,-3, TIFF_UNDEFINED, FIELD_RICHTIFFIPTC, - FALSE, TRUE, "RichTIFFIPTC" }, -#endif -#endif - { TIFFTAG_PHOTOSHOP, -1,-3, TIFF_BYTE, FIELD_PHOTOSHOP, - FALSE, TRUE, "Photoshop" }, - { TIFFTAG_ICCPROFILE, -1,-3, TIFF_UNDEFINED, FIELD_ICCPROFILE, - FALSE, TRUE, "ICC Profile" }, - { TIFFTAG_STONITS, 1, 1, TIFF_DOUBLE, FIELD_STONITS, - FALSE, FALSE, "StoNits" }, -}; -#define N(a) (sizeof (a) / sizeof (a[0])) - -void -_TIFFSetupFieldInfo(TIFF* tif) -{ - if (tif->tif_fieldinfo) { - int i; - - for (i = 0; i < tif->tif_nfields; i++) - { - TIFFFieldInfo *fld = tif->tif_fieldinfo[i]; - if (fld->field_bit == FIELD_CUSTOM && - strncmp("Tag ", fld->field_name, 4) == 0) - { - _TIFFfree(fld->field_name); - _TIFFfree(fld); - } - } - - _TIFFfree(tif->tif_fieldinfo); - tif->tif_nfields = 0; - } - _TIFFMergeFieldInfo(tif, tiffFieldInfo, N(tiffFieldInfo)); -} - -static int -tagCompare(const void* a, const void* b) -{ - const TIFFFieldInfo* ta = *(const TIFFFieldInfo**) a; - const TIFFFieldInfo* tb = *(const TIFFFieldInfo**) b; - /* NB: be careful of return values for 16-bit platforms */ - if (ta->field_tag != tb->field_tag) - return (ta->field_tag < tb->field_tag ? -1 : 1); - else - return ((int)tb->field_type - (int)ta->field_type); -} - -void -_TIFFMergeFieldInfo(TIFF* tif, const TIFFFieldInfo info[], int n) -{ - TIFFFieldInfo** tp; - int i; - - if (tif->tif_nfields > 0) { - tif->tif_fieldinfo = (TIFFFieldInfo**) - _TIFFrealloc(tif->tif_fieldinfo, - (tif->tif_nfields+n) * sizeof (TIFFFieldInfo*)); - } else { - tif->tif_fieldinfo = (TIFFFieldInfo**) - _TIFFmalloc(n * sizeof (TIFFFieldInfo*)); - } - assert(tif->tif_fieldinfo != NULL); - tp = &tif->tif_fieldinfo[tif->tif_nfields]; - for (i = 0; i < n; i++) - tp[i] = (TIFFFieldInfo*) &info[i]; /* XXX */ - - /* Sort the field info by tag number */ - qsort(tif->tif_fieldinfo, (size_t) (tif->tif_nfields += n), - sizeof (TIFFFieldInfo*), tagCompare); -} - -void -_TIFFPrintFieldInfo(TIFF* tif, FILE* fd) -{ - int i; - - fprintf(fd, "%s: \n", tif->tif_name); - for (i = 0; i < tif->tif_nfields; i++) { - const TIFFFieldInfo* fip = tif->tif_fieldinfo[i]; - fprintf(fd, "field[%2d] %5lu, %2d, %2d, %d, %2d, %5s, %5s, %s\n" - , i - , (unsigned long) fip->field_tag - , fip->field_readcount, fip->field_writecount - , fip->field_type - , fip->field_bit - , fip->field_oktochange ? "TRUE" : "FALSE" - , fip->field_passcount ? "TRUE" : "FALSE" - , fip->field_name - ); - } -} - -/* - * Return size of TIFFDataType in bytes - */ -int -TIFFDataWidth(TIFFDataType type) -{ - switch(type) - { - case 0: /* nothing */ - case 1: /* TIFF_BYTE */ - case 2: /* TIFF_ASCII */ - case 6: /* TIFF_SBYTE */ - case 7: /* TIFF_UNDEFINED */ - return 1; - case 3: /* TIFF_SHORT */ - case 8: /* TIFF_SSHORT */ - return 2; - case 4: /* TIFF_LONG */ - case 9: /* TIFF_SLONG */ - case 11: /* TIFF_FLOAT */ - case 13: /* TIFF_IFD */ - return 4; - case 5: /* TIFF_RATIONAL */ - case 10: /* TIFF_SRATIONAL */ - case 12: /* TIFF_DOUBLE */ - return 8; - default: - return 0; /* will return 0 for unknown types */ - } -} - -/* - * Return nearest TIFFDataType to the sample type of an image. - */ -TIFFDataType -_TIFFSampleToTagType(TIFF* tif) -{ - uint32 bps = TIFFhowmany8(tif->tif_dir.td_bitspersample); - - switch (tif->tif_dir.td_sampleformat) { - case SAMPLEFORMAT_IEEEFP: - return (bps == 4 ? TIFF_FLOAT : TIFF_DOUBLE); - case SAMPLEFORMAT_INT: - return (bps <= 1 ? TIFF_SBYTE : - bps <= 2 ? TIFF_SSHORT : TIFF_SLONG); - case SAMPLEFORMAT_UINT: - return (bps <= 1 ? TIFF_BYTE : - bps <= 2 ? TIFF_SHORT : TIFF_LONG); - case SAMPLEFORMAT_VOID: - return (TIFF_UNDEFINED); - } - /*NOTREACHED*/ - return (TIFF_UNDEFINED); -} - -const TIFFFieldInfo* -_TIFFFindFieldInfo(TIFF* tif, ttag_t tag, TIFFDataType dt) -{ - static const TIFFFieldInfo *last = NULL; - int i, n; - - if (last && last->field_tag == tag && - (dt == TIFF_ANY || dt == last->field_type)) - return (last); - /* NB: if table gets big, use sorted search (e.g. binary search) */ - if(dt != TIFF_ANY) { - TIFFFieldInfo key = {0, 0, 0, 0, 0, 0, 0, 0}; - key.field_tag = tag; - key.field_type = dt; - return((const TIFFFieldInfo *) bsearch(&key, - tif->tif_fieldinfo, - tif->tif_nfields, - sizeof(TIFFFieldInfo), - tagCompare)); - } else for (i = 0, n = tif->tif_nfields; i < n; i++) { - const TIFFFieldInfo* fip = tif->tif_fieldinfo[i]; - if (fip->field_tag == tag && - (dt == TIFF_ANY || fip->field_type == dt)) - return (last = fip); - } - return ((const TIFFFieldInfo *)0); -} - -const TIFFFieldInfo* -_TIFFFieldWithTag(TIFF* tif, ttag_t tag) -{ - const TIFFFieldInfo* fip = _TIFFFindFieldInfo(tif, tag, TIFF_ANY); - if (!fip) { - TIFFError("TIFFFieldWithTag", - "Internal error, unknown tag 0x%x", (u_int) tag); - assert(fip != NULL); - /*NOTREACHED*/ - } - return (fip); -} - -const TIFFFieldInfo* -_TIFFFindOrRegisterFieldInfo( TIFF *tif, ttag_t tag, TIFFDataType dt ) - -{ - const TIFFFieldInfo *fld; - - fld = _TIFFFindFieldInfo( tif, tag, dt ); - if( fld == NULL ) - { - fld = _TIFFCreateAnonFieldInfo( tif, tag, dt ); - _TIFFMergeFieldInfo( tif, fld, 1 ); - } - - return fld; -} - -TIFFFieldInfo* -_TIFFCreateAnonFieldInfo(TIFF *tif, ttag_t tag, TIFFDataType field_type) -{ - TIFFFieldInfo *fld; - - fld = (TIFFFieldInfo *) _TIFFmalloc(sizeof (TIFFFieldInfo)); - if (fld == NULL) - return NULL; - _TIFFmemset( fld, 0, sizeof(TIFFFieldInfo) ); - - fld->field_tag = tag; - fld->field_readcount = TIFF_VARIABLE; - fld->field_writecount = TIFF_VARIABLE; - fld->field_type = field_type; - fld->field_bit = FIELD_CUSTOM; - fld->field_oktochange = TRUE; - fld->field_passcount = TRUE; - fld->field_name = (char *) _TIFFmalloc(32); - if (fld->field_name == NULL) { - _TIFFfree(fld); - return NULL; - } - - /* note that this name is a special sign to TIFFClose() and - * _TIFFSetupFieldInfo() to free the field - */ - sprintf(fld->field_name, "Tag %d", (int) tag); - - return fld; -} diff --git a/wxWidgets/src/tiff/tif_dirread.c b/wxWidgets/src/tiff/tif_dirread.c deleted file mode 100644 index 96ecfe59ed..0000000000 --- a/wxWidgets/src/tiff/tif_dirread.c +++ /dev/null @@ -1,1518 +0,0 @@ -/* $Header$ */ - -/* - * Copyright (c) 1988-1997 Sam Leffler - * Copyright (c) 1991-1997 Silicon Graphics, Inc. - * - * Permission to use, copy, modify, distribute, and sell this software and - * its documentation for any purpose is hereby granted without fee, provided - * that (i) the above copyright notices and this permission notice appear in - * all copies of the software and related documentation, and (ii) the names of - * Sam Leffler and Silicon Graphics may not be used in any advertising or - * publicity relating to the software without the specific, prior written - * permission of Sam Leffler and Silicon Graphics. - * - * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, - * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * - * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR - * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, - * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF - * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE - * OF THIS SOFTWARE. - */ - -/* - * TIFF Library. - * - * Directory Read Support Routines. - */ -#include "tiffiop.h" - -#define IGNORE 0 /* tag placeholder used below */ - -#if HAVE_IEEEFP -#define TIFFCvtIEEEFloatToNative(tif, n, fp) -#define TIFFCvtIEEEDoubleToNative(tif, n, dp) -#else -extern void TIFFCvtIEEEFloatToNative(TIFF*, uint32, float*); -extern void TIFFCvtIEEEDoubleToNative(TIFF*, uint32, double*); -#endif - -static int EstimateStripByteCounts(TIFF*, TIFFDirEntry*, uint16); -static void MissingRequired(TIFF*, const char*); -static int CheckDirCount(TIFF*, TIFFDirEntry*, uint32); -static tsize_t TIFFFetchData(TIFF*, TIFFDirEntry*, char*); -static tsize_t TIFFFetchString(TIFF*, TIFFDirEntry*, char*); -static float TIFFFetchRational(TIFF*, TIFFDirEntry*); -static int TIFFFetchNormalTag(TIFF*, TIFFDirEntry*); -static int TIFFFetchPerSampleShorts(TIFF*, TIFFDirEntry*, int*); -static int TIFFFetchPerSampleAnys(TIFF*, TIFFDirEntry*, double*); -static int TIFFFetchShortArray(TIFF*, TIFFDirEntry*, uint16*); -static int TIFFFetchStripThing(TIFF*, TIFFDirEntry*, long, uint32**); -static int TIFFFetchExtraSamples(TIFF*, TIFFDirEntry*); -static int TIFFFetchRefBlackWhite(TIFF*, TIFFDirEntry*); -static float TIFFFetchFloat(TIFF*, TIFFDirEntry*); -static int TIFFFetchFloatArray(TIFF*, TIFFDirEntry*, float*); -static int TIFFFetchDoubleArray(TIFF*, TIFFDirEntry*, double*); -static int TIFFFetchAnyArray(TIFF*, TIFFDirEntry*, double*); -static int TIFFFetchShortPair(TIFF*, TIFFDirEntry*); -static void ChopUpSingleUncompressedStrip(TIFF*); - -static char * -CheckMalloc(TIFF* tif, size_t nmemb, size_t elem_size, const char* what) -{ - char *cp = NULL; - tsize_t bytes = nmemb * elem_size; - - if (nmemb && elem_size && bytes / elem_size == nmemb) - cp = (char*)_TIFFmalloc(bytes); - - if (cp == NULL) - TIFFError(tif->tif_name, "No space %s", what); - - return (cp); -} - -/* - * Read the next TIFF directory from a file - * and convert it to the internal format. - * We read directories sequentially. - */ -int -TIFFReadDirectory(TIFF* tif) -{ - static const char module[] = "TIFFReadDirectory"; - - register TIFFDirEntry* dp; - register int n; - register TIFFDirectory* td; - TIFFDirEntry* dir; - int iv; - long v; - double dv; - const TIFFFieldInfo* fip; - int fix; - uint16 dircount; - toff_t nextdiroff; - char* cp; - int diroutoforderwarning = 0; - toff_t* new_dirlist; - - tif->tif_diroff = tif->tif_nextdiroff; - if (tif->tif_diroff == 0) /* no more directories */ - return (0); - - /* - * XXX: Trick to prevent IFD looping. The one can create TIFF file - * with looped directory pointers. We will maintain a list of already - * seen directories and check every IFD offset against this list. - */ - for (n = 0; n < tif->tif_dirnumber; n++) { - if (tif->tif_dirlist[n] == tif->tif_diroff) - return (0); - } - tif->tif_dirnumber++; - new_dirlist = _TIFFrealloc(tif->tif_dirlist, - tif->tif_dirnumber * sizeof(toff_t)); - if (!new_dirlist) { - TIFFError(module, - "%.1000s: Failed to allocate space for IFD list", - tif->tif_name); - return (0); - } - tif->tif_dirlist = new_dirlist; - tif->tif_dirlist[tif->tif_dirnumber - 1] = tif->tif_diroff; - - /* - * Cleanup any previous compression state. - */ - (*tif->tif_cleanup)(tif); - tif->tif_curdir++; - nextdiroff = 0; - if (!isMapped(tif)) { - if (!SeekOK(tif, tif->tif_diroff)) { - TIFFError(module, - "%.1000s: Seek error accessing TIFF directory", - tif->tif_name); - return (0); - } - if (!ReadOK(tif, &dircount, sizeof (uint16))) { - TIFFError(module, - "%.1000s: Can not read TIFF directory count", - tif->tif_name); - return (0); - } - if (tif->tif_flags & TIFF_SWAB) - TIFFSwabShort(&dircount); - dir = (TIFFDirEntry *)CheckMalloc(tif, - dircount, sizeof (TIFFDirEntry), "to read TIFF directory"); - if (dir == NULL) - return (0); - if (!ReadOK(tif, dir, dircount*sizeof (TIFFDirEntry))) { - TIFFError(module, - "%.100s: Can not read TIFF directory", - tif->tif_name); - goto bad; - } - /* - * Read offset to next directory for sequential scans. - */ - (void) ReadOK(tif, &nextdiroff, sizeof (uint32)); - } else { - toff_t off = tif->tif_diroff; - - if (off + sizeof (uint16) > tif->tif_size) { - TIFFError(module, - "%.1000s: Can not read TIFF directory count", - tif->tif_name); - return (0); - } else - _TIFFmemcpy(&dircount, tif->tif_base + off, sizeof (uint16)); - off += sizeof (uint16); - if (tif->tif_flags & TIFF_SWAB) - TIFFSwabShort(&dircount); - dir = (TIFFDirEntry *)CheckMalloc(tif, - dircount, sizeof (TIFFDirEntry), "to read TIFF directory"); - if (dir == NULL) - return (0); - if (off + dircount*sizeof (TIFFDirEntry) > tif->tif_size) { - TIFFError(module, - "%.1000s: Can not read TIFF directory", - tif->tif_name); - goto bad; - } else { - _TIFFmemcpy(dir, tif->tif_base + off, - dircount*sizeof (TIFFDirEntry)); - } - off += dircount* sizeof (TIFFDirEntry); - if (off + sizeof (uint32) <= tif->tif_size) - _TIFFmemcpy(&nextdiroff, tif->tif_base+off, sizeof (uint32)); - } - if (tif->tif_flags & TIFF_SWAB) - TIFFSwabLong(&nextdiroff); - tif->tif_nextdiroff = nextdiroff; - - tif->tif_flags &= ~TIFF_BEENWRITING; /* reset before new dir */ - /* - * Setup default value and then make a pass over - * the fields to check type and tag information, - * and to extract info required to size data - * structures. A second pass is made afterwards - * to read in everthing not taken in the first pass. - */ - td = &tif->tif_dir; - /* free any old stuff and reinit */ - TIFFFreeDirectory(tif); - TIFFDefaultDirectory(tif); - /* - * Electronic Arts writes gray-scale TIFF files - * without a PlanarConfiguration directory entry. - * Thus we setup a default value here, even though - * the TIFF spec says there is no default value. - */ - TIFFSetField(tif, TIFFTAG_PLANARCONFIG, PLANARCONFIG_CONTIG); - - /* - * Sigh, we must make a separate pass through the - * directory for the following reason: - * - * We must process the Compression tag in the first pass - * in order to merge in codec-private tag definitions (otherwise - * we may get complaints about unknown tags). However, the - * Compression tag may be dependent on the SamplesPerPixel - * tag value because older TIFF specs permited Compression - * to be written as a SamplesPerPixel-count tag entry. - * Thus if we don't first figure out the correct SamplesPerPixel - * tag value then we may end up ignoring the Compression tag - * value because it has an incorrect count value (if the - * true value of SamplesPerPixel is not 1). - * - * It sure would have been nice if Aldus had really thought - * this stuff through carefully. - */ - for (dp = dir, n = dircount; n > 0; n--, dp++) { - if (tif->tif_flags & TIFF_SWAB) { - TIFFSwabArrayOfShort(&dp->tdir_tag, 2); - TIFFSwabArrayOfLong(&dp->tdir_count, 2); - } - if (dp->tdir_tag == TIFFTAG_SAMPLESPERPIXEL) { - if (!TIFFFetchNormalTag(tif, dp)) - goto bad; - dp->tdir_tag = IGNORE; - } - } - /* - * First real pass over the directory. - */ - fix = 0; - for (dp = dir, n = dircount; n > 0; n--, dp++) { - - /* - * Find the field information entry for this tag. - * Added check for tags to ignore ... [BFC] - */ - if( TIFFReassignTagToIgnore(TIS_EXTRACT, dp->tdir_tag) ) - dp->tdir_tag = IGNORE; - - if (fix >= tif->tif_nfields || dp->tdir_tag == IGNORE) - continue; - - /* - * Silicon Beach (at least) writes unordered - * directory tags (violating the spec). Handle - * it here, but be obnoxious (maybe they'll fix it?). - */ - if (dp->tdir_tag < tif->tif_fieldinfo[fix]->field_tag) { - if (!diroutoforderwarning) { - TIFFWarning(module, -"%.1000s: invalid TIFF directory; tags are not sorted in ascending order", - tif->tif_name); - diroutoforderwarning = 1; - } - fix = 0; /* O(n^2) */ - } - while (fix < tif->tif_nfields && - tif->tif_fieldinfo[fix]->field_tag < dp->tdir_tag) - fix++; - if (fix >= tif->tif_nfields || - tif->tif_fieldinfo[fix]->field_tag != dp->tdir_tag) { - - TIFFWarning(module, - "%.1000s: unknown field with tag %d (0x%x) encountered", - tif->tif_name, dp->tdir_tag, dp->tdir_tag); - - TIFFMergeFieldInfo( tif, - _TIFFCreateAnonFieldInfo( tif, - dp->tdir_tag, - (TIFFDataType) dp->tdir_type ), - 1 ); - fix = 0; - while (fix < tif->tif_nfields && - tif->tif_fieldinfo[fix]->field_tag < dp->tdir_tag) - fix++; - } - /* - * Null out old tags that we ignore. - */ - if (tif->tif_fieldinfo[fix]->field_bit == FIELD_IGNORE) { - ignore: - dp->tdir_tag = IGNORE; - continue; - } - /* - * Check data type. - */ - fip = tif->tif_fieldinfo[fix]; - while (dp->tdir_type != (u_short) fip->field_type) { - if (fip->field_type == TIFF_ANY) /* wildcard */ - break; - fip++, fix++; - if (fix == tif->tif_nfields || - fip->field_tag != dp->tdir_tag) { - TIFFWarning(module, - "%.1000s: wrong data type %d for \"%s\"; tag ignored", - tif->tif_name, dp->tdir_type, - fip[-1].field_name); - goto ignore; - } - } - /* - * Check count if known in advance. - */ - if (fip->field_readcount != TIFF_VARIABLE) { - uint32 expected = (fip->field_readcount == TIFF_SPP) ? - (uint32) td->td_samplesperpixel : - (uint32) fip->field_readcount; - if (!CheckDirCount(tif, dp, expected)) - goto ignore; - } - - switch (dp->tdir_tag) { - case TIFFTAG_COMPRESSION: - /* - * The 5.0 spec says the Compression tag has - * one value, while earlier specs say it has - * one value per sample. Because of this, we - * accept the tag if one value is supplied. - */ - if (dp->tdir_count == 1) { - v = TIFFExtractData(tif, - dp->tdir_type, dp->tdir_offset); - if (!TIFFSetField(tif, dp->tdir_tag, (int)v)) - goto bad; - break; - } - if (!TIFFFetchPerSampleShorts(tif, dp, &iv) || - !TIFFSetField(tif, dp->tdir_tag, iv)) - goto bad; - dp->tdir_tag = IGNORE; - break; - case TIFFTAG_STRIPOFFSETS: - case TIFFTAG_STRIPBYTECOUNTS: - case TIFFTAG_TILEOFFSETS: - case TIFFTAG_TILEBYTECOUNTS: - TIFFSetFieldBit(tif, fip->field_bit); - break; - case TIFFTAG_IMAGEWIDTH: - case TIFFTAG_IMAGELENGTH: - case TIFFTAG_IMAGEDEPTH: - case TIFFTAG_TILELENGTH: - case TIFFTAG_TILEWIDTH: - case TIFFTAG_TILEDEPTH: - case TIFFTAG_PLANARCONFIG: - case TIFFTAG_ROWSPERSTRIP: - if (!TIFFFetchNormalTag(tif, dp)) - goto bad; - dp->tdir_tag = IGNORE; - break; - case TIFFTAG_EXTRASAMPLES: - (void) TIFFFetchExtraSamples(tif, dp); - dp->tdir_tag = IGNORE; - break; - } - } - - /* - * Allocate directory structure and setup defaults. - */ - if (!TIFFFieldSet(tif, FIELD_IMAGEDIMENSIONS)) { - MissingRequired(tif, "ImageLength"); - goto bad; - } - if (!TIFFFieldSet(tif, FIELD_PLANARCONFIG)) { - MissingRequired(tif, "PlanarConfiguration"); - goto bad; - } - /* - * Setup appropriate structures (by strip or by tile) - */ - if (!TIFFFieldSet(tif, FIELD_TILEDIMENSIONS)) { - td->td_nstrips = TIFFNumberOfStrips(tif); - td->td_tilewidth = td->td_imagewidth; - td->td_tilelength = td->td_rowsperstrip; - td->td_tiledepth = td->td_imagedepth; - tif->tif_flags &= ~TIFF_ISTILED; - } else { - td->td_nstrips = TIFFNumberOfTiles(tif); - tif->tif_flags |= TIFF_ISTILED; - } - if (!td->td_nstrips) { - TIFFError(module, "%s: cannot handle zero number of %s", - tif->tif_name, isTiled(tif) ? "tiles" : "strips"); - goto bad; - } - td->td_stripsperimage = td->td_nstrips; - if (td->td_planarconfig == PLANARCONFIG_SEPARATE) - td->td_stripsperimage /= td->td_samplesperpixel; - if (!TIFFFieldSet(tif, FIELD_STRIPOFFSETS)) { - MissingRequired(tif, - isTiled(tif) ? "TileOffsets" : "StripOffsets"); - goto bad; - } - - /* - * Second pass: extract other information. - */ - for (dp = dir, n = dircount; n > 0; n--, dp++) { - if (dp->tdir_tag == IGNORE) - continue; - switch (dp->tdir_tag) { - case TIFFTAG_MINSAMPLEVALUE: - case TIFFTAG_MAXSAMPLEVALUE: - case TIFFTAG_BITSPERSAMPLE: - /* - * The 5.0 spec says the Compression tag has - * one value, while earlier specs say it has - * one value per sample. Because of this, we - * accept the tag if one value is supplied. - * - * The MinSampleValue, MaxSampleValue and - * BitsPerSample tags are supposed to be written - * as one value/sample, but some vendors incorrectly - * write one value only -- so we accept that - * as well (yech). - */ - if (dp->tdir_count == 1) { - v = TIFFExtractData(tif, - dp->tdir_type, dp->tdir_offset); - if (!TIFFSetField(tif, dp->tdir_tag, (int)v)) - goto bad; - break; - } - /* fall thru... */ - case TIFFTAG_DATATYPE: - case TIFFTAG_SAMPLEFORMAT: - if (!TIFFFetchPerSampleShorts(tif, dp, &iv) || - !TIFFSetField(tif, dp->tdir_tag, iv)) - goto bad; - break; - case TIFFTAG_SMINSAMPLEVALUE: - case TIFFTAG_SMAXSAMPLEVALUE: - if (!TIFFFetchPerSampleAnys(tif, dp, &dv) || - !TIFFSetField(tif, dp->tdir_tag, dv)) - goto bad; - break; - case TIFFTAG_STRIPOFFSETS: - case TIFFTAG_TILEOFFSETS: - if (!TIFFFetchStripThing(tif, dp, - td->td_nstrips, &td->td_stripoffset)) - goto bad; - break; - case TIFFTAG_STRIPBYTECOUNTS: - case TIFFTAG_TILEBYTECOUNTS: - if (!TIFFFetchStripThing(tif, dp, - td->td_nstrips, &td->td_stripbytecount)) - goto bad; - break; - case TIFFTAG_COLORMAP: - case TIFFTAG_TRANSFERFUNCTION: - /* - * TransferFunction can have either 1x or 3x data - * values; Colormap can have only 3x items. - */ - v = 1L<td_bitspersample; - if (dp->tdir_tag == TIFFTAG_COLORMAP || - dp->tdir_count != (uint32) v) { - if (!CheckDirCount(tif, dp, (uint32)(3*v))) - break; - } - v *= sizeof (uint16); - cp = CheckMalloc(tif, dp->tdir_count, sizeof (uint16), - "to read \"TransferFunction\" tag"); - if (cp != NULL) { - if (TIFFFetchData(tif, dp, cp)) { - /* - * This deals with there being only - * one array to apply to all samples. - */ - uint32 c = - (uint32)1 << td->td_bitspersample; - if (dp->tdir_count == c) - v = 0; - TIFFSetField(tif, dp->tdir_tag, - cp, cp+v, cp+2*v); - } - _TIFFfree(cp); - } - break; - case TIFFTAG_PAGENUMBER: - case TIFFTAG_HALFTONEHINTS: - case TIFFTAG_YCBCRSUBSAMPLING: - case TIFFTAG_DOTRANGE: - (void) TIFFFetchShortPair(tif, dp); - break; -#ifdef COLORIMETRY_SUPPORT - case TIFFTAG_REFERENCEBLACKWHITE: - (void) TIFFFetchRefBlackWhite(tif, dp); - break; -#endif -/* BEGIN REV 4.0 COMPATIBILITY */ - case TIFFTAG_OSUBFILETYPE: - v = 0; - switch (TIFFExtractData(tif, dp->tdir_type, - dp->tdir_offset)) { - case OFILETYPE_REDUCEDIMAGE: - v = FILETYPE_REDUCEDIMAGE; - break; - case OFILETYPE_PAGE: - v = FILETYPE_PAGE; - break; - } - if (v) - (void) TIFFSetField(tif, - TIFFTAG_SUBFILETYPE, (int)v); - break; -/* END REV 4.0 COMPATIBILITY */ - default: - (void) TIFFFetchNormalTag(tif, dp); - break; - } - } - /* - * Verify Palette image has a Colormap. - */ - if (td->td_photometric == PHOTOMETRIC_PALETTE && - !TIFFFieldSet(tif, FIELD_COLORMAP)) { - MissingRequired(tif, "Colormap"); - goto bad; - } - /* - * Attempt to deal with a missing StripByteCounts tag. - */ - if (!TIFFFieldSet(tif, FIELD_STRIPBYTECOUNTS)) { - /* - * Some manufacturers violate the spec by not giving - * the size of the strips. In this case, assume there - * is one uncompressed strip of data. - */ - if ((td->td_planarconfig == PLANARCONFIG_CONTIG && - td->td_nstrips > 1) || - (td->td_planarconfig == PLANARCONFIG_SEPARATE && - td->td_nstrips != td->td_samplesperpixel)) { - MissingRequired(tif, "StripByteCounts"); - goto bad; - } - TIFFWarning(module, - "%.1000s: TIFF directory is missing required " - "\"%s\" field, calculating from imagelength", - tif->tif_name, - _TIFFFieldWithTag(tif,TIFFTAG_STRIPBYTECOUNTS)->field_name); - if (EstimateStripByteCounts(tif, dir, dircount) < 0) - goto bad; -/* - * Assume we have wrong StripByteCount value (in case of single strip) in - * following cases: - * - it is equal to zero along with StripOffset; - * - it is larger than file itself (in case of uncompressed image). - */ -#define BYTECOUNTLOOKSBAD \ - ( (td->td_stripbytecount[0] == 0 && td->td_stripoffset[0] != 0) || \ - (td->td_compression == COMPRESSION_NONE && \ - td->td_stripbytecount[0] > TIFFGetFileSize(tif) - td->td_stripoffset[0]) ) - } else if (td->td_nstrips == 1 && BYTECOUNTLOOKSBAD) { - /* - * Plexus (and others) sometimes give a value - * of zero for a tag when they don't know what - * the correct value is! Try and handle the - * simple case of estimating the size of a one - * strip image. - */ - TIFFWarning(module, - "%.1000s: Bogus \"%s\" field, ignoring and calculating from imagelength", - tif->tif_name, - _TIFFFieldWithTag(tif,TIFFTAG_STRIPBYTECOUNTS)->field_name); - if(EstimateStripByteCounts(tif, dir, dircount) < 0) - goto bad; - } - if (dir) { - _TIFFfree((char *)dir); - dir = NULL; - } - if (!TIFFFieldSet(tif, FIELD_MAXSAMPLEVALUE)) - td->td_maxsamplevalue = (uint16)((1L<td_bitspersample)-1); - /* - * Setup default compression scheme. - */ - if (!TIFFFieldSet(tif, FIELD_COMPRESSION)) - TIFFSetField(tif, TIFFTAG_COMPRESSION, COMPRESSION_NONE); - /* - * Some manufacturers make life difficult by writing - * large amounts of uncompressed data as a single strip. - * This is contrary to the recommendations of the spec. - * The following makes an attempt at breaking such images - * into strips closer to the recommended 8k bytes. A - * side effect, however, is that the RowsPerStrip tag - * value may be changed. - */ - if (td->td_nstrips == 1 && td->td_compression == COMPRESSION_NONE && - (tif->tif_flags & (TIFF_STRIPCHOP|TIFF_ISTILED)) == TIFF_STRIPCHOP) - ChopUpSingleUncompressedStrip(tif); - /* - * Reinitialize i/o since we are starting on a new directory. - */ - tif->tif_row = (uint32) -1; - tif->tif_curstrip = (tstrip_t) -1; - tif->tif_col = (uint32) -1; - tif->tif_curtile = (ttile_t) -1; - tif->tif_tilesize = TIFFTileSize(tif); - tif->tif_scanlinesize = TIFFScanlineSize(tif); - - if (!tif->tif_tilesize) { - TIFFError(module, "%s: cannot handle zero tile size", - tif->tif_name); - return (0); - } - if (!tif->tif_scanlinesize) { - TIFFError(module, "%s: cannot handle zero scanline size", - tif->tif_name); - return (0); - } - return (1); -bad: - if (dir) - _TIFFfree(dir); - return (0); -} - -static int -EstimateStripByteCounts(TIFF* tif, TIFFDirEntry* dir, uint16 dircount) -{ - static const char module[] = "EstimateStripByteCounts"; - - register TIFFDirEntry *dp; - register TIFFDirectory *td = &tif->tif_dir; - uint16 i; - - if (td->td_stripbytecount) - _TIFFfree(td->td_stripbytecount); - td->td_stripbytecount = (uint32*) - CheckMalloc(tif, td->td_nstrips, sizeof (uint32), - "for \"StripByteCounts\" array"); - if (td->td_compression != COMPRESSION_NONE) { - uint32 space = (uint32)(sizeof (TIFFHeader) - + sizeof (uint16) - + (dircount * sizeof (TIFFDirEntry)) - + sizeof (uint32)); - toff_t filesize = TIFFGetFileSize(tif); - uint16 n; - - /* calculate amount of space used by indirect values */ - for (dp = dir, n = dircount; n > 0; n--, dp++) - { - uint32 cc = TIFFDataWidth((TIFFDataType) dp->tdir_type); - if (cc == 0) { - TIFFError(module, - "%.1000s: Cannot determine size of unknown tag type %d", - tif->tif_name, dp->tdir_type); - return -1; - } - cc = cc * dp->tdir_count; - if (cc > sizeof (uint32)) - space += cc; - } - space = filesize - space; - if (td->td_planarconfig == PLANARCONFIG_SEPARATE) - space /= td->td_samplesperpixel; - for (i = 0; i < td->td_nstrips; i++) - td->td_stripbytecount[i] = space; - /* - * This gross hack handles the case were the offset to - * the last strip is past the place where we think the strip - * should begin. Since a strip of data must be contiguous, - * it's safe to assume that we've overestimated the amount - * of data in the strip and trim this number back accordingly. - */ - i--; - if (((toff_t)(td->td_stripoffset[i]+td->td_stripbytecount[i])) - > filesize) - td->td_stripbytecount[i] = - filesize - td->td_stripoffset[i]; - } else { - uint32 rowbytes = TIFFScanlineSize(tif); - uint32 rowsperstrip = td->td_imagelength/td->td_stripsperimage; - for (i = 0; i < td->td_nstrips; i++) - td->td_stripbytecount[i] = rowbytes*rowsperstrip; - } - TIFFSetFieldBit(tif, FIELD_STRIPBYTECOUNTS); - if (!TIFFFieldSet(tif, FIELD_ROWSPERSTRIP)) - td->td_rowsperstrip = td->td_imagelength; - return 1; -} - -static void -MissingRequired(TIFF* tif, const char* tagname) -{ - static const char module[] = "MissingRequired"; - - TIFFError(module, - "%.1000s: TIFF directory is missing required \"%s\" field", - tif->tif_name, tagname); -} - -/* - * Check the count field of a directory - * entry against a known value. The caller - * is expected to skip/ignore the tag if - * there is a mismatch. - */ -static int -CheckDirCount(TIFF* tif, TIFFDirEntry* dir, uint32 count) -{ - if (count != dir->tdir_count) { - TIFFWarning(tif->tif_name, - "incorrect count for field \"%s\" (%lu, expecting %lu); tag ignored", - _TIFFFieldWithTag(tif, dir->tdir_tag)->field_name, - dir->tdir_count, count); - return (0); - } - return (1); -} - -/* - * Fetch a contiguous directory item. - */ -static tsize_t -TIFFFetchData(TIFF* tif, TIFFDirEntry* dir, char* cp) -{ - int w = TIFFDataWidth((TIFFDataType) dir->tdir_type); - tsize_t cc = dir->tdir_count * w; - - if (!isMapped(tif)) { - if (!SeekOK(tif, dir->tdir_offset)) - goto bad; - if (!ReadOK(tif, cp, cc)) - goto bad; - } else { - if (dir->tdir_offset + cc > tif->tif_size) - goto bad; - _TIFFmemcpy(cp, tif->tif_base + dir->tdir_offset, cc); - } - if (tif->tif_flags & TIFF_SWAB) { - switch (dir->tdir_type) { - case TIFF_SHORT: - case TIFF_SSHORT: - TIFFSwabArrayOfShort((uint16*) cp, dir->tdir_count); - break; - case TIFF_LONG: - case TIFF_SLONG: - case TIFF_FLOAT: - TIFFSwabArrayOfLong((uint32*) cp, dir->tdir_count); - break; - case TIFF_RATIONAL: - case TIFF_SRATIONAL: - TIFFSwabArrayOfLong((uint32*) cp, 2*dir->tdir_count); - break; - case TIFF_DOUBLE: - TIFFSwabArrayOfDouble((double*) cp, dir->tdir_count); - break; - } - } - return (cc); -bad: - TIFFError(tif->tif_name, "Error fetching data for field \"%s\"", - _TIFFFieldWithTag(tif, dir->tdir_tag)->field_name); - return ((tsize_t) 0); -} - -/* - * Fetch an ASCII item from the file. - */ -static tsize_t -TIFFFetchString(TIFF* tif, TIFFDirEntry* dir, char* cp) -{ - if (dir->tdir_count <= 4) { - uint32 l = dir->tdir_offset; - if (tif->tif_flags & TIFF_SWAB) - TIFFSwabLong(&l); - _TIFFmemcpy(cp, &l, dir->tdir_count); - return (1); - } - return (TIFFFetchData(tif, dir, cp)); -} - -/* - * Convert numerator+denominator to float. - */ -static int -cvtRational(TIFF* tif, TIFFDirEntry* dir, uint32 num, uint32 denom, float* rv) -{ - if (denom == 0) { - TIFFError(tif->tif_name, - "%s: Rational with zero denominator (num = %lu)", - _TIFFFieldWithTag(tif, dir->tdir_tag)->field_name, num); - return (0); - } else { - if (dir->tdir_type == TIFF_RATIONAL) - *rv = ((float)num / (float)denom); - else - *rv = ((float)(int32)num / (float)(int32)denom); - return (1); - } -} - -/* - * Fetch a rational item from the file - * at offset off and return the value - * as a floating point number. - */ -static float -TIFFFetchRational(TIFF* tif, TIFFDirEntry* dir) -{ - uint32 l[2]; - float v; - - return (!TIFFFetchData(tif, dir, (char *)l) || - !cvtRational(tif, dir, l[0], l[1], &v) ? 1.0f : v); -} - -/* - * Fetch a single floating point value - * from the offset field and return it - * as a native float. - */ -static float -TIFFFetchFloat(TIFF* tif, TIFFDirEntry* dir) -{ - long l = TIFFExtractData(tif, dir->tdir_type, dir->tdir_offset); - float v = *(float*) &l; - TIFFCvtIEEEFloatToNative(tif, 1, &v); - return (v); -} - -/* - * Fetch an array of BYTE or SBYTE values. - */ -static int -TIFFFetchByteArray(TIFF* tif, TIFFDirEntry* dir, uint16* v) -{ - if (dir->tdir_count <= 4) { - /* - * Extract data from offset field. - */ - if (tif->tif_header.tiff_magic == TIFF_BIGENDIAN) { - if (dir->tdir_type == TIFF_SBYTE) - switch (dir->tdir_count) { - case 4: v[3] = (signed char)(dir->tdir_offset & 0xff); - case 3: v[2] = (signed char)((dir->tdir_offset >> 8) & 0xff); - case 2: v[1] = (signed char)((dir->tdir_offset >> 16) & 0xff); - case 1: v[0] = (signed char)(dir->tdir_offset >> 24); - } - else - switch (dir->tdir_count) { - case 4: v[3] = (uint16)(dir->tdir_offset & 0xff); - case 3: v[2] = (uint16)((dir->tdir_offset >> 8) & 0xff); - case 2: v[1] = (uint16)((dir->tdir_offset >> 16) & 0xff); - case 1: v[0] = (uint16)(dir->tdir_offset >> 24); - } - } else { - if (dir->tdir_type == TIFF_SBYTE) - switch (dir->tdir_count) { - case 4: v[3] = (signed char)(dir->tdir_offset >> 24); - case 3: v[2] = (signed char)((dir->tdir_offset >> 16) & 0xff); - case 2: v[1] = (signed char)((dir->tdir_offset >> 8) & 0xff); - case 1: v[0] = (signed char)(dir->tdir_offset & 0xff); - } - else - switch (dir->tdir_count) { - case 4: v[3] = (uint16)(dir->tdir_offset >> 24); - case 3: v[2] = (uint16)((dir->tdir_offset >> 16) & 0xff); - case 2: v[1] = (uint16)((dir->tdir_offset >> 8) & 0xff); - case 1: v[0] = (uint16)(dir->tdir_offset & 0xff); - } - } - return (1); - } else - return (TIFFFetchData(tif, dir, (char*) v) != 0); /* XXX */ -} - -/* - * Fetch an array of SHORT or SSHORT values. - */ -static int -TIFFFetchShortArray(TIFF* tif, TIFFDirEntry* dir, uint16* v) -{ - if (dir->tdir_count <= 2) { - if (tif->tif_header.tiff_magic == TIFF_BIGENDIAN) { - switch (dir->tdir_count) { - case 2: v[1] = (uint16) (dir->tdir_offset & 0xffff); - case 1: v[0] = (uint16) (dir->tdir_offset >> 16); - } - } else { - switch (dir->tdir_count) { - case 2: v[1] = (uint16) (dir->tdir_offset >> 16); - case 1: v[0] = (uint16) (dir->tdir_offset & 0xffff); - } - } - return (1); - } else - return (TIFFFetchData(tif, dir, (char *)v) != 0); -} - -/* - * Fetch a pair of SHORT or BYTE values. - */ -static int -TIFFFetchShortPair(TIFF* tif, TIFFDirEntry* dir) -{ - uint16 v[4]; - int ok = 0; - - switch (dir->tdir_type) { - case TIFF_SHORT: - case TIFF_SSHORT: - ok = TIFFFetchShortArray(tif, dir, v); - break; - case TIFF_BYTE: - case TIFF_SBYTE: - ok = TIFFFetchByteArray(tif, dir, v); - break; - } - if (ok) - TIFFSetField(tif, dir->tdir_tag, v[0], v[1]); - return (ok); -} - -/* - * Fetch an array of LONG or SLONG values. - */ -static int -TIFFFetchLongArray(TIFF* tif, TIFFDirEntry* dir, uint32* v) -{ - if (dir->tdir_count == 1) { - v[0] = dir->tdir_offset; - return (1); - } else - return (TIFFFetchData(tif, dir, (char*) v) != 0); -} - -/* - * Fetch an array of RATIONAL or SRATIONAL values. - */ -static int -TIFFFetchRationalArray(TIFF* tif, TIFFDirEntry* dir, float* v) -{ - int ok = 0; - uint32* l; - - l = (uint32*)CheckMalloc(tif, - dir->tdir_count, TIFFDataWidth((TIFFDataType) dir->tdir_type), - "to fetch array of rationals"); - if (l) { - if (TIFFFetchData(tif, dir, (char *)l)) { - uint32 i; - for (i = 0; i < dir->tdir_count; i++) { - ok = cvtRational(tif, dir, - l[2*i+0], l[2*i+1], &v[i]); - if (!ok) - break; - } - } - _TIFFfree((char *)l); - } - return (ok); -} - -/* - * Fetch an array of FLOAT values. - */ -static int -TIFFFetchFloatArray(TIFF* tif, TIFFDirEntry* dir, float* v) -{ - - if (dir->tdir_count == 1) { - v[0] = *(float*) &dir->tdir_offset; - TIFFCvtIEEEFloatToNative(tif, dir->tdir_count, v); - return (1); - } else if (TIFFFetchData(tif, dir, (char*) v)) { - TIFFCvtIEEEFloatToNative(tif, dir->tdir_count, v); - return (1); - } else - return (0); -} - -/* - * Fetch an array of DOUBLE values. - */ -static int -TIFFFetchDoubleArray(TIFF* tif, TIFFDirEntry* dir, double* v) -{ - if (TIFFFetchData(tif, dir, (char*) v)) { - TIFFCvtIEEEDoubleToNative(tif, dir->tdir_count, v); - return (1); - } else - return (0); -} - -/* - * Fetch an array of ANY values. The actual values are - * returned as doubles which should be able hold all the - * types. Yes, there really should be an tany_t to avoid - * this potential non-portability ... Note in particular - * that we assume that the double return value vector is - * large enough to read in any fundamental type. We use - * that vector as a buffer to read in the base type vector - * and then convert it in place to double (from end - * to front of course). - */ -static int -TIFFFetchAnyArray(TIFF* tif, TIFFDirEntry* dir, double* v) -{ - int i; - - switch (dir->tdir_type) { - case TIFF_BYTE: - case TIFF_SBYTE: - if (!TIFFFetchByteArray(tif, dir, (uint16*) v)) - return (0); - if (dir->tdir_type == TIFF_BYTE) { - uint16* vp = (uint16*) v; - for (i = dir->tdir_count-1; i >= 0; i--) - v[i] = vp[i]; - } else { - int16* vp = (int16*) v; - for (i = dir->tdir_count-1; i >= 0; i--) - v[i] = vp[i]; - } - break; - case TIFF_SHORT: - case TIFF_SSHORT: - if (!TIFFFetchShortArray(tif, dir, (uint16*) v)) - return (0); - if (dir->tdir_type == TIFF_SHORT) { - uint16* vp = (uint16*) v; - for (i = dir->tdir_count-1; i >= 0; i--) - v[i] = vp[i]; - } else { - int16* vp = (int16*) v; - for (i = dir->tdir_count-1; i >= 0; i--) - v[i] = vp[i]; - } - break; - case TIFF_LONG: - case TIFF_SLONG: - if (!TIFFFetchLongArray(tif, dir, (uint32*) v)) - return (0); - if (dir->tdir_type == TIFF_LONG) { - uint32* vp = (uint32*) v; - for (i = dir->tdir_count-1; i >= 0; i--) - v[i] = vp[i]; - } else { - int32* vp = (int32*) v; - for (i = dir->tdir_count-1; i >= 0; i--) - v[i] = vp[i]; - } - break; - case TIFF_RATIONAL: - case TIFF_SRATIONAL: - if (!TIFFFetchRationalArray(tif, dir, (float*) v)) - return (0); - { float* vp = (float*) v; - for (i = dir->tdir_count-1; i >= 0; i--) - v[i] = vp[i]; - } - break; - case TIFF_FLOAT: - if (!TIFFFetchFloatArray(tif, dir, (float*) v)) - return (0); - { float* vp = (float*) v; - for (i = dir->tdir_count-1; i >= 0; i--) - v[i] = vp[i]; - } - break; - case TIFF_DOUBLE: - return (TIFFFetchDoubleArray(tif, dir, (double*) v)); - default: - /* TIFF_NOTYPE */ - /* TIFF_ASCII */ - /* TIFF_UNDEFINED */ - TIFFError(tif->tif_name, - "cannot read TIFF_ANY type %d for field \"%s\"", - _TIFFFieldWithTag(tif, dir->tdir_tag)->field_name); - return (0); - } - return (1); -} - -/* - * Fetch a tag that is not handled by special case code. - */ -static int -TIFFFetchNormalTag(TIFF* tif, TIFFDirEntry* dp) -{ - static const char mesg[] = "to fetch tag value"; - int ok = 0; - const TIFFFieldInfo* fip = _TIFFFieldWithTag(tif, dp->tdir_tag); - - if (dp->tdir_count > 1) { /* array of values */ - char* cp = NULL; - - switch (dp->tdir_type) { - case TIFF_BYTE: - case TIFF_SBYTE: - /* NB: always expand BYTE values to shorts */ - cp = CheckMalloc(tif, - dp->tdir_count, sizeof (uint16), mesg); - ok = cp && TIFFFetchByteArray(tif, dp, (uint16*) cp); - break; - case TIFF_SHORT: - case TIFF_SSHORT: - cp = CheckMalloc(tif, - dp->tdir_count, sizeof (uint16), mesg); - ok = cp && TIFFFetchShortArray(tif, dp, (uint16*) cp); - break; - case TIFF_LONG: - case TIFF_SLONG: - cp = CheckMalloc(tif, - dp->tdir_count, sizeof (uint32), mesg); - ok = cp && TIFFFetchLongArray(tif, dp, (uint32*) cp); - break; - case TIFF_RATIONAL: - case TIFF_SRATIONAL: - cp = CheckMalloc(tif, - dp->tdir_count, sizeof (float), mesg); - ok = cp && TIFFFetchRationalArray(tif, dp, (float*) cp); - break; - case TIFF_FLOAT: - cp = CheckMalloc(tif, - dp->tdir_count, sizeof (float), mesg); - ok = cp && TIFFFetchFloatArray(tif, dp, (float*) cp); - break; - case TIFF_DOUBLE: - cp = CheckMalloc(tif, - dp->tdir_count, sizeof (double), mesg); - ok = cp && TIFFFetchDoubleArray(tif, dp, (double*) cp); - break; - case TIFF_ASCII: - case TIFF_UNDEFINED: /* bit of a cheat... */ - /* - * Some vendors write strings w/o the trailing - * NULL byte, so always append one just in case. - */ - cp = CheckMalloc(tif, dp->tdir_count+1, 1, mesg); - if( (ok = (cp && TIFFFetchString(tif, dp, cp))) != 0 ) - cp[dp->tdir_count] = '\0'; /* XXX */ - break; - } - if (ok) { - ok = (fip->field_passcount ? - TIFFSetField(tif, dp->tdir_tag, dp->tdir_count, cp) - : TIFFSetField(tif, dp->tdir_tag, cp)); - } - if (cp != NULL) - _TIFFfree(cp); - } else if (CheckDirCount(tif, dp, 1)) { /* singleton value */ - switch (dp->tdir_type) { - case TIFF_BYTE: - case TIFF_SBYTE: - case TIFF_SHORT: - case TIFF_SSHORT: - /* - * If the tag is also acceptable as a LONG or SLONG - * then TIFFSetField will expect an uint32 parameter - * passed to it (through varargs). Thus, for machines - * where sizeof (int) != sizeof (uint32) we must do - * a careful check here. It's hard to say if this - * is worth optimizing. - * - * NB: We use TIFFFieldWithTag here knowing that - * it returns us the first entry in the table - * for the tag and that that entry is for the - * widest potential data type the tag may have. - */ - { TIFFDataType type = fip->field_type; - if (type != TIFF_LONG && type != TIFF_SLONG) { - uint16 v = (uint16) - TIFFExtractData(tif, dp->tdir_type, dp->tdir_offset); - ok = (fip->field_passcount ? - TIFFSetField(tif, dp->tdir_tag, 1, &v) - : TIFFSetField(tif, dp->tdir_tag, v)); - break; - } - } - /* fall thru... */ - case TIFF_LONG: - case TIFF_SLONG: - { uint32 v32 = - TIFFExtractData(tif, dp->tdir_type, dp->tdir_offset); - ok = (fip->field_passcount ? - TIFFSetField(tif, dp->tdir_tag, 1, &v32) - : TIFFSetField(tif, dp->tdir_tag, v32)); - } - break; - case TIFF_RATIONAL: - case TIFF_SRATIONAL: - case TIFF_FLOAT: - { float v = (dp->tdir_type == TIFF_FLOAT ? - TIFFFetchFloat(tif, dp) - : TIFFFetchRational(tif, dp)); - ok = (fip->field_passcount ? - TIFFSetField(tif, dp->tdir_tag, 1, &v) - : TIFFSetField(tif, dp->tdir_tag, v)); - } - break; - case TIFF_DOUBLE: - { double v; - ok = (TIFFFetchDoubleArray(tif, dp, &v) && - (fip->field_passcount ? - TIFFSetField(tif, dp->tdir_tag, 1, &v) - : TIFFSetField(tif, dp->tdir_tag, v)) - ); - } - break; - case TIFF_ASCII: - case TIFF_UNDEFINED: /* bit of a cheat... */ - { char c[2]; - if( (ok = (TIFFFetchString(tif, dp, c) != 0)) != 0 ){ - c[1] = '\0'; /* XXX paranoid */ - ok = TIFFSetField(tif, dp->tdir_tag, c); - } - } - break; - } - } - return (ok); -} - -#define NITEMS(x) (sizeof (x) / sizeof (x[0])) -/* - * Fetch samples/pixel short values for - * the specified tag and verify that - * all values are the same. - */ -static int -TIFFFetchPerSampleShorts(TIFF* tif, TIFFDirEntry* dir, int* pl) -{ - int samples = tif->tif_dir.td_samplesperpixel; - int status = 0; - - if (CheckDirCount(tif, dir, (uint32) samples)) { - uint16 buf[10]; - uint16* v = buf; - - if (samples > NITEMS(buf)) - v = (uint16*) CheckMalloc(tif, samples, sizeof (uint16), - "to fetch per-sample values"); - if (v && TIFFFetchShortArray(tif, dir, v)) { - int i; - for (i = 1; i < samples; i++) - if (v[i] != v[0]) { - TIFFError(tif->tif_name, - "Cannot handle different per-sample values for field \"%s\"", - _TIFFFieldWithTag(tif, dir->tdir_tag)->field_name); - goto bad; - } - *pl = v[0]; - status = 1; - } - bad: - if (v && v != buf) - _TIFFfree((char*) v); - } - return (status); -} - -/* - * Fetch samples/pixel ANY values for - * the specified tag and verify that - * all values are the same. - */ -static int -TIFFFetchPerSampleAnys(TIFF* tif, TIFFDirEntry* dir, double* pl) -{ - int samples = (int) tif->tif_dir.td_samplesperpixel; - int status = 0; - - if (CheckDirCount(tif, dir, (uint32) samples)) { - double buf[10]; - double* v = buf; - - if (samples > NITEMS(buf)) - v = (double*) CheckMalloc(tif, samples, sizeof (double), - "to fetch per-sample values"); - if (v && TIFFFetchAnyArray(tif, dir, v)) { - int i; - for (i = 1; i < samples; i++) - if (v[i] != v[0]) { - TIFFError(tif->tif_name, - "Cannot handle different per-sample values for field \"%s\"", - _TIFFFieldWithTag(tif, dir->tdir_tag)->field_name); - goto bad; - } - *pl = v[0]; - status = 1; - } - bad: - if (v && v != buf) - _TIFFfree(v); - } - return (status); -} -#undef NITEMS - -/* - * Fetch a set of offsets or lengths. - * While this routine says "strips", - * in fact it's also used for tiles. - */ -static int -TIFFFetchStripThing(TIFF* tif, TIFFDirEntry* dir, long nstrips, uint32** lpp) -{ - register uint32* lp; - int status; - - CheckDirCount(tif, dir, (uint32) nstrips); - - /* - * Allocate space for strip information. - */ - if (*lpp == NULL && - (*lpp = (uint32 *)CheckMalloc(tif, - nstrips, sizeof (uint32), "for strip array")) == NULL) - return (0); - lp = *lpp; - memset( lp, 0, sizeof(uint32) * nstrips ); - - if (dir->tdir_type == (int)TIFF_SHORT) { - /* - * Handle uint16->uint32 expansion. - */ - uint16* dp = (uint16*) CheckMalloc(tif, - dir->tdir_count, sizeof (uint16), "to fetch strip tag"); - if (dp == NULL) - return (0); - if( (status = TIFFFetchShortArray(tif, dir, dp)) != 0 ) { - int i; - - for( i = 0; i < nstrips && i < (int) dir->tdir_count; i++ ) - { - lp[i] = dp[i]; - } - } - _TIFFfree((char*) dp); - - } else if( nstrips != (int) dir->tdir_count ) { - /* Special case to correct length */ - - uint32* dp = (uint32*) CheckMalloc(tif, - dir->tdir_count, sizeof (uint32), "to fetch strip tag"); - if (dp == NULL) - return (0); - - status = TIFFFetchLongArray(tif, dir, dp); - if( status != 0 ) { - int i; - - for( i = 0; i < nstrips && i < (int) dir->tdir_count; i++ ) - { - lp[i] = dp[i]; - } - } - - _TIFFfree( (char *) dp ); - } else - status = TIFFFetchLongArray(tif, dir, lp); - - return (status); -} - -#define NITEMS(x) (sizeof (x) / sizeof (x[0])) -/* - * Fetch and set the ExtraSamples tag. - */ -static int -TIFFFetchExtraSamples(TIFF* tif, TIFFDirEntry* dir) -{ - uint16 buf[10]; - uint16* v = buf; - int status; - - if (dir->tdir_count > NITEMS(buf)) { - v = (uint16*) CheckMalloc(tif, dir->tdir_count, sizeof (uint16), - "to fetch extra samples"); - if (!v) - return (0); - } - if (dir->tdir_type == TIFF_BYTE) - status = TIFFFetchByteArray(tif, dir, v); - else - status = TIFFFetchShortArray(tif, dir, v); - if (status) - status = TIFFSetField(tif, dir->tdir_tag, dir->tdir_count, v); - if (v != buf) - _TIFFfree((char*) v); - return (status); -} -#undef NITEMS - -#ifdef COLORIMETRY_SUPPORT -/* - * Fetch and set the RefBlackWhite tag. - */ -static int -TIFFFetchRefBlackWhite(TIFF* tif, TIFFDirEntry* dir) -{ - static const char mesg[] = "for \"ReferenceBlackWhite\" array"; - char* cp; - int ok; - - if (dir->tdir_type == TIFF_RATIONAL) - return (TIFFFetchNormalTag(tif, dir)); - /* - * Handle LONG's for backward compatibility. - */ - cp = CheckMalloc(tif, dir->tdir_count, sizeof (uint32), mesg); - if( (ok = (cp && TIFFFetchLongArray(tif, dir, (uint32*) cp))) != 0) { - float* fp = (float*) - CheckMalloc(tif, dir->tdir_count, sizeof (float), mesg); - if( (ok = (fp != NULL)) != 0 ) { - uint32 i; - for (i = 0; i < dir->tdir_count; i++) - fp[i] = (float)((uint32*) cp)[i]; - ok = TIFFSetField(tif, dir->tdir_tag, fp); - _TIFFfree((char*) fp); - } - } - if (cp) - _TIFFfree(cp); - return (ok); -} -#endif - -/* - * Replace a single strip (tile) of uncompressed data by - * multiple strips (tiles), each approximately 8Kbytes. - * This is useful for dealing with large images or - * for dealing with machines with a limited amount - * memory. - */ -static void -ChopUpSingleUncompressedStrip(TIFF* tif) -{ - register TIFFDirectory *td = &tif->tif_dir; - uint32 bytecount = td->td_stripbytecount[0]; - uint32 offset = td->td_stripoffset[0]; - tsize_t rowbytes = TIFFVTileSize(tif, 1), stripbytes; - tstrip_t strip, nstrips, rowsperstrip; - uint32* newcounts; - uint32* newoffsets; - - /* - * Make the rows hold at least one - * scanline, but fill 8k if possible. - */ - if (rowbytes > 8192) { - stripbytes = rowbytes; - rowsperstrip = 1; - } else if (rowbytes > 0 ) { - rowsperstrip = 8192 / rowbytes; - stripbytes = rowbytes * rowsperstrip; - } - else - return; - - /* never increase the number of strips in an image */ - if (rowsperstrip >= td->td_rowsperstrip) - return; - nstrips = (tstrip_t) TIFFhowmany(bytecount, stripbytes); - newcounts = (uint32*) CheckMalloc(tif, nstrips, sizeof (uint32), - "for chopped \"StripByteCounts\" array"); - newoffsets = (uint32*) CheckMalloc(tif, nstrips, sizeof (uint32), - "for chopped \"StripOffsets\" array"); - if (newcounts == NULL || newoffsets == NULL) { - /* - * Unable to allocate new strip information, give - * up and use the original one strip information. - */ - if (newcounts != NULL) - _TIFFfree(newcounts); - if (newoffsets != NULL) - _TIFFfree(newoffsets); - return; - } - /* - * Fill the strip information arrays with - * new bytecounts and offsets that reflect - * the broken-up format. - */ - for (strip = 0; strip < nstrips; strip++) { - if (stripbytes > (tsize_t) bytecount) - stripbytes = bytecount; - newcounts[strip] = stripbytes; - newoffsets[strip] = offset; - offset += stripbytes; - bytecount -= stripbytes; - } - /* - * Replace old single strip info with multi-strip info. - */ - td->td_stripsperimage = td->td_nstrips = nstrips; - TIFFSetField(tif, TIFFTAG_ROWSPERSTRIP, rowsperstrip); - - _TIFFfree(td->td_stripbytecount); - _TIFFfree(td->td_stripoffset); - td->td_stripbytecount = newcounts; - td->td_stripoffset = newoffsets; -} diff --git a/wxWidgets/src/tiff/tif_dirwrite.c b/wxWidgets/src/tiff/tif_dirwrite.c deleted file mode 100644 index df120153f2..0000000000 --- a/wxWidgets/src/tiff/tif_dirwrite.c +++ /dev/null @@ -1,1256 +0,0 @@ -/* $Header$ */ - -/* - * Copyright (c) 1988-1997 Sam Leffler - * Copyright (c) 1991-1997 Silicon Graphics, Inc. - * - * Permission to use, copy, modify, distribute, and sell this software and - * its documentation for any purpose is hereby granted without fee, provided - * that (i) the above copyright notices and this permission notice appear in - * all copies of the software and related documentation, and (ii) the names of - * Sam Leffler and Silicon Graphics may not be used in any advertising or - * publicity relating to the software without the specific, prior written - * permission of Sam Leffler and Silicon Graphics. - * - * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, - * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * - * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR - * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, - * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF - * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE - * OF THIS SOFTWARE. - */ - -/* - * TIFF Library. - * - * Directory Write Support Routines. - */ -#include "tiffiop.h" - -#if HAVE_IEEEFP -#define TIFFCvtNativeToIEEEFloat(tif, n, fp) -#define TIFFCvtNativeToIEEEDouble(tif, n, dp) -#else -extern void TIFFCvtNativeToIEEEFloat(TIFF*, uint32, float*); -extern void TIFFCvtNativeToIEEEDouble(TIFF*, uint32, double*); -#endif - -static int TIFFWriteNormalTag(TIFF*, TIFFDirEntry*, const TIFFFieldInfo*); -static void TIFFSetupShortLong(TIFF*, ttag_t, TIFFDirEntry*, uint32); -static void TIFFSetupShort(TIFF*, ttag_t, TIFFDirEntry*, uint16); -static int TIFFSetupShortPair(TIFF*, ttag_t, TIFFDirEntry*); -static int TIFFWritePerSampleShorts(TIFF*, ttag_t, TIFFDirEntry*); -static int TIFFWritePerSampleAnys(TIFF*, TIFFDataType, ttag_t, TIFFDirEntry*); -static int TIFFWriteShortTable(TIFF*, ttag_t, TIFFDirEntry*, uint32, uint16**); -static int TIFFWriteShortArray(TIFF*, - TIFFDataType, ttag_t, TIFFDirEntry*, uint32, uint16*); -static int TIFFWriteLongArray(TIFF *, - TIFFDataType, ttag_t, TIFFDirEntry*, uint32, uint32*); -static int TIFFWriteRationalArray(TIFF *, - TIFFDataType, ttag_t, TIFFDirEntry*, uint32, float*); -static int TIFFWriteFloatArray(TIFF *, - TIFFDataType, ttag_t, TIFFDirEntry*, uint32, float*); -static int TIFFWriteDoubleArray(TIFF *, - TIFFDataType, ttag_t, TIFFDirEntry*, uint32, double*); -static int TIFFWriteByteArray(TIFF*, TIFFDirEntry*, char*); -static int TIFFWriteAnyArray(TIFF*, - TIFFDataType, ttag_t, TIFFDirEntry*, uint32, double*); -#ifdef COLORIMETRY_SUPPORT -static int TIFFWriteTransferFunction(TIFF*, TIFFDirEntry*); -#endif -#ifdef CMYK_SUPPORT -static int TIFFWriteInkNames(TIFF*, TIFFDirEntry*); -#endif -static int TIFFWriteData(TIFF*, TIFFDirEntry*, char*); -static int TIFFLinkDirectory(TIFF*); - -#define WriteRationalPair(type, tag1, v1, tag2, v2) { \ - if (!TIFFWriteRational(tif, type, tag1, dir, v1)) \ - goto bad; \ - if (!TIFFWriteRational(tif, type, tag2, dir+1, v2)) \ - goto bad; \ - dir++; \ -} -#define TIFFWriteRational(tif, type, tag, dir, v) \ - TIFFWriteRationalArray((tif), (type), (tag), (dir), 1, &(v)) -#ifndef TIFFWriteRational -static int TIFFWriteRational(TIFF*, - TIFFDataType, ttag_t, TIFFDirEntry*, float); -#endif - -/* - * Write the contents of the current directory - * to the specified file. This routine doesn't - * handle overwriting a directory with auxiliary - * storage that's been changed. - */ -static int -_TIFFWriteDirectory(TIFF* tif, int done) -{ - uint16 dircount; - toff_t diroff; - ttag_t tag; - uint32 nfields; - tsize_t dirsize; - char* data; - TIFFDirEntry* dir; - TIFFDirectory* td; - u_long b, fields[FIELD_SETLONGS]; - int fi, nfi; - - if (tif->tif_mode == O_RDONLY) - return (1); - /* - * Clear write state so that subsequent images with - * different characteristics get the right buffers - * setup for them. - */ - if (done) - { - if (tif->tif_flags & TIFF_POSTENCODE) { - tif->tif_flags &= ~TIFF_POSTENCODE; - if (!(*tif->tif_postencode)(tif)) { - TIFFError(tif->tif_name, - "Error post-encoding before directory write"); - return (0); - } - } - (*tif->tif_close)(tif); /* shutdown encoder */ - /* - * Flush any data that might have been written - * by the compression close+cleanup routines. - */ - if (tif->tif_rawcc > 0 && !TIFFFlushData1(tif)) { - TIFFError(tif->tif_name, - "Error flushing data before directory write"); - return (0); - } - if ((tif->tif_flags & TIFF_MYBUFFER) && tif->tif_rawdata) { - _TIFFfree(tif->tif_rawdata); - tif->tif_rawdata = NULL; - tif->tif_rawcc = 0; - tif->tif_rawdatasize = 0; - } - tif->tif_flags &= ~(TIFF_BEENWRITING|TIFF_BUFFERSETUP); - } - - td = &tif->tif_dir; - /* - * Size the directory so that we can calculate - * offsets for the data items that aren't kept - * in-place in each field. - */ - nfields = 0; - for (b = 0; b <= FIELD_LAST; b++) - if (TIFFFieldSet(tif, b) && b != FIELD_CUSTOM) - nfields += (b < FIELD_SUBFILETYPE ? 2 : 1); - nfields += td->td_customValueCount; - dirsize = nfields * sizeof (TIFFDirEntry); - data = (char*) _TIFFmalloc(dirsize); - if (data == NULL) { - TIFFError(tif->tif_name, - "Cannot write directory, out of space"); - return (0); - } - /* - * Directory hasn't been placed yet, put - * it at the end of the file and link it - * into the existing directory structure. - */ - if (tif->tif_diroff == 0 && !TIFFLinkDirectory(tif)) - goto bad; - tif->tif_dataoff = (toff_t)( - tif->tif_diroff + sizeof (uint16) + dirsize + sizeof (toff_t)); - if (tif->tif_dataoff & 1) - tif->tif_dataoff++; - (void) TIFFSeekFile(tif, tif->tif_dataoff, SEEK_SET); - tif->tif_curdir++; - dir = (TIFFDirEntry*) data; - /* - * Setup external form of directory - * entries and write data items. - */ - _TIFFmemcpy(fields, td->td_fieldsset, sizeof (fields)); - /* - * Write out ExtraSamples tag only if - * extra samples are present in the data. - */ - if (FieldSet(fields, FIELD_EXTRASAMPLES) && !td->td_extrasamples) { - ResetFieldBit(fields, FIELD_EXTRASAMPLES); - nfields--; - dirsize -= sizeof (TIFFDirEntry); - } /*XXX*/ - for (fi = 0, nfi = tif->tif_nfields; nfi > 0; nfi--, fi++) { - const TIFFFieldInfo* fip = tif->tif_fieldinfo[fi]; - - /* - ** For custom fields, we test to see if the custom field - ** is set or not. For normal fields, we just use the - ** FieldSet test. - */ - if( fip->field_bit == FIELD_CUSTOM ) - { - int ci, is_set = FALSE; - - for( ci = 0; ci < td->td_customValueCount; ci++ ) - is_set |= (td->td_customValues[ci].info == fip); - - if( !is_set ) - continue; - } - else if (!FieldSet(fields, fip->field_bit)) - continue; - - - /* - ** Handle other fields. - */ - switch (fip->field_bit) - { - case FIELD_STRIPOFFSETS: - /* - * We use one field bit for both strip and tile - - * offsets, and so must be careful in selecting - * the appropriate field descriptor (so that tags - * are written in sorted order). - */ - tag = isTiled(tif) ? - TIFFTAG_TILEOFFSETS : TIFFTAG_STRIPOFFSETS; - if (tag != fip->field_tag) - continue; - if (!TIFFWriteLongArray(tif, TIFF_LONG, tag, dir, - (uint32) td->td_nstrips, td->td_stripoffset)) - goto bad; - break; - case FIELD_STRIPBYTECOUNTS: - /* - * We use one field bit for both strip and tile - * byte counts, and so must be careful in selecting - * the appropriate field descriptor (so that tags - * are written in sorted order). - */ - tag = isTiled(tif) ? - TIFFTAG_TILEBYTECOUNTS : TIFFTAG_STRIPBYTECOUNTS; - if (tag != fip->field_tag) - continue; - if (!TIFFWriteLongArray(tif, TIFF_LONG, tag, dir, - (uint32) td->td_nstrips, td->td_stripbytecount)) - goto bad; - break; - case FIELD_ROWSPERSTRIP: - TIFFSetupShortLong(tif, TIFFTAG_ROWSPERSTRIP, - dir, td->td_rowsperstrip); - break; - case FIELD_COLORMAP: - if (!TIFFWriteShortTable(tif, TIFFTAG_COLORMAP, dir, - 3, td->td_colormap)) - goto bad; - break; - case FIELD_IMAGEDIMENSIONS: - TIFFSetupShortLong(tif, TIFFTAG_IMAGEWIDTH, - dir++, td->td_imagewidth); - TIFFSetupShortLong(tif, TIFFTAG_IMAGELENGTH, - dir, td->td_imagelength); - break; - case FIELD_TILEDIMENSIONS: - TIFFSetupShortLong(tif, TIFFTAG_TILEWIDTH, - dir++, td->td_tilewidth); - TIFFSetupShortLong(tif, TIFFTAG_TILELENGTH, - dir, td->td_tilelength); - break; - case FIELD_COMPRESSION: - TIFFSetupShort(tif, TIFFTAG_COMPRESSION, - dir, td->td_compression); - break; - case FIELD_PHOTOMETRIC: - TIFFSetupShort(tif, TIFFTAG_PHOTOMETRIC, - dir, td->td_photometric); - break; - case FIELD_POSITION: - WriteRationalPair(TIFF_RATIONAL, - TIFFTAG_XPOSITION, td->td_xposition, - TIFFTAG_YPOSITION, td->td_yposition); - break; - case FIELD_RESOLUTION: - WriteRationalPair(TIFF_RATIONAL, - TIFFTAG_XRESOLUTION, td->td_xresolution, - TIFFTAG_YRESOLUTION, td->td_yresolution); - break; - case FIELD_BITSPERSAMPLE: - case FIELD_MINSAMPLEVALUE: - case FIELD_MAXSAMPLEVALUE: - case FIELD_SAMPLEFORMAT: - if (!TIFFWritePerSampleShorts(tif, fip->field_tag, dir)) - goto bad; - break; - case FIELD_SMINSAMPLEVALUE: - case FIELD_SMAXSAMPLEVALUE: - if (!TIFFWritePerSampleAnys(tif, - _TIFFSampleToTagType(tif), fip->field_tag, dir)) - goto bad; - break; - case FIELD_PAGENUMBER: - case FIELD_HALFTONEHINTS: -#ifdef YCBCR_SUPPORT - case FIELD_YCBCRSUBSAMPLING: -#endif -#ifdef CMYK_SUPPORT - case FIELD_DOTRANGE: -#endif - if (!TIFFSetupShortPair(tif, fip->field_tag, dir)) - goto bad; - break; -#ifdef CMYK_SUPPORT - case FIELD_INKNAMES: - if (!TIFFWriteInkNames(tif, dir)) - goto bad; - break; -#endif -#ifdef COLORIMETRY_SUPPORT - case FIELD_TRANSFERFUNCTION: - if (!TIFFWriteTransferFunction(tif, dir)) - goto bad; - break; -#endif -#if SUBIFD_SUPPORT - case FIELD_SUBIFD: - if (!TIFFWriteNormalTag(tif, dir, fip)) - goto bad; - /* - * Total hack: if this directory includes a SubIFD - * tag then force the next directories to be - * written as ``sub directories'' of this one. This - * is used to write things like thumbnails and - * image masks that one wants to keep out of the - * normal directory linkage access mechanism. - */ - if (dir->tdir_count > 0) { - tif->tif_flags |= TIFF_INSUBIFD; - tif->tif_nsubifd = (uint16) dir->tdir_count; - if (dir->tdir_count > 1) - tif->tif_subifdoff = dir->tdir_offset; - else - tif->tif_subifdoff = (uint32)( - tif->tif_diroff - + sizeof (uint16) - + ((char*)&dir->tdir_offset-data)); - } - break; -#endif - default: - if (!TIFFWriteNormalTag(tif, dir, fip)) - goto bad; - break; - } - dir++; - - if( fip->field_bit != FIELD_CUSTOM ) - ResetFieldBit(fields, fip->field_bit); - } - - /* - * Write directory. - */ - dircount = (uint16) nfields; - diroff = (uint32) tif->tif_nextdiroff; - if (tif->tif_flags & TIFF_SWAB) { - /* - * The file's byte order is opposite to the - * native machine architecture. We overwrite - * the directory information with impunity - * because it'll be released below after we - * write it to the file. Note that all the - * other tag construction routines assume that - * we do this byte-swapping; i.e. they only - * byte-swap indirect data. - */ - for (dir = (TIFFDirEntry*) data; dircount; dir++, dircount--) { - TIFFSwabArrayOfShort(&dir->tdir_tag, 2); - TIFFSwabArrayOfLong(&dir->tdir_count, 2); - } - dircount = (uint16) nfields; - TIFFSwabShort(&dircount); - TIFFSwabLong(&diroff); - } - (void) TIFFSeekFile(tif, tif->tif_diroff, SEEK_SET); - if (!WriteOK(tif, &dircount, sizeof (dircount))) { - TIFFError(tif->tif_name, "Error writing directory count"); - goto bad; - } - if (!WriteOK(tif, data, dirsize)) { - TIFFError(tif->tif_name, "Error writing directory contents"); - goto bad; - } - if (!WriteOK(tif, &diroff, sizeof (diroff))) { - TIFFError(tif->tif_name, "Error writing directory link"); - goto bad; - } - if (done) { - TIFFFreeDirectory(tif); - tif->tif_flags &= ~TIFF_DIRTYDIRECT; - (*tif->tif_cleanup)(tif); - - /* - * Reset directory-related state for subsequent - * directories. - */ - TIFFCreateDirectory(tif); - } - _TIFFfree(data); - return (1); -bad: - _TIFFfree(data); - return (0); -} -#undef WriteRationalPair - -int -TIFFWriteDirectory(TIFF* tif) -{ - return _TIFFWriteDirectory(tif, TRUE); -} - -/* - * Similar to TIFFWriteDirectory(), writes the directory out - * but leaves all data structures in memory so that it can be - * written again. This will make a partially written TIFF file - * readable before it is successfully completed/closed. - */ -int -TIFFCheckpointDirectory(TIFF* tif) -{ - int rc; - /* Setup the strips arrays, if they haven't already been. */ - if (tif->tif_dir.td_stripoffset == NULL) - (void) TIFFSetupStrips(tif); - rc = _TIFFWriteDirectory(tif, FALSE); - (void) TIFFSetWriteOffset(tif, TIFFSeekFile(tif, 0, SEEK_END)); - return rc; -} - -/* - * Process tags that are not special cased. - */ -static int -TIFFWriteNormalTag(TIFF* tif, TIFFDirEntry* dir, const TIFFFieldInfo* fip) -{ - u_short wc = (u_short) fip->field_writecount; - uint32 wc2; - - dir->tdir_tag = (uint16) fip->field_tag; - dir->tdir_type = (u_short) fip->field_type; - dir->tdir_count = wc; -#define WRITEF(x,y) x(tif, fip->field_type, fip->field_tag, dir, wc, y) - switch (fip->field_type) { - case TIFF_SHORT: - case TIFF_SSHORT: - if (wc > 1) { - uint16* wp; - if (wc == (u_short) TIFF_VARIABLE - || fip->field_passcount) - TIFFGetField(tif, fip->field_tag, &wc, &wp); - else - TIFFGetField(tif, fip->field_tag, &wp); - if (!WRITEF(TIFFWriteShortArray, wp)) - return (0); - } else { - if (fip->field_passcount) { - uint16* wp; - TIFFGetField(tif, fip->field_tag, &wc, &wp); - if (!WRITEF(TIFFWriteShortArray, wp)) - return 0; - } else { - uint16 sv; - TIFFGetField(tif, fip->field_tag, &sv); - dir->tdir_offset = - TIFFInsertData(tif, dir->tdir_type, sv); - } - } - break; - case TIFF_LONG: - case TIFF_SLONG: - case TIFF_IFD: - if (wc > 1) { - uint32* lp; - if (wc == (u_short) TIFF_VARIABLE - || fip->field_passcount) - TIFFGetField(tif, fip->field_tag, &wc, &lp); - else - TIFFGetField(tif, fip->field_tag, &lp); - if (!WRITEF(TIFFWriteLongArray, lp)) - return (0); - } else { - if (fip->field_passcount) { - uint32* lp; - TIFFGetField(tif, fip->field_tag, &wc, &lp); - if (!WRITEF(TIFFWriteLongArray, lp)) - return 0; - } else { - /* XXX handle LONG->SHORT conversion */ - TIFFGetField(tif, fip->field_tag, - &dir->tdir_offset); - } - } - break; - case TIFF_RATIONAL: - case TIFF_SRATIONAL: - if (wc > 1) { - float* fp; - if (wc == (u_short) TIFF_VARIABLE - || fip->field_passcount) - TIFFGetField(tif, fip->field_tag, &wc, &fp); - else - TIFFGetField(tif, fip->field_tag, &fp); - if (!WRITEF(TIFFWriteRationalArray, fp)) - return (0); - } else { - if (fip->field_passcount) { - float* fp; - TIFFGetField(tif, fip->field_tag, &wc, &fp); - if (!WRITEF(TIFFWriteRationalArray, fp)) - return 0; - } else { - float fv; - TIFFGetField(tif, fip->field_tag, &fv); - if (!WRITEF(TIFFWriteRationalArray, &fv)) - return (0); - } - } - break; - case TIFF_FLOAT: - if (wc > 1) { - float* fp; - if (wc == (u_short) TIFF_VARIABLE - || fip->field_passcount) - TIFFGetField(tif, fip->field_tag, &wc, &fp); - else - TIFFGetField(tif, fip->field_tag, &fp); - if (!WRITEF(TIFFWriteFloatArray, fp)) - return (0); - } else { - if (fip->field_passcount) { - float* fp; - TIFFGetField(tif, fip->field_tag, &wc, &fp); - if (!WRITEF(TIFFWriteFloatArray, fp)) - return 0; - } else { - float fv; - TIFFGetField(tif, fip->field_tag, &fv); - if (!WRITEF(TIFFWriteFloatArray, &fv)) - return (0); - } - } - break; - case TIFF_DOUBLE: - if (wc > 1) { - double* dp; - if (wc == (u_short) TIFF_VARIABLE - || fip->field_passcount) - TIFFGetField(tif, fip->field_tag, &wc, &dp); - else - TIFFGetField(tif, fip->field_tag, &dp); - if (!WRITEF(TIFFWriteDoubleArray, dp)) - return (0); - } else { - if (fip->field_passcount) { - double* dp; - TIFFGetField(tif, fip->field_tag, &wc, &dp); - if (!WRITEF(TIFFWriteDoubleArray, dp)) - return 0; - } else { - double dv; - TIFFGetField(tif, fip->field_tag, &dv); - if (!WRITEF(TIFFWriteDoubleArray, &dv)) - return (0); - } - } - break; - case TIFF_ASCII: - { char* cp; - TIFFGetField(tif, fip->field_tag, &cp); - dir->tdir_count = (uint32) (strlen(cp) + 1); - if (!TIFFWriteByteArray(tif, dir, cp)) - return (0); - } - break; - - /* added based on patch request from MARTIN.MCBRIDE.MM@agfa.co.uk, - correctness not verified (FW, 99/08) */ - case TIFF_BYTE: - case TIFF_SBYTE: - if (wc > 1) { - char* cp; - if (wc == (u_short) TIFF_VARIABLE - || fip->field_passcount) { - TIFFGetField(tif, fip->field_tag, &wc, &cp); - dir->tdir_count = wc; - } else if (wc == (u_short) TIFF_VARIABLE2) { - TIFFGetField(tif, fip->field_tag, &wc2, &cp); - dir->tdir_count = wc2; - } else - TIFFGetField(tif, fip->field_tag, &cp); - if (!TIFFWriteByteArray(tif, dir, cp)) - return (0); - } else { - if (fip->field_passcount) { - char* cp; - TIFFGetField(tif, fip->field_tag, &wc, &cp); - dir->tdir_count = wc; - if (!TIFFWriteByteArray(tif, dir, cp)) - return 0; - } else { - char cv; - TIFFGetField(tif, fip->field_tag, &cv); - if (!TIFFWriteByteArray(tif, dir, &cv)) - return (0); - } - } - break; - - case TIFF_UNDEFINED: - { char* cp; - if (wc == (u_short) TIFF_VARIABLE) { - TIFFGetField(tif, fip->field_tag, &wc, &cp); - dir->tdir_count = wc; - } else if (wc == (u_short) TIFF_VARIABLE2) { - TIFFGetField(tif, fip->field_tag, &wc2, &cp); - dir->tdir_count = wc2; - } else - TIFFGetField(tif, fip->field_tag, &cp); - if (!TIFFWriteByteArray(tif, dir, cp)) - return (0); - } - break; - - case TIFF_NOTYPE: - break; - } - return (1); -} -#undef WRITEF - -/* - * Setup a directory entry with either a SHORT - * or LONG type according to the value. - */ -static void -TIFFSetupShortLong(TIFF* tif, ttag_t tag, TIFFDirEntry* dir, uint32 v) -{ - dir->tdir_tag = (uint16) tag; - dir->tdir_count = 1; - if (v > 0xffffL) { - dir->tdir_type = (short) TIFF_LONG; - dir->tdir_offset = v; - } else { - dir->tdir_type = (short) TIFF_SHORT; - dir->tdir_offset = TIFFInsertData(tif, (int) TIFF_SHORT, v); - } -} - -/* - * Setup a SHORT directory entry - */ -static void -TIFFSetupShort(TIFF* tif, ttag_t tag, TIFFDirEntry* dir, uint16 v) -{ - dir->tdir_tag = (uint16) tag; - dir->tdir_count = 1; - dir->tdir_type = (short) TIFF_SHORT; - dir->tdir_offset = TIFFInsertData(tif, (int) TIFF_SHORT, v); -} -#undef MakeShortDirent - -#ifndef TIFFWriteRational -/* - * Setup a RATIONAL directory entry and - * write the associated indirect value. - */ -static int -TIFFWriteRational(TIFF* tif, - TIFFDataType type, ttag_t tag, TIFFDirEntry* dir, float v) -{ - return (TIFFWriteRationalArray(tif, type, tag, dir, 1, &v)); -} -#endif - -#define NITEMS(x) (sizeof (x) / sizeof (x[0])) -/* - * Setup a directory entry that references a - * samples/pixel array of SHORT values and - * (potentially) write the associated indirect - * values. - */ -static int -TIFFWritePerSampleShorts(TIFF* tif, ttag_t tag, TIFFDirEntry* dir) -{ - uint16 buf[10], v; - uint16* w = buf; - int i, status, samples = tif->tif_dir.td_samplesperpixel; - - if (samples > NITEMS(buf)) { - w = (uint16*) _TIFFmalloc(samples * sizeof (uint16)); - if (w == NULL) { - TIFFError(tif->tif_name, - "No space to write per-sample shorts"); - return (0); - } - } - TIFFGetField(tif, tag, &v); - for (i = 0; i < samples; i++) - w[i] = v; - status = TIFFWriteShortArray(tif, TIFF_SHORT, tag, dir, samples, w); - if (w != buf) - _TIFFfree((char*) w); - return (status); -} - -/* - * Setup a directory entry that references a samples/pixel array of ``type'' - * values and (potentially) write the associated indirect values. The source - * data from TIFFGetField() for the specified tag must be returned as double. - */ -static int -TIFFWritePerSampleAnys(TIFF* tif, - TIFFDataType type, ttag_t tag, TIFFDirEntry* dir) -{ - double buf[10], v; - double* w = buf; - int i, status; - int samples = (int) tif->tif_dir.td_samplesperpixel; - - if (samples > NITEMS(buf)) { - w = (double*) _TIFFmalloc(samples * sizeof (double)); - if (w == NULL) { - TIFFError(tif->tif_name, - "No space to write per-sample values"); - return (0); - } - } - TIFFGetField(tif, tag, &v); - for (i = 0; i < samples; i++) - w[i] = v; - status = TIFFWriteAnyArray(tif, type, tag, dir, samples, w); - if (w != buf) - _TIFFfree(w); - return (status); -} -#undef NITEMS - -/* - * Setup a pair of shorts that are returned by - * value, rather than as a reference to an array. - */ -static int -TIFFSetupShortPair(TIFF* tif, ttag_t tag, TIFFDirEntry* dir) -{ - uint16 v[2]; - - TIFFGetField(tif, tag, &v[0], &v[1]); - return (TIFFWriteShortArray(tif, TIFF_SHORT, tag, dir, 2, v)); -} - -/* - * Setup a directory entry for an NxM table of shorts, - * where M is known to be 2**bitspersample, and write - * the associated indirect data. - */ -static int -TIFFWriteShortTable(TIFF* tif, - ttag_t tag, TIFFDirEntry* dir, uint32 n, uint16** table) -{ - uint32 i, off; - - dir->tdir_tag = (uint16) tag; - dir->tdir_type = (short) TIFF_SHORT; - /* XXX -- yech, fool TIFFWriteData */ - dir->tdir_count = (uint32) (1L<tif_dir.td_bitspersample); - off = tif->tif_dataoff; - for (i = 0; i < n; i++) - if (!TIFFWriteData(tif, dir, (char *)table[i])) - return (0); - dir->tdir_count *= n; - dir->tdir_offset = off; - return (1); -} - -/* - * Write/copy data associated with an ASCII or opaque tag value. - */ -static int -TIFFWriteByteArray(TIFF* tif, TIFFDirEntry* dir, char* cp) -{ - if (dir->tdir_count > 4) { - if (!TIFFWriteData(tif, dir, cp)) - return (0); - } else - _TIFFmemcpy(&dir->tdir_offset, cp, dir->tdir_count); - return (1); -} - -/* - * Setup a directory entry of an array of SHORT - * or SSHORT and write the associated indirect values. - */ -static int -TIFFWriteShortArray(TIFF* tif, - TIFFDataType type, ttag_t tag, TIFFDirEntry* dir, uint32 n, uint16* v) -{ - dir->tdir_tag = (uint16) tag; - dir->tdir_type = (short) type; - dir->tdir_count = n; - if (n <= 2) { - if (tif->tif_header.tiff_magic == TIFF_BIGENDIAN) { - dir->tdir_offset = (uint32) ((long) v[0] << 16); - if (n == 2) - dir->tdir_offset |= v[1] & 0xffff; - } else { - dir->tdir_offset = v[0] & 0xffff; - if (n == 2) - dir->tdir_offset |= (long) v[1] << 16; - } - return (1); - } else - return (TIFFWriteData(tif, dir, (char*) v)); -} - -/* - * Setup a directory entry of an array of LONG - * or SLONG and write the associated indirect values. - */ -static int -TIFFWriteLongArray(TIFF* tif, - TIFFDataType type, ttag_t tag, TIFFDirEntry* dir, uint32 n, uint32* v) -{ - dir->tdir_tag = (uint16) tag; - dir->tdir_type = (short) type; - dir->tdir_count = n; - if (n == 1) { - dir->tdir_offset = v[0]; - return (1); - } else - return (TIFFWriteData(tif, dir, (char*) v)); -} - -/* - * Setup a directory entry of an array of RATIONAL - * or SRATIONAL and write the associated indirect values. - */ -static int -TIFFWriteRationalArray(TIFF* tif, - TIFFDataType type, ttag_t tag, TIFFDirEntry* dir, uint32 n, float* v) -{ - uint32 i; - uint32* t; - int status; - - dir->tdir_tag = (uint16) tag; - dir->tdir_type = (short) type; - dir->tdir_count = n; - t = (uint32*) _TIFFmalloc(2*n * sizeof (uint32)); - if (t == NULL) { - TIFFError(tif->tif_name, - "No space to write RATIONAL array"); - return (0); - } - for (i = 0; i < n; i++) { - float fv = v[i]; - int sign = 1; - uint32 den; - - if (fv < 0) { - if (type == TIFF_RATIONAL) { - TIFFWarning(tif->tif_name, - "\"%s\": Information lost writing value (%g) as (unsigned) RATIONAL", - _TIFFFieldWithTag(tif,tag)->field_name, fv); - fv = 0; - } else - fv = -fv, sign = -1; - } - den = 1L; - if (fv > 0) { - while (fv < 1L<<(31-3) && den < 1L<<(31-3)) - fv *= 1<<3, den *= 1L<<3; - } - t[2*i+0] = (uint32) (sign * (fv + 0.5)); - t[2*i+1] = den; - } - status = TIFFWriteData(tif, dir, (char *)t); - _TIFFfree((char*) t); - return (status); -} - -static int -TIFFWriteFloatArray(TIFF* tif, - TIFFDataType type, ttag_t tag, TIFFDirEntry* dir, uint32 n, float* v) -{ - dir->tdir_tag = (uint16) tag; - dir->tdir_type = (short) type; - dir->tdir_count = n; - TIFFCvtNativeToIEEEFloat(tif, n, v); - if (n == 1) { - dir->tdir_offset = *(uint32*) &v[0]; - return (1); - } else - return (TIFFWriteData(tif, dir, (char*) v)); -} - -static int -TIFFWriteDoubleArray(TIFF* tif, - TIFFDataType type, ttag_t tag, TIFFDirEntry* dir, uint32 n, double* v) -{ - dir->tdir_tag = (uint16) tag; - dir->tdir_type = (short) type; - dir->tdir_count = n; - TIFFCvtNativeToIEEEDouble(tif, n, v); - return (TIFFWriteData(tif, dir, (char*) v)); -} - -/* - * Write an array of ``type'' values for a specified tag (i.e. this is a tag - * which is allowed to have different types, e.g. SMaxSampleType). - * Internally the data values are represented as double since a double can - * hold any of the TIFF tag types (yes, this should really be an abstract - * type tany_t for portability). The data is converted into the specified - * type in a temporary buffer and then handed off to the appropriate array - * writer. - */ -static int -TIFFWriteAnyArray(TIFF* tif, - TIFFDataType type, ttag_t tag, TIFFDirEntry* dir, uint32 n, double* v) -{ - char buf[10 * sizeof(double)]; - char* w = buf; - int i, status = 0; - - if (n * TIFFDataWidth(type) > sizeof buf) { - w = (char*) _TIFFmalloc(n * TIFFDataWidth(type)); - if (w == NULL) { - TIFFError(tif->tif_name, - "No space to write array"); - return (0); - } - } - switch (type) { - case TIFF_BYTE: - { uint8* bp = (uint8*) w; - for (i = 0; i < (int) n; i++) - bp[i] = (uint8) v[i]; - dir->tdir_tag = (uint16) tag; - dir->tdir_type = (short) type; - dir->tdir_count = n; - if (!TIFFWriteByteArray(tif, dir, (char*) bp)) - goto out; - } - break; - case TIFF_SBYTE: - { int8* bp = (int8*) w; - for (i = 0; i < (int) n; i++) - bp[i] = (int8) v[i]; - dir->tdir_tag = (uint16) tag; - dir->tdir_type = (short) type; - dir->tdir_count = n; - if (!TIFFWriteByteArray(tif, dir, (char*) bp)) - goto out; - } - break; - case TIFF_SHORT: - { uint16* bp = (uint16*) w; - for (i = 0; i < (int) n; i++) - bp[i] = (uint16) v[i]; - if (!TIFFWriteShortArray(tif, type, tag, dir, n, (uint16*)bp)) - goto out; - } - break; - case TIFF_SSHORT: - { int16* bp = (int16*) w; - for (i = 0; i < (int) n; i++) - bp[i] = (int16) v[i]; - if (!TIFFWriteShortArray(tif, type, tag, dir, n, (uint16*)bp)) - goto out; - } - break; - case TIFF_LONG: - { uint32* bp = (uint32*) w; - for (i = 0; i < (int) n; i++) - bp[i] = (uint32) v[i]; - if (!TIFFWriteLongArray(tif, type, tag, dir, n, bp)) - goto out; - } - break; - case TIFF_SLONG: - { int32* bp = (int32*) w; - for (i = 0; i < (int) n; i++) - bp[i] = (int32) v[i]; - if (!TIFFWriteLongArray(tif, type, tag, dir, n, (uint32*) bp)) - goto out; - } - break; - case TIFF_FLOAT: - { float* bp = (float*) w; - for (i = 0; i < (int) n; i++) - bp[i] = (float) v[i]; - if (!TIFFWriteFloatArray(tif, type, tag, dir, n, bp)) - goto out; - } - break; - case TIFF_DOUBLE: - return (TIFFWriteDoubleArray(tif, type, tag, dir, n, v)); - default: - /* TIFF_NOTYPE */ - /* TIFF_ASCII */ - /* TIFF_UNDEFINED */ - /* TIFF_RATIONAL */ - /* TIFF_SRATIONAL */ - goto out; - } - status = 1; - out: - if (w != buf) - _TIFFfree(w); - return (status); -} - -#ifdef COLORIMETRY_SUPPORT -static int -TIFFWriteTransferFunction(TIFF* tif, TIFFDirEntry* dir) -{ - TIFFDirectory* td = &tif->tif_dir; - tsize_t n = (1L<td_bitspersample) * sizeof (uint16); - uint16** tf = td->td_transferfunction; - int ncols; - - /* - * Check if the table can be written as a single column, - * or if it must be written as 3 columns. Note that we - * write a 3-column tag if there are 2 samples/pixel and - * a single column of data won't suffice--hmm. - */ - switch (td->td_samplesperpixel - td->td_extrasamples) { - default: if (_TIFFmemcmp(tf[0], tf[2], n)) { ncols = 3; break; } - case 2: if (_TIFFmemcmp(tf[0], tf[1], n)) { ncols = 3; break; } - case 1: case 0: ncols = 1; - } - return (TIFFWriteShortTable(tif, - TIFFTAG_TRANSFERFUNCTION, dir, ncols, tf)); -} -#endif - -#ifdef CMYK_SUPPORT -static int -TIFFWriteInkNames(TIFF* tif, TIFFDirEntry* dir) -{ - TIFFDirectory* td = &tif->tif_dir; - - dir->tdir_tag = TIFFTAG_INKNAMES; - dir->tdir_type = (short) TIFF_ASCII; - dir->tdir_count = td->td_inknameslen; - return (TIFFWriteByteArray(tif, dir, td->td_inknames)); -} -#endif - -/* - * Write a contiguous directory item. - */ -static int -TIFFWriteData(TIFF* tif, TIFFDirEntry* dir, char* cp) -{ - tsize_t cc; - - if (tif->tif_flags & TIFF_SWAB) { - switch (dir->tdir_type) { - case TIFF_SHORT: - case TIFF_SSHORT: - TIFFSwabArrayOfShort((uint16*) cp, dir->tdir_count); - break; - case TIFF_LONG: - case TIFF_SLONG: - case TIFF_FLOAT: - TIFFSwabArrayOfLong((uint32*) cp, dir->tdir_count); - break; - case TIFF_RATIONAL: - case TIFF_SRATIONAL: - TIFFSwabArrayOfLong((uint32*) cp, 2*dir->tdir_count); - break; - case TIFF_DOUBLE: - TIFFSwabArrayOfDouble((double*) cp, dir->tdir_count); - break; - } - } - dir->tdir_offset = tif->tif_dataoff; - cc = dir->tdir_count * TIFFDataWidth((TIFFDataType) dir->tdir_type); - if (SeekOK(tif, dir->tdir_offset) && - WriteOK(tif, cp, cc)) { - tif->tif_dataoff += (cc + 1) & ~1; - return (1); - } - TIFFError(tif->tif_name, "Error writing data for field \"%s\"", - _TIFFFieldWithTag(tif, dir->tdir_tag)->field_name); - return (0); -} - -/* - * Similar to TIFFWriteDirectory(), but if the directory has already - * been written once, it is relocated to the end of the file, in case it - * has changed in size. Note that this will result in the loss of the - * previously used directory space. - */ - -int -TIFFRewriteDirectory( TIFF *tif ) -{ - static const char module[] = "TIFFRewriteDirectory"; - - /* We don't need to do anything special if it hasn't been written. */ - if( tif->tif_diroff == 0 ) - return TIFFWriteDirectory( tif ); - - /* - ** Find and zero the pointer to this directory, so that TIFFLinkDirectory - ** will cause it to be added after this directories current pre-link. - */ - - /* Is it the first directory in the file? */ - if (tif->tif_header.tiff_diroff == tif->tif_diroff) - { - tif->tif_header.tiff_diroff = 0; - tif->tif_diroff = 0; - -#if defined(__hpux) && defined(__LP64__) -#define HDROFF(f) ((toff_t)(unsigned long) &(((TIFFHeader*) 0)->f)) -#else -#define HDROFF(f) ((toff_t) &(((TIFFHeader*) 0)->f)) -#endif - TIFFSeekFile(tif, HDROFF(tiff_diroff), SEEK_SET); - if (!WriteOK(tif, &(tif->tif_header.tiff_diroff), - sizeof (tif->tif_diroff))) - { - TIFFError(tif->tif_name, "Error updating TIFF header"); - return (0); - } - } - else - { - toff_t nextdir, off; - - nextdir = tif->tif_header.tiff_diroff; - do { - uint16 dircount; - - if (!SeekOK(tif, nextdir) || - !ReadOK(tif, &dircount, sizeof (dircount))) { - TIFFError(module, "Error fetching directory count"); - return (0); - } - if (tif->tif_flags & TIFF_SWAB) - TIFFSwabShort(&dircount); - (void) TIFFSeekFile(tif, - dircount * sizeof (TIFFDirEntry), SEEK_CUR); - if (!ReadOK(tif, &nextdir, sizeof (nextdir))) { - TIFFError(module, "Error fetching directory link"); - return (0); - } - if (tif->tif_flags & TIFF_SWAB) - TIFFSwabLong(&nextdir); - } while (nextdir != tif->tif_diroff && nextdir != 0); - off = TIFFSeekFile(tif, 0, SEEK_CUR); /* get current offset */ - (void) TIFFSeekFile(tif, off - (toff_t)sizeof(nextdir), SEEK_SET); - tif->tif_diroff = 0; - if (!WriteOK(tif, &(tif->tif_diroff), sizeof (nextdir))) { - TIFFError(module, "Error writing directory link"); - return (0); - } - } - - /* - ** Now use TIFFWriteDirectory() normally. - */ - - return TIFFWriteDirectory( tif ); -} - - -/* - * Link the current directory into the - * directory chain for the file. - */ -static int -TIFFLinkDirectory(TIFF* tif) -{ - static const char module[] = "TIFFLinkDirectory"; - toff_t nextdir; - toff_t diroff, off; - - tif->tif_diroff = (TIFFSeekFile(tif, (toff_t) 0, SEEK_END)+1) &~ 1; - diroff = tif->tif_diroff; - if (tif->tif_flags & TIFF_SWAB) - TIFFSwabLong(&diroff); -#if SUBIFD_SUPPORT - if (tif->tif_flags & TIFF_INSUBIFD) { - (void) TIFFSeekFile(tif, tif->tif_subifdoff, SEEK_SET); - if (!WriteOK(tif, &diroff, sizeof (diroff))) { - TIFFError(module, - "%s: Error writing SubIFD directory link", - tif->tif_name); - return (0); - } - /* - * Advance to the next SubIFD or, if this is - * the last one configured, revert back to the - * normal directory linkage. - */ - if (--tif->tif_nsubifd) - tif->tif_subifdoff += sizeof (diroff); - else - tif->tif_flags &= ~TIFF_INSUBIFD; - return (1); - } -#endif - if (tif->tif_header.tiff_diroff == 0) { - /* - * First directory, overwrite offset in header. - */ - tif->tif_header.tiff_diroff = tif->tif_diroff; -#define HDROFF(f) ((toff_t) &(((TIFFHeader*) 0)->f)) - (void) TIFFSeekFile(tif, HDROFF(tiff_diroff), SEEK_SET); - if (!WriteOK(tif, &diroff, sizeof (diroff))) { - TIFFError(tif->tif_name, "Error writing TIFF header"); - return (0); - } - return (1); - } - /* - * Not the first directory, search to the last and append. - */ - nextdir = tif->tif_header.tiff_diroff; - do { - uint16 dircount; - - if (!SeekOK(tif, nextdir) || - !ReadOK(tif, &dircount, sizeof (dircount))) { - TIFFError(module, "Error fetching directory count"); - return (0); - } - if (tif->tif_flags & TIFF_SWAB) - TIFFSwabShort(&dircount); - (void) TIFFSeekFile(tif, - dircount * sizeof (TIFFDirEntry), SEEK_CUR); - if (!ReadOK(tif, &nextdir, sizeof (nextdir))) { - TIFFError(module, "Error fetching directory link"); - return (0); - } - if (tif->tif_flags & TIFF_SWAB) - TIFFSwabLong(&nextdir); - } while (nextdir != 0); - off = TIFFSeekFile(tif, 0, SEEK_CUR); /* get current offset */ - (void) TIFFSeekFile(tif, off - (toff_t)sizeof(nextdir), SEEK_SET); - if (!WriteOK(tif, &diroff, sizeof (diroff))) { - TIFFError(module, "Error writing directory link"); - return (0); - } - return (1); -} diff --git a/wxWidgets/src/tiff/tif_dumpmode.c b/wxWidgets/src/tiff/tif_dumpmode.c deleted file mode 100644 index ccb57f71c1..0000000000 --- a/wxWidgets/src/tiff/tif_dumpmode.c +++ /dev/null @@ -1,118 +0,0 @@ -/* $Header$ */ - -/* - * Copyright (c) 1988-1997 Sam Leffler - * Copyright (c) 1991-1997 Silicon Graphics, Inc. - * - * Permission to use, copy, modify, distribute, and sell this software and - * its documentation for any purpose is hereby granted without fee, provided - * that (i) the above copyright notices and this permission notice appear in - * all copies of the software and related documentation, and (ii) the names of - * Sam Leffler and Silicon Graphics may not be used in any advertising or - * publicity relating to the software without the specific, prior written - * permission of Sam Leffler and Silicon Graphics. - * - * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, - * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * - * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR - * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, - * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF - * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE - * OF THIS SOFTWARE. - */ - -/* - * TIFF Library. - * - * "Null" Compression Algorithm Support. - */ -#include "tiffiop.h" -#include - -/* - * Encode a hunk of pixels. - */ -static int -DumpModeEncode(TIFF* tif, tidata_t pp, tsize_t cc, tsample_t s) -{ - (void) s; - while (cc > 0) { - tsize_t n; - - n = cc; - if (tif->tif_rawcc + n > tif->tif_rawdatasize) - n = tif->tif_rawdatasize - tif->tif_rawcc; - - assert( n > 0 ); - - /* - * Avoid copy if client has setup raw - * data buffer to avoid extra copy. - */ - if (tif->tif_rawcp != pp) - _TIFFmemcpy(tif->tif_rawcp, pp, n); - tif->tif_rawcp += n; - tif->tif_rawcc += n; - pp += n; - cc -= n; - if (tif->tif_rawcc >= tif->tif_rawdatasize && - !TIFFFlushData1(tif)) - return (-1); - } - return (1); -} - -/* - * Decode a hunk of pixels. - */ -static int -DumpModeDecode(TIFF* tif, tidata_t buf, tsize_t cc, tsample_t s) -{ - (void) s; - if (tif->tif_rawcc < cc) { - TIFFError(tif->tif_name, - "DumpModeDecode: Not enough data for scanline %d", - tif->tif_row); - return (0); - } - /* - * Avoid copy if client has setup raw - * data buffer to avoid extra copy. - */ - if (tif->tif_rawcp != buf) - _TIFFmemcpy(buf, tif->tif_rawcp, cc); - tif->tif_rawcp += cc; - tif->tif_rawcc -= cc; - return (1); -} - -/* - * Seek forwards nrows in the current strip. - */ -static int -DumpModeSeek(TIFF* tif, uint32 nrows) -{ - tif->tif_rawcp += nrows * tif->tif_scanlinesize; - tif->tif_rawcc -= nrows * tif->tif_scanlinesize; - return (1); -} - -/* - * Initialize dump mode. - */ -int -TIFFInitDumpMode(TIFF* tif, int scheme) -{ - (void) scheme; - tif->tif_decoderow = DumpModeDecode; - tif->tif_decodestrip = DumpModeDecode; - tif->tif_decodetile = DumpModeDecode; - tif->tif_encoderow = DumpModeEncode; - tif->tif_encodestrip = DumpModeEncode; - tif->tif_encodetile = DumpModeEncode; - tif->tif_seek = DumpModeSeek; - return (1); -} diff --git a/wxWidgets/src/tiff/tif_error.c b/wxWidgets/src/tiff/tif_error.c deleted file mode 100644 index e8e622951c..0000000000 --- a/wxWidgets/src/tiff/tif_error.c +++ /dev/null @@ -1,49 +0,0 @@ -/* $Header$ */ - -/* - * Copyright (c) 1988-1997 Sam Leffler - * Copyright (c) 1991-1997 Silicon Graphics, Inc. - * - * Permission to use, copy, modify, distribute, and sell this software and - * its documentation for any purpose is hereby granted without fee, provided - * that (i) the above copyright notices and this permission notice appear in - * all copies of the software and related documentation, and (ii) the names of - * Sam Leffler and Silicon Graphics may not be used in any advertising or - * publicity relating to the software without the specific, prior written - * permission of Sam Leffler and Silicon Graphics. - * - * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, - * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * - * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR - * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, - * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF - * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE - * OF THIS SOFTWARE. - */ - -/* - * TIFF Library. - */ -#include "tiffiop.h" - -TIFFErrorHandler -TIFFSetErrorHandler(TIFFErrorHandler handler) -{ - TIFFErrorHandler prev = _TIFFerrorHandler; - _TIFFerrorHandler = handler; - return (prev); -} - -void -TIFFError(const char* module, const char* fmt, ...) -{ - if (_TIFFerrorHandler) { - va_list ap; - va_start(ap, fmt); - (*_TIFFerrorHandler)(module, fmt, ap); - va_end(ap); - } -} diff --git a/wxWidgets/src/tiff/tif_extension.c b/wxWidgets/src/tiff/tif_extension.c deleted file mode 100644 index f7aa6853ae..0000000000 --- a/wxWidgets/src/tiff/tif_extension.c +++ /dev/null @@ -1,112 +0,0 @@ -/* $Header$ */ - -/* - * Copyright (c) 1988-1997 Sam Leffler - * Copyright (c) 1991-1997 Silicon Graphics, Inc. - * - * Permission to use, copy, modify, distribute, and sell this software and - * its documentation for any purpose is hereby granted without fee, provided - * that (i) the above copyright notices and this permission notice appear in - * all copies of the software and related documentation, and (ii) the names of - * Sam Leffler and Silicon Graphics may not be used in any advertising or - * publicity relating to the software without the specific, prior written - * permission of Sam Leffler and Silicon Graphics. - * - * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, - * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * - * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR - * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, - * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF - * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE - * OF THIS SOFTWARE. - */ - -/* - * TIFF Library. - * - * Various routines support external extension of the tag set, and other - * application extension capabilities. - */ - -#include "tiffiop.h" -#include - -int TIFFGetTagListCount( TIFF *tif ) - -{ - TIFFDirectory* td = &tif->tif_dir; - - return td->td_customValueCount; -} - -ttag_t TIFFGetTagListEntry( TIFF *tif, int tag_index ) - -{ - TIFFDirectory* td = &tif->tif_dir; - - if( tag_index < 0 || tag_index >= td->td_customValueCount ) - return (ttag_t) -1; - else - return td->td_customValues[tag_index].info->field_tag; -} - -/* -** This provides read/write access to the TIFFTagMethods within the TIFF -** structure to application code without giving access to the private -** TIFF structure. -*/ -TIFFTagMethods *TIFFAccessTagMethods( TIFF *tif ) - -{ - return &(tif->tif_tagmethods); -} - -void *TIFFGetClientInfo( TIFF *tif, const char *name ) - -{ - TIFFClientInfoLink *link = tif->tif_clientinfo; - - while( link != NULL && strcmp(link->name,name) != 0 ) - link = link->next; - - if( link != NULL ) - return link->data; - else - return NULL; -} - -void TIFFSetClientInfo( TIFF *tif, void *data, const char *name ) - -{ - TIFFClientInfoLink *link = tif->tif_clientinfo; - - /* - ** Do we have an existing link with this name? If so, just - ** set it. - */ - while( link != NULL && strcmp(link->name,name) != 0 ) - link = link->next; - - if( link != NULL ) - { - link->data = data; - return; - } - - /* - ** Create a new link. - */ - - link = (TIFFClientInfoLink *) _TIFFmalloc(sizeof(TIFFClientInfoLink)); - assert (link != NULL); - link->next = tif->tif_clientinfo; - link->name = (char *) _TIFFmalloc(strlen(name)+1); - assert (link->name != NULL); - strcpy(link->name, name); - link->data = data; - - tif->tif_clientinfo = link; -} diff --git a/wxWidgets/src/tiff/tif_fax3.c b/wxWidgets/src/tiff/tif_fax3.c deleted file mode 100644 index 9474e977c7..0000000000 --- a/wxWidgets/src/tiff/tif_fax3.c +++ /dev/null @@ -1,1527 +0,0 @@ -/* $Header$ */ - -/* - * Copyright (c) 1990-1997 Sam Leffler - * Copyright (c) 1991-1997 Silicon Graphics, Inc. - * - * Permission to use, copy, modify, distribute, and sell this software and - * its documentation for any purpose is hereby granted without fee, provided - * that (i) the above copyright notices and this permission notice appear in - * all copies of the software and related documentation, and (ii) the names of - * Sam Leffler and Silicon Graphics may not be used in any advertising or - * publicity relating to the software without the specific, prior written - * permission of Sam Leffler and Silicon Graphics. - * - * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, - * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * - * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR - * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, - * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF - * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE - * OF THIS SOFTWARE. - */ - -#include "tiffiop.h" -#ifdef CCITT_SUPPORT -/* - * TIFF Library. - * - * CCITT Group 3 (T.4) and Group 4 (T.6) Compression Support. - * - * This file contains support for decoding and encoding TIFF - * compression algorithms 2, 3, 4, and 32771. - * - * Decoder support is derived, with permission, from the code - * in Frank Cringle's viewfax program; - * Copyright (C) 1990, 1995 Frank D. Cringle. - */ -#include "tif_fax3.h" -#define G3CODES -#include "t4.h" -#include -#include - -/* - * Compression+decompression state blocks are - * derived from this ``base state'' block. - */ -typedef struct { - int rw_mode; /* O_RDONLY for decode, else encode */ - int mode; /* operating mode */ - uint32 rowbytes; /* bytes in a decoded scanline */ - uint32 rowpixels; /* pixels in a scanline */ - - uint16 cleanfaxdata; /* CleanFaxData tag */ - uint32 badfaxrun; /* BadFaxRun tag */ - uint32 badfaxlines; /* BadFaxLines tag */ - uint32 groupoptions; /* Group 3/4 options tag */ - uint32 recvparams; /* encoded Class 2 session params */ - char* subaddress; /* subaddress string */ - uint32 recvtime; /* time spent receiving (secs) */ - TIFFVGetMethod vgetparent; /* super-class method */ - TIFFVSetMethod vsetparent; /* super-class method */ -} Fax3BaseState; -#define Fax3State(tif) ((Fax3BaseState*) (tif)->tif_data) - -typedef enum { G3_1D, G3_2D } Ttag; -typedef struct { - Fax3BaseState b; - - /* Decoder state info */ - const u_char* bitmap; /* bit reversal table */ - uint32 data; /* current i/o byte/word */ - int bit; /* current i/o bit in byte */ - int EOLcnt; /* count of EOL codes recognized */ - TIFFFaxFillFunc fill; /* fill routine */ - uint32* runs; /* b&w runs for current/previous row */ - uint32* refruns; /* runs for reference line */ - uint32* curruns; /* runs for current line */ - - /* Encoder state info */ - Ttag tag; /* encoding state */ - u_char* refline; /* reference line for 2d decoding */ - int k; /* #rows left that can be 2d encoded */ - int maxk; /* max #rows that can be 2d encoded */ -} Fax3CodecState; -#define DecoderState(tif) ((Fax3CodecState*) Fax3State(tif)) -#define EncoderState(tif) ((Fax3CodecState*) Fax3State(tif)) - -#define is2DEncoding(sp) \ - (sp->b.groupoptions & GROUP3OPT_2DENCODING) -#define isAligned(p,t) ((((u_long)(p)) & (sizeof (t)-1)) == 0) - -/* - * Group 3 and Group 4 Decoding. - */ - -/* - * These macros glue the TIFF library state to - * the state expected by Frank's decoder. - */ -#define DECLARE_STATE(tif, sp, mod) \ - static const char module[] = mod; \ - Fax3CodecState* sp = DecoderState(tif); \ - int a0; /* reference element */ \ - int lastx = sp->b.rowpixels; /* last element in row */ \ - uint32 BitAcc; /* bit accumulator */ \ - int BitsAvail; /* # valid bits in BitAcc */ \ - int RunLength; /* length of current run */ \ - u_char* cp; /* next byte of input data */ \ - u_char* ep; /* end of input data */ \ - uint32* pa; /* place to stuff next run */ \ - uint32* thisrun; /* current row's run array */ \ - int EOLcnt; /* # EOL codes recognized */ \ - const u_char* bitmap = sp->bitmap; /* input data bit reverser */ \ - const TIFFFaxTabEnt* TabEnt -#define DECLARE_STATE_2D(tif, sp, mod) \ - DECLARE_STATE(tif, sp, mod); \ - int b1; /* next change on prev line */ \ - uint32* pb /* next run in reference line */\ -/* - * Load any state that may be changed during decoding. - */ -#define CACHE_STATE(tif, sp) do { \ - BitAcc = sp->data; \ - BitsAvail = sp->bit; \ - EOLcnt = sp->EOLcnt; \ - cp = (unsigned char*) tif->tif_rawcp; \ - ep = cp + tif->tif_rawcc; \ -} while (0) -/* - * Save state possibly changed during decoding. - */ -#define UNCACHE_STATE(tif, sp) do { \ - sp->bit = BitsAvail; \ - sp->data = BitAcc; \ - sp->EOLcnt = EOLcnt; \ - tif->tif_rawcc -= (tidata_t) cp - tif->tif_rawcp; \ - tif->tif_rawcp = (tidata_t) cp; \ -} while (0) - -/* - * Setup state for decoding a strip. - */ -static int -Fax3PreDecode(TIFF* tif, tsample_t s) -{ - Fax3CodecState* sp = DecoderState(tif); - - (void) s; - assert(sp != NULL); - sp->bit = 0; /* force initial read */ - sp->data = 0; - sp->EOLcnt = 0; /* force initial scan for EOL */ - /* - * Decoder assumes lsb-to-msb bit order. Note that we select - * this here rather than in Fax3SetupState so that viewers can - * hold the image open, fiddle with the FillOrder tag value, - * and then re-decode the image. Otherwise they'd need to close - * and open the image to get the state reset. - */ - sp->bitmap = - TIFFGetBitRevTable(tif->tif_dir.td_fillorder != FILLORDER_LSB2MSB); - if (sp->refruns) { /* init reference line to white */ - sp->refruns[0] = (uint32) sp->b.rowpixels; - sp->refruns[1] = 0; - } - return (1); -} - -/* - * Routine for handling various errors/conditions. - * Note how they are "glued into the decoder" by - * overriding the definitions used by the decoder. - */ - -static void -Fax3Unexpected(const char* module, TIFF* tif, uint32 a0) -{ - TIFFError(module, "%s: Bad code word at scanline %d (x %lu)", - tif->tif_name, tif->tif_row, (u_long) a0); -} -#define unexpected(table, a0) Fax3Unexpected(module, tif, a0) - -static void -Fax3Extension(const char* module, TIFF* tif, uint32 a0) -{ - TIFFError(module, - "%s: Uncompressed data (not supported) at scanline %d (x %lu)", - tif->tif_name, tif->tif_row, (u_long) a0); -} -#define extension(a0) Fax3Extension(module, tif, a0) - -static void -Fax3BadLength(const char* module, TIFF* tif, uint32 a0, uint32 lastx) -{ - TIFFWarning(module, "%s: %s at scanline %d (got %lu, expected %lu)", - tif->tif_name, - a0 < lastx ? "Premature EOL" : "Line length mismatch", - tif->tif_row, (u_long) a0, (u_long) lastx); -} -#define badlength(a0,lastx) Fax3BadLength(module, tif, a0, lastx) - -static void -Fax3PrematureEOF(const char* module, TIFF* tif, uint32 a0) -{ - TIFFWarning(module, "%s: Premature EOF at scanline %d (x %lu)", - tif->tif_name, tif->tif_row, (u_long) a0); -} -#define prematureEOF(a0) Fax3PrematureEOF(module, tif, a0) - -#define Nop - -/* - * Decode the requested amount of G3 1D-encoded data. - */ -static int -Fax3Decode1D(TIFF* tif, tidata_t buf, tsize_t occ, tsample_t s) -{ - DECLARE_STATE(tif, sp, "Fax3Decode1D"); - - (void) s; - CACHE_STATE(tif, sp); - thisrun = sp->curruns; - while ((long)occ > 0) { - a0 = 0; - RunLength = 0; - pa = thisrun; -#ifdef FAX3_DEBUG - printf("\nBitAcc=%08X, BitsAvail = %d\n", BitAcc, BitsAvail); - printf("-------------------- %d\n", tif->tif_row); - fflush(stdout); -#endif - SYNC_EOL(EOF1D); - EXPAND1D(EOF1Da); - (*sp->fill)(buf, thisrun, pa, lastx); - buf += sp->b.rowbytes; - occ -= sp->b.rowbytes; - continue; - EOF1D: /* premature EOF */ - CLEANUP_RUNS(); - EOF1Da: /* premature EOF */ - (*sp->fill)(buf, thisrun, pa, lastx); - UNCACHE_STATE(tif, sp); - return (-1); - } - UNCACHE_STATE(tif, sp); - return (1); -} - -#define SWAP(t,a,b) { t x; x = (a); (a) = (b); (b) = x; } -/* - * Decode the requested amount of G3 2D-encoded data. - */ -static int -Fax3Decode2D(TIFF* tif, tidata_t buf, tsize_t occ, tsample_t s) -{ - DECLARE_STATE_2D(tif, sp, "Fax3Decode2D"); - int is1D; /* current line is 1d/2d-encoded */ - - (void) s; - CACHE_STATE(tif, sp); - while ((long)occ > 0) { - a0 = 0; - RunLength = 0; - pa = thisrun = sp->curruns; -#ifdef FAX3_DEBUG - printf("\nBitAcc=%08X, BitsAvail = %d EOLcnt = %d", - BitAcc, BitsAvail, EOLcnt); -#endif - SYNC_EOL(EOF2D); - NeedBits8(1, EOF2D); - is1D = GetBits(1); /* 1D/2D-encoding tag bit */ - ClrBits(1); -#ifdef FAX3_DEBUG - printf(" %s\n-------------------- %d\n", - is1D ? "1D" : "2D", tif->tif_row); - fflush(stdout); -#endif - pb = sp->refruns; - b1 = *pb++; - if (is1D) - EXPAND1D(EOF2Da); - else - EXPAND2D(EOF2Da); - (*sp->fill)(buf, thisrun, pa, lastx); - SETVAL(0); /* imaginary change for reference */ - SWAP(uint32*, sp->curruns, sp->refruns); - buf += sp->b.rowbytes; - occ -= sp->b.rowbytes; - continue; - EOF2D: /* premature EOF */ - CLEANUP_RUNS(); - EOF2Da: /* premature EOF */ - (*sp->fill)(buf, thisrun, pa, lastx); - UNCACHE_STATE(tif, sp); - return (-1); - } - UNCACHE_STATE(tif, sp); - return (1); -} -#undef SWAP - -/* - * The ZERO & FILL macros must handle spans < 2*sizeof(long) bytes. - * For machines with 64-bit longs this is <16 bytes; otherwise - * this is <8 bytes. We optimize the code here to reflect the - * machine characteristics. - */ -#if defined(__alpha) || (defined(_MIPS_SZLONG) && _MIPS_SZLONG == 64) || defined(__LP64__) || defined(__arch64__) -#define FILL(n, cp) \ - switch (n) { \ - case 15:(cp)[14] = 0xff; case 14:(cp)[13] = 0xff; case 13: (cp)[12] = 0xff;\ - case 12:(cp)[11] = 0xff; case 11:(cp)[10] = 0xff; case 10: (cp)[9] = 0xff;\ - case 9: (cp)[8] = 0xff; case 8: (cp)[7] = 0xff; case 7: (cp)[6] = 0xff;\ - case 6: (cp)[5] = 0xff; case 5: (cp)[4] = 0xff; case 4: (cp)[3] = 0xff;\ - case 3: (cp)[2] = 0xff; case 2: (cp)[1] = 0xff; \ - case 1: (cp)[0] = 0xff; (cp) += (n); case 0: ; \ - } -#define ZERO(n, cp) \ - switch (n) { \ - case 15:(cp)[14] = 0; case 14:(cp)[13] = 0; case 13: (cp)[12] = 0; \ - case 12:(cp)[11] = 0; case 11:(cp)[10] = 0; case 10: (cp)[9] = 0; \ - case 9: (cp)[8] = 0; case 8: (cp)[7] = 0; case 7: (cp)[6] = 0; \ - case 6: (cp)[5] = 0; case 5: (cp)[4] = 0; case 4: (cp)[3] = 0; \ - case 3: (cp)[2] = 0; case 2: (cp)[1] = 0; \ - case 1: (cp)[0] = 0; (cp) += (n); case 0: ; \ - } -#else -#define FILL(n, cp) \ - switch (n) { \ - case 7: (cp)[6] = 0xff; case 6: (cp)[5] = 0xff; case 5: (cp)[4] = 0xff; \ - case 4: (cp)[3] = 0xff; case 3: (cp)[2] = 0xff; case 2: (cp)[1] = 0xff; \ - case 1: (cp)[0] = 0xff; (cp) += (n); case 0: ; \ - } -#define ZERO(n, cp) \ - switch (n) { \ - case 7: (cp)[6] = 0; case 6: (cp)[5] = 0; case 5: (cp)[4] = 0; \ - case 4: (cp)[3] = 0; case 3: (cp)[2] = 0; case 2: (cp)[1] = 0; \ - case 1: (cp)[0] = 0; (cp) += (n); case 0: ; \ - } -#endif - -/* - * Bit-fill a row according to the white/black - * runs generated during G3/G4 decoding. - */ -void -_TIFFFax3fillruns(u_char* buf, uint32* runs, uint32* erun, uint32 lastx) -{ - static const unsigned char _fillmasks[] = - { 0x00, 0x80, 0xc0, 0xe0, 0xf0, 0xf8, 0xfc, 0xfe, 0xff }; - u_char* cp; - uint32 x, bx, run; - int32 n, nw; - long* lp; - - if ((erun-runs)&1) - *erun++ = 0; - x = 0; - for (; runs < erun; runs += 2) { - run = runs[0]; - if (x+run > lastx || run > lastx ) - run = runs[0] = (uint32) (lastx - x); - if (run) { - cp = buf + (x>>3); - bx = x&7; - if (run > 8-bx) { - if (bx) { /* align to byte boundary */ - *cp++ &= 0xff << (8-bx); - run -= 8-bx; - } - if( (n = run >> 3) != 0 ) { /* multiple bytes to fill */ - if ((n/sizeof (long)) > 1) { - /* - * Align to longword boundary and fill. - */ - for (; n && !isAligned(cp, long); n--) - *cp++ = 0x00; - lp = (long*) cp; - nw = (int32)(n / sizeof (long)); - n -= nw * sizeof (long); - do { - *lp++ = 0L; - } while (--nw); - cp = (u_char*) lp; - } - ZERO(n, cp); - run &= 7; - } - if (run) - cp[0] &= 0xff >> run; - } else - cp[0] &= ~(_fillmasks[run]>>bx); - x += runs[0]; - } - run = runs[1]; - if (x+run > lastx || run > lastx ) - run = runs[1] = lastx - x; - if (run) { - cp = buf + (x>>3); - bx = x&7; - if (run > 8-bx) { - if (bx) { /* align to byte boundary */ - *cp++ |= 0xff >> bx; - run -= 8-bx; - } - if( (n = run>>3) != 0 ) { /* multiple bytes to fill */ - if ((n/sizeof (long)) > 1) { - /* - * Align to longword boundary and fill. - */ - for (; n && !isAligned(cp, long); n--) - *cp++ = 0xff; - lp = (long*) cp; - nw = (int32)(n / sizeof (long)); - n -= nw * sizeof (long); - do { - *lp++ = -1L; - } while (--nw); - cp = (u_char*) lp; - } - FILL(n, cp); - run &= 7; - } - if (run) - cp[0] |= 0xff00 >> run; - } else - cp[0] |= _fillmasks[run]>>bx; - x += runs[1]; - } - } - assert(x == lastx); -} -#undef ZERO -#undef FILL - -static char * -CheckMalloc(TIFF* tif, size_t nmemb, size_t elem_size, const char* what) -{ - char *cp = NULL; - tsize_t bytes = nmemb * elem_size; - - if (nmemb && elem_size && bytes / elem_size == nmemb) - cp = (char*) _TIFFmalloc(bytes); - - if (cp == NULL) - TIFFError(tif->tif_name, "No space %s", what); - - return (cp); -} - -/* - * Setup G3/G4-related compression/decompression state - * before data is processed. This routine is called once - * per image -- it sets up different state based on whether - * or not decoding or encoding is being done and whether - * 1D- or 2D-encoded data is involved. - */ -static int -Fax3SetupState(TIFF* tif) -{ - TIFFDirectory* td = &tif->tif_dir; - Fax3BaseState* sp = Fax3State(tif); - long rowbytes, rowpixels; - int needsRefLine; - Fax3CodecState* dsp = DecoderState(tif); - uint32 nruns; - - if (td->td_bitspersample != 1) { - TIFFError(tif->tif_name, - "Bits/sample must be 1 for Group 3/4 encoding/decoding"); - return (0); - } - /* - * Calculate the scanline/tile widths. - */ - if (isTiled(tif)) { - rowbytes = TIFFTileRowSize(tif); - rowpixels = td->td_tilewidth; - } else { - rowbytes = TIFFScanlineSize(tif); - rowpixels = td->td_imagewidth; - } - sp->rowbytes = (uint32) rowbytes; - sp->rowpixels = (uint32) rowpixels; - /* - * Allocate any additional space required for decoding/encoding. - */ - needsRefLine = ( - (sp->groupoptions & GROUP3OPT_2DENCODING) || - td->td_compression == COMPRESSION_CCITTFAX4 - ); - - nruns = needsRefLine ? 2*TIFFroundup(rowpixels,32) : rowpixels; - - dsp->runs = (uint32*) CheckMalloc(tif, 2*nruns+3, sizeof (uint32), - "for Group 3/4 run arrays"); - if (dsp->runs == NULL) - return (0); - dsp->curruns = dsp->runs; - if (needsRefLine) - dsp->refruns = dsp->runs + (nruns>>1); - else - dsp->refruns = NULL; - if (is2DEncoding(dsp)) { /* NB: default is 1D routine */ - tif->tif_decoderow = Fax3Decode2D; - tif->tif_decodestrip = Fax3Decode2D; - tif->tif_decodetile = Fax3Decode2D; - } - - if (needsRefLine) { /* 2d encoding */ - Fax3CodecState* esp = EncoderState(tif); - /* - * 2d encoding requires a scanline - * buffer for the ``reference line''; the - * scanline against which delta encoding - * is referenced. The reference line must - * be initialized to be ``white'' (done elsewhere). - */ - esp->refline = (u_char*) _TIFFmalloc(rowbytes); - if (esp->refline == NULL) { - TIFFError("Fax3SetupState", - "%s: No space for Group 3/4 reference line", - tif->tif_name); - return (0); - } - } else /* 1d encoding */ - EncoderState(tif)->refline = NULL; - return (1); -} - -/* - * CCITT Group 3 FAX Encoding. - */ - -#define Fax3FlushBits(tif, sp) { \ - if ((tif)->tif_rawcc >= (tif)->tif_rawdatasize) \ - (void) TIFFFlushData1(tif); \ - *(tif)->tif_rawcp++ = (tidataval_t) (sp)->data; \ - (tif)->tif_rawcc++; \ - (sp)->data = 0, (sp)->bit = 8; \ -} -#define _FlushBits(tif) { \ - if ((tif)->tif_rawcc >= (tif)->tif_rawdatasize) \ - (void) TIFFFlushData1(tif); \ - *(tif)->tif_rawcp++ = (tidataval_t) data; \ - (tif)->tif_rawcc++; \ - data = 0, bit = 8; \ -} -static const int _msbmask[9] = - { 0x00, 0x01, 0x03, 0x07, 0x0f, 0x1f, 0x3f, 0x7f, 0xff }; -#define _PutBits(tif, bits, length) { \ - while (length > bit) { \ - data |= bits >> (length - bit); \ - length -= bit; \ - _FlushBits(tif); \ - } \ - data |= (bits & _msbmask[length]) << (bit - length); \ - bit -= length; \ - if (bit == 0) \ - _FlushBits(tif); \ -} - -/* - * Write a variable-length bit-value to - * the output stream. Values are - * assumed to be at most 16 bits. - */ -static void -Fax3PutBits(TIFF* tif, u_int bits, u_int length) -{ - Fax3CodecState* sp = EncoderState(tif); - u_int bit = sp->bit; - int data = sp->data; - - _PutBits(tif, bits, length); - - sp->data = data; - sp->bit = bit; -} - -/* - * Write a code to the output stream. - */ -#define putcode(tif, te) Fax3PutBits(tif, (te)->code, (te)->length) - -#ifdef FAX3_DEBUG -#define DEBUG_COLOR(w) (tab == TIFFFaxWhiteCodes ? w "W" : w "B") -#define DEBUG_PRINT(what,len) { \ - int t; \ - printf("%08X/%-2d: %s%5d\t", data, bit, DEBUG_COLOR(what), len); \ - for (t = length-1; t >= 0; t--) \ - putchar(code & (1<bit; - int data = sp->data; - u_int code, length; - - while (span >= 2624) { - const tableentry* te = &tab[63 + (2560>>6)]; - code = te->code, length = te->length; -#ifdef FAX3_DEBUG - DEBUG_PRINT("MakeUp", te->runlen); -#endif - _PutBits(tif, code, length); - span -= te->runlen; - } - if (span >= 64) { - const tableentry* te = &tab[63 + (span>>6)]; - assert(te->runlen == 64*(span>>6)); - code = te->code, length = te->length; -#ifdef FAX3_DEBUG - DEBUG_PRINT("MakeUp", te->runlen); -#endif - _PutBits(tif, code, length); - span -= te->runlen; - } - code = tab[span].code, length = tab[span].length; -#ifdef FAX3_DEBUG - DEBUG_PRINT(" Term", tab[span].runlen); -#endif - _PutBits(tif, code, length); - - sp->data = data; - sp->bit = bit; -} - -/* - * Write an EOL code to the output stream. The zero-fill - * logic for byte-aligning encoded scanlines is handled - * here. We also handle writing the tag bit for the next - * scanline when doing 2d encoding. - */ -static void -Fax3PutEOL(TIFF* tif) -{ - Fax3CodecState* sp = EncoderState(tif); - u_int bit = sp->bit; - int data = sp->data; - u_int code, length, tparm; - - if (sp->b.groupoptions & GROUP3OPT_FILLBITS) { - /* - * Force bit alignment so EOL will terminate on - * a byte boundary. That is, force the bit alignment - * to 16-12 = 4 before putting out the EOL code. - */ - int align = 8 - 4; - if (align != sp->bit) { - if (align > sp->bit) - align = sp->bit + (8 - align); - else - align = sp->bit - align; - code = 0; - tparm=align; - _PutBits(tif, 0, tparm); - } - } - code = EOL, length = 12; - if (is2DEncoding(sp)) - code = (code<<1) | (sp->tag == G3_1D), length++; - _PutBits(tif, code, length); - - sp->data = data; - sp->bit = bit; -} - -/* - * Reset encoding state at the start of a strip. - */ -static int -Fax3PreEncode(TIFF* tif, tsample_t s) -{ - Fax3CodecState* sp = EncoderState(tif); - - (void) s; - assert(sp != NULL); - sp->bit = 8; - sp->data = 0; - sp->tag = G3_1D; - /* - * This is necessary for Group 4; otherwise it isn't - * needed because the first scanline of each strip ends - * up being copied into the refline. - */ - if (sp->refline) - _TIFFmemset(sp->refline, 0x00, sp->b.rowbytes); - if (is2DEncoding(sp)) { - float res = tif->tif_dir.td_yresolution; - /* - * The CCITT spec says that when doing 2d encoding, you - * should only do it on K consecutive scanlines, where K - * depends on the resolution of the image being encoded - * (2 for <= 200 lpi, 4 for > 200 lpi). Since the directory - * code initializes td_yresolution to 0, this code will - * select a K of 2 unless the YResolution tag is set - * appropriately. (Note also that we fudge a little here - * and use 150 lpi to avoid problems with units conversion.) - */ - if (tif->tif_dir.td_resolutionunit == RESUNIT_CENTIMETER) - res *= 2.54f; /* convert to inches */ - sp->maxk = (res > 150 ? 4 : 2); - sp->k = sp->maxk-1; - } else - sp->k = sp->maxk = 0; - return (1); -} - -static const u_char zeroruns[256] = { - 8, 7, 6, 6, 5, 5, 5, 5, 4, 4, 4, 4, 4, 4, 4, 4, /* 0x00 - 0x0f */ - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, /* 0x10 - 0x1f */ - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, /* 0x20 - 0x2f */ - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, /* 0x30 - 0x3f */ - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 0x40 - 0x4f */ - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 0x50 - 0x5f */ - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 0x60 - 0x6f */ - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 0x70 - 0x7f */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x80 - 0x8f */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x90 - 0x9f */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0xa0 - 0xaf */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0xb0 - 0xbf */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0xc0 - 0xcf */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0xd0 - 0xdf */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0xe0 - 0xef */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0xf0 - 0xff */ -}; -static const u_char oneruns[256] = { - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x00 - 0x0f */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x10 - 0x1f */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x20 - 0x2f */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x30 - 0x3f */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x40 - 0x4f */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x50 - 0x5f */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x60 - 0x6f */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x70 - 0x7f */ - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 0x80 - 0x8f */ - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 0x90 - 0x9f */ - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 0xa0 - 0xaf */ - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 0xb0 - 0xbf */ - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, /* 0xc0 - 0xcf */ - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, /* 0xd0 - 0xdf */ - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, /* 0xe0 - 0xef */ - 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 6, 6, 7, 8, /* 0xf0 - 0xff */ -}; - -/* - * On certain systems it pays to inline - * the routines that find pixel spans. - */ -#ifdef VAXC -static int32 find0span(u_char*, int32, int32); -static int32 find1span(u_char*, int32, int32); -#pragma inline(find0span,find1span) -#endif - -/* - * Find a span of ones or zeros using the supplied - * table. The ``base'' of the bit string is supplied - * along with the start+end bit indices. - */ -INLINE static int32 -find0span(u_char* bp, int32 bs, int32 be) -{ - int32 bits = be - bs; - int32 n, span; - - bp += bs>>3; - /* - * Check partial byte on lhs. - */ - if (bits > 0 && (n = (bs & 7))) { - span = zeroruns[(*bp << n) & 0xff]; - if (span > 8-n) /* table value too generous */ - span = 8-n; - if (span > bits) /* constrain span to bit range */ - span = bits; - if (n+span < 8) /* doesn't extend to edge of byte */ - return (span); - bits -= span; - bp++; - } else - span = 0; - if (bits >= 2*8*sizeof (long)) { - long* lp; - /* - * Align to longword boundary and check longwords. - */ - while (!isAligned(bp, long)) { - if (*bp != 0x00) - return (span + zeroruns[*bp]); - span += 8, bits -= 8; - bp++; - } - lp = (long*) bp; - while (bits >= 8*sizeof (long) && *lp == 0) { - span += 8*sizeof (long), bits -= 8*sizeof (long); - lp++; - } - bp = (u_char*) lp; - } - /* - * Scan full bytes for all 0's. - */ - while (bits >= 8) { - if (*bp != 0x00) /* end of run */ - return (span + zeroruns[*bp]); - span += 8, bits -= 8; - bp++; - } - /* - * Check partial byte on rhs. - */ - if (bits > 0) { - n = zeroruns[*bp]; - span += (n > bits ? bits : n); - } - return (span); -} - -INLINE static int32 -find1span(u_char* bp, int32 bs, int32 be) -{ - int32 bits = be - bs; - int32 n, span; - - bp += bs>>3; - /* - * Check partial byte on lhs. - */ - if (bits > 0 && (n = (bs & 7))) { - span = oneruns[(*bp << n) & 0xff]; - if (span > 8-n) /* table value too generous */ - span = 8-n; - if (span > bits) /* constrain span to bit range */ - span = bits; - if (n+span < 8) /* doesn't extend to edge of byte */ - return (span); - bits -= span; - bp++; - } else - span = 0; - if (bits >= 2*8*sizeof (long)) { - long* lp; - /* - * Align to longword boundary and check longwords. - */ - while (!isAligned(bp, long)) { - if (*bp != 0xff) - return (span + oneruns[*bp]); - span += 8, bits -= 8; - bp++; - } - lp = (long*) bp; - while (bits >= 8*sizeof (long) && *lp == ~0) { - span += 8*sizeof (long), bits -= 8*sizeof (long); - lp++; - } - bp = (u_char*) lp; - } - /* - * Scan full bytes for all 1's. - */ - while (bits >= 8) { - if (*bp != 0xff) /* end of run */ - return (span + oneruns[*bp]); - span += 8, bits -= 8; - bp++; - } - /* - * Check partial byte on rhs. - */ - if (bits > 0) { - n = oneruns[*bp]; - span += (n > bits ? bits : n); - } - return (span); -} - -/* - * Return the offset of the next bit in the range - * [bs..be] that is different from the specified - * color. The end, be, is returned if no such bit - * exists. - */ -#define finddiff(_cp, _bs, _be, _color) \ - (_bs + (_color ? find1span(_cp,_bs,_be) : find0span(_cp,_bs,_be))) -/* - * Like finddiff, but also check the starting bit - * against the end in case start > end. - */ -#define finddiff2(_cp, _bs, _be, _color) \ - (_bs < _be ? finddiff(_cp,_bs,_be,_color) : _be) - -/* - * 1d-encode a row of pixels. The encoding is - * a sequence of all-white or all-black spans - * of pixels encoded with Huffman codes. - */ -static int -Fax3Encode1DRow(TIFF* tif, u_char* bp, uint32 bits) -{ - Fax3CodecState* sp = EncoderState(tif); - int32 span; - uint32 bs = 0; - - for (;;) { - span = find0span(bp, bs, bits); /* white span */ - putspan(tif, span, TIFFFaxWhiteCodes); - bs += span; - if (bs >= bits) - break; - span = find1span(bp, bs, bits); /* black span */ - putspan(tif, span, TIFFFaxBlackCodes); - bs += span; - if (bs >= bits) - break; - } - if (sp->b.mode & (FAXMODE_BYTEALIGN|FAXMODE_WORDALIGN)) { - if (sp->bit != 8) /* byte-align */ - Fax3FlushBits(tif, sp); - if ((sp->b.mode&FAXMODE_WORDALIGN) && - !isAligned(tif->tif_rawcp, uint16)) - Fax3FlushBits(tif, sp); - } - return (1); -} - -static const tableentry horizcode = - { 3, 0x1 }; /* 001 */ -static const tableentry passcode = - { 4, 0x1 }; /* 0001 */ -static const tableentry vcodes[7] = { - { 7, 0x03 }, /* 0000 011 */ - { 6, 0x03 }, /* 0000 11 */ - { 3, 0x03 }, /* 011 */ - { 1, 0x1 }, /* 1 */ - { 3, 0x2 }, /* 010 */ - { 6, 0x02 }, /* 0000 10 */ - { 7, 0x02 } /* 0000 010 */ -}; - -/* - * 2d-encode a row of pixels. Consult the CCITT - * documentation for the algorithm. - */ -static int -Fax3Encode2DRow(TIFF* tif, u_char* bp, u_char* rp, uint32 bits) -{ -#define PIXEL(buf,ix) ((((buf)[(ix)>>3]) >> (7-((ix)&7))) & 1) - uint32 a0 = 0; - uint32 a1 = (PIXEL(bp, 0) != 0 ? 0 : finddiff(bp, 0, bits, 0)); - uint32 b1 = (PIXEL(rp, 0) != 0 ? 0 : finddiff(rp, 0, bits, 0)); - uint32 a2, b2; - - for (;;) { - b2 = finddiff2(rp, b1, bits, PIXEL(rp,b1)); - if (b2 >= a1) { - int32 d = b1 - a1; - if (!(-3 <= d && d <= 3)) { /* horizontal mode */ - a2 = finddiff2(bp, a1, bits, PIXEL(bp,a1)); - putcode(tif, &horizcode); - if (a0+a1 == 0 || PIXEL(bp, a0) == 0) { - putspan(tif, a1-a0, TIFFFaxWhiteCodes); - putspan(tif, a2-a1, TIFFFaxBlackCodes); - } else { - putspan(tif, a1-a0, TIFFFaxBlackCodes); - putspan(tif, a2-a1, TIFFFaxWhiteCodes); - } - a0 = a2; - } else { /* vertical mode */ - putcode(tif, &vcodes[d+3]); - a0 = a1; - } - } else { /* pass mode */ - putcode(tif, &passcode); - a0 = b2; - } - if (a0 >= bits) - break; - a1 = finddiff(bp, a0, bits, PIXEL(bp,a0)); - b1 = finddiff(rp, a0, bits, !PIXEL(bp,a0)); - b1 = finddiff(rp, b1, bits, PIXEL(bp,a0)); - } - return (1); -#undef PIXEL -} - -/* - * Encode a buffer of pixels. - */ -static int -Fax3Encode(TIFF* tif, tidata_t bp, tsize_t cc, tsample_t s) -{ - Fax3CodecState* sp = EncoderState(tif); - - (void) s; - while ((long)cc > 0) { - if ((sp->b.mode & FAXMODE_NOEOL) == 0) - Fax3PutEOL(tif); - if (is2DEncoding(sp)) { - if (sp->tag == G3_1D) { - if (!Fax3Encode1DRow(tif, bp, sp->b.rowpixels)) - return (0); - sp->tag = G3_2D; - } else { - if (!Fax3Encode2DRow(tif, bp, sp->refline, sp->b.rowpixels)) - return (0); - sp->k--; - } - if (sp->k == 0) { - sp->tag = G3_1D; - sp->k = sp->maxk-1; - } else - _TIFFmemcpy(sp->refline, bp, sp->b.rowbytes); - } else { - if (!Fax3Encode1DRow(tif, bp, sp->b.rowpixels)) - return (0); - } - bp += sp->b.rowbytes; - cc -= sp->b.rowbytes; - } - return (1); -} - -static int -Fax3PostEncode(TIFF* tif) -{ - Fax3CodecState* sp = EncoderState(tif); - - if (sp->bit != 8) - Fax3FlushBits(tif, sp); - return (1); -} - -static void -Fax3Close(TIFF* tif) -{ - if ((Fax3State(tif)->mode & FAXMODE_NORTC) == 0) { - Fax3CodecState* sp = EncoderState(tif); - u_int code = EOL; - u_int length = 12; - int i; - - if (is2DEncoding(sp)) - code = (code<<1) | (sp->tag == G3_1D), length++; - for (i = 0; i < 6; i++) - Fax3PutBits(tif, code, length); - Fax3FlushBits(tif, sp); - } -} - -static void -Fax3Cleanup(TIFF* tif) -{ - if (tif->tif_data) { - Fax3CodecState* sp = DecoderState(tif); - - if (sp->runs) - _TIFFfree(sp->runs); - if (sp->refline) - _TIFFfree(sp->refline); - - if (Fax3State(tif)->subaddress) - _TIFFfree(Fax3State(tif)->subaddress); - _TIFFfree(tif->tif_data); - tif->tif_data = NULL; - } -} - -#define FIELD_BADFAXLINES (FIELD_CODEC+0) -#define FIELD_CLEANFAXDATA (FIELD_CODEC+1) -#define FIELD_BADFAXRUN (FIELD_CODEC+2) -#define FIELD_RECVPARAMS (FIELD_CODEC+3) -#define FIELD_SUBADDRESS (FIELD_CODEC+4) -#define FIELD_RECVTIME (FIELD_CODEC+5) - -#define FIELD_OPTIONS (FIELD_CODEC+6) - -static const TIFFFieldInfo faxFieldInfo[] = { - { TIFFTAG_FAXMODE, 0, 0, TIFF_ANY, FIELD_PSEUDO, - FALSE, FALSE, "FaxMode" }, - { TIFFTAG_FAXFILLFUNC, 0, 0, TIFF_ANY, FIELD_PSEUDO, - FALSE, FALSE, "FaxFillFunc" }, - { TIFFTAG_BADFAXLINES, 1, 1, TIFF_LONG, FIELD_BADFAXLINES, - TRUE, FALSE, "BadFaxLines" }, - { TIFFTAG_BADFAXLINES, 1, 1, TIFF_SHORT, FIELD_BADFAXLINES, - TRUE, FALSE, "BadFaxLines" }, - { TIFFTAG_CLEANFAXDATA, 1, 1, TIFF_SHORT, FIELD_CLEANFAXDATA, - TRUE, FALSE, "CleanFaxData" }, - { TIFFTAG_CONSECUTIVEBADFAXLINES,1,1, TIFF_LONG, FIELD_BADFAXRUN, - TRUE, FALSE, "ConsecutiveBadFaxLines" }, - { TIFFTAG_CONSECUTIVEBADFAXLINES,1,1, TIFF_SHORT, FIELD_BADFAXRUN, - TRUE, FALSE, "ConsecutiveBadFaxLines" }, - { TIFFTAG_FAXRECVPARAMS, 1, 1, TIFF_LONG, FIELD_RECVPARAMS, - TRUE, FALSE, "FaxRecvParams" }, - { TIFFTAG_FAXSUBADDRESS, -1,-1, TIFF_ASCII, FIELD_SUBADDRESS, - TRUE, FALSE, "FaxSubAddress" }, - { TIFFTAG_FAXRECVTIME, 1, 1, TIFF_LONG, FIELD_RECVTIME, - TRUE, FALSE, "FaxRecvTime" }, -}; -static const TIFFFieldInfo fax3FieldInfo[] = { - { TIFFTAG_GROUP3OPTIONS, 1, 1, TIFF_LONG, FIELD_OPTIONS, - FALSE, FALSE, "Group3Options" }, -}; -static const TIFFFieldInfo fax4FieldInfo[] = { - { TIFFTAG_GROUP4OPTIONS, 1, 1, TIFF_LONG, FIELD_OPTIONS, - FALSE, FALSE, "Group4Options" }, -}; -#define N(a) (sizeof (a) / sizeof (a[0])) - -static int -Fax3VSetField(TIFF* tif, ttag_t tag, va_list ap) -{ - Fax3BaseState* sp = Fax3State(tif); - - switch (tag) { - case TIFFTAG_FAXMODE: - sp->mode = va_arg(ap, int); - return (1); /* NB: pseudo tag */ - case TIFFTAG_FAXFILLFUNC: - DecoderState(tif)->fill = va_arg(ap, TIFFFaxFillFunc); - return (1); /* NB: pseudo tag */ - case TIFFTAG_GROUP3OPTIONS: - case TIFFTAG_GROUP4OPTIONS: - sp->groupoptions = va_arg(ap, uint32); - break; - case TIFFTAG_BADFAXLINES: - sp->badfaxlines = va_arg(ap, uint32); - break; - case TIFFTAG_CLEANFAXDATA: - sp->cleanfaxdata = (uint16) va_arg(ap, int); - break; - case TIFFTAG_CONSECUTIVEBADFAXLINES: - sp->badfaxrun = va_arg(ap, uint32); - break; - case TIFFTAG_FAXRECVPARAMS: - sp->recvparams = va_arg(ap, uint32); - break; - case TIFFTAG_FAXSUBADDRESS: - _TIFFsetString(&sp->subaddress, va_arg(ap, char*)); - break; - case TIFFTAG_FAXRECVTIME: - sp->recvtime = va_arg(ap, uint32); - break; - default: - return (*sp->vsetparent)(tif, tag, ap); - } - TIFFSetFieldBit(tif, _TIFFFieldWithTag(tif, tag)->field_bit); - tif->tif_flags |= TIFF_DIRTYDIRECT; - return (1); -} - -static int -Fax3VGetField(TIFF* tif, ttag_t tag, va_list ap) -{ - Fax3BaseState* sp = Fax3State(tif); - - switch (tag) { - case TIFFTAG_FAXMODE: - *va_arg(ap, int*) = sp->mode; - break; - case TIFFTAG_FAXFILLFUNC: - *va_arg(ap, TIFFFaxFillFunc*) = DecoderState(tif)->fill; - break; - case TIFFTAG_GROUP3OPTIONS: - case TIFFTAG_GROUP4OPTIONS: - *va_arg(ap, uint32*) = sp->groupoptions; - break; - case TIFFTAG_BADFAXLINES: - *va_arg(ap, uint32*) = sp->badfaxlines; - break; - case TIFFTAG_CLEANFAXDATA: - *va_arg(ap, uint16*) = sp->cleanfaxdata; - break; - case TIFFTAG_CONSECUTIVEBADFAXLINES: - *va_arg(ap, uint32*) = sp->badfaxrun; - break; - case TIFFTAG_FAXRECVPARAMS: - *va_arg(ap, uint32*) = sp->recvparams; - break; - case TIFFTAG_FAXSUBADDRESS: - *va_arg(ap, char**) = sp->subaddress; - break; - case TIFFTAG_FAXRECVTIME: - *va_arg(ap, uint32*) = sp->recvtime; - break; - default: - return (*sp->vgetparent)(tif, tag, ap); - } - return (1); -} - -static void -Fax3PrintDir(TIFF* tif, FILE* fd, long flags) -{ - Fax3BaseState* sp = Fax3State(tif); - - (void) flags; - if (TIFFFieldSet(tif,FIELD_OPTIONS)) { - const char* sep = " "; - if (tif->tif_dir.td_compression == COMPRESSION_CCITTFAX4) { - fprintf(fd, " Group 4 Options:"); - if (sp->groupoptions & GROUP4OPT_UNCOMPRESSED) - fprintf(fd, "%suncompressed data", sep); - } else { - - fprintf(fd, " Group 3 Options:"); - if (sp->groupoptions & GROUP3OPT_2DENCODING) - fprintf(fd, "%s2-d encoding", sep), sep = "+"; - if (sp->groupoptions & GROUP3OPT_FILLBITS) - fprintf(fd, "%sEOL padding", sep), sep = "+"; - if (sp->groupoptions & GROUP3OPT_UNCOMPRESSED) - fprintf(fd, "%suncompressed data", sep); - } - fprintf(fd, " (%lu = 0x%lx)\n", - (u_long) sp->groupoptions, (u_long) sp->groupoptions); - } - if (TIFFFieldSet(tif,FIELD_CLEANFAXDATA)) { - fprintf(fd, " Fax Data:"); - switch (sp->cleanfaxdata) { - case CLEANFAXDATA_CLEAN: - fprintf(fd, " clean"); - break; - case CLEANFAXDATA_REGENERATED: - fprintf(fd, " receiver regenerated"); - break; - case CLEANFAXDATA_UNCLEAN: - fprintf(fd, " uncorrected errors"); - break; - } - fprintf(fd, " (%u = 0x%x)\n", - sp->cleanfaxdata, sp->cleanfaxdata); - } - if (TIFFFieldSet(tif,FIELD_BADFAXLINES)) - fprintf(fd, " Bad Fax Lines: %lu\n", (u_long) sp->badfaxlines); - if (TIFFFieldSet(tif,FIELD_BADFAXRUN)) - fprintf(fd, " Consecutive Bad Fax Lines: %lu\n", - (u_long) sp->badfaxrun); - if (TIFFFieldSet(tif,FIELD_RECVPARAMS)) - fprintf(fd, " Fax Receive Parameters: %08lx\n", - (u_long) sp->recvparams); - if (TIFFFieldSet(tif,FIELD_SUBADDRESS)) - fprintf(fd, " Fax SubAddress: %s\n", sp->subaddress); - if (TIFFFieldSet(tif,FIELD_RECVTIME)) - fprintf(fd, " Fax Receive Time: %lu secs\n", - (u_long) sp->recvtime); -} - -static int -InitCCITTFax3(TIFF* tif) -{ - Fax3BaseState* sp; - - /* - * Allocate state block so tag methods have storage to record values. - */ - tif->tif_data = (tidata_t) - _TIFFmalloc(sizeof (Fax3CodecState)); - - if (tif->tif_data == NULL) { - TIFFError("TIFFInitCCITTFax3", - "%s: No space for state block", tif->tif_name); - return (0); - } - - sp = Fax3State(tif); - sp->rw_mode = tif->tif_mode; - - /* - * Merge codec-specific tag information and - * override parent get/set field methods. - */ - _TIFFMergeFieldInfo(tif, faxFieldInfo, N(faxFieldInfo)); - sp->vgetparent = tif->tif_tagmethods.vgetfield; - tif->tif_tagmethods.vgetfield = Fax3VGetField; /* hook for codec tags */ - sp->vsetparent = tif->tif_tagmethods.vsetfield; - tif->tif_tagmethods.vsetfield = Fax3VSetField; /* hook for codec tags */ - tif->tif_tagmethods.printdir = Fax3PrintDir; /* hook for codec tags */ - sp->groupoptions = 0; - sp->recvparams = 0; - sp->subaddress = NULL; - - tif->tif_flags |= TIFF_NOBITREV; /* decoder does bit reversal */ - DecoderState(tif)->runs = NULL; - TIFFSetField(tif, TIFFTAG_FAXFILLFUNC, _TIFFFax3fillruns); - EncoderState(tif)->refline = NULL; - - /* - * Install codec methods. - */ - tif->tif_setupdecode = Fax3SetupState; - tif->tif_predecode = Fax3PreDecode; - tif->tif_decoderow = Fax3Decode1D; - tif->tif_decodestrip = Fax3Decode1D; - tif->tif_decodetile = Fax3Decode1D; - tif->tif_setupencode = Fax3SetupState; - tif->tif_preencode = Fax3PreEncode; - tif->tif_postencode = Fax3PostEncode; - tif->tif_encoderow = Fax3Encode; - tif->tif_encodestrip = Fax3Encode; - tif->tif_encodetile = Fax3Encode; - tif->tif_close = Fax3Close; - tif->tif_cleanup = Fax3Cleanup; - - return (1); -} - -int -TIFFInitCCITTFax3(TIFF* tif, int scheme) -{ - if (InitCCITTFax3(tif)) { - _TIFFMergeFieldInfo(tif, fax3FieldInfo, N(fax3FieldInfo)); - - /* - * The default format is Class/F-style w/o RTC. - */ - return TIFFSetField(tif, TIFFTAG_FAXMODE, FAXMODE_CLASSF); - } else - return (0); -} - -/* - * CCITT Group 4 (T.6) Facsimile-compatible - * Compression Scheme Support. - */ - -#define SWAP(t,a,b) { t x; x = (a); (a) = (b); (b) = x; } -/* - * Decode the requested amount of G4-encoded data. - */ -static int -Fax4Decode(TIFF* tif, tidata_t buf, tsize_t occ, tsample_t s) -{ - DECLARE_STATE_2D(tif, sp, "Fax4Decode"); - - (void) s; - CACHE_STATE(tif, sp); - while ((long)occ > 0) { - a0 = 0; - RunLength = 0; - pa = thisrun = sp->curruns; - pb = sp->refruns; - b1 = *pb++; -#ifdef FAX3_DEBUG - printf("\nBitAcc=%08X, BitsAvail = %d\n", BitAcc, BitsAvail); - printf("-------------------- %d\n", tif->tif_row); - fflush(stdout); -#endif - EXPAND2D(EOFG4); - if (EOLcnt) - goto EOFG4; - (*sp->fill)(buf, thisrun, pa, lastx); - SETVAL(0); /* imaginary change for reference */ - SWAP(uint32*, sp->curruns, sp->refruns); - buf += sp->b.rowbytes; - occ -= sp->b.rowbytes; - continue; - EOFG4: - NeedBits16( 13, BADG4 ); - BADG4: -#ifdef FAX3_DEBUG - if( GetBits(13) != 0x1001 ) - fputs( "Bad RTC\n", stderr ); -#endif - ClrBits( 13 ); - (*sp->fill)(buf, thisrun, pa, lastx); - UNCACHE_STATE(tif, sp); - return (-1); - } - UNCACHE_STATE(tif, sp); - return (1); -} -#undef SWAP - -/* - * Encode the requested amount of data. - */ -static int -Fax4Encode(TIFF* tif, tidata_t bp, tsize_t cc, tsample_t s) -{ - Fax3CodecState *sp = EncoderState(tif); - - (void) s; - while ((long)cc > 0) { - if (!Fax3Encode2DRow(tif, bp, sp->refline, sp->b.rowpixels)) - return (0); - _TIFFmemcpy(sp->refline, bp, sp->b.rowbytes); - bp += sp->b.rowbytes; - cc -= sp->b.rowbytes; - } - return (1); -} - -static int -Fax4PostEncode(TIFF* tif) -{ - Fax3CodecState *sp = EncoderState(tif); - - /* terminate strip w/ EOFB */ - Fax3PutBits(tif, EOL, 12); - Fax3PutBits(tif, EOL, 12); - if (sp->bit != 8) - Fax3FlushBits(tif, sp); - return (1); -} - -int -TIFFInitCCITTFax4(TIFF* tif, int scheme) -{ - if (InitCCITTFax3(tif)) { /* reuse G3 support */ - _TIFFMergeFieldInfo(tif, fax4FieldInfo, N(fax4FieldInfo)); - - tif->tif_decoderow = Fax4Decode; - tif->tif_decodestrip = Fax4Decode; - tif->tif_decodetile = Fax4Decode; - tif->tif_encoderow = Fax4Encode; - tif->tif_encodestrip = Fax4Encode; - tif->tif_encodetile = Fax4Encode; - tif->tif_postencode = Fax4PostEncode; - /* - * Suppress RTC at the end of each strip. - */ - return TIFFSetField(tif, TIFFTAG_FAXMODE, FAXMODE_NORTC); - } else - return (0); -} - -/* - * CCITT Group 3 1-D Modified Huffman RLE Compression Support. - * (Compression algorithms 2 and 32771) - */ - -/* - * Decode the requested amount of RLE-encoded data. - */ -static int -Fax3DecodeRLE(TIFF* tif, tidata_t buf, tsize_t occ, tsample_t s) -{ - DECLARE_STATE(tif, sp, "Fax3DecodeRLE"); - int mode = sp->b.mode; - - (void) s; - CACHE_STATE(tif, sp); - thisrun = sp->curruns; - while ((long)occ > 0) { - a0 = 0; - RunLength = 0; - pa = thisrun; -#ifdef FAX3_DEBUG - printf("\nBitAcc=%08X, BitsAvail = %d\n", BitAcc, BitsAvail); - printf("-------------------- %d\n", tif->tif_row); - fflush(stdout); -#endif - EXPAND1D(EOFRLE); - (*sp->fill)(buf, thisrun, pa, lastx); - /* - * Cleanup at the end of the row. - */ - if (mode & FAXMODE_BYTEALIGN) { - int n = BitsAvail - (BitsAvail &~ 7); - ClrBits(n); - } else if (mode & FAXMODE_WORDALIGN) { - int n = BitsAvail - (BitsAvail &~ 15); - ClrBits(n); - if (BitsAvail == 0 && !isAligned(cp, uint16)) - cp++; - } - buf += sp->b.rowbytes; - occ -= sp->b.rowbytes; - continue; - EOFRLE: /* premature EOF */ - (*sp->fill)(buf, thisrun, pa, lastx); - UNCACHE_STATE(tif, sp); - return (-1); - } - UNCACHE_STATE(tif, sp); - return (1); -} - -int -TIFFInitCCITTRLE(TIFF* tif, int scheme) -{ - if (InitCCITTFax3(tif)) { /* reuse G3 support */ - tif->tif_decoderow = Fax3DecodeRLE; - tif->tif_decodestrip = Fax3DecodeRLE; - tif->tif_decodetile = Fax3DecodeRLE; - /* - * Suppress RTC+EOLs when encoding and byte-align data. - */ - return TIFFSetField(tif, TIFFTAG_FAXMODE, - FAXMODE_NORTC|FAXMODE_NOEOL|FAXMODE_BYTEALIGN); - } else - return (0); -} - -int -TIFFInitCCITTRLEW(TIFF* tif, int scheme) -{ - if (InitCCITTFax3(tif)) { /* reuse G3 support */ - tif->tif_decoderow = Fax3DecodeRLE; - tif->tif_decodestrip = Fax3DecodeRLE; - tif->tif_decodetile = Fax3DecodeRLE; - /* - * Suppress RTC+EOLs when encoding and word-align data. - */ - return TIFFSetField(tif, TIFFTAG_FAXMODE, - FAXMODE_NORTC|FAXMODE_NOEOL|FAXMODE_WORDALIGN); - } else - return (0); -} -#endif /* CCITT_SUPPORT */ diff --git a/wxWidgets/src/tiff/tif_fax3.h b/wxWidgets/src/tiff/tif_fax3.h deleted file mode 100644 index b0af1c118a..0000000000 --- a/wxWidgets/src/tiff/tif_fax3.h +++ /dev/null @@ -1,525 +0,0 @@ -/* $Id: tif_fax3.h 30659 2004-11-19 22:29:47Z VZ $ */ - -/* - * Copyright (c) 1990-1997 Sam Leffler - * Copyright (c) 1991-1997 Silicon Graphics, Inc. - * - * Permission to use, copy, modify, distribute, and sell this software and - * its documentation for any purpose is hereby granted without fee, provided - * that (i) the above copyright notices and this permission notice appear in - * all copies of the software and related documentation, and (ii) the names of - * Sam Leffler and Silicon Graphics may not be used in any advertising or - * publicity relating to the software without the specific, prior written - * permission of Sam Leffler and Silicon Graphics. - * - * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, - * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * - * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR - * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, - * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF - * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE - * OF THIS SOFTWARE. - */ - -#ifndef _FAX3_ -#define _FAX3_ -/* - * TIFF Library. - * - * CCITT Group 3 (T.4) and Group 4 (T.6) Decompression Support. - * - * Decoder support is derived, with permission, from the code - * in Frank Cringle's viewfax program; - * Copyright (C) 1990, 1995 Frank D. Cringle. - */ -#include "tiff.h" - -/* - * To override the default routine used to image decoded - * spans one can use the pseduo tag TIFFTAG_FAXFILLFUNC. - * The routine must have the type signature given below; - * for example: - * - * fillruns(unsigned char* buf, uint32* runs, uint32* erun, uint32 lastx) - * - * where buf is place to set the bits, runs is the array of b&w run - * lengths (white then black), erun is the last run in the array, and - * lastx is the width of the row in pixels. Fill routines can assume - * the run array has room for at least lastx runs and can overwrite - * data in the run array as needed (e.g. to append zero runs to bring - * the count up to a nice multiple). - */ -typedef void (*TIFFFaxFillFunc)(unsigned char*, uint32*, uint32*, uint32); - -/* - * The default run filler; made external for other decoders. - */ -#if defined(__cplusplus) -extern "C" { -#endif -extern void _TIFFFax3fillruns(unsigned char*, uint32*, uint32*, uint32); -#if defined(__cplusplus) -} -#endif - - -/* finite state machine codes */ -#define S_Null 0 -#define S_Pass 1 -#define S_Horiz 2 -#define S_V0 3 -#define S_VR 4 -#define S_VL 5 -#define S_Ext 6 -#define S_TermW 7 -#define S_TermB 8 -#define S_MakeUpW 9 -#define S_MakeUpB 10 -#define S_MakeUp 11 -#define S_EOL 12 - -typedef struct { /* state table entry */ - unsigned char State; /* see above */ - unsigned char Width; /* width of code in bits */ - uint32 Param; /* unsigned 32-bit run length in bits */ -} TIFFFaxTabEnt; - -extern const TIFFFaxTabEnt TIFFFaxMainTable[]; -extern const TIFFFaxTabEnt TIFFFaxWhiteTable[]; -extern const TIFFFaxTabEnt TIFFFaxBlackTable[]; - -/* - * The following macros define the majority of the G3/G4 decoder - * algorithm using the state tables defined elsewhere. To build - * a decoder you need some setup code and some glue code. Note - * that you may also need/want to change the way the NeedBits* - * macros get input data if, for example, you know the data to be - * decoded is properly aligned and oriented (doing so before running - * the decoder can be a big performance win). - * - * Consult the decoder in the TIFF library for an idea of what you - * need to define and setup to make use of these definitions. - * - * NB: to enable a debugging version of these macros define FAX3_DEBUG - * before including this file. Trace output goes to stdout. - */ - -#ifndef EndOfData -#define EndOfData() (cp >= ep) -#endif -/* - * Need <=8 or <=16 bits of input data. Unlike viewfax we - * cannot use/assume a word-aligned, properly bit swizzled - * input data set because data may come from an arbitrarily - * aligned, read-only source such as a memory-mapped file. - * Note also that the viewfax decoder does not check for - * running off the end of the input data buffer. This is - * possible for G3-encoded data because it prescans the input - * data to count EOL markers, but can cause problems for G4 - * data. In any event, we don't prescan and must watch for - * running out of data since we can't permit the library to - * scan past the end of the input data buffer. - * - * Finally, note that we must handle remaindered data at the end - * of a strip specially. The coder asks for a fixed number of - * bits when scanning for the next code. This may be more bits - * than are actually present in the data stream. If we appear - * to run out of data but still have some number of valid bits - * remaining then we makeup the requested amount with zeros and - * return successfully. If the returned data is incorrect then - * we should be called again and get a premature EOF error; - * otherwise we should get the right answer. - */ -#ifndef NeedBits8 -#define NeedBits8(n,eoflab) do { \ - if (BitsAvail < (n)) { \ - if (EndOfData()) { \ - if (BitsAvail == 0) /* no valid bits */ \ - goto eoflab; \ - BitsAvail = (n); /* pad with zeros */ \ - } else { \ - BitAcc |= ((uint32) bitmap[*cp++])<>= (n); \ -} while (0) - -#ifdef FAX3_DEBUG -static const char* StateNames[] = { - "Null ", - "Pass ", - "Horiz ", - "V0 ", - "VR ", - "VL ", - "Ext ", - "TermW ", - "TermB ", - "MakeUpW", - "MakeUpB", - "MakeUp ", - "EOL ", -}; -#define DEBUG_SHOW putchar(BitAcc & (1 << t) ? '1' : '0') -#define LOOKUP8(wid,tab,eoflab) do { \ - int t; \ - NeedBits8(wid,eoflab); \ - TabEnt = tab + GetBits(wid); \ - printf("%08lX/%d: %s%5d\t", (long) BitAcc, BitsAvail, \ - StateNames[TabEnt->State], TabEnt->Param); \ - for (t = 0; t < TabEnt->Width; t++) \ - DEBUG_SHOW; \ - putchar('\n'); \ - fflush(stdout); \ - ClrBits(TabEnt->Width); \ -} while (0) -#define LOOKUP16(wid,tab,eoflab) do { \ - int t; \ - NeedBits16(wid,eoflab); \ - TabEnt = tab + GetBits(wid); \ - printf("%08lX/%d: %s%5d\t", (long) BitAcc, BitsAvail, \ - StateNames[TabEnt->State], TabEnt->Param); \ - for (t = 0; t < TabEnt->Width; t++) \ - DEBUG_SHOW; \ - putchar('\n'); \ - fflush(stdout); \ - ClrBits(TabEnt->Width); \ -} while (0) - -#define SETVAL(x) do { \ - *pa++ = RunLength + (x); \ - printf("SETVAL: %d\t%d\n", RunLength + (x), a0); \ - a0 += x; \ - RunLength = 0; \ -} while (0) -#else -#define LOOKUP8(wid,tab,eoflab) do { \ - NeedBits8(wid,eoflab); \ - TabEnt = tab + GetBits(wid); \ - ClrBits(TabEnt->Width); \ -} while (0) -#define LOOKUP16(wid,tab,eoflab) do { \ - NeedBits16(wid,eoflab); \ - TabEnt = tab + GetBits(wid); \ - ClrBits(TabEnt->Width); \ -} while (0) - -/* - * Append a run to the run length array for the - * current row and reset decoding state. - */ -#define SETVAL(x) do { \ - *pa++ = RunLength + (x); \ - a0 += (x); \ - RunLength = 0; \ -} while (0) -#endif - -/* - * Synchronize input decoding at the start of each - * row by scanning for an EOL (if appropriate) and - * skipping any trash data that might be present - * after a decoding error. Note that the decoding - * done elsewhere that recognizes an EOL only consumes - * 11 consecutive zero bits. This means that if EOLcnt - * is non-zero then we still need to scan for the final flag - * bit that is part of the EOL code. - */ -#define SYNC_EOL(eoflab) do { \ - if (EOLcnt == 0) { \ - for (;;) { \ - NeedBits16(11,eoflab); \ - if (GetBits(11) == 0) \ - break; \ - ClrBits(1); \ - } \ - } \ - for (;;) { \ - NeedBits8(8,eoflab); \ - if (GetBits(8)) \ - break; \ - ClrBits(8); \ - } \ - while (GetBits(1) == 0) \ - ClrBits(1); \ - ClrBits(1); /* EOL bit */ \ - EOLcnt = 0; /* reset EOL counter/flag */ \ -} while (0) - -/* - * Cleanup the array of runs after decoding a row. - * We adjust final runs to insure the user buffer is not - * overwritten and/or undecoded area is white filled. - */ -#define CLEANUP_RUNS() do { \ - if (RunLength) \ - SETVAL(0); \ - if (a0 != lastx) { \ - badlength(a0, lastx); \ - while (a0 > lastx && pa > thisrun) \ - a0 -= *--pa; \ - if (a0 < lastx) { \ - if (a0 < 0) \ - a0 = 0; \ - if ((pa-thisrun)&1) \ - SETVAL(0); \ - SETVAL(lastx - a0); \ - } else if (a0 > lastx) { \ - SETVAL(lastx); \ - SETVAL(0); \ - } \ - } \ -} while (0) - -/* - * Decode a line of 1D-encoded data. - * - * The line expanders are written as macros so that they can be reused - * but still have direct access to the local variables of the "calling" - * function. - * - * Note that unlike the original version we have to explicitly test for - * a0 >= lastx after each black/white run is decoded. This is because - * the original code depended on the input data being zero-padded to - * insure the decoder recognized an EOL before running out of data. - */ -#define EXPAND1D(eoflab) do { \ - for (;;) { \ - for (;;) { \ - LOOKUP16(12, TIFFFaxWhiteTable, eof1d); \ - switch (TabEnt->State) { \ - case S_EOL: \ - EOLcnt = 1; \ - goto done1d; \ - case S_TermW: \ - SETVAL(TabEnt->Param); \ - goto doneWhite1d; \ - case S_MakeUpW: \ - case S_MakeUp: \ - a0 += TabEnt->Param; \ - RunLength += TabEnt->Param; \ - break; \ - default: \ - unexpected("WhiteTable", a0); \ - goto done1d; \ - } \ - } \ - doneWhite1d: \ - if (a0 >= lastx) \ - goto done1d; \ - for (;;) { \ - LOOKUP16(13, TIFFFaxBlackTable, eof1d); \ - switch (TabEnt->State) { \ - case S_EOL: \ - EOLcnt = 1; \ - goto done1d; \ - case S_TermB: \ - SETVAL(TabEnt->Param); \ - goto doneBlack1d; \ - case S_MakeUpB: \ - case S_MakeUp: \ - a0 += TabEnt->Param; \ - RunLength += TabEnt->Param; \ - break; \ - default: \ - unexpected("BlackTable", a0); \ - goto done1d; \ - } \ - } \ - doneBlack1d: \ - if (a0 >= lastx) \ - goto done1d; \ - if( *(pa-1) == 0 && *(pa-2) == 0 ) \ - pa -= 2; \ - } \ -eof1d: \ - prematureEOF(a0); \ - CLEANUP_RUNS(); \ - goto eoflab; \ -done1d: \ - CLEANUP_RUNS(); \ -} while (0) - -/* - * Update the value of b1 using the array - * of runs for the reference line. - */ -#define CHECK_b1 do { \ - if (pa != thisrun) while (b1 <= a0 && b1 < lastx) { \ - b1 += pb[0] + pb[1]; \ - pb += 2; \ - } \ -} while (0) - -/* - * Expand a row of 2D-encoded data. - */ -#define EXPAND2D(eoflab) do { \ - while (a0 < lastx) { \ - LOOKUP8(7, TIFFFaxMainTable, eof2d); \ - switch (TabEnt->State) { \ - case S_Pass: \ - CHECK_b1; \ - b1 += *pb++; \ - RunLength += b1 - a0; \ - a0 = b1; \ - b1 += *pb++; \ - break; \ - case S_Horiz: \ - if ((pa-thisrun)&1) { \ - for (;;) { /* black first */ \ - LOOKUP16(13, TIFFFaxBlackTable, eof2d); \ - switch (TabEnt->State) { \ - case S_TermB: \ - SETVAL(TabEnt->Param); \ - goto doneWhite2da; \ - case S_MakeUpB: \ - case S_MakeUp: \ - a0 += TabEnt->Param; \ - RunLength += TabEnt->Param; \ - break; \ - default: \ - goto badBlack2d; \ - } \ - } \ - doneWhite2da:; \ - for (;;) { /* then white */ \ - LOOKUP16(12, TIFFFaxWhiteTable, eof2d); \ - switch (TabEnt->State) { \ - case S_TermW: \ - SETVAL(TabEnt->Param); \ - goto doneBlack2da; \ - case S_MakeUpW: \ - case S_MakeUp: \ - a0 += TabEnt->Param; \ - RunLength += TabEnt->Param; \ - break; \ - default: \ - goto badWhite2d; \ - } \ - } \ - doneBlack2da:; \ - } else { \ - for (;;) { /* white first */ \ - LOOKUP16(12, TIFFFaxWhiteTable, eof2d); \ - switch (TabEnt->State) { \ - case S_TermW: \ - SETVAL(TabEnt->Param); \ - goto doneWhite2db; \ - case S_MakeUpW: \ - case S_MakeUp: \ - a0 += TabEnt->Param; \ - RunLength += TabEnt->Param; \ - break; \ - default: \ - goto badWhite2d; \ - } \ - } \ - doneWhite2db:; \ - for (;;) { /* then black */ \ - LOOKUP16(13, TIFFFaxBlackTable, eof2d); \ - switch (TabEnt->State) { \ - case S_TermB: \ - SETVAL(TabEnt->Param); \ - goto doneBlack2db; \ - case S_MakeUpB: \ - case S_MakeUp: \ - a0 += TabEnt->Param; \ - RunLength += TabEnt->Param; \ - break; \ - default: \ - goto badBlack2d; \ - } \ - } \ - doneBlack2db:; \ - } \ - CHECK_b1; \ - break; \ - case S_V0: \ - CHECK_b1; \ - SETVAL(b1 - a0); \ - b1 += *pb++; \ - break; \ - case S_VR: \ - CHECK_b1; \ - SETVAL(b1 - a0 + TabEnt->Param); \ - b1 += *pb++; \ - break; \ - case S_VL: \ - CHECK_b1; \ - SETVAL(b1 - a0 - TabEnt->Param); \ - b1 -= *--pb; \ - break; \ - case S_Ext: \ - *pa++ = lastx - a0; \ - extension(a0); \ - goto eol2d; \ - case S_EOL: \ - *pa++ = lastx - a0; \ - NeedBits8(4,eof2d); \ - if (GetBits(4)) \ - unexpected("EOL", a0); \ - ClrBits(4); \ - EOLcnt = 1; \ - goto eol2d; \ - default: \ - badMain2d: \ - unexpected("MainTable", a0); \ - goto eol2d; \ - badBlack2d: \ - unexpected("BlackTable", a0); \ - goto eol2d; \ - badWhite2d: \ - unexpected("WhiteTable", a0); \ - goto eol2d; \ - eof2d: \ - prematureEOF(a0); \ - CLEANUP_RUNS(); \ - goto eoflab; \ - } \ - } \ - if (RunLength) { \ - if (RunLength + a0 < lastx) { \ - /* expect a final V0 */ \ - NeedBits8(1,eof2d); \ - if (!GetBits(1)) \ - goto badMain2d; \ - ClrBits(1); \ - } \ - SETVAL(0); \ - } \ -eol2d: \ - CLEANUP_RUNS(); \ -} while (0) -#endif /* _FAX3_ */ diff --git a/wxWidgets/src/tiff/tif_fax3sm.c b/wxWidgets/src/tiff/tif_fax3sm.c deleted file mode 100644 index 04de9bbf8b..0000000000 --- a/wxWidgets/src/tiff/tif_fax3sm.c +++ /dev/null @@ -1,1046 +0,0 @@ -/* WARNING, this file was automatically generated by the - mkg3states program */ -#include "tiff.h" -#include "tif_fax3.h" - const TIFFFaxTabEnt TIFFFaxMainTable[128] = { -12,7,0,3,1,0,5,3,1,3,1,0,2,3,0,3,1,0,4,3,1,3,1,0,1,4,0,3,1,0,5,3,1,3,1,0, -2,3,0,3,1,0,4,3,1,3,1,0,5,6,2,3,1,0,5,3,1,3,1,0,2,3,0,3,1,0,4,3,1,3,1,0, -1,4,0,3,1,0,5,3,1,3,1,0,2,3,0,3,1,0,4,3,1,3,1,0,5,7,3,3,1,0,5,3,1,3,1,0, -2,3,0,3,1,0,4,3,1,3,1,0,1,4,0,3,1,0,5,3,1,3,1,0,2,3,0,3,1,0,4,3,1,3,1,0, -4,6,2,3,1,0,5,3,1,3,1,0,2,3,0,3,1,0,4,3,1,3,1,0,1,4,0,3,1,0,5,3,1,3,1,0, -2,3,0,3,1,0,4,3,1,3,1,0,6,7,0,3,1,0,5,3,1,3,1,0,2,3,0,3,1,0,4,3,1,3,1,0, -1,4,0,3,1,0,5,3,1,3,1,0,2,3,0,3,1,0,4,3,1,3,1,0,5,6,2,3,1,0,5,3,1,3,1,0, -2,3,0,3,1,0,4,3,1,3,1,0,1,4,0,3,1,0,5,3,1,3,1,0,2,3,0,3,1,0,4,3,1,3,1,0, -4,7,3,3,1,0,5,3,1,3,1,0,2,3,0,3,1,0,4,3,1,3,1,0,1,4,0,3,1,0,5,3,1,3,1,0, -2,3,0,3,1,0,4,3,1,3,1,0,4,6,2,3,1,0,5,3,1,3,1,0,2,3,0,3,1,0,4,3,1,3,1,0, -1,4,0,3,1,0,5,3,1,3,1,0,2,3,0,3,1,0,4,3,1,3,1,0 -}; - const TIFFFaxTabEnt TIFFFaxWhiteTable[4096] = { -12,11,0,7,4,3,7,5,11,7,4,5,7,6,12,7,5,9,9,6,1664,7,4,6,7,7,20,9,5,128,7,7,24,7,6,14, -7,7,28,7,4,4,7,4,2,7,4,7,7,7,23,7,4,3,7,7,27,7,4,5,7,8,39,7,6,16,9,8,576,7,4,6, -7,7,19,7,5,8,7,8,55,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7,7,8,45,7,4,3,7,5,11,7,4,5, -7,8,53,7,5,9,9,8,448,7,4,6,7,8,35,9,5,128,7,8,51,7,6,15,7,8,63,7,4,4,7,4,2,7,4,7, -7,6,13,7,4,3,9,9,1472,7,4,5,7,8,43,7,6,17,9,9,1216,7,4,6,7,6,1,7,5,8,9,6,192,9,5,64, -7,5,10,7,4,4,7,4,2,7,4,7,7,8,29,7,4,3,7,5,11,7,4,5,7,6,12,7,5,9,9,6,1664,7,4,6, -7,8,33,9,5,128,7,8,49,7,6,14,7,8,61,7,4,4,7,4,2,7,4,7,7,8,47,7,4,3,7,8,59,7,4,5, -7,8,41,7,6,16,9,9,960,7,4,6,7,8,31,7,5,8,7,8,57,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7, -7,7,22,7,4,3,7,5,11,7,4,5,7,7,26,7,5,9,9,9,704,7,4,6,7,8,37,9,5,128,7,7,25,7,6,15, -9,8,320,7,4,4,7,4,2,7,4,7,7,6,13,7,4,3,7,7,18,7,4,5,7,7,21,7,6,17,9,7,256,7,4,6, -7,6,1,7,5,8,9,6,192,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7,11,11,1792,7,4,3,7,5,11,7,4,5, -7,6,12,7,5,9,9,6,1664,7,4,6,7,7,20,9,5,128,7,7,24,7,6,14,7,7,28,7,4,4,7,4,2,7,4,7, -7,7,23,7,4,3,7,7,27,7,4,5,7,8,40,7,6,16,9,9,832,7,4,6,7,7,19,7,5,8,7,8,56,9,5,64, -7,5,10,7,4,4,7,4,2,7,4,7,7,8,46,7,4,3,7,5,11,7,4,5,7,8,54,7,5,9,9,8,512,7,4,6, -7,8,36,9,5,128,7,8,52,7,6,15,7,8,0,7,4,4,7,4,2,7,4,7,7,6,13,7,4,3,9,9,1600,7,4,5, -7,8,44,7,6,17,9,9,1344,7,4,6,7,6,1,7,5,8,9,6,192,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7, -7,8,30,7,4,3,7,5,11,7,4,5,7,6,12,7,5,9,9,6,1664,7,4,6,7,8,34,9,5,128,7,8,50,7,6,14, -7,8,62,7,4,4,7,4,2,7,4,7,7,8,48,7,4,3,7,8,60,7,4,5,7,8,42,7,6,16,9,9,1088,7,4,6, -7,8,32,7,5,8,7,8,58,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7,7,7,22,7,4,3,7,5,11,7,4,5, -7,7,26,7,5,9,9,8,640,7,4,6,7,8,38,9,5,128,7,7,25,7,6,15,9,8,384,7,4,4,7,4,2,7,4,7, -7,6,13,7,4,3,7,7,18,7,4,5,7,7,21,7,6,17,9,7,256,7,4,6,7,6,1,7,5,8,9,6,192,9,5,64, -7,5,10,7,4,4,7,4,2,7,4,7,0,0,0,7,4,3,7,5,11,7,4,5,7,6,12,7,5,9,9,6,1664,7,4,6, -7,7,20,9,5,128,7,7,24,7,6,14,7,7,28,7,4,4,7,4,2,7,4,7,7,7,23,7,4,3,7,7,27,7,4,5, -7,8,39,7,6,16,9,8,576,7,4,6,7,7,19,7,5,8,7,8,55,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7, -7,8,45,7,4,3,7,5,11,7,4,5,7,8,53,7,5,9,9,8,448,7,4,6,7,8,35,9,5,128,7,8,51,7,6,15, -7,8,63,7,4,4,7,4,2,7,4,7,7,6,13,7,4,3,9,9,1536,7,4,5,7,8,43,7,6,17,9,9,1280,7,4,6, -7,6,1,7,5,8,9,6,192,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7,7,8,29,7,4,3,7,5,11,7,4,5, -7,6,12,7,5,9,9,6,1664,7,4,6,7,8,33,9,5,128,7,8,49,7,6,14,7,8,61,7,4,4,7,4,2,7,4,7, -7,8,47,7,4,3,7,8,59,7,4,5,7,8,41,7,6,16,9,9,1024,7,4,6,7,8,31,7,5,8,7,8,57,9,5,64, -7,5,10,7,4,4,7,4,2,7,4,7,7,7,22,7,4,3,7,5,11,7,4,5,7,7,26,7,5,9,9,9,768,7,4,6, -7,8,37,9,5,128,7,7,25,7,6,15,9,8,320,7,4,4,7,4,2,7,4,7,7,6,13,7,4,3,7,7,18,7,4,5, -7,7,21,7,6,17,9,7,256,7,4,6,7,6,1,7,5,8,9,6,192,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7, -11,11,1856,7,4,3,7,5,11,7,4,5,7,6,12,7,5,9,9,6,1664,7,4,6,7,7,20,9,5,128,7,7,24,7,6,14, -7,7,28,7,4,4,7,4,2,7,4,7,7,7,23,7,4,3,7,7,27,7,4,5,7,8,40,7,6,16,9,9,896,7,4,6, -7,7,19,7,5,8,7,8,56,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7,7,8,46,7,4,3,7,5,11,7,4,5, -7,8,54,7,5,9,9,8,512,7,4,6,7,8,36,9,5,128,7,8,52,7,6,15,7,8,0,7,4,4,7,4,2,7,4,7, -7,6,13,7,4,3,9,9,1728,7,4,5,7,8,44,7,6,17,9,9,1408,7,4,6,7,6,1,7,5,8,9,6,192,9,5,64, -7,5,10,7,4,4,7,4,2,7,4,7,7,8,30,7,4,3,7,5,11,7,4,5,7,6,12,7,5,9,9,6,1664,7,4,6, -7,8,34,9,5,128,7,8,50,7,6,14,7,8,62,7,4,4,7,4,2,7,4,7,7,8,48,7,4,3,7,8,60,7,4,5, -7,8,42,7,6,16,9,9,1152,7,4,6,7,8,32,7,5,8,7,8,58,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7, -7,7,22,7,4,3,7,5,11,7,4,5,7,7,26,7,5,9,9,8,640,7,4,6,7,8,38,9,5,128,7,7,25,7,6,15, -9,8,384,7,4,4,7,4,2,7,4,7,7,6,13,7,4,3,7,7,18,7,4,5,7,7,21,7,6,17,9,7,256,7,4,6, -7,6,1,7,5,8,9,6,192,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7,0,0,0,7,4,3,7,5,11,7,4,5, -7,6,12,7,5,9,9,6,1664,7,4,6,7,7,20,9,5,128,7,7,24,7,6,14,7,7,28,7,4,4,7,4,2,7,4,7, -7,7,23,7,4,3,7,7,27,7,4,5,7,8,39,7,6,16,9,8,576,7,4,6,7,7,19,7,5,8,7,8,55,9,5,64, -7,5,10,7,4,4,7,4,2,7,4,7,7,8,45,7,4,3,7,5,11,7,4,5,7,8,53,7,5,9,9,8,448,7,4,6, -7,8,35,9,5,128,7,8,51,7,6,15,7,8,63,7,4,4,7,4,2,7,4,7,7,6,13,7,4,3,9,9,1472,7,4,5, -7,8,43,7,6,17,9,9,1216,7,4,6,7,6,1,7,5,8,9,6,192,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7, -7,8,29,7,4,3,7,5,11,7,4,5,7,6,12,7,5,9,9,6,1664,7,4,6,7,8,33,9,5,128,7,8,49,7,6,14, -7,8,61,7,4,4,7,4,2,7,4,7,7,8,47,7,4,3,7,8,59,7,4,5,7,8,41,7,6,16,9,9,960,7,4,6, -7,8,31,7,5,8,7,8,57,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7,7,7,22,7,4,3,7,5,11,7,4,5, -7,7,26,7,5,9,9,9,704,7,4,6,7,8,37,9,5,128,7,7,25,7,6,15,9,8,320,7,4,4,7,4,2,7,4,7, -7,6,13,7,4,3,7,7,18,7,4,5,7,7,21,7,6,17,9,7,256,7,4,6,7,6,1,7,5,8,9,6,192,9,5,64, -7,5,10,7,4,4,7,4,2,7,4,7,11,12,2112,7,4,3,7,5,11,7,4,5,7,6,12,7,5,9,9,6,1664,7,4,6, -7,7,20,9,5,128,7,7,24,7,6,14,7,7,28,7,4,4,7,4,2,7,4,7,7,7,23,7,4,3,7,7,27,7,4,5, -7,8,40,7,6,16,9,9,832,7,4,6,7,7,19,7,5,8,7,8,56,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7, -7,8,46,7,4,3,7,5,11,7,4,5,7,8,54,7,5,9,9,8,512,7,4,6,7,8,36,9,5,128,7,8,52,7,6,15, -7,8,0,7,4,4,7,4,2,7,4,7,7,6,13,7,4,3,9,9,1600,7,4,5,7,8,44,7,6,17,9,9,1344,7,4,6, -7,6,1,7,5,8,9,6,192,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7,7,8,30,7,4,3,7,5,11,7,4,5, -7,6,12,7,5,9,9,6,1664,7,4,6,7,8,34,9,5,128,7,8,50,7,6,14,7,8,62,7,4,4,7,4,2,7,4,7, -7,8,48,7,4,3,7,8,60,7,4,5,7,8,42,7,6,16,9,9,1088,7,4,6,7,8,32,7,5,8,7,8,58,9,5,64, -7,5,10,7,4,4,7,4,2,7,4,7,7,7,22,7,4,3,7,5,11,7,4,5,7,7,26,7,5,9,9,8,640,7,4,6, -7,8,38,9,5,128,7,7,25,7,6,15,9,8,384,7,4,4,7,4,2,7,4,7,7,6,13,7,4,3,7,7,18,7,4,5, -7,7,21,7,6,17,9,7,256,7,4,6,7,6,1,7,5,8,9,6,192,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7, -0,0,0,7,4,3,7,5,11,7,4,5,7,6,12,7,5,9,9,6,1664,7,4,6,7,7,20,9,5,128,7,7,24,7,6,14, -7,7,28,7,4,4,7,4,2,7,4,7,7,7,23,7,4,3,7,7,27,7,4,5,7,8,39,7,6,16,9,8,576,7,4,6, -7,7,19,7,5,8,7,8,55,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7,7,8,45,7,4,3,7,5,11,7,4,5, -7,8,53,7,5,9,9,8,448,7,4,6,7,8,35,9,5,128,7,8,51,7,6,15,7,8,63,7,4,4,7,4,2,7,4,7, -7,6,13,7,4,3,9,9,1536,7,4,5,7,8,43,7,6,17,9,9,1280,7,4,6,7,6,1,7,5,8,9,6,192,9,5,64, -7,5,10,7,4,4,7,4,2,7,4,7,7,8,29,7,4,3,7,5,11,7,4,5,7,6,12,7,5,9,9,6,1664,7,4,6, -7,8,33,9,5,128,7,8,49,7,6,14,7,8,61,7,4,4,7,4,2,7,4,7,7,8,47,7,4,3,7,8,59,7,4,5, -7,8,41,7,6,16,9,9,1024,7,4,6,7,8,31,7,5,8,7,8,57,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7, -7,7,22,7,4,3,7,5,11,7,4,5,7,7,26,7,5,9,9,9,768,7,4,6,7,8,37,9,5,128,7,7,25,7,6,15, -9,8,320,7,4,4,7,4,2,7,4,7,7,6,13,7,4,3,7,7,18,7,4,5,7,7,21,7,6,17,9,7,256,7,4,6, -7,6,1,7,5,8,9,6,192,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7,11,12,2368,7,4,3,7,5,11,7,4,5, -7,6,12,7,5,9,9,6,1664,7,4,6,7,7,20,9,5,128,7,7,24,7,6,14,7,7,28,7,4,4,7,4,2,7,4,7, -7,7,23,7,4,3,7,7,27,7,4,5,7,8,40,7,6,16,9,9,896,7,4,6,7,7,19,7,5,8,7,8,56,9,5,64, -7,5,10,7,4,4,7,4,2,7,4,7,7,8,46,7,4,3,7,5,11,7,4,5,7,8,54,7,5,9,9,8,512,7,4,6, -7,8,36,9,5,128,7,8,52,7,6,15,7,8,0,7,4,4,7,4,2,7,4,7,7,6,13,7,4,3,9,9,1728,7,4,5, -7,8,44,7,6,17,9,9,1408,7,4,6,7,6,1,7,5,8,9,6,192,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7, -7,8,30,7,4,3,7,5,11,7,4,5,7,6,12,7,5,9,9,6,1664,7,4,6,7,8,34,9,5,128,7,8,50,7,6,14, -7,8,62,7,4,4,7,4,2,7,4,7,7,8,48,7,4,3,7,8,60,7,4,5,7,8,42,7,6,16,9,9,1152,7,4,6, -7,8,32,7,5,8,7,8,58,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7,7,7,22,7,4,3,7,5,11,7,4,5, -7,7,26,7,5,9,9,8,640,7,4,6,7,8,38,9,5,128,7,7,25,7,6,15,9,8,384,7,4,4,7,4,2,7,4,7, -7,6,13,7,4,3,7,7,18,7,4,5,7,7,21,7,6,17,9,7,256,7,4,6,7,6,1,7,5,8,9,6,192,9,5,64, -7,5,10,7,4,4,7,4,2,7,4,7,0,0,0,7,4,3,7,5,11,7,4,5,7,6,12,7,5,9,9,6,1664,7,4,6, -7,7,20,9,5,128,7,7,24,7,6,14,7,7,28,7,4,4,7,4,2,7,4,7,7,7,23,7,4,3,7,7,27,7,4,5, -7,8,39,7,6,16,9,8,576,7,4,6,7,7,19,7,5,8,7,8,55,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7, -7,8,45,7,4,3,7,5,11,7,4,5,7,8,53,7,5,9,9,8,448,7,4,6,7,8,35,9,5,128,7,8,51,7,6,15, -7,8,63,7,4,4,7,4,2,7,4,7,7,6,13,7,4,3,9,9,1472,7,4,5,7,8,43,7,6,17,9,9,1216,7,4,6, -7,6,1,7,5,8,9,6,192,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7,7,8,29,7,4,3,7,5,11,7,4,5, -7,6,12,7,5,9,9,6,1664,7,4,6,7,8,33,9,5,128,7,8,49,7,6,14,7,8,61,7,4,4,7,4,2,7,4,7, -7,8,47,7,4,3,7,8,59,7,4,5,7,8,41,7,6,16,9,9,960,7,4,6,7,8,31,7,5,8,7,8,57,9,5,64, -7,5,10,7,4,4,7,4,2,7,4,7,7,7,22,7,4,3,7,5,11,7,4,5,7,7,26,7,5,9,9,9,704,7,4,6, -7,8,37,9,5,128,7,7,25,7,6,15,9,8,320,7,4,4,7,4,2,7,4,7,7,6,13,7,4,3,7,7,18,7,4,5, -7,7,21,7,6,17,9,7,256,7,4,6,7,6,1,7,5,8,9,6,192,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7, -11,12,1984,7,4,3,7,5,11,7,4,5,7,6,12,7,5,9,9,6,1664,7,4,6,7,7,20,9,5,128,7,7,24,7,6,14, -7,7,28,7,4,4,7,4,2,7,4,7,7,7,23,7,4,3,7,7,27,7,4,5,7,8,40,7,6,16,9,9,832,7,4,6, -7,7,19,7,5,8,7,8,56,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7,7,8,46,7,4,3,7,5,11,7,4,5, -7,8,54,7,5,9,9,8,512,7,4,6,7,8,36,9,5,128,7,8,52,7,6,15,7,8,0,7,4,4,7,4,2,7,4,7, -7,6,13,7,4,3,9,9,1600,7,4,5,7,8,44,7,6,17,9,9,1344,7,4,6,7,6,1,7,5,8,9,6,192,9,5,64, -7,5,10,7,4,4,7,4,2,7,4,7,7,8,30,7,4,3,7,5,11,7,4,5,7,6,12,7,5,9,9,6,1664,7,4,6, -7,8,34,9,5,128,7,8,50,7,6,14,7,8,62,7,4,4,7,4,2,7,4,7,7,8,48,7,4,3,7,8,60,7,4,5, -7,8,42,7,6,16,9,9,1088,7,4,6,7,8,32,7,5,8,7,8,58,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7, -7,7,22,7,4,3,7,5,11,7,4,5,7,7,26,7,5,9,9,8,640,7,4,6,7,8,38,9,5,128,7,7,25,7,6,15, -9,8,384,7,4,4,7,4,2,7,4,7,7,6,13,7,4,3,7,7,18,7,4,5,7,7,21,7,6,17,9,7,256,7,4,6, -7,6,1,7,5,8,9,6,192,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7,0,0,0,7,4,3,7,5,11,7,4,5, -7,6,12,7,5,9,9,6,1664,7,4,6,7,7,20,9,5,128,7,7,24,7,6,14,7,7,28,7,4,4,7,4,2,7,4,7, -7,7,23,7,4,3,7,7,27,7,4,5,7,8,39,7,6,16,9,8,576,7,4,6,7,7,19,7,5,8,7,8,55,9,5,64, -7,5,10,7,4,4,7,4,2,7,4,7,7,8,45,7,4,3,7,5,11,7,4,5,7,8,53,7,5,9,9,8,448,7,4,6, -7,8,35,9,5,128,7,8,51,7,6,15,7,8,63,7,4,4,7,4,2,7,4,7,7,6,13,7,4,3,9,9,1536,7,4,5, -7,8,43,7,6,17,9,9,1280,7,4,6,7,6,1,7,5,8,9,6,192,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7, -7,8,29,7,4,3,7,5,11,7,4,5,7,6,12,7,5,9,9,6,1664,7,4,6,7,8,33,9,5,128,7,8,49,7,6,14, -7,8,61,7,4,4,7,4,2,7,4,7,7,8,47,7,4,3,7,8,59,7,4,5,7,8,41,7,6,16,9,9,1024,7,4,6, -7,8,31,7,5,8,7,8,57,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7,7,7,22,7,4,3,7,5,11,7,4,5, -7,7,26,7,5,9,9,9,768,7,4,6,7,8,37,9,5,128,7,7,25,7,6,15,9,8,320,7,4,4,7,4,2,7,4,7, -7,6,13,7,4,3,7,7,18,7,4,5,7,7,21,7,6,17,9,7,256,7,4,6,7,6,1,7,5,8,9,6,192,9,5,64, -7,5,10,7,4,4,7,4,2,7,4,7,11,11,1920,7,4,3,7,5,11,7,4,5,7,6,12,7,5,9,9,6,1664,7,4,6, -7,7,20,9,5,128,7,7,24,7,6,14,7,7,28,7,4,4,7,4,2,7,4,7,7,7,23,7,4,3,7,7,27,7,4,5, -7,8,40,7,6,16,9,9,896,7,4,6,7,7,19,7,5,8,7,8,56,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7, -7,8,46,7,4,3,7,5,11,7,4,5,7,8,54,7,5,9,9,8,512,7,4,6,7,8,36,9,5,128,7,8,52,7,6,15, -7,8,0,7,4,4,7,4,2,7,4,7,7,6,13,7,4,3,9,9,1728,7,4,5,7,8,44,7,6,17,9,9,1408,7,4,6, -7,6,1,7,5,8,9,6,192,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7,7,8,30,7,4,3,7,5,11,7,4,5, -7,6,12,7,5,9,9,6,1664,7,4,6,7,8,34,9,5,128,7,8,50,7,6,14,7,8,62,7,4,4,7,4,2,7,4,7, -7,8,48,7,4,3,7,8,60,7,4,5,7,8,42,7,6,16,9,9,1152,7,4,6,7,8,32,7,5,8,7,8,58,9,5,64, -7,5,10,7,4,4,7,4,2,7,4,7,7,7,22,7,4,3,7,5,11,7,4,5,7,7,26,7,5,9,9,8,640,7,4,6, -7,8,38,9,5,128,7,7,25,7,6,15,9,8,384,7,4,4,7,4,2,7,4,7,7,6,13,7,4,3,7,7,18,7,4,5, -7,7,21,7,6,17,9,7,256,7,4,6,7,6,1,7,5,8,9,6,192,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7, -0,0,0,7,4,3,7,5,11,7,4,5,7,6,12,7,5,9,9,6,1664,7,4,6,7,7,20,9,5,128,7,7,24,7,6,14, -7,7,28,7,4,4,7,4,2,7,4,7,7,7,23,7,4,3,7,7,27,7,4,5,7,8,39,7,6,16,9,8,576,7,4,6, -7,7,19,7,5,8,7,8,55,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7,7,8,45,7,4,3,7,5,11,7,4,5, -7,8,53,7,5,9,9,8,448,7,4,6,7,8,35,9,5,128,7,8,51,7,6,15,7,8,63,7,4,4,7,4,2,7,4,7, -7,6,13,7,4,3,9,9,1472,7,4,5,7,8,43,7,6,17,9,9,1216,7,4,6,7,6,1,7,5,8,9,6,192,9,5,64, -7,5,10,7,4,4,7,4,2,7,4,7,7,8,29,7,4,3,7,5,11,7,4,5,7,6,12,7,5,9,9,6,1664,7,4,6, -7,8,33,9,5,128,7,8,49,7,6,14,7,8,61,7,4,4,7,4,2,7,4,7,7,8,47,7,4,3,7,8,59,7,4,5, -7,8,41,7,6,16,9,9,960,7,4,6,7,8,31,7,5,8,7,8,57,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7, -7,7,22,7,4,3,7,5,11,7,4,5,7,7,26,7,5,9,9,9,704,7,4,6,7,8,37,9,5,128,7,7,25,7,6,15, -9,8,320,7,4,4,7,4,2,7,4,7,7,6,13,7,4,3,7,7,18,7,4,5,7,7,21,7,6,17,9,7,256,7,4,6, -7,6,1,7,5,8,9,6,192,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7,11,12,2240,7,4,3,7,5,11,7,4,5, -7,6,12,7,5,9,9,6,1664,7,4,6,7,7,20,9,5,128,7,7,24,7,6,14,7,7,28,7,4,4,7,4,2,7,4,7, -7,7,23,7,4,3,7,7,27,7,4,5,7,8,40,7,6,16,9,9,832,7,4,6,7,7,19,7,5,8,7,8,56,9,5,64, -7,5,10,7,4,4,7,4,2,7,4,7,7,8,46,7,4,3,7,5,11,7,4,5,7,8,54,7,5,9,9,8,512,7,4,6, -7,8,36,9,5,128,7,8,52,7,6,15,7,8,0,7,4,4,7,4,2,7,4,7,7,6,13,7,4,3,9,9,1600,7,4,5, -7,8,44,7,6,17,9,9,1344,7,4,6,7,6,1,7,5,8,9,6,192,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7, -7,8,30,7,4,3,7,5,11,7,4,5,7,6,12,7,5,9,9,6,1664,7,4,6,7,8,34,9,5,128,7,8,50,7,6,14, -7,8,62,7,4,4,7,4,2,7,4,7,7,8,48,7,4,3,7,8,60,7,4,5,7,8,42,7,6,16,9,9,1088,7,4,6, -7,8,32,7,5,8,7,8,58,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7,7,7,22,7,4,3,7,5,11,7,4,5, -7,7,26,7,5,9,9,8,640,7,4,6,7,8,38,9,5,128,7,7,25,7,6,15,9,8,384,7,4,4,7,4,2,7,4,7, -7,6,13,7,4,3,7,7,18,7,4,5,7,7,21,7,6,17,9,7,256,7,4,6,7,6,1,7,5,8,9,6,192,9,5,64, -7,5,10,7,4,4,7,4,2,7,4,7,0,0,0,7,4,3,7,5,11,7,4,5,7,6,12,7,5,9,9,6,1664,7,4,6, -7,7,20,9,5,128,7,7,24,7,6,14,7,7,28,7,4,4,7,4,2,7,4,7,7,7,23,7,4,3,7,7,27,7,4,5, -7,8,39,7,6,16,9,8,576,7,4,6,7,7,19,7,5,8,7,8,55,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7, -7,8,45,7,4,3,7,5,11,7,4,5,7,8,53,7,5,9,9,8,448,7,4,6,7,8,35,9,5,128,7,8,51,7,6,15, -7,8,63,7,4,4,7,4,2,7,4,7,7,6,13,7,4,3,9,9,1536,7,4,5,7,8,43,7,6,17,9,9,1280,7,4,6, -7,6,1,7,5,8,9,6,192,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7,7,8,29,7,4,3,7,5,11,7,4,5, -7,6,12,7,5,9,9,6,1664,7,4,6,7,8,33,9,5,128,7,8,49,7,6,14,7,8,61,7,4,4,7,4,2,7,4,7, -7,8,47,7,4,3,7,8,59,7,4,5,7,8,41,7,6,16,9,9,1024,7,4,6,7,8,31,7,5,8,7,8,57,9,5,64, -7,5,10,7,4,4,7,4,2,7,4,7,7,7,22,7,4,3,7,5,11,7,4,5,7,7,26,7,5,9,9,9,768,7,4,6, -7,8,37,9,5,128,7,7,25,7,6,15,9,8,320,7,4,4,7,4,2,7,4,7,7,6,13,7,4,3,7,7,18,7,4,5, -7,7,21,7,6,17,9,7,256,7,4,6,7,6,1,7,5,8,9,6,192,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7, -11,12,2496,7,4,3,7,5,11,7,4,5,7,6,12,7,5,9,9,6,1664,7,4,6,7,7,20,9,5,128,7,7,24,7,6,14, -7,7,28,7,4,4,7,4,2,7,4,7,7,7,23,7,4,3,7,7,27,7,4,5,7,8,40,7,6,16,9,9,896,7,4,6, -7,7,19,7,5,8,7,8,56,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7,7,8,46,7,4,3,7,5,11,7,4,5, -7,8,54,7,5,9,9,8,512,7,4,6,7,8,36,9,5,128,7,8,52,7,6,15,7,8,0,7,4,4,7,4,2,7,4,7, -7,6,13,7,4,3,9,9,1728,7,4,5,7,8,44,7,6,17,9,9,1408,7,4,6,7,6,1,7,5,8,9,6,192,9,5,64, -7,5,10,7,4,4,7,4,2,7,4,7,7,8,30,7,4,3,7,5,11,7,4,5,7,6,12,7,5,9,9,6,1664,7,4,6, -7,8,34,9,5,128,7,8,50,7,6,14,7,8,62,7,4,4,7,4,2,7,4,7,7,8,48,7,4,3,7,8,60,7,4,5, -7,8,42,7,6,16,9,9,1152,7,4,6,7,8,32,7,5,8,7,8,58,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7, -7,7,22,7,4,3,7,5,11,7,4,5,7,7,26,7,5,9,9,8,640,7,4,6,7,8,38,9,5,128,7,7,25,7,6,15, -9,8,384,7,4,4,7,4,2,7,4,7,7,6,13,7,4,3,7,7,18,7,4,5,7,7,21,7,6,17,9,7,256,7,4,6, -7,6,1,7,5,8,9,6,192,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7,12,11,0,7,4,3,7,5,11,7,4,5, -7,6,12,7,5,9,9,6,1664,7,4,6,7,7,20,9,5,128,7,7,24,7,6,14,7,7,28,7,4,4,7,4,2,7,4,7, -7,7,23,7,4,3,7,7,27,7,4,5,7,8,39,7,6,16,9,8,576,7,4,6,7,7,19,7,5,8,7,8,55,9,5,64, -7,5,10,7,4,4,7,4,2,7,4,7,7,8,45,7,4,3,7,5,11,7,4,5,7,8,53,7,5,9,9,8,448,7,4,6, -7,8,35,9,5,128,7,8,51,7,6,15,7,8,63,7,4,4,7,4,2,7,4,7,7,6,13,7,4,3,9,9,1472,7,4,5, -7,8,43,7,6,17,9,9,1216,7,4,6,7,6,1,7,5,8,9,6,192,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7, -7,8,29,7,4,3,7,5,11,7,4,5,7,6,12,7,5,9,9,6,1664,7,4,6,7,8,33,9,5,128,7,8,49,7,6,14, -7,8,61,7,4,4,7,4,2,7,4,7,7,8,47,7,4,3,7,8,59,7,4,5,7,8,41,7,6,16,9,9,960,7,4,6, -7,8,31,7,5,8,7,8,57,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7,7,7,22,7,4,3,7,5,11,7,4,5, -7,7,26,7,5,9,9,9,704,7,4,6,7,8,37,9,5,128,7,7,25,7,6,15,9,8,320,7,4,4,7,4,2,7,4,7, -7,6,13,7,4,3,7,7,18,7,4,5,7,7,21,7,6,17,9,7,256,7,4,6,7,6,1,7,5,8,9,6,192,9,5,64, -7,5,10,7,4,4,7,4,2,7,4,7,11,11,1792,7,4,3,7,5,11,7,4,5,7,6,12,7,5,9,9,6,1664,7,4,6, -7,7,20,9,5,128,7,7,24,7,6,14,7,7,28,7,4,4,7,4,2,7,4,7,7,7,23,7,4,3,7,7,27,7,4,5, -7,8,40,7,6,16,9,9,832,7,4,6,7,7,19,7,5,8,7,8,56,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7, -7,8,46,7,4,3,7,5,11,7,4,5,7,8,54,7,5,9,9,8,512,7,4,6,7,8,36,9,5,128,7,8,52,7,6,15, -7,8,0,7,4,4,7,4,2,7,4,7,7,6,13,7,4,3,9,9,1600,7,4,5,7,8,44,7,6,17,9,9,1344,7,4,6, -7,6,1,7,5,8,9,6,192,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7,7,8,30,7,4,3,7,5,11,7,4,5, -7,6,12,7,5,9,9,6,1664,7,4,6,7,8,34,9,5,128,7,8,50,7,6,14,7,8,62,7,4,4,7,4,2,7,4,7, -7,8,48,7,4,3,7,8,60,7,4,5,7,8,42,7,6,16,9,9,1088,7,4,6,7,8,32,7,5,8,7,8,58,9,5,64, -7,5,10,7,4,4,7,4,2,7,4,7,7,7,22,7,4,3,7,5,11,7,4,5,7,7,26,7,5,9,9,8,640,7,4,6, -7,8,38,9,5,128,7,7,25,7,6,15,9,8,384,7,4,4,7,4,2,7,4,7,7,6,13,7,4,3,7,7,18,7,4,5, -7,7,21,7,6,17,9,7,256,7,4,6,7,6,1,7,5,8,9,6,192,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7, -0,0,0,7,4,3,7,5,11,7,4,5,7,6,12,7,5,9,9,6,1664,7,4,6,7,7,20,9,5,128,7,7,24,7,6,14, -7,7,28,7,4,4,7,4,2,7,4,7,7,7,23,7,4,3,7,7,27,7,4,5,7,8,39,7,6,16,9,8,576,7,4,6, -7,7,19,7,5,8,7,8,55,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7,7,8,45,7,4,3,7,5,11,7,4,5, -7,8,53,7,5,9,9,8,448,7,4,6,7,8,35,9,5,128,7,8,51,7,6,15,7,8,63,7,4,4,7,4,2,7,4,7, -7,6,13,7,4,3,9,9,1536,7,4,5,7,8,43,7,6,17,9,9,1280,7,4,6,7,6,1,7,5,8,9,6,192,9,5,64, -7,5,10,7,4,4,7,4,2,7,4,7,7,8,29,7,4,3,7,5,11,7,4,5,7,6,12,7,5,9,9,6,1664,7,4,6, -7,8,33,9,5,128,7,8,49,7,6,14,7,8,61,7,4,4,7,4,2,7,4,7,7,8,47,7,4,3,7,8,59,7,4,5, -7,8,41,7,6,16,9,9,1024,7,4,6,7,8,31,7,5,8,7,8,57,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7, -7,7,22,7,4,3,7,5,11,7,4,5,7,7,26,7,5,9,9,9,768,7,4,6,7,8,37,9,5,128,7,7,25,7,6,15, -9,8,320,7,4,4,7,4,2,7,4,7,7,6,13,7,4,3,7,7,18,7,4,5,7,7,21,7,6,17,9,7,256,7,4,6, -7,6,1,7,5,8,9,6,192,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7,11,11,1856,7,4,3,7,5,11,7,4,5, -7,6,12,7,5,9,9,6,1664,7,4,6,7,7,20,9,5,128,7,7,24,7,6,14,7,7,28,7,4,4,7,4,2,7,4,7, -7,7,23,7,4,3,7,7,27,7,4,5,7,8,40,7,6,16,9,9,896,7,4,6,7,7,19,7,5,8,7,8,56,9,5,64, -7,5,10,7,4,4,7,4,2,7,4,7,7,8,46,7,4,3,7,5,11,7,4,5,7,8,54,7,5,9,9,8,512,7,4,6, -7,8,36,9,5,128,7,8,52,7,6,15,7,8,0,7,4,4,7,4,2,7,4,7,7,6,13,7,4,3,9,9,1728,7,4,5, -7,8,44,7,6,17,9,9,1408,7,4,6,7,6,1,7,5,8,9,6,192,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7, -7,8,30,7,4,3,7,5,11,7,4,5,7,6,12,7,5,9,9,6,1664,7,4,6,7,8,34,9,5,128,7,8,50,7,6,14, -7,8,62,7,4,4,7,4,2,7,4,7,7,8,48,7,4,3,7,8,60,7,4,5,7,8,42,7,6,16,9,9,1152,7,4,6, -7,8,32,7,5,8,7,8,58,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7,7,7,22,7,4,3,7,5,11,7,4,5, -7,7,26,7,5,9,9,8,640,7,4,6,7,8,38,9,5,128,7,7,25,7,6,15,9,8,384,7,4,4,7,4,2,7,4,7, -7,6,13,7,4,3,7,7,18,7,4,5,7,7,21,7,6,17,9,7,256,7,4,6,7,6,1,7,5,8,9,6,192,9,5,64, -7,5,10,7,4,4,7,4,2,7,4,7,0,0,0,7,4,3,7,5,11,7,4,5,7,6,12,7,5,9,9,6,1664,7,4,6, -7,7,20,9,5,128,7,7,24,7,6,14,7,7,28,7,4,4,7,4,2,7,4,7,7,7,23,7,4,3,7,7,27,7,4,5, -7,8,39,7,6,16,9,8,576,7,4,6,7,7,19,7,5,8,7,8,55,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7, -7,8,45,7,4,3,7,5,11,7,4,5,7,8,53,7,5,9,9,8,448,7,4,6,7,8,35,9,5,128,7,8,51,7,6,15, -7,8,63,7,4,4,7,4,2,7,4,7,7,6,13,7,4,3,9,9,1472,7,4,5,7,8,43,7,6,17,9,9,1216,7,4,6, -7,6,1,7,5,8,9,6,192,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7,7,8,29,7,4,3,7,5,11,7,4,5, -7,6,12,7,5,9,9,6,1664,7,4,6,7,8,33,9,5,128,7,8,49,7,6,14,7,8,61,7,4,4,7,4,2,7,4,7, -7,8,47,7,4,3,7,8,59,7,4,5,7,8,41,7,6,16,9,9,960,7,4,6,7,8,31,7,5,8,7,8,57,9,5,64, -7,5,10,7,4,4,7,4,2,7,4,7,7,7,22,7,4,3,7,5,11,7,4,5,7,7,26,7,5,9,9,9,704,7,4,6, -7,8,37,9,5,128,7,7,25,7,6,15,9,8,320,7,4,4,7,4,2,7,4,7,7,6,13,7,4,3,7,7,18,7,4,5, -7,7,21,7,6,17,9,7,256,7,4,6,7,6,1,7,5,8,9,6,192,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7, -11,12,2176,7,4,3,7,5,11,7,4,5,7,6,12,7,5,9,9,6,1664,7,4,6,7,7,20,9,5,128,7,7,24,7,6,14, -7,7,28,7,4,4,7,4,2,7,4,7,7,7,23,7,4,3,7,7,27,7,4,5,7,8,40,7,6,16,9,9,832,7,4,6, -7,7,19,7,5,8,7,8,56,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7,7,8,46,7,4,3,7,5,11,7,4,5, -7,8,54,7,5,9,9,8,512,7,4,6,7,8,36,9,5,128,7,8,52,7,6,15,7,8,0,7,4,4,7,4,2,7,4,7, -7,6,13,7,4,3,9,9,1600,7,4,5,7,8,44,7,6,17,9,9,1344,7,4,6,7,6,1,7,5,8,9,6,192,9,5,64, -7,5,10,7,4,4,7,4,2,7,4,7,7,8,30,7,4,3,7,5,11,7,4,5,7,6,12,7,5,9,9,6,1664,7,4,6, -7,8,34,9,5,128,7,8,50,7,6,14,7,8,62,7,4,4,7,4,2,7,4,7,7,8,48,7,4,3,7,8,60,7,4,5, -7,8,42,7,6,16,9,9,1088,7,4,6,7,8,32,7,5,8,7,8,58,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7, -7,7,22,7,4,3,7,5,11,7,4,5,7,7,26,7,5,9,9,8,640,7,4,6,7,8,38,9,5,128,7,7,25,7,6,15, -9,8,384,7,4,4,7,4,2,7,4,7,7,6,13,7,4,3,7,7,18,7,4,5,7,7,21,7,6,17,9,7,256,7,4,6, -7,6,1,7,5,8,9,6,192,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7,0,0,0,7,4,3,7,5,11,7,4,5, -7,6,12,7,5,9,9,6,1664,7,4,6,7,7,20,9,5,128,7,7,24,7,6,14,7,7,28,7,4,4,7,4,2,7,4,7, -7,7,23,7,4,3,7,7,27,7,4,5,7,8,39,7,6,16,9,8,576,7,4,6,7,7,19,7,5,8,7,8,55,9,5,64, -7,5,10,7,4,4,7,4,2,7,4,7,7,8,45,7,4,3,7,5,11,7,4,5,7,8,53,7,5,9,9,8,448,7,4,6, -7,8,35,9,5,128,7,8,51,7,6,15,7,8,63,7,4,4,7,4,2,7,4,7,7,6,13,7,4,3,9,9,1536,7,4,5, -7,8,43,7,6,17,9,9,1280,7,4,6,7,6,1,7,5,8,9,6,192,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7, -7,8,29,7,4,3,7,5,11,7,4,5,7,6,12,7,5,9,9,6,1664,7,4,6,7,8,33,9,5,128,7,8,49,7,6,14, -7,8,61,7,4,4,7,4,2,7,4,7,7,8,47,7,4,3,7,8,59,7,4,5,7,8,41,7,6,16,9,9,1024,7,4,6, -7,8,31,7,5,8,7,8,57,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7,7,7,22,7,4,3,7,5,11,7,4,5, -7,7,26,7,5,9,9,9,768,7,4,6,7,8,37,9,5,128,7,7,25,7,6,15,9,8,320,7,4,4,7,4,2,7,4,7, -7,6,13,7,4,3,7,7,18,7,4,5,7,7,21,7,6,17,9,7,256,7,4,6,7,6,1,7,5,8,9,6,192,9,5,64, -7,5,10,7,4,4,7,4,2,7,4,7,11,12,2432,7,4,3,7,5,11,7,4,5,7,6,12,7,5,9,9,6,1664,7,4,6, -7,7,20,9,5,128,7,7,24,7,6,14,7,7,28,7,4,4,7,4,2,7,4,7,7,7,23,7,4,3,7,7,27,7,4,5, -7,8,40,7,6,16,9,9,896,7,4,6,7,7,19,7,5,8,7,8,56,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7, -7,8,46,7,4,3,7,5,11,7,4,5,7,8,54,7,5,9,9,8,512,7,4,6,7,8,36,9,5,128,7,8,52,7,6,15, -7,8,0,7,4,4,7,4,2,7,4,7,7,6,13,7,4,3,9,9,1728,7,4,5,7,8,44,7,6,17,9,9,1408,7,4,6, -7,6,1,7,5,8,9,6,192,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7,7,8,30,7,4,3,7,5,11,7,4,5, -7,6,12,7,5,9,9,6,1664,7,4,6,7,8,34,9,5,128,7,8,50,7,6,14,7,8,62,7,4,4,7,4,2,7,4,7, -7,8,48,7,4,3,7,8,60,7,4,5,7,8,42,7,6,16,9,9,1152,7,4,6,7,8,32,7,5,8,7,8,58,9,5,64, -7,5,10,7,4,4,7,4,2,7,4,7,7,7,22,7,4,3,7,5,11,7,4,5,7,7,26,7,5,9,9,8,640,7,4,6, -7,8,38,9,5,128,7,7,25,7,6,15,9,8,384,7,4,4,7,4,2,7,4,7,7,6,13,7,4,3,7,7,18,7,4,5, -7,7,21,7,6,17,9,7,256,7,4,6,7,6,1,7,5,8,9,6,192,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7, -0,0,0,7,4,3,7,5,11,7,4,5,7,6,12,7,5,9,9,6,1664,7,4,6,7,7,20,9,5,128,7,7,24,7,6,14, -7,7,28,7,4,4,7,4,2,7,4,7,7,7,23,7,4,3,7,7,27,7,4,5,7,8,39,7,6,16,9,8,576,7,4,6, -7,7,19,7,5,8,7,8,55,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7,7,8,45,7,4,3,7,5,11,7,4,5, -7,8,53,7,5,9,9,8,448,7,4,6,7,8,35,9,5,128,7,8,51,7,6,15,7,8,63,7,4,4,7,4,2,7,4,7, -7,6,13,7,4,3,9,9,1472,7,4,5,7,8,43,7,6,17,9,9,1216,7,4,6,7,6,1,7,5,8,9,6,192,9,5,64, -7,5,10,7,4,4,7,4,2,7,4,7,7,8,29,7,4,3,7,5,11,7,4,5,7,6,12,7,5,9,9,6,1664,7,4,6, -7,8,33,9,5,128,7,8,49,7,6,14,7,8,61,7,4,4,7,4,2,7,4,7,7,8,47,7,4,3,7,8,59,7,4,5, -7,8,41,7,6,16,9,9,960,7,4,6,7,8,31,7,5,8,7,8,57,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7, -7,7,22,7,4,3,7,5,11,7,4,5,7,7,26,7,5,9,9,9,704,7,4,6,7,8,37,9,5,128,7,7,25,7,6,15, -9,8,320,7,4,4,7,4,2,7,4,7,7,6,13,7,4,3,7,7,18,7,4,5,7,7,21,7,6,17,9,7,256,7,4,6, -7,6,1,7,5,8,9,6,192,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7,11,12,2048,7,4,3,7,5,11,7,4,5, -7,6,12,7,5,9,9,6,1664,7,4,6,7,7,20,9,5,128,7,7,24,7,6,14,7,7,28,7,4,4,7,4,2,7,4,7, -7,7,23,7,4,3,7,7,27,7,4,5,7,8,40,7,6,16,9,9,832,7,4,6,7,7,19,7,5,8,7,8,56,9,5,64, -7,5,10,7,4,4,7,4,2,7,4,7,7,8,46,7,4,3,7,5,11,7,4,5,7,8,54,7,5,9,9,8,512,7,4,6, -7,8,36,9,5,128,7,8,52,7,6,15,7,8,0,7,4,4,7,4,2,7,4,7,7,6,13,7,4,3,9,9,1600,7,4,5, -7,8,44,7,6,17,9,9,1344,7,4,6,7,6,1,7,5,8,9,6,192,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7, -7,8,30,7,4,3,7,5,11,7,4,5,7,6,12,7,5,9,9,6,1664,7,4,6,7,8,34,9,5,128,7,8,50,7,6,14, -7,8,62,7,4,4,7,4,2,7,4,7,7,8,48,7,4,3,7,8,60,7,4,5,7,8,42,7,6,16,9,9,1088,7,4,6, -7,8,32,7,5,8,7,8,58,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7,7,7,22,7,4,3,7,5,11,7,4,5, -7,7,26,7,5,9,9,8,640,7,4,6,7,8,38,9,5,128,7,7,25,7,6,15,9,8,384,7,4,4,7,4,2,7,4,7, -7,6,13,7,4,3,7,7,18,7,4,5,7,7,21,7,6,17,9,7,256,7,4,6,7,6,1,7,5,8,9,6,192,9,5,64, -7,5,10,7,4,4,7,4,2,7,4,7,0,0,0,7,4,3,7,5,11,7,4,5,7,6,12,7,5,9,9,6,1664,7,4,6, -7,7,20,9,5,128,7,7,24,7,6,14,7,7,28,7,4,4,7,4,2,7,4,7,7,7,23,7,4,3,7,7,27,7,4,5, -7,8,39,7,6,16,9,8,576,7,4,6,7,7,19,7,5,8,7,8,55,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7, -7,8,45,7,4,3,7,5,11,7,4,5,7,8,53,7,5,9,9,8,448,7,4,6,7,8,35,9,5,128,7,8,51,7,6,15, -7,8,63,7,4,4,7,4,2,7,4,7,7,6,13,7,4,3,9,9,1536,7,4,5,7,8,43,7,6,17,9,9,1280,7,4,6, -7,6,1,7,5,8,9,6,192,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7,7,8,29,7,4,3,7,5,11,7,4,5, -7,6,12,7,5,9,9,6,1664,7,4,6,7,8,33,9,5,128,7,8,49,7,6,14,7,8,61,7,4,4,7,4,2,7,4,7, -7,8,47,7,4,3,7,8,59,7,4,5,7,8,41,7,6,16,9,9,1024,7,4,6,7,8,31,7,5,8,7,8,57,9,5,64, -7,5,10,7,4,4,7,4,2,7,4,7,7,7,22,7,4,3,7,5,11,7,4,5,7,7,26,7,5,9,9,9,768,7,4,6, -7,8,37,9,5,128,7,7,25,7,6,15,9,8,320,7,4,4,7,4,2,7,4,7,7,6,13,7,4,3,7,7,18,7,4,5, -7,7,21,7,6,17,9,7,256,7,4,6,7,6,1,7,5,8,9,6,192,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7, -11,11,1920,7,4,3,7,5,11,7,4,5,7,6,12,7,5,9,9,6,1664,7,4,6,7,7,20,9,5,128,7,7,24,7,6,14, -7,7,28,7,4,4,7,4,2,7,4,7,7,7,23,7,4,3,7,7,27,7,4,5,7,8,40,7,6,16,9,9,896,7,4,6, -7,7,19,7,5,8,7,8,56,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7,7,8,46,7,4,3,7,5,11,7,4,5, -7,8,54,7,5,9,9,8,512,7,4,6,7,8,36,9,5,128,7,8,52,7,6,15,7,8,0,7,4,4,7,4,2,7,4,7, -7,6,13,7,4,3,9,9,1728,7,4,5,7,8,44,7,6,17,9,9,1408,7,4,6,7,6,1,7,5,8,9,6,192,9,5,64, -7,5,10,7,4,4,7,4,2,7,4,7,7,8,30,7,4,3,7,5,11,7,4,5,7,6,12,7,5,9,9,6,1664,7,4,6, -7,8,34,9,5,128,7,8,50,7,6,14,7,8,62,7,4,4,7,4,2,7,4,7,7,8,48,7,4,3,7,8,60,7,4,5, -7,8,42,7,6,16,9,9,1152,7,4,6,7,8,32,7,5,8,7,8,58,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7, -7,7,22,7,4,3,7,5,11,7,4,5,7,7,26,7,5,9,9,8,640,7,4,6,7,8,38,9,5,128,7,7,25,7,6,15, -9,8,384,7,4,4,7,4,2,7,4,7,7,6,13,7,4,3,7,7,18,7,4,5,7,7,21,7,6,17,9,7,256,7,4,6, -7,6,1,7,5,8,9,6,192,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7,0,0,0,7,4,3,7,5,11,7,4,5, -7,6,12,7,5,9,9,6,1664,7,4,6,7,7,20,9,5,128,7,7,24,7,6,14,7,7,28,7,4,4,7,4,2,7,4,7, -7,7,23,7,4,3,7,7,27,7,4,5,7,8,39,7,6,16,9,8,576,7,4,6,7,7,19,7,5,8,7,8,55,9,5,64, -7,5,10,7,4,4,7,4,2,7,4,7,7,8,45,7,4,3,7,5,11,7,4,5,7,8,53,7,5,9,9,8,448,7,4,6, -7,8,35,9,5,128,7,8,51,7,6,15,7,8,63,7,4,4,7,4,2,7,4,7,7,6,13,7,4,3,9,9,1472,7,4,5, -7,8,43,7,6,17,9,9,1216,7,4,6,7,6,1,7,5,8,9,6,192,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7, -7,8,29,7,4,3,7,5,11,7,4,5,7,6,12,7,5,9,9,6,1664,7,4,6,7,8,33,9,5,128,7,8,49,7,6,14, -7,8,61,7,4,4,7,4,2,7,4,7,7,8,47,7,4,3,7,8,59,7,4,5,7,8,41,7,6,16,9,9,960,7,4,6, -7,8,31,7,5,8,7,8,57,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7,7,7,22,7,4,3,7,5,11,7,4,5, -7,7,26,7,5,9,9,9,704,7,4,6,7,8,37,9,5,128,7,7,25,7,6,15,9,8,320,7,4,4,7,4,2,7,4,7, -7,6,13,7,4,3,7,7,18,7,4,5,7,7,21,7,6,17,9,7,256,7,4,6,7,6,1,7,5,8,9,6,192,9,5,64, -7,5,10,7,4,4,7,4,2,7,4,7,11,12,2304,7,4,3,7,5,11,7,4,5,7,6,12,7,5,9,9,6,1664,7,4,6, -7,7,20,9,5,128,7,7,24,7,6,14,7,7,28,7,4,4,7,4,2,7,4,7,7,7,23,7,4,3,7,7,27,7,4,5, -7,8,40,7,6,16,9,9,832,7,4,6,7,7,19,7,5,8,7,8,56,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7, -7,8,46,7,4,3,7,5,11,7,4,5,7,8,54,7,5,9,9,8,512,7,4,6,7,8,36,9,5,128,7,8,52,7,6,15, -7,8,0,7,4,4,7,4,2,7,4,7,7,6,13,7,4,3,9,9,1600,7,4,5,7,8,44,7,6,17,9,9,1344,7,4,6, -7,6,1,7,5,8,9,6,192,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7,7,8,30,7,4,3,7,5,11,7,4,5, -7,6,12,7,5,9,9,6,1664,7,4,6,7,8,34,9,5,128,7,8,50,7,6,14,7,8,62,7,4,4,7,4,2,7,4,7, -7,8,48,7,4,3,7,8,60,7,4,5,7,8,42,7,6,16,9,9,1088,7,4,6,7,8,32,7,5,8,7,8,58,9,5,64, -7,5,10,7,4,4,7,4,2,7,4,7,7,7,22,7,4,3,7,5,11,7,4,5,7,7,26,7,5,9,9,8,640,7,4,6, -7,8,38,9,5,128,7,7,25,7,6,15,9,8,384,7,4,4,7,4,2,7,4,7,7,6,13,7,4,3,7,7,18,7,4,5, -7,7,21,7,6,17,9,7,256,7,4,6,7,6,1,7,5,8,9,6,192,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7, -0,0,0,7,4,3,7,5,11,7,4,5,7,6,12,7,5,9,9,6,1664,7,4,6,7,7,20,9,5,128,7,7,24,7,6,14, -7,7,28,7,4,4,7,4,2,7,4,7,7,7,23,7,4,3,7,7,27,7,4,5,7,8,39,7,6,16,9,8,576,7,4,6, -7,7,19,7,5,8,7,8,55,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7,7,8,45,7,4,3,7,5,11,7,4,5, -7,8,53,7,5,9,9,8,448,7,4,6,7,8,35,9,5,128,7,8,51,7,6,15,7,8,63,7,4,4,7,4,2,7,4,7, -7,6,13,7,4,3,9,9,1536,7,4,5,7,8,43,7,6,17,9,9,1280,7,4,6,7,6,1,7,5,8,9,6,192,9,5,64, -7,5,10,7,4,4,7,4,2,7,4,7,7,8,29,7,4,3,7,5,11,7,4,5,7,6,12,7,5,9,9,6,1664,7,4,6, -7,8,33,9,5,128,7,8,49,7,6,14,7,8,61,7,4,4,7,4,2,7,4,7,7,8,47,7,4,3,7,8,59,7,4,5, -7,8,41,7,6,16,9,9,1024,7,4,6,7,8,31,7,5,8,7,8,57,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7, -7,7,22,7,4,3,7,5,11,7,4,5,7,7,26,7,5,9,9,9,768,7,4,6,7,8,37,9,5,128,7,7,25,7,6,15, -9,8,320,7,4,4,7,4,2,7,4,7,7,6,13,7,4,3,7,7,18,7,4,5,7,7,21,7,6,17,9,7,256,7,4,6, -7,6,1,7,5,8,9,6,192,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7,11,12,2560,7,4,3,7,5,11,7,4,5, -7,6,12,7,5,9,9,6,1664,7,4,6,7,7,20,9,5,128,7,7,24,7,6,14,7,7,28,7,4,4,7,4,2,7,4,7, -7,7,23,7,4,3,7,7,27,7,4,5,7,8,40,7,6,16,9,9,896,7,4,6,7,7,19,7,5,8,7,8,56,9,5,64, -7,5,10,7,4,4,7,4,2,7,4,7,7,8,46,7,4,3,7,5,11,7,4,5,7,8,54,7,5,9,9,8,512,7,4,6, -7,8,36,9,5,128,7,8,52,7,6,15,7,8,0,7,4,4,7,4,2,7,4,7,7,6,13,7,4,3,9,9,1728,7,4,5, -7,8,44,7,6,17,9,9,1408,7,4,6,7,6,1,7,5,8,9,6,192,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7, -7,8,30,7,4,3,7,5,11,7,4,5,7,6,12,7,5,9,9,6,1664,7,4,6,7,8,34,9,5,128,7,8,50,7,6,14, -7,8,62,7,4,4,7,4,2,7,4,7,7,8,48,7,4,3,7,8,60,7,4,5,7,8,42,7,6,16,9,9,1152,7,4,6, -7,8,32,7,5,8,7,8,58,9,5,64,7,5,10,7,4,4,7,4,2,7,4,7,7,7,22,7,4,3,7,5,11,7,4,5, -7,7,26,7,5,9,9,8,640,7,4,6,7,8,38,9,5,128,7,7,25,7,6,15,9,8,384,7,4,4,7,4,2,7,4,7, -7,6,13,7,4,3,7,7,18,7,4,5,7,7,21,7,6,17,9,7,256,7,4,6,7,6,1,7,5,8,9,6,192,9,5,64, -7,5,10,7,4,4,7,4,2,7,4,7 -}; - const TIFFFaxTabEnt TIFFFaxBlackTable[8192] = { -12,11,0,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,7,10,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,8,13,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,9,15,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,10,18,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,11,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,10,17,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,7,12,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,11,11,1792,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,7,10,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,11,23,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,11,20,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,11,25,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,7,11,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,8,14,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,7,12,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,0,0,0,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,10,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,8,13,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,10,12,128,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,12,56,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,7,11,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,12,30,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,12,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -11,11,1856,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,7,10,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,12,57,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,11,21,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,12,54,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,11,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,8,14,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,7,12,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,0,0,0,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,7,10,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,8,13,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,9,15,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,12,52,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,7,11,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,12,48,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,7,12,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,11,12,2112,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,10,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,12,44,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,12,36,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,10,12,384,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,7,11,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,8,14,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,12,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -0,0,0,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,7,10,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,8,13,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,12,28,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,12,60,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,11,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,12,40,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,7,12,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,11,12,2368,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,7,10,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,10,16,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,10,0,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -10,10,64,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,7,11,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,8,14,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,7,12,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,0,0,0,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,10,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,8,13,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,9,15,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,10,18,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,7,11,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,10,17,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,12,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -11,12,1984,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,7,10,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,12,50,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,12,34,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,10,13,1664,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,11,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,8,14,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,7,12,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,0,0,0,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,7,10,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,8,13,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,12,26,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -10,13,1408,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,7,11,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,12,32,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,7,12,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,11,11,1920,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,10,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,12,61,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,12,42,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,10,13,1024,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,7,11,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,8,14,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,12,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -0,0,0,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,7,10,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,8,13,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,9,15,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,10,13,768,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,11,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,12,62,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,7,12,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,11,12,2240,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,7,10,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,12,46,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,12,38,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -10,13,512,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,7,11,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,8,14,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,7,12,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,0,0,0,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,10,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,8,13,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,11,19,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,11,24,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,7,11,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,11,22,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,12,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -11,12,2496,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,7,10,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,10,16,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,10,0,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,10,10,64,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,11,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,8,14,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,7,12,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,12,11,0,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,7,10,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,8,13,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,9,15,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,10,18,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,7,11,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,10,17,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,7,12,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,11,11,1792,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,10,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,11,23,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,11,20,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,11,25,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,7,11,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,8,14,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,12,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -0,0,0,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,7,10,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,8,13,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -10,12,192,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,10,13,1280,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,11,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,12,31,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,7,12,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,11,11,1856,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,7,10,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,12,58,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,11,21,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -10,13,896,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,7,11,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,8,14,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,7,12,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,0,0,0,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,10,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,8,13,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,9,15,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,10,13,640,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,7,11,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,12,49,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,12,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -11,12,2176,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,7,10,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,12,45,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,12,37,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,10,12,448,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,11,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,8,14,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,7,12,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,0,0,0,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,7,10,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,8,13,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,12,29,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -10,13,1536,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,7,11,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,12,41,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,7,12,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,11,12,2432,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,10,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,10,16,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,10,0,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,10,10,64,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,7,11,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,8,14,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,12,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -0,0,0,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,7,10,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,8,13,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,9,15,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,10,18,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,11,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,10,17,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,7,12,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,11,12,2048,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,7,10,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,12,51,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,12,35,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -10,12,320,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,7,11,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,8,14,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,7,12,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,0,0,0,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,10,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,8,13,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,12,27,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,12,59,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,7,11,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,12,33,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,12,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -11,11,1920,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,7,10,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,10,12,256,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,12,43,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,10,13,1152,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,11,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,8,14,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,7,12,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,0,0,0,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,7,10,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,8,13,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,9,15,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,12,55,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,7,11,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,12,63,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,7,12,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,11,12,2304,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,10,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,12,47,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,12,39,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,12,53,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,7,11,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,8,14,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,12,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -0,0,0,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,7,10,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,8,13,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,11,19,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,11,24,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,11,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,11,22,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,7,12,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,11,12,2560,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,7,10,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,10,16,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,10,0,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -10,10,64,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,7,11,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,8,14,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,7,12,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,12,11,0,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,10,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,8,13,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,9,15,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,10,18,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,7,11,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,10,17,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,12,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -11,11,1792,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,7,10,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,11,23,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,11,20,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,11,25,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,11,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,8,14,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,7,12,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,0,0,0,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,7,10,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,8,13,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,10,12,128,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,12,56,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,7,11,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,12,30,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,7,12,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,11,11,1856,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,10,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,12,57,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,11,21,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,12,54,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,7,11,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,8,14,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,12,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -0,0,0,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,7,10,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,8,13,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,9,15,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,12,52,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,11,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,12,48,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,7,12,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,11,12,2112,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,7,10,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,12,44,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,12,36,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -10,12,384,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,7,11,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,8,14,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,7,12,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,0,0,0,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,10,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,8,13,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,12,28,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,12,60,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,7,11,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,12,40,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,12,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -11,12,2368,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,7,10,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,10,16,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,10,0,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,10,10,64,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,11,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,8,14,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,7,12,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,0,0,0,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,7,10,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,8,13,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,9,15,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,10,18,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,7,11,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,10,17,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,7,12,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,11,12,1984,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,10,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,12,50,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,12,34,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,10,13,1728,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,7,11,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,8,14,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,12,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -0,0,0,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,7,10,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,8,13,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,12,26,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,10,13,1472,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,11,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,12,32,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,7,12,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,11,11,1920,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,7,10,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,12,61,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,12,42,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -10,13,1088,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,7,11,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,8,14,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,7,12,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,0,0,0,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,10,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,8,13,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,9,15,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,10,13,832,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,7,11,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,12,62,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,12,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -11,12,2240,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,7,10,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,12,46,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,12,38,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,10,13,576,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,11,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,8,14,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,7,12,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,0,0,0,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,7,10,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,8,13,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,11,19,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,11,24,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,7,11,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,11,22,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,7,12,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,11,12,2496,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,10,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,10,16,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,10,0,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,10,10,64,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,7,11,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,8,14,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,12,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -12,11,0,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,7,10,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,8,13,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,9,15,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,10,18,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,11,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,10,17,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,7,12,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,11,11,1792,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,7,10,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,11,23,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,11,20,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,11,25,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,7,11,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,8,14,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,7,12,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,0,0,0,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,10,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,8,13,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,10,12,192,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,10,13,1344,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,7,11,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,12,31,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,12,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -11,11,1856,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,7,10,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,12,58,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,11,21,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,10,13,960,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,11,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,8,14,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,7,12,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,0,0,0,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,7,10,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,8,13,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,9,15,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -10,13,704,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,7,11,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,12,49,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,7,12,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,11,12,2176,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,10,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,12,45,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,12,37,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,10,12,448,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,7,11,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,8,14,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,12,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -0,0,0,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,7,10,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,8,13,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,12,29,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,10,13,1600,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,11,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,12,41,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,7,12,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,11,12,2432,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,7,10,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,10,16,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,10,0,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -10,10,64,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,7,11,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,8,14,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,7,12,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,0,0,0,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,10,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,8,13,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,9,15,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,10,18,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,7,11,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,10,17,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,12,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -11,12,2048,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,7,10,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,12,51,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,12,35,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,10,12,320,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,11,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,8,14,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,7,12,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,0,0,0,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,7,10,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,8,13,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,12,27,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,12,59,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,7,11,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,12,33,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,7,12,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,11,11,1920,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,10,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -10,12,256,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,12,43,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,10,13,1216,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,7,11,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,8,14,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,12,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -0,0,0,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,7,10,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,8,13,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,9,15,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,12,55,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,11,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,12,63,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,7,12,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,11,12,2304,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,7,10,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,12,47,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,12,39,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,12,53,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,7,11,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,8,14,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,7,12,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,0,0,0,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,10,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,8,13,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,11,19,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,11,24,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,7,11,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,11,22,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,12,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -11,12,2560,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,9,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,7,10,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,10,16,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,10,0,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,10,10,64,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,6,9,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2,8,7,11,8,2,3,8,3,1,8,2,2, -8,4,6,8,2,3,8,3,4,8,2,2,8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2, -8,8,14,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2,8,6,8,8,2,3,8,3,1,8,2,2, -8,4,5,8,2,3,8,3,4,8,2,2,8,7,12,8,2,3,8,3,1,8,2,2,8,4,6,8,2,3,8,3,4,8,2,2, -8,5,7,8,2,3,8,3,1,8,2,2,8,4,5,8,2,3,8,3,4,8,2,2 -}; diff --git a/wxWidgets/src/tiff/tif_flush.c b/wxWidgets/src/tiff/tif_flush.c deleted file mode 100644 index 6746e1e2e2..0000000000 --- a/wxWidgets/src/tiff/tif_flush.c +++ /dev/null @@ -1,67 +0,0 @@ -/* $Header$ */ - -/* - * Copyright (c) 1988-1997 Sam Leffler - * Copyright (c) 1991-1997 Silicon Graphics, Inc. - * - * Permission to use, copy, modify, distribute, and sell this software and - * its documentation for any purpose is hereby granted without fee, provided - * that (i) the above copyright notices and this permission notice appear in - * all copies of the software and related documentation, and (ii) the names of - * Sam Leffler and Silicon Graphics may not be used in any advertising or - * publicity relating to the software without the specific, prior written - * permission of Sam Leffler and Silicon Graphics. - * - * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, - * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * - * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR - * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, - * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF - * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE - * OF THIS SOFTWARE. - */ - -/* - * TIFF Library. - */ -#include "tiffiop.h" - -int -TIFFFlush(TIFF* tif) -{ - - if (tif->tif_mode != O_RDONLY) { - if (!TIFFFlushData(tif)) - return (0); - if ((tif->tif_flags & TIFF_DIRTYDIRECT) && - !TIFFWriteDirectory(tif)) - return (0); - } - return (1); -} - -/* - * Flush buffered data to the file. - * - * Frank Warmerdam'2000: I modified this to return 1 if TIFF_BEENWRITING - * is not set, so that TIFFFlush() will proceed to write out the directory. - * The documentation says returning 1 is an error indicator, but not having - * been writing isn't exactly a an error. Hopefully this doesn't cause - * problems for other people. - */ -int -TIFFFlushData(TIFF* tif) -{ - if ((tif->tif_flags & TIFF_BEENWRITING) == 0) - return (0); - if (tif->tif_flags & TIFF_POSTENCODE) { - tif->tif_flags &= ~TIFF_POSTENCODE; - if (!(*tif->tif_postencode)(tif)) - return (0); - } - return (TIFFFlushData1(tif)); -} - diff --git a/wxWidgets/src/tiff/tif_getimage.c b/wxWidgets/src/tiff/tif_getimage.c deleted file mode 100644 index f69fbc17aa..0000000000 --- a/wxWidgets/src/tiff/tif_getimage.c +++ /dev/null @@ -1,2585 +0,0 @@ -/* $Header$ */ - -/* - * Copyright (c) 1991-1997 Sam Leffler - * Copyright (c) 1991-1997 Silicon Graphics, Inc. - * - * Permission to use, copy, modify, distribute, and sell this software and - * its documentation for any purpose is hereby granted without fee, provided - * that (i) the above copyright notices and this permission notice appear in - * all copies of the software and related documentation, and (ii) the names of - * Sam Leffler and Silicon Graphics may not be used in any advertising or - * publicity relating to the software without the specific, prior written - * permission of Sam Leffler and Silicon Graphics. - * - * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, - * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * - * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR - * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, - * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF - * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE - * OF THIS SOFTWARE. - */ - -/* - * TIFF Library - * - * Read and return a packed RGBA image. - */ -#include "tiffiop.h" -#include -#include - -static int gtTileContig(TIFFRGBAImage*, uint32*, uint32, uint32); -static int gtTileSeparate(TIFFRGBAImage*, uint32*, uint32, uint32); -static int gtStripContig(TIFFRGBAImage*, uint32*, uint32, uint32); -static int gtStripSeparate(TIFFRGBAImage*, uint32*, uint32, uint32); -static int pickTileContigCase(TIFFRGBAImage*); -static int pickTileSeparateCase(TIFFRGBAImage*); - -static const char photoTag[] = "PhotometricInterpretation"; - -/* - * Helper constants used in Orientation tag handling - */ -#define FLIP_VERTICALLY 0x01 -#define FLIP_HORIZONTALLY 0x02 - -/* - * Color conversion constants. We will define display types here. - */ - -TIFFDisplay display_sRGB = { - { /* XYZ -> luminance matrix */ - { 3.2410F, -1.5374F, -0.4986F }, - { -0.9692F, 1.8760F, 0.0416F }, - { 0.0556F, -0.2040F, 1.0570F } - }, - 100.0F, 100.0F, 100.0F, /* Light o/p for reference white */ - 255, 255, 255, /* Pixel values for ref. white */ - 1.0F, 1.0F, 1.0F, /* Residual light o/p for black pixel */ - 2.4F, 2.4F, 2.4F, /* Gamma values for the three guns */ -}; - -/* - * Check the image to see if TIFFReadRGBAImage can deal with it. - * 1/0 is returned according to whether or not the image can - * be handled. If 0 is returned, emsg contains the reason - * why it is being rejected. - */ -int -TIFFRGBAImageOK(TIFF* tif, char emsg[1024]) -{ - TIFFDirectory* td = &tif->tif_dir; - uint16 photometric; - int colorchannels; - - if (!tif->tif_decodestatus) { - sprintf(emsg, "Sorry, requested compression method is not configured"); - return (0); - } - switch (td->td_bitspersample) { - case 1: case 2: case 4: - case 8: case 16: - break; - default: - sprintf(emsg, "Sorry, can not handle images with %d-bit samples", - td->td_bitspersample); - return (0); - } - colorchannels = td->td_samplesperpixel - td->td_extrasamples; - if (!TIFFGetField(tif, TIFFTAG_PHOTOMETRIC, &photometric)) { - switch (colorchannels) { - case 1: - photometric = PHOTOMETRIC_MINISBLACK; - break; - case 3: - photometric = PHOTOMETRIC_RGB; - break; - default: - sprintf(emsg, "Missing needed %s tag", photoTag); - return (0); - } - } - switch (photometric) { - case PHOTOMETRIC_MINISWHITE: - case PHOTOMETRIC_MINISBLACK: - case PHOTOMETRIC_PALETTE: - if (td->td_planarconfig == PLANARCONFIG_CONTIG - && td->td_samplesperpixel != 1 - && td->td_bitspersample < 8 ) { - sprintf(emsg, - "Sorry, can not handle contiguous data with %s=%d, " - "and %s=%d and Bits/Sample=%d", - photoTag, photometric, - "Samples/pixel", td->td_samplesperpixel, - td->td_bitspersample); - return (0); - } - /* - ** We should likely validate that any extra samples are either - ** to be ignored, or are alpha, and if alpha we should try to use - ** them. But for now we won't bother with this. - */ - break; - case PHOTOMETRIC_YCBCR: - if (td->td_planarconfig != PLANARCONFIG_CONTIG) { - sprintf(emsg, "Sorry, can not handle YCbCr images with %s=%d", - "Planarconfiguration", td->td_planarconfig); - return (0); - } - break; - case PHOTOMETRIC_RGB: - if (colorchannels < 3) { - sprintf(emsg, "Sorry, can not handle RGB image with %s=%d", - "Color channels", colorchannels); - return (0); - } - break; - case PHOTOMETRIC_SEPARATED: - if (td->td_inkset != INKSET_CMYK) { - sprintf(emsg, "Sorry, can not handle separated image with %s=%d", - "InkSet", td->td_inkset); - return (0); - } - if (td->td_samplesperpixel < 4) { - sprintf(emsg, "Sorry, can not handle separated image with %s=%d", - "Samples/pixel", td->td_samplesperpixel); - return (0); - } - break; - case PHOTOMETRIC_LOGL: - if (td->td_compression != COMPRESSION_SGILOG) { - sprintf(emsg, "Sorry, LogL data must have %s=%d", - "Compression", COMPRESSION_SGILOG); - return (0); - } - break; - case PHOTOMETRIC_LOGLUV: - if (td->td_compression != COMPRESSION_SGILOG && - td->td_compression != COMPRESSION_SGILOG24) { - sprintf(emsg, "Sorry, LogLuv data must have %s=%d or %d", - "Compression", COMPRESSION_SGILOG, COMPRESSION_SGILOG24); - return (0); - } - if (td->td_planarconfig != PLANARCONFIG_CONTIG) { - sprintf(emsg, "Sorry, can not handle LogLuv images with %s=%d", - "Planarconfiguration", td->td_planarconfig); - return (0); - } - break; - case PHOTOMETRIC_CIELAB: - break; - default: - sprintf(emsg, "Sorry, can not handle image with %s=%d", - photoTag, photometric); - return (0); - } - return (1); -} - -void -TIFFRGBAImageEnd(TIFFRGBAImage* img) -{ - if (img->Map) - _TIFFfree(img->Map), img->Map = NULL; - if (img->BWmap) - _TIFFfree(img->BWmap), img->BWmap = NULL; - if (img->PALmap) - _TIFFfree(img->PALmap), img->PALmap = NULL; - if (img->ycbcr) - _TIFFfree(img->ycbcr), img->ycbcr = NULL; - if (img->cielab) - _TIFFfree(img->cielab), img->cielab = NULL; - - if( img->redcmap ) { - _TIFFfree( img->redcmap ); - _TIFFfree( img->greencmap ); - _TIFFfree( img->bluecmap ); - } -} - -static int -isCCITTCompression(TIFF* tif) -{ - uint16 compress; - TIFFGetField(tif, TIFFTAG_COMPRESSION, &compress); - return (compress == COMPRESSION_CCITTFAX3 || - compress == COMPRESSION_CCITTFAX4 || - compress == COMPRESSION_CCITTRLE || - compress == COMPRESSION_CCITTRLEW); -} - -int -TIFFRGBAImageBegin(TIFFRGBAImage* img, TIFF* tif, int stop, char emsg[1024]) -{ - uint16* sampleinfo; - uint16 extrasamples; - uint16 planarconfig; - uint16 compress; - int colorchannels; - uint16 *red_orig, *green_orig, *blue_orig; - int n_color; - - /* Initialize to normal values */ - img->row_offset = 0; - img->col_offset = 0; - img->redcmap = NULL; - img->greencmap = NULL; - img->bluecmap = NULL; - img->req_orientation = ORIENTATION_BOTLEFT; /* It is the default */ - - img->tif = tif; - img->stoponerr = stop; - TIFFGetFieldDefaulted(tif, TIFFTAG_BITSPERSAMPLE, &img->bitspersample); - switch (img->bitspersample) { - case 1: case 2: case 4: - case 8: case 16: - break; - default: - sprintf(emsg, "Sorry, can not handle images with %d-bit samples", - img->bitspersample); - return (0); - } - img->alpha = 0; - TIFFGetFieldDefaulted(tif, TIFFTAG_SAMPLESPERPIXEL, &img->samplesperpixel); - TIFFGetFieldDefaulted(tif, TIFFTAG_EXTRASAMPLES, - &extrasamples, &sampleinfo); - if (extrasamples == 1) - { - switch (sampleinfo[0]) { - case EXTRASAMPLE_UNSPECIFIED: /* Workaround for some images without */ - if (img->samplesperpixel == 4) /* correct info about alpha channel */ - img->alpha = EXTRASAMPLE_ASSOCALPHA; - break; - case EXTRASAMPLE_ASSOCALPHA: /* data is pre-multiplied */ - case EXTRASAMPLE_UNASSALPHA: /* data is not pre-multiplied */ - img->alpha = sampleinfo[0]; - break; - } - } - -#if DEFAULT_EXTRASAMPLE_AS_ALPHA == 1 - if( !TIFFGetField(tif, TIFFTAG_PHOTOMETRIC, &img->photometric)) - img->photometric = PHOTOMETRIC_MINISWHITE; - - if( extrasamples == 0 - && img->samplesperpixel == 4 - && img->photometric == PHOTOMETRIC_RGB ) - { - img->alpha = EXTRASAMPLE_ASSOCALPHA; - extrasamples = 1; - } -#endif - - colorchannels = img->samplesperpixel - extrasamples; - TIFFGetFieldDefaulted(tif, TIFFTAG_COMPRESSION, &compress); - TIFFGetFieldDefaulted(tif, TIFFTAG_PLANARCONFIG, &planarconfig); - if (!TIFFGetField(tif, TIFFTAG_PHOTOMETRIC, &img->photometric)) { - switch (colorchannels) { - case 1: - if (isCCITTCompression(tif)) - img->photometric = PHOTOMETRIC_MINISWHITE; - else - img->photometric = PHOTOMETRIC_MINISBLACK; - break; - case 3: - img->photometric = PHOTOMETRIC_RGB; - break; - default: - sprintf(emsg, "Missing needed %s tag", photoTag); - return (0); - } - } - switch (img->photometric) { - case PHOTOMETRIC_PALETTE: - if (!TIFFGetField(tif, TIFFTAG_COLORMAP, - &red_orig, &green_orig, &blue_orig)) { - TIFFError(TIFFFileName(tif), "Missing required \"Colormap\" tag"); - return (0); - } - - /* copy the colormaps so we can modify them */ - n_color = (1L << img->bitspersample); - img->redcmap = (uint16 *) _TIFFmalloc(sizeof(uint16)*n_color); - img->greencmap = (uint16 *) _TIFFmalloc(sizeof(uint16)*n_color); - img->bluecmap = (uint16 *) _TIFFmalloc(sizeof(uint16)*n_color); - if( !img->redcmap || !img->greencmap || !img->bluecmap ) { - TIFFError(TIFFFileName(tif), "Out of memory for colormap copy"); - return (0); - } - - memcpy( img->redcmap, red_orig, n_color * 2 ); - memcpy( img->greencmap, green_orig, n_color * 2 ); - memcpy( img->bluecmap, blue_orig, n_color * 2 ); - - /* fall thru... */ - case PHOTOMETRIC_MINISWHITE: - case PHOTOMETRIC_MINISBLACK: - if (planarconfig == PLANARCONFIG_CONTIG - && img->samplesperpixel != 1 - && img->bitspersample < 8 ) { - sprintf(emsg, - "Sorry, can not handle contiguous data with %s=%d, " - "and %s=%d and Bits/Sample=%d", - photoTag, img->photometric, - "Samples/pixel", img->samplesperpixel, - img->bitspersample); - return (0); - } - break; - case PHOTOMETRIC_YCBCR: - if (planarconfig != PLANARCONFIG_CONTIG) { - sprintf(emsg, "Sorry, can not handle YCbCr images with %s=%d", - "Planarconfiguration", planarconfig); - return (0); - } - /* It would probably be nice to have a reality check here. */ - if (planarconfig == PLANARCONFIG_CONTIG) - /* can rely on libjpeg to convert to RGB */ - /* XXX should restore current state on exit */ - switch (compress) { - case COMPRESSION_OJPEG: - case COMPRESSION_JPEG: - TIFFSetField(tif, TIFFTAG_JPEGCOLORMODE, JPEGCOLORMODE_RGB); - img->photometric = PHOTOMETRIC_RGB; - break; - - default: - /* do nothing */; - break; - } - break; - case PHOTOMETRIC_RGB: - if (colorchannels < 3) { - sprintf(emsg, "Sorry, can not handle RGB image with %s=%d", - "Color channels", colorchannels); - return (0); - } - break; - case PHOTOMETRIC_SEPARATED: { - uint16 inkset; - TIFFGetFieldDefaulted(tif, TIFFTAG_INKSET, &inkset); - if (inkset != INKSET_CMYK) { - sprintf(emsg, "Sorry, can not handle separated image with %s=%d", - "InkSet", inkset); - return (0); - } - if (img->samplesperpixel < 4) { - sprintf(emsg, "Sorry, can not handle separated image with %s=%d", - "Samples/pixel", img->samplesperpixel); - return (0); - } - break; - } - case PHOTOMETRIC_LOGL: - if (compress != COMPRESSION_SGILOG) { - sprintf(emsg, "Sorry, LogL data must have %s=%d", - "Compression", COMPRESSION_SGILOG); - return (0); - } - TIFFSetField(tif, TIFFTAG_SGILOGDATAFMT, SGILOGDATAFMT_8BIT); - img->photometric = PHOTOMETRIC_MINISBLACK; /* little white lie */ - img->bitspersample = 8; - break; - case PHOTOMETRIC_LOGLUV: - if (compress != COMPRESSION_SGILOG && compress != COMPRESSION_SGILOG24) { - sprintf(emsg, "Sorry, LogLuv data must have %s=%d or %d", - "Compression", COMPRESSION_SGILOG, COMPRESSION_SGILOG24); - return (0); - } - if (planarconfig != PLANARCONFIG_CONTIG) { - sprintf(emsg, "Sorry, can not handle LogLuv images with %s=%d", - "Planarconfiguration", planarconfig); - return (0); - } - TIFFSetField(tif, TIFFTAG_SGILOGDATAFMT, SGILOGDATAFMT_8BIT); - img->photometric = PHOTOMETRIC_RGB; /* little white lie */ - img->bitspersample = 8; - break; - case PHOTOMETRIC_CIELAB: - break; - default: - sprintf(emsg, "Sorry, can not handle image with %s=%d", - photoTag, img->photometric); - return (0); - } - img->Map = NULL; - img->BWmap = NULL; - img->PALmap = NULL; - img->ycbcr = NULL; - img->cielab = NULL; - TIFFGetField(tif, TIFFTAG_IMAGEWIDTH, &img->width); - TIFFGetField(tif, TIFFTAG_IMAGELENGTH, &img->height); - TIFFGetFieldDefaulted(tif, TIFFTAG_ORIENTATION, &img->orientation); - img->isContig = - !(planarconfig == PLANARCONFIG_SEPARATE && colorchannels > 1); - if (img->isContig) { - img->get = TIFFIsTiled(tif) ? gtTileContig : gtStripContig; - return pickTileContigCase(img); - } else { - img->get = TIFFIsTiled(tif) ? gtTileSeparate : gtStripSeparate; - return pickTileSeparateCase(img); - } -} - -int -TIFFRGBAImageGet(TIFFRGBAImage* img, uint32* raster, uint32 w, uint32 h) -{ - if (img->get == NULL) { - TIFFError(TIFFFileName(img->tif), "No \"get\" routine setup"); - return (0); - } - if (img->put.any == NULL) { - TIFFError(TIFFFileName(img->tif), - "No \"put\" routine setupl; probably can not handle image format"); - return (0); - } - return (*img->get)(img, raster, w, h); -} - -/* - * Read the specified image into an ABGR-format rastertaking in account - * specified orientation. - */ -int -TIFFReadRGBAImageOriented(TIFF* tif, - uint32 rwidth, uint32 rheight, uint32* raster, - int orientation, int stop) -{ - char emsg[1024]; - TIFFRGBAImage img; - int ok; - - if (TIFFRGBAImageOK(tif, emsg) && - TIFFRGBAImageBegin(&img, tif, stop, emsg)) { - img.req_orientation = orientation; - /* XXX verify rwidth and rheight against width and height */ - ok = TIFFRGBAImageGet(&img, raster+(rheight-img.height)*rwidth, - rwidth, img.height); - TIFFRGBAImageEnd(&img); - } else { - TIFFError(TIFFFileName(tif), emsg); - ok = 0; - } - return (ok); -} - -/* - * Read the specified image into an ABGR-format raster. Use bottom left - * origin for raster by default. - */ -int -TIFFReadRGBAImage(TIFF* tif, - uint32 rwidth, uint32 rheight, uint32* raster, int stop) -{ - return TIFFReadRGBAImageOriented(tif, rwidth, rheight, raster, - ORIENTATION_BOTLEFT, stop); -} - -static int -setorientation(TIFFRGBAImage* img) -{ - switch (img->orientation) { - case ORIENTATION_TOPLEFT: - case ORIENTATION_LEFTTOP: - if (img->req_orientation == ORIENTATION_TOPRIGHT || - img->req_orientation == ORIENTATION_RIGHTTOP) - return FLIP_HORIZONTALLY; - else if (img->req_orientation == ORIENTATION_BOTRIGHT || - img->req_orientation == ORIENTATION_RIGHTBOT) - return FLIP_HORIZONTALLY | FLIP_VERTICALLY; - else if (img->req_orientation == ORIENTATION_BOTLEFT || - img->req_orientation == ORIENTATION_LEFTBOT) - return FLIP_VERTICALLY; - else - return 0; - case ORIENTATION_TOPRIGHT: - case ORIENTATION_RIGHTTOP: - if (img->req_orientation == ORIENTATION_TOPLEFT || - img->req_orientation == ORIENTATION_LEFTTOP) - return FLIP_HORIZONTALLY; - else if (img->req_orientation == ORIENTATION_BOTRIGHT || - img->req_orientation == ORIENTATION_RIGHTBOT) - return FLIP_VERTICALLY; - else if (img->req_orientation == ORIENTATION_BOTLEFT || - img->req_orientation == ORIENTATION_LEFTBOT) - return FLIP_HORIZONTALLY | FLIP_VERTICALLY; - else - return 0; - case ORIENTATION_BOTRIGHT: - case ORIENTATION_RIGHTBOT: - if (img->req_orientation == ORIENTATION_TOPLEFT || - img->req_orientation == ORIENTATION_LEFTTOP) - return FLIP_HORIZONTALLY | FLIP_VERTICALLY; - else if (img->req_orientation == ORIENTATION_TOPRIGHT || - img->req_orientation == ORIENTATION_RIGHTTOP) - return FLIP_VERTICALLY; - else if (img->req_orientation == ORIENTATION_BOTLEFT || - img->req_orientation == ORIENTATION_LEFTBOT) - return FLIP_HORIZONTALLY; - else - return 0; - case ORIENTATION_BOTLEFT: - case ORIENTATION_LEFTBOT: - if (img->req_orientation == ORIENTATION_TOPLEFT || - img->req_orientation == ORIENTATION_LEFTTOP) - return FLIP_VERTICALLY; - else if (img->req_orientation == ORIENTATION_TOPRIGHT || - img->req_orientation == ORIENTATION_RIGHTTOP) - return FLIP_HORIZONTALLY | FLIP_VERTICALLY; - else if (img->req_orientation == ORIENTATION_BOTRIGHT || - img->req_orientation == ORIENTATION_RIGHTBOT) - return FLIP_HORIZONTALLY; - else - return 0; - default: /* NOTREACHED */ - return 0; - } -} - -/* - * Get an tile-organized image that has - * PlanarConfiguration contiguous if SamplesPerPixel > 1 - * or - * SamplesPerPixel == 1 - */ -static int -gtTileContig(TIFFRGBAImage* img, uint32* raster, uint32 w, uint32 h) -{ - TIFF* tif = img->tif; - tileContigRoutine put = img->put.contig; - uint32 col, row, y, rowstoread; - uint32 pos; - uint32 tw, th; - u_char* buf; - int32 fromskew, toskew; - uint32 nrow; - int ret = 1, flip; - - buf = (u_char*) _TIFFmalloc(TIFFTileSize(tif)); - if (buf == 0) { - TIFFError(TIFFFileName(tif), "No space for tile buffer"); - return (0); - } - _TIFFmemset(buf, 0, TIFFTileSize(tif)); - TIFFGetField(tif, TIFFTAG_TILEWIDTH, &tw); - TIFFGetField(tif, TIFFTAG_TILELENGTH, &th); - - flip = setorientation(img); - if (flip & FLIP_VERTICALLY) { - y = h - 1; - toskew = -(int32)(tw + w); - } - else { - y = 0; - toskew = -(int32)(tw - w); - } - - for (row = 0; row < h; row += nrow) - { - rowstoread = th - (row + img->row_offset) % th; - nrow = (row + rowstoread > h ? h - row : rowstoread); - for (col = 0; col < w; col += tw) - { - if (TIFFReadTile(tif, buf, col+img->col_offset, - row+img->row_offset, 0, 0) < 0 && img->stoponerr) - { - ret = 0; - break; - } - - pos = ((row+img->row_offset) % th) * TIFFTileRowSize(tif); - - if (col + tw > w) - { - /* - * Tile is clipped horizontally. Calculate - * visible portion and skewing factors. - */ - uint32 npix = w - col; - fromskew = tw - npix; - (*put)(img, raster+y*w+col, col, y, - npix, nrow, fromskew, toskew + fromskew, buf + pos); - } - else - { - (*put)(img, raster+y*w+col, col, y, tw, nrow, 0, toskew, buf + pos); - } - } - - y += (flip & FLIP_VERTICALLY ? -(int32) nrow : (int32) nrow); - } - _TIFFfree(buf); - - if (flip & FLIP_HORIZONTALLY) { - uint32 line; - - for (line = 0; line < h; line++) { - uint32 *left = raster + (line * w); - uint32 *right = left + w - 1; - - while ( left < right ) { - uint32 temp = *left; - *left = *right; - *right = temp; - left++, right--; - } - } - } - - return (ret); -} - -/* - * Get an tile-organized image that has - * SamplesPerPixel > 1 - * PlanarConfiguration separated - * We assume that all such images are RGB. - */ -static int -gtTileSeparate(TIFFRGBAImage* img, uint32* raster, uint32 w, uint32 h) -{ - TIFF* tif = img->tif; - tileSeparateRoutine put = img->put.separate; - uint32 col, row, y, rowstoread; - uint32 pos; - uint32 tw, th; - u_char* buf; - u_char* r; - u_char* g; - u_char* b; - u_char* a; - tsize_t tilesize; - int32 fromskew, toskew; - int alpha = img->alpha; - uint32 nrow; - int ret = 1, flip; - - tilesize = TIFFTileSize(tif); - buf = (u_char*) _TIFFmalloc(4*tilesize); - if (buf == 0) { - TIFFError(TIFFFileName(tif), "No space for tile buffer"); - return (0); - } - _TIFFmemset(buf, 0, 4*tilesize); - r = buf; - g = r + tilesize; - b = g + tilesize; - a = b + tilesize; - if (!alpha) - memset(a, 0xff, tilesize); - TIFFGetField(tif, TIFFTAG_TILEWIDTH, &tw); - TIFFGetField(tif, TIFFTAG_TILELENGTH, &th); - - flip = setorientation(img); - if (flip & FLIP_VERTICALLY) { - y = h - 1; - toskew = -(int32)(tw + w); - } - else { - y = 0; - toskew = -(int32)(tw - w); - } - - for (row = 0; row < h; row += nrow) - { - rowstoread = th - (row + img->row_offset) % th; - nrow = (row + rowstoread > h ? h - row : rowstoread); - for (col = 0; col < w; col += tw) - { - if (TIFFReadTile(tif, r, col+img->col_offset, - row+img->row_offset,0,0) < 0 && img->stoponerr) - { - ret = 0; - break; - } - if (TIFFReadTile(tif, g, col+img->col_offset, - row+img->row_offset,0,1) < 0 && img->stoponerr) - { - ret = 0; - break; - } - if (TIFFReadTile(tif, b, col+img->col_offset, - row+img->row_offset,0,2) < 0 && img->stoponerr) - { - ret = 0; - break; - } - if (alpha && TIFFReadTile(tif,a,col+img->col_offset, - row+img->row_offset,0,3) < 0 && img->stoponerr) - { - ret = 0; - break; - } - - pos = ((row+img->row_offset) % th) * TIFFTileRowSize(tif); - - if (col + tw > w) - { - /* - * Tile is clipped horizontally. Calculate - * visible portion and skewing factors. - */ - uint32 npix = w - col; - fromskew = tw - npix; - (*put)(img, raster+y*w+col, col, y, - npix, nrow, fromskew, toskew + fromskew, - r + pos, g + pos, b + pos, a + pos); - } else { - (*put)(img, raster+y*w+col, col, y, - tw, nrow, 0, toskew, r + pos, g + pos, b + pos, a + pos); - } - } - - y += (flip & FLIP_VERTICALLY ?-(int32) nrow : (int32) nrow); - } - - if (flip & FLIP_HORIZONTALLY) { - uint32 line; - - for (line = 0; line < h; line++) { - uint32 *left = raster + (line * w); - uint32 *right = left + w - 1; - - while ( left < right ) { - uint32 temp = *left; - *left = *right; - *right = temp; - left++, right--; - } - } - } - - _TIFFfree(buf); - return (ret); -} - -/* - * Get a strip-organized image that has - * PlanarConfiguration contiguous if SamplesPerPixel > 1 - * or - * SamplesPerPixel == 1 - */ -static int -gtStripContig(TIFFRGBAImage* img, uint32* raster, uint32 w, uint32 h) -{ - TIFF* tif = img->tif; - tileContigRoutine put = img->put.contig; - uint32 row, y, nrow, rowstoread; - uint32 pos; - u_char* buf; - uint32 rowsperstrip; - uint32 imagewidth = img->width; - tsize_t scanline; - int32 fromskew, toskew; - int ret = 1, flip; - - buf = (u_char*) _TIFFmalloc(TIFFStripSize(tif)); - if (buf == 0) { - TIFFError(TIFFFileName(tif), "No space for strip buffer"); - return (0); - } - _TIFFmemset(buf, 0, TIFFStripSize(tif)); - - flip = setorientation(img); - if (flip & FLIP_VERTICALLY) { - y = h - 1; - toskew = -(int32)(w + w); - } else { - y = 0; - toskew = -(int32)(w - w); - } - - TIFFGetFieldDefaulted(tif, TIFFTAG_ROWSPERSTRIP, &rowsperstrip); - scanline = TIFFScanlineSize(tif); - fromskew = (w < imagewidth ? imagewidth - w : 0); - for (row = 0; row < h; row += nrow) - { - rowstoread = rowsperstrip - (row + img->row_offset) % rowsperstrip; - nrow = (row + rowstoread > h ? h - row : rowstoread); - if (TIFFReadEncodedStrip(tif, - TIFFComputeStrip(tif,row+img->row_offset, 0), - buf, - ((row + img->row_offset)%rowsperstrip + nrow) * scanline) < 0 - && img->stoponerr) - { - ret = 0; - break; - } - - pos = ((row + img->row_offset) % rowsperstrip) * scanline; - (*put)(img, raster+y*w, 0, y, w, nrow, fromskew, toskew, buf + pos); - y += (flip & FLIP_VERTICALLY ? -(int32) nrow : (int32) nrow); - } - - if (flip & FLIP_HORIZONTALLY) { - uint32 line; - - for (line = 0; line < h; line++) { - uint32 *left = raster + (line * w); - uint32 *right = left + w - 1; - - while ( left < right ) { - uint32 temp = *left; - *left = *right; - *right = temp; - left++, right--; - } - } - } - - _TIFFfree(buf); - return (ret); -} - -/* - * Get a strip-organized image with - * SamplesPerPixel > 1 - * PlanarConfiguration separated - * We assume that all such images are RGB. - */ -static int -gtStripSeparate(TIFFRGBAImage* img, uint32* raster, uint32 w, uint32 h) -{ - TIFF* tif = img->tif; - tileSeparateRoutine put = img->put.separate; - u_char *buf; - u_char *r, *g, *b, *a; - uint32 row, y, nrow, rowstoread; - uint32 pos; - tsize_t scanline; - uint32 rowsperstrip, offset_row; - uint32 imagewidth = img->width; - tsize_t stripsize; - int32 fromskew, toskew; - int alpha = img->alpha; - int ret = 1, flip; - - stripsize = TIFFStripSize(tif); - r = buf = (u_char *)_TIFFmalloc(4*stripsize); - if (buf == 0) { - TIFFError(TIFFFileName(tif), "No space for tile buffer"); - return (0); - } - _TIFFmemset(buf, 0, 4*stripsize); - g = r + stripsize; - b = g + stripsize; - a = b + stripsize; - if (!alpha) - memset(a, 0xff, stripsize); - - flip = setorientation(img); - if (flip & FLIP_VERTICALLY) { - y = h - 1; - toskew = -(int32)(w + w); - } - else { - y = 0; - toskew = -(int32)(w - w); - } - - TIFFGetFieldDefaulted(tif, TIFFTAG_ROWSPERSTRIP, &rowsperstrip); - scanline = TIFFScanlineSize(tif); - fromskew = (w < imagewidth ? imagewidth - w : 0); - for (row = 0; row < h; row += nrow) - { - rowstoread = rowsperstrip - (row + img->row_offset) % rowsperstrip; - nrow = (row + rowstoread > h ? h - row : rowstoread); - offset_row = row + img->row_offset; - if (TIFFReadEncodedStrip(tif, TIFFComputeStrip(tif, offset_row, 0), - r, ((row + img->row_offset)%rowsperstrip + nrow) * scanline) < 0 - && img->stoponerr) - { - ret = 0; - break; - } - if (TIFFReadEncodedStrip(tif, TIFFComputeStrip(tif, offset_row, 1), - g, ((row + img->row_offset)%rowsperstrip + nrow) * scanline) < 0 - && img->stoponerr) - { - ret = 0; - break; - } - if (TIFFReadEncodedStrip(tif, TIFFComputeStrip(tif, offset_row, 2), - b, ((row + img->row_offset)%rowsperstrip + nrow) * scanline) < 0 - && img->stoponerr) - { - ret = 0; - break; - } - if (alpha && - (TIFFReadEncodedStrip(tif, TIFFComputeStrip(tif, offset_row, 3), - a, ((row + img->row_offset)%rowsperstrip + nrow) * scanline) < 0 - && img->stoponerr)) - { - ret = 0; - break; - } - - pos = ((row + img->row_offset) % rowsperstrip) * scanline; - (*put)(img, raster+y*w, 0, y, w, nrow, fromskew, toskew, r + pos, g + pos, - b + pos, a + pos); - y += (flip & FLIP_VERTICALLY ? -(int32) nrow : (int32) nrow); - } - - if (flip & FLIP_HORIZONTALLY) { - uint32 line; - - for (line = 0; line < h; line++) { - uint32 *left = raster + (line * w); - uint32 *right = left + w - 1; - - while ( left < right ) { - uint32 temp = *left; - *left = *right; - *right = temp; - left++, right--; - } - } - } - - _TIFFfree(buf); - return (ret); -} - -/* - * The following routines move decoded data returned - * from the TIFF library into rasters filled with packed - * ABGR pixels (i.e. suitable for passing to lrecwrite.) - * - * The routines have been created according to the most - * important cases and optimized. pickTileContigCase and - * pickTileSeparateCase analyze the parameters and select - * the appropriate "put" routine to use. - */ -#define REPEAT8(op) REPEAT4(op); REPEAT4(op) -#define REPEAT4(op) REPEAT2(op); REPEAT2(op) -#define REPEAT2(op) op; op -#define CASE8(x,op) \ - switch (x) { \ - case 7: op; case 6: op; case 5: op; \ - case 4: op; case 3: op; case 2: op; \ - case 1: op; \ - } -#define CASE4(x,op) switch (x) { case 3: op; case 2: op; case 1: op; } -#define NOP - -#define UNROLL8(w, op1, op2) { \ - uint32 _x; \ - for (_x = w; _x >= 8; _x -= 8) { \ - op1; \ - REPEAT8(op2); \ - } \ - if (_x > 0) { \ - op1; \ - CASE8(_x,op2); \ - } \ -} -#define UNROLL4(w, op1, op2) { \ - uint32 _x; \ - for (_x = w; _x >= 4; _x -= 4) { \ - op1; \ - REPEAT4(op2); \ - } \ - if (_x > 0) { \ - op1; \ - CASE4(_x,op2); \ - } \ -} -#define UNROLL2(w, op1, op2) { \ - uint32 _x; \ - for (_x = w; _x >= 2; _x -= 2) { \ - op1; \ - REPEAT2(op2); \ - } \ - if (_x) { \ - op1; \ - op2; \ - } \ -} - -#define SKEW(r,g,b,skew) { r += skew; g += skew; b += skew; } -#define SKEW4(r,g,b,a,skew) { r += skew; g += skew; b += skew; a+= skew; } - -#define A1 ((uint32)(0xffL<<24)) -#define PACK(r,g,b) \ - ((uint32)(r)|((uint32)(g)<<8)|((uint32)(b)<<16)|A1) -#define PACK4(r,g,b,a) \ - ((uint32)(r)|((uint32)(g)<<8)|((uint32)(b)<<16)|((uint32)(a)<<24)) -#define W2B(v) (((v)>>8)&0xff) -#define PACKW(r,g,b) \ - ((uint32)W2B(r)|((uint32)W2B(g)<<8)|((uint32)W2B(b)<<16)|A1) -#define PACKW4(r,g,b,a) \ - ((uint32)W2B(r)|((uint32)W2B(g)<<8)|((uint32)W2B(b)<<16)|((uint32)W2B(a)<<24)) - -#define DECLAREContigPutFunc(name) \ -static void name(\ - TIFFRGBAImage* img, \ - uint32* cp, \ - uint32 x, uint32 y, \ - uint32 w, uint32 h, \ - int32 fromskew, int32 toskew, \ - u_char* pp \ -) - -/* - * 8-bit palette => colormap/RGB - */ -DECLAREContigPutFunc(put8bitcmaptile) -{ - uint32** PALmap = img->PALmap; - int samplesperpixel = img->samplesperpixel; - - (void) y; - while (h-- > 0) { - for (x = w; x-- > 0;) - { - *cp++ = PALmap[*pp][0]; - pp += samplesperpixel; - } - cp += toskew; - pp += fromskew; - } -} - -/* - * 4-bit palette => colormap/RGB - */ -DECLAREContigPutFunc(put4bitcmaptile) -{ - uint32** PALmap = img->PALmap; - - (void) x; (void) y; - fromskew /= 2; - while (h-- > 0) { - uint32* bw; - UNROLL2(w, bw = PALmap[*pp++], *cp++ = *bw++); - cp += toskew; - pp += fromskew; - } -} - -/* - * 2-bit palette => colormap/RGB - */ -DECLAREContigPutFunc(put2bitcmaptile) -{ - uint32** PALmap = img->PALmap; - - (void) x; (void) y; - fromskew /= 4; - while (h-- > 0) { - uint32* bw; - UNROLL4(w, bw = PALmap[*pp++], *cp++ = *bw++); - cp += toskew; - pp += fromskew; - } -} - -/* - * 1-bit palette => colormap/RGB - */ -DECLAREContigPutFunc(put1bitcmaptile) -{ - uint32** PALmap = img->PALmap; - - (void) x; (void) y; - fromskew /= 8; - while (h-- > 0) { - uint32* bw; - UNROLL8(w, bw = PALmap[*pp++], *cp++ = *bw++); - cp += toskew; - pp += fromskew; - } -} - -/* - * 8-bit greyscale => colormap/RGB - */ -DECLAREContigPutFunc(putgreytile) -{ - int samplesperpixel = img->samplesperpixel; - uint32** BWmap = img->BWmap; - - (void) y; - while (h-- > 0) { - for (x = w; x-- > 0;) - { - *cp++ = BWmap[*pp][0]; - pp += samplesperpixel; - } - cp += toskew; - pp += fromskew; - } -} - -/* - * 16-bit greyscale => colormap/RGB - */ -DECLAREContigPutFunc(put16bitbwtile) -{ - int samplesperpixel = img->samplesperpixel; - uint32** BWmap = img->BWmap; - - (void) y; - while (h-- > 0) { - uint16 *wp = (uint16 *) pp; - - for (x = w; x-- > 0;) - { - /* use high order byte of 16bit value */ - - *cp++ = BWmap[*wp >> 8][0]; - pp += 2 * samplesperpixel; - wp += samplesperpixel; - } - cp += toskew; - pp += fromskew; - } -} - -/* - * 1-bit bilevel => colormap/RGB - */ -DECLAREContigPutFunc(put1bitbwtile) -{ - uint32** BWmap = img->BWmap; - - (void) x; (void) y; - fromskew /= 8; - while (h-- > 0) { - uint32* bw; - UNROLL8(w, bw = BWmap[*pp++], *cp++ = *bw++); - cp += toskew; - pp += fromskew; - } -} - -/* - * 2-bit greyscale => colormap/RGB - */ -DECLAREContigPutFunc(put2bitbwtile) -{ - uint32** BWmap = img->BWmap; - - (void) x; (void) y; - fromskew /= 4; - while (h-- > 0) { - uint32* bw; - UNROLL4(w, bw = BWmap[*pp++], *cp++ = *bw++); - cp += toskew; - pp += fromskew; - } -} - -/* - * 4-bit greyscale => colormap/RGB - */ -DECLAREContigPutFunc(put4bitbwtile) -{ - uint32** BWmap = img->BWmap; - - (void) x; (void) y; - fromskew /= 2; - while (h-- > 0) { - uint32* bw; - UNROLL2(w, bw = BWmap[*pp++], *cp++ = *bw++); - cp += toskew; - pp += fromskew; - } -} - -/* - * 8-bit packed samples, no Map => RGB - */ -DECLAREContigPutFunc(putRGBcontig8bittile) -{ - int samplesperpixel = img->samplesperpixel; - - (void) x; (void) y; - fromskew *= samplesperpixel; - while (h-- > 0) { - UNROLL8(w, NOP, - *cp++ = PACK(pp[0], pp[1], pp[2]); - pp += samplesperpixel); - cp += toskew; - pp += fromskew; - } -} - -/* - * 8-bit packed samples, w/ Map => RGB - */ -DECLAREContigPutFunc(putRGBcontig8bitMaptile) -{ - TIFFRGBValue* Map = img->Map; - int samplesperpixel = img->samplesperpixel; - - (void) y; - fromskew *= samplesperpixel; - while (h-- > 0) { - for (x = w; x-- > 0;) { - *cp++ = PACK(Map[pp[0]], Map[pp[1]], Map[pp[2]]); - pp += samplesperpixel; - } - pp += fromskew; - cp += toskew; - } -} - -/* - * 8-bit packed samples => RGBA w/ associated alpha - * (known to have Map == NULL) - */ -DECLAREContigPutFunc(putRGBAAcontig8bittile) -{ - int samplesperpixel = img->samplesperpixel; - - (void) x; (void) y; - fromskew *= samplesperpixel; - while (h-- > 0) { - UNROLL8(w, NOP, - *cp++ = PACK4(pp[0], pp[1], pp[2], pp[3]); - pp += samplesperpixel); - cp += toskew; - pp += fromskew; - } -} - -/* - * 8-bit packed samples => RGBA w/ unassociated alpha - * (known to have Map == NULL) - */ -DECLAREContigPutFunc(putRGBUAcontig8bittile) -{ - int samplesperpixel = img->samplesperpixel; - - (void) y; - fromskew *= samplesperpixel; - while (h-- > 0) { - uint32 r, g, b, a; - for (x = w; x-- > 0;) { - a = pp[3]; - r = (pp[0] * a) / 255; - g = (pp[1] * a) / 255; - b = (pp[2] * a) / 255; - *cp++ = PACK4(r,g,b,a); - pp += samplesperpixel; - } - cp += toskew; - pp += fromskew; - } -} - -/* - * 16-bit packed samples => RGB - */ -DECLAREContigPutFunc(putRGBcontig16bittile) -{ - int samplesperpixel = img->samplesperpixel; - uint16 *wp = (uint16 *)pp; - - (void) y; - fromskew *= samplesperpixel; - while (h-- > 0) { - for (x = w; x-- > 0;) { - *cp++ = PACKW(wp[0], wp[1], wp[2]); - wp += samplesperpixel; - } - cp += toskew; - wp += fromskew; - } -} - -/* - * 16-bit packed samples => RGBA w/ associated alpha - * (known to have Map == NULL) - */ -DECLAREContigPutFunc(putRGBAAcontig16bittile) -{ - int samplesperpixel = img->samplesperpixel; - uint16 *wp = (uint16 *)pp; - - (void) y; - fromskew *= samplesperpixel; - while (h-- > 0) { - for (x = w; x-- > 0;) { - *cp++ = PACKW4(wp[0], wp[1], wp[2], wp[3]); - wp += samplesperpixel; - } - cp += toskew; - wp += fromskew; - } -} - -/* - * 16-bit packed samples => RGBA w/ unassociated alpha - * (known to have Map == NULL) - */ -DECLAREContigPutFunc(putRGBUAcontig16bittile) -{ - int samplesperpixel = img->samplesperpixel; - uint16 *wp = (uint16 *)pp; - - (void) y; - fromskew *= samplesperpixel; - while (h-- > 0) { - uint32 r,g,b,a; - /* - * We shift alpha down four bits just in case unsigned - * arithmetic doesn't handle the full range. - * We still have plenty of accuracy, since the output is 8 bits. - * So we have (r * 0xffff) * (a * 0xfff)) = r*a * (0xffff*0xfff) - * Since we want r*a * 0xff for eight bit output, - * we divide by (0xffff * 0xfff) / 0xff == 0x10eff. - */ - for (x = w; x-- > 0;) { - a = wp[3] >> 4; - r = (wp[0] * a) / 0x10eff; - g = (wp[1] * a) / 0x10eff; - b = (wp[2] * a) / 0x10eff; - *cp++ = PACK4(r,g,b,a); - wp += samplesperpixel; - } - cp += toskew; - wp += fromskew; - } -} - -/* - * 8-bit packed CMYK samples w/o Map => RGB - * - * NB: The conversion of CMYK->RGB is *very* crude. - */ -DECLAREContigPutFunc(putRGBcontig8bitCMYKtile) -{ - int samplesperpixel = img->samplesperpixel; - uint16 r, g, b, k; - - (void) x; (void) y; - fromskew *= samplesperpixel; - while (h-- > 0) { - UNROLL8(w, NOP, - k = 255 - pp[3]; - r = (k*(255-pp[0]))/255; - g = (k*(255-pp[1]))/255; - b = (k*(255-pp[2]))/255; - *cp++ = PACK(r, g, b); - pp += samplesperpixel); - cp += toskew; - pp += fromskew; - } -} - -/* - * 8-bit packed CMYK samples w/Map => RGB - * - * NB: The conversion of CMYK->RGB is *very* crude. - */ -DECLAREContigPutFunc(putRGBcontig8bitCMYKMaptile) -{ - int samplesperpixel = img->samplesperpixel; - TIFFRGBValue* Map = img->Map; - uint16 r, g, b, k; - - (void) y; - fromskew *= samplesperpixel; - while (h-- > 0) { - for (x = w; x-- > 0;) { - k = 255 - pp[3]; - r = (k*(255-pp[0]))/255; - g = (k*(255-pp[1]))/255; - b = (k*(255-pp[2]))/255; - *cp++ = PACK(Map[r], Map[g], Map[b]); - pp += samplesperpixel; - } - pp += fromskew; - cp += toskew; - } -} - -#define DECLARESepPutFunc(name) \ -static void name(\ - TIFFRGBAImage* img,\ - uint32* cp,\ - uint32 x, uint32 y, \ - uint32 w, uint32 h,\ - int32 fromskew, int32 toskew,\ - u_char* r, u_char* g, u_char* b, u_char* a\ -) - -/* - * 8-bit unpacked samples => RGB - */ -DECLARESepPutFunc(putRGBseparate8bittile) -{ - (void) img; (void) x; (void) y; (void) a; - while (h-- > 0) { - UNROLL8(w, NOP, *cp++ = PACK(*r++, *g++, *b++)); - SKEW(r, g, b, fromskew); - cp += toskew; - } -} - -/* - * 8-bit unpacked samples => RGB - */ -DECLARESepPutFunc(putRGBseparate8bitMaptile) -{ - TIFFRGBValue* Map = img->Map; - - (void) y; (void) a; - while (h-- > 0) { - for (x = w; x > 0; x--) - *cp++ = PACK(Map[*r++], Map[*g++], Map[*b++]); - SKEW(r, g, b, fromskew); - cp += toskew; - } -} - -/* - * 8-bit unpacked samples => RGBA w/ associated alpha - */ -DECLARESepPutFunc(putRGBAAseparate8bittile) -{ - (void) img; (void) x; (void) y; - while (h-- > 0) { - UNROLL8(w, NOP, *cp++ = PACK4(*r++, *g++, *b++, *a++)); - SKEW4(r, g, b, a, fromskew); - cp += toskew; - } -} - -/* - * 8-bit unpacked samples => RGBA w/ unassociated alpha - */ -DECLARESepPutFunc(putRGBUAseparate8bittile) -{ - (void) img; (void) y; - while (h-- > 0) { - uint32 rv, gv, bv, av; - for (x = w; x-- > 0;) { - av = *a++; - rv = (*r++ * av) / 255; - gv = (*g++ * av) / 255; - bv = (*b++ * av) / 255; - *cp++ = PACK4(rv,gv,bv,av); - } - SKEW4(r, g, b, a, fromskew); - cp += toskew; - } -} - -/* - * 16-bit unpacked samples => RGB - */ -DECLARESepPutFunc(putRGBseparate16bittile) -{ - uint16 *wr = (uint16*) r; - uint16 *wg = (uint16*) g; - uint16 *wb = (uint16*) b; - - (void) img; (void) y; (void) a; - while (h-- > 0) { - for (x = 0; x < w; x++) - *cp++ = PACKW(*wr++, *wg++, *wb++); - SKEW(wr, wg, wb, fromskew); - cp += toskew; - } -} - -/* - * 16-bit unpacked samples => RGBA w/ associated alpha - */ -DECLARESepPutFunc(putRGBAAseparate16bittile) -{ - uint16 *wr = (uint16*) r; - uint16 *wg = (uint16*) g; - uint16 *wb = (uint16*) b; - uint16 *wa = (uint16*) a; - - (void) img; (void) y; - while (h-- > 0) { - for (x = 0; x < w; x++) - *cp++ = PACKW4(*wr++, *wg++, *wb++, *wa++); - SKEW4(wr, wg, wb, wa, fromskew); - cp += toskew; - } -} - -/* - * 16-bit unpacked samples => RGBA w/ unassociated alpha - */ -DECLARESepPutFunc(putRGBUAseparate16bittile) -{ - uint16 *wr = (uint16*) r; - uint16 *wg = (uint16*) g; - uint16 *wb = (uint16*) b; - uint16 *wa = (uint16*) a; - - (void) img; (void) y; - while (h-- > 0) { - uint32 r,g,b,a; - /* - * We shift alpha down four bits just in case unsigned - * arithmetic doesn't handle the full range. - * We still have plenty of accuracy, since the output is 8 bits. - * So we have (r * 0xffff) * (a * 0xfff)) = r*a * (0xffff*0xfff) - * Since we want r*a * 0xff for eight bit output, - * we divide by (0xffff * 0xfff) / 0xff == 0x10eff. - */ - for (x = w; x-- > 0;) { - a = *wa++ >> 4; - r = (*wr++ * a) / 0x10eff; - g = (*wg++ * a) / 0x10eff; - b = (*wb++ * a) / 0x10eff; - *cp++ = PACK4(r,g,b,a); - } - SKEW4(wr, wg, wb, wa, fromskew); - cp += toskew; - } -} - -/* - * 8-bit packed CIE L*a*b 1976 samples => RGB - */ -DECLAREContigPutFunc(putcontig8bitCIELab) -{ - float X, Y, Z; - uint32 r, g, b; - (void) y; - fromskew *= 3; - while (h-- > 0) { - for (x = w; x-- > 0;) { - TIFFCIELabToXYZ(img->cielab, - (u_char)pp[0], - (signed char)pp[1], - (signed char)pp[2], - &X, &Y, &Z); - TIFFXYZToRGB(img->cielab, X, Y, Z, &r, &g, &b); - *cp++ = PACK(r, g, b); - pp += 3; - } - cp += toskew; - pp += fromskew; - } -} - -/* - * YCbCr -> RGB conversion and packing routines. - */ - -#define YCbCrtoRGB(dst, Y) { \ - uint32 r, g, b; \ - TIFFYCbCrtoRGB(img->ycbcr, (Y), Cb, Cr, &r, &g, &b); \ - dst = PACK(r, g, b); \ -} - -/* - * 8-bit packed YCbCr samples => RGB - * This function is generic for different sampling sizes, - * and can handle blocks sizes that aren't multiples of the - * sampling size. However, it is substantially less optimized - * than the specific sampling cases. It is used as a fallback - * for difficult blocks. - */ -#ifdef notdef -static void putcontig8bitYCbCrGenericTile( - TIFFRGBAImage* img, - uint32* cp, - uint32 x, uint32 y, - uint32 w, uint32 h, - int32 fromskew, int32 toskew, - u_char* pp, - int h_group, - int v_group ) - -{ - uint32* cp1 = cp+w+toskew; - uint32* cp2 = cp1+w+toskew; - uint32* cp3 = cp2+w+toskew; - int32 incr = 3*w+4*toskew; - int32 Cb, Cr; - int group_size = v_group * h_group + 2; - - (void) y; - fromskew = (fromskew * group_size) / h_group; - - for( yy = 0; yy < h; yy++ ) - { - u_char *pp_line; - int y_line_group = yy / v_group; - int y_remainder = yy - y_line_group * v_group; - - pp_line = pp + v_line_group * - - - for( xx = 0; xx < w; xx++ ) - { - Cb = pp - } - } - for (; h >= 4; h -= 4) { - x = w>>2; - do { - Cb = pp[16]; - Cr = pp[17]; - - YCbCrtoRGB(cp [0], pp[ 0]); - YCbCrtoRGB(cp [1], pp[ 1]); - YCbCrtoRGB(cp [2], pp[ 2]); - YCbCrtoRGB(cp [3], pp[ 3]); - YCbCrtoRGB(cp1[0], pp[ 4]); - YCbCrtoRGB(cp1[1], pp[ 5]); - YCbCrtoRGB(cp1[2], pp[ 6]); - YCbCrtoRGB(cp1[3], pp[ 7]); - YCbCrtoRGB(cp2[0], pp[ 8]); - YCbCrtoRGB(cp2[1], pp[ 9]); - YCbCrtoRGB(cp2[2], pp[10]); - YCbCrtoRGB(cp2[3], pp[11]); - YCbCrtoRGB(cp3[0], pp[12]); - YCbCrtoRGB(cp3[1], pp[13]); - YCbCrtoRGB(cp3[2], pp[14]); - YCbCrtoRGB(cp3[3], pp[15]); - - cp += 4, cp1 += 4, cp2 += 4, cp3 += 4; - pp += 18; - } while (--x); - cp += incr, cp1 += incr, cp2 += incr, cp3 += incr; - pp += fromskew; - } -} -#endif - -/* - * 8-bit packed YCbCr samples w/ 4,4 subsampling => RGB - */ -DECLAREContigPutFunc(putcontig8bitYCbCr44tile) -{ - uint32* cp1 = cp+w+toskew; - uint32* cp2 = cp1+w+toskew; - uint32* cp3 = cp2+w+toskew; - int32 incr = 3*w+4*toskew; - - (void) y; - /* adjust fromskew */ - fromskew = (fromskew * 18) / 4; - if ((h & 3) == 0 && (w & 3) == 0) { - for (; h >= 4; h -= 4) { - x = w>>2; - do { - int32 Cb = pp[16]; - int32 Cr = pp[17]; - - YCbCrtoRGB(cp [0], pp[ 0]); - YCbCrtoRGB(cp [1], pp[ 1]); - YCbCrtoRGB(cp [2], pp[ 2]); - YCbCrtoRGB(cp [3], pp[ 3]); - YCbCrtoRGB(cp1[0], pp[ 4]); - YCbCrtoRGB(cp1[1], pp[ 5]); - YCbCrtoRGB(cp1[2], pp[ 6]); - YCbCrtoRGB(cp1[3], pp[ 7]); - YCbCrtoRGB(cp2[0], pp[ 8]); - YCbCrtoRGB(cp2[1], pp[ 9]); - YCbCrtoRGB(cp2[2], pp[10]); - YCbCrtoRGB(cp2[3], pp[11]); - YCbCrtoRGB(cp3[0], pp[12]); - YCbCrtoRGB(cp3[1], pp[13]); - YCbCrtoRGB(cp3[2], pp[14]); - YCbCrtoRGB(cp3[3], pp[15]); - - cp += 4, cp1 += 4, cp2 += 4, cp3 += 4; - pp += 18; - } while (--x); - cp += incr, cp1 += incr, cp2 += incr, cp3 += incr; - pp += fromskew; - } - } else { - while (h > 0) { - for (x = w; x > 0;) { - int32 Cb = pp[16]; - int32 Cr = pp[17]; - switch (x) { - default: - switch (h) { - default: YCbCrtoRGB(cp3[3], pp[15]); /* FALLTHROUGH */ - case 3: YCbCrtoRGB(cp2[3], pp[11]); /* FALLTHROUGH */ - case 2: YCbCrtoRGB(cp1[3], pp[ 7]); /* FALLTHROUGH */ - case 1: YCbCrtoRGB(cp [3], pp[ 3]); /* FALLTHROUGH */ - } /* FALLTHROUGH */ - case 3: - switch (h) { - default: YCbCrtoRGB(cp3[2], pp[14]); /* FALLTHROUGH */ - case 3: YCbCrtoRGB(cp2[2], pp[10]); /* FALLTHROUGH */ - case 2: YCbCrtoRGB(cp1[2], pp[ 6]); /* FALLTHROUGH */ - case 1: YCbCrtoRGB(cp [2], pp[ 2]); /* FALLTHROUGH */ - } /* FALLTHROUGH */ - case 2: - switch (h) { - default: YCbCrtoRGB(cp3[1], pp[13]); /* FALLTHROUGH */ - case 3: YCbCrtoRGB(cp2[1], pp[ 9]); /* FALLTHROUGH */ - case 2: YCbCrtoRGB(cp1[1], pp[ 5]); /* FALLTHROUGH */ - case 1: YCbCrtoRGB(cp [1], pp[ 1]); /* FALLTHROUGH */ - } /* FALLTHROUGH */ - case 1: - switch (h) { - default: YCbCrtoRGB(cp3[0], pp[12]); /* FALLTHROUGH */ - case 3: YCbCrtoRGB(cp2[0], pp[ 8]); /* FALLTHROUGH */ - case 2: YCbCrtoRGB(cp1[0], pp[ 4]); /* FALLTHROUGH */ - case 1: YCbCrtoRGB(cp [0], pp[ 0]); /* FALLTHROUGH */ - } /* FALLTHROUGH */ - } - if (x < 4) { - cp += x; cp1 += x; cp2 += x; cp3 += x; - x = 0; - } - else { - cp += 4; cp1 += 4; cp2 += 4; cp3 += 4; - x -= 4; - } - pp += 18; - } - if (h <= 4) - break; - h -= 4; - cp += incr, cp1 += incr, cp2 += incr, cp3 += incr; - pp += fromskew; - } - } -} - -/* - * 8-bit packed YCbCr samples w/ 4,2 subsampling => RGB - */ -DECLAREContigPutFunc(putcontig8bitYCbCr42tile) -{ - uint32* cp1 = cp+w+toskew; - int32 incr = 2*toskew+w; - - (void) y; - fromskew = (fromskew * 10) / 4; - if ((h & 3) == 0 && (w & 1) == 0) { - for (; h >= 2; h -= 2) { - x = w>>2; - do { - int32 Cb = pp[8]; - int32 Cr = pp[9]; - - YCbCrtoRGB(cp [0], pp[0]); - YCbCrtoRGB(cp [1], pp[1]); - YCbCrtoRGB(cp [2], pp[2]); - YCbCrtoRGB(cp [3], pp[3]); - YCbCrtoRGB(cp1[0], pp[4]); - YCbCrtoRGB(cp1[1], pp[5]); - YCbCrtoRGB(cp1[2], pp[6]); - YCbCrtoRGB(cp1[3], pp[7]); - - cp += 4, cp1 += 4; - pp += 10; - } while (--x); - cp += incr, cp1 += incr; - pp += fromskew; - } - } else { - while (h > 0) { - for (x = w; x > 0;) { - int32 Cb = pp[8]; - int32 Cr = pp[9]; - switch (x) { - default: - switch (h) { - default: YCbCrtoRGB(cp1[3], pp[ 7]); /* FALLTHROUGH */ - case 1: YCbCrtoRGB(cp [3], pp[ 3]); /* FALLTHROUGH */ - } /* FALLTHROUGH */ - case 3: - switch (h) { - default: YCbCrtoRGB(cp1[2], pp[ 6]); /* FALLTHROUGH */ - case 1: YCbCrtoRGB(cp [2], pp[ 2]); /* FALLTHROUGH */ - } /* FALLTHROUGH */ - case 2: - switch (h) { - default: YCbCrtoRGB(cp1[1], pp[ 5]); /* FALLTHROUGH */ - case 1: YCbCrtoRGB(cp [1], pp[ 1]); /* FALLTHROUGH */ - } /* FALLTHROUGH */ - case 1: - switch (h) { - default: YCbCrtoRGB(cp1[0], pp[ 4]); /* FALLTHROUGH */ - case 1: YCbCrtoRGB(cp [0], pp[ 0]); /* FALLTHROUGH */ - } /* FALLTHROUGH */ - } - if (x < 4) { - cp += x; cp1 += x; - x = 0; - } - else { - cp += 4; cp1 += 4; - x -= 4; - } - pp += 10; - } - if (h <= 2) - break; - h -= 2; - cp += incr, cp1 += incr; - pp += fromskew; - } - } -} - -/* - * 8-bit packed YCbCr samples w/ 4,1 subsampling => RGB - */ -DECLAREContigPutFunc(putcontig8bitYCbCr41tile) -{ - (void) y; - /* XXX adjust fromskew */ - do { - x = w>>2; - do { - int32 Cb = pp[4]; - int32 Cr = pp[5]; - - YCbCrtoRGB(cp [0], pp[0]); - YCbCrtoRGB(cp [1], pp[1]); - YCbCrtoRGB(cp [2], pp[2]); - YCbCrtoRGB(cp [3], pp[3]); - - cp += 4; - pp += 6; - } while (--x); - - if( (w&3) != 0 ) - { - int32 Cb = pp[4]; - int32 Cr = pp[5]; - - switch( (w&3) ) { - case 3: YCbCrtoRGB(cp [2], pp[2]); - case 2: YCbCrtoRGB(cp [1], pp[1]); - case 1: YCbCrtoRGB(cp [0], pp[0]); - case 0: break; - } - - cp += (w&3); - pp += 6; - } - - cp += toskew; - pp += fromskew; - } while (--h); - -} - -/* - * 8-bit packed YCbCr samples w/ 2,2 subsampling => RGB - */ -DECLAREContigPutFunc(putcontig8bitYCbCr22tile) -{ - uint32* cp1 = cp+w+toskew; - int32 incr = 2*toskew+w; - - (void) y; - fromskew = (fromskew * 6) / 2; - if ((h & 1) == 0 && (w & 1) == 0) { - for (; h >= 2; h -= 2) { - x = w>>1; - do { - int32 Cb = pp[4]; - int32 Cr = pp[5]; - - YCbCrtoRGB(cp [0], pp[0]); - YCbCrtoRGB(cp [1], pp[1]); - YCbCrtoRGB(cp1[0], pp[2]); - YCbCrtoRGB(cp1[1], pp[3]); - - cp += 2, cp1 += 2; - pp += 6; - } while (--x); - cp += incr, cp1 += incr; - pp += fromskew; - } - } else { - while (h > 0) { - for (x = w; x > 0;) { - int32 Cb = pp[4]; - int32 Cr = pp[5]; - switch (x) { - default: - switch (h) { - default: YCbCrtoRGB(cp1[1], pp[ 3]); /* FALLTHROUGH */ - case 1: YCbCrtoRGB(cp [1], pp[ 1]); /* FALLTHROUGH */ - } /* FALLTHROUGH */ - case 1: - switch (h) { - default: YCbCrtoRGB(cp1[0], pp[ 2]); /* FALLTHROUGH */ - case 1: YCbCrtoRGB(cp [0], pp[ 0]); /* FALLTHROUGH */ - } /* FALLTHROUGH */ - } - if (x < 2) { - cp += x; cp1 += x; - x = 0; - } - else { - cp += 2; cp1 += 2; - x -= 2; - } - pp += 6; - } - if (h <= 2) - break; - h -= 2; - cp += incr, cp1 += incr; - pp += fromskew; - } - } -} - -/* - * 8-bit packed YCbCr samples w/ 2,1 subsampling => RGB - */ -DECLAREContigPutFunc(putcontig8bitYCbCr21tile) -{ - (void) y; - fromskew = (fromskew * 4) / 2; - do { - x = w>>1; - do { - int32 Cb = pp[2]; - int32 Cr = pp[3]; - - YCbCrtoRGB(cp[0], pp[0]); - YCbCrtoRGB(cp[1], pp[1]); - - cp += 2; - pp += 4; - } while (--x); - - if( (w&1) != 0 ) - { - int32 Cb = pp[2]; - int32 Cr = pp[3]; - - YCbCrtoRGB(cp [0], pp[0]); - - cp += 1; - pp += 4; - } - - cp += toskew; - pp += fromskew; - } while (--h); -} - -/* - * 8-bit packed YCbCr samples w/ no subsampling => RGB - */ -DECLAREContigPutFunc(putcontig8bitYCbCr11tile) -{ - (void) y; - fromskew *= 3; - do { - x = w; /* was x = w>>1; patched 2000/09/25 warmerda@home.com */ - do { - int32 Cb = pp[1]; - int32 Cr = pp[2]; - - YCbCrtoRGB(*cp++, pp[0]); - - pp += 3; - } while (--x); - cp += toskew; - pp += fromskew; - } while (--h); -} -#undef YCbCrtoRGB - -static tileContigRoutine -initYCbCrConversion(TIFFRGBAImage* img) -{ - static char module[] = "initCIELabConversion"; - - float *luma, *refBlackWhite; - uint16 hs, vs; - - if (img->ycbcr == NULL) { - img->ycbcr = (TIFFYCbCrToRGB*) _TIFFmalloc( - TIFFroundup(sizeof (TIFFYCbCrToRGB), sizeof (long)) - + 4*256*sizeof (TIFFRGBValue) - + 2*256*sizeof (int) - + 3*256*sizeof (int32) - ); - if (img->ycbcr == NULL) { - TIFFError(module, - "No space for YCbCr->RGB conversion state"); - return (NULL); - } - } - - TIFFGetFieldDefaulted(img->tif, TIFFTAG_YCBCRCOEFFICIENTS, &luma); - TIFFGetFieldDefaulted(img->tif, TIFFTAG_REFERENCEBLACKWHITE, - &refBlackWhite); - if (TIFFYCbCrToRGBInit(img->ycbcr, luma, refBlackWhite) < 0) - return NULL; - - /* - * The 6.0 spec says that subsampling must be - * one of 1, 2, or 4, and that vertical subsampling - * must always be <= horizontal subsampling; so - * there are only a few possibilities and we just - * enumerate the cases. - */ - TIFFGetFieldDefaulted(img->tif, TIFFTAG_YCBCRSUBSAMPLING, &hs, &vs); - switch ((hs<<4)|vs) { - case 0x44: return (&putcontig8bitYCbCr44tile); - case 0x42: return (&putcontig8bitYCbCr42tile); - case 0x41: return (&putcontig8bitYCbCr41tile); - case 0x22: return (&putcontig8bitYCbCr22tile); - case 0x21: return (&putcontig8bitYCbCr21tile); - case 0x11: return (&putcontig8bitYCbCr11tile); - } - - return (NULL); -} - -static tileContigRoutine -initCIELabConversion(TIFFRGBAImage* img) -{ - static char module[] = "initCIELabConversion"; - - float *whitePoint; - float refWhite[3]; - - if (!img->cielab) { - img->cielab = (TIFFCIELabToRGB *) - _TIFFmalloc(sizeof(TIFFCIELabToRGB)); - if (!img->cielab) { - TIFFError(module, - "No space for CIE L*a*b*->RGB conversion state."); - return NULL; - } - } - - TIFFGetFieldDefaulted(img->tif, TIFFTAG_WHITEPOINT, &whitePoint); - refWhite[1] = 100.0F; - refWhite[0] = whitePoint[0] / whitePoint[1] * refWhite[1]; - refWhite[2] = (1.0F - whitePoint[0] - whitePoint[1]) - / whitePoint[1] * refWhite[1]; - if (TIFFCIELabToRGBInit(img->cielab, &display_sRGB, refWhite) < 0) { - TIFFError(module, - "Failed to initialize CIE L*a*b*->RGB conversion state."); - _TIFFfree(img->cielab); - return NULL; - } - - return &putcontig8bitCIELab; -} - -/* - * Greyscale images with less than 8 bits/sample are handled - * with a table to avoid lots of shifts and masks. The table - * is setup so that put*bwtile (below) can retrieve 8/bitspersample - * pixel values simply by indexing into the table with one - * number. - */ -static int -makebwmap(TIFFRGBAImage* img) -{ - TIFFRGBValue* Map = img->Map; - int bitspersample = img->bitspersample; - int nsamples = 8 / bitspersample; - int i; - uint32* p; - - if( nsamples == 0 ) - nsamples = 1; - - img->BWmap = (uint32**) _TIFFmalloc( - 256*sizeof (uint32 *)+(256*nsamples*sizeof(uint32))); - if (img->BWmap == NULL) { - TIFFError(TIFFFileName(img->tif), "No space for B&W mapping table"); - return (0); - } - p = (uint32*)(img->BWmap + 256); - for (i = 0; i < 256; i++) { - TIFFRGBValue c; - img->BWmap[i] = p; - switch (bitspersample) { -#define GREY(x) c = Map[x]; *p++ = PACK(c,c,c); - case 1: - GREY(i>>7); - GREY((i>>6)&1); - GREY((i>>5)&1); - GREY((i>>4)&1); - GREY((i>>3)&1); - GREY((i>>2)&1); - GREY((i>>1)&1); - GREY(i&1); - break; - case 2: - GREY(i>>6); - GREY((i>>4)&3); - GREY((i>>2)&3); - GREY(i&3); - break; - case 4: - GREY(i>>4); - GREY(i&0xf); - break; - case 8: - case 16: - GREY(i); - break; - } -#undef GREY - } - return (1); -} - -/* - * Construct a mapping table to convert from the range - * of the data samples to [0,255] --for display. This - * process also handles inverting B&W images when needed. - */ -static int -setupMap(TIFFRGBAImage* img) -{ - int32 x, range; - - range = (int32)((1L<bitspersample)-1); - - /* treat 16 bit the same as eight bit */ - if( img->bitspersample == 16 ) - range = (int32) 255; - - img->Map = (TIFFRGBValue*) _TIFFmalloc((range+1) * sizeof (TIFFRGBValue)); - if (img->Map == NULL) { - TIFFError(TIFFFileName(img->tif), - "No space for photometric conversion table"); - return (0); - } - if (img->photometric == PHOTOMETRIC_MINISWHITE) { - for (x = 0; x <= range; x++) - img->Map[x] = (TIFFRGBValue) (((range - x) * 255) / range); - } else { - for (x = 0; x <= range; x++) - img->Map[x] = (TIFFRGBValue) ((x * 255) / range); - } - if (img->bitspersample <= 16 && - (img->photometric == PHOTOMETRIC_MINISBLACK || - img->photometric == PHOTOMETRIC_MINISWHITE)) { - /* - * Use photometric mapping table to construct - * unpacking tables for samples <= 8 bits. - */ - if (!makebwmap(img)) - return (0); - /* no longer need Map, free it */ - _TIFFfree(img->Map), img->Map = NULL; - } - return (1); -} - -static int -checkcmap(TIFFRGBAImage* img) -{ - uint16* r = img->redcmap; - uint16* g = img->greencmap; - uint16* b = img->bluecmap; - long n = 1L<bitspersample; - - while (n-- > 0) - if (*r++ >= 256 || *g++ >= 256 || *b++ >= 256) - return (16); - return (8); -} - -static void -cvtcmap(TIFFRGBAImage* img) -{ - uint16* r = img->redcmap; - uint16* g = img->greencmap; - uint16* b = img->bluecmap; - long i; - - for (i = (1L<bitspersample)-1; i >= 0; i--) { -#define CVT(x) ((uint16)((x)>>8)) - r[i] = CVT(r[i]); - g[i] = CVT(g[i]); - b[i] = CVT(b[i]); -#undef CVT - } -} - -/* - * Palette images with <= 8 bits/sample are handled - * with a table to avoid lots of shifts and masks. The table - * is setup so that put*cmaptile (below) can retrieve 8/bitspersample - * pixel values simply by indexing into the table with one - * number. - */ -static int -makecmap(TIFFRGBAImage* img) -{ - int bitspersample = img->bitspersample; - int nsamples = 8 / bitspersample; - uint16* r = img->redcmap; - uint16* g = img->greencmap; - uint16* b = img->bluecmap; - uint32 *p; - int i; - - img->PALmap = (uint32**) _TIFFmalloc( - 256*sizeof (uint32 *)+(256*nsamples*sizeof(uint32))); - if (img->PALmap == NULL) { - TIFFError(TIFFFileName(img->tif), "No space for Palette mapping table"); - return (0); - } - p = (uint32*)(img->PALmap + 256); - for (i = 0; i < 256; i++) { - TIFFRGBValue c; - img->PALmap[i] = p; -#define CMAP(x) c = (TIFFRGBValue) x; *p++ = PACK(r[c]&0xff, g[c]&0xff, b[c]&0xff); - switch (bitspersample) { - case 1: - CMAP(i>>7); - CMAP((i>>6)&1); - CMAP((i>>5)&1); - CMAP((i>>4)&1); - CMAP((i>>3)&1); - CMAP((i>>2)&1); - CMAP((i>>1)&1); - CMAP(i&1); - break; - case 2: - CMAP(i>>6); - CMAP((i>>4)&3); - CMAP((i>>2)&3); - CMAP(i&3); - break; - case 4: - CMAP(i>>4); - CMAP(i&0xf); - break; - case 8: - CMAP(i); - break; - } -#undef CMAP - } - return (1); -} - -/* - * Construct any mapping table used - * by the associated put routine. - */ -static int -buildMap(TIFFRGBAImage* img) -{ - switch (img->photometric) { - case PHOTOMETRIC_RGB: - case PHOTOMETRIC_YCBCR: - case PHOTOMETRIC_SEPARATED: - if (img->bitspersample == 8) - break; - /* fall thru... */ - case PHOTOMETRIC_MINISBLACK: - case PHOTOMETRIC_MINISWHITE: - if (!setupMap(img)) - return (0); - break; - case PHOTOMETRIC_PALETTE: - /* - * Convert 16-bit colormap to 8-bit (unless it looks - * like an old-style 8-bit colormap). - */ - if (checkcmap(img) == 16) - cvtcmap(img); - else - TIFFWarning(TIFFFileName(img->tif), "Assuming 8-bit colormap"); - /* - * Use mapping table and colormap to construct - * unpacking tables for samples < 8 bits. - */ - if (img->bitspersample <= 8 && !makecmap(img)) - return (0); - break; - } - return (1); -} - -/* - * Select the appropriate conversion routine for packed data. - */ -static int -pickTileContigCase(TIFFRGBAImage* img) -{ - tileContigRoutine put = 0; - - if (buildMap(img)) { - switch (img->photometric) { - case PHOTOMETRIC_RGB: - switch (img->bitspersample) { - case 8: - if (!img->Map) { - if (img->alpha == EXTRASAMPLE_ASSOCALPHA) - put = putRGBAAcontig8bittile; - else if (img->alpha == EXTRASAMPLE_UNASSALPHA) - put = putRGBUAcontig8bittile; - else - put = putRGBcontig8bittile; - } else - put = putRGBcontig8bitMaptile; - break; - case 16: - put = putRGBcontig16bittile; - if (!img->Map) { - if (img->alpha == EXTRASAMPLE_ASSOCALPHA) - put = putRGBAAcontig16bittile; - else if (img->alpha == EXTRASAMPLE_UNASSALPHA) - put = putRGBUAcontig16bittile; - } - break; - } - break; - case PHOTOMETRIC_SEPARATED: - if (img->bitspersample == 8) { - if (!img->Map) - put = putRGBcontig8bitCMYKtile; - else - put = putRGBcontig8bitCMYKMaptile; - } - break; - case PHOTOMETRIC_PALETTE: - switch (img->bitspersample) { - case 8: put = put8bitcmaptile; break; - case 4: put = put4bitcmaptile; break; - case 2: put = put2bitcmaptile; break; - case 1: put = put1bitcmaptile; break; - } - break; - case PHOTOMETRIC_MINISWHITE: - case PHOTOMETRIC_MINISBLACK: - switch (img->bitspersample) { - case 16: put = put16bitbwtile; break; - case 8: put = putgreytile; break; - case 4: put = put4bitbwtile; break; - case 2: put = put2bitbwtile; break; - case 1: put = put1bitbwtile; break; - } - break; - case PHOTOMETRIC_YCBCR: - if (img->bitspersample == 8) - put = initYCbCrConversion(img); - break; - case PHOTOMETRIC_CIELAB: - if (img->bitspersample == 8) - put = initCIELabConversion(img); - break; - } - } - return ((img->put.contig = put) != 0); -} - -/* - * Select the appropriate conversion routine for unpacked data. - * - * NB: we assume that unpacked single channel data is directed - * to the "packed routines. - */ -static int -pickTileSeparateCase(TIFFRGBAImage* img) -{ - tileSeparateRoutine put = 0; - - if (buildMap(img)) { - switch (img->photometric) { - case PHOTOMETRIC_RGB: - switch (img->bitspersample) { - case 8: - if (!img->Map) { - if (img->alpha == EXTRASAMPLE_ASSOCALPHA) - put = putRGBAAseparate8bittile; - else if (img->alpha == EXTRASAMPLE_UNASSALPHA) - put = putRGBUAseparate8bittile; - else - put = putRGBseparate8bittile; - } else - put = putRGBseparate8bitMaptile; - break; - case 16: - put = putRGBseparate16bittile; - if (!img->Map) { - if (img->alpha == EXTRASAMPLE_ASSOCALPHA) - put = putRGBAAseparate16bittile; - else if (img->alpha == EXTRASAMPLE_UNASSALPHA) - put = putRGBUAseparate16bittile; - } - break; - } - break; - } - } - return ((img->put.separate = put) != 0); -} - -/* - * Read a whole strip off data from the file, and convert to RGBA form. - * If this is the last strip, then it will only contain the portion of - * the strip that is actually within the image space. The result is - * organized in bottom to top form. - */ - - -int -TIFFReadRGBAStrip(TIFF* tif, uint32 row, uint32 * raster ) - -{ - char emsg[1024]; - TIFFRGBAImage img; - int ok; - uint32 rowsperstrip, rows_to_read; - - if( TIFFIsTiled( tif ) ) - { - TIFFError(TIFFFileName(tif), - "Can't use TIFFReadRGBAStrip() with tiled file."); - return (0); - } - - TIFFGetFieldDefaulted(tif, TIFFTAG_ROWSPERSTRIP, &rowsperstrip); - if( (row % rowsperstrip) != 0 ) - { - TIFFError(TIFFFileName(tif), - "Row passed to TIFFReadRGBAStrip() must be first in a strip."); - return (0); - } - - if (TIFFRGBAImageOK(tif, emsg) && TIFFRGBAImageBegin(&img, tif, 0, emsg)) { - - img.row_offset = row; - img.col_offset = 0; - - if( row + rowsperstrip > img.height ) - rows_to_read = img.height - row; - else - rows_to_read = rowsperstrip; - - ok = TIFFRGBAImageGet(&img, raster, img.width, rows_to_read ); - - TIFFRGBAImageEnd(&img); - } else { - TIFFError(TIFFFileName(tif), emsg); - ok = 0; - } - - return (ok); -} - -/* - * Read a whole tile off data from the file, and convert to RGBA form. - * The returned RGBA data is organized from bottom to top of tile, - * and may include zeroed areas if the tile extends off the image. - */ - -int -TIFFReadRGBATile(TIFF* tif, uint32 col, uint32 row, uint32 * raster) - -{ - char emsg[1024]; - TIFFRGBAImage img; - int ok; - uint32 tile_xsize, tile_ysize; - uint32 read_xsize, read_ysize; - uint32 i_row; - - /* - * Verify that our request is legal - on a tile file, and on a - * tile boundary. - */ - - if( !TIFFIsTiled( tif ) ) - { - TIFFError(TIFFFileName(tif), - "Can't use TIFFReadRGBATile() with stripped file."); - return (0); - } - - TIFFGetFieldDefaulted(tif, TIFFTAG_TILEWIDTH, &tile_xsize); - TIFFGetFieldDefaulted(tif, TIFFTAG_TILELENGTH, &tile_ysize); - if( (col % tile_xsize) != 0 || (row % tile_ysize) != 0 ) - { - TIFFError(TIFFFileName(tif), - "Row/col passed to TIFFReadRGBATile() must be top" - "left corner of a tile."); - return (0); - } - - /* - * Setup the RGBA reader. - */ - - if (!TIFFRGBAImageOK(tif, emsg) - || !TIFFRGBAImageBegin(&img, tif, 0, emsg)) { - TIFFError(TIFFFileName(tif), emsg); - return( 0 ); - } - - /* - * The TIFFRGBAImageGet() function doesn't allow us to get off the - * edge of the image, even to fill an otherwise valid tile. So we - * figure out how much we can read, and fix up the tile buffer to - * a full tile configuration afterwards. - */ - - if( row + tile_ysize > img.height ) - read_ysize = img.height - row; - else - read_ysize = tile_ysize; - - if( col + tile_xsize > img.width ) - read_xsize = img.width - col; - else - read_xsize = tile_xsize; - - /* - * Read the chunk of imagery. - */ - - img.row_offset = row; - img.col_offset = col; - - ok = TIFFRGBAImageGet(&img, raster, read_xsize, read_ysize ); - - TIFFRGBAImageEnd(&img); - - /* - * If our read was incomplete we will need to fix up the tile by - * shifting the data around as if a full tile of data is being returned. - * - * This is all the more complicated because the image is organized in - * bottom to top format. - */ - - if( read_xsize == tile_xsize && read_ysize == tile_ysize ) - return( ok ); - - for( i_row = 0; i_row < read_ysize; i_row++ ) { - memmove( raster + (tile_ysize - i_row - 1) * tile_xsize, - raster + (read_ysize - i_row - 1) * read_xsize, - read_xsize * sizeof(uint32) ); - _TIFFmemset( raster + (tile_ysize - i_row - 1) * tile_xsize+read_xsize, - 0, sizeof(uint32) * (tile_xsize - read_xsize) ); - } - - for( i_row = read_ysize; i_row < tile_ysize; i_row++ ) { - _TIFFmemset( raster + (tile_ysize - i_row - 1) * tile_xsize, - 0, sizeof(uint32) * tile_xsize ); - } - - return (ok); -} diff --git a/wxWidgets/src/tiff/tif_jpeg.c b/wxWidgets/src/tiff/tif_jpeg.c deleted file mode 100644 index 3ee97b90d7..0000000000 --- a/wxWidgets/src/tiff/tif_jpeg.c +++ /dev/null @@ -1,1673 +0,0 @@ -/* $Header$ */ - -/* - * Copyright (c) 1994-1997 Sam Leffler - * Copyright (c) 1994-1997 Silicon Graphics, Inc. - * - * Permission to use, copy, modify, distribute, and sell this software and - * its documentation for any purpose is hereby granted without fee, provided - * that (i) the above copyright notices and this permission notice appear in - * all copies of the software and related documentation, and (ii) the names of - * Sam Leffler and Silicon Graphics may not be used in any advertising or - * publicity relating to the software without the specific, prior written - * permission of Sam Leffler and Silicon Graphics. - * - * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, - * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * - * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR - * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, - * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF - * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE - * OF THIS SOFTWARE. - */ - -#include "tiffiop.h" -#ifdef JPEG_SUPPORT -/* - * TIFF Library - * - * JPEG Compression support per TIFF Technical Note #2 - * (*not* per the original TIFF 6.0 spec). - * - * This file is simply an interface to the libjpeg library written by - * the Independent JPEG Group. You need release 5 or later of the IJG - * code, which you can find on the Internet at ftp.uu.net:/graphics/jpeg/. - * - * Contributed by Tom Lane . - */ -#include -#include -#include - -int TIFFFillStrip(TIFF*, tstrip_t); -int TIFFFillTile(TIFF*, ttile_t); - -/* We undefine FAR to avoid conflict with JPEG definition */ - -#ifdef FAR -#undef FAR -#endif - -/* - The windows RPCNDR.H file defines boolean, but defines it with the - wrong size. So we declare HAVE_BOOLEAN so that the jpeg include file - won't try to typedef boolean, but #define it to override the rpcndr.h - definition. - - http://bugzilla.remotesensing.org/show_bug.cgi?id=188 -*/ -#ifdef wxHACK_BOOLEAN - #include "wx/defs.h" - #define XMD_H - #define HAVE_BOOLEAN - #define boolean wxHACK_BOOLEAN -#endif - -#include "jpeglib.h" -#include "jerror.h" - -#ifndef HAVE_WXJPEG_BOOLEAN -typedef boolean wxjpeg_boolean; -#endif - -/* - * On some machines it may be worthwhile to use _setjmp or sigsetjmp - * in place of plain setjmp. These macros will make it easier. - */ -#define SETJMP(jbuf) setjmp(jbuf) -#define LONGJMP(jbuf,code) longjmp(jbuf,code) -#define JMP_BUF jmp_buf - -typedef struct jpeg_destination_mgr jpeg_destination_mgr; -typedef struct jpeg_source_mgr jpeg_source_mgr; -typedef struct jpeg_error_mgr jpeg_error_mgr; - -/* - * State block for each open TIFF file using - * libjpeg to do JPEG compression/decompression. - * - * libjpeg's visible state is either a jpeg_compress_struct - * or jpeg_decompress_struct depending on which way we - * are going. comm can be used to refer to the fields - * which are common to both. - * - * NB: cinfo is required to be the first member of JPEGState, - * so we can safely cast JPEGState* -> jpeg_xxx_struct* - * and vice versa! - */ -typedef struct { - union { - struct jpeg_compress_struct c; - struct jpeg_decompress_struct d; - struct jpeg_common_struct comm; - } cinfo; /* NB: must be first */ - int cinfo_initialized; - - jpeg_error_mgr err; /* libjpeg error manager */ - JMP_BUF exit_jmpbuf; /* for catching libjpeg failures */ - /* - * The following two members could be a union, but - * they're small enough that it's not worth the effort. - */ - jpeg_destination_mgr dest; /* data dest for compression */ - jpeg_source_mgr src; /* data source for decompression */ - /* private state */ - TIFF* tif; /* back link needed by some code */ - uint16 photometric; /* copy of PhotometricInterpretation */ - uint16 h_sampling; /* luminance sampling factors */ - uint16 v_sampling; - tsize_t bytesperline; /* decompressed bytes per scanline */ - /* pointers to intermediate buffers when processing downsampled data */ - JSAMPARRAY ds_buffer[MAX_COMPONENTS]; - int scancount; /* number of "scanlines" accumulated */ - int samplesperclump; - - TIFFVGetMethod vgetparent; /* super-class method */ - TIFFVSetMethod vsetparent; /* super-class method */ - TIFFStripMethod defsparent; /* super-class method */ - TIFFTileMethod deftparent; /* super-class method */ - /* pseudo-tag fields */ - void* jpegtables; /* JPEGTables tag value, or NULL */ - uint32 jpegtables_length; /* number of bytes in same */ - int jpegquality; /* Compression quality level */ - int jpegcolormode; /* Auto RGB<=>YCbCr convert? */ - int jpegtablesmode; /* What to put in JPEGTables */ - - int ycbcrsampling_fetched; -} JPEGState; - -#define JState(tif) ((JPEGState*)(tif)->tif_data) - -static int JPEGDecode(TIFF*, tidata_t, tsize_t, tsample_t); -static int JPEGDecodeRaw(TIFF*, tidata_t, tsize_t, tsample_t); -static int JPEGEncode(TIFF*, tidata_t, tsize_t, tsample_t); -static int JPEGEncodeRaw(TIFF*, tidata_t, tsize_t, tsample_t); -static int JPEGInitializeLibJPEG( TIFF * tif ); - -#define FIELD_JPEGTABLES (FIELD_CODEC+0) - -static const TIFFFieldInfo jpegFieldInfo[] = { - { TIFFTAG_JPEGTABLES, -1,-1, TIFF_UNDEFINED, FIELD_JPEGTABLES, - FALSE, TRUE, "JPEGTables" }, - { TIFFTAG_JPEGQUALITY, 0, 0, TIFF_ANY, FIELD_PSEUDO, - TRUE, FALSE, "" }, - { TIFFTAG_JPEGCOLORMODE, 0, 0, TIFF_ANY, FIELD_PSEUDO, - FALSE, FALSE, "" }, - { TIFFTAG_JPEGTABLESMODE, 0, 0, TIFF_ANY, FIELD_PSEUDO, - FALSE, FALSE, "" }, -}; -#define N(a) (sizeof (a) / sizeof (a[0])) - -/* - * libjpeg interface layer. - * - * We use setjmp/longjmp to return control to libtiff - * when a fatal error is encountered within the JPEG - * library. We also direct libjpeg error and warning - * messages through the appropriate libtiff handlers. - */ - -/* - * Error handling routines (these replace corresponding - * IJG routines from jerror.c). These are used for both - * compression and decompression. - */ -static void -TIFFjpeg_error_exit(j_common_ptr cinfo) -{ - JPEGState *sp = (JPEGState *) cinfo; /* NB: cinfo assumed first */ - char buffer[JMSG_LENGTH_MAX]; - - (*cinfo->err->format_message) (cinfo, buffer); - TIFFError("JPEGLib", buffer); /* display the error message */ - jpeg_abort(cinfo); /* clean up libjpeg state */ - LONGJMP(sp->exit_jmpbuf, 1); /* return to libtiff caller */ -} - -/* - * This routine is invoked only for warning messages, - * since error_exit does its own thing and trace_level - * is never set > 0. - */ -static void -TIFFjpeg_output_message(j_common_ptr cinfo) -{ - char buffer[JMSG_LENGTH_MAX]; - - (*cinfo->err->format_message) (cinfo, buffer); - TIFFWarning("JPEGLib", buffer); -} - -/* - * Interface routines. This layer of routines exists - * primarily to limit side-effects from using setjmp. - * Also, normal/error returns are converted into return - * values per libtiff practice. - */ -#define CALLJPEG(sp, fail, op) (SETJMP((sp)->exit_jmpbuf) ? (fail) : (op)) -#define CALLVJPEG(sp, op) CALLJPEG(sp, 0, ((op),1)) - -static int -TIFFjpeg_create_compress(JPEGState* sp) -{ - /* initialize JPEG error handling */ - sp->cinfo.c.err = jpeg_std_error(&sp->err); - sp->err.error_exit = TIFFjpeg_error_exit; - sp->err.output_message = TIFFjpeg_output_message; - - return CALLVJPEG(sp, jpeg_create_compress(&sp->cinfo.c)); -} - -static int -TIFFjpeg_create_decompress(JPEGState* sp) -{ - /* initialize JPEG error handling */ - sp->cinfo.d.err = jpeg_std_error(&sp->err); - sp->err.error_exit = TIFFjpeg_error_exit; - sp->err.output_message = TIFFjpeg_output_message; - - return CALLVJPEG(sp, jpeg_create_decompress(&sp->cinfo.d)); -} - -static int -TIFFjpeg_set_defaults(JPEGState* sp) -{ - return CALLVJPEG(sp, jpeg_set_defaults(&sp->cinfo.c)); -} - -static int -TIFFjpeg_set_colorspace(JPEGState* sp, J_COLOR_SPACE colorspace) -{ - return CALLVJPEG(sp, jpeg_set_colorspace(&sp->cinfo.c, colorspace)); -} - -static int -TIFFjpeg_set_quality(JPEGState* sp, int quality, wxjpeg_boolean force_baseline) -{ - return CALLVJPEG(sp, - jpeg_set_quality(&sp->cinfo.c, quality, force_baseline)); -} - -static int -TIFFjpeg_suppress_tables(JPEGState* sp, wxjpeg_boolean suppress) -{ - return CALLVJPEG(sp, jpeg_suppress_tables(&sp->cinfo.c, suppress)); -} - -static int -TIFFjpeg_start_compress(JPEGState* sp, wxjpeg_boolean write_all_tables) -{ - return CALLVJPEG(sp, - jpeg_start_compress(&sp->cinfo.c, write_all_tables)); -} - -static int -TIFFjpeg_write_scanlines(JPEGState* sp, JSAMPARRAY scanlines, int num_lines) -{ - return CALLJPEG(sp, -1, (int) jpeg_write_scanlines(&sp->cinfo.c, - scanlines, (JDIMENSION) num_lines)); -} - -static int -TIFFjpeg_write_raw_data(JPEGState* sp, JSAMPIMAGE data, int num_lines) -{ - return CALLJPEG(sp, -1, (int) jpeg_write_raw_data(&sp->cinfo.c, - data, (JDIMENSION) num_lines)); -} - -static int -TIFFjpeg_finish_compress(JPEGState* sp) -{ - return CALLVJPEG(sp, jpeg_finish_compress(&sp->cinfo.c)); -} - -static int -TIFFjpeg_write_tables(JPEGState* sp) -{ - return CALLVJPEG(sp, jpeg_write_tables(&sp->cinfo.c)); -} - -static int -TIFFjpeg_read_header(JPEGState* sp, wxjpeg_boolean require_image) -{ - return CALLJPEG(sp, -1, jpeg_read_header(&sp->cinfo.d, require_image)); -} - -static int -TIFFjpeg_start_decompress(JPEGState* sp) -{ - return CALLVJPEG(sp, jpeg_start_decompress(&sp->cinfo.d)); -} - -static int -TIFFjpeg_read_scanlines(JPEGState* sp, JSAMPARRAY scanlines, int max_lines) -{ - return CALLJPEG(sp, -1, (int) jpeg_read_scanlines(&sp->cinfo.d, - scanlines, (JDIMENSION) max_lines)); -} - -static int -TIFFjpeg_read_raw_data(JPEGState* sp, JSAMPIMAGE data, int max_lines) -{ - return CALLJPEG(sp, -1, (int) jpeg_read_raw_data(&sp->cinfo.d, - data, (JDIMENSION) max_lines)); -} - -static int -TIFFjpeg_finish_decompress(JPEGState* sp) -{ - return CALLJPEG(sp, -1, (int) jpeg_finish_decompress(&sp->cinfo.d)); -} - -static int -TIFFjpeg_abort(JPEGState* sp) -{ - return CALLVJPEG(sp, jpeg_abort(&sp->cinfo.comm)); -} - -static int -TIFFjpeg_destroy(JPEGState* sp) -{ - return CALLVJPEG(sp, jpeg_destroy(&sp->cinfo.comm)); -} - -static JSAMPARRAY -TIFFjpeg_alloc_sarray(JPEGState* sp, int pool_id, - JDIMENSION samplesperrow, JDIMENSION numrows) -{ - return CALLJPEG(sp, (JSAMPARRAY) NULL, - (*sp->cinfo.comm.mem->alloc_sarray) - (&sp->cinfo.comm, pool_id, samplesperrow, numrows)); -} - -/* - * JPEG library destination data manager. - * These routines direct compressed data from libjpeg into the - * libtiff output buffer. - */ - -static void -std_init_destination(j_compress_ptr cinfo) -{ - JPEGState* sp = (JPEGState*) cinfo; - TIFF* tif = sp->tif; - - sp->dest.next_output_byte = (JOCTET*) tif->tif_rawdata; - sp->dest.free_in_buffer = (size_t) tif->tif_rawdatasize; -} - -static wxjpeg_boolean -std_empty_output_buffer(j_compress_ptr cinfo) -{ - JPEGState* sp = (JPEGState*) cinfo; - TIFF* tif = sp->tif; - - /* the entire buffer has been filled */ - tif->tif_rawcc = tif->tif_rawdatasize; - TIFFFlushData1(tif); - sp->dest.next_output_byte = (JOCTET*) tif->tif_rawdata; - sp->dest.free_in_buffer = (size_t) tif->tif_rawdatasize; - - return (TRUE); -} - -static void -std_term_destination(j_compress_ptr cinfo) -{ - JPEGState* sp = (JPEGState*) cinfo; - TIFF* tif = sp->tif; - - tif->tif_rawcp = (tidata_t) sp->dest.next_output_byte; - tif->tif_rawcc = - tif->tif_rawdatasize - (tsize_t) sp->dest.free_in_buffer; - /* NB: libtiff does the final buffer flush */ -} - -static void -TIFFjpeg_data_dest(JPEGState* sp, TIFF* tif) -{ - (void) tif; - sp->cinfo.c.dest = &sp->dest; - sp->dest.init_destination = std_init_destination; - sp->dest.empty_output_buffer = std_empty_output_buffer; - sp->dest.term_destination = std_term_destination; -} - -/* - * Alternate destination manager for outputting to JPEGTables field. - */ - -static void -tables_init_destination(j_compress_ptr cinfo) -{ - JPEGState* sp = (JPEGState*) cinfo; - - /* while building, jpegtables_length is allocated buffer size */ - sp->dest.next_output_byte = (JOCTET*) sp->jpegtables; - sp->dest.free_in_buffer = (size_t) sp->jpegtables_length; -} - -static wxjpeg_boolean -tables_empty_output_buffer(j_compress_ptr cinfo) -{ - JPEGState* sp = (JPEGState*) cinfo; - void* newbuf; - - /* the entire buffer has been filled; enlarge it by 1000 bytes */ - newbuf = _TIFFrealloc((tdata_t) sp->jpegtables, - (tsize_t) (sp->jpegtables_length + 1000)); - if (newbuf == NULL) - ERREXIT1(cinfo, JERR_OUT_OF_MEMORY, 100); - sp->dest.next_output_byte = (JOCTET*) newbuf + sp->jpegtables_length; - sp->dest.free_in_buffer = (size_t) 1000; - sp->jpegtables = newbuf; - sp->jpegtables_length += 1000; - return (TRUE); -} - -static void -tables_term_destination(j_compress_ptr cinfo) -{ - JPEGState* sp = (JPEGState*) cinfo; - - /* set tables length to number of bytes actually emitted */ - sp->jpegtables_length -= sp->dest.free_in_buffer; -} - -static int -TIFFjpeg_tables_dest(JPEGState* sp, TIFF* tif) -{ - (void) tif; - /* - * Allocate a working buffer for building tables. - * Initial size is 1000 bytes, which is usually adequate. - */ - if (sp->jpegtables) - _TIFFfree(sp->jpegtables); - sp->jpegtables_length = 1000; - sp->jpegtables = (void*) _TIFFmalloc((tsize_t) sp->jpegtables_length); - if (sp->jpegtables == NULL) { - sp->jpegtables_length = 0; - TIFFError("TIFFjpeg_tables_dest", "No space for JPEGTables"); - return (0); - } - sp->cinfo.c.dest = &sp->dest; - sp->dest.init_destination = tables_init_destination; - sp->dest.empty_output_buffer = tables_empty_output_buffer; - sp->dest.term_destination = tables_term_destination; - return (1); -} - -/* - * JPEG library source data manager. - * These routines supply compressed data to libjpeg. - */ - -static void -std_init_source(j_decompress_ptr cinfo) -{ - JPEGState* sp = (JPEGState*) cinfo; - TIFF* tif = sp->tif; - - sp->src.next_input_byte = (const JOCTET*) tif->tif_rawdata; - sp->src.bytes_in_buffer = (size_t) tif->tif_rawcc; -} - -static wxjpeg_boolean -std_fill_input_buffer(j_decompress_ptr cinfo) -{ - JPEGState* sp = (JPEGState* ) cinfo; - static const JOCTET dummy_EOI[2] = { 0xFF, JPEG_EOI }; - - /* - * Should never get here since entire strip/tile is - * read into memory before the decompressor is called, - * and thus was supplied by init_source. - */ - WARNMS(cinfo, JWRN_JPEG_EOF); - /* insert a fake EOI marker */ - sp->src.next_input_byte = dummy_EOI; - sp->src.bytes_in_buffer = 2; - return (TRUE); -} - -static void -std_skip_input_data(j_decompress_ptr cinfo, long num_bytes) -{ - JPEGState* sp = (JPEGState*) cinfo; - - if (num_bytes > 0) { - if (num_bytes > (long) sp->src.bytes_in_buffer) { - /* oops, buffer overrun */ - (void) std_fill_input_buffer(cinfo); - } else { - sp->src.next_input_byte += (size_t) num_bytes; - sp->src.bytes_in_buffer -= (size_t) num_bytes; - } - } -} - -static void -std_term_source(j_decompress_ptr cinfo) -{ - /* No work necessary here */ - /* Or must we update tif->tif_rawcp, tif->tif_rawcc ??? */ - /* (if so, need empty tables_term_source!) */ - (void) cinfo; -} - -static void -TIFFjpeg_data_src(JPEGState* sp, TIFF* tif) -{ - (void) tif; - sp->cinfo.d.src = &sp->src; - sp->src.init_source = std_init_source; - sp->src.fill_input_buffer = std_fill_input_buffer; - sp->src.skip_input_data = std_skip_input_data; - sp->src.resync_to_restart = jpeg_resync_to_restart; - sp->src.term_source = std_term_source; - sp->src.bytes_in_buffer = 0; /* for safety */ - sp->src.next_input_byte = NULL; -} - -/* - * Alternate source manager for reading from JPEGTables. - * We can share all the code except for the init routine. - */ - -static void -tables_init_source(j_decompress_ptr cinfo) -{ - JPEGState* sp = (JPEGState*) cinfo; - - sp->src.next_input_byte = (const JOCTET*) sp->jpegtables; - sp->src.bytes_in_buffer = (size_t) sp->jpegtables_length; -} - -static void -TIFFjpeg_tables_src(JPEGState* sp, TIFF* tif) -{ - TIFFjpeg_data_src(sp, tif); - sp->src.init_source = tables_init_source; -} - -/* - * Allocate downsampled-data buffers needed for downsampled I/O. - * We use values computed in jpeg_start_compress or jpeg_start_decompress. - * We use libjpeg's allocator so that buffers will be released automatically - * when done with strip/tile. - * This is also a handy place to compute samplesperclump, bytesperline. - */ -static int -alloc_downsampled_buffers(TIFF* tif, jpeg_component_info* comp_info, - int num_components) -{ - JPEGState* sp = JState(tif); - int ci; - jpeg_component_info* compptr; - JSAMPARRAY buf; - int samples_per_clump = 0; - - for (ci = 0, compptr = comp_info; ci < num_components; - ci++, compptr++) { - samples_per_clump += compptr->h_samp_factor * - compptr->v_samp_factor; - buf = TIFFjpeg_alloc_sarray(sp, JPOOL_IMAGE, - compptr->width_in_blocks * DCTSIZE, - (JDIMENSION) (compptr->v_samp_factor*DCTSIZE)); - if (buf == NULL) - return (0); - sp->ds_buffer[ci] = buf; - } - sp->samplesperclump = samples_per_clump; - return (1); -} - - -/* - * JPEG Decoding. - */ - -static int -JPEGSetupDecode(TIFF* tif) -{ - JPEGState* sp = JState(tif); - TIFFDirectory *td = &tif->tif_dir; - - JPEGInitializeLibJPEG( tif ); - - assert(sp != NULL); - assert(sp->cinfo.comm.is_decompressor); - - /* Read JPEGTables if it is present */ - if (TIFFFieldSet(tif,FIELD_JPEGTABLES)) { - TIFFjpeg_tables_src(sp, tif); - if(TIFFjpeg_read_header(sp,FALSE) != JPEG_HEADER_TABLES_ONLY) { - TIFFError("JPEGSetupDecode", "Bogus JPEGTables field"); - return (0); - } - } - - /* Grab parameters that are same for all strips/tiles */ - sp->photometric = td->td_photometric; - switch (sp->photometric) { - case PHOTOMETRIC_YCBCR: - sp->h_sampling = td->td_ycbcrsubsampling[0]; - sp->v_sampling = td->td_ycbcrsubsampling[1]; - break; - default: - /* TIFF 6.0 forbids subsampling of all other color spaces */ - sp->h_sampling = 1; - sp->v_sampling = 1; - break; - } - - /* Set up for reading normal data */ - TIFFjpeg_data_src(sp, tif); - tif->tif_postdecode = _TIFFNoPostDecode; /* override byte swapping */ - return (1); -} - -/* - * Set up for decoding a strip or tile. - */ -static int -JPEGPreDecode(TIFF* tif, tsample_t s) -{ - JPEGState *sp = JState(tif); - TIFFDirectory *td = &tif->tif_dir; - static const char module[] = "JPEGPreDecode"; - uint32 segment_width, segment_height; - int downsampled_output; - int ci; - - assert(sp != NULL); - assert(sp->cinfo.comm.is_decompressor); - /* - * Reset decoder state from any previous strip/tile, - * in case application didn't read the whole strip. - */ - if (!TIFFjpeg_abort(sp)) - return (0); - /* - * Read the header for this strip/tile. - */ - if (TIFFjpeg_read_header(sp, TRUE) != JPEG_HEADER_OK) - return (0); - /* - * Check image parameters and set decompression parameters. - */ - segment_width = td->td_imagewidth; - segment_height = td->td_imagelength - tif->tif_row; - if (isTiled(tif)) { - segment_width = td->td_tilewidth; - segment_height = td->td_tilelength; - sp->bytesperline = TIFFTileRowSize(tif); - } else { - if (segment_height > td->td_rowsperstrip) - segment_height = td->td_rowsperstrip; - sp->bytesperline = TIFFScanlineSize(tif); - } - if (td->td_planarconfig == PLANARCONFIG_SEPARATE && s > 0) { - /* - * For PC 2, scale down the expected strip/tile size - * to match a downsampled component - */ - segment_width = TIFFhowmany(segment_width, sp->h_sampling); - segment_height = TIFFhowmany(segment_height, sp->v_sampling); - } - if (sp->cinfo.d.image_width != segment_width || - sp->cinfo.d.image_height != segment_height) { - TIFFWarning(module, - "Improper JPEG strip/tile size, expected %dx%d, got %dx%d", - segment_width, - segment_height, - sp->cinfo.d.image_width, - sp->cinfo.d.image_height); - } - if (sp->cinfo.d.num_components != - (td->td_planarconfig == PLANARCONFIG_CONTIG ? - td->td_samplesperpixel : 1)) { - TIFFError(module, "Improper JPEG component count"); - return (0); - } - if (sp->cinfo.d.data_precision != td->td_bitspersample) { - TIFFError(module, "Improper JPEG data precision"); - return (0); - } - if (td->td_planarconfig == PLANARCONFIG_CONTIG) { - /* Component 0 should have expected sampling factors */ - if (sp->cinfo.d.comp_info[0].h_samp_factor != sp->h_sampling || - sp->cinfo.d.comp_info[0].v_samp_factor != sp->v_sampling) { - TIFFWarning(module, - "Improper JPEG sampling factors %d,%d\n" - "Apparently should be %d,%d, " - "decompressor will try reading with " - "sampling %d,%d", - sp->cinfo.d.comp_info[0].h_samp_factor, - sp->cinfo.d.comp_info[0].v_samp_factor, - sp->h_sampling, - sp->v_sampling, - sp->cinfo.d.comp_info[0].h_samp_factor, - sp->cinfo.d.comp_info[0].v_samp_factor ); - - sp->h_sampling = (uint16) - sp->cinfo.d.comp_info[0].h_samp_factor; - sp->v_sampling = (uint16) - sp->cinfo.d.comp_info[0].v_samp_factor; - } - /* Rest should have sampling factors 1,1 */ - for (ci = 1; ci < sp->cinfo.d.num_components; ci++) { - if (sp->cinfo.d.comp_info[ci].h_samp_factor != 1 || - sp->cinfo.d.comp_info[ci].v_samp_factor != 1) { - TIFFError(module, "Improper JPEG sampling factors"); - return (0); - } - } - } else { - /* PC 2's single component should have sampling factors 1,1 */ - if (sp->cinfo.d.comp_info[0].h_samp_factor != 1 || - sp->cinfo.d.comp_info[0].v_samp_factor != 1) { - TIFFError(module, "Improper JPEG sampling factors"); - return (0); - } - } - downsampled_output = FALSE; - if (td->td_planarconfig == PLANARCONFIG_CONTIG && - sp->photometric == PHOTOMETRIC_YCBCR && - sp->jpegcolormode == JPEGCOLORMODE_RGB) { - /* Convert YCbCr to RGB */ - sp->cinfo.d.jpeg_color_space = JCS_YCbCr; - sp->cinfo.d.out_color_space = JCS_RGB; - } else { - /* Suppress colorspace handling */ - sp->cinfo.d.jpeg_color_space = JCS_UNKNOWN; - sp->cinfo.d.out_color_space = JCS_UNKNOWN; - if (td->td_planarconfig == PLANARCONFIG_CONTIG && - (sp->h_sampling != 1 || sp->v_sampling != 1)) - downsampled_output = TRUE; - /* XXX what about up-sampling? */ - } - if (downsampled_output) { - /* Need to use raw-data interface to libjpeg */ - sp->cinfo.d.raw_data_out = TRUE; - tif->tif_decoderow = JPEGDecodeRaw; - tif->tif_decodestrip = JPEGDecodeRaw; - tif->tif_decodetile = JPEGDecodeRaw; - } else { - /* Use normal interface to libjpeg */ - sp->cinfo.d.raw_data_out = FALSE; - tif->tif_decoderow = JPEGDecode; - tif->tif_decodestrip = JPEGDecode; - tif->tif_decodetile = JPEGDecode; - } - /* Start JPEG decompressor */ - if (!TIFFjpeg_start_decompress(sp)) - return (0); - /* Allocate downsampled-data buffers if needed */ - if (downsampled_output) { - if (!alloc_downsampled_buffers(tif, sp->cinfo.d.comp_info, - sp->cinfo.d.num_components)) - return (0); - sp->scancount = DCTSIZE; /* mark buffer empty */ - } - return (1); -} - -/* - * Decode a chunk of pixels. - * "Standard" case: returned data is not downsampled. - */ -/*ARGSUSED*/ static int -JPEGDecode(TIFF* tif, tidata_t buf, tsize_t cc, tsample_t s) -{ - JPEGState *sp = JState(tif); - tsize_t nrows; - - nrows = cc / sp->bytesperline; - if (cc % sp->bytesperline) - TIFFWarning(tif->tif_name, "fractional scanline not read"); - - if( nrows > (int) sp->cinfo.d.image_height ) - nrows = sp->cinfo.d.image_height; - - /* data is expected to be read in multiples of a scanline */ - if (nrows) - { - do { - JSAMPROW bufptr = (JSAMPROW)buf; - - if (TIFFjpeg_read_scanlines(sp, &bufptr, 1) != 1) - return (0); - ++tif->tif_row; - buf += sp->bytesperline; - cc -= sp->bytesperline; - } while (--nrows > 0); - } - /* Close down the decompressor if we've finished the strip or tile. */ - return sp->cinfo.d.output_scanline < sp->cinfo.d.output_height - || TIFFjpeg_finish_decompress(sp); -} - -/* - * Decode a chunk of pixels. - * Returned data is downsampled per sampling factors. - */ -/*ARGSUSED*/ static int -JPEGDecodeRaw(TIFF* tif, tidata_t buf, tsize_t cc, tsample_t s) -{ - JPEGState *sp = JState(tif); - tsize_t nrows; - - /* data is expected to be read in multiples of a scanline */ - if ( (nrows = sp->cinfo.d.image_height) ) { - /* Cb,Cr both have sampling factors 1, so this is correct */ - JDIMENSION clumps_per_line = sp->cinfo.d.comp_info[1].downsampled_width; - int samples_per_clump = sp->samplesperclump; - - do { - jpeg_component_info *compptr; - int ci, clumpoffset; - - /* Reload downsampled-data buffer if needed */ - if (sp->scancount >= DCTSIZE) { - int n = sp->cinfo.d.max_v_samp_factor * DCTSIZE; - - if (TIFFjpeg_read_raw_data(sp, sp->ds_buffer, n) - != n) - return (0); - sp->scancount = 0; - } - /* - * Fastest way to unseparate data is to make one pass - * over the scanline for each row of each component. - */ - clumpoffset = 0; /* first sample in clump */ - for (ci = 0, compptr = sp->cinfo.d.comp_info; - ci < sp->cinfo.d.num_components; - ci++, compptr++) { - int hsamp = compptr->h_samp_factor; - int vsamp = compptr->v_samp_factor; - int ypos; - - for (ypos = 0; ypos < vsamp; ypos++) { - JSAMPLE *inptr = sp->ds_buffer[ci][sp->scancount*vsamp + ypos]; - JSAMPLE *outptr = (JSAMPLE*)buf + clumpoffset; - JDIMENSION nclump; - - if (hsamp == 1) { - /* fast path for at least Cb and Cr */ - for (nclump = clumps_per_line; nclump-- > 0; ) { - outptr[0] = *inptr++; - outptr += samples_per_clump; - } - } else { - int xpos; - - /* general case */ - for (nclump = clumps_per_line; nclump-- > 0; ) { - for (xpos = 0; xpos < hsamp; xpos++) - outptr[xpos] = *inptr++; - outptr += samples_per_clump; - } - } - clumpoffset += hsamp; - } - } - ++sp->scancount; - ++tif->tif_row; - buf += sp->bytesperline; - cc -= sp->bytesperline; - } while (--nrows > 0); - } - - /* Close down the decompressor if done. */ - return sp->cinfo.d.output_scanline < sp->cinfo.d.output_height - || TIFFjpeg_finish_decompress(sp); -} - - -/* - * JPEG Encoding. - */ - -static void -unsuppress_quant_table (JPEGState* sp, int tblno) -{ - JQUANT_TBL* qtbl; - - if ((qtbl = sp->cinfo.c.quant_tbl_ptrs[tblno]) != NULL) - qtbl->sent_table = FALSE; -} - -static void -unsuppress_huff_table (JPEGState* sp, int tblno) -{ - JHUFF_TBL* htbl; - - if ((htbl = sp->cinfo.c.dc_huff_tbl_ptrs[tblno]) != NULL) - htbl->sent_table = FALSE; - if ((htbl = sp->cinfo.c.ac_huff_tbl_ptrs[tblno]) != NULL) - htbl->sent_table = FALSE; -} - -static int -prepare_JPEGTables(TIFF* tif) -{ - JPEGState* sp = JState(tif); - - JPEGInitializeLibJPEG( tif ); - - /* Initialize quant tables for current quality setting */ - if (!TIFFjpeg_set_quality(sp, sp->jpegquality, FALSE)) - return (0); - /* Mark only the tables we want for output */ - /* NB: chrominance tables are currently used only with YCbCr */ - if (!TIFFjpeg_suppress_tables(sp, TRUE)) - return (0); - if (sp->jpegtablesmode & JPEGTABLESMODE_QUANT) { - unsuppress_quant_table(sp, 0); - if (sp->photometric == PHOTOMETRIC_YCBCR) - unsuppress_quant_table(sp, 1); - } - if (sp->jpegtablesmode & JPEGTABLESMODE_HUFF) { - unsuppress_huff_table(sp, 0); - if (sp->photometric == PHOTOMETRIC_YCBCR) - unsuppress_huff_table(sp, 1); - } - /* Direct libjpeg output into jpegtables */ - if (!TIFFjpeg_tables_dest(sp, tif)) - return (0); - /* Emit tables-only datastream */ - if (!TIFFjpeg_write_tables(sp)) - return (0); - - return (1); -} - -static int -JPEGSetupEncode(TIFF* tif) -{ - JPEGState* sp = JState(tif); - TIFFDirectory *td = &tif->tif_dir; - static const char module[] = "JPEGSetupEncode"; - - JPEGInitializeLibJPEG( tif ); - - assert(sp != NULL); - assert(!sp->cinfo.comm.is_decompressor); - - /* - * Initialize all JPEG parameters to default values. - * Note that jpeg_set_defaults needs legal values for - * in_color_space and input_components. - */ - sp->cinfo.c.in_color_space = JCS_UNKNOWN; - sp->cinfo.c.input_components = 1; - if (!TIFFjpeg_set_defaults(sp)) - return (0); - /* Set per-file parameters */ - sp->photometric = td->td_photometric; - switch (sp->photometric) { - case PHOTOMETRIC_YCBCR: - sp->h_sampling = td->td_ycbcrsubsampling[0]; - sp->v_sampling = td->td_ycbcrsubsampling[1]; - /* - * A ReferenceBlackWhite field *must* be present since the - * default value is inappropriate for YCbCr. Fill in the - * proper value if application didn't set it. - */ - if (!TIFFFieldSet(tif, FIELD_REFBLACKWHITE)) { - float refbw[6]; - long top = 1L << td->td_bitspersample; - refbw[0] = 0; - refbw[1] = (float)(top-1L); - refbw[2] = (float)(top>>1); - refbw[3] = refbw[1]; - refbw[4] = refbw[2]; - refbw[5] = refbw[1]; - TIFFSetField(tif, TIFFTAG_REFERENCEBLACKWHITE, refbw); - } - break; - case PHOTOMETRIC_PALETTE: /* disallowed by Tech Note */ - case PHOTOMETRIC_MASK: - TIFFError(module, - "PhotometricInterpretation %d not allowed for JPEG", - (int) sp->photometric); - return (0); - default: - /* TIFF 6.0 forbids subsampling of all other color spaces */ - sp->h_sampling = 1; - sp->v_sampling = 1; - break; - } - - /* Verify miscellaneous parameters */ - - /* - * This would need work if libtiff ever supports different - * depths for different components, or if libjpeg ever supports - * run-time selection of depth. Neither is imminent. - */ - if (td->td_bitspersample != BITS_IN_JSAMPLE) { - TIFFError(module, "BitsPerSample %d not allowed for JPEG", - (int) td->td_bitspersample); - return (0); - } - sp->cinfo.c.data_precision = td->td_bitspersample; - if (isTiled(tif)) { - if ((td->td_tilelength % (sp->v_sampling * DCTSIZE)) != 0) { - TIFFError(module, - "JPEG tile height must be multiple of %d", - sp->v_sampling * DCTSIZE); - return (0); - } - if ((td->td_tilewidth % (sp->h_sampling * DCTSIZE)) != 0) { - TIFFError(module, - "JPEG tile width must be multiple of %d", - sp->h_sampling * DCTSIZE); - return (0); - } - } else { - if (td->td_rowsperstrip < td->td_imagelength && - (td->td_rowsperstrip % (sp->v_sampling * DCTSIZE)) != 0) { - TIFFError(module, - "RowsPerStrip must be multiple of %d for JPEG", - sp->v_sampling * DCTSIZE); - return (0); - } - } - - /* Create a JPEGTables field if appropriate */ - if (sp->jpegtablesmode & (JPEGTABLESMODE_QUANT|JPEGTABLESMODE_HUFF)) { - if (!prepare_JPEGTables(tif)) - return (0); - /* Mark the field present */ - /* Can't use TIFFSetField since BEENWRITING is already set! */ - TIFFSetFieldBit(tif, FIELD_JPEGTABLES); - tif->tif_flags |= TIFF_DIRTYDIRECT; - } else { - /* We do not support application-supplied JPEGTables, */ - /* so mark the field not present */ - TIFFClrFieldBit(tif, FIELD_JPEGTABLES); - } - - /* Direct libjpeg output to libtiff's output buffer */ - TIFFjpeg_data_dest(sp, tif); - - return (1); -} - -/* - * Set encoding state at the start of a strip or tile. - */ -static int -JPEGPreEncode(TIFF* tif, tsample_t s) -{ - JPEGState *sp = JState(tif); - TIFFDirectory *td = &tif->tif_dir; - static const char module[] = "JPEGPreEncode"; - uint32 segment_width, segment_height; - int downsampled_input; - - assert(sp != NULL); - assert(!sp->cinfo.comm.is_decompressor); - /* - * Set encoding parameters for this strip/tile. - */ - if (isTiled(tif)) { - segment_width = td->td_tilewidth; - segment_height = td->td_tilelength; - sp->bytesperline = TIFFTileRowSize(tif); - } else { - segment_width = td->td_imagewidth; - segment_height = td->td_imagelength - tif->tif_row; - if (segment_height > td->td_rowsperstrip) - segment_height = td->td_rowsperstrip; - sp->bytesperline = TIFFScanlineSize(tif); - } - if (td->td_planarconfig == PLANARCONFIG_SEPARATE && s > 0) { - /* for PC 2, scale down the strip/tile size - * to match a downsampled component - */ - segment_width = TIFFhowmany(segment_width, sp->h_sampling); - segment_height = TIFFhowmany(segment_height, sp->v_sampling); - } - if (segment_width > 65535 || segment_height > 65535) { - TIFFError(module, "Strip/tile too large for JPEG"); - return (0); - } - sp->cinfo.c.image_width = segment_width; - sp->cinfo.c.image_height = segment_height; - downsampled_input = FALSE; - if (td->td_planarconfig == PLANARCONFIG_CONTIG) { - sp->cinfo.c.input_components = td->td_samplesperpixel; - if (sp->photometric == PHOTOMETRIC_YCBCR) { - if (sp->jpegcolormode == JPEGCOLORMODE_RGB) { - sp->cinfo.c.in_color_space = JCS_RGB; - } else { - sp->cinfo.c.in_color_space = JCS_YCbCr; - if (sp->h_sampling != 1 || sp->v_sampling != 1) - downsampled_input = TRUE; - } - if (!TIFFjpeg_set_colorspace(sp, JCS_YCbCr)) - return (0); - /* - * Set Y sampling factors; - * we assume jpeg_set_colorspace() set the rest to 1 - */ - sp->cinfo.c.comp_info[0].h_samp_factor = sp->h_sampling; - sp->cinfo.c.comp_info[0].v_samp_factor = sp->v_sampling; - } else { - sp->cinfo.c.in_color_space = JCS_UNKNOWN; - if (!TIFFjpeg_set_colorspace(sp, JCS_UNKNOWN)) - return (0); - /* jpeg_set_colorspace set all sampling factors to 1 */ - } - } else { - sp->cinfo.c.input_components = 1; - sp->cinfo.c.in_color_space = JCS_UNKNOWN; - if (!TIFFjpeg_set_colorspace(sp, JCS_UNKNOWN)) - return (0); - sp->cinfo.c.comp_info[0].component_id = s; - /* jpeg_set_colorspace() set sampling factors to 1 */ - if (sp->photometric == PHOTOMETRIC_YCBCR && s > 0) { - sp->cinfo.c.comp_info[0].quant_tbl_no = 1; - sp->cinfo.c.comp_info[0].dc_tbl_no = 1; - sp->cinfo.c.comp_info[0].ac_tbl_no = 1; - } - } - /* ensure libjpeg won't write any extraneous markers */ - sp->cinfo.c.write_JFIF_header = FALSE; - sp->cinfo.c.write_Adobe_marker = FALSE; - /* set up table handling correctly */ - if (! (sp->jpegtablesmode & JPEGTABLESMODE_QUANT)) { - if (!TIFFjpeg_set_quality(sp, sp->jpegquality, FALSE)) - return (0); - unsuppress_quant_table(sp, 0); - unsuppress_quant_table(sp, 1); - } - if (sp->jpegtablesmode & JPEGTABLESMODE_HUFF) - sp->cinfo.c.optimize_coding = FALSE; - else - sp->cinfo.c.optimize_coding = TRUE; - if (downsampled_input) { - /* Need to use raw-data interface to libjpeg */ - sp->cinfo.c.raw_data_in = TRUE; - tif->tif_encoderow = JPEGEncodeRaw; - tif->tif_encodestrip = JPEGEncodeRaw; - tif->tif_encodetile = JPEGEncodeRaw; - } else { - /* Use normal interface to libjpeg */ - sp->cinfo.c.raw_data_in = FALSE; - tif->tif_encoderow = JPEGEncode; - tif->tif_encodestrip = JPEGEncode; - tif->tif_encodetile = JPEGEncode; - } - /* Start JPEG compressor */ - if (!TIFFjpeg_start_compress(sp, FALSE)) - return (0); - /* Allocate downsampled-data buffers if needed */ - if (downsampled_input) { - if (!alloc_downsampled_buffers(tif, sp->cinfo.c.comp_info, - sp->cinfo.c.num_components)) - return (0); - } - sp->scancount = 0; - - return (1); -} - -/* - * Encode a chunk of pixels. - * "Standard" case: incoming data is not downsampled. - */ -static int -JPEGEncode(TIFF* tif, tidata_t buf, tsize_t cc, tsample_t s) -{ - JPEGState *sp = JState(tif); - tsize_t nrows; - JSAMPROW bufptr[1]; - - (void) s; - assert(sp != NULL); - /* data is expected to be supplied in multiples of a scanline */ - nrows = cc / sp->bytesperline; - if (cc % sp->bytesperline) - TIFFWarning(tif->tif_name, "fractional scanline discarded"); - - while (nrows-- > 0) { - bufptr[0] = (JSAMPROW) buf; - if (TIFFjpeg_write_scanlines(sp, bufptr, 1) != 1) - return (0); - if (nrows > 0) - tif->tif_row++; - buf += sp->bytesperline; - } - return (1); -} - -/* - * Encode a chunk of pixels. - * Incoming data is expected to be downsampled per sampling factors. - */ -static int -JPEGEncodeRaw(TIFF* tif, tidata_t buf, tsize_t cc, tsample_t s) -{ - JPEGState *sp = JState(tif); - JSAMPLE* inptr; - JSAMPLE* outptr; - tsize_t nrows; - JDIMENSION clumps_per_line, nclump; - int clumpoffset, ci, xpos, ypos; - jpeg_component_info* compptr; - int samples_per_clump = sp->samplesperclump; - - (void) s; - assert(sp != NULL); - /* data is expected to be supplied in multiples of a scanline */ - nrows = cc / sp->bytesperline; - if (cc % sp->bytesperline) - TIFFWarning(tif->tif_name, "fractional scanline discarded"); - - /* Cb,Cr both have sampling factors 1, so this is correct */ - clumps_per_line = sp->cinfo.c.comp_info[1].downsampled_width; - - while (nrows-- > 0) { - /* - * Fastest way to separate the data is to make one pass - * over the scanline for each row of each component. - */ - clumpoffset = 0; /* first sample in clump */ - for (ci = 0, compptr = sp->cinfo.c.comp_info; - ci < sp->cinfo.c.num_components; - ci++, compptr++) { - int hsamp = compptr->h_samp_factor; - int vsamp = compptr->v_samp_factor; - int padding = (int) (compptr->width_in_blocks * DCTSIZE - - clumps_per_line * hsamp); - for (ypos = 0; ypos < vsamp; ypos++) { - inptr = ((JSAMPLE*) buf) + clumpoffset; - outptr = sp->ds_buffer[ci][sp->scancount*vsamp + ypos]; - if (hsamp == 1) { - /* fast path for at least Cb and Cr */ - for (nclump = clumps_per_line; nclump-- > 0; ) { - *outptr++ = inptr[0]; - inptr += samples_per_clump; - } - } else { - /* general case */ - for (nclump = clumps_per_line; nclump-- > 0; ) { - for (xpos = 0; xpos < hsamp; xpos++) - *outptr++ = inptr[xpos]; - inptr += samples_per_clump; - } - } - /* pad each scanline as needed */ - for (xpos = 0; xpos < padding; xpos++) { - *outptr = outptr[-1]; - outptr++; - } - clumpoffset += hsamp; - } - } - sp->scancount++; - if (sp->scancount >= DCTSIZE) { - int n = sp->cinfo.c.max_v_samp_factor * DCTSIZE; - if (TIFFjpeg_write_raw_data(sp, sp->ds_buffer, n) != n) - return (0); - sp->scancount = 0; - } - if (nrows > 0) - tif->tif_row++; - buf += sp->bytesperline; - } - return (1); -} - -/* - * Finish up at the end of a strip or tile. - */ -static int -JPEGPostEncode(TIFF* tif) -{ - JPEGState *sp = JState(tif); - - if (sp->scancount > 0) { - /* - * Need to emit a partial bufferload of downsampled data. - * Pad the data vertically. - */ - int ci, ypos, n; - jpeg_component_info* compptr; - - for (ci = 0, compptr = sp->cinfo.c.comp_info; - ci < sp->cinfo.c.num_components; - ci++, compptr++) { - int vsamp = compptr->v_samp_factor; - tsize_t row_width = compptr->width_in_blocks * DCTSIZE - * sizeof(JSAMPLE); - for (ypos = sp->scancount * vsamp; - ypos < DCTSIZE * vsamp; ypos++) { - _TIFFmemcpy((tdata_t)sp->ds_buffer[ci][ypos], - (tdata_t)sp->ds_buffer[ci][ypos-1], - row_width); - - } - } - n = sp->cinfo.c.max_v_samp_factor * DCTSIZE; - if (TIFFjpeg_write_raw_data(sp, sp->ds_buffer, n) != n) - return (0); - } - - return (TIFFjpeg_finish_compress(JState(tif))); -} - -static void -JPEGCleanup(TIFF* tif) -{ - if (tif->tif_data) { - JPEGState *sp = JState(tif); - if( sp->cinfo_initialized ) - TIFFjpeg_destroy(sp); /* release libjpeg resources */ - if (sp->jpegtables) /* tag value */ - _TIFFfree(sp->jpegtables); - _TIFFfree(tif->tif_data); /* release local state */ - tif->tif_data = NULL; - } -} - -static int -JPEGVSetField(TIFF* tif, ttag_t tag, va_list ap) -{ - JPEGState* sp = JState(tif); - TIFFDirectory* td = &tif->tif_dir; - uint32 v32; - - switch (tag) { - case TIFFTAG_JPEGTABLES: - v32 = va_arg(ap, uint32); - if (v32 == 0) { - /* XXX */ - return (0); - } - _TIFFsetByteArray(&sp->jpegtables, va_arg(ap, void*), - (long) v32); - sp->jpegtables_length = v32; - TIFFSetFieldBit(tif, FIELD_JPEGTABLES); - break; - case TIFFTAG_JPEGQUALITY: - sp->jpegquality = va_arg(ap, int); - return (1); /* pseudo tag */ - case TIFFTAG_JPEGCOLORMODE: - sp->jpegcolormode = va_arg(ap, int); - /* - * Mark whether returned data is up-sampled or not - * so TIFFStripSize and TIFFTileSize return values - * that reflect the true amount of data. - */ - tif->tif_flags &= ~TIFF_UPSAMPLED; - if (td->td_planarconfig == PLANARCONFIG_CONTIG) { - if (td->td_photometric == PHOTOMETRIC_YCBCR && - sp->jpegcolormode == JPEGCOLORMODE_RGB) { - tif->tif_flags |= TIFF_UPSAMPLED; - } else { - if (td->td_ycbcrsubsampling[0] != 1 || - td->td_ycbcrsubsampling[1] != 1) - ; /* XXX what about up-sampling? */ - } - } - /* - * Must recalculate cached tile size - * in case sampling state changed. - */ - tif->tif_tilesize = TIFFTileSize(tif); - return (1); /* pseudo tag */ - case TIFFTAG_JPEGTABLESMODE: - sp->jpegtablesmode = va_arg(ap, int); - return (1); /* pseudo tag */ - case TIFFTAG_YCBCRSUBSAMPLING: - /* mark the fact that we have a real ycbcrsubsampling! */ - sp->ycbcrsampling_fetched = 1; - return (*sp->vsetparent)(tif, tag, ap); - default: - return (*sp->vsetparent)(tif, tag, ap); - } - tif->tif_flags |= TIFF_DIRTYDIRECT; - return (1); -} - -/* - * Some JPEG-in-TIFF produces do not emit the YCBCRSUBSAMPLING values in - * the TIFF tags, but still use non-default (2,2) values within the jpeg - * data stream itself. In order for TIFF applications to work properly - * - for instance to get the strip buffer size right - it is imperative - * that the subsampling be available before we start reading the image - * data normally. This function will attempt to load the first strip in - * order to get the sampling values from the jpeg data stream. Various - * hacks are various places are done to ensure this function gets called - * before the td_ycbcrsubsampling values are used from the directory structure, - * including calling TIFFGetField() for the YCBCRSUBSAMPLING field from - * TIFFStripSize(), and the printing code in tif_print.c. - * - * Note that JPEGPreDeocode() will produce a fairly loud warning when the - * discovered sampling does not match the default sampling (2,2) or whatever - * was actually in the tiff tags. - * - * Problems: - * o This code will cause one whole strip/tile of compressed data to be - * loaded just to get the tags right, even if the imagery is never read. - * It would be more efficient to just load a bit of the header, and - * initialize things from that. - * - * See the bug in bugzilla for details: - * - * http://bugzilla.remotesensing.org/show_bug.cgi?id=168 - * - * Frank Warmerdam, July 2002 - */ - -static void -JPEGFixupTestSubsampling( TIFF * tif ) -{ -#if CHECK_JPEG_YCBCR_SUBSAMPLING == 1 - JPEGState *sp = JState(tif); - TIFFDirectory *td = &tif->tif_dir; - - JPEGInitializeLibJPEG( tif ); - - /* - * Some JPEG-in-TIFF files don't provide the ycbcrsampling tags, - * and use a sampling schema other than the default 2,2. To handle - * this we actually have to scan the header of a strip or tile of - * jpeg data to get the sampling. - */ - if( !sp->cinfo.comm.is_decompressor - || sp->ycbcrsampling_fetched - || td->td_photometric != PHOTOMETRIC_YCBCR ) - return; - - sp->ycbcrsampling_fetched = 1; - if( TIFFIsTiled( tif ) ) - { - if( !TIFFFillTile( tif, 0 ) ) - return; - } - else - { - if( !TIFFFillStrip( tif, 0 ) ) - return; - } - - TIFFSetField( tif, TIFFTAG_YCBCRSUBSAMPLING, - (uint16) sp->h_sampling, (uint16) sp->v_sampling ); -#endif /* CHECK_JPEG_YCBCR_SUBSAMPLING == 1 */ -} - -static int -JPEGVGetField(TIFF* tif, ttag_t tag, va_list ap) -{ - JPEGState* sp = JState(tif); - - switch (tag) { - case TIFFTAG_JPEGTABLES: - /* u_short is bogus --- should be uint32 ??? */ - /* TIFFWriteNormalTag needs fixed XXX */ - *va_arg(ap, u_short*) = (u_short) sp->jpegtables_length; - *va_arg(ap, void**) = sp->jpegtables; - break; - case TIFFTAG_JPEGQUALITY: - *va_arg(ap, int*) = sp->jpegquality; - break; - case TIFFTAG_JPEGCOLORMODE: - *va_arg(ap, int*) = sp->jpegcolormode; - break; - case TIFFTAG_JPEGTABLESMODE: - *va_arg(ap, int*) = sp->jpegtablesmode; - break; - case TIFFTAG_YCBCRSUBSAMPLING: - JPEGFixupTestSubsampling( tif ); - return (*sp->vgetparent)(tif, tag, ap); - break; - default: - return (*sp->vgetparent)(tif, tag, ap); - } - return (1); -} - -static void -JPEGPrintDir(TIFF* tif, FILE* fd, long flags) -{ - JPEGState* sp = JState(tif); - - (void) flags; - if (TIFFFieldSet(tif,FIELD_JPEGTABLES)) - fprintf(fd, " JPEG Tables: (%lu bytes)\n", - (u_long) sp->jpegtables_length); -} - -static uint32 -JPEGDefaultStripSize(TIFF* tif, uint32 s) -{ - JPEGState* sp = JState(tif); - TIFFDirectory *td = &tif->tif_dir; - - s = (*sp->defsparent)(tif, s); - if (s < td->td_imagelength) - s = TIFFroundup(s, td->td_ycbcrsubsampling[1] * DCTSIZE); - return (s); -} - -static void -JPEGDefaultTileSize(TIFF* tif, uint32* tw, uint32* th) -{ - JPEGState* sp = JState(tif); - TIFFDirectory *td = &tif->tif_dir; - - (*sp->deftparent)(tif, tw, th); - *tw = TIFFroundup(*tw, td->td_ycbcrsubsampling[0] * DCTSIZE); - *th = TIFFroundup(*th, td->td_ycbcrsubsampling[1] * DCTSIZE); -} - -/* - * The JPEG library initialized used to be done in TIFFInitJPEG(), but - * now that we allow a TIFF file to be opened in update mode it is necessary - * to have some way of deciding whether compression or decompression is - * desired other than looking at tif->tif_mode. We accomplish this by - * examining {TILE/STRIP}BYTECOUNTS to see if there is a non-zero entry. - * If so, we assume decompression is desired. - * - * This is tricky, because TIFFInitJPEG() is called while the directory is - * being read, and generally speaking the BYTECOUNTS tag won't have been read - * at that point. So we try to defer jpeg library initialization till we - * do have that tag ... basically any access that might require the compressor - * or decompressor that occurs after the reading of the directory. - * - * In an ideal world compressors or decompressors would be setup - * at the point where a single tile or strip was accessed (for read or write) - * so that stuff like update of missing tiles, or replacement of tiles could - * be done. However, we aren't trying to crack that nut just yet ... - * - * NFW, Feb 3rd, 2003. - */ - -static int JPEGInitializeLibJPEG( TIFF * tif ) -{ - JPEGState* sp = JState(tif); - uint32 *byte_counts = NULL; - int data_is_empty = TRUE; - - if( sp->cinfo_initialized ) - return 1; - - /* - * Do we have tile data already? Make sure we initialize the - * the state in decompressor mode if we have tile data, even if we - * are not in read-only file access mode. - */ - if( TIFFIsTiled( tif ) - && TIFFGetField( tif, TIFFTAG_TILEBYTECOUNTS, &byte_counts ) - && byte_counts != NULL ) - { - data_is_empty = byte_counts[0] == 0; - } - if( !TIFFIsTiled( tif ) - && TIFFGetField( tif, TIFFTAG_STRIPBYTECOUNTS, &byte_counts) - && byte_counts != NULL ) - { - data_is_empty = byte_counts[0] == 0; - } - - /* - * Initialize libjpeg. - */ - if (tif->tif_mode == O_RDONLY || !data_is_empty ) { - if (!TIFFjpeg_create_decompress(sp)) - return (0); - - } else { - if (!TIFFjpeg_create_compress(sp)) - return (0); - } - - sp->cinfo_initialized = TRUE; - - return 1; -} - -int -TIFFInitJPEG(TIFF* tif, int scheme) -{ - JPEGState* sp; - - assert(scheme == COMPRESSION_JPEG); - - /* - * Allocate state block so tag methods have storage to record values. - */ - tif->tif_data = (tidata_t) _TIFFmalloc(sizeof (JPEGState)); - - if (tif->tif_data == NULL) { - TIFFError("TIFFInitJPEG", "No space for JPEG state block"); - return (0); - } - memset( tif->tif_data, 0, sizeof(JPEGState)); - - sp = JState(tif); - sp->tif = tif; /* back link */ - - /* - * Merge codec-specific tag information and - * override parent get/set field methods. - */ - _TIFFMergeFieldInfo(tif, jpegFieldInfo, N(jpegFieldInfo)); - sp->vgetparent = tif->tif_tagmethods.vgetfield; - tif->tif_tagmethods.vgetfield = JPEGVGetField; /* hook for codec tags */ - sp->vsetparent = tif->tif_tagmethods.vsetfield; - tif->tif_tagmethods.vsetfield = JPEGVSetField; /* hook for codec tags */ - tif->tif_tagmethods.printdir = JPEGPrintDir; /* hook for codec tags */ - - /* Default values for codec-specific fields */ - sp->jpegtables = NULL; - sp->jpegtables_length = 0; - sp->jpegquality = 75; /* Default IJG quality */ - sp->jpegcolormode = JPEGCOLORMODE_RAW; - sp->jpegtablesmode = JPEGTABLESMODE_QUANT | JPEGTABLESMODE_HUFF; - - sp->ycbcrsampling_fetched = 0; - - /* - * Install codec methods. - */ - tif->tif_setupdecode = JPEGSetupDecode; - tif->tif_predecode = JPEGPreDecode; - tif->tif_decoderow = JPEGDecode; - tif->tif_decodestrip = JPEGDecode; - tif->tif_decodetile = JPEGDecode; - tif->tif_setupencode = JPEGSetupEncode; - tif->tif_preencode = JPEGPreEncode; - tif->tif_postencode = JPEGPostEncode; - tif->tif_encoderow = JPEGEncode; - tif->tif_encodestrip = JPEGEncode; - tif->tif_encodetile = JPEGEncode; - tif->tif_cleanup = JPEGCleanup; - sp->defsparent = tif->tif_defstripsize; - tif->tif_defstripsize = JPEGDefaultStripSize; - sp->deftparent = tif->tif_deftilesize; - tif->tif_deftilesize = JPEGDefaultTileSize; - tif->tif_flags |= TIFF_NOBITREV; /* no bit reversal, please */ - - sp->cinfo_initialized = FALSE; - - /* - * Mark the TIFFTAG_YCBCRSAMPLES as present even if it is not - * see: JPEGFixupTestSubsampling(). - */ - TIFFSetFieldBit( tif, FIELD_YCBCRSUBSAMPLING ); - - return (1); -} -#endif /* JPEG_SUPPORT */ diff --git a/wxWidgets/src/tiff/tif_luv.c b/wxWidgets/src/tiff/tif_luv.c deleted file mode 100644 index 4c3d06e449..0000000000 --- a/wxWidgets/src/tiff/tif_luv.c +++ /dev/null @@ -1,1597 +0,0 @@ -/* - * Copyright (c) 1997 Greg Ward Larson - * Copyright (c) 1997 Silicon Graphics, Inc. - * - * Permission to use, copy, modify, distribute, and sell this software and - * its documentation for any purpose is hereby granted without fee, provided - * that (i) the above copyright notices and this permission notice appear in - * all copies of the software and related documentation, and (ii) the names of - * Sam Leffler, Greg Larson and Silicon Graphics may not be used in any - * advertising or publicity relating to the software without the specific, - * prior written permission of Sam Leffler, Greg Larson and Silicon Graphics. - * - * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, - * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * - * IN NO EVENT SHALL SAM LEFFLER, GREG LARSON OR SILICON GRAPHICS BE LIABLE - * FOR ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, - * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF - * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE - * OF THIS SOFTWARE. - */ - -#include "tiffiop.h" -#ifdef LOGLUV_SUPPORT - -/* - * TIFF Library. - * LogLuv compression support for high dynamic range images. - * - * Contributed by Greg Larson. - * - * LogLuv image support uses the TIFF library to store 16 or 10-bit - * log luminance values with 8 bits each of u and v or a 14-bit index. - * - * The codec can take as input and produce as output 32-bit IEEE float values - * as well as 16-bit integer values. A 16-bit luminance is interpreted - * as a sign bit followed by a 15-bit integer that is converted - * to and from a linear magnitude using the transformation: - * - * L = 2^( (Le+.5)/256 - 64 ) # real from 15-bit - * - * Le = floor( 256*(log2(L) + 64) ) # 15-bit from real - * - * The actual conversion to world luminance units in candelas per sq. meter - * requires an additional multiplier, which is stored in the TIFFTAG_STONITS. - * This value is usually set such that a reasonable exposure comes from - * clamping decoded luminances above 1 to 1 in the displayed image. - * - * The 16-bit values for u and v may be converted to real values by dividing - * each by 32768. (This allows for negative values, which aren't useful as - * far as we know, but are left in case of future improvements in human - * color vision.) - * - * Conversion from (u,v), which is actually the CIE (u',v') system for - * you color scientists, is accomplished by the following transformation: - * - * u = 4*x / (-2*x + 12*y + 3) - * v = 9*y / (-2*x + 12*y + 3) - * - * x = 9*u / (6*u - 16*v + 12) - * y = 4*v / (6*u - 16*v + 12) - * - * This process is greatly simplified by passing 32-bit IEEE floats - * for each of three CIE XYZ coordinates. The codec then takes care - * of conversion to and from LogLuv, though the application is still - * responsible for interpreting the TIFFTAG_STONITS calibration factor. - * - * By definition, a CIE XYZ vector of [1 1 1] corresponds to a neutral white - * point of (x,y)=(1/3,1/3). However, most color systems assume some other - * white point, such as D65, and an absolute color conversion to XYZ then - * to another color space with a different white point may introduce an - * unwanted color cast to the image. It is often desirable, therefore, to - * perform a white point conversion that maps the input white to [1 1 1] - * in XYZ, then record the original white point using the TIFFTAG_WHITEPOINT - * tag value. A decoder that demands absolute color calibration may use - * this white point tag to get back the original colors, but usually it - * will be ignored and the new white point will be used instead that - * matches the output color space. - * - * Pixel information is compressed into one of two basic encodings, depending - * on the setting of the compression tag, which is one of COMPRESSION_SGILOG - * or COMPRESSION_SGILOG24. For COMPRESSION_SGILOG, greyscale data is - * stored as: - * - * 1 15 - * |-+---------------| - * - * COMPRESSION_SGILOG color data is stored as: - * - * 1 15 8 8 - * |-+---------------|--------+--------| - * S Le ue ve - * - * For the 24-bit COMPRESSION_SGILOG24 color format, the data is stored as: - * - * 10 14 - * |----------|--------------| - * Le' Ce - * - * There is no sign bit in the 24-bit case, and the (u,v) chromaticity is - * encoded as an index for optimal color resolution. The 10 log bits are - * defined by the following conversions: - * - * L = 2^((Le'+.5)/64 - 12) # real from 10-bit - * - * Le' = floor( 64*(log2(L) + 12) ) # 10-bit from real - * - * The 10 bits of the smaller format may be converted into the 15 bits of - * the larger format by multiplying by 4 and adding 13314. Obviously, - * a smaller range of magnitudes is covered (about 5 orders of magnitude - * instead of 38), and the lack of a sign bit means that negative luminances - * are not allowed. (Well, they aren't allowed in the real world, either, - * but they are useful for certain types of image processing.) - * - * The desired user format is controlled by the setting the internal - * pseudo tag TIFFTAG_SGILOGDATAFMT to one of: - * SGILOGDATAFMT_FLOAT = IEEE 32-bit float XYZ values - * SGILOGDATAFMT_16BIT = 16-bit integer encodings of logL, u and v - * Raw data i/o is also possible using: - * SGILOGDATAFMT_RAW = 32-bit unsigned integer with encoded pixel - * In addition, the following decoding is provided for ease of display: - * SGILOGDATAFMT_8BIT = 8-bit default RGB gamma-corrected values - * - * For grayscale images, we provide the following data formats: - * SGILOGDATAFMT_FLOAT = IEEE 32-bit float Y values - * SGILOGDATAFMT_16BIT = 16-bit integer w/ encoded luminance - * SGILOGDATAFMT_8BIT = 8-bit gray monitor values - * - * Note that the COMPRESSION_SGILOG applies a simple run-length encoding - * scheme by separating the logL, u and v bytes for each row and applying - * a PackBits type of compression. Since the 24-bit encoding is not - * adaptive, the 32-bit color format takes less space in many cases. - * - * Further control is provided over the conversion from higher-resolution - * formats to final encoded values through the pseudo tag - * TIFFTAG_SGILOGENCODE: - * SGILOGENCODE_NODITHER = do not dither encoded values - * SGILOGENCODE_RANDITHER = apply random dithering during encoding - * - * The default value of this tag is SGILOGENCODE_NODITHER for - * COMPRESSION_SGILOG to maximize run-length encoding and - * SGILOGENCODE_RANDITHER for COMPRESSION_SGILOG24 to turn - * quantization errors into noise. - */ - -#include -#include -#include -#include - -/* - * State block for each open TIFF - * file using LogLuv compression/decompression. - */ -typedef struct logLuvState LogLuvState; - -struct logLuvState { - int user_datafmt; /* user data format */ - int encode_meth; /* encoding method */ - int pixel_size; /* bytes per pixel */ - - tidata_t* tbuf; /* translation buffer */ - int tbuflen; /* buffer length */ - void (*tfunc)(LogLuvState*, tidata_t, int); - - TIFFVSetMethod vgetparent; /* super-class method */ - TIFFVSetMethod vsetparent; /* super-class method */ -}; - -#define DecoderState(tif) ((LogLuvState*) (tif)->tif_data) -#define EncoderState(tif) ((LogLuvState*) (tif)->tif_data) - -#define N(a) (sizeof(a)/sizeof(a[0])) -#define SGILOGDATAFMT_UNKNOWN -1 - -#define MINRUN 4 /* minimum run length */ - -/* - * Decode a string of 16-bit gray pixels. - */ -static int -LogL16Decode(TIFF* tif, tidata_t op, tsize_t occ, tsample_t s) -{ - LogLuvState* sp = DecoderState(tif); - int shft, i, npixels; - u_char* bp; - int16* tp; - int16 b; - int cc, rc; - - assert(s == 0); - assert(sp != NULL); - - npixels = occ / sp->pixel_size; - - if (sp->user_datafmt == SGILOGDATAFMT_16BIT) - tp = (int16*) op; - else { - assert(sp->tbuflen >= npixels); - tp = (int16*) sp->tbuf; - } - _TIFFmemset((tdata_t) tp, 0, npixels*sizeof (tp[0])); - - bp = (u_char*) tif->tif_rawcp; - cc = tif->tif_rawcc; - /* get each byte string */ - for (shft = 2*8; (shft -= 8) >= 0; ) { - for (i = 0; i < npixels && cc > 0; ) - if (*bp >= 128) { /* run */ - rc = *bp++ + (2-128); - b = (int16)(*bp++ << shft); - cc -= 2; - while (rc-- && i < npixels) - tp[i++] |= b; - } else { /* non-run */ - rc = *bp++; /* nul is noop */ - while (--cc && rc-- && i < npixels) - tp[i++] |= (int16)*bp++ << shft; - } - if (i != npixels) { - TIFFError(tif->tif_name, - "LogL16Decode: Not enough data at row %d (short %d pixels)", - tif->tif_row, npixels - i); - tif->tif_rawcp = (tidata_t) bp; - tif->tif_rawcc = cc; - return (0); - } - } - (*sp->tfunc)(sp, op, npixels); - tif->tif_rawcp = (tidata_t) bp; - tif->tif_rawcc = cc; - return (1); -} - -/* - * Decode a string of 24-bit pixels. - */ -static int -LogLuvDecode24(TIFF* tif, tidata_t op, tsize_t occ, tsample_t s) -{ - LogLuvState* sp = DecoderState(tif); - int cc, i, npixels; - u_char* bp; - uint32* tp; - - assert(s == 0); - assert(sp != NULL); - - npixels = occ / sp->pixel_size; - - if (sp->user_datafmt == SGILOGDATAFMT_RAW) - tp = (uint32 *)op; - else { - assert(sp->tbuflen >= npixels); - tp = (uint32 *) sp->tbuf; - } - /* copy to array of uint32 */ - bp = (u_char*) tif->tif_rawcp; - cc = tif->tif_rawcc; - for (i = 0; i < npixels && cc > 0; i++) { - tp[i] = bp[0] << 16 | bp[1] << 8 | bp[2]; - bp += 3; - cc -= 3; - } - tif->tif_rawcp = (tidata_t) bp; - tif->tif_rawcc = cc; - if (i != npixels) { - TIFFError(tif->tif_name, - "LogLuvDecode24: Not enough data at row %d (short %d pixels)", - tif->tif_row, npixels - i); - return (0); - } - (*sp->tfunc)(sp, op, npixels); - return (1); -} - -/* - * Decode a string of 32-bit pixels. - */ -static int -LogLuvDecode32(TIFF* tif, tidata_t op, tsize_t occ, tsample_t s) -{ - LogLuvState* sp; - int shft, i, npixels; - u_char* bp; - uint32* tp; - uint32 b; - int cc, rc; - - assert(s == 0); - sp = DecoderState(tif); - assert(sp != NULL); - - npixels = occ / sp->pixel_size; - - if (sp->user_datafmt == SGILOGDATAFMT_RAW) - tp = (uint32*) op; - else { - assert(sp->tbuflen >= npixels); - tp = (uint32*) sp->tbuf; - } - _TIFFmemset((tdata_t) tp, 0, npixels*sizeof (tp[0])); - - bp = (u_char*) tif->tif_rawcp; - cc = tif->tif_rawcc; - /* get each byte string */ - for (shft = 4*8; (shft -= 8) >= 0; ) { - for (i = 0; i < npixels && cc > 0; ) - if (*bp >= 128) { /* run */ - rc = *bp++ + (2-128); - b = (uint32)*bp++ << shft; - cc -= 2; - while (rc-- && i < npixels) - tp[i++] |= b; - } else { /* non-run */ - rc = *bp++; /* nul is noop */ - while (--cc && rc-- && i < npixels) - tp[i++] |= (uint32)*bp++ << shft; - } - if (i != npixels) { - TIFFError(tif->tif_name, - "LogLuvDecode32: Not enough data at row %d (short %d pixels)", - tif->tif_row, npixels - i); - tif->tif_rawcp = (tidata_t) bp; - tif->tif_rawcc = cc; - return (0); - } - } - (*sp->tfunc)(sp, op, npixels); - tif->tif_rawcp = (tidata_t) bp; - tif->tif_rawcc = cc; - return (1); -} - -/* - * Decode a strip of pixels. We break it into rows to - * maintain synchrony with the encode algorithm, which - * is row by row. - */ -static int -LogLuvDecodeStrip(TIFF* tif, tidata_t bp, tsize_t cc, tsample_t s) -{ - tsize_t rowlen = TIFFScanlineSize(tif); - - assert(cc%rowlen == 0); - while (cc && (*tif->tif_decoderow)(tif, bp, rowlen, s)) - bp += rowlen, cc -= rowlen; - return (cc == 0); -} - -/* - * Decode a tile of pixels. We break it into rows to - * maintain synchrony with the encode algorithm, which - * is row by row. - */ -static int -LogLuvDecodeTile(TIFF* tif, tidata_t bp, tsize_t cc, tsample_t s) -{ - tsize_t rowlen = TIFFTileRowSize(tif); - - assert(cc%rowlen == 0); - while (cc && (*tif->tif_decoderow)(tif, bp, rowlen, s)) - bp += rowlen, cc -= rowlen; - return (cc == 0); -} - -/* - * Encode a row of 16-bit pixels. - */ -static int -LogL16Encode(TIFF* tif, tidata_t bp, tsize_t cc, tsample_t s) -{ - LogLuvState* sp = EncoderState(tif); - int shft, i, j, npixels; - tidata_t op; - int16* tp; - int16 b; - int occ, rc=0, mask, beg; - - assert(s == 0); - assert(sp != NULL); - npixels = cc / sp->pixel_size; - - if (sp->user_datafmt == SGILOGDATAFMT_16BIT) - tp = (int16*) bp; - else { - tp = (int16*) sp->tbuf; - assert(sp->tbuflen >= npixels); - (*sp->tfunc)(sp, bp, npixels); - } - /* compress each byte string */ - op = tif->tif_rawcp; - occ = tif->tif_rawdatasize - tif->tif_rawcc; - for (shft = 2*8; (shft -= 8) >= 0; ) - for (i = 0; i < npixels; i += rc) { - if (occ < 4) { - tif->tif_rawcp = op; - tif->tif_rawcc = tif->tif_rawdatasize - occ; - if (!TIFFFlushData1(tif)) - return (-1); - op = tif->tif_rawcp; - occ = tif->tif_rawdatasize - tif->tif_rawcc; - } - mask = 0xff << shft; /* find next run */ - for (beg = i; beg < npixels; beg += rc) { - b = (int16) (tp[beg] & mask); - rc = 1; - while (rc < 127+2 && beg+rc < npixels && - (tp[beg+rc] & mask) == b) - rc++; - if (rc >= MINRUN) - break; /* long enough */ - } - if (beg-i > 1 && beg-i < MINRUN) { - b = (int16) (tp[i] & mask);/*check short run */ - j = i+1; - while ((tp[j++] & mask) == b) - if (j == beg) { - *op++ = (tidataval_t)(128-2+j-i); - *op++ = (tidataval_t) (b >> shft); - occ -= 2; - i = beg; - break; - } - } - while (i < beg) { /* write out non-run */ - if ((j = beg-i) > 127) j = 127; - if (occ < j+3) { - tif->tif_rawcp = op; - tif->tif_rawcc = tif->tif_rawdatasize - occ; - if (!TIFFFlushData1(tif)) - return (-1); - op = tif->tif_rawcp; - occ = tif->tif_rawdatasize - tif->tif_rawcc; - } - *op++ = (tidataval_t) j; occ--; - while (j--) { - *op++ = (tidataval_t) (tp[i++] >> shft & 0xff); - occ--; - } - } - if (rc >= MINRUN) { /* write out run */ - *op++ = (tidataval_t) (128-2+rc); - *op++ = (tidataval_t) (tp[beg] >> shft & 0xff); - occ -= 2; - } else - rc = 0; - } - tif->tif_rawcp = op; - tif->tif_rawcc = tif->tif_rawdatasize - occ; - - return (0); -} - -/* - * Encode a row of 24-bit pixels. - */ -static int -LogLuvEncode24(TIFF* tif, tidata_t bp, tsize_t cc, tsample_t s) -{ - LogLuvState* sp = EncoderState(tif); - int i, npixels, occ; - tidata_t op; - uint32* tp; - - assert(s == 0); - assert(sp != NULL); - npixels = cc / sp->pixel_size; - - if (sp->user_datafmt == SGILOGDATAFMT_RAW) - tp = (uint32*) bp; - else { - tp = (uint32*) sp->tbuf; - assert(sp->tbuflen >= npixels); - (*sp->tfunc)(sp, bp, npixels); - } - /* write out encoded pixels */ - op = tif->tif_rawcp; - occ = tif->tif_rawdatasize - tif->tif_rawcc; - for (i = npixels; i--; ) { - if (occ < 3) { - tif->tif_rawcp = op; - tif->tif_rawcc = tif->tif_rawdatasize - occ; - if (!TIFFFlushData1(tif)) - return (-1); - op = tif->tif_rawcp; - occ = tif->tif_rawdatasize - tif->tif_rawcc; - } - *op++ = (tidataval_t)(*tp >> 16); - *op++ = (tidataval_t)(*tp >> 8 & 0xff); - *op++ = (tidataval_t)(*tp++ & 0xff); - occ -= 3; - } - tif->tif_rawcp = op; - tif->tif_rawcc = tif->tif_rawdatasize - occ; - - return (0); -} - -/* - * Encode a row of 32-bit pixels. - */ -static int -LogLuvEncode32(TIFF* tif, tidata_t bp, tsize_t cc, tsample_t s) -{ - LogLuvState* sp = EncoderState(tif); - int shft, i, j, npixels; - tidata_t op; - uint32* tp; - uint32 b; - int occ, rc=0, mask, beg; - - assert(s == 0); - assert(sp != NULL); - - npixels = cc / sp->pixel_size; - - if (sp->user_datafmt == SGILOGDATAFMT_RAW) - tp = (uint32*) bp; - else { - tp = (uint32*) sp->tbuf; - assert(sp->tbuflen >= npixels); - (*sp->tfunc)(sp, bp, npixels); - } - /* compress each byte string */ - op = tif->tif_rawcp; - occ = tif->tif_rawdatasize - tif->tif_rawcc; - for (shft = 4*8; (shft -= 8) >= 0; ) - for (i = 0; i < npixels; i += rc) { - if (occ < 4) { - tif->tif_rawcp = op; - tif->tif_rawcc = tif->tif_rawdatasize - occ; - if (!TIFFFlushData1(tif)) - return (-1); - op = tif->tif_rawcp; - occ = tif->tif_rawdatasize - tif->tif_rawcc; - } - mask = 0xff << shft; /* find next run */ - for (beg = i; beg < npixels; beg += rc) { - b = tp[beg] & mask; - rc = 1; - while (rc < 127+2 && beg+rc < npixels && - (tp[beg+rc] & mask) == b) - rc++; - if (rc >= MINRUN) - break; /* long enough */ - } - if (beg-i > 1 && beg-i < MINRUN) { - b = tp[i] & mask; /* check short run */ - j = i+1; - while ((tp[j++] & mask) == b) - if (j == beg) { - *op++ = (tidataval_t)(128-2+j-i); - *op++ = (tidataval_t)(b >> shft); - occ -= 2; - i = beg; - break; - } - } - while (i < beg) { /* write out non-run */ - if ((j = beg-i) > 127) j = 127; - if (occ < j+3) { - tif->tif_rawcp = op; - tif->tif_rawcc = tif->tif_rawdatasize - occ; - if (!TIFFFlushData1(tif)) - return (-1); - op = tif->tif_rawcp; - occ = tif->tif_rawdatasize - tif->tif_rawcc; - } - *op++ = (tidataval_t) j; occ--; - while (j--) { - *op++ = (tidataval_t)(tp[i++] >> shft & 0xff); - occ--; - } - } - if (rc >= MINRUN) { /* write out run */ - *op++ = (tidataval_t) (128-2+rc); - *op++ = (tidataval_t)(tp[beg] >> shft & 0xff); - occ -= 2; - } else - rc = 0; - } - tif->tif_rawcp = op; - tif->tif_rawcc = tif->tif_rawdatasize - occ; - - return (0); -} - -/* - * Encode a strip of pixels. We break it into rows to - * avoid encoding runs across row boundaries. - */ -static int -LogLuvEncodeStrip(TIFF* tif, tidata_t bp, tsize_t cc, tsample_t s) -{ - tsize_t rowlen = TIFFScanlineSize(tif); - - assert(cc%rowlen == 0); - while (cc && (*tif->tif_encoderow)(tif, bp, rowlen, s) == 0) - bp += rowlen, cc -= rowlen; - return (cc == 0); -} - -/* - * Encode a tile of pixels. We break it into rows to - * avoid encoding runs across row boundaries. - */ -static int -LogLuvEncodeTile(TIFF* tif, tidata_t bp, tsize_t cc, tsample_t s) -{ - tsize_t rowlen = TIFFTileRowSize(tif); - - assert(cc%rowlen == 0); - while (cc && (*tif->tif_encoderow)(tif, bp, rowlen, s) == 0) - bp += rowlen, cc -= rowlen; - return (cc == 0); -} - -/* - * Encode/Decode functions for converting to and from user formats. - */ - -#include "uvcode.h" - -#ifndef UVSCALE -#define U_NEU 0.210526316 -#define V_NEU 0.473684211 -#define UVSCALE 410. -#endif - -#ifndef M_LN2 -#define M_LN2 0.69314718055994530942 -#endif -#ifndef M_PI -#define M_PI 3.14159265358979323846 -#endif -#define log2(x) ((1./M_LN2)*log(x)) -#define exp2(x) exp(M_LN2*(x)) - -#define itrunc(x,m) ((m)==SGILOGENCODE_NODITHER ? \ - (int)(x) : \ - (int)((x) + rand()*(1./RAND_MAX) - .5)) - -#if !LOGLUV_PUBLIC -static -#endif -double -LogL16toY(int p16) /* compute luminance from 16-bit LogL */ -{ - int Le = p16 & 0x7fff; - double Y; - - if (!Le) - return (0.); - Y = exp(M_LN2/256.*(Le+.5) - M_LN2*64.); - return (!(p16 & 0x8000) ? Y : -Y); -} - -#if !LOGLUV_PUBLIC -static -#endif -int -LogL16fromY(double Y, int em) /* get 16-bit LogL from Y */ -{ - if (Y >= 1.8371976e19) - return (0x7fff); - if (Y <= -1.8371976e19) - return (0xffff); - if (Y > 5.4136769e-20) - return itrunc(256.*(log2(Y) + 64.), em); - if (Y < -5.4136769e-20) - return (~0x7fff | itrunc(256.*(log2(-Y) + 64.), em)); - return (0); -} - -static void -L16toY(LogLuvState* sp, tidata_t op, int n) -{ - int16* l16 = (int16*) sp->tbuf; - float* yp = (float*) op; - - while (n-- > 0) - *yp++ = (float)LogL16toY(*l16++); -} - -static void -L16toGry(LogLuvState* sp, tidata_t op, int n) -{ - int16* l16 = (int16*) sp->tbuf; - uint8* gp = (uint8*) op; - - while (n-- > 0) { - double Y = LogL16toY(*l16++); - *gp++ = (uint8) ((Y <= 0.) ? 0 : (Y >= 1.) ? 255 : (int)(256.*sqrt(Y))); - } -} - -static void -L16fromY(LogLuvState* sp, tidata_t op, int n) -{ - int16* l16 = (int16*) sp->tbuf; - float* yp = (float*) op; - - while (n-- > 0) - *l16++ = (int16) (LogL16fromY(*yp++, sp->encode_meth)); -} - -#if !LOGLUV_PUBLIC -static -#endif -void -XYZtoRGB24(float xyz[3], uint8 rgb[3]) -{ - double r, g, b; - /* assume CCIR-709 primaries */ - r = 2.690*xyz[0] + -1.276*xyz[1] + -0.414*xyz[2]; - g = -1.022*xyz[0] + 1.978*xyz[1] + 0.044*xyz[2]; - b = 0.061*xyz[0] + -0.224*xyz[1] + 1.163*xyz[2]; - /* assume 2.0 gamma for speed */ - /* could use integer sqrt approx., but this is probably faster */ - rgb[0] = (uint8)((r<=0.) ? 0 : (r >= 1.) ? 255 : (int)(256.*sqrt(r))); - rgb[1] = (uint8)((g<=0.) ? 0 : (g >= 1.) ? 255 : (int)(256.*sqrt(g))); - rgb[2] = (uint8)((b<=0.) ? 0 : (b >= 1.) ? 255 : (int)(256.*sqrt(b))); -} - -#if !LOGLUV_PUBLIC -static -#endif -double -LogL10toY(int p10) /* compute luminance from 10-bit LogL */ -{ - if (p10 == 0) - return (0.); - return (exp(M_LN2/64.*(p10+.5) - M_LN2*12.)); -} - -#if !LOGLUV_PUBLIC -static -#endif -int -LogL10fromY(double Y, int em) /* get 10-bit LogL from Y */ -{ - if (Y >= 15.742) - return (0x3ff); - else if (Y <= .00024283) - return (0); - else - return itrunc(64.*(log2(Y) + 12.), em); -} - -#define NANGLES 100 -#define uv2ang(u, v) ( (NANGLES*.499999999/M_PI) \ - * atan2((v)-V_NEU,(u)-U_NEU) + .5*NANGLES ) - -static int -oog_encode(double u, double v) /* encode out-of-gamut chroma */ -{ - static int oog_table[NANGLES]; - static int initialized = 0; - register int i; - - if (!initialized) { /* set up perimeter table */ - double eps[NANGLES], ua, va, ang, epsa; - int ui, vi, ustep; - for (i = NANGLES; i--; ) - eps[i] = 2.; - for (vi = UV_NVS; vi--; ) { - va = UV_VSTART + (vi+.5)*UV_SQSIZ; - ustep = uv_row[vi].nus-1; - if (vi == UV_NVS-1 || vi == 0 || ustep <= 0) - ustep = 1; - for (ui = uv_row[vi].nus-1; ui >= 0; ui -= ustep) { - ua = uv_row[vi].ustart + (ui+.5)*UV_SQSIZ; - ang = uv2ang(ua, va); - i = (int) ang; - epsa = fabs(ang - (i+.5)); - if (epsa < eps[i]) { - oog_table[i] = uv_row[vi].ncum + ui; - eps[i] = epsa; - } - } - } - for (i = NANGLES; i--; ) /* fill any holes */ - if (eps[i] > 1.5) { - int i1, i2; - for (i1 = 1; i1 < NANGLES/2; i1++) - if (eps[(i+i1)%NANGLES] < 1.5) - break; - for (i2 = 1; i2 < NANGLES/2; i2++) - if (eps[(i+NANGLES-i2)%NANGLES] < 1.5) - break; - if (i1 < i2) - oog_table[i] = - oog_table[(i+i1)%NANGLES]; - else - oog_table[i] = - oog_table[(i+NANGLES-i2)%NANGLES]; - } - initialized = 1; - } - i = (int) uv2ang(u, v); /* look up hue angle */ - return (oog_table[i]); -} - -#undef uv2ang -#undef NANGLES - -#if !LOGLUV_PUBLIC -static -#endif -int -uv_encode(double u, double v, int em) /* encode (u',v') coordinates */ -{ - register int vi, ui; - - if (v < UV_VSTART) - return oog_encode(u, v); - vi = itrunc((v - UV_VSTART)*(1./UV_SQSIZ), em); - if (vi >= UV_NVS) - return oog_encode(u, v); - if (u < uv_row[vi].ustart) - return oog_encode(u, v); - ui = itrunc((u - uv_row[vi].ustart)*(1./UV_SQSIZ), em); - if (ui >= uv_row[vi].nus) - return oog_encode(u, v); - - return (uv_row[vi].ncum + ui); -} - -#if !LOGLUV_PUBLIC -static -#endif -int -uv_decode(double *up, double *vp, int c) /* decode (u',v') index */ -{ - int upper, lower; - register int ui, vi; - - if (c < 0 || c >= UV_NDIVS) - return (-1); - lower = 0; /* binary search */ - upper = UV_NVS; - while (upper - lower > 1) { - vi = (lower + upper) >> 1; - ui = c - uv_row[vi].ncum; - if (ui > 0) - lower = vi; - else if (ui < 0) - upper = vi; - else { - lower = vi; - break; - } - } - vi = lower; - ui = c - uv_row[vi].ncum; - *up = uv_row[vi].ustart + (ui+.5)*UV_SQSIZ; - *vp = UV_VSTART + (vi+.5)*UV_SQSIZ; - return (0); -} - -#if !LOGLUV_PUBLIC -static -#endif -void -LogLuv24toXYZ(uint32 p, float XYZ[3]) -{ - int Ce; - double L, u, v, s, x, y; - /* decode luminance */ - L = LogL10toY(p>>14 & 0x3ff); - if (L <= 0.) { - XYZ[0] = XYZ[1] = XYZ[2] = 0.; - return; - } - /* decode color */ - Ce = p & 0x3fff; - if (uv_decode(&u, &v, Ce) < 0) { - u = U_NEU; v = V_NEU; - } - s = 1./(6.*u - 16.*v + 12.); - x = 9.*u * s; - y = 4.*v * s; - /* convert to XYZ */ - XYZ[0] = (float)(x/y * L); - XYZ[1] = (float)L; - XYZ[2] = (float)((1.-x-y)/y * L); -} - -#if !LOGLUV_PUBLIC -static -#endif -uint32 -LogLuv24fromXYZ(float XYZ[3], int em) -{ - int Le, Ce; - double u, v, s; - /* encode luminance */ - Le = LogL10fromY(XYZ[1], em); - /* encode color */ - s = XYZ[0] + 15.*XYZ[1] + 3.*XYZ[2]; - if (!Le || s <= 0.) { - u = U_NEU; - v = V_NEU; - } else { - u = 4.*XYZ[0] / s; - v = 9.*XYZ[1] / s; - } - Ce = uv_encode(u, v, em); - if (Ce < 0) /* never happens */ - Ce = uv_encode(U_NEU, V_NEU, SGILOGENCODE_NODITHER); - /* combine encodings */ - return (Le << 14 | Ce); -} - -static void -Luv24toXYZ(LogLuvState* sp, tidata_t op, int n) -{ - uint32* luv = (uint32*) sp->tbuf; - float* xyz = (float*) op; - - while (n-- > 0) { - LogLuv24toXYZ(*luv, xyz); - xyz += 3; - luv++; - } -} - -static void -Luv24toLuv48(LogLuvState* sp, tidata_t op, int n) -{ - uint32* luv = (uint32*) sp->tbuf; - int16* luv3 = (int16*) op; - - while (n-- > 0) { - double u, v; - - *luv3++ = (int16)((*luv >> 12 & 0xffd) + 13314); - if (uv_decode(&u, &v, *luv&0x3fff) < 0) { - u = U_NEU; - v = V_NEU; - } - *luv3++ = (int16)(u * (1L<<15)); - *luv3++ = (int16)(v * (1L<<15)); - luv++; - } -} - -static void -Luv24toRGB(LogLuvState* sp, tidata_t op, int n) -{ - uint32* luv = (uint32*) sp->tbuf; - uint8* rgb = (uint8*) op; - - while (n-- > 0) { - float xyz[3]; - - LogLuv24toXYZ(*luv++, xyz); - XYZtoRGB24(xyz, rgb); - rgb += 3; - } -} - -static void -Luv24fromXYZ(LogLuvState* sp, tidata_t op, int n) -{ - uint32* luv = (uint32*) sp->tbuf; - float* xyz = (float*) op; - - while (n-- > 0) { - *luv++ = LogLuv24fromXYZ(xyz, sp->encode_meth); - xyz += 3; - } -} - -static void -Luv24fromLuv48(LogLuvState* sp, tidata_t op, int n) -{ - uint32* luv = (uint32*) sp->tbuf; - int16* luv3 = (int16*) op; - - while (n-- > 0) { - int Le, Ce; - - if (luv3[0] <= 0) - Le = 0; - else if (luv3[0] >= (1<<12)+3314) - Le = (1<<10) - 1; - else if (sp->encode_meth == SGILOGENCODE_NODITHER) - Le = (luv3[0]-3314) >> 2; - else - Le = itrunc(.25*(luv3[0]-3314.), sp->encode_meth); - - Ce = uv_encode((luv3[1]+.5)/(1<<15), (luv3[2]+.5)/(1<<15), - sp->encode_meth); - if (Ce < 0) /* never happens */ - Ce = uv_encode(U_NEU, V_NEU, SGILOGENCODE_NODITHER); - *luv++ = (uint32)Le << 14 | Ce; - luv3 += 3; - } -} - -#if !LOGLUV_PUBLIC -static -#endif -void -LogLuv32toXYZ(uint32 p, float XYZ[3]) -{ - double L, u, v, s, x, y; - /* decode luminance */ - L = LogL16toY((int)p >> 16); - if (L <= 0.) { - XYZ[0] = XYZ[1] = XYZ[2] = 0.; - return; - } - /* decode color */ - u = 1./UVSCALE * ((p>>8 & 0xff) + .5); - v = 1./UVSCALE * ((p & 0xff) + .5); - s = 1./(6.*u - 16.*v + 12.); - x = 9.*u * s; - y = 4.*v * s; - /* convert to XYZ */ - XYZ[0] = (float)(x/y * L); - XYZ[1] = (float)L; - XYZ[2] = (float)((1.-x-y)/y * L); -} - -#if !LOGLUV_PUBLIC -static -#endif -uint32 -LogLuv32fromXYZ(float XYZ[3], int em) -{ - unsigned int Le, ue, ve; - double u, v, s; - /* encode luminance */ - Le = (unsigned int)LogL16fromY(XYZ[1], em); - /* encode color */ - s = XYZ[0] + 15.*XYZ[1] + 3.*XYZ[2]; - if (!Le || s <= 0.) { - u = U_NEU; - v = V_NEU; - } else { - u = 4.*XYZ[0] / s; - v = 9.*XYZ[1] / s; - } - if (u <= 0.) ue = 0; - else ue = itrunc(UVSCALE*u, em); - if (ue > 255) ue = 255; - if (v <= 0.) ve = 0; - else ve = itrunc(UVSCALE*v, em); - if (ve > 255) ve = 255; - /* combine encodings */ - return (Le << 16 | ue << 8 | ve); -} - -static void -Luv32toXYZ(LogLuvState* sp, tidata_t op, int n) -{ - uint32* luv = (uint32*) sp->tbuf; - float* xyz = (float*) op; - - while (n-- > 0) { - LogLuv32toXYZ(*luv++, xyz); - xyz += 3; - } -} - -static void -Luv32toLuv48(LogLuvState* sp, tidata_t op, int n) -{ - uint32* luv = (uint32*) sp->tbuf; - int16* luv3 = (int16*) op; - - while (n-- > 0) { - double u, v; - - *luv3++ = (int16)(*luv >> 16); - u = 1./UVSCALE * ((*luv>>8 & 0xff) + .5); - v = 1./UVSCALE * ((*luv & 0xff) + .5); - *luv3++ = (int16)(u * (1L<<15)); - *luv3++ = (int16)(v * (1L<<15)); - luv++; - } -} - -static void -Luv32toRGB(LogLuvState* sp, tidata_t op, int n) -{ - uint32* luv = (uint32*) sp->tbuf; - uint8* rgb = (uint8*) op; - - while (n-- > 0) { - float xyz[3]; - - LogLuv32toXYZ(*luv++, xyz); - XYZtoRGB24(xyz, rgb); - rgb += 3; - } -} - -static void -Luv32fromXYZ(LogLuvState* sp, tidata_t op, int n) -{ - uint32* luv = (uint32*) sp->tbuf; - float* xyz = (float*) op; - - while (n-- > 0) { - *luv++ = LogLuv32fromXYZ(xyz, sp->encode_meth); - xyz += 3; - } -} - -static void -Luv32fromLuv48(LogLuvState* sp, tidata_t op, int n) -{ - uint32* luv = (uint32*) sp->tbuf; - int16* luv3 = (int16*) op; - - if (sp->encode_meth == SGILOGENCODE_NODITHER) { - while (n-- > 0) { - *luv++ = (uint32)luv3[0] << 16 | - (luv3[1]*(uint32)(UVSCALE+.5) >> 7 & 0xff00) | - (luv3[2]*(uint32)(UVSCALE+.5) >> 15 & 0xff); - luv3 += 3; - } - return; - } - while (n-- > 0) { - *luv++ = (uint32)luv3[0] << 16 | - (itrunc(luv3[1]*(UVSCALE/(1<<15)), sp->encode_meth) << 8 & 0xff00) | - (itrunc(luv3[2]*(UVSCALE/(1<<15)), sp->encode_meth) & 0xff); - luv3 += 3; - } -} - -static void -_logLuvNop(LogLuvState* sp, tidata_t op, int n) -{ - (void) sp; (void) op; (void) n; -} - -static int -LogL16GuessDataFmt(TIFFDirectory *td) -{ -#define PACK(s,b,f) (((b)<<6)|((s)<<3)|(f)) - switch (PACK(td->td_samplesperpixel, td->td_bitspersample, td->td_sampleformat)) { - case PACK(1, 32, SAMPLEFORMAT_IEEEFP): - return (SGILOGDATAFMT_FLOAT); - case PACK(1, 16, SAMPLEFORMAT_VOID): - case PACK(1, 16, SAMPLEFORMAT_INT): - case PACK(1, 16, SAMPLEFORMAT_UINT): - return (SGILOGDATAFMT_16BIT); - case PACK(1, 8, SAMPLEFORMAT_VOID): - case PACK(1, 8, SAMPLEFORMAT_UINT): - return (SGILOGDATAFMT_8BIT); - } -#undef PACK - return (SGILOGDATAFMT_UNKNOWN); -} - -static uint32 -multiply(size_t m1, size_t m2) -{ - uint32 bytes = m1 * m2; - - if (m1 && bytes / m1 != m2) - bytes = 0; - - return bytes; -} - -static int -LogL16InitState(TIFF* tif) -{ - TIFFDirectory *td = &tif->tif_dir; - LogLuvState* sp = DecoderState(tif); - static const char module[] = "LogL16InitState"; - - assert(sp != NULL); - assert(td->td_photometric == PHOTOMETRIC_LOGL); - - /* for some reason, we can't do this in TIFFInitLogL16 */ - if (sp->user_datafmt == SGILOGDATAFMT_UNKNOWN) - sp->user_datafmt = LogL16GuessDataFmt(td); - switch (sp->user_datafmt) { - case SGILOGDATAFMT_FLOAT: - sp->pixel_size = sizeof (float); - break; - case SGILOGDATAFMT_16BIT: - sp->pixel_size = sizeof (int16); - break; - case SGILOGDATAFMT_8BIT: - sp->pixel_size = sizeof (uint8); - break; - default: - TIFFError(tif->tif_name, - "No support for converting user data format to LogL"); - return (0); - } - sp->tbuflen = multiply(td->td_imagewidth, td->td_rowsperstrip); - if (multiply(sp->tbuflen, sizeof (int16)) == 0 || - (sp->tbuf = (tidata_t*) _TIFFmalloc(sp->tbuflen * sizeof (int16))) == NULL) { - TIFFError(module, "%s: No space for SGILog translation buffer", - tif->tif_name); - return (0); - } - return (1); -} - -static int -LogLuvGuessDataFmt(TIFFDirectory *td) -{ - int guess; - - /* - * If the user didn't tell us their datafmt, - * take our best guess from the bitspersample. - */ -#define PACK(a,b) (((a)<<3)|(b)) - switch (PACK(td->td_bitspersample, td->td_sampleformat)) { - case PACK(32, SAMPLEFORMAT_IEEEFP): - guess = SGILOGDATAFMT_FLOAT; - break; - case PACK(32, SAMPLEFORMAT_VOID): - case PACK(32, SAMPLEFORMAT_UINT): - case PACK(32, SAMPLEFORMAT_INT): - guess = SGILOGDATAFMT_RAW; - break; - case PACK(16, SAMPLEFORMAT_VOID): - case PACK(16, SAMPLEFORMAT_INT): - case PACK(16, SAMPLEFORMAT_UINT): - guess = SGILOGDATAFMT_16BIT; - break; - case PACK( 8, SAMPLEFORMAT_VOID): - case PACK( 8, SAMPLEFORMAT_UINT): - guess = SGILOGDATAFMT_8BIT; - break; - default: - guess = SGILOGDATAFMT_UNKNOWN; - break; -#undef PACK - } - /* - * Double-check samples per pixel. - */ - switch (td->td_samplesperpixel) { - case 1: - if (guess != SGILOGDATAFMT_RAW) - guess = SGILOGDATAFMT_UNKNOWN; - break; - case 3: - if (guess == SGILOGDATAFMT_RAW) - guess = SGILOGDATAFMT_UNKNOWN; - break; - default: - guess = SGILOGDATAFMT_UNKNOWN; - break; - } - return (guess); -} - -static int -LogLuvInitState(TIFF* tif) -{ - TIFFDirectory* td = &tif->tif_dir; - LogLuvState* sp = DecoderState(tif); - static const char module[] = "LogLuvInitState"; - - assert(sp != NULL); - assert(td->td_photometric == PHOTOMETRIC_LOGLUV); - - /* for some reason, we can't do this in TIFFInitLogLuv */ - if (td->td_planarconfig != PLANARCONFIG_CONTIG) { - TIFFError(module, - "SGILog compression cannot handle non-contiguous data"); - return (0); - } - if (sp->user_datafmt == SGILOGDATAFMT_UNKNOWN) - sp->user_datafmt = LogLuvGuessDataFmt(td); - switch (sp->user_datafmt) { - case SGILOGDATAFMT_FLOAT: - sp->pixel_size = 3*sizeof (float); - break; - case SGILOGDATAFMT_16BIT: - sp->pixel_size = 3*sizeof (int16); - break; - case SGILOGDATAFMT_RAW: - sp->pixel_size = sizeof (uint32); - break; - case SGILOGDATAFMT_8BIT: - sp->pixel_size = 3*sizeof (uint8); - break; - default: - TIFFError(tif->tif_name, - "No support for converting user data format to LogLuv"); - return (0); - } - sp->tbuflen = multiply(td->td_imagewidth, td->td_rowsperstrip); - if (multiply(sp->tbuflen, sizeof (uint32)) == 0 || - (sp->tbuf = (tidata_t*) _TIFFmalloc(sp->tbuflen * sizeof (uint32))) == NULL) { - TIFFError(module, "%s: No space for SGILog translation buffer", - tif->tif_name); - return (0); - } - return (1); -} - -static int -LogLuvSetupDecode(TIFF* tif) -{ - LogLuvState* sp = DecoderState(tif); - TIFFDirectory* td = &tif->tif_dir; - - tif->tif_postdecode = _TIFFNoPostDecode; - switch (td->td_photometric) { - case PHOTOMETRIC_LOGLUV: - if (!LogLuvInitState(tif)) - break; - if (td->td_compression == COMPRESSION_SGILOG24) { - tif->tif_decoderow = LogLuvDecode24; - switch (sp->user_datafmt) { - case SGILOGDATAFMT_FLOAT: - sp->tfunc = Luv24toXYZ; - break; - case SGILOGDATAFMT_16BIT: - sp->tfunc = Luv24toLuv48; - break; - case SGILOGDATAFMT_8BIT: - sp->tfunc = Luv24toRGB; - break; - } - } else { - tif->tif_decoderow = LogLuvDecode32; - switch (sp->user_datafmt) { - case SGILOGDATAFMT_FLOAT: - sp->tfunc = Luv32toXYZ; - break; - case SGILOGDATAFMT_16BIT: - sp->tfunc = Luv32toLuv48; - break; - case SGILOGDATAFMT_8BIT: - sp->tfunc = Luv32toRGB; - break; - } - } - return (1); - case PHOTOMETRIC_LOGL: - if (!LogL16InitState(tif)) - break; - tif->tif_decoderow = LogL16Decode; - switch (sp->user_datafmt) { - case SGILOGDATAFMT_FLOAT: - sp->tfunc = L16toY; - break; - case SGILOGDATAFMT_8BIT: - sp->tfunc = L16toGry; - break; - } - return (1); - default: - TIFFError(tif->tif_name, - "Inappropriate photometric interpretation %d for SGILog compression; %s", - td->td_photometric, "must be either LogLUV or LogL"); - break; - } - return (0); -} - -static int -LogLuvSetupEncode(TIFF* tif) -{ - LogLuvState* sp = EncoderState(tif); - TIFFDirectory* td = &tif->tif_dir; - - switch (td->td_photometric) { - case PHOTOMETRIC_LOGLUV: - if (!LogLuvInitState(tif)) - break; - if (td->td_compression == COMPRESSION_SGILOG24) { - tif->tif_encoderow = LogLuvEncode24; - switch (sp->user_datafmt) { - case SGILOGDATAFMT_FLOAT: - sp->tfunc = Luv24fromXYZ; - break; - case SGILOGDATAFMT_16BIT: - sp->tfunc = Luv24fromLuv48; - break; - case SGILOGDATAFMT_RAW: - break; - default: - goto notsupported; - } - } else { - tif->tif_encoderow = LogLuvEncode32; - switch (sp->user_datafmt) { - case SGILOGDATAFMT_FLOAT: - sp->tfunc = Luv32fromXYZ; - break; - case SGILOGDATAFMT_16BIT: - sp->tfunc = Luv32fromLuv48; - break; - case SGILOGDATAFMT_RAW: - break; - default: - goto notsupported; - } - } - break; - case PHOTOMETRIC_LOGL: - if (!LogL16InitState(tif)) - break; - tif->tif_encoderow = LogL16Encode; - switch (sp->user_datafmt) { - case SGILOGDATAFMT_FLOAT: - sp->tfunc = L16fromY; - break; - case SGILOGDATAFMT_16BIT: - break; - default: - goto notsupported; - } - break; - default: - TIFFError(tif->tif_name, - "Inappropriate photometric interpretation %d for SGILog compression; %s", - td->td_photometric, "must be either LogLUV or LogL"); - break; - } - return (1); -notsupported: - TIFFError(tif->tif_name, - "SGILog compression supported only for %s, or raw data", - td->td_photometric == PHOTOMETRIC_LOGL ? "Y, L" : "XYZ, Luv"); - return (0); -} - -static void -LogLuvClose(TIFF* tif) -{ - TIFFDirectory *td = &tif->tif_dir; - - /* - * For consistency, we always want to write out the same - * bitspersample and sampleformat for our TIFF file, - * regardless of the data format being used by the application. - * Since this routine is called after tags have been set but - * before they have been recorded in the file, we reset them here. - */ - td->td_samplesperpixel = - (td->td_photometric == PHOTOMETRIC_LOGL) ? 1 : 3; - td->td_bitspersample = 16; - td->td_sampleformat = SAMPLEFORMAT_INT; -} - -static void -LogLuvCleanup(TIFF* tif) -{ - LogLuvState* sp = (LogLuvState *)tif->tif_data; - - if (sp) { - if (sp->tbuf) - _TIFFfree(sp->tbuf); - _TIFFfree(sp); - tif->tif_data = NULL; - } -} - -static int -LogLuvVSetField(TIFF* tif, ttag_t tag, va_list ap) -{ - LogLuvState* sp = DecoderState(tif); - int bps, fmt; - - switch (tag) { - case TIFFTAG_SGILOGDATAFMT: - sp->user_datafmt = va_arg(ap, int); - /* - * Tweak the TIFF header so that the rest of libtiff knows what - * size of data will be passed between app and library, and - * assume that the app knows what it is doing and is not - * confused by these header manipulations... - */ - switch (sp->user_datafmt) { - case SGILOGDATAFMT_FLOAT: - bps = 32, fmt = SAMPLEFORMAT_IEEEFP; - break; - case SGILOGDATAFMT_16BIT: - bps = 16, fmt = SAMPLEFORMAT_INT; - break; - case SGILOGDATAFMT_RAW: - bps = 32, fmt = SAMPLEFORMAT_UINT; - TIFFSetField(tif, TIFFTAG_SAMPLESPERPIXEL, 1); - break; - case SGILOGDATAFMT_8BIT: - bps = 8, fmt = SAMPLEFORMAT_UINT; - break; - default: - TIFFError(tif->tif_name, - "Unknown data format %d for LogLuv compression", - sp->user_datafmt); - return (0); - } - TIFFSetField(tif, TIFFTAG_BITSPERSAMPLE, bps); - TIFFSetField(tif, TIFFTAG_SAMPLEFORMAT, fmt); - /* - * Must recalculate sizes should bits/sample change. - */ - tif->tif_tilesize = TIFFTileSize(tif); - tif->tif_scanlinesize = TIFFScanlineSize(tif); - return (1); - case TIFFTAG_SGILOGENCODE: - sp->encode_meth = va_arg(ap, int); - if (sp->encode_meth != SGILOGENCODE_NODITHER && - sp->encode_meth != SGILOGENCODE_RANDITHER) { - TIFFError(tif->tif_name, - "Unknown encoding %d for LogLuv compression", - sp->encode_meth); - return (0); - } - return (1); - default: - return (*sp->vsetparent)(tif, tag, ap); - } -} - -static int -LogLuvVGetField(TIFF* tif, ttag_t tag, va_list ap) -{ - LogLuvState *sp = (LogLuvState *)tif->tif_data; - - switch (tag) { - case TIFFTAG_SGILOGDATAFMT: - *va_arg(ap, int*) = sp->user_datafmt; - return (1); - default: - return (*sp->vgetparent)(tif, tag, ap); - } -} - -static const TIFFFieldInfo LogLuvFieldInfo[] = { - { TIFFTAG_SGILOGDATAFMT, 0, 0, TIFF_SHORT, FIELD_PSEUDO, - TRUE, FALSE, "SGILogDataFmt"}, - { TIFFTAG_SGILOGENCODE, 0, 0, TIFF_SHORT, FIELD_PSEUDO, - TRUE, FALSE, "SGILogEncode"} -}; - -int -TIFFInitSGILog(TIFF* tif, int scheme) -{ - static const char module[] = "TIFFInitSGILog"; - LogLuvState* sp; - - assert(scheme == COMPRESSION_SGILOG24 || scheme == COMPRESSION_SGILOG); - - /* - * Allocate state block so tag methods have storage to record values. - */ - tif->tif_data = (tidata_t) _TIFFmalloc(sizeof (LogLuvState)); - if (tif->tif_data == NULL) - goto bad; - sp = (LogLuvState*) tif->tif_data; - _TIFFmemset((tdata_t)sp, 0, sizeof (*sp)); - sp->user_datafmt = SGILOGDATAFMT_UNKNOWN; - sp->encode_meth = (scheme == COMPRESSION_SGILOG24) ? - SGILOGENCODE_RANDITHER : SGILOGENCODE_NODITHER; - sp->tfunc = _logLuvNop; - - /* - * Install codec methods. - * NB: tif_decoderow & tif_encoderow are filled - * in at setup time. - */ - tif->tif_setupdecode = LogLuvSetupDecode; - tif->tif_decodestrip = LogLuvDecodeStrip; - tif->tif_decodetile = LogLuvDecodeTile; - tif->tif_setupencode = LogLuvSetupEncode; - tif->tif_encodestrip = LogLuvEncodeStrip; - tif->tif_encodetile = LogLuvEncodeTile; - tif->tif_close = LogLuvClose; - tif->tif_cleanup = LogLuvCleanup; - - /* override SetField so we can handle our private pseudo-tag */ - _TIFFMergeFieldInfo(tif, LogLuvFieldInfo, N(LogLuvFieldInfo)); - sp->vgetparent = tif->tif_tagmethods.vgetfield; - tif->tif_tagmethods.vgetfield = LogLuvVGetField; /* hook for codec tags */ - sp->vsetparent = tif->tif_tagmethods.vsetfield; - tif->tif_tagmethods.vsetfield = LogLuvVSetField; /* hook for codec tags */ - - return (1); -bad: - TIFFError(module, "%s: No space for LogLuv state block", tif->tif_name); - return (0); -} -#endif /* LOGLUV_SUPPORT */ diff --git a/wxWidgets/src/tiff/tif_lzw.c b/wxWidgets/src/tiff/tif_lzw.c deleted file mode 100644 index 9909ee43aa..0000000000 --- a/wxWidgets/src/tiff/tif_lzw.c +++ /dev/null @@ -1,745 +0,0 @@ -/* $Header$ */ - -/* - * Copyright (c) 1988-1997 Sam Leffler - * Copyright (c) 1991-1997 Silicon Graphics, Inc. - * - * Permission to use, copy, modify, distribute, and sell this software and - * its documentation for any purpose is hereby granted without fee, provided - * that (i) the above copyright notices and this permission notice appear in - * all copies of the software and related documentation, and (ii) the names of - * Sam Leffler and Silicon Graphics may not be used in any advertising or - * publicity relating to the software without the specific, prior written - * permission of Sam Leffler and Silicon Graphics. - * - * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, - * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * - * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR - * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, - * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF - * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE - * OF THIS SOFTWARE. - */ - -#include "tiffiop.h" -#ifdef LZW_SUPPORT -/* - * TIFF Library. - * Rev 5.0 Lempel-Ziv & Welch Compression Support - * - * This code is derived from the compress program whose code is - * derived from software contributed to Berkeley by James A. Woods, - * derived from original work by Spencer Thomas and Joseph Orost. - * - * The original Berkeley copyright notice appears below in its entirety. - */ -#include "tif_predict.h" - -#include -#include - -/* - * NB: The 5.0 spec describes a different algorithm than Aldus - * implements. Specifically, Aldus does code length transitions - * one code earlier than should be done (for real LZW). - * Earlier versions of this library implemented the correct - * LZW algorithm, but emitted codes in a bit order opposite - * to the TIFF spec. Thus, to maintain compatibility w/ Aldus - * we interpret MSB-LSB ordered codes to be images written w/ - * old versions of this library, but otherwise adhere to the - * Aldus "off by one" algorithm. - * - * Future revisions to the TIFF spec are expected to "clarify this issue". - */ -#define LZW_COMPAT /* include backwards compatibility code */ -/* - * Each strip of data is supposed to be terminated by a CODE_EOI. - * If the following #define is included, the decoder will also - * check for end-of-strip w/o seeing this code. This makes the - * library more robust, but also slower. - */ -#define LZW_CHECKEOS /* include checks for strips w/o EOI code */ - -#define MAXCODE(n) ((1L<<(n))-1) -/* - * The TIFF spec specifies that encoded bit - * strings range from 9 to 12 bits. - */ -#define BITS_MIN 9 /* start with 9 bits */ -#define BITS_MAX 12 /* max of 12 bit strings */ -/* predefined codes */ -#define CODE_CLEAR 256 /* code to clear string table */ -#define CODE_EOI 257 /* end-of-information code */ -#define CODE_FIRST 258 /* first free code entry */ -#define CODE_MAX MAXCODE(BITS_MAX) -#define HSIZE 9001L /* 91% occupancy */ -#define HSHIFT (13-8) -#ifdef LZW_COMPAT -/* NB: +1024 is for compatibility with old files */ -#define CSIZE (MAXCODE(BITS_MAX)+1024L) -#else -#define CSIZE (MAXCODE(BITS_MAX)+1L) -#endif - -/* - * State block for each open TIFF file using LZW - * compression/decompression. Note that the predictor - * state block must be first in this data structure. - */ -typedef struct { - TIFFPredictorState predict; /* predictor super class */ - - u_short nbits; /* # of bits/code */ - u_short maxcode; /* maximum code for lzw_nbits */ - u_short free_ent; /* next free entry in hash table */ - long nextdata; /* next bits of i/o */ - long nextbits; /* # of valid bits in lzw_nextdata */ -} LZWBaseState; - -#define lzw_nbits base.nbits -#define lzw_maxcode base.maxcode -#define lzw_free_ent base.free_ent -#define lzw_nextdata base.nextdata -#define lzw_nextbits base.nextbits - -/* - * Encoding-specific state. - */ -typedef uint16 hcode_t; /* codes fit in 16 bits */ - -/* - * Decoding-specific state. - */ -typedef struct code_ent { - struct code_ent *next; - u_short length; /* string len, including this token */ - u_char value; /* data value */ - u_char firstchar; /* first token of string */ -} code_t; - -typedef int (*decodeFunc)(TIFF*, tidata_t, tsize_t, tsample_t); - -typedef struct { - LZWBaseState base; - - /* Decoding specific data */ - long dec_nbitsmask; /* lzw_nbits 1 bits, right adjusted */ - long dec_restart; /* restart count */ -#ifdef LZW_CHECKEOS - long dec_bitsleft; /* available bits in raw data */ -#endif - decodeFunc dec_decode; /* regular or backwards compatible */ - code_t* dec_codep; /* current recognized code */ - code_t* dec_oldcodep; /* previously recognized code */ - code_t* dec_free_entp; /* next free entry */ - code_t* dec_maxcodep; /* max available entry */ - code_t* dec_codetab; /* kept separate for small machines */ -} LZWCodecState; - -#define LZWState(tif) ((LZWBaseState*) (tif)->tif_data) -#define DecoderState(tif) ((LZWCodecState*) LZWState(tif)) - -static int LZWDecode(TIFF*, tidata_t, tsize_t, tsample_t); -#ifdef LZW_COMPAT -static int LZWDecodeCompat(TIFF*, tidata_t, tsize_t, tsample_t); -#endif - -/* - * LZW Decoder. - */ - -#ifdef LZW_CHECKEOS -/* - * This check shouldn't be necessary because each - * strip is suppose to be terminated with CODE_EOI. - */ -#define NextCode(_tif, _sp, _bp, _code, _get) { \ - if ((_sp)->dec_bitsleft < nbits) { \ - TIFFWarning(_tif->tif_name, \ - "LZWDecode: Strip %d not terminated with EOI code", \ - _tif->tif_curstrip); \ - _code = CODE_EOI; \ - } else { \ - _get(_sp,_bp,_code); \ - (_sp)->dec_bitsleft -= nbits; \ - } \ -} -#else -#define NextCode(tif, sp, bp, code, get) get(sp, bp, code) -#endif - -static int -LZWSetupDecode(TIFF* tif) -{ - LZWCodecState* sp = DecoderState(tif); - static const char module[] = "LZWSetupDecode"; - int code; - - assert(sp != NULL); - - if (sp->dec_codetab == NULL) { - sp->dec_codetab = (code_t*)_TIFFmalloc(CSIZE*sizeof (code_t)); - if (sp->dec_codetab == NULL) { - TIFFError(module, "No space for LZW code table"); - return (0); - } - /* - * Pre-load the table. - */ - code = 255; - do { - sp->dec_codetab[code].value = (u_char) code; - sp->dec_codetab[code].firstchar = (u_char) code; - sp->dec_codetab[code].length = 1; - sp->dec_codetab[code].next = NULL; - } while (code--); - } - return (1); -} - -/* - * Setup state for decoding a strip. - */ -static int -LZWPreDecode(TIFF* tif, tsample_t s) -{ - LZWCodecState *sp = DecoderState(tif); - - (void) s; - assert(sp != NULL); - /* - * Check for old bit-reversed codes. - */ - if (tif->tif_rawdata[0] == 0 && (tif->tif_rawdata[1] & 0x1)) { -#ifdef LZW_COMPAT - if (!sp->dec_decode) { - TIFFWarning(tif->tif_name, - "Old-style LZW codes, convert file"); - /* - * Override default decoding methods with - * ones that deal with the old coding. - * Otherwise the predictor versions set - * above will call the compatibility routines - * through the dec_decode method. - */ - tif->tif_decoderow = LZWDecodeCompat; - tif->tif_decodestrip = LZWDecodeCompat; - tif->tif_decodetile = LZWDecodeCompat; - /* - * If doing horizontal differencing, must - * re-setup the predictor logic since we - * switched the basic decoder methods... - */ - (*tif->tif_setupdecode)(tif); - sp->dec_decode = LZWDecodeCompat; - } - sp->lzw_maxcode = MAXCODE(BITS_MIN); -#else /* !LZW_COMPAT */ - if (!sp->dec_decode) { - TIFFError(tif->tif_name, - "Old-style LZW codes not supported"); - sp->dec_decode = LZWDecode; - } - return (0); -#endif/* !LZW_COMPAT */ - } else { - sp->lzw_maxcode = MAXCODE(BITS_MIN)-1; - sp->dec_decode = LZWDecode; - } - sp->lzw_nbits = BITS_MIN; - sp->lzw_nextbits = 0; - sp->lzw_nextdata = 0; - - sp->dec_restart = 0; - sp->dec_nbitsmask = MAXCODE(BITS_MIN); -#ifdef LZW_CHECKEOS - sp->dec_bitsleft = tif->tif_rawcc << 3; -#endif - sp->dec_free_entp = sp->dec_codetab + CODE_FIRST; - /* - * Zero entries that are not yet filled in. We do - * this to guard against bogus input data that causes - * us to index into undefined entries. If you can - * come up with a way to safely bounds-check input codes - * while decoding then you can remove this operation. - */ - _TIFFmemset(sp->dec_free_entp, 0, (CSIZE-CODE_FIRST)*sizeof (code_t)); - sp->dec_oldcodep = &sp->dec_codetab[-1]; - sp->dec_maxcodep = &sp->dec_codetab[sp->dec_nbitsmask-1]; - return (1); -} - -/* - * Decode a "hunk of data". - */ -#define GetNextCode(sp, bp, code) { \ - nextdata = (nextdata<<8) | *(bp)++; \ - nextbits += 8; \ - if (nextbits < nbits) { \ - nextdata = (nextdata<<8) | *(bp)++; \ - nextbits += 8; \ - } \ - code = (hcode_t)((nextdata >> (nextbits-nbits)) & nbitsmask); \ - nextbits -= nbits; \ -} - -static void -codeLoop(TIFF* tif) -{ - TIFFError(tif->tif_name, - "LZWDecode: Bogus encoding, loop in the code table; scanline %d", - tif->tif_row); -} - -static int -LZWDecode(TIFF* tif, tidata_t op0, tsize_t occ0, tsample_t s) -{ - LZWCodecState *sp = DecoderState(tif); - char *op = (char*) op0; - long occ = (long) occ0; - char *tp; - u_char *bp; - hcode_t code; - int len; - long nbits, nextbits, nextdata, nbitsmask; - code_t *codep, *free_entp, *maxcodep, *oldcodep; - - (void) s; - assert(sp != NULL); - /* - * Restart interrupted output operation. - */ - if (sp->dec_restart) { - long residue; - - codep = sp->dec_codep; - residue = codep->length - sp->dec_restart; - if (residue > occ) { - /* - * Residue from previous decode is sufficient - * to satisfy decode request. Skip to the - * start of the decoded string, place decoded - * values in the output buffer, and return. - */ - sp->dec_restart += occ; - do { - codep = codep->next; - } while (--residue > occ && codep); - if (codep) { - tp = op + occ; - do { - *--tp = codep->value; - codep = codep->next; - } while (--occ && codep); - } - return (1); - } - /* - * Residue satisfies only part of the decode request. - */ - op += residue, occ -= residue; - tp = op; - do { - int t; - --tp; - t = codep->value; - codep = codep->next; - *tp = (char) t; - } while (--residue && codep); - sp->dec_restart = 0; - } - - bp = (u_char *)tif->tif_rawcp; - nbits = sp->lzw_nbits; - nextdata = sp->lzw_nextdata; - nextbits = sp->lzw_nextbits; - nbitsmask = sp->dec_nbitsmask; - oldcodep = sp->dec_oldcodep; - free_entp = sp->dec_free_entp; - maxcodep = sp->dec_maxcodep; - - while (occ > 0) { - NextCode(tif, sp, bp, code, GetNextCode); - if (code == CODE_EOI) - break; - if (code == CODE_CLEAR) { - free_entp = sp->dec_codetab + CODE_FIRST; - nbits = BITS_MIN; - nbitsmask = MAXCODE(BITS_MIN); - maxcodep = sp->dec_codetab + nbitsmask-1; - NextCode(tif, sp, bp, code, GetNextCode); - if (code == CODE_EOI) - break; - *op++ = (char)code, occ--; - oldcodep = sp->dec_codetab + code; - continue; - } - codep = sp->dec_codetab + code; - - /* - * Add the new entry to the code table. - */ - if (free_entp < &sp->dec_codetab[0] || - free_entp >= &sp->dec_codetab[CSIZE]) { - TIFFError(tif->tif_name, - "LZWDecode: Corrupted LZW table at scanline %d", - tif->tif_row); - return (0); - } - - free_entp->next = oldcodep; - if (free_entp->next < &sp->dec_codetab[0] || - free_entp->next >= &sp->dec_codetab[CSIZE]) { - TIFFError(tif->tif_name, - "LZWDecode: Corrupted LZW table at scanline %d", - tif->tif_row); - return (0); - } - free_entp->firstchar = free_entp->next->firstchar; - free_entp->length = free_entp->next->length+1; - free_entp->value = (codep < free_entp) ? - codep->firstchar : free_entp->firstchar; - if (++free_entp > maxcodep) { - if (++nbits > BITS_MAX) /* should not happen */ - nbits = BITS_MAX; - nbitsmask = MAXCODE(nbits); - maxcodep = sp->dec_codetab + nbitsmask-1; - } - oldcodep = codep; - if (code >= 256) { - /* - * Code maps to a string, copy string - * value to output (written in reverse). - */ - if(codep->length == 0) { - TIFFError(tif->tif_name, - "LZWDecode: Wrong length of decoded string: " - "data probably corrupted at scanline %d", - tif->tif_row); - return (0); - } - if (codep->length > occ) { - /* - * String is too long for decode buffer, - * locate portion that will fit, copy to - * the decode buffer, and setup restart - * logic for the next decoding call. - */ - sp->dec_codep = codep; - do { - codep = codep->next; - } while (codep && codep->length > occ); - if (codep) { - sp->dec_restart = occ; - tp = op + occ; - do { - *--tp = codep->value; - codep = codep->next; - } while (--occ && codep); - if (codep) - codeLoop(tif); - } - break; - } - len = codep->length; - tp = op + len; - do { - int t; - --tp; - t = codep->value; - codep = codep->next; - *tp = (char) t; - } while (codep && tp > op); - if (codep) { - codeLoop(tif); - break; - } - op += len, occ -= len; - } else - *op++ = (char)code, occ--; - } - - tif->tif_rawcp = (tidata_t) bp; - sp->lzw_nbits = (u_short) nbits; - sp->lzw_nextdata = nextdata; - sp->lzw_nextbits = nextbits; - sp->dec_nbitsmask = nbitsmask; - sp->dec_oldcodep = oldcodep; - sp->dec_free_entp = free_entp; - sp->dec_maxcodep = maxcodep; - - if (occ > 0) { - TIFFError(tif->tif_name, - "LZWDecode: Not enough data at scanline %d (short %d bytes)", - tif->tif_row, occ); - return (0); - } - return (1); -} - -#ifdef LZW_COMPAT -/* - * Decode a "hunk of data" for old images. - */ -#define GetNextCodeCompat(sp, bp, code) { \ - nextdata |= (u_long) *(bp)++ << nextbits; \ - nextbits += 8; \ - if (nextbits < nbits) { \ - nextdata |= (u_long) *(bp)++ << nextbits; \ - nextbits += 8; \ - } \ - code = (hcode_t)(nextdata & nbitsmask); \ - nextdata >>= nbits; \ - nextbits -= nbits; \ -} - -static int -LZWDecodeCompat(TIFF* tif, tidata_t op0, tsize_t occ0, tsample_t s) -{ - LZWCodecState *sp = DecoderState(tif); - char *op = (char*) op0; - long occ = (long) occ0; - char *tp; - u_char *bp; - int code, nbits; - long nextbits, nextdata, nbitsmask; - code_t *codep, *free_entp, *maxcodep, *oldcodep; - - (void) s; - assert(sp != NULL); - /* - * Restart interrupted output operation. - */ - if (sp->dec_restart) { - long residue; - - codep = sp->dec_codep; - residue = codep->length - sp->dec_restart; - if (residue > occ) { - /* - * Residue from previous decode is sufficient - * to satisfy decode request. Skip to the - * start of the decoded string, place decoded - * values in the output buffer, and return. - */ - sp->dec_restart += occ; - do { - codep = codep->next; - } while (--residue > occ); - tp = op + occ; - do { - *--tp = codep->value; - codep = codep->next; - } while (--occ); - return (1); - } - /* - * Residue satisfies only part of the decode request. - */ - op += residue, occ -= residue; - tp = op; - do { - *--tp = codep->value; - codep = codep->next; - } while (--residue); - sp->dec_restart = 0; - } - - bp = (u_char *)tif->tif_rawcp; - nbits = sp->lzw_nbits; - nextdata = sp->lzw_nextdata; - nextbits = sp->lzw_nextbits; - nbitsmask = sp->dec_nbitsmask; - oldcodep = sp->dec_oldcodep; - free_entp = sp->dec_free_entp; - maxcodep = sp->dec_maxcodep; - - while (occ > 0) { - NextCode(tif, sp, bp, code, GetNextCodeCompat); - if (code == CODE_EOI) - break; - if (code == CODE_CLEAR) { - free_entp = sp->dec_codetab + CODE_FIRST; - nbits = BITS_MIN; - nbitsmask = MAXCODE(BITS_MIN); - maxcodep = sp->dec_codetab + nbitsmask; - NextCode(tif, sp, bp, code, GetNextCodeCompat); - if (code == CODE_EOI) - break; - *op++ = (char) code, occ--; - oldcodep = sp->dec_codetab + code; - continue; - } - codep = sp->dec_codetab + code; - - /* - * Add the new entry to the code table. - */ - if (free_entp < &sp->dec_codetab[0] || - free_entp >= &sp->dec_codetab[CSIZE]) { - TIFFError(tif->tif_name, - "LZWDecodeCompat: Corrupted LZW table at scanline %d", - tif->tif_row); - return (0); - } - - free_entp->next = oldcodep; - if (free_entp->next < &sp->dec_codetab[0] || - free_entp->next >= &sp->dec_codetab[CSIZE]) { - TIFFError(tif->tif_name, - "LZWDecodeCompat: Corrupted LZW table at scanline %d", - tif->tif_row); - return (0); - } - free_entp->firstchar = free_entp->next->firstchar; - free_entp->length = free_entp->next->length+1; - free_entp->value = (codep < free_entp) ? - codep->firstchar : free_entp->firstchar; - if (++free_entp > maxcodep) { - if (++nbits > BITS_MAX) /* should not happen */ - nbits = BITS_MAX; - nbitsmask = MAXCODE(nbits); - maxcodep = sp->dec_codetab + nbitsmask; - } - oldcodep = codep; - if (code >= 256) { - /* - * Code maps to a string, copy string - * value to output (written in reverse). - */ - if(codep->length == 0) { - TIFFError(tif->tif_name, - "LZWDecodeCompat: Wrong length of decoded " - "string: data probably corrupted at scanline %d", - tif->tif_row); - return (0); - } - if (codep->length > occ) { - /* - * String is too long for decode buffer, - * locate portion that will fit, copy to - * the decode buffer, and setup restart - * logic for the next decoding call. - */ - sp->dec_codep = codep; - do { - codep = codep->next; - } while (codep->length > occ); - sp->dec_restart = occ; - tp = op + occ; - do { - *--tp = codep->value; - codep = codep->next; - } while (--occ); - break; - } - op += codep->length, occ -= codep->length; - tp = op; - do { - *--tp = codep->value; - } while( (codep = codep->next) != NULL); - } else - *op++ = (char) code, occ--; - } - - tif->tif_rawcp = (tidata_t) bp; - sp->lzw_nbits = (u_short) nbits; - sp->lzw_nextdata = nextdata; - sp->lzw_nextbits = nextbits; - sp->dec_nbitsmask = nbitsmask; - sp->dec_oldcodep = oldcodep; - sp->dec_free_entp = free_entp; - sp->dec_maxcodep = maxcodep; - - if (occ > 0) { - TIFFError(tif->tif_name, - "LZWDecodeCompat: Not enough data at scanline %d (short %d bytes)", - tif->tif_row, occ); - return (0); - } - return (1); -} -#endif /* LZW_COMPAT */ - - - -static void -LZWCleanup(TIFF* tif) -{ - if (tif->tif_data) { - if (DecoderState(tif)->dec_codetab) - _TIFFfree(DecoderState(tif)->dec_codetab); - _TIFFfree(tif->tif_data); - tif->tif_data = NULL; - } -} - -static int -LZWSetupEncode(TIFF* tif) -{ - TIFFError(tif->tif_name, - "LZW compression is not available to due to Unisys patent enforcement"); - return (0); -} - -int -TIFFInitLZW(TIFF* tif, int scheme) -{ - assert(scheme == COMPRESSION_LZW); - - /* - * Allocate state block so tag methods have storage to record values. - */ - tif->tif_data = (tidata_t) _TIFFmalloc(sizeof (LZWCodecState)); - if (tif->tif_data == NULL) - goto bad; - DecoderState(tif)->dec_codetab = NULL; - DecoderState(tif)->dec_decode = NULL; - - /* - * Install codec methods. - */ - tif->tif_setupencode = LZWSetupEncode; - tif->tif_setupdecode = LZWSetupDecode; - tif->tif_predecode = LZWPreDecode; - tif->tif_decoderow = LZWDecode; - tif->tif_decodestrip = LZWDecode; - tif->tif_decodetile = LZWDecode; - tif->tif_cleanup = LZWCleanup; - - /* - * Setup predictor setup. - */ - (void) TIFFPredictorInit(tif); - - return (1); - -bad: - TIFFError("TIFFInitLZW", "No space for LZW state block"); - return (0); -} - -/* - * Copyright (c) 1985, 1986 The Regents of the University of California. - * All rights reserved. - * - * This code is derived from software contributed to Berkeley by - * James A. Woods, derived from original work by Spencer Thomas - * and Joseph Orost. - * - * Redistribution and use in source and binary forms are permitted - * provided that the above copyright notice and this paragraph are - * duplicated in all such forms and that any documentation, - * advertising materials, and other materials related to such - * distribution and use acknowledge that the software was developed - * by the University of California, Berkeley. The name of the - * University may not be used to endorse or promote products derived - * from this software without specific prior written permission. - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED - * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. - */ -#endif /* LZW_SUPPORT */ diff --git a/wxWidgets/src/tiff/tif_msdos.c b/wxWidgets/src/tiff/tif_msdos.c deleted file mode 100644 index 227409d719..0000000000 --- a/wxWidgets/src/tiff/tif_msdos.c +++ /dev/null @@ -1,179 +0,0 @@ -/* $Header$ */ - -/* - * Copyright (c) 1988-1997 Sam Leffler - * Copyright (c) 1991-1997 Silicon Graphics, Inc. - * - * Permission to use, copy, modify, distribute, and sell this software and - * its documentation for any purpose is hereby granted without fee, provided - * that (i) the above copyright notices and this permission notice appear in - * all copies of the software and related documentation, and (ii) the names of - * Sam Leffler and Silicon Graphics may not be used in any advertising or - * publicity relating to the software without the specific, prior written - * permission of Sam Leffler and Silicon Graphics. - * - * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, - * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * - * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR - * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, - * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF - * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE - * OF THIS SOFTWARE. - */ - -/* - * TIFF Library MSDOS-specific Routines. - */ -#if defined(__WATCOMC__) || defined(__BORLANDC__) || defined(_MSC_VER) -#include /* for open, close, etc. function prototypes */ -#include -#endif -#include "tiffiop.h" - -static tsize_t -_tiffReadProc(thandle_t fd, tdata_t buf, tsize_t size) -{ - return (read((int) fd, buf, size)); -} - -static tsize_t -_tiffWriteProc(thandle_t fd, tdata_t buf, tsize_t size) -{ - return (write((int) fd, buf, size)); -} - -static toff_t -_tiffSeekProc(thandle_t fd, toff_t off, int whence) -{ - return (lseek((int) fd, (off_t) off, whence)); -} - -static int -_tiffCloseProc(thandle_t fd) -{ - return (close((int) fd)); -} - -#include - -static toff_t -_tiffSizeProc(thandle_t fd) -{ - struct stat sb; - return (fstat((int) fd, &sb) < 0 ? 0 : sb.st_size); -} - -static int -_tiffMapProc(thandle_t fd, tdata_t* pbase, toff_t* psize) -{ - return (0); -} - -static void -_tiffUnmapProc(thandle_t fd, tdata_t base, toff_t size) -{ -} - -/* - * Open a TIFF file descriptor for read/writing. - */ -TIFF* -TIFFFdOpen(int fd, const char* name, const char* mode) -{ - TIFF* tif; - - tif = TIFFClientOpen(name, mode, - (void*) fd, - _tiffReadProc, _tiffWriteProc, _tiffSeekProc, _tiffCloseProc, - _tiffSizeProc, _tiffMapProc, _tiffUnmapProc); - if (tif) - tif->tif_fd = fd; - return (tif); -} - -/* - * Open a TIFF file for read/writing. - */ -TIFF* -TIFFOpen(const char* name, const char* mode) -{ - static const char module[] = "TIFFOpen"; - int m, fd; - - m = _TIFFgetMode(mode, module); - if (m == -1) - return ((TIFF*)0); - fd = open(name, m|O_BINARY, 0666); - if (fd < 0) { - TIFFError(module, "%s: Cannot open", name); - return ((TIFF*)0); - } - return (TIFFFdOpen(fd, name, mode)); -} - -#ifdef __GNUC__ -extern char* malloc(); -extern char* realloc(); -#else -#include -#endif - -tdata_t -_TIFFmalloc(tsize_t s) -{ - return (malloc((size_t) s)); -} - -void -_TIFFfree(tdata_t p) -{ - free(p); -} - -tdata_t -_TIFFrealloc(tdata_t p, tsize_t s) -{ - return (realloc(p, (size_t) s)); -} - -void -_TIFFmemset(tdata_t p, int v, tsize_t c) -{ - memset(p, v, (size_t) c); -} - -void -_TIFFmemcpy(tdata_t d, const tdata_t s, tsize_t c) -{ - memcpy(d, s, (size_t) c); -} - -int -_TIFFmemcmp(const tdata_t p1, const tdata_t p2, tsize_t c) -{ - return (memcmp(p1, p2, (size_t) c)); -} - -static void -msdosWarningHandler(const char* module, const char* fmt, va_list ap) -{ - if (module != NULL) - fprintf(stderr, "%s: ", module); - fprintf(stderr, "Warning, "); - vfprintf(stderr, fmt, ap); - fprintf(stderr, ".\n"); -} -TIFFErrorHandler _TIFFwarningHandler = msdosWarningHandler; - -static void -msdosErrorHandler(const char* module, const char* fmt, va_list ap) -{ - if (module != NULL) - fprintf(stderr, "%s: ", module); - vfprintf(stderr, fmt, ap); - fprintf(stderr, ".\n"); -} -TIFFErrorHandler _TIFFerrorHandler = msdosErrorHandler; diff --git a/wxWidgets/src/tiff/tif_next.c b/wxWidgets/src/tiff/tif_next.c deleted file mode 100644 index 42d631e07f..0000000000 --- a/wxWidgets/src/tiff/tif_next.c +++ /dev/null @@ -1,142 +0,0 @@ -/* $Header$ */ - -/* - * Copyright (c) 1988-1997 Sam Leffler - * Copyright (c) 1991-1997 Silicon Graphics, Inc. - * - * Permission to use, copy, modify, distribute, and sell this software and - * its documentation for any purpose is hereby granted without fee, provided - * that (i) the above copyright notices and this permission notice appear in - * all copies of the software and related documentation, and (ii) the names of - * Sam Leffler and Silicon Graphics may not be used in any advertising or - * publicity relating to the software without the specific, prior written - * permission of Sam Leffler and Silicon Graphics. - * - * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, - * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * - * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR - * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, - * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF - * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE - * OF THIS SOFTWARE. - */ - -#include "tiffiop.h" -#ifdef NEXT_SUPPORT -/* - * TIFF Library. - * - * NeXT 2-bit Grey Scale Compression Algorithm Support - */ - -#define SETPIXEL(op, v) { \ - switch (npixels++ & 3) { \ - case 0: op[0] = (u_char) ((v) << 6); break; \ - case 1: op[0] |= (v) << 4; break; \ - case 2: op[0] |= (v) << 2; break; \ - case 3: *op++ |= (v); break; \ - } \ -} - -#define LITERALROW 0x00 -#define LITERALSPAN 0x40 -#define WHITE ((1<<2)-1) - -static int -NeXTDecode(TIFF* tif, tidata_t buf, tsize_t occ, tsample_t s) -{ - register u_char *bp, *op; - register tsize_t cc; - register int n; - tidata_t row; - tsize_t scanline; - - (void) s; - /* - * Each scanline is assumed to start off as all - * white (we assume a PhotometricInterpretation - * of ``min-is-black''). - */ - for (op = buf, cc = occ; cc-- > 0;) - *op++ = 0xff; - - bp = (u_char *)tif->tif_rawcp; - cc = tif->tif_rawcc; - scanline = tif->tif_scanlinesize; - for (row = buf; (long)occ > 0; occ -= scanline, row += scanline) { - n = *bp++, cc--; - switch (n) { - case LITERALROW: - /* - * The entire scanline is given as literal values. - */ - if (cc < scanline) - goto bad; - _TIFFmemcpy(row, bp, scanline); - bp += scanline; - cc -= scanline; - break; - case LITERALSPAN: { - int off; - /* - * The scanline has a literal span - * that begins at some offset. - */ - off = (bp[0] * 256) + bp[1]; - n = (bp[2] * 256) + bp[3]; - if (cc < 4+n || off+n > scanline) - goto bad; - _TIFFmemcpy(row+off, bp+4, n); - bp += 4+n; - cc -= 4+n; - break; - } - default: { - register int npixels = 0, grey; - u_long imagewidth = tif->tif_dir.td_imagewidth; - - /* - * The scanline is composed of a sequence - * of constant color ``runs''. We shift - * into ``run mode'' and interpret bytes - * as codes of the form - * until we've filled the scanline. - */ - op = row; - for (;;) { - grey = (n>>6) & 0x3; - n &= 0x3f; - while (n-- > 0) - SETPIXEL(op, grey); - if (npixels >= (int) imagewidth) - break; - if (cc == 0) - goto bad; - n = *bp++, cc--; - } - break; - } - } - } - tif->tif_rawcp = (tidata_t) bp; - tif->tif_rawcc = cc; - return (1); -bad: - TIFFError(tif->tif_name, "NeXTDecode: Not enough data for scanline %ld", - (long) tif->tif_row); - return (0); -} - -int -TIFFInitNeXT(TIFF* tif, int scheme) -{ - (void) scheme; - tif->tif_decoderow = NeXTDecode; - tif->tif_decodestrip = NeXTDecode; - tif->tif_decodetile = NeXTDecode; - return (1); -} -#endif /* NEXT_SUPPORT */ diff --git a/wxWidgets/src/tiff/tif_ojpeg.c b/wxWidgets/src/tiff/tif_ojpeg.c deleted file mode 100644 index a4426475f1..0000000000 --- a/wxWidgets/src/tiff/tif_ojpeg.c +++ /dev/null @@ -1,2630 +0,0 @@ -#include "tiffiop.h" -#ifdef OJPEG_SUPPORT - -/* JPEG Compression support, as per the original TIFF 6.0 specification. - - WARNING: KLUDGE ALERT! The type of JPEG encapsulation defined by the TIFF - Version 6.0 specification is now totally obsolete and - deprecated for new applications and images. This file is an unsupported hack - that was created solely in order to read (but NOT write!) a few old, - unconverted images still present on some users' computer systems. The code - isn't pretty or robust, and it won't read every "old format" JPEG-in-TIFF - file (see Samuel Leffler's draft "TIFF Technical Note No. 2" for a long and - incomplete list of known problems), but it seems to work well enough in the - few cases of practical interest to the author; so, "caveat emptor"! This - file should NEVER be enhanced to write new images using anything other than - the latest approved JPEG-in-TIFF encapsulation method, implemented by the - "tif_jpeg.c" file elsewhere in this library. - - This file interfaces with Release 6B of the JPEG Library written by theu - Independent JPEG Group, which you can find on the Internet at: - ftp://ftp.uu.net:/graphics/jpeg/. - - The "C" Preprocessor macros, "[CD]_LOSSLESS_SUPPORTED", are defined by your - JPEG Library Version 6B only if you have applied a (massive!) patch by Ken - Murchison of Oceana Matrix Ltd. to support lossless Huffman - encoding (TIFF "JPEGProc" tag value = 14). This patch can be found on the - Internet at: ftp://ftp.oceana.com/pub/ljpeg-6b.tar.gz. - - Some old files produced by the Wang Imaging application for Microsoft Windows - apparently can be decoded only with a special patch to the JPEG Library, - which defines a subroutine named "jpeg_reset_huff_decode()" in its "jdhuff.c" - module (the "jdshuff.c" module, if Ken Murchison's patch has been applied). - Unfortunately the patch differs slightly in each case, and some TIFF Library - have reported problems finding the code, so both versions appear below; you - should carefully extract and apply only the version that applies to your JPEG - Library! - - Contributed by Scott Marovich with considerable help - from Charles Auer to unravel the mysteries of image files - created by the Wang Imaging application for Microsoft Windows. -*/ -#if 0 /* Patch for JPEG Library WITHOUT lossless Huffman coding */ -*** jdhuff.c.orig Mon Oct 20 17:51:10 1997 ---- jdhuff.c Sun Nov 11 17:33:58 2001 -*************** -*** 648,651 **** ---- 648,683 ---- - for (i = 0; i < NUM_HUFF_TBLS; i++) { - entropy->dc_derived_tbls[i] = entropy->ac_derived_tbls[i] = NULL; - } - } -+ -+ /* -+ * BEWARE OF KLUDGE: This subroutine is a hack for decoding illegal JPEG-in- -+ * TIFF encapsulations produced by Microsoft's Wang Imaging -+ * for Windows application with the public-domain TIFF Library. Based upon an -+ * examination of selected output files, this program apparently divides a JPEG -+ * bit-stream into consecutive horizontal TIFF "strips", such that the JPEG -+ * encoder's/decoder's DC coefficients for each image component are reset before -+ * each "strip". Moreover, a "strip" is not necessarily encoded in a multiple -+ * of 8 bits, so one must sometimes discard 1-7 bits at the end of each "strip" -+ * for alignment to the next input-Byte storage boundary. IJG JPEG Library -+ * decoder state is not normally exposed to client applications, so this sub- -+ * routine provides the TIFF Library with a "hook" to make these corrections. -+ * It should be called after "jpeg_start_decompress()" and before -+ * "jpeg_finish_decompress()", just before decoding each "strip" using -+ * "jpeg_read_raw_data()" or "jpeg_read_scanlines()". -+ * -+ * This kludge is not sanctioned or supported by the Independent JPEG Group, and -+ * future changes to the IJG JPEG Library might invalidate it. Do not send bug -+ * reports about this code to IJG developers. Instead, contact the author for -+ * advice: Scott B. Marovich , Hewlett-Packard Labs, 6/01. -+ */ -+ GLOBAL(void) -+ jpeg_reset_huff_decode (register j_decompress_ptr cinfo) -+ { register huff_entropy_ptr entropy = (huff_entropy_ptr)cinfo->entropy; -+ register int ci = 0; -+ -+ /* Discard encoded input bits, up to the next Byte boundary */ -+ entropy->bitstate.bits_left &= ~7; -+ /* Re-initialize DC predictions to 0 */ -+ do entropy->saved.last_dc_val[ci] = 0; while (++ci < cinfo->comps_in_scan); -+ } -#endif /* Patch for JPEG Library WITHOUT lossless Huffman coding */ -#if 0 /* Patch for JPEG Library WITH lossless Huffman coding */ -*** jdshuff.c.orig Mon Mar 11 16:44:54 2002 ---- jdshuff.c Mon Mar 11 16:44:54 2002 -*************** -*** 357,360 **** ---- 357,393 ---- - for (i = 0; i < NUM_HUFF_TBLS; i++) { - entropy->dc_derived_tbls[i] = entropy->ac_derived_tbls[i] = NULL; - } - } -+ -+ /* -+ * BEWARE OF KLUDGE: This subroutine is a hack for decoding illegal JPEG-in- -+ * TIFF encapsulations produced by Microsoft's Wang Imaging -+ * for Windows application with the public-domain TIFF Library. Based upon an -+ * examination of selected output files, this program apparently divides a JPEG -+ * bit-stream into consecutive horizontal TIFF "strips", such that the JPEG -+ * encoder's/decoder's DC coefficients for each image component are reset before -+ * each "strip". Moreover, a "strip" is not necessarily encoded in a multiple -+ * of 8 bits, so one must sometimes discard 1-7 bits at the end of each "strip" -+ * for alignment to the next input-Byte storage boundary. IJG JPEG Library -+ * decoder state is not normally exposed to client applications, so this sub- -+ * routine provides the TIFF Library with a "hook" to make these corrections. -+ * It should be called after "jpeg_start_decompress()" and before -+ * "jpeg_finish_decompress()", just before decoding each "strip" using -+ * "jpeg_read_raw_data()" or "jpeg_read_scanlines()". -+ * -+ * This kludge is not sanctioned or supported by the Independent JPEG Group, and -+ * future changes to the IJG JPEG Library might invalidate it. Do not send bug -+ * reports about this code to IJG developers. Instead, contact the author for -+ * advice: Scott B. Marovich , Hewlett-Packard Labs, 6/01. -+ */ -+ GLOBAL(void) -+ jpeg_reset_huff_decode (register j_decompress_ptr cinfo) -+ { register shuff_entropy_ptr entropy = (shuff_entropy_ptr) -+ ((j_lossy_d_ptr)cinfo->codec)->entropy_private; -+ register int ci = 0; -+ -+ /* Discard encoded input bits, up to the next Byte boundary */ -+ entropy->bitstate.bits_left &= ~7; -+ /* Re-initialize DC predictions to 0 */ -+ do entropy->saved.last_dc_val[ci] = 0; while (++ci < cinfo->comps_in_scan); -+ } -#endif /* Patch for JPEG Library WITH lossless Huffman coding */ -#include -#include -#ifdef FAR -#undef FAR /* Undefine FAR to avoid conflict with JPEG definition */ -#endif -#define JPEG_INTERNALS /* Include "jpegint.h" for "DSTATE_*" symbols */ -#define JPEG_CJPEG_DJPEG /* Include all Version 6B+ "jconfig.h" options */ -#undef INLINE -#include "jpeglib.h" -#undef JPEG_CJPEG_DJPEG -#undef JPEG_INTERNALS - -/* Hack for files produced by Wang Imaging application on Microsoft Windows */ -extern void jpeg_reset_huff_decode(j_decompress_ptr); - -/* On some machines, it may be worthwhile to use "_setjmp()" or "sigsetjmp()" - instead of "setjmp()". These macros make it easier: -*/ -#define SETJMP(jbuf)setjmp(jbuf) -#define LONGJMP(jbuf,code)longjmp(jbuf,code) -#define JMP_BUF jmp_buf - -#define TIFFTAG_WANG_PAGECONTROL 32934 - -/* Bit-vector offsets for keeping track of TIFF records that we've parsed. */ - -#define FIELD_JPEGPROC FIELD_CODEC -#define FIELD_JPEGIFOFFSET (FIELD_CODEC+1) -#define FIELD_JPEGIFBYTECOUNT (FIELD_CODEC+2) -#define FIELD_JPEGRESTARTINTERVAL (FIELD_CODEC+3) -#define FIELD_JPEGTABLES (FIELD_CODEC+4) /* New, post-6.0 JPEG-in-TIFF tag! */ -#define FIELD_JPEGLOSSLESSPREDICTORS (FIELD_CODEC+5) -#define FIELD_JPEGPOINTTRANSFORM (FIELD_CODEC+6) -#define FIELD_JPEGQTABLES (FIELD_CODEC+7) -#define FIELD_JPEGDCTABLES (FIELD_CODEC+8) -#define FIELD_JPEGACTABLES (FIELD_CODEC+9) -#define FIELD_WANG_PAGECONTROL (FIELD_CODEC+10) -#define FIELD_JPEGCOLORMODE (FIELD_CODEC+11) - -typedef struct jpeg_destination_mgr jpeg_destination_mgr; -typedef struct jpeg_source_mgr jpeg_source_mgr; -typedef struct jpeg_error_mgr jpeg_error_mgr; - -/* State variable for each open TIFF file that uses "libjpeg" for JPEG - decompression. (Note: This file should NEVER perform JPEG compression - except in the manner implemented by the "tif_jpeg.c" file, elsewhere in this - library; see comments above.) JPEG Library internal state is recorded in a - "jpeg_{de}compress_struct", while a "jpeg_common_struct" records a few items - common to both compression and expansion. The "cinfo" field containing JPEG - Library state MUST be the 1st member of our own state variable, so that we - can safely "cast" pointers back and forth. -*/ -typedef struct /* This module's private, per-image state variable */ - { - union /* JPEG Library state variable; this MUST be our 1st field! */ - { - struct jpeg_compress_struct c; - struct jpeg_decompress_struct d; - struct jpeg_common_struct comm; - } cinfo; - jpeg_error_mgr err; /* JPEG Library error manager */ - JMP_BUF exit_jmpbuf; /* ...for catching JPEG Library failures */ -# ifdef never - - /* (The following two fields could be a "union", but they're small enough that - it's not worth the effort.) - */ - jpeg_destination_mgr dest; /* Destination for compressed data */ -# endif - jpeg_source_mgr src; /* Source of expanded data */ - JSAMPARRAY ds_buffer[MAX_COMPONENTS]; /* ->Temporary downsampling buffers */ - TIFF *tif; /* Reverse pointer, needed by some code */ - TIFFVGetMethod vgetparent; /* "Super class" methods... */ - TIFFVSetMethod vsetparent; - TIFFStripMethod defsparent; - TIFFTileMethod deftparent; - void *jpegtables; /* ->"New" JPEG tables, if we synthesized any */ - uint32 is_WANG, /* <=> Wang Imaging for Microsoft Windows output file? */ - jpegtables_length; /* Length of "new" JPEG tables, if they exist */ - tsize_t bytesperline; /* No. of decompressed Bytes per scan line */ - int jpegquality, /* Compression quality level */ - jpegtablesmode, /* What to put in JPEGTables */ - samplesperclump, - scancount; /* No. of scan lines accumulated */ - J_COLOR_SPACE photometric; /* IJG JPEG Library's photometry code */ - u_char h_sampling, /* Luminance sampling factors */ - v_sampling, - jpegcolormode; /* Who performs RGB <-> YCbCr conversion? */ - /* JPEGCOLORMODE_RAW <=> TIFF Library or its client */ - /* JPEGCOLORMODE_RGB <=> JPEG Library */ - /* These fields are added to support TIFFGetField */ - uint16 jpegproc; - uint32 jpegifoffset; - uint32 jpegifbytecount; - uint32 jpegrestartinterval; - void* jpeglosslesspredictors; - uint16 jpeglosslesspredictors_length; - void* jpegpointtransform; - uint32 jpegpointtransform_length; - void* jpegqtables; - uint32 jpegqtables_length; - void* jpegdctables; - uint32 jpegdctables_length; - void* jpegactables; - uint32 jpegactables_length; - - } OJPEGState; -#define OJState(tif)((OJPEGState*)(tif)->tif_data) - -static const TIFFFieldInfo ojpegFieldInfo[]=/* JPEG-specific TIFF-record tags */ - { - - /* This is the current JPEG-in-TIFF metadata-encapsulation tag, and its - treatment in this file is idiosyncratic. It should never appear in a - "source" image conforming to the TIFF Version 6.0 specification, so we - arrange to report an error if it appears. But in order to support possible - future conversion of "old" JPEG-in-TIFF encapsulations to "new" ones, we - might wish to synthesize an equivalent value to be returned by the TIFF - Library's "getfield" method. So, this table tells the TIFF Library to pass - these records to us in order to filter them below. - */ - { - TIFFTAG_JPEGTABLES ,TIFF_VARIABLE,TIFF_VARIABLE, - TIFF_UNDEFINED,FIELD_JPEGTABLES ,FALSE,TRUE ,"JPEGTables" - }, - - /* These tags are defined by the TIFF Version 6.0 specification and are now - obsolete. This module reads them from an old "source" image, but it never - writes them to a new "destination" image. - */ - { - TIFFTAG_JPEGPROC ,1 ,1 , - TIFF_SHORT ,FIELD_JPEGPROC ,FALSE,FALSE,"JPEGProc" - }, - { - TIFFTAG_JPEGIFOFFSET ,1 ,1 , - TIFF_LONG ,FIELD_JPEGIFOFFSET ,FALSE,FALSE,"JPEGInterchangeFormat" - }, - { - TIFFTAG_JPEGIFBYTECOUNT ,1 ,1 , - TIFF_LONG ,FIELD_JPEGIFBYTECOUNT ,FALSE,FALSE,"JPEGInterchangeFormatLength" - }, - { - TIFFTAG_JPEGRESTARTINTERVAL ,1 ,1 , - TIFF_SHORT ,FIELD_JPEGRESTARTINTERVAL ,FALSE,FALSE,"JPEGRestartInterval" - }, - { - TIFFTAG_JPEGLOSSLESSPREDICTORS,TIFF_VARIABLE,TIFF_VARIABLE, - TIFF_SHORT ,FIELD_JPEGLOSSLESSPREDICTORS,FALSE,TRUE ,"JPEGLosslessPredictors" - }, - { - TIFFTAG_JPEGPOINTTRANSFORM ,TIFF_VARIABLE,TIFF_VARIABLE, - TIFF_SHORT ,FIELD_JPEGPOINTTRANSFORM ,FALSE,TRUE ,"JPEGPointTransforms" - }, - { - TIFFTAG_JPEGQTABLES ,TIFF_VARIABLE,TIFF_VARIABLE, - TIFF_LONG ,FIELD_JPEGQTABLES ,FALSE,TRUE ,"JPEGQTables" - }, - { - TIFFTAG_JPEGDCTABLES ,TIFF_VARIABLE,TIFF_VARIABLE, - TIFF_LONG ,FIELD_JPEGDCTABLES ,FALSE,TRUE ,"JPEGDCTables" - }, - { - TIFFTAG_JPEGACTABLES ,TIFF_VARIABLE,TIFF_VARIABLE, - TIFF_LONG ,FIELD_JPEGACTABLES ,FALSE,TRUE ,"JPEGACTables" - }, - { - TIFFTAG_WANG_PAGECONTROL ,TIFF_VARIABLE,1 , - TIFF_LONG ,FIELD_WANG_PAGECONTROL ,FALSE,FALSE,"WANG PageControl" - }, - - /* This is a pseudo tag intended for internal use only by the TIFF Library and - its clients, which should never appear in an input/output image file. It - specifies whether the TIFF Library (or its client) should do YCbCr <-> RGB - color-space conversion (JPEGCOLORMODE_RAW <=> 0) or whether we should ask - the JPEG Library to do it (JPEGCOLORMODE_RGB <=> 1). - */ - { - TIFFTAG_JPEGCOLORMODE ,0 ,0 , - TIFF_ANY ,FIELD_PSEUDO ,FALSE,FALSE,"JPEGColorMode" - } - }; -static const char JPEGLib_name[]={"JPEG Library"}, - bad_bps[]={"%u BitsPerSample not allowed for JPEG"}, - bad_photometry[]={"PhotometricInterpretation %u not allowed for JPEG"}, - bad_subsampling[]={"invalid YCbCr subsampling factor(s)"}, -# ifdef never - no_write_frac[]={"fractional scan line discarded"}, -# endif - no_read_frac[]={"fractional scan line not read"}, - no_jtable_space[]={"No space for JPEGTables"}; - -/* The following diagnostic subroutines interface with and replace default - subroutines in the JPEG Library. Our basic strategy is to use "setjmp()"/ - "longjmp()" in order to return control to the TIFF Library when the JPEG - library detects an error, and to use TIFF Library subroutines for displaying - diagnostic messages to a client application. -*/ -static void -TIFFojpeg_error_exit(register j_common_ptr cinfo) - { char buffer[JMSG_LENGTH_MAX]; - - (*cinfo->err->format_message)(cinfo,buffer); - TIFFError(JPEGLib_name,buffer); /* Display error message */ - jpeg_abort(cinfo); /* Clean up JPEG Library state */ - LONGJMP(((OJPEGState *)cinfo)->exit_jmpbuf,1); /* Return to TIFF client */ - } - -static void -TIFFojpeg_output_message(register j_common_ptr cinfo) - { char buffer[JMSG_LENGTH_MAX]; - - /* This subroutine is invoked only for warning messages, since the JPEG - Library's "error_exit" method does its own thing and "trace_level" is never - set > 0. - */ - (*cinfo->err->format_message)(cinfo,buffer); - TIFFWarning(JPEGLib_name,buffer); - } - -/* The following subroutines, which also interface with the JPEG Library, exist - mainly in limit the side effects of "setjmp()" and convert JPEG normal/error - conditions into TIFF Library return codes. -*/ -#define CALLJPEG(sp,fail,op)(SETJMP((sp)->exit_jmpbuf)?(fail):(op)) -#define CALLVJPEG(sp,op)CALLJPEG(sp,0,((op),1)) -#ifdef never - -static int -TIFFojpeg_create_compress(register OJPEGState *sp) - { - sp->cinfo.c.err = jpeg_std_error(&sp->err); /* Initialize error handling */ - sp->err.error_exit = TIFFojpeg_error_exit; - sp->err.output_message = TIFFojpeg_output_message; - return CALLVJPEG(sp,jpeg_create_compress(&sp->cinfo.c)); - } - -/* The following subroutines comprise a JPEG Library "destination" data manager - by directing compressed data from the JPEG Library to a TIFF Library output - buffer. -*/ -static void -std_init_destination(register j_compress_ptr cinfo){} /* "Dummy" stub */ - -static boolean -std_empty_output_buffer(register j_compress_ptr cinfo) - { -# define sp ((OJPEGState *)cinfo) - register TIFF *tif = sp->tif; - - tif->tif_rawcc = tif->tif_rawdatasize; /* Entire buffer has been filled */ - TIFFFlushData1(tif); - sp->dest.next_output_byte = (JOCTET *)tif->tif_rawdata; - sp->dest.free_in_buffer = (size_t)tif->tif_rawdatasize; - return TRUE; -# undef sp - } - -static void -std_term_destination(register j_compress_ptr cinfo) - { -# define sp ((OJPEGState *)cinfo) - register TIFF *tif = sp->tif; - - /* NB: The TIFF Library does the final buffer flush. */ - tif->tif_rawcp = (tidata_t)sp->dest.next_output_byte; - tif->tif_rawcc = tif->tif_rawdatasize - (tsize_t)sp->dest.free_in_buffer; -# undef sp - } - -/* Alternate destination manager to output JPEGTables field: */ - -static void -tables_init_destination(register j_compress_ptr cinfo) - { -# define sp ((OJPEGState *)cinfo) - /* The "jpegtables_length" field is the allocated buffer size while building */ - sp->dest.next_output_byte = (JOCTET *)sp->jpegtables; - sp->dest.free_in_buffer = (size_t)sp->jpegtables_length; -# undef sp - } - -static boolean -tables_empty_output_buffer(register j_compress_ptr cinfo) - { void *newbuf; -# define sp ((OJPEGState *)cinfo) - - /* The entire buffer has been filled, so enlarge it by 1000 bytes. */ - if (!( newbuf = _TIFFrealloc( (tdata_t)sp->jpegtables - , (tsize_t)(sp->jpegtables_length + 1000) - ) - ) - ) ERREXIT1(cinfo,JERR_OUT_OF_MEMORY,100); - sp->dest.next_output_byte = (JOCTET *)newbuf + sp->jpegtables_length; - sp->dest.free_in_buffer = (size_t)1000; - sp->jpegtables = newbuf; - sp->jpegtables_length += 1000; - return TRUE; -# undef sp - } - -static void -tables_term_destination(register j_compress_ptr cinfo) - { -# define sp ((OJPEGState *)cinfo) - /* Set tables length to no. of Bytes actually emitted. */ - sp->jpegtables_length -= sp->dest.free_in_buffer; -# undef sp - } - -/*ARGSUSED*/ static int -TIFFojpeg_tables_dest(register OJPEGState *sp, TIFF *tif) - { - - /* Allocate a working buffer for building tables. The initial size is 1000 - Bytes, which is usually adequate. - */ - if (sp->jpegtables) _TIFFfree(sp->jpegtables); - if (!(sp->jpegtables = (void*) - _TIFFmalloc((tsize_t)(sp->jpegtables_length = 1000)) - ) - ) - { - sp->jpegtables_length = 0; - TIFFError("TIFFojpeg_tables_dest",no_jtable_space); - return 0; - }; - sp->cinfo.c.dest = &sp->dest; - sp->dest.init_destination = tables_init_destination; - sp->dest.empty_output_buffer = tables_empty_output_buffer; - sp->dest.term_destination = tables_term_destination; - return 1; - } -#else /* well, hardly ever */ - -static int -_notSupported(register TIFF *tif) - { const TIFFCodec *c = TIFFFindCODEC(tif->tif_dir.td_compression); - - TIFFError(tif->tif_name,"%s compression not supported",c->name); - return 0; - } -#endif /* never */ - -/* The following subroutines comprise a JPEG Library "source" data manager by - by directing compressed data to the JPEG Library from a TIFF Library input - buffer. -*/ -static void -std_init_source(register j_decompress_ptr cinfo) - { -# define sp ((OJPEGState *)cinfo) - register TIFF *tif = sp->tif; - - if (sp->src.bytes_in_buffer == 0) - { - sp->src.next_input_byte = (const JOCTET *)tif->tif_rawdata; - sp->src.bytes_in_buffer = (size_t)tif->tif_rawcc; - }; -# undef sp - } - -static boolean -std_fill_input_buffer(register j_decompress_ptr cinfo) - { static const JOCTET dummy_EOI[2]={0xFF,JPEG_EOI}; -# define sp ((OJPEGState *)cinfo) - - /* Control should never get here, since an entire strip/tile is read into - memory before the decompressor is called; thus, data should have been - supplied by the "init_source" method. ...But, sometimes things fail. - */ - WARNMS(cinfo,JWRN_JPEG_EOF); - sp->src.next_input_byte = dummy_EOI; /* Insert a fake EOI marker */ - sp->src.bytes_in_buffer = sizeof dummy_EOI; - return TRUE; -# undef sp - } - -static void -std_skip_input_data(register j_decompress_ptr cinfo, long num_bytes) - { -# define sp ((OJPEGState *)cinfo) - - if (num_bytes > 0) - { - if (num_bytes > (long)sp->src.bytes_in_buffer) /* oops: buffer overrun */ - (void)std_fill_input_buffer(cinfo); - else - { - sp->src.next_input_byte += (size_t)num_bytes; - sp->src.bytes_in_buffer -= (size_t)num_bytes; - } - } -# undef sp - } - -/*ARGSUSED*/ static void -std_term_source(register j_decompress_ptr cinfo){} /* "Dummy" stub */ - -/* Allocate temporary I/O buffers for downsampled data, using values computed in - "jpeg_start_{de}compress()". We use the JPEG Library's allocator so that - buffers will be released automatically when done with a strip/tile. This is - also a handy place to compute samplesperclump, bytesperline, etc. -*/ -static int -alloc_downsampled_buffers(TIFF *tif,jpeg_component_info *comp_info, - int num_components) - { register OJPEGState *sp = OJState(tif); - - sp->samplesperclump = 0; - if (num_components > 0) - { tsize_t size = sp->cinfo.comm.is_decompressor -# ifdef D_LOSSLESS_SUPPORTED - ? sp->cinfo.d.min_codec_data_unit -# else - ? DCTSIZE -# endif -# ifdef C_LOSSLESS_SUPPORTED - : sp->cinfo.c.data_unit; -# else - : DCTSIZE; -# endif - int ci = 0; - register jpeg_component_info *compptr = comp_info; - - do - { JSAMPARRAY buf; - - sp->samplesperclump += - compptr->h_samp_factor * compptr->v_samp_factor; -# if defined(C_LOSSLESS_SUPPORTED) || defined(D_LOSSLESS_SUPPORTED) - if (!(buf = CALLJPEG(sp,0,(*sp->cinfo.comm.mem->alloc_sarray)(&sp->cinfo.comm,JPOOL_IMAGE,compptr->width_in_data_units*size,compptr->v_samp_factor*size)))) -# else - if (!(buf = CALLJPEG(sp,0,(*sp->cinfo.comm.mem->alloc_sarray)(&sp->cinfo.comm,JPOOL_IMAGE,compptr->width_in_blocks*size,compptr->v_samp_factor*size)))) -# endif - return 0; - sp->ds_buffer[ci] = buf; - } - while (++compptr,++ci < num_components); - }; - return 1; - } -#ifdef never - -/* JPEG Encoding begins here. */ - -/*ARGSUSED*/ static int -OJPEGEncode(register TIFF *tif,tidata_t buf,tsize_t cc,tsample_t s) - { tsize_t rows; /* No. of unprocessed rows in file */ - register OJPEGState *sp = OJState(tif); - - /* Encode a chunk of pixels, where returned data is NOT down-sampled (the - standard case). The data is expected to be written in scan-line multiples. - */ - if (cc % sp->bytesperline) TIFFWarning(tif->tif_name,no_write_frac); - if ( (cc /= bytesperline) /* No. of complete rows in caller's buffer */ - > (rows = sp->cinfo.c.image_height - sp->cinfo.c.next_scanline) - ) cc = rows; - while (--cc >= 0) - { - if ( CALLJPEG(sp,-1,jpeg_write_scanlines(&sp->cinfo.c,(JSAMPARRAY)&buf,1)) - != 1 - ) return 0; - ++tif->tif_row; - buf += sp->bytesperline; - }; - return 1; - } - -/*ARGSUSED*/ static int -OJPEGEncodeRaw(register TIFF *tif,tidata_t buf,tsize_t cc,tsample_t s) - { tsize_t rows; /* No. of unprocessed rows in file */ - JDIMENSION lines_per_MCU, size; - register OJPEGState *sp = OJState(tif); - - /* Encode a chunk of pixels, where returned data is down-sampled as per the - sampling factors. The data is expected to be written in scan-line - multiples. - */ - cc /= sp->bytesperline; - if (cc % sp->bytesperline) TIFFWarning(tif->tif_name,no_write_frac); - if ( (cc /= bytesperline) /* No. of complete rows in caller's buffer */ - > (rows = sp->cinfo.c.image_height - sp->cinfo.c.next_scanline) - ) cc = rows; -# ifdef C_LOSSLESS_SUPPORTED - lines_per_MCU = sp->cinfo.c.max_samp_factor*(size = sp->cinfo.d.data_unit); -# else - lines_per_MCU = sp->cinfo.c.max_samp_factor*(size = DCTSIZE); -# endif - while (--cc >= 0) - { int ci = 0, clumpoffset = 0; - register jpeg_component_info *compptr = sp->cinfo.c.comp_info; - - /* The fastest way to separate the data is to make 1 pass over the scan - line for each row of each component. - */ - do - { int ypos = 0; - - do - { int padding; - register JSAMPLE *inptr = (JSAMPLE*)buf + clumpoffset, - *outptr = - sp->ds_buffer[ci][sp->scancount*compptr->v_samp_factor+ypos]; - /* Cb,Cr both have sampling factors 1, so this is correct */ - register int clumps_per_line = - sp->cinfo.c.comp_info[1].downsampled_width, - xpos; - - padding = (int) -# ifdef C_LOSSLESS_SUPPORTED - ( compptr->width_in_data_units * size -# else - ( compptr->width_in_blocks * size -# endif - - clumps_per_line * compptr->h_samp_factor - ); - if (compptr->h_samp_factor == 1) /* Cb & Cr fast path */ - do *outptr++ = *inptr; - while ((inptr += sp->samplesperclump),--clumps_per_line > 0); - else /* general case */ - do - { - xpos = 0; - do *outptr++ = inptr[xpos]; - while (++xpos < compptr->h_samp_factor); - } - while ((inptr += sp->samplesperclump),--clumps_per_line > 0); - xpos = 0; /* Pad each scan line as needed */ - do outptr[0] = outptr[-1]; while (++outptr,++xpos < padding); - clumpoffset += compptr->h_samp_factor; - } - while (++ypos < compptr->v_samp_factor); - } - while (++compptr,++ci < sp->cinfo.c.num_components); - if (++sp->scancount >= size) - { - if ( CALLJPEG(sp,-1,jpeg_write_raw_data(&sp->cinfo.c,sp->ds_buffer,lines_per_MCU)) - != lines_per_MCU - ) return 0; - sp->scancount = 0; - }; - ++tif->tif_row++ - buf += sp->bytesperline; - }; - return 1; - } - -static int -OJPEGSetupEncode(register TIFF *tif) - { static const char module[]={"OJPEGSetupEncode"}; - uint32 segment_height, segment_width; - int status = 1; /* Assume success by default */ - register OJPEGState *sp = OJState(tif); -# define td (&tif->tif_dir) - - /* Verify miscellaneous parameters. This will need work if the TIFF Library - ever supports different depths for different components, or if the JPEG - Library ever supports run-time depth selection. Neither seems imminent. - */ - if (td->td_bitspersample != 8) - { - TIFFError(module,bad_bps,td->td_bitspersample); - status = 0; - }; - - /* The TIFF Version 6.0 specification and IJG JPEG Library accept different - sets of color spaces, so verify that our image belongs to the common subset - and map its photometry code, then initialize to handle subsampling and - optional JPEG Library YCbCr <-> RGB color-space conversion. - */ - switch (td->td_photometric) - { - case PHOTOMETRIC_YCBCR : - - /* ISO IS 10918-1 requires that JPEG subsampling factors be 1-4, but - TIFF Version 6.0 is more restrictive: only 1, 2, and 4 are allowed. - */ - if ( ( td->td_ycbcrsubsampling[0] == 1 - || td->td_ycbcrsubsampling[0] == 2 - || td->td_ycbcrsubsampling[0] == 4 - ) - && ( td->td_ycbcrsubsampling[1] == 1 - || td->td_ycbcrsubsampling[1] == 2 - || td->td_ycbcrsubsampling[1] == 4 - ) - ) - sp->cinfo.c.raw_data_in = - ( (sp->h_sampling = td->td_ycbcrsubsampling[0]) << 3 - | (sp->v_sampling = td->td_ycbcrsubsampling[1]) - ) != 011; - else - { - TIFFError(module,bad_subsampling); - status = 0; - }; - - /* A ReferenceBlackWhite field MUST be present, since the default value - is inapproriate for YCbCr. Fill in the proper value if the - application didn't set it. - */ - if (!TIFFFieldSet(tif,FIELD_REFBLACKWHITE)) - { float refbw[6]; - long top = 1L << td->td_bitspersample; - - refbw[0] = 0; - refbw[1] = (float)(top-1L); - refbw[2] = (float)(top>>1); - refbw[3] = refbw[1]; - refbw[4] = refbw[2]; - refbw[5] = refbw[1]; - TIFFSetField(tif,TIFFTAG_REFERENCEBLACKWHITE,refbw); - }; - sp->cinfo.c.jpeg_color_space = JCS_YCbCr; - if (sp->jpegcolormode == JPEGCOLORMODE_RGB) - { - sp->cinfo.c.raw_data_in = FALSE; - sp->in_color_space = JCS_RGB; - break; - }; - goto L2; - case PHOTOMETRIC_MINISBLACK: - sp->cinfo.c.jpeg_color_space = JCS_GRAYSCALE; - goto L1; - case PHOTOMETRIC_RGB : - sp->cinfo.c.jpeg_color_space = JCS_RGB; - goto L1; - case PHOTOMETRIC_SEPARATED : - sp->cinfo.c.jpeg_color_space = JCS_CMYK; - L1: sp->jpegcolormode = JPEGCOLORMODE_RAW; /* No JPEG Lib. conversion */ - L2: sp->cinfo.d.in_color_space = sp->cinfo.d.jpeg_color-space; - break; - default : - TIFFError(module,bad_photometry,td->td_photometric); - status = 0; - }; - tif->tif_encoderow = tif->tif_encodestrip = tif->tif_encodetile = - sp->cinfo.c.raw_data_in ? OJPEGEncodeRaw : OJPEGEncode; - if (isTiled(tif)) - { tsize_t size; - -# ifdef C_LOSSLESS_SUPPORTED - if ((size = sp->v_sampling*sp->cinfo.c.data_unit) < 16) size = 16; -# else - if ((size = sp->v_sampling*DCTSIZE) < 16) size = 16; -# endif - if ((segment_height = td->td_tilelength) % size) - { - TIFFError(module,"JPEG tile height must be multiple of %d",size); - status = 0; - }; -# ifdef C_LOSSLESS_SUPPORTED - if ((size = sp->h_sampling*sp->cinfo.c.data_unit) < 16) size = 16; -# else - if ((size = sp->h_sampling*DCTSIZE) < 16) size = 16; -# endif - if ((segment_width = td->td_tilewidth) % size) - { - TIFFError(module,"JPEG tile width must be multiple of %d",size); - status = 0; - }; - sp->bytesperline = TIFFTileRowSize(tif); - } - else - { tsize_t size; - -# ifdef C_LOSSLESS_SUPPORTED - if ((size = sp->v_sampling*sp->cinfo.c.data_unit) < 16) size = 16; -# else - if ((size = sp->v_sampling*DCTSIZE) < 16) size = 16; -# endif - if (td->td_rowsperstrip < (segment_height = td->td_imagelength)) - { - if (td->td_rowsperstrip % size) - { - TIFFError(module,"JPEG RowsPerStrip must be multiple of %d",size); - status = 0; - }; - segment_height = td->td_rowsperstrip; - }; - segment_width = td->td_imagewidth; - sp->bytesperline = tif->tif_scanlinesize; - }; - if (segment_width > 65535 || segment_height > 65535) - { - TIFFError(module,"Strip/tile too large for JPEG"); - status = 0; - }; - - /* Initialize all JPEG parameters to default values. Note that the JPEG - Library's "jpeg_set_defaults()" method needs legal values for the - "in_color_space" and "input_components" fields. - */ - sp->cinfo.c.input_components = 1; /* Default for JCS_UNKNOWN */ - if (!CALLVJPEG(sp,jpeg_set_defaults(&sp->cinfo.c))) status = 0; - switch (sp->jpegtablesmode & (JPEGTABLESMODE_HUFF|JPEGTABLESMODE_QUANT)) - { register JHUFF_TBL *htbl; - register JQUANT_TBL *qtbl; - - case 0 : - sp->cinfo.c.optimize_coding = TRUE; - case JPEGTABLESMODE_HUFF : - if (!CALLVJPEG(sp,jpeg_set_quality(&sp->cinfo.c,sp->jpegquality,FALSE))) - return 0; - if (qtbl = sp->cinfo.c.quant_tbl_ptrs[0]) qtbl->sent_table = FALSE; - if (qtbl = sp->cinfo.c.quant_tbl_ptrs[1]) qtbl->sent_table = FALSE; - goto L3; - case JPEGTABLESMODE_QUANT : - sp->cinfo.c.optimize_coding = TRUE; - - /* We do not support application-supplied JPEG tables, so mark the field - "not present". - */ - L3: TIFFClrFieldBit(tif,FIELD_JPEGTABLES); - break; - case JPEGTABLESMODE_HUFF|JPEGTABLESMODE_QUANT: - if ( !CALLVJPEG(sp,jpeg_set_quality(&sp->cinfo.c,sp->jpegquality,FALSE)) - || !CALLVJPEG(sp,jpeg_suppress_tables(&sp->cinfo.c,TRUE)) - ) - { - status = 0; - break; - }; - if (qtbl = sp->cinfo.c.quant_tbl_ptrs[0]) qtbl->sent_table = FALSE; - if (htbl = sp->cinfo.c.dc_huff_tbl_ptrs[0]) htbl->sent_table = FALSE; - if (htbl = sp->cinfo.c.ac_huff_tbl_ptrs[0]) htbl->sent_table = FALSE; - if (sp->cinfo.c.jpeg_color_space == JCS_YCbCr) - { - if (qtbl = sp->cinfo.c.quant_tbl_ptrs[1]) - qtbl->sent_table = FALSE; - if (htbl = sp->cinfo.c.dc_huff_tbl_ptrs[1]) - htbl->sent_table = FALSE; - if (htbl = sp->cinfo.c.ac_huff_tbl_ptrs[1]) - htbl->sent_table = FALSE; - }; - if ( TIFFojpeg_tables_dest(sp,tif) - && CALLVJPEG(sp,jpeg_write_tables(&sp->cinfo.c)) - ) - { - - /* Mark the field "present". We can't use "TIFFSetField()" because - "BEENWRITING" is already set! - */ - TIFFSetFieldBit(tif,FIELD_JPEGTABLES); - tif->tif_flags |= TIFF_DIRTYDIRECT; - } - else status = 0; - }; - if ( sp->cinfo.c.raw_data_in - && !alloc_downsampled_buffers(tif,sp->cinfo.c.comp_info, - sp->cinfo.c.num_components) - ) status = 0; - if (status == 0) return 0; /* If TIFF errors, don't bother to continue */ - /* Grab parameters that are same for all strips/tiles. */ - - sp->dest.init_destination = std_init_destination; - sp->dest.empty_output_buffer = std_empty_output_buffer; - sp->dest.term_destination = std_term_destination; - sp->cinfo.c.dest = &sp->dest; - sp->cinfo.c.data_precision = td->td_bitspersample; - sp->cinfo.c.write_JFIF_header = /* Don't write extraneous markers */ - sp->cinfo.c.write_Adobe_marker = FALSE; - sp->cinfo.c.image_width = segment_width; - sp->cinfo.c.image_height = segment_height; - sp->cinfo.c.comp_info[0].h_samp_factor = - sp->cinfo.c.comp_info[0].v_samp_factor = 1; - return CALLVJPEG(sp,jpeg_start_compress(&sp->cinfo.c,FALSE)); -# undef td - } - -static int -OJPEGPreEncode(register TIFF *tif,tsample_t s) - { register OJPEGState *sp = OJState(tif); -# define td (&tif->tif_dir) - - /* If we are about to write the first row of an image plane, which should - coincide with a JPEG "scan", reset the JPEG Library's compressor. Otherwise - let the compressor run "as is" and return a "success" status without further - ado. - */ - if ( (isTiled(tif) ? tif->tif_curtile : tif->tif_curstrip) - % td->td_stripsperimage - == 0 - ) - { - if ( (sp->cinfo.c.comp_info[0].component_id = s) == 1) - && sp->cinfo.c.jpeg_color_space == JCS_YCbCr - ) - { - sp->cinfo.c.comp_info[0].quant_tbl_no = - sp->cinfo.c.comp_info[0].dc_tbl_no = - sp->cinfo.c.comp_info[0].ac_tbl_no = 1; - sp->cinfo.c.comp_info[0].h_samp_factor = sp->h_sampling; - sp->cinfo.c.comp_info[0].v_samp_factor = sp->v_sampling; - - /* Scale expected strip/tile size to match a downsampled component. */ - - sp->cinfo.c.image_width = TIFFhowmany(segment_width,sp->h_sampling); - sp->cinfo.c.image_height=TIFFhowmany(segment_height,sp->v_sampling); - }; - sp->scancount = 0; /* Mark subsampling buffer(s) empty */ - }; - return 1; -# undef td - } - -static int -OJPEGPostEncode(register TIFF *tif) - { register OJPEGState *sp = OJState(tif); - - /* Finish up at the end of a strip or tile. */ - - if (sp->scancount > 0) /* emit partial buffer of down-sampled data */ - { JDIMENSION n; - -# ifdef C_LOSSLESS_SUPPORTED - if ( sp->scancount < sp->cinfo.c.data_unit - && sp->cinfo.c.num_components > 0 - ) -# else - if (sp->scancount < DCTSIZE && sp->cinfo.c.num_components > 0) -# endif - { int ci = 0, /* Pad the data vertically */ -# ifdef C_LOSSLESS_SUPPORTED - size = sp->cinfo.c.data_unit; -# else - size = DCTSIZE; -# endif - register jpeg_component_info *compptr = sp->cinfo.c.comp_info; - - do -# ifdef C_LOSSLESS_SUPPORTED - { tsize_t row_width = compptr->width_in_data_units -# else - tsize_t row_width = compptr->width_in_blocks -# endif - *size*sizeof(JSAMPLE); - int ypos = sp->scancount*compptr->v_samp_factor; - - do _TIFFmemcpy( (tdata_t)sp->ds_buffer[ci][ypos] - , (tdata_t)sp->ds_buffer[ci][ypos-1] - , row_width - ); - while (++ypos < compptr->v_samp_factor*size); - } - while (++compptr,++ci < sp->cinfo.c.num_components); - }; - n = sp->cinfo.c.max_v_samp_factor*size; - if (CALLJPEG(sp,-1,jpeg_write_raw_data(&sp->cinfo.c,sp->ds_buffer,n)) != n) - return 0; - }; - return CALLVJPEG(sp,jpeg_finish_compress(&sp->cinfo.c)); - } -#endif /* never */ - -/* JPEG Decoding begins here. */ - -/*ARGSUSED*/ static int -OJPEGDecode(register TIFF *tif,tidata_t buf,tsize_t cc,tsample_t s) - { tsize_t bytesperline = isTiled(tif) - ? TIFFTileRowSize(tif) - : tif->tif_scanlinesize, - rows; /* No. of unprocessed rows in file */ - register OJPEGState *sp = OJState(tif); - - /* Decode a chunk of pixels, where the input data has not NOT been down- - sampled, or else the TIFF Library's client has used the "JPEGColorMode" TIFF - pseudo-tag to request that the JPEG Library do color-space conversion; this - is the normal case. The data is expected to be read in scan-line multiples, - and this subroutine is called for both pixel-interleaved and separate color - planes. - - WARNING: Unlike "OJPEGDecodeRawContig()", below, the no. of Bytes in each - decoded row is calculated here as "bytesperline" instead of - using "sp->bytesperline", which might be a little smaller. This can - occur for an old tiled image whose width isn't a multiple of 8 pixels. - That's illegal according to the TIFF Version 6 specification, but some - test files, like "zackthecat.tif", were built that way. In those cases, - we want to embed the image's true width in our caller's buffer (which is - presumably allocated according to the expected tile width) by - effectively "padding" it with unused Bytes at the end of each row. - */ - if ( (cc /= bytesperline) /* No. of complete rows in caller's buffer */ - > (rows = sp->cinfo.d.output_height - sp->cinfo.d.output_scanline) - ) cc = rows; - while (--cc >= 0) - { - if ( CALLJPEG(sp,-1,jpeg_read_scanlines(&sp->cinfo.d,(JSAMPARRAY)&buf,1)) - != 1 - ) return 0; - buf += bytesperline; - ++tif->tif_row; - }; - - /* BEWARE OF KLUDGE: If our input file was produced by Microsoft's Wang - Imaging for Windows application, the DC coefficients of - each JPEG image component (Y,Cb,Cr) must be reset at the end of each TIFF - "strip", and any JPEG data bits remaining in the current Byte of the - decoder's input buffer must be discarded. To do so, we create an "ad hoc" - interface in the "jdhuff.c" module of IJG JPEG Library Version 6 (module - "jdshuff.c", if Ken Murchison's lossless-Huffman patch is applied), and we - invoke that interface here after decoding each "strip". - */ - if (sp->is_WANG) jpeg_reset_huff_decode(&sp->cinfo.d); - return 1; - } - -/*ARGSUSED*/ static int -OJPEGDecodeRawContig(register TIFF *tif,tidata_t buf,tsize_t cc,tsample_t s) - { tsize_t rows; /* No. of unprocessed rows in file */ - JDIMENSION lines_per_MCU, size; - register OJPEGState *sp = OJState(tif); - - /* Decode a chunk of pixels, where the input data has pixel-interleaved color - planes, some of which have been down-sampled, but the TIFF Library's client - has NOT used the "JPEGColorMode" TIFF pseudo-tag to request that the JPEG - Library do color-space conversion. In other words, we must up-sample/ - expand/duplicate image components according to the image's sampling factors, - without changing its color space. The data is expected to be read in scan- - line multiples. - */ - if ( (cc /= sp->bytesperline) /* No. of complete rows in caller's buffer */ - > (rows = sp->cinfo.d.output_height - sp->cinfo.d.output_scanline) - ) cc = rows; - lines_per_MCU = sp->cinfo.d.max_v_samp_factor -# ifdef D_LOSSLESS_SUPPORTED - * (size = sp->cinfo.d.min_codec_data_unit); -# else - * (size = DCTSIZE); -# endif - while (--cc >= 0) - { int clumpoffset, ci; - register jpeg_component_info *compptr; - - if (sp->scancount >= size) /* reload downsampled-data buffers */ - { - if ( CALLJPEG(sp,-1,jpeg_read_raw_data(&sp->cinfo.d,sp->ds_buffer,lines_per_MCU)) - != lines_per_MCU - ) return 0; - sp->scancount = 0; - }; - - /* The fastest way to separate the data is: make 1 pass over the scan - line for each row of each component. - */ - clumpoffset = ci = 0; - compptr = sp->cinfo.d.comp_info; - do - { int ypos = 0; - - if (compptr->h_samp_factor == 1) /* fast path */ - do - { register JSAMPLE *inptr = - sp->ds_buffer[ci][sp->scancount*compptr->v_samp_factor+ypos], - *outptr = (JSAMPLE *)buf + clumpoffset; - register int clumps_per_line = compptr->downsampled_width; - - do *outptr = *inptr++; - while ((outptr += sp->samplesperclump),--clumps_per_line > 0); - } - while ( (clumpoffset += compptr->h_samp_factor) - , ++ypos < compptr->v_samp_factor - ); - else /* general case */ - do - { register JSAMPLE *inptr = - sp->ds_buffer[ci][sp->scancount*compptr->v_samp_factor+ypos], - *outptr = (JSAMPLE *)buf + clumpoffset; - register int clumps_per_line = compptr->downsampled_width; - - do - { register int xpos = 0; - - do outptr[xpos] = *inptr++; - while (++xpos < compptr->h_samp_factor); - } - while ((outptr += sp->samplesperclump),--clumps_per_line > 0); - } - while ( (clumpoffset += compptr->h_samp_factor) - , ++ypos < compptr->v_samp_factor - ); - } - while (++compptr,++ci < sp->cinfo.d.num_components); - ++sp->scancount; - buf += sp->bytesperline; - ++tif->tif_row; - }; - - /* BEWARE OF KLUDGE: If our input file was produced by Microsoft's Wang - Imaging for Windows application, the DC coefficients of - each JPEG image component (Y,Cb,Cr) must be reset at the end of each TIFF - "strip", and any JPEG data bits remaining in the current Byte of the - decoder's input buffer must be discarded. To do so, we create an "ad hoc" - interface in the "jdhuff.c" module of IJG JPEG Library Version 6 (module - "jdshuff.c", if Ken Murchison's lossless-Huffman patch is applied), and we - invoke that interface here after decoding each "strip". - */ - if (sp->is_WANG) jpeg_reset_huff_decode(&sp->cinfo.d); - return 1; - } - -/*ARGSUSED*/ static int -OJPEGDecodeRawSeparate(TIFF *tif,register tidata_t buf,tsize_t cc,tsample_t s) - { tsize_t rows; /* No. of unprocessed rows in file */ - JDIMENSION lines_per_MCU, - size, /* ...of MCU */ - v; /* Component's vertical up-sampling ratio */ - register OJPEGState *sp = OJState(tif); - register jpeg_component_info *compptr = sp->cinfo.d.comp_info + s; - - /* Decode a chunk of pixels, where the input data has separate color planes, - some of which have been down-sampled, but the TIFF Library's client has NOT - used the "JPEGColorMode" TIFF pseudo-tag to request that the JPEG Library - do color-space conversion. The data is expected to be read in scan-line - multiples. - */ - v = sp->cinfo.d.max_v_samp_factor/compptr->v_samp_factor; - if ( (cc /= compptr->downsampled_width) /* No. of rows in caller's buffer */ - > (rows = (sp->cinfo.d.output_height-sp->cinfo.d.output_scanline+v-1)/v) - ) cc = rows; /* No. of rows of "clumps" to read */ - lines_per_MCU = sp->cinfo.d.max_v_samp_factor -# ifdef D_LOSSLESS_SUPPORTED - * (size = sp->cinfo.d.min_codec_data_unit); -# else - * (size = DCTSIZE); -# endif - L: if (sp->scancount >= size) /* reload downsampled-data buffers */ - { - if ( CALLJPEG(sp,-1,jpeg_read_raw_data(&sp->cinfo.d,sp->ds_buffer,lines_per_MCU)) - != lines_per_MCU - ) return 0; - sp->scancount = 0; - }; - rows = 0; - do - { register JSAMPLE *inptr = - sp->ds_buffer[s][sp->scancount*compptr->v_samp_factor + rows]; - register int clumps_per_line = compptr->downsampled_width; - - do *buf++ = *inptr++; while (--clumps_per_line > 0); /* Copy scanline */ - tif->tif_row += v; - if (--cc <= 0) return 1; /* End of caller's buffer? */ - } - while (++rows < compptr->v_samp_factor); - ++sp->scancount; - goto L; - } - -/* "OJPEGSetupDecode()" temporarily forces the JPEG Library to use the following - subroutine as a "dummy" input reader in order to fool the library into - thinking that it has read the image's first "Start of Scan" (SOS) marker, so - that it initializes accordingly. -*/ -/*ARGSUSED*/ METHODDEF(int) -fake_SOS_marker(j_decompress_ptr cinfo){return JPEG_REACHED_SOS;} - -/*ARGSUSED*/ METHODDEF(int) -suspend(j_decompress_ptr cinfo){return JPEG_SUSPENDED;} - -/* The JPEG Library's "null" color-space converter actually re-packs separate - color planes (it's native image representation) into a pixel-interleaved, - contiguous plane. But if our TIFF Library client is tryng to process a - PLANARCONFIG_SEPARATE image, we don't want that; so here are modifications of - code in the JPEG Library's "jdcolor.c" file, which simply copy Bytes to a - color plane specified by the current JPEG "scan". -*/ -METHODDEF(void) -ycc_rgb_convert(register j_decompress_ptr cinfo,JSAMPIMAGE in,JDIMENSION row, - register JSAMPARRAY out,register int nrows) - { typedef struct /* "jdcolor.c" color-space conversion state */ - { - - /* WARNING: This declaration is ugly and dangerous! It's supposed to be - private to the JPEG Library's "jdcolor.c" module, but we also - need it here. Since the library's copy might change without notice, be - sure to keep this one synchronized or the following code will break! - */ - struct jpeg_color_deconverter pub; /* Public fields */ - /* Private state for YCC->RGB conversion */ - int *Cr_r_tab, /* ->Cr to R conversion table */ - *Cb_b_tab; /* ->Cb to B conversion table */ - INT32 *Cr_g_tab, /* ->Cr to G conversion table */ - *Cb_g_tab; /* ->Cb to G conversion table */ - } *my_cconvert_ptr; - my_cconvert_ptr cconvert = (my_cconvert_ptr)cinfo->cconvert; - JSAMPARRAY irow0p = in[0] + row; - register JSAMPLE *range_limit = cinfo->sample_range_limit; - register JSAMPROW outp, Y; - - switch (cinfo->output_scan_number - 1) - { JSAMPARRAY irow1p, irow2p; - register INT32 *table0, *table1; - SHIFT_TEMPS - - case RGB_RED : irow2p = in[2] + row; - table0 = (INT32 *)cconvert->Cr_r_tab; - while (--nrows >= 0) - { register JSAMPROW Cr = *irow2p++; - register int i = cinfo->output_width; - - Y = *irow0p++; - outp = *out++; - while (--i >= 0) - *outp++ = range_limit[*Y++ + table0[*Cr++]]; - }; - return; - case RGB_GREEN: irow1p = in[1] + row; - irow2p = in[2] + row; - table0 = cconvert->Cb_g_tab; - table1 = cconvert->Cr_g_tab; - while (--nrows >= 0) - { register JSAMPROW Cb = *irow1p++, - Cr = *irow2p++; - register int i = cinfo->output_width; - - Y = *irow0p++; - outp = *out++; - while (--i >= 0) - *outp++ = - range_limit[ *Y++ - + RIGHT_SHIFT(table0[*Cb++]+table1[*Cr++],16) - ]; - }; - return; - case RGB_BLUE : irow1p = in[1] + row; - table0 = (INT32 *)cconvert->Cb_b_tab; - while (--nrows >= 0) - { register JSAMPROW Cb = *irow1p++; - register int i = cinfo->output_width; - - Y = *irow0p++; - outp = *out++; - while (--i >= 0) - *outp++ = range_limit[*Y++ + table0[*Cb++]]; - } - } - } - -METHODDEF(void) -null_convert(register j_decompress_ptr cinfo,JSAMPIMAGE in,JDIMENSION row, - register JSAMPARRAY out,register int nrows) - { register JSAMPARRAY irowp = in[cinfo->output_scan_number - 1] + row; - - while (--nrows >= 0) _TIFFmemcpy(*out++,*irowp++,cinfo->output_width); - } - -static int -OJPEGSetupDecode(register TIFF *tif) - { static char module[]={"OJPEGSetupDecode"}; - J_COLOR_SPACE jpeg_color_space, /* Color space of JPEG-compressed image */ - out_color_space; /* Color space of decompressed image */ - uint32 segment_width; - int status = 1; /* Assume success by default */ - boolean downsampled_output=FALSE, /* <=> Want JPEG Library's "raw" image? */ - is_JFIF; /* <=> JFIF image? */ - register OJPEGState *sp = OJState(tif); -# define td (&tif->tif_dir) - - /* Verify miscellaneous parameters. This will need work if the TIFF Library - ever supports different depths for different components, or if the JPEG - Library ever supports run-time depth selection. Neither seems imminent. - */ - if (td->td_bitspersample != sp->cinfo.d.data_precision) - { - TIFFError(module,bad_bps,td->td_bitspersample); - status = 0; - }; - - /* The TIFF Version 6.0 specification and IJG JPEG Library accept different - sets of color spaces, so verify that our image belongs to the common subset - and map its photometry code, then initialize to handle subsampling and - optional JPEG Library YCbCr <-> RGB color-space conversion. - */ - switch (td->td_photometric) - { - case PHOTOMETRIC_YCBCR : - - /* ISO IS 10918-1 requires that JPEG subsampling factors be 1-4, but - TIFF Version 6.0 is more restrictive: only 1, 2, and 4 are allowed. - */ - if ( ( td->td_ycbcrsubsampling[0] == 1 - || td->td_ycbcrsubsampling[0] == 2 - || td->td_ycbcrsubsampling[0] == 4 - ) - && ( td->td_ycbcrsubsampling[1] == 1 - || td->td_ycbcrsubsampling[1] == 2 - || td->td_ycbcrsubsampling[1] == 4 - ) - ) - downsampled_output = - ( - (sp->h_sampling = td->td_ycbcrsubsampling[0]) << 3 - | (sp->v_sampling = td->td_ycbcrsubsampling[1]) - ) != 011; - else - { - TIFFError(module,bad_subsampling); - status = 0; - }; - jpeg_color_space = JCS_YCbCr; - if (sp->jpegcolormode == JPEGCOLORMODE_RGB) - { - downsampled_output = FALSE; - out_color_space = JCS_RGB; - break; - }; - goto L2; - case PHOTOMETRIC_MINISBLACK: - jpeg_color_space = JCS_GRAYSCALE; - goto L1; - case PHOTOMETRIC_RGB : - jpeg_color_space = JCS_RGB; - goto L1; - case PHOTOMETRIC_SEPARATED : - jpeg_color_space = JCS_CMYK; - L1: sp->jpegcolormode = JPEGCOLORMODE_RAW; /* No JPEG Lib. conversion */ - L2: out_color_space = jpeg_color_space; - break; - default : - TIFFError(module,bad_photometry,td->td_photometric); - status = 0; - }; - if (status == 0) return 0; /* If TIFF errors, don't bother to continue */ - - /* Set parameters that are same for all strips/tiles. */ - - sp->cinfo.d.src = &sp->src; - sp->src.init_source = std_init_source; - sp->src.fill_input_buffer = std_fill_input_buffer; - sp->src.skip_input_data = std_skip_input_data; - sp->src.resync_to_restart = jpeg_resync_to_restart; - sp->src.term_source = std_term_source; - - /* BOGOSITY ALERT! The Wang Imaging application for Microsoft Windows produces - images containing "JPEGInterchangeFormat[Length]" TIFF - records that resemble JFIF-in-TIFF encapsulations but, in fact, violate the - TIFF Version 6 specification in several ways; nevertheless, we try to handle - them gracefully because there are apparently a lot of them around. The - purported "JFIF" data stream in one of these files vaguely resembles a JPEG - "tables only" data stream, except that there's no trailing EOI marker. The - rest of the JPEG data stream lies in a discontiguous file region, identified - by the 0th Strip offset (which is *also* illegal!), where it begins with an - SOS marker and apparently continues to the end of the file. There is no - trailing EOI marker here, either. - */ - is_JFIF = !sp->is_WANG && TIFFFieldSet(tif,FIELD_JPEGIFOFFSET); - - /* Initialize decompression parameters that won't be overridden by JPEG Library - defaults set during the "jpeg_read_header()" call, below. - */ - segment_width = td->td_imagewidth; - if (isTiled(tif)) - { - if (sp->is_WANG) /* we don't know how to handle it */ - { - TIFFError(module,"Tiled Wang image not supported"); - return 0; - }; - - /* BOGOSITY ALERT! "TIFFTileRowSize()" seems to work fine for modern JPEG- - in-TIFF encapsulations where the image width--like the - tile width--is a multiple of 8 or 16 pixels. But image widths and - heights are aren't restricted to 8- or 16-bit multiples, and we need - the exact Byte count of decompressed scan lines when we call the JPEG - Library. At least one old file ("zackthecat.tif") in the TIFF Library - test suite has widths and heights slightly less than the tile sizes, and - it apparently used the bogus computation below to determine the number - of Bytes per scan line (was this due to an old, broken version of - "TIFFhowmany()"?). Before we get here, "OJPEGSetupDecode()" verified - that our image uses 8-bit samples, so the following check appears to - return the correct answer in all known cases tested to date. - */ - if (is_JFIF || (segment_width & 7) == 0) - sp->bytesperline = TIFFTileRowSize(tif); /* Normal case */ - else - { - /* Was the file-encoder's segment-width calculation bogus? */ - segment_width = (segment_width/sp->h_sampling + 1) * sp->h_sampling; - sp->bytesperline = segment_width * td->td_samplesperpixel; - } - } - else sp->bytesperline = TIFFVStripSize(tif,1); - - /* BEWARE OF KLUDGE: If we have JPEG Interchange File Format (JFIF) image, - then we want to read "metadata" in the bit-stream's - header and validate it against corresponding information in TIFF records. - But if we have a *really old* JPEG file that's not JFIF, then we simply - assign TIFF-record values to JPEG Library variables without checking. - */ - if (is_JFIF) /* JFIF image */ - { unsigned char *end_of_data; - int subsampling_factors; - register unsigned char *p; - register int i; - - /* WARNING: Although the image file contains a JFIF bit stream, it might - also contain some old TIFF records causing "OJPEGVSetField()" - to have allocated quantization or Huffman decoding tables. But when the - JPEG Library reads and parses the JFIF header below, it reallocate these - tables anew without checking for "dangling" pointers, thereby causing a - memory "leak". We have enough information to potentially deallocate the - old tables here, but unfortunately JPEG Library Version 6B uses a "pool" - allocator for small objects, with no deallocation procedure; instead, it - reclaims a whole pool when an image is closed/destroyed, so well-behaved - TIFF client applications (i.e., those which close their JPEG images as - soon as they're no longer needed) will waste memory for a short time but - recover it eventually. But ill-behaved TIFF clients (i.e., those which - keep many JPEG images open gratuitously) can exhaust memory prematurely. - If the JPEG Library ever implements a deallocation procedure, insert - this clean-up code: - */ -# ifdef someday - if (sp->jpegtablesmode & JPEGTABLESMODE_QUANT) /* free quant. tables */ - { register int i = 0; - - do - { register JQUANT_TBL *q; - - if (q = sp->cinfo.d.quant_tbl_ptrs[i]) - { - jpeg_free_small(&sp->cinfo.comm,q,sizeof *q); - sp->cinfo.d.quant_tbl_ptrs[i] = 0; - } - } - while (++i < NUM_QUANT_TBLS); - }; - if (sp->jpegtablesmode & JPEGTABLESMODE_HUFF) /* free Huffman tables */ - { register int i = 0; - - do - { register JHUFF_TBL *h; - - if (h = sp->cinfo.d.dc_huff_tbl_ptrs[i]) - { - jpeg_free_small(&sp->cinfo.comm,h,sizeof *h); - sp->cinfo.d.dc_huff_tbl_ptrs[i] = 0; - }; - if (h = sp->cinfo.d.ac_huff_tbl_ptrs[i]) - { - jpeg_free_small(&sp->cinfo.comm,h,sizeof *h); - sp->cinfo.d.ac_huff_tbl_ptrs[i] = 0; - } - } - while (++i < NUM_HUFF_TBLS); - }; -# endif /* someday */ - - /* Since we might someday wish to try rewriting "old format" JPEG-in-TIFF - encapsulations in "new format" files, try to synthesize the value of a - modern "JPEGTables" TIFF record by scanning the JPEG data from just past - the "Start of Information" (SOI) marker until something other than a - legitimate "table" marker is found, as defined in ISO IS 10918-1 - Appending B.2.4; namely: - - -- Define Quantization Table (DQT) - -- Define Huffman Table (DHT) - -- Define Arithmetic Coding table (DAC) - -- Define Restart Interval (DRI) - -- Comment (COM) - -- Application data (APPn) - - For convenience, we also accept "Expansion" (EXP) markers, although they - are apparently not a part of normal "table" data. - */ - sp->jpegtables = p = (unsigned char *)sp->src.next_input_byte; - end_of_data = p + sp->src.bytes_in_buffer; - p += 2; - while (p < end_of_data && p[0] == 0xFF) - switch (p[1]) - { - default : goto L; - case 0xC0: /* SOF0 */ - case 0xC1: /* SOF1 */ - case 0xC2: /* SOF2 */ - case 0xC3: /* SOF3 */ - case 0xC4: /* DHT */ - case 0xC5: /* SOF5 */ - case 0xC6: /* SOF6 */ - case 0xC7: /* SOF7 */ - case 0xC9: /* SOF9 */ - case 0xCA: /* SOF10 */ - case 0xCB: /* SOF11 */ - case 0xCC: /* DAC */ - case 0xCD: /* SOF13 */ - case 0xCE: /* SOF14 */ - case 0xCF: /* SOF15 */ - case 0xDB: /* DQT */ - case 0xDD: /* DRI */ - case 0xDF: /* EXP */ - case 0xE0: /* APP0 */ - case 0xE1: /* APP1 */ - case 0xE2: /* APP2 */ - case 0xE3: /* APP3 */ - case 0xE4: /* APP4 */ - case 0xE5: /* APP5 */ - case 0xE6: /* APP6 */ - case 0xE7: /* APP7 */ - case 0xE8: /* APP8 */ - case 0xE9: /* APP9 */ - case 0xEA: /* APP10 */ - case 0xEB: /* APP11 */ - case 0xEC: /* APP12 */ - case 0xED: /* APP13 */ - case 0xEE: /* APP14 */ - case 0xEF: /* APP15 */ - case 0xFE: /* COM */ - p += (p[2] << 8 | p[3]) + 2; - }; - L: if (p - (unsigned char *)sp->jpegtables > 2) /* fake "JPEGTables" */ - { - - /* In case our client application asks, pretend that this image file - contains a modern "JPEGTables" TIFF record by copying to a buffer - the initial part of the JFIF bit-stream that we just scanned, from - the SOI marker through the "metadata" tables, then append an EOI - marker and flag the "JPEGTables" TIFF record as "present". - */ - sp->jpegtables_length = p - (unsigned char*)sp->jpegtables + 2; - p = sp->jpegtables; - if (!(sp->jpegtables = _TIFFmalloc(sp->jpegtables_length))) - { - TIFFError(module,no_jtable_space); - return 0; - }; - _TIFFmemcpy(sp->jpegtables,p,sp->jpegtables_length-2); - p = (unsigned char *)sp->jpegtables + sp->jpegtables_length; - p[-2] = 0xFF; p[-1] = JPEG_EOI; /* Append EOI marker */ - TIFFSetFieldBit(tif,FIELD_JPEGTABLES); - tif->tif_flags |= TIFF_DIRTYDIRECT; - } - else sp->jpegtables = 0; /* Don't simulate "JPEGTables" */ - if ( CALLJPEG(sp,-1,jpeg_read_header(&sp->cinfo.d,TRUE)) - != JPEG_HEADER_OK - ) return 0; - if ( sp->cinfo.d.image_width != segment_width - || sp->cinfo.d.image_height != td->td_imagelength - ) - { - TIFFError(module,"Improper JPEG strip/tile size"); - return 0; - }; - if (sp->cinfo.d.num_components != td->td_samplesperpixel) - { - TIFFError(module,"Improper JPEG component count"); - return 0; - }; - if (sp->cinfo.d.data_precision != td->td_bitspersample) - { - TIFFError(module,"Improper JPEG data precision"); - return 0; - }; - - /* Check that JPEG image components all have the same subsampling factors - declared (or defaulted) in the TIFF file, since TIFF Version 6.0 is more - restrictive than JPEG: Only the 0th component may have horizontal and - vertical subsampling factors other than <1,1>. - */ - subsampling_factors = sp->h_sampling << 3 | sp->v_sampling; - i = 0; - do - { - if ( ( sp->cinfo.d.comp_info[i].h_samp_factor << 3 - | sp->cinfo.d.comp_info[i].v_samp_factor - ) - != subsampling_factors - ) - { - TIFFError(module,"Improper JPEG subsampling factors"); - return 0; - }; - subsampling_factors = 011; /* Required for image components > 0 */ - } - while (++i < sp->cinfo.d.num_components); - } - else /* not JFIF image */ - { int (*save)(j_decompress_ptr cinfo) = sp->cinfo.d.marker->read_markers; - register int i; - - /* We're not assuming that this file's JPEG bit stream has any header - "metadata", so fool the JPEG Library into thinking that we read a - "Start of Input" (SOI) marker and a "Start of Frame" (SOFx) marker, then - force it to read a simulated "Start of Scan" (SOS) marker when we call - "jpeg_read_header()" below. This should cause the JPEG Library to - establish reasonable defaults. - */ - sp->cinfo.d.marker->saw_SOI = /* Pretend we saw SOI marker */ - sp->cinfo.d.marker->saw_SOF = TRUE; /* Pretend we saw SOF marker */ - sp->cinfo.d.marker->read_markers = - sp->is_WANG ? suspend : fake_SOS_marker; - sp->cinfo.d.global_state = DSTATE_INHEADER; - sp->cinfo.d.Se = DCTSIZE2-1; /* Suppress JPEG Library warning */ - sp->cinfo.d.image_width = segment_width; - sp->cinfo.d.image_height = td->td_imagelength; - - /* The following color-space initialization, including the complicated - "switch"-statement below, essentially duplicates the logic used by the - JPEG Library's "jpeg_init_colorspace()" subroutine during compression. - */ - sp->cinfo.d.num_components = td->td_samplesperpixel; - sp->cinfo.d.comp_info = (jpeg_component_info *) - (*sp->cinfo.d.mem->alloc_small) - ( &sp->cinfo.comm - , JPOOL_IMAGE - , sp->cinfo.d.num_components * sizeof *sp->cinfo.d.comp_info - ); - i = 0; - do - { - sp->cinfo.d.comp_info[i].component_index = i; - sp->cinfo.d.comp_info[i].component_needed = TRUE; - sp->cinfo.d.cur_comp_info[i] = &sp->cinfo.d.comp_info[i]; - } - while (++i < sp->cinfo.d.num_components); - switch (jpeg_color_space) - { - case JCS_UNKNOWN : - i = 0; - do - { - sp->cinfo.d.comp_info[i].component_id = i; - sp->cinfo.d.comp_info[i].h_samp_factor = - sp->cinfo.d.comp_info[i].v_samp_factor = 1; - } - while (++i < sp->cinfo.d.num_components); - break; - case JCS_GRAYSCALE: - sp->cinfo.d.comp_info[0].component_id = - sp->cinfo.d.comp_info[0].h_samp_factor = - sp->cinfo.d.comp_info[0].v_samp_factor = 1; - break; - case JCS_RGB : - sp->cinfo.d.comp_info[0].component_id = 'R'; - sp->cinfo.d.comp_info[1].component_id = 'G'; - sp->cinfo.d.comp_info[2].component_id = 'B'; - i = 0; - do sp->cinfo.d.comp_info[i].h_samp_factor = - sp->cinfo.d.comp_info[i].v_samp_factor = 1; - while (++i < sp->cinfo.d.num_components); - break; - case JCS_CMYK : - sp->cinfo.d.comp_info[0].component_id = 'C'; - sp->cinfo.d.comp_info[1].component_id = 'M'; - sp->cinfo.d.comp_info[2].component_id = 'Y'; - sp->cinfo.d.comp_info[3].component_id = 'K'; - i = 0; - do sp->cinfo.d.comp_info[i].h_samp_factor = - sp->cinfo.d.comp_info[i].v_samp_factor = 1; - while (++i < sp->cinfo.d.num_components); - break; - case JCS_YCbCr : - i = 0; - do - { - sp->cinfo.d.comp_info[i].component_id = i+1; - sp->cinfo.d.comp_info[i].h_samp_factor = - sp->cinfo.d.comp_info[i].v_samp_factor = 1; - sp->cinfo.d.comp_info[i].quant_tbl_no = - sp->cinfo.d.comp_info[i].dc_tbl_no = - sp->cinfo.d.comp_info[i].ac_tbl_no = i > 0; - } - while (++i < sp->cinfo.d.num_components); - sp->cinfo.d.comp_info[0].h_samp_factor = sp->h_sampling; - sp->cinfo.d.comp_info[0].v_samp_factor = sp->v_sampling; - }; - sp->cinfo.d.comps_in_scan = td->td_planarconfig == PLANARCONFIG_CONTIG - ? sp->cinfo.d.num_components - : 1; - i = CALLJPEG(sp,-1,jpeg_read_header(&sp->cinfo.d,!sp->is_WANG)); - sp->cinfo.d.marker->read_markers = save; /* Restore input method */ - if (sp->is_WANG) /* produced by Wang Imaging on Microsoft Windows */ - { - if (i != JPEG_SUSPENDED) return 0; - - /* BOGOSITY ALERT! Files prooduced by the Wang Imaging application for - Microsoft Windows are a special--and, technically - illegal--case. A JPEG SOS marker and rest of the data stream should - be located at the end of the file, in a position identified by the - 0th Strip offset. - */ - i = td->td_nstrips - 1; - sp->src.next_input_byte = tif->tif_base + td->td_stripoffset[0]; - sp->src.bytes_in_buffer = td->td_stripoffset[i] - - td->td_stripoffset[0] + td->td_stripbytecount[i]; - i = CALLJPEG(sp,-1,jpeg_read_header(&sp->cinfo.d,TRUE)); - }; - if (i != JPEG_HEADER_OK) return 0; - }; - - /* Some of our initialization must wait until the JPEG Library is initialized - above, in order to override its defaults. - */ - if ( (sp->cinfo.d.raw_data_out = downsampled_output) - && !alloc_downsampled_buffers(tif,sp->cinfo.d.comp_info, - sp->cinfo.d.num_components) - ) return 0; - sp->cinfo.d.jpeg_color_space = jpeg_color_space; - sp->cinfo.d.out_color_space = out_color_space; - sp->cinfo.d.dither_mode = JDITHER_NONE; /* Reduce image "noise" */ - sp->cinfo.d.two_pass_quantize = FALSE; - - /* If the image consists of separate, discontiguous TIFF "samples" (= color - planes, hopefully = JPEG "scans"), then we must use the JPEG Library's - "buffered image" mode to decompress the entire image into temporary buffers, - because the JPEG Library must parse the entire JPEG bit-stream in order to - be satsified that it has a complete set of color components for each pixel, - but the TIFF Library must allow our client to extract 1 component at a time. - Initializing the JPEG Library's "buffered image" mode is tricky: First, we - start its decompressor, then we tell the decompressor to "consume" (i.e., - buffer) the entire bit-stream. - - WARNING: Disabling "fancy" up-sampling seems to slightly reduce "noise" for - certain old Wang Imaging files, but it absolutely *must* be - enabled if the image has separate color planes, since in that case, the JPEG - Library doesn't use an "sp->cinfo.d.cconvert" structure (so de-referencing - this pointer below will cause a fatal crash) but writing our own code to up- - sample separate color planes is too much work for right now. Maybe someday? - */ - sp->cinfo.d.do_fancy_upsampling = /* Always let this default (to TRUE)? */ - sp->cinfo.d.buffered_image = td->td_planarconfig == PLANARCONFIG_SEPARATE; - if (!CALLJPEG(sp,0,jpeg_start_decompress(&sp->cinfo.d))) return 0; - if (sp->cinfo.d.buffered_image) /* separate color planes */ - { - if (sp->cinfo.d.raw_data_out) - tif->tif_decoderow = tif->tif_decodestrip = tif->tif_decodetile = - OJPEGDecodeRawSeparate; - else - { - tif->tif_decoderow = tif->tif_decodestrip = tif->tif_decodetile = - OJPEGDecode; - - /* In JPEG Library Version 6B, color-space conversion isn't implemented - for separate color planes, so we must do it ourself if our TIFF - client doesn't want to: - */ - sp->cinfo.d.cconvert->color_convert = - sp->cinfo.d.jpeg_color_space == sp->cinfo.d.out_color_space - ? null_convert : ycc_rgb_convert; - }; - L3: switch (CALLJPEG(sp,0,jpeg_consume_input(&sp->cinfo.d))) - { - default : goto L3; - - /* If no JPEG "End of Information" (EOI) marker is found when bit- - stream parsing ends, check whether we have enough data to proceed - before reporting an error. - */ - case JPEG_SUSPENDED : if ( sp->cinfo.d.input_scan_number - *sp->cinfo.d.image_height - + sp->cinfo.d.input_iMCU_row - *sp->cinfo.d.max_v_samp_factor -# ifdef D_LOSSLESS_SUPPORTED - *sp->cinfo.d.data_units_in_MCU - *sp->cinfo.d.min_codec_data_unit -# else - *sp->cinfo.d.blocks_in_MCU - *DCTSIZE -# endif - < td->td_samplesperpixel - *sp->cinfo.d.image_height - ) - { - TIFFError(tif->tif_name, - "Premature end of JPEG bit-stream"); - return 0; - } - case JPEG_REACHED_EOI: ; - } - } - else /* pixel-interleaved color planes */ - tif->tif_decoderow = tif->tif_decodestrip = tif->tif_decodetile = - downsampled_output ? OJPEGDecodeRawContig : OJPEGDecode; - return 1; -# undef td - } - -static int -OJPEGPreDecode(register TIFF *tif,tsample_t s) - { register OJPEGState *sp = OJState(tif); -# define td (&tif->tif_dir) - - /* If we are about to read the first row of an image plane (hopefully, these - are coincident with JPEG "scans"!), reset the JPEG Library's decompressor - appropriately. Otherwise, let the decompressor run "as is" and return a - "success" status without further ado. - */ - if ( (isTiled(tif) ? tif->tif_curtile : tif->tif_curstrip) - % td->td_stripsperimage - == 0 - ) - { - if ( sp->cinfo.d.buffered_image - && !CALLJPEG(sp,0,jpeg_start_output(&sp->cinfo.d,s+1)) - ) return 0; - sp->cinfo.d.output_scanline = 0; - - /* Mark subsampling buffers "empty". */ - -# ifdef D_LOSSLESS_SUPPORTED - sp->scancount = sp->cinfo.d.min_codec_data_unit; -# else - sp->scancount = DCTSIZE; -# endif - }; - return 1; -# undef td - } - -/*ARGSUSED*/ static void -OJPEGPostDecode(register TIFF *tif,tidata_t buf,tsize_t cc) - { register OJPEGState *sp = OJState(tif); -# define td (&tif->tif_dir) - - /* The JPEG Library decompressor has reached the end of a strip/tile. If this - is the end of a TIFF image "sample" (= JPEG "scan") in a file with separate - components (color planes), then end the "scan". If it ends the image's last - sample/scan, then also stop the JPEG Library's decompressor. - */ - if (sp->cinfo.d.output_scanline >= sp->cinfo.d.output_height) - { - if (sp->cinfo.d.buffered_image) - CALLJPEG(sp,-1,jpeg_finish_output(&sp->cinfo.d)); /* End JPEG scan */ - if ( (isTiled(tif) ? tif->tif_curtile : tif->tif_curstrip) - >= td->td_nstrips-1 - ) CALLJPEG(sp,0,jpeg_finish_decompress(&sp->cinfo.d)); - } -# undef td - } - -static int -OJPEGVSetField(register TIFF *tif,ttag_t tag,va_list ap) -{ - uint32 v32; - register OJPEGState *sp = OJState(tif); -# define td (&tif->tif_dir) - toff_t tiffoff=0; - uint32 bufoff=0; - uint32 code_count=0; - int i2=0; - int k2=0; - - switch (tag) - { - - /* If a "ReferenceBlackWhite" TIFF tag appears in the file explicitly, undo - any modified default definition that we might have installed below, then - install the real one. - */ - case TIFFTAG_REFERENCEBLACKWHITE : if (td->td_refblackwhite) - { - _TIFFfree(td->td_refblackwhite); - td->td_refblackwhite = 0; - }; - default : return - (*sp->vsetparent)(tif,tag,ap); - - /* BEWARE OF KLUDGE: Some old-format JPEG-in-TIFF files, including those - produced by the Wang Imaging application for Micro- - soft Windows, illegally omit a "ReferenceBlackWhite" TIFF tag, even - though the TIFF specification's default is intended for the RGB color - space and is inappropriate for the YCbCr color space ordinarily used for - JPEG images. Since many TIFF client applications request the value of - this tag immediately after a TIFF image directory is parsed, and before - any other code in this module receives control, we are forced to fix - this problem very early in image-file processing. Fortunately, legal - TIFF files are supposed to store their tags in numeric order, so a - mandatory "PhotometricInterpretation" tag should always appear before - an optional "ReferenceBlackWhite" tag. Hence, we slyly peek ahead when - we discover the desired photometry, by installing modified black and - white reference levels. - */ - case TIFFTAG_PHOTOMETRIC : - if ( (v32 = (*sp->vsetparent)(tif,tag,ap)) - && td->td_photometric == PHOTOMETRIC_YCBCR - ) - { - if ( (td->td_refblackwhite = _TIFFmalloc(6*sizeof(float))) ) - { register long top = 1 << td->td_bitspersample; - - td->td_refblackwhite[0] = 0; - td->td_refblackwhite[1] = td->td_refblackwhite[3] = - td->td_refblackwhite[5] = top - 1; - td->td_refblackwhite[2] = td->td_refblackwhite[4] = top >> 1; - } - else - { - TIFFError(tif->tif_name, - "Cannot set default reference black and white levels"); - v32 = 0; - }; - } - return v32; - - /* BEWARE OF KLUDGE: According to Charles Auer , if our - input is a multi-image (multi-directory) JPEG-in-TIFF - file is produced by the Wang Imaging application on Microsoft Windows, - for some reason the first directory excludes the vendor-specific "WANG - PageControl" tag (32934) that we check below, so the only other way to - identify these directories is apparently to look for a software- - identification tag with the substring, "Wang Labs". Single-image files - can apparently pass both tests, which causes no harm here, but what a - mess this is! - */ - case TIFFTAG_SOFTWARE : - { - char *software; - - v32 = (*sp->vsetparent)(tif,tag,ap); - if( TIFFGetField( tif, TIFFTAG_SOFTWARE, &software ) - && strstr( software, "Wang Labs" ) ) - sp->is_WANG = 1; - return v32; - } - - case TIFFTAG_JPEGPROC : - case TIFFTAG_JPEGIFOFFSET : - case TIFFTAG_JPEGIFBYTECOUNT : - case TIFFTAG_JPEGRESTARTINTERVAL : - case TIFFTAG_JPEGLOSSLESSPREDICTORS: - case TIFFTAG_JPEGPOINTTRANSFORM : - case TIFFTAG_JPEGQTABLES : - case TIFFTAG_JPEGDCTABLES : - case TIFFTAG_JPEGACTABLES : - case TIFFTAG_WANG_PAGECONTROL : - case TIFFTAG_JPEGCOLORMODE : ; - }; - v32 = va_arg(ap,uint32); /* No. of values in this TIFF record */ - - /* This switch statement is added for OJPEGVSetField */ - if(v32 !=0){ - switch(tag){ - case TIFFTAG_JPEGPROC: - sp->jpegproc=v32; - break; - case TIFFTAG_JPEGIFOFFSET: - sp->jpegifoffset=v32; - break; - case TIFFTAG_JPEGIFBYTECOUNT: - sp->jpegifbytecount=v32; - break; - case TIFFTAG_JPEGRESTARTINTERVAL: - sp->jpegrestartinterval=v32; - break; - case TIFFTAG_JPEGLOSSLESSPREDICTORS: - sp->jpeglosslesspredictors_length=v32; - break; - case TIFFTAG_JPEGPOINTTRANSFORM: - sp->jpegpointtransform_length=v32; - break; - case TIFFTAG_JPEGQTABLES: - sp->jpegqtables_length=v32; - break; - case TIFFTAG_JPEGACTABLES: - sp->jpegactables_length=v32; - break; - case TIFFTAG_JPEGDCTABLES: - sp->jpegdctables_length=v32; - break; - default: - break; - } - } - - /* BEWARE: The following actions apply only if we are reading a "source" TIFF - image to be decompressed for a client application program. If we - ever enhance this file's CODEC to write "destination" JPEG-in-TIFF images, - we'll need an "if"- and another "switch"-statement below, because we'll - probably want to store these records' values in some different places. Most - of these need not be parsed here in order to decode JPEG bit stream, so we - set boolean flags to note that they have been seen, but we otherwise ignore - them. - */ - switch (tag) - { JHUFF_TBL **h; - - /* Validate the JPEG-process code. */ - - case TIFFTAG_JPEGPROC : - switch (v32) - { - default : TIFFError(tif->tif_name, - "Unknown JPEG process"); - return 0; -# ifdef C_LOSSLESS_SUPPORTED - - /* Image uses (lossy) baseline sequential coding. */ - - case JPEGPROC_BASELINE: sp->cinfo.d.process = JPROC_SEQUENTIAL; - sp->cinfo.d.data_unit = DCTSIZE; - break; - - /* Image uses (lossless) Huffman coding. */ - - case JPEGPROC_LOSSLESS: sp->cinfo.d.process = JPROC_LOSSLESS; - sp->cinfo.d.data_unit = 1; -# else /* not C_LOSSLESS_SUPPORTED */ - case JPEGPROC_LOSSLESS: TIFFError(JPEGLib_name, - "Does not support lossless Huffman coding"); - return 0; - case JPEGPROC_BASELINE: ; -# endif /* C_LOSSLESS_SUPPORTED */ - }; - break; - - /* The TIFF Version 6.0 specification says that if the value of a TIFF - "JPEGInterchangeFormat" record is 0, then we are to behave as if this - record were absent; i.e., the data does *not* represent a JPEG Inter- - change Format File (JFIF), so don't even set the boolean "I've been - here" flag below. Otherwise, the field's value represents the file - offset of the JPEG SOI marker. - */ - case TIFFTAG_JPEGIFOFFSET : - if (v32) - { - sp->src.next_input_byte = tif->tif_base + v32; - break; - }; - return 1; - case TIFFTAG_JPEGIFBYTECOUNT : - sp->src.bytes_in_buffer = v32; - break; - - /* The TIFF Version 6.0 specification says that if the JPEG "Restart" - marker interval is 0, then the data has no "Restart" markers; i.e., we - must behave as if this TIFF record were absent. So, don't even set the - boolean "I've been here" flag below. - */ - /* - * Instead, set the field bit so TIFFGetField can get whether or not - * it was set. - */ - case TIFFTAG_JPEGRESTARTINTERVAL : - if (v32) - sp->cinfo.d.restart_interval = v32; - break; - /* The TIFF Version 6.0 specification says that this tag is supposed to be - a vector containing a value for each image component, but for lossless - Huffman coding (the only JPEG process defined by the specification for - which this tag should be needed), ISO IS 10918-1 uses only a single - value, equivalent to the "Ss" field in a JPEG bit-stream's "Start of - Scan" (SOS) marker. So, we extract the first vector element and ignore - the rest. (I hope this is correct!) - */ - case TIFFTAG_JPEGLOSSLESSPREDICTORS: - if (v32) - { - sp->cinfo.d.Ss = *va_arg(ap,uint16 *); - sp->jpeglosslesspredictors = - _TIFFmalloc(sp->jpeglosslesspredictors_length - * sizeof(uint16)); - if(sp->jpeglosslesspredictors==NULL){return(0);} - for(i2=0;i2jpeglosslesspredictors_length;i2++){ - ((uint16*)sp->jpeglosslesspredictors)[i2] = - ((uint16*)sp->cinfo.d.Ss)[i2]; - } - sp->jpeglosslesspredictors_length*=sizeof(uint16); - break; - }; - return v32; - - /* The TIFF Version 6.0 specification says that this tag is supposed to be - a vector containing a value for each image component, but for lossless - Huffman coding (the only JPEG process defined by the specification for - which this tag should be needed), ISO IS 10918-1 uses only a single - value, equivalent to the "Al" field in a JPEG bit-stream's "Start of - Scan" (SOS) marker. So, we extract the first vector element and ignore - the rest. (I hope this is correct!) - */ - case TIFFTAG_JPEGPOINTTRANSFORM : - if (v32) - { - sp->cinfo.d.Al = *va_arg(ap,uint16 *); - sp->jpegpointtransform = - _TIFFmalloc(sp->jpegpointtransform_length*sizeof(uint16)); - if(sp->jpegpointtransform==NULL){return(0);} - for(i2=0;i2jpegpointtransform_length;i2++) { - ((uint16*)sp->jpegpointtransform)[i2] = - ((uint16*)sp->cinfo.d.Al)[i2]; - } - sp->jpegpointtransform_length*=sizeof(uint16); - break; - } - return v32; - - /* We have a vector of offsets to quantization tables, so load 'em! */ - - case TIFFTAG_JPEGQTABLES : - if (v32) - { uint32 *v; - int i; - if (v32 > NUM_QUANT_TBLS) - { - TIFFError(tif->tif_name,"Too many quantization tables"); - return 0; - }; - i = 0; - v = va_arg(ap,uint32 *); - sp->jpegqtables=_TIFFmalloc(64*sp->jpegqtables_length); - if(sp->jpegqtables==NULL){return(0);} - tiffoff = TIFFSeekFile(tif, 0, SEEK_CUR); - bufoff=0; - for(i2=0;i2jpegqtables_length;i2++){ - TIFFSeekFile(tif, v[i2], SEEK_SET); - TIFFReadFile(tif, &(((u_char*)(sp->jpegqtables))[bufoff]), - 64); - bufoff+=64; - } - sp->jpegqtables_length=bufoff; - TIFFSeekFile(tif, tiffoff, SEEK_SET); - - do /* read quantization table */ - { register UINT8 *from = tif->tif_base + *v++; - register UINT16 *to; - register int j = DCTSIZE2; - - if (!( sp->cinfo.d.quant_tbl_ptrs[i] - = CALLJPEG(sp,0,jpeg_alloc_quant_table(&sp->cinfo.comm)) - ) - ) - { - TIFFError(JPEGLib_name,"No space for quantization table"); - return 0; - }; - to = sp->cinfo.d.quant_tbl_ptrs[i]->quantval; - do *to++ = *from++; while (--j > 0); - } - while (++i < v32); - sp->jpegtablesmode |= JPEGTABLESMODE_QUANT; - }; - break; - - /* We have a vector of offsets to DC Huffman tables, so load 'em! */ - - case TIFFTAG_JPEGDCTABLES : - h = sp->cinfo.d.dc_huff_tbl_ptrs; - goto L; - - /* We have a vector of offsets to AC Huffman tables, so load 'em! */ - - case TIFFTAG_JPEGACTABLES : - h = sp->cinfo.d.ac_huff_tbl_ptrs; - L: if (v32) - { uint32 *v; - int i; - if (v32 > NUM_HUFF_TBLS) - { - TIFFError(tif->tif_name,"Too many Huffman tables"); - return 0; - }; - v = va_arg(ap,uint32 *); - if(tag == TIFFTAG_JPEGDCTABLES) { - sp->jpegdctables=_TIFFmalloc(272*sp->jpegdctables_length); - if(sp->jpegdctables==NULL){return(0);} - tiffoff = TIFFSeekFile(tif, 0, SEEK_CUR); - bufoff=0; - code_count=0; - for(i2=0;i2jpegdctables_length;i2++){ - TIFFSeekFile(tif, v[i2], SEEK_SET); - TIFFReadFile(tif, - &(((u_char*)(sp->jpegdctables))[bufoff]), - 16); - code_count=0; - for(k2=0;k2<16;k2++){ - code_count+=((u_char*)(sp->jpegdctables))[k2+bufoff]; - } - TIFFReadFile(tif, - &(((u_char*)(sp->jpegdctables))[bufoff+16]), - code_count); - bufoff+=16; - bufoff+=code_count; - } - sp->jpegdctables_length=bufoff; - TIFFSeekFile(tif, tiffoff, SEEK_SET); - } - if(tag==TIFFTAG_JPEGACTABLES){ - sp->jpegactables=_TIFFmalloc(272*sp->jpegactables_length); - if(sp->jpegactables==NULL){return(0);} - tiffoff = TIFFSeekFile(tif, 0, SEEK_CUR); - bufoff=0; - code_count=0; - for(i2=0;i2jpegactables_length;i2++){ - TIFFSeekFile(tif, v[i2], SEEK_SET); - TIFFReadFile(tif, &(((unsigned char*)(sp->jpegactables))[bufoff]), 16); - code_count=0; - for(k2=0;k2<16;k2++){ - code_count+=((unsigned char*)(sp->jpegactables))[k2+bufoff]; - } - TIFFReadFile(tif, &(((unsigned char*)(sp->jpegactables))[bufoff+16]), code_count); - bufoff+=16; - bufoff+=code_count; - } - sp->jpegactables_length=bufoff; - TIFFSeekFile(tif, tiffoff, SEEK_SET); - } - i = 0; - do /* copy each Huffman table */ - { int size = 0; - register UINT8 *from = tif->tif_base + *v++, *to; - register int j = sizeof (*h)->bits; - - /* WARNING: This code relies on the fact that an image file not - "memory mapped" was read entirely into a single - buffer by "TIFFInitOJPEG()", so we can do a fast memory-to- - memory copy here. Each table consists of 16 Bytes, which are - suffixed to a 0 Byte when copied, followed by a variable - number of Bytes whose length is the sum of the first 16. - */ - if (!( *h - = CALLJPEG(sp,0,jpeg_alloc_huff_table(&sp->cinfo.comm)) - ) - ) - { - TIFFError(JPEGLib_name,"No space for Huffman table"); - return 0; - }; - to = (*h++)->bits; - *to++ = 0; - while (--j > 0) size += *to++ = *from++; /* Copy 16 Bytes */ - if (size > sizeof (*h)->huffval/sizeof *(*h)->huffval) - { - TIFFError(tif->tif_name,"Huffman table too big"); - return 0; - }; - if ((j = size) > 0) do *to++ = *from++; while (--j > 0); - while (++size <= sizeof (*h)->huffval/sizeof *(*h)->huffval) - *to++ = 0; /* Zero the rest of the table for cleanliness */ - } - while (++i < v32); - sp->jpegtablesmode |= JPEGTABLESMODE_HUFF; - }; - break; - - /* The following vendor-specific TIFF tag occurs in (highly illegal) files - produced by the Wang Imaging application for Microsoft Windows. These - can apparently have several "pages", in which case this tag specifies - the offset of a "page control" structure, which we don't currently know - how to handle. 0 indicates a 1-page image with no "page control", which - we make a feeble effort to handle. - */ - case TIFFTAG_WANG_PAGECONTROL : - if (v32 == 0) v32 = -1; - sp->is_WANG = v32; - tag = TIFFTAG_JPEGPROC+FIELD_WANG_PAGECONTROL-FIELD_JPEGPROC; - break; - - /* This pseudo tag indicates whether our caller is expected to do YCbCr <-> - RGB color-space conversion (JPEGCOLORMODE_RAW <=> 0) or whether we must - ask the JPEG Library to do it (JPEGCOLORMODE_RGB <=> 1). - */ - case TIFFTAG_JPEGCOLORMODE : - sp->jpegcolormode = v32; - - /* Mark the image to indicate whether returned data is up-sampled, so - that "TIFF{Strip,Tile}Size()" reflect the true amount of data present. - */ - v32 = tif->tif_flags; /* Save flags temporarily */ - tif->tif_flags &= ~TIFF_UPSAMPLED; - if ( td->td_photometric == PHOTOMETRIC_YCBCR - && (td->td_ycbcrsubsampling[0]<<3 | td->td_ycbcrsubsampling[1]) - != 011 - && sp->jpegcolormode == JPEGCOLORMODE_RGB - ) tif->tif_flags |= TIFF_UPSAMPLED; - - /* If the up-sampling state changed, re-calculate tile size. */ - - if ((tif->tif_flags ^ v32) & TIFF_UPSAMPLED) - { - tif->tif_tilesize = TIFFTileSize(tif); - tif->tif_flags |= TIFF_DIRTYDIRECT; - }; - return 1; - }; - TIFFSetFieldBit(tif,tag-TIFFTAG_JPEGPROC+FIELD_JPEGPROC); - return 1; -# undef td - } - -static int -OJPEGVGetField(register TIFF *tif,ttag_t tag,va_list ap) - { register OJPEGState *sp = OJState(tif); - - switch (tag) - { - - /* If this file has managed to synthesize a set of consolidated "metadata" - tables for the current (post-TIFF Version 6.0 specification) JPEG-in- - TIFF encapsulation strategy, then tell our caller about them; otherwise, - keep mum. - */ - case TIFFTAG_JPEGTABLES : - if (sp->jpegtables_length) /* we have "new"-style JPEG tables */ - { - *va_arg(ap,uint32 *) = sp->jpegtables_length; - *va_arg(ap,char **) = sp->jpegtables; - return 1; - }; - - /* This pseudo tag indicates whether our caller is expected to do YCbCr <-> - RGB color-space conversion (JPEGCOLORMODE_RAW <=> 0) or whether we must - ask the JPEG Library to do it (JPEGCOLORMODE_RGB <=> 1). - */ - case TIFFTAG_JPEGCOLORMODE : - *va_arg(ap,uint32 *) = sp->jpegcolormode; - return 1; - - /* The following tags are defined by the TIFF Version 6.0 specification - and are obsolete. If our caller asks for information about them, do not - return anything, even if we parsed them in an old-format "source" image. - */ - case TIFFTAG_JPEGPROC : - *va_arg(ap, uint16*)=sp->jpegproc; - return(1); - break; - case TIFFTAG_JPEGIFOFFSET : - *va_arg(ap, uint32*)=sp->jpegifoffset; - return(1); - break; - case TIFFTAG_JPEGIFBYTECOUNT : - *va_arg(ap, uint32*)=sp->jpegifbytecount; - return(1); - break; - case TIFFTAG_JPEGRESTARTINTERVAL : - *va_arg(ap, uint32*)=sp->jpegrestartinterval; - return(1); - break; - case TIFFTAG_JPEGLOSSLESSPREDICTORS: - *va_arg(ap, uint32*)=sp->jpeglosslesspredictors_length; - *va_arg(ap, void**)=sp->jpeglosslesspredictors; - return(1); - break; - case TIFFTAG_JPEGPOINTTRANSFORM : - *va_arg(ap, uint32*)=sp->jpegpointtransform_length; - *va_arg(ap, void**)=sp->jpegpointtransform; - return(1); - break; - case TIFFTAG_JPEGQTABLES : - *va_arg(ap, uint32*)=sp->jpegqtables_length; - *va_arg(ap, void**)=sp->jpegqtables; - return(1); - break; - case TIFFTAG_JPEGDCTABLES : - *va_arg(ap, uint32*)=sp->jpegdctables_length; - *va_arg(ap, void**)=sp->jpegdctables; - return(1); - break; - case TIFFTAG_JPEGACTABLES : - *va_arg(ap, uint32*)=sp->jpegactables_length; - *va_arg(ap, void**)=sp->jpegactables; - return(1); - break; - }; - return (*sp->vgetparent)(tif,tag,ap); - } - -static void -OJPEGPrintDir(register TIFF *tif,FILE *fd,long flags) - { register OJPEGState *sp = OJState(tif); - - if ( ( flags - & (TIFFPRINT_JPEGQTABLES|TIFFPRINT_JPEGDCTABLES|TIFFPRINT_JPEGACTABLES) - ) - && sp->jpegtables_length - ) - fprintf(fd," JPEG Table Data: , %lu bytes\n", - sp->jpegtables_length); - } - -static uint32 -OJPEGDefaultStripSize(register TIFF *tif,register uint32 s) - { register OJPEGState *sp = OJState(tif); -# define td (&tif->tif_dir) - - if ((s = (*sp->defsparent)(tif,s)) < td->td_imagelength) - { register tsize_t size = sp->cinfo.comm.is_decompressor -# ifdef D_LOSSLESS_SUPPORTED - ? sp->cinfo.d.min_codec_data_unit -# else - ? DCTSIZE -# endif -# ifdef C_LOSSLESS_SUPPORTED - : sp->cinfo.c.data_unit; -# else - : DCTSIZE; -# endif - - size = TIFFroundup(size,16); - s = TIFFroundup(s,td->td_ycbcrsubsampling[1]*size); - }; - return s; -# undef td - } - -static void -OJPEGDefaultTileSize(register TIFF *tif,register uint32 *tw,register uint32 *th) - { register OJPEGState *sp = OJState(tif); - register tsize_t size; -# define td (&tif->tif_dir) - - size = sp->cinfo.comm.is_decompressor -# ifdef D_LOSSLESS_SUPPORTED - ? sp->cinfo.d.min_codec_data_unit -# else - ? DCTSIZE -# endif -# ifdef C_LOSSLESS_SUPPORTED - : sp->cinfo.c.data_unit; -# else - : DCTSIZE; -# endif - size = TIFFroundup(size,16); - (*sp->deftparent)(tif,tw,th); - *tw = TIFFroundup(*tw,td->td_ycbcrsubsampling[0]*size); - *th = TIFFroundup(*th,td->td_ycbcrsubsampling[1]*size); -# undef td - } - -static void -OJPEGCleanUp(register TIFF *tif) - { register OJPEGState *sp; - - if ( (sp = OJState(tif)) ) - { - CALLVJPEG(sp,jpeg_destroy(&sp->cinfo.comm)); /* Free JPEG Lib. vars. */ - if (sp->jpegtables) {_TIFFfree(sp->jpegtables);sp->jpegtables=0;} - if (sp->jpeglosslesspredictors) { - _TIFFfree(sp->jpeglosslesspredictors); - sp->jpeglosslesspredictors = 0; - } - if (sp->jpegpointtransform) { - _TIFFfree(sp->jpegpointtransform); - sp->jpegpointtransform=0; - } - if (sp->jpegqtables) {_TIFFfree(sp->jpegqtables);sp->jpegqtables=0;} - if (sp->jpegactables) {_TIFFfree(sp->jpegactables);sp->jpegactables=0;} - if (sp->jpegdctables) {_TIFFfree(sp->jpegdctables);sp->jpegdctables=0;} - /* If the image file isn't "memory mapped" and we read it all into a - single, large memory buffer, free the buffer now. - */ - if (!isMapped(tif) && tif->tif_base) /* free whole-file buffer */ - { - _TIFFfree(tif->tif_base); - tif->tif_base = 0; - tif->tif_size = 0; - }; - _TIFFfree(sp); /* Release local variables */ - tif->tif_data = 0; - } - } - -int -TIFFInitOJPEG(register TIFF *tif,int scheme) - { register OJPEGState *sp; -# define td (&tif->tif_dir) -# ifndef never - - /* This module supports a decompression-only CODEC, which is intended strictly - for viewing old image files using the obsolete JPEG-in-TIFF encapsulation - specified by the TIFF Version 6.0 specification. It does not, and never - should, support compression for new images. If a client application asks us - to, refuse and complain loudly! - */ - if (tif->tif_mode != O_RDONLY) return _notSupported(tif); -# endif /* never */ - if (!isMapped(tif)) - { - - /* BEWARE OF KLUDGE: If our host operating-system doesn't let an image - file be "memory mapped", then we want to read the - entire file into a single (possibly large) memory buffer as if it had - been "memory mapped". Although this is likely to waste space, because - analysis of the file's content might cause parts of it to be read into - smaller buffers duplicatively, it appears to be the lesser of several - evils. Very old JPEG-in-TIFF encapsulations aren't guaranteed to be - JFIF bit streams, or to have a TIFF "JPEGTables" record or much other - "metadata" to help us locate the decoding tables and entropy-coded data, - so we're likely do a lot of random-access grokking around, and we must - ultimately tell the JPEG Library to sequentially scan much of the file - anyway. This is all likely to be easier if we use "brute force" to - read the entire file, once, and don't use incremental disc I/O. If our - client application tries to process a file so big that we can't buffer - it entirely, then tough shit: we'll give up and exit! - */ - if (!(tif->tif_base = _TIFFmalloc(tif->tif_size=TIFFGetFileSize(tif)))) - { - TIFFError(tif->tif_name,"Cannot allocate file buffer"); - return 0; - }; - if (!SeekOK(tif,0) || !ReadOK(tif,tif->tif_base,tif->tif_size)) - { - TIFFError(tif->tif_name,"Cannot read file"); - return 0; - } - }; - - /* Allocate storage for this module's per-file variables. */ - - if (!(tif->tif_data = (tidata_t)_TIFFmalloc(sizeof *sp))) - { - TIFFError("TIFFInitOJPEG","No space for JPEG state block"); - return 0; - }; - (sp = OJState(tif))->tif = tif; /* Initialize reverse pointer */ - sp->cinfo.d.err = jpeg_std_error(&sp->err); /* Initialize error handling */ - sp->err.error_exit = TIFFojpeg_error_exit; - sp->err.output_message = TIFFojpeg_output_message; - if (!CALLVJPEG(sp,jpeg_create_decompress(&sp->cinfo.d))) return 0; - - /* Install CODEC-specific tag information and override default TIFF Library - "method" subroutines with our own, CODEC-specific methods. Like all good - members of an object-class, we save some of these subroutine pointers for - "fall back" in case our own methods fail. - */ - _TIFFMergeFieldInfo(tif,ojpegFieldInfo, - sizeof ojpegFieldInfo/sizeof *ojpegFieldInfo); - sp->defsparent = tif->tif_defstripsize; - sp->deftparent = tif->tif_deftilesize; - sp->vgetparent = tif->tif_tagmethods.vgetfield; - sp->vsetparent = tif->tif_tagmethods.vsetfield; - tif->tif_defstripsize = OJPEGDefaultStripSize; - tif->tif_deftilesize = OJPEGDefaultTileSize; - tif->tif_tagmethods.vgetfield = OJPEGVGetField; - tif->tif_tagmethods.vsetfield = OJPEGVSetField; - tif->tif_tagmethods.printdir = OJPEGPrintDir; -# ifdef never - tif->tif_setupencode = OJPEGSetupEncode; - tif->tif_preencode = OJPEGPreEncode; - tif->tif_postencode = OJPEGPostEncode; -# else /* well, hardly ever */ - tif->tif_setupencode = tif->tif_postencode = _notSupported; - tif->tif_preencode = (TIFFPreMethod)_notSupported; -# endif /* never */ - tif->tif_setupdecode = OJPEGSetupDecode; - tif->tif_predecode = OJPEGPreDecode; - tif->tif_postdecode = OJPEGPostDecode; - tif->tif_cleanup = OJPEGCleanUp; - - /* If the image file doesn't have "JPEGInterchangeFormat[Length]" TIFF records - to guide us, we have few clues about where its encapsulated JPEG bit stream - is located, so establish intelligent defaults: If the Image File Directory - doesn't immediately follow the TIFF header, assume that the JPEG data lies - in between; otherwise, assume that it follows the Image File Directory. - */ - if (tif->tif_header.tiff_diroff > sizeof tif->tif_header) - { - sp->src.next_input_byte = tif->tif_base + sizeof tif->tif_header; - sp->src.bytes_in_buffer = tif->tif_header.tiff_diroff - - sizeof tif->tif_header; - } - else /* this case is ugly! */ - { uint32 maxoffset = tif->tif_size; - uint16 dircount; - - /* Calculate the offset to the next Image File Directory, if there is one, - or to the end of the file, if not. Then arrange to read the file from - the end of the Image File Directory to that offset. - */ - if (tif->tif_nextdiroff) maxoffset = tif->tif_nextdiroff; /* Not EOF */ - _TIFFmemcpy(&dircount,(const tdata_t) - (sp->src.next_input_byte = tif->tif_base+tif->tif_header.tiff_diroff), - sizeof dircount); - if (tif->tif_flags & TIFF_SWAB) TIFFSwabShort(&dircount); - sp->src.next_input_byte += dircount*sizeof(TIFFDirEntry) - + sizeof maxoffset + sizeof dircount; - sp->src.bytes_in_buffer = tif->tif_base - sp->src.next_input_byte - + maxoffset; - }; - - /* IJG JPEG Library Version 6B can be configured for either 8- or 12-bit sample - precision, but we assume that "old JPEG" TIFF clients only need 8 bits. - */ - sp->cinfo.d.data_precision = 8; -# ifdef C_LOSSLESS_SUPPORTED - - /* If the "JPEGProc" TIFF tag is missing from the Image File Dictionary, the - JPEG Library will use its (lossy) baseline sequential process by default. - */ - sp->cinfo.d.data_unit = DCTSIZE; -# endif /* C_LOSSLESS_SUPPORTED */ - - /* Initialize other CODEC-specific variables requiring default values. */ - - tif->tif_flags |= TIFF_NOBITREV; /* No bit-reversal within data bytes */ - sp->h_sampling = sp->v_sampling = 1; /* No subsampling by default */ - sp->is_WANG = 0; /* Assume not a MS Windows Wang Imaging file by default */ - sp->jpegtables = 0; /* No "new"-style JPEG tables synthesized yet */ - sp->jpegtables_length = 0; - sp->jpegquality = 75; /* Default IJG quality */ - sp->jpegcolormode = JPEGCOLORMODE_RAW; - sp->jpegtablesmode = 0; /* No tables found yet */ - sp->jpeglosslesspredictors=0; - sp->jpeglosslesspredictors_length=0; - sp->jpegpointtransform=0; - sp->jpegpointtransform_length=0; - sp->jpegqtables=0; - sp->jpegqtables_length=0; - sp->jpegdctables=0; - sp->jpegdctables_length=0; - sp->jpegactables=0; - sp->jpegactables_length=0; - return 1; -# undef td - } -#endif /* OJPEG_SUPPORT */ diff --git a/wxWidgets/src/tiff/tif_open.c b/wxWidgets/src/tiff/tif_open.c deleted file mode 100644 index a981b73522..0000000000 --- a/wxWidgets/src/tiff/tif_open.c +++ /dev/null @@ -1,495 +0,0 @@ -/* $Header$ */ - -/* - * Copyright (c) 1988-1997 Sam Leffler - * Copyright (c) 1991-1997 Silicon Graphics, Inc. - * - * Permission to use, copy, modify, distribute, and sell this software and - * its documentation for any purpose is hereby granted without fee, provided - * that (i) the above copyright notices and this permission notice appear in - * all copies of the software and related documentation, and (ii) the names of - * Sam Leffler and Silicon Graphics may not be used in any advertising or - * publicity relating to the software without the specific, prior written - * permission of Sam Leffler and Silicon Graphics. - * - * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, - * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * - * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR - * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, - * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF - * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE - * OF THIS SOFTWARE. - */ - -/* - * TIFF Library. - */ -#include "tiffiop.h" - -void _TIFFSetDefaultCompressionState(TIFF* tif); - -static const long typemask[13] = { - (long)0L, /* TIFF_NOTYPE */ - (long)0x000000ffL, /* TIFF_BYTE */ - (long)0xffffffffL, /* TIFF_ASCII */ - (long)0x0000ffffL, /* TIFF_SHORT */ - (long)0xffffffffL, /* TIFF_LONG */ - (long)0xffffffffL, /* TIFF_RATIONAL */ - (long)0x000000ffL, /* TIFF_SBYTE */ - (long)0x000000ffL, /* TIFF_UNDEFINED */ - (long)0x0000ffffL, /* TIFF_SSHORT */ - (long)0xffffffffL, /* TIFF_SLONG */ - (long)0xffffffffL, /* TIFF_SRATIONAL */ - (long)0xffffffffL, /* TIFF_FLOAT */ - (long)0xffffffffL, /* TIFF_DOUBLE */ -}; -static const int bigTypeshift[13] = { - 0, /* TIFF_NOTYPE */ - 24, /* TIFF_BYTE */ - 0, /* TIFF_ASCII */ - 16, /* TIFF_SHORT */ - 0, /* TIFF_LONG */ - 0, /* TIFF_RATIONAL */ - 24, /* TIFF_SBYTE */ - 24, /* TIFF_UNDEFINED */ - 16, /* TIFF_SSHORT */ - 0, /* TIFF_SLONG */ - 0, /* TIFF_SRATIONAL */ - 0, /* TIFF_FLOAT */ - 0, /* TIFF_DOUBLE */ -}; -static const int litTypeshift[13] = { - 0, /* TIFF_NOTYPE */ - 0, /* TIFF_BYTE */ - 0, /* TIFF_ASCII */ - 0, /* TIFF_SHORT */ - 0, /* TIFF_LONG */ - 0, /* TIFF_RATIONAL */ - 0, /* TIFF_SBYTE */ - 0, /* TIFF_UNDEFINED */ - 0, /* TIFF_SSHORT */ - 0, /* TIFF_SLONG */ - 0, /* TIFF_SRATIONAL */ - 0, /* TIFF_FLOAT */ - 0, /* TIFF_DOUBLE */ -}; - -/* - * Initialize the shift & mask tables, and the - * byte swapping state according to the file - * contents and the machine architecture. - */ -static void -TIFFInitOrder(TIFF* tif, int magic, int bigendian) -{ - tif->tif_typemask = typemask; - if (magic == TIFF_BIGENDIAN) { - tif->tif_typeshift = bigTypeshift; - if (!bigendian) - tif->tif_flags |= TIFF_SWAB; - } else { - tif->tif_typeshift = litTypeshift; - if (bigendian) - tif->tif_flags |= TIFF_SWAB; - } -} - -int -_TIFFgetMode(const char* mode, const char* module) -{ - int m = -1; - - switch (mode[0]) { - case 'r': - m = O_RDONLY; - if (mode[1] == '+') - m = O_RDWR; - break; - case 'w': - case 'a': - m = O_RDWR|O_CREAT; - if (mode[0] == 'w') - m |= O_TRUNC; - break; - default: - TIFFError(module, "\"%s\": Bad mode", mode); - break; - } - return (m); -} - -TIFF* -TIFFClientOpen( - const char* name, const char* mode, - thandle_t clientdata, - TIFFReadWriteProc readproc, - TIFFReadWriteProc writeproc, - TIFFSeekProc seekproc, - TIFFCloseProc closeproc, - TIFFSizeProc sizeproc, - TIFFMapFileProc mapproc, - TIFFUnmapFileProc unmapproc -) -{ - static const char module[] = "TIFFClientOpen"; - TIFF *tif; - int m, bigendian; - const char* cp; - - m = _TIFFgetMode(mode, module); - if (m == -1) - goto bad2; - tif = (TIFF *)_TIFFmalloc(sizeof (TIFF) + strlen(name) + 1); - if (tif == NULL) { - TIFFError(module, "%s: Out of memory (TIFF structure)", name); - goto bad2; - } - _TIFFmemset(tif, 0, sizeof (*tif)); - tif->tif_name = (char *)tif + sizeof (TIFF); - strcpy(tif->tif_name, name); - tif->tif_mode = m &~ (O_CREAT|O_TRUNC); - tif->tif_curdir = (tdir_t) -1; /* non-existent directory */ - tif->tif_curoff = 0; - tif->tif_curstrip = (tstrip_t) -1; /* invalid strip */ - tif->tif_row = (uint32) -1; /* read/write pre-increment */ - tif->tif_clientdata = clientdata; - if (!readproc || !writeproc || !seekproc || !closeproc - || !sizeproc || !mapproc || !unmapproc) { - TIFFError(module, "One of the client procedures are NULL pointer"); - goto bad3; - } - tif->tif_readproc = readproc; - tif->tif_writeproc = writeproc; - tif->tif_seekproc = seekproc; - tif->tif_closeproc = closeproc; - tif->tif_sizeproc = sizeproc; - tif->tif_mapproc = mapproc; - tif->tif_unmapproc = unmapproc; - _TIFFSetDefaultCompressionState(tif); /* setup default state */ - /* - * Default is to return data MSB2LSB and enable the - * use of memory-mapped files and strip chopping when - * a file is opened read-only. - */ - tif->tif_flags = FILLORDER_MSB2LSB; - if (m == O_RDONLY ) - tif->tif_flags |= TIFF_MAPPED; - -#ifdef STRIPCHOP_DEFAULT - if (m == O_RDONLY || m == O_RDWR) - tif->tif_flags |= STRIPCHOP_DEFAULT; -#endif - - { union { int32 i; char c[4]; } u; u.i = 1; bigendian = u.c[0] == 0; } - /* - * Process library-specific flags in the open mode string. - * The following flags may be used to control intrinsic library - * behaviour that may or may not be desirable (usually for - * compatibility with some application that claims to support - * TIFF but only supports some braindead idea of what the - * vendor thinks TIFF is): - * - * 'l' use little-endian byte order for creating a file - * 'b' use big-endian byte order for creating a file - * 'L' read/write information using LSB2MSB bit order - * 'B' read/write information using MSB2LSB bit order - * 'H' read/write information using host bit order - * 'M' enable use of memory-mapped files when supported - * 'm' disable use of memory-mapped files - * 'C' enable strip chopping support when reading - * 'c' disable strip chopping support - * - * The use of the 'l' and 'b' flags is strongly discouraged. - * These flags are provided solely because numerous vendors, - * typically on the PC, do not correctly support TIFF; they - * only support the Intel little-endian byte order. This - * support is not configured by default because it supports - * the violation of the TIFF spec that says that readers *MUST* - * support both byte orders. It is strongly recommended that - * you not use this feature except to deal with busted apps - * that write invalid TIFF. And even in those cases you should - * bang on the vendors to fix their software. - * - * The 'L', 'B', and 'H' flags are intended for applications - * that can optimize operations on data by using a particular - * bit order. By default the library returns data in MSB2LSB - * bit order for compatibility with older versions of this - * library. Returning data in the bit order of the native cpu - * makes the most sense but also requires applications to check - * the value of the FillOrder tag; something they probabyl do - * not do right now. - * - * The 'M' and 'm' flags are provided because some virtual memory - * systems exhibit poor behaviour when large images are mapped. - * These options permit clients to control the use of memory-mapped - * files on a per-file basis. - * - * The 'C' and 'c' flags are provided because the library support - * for chopping up large strips into multiple smaller strips is not - * application-transparent and as such can cause problems. The 'c' - * option permits applications that only want to look at the tags, - * for example, to get the unadulterated TIFF tag information. - */ - for (cp = mode; *cp; cp++) - switch (*cp) { - case 'b': - if ((m&O_CREAT) && !bigendian) - tif->tif_flags |= TIFF_SWAB; - break; - case 'l': - if ((m&O_CREAT) && bigendian) - tif->tif_flags |= TIFF_SWAB; - break; - case 'B': - tif->tif_flags = (tif->tif_flags &~ TIFF_FILLORDER) | - FILLORDER_MSB2LSB; - break; - case 'L': - tif->tif_flags = (tif->tif_flags &~ TIFF_FILLORDER) | - FILLORDER_LSB2MSB; - break; - case 'H': - tif->tif_flags = (tif->tif_flags &~ TIFF_FILLORDER) | - HOST_FILLORDER; - break; - case 'M': - if (m == O_RDONLY) - tif->tif_flags |= TIFF_MAPPED; - break; - case 'm': - if (m == O_RDONLY) - tif->tif_flags &= ~TIFF_MAPPED; - break; - case 'C': - if (m == O_RDONLY) - tif->tif_flags |= TIFF_STRIPCHOP; - break; - case 'c': - if (m == O_RDONLY) - tif->tif_flags &= ~TIFF_STRIPCHOP; - break; - } - /* - * Read in TIFF header. - */ - if (!ReadOK(tif, &tif->tif_header, sizeof (TIFFHeader))) { - if (tif->tif_mode == O_RDONLY) { - TIFFError(name, "Cannot read TIFF header"); - goto bad; - } - /* - * Setup header and write. - */ - tif->tif_header.tiff_magic = tif->tif_flags & TIFF_SWAB - ? (bigendian ? TIFF_LITTLEENDIAN : TIFF_BIGENDIAN) - : (bigendian ? TIFF_BIGENDIAN : TIFF_LITTLEENDIAN); - tif->tif_header.tiff_version = TIFF_VERSION; - if (tif->tif_flags & TIFF_SWAB) - TIFFSwabShort(&tif->tif_header.tiff_version); - tif->tif_header.tiff_diroff = 0; /* filled in later */ - - /* - * This seek shouldn't be necessary, but I have had some - * crazy problems with a failed fseek() on Solaris leaving - * the current file pointer out of whack when an fwrite() - * is done. - */ - TIFFSeekFile( tif, 0, SEEK_SET ); - - if (!WriteOK(tif, &tif->tif_header, sizeof (TIFFHeader))) { - TIFFError(name, "Error writing TIFF header"); - goto bad; - } - /* - * Setup the byte order handling. - */ - TIFFInitOrder(tif, tif->tif_header.tiff_magic, bigendian); - /* - * Setup default directory. - */ - if (!TIFFDefaultDirectory(tif)) - goto bad; - tif->tif_diroff = 0; - tif->tif_dirlist = NULL; - tif->tif_dirnumber = 0; - return (tif); - } - /* - * Setup the byte order handling. - */ - if (tif->tif_header.tiff_magic != TIFF_BIGENDIAN && - tif->tif_header.tiff_magic != TIFF_LITTLEENDIAN) { - TIFFError(name, "Not a TIFF file, bad magic number %d (0x%x)", - tif->tif_header.tiff_magic, - tif->tif_header.tiff_magic); - goto bad; - } - TIFFInitOrder(tif, tif->tif_header.tiff_magic, bigendian); - /* - * Swap header if required. - */ - if (tif->tif_flags & TIFF_SWAB) { - TIFFSwabShort(&tif->tif_header.tiff_version); - TIFFSwabLong(&tif->tif_header.tiff_diroff); - } - /* - * Now check version (if needed, it's been byte-swapped). - * Note that this isn't actually a version number, it's a - * magic number that doesn't change (stupid). - */ - if (tif->tif_header.tiff_version != TIFF_VERSION) { - TIFFError(name, - "Not a TIFF file, bad version number %d (0x%x)", - tif->tif_header.tiff_version, - tif->tif_header.tiff_version); - goto bad; - } - tif->tif_flags |= TIFF_MYBUFFER; - tif->tif_rawcp = tif->tif_rawdata = 0; - tif->tif_rawdatasize = 0; - /* - * Setup initial directory. - */ - switch (mode[0]) { - case 'r': - tif->tif_nextdiroff = tif->tif_header.tiff_diroff; - /* - * Try to use a memory-mapped file if the client - * has not explicitly suppressed usage with the - * 'm' flag in the open mode (see above). - */ - if ((tif->tif_flags & TIFF_MAPPED) && - !TIFFMapFileContents(tif, (tdata_t*) &tif->tif_base, &tif->tif_size)) - tif->tif_flags &= ~TIFF_MAPPED; - if (TIFFReadDirectory(tif)) { - tif->tif_rawcc = -1; - tif->tif_flags |= TIFF_BUFFERSETUP; - return (tif); - } - break; - case 'a': - /* - * New directories are automatically append - * to the end of the directory chain when they - * are written out (see TIFFWriteDirectory). - */ - if (!TIFFDefaultDirectory(tif)) - goto bad; - return (tif); - } -bad: - tif->tif_mode = O_RDONLY; /* XXX avoid flush */ - TIFFClose(tif); - return ((TIFF*)0); -bad2: - (void) (*closeproc)(clientdata); -bad3: - return ((TIFF*)0); -} - -/* - * Query functions to access private data. - */ - -/* - * Return open file's name. - */ -const char * -TIFFFileName(TIFF* tif) -{ - return (tif->tif_name); -} - -/* - * Return open file's I/O descriptor. - */ -int -TIFFFileno(TIFF* tif) -{ - return (tif->tif_fd); -} - -/* - * Return read/write mode. - */ -int -TIFFGetMode(TIFF* tif) -{ - return (tif->tif_mode); -} - -/* - * Return nonzero if file is organized in - * tiles; zero if organized as strips. - */ -int -TIFFIsTiled(TIFF* tif) -{ - return (isTiled(tif)); -} - -/* - * Return current row being read/written. - */ -uint32 -TIFFCurrentRow(TIFF* tif) -{ - return (tif->tif_row); -} - -/* - * Return index of the current directory. - */ -tdir_t -TIFFCurrentDirectory(TIFF* tif) -{ - return (tif->tif_curdir); -} - -/* - * Return current strip. - */ -tstrip_t -TIFFCurrentStrip(TIFF* tif) -{ - return (tif->tif_curstrip); -} - -/* - * Return current tile. - */ -ttile_t -TIFFCurrentTile(TIFF* tif) -{ - return (tif->tif_curtile); -} - -/* - * Return nonzero if the file has byte-swapped data. - */ -int -TIFFIsByteSwapped(TIFF* tif) -{ - return ((tif->tif_flags & TIFF_SWAB) != 0); -} - -/* - * Return nonzero if the data is returned up-sampled. - */ -int -TIFFIsUpSampled(TIFF* tif) -{ - return (isUpSampled(tif)); -} - -/* - * Return nonzero if the data is returned in MSB-to-LSB bit order. - */ -int -TIFFIsMSB2LSB(TIFF* tif) -{ - return (isFillOrder(tif, FILLORDER_MSB2LSB)); -} diff --git a/wxWidgets/src/tiff/tif_os2.c b/wxWidgets/src/tiff/tif_os2.c deleted file mode 100644 index 4631296207..0000000000 --- a/wxWidgets/src/tiff/tif_os2.c +++ /dev/null @@ -1,338 +0,0 @@ -/* $Header$ */ - -/* - * Copyright (c) 1988-1997 Sam Leffler - * Copyright (c) 1991-1997 Silicon Graphics, Inc. - * - * modifed for use with OS/2 by David Webster - * - * Permission to use, copy, modify, distribute, and sell this software and - * its documentation for any purpose is hereby granted without fee, provided - * that (i) the above copyright notices and this permission notice appear in - * all copies of the software and related documentation, and (ii) the names of - * Sam Leffler and Silicon Graphics may not be used in any advertising or - * publicity relating to the software without the specific, prior written - * permission of Sam Leffler and Silicon Graphics. - * - * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, - * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * - * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR - * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, - * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF - * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE - * OF THIS SOFTWARE. - */ - -/* - * TIFF Library OS/2-specific Routines. Adapted from tif_win32.c 2/16/00 by - * David Webster (dwebster@bhmi.com), Baldwin, Hackett, and Meeks, Inc., Omaha, NE USA - */ -#define INCL_PM -#define INCL_BASE -#include -#include -#include -#include "tiffiop.h" - -/* Some windows datatypes */ - -typedef ULONG DWORD; -typedef ULONG HANDLE; -typedef PCHAR LPTSTR; -typedef const PCHAR LPCTSTR; -typedef CHAR TCHAR; -#define GlobalAlloc(a,b) malloc(b) -#define LocalAlloc(a,b) malloc(b) -#define GlobalFree(b) free(b) -#define LocalFree(b) free(b) -#define GlobalReAlloc(p, s, t) realloc(p, s) -#define CopyMemory(p, v, s) memcpy(p, v, s) -#define FillMemory(p, c, s) memset(p, c, s) -#define GlobalSize(p) sizeof(p) -#define wsprintf sprintf -#define wvsprintf vsprintf -#define lstrlen strlen - -static tsize_t LINKAGEMODE -_tiffReadProc(thandle_t fd, tdata_t buf, tsize_t size) -{ - DWORD dwSizeRead; - if (!DosRead((HFILE)fd, buf, size, &dwSizeRead)) - return(0); - return ((tsize_t) dwSizeRead); -} - -static tsize_t LINKAGEMODE -_tiffWriteProc(thandle_t fd, tdata_t buf, tsize_t size) -{ - DWORD dwSizeWritten; - if (!DosWrite((HFILE)fd, buf, size, &dwSizeWritten)) - return(0); - return ((tsize_t) dwSizeWritten); -} - -static toff_t LINKAGEMODE -_tiffSeekProc(thandle_t fd, toff_t off, int whence) -{ - DWORD dwMoveMethod; - ULONG ibActual; - switch(whence) - { - case 0: - dwMoveMethod = FILE_BEGIN; - break; - case 1: - dwMoveMethod = FILE_CURRENT; - break; - case 2: - dwMoveMethod = FILE_END; - break; - default: - dwMoveMethod = FILE_BEGIN; - break; - } - DosSetFilePtr((HFILE)fd, off, dwMoveMethod, &ibActual); - return((toff_t)ibActual); -} - -static int LINKAGEMODE -_tiffCloseProc(thandle_t fd) -{ - return (DosClose((HFILE)fd) ? 0 : -1); -} - -static toff_t LINKAGEMODE -_tiffSizeProc(thandle_t fd) -{ - FILESTATUS3 vStatus; - - DosQueryFileInfo((HFILE)fd, FIL_STANDARD, &vStatus, sizeof(FILESTATUS3)); - return (vStatus.cbFile); -} - -static int LINKAGEMODE -_tiffDummyMapProc(thandle_t fd, tdata_t* pbase, toff_t* psize) -{ - return (0); -} - -/* - * From "Hermann Josef Hill" : - * - * Windows uses both a handle and a pointer for file mapping, - * but according to the SDK documentation and Richter's book - * "Advanced Windows Programming" it is safe to free the handle - * after obtaining the file mapping pointer - * - * This removes a nasty OS dependency and cures a problem - * with Visual C++ 5.0 - */ -static int LINKAGEMODE -_tiffMapProc(thandle_t fd, tdata_t* pbase, toff_t* psize) -{ - return(0); -} - -static void LINKAGEMODE -_tiffDummyUnmapProc(thandle_t fd, tdata_t base, toff_t size) -{ -} - -static void LINKAGEMODE -_tiffUnmapProc(thandle_t fd, tdata_t base, toff_t size) -{ -} - -/* - * Open a TIFF file descriptor for read/writing. - * Note that TIFFFdOpen and TIFFOpen recognise the character 'u' in the mode - * string, which forces the file to be opened unmapped. - */ -TIFF* -TIFFFdOpen(int ifd, const char* name, const char* mode) -{ - TIFF* tif; - BOOL fSuppressMap = (mode[1] == 'u' || mode[2] == 'u'); - - tif = TIFFClientOpen(name, mode, - (thandle_t)ifd, - _tiffReadProc, _tiffWriteProc, - _tiffSeekProc, _tiffCloseProc, _tiffSizeProc, - fSuppressMap ? _tiffDummyMapProc : _tiffMapProc, - fSuppressMap ? _tiffDummyUnmapProc : _tiffUnmapProc); - if (tif) - tif->tif_fd = ifd; - return (tif); -} - -/* - * Open a TIFF file for read/writing. - */ -TIFF* -TIFFOpen(const char* name, const char* mode) -{ - static const char module[] = "TIFFOpen"; - thandle_t fd; - int m; - DWORD dwOpenMode; - DWORD dwOpenFlags; - DWORD dwAction; - APIRET ulrc; - - m = _TIFFgetMode(mode, module); - - switch(m) - { - case O_RDONLY: - dwOpenMode = OPEN_ACCESS_READONLY; - dwOpenFlags = OPEN_ACTION_FAIL_IF_NEW; - break; - case O_RDWR: - dwOpenMode = OPEN_ACCESS_READWRITE; - dwOpenFlags = OPEN_ACTION_FAIL_IF_NEW; - break; - case O_RDWR|O_CREAT: - dwOpenMode = OPEN_ACCESS_READWRITE; - dwOpenFlags = OPEN_ACTION_CREATE_IF_NEW; - break; - case O_RDWR|O_TRUNC: - dwOpenMode = OPEN_ACCESS_READWRITE; - dwOpenFlags = OPEN_ACTION_FAIL_IF_NEW | OPEN_ACTION_OPEN_IF_EXISTS; - break; - case O_RDWR|O_CREAT|O_TRUNC: - dwOpenMode = OPEN_ACCESS_READWRITE; - dwOpenFlags = OPEN_ACTION_CREATE_IF_NEW | OPEN_ACTION_REPLACE_IF_EXISTS; - break; - default: - return ((TIFF*)0); - } - ulrc = DosOpen( name, (HFILE*)&fd, &dwAction, FILE_ARCHIVED|FILE_NORMAL - ,1000L, dwOpenFlags, dwOpenMode, NULL - ); - if (fd != NO_ERROR) { - TIFFError(module, "%s: Cannot open", name); - return ((TIFF *)0); - } - return (TIFFFdOpen((int)fd, name, mode)); -} - -tdata_t -_TIFFmalloc(tsize_t s) -{ - return ((tdata_t)GlobalAlloc(GMEM_FIXED, s)); -} - -void -_TIFFfree(tdata_t p) -{ - GlobalFree(p); - return; -} - -tdata_t -_TIFFrealloc(tdata_t p, tsize_t s) -{ - void* pvTmp; - if ((pvTmp = GlobalReAlloc(p, s, 0)) == NULL) { - if ((pvTmp = GlobalAlloc(sGMEM_FIXED, s)) != NULL) { - CopyMemory(pvTmp, p, GlobalSize(p)); - GlobalFree(p); - } - } - return ((tdata_t)pvTmp); -} - -void -_TIFFmemset(void* p, int v, tsize_t c) -{ - FillMemory(p, c, (BYTE)v); -} - -void -_TIFFmemcpy(void* d, const tdata_t s, tsize_t c) -{ - CopyMemory(d, s, c); -} - -int -_TIFFmemcmp(const tdata_t p1, const tdata_t p2, tsize_t c) -{ - register const *pb1 = (const int*)p1; - register const *pb2 = (const int*)p2; - register DWORD dwTmp = c; - register int iTmp; - for (iTmp = 0; dwTmp-- && !iTmp; iTmp = (int)*pb1++ - (int)*pb2++) - ; - return (iTmp); -} - -static void LINKAGEMODE -Os2WarningHandler(const char* module, const char* fmt, va_list ap) -{ -#ifndef TIF_PLATFORM_CONSOLE - LPTSTR szTitle; - LPTSTR szTmp; - LPCTSTR szTitleText = "%s Warning"; - LPCTSTR szDefaultModule = "TIFFLIB"; - szTmp = (module == NULL) ? (LPTSTR)szDefaultModule : (LPTSTR)module; - if ((szTitle = (LPTSTR)LocalAlloc(LMEM_FIXED, (lstrlen(szTmp) + - lstrlen(szTitleText) + lstrlen(fmt) + 128)*sizeof(TCHAR))) == NULL) - return; - wsprintf(szTitle, szTitleText, szTmp); - szTmp = szTitle + (lstrlen(szTitle)+2)*sizeof(TCHAR); - wvsprintf(szTmp, fmt, ap); - WinMessageBox( HWND_DESKTOP - ,WinQueryFocus(HWND_DESKTOP) - ,szTmp - ,szTitle - ,0 - ,MB_OK | MB_INFORMATION - ); - LocalFree(szTitle); - return; -#else - if (module != NULL) - fprintf(stderr, "%s: ", module); - fprintf(stderr, "Warning, "); - vfprintf(stderr, fmt, ap); - fprintf(stderr, ".\n"); -#endif -} -TIFFErrorHandler _TIFFwarningHandler = Os2WarningHandler; - -static void LINKAGEMODE -Os2ErrorHandler(const char* module, const char* fmt, va_list ap) -{ -#ifndef TIF_PLATFORM_CONSOLE - LPTSTR szTitle; - LPTSTR szTmp; - LPCTSTR szTitleText = "%s Error"; - LPCTSTR szDefaultModule = "TIFFLIB"; - szTmp = (module == NULL) ? (LPTSTR)szDefaultModule : (LPTSTR)module; - if ((szTitle = (LPTSTR)LocalAlloc(LMEM_FIXED, (lstrlen(szTmp) + - lstrlen(szTitleText) + lstrlen(fmt) + 128)*sizeof(TCHAR))) == NULL) - return; - wsprintf(szTitle, szTitleText, szTmp); - szTmp = szTitle + (lstrlen(szTitle)+2)*sizeof(TCHAR); - wvsprintf(szTmp, fmt, ap); - WinMessageBox( HWND_DESKTOP - ,WinQueryFocus(HWND_DESKTOP) - ,szTmp - ,szTitle - ,0 - ,MB_OK | MB_ICONEXCLAMATION - ); - LocalFree(szTitle); - return; -#else - if (module != NULL) - fprintf(stderr, "%s: ", module); - vfprintf(stderr, fmt, ap); - fprintf(stderr, ".\n"); -#endif -} -TIFFErrorHandler _TIFFerrorHandler = Os2ErrorHandler; - diff --git a/wxWidgets/src/tiff/tif_packbits.c b/wxWidgets/src/tiff/tif_packbits.c deleted file mode 100644 index 63a03d14b8..0000000000 --- a/wxWidgets/src/tiff/tif_packbits.c +++ /dev/null @@ -1,300 +0,0 @@ -/* $Header$ */ - -/* - * Copyright (c) 1988-1997 Sam Leffler - * Copyright (c) 1991-1997 Silicon Graphics, Inc. - * - * Permission to use, copy, modify, distribute, and sell this software and - * its documentation for any purpose is hereby granted without fee, provided - * that (i) the above copyright notices and this permission notice appear in - * all copies of the software and related documentation, and (ii) the names of - * Sam Leffler and Silicon Graphics may not be used in any advertising or - * publicity relating to the software without the specific, prior written - * permission of Sam Leffler and Silicon Graphics. - * - * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, - * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * - * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR - * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, - * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF - * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE - * OF THIS SOFTWARE. - */ - -#include "tiffiop.h" -#ifdef PACKBITS_SUPPORT -/* - * TIFF Library. - * - * PackBits Compression Algorithm Support - */ -#include -#include - -static int -PackBitsPreEncode(TIFF* tif, tsample_t s) -{ - (void) s; - /* - * Calculate the scanline/tile-width size in bytes. - */ - if (isTiled(tif)) - tif->tif_data = (tidata_t) TIFFTileRowSize(tif); - else - tif->tif_data = (tidata_t) TIFFScanlineSize(tif); - return (1); -} - -/* - * NB: tidata is the type representing *(tidata_t); - * if tidata_t is made signed then this type must - * be adjusted accordingly. - */ -typedef unsigned char tidata; - -/* - * Encode a run of pixels. - */ -static int -PackBitsEncode(TIFF* tif, tidata_t buf, tsize_t cc, tsample_t s) -{ - u_char* bp = (u_char*) buf; - tidata_t op, ep, lastliteral; - long n, slop; - int b; - enum { BASE, LITERAL, RUN, LITERAL_RUN } state; - - (void) s; - op = tif->tif_rawcp; - ep = tif->tif_rawdata + tif->tif_rawdatasize; - state = BASE; - lastliteral = 0; - while (cc > 0) { - /* - * Find the longest string of identical bytes. - */ - b = *bp++, cc--, n = 1; - for (; cc > 0 && b == *bp; cc--, bp++) - n++; - again: - if (op + 2 >= ep) { /* insure space for new data */ - /* - * Be careful about writing the last - * literal. Must write up to that point - * and then copy the remainder to the - * front of the buffer. - */ - if (state == LITERAL || state == LITERAL_RUN) { - slop = op - lastliteral; - tif->tif_rawcc += lastliteral - tif->tif_rawcp; - if (!TIFFFlushData1(tif)) - return (-1); - op = tif->tif_rawcp; - while (slop-- > 0) - *op++ = *lastliteral++; - lastliteral = tif->tif_rawcp; - } else { - tif->tif_rawcc += op - tif->tif_rawcp; - if (!TIFFFlushData1(tif)) - return (-1); - op = tif->tif_rawcp; - } - } - switch (state) { - case BASE: /* initial state, set run/literal */ - if (n > 1) { - state = RUN; - if (n > 128) { - *op++ = (tidata) -127; - *op++ = (tidataval_t) b; - n -= 128; - goto again; - } - *op++ = (tidataval_t)(-(n-1)); - *op++ = (tidataval_t) b; - } else { - lastliteral = op; - *op++ = 0; - *op++ = (tidataval_t) b; - state = LITERAL; - } - break; - case LITERAL: /* last object was literal string */ - if (n > 1) { - state = LITERAL_RUN; - if (n > 128) { - *op++ = (tidata) -127; - *op++ = (tidataval_t) b; - n -= 128; - goto again; - } - *op++ = (tidataval_t)(-(n-1)); /* encode run */ - *op++ = (tidataval_t) b; - } else { /* extend literal */ - if (++(*lastliteral) == 127) - state = BASE; - *op++ = (tidataval_t) b; - } - break; - case RUN: /* last object was run */ - if (n > 1) { - if (n > 128) { - *op++ = (tidata) -127; - *op++ = (tidataval_t) b; - n -= 128; - goto again; - } - *op++ = (tidataval_t)(-(n-1)); - *op++ = (tidataval_t) b; - } else { - lastliteral = op; - *op++ = 0; - *op++ = (tidataval_t) b; - state = LITERAL; - } - break; - case LITERAL_RUN: /* literal followed by a run */ - /* - * Check to see if previous run should - * be converted to a literal, in which - * case we convert literal-run-literal - * to a single literal. - */ - if (n == 1 && op[-2] == (tidata) -1 && - *lastliteral < 126) { - state = (((*lastliteral) += 2) == 127 ? - BASE : LITERAL); - op[-2] = op[-1]; /* replicate */ - } else - state = RUN; - goto again; - } - } - tif->tif_rawcc += op - tif->tif_rawcp; - tif->tif_rawcp = op; - return (1); -} - -/* - * Encode a rectangular chunk of pixels. We break it up - * into row-sized pieces to insure that encoded runs do - * not span rows. Otherwise, there can be problems with - * the decoder if data is read, for example, by scanlines - * when it was encoded by strips. - */ -static int -PackBitsEncodeChunk(TIFF* tif, tidata_t bp, tsize_t cc, tsample_t s) -{ -#if defined(__hpux) && defined(__LP64__) - tsize_t rowsize = (tsize_t)(unsigned long) tif->tif_data; -#else - tsize_t rowsize = (tsize_t) tif->tif_data; -#endif - - assert(rowsize > 0); - -#ifdef YCBCR_SUPPORT - /* - * YCBCR data isn't really separable into rows, so we - * might as well encode the whole tile/strip as one chunk. - */ - if( tif->tif_dir.td_photometric == PHOTOMETRIC_YCBCR ) { -#if defined(__hpux) && defined(__LP64__) - rowsize = (tsize_t)(unsigned long) tif->tif_data; -#else - rowsize = (tsize_t) tif->tif_data; -#endif - } -#endif - - while ((long)cc > 0) { - int chunk = rowsize; - - if( cc < chunk ) - chunk = cc; - - if (PackBitsEncode(tif, bp, chunk, s) < 0) - return (-1); - bp += chunk; - cc -= chunk; - } - return (1); -} - -static int -PackBitsDecode(TIFF* tif, tidata_t op, tsize_t occ, tsample_t s) -{ - char *bp; - tsize_t cc; - long n; - int b; - - (void) s; - bp = (char*) tif->tif_rawcp; - cc = tif->tif_rawcc; - while (cc > 0 && (long)occ > 0) { - n = (long) *bp++, cc--; - /* - * Watch out for compilers that - * don't sign extend chars... - */ - if (n >= 128) - n -= 256; - if (n < 0) { /* replicate next byte -n+1 times */ - if (n == -128) /* nop */ - continue; - n = -n + 1; - if( occ < n ) - { - TIFFWarning(tif->tif_name, - "PackBitsDecode: discarding %d bytes " - "to avoid buffer overrun", - n - occ); - n = occ; - } - occ -= n; - b = *bp++, cc--; - while (n-- > 0) - *op++ = (tidataval_t) b; - } else { /* copy next n+1 bytes literally */ - if (occ < n + 1) - { - TIFFWarning(tif->tif_name, - "PackBitsDecode: discarding %d bytes " - "to avoid buffer overrun", - n - occ + 1); - n = occ - 1; - } - _TIFFmemcpy(op, bp, ++n); - op += n; occ -= n; - bp += n; cc -= n; - } - } - tif->tif_rawcp = (tidata_t) bp; - tif->tif_rawcc = cc; - if (occ > 0) { - TIFFError(tif->tif_name, - "PackBitsDecode: Not enough data for scanline %ld", - (long) tif->tif_row); - return (0); - } - return (1); -} - -int -TIFFInitPackBits(TIFF* tif, int scheme) -{ - (void) scheme; - tif->tif_decoderow = PackBitsDecode; - tif->tif_decodestrip = PackBitsDecode; - tif->tif_decodetile = PackBitsDecode; - tif->tif_preencode = PackBitsPreEncode; - tif->tif_encoderow = PackBitsEncode; - tif->tif_encodestrip = PackBitsEncodeChunk; - tif->tif_encodetile = PackBitsEncodeChunk; - return (1); -} -#endif /* PACKBITS_SUPPORT */ diff --git a/wxWidgets/src/tiff/tif_pixarlog.c b/wxWidgets/src/tiff/tif_pixarlog.c deleted file mode 100644 index 01943946e4..0000000000 --- a/wxWidgets/src/tiff/tif_pixarlog.c +++ /dev/null @@ -1,1328 +0,0 @@ -/* - * Copyright (c) 1996-1997 Sam Leffler - * Copyright (c) 1996 Pixar - * - * Permission to use, copy, modify, distribute, and sell this software and - * its documentation for any purpose is hereby granted without fee, provided - * that (i) the above copyright notices and this permission notice appear in - * all copies of the software and related documentation, and (ii) the names of - * Pixar, Sam Leffler and Silicon Graphics may not be used in any advertising or - * publicity relating to the software without the specific, prior written - * permission of Pixar, Sam Leffler and Silicon Graphics. - * - * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, - * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * - * IN NO EVENT SHALL PIXAR, SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR - * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, - * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF - * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE - * OF THIS SOFTWARE. - */ - -#include "tiffiop.h" -#ifdef PIXARLOG_SUPPORT - -/* - * TIFF Library. - * PixarLog Compression Support - * - * Contributed by Dan McCoy. - * - * PixarLog film support uses the TIFF library to store companded - * 11 bit values into a tiff file, which are compressed using the - * zip compressor. - * - * The codec can take as input and produce as output 32-bit IEEE float values - * as well as 16-bit or 8-bit unsigned integer values. - * - * On writing any of the above are converted into the internal - * 11-bit log format. In the case of 8 and 16 bit values, the - * input is assumed to be unsigned linear color values that represent - * the range 0-1. In the case of IEEE values, the 0-1 range is assumed to - * be the normal linear color range, in addition over 1 values are - * accepted up to a value of about 25.0 to encode "hot" highlights and such. - * The encoding is lossless for 8-bit values, slightly lossy for the - * other bit depths. The actual color precision should be better - * than the human eye can perceive with extra room to allow for - * error introduced by further image computation. As with any quantized - * color format, it is possible to perform image calculations which - * expose the quantization error. This format should certainly be less - * susceptable to such errors than standard 8-bit encodings, but more - * susceptable than straight 16-bit or 32-bit encodings. - * - * On reading the internal format is converted to the desired output format. - * The program can request which format it desires by setting the internal - * pseudo tag TIFFTAG_PIXARLOGDATAFMT to one of these possible values: - * PIXARLOGDATAFMT_FLOAT = provide IEEE float values. - * PIXARLOGDATAFMT_16BIT = provide unsigned 16-bit integer values - * PIXARLOGDATAFMT_8BIT = provide unsigned 8-bit integer values - * - * alternately PIXARLOGDATAFMT_8BITABGR provides unsigned 8-bit integer - * values with the difference that if there are exactly three or four channels - * (rgb or rgba) it swaps the channel order (bgr or abgr). - * - * PIXARLOGDATAFMT_11BITLOG provides the internal encoding directly - * packed in 16-bit values. However no tools are supplied for interpreting - * these values. - * - * "hot" (over 1.0) areas written in floating point get clamped to - * 1.0 in the integer data types. - * - * When the file is closed after writing, the bit depth and sample format - * are set always to appear as if 8-bit data has been written into it. - * That way a naive program unaware of the particulars of the encoding - * gets the format it is most likely able to handle. - * - * The codec does it's own horizontal differencing step on the coded - * values so the libraries predictor stuff should be turned off. - * The codec also handle byte swapping the encoded values as necessary - * since the library does not have the information necessary - * to know the bit depth of the raw unencoded buffer. - * - */ - -#include "tif_predict.h" -#include "zlib.h" - -#include -#include -#include -#include - -/* Tables for converting to/from 11 bit coded values */ - -#define TSIZE 2048 /* decode table size (11-bit tokens) */ -#define TSIZEP1 2049 /* Plus one for slop */ -#define ONE 1250 /* token value of 1.0 exactly */ -#define RATIO 1.004 /* nominal ratio for log part */ - -#define CODE_MASK 0x7ff /* 11 bits. */ - -static float Fltsize; -static float LogK1, LogK2; - -#define REPEAT(n, op) { int i; i=n; do { i--; op; } while (i>0); } - -static void -horizontalAccumulateF(uint16 *wp, int n, int stride, float *op, - float *ToLinearF) -{ - register unsigned int cr, cg, cb, ca, mask; - register float t0, t1, t2, t3; - - if (n >= stride) { - mask = CODE_MASK; - if (stride == 3) { - t0 = ToLinearF[cr = wp[0]]; - t1 = ToLinearF[cg = wp[1]]; - t2 = ToLinearF[cb = wp[2]]; - op[0] = t0; - op[1] = t1; - op[2] = t2; - n -= 3; - while (n > 0) { - wp += 3; - op += 3; - n -= 3; - t0 = ToLinearF[(cr += wp[0]) & mask]; - t1 = ToLinearF[(cg += wp[1]) & mask]; - t2 = ToLinearF[(cb += wp[2]) & mask]; - op[0] = t0; - op[1] = t1; - op[2] = t2; - } - } else if (stride == 4) { - t0 = ToLinearF[cr = wp[0]]; - t1 = ToLinearF[cg = wp[1]]; - t2 = ToLinearF[cb = wp[2]]; - t3 = ToLinearF[ca = wp[3]]; - op[0] = t0; - op[1] = t1; - op[2] = t2; - op[3] = t3; - n -= 4; - while (n > 0) { - wp += 4; - op += 4; - n -= 4; - t0 = ToLinearF[(cr += wp[0]) & mask]; - t1 = ToLinearF[(cg += wp[1]) & mask]; - t2 = ToLinearF[(cb += wp[2]) & mask]; - t3 = ToLinearF[(ca += wp[3]) & mask]; - op[0] = t0; - op[1] = t1; - op[2] = t2; - op[3] = t3; - } - } else { - REPEAT(stride, *op = ToLinearF[*wp&mask]; wp++; op++) - n -= stride; - while (n > 0) { - REPEAT(stride, - wp[stride] += *wp; *op = ToLinearF[*wp&mask]; wp++; op++) - n -= stride; - } - } - } -} - -static void -horizontalAccumulate12(uint16 *wp, int n, int stride, int16 *op, - float *ToLinearF) -{ - register unsigned int cr, cg, cb, ca, mask; - register float t0, t1, t2, t3; - -#define SCALE12 2048.0 -#define CLAMP12(t) (((t) < 3071) ? (uint16) (t) : 3071) - - if (n >= stride) { - mask = CODE_MASK; - if (stride == 3) { - t0 = ToLinearF[cr = wp[0]] * SCALE12; - t1 = ToLinearF[cg = wp[1]] * SCALE12; - t2 = ToLinearF[cb = wp[2]] * SCALE12; - op[0] = CLAMP12(t0); - op[1] = CLAMP12(t1); - op[2] = CLAMP12(t2); - n -= 3; - while (n > 0) { - wp += 3; - op += 3; - n -= 3; - t0 = ToLinearF[(cr += wp[0]) & mask] * SCALE12; - t1 = ToLinearF[(cg += wp[1]) & mask] * SCALE12; - t2 = ToLinearF[(cb += wp[2]) & mask] * SCALE12; - op[0] = CLAMP12(t0); - op[1] = CLAMP12(t1); - op[2] = CLAMP12(t2); - } - } else if (stride == 4) { - t0 = ToLinearF[cr = wp[0]] * SCALE12; - t1 = ToLinearF[cg = wp[1]] * SCALE12; - t2 = ToLinearF[cb = wp[2]] * SCALE12; - t3 = ToLinearF[ca = wp[3]] * SCALE12; - op[0] = CLAMP12(t0); - op[1] = CLAMP12(t1); - op[2] = CLAMP12(t2); - op[3] = CLAMP12(t3); - n -= 4; - while (n > 0) { - wp += 4; - op += 4; - n -= 4; - t0 = ToLinearF[(cr += wp[0]) & mask] * SCALE12; - t1 = ToLinearF[(cg += wp[1]) & mask] * SCALE12; - t2 = ToLinearF[(cb += wp[2]) & mask] * SCALE12; - t3 = ToLinearF[(ca += wp[3]) & mask] * SCALE12; - op[0] = CLAMP12(t0); - op[1] = CLAMP12(t1); - op[2] = CLAMP12(t2); - op[3] = CLAMP12(t3); - } - } else { - REPEAT(stride, t0 = ToLinearF[*wp&mask] * SCALE12; - *op = CLAMP12(t0); wp++; op++) - n -= stride; - while (n > 0) { - REPEAT(stride, - wp[stride] += *wp; t0 = ToLinearF[wp[stride]&mask]*SCALE12; - *op = CLAMP12(t0); wp++; op++) - n -= stride; - } - } - } -} - -static void -horizontalAccumulate16(uint16 *wp, int n, int stride, uint16 *op, - uint16 *ToLinear16) -{ - register unsigned int cr, cg, cb, ca, mask; - - if (n >= stride) { - mask = CODE_MASK; - if (stride == 3) { - op[0] = ToLinear16[cr = wp[0]]; - op[1] = ToLinear16[cg = wp[1]]; - op[2] = ToLinear16[cb = wp[2]]; - n -= 3; - while (n > 0) { - wp += 3; - op += 3; - n -= 3; - op[0] = ToLinear16[(cr += wp[0]) & mask]; - op[1] = ToLinear16[(cg += wp[1]) & mask]; - op[2] = ToLinear16[(cb += wp[2]) & mask]; - } - } else if (stride == 4) { - op[0] = ToLinear16[cr = wp[0]]; - op[1] = ToLinear16[cg = wp[1]]; - op[2] = ToLinear16[cb = wp[2]]; - op[3] = ToLinear16[ca = wp[3]]; - n -= 4; - while (n > 0) { - wp += 4; - op += 4; - n -= 4; - op[0] = ToLinear16[(cr += wp[0]) & mask]; - op[1] = ToLinear16[(cg += wp[1]) & mask]; - op[2] = ToLinear16[(cb += wp[2]) & mask]; - op[3] = ToLinear16[(ca += wp[3]) & mask]; - } - } else { - REPEAT(stride, *op = ToLinear16[*wp&mask]; wp++; op++) - n -= stride; - while (n > 0) { - REPEAT(stride, - wp[stride] += *wp; *op = ToLinear16[*wp&mask]; wp++; op++) - n -= stride; - } - } - } -} - -/* - * Returns the log encoded 11-bit values with the horizontal - * differencing undone. - */ -static void -horizontalAccumulate11(uint16 *wp, int n, int stride, uint16 *op) -{ - register unsigned int cr, cg, cb, ca, mask; - - if (n >= stride) { - mask = CODE_MASK; - if (stride == 3) { - op[0] = cr = wp[0]; op[1] = cg = wp[1]; op[2] = cb = wp[2]; - n -= 3; - while (n > 0) { - wp += 3; - op += 3; - n -= 3; - op[0] = (cr += wp[0]) & mask; - op[1] = (cg += wp[1]) & mask; - op[2] = (cb += wp[2]) & mask; - } - } else if (stride == 4) { - op[0] = cr = wp[0]; op[1] = cg = wp[1]; - op[2] = cb = wp[2]; op[3] = ca = wp[3]; - n -= 4; - while (n > 0) { - wp += 4; - op += 4; - n -= 4; - op[0] = (cr += wp[0]) & mask; - op[1] = (cg += wp[1]) & mask; - op[2] = (cb += wp[2]) & mask; - op[3] = (ca += wp[3]) & mask; - } - } else { - REPEAT(stride, *op = *wp&mask; wp++; op++) - n -= stride; - while (n > 0) { - REPEAT(stride, - wp[stride] += *wp; *op = *wp&mask; wp++; op++) - n -= stride; - } - } - } -} - -static void -horizontalAccumulate8(uint16 *wp, int n, int stride, unsigned char *op, - unsigned char *ToLinear8) -{ - register unsigned int cr, cg, cb, ca, mask; - - if (n >= stride) { - mask = CODE_MASK; - if (stride == 3) { - op[0] = ToLinear8[cr = wp[0]]; - op[1] = ToLinear8[cg = wp[1]]; - op[2] = ToLinear8[cb = wp[2]]; - n -= 3; - while (n > 0) { - n -= 3; - wp += 3; - op += 3; - op[0] = ToLinear8[(cr += wp[0]) & mask]; - op[1] = ToLinear8[(cg += wp[1]) & mask]; - op[2] = ToLinear8[(cb += wp[2]) & mask]; - } - } else if (stride == 4) { - op[0] = ToLinear8[cr = wp[0]]; - op[1] = ToLinear8[cg = wp[1]]; - op[2] = ToLinear8[cb = wp[2]]; - op[3] = ToLinear8[ca = wp[3]]; - n -= 4; - while (n > 0) { - n -= 4; - wp += 4; - op += 4; - op[0] = ToLinear8[(cr += wp[0]) & mask]; - op[1] = ToLinear8[(cg += wp[1]) & mask]; - op[2] = ToLinear8[(cb += wp[2]) & mask]; - op[3] = ToLinear8[(ca += wp[3]) & mask]; - } - } else { - REPEAT(stride, *op = ToLinear8[*wp&mask]; wp++; op++) - n -= stride; - while (n > 0) { - REPEAT(stride, - wp[stride] += *wp; *op = ToLinear8[*wp&mask]; wp++; op++) - n -= stride; - } - } - } -} - - -static void -horizontalAccumulate8abgr(uint16 *wp, int n, int stride, unsigned char *op, - unsigned char *ToLinear8) -{ - register unsigned int cr, cg, cb, ca, mask; - register unsigned char t0, t1, t2, t3; - - if (n >= stride) { - mask = CODE_MASK; - if (stride == 3) { - op[0] = 0; - t1 = ToLinear8[cb = wp[2]]; - t2 = ToLinear8[cg = wp[1]]; - t3 = ToLinear8[cr = wp[0]]; - op[1] = t1; - op[2] = t2; - op[3] = t3; - n -= 3; - while (n > 0) { - n -= 3; - wp += 3; - op += 4; - op[0] = 0; - t1 = ToLinear8[(cb += wp[2]) & mask]; - t2 = ToLinear8[(cg += wp[1]) & mask]; - t3 = ToLinear8[(cr += wp[0]) & mask]; - op[1] = t1; - op[2] = t2; - op[3] = t3; - } - } else if (stride == 4) { - t0 = ToLinear8[ca = wp[3]]; - t1 = ToLinear8[cb = wp[2]]; - t2 = ToLinear8[cg = wp[1]]; - t3 = ToLinear8[cr = wp[0]]; - op[0] = t0; - op[1] = t1; - op[2] = t2; - op[3] = t3; - n -= 4; - while (n > 0) { - n -= 4; - wp += 4; - op += 4; - t0 = ToLinear8[(ca += wp[3]) & mask]; - t1 = ToLinear8[(cb += wp[2]) & mask]; - t2 = ToLinear8[(cg += wp[1]) & mask]; - t3 = ToLinear8[(cr += wp[0]) & mask]; - op[0] = t0; - op[1] = t1; - op[2] = t2; - op[3] = t3; - } - } else { - REPEAT(stride, *op = ToLinear8[*wp&mask]; wp++; op++) - n -= stride; - while (n > 0) { - REPEAT(stride, - wp[stride] += *wp; *op = ToLinear8[*wp&mask]; wp++; op++) - n -= stride; - } - } - } -} - -/* - * State block for each open TIFF - * file using PixarLog compression/decompression. - */ -typedef struct { - TIFFPredictorState predict; - z_stream stream; - uint16 *tbuf; - uint16 stride; - int state; - int user_datafmt; - int quality; -#define PLSTATE_INIT 1 - - TIFFVSetMethod vgetparent; /* super-class method */ - TIFFVSetMethod vsetparent; /* super-class method */ - - float *ToLinearF; - uint16 *ToLinear16; - unsigned char *ToLinear8; - uint16 *FromLT2; - uint16 *From14; /* Really for 16-bit data, but we shift down 2 */ - uint16 *From8; - -} PixarLogState; - -static int -PixarLogMakeTables(PixarLogState *sp) -{ - -/* - * We make several tables here to convert between various external - * representations (float, 16-bit, and 8-bit) and the internal - * 11-bit companded representation. The 11-bit representation has two - * distinct regions. A linear bottom end up through .018316 in steps - * of about .000073, and a region of constant ratio up to about 25. - * These floating point numbers are stored in the main table ToLinearF. - * All other tables are derived from this one. The tables (and the - * ratios) are continuous at the internal seam. - */ - - int nlin, lt2size; - int i, j; - double b, c, linstep, v; - float *ToLinearF; - uint16 *ToLinear16; - unsigned char *ToLinear8; - uint16 *FromLT2; - uint16 *From14; /* Really for 16-bit data, but we shift down 2 */ - uint16 *From8; - - c = log(RATIO); - nlin = (int)1./c; /* nlin must be an integer */ - c = 1./nlin; - b = exp(-c*ONE); /* multiplicative scale factor [b*exp(c*ONE) = 1] */ - linstep = b*c*exp(1.); - - LogK1 = 1./c; /* if (v >= 2) token = k1*log(v*k2) */ - LogK2 = 1./b; - lt2size = (int)(2./linstep) + 1; - FromLT2 = (uint16 *)_TIFFmalloc(lt2size*sizeof(uint16)); - From14 = (uint16 *)_TIFFmalloc(16384*sizeof(uint16)); - From8 = (uint16 *)_TIFFmalloc(256*sizeof(uint16)); - ToLinearF = (float *)_TIFFmalloc(TSIZEP1 * sizeof(float)); - ToLinear16 = (uint16 *)_TIFFmalloc(TSIZEP1 * sizeof(uint16)); - ToLinear8 = (unsigned char *)_TIFFmalloc(TSIZEP1 * sizeof(unsigned char)); - if (FromLT2 == NULL || From14 == NULL || From8 == NULL || - ToLinearF == NULL || ToLinear16 == NULL || ToLinear8 == NULL) { - if (FromLT2) _TIFFfree(FromLT2); - if (From14) _TIFFfree(From14); - if (From8) _TIFFfree(From8); - if (ToLinearF) _TIFFfree(ToLinearF); - if (ToLinear16) _TIFFfree(ToLinear16); - if (ToLinear8) _TIFFfree(ToLinear8); - sp->FromLT2 = NULL; - sp->From14 = NULL; - sp->From8 = NULL; - sp->ToLinearF = NULL; - sp->ToLinear16 = NULL; - sp->ToLinear8 = NULL; - return 0; - } - - j = 0; - - for (i = 0; i < nlin; i++) { - v = i * linstep; - ToLinearF[j++] = v; - } - - for (i = nlin; i < TSIZE; i++) - ToLinearF[j++] = b*exp(c*i); - - ToLinearF[2048] = ToLinearF[2047]; - - for (i = 0; i < TSIZEP1; i++) { - v = ToLinearF[i]*65535.0 + 0.5; - ToLinear16[i] = (v > 65535.0) ? 65535 : (uint16)v; - v = ToLinearF[i]*255.0 + 0.5; - ToLinear8[i] = (v > 255.0) ? 255 : (unsigned char)v; - } - - j = 0; - for (i = 0; i < lt2size; i++) { - if ((i*linstep)*(i*linstep) > ToLinearF[j]*ToLinearF[j+1]) - j++; - FromLT2[i] = j; - } - - /* - * Since we lose info anyway on 16-bit data, we set up a 14-bit - * table and shift 16-bit values down two bits on input. - * saves a little table space. - */ - j = 0; - for (i = 0; i < 16384; i++) { - while ((i/16383.)*(i/16383.) > ToLinearF[j]*ToLinearF[j+1]) - j++; - From14[i] = j; - } - - j = 0; - for (i = 0; i < 256; i++) { - while ((i/255.)*(i/255.) > ToLinearF[j]*ToLinearF[j+1]) - j++; - From8[i] = j; - } - - Fltsize = lt2size/2; - - sp->ToLinearF = ToLinearF; - sp->ToLinear16 = ToLinear16; - sp->ToLinear8 = ToLinear8; - sp->FromLT2 = FromLT2; - sp->From14 = From14; - sp->From8 = From8; - - return 1; -} - -#define DecoderState(tif) ((PixarLogState*) (tif)->tif_data) -#define EncoderState(tif) ((PixarLogState*) (tif)->tif_data) - -static int PixarLogEncode(TIFF*, tidata_t, tsize_t, tsample_t); -static int PixarLogDecode(TIFF*, tidata_t, tsize_t, tsample_t); - -#define N(a) (sizeof(a)/sizeof(a[0])) -#define PIXARLOGDATAFMT_UNKNOWN -1 - -static int -PixarLogGuessDataFmt(TIFFDirectory *td) -{ - int guess = PIXARLOGDATAFMT_UNKNOWN; - int format = td->td_sampleformat; - - /* If the user didn't tell us his datafmt, - * take our best guess from the bitspersample. - */ - switch (td->td_bitspersample) { - case 32: - if (format == SAMPLEFORMAT_IEEEFP) - guess = PIXARLOGDATAFMT_FLOAT; - break; - case 16: - if (format == SAMPLEFORMAT_VOID || format == SAMPLEFORMAT_UINT) - guess = PIXARLOGDATAFMT_16BIT; - break; - case 12: - if (format == SAMPLEFORMAT_VOID || format == SAMPLEFORMAT_INT) - guess = PIXARLOGDATAFMT_12BITPICIO; - break; - case 11: - if (format == SAMPLEFORMAT_VOID || format == SAMPLEFORMAT_UINT) - guess = PIXARLOGDATAFMT_11BITLOG; - break; - case 8: - if (format == SAMPLEFORMAT_VOID || format == SAMPLEFORMAT_UINT) - guess = PIXARLOGDATAFMT_8BIT; - break; - } - - return guess; -} - -static uint32 -multiply(size_t m1, size_t m2) -{ - uint32 bytes = m1 * m2; - - if (m1 && bytes / m1 != m2) - bytes = 0; - - return bytes; -} - -static int -PixarLogSetupDecode(TIFF* tif) -{ - TIFFDirectory *td = &tif->tif_dir; - PixarLogState* sp = DecoderState(tif); - tsize_t tbuf_size; - static const char module[] = "PixarLogSetupDecode"; - - assert(sp != NULL); - - /* Make sure no byte swapping happens on the data - * after decompression. */ - tif->tif_postdecode = _TIFFNoPostDecode; - - /* for some reason, we can't do this in TIFFInitPixarLog */ - - sp->stride = (td->td_planarconfig == PLANARCONFIG_CONTIG ? - td->td_samplesperpixel : 1); - tbuf_size = multiply(multiply(multiply(sp->stride, td->td_imagewidth), - td->td_rowsperstrip), sizeof(uint16)); - if (tbuf_size == 0) - return (0); - sp->tbuf = (uint16 *) _TIFFmalloc(tbuf_size); - if (sp->tbuf == NULL) - return (0); - if (sp->user_datafmt == PIXARLOGDATAFMT_UNKNOWN) - sp->user_datafmt = PixarLogGuessDataFmt(td); - if (sp->user_datafmt == PIXARLOGDATAFMT_UNKNOWN) { - TIFFError(module, - "PixarLog compression can't handle bits depth/data format combination (depth: %d)", - td->td_bitspersample); - return (0); - } - - if (inflateInit(&sp->stream) != Z_OK) { - TIFFError(module, "%s: %s", tif->tif_name, sp->stream.msg); - return (0); - } else { - sp->state |= PLSTATE_INIT; - return (1); - } -} - -/* - * Setup state for decoding a strip. - */ -static int -PixarLogPreDecode(TIFF* tif, tsample_t s) -{ - PixarLogState* sp = DecoderState(tif); - - (void) s; - assert(sp != NULL); - sp->stream.next_in = tif->tif_rawdata; - sp->stream.avail_in = tif->tif_rawcc; - return (inflateReset(&sp->stream) == Z_OK); -} - -static int -PixarLogDecode(TIFF* tif, tidata_t op, tsize_t occ, tsample_t s) -{ - TIFFDirectory *td = &tif->tif_dir; - PixarLogState* sp = DecoderState(tif); - static const char module[] = "PixarLogDecode"; - int i, nsamples, llen; - uint16 *up; - - switch (sp->user_datafmt) { - case PIXARLOGDATAFMT_FLOAT: - nsamples = occ / sizeof(float); /* XXX float == 32 bits */ - break; - case PIXARLOGDATAFMT_16BIT: - case PIXARLOGDATAFMT_12BITPICIO: - case PIXARLOGDATAFMT_11BITLOG: - nsamples = occ / sizeof(uint16); /* XXX uint16 == 16 bits */ - break; - case PIXARLOGDATAFMT_8BIT: - case PIXARLOGDATAFMT_8BITABGR: - nsamples = occ; - break; - default: - TIFFError(tif->tif_name, - "%d bit input not supported in PixarLog", - td->td_bitspersample); - return 0; - } - - llen = sp->stride * td->td_imagewidth; - - (void) s; - assert(sp != NULL); - sp->stream.next_out = (unsigned char *) sp->tbuf; - sp->stream.avail_out = nsamples * sizeof(uint16); - do { - int state = inflate(&sp->stream, Z_PARTIAL_FLUSH); - if (state == Z_STREAM_END) { - break; /* XXX */ - } - if (state == Z_DATA_ERROR) { - TIFFError(module, - "%s: Decoding error at scanline %d, %s", - tif->tif_name, tif->tif_row, sp->stream.msg); - if (inflateSync(&sp->stream) != Z_OK) - return (0); - continue; - } - if (state != Z_OK) { - TIFFError(module, "%s: zlib error: %s", - tif->tif_name, sp->stream.msg); - return (0); - } - } while (sp->stream.avail_out > 0); - - /* hopefully, we got all the bytes we needed */ - if (sp->stream.avail_out != 0) { - TIFFError(module, - "%s: Not enough data at scanline %d (short %d bytes)", - tif->tif_name, tif->tif_row, sp->stream.avail_out); - return (0); - } - - up = sp->tbuf; - /* Swap bytes in the data if from a different endian machine. */ - if (tif->tif_flags & TIFF_SWAB) - TIFFSwabArrayOfShort(up, nsamples); - - for (i = 0; i < nsamples; i += llen, up += llen) { - switch (sp->user_datafmt) { - case PIXARLOGDATAFMT_FLOAT: - horizontalAccumulateF(up, llen, sp->stride, - (float *)op, sp->ToLinearF); - op += llen * sizeof(float); - break; - case PIXARLOGDATAFMT_16BIT: - horizontalAccumulate16(up, llen, sp->stride, - (uint16 *)op, sp->ToLinear16); - op += llen * sizeof(uint16); - break; - case PIXARLOGDATAFMT_12BITPICIO: - horizontalAccumulate12(up, llen, sp->stride, - (int16 *)op, sp->ToLinearF); - op += llen * sizeof(int16); - break; - case PIXARLOGDATAFMT_11BITLOG: - horizontalAccumulate11(up, llen, sp->stride, - (uint16 *)op); - op += llen * sizeof(uint16); - break; - case PIXARLOGDATAFMT_8BIT: - horizontalAccumulate8(up, llen, sp->stride, - (unsigned char *)op, sp->ToLinear8); - op += llen * sizeof(unsigned char); - break; - case PIXARLOGDATAFMT_8BITABGR: - horizontalAccumulate8abgr(up, llen, sp->stride, - (unsigned char *)op, sp->ToLinear8); - op += llen * sizeof(unsigned char); - break; - default: - TIFFError(tif->tif_name, - "PixarLogDecode: unsupported bits/sample: %d", - td->td_bitspersample); - return (0); - } - } - - return (1); -} - -static int -PixarLogSetupEncode(TIFF* tif) -{ - TIFFDirectory *td = &tif->tif_dir; - PixarLogState* sp = EncoderState(tif); - tsize_t tbuf_size; - static const char module[] = "PixarLogSetupEncode"; - - assert(sp != NULL); - - /* for some reason, we can't do this in TIFFInitPixarLog */ - - sp->stride = (td->td_planarconfig == PLANARCONFIG_CONTIG ? - td->td_samplesperpixel : 1); - tbuf_size = multiply(multiply(multiply(sp->stride, td->td_imagewidth), - td->td_rowsperstrip), sizeof(uint16)); - if (tbuf_size == 0) - return (0); - sp->tbuf = (uint16 *) _TIFFmalloc(tbuf_size); - if (sp->tbuf == NULL) - return (0); - if (sp->user_datafmt == PIXARLOGDATAFMT_UNKNOWN) - sp->user_datafmt = PixarLogGuessDataFmt(td); - if (sp->user_datafmt == PIXARLOGDATAFMT_UNKNOWN) { - TIFFError(module, "PixarLog compression can't handle %d bit linear encodings", td->td_bitspersample); - return (0); - } - - if (deflateInit(&sp->stream, sp->quality) != Z_OK) { - TIFFError(module, "%s: %s", tif->tif_name, sp->stream.msg); - return (0); - } else { - sp->state |= PLSTATE_INIT; - return (1); - } -} - -/* - * Reset encoding state at the start of a strip. - */ -static int -PixarLogPreEncode(TIFF* tif, tsample_t s) -{ - PixarLogState *sp = EncoderState(tif); - - (void) s; - assert(sp != NULL); - sp->stream.next_out = tif->tif_rawdata; - sp->stream.avail_out = tif->tif_rawdatasize; - return (deflateReset(&sp->stream) == Z_OK); -} - -static void -horizontalDifferenceF(float *ip, int n, int stride, uint16 *wp, uint16 *FromLT2) -{ - - register int r1, g1, b1, a1, r2, g2, b2, a2, mask; - register float fltsize = Fltsize; - -#define CLAMP(v) ( (v<(float)0.) ? 0 \ - : (v<(float)2.) ? FromLT2[(int)(v*fltsize)] \ - : (v>(float)24.2) ? 2047 \ - : LogK1*log(v*LogK2) + 0.5 ) - - mask = CODE_MASK; - if (n >= stride) { - if (stride == 3) { - r2 = wp[0] = CLAMP(ip[0]); g2 = wp[1] = CLAMP(ip[1]); - b2 = wp[2] = CLAMP(ip[2]); - n -= 3; - while (n > 0) { - n -= 3; - wp += 3; - ip += 3; - r1 = CLAMP(ip[0]); wp[0] = (r1-r2) & mask; r2 = r1; - g1 = CLAMP(ip[1]); wp[1] = (g1-g2) & mask; g2 = g1; - b1 = CLAMP(ip[2]); wp[2] = (b1-b2) & mask; b2 = b1; - } - } else if (stride == 4) { - r2 = wp[0] = CLAMP(ip[0]); g2 = wp[1] = CLAMP(ip[1]); - b2 = wp[2] = CLAMP(ip[2]); a2 = wp[3] = CLAMP(ip[3]); - n -= 4; - while (n > 0) { - n -= 4; - wp += 4; - ip += 4; - r1 = CLAMP(ip[0]); wp[0] = (r1-r2) & mask; r2 = r1; - g1 = CLAMP(ip[1]); wp[1] = (g1-g2) & mask; g2 = g1; - b1 = CLAMP(ip[2]); wp[2] = (b1-b2) & mask; b2 = b1; - a1 = CLAMP(ip[3]); wp[3] = (a1-a2) & mask; a2 = a1; - } - } else { - ip += n - 1; /* point to last one */ - wp += n - 1; /* point to last one */ - n -= stride; - while (n > 0) { - REPEAT(stride, wp[0] = CLAMP(ip[0]); - wp[stride] -= wp[0]; - wp[stride] &= mask; - wp--; ip--) - n -= stride; - } - REPEAT(stride, wp[0] = CLAMP(ip[0]); wp--; ip--) - } - } -} - -static void -horizontalDifference16(unsigned short *ip, int n, int stride, - unsigned short *wp, uint16 *From14) -{ - register int r1, g1, b1, a1, r2, g2, b2, a2, mask; - -/* assumption is unsigned pixel values */ -#undef CLAMP -#define CLAMP(v) From14[(v) >> 2] - - mask = CODE_MASK; - if (n >= stride) { - if (stride == 3) { - r2 = wp[0] = CLAMP(ip[0]); g2 = wp[1] = CLAMP(ip[1]); - b2 = wp[2] = CLAMP(ip[2]); - n -= 3; - while (n > 0) { - n -= 3; - wp += 3; - ip += 3; - r1 = CLAMP(ip[0]); wp[0] = (r1-r2) & mask; r2 = r1; - g1 = CLAMP(ip[1]); wp[1] = (g1-g2) & mask; g2 = g1; - b1 = CLAMP(ip[2]); wp[2] = (b1-b2) & mask; b2 = b1; - } - } else if (stride == 4) { - r2 = wp[0] = CLAMP(ip[0]); g2 = wp[1] = CLAMP(ip[1]); - b2 = wp[2] = CLAMP(ip[2]); a2 = wp[3] = CLAMP(ip[3]); - n -= 4; - while (n > 0) { - n -= 4; - wp += 4; - ip += 4; - r1 = CLAMP(ip[0]); wp[0] = (r1-r2) & mask; r2 = r1; - g1 = CLAMP(ip[1]); wp[1] = (g1-g2) & mask; g2 = g1; - b1 = CLAMP(ip[2]); wp[2] = (b1-b2) & mask; b2 = b1; - a1 = CLAMP(ip[3]); wp[3] = (a1-a2) & mask; a2 = a1; - } - } else { - ip += n - 1; /* point to last one */ - wp += n - 1; /* point to last one */ - n -= stride; - while (n > 0) { - REPEAT(stride, wp[0] = CLAMP(ip[0]); - wp[stride] -= wp[0]; - wp[stride] &= mask; - wp--; ip--) - n -= stride; - } - REPEAT(stride, wp[0] = CLAMP(ip[0]); wp--; ip--) - } - } -} - - -static void -horizontalDifference8(unsigned char *ip, int n, int stride, - unsigned short *wp, uint16 *From8) -{ - register int r1, g1, b1, a1, r2, g2, b2, a2, mask; - -#undef CLAMP -#define CLAMP(v) (From8[(v)]) - - mask = CODE_MASK; - if (n >= stride) { - if (stride == 3) { - r2 = wp[0] = CLAMP(ip[0]); g2 = wp[1] = CLAMP(ip[1]); - b2 = wp[2] = CLAMP(ip[2]); - n -= 3; - while (n > 0) { - n -= 3; - r1 = CLAMP(ip[3]); wp[3] = (r1-r2) & mask; r2 = r1; - g1 = CLAMP(ip[4]); wp[4] = (g1-g2) & mask; g2 = g1; - b1 = CLAMP(ip[5]); wp[5] = (b1-b2) & mask; b2 = b1; - wp += 3; - ip += 3; - } - } else if (stride == 4) { - r2 = wp[0] = CLAMP(ip[0]); g2 = wp[1] = CLAMP(ip[1]); - b2 = wp[2] = CLAMP(ip[2]); a2 = wp[3] = CLAMP(ip[3]); - n -= 4; - while (n > 0) { - n -= 4; - r1 = CLAMP(ip[4]); wp[4] = (r1-r2) & mask; r2 = r1; - g1 = CLAMP(ip[5]); wp[5] = (g1-g2) & mask; g2 = g1; - b1 = CLAMP(ip[6]); wp[6] = (b1-b2) & mask; b2 = b1; - a1 = CLAMP(ip[7]); wp[7] = (a1-a2) & mask; a2 = a1; - wp += 4; - ip += 4; - } - } else { - wp += n + stride - 1; /* point to last one */ - ip += n + stride - 1; /* point to last one */ - n -= stride; - while (n > 0) { - REPEAT(stride, wp[0] = CLAMP(ip[0]); - wp[stride] -= wp[0]; - wp[stride] &= mask; - wp--; ip--) - n -= stride; - } - REPEAT(stride, wp[0] = CLAMP(ip[0]); wp--; ip--) - } - } -} - -/* - * Encode a chunk of pixels. - */ -static int -PixarLogEncode(TIFF* tif, tidata_t bp, tsize_t cc, tsample_t s) -{ - TIFFDirectory *td = &tif->tif_dir; - PixarLogState *sp = EncoderState(tif); - static const char module[] = "PixarLogEncode"; - int i, n, llen; - unsigned short * up; - - (void) s; - - switch (sp->user_datafmt) { - case PIXARLOGDATAFMT_FLOAT: - n = cc / sizeof(float); /* XXX float == 32 bits */ - break; - case PIXARLOGDATAFMT_16BIT: - case PIXARLOGDATAFMT_12BITPICIO: - case PIXARLOGDATAFMT_11BITLOG: - n = cc / sizeof(uint16); /* XXX uint16 == 16 bits */ - break; - case PIXARLOGDATAFMT_8BIT: - case PIXARLOGDATAFMT_8BITABGR: - n = cc; - break; - default: - TIFFError(tif->tif_name, - "%d bit input not supported in PixarLog", - td->td_bitspersample); - return 0; - } - - llen = sp->stride * td->td_imagewidth; - - for (i = 0, up = sp->tbuf; i < n; i += llen, up += llen) { - switch (sp->user_datafmt) { - case PIXARLOGDATAFMT_FLOAT: - horizontalDifferenceF((float *)bp, llen, - sp->stride, up, sp->FromLT2); - bp += llen * sizeof(float); - break; - case PIXARLOGDATAFMT_16BIT: - horizontalDifference16((uint16 *)bp, llen, - sp->stride, up, sp->From14); - bp += llen * sizeof(uint16); - break; - case PIXARLOGDATAFMT_8BIT: - horizontalDifference8((unsigned char *)bp, llen, - sp->stride, up, sp->From8); - bp += llen * sizeof(unsigned char); - break; - default: - TIFFError(tif->tif_name, - "%d bit input not supported in PixarLog", - td->td_bitspersample); - return 0; - } - } - - sp->stream.next_in = (unsigned char *) sp->tbuf; - sp->stream.avail_in = n * sizeof(uint16); - - do { - if (deflate(&sp->stream, Z_NO_FLUSH) != Z_OK) { - TIFFError(module, "%s: Encoder error: %s", - tif->tif_name, sp->stream.msg); - return (0); - } - if (sp->stream.avail_out == 0) { - tif->tif_rawcc = tif->tif_rawdatasize; - TIFFFlushData1(tif); - sp->stream.next_out = tif->tif_rawdata; - sp->stream.avail_out = tif->tif_rawdatasize; - } - } while (sp->stream.avail_in > 0); - return (1); -} - -/* - * Finish off an encoded strip by flushing the last - * string and tacking on an End Of Information code. - */ - -static int -PixarLogPostEncode(TIFF* tif) -{ - PixarLogState *sp = EncoderState(tif); - static const char module[] = "PixarLogPostEncode"; - int state; - - sp->stream.avail_in = 0; - - do { - state = deflate(&sp->stream, Z_FINISH); - switch (state) { - case Z_STREAM_END: - case Z_OK: - if (sp->stream.avail_out != tif->tif_rawdatasize) { - tif->tif_rawcc = - tif->tif_rawdatasize - sp->stream.avail_out; - TIFFFlushData1(tif); - sp->stream.next_out = tif->tif_rawdata; - sp->stream.avail_out = tif->tif_rawdatasize; - } - break; - default: - TIFFError(module, "%s: zlib error: %s", - tif->tif_name, sp->stream.msg); - return (0); - } - } while (state != Z_STREAM_END); - return (1); -} - -static void -PixarLogClose(TIFF* tif) -{ - TIFFDirectory *td = &tif->tif_dir; - - /* In a really sneaky maneuver, on close, we covertly modify both - * bitspersample and sampleformat in the directory to indicate - * 8-bit linear. This way, the decode "just works" even for - * readers that don't know about PixarLog, or how to set - * the PIXARLOGDATFMT pseudo-tag. - */ - td->td_bitspersample = 8; - td->td_sampleformat = SAMPLEFORMAT_UINT; -} - -static void -PixarLogCleanup(TIFF* tif) -{ - PixarLogState* sp = (PixarLogState*) tif->tif_data; - - if (sp) { - if (sp->FromLT2) _TIFFfree(sp->FromLT2); - if (sp->From14) _TIFFfree(sp->From14); - if (sp->From8) _TIFFfree(sp->From8); - if (sp->ToLinearF) _TIFFfree(sp->ToLinearF); - if (sp->ToLinear16) _TIFFfree(sp->ToLinear16); - if (sp->ToLinear8) _TIFFfree(sp->ToLinear8); - if (sp->state&PLSTATE_INIT) { - if (tif->tif_mode == O_RDONLY) - inflateEnd(&sp->stream); - else - deflateEnd(&sp->stream); - } - if (sp->tbuf) - _TIFFfree(sp->tbuf); - _TIFFfree(sp); - tif->tif_data = NULL; - } -} - -static int -PixarLogVSetField(TIFF* tif, ttag_t tag, va_list ap) -{ - PixarLogState *sp = (PixarLogState *)tif->tif_data; - int result; - static const char module[] = "PixarLogVSetField"; - - switch (tag) { - case TIFFTAG_PIXARLOGQUALITY: - sp->quality = va_arg(ap, int); - if (tif->tif_mode != O_RDONLY && (sp->state&PLSTATE_INIT)) { - if (deflateParams(&sp->stream, - sp->quality, Z_DEFAULT_STRATEGY) != Z_OK) { - TIFFError(module, "%s: zlib error: %s", - tif->tif_name, sp->stream.msg); - return (0); - } - } - return (1); - case TIFFTAG_PIXARLOGDATAFMT: - sp->user_datafmt = va_arg(ap, int); - /* Tweak the TIFF header so that the rest of libtiff knows what - * size of data will be passed between app and library, and - * assume that the app knows what it is doing and is not - * confused by these header manipulations... - */ - switch (sp->user_datafmt) { - case PIXARLOGDATAFMT_8BIT: - case PIXARLOGDATAFMT_8BITABGR: - TIFFSetField(tif, TIFFTAG_BITSPERSAMPLE, 8); - TIFFSetField(tif, TIFFTAG_SAMPLEFORMAT, SAMPLEFORMAT_UINT); - break; - case PIXARLOGDATAFMT_11BITLOG: - TIFFSetField(tif, TIFFTAG_BITSPERSAMPLE, 16); - TIFFSetField(tif, TIFFTAG_SAMPLEFORMAT, SAMPLEFORMAT_UINT); - break; - case PIXARLOGDATAFMT_12BITPICIO: - TIFFSetField(tif, TIFFTAG_BITSPERSAMPLE, 16); - TIFFSetField(tif, TIFFTAG_SAMPLEFORMAT, SAMPLEFORMAT_INT); - break; - case PIXARLOGDATAFMT_16BIT: - TIFFSetField(tif, TIFFTAG_BITSPERSAMPLE, 16); - TIFFSetField(tif, TIFFTAG_SAMPLEFORMAT, SAMPLEFORMAT_UINT); - break; - case PIXARLOGDATAFMT_FLOAT: - TIFFSetField(tif, TIFFTAG_BITSPERSAMPLE, 32); - TIFFSetField(tif, TIFFTAG_SAMPLEFORMAT, SAMPLEFORMAT_IEEEFP); - break; - } - /* - * Must recalculate sizes should bits/sample change. - */ - tif->tif_tilesize = TIFFTileSize(tif); - tif->tif_scanlinesize = TIFFScanlineSize(tif); - result = 1; /* NB: pseudo tag */ - break; - default: - result = (*sp->vsetparent)(tif, tag, ap); - } - return (result); -} - -static int -PixarLogVGetField(TIFF* tif, ttag_t tag, va_list ap) -{ - PixarLogState *sp = (PixarLogState *)tif->tif_data; - - switch (tag) { - case TIFFTAG_PIXARLOGQUALITY: - *va_arg(ap, int*) = sp->quality; - break; - case TIFFTAG_PIXARLOGDATAFMT: - *va_arg(ap, int*) = sp->user_datafmt; - break; - default: - return (*sp->vgetparent)(tif, tag, ap); - } - return (1); -} - -static const TIFFFieldInfo pixarlogFieldInfo[] = { - {TIFFTAG_PIXARLOGDATAFMT,0,0,TIFF_ANY, FIELD_PSEUDO,FALSE,FALSE,""}, - {TIFFTAG_PIXARLOGQUALITY,0,0,TIFF_ANY, FIELD_PSEUDO,FALSE,FALSE,""} -}; - -int -TIFFInitPixarLog(TIFF* tif, int scheme) -{ - PixarLogState* sp; - - assert(scheme == COMPRESSION_PIXARLOG); - - /* - * Allocate state block so tag methods have storage to record values. - */ - tif->tif_data = (tidata_t) _TIFFmalloc(sizeof (PixarLogState)); - if (tif->tif_data == NULL) - goto bad; - sp = (PixarLogState*) tif->tif_data; - memset(sp, 0, sizeof (*sp)); - sp->stream.data_type = Z_BINARY; - sp->user_datafmt = PIXARLOGDATAFMT_UNKNOWN; - - /* - * Install codec methods. - */ - tif->tif_setupdecode = PixarLogSetupDecode; - tif->tif_predecode = PixarLogPreDecode; - tif->tif_decoderow = PixarLogDecode; - tif->tif_decodestrip = PixarLogDecode; - tif->tif_decodetile = PixarLogDecode; - tif->tif_setupencode = PixarLogSetupEncode; - tif->tif_preencode = PixarLogPreEncode; - tif->tif_postencode = PixarLogPostEncode; - tif->tif_encoderow = PixarLogEncode; - tif->tif_encodestrip = PixarLogEncode; - tif->tif_encodetile = PixarLogEncode; - tif->tif_close = PixarLogClose; - tif->tif_cleanup = PixarLogCleanup; - - /* Override SetField so we can handle our private pseudo-tag */ - _TIFFMergeFieldInfo(tif, pixarlogFieldInfo, N(pixarlogFieldInfo)); - sp->vgetparent = tif->tif_tagmethods.vgetfield; - tif->tif_tagmethods.vgetfield = PixarLogVGetField; /* hook for codec tags */ - sp->vsetparent = tif->tif_tagmethods.vsetfield; - tif->tif_tagmethods.vsetfield = PixarLogVSetField; /* hook for codec tags */ - - /* Default values for codec-specific fields */ - sp->quality = Z_DEFAULT_COMPRESSION; /* default comp. level */ - sp->state = 0; - - /* we don't wish to use the predictor, - * the default is none, which predictor value 1 - */ - (void) TIFFPredictorInit(tif); - - /* - * build the companding tables - */ - PixarLogMakeTables(sp); - - return (1); -bad: - TIFFError("TIFFInitPixarLog", "No space for PixarLog state block"); - return (0); -} -#endif /* PIXARLOG_SUPPORT */ diff --git a/wxWidgets/src/tiff/tif_predict.c b/wxWidgets/src/tiff/tif_predict.c deleted file mode 100644 index 0da5c8b36b..0000000000 --- a/wxWidgets/src/tiff/tif_predict.c +++ /dev/null @@ -1,464 +0,0 @@ -/* $Header$ */ - -/* - * Copyright (c) 1988-1997 Sam Leffler - * Copyright (c) 1991-1997 Silicon Graphics, Inc. - * - * Permission to use, copy, modify, distribute, and sell this software and - * its documentation for any purpose is hereby granted without fee, provided - * that (i) the above copyright notices and this permission notice appear in - * all copies of the software and related documentation, and (ii) the names of - * Sam Leffler and Silicon Graphics may not be used in any advertising or - * publicity relating to the software without the specific, prior written - * permission of Sam Leffler and Silicon Graphics. - * - * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, - * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * - * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR - * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, - * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF - * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE - * OF THIS SOFTWARE. - */ - -/* - * TIFF Library. - * - * Predictor Tag Support (used by multiple codecs). - */ -#include "tiffiop.h" -#include "tif_predict.h" - -#include - -#define PredictorState(tif) ((TIFFPredictorState*) (tif)->tif_data) - -static void horAcc8(TIFF*, tidata_t, tsize_t); -static void horAcc16(TIFF*, tidata_t, tsize_t); -static void swabHorAcc16(TIFF*, tidata_t, tsize_t); -static void horDiff8(TIFF*, tidata_t, tsize_t); -static void horDiff16(TIFF*, tidata_t, tsize_t); -static int PredictorDecodeRow(TIFF*, tidata_t, tsize_t, tsample_t); -static int PredictorDecodeTile(TIFF*, tidata_t, tsize_t, tsample_t); -static int PredictorEncodeRow(TIFF*, tidata_t, tsize_t, tsample_t); -static int PredictorEncodeTile(TIFF*, tidata_t, tsize_t, tsample_t); - -static int -PredictorSetup(TIFF* tif) -{ - TIFFPredictorState* sp = PredictorState(tif); - TIFFDirectory* td = &tif->tif_dir; - - if (sp->predictor == 1) /* no differencing */ - return (1); - if (sp->predictor != 2) { - TIFFError(tif->tif_name, "\"Predictor\" value %d not supported", - sp->predictor); - return (0); - } - if (td->td_bitspersample != 8 && td->td_bitspersample != 16) { - TIFFError(tif->tif_name, - "Horizontal differencing \"Predictor\" not supported with %d-bit samples", - td->td_bitspersample); - return (0); - } - sp->stride = (td->td_planarconfig == PLANARCONFIG_CONTIG ? - td->td_samplesperpixel : 1); - /* - * Calculate the scanline/tile-width size in bytes. - */ - if (isTiled(tif)) - sp->rowsize = TIFFTileRowSize(tif); - else - sp->rowsize = TIFFScanlineSize(tif); - return (1); -} - -static int -PredictorSetupDecode(TIFF* tif) -{ - TIFFPredictorState* sp = PredictorState(tif); - TIFFDirectory* td = &tif->tif_dir; - - if (!(*sp->setupdecode)(tif) || !PredictorSetup(tif)) - return (0); - if (sp->predictor == 2) { - switch (td->td_bitspersample) { - case 8: sp->pfunc = horAcc8; break; - case 16: sp->pfunc = horAcc16; break; - } - /* - * Override default decoding method with - * one that does the predictor stuff. - */ - sp->coderow = tif->tif_decoderow; - tif->tif_decoderow = PredictorDecodeRow; - sp->codestrip = tif->tif_decodestrip; - tif->tif_decodestrip = PredictorDecodeTile; - sp->codetile = tif->tif_decodetile; - tif->tif_decodetile = PredictorDecodeTile; - /* - * If the data is horizontally differenced - * 16-bit data that requires byte-swapping, - * then it must be byte swapped before the - * accumulation step. We do this with a - * special-purpose routine and override the - * normal post decoding logic that the library - * setup when the directory was read. - */ - if (tif->tif_flags&TIFF_SWAB) { - if (sp->pfunc == horAcc16) { - sp->pfunc = swabHorAcc16; - tif->tif_postdecode = _TIFFNoPostDecode; - } /* else handle 32-bit case... */ - } - } - return (1); -} - -static int -PredictorSetupEncode(TIFF* tif) -{ - TIFFPredictorState* sp = PredictorState(tif); - TIFFDirectory* td = &tif->tif_dir; - - if (!(*sp->setupencode)(tif) || !PredictorSetup(tif)) - return (0); - if (sp->predictor == 2) { - switch (td->td_bitspersample) { - case 8: sp->pfunc = horDiff8; break; - case 16: sp->pfunc = horDiff16; break; - } - /* - * Override default encoding method with - * one that does the predictor stuff. - */ - sp->coderow = tif->tif_encoderow; - tif->tif_encoderow = PredictorEncodeRow; - sp->codestrip = tif->tif_encodestrip; - tif->tif_encodestrip = PredictorEncodeTile; - sp->codetile = tif->tif_encodetile; - tif->tif_encodetile = PredictorEncodeTile; - } - return (1); -} - -#define REPEAT4(n, op) \ - switch (n) { \ - default: { int i; for (i = n-4; i > 0; i--) { op; } } \ - case 4: op; \ - case 3: op; \ - case 2: op; \ - case 1: op; \ - case 0: ; \ - } - -static void -horAcc8(TIFF* tif, tidata_t cp0, tsize_t cc) -{ - TIFFPredictorState* sp = PredictorState(tif); - tsize_t stride = sp->stride; - - char* cp = (char*) cp0; - if (cc > stride) { - cc -= stride; - /* - * Pipeline the most common cases. - */ - if (stride == 3) { - u_int cr = cp[0]; - u_int cg = cp[1]; - u_int cb = cp[2]; - do { - cc -= 3, cp += 3; - cp[0] = (char) (cr += cp[0]); - cp[1] = (char) (cg += cp[1]); - cp[2] = (char) (cb += cp[2]); - } while ((int32) cc > 0); - } else if (stride == 4) { - u_int cr = cp[0]; - u_int cg = cp[1]; - u_int cb = cp[2]; - u_int ca = cp[3]; - do { - cc -= 4, cp += 4; - cp[0] = (char) (cr += cp[0]); - cp[1] = (char) (cg += cp[1]); - cp[2] = (char) (cb += cp[2]); - cp[3] = (char) (ca += cp[3]); - } while ((int32) cc > 0); - } else { - do { - REPEAT4(stride, cp[stride] = (char) (cp[stride] + *cp); cp++) - cc -= stride; - } while ((int32) cc > 0); - } - } -} - -static void -swabHorAcc16(TIFF* tif, tidata_t cp0, tsize_t cc) -{ - TIFFPredictorState* sp = PredictorState(tif); - tsize_t stride = sp->stride; - uint16* wp = (uint16*) cp0; - tsize_t wc = cc / 2; - - if (wc > stride) { - TIFFSwabArrayOfShort(wp, wc); - wc -= stride; - do { - REPEAT4(stride, wp[stride] += wp[0]; wp++) - wc -= stride; - } while ((int32) wc > 0); - } -} - -static void -horAcc16(TIFF* tif, tidata_t cp0, tsize_t cc) -{ - tsize_t stride = PredictorState(tif)->stride; - uint16* wp = (uint16*) cp0; - tsize_t wc = cc / 2; - - if (wc > stride) { - wc -= stride; - do { - REPEAT4(stride, wp[stride] += wp[0]; wp++) - wc -= stride; - } while ((int32) wc > 0); - } -} - -/* - * Decode a scanline and apply the predictor routine. - */ -static int -PredictorDecodeRow(TIFF* tif, tidata_t op0, tsize_t occ0, tsample_t s) -{ - TIFFPredictorState *sp = PredictorState(tif); - - assert(sp != NULL); - assert(sp->coderow != NULL); - assert(sp->pfunc != NULL); - if ((*sp->coderow)(tif, op0, occ0, s)) { - (*sp->pfunc)(tif, op0, occ0); - return (1); - } else - return (0); -} - -/* - * Decode a tile/strip and apply the predictor routine. - * Note that horizontal differencing must be done on a - * row-by-row basis. The width of a "row" has already - * been calculated at pre-decode time according to the - * strip/tile dimensions. - */ -static int -PredictorDecodeTile(TIFF* tif, tidata_t op0, tsize_t occ0, tsample_t s) -{ - TIFFPredictorState *sp = PredictorState(tif); - - assert(sp != NULL); - assert(sp->codetile != NULL); - if ((*sp->codetile)(tif, op0, occ0, s)) { - tsize_t rowsize = sp->rowsize; - assert(rowsize > 0); - assert(sp->pfunc != NULL); - while ((long)occ0 > 0) { - (*sp->pfunc)(tif, op0, (tsize_t) rowsize); - occ0 -= rowsize; - op0 += rowsize; - } - return (1); - } else - return (0); -} - -static void -horDiff8(TIFF* tif, tidata_t cp0, tsize_t cc) -{ - TIFFPredictorState* sp = PredictorState(tif); - tsize_t stride = sp->stride; - char* cp = (char*) cp0; - - if (cc > stride) { - cc -= stride; - /* - * Pipeline the most common cases. - */ - if (stride == 3) { - int r1, g1, b1; - int r2 = cp[0]; - int g2 = cp[1]; - int b2 = cp[2]; - do { - r1 = cp[3]; cp[3] = r1-r2; r2 = r1; - g1 = cp[4]; cp[4] = g1-g2; g2 = g1; - b1 = cp[5]; cp[5] = b1-b2; b2 = b1; - cp += 3; - } while ((int32)(cc -= 3) > 0); - } else if (stride == 4) { - int r1, g1, b1, a1; - int r2 = cp[0]; - int g2 = cp[1]; - int b2 = cp[2]; - int a2 = cp[3]; - do { - r1 = cp[4]; cp[4] = r1-r2; r2 = r1; - g1 = cp[5]; cp[5] = g1-g2; g2 = g1; - b1 = cp[6]; cp[6] = b1-b2; b2 = b1; - a1 = cp[7]; cp[7] = a1-a2; a2 = a1; - cp += 4; - } while ((int32)(cc -= 4) > 0); - } else { - cp += cc - 1; - do { - REPEAT4(stride, cp[stride] -= cp[0]; cp--) - } while ((int32)(cc -= stride) > 0); - } - } -} - -static void -horDiff16(TIFF* tif, tidata_t cp0, tsize_t cc) -{ - TIFFPredictorState* sp = PredictorState(tif); - tsize_t stride = sp->stride; - int16 *wp = (int16*) cp0; - tsize_t wc = cc/2; - - if (wc > stride) { - wc -= stride; - wp += wc - 1; - do { - REPEAT4(stride, wp[stride] -= wp[0]; wp--) - wc -= stride; - } while ((int32) wc > 0); - } -} - -static int -PredictorEncodeRow(TIFF* tif, tidata_t bp, tsize_t cc, tsample_t s) -{ - TIFFPredictorState *sp = PredictorState(tif); - - assert(sp != NULL); - assert(sp->pfunc != NULL); - assert(sp->coderow != NULL); -/* XXX horizontal differencing alters user's data XXX */ - (*sp->pfunc)(tif, bp, cc); - return ((*sp->coderow)(tif, bp, cc, s)); -} - -static int -PredictorEncodeTile(TIFF* tif, tidata_t bp0, tsize_t cc0, tsample_t s) -{ - TIFFPredictorState *sp = PredictorState(tif); - tsize_t cc = cc0, rowsize; - u_char* bp = bp0; - - assert(sp != NULL); - assert(sp->pfunc != NULL); - assert(sp->codetile != NULL); - rowsize = sp->rowsize; - assert(rowsize > 0); - while ((long)cc > 0) { - (*sp->pfunc)(tif, bp, (tsize_t) rowsize); - cc -= rowsize; - bp += rowsize; - } - return ((*sp->codetile)(tif, bp0, cc0, s)); -} - -#define FIELD_PREDICTOR (FIELD_CODEC+0) /* XXX */ - -static const TIFFFieldInfo predictFieldInfo[] = { - { TIFFTAG_PREDICTOR, 1, 1, TIFF_SHORT, FIELD_PREDICTOR, - FALSE, FALSE, "Predictor" }, -}; -#define N(a) (sizeof (a) / sizeof (a[0])) - -static int -PredictorVSetField(TIFF* tif, ttag_t tag, va_list ap) -{ - TIFFPredictorState *sp = PredictorState(tif); - - switch (tag) { - case TIFFTAG_PREDICTOR: - sp->predictor = (uint16) va_arg(ap, int); - TIFFSetFieldBit(tif, FIELD_PREDICTOR); - break; - default: - return (*sp->vsetparent)(tif, tag, ap); - } - tif->tif_flags |= TIFF_DIRTYDIRECT; - return (1); -} - -static int -PredictorVGetField(TIFF* tif, ttag_t tag, va_list ap) -{ - TIFFPredictorState *sp = PredictorState(tif); - - switch (tag) { - case TIFFTAG_PREDICTOR: - *va_arg(ap, uint16*) = sp->predictor; - break; - default: - return (*sp->vgetparent)(tif, tag, ap); - } - return (1); -} - -static void -PredictorPrintDir(TIFF* tif, FILE* fd, long flags) -{ - TIFFPredictorState* sp = PredictorState(tif); - - (void) flags; - if (TIFFFieldSet(tif,FIELD_PREDICTOR)) { - fprintf(fd, " Predictor: "); - switch (sp->predictor) { - case 1: fprintf(fd, "none "); break; - case 2: fprintf(fd, "horizontal differencing "); break; - } - fprintf(fd, "%u (0x%x)\n", sp->predictor, sp->predictor); - } - if (sp->printdir) - (*sp->printdir)(tif, fd, flags); -} - -int -TIFFPredictorInit(TIFF* tif) -{ - TIFFPredictorState* sp = PredictorState(tif); - - /* - * Merge codec-specific tag information and - * override parent get/set field methods. - */ - _TIFFMergeFieldInfo(tif, predictFieldInfo, N(predictFieldInfo)); - sp->vgetparent = tif->tif_tagmethods.vgetfield; - tif->tif_tagmethods.vgetfield = - PredictorVGetField;/* hook for predictor tag */ - sp->vsetparent = tif->tif_tagmethods.vsetfield; - tif->tif_tagmethods.vsetfield = - PredictorVSetField;/* hook for predictor tag */ - sp->printdir = tif->tif_tagmethods.printdir; - tif->tif_tagmethods.printdir = - PredictorPrintDir; /* hook for predictor tag */ - - sp->setupdecode = tif->tif_setupdecode; - tif->tif_setupdecode = PredictorSetupDecode; - sp->setupencode = tif->tif_setupencode; - tif->tif_setupencode = PredictorSetupEncode; - - sp->predictor = 1; /* default value */ - sp->pfunc = NULL; /* no predictor routine */ - return (1); -} diff --git a/wxWidgets/src/tiff/tif_predict.h b/wxWidgets/src/tiff/tif_predict.h deleted file mode 100644 index d26d416084..0000000000 --- a/wxWidgets/src/tiff/tif_predict.h +++ /dev/null @@ -1,61 +0,0 @@ -/* $Header$ */ - -/* - * Copyright (c) 1995-1997 Sam Leffler - * Copyright (c) 1995-1997 Silicon Graphics, Inc. - * - * Permission to use, copy, modify, distribute, and sell this software and - * its documentation for any purpose is hereby granted without fee, provided - * that (i) the above copyright notices and this permission notice appear in - * all copies of the software and related documentation, and (ii) the names of - * Sam Leffler and Silicon Graphics may not be used in any advertising or - * publicity relating to the software without the specific, prior written - * permission of Sam Leffler and Silicon Graphics. - * - * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, - * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * - * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR - * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, - * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF - * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE - * OF THIS SOFTWARE. - */ - -#ifndef _TIFFPREDICT_ -#define _TIFFPREDICT_ -/* - * ``Library-private'' Support for the Predictor Tag - */ - -/* - * Codecs that want to support the Predictor tag must place - * this structure first in their private state block so that - * the predictor code can cast tif_data to find its state. - */ -typedef struct { - int predictor; /* predictor tag value */ - int stride; /* sample stride over data */ - tsize_t rowsize; /* tile/strip row size */ - - TIFFPostMethod pfunc; /* horizontal differencer/accumulator */ - TIFFCodeMethod coderow; /* parent codec encode/decode row */ - TIFFCodeMethod codestrip; /* parent codec encode/decode strip */ - TIFFCodeMethod codetile; /* parent codec encode/decode tile */ - TIFFVGetMethod vgetparent; /* super-class method */ - TIFFVSetMethod vsetparent; /* super-class method */ - TIFFPrintMethod printdir; /* super-class method */ - TIFFBoolMethod setupdecode; /* super-class method */ - TIFFBoolMethod setupencode; /* super-class method */ -} TIFFPredictorState; - -#if defined(__cplusplus) -extern "C" { -#endif -extern int TIFFPredictorInit(TIFF*); -#if defined(__cplusplus) -} -#endif -#endif /* _TIFFPREDICT_ */ diff --git a/wxWidgets/src/tiff/tif_print.c b/wxWidgets/src/tiff/tif_print.c deleted file mode 100644 index 8fd7165001..0000000000 --- a/wxWidgets/src/tiff/tif_print.c +++ /dev/null @@ -1,613 +0,0 @@ -/* $Header$ */ - -/* - * Copyright (c) 1988-1997 Sam Leffler - * Copyright (c) 1991-1997 Silicon Graphics, Inc. - * - * Permission to use, copy, modify, distribute, and sell this software and - * its documentation for any purpose is hereby granted without fee, provided - * that (i) the above copyright notices and this permission notice appear in - * all copies of the software and related documentation, and (ii) the names of - * Sam Leffler and Silicon Graphics may not be used in any advertising or - * publicity relating to the software without the specific, prior written - * permission of Sam Leffler and Silicon Graphics. - * - * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, - * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * - * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR - * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, - * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF - * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE - * OF THIS SOFTWARE. - */ - -/* - * TIFF Library. - * - * Directory Printing Support - */ -#include "tiffiop.h" -#include - -#include - -static const char *photoNames[] = { - "min-is-white", /* PHOTOMETRIC_MINISWHITE */ - "min-is-black", /* PHOTOMETRIC_MINISBLACK */ - "RGB color", /* PHOTOMETRIC_RGB */ - "palette color (RGB from colormap)", /* PHOTOMETRIC_PALETTE */ - "transparency mask", /* PHOTOMETRIC_MASK */ - "separated", /* PHOTOMETRIC_SEPARATED */ - "YCbCr", /* PHOTOMETRIC_YCBCR */ - "7 (0x7)", - "CIE L*a*b*", /* PHOTOMETRIC_CIELAB */ -}; -#define NPHOTONAMES (sizeof (photoNames) / sizeof (photoNames[0])) - -static const char *orientNames[] = { - "0 (0x0)", - "row 0 top, col 0 lhs", /* ORIENTATION_TOPLEFT */ - "row 0 top, col 0 rhs", /* ORIENTATION_TOPRIGHT */ - "row 0 bottom, col 0 rhs", /* ORIENTATION_BOTRIGHT */ - "row 0 bottom, col 0 lhs", /* ORIENTATION_BOTLEFT */ - "row 0 lhs, col 0 top", /* ORIENTATION_LEFTTOP */ - "row 0 rhs, col 0 top", /* ORIENTATION_RIGHTTOP */ - "row 0 rhs, col 0 bottom", /* ORIENTATION_RIGHTBOT */ - "row 0 lhs, col 0 bottom", /* ORIENTATION_LEFTBOT */ -}; -#define NORIENTNAMES (sizeof (orientNames) / sizeof (orientNames[0])) - -/* - * Print the contents of the current directory - * to the specified stdio file stream. - */ -void -TIFFPrintDirectory(TIFF* tif, FILE* fd, long flags) -{ - register TIFFDirectory *td; - char *sep; - uint16 i; - long l, n; - - fprintf(fd, "TIFF Directory at offset 0x%lx\n", tif->tif_diroff); - td = &tif->tif_dir; - if (TIFFFieldSet(tif,FIELD_SUBFILETYPE)) { - fprintf(fd, " Subfile Type:"); - sep = " "; - if (td->td_subfiletype & FILETYPE_REDUCEDIMAGE) { - fprintf(fd, "%sreduced-resolution image", sep); - sep = "/"; - } - if (td->td_subfiletype & FILETYPE_PAGE) { - fprintf(fd, "%smulti-page document", sep); - sep = "/"; - } - if (td->td_subfiletype & FILETYPE_MASK) - fprintf(fd, "%stransparency mask", sep); - fprintf(fd, " (%lu = 0x%lx)\n", - (long) td->td_subfiletype, (long) td->td_subfiletype); - } - if (TIFFFieldSet(tif,FIELD_IMAGEDIMENSIONS)) { - fprintf(fd, " Image Width: %lu Image Length: %lu", - (u_long) td->td_imagewidth, (u_long) td->td_imagelength); - if (TIFFFieldSet(tif,FIELD_IMAGEDEPTH)) - fprintf(fd, " Image Depth: %lu", - (u_long) td->td_imagedepth); - fprintf(fd, "\n"); - } - - /* Begin Pixar */ - if (TIFFFieldSet(tif,FIELD_IMAGEFULLWIDTH) || - TIFFFieldSet(tif,FIELD_IMAGEFULLLENGTH)) { - fprintf(fd, " Pixar Full Image Width: %lu Full Image Length: %lu\n", - (u_long) td->td_imagefullwidth, - (u_long) td->td_imagefulllength); - } - if (TIFFFieldSet(tif,FIELD_TEXTUREFORMAT)) - _TIFFprintAsciiTag(fd, "Texture Format", td->td_textureformat); - if (TIFFFieldSet(tif,FIELD_WRAPMODES)) - _TIFFprintAsciiTag(fd, "Texture Wrap Modes", td->td_wrapmodes); - if (TIFFFieldSet(tif,FIELD_FOVCOT)) - fprintf(fd, " Field of View Cotangent: %g\n", td->td_fovcot); - if (TIFFFieldSet(tif,FIELD_MATRIX_WORLDTOSCREEN)) { - typedef float Matrix[4][4]; - Matrix* m = (Matrix*)td->td_matrixWorldToScreen; - - fprintf(fd, " Matrix NP:\n\t%g %g %g %g\n\t%g %g %g %g\n\t%g %g %g %g\n\t%g %g %g %g\n", - (*m)[0][0], (*m)[0][1], (*m)[0][2], (*m)[0][3], - (*m)[1][0], (*m)[1][1], (*m)[1][2], (*m)[1][3], - (*m)[2][0], (*m)[2][1], (*m)[2][2], (*m)[2][3], - (*m)[3][0], (*m)[3][1], (*m)[3][2], (*m)[3][3]); - } - if (TIFFFieldSet(tif,FIELD_MATRIX_WORLDTOCAMERA)) { - typedef float Matrix[4][4]; - Matrix* m = (Matrix*)td->td_matrixWorldToCamera; - - fprintf(fd, " Matrix Nl:\n\t%g %g %g %g\n\t%g %g %g %g\n\t%g %g %g %g\n\t%g %g %g %g\n", - (*m)[0][0], (*m)[0][1], (*m)[0][2], (*m)[0][3], - (*m)[1][0], (*m)[1][1], (*m)[1][2], (*m)[1][3], - (*m)[2][0], (*m)[2][1], (*m)[2][2], (*m)[2][3], - (*m)[3][0], (*m)[3][1], (*m)[3][2], (*m)[3][3]); - } - /* End Pixar */ - - if (TIFFFieldSet(tif,FIELD_TILEDIMENSIONS)) { - fprintf(fd, " Tile Width: %lu Tile Length: %lu", - (u_long) td->td_tilewidth, (u_long) td->td_tilelength); - if (TIFFFieldSet(tif,FIELD_TILEDEPTH)) - fprintf(fd, " Tile Depth: %lu", - (u_long) td->td_tiledepth); - fprintf(fd, "\n"); - } - if (TIFFFieldSet(tif,FIELD_RESOLUTION)) { - fprintf(fd, " Resolution: %g, %g", - td->td_xresolution, td->td_yresolution); - if (TIFFFieldSet(tif,FIELD_RESOLUTIONUNIT)) { - switch (td->td_resolutionunit) { - case RESUNIT_NONE: - fprintf(fd, " (unitless)"); - break; - case RESUNIT_INCH: - fprintf(fd, " pixels/inch"); - break; - case RESUNIT_CENTIMETER: - fprintf(fd, " pixels/cm"); - break; - default: - fprintf(fd, " (unit %u = 0x%x)", - td->td_resolutionunit, - td->td_resolutionunit); - break; - } - } - fprintf(fd, "\n"); - } - if (TIFFFieldSet(tif,FIELD_POSITION)) - fprintf(fd, " Position: %g, %g\n", - td->td_xposition, td->td_yposition); - if (TIFFFieldSet(tif,FIELD_BITSPERSAMPLE)) - fprintf(fd, " Bits/Sample: %u\n", td->td_bitspersample); - if (TIFFFieldSet(tif,FIELD_SAMPLEFORMAT)) { - fprintf(fd, " Sample Format: "); - switch (td->td_sampleformat) { - case SAMPLEFORMAT_VOID: - fprintf(fd, "void\n"); - break; - case SAMPLEFORMAT_INT: - fprintf(fd, "signed integer\n"); - break; - case SAMPLEFORMAT_UINT: - fprintf(fd, "unsigned integer\n"); - break; - case SAMPLEFORMAT_IEEEFP: - fprintf(fd, "IEEE floating point\n"); - break; - case SAMPLEFORMAT_COMPLEXINT: - fprintf(fd, "complex signed integer\n"); - break; - case SAMPLEFORMAT_COMPLEXIEEEFP: - fprintf(fd, "complex IEEE floating point\n"); - break; - default: - fprintf(fd, "%u (0x%x)\n", - td->td_sampleformat, td->td_sampleformat); - break; - } - } - if (TIFFFieldSet(tif,FIELD_COMPRESSION)) { - const TIFFCodec* c = TIFFFindCODEC(td->td_compression); - fprintf(fd, " Compression Scheme: "); - if (c) - fprintf(fd, "%s\n", c->name); - else - fprintf(fd, "%u (0x%x)\n", - td->td_compression, td->td_compression); - } - if (TIFFFieldSet(tif,FIELD_PHOTOMETRIC)) { - fprintf(fd, " Photometric Interpretation: "); - if (td->td_photometric < NPHOTONAMES) - fprintf(fd, "%s\n", photoNames[td->td_photometric]); - else { - switch (td->td_photometric) { - case PHOTOMETRIC_LOGL: - fprintf(fd, "CIE Log2(L)\n"); - break; - case PHOTOMETRIC_LOGLUV: - fprintf(fd, "CIE Log2(L) (u',v')\n"); - break; - default: - fprintf(fd, "%u (0x%x)\n", - td->td_photometric, td->td_photometric); - break; - } - } - } - if (TIFFFieldSet(tif,FIELD_EXTRASAMPLES) && td->td_extrasamples) { - fprintf(fd, " Extra Samples: %u<", td->td_extrasamples); - sep = ""; - for (i = 0; i < td->td_extrasamples; i++) { - switch (td->td_sampleinfo[i]) { - case EXTRASAMPLE_UNSPECIFIED: - fprintf(fd, "%sunspecified", sep); - break; - case EXTRASAMPLE_ASSOCALPHA: - fprintf(fd, "%sassoc-alpha", sep); - break; - case EXTRASAMPLE_UNASSALPHA: - fprintf(fd, "%sunassoc-alpha", sep); - break; - default: - fprintf(fd, "%s%u (0x%x)", sep, - td->td_sampleinfo[i], td->td_sampleinfo[i]); - break; - } - sep = ", "; - } - fprintf(fd, ">\n"); - } - if (TIFFFieldSet(tif,FIELD_STONITS)) { - fprintf(fd, " Sample to Nits conversion factor: %.4e\n", - td->td_stonits); - } -#ifdef CMYK_SUPPORT - if (TIFFFieldSet(tif,FIELD_INKSET)) { - fprintf(fd, " Ink Set: "); - switch (td->td_inkset) { - case INKSET_CMYK: - fprintf(fd, "CMYK\n"); - break; - default: - fprintf(fd, "%u (0x%x)\n", - td->td_inkset, td->td_inkset); - break; - } - } - if (TIFFFieldSet(tif,FIELD_INKNAMES)) { - char* cp; - fprintf(fd, " Ink Names: "); - i = td->td_samplesperpixel; - sep = ""; - for (cp = td->td_inknames; i > 0; cp = strchr(cp,'\0')+1, i--) { - fprintf(fd, "%s", sep); - _TIFFprintAscii(fd, cp); - sep = ", "; - } - } - if (TIFFFieldSet(tif,FIELD_NUMBEROFINKS)) - fprintf(fd, " Number of Inks: %u\n", td->td_ninks); - if (TIFFFieldSet(tif,FIELD_DOTRANGE)) - fprintf(fd, " Dot Range: %u-%u\n", - td->td_dotrange[0], td->td_dotrange[1]); - if (TIFFFieldSet(tif,FIELD_TARGETPRINTER)) - _TIFFprintAsciiTag(fd, "Target Printer", td->td_targetprinter); -#endif - if (TIFFFieldSet(tif,FIELD_THRESHHOLDING)) { - fprintf(fd, " Thresholding: "); - switch (td->td_threshholding) { - case THRESHHOLD_BILEVEL: - fprintf(fd, "bilevel art scan\n"); - break; - case THRESHHOLD_HALFTONE: - fprintf(fd, "halftone or dithered scan\n"); - break; - case THRESHHOLD_ERRORDIFFUSE: - fprintf(fd, "error diffused\n"); - break; - default: - fprintf(fd, "%u (0x%x)\n", - td->td_threshholding, td->td_threshholding); - break; - } - } - if (TIFFFieldSet(tif,FIELD_FILLORDER)) { - fprintf(fd, " FillOrder: "); - switch (td->td_fillorder) { - case FILLORDER_MSB2LSB: - fprintf(fd, "msb-to-lsb\n"); - break; - case FILLORDER_LSB2MSB: - fprintf(fd, "lsb-to-msb\n"); - break; - default: - fprintf(fd, "%u (0x%x)\n", - td->td_fillorder, td->td_fillorder); - break; - } - } -#ifdef YCBCR_SUPPORT - if (TIFFFieldSet(tif,FIELD_YCBCRSUBSAMPLING)) - { - /* - * For hacky reasons (see tif_jpeg.c - JPEGFixupTestSubsampling), - * we need to fetch this rather than trust what is in our - * structures. - */ - uint16 subsampling[2]; - - TIFFGetField( tif, TIFFTAG_YCBCRSUBSAMPLING, - subsampling + 0, subsampling + 1 ); - fprintf(fd, " YCbCr Subsampling: %u, %u\n", - subsampling[0], subsampling[1] ); - } - if (TIFFFieldSet(tif,FIELD_YCBCRPOSITIONING)) { - fprintf(fd, " YCbCr Positioning: "); - switch (td->td_ycbcrpositioning) { - case YCBCRPOSITION_CENTERED: - fprintf(fd, "centered\n"); - break; - case YCBCRPOSITION_COSITED: - fprintf(fd, "cosited\n"); - break; - default: - fprintf(fd, "%u (0x%x)\n", - td->td_ycbcrpositioning, td->td_ycbcrpositioning); - break; - } - } - if (TIFFFieldSet(tif,FIELD_YCBCRCOEFFICIENTS)) - fprintf(fd, " YCbCr Coefficients: %g, %g, %g\n", - td->td_ycbcrcoeffs[0], - td->td_ycbcrcoeffs[1], - td->td_ycbcrcoeffs[2]); -#endif - if (TIFFFieldSet(tif,FIELD_HALFTONEHINTS)) - fprintf(fd, " Halftone Hints: light %u dark %u\n", - td->td_halftonehints[0], td->td_halftonehints[1]); - if (TIFFFieldSet(tif,FIELD_ARTIST)) - _TIFFprintAsciiTag(fd, "Artist", td->td_artist); - if (TIFFFieldSet(tif,FIELD_DATETIME)) - _TIFFprintAsciiTag(fd, "Date & Time", td->td_datetime); - if (TIFFFieldSet(tif,FIELD_HOSTCOMPUTER)) - _TIFFprintAsciiTag(fd, "Host Computer", td->td_hostcomputer); - if (TIFFFieldSet(tif,FIELD_COPYRIGHT)) - _TIFFprintAsciiTag(fd, "Copyright", td->td_copyright); - if (TIFFFieldSet(tif,FIELD_DOCUMENTNAME)) - _TIFFprintAsciiTag(fd, "Document Name", td->td_documentname); - if (TIFFFieldSet(tif,FIELD_IMAGEDESCRIPTION)) - _TIFFprintAsciiTag(fd, "Image Description", td->td_imagedescription); - if (TIFFFieldSet(tif,FIELD_MAKE)) - _TIFFprintAsciiTag(fd, "Make", td->td_make); - if (TIFFFieldSet(tif,FIELD_MODEL)) - _TIFFprintAsciiTag(fd, "Model", td->td_model); - if (TIFFFieldSet(tif,FIELD_ORIENTATION)) { - fprintf(fd, " Orientation: "); - if (td->td_orientation < NORIENTNAMES) - fprintf(fd, "%s\n", orientNames[td->td_orientation]); - else - fprintf(fd, "%u (0x%x)\n", - td->td_orientation, td->td_orientation); - } - if (TIFFFieldSet(tif,FIELD_SAMPLESPERPIXEL)) - fprintf(fd, " Samples/Pixel: %u\n", td->td_samplesperpixel); - if (TIFFFieldSet(tif,FIELD_ROWSPERSTRIP)) { - fprintf(fd, " Rows/Strip: "); - if (td->td_rowsperstrip == (uint32) -1) - fprintf(fd, "(infinite)\n"); - else - fprintf(fd, "%lu\n", (u_long) td->td_rowsperstrip); - } - if (TIFFFieldSet(tif,FIELD_MINSAMPLEVALUE)) - fprintf(fd, " Min Sample Value: %u\n", td->td_minsamplevalue); - if (TIFFFieldSet(tif,FIELD_MAXSAMPLEVALUE)) - fprintf(fd, " Max Sample Value: %u\n", td->td_maxsamplevalue); - if (TIFFFieldSet(tif,FIELD_SMINSAMPLEVALUE)) - fprintf(fd, " SMin Sample Value: %g\n", - td->td_sminsamplevalue); - if (TIFFFieldSet(tif,FIELD_SMAXSAMPLEVALUE)) - fprintf(fd, " SMax Sample Value: %g\n", - td->td_smaxsamplevalue); - if (TIFFFieldSet(tif,FIELD_PLANARCONFIG)) { - fprintf(fd, " Planar Configuration: "); - switch (td->td_planarconfig) { - case PLANARCONFIG_CONTIG: - fprintf(fd, "single image plane\n"); - break; - case PLANARCONFIG_SEPARATE: - fprintf(fd, "separate image planes\n"); - break; - default: - fprintf(fd, "%u (0x%x)\n", - td->td_planarconfig, td->td_planarconfig); - break; - } - } - if (TIFFFieldSet(tif,FIELD_PAGENAME)) - _TIFFprintAsciiTag(fd, "Page Name", td->td_pagename); - if (TIFFFieldSet(tif,FIELD_PAGENUMBER)) - fprintf(fd, " Page Number: %u-%u\n", - td->td_pagenumber[0], td->td_pagenumber[1]); - if (TIFFFieldSet(tif,FIELD_COLORMAP)) { - fprintf(fd, " Color Map: "); - if (flags & TIFFPRINT_COLORMAP) { - fprintf(fd, "\n"); - n = 1L<td_bitspersample; - for (l = 0; l < n; l++) - fprintf(fd, " %5lu: %5u %5u %5u\n", - l, - td->td_colormap[0][l], - td->td_colormap[1][l], - td->td_colormap[2][l]); - } else - fprintf(fd, "(present)\n"); - } -#ifdef COLORIMETRY_SUPPORT - if (TIFFFieldSet(tif,FIELD_WHITEPOINT)) - fprintf(fd, " White Point: %g-%g\n", - td->td_whitepoint[0], td->td_whitepoint[1]); - if (TIFFFieldSet(tif,FIELD_PRIMARYCHROMAS)) - fprintf(fd, " Primary Chromaticities: %g,%g %g,%g %g,%g\n", - td->td_primarychromas[0], td->td_primarychromas[1], - td->td_primarychromas[2], td->td_primarychromas[3], - td->td_primarychromas[4], td->td_primarychromas[5]); - if (TIFFFieldSet(tif,FIELD_REFBLACKWHITE)) { - fprintf(fd, " Reference Black/White:\n"); - for (i = 0; i < td->td_samplesperpixel; i++) - fprintf(fd, " %2d: %5g %5g\n", - i, - td->td_refblackwhite[2*i+0], - td->td_refblackwhite[2*i+1]); - } - if (TIFFFieldSet(tif,FIELD_TRANSFERFUNCTION)) { - fprintf(fd, " Transfer Function: "); - if (flags & TIFFPRINT_CURVES) { - fprintf(fd, "\n"); - n = 1L<td_bitspersample; - for (l = 0; l < n; l++) { - fprintf(fd, " %2lu: %5u", - l, td->td_transferfunction[0][l]); - for (i = 1; i < td->td_samplesperpixel; i++) - fprintf(fd, " %5u", - td->td_transferfunction[i][l]); - fputc('\n', fd); - } - } else - fprintf(fd, "(present)\n"); - } -#endif -#ifdef ICC_SUPPORT - if (TIFFFieldSet(tif,FIELD_ICCPROFILE)) - fprintf(fd, " ICC Profile: , %lu bytes\n", - (u_long) td->td_profileLength); -#endif -#ifdef PHOTOSHOP_SUPPORT - if (TIFFFieldSet(tif,FIELD_PHOTOSHOP)) - fprintf(fd, " Photoshop Data: , %lu bytes\n", - (u_long) td->td_photoshopLength); -#endif -#ifdef IPTC_SUPPORT - if (TIFFFieldSet(tif,FIELD_RICHTIFFIPTC)) - fprintf(fd, " RichTIFFIPTC Data: , %lu bytes\n", - (u_long) td->td_richtiffiptcLength); -#endif -#if SUBIFD_SUPPORT - if (TIFFFieldSet(tif, FIELD_SUBIFD)) { - fprintf(fd, " SubIFD Offsets:"); - for (i = 0; i < td->td_nsubifd; i++) - fprintf(fd, " %5lu", (long) td->td_subifd[i]); - fputc('\n', fd); - } -#endif - /* - ** Custom tag support. - */ - { - int i; - short count; - - count = (short) TIFFGetTagListCount( tif ); - for( i = 0; i < count; i++ ) - { - ttag_t tag = TIFFGetTagListEntry( tif, i ); - const TIFFFieldInfo *fld; - - fld = TIFFFieldWithTag( tif, tag ); - if( fld == NULL ) - continue; - - if( fld->field_passcount ) - { - short value_count; - int j; - void *raw_data; - - if( TIFFGetField( tif, tag, &value_count, &raw_data ) != 1 ) - continue; - - fprintf(fd, " %s: ", fld->field_name ); - - for( j = 0; j < value_count; j++ ) - { - if( fld->field_type == TIFF_BYTE ) - fprintf( fd, "%d", - (int) ((char *) raw_data)[j] ); - else if( fld->field_type == TIFF_SHORT ) - fprintf( fd, "%d", - (int) ((short *) raw_data)[j] ); - else if( fld->field_type == TIFF_LONG ) - fprintf( fd, "%d", - (int) ((long *) raw_data)[j] ); - else if( fld->field_type == TIFF_RATIONAL ) - fprintf( fd, "%f", - ((float *) raw_data)[j] ); - else if( fld->field_type == TIFF_ASCII ) - { - fprintf( fd, "%s", - (char *) raw_data ); - break; - } - else if( fld->field_type == TIFF_DOUBLE ) - fprintf( fd, "%f", - ((double *) raw_data)[j] ); - else if( fld->field_type == TIFF_FLOAT ) - fprintf( fd, "%f", - ((float *) raw_data)[j] ); - else - { - fprintf( fd, - "" ); - break; - } - - if( j < value_count-1 ) - fprintf( fd, "," ); - } - fprintf( fd, "\n" ); - } - else if( !fld->field_passcount - && fld->field_type == TIFF_ASCII ) - { - char *data; - - if( TIFFGetField( tif, tag, &data ) ) - fprintf(fd, " %s: %s\n", fld->field_name, data ); - } - } - } - - if (tif->tif_tagmethods.printdir) - (*tif->tif_tagmethods.printdir)(tif, fd, flags); - if ((flags & TIFFPRINT_STRIPS) && - TIFFFieldSet(tif,FIELD_STRIPOFFSETS)) { - tstrip_t s; - - fprintf(fd, " %lu %s:\n", - (long) td->td_nstrips, - isTiled(tif) ? "Tiles" : "Strips"); - for (s = 0; s < td->td_nstrips; s++) - fprintf(fd, " %3lu: [%8lu, %8lu]\n", - (u_long) s, - (u_long) td->td_stripoffset[s], - (u_long) td->td_stripbytecount[s]); - } -} - -void -_TIFFprintAscii(FILE* fd, const char* cp) -{ - for (; *cp != '\0'; cp++) { - const char* tp; - - if (isprint(*cp)) { - fputc(*cp, fd); - continue; - } - for (tp = "\tt\bb\rr\nn\vv"; *tp; tp++) - if (*tp++ == *cp) - break; - if (*tp) - fprintf(fd, "\\%c", *tp); - else - fprintf(fd, "\\%03o", *cp & 0xff); - } -} - -void -_TIFFprintAsciiTag(FILE* fd, const char* name, const char* value) -{ - fprintf(fd, " %s: \"", name); - _TIFFprintAscii(fd, value); - fprintf(fd, "\"\n"); -} diff --git a/wxWidgets/src/tiff/tif_read.c b/wxWidgets/src/tiff/tif_read.c deleted file mode 100644 index f39bf45ae6..0000000000 --- a/wxWidgets/src/tiff/tif_read.c +++ /dev/null @@ -1,637 +0,0 @@ -/* $Header$ */ - -/* - * Copyright (c) 1988-1997 Sam Leffler - * Copyright (c) 1991-1997 Silicon Graphics, Inc. - * - * Permission to use, copy, modify, distribute, and sell this software and - * its documentation for any purpose is hereby granted without fee, provided - * that (i) the above copyright notices and this permission notice appear in - * all copies of the software and related documentation, and (ii) the names of - * Sam Leffler and Silicon Graphics may not be used in any advertising or - * publicity relating to the software without the specific, prior written - * permission of Sam Leffler and Silicon Graphics. - * - * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, - * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * - * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR - * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, - * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF - * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE - * OF THIS SOFTWARE. - */ - -/* - * TIFF Library. - * Scanline-oriented Read Support - */ -#include "tiffiop.h" -#include -#include - - int TIFFFillStrip(TIFF*, tstrip_t); - int TIFFFillTile(TIFF*, ttile_t); -static int TIFFStartStrip(TIFF*, tstrip_t); -static int TIFFStartTile(TIFF*, ttile_t); -static int TIFFCheckRead(TIFF*, int); - -#define NOSTRIP ((tstrip_t) -1) /* undefined state */ -#define NOTILE ((ttile_t) -1) /* undefined state */ - -/* - * Seek to a random row+sample in a file. - */ -static int -TIFFSeek(TIFF* tif, uint32 row, tsample_t sample) -{ - register TIFFDirectory *td = &tif->tif_dir; - tstrip_t strip; - - if (row >= td->td_imagelength) { /* out of range */ - TIFFError(tif->tif_name, "%lu: Row out of range, max %lu", - (u_long) row, (u_long) td->td_imagelength); - return (0); - } - if (td->td_planarconfig == PLANARCONFIG_SEPARATE) { - if (sample >= td->td_samplesperpixel) { - TIFFError(tif->tif_name, - "%lu: Sample out of range, max %lu", - (u_long) sample, (u_long) td->td_samplesperpixel); - return (0); - } - strip = sample*td->td_stripsperimage + row/td->td_rowsperstrip; - } else - strip = row / td->td_rowsperstrip; - if (strip != tif->tif_curstrip) { /* different strip, refill */ - if (!TIFFFillStrip(tif, strip)) - return (0); - } else if (row < tif->tif_row) { - /* - * Moving backwards within the same strip: backup - * to the start and then decode forward (below). - * - * NB: If you're planning on lots of random access within a - * strip, it's better to just read and decode the entire - * strip, and then access the decoded data in a random fashion. - */ - if (!TIFFStartStrip(tif, strip)) - return (0); - } - if (row != tif->tif_row) { - /* - * Seek forward to the desired row. - */ - if (!(*tif->tif_seek)(tif, row - tif->tif_row)) - return (0); - tif->tif_row = row; - } - return (1); -} - -int -TIFFReadScanline(TIFF* tif, tdata_t buf, uint32 row, tsample_t sample) -{ - int e; - - if (!TIFFCheckRead(tif, 0)) - return (-1); - if( (e = TIFFSeek(tif, row, sample)) != 0) { - /* - * Decompress desired row into user buffer. - */ - e = (*tif->tif_decoderow) - (tif, (tidata_t) buf, tif->tif_scanlinesize, sample); - - /* we are now poised at the beginning of the next row */ - tif->tif_row = row + 1; - - if (e) - (*tif->tif_postdecode)(tif, (tidata_t) buf, - tif->tif_scanlinesize); - } - return (e > 0 ? 1 : -1); -} - -/* - * Read a strip of data and decompress the specified - * amount into the user-supplied buffer. - */ -tsize_t -TIFFReadEncodedStrip(TIFF* tif, tstrip_t strip, tdata_t buf, tsize_t size) -{ - TIFFDirectory *td = &tif->tif_dir; - uint32 nrows; - tsize_t stripsize; - tstrip_t sep_strip, strips_per_sep; - - if (!TIFFCheckRead(tif, 0)) - return (-1); - if (strip >= td->td_nstrips) { - TIFFError(tif->tif_name, "%ld: Strip out of range, max %ld", - (long) strip, (long) td->td_nstrips); - return (-1); - } - /* - * Calculate the strip size according to the number of - * rows in the strip (check for truncated last strip on any - * of the separations). - */ - if( td->td_rowsperstrip >= td->td_imagelength ) - strips_per_sep = 1; - else - strips_per_sep = (td->td_imagelength+td->td_rowsperstrip-1) - / td->td_rowsperstrip; - - sep_strip = strip % strips_per_sep; - - if (sep_strip != strips_per_sep-1 || - (nrows = td->td_imagelength % td->td_rowsperstrip) == 0) - nrows = td->td_rowsperstrip; - - stripsize = TIFFVStripSize(tif, nrows); - if (size == (tsize_t) -1) - size = stripsize; - else if (size > stripsize) - size = stripsize; - if (TIFFFillStrip(tif, strip) - && (*tif->tif_decodestrip)(tif, (tidata_t) buf, size, - (tsample_t)(strip / td->td_stripsperimage)) > 0 ) { - (*tif->tif_postdecode)(tif, (tidata_t) buf, size); - return (size); - } else - return ((tsize_t) -1); -} - -static tsize_t -TIFFReadRawStrip1(TIFF* tif, - tstrip_t strip, tdata_t buf, tsize_t size, const char* module) -{ - TIFFDirectory *td = &tif->tif_dir; - - if (!isMapped(tif)) { - tsize_t cc; - - if (!SeekOK(tif, td->td_stripoffset[strip])) { - TIFFError(module, - "%s: Seek error at scanline %lu, strip %lu", - tif->tif_name, - (u_long) tif->tif_row, (u_long) strip); - return (-1); - } - cc = TIFFReadFile(tif, buf, size); - if (cc != size) { - TIFFError(module, - "%s: Read error at scanline %lu; got %lu bytes, expected %lu", - tif->tif_name, - (u_long) tif->tif_row, - (u_long) cc, - (u_long) size); - return (-1); - } - } else { - if (td->td_stripoffset[strip] + size > tif->tif_size) { - TIFFError(module, - "%s: Read error at scanline %lu, strip %lu; got %lu bytes, expected %lu", - tif->tif_name, - (u_long) tif->tif_row, - (u_long) strip, - (u_long) tif->tif_size - td->td_stripoffset[strip], - (u_long) size); - return (-1); - } - _TIFFmemcpy(buf, tif->tif_base + td->td_stripoffset[strip], size); - } - return (size); -} - -/* - * Read a strip of data from the file. - */ -tsize_t -TIFFReadRawStrip(TIFF* tif, tstrip_t strip, tdata_t buf, tsize_t size) -{ - static const char module[] = "TIFFReadRawStrip"; - TIFFDirectory *td = &tif->tif_dir; - tsize_t bytecount; - - if (!TIFFCheckRead(tif, 0)) - return ((tsize_t) -1); - if (strip >= td->td_nstrips) { - TIFFError(tif->tif_name, "%lu: Strip out of range, max %lu", - (u_long) strip, (u_long) td->td_nstrips); - return ((tsize_t) -1); - } - bytecount = td->td_stripbytecount[strip]; - if (bytecount <= 0) { - TIFFError(tif->tif_name, - "%lu: Invalid strip byte count, strip %lu", - (u_long) bytecount, (u_long) strip); - return ((tsize_t) -1); - } - if (size != (tsize_t)-1 && size < bytecount) - bytecount = size; - return (TIFFReadRawStrip1(tif, strip, buf, bytecount, module)); -} - -/* - * Read the specified strip and setup for decoding. - * The data buffer is expanded, as necessary, to - * hold the strip's data. - */ -int -TIFFFillStrip(TIFF* tif, tstrip_t strip) -{ - static const char module[] = "TIFFFillStrip"; - TIFFDirectory *td = &tif->tif_dir; - tsize_t bytecount; - - bytecount = td->td_stripbytecount[strip]; - if (bytecount <= 0) { - TIFFError(tif->tif_name, - "%lu: Invalid strip byte count, strip %lu", - (u_long) bytecount, (u_long) strip); - return (0); - } - if (isMapped(tif) && - (isFillOrder(tif, td->td_fillorder) || (tif->tif_flags & TIFF_NOBITREV))) { - /* - * The image is mapped into memory and we either don't - * need to flip bits or the compression routine is going - * to handle this operation itself. In this case, avoid - * copying the raw data and instead just reference the - * data from the memory mapped file image. This assumes - * that the decompression routines do not modify the - * contents of the raw data buffer (if they try to, - * the application will get a fault since the file is - * mapped read-only). - */ - if ((tif->tif_flags & TIFF_MYBUFFER) && tif->tif_rawdata) - _TIFFfree(tif->tif_rawdata); - tif->tif_flags &= ~TIFF_MYBUFFER; - if ( td->td_stripoffset[strip] + bytecount > tif->tif_size) { - /* - * This error message might seem strange, but it's - * what would happen if a read were done instead. - */ - TIFFError(module, - "%s: Read error on strip %lu; got %lu bytes, expected %lu", - tif->tif_name, - (u_long) strip, - (u_long) tif->tif_size - td->td_stripoffset[strip], - (u_long) bytecount); - tif->tif_curstrip = NOSTRIP; - return (0); - } - tif->tif_rawdatasize = bytecount; - tif->tif_rawdata = tif->tif_base + td->td_stripoffset[strip]; - } else { - /* - * Expand raw data buffer, if needed, to - * hold data strip coming from file - * (perhaps should set upper bound on - * the size of a buffer we'll use?). - */ - if (bytecount > tif->tif_rawdatasize) { - tif->tif_curstrip = NOSTRIP; - if ((tif->tif_flags & TIFF_MYBUFFER) == 0) { - TIFFError(module, - "%s: Data buffer too small to hold strip %lu", - tif->tif_name, (u_long) strip); - return (0); - } - if (!TIFFReadBufferSetup(tif, 0, - TIFFroundup(bytecount, 1024))) - return (0); - } - if (TIFFReadRawStrip1(tif, strip, (u_char *)tif->tif_rawdata, - bytecount, module) != bytecount) - return (0); - if (!isFillOrder(tif, td->td_fillorder) && - (tif->tif_flags & TIFF_NOBITREV) == 0) - TIFFReverseBits(tif->tif_rawdata, bytecount); - } - return (TIFFStartStrip(tif, strip)); -} - -/* - * Tile-oriented Read Support - * Contributed by Nancy Cam (Silicon Graphics). - */ - -/* - * Read and decompress a tile of data. The - * tile is selected by the (x,y,z,s) coordinates. - */ -tsize_t -TIFFReadTile(TIFF* tif, - tdata_t buf, uint32 x, uint32 y, uint32 z, tsample_t s) -{ - if (!TIFFCheckRead(tif, 1) || !TIFFCheckTile(tif, x, y, z, s)) - return (-1); - return (TIFFReadEncodedTile(tif, - TIFFComputeTile(tif, x, y, z, s), buf, (tsize_t) -1)); -} - -/* - * Read a tile of data and decompress the specified - * amount into the user-supplied buffer. - */ -tsize_t -TIFFReadEncodedTile(TIFF* tif, ttile_t tile, tdata_t buf, tsize_t size) -{ - TIFFDirectory *td = &tif->tif_dir; - tsize_t tilesize = tif->tif_tilesize; - - if (!TIFFCheckRead(tif, 1)) - return (-1); - if (tile >= td->td_nstrips) { - TIFFError(tif->tif_name, "%ld: Tile out of range, max %ld", - (long) tile, (u_long) td->td_nstrips); - return (-1); - } - if (size == (tsize_t) -1) - size = tilesize; - else if (size > tilesize) - size = tilesize; - if (TIFFFillTile(tif, tile) && (*tif->tif_decodetile)(tif, - (tidata_t) buf, size, (tsample_t)(tile/td->td_stripsperimage))) { - (*tif->tif_postdecode)(tif, (tidata_t) buf, size); - return (size); - } else - return (-1); -} - -static tsize_t -TIFFReadRawTile1(TIFF* tif, - ttile_t tile, tdata_t buf, tsize_t size, const char* module) -{ - TIFFDirectory *td = &tif->tif_dir; - - if (!isMapped(tif)) { - tsize_t cc; - - if (!SeekOK(tif, td->td_stripoffset[tile])) { - TIFFError(module, - "%s: Seek error at row %ld, col %ld, tile %ld", - tif->tif_name, - (long) tif->tif_row, - (long) tif->tif_col, - (long) tile); - return ((tsize_t) -1); - } - cc = TIFFReadFile(tif, buf, size); - if (cc != size) { - TIFFError(module, - "%s: Read error at row %ld, col %ld; got %lu bytes, expected %lu", - tif->tif_name, - (long) tif->tif_row, - (long) tif->tif_col, - (u_long) cc, - (u_long) size); - return ((tsize_t) -1); - } - } else { - if (td->td_stripoffset[tile] + size > tif->tif_size) { - TIFFError(module, - "%s: Read error at row %ld, col %ld, tile %ld; got %lu bytes, expected %lu", - tif->tif_name, - (long) tif->tif_row, - (long) tif->tif_col, - (long) tile, - (u_long) tif->tif_size - td->td_stripoffset[tile], - (u_long) size); - return ((tsize_t) -1); - } - _TIFFmemcpy(buf, tif->tif_base + td->td_stripoffset[tile], size); - } - return (size); -} - -/* - * Read a tile of data from the file. - */ -tsize_t -TIFFReadRawTile(TIFF* tif, ttile_t tile, tdata_t buf, tsize_t size) -{ - static const char module[] = "TIFFReadRawTile"; - TIFFDirectory *td = &tif->tif_dir; - tsize_t bytecount; - - if (!TIFFCheckRead(tif, 1)) - return ((tsize_t) -1); - if (tile >= td->td_nstrips) { - TIFFError(tif->tif_name, "%lu: Tile out of range, max %lu", - (u_long) tile, (u_long) td->td_nstrips); - return ((tsize_t) -1); - } - bytecount = td->td_stripbytecount[tile]; - if (size != (tsize_t) -1 && size < bytecount) - bytecount = size; - return (TIFFReadRawTile1(tif, tile, buf, bytecount, module)); -} - -/* - * Read the specified tile and setup for decoding. - * The data buffer is expanded, as necessary, to - * hold the tile's data. - */ -int -TIFFFillTile(TIFF* tif, ttile_t tile) -{ - static const char module[] = "TIFFFillTile"; - TIFFDirectory *td = &tif->tif_dir; - tsize_t bytecount; - - bytecount = td->td_stripbytecount[tile]; - if (bytecount <= 0) { - TIFFError(tif->tif_name, - "%lu: Invalid tile byte count, tile %lu", - (u_long) bytecount, (u_long) tile); - return (0); - } - if (isMapped(tif) && - (isFillOrder(tif, td->td_fillorder) || (tif->tif_flags & TIFF_NOBITREV))) { - /* - * The image is mapped into memory and we either don't - * need to flip bits or the compression routine is going - * to handle this operation itself. In this case, avoid - * copying the raw data and instead just reference the - * data from the memory mapped file image. This assumes - * that the decompression routines do not modify the - * contents of the raw data buffer (if they try to, - * the application will get a fault since the file is - * mapped read-only). - */ - if ((tif->tif_flags & TIFF_MYBUFFER) && tif->tif_rawdata) - _TIFFfree(tif->tif_rawdata); - tif->tif_flags &= ~TIFF_MYBUFFER; - if ( td->td_stripoffset[tile] + bytecount > tif->tif_size) { - tif->tif_curtile = NOTILE; - return (0); - } - tif->tif_rawdatasize = bytecount; - tif->tif_rawdata = tif->tif_base + td->td_stripoffset[tile]; - } else { - /* - * Expand raw data buffer, if needed, to - * hold data tile coming from file - * (perhaps should set upper bound on - * the size of a buffer we'll use?). - */ - if (bytecount > tif->tif_rawdatasize) { - tif->tif_curtile = NOTILE; - if ((tif->tif_flags & TIFF_MYBUFFER) == 0) { - TIFFError(module, - "%s: Data buffer too small to hold tile %ld", - tif->tif_name, (long) tile); - return (0); - } - if (!TIFFReadBufferSetup(tif, 0, - TIFFroundup(bytecount, 1024))) - return (0); - } - if (TIFFReadRawTile1(tif, tile, (u_char *)tif->tif_rawdata, - bytecount, module) != bytecount) - return (0); - if (!isFillOrder(tif, td->td_fillorder) && - (tif->tif_flags & TIFF_NOBITREV) == 0) - TIFFReverseBits(tif->tif_rawdata, bytecount); - } - return (TIFFStartTile(tif, tile)); -} - -/* - * Setup the raw data buffer in preparation for - * reading a strip of raw data. If the buffer - * is specified as zero, then a buffer of appropriate - * size is allocated by the library. Otherwise, - * the client must guarantee that the buffer is - * large enough to hold any individual strip of - * raw data. - */ -int -TIFFReadBufferSetup(TIFF* tif, tdata_t bp, tsize_t size) -{ - static const char module[] = "TIFFReadBufferSetup"; - - if (tif->tif_rawdata) { - if (tif->tif_flags & TIFF_MYBUFFER) - _TIFFfree(tif->tif_rawdata); - tif->tif_rawdata = NULL; - } - if (bp) { - tif->tif_rawdatasize = size; - tif->tif_rawdata = (tidata_t) bp; - tif->tif_flags &= ~TIFF_MYBUFFER; - } else { - tif->tif_rawdatasize = TIFFroundup(size, 1024); - tif->tif_rawdata = (tidata_t) _TIFFmalloc(tif->tif_rawdatasize); - tif->tif_flags |= TIFF_MYBUFFER; - } - if (tif->tif_rawdata == NULL) { - TIFFError(module, - "%s: No space for data buffer at scanline %ld", - tif->tif_name, (long) tif->tif_row); - tif->tif_rawdatasize = 0; - return (0); - } - return (1); -} - -/* - * Set state to appear as if a - * strip has just been read in. - */ -static int -TIFFStartStrip(TIFF* tif, tstrip_t strip) -{ - TIFFDirectory *td = &tif->tif_dir; - - if ((tif->tif_flags & TIFF_CODERSETUP) == 0) { - if (!(*tif->tif_setupdecode)(tif)) - return (0); - tif->tif_flags |= TIFF_CODERSETUP; - } - tif->tif_curstrip = strip; - tif->tif_row = (strip % td->td_stripsperimage) * td->td_rowsperstrip; - tif->tif_rawcp = tif->tif_rawdata; - tif->tif_rawcc = td->td_stripbytecount[strip]; - return ((*tif->tif_predecode)(tif, - (tsample_t)(strip / td->td_stripsperimage))); -} - -/* - * Set state to appear as if a - * tile has just been read in. - */ -static int -TIFFStartTile(TIFF* tif, ttile_t tile) -{ - TIFFDirectory *td = &tif->tif_dir; - - if ((tif->tif_flags & TIFF_CODERSETUP) == 0) { - if (!(*tif->tif_setupdecode)(tif)) - return (0); - tif->tif_flags |= TIFF_CODERSETUP; - } - tif->tif_curtile = tile; - tif->tif_row = - (tile % TIFFhowmany(td->td_imagewidth, td->td_tilewidth)) * - td->td_tilelength; - tif->tif_col = - (tile % TIFFhowmany(td->td_imagelength, td->td_tilelength)) * - td->td_tilewidth; - tif->tif_rawcp = tif->tif_rawdata; - tif->tif_rawcc = td->td_stripbytecount[tile]; - return ((*tif->tif_predecode)(tif, - (tsample_t)(tile/td->td_stripsperimage))); -} - -static int -TIFFCheckRead(TIFF* tif, int tiles) -{ - if (tif->tif_mode == O_WRONLY) { - TIFFError(tif->tif_name, "File not open for reading"); - return (0); - } - if (tiles ^ isTiled(tif)) { - TIFFError(tif->tif_name, tiles ? - "Can not read tiles from a stripped image" : - "Can not read scanlines from a tiled image"); - return (0); - } - return (1); -} - -void -_TIFFNoPostDecode(TIFF* tif, tidata_t buf, tsize_t cc) -{ - (void) tif; (void) buf; (void) cc; -} - -void -_TIFFSwab16BitData(TIFF* tif, tidata_t buf, tsize_t cc) -{ - (void) tif; - assert((cc & 1) == 0); - TIFFSwabArrayOfShort((uint16*) buf, cc/2); -} - -void -_TIFFSwab32BitData(TIFF* tif, tidata_t buf, tsize_t cc) -{ - (void) tif; - assert((cc & 3) == 0); - TIFFSwabArrayOfLong((uint32*) buf, cc/4); -} - -void -_TIFFSwab64BitData(TIFF* tif, tidata_t buf, tsize_t cc) -{ - (void) tif; - assert((cc & 7) == 0); - TIFFSwabArrayOfDouble((double*) buf, cc/8); -} diff --git a/wxWidgets/src/tiff/tif_strip.c b/wxWidgets/src/tiff/tif_strip.c deleted file mode 100644 index 4c8378bd0b..0000000000 --- a/wxWidgets/src/tiff/tif_strip.c +++ /dev/null @@ -1,254 +0,0 @@ -/* $Header$ */ - -/* - * Copyright (c) 1991-1997 Sam Leffler - * Copyright (c) 1991-1997 Silicon Graphics, Inc. - * - * Permission to use, copy, modify, distribute, and sell this software and - * its documentation for any purpose is hereby granted without fee, provided - * that (i) the above copyright notices and this permission notice appear in - * all copies of the software and related documentation, and (ii) the names of - * Sam Leffler and Silicon Graphics may not be used in any advertising or - * publicity relating to the software without the specific, prior written - * permission of Sam Leffler and Silicon Graphics. - * - * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, - * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * - * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR - * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, - * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF - * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE - * OF THIS SOFTWARE. - */ - -/* - * TIFF Library. - * - * Strip-organized Image Support Routines. - */ -#include "tiffiop.h" - -static uint32 -summarize(TIFF* tif, size_t summand1, size_t summand2, const char* where) -{ - uint32 bytes = summand1 + summand2; - - if (bytes - summand1 != summand2) { - TIFFError(tif->tif_name, "Integer overflow in %s", where); - bytes = 0; - } - - return (bytes); -} - -static uint32 -multiply(TIFF* tif, size_t nmemb, size_t elem_size, const char* where) -{ - uint32 bytes = nmemb * elem_size; - - if (elem_size && bytes / elem_size != nmemb) { - TIFFError(tif->tif_name, "Integer overflow in %s", where); - bytes = 0; - } - - return (bytes); -} - -/* - * Compute which strip a (row,sample) value is in. - */ -tstrip_t -TIFFComputeStrip(TIFF* tif, uint32 row, tsample_t sample) -{ - TIFFDirectory *td = &tif->tif_dir; - tstrip_t strip; - - strip = row / td->td_rowsperstrip; - if (td->td_planarconfig == PLANARCONFIG_SEPARATE) { - if (sample >= td->td_samplesperpixel) { - TIFFError(tif->tif_name, - "%u: Sample out of range, max %u", - sample, td->td_samplesperpixel); - return ((tstrip_t) 0); - } - strip += sample*td->td_stripsperimage; - } - return (strip); -} - -/* - * Compute how many strips are in an image. - */ -tstrip_t -TIFFNumberOfStrips(TIFF* tif) -{ - TIFFDirectory *td = &tif->tif_dir; - tstrip_t nstrips; - - nstrips = (td->td_rowsperstrip == (uint32) -1 ? - (td->td_imagelength != 0 ? 1 : 0) : - TIFFhowmany(td->td_imagelength, td->td_rowsperstrip)); - if (td->td_planarconfig == PLANARCONFIG_SEPARATE) - nstrips = multiply(tif, nstrips, td->td_samplesperpixel, - "TIFFNumberOfStrips"); - return (nstrips); -} - -/* - * Compute the # bytes in a variable height, row-aligned strip. - */ -tsize_t -TIFFVStripSize(TIFF* tif, uint32 nrows) -{ - TIFFDirectory *td = &tif->tif_dir; - - if (nrows == (uint32) -1) - nrows = td->td_imagelength; -#ifdef YCBCR_SUPPORT - if (td->td_planarconfig == PLANARCONFIG_CONTIG && - td->td_photometric == PHOTOMETRIC_YCBCR && - !isUpSampled(tif)) { - /* - * Packed YCbCr data contain one Cb+Cr for every - * HorizontalSampling*VerticalSampling Y values. - * Must also roundup width and height when calculating - * since images that are not a multiple of the - * horizontal/vertical subsampling area include - * YCbCr data for the extended image. - */ - uint16 ycbcrsubsampling[2]; - tsize_t w, scanline, samplingarea; - - TIFFGetField( tif, TIFFTAG_YCBCRSUBSAMPLING, - ycbcrsubsampling + 0, - ycbcrsubsampling + 1 ); - - w = TIFFroundup(td->td_imagewidth, ycbcrsubsampling[0]); - scanline = TIFFhowmany8(multiply(tif, w, td->td_bitspersample, - "TIFFVStripSize")); - samplingarea = ycbcrsubsampling[0]*ycbcrsubsampling[1]; - nrows = TIFFroundup(nrows, ycbcrsubsampling[1]); - /* NB: don't need TIFFhowmany here 'cuz everything is rounded */ - scanline = multiply(tif, nrows, scanline, "TIFFVStripSize"); - return ((tsize_t) - summarize(tif, scanline, - multiply(tif, 2, scanline / samplingarea, - "TIFFVStripSize"), "TIFFVStripSize")); - } else -#endif - return ((tsize_t) multiply(tif, nrows, TIFFScanlineSize(tif), - "TIFFVStripSize")); -} - - -/* - * Compute the # bytes in a raw strip. - */ -tsize_t -TIFFRawStripSize(TIFF* tif, tstrip_t strip) -{ - TIFFDirectory* td = &tif->tif_dir; - tsize_t bytecount = td->td_stripbytecount[strip]; - - if (bytecount <= 0) { - TIFFError(tif->tif_name, - "%lu: Invalid strip byte count, strip %lu", - (u_long) bytecount, (u_long) strip); - bytecount = (tsize_t) -1; - } - - return bytecount; -} - -/* - * Compute the # bytes in a (row-aligned) strip. - * - * Note that if RowsPerStrip is larger than the - * recorded ImageLength, then the strip size is - * truncated to reflect the actual space required - * to hold the strip. - */ -tsize_t -TIFFStripSize(TIFF* tif) -{ - TIFFDirectory* td = &tif->tif_dir; - uint32 rps = td->td_rowsperstrip; - if (rps > td->td_imagelength) - rps = td->td_imagelength; - return (TIFFVStripSize(tif, rps)); -} - -/* - * Compute a default strip size based on the image - * characteristics and a requested value. If the - * request is <1 then we choose a strip size according - * to certain heuristics. - */ -uint32 -TIFFDefaultStripSize(TIFF* tif, uint32 request) -{ - return (*tif->tif_defstripsize)(tif, request); -} - -uint32 -_TIFFDefaultStripSize(TIFF* tif, uint32 s) -{ - if ((int32) s < 1) { - /* - * If RowsPerStrip is unspecified, try to break the - * image up into strips that are approximately 8Kbytes. - */ - tsize_t scanline = TIFFScanlineSize(tif); - s = (uint32)(8*1024) / (scanline == 0 ? 1 : scanline); - if (s == 0) /* very wide images */ - s = 1; - } - return (s); -} - -/* - * Return the number of bytes to read/write in a call to - * one of the scanline-oriented i/o routines. Note that - * this number may be 1/samples-per-pixel if data is - * stored as separate planes. - */ -tsize_t -TIFFScanlineSize(TIFF* tif) -{ - TIFFDirectory *td = &tif->tif_dir; - tsize_t scanline; - - scanline = multiply (tif, td->td_bitspersample, td->td_imagewidth, - "TIFFScanlineSize"); - if (td->td_planarconfig == PLANARCONFIG_CONTIG) - scanline = multiply (tif, scanline, td->td_samplesperpixel, - "TIFFScanlineSize"); - return ((tsize_t) TIFFhowmany8(scanline)); -} - -/* - * Return the number of bytes required to store a complete - * decoded and packed raster scanline (as opposed to the - * I/O size returned by TIFFScanlineSize which may be less - * if data is store as separate planes). - */ -tsize_t -TIFFRasterScanlineSize(TIFF* tif) -{ - TIFFDirectory *td = &tif->tif_dir; - tsize_t scanline; - - scanline = multiply (tif, td->td_bitspersample, td->td_imagewidth, - "TIFFRasterScanlineSize"); - if (td->td_planarconfig == PLANARCONFIG_CONTIG) { - scanline = multiply (tif, scanline, td->td_samplesperpixel, - "TIFFRasterScanlineSize"); - return ((tsize_t) TIFFhowmany8(scanline)); - } else - return ((tsize_t) multiply (tif, TIFFhowmany8(scanline), - td->td_samplesperpixel, - "TIFFRasterScanlineSize")); -} diff --git a/wxWidgets/src/tiff/tif_swab.c b/wxWidgets/src/tiff/tif_swab.c deleted file mode 100644 index 37962b82a7..0000000000 --- a/wxWidgets/src/tiff/tif_swab.c +++ /dev/null @@ -1,217 +0,0 @@ -/* $Header$ */ - -/* - * Copyright (c) 1988-1997 Sam Leffler - * Copyright (c) 1991-1997 Silicon Graphics, Inc. - * - * Permission to use, copy, modify, distribute, and sell this software and - * its documentation for any purpose is hereby granted without fee, provided - * that (i) the above copyright notices and this permission notice appear in - * all copies of the software and related documentation, and (ii) the names of - * Sam Leffler and Silicon Graphics may not be used in any advertising or - * publicity relating to the software without the specific, prior written - * permission of Sam Leffler and Silicon Graphics. - * - * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, - * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * - * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR - * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, - * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF - * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE - * OF THIS SOFTWARE. - */ - -/* - * TIFF Library Bit & Byte Swapping Support. - * - * XXX We assume short = 16-bits and long = 32-bits XXX - */ -#include "tiffiop.h" - -#ifndef TIFFSwabShort -void -TIFFSwabShort(uint16* wp) -{ - register u_char* cp = (u_char*) wp; - u_char t; - - t = cp[1]; cp[1] = cp[0]; cp[0] = t; -} -#endif - -#ifndef TIFFSwabLong -void -TIFFSwabLong(uint32* lp) -{ - register u_char* cp = (u_char*) lp; - u_char t; - - t = cp[3]; cp[3] = cp[0]; cp[0] = t; - t = cp[2]; cp[2] = cp[1]; cp[1] = t; -} -#endif - -#ifndef TIFFSwabArrayOfShort -void -TIFFSwabArrayOfShort(uint16* wp, register u_long n) -{ - register u_char* cp; - register u_char t; - - /* XXX unroll loop some */ - while (n-- > 0) { - cp = (u_char*) wp; - t = cp[1]; cp[1] = cp[0]; cp[0] = t; - wp++; - } -} -#endif - -#ifndef TIFFSwabArrayOfLong -void -TIFFSwabArrayOfLong(register uint32* lp, register u_long n) -{ - register unsigned char *cp; - register unsigned char t; - - /* XXX unroll loop some */ - while (n-- > 0) { - cp = (unsigned char *)lp; - t = cp[3]; cp[3] = cp[0]; cp[0] = t; - t = cp[2]; cp[2] = cp[1]; cp[1] = t; - lp++; - } -} -#endif - -#ifndef TIFFSwabDouble -void -TIFFSwabDouble(double *dp) -{ - register uint32* lp = (uint32*) dp; - uint32 t; - - TIFFSwabArrayOfLong(lp, 2); - t = lp[0]; lp[0] = lp[1]; lp[1] = t; -} -#endif - -#ifndef TIFFSwabArrayOfDouble -void -TIFFSwabArrayOfDouble(double* dp, register u_long n) -{ - register uint32* lp = (uint32*) dp; - register uint32 t; - - TIFFSwabArrayOfLong(lp, n + n); - while (n-- > 0) { - t = lp[0]; lp[0] = lp[1]; lp[1] = t; - lp += 2; - } -} -#endif - -/* - * Bit reversal tables. TIFFBitRevTable[] gives - * the bit reversed value of . Used in various - * places in the library when the FillOrder requires - * bit reversal of byte values (e.g. CCITT Fax 3 - * encoding/decoding). TIFFNoBitRevTable is provided - * for algorithms that want an equivalent table that - * do not reverse bit values. - */ -static const unsigned char TIFFBitRevTable[256] = { - 0x00, 0x80, 0x40, 0xc0, 0x20, 0xa0, 0x60, 0xe0, - 0x10, 0x90, 0x50, 0xd0, 0x30, 0xb0, 0x70, 0xf0, - 0x08, 0x88, 0x48, 0xc8, 0x28, 0xa8, 0x68, 0xe8, - 0x18, 0x98, 0x58, 0xd8, 0x38, 0xb8, 0x78, 0xf8, - 0x04, 0x84, 0x44, 0xc4, 0x24, 0xa4, 0x64, 0xe4, - 0x14, 0x94, 0x54, 0xd4, 0x34, 0xb4, 0x74, 0xf4, - 0x0c, 0x8c, 0x4c, 0xcc, 0x2c, 0xac, 0x6c, 0xec, - 0x1c, 0x9c, 0x5c, 0xdc, 0x3c, 0xbc, 0x7c, 0xfc, - 0x02, 0x82, 0x42, 0xc2, 0x22, 0xa2, 0x62, 0xe2, - 0x12, 0x92, 0x52, 0xd2, 0x32, 0xb2, 0x72, 0xf2, - 0x0a, 0x8a, 0x4a, 0xca, 0x2a, 0xaa, 0x6a, 0xea, - 0x1a, 0x9a, 0x5a, 0xda, 0x3a, 0xba, 0x7a, 0xfa, - 0x06, 0x86, 0x46, 0xc6, 0x26, 0xa6, 0x66, 0xe6, - 0x16, 0x96, 0x56, 0xd6, 0x36, 0xb6, 0x76, 0xf6, - 0x0e, 0x8e, 0x4e, 0xce, 0x2e, 0xae, 0x6e, 0xee, - 0x1e, 0x9e, 0x5e, 0xde, 0x3e, 0xbe, 0x7e, 0xfe, - 0x01, 0x81, 0x41, 0xc1, 0x21, 0xa1, 0x61, 0xe1, - 0x11, 0x91, 0x51, 0xd1, 0x31, 0xb1, 0x71, 0xf1, - 0x09, 0x89, 0x49, 0xc9, 0x29, 0xa9, 0x69, 0xe9, - 0x19, 0x99, 0x59, 0xd9, 0x39, 0xb9, 0x79, 0xf9, - 0x05, 0x85, 0x45, 0xc5, 0x25, 0xa5, 0x65, 0xe5, - 0x15, 0x95, 0x55, 0xd5, 0x35, 0xb5, 0x75, 0xf5, - 0x0d, 0x8d, 0x4d, 0xcd, 0x2d, 0xad, 0x6d, 0xed, - 0x1d, 0x9d, 0x5d, 0xdd, 0x3d, 0xbd, 0x7d, 0xfd, - 0x03, 0x83, 0x43, 0xc3, 0x23, 0xa3, 0x63, 0xe3, - 0x13, 0x93, 0x53, 0xd3, 0x33, 0xb3, 0x73, 0xf3, - 0x0b, 0x8b, 0x4b, 0xcb, 0x2b, 0xab, 0x6b, 0xeb, - 0x1b, 0x9b, 0x5b, 0xdb, 0x3b, 0xbb, 0x7b, 0xfb, - 0x07, 0x87, 0x47, 0xc7, 0x27, 0xa7, 0x67, 0xe7, - 0x17, 0x97, 0x57, 0xd7, 0x37, 0xb7, 0x77, 0xf7, - 0x0f, 0x8f, 0x4f, 0xcf, 0x2f, 0xaf, 0x6f, 0xef, - 0x1f, 0x9f, 0x5f, 0xdf, 0x3f, 0xbf, 0x7f, 0xff -}; -static const unsigned char TIFFNoBitRevTable[256] = { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, - 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, - 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, - 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, - 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, - 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, - 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, - 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, - 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, - 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, - 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, - 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, - 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, - 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, - 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, - 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, - 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, - 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, - 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, - 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, - 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, - 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, - 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, - 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, - 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, - 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, - 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, - 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, - 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, - 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, - 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff, -}; - -const unsigned char* -TIFFGetBitRevTable(int reversed) -{ - return (reversed ? TIFFBitRevTable : TIFFNoBitRevTable); -} - -void -TIFFReverseBits(register u_char* cp, register u_long n) -{ - for (; n > 8; n -= 8) { - cp[0] = TIFFBitRevTable[cp[0]]; - cp[1] = TIFFBitRevTable[cp[1]]; - cp[2] = TIFFBitRevTable[cp[2]]; - cp[3] = TIFFBitRevTable[cp[3]]; - cp[4] = TIFFBitRevTable[cp[4]]; - cp[5] = TIFFBitRevTable[cp[5]]; - cp[6] = TIFFBitRevTable[cp[6]]; - cp[7] = TIFFBitRevTable[cp[7]]; - cp += 8; - } - while (n-- > 0) - *cp = TIFFBitRevTable[*cp], cp++; -} diff --git a/wxWidgets/src/tiff/tif_thunder.c b/wxWidgets/src/tiff/tif_thunder.c deleted file mode 100644 index 0880795980..0000000000 --- a/wxWidgets/src/tiff/tif_thunder.c +++ /dev/null @@ -1,156 +0,0 @@ -/* $Header$ */ - -/* - * Copyright (c) 1988-1997 Sam Leffler - * Copyright (c) 1991-1997 Silicon Graphics, Inc. - * - * Permission to use, copy, modify, distribute, and sell this software and - * its documentation for any purpose is hereby granted without fee, provided - * that (i) the above copyright notices and this permission notice appear in - * all copies of the software and related documentation, and (ii) the names of - * Sam Leffler and Silicon Graphics may not be used in any advertising or - * publicity relating to the software without the specific, prior written - * permission of Sam Leffler and Silicon Graphics. - * - * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, - * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * - * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR - * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, - * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF - * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE - * OF THIS SOFTWARE. - */ - -#include "tiffiop.h" -#ifdef THUNDER_SUPPORT -/* - * TIFF Library. - * - * ThunderScan 4-bit Compression Algorithm Support - */ - -/* - * ThunderScan uses an encoding scheme designed for - * 4-bit pixel values. Data is encoded in bytes, with - * each byte split into a 2-bit code word and a 6-bit - * data value. The encoding gives raw data, runs of - * pixels, or pixel values encoded as a delta from the - * previous pixel value. For the latter, either 2-bit - * or 3-bit delta values are used, with the deltas packed - * into a single byte. - */ -#define THUNDER_DATA 0x3f /* mask for 6-bit data */ -#define THUNDER_CODE 0xc0 /* mask for 2-bit code word */ -/* code values */ -#define THUNDER_RUN 0x00 /* run of pixels w/ encoded count */ -#define THUNDER_2BITDELTAS 0x40 /* 3 pixels w/ encoded 2-bit deltas */ -#define DELTA2_SKIP 2 /* skip code for 2-bit deltas */ -#define THUNDER_3BITDELTAS 0x80 /* 2 pixels w/ encoded 3-bit deltas */ -#define DELTA3_SKIP 4 /* skip code for 3-bit deltas */ -#define THUNDER_RAW 0xc0 /* raw data encoded */ - -static const int twobitdeltas[4] = { 0, 1, 0, -1 }; -static const int threebitdeltas[8] = { 0, 1, 2, 3, 0, -3, -2, -1 }; - -#define SETPIXEL(op, v) { \ - lastpixel = (v) & 0xf; \ - if (npixels++ & 1) \ - *op++ |= lastpixel; \ - else \ - op[0] = (tidataval_t) (lastpixel << 4); \ -} - -static int -ThunderDecode(TIFF* tif, tidata_t op, tsize_t maxpixels) -{ - register u_char *bp; - register tsize_t cc; - u_int lastpixel; - tsize_t npixels; - - bp = (u_char *)tif->tif_rawcp; - cc = tif->tif_rawcc; - lastpixel = 0; - npixels = 0; - while (cc > 0 && npixels < maxpixels) { - int n, delta; - - n = *bp++, cc--; - switch (n & THUNDER_CODE) { - case THUNDER_RUN: /* pixel run */ - /* - * Replicate the last pixel n times, - * where n is the lower-order 6 bits. - */ - if (npixels & 1) { - op[0] |= lastpixel; - lastpixel = *op++; npixels++; n--; - } else - lastpixel |= lastpixel << 4; - npixels += n; - if (npixels < maxpixels) { - for (; n > 0; n -= 2) - *op++ = (tidataval_t) lastpixel; - } - if (n == -1) - *--op &= 0xf0; - lastpixel &= 0xf; - break; - case THUNDER_2BITDELTAS: /* 2-bit deltas */ - if ((delta = ((n >> 4) & 3)) != DELTA2_SKIP) - SETPIXEL(op, lastpixel + twobitdeltas[delta]); - if ((delta = ((n >> 2) & 3)) != DELTA2_SKIP) - SETPIXEL(op, lastpixel + twobitdeltas[delta]); - if ((delta = (n & 3)) != DELTA2_SKIP) - SETPIXEL(op, lastpixel + twobitdeltas[delta]); - break; - case THUNDER_3BITDELTAS: /* 3-bit deltas */ - if ((delta = ((n >> 3) & 7)) != DELTA3_SKIP) - SETPIXEL(op, lastpixel + threebitdeltas[delta]); - if ((delta = (n & 7)) != DELTA3_SKIP) - SETPIXEL(op, lastpixel + threebitdeltas[delta]); - break; - case THUNDER_RAW: /* raw data */ - SETPIXEL(op, n); - break; - } - } - tif->tif_rawcp = (tidata_t) bp; - tif->tif_rawcc = cc; - if (npixels != maxpixels) { - TIFFError(tif->tif_name, - "ThunderDecode: %s data at scanline %ld (%lu != %lu)", - npixels < maxpixels ? "Not enough" : "Too much", - (long) tif->tif_row, (long) npixels, (long) maxpixels); - return (0); - } - return (1); -} - -static int -ThunderDecodeRow(TIFF* tif, tidata_t buf, tsize_t occ, tsample_t s) -{ - tidata_t row = buf; - - (void) s; - while ((long)occ > 0) { - if (!ThunderDecode(tif, row, tif->tif_dir.td_imagewidth)) - return (0); - occ -= tif->tif_scanlinesize; - row += tif->tif_scanlinesize; - } - return (1); -} - -int -TIFFInitThunderScan(TIFF* tif, int scheme) -{ - (void) scheme; - tif->tif_decoderow = ThunderDecodeRow; - tif->tif_decodestrip = ThunderDecodeRow; - return (1); -} -#endif /* THUNDER_SUPPORT */ diff --git a/wxWidgets/src/tiff/tif_tile.c b/wxWidgets/src/tiff/tif_tile.c deleted file mode 100644 index 5a0b433a20..0000000000 --- a/wxWidgets/src/tiff/tif_tile.c +++ /dev/null @@ -1,257 +0,0 @@ -/* $Header$ */ - -/* - * Copyright (c) 1991-1997 Sam Leffler - * Copyright (c) 1991-1997 Silicon Graphics, Inc. - * - * Permission to use, copy, modify, distribute, and sell this software and - * its documentation for any purpose is hereby granted without fee, provided - * that (i) the above copyright notices and this permission notice appear in - * all copies of the software and related documentation, and (ii) the names of - * Sam Leffler and Silicon Graphics may not be used in any advertising or - * publicity relating to the software without the specific, prior written - * permission of Sam Leffler and Silicon Graphics. - * - * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, - * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * - * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR - * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, - * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF - * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE - * OF THIS SOFTWARE. - */ - -/* - * TIFF Library. - * - * Tiled Image Support Routines. - */ -#include "tiffiop.h" - -static uint32 -summarize(TIFF* tif, size_t summand1, size_t summand2, const char* where) -{ - uint32 bytes = summand1 + summand2; - - if (bytes - summand1 != summand2) { - TIFFError(tif->tif_name, "Integer overflow in %s", where); - bytes = 0; - } - - return (bytes); -} - -static uint32 -multiply(TIFF* tif, size_t nmemb, size_t elem_size, const char* where) -{ - uint32 bytes = nmemb * elem_size; - - if (elem_size && bytes / elem_size != nmemb) { - TIFFError(tif->tif_name, "Integer overflow in %s", where); - bytes = 0; - } - - return (bytes); -} - -/* - * Compute which tile an (x,y,z,s) value is in. - */ -ttile_t -TIFFComputeTile(TIFF* tif, uint32 x, uint32 y, uint32 z, tsample_t s) -{ - TIFFDirectory *td = &tif->tif_dir; - uint32 dx = td->td_tilewidth; - uint32 dy = td->td_tilelength; - uint32 dz = td->td_tiledepth; - ttile_t tile = 1; - - if (td->td_imagedepth == 1) - z = 0; - if (dx == (uint32) -1) - dx = td->td_imagewidth; - if (dy == (uint32) -1) - dy = td->td_imagelength; - if (dz == (uint32) -1) - dz = td->td_imagedepth; - if (dx != 0 && dy != 0 && dz != 0) { - uint32 xpt = TIFFhowmany(td->td_imagewidth, dx); - uint32 ypt = TIFFhowmany(td->td_imagelength, dy); - uint32 zpt = TIFFhowmany(td->td_imagedepth, dz); - - if (td->td_planarconfig == PLANARCONFIG_SEPARATE) - tile = (xpt*ypt*zpt)*s + - (xpt*ypt)*(z/dz) + - xpt*(y/dy) + - x/dx; - else - tile = (xpt*ypt)*(z/dz) + xpt*(y/dy) + x/dx; - } - return (tile); -} - -/* - * Check an (x,y,z,s) coordinate - * against the image bounds. - */ -int -TIFFCheckTile(TIFF* tif, uint32 x, uint32 y, uint32 z, tsample_t s) -{ - TIFFDirectory *td = &tif->tif_dir; - - if (x >= td->td_imagewidth) { - TIFFError(tif->tif_name, "Col %ld out of range, max %lu", - (long) x, (u_long) td->td_imagewidth); - return (0); - } - if (y >= td->td_imagelength) { - TIFFError(tif->tif_name, "Row %ld out of range, max %lu", - (long) y, (u_long) td->td_imagelength); - return (0); - } - if (z >= td->td_imagedepth) { - TIFFError(tif->tif_name, "Depth %ld out of range, max %lu", - (long) z, (u_long) td->td_imagedepth); - return (0); - } - if (td->td_planarconfig == PLANARCONFIG_SEPARATE && - s >= td->td_samplesperpixel) { - TIFFError(tif->tif_name, "Sample %d out of range, max %u", - (int) s, td->td_samplesperpixel); - return (0); - } - return (1); -} - -/* - * Compute how many tiles are in an image. - */ -ttile_t -TIFFNumberOfTiles(TIFF* tif) -{ - TIFFDirectory *td = &tif->tif_dir; - uint32 dx = td->td_tilewidth; - uint32 dy = td->td_tilelength; - uint32 dz = td->td_tiledepth; - ttile_t ntiles; - - if (dx == (uint32) -1) - dx = td->td_imagewidth; - if (dy == (uint32) -1) - dy = td->td_imagelength; - if (dz == (uint32) -1) - dz = td->td_imagedepth; - ntiles = (dx == 0 || dy == 0 || dz == 0) ? 0 : - multiply(tif, multiply(tif, TIFFhowmany(td->td_imagewidth, dx), - TIFFhowmany(td->td_imagelength, dy), - "TIFFNumberOfTiles"), - TIFFhowmany(td->td_imagedepth, dz), "TIFFNumberOfTiles"); - if (td->td_planarconfig == PLANARCONFIG_SEPARATE) - ntiles = multiply(tif, ntiles, td->td_samplesperpixel, - "TIFFNumberOfTiles"); - return (ntiles); -} - -/* - * Compute the # bytes in each row of a tile. - */ -tsize_t -TIFFTileRowSize(TIFF* tif) -{ - TIFFDirectory *td = &tif->tif_dir; - tsize_t rowsize; - - if (td->td_tilelength == 0 || td->td_tilewidth == 0) - return ((tsize_t) 0); - rowsize = multiply(tif, td->td_bitspersample, td->td_tilewidth, - "TIFFTileRowSize"); - if (td->td_planarconfig == PLANARCONFIG_CONTIG) - rowsize = multiply(tif, rowsize, td->td_samplesperpixel, - "TIFFTileRowSize"); - return ((tsize_t) TIFFhowmany8(rowsize)); -} - -/* - * Compute the # bytes in a variable length, row-aligned tile. - */ -tsize_t -TIFFVTileSize(TIFF* tif, uint32 nrows) -{ - TIFFDirectory *td = &tif->tif_dir; - tsize_t tilesize; - - if (td->td_tilelength == 0 || td->td_tilewidth == 0 || - td->td_tiledepth == 0) - return ((tsize_t) 0); -#ifdef YCBCR_SUPPORT - if (td->td_planarconfig == PLANARCONFIG_CONTIG && - td->td_photometric == PHOTOMETRIC_YCBCR && - !isUpSampled(tif)) { - /* - * Packed YCbCr data contain one Cb+Cr for every - * HorizontalSampling*VerticalSampling Y values. - * Must also roundup width and height when calculating - * since images that are not a multiple of the - * horizontal/vertical subsampling area include - * YCbCr data for the extended image. - */ - tsize_t w = - TIFFroundup(td->td_tilewidth, td->td_ycbcrsubsampling[0]); - tsize_t rowsize = - TIFFhowmany8(multiply(tif, w, td->td_bitspersample, - "TIFFVTileSize")); - tsize_t samplingarea = - td->td_ycbcrsubsampling[0]*td->td_ycbcrsubsampling[1]; - nrows = TIFFroundup(nrows, td->td_ycbcrsubsampling[1]); - /* NB: don't need TIFFhowmany here 'cuz everything is rounded */ - tilesize = multiply(tif, nrows, rowsize, "TIFFVTileSize"); - tilesize = summarize(tif, tilesize, - multiply(tif, 2, tilesize / samplingarea, - "TIFFVTileSize"), - "TIFFVTileSize"); - } else -#endif - tilesize = multiply(tif, nrows, TIFFTileRowSize(tif), - "TIFFVTileSize"); - return ((tsize_t) - multiply(tif, tilesize, td->td_tiledepth, "TIFFVTileSize")); -} - -/* - * Compute the # bytes in a row-aligned tile. - */ -tsize_t -TIFFTileSize(TIFF* tif) -{ - return (TIFFVTileSize(tif, tif->tif_dir.td_tilelength)); -} - -/* - * Compute a default tile size based on the image - * characteristics and a requested value. If a - * request is <1 then we choose a size according - * to certain heuristics. - */ -void -TIFFDefaultTileSize(TIFF* tif, uint32* tw, uint32* th) -{ - (*tif->tif_deftilesize)(tif, tw, th); -} - -void -_TIFFDefaultTileSize(TIFF* tif, uint32* tw, uint32* th) -{ - (void) tif; - if (*(int32*) tw < 1) - *tw = 256; - if (*(int32*) th < 1) - *th = 256; - /* roundup to a multiple of 16 per the spec */ - if (*tw & 0xf) - *tw = TIFFroundup(*tw, 16); - if (*th & 0xf) - *th = TIFFroundup(*th, 16); -} diff --git a/wxWidgets/src/tiff/tif_unix.c b/wxWidgets/src/tiff/tif_unix.c deleted file mode 100644 index dab65b3ced..0000000000 --- a/wxWidgets/src/tiff/tif_unix.c +++ /dev/null @@ -1,228 +0,0 @@ -/* $Header$ */ - -/* - * Copyright (c) 1988-1997 Sam Leffler - * Copyright (c) 1991-1997 Silicon Graphics, Inc. - * - * Permission to use, copy, modify, distribute, and sell this software and - * its documentation for any purpose is hereby granted without fee, provided - * that (i) the above copyright notices and this permission notice appear in - * all copies of the software and related documentation, and (ii) the names of - * Sam Leffler and Silicon Graphics may not be used in any advertising or - * publicity relating to the software without the specific, prior written - * permission of Sam Leffler and Silicon Graphics. - * - * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, - * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * - * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR - * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, - * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF - * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE - * OF THIS SOFTWARE. - */ - -/* - * TIFF Library UNIX-specific Routines. - */ -#include "tiffiop.h" -#include -#include -#include - -static tsize_t -_tiffReadProc(thandle_t fd, tdata_t buf, tsize_t size) -{ - return ((tsize_t) read((int) fd, buf, (size_t) size)); -} - -static tsize_t -_tiffWriteProc(thandle_t fd, tdata_t buf, tsize_t size) -{ - return ((tsize_t) write((int) fd, buf, (size_t) size)); -} - -static toff_t -_tiffSeekProc(thandle_t fd, toff_t off, int whence) -{ -#if USE_64BIT_API == 1 - return ((toff_t) lseek64((int) fd, (off64_t) off, whence)); -#else - return ((toff_t) lseek((int) fd, (off_t) off, whence)); -#endif -} - -static int -_tiffCloseProc(thandle_t fd) -{ - return (close((int) fd)); -} - -#include - -static toff_t -_tiffSizeProc(thandle_t fd) -{ -#ifdef _AM29K - long fsize; - return ((fsize = lseek((int) fd, 0, SEEK_END)) < 0 ? 0 : fsize); -#else -#if USE_64BIT_API == 1 - struct stat64 sb; - return (toff_t) (fstat64((int) fd, &sb) < 0 ? 0 : sb.st_size); -#else - struct stat sb; - return (toff_t) (fstat((int) fd, &sb) < 0 ? 0 : sb.st_size); -#endif -#endif -} - -#ifdef HAVE_MMAP -#include - -static int -_tiffMapProc(thandle_t fd, tdata_t* pbase, toff_t* psize) -{ - toff_t size = _tiffSizeProc(fd); - if (size != (toff_t) -1) { - *pbase = (tdata_t) - mmap(0, size, PROT_READ, MAP_SHARED, (int) fd, 0); - if (*pbase != (tdata_t) -1) { - *psize = size; - return (1); - } - } - return (0); -} - -static void -_tiffUnmapProc(thandle_t fd, tdata_t base, toff_t size) -{ - (void) fd; - (void) munmap(base, (off_t) size); -} -#else /* !HAVE_MMAP */ -static int -_tiffMapProc(thandle_t fd, tdata_t* pbase, toff_t* psize) -{ - (void) fd; (void) pbase; (void) psize; - return (0); -} - -static void -_tiffUnmapProc(thandle_t fd, tdata_t base, toff_t size) -{ - (void) fd; (void) base; (void) size; -} -#endif /* !HAVE_MMAP */ - -/* - * Open a TIFF file descriptor for read/writing. - */ -TIFF* -TIFFFdOpen(int fd, const char* name, const char* mode) -{ - TIFF* tif; - - tif = TIFFClientOpen(name, mode, - (thandle_t) fd, - _tiffReadProc, _tiffWriteProc, - _tiffSeekProc, _tiffCloseProc, _tiffSizeProc, - _tiffMapProc, _tiffUnmapProc); - if (tif) - tif->tif_fd = fd; - return (tif); -} - -/* - * Open a TIFF file for read/writing. - */ -TIFF* -TIFFOpen(const char* name, const char* mode) -{ - static const char module[] = "TIFFOpen"; - int m, fd; - - m = _TIFFgetMode(mode, module); - if (m == -1) - return ((TIFF*)0); - -/* for cygwin */ -#ifdef O_BINARY - m |= O_BINARY; -#endif - -#ifdef _AM29K - fd = open(name, m); -#else -#if USE_64BIT_API == 1 - fd = open(name, m | O_LARGEFILE, 0666); -#else - fd = open(name, m, 0666); -#endif -#endif - if (fd < 0) { - TIFFError(module, "%s: Cannot open", name); - return ((TIFF *)0); - } - return (TIFFFdOpen(fd, name, mode)); -} - -void* -_TIFFmalloc(tsize_t s) -{ - return (malloc((size_t) s)); -} - -void -_TIFFfree(tdata_t p) -{ - free(p); -} - -void* -_TIFFrealloc(tdata_t p, tsize_t s) -{ - return (realloc(p, (size_t) s)); -} - -void -_TIFFmemset(tdata_t p, int v, tsize_t c) -{ - memset(p, v, (size_t) c); -} - -void -_TIFFmemcpy(tdata_t d, const tdata_t s, tsize_t c) -{ - memcpy(d, s, (size_t) c); -} - -int -_TIFFmemcmp(const tdata_t p1, const tdata_t p2, tsize_t c) -{ - return (memcmp(p1, p2, (size_t) c)); -} - -static void -unixWarningHandler(const char* module, const char* fmt, va_list ap) -{ - if (module != NULL) - fprintf(stderr, "%s: ", module); - fprintf(stderr, "Warning, "); - vfprintf(stderr, fmt, ap); - fprintf(stderr, ".\n"); -} -TIFFErrorHandler _TIFFwarningHandler = unixWarningHandler; - -static void -unixErrorHandler(const char* module, const char* fmt, va_list ap) -{ - if (module != NULL) - fprintf(stderr, "%s: ", module); - vfprintf(stderr, fmt, ap); - fprintf(stderr, ".\n"); -} -TIFFErrorHandler _TIFFerrorHandler = unixErrorHandler; diff --git a/wxWidgets/src/tiff/tif_version.c b/wxWidgets/src/tiff/tif_version.c deleted file mode 100644 index 2b8ccf7708..0000000000 --- a/wxWidgets/src/tiff/tif_version.c +++ /dev/null @@ -1,33 +0,0 @@ -/* $Header$ */ -/* - * Copyright (c) 1992-1997 Sam Leffler - * Copyright (c) 1992-1997 Silicon Graphics, Inc. - * - * Permission to use, copy, modify, distribute, and sell this software and - * its documentation for any purpose is hereby granted without fee, provided - * that (i) the above copyright notices and this permission notice appear in - * all copies of the software and related documentation, and (ii) the names of - * Sam Leffler and Silicon Graphics may not be used in any advertising or - * publicity relating to the software without the specific, prior written - * permission of Sam Leffler and Silicon Graphics. - * - * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, - * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * - * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR - * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, - * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF - * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE - * OF THIS SOFTWARE. - */ -#include "tiffiop.h" - -static const char TIFFVersion[] = TIFFLIB_VERSION_STR; - -const char* -TIFFGetVersion(void) -{ - return (TIFFVersion); -} diff --git a/wxWidgets/src/tiff/tif_vms.c b/wxWidgets/src/tiff/tif_vms.c deleted file mode 100644 index 783b6539aa..0000000000 --- a/wxWidgets/src/tiff/tif_vms.c +++ /dev/null @@ -1,588 +0,0 @@ -/* $Header$ */ - -/* - * Copyright (c) 1988-1997 Sam Leffler - * Copyright (c) 1991-1997 Silicon Graphics, Inc. - * - * Permission to use, copy, modify, distribute, and sell this software and - * its documentation for any purpose is hereby granted without fee, provided - * that (i) the above copyright notices and this permission notice appear in - * all copies of the software and related documentation, and (ii) the names of - * Sam Leffler and Silicon Graphics may not be used in any advertising or - * publicity relating to the software without the specific, prior written - * permission of Sam Leffler and Silicon Graphics. - * - * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, - * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * - * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR - * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, - * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF - * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE - * OF THIS SOFTWARE. - */ - -/* - * TIFF Library VMS-specific Routines. - */ - -#include -#include -#include "tiffiop.h" -#if !HAVE_IEEEFP -#include -#endif - -#ifdef VAXC -#define NOSHARE noshare -#else -#define NOSHARE -#endif - -#ifdef __alpha -/* Dummy entry point for backwards compatibility */ -void TIFFModeCCITTFax3(void){} -#endif - -static tsize_t -_tiffReadProc(thandle_t fd, tdata_t buf, tsize_t size) -{ - return (read((int) fd, buf, size)); -} - -static tsize_t -_tiffWriteProc(thandle_t fd, tdata_t buf, tsize_t size) -{ - return (write((int) fd, buf, size)); -} - -static toff_t -_tiffSeekProc(thandle_t fd, toff_t off, int whence) -{ - return ((toff_t) lseek((int) fd, (off_t) off, whence)); -} - -static int -_tiffCloseProc(thandle_t fd) -{ - return (close((int) fd)); -} - -#include - -static toff_t -_tiffSizeProc(thandle_t fd) -{ - struct stat sb; - return (toff_t) (fstat((int) fd, &sb) < 0 ? 0 : sb.st_size); -} - -#ifdef HAVE_MMAP -#include -#include -#include - -/* - * Table for storing information on current open sections. - * (Should really be a linked list) - */ -#define MAX_MAPPED 100 -static int no_mapped = 0; -static struct { - char *base; - char *top; - unsigned short channel; -} map_table[MAX_MAPPED]; - -/* - * This routine maps a file into a private section. Note that this - * method of accessing a file is by far the fastest under VMS. - * The routine may fail (i.e. return 0) for several reasons, for - * example: - * - There is no more room for storing the info on sections. - * - The process is out of open file quota, channels, ... - * - fd does not describe an opened file. - * - The file is already opened for write access by this process - * or another process - * - There is no free "hole" in virtual memory that fits the - * size of the file - */ -static int -_tiffMapProc(thandle_t fd, tdata_t* pbase, toff_t* psize) -{ - char name[256]; - struct FAB fab; - unsigned short channel; - char *inadr[2], *retadr[2]; - unsigned long status; - long size; - - if (no_mapped >= MAX_MAPPED) - return(0); - /* - * We cannot use a file descriptor, we - * must open the file once more. - */ - if (getname((int)fd, name, 1) == NULL) - return(0); - /* prepare the FAB for a user file open */ - fab = cc$rms_fab; - fab.fab$l_fop |= FAB$V_UFO; - fab.fab$b_fac = FAB$M_GET; - fab.fab$b_shr = FAB$M_SHRGET; - fab.fab$l_fna = name; - fab.fab$b_fns = strlen(name); - status = sys$open(&fab); /* open file & get channel number */ - if ((status&1) == 0) - return(0); - channel = (unsigned short)fab.fab$l_stv; - inadr[0] = inadr[1] = (char *)0; /* just an address in P0 space */ - /* - * Map the blocks of the file up to - * the EOF block into virtual memory. - */ - size = _tiffSizeProc(fd); - status = sys$crmpsc(inadr, retadr, 0, SEC$M_EXPREG, 0,0,0, channel, - TIFFhowmany(size,512), 0,0,0); - if ((status&1) == 0){ - sys$dassgn(channel); - return(0); - } - *pbase = (tdata_t) retadr[0]; /* starting virtual address */ - /* - * Use the size of the file up to the - * EOF mark for UNIX compatibility. - */ - *psize = (toff_t) size; - /* Record the section in the table */ - map_table[no_mapped].base = retadr[0]; - map_table[no_mapped].top = retadr[1]; - map_table[no_mapped].channel = channel; - no_mapped++; - - return(1); -} - -/* - * This routine unmaps a section from the virtual address space of - * the process, but only if the base was the one returned from a - * call to TIFFMapFileContents. - */ -static void -_tiffUnmapProc(thandle_t fd, tdata_t base, toff_t size) -{ - char *inadr[2]; - int i, j; - - /* Find the section in the table */ - for (i = 0;i < no_mapped; i++) { - if (map_table[i].base == (char *) base) { - /* Unmap the section */ - inadr[0] = (char *) base; - inadr[1] = map_table[i].top; - sys$deltva(inadr, 0, 0); - sys$dassgn(map_table[i].channel); - /* Remove this section from the list */ - for (j = i+1; j < no_mapped; j++) - map_table[j-1] = map_table[j]; - no_mapped--; - return; - } - } -} -#else /* !HAVE_MMAP */ -static int -_tiffMapProc(thandle_t fd, tdata_t* pbase, toff_t* psize) -{ - return (0); -} - -static void -_tiffUnmapProc(thandle_t fd, tdata_t base, toff_t size) -{ -} -#endif /* !HAVE_MMAP */ - -/* - * Open a TIFF file descriptor for read/writing. - */ -TIFF* -TIFFFdOpen(int fd, const char* name, const char* mode) -{ - TIFF* tif; - - tif = TIFFClientOpen(name, mode, - (thandle_t) fd, - _tiffReadProc, _tiffWriteProc, _tiffSeekProc, _tiffCloseProc, - _tiffSizeProc, _tiffMapProc, _tiffUnmapProc); - if (tif) - tif->tif_fd = fd; - return (tif); -} - -/* - * Open a TIFF file for read/writing. - */ -TIFF* -TIFFOpen(const char* name, const char* mode) -{ - static const char module[] = "TIFFOpen"; - int m, fd; - - m = _TIFFgetMode(mode, module); - if (m == -1) - return ((TIFF*)0); - if (m&O_TRUNC){ - /* - * There is a bug in open in VAXC. If you use - * open w/ m=O_RDWR|O_CREAT|O_TRUNC the - * wrong thing happens. On the other hand - * creat does the right thing. - */ - fd = creat((char *) /* bug in stdio.h */ name, 0666, - "alq = 128", "deq = 64", "mbc = 32", - "fop = tef"); - } else if (m&O_RDWR) { - fd = open(name, m, 0666, - "deq = 64", "mbc = 32", "fop = tef", "ctx = stm"); - } else - fd = open(name, m, 0666, "mbc = 32", "ctx = stm"); - if (fd < 0) { - TIFFError(module, "%s: Cannot open", name); - return ((TIFF*)0); - } - return (TIFFFdOpen(fd, name, mode)); -} - -tdata_t -_TIFFmalloc(tsize_t s) -{ - return (malloc((size_t) s)); -} - -void -_TIFFfree(tdata_t p) -{ - free(p); -} - -tdata_t -_TIFFrealloc(tdata_t p, tsize_t s) -{ - return (realloc(p, (size_t) s)); -} - -void -_TIFFmemset(tdata_t p, int v, tsize_t c) -{ - memset(p, v, (size_t) c); -} - -void -_TIFFmemcpy(tdata_t d, const tdata_t s, tsize_t c) -{ - memcpy(d, s, (size_t) c); -} - -int -_TIFFmemcmp(const tdata_t p1, const tdata_t p2, tsize_t c) -{ - return (memcmp(p1, p2, (size_t) c)); -} - -/* - * On the VAX, we need to make those global, writable pointers - * non-shareable, otherwise they would be made shareable by default. - * On the AXP, this brain damage has been corrected. - * - * I (Karsten Spang, krs@kampsax.dk) have dug around in the GCC - * manual and the GAS code and have come up with the following - * construct, but I don't have GCC on my VAX, so it is untested. - * Please tell me if it does not work. - */ - -static void -vmsWarningHandler(const char* module, const char* fmt, va_list ap) -{ - if (module != NULL) - fprintf(stderr, "%s: ", module); - fprintf(stderr, "Warning, "); - vfprintf(stderr, fmt, ap); - fprintf(stderr, ".\n"); -} - -NOSHARE TIFFErrorHandler _TIFFwarningHandler = vmsWarningHandler -#if defined(VAX) && defined(__GNUC__) -asm("_$$PsectAttributes_NOSHR$$_TIFFwarningHandler") -#endif -; - -static void -vmsErrorHandler(const char* module, const char* fmt, va_list ap) -{ - if (module != NULL) - fprintf(stderr, "%s: ", module); - vfprintf(stderr, fmt, ap); - fprintf(stderr, ".\n"); -} - -NOSHARE TIFFErrorHandler _TIFFerrorHandler = vmsErrorHandler -#if defined(VAX) && defined(__GNUC__) -asm("_$$PsectAttributes_NOSHR$$_TIFFerrorHandler") -#endif -; - - -#if !HAVE_IEEEFP -/* IEEE floting point handling */ - -typedef struct ieeedouble { - u_long mant2; /* fix NDR: full 8-byte swap */ - u_long mant : 20, - exp : 11, - sign : 1; -} ieeedouble; -typedef struct ieeefloat { - u_long mant : 23, - exp : 8, - sign : 1; -} ieeefloat; - -/* - * NB: These are D_FLOAT's, not G_FLOAT's. A G_FLOAT is - * simply a reverse-IEEE float/double. - */ - -typedef struct { - u_long mant1 : 7, - exp : 8, - sign : 1, - mant2 : 16, - mant3 : 16, - mant4 : 16; -} nativedouble; -typedef struct { - u_long mant1 : 7, - exp : 8, - sign : 1, - mant2 : 16; -} nativefloat; - -typedef union { - ieeedouble ieee; - nativedouble native; - char b[8]; - uint32 l[2]; - double d; -} double_t; - -typedef union { - ieeefloat ieee; - nativefloat native; - char b[4]; - uint32 l; - float f; -} float_t; - -#if defined(VAXC) || defined(DECC) -#pragma inline(ieeetod,dtoieee) -#endif - -/* - * Convert an IEEE double precision number to native double precision. - * The source is contained in two longwords, the second holding the sign, - * exponent and the higher order bits of the mantissa, and the first - * holding the rest of the mantissa as follows: - * (Note: It is assumed that the number has been eight-byte swapped to - * LSB first.) - * - * First longword: - * 32 least significant bits of mantissa - * Second longword: - * 0-19: 20 most significant bits of mantissa - * 20-30: exponent - * 31: sign - * The exponent is stored as excess 1023. - * The most significant bit of the mantissa is implied 1, and not stored. - * If the exponent and mantissa are zero, the number is zero. - * If the exponent is 0 (i.e. -1023) and the mantissa is non-zero, it is an - * unnormalized number with the most significant bit NOT implied. - * If the exponent is 2047, the number is invalid, in case the mantissa is zero, - * this means overflow (+/- depending of the sign bit), otherwise - * it simply means invalid number. - * - * If the number is too large for the machine or was specified as overflow, - * +/-HUGE_VAL is returned. - */ -INLINE static void -ieeetod(double *dp) -{ - double_t source; - long sign,exp,mant; - double dmant; - - source.ieee = ((double_t*)dp)->ieee; - sign = source.ieee.sign; - exp = source.ieee.exp; - mant = source.ieee.mant; - - if (exp == 2047) { - if (mant) /* Not a Number (NAN) */ - *dp = HUGE_VAL; - else /* +/- infinity */ - *dp = (sign ? -HUGE_VAL : HUGE_VAL); - return; - } - if (!exp) { - if (!(mant || source.ieee.mant2)) { /* zero */ - *dp=0; - return; - } else { /* Unnormalized number */ - /* NB: not -1023, the 1 bit is not implied */ - exp= -1022; - } - } else { - mant |= 1<<20; - exp -= 1023; - } - dmant = (((double) mant) + - ((double) source.ieee.mant2) / (((double) (1<<16)) * - ((double) (1<<16)))) / (double) (1<<20); - dmant = ldexp(dmant, exp); - if (sign) - dmant= -dmant; - *dp = dmant; -} - -INLINE static void -dtoieee(double *dp) -{ - double_t num; - double x; - int exp; - - num.d = *dp; - if (!num.d) { /* Zero is just binary all zeros */ - num.l[0] = num.l[1] = 0; - return; - } - - if (num.d < 0) { /* Sign is encoded separately */ - num.d = -num.d; - num.ieee.sign = 1; - } else { - num.ieee.sign = 0; - } - - /* Now separate the absolute value into mantissa and exponent */ - x = frexp(num.d, &exp); - - /* - * Handle cases where the value is outside the - * range for IEEE floating point numbers. - * (Overflow cannot happen on a VAX, but underflow - * can happen for G float.) - */ - if (exp < -1022) { /* Unnormalized number */ - x = ldexp(x, -1023-exp); - exp = 0; - } else if (exp > 1023) { /* +/- infinity */ - x = 0; - exp = 2047; - } else { /* Get rid of most significant bit */ - x *= 2; - x -= 1; - exp += 1022; /* fix NDR: 1.0 -> x=0.5, exp=1 -> ieee.exp = 1023 */ - } - num.ieee.exp = exp; - - x *= (double) (1<<20); - num.ieee.mant = (long) x; - x -= (double) num.ieee.mant; - num.ieee.mant2 = (long) (x*((double) (1<<16)*(double) (1<<16))); - - if (!(num.ieee.mant || num.ieee.exp || num.ieee.mant2)) { - /* Avoid negative zero */ - num.ieee.sign = 0; - } - ((double_t*)dp)->ieee = num.ieee; -} - -/* - * Beware, these do not handle over/under-flow - * during conversion from ieee to native format. - */ -#define NATIVE2IEEEFLOAT(fp) { \ - float_t t; \ - if (t.ieee.exp = (fp)->native.exp) \ - t.ieee.exp += -129 + 127; \ - t.ieee.sign = (fp)->native.sign; \ - t.ieee.mant = ((fp)->native.mant1<<16)|(fp)->native.mant2; \ - *(fp) = t; \ -} -#define IEEEFLOAT2NATIVE(fp) { \ - float_t t; int v = (fp)->ieee.exp; \ - if (v) v += -127 + 129; /* alter bias of exponent */\ - t.native.exp = v; /* implicit truncation of exponent */\ - t.native.sign = (fp)->ieee.sign; \ - v = (fp)->ieee.mant; \ - t.native.mant1 = v >> 16; \ - t.native.mant2 = v;\ - *(fp) = t; \ -} - -#define IEEEDOUBLE2NATIVE(dp) ieeetod(dp) - -#define NATIVE2IEEEDOUBLE(dp) dtoieee(dp) - - -/* - * These unions are used during floating point - * conversions. The above macros define the - * conversion operations. - */ -void -TIFFCvtIEEEFloatToNative(TIFF* tif, u_int n, float* f) -{ - float_t* fp = (float_t*) f; - - while (n-- > 0) { - IEEEFLOAT2NATIVE(fp); - fp++; - } -} - -void -TIFFCvtNativeToIEEEFloat(TIFF* tif, u_int n, float* f) -{ - float_t* fp = (float_t*) f; - - while (n-- > 0) { - NATIVE2IEEEFLOAT(fp); - fp++; - } -} -void -TIFFCvtIEEEDoubleToNative(TIFF* tif, u_int n, double* f) -{ - double_t* fp = (double_t*) f; - - while (n-- > 0) { - IEEEDOUBLE2NATIVE(fp); - fp++; - } -} - -void -TIFFCvtNativeToIEEEDouble(TIFF* tif, u_int n, double* f) -{ - double_t* fp = (double_t*) f; - - while (n-- > 0) { - NATIVE2IEEEDOUBLE(fp); - fp++; - } -} -#endif diff --git a/wxWidgets/src/tiff/tif_warning.c b/wxWidgets/src/tiff/tif_warning.c deleted file mode 100644 index d542690e4e..0000000000 --- a/wxWidgets/src/tiff/tif_warning.c +++ /dev/null @@ -1,49 +0,0 @@ -/* $Header$ */ - -/* - * Copyright (c) 1988-1997 Sam Leffler - * Copyright (c) 1991-1997 Silicon Graphics, Inc. - * - * Permission to use, copy, modify, distribute, and sell this software and - * its documentation for any purpose is hereby granted without fee, provided - * that (i) the above copyright notices and this permission notice appear in - * all copies of the software and related documentation, and (ii) the names of - * Sam Leffler and Silicon Graphics may not be used in any advertising or - * publicity relating to the software without the specific, prior written - * permission of Sam Leffler and Silicon Graphics. - * - * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, - * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * - * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR - * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, - * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF - * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE - * OF THIS SOFTWARE. - */ - -/* - * TIFF Library. - */ -#include "tiffiop.h" - -TIFFErrorHandler -TIFFSetWarningHandler(TIFFErrorHandler handler) -{ - TIFFErrorHandler prev = _TIFFwarningHandler; - _TIFFwarningHandler = handler; - return (prev); -} - -void -TIFFWarning(const char* module, const char* fmt, ...) -{ - if (_TIFFwarningHandler) { - va_list ap; - va_start(ap, fmt); - (*_TIFFwarningHandler)(module, fmt, ap); - va_end(ap); - } -} diff --git a/wxWidgets/src/tiff/tif_win3.c b/wxWidgets/src/tiff/tif_win3.c deleted file mode 100644 index a540f1126a..0000000000 --- a/wxWidgets/src/tiff/tif_win3.c +++ /dev/null @@ -1,225 +0,0 @@ -/* $Header$ */ - -/* - * Copyright (c) 1988-1997 Sam Leffler - * Copyright (c) 1991-1997 Silicon Graphics, Inc. - * - * Permission to use, copy, modify, distribute, and sell this software and - * its documentation for any purpose is hereby granted without fee, provided - * that (i) the above copyright notices and this permission notice appear in - * all copies of the software and related documentation, and (ii) the names of - * Sam Leffler and Silicon Graphics may not be used in any advertising or - * publicity relating to the software without the specific, prior written - * permission of Sam Leffler and Silicon Graphics. - * - * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, - * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * - * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR - * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, - * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF - * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE - * OF THIS SOFTWARE. - */ - -/* - * TIFF Library Windows 3.x-specific Routines. - */ -#include "tiffiop.h" -#if defined(__WATCOMC__) || defined(__BORLANDC__) || defined(_MSC_VER) -#include /* for open, close, etc. function prototypes */ -#endif - -#include -#include -#include - -static tsize_t -_tiffReadProc(thandle_t fd, tdata_t buf, tsize_t size) -{ - return (_hread(fd, buf, size)); -} - -static tsize_t -_tiffWriteProc(thandle_t fd, tdata_t buf, tsize_t size) -{ - return (_hwrite(fd, buf, size)); -} - -static toff_t -_tiffSeekProc(thandle_t fd, toff_t off, int whence) -{ - return (_llseek(fd, (off_t) off, whence)); -} - -static int -_tiffCloseProc(thandle_t fd) -{ - return (_lclose(fd)); -} - -#include - -static toff_t -_tiffSizeProc(thandle_t fd) -{ - struct stat sb; - return (fstat((int) fd, &sb) < 0 ? 0 : sb.st_size); -} - -static int -_tiffMapProc(thandle_t fd, tdata_t* pbase, toff_t* psize) -{ - return (0); -} - -static void -_tiffUnmapProc(thandle_t fd, tdata_t base, toff_t size) -{ -} - -/* - * Open a TIFF file descriptor for read/writing. - */ -TIFF* -TIFFFdOpen(int fd, const char* name, const char* mode) -{ - TIFF* tif; - - tif = TIFFClientOpen(name, mode, - (thandle_t) fd, - _tiffReadProc, _tiffWriteProc, _tiffSeekProc, _tiffCloseProc, - _tiffSizeProc, _tiffMapProc, _tiffUnmapProc); - if (tif) - tif->tif_fd = fd; - return (tif); -} - -/* - * Open a TIFF file for read/writing. - */ -TIFF* -TIFFOpen(const char* name, const char* mode) -{ - static const char module[] = "TIFFOpen"; - int m, fd; - OFSTRUCT of; - int mm = 0; - - m = _TIFFgetMode(mode, module); - if (m == -1) - return ((TIFF*)0); - if (m & O_CREAT) { - if ((m & O_TRUNC) || OpenFile(name, &of, OF_EXIST) != HFILE_ERROR) - mm |= OF_CREATE; - } - if (m & O_WRONLY) - mm |= OF_WRITE; - if (m & O_RDWR) - mm |= OF_READWRITE; - fd = OpenFile(name, &of, mm); - if (fd < 0) { - TIFFError(module, "%s: Cannot open", name); - return ((TIFF*)0); - } - return (TIFFFdOpen(fd, name, mode)); -} - -tdata_t -_TIFFmalloc(tsize_t s) -{ - return (tdata_t) GlobalAllocPtr(GHND, (DWORD) s); -} - -void -_TIFFfree(tdata_t p) -{ - GlobalFreePtr(p); -} - -tdata_t -_TIFFrealloc(tdata_t p, tsize_t s) -{ - return (tdata_t) GlobalReAllocPtr(p, (DWORD) s, GHND); -} - -void -_TIFFmemset(tdata_t p, int v, tsize_t c) -{ - char* pp = (char*) p; - - while (c > 0) { - tsize_t chunk = 0x10000 - ((uint32) pp & 0xffff);/* What's left in segment */ - if (chunk > 0xff00) /* No more than 0xff00 */ - chunk = 0xff00; - if (chunk > c) /* No more than needed */ - chunk = c; - memset(pp, v, chunk); - pp = (char*) (chunk + (char huge*) pp); - c -= chunk; - } -} - -void -_TIFFmemcpy(tdata_t d, const tdata_t s, tsize_t c) -{ - if (c > 0xFFFF) - hmemcpy((void _huge*) d, (void _huge*) s, c); - else - (void) memcpy(d, s, (size_t) c); -} - -int -_TIFFmemcmp(const tdata_t d, const tdata_t s, tsize_t c) -{ - char* dd = (char*) d; - char* ss = (char*) s; - tsize_t chunks, chunkd, chunk; - int result; - - while (c > 0) { - chunks = 0x10000 - ((uint32) ss & 0xffff); /* What's left in segment */ - chunkd = 0x10000 - ((uint32) dd & 0xffff); /* What's left in segment */ - chunk = c; /* Get the largest of */ - if (chunk > chunks) /* c, chunks, chunkd, */ - chunk = chunks; /* 0xff00 */ - if (chunk > chunkd) - chunk = chunkd; - if (chunk > 0xff00) - chunk = 0xff00; - result = memcmp(dd, ss, chunk); - if (result != 0) - return (result); - dd = (char*) (chunk + (char huge*) dd); - ss = (char*) (chunk + (char huge*) ss); - c -= chunk; - } - return (0); -} - -static void -win3WarningHandler(const char* module, const char* fmt, va_list ap) -{ - char e[512] = { '\0' }; - if (module != NULL) - strcat(strcpy(e, module), ":"); - vsprintf(e+strlen(e), fmt, ap); - strcat(e, "."); - MessageBox(GetActiveWindow(), e, "LibTIFF Warning", - MB_OK|MB_ICONEXCLAMATION); -} -TIFFErrorHandler _TIFFwarningHandler = win3WarningHandler; - -static void -win3ErrorHandler(const char* module, const char* fmt, va_list ap) -{ - char e[512] = { '\0' }; - if (module != NULL) - strcat(strcpy(e, module), ":"); - vsprintf(e+strlen(e), fmt, ap); - strcat(e, "."); - MessageBox(GetActiveWindow(), e, "LibTIFF Error", MB_OK|MB_ICONSTOP); -} -TIFFErrorHandler _TIFFerrorHandler = win3ErrorHandler; diff --git a/wxWidgets/src/tiff/tif_win32.c b/wxWidgets/src/tiff/tif_win32.c deleted file mode 100644 index 943c22b48f..0000000000 --- a/wxWidgets/src/tiff/tif_win32.c +++ /dev/null @@ -1,329 +0,0 @@ -/* $Header$ */ - -/* - * Copyright (c) 1988-1997 Sam Leffler - * Copyright (c) 1991-1997 Silicon Graphics, Inc. - * - * Permission to use, copy, modify, distribute, and sell this software and - * its documentation for any purpose is hereby granted without fee, provided - * that (i) the above copyright notices and this permission notice appear in - * all copies of the software and related documentation, and (ii) the names of - * Sam Leffler and Silicon Graphics may not be used in any advertising or - * publicity relating to the software without the specific, prior written - * permission of Sam Leffler and Silicon Graphics. - * - * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, - * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * - * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR - * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, - * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF - * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE - * OF THIS SOFTWARE. - */ - -/* - * TIFF Library Win32-specific Routines. Adapted from tif_unix.c 4/5/95 by - * Scott Wagner (wagner@itek.com), Itek Graphix, Rochester, NY USA - */ -#include -#include "tiffiop.h" - -static tsize_t -_tiffReadProc(thandle_t fd, tdata_t buf, tsize_t size) -{ - DWORD dwSizeRead; - if (!ReadFile(fd, buf, size, &dwSizeRead, NULL)) - return(0); - return ((tsize_t) dwSizeRead); -} - -static tsize_t -_tiffWriteProc(thandle_t fd, tdata_t buf, tsize_t size) -{ - DWORD dwSizeWritten; - if (!WriteFile(fd, buf, size, &dwSizeWritten, NULL)) - return(0); - return ((tsize_t) dwSizeWritten); -} - -static toff_t -_tiffSeekProc(thandle_t fd, toff_t off, int whence) -{ - DWORD dwMoveMethod, dwMoveHigh; - - /* we use this as a special code, so avoid accepting it */ - if( off == 0xFFFFFFFF ) - return 0xFFFFFFFF; - - switch(whence) - { - case SEEK_SET: - dwMoveMethod = FILE_BEGIN; - break; - case SEEK_CUR: - dwMoveMethod = FILE_CURRENT; - break; - case SEEK_END: - dwMoveMethod = FILE_END; - break; - default: - dwMoveMethod = FILE_BEGIN; - break; - } - dwMoveHigh = 0; - return ((toff_t)SetFilePointer(fd, (LONG) off, (PLONG)&dwMoveHigh, - dwMoveMethod)); -} - -static int -_tiffCloseProc(thandle_t fd) -{ - return (CloseHandle(fd) ? 0 : -1); -} - -static toff_t -_tiffSizeProc(thandle_t fd) -{ - return ((toff_t)GetFileSize(fd, NULL)); -} - -#ifdef __BORLANDC__ -#pragma argsused -#endif -static int -_tiffDummyMapProc(thandle_t fd, tdata_t* pbase, toff_t* psize) -{ - return (0); -} - -/* - * From "Hermann Josef Hill" : - * - * Windows uses both a handle and a pointer for file mapping, - * but according to the SDK documentation and Richter's book - * "Advanced Windows Programming" it is safe to free the handle - * after obtaining the file mapping pointer - * - * This removes a nasty OS dependency and cures a problem - * with Visual C++ 5.0 - */ -static int -_tiffMapProc(thandle_t fd, tdata_t* pbase, toff_t* psize) -{ - toff_t size; - HANDLE hMapFile; - - if ((size = _tiffSizeProc(fd)) == 0xFFFFFFFF) - return (0); - hMapFile = CreateFileMapping(fd, NULL, PAGE_READONLY, 0, size, NULL); - if (hMapFile == NULL) - return (0); - *pbase = MapViewOfFile(hMapFile, FILE_MAP_READ, 0, 0, 0); - CloseHandle(hMapFile); - if (*pbase == NULL) - return (0); - *psize = size; - return(1); -} - -#ifdef __BORLANDC__ -#pragma argsused -#endif -static void -_tiffDummyUnmapProc(thandle_t fd, tdata_t base, toff_t size) -{ -} - -static void -_tiffUnmapProc(thandle_t fd, tdata_t base, toff_t size) -{ - UnmapViewOfFile(base); -} - -/* - * Open a TIFF file descriptor for read/writing. - * Note that TIFFFdOpen and TIFFOpen recognise the character 'u' in the mode - * string, which forces the file to be opened unmapped. - */ -TIFF* -TIFFFdOpen(int ifd, const char* name, const char* mode) -{ - TIFF* tif; - BOOL fSuppressMap = (mode[1] == 'u' || (mode[1]!=0 && mode[2] == 'u')); - - tif = TIFFClientOpen(name, mode, - (thandle_t)ifd, - _tiffReadProc, _tiffWriteProc, - _tiffSeekProc, _tiffCloseProc, _tiffSizeProc, - fSuppressMap ? _tiffDummyMapProc : _tiffMapProc, - fSuppressMap ? _tiffDummyUnmapProc : _tiffUnmapProc); - if (tif) - tif->tif_fd = ifd; - return (tif); -} - -/* - * Open a TIFF file for read/writing. - */ -TIFF* -TIFFOpen(const char* name, const char* mode) -{ - static const char module[] = "TIFFOpen"; - thandle_t fd; - int m; - DWORD dwMode; - - m = _TIFFgetMode(mode, module); - - switch(m) - { - case O_RDONLY: - dwMode = OPEN_EXISTING; - break; - case O_RDWR: - dwMode = OPEN_ALWAYS; - break; - case O_RDWR|O_CREAT: - dwMode = OPEN_ALWAYS; - break; - case O_RDWR|O_TRUNC: - dwMode = CREATE_ALWAYS; - break; - case O_RDWR|O_CREAT|O_TRUNC: - dwMode = CREATE_ALWAYS; - break; - default: - return ((TIFF*)0); - } - fd = (thandle_t)CreateFile(name, (m == O_RDONLY) ? GENERIC_READ : - (GENERIC_READ | GENERIC_WRITE), FILE_SHARE_READ, NULL, dwMode, - (m == O_RDONLY) ? FILE_ATTRIBUTE_READONLY : FILE_ATTRIBUTE_NORMAL, NULL); - if (fd == INVALID_HANDLE_VALUE) { - TIFFError(module, "%s: Cannot open", name); - return ((TIFF *)0); - } - return (TIFFFdOpen((int)fd, name, mode)); -} - -tdata_t -_TIFFmalloc(tsize_t s) -{ - return ((tdata_t)GlobalAlloc(GMEM_FIXED, s)); -} - -void -_TIFFfree(tdata_t p) -{ - GlobalFree(p); - return; -} - -tdata_t -_TIFFrealloc(tdata_t p, tsize_t s) -{ - void* pvTmp; - tsize_t old; - - if(p == NULL) - return ((tdata_t)GlobalAlloc(GMEM_FIXED, s)); - - old = GlobalSize(p); - - if (old>=s) - { - if ((pvTmp = GlobalAlloc(GMEM_FIXED, s)) != NULL) { - CopyMemory(pvTmp, p, s); - GlobalFree(p); - } - } - else - { - if ((pvTmp = GlobalAlloc(GMEM_FIXED, s)) != NULL) { - CopyMemory(pvTmp, p, old); - GlobalFree(p); - } - } - return ((tdata_t)pvTmp); -} - -void -_TIFFmemset(void* p, int v, tsize_t c) -{ - FillMemory(p, c, (BYTE)v); -} - -void -_TIFFmemcpy(void* d, const tdata_t s, tsize_t c) -{ - CopyMemory(d, s, c); -} - -int -_TIFFmemcmp(const tdata_t p1, const tdata_t p2, tsize_t c) -{ - register const BYTE *pb1 = (const BYTE *) p1; - register const BYTE *pb2 = (const BYTE *) p2; - register DWORD dwTmp = c; - register int iTmp; - for (iTmp = 0; dwTmp-- && !iTmp; iTmp = (int)*pb1++ - (int)*pb2++) - ; - return (iTmp); -} - -static void -Win32WarningHandler(const char* module, const char* fmt, va_list ap) -{ -#ifndef TIF_PLATFORM_CONSOLE - LPTSTR szTitle; - LPTSTR szTmp; - LPCTSTR szTitleText = "%s Warning"; - LPCTSTR szDefaultModule = "TIFFLIB"; - szTmp = (module == NULL) ? (LPTSTR)szDefaultModule : (LPTSTR)module; - if ((szTitle = (LPTSTR)LocalAlloc(LMEM_FIXED, (lstrlen(szTmp) + - lstrlen(szTitleText) + lstrlen(fmt) + 128)*sizeof(TCHAR))) == NULL) - return; - wsprintf(szTitle, szTitleText, szTmp); - szTmp = szTitle + (lstrlen(szTitle)+2)*sizeof(TCHAR); - wvsprintf(szTmp, fmt, ap); - MessageBox(GetFocus(), szTmp, szTitle, MB_OK | MB_ICONINFORMATION); - LocalFree(szTitle); - return; -#else - if (module != NULL) - fprintf(stderr, "%s: ", module); - fprintf(stderr, "Warning, "); - vfprintf(stderr, fmt, ap); - fprintf(stderr, ".\n"); -#endif -} -TIFFErrorHandler _TIFFwarningHandler = Win32WarningHandler; - -static void -Win32ErrorHandler(const char* module, const char* fmt, va_list ap) -{ -#ifndef TIF_PLATFORM_CONSOLE - LPTSTR szTitle; - LPTSTR szTmp; - LPCTSTR szTitleText = "%s Error"; - LPCTSTR szDefaultModule = "TIFFLIB"; - szTmp = (module == NULL) ? (LPTSTR)szDefaultModule : (LPTSTR)module; - if ((szTitle = (LPTSTR)LocalAlloc(LMEM_FIXED, (lstrlen(szTmp) + - lstrlen(szTitleText) + lstrlen(fmt) + 128)*sizeof(TCHAR))) == NULL) - return; - wsprintf(szTitle, szTitleText, szTmp); - szTmp = szTitle + (lstrlen(szTitle)+2)*sizeof(TCHAR); - wvsprintf(szTmp, fmt, ap); - MessageBox(GetFocus(), szTmp, szTitle, MB_OK | MB_ICONEXCLAMATION); - LocalFree(szTitle); - return; -#else - if (module != NULL) - fprintf(stderr, "%s: ", module); - vfprintf(stderr, fmt, ap); - fprintf(stderr, ".\n"); -#endif -} -TIFFErrorHandler _TIFFerrorHandler = Win32ErrorHandler; diff --git a/wxWidgets/src/tiff/tif_write.c b/wxWidgets/src/tiff/tif_write.c deleted file mode 100644 index 7b8cab50ce..0000000000 --- a/wxWidgets/src/tiff/tif_write.c +++ /dev/null @@ -1,703 +0,0 @@ -/* $Header$ */ - -/* - * Copyright (c) 1988-1997 Sam Leffler - * Copyright (c) 1991-1997 Silicon Graphics, Inc. - * - * Permission to use, copy, modify, distribute, and sell this software and - * its documentation for any purpose is hereby granted without fee, provided - * that (i) the above copyright notices and this permission notice appear in - * all copies of the software and related documentation, and (ii) the names of - * Sam Leffler and Silicon Graphics may not be used in any advertising or - * publicity relating to the software without the specific, prior written - * permission of Sam Leffler and Silicon Graphics. - * - * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, - * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * - * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR - * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, - * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF - * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE - * OF THIS SOFTWARE. - */ - -/* - * TIFF Library. - * - * Scanline-oriented Write Support - */ -#include "tiffiop.h" -#include -#include - -#define REWRITE_HACK - -#define STRIPINCR 20 /* expansion factor on strip array */ - -#define WRITECHECKSTRIPS(tif, module) \ - (((tif)->tif_flags&TIFF_BEENWRITING) || TIFFWriteCheck((tif),0,module)) -#define WRITECHECKTILES(tif, module) \ - (((tif)->tif_flags&TIFF_BEENWRITING) || TIFFWriteCheck((tif),1,module)) -#define BUFFERCHECK(tif) \ - ((((tif)->tif_flags & TIFF_BUFFERSETUP) && tif->tif_rawdata) || \ - TIFFWriteBufferSetup((tif), NULL, (tsize_t) -1)) - -static int TIFFGrowStrips(TIFF*, int, const char*); -static int TIFFAppendToStrip(TIFF*, tstrip_t, tidata_t, tsize_t); - -int -TIFFWriteScanline(TIFF* tif, tdata_t buf, uint32 row, tsample_t sample) -{ - static const char module[] = "TIFFWriteScanline"; - register TIFFDirectory *td; - int status, imagegrew = 0; - tstrip_t strip; - - if (!WRITECHECKSTRIPS(tif, module)) - return (-1); - /* - * Handle delayed allocation of data buffer. This - * permits it to be sized more intelligently (using - * directory information). - */ - if (!BUFFERCHECK(tif)) - return (-1); - td = &tif->tif_dir; - /* - * Extend image length if needed - * (but only for PlanarConfig=1). - */ - if (row >= td->td_imagelength) { /* extend image */ - if (td->td_planarconfig == PLANARCONFIG_SEPARATE) { - TIFFError(tif->tif_name, - "Can not change \"ImageLength\" when using separate planes"); - return (-1); - } - td->td_imagelength = row+1; - imagegrew = 1; - } - /* - * Calculate strip and check for crossings. - */ - if (td->td_planarconfig == PLANARCONFIG_SEPARATE) { - if (sample >= td->td_samplesperpixel) { - TIFFError(tif->tif_name, - "%d: Sample out of range, max %d", - sample, td->td_samplesperpixel); - return (-1); - } - strip = sample*td->td_stripsperimage + row/td->td_rowsperstrip; - } else - strip = row / td->td_rowsperstrip; - if (strip != tif->tif_curstrip) { - /* - * Changing strips -- flush any data present. - */ - if (!TIFFFlushData(tif)) - return (-1); - tif->tif_curstrip = strip; - /* - * Watch out for a growing image. The value of - * strips/image will initially be 1 (since it - * can't be deduced until the imagelength is known). - */ - if (strip >= td->td_stripsperimage && imagegrew) - td->td_stripsperimage = - TIFFhowmany(td->td_imagelength,td->td_rowsperstrip); - tif->tif_row = - (strip % td->td_stripsperimage) * td->td_rowsperstrip; - if ((tif->tif_flags & TIFF_CODERSETUP) == 0) { - if (!(*tif->tif_setupencode)(tif)) - return (-1); - tif->tif_flags |= TIFF_CODERSETUP; - } - if (!(*tif->tif_preencode)(tif, sample)) - return (-1); - tif->tif_flags |= TIFF_POSTENCODE; - } - /* - * Check strip array to make sure there's space. - * We don't support dynamically growing files that - * have data organized in separate bitplanes because - * it's too painful. In that case we require that - * the imagelength be set properly before the first - * write (so that the strips array will be fully - * allocated above). - */ - if (strip >= td->td_nstrips && !TIFFGrowStrips(tif, 1, module)) - return (-1); - /* - * Ensure the write is either sequential or at the - * beginning of a strip (or that we can randomly - * access the data -- i.e. no encoding). - */ - if (row != tif->tif_row) { - if (row < tif->tif_row) { - /* - * Moving backwards within the same strip: - * backup to the start and then decode - * forward (below). - */ - tif->tif_row = (strip % td->td_stripsperimage) * - td->td_rowsperstrip; - tif->tif_rawcp = tif->tif_rawdata; - } - /* - * Seek forward to the desired row. - */ - if (!(*tif->tif_seek)(tif, row - tif->tif_row)) - return (-1); - tif->tif_row = row; - } - - /* swab if needed - note that source buffer will be altered */ - tif->tif_postdecode( tif, (tidata_t) buf, tif->tif_scanlinesize ); - - status = (*tif->tif_encoderow)(tif, (tidata_t) buf, - tif->tif_scanlinesize, sample); - - /* we are now poised at the beginning of the next row */ - tif->tif_row = row + 1; - return (status); -} - -/* - * Encode the supplied data and write it to the - * specified strip. There must be space for the - * data; we don't check if strips overlap! - * - * NB: Image length must be setup before writing. - */ -tsize_t -TIFFWriteEncodedStrip(TIFF* tif, tstrip_t strip, tdata_t data, tsize_t cc) -{ - static const char module[] = "TIFFWriteEncodedStrip"; - TIFFDirectory *td = &tif->tif_dir; - tsample_t sample; - - if (!WRITECHECKSTRIPS(tif, module)) - return ((tsize_t) -1); - /* - * Check strip array to make sure there's space. - * We don't support dynamically growing files that - * have data organized in separate bitplanes because - * it's too painful. In that case we require that - * the imagelength be set properly before the first - * write (so that the strips array will be fully - * allocated above). - */ - if (strip >= td->td_nstrips) { - if (td->td_planarconfig == PLANARCONFIG_SEPARATE) { - TIFFError(tif->tif_name, - "Can not grow image by strips when using separate planes"); - return ((tsize_t) -1); - } - if (!TIFFGrowStrips(tif, 1, module)) - return ((tsize_t) -1); - td->td_stripsperimage = - TIFFhowmany(td->td_imagelength, td->td_rowsperstrip); - } - /* - * Handle delayed allocation of data buffer. This - * permits it to be sized according to the directory - * info. - */ - if (!BUFFERCHECK(tif)) - return ((tsize_t) -1); - tif->tif_curstrip = strip; - tif->tif_row = (strip % td->td_stripsperimage) * td->td_rowsperstrip; - if ((tif->tif_flags & TIFF_CODERSETUP) == 0) { - if (!(*tif->tif_setupencode)(tif)) - return ((tsize_t) -1); - tif->tif_flags |= TIFF_CODERSETUP; - } - -#ifdef REWRITE_HACK - tif->tif_rawcc = 0; - tif->tif_rawcp = tif->tif_rawdata; - - if( td->td_stripbytecount[strip] > 0 ) - { - /* if we are writing over existing tiles, zero length. */ - td->td_stripbytecount[strip] = 0; - - /* this forces TIFFAppendToStrip() to do a seek */ - tif->tif_curoff = 0; - } -#endif - - tif->tif_flags &= ~TIFF_POSTENCODE; - sample = (tsample_t)(strip / td->td_stripsperimage); - if (!(*tif->tif_preencode)(tif, sample)) - return ((tsize_t) -1); - - /* swab if needed - note that source buffer will be altered */ - tif->tif_postdecode( tif, (tidata_t) data, cc ); - - if (!(*tif->tif_encodestrip)(tif, (tidata_t) data, cc, sample)) - return ((tsize_t) 0); - if (!(*tif->tif_postencode)(tif)) - return ((tsize_t) -1); - if (!isFillOrder(tif, td->td_fillorder) && - (tif->tif_flags & TIFF_NOBITREV) == 0) - TIFFReverseBits(tif->tif_rawdata, tif->tif_rawcc); - if (tif->tif_rawcc > 0 && - !TIFFAppendToStrip(tif, strip, tif->tif_rawdata, tif->tif_rawcc)) - return ((tsize_t) -1); - tif->tif_rawcc = 0; - tif->tif_rawcp = tif->tif_rawdata; - return (cc); -} - -/* - * Write the supplied data to the specified strip. - * There must be space for the data; we don't check - * if strips overlap! - * - * NB: Image length must be setup before writing. - */ -tsize_t -TIFFWriteRawStrip(TIFF* tif, tstrip_t strip, tdata_t data, tsize_t cc) -{ - static const char module[] = "TIFFWriteRawStrip"; - TIFFDirectory *td = &tif->tif_dir; - - if (!WRITECHECKSTRIPS(tif, module)) - return ((tsize_t) -1); - /* - * Check strip array to make sure there's space. - * We don't support dynamically growing files that - * have data organized in separate bitplanes because - * it's too painful. In that case we require that - * the imagelength be set properly before the first - * write (so that the strips array will be fully - * allocated above). - */ - if (strip >= td->td_nstrips) { - if (td->td_planarconfig == PLANARCONFIG_SEPARATE) { - TIFFError(tif->tif_name, - "Can not grow image by strips when using separate planes"); - return ((tsize_t) -1); - } - /* - * Watch out for a growing image. The value of - * strips/image will initially be 1 (since it - * can't be deduced until the imagelength is known). - */ - if (strip >= td->td_stripsperimage) - td->td_stripsperimage = - TIFFhowmany(td->td_imagelength,td->td_rowsperstrip); - if (!TIFFGrowStrips(tif, 1, module)) - return ((tsize_t) -1); - } - tif->tif_curstrip = strip; - tif->tif_row = (strip % td->td_stripsperimage) * td->td_rowsperstrip; - return (TIFFAppendToStrip(tif, strip, (tidata_t) data, cc) ? - cc : (tsize_t) -1); -} - -/* - * Write and compress a tile of data. The - * tile is selected by the (x,y,z,s) coordinates. - */ -tsize_t -TIFFWriteTile(TIFF* tif, - tdata_t buf, uint32 x, uint32 y, uint32 z, tsample_t s) -{ - if (!TIFFCheckTile(tif, x, y, z, s)) - return (-1); - /* - * NB: A tile size of -1 is used instead of tif_tilesize knowing - * that TIFFWriteEncodedTile will clamp this to the tile size. - * This is done because the tile size may not be defined until - * after the output buffer is setup in TIFFWriteBufferSetup. - */ - return (TIFFWriteEncodedTile(tif, - TIFFComputeTile(tif, x, y, z, s), buf, (tsize_t) -1)); -} - -/* - * Encode the supplied data and write it to the - * specified tile. There must be space for the - * data. The function clamps individual writes - * to a tile to the tile size, but does not (and - * can not) check that multiple writes to the same - * tile do not write more than tile size data. - * - * NB: Image length must be setup before writing; this - * interface does not support automatically growing - * the image on each write (as TIFFWriteScanline does). - */ -tsize_t -TIFFWriteEncodedTile(TIFF* tif, ttile_t tile, tdata_t data, tsize_t cc) -{ - static const char module[] = "TIFFWriteEncodedTile"; - TIFFDirectory *td; - tsample_t sample; - - if (!WRITECHECKTILES(tif, module)) - return ((tsize_t) -1); - td = &tif->tif_dir; - if (tile >= td->td_nstrips) { - TIFFError(module, "%s: Tile %lu out of range, max %lu", - tif->tif_name, (u_long) tile, (u_long) td->td_nstrips); - return ((tsize_t) -1); - } - /* - * Handle delayed allocation of data buffer. This - * permits it to be sized more intelligently (using - * directory information). - */ - if (!BUFFERCHECK(tif)) - return ((tsize_t) -1); - tif->tif_curtile = tile; - -#ifdef REWRITE_HACK - tif->tif_rawcc = 0; - tif->tif_rawcp = tif->tif_rawdata; - - if( td->td_stripbytecount[tile] > 0 ) - { - /* if we are writing over existing tiles, zero length. */ - td->td_stripbytecount[tile] = 0; - - /* this forces TIFFAppendToStrip() to do a seek */ - tif->tif_curoff = 0; - } -#endif - - /* - * Compute tiles per row & per column to compute - * current row and column - */ - tif->tif_row = (tile % TIFFhowmany(td->td_imagelength, td->td_tilelength)) - * td->td_tilelength; - tif->tif_col = (tile % TIFFhowmany(td->td_imagewidth, td->td_tilewidth)) - * td->td_tilewidth; - - if ((tif->tif_flags & TIFF_CODERSETUP) == 0) { - if (!(*tif->tif_setupencode)(tif)) - return ((tsize_t) -1); - tif->tif_flags |= TIFF_CODERSETUP; - } - tif->tif_flags &= ~TIFF_POSTENCODE; - sample = (tsample_t)(tile/td->td_stripsperimage); - if (!(*tif->tif_preencode)(tif, sample)) - return ((tsize_t) -1); - /* - * Clamp write amount to the tile size. This is mostly - * done so that callers can pass in some large number - * (e.g. -1) and have the tile size used instead. - */ - if ( cc < 1 || cc > tif->tif_tilesize) - cc = tif->tif_tilesize; - - /* swab if needed - note that source buffer will be altered */ - tif->tif_postdecode( tif, (tidata_t) data, cc ); - - if (!(*tif->tif_encodetile)(tif, (tidata_t) data, cc, sample)) - return ((tsize_t) 0); - if (!(*tif->tif_postencode)(tif)) - return ((tsize_t) -1); - if (!isFillOrder(tif, td->td_fillorder) && - (tif->tif_flags & TIFF_NOBITREV) == 0) - TIFFReverseBits((u_char *)tif->tif_rawdata, tif->tif_rawcc); - if (tif->tif_rawcc > 0 && !TIFFAppendToStrip(tif, tile, - tif->tif_rawdata, tif->tif_rawcc)) - return ((tsize_t) -1); - tif->tif_rawcc = 0; - tif->tif_rawcp = tif->tif_rawdata; - return (cc); -} - -/* - * Write the supplied data to the specified strip. - * There must be space for the data; we don't check - * if strips overlap! - * - * NB: Image length must be setup before writing; this - * interface does not support automatically growing - * the image on each write (as TIFFWriteScanline does). - */ -tsize_t -TIFFWriteRawTile(TIFF* tif, ttile_t tile, tdata_t data, tsize_t cc) -{ - static const char module[] = "TIFFWriteRawTile"; - - if (!WRITECHECKTILES(tif, module)) - return ((tsize_t) -1); - if (tile >= tif->tif_dir.td_nstrips) { - TIFFError(module, "%s: Tile %lu out of range, max %lu", - tif->tif_name, (u_long) tile, - (u_long) tif->tif_dir.td_nstrips); - return ((tsize_t) -1); - } - return (TIFFAppendToStrip(tif, tile, (tidata_t) data, cc) ? - cc : (tsize_t) -1); -} - -#define isUnspecified(tif, f) \ - (TIFFFieldSet(tif,f) && (tif)->tif_dir.td_imagelength == 0) - -int -TIFFSetupStrips(TIFF* tif) -{ - TIFFDirectory* td = &tif->tif_dir; - - if (isTiled(tif)) - td->td_stripsperimage = - isUnspecified(tif, FIELD_TILEDIMENSIONS) ? - td->td_samplesperpixel : TIFFNumberOfTiles(tif); - else - td->td_stripsperimage = - isUnspecified(tif, FIELD_ROWSPERSTRIP) ? - td->td_samplesperpixel : TIFFNumberOfStrips(tif); - td->td_nstrips = td->td_stripsperimage; - if (td->td_planarconfig == PLANARCONFIG_SEPARATE) - td->td_stripsperimage /= td->td_samplesperpixel; - td->td_stripoffset = (uint32 *) - _TIFFmalloc(td->td_nstrips * sizeof (uint32)); - td->td_stripbytecount = (uint32 *) - _TIFFmalloc(td->td_nstrips * sizeof (uint32)); - if (td->td_stripoffset == NULL || td->td_stripbytecount == NULL) - return (0); - /* - * Place data at the end-of-file - * (by setting offsets to zero). - */ - _TIFFmemset(td->td_stripoffset, 0, td->td_nstrips*sizeof (uint32)); - _TIFFmemset(td->td_stripbytecount, 0, td->td_nstrips*sizeof (uint32)); - TIFFSetFieldBit(tif, FIELD_STRIPOFFSETS); - TIFFSetFieldBit(tif, FIELD_STRIPBYTECOUNTS); - return (1); -} -#undef isUnspecified - -/* - * Verify file is writable and that the directory - * information is setup properly. In doing the latter - * we also "freeze" the state of the directory so - * that important information is not changed. - */ -int -TIFFWriteCheck(TIFF* tif, int tiles, const char* module) -{ - if (tif->tif_mode == O_RDONLY) { - TIFFError(module, "%s: File not open for writing", - tif->tif_name); - return (0); - } - if (tiles ^ isTiled(tif)) { - TIFFError(tif->tif_name, tiles ? - "Can not write tiles to a stripped image" : - "Can not write scanlines to a tiled image"); - return (0); - } - - /* - * While we allow compressed TIFF files to be opened in update mode, - * we don't allow writing any image blocks in an existing compressed - * image. Eventually we could do so, by moving blocks that grow - * to the end of the file, but we don't for now. - */ - if (tif->tif_dir.td_stripoffset != NULL - && tif->tif_dir.td_compression != COMPRESSION_NONE ) - { - TIFFError( module, - "%s:\n" - "In place update to compressed TIFF images not " - "supported.", - tif->tif_name ); - return (0); - } - - /* - * On the first write verify all the required information - * has been setup and initialize any data structures that - * had to wait until directory information was set. - * Note that a lot of our work is assumed to remain valid - * because we disallow any of the important parameters - * from changing after we start writing (i.e. once - * TIFF_BEENWRITING is set, TIFFSetField will only allow - * the image's length to be changed). - */ - if (!TIFFFieldSet(tif, FIELD_IMAGEDIMENSIONS)) { - TIFFError(module, - "%s: Must set \"ImageWidth\" before writing data", - tif->tif_name); - return (0); - } - if (!TIFFFieldSet(tif, FIELD_PLANARCONFIG)) { - TIFFError(module, - "%s: Must set \"PlanarConfiguration\" before writing data", - tif->tif_name); - return (0); - } - if (tif->tif_dir.td_stripoffset == NULL && !TIFFSetupStrips(tif)) { - tif->tif_dir.td_nstrips = 0; - TIFFError(module, "%s: No space for %s arrays", - tif->tif_name, isTiled(tif) ? "tile" : "strip"); - return (0); - } - if (isTiled(tif)) - tif->tif_tilesize = TIFFTileSize(tif); - else - tif->tif_tilesize = (tsize_t) -1; - - tif->tif_scanlinesize = TIFFScanlineSize(tif); - tif->tif_flags |= TIFF_BEENWRITING; - return (1); -} - -/* - * Setup the raw data buffer used for encoding. - */ -int -TIFFWriteBufferSetup(TIFF* tif, tdata_t bp, tsize_t size) -{ - static const char module[] = "TIFFWriteBufferSetup"; - - if (tif->tif_rawdata) { - if (tif->tif_flags & TIFF_MYBUFFER) { - _TIFFfree(tif->tif_rawdata); - tif->tif_flags &= ~TIFF_MYBUFFER; - } - tif->tif_rawdata = NULL; - } - if (size == (tsize_t) -1) { - size = (isTiled(tif) ? - tif->tif_tilesize : tif->tif_scanlinesize); - /* - * Make raw data buffer at least 8K - */ - if (size < 8*1024) - size = 8*1024; - bp = NULL; /* NB: force malloc */ - } - if (bp == NULL) { - bp = _TIFFmalloc(size); - if (bp == NULL) { - TIFFError(module, "%s: No space for output buffer", - tif->tif_name); - return (0); - } - tif->tif_flags |= TIFF_MYBUFFER; - } else - tif->tif_flags &= ~TIFF_MYBUFFER; - tif->tif_rawdata = (tidata_t) bp; - tif->tif_rawdatasize = size; - tif->tif_rawcc = 0; - tif->tif_rawcp = tif->tif_rawdata; - tif->tif_flags |= TIFF_BUFFERSETUP; - return (1); -} - -/* - * Grow the strip data structures by delta strips. - */ -static int -TIFFGrowStrips(TIFF* tif, int delta, const char* module) -{ - TIFFDirectory *td = &tif->tif_dir; - uint32 *new_stripoffset, *new_stripbytecount; - - assert(td->td_planarconfig == PLANARCONFIG_CONTIG); - new_stripoffset = (uint32*)_TIFFrealloc(td->td_stripoffset, - (td->td_nstrips + delta) * sizeof (uint32)); - new_stripbytecount = (uint32*)_TIFFrealloc(td->td_stripbytecount, - (td->td_nstrips + delta) * sizeof (uint32)); - if (new_stripoffset == NULL || new_stripbytecount == NULL) { - if (new_stripoffset) - _TIFFfree(new_stripoffset); - if (new_stripbytecount) - _TIFFfree(new_stripbytecount); - td->td_nstrips = 0; - TIFFError(module, "%s: No space to expand strip arrays", - tif->tif_name); - return (0); - } - td->td_stripoffset = new_stripoffset; - td->td_stripbytecount = new_stripbytecount; - _TIFFmemset(td->td_stripoffset + td->td_nstrips, - 0, delta*sizeof (uint32)); - _TIFFmemset(td->td_stripbytecount + td->td_nstrips, - 0, delta*sizeof (uint32)); - td->td_nstrips += delta; - return (1); -} - -/* - * Append the data to the specified strip. - * - * NB: We don't check that there's space in the - * file (i.e. that strips do not overlap). - */ -static int -TIFFAppendToStrip(TIFF* tif, tstrip_t strip, tidata_t data, tsize_t cc) -{ - TIFFDirectory *td = &tif->tif_dir; - static const char module[] = "TIFFAppendToStrip"; - - if (td->td_stripoffset[strip] == 0 || tif->tif_curoff == 0) { - /* - * No current offset, set the current strip. - */ - if (td->td_stripoffset[strip] != 0) { - if (!SeekOK(tif, td->td_stripoffset[strip])) { - TIFFError(module, - "%s: Seek error at scanline %lu", - tif->tif_name, (u_long) tif->tif_row); - return (0); - } - } else - td->td_stripoffset[strip] = - TIFFSeekFile(tif, (toff_t) 0, SEEK_END); - tif->tif_curoff = td->td_stripoffset[strip]; - } - if (!WriteOK(tif, data, cc)) { - TIFFError(module, "%s: Write error at scanline %lu", - tif->tif_name, (u_long) tif->tif_row); - return (0); - } - tif->tif_curoff += cc; - td->td_stripbytecount[strip] += cc; - return (1); -} - -/* - * Internal version of TIFFFlushData that can be - * called by ``encodestrip routines'' w/o concern - * for infinite recursion. - */ -int -TIFFFlushData1(TIFF* tif) -{ - if (tif->tif_rawcc > 0) { - if (!isFillOrder(tif, tif->tif_dir.td_fillorder) && - (tif->tif_flags & TIFF_NOBITREV) == 0) - TIFFReverseBits((u_char *)tif->tif_rawdata, - tif->tif_rawcc); - if (!TIFFAppendToStrip(tif, - isTiled(tif) ? tif->tif_curtile : tif->tif_curstrip, - tif->tif_rawdata, tif->tif_rawcc)) - return (0); - tif->tif_rawcc = 0; - tif->tif_rawcp = tif->tif_rawdata; - } - return (1); -} - -/* - * Set the current write offset. This should only be - * used to set the offset to a known previous location - * (very carefully), or to 0 so that the next write gets - * appended to the end of the file. - */ -void -TIFFSetWriteOffset(TIFF* tif, toff_t off) -{ - tif->tif_curoff = off; -} diff --git a/wxWidgets/src/tiff/tif_zip.c b/wxWidgets/src/tiff/tif_zip.c deleted file mode 100644 index 3539500cb4..0000000000 --- a/wxWidgets/src/tiff/tif_zip.c +++ /dev/null @@ -1,368 +0,0 @@ -/* $Header$ */ - -/* - * Copyright (c) 1995-1997 Sam Leffler - * Copyright (c) 1995-1997 Silicon Graphics, Inc. - * - * Permission to use, copy, modify, distribute, and sell this software and - * its documentation for any purpose is hereby granted without fee, provided - * that (i) the above copyright notices and this permission notice appear in - * all copies of the software and related documentation, and (ii) the names of - * Sam Leffler and Silicon Graphics may not be used in any advertising or - * publicity relating to the software without the specific, prior written - * permission of Sam Leffler and Silicon Graphics. - * - * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, - * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * - * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR - * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, - * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF - * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE - * OF THIS SOFTWARE. - */ - -#include "tiffiop.h" -#ifdef ZIP_SUPPORT -/* - * TIFF Library. - * - * ZIP (aka Deflate) Compression Support - * - * This file is simply an interface to the zlib library written by - * Jean-loup Gailly and Mark Adler. You must use version 1.0 or later - * of the library: this code assumes the 1.0 API and also depends on - * the ability to write the zlib header multiple times (one per strip) - * which was not possible with versions prior to 0.95. Note also that - * older versions of this codec avoided this bug by supressing the header - * entirely. This means that files written with the old library cannot - * be read; they should be converted to a different compression scheme - * and then reconverted. - * - * The data format used by the zlib library is described in the files - * zlib-3.1.doc, deflate-1.1.doc and gzip-4.1.doc, available in the - * directory ftp://ftp.uu.net/pub/archiving/zip/doc. The library was - * last found at ftp://ftp.uu.net/pub/archiving/zip/zlib/zlib-0.99.tar.gz. - */ -#include "tif_predict.h" -#include "zlib.h" - -#include -#include - -/* - * Sigh, ZLIB_VERSION is defined as a string so there's no - * way to do a proper check here. Instead we guess based - * on the presence of #defines that were added between the - * 0.95 and 1.0 distributions. - */ -#if !defined(Z_NO_COMPRESSION) || !defined(Z_DEFLATED) -#error "Antiquated ZLIB software; you must use version 1.0 or later" -#endif - -/* - * State block for each open TIFF - * file using ZIP compression/decompression. - */ -typedef struct { - TIFFPredictorState predict; - z_stream stream; - int zipquality; /* compression level */ - int state; /* state flags */ -#define ZSTATE_INIT 0x1 /* zlib setup successfully */ - - TIFFVGetMethod vgetparent; /* super-class method */ - TIFFVSetMethod vsetparent; /* super-class method */ -} ZIPState; - -#define ZState(tif) ((ZIPState*) (tif)->tif_data) -#define DecoderState(tif) ZState(tif) -#define EncoderState(tif) ZState(tif) - -static int ZIPEncode(TIFF*, tidata_t, tsize_t, tsample_t); -static int ZIPDecode(TIFF*, tidata_t, tsize_t, tsample_t); - -static int -ZIPSetupDecode(TIFF* tif) -{ - ZIPState* sp = DecoderState(tif); - static const char module[] = "ZIPSetupDecode"; - - assert(sp != NULL); - if (inflateInit(&sp->stream) != Z_OK) { - TIFFError(module, "%s: %s", tif->tif_name, sp->stream.msg); - return (0); - } else { - sp->state |= ZSTATE_INIT; - return (1); - } -} - -/* - * Setup state for decoding a strip. - */ -static int -ZIPPreDecode(TIFF* tif, tsample_t s) -{ - ZIPState* sp = DecoderState(tif); - - (void) s; - assert(sp != NULL); - sp->stream.next_in = tif->tif_rawdata; - sp->stream.avail_in = tif->tif_rawcc; - return (inflateReset(&sp->stream) == Z_OK); -} - -static int -ZIPDecode(TIFF* tif, tidata_t op, tsize_t occ, tsample_t s) -{ - ZIPState* sp = DecoderState(tif); - static const char module[] = "ZIPDecode"; - - (void) s; - assert(sp != NULL); - sp->stream.next_out = op; - sp->stream.avail_out = occ; - do { - int state = inflate(&sp->stream, Z_PARTIAL_FLUSH); - if (state == Z_STREAM_END) - break; - if (state == Z_DATA_ERROR) { - TIFFError(module, - "%s: Decoding error at scanline %d, %s", - tif->tif_name, tif->tif_row, sp->stream.msg); - if (inflateSync(&sp->stream) != Z_OK) - return (0); - continue; - } - if (state != Z_OK) { - TIFFError(module, "%s: zlib error: %s", - tif->tif_name, sp->stream.msg); - return (0); - } - } while (sp->stream.avail_out > 0); - if (sp->stream.avail_out != 0) { - TIFFError(module, - "%s: Not enough data at scanline %d (short %d bytes)", - tif->tif_name, tif->tif_row, sp->stream.avail_out); - return (0); - } - return (1); -} - -static int -ZIPSetupEncode(TIFF* tif) -{ - ZIPState* sp = EncoderState(tif); - static const char module[] = "ZIPSetupEncode"; - - assert(sp != NULL); - if (deflateInit(&sp->stream, sp->zipquality) != Z_OK) { - TIFFError(module, "%s: %s", tif->tif_name, sp->stream.msg); - return (0); - } else { - sp->state |= ZSTATE_INIT; - return (1); - } -} - -/* - * Reset encoding state at the start of a strip. - */ -static int -ZIPPreEncode(TIFF* tif, tsample_t s) -{ - ZIPState *sp = EncoderState(tif); - - (void) s; - assert(sp != NULL); - sp->stream.next_out = tif->tif_rawdata; - sp->stream.avail_out = tif->tif_rawdatasize; - return (deflateReset(&sp->stream) == Z_OK); -} - -/* - * Encode a chunk of pixels. - */ -static int -ZIPEncode(TIFF* tif, tidata_t bp, tsize_t cc, tsample_t s) -{ - ZIPState *sp = EncoderState(tif); - static const char module[] = "ZIPEncode"; - - (void) s; - sp->stream.next_in = bp; - sp->stream.avail_in = cc; - do { - if (deflate(&sp->stream, Z_NO_FLUSH) != Z_OK) { - TIFFError(module, "%s: Encoder error: %s", - tif->tif_name, sp->stream.msg); - return (0); - } - if (sp->stream.avail_out == 0) { - tif->tif_rawcc = tif->tif_rawdatasize; - TIFFFlushData1(tif); - sp->stream.next_out = tif->tif_rawdata; - sp->stream.avail_out = tif->tif_rawdatasize; - } - } while (sp->stream.avail_in > 0); - return (1); -} - -/* - * Finish off an encoded strip by flushing the last - * string and tacking on an End Of Information code. - */ -static int -ZIPPostEncode(TIFF* tif) -{ - ZIPState *sp = EncoderState(tif); - static const char module[] = "ZIPPostEncode"; - int state; - - sp->stream.avail_in = 0; - do { - state = deflate(&sp->stream, Z_FINISH); - switch (state) { - case Z_STREAM_END: - case Z_OK: - if ((int)sp->stream.avail_out != (int)tif->tif_rawdatasize) - { - tif->tif_rawcc = - tif->tif_rawdatasize - sp->stream.avail_out; - TIFFFlushData1(tif); - sp->stream.next_out = tif->tif_rawdata; - sp->stream.avail_out = tif->tif_rawdatasize; - } - break; - default: - TIFFError(module, "%s: zlib error: %s", - tif->tif_name, sp->stream.msg); - return (0); - } - } while (state != Z_STREAM_END); - return (1); -} - -static void -ZIPCleanup(TIFF* tif) -{ - ZIPState* sp = ZState(tif); - if (sp) { - if (sp->state&ZSTATE_INIT) { - /* NB: avoid problems in the library */ - if (tif->tif_mode == O_RDONLY) - inflateEnd(&sp->stream); - else - deflateEnd(&sp->stream); - } - _TIFFfree(sp); - tif->tif_data = NULL; - } -} - -static int -ZIPVSetField(TIFF* tif, ttag_t tag, va_list ap) -{ - ZIPState* sp = ZState(tif); - static const char module[] = "ZIPVSetField"; - - switch (tag) { - case TIFFTAG_ZIPQUALITY: - sp->zipquality = va_arg(ap, int); - if (tif->tif_mode != O_RDONLY && (sp->state&ZSTATE_INIT)) { - if (deflateParams(&sp->stream, - sp->zipquality, Z_DEFAULT_STRATEGY) != Z_OK) { - TIFFError(module, "%s: zlib error: %s", - tif->tif_name, sp->stream.msg); - return (0); - } - } - return (1); - default: - return (*sp->vsetparent)(tif, tag, ap); - } - /*NOTREACHED*/ -} - -static int -ZIPVGetField(TIFF* tif, ttag_t tag, va_list ap) -{ - ZIPState* sp = ZState(tif); - - switch (tag) { - case TIFFTAG_ZIPQUALITY: - *va_arg(ap, int*) = sp->zipquality; - break; - default: - return (*sp->vgetparent)(tif, tag, ap); - } - return (1); -} - -static const TIFFFieldInfo zipFieldInfo[] = { - { TIFFTAG_ZIPQUALITY, 0, 0, TIFF_ANY, FIELD_PSEUDO, - TRUE, FALSE, "" }, -}; -#define N(a) (sizeof (a) / sizeof (a[0])) - -int -TIFFInitZIP(TIFF* tif, int scheme) -{ - ZIPState* sp; - - assert( (scheme == COMPRESSION_DEFLATE) || (scheme == COMPRESSION_ADOBE_DEFLATE)); - - /* - * Allocate state block so tag methods have storage to record values. - */ - tif->tif_data = (tidata_t) _TIFFmalloc(sizeof (ZIPState)); - if (tif->tif_data == NULL) - goto bad; - sp = ZState(tif); - sp->stream.zalloc = NULL; - sp->stream.zfree = NULL; - sp->stream.opaque = NULL; - sp->stream.data_type = Z_BINARY; - - /* - * Merge codec-specific tag information and - * override parent get/set field methods. - */ - _TIFFMergeFieldInfo(tif, zipFieldInfo, N(zipFieldInfo)); - sp->vgetparent = tif->tif_tagmethods.vgetfield; - tif->tif_tagmethods.vgetfield = ZIPVGetField; /* hook for codec tags */ - sp->vsetparent = tif->tif_tagmethods.vsetfield; - tif->tif_tagmethods.vsetfield = ZIPVSetField; /* hook for codec tags */ - - /* Default values for codec-specific fields */ - sp->zipquality = Z_DEFAULT_COMPRESSION; /* default comp. level */ - sp->state = 0; - - /* - * Install codec methods. - */ - tif->tif_setupdecode = ZIPSetupDecode; - tif->tif_predecode = ZIPPreDecode; - tif->tif_decoderow = ZIPDecode; - tif->tif_decodestrip = ZIPDecode; - tif->tif_decodetile = ZIPDecode; - tif->tif_setupencode = ZIPSetupEncode; - tif->tif_preencode = ZIPPreEncode; - tif->tif_postencode = ZIPPostEncode; - tif->tif_encoderow = ZIPEncode; - tif->tif_encodestrip = ZIPEncode; - tif->tif_encodetile = ZIPEncode; - tif->tif_cleanup = ZIPCleanup; - /* - * Setup predictor setup. - */ - (void) TIFFPredictorInit(tif); - return (1); -bad: - TIFFError("TIFFInitZIP", "No space for ZIP state block"); - return (0); -} -#endif /* ZIP_SUPORT */ diff --git a/wxWidgets/src/tiff/tiff.dsp b/wxWidgets/src/tiff/tiff.dsp deleted file mode 100644 index 3d39c1bd13..0000000000 --- a/wxWidgets/src/tiff/tiff.dsp +++ /dev/null @@ -1,696 +0,0 @@ -# Microsoft Developer Studio Project File - Name="tiff" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Static Library" 0x0104 - -CFG=tiff - 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 "tiff.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 "tiff.mak" CFG="tiff - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "tiff - Win32 Release" (based on "Win32 (x86) Static Library") -!MESSAGE "tiff - Win32 Debug" (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)" == "tiff - 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 Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /MD /w /W0 /O1 /Ob2 /I "../include" /D "WIN32" /D "_WINDOWS" /D "__WINDOWS__" /D "__WXMSW__" /D "__WIN95__" /D "__WIN32__" /D WINVER=0x0400 /D "STRICT" /Yu"wx/wxprec.h" /FD /c -# ADD BASE RSC /l 0x809 -# ADD RSC /l 0x809 -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo /out:"..\..\lib\tiff.lib" - -!ELSEIF "$(CFG)" == "tiff - 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 Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /Z7 /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /MDd /w /W0 /Zi /Od /I "../include" /I ".." /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "__WINDOWS__" /D "__WXMSW__" /D DEBUG=1 /D "__WXDEBUG__" /D "__WIN95__" /D "__WIN32__" /D WINVER=0x0400 /D "STRICT" /Yu"wx/wxprec.h" /FD /c -# ADD BASE RSC /l 0x809 -# ADD RSC /l 0x809 -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo /out:"..\..\lib\tiffd.lib" - -!ENDIF - -# Begin Target - -# Name "tiff - Win32 Release" -# Name "tiff - Win32 Debug" -# Begin Group "tiff Files" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\tif_aux.c - -!IF "$(CFG)" == "tiff - Win32 Release" - -# ADD CPP /I ".." -# SUBTRACT CPP /YX /Yc /Yu - -!ELSEIF "$(CFG)" == "tiff - Win32 Debug" - -# SUBTRACT CPP /YX /Yc /Yu - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\tif_close.c - -!IF "$(CFG)" == "tiff - Win32 Release" - -# ADD CPP /I ".." -# SUBTRACT CPP /YX /Yc /Yu - -!ELSEIF "$(CFG)" == "tiff - Win32 Debug" - -# SUBTRACT CPP /YX /Yc /Yu - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\tif_codec.c - -!IF "$(CFG)" == "tiff - Win32 Release" - -# ADD CPP /I ".." -# SUBTRACT CPP /YX /Yc /Yu - -!ELSEIF "$(CFG)" == "tiff - Win32 Debug" - -# SUBTRACT CPP /YX /Yc /Yu - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\tif_color.c - -!IF "$(CFG)" == "tiff - Win32 Release" - -# ADD CPP /I ".." -# SUBTRACT CPP /YX /Yc /Yu - -!ELSEIF "$(CFG)" == "tiff - Win32 Debug" - -# SUBTRACT CPP /YX /Yc /Yu - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\tif_compress.c - -!IF "$(CFG)" == "tiff - Win32 Release" - -# ADD CPP /I ".." -# SUBTRACT CPP /YX /Yc /Yu - -!ELSEIF "$(CFG)" == "tiff - Win32 Debug" - -# SUBTRACT CPP /YX /Yc /Yu - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\tif_dir.c - -!IF "$(CFG)" == "tiff - Win32 Release" - -# ADD CPP /I ".." -# SUBTRACT CPP /YX /Yc /Yu - -!ELSEIF "$(CFG)" == "tiff - Win32 Debug" - -# SUBTRACT CPP /YX /Yc /Yu - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\tif_dirinfo.c - -!IF "$(CFG)" == "tiff - Win32 Release" - -# ADD CPP /I ".." -# SUBTRACT CPP /YX /Yc /Yu - -!ELSEIF "$(CFG)" == "tiff - Win32 Debug" - -# SUBTRACT CPP /YX /Yc /Yu - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\tif_dirread.c - -!IF "$(CFG)" == "tiff - Win32 Release" - -# ADD CPP /I ".." -# SUBTRACT CPP /YX /Yc /Yu - -!ELSEIF "$(CFG)" == "tiff - Win32 Debug" - -# SUBTRACT CPP /YX /Yc /Yu - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\tif_dirwrite.c - -!IF "$(CFG)" == "tiff - Win32 Release" - -# ADD CPP /I ".." -# SUBTRACT CPP /YX /Yc /Yu - -!ELSEIF "$(CFG)" == "tiff - Win32 Debug" - -# SUBTRACT CPP /YX /Yc /Yu - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\tif_dumpmode.c - -!IF "$(CFG)" == "tiff - Win32 Release" - -# ADD CPP /I ".." -# SUBTRACT CPP /YX /Yc /Yu - -!ELSEIF "$(CFG)" == "tiff - Win32 Debug" - -# SUBTRACT CPP /YX /Yc /Yu - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\tif_error.c - -!IF "$(CFG)" == "tiff - Win32 Release" - -# ADD CPP /I ".." -# SUBTRACT CPP /YX /Yc /Yu - -!ELSEIF "$(CFG)" == "tiff - Win32 Debug" - -# SUBTRACT CPP /YX /Yc /Yu - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\tif_extension.c - -!IF "$(CFG)" == "tiff - Win32 Release" - -# ADD CPP /I ".." -# SUBTRACT CPP /YX /Yc /Yu - -!ELSEIF "$(CFG)" == "tiff - Win32 Debug" - -# SUBTRACT CPP /YX /Yc /Yu - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\tif_fax3.c - -!IF "$(CFG)" == "tiff - Win32 Release" - -# ADD CPP /I ".." -# SUBTRACT CPP /YX /Yc /Yu - -!ELSEIF "$(CFG)" == "tiff - Win32 Debug" - -# SUBTRACT CPP /YX /Yc /Yu - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\tif_fax3sm.c - -!IF "$(CFG)" == "tiff - Win32 Release" - -# ADD CPP /I ".." -# SUBTRACT CPP /YX /Yc /Yu - -!ELSEIF "$(CFG)" == "tiff - Win32 Debug" - -# SUBTRACT CPP /YX /Yc /Yu - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\tif_flush.c - -!IF "$(CFG)" == "tiff - Win32 Release" - -# ADD CPP /I ".." -# SUBTRACT CPP /YX /Yc /Yu - -!ELSEIF "$(CFG)" == "tiff - Win32 Debug" - -# SUBTRACT CPP /YX /Yc /Yu - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\tif_getimage.c - -!IF "$(CFG)" == "tiff - Win32 Release" - -# ADD CPP /I ".." -# SUBTRACT CPP /YX /Yc /Yu - -!ELSEIF "$(CFG)" == "tiff - Win32 Debug" - -# SUBTRACT CPP /YX /Yc /Yu - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\tif_jpeg.c - -!IF "$(CFG)" == "tiff - Win32 Release" - -# ADD CPP /I ".." -# SUBTRACT CPP /YX /Yc /Yu - -!ELSEIF "$(CFG)" == "tiff - Win32 Debug" - -# SUBTRACT CPP /YX /Yc /Yu - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\tif_luv.c - -!IF "$(CFG)" == "tiff - Win32 Release" - -# ADD CPP /I ".." -# SUBTRACT CPP /YX /Yc /Yu - -!ELSEIF "$(CFG)" == "tiff - Win32 Debug" - -# SUBTRACT CPP /YX /Yc /Yu - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\tif_lzw.c - -!IF "$(CFG)" == "tiff - Win32 Release" - -# ADD CPP /I ".." -# SUBTRACT CPP /YX /Yc /Yu - -!ELSEIF "$(CFG)" == "tiff - Win32 Debug" - -# SUBTRACT CPP /YX /Yc /Yu - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\tif_next.c - -!IF "$(CFG)" == "tiff - Win32 Release" - -# ADD CPP /I ".." -# SUBTRACT CPP /YX /Yc /Yu - -!ELSEIF "$(CFG)" == "tiff - Win32 Debug" - -# SUBTRACT CPP /YX /Yc /Yu - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\tif_open.c - -!IF "$(CFG)" == "tiff - Win32 Release" - -# ADD CPP /I ".." -# SUBTRACT CPP /YX /Yc /Yu - -!ELSEIF "$(CFG)" == "tiff - Win32 Debug" - -# SUBTRACT CPP /YX /Yc /Yu - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\tif_packbits.c - -!IF "$(CFG)" == "tiff - Win32 Release" - -# ADD CPP /I ".." -# SUBTRACT CPP /YX /Yc /Yu - -!ELSEIF "$(CFG)" == "tiff - Win32 Debug" - -# SUBTRACT CPP /YX /Yc /Yu - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\tif_pixarlog.c - -!IF "$(CFG)" == "tiff - Win32 Release" - -# ADD CPP /I ".." -# SUBTRACT CPP /YX /Yc /Yu - -!ELSEIF "$(CFG)" == "tiff - Win32 Debug" - -# SUBTRACT CPP /YX /Yc /Yu - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\tif_predict.c - -!IF "$(CFG)" == "tiff - Win32 Release" - -# ADD CPP /I ".." -# SUBTRACT CPP /YX /Yc /Yu - -!ELSEIF "$(CFG)" == "tiff - Win32 Debug" - -# SUBTRACT CPP /YX /Yc /Yu - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\tif_print.c - -!IF "$(CFG)" == "tiff - Win32 Release" - -# ADD CPP /I ".." -# SUBTRACT CPP /YX /Yc /Yu - -!ELSEIF "$(CFG)" == "tiff - Win32 Debug" - -# SUBTRACT CPP /YX /Yc /Yu - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\tif_read.c - -!IF "$(CFG)" == "tiff - Win32 Release" - -# ADD CPP /I ".." -# SUBTRACT CPP /YX /Yc /Yu - -!ELSEIF "$(CFG)" == "tiff - Win32 Debug" - -# SUBTRACT CPP /YX /Yc /Yu - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\tif_strip.c - -!IF "$(CFG)" == "tiff - Win32 Release" - -# ADD CPP /I ".." -# SUBTRACT CPP /YX /Yc /Yu - -!ELSEIF "$(CFG)" == "tiff - Win32 Debug" - -# SUBTRACT CPP /YX /Yc /Yu - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\tif_swab.c - -!IF "$(CFG)" == "tiff - Win32 Release" - -# ADD CPP /I ".." -# SUBTRACT CPP /YX /Yc /Yu - -!ELSEIF "$(CFG)" == "tiff - Win32 Debug" - -# SUBTRACT CPP /YX /Yc /Yu - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\tif_thunder.c - -!IF "$(CFG)" == "tiff - Win32 Release" - -# ADD CPP /I ".." -# SUBTRACT CPP /YX /Yc /Yu - -!ELSEIF "$(CFG)" == "tiff - Win32 Debug" - -# SUBTRACT CPP /YX /Yc /Yu - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\tif_tile.c - -!IF "$(CFG)" == "tiff - Win32 Release" - -# ADD CPP /I ".." -# SUBTRACT CPP /YX /Yc /Yu - -!ELSEIF "$(CFG)" == "tiff - Win32 Debug" - -# SUBTRACT CPP /YX /Yc /Yu - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\tif_version.c - -!IF "$(CFG)" == "tiff - Win32 Release" - -# ADD CPP /I ".." -# SUBTRACT CPP /YX /Yc /Yu - -!ELSEIF "$(CFG)" == "tiff - Win32 Debug" - -# SUBTRACT CPP /YX /Yc /Yu - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\tif_warning.c - -!IF "$(CFG)" == "tiff - Win32 Release" - -# ADD CPP /I ".." -# SUBTRACT CPP /YX /Yc /Yu - -!ELSEIF "$(CFG)" == "tiff - Win32 Debug" - -# SUBTRACT CPP /YX /Yc /Yu - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\tif_win32.c - -!IF "$(CFG)" == "tiff - Win32 Release" - -# ADD CPP /I ".." -# SUBTRACT CPP /YX /Yc /Yu - -!ELSEIF "$(CFG)" == "tiff - Win32 Debug" - -# SUBTRACT CPP /YX /Yc /Yu - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\tif_write.c - -!IF "$(CFG)" == "tiff - Win32 Release" - -# ADD CPP /I ".." -# SUBTRACT CPP /YX /Yc /Yu - -!ELSEIF "$(CFG)" == "tiff - Win32 Debug" - -# SUBTRACT CPP /YX /Yc /Yu - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\tif_zip.c - -!IF "$(CFG)" == "tiff - Win32 Release" - -# ADD CPP /I ".." -# SUBTRACT CPP /YX /Yc /Yu - -!ELSEIF "$(CFG)" == "tiff - Win32 Debug" - -# SUBTRACT CPP /YX /Yc /Yu - -!ENDIF - -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h" -# Begin Source File - -SOURCE=.\port.h -# End Source File -# Begin Source File - -SOURCE=.\t4.h -# End Source File -# Begin Source File - -SOURCE=.\tif_dir.h -# End Source File -# Begin Source File - -SOURCE=.\tif_fax3.h -# End Source File -# Begin Source File - -SOURCE=.\tif_predict.h -# End Source File -# Begin Source File - -SOURCE=.\tiff.h -# End Source File -# Begin Source File - -SOURCE=.\tiffcomp.h -# End Source File -# Begin Source File - -SOURCE=.\tiffconf.h -# End Source File -# Begin Source File - -SOURCE=.\tiffio.h -# End Source File -# Begin Source File - -SOURCE=.\tiffiop.h -# End Source File -# Begin Source File - -SOURCE=.\uvcode.h -# End Source File -# End Group -# End Target -# End Project diff --git a/wxWidgets/src/tiff/tiff.h b/wxWidgets/src/tiff/tiff.h deleted file mode 100644 index a73c07501e..0000000000 --- a/wxWidgets/src/tiff/tiff.h +++ /dev/null @@ -1,482 +0,0 @@ -/* $Header$ */ - -/* - * Copyright (c) 1988-1997 Sam Leffler - * Copyright (c) 1991-1997 Silicon Graphics, Inc. - * - * Permission to use, copy, modify, distribute, and sell this software and - * its documentation for any purpose is hereby granted without fee, provided - * that (i) the above copyright notices and this permission notice appear in - * all copies of the software and related documentation, and (ii) the names of - * Sam Leffler and Silicon Graphics may not be used in any advertising or - * publicity relating to the software without the specific, prior written - * permission of Sam Leffler and Silicon Graphics. - * - * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, - * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * - * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR - * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, - * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF - * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE - * OF THIS SOFTWARE. - */ - -#ifndef _TIFF_ -#define _TIFF_ -/* - * Tag Image File Format (TIFF) - * - * Based on Rev 6.0 from: - * Developer's Desk - * Aldus Corporation - * 411 First Ave. South - * Suite 200 - * Seattle, WA 98104 - * 206-622-5500 - */ -#define TIFF_VERSION 42 - -#define TIFF_BIGENDIAN 0x4d4d -#define TIFF_LITTLEENDIAN 0x4949 - -/* - * The so called TIFF types conflict with definitions from inttypes.h - * included from sys/types.h on AIX (at least using VisualAge compiler). - * We try to work around this by detecting this case. Defining - * _TIFF_DATA_TYPEDEFS_ short circuits the later definitions in tiff.h, and - * we will in the holes not provided for by inttypes.h. - * - * See http://bugzilla.remotesensing.org/show_bug.cgi?id=39 - */ -#if defined(_H_INTTYPES) && defined(_ALL_SOURCE) && defined(USING_VISUALAGE) - -#define _TIFF_DATA_TYPEDEFS_ -typedef unsigned char uint8; -typedef unsigned short uint16; -typedef unsigned int uint32; - -#endif - -/* - * Intrinsic data types required by the file format: - * - * 8-bit quantities int8/uint8 - * 16-bit quantities int16/uint16 - * 32-bit quantities int32/uint32 - * strings unsigned char* - */ -#ifndef _TIFF_DATA_TYPEDEFS_ -#define _TIFF_DATA_TYPEDEFS_ - -#ifdef __STDC__ -typedef signed char int8; /* NB: non-ANSI compilers may not grok */ -#else -typedef char int8; -#endif -typedef unsigned char uint8; -typedef short int16; -typedef unsigned short uint16; /* sizeof (uint16) must == 2 */ -#if defined(__alpha) || (defined(_MIPS_SZLONG) && _MIPS_SZLONG == 64) || defined(__LP64__) || defined(__arch64__) -typedef int int32; -typedef unsigned int uint32; /* sizeof (uint32) must == 4 */ -#else -typedef long int32; -typedef unsigned long uint32; /* sizeof (uint32) must == 4 */ -#endif -#endif /* _TIFF_DATA_TYPEDEFS_ */ - -/* For TIFFReassignTagToIgnore */ -enum TIFFIgnoreSense /* IGNORE tag table */ -{ - TIS_STORE, - TIS_EXTRACT, - TIS_EMPTY -}; - -typedef struct { - uint16 tiff_magic; /* magic number (defines byte order) */ - uint16 tiff_version; /* TIFF version number */ - uint32 tiff_diroff; /* byte offset to first directory */ -} TIFFHeader; - -/* - * TIFF Image File Directories are comprised of - * a table of field descriptors of the form shown - * below. The table is sorted in ascending order - * by tag. The values associated with each entry - * are disjoint and may appear anywhere in the file - * (so long as they are placed on a word boundary). - * - * If the value is 4 bytes or less, then it is placed - * in the offset field to save space. If the value - * is less than 4 bytes, it is left-justified in the - * offset field. - */ -typedef struct { - uint16 tdir_tag; /* see below */ - uint16 tdir_type; /* data type; see below */ - uint32 tdir_count; /* number of items; length in spec */ - uint32 tdir_offset; /* byte offset to field data */ -} TIFFDirEntry; - -/* - * NB: In the comments below, - * - items marked with a + are obsoleted by revision 5.0, - * - items marked with a ! are introduced in revision 6.0. - * - items marked with a % are introduced post revision 6.0. - * - items marked with a $ are obsoleted by revision 6.0. - */ - -/* - * Tag data type information. - * - * Note: RATIONALs are the ratio of two 32-bit integer values. - */ -typedef enum { - TIFF_NOTYPE = 0, /* placeholder */ - TIFF_BYTE = 1, /* 8-bit unsigned integer */ - TIFF_ASCII = 2, /* 8-bit bytes w/ last byte null */ - TIFF_SHORT = 3, /* 16-bit unsigned integer */ - TIFF_LONG = 4, /* 32-bit unsigned integer */ - TIFF_RATIONAL = 5, /* 64-bit unsigned fraction */ - TIFF_SBYTE = 6, /* !8-bit signed integer */ - TIFF_UNDEFINED = 7, /* !8-bit untyped data */ - TIFF_SSHORT = 8, /* !16-bit signed integer */ - TIFF_SLONG = 9, /* !32-bit signed integer */ - TIFF_SRATIONAL = 10, /* !64-bit signed fraction */ - TIFF_FLOAT = 11, /* !32-bit IEEE floating point */ - TIFF_DOUBLE = 12, /* !64-bit IEEE floating point */ - TIFF_IFD = 13 /* %32-bit unsigned integer (offset) */ -} TIFFDataType; - -/* - * TIFF Tag Definitions. - */ -#define TIFFTAG_SUBFILETYPE 254 /* subfile data descriptor */ -#define FILETYPE_REDUCEDIMAGE 0x1 /* reduced resolution version */ -#define FILETYPE_PAGE 0x2 /* one page of many */ -#define FILETYPE_MASK 0x4 /* transparency mask */ -#define TIFFTAG_OSUBFILETYPE 255 /* +kind of data in subfile */ -#define OFILETYPE_IMAGE 1 /* full resolution image data */ -#define OFILETYPE_REDUCEDIMAGE 2 /* reduced size image data */ -#define OFILETYPE_PAGE 3 /* one page of many */ -#define TIFFTAG_IMAGEWIDTH 256 /* image width in pixels */ -#define TIFFTAG_IMAGELENGTH 257 /* image height in pixels */ -#define TIFFTAG_BITSPERSAMPLE 258 /* bits per channel (sample) */ -#define TIFFTAG_COMPRESSION 259 /* data compression technique */ -#define COMPRESSION_NONE 1 /* dump mode */ -#define COMPRESSION_CCITTRLE 2 /* CCITT modified Huffman RLE */ -#define COMPRESSION_CCITTFAX3 3 /* CCITT Group 3 fax encoding */ -#define COMPRESSION_CCITT_T4 3 /* CCITT T.4 (TIFF 6 name) */ -#define COMPRESSION_CCITTFAX4 4 /* CCITT Group 4 fax encoding */ -#define COMPRESSION_CCITT_T6 4 /* CCITT T.6 (TIFF 6 name) */ -#define COMPRESSION_LZW 5 /* Lempel-Ziv & Welch */ -#define COMPRESSION_OJPEG 6 /* !6.0 JPEG */ -#define COMPRESSION_JPEG 7 /* %JPEG DCT compression */ -#define COMPRESSION_NEXT 32766 /* NeXT 2-bit RLE */ -#define COMPRESSION_CCITTRLEW 32771 /* #1 w/ word alignment */ -#define COMPRESSION_PACKBITS 32773 /* Macintosh RLE */ -#define COMPRESSION_THUNDERSCAN 32809 /* ThunderScan RLE */ -/* codes 32895-32898 are reserved for ANSI IT8 TIFF/IT */ -#define COMPRESSION_DCS 32947 /* Kodak DCS encoding */ -#define COMPRESSION_JBIG 34661 /* ISO JBIG */ -#define COMPRESSION_SGILOG 34676 /* SGI Log Luminance RLE */ -#define COMPRESSION_SGILOG24 34677 /* SGI Log 24-bit packed */ -#define COMPRESSION_JP2000 34712 /* Leadtools JPEG2000 */ -#define TIFFTAG_PHOTOMETRIC 262 /* photometric interpretation */ -#define PHOTOMETRIC_MINISWHITE 0 /* min value is white */ -#define PHOTOMETRIC_MINISBLACK 1 /* min value is black */ -#define PHOTOMETRIC_RGB 2 /* RGB color model */ -#define PHOTOMETRIC_PALETTE 3 /* color map indexed */ -#define PHOTOMETRIC_MASK 4 /* $holdout mask */ -#define PHOTOMETRIC_SEPARATED 5 /* !color separations */ -#define PHOTOMETRIC_YCBCR 6 /* !CCIR 601 */ -#define PHOTOMETRIC_CIELAB 8 /* !1976 CIE L*a*b* */ -#define PHOTOMETRIC_ICCLAB 9 /* ICC L*a*b* [Adobe TIFF Technote 4] */ -#define PHOTOMETRIC_ITULAB 10 /* ITU L*a*b* */ -#define PHOTOMETRIC_LOGL 32844 /* CIE Log2(L) */ -#define PHOTOMETRIC_LOGLUV 32845 /* CIE Log2(L) (u',v') */ -#define TIFFTAG_THRESHHOLDING 263 /* +thresholding used on data */ -#define THRESHHOLD_BILEVEL 1 /* b&w art scan */ -#define THRESHHOLD_HALFTONE 2 /* or dithered scan */ -#define THRESHHOLD_ERRORDIFFUSE 3 /* usually floyd-steinberg */ -#define TIFFTAG_CELLWIDTH 264 /* +dithering matrix width */ -#define TIFFTAG_CELLLENGTH 265 /* +dithering matrix height */ -#define TIFFTAG_FILLORDER 266 /* data order within a byte */ -#define FILLORDER_MSB2LSB 1 /* most significant -> least */ -#define FILLORDER_LSB2MSB 2 /* least significant -> most */ -#define TIFFTAG_DOCUMENTNAME 269 /* name of doc. image is from */ -#define TIFFTAG_IMAGEDESCRIPTION 270 /* info about image */ -#define TIFFTAG_MAKE 271 /* scanner manufacturer name */ -#define TIFFTAG_MODEL 272 /* scanner model name/number */ -#define TIFFTAG_STRIPOFFSETS 273 /* offsets to data strips */ -#define TIFFTAG_ORIENTATION 274 /* +image orientation */ -#define ORIENTATION_TOPLEFT 1 /* row 0 top, col 0 lhs */ -#define ORIENTATION_TOPRIGHT 2 /* row 0 top, col 0 rhs */ -#define ORIENTATION_BOTRIGHT 3 /* row 0 bottom, col 0 rhs */ -#define ORIENTATION_BOTLEFT 4 /* row 0 bottom, col 0 lhs */ -#define ORIENTATION_LEFTTOP 5 /* row 0 lhs, col 0 top */ -#define ORIENTATION_RIGHTTOP 6 /* row 0 rhs, col 0 top */ -#define ORIENTATION_RIGHTBOT 7 /* row 0 rhs, col 0 bottom */ -#define ORIENTATION_LEFTBOT 8 /* row 0 lhs, col 0 bottom */ -#define TIFFTAG_SAMPLESPERPIXEL 277 /* samples per pixel */ -#define TIFFTAG_ROWSPERSTRIP 278 /* rows per strip of data */ -#define TIFFTAG_STRIPBYTECOUNTS 279 /* bytes counts for strips */ -#define TIFFTAG_MINSAMPLEVALUE 280 /* +minimum sample value */ -#define TIFFTAG_MAXSAMPLEVALUE 281 /* +maximum sample value */ -#define TIFFTAG_XRESOLUTION 282 /* pixels/resolution in x */ -#define TIFFTAG_YRESOLUTION 283 /* pixels/resolution in y */ -#define TIFFTAG_PLANARCONFIG 284 /* storage organization */ -#define PLANARCONFIG_CONTIG 1 /* single image plane */ -#define PLANARCONFIG_SEPARATE 2 /* separate planes of data */ -#define TIFFTAG_PAGENAME 285 /* page name image is from */ -#define TIFFTAG_XPOSITION 286 /* x page offset of image lhs */ -#define TIFFTAG_YPOSITION 287 /* y page offset of image lhs */ -#define TIFFTAG_FREEOFFSETS 288 /* +byte offset to free block */ -#define TIFFTAG_FREEBYTECOUNTS 289 /* +sizes of free blocks */ -#define TIFFTAG_GRAYRESPONSEUNIT 290 /* $gray scale curve accuracy */ -#define GRAYRESPONSEUNIT_10S 1 /* tenths of a unit */ -#define GRAYRESPONSEUNIT_100S 2 /* hundredths of a unit */ -#define GRAYRESPONSEUNIT_1000S 3 /* thousandths of a unit */ -#define GRAYRESPONSEUNIT_10000S 4 /* ten-thousandths of a unit */ -#define GRAYRESPONSEUNIT_100000S 5 /* hundred-thousandths */ -#define TIFFTAG_GRAYRESPONSECURVE 291 /* $gray scale response curve */ -#define TIFFTAG_GROUP3OPTIONS 292 /* 32 flag bits */ -#define TIFFTAG_T4OPTIONS 292 /* TIFF 6.0 proper name alias */ -#define GROUP3OPT_2DENCODING 0x1 /* 2-dimensional coding */ -#define GROUP3OPT_UNCOMPRESSED 0x2 /* data not compressed */ -#define GROUP3OPT_FILLBITS 0x4 /* fill to byte boundary */ -#define TIFFTAG_GROUP4OPTIONS 293 /* 32 flag bits */ -#define TIFFTAG_T6OPTIONS 293 /* TIFF 6.0 proper name */ -#define GROUP4OPT_UNCOMPRESSED 0x2 /* data not compressed */ -#define TIFFTAG_RESOLUTIONUNIT 296 /* units of resolutions */ -#define RESUNIT_NONE 1 /* no meaningful units */ -#define RESUNIT_INCH 2 /* english */ -#define RESUNIT_CENTIMETER 3 /* metric */ -#define TIFFTAG_PAGENUMBER 297 /* page numbers of multi-page */ -#define TIFFTAG_COLORRESPONSEUNIT 300 /* $color curve accuracy */ -#define COLORRESPONSEUNIT_10S 1 /* tenths of a unit */ -#define COLORRESPONSEUNIT_100S 2 /* hundredths of a unit */ -#define COLORRESPONSEUNIT_1000S 3 /* thousandths of a unit */ -#define COLORRESPONSEUNIT_10000S 4 /* ten-thousandths of a unit */ -#define COLORRESPONSEUNIT_100000S 5 /* hundred-thousandths */ -#define TIFFTAG_TRANSFERFUNCTION 301 /* !colorimetry info */ -#define TIFFTAG_SOFTWARE 305 /* name & release */ -#define TIFFTAG_DATETIME 306 /* creation date and time */ -#define TIFFTAG_ARTIST 315 /* creator of image */ -#define TIFFTAG_HOSTCOMPUTER 316 /* machine where created */ -#define TIFFTAG_PREDICTOR 317 /* prediction scheme w/ LZW */ -#define TIFFTAG_WHITEPOINT 318 /* image white point */ -#define TIFFTAG_PRIMARYCHROMATICITIES 319 /* !primary chromaticities */ -#define TIFFTAG_COLORMAP 320 /* RGB map for pallette image */ -#define TIFFTAG_HALFTONEHINTS 321 /* !highlight+shadow info */ -#define TIFFTAG_TILEWIDTH 322 /* !rows/data tile */ -#define TIFFTAG_TILELENGTH 323 /* !cols/data tile */ -#define TIFFTAG_TILEOFFSETS 324 /* !offsets to data tiles */ -#define TIFFTAG_TILEBYTECOUNTS 325 /* !byte counts for tiles */ -#define TIFFTAG_BADFAXLINES 326 /* lines w/ wrong pixel count */ -#define TIFFTAG_CLEANFAXDATA 327 /* regenerated line info */ -#define CLEANFAXDATA_CLEAN 0 /* no errors detected */ -#define CLEANFAXDATA_REGENERATED 1 /* receiver regenerated lines */ -#define CLEANFAXDATA_UNCLEAN 2 /* uncorrected errors exist */ -#define TIFFTAG_CONSECUTIVEBADFAXLINES 328 /* max consecutive bad lines */ -#define TIFFTAG_SUBIFD 330 /* subimage descriptors */ -#define TIFFTAG_INKSET 332 /* !inks in separated image */ -#define INKSET_CMYK 1 /* !cyan-magenta-yellow-black color */ -#define INKSET_MULTIINK 2 /* !multi-ink or hi-fi color */ -#define TIFFTAG_INKNAMES 333 /* !ascii names of inks */ -#define TIFFTAG_NUMBEROFINKS 334 /* !number of inks */ -#define TIFFTAG_DOTRANGE 336 /* !0% and 100% dot codes */ -#define TIFFTAG_TARGETPRINTER 337 /* !separation target */ -#define TIFFTAG_EXTRASAMPLES 338 /* !info about extra samples */ -#define EXTRASAMPLE_UNSPECIFIED 0 /* !unspecified data */ -#define EXTRASAMPLE_ASSOCALPHA 1 /* !associated alpha data */ -#define EXTRASAMPLE_UNASSALPHA 2 /* !unassociated alpha data */ -#define TIFFTAG_SAMPLEFORMAT 339 /* !data sample format */ -#define SAMPLEFORMAT_UINT 1 /* !unsigned integer data */ -#define SAMPLEFORMAT_INT 2 /* !signed integer data */ -#define SAMPLEFORMAT_IEEEFP 3 /* !IEEE floating point data */ -#define SAMPLEFORMAT_VOID 4 /* !untyped data */ -#define SAMPLEFORMAT_COMPLEXINT 5 /* !complex signed int */ -#define SAMPLEFORMAT_COMPLEXIEEEFP 6 /* !complex ieee floating */ -#define TIFFTAG_SMINSAMPLEVALUE 340 /* !variable MinSampleValue */ -#define TIFFTAG_SMAXSAMPLEVALUE 341 /* !variable MaxSampleValue */ -#define TIFFTAG_CLIPPATH 343 /* %ClipPath [Adobe TIFF technote 2] */ -#define TIFFTAG_XCLIPPATHUNITS 344 /* %XClipPathUnits [Adobe TIFF technote 2] */ -#define TIFFTAG_YCLIPPATHUNITS 344 /* %YClipPathUnits [Adobe TIFF technote 2] */ -#define TIFFTAG_INDEXED 345 /* %Indexed [Adobe TIFF Technote 3] */ -#define TIFFTAG_JPEGTABLES 347 /* %JPEG table stream */ -#define TIFFTAG_OPIPROXY 351 /* %OPI Proxy [Adobe TIFF technote] */ -/* - * Tags 512-521 are obsoleted by Technical Note #2 - * which specifies a revised JPEG-in-TIFF scheme. - */ -#define TIFFTAG_JPEGPROC 512 /* !JPEG processing algorithm */ -#define JPEGPROC_BASELINE 1 /* !baseline sequential */ -#define JPEGPROC_LOSSLESS 14 /* !Huffman coded lossless */ -#define TIFFTAG_JPEGIFOFFSET 513 /* !pointer to SOI marker */ -#define TIFFTAG_JPEGIFBYTECOUNT 514 /* !JFIF stream length */ -#define TIFFTAG_JPEGRESTARTINTERVAL 515 /* !restart interval length */ -#define TIFFTAG_JPEGLOSSLESSPREDICTORS 517 /* !lossless proc predictor */ -#define TIFFTAG_JPEGPOINTTRANSFORM 518 /* !lossless point transform */ -#define TIFFTAG_JPEGQTABLES 519 /* !Q matrice offsets */ -#define TIFFTAG_JPEGDCTABLES 520 /* !DCT table offsets */ -#define TIFFTAG_JPEGACTABLES 521 /* !AC coefficient offsets */ -#define TIFFTAG_YCBCRCOEFFICIENTS 529 /* !RGB -> YCbCr transform */ -#define TIFFTAG_YCBCRSUBSAMPLING 530 /* !YCbCr subsampling factors */ -#define TIFFTAG_YCBCRPOSITIONING 531 /* !subsample positioning */ -#define YCBCRPOSITION_CENTERED 1 /* !as in PostScript Level 2 */ -#define YCBCRPOSITION_COSITED 2 /* !as in CCIR 601-1 */ -#define TIFFTAG_REFERENCEBLACKWHITE 532 /* !colorimetry info */ -#define TIFFTAG_XMLPACKET 700 /* %XML packet [Adobe XMP technote 9-14-02] (dkelly@apago.com) */ -#define TIFFTAG_OPIIMAGEID 32781 /* %OPI ImageID [Adobe TIFF technote] */ -/* tags 32952-32956 are private tags registered to Island Graphics */ -#define TIFFTAG_REFPTS 32953 /* image reference points */ -#define TIFFTAG_REGIONTACKPOINT 32954 /* region-xform tack point */ -#define TIFFTAG_REGIONWARPCORNERS 32955 /* warp quadrilateral */ -#define TIFFTAG_REGIONAFFINE 32956 /* affine transformation mat */ -/* tags 32995-32999 are private tags registered to SGI */ -#define TIFFTAG_MATTEING 32995 /* $use ExtraSamples */ -#define TIFFTAG_DATATYPE 32996 /* $use SampleFormat */ -#define TIFFTAG_IMAGEDEPTH 32997 /* z depth of image */ -#define TIFFTAG_TILEDEPTH 32998 /* z depth/data tile */ -/* tags 33300-33309 are private tags registered to Pixar */ -/* - * TIFFTAG_PIXAR_IMAGEFULLWIDTH and TIFFTAG_PIXAR_IMAGEFULLLENGTH - * are set when an image has been cropped out of a larger image. - * They reflect the size of the original uncropped image. - * The TIFFTAG_XPOSITION and TIFFTAG_YPOSITION can be used - * to determine the position of the smaller image in the larger one. - */ -#define TIFFTAG_PIXAR_IMAGEFULLWIDTH 33300 /* full image size in x */ -#define TIFFTAG_PIXAR_IMAGEFULLLENGTH 33301 /* full image size in y */ - /* Tags 33302-33306 are used to identify special image modes and data - * used by Pixar's texture formats. - */ -#define TIFFTAG_PIXAR_TEXTUREFORMAT 33302 /* texture map format */ -#define TIFFTAG_PIXAR_WRAPMODES 33303 /* s & t wrap modes */ -#define TIFFTAG_PIXAR_FOVCOT 33304 /* cotan(fov) for env. maps */ -#define TIFFTAG_PIXAR_MATRIX_WORLDTOSCREEN 33305 -#define TIFFTAG_PIXAR_MATRIX_WORLDTOCAMERA 33306 -/* tag 33405 is a private tag registered to Eastman Kodak */ -#define TIFFTAG_WRITERSERIALNUMBER 33405 /* device serial number */ -/* tag 33432 is listed in the 6.0 spec w/ unknown ownership */ -#define TIFFTAG_COPYRIGHT 33432 /* copyright string */ -/* IPTC TAG from RichTIFF specifications */ -#define TIFFTAG_RICHTIFFIPTC 33723 -/* 34016-34029 are reserved for ANSI IT8 TIFF/IT */ -#define TIFFTAG_STONITS 37439 /* Sample value to Nits */ -/* tag 34929 is a private tag registered to FedEx */ -#define TIFFTAG_FEDEX_EDR 34929 /* unknown use */ -/* tag 65535 is an undefined tag used by Eastman Kodak */ -#define TIFFTAG_DCSHUESHIFTVALUES 65535 /* hue shift correction data */ - -/* - * The following are ``pseudo tags'' that can be - * used to control codec-specific functionality. - * These tags are not written to file. Note that - * these values start at 0xffff+1 so that they'll - * never collide with Aldus-assigned tags. - * - * If you want your private pseudo tags ``registered'' - * (i.e. added to this file), send mail to sam@sgi.com - * with the appropriate C definitions to add. - */ -#define TIFFTAG_FAXMODE 65536 /* Group 3/4 format control */ -#define FAXMODE_CLASSIC 0x0000 /* default, include RTC */ -#define FAXMODE_NORTC 0x0001 /* no RTC at end of data */ -#define FAXMODE_NOEOL 0x0002 /* no EOL code at end of row */ -#define FAXMODE_BYTEALIGN 0x0004 /* byte align row */ -#define FAXMODE_WORDALIGN 0x0008 /* word align row */ -#define FAXMODE_CLASSF FAXMODE_NORTC /* TIFF Class F */ -#define TIFFTAG_JPEGQUALITY 65537 /* Compression quality level */ -/* Note: quality level is on the IJG 0-100 scale. Default value is 75 */ -#define TIFFTAG_JPEGCOLORMODE 65538 /* Auto RGB<=>YCbCr convert? */ -#define JPEGCOLORMODE_RAW 0x0000 /* no conversion (default) */ -#define JPEGCOLORMODE_RGB 0x0001 /* do auto conversion */ -#define TIFFTAG_JPEGTABLESMODE 65539 /* What to put in JPEGTables */ -#define JPEGTABLESMODE_QUANT 0x0001 /* include quantization tbls */ -#define JPEGTABLESMODE_HUFF 0x0002 /* include Huffman tbls */ -/* Note: default is JPEGTABLESMODE_QUANT | JPEGTABLESMODE_HUFF */ -#define TIFFTAG_FAXFILLFUNC 65540 /* G3/G4 fill function */ -#define TIFFTAG_PIXARLOGDATAFMT 65549 /* PixarLogCodec I/O data sz */ -#define PIXARLOGDATAFMT_8BIT 0 /* regular u_char samples */ -#define PIXARLOGDATAFMT_8BITABGR 1 /* ABGR-order u_chars */ -#define PIXARLOGDATAFMT_11BITLOG 2 /* 11-bit log-encoded (raw) */ -#define PIXARLOGDATAFMT_12BITPICIO 3 /* as per PICIO (1.0==2048) */ -#define PIXARLOGDATAFMT_16BIT 4 /* signed short samples */ -#define PIXARLOGDATAFMT_FLOAT 5 /* IEEE float samples */ -/* 65550-65556 are allocated to Oceana Matrix */ -#define TIFFTAG_DCSIMAGERTYPE 65550 /* imager model & filter */ -#define DCSIMAGERMODEL_M3 0 /* M3 chip (1280 x 1024) */ -#define DCSIMAGERMODEL_M5 1 /* M5 chip (1536 x 1024) */ -#define DCSIMAGERMODEL_M6 2 /* M6 chip (3072 x 2048) */ -#define DCSIMAGERFILTER_IR 0 /* infrared filter */ -#define DCSIMAGERFILTER_MONO 1 /* monochrome filter */ -#define DCSIMAGERFILTER_CFA 2 /* color filter array */ -#define DCSIMAGERFILTER_OTHER 3 /* other filter */ -#define TIFFTAG_DCSINTERPMODE 65551 /* interpolation mode */ -#define DCSINTERPMODE_NORMAL 0x0 /* whole image, default */ -#define DCSINTERPMODE_PREVIEW 0x1 /* preview of image (384x256) */ -#define TIFFTAG_DCSBALANCEARRAY 65552 /* color balance values */ -#define TIFFTAG_DCSCORRECTMATRIX 65553 /* color correction values */ -#define TIFFTAG_DCSGAMMA 65554 /* gamma value */ -#define TIFFTAG_DCSTOESHOULDERPTS 65555 /* toe & shoulder points */ -#define TIFFTAG_DCSCALIBRATIONFD 65556 /* calibration file desc */ -/* Note: quality level is on the ZLIB 1-9 scale. Default value is -1 */ -#define TIFFTAG_ZIPQUALITY 65557 /* compression quality level */ -#define TIFFTAG_PIXARLOGQUALITY 65558 /* PixarLog uses same scale */ -/* 65559 is allocated to Oceana Matrix */ -#define TIFFTAG_DCSCLIPRECTANGLE 65559 /* area of image to acquire */ -#define TIFFTAG_SGILOGDATAFMT 65560 /* SGILog user data format */ -#define SGILOGDATAFMT_FLOAT 0 /* IEEE float samples */ -#define SGILOGDATAFMT_16BIT 1 /* 16-bit samples */ -#define SGILOGDATAFMT_RAW 2 /* uninterpreted data */ -#define SGILOGDATAFMT_8BIT 3 /* 8-bit RGB monitor values */ -#define TIFFTAG_SGILOGENCODE 65561 /* SGILog data encoding control*/ -#define SGILOGENCODE_NODITHER 0 /* do not dither encoded values*/ -#define SGILOGENCODE_RANDITHER 1 /* randomly dither encd values */ -#endif /* _TIFF_ */ diff --git a/wxWidgets/src/tiff/tiffM8.xml b/wxWidgets/src/tiff/tiffM8.xml deleted file mode 100644 index fc0f6ba841..0000000000 --- a/wxWidgets/src/tiff/tiffM8.xml +++ /dev/null @@ -1,3330 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -]> - - - - - PPC - - - - UserSourceTrees - - - AlwaysSearchUserPathstrue - InterpretDOSAndUnixPathstrue - RequireFrameworkStyleIncludesfalse - UserSearchPaths - - SearchPath - Path: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path::zlib: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SystemSearchPaths - - SearchPath - Path:MSL: - PathFormatMacOS - PathRootCodeWarrior - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:MacOS Support: - PathFormatMacOS - PathRootCodeWarrior - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - - - MWRuntimeSettings_WorkingDirectory - MWRuntimeSettings_CommandLine - MWRuntimeSettings_HostApplication - Path - PathFormatGeneric - PathRootAbsolute - - MWRuntimeSettings_EnvVars - - - LinkerMacOS PPC Linker - PreLinker - PostLinker - TargetnamePPC - OutputDirectory - Path:::lib: - PathFormatMacOS - PathRootProject - - SaveEntriesUsingRelativePathsfalse - - - FileMappings - - FileTypeAPPL - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypeAppl - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypeMMLB - FileExtension - CompilerLib Import PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeMPLF - FileExtension - CompilerLib Import PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeMWCD - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypeRSRC - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.bh - CompilerBalloon Help - EditLanguageBalloon Help - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.c - CompilerMW C/C++ PPC - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.c++ - CompilerMW C/C++ PPC - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.cc - CompilerMW C/C++ PPC - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.cp - CompilerMW C/C++ PPC - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.cpp - CompilerMW C/C++ PPC - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.exp - Compiler - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.h - CompilerMW C/C++ PPC - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMaketrue - - - FileTypeTEXT - FileExtension.p - CompilerMW Pascal PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.pas - CompilerMW Pascal PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.pch - CompilerMW C/C++ PPC - EditLanguageC/C++ - Precompiletrue - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.pch++ - CompilerMW C/C++ PPC - EditLanguageC/C++ - Precompiletrue - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.ppu - CompilerMW Pascal PPC - EditLanguage - Precompiletrue - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.r - CompilerRez - EditLanguageRez - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.s - CompilerPPCAsm - EditLanguageBalloon Help - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeXCOF - FileExtension - CompilerXCOFF Import PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypedocu - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypersrc - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypeshlb - FileExtension - CompilerPEF Import PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypestub - FileExtension - CompilerPEF Import PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileExtension.doc - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFilefalse - IgnoredByMaketrue - - - FileExtension.o - CompilerXCOFF Import PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileExtension.ppob - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileExtension.rsrc - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - - - CacheModDatestrue - DumpBrowserInfofalse - CacheSubprojectstrue - UseThirdPartyDebuggerfalse - BrowserGenerator1 - DebuggerAppPath - Path - PathFormatGeneric - PathRootAbsolute - - DebuggerCmdLineArgs - DebuggerWorkingDir - Path - PathFormatGeneric - PathRootAbsolute - - CodeCompletionPrefixFileNameMacHeaders.c - CodeCompletionMacroFileNameMacOS_Carbon_C++_Macros.h - - - ConsoleEncoding0 - LogSystemMessagestrue - AutoTargetDLLsfalse - StopAtWatchpointstrue - PauseWhileRunningfalse - PauseInterval5 - PauseUIFlags0 - AltExePath - Path - PathFormatGeneric - PathRootAbsolute - - StopAtTempBPOnLaunchtrue - CacheSymbolicstrue - TempBPFunctionNamemain - TempBPType0 - - - Enabledfalse - ConnectionName - DownloadPath - LaunchRemoteAppfalse - RemoteAppPath - CoreID0 - JTAGClockSpeed8000 - IsMultiCorefalse - OSDownloadfalse - UseGlobalOSDownloadfalse - OSDownloadConnectionName - OSDownloadPath - AltDownloadfalse - AltDownloadConnectionName - - - OtherExecutables - - - CustomColor1 - Red0 - Green32767 - Blue0 - - CustomColor2 - Red0 - Green32767 - Blue0 - - CustomColor3 - Red0 - Green32767 - Blue0 - - CustomColor4 - Red0 - Green32767 - Blue0 - - - - MWFrontEnd_C_cplusplus0 - MWFrontEnd_C_checkprotos0 - MWFrontEnd_C_arm0 - MWFrontEnd_C_trigraphs0 - MWFrontEnd_C_onlystdkeywords0 - MWFrontEnd_C_enumsalwaysint0 - MWFrontEnd_C_mpwpointerstyle0 - MWFrontEnd_C_prefixname - MWFrontEnd_C_ansistrict0 - MWFrontEnd_C_mpwcnewline0 - MWFrontEnd_C_wchar_type1 - MWFrontEnd_C_enableexceptions1 - MWFrontEnd_C_dontreusestrings0 - MWFrontEnd_C_poolstrings0 - MWFrontEnd_C_dontinline0 - MWFrontEnd_C_useRTTI1 - MWFrontEnd_C_multibyteaware0 - MWFrontEnd_C_unsignedchars0 - MWFrontEnd_C_autoinline0 - MWFrontEnd_C_booltruefalse1 - MWFrontEnd_C_inlinelevel0 - MWFrontEnd_C_ecplusplus0 - MWFrontEnd_C_objective_c0 - MWFrontEnd_C_defer_codegen0 - MWFrontEnd_C_templateparser0 - MWFrontEnd_C_c990 - MWFrontEnd_C_bottomupinline1 - - - MWWarning_C_warn_illpragma1 - MWWarning_C_warn_emptydecl1 - MWWarning_C_warn_possunwant1 - MWWarning_C_warn_unusedvar0 - MWWarning_C_warn_unusedarg0 - MWWarning_C_warn_extracomma1 - MWWarning_C_pedantic1 - MWWarning_C_warningerrors0 - MWWarning_C_warn_hidevirtual1 - MWWarning_C_warn_implicitconv0 - MWWarning_C_warn_notinlined1 - MWWarning_C_warn_structclass1 - - - MWFTP_Post_hostName - MWFTP_Post_username - MWFTP_Post_password0ÿÀ°¥ðŒ"²¸ - MWFTP_Post_remoteDir - MWFTP_Post_ftp_PathVersion1 - MWFTP_Post_ftp_PathType0 - MWFTP_Post_ftp_PathFormat0 - MWFTP_Post_ftp_tree - MWFTP_Post_uploadDir - MWFTP_Post_ftp_port21 - MWFTP_Post_SendBin1 - MWFTP_Post_ShouldLog1 - - - MWCommandLine_Java_clsName - MWCommandLine_Java_args - - - MWVJavaDebugging_Protocol1 - MWVJavaDebugging_JDKVersion1 - MWVJavaDebugging_TimeOut25 - MWVJavaDebugging_SupportSlowDevicesfalse - MWVJavaDebugging_UseRemoteLaunchAgentfalse - MWVJavaDebugging_LaunchVMasServerfalse - - - MWJava_Language_optimizefalse - MWJava_Language_warnDeprecatedfalse - MWJava_Language_emitMapfalse - MWJava_Language_strictFileNamesfalse - MWJava_Language_strictFileHierarchyfalse - MWJava_Language_1_1_Compatiblefalse - MWJava_Language_emitHeaders0 - MWJava_Language_headerTypeJNINativeHeaders - MWJava_Language_packageFilter - MWJava_Language_genCommentstrue - MWJava_Language_genHeadersfalse - MWJava_Language_enableAssertsfalse - MWJava_Language_targetVM1.1 - - - Manifest-JAD Attributes - - AttributeMain-Class - ValueAuto-Generated - - - - - MWJava_MRJAppBuilder_outFileMRJApplication - MWJava_MRJAppBuilder_mergefalse - MWJava_MRJAppBuilder_quitMenutrue - MWJava_MRJAppBuilder_growfalse - MWJava_MRJAppBuilder_stdoutTypeConsole - MWJava_MRJAppBuilder_stderrTypeConsole - MWJava_MRJAppBuilder_stdinTypeConsole - MWJava_MRJAppBuilder_appIconPVersion0 - MWJava_MRJAppBuilder_appIconPType0 - MWJava_MRJAppBuilder_appIconPFormat0 - MWJava_MRJAppBuilder_appIconPTree - MWJava_MRJAppBuilder_appIconFile - MWJava_MRJAppBuilder_splashScreenPVersion0 - MWJava_MRJAppBuilder_splashScreenPType0 - MWJava_MRJAppBuilder_splashScreenPFormat0 - MWJava_MRJAppBuilder_splashScreenPTree - MWJava_MRJAppBuilder_splashScreenPICTFile - MWJava_MRJAppBuilder_aboutName - MWJava_MRJAppBuilder_stdoutPVersion0 - MWJava_MRJAppBuilder_stdoutPType0 - MWJava_MRJAppBuilder_stdoutPFormat0 - MWJava_MRJAppBuilder_stdoutPTree - MWJava_MRJAppBuilder_stdoutFile - MWJava_MRJAppBuilder_stdoutAppendfalse - MWJava_MRJAppBuilder_stderrPType0 - MWJava_MRJAppBuilder_stderrPFormat0 - MWJava_MRJAppBuilder_stderrPTree - MWJava_MRJAppBuilder_stderrFile - MWJava_MRJAppBuilder_stderrAppendfalse - MWJava_MRJAppBuilder_stdinPType0 - MWJava_MRJAppBuilder_stdinPFormat0 - MWJava_MRJAppBuilder_stdinPTree - MWJava_MRJAppBuilder_stdinFile - - - MWJava_Output_outputtypeJarFile - MWJava_Output_outfileJavaClasses.jar - MWJava_Output_ftype1514754080 - MWJava_Output_fcreator1297570384 - MWJava_Output_compress0 - MWJava_Output_genManifest0 - MWJava_Output_trunctypeFront - MWJava_Output_deleteClasses0 - MWJava_Output_consoleApp1 - MWJava_Output_preverify0 - MWJava_Output_genJad0 - MWJava_Output_obfuscate0 - - - MWJava_Proj_projtypeApplet - MWJava_Proj_mainClassName - MWJava_Proj_HTMLAppCreator1145457748 - MWJava_Proj_HTMLAppNameMetrowerks Java - MWJava_Proj_PathVersion1 - MWJava_Proj_PathType0 - MWJava_Proj_PathFormat0 - MWJava_Proj_tree - MWJava_Proj_HTMLAppWin32NameInternet Explorer - MWJava_Proj_compress0 - MWJava_Proj_simulator0 - MWJava_Proj_useVM\000\000macosx - MWJava_Proj_vmarguments - MWJava_Proj_vmName - MWJava_Proj_simPropFile - - - MWJavaDoc_Proj_Version1 - MWJavaDoc_Proj_Deprecated1 - MWJavaDoc_Proj_Author1 - MWJavaDoc_Proj_Index1 - MWJavaDoc_Proj_Tree1 - MWJavaDoc_Proj_SunResolveToSame0 - MWJavaDoc_Proj_Shortnames1 - MWJavaDoc_Proj_Folder0 - MWJavaDoc_Proj_GenerateAPILinks0 - MWJavaDoc_Proj_scopePublic - MWJavaDoc_Proj_fcreator1297303877 - MWJavaDoc_Proj_encodingName - MWJavaDoc_Proj_decodingName - MWJavaDoc_Proj_javaPackagePathhttp://java.sun.com/products/jdk/1.1/docs/api/ - - - MWMerge_MacOS_projectTypeApplication - MWMerge_MacOS_outputNameMerge Out - MWMerge_MacOS_outputCreator???? - MWMerge_MacOS_outputTypeAPPL - MWMerge_MacOS_suppressWarning0 - MWMerge_MacOS_copyFragments1 - MWMerge_MacOS_copyResources1 - MWMerge_MacOS_flattenResource0 - MWMerge_MacOS_flatFileNamea.rsrc - MWMerge_MacOS_flatFileOutputPath - Path: - PathFormatMacOS - PathRootProject - - MWMerge_MacOS_skipResources - DLGX - ckid - Proj - WSPC - - - - FileLockedfalse - ResourcesMapIsReadOnlyfalse - PrinterDriverIsMultiFinderCompatiblefalse - Invisiblefalse - HasBundlefalse - NameLockedfalse - Stationeryfalse - HasCustomIconfalse - Sharedfalse - HasBeenInitedfalse - Label0 - Comments - - - MWMacOSPackager_UsePackager0 - MWMacOSPackager_FolderToPackage - Path - PathFormatMacOS - PathRootAbsolute - - MWMacOSPackager_CreateClassicAlias0 - MWMacOSPackager_ClassicAliasMethodUseTargetOutput - MWMacOSPackager_ClassicAliasPath - MWMacOSPackager_CreatePkgInfo0 - MWMacOSPackager_PkgCreatorType???? - MWMacOSPackager_PkgFileTypeAPPL - - - MWCodeGen_PPC_structalignmentPPC_mw - MWCodeGen_PPC_tracebacktablesInline - MWCodeGen_PPC_processorGeneric - MWCodeGen_PPC_function_align4 - MWCodeGen_PPC_tocdata1 - MWCodeGen_PPC_largetoc0 - MWCodeGen_PPC_profiler0 - MWCodeGen_PPC_vectortocdata0 - MWCodeGen_PPC_poolconst0 - MWCodeGen_PPC_peephole1 - MWCodeGen_PPC_readonlystrings0 - MWCodeGen_PPC_linkerpoolsstrings0 - MWCodeGen_PPC_volatileasm0 - MWCodeGen_PPC_schedule0 - MWCodeGen_PPC_altivec0 - MWCodeGen_PPC_altivec_move_block0 - MWCodeGen_PPC_strictIEEEfp0 - MWCodeGen_PPC_fpcontract1 - MWCodeGen_PPC_genfsel0 - MWCodeGen_PPC_orderedfpcmp0 - - - MWCodeGen_MachO_structalignmentPPC_mw - MWCodeGen_MachO_profiler_enumOff - MWCodeGen_MachO_processorGeneric - MWCodeGen_MachO_function_align4 - MWCodeGen_MachO_common0 - MWCodeGen_MachO_peephole1 - MWCodeGen_MachO_readonlystrings0 - MWCodeGen_MachO_linkerpoolsstrings1 - MWCodeGen_MachO_volatileasm0 - MWCodeGen_MachO_schedule0 - MWCodeGen_MachO_altivec0 - MWCodeGen_MachO_vecmove0 - MWCodeGen_MachO_fp_ieee_strict0 - MWCodeGen_MachO_fpcontract1 - MWCodeGen_MachO_genfsel0 - MWCodeGen_MachO_fp_cmps_ordered0 - - - MWDisassembler_PPC_showcode1 - MWDisassembler_PPC_extended1 - MWDisassembler_PPC_mix0 - MWDisassembler_PPC_nohex0 - MWDisassembler_PPC_showdata1 - MWDisassembler_PPC_showexceptions1 - MWDisassembler_PPC_showsym0 - MWDisassembler_PPC_shownames1 - - - GlobalOptimizer_PPC_optimizationlevelLevel0 - GlobalOptimizer_PPC_optforSpeed - - - MWLinker_PPC_linksym1 - MWLinker_PPC_symfullpath1 - MWLinker_PPC_linkmap0 - MWLinker_PPC_nolinkwarnings0 - MWLinker_PPC_dontdeadstripinitcode0 - MWLinker_PPC_permitmultdefs0 - MWLinker_PPC_linkmodeFast - MWLinker_PPC_initname - MWLinker_PPC_mainname__start - MWLinker_PPC_termname - - - MWLinker_MacOSX_linksym0 - MWLinker_MacOSX_symfullpath0 - MWLinker_MacOSX_nolinkwarnings0 - MWLinker_MacOSX_linkmap0 - MWLinker_MacOSX_dontdeadstripinitcode0 - MWLinker_MacOSX_permitmultdefs1 - MWLinker_MacOSX_use_objectivec_semantics0 - MWLinker_MacOSX_strip_debug_symbols0 - MWLinker_MacOSX_split_segs0 - MWLinker_MacOSX_report_msl_overloads0 - MWLinker_MacOSX_objects_follow_linkorder0 - MWLinker_MacOSX_linkmodeFast - MWLinker_MacOSX_exportsReferencedGlobals - MWLinker_MacOSX_sortcodeNone - MWLinker_MacOSX_mainnamestart - - - MWProject_MacOSX_typeLibrary - MWProject_MacOSX_outfiletif_PPC.lib - MWProject_MacOSX_filecreator???? - MWProject_MacOSX_filetype???? - MWProject_MacOSX_vmaddress0 - MWProject_MacOSX_usedefaultvmaddr1 - MWProject_MacOSX_flatrsrc0 - MWProject_MacOSX_flatrsrcfilename - MWProject_MacOSX_flatrsrcoutputdir - Path: - PathFormatMacOS - PathRootProject - - MWProject_MacOSX_installpath./ - MWProject_MacOSX_dont_prebind0 - MWProject_MacOSX_flat_namespace0 - MWProject_MacOSX_frameworkversionA - MWProject_MacOSX_currentversion0 - MWProject_MacOSX_flat_oldimpversion0 - - - MWLinker_MachO_exportsNone - MWLinker_MachO_mainnamestart - MWLinker_MachO_currentversion0 - MWLinker_MachO_compatibleversion0 - MWLinker_MachO_symfullpath0 - MWLinker_MachO_supresswarnings0 - MWLinker_MachO_multisymerror0 - MWLinker_MachO_prebind1 - MWLinker_MachO_deadstrip1 - MWLinker_MachO_objectivecsemantics0 - MWLinker_MachO_whichfileloaded0 - MWLinker_MachO_whyfileloaded0 - MWLinker_MachO_readonlyrelocsErrors - MWLinker_MachO_undefinedsymbolsErrors - MWLinker_MachO_twolevelnamespace1 - MWLinker_MachO_stripdebugsymbols0 - - - MWProject_MachO_typeExecutable - MWProject_MachO_outfilea.exe - MWProject_MachO_filecreator???? - MWProject_MachO_filetypeMEXE - MWProject_MachO_vmaddress4096 - MWProject_MachO_flatrsrc1 - MWProject_MachO_flatrsrcfilenamea.rsrc - MWProject_MachO_flatrsrcoutputdir - Path: - PathFormatMacOS - PathRootProject - - MWProject_MachO_installpath./ - MWProject_MachO_frameworkversion - - - MWPEF_exportsNone - MWPEF_libfolder0 - MWPEF_sortcodeNone - MWPEF_expandbss0 - MWPEF_sharedata0 - MWPEF_olddefversion0 - MWPEF_oldimpversion0 - MWPEF_currentversion0 - MWPEF_fragmentname - MWPEF_collapsereloads0 - - - MWProject_PPC_typeLibrary - MWProject_PPC_outfiletif_PPC.lib - MWProject_PPC_filecreator???? - MWProject_PPC_filetype???? - MWProject_PPC_size0 - MWProject_PPC_minsize0 - MWProject_PPC_stacksize0 - MWProject_PPC_flags0 - MWProject_PPC_symfilename - MWProject_PPC_rsrcname - MWProject_PPC_rsrcheaderNative - MWProject_PPC_rsrctype???? - MWProject_PPC_rsrcid0 - MWProject_PPC_rsrcflags0 - MWProject_PPC_rsrcstore0 - MWProject_PPC_rsrcmerge0 - MWProject_PPC_flatrsrc0 - MWProject_PPC_flatrsrcoutputdir - Path: - PathFormatMacOS - PathRootProject - - MWProject_PPC_flatrsrcfilename - - - MWAssembler_PPC_auxheader0 - MWAssembler_PPC_symmodeMac - MWAssembler_PPC_dialectPPC - MWAssembler_PPC_prefixfile - MWAssembler_PPC_typecheck0 - MWAssembler_PPC_warnings0 - MWAssembler_PPC_casesensitive0 - - - PList_OutputTypeFile - PList_OutputEncodingUTF-8 - PList_Prefix - PList_FileFilenameInfo.plist - PList_FileDirectory - Path: - PathFormatMacOS - PathRootProject - - PList_ResourceTypeplst - PList_ResourceID0 - PList_ResourceName - - - MWRez_Language_maxwidth80 - MWRez_Language_scriptRoman - MWRez_Language_alignmentAlign1 - MWRez_Language_filtermodeFilterSkip - MWRez_Language_suppresswarnings0 - MWRez_Language_escapecontrolchars1 - MWRez_Language_prefixname - MWRez_Language_filteredtypes'CODE' 'DATA' 'PICT' - - - MWWinRC_prefixname - - - MWCodeGen_X86_processorGeneric - MWCodeGen_X86_alignmentbytes8 - MWCodeGen_X86_exceptionsZeroOverhead - MWCodeGen_X86_name_manglingMWWin32 - MWCodeGen_X86_use_extinst0 - MWCodeGen_X86_extinst_mmx0 - MWCodeGen_X86_extinst_3dnow0 - MWCodeGen_X86_use_mmx_3dnow_convention0 - MWCodeGen_X86_extinst_cmov0 - MWCodeGen_X86_extinst_sse0 - MWCodeGen_X86_extinst_sse20 - MWCodeGen_X86_intrinsics0 - MWCodeGen_X86_optimizeasm0 - MWCodeGen_X86_disableopts0 - MWCodeGen_X86_profile0 - MWLinker_X86_runtimeCustom - MWCodeGen_X86_readonlystrings0 - - - MWLinker_X86_subsysmajorid4 - MWLinker_X86_subsysminorid0 - MWCOFF_X86_opsysmajorid4 - MWCOFF_X86_opsysminorid0 - MWLinker_X86_usrmajorid0 - MWLinker_X86_usrminorid0 - MWProject_X86_maxstacksize1024 - MWProject_X86_minstacksize4 - MWProject_X86_size1024 - MWProject_X86_minsize4 - MWCOFF_X86_coff_flags0 - MWCOFF_X86_dll_flags0 - MWProject_X86_baseaddress4194304 - MWCOFF_X86_filealign512 - MWCOFF_X86_sectionalign4096 - - - PDisasmX86_showHeaderstrue - PDisasmX86_showSectHeaderstrue - PDisasmX86_showSymTabtrue - PDisasmX86_showCodetrue - PDisasmX86_showDatatrue - PDisasmX86_showDebugfalse - PDisasmX86_showExceptionsfalse - PDisasmX86_showRawfalse - PDisasmX86_showAllRawfalse - PDisasmX86_showSourcefalse - PDisasmX86_showRelocationtrue - PDisasmX86_showHextrue - PDisasmX86_showCommentsfalse - PDisasmX86_showSymDefstrue - PDisasmX86_unmanglefalse - PDisasmX86_verbosefalse - PDisasmX86_resolveRelocstrue - PDisasmX86_resolveLocalsfalse - - - MWDebugger_X86_Exceptions - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - - - - GlobalOptimizer_X86_optimizationlevelLevel0 - GlobalOptimizer_X86_optforSpeed - - - MWLinker_X86_entrypointusageDefault - MWLinker_X86_entrypoint - MWLinker_X86_subsystemWinGUI - MWLinker_X86_commandfile - MWLinker_X86_generatemap0 - MWLinker_X86_linksym0 - MWLinker_X86_linkCV1 - MWLinker_X86_symfullpathfalse - MWLinker_X86_linkdebugtrue - MWLinker_X86_checksumfalse - MWLinker_X86_zero_init_bssfalse - MWLinker_X86_mergedatafalse - MWLinker_X86_usedefaultlibsfalse - MWLinker_X86_adddefaultlibsfalse - MWLinker_X86_nowarningsfalse - MWLinker_X86_verbosefalse - - - MWProject_X86_typeApplication - MWProject_X86_outfileNONAME.EXE - MWProject_X86_importlib - MWProject_X86_setimportlibdirfalse - MWProject_X86_dontgenerateimportlibfalse - MWProject_X86_oldformatlibfalse - MWProject_X86_replaceobjextensionfalse - MWProject_X86_copyallfilesfalse - - - - Name - tif_apple.c - MacOS - Text - Debug - - - Name - tif_aux.c - MacOS - Text - Debug - - - Name - tif_close.c - MacOS - Text - Debug - - - Name - tif_codec.c - MacOS - Text - Debug - - - Name - tif_compress.c - MacOS - Text - Debug - - - Name - tif_dir.c - MacOS - Text - Debug - - - Name - tif_dirinfo.c - MacOS - Text - Debug - - - Name - tif_dirread.c - MacOS - Text - Debug - - - Name - tif_dirwrite.c - MacOS - Text - Debug - - - Name - tif_dumpmode.c - MacOS - Text - Debug - - - Name - tif_error.c - MacOS - Text - Debug - - - Name - tif_fax3.c - MacOS - Text - Debug - - - Name - tif_fax3sm.c - MacOS - Text - Debug - - - Name - tif_flush.c - MacOS - Text - Debug - - - Name - tif_getimage.c - MacOS - Text - Debug - - - Name - tif_jpeg.c - MacOS - Text - Debug - - - Name - tif_luv.c - MacOS - Text - Debug - - - Name - tif_lzw.c - MacOS - Text - Debug - - - Name - tif_open.c - MacOS - Text - Debug - - - Name - tif_packbits.c - MacOS - Text - Debug - - - Name - tif_pixarlog.c - MacOS - Text - Debug - - - Name - tif_predict.c - MacOS - Text - Debug - - - Name - tif_print.c - MacOS - Text - Debug - - - Name - tif_read.c - MacOS - Text - Debug - - - Name - tif_strip.c - MacOS - Text - Debug - - - Name - tif_swab.c - MacOS - Text - Debug - - - Name - tif_thunder.c - MacOS - Text - Debug - - - Name - tif_tile.c - MacOS - Text - Debug - - - Name - tif_version.c - MacOS - Text - Debug - - - Name - tif_warning.c - MacOS - Text - Debug - - - Name - tif_write.c - MacOS - Text - Debug - - - Name - tif_zip.c - MacOS - Text - Debug - - - Name - tif_next.c - MacOS - Text - Debug - - - Name - tif_color.c - MacOS - Text - Debug - - - - - Name - tif_apple.c - MacOS - - - Name - tif_aux.c - MacOS - - - Name - tif_close.c - MacOS - - - Name - tif_codec.c - MacOS - - - Name - tif_compress.c - MacOS - - - Name - tif_dir.c - MacOS - - - Name - tif_dirinfo.c - MacOS - - - Name - tif_dirread.c - MacOS - - - Name - tif_dirwrite.c - MacOS - - - Name - tif_dumpmode.c - MacOS - - - Name - tif_error.c - MacOS - - - Name - tif_fax3.c - MacOS - - - Name - tif_fax3sm.c - MacOS - - - Name - tif_flush.c - MacOS - - - Name - tif_getimage.c - MacOS - - - Name - tif_jpeg.c - MacOS - - - Name - tif_luv.c - MacOS - - - Name - tif_lzw.c - MacOS - - - Name - tif_open.c - MacOS - - - Name - tif_packbits.c - MacOS - - - Name - tif_pixarlog.c - MacOS - - - Name - tif_predict.c - MacOS - - - Name - tif_print.c - MacOS - - - Name - tif_read.c - MacOS - - - Name - tif_strip.c - MacOS - - - Name - tif_swab.c - MacOS - - - Name - tif_thunder.c - MacOS - - - Name - tif_tile.c - MacOS - - - Name - tif_version.c - MacOS - - - Name - tif_warning.c - MacOS - - - Name - tif_write.c - MacOS - - - Name - tif_zip.c - MacOS - - - Name - tif_next.c - MacOS - - - Name - tif_color.c - MacOS - - - - - Mach-O - - - - UserSourceTrees - - - AlwaysSearchUserPathstrue - InterpretDOSAndUnixPathstrue - RequireFrameworkStyleIncludesfalse - UserSearchPaths - - SearchPath - Path: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path::zlib: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SystemSearchPaths - - SearchPath - PathMacOS X Support/Headers/(wchar_t Support fix) - PathFormatUnix - PathRootCodeWarrior - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Pathusr/include - PathFormatUnix - PathRootOS X Volume - - Recursivefalse - FrameworkPathfalse - HostFlagsAll - - - SearchPath - PathMSL/MSL_C - PathFormatUnix - PathRootCodeWarrior - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - PathMSL/MSL_C++ - PathFormatUnix - PathRootCodeWarrior - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - PathMacOS X Support - PathFormatUnix - PathRootCodeWarrior - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - PathSystem/Library/Frameworks - PathFormatUnix - PathRootOS X Volume - - Recursivefalse - FrameworkPathtrue - HostFlagsAll - - - - - MWRuntimeSettings_WorkingDirectory - MWRuntimeSettings_CommandLine - MWRuntimeSettings_HostApplication - Path - PathFormatGeneric - PathRootAbsolute - - MWRuntimeSettings_EnvVars - - - LinkerMacOS X PPC Linker - PreLinker - PostLinker - TargetnameMach-O - OutputDirectory - Path:::lib: - PathFormatMacOS - PathRootProject - - SaveEntriesUsingRelativePathsfalse - - - FileMappings - - FileTypeAPPL - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypeAppl - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypeMDYL - FileExtension - CompilerMachO Importer - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeMLIB - FileExtension - CompilerMachO Importer - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeMMLB - FileExtension - CompilerMachO Importer - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeMPLF - FileExtension - CompilerMachO Importer - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeMWCD - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypeRSRC - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.arr - Compiler - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.axp - Compiler - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.c - CompilerMW C/C++ PPC Mac OS X - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.c++ - CompilerMW C/C++ PPC Mac OS X - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.cc - CompilerMW C/C++ PPC Mac OS X - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.cp - CompilerMW C/C++ PPC Mac OS X - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.cpp - CompilerMW C/C++ PPC Mac OS X - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.exp - Compiler - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.h - CompilerMW C/C++ PPC Mac OS X - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMaketrue - - - FileTypeTEXT - FileExtension.h++ - CompilerMW C/C++ PPC Mac OS X - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMaketrue - - - FileTypeTEXT - FileExtension.hpp - CompilerMW C/C++ PPC Mac OS X - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMaketrue - - - FileTypeTEXT - FileExtension.lcf - Compiler - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.m - CompilerMW C/C++ PPC Mac OS X - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.mm - CompilerMW C/C++ PPC Mac OS X - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.pch - CompilerMW C/C++ PPC Mac OS X - EditLanguageC/C++ - Precompiletrue - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.pch++ - CompilerMW C/C++ PPC Mac OS X - EditLanguageC/C++ - Precompiletrue - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.pchm - CompilerMW C/C++ PPC Mac OS X - EditLanguageC/C++ - Precompiletrue - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.pchmm - CompilerMW C/C++ PPC Mac OS X - EditLanguageC/C++ - Precompiletrue - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.plc - CompilerProperty List Compiler - EditLanguageProperty List - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.ploc - CompilerProperty List Compiler - EditLanguageProperty List - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.r - CompilerRez - EditLanguageRez - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.wke - Compiler - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypedocu - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypersrc - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileExtension.a - CompilerMachO Importer - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileExtension.doc - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFilefalse - IgnoredByMaketrue - - - FileExtension.dylib - CompilerMachO Importer - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileExtension.gif - CompilerCopy To Package - EditLanguage - Precompilefalse - Launchabletrue - ResourceFilefalse - IgnoredByMaketrue - - - FileExtension.icns - CompilerCopy To Package - EditLanguage - Precompilefalse - Launchabletrue - ResourceFilefalse - IgnoredByMaketrue - - - FileExtension.jpg - CompilerCopy To Package - EditLanguage - Precompilefalse - Launchabletrue - ResourceFilefalse - IgnoredByMaketrue - - - FileExtension.lib - CompilerMachO Importer - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileExtension.nib - CompilerCopy To Package - EditLanguage - Precompilefalse - Launchabletrue - ResourceFilefalse - IgnoredByMaketrue - - - FileExtension.pl - CompilerPerl Tool - EditLanguagePerl - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileExtension.plist - CompilerCopy To Package - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMaketrue - - - FileExtension.ppob - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileExtension.psh - CompilerShell Tool - EditLanguage - Precompiletrue - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileExtension.rsrc - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileExtension.sh - CompilerShell Tool - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileExtension.strings - CompilerCopy To Package - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMaketrue - - - FileExtension.tiff - CompilerCopy To Package - EditLanguage - Precompilefalse - Launchabletrue - ResourceFilefalse - IgnoredByMaketrue - - - - - CacheModDatestrue - DumpBrowserInfofalse - CacheSubprojectstrue - UseThirdPartyDebuggerfalse - BrowserGenerator1 - DebuggerAppPath - Path - PathFormatGeneric - PathRootAbsolute - - DebuggerCmdLineArgs - DebuggerWorkingDir - Path - PathFormatGeneric - PathRootAbsolute - - CodeCompletionPrefixFileNameMacHeaders.c - CodeCompletionMacroFileNameMacOS_Carbon_C++_Macros.h - - - ConsoleEncoding0 - LogSystemMessagestrue - AutoTargetDLLsfalse - StopAtWatchpointstrue - PauseWhileRunningfalse - PauseInterval5 - PauseUIFlags0 - AltExePath - Path - PathFormatGeneric - PathRootAbsolute - - StopAtTempBPOnLaunchtrue - CacheSymbolicstrue - TempBPFunctionNamemain - TempBPType0 - - - Enabledfalse - ConnectionName - DownloadPath - LaunchRemoteAppfalse - RemoteAppPath - CoreID0 - JTAGClockSpeed8000 - IsMultiCorefalse - OSDownloadfalse - UseGlobalOSDownloadfalse - OSDownloadConnectionName - OSDownloadPath - AltDownloadfalse - AltDownloadConnectionName - - - OtherExecutables - - - CustomColor1 - Red0 - Green32767 - Blue0 - - CustomColor2 - Red0 - Green32767 - Blue0 - - CustomColor3 - Red0 - Green32767 - Blue0 - - CustomColor4 - Red0 - Green32767 - Blue0 - - - - MWFrontEnd_C_cplusplus0 - MWFrontEnd_C_checkprotos0 - MWFrontEnd_C_arm0 - MWFrontEnd_C_trigraphs0 - MWFrontEnd_C_onlystdkeywords0 - MWFrontEnd_C_enumsalwaysint0 - MWFrontEnd_C_mpwpointerstyle0 - MWFrontEnd_C_prefixname - MWFrontEnd_C_ansistrict0 - MWFrontEnd_C_mpwcnewline0 - MWFrontEnd_C_wchar_type1 - MWFrontEnd_C_enableexceptions1 - MWFrontEnd_C_dontreusestrings0 - MWFrontEnd_C_poolstrings0 - MWFrontEnd_C_dontinline0 - MWFrontEnd_C_useRTTI1 - MWFrontEnd_C_multibyteaware0 - MWFrontEnd_C_unsignedchars0 - MWFrontEnd_C_autoinline0 - MWFrontEnd_C_booltruefalse1 - MWFrontEnd_C_inlinelevel0 - MWFrontEnd_C_ecplusplus0 - MWFrontEnd_C_objective_c0 - MWFrontEnd_C_defer_codegen0 - MWFrontEnd_C_templateparser0 - MWFrontEnd_C_c990 - MWFrontEnd_C_bottomupinline1 - - - MWWarning_C_warn_illpragma1 - MWWarning_C_warn_emptydecl1 - MWWarning_C_warn_possunwant1 - MWWarning_C_warn_unusedvar0 - MWWarning_C_warn_unusedarg0 - MWWarning_C_warn_extracomma1 - MWWarning_C_pedantic1 - MWWarning_C_warningerrors0 - MWWarning_C_warn_hidevirtual1 - MWWarning_C_warn_implicitconv0 - MWWarning_C_warn_notinlined1 - MWWarning_C_warn_structclass1 - - - MWFTP_Post_hostName - MWFTP_Post_username - MWFTP_Post_password0ÿÀ°¥ðŒ"²¸ - MWFTP_Post_remoteDir - MWFTP_Post_ftp_PathVersion1 - MWFTP_Post_ftp_PathType0 - MWFTP_Post_ftp_PathFormat0 - MWFTP_Post_ftp_tree - MWFTP_Post_uploadDir - MWFTP_Post_ftp_port21 - MWFTP_Post_SendBin1 - MWFTP_Post_ShouldLog1 - - - MWCommandLine_Java_clsName - MWCommandLine_Java_args - - - MWVJavaDebugging_Protocol1 - MWVJavaDebugging_JDKVersion1 - MWVJavaDebugging_TimeOut25 - MWVJavaDebugging_SupportSlowDevicesfalse - MWVJavaDebugging_UseRemoteLaunchAgentfalse - MWVJavaDebugging_LaunchVMasServerfalse - - - MWJava_Language_optimizefalse - MWJava_Language_warnDeprecatedfalse - MWJava_Language_emitMapfalse - MWJava_Language_strictFileNamesfalse - MWJava_Language_strictFileHierarchyfalse - MWJava_Language_1_1_Compatiblefalse - MWJava_Language_emitHeaders0 - MWJava_Language_headerTypeJNINativeHeaders - MWJava_Language_packageFilter - MWJava_Language_genCommentstrue - MWJava_Language_genHeadersfalse - MWJava_Language_enableAssertsfalse - MWJava_Language_targetVM1.1 - - - Manifest-JAD Attributes - - AttributeMain-Class - ValueAuto-Generated - - - - - MWJava_MRJAppBuilder_outFileMRJApplication - MWJava_MRJAppBuilder_mergefalse - MWJava_MRJAppBuilder_quitMenutrue - MWJava_MRJAppBuilder_growfalse - MWJava_MRJAppBuilder_stdoutTypeConsole - MWJava_MRJAppBuilder_stderrTypeConsole - MWJava_MRJAppBuilder_stdinTypeConsole - MWJava_MRJAppBuilder_appIconPVersion0 - MWJava_MRJAppBuilder_appIconPType0 - MWJava_MRJAppBuilder_appIconPFormat0 - MWJava_MRJAppBuilder_appIconPTree - MWJava_MRJAppBuilder_appIconFile - MWJava_MRJAppBuilder_splashScreenPVersion0 - MWJava_MRJAppBuilder_splashScreenPType0 - MWJava_MRJAppBuilder_splashScreenPFormat0 - MWJava_MRJAppBuilder_splashScreenPTree - MWJava_MRJAppBuilder_splashScreenPICTFile - MWJava_MRJAppBuilder_aboutName - MWJava_MRJAppBuilder_stdoutPVersion0 - MWJava_MRJAppBuilder_stdoutPType0 - MWJava_MRJAppBuilder_stdoutPFormat0 - MWJava_MRJAppBuilder_stdoutPTree - MWJava_MRJAppBuilder_stdoutFile - MWJava_MRJAppBuilder_stdoutAppendfalse - MWJava_MRJAppBuilder_stderrPType0 - MWJava_MRJAppBuilder_stderrPFormat0 - MWJava_MRJAppBuilder_stderrPTree - MWJava_MRJAppBuilder_stderrFile - MWJava_MRJAppBuilder_stderrAppendfalse - MWJava_MRJAppBuilder_stdinPType0 - MWJava_MRJAppBuilder_stdinPFormat0 - MWJava_MRJAppBuilder_stdinPTree - MWJava_MRJAppBuilder_stdinFile - - - MWJava_Output_outputtypeJarFile - MWJava_Output_outfileJavaClasses.jar - MWJava_Output_ftype1514754080 - MWJava_Output_fcreator1297570384 - MWJava_Output_compress0 - MWJava_Output_genManifest0 - MWJava_Output_trunctypeFront - MWJava_Output_deleteClasses0 - MWJava_Output_consoleApp1 - MWJava_Output_preverify0 - MWJava_Output_genJad0 - MWJava_Output_obfuscate0 - - - MWJava_Proj_projtypeApplet - MWJava_Proj_mainClassName - MWJava_Proj_HTMLAppCreator1145457748 - MWJava_Proj_HTMLAppNameMetrowerks Java - MWJava_Proj_PathVersion1 - MWJava_Proj_PathType0 - MWJava_Proj_PathFormat0 - MWJava_Proj_tree - MWJava_Proj_HTMLAppWin32NameInternet Explorer - MWJava_Proj_compress0 - MWJava_Proj_simulator0 - MWJava_Proj_useVM\000\000macosx - MWJava_Proj_vmarguments - MWJava_Proj_vmName - MWJava_Proj_simPropFile - - - MWJavaDoc_Proj_Version1 - MWJavaDoc_Proj_Deprecated1 - MWJavaDoc_Proj_Author1 - MWJavaDoc_Proj_Index1 - MWJavaDoc_Proj_Tree1 - MWJavaDoc_Proj_SunResolveToSame0 - MWJavaDoc_Proj_Shortnames1 - MWJavaDoc_Proj_Folder0 - MWJavaDoc_Proj_GenerateAPILinks0 - MWJavaDoc_Proj_scopePublic - MWJavaDoc_Proj_fcreator1297303877 - MWJavaDoc_Proj_encodingName - MWJavaDoc_Proj_decodingName - MWJavaDoc_Proj_javaPackagePathhttp://java.sun.com/products/jdk/1.1/docs/api/ - - - MWMerge_MacOS_projectTypeApplication - MWMerge_MacOS_outputNameMerge Out - MWMerge_MacOS_outputCreator???? - MWMerge_MacOS_outputTypeAPPL - MWMerge_MacOS_suppressWarning0 - MWMerge_MacOS_copyFragments1 - MWMerge_MacOS_copyResources1 - MWMerge_MacOS_flattenResource0 - MWMerge_MacOS_flatFileNamea.rsrc - MWMerge_MacOS_flatFileOutputPath - Path: - PathFormatMacOS - PathRootProject - - MWMerge_MacOS_skipResources - DLGX - ckid - Proj - WSPC - - - - FileLockedfalse - ResourcesMapIsReadOnlyfalse - PrinterDriverIsMultiFinderCompatiblefalse - Invisiblefalse - HasBundlefalse - NameLockedfalse - Stationeryfalse - HasCustomIconfalse - Sharedfalse - HasBeenInitedfalse - Label0 - Comments - - - MWMacOSPackager_UsePackager0 - MWMacOSPackager_FolderToPackage - Path - PathFormatMacOS - PathRootAbsolute - - MWMacOSPackager_CreateClassicAlias0 - MWMacOSPackager_ClassicAliasMethodUseTargetOutput - MWMacOSPackager_ClassicAliasPath - MWMacOSPackager_CreatePkgInfo0 - MWMacOSPackager_PkgCreatorType???? - MWMacOSPackager_PkgFileTypeAPPL - - - MWCodeGen_PPC_structalignmentPPC_mw - MWCodeGen_PPC_tracebacktablesInline - MWCodeGen_PPC_processorGeneric - MWCodeGen_PPC_function_align4 - MWCodeGen_PPC_tocdata1 - MWCodeGen_PPC_largetoc0 - MWCodeGen_PPC_profiler0 - MWCodeGen_PPC_vectortocdata0 - MWCodeGen_PPC_poolconst0 - MWCodeGen_PPC_peephole1 - MWCodeGen_PPC_readonlystrings0 - MWCodeGen_PPC_linkerpoolsstrings0 - MWCodeGen_PPC_volatileasm0 - MWCodeGen_PPC_schedule0 - MWCodeGen_PPC_altivec0 - MWCodeGen_PPC_altivec_move_block0 - MWCodeGen_PPC_strictIEEEfp0 - MWCodeGen_PPC_fpcontract1 - MWCodeGen_PPC_genfsel0 - MWCodeGen_PPC_orderedfpcmp0 - - - MWCodeGen_MachO_structalignmentPPC_mw - MWCodeGen_MachO_profiler_enumOff - MWCodeGen_MachO_processorGeneric - MWCodeGen_MachO_function_align4 - MWCodeGen_MachO_common0 - MWCodeGen_MachO_peephole1 - MWCodeGen_MachO_readonlystrings0 - MWCodeGen_MachO_linkerpoolsstrings1 - MWCodeGen_MachO_volatileasm0 - MWCodeGen_MachO_schedule0 - MWCodeGen_MachO_altivec0 - MWCodeGen_MachO_vecmove0 - MWCodeGen_MachO_fp_ieee_strict0 - MWCodeGen_MachO_fpcontract1 - MWCodeGen_MachO_genfsel0 - MWCodeGen_MachO_fp_cmps_ordered0 - - - MWDisassembler_PPC_showcode1 - MWDisassembler_PPC_extended1 - MWDisassembler_PPC_mix0 - MWDisassembler_PPC_nohex0 - MWDisassembler_PPC_showdata1 - MWDisassembler_PPC_showexceptions1 - MWDisassembler_PPC_showsym0 - MWDisassembler_PPC_shownames1 - - - GlobalOptimizer_PPC_optimizationlevelLevel0 - GlobalOptimizer_PPC_optforSpeed - - - MWLinker_PPC_linksym1 - MWLinker_PPC_symfullpath1 - MWLinker_PPC_linkmap0 - MWLinker_PPC_nolinkwarnings0 - MWLinker_PPC_dontdeadstripinitcode0 - MWLinker_PPC_permitmultdefs0 - MWLinker_PPC_linkmodeFast - MWLinker_PPC_initname - MWLinker_PPC_mainname__start - MWLinker_PPC_termname - - - MWLinker_MacOSX_linksym0 - MWLinker_MacOSX_symfullpath0 - MWLinker_MacOSX_nolinkwarnings0 - MWLinker_MacOSX_linkmap0 - MWLinker_MacOSX_dontdeadstripinitcode0 - MWLinker_MacOSX_permitmultdefs1 - MWLinker_MacOSX_use_objectivec_semantics0 - MWLinker_MacOSX_strip_debug_symbols0 - MWLinker_MacOSX_split_segs0 - MWLinker_MacOSX_report_msl_overloads0 - MWLinker_MacOSX_objects_follow_linkorder0 - MWLinker_MacOSX_linkmodeFast - MWLinker_MacOSX_exportsReferencedGlobals - MWLinker_MacOSX_sortcodeNone - MWLinker_MacOSX_mainnamestart - - - MWProject_MacOSX_typeLibrary - MWProject_MacOSX_outfiletif_MACH.lib - MWProject_MacOSX_filecreator???? - MWProject_MacOSX_filetype???? - MWProject_MacOSX_vmaddress0 - MWProject_MacOSX_usedefaultvmaddr1 - MWProject_MacOSX_flatrsrc0 - MWProject_MacOSX_flatrsrcfilename - MWProject_MacOSX_flatrsrcoutputdir - Path: - PathFormatMacOS - PathRootProject - - MWProject_MacOSX_installpath./ - MWProject_MacOSX_dont_prebind0 - MWProject_MacOSX_flat_namespace0 - MWProject_MacOSX_frameworkversionA - MWProject_MacOSX_currentversion0 - MWProject_MacOSX_flat_oldimpversion0 - - - MWLinker_MachO_exportsNone - MWLinker_MachO_mainnamestart - MWLinker_MachO_currentversion0 - MWLinker_MachO_compatibleversion0 - MWLinker_MachO_symfullpath0 - MWLinker_MachO_supresswarnings0 - MWLinker_MachO_multisymerror0 - MWLinker_MachO_prebind1 - MWLinker_MachO_deadstrip1 - MWLinker_MachO_objectivecsemantics0 - MWLinker_MachO_whichfileloaded0 - MWLinker_MachO_whyfileloaded0 - MWLinker_MachO_readonlyrelocsErrors - MWLinker_MachO_undefinedsymbolsErrors - MWLinker_MachO_twolevelnamespace1 - MWLinker_MachO_stripdebugsymbols0 - - - MWProject_MachO_typeExecutable - MWProject_MachO_outfilea.exe - MWProject_MachO_filecreator???? - MWProject_MachO_filetypeMEXE - MWProject_MachO_vmaddress4096 - MWProject_MachO_flatrsrc1 - MWProject_MachO_flatrsrcfilenamea.rsrc - MWProject_MachO_flatrsrcoutputdir - Path: - PathFormatMacOS - PathRootProject - - MWProject_MachO_installpath./ - MWProject_MachO_frameworkversion - - - MWPEF_exportsNone - MWPEF_libfolder0 - MWPEF_sortcodeNone - MWPEF_expandbss0 - MWPEF_sharedata0 - MWPEF_olddefversion0 - MWPEF_oldimpversion0 - MWPEF_currentversion0 - MWPEF_fragmentname - MWPEF_collapsereloads0 - - - MWProject_PPC_typeLibrary - MWProject_PPC_outfiletif_PPC.lib - MWProject_PPC_filecreator???? - MWProject_PPC_filetype???? - MWProject_PPC_size0 - MWProject_PPC_minsize0 - MWProject_PPC_stacksize0 - MWProject_PPC_flags0 - MWProject_PPC_symfilename - MWProject_PPC_rsrcname - MWProject_PPC_rsrcheaderNative - MWProject_PPC_rsrctype???? - MWProject_PPC_rsrcid0 - MWProject_PPC_rsrcflags0 - MWProject_PPC_rsrcstore0 - MWProject_PPC_rsrcmerge0 - MWProject_PPC_flatrsrc0 - MWProject_PPC_flatrsrcoutputdir - Path: - PathFormatMacOS - PathRootProject - - MWProject_PPC_flatrsrcfilename - - - MWAssembler_PPC_auxheader0 - MWAssembler_PPC_symmodeMac - MWAssembler_PPC_dialectPPC - MWAssembler_PPC_prefixfile - MWAssembler_PPC_typecheck0 - MWAssembler_PPC_warnings0 - MWAssembler_PPC_casesensitive0 - - - PList_OutputTypeFile - PList_OutputEncodingUTF-8 - PList_Prefix - PList_FileFilenameInfo.plist - PList_FileDirectory - Path: - PathFormatMacOS - PathRootProject - - PList_ResourceTypeplst - PList_ResourceID0 - PList_ResourceName - - - MWRez_Language_maxwidth80 - MWRez_Language_scriptRoman - MWRez_Language_alignmentAlign1 - MWRez_Language_filtermodeFilterSkip - MWRez_Language_suppresswarnings0 - MWRez_Language_escapecontrolchars1 - MWRez_Language_prefixname - MWRez_Language_filteredtypes'CODE' 'DATA' 'PICT' - - - MWWinRC_prefixname - - - MWCodeGen_X86_processorGeneric - MWCodeGen_X86_alignmentbytes8 - MWCodeGen_X86_exceptionsZeroOverhead - MWCodeGen_X86_name_manglingMWWin32 - MWCodeGen_X86_use_extinst0 - MWCodeGen_X86_extinst_mmx0 - MWCodeGen_X86_extinst_3dnow0 - MWCodeGen_X86_use_mmx_3dnow_convention0 - MWCodeGen_X86_extinst_cmov0 - MWCodeGen_X86_extinst_sse0 - MWCodeGen_X86_extinst_sse20 - MWCodeGen_X86_intrinsics0 - MWCodeGen_X86_optimizeasm0 - MWCodeGen_X86_disableopts0 - MWCodeGen_X86_profile0 - MWLinker_X86_runtimeCustom - MWCodeGen_X86_readonlystrings0 - - - MWLinker_X86_subsysmajorid4 - MWLinker_X86_subsysminorid0 - MWCOFF_X86_opsysmajorid4 - MWCOFF_X86_opsysminorid0 - MWLinker_X86_usrmajorid0 - MWLinker_X86_usrminorid0 - MWProject_X86_maxstacksize1024 - MWProject_X86_minstacksize4 - MWProject_X86_size1024 - MWProject_X86_minsize4 - MWCOFF_X86_coff_flags0 - MWCOFF_X86_dll_flags0 - MWProject_X86_baseaddress4194304 - MWCOFF_X86_filealign512 - MWCOFF_X86_sectionalign4096 - - - PDisasmX86_showHeaderstrue - PDisasmX86_showSectHeaderstrue - PDisasmX86_showSymTabtrue - PDisasmX86_showCodetrue - PDisasmX86_showDatatrue - PDisasmX86_showDebugfalse - PDisasmX86_showExceptionsfalse - PDisasmX86_showRawfalse - PDisasmX86_showAllRawfalse - PDisasmX86_showSourcefalse - PDisasmX86_showRelocationtrue - PDisasmX86_showHextrue - PDisasmX86_showCommentsfalse - PDisasmX86_showSymDefstrue - PDisasmX86_unmanglefalse - PDisasmX86_verbosefalse - PDisasmX86_resolveRelocstrue - PDisasmX86_resolveLocalsfalse - - - MWDebugger_X86_Exceptions - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - - - - GlobalOptimizer_X86_optimizationlevelLevel0 - GlobalOptimizer_X86_optforSpeed - - - MWLinker_X86_entrypointusageDefault - MWLinker_X86_entrypoint - MWLinker_X86_subsystemWinGUI - MWLinker_X86_commandfile - MWLinker_X86_generatemap0 - MWLinker_X86_linksym0 - MWLinker_X86_linkCV1 - MWLinker_X86_symfullpathfalse - MWLinker_X86_linkdebugtrue - MWLinker_X86_checksumfalse - MWLinker_X86_zero_init_bssfalse - MWLinker_X86_mergedatafalse - MWLinker_X86_usedefaultlibsfalse - MWLinker_X86_adddefaultlibsfalse - MWLinker_X86_nowarningsfalse - MWLinker_X86_verbosefalse - - - MWProject_X86_typeApplication - MWProject_X86_outfileNONAME.EXE - MWProject_X86_importlib - MWProject_X86_setimportlibdirfalse - MWProject_X86_dontgenerateimportlibfalse - MWProject_X86_oldformatlibfalse - MWProject_X86_replaceobjextensionfalse - MWProject_X86_copyallfilesfalse - - - - Name - tif_apple.c - MacOS - Text - Debug - - - Name - tif_aux.c - MacOS - Text - Debug - - - Name - tif_close.c - MacOS - Text - Debug - - - Name - tif_codec.c - MacOS - Text - Debug - - - Name - tif_compress.c - MacOS - Text - Debug - - - Name - tif_dir.c - MacOS - Text - Debug - - - Name - tif_dirinfo.c - MacOS - Text - Debug - - - Name - tif_dirread.c - MacOS - Text - Debug - - - Name - tif_dirwrite.c - MacOS - Text - Debug - - - Name - tif_dumpmode.c - MacOS - Text - Debug - - - Name - tif_error.c - MacOS - Text - Debug - - - Name - tif_fax3.c - MacOS - Text - Debug - - - Name - tif_fax3sm.c - MacOS - Text - Debug - - - Name - tif_flush.c - MacOS - Text - Debug - - - Name - tif_getimage.c - MacOS - Text - Debug - - - Name - tif_jpeg.c - MacOS - Text - Debug - - - Name - tif_luv.c - MacOS - Text - Debug - - - Name - tif_lzw.c - MacOS - Text - Debug - - - Name - tif_open.c - MacOS - Text - Debug - - - Name - tif_packbits.c - MacOS - Text - Debug - - - Name - tif_pixarlog.c - MacOS - Text - Debug - - - Name - tif_predict.c - MacOS - Text - Debug - - - Name - tif_print.c - MacOS - Text - Debug - - - Name - tif_read.c - MacOS - Text - Debug - - - Name - tif_strip.c - MacOS - Text - Debug - - - Name - tif_swab.c - MacOS - Text - Debug - - - Name - tif_thunder.c - MacOS - Text - Debug - - - Name - tif_tile.c - MacOS - Text - Debug - - - Name - tif_version.c - MacOS - Text - Debug - - - Name - tif_warning.c - MacOS - Text - Debug - - - Name - tif_write.c - MacOS - Text - Debug - - - Name - tif_zip.c - MacOS - Text - Debug - - - Name - tif_next.c - MacOS - Text - Debug - - - Name - tif_color.c - MacOS - Text - Debug - - - - - Name - tif_apple.c - MacOS - - - Name - tif_aux.c - MacOS - - - Name - tif_close.c - MacOS - - - Name - tif_codec.c - MacOS - - - Name - tif_compress.c - MacOS - - - Name - tif_dir.c - MacOS - - - Name - tif_dirinfo.c - MacOS - - - Name - tif_dirread.c - MacOS - - - Name - tif_dirwrite.c - MacOS - - - Name - tif_dumpmode.c - MacOS - - - Name - tif_error.c - MacOS - - - Name - tif_fax3.c - MacOS - - - Name - tif_fax3sm.c - MacOS - - - Name - tif_flush.c - MacOS - - - Name - tif_getimage.c - MacOS - - - Name - tif_jpeg.c - MacOS - - - Name - tif_luv.c - MacOS - - - Name - tif_lzw.c - MacOS - - - Name - tif_open.c - MacOS - - - Name - tif_packbits.c - MacOS - - - Name - tif_pixarlog.c - MacOS - - - Name - tif_predict.c - MacOS - - - Name - tif_print.c - MacOS - - - Name - tif_read.c - MacOS - - - Name - tif_strip.c - MacOS - - - Name - tif_swab.c - MacOS - - - Name - tif_thunder.c - MacOS - - - Name - tif_tile.c - MacOS - - - Name - tif_version.c - MacOS - - - Name - tif_warning.c - MacOS - - - Name - tif_write.c - MacOS - - - Name - tif_zip.c - MacOS - - - Name - tif_next.c - MacOS - - - Name - tif_color.c - MacOS - - - - - - Name - Carbon.framework - Unix - - Carbon - - - - - - - PPC - Mach-O - - - - - PPC - Name - tif_apple.c - MacOS - - - PPC - Name - tif_aux.c - MacOS - - - PPC - Name - tif_close.c - MacOS - - - PPC - Name - tif_codec.c - MacOS - - - PPC - Name - tif_color.c - MacOS - - - PPC - Name - tif_compress.c - MacOS - - - PPC - Name - tif_dir.c - MacOS - - - PPC - Name - tif_dirinfo.c - MacOS - - - PPC - Name - tif_dirread.c - MacOS - - - PPC - Name - tif_dirwrite.c - MacOS - - - PPC - Name - tif_dumpmode.c - MacOS - - - PPC - Name - tif_error.c - MacOS - - - PPC - Name - tif_fax3.c - MacOS - - - PPC - Name - tif_fax3sm.c - MacOS - - - PPC - Name - tif_flush.c - MacOS - - - PPC - Name - tif_getimage.c - MacOS - - - PPC - Name - tif_jpeg.c - MacOS - - - PPC - Name - tif_luv.c - MacOS - - - PPC - Name - tif_lzw.c - MacOS - - - PPC - Name - tif_next.c - MacOS - - - PPC - Name - tif_open.c - MacOS - - - PPC - Name - tif_packbits.c - MacOS - - - PPC - Name - tif_pixarlog.c - MacOS - - - PPC - Name - tif_predict.c - MacOS - - - PPC - Name - tif_print.c - MacOS - - - PPC - Name - tif_read.c - MacOS - - - PPC - Name - tif_strip.c - MacOS - - - PPC - Name - tif_swab.c - MacOS - - - PPC - Name - tif_thunder.c - MacOS - - - PPC - Name - tif_tile.c - MacOS - - - PPC - Name - tif_version.c - MacOS - - - PPC - Name - tif_warning.c - MacOS - - - PPC - Name - tif_write.c - MacOS - - - PPC - Name - tif_zip.c - MacOS - - - - diff --git a/wxWidgets/src/tiff/tiff_CW_Prefix.h b/wxWidgets/src/tiff/tiff_CW_Prefix.h deleted file mode 100644 index 68b8f58afd..0000000000 --- a/wxWidgets/src/tiff/tiff_CW_Prefix.h +++ /dev/null @@ -1,12 +0,0 @@ -#define NEED_STRDUP -#define WINVER 0x0400 - -/* - We need to make sure some symbols required for correct use of - Win32 SDK headers (and that some of these headers are included - to begin with). The best way is to simply include one of the - ANSI headers. -*/ - -#include - diff --git a/wxWidgets/src/tiff/tiffcomp.h b/wxWidgets/src/tiff/tiffcomp.h deleted file mode 100644 index 0b1aa4c6c5..0000000000 --- a/wxWidgets/src/tiff/tiffcomp.h +++ /dev/null @@ -1,225 +0,0 @@ -/* $Header$ */ - -/* - * Copyright (c) 1990-1997 Sam Leffler - * Copyright (c) 1991-1997 Silicon Graphics, Inc. - * - * Permission to use, copy, modify, distribute, and sell this software and - * its documentation for any purpose is hereby granted without fee, provided - * that (i) the above copyright notices and this permission notice appear in - * all copies of the software and related documentation, and (ii) the names of - * Sam Leffler and Silicon Graphics may not be used in any advertising or - * publicity relating to the software without the specific, prior written - * permission of Sam Leffler and Silicon Graphics. - * - * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, - * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * - * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR - * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, - * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF - * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE - * OF THIS SOFTWARE. - */ - -#ifndef _COMPAT_ -#define _COMPAT_ -/* - * This file contains a hodgepodge of definitions and - * declarations that are needed to provide compatibility - * between the native system and the base implementation - * that the library assumes. - * - * NB: This file is a mess. - */ - -/* - * Setup basic type definitions and function declaratations. - */ - -/* - * Simplify Acorn RISC OS identifier (to avoid confusion with Acorn RISC iX - * and with defunct Unix Risc OS) - * No need to specify __arm - hey, Acorn might port the OS, no problem here! - */ -#ifdef __acornriscos -#undef __acornriscos -#endif -#if defined(__acorn) && defined(__riscos) -#define __acornriscos -#endif - -#if (defined(__MWERKS__) && !defined(__MACH__)) || defined(THINK_C) -#include -#include -#endif - -#include - -#if defined(__PPCC__) || ( defined(__SC__) && !defined(__DMC__) ) || defined(__MRC__) -#include -#elif !defined(__MWERKS__) && !defined(THINK_C) && !defined(__acornriscos) && !defined(applec) -#include -#endif - -#if defined(VMS) -#include -#include -#elif !defined(__acornriscos) -#include -#endif - -/* - * This maze of checks controls defines or not the - * target system has BSD-style typdedefs declared in - * an include file and/or whether or not to include - * to get the SEEK_* definitions. Some - * additional includes are also done to pull in the - * appropriate definitions we're looking for. - */ -#if defined(__MWERKS__) || defined(THINK_C) || defined(__PPCC__) || ( defined(__SC__) && !defined(__DMC__) ) || defined(__MRC__) -#include -#define BSDTYPES -#define HAVE_UNISTD_H 0 -#elif (defined(_WINDOWS) || defined(__WIN32__) || defined(_Windows) || defined(_WIN32)) && !defined(unix) -#define BSDTYPES -#elif defined(OS2_16) || defined(OS2_32) -#define BSDTYPES -#elif defined(__MSDOS__) -#define BSDTYPES -#elif defined(__acornriscos) -#include -#define BSDTYPES -#define HAVE_UNISTD_H 0 -#elif defined(VMS) -#define HAVE_UNISTD_H 0 -#else -#define HAVE_UNISTD_H 1 -#endif - -/* - * The library uses the ANSI C/POSIX SEEK_* - * definitions that should be defined in unistd.h - * (except on system where they are in stdio.h and - * there is no unistd.h). - */ -#if !defined(SEEK_SET) && HAVE_UNISTD_H -#include -#endif - -/* - * The library uses memset, memcpy, and memcmp. - * ANSI C and System V define these in string.h. - */ -#include - -/* - * The BSD typedefs are used throughout the library. - * If your system doesn't have them in , - * then define BSDTYPES in your Makefile. - */ -#if defined(BSDTYPES) -# ifndef _BSDTYPES_DEFINED -# ifndef __u_char_defined -typedef unsigned char u_char; -typedef unsigned short u_short; -typedef unsigned int u_int; -typedef unsigned long u_long; -# define __u_char_defined -# endif /* __u_char_defined */ -# define _BSDTYPES_DEFINED -# endif /* _BSDTYPES_DEFINED */ -#endif /* BSDTYPES */ - -/* - * dblparam_t is the type that a double precision - * floating point value will have on the parameter - * stack (when coerced by the compiler). - */ -/* Note: on MacPowerPC "extended" is undefined. So only use it for 68K-Macs */ -#if ( defined(__SC__) && !defined(__DMC__) ) || defined(THINK_C) -typedef extended dblparam_t; -#else -typedef double dblparam_t; -#endif - -/* - * If your compiler supports inline functions, then - * set INLINE appropriately to get the known hotspots - * in the library expanded inline. - */ -#if defined(__GNUC__) -#if defined(__STRICT_ANSI__) -#define INLINE __inline__ -#else -#define INLINE inline -#endif -#else /* !__GNUC__ */ -#define INLINE -#endif - -/* - * GLOBALDATA is a macro that is used to define global variables - * private to the library. We use this indirection to hide - * brain-damage in VAXC (and GCC) under VAX/VMS. In these - * environments the macro places the variable in a non-shareable - * program section, which ought to be done by default (sigh!) - * - * Apparently DEC are aware of the problem as this behaviour is the - * default under VMS on AXP. - * - * The GNU C variant is untested. - */ -#if defined(VAX) && defined(VMS) -#if defined(VAXC) -#define GLOBALDATA(TYPE,NAME) extern noshare TYPE NAME -#endif -#if defined(__GNUC__) -#define GLOBALDATA(TYPE,NAME) extern TYPE NAME \ - asm("_$$PsectAttributes_NOSHR$$" #NAME) -#endif -#else /* !VAX/VMS */ -#define GLOBALDATA(TYPE,NAME) extern TYPE NAME -#endif - -#if defined(__acornriscos) -/* - * osfcn.h is part of C++Lib on Acorn C/C++, and as such can't be used - * on C alone. For that reason, the relevant functions are - * implemented in tif_acorn.c, and the elements from the header - * file are included here. - */ -#if defined(__cplusplus) -#include -#else -#define O_RDONLY 0 -#define O_WRONLY 1 -#define O_RDWR 2 -#define O_APPEND 8 -#define O_CREAT 0x200 -#define O_TRUNC 0x400 -typedef long off_t; -extern int open(const char *name, int flags, int mode); -extern int close(int fd); -extern int write(int fd, const char *buf, int nbytes); -extern int read(int fd, char *buf, int nbytes); -extern off_t lseek(int fd, off_t offset, int whence); -extern int creat(const char *path, int mode); -#endif /* __cplusplus */ -#endif /* __acornriscos */ - -/* Bit and byte order, the default is MSB to LSB */ -#ifdef VMS -#undef HOST_FILLORDER -#undef HOST_BIGENDIAN -#define HOST_FILLORDER FILLORDER_LSB2MSB -#define HOST_BIGENDIAN 0 -#endif - -#ifndef LINKAGEMODE - #define LINKAGEMODE -#endif - -#endif /* _COMPAT_ */ diff --git a/wxWidgets/src/tiff/tiffconf.h b/wxWidgets/src/tiff/tiffconf.h deleted file mode 100644 index 7ca5b081b1..0000000000 --- a/wxWidgets/src/tiff/tiffconf.h +++ /dev/null @@ -1,153 +0,0 @@ -/* $Header$ */ -/* - * Copyright (c) 1988-1997 Sam Leffler - * Copyright (c) 1991-1997 Silicon Graphics, Inc. - * - * Permission to use, copy, modify, distribute, and sell this software and - * its documentation for any purpose is hereby granted without fee, provided - * that (i) the above copyright notices and this permission notice appear in - * all copies of the software and related documentation, and (ii) the names of - * Sam Leffler and Silicon Graphics may not be used in any advertising or - * publicity relating to the software without the specific, prior written - * permission of Sam Leffler and Silicon Graphics. - * - * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, - * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * - * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR - * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, - * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF - * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE - * OF THIS SOFTWARE. - */ - -#ifndef _TIFFCONF_ -#define _TIFFCONF_ -/* - * Library Configuration Definitions. - * - * This file defines the default configuration for the library. - * If the target system does not have make or a way to specify - * #defines on the command line, this file can be edited to - * configure the library. Otherwise, one can override portability - * and configuration-related definitions from a Makefile or command - * line by defining COMPRESSION_SUPPORT (see below). - */ - -/* - * General portability-related defines: - * - * HAVE_IEEEFP define as 0 or 1 according to the floating point - * format suported by the machine - * BSDTYPES define this if your system does NOT define the - * usual 4BSD typedefs u_int et. al. - * HAVE_MMAP enable support for memory mapping read-only files; - * this is typically deduced by the configure script - * HOST_FILLORDER native cpu bit order: one of FILLORDER_MSB2LSB - * or FILLODER_LSB2MSB; this is typically set by the - * configure script - * HOST_BIGENDIAN native cpu byte order: 1 if big-endian (Motorola) - * or 0 if little-endian (Intel); this may be used - * in codecs to optimize code - * USE_64BIT_API set to 1 if tif_unix.c should use lseek64(), - * fstat64() and stat64 allowing 2-4GB files. - */ -#ifndef HAVE_IEEEFP -#define HAVE_IEEEFP 1 -#endif -#ifndef HOST_FILLORDER -#define HOST_FILLORDER FILLORDER_MSB2LSB -#endif -#ifndef HOST_BIGENDIAN -#define HOST_BIGENDIAN 1 -#endif - -#ifndef USE_64BIT_API -# define USE_64BIT_API 0 -#endif - -#ifndef COMPRESSION_SUPPORT -/* - * Compression support defines: - * - * CCITT_SUPPORT enable support for CCITT Group 3 & 4 algorithms - * PACKBITS_SUPPORT enable support for Macintosh PackBits algorithm - * LZW_SUPPORT enable support for LZW algorithm - * THUNDER_SUPPORT enable support for ThunderScan 4-bit RLE algorithm - * NEXT_SUPPORT enable support for NeXT 2-bit RLE algorithm - * OJPEG_SUPPORT enable support for 6.0-style JPEG DCT algorithms - * (requires IJG software) - * JPEG_SUPPORT enable support for post-6.0-style JPEG DCT algorithms - * (requires freely available IJG software, see tif_jpeg.c) - * ZIP_SUPPORT enable support for Deflate algorithm - * (requires freely available zlib software, see tif_zip.c) - * PIXARLOG_SUPPORT enable support for Pixar log-format algorithm - * LOGLUV_SUPPORT enable support for LogLuv high dynamic range encoding - */ -#define CCITT_SUPPORT -#define PACKBITS_SUPPORT -#define LZW_SUPPORT -#define THUNDER_SUPPORT -#define NEXT_SUPPORT -#define LOGLUV_SUPPORT -#endif /* COMPRESSION_SUPPORT */ - -/* - * If JPEG compression is enabled then we must also include - * support for the colorimetry and YCbCr-related tags. - */ -#ifdef JPEG_SUPPORT -#ifndef YCBCR_SUPPORT -#define YCBCR_SUPPORT -#endif -#ifndef COLORIMETRY_SUPPORT -#define COLORIMETRY_SUPPORT -#endif -#endif /* JPEG_SUPPORT */ - -/* - * ``Orthogonal Features'' - * - * STRIPCHOP_DEFAULT default handling of strip chopping support (whether - * or not to convert single-strip uncompressed images - * to mutiple strips of ~8Kb--to reduce memory use) - * SUBIFD_SUPPORT enable support for SubIFD tag (thumbnails and such) - * DEFAULT_EXTRASAMPLE_AS_ALPHA - * The RGBA interface will treat a fourth sample with - * no EXTRASAMPLE_ value as being ASSOCALPHA. Many - * packages produce RGBA files but don't mark the alpha - * properly. - * CHECK_JPEG_YCBCR_SUBSAMPLING - * Enable picking up YCbCr subsampling info from the - * JPEG data stream to support files lacking the tag. - * See Bug 168 in Bugzilla, and JPEGFixupTestSubsampling() - * for details. - */ -#ifndef STRIPCHOP_DEFAULT -#define STRIPCHOP_DEFAULT TIFF_STRIPCHOP /* default is to enable */ -#endif -#ifndef SUBIFD_SUPPORT -#define SUBIFD_SUPPORT 1 /* enable SubIFD tag (330) support */ -#endif -#ifndef DEFAULT_EXTRASAMPLE_AS_ALPHA -#define DEFAULT_EXTRASAMPLE_AS_ALPHA 1 -#endif -#ifndef CHECK_JPEG_YCBCR_SUBSAMPLING -#define CHECK_JPEG_YCBCR_SUBSAMPLING 1 -#endif - -/* - * Feature support definitions. - * XXX: These macros are obsoleted. Don't use them in your apps! - * Macros stays here for backward compatibility and should be always defined. - */ -#define COLORIMETRY_SUPPORT -#define YCBCR_SUPPORT -#define CMYK_SUPPORT -#define ICC_SUPPORT -#define PHOTOSHOP_SUPPORT -#define IPTC_SUPPORT - -#endif /* _TIFFCONF_ */ diff --git a/wxWidgets/src/tiff/tiffio.h b/wxWidgets/src/tiff/tiffio.h deleted file mode 100644 index 778f2f5941..0000000000 --- a/wxWidgets/src/tiff/tiffio.h +++ /dev/null @@ -1,477 +0,0 @@ -/* $Header$ */ - -/* - * Copyright (c) 1988-1997 Sam Leffler - * Copyright (c) 1991-1997 Silicon Graphics, Inc. - * - * Permission to use, copy, modify, distribute, and sell this software and - * its documentation for any purpose is hereby granted without fee, provided - * that (i) the above copyright notices and this permission notice appear in - * all copies of the software and related documentation, and (ii) the names of - * Sam Leffler and Silicon Graphics may not be used in any advertising or - * publicity relating to the software without the specific, prior written - * permission of Sam Leffler and Silicon Graphics. - * - * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, - * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * - * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR - * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, - * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF - * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE - * OF THIS SOFTWARE. - */ - -#ifndef _TIFFIO_ -#define _TIFFIO_ - -/* - * TIFF I/O Library Definitions. - */ -#include "tiff.h" -#include "tiffvers.h" - -/* - * TIFF is defined as an incomplete type to hide the - * library's internal data structures from clients. - */ -typedef struct tiff TIFF; - -/* - * The following typedefs define the intrinsic size of - * data types used in the *exported* interfaces. These - * definitions depend on the proper definition of types - * in tiff.h. Note also that the varargs interface used - * to pass tag types and values uses the types defined in - * tiff.h directly. - * - * NB: ttag_t is unsigned int and not unsigned short because - * ANSI C requires that the type before the ellipsis be a - * promoted type (i.e. one of int, unsigned int, pointer, - * or double) and because we defined pseudo-tags that are - * outside the range of legal Aldus-assigned tags. - * NB: tsize_t is int32 and not uint32 because some functions - * return -1. - * NB: toff_t is not off_t for many reasons; TIFFs max out at - * 32-bit file offsets being the most important, and to ensure - * that it is unsigned, rather than signed. - */ -typedef uint32 ttag_t; /* directory tag */ -typedef uint16 tdir_t; /* directory index */ -typedef uint16 tsample_t; /* sample number */ -typedef uint32 tstrip_t; /* strip number */ -typedef uint32 ttile_t; /* tile number */ -typedef int32 tsize_t; /* i/o size in bytes */ -typedef void* tdata_t; /* image data ref */ -typedef uint32 toff_t; /* file offset */ - -#if !defined(__WIN32__) && (defined(_WIN32) || defined(WIN32)) -#define __WIN32__ -#endif - -/* - * On windows you should define USE_WIN32_FILEIO if you are using tif_win32.c - * or AVOID_WIN32_FILEIO if you are using something else (like tif_unix.c). - * - * By default tif_win32.c is assumed on windows if not using the cygwin - * environment. - */ - -#if defined(_WINDOWS) || defined(__WIN32__) || defined(_Windows) -# if !defined(__CYGWIN) && !defined(AVOID_WIN32_FILEIO) && !defined(USE_WIN32_FILIO) -# define USE_WIN32_FILEIO -# endif -#endif - -#if defined(USE_WIN32_FILEIO) -#include -#ifdef __WIN32__ -DECLARE_HANDLE(thandle_t); /* Win32 file handle */ -#else -typedef HFILE thandle_t; /* client data handle */ -#endif -#else -typedef void* thandle_t; /* client data handle */ -#endif - -#ifndef NULL -#define NULL 0 -#endif - -/* - * Flags to pass to TIFFPrintDirectory to control - * printing of data structures that are potentially - * very large. Bit-or these flags to enable printing - * multiple items. - */ -#define TIFFPRINT_NONE 0x0 /* no extra info */ -#define TIFFPRINT_STRIPS 0x1 /* strips/tiles info */ -#define TIFFPRINT_CURVES 0x2 /* color/gray response curves */ -#define TIFFPRINT_COLORMAP 0x4 /* colormap */ -#define TIFFPRINT_JPEGQTABLES 0x100 /* JPEG Q matrices */ -#define TIFFPRINT_JPEGACTABLES 0x200 /* JPEG AC tables */ -#define TIFFPRINT_JPEGDCTABLES 0x200 /* JPEG DC tables */ - -/* - * Colour conversion stuff - */ - -/* reference white */ -#define D65_X0 (95.0470F) -#define D65_Y0 (100.0F) -#define D65_Z0 (108.8827F) - -#define D50_X0 (96.4250F) -#define D50_Y0 (100.0F) -#define D50_Z0 (82.4680F) - -/* Structure for holding information about a display device. */ - -typedef unsigned char TIFFRGBValue; /* 8-bit samples */ - -typedef struct { - float d_mat[3][3]; /* XYZ -> luminance matrix */ - float d_YCR; /* Light o/p for reference white */ - float d_YCG; - float d_YCB; - uint32 d_Vrwr; /* Pixel values for ref. white */ - uint32 d_Vrwg; - uint32 d_Vrwb; - float d_Y0R; /* Residual light for black pixel */ - float d_Y0G; - float d_Y0B; - float d_gammaR; /* Gamma values for the three guns */ - float d_gammaG; - float d_gammaB; -} TIFFDisplay; - -typedef struct { /* YCbCr->RGB support */ - TIFFRGBValue* clamptab; /* range clamping table */ - int* Cr_r_tab; - int* Cb_b_tab; - int32* Cr_g_tab; - int32* Cb_g_tab; - int32* Y_tab; -} TIFFYCbCrToRGB; - -typedef struct { /* CIE Lab 1976->RGB support */ - int range; /* Size of conversion table */ -#define CIELABTORGB_TABLE_RANGE 1500 - float rstep, gstep, bstep; - float X0, Y0, Z0; /* Reference white point */ - TIFFDisplay display; - float Yr2r[CIELABTORGB_TABLE_RANGE + 1]; /* Conversion of Yr to r */ - float Yg2g[CIELABTORGB_TABLE_RANGE + 1]; /* Conversion of Yg to g */ - float Yb2b[CIELABTORGB_TABLE_RANGE + 1]; /* Conversion of Yb to b */ -} TIFFCIELabToRGB; - -extern int TIFFCIELabToRGBInit(TIFFCIELabToRGB*, TIFFDisplay *, float*); -extern void TIFFCIELabToXYZ(TIFFCIELabToRGB *, uint32, int32, int32, - float *, float *, float *); -extern void TIFFXYZToRGB(TIFFCIELabToRGB *, float, float, float, - uint32 *, uint32 *, uint32 *); - -extern int TIFFYCbCrToRGBInit(TIFFYCbCrToRGB*, float*, float*); -extern void TIFFYCbCrtoRGB(TIFFYCbCrToRGB *, uint32, int32, int32, - uint32 *, uint32 *, uint32 *); - -/* - * RGBA-style image support. - */ -typedef struct _TIFFRGBAImage TIFFRGBAImage; -/* - * The image reading and conversion routines invoke - * ``put routines'' to copy/image/whatever tiles of - * raw image data. A default set of routines are - * provided to convert/copy raw image data to 8-bit - * packed ABGR format rasters. Applications can supply - * alternate routines that unpack the data into a - * different format or, for example, unpack the data - * and draw the unpacked raster on the display. - */ -typedef void (*tileContigRoutine) - (TIFFRGBAImage*, uint32*, uint32, uint32, uint32, uint32, int32, int32, - unsigned char*); -typedef void (*tileSeparateRoutine) - (TIFFRGBAImage*, uint32*, uint32, uint32, uint32, uint32, int32, int32, - unsigned char*, unsigned char*, unsigned char*, unsigned char*); -/* - * RGBA-reader state. - */ -struct _TIFFRGBAImage { - TIFF* tif; /* image handle */ - int stoponerr; /* stop on read error */ - int isContig; /* data is packed/separate */ - int alpha; /* type of alpha data present */ - uint32 width; /* image width */ - uint32 height; /* image height */ - uint16 bitspersample; /* image bits/sample */ - uint16 samplesperpixel; /* image samples/pixel */ - uint16 orientation; /* image orientation */ - uint16 req_orientation; /* requested orientation */ - uint16 photometric; /* image photometric interp */ - uint16* redcmap; /* colormap pallete */ - uint16* greencmap; - uint16* bluecmap; - /* get image data routine */ - int (*get)(TIFFRGBAImage*, uint32*, uint32, uint32); - union { - void (*any)(TIFFRGBAImage*); - tileContigRoutine contig; - tileSeparateRoutine separate; - } put; /* put decoded strip/tile */ - TIFFRGBValue* Map; /* sample mapping array */ - uint32** BWmap; /* black&white map */ - uint32** PALmap; /* palette image map */ - TIFFYCbCrToRGB* ycbcr; /* YCbCr conversion state */ - TIFFCIELabToRGB* cielab; /* CIE L*a*b conversion state */ - - int row_offset; - int col_offset; -}; - -/* - * Macros for extracting components from the - * packed ABGR form returned by TIFFReadRGBAImage. - */ -#define TIFFGetR(abgr) ((abgr) & 0xff) -#define TIFFGetG(abgr) (((abgr) >> 8) & 0xff) -#define TIFFGetB(abgr) (((abgr) >> 16) & 0xff) -#define TIFFGetA(abgr) (((abgr) >> 24) & 0xff) - -/* - * A CODEC is a software package that implements decoding, - * encoding, or decoding+encoding of a compression algorithm. - * The library provides a collection of builtin codecs. - * More codecs may be registered through calls to the library - * and/or the builtin implementations may be overridden. - */ -typedef int (*TIFFInitMethod)(TIFF*, int); -typedef struct { - char* name; - uint16 scheme; - TIFFInitMethod init; -} TIFFCodec; - -#include -#include - -/* share internal LogLuv conversion routines? */ -#ifndef LOGLUV_PUBLIC -#define LOGLUV_PUBLIC 1 -#endif - -#if defined(__cplusplus) -extern "C" { -#endif -typedef void (*TIFFErrorHandler)(const char*, const char*, va_list); -typedef tsize_t (*TIFFReadWriteProc)(thandle_t, tdata_t, tsize_t); -typedef toff_t (*TIFFSeekProc)(thandle_t, toff_t, int); -typedef int (*TIFFCloseProc)(thandle_t); -typedef toff_t (*TIFFSizeProc)(thandle_t); -typedef int (*TIFFMapFileProc)(thandle_t, tdata_t*, toff_t*); -typedef void (*TIFFUnmapFileProc)(thandle_t, tdata_t, toff_t); -typedef void (*TIFFExtendProc)(TIFF*); - -extern const char* TIFFGetVersion(void); - -extern const TIFFCodec* TIFFFindCODEC(uint16); -extern TIFFCodec* TIFFRegisterCODEC(uint16, const char*, TIFFInitMethod); -extern void TIFFUnRegisterCODEC(TIFFCodec*); -extern int TIFFIsCODECConfigured(uint16); - -extern tdata_t _TIFFmalloc(tsize_t); -extern tdata_t _TIFFrealloc(tdata_t, tsize_t); -extern void _TIFFmemset(tdata_t, int, tsize_t); -extern void _TIFFmemcpy(tdata_t, const tdata_t, tsize_t); -extern int _TIFFmemcmp(const tdata_t, const tdata_t, tsize_t); -extern void _TIFFfree(tdata_t); - -extern void TIFFClose(TIFF*); -extern int TIFFFlush(TIFF*); -extern int TIFFFlushData(TIFF*); -extern int TIFFGetField(TIFF*, ttag_t, ...); -extern int TIFFVGetField(TIFF*, ttag_t, va_list); -extern int TIFFGetFieldDefaulted(TIFF*, ttag_t, ...); -extern int TIFFVGetFieldDefaulted(TIFF*, ttag_t, va_list); -extern int TIFFReadDirectory(TIFF*); -extern tsize_t TIFFScanlineSize(TIFF*); -extern tsize_t TIFFRasterScanlineSize(TIFF*); -extern tsize_t TIFFStripSize(TIFF*); -extern tsize_t TIFFRawStripSize(TIFF*, tstrip_t); -extern tsize_t TIFFVStripSize(TIFF*, uint32); -extern tsize_t TIFFTileRowSize(TIFF*); -extern tsize_t TIFFTileSize(TIFF*); -extern tsize_t TIFFVTileSize(TIFF*, uint32); -extern uint32 TIFFDefaultStripSize(TIFF*, uint32); -extern void TIFFDefaultTileSize(TIFF*, uint32*, uint32*); -extern int TIFFFileno(TIFF*); -extern int TIFFGetMode(TIFF*); -extern int TIFFIsTiled(TIFF*); -extern int TIFFIsByteSwapped(TIFF*); -extern int TIFFIsUpSampled(TIFF*); -extern int TIFFIsMSB2LSB(TIFF*); -extern uint32 TIFFCurrentRow(TIFF*); -extern tdir_t TIFFCurrentDirectory(TIFF*); -extern tdir_t TIFFNumberOfDirectories(TIFF*); -extern uint32 TIFFCurrentDirOffset(TIFF*); -extern tstrip_t TIFFCurrentStrip(TIFF*); -extern ttile_t TIFFCurrentTile(TIFF*); -extern int TIFFReadBufferSetup(TIFF*, tdata_t, tsize_t); -extern int TIFFWriteBufferSetup(TIFF*, tdata_t, tsize_t); -extern int TIFFSetupStrips(TIFF *); -extern int TIFFWriteCheck(TIFF*, int, const char *); -extern int TIFFCreateDirectory(TIFF*); -extern int TIFFLastDirectory(TIFF*); -extern int TIFFSetDirectory(TIFF*, tdir_t); -extern int TIFFSetSubDirectory(TIFF*, uint32); -extern int TIFFUnlinkDirectory(TIFF*, tdir_t); -extern int TIFFSetField(TIFF*, ttag_t, ...); -extern int TIFFVSetField(TIFF*, ttag_t, va_list); -extern int TIFFWriteDirectory(TIFF *); -extern int TIFFCheckpointDirectory(TIFF *); -extern int TIFFRewriteDirectory(TIFF *); -extern int TIFFReassignTagToIgnore(enum TIFFIgnoreSense, int); - -#if defined(c_plusplus) || defined(__cplusplus) -extern void TIFFPrintDirectory(TIFF*, FILE*, long = 0); -extern int TIFFReadScanline(TIFF*, tdata_t, uint32, tsample_t = 0); -extern int TIFFWriteScanline(TIFF*, tdata_t, uint32, tsample_t = 0); -extern int TIFFReadRGBAImage(TIFF*, uint32, uint32, uint32*, int = 0); -extern int TIFFReadRGBAImageOriented(TIFF*, uint32, uint32, uint32*, - int = ORIENTATION_BOTLEFT, int = 0); -#else -extern void TIFFPrintDirectory(TIFF*, FILE*, long); -extern int TIFFReadScanline(TIFF*, tdata_t, uint32, tsample_t); -extern int TIFFWriteScanline(TIFF*, tdata_t, uint32, tsample_t); -extern int TIFFReadRGBAImage(TIFF*, uint32, uint32, uint32*, int); -extern int TIFFReadRGBAImageOriented(TIFF*, uint32, uint32, uint32*, int, int); -#endif - -extern int TIFFReadRGBAStrip(TIFF*, tstrip_t, uint32 * ); -extern int TIFFReadRGBATile(TIFF*, uint32, uint32, uint32 * ); -extern int TIFFRGBAImageOK(TIFF*, char [1024]); -extern int TIFFRGBAImageBegin(TIFFRGBAImage*, TIFF*, int, char [1024]); -extern int TIFFRGBAImageGet(TIFFRGBAImage*, uint32*, uint32, uint32); -extern void TIFFRGBAImageEnd(TIFFRGBAImage*); -extern TIFF* TIFFOpen(const char*, const char*); -extern TIFF* TIFFFdOpen(int, const char*, const char*); -extern TIFF* TIFFClientOpen(const char*, const char*, - thandle_t, - TIFFReadWriteProc, TIFFReadWriteProc, - TIFFSeekProc, TIFFCloseProc, - TIFFSizeProc, - TIFFMapFileProc, TIFFUnmapFileProc); -extern const char* TIFFFileName(TIFF*); -extern void TIFFError(const char*, const char*, ...); -extern void TIFFWarning(const char*, const char*, ...); -extern TIFFErrorHandler TIFFSetErrorHandler(TIFFErrorHandler); -extern TIFFErrorHandler TIFFSetWarningHandler(TIFFErrorHandler); -extern TIFFExtendProc TIFFSetTagExtender(TIFFExtendProc); -extern ttile_t TIFFComputeTile(TIFF*, uint32, uint32, uint32, tsample_t); -extern int TIFFCheckTile(TIFF*, uint32, uint32, uint32, tsample_t); -extern ttile_t TIFFNumberOfTiles(TIFF*); -extern tsize_t TIFFReadTile(TIFF*, - tdata_t, uint32, uint32, uint32, tsample_t); -extern tsize_t TIFFWriteTile(TIFF*, - tdata_t, uint32, uint32, uint32, tsample_t); -extern tstrip_t TIFFComputeStrip(TIFF*, uint32, tsample_t); -extern tstrip_t TIFFNumberOfStrips(TIFF*); -extern tsize_t TIFFReadEncodedStrip(TIFF*, tstrip_t, tdata_t, tsize_t); -extern tsize_t TIFFReadRawStrip(TIFF*, tstrip_t, tdata_t, tsize_t); -extern tsize_t TIFFReadEncodedTile(TIFF*, ttile_t, tdata_t, tsize_t); -extern tsize_t TIFFReadRawTile(TIFF*, ttile_t, tdata_t, tsize_t); -extern tsize_t TIFFWriteEncodedStrip(TIFF*, tstrip_t, tdata_t, tsize_t); -extern tsize_t TIFFWriteRawStrip(TIFF*, tstrip_t, tdata_t, tsize_t); -extern tsize_t TIFFWriteEncodedTile(TIFF*, ttile_t, tdata_t, tsize_t); -extern tsize_t TIFFWriteRawTile(TIFF*, ttile_t, tdata_t, tsize_t); -extern int TIFFDataWidth(TIFFDataType); /* table of tag datatype widths */ -extern void TIFFSetWriteOffset(TIFF*, toff_t); -extern void TIFFSwabShort(uint16*); -extern void TIFFSwabLong(uint32*); -extern void TIFFSwabDouble(double*); -extern void TIFFSwabArrayOfShort(uint16*, unsigned long); -extern void TIFFSwabArrayOfLong(uint32*, unsigned long); -extern void TIFFSwabArrayOfDouble(double*, unsigned long); -extern void TIFFReverseBits(unsigned char *, unsigned long); -extern const unsigned char* TIFFGetBitRevTable(int); - -#ifdef LOGLUV_PUBLIC -#define U_NEU 0.210526316 -#define V_NEU 0.473684211 -#define UVSCALE 410. -extern double LogL16toY(int); -extern double LogL10toY(int); -extern void XYZtoRGB24(float*, uint8*); -extern int uv_decode(double*, double*, int); -extern void LogLuv24toXYZ(uint32, float*); -extern void LogLuv32toXYZ(uint32, float*); -#if defined(c_plusplus) || defined(__cplusplus) -extern int LogL16fromY(double, int = SGILOGENCODE_NODITHER); -extern int LogL10fromY(double, int = SGILOGENCODE_NODITHER); -extern int uv_encode(double, double, int = SGILOGENCODE_NODITHER); -extern uint32 LogLuv24fromXYZ(float*, int = SGILOGENCODE_NODITHER); -extern uint32 LogLuv32fromXYZ(float*, int = SGILOGENCODE_NODITHER); -#else -extern int LogL16fromY(double, int); -extern int LogL10fromY(double, int); -extern int uv_encode(double, double, int); -extern uint32 LogLuv24fromXYZ(float*, int); -extern uint32 LogLuv32fromXYZ(float*, int); -#endif -#endif /* LOGLUV_PUBLIC */ - -/* -** New stuff going public in 3.6.x. -*/ -extern int TIFFGetTagListCount( TIFF * ); -extern ttag_t TIFFGetTagListEntry( TIFF *, int tag_index ); - -#define TIFF_ANY TIFF_NOTYPE /* for field descriptor searching */ -#define TIFF_VARIABLE -1 /* marker for variable length tags */ -#define TIFF_SPP -2 /* marker for SamplesPerPixel tags */ -#define TIFF_VARIABLE2 -3 /* marker for uint32 var-length tags */ - -#define FIELD_CUSTOM 65 - -typedef struct { - ttag_t field_tag; /* field's tag */ - short field_readcount; /* read count/TIFF_VARIABLE/TIFF_SPP */ - short field_writecount; /* write count/TIFF_VARIABLE */ - TIFFDataType field_type; /* type of associated data */ - unsigned short field_bit; /* bit in fieldsset bit vector */ - unsigned char field_oktochange; /* if true, can change while writing */ - unsigned char field_passcount; /* if true, pass dir count on set */ - char *field_name; /* ASCII name */ -} TIFFFieldInfo; - -typedef struct _TIFFTagValue { - const TIFFFieldInfo *info; - int count; - void *value; -} TIFFTagValue; - -extern void TIFFMergeFieldInfo(TIFF*, const TIFFFieldInfo[], int); -extern const TIFFFieldInfo* TIFFFindFieldInfo(TIFF*, ttag_t, TIFFDataType); -extern const TIFFFieldInfo* TIFFFieldWithTag(TIFF*, ttag_t); - -typedef int (*TIFFVSetMethod)(TIFF*, ttag_t, va_list); -typedef int (*TIFFVGetMethod)(TIFF*, ttag_t, va_list); -typedef void (*TIFFPrintMethod)(TIFF*, FILE*, long); - -typedef struct { - TIFFVSetMethod vsetfield; /* tag set routine */ - TIFFVGetMethod vgetfield; /* tag get routine */ - TIFFPrintMethod printdir; /* directory print routine */ -} TIFFTagMethods; - -extern TIFFTagMethods *TIFFAccessTagMethods( TIFF * ); -extern void *TIFFGetClientInfo( TIFF *, const char * ); -extern void TIFFSetClientInfo( TIFF *, void *, const char * ); - -#if defined(__cplusplus) -} -#endif -#endif /* _TIFFIO_ */ diff --git a/wxWidgets/src/tiff/tiffiop.h b/wxWidgets/src/tiff/tiffiop.h deleted file mode 100644 index b2286162fd..0000000000 --- a/wxWidgets/src/tiff/tiffiop.h +++ /dev/null @@ -1,289 +0,0 @@ -/* $Header$ */ - -/* - * Copyright (c) 1988-1997 Sam Leffler - * Copyright (c) 1991-1997 Silicon Graphics, Inc. - * - * Permission to use, copy, modify, distribute, and sell this software and - * its documentation for any purpose is hereby granted without fee, provided - * that (i) the above copyright notices and this permission notice appear in - * all copies of the software and related documentation, and (ii) the names of - * Sam Leffler and Silicon Graphics may not be used in any advertising or - * publicity relating to the software without the specific, prior written - * permission of Sam Leffler and Silicon Graphics. - * - * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, - * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * - * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR - * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, - * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF - * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE - * OF THIS SOFTWARE. - */ - -#ifndef _TIFFIOP_ -#define _TIFFIOP_ -/* - * ``Library-private'' definitions. - */ -/* - * UNIX systems should run the configure script to generate - * a port.h file that reflects the system capabilities. - * Doing this obviates all the dreck done in tiffcomp.h. - */ -#if (defined(unix) || defined(__unix)) && !defined(__DJGPP__) -#include "port.h" -#include "tiffconf.h" -#else -#include "tiffconf.h" -#include "tiffcomp.h" -#endif -#include "tiffio.h" -#include "tif_dir.h" - -#ifndef TRUE -#define TRUE 1 -#define FALSE 0 -#endif - -typedef struct client_info { - struct client_info *next; - void *data; - char *name; -} TIFFClientInfoLink; - -/* - * Typedefs for ``method pointers'' used internally. - */ -typedef unsigned char tidataval_t; /* internal image data value type */ -typedef tidataval_t* tidata_t; /* reference to internal image data */ - -typedef void (*TIFFVoidMethod)(TIFF*); -typedef int (*TIFFBoolMethod)(TIFF*); -typedef int (*TIFFPreMethod)(TIFF*, tsample_t); -typedef int (*TIFFCodeMethod)(TIFF*, tidata_t, tsize_t, tsample_t); -typedef int (*TIFFSeekMethod)(TIFF*, uint32); -typedef void (*TIFFPostMethod)(TIFF*, tidata_t, tsize_t); -typedef uint32 (*TIFFStripMethod)(TIFF*, uint32); -typedef void (*TIFFTileMethod)(TIFF*, uint32*, uint32*); - -struct tiff { - char* tif_name; /* name of open file */ - int tif_fd; /* open file descriptor */ - int tif_mode; /* open mode (O_*) */ - uint32 tif_flags; -#define TIFF_FILLORDER 0x0003 /* natural bit fill order for machine */ -#define TIFF_DIRTYHEADER 0x0004 /* header must be written on close */ -#define TIFF_DIRTYDIRECT 0x0008 /* current directory must be written */ -#define TIFF_BUFFERSETUP 0x0010 /* data buffers setup */ -#define TIFF_CODERSETUP 0x0020 /* encoder/decoder setup done */ -#define TIFF_BEENWRITING 0x0040 /* written 1+ scanlines to file */ -#define TIFF_SWAB 0x0080 /* byte swap file information */ -#define TIFF_NOBITREV 0x0100 /* inhibit bit reversal logic */ -#define TIFF_MYBUFFER 0x0200 /* my raw data buffer; free on close */ -#define TIFF_ISTILED 0x0400 /* file is tile, not strip- based */ -#define TIFF_MAPPED 0x0800 /* file is mapped into memory */ -#define TIFF_POSTENCODE 0x1000 /* need call to postencode routine */ -#define TIFF_INSUBIFD 0x2000 /* currently writing a subifd */ -#define TIFF_UPSAMPLED 0x4000 /* library is doing data up-sampling */ -#define TIFF_STRIPCHOP 0x8000 /* enable strip chopping support */ - toff_t tif_diroff; /* file offset of current directory */ - toff_t tif_nextdiroff; /* file offset of following directory */ - toff_t* tif_dirlist; /* list of offsets to already seen */ - /* directories to prevent IFD looping */ - uint16 tif_dirnumber; /* number of already seen directories */ - TIFFDirectory tif_dir; /* internal rep of current directory */ - TIFFHeader tif_header; /* file's header block */ - const int* tif_typeshift; /* data type shift counts */ - const long* tif_typemask; /* data type masks */ - uint32 tif_row; /* current scanline */ - tdir_t tif_curdir; /* current directory (index) */ - tstrip_t tif_curstrip; /* current strip for read/write */ - toff_t tif_curoff; /* current offset for read/write */ - toff_t tif_dataoff; /* current offset for writing dir */ -#if SUBIFD_SUPPORT - uint16 tif_nsubifd; /* remaining subifds to write */ - toff_t tif_subifdoff; /* offset for patching SubIFD link */ -#endif -/* tiling support */ - uint32 tif_col; /* current column (offset by row too) */ - ttile_t tif_curtile; /* current tile for read/write */ - tsize_t tif_tilesize; /* # of bytes in a tile */ -/* compression scheme hooks */ - int tif_decodestatus; - TIFFBoolMethod tif_setupdecode;/* called once before predecode */ - TIFFPreMethod tif_predecode; /* pre- row/strip/tile decoding */ - TIFFBoolMethod tif_setupencode;/* called once before preencode */ - int tif_encodestatus; - TIFFPreMethod tif_preencode; /* pre- row/strip/tile encoding */ - TIFFBoolMethod tif_postencode; /* post- row/strip/tile encoding */ - TIFFCodeMethod tif_decoderow; /* scanline decoding routine */ - TIFFCodeMethod tif_encoderow; /* scanline encoding routine */ - TIFFCodeMethod tif_decodestrip;/* strip decoding routine */ - TIFFCodeMethod tif_encodestrip;/* strip encoding routine */ - TIFFCodeMethod tif_decodetile; /* tile decoding routine */ - TIFFCodeMethod tif_encodetile; /* tile encoding routine */ - TIFFVoidMethod tif_close; /* cleanup-on-close routine */ - TIFFSeekMethod tif_seek; /* position within a strip routine */ - TIFFVoidMethod tif_cleanup; /* cleanup state routine */ - TIFFStripMethod tif_defstripsize;/* calculate/constrain strip size */ - TIFFTileMethod tif_deftilesize;/* calculate/constrain tile size */ - tidata_t tif_data; /* compression scheme private data */ -/* input/output buffering */ - tsize_t tif_scanlinesize;/* # of bytes in a scanline */ - tsize_t tif_scanlineskew;/* scanline skew for reading strips */ - tidata_t tif_rawdata; /* raw data buffer */ - tsize_t tif_rawdatasize;/* # of bytes in raw data buffer */ - tidata_t tif_rawcp; /* current spot in raw buffer */ - tsize_t tif_rawcc; /* bytes unread from raw buffer */ -/* memory-mapped file support */ - tidata_t tif_base; /* base of mapped file */ - toff_t tif_size; /* size of mapped file region (bytes) */ - TIFFMapFileProc tif_mapproc; /* map file method */ - TIFFUnmapFileProc tif_unmapproc;/* unmap file method */ -/* input/output callback methods */ - thandle_t tif_clientdata; /* callback parameter */ - TIFFReadWriteProc tif_readproc; /* read method */ - TIFFReadWriteProc tif_writeproc;/* write method */ - TIFFSeekProc tif_seekproc; /* lseek method */ - TIFFCloseProc tif_closeproc; /* close method */ - TIFFSizeProc tif_sizeproc; /* filesize method */ -/* post-decoding support */ - TIFFPostMethod tif_postdecode; /* post decoding routine */ -/* tag support */ - TIFFFieldInfo** tif_fieldinfo; /* sorted table of registered tags */ - int tif_nfields; /* # entries in registered tag table */ - TIFFTagMethods tif_tagmethods; /* tag get/set/print routines */ - TIFFClientInfoLink *tif_clientinfo; /* extra client information. */ -}; - -#define isPseudoTag(t) (t > 0xffff) /* is tag value normal or pseudo */ - -#define isTiled(tif) (((tif)->tif_flags & TIFF_ISTILED) != 0) -#define isMapped(tif) (((tif)->tif_flags & TIFF_MAPPED) != 0) -#define isFillOrder(tif, o) (((tif)->tif_flags & (o)) != 0) -#define isUpSampled(tif) (((tif)->tif_flags & TIFF_UPSAMPLED) != 0) -#define TIFFReadFile(tif, buf, size) \ - ((*(tif)->tif_readproc)((tif)->tif_clientdata,buf,size)) -#define TIFFWriteFile(tif, buf, size) \ - ((*(tif)->tif_writeproc)((tif)->tif_clientdata,buf,size)) -#define TIFFSeekFile(tif, off, whence) \ - ((*(tif)->tif_seekproc)((tif)->tif_clientdata,(toff_t)(off),whence)) -#define TIFFCloseFile(tif) \ - ((*(tif)->tif_closeproc)((tif)->tif_clientdata)) -#define TIFFGetFileSize(tif) \ - ((*(tif)->tif_sizeproc)((tif)->tif_clientdata)) -#define TIFFMapFileContents(tif, paddr, psize) \ - ((*(tif)->tif_mapproc)((tif)->tif_clientdata,paddr,psize)) -#define TIFFUnmapFileContents(tif, addr, size) \ - ((*(tif)->tif_unmapproc)((tif)->tif_clientdata,addr,size)) - -/* - * Default Read/Seek/Write definitions. - */ -#ifndef ReadOK -#define ReadOK(tif, buf, size) \ - (TIFFReadFile(tif, (tdata_t) buf, (tsize_t)(size)) == (tsize_t)(size)) -#endif -#ifndef SeekOK -#define SeekOK(tif, off) \ - (TIFFSeekFile(tif, (toff_t) off, SEEK_SET) == (toff_t) off) -#endif -#ifndef WriteOK -#define WriteOK(tif, buf, size) \ - (TIFFWriteFile(tif, (tdata_t) buf, (tsize_t) size) == (tsize_t) size) -#endif - -/* NB: the uint32 casts are to silence certain ANSI-C compilers */ -#define TIFFhowmany(x, y) ((((uint32)(x))+(((uint32)(y))-1))/((uint32)(y))) -#define TIFFhowmany8(x) (((x)&0x07)?((uint32)(x)>>3)+1:(uint32)(x)>>3) -#define TIFFroundup(x, y) (TIFFhowmany(x,y)*(y)) - -#define TIFFmax(A,B) ((A)>(B)?(A):(B)) -#define TIFFmin(A,B) ((A)<(B)?(A):(B)) - -#if defined(__cplusplus) -extern "C" { -#endif -extern int _TIFFgetMode(const char*, const char*); -extern int _TIFFNoRowEncode(TIFF*, tidata_t, tsize_t, tsample_t); -extern int _TIFFNoStripEncode(TIFF*, tidata_t, tsize_t, tsample_t); -extern int _TIFFNoTileEncode(TIFF*, tidata_t, tsize_t, tsample_t); -extern int _TIFFNoRowDecode(TIFF*, tidata_t, tsize_t, tsample_t); -extern int _TIFFNoStripDecode(TIFF*, tidata_t, tsize_t, tsample_t); -extern int _TIFFNoTileDecode(TIFF*, tidata_t, tsize_t, tsample_t); -extern void _TIFFNoPostDecode(TIFF*, tidata_t, tsize_t); -extern int _TIFFNoPreCode (TIFF*, tsample_t); -extern int _TIFFNoSeek(TIFF*, uint32); -extern void _TIFFSwab16BitData(TIFF*, tidata_t, tsize_t); -extern void _TIFFSwab32BitData(TIFF*, tidata_t, tsize_t); -extern void _TIFFSwab64BitData(TIFF*, tidata_t, tsize_t); -extern int TIFFFlushData1(TIFF*); -extern void TIFFFreeDirectory(TIFF*); -extern int TIFFDefaultDirectory(TIFF*); -extern int TIFFSetCompressionScheme(TIFF*, int); -extern int TIFFSetDefaultCompressionState(TIFF*); -extern uint32 _TIFFDefaultStripSize(TIFF*, uint32); -extern void _TIFFDefaultTileSize(TIFF*, uint32*, uint32*); - -extern void _TIFFsetByteArray(void**, void*, long); -extern void _TIFFsetString(char**, char*); -extern void _TIFFsetShortArray(uint16**, uint16*, long); -extern void _TIFFsetLongArray(uint32**, uint32*, long); -extern void _TIFFsetFloatArray(float**, float*, long); -extern void _TIFFsetDoubleArray(double**, double*, long); - -extern void _TIFFprintAscii(FILE*, const char*); -extern void _TIFFprintAsciiTag(FILE*, const char*, const char*); - -GLOBALDATA(TIFFErrorHandler,_TIFFwarningHandler); -GLOBALDATA(TIFFErrorHandler,_TIFFerrorHandler); - -extern int TIFFInitDumpMode(TIFF*, int); -#ifdef PACKBITS_SUPPORT -extern int TIFFInitPackBits(TIFF*, int); -#endif -#ifdef CCITT_SUPPORT -extern int TIFFInitCCITTRLE(TIFF*, int), TIFFInitCCITTRLEW(TIFF*, int); -extern int TIFFInitCCITTFax3(TIFF*, int), TIFFInitCCITTFax4(TIFF*, int); -#endif -#ifdef THUNDER_SUPPORT -extern int TIFFInitThunderScan(TIFF*, int); -#endif -#ifdef NEXT_SUPPORT -extern int TIFFInitNeXT(TIFF*, int); -#endif -#ifdef LZW_SUPPORT -extern int TIFFInitLZW(TIFF*, int); -#endif -#ifdef OJPEG_SUPPORT -extern int TIFFInitOJPEG(TIFF*, int); -#endif -#ifdef JPEG_SUPPORT -extern int TIFFInitJPEG(TIFF*, int); -#endif -#ifdef JBIG_SUPPORT -extern int TIFFInitJBIG(TIFF*, int); -#endif -#ifdef ZIP_SUPPORT -extern int TIFFInitZIP(TIFF*, int); -#endif -#ifdef PIXARLOG_SUPPORT -extern int TIFFInitPixarLog(TIFF*, int); -#endif -#ifdef LOGLUV_SUPPORT -extern int TIFFInitSGILog(TIFF*, int); -#endif -#ifdef VMS -extern const TIFFCodec _TIFFBuiltinCODECS[]; -#else -extern TIFFCodec _TIFFBuiltinCODECS[]; -#endif - -#if defined(__cplusplus) -} -#endif -#endif /* _TIFFIOP_ */ diff --git a/wxWidgets/src/tiff/tiffvers.h b/wxWidgets/src/tiff/tiffvers.h deleted file mode 100644 index 3d24f9a2c2..0000000000 --- a/wxWidgets/src/tiff/tiffvers.h +++ /dev/null @@ -1,9 +0,0 @@ -#define TIFFLIB_VERSION_STR "LIBTIFF, Version 3.6.1\nCopyright (c) 1988-1996 Sam Leffler\nCopyright (c) 1991-1996 Silicon Graphics, Inc." -/* - * This define can be used in code that requires - * compilation-related definitions specific to a - * version or versions of the library. Runtime - * version checking should be done based on the - * string returned by TIFFGetVersion. - */ -#define TIFFLIB_VERSION 20031226 diff --git a/wxWidgets/src/tiff/uvcode.h b/wxWidgets/src/tiff/uvcode.h deleted file mode 100644 index 8d96e44583..0000000000 --- a/wxWidgets/src/tiff/uvcode.h +++ /dev/null @@ -1,173 +0,0 @@ -/* Version 1.0 generated April 7, 1997 by Greg Ward Larson, SGI */ -#define UV_SQSIZ (float)0.003500 -#define UV_NDIVS 16289 -#define UV_VSTART (float)0.016940 -#define UV_NVS 163 -static struct { - float ustart; - short nus, ncum; -} uv_row[UV_NVS] = { - (float)0.247663, 4, 0, - (float)0.243779, 6, 4, - (float)0.241684, 7, 10, - (float)0.237874, 9, 17, - (float)0.235906, 10, 26, - (float)0.232153, 12, 36, - (float)0.228352, 14, 48, - (float)0.226259, 15, 62, - (float)0.222371, 17, 77, - (float)0.220410, 18, 94, - (float)0.214710, 21, 112, - (float)0.212714, 22, 133, - (float)0.210721, 23, 155, - (float)0.204976, 26, 178, - (float)0.202986, 27, 204, - (float)0.199245, 29, 231, - (float)0.195525, 31, 260, - (float)0.193560, 32, 291, - (float)0.189878, 34, 323, - (float)0.186216, 36, 357, - (float)0.186216, 36, 393, - (float)0.182592, 38, 429, - (float)0.179003, 40, 467, - (float)0.175466, 42, 507, - (float)0.172001, 44, 549, - (float)0.172001, 44, 593, - (float)0.168612, 46, 637, - (float)0.168612, 46, 683, - (float)0.163575, 49, 729, - (float)0.158642, 52, 778, - (float)0.158642, 52, 830, - (float)0.158642, 52, 882, - (float)0.153815, 55, 934, - (float)0.153815, 55, 989, - (float)0.149097, 58, 1044, - (float)0.149097, 58, 1102, - (float)0.142746, 62, 1160, - (float)0.142746, 62, 1222, - (float)0.142746, 62, 1284, - (float)0.138270, 65, 1346, - (float)0.138270, 65, 1411, - (float)0.138270, 65, 1476, - (float)0.132166, 69, 1541, - (float)0.132166, 69, 1610, - (float)0.126204, 73, 1679, - (float)0.126204, 73, 1752, - (float)0.126204, 73, 1825, - (float)0.120381, 77, 1898, - (float)0.120381, 77, 1975, - (float)0.120381, 77, 2052, - (float)0.120381, 77, 2129, - (float)0.112962, 82, 2206, - (float)0.112962, 82, 2288, - (float)0.112962, 82, 2370, - (float)0.107450, 86, 2452, - (float)0.107450, 86, 2538, - (float)0.107450, 86, 2624, - (float)0.107450, 86, 2710, - (float)0.100343, 91, 2796, - (float)0.100343, 91, 2887, - (float)0.100343, 91, 2978, - (float)0.095126, 95, 3069, - (float)0.095126, 95, 3164, - (float)0.095126, 95, 3259, - (float)0.095126, 95, 3354, - (float)0.088276, 100, 3449, - (float)0.088276, 100, 3549, - (float)0.088276, 100, 3649, - (float)0.088276, 100, 3749, - (float)0.081523, 105, 3849, - (float)0.081523, 105, 3954, - (float)0.081523, 105, 4059, - (float)0.081523, 105, 4164, - (float)0.074861, 110, 4269, - (float)0.074861, 110, 4379, - (float)0.074861, 110, 4489, - (float)0.074861, 110, 4599, - (float)0.068290, 115, 4709, - (float)0.068290, 115, 4824, - (float)0.068290, 115, 4939, - (float)0.068290, 115, 5054, - (float)0.063573, 119, 5169, - (float)0.063573, 119, 5288, - (float)0.063573, 119, 5407, - (float)0.063573, 119, 5526, - (float)0.057219, 124, 5645, - (float)0.057219, 124, 5769, - (float)0.057219, 124, 5893, - (float)0.057219, 124, 6017, - (float)0.050985, 129, 6141, - (float)0.050985, 129, 6270, - (float)0.050985, 129, 6399, - (float)0.050985, 129, 6528, - (float)0.050985, 129, 6657, - (float)0.044859, 134, 6786, - (float)0.044859, 134, 6920, - (float)0.044859, 134, 7054, - (float)0.044859, 134, 7188, - (float)0.040571, 138, 7322, - (float)0.040571, 138, 7460, - (float)0.040571, 138, 7598, - (float)0.040571, 138, 7736, - (float)0.036339, 142, 7874, - (float)0.036339, 142, 8016, - (float)0.036339, 142, 8158, - (float)0.036339, 142, 8300, - (float)0.032139, 146, 8442, - (float)0.032139, 146, 8588, - (float)0.032139, 146, 8734, - (float)0.032139, 146, 8880, - (float)0.027947, 150, 9026, - (float)0.027947, 150, 9176, - (float)0.027947, 150, 9326, - (float)0.023739, 154, 9476, - (float)0.023739, 154, 9630, - (float)0.023739, 154, 9784, - (float)0.023739, 154, 9938, - (float)0.019504, 158, 10092, - (float)0.019504, 158, 10250, - (float)0.019504, 158, 10408, - (float)0.016976, 161, 10566, - (float)0.016976, 161, 10727, - (float)0.016976, 161, 10888, - (float)0.016976, 161, 11049, - (float)0.012639, 165, 11210, - (float)0.012639, 165, 11375, - (float)0.012639, 165, 11540, - (float)0.009991, 168, 11705, - (float)0.009991, 168, 11873, - (float)0.009991, 168, 12041, - (float)0.009016, 170, 12209, - (float)0.009016, 170, 12379, - (float)0.009016, 170, 12549, - (float)0.006217, 173, 12719, - (float)0.006217, 173, 12892, - (float)0.005097, 175, 13065, - (float)0.005097, 175, 13240, - (float)0.005097, 175, 13415, - (float)0.003909, 177, 13590, - (float)0.003909, 177, 13767, - (float)0.002340, 177, 13944, - (float)0.002389, 170, 14121, - (float)0.001068, 164, 14291, - (float)0.001653, 157, 14455, - (float)0.000717, 150, 14612, - (float)0.001614, 143, 14762, - (float)0.000270, 136, 14905, - (float)0.000484, 129, 15041, - (float)0.001103, 123, 15170, - (float)0.001242, 115, 15293, - (float)0.001188, 109, 15408, - (float)0.001011, 103, 15517, - (float)0.000709, 97, 15620, - (float)0.000301, 89, 15717, - (float)0.002416, 82, 15806, - (float)0.003251, 76, 15888, - (float)0.003246, 69, 15964, - (float)0.004141, 62, 16033, - (float)0.005963, 55, 16095, - (float)0.008839, 47, 16150, - (float)0.010490, 40, 16197, - (float)0.016994, 31, 16237, - (float)0.023659, 21, 16268, -}; diff --git a/wxWidgets/src/univ/bmpbuttn.cpp b/wxWidgets/src/univ/bmpbuttn.cpp deleted file mode 100644 index 39fee9a8df..0000000000 --- a/wxWidgets/src/univ/bmpbuttn.cpp +++ /dev/null @@ -1,155 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/univ/bmpbuttn.cpp -// Purpose: wxBitmapButton implementation -// Author: Vadim Zeitlin -// Modified by: -// Created: 25.08.00 -// RCS-ID: $Id: bmpbuttn.cpp 42778 2006-10-30 22:11:26Z VZ $ -// Copyright: (c) 2000 SciTech Software, Inc. (www.scitechsoft.com) -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_BMPBUTTON - -#include "wx/bmpbuttn.h" - -#ifndef WX_PRECOMP - #include "wx/dc.h" - #include "wx/validate.h" -#endif - -#include "wx/univ/renderer.h" - -// ============================================================================ -// implementation -// ============================================================================ - -IMPLEMENT_DYNAMIC_CLASS(wxBitmapButton, wxButton) - -BEGIN_EVENT_TABLE(wxBitmapButton, wxButton) - EVT_SET_FOCUS(wxBitmapButton::OnSetFocus) - EVT_KILL_FOCUS(wxBitmapButton::OnKillFocus) -END_EVENT_TABLE() - -// ---------------------------------------------------------------------------- -// wxBitmapButton -// ---------------------------------------------------------------------------- - -bool wxBitmapButton::Create(wxWindow *parent, - wxWindowID id, - const wxBitmap& bitmap, - const wxPoint &pos, - const wxSize &size, - long style, - const wxValidator& validator, - const wxString &name) -{ - // we add wxBU_EXACTFIT because the bitmap buttons are not the standard - // ones and so shouldn't be forced to be of the standard size which is - // typically too big for them - if ( !wxButton::Create(parent, id, bitmap, wxEmptyString, - pos, size, style | wxBU_EXACTFIT, validator, name) ) - return false; - - m_bmpNormal = bitmap; - - return true; -} - -void wxBitmapButton::OnSetBitmap() -{ - wxBitmap bmp; - if ( !IsEnabled() ) - { - bmp = m_bmpDisabled; - } - else if ( IsPressed() ) - { - bmp = m_bmpSelected; - } - else if ( IsFocused() ) - { - bmp = m_bmpFocus; - } - else - { - bmp = m_bmpNormal; - } - - ChangeBitmap(bmp); -} - -bool wxBitmapButton::ChangeBitmap(const wxBitmap& bmp) -{ - wxBitmap bitmap = bmp.Ok() ? bmp : m_bmpNormal; - if ( bitmap.IsSameAs(m_bitmap) ) - return false; - - m_bitmap = bitmap; - - return true; -} - -bool wxBitmapButton::Enable(bool enable) -{ - if ( !wxButton::Enable(enable) ) - return false; - - if ( !enable && ChangeBitmap(m_bmpDisabled) ) - Refresh(); - - return true; -} - -bool wxBitmapButton::SetCurrent(bool doit) -{ - ChangeBitmap(doit ? m_bmpFocus : m_bmpNormal); - - return wxButton::SetCurrent(doit); -} - -void wxBitmapButton::OnSetFocus(wxFocusEvent& event) -{ - if ( ChangeBitmap(m_bmpFocus) ) - Refresh(); - - event.Skip(); -} - -void wxBitmapButton::OnKillFocus(wxFocusEvent& event) -{ - if ( ChangeBitmap(m_bmpNormal) ) - Refresh(); - - event.Skip(); -} - -void wxBitmapButton::Press() -{ - ChangeBitmap(m_bmpSelected); - - wxButton::Press(); -} - -void wxBitmapButton::Release() -{ - ChangeBitmap(IsFocused() ? m_bmpFocus : m_bmpNormal); - - wxButton::Release(); -} - -#endif // wxUSE_BMPBUTTON diff --git a/wxWidgets/src/univ/button.cpp b/wxWidgets/src/univ/button.cpp deleted file mode 100644 index f397e5f814..0000000000 --- a/wxWidgets/src/univ/button.cpp +++ /dev/null @@ -1,466 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: univ/button.cpp -// Purpose: wxButton -// Author: Vadim Zeitlin -// Modified by: -// Created: 14.08.00 -// RCS-ID: $Id: button.cpp 42816 2006-10-31 08:50:17Z RD $ -// Copyright: (c) 2000 SciTech Software, Inc. (www.scitechsoft.com) -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_BUTTON - -#ifndef WX_PRECOMP - #include "wx/dcclient.h" - #include "wx/dcscreen.h" - #include "wx/button.h" - #include "wx/validate.h" - #include "wx/settings.h" -#endif - -#include "wx/univ/renderer.h" -#include "wx/univ/inphand.h" -#include "wx/univ/theme.h" -#include "wx/univ/colschem.h" -#include "wx/stockitem.h" - -// ---------------------------------------------------------------------------- -// wxStdButtonInputHandler: translates SPACE and ENTER keys and the left mouse -// click into button press/release actions -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxStdButtonInputHandler : public wxStdInputHandler -{ -public: - wxStdButtonInputHandler(wxInputHandler *inphand); - - virtual bool HandleKey(wxInputConsumer *consumer, - const wxKeyEvent& event, - bool pressed); - virtual bool HandleMouse(wxInputConsumer *consumer, - const wxMouseEvent& event); - virtual bool HandleMouseMove(wxInputConsumer *consumer, - const wxMouseEvent& event); - virtual bool HandleFocus(wxInputConsumer *consumer, - const wxFocusEvent& event); - virtual bool HandleActivation(wxInputConsumer *consumer, bool activated); - -private: - // the window (button) which has capture or NULL and the flag telling if - // the mouse is inside the button which captured it or not - wxWindow *m_winCapture; - bool m_winHasMouse; -}; - -// ---------------------------------------------------------------------------- -// constants -// ---------------------------------------------------------------------------- - -// default margins around the image -static const wxCoord DEFAULT_BTN_MARGIN_X = 0; // We should give space for the border, at least. -static const wxCoord DEFAULT_BTN_MARGIN_Y = 0; - -// ============================================================================ -// implementation -// ============================================================================ - -IMPLEMENT_DYNAMIC_CLASS(wxButton, wxControl) - -// ---------------------------------------------------------------------------- -// creation -// ---------------------------------------------------------------------------- - -void wxButton::Init() -{ - m_isPressed = - m_isDefault = false; -} - -bool wxButton::Create(wxWindow *parent, - wxWindowID id, - const wxBitmap& bitmap, - const wxString &lbl, - const wxPoint &pos, - const wxSize &size, - long style, - const wxValidator& validator, - const wxString &name) -{ - wxString label(lbl); - if (label.empty() && wxIsStockID(id)) - label = wxGetStockLabel(id); - - long ctrl_style = style & ~wxBU_ALIGN_MASK; - ctrl_style = ctrl_style & ~wxALIGN_MASK; - - if((style & wxBU_RIGHT) == wxBU_RIGHT) - ctrl_style |= wxALIGN_RIGHT; - else if((style & wxBU_LEFT) == wxBU_LEFT) - ctrl_style |= wxALIGN_LEFT; - else - ctrl_style |= wxALIGN_CENTRE_HORIZONTAL; - - if((style & wxBU_TOP) == wxBU_TOP) - ctrl_style |= wxALIGN_TOP; - else if((style & wxBU_BOTTOM) == wxBU_BOTTOM) - ctrl_style |= wxALIGN_BOTTOM; - else - ctrl_style |= wxALIGN_CENTRE_VERTICAL; - - if ( !wxControl::Create(parent, id, pos, size, ctrl_style, validator, name) ) - return false; - - SetLabel(label); - - if (bitmap.Ok()) - SetImageLabel(bitmap); // SetInitialSize called by SetImageLabel() - else - SetInitialSize(size); - - CreateInputHandler(wxINP_HANDLER_BUTTON); - - return true; -} - -wxButton::~wxButton() -{ -} - -// ---------------------------------------------------------------------------- -// size management -// ---------------------------------------------------------------------------- - -/* static */ -wxSize wxButtonBase::GetDefaultSize() -{ - static wxSize s_sizeBtn; - - if ( s_sizeBtn.x == 0 ) - { - wxScreenDC dc; - - // this corresponds more or less to wxMSW standard in Win32 theme (see - // wxWin32Renderer::AdjustSize()) -// s_sizeBtn.x = 8*dc.GetCharWidth(); -// s_sizeBtn.y = (11*dc.GetCharHeight())/10 + 2; - // Otto Wyss, Patch 664399 - s_sizeBtn.x = dc.GetCharWidth()*10 + 2; - s_sizeBtn.y = dc.GetCharHeight()*11/10 + 2; - } - - return s_sizeBtn; -} - -wxSize wxButton::DoGetBestClientSize() const -{ - wxClientDC dc(wxConstCast(this, wxButton)); - wxCoord width, height; - dc.GetMultiLineTextExtent(GetLabel(), &width, &height); - - if ( m_bitmap.Ok() ) - { - // allocate extra space for the bitmap - wxCoord heightBmp = m_bitmap.GetHeight() + 2*m_marginBmpY; - if ( height < heightBmp ) - height = heightBmp; - - width += m_bitmap.GetWidth() + 2*m_marginBmpX; - } - - // The default size should not be adjusted, so the code is moved into the - // renderer. This is conceptual wrong but currently the only solution. - // (Otto Wyss, Patch 664399) - -/* - // for compatibility with other ports, the buttons default size is never - // less than the standard one, but not when display not PDAs. - if (wxSystemSettings::GetScreenType() > wxSYS_SCREEN_PDA) - { - if ( !(GetWindowStyle() & wxBU_EXACTFIT) ) - { - wxSize szDef = GetDefaultSize(); - if ( width < szDef.x ) - width = szDef.x; - } - } -*/ - return wxSize(width, height); -} - -// ---------------------------------------------------------------------------- -// drawing -// ---------------------------------------------------------------------------- - -void wxButton::DoDraw(wxControlRenderer *renderer) -{ - if ( !(GetWindowStyle() & wxBORDER_NONE) ) - { - renderer->DrawButtonBorder(); - } - - renderer->DrawLabel(m_bitmap, m_marginBmpX, m_marginBmpY); -} - -bool wxButton::DoDrawBackground(wxDC& dc) -{ - wxRect rect; - wxSize size = GetSize(); - rect.width = size.x; - rect.height = size.y; - - if ( GetBackgroundBitmap().Ok() ) - { - // get the bitmap and the flags - int alignment; - wxStretch stretch; - wxBitmap bmp = GetBackgroundBitmap(&alignment, &stretch); - wxControlRenderer::DrawBitmap(dc, bmp, rect, alignment, stretch); - } - else - { - m_renderer->DrawButtonSurface(dc, wxTHEME_BG_COLOUR(this), - rect, GetStateFlags()); - } - - return true; -} - -// ---------------------------------------------------------------------------- -// input processing -// ---------------------------------------------------------------------------- - -void wxButton::Press() -{ - if ( !m_isPressed ) - { - m_isPressed = true; - - Refresh(); - } -} - -void wxButton::Release() -{ - if ( m_isPressed ) - { - m_isPressed = false; - - Refresh(); - } -} - -void wxButton::Toggle() -{ - if ( m_isPressed ) - Release(); - else - Press(); - - if ( !m_isPressed ) - { - // releasing button after it had been pressed generates a click event - Click(); - } -} - -void wxButton::Click() -{ - wxCommandEvent event(wxEVT_COMMAND_BUTTON_CLICKED, GetId()); - InitCommandEvent(event); - Command(event); -} - -bool wxButton::PerformAction(const wxControlAction& action, - long numArg, - const wxString& strArg) -{ - if ( action == wxACTION_BUTTON_TOGGLE ) - Toggle(); - else if ( action == wxACTION_BUTTON_CLICK ) - Click(); - else if ( action == wxACTION_BUTTON_PRESS ) - Press(); - else if ( action == wxACTION_BUTTON_RELEASE ) - Release(); - else - return wxControl::PerformAction(action, numArg, strArg); - - return true; -} - -/* static */ -wxInputHandler *wxButton::GetStdInputHandler(wxInputHandler *handlerDef) -{ - static wxStdButtonInputHandler s_handlerBtn(handlerDef); - - return &s_handlerBtn; -} - -// ---------------------------------------------------------------------------- -// misc -// ---------------------------------------------------------------------------- - -void wxButton::SetImageLabel(const wxBitmap& bitmap) -{ - m_bitmap = bitmap; - - SetImageMargins(DEFAULT_BTN_MARGIN_X, DEFAULT_BTN_MARGIN_Y); -} - -void wxButton::SetImageMargins(wxCoord x, wxCoord y) -{ - m_marginBmpX = x + 2; - m_marginBmpY = y + 2; - - SetInitialSize(wxDefaultSize); -} - -void wxButton::SetDefault() -{ - m_isDefault = true; -} - -// ============================================================================ -// wxStdButtonInputHandler -// ============================================================================ - -wxStdButtonInputHandler::wxStdButtonInputHandler(wxInputHandler *handler) - : wxStdInputHandler(handler) -{ - m_winCapture = NULL; - m_winHasMouse = false; -} - -bool wxStdButtonInputHandler::HandleKey(wxInputConsumer *consumer, - const wxKeyEvent& event, - bool pressed) -{ - int keycode = event.GetKeyCode(); - if ( keycode == WXK_SPACE || keycode == WXK_RETURN ) - { - consumer->PerformAction(wxACTION_BUTTON_TOGGLE); - - return true; - } - - return wxStdInputHandler::HandleKey(consumer, event, pressed); -} - -bool wxStdButtonInputHandler::HandleMouse(wxInputConsumer *consumer, - const wxMouseEvent& event) -{ - // the button has 2 states: pressed and normal with the following - // transitions between them: - // - // normal -> left down -> capture mouse and go to pressed state - // pressed -> left up inside -> generate click -> go to normal - // outside ------------------> - // - // the other mouse buttons are ignored - if ( event.Button(1) ) - { - if ( event.LeftDown() || event.LeftDClick() ) - { - m_winCapture = consumer->GetInputWindow(); - m_winCapture->CaptureMouse(); - m_winHasMouse = true; - - consumer->PerformAction(wxACTION_BUTTON_PRESS); - - return true; - } - else if ( event.LeftUp() ) - { - if ( m_winCapture ) - { - m_winCapture->ReleaseMouse(); - m_winCapture = NULL; - } - - if ( m_winHasMouse ) - { - // this will generate a click event - consumer->PerformAction(wxACTION_BUTTON_TOGGLE); - - return true; - } - //else: the mouse was released outside the window, this doesn't - // count as a click - } - //else: don't do anything special about the double click - } - - return wxStdInputHandler::HandleMouse(consumer, event); -} - -bool wxStdButtonInputHandler::HandleMouseMove(wxInputConsumer *consumer, - const wxMouseEvent& event) -{ - // we only have to do something when the mouse leaves/enters the pressed - // button and don't care about the other ones - if ( event.GetEventObject() == m_winCapture ) - { - // leaving the button should remove its pressed state - if ( event.Leaving() ) - { - // remember that the mouse is now outside - m_winHasMouse = false; - - // we do have a pressed button, so release it - consumer->GetInputWindow()->SetCurrent(false); - consumer->PerformAction(wxACTION_BUTTON_RELEASE); - - return true; - } - // and entering it back should make it pressed again if it had been - // pressed - else if ( event.Entering() ) - { - // the mouse is (back) inside the button - m_winHasMouse = true; - - // we did have a pressed button which we released when leaving the - // window, press it again - consumer->GetInputWindow()->SetCurrent(true); - consumer->PerformAction(wxACTION_BUTTON_PRESS); - - return true; - } - } - - return wxStdInputHandler::HandleMouseMove(consumer, event); -} - -bool wxStdButtonInputHandler::HandleFocus(wxInputConsumer * WXUNUSED(consumer), - const wxFocusEvent& WXUNUSED(event)) -{ - // buttons change appearance when they get/lose focus, so return true to - // refresh - return true; -} - -bool wxStdButtonInputHandler::HandleActivation(wxInputConsumer *consumer, - bool WXUNUSED(activated)) -{ - // the default button changes appearance when the app is [de]activated, so - // return true to refresh - return wxStaticCast(consumer->GetInputWindow(), wxButton)->IsDefault(); -} - -#endif // wxUSE_BUTTON - diff --git a/wxWidgets/src/univ/checkbox.cpp b/wxWidgets/src/univ/checkbox.cpp deleted file mode 100644 index 63f9e3b429..0000000000 --- a/wxWidgets/src/univ/checkbox.cpp +++ /dev/null @@ -1,367 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/univ/checkbox.cpp -// Purpose: wxCheckBox implementation -// Author: Vadim Zeitlin -// Modified by: -// Created: 25.08.00 -// RCS-ID: $Id: checkbox.cpp 42816 2006-10-31 08:50:17Z RD $ -// Copyright: (c) 2000 SciTech Software, Inc. (www.scitechsoft.com) -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_CHECKBOX - -#include "wx/checkbox.h" - -#ifndef WX_PRECOMP - #include "wx/dcclient.h" - #include "wx/validate.h" - - #include "wx/button.h" // for wxACTION_BUTTON_XXX -#endif - -#include "wx/univ/theme.h" -#include "wx/univ/renderer.h" -#include "wx/univ/inphand.h" -#include "wx/univ/colschem.h" - -// ---------------------------------------------------------------------------- -// wxStdCheckboxInputHandler: handles the mouse events for the check and radio -// boxes (handling the keyboard input is simple, but its handling differs a -// lot between GTK and MSW, so a new class should be derived for this) -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxStdCheckboxInputHandler : public wxStdInputHandler -{ -public: - wxStdCheckboxInputHandler(wxInputHandler *inphand); - - // we have to override this one as wxStdButtonInputHandler version works - // only with the buttons - virtual bool HandleActivation(wxInputConsumer *consumer, bool activated); -}; - -// ============================================================================ -// implementation -// ============================================================================ - -IMPLEMENT_DYNAMIC_CLASS(wxCheckBox, wxControl) - -// ---------------------------------------------------------------------------- -// wxCheckBox -// ---------------------------------------------------------------------------- - -void wxCheckBox::Init() -{ - m_isPressed = false; - m_status = Status_Unchecked; -} - -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 ( !wxControl::Create(parent, id, pos, size, style, validator, name) ) - return false; - - SetLabel(label); - SetInitialSize(size); - - CreateInputHandler(wxINP_HANDLER_CHECKBOX); - - return true; -} - -// ---------------------------------------------------------------------------- -// checkbox interface -// ---------------------------------------------------------------------------- - -bool wxCheckBox::GetValue() const -{ - return (Get3StateValue() != wxCHK_UNCHECKED); -} - -void wxCheckBox::SetValue(bool value) -{ - Set3StateValue( value ? wxCHK_CHECKED : wxCHK_UNCHECKED ); -} - -void wxCheckBox::OnCheck() -{ - // we do nothing here -} - -// ---------------------------------------------------------------------------- -// indicator bitmaps -// ---------------------------------------------------------------------------- - -wxBitmap wxCheckBox::GetBitmap(State state, Status status) const -{ - wxBitmap bmp = m_bitmaps[state][status]; - if ( !bmp.Ok() ) - bmp = m_bitmaps[State_Normal][status]; - - return bmp; -} - -void wxCheckBox::SetBitmap(const wxBitmap& bmp, State state, Status status) -{ - m_bitmaps[state][status] = bmp; -} - -// ---------------------------------------------------------------------------- -// drawing -// ---------------------------------------------------------------------------- - -wxCheckBox::State wxCheckBox::GetState(int flags) const -{ - if ( flags & wxCONTROL_DISABLED ) - return State_Disabled; - else if ( flags & wxCONTROL_PRESSED ) - return State_Pressed; - else if ( flags & wxCONTROL_CURRENT ) - return State_Current; - else - return State_Normal; -} - -void wxCheckBox::DoDraw(wxControlRenderer *renderer) -{ - int flags = GetStateFlags(); - - wxDC& dc = renderer->GetDC(); - dc.SetFont(GetFont()); - dc.SetTextForeground(GetForegroundColour()); - - switch ( Get3StateValue() ) - { - case wxCHK_CHECKED: flags |= wxCONTROL_CHECKED; break; - case wxCHK_UNDETERMINED: flags |= wxCONTROL_UNDETERMINED; break; - default: /* do nothing */ break; - } - - wxBitmap bitmap(GetBitmap(GetState(flags), m_status)); - - renderer->GetRenderer()-> - DrawCheckButton(dc, - GetLabel(), - bitmap, - renderer->GetRect(), - flags, - GetWindowStyle() & wxALIGN_RIGHT ? wxALIGN_RIGHT - : wxALIGN_LEFT, - GetAccelIndex()); -} - -// ---------------------------------------------------------------------------- -// geometry calculations -// ---------------------------------------------------------------------------- - -wxSize wxCheckBox::GetBitmapSize() const -{ - wxBitmap bmp = GetBitmap(State_Normal, Status_Checked); - return bmp.Ok() ? wxSize(bmp.GetWidth(), bmp.GetHeight()) - : GetRenderer()->GetCheckBitmapSize(); -} - -wxSize wxCheckBox::DoGetBestClientSize() const -{ - wxClientDC dc(wxConstCast(this, wxCheckBox)); - dc.SetFont(GetFont()); - wxCoord width, height; - dc.GetMultiLineTextExtent(GetLabel(), &width, &height); - - wxSize sizeBmp = GetBitmapSize(); - if ( height < sizeBmp.y ) - height = sizeBmp.y; - -#if defined(wxUNIV_COMPATIBLE_MSW) && wxUNIV_COMPATIBLE_MSW - // FIXME: flag nowhere defined so perhaps should be removed? - - // this looks better but is different from what wxMSW does - height += GetCharHeight()/2; -#endif // wxUNIV_COMPATIBLE_MSW - - width += sizeBmp.x + 2*GetCharWidth(); - - return wxSize(width, height); -} - -// ---------------------------------------------------------------------------- -// checkbox actions -// ---------------------------------------------------------------------------- - -void wxCheckBox::DoSet3StateValue(wxCheckBoxState state) -{ - Status status; - switch ( state ) - { - case wxCHK_UNCHECKED: status = Status_Unchecked; break; - case wxCHK_CHECKED: status = Status_Checked; break; - default: wxFAIL_MSG(_T("Unknown checkbox state")); - case wxCHK_UNDETERMINED: status = Status_3rdState; break; - } - if ( status != m_status ) - { - m_status = status; - - if ( m_status == Status_Checked ) - { - // invoke the hook - OnCheck(); - } - - Refresh(); - } -} - -wxCheckBoxState wxCheckBox::DoGet3StateValue() const -{ - switch ( m_status ) - { - case Status_Checked: return wxCHK_CHECKED; - case Status_Unchecked: return wxCHK_UNCHECKED; - default: /* go further */ break; - } - return wxCHK_UNDETERMINED; -} - -void wxCheckBox::Press() -{ - if ( !m_isPressed ) - { - m_isPressed = true; - - Refresh(); - } -} - -void wxCheckBox::Release() -{ - if ( m_isPressed ) - { - m_isPressed = false; - - Refresh(); - } -} - -void wxCheckBox::Toggle() -{ - m_isPressed = false; - - Status status = m_status; - - switch ( Get3StateValue() ) - { - case wxCHK_CHECKED: - Set3StateValue(Is3rdStateAllowedForUser() ? wxCHK_UNDETERMINED : wxCHK_UNCHECKED); - break; - - case wxCHK_UNCHECKED: - Set3StateValue(wxCHK_CHECKED); - break; - - case wxCHK_UNDETERMINED: - Set3StateValue(wxCHK_UNCHECKED); - break; - } - - if( status != m_status ) - SendEvent(); -} - -void wxCheckBox::ChangeValue(bool value) -{ - SetValue(value); - - SendEvent(); -} - -void wxCheckBox::SendEvent() -{ - wxCommandEvent event(wxEVT_COMMAND_CHECKBOX_CLICKED, GetId()); - InitCommandEvent(event); - wxCheckBoxState state = Get3StateValue(); - - // If the style flag to allow the user setting the undetermined state - // is not set, then skip the undetermined state and set it to unchecked. - if ( state == wxCHK_UNDETERMINED && !Is3rdStateAllowedForUser() ) - { - state = wxCHK_UNCHECKED; - Set3StateValue(state); - } - - event.SetInt(state); - Command(event); -} - -// ---------------------------------------------------------------------------- -// input handling -// ---------------------------------------------------------------------------- - -bool wxCheckBox::PerformAction(const wxControlAction& action, - long numArg, - const wxString& strArg) -{ - if ( action == wxACTION_BUTTON_PRESS ) - Press(); - else if ( action == wxACTION_BUTTON_RELEASE ) - Release(); - if ( action == wxACTION_CHECKBOX_CHECK ) - ChangeValue(true); - else if ( action == wxACTION_CHECKBOX_CLEAR ) - ChangeValue(false); - else if ( action == wxACTION_CHECKBOX_TOGGLE ) - Toggle(); - else - return wxControl::PerformAction(action, numArg, strArg); - - return true; -} - -/* static */ -wxInputHandler *wxCheckBox::CreateStdInputHandler(wxInputHandler *handlerDef) -{ - static wxStdCheckboxInputHandler s_handler(handlerDef); - - return &s_handler; -} - -// ---------------------------------------------------------------------------- -// wxStdCheckboxInputHandler -// ---------------------------------------------------------------------------- - -wxStdCheckboxInputHandler::wxStdCheckboxInputHandler(wxInputHandler *def) - : wxStdInputHandler(wxButton::GetStdInputHandler(def)) -{ -} - -bool wxStdCheckboxInputHandler::HandleActivation(wxInputConsumer *consumer, - bool WXUNUSED(activated)) -{ - // only the focused checkbox appearance changes when the app gains/loses - // activation - return consumer->GetInputWindow()->IsFocused(); -} - -#endif // wxUSE_CHECKBOX diff --git a/wxWidgets/src/univ/checklst.cpp b/wxWidgets/src/univ/checklst.cpp deleted file mode 100644 index f9bd2ac3ad..0000000000 --- a/wxWidgets/src/univ/checklst.cpp +++ /dev/null @@ -1,303 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/univ/checklst.cpp -// Purpose: wxCheckListBox implementation -// Author: Vadim Zeitlin -// Modified by: -// Created: 12.09.00 -// RCS-ID: $Id: checklst.cpp 41227 2006-09-14 19:36:47Z VZ $ -// Copyright: (c) 2000 SciTech Software, Inc. (www.scitechsoft.com) -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_CHECKLISTBOX - -#include "wx/checklst.h" - -#ifndef WX_PRECOMP - #include "wx/log.h" - #include "wx/dcclient.h" - #include "wx/validate.h" -#endif - -#include "wx/univ/renderer.h" -#include "wx/univ/inphand.h" -#include "wx/univ/theme.h" - -// ---------------------------------------------------------------------------- -// wxStdCheckListBoxInputHandler -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxStdCheckListboxInputHandler : public wxStdInputHandler -{ -public: - wxStdCheckListboxInputHandler(wxInputHandler *inphand); - - virtual bool HandleKey(wxInputConsumer *consumer, - const wxKeyEvent& event, - bool pressed); - virtual bool HandleMouse(wxInputConsumer *consumer, - const wxMouseEvent& event); -}; - -// ============================================================================ -// implementation of wxCheckListBox -// ============================================================================ - -IMPLEMENT_DYNAMIC_CLASS(wxCheckListBox, wxListBox) - -// ---------------------------------------------------------------------------- -// creation -// ---------------------------------------------------------------------------- - -void wxCheckListBox::Init() -{ -} - -wxCheckListBox::wxCheckListBox(wxWindow *parent, - wxWindowID id, - const wxPoint &pos, - const wxSize &size, - const wxArrayString& choices, - long style, - const wxValidator& validator, - const wxString &name) -{ - Init(); - - Create(parent, id, pos, size, choices, style, validator, name); -} - -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 ( !wxListBox::Create(parent, id, pos, size, - n, choices, style, validator, name) ) - return false; - - CreateInputHandler(wxINP_HANDLER_CHECKLISTBOX); - - return true; -} - -// ---------------------------------------------------------------------------- -// wxCheckListBox functions -// ---------------------------------------------------------------------------- - -bool wxCheckListBox::IsChecked(unsigned int item) const -{ - wxCHECK_MSG( IsValid(item), false, - _T("invalid index in wxCheckListBox::IsChecked") ); - - return m_checks[item] != 0; -} - -void wxCheckListBox::Check(unsigned int item, bool check) -{ - wxCHECK_RET( IsValid(item), - _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; - - RefreshItem(item); - } -} - -// ---------------------------------------------------------------------------- -// methods forwarded to wxListBox -// ---------------------------------------------------------------------------- - -void wxCheckListBox::Delete(unsigned int n) -{ - wxCHECK_RET( IsValid(n), _T("invalid index in wxListBox::Delete") ); - - wxListBox::Delete(n); - - m_checks.RemoveAt(n); -} - -int wxCheckListBox::DoAppend(const wxString& item) -{ - int pos = wxListBox::DoAppend(item); - - // the item is initially unchecked - m_checks.Insert(false, pos); - - return pos; -} - -void wxCheckListBox::DoInsertItems(const wxArrayString& items, unsigned int pos) -{ - wxListBox::DoInsertItems(items, pos); - - unsigned int count = items.GetCount(); - for ( unsigned int 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); - - unsigned int count = items.GetCount(); - for ( unsigned int n = 0; n < count; n++ ) - { - m_checks.Add(false); - } -} - -void wxCheckListBox::DoClear() -{ - m_checks.Empty(); -} - -// ---------------------------------------------------------------------------- -// drawing -// ---------------------------------------------------------------------------- - -wxSize wxCheckListBox::DoGetBestClientSize() const -{ - wxSize size = wxListBox::DoGetBestClientSize(); - size.x += GetRenderer()->GetCheckBitmapSize().x; - - return size; -} - -void wxCheckListBox::DoDrawRange(wxControlRenderer *renderer, - int itemFirst, int itemLast) -{ - renderer->DrawCheckItems(this, itemFirst, itemLast); -} - -// ---------------------------------------------------------------------------- -// actions -// ---------------------------------------------------------------------------- - -bool wxCheckListBox::PerformAction(const wxControlAction& action, - long numArg, - const wxString& strArg) -{ - if ( action == wxACTION_CHECKLISTBOX_TOGGLE ) - { - int sel = (int)numArg; - if ( sel == -1 ) - { - sel = GetSelection(); - } - - if ( sel != -1 ) - { - Check(sel, !IsChecked(sel)); - - SendEvent(wxEVT_COMMAND_CHECKLISTBOX_TOGGLED, sel); - } - } - else - { - return wxListBox::PerformAction(action, numArg, strArg); - } - - return true; -} - -/* static */ -wxInputHandler *wxCheckListBox::GetStdInputHandler(wxInputHandler *handlerDef) -{ - static wxStdCheckListboxInputHandler s_handler(handlerDef); - - return &s_handler; -} - -// ---------------------------------------------------------------------------- -// wxStdCheckListboxInputHandler -// ---------------------------------------------------------------------------- - -wxStdCheckListboxInputHandler:: -wxStdCheckListboxInputHandler(wxInputHandler *inphand) - : wxStdInputHandler(wxListBox::GetStdInputHandler(inphand)) -{ -} - -bool wxStdCheckListboxInputHandler::HandleKey(wxInputConsumer *consumer, - const wxKeyEvent& event, - bool pressed) -{ - if ( pressed && (event.GetKeyCode() == WXK_SPACE) ) - consumer->PerformAction(wxACTION_CHECKLISTBOX_TOGGLE); - - return wxStdInputHandler::HandleKey(consumer, event, pressed); -} - -bool wxStdCheckListboxInputHandler::HandleMouse(wxInputConsumer *consumer, - const wxMouseEvent& event) -{ - if ( event.LeftDown() || event.LeftDClick() ) - { - wxCheckListBox *lbox = wxStaticCast(consumer->GetInputWindow(), wxCheckListBox); - int x, y; - - wxPoint pt = event.GetPosition(); - pt -= consumer->GetInputWindow()->GetClientAreaOrigin(); - lbox->CalcUnscrolledPosition(pt.x, pt.y, &x, &y); - - wxRenderer *renderer = lbox->GetRenderer(); - x -= renderer->GetCheckItemMargin(); - - int item = y / lbox->GetLineHeight(); - if ( x >= 0 && - x < renderer->GetCheckBitmapSize().x && - item >= 0 && - (unsigned int)item < lbox->GetCount() ) - { - lbox->PerformAction(wxACTION_CHECKLISTBOX_TOGGLE, item); - - return true; - } - } - - return wxStdInputHandler::HandleMouse(consumer, event); -} - -#endif // wxUSE_CHECKLISTBOX diff --git a/wxWidgets/src/univ/choice.cpp b/wxWidgets/src/univ/choice.cpp deleted file mode 100644 index 12afceb9ef..0000000000 --- a/wxWidgets/src/univ/choice.cpp +++ /dev/null @@ -1,94 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/univ/choice.cpp -// Purpose: wxChoice implementation -// Author: Vadim Zeitlin -// Modified by: -// Created: 15.12.00 -// RCS-ID: $Id: choice.cpp 39470 2006-05-30 07:34:30Z ABX $ -// Copyright: (c) 2000 SciTech Software, Inc. (www.scitechsoft.com) -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_CHOICE - -#include "wx/choice.h" - -#ifndef WX_PRECOMP - #include "wx/arrstr.h" -#endif - -IMPLEMENT_DYNAMIC_CLASS(wxChoice, wxControl) - -BEGIN_EVENT_TABLE(wxChoice, wxComboBox) - EVT_COMBOBOX(wxID_ANY, wxChoice::OnComboBox) -END_EVENT_TABLE() - -wxChoice::wxChoice(wxWindow *parent, wxWindowID id, - const wxPoint& pos, - const wxSize& size, - const wxArrayString& choices, - long style, - const wxValidator& validator, - const wxString& name) -{ - Create(parent, id, pos, size, choices, style, validator, name); -} - -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 WXUNUSED(style), - const wxValidator& validator, - const wxString& name) -{ - wxString value; - if ( n ) - value = choices[0]; - return wxComboBox::Create(parent, id, value, - pos, size, n, choices, - wxCB_READONLY, validator, name); -} - - -void wxChoice::OnComboBox(wxCommandEvent& event) -{ - if ( event.GetId() == GetId() ) - { - event.SetEventType(wxEVT_COMMAND_CHOICE_SELECTED); - event.Skip(); - GetEventHandler()->ProcessEvent(event); - } - else - event.Skip(); -} - -#endif // wxUSE_CHOICE diff --git a/wxWidgets/src/univ/colschem.cpp b/wxWidgets/src/univ/colschem.cpp deleted file mode 100644 index 8f4aaf827e..0000000000 --- a/wxWidgets/src/univ/colschem.cpp +++ /dev/null @@ -1,102 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: src/univ/colschem.cpp -// Purpose: (trivial) wxColourScheme implementation -// Author: Vadim Zeitlin -// Modified by: -// Created: 20.08.00 -// RCS-ID: $Id: colschem.cpp 67017 2011-02-25 09:37:28Z JS $ -// Copyright: (c) 2000 SciTech Software, Inc. (www.scitechsoft.com) -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -// =========================================================================== -// declarations -// =========================================================================== - -// --------------------------------------------------------------------------- -// headers -// --------------------------------------------------------------------------- - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#ifndef WX_PRECOMP - #include "wx/settings.h" - #include "wx/gdicmn.h" -#endif // WX_PRECOMP - -#include "wx/univ/colschem.h" -#include "wx/univ/theme.h" - -// ============================================================================ -// implementation -// ============================================================================ - -// ---------------------------------------------------------------------------- -// wxColourScheme -// ---------------------------------------------------------------------------- - -wxColourScheme::~wxColourScheme() -{ -} - -// ---------------------------------------------------------------------------- -// wxSystemSettings -// ---------------------------------------------------------------------------- - -wxColour wxSystemSettings::GetColour(wxSystemColour index) -{ - // the elements of this enum must be kept in sync with wxSystemColour - static const wxColourScheme::StdColour s_mapSysToThemeCol[] = - { - wxColourScheme::SCROLLBAR /* wxSYS_COLOUR_SCROLLBAR */, - wxColourScheme::WINDOW /* wxSYS_COLOUR_BACKGROUND */, - wxColourScheme::TITLEBAR_ACTIVE_TEXT /* wxSYS_COLOUR_ACTIVECAPTION */, - wxColourScheme::TITLEBAR_TEXT /* wxSYS_COLOUR_INACTIVECAPTION */, - wxColourScheme::MAX /* wxSYS_COLOUR_MENU */, - wxColourScheme::MAX /* wxSYS_COLOUR_WINDOW */, - wxColourScheme::MAX /* wxSYS_COLOUR_WINDOWFRAME */, - wxColourScheme::CONTROL_TEXT /* wxSYS_COLOUR_MENUTEXT */, - wxColourScheme::CONTROL_TEXT /* wxSYS_COLOUR_WINDOWTEXT */, - wxColourScheme::CONTROL_TEXT /* wxSYS_COLOUR_CAPTIONTEXT */, - wxColourScheme::MAX /* wxSYS_COLOUR_ACTIVEBORDER */, - wxColourScheme::MAX /* wxSYS_COLOUR_INACTIVEBORDER */, - wxColourScheme::FRAME /* wxSYS_COLOUR_APPWORKSPACE */, - wxColourScheme::HIGHLIGHT /* wxSYS_COLOUR_HIGHLIGHT */, - wxColourScheme::HIGHLIGHT_TEXT /* wxSYS_COLOUR_HIGHLIGHTTEXT */, - wxColourScheme::CONTROL /* wxSYS_COLOUR_BTNFACE */, - wxColourScheme::SHADOW_DARK /* wxSYS_COLOUR_BTNSHADOW */, - wxColourScheme::CONTROL_TEXT_DISABLED /* wxSYS_COLOUR_GRAYTEXT */, - wxColourScheme::CONTROL_TEXT /* wxSYS_COLOUR_BTNTEXT */, - wxColourScheme::MAX /* wxSYS_COLOUR_INACTIVECAPTIONTEXT */, - wxColourScheme::SHADOW_HIGHLIGHT /* wxSYS_COLOUR_BTNHIGHLIGHT */, - wxColourScheme::SHADOW_DARK /* wxSYS_COLOUR_3DDKSHADOW */, - wxColourScheme::SHADOW_OUT /* wxSYS_COLOUR_3DLIGHT */, - wxColourScheme::MAX /* wxSYS_COLOUR_INFOTEXT */, - wxColourScheme::MAX /* wxSYS_COLOUR_INFOBK */, - wxColourScheme::WINDOW /* wxSYS_COLOUR_LISTBOX */, - wxColourScheme::SHADOW_HIGHLIGHT /* wxSYS_COLOUR_HOTLIGHT */, - wxColourScheme::TITLEBAR_ACTIVE_TEXT /* wxSYS_COLOUR_GRADIENTACTIVECAPTION */, - wxColourScheme::TITLEBAR_TEXT /* wxSYS_COLOUR_GRADIENTINACTIVECAPTION */, - wxColourScheme::SHADOW_DARK /* wxSYS_COLOUR_MENUHILIGHT */, - wxColourScheme::CONTROL /* wxSYS_COLOUR_MENUBAR */, - wxColourScheme::CONTROL_TEXT /* wxSYS_COLOUR_LISTBOXTEXT */, - wxColourScheme::HIGHLIGHT_TEXT /* wxSYS_COLOUR_LISTBOXHIGHLIGHTTEXT */ - }; - - wxCHECK_MSG( index < (int)WXSIZEOF(s_mapSysToThemeCol), wxNullColour, - _T("invalid wxSystemColour") ); - - wxColourScheme::StdColour col = s_mapSysToThemeCol[index]; - if ( col == wxColourScheme::MAX ) - { - // we don't have theme-equivalent for this colour - return wxSystemSettingsNative::GetColour(index); - } - - return wxTheme::Get()->GetColourScheme()->Get(col); -} diff --git a/wxWidgets/src/univ/combobox.cpp b/wxWidgets/src/univ/combobox.cpp deleted file mode 100644 index bbf4303fcc..0000000000 --- a/wxWidgets/src/univ/combobox.cpp +++ /dev/null @@ -1,559 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/univ/combobox.cpp -// Purpose: wxComboBox implementation -// Author: Vadim Zeitlin -// Modified by: -// Created: 15.12.00 -// RCS-ID: $Id: combobox.cpp 45655 2007-04-26 02:23:51Z VZ $ -// Copyright: (c) 2000 SciTech Software, Inc. (www.scitechsoft.com) -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_COMBOBOX - -#ifndef WX_PRECOMP - #include "wx/log.h" - - #include "wx/button.h" - #include "wx/combobox.h" - #include "wx/listbox.h" - #include "wx/textctrl.h" - #include "wx/bmpbuttn.h" - - #include "wx/validate.h" -#endif - -#include "wx/tooltip.h" -#include "wx/combo.h" - -#include "wx/univ/renderer.h" -#include "wx/univ/inphand.h" -#include "wx/univ/theme.h" - -// ---------------------------------------------------------------------------- -// wxStdComboBoxInputHandler: allows the user to open/close the combo from kbd -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxStdComboBoxInputHandler : public wxStdInputHandler -{ -public: - wxStdComboBoxInputHandler(wxInputHandler *inphand); - - virtual bool HandleKey(wxInputConsumer *consumer, - const wxKeyEvent& event, - bool pressed); -}; - -// ---------------------------------------------------------------------------- -// wxComboListBox is a listbox modified to be used as a popup window in a -// combobox -// ---------------------------------------------------------------------------- - -class wxComboListBox : public wxListBox, public wxComboPopup -{ -public: - // ctor and dtor - wxComboListBox(); - virtual ~wxComboListBox(); - - // implement wxComboPopup methods - virtual bool Create(wxWindow* parent); - virtual void SetStringValue(const wxString& s); - virtual wxString GetStringValue() const; - virtual wxWindow *GetControl() { return this; } - virtual void OnPopup(); - virtual wxSize GetAdjustedSize(int minWidth, int prefHeight, int maxHeight); - - // fix virtual function hiding - virtual void SetSelection(int n) { DoSetSelection(n, true); } - void SetSelection(int n, bool select) { DoSetSelection(n, select); } - - // used to process wxUniv actions - bool PerformAction(const wxControlAction& action, - long numArg, - const wxString& strArg); - -protected: - // set m_clicked value from here - void OnLeftUp(wxMouseEvent& event); - -private: - DECLARE_EVENT_TABLE() -}; - -// ---------------------------------------------------------------------------- -// event tables and such -// ---------------------------------------------------------------------------- - -BEGIN_EVENT_TABLE(wxComboListBox, wxListBox) - EVT_LEFT_UP(wxComboListBox::OnLeftUp) -END_EVENT_TABLE() - -IMPLEMENT_DYNAMIC_CLASS2(wxComboBox, wxControl, wxComboCtrl) - -// ============================================================================ -// implementation -// ============================================================================ - -// ---------------------------------------------------------------------------- -// wxComboListBox -// ---------------------------------------------------------------------------- - -wxComboListBox::wxComboListBox() : wxListBox(), wxComboPopup() -{ -} - -bool wxComboListBox::Create(wxWindow* parent) -{ - if ( !wxListBox::Create(parent, wxID_ANY, - wxDefaultPosition, wxDefaultSize, - 0, NULL, - wxBORDER_SIMPLE | - ( m_combo->GetWindowStyle() & wxCB_SORT ? wxLB_SORT : 0 ) ) ) - return false; - - // we don't react to the mouse events outside the window at all - StopAutoScrolling(); - - return true; -} - -wxComboListBox::~wxComboListBox() -{ -} - -wxString wxComboListBox::GetStringValue() const -{ - return wxListBox::GetStringSelection(); -} - -void wxComboListBox::SetStringValue(const wxString& value) -{ - if ( !value.empty() ) - { - if (FindString(value) != wxNOT_FOUND) - wxListBox::SetStringSelection(value); - } - else - wxListBox::SetSelection(-1); -} - -void wxComboListBox::OnPopup() -{ -} - -bool wxComboListBox::PerformAction(const wxControlAction& action, - long numArg, - const wxString& strArg) - -{ - if ( action == wxACTION_LISTBOX_FIND ) - { - // we don't let the listbox handle this as instead of just using the - // single key presses, as usual, we use the text ctrl value as prefix - // and this is done by wxComboCtrl itself - return true; - } - - return wxListBox::PerformAction(action, numArg, strArg); -} - -void wxComboListBox::OnLeftUp(wxMouseEvent& event) -{ - // we should dismiss the combo now - // first update the combo and close the listbox - Dismiss(); - m_combo->SetValue(wxListBox::GetStringSelection()); - - // next let the user code have the event - wxCommandEvent evt(wxEVT_COMMAND_COMBOBOX_SELECTED,m_combo->GetId()); - evt.SetInt(wxListBox::GetSelection()); - evt.SetEventObject(m_combo); - m_combo->ProcessEvent(evt); - - event.Skip(); -} - -wxSize wxComboListBox::GetAdjustedSize(int minWidth, - int WXUNUSED(prefHeight), - int maxHeight) -{ - wxSize bestSize = wxListBox::GetBestSize(); - return wxSize(wxMax(bestSize.x,minWidth), - wxMin(bestSize.y,maxHeight)); -} - -// ---------------------------------------------------------------------------- -// wxComboBox -// ---------------------------------------------------------------------------- - -void wxComboBox::Init() -{ - m_lbox = (wxListBox *)NULL; -} - -wxComboBox::wxComboBox(wxWindow *parent, - wxWindowID id, - const wxString& value, - const wxPoint& pos, - const wxSize& size, - const wxArrayString& choices, - long style, - const wxValidator& validator, - const wxString& name) -{ - Init(); - - Create(parent, id, value, pos, size, choices, style, validator, name); -} - -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 ( !wxComboCtrl::Create(parent, id, value, pos, size, style, - validator, name) ) - { - return false; - } - - wxComboListBox *combolbox = new wxComboListBox(); - SetPopupControl(combolbox); - - m_lbox = combolbox; - m_lbox->Set(n, choices); - - return true; -} - -wxComboBox::~wxComboBox() -{ -} - -// ---------------------------------------------------------------------------- -// wxComboBox methods forwarded to wxTextCtrl -// ---------------------------------------------------------------------------- - -wxString wxComboBox::GetValue() const -{ - return wxComboCtrl::GetValue(); -} - -void wxComboBox::SetValue(const wxString& value) -{ - wxComboCtrl::SetValue(value); -} - -void wxComboBox::Copy() -{ - if ( GetTextCtrl() ) GetTextCtrl()->Copy(); -} - -void wxComboBox::Cut() -{ - if ( GetTextCtrl() ) GetTextCtrl()->Cut(); -} - -void wxComboBox::Paste() -{ - if ( GetTextCtrl() ) GetTextCtrl()->Paste(); -} - -void wxComboBox::SetInsertionPoint(long pos) -{ - if ( GetTextCtrl() ) GetTextCtrl()->SetInsertionPoint(pos); -} - -void wxComboBox::SetInsertionPointEnd() -{ - if ( GetTextCtrl() ) GetTextCtrl()->SetInsertionPointEnd(); -} - -long wxComboBox::GetInsertionPoint() const -{ - if ( GetTextCtrl() ) - return GetTextCtrl()->GetInsertionPoint(); - return -1; -} - -wxTextPos wxComboBox::GetLastPosition() const -{ - if ( GetTextCtrl() ) - return GetTextCtrl()->GetLastPosition(); - return -1; -} - -void wxComboBox::Replace(long from, long to, const wxString& value) -{ - if ( GetTextCtrl() ) GetTextCtrl()->Replace(from, to, value); -} - -void wxComboBox::Remove(long from, long to) -{ - if ( GetTextCtrl() ) GetTextCtrl()->Remove(from, to); -} - -void wxComboBox::SetSelection(long from, long to) -{ - if ( GetTextCtrl() ) GetTextCtrl()->SetSelection(from, to); -} - -void wxComboBox::SetEditable(bool editable) -{ - if ( GetTextCtrl() ) GetTextCtrl()->SetEditable(editable); -} - -// ---------------------------------------------------------------------------- -// wxComboBox methods forwarded to wxListBox -// ---------------------------------------------------------------------------- - -void wxComboBox::Clear() -{ - GetLBox()->Clear(); - if ( GetTextCtrl() ) GetTextCtrl()->SetValue(wxEmptyString); -} - -void wxComboBox::Delete(unsigned int n) -{ - wxCHECK_RET( IsValid(n), _T("invalid index in wxComboBox::Delete") ); - - if (GetSelection() == (int)n) - if ( GetTextCtrl() ) GetTextCtrl()->SetValue(wxEmptyString); - - GetLBox()->Delete(n); -} - -unsigned int wxComboBox::GetCount() const -{ - return GetLBox()->GetCount(); -} - -wxString wxComboBox::GetString(unsigned int n) const -{ - wxCHECK_MSG( IsValid(n), wxEmptyString, _T("invalid index in wxComboBox::GetString") ); - - return GetLBox()->GetString(n); -} - -void wxComboBox::SetString(unsigned int n, const wxString& s) -{ - wxCHECK_RET( IsValid(n), _T("invalid index in wxComboBox::SetString") ); - - GetLBox()->SetString(n, s); -} - -int wxComboBox::FindString(const wxString& s, bool bCase) const -{ - return GetLBox()->FindString(s, bCase); -} - -void wxComboBox::SetSelection(int n) -{ - wxCHECK_RET( (n == wxNOT_FOUND || IsValid(n)), _T("invalid index in wxComboBox::Select") ); - - GetLBox()->SetSelection(n); - - wxString str; - if ( n != wxNOT_FOUND ) - str = GetLBox()->GetString(n); - - SetText(str); -} - -int wxComboBox::GetSelection() const -{ -#if 1 // FIXME:: What is the correct behavior? - // if the current value isn't one of the listbox strings, return -1 - return GetLBox()->GetSelection(); -#else - // Why oh why is this done this way? - // It is not because the value displayed in the text can be found - // in the list that it is the item that is selected! - return FindString(if ( GetTextCtrl() ) GetTextCtrl()->GetValue()); -#endif -} - -int wxComboBox::DoAppend(const wxString& item) -{ - return GetLBox()->Append(item); -} - -int wxComboBox::DoInsert(const wxString& item, unsigned int pos) -{ - wxCHECK_MSG(!(GetWindowStyle() & wxCB_SORT), -1, wxT("can't insert into sorted list")); - wxCHECK_MSG(IsValidInsert(pos), -1, wxT("invalid index")); - - if (pos == GetCount()) - return DoAppend(item); - - GetLBox()->Insert(item, pos); - return pos; -} - -void wxComboBox::DoSetItemClientData(unsigned int n, void* clientData) -{ - GetLBox()->SetClientData(n, clientData); -} - -void *wxComboBox::DoGetItemClientData(unsigned int n) const -{ - return GetLBox()->GetClientData(n); -} - -void wxComboBox::DoSetItemClientObject(unsigned int n, wxClientData* clientData) -{ - GetLBox()->SetClientObject(n, clientData); -} - -wxClientData* wxComboBox::DoGetItemClientObject(unsigned int n) const -{ - return GetLBox()->GetClientObject(n); -} - -bool wxComboBox::IsEditable() const -{ - return GetTextCtrl() != NULL && (!HasFlag(wxCB_READONLY) || GetTextCtrl()->IsEditable() ); -} - -void wxComboBox::Undo() -{ - if (IsEditable()) - if ( GetTextCtrl() ) GetTextCtrl()->Undo(); -} - -void wxComboBox::Redo() -{ - if (IsEditable()) - if ( GetTextCtrl() ) GetTextCtrl()->Redo(); -} - -void wxComboBox::SelectAll() -{ - if ( GetTextCtrl() ) GetTextCtrl()->SelectAll(); -} - -bool wxComboBox::CanCopy() const -{ - if (GetTextCtrl() != NULL) - return GetTextCtrl()->CanCopy(); - else - return false; -} - -bool wxComboBox::CanCut() const -{ - if (GetTextCtrl() != NULL) - return GetTextCtrl()->CanCut(); - else - return false; -} - -bool wxComboBox::CanPaste() const -{ - if (IsEditable()) - return GetTextCtrl()->CanPaste(); - else - return false; -} - -bool wxComboBox::CanUndo() const -{ - if (IsEditable()) - return GetTextCtrl()->CanUndo(); - else - return false; -} - -bool wxComboBox::CanRedo() const -{ - if (IsEditable()) - return GetTextCtrl()->CanRedo(); - else - return false; -} - - -// ---------------------------------------------------------------------------- -// wxStdComboBoxInputHandler -// ---------------------------------------------------------------------------- - -wxStdComboBoxInputHandler::wxStdComboBoxInputHandler(wxInputHandler *inphand) - : wxStdInputHandler(inphand) -{ -} - -bool wxStdComboBoxInputHandler::HandleKey(wxInputConsumer *consumer, - const wxKeyEvent& event, - bool pressed) -{ - if ( pressed ) - { - wxControlAction action; - switch ( event.GetKeyCode() ) - { - case WXK_DOWN: - action = wxACTION_COMBOBOX_POPUP; - break; - - case WXK_ESCAPE: - action = wxACTION_COMBOBOX_DISMISS; - break; - } - - if ( !action.IsEmpty() ) - { - consumer->PerformAction(action); - - return true; - } - } - - return wxStdInputHandler::HandleKey(consumer, event, pressed); -} - -/* static */ -wxInputHandler *wxComboBox::GetStdInputHandler(wxInputHandler *handlerDef) -{ - static wxStdComboBoxInputHandler s_handler(handlerDef); - - return &s_handler; -} - -#endif // wxUSE_COMBOBOX diff --git a/wxWidgets/src/univ/control.cpp b/wxWidgets/src/univ/control.cpp deleted file mode 100644 index 25097f91b2..0000000000 --- a/wxWidgets/src/univ/control.cpp +++ /dev/null @@ -1,140 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/univ/control.cpp -// Purpose: universal wxControl: adds handling of mnemonics -// Author: Vadim Zeitlin -// Modified by: -// Created: 14.08.00 -// RCS-ID: $Id: control.cpp 41183 2006-09-12 22:20:15Z VZ $ -// Copyright: (c) 2000 SciTech Software, Inc. (www.scitechsoft.com) -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_CONTROLS - -#include "wx/control.h" - -#ifndef WX_PRECOMP - #include "wx/app.h" - #include "wx/dcclient.h" -#endif - -#include "wx/univ/renderer.h" -#include "wx/univ/inphand.h" -#include "wx/univ/theme.h" - -// ============================================================================ -// implementation -// ============================================================================ - -IMPLEMENT_DYNAMIC_CLASS(wxControl, wxWindow) - -BEGIN_EVENT_TABLE(wxControl, wxControlBase) - WX_EVENT_TABLE_INPUT_CONSUMER(wxControl) -END_EVENT_TABLE() - -WX_FORWARD_TO_INPUT_CONSUMER(wxControl) - -// ---------------------------------------------------------------------------- -// creation -// ---------------------------------------------------------------------------- - -void wxControl::Init() -{ - m_indexAccel = -1; -} - -bool wxControl::Create(wxWindow *parent, - wxWindowID id, - const wxPoint& pos, - const wxSize& size, - long style, - const wxValidator& validator, - const wxString& name) -{ - if ( !wxControlBase::Create(parent, id, pos, size, style, validator, name) ) - { - // underlying window creation failed? - return false; - } - - return true; -} - -// ---------------------------------------------------------------------------- -// mnemonics handling -// ---------------------------------------------------------------------------- - -/* static */ -int wxControl::FindAccelIndex(const wxString& label, wxString *labelOnly) -{ - // the character following MNEMONIC_PREFIX is the accelerator for this - // control unless it is MNEMONIC_PREFIX too - this allows to insert - // literal MNEMONIC_PREFIX chars into the label - static const wxChar MNEMONIC_PREFIX = _T('&'); - - if ( labelOnly ) - { - labelOnly->Empty(); - labelOnly->Alloc(label.length()); - } - - int indexAccel = -1; - for ( const wxChar *pc = label; *pc != wxT('\0'); pc++ ) - { - if ( *pc == MNEMONIC_PREFIX ) - { - pc++; // skip it - if ( *pc != MNEMONIC_PREFIX ) - { - if ( indexAccel == -1 ) - { - // remember it (-1 is for MNEMONIC_PREFIX itself - indexAccel = pc - label.c_str() - 1; - } - else - { - wxFAIL_MSG(_T("duplicate accel char in control label")); - } - } - } - - if ( labelOnly ) - { - *labelOnly += *pc; - } - } - - return indexAccel; -} - -void wxControl::SetLabel(const wxString& label) -{ - wxString labelOld = m_label; - m_indexAccel = FindAccelIndex(label, &m_label); - - if ( m_label != labelOld ) - { - Refresh(); - } -} - -wxString wxControl::GetLabel() const -{ - return m_label; -} - -#endif // wxUSE_CONTROLS diff --git a/wxWidgets/src/univ/ctrlrend.cpp b/wxWidgets/src/univ/ctrlrend.cpp deleted file mode 100644 index f2aec4ab62..0000000000 --- a/wxWidgets/src/univ/ctrlrend.cpp +++ /dev/null @@ -1,532 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: src/univ/ctrlrend.cpp -// Purpose: wxControlRenderer implementation -// Author: Vadim Zeitlin -// Modified by: -// Created: 15.08.00 -// RCS-ID: $Id: ctrlrend.cpp 42716 2006-10-30 12:33:25Z VS $ -// Copyright: (c) 2000 SciTech Software, Inc. (www.scitechsoft.com) -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -// =========================================================================== -// declarations -// =========================================================================== - -// --------------------------------------------------------------------------- -// headers -// --------------------------------------------------------------------------- - -// 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/control.h" - #include "wx/checklst.h" - #include "wx/listbox.h" - #include "wx/scrolbar.h" - #include "wx/dc.h" - #include "wx/log.h" - #include "wx/gauge.h" - #include "wx/image.h" -#endif // WX_PRECOMP - -#include "wx/univ/theme.h" -#include "wx/univ/renderer.h" -#include "wx/univ/colschem.h" - -// ============================================================================ -// implementation -// ============================================================================ - -wxRenderer::~wxRenderer() -{ -} - -// ---------------------------------------------------------------------------- -// wxControlRenderer -// ---------------------------------------------------------------------------- - -wxControlRenderer::wxControlRenderer(wxWindow *window, - wxDC& dc, - wxRenderer *renderer) - : m_dc(dc) -{ - m_window = window; - m_renderer = renderer; - - wxSize size = m_window->GetClientSize(); - m_rect.x = - m_rect.y = 0; - m_rect.width = size.x; - m_rect.height = size.y; -} - -void wxControlRenderer::DrawLabel(const wxBitmap& bitmap, - wxCoord marginX, wxCoord marginY) -{ - m_dc.SetBackgroundMode(wxTRANSPARENT); - m_dc.SetFont(m_window->GetFont()); - m_dc.SetTextForeground(m_window->GetForegroundColour()); - - wxString label = m_window->GetLabel(); - if ( !label.empty() || bitmap.Ok() ) - { - wxRect rectLabel = m_rect; - if ( bitmap.Ok() ) - { - rectLabel.Inflate(-marginX, -marginY); - } - - wxControl *ctrl = wxStaticCast(m_window, wxControl); - - m_renderer->DrawButtonLabel(m_dc, - label, - bitmap, - rectLabel, - m_window->GetStateFlags(), - ctrl->GetAlignment(), - ctrl->GetAccelIndex()); - } -} - -void wxControlRenderer::DrawFrame() -{ - m_dc.SetFont(m_window->GetFont()); - m_dc.SetTextForeground(m_window->GetForegroundColour()); - m_dc.SetTextBackground(m_window->GetBackgroundColour()); - - wxControl *ctrl = wxStaticCast(m_window, wxControl); - - m_renderer->DrawFrame(m_dc, - m_window->GetLabel(), - m_rect, - m_window->GetStateFlags(), - ctrl->GetAlignment(), - ctrl->GetAccelIndex()); -} - -void wxControlRenderer::DrawButtonBorder() -{ - int flags = m_window->GetStateFlags(); - - m_renderer->DrawButtonBorder(m_dc, m_rect, flags, &m_rect); - - // Why do this here? - // m_renderer->DrawButtonSurface(m_dc, wxTHEME_BG_COLOUR(m_window), m_rect, flags ); -} - -void wxControlRenderer::DrawBitmap(const wxBitmap& bitmap) -{ - int style = m_window->GetWindowStyle(); - DrawBitmap(m_dc, bitmap, m_rect, - style & wxALIGN_MASK, - style & wxBI_EXPAND ? wxEXPAND : wxSTRETCH_NOT); -} - -/* static */ -void wxControlRenderer::DrawBitmap(wxDC &dc, - const wxBitmap& bitmap, - const wxRect& rect, - int alignment, - wxStretch stretch) -{ - // we may change the bitmap if we stretch it - wxBitmap bmp = bitmap; - if ( !bmp.Ok() ) - return; - - int width = bmp.GetWidth(), - height = bmp.GetHeight(); - - wxCoord x = 0, - y = 0; - if ( stretch & wxTILE ) - { - // tile the bitmap - for ( ; x < rect.width; x += width ) - { - for ( y = 0; y < rect.height; y += height ) - { - // no need to use mask here as we cover the entire window area - dc.DrawBitmap(bmp, x, y); - } - } - } -#if wxUSE_IMAGE - else if ( stretch & wxEXPAND ) - { - // stretch bitmap to fill the entire control - bmp = wxBitmap(wxImage(bmp.ConvertToImage()).Scale(rect.width, rect.height)); - } -#endif // wxUSE_IMAGE - else // not stretched, not tiled - { - if ( alignment & wxALIGN_RIGHT ) - { - x = rect.GetRight() - width; - } - else if ( alignment & wxALIGN_CENTRE ) - { - x = (rect.GetLeft() + rect.GetRight() - width + 1) / 2; - } - else // alignment & wxALIGN_LEFT - { - x = rect.GetLeft(); - } - - if ( alignment & wxALIGN_BOTTOM ) - { - y = rect.GetBottom() - height; - } - else if ( alignment & wxALIGN_CENTRE_VERTICAL ) - { - y = (rect.GetTop() + rect.GetBottom() - height + 1) / 2; - } - else // alignment & wxALIGN_TOP - { - y = rect.GetTop(); - } - } - - // do draw it - dc.DrawBitmap(bmp, x, y, true /* use mask */); -} - -#if wxUSE_SCROLLBAR - -void wxControlRenderer::DrawScrollbar(const wxScrollBar *scrollbar, - int WXUNUSED(thumbPosOld)) -{ - // we will only redraw the parts which must be redrawn and not everything - wxRegion rgnUpdate = scrollbar->GetUpdateRegion(); - - { - wxRect rectUpdate = rgnUpdate.GetBox(); - wxLogTrace(_T("scrollbar"), - _T("%s redraw: update box is (%d, %d)-(%d, %d)"), - scrollbar->IsVertical() ? _T("vert") : _T("horz"), - rectUpdate.GetLeft(), - rectUpdate.GetTop(), - rectUpdate.GetRight(), - rectUpdate.GetBottom()); - -#if 0 //def WXDEBUG_SCROLLBAR - static bool s_refreshDebug = false; - if ( s_refreshDebug ) - { - wxClientDC dc(wxConstCast(scrollbar, wxScrollBar)); - dc.SetBrush(*wxRED_BRUSH); - dc.SetPen(*wxTRANSPARENT_PEN); - dc.DrawRectangle(rectUpdate); - - // under Unix we use "--sync" X option for this - #ifdef __WXMSW__ - ::GdiFlush(); - ::Sleep(200); - #endif // __WXMSW__ - } -#endif // WXDEBUG_SCROLLBAR - } - - wxOrientation orient = scrollbar->IsVertical() ? wxVERTICAL - : wxHORIZONTAL; - - // the shaft - for ( int nBar = 0; nBar < 2; nBar++ ) - { - wxScrollBar::Element elem = - (wxScrollBar::Element)(wxScrollBar::Element_Bar_1 + nBar); - - wxRect rectBar = scrollbar->GetScrollbarRect(elem); - - if ( rgnUpdate.Contains(rectBar) ) - { - wxLogTrace(_T("scrollbar"), - _T("drawing bar part %d at (%d, %d)-(%d, %d)"), - nBar + 1, - rectBar.GetLeft(), - rectBar.GetTop(), - rectBar.GetRight(), - rectBar.GetBottom()); - - m_renderer->DrawScrollbarShaft(m_dc, - orient, - rectBar, - scrollbar->GetState(elem)); - } - } - - // arrows - for ( int nArrow = 0; nArrow < 2; nArrow++ ) - { - wxScrollBar::Element elem = - (wxScrollBar::Element)(wxScrollBar::Element_Arrow_Line_1 + nArrow); - - wxRect rectArrow = scrollbar->GetScrollbarRect(elem); - if ( rgnUpdate.Contains(rectArrow) ) - { - wxLogTrace(_T("scrollbar"), - _T("drawing arrow %d at (%d, %d)-(%d, %d)"), - nArrow + 1, - rectArrow.GetLeft(), - rectArrow.GetTop(), - rectArrow.GetRight(), - rectArrow.GetBottom()); - - scrollbar->GetArrows().DrawArrow - ( - (wxScrollArrows::Arrow)nArrow, - m_dc, - rectArrow, - true // draw a scrollbar arrow, not just an arrow - ); - } - } - - // TODO: support for page arrows - - // and the thumb - wxScrollBar::Element elem = wxScrollBar::Element_Thumb; - wxRect rectThumb = scrollbar->GetScrollbarRect(elem); - if ( rectThumb.width && rectThumb.height && rgnUpdate.Contains(rectThumb) ) - { - wxLogTrace(_T("scrollbar"), - _T("drawing thumb at (%d, %d)-(%d, %d)"), - rectThumb.GetLeft(), - rectThumb.GetTop(), - rectThumb.GetRight(), - rectThumb.GetBottom()); - - m_renderer->DrawScrollbarThumb(m_dc, - orient, - rectThumb, - scrollbar->GetState(elem)); - } -} - -#endif // wxUSE_SCROLLBAR - -void wxControlRenderer::DrawLine(wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2) -{ - wxASSERT_MSG( x1 == x2 || y1 == y2, - _T("line must be either horizontal or vertical") ); - - if ( x1 == x2 ) - m_renderer->DrawVerticalLine(m_dc, x1, y1, y2); - else // horizontal - m_renderer->DrawHorizontalLine(m_dc, y1, x1, x2); -} - -#if wxUSE_LISTBOX - -void wxControlRenderer::DrawItems(const wxListBox *lbox, - size_t itemFirst, size_t itemLast) -{ - DoDrawItems(lbox, itemFirst, itemLast); -} - -void wxControlRenderer::DoDrawItems(const wxListBox *lbox, - size_t itemFirst, size_t itemLast, -#if wxUSE_CHECKLISTBOX - bool isCheckLbox -#else - bool WXUNUSED(isCheckLbox) -#endif - ) -{ - // prepare for the drawing: calc the initial position - wxCoord lineHeight = lbox->GetLineHeight(); - - // note that SetClippingRegion() needs the physical (unscrolled) - // coordinates while we use the logical (scrolled) ones for the drawing - // itself - wxRect rect; - wxSize size = lbox->GetClientSize(); - rect.width = size.x; - rect.height = size.y; - - // keep the text inside the client rect or we will overwrite the vertical - // scrollbar for the long strings - m_dc.SetClippingRegion(rect.x, rect.y, rect.width + 1, rect.height + 1); - - // adjust the rect position now - lbox->CalcScrolledPosition(rect.x, rect.y, &rect.x, &rect.y); - rect.y += itemFirst*lineHeight; - rect.height = lineHeight; - - // the rect should go to the right visible border so adjust the width if x - // is shifted (rightmost point should stay the same) - rect.width -= rect.x; - - // we'll keep the text colour unchanged - m_dc.SetTextForeground(lbox->GetForegroundColour()); - - // an item should have the focused rect only when the lbox has focus, so - // make sure that we never set wxCONTROL_FOCUSED flag if it doesn't - int itemCurrent = wxWindow::FindFocus() == (wxWindow *)lbox // cast needed - ? lbox->GetCurrentItem() - : -1; - for ( size_t n = itemFirst; n < itemLast; n++ ) - { - int flags = 0; - if ( (int)n == itemCurrent ) - flags |= wxCONTROL_FOCUSED; - if ( lbox->IsSelected(n) ) - flags |= wxCONTROL_SELECTED; - -#if wxUSE_CHECKLISTBOX - if ( isCheckLbox ) - { - wxCheckListBox *checklstbox = wxStaticCast(lbox, wxCheckListBox); - if ( checklstbox->IsChecked(n) ) - flags |= wxCONTROL_CHECKED; - - m_renderer->DrawCheckItem(m_dc, lbox->GetString(n), - wxNullBitmap, - rect, - flags); - } - else -#endif // wxUSE_CHECKLISTBOX - { - m_renderer->DrawItem(m_dc, lbox->GetString(n), rect, flags); - } - - rect.y += lineHeight; - } -} - -#endif // wxUSE_LISTBOX - -#if wxUSE_CHECKLISTBOX - -void wxControlRenderer::DrawCheckItems(const wxCheckListBox *lbox, - size_t itemFirst, size_t itemLast) -{ - DoDrawItems(lbox, itemFirst, itemLast, true); -} - -#endif // wxUSE_CHECKLISTBOX - -#if wxUSE_GAUGE - -void wxControlRenderer::DrawProgressBar(const wxGauge *gauge) -{ - // draw background - m_dc.SetBrush(wxBrush(m_window->GetBackgroundColour(), wxSOLID)); - m_dc.SetPen(*wxTRANSPARENT_PEN); - m_dc.DrawRectangle(m_rect); - - int max = gauge->GetRange(); - if ( !max ) - { - // nothing to draw - return; - } - - // calc the filled rect - int pos = gauge->GetValue(); - int left = max - pos; - - wxRect rect = m_rect; - rect.Deflate(1); // FIXME this depends on the border width - - wxColour col = m_window->UseFgCol() ? m_window->GetForegroundColour() - : wxTHEME_COLOUR(GAUGE); - m_dc.SetBrush(wxBrush(col, wxSOLID)); - - if ( gauge->IsSmooth() ) - { - // just draw the rectangle in one go - if ( gauge->IsVertical() ) - { - // vert bars grow from bottom to top - wxCoord dy = ((rect.height - 1) * left) / max; - rect.y += dy; - rect.height -= dy; - } - else // horizontal - { - // grow from left to right - rect.width -= ((rect.width - 1) * left) / max; - } - - m_dc.DrawRectangle(rect); - } - else // discrete - { - wxSize sizeStep = m_renderer->GetProgressBarStep(); - int step = gauge->IsVertical() ? sizeStep.y : sizeStep.x; - - // we divide by it below! - wxCHECK_RET( step, _T("invalid wxGauge step") ); - - // round up to make the progress appear to start faster - int lenTotal = gauge->IsVertical() ? rect.height : rect.width; - int steps = ((lenTotal + step - 1) * pos) / (max * step); - - // calc the coords of one small rect - wxCoord *px; - wxCoord dx, dy; - if ( gauge->IsVertical() ) - { - // draw from bottom to top: so first set y to the bottom - rect.y += rect.height - 1; - - // then adjust the height - rect.height = step; - - // and then adjust y again to be what it should for the first rect - rect.y -= rect.height; - - // we are going up - step = -step; - - // remember that this will be the coord which will change - px = &rect.y; - - dy = 1; - dx = 0; - } - else // horizontal - { - // don't leave 2 empty pixels in the beginning - rect.x--; - - px = &rect.x; - rect.width = step; - - dy = 0; - dx = 1; - } - - for ( int n = 0; n < steps; n++ ) - { - wxRect rectSegment = rect; - rectSegment.Deflate(dx, dy); - - m_dc.DrawRectangle(rectSegment); - - *px += step; - if ( *px < 1 ) - { - // this can only happen for the last step of vertical gauge - rect.height = *px - step - 1; - *px = 1; - } - else if ( *px > lenTotal - step ) - { - // this can only happen for the last step of horizontal gauge - rect.width = lenTotal - *px - 1; - } - } - } -} - -#endif // wxUSE_GAUGE diff --git a/wxWidgets/src/univ/descrip.mms b/wxWidgets/src/univ/descrip.mms deleted file mode 100644 index 0f84915c9a..0000000000 --- a/wxWidgets/src/univ/descrip.mms +++ /dev/null @@ -1,150 +0,0 @@ -#***************************************************************************** -# * -# Make file for VMS * -# Author : J.Jansen (joukj@hrem.nano.tudelft.nl) * -# Date : 22 September 2006 * -# * -#***************************************************************************** -.first - define wx [--.include.wx] - -CXX_DEFINE = /define=(__WXX11__=1,__WXUNIVERSAL__==1)/float=ieee\ - /name=(as_is,short)/assume=(nostdnew,noglobal_array_new) -CC_DEFINE = /define=(__WXX11__=1,__WXUNIVERSAL__==1)/float=ieee\ - /name=(as_is,short) - -.suffixes : .cpp - -.cpp.obj : - cxx $(CXXFLAGS)$(CXX_DEFINE) $(MMS$TARGET_NAME).cpp -.c.obj : - cc $(CFLAGS)$(CC_DEFINE) $(MMS$TARGET_NAME).c - -OBJECTS = \ - bmpbuttn.obj,\ - button.obj,\ - checkbox.obj,\ - checklst.obj,\ - choice.obj,\ - colschem.obj,\ - control.obj,\ - dialog.obj,\ - framuniv.obj,\ - gauge.obj,\ - inpcons.obj,\ - inphand.obj,\ - listbox.obj,\ - menu.obj,\ - notebook.obj,\ - radiobut.obj,\ - scrarrow.obj,\ - scrolbar.obj,\ - scrthumb.obj,\ - slider.obj,\ - spinbutt.obj,\ - statbmp.obj,\ - statbox.obj,\ - statline.obj,\ - stattext.obj,\ - statusbr.obj,\ - stdrend.obj,\ - textctrl.obj,\ - theme.obj,\ - toolbar.obj,\ - topluniv.obj,\ - winuniv.obj,\ - combobox.obj,\ - ctrlrend.obj,\ - gtk.obj,\ - metal.obj,\ - radiobox.obj,\ - scrthumb.obj,\ - win32.obj - -SOURCES =\ - bmpbuttn.cpp \ - button.cpp \ - checkbox.cpp \ - checklst.cpp \ - choice.cpp \ - colschem.cpp \ - control.cpp \ - dialog.cpp \ - framuniv.cpp \ - gauge.cpp \ - inpcons.cpp \ - inphand.cpp \ - listbox.cpp \ - menu.cpp \ - notebook.cpp \ - radiobut.cpp \ - scrarrow.cpp \ - scrolbar.cpp \ - scrthumb.cpp \ - slider.cpp \ - spinbutt.cpp \ - statbmp.cpp \ - statbox.cpp \ - statline.cpp \ - stattext.cpp \ - statusbr.cpp \ - stdrend.cpp,\ - textctrl.cpp \ - theme.cpp \ - toolbar.cpp \ - topluniv.cpp \ - winuniv.cpp \ - combobox.cpp \ - ctrlrend.cpp \ - radiobox.cpp \ - scrthumb.cpp \ - [.themes]gtk.cpp \ - [.themes]metal.cpp \ - [.themes]win32.cpp - -all : $(SOURCES) - $(MMS)$(MMSQUALIFIERS) $(OBJECTS) - library [--.lib]libwx_x11_univ.olb $(OBJECTS) - -bmpbuttn.obj : bmpbuttn.cpp -button.obj : button.cpp -checkbox.obj : checkbox.cpp -checklst.obj : checklst.cpp -choice.obj : choice.cpp -colschem.obj : colschem.cpp -control.obj : control.cpp -dialog.obj : dialog.cpp -framuniv.obj : framuniv.cpp -gauge.obj : gauge.cpp -inpcons.obj : inpcons.cpp -inphand.obj : inphand.cpp -listbox.obj : listbox.cpp -menu.obj : menu.cpp -notebook.obj : notebook.cpp -radiobut.obj : radiobut.cpp -scrarrow.obj : scrarrow.cpp -scrolbar.obj : scrolbar.cpp -scrthumb.obj : scrthumb.cpp -slider.obj : slider.cpp -spinbutt.obj : spinbutt.cpp -statbmp.obj : statbmp.cpp -statbox.obj : statbox.cpp -statline.obj : statline.cpp -stattext.obj : stattext.cpp -statusbr.obj : statusbr.cpp -stdrend.obj : stdrend.cpp -textctrl.obj : textctrl.cpp -theme.obj : theme.cpp -toolbar.obj : toolbar.cpp -topluniv.obj : topluniv.cpp -winuniv.obj : winuniv.cpp -combobox.obj : combobox.cpp -ctrlrend.obj : ctrlrend.cpp -gtk.obj : [.themes]gtk.cpp - cxx $(CXXFLAGS)$(CXX_DEFINE) [.themes]gtk.cpp -metal.obj : [.themes]metal.cpp - cxx $(CXXFLAGS)$(CXX_DEFINE) [.themes]metal.cpp -radiobox.obj : radiobox.cpp -scrthumb.obj : scrthumb.cpp -win32.obj : [.themes]win32.cpp - cxx $(CXXFLAGS)$(CXX_DEFINE) [.themes]win32.cpp diff --git a/wxWidgets/src/univ/dialog.cpp b/wxWidgets/src/univ/dialog.cpp deleted file mode 100644 index c801235575..0000000000 --- a/wxWidgets/src/univ/dialog.cpp +++ /dev/null @@ -1,222 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/univ/dialog.cpp -// Author: Robert Roebling, Vaclav Slavik -// Id: $Id: dialog.cpp 39273 2006-05-22 20:54:04Z ABX $ -// Copyright: (c) 2001 SciTech Software, Inc. (www.scitechsoft.com) -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#include "wx/dialog.h" - -#ifndef WX_PRECOMP - #include "wx/utils.h" - #include "wx/app.h" -#endif - -#include "wx/evtloop.h" - -//----------------------------------------------------------------------------- -// wxDialog -//----------------------------------------------------------------------------- - -BEGIN_EVENT_TABLE(wxDialog,wxDialogBase) - EVT_BUTTON (wxID_OK, wxDialog::OnOK) - EVT_BUTTON (wxID_CANCEL, wxDialog::OnCancel) - EVT_BUTTON (wxID_APPLY, wxDialog::OnApply) - EVT_CLOSE (wxDialog::OnCloseWindow) -END_EVENT_TABLE() - -IMPLEMENT_DYNAMIC_CLASS(wxDialog,wxTopLevelWindow) - -void wxDialog::Init() -{ - m_returnCode = 0; - m_windowDisabler = NULL; - m_eventLoop = NULL; - m_isShowingModal = false; -} - -wxDialog::~wxDialog() -{ - delete m_eventLoop; -} - -bool wxDialog::Create(wxWindow *parent, - wxWindowID id, const wxString &title, - const wxPoint &pos, const wxSize &size, - long style, const wxString &name) -{ - SetExtraStyle(GetExtraStyle() | wxTOPLEVEL_EX_DIALOG); - - // all dialogs should have tab traversal enabled - style |= wxTAB_TRAVERSAL; - - return wxTopLevelWindow::Create(parent, id, title, pos, size, style, name); -} - -void wxDialog::OnApply(wxCommandEvent &WXUNUSED(event)) -{ - if ( Validate() ) - TransferDataFromWindow(); -} - -void wxDialog::OnCancel(wxCommandEvent &WXUNUSED(event)) -{ - if ( IsModal() ) - { - EndModal(wxID_CANCEL); - } - else - { - SetReturnCode(wxID_CANCEL); - Show(false); - } -} - -void wxDialog::OnOK(wxCommandEvent &WXUNUSED(event)) -{ - if ( Validate() && TransferDataFromWindow() ) - { - if ( IsModal() ) - { - EndModal(wxID_OK); - } - else - { - SetReturnCode(wxID_OK); - Show(false); - } - } -} - -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 s_closing; - - if (s_closing.Member(this)) - return; // no loops - - s_closing.Append(this); - - wxCommandEvent cancelEvent(wxEVT_COMMAND_BUTTON_CLICKED, wxID_CANCEL); - cancelEvent.SetEventObject(this); - GetEventHandler()->ProcessEvent(cancelEvent); - s_closing.DeleteObject(this); -} - -bool wxDialog::Show(bool show) -{ - if ( !show ) - { - // if we had disabled other app windows, reenable them back now because - // if they stay disabled Windows will activate another window (one - // which is enabled, anyhow) and we will lose activation - if ( m_windowDisabler ) - { - delete m_windowDisabler; - m_windowDisabler = NULL; - } - - if ( IsModal() ) - EndModal(wxID_CANCEL); - } - - bool ret = wxDialogBase::Show(show); - - if ( show ) - InitDialog(); - - return ret; -} - -bool wxDialog::IsModal() const -{ - return m_isShowingModal; -} - -int wxDialog::ShowModal() -{ - if ( IsModal() ) - { - wxFAIL_MSG( wxT("wxDialog:ShowModal called twice") ); - return GetReturnCode(); - } - - // use the apps top level window as parent if none given unless explicitly - // forbidden - if ( !GetParent() && !(GetWindowStyleFlag() & wxDIALOG_NO_PARENT) ) - { - wxWindow *parent = wxTheApp->GetTopWindow(); - if ( parent && parent != this ) - { - m_parent = parent; - } - } - - Show(true); - - m_isShowingModal = true; - - wxASSERT_MSG( !m_windowDisabler, _T("disabling windows twice?") ); - -#if defined(__WXGTK__) || defined(__WXMGL__) - wxBusyCursorSuspender suspender; - // FIXME (FIXME_MGL) - make sure busy cursor disappears under MSW too -#endif - - m_windowDisabler = new wxWindowDisabler(this); - if ( !m_eventLoop ) - m_eventLoop = new wxEventLoop; - - m_eventLoop->Run(); - - return GetReturnCode(); -} - -void wxDialog::EndModal(int retCode) -{ - wxASSERT_MSG( m_eventLoop, _T("wxDialog is not modal") ); - - SetReturnCode(retCode); - - if ( !IsModal() ) - { - wxFAIL_MSG( wxT("wxDialog:EndModal called twice") ); - return; - } - - m_isShowingModal = false; - - m_eventLoop->Exit(); - - Show(false); -} diff --git a/wxWidgets/src/univ/framuniv.cpp b/wxWidgets/src/univ/framuniv.cpp deleted file mode 100644 index 298e84a814..0000000000 --- a/wxWidgets/src/univ/framuniv.cpp +++ /dev/null @@ -1,328 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: src/univ/frame.cpp -// Purpose: wxFrame class for wxUniversal -// Author: Vadim Zeitlin -// Modified by: -// Created: 19.05.01 -// RCS-ID: $Id: framuniv.cpp 42664 2006-10-29 20:39:31Z VZ $ -// Copyright: (c) 2001 SciTech Software, Inc. (www.scitechsoft.com) -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -// =========================================================================== -// declarations -// =========================================================================== - -// --------------------------------------------------------------------------- -// headers -// --------------------------------------------------------------------------- - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#include "wx/frame.h" - -#ifndef WX_PRECOMP - #include "wx/menu.h" - #include "wx/statusbr.h" - #include "wx/settings.h" - #include "wx/toolbar.h" -#endif // WX_PRECOMP - -// ============================================================================ -// implementation -// ============================================================================ - -BEGIN_EVENT_TABLE(wxFrame, wxFrameBase) - EVT_SIZE(wxFrame::OnSize) - EVT_SYS_COLOUR_CHANGED(wxFrame::OnSysColourChanged) -END_EVENT_TABLE() - -IMPLEMENT_DYNAMIC_CLASS(wxFrame, wxTopLevelWindow) - -// ---------------------------------------------------------------------------- -// ctors -// ---------------------------------------------------------------------------- - -bool wxFrame::Create(wxWindow *parent, - wxWindowID id, - const wxString& title, - const wxPoint& pos, - const wxSize& size, - long style, - const wxString& name) -{ - if ( !wxTopLevelWindow::Create(parent, id, title, pos, size, style, name) ) - return false; - - SetOwnBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_APPWORKSPACE)); - - return true; -} - -// Responds to colour changes, and passes event on to children. -void wxFrame::OnSysColourChanged(wxSysColourChangedEvent& event) -{ - SetOwnBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_APPWORKSPACE)); - Refresh(); - - event.Skip(); -} - -// ---------------------------------------------------------------------------- -// menu support -// ---------------------------------------------------------------------------- - -void wxFrame::OnSize(wxSizeEvent& event) -{ -#if wxUSE_MENUS - PositionMenuBar(); -#endif // wxUSE_MENUS -#if wxUSE_STATUSBAR - PositionStatusBar(); -#endif // wxUSE_STATUSBAR -#if wxUSE_TOOLBAR - PositionToolBar(); -#endif // wxUSE_TOOLBAR - - event.Skip(); -} - -void wxFrame::SendSizeEvent() -{ - wxSizeEvent event(GetSize(), GetId()); - event.SetEventObject(this); - GetEventHandler()->ProcessEvent(event); -} - -#if wxUSE_MENUS - -void wxFrame::PositionMenuBar() -{ - if ( m_frameMenuBar ) - { - // the menubar is positioned above the client size, hence the negative - // y coord - wxCoord heightMbar = m_frameMenuBar->GetSize().y; - - wxCoord heightTbar = 0; - -#if wxUSE_TOOLBAR - if ( m_frameToolBar ) - heightTbar = m_frameToolBar->GetSize().y; -#endif // wxUSE_TOOLBAR - - m_frameMenuBar->SetSize(0, -#ifdef __WXPM__ // FIXME -- remove this, make wxOS2/Univ behave as - // the rest of the world!!! - GetClientSize().y - heightMbar - heightTbar, -#else - - (heightMbar + heightTbar), -#endif - GetClientSize().x, heightMbar); - } -} - -void wxFrame::DetachMenuBar() -{ - wxFrameBase::DetachMenuBar(); - SendSizeEvent(); -} - -void wxFrame::AttachMenuBar(wxMenuBar *menubar) -{ - wxFrameBase::AttachMenuBar(menubar); - SendSizeEvent(); -} - -#endif // wxUSE_MENUS - -#if wxUSE_STATUSBAR - -void wxFrame::PositionStatusBar() -{ - if ( m_frameStatusBar ) - { - wxSize size = GetClientSize(); - m_frameStatusBar->SetSize(0, size.y, size.x, wxDefaultCoord); - } -} - -wxStatusBar* wxFrame::CreateStatusBar(int number, long style, - wxWindowID id, const wxString& name) -{ - wxStatusBar *bar = wxFrameBase::CreateStatusBar(number, style, id, name); - SendSizeEvent(); - return bar; -} - -#endif // wxUSE_STATUSBAR - -#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() -{ - if ( m_frameToolBar ) - { - wxSize size = GetClientSize(); - int tw, th, tx, ty; - - tx = ty = 0; - m_frameToolBar->GetSize(&tw, &th); - if ( m_frameToolBar->GetWindowStyleFlag() & wxTB_VERTICAL ) - { - tx = -tw; - th = size.y; - } - else - { - ty = -th; - tw = size.x; - } - - m_frameToolBar->SetSize(tx, ty, tw, th); - } -} -#endif // wxUSE_TOOLBAR - -wxPoint wxFrame::GetClientAreaOrigin() const -{ - wxPoint pt = wxFrameBase::GetClientAreaOrigin(); - -#if wxUSE_MENUS && !defined(__WXPM__) - if ( m_frameMenuBar ) - { - pt.y += m_frameMenuBar->GetSize().y; - } -#endif // wxUSE_MENUS - -#if wxUSE_TOOLBAR - if ( m_frameToolBar ) - { - if ( m_frameToolBar->GetWindowStyleFlag() & wxTB_VERTICAL ) - pt.x += m_frameToolBar->GetSize().x; - else - pt.y += m_frameToolBar->GetSize().y; - } -#endif // wxUSE_TOOLBAR - - return pt; -} - -void wxFrame::DoGetClientSize(int *width, int *height) const -{ - wxFrameBase::DoGetClientSize(width, height); - -#if wxUSE_MENUS - if ( m_frameMenuBar && height ) - { - (*height) -= m_frameMenuBar->GetSize().y; - } -#endif // wxUSE_MENUS - -#if wxUSE_STATUSBAR - if ( m_frameStatusBar && height ) - { - (*height) -= m_frameStatusBar->GetSize().y; - } -#endif // wxUSE_STATUSBAR - -#if wxUSE_TOOLBAR - if ( m_frameToolBar ) - { - if ( width && (m_frameToolBar->GetWindowStyleFlag() & wxTB_VERTICAL) ) - (*width) -= m_frameToolBar->GetSize().x; - else if ( height ) - (*height) -= m_frameToolBar->GetSize().y; - } -#endif // wxUSE_TOOLBAR -} - -void wxFrame::DoSetClientSize(int width, int height) -{ -#if wxUSE_MENUS - if ( m_frameMenuBar ) - { - height += m_frameMenuBar->GetSize().y; - } -#endif // wxUSE_MENUS - -#if wxUSE_STATUSBAR - if ( m_frameStatusBar ) - { - height += m_frameStatusBar->GetSize().y; - } -#endif // wxUSE_STATUSBAR - -#if wxUSE_TOOLBAR - if ( m_frameToolBar ) - { -#if wxUSE_STATUSBAR - height += m_frameStatusBar->GetSize().y; -#endif // wxUSE_STATUSBAR - - if ( m_frameToolBar->GetWindowStyleFlag() & wxTB_VERTICAL ) - width += m_frameToolBar->GetSize().x; - else - height += m_frameToolBar->GetSize().y; - } -#endif // wxUSE_TOOLBAR - - wxFrameBase::DoSetClientSize(width, height); -} - -wxSize wxFrame::GetMinSize() const -{ - wxSize size = wxFrameBase::GetMinSize(); - -#if wxUSE_MENUS - if ( m_frameMenuBar ) - { - const wxSize sizeMenu = m_frameMenuBar->GetBestSize(); - if ( sizeMenu.x > size.x ) - size.x = sizeMenu.x; - size.y += sizeMenu.y; - } -#endif // wxUSE_MENUS - -#if wxUSE_TOOLBAR - if ( m_frameToolBar ) - { - size.y += m_frameToolBar->GetSize().y; - } -#endif // wxUSE_TOOLBAR - -#if wxUSE_STATUSBAR - if ( m_frameStatusBar ) - { - size.y += m_frameStatusBar->GetSize().y; - } -#endif // wxUSE_STATUSBAR - - return size; -} - -bool wxFrame::Enable(bool enable) -{ - if (!wxFrameBase::Enable(enable)) - return false; -#ifdef __WXMICROWIN__ - if (m_frameMenuBar) - m_frameMenuBar->Enable(enable); -#endif - return true; -} diff --git a/wxWidgets/src/univ/gauge.cpp b/wxWidgets/src/univ/gauge.cpp deleted file mode 100644 index 6ad4baceaf..0000000000 --- a/wxWidgets/src/univ/gauge.cpp +++ /dev/null @@ -1,128 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: src/gauge/gaugecmn.cpp -// Purpose: wxGauge for wxUniversal -// Author: Vadim Zeitlin -// Modified by: -// Created: 20.02.01 -// RCS-ID: $Id: gauge.cpp 42816 2006-10-31 08:50:17Z RD $ -// Copyright: (c) 2001 SciTech Software, Inc. (www.scitechsoft.com) -// License: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_GAUGE - -#include "wx/gauge.h" - -#ifndef WX_PRECOMP -#endif //WX_PRECOMP - -#include "wx/univ/renderer.h" - -IMPLEMENT_DYNAMIC_CLASS(wxGauge, wxControl) - -// ============================================================================ -// implementation -// ============================================================================ - -// ---------------------------------------------------------------------------- -// wxGauge creation -// ---------------------------------------------------------------------------- - -void wxGauge::Init() -{ - m_gaugePos = - m_rangeMax = 0; -} - -bool wxGauge::Create(wxWindow *parent, - wxWindowID id, - int range, - const wxPoint& pos, - const wxSize& size, - long style, - const wxValidator& validator, - const wxString& name) -{ - if ( !wxGaugeBase::Create(parent, id, range, pos, size, style, - validator, name) ) - { - return false; - } - - SetInitialSize(size); - - return true; -} - -// ---------------------------------------------------------------------------- -// wxGauge range/position -// ---------------------------------------------------------------------------- - -void wxGauge::SetRange(int range) -{ - wxGaugeBase::SetRange(range); - - Refresh(); -} - -void wxGauge::SetValue(int pos) -{ - wxGaugeBase::SetValue(pos); - - Refresh(); -} - -// ---------------------------------------------------------------------------- -// wxGauge geometry -// ---------------------------------------------------------------------------- - -wxSize wxGauge::DoGetBestClientSize() const -{ - wxSize size = GetRenderer()->GetProgressBarStep(); - - // these adjustments are really ridiculous - they are just done to find the - // "correct" result under Windows (FIXME) - if ( IsVertical() ) - { - size.x = (3*size.y) / 2 + 2; - size.y = wxDefaultCoord; - } - else - { - size.y = (3*size.x) / 2 + 2; - size.x = wxDefaultCoord; - } - - return size; -} - -// ---------------------------------------------------------------------------- -// wxGauge drawing -// ---------------------------------------------------------------------------- - -wxBorder wxGauge::GetDefaultBorder() const -{ - return wxBORDER_STATIC; -} - -void wxGauge::DoDraw(wxControlRenderer *renderer) -{ - renderer->DrawProgressBar(this); -} - -#endif // wxUSE_GAUGE diff --git a/wxWidgets/src/univ/inpcons.cpp b/wxWidgets/src/univ/inpcons.cpp deleted file mode 100644 index 3e1e4961ee..0000000000 --- a/wxWidgets/src/univ/inpcons.cpp +++ /dev/null @@ -1,114 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/univ/inpcons.cpp -// Purpose: wxInputConsumer: mix-in class for input handling -// Author: Vadim Zeitlin -// Modified by: -// Created: 14.08.00 -// RCS-ID: $Id: inpcons.cpp 42732 2006-10-30 17:05:42Z ABX $ -// Copyright: (c) 2000 SciTech Software, Inc. (www.scitechsoft.com) -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#ifndef WX_PRECOMP - #include "wx/window.h" -#endif // WX_PRECOMP - -#include "wx/univ/renderer.h" -#include "wx/univ/inphand.h" -#include "wx/univ/theme.h" - -// ============================================================================ -// implementation -// ============================================================================ - -// ---------------------------------------------------------------------------- -// focus/activation handling -// ---------------------------------------------------------------------------- - -void wxInputConsumer::OnFocus(wxFocusEvent& event) -{ - if ( m_inputHandler && m_inputHandler->HandleFocus(this, event) ) - GetInputWindow()->Refresh(); - else - event.Skip(); -} - -void wxInputConsumer::OnActivate(wxActivateEvent& event) -{ - if ( m_inputHandler && m_inputHandler->HandleActivation(this, event.GetActive()) ) - GetInputWindow()->Refresh(); - else - event.Skip(); -} - -// ---------------------------------------------------------------------------- -// input processing -// ---------------------------------------------------------------------------- - -wxInputHandler * -wxInputConsumer::DoGetStdInputHandler(wxInputHandler * WXUNUSED(handlerDef)) -{ - return NULL; -} - -void wxInputConsumer::CreateInputHandler(const wxString& inphandler) -{ - m_inputHandler = wxTheme::Get()->GetInputHandler(inphandler, this); -} - -void wxInputConsumer::OnKeyDown(wxKeyEvent& event) -{ - if ( !m_inputHandler || !m_inputHandler->HandleKey(this, event, true) ) - event.Skip(); -} - -void wxInputConsumer::OnKeyUp(wxKeyEvent& event) -{ - if ( !m_inputHandler || !m_inputHandler->HandleKey(this, event, false) ) - event.Skip(); -} - -void wxInputConsumer::OnMouse(wxMouseEvent& event) -{ - if ( m_inputHandler ) - { - if ( event.Moving() || event.Dragging() || - event.Entering() || event.Leaving() ) - { - if ( m_inputHandler->HandleMouseMove(this, event) ) - return; - } - else // a click action - { - if ( m_inputHandler->HandleMouse(this, event) ) - return; - } - } - - event.Skip(); -} - -// ---------------------------------------------------------------------------- -// the actions -// ---------------------------------------------------------------------------- - -bool wxInputConsumer::PerformAction(const wxControlAction& WXUNUSED(action), - long WXUNUSED(numArg), - const wxString& WXUNUSED(strArg)) -{ - return false; -} diff --git a/wxWidgets/src/univ/inphand.cpp b/wxWidgets/src/univ/inphand.cpp deleted file mode 100644 index a37b5e0316..0000000000 --- a/wxWidgets/src/univ/inphand.cpp +++ /dev/null @@ -1,61 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: univ/inphand.cpp -// Purpose: (trivial) wxInputHandler implementation -// Author: Vadim Zeitlin -// Modified by: -// Created: 18.08.00 -// RCS-ID: $Id: inphand.cpp 35650 2005-09-23 12:56:45Z MR $ -// Copyright: (c) 2000 SciTech Software, Inc. (www.scitechsoft.com) -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -// =========================================================================== -// declarations -// =========================================================================== - -// --------------------------------------------------------------------------- -// headers -// --------------------------------------------------------------------------- - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#ifndef WX_PRECOMP -#endif // WX_PRECOMP - -#include "wx/univ/inphand.h" - -// ============================================================================ -// implementation -// ============================================================================ - -// ---------------------------------------------------------------------------- -// wxInputHandler -// ---------------------------------------------------------------------------- - -bool wxInputHandler::HandleMouseMove(wxInputConsumer * WXUNUSED(consumer), - const wxMouseEvent& WXUNUSED(event)) -{ - return false; -} - -bool wxInputHandler::HandleFocus(wxInputConsumer *WXUNUSED(consumer), - const wxFocusEvent& WXUNUSED(event)) -{ - return false; -} - -bool wxInputHandler::HandleActivation(wxInputConsumer *WXUNUSED(consumer), - bool WXUNUSED(activated)) -{ - return false; -} - -wxInputHandler::~wxInputHandler() -{ -} - diff --git a/wxWidgets/src/univ/listbox.cpp b/wxWidgets/src/univ/listbox.cpp deleted file mode 100644 index 64fc3b6a56..0000000000 --- a/wxWidgets/src/univ/listbox.cpp +++ /dev/null @@ -1,1579 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/univ/listbox.cpp -// Purpose: wxListBox implementation -// Author: Vadim Zeitlin -// Modified by: -// Created: 30.08.00 -// RCS-ID: $Id: listbox.cpp 42816 2006-10-31 08:50:17Z RD $ -// Copyright: (c) 2000 SciTech Software, Inc. (www.scitechsoft.com) -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_LISTBOX - -#ifndef WX_PRECOMP - #include "wx/log.h" - - #include "wx/dcclient.h" - #include "wx/listbox.h" - #include "wx/validate.h" -#endif - -#include "wx/univ/renderer.h" -#include "wx/univ/inphand.h" -#include "wx/univ/theme.h" - -// ---------------------------------------------------------------------------- -// wxStdListboxInputHandler: handles mouse and kbd in a single or multi -// selection listbox -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxStdListboxInputHandler : public wxStdInputHandler -{ -public: - // if pressing the mouse button in a multiselection listbox should toggle - // the item under mouse immediately, then specify true as the second - // parameter (this is the standard behaviour, under GTK the item is toggled - // only when the mouse is released in the multi selection listbox) - wxStdListboxInputHandler(wxInputHandler *inphand, - bool toggleOnPressAlways = true); - - // base class methods - virtual bool HandleKey(wxInputConsumer *consumer, - const wxKeyEvent& event, - bool pressed); - virtual bool HandleMouse(wxInputConsumer *consumer, - const wxMouseEvent& event); - virtual bool HandleMouseMove(wxInputConsumer *consumer, - const wxMouseEvent& event); - -protected: - // return the item under mouse, 0 if the mouse is above the listbox or - // GetCount() if it is below it - int HitTest(const wxListBox *listbox, const wxMouseEvent& event); - - // parts of HitTest(): first finds the pseudo (because not in range) index - // of the item and the second one adjusts it if necessary - that is if the - // third one returns false - int HitTestUnsafe(const wxListBox *listbox, const wxMouseEvent& event); - int FixItemIndex(const wxListBox *listbox, int item); - bool IsValidIndex(const wxListBox *listbox, int item); - - // init m_btnCapture and m_actionMouse - wxControlAction SetupCapture(wxListBox *lbox, - const wxMouseEvent& event, - int item); - - wxRenderer *m_renderer; - - // the button which initiated the mouse capture (currently 0 or 1) - int m_btnCapture; - - // the action to perform when the mouse moves while we capture it - wxControlAction m_actionMouse; - - // the ctor parameter toggleOnPressAlways (see comments near it) - bool m_toggleOnPressAlways; - - // do we track the mouse outside the window when it is captured? - bool m_trackMouseOutside; -}; - -// ============================================================================ -// implementation of wxListBox -// ============================================================================ - -IMPLEMENT_DYNAMIC_CLASS(wxListBox, wxControl) - -BEGIN_EVENT_TABLE(wxListBox, wxListBoxBase) - EVT_SIZE(wxListBox::OnSize) -END_EVENT_TABLE() - -// ---------------------------------------------------------------------------- -// construction -// ---------------------------------------------------------------------------- - -void wxListBox::Init() -{ - // will be calculated later when needed - m_lineHeight = 0; - m_itemsPerPage = 0; - m_maxWidth = 0; - m_scrollRangeY = 0; - m_maxWidthItem = -1; - m_strings = NULL; - - // no items hence no current item - m_current = -1; - m_selAnchor = -1; - m_currentChanged = false; - - // no need to update anything initially - m_updateCount = 0; - - // no scrollbars to show nor update - m_updateScrollbarX = - m_showScrollbarX = - m_updateScrollbarY = - m_showScrollbarY = false; -} - -wxListBox::wxListBox(wxWindow *parent, - wxWindowID id, - const wxPoint &pos, - const wxSize &size, - const wxArrayString& choices, - long style, - const wxValidator& validator, - const wxString &name) - :wxScrollHelper(this) -{ - Init(); - - Create(parent, id, pos, size, choices, style, validator, name); -} - -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) -{ - // for compatibility accept both the new and old styles - they mean the - // same thing for us - if ( style & wxLB_ALWAYS_SB ) - style |= wxALWAYS_SHOW_SB; - - // if we don't have neither multiple nor extended flag, we must have the - // single selection listbox - if ( !(style & (wxLB_MULTIPLE | wxLB_EXTENDED)) ) - style |= wxLB_SINGLE; - -#if wxUSE_TWO_WINDOWS - style |= wxVSCROLL|wxHSCROLL; - if ((style & wxBORDER_MASK) == 0) - style |= wxBORDER_SUNKEN; -#endif - - if ( !wxControl::Create(parent, id, pos, size, style, - validator, name) ) - return false; - - m_strings = new wxArrayString; - - Set(n, choices); - - SetInitialSize(size); - - CreateInputHandler(wxINP_HANDLER_LISTBOX); - - return true; -} - -wxListBox::~wxListBox() -{ - // call this just to free the client data -- and avoid leaking memory - DoClear(); - - delete m_strings; - - m_strings = NULL; -} - -// ---------------------------------------------------------------------------- -// adding/inserting strings -// ---------------------------------------------------------------------------- - -int wxCMPFUNC_CONV wxListBoxSortNoCase(wxString* s1, wxString* s2) -{ - return s1->CmpNoCase(*s2); -} - -int wxListBox::DoAppendOnly(const wxString& item) -{ - unsigned int index; - - if ( IsSorted() ) - { - m_strings->Add(item); - m_strings->Sort(wxListBoxSortNoCase); - index = m_strings->Index(item); - } - else - { - index = m_strings->GetCount(); - m_strings->Add(item); - } - - return index; -} - -int wxListBox::DoAppend(const wxString& item) -{ - size_t index = DoAppendOnly( item ); - - m_itemsClientData.Insert(NULL, index); - - m_updateScrollbarY = true; - - if ( HasHorzScrollbar() ) - { - // has the max width increased? - wxCoord width; - GetTextExtent(item, &width, NULL); - if ( width > m_maxWidth ) - { - m_maxWidth = width; - m_maxWidthItem = index; - m_updateScrollbarX = true; - } - } - - RefreshFromItemToEnd(index); - - return index; -} - -void wxListBox::DoInsertItems(const wxArrayString& items, unsigned int pos) -{ - // the position of the item being added to a sorted listbox can't be - // specified - wxCHECK_RET( !IsSorted(), _T("can't insert items into sorted listbox") ); - - unsigned int count = items.GetCount(); - for ( unsigned int n = 0; n < count; n++ ) - { - m_strings->Insert(items[n], pos + n); - m_itemsClientData.Insert(NULL, pos + n); - } - - // the number of items has changed so we might have to show the scrollbar - m_updateScrollbarY = true; - - // the max width also might have changed - just recalculate it instead of - // keeping track of it here, this is probably more efficient for a typical - // use pattern - RefreshHorzScrollbar(); - - // note that we have to refresh all the items after the ones we inserted, - // not just these items - RefreshFromItemToEnd(pos); -} - -void wxListBox::DoSetItems(const wxArrayString& items, void **clientData) -{ - DoClear(); - - unsigned int count = items.GetCount(); - if ( !count ) - return; - - m_strings->Alloc(count); - - m_itemsClientData.Alloc(count); - for ( unsigned int n = 0; n < count; n++ ) - { - unsigned int index = DoAppendOnly(items[n]); - - m_itemsClientData.Insert(clientData ? clientData[n] : NULL, index); - } - - m_updateScrollbarY = true; - - RefreshAll(); -} - -void wxListBox::SetString(unsigned int n, const wxString& s) -{ - wxCHECK_RET( !IsSorted(), _T("can't set string in sorted listbox") ); - - (*m_strings)[n] = s; - - if ( HasHorzScrollbar() ) - { - // we need to update m_maxWidth as changing the string may cause the - // horz scrollbar [dis]appear - wxCoord width; - - GetTextExtent(s, &width, NULL); - - // it might have increased if the new string is long - if ( width > m_maxWidth ) - { - m_maxWidth = width; - m_maxWidthItem = n; - m_updateScrollbarX = true; - } - // or also decreased if the old string was the longest one - else if ( n == (unsigned int)m_maxWidthItem ) - { - RefreshHorzScrollbar(); - } - } - - RefreshItem(n); -} - -// ---------------------------------------------------------------------------- -// removing strings -// ---------------------------------------------------------------------------- - -void wxListBox::DoClear() -{ - m_strings->Clear(); - - if ( HasClientObjectData() ) - { - unsigned int count = m_itemsClientData.GetCount(); - for ( unsigned int n = 0; n < count; n++ ) - { - delete (wxClientData *) m_itemsClientData[n]; - } - } - - m_itemsClientData.Clear(); - m_selections.Clear(); - - m_current = -1; -} - -void wxListBox::Clear() -{ - DoClear(); - - m_updateScrollbarY = true; - - RefreshHorzScrollbar(); - - RefreshAll(); -} - -void wxListBox::Delete(unsigned int n) -{ - wxCHECK_RET( IsValid(n), - _T("invalid index in wxListBox::Delete") ); - - // do it before removing the index as otherwise the last item will not be - // refreshed (as GetCount() will be decremented) - RefreshFromItemToEnd(n); - - m_strings->RemoveAt(n); - - if ( HasClientObjectData() ) - { - delete (wxClientData *)m_itemsClientData[n]; - } - - m_itemsClientData.RemoveAt(n); - - // when the item disappears we must not keep using its index - if ( (int)n == m_current ) - { - m_current = -1; - } - else if ( (int)n < m_current ) - { - m_current--; - } - //else: current item may stay - - // update the selections array: the indices of all seletected items after - // the one being deleted must change and the item itselfm ust be removed - int index = wxNOT_FOUND; - unsigned int count = m_selections.GetCount(); - for ( unsigned int item = 0; item < count; item++ ) - { - if ( m_selections[item] == (int)n ) - { - // remember to delete it later - index = item; - } - else if ( m_selections[item] > (int)n ) - { - // to account for the index shift - m_selections[item]--; - } - //else: nothing changed for this one - } - - if ( index != wxNOT_FOUND ) - { - m_selections.RemoveAt(index); - } - - // the number of items has changed, hence the scrollbar may disappear - m_updateScrollbarY = true; - - // finally, if the longest item was deleted the scrollbar may disappear - if ( (int)n == m_maxWidthItem ) - { - RefreshHorzScrollbar(); - } -} - -// ---------------------------------------------------------------------------- -// client data handling -// ---------------------------------------------------------------------------- - -void wxListBox::DoSetItemClientData(unsigned int n, void* clientData) -{ - m_itemsClientData[n] = clientData; -} - -void *wxListBox::DoGetItemClientData(unsigned int n) const -{ - return m_itemsClientData[n]; -} - -void wxListBox::DoSetItemClientObject(unsigned int n, wxClientData* clientData) -{ - m_itemsClientData[n] = clientData; -} - -wxClientData* wxListBox::DoGetItemClientObject(unsigned int n) const -{ - return (wxClientData *)m_itemsClientData[n]; -} - -// ---------------------------------------------------------------------------- -// selection -// ---------------------------------------------------------------------------- - -void wxListBox::DoSetSelection(int n, bool select) -{ - if ( select ) - { - if ( n == wxNOT_FOUND ) - { - if ( !HasMultipleSelection() ) - { - // selecting wxNOT_FOUND is documented to deselect all items - DeselectAll(); - return; - } - } - else if ( m_selections.Index(n) == wxNOT_FOUND ) - { - if ( !HasMultipleSelection() ) - { - // selecting an item in a single selection listbox deselects - // all the others - DeselectAll(); - } - - m_selections.Add(n); - - RefreshItem(n); - } - //else: already selected - } - else // unselect - { - int index = m_selections.Index(n); - if ( index != wxNOT_FOUND ) - { - m_selections.RemoveAt(index); - - RefreshItem(n); - } - //else: not selected - } - - // sanity check: a single selection listbox can't have more than one item - // selected - wxASSERT_MSG( HasMultipleSelection() || (m_selections.GetCount() < 2), - _T("multiple selected items in single selection lbox?") ); - - if ( select ) - { - // the newly selected item becomes the current one - SetCurrentItem(n); - } -} - -int wxListBox::GetSelection() const -{ - wxCHECK_MSG( !HasMultipleSelection(), wxNOT_FOUND, - _T("use wxListBox::GetSelections for ths listbox") ); - - return m_selections.IsEmpty() ? wxNOT_FOUND : m_selections[0]; -} - -int wxCMPFUNC_CONV wxCompareInts(int *n, int *m) -{ - return *n - *m; -} - -int wxListBox::GetSelections(wxArrayInt& selections) const -{ - // always return sorted array to the user - selections = m_selections; - unsigned int count = m_selections.GetCount(); - - // don't call sort on an empty array - if ( count ) - { - selections.Sort(wxCompareInts); - } - - return count; -} - -// ---------------------------------------------------------------------------- -// refresh logic: we use delayed refreshing which allows to avoid multiple -// refreshes (and hence flicker) in case when several listbox items are -// added/deleted/changed subsequently -// ---------------------------------------------------------------------------- - -void wxListBox::RefreshFromItemToEnd(int from) -{ - RefreshItems(from, GetCount() - from); -} - -void wxListBox::RefreshItems(int from, int count) -{ - switch ( m_updateCount ) - { - case 0: - m_updateFrom = from; - m_updateCount = count; - break; - - case -1: - // we refresh everything anyhow - break; - - default: - // add these items to the others which we have to refresh - if ( m_updateFrom < from ) - { - count += from - m_updateFrom; - if ( m_updateCount < count ) - m_updateCount = count; - } - else // m_updateFrom >= from - { - int updateLast = wxMax(m_updateFrom + m_updateCount, - from + count); - m_updateFrom = from; - m_updateCount = updateLast - m_updateFrom; - } - } -} - -void wxListBox::RefreshItem(int n) -{ - switch ( m_updateCount ) - { - case 0: - // refresh this item only - m_updateFrom = n; - m_updateCount = 1; - break; - - case -1: - // we refresh everything anyhow - break; - - default: - // add this item to the others which we have to refresh - if ( m_updateFrom < n ) - { - if ( m_updateCount < n - m_updateFrom + 1 ) - m_updateCount = n - m_updateFrom + 1; - } - else // n <= m_updateFrom - { - m_updateCount += m_updateFrom - n; - m_updateFrom = n; - } - } -} - -void wxListBox::RefreshAll() -{ - m_updateCount = -1; -} - -void wxListBox::RefreshHorzScrollbar() -{ - m_maxWidth = 0; // recalculate it - m_updateScrollbarX = true; -} - -void wxListBox::UpdateScrollbars() -{ - wxSize size = GetClientSize(); - - // is our height enough to show all items? - unsigned int nLines = GetCount(); - wxCoord lineHeight = GetLineHeight(); - bool showScrollbarY = (int)nLines*lineHeight > size.y; - - // check the width too if required - wxCoord charWidth, maxWidth; - bool showScrollbarX; - if ( HasHorzScrollbar() ) - { - charWidth = GetCharWidth(); - maxWidth = GetMaxWidth(); - showScrollbarX = maxWidth > size.x; - } - else // never show it - { - charWidth = maxWidth = 0; - showScrollbarX = false; - } - - // what should be the scrollbar range now? - int scrollRangeX = showScrollbarX - ? (maxWidth + charWidth - 1) / charWidth + 2 // FIXME - : 0; - int scrollRangeY = showScrollbarY - ? nLines + - (size.y % lineHeight + lineHeight - 1) / lineHeight - : 0; - - // reset scrollbars if something changed: either the visibility status - // or the range of a scrollbar which is shown - if ( (showScrollbarY != m_showScrollbarY) || - (showScrollbarX != m_showScrollbarX) || - (showScrollbarY && (scrollRangeY != m_scrollRangeY)) || - (showScrollbarX && (scrollRangeX != m_scrollRangeX)) ) - { - int x, y; - GetViewStart(&x, &y); - SetScrollbars(charWidth, lineHeight, - scrollRangeX, scrollRangeY, - x, y); - - m_showScrollbarX = showScrollbarX; - m_showScrollbarY = showScrollbarY; - - m_scrollRangeX = scrollRangeX; - m_scrollRangeY = scrollRangeY; - } -} - -void wxListBox::UpdateItems() -{ - // only refresh the items which must be refreshed - if ( m_updateCount == -1 ) - { - // refresh all - wxLogTrace(_T("listbox"), _T("Refreshing all")); - - Refresh(); - } - else - { - wxSize size = GetClientSize(); - wxRect rect; - rect.width = size.x; - rect.height = size.y; - rect.y += m_updateFrom*GetLineHeight(); - rect.height = m_updateCount*GetLineHeight(); - - // we don't need to calculate x position as we always refresh the - // entire line(s) - CalcScrolledPosition(0, rect.y, NULL, &rect.y); - - wxLogTrace(_T("listbox"), _T("Refreshing items %d..%d (%d-%d)"), - m_updateFrom, m_updateFrom + m_updateCount - 1, - rect.GetTop(), rect.GetBottom()); - - Refresh(true, &rect); - } -} - -void wxListBox::OnInternalIdle() -{ - if ( m_updateScrollbarY || m_updateScrollbarX ) - { - UpdateScrollbars(); - - m_updateScrollbarX = - m_updateScrollbarY = false; - } - - if ( m_currentChanged ) - { - DoEnsureVisible(m_current); - - m_currentChanged = false; - } - - if ( m_updateCount ) - { - UpdateItems(); - - m_updateCount = 0; - } - wxListBoxBase::OnInternalIdle(); -} - -// ---------------------------------------------------------------------------- -// drawing -// ---------------------------------------------------------------------------- - -wxBorder wxListBox::GetDefaultBorder() const -{ - return wxBORDER_SUNKEN; -} - -void wxListBox::DoDraw(wxControlRenderer *renderer) -{ - // adjust the DC to account for scrolling - wxDC& dc = renderer->GetDC(); - PrepareDC(dc); - dc.SetFont(GetFont()); - - // get the update rect - wxRect rectUpdate = GetUpdateClientRect(); - - int yTop, yBottom; - CalcUnscrolledPosition(0, rectUpdate.GetTop(), NULL, &yTop); - CalcUnscrolledPosition(0, rectUpdate.GetBottom(), NULL, &yBottom); - - // get the items which must be redrawn - wxCoord lineHeight = GetLineHeight(); - unsigned int itemFirst = yTop / lineHeight, - itemLast = (yBottom + lineHeight - 1) / lineHeight, - itemMax = m_strings->GetCount(); - - if ( itemFirst >= itemMax ) - return; - - if ( itemLast > itemMax ) - itemLast = itemMax; - - // do draw them - wxLogTrace(_T("listbox"), _T("Repainting items %d..%d"), - itemFirst, itemLast); - - DoDrawRange(renderer, itemFirst, itemLast); -} - -void wxListBox::DoDrawRange(wxControlRenderer *renderer, - int itemFirst, int itemLast) -{ - renderer->DrawItems(this, itemFirst, itemLast); -} - -// ---------------------------------------------------------------------------- -// size calculations -// ---------------------------------------------------------------------------- - -bool wxListBox::SetFont(const wxFont& font) -{ - if ( !wxControl::SetFont(font) ) - return false; - - CalcItemsPerPage(); - - RefreshAll(); - - return true; -} - -void wxListBox::CalcItemsPerPage() -{ - m_lineHeight = GetRenderer()->GetListboxItemHeight(GetCharHeight()); - m_itemsPerPage = GetClientSize().y / m_lineHeight; -} - -int wxListBox::GetItemsPerPage() const -{ - if ( !m_itemsPerPage ) - { - wxConstCast(this, wxListBox)->CalcItemsPerPage(); - } - - return m_itemsPerPage; -} - -wxCoord wxListBox::GetLineHeight() const -{ - if ( !m_lineHeight ) - { - wxConstCast(this, wxListBox)->CalcItemsPerPage(); - } - - return m_lineHeight; -} - -wxCoord wxListBox::GetMaxWidth() const -{ - if ( m_maxWidth == 0 ) - { - wxListBox *self = wxConstCast(this, wxListBox); - wxCoord width; - unsigned int count = m_strings->GetCount(); - for ( unsigned int n = 0; n < count; n++ ) - { - GetTextExtent(this->GetString(n), &width, NULL); - if ( width > m_maxWidth ) - { - self->m_maxWidth = width; - self->m_maxWidthItem = n; - } - } - } - - return m_maxWidth; -} - -void wxListBox::OnSize(wxSizeEvent& event) -{ - // recalculate the number of items per page - CalcItemsPerPage(); - - // the scrollbars might [dis]appear - m_updateScrollbarX = - m_updateScrollbarY = true; - - event.Skip(); -} - -void wxListBox::DoSetFirstItem(int n) -{ - SetCurrentItem(n); -} - -void wxListBox::DoSetSize(int x, int y, - int width, int height, - int sizeFlags) -{ - if ( GetWindowStyle() & wxLB_INT_HEIGHT ) - { - // we must round up the height to an entire number of rows - - // the client area must contain an int number of rows, so take borders - // into account - wxRect rectBorders = GetRenderer()->GetBorderDimensions(GetBorder()); - wxCoord hBorders = rectBorders.y + rectBorders.height; - - wxCoord hLine = GetLineHeight(); - height = ((height - hBorders + hLine - 1) / hLine)*hLine + hBorders; - } - - wxListBoxBase::DoSetSize(x, y, width, height, sizeFlags); -} - -wxSize wxListBox::DoGetBestClientSize() const -{ - wxCoord width = 0, - height = 0; - - unsigned int count = m_strings->GetCount(); - for ( unsigned int n = 0; n < count; n++ ) - { - wxCoord w,h; - GetTextExtent(this->GetString(n), &w, &h); - - if ( w > width ) - width = w; - if ( h > height ) - height = h; - } - - // if the listbox is empty, still give it some non zero (even if - // arbitrary) size - otherwise, leave small margin around the strings - if ( !width ) - width = 100; - else - width += 3*GetCharWidth(); - - if ( !height ) - height = GetCharHeight(); - - // we need the height of the entire listbox, not just of one line - height *= wxMax(count, 7); - - return wxSize(width, height); -} - -// ---------------------------------------------------------------------------- -// listbox actions -// ---------------------------------------------------------------------------- - -bool wxListBox::SendEvent(wxEventType type, int item) -{ - wxCommandEvent event(type, m_windowId); - event.SetEventObject(this); - - // use the current item by default - if ( item == -1 ) - { - item = m_current; - } - - // client data and string parameters only make sense if we have an item - if ( item != -1 ) - { - if ( HasClientObjectData() ) - event.SetClientObject(GetClientObject(item)); - else if ( HasClientUntypedData() ) - event.SetClientData(GetClientData(item)); - - event.SetString(GetString(item)); - } - - event.SetInt(item); - - return GetEventHandler()->ProcessEvent(event); -} - -void wxListBox::SetCurrentItem(int n) -{ - if ( n != m_current ) - { - if ( m_current != -1 ) - RefreshItem(m_current); - - m_current = n; - - if ( m_current != -1 ) - { - m_currentChanged = true; - - RefreshItem(m_current); - } - } - //else: nothing to do -} - -bool wxListBox::FindItem(const wxString& prefix, bool strictlyAfter) -{ - unsigned int count = GetCount(); - if ( count==0 ) - { - // empty listbox, we can't find anything in it - return false; - } - - // start either from the current item or from the next one if strictlyAfter - // is true - int first; - if ( strictlyAfter ) - { - // the following line will set first correctly to 0 if there is no - // selection (m_current == -1) - first = m_current == (int)(count - 1) ? 0 : m_current + 1; - } - else // start with the current - { - first = m_current == -1 ? 0 : m_current; - } - - int last = first == 0 ? count - 1 : first - 1; - - // if this is not true we'd never exit from the loop below! - wxASSERT_MSG( first < (int)count && last < (int)count, _T("logic error") ); - - // precompute it outside the loop - size_t len = prefix.length(); - - // loop over all items in the listbox - for ( int item = first; item != (int)last; item < (int)(count - 1) ? item++ : item = 0 ) - { - if ( wxStrnicmp(this->GetString(item).c_str(), prefix, len) == 0 ) - { - SetCurrentItem(item); - - if ( !(GetWindowStyle() & wxLB_MULTIPLE) ) - { - DeselectAll(item); - SelectAndNotify(item); - - if ( GetWindowStyle() & wxLB_EXTENDED ) - AnchorSelection(item); - } - - return true; - } - } - - // nothing found - return false; -} - -void wxListBox::EnsureVisible(int n) -{ - if ( m_updateScrollbarY ) - { - UpdateScrollbars(); - - m_updateScrollbarX = - m_updateScrollbarY = false; - } - - DoEnsureVisible(n); -} - -void wxListBox::DoEnsureVisible(int n) -{ - if ( !m_showScrollbarY ) - { - // nothing to do - everything is shown anyhow - return; - } - - int first; - GetViewStart(0, &first); - if ( first > n ) - { - // we need to scroll upwards, so make the current item appear on top - // of the shown range - Scroll(0, n); - } - else - { - int last = first + GetClientSize().y / GetLineHeight() - 1; - if ( last < n ) - { - // scroll down: the current item appears at the bottom of the - // range - Scroll(0, n - (last - first)); - } - } -} - -void wxListBox::ChangeCurrent(int diff) -{ - int current = m_current == -1 ? 0 : m_current; - - current += diff; - - int last = GetCount() - 1; - if ( current < 0 ) - current = 0; - else if ( current > last ) - current = last; - - SetCurrentItem(current); -} - -void wxListBox::ExtendSelection(int itemTo) -{ - // if we don't have the explicit values for selection start/end, make them - // up - if ( m_selAnchor == -1 ) - m_selAnchor = m_current; - - if ( itemTo == -1 ) - itemTo = m_current; - - // swap the start/end of selection range if necessary - int itemFrom = m_selAnchor; - if ( itemFrom > itemTo ) - { - int itemTmp = itemFrom; - itemFrom = itemTo; - itemTo = itemTmp; - } - - // the selection should now include all items in the range between the - // anchor and the specified item and only them - - int n; - for ( n = 0; n < itemFrom; n++ ) - { - Deselect(n); - } - - for ( ; n <= itemTo; n++ ) - { - SetSelection(n); - } - - unsigned int count = GetCount(); - for ( ; n < (int)count; n++ ) - { - Deselect(n); - } -} - -void wxListBox::DoSelect(int item, bool sel) -{ - if ( item != -1 ) - { - // go to this item first - SetCurrentItem(item); - } - - // the current item is the one we want to change: either it was just - // changed above to be the same as item or item == -1 in which we case we - // are supposed to use the current one anyhow - if ( m_current != -1 ) - { - // [de]select it - SetSelection(m_current, sel); - } -} - -void wxListBox::SelectAndNotify(int item) -{ - DoSelect(item); - - SendEvent(wxEVT_COMMAND_LISTBOX_SELECTED); -} - -void wxListBox::Activate(int item) -{ - if ( item != -1 ) - SetCurrentItem(item); - else - item = m_current; - - if ( !(GetWindowStyle() & wxLB_MULTIPLE) ) - { - DeselectAll(item); - } - - if ( item != -1 ) - { - DoSelect(item); - - SendEvent(wxEVT_COMMAND_LISTBOX_DOUBLECLICKED); - } -} - -// ---------------------------------------------------------------------------- -// input handling -// ---------------------------------------------------------------------------- - -/* - The numArg here is the listbox item index while the strArg is used - differently for the different actions: - - a) for wxACTION_LISTBOX_FIND it has the natural meaning: this is the string - to find - - b) for wxACTION_LISTBOX_SELECT and wxACTION_LISTBOX_EXTENDSEL it is used - to decide if the listbox should send the notification event (it is empty) - or not (it is not): this allows us to reuse the same action for when the - user is dragging the mouse when it has been released although in the - first case no notification is sent while in the second it is sent. - */ -bool wxListBox::PerformAction(const wxControlAction& action, - long numArg, - const wxString& strArg) -{ - int item = (int)numArg; - - if ( action == wxACTION_LISTBOX_SETFOCUS ) - { - SetCurrentItem(item); - } - else if ( action == wxACTION_LISTBOX_ACTIVATE ) - { - Activate(item); - } - else if ( action == wxACTION_LISTBOX_TOGGLE ) - { - if ( item == -1 ) - item = m_current; - - if ( IsSelected(item) ) - DoUnselect(item); - else - SelectAndNotify(item); - } - else if ( action == wxACTION_LISTBOX_SELECT ) - { - DeselectAll(item); - - if ( strArg.empty() ) - SelectAndNotify(item); - else - DoSelect(item); - } - else if ( action == wxACTION_LISTBOX_SELECTADD ) - DoSelect(item); - else if ( action == wxACTION_LISTBOX_UNSELECT ) - DoUnselect(item); - else if ( action == wxACTION_LISTBOX_MOVEDOWN ) - ChangeCurrent(1); - else if ( action == wxACTION_LISTBOX_MOVEUP ) - ChangeCurrent(-1); - else if ( action == wxACTION_LISTBOX_PAGEDOWN ) - ChangeCurrent(GetItemsPerPage()); - else if ( action == wxACTION_LISTBOX_PAGEUP ) - ChangeCurrent(-GetItemsPerPage()); - else if ( action == wxACTION_LISTBOX_START ) - SetCurrentItem(0); - else if ( action == wxACTION_LISTBOX_END ) - SetCurrentItem(GetCount() - 1); - else if ( action == wxACTION_LISTBOX_UNSELECTALL ) - DeselectAll(item); - else if ( action == wxACTION_LISTBOX_EXTENDSEL ) - ExtendSelection(item); - else if ( action == wxACTION_LISTBOX_FIND ) - FindNextItem(strArg); - else if ( action == wxACTION_LISTBOX_ANCHOR ) - AnchorSelection(item == -1 ? m_current : item); - else if ( action == wxACTION_LISTBOX_SELECTALL || - action == wxACTION_LISTBOX_SELTOGGLE ) - wxFAIL_MSG(_T("unimplemented yet")); - else - return wxControl::PerformAction(action, numArg, strArg); - - return true; -} - -/* static */ -wxInputHandler *wxListBox::GetStdInputHandler(wxInputHandler *handlerDef) -{ - static wxStdListboxInputHandler s_handler(handlerDef); - - return &s_handler; -} - -// ============================================================================ -// implementation of wxStdListboxInputHandler -// ============================================================================ - -wxStdListboxInputHandler::wxStdListboxInputHandler(wxInputHandler *handler, - bool toggleOnPressAlways) - : wxStdInputHandler(handler) -{ - m_btnCapture = 0; - m_toggleOnPressAlways = toggleOnPressAlways; - m_actionMouse = wxACTION_NONE; - m_trackMouseOutside = true; -} - -int wxStdListboxInputHandler::HitTest(const wxListBox *lbox, - const wxMouseEvent& event) -{ - int item = HitTestUnsafe(lbox, event); - - return FixItemIndex(lbox, item); -} - -int wxStdListboxInputHandler::HitTestUnsafe(const wxListBox *lbox, - const wxMouseEvent& event) -{ - wxPoint pt = event.GetPosition(); - pt -= lbox->GetClientAreaOrigin(); - int y; - lbox->CalcUnscrolledPosition(0, pt.y, NULL, &y); - return y / lbox->GetLineHeight(); -} - -int wxStdListboxInputHandler::FixItemIndex(const wxListBox *lbox, - int item) -{ - if ( item < 0 ) - { - // mouse is above the first item - item = 0; - } - else if ( (unsigned int)item >= lbox->GetCount() ) - { - // mouse is below the last item - item = lbox->GetCount() - 1; - } - - return item; -} - -bool wxStdListboxInputHandler::IsValidIndex(const wxListBox *lbox, int item) -{ - return item >= 0 && (unsigned int)item < lbox->GetCount(); -} - -wxControlAction -wxStdListboxInputHandler::SetupCapture(wxListBox *lbox, - const wxMouseEvent& event, - int item) -{ - // we currently only allow selecting with the left mouse button, if we - // do need to allow using other buttons too we might use the code - // inside #if 0 -#if 0 - m_btnCapture = event.LeftDown() - ? 1 - : event.RightDown() - ? 3 - : 2; -#else - m_btnCapture = 1; -#endif // 0/1 - - wxControlAction action; - if ( lbox->HasMultipleSelection() ) - { - if ( lbox->GetWindowStyle() & wxLB_MULTIPLE ) - { - if ( m_toggleOnPressAlways ) - { - // toggle the item right now - action = wxACTION_LISTBOX_TOGGLE; - } - //else: later - - m_actionMouse = wxACTION_LISTBOX_SETFOCUS; - } - else // wxLB_EXTENDED listbox - { - // simple click in an extended sel listbox clears the old - // selection and adds the clicked item to it then, ctrl-click - // toggles an item to it and shift-click adds a range between - // the old selection anchor and the clicked item - if ( event.ControlDown() ) - { - lbox->PerformAction(wxACTION_LISTBOX_ANCHOR, item); - - action = wxACTION_LISTBOX_TOGGLE; - } - else if ( event.ShiftDown() ) - { - action = wxACTION_LISTBOX_EXTENDSEL; - } - else // simple click - { - lbox->PerformAction(wxACTION_LISTBOX_ANCHOR, item); - - action = wxACTION_LISTBOX_SELECT; - } - - m_actionMouse = wxACTION_LISTBOX_EXTENDSEL; - } - } - else // single selection - { - m_actionMouse = - action = wxACTION_LISTBOX_SELECT; - } - - // by default we always do track it - m_trackMouseOutside = true; - - return action; -} - -bool wxStdListboxInputHandler::HandleKey(wxInputConsumer *consumer, - const wxKeyEvent& event, - bool pressed) -{ - // we're only interested in the key press events - if ( pressed && !event.AltDown() ) - { - bool isMoveCmd = true; - int style = consumer->GetInputWindow()->GetWindowStyle(); - - wxControlAction action; - wxString strArg; - - int keycode = event.GetKeyCode(); - switch ( keycode ) - { - // movement - case WXK_UP: - action = wxACTION_LISTBOX_MOVEUP; - break; - - case WXK_DOWN: - action = wxACTION_LISTBOX_MOVEDOWN; - break; - - case WXK_PAGEUP: - action = wxACTION_LISTBOX_PAGEUP; - break; - - case WXK_PAGEDOWN: - action = wxACTION_LISTBOX_PAGEDOWN; - break; - - case WXK_HOME: - action = wxACTION_LISTBOX_START; - break; - - case WXK_END: - action = wxACTION_LISTBOX_END; - break; - - // selection - case WXK_SPACE: - if ( style & wxLB_MULTIPLE ) - { - action = wxACTION_LISTBOX_TOGGLE; - isMoveCmd = false; - } - break; - - case WXK_RETURN: - action = wxACTION_LISTBOX_ACTIVATE; - isMoveCmd = false; - break; - - default: - if ( (keycode < 255) && wxIsalnum((wxChar)keycode) ) - { - action = wxACTION_LISTBOX_FIND; - strArg = (wxChar)keycode; - } - } - - if ( !action.IsEmpty() ) - { - consumer->PerformAction(action, -1, strArg); - - if ( isMoveCmd ) - { - if ( style & wxLB_SINGLE ) - { - // the current item is always the one selected - consumer->PerformAction(wxACTION_LISTBOX_SELECT); - } - else if ( style & wxLB_EXTENDED ) - { - if ( event.ShiftDown() ) - consumer->PerformAction(wxACTION_LISTBOX_EXTENDSEL); - else - { - // select the item and make it the new selection anchor - consumer->PerformAction(wxACTION_LISTBOX_SELECT); - consumer->PerformAction(wxACTION_LISTBOX_ANCHOR); - } - } - //else: nothing to do for multiple selection listboxes - } - - return true; - } - } - - return wxStdInputHandler::HandleKey(consumer, event, pressed); -} - -bool wxStdListboxInputHandler::HandleMouse(wxInputConsumer *consumer, - const wxMouseEvent& event) -{ - wxListBox *lbox = wxStaticCast(consumer->GetInputWindow(), wxListBox); - int item = HitTest(lbox, event); - wxControlAction action; - - // when the left mouse button is pressed, capture the mouse and track the - // item under mouse (if the mouse leaves the window, we will still be - // getting the mouse move messages generated by wxScrollWindow) - if ( event.LeftDown() ) - { - // capture the mouse to track the selected item - lbox->CaptureMouse(); - - action = SetupCapture(lbox, event, item); - } - else if ( m_btnCapture && event.ButtonUp(m_btnCapture) ) - { - // when the left mouse button is released, release the mouse too - wxWindow *winCapture = wxWindow::GetCapture(); - if ( winCapture ) - { - winCapture->ReleaseMouse(); - m_btnCapture = 0; - - action = m_actionMouse; - } - //else: the mouse wasn't presed over the listbox, only released here - } - else if ( event.LeftDClick() ) - { - action = wxACTION_LISTBOX_ACTIVATE; - } - - if ( !action.IsEmpty() ) - { - lbox->PerformAction(action, item); - - return true; - } - - return wxStdInputHandler::HandleMouse(consumer, event); -} - -bool wxStdListboxInputHandler::HandleMouseMove(wxInputConsumer *consumer, - const wxMouseEvent& event) -{ - wxWindow *winCapture = wxWindow::GetCapture(); - if ( winCapture && (event.GetEventObject() == winCapture) ) - { - wxListBox *lbox = wxStaticCast(consumer->GetInputWindow(), wxListBox); - - if ( !m_btnCapture || !m_trackMouseOutside ) - { - // someone captured the mouse for us (we always set m_btnCapture - // when we do it ourselves): in this case we only react to - // the mouse messages when they happen inside the listbox - if ( lbox->HitTest(event.GetPosition()) != wxHT_WINDOW_INSIDE ) - return false; - } - - int item = HitTest(lbox, event); - if ( !m_btnCapture ) - { - // now that we have the mouse inside the listbox, do capture it - // normally - but ensure that we will still ignore the outside - // events - SetupCapture(lbox, event, item); - - m_trackMouseOutside = false; - } - - if ( IsValidIndex(lbox, item) ) - { - // pass something into strArg to tell the listbox that it shouldn't - // send the notification message: see PerformAction() above - lbox->PerformAction(m_actionMouse, item, _T("no")); - } - // else: don't pass invalid index to the listbox - } - else // we don't have capture any more - { - if ( m_btnCapture ) - { - // if we lost capture unexpectedly (someone else took the capture - // from us), return to a consistent state - m_btnCapture = 0; - } - } - - return wxStdInputHandler::HandleMouseMove(consumer, event); -} - -#endif // wxUSE_LISTBOX diff --git a/wxWidgets/src/univ/menu.cpp b/wxWidgets/src/univ/menu.cpp deleted file mode 100644 index f1e2672aaa..0000000000 --- a/wxWidgets/src/univ/menu.cpp +++ /dev/null @@ -1,2605 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/univ/menu.cpp -// Purpose: wxMenuItem, wxMenu and wxMenuBar implementation -// Author: Vadim Zeitlin -// Modified by: -// Created: 25.08.00 -// RCS-ID: $Id: menu.cpp 48053 2007-08-13 17:07:01Z JS $ -// Copyright: (c) 2000 SciTech Software, Inc. (www.scitechsoft.com) -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_MENUS - -#include "wx/menu.h" -#include "wx/stockitem.h" - -#ifndef WX_PRECOMP - #include "wx/dynarray.h" - #include "wx/control.h" // for FindAccelIndex() - #include "wx/settings.h" - #include "wx/accel.h" - #include "wx/log.h" - #include "wx/frame.h" - #include "wx/dcclient.h" -#endif // WX_PRECOMP - -#include "wx/popupwin.h" -#include "wx/evtloop.h" - -#include "wx/univ/renderer.h" - -#ifdef __WXMSW__ - #include "wx/msw/private.h" -#endif // __WXMSW__ - -typedef wxMenuItemList::compatibility_iterator wxMenuItemIter; - -// ---------------------------------------------------------------------------- -// wxMenuInfo contains all extra information about top level menus we need -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxMenuInfo -{ -public: - // ctor - wxMenuInfo(const wxString& text) - { - SetLabel(text); - SetEnabled(); - } - - // modifiers - - void SetLabel(const wxString& text) - { - m_originalLabel = text; - - // remember the accel char (may be -1 if none) - m_indexAccel = wxControl::FindAccelIndex(text, &m_label); - - // calculate the width later, after the menu bar is created - m_width = 0; - } - - void SetEnabled(bool enabled = true) { m_isEnabled = enabled; } - - // accessors - - const wxString& GetLabel() const { return m_label; } - const wxString& GetOriginalLabel() const { return m_originalLabel; } - bool IsEnabled() const { return m_isEnabled; } - wxCoord GetWidth(wxMenuBar *menubar) const - { - if ( !m_width ) - { - wxConstCast(this, wxMenuInfo)->CalcWidth(menubar); - } - - return m_width; - } - - int GetAccelIndex() const { return m_indexAccel; } - -private: - void CalcWidth(wxMenuBar *menubar) - { - wxSize size; - wxClientDC dc(menubar); - dc.SetFont(wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT)); - dc.GetTextExtent(m_label, &size.x, &size.y); - - // adjust for the renderer we use and store the width - m_width = menubar->GetRenderer()->GetMenuBarItemSize(size).x; - } - - wxString m_label; - wxString m_originalLabel; - wxCoord m_width; - int m_indexAccel; - bool m_isEnabled; -}; - -#include "wx/arrimpl.cpp" - -WX_DEFINE_OBJARRAY(wxMenuInfoArray); - -// ---------------------------------------------------------------------------- -// wxPopupMenuWindow: a popup window showing a menu -// ---------------------------------------------------------------------------- - -class wxPopupMenuWindow : public wxPopupTransientWindow -{ -public: - wxPopupMenuWindow(wxWindow *parent, wxMenu *menu); - - virtual ~wxPopupMenuWindow(); - - // override the base class version to select the first item initially - virtual void Popup(wxWindow *focus = NULL); - - // override the base class version to dismiss any open submenus - virtual void Dismiss(); - - // called when a submenu is dismissed - void OnSubmenuDismiss(bool dismissParent); - - // the default wxMSW wxPopupTransientWindow::OnIdle disables the capture - // when the cursor is inside the popup, which dsables the menu tracking - // so override it to do nothing -#ifdef __WXMSW__ - void OnIdle(wxIdleEvent& WXUNUSED(event)) { } -#endif - - // get the currently selected item (may be NULL) - wxMenuItem *GetCurrentItem() const - { - return m_nodeCurrent ? m_nodeCurrent->GetData() : NULL; - } - - // find the menu item at given position - wxMenuItemIter GetMenuItemFromPoint(const wxPoint& pt) const; - - // refresh the given item - void RefreshItem(wxMenuItem *item); - - // preselect the first item - void SelectFirst() { SetCurrentItem(m_menu->GetMenuItems().GetFirst()); } - - // process the key event, return true if done - bool ProcessKeyDown(int key); - - // process mouse move event - void ProcessMouseMove(const wxPoint& pt); - - // don't dismiss the popup window if the parent menu was clicked - virtual bool ProcessLeftDown(wxMouseEvent& event); - -protected: - // how did we perform this operation? - enum InputMethod - { - WithKeyboard, - WithMouse - }; - - // notify the menu when the window disappears from screen - virtual void OnDismiss(); - - // draw the menu inside this window - virtual void DoDraw(wxControlRenderer *renderer); - - // event handlers - void OnLeftUp(wxMouseEvent& event); - void OnMouseMove(wxMouseEvent& event); - void OnMouseLeave(wxMouseEvent& event); - void OnKeyDown(wxKeyEvent& event); - - // reset the current item and node - void ResetCurrent(); - - // set the current node and item without refreshing anything - void SetCurrentItem(wxMenuItemIter node); - - // change the current item refreshing the old and new items - void ChangeCurrent(wxMenuItemIter node); - - // activate item, i.e. call either ClickItem() or OpenSubmenu() depending - // on what it is, return true if something was done (i.e. it's not a - // separator...) - bool ActivateItem(wxMenuItem *item, InputMethod how = WithKeyboard); - - // send the event about the item click - void ClickItem(wxMenuItem *item); - - // show the submenu for this item - void OpenSubmenu(wxMenuItem *item, InputMethod how = WithKeyboard); - - // can this tiem be opened? - bool CanOpen(wxMenuItem *item) - { - return item && item->IsEnabled() && item->IsSubMenu(); - } - - // dismiss the menu and all parent menus too - void DismissAndNotify(); - - // react to dimissing this menu and also dismiss the parent if - // dismissParent - void HandleDismiss(bool dismissParent); - - // do we have an open submenu? - bool HasOpenSubmenu() const { return m_hasOpenSubMenu; } - - // get previous node after the current one - wxMenuItemIter GetPrevNode() const; - - // get previous node before the given one, wrapping if it's the first one - wxMenuItemIter GetPrevNode(wxMenuItemIter node) const; - - // get next node after the current one - wxMenuItemIter GetNextNode() const; - - // get next node after the given one, wrapping if it's the last one - wxMenuItemIter GetNextNode(wxMenuItemIter node) const; - -private: - // the menu we show - wxMenu *m_menu; - - // the menu node corresponding to the current item - wxMenuItemIter m_nodeCurrent; - - // do we currently have an opened submenu? - bool m_hasOpenSubMenu; - - DECLARE_EVENT_TABLE() -}; - -// ---------------------------------------------------------------------------- -// wxMenuKbdRedirector: an event handler which redirects kbd input to wxMenu -// ---------------------------------------------------------------------------- - -class wxMenuKbdRedirector : public wxEvtHandler -{ -public: - wxMenuKbdRedirector(wxMenu *menu) { m_menu = menu; } - - virtual bool ProcessEvent(wxEvent& event) - { - if ( event.GetEventType() == wxEVT_KEY_DOWN ) - { - return m_menu->ProcessKeyDown(((wxKeyEvent &)event).GetKeyCode()); - } - else - { - // return false; - - return wxEvtHandler::ProcessEvent(event); - } - } - -private: - wxMenu *m_menu; -}; - -// ---------------------------------------------------------------------------- -// wxWin macros -// ---------------------------------------------------------------------------- - -IMPLEMENT_DYNAMIC_CLASS(wxMenu, wxEvtHandler) -IMPLEMENT_DYNAMIC_CLASS(wxMenuBar, wxWindow) -IMPLEMENT_DYNAMIC_CLASS(wxMenuItem, wxObject) - -BEGIN_EVENT_TABLE(wxPopupMenuWindow, wxPopupTransientWindow) - EVT_KEY_DOWN(wxPopupMenuWindow::OnKeyDown) - - EVT_LEFT_UP(wxPopupMenuWindow::OnLeftUp) - EVT_MOTION(wxPopupMenuWindow::OnMouseMove) - EVT_LEAVE_WINDOW(wxPopupMenuWindow::OnMouseLeave) -#ifdef __WXMSW__ - EVT_IDLE(wxPopupMenuWindow::OnIdle) -#endif -END_EVENT_TABLE() - -BEGIN_EVENT_TABLE(wxMenuBar, wxMenuBarBase) - EVT_KILL_FOCUS(wxMenuBar::OnKillFocus) - - EVT_KEY_DOWN(wxMenuBar::OnKeyDown) - - EVT_LEFT_DOWN(wxMenuBar::OnLeftDown) - EVT_MOTION(wxMenuBar::OnMouseMove) -END_EVENT_TABLE() - -// ============================================================================ -// implementation -// ============================================================================ - -// ---------------------------------------------------------------------------- -// wxPopupMenuWindow -// ---------------------------------------------------------------------------- - -wxPopupMenuWindow::wxPopupMenuWindow(wxWindow *parent, wxMenu *menu) -{ - m_menu = menu; - m_hasOpenSubMenu = false; - - ResetCurrent(); - - (void)Create(parent, wxBORDER_RAISED); - - SetCursor(wxCURSOR_ARROW); -} - -wxPopupMenuWindow::~wxPopupMenuWindow() -{ - // When m_popupMenu in wxMenu is deleted because it - // is a child of an old menu bar being deleted (note: it does - // not get destroyed by the wxMenu destructor, but - // by DestroyChildren()), m_popupMenu should be reset to NULL. - - m_menu->m_popupMenu = NULL; -} - -// ---------------------------------------------------------------------------- -// wxPopupMenuWindow current item/node handling -// ---------------------------------------------------------------------------- - -void wxPopupMenuWindow::ResetCurrent() -{ - SetCurrentItem(wxMenuItemIter()); -} - -void wxPopupMenuWindow::SetCurrentItem(wxMenuItemIter node) -{ - m_nodeCurrent = node; -} - -void wxPopupMenuWindow::ChangeCurrent(wxMenuItemIter node) -{ - if ( !m_nodeCurrent || !node || (node != m_nodeCurrent) ) - { - wxMenuItemIter nodeOldCurrent = m_nodeCurrent; - - m_nodeCurrent = node; - - if ( nodeOldCurrent ) - { - wxMenuItem *item = nodeOldCurrent->GetData(); - wxCHECK_RET( item, _T("no current item?") ); - - // if it was the currently opened menu, close it - if ( item->IsSubMenu() && item->GetSubMenu()->IsShown() ) - { - item->GetSubMenu()->Dismiss(); - OnSubmenuDismiss( false ); - } - - RefreshItem(item); - } - - if ( m_nodeCurrent ) - RefreshItem(m_nodeCurrent->GetData()); - } -} - -wxMenuItemIter wxPopupMenuWindow::GetPrevNode() const -{ - // return the last node if there had been no previously selected one - return m_nodeCurrent ? GetPrevNode(m_nodeCurrent) - : wxMenuItemIter(m_menu->GetMenuItems().GetLast()); -} - -wxMenuItemIter -wxPopupMenuWindow::GetPrevNode(wxMenuItemIter node) const -{ - if ( node ) - { - node = node->GetPrevious(); - if ( !node ) - { - node = m_menu->GetMenuItems().GetLast(); - } - } - //else: the menu is empty - - return node; -} - -wxMenuItemIter wxPopupMenuWindow::GetNextNode() const -{ - // return the first node if there had been no previously selected one - return m_nodeCurrent ? GetNextNode(m_nodeCurrent) - : wxMenuItemIter(m_menu->GetMenuItems().GetFirst()); -} - -wxMenuItemIter -wxPopupMenuWindow::GetNextNode(wxMenuItemIter node) const -{ - if ( node ) - { - node = node->GetNext(); - if ( !node ) - { - node = m_menu->GetMenuItems().GetFirst(); - } - } - //else: the menu is empty - - return node; -} - -// ---------------------------------------------------------------------------- -// wxPopupMenuWindow popup/dismiss -// ---------------------------------------------------------------------------- - -void wxPopupMenuWindow::Popup(wxWindow *focus) -{ - // check that the current item had been properly reset before - wxASSERT_MSG( !m_nodeCurrent || - m_nodeCurrent == m_menu->GetMenuItems().GetFirst(), - _T("menu current item preselected incorrectly") ); - - wxPopupTransientWindow::Popup(focus); - - // the base class no-longer captures the mouse automatically when Popup - // is called, so do it here to allow the menu tracking to work - if ( !HasCapture() ) - CaptureMouse(); - -#ifdef __WXMSW__ - // ensure that this window is really on top of everything: without using - // SetWindowPos() it can be covered by its parent menu which is not - // really what we want - wxMenu *menuParent = m_menu->GetParent(); - if ( menuParent ) - { - wxPopupMenuWindow *win = menuParent->m_popupMenu; - - // if we're shown, the parent menu must be also shown - wxCHECK_RET( win, _T("parent menu is not shown?") ); - - if ( !::SetWindowPos(GetHwndOf(win), GetHwnd(), - 0, 0, 0, 0, - SWP_NOMOVE | SWP_NOSIZE | SWP_NOREDRAW) ) - { - wxLogLastError(_T("SetWindowPos(HWND_TOP)")); - } - - Refresh(); - } -#endif // __WXMSW__ -} - -void wxPopupMenuWindow::Dismiss() -{ - if ( HasOpenSubmenu() ) - { - wxMenuItem *item = GetCurrentItem(); - wxCHECK_RET( item && item->IsSubMenu(), _T("where is our open submenu?") ); - - wxPopupMenuWindow *win = item->GetSubMenu()->m_popupMenu; - wxCHECK_RET( win, _T("opened submenu is not opened?") ); - - win->Dismiss(); - OnSubmenuDismiss( false ); - } - - wxPopupTransientWindow::Dismiss(); - - ResetCurrent(); -} - -void wxPopupMenuWindow::OnDismiss() -{ - // when we are dismissed because the user clicked elsewhere or we lost - // focus in any other way, hide the parent menu as well - HandleDismiss(true); -} - -void wxPopupMenuWindow::OnSubmenuDismiss(bool WXUNUSED(dismissParent)) -{ - m_hasOpenSubMenu = false; -} - -void wxPopupMenuWindow::HandleDismiss(bool dismissParent) -{ - m_menu->OnDismiss(dismissParent); -} - -void wxPopupMenuWindow::DismissAndNotify() -{ - Dismiss(); - HandleDismiss(true); -} - -// ---------------------------------------------------------------------------- -// wxPopupMenuWindow geometry -// ---------------------------------------------------------------------------- - -wxMenuItemIter -wxPopupMenuWindow::GetMenuItemFromPoint(const wxPoint& pt) const -{ - // we only use the y coord normally, but still check x in case the point is - // outside the window completely - if ( wxWindow::HitTest(pt) == wxHT_WINDOW_INSIDE ) - { - wxCoord y = 0; - for ( wxMenuItemIter node = m_menu->GetMenuItems().GetFirst(); - node; - node = node->GetNext() ) - { - wxMenuItem *item = node->GetData(); - y += item->GetHeight(); - if ( y > pt.y ) - { - // found - return node; - } - } - } - - return wxMenuItemIter(); -} - -// ---------------------------------------------------------------------------- -// wxPopupMenuWindow drawing -// ---------------------------------------------------------------------------- - -void wxPopupMenuWindow::RefreshItem(wxMenuItem *item) -{ - wxCHECK_RET( item, _T("can't refresh NULL item") ); - - wxASSERT_MSG( IsShown(), _T("can't refresh menu which is not shown") ); - - // FIXME: -1 here because of SetLogicalOrigin(1, 1) in DoDraw() - RefreshRect(wxRect(0, item->GetPosition() - 1, - m_menu->GetGeometryInfo().GetSize().x, item->GetHeight())); -} - -void wxPopupMenuWindow::DoDraw(wxControlRenderer *renderer) -{ - // no clipping so far - do we need it? I don't think so as the menu is - // never partially covered as it is always on top of everything - - wxDC& dc = renderer->GetDC(); - dc.SetFont(wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT)); - - // FIXME: this should be done in the renderer, however when it is fixed - // wxPopupMenuWindow::RefreshItem() should be changed too! - dc.SetLogicalOrigin(1, 1); - - wxRenderer *rend = renderer->GetRenderer(); - - wxCoord y = 0; - const wxMenuGeometryInfo& gi = m_menu->GetGeometryInfo(); - for ( wxMenuItemIter node = m_menu->GetMenuItems().GetFirst(); - node; - node = node->GetNext() ) - { - wxMenuItem *item = node->GetData(); - - if ( item->IsSeparator() ) - { - rend->DrawMenuSeparator(dc, y, gi); - } - else // not a separator - { - int flags = 0; - if ( item->IsCheckable() ) - { - flags |= wxCONTROL_CHECKABLE; - - if ( item->IsChecked() ) - { - flags |= wxCONTROL_CHECKED; - } - } - - if ( !item->IsEnabled() ) - flags |= wxCONTROL_DISABLED; - - if ( item->IsSubMenu() ) - flags |= wxCONTROL_ISSUBMENU; - - if ( item == GetCurrentItem() ) - flags |= wxCONTROL_SELECTED; - - wxBitmap bmp; - - if ( !item->IsEnabled() ) - { - bmp = item->GetDisabledBitmap(); - } - - if ( !bmp.Ok() ) - { - // strangely enough, for unchecked item we use the - // "checked" bitmap because this is the default one - this - // explains this strange boolean expression - bmp = item->GetBitmap(!item->IsCheckable() || item->IsChecked()); - } - - rend->DrawMenuItem - ( - dc, - y, - gi, - item->GetLabel(), - item->GetAccelString(), - bmp, - flags, - item->GetAccelIndex() - ); - } - - y += item->GetHeight(); - } -} - -// ---------------------------------------------------------------------------- -// wxPopupMenuWindow actions -// ---------------------------------------------------------------------------- - -void wxPopupMenuWindow::ClickItem(wxMenuItem *item) -{ - wxCHECK_RET( item, _T("can't click NULL item") ); - - wxASSERT_MSG( !item->IsSeparator() && !item->IsSubMenu(), - _T("can't click this item") ); - - wxMenu* menu = m_menu; - - // close all menus - DismissAndNotify(); - - menu->ClickItem(item); -} - -void wxPopupMenuWindow::OpenSubmenu(wxMenuItem *item, InputMethod how) -{ - wxCHECK_RET( item, _T("can't open NULL submenu") ); - - wxMenu *submenu = item->GetSubMenu(); - wxCHECK_RET( submenu, _T("can only open submenus!") ); - - // FIXME: should take into account the border width - submenu->Popup(ClientToScreen(wxPoint(0, item->GetPosition())), - wxSize(m_menu->GetGeometryInfo().GetSize().x, 0), - how == WithKeyboard /* preselect first item then */); - - m_hasOpenSubMenu = true; -} - -bool wxPopupMenuWindow::ActivateItem(wxMenuItem *item, InputMethod how) -{ - // don't activate disabled items - if ( !item || !item->IsEnabled() ) - { - return false; - } - - // normal menu items generate commands, submenus can be opened and - // the separators don't do anything - if ( item->IsSubMenu() ) - { - OpenSubmenu(item, how); - } - else if ( !item->IsSeparator() ) - { - ClickItem(item); - } - else // separator, can't activate - { - return false; - } - - return true; -} - -// ---------------------------------------------------------------------------- -// wxPopupMenuWindow input handling -// ---------------------------------------------------------------------------- - -bool wxPopupMenuWindow::ProcessLeftDown(wxMouseEvent& event) -{ - // wxPopupWindowHandler dismisses the window when the mouse is clicked - // outside it which is usually just fine, but there is one case when we - // don't want to do it: if the mouse was clicked on the parent submenu item - // which opens this menu, so check for it - - wxPoint pos = event.GetPosition(); - if ( HitTest(pos.x, pos.y) == wxHT_WINDOW_OUTSIDE ) - { - wxMenu *menu = m_menu->GetParent(); - if ( menu ) - { - wxPopupMenuWindow *win = menu->m_popupMenu; - - wxCHECK_MSG( win, false, _T("parent menu not shown?") ); - - pos = ClientToScreen(pos); - if ( win->GetMenuItemFromPoint(win->ScreenToClient(pos)) ) - { - // eat the event - return true; - } - //else: it is outside the parent menu as well, do dismiss this one - } - } - - return false; -} - -void wxPopupMenuWindow::OnLeftUp(wxMouseEvent& event) -{ - wxMenuItemIter node = GetMenuItemFromPoint(event.GetPosition()); - if ( node ) - { - ActivateItem(node->GetData(), WithMouse); - } -} - -void wxPopupMenuWindow::OnMouseMove(wxMouseEvent& event) -{ - const wxPoint pt = event.GetPosition(); - - // we need to ignore extra mouse events: example when this happens is when - // the mouse is on the menu and we open a submenu from keyboard - Windows - // then sends us a dummy mouse move event, we (correctly) determine that it - // happens in the parent menu and so immediately close the just opened - // submenu! -#ifdef __WXMSW__ - static wxPoint s_ptLast; - wxPoint ptCur = ClientToScreen(pt); - if ( ptCur == s_ptLast ) - { - return; - } - - s_ptLast = ptCur; -#endif // __WXMSW__ - - ProcessMouseMove(pt); - - event.Skip(); -} - -void wxPopupMenuWindow::ProcessMouseMove(const wxPoint& pt) -{ - wxMenuItemIter node = GetMenuItemFromPoint(pt); - - // don't reset current to NULL here, we only do it when the mouse leaves - // the window (see below) - if ( node ) - { - if ( !m_nodeCurrent || (node != m_nodeCurrent) ) - { - ChangeCurrent(node); - - wxMenuItem *item = GetCurrentItem(); - if ( CanOpen(item) ) - { - OpenSubmenu(item, WithMouse); - } - } - //else: same item, nothing to do - } - else // not on an item - { - // the last open submenu forwards the mouse move messages to its - // parent, so if the mouse moves to another item of the parent menu, - // this menu is closed and this other item is selected - in the similar - // manner, the top menu forwards the mouse moves to the menubar which - // allows to select another top level menu by just moving the mouse - - // we need to translate our client coords to the client coords of the - // window we forward this event to - wxPoint ptScreen = ClientToScreen(pt); - - // if the mouse is outside this menu, let the parent one to - // process it - wxMenu *menuParent = m_menu->GetParent(); - if ( menuParent ) - { - wxPopupMenuWindow *win = menuParent->m_popupMenu; - - // if we're shown, the parent menu must be also shown - wxCHECK_RET( win, _T("parent menu is not shown?") ); - - win->ProcessMouseMove(win->ScreenToClient(ptScreen)); - } - else // no parent menu - { - wxMenuBar *menubar = m_menu->GetMenuBar(); - if ( menubar ) - { - if ( menubar->ProcessMouseEvent( - menubar->ScreenToClient(ptScreen)) ) - { - // menubar has closed this menu and opened another one, probably - return; - } - } - } - //else: top level popup menu, no other processing to do - } -} - -void wxPopupMenuWindow::OnMouseLeave(wxMouseEvent& event) -{ - // due to the artefact of mouse events generation under MSW, we actually - // may get the mouse leave event after the menu had been already dismissed - // and calling ChangeCurrent() would then assert, so don't do it - if ( IsShown() ) - { - // we shouldn't change the current them if our submenu is opened and - // mouse moved there, in this case the submenu is responsable for - // handling it - bool resetCurrent; - if ( HasOpenSubmenu() ) - { - wxMenuItem *item = GetCurrentItem(); - wxCHECK_RET( CanOpen(item), _T("where is our open submenu?") ); - - wxPopupMenuWindow *win = item->GetSubMenu()->m_popupMenu; - wxCHECK_RET( win, _T("submenu is opened but not shown?") ); - - // only handle this event if the mouse is not inside the submenu - wxPoint pt = ClientToScreen(event.GetPosition()); - resetCurrent = - win->HitTest(win->ScreenToClient(pt)) == wxHT_WINDOW_OUTSIDE; - } - else - { - // this menu is the last opened - resetCurrent = true; - } - - if ( resetCurrent ) - { - ChangeCurrent(wxMenuItemIter()); - } - } - - event.Skip(); -} - -void wxPopupMenuWindow::OnKeyDown(wxKeyEvent& event) -{ - wxMenuBar *menubar = m_menu->GetMenuBar(); - - if ( menubar ) - { - menubar->ProcessEvent(event); - } - else if ( !ProcessKeyDown(event.GetKeyCode()) ) - { - event.Skip(); - } -} - -bool wxPopupMenuWindow::ProcessKeyDown(int key) -{ - wxMenuItem *item = GetCurrentItem(); - - // first let the opened submenu to have it (no test for IsEnabled() here, - // the keys navigate even in a disabled submenu if we had somehow managed - // to open it inspit of this) - if ( HasOpenSubmenu() ) - { - wxCHECK_MSG( CanOpen(item), false, - _T("has open submenu but another item selected?") ); - - if ( item->GetSubMenu()->ProcessKeyDown(key) ) - return true; - } - - bool processed = true; - - // handle the up/down arrows, home, end, esc and return here, pass the - // left/right arrows to the menu bar except when the right arrow can be - // used to open a submenu - switch ( key ) - { - case WXK_LEFT: - // if we're not a top level menu, close us, else leave this to the - // menubar - if ( !m_menu->GetParent() ) - { - processed = false; - break; - } - - // fall through - - case WXK_ESCAPE: - // close just this menu - Dismiss(); - HandleDismiss(false); - break; - - case WXK_RETURN: - processed = ActivateItem(item); - break; - - case WXK_HOME: - ChangeCurrent(m_menu->GetMenuItems().GetFirst()); - break; - - case WXK_END: - ChangeCurrent(m_menu->GetMenuItems().GetLast()); - break; - - case WXK_UP: - case WXK_DOWN: - { - bool up = key == WXK_UP; - - wxMenuItemIter nodeStart = up ? GetPrevNode() : GetNextNode(), - node = nodeStart; - while ( node && node->GetData()->IsSeparator() ) - { - node = up ? GetPrevNode(node) : GetNextNode(node); - - if ( node == nodeStart ) - { - // nothing but separators and disabled items in this - // menu, break out - node = wxMenuItemIter(); - } - } - - if ( node ) - { - ChangeCurrent(node); - } - else - { - processed = false; - } - } - break; - - case WXK_RIGHT: - // don't try to reopen an already opened menu - if ( !HasOpenSubmenu() && CanOpen(item) ) - { - OpenSubmenu(item); - } - else - { - processed = false; - } - break; - - default: - // look for the menu item starting with this letter - if ( wxIsalnum((wxChar)key) ) - { - // we want to start from the item after this one because - // if we're already on the item with the given accel we want to - // go to the next one, not to stay in place - wxMenuItemIter nodeStart = GetNextNode(); - - // do we have more than one item with this accel? - bool notUnique = false; - - // translate everything to lower case before comparing - wxChar chAccel = (wxChar)wxTolower(key); - - // loop through all items searching for the item with this - // accel - wxMenuItemIter nodeFound, - node = nodeStart; - for ( ;; ) - { - item = node->GetData(); - - int idxAccel = item->GetAccelIndex(); - if ( idxAccel != -1 && - (wxChar)wxTolower(item->GetLabel()[(size_t)idxAccel]) - == chAccel ) - { - // ok, found an item with this accel - if ( !nodeFound ) - { - // store it but continue searching as we need to - // know if it's the only item with this accel or if - // there are more - nodeFound = node; - } - else // we already had found such item - { - notUnique = true; - - // no need to continue further, we won't find - // anything we don't already know - break; - } - } - - // we want to iterate over all items wrapping around if - // necessary - node = GetNextNode(node); - if ( node == nodeStart ) - { - // we've seen all nodes - break; - } - } - - if ( nodeFound ) - { - item = nodeFound->GetData(); - - // go to this item anyhow - ChangeCurrent(nodeFound); - - if ( !notUnique && item->IsEnabled() ) - { - // unique item with this accel - activate it - processed = ActivateItem(item); - } - //else: just select it but don't activate as the user might - // have wanted to activate another item - - // skip "processed = false" below - break; - } - } - - processed = false; - } - - return processed; -} - -// ---------------------------------------------------------------------------- -// wxMenu -// ---------------------------------------------------------------------------- - -void wxMenu::Init() -{ - m_geometry = NULL; - - m_popupMenu = NULL; - - m_startRadioGroup = -1; -} - -wxMenu::~wxMenu() -{ - delete m_geometry; - delete m_popupMenu; -} - -// ---------------------------------------------------------------------------- -// wxMenu and wxMenuGeometryInfo -// ---------------------------------------------------------------------------- - -wxMenuGeometryInfo::~wxMenuGeometryInfo() -{ -} - -const wxMenuGeometryInfo& wxMenu::GetGeometryInfo() const -{ - if ( !m_geometry ) - { - if ( m_popupMenu ) - { - wxConstCast(this, wxMenu)->m_geometry = - m_popupMenu->GetRenderer()->GetMenuGeometry(m_popupMenu, *this); - } - else - { - wxFAIL_MSG( _T("can't get geometry without window") ); - } - } - - return *m_geometry; -} - -void wxMenu::InvalidateGeometryInfo() -{ - if ( m_geometry ) - { - delete m_geometry; - m_geometry = NULL; - } -} - -// ---------------------------------------------------------------------------- -// wxMenu adding/removing items -// ---------------------------------------------------------------------------- - -void wxMenu::OnItemAdded(wxMenuItem *item) -{ - InvalidateGeometryInfo(); - -#if wxUSE_ACCEL - AddAccelFor(item); -#endif // wxUSE_ACCEL - - // the submenus of a popup menu should have the same invoking window as it - // has - if ( m_invokingWindow && item->IsSubMenu() ) - { - item->GetSubMenu()->SetInvokingWindow(m_invokingWindow); - } -} - -void wxMenu::EndRadioGroup() -{ - // we're not inside a radio group any longer - m_startRadioGroup = -1; -} - -wxMenuItem* wxMenu::DoAppend(wxMenuItem *item) -{ - 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); - } - else // extend the current radio group - { - // we need to update its end item - item->SetRadioGroupStart(m_startRadioGroup); - wxMenuItemIter 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) ) - return NULL; - - OnItemAdded(item); - - return item; -} - -wxMenuItem* wxMenu::DoInsert(size_t pos, wxMenuItem *item) -{ - if ( !wxMenuBase::DoInsert(pos, item) ) - return NULL; - - OnItemAdded(item); - - return item; -} - -wxMenuItem *wxMenu::DoRemove(wxMenuItem *item) -{ - wxMenuItem *itemOld = wxMenuBase::DoRemove(item); - - if ( itemOld ) - { - InvalidateGeometryInfo(); - -#if wxUSE_ACCEL - RemoveAccelFor(item); -#endif // wxUSE_ACCEL - } - - return itemOld; -} - -// ---------------------------------------------------------------------------- -// wxMenu attaching/detaching -// ---------------------------------------------------------------------------- - -void wxMenu::Attach(wxMenuBarBase *menubar) -{ - wxMenuBase::Attach(menubar); - - wxCHECK_RET( m_menuBar, _T("menubar can't be NULL after attaching") ); - - // unfortunately, we can't use m_menuBar->GetEventHandler() here because, - // if the menubar is currently showing a menu, its event handler is a - // temporary one installed by wxPopupWindow and so will disappear soon any - // any attempts to use it from the newly attached menu would result in a - // crash - // - // so we use the menubar itself, even if it's a pity as it means we can't - // redirect all menu events by changing the menubar handler (FIXME) - SetNextHandler(m_menuBar); -} - -void wxMenu::Detach() -{ - wxMenuBase::Detach(); -} - -// ---------------------------------------------------------------------------- -// wxMenu misc functions -// ---------------------------------------------------------------------------- - -wxWindow *wxMenu::GetRootWindow() const -{ - if ( GetMenuBar() ) - { - // simple case - a normal menu attached to the menubar - return GetMenuBar(); - } - - // we're a popup menu but the trouble is that only the top level popup menu - // has a pointer to the invoking window, so we must walk up the menu chain - // if needed - wxWindow *win = GetInvokingWindow(); - if ( win ) - { - // we already have it - return win; - } - - wxMenu *menu = GetParent(); - while ( menu ) - { - // We are a submenu of a menu of a menubar - if (menu->GetMenuBar()) - return menu->GetMenuBar(); - - win = menu->GetInvokingWindow(); - if ( win ) - break; - - menu = menu->GetParent(); - } - - // we're probably going to crash in the caller anyhow, but try to detect - // this error as soon as possible - wxASSERT_MSG( win, _T("menu without any associated window?") ); - - // also remember it in this menu so that we don't have to search for it the - // next time - wxConstCast(this, wxMenu)->m_invokingWindow = win; - - return win; -} - -wxRenderer *wxMenu::GetRenderer() const -{ - // we're going to crash without renderer! - wxCHECK_MSG( m_popupMenu, NULL, _T("neither popup nor menubar menu?") ); - - return m_popupMenu->GetRenderer(); -} - -void wxMenu::RefreshItem(wxMenuItem *item) -{ - // the item geometry changed, so our might have changed as well - InvalidateGeometryInfo(); - - if ( IsShown() ) - { - // this would be a bug in IsShown() - wxCHECK_RET( m_popupMenu, _T("must have popup window if shown!") ); - - // recalc geometry to update the item height and such - (void)GetGeometryInfo(); - - m_popupMenu->RefreshItem(item); - } -} - -// ---------------------------------------------------------------------------- -// wxMenu showing and hiding -// ---------------------------------------------------------------------------- - -bool wxMenu::IsShown() const -{ - return m_popupMenu && m_popupMenu->IsShown(); -} - -void wxMenu::OnDismiss(bool dismissParent) -{ - if ( m_menuParent ) - { - // always notify the parent about submenu disappearance - wxPopupMenuWindow *win = m_menuParent->m_popupMenu; - if ( win ) - { - win->OnSubmenuDismiss( true ); - } - else - { - wxFAIL_MSG( _T("parent menu not shown?") ); - } - - // and if we dismiss everything, propagate to parent - if ( dismissParent ) - { - // dismissParent is recursive - m_menuParent->Dismiss(); - m_menuParent->OnDismiss(true); - } - } - else // no parent menu - { - // notify the menu bar if we're a top level menu - if ( m_menuBar ) - { - m_menuBar->OnDismissMenu(dismissParent); - } - else // popup menu - { - wxCHECK_RET( m_invokingWindow, _T("what kind of menu is this?") ); - - m_invokingWindow->DismissPopupMenu(); - - // Why reset it here? We need it for sending the event to... - // SetInvokingWindow(NULL); - } - } -} - -void wxMenu::Popup(const wxPoint& pos, const wxSize& size, bool selectFirst) -{ - // create the popup window if not done yet - if ( !m_popupMenu ) - { - m_popupMenu = new wxPopupMenuWindow(GetRootWindow(), this); - } - - // select the first item unless disabled - if ( selectFirst ) - { - m_popupMenu->SelectFirst(); - } - - // the geometry might have changed since the last time we were shown, so - // always resize - m_popupMenu->SetClientSize(GetGeometryInfo().GetSize()); - - // position it as specified - m_popupMenu->Position(pos, size); - - // the menu can't have the focus itself (it is a Windows limitation), so - // always keep the focus at the originating window - wxWindow *focus = GetRootWindow(); - - wxASSERT_MSG( focus, _T("no window to keep focus on?") ); - - // and show it - m_popupMenu->Popup(focus); -} - -void wxMenu::Dismiss() -{ - wxCHECK_RET( IsShown(), _T("can't dismiss hidden menu") ); - - m_popupMenu->Dismiss(); -} - -// ---------------------------------------------------------------------------- -// wxMenu event processing -// ---------------------------------------------------------------------------- - -bool wxMenu::ProcessKeyDown(int key) -{ - wxCHECK_MSG( m_popupMenu, false, - _T("can't process key events if not shown") ); - - return m_popupMenu->ProcessKeyDown(key); -} - -bool wxMenu::ClickItem(wxMenuItem *item) -{ - int isChecked; - if ( item->IsCheckable() ) - { - // update the item state - isChecked = !item->IsChecked(); - - item->Check(isChecked != 0); - } - else - { - // not applicabled - isChecked = -1; - } - - return SendEvent(item->GetId(), isChecked); -} - -// ---------------------------------------------------------------------------- -// wxMenu accel support -// ---------------------------------------------------------------------------- - -#if wxUSE_ACCEL - -bool wxMenu::ProcessAccelEvent(const wxKeyEvent& event) -{ - // do we have an item for this accel? - wxMenuItem *item = m_accelTable.GetMenuItem(event); - if ( item && item->IsEnabled() ) - { - return ClickItem(item); - } - - // try our submenus - for ( wxMenuItemIter node = GetMenuItems().GetFirst(); - node; - node = node->GetNext() ) - { - const wxMenuItem *item = node->GetData(); - if ( item->IsSubMenu() && item->IsEnabled() ) - { - // try its elements - if ( item->GetSubMenu()->ProcessAccelEvent(event) ) - { - return true; - } - } - } - - return false; -} - -void wxMenu::AddAccelFor(wxMenuItem *item) -{ - wxAcceleratorEntry *accel = item->GetAccel(); - if ( accel ) - { - accel->SetMenuItem(item); - - m_accelTable.Add(*accel); - - delete accel; - } -} - -void wxMenu::RemoveAccelFor(wxMenuItem *item) -{ - wxAcceleratorEntry *accel = item->GetAccel(); - if ( accel ) - { - m_accelTable.Remove(*accel); - - delete accel; - } -} - -#endif // wxUSE_ACCEL - -// ---------------------------------------------------------------------------- -// wxMenuItem construction -// ---------------------------------------------------------------------------- - -wxMenuItem::wxMenuItem(wxMenu *parentMenu, - int id, - const wxString& text, - const wxString& help, - wxItemKind kind, - wxMenu *subMenu) - : wxMenuItemBase(parentMenu, id, text, help, kind, subMenu) -{ - m_posY = - m_height = wxDefaultCoord; - - m_radioGroup.start = -1; - m_isRadioGroupStart = false; - - m_bmpDisabled = wxNullBitmap; - - UpdateAccelInfo(); -} - -wxMenuItem::~wxMenuItem() -{ -} - -// ---------------------------------------------------------------------------- -// wxMenuItemBase methods implemented here -// ---------------------------------------------------------------------------- - -/* static */ -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); -} - -/* static */ -wxString wxMenuItemBase::GetLabelFromText(const wxString& text) -{ - return wxStripMenuCodes(text); -} - -// ---------------------------------------------------------------------------- -// wxMenuItem operations -// ---------------------------------------------------------------------------- - -void wxMenuItem::NotifyMenu() -{ - m_parentMenu->RefreshItem(this); -} - -void wxMenuItem::UpdateAccelInfo() -{ - m_indexAccel = wxControl::FindAccelIndex(m_text); - - // will be empty if the text contains no TABs - ok - m_strAccel = m_text.AfterFirst(_T('\t')); -} - -void wxMenuItem::SetText(const wxString& text) -{ - if ( text != m_text ) - { - // first call the base class version to change m_text - // (and also check if we don't have a stock menu item) - wxMenuItemBase::SetText(text); - - UpdateAccelInfo(); - - NotifyMenu(); - } -} - -void wxMenuItem::SetCheckable(bool checkable) -{ - if ( checkable != IsCheckable() ) - { - wxMenuItemBase::SetCheckable(checkable); - - NotifyMenu(); - } -} - -void wxMenuItem::SetBitmaps(const wxBitmap& bmpChecked, - const wxBitmap& bmpUnchecked) -{ - m_bmpChecked = bmpChecked; - m_bmpUnchecked = bmpUnchecked; - - NotifyMenu(); -} - -void wxMenuItem::Enable(bool enable) -{ - if ( enable != m_isEnabled ) - { - wxMenuItemBase::Enable(enable); - - NotifyMenu(); - } -} - -void wxMenuItem::Check(bool check) -{ - wxCHECK_RET( IsCheckable(), wxT("only checkable items may be checked") ); - - if ( m_isChecked == check ) - return; - - if ( GetKind() == wxITEM_RADIO ) - { - // it doesn't make sense to uncheck a radio item - what would this do? - if ( !check ) - return; - - // 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 - wxMenuItemIter node = items.Item(start); - for ( int n = start; n <= end && node; n++ ) - { - if ( n != pos ) - { - node->GetData()->m_isChecked = false; - } - node = node->GetNext(); - } - } - - wxMenuItemBase::Check(check); - - NotifyMenu(); -} - -// 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; -} - -// ---------------------------------------------------------------------------- -// wxMenuBar creation -// ---------------------------------------------------------------------------- - -void wxMenuBar::Init() -{ - m_frameLast = NULL; - - m_current = -1; - - m_menuShown = NULL; - - m_shouldShowMenu = false; -} - -wxMenuBar::wxMenuBar(size_t n, wxMenu *menus[], const wxString titles[], long WXUNUSED(style)) -{ - Init(); - - for (size_t i = 0; i < n; ++i ) - Append(menus[i], titles[i]); -} - -void wxMenuBar::Attach(wxFrame *frame) -{ - // maybe you really wanted to call Detach()? - wxCHECK_RET( frame, _T("wxMenuBar::Attach(NULL) called") ); - - wxMenuBarBase::Attach(frame); - - if ( IsCreated() ) - { - // reparent if necessary - if ( m_frameLast != frame ) - { - Reparent(frame); - } - - // show it back - was hidden by Detach() - Show(); - } - else // not created yet, do it now - { - // we have no way to return the error from here anyhow :-( - (void)Create(frame, wxID_ANY); - - SetCursor(wxCURSOR_ARROW); - - SetFont(wxSystemSettings::GetFont(wxSYS_SYSTEM_FONT)); - - // calculate and set our height (it won't be changed any more) - SetSize(wxDefaultCoord, GetBestSize().y); - } - - // remember the last frame which had us to avoid unnecessarily reparenting - // above - m_frameLast = frame; -} - -void wxMenuBar::Detach() -{ - // don't delete the window because we may be reattached later, just hide it - if ( m_frameLast ) - { - Hide(); - } - - wxMenuBarBase::Detach(); -} - -wxMenuBar::~wxMenuBar() -{ -} - -// ---------------------------------------------------------------------------- -// wxMenuBar adding/removing items -// ---------------------------------------------------------------------------- - -bool wxMenuBar::Append(wxMenu *menu, const wxString& title) -{ - return Insert(GetCount(), menu, title); -} - -bool wxMenuBar::Insert(size_t pos, wxMenu *menu, const wxString& title) -{ - if ( !wxMenuBarBase::Insert(pos, menu, title) ) - return false; - - wxMenuInfo *info = new wxMenuInfo(title); - m_menuInfos.Insert(info, pos); - - RefreshAllItemsAfter(pos); - - return true; -} - -wxMenu *wxMenuBar::Replace(size_t pos, wxMenu *menu, const wxString& title) -{ - wxMenu *menuOld = wxMenuBarBase::Replace(pos, menu, title); - - if ( menuOld ) - { - wxMenuInfo& info = m_menuInfos[pos]; - - info.SetLabel(title); - - // even if the old menu was disabled, the new one is not any more - info.SetEnabled(); - - // even if we change only this one, the new label has different width, - // so we need to refresh everything beyond this item as well - RefreshAllItemsAfter(pos); - } - - return menuOld; -} - -wxMenu *wxMenuBar::Remove(size_t pos) -{ - wxMenu *menuOld = wxMenuBarBase::Remove(pos); - - if ( menuOld ) - { - m_menuInfos.RemoveAt(pos); - - // this doesn't happen too often, so don't try to be too smart - just - // refresh everything - Refresh(); - } - - return menuOld; -} - -// ---------------------------------------------------------------------------- -// wxMenuBar top level menus access -// ---------------------------------------------------------------------------- - -wxCoord wxMenuBar::GetItemWidth(size_t pos) const -{ - return m_menuInfos[pos].GetWidth(wxConstCast(this, wxMenuBar)); -} - -void wxMenuBar::EnableTop(size_t pos, bool enable) -{ - wxCHECK_RET( pos < GetCount(), _T("invalid index in EnableTop") ); - - if ( enable != m_menuInfos[pos].IsEnabled() ) - { - m_menuInfos[pos].SetEnabled(enable); - - RefreshItem(pos); - } - //else: nothing to do -} - -bool wxMenuBar::IsEnabledTop(size_t pos) const -{ - wxCHECK_MSG( pos < GetCount(), false, _T("invalid index in IsEnabledTop") ); - - return m_menuInfos[pos].IsEnabled(); -} - -void wxMenuBar::SetLabelTop(size_t pos, const wxString& label) -{ - wxCHECK_RET( pos < GetCount(), _T("invalid index in SetLabelTop") ); - - if ( label != m_menuInfos[pos].GetOriginalLabel() ) - { - m_menuInfos[pos].SetLabel(label); - - RefreshItem(pos); - } - //else: nothing to do -} - -wxString wxMenuBar::GetLabelTop(size_t pos) const -{ - wxCHECK_MSG( pos < GetCount(), wxEmptyString, _T("invalid index in GetLabelTop") ); - - return m_menuInfos[pos].GetLabel(); -} - -// Gets the original label at the top-level of the menubar -wxString wxMenuBar::GetMenuLabel(size_t pos) const -{ - wxCHECK_MSG( pos < GetMenuCount(), wxEmptyString, - wxT("invalid menu index in wxMenuBar::GetMenuLabel") ); - - return m_menuInfos[pos].GetOriginalLabel(); -} - - -// ---------------------------------------------------------------------------- -// wxMenuBar drawing -// ---------------------------------------------------------------------------- - -void wxMenuBar::RefreshAllItemsAfter(size_t pos) -{ - if ( !IsCreated() ) - { - // no need to refresh if nothing is shown yet - return; - } - - wxRect rect = GetItemRect(pos); - rect.width = GetClientSize().x - rect.x; - RefreshRect(rect); -} - -void wxMenuBar::RefreshItem(size_t pos) -{ - wxCHECK_RET( pos != (size_t)-1, - _T("invalid item in wxMenuBar::RefreshItem") ); - - if ( !IsCreated() ) - { - // no need to refresh if nothing is shown yet - return; - } - - RefreshRect(GetItemRect(pos)); -} - -void wxMenuBar::DoDraw(wxControlRenderer *renderer) -{ - wxDC& dc = renderer->GetDC(); - dc.SetFont(wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT)); - - // redraw only the items which must be redrawn - - // we don't have to use GetUpdateClientRect() here because our client rect - // is the same as total one - wxRect rectUpdate = GetUpdateRegion().GetBox(); - - int flagsMenubar = GetStateFlags(); - - wxRect rect; - rect.y = 0; - rect.height = GetClientSize().y; - - wxCoord x = 0; - size_t count = GetCount(); - for ( size_t n = 0; n < count; n++ ) - { - if ( x > rectUpdate.GetRight() ) - { - // all remaining items are to the right of rectUpdate - break; - } - - rect.x = x; - rect.width = GetItemWidth(n); - x += rect.width; - if ( x < rectUpdate.x ) - { - // this item is still to the left of rectUpdate - continue; - } - - int flags = flagsMenubar; - if ( m_current != -1 && n == (size_t)m_current ) - { - flags |= wxCONTROL_SELECTED; - } - - if ( !IsEnabledTop(n) ) - { - flags |= wxCONTROL_DISABLED; - } - - GetRenderer()->DrawMenuBarItem - ( - dc, - rect, - m_menuInfos[n].GetLabel(), - flags, - m_menuInfos[n].GetAccelIndex() - ); - } -} - -// ---------------------------------------------------------------------------- -// wxMenuBar geometry -// ---------------------------------------------------------------------------- - -wxRect wxMenuBar::GetItemRect(size_t pos) const -{ - wxASSERT_MSG( pos < GetCount(), _T("invalid menu bar item index") ); - wxASSERT_MSG( IsCreated(), _T("can't call this method yet") ); - - wxRect rect; - rect.x = - rect.y = 0; - rect.height = GetClientSize().y; - - for ( size_t n = 0; n < pos; n++ ) - { - rect.x += GetItemWidth(n); - } - - rect.width = GetItemWidth(pos); - - return rect; -} - -wxSize wxMenuBar::DoGetBestClientSize() const -{ - wxSize size; - if ( GetMenuCount() > 0 ) - { - wxClientDC dc(wxConstCast(this, wxMenuBar)); - dc.SetFont(wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT)); - dc.GetTextExtent(GetLabelTop(0), &size.x, &size.y); - - // adjust for the renderer we use - size = GetRenderer()->GetMenuBarItemSize(size); - } - else // empty menubar - { - size.x = - size.y = 0; - } - - // the width is arbitrary, of course, for horizontal menubar - size.x = 100; - - return size; -} - -int wxMenuBar::GetMenuFromPoint(const wxPoint& pos) const -{ - if ( pos.x < 0 || pos.y < 0 || pos.y > GetClientSize().y ) - return -1; - - // do find it - wxCoord x = 0; - size_t count = GetCount(); - for ( size_t item = 0; item < count; item++ ) - { - x += GetItemWidth(item); - - if ( x > pos.x ) - { - return item; - } - } - - // to the right of the last menu item - return -1; -} - -// ---------------------------------------------------------------------------- -// wxMenuBar menu operations -// ---------------------------------------------------------------------------- - -void wxMenuBar::SelectMenu(size_t pos) -{ - SetFocus(); - wxLogTrace(_T("mousecapture"), _T("Capturing mouse from wxMenuBar::SelectMenu")); - CaptureMouse(); - - DoSelectMenu(pos); -} - -void wxMenuBar::DoSelectMenu(size_t pos) -{ - wxCHECK_RET( pos < GetCount(), _T("invalid menu index in DoSelectMenu") ); - - int posOld = m_current; - - m_current = pos; - - if ( posOld != -1 ) - { - // close the previous menu - if ( IsShowingMenu() ) - { - // restore m_shouldShowMenu flag after DismissMenu() which resets - // it to false - bool old = m_shouldShowMenu; - - DismissMenu(); - - m_shouldShowMenu = old; - } - - RefreshItem((size_t)posOld); - } - - RefreshItem(pos); -} - -void wxMenuBar::PopupMenu(size_t pos) -{ - wxCHECK_RET( pos < GetCount(), _T("invalid menu index in PopupCurrentMenu") ); - - SetFocus(); - DoSelectMenu(pos); - PopupCurrentMenu(); -} - -// ---------------------------------------------------------------------------- -// wxMenuBar input handing -// ---------------------------------------------------------------------------- - -/* - Note that wxMenuBar doesn't use wxInputHandler but handles keyboard and - mouse in the same way under all platforms. This is because it doesn't derive - from wxControl (which works with input handlers) but directly from wxWindow. - - Also, menu bar input handling is rather simple, so maybe it's not really - worth making it themeable - at least I've decided against doing it now as it - would merging the changes back into trunk more difficult. But it still could - be done later if really needed. - */ - -void wxMenuBar::OnKillFocus(wxFocusEvent& event) -{ - if ( m_current != -1 ) - { - RefreshItem((size_t)m_current); - - m_current = -1; - } - - event.Skip(); -} - -void wxMenuBar::OnLeftDown(wxMouseEvent& event) -{ - if ( HasCapture() ) - { - OnDismiss(); - - event.Skip(); - } - else // we didn't have mouse capture, capture it now - { - m_current = GetMenuFromPoint(event.GetPosition()); - if ( m_current == -1 ) - { - // unfortunately, we can't prevent wxMSW from giving us the focus, - // so we can only give it back - GiveAwayFocus(); - } - else // on item - { - wxLogTrace(_T("mousecapture"), _T("Capturing mouse from wxMenuBar::OnLeftDown")); - CaptureMouse(); - - // show it as selected - RefreshItem((size_t)m_current); - - // show the menu - PopupCurrentMenu(false /* don't select first item - as Windows does */); - } - } -} - -void wxMenuBar::OnMouseMove(wxMouseEvent& event) -{ - if ( HasCapture() ) - { - (void)ProcessMouseEvent(event.GetPosition()); - } - else - { - event.Skip(); - } -} - -bool wxMenuBar::ProcessMouseEvent(const wxPoint& pt) -{ - // a hack to ignore the extra mouse events MSW sends us: this is similar to - // wxUSE_MOUSEEVENT_HACK in wxWin itself but it isn't enough for us here as - // we get the messages from different windows (old and new popup menus for - // example) -#ifdef __WXMSW__ - static wxPoint s_ptLast; - if ( pt == s_ptLast ) - { - return false; - } - - s_ptLast = pt; -#endif // __WXMSW__ - - int currentNew = GetMenuFromPoint(pt); - if ( (currentNew == -1) || (currentNew == m_current) ) - { - return false; - } - - // select the new active item - DoSelectMenu(currentNew); - - // show the menu if we know that we should, even if we hadn't been showing - // it before (this may happen if the previous menu was disabled) - if ( m_shouldShowMenu && !m_menuShown) - { - // open the new menu if the old one we closed had been opened - PopupCurrentMenu(false /* don't select first item - as Windows does */); - } - - return true; -} - -void wxMenuBar::OnKeyDown(wxKeyEvent& event) -{ - // ensure that we have a current item - we might not have it if we're - // given the focus with Alt or F10 press (and under GTK+ the menubar - // somehow gets the keyboard events even when it doesn't have focus...) - if ( m_current == -1 ) - { - if ( !HasCapture() ) - { - SelectMenu(0); - } - else // we do have capture - { - // we always maintain a valid current item while we're in modal - // state (i.e. have the capture) - wxFAIL_MSG( _T("how did we manage to lose current item?") ); - - return; - } - } - - int key = event.GetKeyCode(); - - // first let the menu have it - if ( IsShowingMenu() && m_menuShown->ProcessKeyDown(key) ) - { - return; - } - - // cycle through the menu items when left/right arrows are pressed and open - // the menu when up/down one is - switch ( key ) - { - case WXK_ALT: - // Alt must be processed at wxWindow level too - event.Skip(); - // fall through - - case WXK_ESCAPE: - // remove the selection and give the focus away - if ( m_current != -1 ) - { - if ( IsShowingMenu() ) - { - DismissMenu(); - } - - OnDismiss(); - } - break; - - case WXK_LEFT: - case WXK_RIGHT: - { - size_t count = GetCount(); - if ( count == 1 ) - { - // the item won't change anyhow - break; - } - //else: otherwise, it will - - // remember if we were showing a menu - if we did, we should - // show the new menu after changing the item - bool wasMenuOpened = IsShowingMenu(); - if ( wasMenuOpened ) - { - DismissMenu(); - } - - // cast is safe as we tested for -1 above - size_t currentNew = (size_t)m_current; - - if ( key == WXK_LEFT ) - { - if ( currentNew-- == 0 ) - currentNew = count - 1; - } - else // right - { - if ( ++currentNew == count ) - currentNew = 0; - } - - DoSelectMenu(currentNew); - - if ( wasMenuOpened ) - { - PopupCurrentMenu(); - } - } - break; - - case WXK_DOWN: - case WXK_UP: - case WXK_RETURN: - // open the menu - PopupCurrentMenu(); - break; - - default: - // letters open the corresponding menu - { - bool unique; - int idxFound = FindNextItemForAccel(m_current, key, &unique); - - if ( idxFound != -1 ) - { - if ( IsShowingMenu() ) - { - DismissMenu(); - } - - DoSelectMenu((size_t)idxFound); - - // if the item is not unique, just select it but don't - // activate as the user might have wanted to activate - // another item - // - // also, don't try to open a disabled menu - if ( unique && IsEnabledTop((size_t)idxFound) ) - { - // open the menu - PopupCurrentMenu(); - } - - // skip the "event.Skip()" below - break; - } - } - - event.Skip(); - } -} - -// ---------------------------------------------------------------------------- -// wxMenuBar accel handling -// ---------------------------------------------------------------------------- - -int wxMenuBar::FindNextItemForAccel(int idxStart, int key, bool *unique) const -{ - if ( !wxIsalnum((wxChar)key) ) - { - // we only support letters/digits as accels - return -1; - } - - // do we have more than one item with this accel? - if ( unique ) - *unique = true; - - // translate everything to lower case before comparing - wxChar chAccel = (wxChar)wxTolower(key); - - // the index of the item with this accel - int idxFound = -1; - - // loop through all items searching for the item with this - // accel starting at the item after the current one - int count = GetCount(); - int n = idxStart == -1 ? 0 : idxStart + 1; - - if ( n == count ) - { - // wrap - n = 0; - } - - idxStart = n; - for ( ;; ) - { - const wxMenuInfo& info = m_menuInfos[n]; - - int idxAccel = info.GetAccelIndex(); - if ( idxAccel != -1 && - (wxChar)wxTolower(info.GetLabel()[(size_t)idxAccel]) == chAccel ) - { - // ok, found an item with this accel - if ( idxFound == -1 ) - { - // store it but continue searching as we need to - // know if it's the only item with this accel or if - // there are more - idxFound = n; - } - else // we already had found such item - { - if ( unique ) - *unique = false; - - // no need to continue further, we won't find - // anything we don't already know - break; - } - } - - // we want to iterate over all items wrapping around if - // necessary - if ( ++n == count ) - { - // wrap - n = 0; - } - - if ( n == idxStart ) - { - // we've seen all items - break; - } - } - - return idxFound; -} - -#if wxUSE_ACCEL - -bool wxMenuBar::ProcessAccelEvent(const wxKeyEvent& event) -{ - size_t n = 0; - for ( wxMenuList::compatibility_iterator node = m_menus.GetFirst(); - node; - node = node->GetNext(), n++ ) - { - // accels of the items in the disabled menus shouldn't work - if ( m_menuInfos[n].IsEnabled() ) - { - if ( node->GetData()->ProcessAccelEvent(event) ) - { - // menu processed it - return true; - } - } - } - - // not found - return false; -} - -#endif // wxUSE_ACCEL - -// ---------------------------------------------------------------------------- -// wxMenuBar menus showing -// ---------------------------------------------------------------------------- - -void wxMenuBar::PopupCurrentMenu(bool selectFirst) -{ - wxCHECK_RET( m_current != -1, _T("no menu to popup") ); - - // forgot to call DismissMenu()? - wxASSERT_MSG( !m_menuShown, _T("shouldn't show two menus at once!") ); - - // in any case, we should show it - even if we won't - m_shouldShowMenu = true; - - if ( IsEnabledTop(m_current) ) - { - // remember the menu we show - m_menuShown = GetMenu(m_current); - - // we don't show the menu at all if it has no items - if ( !m_menuShown->IsEmpty() ) - { - // position it correctly: note that we must use screen coords and - // that we pass 0 as width to position the menu exactly below the - // item, not to the right of it - wxRect rectItem = GetItemRect(m_current); - - m_menuShown->SetInvokingWindow(m_frameLast); - - m_menuShown->Popup(ClientToScreen(rectItem.GetPosition()), - wxSize(0, rectItem.GetHeight()), - selectFirst); - } - else - { - // reset it back as no menu is shown - m_menuShown = NULL; - } - } - //else: don't show disabled menu -} - -void wxMenuBar::DismissMenu() -{ - wxCHECK_RET( m_menuShown, _T("can't dismiss menu if none is shown") ); - - m_menuShown->Dismiss(); - OnDismissMenu(); -} - -void wxMenuBar::OnDismissMenu(bool dismissMenuBar) -{ - m_shouldShowMenu = false; - m_menuShown = NULL; - if ( dismissMenuBar ) - { - OnDismiss(); - } -} - -void wxMenuBar::OnDismiss() -{ - if ( ReleaseMouseCapture() ) - wxLogTrace(_T("mousecapture"), _T("Releasing mouse from wxMenuBar::OnDismiss")); - - if ( m_current != -1 ) - { - size_t current = m_current; - m_current = -1; - - RefreshItem(current); - } - - GiveAwayFocus(); -} - -bool wxMenuBar::ReleaseMouseCapture() -{ -#ifdef __WXX11__ - // With wxX11, when a menu is closed by clicking away from it, a control - // under the click will still get an event, even though the menu has the - // capture (bug?). So that control may already have taken the capture by - // this point, preventing us from releasing the menu's capture. So to work - // around this, we release both captures, then put back the control's - // capture. - wxWindow *capture = GetCapture(); - if ( capture ) - { - capture->ReleaseMouse(); - - if ( capture == this ) - return true; - - bool had = HasCapture(); - - if ( had ) - ReleaseMouse(); - - capture->CaptureMouse(); - - return had; - } -#else - if ( HasCapture() ) - { - ReleaseMouse(); - return true; - } -#endif - return false; -} - -void wxMenuBar::GiveAwayFocus() -{ - GetFrame()->SetFocus(); -} - -// ---------------------------------------------------------------------------- -// popup menu support -// ---------------------------------------------------------------------------- - -wxEventLoop *wxWindow::ms_evtLoopPopup = NULL; - -bool wxWindow::DoPopupMenu(wxMenu *menu, int x, int y) -{ - wxCHECK_MSG( !ms_evtLoopPopup, false, - _T("can't show more than one popup menu at a time") ); - -#ifdef __WXMSW__ - // we need to change the cursor before showing the menu as, apparently, no - // cursor changes took place while the mouse is captured - wxCursor cursorOld = GetCursor(); - SetCursor(wxCURSOR_ARROW); -#endif // __WXMSW__ - -#if 0 - // flash any delayed log messages before showing the menu, otherwise it - // could be dismissed (because it would lose focus) immediately after being - // shown - wxLog::FlushActive(); - - // some controls update themselves from OnIdle() call - let them do it - wxTheApp->ProcessIdle(); - - // if the window hadn't been refreshed yet, the menu can adversely affect - // its next OnPaint() handler execution - i.e. scrolled window refresh - // logic breaks then as it scrolls part of the menu which hadn't been there - // when the update event was generated into view - Update(); -#endif // 0 - - menu->SetInvokingWindow(this); - - // wxLogDebug( "Name of invoking window %s", menu->GetInvokingWindow()->GetName().c_str() ); - - menu->Popup(ClientToScreen(wxPoint(x, y)), wxSize(0,0)); - - // this is not very useful if the menu was popped up because of the mouse - // click but I think it is nice to do when it appears because of a key - // press (i.e. Windows menu key) - // - // Windows itself doesn't do it, but IMHO this is nice - WarpPointer(x, y); - - // we have to redirect all keyboard input to the menu temporarily - PushEventHandler(new wxMenuKbdRedirector(menu)); - - // enter the local modal loop - ms_evtLoopPopup = new wxEventLoop; - ms_evtLoopPopup->Run(); - - delete ms_evtLoopPopup; - ms_evtLoopPopup = NULL; - - // remove the handler - PopEventHandler(true /* delete it */); - - menu->SetInvokingWindow(NULL); - -#ifdef __WXMSW__ - SetCursor(cursorOld); -#endif // __WXMSW__ - - return true; -} - -void wxWindow::DismissPopupMenu() -{ - wxCHECK_RET( ms_evtLoopPopup, _T("no popup menu shown") ); - - ms_evtLoopPopup->Exit(); -} - -#endif // wxUSE_MENUS diff --git a/wxWidgets/src/univ/notebook.cpp b/wxWidgets/src/univ/notebook.cpp deleted file mode 100644 index 8f644909b5..0000000000 --- a/wxWidgets/src/univ/notebook.cpp +++ /dev/null @@ -1,1463 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/univ/notebook.cpp -// Purpose: wxNotebook implementation -// Author: Vadim Zeitlin -// Modified by: -// Created: 01.02.01 -// RCS-ID: $Id: notebook.cpp 50855 2007-12-20 10:51:33Z JS $ -// Copyright: (c) 2001 SciTech Software, Inc. (www.scitechsoft.com) -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_NOTEBOOK - -#include "wx/notebook.h" - -#ifndef WX_PRECOMP - #include "wx/dcmemory.h" -#endif - -#include "wx/imaglist.h" -#include "wx/spinbutt.h" - -#include "wx/univ/renderer.h" - -// ---------------------------------------------------------------------------- -// wxStdNotebookInputHandler: translates SPACE and ENTER keys and the left mouse -// click into button press/release actions -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxStdNotebookInputHandler : public wxStdInputHandler -{ -public: - wxStdNotebookInputHandler(wxInputHandler *inphand); - - virtual bool HandleKey(wxInputConsumer *consumer, - const wxKeyEvent& event, - bool pressed); - virtual bool HandleMouse(wxInputConsumer *consumer, - const wxMouseEvent& event); - virtual bool HandleMouseMove(wxInputConsumer *consumer, const wxMouseEvent& event); - virtual bool HandleFocus(wxInputConsumer *consumer, const wxFocusEvent& event); - virtual bool HandleActivation(wxInputConsumer *consumer, bool activated); - -protected: - void HandleFocusChange(wxInputConsumer *consumer); -}; - -// ---------------------------------------------------------------------------- -// macros -// ---------------------------------------------------------------------------- - -#if 0 -// due to unsigned type nPage is always >= 0 -#define IS_VALID_PAGE(nPage) (((nPage) >= 0) && ((size_t(nPage)) < GetPageCount())) -#else -#define IS_VALID_PAGE(nPage) (((size_t)nPage) < GetPageCount()) -#endif - -// ---------------------------------------------------------------------------- -// constants -// ---------------------------------------------------------------------------- - -static const size_t INVALID_PAGE = (size_t)-1; - -DEFINE_EVENT_TYPE(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING) - -// ---------------------------------------------------------------------------- -// private classes -// ---------------------------------------------------------------------------- - -class wxNotebookSpinBtn : public wxSpinButton -{ -public: - wxNotebookSpinBtn(wxNotebook *nb) - : wxSpinButton(nb, wxID_ANY, - wxDefaultPosition, wxDefaultSize, - nb->IsVertical() ? wxSP_VERTICAL : wxSP_HORIZONTAL) - { - m_nb = nb; - } - -protected: - void OnSpin(wxSpinEvent& event) - { - m_nb->PerformAction(wxACTION_NOTEBOOK_GOTO, event.GetPosition()); - } - -private: - wxNotebook *m_nb; - - DECLARE_EVENT_TABLE() -}; - -BEGIN_EVENT_TABLE(wxNotebookSpinBtn, wxSpinButton) - EVT_SPIN(wxID_ANY, wxNotebookSpinBtn::OnSpin) -END_EVENT_TABLE() - -// ============================================================================ -// implementation -// ============================================================================ - -IMPLEMENT_DYNAMIC_CLASS(wxNotebook, wxBookCtrlBase) -IMPLEMENT_DYNAMIC_CLASS(wxNotebookEvent, wxCommandEvent) - -// ---------------------------------------------------------------------------- -// wxNotebook creation -// ---------------------------------------------------------------------------- - -void wxNotebook::Init() -{ - m_sel = INVALID_PAGE; - - m_heightTab = - m_widthMax = 0; - - m_firstVisible = - m_lastVisible = - m_lastFullyVisible = 0; - - m_offset = 0; - - m_spinbtn = NULL; -} - -bool wxNotebook::Create(wxWindow *parent, - wxWindowID id, - const wxPoint& pos, - const wxSize& size, - long style, - const wxString& name) -{ - if ( (style & wxBK_ALIGN_MASK) == wxBK_DEFAULT ) - style |= wxBK_TOP; - - if ( !wxControl::Create(parent, id, pos, size, style, - wxDefaultValidator, name) ) - return false; - - m_sizePad = GetRenderer()->GetTabPadding(); - - SetInitialSize(size); - - CreateInputHandler(wxINP_HANDLER_NOTEBOOK); - - return true; -} - -// ---------------------------------------------------------------------------- -// wxNotebook page titles and images -// ---------------------------------------------------------------------------- - -wxString wxNotebook::GetPageText(size_t nPage) const -{ - wxCHECK_MSG( IS_VALID_PAGE(nPage), wxEmptyString, _T("invalid notebook page") ); - - return m_titles[nPage]; -} - -bool wxNotebook::SetPageText(size_t nPage, const wxString& strText) -{ - wxCHECK_MSG( IS_VALID_PAGE(nPage), false, _T("invalid notebook page") ); - - if ( strText != m_titles[nPage] ) - { - m_accels[nPage] = FindAccelIndex(strText, &m_titles[nPage]); - - if ( FixedSizeTabs() ) - { - // it's enough to just reresh this one - RefreshTab(nPage); - } - else // var width tabs - { - // we need to resize the tab to fit the new string - ResizeTab(nPage); - } - } - - return true; -} - -int wxNotebook::GetPageImage(size_t nPage) const -{ - wxCHECK_MSG( IS_VALID_PAGE(nPage), wxNOT_FOUND, _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 - bool tabSizeChanges = nImage == -1 || m_images[nPage] == -1; - m_images[nPage] = nImage; - - if ( tabSizeChanges ) - RefreshAllTabs(); - else - RefreshTab(nPage); - } - - return true; -} - -wxNotebook::~wxNotebook() -{ -} - -// ---------------------------------------------------------------------------- -// wxNotebook page switching -// ---------------------------------------------------------------------------- - -int wxNotebook::DoSetSelection(size_t nPage, int flags) -{ - wxCHECK_MSG( IS_VALID_PAGE(nPage), wxNOT_FOUND, _T("invalid notebook page") ); - - if ( (size_t)nPage == m_sel ) - { - // don't do anything if there is nothing to do - return m_sel; - } - - if ( flags & SetSelection_SendEvent ) - { - if ( !SendPageChangingEvent(nPage) ) - { - // program doesn't allow the page change - return m_sel; - } - } - - // we need to change m_sel first, before calling RefreshTab() below as - // otherwise the previously selected tab wouldn't be redrawn properly under - // wxGTK which calls Refresh() immediately and not during the next event - // loop iteration as wxMSW does and as it should - size_t selOld = m_sel; - - m_sel = nPage; - - if ( selOld != INVALID_PAGE ) - { - RefreshTab(selOld, true /* this tab was selected */); - - m_pages[selOld]->Hide(); - } - - if ( m_sel != INVALID_PAGE ) // this is impossible - but test nevertheless - { - if ( HasSpinBtn() ) - { - // keep it in sync - m_spinbtn->SetValue(m_sel); - } - - if ( m_sel < m_firstVisible ) - { - // selection is to the left of visible part of tabs - ScrollTo(m_sel); - } - else if ( m_sel > m_lastFullyVisible ) - { - // selection is to the right of visible part of tabs - ScrollLastTo(m_sel); - } - else // we already see this tab - { - // no need to scroll - RefreshTab(m_sel); - } - - m_pages[m_sel]->SetSize(GetPageRect()); - m_pages[m_sel]->Show(); - } - - if ( flags & SetSelection_SendEvent ) - { - // event handling - SendPageChangedEvent(selOld); - } - - return selOld; -} - -// ---------------------------------------------------------------------------- -// wxNotebook pages adding/deleting -// ---------------------------------------------------------------------------- - -bool wxNotebook::InsertPage(size_t nPage, - wxNotebookPage *pPage, - const wxString& strText, - bool bSelect, - int imageId) -{ - size_t nPages = GetPageCount(); - wxCHECK_MSG( nPage == nPages || IS_VALID_PAGE(nPage), false, - _T("invalid notebook page in InsertPage()") ); - - // modify the data - m_pages.Insert(pPage, nPage); - - wxString label; - m_accels.Insert(FindAccelIndex(strText, &label), nPage); - m_titles.Insert(label, nPage); - - m_images.Insert(imageId, nPage); - - // cache the tab geometry here - wxSize sizeTab = CalcTabSize(nPage); - - if ( sizeTab.y > m_heightTab ) - m_heightTab = sizeTab.y; - - if ( FixedSizeTabs() && sizeTab.x > m_widthMax ) - m_widthMax = sizeTab.x; - - m_widths.Insert(sizeTab.x, nPage); - - // spin button may appear if we didn't have it before - but even if we did, - // its range should change, so update it unconditionally - UpdateSpinBtn(); - - // if the tab has just appeared, we have to relayout everything, otherwise - // it's enough to just redraw the tabs - if ( nPages == 0 ) - { - // always select the first tab to have at least some selection - bSelect = true; - - Relayout(); - Refresh(); - } - else // not the first tab - { - RefreshAllTabs(); - } - - if ( bSelect ) - { - SetSelection(nPage); - } - else // pages added to the notebook are initially hidden - { - pPage->Hide(); - } - - return true; -} - -bool wxNotebook::DeleteAllPages() -{ - if ( !wxNotebookBase::DeleteAllPages() ) - return false; - - // clear the other arrays as well - m_titles.Clear(); - m_images.Clear(); - m_accels.Clear(); - m_widths.Clear(); - - // it is not valid any longer - m_sel = INVALID_PAGE; - - // spin button is not needed any more - UpdateSpinBtn(); - - Relayout(); - - return true; -} - -wxNotebookPage *wxNotebook::DoRemovePage(size_t nPage) -{ - wxCHECK_MSG( IS_VALID_PAGE(nPage), NULL, _T("invalid notebook page") ); - - wxNotebookPage *page = m_pages[nPage]; - m_pages.RemoveAt(nPage); - m_titles.RemoveAt(nPage); - m_accels.RemoveAt(nPage); - m_widths.RemoveAt(nPage); - m_images.RemoveAt(nPage); - - // the spin button might not be needed any more - // 2002-08-12 'if' commented out by JACS on behalf - // of Hans Van Leemputten who - // points out that UpdateSpinBtn should always be called, - // to ensure m_lastVisible is up to date. - // if ( HasSpinBtn() ) - { - UpdateSpinBtn(); - } - - size_t count = GetPageCount(); - if ( count ) - { - if ( m_sel == (size_t)nPage ) - { - // avoid sending event to this page which doesn't exist in the - // notebook any more - m_sel = INVALID_PAGE; - - SetSelection(nPage == count ? nPage - 1 : nPage); - } - else if ( m_sel > (size_t)nPage ) - { - // no need to change selection, just adjust the index - m_sel--; - } - } - else // no more tabs left - { - m_sel = INVALID_PAGE; - } - - // have to refresh everything - Relayout(); - - return page; -} - -// ---------------------------------------------------------------------------- -// wxNotebook drawing -// ---------------------------------------------------------------------------- - -void wxNotebook::RefreshCurrent() -{ - if ( m_sel != INVALID_PAGE ) - { - RefreshTab(m_sel); - } -} - -void wxNotebook::RefreshTab(int page, bool forceSelected) -{ - wxCHECK_RET( IS_VALID_PAGE(page), _T("invalid notebook page") ); - - wxRect rect = GetTabRect(page); - if ( forceSelected || ((size_t)page == m_sel) ) - { - const wxSize indent = GetRenderer()->GetTabIndent(); - rect.Inflate(indent.x, indent.y); - } - - RefreshRect(rect); -} - -void wxNotebook::RefreshAllTabs() -{ - wxRect rect = GetAllTabsRect(); - if ( rect.width || rect.height ) - { - RefreshRect(rect); - } - //else: we don't have tabs at all -} - -void wxNotebook::DoDrawTab(wxDC& dc, const wxRect& rect, size_t n) -{ - wxBitmap bmp; - if ( HasImage(n) ) - { - int image = m_images[n]; - - // Not needed now that wxGenericImageList is being - // used for wxUniversal under MSW -#if 0 // def __WXMSW__ // FIXME - int w, h; - m_imageList->GetSize(n, w, h); - bmp.Create(w, h); - wxMemoryDC dc; - dc.SelectObject(bmp); - dc.SetBackground(wxBrush(GetBackgroundColour(), wxSOLID)); - m_imageList->Draw(image, dc, 0, 0, wxIMAGELIST_DRAW_NORMAL, true); - dc.SelectObject(wxNullBitmap); -#else - bmp = m_imageList->GetBitmap(image); -#endif - } - - int flags = 0; - if ( n == m_sel ) - { - flags |= wxCONTROL_SELECTED; - - if ( IsFocused() ) - flags |= wxCONTROL_FOCUSED; - } - - GetRenderer()->DrawTab - ( - dc, - rect, - GetTabOrientation(), - m_titles[n], - bmp, - flags, - m_accels[n] - ); -} - -void wxNotebook::DoDraw(wxControlRenderer *renderer) -{ - //wxRect rectUpdate = GetUpdateClientRect(); -- unused - - wxDC& dc = renderer->GetDC(); - dc.SetFont(GetFont()); - dc.SetTextForeground(GetForegroundColour()); - - // redraw the border - it's simpler to always do it instead of checking - // whether this needs to be done - GetRenderer()->DrawBorder(dc, wxBORDER_RAISED, GetPagePart()); - - // avoid overwriting the spin button - if ( HasSpinBtn() ) - { - wxRect rectTabs = GetAllTabsRect(); - wxSize sizeSpinBtn = m_spinbtn->GetSize(); - - if ( IsVertical() ) - { - rectTabs.height -= sizeSpinBtn.y; - - // Allow for erasing the line under selected tab - rectTabs.width += 2; - } - else - { - rectTabs.width -= sizeSpinBtn.x; - - // Allow for erasing the line under selected tab - rectTabs.height += 2; - } - - dc.SetClippingRegion(rectTabs); - } - - wxRect rect = GetTabsPart(); - bool isVertical = IsVertical(); - - wxRect rectSel; - for ( size_t n = m_firstVisible; n < m_lastVisible; n++ ) - { - GetTabSize(n, &rect.width, &rect.height); - - if ( n == m_sel ) - { - // don't redraw it now as this tab has to be drawn over the other - // ones as it takes more place and spills over to them - rectSel = rect; - } - else // not selected tab - { - // unfortunately we can't do this because the selected tab hangs - // over its neighbours and so we might need to refresh more tabs - - // of course, we could still avoid rereshing some of them with more - // complicated checks, but it doesn't seem too bad to refresh all - // of them, I still don't see flicker, so leaving as is for now - - //if ( rectUpdate.Intersects(rect) ) - { - DoDrawTab(dc, rect, n); - } - //else: doesn't need to be refreshed - } - - // move the rect to the next tab - if ( isVertical ) - rect.y += rect.height; - else - rect.x += rect.width; - } - - // now redraw the selected tab - if ( rectSel.width ) - { - DoDrawTab(dc, rectSel, m_sel); - } - - dc.DestroyClippingRegion(); -} - -// ---------------------------------------------------------------------------- -// wxNotebook geometry -// ---------------------------------------------------------------------------- - -int wxNotebook::HitTest(const wxPoint& pt, long *flags) const -{ - if ( flags ) - *flags = wxBK_HITTEST_NOWHERE; - - // first check that it is in this window at all - if ( !GetClientRect().Contains(pt) ) - { - return -1; - } - - wxRect rectTabs = GetAllTabsRect(); - - switch ( GetTabOrientation() ) - { - default: - wxFAIL_MSG(_T("unknown tab orientation")); - // fall through - - case wxTOP: - if ( pt.y > rectTabs.GetBottom() ) - return -1; - break; - - case wxBOTTOM: - if ( pt.y < rectTabs.y ) - return -1; - break; - - case wxLEFT: - if ( pt.x > rectTabs.GetRight() ) - return -1; - break; - - case wxRIGHT: - if ( pt.x < rectTabs.x ) - return -1; - break; - } - - for ( size_t n = m_firstVisible; n < m_lastVisible; n++ ) - { - GetTabSize(n, &rectTabs.width, &rectTabs.height); - - if ( rectTabs.Contains(pt) ) - { - if ( flags ) - { - // TODO: be more precise - *flags = wxBK_HITTEST_ONITEM; - } - - return n; - } - - // move the rectTabs to the next tab - if ( IsVertical() ) - rectTabs.y += rectTabs.height; - else - rectTabs.x += rectTabs.width; - } - - return -1; -} - -bool wxNotebook::IsVertical() const -{ - wxDirection dir = GetTabOrientation(); - - return dir == wxLEFT || dir == wxRIGHT; -} - -wxDirection wxNotebook::GetTabOrientation() const -{ - long style = GetWindowStyle(); - if ( style & wxBK_BOTTOM ) - return wxBOTTOM; - else if ( style & wxBK_RIGHT ) - return wxRIGHT; - else if ( style & wxBK_LEFT ) - return wxLEFT; - - // wxBK_TOP == 0 so we don't have to test for it - return wxTOP; -} - -wxRect wxNotebook::GetTabRect(int page) const -{ - wxRect rect; - wxCHECK_MSG( IS_VALID_PAGE(page), rect, _T("invalid notebook page") ); - - // calc the size of this tab and of the preceding ones - wxCoord widthThis, widthBefore; - if ( FixedSizeTabs() ) - { - widthThis = m_widthMax; - widthBefore = page*m_widthMax; - } - else - { - widthBefore = 0; - for ( int n = 0; n < page; n++ ) - { - widthBefore += m_widths[n]; - } - - widthThis = m_widths[page]; - } - - rect = GetTabsPart(); - if ( IsVertical() ) - { - rect.y += widthBefore - m_offset; - rect.height = widthThis; - } - else // horz - { - rect.x += widthBefore - m_offset; - rect.width = widthThis; - } - - return rect; -} - -wxRect wxNotebook::GetAllTabsRect() const -{ - wxRect rect; - - if ( GetPageCount() ) - { - const wxSize indent = GetRenderer()->GetTabIndent(); - wxSize size = GetClientSize(); - - if ( IsVertical() ) - { - rect.width = m_heightTab + indent.x; - rect.x = GetTabOrientation() == wxLEFT ? 0 : size.x - rect.width; - rect.y = 0; - rect.height = size.y; - } - else // horz - { - rect.x = 0; - rect.width = size.x; - rect.height = m_heightTab + indent.y; - rect.y = GetTabOrientation() == wxTOP ? 0 : size.y - rect.height; - } - } - //else: no pages - - return rect; -} - -wxRect wxNotebook::GetTabsPart() const -{ - wxRect rect = GetAllTabsRect(); - - wxDirection dir = GetTabOrientation(); - - const wxSize indent = GetRenderer()->GetTabIndent(); - if ( IsVertical() ) - { - rect.y += indent.x; - if ( dir == wxLEFT ) - { - rect.x += indent.y; - rect.width -= indent.y; - } - else // wxRIGHT - { - rect.width -= indent.y; - } - } - else // horz - { - rect.x += indent.x; - if ( dir == wxTOP ) - { - rect.y += indent.y; - rect.height -= indent.y; - } - else // wxBOTTOM - { - rect.height -= indent.y; - } - } - - return rect; -} - -void wxNotebook::GetTabSize(int page, wxCoord *w, wxCoord *h) const -{ - wxCHECK_RET( w && h, _T("NULL pointer in GetTabSize") ); - - if ( IsVertical() ) - { - // width and height have inverted meaning - wxCoord *tmp = w; - w = h; - h = tmp; - } - - // height is always fixed - *h = m_heightTab; - - // width may also be fixed and be the same for all tabs - *w = GetTabWidth(page); -} - -void wxNotebook::SetTabSize(const wxSize& sz) -{ - wxCHECK_RET( FixedSizeTabs(), _T("SetTabSize() ignored") ); - - if ( IsVertical() ) - { - m_heightTab = sz.x; - m_widthMax = sz.y; - } - else // horz - { - m_widthMax = sz.x; - m_heightTab = sz.y; - } -} - -wxSize wxNotebook::CalcTabSize(int page) const -{ - // NB: don't use m_widthMax, m_heightTab or m_widths here because this - // method is called to calculate them - - wxSize size; - - wxCHECK_MSG( IS_VALID_PAGE(page), size, _T("invalid notebook page") ); - - GetTextExtent(m_titles[page], &size.x, &size.y); - - if ( HasImage(page) ) - { - wxSize sizeImage; - m_imageList->GetSize(m_images[page], sizeImage.x, sizeImage.y); - - size.x += sizeImage.x + 5; // FIXME: hard coded margin - - if ( sizeImage.y > size.y ) - size.y = sizeImage.y; - } - - size.x += 2*m_sizePad.x; - size.y += 2*m_sizePad.y; - - return size; -} - -void wxNotebook::ResizeTab(int page) -{ - wxSize sizeTab = CalcTabSize(page); - - // we only need full relayout if the page size changes - bool needsRelayout = false; - - if ( IsVertical() ) - { - // swap coordinates - wxCoord tmp = sizeTab.x; - sizeTab.x = sizeTab.y; - sizeTab.y = tmp; - } - - if ( sizeTab.y > m_heightTab ) - { - needsRelayout = true; - - m_heightTab = sizeTab.y; - } - - m_widths[page] = sizeTab.x; - - if ( sizeTab.x > m_widthMax ) - m_widthMax = sizeTab.x; - - // the total of the tabs has changed too - UpdateSpinBtn(); - - if ( needsRelayout ) - Relayout(); - else - RefreshAllTabs(); -} - -void wxNotebook::SetPadding(const wxSize& padding) -{ - if ( padding != m_sizePad ) - { - m_sizePad = padding; - - Relayout(); - } -} - -void wxNotebook::Relayout() -{ - if ( GetPageCount() ) - { - RefreshAllTabs(); - - UpdateSpinBtn(); - - if ( m_sel != INVALID_PAGE ) - { - // resize the currently shown page - wxRect rectPage = GetPageRect(); - - m_pages[m_sel]->SetSize(rectPage); - - // also scroll it into view if needed (note that m_lastVisible - // was updated by the call to UpdateSpinBtn() above, this is why it - // is needed here) - if ( HasSpinBtn() ) - { - if ( m_sel < m_firstVisible ) - { - // selection is to the left of visible part of tabs - ScrollTo(m_sel); - } - else if ( m_sel > m_lastFullyVisible ) - { - // selection is to the right of visible part of tabs - ScrollLastTo(m_sel); - } - } - } - } - else // we have no pages - { - // just refresh everything - Refresh(); - } -} - -wxRect wxNotebook::GetPagePart() const -{ - wxRect rectPage = GetClientRect(); - - if ( GetPageCount() ) - { - wxRect rectTabs = GetAllTabsRect(); - wxDirection dir = GetTabOrientation(); - if ( IsVertical() ) - { - rectPage.width -= rectTabs.width; - if ( dir == wxLEFT ) - rectPage.x += rectTabs.width; - } - else // horz - { - rectPage.height -= rectTabs.height; - if ( dir == wxTOP ) - rectPage.y += rectTabs.height; - } - } - //else: no pages at all - - return rectPage; -} - -wxRect wxNotebook::GetPageRect() const -{ - wxRect rect = GetPagePart(); - - // leave space for the border - wxRect rectBorder = GetRenderer()->GetBorderDimensions(wxBORDER_RAISED); - - // FIXME: hardcoded +2! - rect.Inflate(-(rectBorder.x + rectBorder.width + 2), - -(rectBorder.y + rectBorder.height + 2)); - - return rect; -} - -wxSize wxNotebook::GetSizeForPage(const wxSize& size) const -{ - wxSize sizeNb = size; - wxRect rect = GetAllTabsRect(); - if ( IsVertical() ) - sizeNb.x += rect.width; - else - sizeNb.y += rect.height; - - return sizeNb; -} - -void wxNotebook::SetPageSize(const wxSize& size) -{ - SetClientSize(GetSizeForPage(size)); -} - -wxSize wxNotebook::CalcSizeFromPage(const wxSize& sizePage) const -{ - return AdjustSize(GetSizeForPage(sizePage)); -} - -// ---------------------------------------------------------------------------- -// wxNotebook spin button -// ---------------------------------------------------------------------------- - -bool wxNotebook::HasSpinBtn() const -{ - return m_spinbtn && m_spinbtn->IsShown(); -} - -void wxNotebook::CalcLastVisibleTab() -{ - bool isVertical = IsVertical(); - - wxCoord width = GetClientSize().x; - - wxRect rect = GetTabsPart(); - - size_t count = GetPageCount(); - - wxCoord widthLast = 0; - size_t n; - for ( n = m_firstVisible; n < count; n++ ) - { - GetTabSize(n, &rect.width, &rect.height); - if ( rect.GetRight() > width ) - { - break; - } - - // remember it to use below - widthLast = rect.GetRight(); - - // move the rect to the next tab - if ( isVertical ) - rect.y += rect.height; - else - rect.x += rect.width; - } - - if ( n == m_firstVisible ) - { - // even the first tab isn't fully visible - but still pretend it is as - // we have to show something - m_lastFullyVisible = m_firstVisible; - } - else // more than one tab visible - { - m_lastFullyVisible = n - 1; - - // but is it really fully visible? it shouldn't overlap with the spin - // button if it is present (again, even if the first button does - // overlap with it, we pretend that it doesn't as there is not much - // else we can do) - if ( (m_lastFullyVisible > m_firstVisible) && HasSpinBtn() ) - { - // adjust width to be the width before the spin button - wxSize sizeSpinBtn = m_spinbtn->GetSize(); - if ( IsVertical() ) - width -= sizeSpinBtn.y; - else - width -= sizeSpinBtn.x; - - if ( widthLast > width ) - { - // the last button overlaps with spin button, so take he - // previous one - m_lastFullyVisible--; - } - } - } - - if ( n == count ) - { - // everything is visible - m_lastVisible = n; - } - else - { - // this tab is still (partially) visible, so m_lastVisible is the - // next tab (remember, this is "exclusive" last) - m_lastVisible = n + 1; - - } -} - -void wxNotebook::UpdateSpinBtn() -{ - // first decide if we need a spin button - bool allTabsShown; - - size_t count = (size_t)GetPageCount(); - if ( count == 0 ) - { - // this case is special, get rid of it immediately: everything is - // visible and we don't need any spin buttons - allTabsShown = true; - - // have to reset them manually as we don't call CalcLastVisibleTab() - m_firstVisible = - m_lastVisible = - m_lastFullyVisible = 0; - } - else - { - CalcLastVisibleTab(); - - // if all tabs after the first visible one are shown, it doesn't yet - // mean that all tabs are shown - so we go backwards until we arrive to - // the beginning (then all tabs are indeed shown) or find a tab such - // that not all tabs after it are shown - while ( (m_lastFullyVisible == count - 1) && (m_firstVisible > 0) ) - { - // this is equivalent to ScrollTo(m_firstVisible - 1) but more - // efficient - m_offset -= GetTabWidth(m_firstVisible--); - - // reclaculate after m_firstVisible change - CalcLastVisibleTab(); - } - - allTabsShown = m_lastFullyVisible == count - 1; - } - - if ( !allTabsShown ) - { - if ( !m_spinbtn ) - { - // create it once only - m_spinbtn = new wxNotebookSpinBtn(this); - - // set the correct value to keep it in sync - m_spinbtn->SetValue(m_sel); - } - - // position it correctly - PositionSpinBtn(); - - // and show it - m_spinbtn->Show(); - - // also set/update the range - m_spinbtn->SetRange(0, count - 1); - - // update m_lastFullyVisible once again as it might have changed - // because the spin button appeared - // - // FIXME: might do it more efficiently - CalcLastVisibleTab(); - } - else // all tabs are visible, we don't need spin button - { - if ( m_spinbtn && m_spinbtn -> IsShown() ) - { - m_spinbtn->Hide(); - } - } -} - -void wxNotebook::PositionSpinBtn() -{ - if ( !m_spinbtn ) - return; - - wxCoord wBtn, hBtn; - m_spinbtn->GetSize(&wBtn, &hBtn); - - wxRect rectTabs = GetAllTabsRect(); - - wxCoord x, y; - switch ( GetTabOrientation() ) - { - default: - wxFAIL_MSG(_T("unknown tab orientation")); - // fall through - - case wxTOP: - x = rectTabs.GetRight() - wBtn; - y = rectTabs.GetBottom() - hBtn; - break; - - case wxBOTTOM: - x = rectTabs.GetRight() - wBtn; - y = rectTabs.GetTop(); - break; - - case wxLEFT: - x = rectTabs.GetRight() - wBtn; - y = rectTabs.GetBottom() - hBtn; - break; - - case wxRIGHT: - x = rectTabs.GetLeft(); - y = rectTabs.GetBottom() - hBtn; - break; - } - - m_spinbtn->Move(x, y); -} - -// ---------------------------------------------------------------------------- -// wxNotebook scrolling -// ---------------------------------------------------------------------------- - -void wxNotebook::ScrollTo(int page) -{ - wxCHECK_RET( IS_VALID_PAGE(page), _T("invalid notebook page") ); - - // set the first visible tab and offset (easy) - m_firstVisible = (size_t)page; - m_offset = 0; - for ( size_t n = 0; n < m_firstVisible; n++ ) - { - m_offset += GetTabWidth(n); - } - - // find the last visible tab too - CalcLastVisibleTab(); - - RefreshAllTabs(); -} - -void wxNotebook::ScrollLastTo(int page) -{ - wxCHECK_RET( IS_VALID_PAGE(page), _T("invalid notebook page") ); - - // go backwards until we find the first tab which can be made visible - // without hiding the given one - wxSize size = GetClientSize(); - wxCoord widthAll = IsVertical() ? size.y : size.x, - widthTabs = GetTabWidth(page); - - // the total width is less than the width of the window if we have the spin - // button - if ( HasSpinBtn() ) - { - wxSize sizeSpinBtn = m_spinbtn->GetSize(); - if ( IsVertical() ) - widthAll -= sizeSpinBtn.y; - else - widthAll -= sizeSpinBtn.x; - } - - m_firstVisible = page; - while ( (m_firstVisible > 0) && (widthTabs <= widthAll) ) - { - widthTabs += GetTabWidth(--m_firstVisible); - } - - if ( widthTabs > widthAll ) - { - // take one step back (that it is forward) if we can - if ( m_firstVisible < (size_t)GetPageCount() - 1 ) - m_firstVisible++; - } - - // go to it - ScrollTo(m_firstVisible); - - // consitency check: the page we were asked to show should be shown - wxASSERT_MSG( (size_t)page < m_lastVisible, _T("bug in ScrollLastTo") ); -} - -// ---------------------------------------------------------------------------- -// wxNotebook sizing/moving -// ---------------------------------------------------------------------------- - -wxSize wxNotebook::DoGetBestClientSize() const -{ - // calculate the max page size - wxSize size; - - 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 GetSizeForPage(size); -} - -void wxNotebook::DoMoveWindow(int x, int y, int width, int height) -{ - wxControl::DoMoveWindow(x, y, width, height); - - // move the spin ctrl too (NOP if it doesn't exist) - PositionSpinBtn(); -} - -void wxNotebook::DoSetSize(int x, int y, - int width, int height, - int sizeFlags) -{ - wxSize old_client_size = GetClientSize(); - - wxControl::DoSetSize(x, y, width, height, sizeFlags); - - wxSize new_client_size = GetClientSize(); - - if (old_client_size != new_client_size) - Relayout(); -} - -// ---------------------------------------------------------------------------- -// wxNotebook input processing -// ---------------------------------------------------------------------------- - -bool wxNotebook::PerformAction(const wxControlAction& action, - long numArg, - const wxString& strArg) -{ - if ( action == wxACTION_NOTEBOOK_NEXT ) - SetSelection(GetNextPage(true)); - else if ( action == wxACTION_NOTEBOOK_PREV ) - SetSelection(GetNextPage(false)); - else if ( action == wxACTION_NOTEBOOK_GOTO ) - SetSelection((int)numArg); - else - return wxControl::PerformAction(action, numArg, strArg); - - return true; -} - -/* static */ -wxInputHandler *wxNotebook::GetStdInputHandler(wxInputHandler *handlerDef) -{ - static wxStdNotebookInputHandler s_handler(handlerDef); - - return &s_handler; -} - -// ---------------------------------------------------------------------------- -// wxStdNotebookInputHandler -// ---------------------------------------------------------------------------- - -wxStdNotebookInputHandler::wxStdNotebookInputHandler(wxInputHandler *inphand) - : wxStdInputHandler(inphand) -{ -} - -bool wxStdNotebookInputHandler::HandleKey(wxInputConsumer *consumer, - const wxKeyEvent& event, - bool pressed) -{ - // ignore the key releases - if ( pressed ) - { - wxNotebook *notebook = wxStaticCast(consumer->GetInputWindow(), wxNotebook); - - int page = 0; - wxControlAction action; - switch ( event.GetKeyCode() ) - { - case WXK_UP: - if ( notebook->IsVertical() ) - action = wxACTION_NOTEBOOK_PREV; - break; - - case WXK_LEFT: - if ( !notebook->IsVertical() ) - action = wxACTION_NOTEBOOK_PREV; - break; - - case WXK_DOWN: - if ( notebook->IsVertical() ) - action = wxACTION_NOTEBOOK_NEXT; - break; - - case WXK_RIGHT: - if ( !notebook->IsVertical() ) - action = wxACTION_NOTEBOOK_NEXT; - break; - - case WXK_HOME: - action = wxACTION_NOTEBOOK_GOTO; - // page = 0; -- already has this value - break; - - case WXK_END: - action = wxACTION_NOTEBOOK_GOTO; - page = notebook->GetPageCount() - 1; - break; - } - - if ( !action.IsEmpty() ) - { - return consumer->PerformAction(action, page); - } - } - - return wxStdInputHandler::HandleKey(consumer, event, pressed); -} - -bool wxStdNotebookInputHandler::HandleMouse(wxInputConsumer *consumer, - const wxMouseEvent& event) -{ - if ( event.ButtonDown(1) ) - { - wxNotebook *notebook = wxStaticCast(consumer->GetInputWindow(), wxNotebook); - int page = notebook->HitTest(event.GetPosition()); - if ( page != -1 ) - { - consumer->PerformAction(wxACTION_NOTEBOOK_GOTO, page); - - return false; - } - } - - return wxStdInputHandler::HandleMouse(consumer, event); -} - -bool wxStdNotebookInputHandler::HandleMouseMove(wxInputConsumer *consumer, - const wxMouseEvent& event) -{ - return wxStdInputHandler::HandleMouseMove(consumer, event); -} - -bool -wxStdNotebookInputHandler::HandleFocus(wxInputConsumer *consumer, - const wxFocusEvent& WXUNUSED(event)) -{ - HandleFocusChange(consumer); - - return false; -} - -bool wxStdNotebookInputHandler::HandleActivation(wxInputConsumer *consumer, - bool WXUNUSED(activated)) -{ - // we react to the focus change in the same way as to the [de]activation - HandleFocusChange(consumer); - - return false; -} - -void wxStdNotebookInputHandler::HandleFocusChange(wxInputConsumer *consumer) -{ - wxNotebook *notebook = wxStaticCast(consumer->GetInputWindow(), wxNotebook); - notebook->RefreshCurrent(); -} - -#endif // wxUSE_NOTEBOOK diff --git a/wxWidgets/src/univ/radiobox.cpp b/wxWidgets/src/univ/radiobox.cpp deleted file mode 100644 index 4c37bf3fba..0000000000 --- a/wxWidgets/src/univ/radiobox.cpp +++ /dev/null @@ -1,526 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/univ/radiobox.cpp -// Purpose: wxRadioBox implementation -// Author: Vadim Zeitlin -// Modified by: -// Created: 11.09.00 -// RCS-ID: $Id: radiobox.cpp 39517 2006-06-01 20:52:09Z ABX $ -// Copyright: (c) 2000 SciTech Software, Inc. (www.scitechsoft.com) -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_RADIOBOX - -#include "wx/radiobox.h" - -#ifndef WX_PRECOMP - #include "wx/dcclient.h" - #include "wx/radiobut.h" - #include "wx/validate.h" - #include "wx/arrstr.h" -#endif - -#include "wx/tooltip.h" - -#include "wx/univ/theme.h" -#include "wx/univ/renderer.h" -#include "wx/univ/inphand.h" -#include "wx/univ/colschem.h" - -// ---------------------------------------------------------------------------- -// constants -// ---------------------------------------------------------------------------- - -static const int BUTTON_BORDER_X = 2; -static const int BUTTON_BORDER_Y = 4; - -static const int BOX_BORDER_X = 2; -static const int BOX_BORDER_Y = 2; - -// ---------------------------------------------------------------------------- -// wxRadioBox event handler -// ---------------------------------------------------------------------------- - -class wxRadioHookHandler : public wxEvtHandler -{ -public: - wxRadioHookHandler(wxRadioBox *radio) { m_radio = radio; } - - virtual bool ProcessEvent(wxEvent& event) - { - // we intercept the command events from radio buttons - if ( event.GetEventType() == wxEVT_COMMAND_RADIOBUTTON_SELECTED ) - { - m_radio->OnRadioButton(event); - } - else if ( event.GetEventType() == wxEVT_KEY_DOWN ) - { - if ( m_radio->OnKeyDown((wxKeyEvent &)event) ) - { - return true; - } - } - - // just pass it on - return GetNextHandler()->ProcessEvent(event); - } - -private: - wxRadioBox *m_radio; -}; - -// ============================================================================ -// implementation -// ============================================================================ - -IMPLEMENT_DYNAMIC_CLASS(wxRadioBox, wxControl) - -// ---------------------------------------------------------------------------- -// wxRadioBox creation -// ---------------------------------------------------------------------------- - -void wxRadioBox::Init() -{ - m_selection = -1; -} - -wxRadioBox::wxRadioBox(wxWindow *parent, wxWindowID id, const wxString& title, - const wxPoint& pos, const wxSize& size, - const wxArrayString& choices, - int majorDim, long style, - const wxValidator& val, const wxString& name) -{ - wxCArrayString chs(choices); - - Init(); - - (void)Create(parent, id, title, pos, size, chs.GetCount(), - chs.GetStrings(), majorDim, style, val, name); -} - -bool wxRadioBox::Create(wxWindow *parent, - wxWindowID id, - const wxString& title, - 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, title, pos, size, chs.GetCount(), - chs.GetStrings(), majorDim, style, val, name); -} - -bool wxRadioBox::Create(wxWindow *parent, - wxWindowID id, - const wxString& title, - const wxPoint& pos, - const wxSize& size, - int n, - const wxString *choices, - int majorDim, - long style, - const wxValidator& wxVALIDATOR_PARAM(val), - const wxString& name) -{ - // for compatibility with the other ports which don't handle (yet?) - // wxRA_LEFTTORIGHT and wxRA_TOPTOBOTTOM flags, we add them ourselves if - // not specified - if ( !(style & (wxRA_LEFTTORIGHT | wxRA_TOPTOBOTTOM)) ) - { - // horizontal radiobox use left to right layout - if ( style & wxRA_HORIZONTAL ) - { - style |= wxRA_LEFTTORIGHT; - } - else if ( style & wxRA_VERTICAL ) - { - style |= wxRA_TOPTOBOTTOM; - } - else - { - wxFAIL_MSG( _T("you must specify wxRA_XXX style!") ); - - // use default - style = wxRA_HORIZONTAL | wxRA_LEFTTORIGHT; - } - } - - if ( !wxStaticBox::Create(parent, id, title, pos, size, style, name) ) - return false; - -#if wxUSE_VALIDATORS - SetValidator(val); -#endif // wxUSE_VALIDATORS - - Append(n, choices); - - // majorDim default value is 0 which means make one row/column - SetMajorDim(majorDim == 0 ? n : majorDim, style); - - if ( size == wxDefaultSize ) - { - SetClientSize(DoGetBestClientSize()); - } - - // Need to move the radiobox in order to move the radio buttons - wxPoint actualPos = GetPosition(); - wxSize actualSize = GetSize(); - DoMoveWindow(actualPos.x, actualPos.y, actualSize.x, actualSize.y); - - // radiobox should already have selection so select at least one item - SetSelection(0); - - return true; -} - -wxRadioBox::~wxRadioBox() -{ - // remove the event handlers we pushed on them from all buttons and delete - // the buttons themselves: this must be done as the user code expects them - // to disappear now and not some time later when they will be deleted by - // our (common) parent - unsigned int count = m_buttons.GetCount(); - for ( unsigned int n = 0; n < count; n++ ) - { - m_buttons[n]->PopEventHandler(true /* delete it */); - - delete m_buttons[n]; - } -} - -// ---------------------------------------------------------------------------- -// wxRadioBox init -// ---------------------------------------------------------------------------- - -void wxRadioBox::Append(int count, const wxString *choices) -{ - if ( !count ) - return; - - wxWindow *parent = GetParent(); - m_buttons.Alloc(count); - for ( int n = 0; n < count; n++ ) - { - // make the first button in the box the start of new group by giving it - // wxRB_GROUP style - wxRadioButton *btn = new wxRadioButton(parent, wxID_ANY, choices[n], - wxDefaultPosition, - wxDefaultSize, - n == 0 ? wxRB_GROUP : 0); - - // we want to get the events from the buttons to translate it into - btn->PushEventHandler(new wxRadioHookHandler(this)); - m_buttons.Add(btn); - } -} - -// ---------------------------------------------------------------------------- -// selection -// ---------------------------------------------------------------------------- - -void wxRadioBox::SetSelection(int n) -{ - wxCHECK_RET( IsValid(n), _T("invalid index in wxRadioBox::SetSelection") ); - - m_selection = n; - - wxRadioButton *btn = m_buttons[n]; - - // the selected button is always focused in the radiobox - btn->SetFocus(); - - // this will also unselect the previously selected button in our group - btn->SetValue(true); -} - -int wxRadioBox::GetSelection() const -{ - return m_selection; -} - -void wxRadioBox::SendRadioEvent() -{ - wxCHECK_RET( m_selection != -1, _T("no active radio button") ); - - wxCommandEvent event(wxEVT_COMMAND_RADIOBOX_SELECTED, GetId()); - InitCommandEvent(event); - event.SetInt(m_selection); - event.SetString(GetString(m_selection)); - - Command(event); -} - -void wxRadioBox::OnRadioButton(wxEvent& event) -{ - int n = m_buttons.Index((wxRadioButton *)event.GetEventObject()); - wxCHECK_RET( n != wxNOT_FOUND, _T("click from alien radio button") ); - - m_selection = n; - - SendRadioEvent(); -} - -// ---------------------------------------------------------------------------- -// methods forwarded to the buttons -// ---------------------------------------------------------------------------- - -wxString wxRadioBox::GetString(unsigned int n) const -{ - wxCHECK_MSG( IsValid(n), wxEmptyString, - _T("invalid index in wxRadioBox::GetString") ); - - return m_buttons[n]->GetLabel(); -} - -void wxRadioBox::SetString(unsigned int n, const wxString& label) -{ - wxCHECK_RET( IsValid(n), _T("invalid index in wxRadioBox::SetString") ); - - m_buttons[n]->SetLabel(label); -} - -bool wxRadioBox::Enable(unsigned int n, bool enable) -{ - wxCHECK_MSG( IsValid(n), false, _T("invalid index in wxRadioBox::Enable") ); - - return m_buttons[n]->Enable(enable); -} - -bool wxRadioBox::IsItemEnabled(unsigned int n) const -{ - wxCHECK_MSG( IsValid(n), false, _T("invalid index in wxRadioBox::IsItemEnabled") ); - - return m_buttons[n]->IsEnabled(); -} - -bool wxRadioBox::Show(unsigned int n, bool show) -{ - wxCHECK_MSG( IsValid(n), false, _T("invalid index in wxRadioBox::Show") ); - - return m_buttons[n]->Show(show); -} - -bool wxRadioBox::IsItemShown(unsigned int n) const -{ - wxCHECK_MSG( IsValid(n), false, _T("invalid index in wxRadioBox::IsItemShown") ); - - return m_buttons[n]->IsShown(); -} - -// ---------------------------------------------------------------------------- -// methods forwarded to the static box -// ---------------------------------------------------------------------------- - -bool wxRadioBox::Enable(bool enable) -{ - if ( !wxStaticBox::Enable(enable) ) - return false; - - // also enable/disable the buttons - const unsigned int count = m_buttons.GetCount(); - for ( unsigned int n = 0; n < count; n++ ) - { - Enable(n, enable); - } - - return true; -} - -bool wxRadioBox::Show(bool show) -{ - if ( !wxStaticBox::Show(show) ) - return false; - - // also show/hide the buttons - const unsigned int count = m_buttons.GetCount(); - for ( unsigned int n = 0; n < count; n++ ) - { - Show(n, show); - } - - return true; -} - -wxString wxRadioBox::GetLabel() const -{ - return wxStaticBox::GetLabel(); -} - -void wxRadioBox::SetLabel(const wxString& label) -{ - wxStaticBox::SetLabel(label); -} - -#if wxUSE_TOOLTIPS -void wxRadioBox::DoSetToolTip(wxToolTip *tooltip) -{ - wxControl::DoSetToolTip(tooltip); - - // Also set them for all Radio Buttons - const unsigned int count = m_buttons.GetCount(); - for ( unsigned int n = 0; n < count; n++ ) - { - if (tooltip) - m_buttons[n]->SetToolTip(tooltip->GetTip()); - else - m_buttons[n]->SetToolTip(NULL); - } -} -#endif // wxUSE_TOOLTIPS - -// ---------------------------------------------------------------------------- -// buttons positioning -// ---------------------------------------------------------------------------- - -wxSize wxRadioBox::GetMaxButtonSize() const -{ - int widthMax, heightMax, width = 0, height = 0; - widthMax = heightMax = 0; - - const unsigned int count = GetCount(); - for ( unsigned int n = 0; n < count; n++ ) - { - m_buttons[n]->GetBestSize(&width, &height); - - if ( width > widthMax ) - widthMax = width; - if ( height > heightMax ) - heightMax = height; - } - - return wxSize(widthMax + BUTTON_BORDER_X, heightMax + BUTTON_BORDER_Y); -} - -wxSize wxRadioBox::DoGetBestClientSize() const -{ - wxSize sizeBtn = GetMaxButtonSize(); - - sizeBtn.x *= GetColumnCount(); - sizeBtn.y *= GetRowCount(); - - // add a border around all buttons - sizeBtn.x += 2*BOX_BORDER_X; - sizeBtn.y += 2*BOX_BORDER_Y; - - // account for the area taken by static box - wxRect rect = GetBorderGeometry(); - sizeBtn.x += rect.x + rect.width; - sizeBtn.y += rect.y + rect.height; - - return sizeBtn; -} - -void wxRadioBox::DoMoveWindow(int x0, int y0, int width, int height) -{ - wxStaticBox::DoMoveWindow(x0, y0, width, height); - - wxSize sizeBtn = GetMaxButtonSize(); - wxPoint ptOrigin = GetBoxAreaOrigin(); - wxPoint clientOrigin = GetParent() ? GetParent()->GetClientAreaOrigin() : wxPoint(0,0); - - x0 += ptOrigin.x + BOX_BORDER_X - clientOrigin.x; - y0 += ptOrigin.y + BOX_BORDER_Y - clientOrigin.y; - - int x = x0, - y = y0; - - const unsigned int count = GetCount(); - for ( unsigned int n = 0; n < count; n++ ) - { - m_buttons[n]->SetSize(x, y, sizeBtn.x, sizeBtn.y); - - if ( GetWindowStyle() & wxRA_TOPTOBOTTOM ) - { - // from top to bottom - if ( (n + 1) % GetRowCount() ) - { - // continue in this column - y += sizeBtn.y; - } - else - { - // start a new column - x += sizeBtn.x; - y = y0; - } - } - else // wxRA_LEFTTORIGHT: mirror the code above - { - // from left to right - if ( (n + 1) % GetColumnCount() ) - { - // continue in this row - x += sizeBtn.x; - } - else - { - // start a new row - y += sizeBtn.y; - x = x0; - } - } - } -} - -// ---------------------------------------------------------------------------- -// keyboard navigation -// ---------------------------------------------------------------------------- - -bool wxRadioBox::OnKeyDown(wxKeyEvent& event) -{ - wxDirection dir; - switch ( event.GetKeyCode() ) - { - case WXK_UP: - dir = wxUP; - break; - - case WXK_LEFT: - dir = wxLEFT; - break; - - case WXK_DOWN: - dir = wxDOWN; - break; - - case WXK_RIGHT: - dir = wxRIGHT; - break; - - default: - return false; - } - - int selOld = GetSelection(); - int selNew = GetNextItem(selOld, dir, GetWindowStyle()); - if ( selNew != selOld ) - { - SetSelection(selNew); - - // emulate the button click - SendRadioEvent(); - } - - return true; -} - -#endif // wxUSE_RADIOBOX diff --git a/wxWidgets/src/univ/radiobut.cpp b/wxWidgets/src/univ/radiobut.cpp deleted file mode 100644 index a0b91262a9..0000000000 --- a/wxWidgets/src/univ/radiobut.cpp +++ /dev/null @@ -1,179 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/univ/radiobut.cpp -// Purpose: wxRadioButton implementation -// Author: Vadim Zeitlin -// Modified by: -// Created: 10.09.00 -// RCS-ID: $Id: radiobut.cpp 39567 2006-06-05 16:46:15Z ABX $ -// Copyright: (c) 2000 SciTech Software, Inc. (www.scitechsoft.com) -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_RADIOBTN - -#include "wx/radiobut.h" - -#ifndef WX_PRECOMP - #include "wx/dcclient.h" - #include "wx/validate.h" -#endif - -#include "wx/univ/theme.h" -#include "wx/univ/renderer.h" -#include "wx/univ/inphand.h" -#include "wx/univ/colschem.h" - -// ============================================================================ -// implementation -// ============================================================================ - -IMPLEMENT_DYNAMIC_CLASS(wxRadioButton, wxControl) - -// ---------------------------------------------------------------------------- -// wxRadioButton -// ---------------------------------------------------------------------------- - -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 ( !wxCheckBox::Create(parent, id, label, pos, size, style, - validator, name) ) - { - return false; - } - - return true; -} - -// ---------------------------------------------------------------------------- -// radio button methods -// ---------------------------------------------------------------------------- - -void wxRadioButton::OnCheck() -{ - // clear all others radio buttons in our group: for this we need to - // find the radio button which is the first in the group, i.e. the one - // with wxRB_GROUP style - const wxWindowList& siblings = GetParent()->GetChildren(); - wxWindowList::compatibility_iterator nodeStart = siblings.Find(this); - while ( nodeStart ) - { - // stop if we found a radio button with wxRB_GROUP style or it we - // are at the first control - if ( !nodeStart->GetPrevious() || - (nodeStart->GetData()->GetWindowStyle() & wxRB_GROUP) ) - break; - - nodeStart = nodeStart->GetPrevious(); - } - - // now clear all radio buttons from the starting one until the next - // one with wxRB_GROUP style - while ( nodeStart ) - { - wxWindow *win = nodeStart->GetData(); - if ( win != this ) - { - wxRadioButton *btn = wxDynamicCast(win, wxRadioButton); - if ( btn ) - { - btn->ClearValue(); - } - } - - nodeStart = nodeStart->GetNext(); - if ( !nodeStart || - (nodeStart->GetData()->GetWindowStyle() & wxRB_GROUP) ) - { - // we reached the next group - break; - } - } -} - -void wxRadioButton::ChangeValue(bool value) -{ - if ( value == IsChecked() ) - return; - - if ( !IsChecked() ) - { - wxCheckBox::ChangeValue(value); - } - else // attempt to clear a radio button - this can't be done - { - // but still refresh as our PRESSED flag changed - Refresh(); - } -} - -void wxRadioButton::ClearValue() -{ - if ( IsChecked() ) - { - SetValue(false); - } -} - -void wxRadioButton::SendEvent() -{ - wxCommandEvent event(wxEVT_COMMAND_RADIOBUTTON_SELECTED, GetId()); - InitCommandEvent(event); - event.SetInt(IsChecked()); - Command(event); -} - -// ---------------------------------------------------------------------------- -// overridden wxCheckBox methods -// ---------------------------------------------------------------------------- - -wxSize wxRadioButton::GetBitmapSize() const -{ - wxBitmap bmp = GetBitmap(State_Normal, Status_Checked); - return bmp.Ok() ? wxSize(bmp.GetWidth(), bmp.GetHeight()) - : GetRenderer()->GetRadioBitmapSize(); -} - -void wxRadioButton::DoDraw(wxControlRenderer *renderer) -{ - wxDC& dc = renderer->GetDC(); - dc.SetFont(GetFont()); - dc.SetTextForeground(GetForegroundColour()); - - int flags = GetStateFlags(); - Status status = GetStatus(); - if ( status == Status_Checked ) - flags |= wxCONTROL_CHECKED; - - renderer->GetRenderer()-> - DrawRadioButton(dc, - GetLabel(), - GetBitmap(GetState(flags), status), - renderer->GetRect(), - flags, - GetWindowStyle() & wxALIGN_RIGHT ? wxALIGN_RIGHT - : wxALIGN_LEFT, - GetAccelIndex()); -} - -#endif // wxUSE_RADIOBTN diff --git a/wxWidgets/src/univ/scrarrow.cpp b/wxWidgets/src/univ/scrarrow.cpp deleted file mode 100644 index b36e27c1f8..0000000000 --- a/wxWidgets/src/univ/scrarrow.cpp +++ /dev/null @@ -1,301 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: src/univ/scrarrow.cpp -// Purpose: wxScrollArrows class implementation -// Author: Vadim Zeitlin -// Modified by: -// Created: 22.01.01 -// RCS-ID: $Id: scrarrow.cpp 42739 2006-10-30 18:08:21Z ABX $ -// Copyright: (c) 2001 SciTech Software, Inc. (www.scitechsoft.com) -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#ifndef WX_PRECOMP - #include "wx/window.h" -#endif - -#include "wx/univ/scrtimer.h" -#include "wx/univ/scrarrow.h" - -#include "wx/univ/renderer.h" -#include "wx/univ/inphand.h" -#include "wx/univ/theme.h" - -// ---------------------------------------------------------------------------- -// wxScrollArrowCaptureData: contains the data used while the arrow is being -// pressed by the user -// ---------------------------------------------------------------------------- - -struct wxScrollArrowCaptureData -{ - wxScrollArrowCaptureData() - { - m_arrowPressed = wxScrollArrows::Arrow_None; - m_window = NULL; - m_btnCapture = -1; -#if wxUSE_TIMER - m_timerScroll = NULL; -#endif // wxUSE_TIMER - } - - ~wxScrollArrowCaptureData() - { - if ( m_window ) - m_window->ReleaseMouse(); - -#if wxUSE_TIMER - delete m_timerScroll; -#endif // wxUSE_TIMER - } - - // the arrow being held pressed (may be Arrow_None) - wxScrollArrows::Arrow m_arrowPressed; - - // the mouse button which started the capture (-1 if none) - int m_btnCapture; - - // the window which has captured the mouse - wxWindow *m_window; - -#if wxUSE_TIMER - // the timer for generating the scroll events - wxScrollTimer *m_timerScroll; -#endif -}; - -// ---------------------------------------------------------------------------- -// wxScrollArrowTimer: a wxScrollTimer which calls OnArrow() -// ---------------------------------------------------------------------------- - -#if wxUSE_TIMER - -class wxScrollArrowTimer : public wxScrollTimer -{ -public: - wxScrollArrowTimer(wxControlWithArrows *control, - wxScrollArrows::Arrow arrow) - { - m_control = control; - m_arrow = arrow; - - StartAutoScroll(); - } - -protected: - virtual bool DoNotify() - { - return m_control->OnArrow(m_arrow); - } - - wxControlWithArrows *m_control; - wxScrollArrows::Arrow m_arrow; -}; - -#endif // wxUSE_TIMER - -// ============================================================================ -// implementation of wxScrollArrows -// ============================================================================ - -// ---------------------------------------------------------------------------- -// con/destruction -// ---------------------------------------------------------------------------- - -wxScrollArrows::wxScrollArrows(wxControlWithArrows *control) -{ - m_control = control; - m_captureData = NULL; -} - -wxScrollArrows::~wxScrollArrows() -{ - // it should have been destroyed - wxASSERT_MSG( !m_captureData, _T("memory leak in wxScrollArrows") ); -} - -// ---------------------------------------------------------------------------- -// drawing -// ---------------------------------------------------------------------------- - -void wxScrollArrows::DrawArrow(Arrow arrow, - wxDC& dc, - const wxRect& rect, - bool scrollbarLike) const -{ - static const wxDirection arrowDirs[2][Arrow_Max] = - { - { wxLEFT, wxRIGHT }, - { wxUP, wxDOWN } - }; - - if ( scrollbarLike ) - m_control->GetRenderer()->DrawScrollbarArrow( - dc, - arrowDirs[m_control->IsVertical()][arrow], - rect, - m_control->GetArrowState(arrow)); - else - m_control->GetRenderer()->DrawArrow( - dc, - arrowDirs[m_control->IsVertical()][arrow], - rect, - m_control->GetArrowState(arrow)); -} - -// ---------------------------------------------------------------------------- -// input handling -// ---------------------------------------------------------------------------- - -void wxScrollArrows::UpdateCurrentFlag(Arrow arrow, Arrow arrowCur) const -{ - m_control->SetArrowFlag(arrow, wxCONTROL_CURRENT, arrow == arrowCur); -} - -bool wxScrollArrows::HandleMouseMove(const wxMouseEvent& event) const -{ - Arrow arrow; - if ( event.Leaving() ) - { - // no arrow has mouse if it left the window completely - arrow = Arrow_None; - } - else // Moving() or Entering(), treat them the same here - { - arrow = m_control->HitTestArrow(event.GetPosition()); - } - -#if wxUSE_TIMER - if ( m_captureData && m_captureData->m_timerScroll) - { - // the mouse is captured, we may want to pause scrolling if it goes - // outside the arrow or to resume it if we had paused it before - wxTimer *timer = m_captureData->m_timerScroll; - if ( !timer->IsRunning() ) - { - // timer is paused - if ( arrow == m_captureData->m_arrowPressed ) - { - // resume now - m_control->SetArrowFlag(arrow, wxCONTROL_PRESSED, true); - timer->Start(); - - return true; - } - } - else // if ( 1 ) FIXME: m_control->ShouldPauseScrolling() ) - { - // we may want to stop it - if ( arrow != m_captureData->m_arrowPressed ) - { - // stop as the mouse left the arrow - m_control->SetArrowFlag(m_captureData->m_arrowPressed, - wxCONTROL_PRESSED, false); - timer->Stop(); - - return true; - } - } - - return false; - } -#endif // wxUSE_TIMER - - // reset the wxCONTROL_CURRENT flag for the arrows which don't have the - // mouse and set it for the one which has - UpdateCurrentFlag(Arrow_First, arrow); - UpdateCurrentFlag(Arrow_Second, arrow); - - // return true if it was really an event for an arrow - return !event.Leaving() && arrow != Arrow_None; -} - -bool wxScrollArrows::HandleMouse(const wxMouseEvent& event) const -{ - int btn = event.GetButton(); - if ( btn == -1 ) - { - // we only care about button press/release events - return false; - } - - if ( event.ButtonDown() || event.ButtonDClick() ) - { - if ( !m_captureData ) - { - Arrow arrow = m_control->HitTestArrow(event.GetPosition()); - if ( arrow == Arrow_None ) - { - // mouse pressed over something else - return false; - } - - if ( m_control->GetArrowState(arrow) & wxCONTROL_DISABLED ) - { - // don't allow to press disabled arrows - return true; - } - - wxConstCast(this, wxScrollArrows)->m_captureData = - new wxScrollArrowCaptureData; - m_captureData->m_arrowPressed = arrow; - m_captureData->m_btnCapture = btn; - m_captureData->m_window = m_control->GetWindow(); - m_captureData->m_window->CaptureMouse(); - -#if wxUSE_TIMER - // start scrolling - wxScrollArrowTimer *tmpTimerScroll = - new wxScrollArrowTimer(m_control, arrow); -#endif // wxUSE_TIMER - - // Because in some cases wxScrollArrowTimer can cause - // m_captureData to be destructed we need to test if it - // is still valid before using. - if (m_captureData) - { -#if wxUSE_TIMER - m_captureData->m_timerScroll = tmpTimerScroll; -#endif // wxUSE_TIMER - - m_control->SetArrowFlag(arrow, wxCONTROL_PRESSED, true); - } - else - { -#if wxUSE_TIMER - delete tmpTimerScroll; -#endif // wxUSE_TIMER - } - } - //else: mouse already captured, nothing to do - } - // release mouse if the *same* button went up - else if ( m_captureData && (btn == m_captureData->m_btnCapture) ) - { - Arrow arrow = m_captureData->m_arrowPressed; - - delete m_captureData; - wxConstCast(this, wxScrollArrows)->m_captureData = NULL; - - m_control->SetArrowFlag(arrow, wxCONTROL_PRESSED, false); - } - else - { - // we don't process this - return false; - } - - return true; -} diff --git a/wxWidgets/src/univ/scrolbar.cpp b/wxWidgets/src/univ/scrolbar.cpp deleted file mode 100644 index 9a62ae409e..0000000000 --- a/wxWidgets/src/univ/scrolbar.cpp +++ /dev/null @@ -1,1207 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/univ/scrolbar.cpp -// Purpose: wxScrollBar implementation -// Author: Vadim Zeitlin -// Modified by: -// Created: 20.08.00 -// RCS-ID: $Id: scrolbar.cpp 42821 2006-10-31 09:26:55Z VS $ -// Copyright: (c) 2000 SciTech Software, Inc. (www.scitechsoft.com) -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_SCROLLBAR - -#include "wx/scrolbar.h" - -#ifndef WX_PRECOMP - #include "wx/timer.h" - #include "wx/dcclient.h" - #include "wx/validate.h" - #include "wx/log.h" -#endif - -#include "wx/univ/scrtimer.h" - -#include "wx/univ/renderer.h" -#include "wx/univ/inphand.h" -#include "wx/univ/theme.h" - -#define WXDEBUG_SCROLLBAR - -#ifndef __WXDEBUG__ - #undef WXDEBUG_SCROLLBAR -#endif // !__WXDEBUG__ - -#if defined(WXDEBUG_SCROLLBAR) && defined(__WXMSW__) && !defined(__WXMICROWIN__) -#include "wx/msw/private.h" -#endif - -// ---------------------------------------------------------------------------- -// wxScrollBarTimer: this class is used to repeatedly scroll the scrollbar -// when the mouse is help pressed on the arrow or on the bar. It generates the -// given scroll action command periodically. -// ---------------------------------------------------------------------------- - -class wxScrollBarTimer : public wxScrollTimer -{ -public: - wxScrollBarTimer(wxStdScrollBarInputHandler *handler, - const wxControlAction& action, - wxScrollBar *control); - -protected: - virtual bool DoNotify(); - -private: - wxStdScrollBarInputHandler *m_handler; - wxControlAction m_action; - wxScrollBar *m_control; -}; - -// ============================================================================ -// implementation -// ============================================================================ - -IMPLEMENT_DYNAMIC_CLASS(wxScrollBar, wxControl) - -BEGIN_EVENT_TABLE(wxScrollBar, wxScrollBarBase) -END_EVENT_TABLE() - -// ---------------------------------------------------------------------------- -// creation -// ---------------------------------------------------------------------------- - -#ifdef __VISUALC__ - // warning C4355: 'this' : used in base member initializer list - #pragma warning(disable:4355) // so what? disable it... -#endif - -wxScrollBar::wxScrollBar() - : m_arrows(this) -{ - Init(); -} - -wxScrollBar::wxScrollBar(wxWindow *parent, - wxWindowID id, - const wxPoint& pos, - const wxSize& size, - long style, - const wxValidator& validator, - const wxString& name) - : m_arrows(this) -{ - Init(); - - (void)Create(parent, id, pos, size, style, validator, name); -} - -#ifdef __VISUALC__ - // warning C4355: 'this' : used in base member initializer list - #pragma warning(default:4355) -#endif - -void wxScrollBar::Init() -{ - m_range = - m_thumbSize = - m_thumbPos = - m_pageSize = 0; - - m_thumbPosOld = -1; - - for ( size_t n = 0; n < WXSIZEOF(m_elementsState); n++ ) - { - m_elementsState[n] = 0; - } - - m_dirty = false; -} - -bool wxScrollBar::Create(wxWindow *parent, - wxWindowID id, - const wxPoint &pos, - const wxSize &size, - long style, - const wxValidator& validator, - const wxString &name) -{ - // the scrollbars never have the border - style &= ~wxBORDER_MASK; - - if ( !wxControl::Create(parent, id, pos, size, style, validator, name) ) - return false; - - SetInitialSize(size); - - // override the cursor of the target window (if any) - SetCursor(wxCURSOR_ARROW); - - CreateInputHandler(wxINP_HANDLER_SCROLLBAR); - - return true; -} - -wxScrollBar::~wxScrollBar() -{ -} - -// ---------------------------------------------------------------------------- -// misc accessors -// ---------------------------------------------------------------------------- - -bool wxScrollBar::IsStandalone() const -{ - wxWindow *parent = GetParent(); - if ( !parent ) - { - return true; - } - - return (parent->GetScrollbar(wxHORIZONTAL) != this) && - (parent->GetScrollbar(wxVERTICAL) != this); -} - -bool wxScrollBar::AcceptsFocus() const -{ - // the window scrollbars never accept focus - return wxScrollBarBase::AcceptsFocus() && IsStandalone(); -} - -// ---------------------------------------------------------------------------- -// scrollbar API -// ---------------------------------------------------------------------------- - -void wxScrollBar::DoSetThumb(int pos) -{ - // don't assert hecks here, we're a private function which is meant to be - // called with any args at all - if ( pos < 0 ) - { - pos = 0; - } - else if ( pos > m_range - m_thumbSize ) - { - pos = m_range - m_thumbSize; - } - - if ( m_thumbPos == pos ) - { - // nothing changed, avoid refreshes which would provoke flicker - return; - } - - if ( m_thumbPosOld == -1 ) - { - // remember the old thumb position - m_thumbPosOld = m_thumbPos; - } - - m_thumbPos = pos; - - // we have to refresh the part of the bar which was under the thumb and the - // thumb itself - m_elementsState[Element_Thumb] |= wxCONTROL_DIRTY; - m_elementsState[m_thumbPos > m_thumbPosOld - ? Element_Bar_1 : Element_Bar_2] |= wxCONTROL_DIRTY; - m_dirty = true; -} - -int wxScrollBar::GetThumbPosition() const -{ - return m_thumbPos; -} - -int wxScrollBar::GetThumbSize() const -{ - return m_thumbSize; -} - -int wxScrollBar::GetPageSize() const -{ - return m_pageSize; -} - -int wxScrollBar::GetRange() const -{ - return m_range; -} - -void wxScrollBar::SetThumbPosition(int pos) -{ - wxCHECK_RET( pos >= 0 && pos <= m_range, _T("thumb position out of range") ); - - DoSetThumb(pos); -} - -void wxScrollBar::SetScrollbar(int position, int thumbSize, - int range, int pageSize, - bool refresh) -{ - // we only refresh everything when the range changes, thumb position - // changes are handled in OnIdle - bool needsRefresh = (range != m_range) || - (thumbSize != m_thumbSize) || - (pageSize != m_pageSize); - - // set all parameters - m_range = range; - m_thumbSize = thumbSize; - SetThumbPosition(position); - m_pageSize = pageSize; - - // ignore refresh parameter unless we really need to refresh everything - - // there ir a lot of existing code which just calls SetScrollbar() without - // specifying the last parameter even though it doesn't need at all to - // refresh the window immediately - if ( refresh && needsRefresh ) - { - // and update the window - Refresh(); - Update(); - } -} - -// ---------------------------------------------------------------------------- -// geometry -// ---------------------------------------------------------------------------- - -wxSize wxScrollBar::DoGetBestClientSize() const -{ - // this dimension is completely arbitrary - static const wxCoord SIZE = 140; - - wxSize size = m_renderer->GetScrollbarArrowSize(); - if ( IsVertical() ) - { - size.y = SIZE; - } - else // horizontal - { - size.x = SIZE; - } - - return size; -} - -wxScrollArrows::Arrow wxScrollBar::HitTestArrow(const wxPoint& pt) const -{ - switch ( HitTestBar(pt) ) - { - case wxHT_SCROLLBAR_ARROW_LINE_1: - return wxScrollArrows::Arrow_First; - - case wxHT_SCROLLBAR_ARROW_LINE_2: - return wxScrollArrows::Arrow_Second; - - default: - return wxScrollArrows::Arrow_None; - } -} - -wxHitTest wxScrollBar::HitTestBar(const wxPoint& pt) const -{ - // we only need to work with either x or y coord depending on the - // orientation, choose one (but still check the other one to verify if the - // mouse is in the window at all) - const wxSize sizeArrowSB = m_renderer->GetScrollbarArrowSize(); - - wxCoord coord, sizeArrow, sizeTotal; - wxSize size = GetSize(); - if ( GetWindowStyle() & wxVERTICAL ) - { - if ( pt.x < 0 || pt.x > size.x ) - return wxHT_NOWHERE; - - coord = pt.y; - sizeArrow = sizeArrowSB.y; - sizeTotal = size.y; - } - else // horizontal - { - if ( pt.y < 0 || pt.y > size.y ) - return wxHT_NOWHERE; - - coord = pt.x; - sizeArrow = sizeArrowSB.x; - sizeTotal = size.x; - } - - // test for the arrows first as it's faster - if ( coord < 0 || coord > sizeTotal ) - { - return wxHT_NOWHERE; - } - else if ( coord < sizeArrow ) - { - return wxHT_SCROLLBAR_ARROW_LINE_1; - } - else if ( coord > sizeTotal - sizeArrow ) - { - return wxHT_SCROLLBAR_ARROW_LINE_2; - } - else - { - // calculate the thumb position in pixels - sizeTotal -= 2*sizeArrow; - wxCoord thumbStart, thumbEnd; - int range = GetRange(); - if ( !range ) - { - // clicking the scrollbar without range has no effect - return wxHT_NOWHERE; - } - else - { - GetScrollBarThumbSize(sizeTotal, - GetThumbPosition(), - GetThumbSize(), - range, - &thumbStart, - &thumbEnd); - } - - // now compare with the thumb position - coord -= sizeArrow; - if ( coord < thumbStart ) - return wxHT_SCROLLBAR_BAR_1; - else if ( coord > thumbEnd ) - return wxHT_SCROLLBAR_BAR_2; - else - return wxHT_SCROLLBAR_THUMB; - } -} - -/* static */ -void wxScrollBar::GetScrollBarThumbSize(wxCoord length, - int thumbPos, - int thumbSize, - int range, - wxCoord *thumbStart, - wxCoord *thumbEnd) -{ - // the thumb can't be made less than this number of pixels - static const wxCoord thumbMinWidth = 8; // FIXME: should be configurable - - *thumbStart = (length*thumbPos) / range; - *thumbEnd = (length*(thumbPos + thumbSize)) / range; - - if ( *thumbEnd - *thumbStart < thumbMinWidth ) - { - // adjust the end if possible - if ( *thumbStart <= length - thumbMinWidth ) - { - // yes, just make it wider - *thumbEnd = *thumbStart + thumbMinWidth; - } - else // it is at the bottom of the scrollbar - { - // so move it a bit up - *thumbStart = length - thumbMinWidth; - *thumbEnd = length; - } - } -} - -wxRect wxScrollBar::GetScrollbarRect(wxScrollBar::Element elem, - int thumbPos) const -{ - if ( thumbPos == -1 ) - { - thumbPos = GetThumbPosition(); - } - - const wxSize sizeArrow = m_renderer->GetScrollbarArrowSize(); - - wxSize sizeTotal = GetClientSize(); - wxCoord *start, *width; - wxCoord length, arrow; - wxRect rect; - if ( IsVertical() ) - { - rect.x = 0; - rect.width = sizeTotal.x; - length = sizeTotal.y; - start = &rect.y; - width = &rect.height; - arrow = sizeArrow.y; - } - else // horizontal - { - rect.y = 0; - rect.height = sizeTotal.y; - length = sizeTotal.x; - start = &rect.x; - width = &rect.width; - arrow = sizeArrow.x; - } - - switch ( elem ) - { - case wxScrollBar::Element_Arrow_Line_1: - *start = 0; - *width = arrow; - break; - - case wxScrollBar::Element_Arrow_Line_2: - *start = length - arrow; - *width = arrow; - break; - - case wxScrollBar::Element_Arrow_Page_1: - case wxScrollBar::Element_Arrow_Page_2: - // we don't have them at all - break; - - case wxScrollBar::Element_Thumb: - case wxScrollBar::Element_Bar_1: - case wxScrollBar::Element_Bar_2: - // we need to calculate the thumb position - do it - { - length -= 2*arrow; - wxCoord thumbStart, thumbEnd; - int range = GetRange(); - if ( !range ) - { - thumbStart = - thumbEnd = 0; - } - else - { - GetScrollBarThumbSize(length, - thumbPos, - GetThumbSize(), - range, - &thumbStart, - &thumbEnd); - } - - if ( elem == wxScrollBar::Element_Thumb ) - { - *start = thumbStart; - *width = thumbEnd - thumbStart; - } - else if ( elem == wxScrollBar::Element_Bar_1 ) - { - *start = 0; - *width = thumbStart; - } - else // elem == wxScrollBar::Element_Bar_2 - { - *start = thumbEnd; - *width = length - thumbEnd; - } - - // everything is relative to the start of the shaft so far - *start += arrow; - } - break; - - case wxScrollBar::Element_Max: - default: - wxFAIL_MSG( _T("unknown scrollbar element") ); - } - - return rect; -} - -wxCoord wxScrollBar::GetScrollbarSize() const -{ - const wxSize sizeArrowSB = m_renderer->GetScrollbarArrowSize(); - - wxCoord sizeArrow, sizeTotal; - if ( GetWindowStyle() & wxVERTICAL ) - { - sizeArrow = sizeArrowSB.y; - sizeTotal = GetSize().y; - } - else // horizontal - { - sizeArrow = sizeArrowSB.x; - sizeTotal = GetSize().x; - } - - return sizeTotal - 2*sizeArrow; -} - - -wxCoord wxScrollBar::ScrollbarToPixel(int thumbPos) -{ - int range = GetRange(); - if ( !range ) - { - // the only valid position anyhow - return 0; - } - - if ( thumbPos == -1 ) - { - // by default use the current thumb position - thumbPos = GetThumbPosition(); - } - - const wxSize sizeArrow = m_renderer->GetScrollbarArrowSize(); - return (thumbPos * GetScrollbarSize()) / range - + (IsVertical() ? sizeArrow.y : sizeArrow.x); -} - -int wxScrollBar::PixelToScrollbar(wxCoord coord) -{ - const wxSize sizeArrow = m_renderer->GetScrollbarArrowSize(); - return ((coord - (IsVertical() ? sizeArrow.y : sizeArrow.x)) * - GetRange() ) / GetScrollbarSize(); -} - -// ---------------------------------------------------------------------------- -// drawing -// ---------------------------------------------------------------------------- - -void wxScrollBar::OnInternalIdle() -{ - UpdateThumb(); - wxControl::OnInternalIdle(); -} - -void wxScrollBar::UpdateThumb() -{ - if ( m_dirty ) - { - for ( size_t n = 0; n < WXSIZEOF(m_elementsState); n++ ) - { - if ( m_elementsState[n] & wxCONTROL_DIRTY ) - { - wxRect rect = GetScrollbarRect((Element)n); - - if ( rect.width && rect.height ) - { - // we try to avoid redrawing the entire shaft (which might - // be quite long) if possible by only redrawing the area - // wich really changed - if ( (n == Element_Bar_1 || n == Element_Bar_2) && - (m_thumbPosOld != -1) ) - { - // the less efficient but more reliable (i.e. this will - // probably work everywhere) version: refresh the - // distance covered by thumb since the last update -#if 0 - wxRect rectOld = - GetRenderer()->GetScrollbarRect(this, - (Element)n, - m_thumbPosOld); - if ( IsVertical() ) - { - if ( n == Element_Bar_1 ) - rect.SetTop(rectOld.GetBottom()); - else - rect.SetBottom(rectOld.GetBottom()); - } - else // horizontal - { - if ( n == Element_Bar_1 ) - rect.SetLeft(rectOld.GetRight()); - else - rect.SetRight(rectOld.GetRight()); - } -#else // efficient version: only repaint the area occupied by - // the thumb previously - we can't do better than this - rect = GetScrollbarRect(Element_Thumb, m_thumbPosOld); -#endif // 0/1 - } - -#ifdef WXDEBUG_SCROLLBAR - static bool s_refreshDebug = false; - if ( s_refreshDebug ) - { - wxClientDC dc(this); - dc.SetBrush(*wxCYAN_BRUSH); - dc.SetPen(*wxTRANSPARENT_PEN); - dc.DrawRectangle(rect); - - // under Unix we use "--sync" X option for this - #if defined(__WXMSW__) && !defined(__WXMICROWIN__) - ::GdiFlush(); - ::Sleep(200); - #endif // __WXMSW__ - } -#endif // WXDEBUG_SCROLLBAR - - Refresh(false, &rect); - } - - m_elementsState[n] &= ~wxCONTROL_DIRTY; - } - } - - m_dirty = false; - } -} - -void wxScrollBar::DoDraw(wxControlRenderer *renderer) -{ - renderer->DrawScrollbar(this, m_thumbPosOld); - - // clear all dirty flags - m_dirty = false; - m_thumbPosOld = -1; -} - -// ---------------------------------------------------------------------------- -// state flags -// ---------------------------------------------------------------------------- - -static inline wxScrollBar::Element ElementForArrow(wxScrollArrows::Arrow arrow) -{ - return arrow == wxScrollArrows::Arrow_First - ? wxScrollBar::Element_Arrow_Line_1 - : wxScrollBar::Element_Arrow_Line_2; -} - -int wxScrollBar::GetArrowState(wxScrollArrows::Arrow arrow) const -{ - return GetState(ElementForArrow(arrow)); -} - -void wxScrollBar::SetArrowFlag(wxScrollArrows::Arrow arrow, int flag, bool set) -{ - Element which = ElementForArrow(arrow); - int state = GetState(which); - if ( set ) - state |= flag; - else - state &= ~flag; - - SetState(which, state); -} - -int wxScrollBar::GetState(Element which) const -{ - // if the entire scrollbar is disabled, all of its elements are too - int flags = m_elementsState[which]; - if ( !IsEnabled() ) - flags |= wxCONTROL_DISABLED; - - return flags; -} - -void wxScrollBar::SetState(Element which, int flags) -{ - if ( (int)(m_elementsState[which] & ~wxCONTROL_DIRTY) != flags ) - { - m_elementsState[which] = flags | wxCONTROL_DIRTY; - - m_dirty = true; - } -} - -// ---------------------------------------------------------------------------- -// input processing -// ---------------------------------------------------------------------------- - -bool wxScrollBar::OnArrow(wxScrollArrows::Arrow arrow) -{ - int oldThumbPos = GetThumbPosition(); - PerformAction(arrow == wxScrollArrows::Arrow_First - ? wxACTION_SCROLL_LINE_UP - : wxACTION_SCROLL_LINE_DOWN); - - // did we scroll till the end? - return GetThumbPosition() != oldThumbPos; -} - -bool wxScrollBar::PerformAction(const wxControlAction& action, - long numArg, - const wxString& strArg) -{ - int thumbOld = m_thumbPos; - - bool notify = false; // send an event about the change? - - wxEventType scrollType; - - // test for thumb move first as these events happen in quick succession - if ( action == wxACTION_SCROLL_THUMB_MOVE ) - { - DoSetThumb(numArg); - - // VS: we have to force redraw here, otherwise the thumb will lack - // behind mouse cursor - UpdateThumb(); - - scrollType = wxEVT_SCROLLWIN_THUMBTRACK; - } - else if ( action == wxACTION_SCROLL_LINE_UP ) - { - scrollType = wxEVT_SCROLLWIN_LINEUP; - ScrollLines(-1); - } - else if ( action == wxACTION_SCROLL_LINE_DOWN ) - { - scrollType = wxEVT_SCROLLWIN_LINEDOWN; - ScrollLines(1); - } - else if ( action == wxACTION_SCROLL_PAGE_UP ) - { - scrollType = wxEVT_SCROLLWIN_PAGEUP; - ScrollPages(-1); - } - else if ( action == wxACTION_SCROLL_PAGE_DOWN ) - { - scrollType = wxEVT_SCROLLWIN_PAGEDOWN; - ScrollPages(1); - } - else if ( action == wxACTION_SCROLL_START ) - { - scrollType = wxEVT_SCROLLWIN_THUMBRELEASE; // anything better? - ScrollToStart(); - } - else if ( action == wxACTION_SCROLL_END ) - { - scrollType = wxEVT_SCROLLWIN_THUMBRELEASE; // anything better? - ScrollToEnd(); - } - else if ( action == wxACTION_SCROLL_THUMB_DRAG ) - { - // we won't use it but this line suppresses the compiler - // warning about "variable may be used without having been - // initialized" - scrollType = wxEVT_NULL; - } - else if ( action == wxACTION_SCROLL_THUMB_RELEASE ) - { - // always notify about this - notify = true; - scrollType = wxEVT_SCROLLWIN_THUMBRELEASE; - } - else - return wxControl::PerformAction(action, numArg, strArg); - - // has scrollbar position changed? - bool changed = m_thumbPos != thumbOld; - if ( notify || changed ) - { - if ( IsStandalone() ) - { - // we should generate EVT_SCROLL events for the standalone - // scrollbars and not the EVT_SCROLLWIN ones - // - // NB: we assume that scrollbar events are sequentially numbered - // but this should be ok as other code relies on this as well - scrollType += wxEVT_SCROLL_TOP - wxEVT_SCROLLWIN_TOP; - wxScrollEvent event(scrollType, this->GetId(), m_thumbPos, - IsVertical() ? wxVERTICAL : wxHORIZONTAL); - event.SetEventObject(this); - GetEventHandler()->ProcessEvent(event); - } - else // part of the window - { - wxScrollWinEvent event(scrollType, m_thumbPos, - IsVertical() ? wxVERTICAL : wxHORIZONTAL); - event.SetEventObject(this); - GetParent()->GetEventHandler()->ProcessEvent(event); - } - } - - return true; -} - -void wxScrollBar::ScrollToStart() -{ - DoSetThumb(0); -} - -void wxScrollBar::ScrollToEnd() -{ - DoSetThumb(m_range - m_thumbSize); -} - -bool wxScrollBar::ScrollLines(int nLines) -{ - DoSetThumb(m_thumbPos + nLines); - return true; -} - -bool wxScrollBar::ScrollPages(int nPages) -{ - DoSetThumb(m_thumbPos + nPages*m_pageSize); - return true; -} - -/* static */ -wxInputHandler *wxScrollBar::GetStdInputHandler(wxInputHandler *handlerDef) -{ - static wxStdScrollBarInputHandler - s_handler(wxTheme::Get()->GetRenderer(), handlerDef); - - return &s_handler; -} - -// ============================================================================ -// scroll bar input handler -// ============================================================================ - -// ---------------------------------------------------------------------------- -// wxScrollBarTimer -// ---------------------------------------------------------------------------- - -wxScrollBarTimer::wxScrollBarTimer(wxStdScrollBarInputHandler *handler, - const wxControlAction& action, - wxScrollBar *control) -{ - m_handler = handler; - m_action = action; - m_control = control; -} - -bool wxScrollBarTimer::DoNotify() -{ - return m_handler->OnScrollTimer(m_control, m_action); -} - -// ---------------------------------------------------------------------------- -// wxStdScrollBarInputHandler -// ---------------------------------------------------------------------------- - -wxStdScrollBarInputHandler::wxStdScrollBarInputHandler(wxRenderer *renderer, - wxInputHandler *handler) - : wxStdInputHandler(handler) -{ - m_renderer = renderer; - m_winCapture = NULL; - m_htLast = wxHT_NOWHERE; - m_timerScroll = NULL; -} - -wxStdScrollBarInputHandler::~wxStdScrollBarInputHandler() -{ - // normally, it's NULL by now but just in case the user somehow managed to - // keep the mouse captured until now... - delete m_timerScroll; -} - -void wxStdScrollBarInputHandler::SetElementState(wxScrollBar *control, - int flag, - bool doIt) -{ - if ( m_htLast > wxHT_SCROLLBAR_FIRST && m_htLast < wxHT_SCROLLBAR_LAST ) - { - wxScrollBar::Element - elem = (wxScrollBar::Element)(m_htLast - wxHT_SCROLLBAR_FIRST - 1); - - int flags = control->GetState(elem); - if ( doIt ) - flags |= flag; - else - flags &= ~flag; - control->SetState(elem, flags); - } -} - -bool wxStdScrollBarInputHandler::OnScrollTimer(wxScrollBar *scrollbar, - const wxControlAction& action) -{ - int oldThumbPos = scrollbar->GetThumbPosition(); - scrollbar->PerformAction(action); - if ( scrollbar->GetThumbPosition() != oldThumbPos ) - return true; - - // we scrolled till the end - m_timerScroll->Stop(); - - return false; -} - -void wxStdScrollBarInputHandler::StopScrolling(wxScrollBar *control) -{ - // return everything to the normal state - if ( m_winCapture ) - { - m_winCapture->ReleaseMouse(); - m_winCapture = NULL; - } - - m_btnCapture = -1; - - if ( m_timerScroll ) - { - delete m_timerScroll; - m_timerScroll = NULL; - } - - // unpress the arrow and highlight the current element - Press(control, false); -} - -wxCoord -wxStdScrollBarInputHandler::GetMouseCoord(const wxScrollBar *scrollbar, - const wxMouseEvent& event) const -{ - wxPoint pt = event.GetPosition(); - return scrollbar->GetWindowStyle() & wxVERTICAL ? pt.y : pt.x; -} - -void wxStdScrollBarInputHandler::HandleThumbMove(wxScrollBar *scrollbar, - const wxMouseEvent& event) -{ - int thumbPos = GetMouseCoord(scrollbar, event) - m_ofsMouse; - thumbPos = scrollbar->PixelToScrollbar(thumbPos); - scrollbar->PerformAction(wxACTION_SCROLL_THUMB_MOVE, thumbPos); -} - -bool wxStdScrollBarInputHandler::HandleKey(wxInputConsumer *consumer, - const wxKeyEvent& event, - bool pressed) -{ - // we only react to the key presses here - if ( pressed ) - { - wxControlAction action; - switch ( event.GetKeyCode() ) - { - case WXK_DOWN: - case WXK_RIGHT: action = wxACTION_SCROLL_LINE_DOWN; break; - case WXK_UP: - case WXK_LEFT: action = wxACTION_SCROLL_LINE_UP; break; - case WXK_HOME: action = wxACTION_SCROLL_START; break; - case WXK_END: action = wxACTION_SCROLL_END; break; - case WXK_PAGEUP: action = wxACTION_SCROLL_PAGE_UP; break; - case WXK_PAGEDOWN: action = wxACTION_SCROLL_PAGE_DOWN; break; - } - - if ( !action.IsEmpty() ) - { - consumer->PerformAction(action); - - return true; - } - } - - return wxStdInputHandler::HandleKey(consumer, event, pressed); -} - -bool wxStdScrollBarInputHandler::HandleMouse(wxInputConsumer *consumer, - const wxMouseEvent& event) -{ - // is this a click event from an acceptable button? - int btn = event.GetButton(); - if ( btn == wxMOUSE_BTN_LEFT ) - { - // determine which part of the window mouse is in - wxScrollBar *scrollbar = wxStaticCast(consumer->GetInputWindow(), wxScrollBar); - wxHitTest ht = scrollbar->HitTestBar(event.GetPosition()); - - // when the mouse is pressed on any scrollbar element, we capture it - // and hold capture until the same mouse button is released - if ( event.ButtonDown() || event.ButtonDClick() ) - { - if ( !m_winCapture ) - { - m_btnCapture = btn; - m_winCapture = consumer->GetInputWindow(); - m_winCapture->CaptureMouse(); - - // generate the command - bool hasAction = true; - wxControlAction action; - switch ( ht ) - { - case wxHT_SCROLLBAR_ARROW_LINE_1: - action = wxACTION_SCROLL_LINE_UP; - break; - - case wxHT_SCROLLBAR_ARROW_LINE_2: - action = wxACTION_SCROLL_LINE_DOWN; - break; - - case wxHT_SCROLLBAR_BAR_1: - action = wxACTION_SCROLL_PAGE_UP; - m_ptStartScrolling = event.GetPosition(); - break; - - case wxHT_SCROLLBAR_BAR_2: - action = wxACTION_SCROLL_PAGE_DOWN; - m_ptStartScrolling = event.GetPosition(); - break; - - case wxHT_SCROLLBAR_THUMB: - consumer->PerformAction(wxACTION_SCROLL_THUMB_DRAG); - m_ofsMouse = GetMouseCoord(scrollbar, event) - - scrollbar->ScrollbarToPixel(); - - // fall through: there is no immediate action - - default: - hasAction = false; - } - - // remove highlighting - Highlight(scrollbar, false); - m_htLast = ht; - - // and press the arrow or highlight thumb now instead - if ( m_htLast == wxHT_SCROLLBAR_THUMB ) - Highlight(scrollbar, true); - else - Press(scrollbar, true); - - // start dragging - if ( hasAction ) - { - m_timerScroll = new wxScrollBarTimer(this, action, - scrollbar); - m_timerScroll->StartAutoScroll(); - } - //else: no (immediate) action - - } - //else: mouse already captured, nothing to do - } - // release mouse if the *same* button went up - else if ( btn == m_btnCapture ) - { - if ( m_winCapture ) - { - StopScrolling(scrollbar); - - // if we were dragging the thumb, send the last event - if ( m_htLast == wxHT_SCROLLBAR_THUMB ) - { - scrollbar->PerformAction(wxACTION_SCROLL_THUMB_RELEASE); - } - - m_htLast = ht; - Highlight(scrollbar, true); - } - else - { - // this is not supposed to happen as the button can't go up - // without going down previously and then we'd have - // m_winCapture by now - wxFAIL_MSG( _T("logic error in mouse capturing code") ); - } - } - } - - return wxStdInputHandler::HandleMouse(consumer, event); -} - -bool wxStdScrollBarInputHandler::HandleMouseMove(wxInputConsumer *consumer, - const wxMouseEvent& event) -{ - wxScrollBar *scrollbar = wxStaticCast(consumer->GetInputWindow(), wxScrollBar); - - if ( m_winCapture ) - { - if ( (m_htLast == wxHT_SCROLLBAR_THUMB) && event.Dragging() ) - { - // make the thumb follow the mouse by keeping the same offset - // between the mouse position and the top/left of the thumb - HandleThumbMove(scrollbar, event); - - return true; - } - - // no other changes are possible while the mouse is captured - return false; - } - - bool isArrow = scrollbar->GetArrows().HandleMouseMove(event); - - if ( event.Dragging() ) - { - wxHitTest ht = scrollbar->HitTestBar(event.GetPosition()); - if ( ht == m_htLast ) - { - // nothing changed - return false; - } - -#ifdef DEBUG_MOUSE - wxLogDebug("Scrollbar::OnMouseMove: ht = %d", ht); -#endif // DEBUG_MOUSE - - Highlight(scrollbar, false); - m_htLast = ht; - - if ( !isArrow ) - Highlight(scrollbar, true); - //else: already done by wxScrollArrows::HandleMouseMove - } - else if ( event.Leaving() ) - { - if ( !isArrow ) - Highlight(scrollbar, false); - - m_htLast = wxHT_NOWHERE; - } - else // event.Entering() - { - // we don't process this event - return false; - } - - // we did something - return true; -} - -#endif // wxUSE_SCROLLBAR - -#if wxUSE_TIMER - -// ---------------------------------------------------------------------------- -// wxScrollTimer -// ---------------------------------------------------------------------------- - -wxScrollTimer::wxScrollTimer() -{ - m_skipNext = false; -} - -void wxScrollTimer::StartAutoScroll() -{ - // start scrolling immediately - if ( !DoNotify() ) - { - // ... and end it too - return; - } - - // there is an initial delay before the scrollbar starts scrolling - - // implement it by ignoring the first timer expiration and only start - // scrolling from the second one - m_skipNext = true; - Start(200); // FIXME: hardcoded delay -} - -void wxScrollTimer::Notify() -{ - if ( m_skipNext ) - { - // scroll normally now - reduce the delay - Stop(); - Start(50); // FIXME: hardcoded delay - - m_skipNext = false; - } - else - { - // if DoNotify() returns false, we're already deleted by the timer - // event handler, so don't do anything else here - (void)DoNotify(); - } -} - -#endif // wxUSE_TIMER diff --git a/wxWidgets/src/univ/scrthumb.cpp b/wxWidgets/src/univ/scrthumb.cpp deleted file mode 100644 index c98b0b9d01..0000000000 --- a/wxWidgets/src/univ/scrthumb.cpp +++ /dev/null @@ -1,291 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/univ/scrthumb.cpp -// Purpose: wxScrollThumb and related classes -// Author: Vadim Zeitlin -// Modified by: -// Created: 13.02.01 -// RCS-ID: $Id: scrthumb.cpp 39633 2006-06-08 11:25:30Z ABX $ -// Copyright: (c) 2001 SciTech Software, Inc. (www.scitechsoft.com) -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#ifndef WX_PRECOMP - #include "wx/window.h" -#endif // WX_PRECOMP - -#include "wx/renderer.h" -#include "wx/univ/scrtimer.h" -#include "wx/univ/scrthumb.h" - -// ---------------------------------------------------------------------------- -// wxScrollThumbCaptureData: the struct used while dragging the scroll thumb -// ---------------------------------------------------------------------------- - -struct WXDLLEXPORT wxScrollThumbCaptureData -{ - // start mouse capture after the user clicked the mouse button btn on this - // part of the control - wxScrollThumbCaptureData(wxScrollThumb::Shaft part, - int btn, - wxControlWithThumb *control) - { - m_shaftPart = part; - m_btnCapture = btn; - m_timerScroll = NULL; - - m_window = control->GetWindow(); - m_window->CaptureMouse(); - } - - // release mouse - ~wxScrollThumbCaptureData() - { - if ( m_window ) - { - m_window->ReleaseMouse(); - } - -#if wxUSE_TIMER - delete m_timerScroll; -#endif // wxUSE_TIMER - } - - // the thumb part being held pressed - wxScrollThumb::Shaft m_shaftPart; - - // the mouse button which started the capture (-1 if none) - int m_btnCapture; - - // the window which has captured the mouse - wxWindow *m_window; - - // the offset between the mouse position and the start of the thumb which - // is kept constant while dragging the thumb - wxCoord m_ofsMouse; - - // the timer for generating the scroll events when scrolling by page - wxScrollTimer *m_timerScroll; -}; - -// ---------------------------------------------------------------------------- -// wxScrollTimer: the timer used when the arrow is kept pressed -// ---------------------------------------------------------------------------- - -#if wxUSE_TIMER - -class wxScrollThumbTimer : public wxScrollTimer -{ -public: - wxScrollThumbTimer(wxControlWithThumb *control, - wxScrollThumb::Shaft shaftPart) - { - m_control = control; - switch ( shaftPart ) - { - case wxScrollThumb::Shaft_Above: - m_inc = -1; - break; - - default: - wxFAIL_MSG(_T("unexpected shaft part in wxScrollThumbTimer")); - // fall through - - case wxScrollThumb::Shaft_Below: - m_inc = 1; - break; - } - - m_control->OnPageScrollStart(); - - StartAutoScroll(); - } - -protected: - virtual bool DoNotify() - { - return m_control->OnPageScroll(m_inc); - } - - wxControlWithThumb *m_control; - int m_inc; -}; - -#endif // wxUSE_TIMER - -// ============================================================================ -// implementation -// ============================================================================ - -// ---------------------------------------------------------------------------- -// wxScrollThumb constructor and dtor -// ---------------------------------------------------------------------------- - -wxScrollThumb::wxScrollThumb(wxControlWithThumb *control) -{ - m_shaftPart = Shaft_None; - m_control = control; - m_captureData = NULL; -} - -wxScrollThumb::~wxScrollThumb() -{ - // it should have been destroyed - wxASSERT_MSG( !m_captureData, _T("memory leak in wxScrollThumb") ); -} - -// ---------------------------------------------------------------------------- -// wxScrollThumb mouse handling -// ---------------------------------------------------------------------------- - -bool wxScrollThumb::HandleMouse(const wxMouseEvent& event) const -{ - // is this a click event? - int btn = event.GetButton(); - if ( btn == -1 ) - { - // no... - return false; - } - - // when the mouse is pressed on any scrollbar element, we capture it - // and hold capture until the same mouse button is released - if ( event.ButtonDown() || event.ButtonDClick() ) - { - if ( HasCapture() ) - { - // mouse already captured, nothing to do - return false; - } - - // determine which part of the window the user clicked in - Shaft shaftPart = m_control->HitTest(event.GetPosition()); - - if ( shaftPart == Shaft_None ) - { - // mouse pressed over something else - return false; - } - - // capture the mouse - wxConstCast(this, wxScrollThumb)->m_captureData = - new wxScrollThumbCaptureData(shaftPart, btn, m_control); - - // modify the visual appearance before sending the event which will - // cause a redraw - m_control->SetShaftPartState(shaftPart, wxCONTROL_PRESSED); - - if ( shaftPart == Shaft_Thumb ) - { - // save the mouse offset from the thumb position - we will keep it - // constant while dragging the thumb - m_captureData->m_ofsMouse = - GetMouseCoord(event) - m_control->ThumbPosToPixel(); - - // generate an additional event if we start dragging the thumb - m_control->OnThumbDragStart(GetThumbPos(event)); - } -#if wxUSE_TIMER - else // not the thumb - { - // start timer for auto scrolling when the user presses the mouse - // in the shaft above or below the thumb - m_captureData->m_timerScroll = - new wxScrollThumbTimer(m_control, shaftPart); - } -#endif // wxUSE_TIMER - } - // release mouse if the *same* button went up - else if ( HasCapture() && (btn == m_captureData->m_btnCapture) ) - { - Shaft shaftPart = m_captureData->m_shaftPart; - - // if we were dragging the thumb, send the one last event - if ( shaftPart == Shaft_Thumb ) - { - m_control->OnThumbDragEnd(GetThumbPos(event)); - } - - // release the mouse and free capture data - delete m_captureData; - wxConstCast(this, wxScrollThumb)->m_captureData = NULL; - - m_control->SetShaftPartState(shaftPart, wxCONTROL_PRESSED, false); - } - else // another mouse button released - { - // we don't process this - return false; - } - - return true; -} - -bool wxScrollThumb::HandleMouseMove(const wxMouseEvent& event) const -{ - if ( HasCapture() ) - { - if ( (m_captureData->m_shaftPart == Shaft_Thumb) && event.Moving() ) - { - // make the thumb follow the mouse by keeping the same offset - // between the mouse position and the top/left of the thumb - m_control->OnThumbDrag(GetThumbPos(event)); - } - - // we process all mouse events while the mouse is captured by us - return true; - } - else // no capture - { - Shaft shaftPart; - if ( event.Leaving() ) - { - // no part of the shaft has mouse if it left the window completely - shaftPart = Shaft_None; - } - else // Moving() or Entering(), treat them the same here - { - shaftPart = m_control->HitTest(event.GetPosition()); - } - - if ( shaftPart != m_shaftPart ) - { - // update the highlighted state - m_control->SetShaftPartState(m_shaftPart, wxCONTROL_CURRENT, false); - wxConstCast(this, wxScrollThumb)->m_shaftPart = shaftPart; - m_control->SetShaftPartState(m_shaftPart, wxCONTROL_CURRENT, true); - } - - // if the event happened on the shaft, it was for us and we processed - // it - return shaftPart != Shaft_None; - } -} - -wxCoord wxScrollThumb::GetMouseCoord(const wxMouseEvent& event) const -{ - wxPoint pt = event.GetPosition(); - return m_control->IsVertical() ? pt.y : pt.x; -} - -int wxScrollThumb::GetThumbPos(const wxMouseEvent& event) const -{ - wxCHECK_MSG( m_captureData && m_captureData->m_shaftPart == Shaft_Thumb, 0, - _T("can't be called when thumb is not dragged") ); - - int x = GetMouseCoord(event) - m_captureData->m_ofsMouse; - return m_control->PixelToThumbPos(x); -} diff --git a/wxWidgets/src/univ/slider.cpp b/wxWidgets/src/univ/slider.cpp deleted file mode 100644 index 75e8d41e7d..0000000000 --- a/wxWidgets/src/univ/slider.cpp +++ /dev/null @@ -1,1101 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: src/univ/slider.cpp -// Purpose: implementation of the universal version of wxSlider -// Author: Vadim Zeitlin -// Modified by: -// Created: 09.02.01 -// RCS-ID: $Id: slider.cpp 42816 2006-10-31 08:50:17Z RD $ -// Copyright: (c) 2001 SciTech Software, Inc. (www.scitechsoft.com) -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -/* - There is some discrepancy in wxSL_LABELS style handling between wxMSW and - wxGTK: the latter handles it natively and shows only the current value of - the slider on the side corresponding to wxSL_TOP/BOTTOM/LEFT/RIGHT style - given (which can be combined with wxSL_HORIZONTAL/VERTICAL) while wxMSW - emulates this somehow and shows the min and max values near the ends of the - slider and the current value in a separate static box nearby. - - We currently follow wxGTK except that wxSL_HORIZONTAL slider can only have - the label displayed on top or bottom of it and wxSL_VERTICAL - to the left - or right. - - What we really need is probably a more fine grain control on labels, i.e. we - should be able to select if we show nothing at all, the current value only - or the value and the limits - the current approach is just that of the - lowest common denominator. - - TODO: - - +0. add ticks support - 1. support for all orientations - 2. draw the slider thumb highlighted when it is dragged - ?3. manual ticks support? - */ - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_SLIDER - -#include "wx/slider.h" - -#ifndef WX_PRECOMP - #include "wx/dc.h" -#endif - -#include "wx/univ/renderer.h" -#include "wx/univ/inphand.h" -#include "wx/univ/theme.h" - -// ---------------------------------------------------------------------------- -// wxStdSliderInputHandler: default slider input handling -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxStdSliderInputHandler : public wxStdInputHandler -{ -public: - // default ctor - wxStdSliderInputHandler(wxInputHandler *inphand) - : wxStdInputHandler(inphand) - { - } - - // base class methods - virtual bool HandleKey(wxInputConsumer *consumer, - const wxKeyEvent& event, - bool pressed); - virtual bool HandleMouse(wxInputConsumer *consumer, - const wxMouseEvent& event); - virtual bool HandleMouseMove(wxInputConsumer *consumer, - const wxMouseEvent& event); - - virtual bool HandleFocus(wxInputConsumer *consumer, const wxFocusEvent& event); -}; - -// ---------------------------------------------------------------------------- -// constants -// ---------------------------------------------------------------------------- - -// the margin between the slider and the label (FIXME: hardcoded) -static const wxCoord SLIDER_LABEL_MARGIN = 2; - -// ============================================================================ -// implementation of wxSlider -// ============================================================================ - -IMPLEMENT_DYNAMIC_CLASS(wxSlider, wxControl) - -BEGIN_EVENT_TABLE(wxSlider, wxControl) - EVT_SIZE(wxSlider::OnSize) -END_EVENT_TABLE() - -// ---------------------------------------------------------------------------- -// wxSlider creation -// ---------------------------------------------------------------------------- - -#ifdef __VISUALC__ - // warning C4355: 'this' : used in base member initializer list - #pragma warning(disable:4355) -#endif - -wxSlider::wxSlider() - : m_thumb(this) -{ - Init(); -} - -wxSlider::wxSlider(wxWindow *parent, - wxWindowID id, - int value, int minValue, int maxValue, - const wxPoint& pos, - const wxSize& size, - long style, - const wxValidator& validator, - const wxString& name) - : m_thumb(this) -{ - Init(); - - (void)Create(parent, id, value, minValue, maxValue, - pos, size, style, validator, name); -} - -#ifdef __VISUALC__ - // warning C4355: 'this' : used in base member initializer list - #pragma warning(default:4355) -#endif - -void wxSlider::Init() -{ - m_min = - m_max = - m_value = 0; - - m_tickFreq = 1; - - m_lineSize = - m_pageSize = 0; - - m_thumbSize = 0; - m_thumbFlags = 0; -} - -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 ( !wxSliderBase::Create(parent, id, pos, size, style, - validator, name) ) - return false; - - SetRange(minValue, maxValue); - SetValue(value); - - // call this after setting the range as the best size depends (at least if - // we have wxSL_LABELS style) on the range - SetInitialSize(size); - - CreateInputHandler(wxINP_HANDLER_SLIDER); - - return true; -} - -// ---------------------------------------------------------------------------- -// wxSlider range and value -// ---------------------------------------------------------------------------- - -int wxSlider::GetValue() const -{ - return m_value; -} - -int wxSlider::NormalizeValue(int value) const -{ - if ( value < m_min ) - return m_min; - else if ( value > m_max ) - return m_max; - else - return value; -} - -bool wxSlider::ChangeValueBy(int inc) -{ - return ChangeValueTo(NormalizeValue(m_value + inc)); -} - -bool wxSlider::ChangeValueTo(int value) -{ - // check if the value is going to change at all - if (value == m_value) - return false; - - // this method is protected and we should only call it with normalized - // value! - wxCHECK_MSG( IsInRange(value), false, _T("invalid slider value") ); - - m_value = value; - - Refresh(); - - // generate the events: both a specific scroll event and a command event - wxScrollEvent eventScroll(wxEVT_SCROLL_CHANGED, GetId()); - eventScroll.SetPosition(m_value); - eventScroll.SetEventObject( this ); - (void)GetEventHandler()->ProcessEvent(eventScroll); - - wxCommandEvent event(wxEVT_COMMAND_SLIDER_UPDATED, GetId()); - event.SetInt(m_value); - event.SetEventObject(this); - (void)GetEventHandler()->ProcessEvent(event); - - return true; -} - -void wxSlider::SetValue(int value) -{ - value = NormalizeValue(value); - - if ( m_value != value ) - { - m_value = value; - - Refresh(); - } -} - -void wxSlider::SetRange(int minValue, int maxValue) -{ - if ( minValue > maxValue ) - { - // swap them, we always want min to be less than max - int tmp = minValue; - minValue = maxValue; - maxValue = tmp; - } - - if ( m_min != minValue || m_max != maxValue ) - { - m_min = minValue; - m_max = maxValue; - - // reset the value to make sure it is in the new range - SetValue(m_value); - - // the size of the label rect might have changed - if ( HasLabels() ) - { - CalcGeometry(); - } - - Refresh(); - } - //else: nothing changed -} - -int wxSlider::GetMin() const -{ - return m_min; -} - -int wxSlider::GetMax() const -{ - return m_max; -} - -// ---------------------------------------------------------------------------- -// wxSlider line/page/thumb size -// ---------------------------------------------------------------------------- - -void wxSlider::SetLineSize(int lineSize) -{ - wxCHECK_RET( lineSize >= 0, _T("invalid slider line size") ); - - m_lineSize = lineSize; -} - -void wxSlider::SetPageSize(int pageSize) -{ - wxCHECK_RET( pageSize >= 0, _T("invalid slider page size") ); - - m_pageSize = pageSize; -} - -int wxSlider::GetLineSize() const -{ - if ( !m_lineSize ) - { - // the default line increment is 1 - wxConstCast(this, wxSlider)->m_lineSize = 1; - } - - return m_lineSize; -} - -int wxSlider::GetPageSize() const -{ - if ( !m_pageSize ) - { - // the default page increment is m_tickFreq - wxConstCast(this, wxSlider)->m_pageSize = m_tickFreq; - } - - return m_pageSize; -} - -void wxSlider::SetThumbLength(int lenPixels) -{ - wxCHECK_RET( lenPixels >= 0, _T("invalid slider thumb size") ); - - // use m_thumbSize here directly and not GetThumbLength() to avoid setting - // it to the default value as we don't need it - if ( lenPixels != m_thumbSize ) - { - m_thumbSize = lenPixels; - - Refresh(); - } -} - -int wxSlider::GetThumbLength() const -{ - wxSize sz = GetDefaultThumbSize(); - int len = (IsVert() ? sz.x : sz.y); - if (m_thumbSize > len) - { - return m_thumbSize; - } - else - { - return len; - } - -} - -// ---------------------------------------------------------------------------- -// wxSlider ticks -// ---------------------------------------------------------------------------- - -void wxSlider::SetTickFreq(int n, int WXUNUSED(dummy)) -{ - wxCHECK_RET (n > 0, _T("invalid slider tick frequency")); - - if ( n != m_tickFreq ) - { - m_tickFreq = n; - - Refresh(); - } -} - -// ---------------------------------------------------------------------------- -// wxSlider geometry -// ---------------------------------------------------------------------------- - -wxSize wxSlider::CalcLabelSize() const -{ - wxSize size; - - // there is no sense in trying to calc the labels size if we haven't got - // any, the caller must check for it - wxCHECK_MSG( HasLabels(), size, _T("shouldn't be called") ); - - wxCoord w1, h1, w2, h2; - GetTextExtent(FormatValue(m_min), &w1, &h1); - GetTextExtent(FormatValue(m_max), &w2, &h2); - - size.x = wxMax(w1, w2); - size.y = wxMax(h1, h2); - - return size; -} - -wxSize wxSlider::DoGetBestClientSize() const -{ - // this dimension is completely arbitrary - static const wxCoord SLIDER_WIDTH = 40; - - long style = GetWindowStyle(); - - // first calculate the size of the slider itself: i.e. the shaft and the - // thumb - wxCoord height = GetRenderer()->GetSliderDim(); - - wxSize size; - if ( IsVert() ) - { - size.x = height; - size.y = SLIDER_WIDTH; - } - else // horizontal - { - size.x = SLIDER_WIDTH; - size.y = height; - } - - // add space for ticks - if ( HasTicks() ) - { - wxCoord lenTick = GetRenderer()->GetSliderTickLen(); - if (style & wxSL_BOTH) - { - lenTick = 2 * lenTick; - } - - if ( IsVert() ) - size.x += lenTick; - else - size.y += lenTick; - } - - // if we have the label, reserve enough space for it - if ( HasLabels() ) - { - wxSize sizeLabels = CalcLabelSize(); - - if (style & (wxSL_LEFT|wxSL_RIGHT)) - { - size.x += sizeLabels.x + SLIDER_LABEL_MARGIN; - } - else if (style & (wxSL_TOP|wxSL_BOTTOM)) - { - size.y += sizeLabels.y + SLIDER_LABEL_MARGIN; - } - } - - return size; -} - -void wxSlider::OnSize(wxSizeEvent& event) -{ - CalcGeometry(); - - event.Skip(); -} - -const wxRect& wxSlider::GetSliderRect() const -{ - if ( m_rectSlider.width < 0 ) - { - wxConstCast(this, wxSlider)->CalcGeometry(); - } - - return m_rectSlider; -} - -void wxSlider::CalcGeometry() -{ - /* - recalc the label and slider positions, this looks like this for - wxSL_HORIZONTAL | wxSL_TOP slider: - - LLL lll - ------------------------- - | T | <-- this is the slider rect - | HHHHHHHHHHHHHHHTHHHHH | - | T | - | * * * * * * * *| - ------------------------- - - LLL is m_rectLabel as calculated here and lll is the real rect used for - label drawing in OnDraw() (TTT indicated the thumb position and *s are - the ticks) - - in the wxSL_VERTICAL | wxSL_RIGHT case the picture is like this: - - ------ LLL - | H | - | H *| - | H | - | H *| - | H | - | H *| - | H | - |TTT*| lll - | H | - | H *| - ------ - */ - long style = GetWindowStyle(); - - // initialize to the full client rect - wxRect rectTotal = GetClientRect(); - m_rectSlider = rectTotal; - wxSize sizeThumb = GetThumbSize(); - - // Labels reduce the size of the slider rect - if ( HasLabels() ) - { - wxSize sizeLabels = CalcLabelSize(); - - m_rectLabel = wxRect(rectTotal.GetPosition(), sizeLabels); - - if (style & wxSL_TOP) - { - // shrink and offset the slider to the bottom - m_rectSlider.y += sizeLabels.y + SLIDER_LABEL_MARGIN; - m_rectSlider.height -= sizeLabels.y + SLIDER_LABEL_MARGIN; - } - else if (style & wxSL_BOTTOM) - { - // shrink the slider and move the label to the bottom - m_rectSlider.height -= sizeLabels.y + SLIDER_LABEL_MARGIN; - m_rectLabel.y += m_rectSlider.height + SLIDER_LABEL_MARGIN; - } - else if (style & wxSL_LEFT) - { - // shrink and offset the slider to the right - m_rectSlider.x += sizeLabels.x + SLIDER_LABEL_MARGIN; - m_rectSlider.width -= sizeLabels.x + SLIDER_LABEL_MARGIN; - } - else if (style & wxSL_RIGHT) - { - // shrink the slider and move the label to the right - m_rectSlider.width -= sizeLabels.x + SLIDER_LABEL_MARGIN; - m_rectLabel.x += m_rectSlider.width + SLIDER_LABEL_MARGIN; - } - } - - // calculate ticks too - if ( HasTicks() ) - { - wxCoord lenTick = GetRenderer()->GetSliderTickLen(); - - // it - m_rectTicks = GetShaftRect(); - - if ( IsVert() ) - { - if (style & (wxSL_LEFT|wxSL_BOTH)) - { - m_rectTicks.x = m_rectSlider.x; - } - else - { // wxSL_RIGHT - m_rectTicks.x = m_rectSlider.x + m_rectSlider.width - lenTick; - } - m_rectTicks.width = lenTick; - } - else // horizontal - { - if (style & (wxSL_TOP|wxSL_BOTH)) - { - m_rectTicks.y = m_rectSlider.y; - } - else - { // wxSL_BOTTOM - m_rectTicks.y = m_rectSlider.y + m_rectSlider.height - lenTick; - } - m_rectTicks.height = lenTick; - } - } - - // slider is never smaller than thumb size unless rectTotal - if ( IsVert() ) - { - wxCoord width = wxMin ( rectTotal.width, sizeThumb.x ); - m_rectSlider.width = wxMax ( m_rectSlider.width, width ); - } - else - { - wxCoord height = wxMin ( rectTotal.height, sizeThumb.y ); - m_rectSlider.height = wxMax ( m_rectSlider.height, height ); - } -} - -wxSize wxSlider::GetDefaultThumbSize() const -{ - // Default size has no styles (arrows) - return GetRenderer()->GetSliderThumbSize(GetSliderRect(), 0, GetOrientation()); -} - -wxSize wxSlider::GetThumbSize() const -{ - return GetRenderer()->GetSliderThumbSize(GetSliderRect(), m_thumbSize, GetOrientation()); -} - -// ---------------------------------------------------------------------------- -// wxSlider thumb geometry -// ---------------------------------------------------------------------------- - -wxRect wxSlider::GetShaftRect() const -{ - return GetRenderer()->GetSliderShaftRect(m_rectSlider, m_thumbSize, GetOrientation(), GetWindowStyle()); -} - -void wxSlider::CalcThumbRect(const wxRect *rectShaftIn, - wxRect *rectThumbOut, - wxRect *rectLabelOut, - int value) const -{ - if ( value == INVALID_THUMB_VALUE ) - { - // use the current if not specified - value = m_value; - } - - bool isVertical = IsVert(); - - wxRect rectShaft; - if ( rectShaftIn ) - { - rectShaft = *rectShaftIn; - } - else // no shaft rect provided, calc it - { - rectShaft = GetShaftRect(); - } - - wxCoord lenShaft, - lenThumb; - wxCoord *p; - - wxRect rectThumb(rectShaft.GetPosition(), GetThumbSize()); - if ( isVertical ) - { - rectThumb.x += (rectShaft.width - rectThumb.width) / 2; - - lenThumb = rectThumb.height; - lenShaft = rectShaft.height; - p = &rectThumb.y; - } - else // horz - { - rectThumb.y += (rectShaft.height - rectThumb.height) / 2; - - lenThumb = rectThumb.width; - lenShaft = rectShaft.width; - p = &rectThumb.x; - } - - // the thumb must always be entirely inside the shaft limits, so the max - // position is not at lenShaft but at lenShaft - thumbSize - if ( m_max != m_min ) - { - if ( isVertical ) - { - *p += ((lenShaft - lenThumb)*(m_max - value))/(m_max - m_min); - } - else - { // horz - *p += ((lenShaft - lenThumb)*(value - m_min))/(m_max - m_min); - } - } - - // calc the label rect - if ( HasLabels() && rectLabelOut ) - { - long style = GetWindowStyle(); - wxRect rectLabel = m_rectLabel; - - // centre the label relatively to the thumb position - if (style & (wxSL_TOP|wxSL_BOTTOM)) - { - rectLabel.x = rectThumb.x + (rectThumb.width - m_rectLabel.width)/2; - } - else if (style & (wxSL_LEFT|wxSL_RIGHT)) - { - rectLabel.y = rectThumb.y + (rectThumb.height - m_rectLabel.height)/2; - } - - *rectLabelOut = rectLabel; - } - - if ( rectThumbOut ) - - *rectThumbOut = rectThumb; -} - -// ---------------------------------------------------------------------------- -// wxSlider drawing -// ---------------------------------------------------------------------------- - -wxString wxSlider::FormatValue(int value) const -{ - return wxString::Format(_T("%d"), value); -} - -void wxSlider::DoDraw(wxControlRenderer *renderer) -{ - wxRenderer *rend = GetRenderer(); - wxDC& dc = renderer->GetDC(); - wxRect rectUpdate = GetUpdateClientRect(); - - wxOrientation orient = GetOrientation(); - int flags = GetStateFlags(); - long style = GetWindowStyle(); - - wxSize sz = GetThumbSize(); - int len = IsVert() ? sz.x : sz.y; - - // first draw the shaft - wxRect rectShaft = rend->GetSliderShaftRect(m_rectSlider, len, orient, style); - if ( rectUpdate.Intersects(rectShaft) ) - { - rend->DrawSliderShaft(dc, m_rectSlider, len, orient, flags, style); - } - - // calculate the thumb position in pixels and draw it - wxRect rectThumb, rectLabel; - CalcThumbRect(&rectShaft, &rectThumb, &rectLabel); - - // then draw the ticks - if ( HasTicks() && rectUpdate.Intersects(m_rectTicks) ) - { - rend->DrawSliderTicks(dc, m_rectSlider, len, orient, - m_min, m_max, m_tickFreq, flags, style); - } - - // then draw the thumb - if ( rectUpdate.Intersects(rectThumb) ) - { - rend->DrawSliderThumb(dc, rectThumb, orient, flags | m_thumbFlags, style); - } - - // finally, draw the label near the thumb - if ( HasLabels() && rectUpdate.Intersects(rectLabel) ) - { - // align it to be close to the shaft - int align = 0; - if (style & wxSL_TOP) - { - align = wxALIGN_CENTRE_HORIZONTAL|wxALIGN_TOP; - } - else if (style & wxSL_BOTTOM) - { - align = wxALIGN_CENTRE_HORIZONTAL|wxALIGN_BOTTOM; - } - else if (style & wxSL_LEFT) - { - align = wxALIGN_CENTRE_VERTICAL|wxALIGN_LEFT; - } - else if (style & wxSL_RIGHT) - { - align = wxALIGN_CENTRE_VERTICAL|wxALIGN_RIGHT; - } - - dc.SetFont(GetFont()); - dc.SetTextForeground(GetForegroundColour()); - - // the slider label is never drawn focused - rend->DrawLabel(dc, FormatValue(m_value), rectLabel, - flags & ~wxCONTROL_FOCUSED, align); - } -} - -// ---------------------------------------------------------------------------- -// wxSlider input processing -// ---------------------------------------------------------------------------- - -bool wxSlider::PerformAction(const wxControlAction& action, - long numArg, - const wxString& strArg) -{ - wxEventType scrollEvent = wxEVT_NULL; - int value; - bool valueChanged = true; - - if ( action == wxACTION_SLIDER_START ) - { - scrollEvent = wxEVT_SCROLL_TOP; - value = m_min; - } - else if ( action == wxACTION_SLIDER_END ) - { - scrollEvent = wxEVT_SCROLL_BOTTOM; - value = m_max; - } - else if ( action == wxACTION_SLIDER_PAGE_CHANGE ) - { - value = NormalizeValue(m_value + numArg * GetPageSize()); - } - else if ( action == wxACTION_SLIDER_LINE_UP ) - { - scrollEvent = wxEVT_SCROLL_LINEUP; - value = NormalizeValue(m_value + +GetLineSize()); - } - else if ( action == wxACTION_SLIDER_LINE_DOWN ) - { - scrollEvent = wxEVT_SCROLL_LINEDOWN; - value = NormalizeValue(m_value + -GetLineSize()); - } - else if ( action == wxACTION_SLIDER_PAGE_UP ) - { - scrollEvent = wxEVT_SCROLL_PAGEUP; - value = NormalizeValue(m_value + +GetPageSize()); - } - else if ( action == wxACTION_SLIDER_PAGE_DOWN ) - { - scrollEvent = wxEVT_SCROLL_PAGEDOWN; - value = NormalizeValue(m_value + -GetPageSize()); - } - else if ( action == wxACTION_SLIDER_THUMB_DRAG || - action == wxACTION_SLIDER_THUMB_MOVE ) - { - scrollEvent = wxEVT_SCROLL_THUMBTRACK; - - // we shouldn't generate a command event about this change but we still - // should update our value and the slider appearance - valueChanged = false; - m_value = - value = (int)numArg; - Refresh(); - } - else if ( action == wxACTION_SLIDER_THUMB_RELEASE ) - { - scrollEvent = wxEVT_SCROLL_THUMBRELEASE; - value = (int)numArg; - } - else - { - return wxControl::PerformAction(action, numArg, strArg); - } - - // update wxSlider current value and generate wxCommandEvent, except while - // dragging the thumb - if ( valueChanged ) - ChangeValueTo(value); - - // also generate more precise wxScrollEvent if applicable - if ( scrollEvent != wxEVT_NULL ) - { - wxScrollEvent event(scrollEvent, GetId()); - event.SetPosition(value); - event.SetEventObject( this ); - GetEventHandler()->ProcessEvent(event); - } - - return true; -} - -/* static */ -wxInputHandler *wxSlider::GetStdInputHandler(wxInputHandler *handlerDef) -{ - static wxStdSliderInputHandler s_handler(handlerDef); - - return &s_handler; -} - -// ---------------------------------------------------------------------------- -// wxSlider implementation of wxControlWithThumb interface -// ---------------------------------------------------------------------------- - -wxScrollThumb::Shaft wxSlider::HitTest(const wxPoint& pt) const -{ - wxRect rectShaft = GetShaftRect(); - wxRect rectThumb; - CalcThumbRect(&rectShaft, &rectThumb, NULL); - - // check for possible shaft or thumb hit - if (!rectShaft.Contains(pt) && !rectThumb.Contains(pt)) - { - return wxScrollThumb::Shaft_None; - } - - // the position to test and the start and end of the thumb - wxCoord x, x1, x2, x3, x4; - if (IsVert()) - { - x = pt.y; - x1 = rectThumb.GetBottom(); - x2 = rectShaft.GetBottom(); - x3 = rectShaft.GetTop(); - x4 = rectThumb.GetTop(); - } - else - { // horz - x = pt.x; - x1 = rectShaft.GetLeft(); - x2 = rectThumb.GetLeft(); - x3 = rectThumb.GetRight(); - x4 = rectShaft.GetRight(); - } - if ((x1 <= x) && (x < x2)) - { - // or to the left - return wxScrollThumb::Shaft_Above; - } - - if ((x3 < x) && (x <= x4)) { - // or to the right - return wxScrollThumb::Shaft_Below; - } - - // where else can it be? - return wxScrollThumb::Shaft_Thumb; -} - -wxCoord wxSlider::ThumbPosToPixel() const -{ - wxRect rectThumb; - CalcThumbRect(NULL, &rectThumb, NULL); - - return IsVert() ? rectThumb.y : rectThumb.x; -} - -int wxSlider::PixelToThumbPos(wxCoord x) const -{ - wxRect rectShaft = GetShaftRect(); - wxSize sizeThumb = GetThumbSize(); - - wxCoord x0, len; - if ( IsVert() ) - { - x0 = rectShaft.y; - len = rectShaft.height - sizeThumb.y; - } - else // horz - { - x0 = rectShaft.x; - len = rectShaft.width - sizeThumb.x; - } - - int pos = m_min; - if ( len > 0 ) - { - if ( x > x0 ) - { - pos += ((x - x0) * (m_max - m_min)) / len; - if ( pos > m_max ) - pos = m_max; - } - //else: x <= x0, leave pos = min - } - - return pos; -} - -void wxSlider::SetShaftPartState(wxScrollThumb::Shaft shaftPart, - int flag, - bool set) -{ - // for now we ignore the flags for the shaft as no renderer uses them - // anyhow - if ( shaftPart == wxScrollThumb::Shaft_Thumb ) - { - if ( set ) - m_thumbFlags |= flag; - else - m_thumbFlags &= ~flag; - - Refresh(); - } -} - -void wxSlider::OnThumbDragStart(int pos) -{ - if (IsVert()) - { - PerformAction(wxACTION_SLIDER_THUMB_DRAG, m_max - pos); - } - else - { - PerformAction(wxACTION_SLIDER_THUMB_DRAG, pos); - } -} - -void wxSlider::OnThumbDrag(int pos) -{ - if (IsVert()) - { - PerformAction(wxACTION_SLIDER_THUMB_MOVE, m_max - pos); - } - else - { - PerformAction(wxACTION_SLIDER_THUMB_MOVE, pos); - } -} - -void wxSlider::OnThumbDragEnd(int pos) -{ - if (IsVert()) - { - PerformAction(wxACTION_SLIDER_THUMB_RELEASE, m_max - pos); - } - else - { - PerformAction(wxACTION_SLIDER_THUMB_RELEASE, pos); - } -} - -void wxSlider::OnPageScrollStart() -{ - // we do nothing here -} - -bool wxSlider::OnPageScroll(int pageInc) -{ - int value = GetValue(); - PerformAction(wxACTION_SLIDER_PAGE_CHANGE, pageInc); - - return GetValue() != value; -} - -// ---------------------------------------------------------------------------- -// wxStdSliderInputHandler -// ---------------------------------------------------------------------------- - -bool wxStdSliderInputHandler::HandleKey(wxInputConsumer *consumer, - const wxKeyEvent& event, - bool pressed) -{ - if ( pressed ) - { - int keycode = event.GetKeyCode(); - - wxControlAction action; - switch ( keycode ) - { - case WXK_HOME: - action = wxACTION_SLIDER_END; - break; - - case WXK_END: - action = wxACTION_SLIDER_START; - break; - - case WXK_RIGHT: - case WXK_UP: - action = wxACTION_SLIDER_LINE_UP; - break; - - case WXK_LEFT: - case WXK_DOWN: - action = wxACTION_SLIDER_LINE_DOWN; - break; - - case WXK_PAGEUP: - action = wxACTION_SLIDER_PAGE_UP; - break; - - case WXK_PAGEDOWN: - action = wxACTION_SLIDER_PAGE_DOWN; - break; - } - - if ( !action.IsEmpty() ) - { - consumer->PerformAction(action); - - return true; - } - } - - return wxStdInputHandler::HandleKey(consumer, event, pressed); -} - -bool wxStdSliderInputHandler::HandleMouse(wxInputConsumer *consumer, - const wxMouseEvent& event) -{ - wxSlider *slider = wxStaticCast(consumer->GetInputWindow(), wxSlider); - - if ( slider->GetThumb().HandleMouse(event) ) - { - // processed by the thumb - return false; - } - - return wxStdInputHandler::HandleMouse(consumer, event); -} - -bool wxStdSliderInputHandler::HandleMouseMove(wxInputConsumer *consumer, - const wxMouseEvent& event) -{ - wxSlider *slider = wxStaticCast(consumer->GetInputWindow(), wxSlider); - - if ( slider->GetThumb().HandleMouseMove(event) ) - { - // processed by the thumb - return false; - } - - return wxStdInputHandler::HandleMouseMove(consumer, event); -} - -bool -wxStdSliderInputHandler::HandleFocus(wxInputConsumer * WXUNUSED(consumer), - const wxFocusEvent& WXUNUSED(event)) -{ - // slider appearance changes when it gets/loses focus - return true; -} - -#endif // wxUSE_SLIDER diff --git a/wxWidgets/src/univ/spinbutt.cpp b/wxWidgets/src/univ/spinbutt.cpp deleted file mode 100644 index 1487e3c68a..0000000000 --- a/wxWidgets/src/univ/spinbutt.cpp +++ /dev/null @@ -1,436 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: univ/spinbutt.cpp -// Purpose: implementation of the universal version of wxSpinButton -// Author: Vadim Zeitlin -// Modified by: -// Created: 21.01.01 -// RCS-ID: $Id: spinbutt.cpp 42816 2006-10-31 08:50:17Z RD $ -// Copyright: (c) 2001 SciTech Software, Inc. (www.scitechsoft.com) -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#ifndef WX_PRECOMP -#endif - -#include "wx/spinbutt.h" - -#if wxUSE_SPINBTN - -#include "wx/univ/renderer.h" -#include "wx/univ/inphand.h" -#include "wx/univ/theme.h" - -// ============================================================================ -// implementation of wxSpinButton -// ============================================================================ - -IMPLEMENT_DYNAMIC_CLASS(wxSpinEvent, wxNotifyEvent) -IMPLEMENT_DYNAMIC_CLASS(wxSpinButton, wxControl) - -// ---------------------------------------------------------------------------- -// creation -// ---------------------------------------------------------------------------- - -#ifdef __VISUALC__ - // warning C4355: 'this' : used in base member initializer list - #pragma warning(disable:4355) // so what? disable it... -#endif - -wxSpinButton::wxSpinButton() - : m_arrows(this) -{ - Init(); -} - -wxSpinButton::wxSpinButton(wxWindow *parent, - wxWindowID id, - const wxPoint& pos, - const wxSize& size, - long style, - const wxString& name) - : m_arrows(this) -{ - Init(); - - (void)Create(parent, id, pos, size, style, name); -} - -#ifdef __VISUALC__ - // warning C4355: 'this' : used in base member initializer list - #pragma warning(default:4355) -#endif - -void wxSpinButton::Init() -{ - for ( size_t n = 0; n < WXSIZEOF(m_arrowsState); n++ ) - { - m_arrowsState[n] = 0; - } - - m_value = 0; -} - -bool wxSpinButton::Create(wxWindow *parent, - wxWindowID id, - const wxPoint& pos, - const wxSize& size, - long style, - const wxString& name) -{ - // the spin buttons never have the border - style &= ~wxBORDER_MASK; - - if ( !wxSpinButtonBase::Create(parent, id, pos, size, style, - wxDefaultValidator, name) ) - return false; - - SetInitialSize(size); - - CreateInputHandler(wxINP_HANDLER_SPINBTN); - - return true; -} - -// ---------------------------------------------------------------------------- -// value access -// ---------------------------------------------------------------------------- - -void wxSpinButton::SetRange(int minVal, int maxVal) -{ - wxSpinButtonBase::SetRange(minVal, maxVal); - - // because the arrows disabled state might have changed - we don't check if - // it really changed or not because SetRange() is called rarely enough and - // son an extre refresh here doesn't really hurt - Refresh(); -} - -int wxSpinButton::GetValue() const -{ - return m_value; -} - -void wxSpinButton::SetValue(int val) -{ - if ( val != m_value ) - { - m_value = val; - - Refresh(); - } -} - -int wxSpinButton::NormalizeValue(int value) const -{ - if ( value > m_max ) - { - if ( GetWindowStyleFlag() & wxSP_WRAP ) - value = m_min + (value - m_max - 1) % (m_max - m_min + 1); - else - value = m_max; - } - else if ( value < m_min ) - { - if ( GetWindowStyleFlag() & wxSP_WRAP ) - value = m_max - (m_min - value - 1) % (m_max - m_min + 1); - else - value = m_min; - } - - return value; -} - -bool wxSpinButton::ChangeValue(int inc) -{ - int valueNew = NormalizeValue(m_value + inc); - - if ( valueNew == m_value ) - { - // nothing changed - most likely because we are already at min/max - // value - return false; - } - - wxSpinEvent event(inc > 0 ? wxEVT_SCROLL_LINEUP : wxEVT_SCROLL_LINEDOWN, - GetId()); - event.SetPosition(valueNew); - event.SetEventObject(this); - - if ( GetEventHandler()->ProcessEvent(event) && !event.IsAllowed() ) - { - // programm has vetoed the event - return false; - } - - m_value = valueNew; - - // send wxEVT_SCROLL_THUMBTRACK as well - event.SetEventType(wxEVT_SCROLL_THUMBTRACK); - (void)GetEventHandler()->ProcessEvent(event); - - return true; -} - -// ---------------------------------------------------------------------------- -// size calculations -// ---------------------------------------------------------------------------- - -wxSize wxSpinButton::DoGetBestClientSize() const -{ - // a spin button has by default the same size as two scrollbar arrows put - // together - wxSize size = m_renderer->GetScrollbarArrowSize(); - if ( IsVertical() ) - { - size.y *= 2; - } - else - { - size.x *= 2; - } - - return size; -} - -// ---------------------------------------------------------------------------- -// wxControlWithArrows methods -// ---------------------------------------------------------------------------- - -int wxSpinButton::GetArrowState(wxScrollArrows::Arrow arrow) const -{ - int state = m_arrowsState[arrow]; - - // the arrow may also be disabled: either because the control is completely - // disabled - bool disabled = !IsEnabled(); - - if ( !disabled && !(GetWindowStyleFlag() & wxSP_WRAP) ) - { - // ... or because we can't go any further - note that this never - // happens if we just wrap - if ( IsVertical() ) - { - if ( arrow == wxScrollArrows::Arrow_First ) - disabled = m_value == m_max; - else - disabled = m_value == m_min; - } - else // horizontal - { - if ( arrow == wxScrollArrows::Arrow_First ) - disabled = m_value == m_min; - else - disabled = m_value == m_max; - } - } - - if ( disabled ) - { - state |= wxCONTROL_DISABLED; - } - - return state; -} - -void wxSpinButton::SetArrowFlag(wxScrollArrows::Arrow arrow, int flag, bool set) -{ - int state = m_arrowsState[arrow]; - if ( set ) - state |= flag; - else - state &= ~flag; - - if ( state != m_arrowsState[arrow] ) - { - m_arrowsState[arrow] = state; - Refresh(); - } -} - -bool wxSpinButton::OnArrow(wxScrollArrows::Arrow arrow) -{ - int valueOld = GetValue(); - - wxControlAction action; - if ( arrow == wxScrollArrows::Arrow_First ) - action = IsVertical() ? wxACTION_SPIN_INC : wxACTION_SPIN_DEC; - else - action = IsVertical() ? wxACTION_SPIN_DEC : wxACTION_SPIN_INC; - - PerformAction(action); - - // did we scroll to the end? - return GetValue() != valueOld; -} - -// ---------------------------------------------------------------------------- -// drawing -// ---------------------------------------------------------------------------- - -void wxSpinButton::DoDraw(wxControlRenderer *renderer) -{ - wxRect rectArrow1, rectArrow2; - CalcArrowRects(&rectArrow1, &rectArrow2); - - wxDC& dc = renderer->GetDC(); - m_arrows.DrawArrow(wxScrollArrows::Arrow_First, dc, rectArrow1); - m_arrows.DrawArrow(wxScrollArrows::Arrow_Second, dc, rectArrow2); -} - -// ---------------------------------------------------------------------------- -// geometry -// ---------------------------------------------------------------------------- - -void wxSpinButton::CalcArrowRects(wxRect *rect1, wxRect *rect2) const -{ - // calculate the rectangles for both arrows: note that normally the 2 - // arrows are adjacent to each other but if the total control width/height - // is odd, we can have 1 pixel between them - wxRect rectTotal = GetClientRect(); - - *rect1 = - *rect2 = rectTotal; - if ( IsVertical() ) - { - rect1->height /= 2; - rect2->height /= 2; - - rect2->y += rect1->height; - if ( rectTotal.height % 2 ) - rect2->y++; - } - else // horizontal - { - rect1->width /= 2; - rect2->width /= 2; - - rect2->x += rect1->width; - if ( rectTotal.width % 2 ) - rect2->x++; - } -} - -wxScrollArrows::Arrow wxSpinButton::HitTestArrow(const wxPoint& pt) const -{ - wxRect rectArrow1, rectArrow2; - CalcArrowRects(&rectArrow1, &rectArrow2); - - if ( rectArrow1.Contains(pt) ) - return wxScrollArrows::Arrow_First; - else if ( rectArrow2.Contains(pt) ) - return wxScrollArrows::Arrow_Second; - else - return wxScrollArrows::Arrow_None; -} - -// ---------------------------------------------------------------------------- -// input processing -// ---------------------------------------------------------------------------- - -bool wxSpinButton::PerformAction(const wxControlAction& action, - long numArg, - const wxString& strArg) -{ - if ( action == wxACTION_SPIN_INC ) - ChangeValue(+1); - else if ( action == wxACTION_SPIN_DEC ) - ChangeValue(-1); - else - return wxControl::PerformAction(action, numArg, strArg); - - return true; -} - -/* static */ -wxInputHandler *wxSpinButton::GetStdInputHandler(wxInputHandler *handlerDef) -{ - static wxStdSpinButtonInputHandler s_handler(handlerDef); - - return &s_handler; -} - -// ---------------------------------------------------------------------------- -// wxStdSpinButtonInputHandler -// ---------------------------------------------------------------------------- - -wxStdSpinButtonInputHandler:: -wxStdSpinButtonInputHandler(wxInputHandler *inphand) - : wxStdInputHandler(inphand) -{ -} - -bool wxStdSpinButtonInputHandler::HandleKey(wxInputConsumer *consumer, - const wxKeyEvent& event, - bool pressed) -{ - if ( pressed ) - { - wxControlAction action; - switch ( event.GetKeyCode() ) - { - case WXK_DOWN: - case WXK_RIGHT: - action = wxACTION_SPIN_DEC; - break; - - case WXK_UP: - case WXK_LEFT: - action = wxACTION_SPIN_INC; - break; - } - - if ( !action.IsEmpty() ) - { - consumer->PerformAction(action); - - return true; - } - } - - return wxStdInputHandler::HandleKey(consumer, event, pressed); -} - -bool wxStdSpinButtonInputHandler::HandleMouse(wxInputConsumer *consumer, - const wxMouseEvent& event) -{ - wxSpinButton *spinbtn = wxStaticCast(consumer->GetInputWindow(), wxSpinButton); - - if ( spinbtn->GetArrows().HandleMouse(event) ) - { - // don't refresh, everything is already done - return false; - } - - return wxStdInputHandler::HandleMouse(consumer, event); -} - -bool wxStdSpinButtonInputHandler::HandleMouseMove(wxInputConsumer *consumer, - const wxMouseEvent& event) -{ - wxSpinButton *spinbtn = wxStaticCast(consumer->GetInputWindow(), wxSpinButton); - - if ( spinbtn->GetArrows().HandleMouseMove(event) ) - { - // processed by the arrows - return false; - } - - return wxStdInputHandler::HandleMouseMove(consumer, event); -} - - -#endif // wxUSE_SPINBTN diff --git a/wxWidgets/src/univ/statbmp.cpp b/wxWidgets/src/univ/statbmp.cpp deleted file mode 100644 index bb1a0a5a23..0000000000 --- a/wxWidgets/src/univ/statbmp.cpp +++ /dev/null @@ -1,108 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/univ/statbmp.cpp -// Purpose: wxStaticBitmap implementation -// Author: Vadim Zeitlin -// Modified by: -// Created: 25.08.00 -// RCS-ID: $Id: statbmp.cpp 42816 2006-10-31 08:50:17Z RD $ -// Copyright: (c) 2000 SciTech Software, Inc. (www.scitechsoft.com) -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_STATBMP - -#include "wx/statbmp.h" - -#ifndef WX_PRECOMP - #include "wx/dc.h" - #include "wx/icon.h" - #include "wx/validate.h" -#endif - -#include "wx/univ/renderer.h" -#include "wx/univ/theme.h" - -// ============================================================================ -// implementation -// ============================================================================ - -IMPLEMENT_DYNAMIC_CLASS(wxStaticBitmap, wxControl) - -// ---------------------------------------------------------------------------- -// wxStaticBitmap -// ---------------------------------------------------------------------------- - -bool wxStaticBitmap::Create(wxWindow *parent, - wxWindowID id, - const wxBitmap &label, - const wxPoint &pos, - const wxSize &size, - long style, - const wxString &name) -{ - if ( !wxControl::Create(parent, id, pos, size, style, wxDefaultValidator, name) ) - return false; - - // set bitmap first - SetBitmap(label); - - // and adjust our size to fit it after this - SetInitialSize(size); - - return true; -} - -// ---------------------------------------------------------------------------- -// bitmap/icon setting/getting and converting between -// ---------------------------------------------------------------------------- - -void wxStaticBitmap::SetBitmap(const wxBitmap& bitmap) -{ - m_bitmap = bitmap; -} - -void wxStaticBitmap::SetIcon(const wxIcon& icon) -{ -#ifdef __WXMSW__ - m_bitmap.CopyFromIcon(icon); -#else - m_bitmap = (const wxBitmap&)icon; -#endif -} - -wxIcon wxStaticBitmap::GetIcon() const -{ - wxIcon icon; -#ifdef __WXMSW__ - icon.CopyFromBitmap(m_bitmap); -#else - icon = (const wxIcon&)m_bitmap; -#endif - return icon; -} - -// ---------------------------------------------------------------------------- -// drawing -// ---------------------------------------------------------------------------- - -void wxStaticBitmap::DoDraw(wxControlRenderer *renderer) -{ - wxControl::DoDraw(renderer); - renderer->DrawBitmap(GetBitmap()); -} - -#endif // wxUSE_STATBMP diff --git a/wxWidgets/src/univ/statbox.cpp b/wxWidgets/src/univ/statbox.cpp deleted file mode 100644 index f06b716364..0000000000 --- a/wxWidgets/src/univ/statbox.cpp +++ /dev/null @@ -1,121 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: univ/statbox.cpp -// Purpose: wxStaticBox implementation -// Author: Vadim Zeitlin -// Modified by: -// Created: 25.08.00 -// RCS-ID: $Id: statbox.cpp 35650 2005-09-23 12:56:45Z MR $ -// Copyright: (c) 2000 SciTech Software, Inc. (www.scitechsoft.com) -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_STATBOX - -#ifndef WX_PRECOMP - #include "wx/dc.h" - #include "wx/statbox.h" - #include "wx/validate.h" -#endif - -#include "wx/univ/renderer.h" - -// ============================================================================ -// implementation -// ============================================================================ - -IMPLEMENT_DYNAMIC_CLASS(wxStaticBox, wxControl) - -// ---------------------------------------------------------------------------- -// wxStaticBox -// ---------------------------------------------------------------------------- - -bool wxStaticBox::Create(wxWindow *parent, - wxWindowID id, - const wxString &label, - const wxPoint &pos, - const wxSize &size, - long style, - const wxString &name) -{ - // FIXME refresh just the right/bottom parts affected in OnSize - style |= wxFULL_REPAINT_ON_RESIZE; - - if ( !wxControl::Create(parent, id, pos, size, style, wxDefaultValidator, name) ) - return false; - - SetLabel(label); - - return true; -} - -void wxStaticBox::DoDraw(wxControlRenderer *renderer) -{ - // we never have a border, so don't call the base class version which draws - // it - renderer->DrawFrame(); -} - -// ---------------------------------------------------------------------------- -// geometry -// ---------------------------------------------------------------------------- - -wxRect wxStaticBox::GetBorderGeometry() const -{ - // FIXME should use the renderer here - wxRect rect; - rect.width = - rect.x = GetCharWidth() / 2 + 1; - rect.y = GetCharHeight() + 1; - rect.height = rect.y / 2; - - return rect; -} - -wxPoint wxStaticBox::GetBoxAreaOrigin() const -{ - wxPoint pt = wxControl::GetClientAreaOrigin(); - wxRect rect = GetBorderGeometry(); - pt.x += rect.x; - pt.y += rect.y; - - return pt; -} - -#if 0 -void wxStaticBox::DoSetClientSize(int width, int height) -{ - wxRect rect = GetBorderGeometry(); - - wxControl::DoSetClientSize(width + rect.x + rect.width, - height + rect.y + rect.height); -} - -void wxStaticBox::DoGetClientSize(int *width, int *height) const -{ - wxControl::DoGetClientSize(width, height); - - wxRect rect = GetBorderGeometry(); - if ( width ) - *width -= rect.x + rect.width; - if ( height ) - *height -= rect.y + rect.height; -} - -#endif // 0 - -#endif // wxUSE_STATBOX - diff --git a/wxWidgets/src/univ/statline.cpp b/wxWidgets/src/univ/statline.cpp deleted file mode 100644 index c326a001e0..0000000000 --- a/wxWidgets/src/univ/statline.cpp +++ /dev/null @@ -1,85 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: univ/statline.cpp -// Purpose: wxStaticLine implementation -// Author: Vadim Zeitlin -// Modified by: -// Created: 25.08.00 -// RCS-ID: $Id: statline.cpp 35650 2005-09-23 12:56:45Z MR $ -// Copyright: (c) 2000 SciTech Software, Inc. (www.scitechsoft.com) -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_STATLINE - -#ifndef WX_PRECOMP - #include "wx/dc.h" - #include "wx/validate.h" -#endif - -#include "wx/statline.h" - -#include "wx/univ/renderer.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 ( !wxControl::Create(parent, id, pos, size, style, wxDefaultValidator, name) ) - return false; - - wxSize sizeReal = AdjustSize(size); - if ( sizeReal != size ) - SetSize(sizeReal); - - return true; -} - -void wxStaticLine::DoDraw(wxControlRenderer *renderer) -{ - // we never have a border, so don't call the base class version whcih draws - // it - wxSize sz = GetSize(); - wxCoord x2, y2; - if ( IsVertical() ) - { - x2 = 0; - y2 = sz.y; - } - else // horizontal - { - x2 = sz.x; - y2 = 0; - } - - renderer->DrawLine(0, 0, x2, y2); -} - -#endif // wxUSE_STATLINE - diff --git a/wxWidgets/src/univ/stattext.cpp b/wxWidgets/src/univ/stattext.cpp deleted file mode 100644 index b06d5841a0..0000000000 --- a/wxWidgets/src/univ/stattext.cpp +++ /dev/null @@ -1,94 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/univ/stattext.cpp -// Purpose: wxStaticText -// Author: Vadim Zeitlin -// Modified by: -// Created: 14.08.00 -// RCS-ID: $Id: stattext.cpp 45447 2007-04-14 01:17:28Z VZ $ -// Copyright: (c) 2000 SciTech Software, Inc. (www.scitechsoft.com) -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_STATTEXT - -#include "wx/stattext.h" - -#ifndef WX_PRECOMP - #include "wx/dcclient.h" - #include "wx/validate.h" -#endif - -#include "wx/univ/renderer.h" -#include "wx/univ/theme.h" - -// ============================================================================ -// implementation -// ============================================================================ - -IMPLEMENT_ABSTRACT_CLASS(wxStaticText, wxControl) - -// ---------------------------------------------------------------------------- -// creation -// ---------------------------------------------------------------------------- - -bool wxStaticText::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; - - SetLabel(label); - SetInitialSize(size); - - return true; -} - -// ---------------------------------------------------------------------------- -// size management -// ---------------------------------------------------------------------------- - -void wxStaticText::SetLabel(const wxString& label) -{ - wxControl::SetLabel(label); -} - -wxSize wxStaticText::DoGetBestClientSize() const -{ - wxStaticText *self = wxConstCast(this, wxStaticText); - wxClientDC dc(self); - dc.SetFont(GetFont()); - wxCoord width, height; - dc.GetMultiLineTextExtent(GetLabel(), &width, &height); - - return wxSize(width, height); -} - -// ---------------------------------------------------------------------------- -// drawing -// ---------------------------------------------------------------------------- - -void wxStaticText::DoDraw(wxControlRenderer *renderer) -{ - renderer->DrawLabel(); -} - -#endif // wxUSE_STATTEXT diff --git a/wxWidgets/src/univ/statusbr.cpp b/wxWidgets/src/univ/statusbr.cpp deleted file mode 100644 index 37d1906efe..0000000000 --- a/wxWidgets/src/univ/statusbr.cpp +++ /dev/null @@ -1,326 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/univ/statusbr.cpp -// Purpose: wxStatusBar implementation -// Author: Vadim Zeitlin -// Modified by: -// Created: 14.10.01 -// RCS-ID: $Id: statusbr.cpp 42404 2006-10-25 18:14:08Z VS $ -// Copyright: (c) 2000 SciTech Software, Inc. (www.scitechsoft.com) -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_STATUSBAR - -#include "wx/statusbr.h" - -#ifndef WX_PRECOMP - #include "wx/settings.h" - #include "wx/dcclient.h" - #include "wx/toplevel.h" -#endif - -#include "wx/univ/renderer.h" - -// ============================================================================ -// implementation -// ============================================================================ - -BEGIN_EVENT_TABLE(wxStatusBarUniv, wxStatusBarBase) - EVT_SIZE(wxStatusBarUniv::OnSize) - - WX_EVENT_TABLE_INPUT_CONSUMER(wxStatusBarUniv) -END_EVENT_TABLE() - -WX_FORWARD_TO_INPUT_CONSUMER(wxStatusBarUniv) - -// ---------------------------------------------------------------------------- -// creation -// ---------------------------------------------------------------------------- - -void wxStatusBarUniv::Init() -{ -} - -bool wxStatusBarUniv::Create(wxWindow *parent, - wxWindowID id, - long style, - const wxString& name) -{ - if ( !wxWindow::Create(parent, id, - wxDefaultPosition, wxDefaultSize, - style, name) ) - { - return false; - } - - SetFieldsCount(1); - - CreateInputHandler(wxINP_HANDLER_STATUSBAR); - - SetSize(DoGetBestSize()); - - return true; -} - -// ---------------------------------------------------------------------------- -// drawing -// ---------------------------------------------------------------------------- - -wxRect wxStatusBarUniv::GetTotalFieldRect(wxCoord *borderBetweenFields) -{ - wxRect rect = GetClientRect(); - - // no, don't do this - the borders are meant to be inside this rect - // wxSize sizeBorders = - if ( borderBetweenFields ) - *borderBetweenFields = m_renderer->GetStatusBarBorderBetweenFields(); - //rect.Deflate(sizeBorders.x, sizeBorders.y); - - // recalc the field widths if needed - if ( m_widthsAbs.IsEmpty() ) - { - // the total width for the fields doesn't include the borders between - // them - m_widthsAbs = CalculateAbsWidths(rect.width - - *borderBetweenFields*(m_nFields - 1)); - } - - return rect; -} - -void wxStatusBarUniv::DoDraw(wxControlRenderer *renderer) -{ - // get the fields rect - wxCoord borderBetweenFields; - wxRect rect = GetTotalFieldRect(&borderBetweenFields); - - // prepare the DC - wxDC& dc = renderer->GetDC(); - dc.SetFont(GetFont()); - dc.SetTextForeground(GetForegroundColour()); - - // do draw the fields - int flags = IsEnabled() ? 0 : (int)wxCONTROL_DISABLED; - for ( int n = 0; n < m_nFields; n++ ) - { - rect.width = m_widthsAbs[n]; - - if ( IsExposed(rect) ) - { - wxTopLevelWindow *parentTLW = wxDynamicCast(GetParent(), wxTopLevelWindow); - - // the size grip may be drawn only on the last field and only if we - // have the corresponding style and even then only if we really can - // resize this frame - if ( n == m_nFields - 1 && - HasFlag(wxST_SIZEGRIP) && - GetParent()->HasFlag(wxRESIZE_BORDER) && - parentTLW && !parentTLW->IsMaximized() ) - { - flags |= wxCONTROL_SIZEGRIP; - } - - int style; - if (m_statusStyles) - style = m_statusStyles[n]; - else - style = wxSB_NORMAL; - m_renderer->DrawStatusField(dc, rect, m_statusText[n], flags, style); - } - - rect.x += rect.width + borderBetweenFields; - } -} - -void wxStatusBarUniv::RefreshField(int i) -{ - wxRect rect; - if ( GetFieldRect(i, rect) ) - { - RefreshRect(rect); - } -} - -// ---------------------------------------------------------------------------- -// fields text -// ---------------------------------------------------------------------------- - -void wxStatusBarUniv::SetStatusText(const wxString& text, int number) -{ - wxCHECK_RET( number >= 0 && number < m_nFields, - _T("invalid status bar field index in SetStatusText()") ); - - if ( text == m_statusText[number] ) - { - // nothing changed - return; - } - - m_statusText[number] = text; - - RefreshField(number); -} - -wxString wxStatusBarUniv::GetStatusText(int number) const -{ - wxCHECK_MSG( number >= 0 && number < m_nFields, wxEmptyString, - _T("invalid status bar field index") ); - - return m_statusText[number]; -} - -// ---------------------------------------------------------------------------- -// fields count/widths -// ---------------------------------------------------------------------------- - -void wxStatusBarUniv::SetFieldsCount(int number, const int *widths) -{ - m_statusText.SetCount(number); - wxStatusBarBase::SetFieldsCount(number, widths); - m_widthsAbs.Empty(); -} - -void wxStatusBarUniv::SetStatusWidths(int n, const int widths[]) -{ - wxStatusBarBase::SetStatusWidths(n, widths); - - m_widthsAbs.Empty(); -} - -// ---------------------------------------------------------------------------- -// geometry -// ---------------------------------------------------------------------------- - -void wxStatusBarUniv::OnSize(wxSizeEvent& event) -{ - // we don't need to refresh the fields whose width didn't change, so find - // the first field whose width did change and refresh starting from it - int field; - if ( m_statusWidths ) - { - for ( field = 0; field < m_nFields; field++ ) - { - if ( m_statusWidths[field] < 0 ) - { - // var width field - break; - } - } - } - else // all fields have the same width - { - // hence all fields widths have changed - field = 0; - } - - if ( field < m_nFields ) - { - // call this before invalidating the old widths as we want to use them, - // not the new ones - wxRect rect = DoGetFieldRect(field); - - // invalidate the widths, we'll have to recalc them - m_widthsAbs.Empty(); - - // refresh everything after the first invalid field - rect.y = 0; - rect.SetRight(event.GetSize().x); - rect.height = event.GetSize().y; - RefreshRect(rect); - } - - event.Skip(); -} - -bool wxStatusBarUniv::GetFieldRect(int n, wxRect& rect) const -{ - wxCHECK_MSG( n >= 0 && n < m_nFields, false, - _T("invalid field index in GetFieldRect()") ); - - // this is a fix for a bug exhibited by the statbar sample: if - // GetFieldRect() is called from the derived class OnSize() handler, then - // our geometry info is wrong as our OnSize() didn't invalidate m_widthsAbs - // yet - so recalc it just in case - wxConstCast(this, wxStatusBarUniv)->m_widthsAbs.Empty(); - - rect = DoGetFieldRect(n); - - return true; -} - -wxRect wxStatusBarUniv::DoGetFieldRect(int n) const -{ - wxStatusBarUniv *self = wxConstCast(this, wxStatusBarUniv); - - wxCoord borderBetweenFields; - wxRect rect = self->GetTotalFieldRect(&borderBetweenFields); - - // it's the caller responsability to check this, if unsure - call - // GetFieldRect() instead - wxCHECK_MSG( !m_widthsAbs.IsEmpty(), rect, - _T("can't be called if we don't have the widths") ); - - for ( int i = 0; i <= n; i++ ) - { - rect.width = m_widthsAbs[i]; - - if ( i < n ) - rect.x += rect.width + borderBetweenFields; - } - - return rect; -} - -wxCoord wxStatusBarUniv::GetHeight() const -{ - return GetCharHeight() + 2*GetBorderY(); -} - -wxSize wxStatusBarUniv::DoGetBestSize() const -{ - return wxSize(100, GetHeight()); -} - -void wxStatusBarUniv::DoSetSize(int x, int y, - int width, int WXUNUSED(height), - int sizeFlags) -{ - wxStatusBarBase::DoSetSize(x, y, width, GetHeight(), sizeFlags); -} - -// ---------------------------------------------------------------------------- -// misc -// ---------------------------------------------------------------------------- - -void wxStatusBarUniv::SetMinHeight(int WXUNUSED(height)) -{ - // nothing to do here, we don't support it - and why would we? -} - -int wxStatusBarUniv::GetBorderX() const -{ - return m_renderer->GetStatusBarBorders().x + - m_renderer->GetStatusBarFieldMargins().x; -} - -int wxStatusBarUniv::GetBorderY() const -{ - return m_renderer->GetStatusBarBorders().y + - m_renderer->GetStatusBarFieldMargins().y; -} - -#endif // wxUSE_STATUSBAR diff --git a/wxWidgets/src/univ/stdrend.cpp b/wxWidgets/src/univ/stdrend.cpp deleted file mode 100644 index 898a9dd3fd..0000000000 --- a/wxWidgets/src/univ/stdrend.cpp +++ /dev/null @@ -1,1267 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: src/univ/stdrend.cpp -// Purpose: implementation of wxStdRenderer -// Author: Vadim Zeitlin -// Created: 2006-09-16 -// RCS-ID: $Id: stdrend.cpp 49996 2007-11-16 15:52:17Z CE $ -// Copyright: (c) 2006 Vadim Zeitlin -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -// for compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#ifndef WX_PRECOMP - #include "wx/settings.h" - #include "wx/brush.h" - #include "wx/dc.h" - #include "wx/statusbr.h" - #include "wx/toplevel.h" -#endif //WX_PRECOMP - -#include "wx/univ/stdrend.h" -#include "wx/univ/colschem.h" - -// ---------------------------------------------------------------------------- -// constants -// ---------------------------------------------------------------------------- - -static const int FRAME_TITLEBAR_HEIGHT = 18; -static const int FRAME_BUTTON_WIDTH = 16; -static const int FRAME_BUTTON_HEIGHT = 14; - -// the margin between listbox item text and its rectangle -static const int ITEM_MARGIN = 1; - -// ============================================================================ -// wxStdRenderer implementation -// ============================================================================ - -// ---------------------------------------------------------------------------- -// ctor -// ---------------------------------------------------------------------------- - -wxStdRenderer::wxStdRenderer(const wxColourScheme *scheme) - : m_scheme(scheme) -{ - m_penBlack = wxPen(wxSCHEME_COLOUR(scheme, SHADOW_DARK)); - m_penDarkGrey = wxPen(wxSCHEME_COLOUR(scheme, SHADOW_OUT)); - m_penLightGrey = wxPen(wxSCHEME_COLOUR(scheme, SHADOW_IN)); - m_penHighlight = wxPen(wxSCHEME_COLOUR(scheme, SHADOW_HIGHLIGHT)); - - m_titlebarFont = wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT); - m_titlebarFont.SetWeight(wxFONTWEIGHT_BOLD); -} - -// ---------------------------------------------------------------------------- -// helper functions -// ---------------------------------------------------------------------------- - -void -wxStdRenderer::DrawSolidRect(wxDC& dc, const wxColour& col, const wxRect& rect) -{ - wxBrush brush(col, wxSOLID); - dc.SetBrush(brush); - dc.SetPen(*wxTRANSPARENT_PEN); - dc.DrawRectangle(rect); -} - -void wxStdRenderer::DrawRect(wxDC& dc, wxRect *rect, const wxPen& pen) -{ - // draw - dc.SetPen(pen); - dc.SetBrush(*wxTRANSPARENT_BRUSH); - dc.DrawRectangle(*rect); - - // adjust the rect - rect->Inflate(-1); -} - -void wxStdRenderer::DrawShadedRect(wxDC& dc, wxRect *rect, - const wxPen& pen1, const wxPen& pen2) -{ - // draw the rectangle - dc.SetPen(pen1); - dc.DrawLine(rect->GetLeft(), rect->GetTop(), - rect->GetLeft(), rect->GetBottom()); - dc.DrawLine(rect->GetLeft() + 1, rect->GetTop(), - rect->GetRight(), rect->GetTop()); - dc.SetPen(pen2); - dc.DrawLine(rect->GetRight(), rect->GetTop(), - rect->GetRight(), rect->GetBottom()); - dc.DrawLine(rect->GetLeft(), rect->GetBottom(), - rect->GetRight() + 1, rect->GetBottom()); - - // adjust the rect - rect->Inflate(-1); -} - -// ---------------------------------------------------------------------------- -// translate various flags into corresponding renderer constants -// ---------------------------------------------------------------------------- - -/* static */ -void wxStdRenderer::GetIndicatorsFromFlags(int flags, - IndicatorState& state, - IndicatorStatus& status) -{ - if ( flags & wxCONTROL_SELECTED ) - state = flags & wxCONTROL_DISABLED ? IndicatorState_SelectedDisabled - : IndicatorState_Selected; - else if ( flags & wxCONTROL_DISABLED ) - state = IndicatorState_Disabled; - else if ( flags & wxCONTROL_PRESSED ) - state = IndicatorState_Pressed; - else - state = IndicatorState_Normal; - - status = flags & wxCONTROL_CHECKED ? IndicatorStatus_Checked - : flags & wxCONTROL_UNDETERMINED - ? IndicatorStatus_Undetermined - : IndicatorStatus_Unchecked; -} - -/* static */ -wxStdRenderer::ArrowDirection wxStdRenderer::GetArrowDirection(wxDirection dir) -{ - switch ( dir ) - { - case wxLEFT: - return Arrow_Left; - - case wxRIGHT: - return Arrow_Right; - - case wxUP: - return Arrow_Up; - - case wxDOWN: - return Arrow_Down; - - default: - wxFAIL_MSG(_T("unknown arrow direction")); - } - - return Arrow_Max; -} - -// ---------------------------------------------------------------------------- -// background -// ---------------------------------------------------------------------------- - -void wxStdRenderer::DrawBackground(wxDC& dc, - const wxColour& col, - const wxRect& rect, - int WXUNUSED(flags), - wxWindow *window) -{ - wxColour colBg; - - if (col.Ok()) - { - colBg = col; - } - else if (window) - { - colBg = m_scheme->GetBackground(window); - } - else - { - colBg = wxSCHEME_COLOUR(m_scheme, CONTROL); - } - - DrawSolidRect(dc, colBg, rect); -} - - -void wxStdRenderer::DrawButtonSurface(wxDC& dc, - const wxColour& col, - const wxRect& rect, - int flags) -{ - DrawBackground(dc, col, rect, flags); -} - -// ---------------------------------------------------------------------------- -// text -// ---------------------------------------------------------------------------- - -void -wxStdRenderer::DrawFocusRect(wxDC& dc, const wxRect& rect, int WXUNUSED(flags)) -{ - // draw the pixels manually because the "dots" in wxPen with wxDOT style - // may be short traits and not really dots - // - // note that to behave in the same manner as DrawRect(), we must exclude - // the bottom and right borders from the rectangle - wxCoord x1 = rect.GetLeft(), - y1 = rect.GetTop(), - x2 = rect.GetRight(), - y2 = rect.GetBottom(); - - dc.SetPen(m_penBlack); - - // this seems to be closer than what Windows does than wxINVERT although - // I'm still not sure if it's correct - dc.SetLogicalFunction(wxAND_REVERSE); - - wxCoord z; - for ( z = x1 + 1; z < x2; z += 2 ) - dc.DrawPoint(z, rect.GetTop()); - - wxCoord shift = z == x2 ? 0 : 1; - for ( z = y1 + shift; z < y2; z += 2 ) - dc.DrawPoint(x2, z); - - shift = z == y2 ? 0 : 1; - for ( z = x2 - shift; z > x1; z -= 2 ) - dc.DrawPoint(z, y2); - - shift = z == x1 ? 0 : 1; - for ( z = y2 - shift; z > y1; z -= 2 ) - dc.DrawPoint(x1, z); - - dc.SetLogicalFunction(wxCOPY); -} - -void wxStdRenderer::DrawLabel(wxDC& dc, - const wxString& label, - const wxRect& rect, - int flags, - int alignment, - int indexAccel, - wxRect *rectBounds) -{ - DrawButtonLabel(dc, label, wxNullBitmap, rect, flags, - alignment, indexAccel, rectBounds); -} - -void wxStdRenderer::DrawButtonLabel(wxDC& dc, - const wxString& label, - const wxBitmap& image, - const wxRect& rect, - int flags, - int alignment, - int indexAccel, - wxRect *rectBounds) -{ - wxDCTextColourChanger clrChanger(dc); - - wxRect rectLabel = rect; - if ( !label.empty() && (flags & wxCONTROL_DISABLED) ) - { - if ( flags & wxCONTROL_PRESSED ) - { - // shift the label if a button is pressed - rectLabel.Offset(1, 1); - } - - // draw shadow of the text - clrChanger.Set(m_penHighlight.GetColour()); - wxRect rectShadow = rect; - rectShadow.Offset(1, 1); - dc.DrawLabel(label, rectShadow, alignment, indexAccel); - - // make the main label text grey - clrChanger.Set(m_penDarkGrey.GetColour()); - - if ( flags & wxCONTROL_FOCUSED ) - { - // leave enough space for the focus rect - rectLabel.Inflate(-2); - } - } - - dc.DrawLabel(label, image, rectLabel, alignment, indexAccel, rectBounds); - - if ( !label.empty() && (flags & wxCONTROL_FOCUSED) ) - { - rectLabel.Inflate(-1); - - DrawFocusRect(dc, rectLabel); - } -} - -// ---------------------------------------------------------------------------- -// borders -// ---------------------------------------------------------------------------- - -/* - We implement standard-looking 3D borders which have the following appearance: - - The raised border: - - WWWWWWWWWWWWWWWWWWWWWWB - WHHHHHHHHHHHHHHHHHHHHGB - WH GB W = white (HILIGHT) - WH GB H = light grey (LIGHT) - WH GB G = dark grey (SHADOI) - WH GB B = black (DKSHADOI) - WH GB - WH GB - WGGGGGGGGGGGGGGGGGGGGGB - BBBBBBBBBBBBBBBBBBBBBBB - - The sunken border looks like this: - - GGGGGGGGGGGGGGGGGGGGGGW - GBBBBBBBBBBBBBBBBBBBBHW - GB HW - GB HW - GB HW - GB HW - GB HW - GB HW - GHHHHHHHHHHHHHHHHHHHHHW - WWWWWWWWWWWWWWWWWWWWWWW - - The static border (used for the controls which don't get focus) is like - this: - - GGGGGGGGGGGGGGGGGGGGGGW - G W - G W - G W - G W - G W - G W - G W - WWWWWWWWWWWWWWWWWWWWWWW - - The most complicated is the double border which is a combination of special - "anti-sunken" border and an extra border inside it: - - HHHHHHHHHHHHHHHHHHHHHHB - HWWWWWWWWWWWWWWWWWWWWGB - HWHHHHHHHHHHHHHHHHHHHGB - HWH HGB - HWH HGB - HWH HGB - HWH HGB - HWHHHHHHHHHHHHHHHHHHHGB - HGGGGGGGGGGGGGGGGGGGGGB - BBBBBBBBBBBBBBBBBBBBBBB - - And the simple border is, well, simple: - - BBBBBBBBBBBBBBBBBBBBBBB - B B - B B - B B - B B - B B - B B - B B - B B - BBBBBBBBBBBBBBBBBBBBBBB -*/ - -void wxStdRenderer::DrawRaisedBorder(wxDC& dc, wxRect *rect) -{ - DrawShadedRect(dc, rect, m_penHighlight, m_penBlack); - DrawShadedRect(dc, rect, m_penLightGrey, m_penDarkGrey); -} - -void wxStdRenderer::DrawSunkenBorder(wxDC& dc, wxRect *rect) -{ - DrawShadedRect(dc, rect, m_penDarkGrey, m_penHighlight); - DrawShadedRect(dc, rect, m_penBlack, m_penLightGrey); -} - -void wxStdRenderer::DrawAntiSunkenBorder(wxDC& dc, wxRect *rect) -{ - DrawShadedRect(dc, rect, m_penLightGrey, m_penBlack); - DrawShadedRect(dc, rect, m_penHighlight, m_penDarkGrey); -} - -void wxStdRenderer::DrawBoxBorder(wxDC& dc, wxRect *rect) -{ - DrawShadedRect(dc, rect, m_penDarkGrey, m_penHighlight); - DrawShadedRect(dc, rect, m_penHighlight, m_penDarkGrey); -} - -void wxStdRenderer::DrawStaticBorder(wxDC& dc, wxRect *rect) -{ - DrawShadedRect(dc, rect, m_penDarkGrey, m_penHighlight); -} - -void wxStdRenderer::DrawExtraBorder(wxDC& dc, wxRect *rect) -{ - DrawRect(dc, rect, m_penLightGrey); -} - -void wxStdRenderer::DrawBorder(wxDC& dc, - wxBorder border, - const wxRect& rectTotal, - int WXUNUSED(flags), - wxRect *rectIn) -{ - wxRect rect = rectTotal; - - switch ( border ) - { - case wxBORDER_THEME: - case wxBORDER_SUNKEN: - DrawSunkenBorder(dc, &rect); - break; - - // wxBORDER_DOUBLE is no longer supported since wxBORDER_THEME takes on the same value -#if 0 - case wxBORDER_DOUBLE: - DrawAntiSunkenBorder(dc, &rect); - DrawExtraBorder(dc, &rect); - break; -#endif - case wxBORDER_STATIC: - DrawStaticBorder(dc, &rect); - break; - - case wxBORDER_RAISED: - DrawRaisedBorder(dc, &rect); - break; - - case wxBORDER_SIMPLE: - DrawRect(dc, &rect, m_penBlack); - break; - - default: - wxFAIL_MSG(_T("unknown border type")); - // fall through - - case wxBORDER_DEFAULT: - case wxBORDER_NONE: - break; - } - - if ( rectIn ) - *rectIn = rect; -} - -wxRect wxStdRenderer::GetBorderDimensions(wxBorder border) const -{ - wxCoord width; - switch ( border ) - { - case wxBORDER_SIMPLE: - case wxBORDER_STATIC: - width = 1; - break; - - case wxBORDER_RAISED: - case wxBORDER_SUNKEN: - case wxBORDER_THEME: - width = 2; - break; -#if 0 - case wxBORDER_DOUBLE: - width = 3; - break; -#endif - default: - wxFAIL_MSG(_T("unknown border type")); - // fall through - - case wxBORDER_DEFAULT: - case wxBORDER_NONE: - width = 0; - break; - } - - wxRect rect; - rect.x = - rect.y = - rect.width = - rect.height = width; - - return rect; -} - -void wxStdRenderer::AdjustSize(wxSize *size, const wxWindow *window) -{ - // take into account the border width - wxRect rectBorder = GetBorderDimensions(window->GetBorder()); - size->x += rectBorder.x + rectBorder.width; - size->y += rectBorder.y + rectBorder.height; -} - -bool wxStdRenderer::AreScrollbarsInsideBorder() const -{ - return false; -} - -wxCoord wxStdRenderer::GetListboxItemHeight(wxCoord fontHeight) -{ - return fontHeight + 2*ITEM_MARGIN; -} - -void wxStdRenderer::DrawTextBorder(wxDC& dc, - wxBorder border, - const wxRect& rect, - int flags, - wxRect *rectIn) -{ - DrawBorder(dc, border, rect, flags, rectIn); -} - -// ---------------------------------------------------------------------------- -// lines and boxes -// ---------------------------------------------------------------------------- - -void -wxStdRenderer::DrawHorizontalLine(wxDC& dc, wxCoord y, wxCoord x1, wxCoord x2) -{ - dc.SetPen(m_penDarkGrey); - dc.DrawLine(x1, y, x2 + 1, y); - - dc.SetPen(m_penHighlight); - y++; - dc.DrawLine(x1, y, x2 + 1, y); -} - -void -wxStdRenderer::DrawVerticalLine(wxDC& dc, wxCoord x, wxCoord y1, wxCoord y2) -{ - dc.SetPen(m_penDarkGrey); - dc.DrawLine(x, y1, x, y2 + 1); - - dc.SetPen(m_penHighlight); - x++; - dc.DrawLine(x, y1, x, y2 + 1); -} - -void wxStdRenderer::DrawFrameWithoutLabel(wxDC& dc, - const wxRect& rectFrame, - const wxRect& rectLabel) -{ - // draw left, bottom and right lines entirely - DrawVerticalLine(dc, rectFrame.GetLeft(), - rectFrame.GetTop(), rectFrame.GetBottom() - 2); - DrawHorizontalLine(dc, rectFrame.GetBottom() - 1, - rectFrame.GetLeft(), rectFrame.GetRight()); - DrawVerticalLine(dc, rectFrame.GetRight() - 1, - rectFrame.GetTop(), rectFrame.GetBottom() - 1); - - // and 2 parts of the top line - DrawHorizontalLine(dc, rectFrame.GetTop(), - rectFrame.GetLeft() + 1, rectLabel.GetLeft()); - DrawHorizontalLine(dc, rectFrame.GetTop(), - rectLabel.GetRight(), rectFrame.GetRight() - 2); -} - -void wxStdRenderer::DrawFrameWithLabel(wxDC& dc, - const wxString& label, - const wxRect& rectFrame, - const wxRect& rectText, - int flags, - int alignment, - int indexAccel) -{ - wxRect rectLabel; - DrawLabel(dc, label, rectText, flags, alignment, indexAccel, &rectLabel); - - DrawFrameWithoutLabel(dc, rectFrame, rectLabel); -} - -void wxStdRenderer::DrawFrame(wxDC& dc, - const wxString& label, - const wxRect& rect, - int flags, - int alignment, - int indexAccel) -{ - wxCoord height = 0; // of the label - wxRect rectFrame = rect; - if ( !label.empty() ) - { - // the text should touch the top border of the rect, so the frame - // itself should be lower - dc.GetTextExtent(label, NULL, &height); - rectFrame.y += height / 2; - rectFrame.height -= height / 2; - - // we have to draw each part of the frame individually as we can't - // erase the background beyond the label as it might contain some - // pixmap already, so drawing everything and then overwriting part of - // the frame with label doesn't work - - // TODO: the +5 shouldn't be hard coded - wxRect rectText; - rectText.x = rectFrame.x + 5; - rectText.y = rect.y; - rectText.width = rectFrame.width - 7; // +2 border width - rectText.height = height; - - DrawFrameWithLabel(dc, label, rectFrame, rectText, flags, - alignment, indexAccel); - } - else // no label - { - DrawBoxBorder(dc, &rectFrame); - } -} - -void wxStdRenderer::DrawItem(wxDC& dc, - const wxString& label, - const wxRect& rect, - int flags) -{ - wxDCTextColourChanger colChanger(dc); - - if ( flags & wxCONTROL_SELECTED ) - { - colChanger.Set(wxSCHEME_COLOUR(m_scheme, HIGHLIGHT_TEXT)); - - const wxColour colBg = wxSCHEME_COLOUR(m_scheme, HIGHLIGHT); - dc.SetBrush(colBg); - dc.SetPen(colBg); - dc.DrawRectangle(rect); - } - - // horizontal adjustment is arbitrary - wxRect rectText = rect; - rectText.Deflate(2, ITEM_MARGIN); - dc.DrawLabel(label, wxNullBitmap, rectText); - - if ( flags & wxCONTROL_FOCUSED ) - { - DrawFocusRect(dc, rect, flags); - } -} - -void wxStdRenderer::DrawCheckItemBitmap(wxDC& dc, - const wxBitmap& bitmap, - const wxRect& rect, - int flags) -{ - DrawCheckButton(dc, wxEmptyString, bitmap, rect, flags); -} - -void wxStdRenderer::DrawCheckItem(wxDC& dc, - const wxString& label, - const wxBitmap& bitmap, - const wxRect& rect, - int flags) -{ - wxRect rectBitmap = rect; - rectBitmap.width = GetCheckBitmapSize().x; - DrawCheckItemBitmap(dc, bitmap, rectBitmap, flags); - - wxRect rectLabel = rect; - wxCoord shift = rectBitmap.width + 2*GetCheckItemMargin(); - rectLabel.x += shift; - rectLabel.width -= shift; - DrawItem(dc, label, rectLabel, flags); -} - -// ---------------------------------------------------------------------------- -// check and radio bitmaps -// ---------------------------------------------------------------------------- - -void wxStdRenderer::DrawCheckButton(wxDC& dc, - const wxString& label, - const wxBitmap& bitmap, - const wxRect& rect, - int flags, - wxAlignment align, - int indexAccel) -{ - if (bitmap.Ok()) - DrawCheckOrRadioButton(dc, label, bitmap, rect, flags, align, indexAccel); - else - DrawCheckOrRadioButton(dc, label, GetCheckBitmap(flags), rect, flags, align, indexAccel); -} - -void wxStdRenderer::DrawRadioButton(wxDC& dc, - const wxString& label, - const wxBitmap& bitmap, - const wxRect& rect, - int flags, - wxAlignment align, - int indexAccel) -{ - if (bitmap.Ok()) - DrawCheckOrRadioButton(dc, label, bitmap, rect, flags, align, indexAccel); - else - DrawCheckOrRadioButton(dc, label, GetRadioBitmap(flags), rect, flags, align, indexAccel); -} - -void wxStdRenderer::DrawCheckOrRadioButton(wxDC& dc, - const wxString& label, - const wxBitmap& bitmap, - const wxRect& rect, - int flags, - wxAlignment align, - int indexAccel) -{ - // calculate the position of the bitmap and of the label - wxCoord heightBmp = bitmap.GetHeight(); - wxCoord xBmp, - yBmp = rect.y + (rect.height - heightBmp) / 2; - - wxRect rectLabel; - dc.GetMultiLineTextExtent(label, NULL, &rectLabel.height); - rectLabel.y = rect.y + (rect.height - rectLabel.height) / 2; - - // align label vertically with the bitmap - looks nicer like this - rectLabel.y -= (rectLabel.height - heightBmp) % 2; - - // calc horz position - if ( align == wxALIGN_RIGHT ) - { - xBmp = rect.GetRight() - bitmap.GetWidth(); - rectLabel.x = rect.x + 3; - rectLabel.SetRight(xBmp); - } - else // normal (checkbox to the left of the text) case - { - xBmp = rect.x; - rectLabel.x = xBmp + bitmap.GetWidth() + 5; - rectLabel.SetRight(rect.GetRight()); - } - - dc.DrawBitmap(bitmap, xBmp, yBmp, true /* use mask */); - - DrawLabel(dc, label, rectLabel, flags, - wxALIGN_LEFT | wxALIGN_TOP, indexAccel); -} - -#if wxUSE_TEXTCTRL - -void wxStdRenderer::DrawTextLine(wxDC& dc, - const wxString& text, - const wxRect& rect, - int selStart, - int selEnd, - int flags) -{ - if ( (selStart == -1) || !(flags & wxCONTROL_FOCUSED) ) - { - // just draw it as is - dc.DrawText(text, rect.x, rect.y); - } - else // we have selection - { - wxCoord width, - x = rect.x; - - // draw the part before selection - wxString s(text, (size_t)selStart); - if ( !s.empty() ) - { - dc.DrawText(s, x, rect.y); - - dc.GetTextExtent(s, &width, NULL); - x += width; - } - - // draw the selection itself - s = wxString(text.c_str() + selStart, text.c_str() + selEnd); - if ( !s.empty() ) - { - wxColour colFg = dc.GetTextForeground(), - colBg = dc.GetTextBackground(); - dc.SetTextForeground(wxSCHEME_COLOUR(m_scheme, HIGHLIGHT_TEXT)); - dc.SetTextBackground(wxSCHEME_COLOUR(m_scheme, HIGHLIGHT)); - dc.SetBackgroundMode(wxSOLID); - - dc.DrawText(s, x, rect.y); - dc.GetTextExtent(s, &width, NULL); - x += width; - - dc.SetBackgroundMode(wxTRANSPARENT); - dc.SetTextBackground(colBg); - dc.SetTextForeground(colFg); - } - - // draw the final part - s = text.c_str() + selEnd; - if ( !s.empty() ) - { - dc.DrawText(s, x, rect.y); - } - } -} - -void wxStdRenderer::DrawLineWrapMark(wxDC& WXUNUSED(dc), - const wxRect& WXUNUSED(rect)) -{ - // nothing by default -} - -int wxStdRenderer::GetTextBorderWidth(const wxTextCtrl * WXUNUSED(text)) const -{ - return 1; -} - -wxRect -wxStdRenderer::GetTextTotalArea(const wxTextCtrl *text, const wxRect& rect) const -{ - wxRect rectTotal = rect; - rectTotal.Inflate(GetTextBorderWidth(text)); - return rectTotal; -} - -wxRect wxStdRenderer::GetTextClientArea(const wxTextCtrl *text, - const wxRect& rect, - wxCoord *extraSpaceBeyond) const -{ - wxRect rectText = rect; - rectText.Deflate(GetTextBorderWidth(text)); - - if ( extraSpaceBeyond ) - *extraSpaceBeyond = 0; - - return rectText; -} - -#endif // wxUSE_TEXTCTRL - -// ---------------------------------------------------------------------------- -// scrollbars drawing -// ---------------------------------------------------------------------------- - -void wxStdRenderer::DrawScrollbarArrow(wxDC& dc, - wxDirection dir, - const wxRect& rect, - int flags) -{ - DrawArrow(dc, dir, rect, flags); -} - -void wxStdRenderer::DrawScrollCorner(wxDC& dc, const wxRect& rect) -{ - DrawSolidRect(dc, wxSCHEME_COLOUR(m_scheme, CONTROL), rect); -} - -// ---------------------------------------------------------------------------- -// status bar -// ---------------------------------------------------------------------------- - -#if wxUSE_STATUSBAR - -wxSize wxStdRenderer::GetStatusBarBorders() const -{ - // Rendered border may be different depending on field's style, we use - // the largest value so that any field certainly fits into the borders - // we return: - wxRect raised = GetBorderDimensions(wxBORDER_RAISED); - wxRect flat = GetBorderDimensions(wxBORDER_STATIC); - wxASSERT_MSG( raised.x == raised.width && raised.y == raised.height && - flat.x == flat.width && flat.y == flat.height, - _T("this code expects uniform borders, you must override GetStatusBarBorders") ); - - // take the larger of flat/raised values: - wxSize border(wxMax(raised.x, flat.x), wxMax(raised.y, flat.y)); - - return border; -} - -wxCoord wxStdRenderer::GetStatusBarBorderBetweenFields() const -{ - return 2; -} - -wxSize wxStdRenderer::GetStatusBarFieldMargins() const -{ - return wxSize(2, 2); -} - -void wxStdRenderer::DrawStatusField(wxDC& dc, - const wxRect& rect, - const wxString& label, - int flags, - int style) -{ - wxRect rectIn; - - if ( style == wxSB_RAISED ) - DrawBorder(dc, wxBORDER_RAISED, rect, flags, &rectIn); - else if ( style != wxSB_FLAT ) - DrawBorder(dc, wxBORDER_STATIC, rect, flags, &rectIn); - - rectIn.Deflate(GetStatusBarFieldMargins()); - - wxDCClipper clipper(dc, rectIn); - DrawLabel(dc, label, rectIn, flags, wxALIGN_LEFT | wxALIGN_CENTRE_VERTICAL); -} - -#endif // wxUSE_STATUSBAR - -// ---------------------------------------------------------------------------- -// top level windows -// ---------------------------------------------------------------------------- - -int wxStdRenderer::HitTestFrame(const wxRect& rect, const wxPoint& pt, int flags) const -{ - wxRect client = GetFrameClientArea(rect, flags); - - if ( client.Contains(pt) ) - return wxHT_TOPLEVEL_CLIENT_AREA; - - if ( flags & wxTOPLEVEL_TITLEBAR ) - { - wxRect client = GetFrameClientArea(rect, flags & ~wxTOPLEVEL_TITLEBAR); - - if ( flags & wxTOPLEVEL_ICON ) - { - if ( wxRect(client.GetPosition(), GetFrameIconSize()).Contains(pt) ) - return wxHT_TOPLEVEL_ICON; - } - - wxRect btnRect(client.GetRight() - 2 - FRAME_BUTTON_WIDTH, - client.GetTop() + (FRAME_TITLEBAR_HEIGHT-FRAME_BUTTON_HEIGHT)/2, - FRAME_BUTTON_WIDTH, FRAME_BUTTON_HEIGHT); - - if ( flags & wxTOPLEVEL_BUTTON_CLOSE ) - { - if ( btnRect.Contains(pt) ) - return wxHT_TOPLEVEL_BUTTON_CLOSE; - btnRect.x -= FRAME_BUTTON_WIDTH + 2; - } - if ( flags & wxTOPLEVEL_BUTTON_MAXIMIZE ) - { - if ( btnRect.Contains(pt) ) - return wxHT_TOPLEVEL_BUTTON_MAXIMIZE; - btnRect.x -= FRAME_BUTTON_WIDTH; - } - if ( flags & wxTOPLEVEL_BUTTON_RESTORE ) - { - if ( btnRect.Contains(pt) ) - return wxHT_TOPLEVEL_BUTTON_RESTORE; - btnRect.x -= FRAME_BUTTON_WIDTH; - } - if ( flags & wxTOPLEVEL_BUTTON_ICONIZE ) - { - if ( btnRect.Contains(pt) ) - return wxHT_TOPLEVEL_BUTTON_ICONIZE; - btnRect.x -= FRAME_BUTTON_WIDTH; - } - if ( flags & wxTOPLEVEL_BUTTON_HELP ) - { - if ( btnRect.Contains(pt) ) - return wxHT_TOPLEVEL_BUTTON_HELP; - btnRect.x -= FRAME_BUTTON_WIDTH; - } - - if ( pt.y >= client.y && pt.y < client.y + FRAME_TITLEBAR_HEIGHT ) - return wxHT_TOPLEVEL_TITLEBAR; - } - - if ( (flags & wxTOPLEVEL_BORDER) && !(flags & wxTOPLEVEL_MAXIMIZED) ) - { - // we are certainly at one of borders, let's decide which one: - - int border = 0; - // dirty trick, relies on the way wxHT_TOPLEVEL_XXX are defined! - if ( pt.x < client.x ) - border |= wxHT_TOPLEVEL_BORDER_W; - else if ( pt.x >= client.width + client.x ) - border |= wxHT_TOPLEVEL_BORDER_E; - if ( pt.y < client.y ) - border |= wxHT_TOPLEVEL_BORDER_N; - else if ( pt.y >= client.height + client.y ) - border |= wxHT_TOPLEVEL_BORDER_S; - return border; - } - - return wxHT_NOWHERE; -} - -void wxStdRenderer::DrawFrameTitleBar(wxDC& dc, - const wxRect& rect, - const wxString& title, - const wxIcon& icon, - int flags, - int specialButton, - int specialButtonFlags) -{ - if ( (flags & wxTOPLEVEL_BORDER) && !(flags & wxTOPLEVEL_MAXIMIZED) ) - { - DrawFrameBorder(dc, rect, flags); - } - if ( flags & wxTOPLEVEL_TITLEBAR ) - { - DrawFrameBackground(dc, rect, flags); - if ( flags & wxTOPLEVEL_ICON ) - DrawFrameIcon(dc, rect, icon, flags); - DrawFrameTitle(dc, rect, title, flags); - - wxRect client = GetFrameClientArea(rect, flags & ~wxTOPLEVEL_TITLEBAR); - wxCoord x,y; - x = client.GetRight() - 2 - FRAME_BUTTON_WIDTH; - y = client.GetTop() + (FRAME_TITLEBAR_HEIGHT-FRAME_BUTTON_HEIGHT)/2; - - if ( flags & wxTOPLEVEL_BUTTON_CLOSE ) - { - DrawFrameButton(dc, x, y, wxTOPLEVEL_BUTTON_CLOSE, - (specialButton == wxTOPLEVEL_BUTTON_CLOSE) ? - specialButtonFlags : 0); - x -= FRAME_BUTTON_WIDTH + 2; - } - if ( flags & wxTOPLEVEL_BUTTON_MAXIMIZE ) - { - DrawFrameButton(dc, x, y, wxTOPLEVEL_BUTTON_MAXIMIZE, - (specialButton == wxTOPLEVEL_BUTTON_MAXIMIZE) ? - specialButtonFlags : 0); - x -= FRAME_BUTTON_WIDTH; - } - if ( flags & wxTOPLEVEL_BUTTON_RESTORE ) - { - DrawFrameButton(dc, x, y, wxTOPLEVEL_BUTTON_RESTORE, - (specialButton == wxTOPLEVEL_BUTTON_RESTORE) ? - specialButtonFlags : 0); - x -= FRAME_BUTTON_WIDTH; - } - if ( flags & wxTOPLEVEL_BUTTON_ICONIZE ) - { - DrawFrameButton(dc, x, y, wxTOPLEVEL_BUTTON_ICONIZE, - (specialButton == wxTOPLEVEL_BUTTON_ICONIZE) ? - specialButtonFlags : 0); - x -= FRAME_BUTTON_WIDTH; - } - if ( flags & wxTOPLEVEL_BUTTON_HELP ) - { - DrawFrameButton(dc, x, y, wxTOPLEVEL_BUTTON_HELP, - (specialButton == wxTOPLEVEL_BUTTON_HELP) ? - specialButtonFlags : 0); - } - } -} - -void wxStdRenderer::DrawFrameBorder(wxDC& dc, const wxRect& rect, int flags) -{ - if ( !(flags & wxTOPLEVEL_BORDER) ) - return; - - wxRect r(rect); - - DrawAntiSunkenBorder(dc, &r); - DrawExtraBorder(dc, &r); - if ( flags & wxTOPLEVEL_RESIZEABLE ) - DrawExtraBorder(dc, &r); -} - -void wxStdRenderer::DrawFrameBackground(wxDC& dc, const wxRect& rect, int flags) -{ - if ( !(flags & wxTOPLEVEL_TITLEBAR) ) - return; - - wxColour col = m_scheme->Get(flags & wxTOPLEVEL_ACTIVE - ? wxColourScheme::TITLEBAR_ACTIVE - : wxColourScheme::TITLEBAR); - - wxRect r = GetFrameClientArea(rect, flags & ~wxTOPLEVEL_TITLEBAR); - r.height = FRAME_TITLEBAR_HEIGHT; - - DrawBackground(dc, col, r); -} - -void wxStdRenderer::DrawFrameTitle(wxDC& dc, - const wxRect& rect, - const wxString& title, - int flags) -{ - wxColour col = m_scheme->Get(flags & wxTOPLEVEL_ACTIVE - ? wxColourScheme::TITLEBAR_ACTIVE_TEXT - : wxColourScheme::TITLEBAR_TEXT); - dc.SetTextForeground(col); - - wxRect r = GetFrameClientArea(rect, flags & ~wxTOPLEVEL_TITLEBAR); - r.height = FRAME_TITLEBAR_HEIGHT; - if ( flags & wxTOPLEVEL_ICON ) - { - r.x += FRAME_TITLEBAR_HEIGHT; - r.width -= FRAME_TITLEBAR_HEIGHT + 2; - } - else - { - r.x += 1; - r.width -= 3; - } - - if ( flags & wxTOPLEVEL_BUTTON_CLOSE ) - r.width -= FRAME_BUTTON_WIDTH + 2; - if ( flags & wxTOPLEVEL_BUTTON_MAXIMIZE ) - r.width -= FRAME_BUTTON_WIDTH; - if ( flags & wxTOPLEVEL_BUTTON_RESTORE ) - r.width -= FRAME_BUTTON_WIDTH; - if ( flags & wxTOPLEVEL_BUTTON_ICONIZE ) - r.width -= FRAME_BUTTON_WIDTH; - if ( flags & wxTOPLEVEL_BUTTON_HELP ) - r.width -= FRAME_BUTTON_WIDTH; - - dc.SetFont(m_titlebarFont); - - wxString s; - wxCoord textW; - dc.GetTextExtent(title, &textW, NULL); - if ( textW > r.width ) - { - // text is too big, let's shorten it and add "..." after it: - size_t len = title.length(); - wxCoord WSoFar, letterW; - - dc.GetTextExtent(wxT("..."), &WSoFar, NULL); - if ( WSoFar > r.width ) - { - // not enough space to draw anything - return; - } - - s.Alloc(len); - for (size_t i = 0; i < len; i++) - { - dc.GetTextExtent(title[i], &letterW, NULL); - if ( letterW + WSoFar > r.width ) - break; - WSoFar += letterW; - s << title[i]; - } - s << wxT("..."); - } - else // no need to truncate the title - { - s = title; - } - - dc.DrawLabel(s, wxNullBitmap, r, wxALIGN_LEFT | wxALIGN_CENTRE_VERTICAL); -} - -void wxStdRenderer::DrawFrameIcon(wxDC& dc, - const wxRect& rect, - const wxIcon& icon, - int flags) -{ - if ( icon.Ok() ) - { - wxRect r = GetFrameClientArea(rect, flags & ~wxTOPLEVEL_TITLEBAR); - dc.DrawIcon(icon, r.x, r.y); - } -} - -void wxStdRenderer::DrawFrameButton(wxDC& dc, - wxCoord x, wxCoord y, - int button, - int flags) -{ - FrameButtonType idx; - switch (button) - { - case wxTOPLEVEL_BUTTON_CLOSE: idx = FrameButton_Close; break; - case wxTOPLEVEL_BUTTON_MAXIMIZE: idx = FrameButton_Maximize; break; - case wxTOPLEVEL_BUTTON_ICONIZE: idx = FrameButton_Minimize; break; - case wxTOPLEVEL_BUTTON_RESTORE: idx = FrameButton_Restore; break; - case wxTOPLEVEL_BUTTON_HELP: idx = FrameButton_Help; break; - default: - wxFAIL_MSG(wxT("incorrect button specification")); - return; - } - - wxBitmap bmp = GetFrameButtonBitmap(idx); - if ( !bmp.Ok() ) - return; - - wxRect rectBtn(x, y, FRAME_BUTTON_WIDTH, FRAME_BUTTON_HEIGHT); - if ( flags & wxCONTROL_PRESSED ) - { - DrawSunkenBorder(dc, &rectBtn); - - rectBtn.Offset(1, 1); - } - else - { - DrawRaisedBorder(dc, &rectBtn); - } - - DrawBackground(dc, wxSCHEME_COLOUR(m_scheme, CONTROL), rectBtn); - - wxRect rectBmp(0, 0, bmp.GetWidth(), bmp.GetHeight()); - dc.DrawBitmap(bmp, rectBmp.CentreIn(rectBtn).GetPosition(), true); -} - -int wxStdRenderer::GetFrameBorderWidth(int flags) const -{ - return flags & wxTOPLEVEL_RESIZEABLE ? 4 : 3; -} - - -wxRect wxStdRenderer::GetFrameClientArea(const wxRect& rect, int flags) const -{ - wxRect r(rect); - - if ( (flags & wxTOPLEVEL_BORDER) && !(flags & wxTOPLEVEL_MAXIMIZED) ) - { - r.Inflate(-GetFrameBorderWidth(flags)); - } - - if ( flags & wxTOPLEVEL_TITLEBAR ) - { - r.y += FRAME_TITLEBAR_HEIGHT; - r.height -= FRAME_TITLEBAR_HEIGHT; - } - - return r; -} - -wxSize -wxStdRenderer::GetFrameTotalSize(const wxSize& clientSize, int flags) const -{ - wxSize s(clientSize); - - if ( (flags & wxTOPLEVEL_BORDER) && !(flags & wxTOPLEVEL_MAXIMIZED) ) - { - s.IncBy(2*GetFrameBorderWidth(flags)); - } - - if ( flags & wxTOPLEVEL_TITLEBAR ) - s.y += FRAME_TITLEBAR_HEIGHT; - - return s; -} - -wxSize wxStdRenderer::GetFrameMinSize(int flags) const -{ - wxSize s; - - if ( (flags & wxTOPLEVEL_BORDER) && !(flags & wxTOPLEVEL_MAXIMIZED) ) - { - s.IncBy(2*GetFrameBorderWidth(flags)); - } - - if ( flags & wxTOPLEVEL_TITLEBAR ) - { - s.y += FRAME_TITLEBAR_HEIGHT; - - if ( flags & wxTOPLEVEL_ICON ) - s.x += FRAME_TITLEBAR_HEIGHT + 2; - if ( flags & wxTOPLEVEL_BUTTON_CLOSE ) - s.x += FRAME_BUTTON_WIDTH + 2; - if ( flags & wxTOPLEVEL_BUTTON_MAXIMIZE ) - s.x += FRAME_BUTTON_WIDTH; - if ( flags & wxTOPLEVEL_BUTTON_RESTORE ) - s.x += FRAME_BUTTON_WIDTH; - if ( flags & wxTOPLEVEL_BUTTON_ICONIZE ) - s.x += FRAME_BUTTON_WIDTH; - if ( flags & wxTOPLEVEL_BUTTON_HELP ) - s.x += FRAME_BUTTON_WIDTH; - } - - return s; -} - -wxSize wxStdRenderer::GetFrameIconSize() const -{ - return wxSize(16, 16); -} diff --git a/wxWidgets/src/univ/textctrl.cpp b/wxWidgets/src/univ/textctrl.cpp deleted file mode 100644 index 85a15bb496..0000000000 --- a/wxWidgets/src/univ/textctrl.cpp +++ /dev/null @@ -1,5011 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/univ/textctrl.cpp -// Purpose: wxTextCtrl -// Author: Vadim Zeitlin -// Modified by: -// Created: 15.09.00 -// RCS-ID: $Id: textctrl.cpp 48721 2007-09-16 11:04:26Z VZ $ -// Copyright: (c) 2000 SciTech Software, Inc. (www.scitechsoft.com) -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -/* - TODO - -+ 1. update vert scrollbar when any line length changes for WrapLines() -+ 2. cursor movement ("Hello,^" -> "^verse!" on Arrow Down)? - -> maybe save the x position and use it instead of current in handling - DOWN/UP actions (this would make up/down always return the cursor to - the same location)? - 3. split file into chunks -+? 4. rewrite Replace() refresh logic to deal with wrapping lines -+? 5. cache info found by GetPartOfWrappedLine() - performance must be horrible - with lots of text - - 6. backspace refreshes too much (until end of line) - */ - -/* - Optimisation hints from PureQuantify: - - +1. wxStringTokenize is the slowest part of Replace - 2. GetDC/ReleaseDC are very slow, avoid calling them several times - +3. GetCharHeight() should be cached too - 4. wxClientDC construction/destruction in HitTestLine is horribly expensive - - For line wrapping controls HitTest2 takes 50% of program time. The results - of GetRowsPerLine and GetPartOfWrappedLine *MUST* be cached. - - Search for "OPT!" for things which must be optimized. - */ - -/* - Some terminology: - - Everywhere in this file LINE refers to a logical line of text, and ROW to a - physical line of text on the display. They are the same unless WrapLines() - is true in which case a single LINE may correspond to multiple ROWs. - - A text position is an unsigned int (which for reasons of compatibility is - still a long as wxTextPos) from 0 to GetLastPosition() inclusive. The positions - correspond to the gaps between the letters so the position 0 is just - before the first character and the last position is the one beyond the last - character. For an empty text control GetLastPosition() returns 0. - - Lines and columns returned/accepted by XYToPosition() and PositionToXY() - start from 0. The y coordinate is a LINE, not a ROW. Columns correspond to - the characters, the first column of a line is the first character in it, - the last one is length(line text). For compatibility, again, lines and - columns are also longs. - - When translating lines/column coordinates to/from positions, the line and - column give the character after the given position. Thus, GetLastPosition() - doesn't have any corresponding column. - - An example of positions and lines/columns for a control without wrapping - containing the text "Hello, Universe!\nGoodbye" - - 1 1 1 1 1 1 1 - pos: 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 - H e l l o , U n i v e r s e ! line 0 - col: 0 1 2 3 4 5 6 7 8 9 1 1 1 1 1 1 - 0 1 2 3 4 5 - - pos: 1 1 1 2 2 2 2 2 - 7 8 9 0 1 2 3 4 - G o o d b y e line 1 - col: 0 1 2 3 4 5 6 - - - The same example for a control with line wrap assuming "Universe" is too - long to fit on the same line with "Hello,": - - pos: 0 1 2 3 4 5 - H e l l o , line 0 (row 0) - col: 0 1 2 3 4 5 - - 1 1 1 1 1 1 1 - pos: 6 7 8 9 0 1 2 3 4 5 6 - U n i v e r s e ! line 0 (row 1) - col: 6 7 8 9 1 1 1 1 1 1 - 0 1 2 3 4 5 - - (line 1 == row 2 same as above) - - Note that there is still the same number of columns and positions and that - there is no (logical) position at the end of the first ROW. This position - is identified with the preceding one (which is not how Windows does it: it - identifies it with the next one, i.e. the first position of the next line, - but much more logical IMHO). - */ - -/* - Search for "OPT" for possible optimizations - - A possible global optimization would be to always store the coords in the - text in triplets (pos, col, line) and update them simultaneously instead of - recalculating col and line from pos each time it is needed. Currently we - only do it for the current position but we might also do it for the - selection start and end. - */ - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_TEXTCTRL - -#include "wx/textctrl.h" - -#ifndef WX_PRECOMP - #include "wx/log.h" - #include "wx/dcclient.h" - #include "wx/validate.h" - #include "wx/dataobj.h" -#endif - -#include - -#include "wx/clipbrd.h" - -#include "wx/textfile.h" - -#include "wx/caret.h" - -#include "wx/univ/inphand.h" -#include "wx/univ/renderer.h" -#include "wx/univ/colschem.h" -#include "wx/univ/theme.h" - -#include "wx/cmdproc.h" - -// turn extra wxTextCtrl-specific debugging on/off -#define WXDEBUG_TEXT - -// turn wxTextCtrl::Replace() debugging on (slows down code a *lot*!) -#define WXDEBUG_TEXT_REPLACE - -#ifndef __WXDEBUG__ - #undef WXDEBUG_TEXT - #undef WXDEBUG_TEXT_REPLACE -#endif - -// wxStringTokenize only needed for debug checks -#ifdef WXDEBUG_TEXT_REPLACE - #include "wx/tokenzr.h" -#endif // WXDEBUG_TEXT_REPLACE - -// ---------------------------------------------------------------------------- -// wxStdTextCtrlInputHandler: this control handles only the mouse/kbd actions -// common to Win32 and GTK, platform-specific things are implemented elsewhere -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxStdTextCtrlInputHandler : public wxStdInputHandler -{ -public: - wxStdTextCtrlInputHandler(wxInputHandler *inphand); - - virtual bool HandleKey(wxInputConsumer *consumer, - const wxKeyEvent& event, - bool pressed); - virtual bool HandleMouse(wxInputConsumer *consumer, - const wxMouseEvent& event); - virtual bool HandleMouseMove(wxInputConsumer *consumer, - const wxMouseEvent& event); - virtual bool HandleFocus(wxInputConsumer *consumer, const wxFocusEvent& event); - -protected: - // get the position of the mouse click - static wxTextPos HitTest(const wxTextCtrl *text, const wxPoint& pos); - - // capture data - wxTextCtrl *m_winCapture; -}; - -// ---------------------------------------------------------------------------- -// private functions -// ---------------------------------------------------------------------------- - -// exchange two positions so that from is always less than or equal to to -static inline void OrderPositions(wxTextPos& from, wxTextPos& to) -{ - if ( from > to ) - { - wxTextPos tmp = from; - from = to; - to = tmp; - } -} - -// ---------------------------------------------------------------------------- -// constants -// ---------------------------------------------------------------------------- - -// names of text ctrl commands -#define wxTEXT_COMMAND_INSERT _T("insert") -#define wxTEXT_COMMAND_REMOVE _T("remove") - -// the value which is never used for text position, even not -1 which is -// sometimes used for some special meaning -static const wxTextPos INVALID_POS_VALUE = wxInvalidTextCoord; - -// overlap between pages (when using PageUp/Dn) in lines -static const size_t PAGE_OVERLAP_IN_LINES = 1; - -// ---------------------------------------------------------------------------- -// private data of wxTextCtrl -// ---------------------------------------------------------------------------- - -// the data only used by single line text controls -struct wxTextSingleLineData -{ - // the position of the first visible pixel and the first visible column - wxCoord m_ofsHorz; - wxTextCoord m_colStart; - - // and the last ones (m_posLastVisible is the width but m_colLastVisible - // is an absolute value) - wxCoord m_posLastVisible; - wxTextCoord m_colLastVisible; - - // def ctor - wxTextSingleLineData() - { - m_colStart = 0; - m_ofsHorz = 0; - - m_colLastVisible = -1; - m_posLastVisible = -1; - } - -}; - -// the data only used by multi line text controls -struct wxTextMultiLineData -{ - // the lines of text - wxArrayString m_lines; - - // the current ranges of the scrollbars - int m_scrollRangeX, - m_scrollRangeY; - - // should we adjust the horz/vert scrollbar? - bool m_updateScrollbarX, - m_updateScrollbarY; - - // the max line length in pixels - wxCoord m_widthMax; - - // the index of the line which has the length of m_widthMax - wxTextCoord m_lineLongest; - - // the rect in which text appears: it is even less than m_rectText because - // only the last _complete_ line is shown, hence there is an unoccupied - // horizontal band at the bottom of it - wxRect m_rectTextReal; - - // the x-coordinate of the caret before we started moving it vertically: - // this is used to ensure that moving the caret up and then down will - // return it to the same position as if we always round it in one direction - // we would shift it in that direction - // - // when m_xCaret == -1, we don't have any remembered position - wxCoord m_xCaret; - - // the def ctor - wxTextMultiLineData() - { - m_scrollRangeX = - m_scrollRangeY = 0; - - m_updateScrollbarX = - m_updateScrollbarY = false; - - m_widthMax = -1; - m_lineLongest = 0; - - m_xCaret = -1; - } -}; - -// the data only used by multi line text controls in line wrap mode -class wxWrappedLineData -{ - // these functions set all our values, so give them access to them -friend void wxTextCtrl::LayoutLine(wxTextCoord line, - wxWrappedLineData& lineData) const; -friend void wxTextCtrl::LayoutLines(wxTextCoord) const; - -public: - // def ctor - wxWrappedLineData() - { - m_rowFirst = -1; - } - - // get the start of any row (remember that accessing m_rowsStart doesn't work - // for the first one) - wxTextCoord GetRowStart(wxTextCoord row) const - { - wxASSERT_MSG( IsValid(), _T("this line hadn't been laid out") ); - - return row ? m_rowsStart[row - 1] : 0; - } - - // get the length of the row (using the total line length which we don't - // have here but need to calculate the length of the last row, so it must - // be given to us) - wxTextCoord GetRowLength(wxTextCoord row, wxTextCoord lenLine) const - { - wxASSERT_MSG( IsValid(), _T("this line hadn't been laid out") ); - - // note that m_rowsStart[row] is the same as GetRowStart(row + 1) (but - // slightly more efficient) and lenLine is the same as the start of the - // first row of the next line - return ((size_t)row == m_rowsStart.GetCount() ? lenLine : m_rowsStart[row]) - - GetRowStart(row); - } - - // return the width of the row in pixels - wxCoord GetRowWidth(wxTextCoord row) const - { - wxASSERT_MSG( IsValid(), _T("this line hadn't been laid out") ); - - return m_rowsWidth[row]; - } - - // return the number of rows - size_t GetRowCount() const - { - wxASSERT_MSG( IsValid(), _T("this line hadn't been laid out") ); - - return m_rowsStart.GetCount() + 1; - } - - // return the number of additional (i.e. after the first one) rows - size_t GetExtraRowCount() const - { - wxASSERT_MSG( IsValid(), _T("this line hadn't been laid out") ); - - return m_rowsStart.GetCount(); - } - - // return the first row of this line - wxTextCoord GetFirstRow() const - { - wxASSERT_MSG( IsValid(), _T("this line hadn't been laid out") ); - - return m_rowFirst; - } - - // return the first row of the next line - wxTextCoord GetNextRow() const - { - wxASSERT_MSG( IsValid(), _T("this line hadn't been laid out") ); - - return m_rowFirst + m_rowsStart.GetCount() + 1; - } - - // this just provides direct access to m_rowsStart aerray for efficiency - wxTextCoord GetExtraRowStart(wxTextCoord row) const - { - wxASSERT_MSG( IsValid(), _T("this line hadn't been laid out") ); - - return m_rowsStart[row]; - } - - // this code is unused any longer -#if 0 - // return true if the column is in the start of the last row (hence the row - // it is in is not wrapped) - bool IsLastRow(wxTextCoord colRowStart) const - { - return colRowStart == GetRowStart(m_rowsStart.GetCount()); - } - - // return true if the column is the last column of the row starting in - // colRowStart - bool IsLastColInRow(wxTextCoord colRowStart, - wxTextCoord colRowEnd, - wxTextCoord lenLine) const - { - // find the row which starts with colRowStart - size_t nRows = GetRowCount(); - for ( size_t n = 0; n < nRows; n++ ) - { - if ( GetRowStart(n) == colRowStart ) - { - wxTextCoord colNextRowStart = n == nRows - 1 - ? lenLine - : GetRowStart(n + 1); - - wxASSERT_MSG( colRowEnd < colNextRowStart, - _T("this column is not in this row at all!") ); - - return colRowEnd == colNextRowStart - 1; - } - } - - // caller got it wrong - wxFAIL_MSG( _T("this column is not in the start of the row!") ); - - return false; - } -#endif // 0 - - // is this row the last one in its line? - bool IsLastRow(wxTextCoord row) const - { - return (size_t)row == GetExtraRowCount(); - } - - // the line is valid if it had been laid out correctly: note that just - // shiwting the line (because one of previous lines changed) doesn't make - // it invalid - bool IsValid() const { return !m_rowsWidth.IsEmpty(); } - - // invalidating line will relayout it - void Invalidate() { m_rowsWidth.Empty(); } - -private: - // for each line we remember the starting columns of all its rows after the - // first one (which always starts at 0), i.e. if a line is wrapped twice - // (== takes 3 rows) its m_rowsStart[0] may be 10 and m_rowsStart[1] == 15 - wxArrayLong m_rowsStart; - - // and the width of each row in pixels (this array starts from 0, as usual) - wxArrayInt m_rowsWidth; - - // and also its starting row (0 for the first line, first lines' - // m_rowsStart.GetCount() + 1 for the second &c): it is set to -1 initially - // and this means that the struct hadn't yet been initialized - wxTextCoord m_rowFirst; - - // the last modification "time"-stamp used by LayoutLines() - size_t m_timestamp; -}; - -WX_DECLARE_OBJARRAY(wxWrappedLineData, wxArrayWrappedLinesData); -#include "wx/arrimpl.cpp" -WX_DEFINE_OBJARRAY(wxArrayWrappedLinesData); - -struct wxTextWrappedData : public wxTextMultiLineData -{ - // the width of the column to the right of the text rect used for the - // indicator mark display for the wrapped lines - wxCoord m_widthMark; - - // the data for each line - wxArrayWrappedLinesData m_linesData; - - // flag telling us to recalculate all starting rows starting from this line - // (if it is -1, we don't have to recalculate anything) - it is set when - // the number of the rows in the middle of the control changes - wxTextCoord m_rowFirstInvalid; - - // the current timestamp used by LayoutLines() - size_t m_timestamp; - - // invalidate starting rows of all lines (NOT rows!) after this one - void InvalidateLinesBelow(wxTextCoord line) - { - if ( m_rowFirstInvalid == -1 || m_rowFirstInvalid > line ) - { - m_rowFirstInvalid = line; - } - } - - // check if this line is valid: i.e. before the first invalid one - bool IsValidLine(wxTextCoord line) const - { - return ((m_rowFirstInvalid == -1) || (line < m_rowFirstInvalid)) && - m_linesData[line].IsValid(); - } - - // def ctor - wxTextWrappedData() - { - m_widthMark = 0; - m_rowFirstInvalid = -1; - m_timestamp = 0; - } -}; - -// ---------------------------------------------------------------------------- -// private classes for undo/redo management -// ---------------------------------------------------------------------------- - -/* - We use custom versions of wxWidgets command processor to implement undo/redo - as we want to avoid storing the backpointer to wxTextCtrl in wxCommand - itself: this is a waste of memory as all commands in the given command - processor always have the same associated wxTextCtrl and so it makes sense - to store the backpointer there. - - As for the rest of the implementation, it's fairly standard: we have 2 - command classes corresponding to adding and removing text. - */ - -// a command corresponding to a wxTextCtrl action -class wxTextCtrlCommand : public wxCommand -{ -public: - wxTextCtrlCommand(const wxString& name) : wxCommand(true, name) { } - - // we don't use these methods as they don't make sense for us as we need a - // wxTextCtrl to be applied - virtual bool Do() { wxFAIL_MSG(_T("shouldn't be called")); return false; } - virtual bool Undo() { wxFAIL_MSG(_T("shouldn't be called")); return false; } - - // instead, our command processor uses these methods - virtual bool Do(wxTextCtrl *text) = 0; - virtual bool Undo(wxTextCtrl *text) = 0; -}; - -// insert text command -class wxTextCtrlInsertCommand : public wxTextCtrlCommand -{ -public: - wxTextCtrlInsertCommand(const wxString& textToInsert) - : wxTextCtrlCommand(wxTEXT_COMMAND_INSERT), m_text(textToInsert) - { - m_from = -1; - } - - // combine the 2 commands together - void Append(wxTextCtrlInsertCommand *other); - - virtual bool CanUndo() const; - virtual bool Do(wxTextCtrl *text); - virtual bool Do() { return wxTextCtrlCommand::Do(); } - virtual bool Undo() { return wxTextCtrlCommand::Undo(); } - virtual bool Undo(wxTextCtrl *text); - -private: - // the text we insert - wxString m_text; - - // the position where we inserted the text - wxTextPos m_from; -}; - -// remove text command -class wxTextCtrlRemoveCommand : public wxTextCtrlCommand -{ -public: - wxTextCtrlRemoveCommand(wxTextPos from, wxTextPos to) - : wxTextCtrlCommand(wxTEXT_COMMAND_REMOVE) - { - m_from = from; - m_to = to; - } - - virtual bool CanUndo() const; - virtual bool Do(wxTextCtrl *text); - virtual bool Do() { return wxTextCtrlCommand::Do(); } - virtual bool Undo() { return wxTextCtrlCommand::Undo(); } - virtual bool Undo(wxTextCtrl *text); - -private: - // the range of text to delete - wxTextPos m_from, - m_to; - - // the text which was deleted when this command was Do()ne - wxString m_textDeleted; -}; - -// a command processor for a wxTextCtrl -class wxTextCtrlCommandProcessor : public wxCommandProcessor -{ -public: - wxTextCtrlCommandProcessor(wxTextCtrl *text) - { - m_compressInserts = false; - - m_text = text; - } - - // override Store() to compress multiple wxTextCtrlInsertCommand into one - virtual void Store(wxCommand *command); - - // stop compressing insert commands when this is called - void StopCompressing() { m_compressInserts = false; } - - // accessors - wxTextCtrl *GetTextCtrl() const { return m_text; } - bool IsCompressing() const { return m_compressInserts; } - -protected: - virtual bool DoCommand(wxCommand& cmd) - { return ((wxTextCtrlCommand &)cmd).Do(m_text); } - virtual bool UndoCommand(wxCommand& cmd) - { return ((wxTextCtrlCommand &)cmd).Undo(m_text); } - - // check if this command is a wxTextCtrlInsertCommand and return it casted - // to the right type if it is or NULL otherwise - wxTextCtrlInsertCommand *IsInsertCommand(wxCommand *cmd); - -private: - // the control we're associated with - wxTextCtrl *m_text; - - // if the flag is true we're compressing subsequent insert commands into - // one so that the entire typing could be undone in one call to Undo() - bool m_compressInserts; -}; - -// ============================================================================ -// implementation -// ============================================================================ - -BEGIN_EVENT_TABLE(wxTextCtrl, wxTextCtrlBase) - EVT_CHAR(wxTextCtrl::OnChar) - - EVT_SIZE(wxTextCtrl::OnSize) -END_EVENT_TABLE() - -IMPLEMENT_DYNAMIC_CLASS(wxTextCtrl, wxTextCtrlBase) - -// ---------------------------------------------------------------------------- -// creation -// ---------------------------------------------------------------------------- - -void wxTextCtrl::Init() -{ - m_selAnchor = - m_selStart = - m_selEnd = -1; - - m_isModified = false; - m_isEditable = true; - m_wrapLines = false; - - m_posLast = - m_curPos = - m_curCol = - m_curRow = 0; - - m_heightLine = - m_widthAvg = -1; - - // init the undo manager - m_cmdProcessor = new wxTextCtrlCommandProcessor(this); - - // no data yet - m_data.data = NULL; -} - -bool wxTextCtrl::Create(wxWindow *parent, - wxWindowID id, - const wxString& value, - const wxPoint& pos, - const wxSize& size, - long style, - const wxValidator& validator, - const wxString &name) -{ - if ( style & wxTE_MULTILINE ) - { - // for compatibility with wxMSW we create the controls with vertical - // scrollbar always shown unless they have wxTE_RICH style (because - // Windows text controls always has vert scrollbar but richedit one - // doesn't) - if ( !(style & wxTE_RICH) ) - { - style |= wxALWAYS_SHOW_SB; - } - - // wrapping style: wxTE_DONTWRAP == wxHSCROLL so if it's _not_ given, - // we won't have horizontal scrollbar automatically, no need to do - // anything - - // TODO: support wxTE_NO_VSCROLL (?) - - // create data object for normal multiline or for controls with line - // wrap as needed - if ( style & wxHSCROLL ) - { - m_data.mdata = new wxTextMultiLineData; - } - else // we must wrap lines if we don't have horizontal scrollbar - { - // NB: we can't rely on HasFlag(wxHSCROLL) as the flags can change - // later and even wxWindow::Create() itself temporarily resets - // wxHSCROLL in wxUniv, so remember that we have a wrapped data - // and not just a multi line data in a separate variable - m_wrapLines = true; - m_data.wdata = new wxTextWrappedData; - } - } - else - { - // this doesn't make sense for single line controls - style &= ~wxHSCROLL; - - // create data object for single line controls - m_data.sdata = new wxTextSingleLineData; - } - -#if wxUSE_TWO_WINDOWS - if ((style & wxBORDER_MASK) == 0) - style |= wxBORDER_SUNKEN; -#endif - - if ( !wxControl::Create(parent, id, pos, size, style, - validator, name) ) - { - return false; - } - - SetCursor(wxCURSOR_IBEAM); - - if ( style & wxTE_MULTILINE ) - { - // we should always have at least one line in a multiline control - MData().m_lines.Add(wxEmptyString); - - if ( !(style & wxHSCROLL) ) - { - WData().m_linesData.Add(new wxWrappedLineData); - WData().InvalidateLinesBelow(0); - } - - // we might support it but it's quite useless and other ports don't - // support it anyhow - wxASSERT_MSG( !(style & wxTE_PASSWORD), - _T("wxTE_PASSWORD can't be used with multiline ctrls") ); - } - - RecalcFontMetrics(); - SetValue(value); - SetInitialSize(size); - - m_isEditable = !(style & wxTE_READONLY); - - CreateCaret(); - InitInsertionPoint(); - - // we can't show caret right now as we're not shown yet and so it would - // result in garbage on the screen - we'll do it after first OnPaint() - m_hasCaret = false; - - CreateInputHandler(wxINP_HANDLER_TEXTCTRL); - - wxSizeEvent sizeEvent(GetSize(), GetId()); - GetEventHandler()->ProcessEvent(sizeEvent); - - return true; -} - -wxTextCtrl::~wxTextCtrl() -{ - delete m_cmdProcessor; - - if ( m_data.data ) - { - if ( IsSingleLine() ) - delete m_data.sdata; - else if ( WrapLines() ) - delete m_data.wdata; - else - delete m_data.mdata; - } -} - -// ---------------------------------------------------------------------------- -// set/get the value -// ---------------------------------------------------------------------------- - -void wxTextCtrl::DoSetValue(const wxString& value, int flags) -{ - if ( IsSingleLine() && (value == GetValue()) ) - { - // nothing changed - return; - } - - Replace(0, GetLastPosition(), value); - - if ( IsSingleLine() ) - { - SetInsertionPoint(0); - } - - if ( flags & SetValue_SendEvent ) - SendTextUpdatedEvent(); -} - -const wxArrayString& wxTextCtrl::GetLines() const -{ - return MData().m_lines; -} - -size_t wxTextCtrl::GetLineCount() const -{ - return MData().m_lines.GetCount(); -} - -wxString wxTextCtrl::GetValue() const -{ - // for multiline controls we don't always store the total value but only - // recompute it when asked - and to invalidate it we just empty it in - // Replace() - if ( !IsSingleLine() && m_value.empty() ) - { - // recalculate: note that we always do it for empty multilien control, - // but then it's so quick that it's not important - - // the first line is special as there is no \n before it, so it's - // outside the loop - const wxArrayString& lines = GetLines(); - wxTextCtrl *self = wxConstCast(this, wxTextCtrl); - self->m_value << lines[0u]; - size_t count = lines.GetCount(); - for ( size_t n = 1; n < count; n++ ) - { - self->m_value << _T('\n') << lines[n]; - } - } - - return m_value; -} - -void wxTextCtrl::Clear() -{ - SetValue(wxEmptyString); -} - -bool wxTextCtrl::ReplaceLine(wxTextCoord line, - const wxString& text) -{ - if ( WrapLines() ) - { - // first, we have to relayout the line entirely - // - // OPT: we might try not to recalc the unchanged part of line - - wxWrappedLineData& lineData = WData().m_linesData[line]; - - // if we had some number of rows before, use this number, otherwise - // just make sure that the test below (rowsNew != rowsOld) will be true - int rowsOld; - if ( lineData.IsValid() ) - { - rowsOld = lineData.GetExtraRowCount(); - } - else // line wasn't laid out yet - { - // assume it changed entirely as we can't do anything better - rowsOld = -1; - } - - // now change the line - MData().m_lines[line] = text; - - // OPT: we choose to lay it our immediately instead of delaying it - // until it is needed because it allows us to avoid invalidating - // lines further down if the number of rows didn't chnage, but - // maybe we can imporve this even further? - LayoutLine(line, lineData); - - int rowsNew = lineData.GetExtraRowCount(); - - if ( rowsNew != rowsOld ) - { - // we have to update the line wrap marks as this is normally done - // by LayoutLines() which we bypassed by calling LayoutLine() - // directly - wxTextCoord rowFirst = lineData.GetFirstRow(), - rowCount = wxMax(rowsOld, rowsNew); - RefreshLineWrapMarks(rowFirst, rowFirst + rowCount); - - // next, if this is not the last line, as the number of rows in it - // changed, we need to shift all the lines below it - if ( (size_t)line < WData().m_linesData.GetCount() ) - { - // number of rows changed shifting all lines below - WData().InvalidateLinesBelow(line + 1); - } - - // the number of rows changed - return true; - } - } - else // no line wrap - { - MData().m_lines[line] = text; - } - - // the number of rows didn't change - return false; -} - -void wxTextCtrl::RemoveLine(wxTextCoord line) -{ - MData().m_lines.RemoveAt(line); - if ( WrapLines() ) - { - // we need to recalculate all the starting rows from this line, but we - // can avoid doing it if this line was never calculated: this means - // that we will recalculate all lines below it anyhow later if needed - if ( WData().IsValidLine(line) ) - { - WData().InvalidateLinesBelow(line); - } - - WData().m_linesData.RemoveAt(line); - } -} - -void wxTextCtrl::InsertLine(wxTextCoord line, const wxString& text) -{ - MData().m_lines.Insert(text, line); - if ( WrapLines() ) - { - WData().m_linesData.Insert(new wxWrappedLineData, line); - - // invalidate everything below it - WData().InvalidateLinesBelow(line); - } -} - -void wxTextCtrl::Replace(wxTextPos from, wxTextPos to, const wxString& text) -{ - wxTextCoord colStart, colEnd, - lineStart, lineEnd; - - if ( (from > to) || - !PositionToXY(from, &colStart, &lineStart) || - !PositionToXY(to, &colEnd, &lineEnd) ) - { - wxFAIL_MSG(_T("invalid range in wxTextCtrl::Replace")); - - return; - } - -#ifdef WXDEBUG_TEXT_REPLACE - // a straighforward (but very inefficient) way of calculating what the new - // value should be - wxString textTotal = GetValue(); - wxString textTotalNew(textTotal, (size_t)from); - textTotalNew += text; - if ( (size_t)to < textTotal.length() ) - textTotalNew += textTotal.c_str() + (size_t)to; -#endif // WXDEBUG_TEXT_REPLACE - - // remember the old selection and reset it immediately: we must do it - // before calling Refresh(anything) as, at least under GTK, this leads to - // an _immediate_ repaint (under MSW it is delayed) and hence parts of - // text would be redrawn as selected if we didn't reset the selection - int selStartOld = m_selStart, - selEndOld = m_selEnd; - - m_selStart = - m_selEnd = -1; - - if ( IsSingleLine() ) - { - // replace the part of the text with the new value - wxString valueNew(m_value, (size_t)from); - - // remember it for later use - wxCoord startNewText = GetTextWidth(valueNew); - - valueNew += text; - if ( (size_t)to < m_value.length() ) - { - valueNew += m_value.c_str() + (size_t)to; - } - - // we usually refresh till the end of line except of the most common case - // when some text is appended to the end of the string in which case we - // refresh just it - wxCoord widthNewText; - - if ( (size_t)from < m_value.length() ) - { - // refresh till the end of line - widthNewText = 0; - } - else // text appended, not replaced - { - // refresh only the new text - widthNewText = GetTextWidth(text); - } - - m_value = valueNew; - - // force SData().m_colLastVisible update - SData().m_colLastVisible = -1; - - // repaint - RefreshPixelRange(0, startNewText, widthNewText); - } - else // multiline - { - //OPT: special case for replacements inside single line? - - /* - Join all the lines in the replacement range into one string, then - replace a part of it with the new text and break it into lines again. - */ - - // (0) we want to know if this replacement changes the number of rows - // as if it does we need to refresh everything below the changed - // text (it will be shifted...) and we can avoid it if there is no - // row relayout - bool rowsNumberChanged = false; - - // (1) join lines - const wxArrayString& linesOld = GetLines(); - wxString textOrig; - wxTextCoord line; - for ( line = lineStart; line <= lineEnd; line++ ) - { - if ( line > lineStart ) - { - // from the previous line - textOrig += _T('\n'); - } - - textOrig += linesOld[line]; - } - - // we need to append the '\n' for the last line unless there is no - // following line - size_t countOld = linesOld.GetCount(); - - // (2) replace text in the combined string - - // (2a) leave the part before replaced area unchanged - wxString textNew(textOrig, colStart); - - // these values will be used to refresh the changed area below - wxCoord widthNewText, - startNewText = GetTextWidth(textNew); - if ( (size_t)colStart == linesOld[lineStart].length() ) - { - // text appended, refresh just enough to show the new text - widthNewText = GetTextWidth(text.BeforeFirst(_T('\n'))); - } - else // text inserted, refresh till the end of line - { - widthNewText = 0; - } - - // (2b) insert new text - textNew += text; - - // (2c) and append the end of the old text - - // adjust for index shift: to is relative to colStart, not 0 - size_t toRel = (size_t)((to - from) + colStart); - if ( toRel < textOrig.length() ) - { - textNew += textOrig.c_str() + toRel; - } - - // (3) break it into lines - - wxArrayString lines; - const wxChar *curLineStart = textNew.c_str(); - for ( const wxChar *p = textNew.c_str(); ; p++ ) - { - // end of line/text? - if ( !*p || *p == _T('\n') ) - { - lines.Add(wxString(curLineStart, p)); - if ( !*p ) - break; - - curLineStart = p + 1; - } - } - -#ifdef WXDEBUG_TEXT_REPLACE - // (3a) all empty tokens should be counted as replacing with "foo" and - // with "foo\n" should have different effects - wxArrayString lines2 = wxStringTokenize(textNew, _T("\n"), - wxTOKEN_RET_EMPTY_ALL); - - if ( lines2.IsEmpty() ) - { - lines2.Add(wxEmptyString); - } - - wxASSERT_MSG( lines.GetCount() == lines2.GetCount(), - _T("Replace() broken") ); - for ( size_t n = 0; n < lines.GetCount(); n++ ) - { - wxASSERT_MSG( lines[n] == lines2[n], _T("Replace() broken") ); - } -#endif // WXDEBUG_TEXT_REPLACE - - // (3b) special case: if we replace everything till the end we need to - // keep an empty line or the lines would disappear completely - // (this also takes care of never leaving m_lines empty) - if ( ((size_t)lineEnd == countOld - 1) && lines.IsEmpty() ) - { - lines.Add(wxEmptyString); - } - - size_t nReplaceCount = lines.GetCount(), - nReplaceLine = 0; - - // (4) merge into the array - - // (4a) replace - for ( line = lineStart; line <= lineEnd; line++, nReplaceLine++ ) - { - if ( nReplaceLine < nReplaceCount ) - { - // we have the replacement line for this one - if ( ReplaceLine(line, lines[nReplaceLine]) ) - { - rowsNumberChanged = true; - } - - UpdateMaxWidth(line); - } - else // no more replacement lines - { - // (4b) delete all extra lines (note that we need to delete - // them backwards because indices shift while we do it) - bool deletedLongestLine = false; - for ( wxTextCoord lineDel = lineEnd; lineDel >= line; lineDel-- ) - { - if ( lineDel == MData().m_lineLongest ) - { - // we will need to recalc the max line width - deletedLongestLine = true; - } - - RemoveLine(lineDel); - } - - if ( deletedLongestLine ) - { - RecalcMaxWidth(); - } - - // even the line number changed - rowsNumberChanged = true; - - // update line to exit the loop - line = lineEnd + 1; - } - } - - // (4c) insert the new lines - if ( nReplaceLine < nReplaceCount ) - { - // even the line number changed - rowsNumberChanged = true; - - do - { - InsertLine(++lineEnd, lines[nReplaceLine++]); - - UpdateMaxWidth(lineEnd); - } - while ( nReplaceLine < nReplaceCount ); - } - - // (5) now refresh the changed area - - // update the (cached) last position first as refresh functions use it - m_posLast += text.length() - to + from; - - // we may optimize refresh if the number of rows didn't change - but if - // it did we have to refresh everything below the part we chanegd as - // well as it might have moved - if ( !rowsNumberChanged ) - { - // refresh the line we changed - if ( !WrapLines() ) - { - RefreshPixelRange(lineStart++, startNewText, widthNewText); - } - else - { - //OPT: we shouldn't refresh the unchanged part of the line in - // this case, but instead just refresh the tail of it - the - // trouble is that we don't know here where does this tail - // start - } - - // number of rows didn't change, refresh the updated rows and the - // last one - if ( lineStart <= lineEnd ) - RefreshLineRange(lineStart, lineEnd); - } - else // rows number did change - { - if ( !WrapLines() ) - { - // refresh only part of the first line - RefreshPixelRange(lineStart++, startNewText, widthNewText); - } - //else: we have to refresh everything as some part of the text - // could be in the previous row before but moved to the next - // one now (due to word wrap) - - wxTextCoord lineEnd = GetLines().GetCount() - 1; - if ( lineStart <= lineEnd ) - RefreshLineRange(lineStart, lineEnd); - - // refresh text rect left below - RefreshLineRange(lineEnd + 1, 0); - - // the vert scrollbar might [dis]appear - MData().m_updateScrollbarY = true; - } - - // must recalculate it - will do later - m_value.clear(); - } - -#ifdef WXDEBUG_TEXT_REPLACE - // optimized code above should give the same result as straightforward - // computation in the beginning - wxASSERT_MSG( GetValue() == textTotalNew, _T("error in Replace()") ); -#endif // WXDEBUG_TEXT_REPLACE - - // update the current position: note that we always put the cursor at the - // end of the replacement text - DoSetInsertionPoint(from + text.length()); - - // and the selection: this is complicated by the fact that selection coords - // must be first updated to reflect change in text coords, i.e. if we had - // selection from 17 to 19 and we just removed this range, we don't have to - // refresh anything, so we can't just use ClearSelection() here - if ( selStartOld != -1 ) - { - // refresh the parst of the selection outside the changed text (which - // we already refreshed) - if ( selStartOld < from ) - RefreshTextRange(selStartOld, from); - if ( to < selEndOld ) - RefreshTextRange(to, selEndOld); - - } - - // now call it to do the rest (not related to refreshing) - ClearSelection(); -} - -void wxTextCtrl::Remove(wxTextPos from, wxTextPos to) -{ - // Replace() only works with correctly ordered arguments, so exchange them - // if necessary - OrderPositions(from, to); - - Replace(from, to, wxEmptyString); -} - -void wxTextCtrl::WriteText(const wxString& text) -{ - // replace the selection with the new text - RemoveSelection(); - - Replace(m_curPos, m_curPos, text); -} - -void wxTextCtrl::AppendText(const wxString& text) -{ - SetInsertionPointEnd(); - WriteText(text); -} - -// ---------------------------------------------------------------------------- -// current position -// ---------------------------------------------------------------------------- - -void wxTextCtrl::SetInsertionPoint(wxTextPos pos) -{ - wxCHECK_RET( pos >= 0 && pos <= GetLastPosition(), - _T("insertion point position out of range") ); - - // don't do anything if it didn't change - if ( pos != m_curPos ) - { - DoSetInsertionPoint(pos); - } - - if ( !IsSingleLine() ) - { - // moving cursor should reset the stored abscissa (even if the cursor - // position didn't actually change!) - MData().m_xCaret = -1; - } - - ClearSelection(); -} - -void wxTextCtrl::InitInsertionPoint() -{ - // so far always put it in the beginning - DoSetInsertionPoint(0); - - // this will also set the selection anchor correctly - ClearSelection(); -} - -void wxTextCtrl::MoveInsertionPoint(wxTextPos pos) -{ - wxASSERT_MSG( pos >= 0 && pos <= GetLastPosition(), - _T("DoSetInsertionPoint() can only be called with valid pos") ); - - m_curPos = pos; - PositionToXY(m_curPos, &m_curCol, &m_curRow); -} - -void wxTextCtrl::DoSetInsertionPoint(wxTextPos pos) -{ - MoveInsertionPoint(pos); - - ShowPosition(pos); -} - -void wxTextCtrl::SetInsertionPointEnd() -{ - SetInsertionPoint(GetLastPosition()); -} - -wxTextPos wxTextCtrl::GetInsertionPoint() const -{ - return m_curPos; -} - -wxTextPos wxTextCtrl::GetLastPosition() const -{ - wxTextPos pos; - if ( IsSingleLine() ) - { - pos = m_value.length(); - } - else // multiline - { -#ifdef WXDEBUG_TEXT - pos = 0; - size_t nLineCount = GetLineCount(); - for ( size_t nLine = 0; nLine < nLineCount; nLine++ ) - { - // +1 is because the positions at the end of this line and of the - // start of the next one are different - pos += GetLines()[nLine].length() + 1; - } - - if ( pos > 0 ) - { - // the last position is at the end of the last line, not in the - // beginning of the next line after it - pos--; - } - - // more probable reason of this would be to forget to update m_posLast - wxASSERT_MSG( pos == m_posLast, _T("bug in GetLastPosition()") ); -#endif // WXDEBUG_TEXT - - pos = m_posLast; - } - - return pos; -} - -// ---------------------------------------------------------------------------- -// selection -// ---------------------------------------------------------------------------- - -void wxTextCtrl::GetSelection(wxTextPos* from, wxTextPos* to) const -{ - if ( from ) - *from = m_selStart; - if ( to ) - *to = m_selEnd; -} - -wxString wxTextCtrl::GetSelectionText() const -{ - wxString sel; - - if ( HasSelection() ) - { - if ( IsSingleLine() ) - { - sel = m_value.Mid(m_selStart, m_selEnd - m_selStart); - } - else // multiline - { - wxTextCoord colStart, lineStart, - colEnd, lineEnd; - PositionToXY(m_selStart, &colStart, &lineStart); - PositionToXY(m_selEnd, &colEnd, &lineEnd); - - // as always, we need to check for the special case when the start - // and end line are the same - if ( lineEnd == lineStart ) - { - sel = GetLines()[lineStart].Mid(colStart, colEnd - colStart); - } - else // sel on multiple lines - { - // take the end of the first line - sel = GetLines()[lineStart].c_str() + colStart; - sel += _T('\n'); - - // all intermediate ones - for ( wxTextCoord line = lineStart + 1; line < lineEnd; line++ ) - { - sel << GetLines()[line] << _T('\n'); - } - - // and the start of the last one - sel += GetLines()[lineEnd].Left(colEnd); - } - } - } - - return sel; -} - -void wxTextCtrl::SetSelection(wxTextPos from, wxTextPos to) -{ - // selecting till -1 is the same as selecting to the end - if ( to == -1 ) - { - // and selecting (-1, -1) range is the same as selecting everything, by - // convention - if ( from == -1 ) - from = 0; - to = GetLastPosition(); - } - - if ( from == -1 || to == from ) - { - ClearSelection(); - } - else // valid sel range - { - // remember the 'to' position as the current position, used to move the - // caret there later - wxTextPos toOrig = to; - - OrderPositions(from, to); - - wxCHECK_RET( to <= GetLastPosition(), - _T("invalid range in wxTextCtrl::SetSelection") ); - - if ( from != m_selStart || to != m_selEnd ) - { - // we need to use temp vars as RefreshTextRange() may call DoDraw() - // directly and so m_selStart/End must be reset by then - wxTextPos selStartOld = m_selStart, - selEndOld = m_selEnd; - - m_selStart = from; - m_selEnd = to; - - wxLogTrace(_T("text"), _T("Selection range is %ld-%ld"), - m_selStart, m_selEnd); - - // refresh only the part of text which became (un)selected if - // possible - if ( selStartOld == m_selStart ) - { - RefreshTextRange(selEndOld, m_selEnd); - } - else if ( selEndOld == m_selEnd ) - { - RefreshTextRange(m_selStart, selStartOld); - } - else - { - // OPT: could check for other cases too but it is probably not - // worth it as the two above are the most common ones - if ( selStartOld != -1 ) - RefreshTextRange(selStartOld, selEndOld); - if ( m_selStart != -1 ) - RefreshTextRange(m_selStart, m_selEnd); - } - - // we need to fully repaint the invalidated areas of the window - // before scrolling it (from DoSetInsertionPoint which is typically - // called after SetSelection()), otherwise they may stay unpainted - m_targetWindow->Update(); - } - //else: nothing to do - - // the insertion point is put at the location where the caret was moved - DoSetInsertionPoint(toOrig); - } -} - -void wxTextCtrl::ClearSelection() -{ - if ( HasSelection() ) - { - // we need to use temp vars as RefreshTextRange() may call DoDraw() - // directly (see above as well) - wxTextPos selStart = m_selStart, - selEnd = m_selEnd; - - // no selection any more - m_selStart = - m_selEnd = -1; - - // refresh the old selection - RefreshTextRange(selStart, selEnd); - } - - // the anchor should be moved even if there was no selection previously - m_selAnchor = m_curPos; -} - -void wxTextCtrl::RemoveSelection() -{ - if ( !HasSelection() ) - return; - - Remove(m_selStart, m_selEnd); -} - -bool wxTextCtrl::GetSelectedPartOfLine(wxTextCoord line, - wxTextPos *start, wxTextPos *end) const -{ - if ( start ) - *start = -1; - if ( end ) - *end = -1; - - if ( !HasSelection() ) - { - // no selection at all, hence no selection in this line - return false; - } - - wxTextCoord lineStart, colStart; - PositionToXY(m_selStart, &colStart, &lineStart); - if ( lineStart > line ) - { - // this line is entirely above the selection - return false; - } - - wxTextCoord lineEnd, colEnd; - PositionToXY(m_selEnd, &colEnd, &lineEnd); - if ( lineEnd < line ) - { - // this line is entirely below the selection - return false; - } - - if ( line == lineStart ) - { - if ( start ) - *start = colStart; - if ( end ) - *end = lineEnd == lineStart ? colEnd : GetLineLength(line); - } - else if ( line == lineEnd ) - { - if ( start ) - *start = lineEnd == lineStart ? colStart : 0; - if ( end ) - *end = colEnd; - } - else // the line is entirely inside the selection - { - if ( start ) - *start = 0; - if ( end ) - *end = GetLineLength(line); - } - - return true; -} - -// ---------------------------------------------------------------------------- -// flags -// ---------------------------------------------------------------------------- - -bool wxTextCtrl::IsModified() const -{ - return m_isModified; -} - -bool wxTextCtrl::IsEditable() const -{ - // disabled control can never be edited - return m_isEditable && IsEnabled(); -} - -void wxTextCtrl::MarkDirty() -{ - m_isModified = true; -} - -void wxTextCtrl::DiscardEdits() -{ - m_isModified = false; -} - -void wxTextCtrl::SetEditable(bool editable) -{ - if ( editable != m_isEditable ) - { - m_isEditable = editable; - - // the caret (dis)appears - CreateCaret(); - - // the appearance of the control might have changed - Refresh(); - } -} - -// ---------------------------------------------------------------------------- -// col/lines <-> position correspondence -// ---------------------------------------------------------------------------- - -/* - A few remarks about this stuff: - - o The numbering of the text control columns/rows starts from 0. - o Start of first line is position 0, its last position is line.length() - o Start of the next line is the last position of the previous line + 1 - */ - -int wxTextCtrl::GetLineLength(wxTextCoord line) const -{ - if ( IsSingleLine() ) - { - wxASSERT_MSG( line == 0, _T("invalid GetLineLength() parameter") ); - - return m_value.length(); - } - else // multiline - { - wxCHECK_MSG( (size_t)line < GetLineCount(), -1, - _T("line index out of range") ); - - return GetLines()[line].length(); - } -} - -wxString wxTextCtrl::GetLineText(wxTextCoord line) const -{ - if ( IsSingleLine() ) - { - wxASSERT_MSG( line == 0, _T("invalid GetLineLength() parameter") ); - - return m_value; - } - else // multiline - { - //this is called during DoGetBestSize - if (line == 0 && GetLineCount() == 0) return wxEmptyString ; - - wxCHECK_MSG( (size_t)line < GetLineCount(), wxEmptyString, - _T("line index out of range") ); - - return GetLines()[line]; - } -} - -int wxTextCtrl::GetNumberOfLines() const -{ - // there is always 1 line, even if the text is empty - return IsSingleLine() ? 1 : GetLineCount(); -} - -wxTextPos wxTextCtrl::XYToPosition(wxTextCoord x, wxTextCoord y) const -{ - // note that this method should accept any values of x and y and return -1 - // if they are out of range - if ( IsSingleLine() ) - { - return ( x > GetLastPosition() || y > 0 ) ? wxOutOfRangeTextCoord : x; - } - else // multiline - { - if ( (size_t)y >= GetLineCount() ) - { - // this position is below the text - return GetLastPosition(); - } - - wxTextPos pos = 0; - for ( size_t nLine = 0; nLine < (size_t)y; nLine++ ) - { - // +1 is because the positions at the end of this line and of the - // start of the next one are different - pos += GetLines()[nLine].length() + 1; - } - - // take into account also the position in line - if ( (size_t)x > GetLines()[y].length() ) - { - // don't return position in the next line - x = GetLines()[y].length(); - } - - return pos + x; - } -} - -bool wxTextCtrl::PositionToXY(wxTextPos pos, - wxTextCoord *x, wxTextCoord *y) const -{ - if ( IsSingleLine() ) - { - if ( (size_t)pos > m_value.length() ) - return false; - - if ( x ) - *x = pos; - if ( y ) - *y = 0; - - return true; - } - else // multiline - { - wxTextPos posCur = 0; - size_t nLineCount = GetLineCount(); - for ( size_t nLine = 0; nLine < nLineCount; nLine++ ) - { - // +1 is because the start the start of the next line is one - // position after the end of this one - wxTextPos posNew = posCur + GetLines()[nLine].length() + 1; - if ( posNew > pos ) - { - // we've found the line, now just calc the column - if ( x ) - *x = pos - posCur; - - if ( y ) - *y = nLine; - -#ifdef WXDEBUG_TEXT - wxASSERT_MSG( XYToPosition(pos - posCur, nLine) == pos, - _T("XYToPosition() or PositionToXY() broken") ); -#endif // WXDEBUG_TEXT - - return true; - } - else // go further down - { - posCur = posNew; - } - } - - // beyond the last line - return false; - } -} - -wxTextCoord wxTextCtrl::GetRowsPerLine(wxTextCoord line) const -{ - // a normal line has one row - wxTextCoord numRows = 1; - - if ( WrapLines() ) - { - // add the number of additional rows - numRows += WData().m_linesData[line].GetExtraRowCount(); - } - - return numRows; -} - -wxTextCoord wxTextCtrl::GetRowCount() const -{ - wxTextCoord count = GetLineCount(); - if (count == 0) - return 0; - if ( WrapLines() ) - { - count = GetFirstRowOfLine(count - 1) + - WData().m_linesData[count - 1].GetRowCount(); - } - - return count; -} - -wxTextCoord wxTextCtrl::GetRowAfterLine(wxTextCoord line) const -{ - if ( !WrapLines() ) - return line + 1; - - if ( !WData().IsValidLine(line) ) - { - LayoutLines(line); - } - - return WData().m_linesData[line].GetNextRow(); -} - -wxTextCoord wxTextCtrl::GetFirstRowOfLine(wxTextCoord line) const -{ - if ( !WrapLines() ) - return line; - - if ( !WData().IsValidLine(line) ) - { - LayoutLines(line); - } - - return WData().m_linesData[line].GetFirstRow(); -} - -bool wxTextCtrl::PositionToLogicalXY(wxTextPos pos, - wxCoord *xOut, - wxCoord *yOut) const -{ - wxTextCoord col, line; - - // optimization for special (but common) case when we already have the col - // and line - if ( pos == m_curPos ) - { - col = m_curCol; - line = m_curRow; - } - else // must really calculate col/line from pos - { - if ( !PositionToXY(pos, &col, &line) ) - return false; - } - - int hLine = GetLineHeight(); - wxCoord x, y; - wxString textLine = GetLineText(line); - if ( IsSingleLine() || !WrapLines() ) - { - x = GetTextWidth(textLine.Left(col)); - y = line*hLine; - } - else // difficult case: multline control with line wrap - { - y = GetFirstRowOfLine(line); - - wxTextCoord colRowStart; - y += GetRowInLine(line, col, &colRowStart); - - y *= hLine; - - // x is the width of the text before this position in this row - x = GetTextWidth(textLine.Mid(colRowStart, col - colRowStart)); - } - - if ( xOut ) - *xOut = x; - if ( yOut ) - *yOut = y; - - return true; -} - -bool wxTextCtrl::PositionToDeviceXY(wxTextPos pos, - wxCoord *xOut, - wxCoord *yOut) const -{ - wxCoord x, y; - if ( !PositionToLogicalXY(pos, &x, &y) ) - return false; - - // finally translate the logical text rect coords into physical client - // coords - CalcScrolledPosition(m_rectText.x + x, m_rectText.y + y, xOut, yOut); - - return true; -} - -wxPoint wxTextCtrl::GetCaretPosition() const -{ - wxCoord xCaret, yCaret; - if ( !PositionToDeviceXY(m_curPos, &xCaret, &yCaret) ) - { - wxFAIL_MSG( _T("Caret can't be beyond the text!") ); - } - - return wxPoint(xCaret, yCaret); -} - -// pos may be -1 to show the current position -void wxTextCtrl::ShowPosition(wxTextPos pos) -{ - bool showCaret = GetCaret() && GetCaret()->IsVisible(); - if (showCaret) - HideCaret(); - - if ( IsSingleLine() ) - { - ShowHorzPosition(GetTextWidth(m_value.Left(pos))); - } - else if ( MData().m_scrollRangeX || MData().m_scrollRangeY ) // multiline with scrollbars - { - int xStart, yStart; - GetViewStart(&xStart, &yStart); - - if ( pos == -1 ) - pos = m_curPos; - - wxCoord x, y; - PositionToLogicalXY(pos, &x, &y); - - wxRect rectText = GetRealTextArea(); - - // scroll the position vertically into view: if it is currently above - // it, make it the first one, otherwise the last one - if ( MData().m_scrollRangeY ) - { - y /= GetLineHeight(); - - if ( y < yStart ) - { - Scroll(0, y); - } - else // we are currently in or below the view area - { - // find the last row currently shown - wxTextCoord yEnd; - - if ( WrapLines() ) - { - // to find the last row we need to use the generic HitTest - wxTextCoord col; - - // OPT this is a bit silly: we undo this in HitTest(), so - // it would be better to factor out the common - // functionality into a separate function (OTOH it - // won't probably save us that much) - wxPoint pt(0, rectText.height - 1); - pt += GetClientAreaOrigin(); - pt += m_rectText.GetPosition(); - HitTest(pt, &col, &yEnd); - - // find the row inside the line - yEnd = GetFirstRowOfLine(yEnd) + GetRowInLine(yEnd, col); - } - else - { - // finding the last line is easy if each line has exactly - // one row - yEnd = yStart + rectText.height / GetLineHeight() - 1; - } - - if ( yEnd < y ) - { - // scroll down: the current item should appear at the - // bottom of the view - Scroll(0, y - (yEnd - yStart)); - } - } - } - - // scroll the position horizontally into view - // - // we follow what I believe to be Windows behaviour here, that is if - // the position is already entirely in the view we do nothing, but if - // we do have to scroll the window to bring it into view, we scroll it - // not just enough to show the position but slightly more so that this - // position is at 1/3 of the window width from the closest border to it - // (I'm not sure that Windows does exactly this but it looks like this) - if ( MData().m_scrollRangeX ) - { - // unlike for the rows, xStart doesn't correspond to the starting - // column as they all have different widths, so we need to - // translate everything to pixels - - // we want the text between x and x2 be entirely inside the view - // (i.e. the current character) - - // make xStart the first visible pixel (and not position) - int wChar = GetAverageWidth(); - xStart *= wChar; - - if ( x < xStart ) - { - // we want the position of this column be 1/3 to the right of - // the left edge - x -= rectText.width / 3; - if ( x < 0 ) - x = 0; - Scroll(x / wChar, y); - } - else // maybe we're beyond the right border of the view? - { - wxTextCoord col, row; - if ( PositionToXY(pos, &col, &row) ) - { - wxString lineText = GetLineText(row); - wxCoord x2 = x + GetTextWidth(lineText[(size_t)col]); - if ( x2 > xStart + rectText.width ) - { - // we want the position of this column be 1/3 to the - // left of the right edge, i.e. 2/3 right of the left - // one - x2 -= (2*rectText.width)/3; - if ( x2 < 0 ) - x2 = 0; - Scroll(x2 / wChar, row); - } - } - } - } - } - //else: multiline but no scrollbars, hence nothing to do - - if (showCaret) - ShowCaret(); -} - -// ---------------------------------------------------------------------------- -// word stuff -// ---------------------------------------------------------------------------- - -/* - TODO: we could have (easy to do) vi-like options for word movement, i.e. - distinguish between inlusive/exclusive words and between words and - WORDS (in vim sense) and also, finally, make the set of characters - which make up a word configurable - currently we use the exclusive - WORDS only (coincidentally, this is what Windows edit control does) - - For future references, here is what vim help says: - - A word consists of a sequence of letters, digits and underscores, or - a sequence of other non-blank characters, separated with white space - (spaces, tabs, ). This can be changed with the 'iskeyword' - option. - - A WORD consists of a sequence of non-blank characters, separated with - white space. An empty line is also considered to be a word and a - WORD. - */ - -static inline bool IsWordChar(wxChar ch) -{ - return !wxIsspace(ch); -} - -wxTextPos wxTextCtrl::GetWordStart() const -{ - if ( m_curPos == -1 || m_curPos == 0 ) - return 0; - - if ( m_curCol == 0 ) - { - // go to the end of the previous line - return m_curPos - 1; - } - - // it shouldn't be possible to learn where the word starts in the password - // text entry zone - if ( IsPassword() ) - return 0; - - // start at the previous position - const wxChar *p0 = GetLineText(m_curRow).c_str(); - const wxChar *p = p0 + m_curCol - 1; - - // find the end of the previous word - while ( (p > p0) && !IsWordChar(*p) ) - p--; - - // now find the beginning of this word - while ( (p > p0) && IsWordChar(*p) ) - p--; - - // we might have gone too far - if ( !IsWordChar(*p) ) - p++; - - return (m_curPos - m_curCol) + p - p0; -} - -wxTextPos wxTextCtrl::GetWordEnd() const -{ - if ( m_curPos == -1 ) - return 0; - - wxString line = GetLineText(m_curRow); - if ( (size_t)m_curCol == line.length() ) - { - // if we're on the last position in the line, go to the next one - if - // it exists - wxTextPos pos = m_curPos; - if ( pos < GetLastPosition() ) - pos++; - - return pos; - } - - // it shouldn't be possible to learn where the word ends in the password - // text entry zone - if ( IsPassword() ) - return GetLastPosition(); - - // start at the current position - const wxChar *p0 = line.c_str(); - const wxChar *p = p0 + m_curCol; - - // find the start of the next word - while ( *p && !IsWordChar(*p) ) - p++; - - // now find the end of it - while ( *p && IsWordChar(*p) ) - p++; - - // and find the start of the next word - while ( *p && !IsWordChar(*p) ) - p++; - - return (m_curPos - m_curCol) + p - p0; -} - -// ---------------------------------------------------------------------------- -// clipboard stuff -// ---------------------------------------------------------------------------- - -void wxTextCtrl::Copy() -{ -#if wxUSE_CLIPBOARD - if ( HasSelection() ) - { - wxClipboardLocker clipLock; - - // wxTextFile::Translate() is needed to transform all '\n' into "\r\n" - wxString text = wxTextFile::Translate(GetTextToShow(GetSelectionText())); - wxTextDataObject *data = new wxTextDataObject(text); - wxTheClipboard->SetData(data); - } -#endif // wxUSE_CLIPBOARD -} - -void wxTextCtrl::Cut() -{ - (void)DoCut(); -} - -bool wxTextCtrl::DoCut() -{ - if ( !HasSelection() ) - return false; - - Copy(); - - RemoveSelection(); - - return true; -} - -void wxTextCtrl::Paste() -{ - (void)DoPaste(); -} - -bool wxTextCtrl::DoPaste() -{ -#if wxUSE_CLIPBOARD - wxClipboardLocker clipLock; - - wxTextDataObject data; - if ( wxTheClipboard->IsSupported(data.GetFormat()) - && wxTheClipboard->GetData(data) ) - { - // reverse transformation: '\r\n\" -> '\n' - wxString text = wxTextFile::Translate(data.GetText(), - wxTextFileType_Unix); - if ( !text.empty() ) - { - WriteText(text); - - return true; - } - } -#endif // wxUSE_CLIPBOARD - - return false; -} - -// ---------------------------------------------------------------------------- -// Undo and redo -// ---------------------------------------------------------------------------- - -wxTextCtrlInsertCommand * -wxTextCtrlCommandProcessor::IsInsertCommand(wxCommand *command) -{ - return (wxTextCtrlInsertCommand *) - (command && (command->GetName() == wxTEXT_COMMAND_INSERT) - ? command : NULL); -} - -void wxTextCtrlCommandProcessor::Store(wxCommand *command) -{ - wxTextCtrlInsertCommand *cmdIns = IsInsertCommand(command); - if ( cmdIns ) - { - if ( IsCompressing() ) - { - wxTextCtrlInsertCommand * - cmdInsLast = IsInsertCommand(GetCurrentCommand()); - - // it is possible that we don't have any last command at all if, - // for example, it was undone since the last Store(), so deal with - // this case too - if ( cmdInsLast ) - { - cmdInsLast->Append(cmdIns); - - delete cmdIns; - - // don't need to call the base class version - return; - } - } - - // append the following insert commands to this one - m_compressInserts = true; - - // let the base class version will do the job normally - } - else // not an insert command - { - // stop compressing insert commands - this won't work with the last - // command not being an insert one anyhow - StopCompressing(); - - // let the base class version will do the job normally - } - - wxCommandProcessor::Store(command); -} - -void wxTextCtrlInsertCommand::Append(wxTextCtrlInsertCommand *other) -{ - m_text += other->m_text; -} - -bool wxTextCtrlInsertCommand::CanUndo() const -{ - return m_from != -1; -} - -bool wxTextCtrlInsertCommand::Do(wxTextCtrl *text) -{ - // the text is going to be inserted at the current position, remember where - // exactly it is - m_from = text->GetInsertionPoint(); - - // and now do insert it - text->WriteText(m_text); - - return true; -} - -bool wxTextCtrlInsertCommand::Undo(wxTextCtrl *text) -{ - wxCHECK_MSG( CanUndo(), false, _T("impossible to undo insert cmd") ); - - // remove the text from where we inserted it - text->Remove(m_from, m_from + m_text.length()); - - return true; -} - -bool wxTextCtrlRemoveCommand::CanUndo() const -{ - // if we were executed, we should have the text we removed - return !m_textDeleted.empty(); -} - -bool wxTextCtrlRemoveCommand::Do(wxTextCtrl *text) -{ - text->SetSelection(m_from, m_to); - m_textDeleted = text->GetSelectionText(); - text->RemoveSelection(); - - return true; -} - -bool wxTextCtrlRemoveCommand::Undo(wxTextCtrl *text) -{ - // it is possible that the text was deleted and that we can't restore text - // at the same position we removed it any more - wxTextPos posLast = text->GetLastPosition(); - text->SetInsertionPoint(m_from > posLast ? posLast : m_from); - text->WriteText(m_textDeleted); - - return true; -} - -void wxTextCtrl::Undo() -{ - // the caller must check it - wxASSERT_MSG( CanUndo(), _T("can't call Undo() if !CanUndo()") ); - - m_cmdProcessor->Undo(); -} - -void wxTextCtrl::Redo() -{ - // the caller must check it - wxASSERT_MSG( CanRedo(), _T("can't call Undo() if !CanUndo()") ); - - m_cmdProcessor->Redo(); -} - -bool wxTextCtrl::CanUndo() const -{ - return IsEditable() && m_cmdProcessor->CanUndo(); -} - -bool wxTextCtrl::CanRedo() const -{ - return IsEditable() && m_cmdProcessor->CanRedo(); -} - -// ---------------------------------------------------------------------------- -// geometry -// ---------------------------------------------------------------------------- - -wxSize wxTextCtrl::DoGetBestClientSize() const -{ - // when we're called for the very first time from Create() we must - // calculate the font metrics here because we can't do it before calling - // Create() (there is no window yet and wxGTK crashes) but we need them - // here - if ( m_heightLine == -1 ) - { - wxConstCast(this, wxTextCtrl)->RecalcFontMetrics(); - } - - wxCoord w, h; - GetTextExtent(GetTextToShow(GetLineText(0)), &w, &h); - - int wChar = GetAverageWidth(), - hChar = GetLineHeight(); - - int widthMin = wxMax(10*wChar, 100); - if ( w < widthMin ) - w = widthMin; - if ( h < hChar ) - h = hChar; - - if ( !IsSingleLine() ) - { - // let the control have a reasonable number of lines - int lines = GetNumberOfLines(); - if ( lines < 5 ) - lines = 5; - else if ( lines > 10 ) - lines = 10; - h *= lines; - } - - wxRect rectText; - rectText.width = w; - rectText.height = h; - wxRect rectTotal = GetRenderer()->GetTextTotalArea(this, rectText); - return wxSize(rectTotal.width, rectTotal.height); -} - -void wxTextCtrl::UpdateTextRect() -{ - wxRect rectTotal(GetClientSize()); - wxCoord *extraSpace = WrapLines() ? &WData().m_widthMark : NULL; - m_rectText = GetRenderer()->GetTextClientArea(this, rectTotal, extraSpace); - - // code elsewhere is confused by negative rect size - if ( m_rectText.width <= 0 ) - m_rectText.width = 1; - if ( m_rectText.height <= 0 ) - m_rectText.height = 1; - - if ( !IsSingleLine() ) - { - // invalidate it so that GetRealTextArea() will recalc it - MData().m_rectTextReal.width = 0; - - // only scroll this rect when the window is scrolled: note that we have - // to scroll not only the text but the line wrap marks too if we show - // them - wxRect rectText = GetRealTextArea(); - if ( extraSpace && *extraSpace ) - { - rectText.width += *extraSpace; - } - SetTargetRect(rectText); - - // relayout all lines - if ( WrapLines() ) - { - WData().m_rowFirstInvalid = 0; - - // increase timestamp: this means that the lines which had been - // laid out before will be relayd out the next time LayoutLines() - // is called because their timestamp will be smaller than the - // current one - WData().m_timestamp++; - } - } - - UpdateLastVisible(); -} - -void wxTextCtrl::UpdateLastVisible() -{ - // this method is only used for horizontal "scrollbarless" scrolling which - // is used only with single line controls - if ( !IsSingleLine() ) - return; - - // use (efficient) HitTestLine to find the last visible character - wxString text = m_value.Mid((size_t)SData().m_colStart /* to the end */); - wxTextCoord col; - switch ( HitTestLine(text, m_rectText.width, &col) ) - { - case wxTE_HT_BEYOND: - // everything is visible - SData().m_ofsHorz = 0; - - SData().m_colStart = 0; - SData().m_colLastVisible = text.length(); - - // calculate it below - SData().m_posLastVisible = -1; - break; - - /* - case wxTE_HT_BEFORE: - case wxTE_HT_BELOW: - */ - default: - wxFAIL_MSG(_T("unexpected HitTestLine() return value")); - // fall through - - case wxTE_HT_ON_TEXT: - if ( col > 0 ) - { - // the last entirely seen character is the previous one because - // this one is only partly visible - unless the width of the - // string is exactly the max width - SData().m_posLastVisible = GetTextWidth(text.Truncate(col + 1)); - if ( SData().m_posLastVisible > m_rectText.width ) - { - // this character is not entirely visible, take the - // previous one - col--; - - // recalc it - SData().m_posLastVisible = -1; - } - //else: we can just see it - - SData().m_colLastVisible = col; - } - break; - } - - // calculate the width of the text really shown - if ( SData().m_posLastVisible == -1 ) - { - SData().m_posLastVisible = GetTextWidth(text.Truncate(SData().m_colLastVisible + 1)); - } - - // current value is relative the start of the string text which starts at - // SData().m_colStart, we need an absolute offset into string - SData().m_colLastVisible += SData().m_colStart; - - wxLogTrace(_T("text"), _T("Last visible column/position is %d/%ld"), - (int) SData().m_colLastVisible, (long) SData().m_posLastVisible); -} - -void wxTextCtrl::OnSize(wxSizeEvent& event) -{ - UpdateTextRect(); - - if ( !IsSingleLine() ) - { -#if 0 - // update them immediately because if we are called for the first time, - // we need to create them in order for the base class version to - // position the scrollbars correctly - if we don't do it now, it won't - // happen at all if we don't get more size events - UpdateScrollbars(); -#endif // 0 - - MData().m_updateScrollbarX = - MData().m_updateScrollbarY = true; - } - - event.Skip(); -} - -wxCoord wxTextCtrl::GetTotalWidth() const -{ - wxCoord w; - CalcUnscrolledPosition(m_rectText.width, 0, &w, NULL); - return w; -} - -wxCoord wxTextCtrl::GetTextWidth(const wxString& text) const -{ - wxCoord w; - GetTextExtent(GetTextToShow(text), &w, NULL); - return w; -} - -wxRect wxTextCtrl::GetRealTextArea() const -{ - // for single line text control it's just the same as text rect - if ( IsSingleLine() ) - return m_rectText; - - // the real text area always holds an entire number of lines, so the only - // difference with the text area is a narrow strip along the bottom border - wxRect rectText = MData().m_rectTextReal; - if ( !rectText.width ) - { - // recalculate it - rectText = m_rectText; - - // when we're called for the very first time, the line height might not - // had been calculated yet, so do get it now - wxTextCtrl *self = wxConstCast(this, wxTextCtrl); - self->RecalcFontMetrics(); - - int hLine = GetLineHeight(); - rectText.height = (m_rectText.height / hLine) * hLine; - - // cache the result - self->MData().m_rectTextReal = rectText; - } - - return rectText; -} - -wxTextCoord wxTextCtrl::GetRowInLine(wxTextCoord line, - wxTextCoord col, - wxTextCoord *colRowStart) const -{ - wxASSERT_MSG( WrapLines(), _T("shouldn't be called") ); - - const wxWrappedLineData& lineData = WData().m_linesData[line]; - - if ( !WData().IsValidLine(line) ) - LayoutLines(line); - - // row is here counted a bit specially: 0 is the 2nd row of the line (1st - // extra row) - size_t row = 0, - rowMax = lineData.GetExtraRowCount(); - if ( rowMax ) - { - row = 0; - while ( (row < rowMax) && (col >= lineData.GetExtraRowStart(row)) ) - row++; - - // it's ok here that row is 1 greater than needed: like this, it is - // counted as a normal (and not extra) row - } - //else: only one row anyhow - - if ( colRowStart ) - { - // +1 because we need a real row number, not the extra row one - *colRowStart = lineData.GetRowStart(row); - - // this can't happen, of course - wxASSERT_MSG( *colRowStart <= col, _T("GetRowInLine() is broken") ); - } - - return row; -} - -void wxTextCtrl::LayoutLine(wxTextCoord line, wxWrappedLineData& lineData) const -{ - // FIXME: this uses old GetPartOfWrappedLine() which is not used anywhere - // else now and has rather awkward interface for our needs here - - lineData.m_rowsStart.Empty(); - lineData.m_rowsWidth.Empty(); - - const wxString& text = GetLineText(line); - wxCoord widthRow; - size_t colRowStart = 0; - do - { - size_t lenRow = GetPartOfWrappedLine - ( - text.c_str() + colRowStart, - &widthRow - ); - - // remember the start of this row (not for the first one as - // it's always 0) and its width - if ( colRowStart ) - lineData.m_rowsStart.Add(colRowStart); - lineData.m_rowsWidth.Add(widthRow); - - colRowStart += lenRow; - } - while ( colRowStart < text.length() ); - - // put the current timestamp on it - lineData.m_timestamp = WData().m_timestamp; -} - -void wxTextCtrl::LayoutLines(wxTextCoord lineLast) const -{ - wxASSERT_MSG( WrapLines(), _T("should only be used for line wrapping") ); - - // if we were called, some line was dirty and if it was dirty we must have - // had m_rowFirstInvalid set to something too - wxTextCoord lineFirst = WData().m_rowFirstInvalid; - wxASSERT_MSG( lineFirst != -1, _T("nothing to layout?") ); - - wxTextCoord rowFirst, rowCur; - if ( lineFirst ) - { - // start after the last known valid line - const wxWrappedLineData& lineData = WData().m_linesData[lineFirst - 1]; - rowFirst = lineData.GetFirstRow() + lineData.GetRowCount(); - } - else // no valid lines, start at row 0 - { - rowFirst = 0; - } - - rowCur = rowFirst; - for ( wxTextCoord line = lineFirst; line <= lineLast; line++ ) - { - // set the starting row for this line - wxWrappedLineData& lineData = WData().m_linesData[line]; - lineData.m_rowFirst = rowCur; - - // had the line been already broken into rows? - // - // if so, compare its timestamp with the current one: if nothing has - // been changed, don't relayout it - if ( !lineData.IsValid() || - (lineData.m_timestamp < WData().m_timestamp) ) - { - // now do break it in rows - LayoutLine(line, lineData); - } - - rowCur += lineData.GetRowCount(); - } - - // we are now valid at least up to this line, but if it is the last one we - // just don't have any more invalid rows at all - if ( (size_t)lineLast == WData().m_linesData.GetCount() -1 ) - { - lineLast = -1; - } - - wxTextCtrl *self = wxConstCast(this, wxTextCtrl); - self->WData().m_rowFirstInvalid = lineLast; - - // also refresh the line end indicators (FIXME shouldn't do it always!) - self->RefreshLineWrapMarks(rowFirst, rowCur); -} - -size_t wxTextCtrl::GetPartOfWrappedLine(const wxChar* text, - wxCoord *widthReal) const -{ - // this function is slow, it shouldn't be called unless really needed - wxASSERT_MSG( WrapLines(), _T("shouldn't be called") ); - - wxString s(text); - wxTextCoord col; - wxCoord wReal = wxDefaultCoord; - switch ( HitTestLine(s, m_rectText.width, &col) ) - { - /* - case wxTE_HT_BEFORE: - case wxTE_HT_BELOW: - */ - default: - wxFAIL_MSG(_T("unexpected HitTestLine() return value")); - // fall through - - case wxTE_HT_ON_TEXT: - if ( col > 0 ) - { - // the last entirely seen character is the previous one because - // this one is only partly visible - unless the width of the - // string is exactly the max width - wReal = GetTextWidth(s.Truncate(col + 1)); - if ( wReal > m_rectText.width ) - { - // this character is not entirely visible, take the - // previous one - col--; - - // recalc the width - wReal = wxDefaultCoord; - } - //else: we can just see it - - // wrap at any character or only at words boundaries? - if ( !(GetWindowStyle() & wxTE_CHARWRAP) ) - { - // find the (last) not word char before this word - wxTextCoord colWordStart; - for ( colWordStart = col; - colWordStart && IsWordChar(s[(size_t)colWordStart]); - colWordStart-- ) - ; - - if ( colWordStart > 0 ) - { - if ( colWordStart != col ) - { - // will have to recalc the real width - wReal = wxDefaultCoord; - - col = colWordStart; - } - } - //else: only a single word, have to wrap it here - } - } - break; - - case wxTE_HT_BEYOND: - break; - } - - // we return the number of characters, not the index of the last one - if ( (size_t)col < s.length() ) - { - // but don't return more than this (empty) string has - col++; - } - - if ( widthReal ) - { - if ( wReal == wxDefaultCoord ) - { - // calc it if not done yet - wReal = GetTextWidth(s.Truncate(col)); - } - - *widthReal = wReal; - } - - // VZ: old, horribly inefficient code which can still be used for checking - // the result (in line, not word, wrap mode only) - to be removed later -#if 0 - wxTextCtrl *self = wxConstCast(this, wxTextCtrl); - wxClientDC dc(self); - dc.SetFont(GetFont()); - self->DoPrepareDC(dc); - - wxCoord widthMax = m_rectText.width; - - // the text which we can keep in this ROW - wxString str; - wxCoord w, wOld; - for ( wOld = w = 0; *text && (w <= widthMax); ) - { - wOld = w; - str += *text++; - dc.GetTextExtent(str, &w, NULL); - } - - if ( w > widthMax ) - { - // if we wrapped, the last letter was one too much - if ( str.length() > 1 ) - { - // remove it - str.erase(str.length() - 1, 1); - } - else // but always keep at least one letter in each row - { - // the real width then is the last value of w and not teh one - // before last - wOld = w; - } - } - else // we didn't wrap - { - wOld = w; - } - - wxASSERT( col == str.length() ); - - if ( widthReal ) - { - wxASSERT( *widthReal == wOld ); - - *widthReal = wOld; - } - - //return str.length(); -#endif - - return col; -} - -// OPT: this function is called a lot - would be nice to optimize it but I -// don't really know how yet -wxTextCtrlHitTestResult wxTextCtrl::HitTestLine(const wxString& line, - wxCoord x, - wxTextCoord *colOut) const -{ - wxTextCtrlHitTestResult res = wxTE_HT_ON_TEXT; - - int col; - wxTextCtrl *self = wxConstCast(this, wxTextCtrl); - wxClientDC dc(self); - dc.SetFont(GetFont()); - self->DoPrepareDC(dc); - - wxCoord width; - dc.GetTextExtent(line, &width, NULL); - if ( x >= width ) - { - // clicking beyond the end of line is equivalent to clicking at - // the end of it, so return the last line column - col = line.length(); - if ( col ) - { - // unless the line is empty and so doesn't have any column at all - - // in this case return 0, what else can we do? - col--; - } - - res = wxTE_HT_BEYOND; - } - else if ( x < 0 ) - { - col = 0; - - res = wxTE_HT_BEFORE; - } - else // we're inside the line - { - // now calculate the column: first, approximate it with fixed-width - // value and then calculate the correct value iteratively: note that - // we use the first character of the line instead of (average) - // GetCharWidth(): it is common to have lines of dashes, for example, - // and this should give us much better approximation in such case - // - // OPT: maybe using (cache) m_widthAvg would be still faster? profile! - dc.GetTextExtent(line[0], &width, NULL); - - col = x / width; - if ( col < 0 ) - { - col = 0; - } - else if ( (size_t)col > line.length() ) - { - col = line.length(); - } - - // matchDir is the direction in which we should move to reach the - // character containing the given position - enum - { - Match_Left = -1, - Match_None = 0, - Match_Right = 1 - } matchDir = Match_None; - for ( ;; ) - { - // check that we didn't go beyond the line boundary - if ( col < 0 ) - { - col = 0; - break; - } - if ( (size_t)col > line.length() ) - { - col = line.length(); - break; - } - - wxString strBefore(line, (size_t)col); - dc.GetTextExtent(strBefore, &width, NULL); - if ( width > x ) - { - if ( matchDir == Match_Right ) - { - // we were going to the right and, finally, moved beyond - // the original position - stop on the previous one - col--; - - break; - } - - if ( matchDir == Match_None ) - { - // we just started iterating, now we know that we should - // move to the left - matchDir = Match_Left; - } - //else: we are still to the right of the target, continue - } - else // width < x - { - // invert the logic above - if ( matchDir == Match_Left ) - { - // with the exception that we don't need to backtrack here - break; - } - - if ( matchDir == Match_None ) - { - // go to the right - matchDir = Match_Right; - } - } - - // this is not supposed to happen - wxASSERT_MSG( matchDir, _T("logic error in wxTextCtrl::HitTest") ); - - if ( matchDir == Match_Right ) - col++; - else - col--; - } - } - - // check that we calculated it correctly -#ifdef WXDEBUG_TEXT - if ( res == wxTE_HT_ON_TEXT ) - { - wxCoord width1; - wxString text = line.Left(col); - dc.GetTextExtent(text, &width1, NULL); - if ( (size_t)col < line.length() ) - { - wxCoord width2; - - text += line[col]; - dc.GetTextExtent(text, &width2, NULL); - - wxASSERT_MSG( (width1 <= x) && (x < width2), - _T("incorrect HitTestLine() result") ); - } - else // we return last char - { - wxASSERT_MSG( x >= width1, _T("incorrect HitTestLine() result") ); - } - } -#endif // WXDEBUG_TEXT - - if ( colOut ) - *colOut = col; - - return res; -} - -wxTextCtrlHitTestResult wxTextCtrl::HitTest(const wxPoint& pt, long *pos) const -{ - wxTextCoord x, y; - wxTextCtrlHitTestResult rc = HitTest(pt, &x, &y); - if ( rc != wxTE_HT_UNKNOWN && pos ) - { - *pos = XYToPosition(x, y); - } - - return rc; -} - -wxTextCtrlHitTestResult wxTextCtrl::HitTest(const wxPoint& pos, - wxTextCoord *colOut, - wxTextCoord *rowOut) const -{ - return HitTest2(pos.y, pos.x, 0, rowOut, colOut, NULL, NULL); -} - -wxTextCtrlHitTestResult wxTextCtrl::HitTestLogical(const wxPoint& pos, - wxTextCoord *colOut, - wxTextCoord *rowOut) const -{ - return HitTest2(pos.y, pos.x, 0, rowOut, colOut, NULL, NULL, false); -} - -wxTextCtrlHitTestResult wxTextCtrl::HitTest2(wxCoord y0, - wxCoord x10, - wxCoord x20, - wxTextCoord *rowOut, - wxTextCoord *colStart, - wxTextCoord *colEnd, - wxTextCoord *colRowStartOut, - bool deviceCoords) const -{ - // is the point in the text area or to the right or below it? - wxTextCtrlHitTestResult res = wxTE_HT_ON_TEXT; - - // translate the window coords x0 and y0 into the client coords in the text - // area by adjusting for both the client and text area offsets (unless this - // was already done) - int x1, y; - if ( deviceCoords ) - { - wxPoint pt = GetClientAreaOrigin() + m_rectText.GetPosition(); - CalcUnscrolledPosition(x10 - pt.x, y0 - pt.y, &x1, &y); - } - else - { - y = y0; - x1 = x10; - } - - // calculate the row (it is really a LINE, not a ROW) - wxTextCoord row; - - // these vars are used only for WrapLines() case - wxTextCoord colRowStart = 0; - size_t rowLen = 0; - - if ( colRowStartOut ) - *colRowStartOut = 0; - - int hLine = GetLineHeight(); - if ( y < 0 ) - { - // and clicking before it is the same as clicking on the first one - row = 0; - - res = wxTE_HT_BEFORE; - } - else // y >= 0 - { - wxTextCoord rowLast = GetNumberOfLines() - 1; - row = y / hLine; - if ( IsSingleLine() || !WrapLines() ) - { - // in this case row calculation is simple as all lines have the - // same height and so row is the same as line - if ( row > rowLast ) - { - // clicking below the text is the same as clicking on the last - // line - row = rowLast; - - res = wxTE_HT_BELOW; - } - } - else // multline control with line wrap - { - // use binary search to find the line containing this row - const wxArrayWrappedLinesData& linesData = WData().m_linesData; - size_t lo = 0, - hi = linesData.GetCount(), - cur; - while ( lo < hi ) - { - cur = (lo + hi)/2; - const wxWrappedLineData& lineData = linesData[cur]; - if ( !WData().IsValidLine(cur) ) - LayoutLines(cur); - wxTextCoord rowFirst = lineData.GetFirstRow(); - - if ( row < rowFirst ) - { - hi = cur; - } - else - { - // our row is after the first row of the cur line: - // obviously, if cur is the last line, it contains this - // row, otherwise we have to test that it is before the - // first row of the next line - bool found = cur == linesData.GetCount() - 1; - if ( found ) - { - // if the row is beyond the end of text, adjust it to - // be the last one and set res accordingly - if ( (size_t)(row - rowFirst) >= lineData.GetRowCount() ) - { - res = wxTE_HT_BELOW; - - row = lineData.GetRowCount() + rowFirst - 1; - } - } - else // not the last row - { - const wxWrappedLineData& - lineNextData = linesData[cur + 1]; - if ( !WData().IsValidLine(cur + 1) ) - LayoutLines(cur + 1); - found = row < lineNextData.GetFirstRow(); - } - - if ( found ) - { - colRowStart = lineData.GetRowStart(row - rowFirst); - rowLen = lineData.GetRowLength(row - rowFirst, - GetLines()[cur].length()); - row = cur; - - break; - } - else - { - lo = cur; - } - } - } - } - } - - if ( res == wxTE_HT_ON_TEXT ) - { - // now find the position in the line - wxString lineText = GetLineText(row), - rowText; - - if ( colRowStart || rowLen ) - { - // look in this row only, not in whole line - rowText = lineText.Mid(colRowStart, rowLen); - } - else - { - // just take the whole string - rowText = lineText; - } - - if ( colStart ) - { - res = HitTestLine(GetTextToShow(rowText), x1, colStart); - - if ( colRowStart ) - { - if ( colRowStartOut ) - { - // give them the column offset in this ROW in pixels - *colRowStartOut = colRowStart; - } - - // take into account that the ROW doesn't start in the - // beginning of the LINE - *colStart += colRowStart; - } - - if ( colEnd ) - { - // the hit test result we return is for x1, so throw out - // the result for x2 here - int x2 = x1 + x20 - x10; - (void)HitTestLine(GetTextToShow(rowText), x2, colEnd); - - *colEnd += colRowStart; - } - } - } - else // before/after vertical text span - { - if ( colStart ) - { - // fill the column with the first/last position in the - // corresponding line - if ( res == wxTE_HT_BEFORE ) - *colStart = 0; - else // res == wxTE_HT_BELOW - *colStart = GetLineText(GetNumberOfLines() - 1).length(); - } - } - - if ( rowOut ) - { - // give them the row in text coords (as is) - *rowOut = row; - } - - return res; -} - -bool wxTextCtrl::GetLineAndRow(wxTextCoord row, - wxTextCoord *lineOut, - wxTextCoord *rowInLineOut) const -{ - wxTextCoord line, - rowInLine = 0; - - if ( row < 0 ) - return false; - - int nLines = GetNumberOfLines(); - if ( WrapLines() ) - { - const wxArrayWrappedLinesData& linesData = WData().m_linesData; - for ( line = 0; line < nLines; line++ ) - { - if ( !WData().IsValidLine(line) ) - LayoutLines(line); - - if ( row < linesData[line].GetNextRow() ) - { - // we found the right line - rowInLine = row - linesData[line].GetFirstRow(); - - break; - } - } - - if ( line == nLines ) - { - // the row is out of range - return false; - } - } - else // no line wrapping, everything is easy - { - if ( row >= nLines ) - return false; - - line = row; - } - - if ( lineOut ) - *lineOut = line; - if ( rowInLineOut ) - *rowInLineOut = rowInLine; - - return true; -} - -// ---------------------------------------------------------------------------- -// scrolling -// ---------------------------------------------------------------------------- - -/* - wxTextCtrl has not one but two scrolling mechanisms: one is semi-automatic - scrolling in both horizontal and vertical direction implemented using - wxScrollHelper and the second one is manual scrolling implemented using - SData().m_ofsHorz and used by the single line controls without scroll bar. - - The first version (the standard one) always scrolls by fixed amount which is - fine for vertical scrolling as all lines have the same height but is rather - ugly for horizontal scrolling if proportional font is used. This is why we - manually update and use SData().m_ofsHorz which contains the length of the string - which is hidden beyond the left border. An important property of text - controls using this kind of scrolling is that an entire number of characters - is always shown and that parts of characters never appear on display - - neither in the leftmost nor rightmost positions. - - Once again, for multi line controls SData().m_ofsHorz is always 0 and scrolling is - done as usual for wxScrollWindow. - */ - -void wxTextCtrl::ShowHorzPosition(wxCoord pos) -{ - wxASSERT_MSG( IsSingleLine(), _T("doesn't work for multiline") ); - - // pos is the logical position to show - - // SData().m_ofsHorz is the first logical position shown - if ( pos < SData().m_ofsHorz ) - { - // scroll backwards - wxTextCoord col; - HitTestLine(m_value, pos, &col); - ScrollText(col); - } - else - { - wxCoord width = m_rectText.width; - if ( !width ) - { - // if we are called from the ctor, m_rectText is not initialized - // yet, so do it now - UpdateTextRect(); - width = m_rectText.width; - } - - // SData().m_ofsHorz + width is the last logical position shown - if ( pos > SData().m_ofsHorz + width) - { - // scroll forward - wxTextCoord col; - HitTestLine(m_value, pos - width, &col); - ScrollText(col + 1); - } - } -} - -// scroll the window horizontally so that the first visible character becomes -// the one at this position -void wxTextCtrl::ScrollText(wxTextCoord col) -{ - wxASSERT_MSG( IsSingleLine(), - _T("ScrollText() is for single line controls only") ); - - // never scroll beyond the left border - if ( col < 0 ) - col = 0; - - // OPT: could only get the extent of the part of the string between col - // and SData().m_colStart - wxCoord ofsHorz = GetTextWidth(GetLineText(0).Left(col)); - - if ( ofsHorz != SData().m_ofsHorz ) - { - // remember the last currently used pixel - int posLastVisible = SData().m_posLastVisible; - if ( posLastVisible == -1 ) - { - // this may happen when we're called very early, during the - // controls construction - UpdateLastVisible(); - - posLastVisible = SData().m_posLastVisible; - } - - // NB1: to scroll to the right, offset must be negative, hence the - // order of operands - int dx = SData().m_ofsHorz - ofsHorz; - - // NB2: we call Refresh() below which results in a call to - // DoDraw(), so we must update SData().m_ofsHorz before calling it - SData().m_ofsHorz = ofsHorz; - SData().m_colStart = col; - - // after changing m_colStart, recalc the last visible position: we need - // to recalc the last visible position beore scrolling in order to make - // it appear exactly at the right edge of the text area after scrolling - UpdateLastVisible(); - -#if 0 // do we? - if ( dx < 0 ) - { - // we want to force the update of it after scrolling - SData().m_colLastVisible = -1; - } -#endif - - // scroll only the rectangle inside which there is the text - wxRect rect = m_rectText; - rect.width = posLastVisible; - - rect = ScrollNoRefresh(dx, 0, &rect); - - /* - we need to manually refresh the part which ScrollWindow() doesn't - refresh (with new API this means the part outside the rect returned - by ScrollNoRefresh): indeed, if we had this: - - ********o - - where '*' is text and 'o' is blank area at the end (too small to - hold the next char) then after scrolling by 2 positions to the left - we're going to have - - ******RRo - - where 'R' is the area refreshed by ScrollWindow() - but we still - need to refresh the 'o' at the end as it may be now big enough to - hold the new character shifted into view. - - when we are scrolling to the right, we need to update this rect as - well because it might have contained something before but doesn't - contain anything any more - */ - - // we can combine both rectangles into one when scrolling to the left, - // but we need two separate Refreshes() otherwise - if ( dx > 0 ) - { - // refresh the uncovered part on the left - Refresh(true, &rect); - - // and now the area on the right - rect.x = m_rectText.x + posLastVisible; - rect.width = m_rectText.width - posLastVisible; - } - else // scrolling to the left - { - // just extend the rect covering the uncovered area to the edge of - // the text rect - rect.width += m_rectText.width - posLastVisible; - } - - Refresh(true, &rect); - - // I don't know exactly why is this needed here but without it we may - // scroll the window again (from the same method) before the previously - // invalidated area is repainted when typing *very* quickly - and this - // may lead to the display corruption - Update(); - } -} - -void wxTextCtrl::CalcUnscrolledPosition(int x, int y, int *xx, int *yy) const -{ - if ( IsSingleLine() ) - { - // we don't use wxScrollHelper - if ( xx ) - *xx = x + SData().m_ofsHorz; - if ( yy ) - *yy = y; - } - else - { - // let the base class do it - wxScrollHelper::CalcUnscrolledPosition(x, y, xx, yy); - } -} - -void wxTextCtrl::CalcScrolledPosition(int x, int y, int *xx, int *yy) const -{ - if ( IsSingleLine() ) - { - // we don't use wxScrollHelper - if ( xx ) - *xx = x - SData().m_ofsHorz; - if ( yy ) - *yy = y; - } - else - { - // let the base class do it - wxScrollHelper::CalcScrolledPosition(x, y, xx, yy); - } -} - -void wxTextCtrl::DoPrepareDC(wxDC& dc) -{ - // for single line controls we only have to deal with SData().m_ofsHorz and it's - // useless to call base class version as they don't use normal scrolling - if ( IsSingleLine() && SData().m_ofsHorz ) - { - // adjust the DC origin if the text is shifted - wxPoint pt = dc.GetDeviceOrigin(); - dc.SetDeviceOrigin(pt.x - SData().m_ofsHorz, pt.y); - } - else - { - wxScrollHelper::DoPrepareDC(dc); - } -} - -void wxTextCtrl::UpdateMaxWidth(wxTextCoord line) -{ - // OPT! - - // check if the max width changes after this line was modified - wxCoord widthMaxOld = MData().m_widthMax, - width; - GetTextExtent(GetLineText(line), &width, NULL); - - if ( line == MData().m_lineLongest ) - { - // this line was the longest one, is it still? - if ( width > MData().m_widthMax ) - { - MData().m_widthMax = width; - } - else if ( width < MData().m_widthMax ) - { - // we need to find the new longest line - RecalcMaxWidth(); - } - //else: its length didn't change, nothing to do - } - else // it wasn't the longest line, but maybe it became it? - { - // GetMaxWidth() and not MData().m_widthMax as it might be not calculated yet - if ( width > GetMaxWidth() ) - { - MData().m_widthMax = width; - MData().m_lineLongest = line; - } - } - - MData().m_updateScrollbarX = MData().m_widthMax != widthMaxOld; -} - -void wxTextCtrl::RecalcFontMetrics() -{ - m_heightLine = GetCharHeight(); - m_widthAvg = GetCharWidth(); -} - -void wxTextCtrl::RecalcMaxWidth() -{ - wxASSERT_MSG( !IsSingleLine(), _T("only used for multiline") ); - - MData().m_widthMax = -1; - (void)GetMaxWidth(); -} - -wxCoord wxTextCtrl::GetMaxWidth() const -{ - if ( MData().m_widthMax == -1 ) - { - // recalculate it - - // OPT: should we remember the widths of all the lines? - - wxTextCtrl *self = wxConstCast(this, wxTextCtrl); - wxClientDC dc(self); - dc.SetFont(GetFont()); - - self->MData().m_widthMax = 0; - - size_t count = GetLineCount(); - for ( size_t n = 0; n < count; n++ ) - { - wxCoord width; - dc.GetTextExtent(GetLines()[n], &width, NULL); - if ( width > MData().m_widthMax ) - { - // remember the width and the line which has it - self->MData().m_widthMax = width; - self->MData().m_lineLongest = n; - } - } - } - - wxASSERT_MSG( MData().m_widthMax != -1, _T("should have at least 1 line") ); - - return MData().m_widthMax; -} - -void wxTextCtrl::UpdateScrollbars() -{ - wxASSERT_MSG( !IsSingleLine(), _T("only used for multiline") ); - - wxSize size = GetRealTextArea().GetSize(); - - // is our height enough to show all items? - wxTextCoord nRows = GetRowCount(); - wxCoord lineHeight = GetLineHeight(); - bool showScrollbarY = nRows*lineHeight > size.y; - - // is our width enough to show the longest line? - wxCoord charWidth, maxWidth; - bool showScrollbarX; - if ( !WrapLines() ) - { - charWidth = GetAverageWidth(); - maxWidth = GetMaxWidth(); - showScrollbarX = maxWidth > size.x; - } - else // never show the horz scrollbar - { - // just to suppress compiler warnings about using uninit vars below - charWidth = maxWidth = 0; - - showScrollbarX = false; - } - - // calc the scrollbars ranges - int scrollRangeX = showScrollbarX - ? (maxWidth + 2*charWidth - 1) / charWidth - : 0; - int scrollRangeY = showScrollbarY ? nRows : 0; - - int scrollRangeXOld = MData().m_scrollRangeX, - scrollRangeYOld = MData().m_scrollRangeY; - if ( (scrollRangeY != scrollRangeYOld) || (scrollRangeX != scrollRangeXOld) ) - { - int x, y; - GetViewStart(&x, &y); - -#if 0 - // we want to leave the scrollbars at the same position which means - // that x and y have to be adjusted as the number of positions may have - // changed - // - // the number of positions is calculated from knowing that last - // position = range - thumbSize and thumbSize == pageSize which is - // equal to the window width / pixelsPerLine - if ( scrollRangeXOld ) - { - x *= scrollRangeX - m_rectText.width / charWidth; - x /= scrollRangeXOld - m_rectText.width / charWidth; - } - - if ( scrollRangeYOld ) - y *= scrollRangeY / scrollRangeYOld; -#endif // 0 - - SetScrollbars(charWidth, lineHeight, - scrollRangeX, scrollRangeY, - x, y, - true /* no refresh */); - - if ( scrollRangeXOld ) - { - const int w = m_rectText.width / charWidth; - if ( w != scrollRangeXOld ) - { - x *= scrollRangeX - w; - x /= scrollRangeXOld - w; - } - Scroll(x, y); - } - - MData().m_scrollRangeX = scrollRangeX; - MData().m_scrollRangeY = scrollRangeY; - - // bring the current position in view - ShowPosition(-1); - } - - MData().m_updateScrollbarX = - MData().m_updateScrollbarY = false; -} - -void wxTextCtrl::OnInternalIdle() -{ - // notice that single line text control never has scrollbars - if ( !IsSingleLine() && - (MData().m_updateScrollbarX || MData().m_updateScrollbarY) ) - { - UpdateScrollbars(); - } - wxControl::OnInternalIdle(); -} - -bool wxTextCtrl::SendAutoScrollEvents(wxScrollWinEvent& event) const -{ - bool forward = event.GetEventType() == wxEVT_SCROLLWIN_LINEDOWN; - if ( event.GetOrientation() == wxHORIZONTAL ) - { - return forward ? m_curCol <= GetLineLength(m_curRow) : m_curCol > 0; - } - else // wxVERTICAL - { - return forward ? m_curRow < GetNumberOfLines() : m_curRow > 0; - } -} - -// ---------------------------------------------------------------------------- -// refresh -// ---------------------------------------------------------------------------- - -void wxTextCtrl::RefreshSelection() -{ - if ( HasSelection() ) - { - RefreshTextRange(m_selStart, m_selEnd); - } -} - -void wxTextCtrl::RefreshLineRange(wxTextCoord lineFirst, wxTextCoord lineLast) -{ - wxASSERT_MSG( lineFirst <= lineLast || !lineLast, - _T("no lines to refresh") ); - - wxRect rect; - // rect.x is already 0 - rect.width = m_rectText.width; - wxCoord h = GetLineHeight(); - - wxTextCoord rowFirst; - if ( lineFirst < GetNumberOfLines() ) - { - rowFirst = GetFirstRowOfLine(lineFirst); - } - else // lineFirst == GetNumberOfLines() - { - // lineFirst may be beyond the last line only if we refresh till - // the end, otherwise it's illegal - wxASSERT_MSG( lineFirst == GetNumberOfLines() && !lineLast, - _T("invalid line range") ); - - rowFirst = GetRowAfterLine(lineFirst - 1); - } - - rect.y = rowFirst*h; - - if ( lineLast ) - { - // refresh till this line (inclusive) - wxTextCoord rowLast = GetRowAfterLine(lineLast); - - rect.height = (rowLast - rowFirst + 1)*h; - } - else // lineLast == 0 means to refresh till the end - { - // FIXME: calc it exactly - rect.height = 32000; - } - - RefreshTextRect(rect); -} - -void wxTextCtrl::RefreshTextRange(wxTextPos start, wxTextPos end) -{ - wxCHECK_RET( start != -1 && end != -1, - _T("invalid RefreshTextRange() arguments") ); - - // accept arguments in any order as it is more conenient for the caller - OrderPositions(start, end); - - // this is acceptable but we don't do anything in this case - if ( start == end ) - return; - - wxTextPos colStart, lineStart; - if ( !PositionToXY(start, &colStart, &lineStart) ) - { - // the range is entirely beyond the end of the text, nothing to do - return; - } - - wxTextCoord colEnd, lineEnd; - if ( !PositionToXY(end, &colEnd, &lineEnd) ) - { - // the range spans beyond the end of text, refresh to the end - colEnd = -1; - lineEnd = GetNumberOfLines() - 1; - } - - // refresh all lines one by one - for ( wxTextCoord line = lineStart; line <= lineEnd; line++ ) - { - // refresh the first line from the start of the range to the end, the - // intermediate ones entirely and the last one from the beginning to - // the end of the range - wxTextPos posStart = line == lineStart ? colStart : 0; - size_t posCount; - if ( (line != lineEnd) || (colEnd == -1) ) - { - // intermediate line or the last one but we need to refresh it - // until the end anyhow - do it - posCount = wxString::npos; - } - else // last line - { - // refresh just the positions in between the start and the end one - posCount = colEnd - posStart; - } - - if ( posCount ) - RefreshColRange(line, posStart, posCount); - } -} - -void wxTextCtrl::RefreshColRange(wxTextCoord line, - wxTextPos start, - size_t count) -{ - wxString text = GetLineText(line); - - wxASSERT_MSG( (size_t)start <= text.length() && count, - _T("invalid RefreshColRange() parameter") ); - - RefreshPixelRange(line, - GetTextWidth(text.Left((size_t)start)), - GetTextWidth(text.Mid((size_t)start, (size_t)count))); -} - -// this method accepts "logical" coords in the sense that they are coordinates -// in a logical line but it can span several rows if we wrap lines and -// RefreshPixelRange() will then refresh several rows -void wxTextCtrl::RefreshPixelRange(wxTextCoord line, - wxCoord start, - wxCoord width) -{ - // we will use line text only in line wrap case - wxString text; - if ( WrapLines() ) - { - text = GetLineText(line); - } - - // special case: width == 0 means to refresh till the end of line - if ( width == 0 ) - { - // refresh till the end of visible line - width = GetTotalWidth(); - - if ( WrapLines() ) - { - // refresh till the end of text - wxCoord widthAll = GetTextWidth(text); - - // extend width to the end of ROW - width = widthAll - widthAll % width + width; - } - - // no need to refresh beyond the end of line - width -= start; - } - //else: just refresh the specified part - - wxCoord h = GetLineHeight(); - wxRect rect; - rect.x = start; - rect.y = GetFirstRowOfLine(line)*h; - rect.height = h; - - if ( WrapLines() ) - { - // (1) skip all rows which we don't touch at all - const wxWrappedLineData& lineData = WData().m_linesData[line]; - if ( !WData().IsValidLine(line) ) - LayoutLines(line); - - wxCoord wLine = 0; // suppress compiler warning about uninit var - size_t rowLast = lineData.GetRowCount(), - row = 0; - while ( (row < rowLast) && - (rect.x > (wLine = lineData.GetRowWidth(row++))) ) - { - rect.x -= wLine; - rect.y += h; - } - - // (2) now refresh all lines except the last one: note that the first - // line is refreshed from the given start to the end, all the next - // ones - entirely - while ( (row < rowLast) && (width > wLine - rect.x) ) - { - rect.width = GetTotalWidth() - rect.x; - RefreshTextRect(rect); - - width -= wLine - rect.x; - rect.x = 0; - rect.y += h; - - wLine = lineData.GetRowWidth(row++); - } - - // (3) the code below will refresh the last line - } - - rect.width = width; - - RefreshTextRect(rect); -} - -void wxTextCtrl::RefreshTextRect(const wxRect& rectClient, bool textOnly) -{ - wxRect rect; - CalcScrolledPosition(rectClient.x, rectClient.y, &rect.x, &rect.y); - rect.width = rectClient.width; - rect.height = rectClient.height; - - // account for the text area offset - rect.Offset(m_rectText.GetPosition()); - - // don't refresh beyond the text area unless we're refreshing the line wrap - // marks in which case textOnly is false - if ( textOnly ) - { - if ( rect.GetRight() > m_rectText.GetRight() ) - { - rect.SetRight(m_rectText.GetRight()); - - if ( rect.width <= 0 ) - { - // nothing to refresh - return; - } - } - } - - // check the bottom boundary always, even for the line wrap marks - if ( rect.GetBottom() > m_rectText.GetBottom() ) - { - rect.SetBottom(m_rectText.GetBottom()); - - if ( rect.height <= 0 ) - { - // nothing to refresh - return; - } - } - - // never refresh before the visible rect - if ( rect.x < m_rectText.x ) - rect.x = m_rectText.x; - - if ( rect.y < m_rectText.y ) - rect.y = m_rectText.y; - - wxLogTrace(_T("text"), _T("Refreshing (%d, %d)-(%d, %d)"), - rect.x, rect.y, rect.x + rect.width, rect.y + rect.height); - - Refresh(true, &rect); -} - -void wxTextCtrl::RefreshLineWrapMarks(wxTextCoord rowFirst, - wxTextCoord rowLast) -{ - if ( WData().m_widthMark ) - { - wxRect rectMarks; - rectMarks.x = m_rectText.width; - rectMarks.width = WData().m_widthMark; - rectMarks.y = rowFirst*GetLineHeight(); - rectMarks.height = (rowLast - rowFirst)*GetLineHeight(); - - RefreshTextRect(rectMarks, false /* don't limit to text area */); - } -} - -// ---------------------------------------------------------------------------- -// border drawing -// ---------------------------------------------------------------------------- - -void wxTextCtrl::DoDrawBorder(wxDC& dc, const wxRect& rect) -{ - m_renderer->DrawTextBorder(dc, GetBorder(), rect, GetStateFlags()); -} - -// ---------------------------------------------------------------------------- -// client area drawing -// ---------------------------------------------------------------------------- - -/* - Several remarks about wxTextCtrl redraw logic: - - 1. only the regions which must be updated are redrawn, this means that we - never Refresh() the entire window but use RefreshPixelRange() and - ScrollWindow() which only refresh small parts of it and iterate over the - update region in our DoDraw() - - 2. the text displayed on the screen is obtained using GetTextToShow(): it - should be used for all drawing/measuring - */ - -wxString wxTextCtrl::GetTextToShow(const wxString& text) const -{ - wxString textShown; - if ( IsPassword() ) - textShown = wxString(_T('*'), text.length()); - else - textShown = text; - - return textShown; -} - -void wxTextCtrl::DoDrawTextInRect(wxDC& dc, const wxRect& rectUpdate) -{ - // debugging trick to see the update rect visually -#ifdef WXDEBUG_TEXT - static int s_countUpdates = -1; - if ( s_countUpdates != -1 ) - { - wxWindowDC dc(this); - dc.SetBrush(*(++s_countUpdates % 2 ? wxRED_BRUSH : wxGREEN_BRUSH)); - dc.SetPen(*wxTRANSPARENT_PEN); - dc.DrawRectangle(rectUpdate); - } -#endif // WXDEBUG_TEXT - - // calculate the range lineStart..lineEnd of lines to redraw - wxTextCoord lineStart, lineEnd; - if ( IsSingleLine() ) - { - lineStart = - lineEnd = 0; - } - else // multiline - { - wxPoint pt = rectUpdate.GetPosition(); - (void)HitTest(pt, NULL, &lineStart); - - pt.y += rectUpdate.height; - (void)HitTest(pt, NULL, &lineEnd); - } - - // prepare for drawing - wxCoord hLine = GetLineHeight(); - - // these vars will be used for hit testing of the current row - wxCoord y = rectUpdate.y; - const wxCoord x1 = rectUpdate.x; - const wxCoord x2 = rectUpdate.x + rectUpdate.width; - - wxRect rectText; - rectText.height = hLine; - wxCoord yClient = y - GetClientAreaOrigin().y; - - // we want to always start at the top of the line, otherwise if we redraw a - // rect whose top is in the middle of a line, we'd draw this line shifted - yClient -= (yClient - m_rectText.y) % hLine; - - if ( IsSingleLine() ) - { - rectText.y = yClient; - } - else // multiline, adjust for scrolling - { - CalcUnscrolledPosition(0, yClient, NULL, &rectText.y); - } - - wxRenderer *renderer = GetRenderer(); - - // do draw the invalidated parts of each line: note that we iterate here - // over ROWs, not over LINEs - for ( wxTextCoord line = lineStart; - y < rectUpdate.y + rectUpdate.height; - y += hLine, - rectText.y += hLine ) - { - // calculate the update rect in text positions for this line - wxTextCoord colStart, colEnd, colRowStart; - wxTextCtrlHitTestResult ht = HitTest2(y, x1, x2, - &line, &colStart, &colEnd, - &colRowStart); - - if ( (ht == wxTE_HT_BEYOND) || (ht == wxTE_HT_BELOW) ) - { - wxASSERT_MSG( line <= lineEnd, _T("how did we get that far?") ); - - if ( line == lineEnd ) - { - // we redrew everything - break; - } - - // the update rect is beyond the end of line, no need to redraw - // anything on this line - but continue with the remaining ones - continue; - } - - // for single line controls we may additionally cut off everything - // which is to the right of the last visible position - if ( IsSingleLine() ) - { - // don't show the columns which are scrolled out to the left - if ( colStart < SData().m_colStart ) - colStart = SData().m_colStart; - - // colEnd may be less than colStart if colStart was changed by the - // assignment above - if ( colEnd < colStart ) - colEnd = colStart; - - // don't draw the chars beyond the rightmost one - if ( SData().m_colLastVisible == -1 ) - { - // recalculate this rightmost column - UpdateLastVisible(); - } - - if ( colStart > SData().m_colLastVisible ) - { - // don't bother redrawing something that is beyond the last - // visible position - continue; - } - - if ( colEnd > SData().m_colLastVisible ) - { - colEnd = SData().m_colLastVisible; - } - } - - // extract the part of line we need to redraw - wxString textLine = GetTextToShow(GetLineText(line)); - wxString text = textLine.Mid(colStart, colEnd - colStart + 1); - - // now deal with the selection: only do something if at least part of - // the line is selected - wxTextPos selStart, selEnd; - if ( GetSelectedPartOfLine(line, &selStart, &selEnd) ) - { - // and if this part is (at least partly) in the current row - if ( (selStart <= colEnd) && - (selEnd >= wxMax(colStart, colRowStart)) ) - { - // these values are relative to the start of the line while the - // string passed to DrawTextLine() is only part of it, so - // adjust the selection range accordingly - selStart -= colStart; - selEnd -= colStart; - - if ( selStart < 0 ) - selStart = 0; - - if ( (size_t)selEnd >= text.length() ) - selEnd = text.length(); - } - else - { - // reset selStart and selEnd to avoid passing them to - // DrawTextLine() below - selStart = - selEnd = -1; - } - } - - // calculate the text coords on screen - wxASSERT_MSG( colStart >= colRowStart, _T("invalid string part") ); - wxCoord ofsStart = GetTextWidth( - textLine.Mid(colRowStart, - colStart - colRowStart)); - rectText.x = m_rectText.x + ofsStart; - rectText.width = GetTextWidth(text); - - // do draw the text - renderer->DrawTextLine(dc, text, rectText, selStart, selEnd, - GetStateFlags()); - wxLogTrace(_T("text"), _T("Line %ld: positions %ld-%ld redrawn."), - line, colStart, colEnd); - } -} - -void wxTextCtrl::DoDrawLineWrapMarks(wxDC& dc, const wxRect& rectUpdate) -{ - wxASSERT_MSG( WrapLines() && WData().m_widthMark, - _T("shouldn't be called at all") ); - - wxRenderer *renderer = GetRenderer(); - - wxRect rectMark; - rectMark.x = rectUpdate.x; - rectMark.width = rectUpdate.width; - wxCoord yTop = GetClientAreaOrigin().y; - CalcUnscrolledPosition(0, rectUpdate.y - yTop, NULL, &rectMark.y); - wxCoord hLine = GetLineHeight(); - rectMark.height = hLine; - - wxTextCoord line, rowInLine; - - wxCoord yBottom; - CalcUnscrolledPosition(0, rectUpdate.GetBottom() - yTop, NULL, &yBottom); - for ( ; rectMark.y < yBottom; rectMark.y += hLine ) - { - if ( !GetLineAndRow(rectMark.y / hLine, &line, &rowInLine) ) - { - // we went beyond the end of text - break; - } - - // is this row continued on the next one? - if ( !WData().m_linesData[line].IsLastRow(rowInLine) ) - { - renderer->DrawLineWrapMark(dc, rectMark); - } - } -} - -void wxTextCtrl::DoDraw(wxControlRenderer *renderer) -{ - // hide the caret while we're redrawing the window and show it after we are - // done with it - wxCaretSuspend cs(this); - - // prepare the DC - wxDC& dc = renderer->GetDC(); - dc.SetFont(GetFont()); - dc.SetTextForeground(GetForegroundColour()); - - // get the intersection of the update region with the text area: note that - // the update region is in window coords and text area is in the client - // ones, so it must be shifted before computing intersection - wxRegion rgnUpdate = GetUpdateRegion(); - - wxRect rectTextArea = GetRealTextArea(); - wxPoint pt = GetClientAreaOrigin(); - wxRect rectTextAreaAdjusted = rectTextArea; - rectTextAreaAdjusted.x += pt.x; - rectTextAreaAdjusted.y += pt.y; - rgnUpdate.Intersect(rectTextAreaAdjusted); - - // even though the drawing is already clipped to the update region, we must - // explicitly clip it to the rect we will use as otherwise parts of letters - // might be drawn outside of it (if even a small part of a charater is - // inside, HitTest() will return its column and DrawText() can't draw only - // the part of the character, of course) -#ifdef __WXMSW__ - // FIXME: is this really a bug in wxMSW? - rectTextArea.width--; -#endif // __WXMSW__ - dc.SetClippingRegion(rectTextArea); - - // adjust for scrolling - DoPrepareDC(dc); - - // and now refresh the invalidated parts of the window - wxRegionIterator iter(rgnUpdate); - for ( ; iter.HaveRects(); iter++ ) - { - wxRect r = iter.GetRect(); - - // this is a workaround for wxGTK::wxRegion bug -#ifdef __WXGTK__ - if ( !r.width || !r.height ) - { - // ignore invalid rect - continue; - } -#endif // __WXGTK__ - - DoDrawTextInRect(dc, r); - } - - // now redraw the line wrap marks (if we draw them) - if ( WrapLines() && WData().m_widthMark ) - { - // this is the rect inside which line wrap marks are drawn - wxRect rectMarks; - rectMarks.x = rectTextAreaAdjusted.GetRight() + 1; - rectMarks.y = rectTextAreaAdjusted.y; - rectMarks.width = WData().m_widthMark; - rectMarks.height = rectTextAreaAdjusted.height; - - rgnUpdate = GetUpdateRegion(); - rgnUpdate.Intersect(rectMarks); - - wxRect rectUpdate = rgnUpdate.GetBox(); - if ( rectUpdate.width && rectUpdate.height ) - { - // the marks are outside previously set clipping region - dc.DestroyClippingRegion(); - - DoDrawLineWrapMarks(dc, rectUpdate); - } - } - - // show caret first time only: we must show it after drawing the text or - // the display can be corrupted when it's hidden - if ( !m_hasCaret && GetCaret() && (FindFocus() == this) ) - { - ShowCaret(); - - m_hasCaret = true; - } -} - -// ---------------------------------------------------------------------------- -// caret -// ---------------------------------------------------------------------------- - -bool wxTextCtrl::SetFont(const wxFont& font) -{ - if ( !wxControl::SetFont(font) ) - return false; - - // and refresh everything, of course - InitInsertionPoint(); - ClearSelection(); - - // update geometry parameters - UpdateTextRect(); - RecalcFontMetrics(); - if ( !IsSingleLine() ) - { - UpdateScrollbars(); - RecalcMaxWidth(); - } - - // recreate it, in fact - CreateCaret(); - - Refresh(); - - return true; -} - -bool wxTextCtrl::Enable(bool enable) -{ - if ( !wxTextCtrlBase::Enable(enable) ) - return false; - - if (FindFocus() == this && GetCaret() && - ((enable && !GetCaret()->IsVisible()) || - (!enable && GetCaret()->IsVisible()))) - ShowCaret(enable); - - return true; -} - -void wxTextCtrl::CreateCaret() -{ - wxCaret *caret; - - if ( IsEditable() ) - { - // FIXME use renderer - caret = new wxCaret(this, 1, GetLineHeight()); - } - else - { - // read only controls don't have the caret - caret = (wxCaret *)NULL; - } - - // SetCaret() will delete the old caret if any - SetCaret(caret); -} - -void wxTextCtrl::ShowCaret(bool show) -{ - wxCaret *caret = GetCaret(); - if ( caret ) - { - // (re)position caret correctly - caret->Move(GetCaretPosition()); - - // and show it there - if ((show && !caret->IsVisible()) || - (!show && caret->IsVisible())) - caret->Show(show); - } -} - -// ---------------------------------------------------------------------------- -// vertical scrolling (multiline only) -// ---------------------------------------------------------------------------- - -size_t wxTextCtrl::GetLinesPerPage() const -{ - if ( IsSingleLine() ) - return 1; - - return GetRealTextArea().height / GetLineHeight(); -} - -wxTextPos wxTextCtrl::GetPositionAbove() -{ - wxCHECK_MSG( !IsSingleLine(), INVALID_POS_VALUE, - _T("can't move cursor vertically in a single line control") ); - - // move the cursor up by one ROW not by one LINE: this means that - // we should really use HitTest() and not just go to the same - // position in the previous line - wxPoint pt = GetCaretPosition() - m_rectText.GetPosition(); - if ( MData().m_xCaret == -1 ) - { - // remember the initial cursor abscissa - MData().m_xCaret = pt.x; - } - else - { - // use the remembered abscissa - pt.x = MData().m_xCaret; - } - - CalcUnscrolledPosition(pt.x, pt.y, &pt.x, &pt.y); - pt.y -= GetLineHeight(); - - wxTextCoord col, row; - if ( HitTestLogical(pt, &col, &row) == wxTE_HT_BEFORE ) - { - // can't move further - return INVALID_POS_VALUE; - } - - return XYToPosition(col, row); -} - -wxTextPos wxTextCtrl::GetPositionBelow() -{ - wxCHECK_MSG( !IsSingleLine(), INVALID_POS_VALUE, - _T("can't move cursor vertically in a single line control") ); - - // see comments for wxACTION_TEXT_UP - wxPoint pt = GetCaretPosition() - m_rectText.GetPosition(); - if ( MData().m_xCaret == -1 ) - { - // remember the initial cursor abscissa - MData().m_xCaret = pt.x; - } - else - { - // use the remembered abscissa - pt.x = MData().m_xCaret; - } - - CalcUnscrolledPosition(pt.x, pt.y, &pt.x, &pt.y); - pt.y += GetLineHeight(); - - wxTextCoord col, row; - if ( HitTestLogical(pt, &col, &row) == wxTE_HT_BELOW ) - { - // can't go further down - return INVALID_POS_VALUE; - } - - // note that wxTE_HT_BEYOND is ok: it happens when we go down - // from a longer line to a shorter one, for example (OTOH - // wxTE_HT_BEFORE can never happen) - return XYToPosition(col, row); -} - -// ---------------------------------------------------------------------------- -// input -// ---------------------------------------------------------------------------- - -bool wxTextCtrl::PerformAction(const wxControlAction& actionOrig, - long numArg, - const wxString& strArg) -{ - // has the text changed as result of this action? - bool textChanged = false; - - // the remembered cursor abscissa for multiline text controls is usually - // reset after each user action but for ones which do use it (UP and DOWN - // for example) we shouldn't do it - as indicated by this flag - bool rememberAbscissa = false; - - // the command this action corresponds to or NULL if this action doesn't - // change text at all or can't be undone - wxTextCtrlCommand *command = (wxTextCtrlCommand *)NULL; - - wxString action; - bool del = false, - sel = false; - if ( actionOrig.StartsWith(wxACTION_TEXT_PREFIX_DEL, &action) ) - { - if ( IsEditable() ) - del = true; - } - else if ( actionOrig.StartsWith(wxACTION_TEXT_PREFIX_SEL, &action) ) - { - sel = true; - } - else // not selection nor delete action - { - action = actionOrig; - } - - // set newPos to -2 as it can't become equal to it in the assignments below - // (but it can become -1) - wxTextPos newPos = INVALID_POS_VALUE; - - if ( action == wxACTION_TEXT_HOME ) - { - newPos = m_curPos - m_curCol; - } - else if ( action == wxACTION_TEXT_END ) - { - newPos = m_curPos + GetLineLength(m_curRow) - m_curCol; - } - else if ( (action == wxACTION_TEXT_GOTO) || - (action == wxACTION_TEXT_FIRST) || - (action == wxACTION_TEXT_LAST) ) - { - if ( action == wxACTION_TEXT_FIRST ) - numArg = 0; - else if ( action == wxACTION_TEXT_LAST ) - numArg = GetLastPosition(); - //else: numArg already contains the position - - newPos = numArg; - } - else if ( action == wxACTION_TEXT_UP ) - { - if ( !IsSingleLine() ) - { - newPos = GetPositionAbove(); - - if ( newPos != INVALID_POS_VALUE ) - { - // remember where the cursor original had been - rememberAbscissa = true; - } - } - } - else if ( action == wxACTION_TEXT_DOWN ) - { - if ( !IsSingleLine() ) - { - newPos = GetPositionBelow(); - - if ( newPos != INVALID_POS_VALUE ) - { - // remember where the cursor original had been - rememberAbscissa = true; - } - } - } - else if ( action == wxACTION_TEXT_LEFT ) - { - newPos = m_curPos - 1; - } - else if ( action == wxACTION_TEXT_WORD_LEFT ) - { - newPos = GetWordStart(); - } - else if ( action == wxACTION_TEXT_RIGHT ) - { - newPos = m_curPos + 1; - } - else if ( action == wxACTION_TEXT_WORD_RIGHT ) - { - newPos = GetWordEnd(); - } - else if ( action == wxACTION_TEXT_INSERT ) - { - if ( IsEditable() && !strArg.empty() ) - { - // inserting text can be undone - command = new wxTextCtrlInsertCommand(strArg); - - textChanged = true; - } - } - else if ( (action == wxACTION_TEXT_PAGE_UP) || - (action == wxACTION_TEXT_PAGE_DOWN) ) - { - if ( !IsSingleLine() ) - { - size_t count = GetLinesPerPage(); - if ( count > PAGE_OVERLAP_IN_LINES ) - { - // pages should overlap slightly to allow the reader to keep - // orientation in the text - count -= PAGE_OVERLAP_IN_LINES; - } - - // remember where the cursor original had been - rememberAbscissa = true; - - bool goUp = action == wxACTION_TEXT_PAGE_UP; - for ( size_t line = 0; line < count; line++ ) - { - wxTextPos pos = goUp ? GetPositionAbove() : GetPositionBelow(); - if ( pos == INVALID_POS_VALUE ) - { - // can't move further - break; - } - - MoveInsertionPoint(pos); - newPos = pos; - } - - // we implement the Unix scrolling model here: cursor will always - // be on the first line after Page Down and on the last one after - // Page Up - // - // Windows programs usually keep the cursor line offset constant - // but do we really need it? - wxCoord y; - if ( goUp ) - { - // find the line such that when it is the first one, the - // current position is in the last line - wxTextPos pos = 0; - for ( size_t line = 0; line < count; line++ ) - { - pos = GetPositionAbove(); - if ( pos == INVALID_POS_VALUE ) - break; - - MoveInsertionPoint(pos); - } - - MoveInsertionPoint(newPos); - - PositionToLogicalXY(pos, NULL, &y); - } - else // scrolled down - { - PositionToLogicalXY(newPos, NULL, &y); - } - - // scroll vertically only - Scroll(wxDefaultCoord, y); - } - } - else if ( action == wxACTION_TEXT_SEL_WORD ) - { - SetSelection(GetWordStart(), GetWordEnd()); - } - else if ( action == wxACTION_TEXT_ANCHOR_SEL ) - { - newPos = numArg; - } - else if ( action == wxACTION_TEXT_EXTEND_SEL ) - { - SetSelection(m_selAnchor, numArg); - } - else if ( action == wxACTION_TEXT_COPY ) - { - Copy(); - } - else if ( action == wxACTION_TEXT_CUT ) - { - if ( IsEditable() ) - Cut(); - } - else if ( action == wxACTION_TEXT_PASTE ) - { - if ( IsEditable() ) - Paste(); - } - else if ( action == wxACTION_TEXT_UNDO ) - { - if ( CanUndo() ) - Undo(); - } - else if ( action == wxACTION_TEXT_REDO ) - { - if ( CanRedo() ) - Redo(); - } - else - { - return wxControl::PerformAction(action, numArg, strArg); - } - - if ( newPos != INVALID_POS_VALUE ) - { - // bring the new position into the range - if ( newPos < 0 ) - newPos = 0; - - wxTextPos posLast = GetLastPosition(); - if ( newPos > posLast ) - newPos = posLast; - - if ( del ) - { - // if we have the selection, remove just it - wxTextPos from, to; - if ( HasSelection() ) - { - from = m_selStart; - to = m_selEnd; - } - else - { - // otherwise delete everything between current position and - // the new one - if ( m_curPos != newPos ) - { - from = m_curPos; - to = newPos; - } - else // nothing to delete - { - // prevent test below from working - from = INVALID_POS_VALUE; - - // and this is just to silent the compiler warning - to = 0; - } - } - - if ( from != INVALID_POS_VALUE ) - { - command = new wxTextCtrlRemoveCommand(from, to); - } - } - else // cursor movement command - { - // just go there - DoSetInsertionPoint(newPos); - - if ( sel ) - { - SetSelection(m_selAnchor, m_curPos); - } - else // simple movement - { - // clear the existing selection - ClearSelection(); - } - } - - if ( !rememberAbscissa && !IsSingleLine() ) - { - MData().m_xCaret = -1; - } - } - - if ( command ) - { - // execute and remember it to be able to undo it later - m_cmdProcessor->Submit(command); - - // undoable commands always change text - textChanged = true; - } - else // no undoable command - { - // m_cmdProcessor->StopCompressing() - } - - if ( textChanged ) - { - wxASSERT_MSG( IsEditable(), _T("non editable control changed?") ); - - wxCommandEvent event(wxEVT_COMMAND_TEXT_UPDATED, GetId()); - InitCommandEvent(event); - GetEventHandler()->ProcessEvent(event); - - // as the text changed... - m_isModified = true; - } - - return true; -} - -void wxTextCtrl::OnChar(wxKeyEvent& event) -{ - // only process the key events from "simple keys" here - if ( !event.HasModifiers() ) - { - int keycode = event.GetKeyCode(); -#if wxUSE_UNICODE - wxChar unicode = event.GetUnicodeKey(); -#endif - if ( keycode == WXK_RETURN ) - { - if ( IsSingleLine() || (GetWindowStyle() & wxTE_PROCESS_ENTER) ) - { - wxCommandEvent event(wxEVT_COMMAND_TEXT_ENTER, GetId()); - InitCommandEvent(event); - event.SetString(GetValue()); - GetEventHandler()->ProcessEvent(event); - } - else // interpret normally: insert new line - { - PerformAction(wxACTION_TEXT_INSERT, -1, _T('\n')); - } - } - else if ( keycode < 255 && isprint(keycode) ) - { - PerformAction(wxACTION_TEXT_INSERT, -1, (wxChar)keycode); - - // skip event.Skip() below - return; - } -#if wxUSE_UNICODE - else if (unicode > 0) - { - PerformAction(wxACTION_TEXT_INSERT, -1, unicode); - - return; - } -#endif - } -#ifdef __WXDEBUG__ - // Ctrl-R refreshes the control in debug mode - else if ( event.ControlDown() && event.GetKeyCode() == 'r' ) - Refresh(); -#endif // __WXDEBUG__ - - event.Skip(); -} - -/* static */ -wxInputHandler *wxTextCtrl::GetStdInputHandler(wxInputHandler *handlerDef) -{ - static wxStdTextCtrlInputHandler s_handler(handlerDef); - - return &s_handler; -} - -// ---------------------------------------------------------------------------- -// wxStdTextCtrlInputHandler -// ---------------------------------------------------------------------------- - -wxStdTextCtrlInputHandler::wxStdTextCtrlInputHandler(wxInputHandler *inphand) - : wxStdInputHandler(inphand) -{ - m_winCapture = (wxTextCtrl *)NULL; -} - -/* static */ -wxTextPos wxStdTextCtrlInputHandler::HitTest(const wxTextCtrl *text, - const wxPoint& pt) -{ - wxTextCoord col, row; - wxTextCtrlHitTestResult ht = text->HitTest(pt, &col, &row); - - wxTextPos pos = text->XYToPosition(col, row); - - // if the point is after the last column we must adjust the position to be - // the last position in the line (unless it is already the last) - if ( (ht == wxTE_HT_BEYOND) && (pos < text->GetLastPosition()) ) - { - pos++; - } - - return pos; -} - -bool wxStdTextCtrlInputHandler::HandleKey(wxInputConsumer *consumer, - const wxKeyEvent& event, - bool pressed) -{ - // we're only interested in key presses - if ( !pressed ) - return false; - - int keycode = event.GetKeyCode(); - - wxControlAction action; - wxString str; - bool ctrlDown = event.ControlDown(), - shiftDown = event.ShiftDown(); - if ( shiftDown ) - { - action = wxACTION_TEXT_PREFIX_SEL; - } - - // the only key combination with Alt we recognize is Alt-Bksp for undo, so - // treat it first separately - if ( event.AltDown() ) - { - if ( keycode == WXK_BACK && !ctrlDown && !shiftDown ) - action = wxACTION_TEXT_UNDO; - } - else switch ( keycode ) - { - // cursor movement - case WXK_HOME: - action << (ctrlDown ? wxACTION_TEXT_FIRST - : wxACTION_TEXT_HOME); - break; - - case WXK_END: - action << (ctrlDown ? wxACTION_TEXT_LAST - : wxACTION_TEXT_END); - break; - - case WXK_UP: - if ( !ctrlDown ) - action << wxACTION_TEXT_UP; - break; - - case WXK_DOWN: - if ( !ctrlDown ) - action << wxACTION_TEXT_DOWN; - break; - - case WXK_LEFT: - action << (ctrlDown ? wxACTION_TEXT_WORD_LEFT - : wxACTION_TEXT_LEFT); - break; - - case WXK_RIGHT: - action << (ctrlDown ? wxACTION_TEXT_WORD_RIGHT - : wxACTION_TEXT_RIGHT); - break; - - case WXK_PAGEDOWN: - // we don't map Ctrl-PgUp/Dn to anything special - what should it - // to? for now, it's the same as without control - action << wxACTION_TEXT_PAGE_DOWN; - break; - - case WXK_PAGEUP: - action << wxACTION_TEXT_PAGE_UP; - break; - - // delete - case WXK_DELETE: - if ( !ctrlDown ) - action << wxACTION_TEXT_PREFIX_DEL << wxACTION_TEXT_RIGHT; - break; - - case WXK_BACK: - if ( !ctrlDown ) - action << wxACTION_TEXT_PREFIX_DEL << wxACTION_TEXT_LEFT; - break; - - // something else - default: - // reset the action as it could be already set to one of the - // prefixes - action = wxACTION_NONE; - - if ( ctrlDown ) - { - switch ( keycode ) - { - case 'A': - action = wxACTION_TEXT_REDO; - break; - - case 'C': - action = wxACTION_TEXT_COPY; - break; - - case 'V': - action = wxACTION_TEXT_PASTE; - break; - - case 'X': - action = wxACTION_TEXT_CUT; - break; - - case 'Z': - action = wxACTION_TEXT_UNDO; - break; - } - } - } - - if ( (action != wxACTION_NONE) && (action != wxACTION_TEXT_PREFIX_SEL) ) - { - consumer->PerformAction(action, -1, str); - - return true; - } - - return wxStdInputHandler::HandleKey(consumer, event, pressed); -} - -bool wxStdTextCtrlInputHandler::HandleMouse(wxInputConsumer *consumer, - const wxMouseEvent& event) -{ - if ( event.LeftDown() ) - { - wxASSERT_MSG( !m_winCapture, _T("left button going down twice?") ); - - wxTextCtrl *text = wxStaticCast(consumer->GetInputWindow(), wxTextCtrl); - - m_winCapture = text; - m_winCapture->CaptureMouse(); - - text->HideCaret(); - - wxTextPos pos = HitTest(text, event.GetPosition()); - if ( pos != -1 ) - { - text->PerformAction(wxACTION_TEXT_ANCHOR_SEL, pos); - } - } - else if ( event.LeftDClick() ) - { - // select the word the cursor is on - consumer->PerformAction(wxACTION_TEXT_SEL_WORD); - } - else if ( event.LeftUp() ) - { - if ( m_winCapture ) - { - m_winCapture->ShowCaret(); - - m_winCapture->ReleaseMouse(); - m_winCapture = (wxTextCtrl *)NULL; - } - } - - return wxStdInputHandler::HandleMouse(consumer, event); -} - -bool wxStdTextCtrlInputHandler::HandleMouseMove(wxInputConsumer *consumer, - const wxMouseEvent& event) -{ - if ( m_winCapture ) - { - // track it - wxTextCtrl *text = wxStaticCast(m_winCapture, wxTextCtrl); - wxTextPos pos = HitTest(text, event.GetPosition()); - if ( pos != -1 ) - { - text->PerformAction(wxACTION_TEXT_EXTEND_SEL, pos); - } - } - - return wxStdInputHandler::HandleMouseMove(consumer, event); -} - -bool -wxStdTextCtrlInputHandler::HandleFocus(wxInputConsumer *consumer, - const wxFocusEvent& event) -{ - wxTextCtrl *text = wxStaticCast(consumer->GetInputWindow(), wxTextCtrl); - - // the selection appearance changes depending on whether we have the focus - text->RefreshSelection(); - - if (event.GetEventType() == wxEVT_SET_FOCUS) - { - if (text->GetCaret() && !text->GetCaret()->IsVisible()) - text->ShowCaret(); - } - else - { - if (text->GetCaret() && text->GetCaret()->IsVisible()) - text->HideCaret(); - } - - // never refresh entirely - return false; -} - -#endif // wxUSE_TEXTCTRL diff --git a/wxWidgets/src/univ/tglbtn.cpp b/wxWidgets/src/univ/tglbtn.cpp deleted file mode 100644 index 67de0cb2ed..0000000000 --- a/wxWidgets/src/univ/tglbtn.cpp +++ /dev/null @@ -1,98 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: univ/tglbtn.cpp -// Purpose: wxToggleButton -// Author: Vadim Zeitlin -// Modified by: David Bjorkevik -// Created: 16.05.06 -// RCS-ID: $Id: tglbtn.cpp 39320 2006-05-24 17:17:27Z PC $ -// Copyright: (c) 2000 SciTech Software, Inc. (www.scitechsoft.com) -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_TOGGLEBTN - -#include "wx/tglbtn.h" - -DEFINE_EVENT_TYPE(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED) - -IMPLEMENT_DYNAMIC_CLASS(wxToggleButton, wxButton) - -wxToggleButton::wxToggleButton() -{ - Init(); -} - -wxToggleButton::wxToggleButton(wxWindow *parent, - wxWindowID id, - const wxBitmap& bitmap, - const wxString& label, - const wxPoint& pos, - const wxSize& size, - long style, - const wxValidator& validator, - const wxString& name) -{ - Init(); - Create(parent, id, bitmap, label, pos, size, style, validator, name); -} - -wxToggleButton::wxToggleButton(wxWindow *parent, - wxWindowID id, - const wxString& label, - const wxPoint& pos, - const wxSize& size, - long style, - const wxValidator& validator, - const wxString& name) -{ - Init(); - Create(parent, id, label, pos, size, style, validator, name); -} - -wxToggleButton::~wxToggleButton() -{ -} - -void wxToggleButton::Init() -{ - m_isPressed = false; - m_value = false; -} - -void wxToggleButton::Toggle() -{ - if ( m_isPressed ) - Release(); - else - Press(); - - if ( !m_isPressed ) - { - // releasing button after it had been pressed generates a click event - // and toggles value - m_value = !m_value; - Click(); - } -} - -void wxToggleButton::Click() -{ - wxCommandEvent event(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, GetId()); - InitCommandEvent(event); - event.SetInt(GetValue()); - Command(event); -} - -void wxToggleButton::SetValue(bool state) -{ - m_value = state; - Refresh(); -} - -#endif // wxUSE_TOGGLEBTN diff --git a/wxWidgets/src/univ/theme.cpp b/wxWidgets/src/univ/theme.cpp deleted file mode 100644 index aa89300751..0000000000 --- a/wxWidgets/src/univ/theme.cpp +++ /dev/null @@ -1,204 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: univ/theme.cpp -// Purpose: implementation of wxTheme -// Author: Vadim Zeitlin -// Modified by: -// Created: 06.08.00 -// RCS-ID: $Id: theme.cpp 42455 2006-10-26 15:33:10Z VS $ -// Copyright: (c) 2000 SciTech Software, Inc. (www.scitechsoft.com) -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -// =========================================================================== -// declarations -// =========================================================================== - -// --------------------------------------------------------------------------- -// headers -// --------------------------------------------------------------------------- - -// 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 // WX_PRECOMP - -#include "wx/artprov.h" - -#include "wx/univ/renderer.h" -#include "wx/univ/inphand.h" -#include "wx/univ/theme.h" - -// ============================================================================ -// implementation -// ============================================================================ - -wxThemeInfo *wxTheme::ms_allThemes = (wxThemeInfo *)NULL; -wxTheme *wxTheme::ms_theme = (wxTheme *)NULL; - -// ---------------------------------------------------------------------------- -// "dynamic" theme creation -// ---------------------------------------------------------------------------- - -wxThemeInfo::wxThemeInfo(Constructor c, - const wxChar *n, - const wxChar *d) - : name(n), desc(d), ctor(c) -{ - // insert us (in the head of) the linked list - next = wxTheme::ms_allThemes; - wxTheme::ms_allThemes = this; -} - -/* static */ wxTheme *wxTheme::Create(const wxString& name) -{ - // find the theme in the list by name - wxThemeInfo *info = ms_allThemes; - while ( info ) - { - if ( name.CmpNoCase(info->name) == 0 ) - { - return info->ctor(); - } - - info = info->next; - } - - return (wxTheme *)NULL; -} - -// ---------------------------------------------------------------------------- -// the default theme (called by wxApp::OnInitGui) -// ---------------------------------------------------------------------------- - -/* static */ bool wxTheme::CreateDefault() -{ - if ( ms_theme ) - { - // we already have a theme - return true; - } - - wxString nameDefTheme; - - // use the environment variable first - const wxChar *p = wxGetenv(_T("WXTHEME")); - if ( p ) - { - nameDefTheme = p; - } -#ifdef wxUNIV_DEFAULT_THEME - else // use native theme by default - { - nameDefTheme = wxSTRINGIZE_T(wxUNIV_DEFAULT_THEME); - } -#endif // wxUNIV_DEFAULT_THEME - - wxTheme *theme = Create(nameDefTheme); - - // fallback to the first one in the list - if ( !theme && ms_allThemes ) - { - theme = ms_allThemes->ctor(); - } - - // abort if still nothing - if ( !theme ) - { - wxLogError(_("Failed to initialize GUI: no built-in themes found.")); - - return false; - } - - // Set the theme as current. - wxTheme::Set(theme); - - return true; -} - -/* static */ wxTheme *wxTheme::Set(wxTheme *theme) -{ - wxTheme *themeOld = ms_theme; - ms_theme = theme; - - if ( ms_theme ) - { - // automatically start using the art provider of the new theme if it - // has one - wxArtProvider *art = ms_theme->GetArtProvider(); - if ( art ) - wxArtProvider::Push(art); - } - - return themeOld; -} - -// ---------------------------------------------------------------------------- -// assorted trivial dtors -// ---------------------------------------------------------------------------- - -wxTheme::~wxTheme() -{ -} - - -// ---------------------------------------------------------------------------- -// wxDelegateTheme -// ---------------------------------------------------------------------------- - -wxDelegateTheme::wxDelegateTheme(const wxChar *theme) -{ - m_themeName = theme; - m_theme = NULL; -} - -wxDelegateTheme::~wxDelegateTheme() -{ - delete m_theme; -} - -bool wxDelegateTheme::GetOrCreateTheme() -{ - if ( !m_theme ) - m_theme = wxTheme::Create(m_themeName); - return m_theme != NULL; -} - -wxRenderer *wxDelegateTheme::GetRenderer() -{ - if ( !GetOrCreateTheme() ) - return NULL; - - return m_theme->GetRenderer(); -} - -wxArtProvider *wxDelegateTheme::GetArtProvider() -{ - if ( !GetOrCreateTheme() ) - return NULL; - - return m_theme->GetArtProvider(); -} - -wxInputHandler *wxDelegateTheme::GetInputHandler(const wxString& control, - wxInputConsumer *consumer) -{ - if ( !GetOrCreateTheme() ) - return NULL; - - return m_theme->GetInputHandler(control, consumer); -} - -wxColourScheme *wxDelegateTheme::GetColourScheme() -{ - if ( !GetOrCreateTheme() ) - return NULL; - - return m_theme->GetColourScheme(); -} diff --git a/wxWidgets/src/univ/themes/gtk.cpp b/wxWidgets/src/univ/themes/gtk.cpp deleted file mode 100644 index 0135fa3f76..0000000000 --- a/wxWidgets/src/univ/themes/gtk.cpp +++ /dev/null @@ -1,2739 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: src/univ/themes/gtk.cpp -// Purpose: wxUniversal theme implementing GTK-like LNF -// Author: Vadim Zeitlin -// Modified by: -// Created: 06.08.00 -// RCS-ID: $Id: gtk.cpp 44058 2006-12-24 19:06:39Z VS $ -// Copyright: (c) 2000 SciTech Software, Inc. (www.scitechsoft.com) -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -// =========================================================================== -// declarations -// =========================================================================== - -// --------------------------------------------------------------------------- -// headers -// --------------------------------------------------------------------------- - -// for compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#include "wx/univ/theme.h" - -#if wxUSE_THEME_GTK - -#ifndef WX_PRECOMP - #include "wx/intl.h" - #include "wx/log.h" - #include "wx/dcmemory.h" - #include "wx/window.h" - - #include "wx/menu.h" - - #include "wx/bmpbuttn.h" - #include "wx/button.h" - #include "wx/checkbox.h" - #include "wx/listbox.h" - #include "wx/checklst.h" - #include "wx/combobox.h" - #include "wx/scrolbar.h" - #include "wx/slider.h" - #include "wx/textctrl.h" - #include "wx/toolbar.h" - #include "wx/statusbr.h" - - #include "wx/settings.h" - #include "wx/toplevel.h" - #include "wx/image.h" -#endif // WX_PRECOMP - -#include "wx/notebook.h" -#include "wx/spinbutt.h" -#include "wx/artprov.h" -#ifdef wxUSE_TOGGLEBTN -#include "wx/tglbtn.h" -#endif // wxUSE_TOGGLEBTN - -#include "wx/univ/stdrend.h" -#include "wx/univ/inpcons.h" -#include "wx/univ/inphand.h" -#include "wx/univ/colschem.h" - -class WXDLLEXPORT wxGTKMenuGeometryInfo; - -// ---------------------------------------------------------------------------- -// constants -// ---------------------------------------------------------------------------- - -// standard border size -static const int BORDER_THICKNESS = 2; - -// ---------------------------------------------------------------------------- -// wxGTKRenderer: draw the GUI elements in GTK style -// ---------------------------------------------------------------------------- - -class wxGTKRenderer : public wxStdRenderer -{ -public: - wxGTKRenderer(const wxColourScheme *scheme); - - // wxRenderer methods - virtual void DrawFocusRect(wxDC& dc, const wxRect& rect, int flags = 0); - virtual void DrawTextBorder(wxDC& dc, - wxBorder border, - const wxRect& rect, - int flags = 0, - wxRect *rectIn = NULL); - virtual void DrawButtonLabel(wxDC& dc, - const wxString& label, - const wxBitmap& image, - const wxRect& rect, - int flags, - int alignment, - int indexAccel, - wxRect *rectBounds); - virtual void DrawButtonBorder(wxDC& dc, - const wxRect& rect, - int flags = 0, - wxRect *rectIn = NULL); - virtual void DrawArrow(wxDC& dc, - wxDirection dir, - const wxRect& rect, - int flags = 0); - virtual void DrawScrollbarArrow(wxDC& dc, - wxDirection dir, - const wxRect& rect, - int flags = 0); - virtual void DrawScrollbarThumb(wxDC& dc, - wxOrientation orient, - const wxRect& rect, - int flags = 0); - virtual void DrawScrollbarShaft(wxDC& dc, - wxOrientation orient, - const wxRect& rect, - int flags = 0); - -#if wxUSE_TOOLBAR - virtual void DrawToolBarButton(wxDC& dc, - const wxString& label, - const wxBitmap& bitmap, - const wxRect& rect, - int flags = 0, - long style = 0, - int tbarStyle = 0); -#endif // wxUSE_TOOLBAR - -#if wxUSE_TEXTCTRL - virtual void DrawLineWrapMark(wxDC& dc, const wxRect& rect); -#endif // wxUSE_TEXTCTRL - -#if wxUSE_NOTEBOOK - virtual void DrawTab(wxDC& dc, - const wxRect& rect, - wxDirection dir, - const wxString& label, - const wxBitmap& bitmap = wxNullBitmap, - int flags = 0, - int indexAccel = -1); -#endif // wxUSE_NOTEBOOK - -#if wxUSE_SLIDER - virtual void DrawSliderShaft(wxDC& dc, - const wxRect& rect, - int lenThumb, - wxOrientation orient, - int flags = 0, - long style = 0, - wxRect *rectShaft = NULL); - virtual void DrawSliderThumb(wxDC& dc, - const wxRect& rect, - wxOrientation orient, - int flags = 0, - long style = 0); - virtual void DrawSliderTicks(wxDC& WXUNUSED(dc), - const wxRect& WXUNUSED(rect), - int WXUNUSED(lenThumb), - wxOrientation WXUNUSED(orient), - int WXUNUSED(start), - int WXUNUSED(end), - int WXUNUSED(step) = 1, - int WXUNUSED(flags) = 0, - long WXUNUSED(style) = 0) - { - // we don't have the ticks in GTK version - } -#endif // wxUSE_SLIDER - -#if wxUSE_MENUS - virtual void DrawMenuBarItem(wxDC& dc, - const wxRect& rect, - const wxString& label, - int flags = 0, - int indexAccel = -1); - virtual void DrawMenuItem(wxDC& dc, - wxCoord y, - const wxMenuGeometryInfo& geometryInfo, - const wxString& label, - const wxString& accel, - const wxBitmap& bitmap = wxNullBitmap, - int flags = 0, - int indexAccel = -1); - virtual void DrawMenuSeparator(wxDC& dc, - wxCoord y, - const wxMenuGeometryInfo& geomInfo); -#endif // wxUSE_MENUS - - virtual void GetComboBitmaps(wxBitmap *bmpNormal, - wxBitmap *bmpFocus, - wxBitmap *bmpPressed, - wxBitmap *bmpDisabled); - - virtual void AdjustSize(wxSize *size, const wxWindow *window); - - // geometry and hit testing -#if wxUSE_SCROLLBAR - virtual wxSize GetScrollbarArrowSize() const - { return m_sizeScrollbarArrow; } -#endif // wxUSE_SCROLLBAR - - virtual wxSize GetCheckBitmapSize() const - { return wxSize(10, 10); } - virtual wxSize GetRadioBitmapSize() const - { return wxSize(11, 11); } - virtual wxCoord GetCheckItemMargin() const - { return 2; } - -#if wxUSE_TOOLBAR - virtual wxSize GetToolBarButtonSize(wxCoord *separator) const - { if ( separator ) *separator = 5; return wxSize(16, 15); } - virtual wxSize GetToolBarMargin() const - { return wxSize(6, 6); } -#endif // wxUSE_TOOLBAR - -#if wxUSE_TEXTCTRL - virtual wxRect GetTextClientArea(const wxTextCtrl *text, - const wxRect& rect, - wxCoord *extraSpaceBeyond) const; -#endif // wxUSE_TEXTCTRL - -#if wxUSE_NOTEBOOK - virtual wxSize GetTabIndent() const { return wxSize(2, 2); } - virtual wxSize GetTabPadding() const { return wxSize(6, 6); } -#endif // wxUSE_NOTEBOOK - -#if wxUSE_SLIDER - virtual wxCoord GetSliderDim() const { return 15; } - virtual wxCoord GetSliderTickLen() const { return 0; } - virtual wxRect GetSliderShaftRect(const wxRect& rect, - int lenThumb, - wxOrientation orient, - long style = 0) const; - virtual wxSize GetSliderThumbSize(const wxRect& rect, - int lenThumb, - wxOrientation orient) const; -#endif // wxUSE_SLIDER - - virtual wxSize GetProgressBarStep() const { return wxSize(16, 32); } - -#if wxUSE_MENUS - virtual wxSize GetMenuBarItemSize(const wxSize& sizeText) const; - virtual wxMenuGeometryInfo *GetMenuGeometry(wxWindow *win, - const wxMenu& menu) const; -#endif // wxUSE_MENUS - - // helpers for "wxBitmap wxColourScheme::Get()" - void DrawCheckBitmap(wxDC& dc, const wxRect& rect); - void DrawUncheckBitmap(wxDC& dc, const wxRect& rect, bool isPressed); - void DrawUndeterminedBitmap(wxDC& dc, const wxRect& rect, bool isPressed); - -protected: - // overridden wxStdRenderer methods - virtual void DrawSunkenBorder(wxDC& dc, wxRect *rect); - - virtual void DrawFrameWithLabel(wxDC& dc, - const wxString& label, - const wxRect& rectFrame, - const wxRect& rectText, - int flags, - int alignment, - int indexAccel); - - virtual void DrawCheckItemBitmap(wxDC& dc, - const wxBitmap& bitmap, - const wxRect& rect, - int flags); - - // get the colour to use for background - wxColour GetBackgroundColour(int flags) const - { - if ( flags & wxCONTROL_PRESSED ) - return wxSCHEME_COLOUR(m_scheme, CONTROL_PRESSED); - else if ( flags & wxCONTROL_CURRENT ) - return wxSCHEME_COLOUR(m_scheme, CONTROL_CURRENT); - else - return wxSCHEME_COLOUR(m_scheme, CONTROL); - } - - // as DrawShadedRect() but the pixels in the bottom left and upper right - // border are drawn with the pen1, not pen2 - void DrawAntiShadedRect(wxDC& dc, wxRect *rect, - const wxPen& pen1, const wxPen& pen2); - - // used for drawing opened rectangles - draws only one side of it at once - // (and doesn't adjust the rect) - void DrawAntiShadedRectSide(wxDC& dc, - const wxRect& rect, - const wxPen& pen1, - const wxPen& pen2, - wxDirection dir); - - // draw an opened rect for the arrow in given direction - void DrawArrowBorder(wxDC& dc, - wxRect *rect, - wxDirection dir); - - // draw two sides of the rectangle - void DrawThumbBorder(wxDC& dc, - wxRect *rect, - wxOrientation orient); - - // just as DrawRaisedBorder() except that the bottom left and up right - // pixels of the interior rect are drawn in another colour (i.e. the inner - // rect is drawn with DrawAntiShadedRect() and not DrawShadedRect()) - void DrawAntiRaisedBorder(wxDC& dc, wxRect *rect); - - // draw inner GTK shadow - void DrawInnerShadedRect(wxDC& dc, wxRect *rect); - - // get the line wrap indicator bitmap - wxBitmap GetLineWrapBitmap() const; - - virtual wxBitmap GetCheckBitmap(int flags); - virtual wxBitmap GetRadioBitmap(int flags); - - // draw a /\ or \/ line from (x1, y1) to (x2, y1) passing by the point - // ((x1 + x2)/2, y2) - void DrawUpZag(wxDC& dc, - wxCoord x1, wxCoord x2, - wxCoord y1, wxCoord y2); - void DrawDownZag(wxDC& dc, - wxCoord x1, wxCoord x2, - wxCoord y1, wxCoord y2); - - // draw the radio button bitmap for the given state - void DrawRadioBitmap(wxDC& dc, const wxRect& rect, int flags); - - // common part of DrawMenuItem() and DrawMenuBarItem() - void DoDrawMenuItem(wxDC& dc, - const wxRect& rect, - const wxString& label, - int flags, - int indexAccel, - const wxString& accel = wxEmptyString, - const wxBitmap& bitmap = wxNullBitmap, - const wxGTKMenuGeometryInfo *geometryInfo = NULL); - - // initialize the combo bitmaps - void InitComboBitmaps(); - - virtual wxBitmap GetFrameButtonBitmap(FrameButtonType WXUNUSED(type)) - { - return wxNullBitmap; - } - -private: - // data - wxSize m_sizeScrollbarArrow; - - // GDI objects - wxPen m_penGrey; - - // the checkbox and radio button bitmaps: first row is for the normal, - // second for the pressed state and the columns are for checked, unchecked - // and undeterminated respectively - wxBitmap m_bitmapsCheckbox[IndicatorState_MaxCtrl][IndicatorStatus_Max], - m_bitmapsRadiobtn[IndicatorState_MaxCtrl][IndicatorStatus_Max]; - - // the line wrap bitmap (drawn at the end of wrapped lines) - wxBitmap m_bmpLineWrap; - - // the combobox bitmaps - enum - { - ComboState_Normal, - ComboState_Focus, - ComboState_Pressed, - ComboState_Disabled, - ComboState_Max - }; - - wxBitmap m_bitmapsCombo[ComboState_Max]; -}; - -// ---------------------------------------------------------------------------- -// wxGTKInputHandler and derived classes: process the keyboard and mouse -// messages according to GTK standards -// ---------------------------------------------------------------------------- - -class wxGTKInputHandler : public wxInputHandler -{ -public: - wxGTKInputHandler() { } - - virtual bool HandleKey(wxInputConsumer *control, - const wxKeyEvent& event, - bool pressed); - virtual bool HandleMouse(wxInputConsumer *control, - const wxMouseEvent& event); - virtual bool HandleMouseMove(wxInputConsumer *control, - const wxMouseEvent& event); -}; - -#if wxUSE_SCROLLBAR - -class wxGTKScrollBarInputHandler : public wxStdScrollBarInputHandler -{ -public: - wxGTKScrollBarInputHandler(wxRenderer *renderer, wxInputHandler *handler) - : wxStdScrollBarInputHandler(renderer, handler) { } - -protected: - virtual void Highlight(wxScrollBar *scrollbar, bool doIt) - { - // only arrows and the thumb can be highlighted - if ( !IsArrow() && m_htLast != wxHT_SCROLLBAR_THUMB ) - return; - - wxStdScrollBarInputHandler::Highlight(scrollbar, doIt); - } - - virtual void Press(wxScrollBar *scrollbar, bool doIt) - { - // only arrows can be pressed - if ( !IsArrow() ) - return; - - wxStdScrollBarInputHandler::Press(scrollbar, doIt); - } - - // any button can be used to drag the scrollbar under GTK+ - virtual bool IsAllowedButton(int WXUNUSED(button)) const { return true; } - - bool IsArrow() const - { - return m_htLast == wxHT_SCROLLBAR_ARROW_LINE_1 || - m_htLast == wxHT_SCROLLBAR_ARROW_LINE_2; - } -}; - -#endif // wxUSE_SCROLLBAR - -#if wxUSE_CHECKBOX - -class wxGTKCheckboxInputHandler : public wxStdInputHandler -{ -public: - wxGTKCheckboxInputHandler(wxInputHandler *handler) - : wxStdInputHandler(handler) { } - - virtual bool HandleKey(wxInputConsumer *control, - const wxKeyEvent& event, - bool pressed); -}; - -#endif // wxUSE_CHECKBOX - -#if wxUSE_TEXTCTRL - -class wxGTKTextCtrlInputHandler : public wxStdInputHandler -{ -public: - wxGTKTextCtrlInputHandler(wxInputHandler *handler) - : wxStdInputHandler(handler) { } - - virtual bool HandleKey(wxInputConsumer *control, - const wxKeyEvent& event, - bool pressed); -}; - -#endif // wxUSE_TEXTCTRL - -// ---------------------------------------------------------------------------- -// wxGTKColourScheme: uses the standard GTK colours -// ---------------------------------------------------------------------------- - -class wxGTKColourScheme : public wxColourScheme -{ -public: - virtual wxColour Get(StdColour col) const; - virtual wxColour GetBackground(wxWindow *win) const; -}; - -// ---------------------------------------------------------------------------- -// wxGTKArtProvider -// ---------------------------------------------------------------------------- - -class wxGTKArtProvider : public wxArtProvider -{ -protected: - virtual wxBitmap CreateBitmap(const wxArtID& id, - const wxArtClient& client, - const wxSize& size); -}; - -// ---------------------------------------------------------------------------- -// wxGTKTheme -// ---------------------------------------------------------------------------- - -WX_DEFINE_ARRAY_PTR(wxInputHandler *, wxArrayHandlers); - -class wxGTKTheme : public wxTheme -{ -public: - wxGTKTheme(); - virtual ~wxGTKTheme(); - - virtual wxRenderer *GetRenderer(); - virtual wxArtProvider *GetArtProvider(); - virtual wxInputHandler *GetInputHandler(const wxString& control, - wxInputConsumer *consumer); - virtual wxColourScheme *GetColourScheme(); - -private: - wxGTKRenderer *m_renderer; - - wxGTKArtProvider *m_artProvider; - - // the names of the already created handlers and the handlers themselves - // (these arrays are synchronized) - wxSortedArrayString m_handlerNames; - wxArrayHandlers m_handlers; - - wxGTKColourScheme *m_scheme; - - WX_DECLARE_THEME(gtk) -}; - -// ============================================================================ -// implementation -// ============================================================================ - -WX_IMPLEMENT_THEME(wxGTKTheme, gtk, wxTRANSLATE("GTK+ theme")); - -// ---------------------------------------------------------------------------- -// wxGTKTheme -// ---------------------------------------------------------------------------- - -wxGTKTheme::wxGTKTheme() -{ - m_scheme = NULL; - m_renderer = NULL; - m_artProvider = NULL; -} - -wxGTKTheme::~wxGTKTheme() -{ - delete m_renderer; - delete m_scheme; - delete m_artProvider; -} - -wxRenderer *wxGTKTheme::GetRenderer() -{ - if ( !m_renderer ) - { - m_renderer = new wxGTKRenderer(GetColourScheme()); - } - - return m_renderer; -} - -wxArtProvider *wxGTKTheme::GetArtProvider() -{ - if ( !m_artProvider ) - { - m_artProvider = new wxGTKArtProvider; - } - - return m_artProvider; -} - -wxColourScheme *wxGTKTheme::GetColourScheme() -{ - if ( !m_scheme ) - { - m_scheme = new wxGTKColourScheme; - } - return m_scheme; -} - -wxInputHandler *wxGTKTheme::GetInputHandler(const wxString& control, - wxInputConsumer *consumer) -{ - wxInputHandler *handler = NULL; - int n = m_handlerNames.Index(control); - if ( n == wxNOT_FOUND ) - { - static wxGTKInputHandler s_handlerDef; - - wxInputHandler * const - handlerStd = consumer->DoGetStdInputHandler(&s_handlerDef); - - // create a new handler -#if wxUSE_CHECKBOX - if ( control == wxINP_HANDLER_CHECKBOX ) - { - static wxGTKCheckboxInputHandler s_handler(handlerStd); - - handler = &s_handler; - } - else -#endif // wxUSE_CHECKBOX -#if wxUSE_SCROLLBAR - if ( control == wxINP_HANDLER_SCROLLBAR ) - { - static wxGTKScrollBarInputHandler s_handler(m_renderer, handlerStd); - - handler = &s_handler; - } - else -#endif // wxUSE_SCROLLBAR -#if wxUSE_TEXTCTRL - if ( control == wxINP_HANDLER_TEXTCTRL ) - { - static wxGTKTextCtrlInputHandler s_handler(handlerStd); - - handler = &s_handler; - } - else -#endif // wxUSE_TEXTCTRL - { - // no special handler for this control - handler = handlerStd; - } - - n = m_handlerNames.Add(control); - m_handlers.Insert(handler, n); - } - else // we already have it - { - handler = m_handlers[n]; - } - - return handler; -} - -// ============================================================================ -// wxGTKColourScheme -// ============================================================================ - -wxColour wxGTKColourScheme::GetBackground(wxWindow *win) const -{ - wxColour col; - if ( win->UseBgCol() ) - { - // use the user specified colour - col = win->GetBackgroundColour(); - } - - if ( !win->ShouldInheritColours() ) - { - // doesn't depend on the state - if ( !col.Ok() ) - { - col = Get(WINDOW); - } - } - else - { - int flags = win->GetStateFlags(); - - // the colour set by the user should be used for the normal state - // and for the states for which we don't have any specific colours - if ( !col.Ok() || (flags != 0) ) - { -#if wxUSE_SCROLLBAR - if ( wxDynamicCast(win, wxScrollBar) ) - col = Get(SCROLLBAR); - else -#endif //wxUSE_SCROLLBAR - if ( (flags & wxCONTROL_CURRENT) && win->CanBeHighlighted() ) - col = Get(CONTROL_CURRENT); - else if ( flags & wxCONTROL_PRESSED ) - col = Get(CONTROL_PRESSED); - else - col = Get(CONTROL); - } - } - - return col; -} - -wxColour wxGTKColourScheme::Get(wxGTKColourScheme::StdColour col) const -{ - switch ( col ) - { - case FRAME: - case WINDOW: return *wxWHITE; - - case SHADOW_DARK: return *wxBLACK; - case SHADOW_HIGHLIGHT: return *wxWHITE; - case SHADOW_IN: return wxColour(0xd6d6d6); - case SHADOW_OUT: return wxColour(0x969696); - - case CONTROL: return wxColour(0xd6d6d6); - case CONTROL_PRESSED: return wxColour(0xc3c3c3); - case CONTROL_CURRENT: return wxColour(0xeaeaea); - - case CONTROL_TEXT: return *wxBLACK; - case CONTROL_TEXT_DISABLED: - return wxColour(0x757575); - case CONTROL_TEXT_DISABLED_SHADOW: - return *wxWHITE; - - case SCROLLBAR: - case SCROLLBAR_PRESSED: return wxColour(0xc3c3c3); - - case HIGHLIGHT: return wxColour(0x9c0000); - case HIGHLIGHT_TEXT: return wxColour(0xffffff); - - case GAUGE: return Get(CONTROL_CURRENT); - - case TITLEBAR: return wxColour(0xaeaaae); - case TITLEBAR_ACTIVE: return wxColour(0x820300); - case TITLEBAR_TEXT: return wxColour(0xc0c0c0); - case TITLEBAR_ACTIVE_TEXT: - return *wxWHITE; - - case DESKTOP: return *wxBLACK; - - case MAX: - default: - wxFAIL_MSG(_T("invalid standard colour")); - return *wxBLACK; - } -} - -// ============================================================================ -// wxGTKRenderer -// ============================================================================ - -// ---------------------------------------------------------------------------- -// construction -// ---------------------------------------------------------------------------- - -wxGTKRenderer::wxGTKRenderer(const wxColourScheme *scheme) - : wxStdRenderer(scheme) -{ - m_sizeScrollbarArrow = wxSize(15, 14); - - m_penGrey = wxPen(wxSCHEME_COLOUR(scheme, SCROLLBAR)); -} - -// ---------------------------------------------------------------------------- -// border stuff -// ---------------------------------------------------------------------------- - -void wxGTKRenderer::DrawAntiShadedRectSide(wxDC& dc, - const wxRect& rect, - const wxPen& pen1, - const wxPen& pen2, - wxDirection dir) -{ - dc.SetPen(dir == wxLEFT || dir == wxUP ? pen1 : pen2); - - switch ( dir ) - { - case wxLEFT: - dc.DrawLine(rect.GetLeft(), rect.GetTop(), - rect.GetLeft(), rect.GetBottom() + 1); - break; - - case wxUP: - dc.DrawLine(rect.GetLeft(), rect.GetTop(), - rect.GetRight() + 1, rect.GetTop()); - break; - - case wxRIGHT: - dc.DrawLine(rect.GetRight(), rect.GetTop(), - rect.GetRight(), rect.GetBottom() + 1); - break; - - case wxDOWN: - dc.DrawLine(rect.GetLeft(), rect.GetBottom(), - rect.GetRight() + 1, rect.GetBottom()); - break; - - default: - wxFAIL_MSG(_T("unknown rectangle side")); - } -} - -void wxGTKRenderer::DrawAntiShadedRect(wxDC& dc, wxRect *rect, - const wxPen& pen1, const wxPen& pen2) -{ - // draw the rectangle - dc.SetPen(pen1); - dc.DrawLine(rect->GetLeft(), rect->GetTop(), - rect->GetLeft(), rect->GetBottom() + 1); - dc.DrawLine(rect->GetLeft() + 1, rect->GetTop(), - rect->GetRight() + 1, rect->GetTop()); - dc.SetPen(pen2); - dc.DrawLine(rect->GetRight(), rect->GetTop() + 1, - rect->GetRight(), rect->GetBottom()); - dc.DrawLine(rect->GetLeft() + 1, rect->GetBottom(), - rect->GetRight() + 1, rect->GetBottom()); - - // adjust the rect - rect->Inflate(-1); -} - -void wxGTKRenderer::DrawInnerShadedRect(wxDC& dc, wxRect *rect) -{ - DrawAntiShadedRect(dc, rect, m_penDarkGrey, m_penHighlight); - DrawAntiShadedRect(dc, rect, m_penBlack, m_penHighlight); -} - -void wxGTKRenderer::DrawAntiRaisedBorder(wxDC& dc, wxRect *rect) -{ - DrawShadedRect(dc, rect, m_penHighlight, m_penBlack); - DrawAntiShadedRect(dc, rect, m_penLightGrey, m_penDarkGrey); -} - -void wxGTKRenderer::DrawSunkenBorder(wxDC& dc, wxRect *rect) -{ - DrawAntiShadedRect(dc, rect, m_penDarkGrey, m_penHighlight); - DrawShadedRect(dc, rect, m_penBlack, m_penLightGrey); -} - -void -wxGTKRenderer::DrawFocusRect(wxDC& dc, const wxRect& rect, int WXUNUSED(flags)) -{ - dc.SetBrush(*wxTRANSPARENT_BRUSH); - wxRect rectFocus = rect; - DrawRect(dc, &rectFocus, m_penBlack); -} - -void wxGTKRenderer::DrawTextBorder(wxDC& dc, - wxBorder border, - const wxRect& rectOrig, - int flags, - wxRect *rectIn) -{ - wxRect rect = rectOrig; - - if ( border != wxBORDER_NONE ) - { - if ( flags & wxCONTROL_FOCUSED ) - { - DrawRect(dc, &rect, m_penBlack); - DrawAntiShadedRect(dc, &rect, m_penDarkGrey, m_penHighlight); - } - else // !focused - { - DrawInnerShadedRect(dc, &rect); - } - } - - if ( rectIn ) - *rectIn = rect; -} - -void wxGTKRenderer::DrawButtonLabel(wxDC& dc, - const wxString& label, - const wxBitmap& image, - const wxRect& rect, - int flags, - int alignment, - int indexAccel, - wxRect *rectBounds) -{ - // no focus rect around buttons label in GTK+ - wxStdRenderer::DrawButtonLabel(dc, label, image, rect, flags, - alignment, indexAccel, rectBounds); -} - -void wxGTKRenderer::DrawButtonBorder(wxDC& dc, - const wxRect& rectTotal, - int flags, - wxRect *rectIn) -{ - wxRect rect = rectTotal; - - if ( flags & wxCONTROL_PRESSED ) - { - // button pressed: draw a black border around it and an inward shade - DrawRect(dc, &rect, m_penBlack); - - DrawInnerShadedRect(dc, &rect); - } - else // button not pressed - { - if ( flags & wxCONTROL_ISDEFAULT ) - { - // TODO - } - - if ( flags & wxCONTROL_FOCUSED ) - { - // button is currently default: add an extra border around it - DrawRect(dc, &rect, m_penBlack); - } - - // now draw a normal button - DrawShadedRect(dc, &rect, m_penHighlight, m_penBlack); - DrawAntiShadedRect(dc, &rect, GetBackgroundColour(flags), m_penDarkGrey); - } - - if ( rectIn ) - *rectIn = rect; -} - -// ---------------------------------------------------------------------------- -// lines and frames -// ---------------------------------------------------------------------------- - -void wxGTKRenderer::DrawFrameWithLabel(wxDC& dc, - const wxString& label, - const wxRect& rectFrame, - const wxRect& rectTextOrig, - int flags, - int alignment, - int indexAccel) -{ - wxRect rectText(rectTextOrig); - rectText.Inflate(1, 0); - - wxRect rectLabel; - DrawLabel(dc, label, rectText, flags, alignment, indexAccel, &rectLabel); - rectLabel.x -= 1; - rectLabel.width += 2; - - DrawFrameWithoutLabel(dc, rectFrame, rectLabel); - - // GTK+ does it like this - dc.SetPen(m_penHighlight); - dc.DrawPoint(rectText.x, rectFrame.y); - dc.DrawPoint(rectText.x + rectLabel.width - 3, rectFrame.y); -} - -// ---------------------------------------------------------------------------- -// check/radion buttons -// ---------------------------------------------------------------------------- - -void wxGTKRenderer::DrawCheckItemBitmap(wxDC& dc, - const wxBitmap& bitmap, - const wxRect& rect, - int flags) -{ - // never draw the focus rect around the check indicators here - DrawCheckButton(dc, wxEmptyString, bitmap, rect, flags & ~wxCONTROL_FOCUSED); -} - -void wxGTKRenderer::DrawUndeterminedBitmap(wxDC& dc, - const wxRect& rectTotal, - bool isPressed) -{ - // FIXME: For sure it is not GTK look but it is better than nothing. - // Show me correct look and I will immediatelly make it better (ABX) - wxRect rect = rectTotal; - - wxColour col1, col2; - - if ( isPressed ) - { - col1 = wxSCHEME_COLOUR(m_scheme, SHADOW_DARK); - col2 = wxSCHEME_COLOUR(m_scheme, CONTROL_PRESSED); - } - else - { - col1 = wxSCHEME_COLOUR(m_scheme, SHADOW_DARK); - col2 = wxSCHEME_COLOUR(m_scheme, SHADOW_IN); - } - - dc.SetPen(*wxTRANSPARENT_PEN); - dc.SetBrush(col1); - dc.DrawRectangle(rect); - rect.Deflate(1); - dc.SetBrush(col2); - dc.DrawRectangle(rect); -} - -void wxGTKRenderer::DrawUncheckBitmap(wxDC& dc, - const wxRect& rectTotal, - bool isPressed) -{ - wxRect rect = rectTotal; - DrawAntiRaisedBorder(dc, &rect); - - wxColour col = wxSCHEME_COLOUR(m_scheme, SHADOW_IN); - dc.SetPen(wxPen(col)); - dc.DrawPoint(rect.GetRight() - 1, rect.GetBottom() - 1); - - if ( isPressed ) - col = wxSCHEME_COLOUR(m_scheme, CONTROL_PRESSED); - //else: it is SHADOW_IN, leave as is - - dc.SetPen(*wxTRANSPARENT_PEN); - dc.SetBrush(col); - dc.DrawRectangle(rect); -} - -void wxGTKRenderer::DrawCheckBitmap(wxDC& dc, const wxRect& rectTotal) -{ - wxRect rect = rectTotal; - DrawAntiShadedRect(dc, &rect, m_penDarkGrey, m_penHighlight); - DrawShadedRect(dc, &rect, m_penBlack, m_penLightGrey); - - dc.SetPen(*wxTRANSPARENT_PEN); - dc.SetBrush(wxSCHEME_COLOUR(m_scheme, CONTROL_PRESSED)); - dc.DrawRectangle(rect); -} - -void wxGTKRenderer::DrawRadioBitmap(wxDC& dc, - const wxRect& rect, - int flags) -{ - wxCoord x = rect.x, - y = rect.y, - xRight = rect.GetRight(), - yBottom = rect.GetBottom(); - - wxCoord yMid = (y + yBottom) / 2; - - // then draw the upper half - dc.SetPen(flags & wxCONTROL_CHECKED ? m_penDarkGrey : m_penHighlight); - DrawUpZag(dc, x, xRight, yMid, y); - DrawUpZag(dc, x + 1, xRight - 1, yMid, y + 1); - - bool drawIt = true; - if ( flags & wxCONTROL_CHECKED ) - dc.SetPen(m_penBlack); - else if ( flags & wxCONTROL_PRESSED ) - dc.SetPen(wxPen(wxSCHEME_COLOUR(m_scheme, CONTROL_PRESSED))); - else // unchecked and unpressed - drawIt = false; - - if ( drawIt ) - DrawUpZag(dc, x + 2, xRight - 2, yMid, y + 2); - - // and then the lower one - dc.SetPen(flags & wxCONTROL_CHECKED ? m_penHighlight : m_penBlack); - DrawDownZag(dc, x, xRight, yMid, yBottom); - if ( !(flags & wxCONTROL_CHECKED) ) - dc.SetPen(m_penDarkGrey); - DrawDownZag(dc, x + 1, xRight - 1, yMid, yBottom - 1); - - if ( !(flags & wxCONTROL_CHECKED) ) - drawIt = true; // with the same pen - else if ( flags & wxCONTROL_PRESSED ) - { - dc.SetPen(wxPen(wxSCHEME_COLOUR(m_scheme, CONTROL_PRESSED))); - drawIt = true; - } - else // checked and unpressed - drawIt = false; - - if ( drawIt ) - DrawDownZag(dc, x + 2, xRight - 2, yMid, yBottom - 2); -} - -void wxGTKRenderer::DrawUpZag(wxDC& dc, - wxCoord x1, - wxCoord x2, - wxCoord y1, - wxCoord y2) -{ - wxCoord xMid = (x1 + x2) / 2; - dc.DrawLine(x1, y1, xMid, y2); - dc.DrawLine(xMid, y2, x2 + 1, y1 + 1); -} - -void wxGTKRenderer::DrawDownZag(wxDC& dc, - wxCoord x1, - wxCoord x2, - wxCoord y1, - wxCoord y2) -{ - wxCoord xMid = (x1 + x2) / 2; - dc.DrawLine(x1 + 1, y1 + 1, xMid, y2); - dc.DrawLine(xMid, y2, x2, y1); -} - -wxBitmap wxGTKRenderer::GetCheckBitmap(int flags) -{ - if ( !m_bitmapsCheckbox[0][0].Ok() ) - { - // init the bitmaps once only - wxRect rect; - wxSize size = GetCheckBitmapSize(); - rect.width = size.x; - rect.height = size.y; - for ( int i = 0; i < 2; i++ ) - { - for ( int j = 0; j < 3; j++ ) - m_bitmapsCheckbox[i][j].Create(rect.width, rect.height); - } - - wxMemoryDC dc; - - // normal checked - dc.SelectObject(m_bitmapsCheckbox[0][0]); - DrawCheckBitmap(dc, rect); - - // normal unchecked - dc.SelectObject(m_bitmapsCheckbox[0][1]); - DrawUncheckBitmap(dc, rect, false); - - // normal undeterminated - dc.SelectObject(m_bitmapsCheckbox[0][2]); - DrawUndeterminedBitmap(dc, rect, false); - - // pressed checked - m_bitmapsCheckbox[1][0] = m_bitmapsCheckbox[0][0]; - - // pressed unchecked - dc.SelectObject(m_bitmapsCheckbox[1][1]); - DrawUncheckBitmap(dc, rect, true); - - // pressed undeterminated - dc.SelectObject(m_bitmapsCheckbox[1][2]); - DrawUndeterminedBitmap(dc, rect, true); - } - - IndicatorState state; - IndicatorStatus status; - GetIndicatorsFromFlags(flags, state, status); - - // disabled looks the same as normal - if ( state == IndicatorState_Disabled ) - state = IndicatorState_Normal; - - return m_bitmapsCheckbox[state][status]; -} - -wxBitmap wxGTKRenderer::GetRadioBitmap(int flags) -{ - IndicatorState state; - IndicatorStatus status; - GetIndicatorsFromFlags(flags, state, status); - - wxBitmap& bmp = m_bitmapsRadiobtn[state][status]; - if ( !bmp.Ok() ) - { - const wxSize size = GetRadioBitmapSize(); - - wxMemoryDC dc; - bmp.Create(size.x, size.y); - dc.SelectObject(bmp); - - DrawRadioBitmap(dc, size, flags); - } - - return bmp; -} - -wxBitmap wxGTKRenderer::GetLineWrapBitmap() const -{ - if ( !m_bmpLineWrap.Ok() ) - { - // the line wrap bitmap as used by GTK+ - #define line_wrap_width 6 - #define line_wrap_height 9 - static const char line_wrap_bits[] = - { - 0x1e, 0x3e, 0x30, 0x30, 0x39, 0x1f, 0x0f, 0x0f, 0x1f, - }; - - wxBitmap bmpLineWrap(line_wrap_bits, line_wrap_width, line_wrap_height); - if ( !bmpLineWrap.Ok() ) - { - wxFAIL_MSG( _T("Failed to create line wrap XBM") ); - } - else - { - wxConstCast(this, wxGTKRenderer)->m_bmpLineWrap = bmpLineWrap; - } - } - - return m_bmpLineWrap; -} - -#if wxUSE_TOOLBAR -void wxGTKRenderer::DrawToolBarButton(wxDC& dc, - const wxString& label, - const wxBitmap& bitmap, - const wxRect& rectOrig, - int flags, - long WXUNUSED(style), - int tbarStyle) -{ - // we don't draw the separators at all - if ( !label.empty() || bitmap.Ok() ) - { - wxRect rect = rectOrig; - rect.Deflate(BORDER_THICKNESS); - - if ( flags & wxCONTROL_PRESSED ) - { - DrawBorder(dc, wxBORDER_SUNKEN, rect, flags, &rect); - - DrawBackground(dc, wxSCHEME_COLOUR(m_scheme, CONTROL_PRESSED), rect); - } - else if ( flags & wxCONTROL_CURRENT ) - { - DrawBorder(dc, wxBORDER_RAISED, rect, flags, &rect); - - DrawBackground(dc, wxSCHEME_COLOUR(m_scheme, CONTROL_CURRENT), rect); - } - - if(tbarStyle & wxTB_TEXT) - { - if(tbarStyle & wxTB_HORIZONTAL) - { - dc.DrawLabel(label, bitmap, rect, wxALIGN_CENTRE); - } - else - { - dc.DrawLabel(label, bitmap, rect, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL); - } - } - else - { - int xpoint = (rect.GetLeft() + rect.GetRight() + 1 - bitmap.GetWidth()) / 2; - int ypoint = (rect.GetTop() + rect.GetBottom() + 1 - bitmap.GetHeight()) / 2; - dc.DrawBitmap(bitmap, xpoint, ypoint); - } - } -} -#endif // wxUSE_TOOLBAR - -// ---------------------------------------------------------------------------- -// text control -// ---------------------------------------------------------------------------- - -#if wxUSE_TEXTCTRL - -wxRect wxGTKRenderer::GetTextClientArea(const wxTextCtrl *text, - const wxRect& rect, - wxCoord *extraSpaceBeyond) const -{ - wxRect - rectText = wxStdRenderer::GetTextClientArea(text, rect, extraSpaceBeyond); - - if ( text->WrapLines() ) - { - // leave enough for the line wrap bitmap indicator - wxCoord widthMark = GetLineWrapBitmap().GetWidth() + 2; - - rectText.width -= widthMark; - - if ( extraSpaceBeyond ) - *extraSpaceBeyond = widthMark; - } - - return rectText; -} - -void wxGTKRenderer::DrawLineWrapMark(wxDC& dc, const wxRect& rect) -{ - wxBitmap bmpLineWrap = GetLineWrapBitmap(); - - // for a mono bitmap he colours it appears in depends on the current text - // colours, so set them correctly - wxColour colFgOld; - if ( bmpLineWrap.GetDepth() == 1 ) - { - colFgOld = dc.GetTextForeground(); - - // FIXME: I wonder what should we do if the background is black too? - dc.SetTextForeground(*wxBLACK); - } - - dc.DrawBitmap(bmpLineWrap, - rect.x, rect.y + (rect.height - bmpLineWrap.GetHeight())/2); - - if ( colFgOld.Ok() ) - { - // restore old colour - dc.SetTextForeground(colFgOld); - } -} - -#endif // wxUSE_TEXTCTRL - -// ---------------------------------------------------------------------------- -// notebook -// ---------------------------------------------------------------------------- - -#if wxUSE_NOTEBOOK - -void wxGTKRenderer::DrawTab(wxDC& dc, - const wxRect& rectOrig, - wxDirection dir, - const wxString& label, - const wxBitmap& bitmap, - int flags, - int indexAccel) -{ - #define SELECT_FOR_VERTICAL(X,Y) ( isVertical ? Y : X ) - #define REVERSE_FOR_VERTICAL(X,Y) \ - SELECT_FOR_VERTICAL(X,Y) \ - , \ - SELECT_FOR_VERTICAL(Y,X) - - wxRect rect = rectOrig; - - bool isVertical = ( dir == wxLEFT ) || ( dir == wxRIGHT ); - - // the current tab is drawn indented (to the top for default case) and - // bigger than the other ones - const wxSize indent = GetTabIndent(); - if ( flags & wxCONTROL_SELECTED ) - { - rect.Inflate( SELECT_FOR_VERTICAL( indent.x , 0), - SELECT_FOR_VERTICAL( 0, indent.y )); - switch ( dir ) - { - default: - wxFAIL_MSG(_T("invaild notebook tab orientation")); - // fall through - - case wxTOP: - rect.y -= indent.y; - // fall through - case wxBOTTOM: - rect.height += indent.y; - break; - - case wxLEFT: - rect.x -= indent.x; - // fall through - case wxRIGHT: - rect.width += indent.x; - break; - } - } - - // selected tab has different colour - wxColour col = flags & wxCONTROL_SELECTED - ? wxSCHEME_COLOUR(m_scheme, SHADOW_IN) - : wxSCHEME_COLOUR(m_scheme, SCROLLBAR); - DrawSolidRect(dc, col, rect); - - if ( flags & wxCONTROL_FOCUSED ) - { - // draw the focus rect - wxRect rectBorder = rect; - rectBorder.Deflate(4, 3); - if ( dir == wxBOTTOM ) - rectBorder.Offset(0, -1); - if ( dir == wxRIGHT ) - rectBorder.Offset(-1, 0); - - DrawRect(dc, &rectBorder, m_penBlack); - } - - // draw the text, image and the focus around them (if necessary) - wxRect rectLabel( REVERSE_FOR_VERTICAL(rect.x,rect.y), - REVERSE_FOR_VERTICAL(rect.width,rect.height) - ); - rectLabel.Deflate(1, 1); - if ( isVertical ) - { - // draw it horizontally into memory and rotate for screen - wxMemoryDC dcMem; - wxBitmap bitmapRotated, - bitmapMem( rectLabel.x + rectLabel.width, - rectLabel.y + rectLabel.height ); - dcMem.SelectObject(bitmapMem); - dcMem.SetBackground(dc.GetBackground()); - dcMem.SetFont(dc.GetFont()); - dcMem.SetTextForeground(dc.GetTextForeground()); - dcMem.Clear(); - bitmapRotated = -#if wxUSE_IMAGE - wxBitmap( wxImage( bitmap.ConvertToImage() ).Rotate90(dir==wxLEFT) ) -#else - bitmap -#endif // wxUSE_IMAGE - ; - dcMem.DrawLabel(label, bitmapRotated, rectLabel, wxALIGN_CENTRE, indexAccel); - dcMem.SelectObject(wxNullBitmap); - bitmapMem = bitmapMem.GetSubBitmap(rectLabel); -#if wxUSE_IMAGE - bitmapMem = wxBitmap(wxImage(bitmapMem.ConvertToImage()).Rotate90(dir==wxRIGHT)) -#endif - ; - - dc.DrawBitmap(bitmapMem, rectLabel.y, rectLabel.x, false); - } - else - { - dc.DrawLabel(label, bitmap, rectLabel, wxALIGN_CENTRE, indexAccel); - } - - // now draw the tab itself - wxCoord x = SELECT_FOR_VERTICAL(rect.x,rect.y), - y = SELECT_FOR_VERTICAL(rect.y,rect.x), - x2 = SELECT_FOR_VERTICAL(rect.GetRight(),rect.GetBottom()), - y2 = SELECT_FOR_VERTICAL(rect.GetBottom(),rect.GetRight()); - switch ( dir ) - { - default: - // default is top - case wxLEFT: - // left orientation looks like top but IsVertical makes x and y reversed - case wxTOP: - // top is not vertical so use coordinates in written order - dc.SetPen(m_penHighlight); - dc.DrawLine(REVERSE_FOR_VERTICAL(x, y2), - REVERSE_FOR_VERTICAL(x, y)); - dc.DrawLine(REVERSE_FOR_VERTICAL(x + 1, y), - REVERSE_FOR_VERTICAL(x2, y)); - - dc.SetPen(m_penBlack); - dc.DrawLine(REVERSE_FOR_VERTICAL(x2, y2), - REVERSE_FOR_VERTICAL(x2, y)); - - dc.SetPen(m_penDarkGrey); - dc.DrawLine(REVERSE_FOR_VERTICAL(x2 - 1, y2), - REVERSE_FOR_VERTICAL(x2 - 1, y + 1)); - - if ( flags & wxCONTROL_SELECTED ) - { - dc.SetPen(m_penLightGrey); - - // overwrite the part of the border below this tab - dc.DrawLine(REVERSE_FOR_VERTICAL(x + 1, y2 + 1), - REVERSE_FOR_VERTICAL(x2 - 1, y2 + 1)); - - // and the shadow of the tab to the left of us - dc.DrawLine(REVERSE_FOR_VERTICAL(x + 1, y + 2), - REVERSE_FOR_VERTICAL(x + 1, y2 + 1)); - } - break; - - case wxRIGHT: - // right orientation looks like bottom but IsVertical makes x and y reversed - case wxBOTTOM: - // bottom is not vertical so use coordinates in written order - dc.SetPen(m_penHighlight); - - // we need to continue one pixel further to overwrite the corner of - // the border for the selected tab - dc.DrawLine(REVERSE_FOR_VERTICAL(x, y - (flags & wxCONTROL_SELECTED ? 1 : 0)), - REVERSE_FOR_VERTICAL(x, y2)); - - // it doesn't work like this (TODO: implement it properly) -#if 0 - // erase the corner of the tab to the right - dc.SetPen(m_penLightGrey); - dc.DrawPoint(REVERSE_FOR_VERTICAL(x2 - 1, y - 2)); - dc.DrawPoint(REVERSE_FOR_VERTICAL(x2 - 2, y - 2)); - dc.DrawPoint(REVERSE_FOR_VERTICAL(x2 - 2, y - 1)); -#endif // 0 - - dc.SetPen(m_penBlack); - dc.DrawLine(REVERSE_FOR_VERTICAL(x + 1, y2), - REVERSE_FOR_VERTICAL(x2, y2)); - dc.DrawLine(REVERSE_FOR_VERTICAL(x2, y), - REVERSE_FOR_VERTICAL(x2, y2)); - - dc.SetPen(m_penDarkGrey); - dc.DrawLine(REVERSE_FOR_VERTICAL(x + 2, y2 - 1), - REVERSE_FOR_VERTICAL(x2 - 1, y2 - 1)); - dc.DrawLine(REVERSE_FOR_VERTICAL(x2 - 1, y), - REVERSE_FOR_VERTICAL(x2 - 1, y2)); - - if ( flags & wxCONTROL_SELECTED ) - { - dc.SetPen(m_penLightGrey); - - // overwrite the part of the (double!) border above this tab - dc.DrawLine(REVERSE_FOR_VERTICAL(x + 1, y - 1), - REVERSE_FOR_VERTICAL(x2 - 1, y - 1)); - dc.DrawLine(REVERSE_FOR_VERTICAL(x + 1, y - 2), - REVERSE_FOR_VERTICAL(x2 - 1, y - 2)); - - // and the shadow of the tab to the left of us - dc.DrawLine(REVERSE_FOR_VERTICAL(x + 1, y2 - 1), - REVERSE_FOR_VERTICAL(x + 1, y - 1)); - } - break; - } -} - -#endif // wxUSE_NOTEBOOK - -// ---------------------------------------------------------------------------- -// slider -// ---------------------------------------------------------------------------- - -#if wxUSE_SLIDER - -wxSize wxGTKRenderer::GetSliderThumbSize(const wxRect& rect, - int lenThumb, - wxOrientation orient) const -{ - static const wxCoord SLIDER_THUMB_LENGTH = 30; - - wxSize size; - - wxRect rectShaft = GetSliderShaftRect(rect, lenThumb, orient); - if ( orient == wxHORIZONTAL ) - { - size.x = wxMin(SLIDER_THUMB_LENGTH, rectShaft.width); - size.y = rectShaft.height; - } - else // vertical - { - size.y = wxMin(SLIDER_THUMB_LENGTH, rectShaft.height); - size.x = rectShaft.width; - } - - return size; -} - -wxRect wxGTKRenderer::GetSliderShaftRect(const wxRect& rect, - int WXUNUSED(lenThumb), - wxOrientation WXUNUSED(orient), - long WXUNUSED(style)) const -{ - return rect.Deflate(2*BORDER_THICKNESS, 2*BORDER_THICKNESS); -} - -void wxGTKRenderer::DrawSliderShaft(wxDC& dc, - const wxRect& rectOrig, - int WXUNUSED(lenThumb), - wxOrientation WXUNUSED(orient), - int flags, - long WXUNUSED(style), - wxRect *rectShaft) -{ - wxRect rect = rectOrig; - - // draw the border first - if ( flags & wxCONTROL_FOCUSED ) - { - DrawRect(dc, &rect, m_penBlack); - } - else // not focused, normal - { - DrawAntiShadedRect(dc, &rect, m_penDarkGrey, m_penHighlight); - } - - DrawAntiShadedRect(dc, &rect, m_penBlack, m_penLightGrey); - - // and the background - DrawSolidRect(dc, wxSCHEME_COLOUR(m_scheme, SCROLLBAR), rect); - - if ( rectShaft ) - *rectShaft = rect; -} - -void wxGTKRenderer::DrawSliderThumb(wxDC& dc, - const wxRect& rectOrig, - wxOrientation orient, - int WXUNUSED(flags), - long WXUNUSED(style)) -{ - // draw the thumb border - wxRect rect = rectOrig; - DrawAntiRaisedBorder(dc, &rect); - - // draw the handle in the middle - if ( orient == wxVERTICAL ) - { - rect.height = 2*BORDER_THICKNESS; - rect.y = rectOrig.y + (rectOrig.height - rect.height) / 2; - } - else // horz - { - rect.width = 2*BORDER_THICKNESS; - rect.x = rectOrig.x + (rectOrig.width - rect.width) / 2; - } - - DrawShadedRect(dc, &rect, m_penDarkGrey, m_penHighlight); -} - -#endif // wxUSE_SLIDER - -#if wxUSE_MENUS - -// ---------------------------------------------------------------------------- -// menu and menubar -// ---------------------------------------------------------------------------- - -// wxGTKMenuGeometryInfo: the wxMenuGeometryInfo used by wxGTKRenderer -class WXDLLEXPORT wxGTKMenuGeometryInfo : public wxMenuGeometryInfo -{ -public: - virtual wxSize GetSize() const { return m_size; } - - wxCoord GetLabelOffset() const { return m_ofsLabel; } - wxCoord GetAccelOffset() const { return m_ofsAccel; } - - wxCoord GetItemHeight() const { return m_heightItem; } - -private: - // the total size of the menu - wxSize m_size; - - // the offset of the start of the menu item label - wxCoord m_ofsLabel; - - // the offset of the start of the accel label - wxCoord m_ofsAccel; - - // the height of a normal (not separator) item - wxCoord m_heightItem; - - friend wxMenuGeometryInfo * - wxGTKRenderer::GetMenuGeometry(wxWindow *, const wxMenu&) const; -}; - -// FIXME: all constants are hardcoded but shouldn't be -static const wxCoord MENU_LEFT_MARGIN = 9; -static const wxCoord MENU_RIGHT_MARGIN = 6; - -static const wxCoord MENU_HORZ_MARGIN = 6; -static const wxCoord MENU_VERT_MARGIN = 3; - -// the margin around bitmap/check marks (on each side) -static const wxCoord MENU_BMP_MARGIN = 2; - -// the margin between the labels and accel strings -static const wxCoord MENU_ACCEL_MARGIN = 8; - -// the separator height in pixels: in fact, strangely enough, the real height -// is 2 but Windows adds one extra pixel in the bottom margin, so take it into -// account here -static const wxCoord MENU_SEPARATOR_HEIGHT = 3; - -// the size of the standard checkmark bitmap -static const wxCoord MENU_CHECK_SIZE = 9; - -void wxGTKRenderer::DrawMenuBarItem(wxDC& dc, - const wxRect& rect, - const wxString& label, - int flags, - int indexAccel) -{ - DoDrawMenuItem(dc, rect, label, flags, indexAccel); -} - -void wxGTKRenderer::DrawMenuItem(wxDC& dc, - wxCoord y, - const wxMenuGeometryInfo& gi, - const wxString& label, - const wxString& accel, - const wxBitmap& bitmap, - int flags, - int indexAccel) -{ - const wxGTKMenuGeometryInfo& geomInfo = (const wxGTKMenuGeometryInfo&)gi; - - wxRect rect; - rect.x = 0; - rect.y = y; - rect.width = geomInfo.GetSize().x; - rect.height = geomInfo.GetItemHeight(); - - DoDrawMenuItem(dc, rect, label, flags, indexAccel, accel, bitmap, &geomInfo); -} - -void wxGTKRenderer::DoDrawMenuItem(wxDC& dc, - const wxRect& rectOrig, - const wxString& label, - int flags, - int indexAccel, - const wxString& accel, - const wxBitmap& bitmap, - const wxGTKMenuGeometryInfo *geometryInfo) -{ - wxRect rect = rectOrig; - - // draw the selected item specially - if ( flags & wxCONTROL_SELECTED ) - { - wxRect rectIn; - DrawBorder(dc, wxBORDER_RAISED, rect, flags, &rectIn); - - DrawBackground(dc, wxSCHEME_COLOUR(m_scheme, CONTROL_CURRENT), rectIn); - } - - rect.Deflate(MENU_HORZ_MARGIN, MENU_VERT_MARGIN); - - // draw the bitmap: use the bitmap provided or the standard checkmark for - // the checkable items - if ( geometryInfo ) - { - wxBitmap bmp = bitmap; - if ( !bmp.Ok() && (flags & wxCONTROL_CHECKABLE) ) - { - bmp = GetCheckBitmap(flags); - } - - if ( bmp.Ok() ) - { - rect.SetRight(geometryInfo->GetLabelOffset()); - wxControlRenderer::DrawBitmap(dc, bmp, rect); - } - } - //else: menubar items don't have bitmaps - - // draw the label - if ( geometryInfo ) - { - rect.x = geometryInfo->GetLabelOffset(); - rect.SetRight(geometryInfo->GetAccelOffset()); - } - - DrawLabel(dc, label, rect, flags, wxALIGN_CENTRE_VERTICAL, indexAccel); - - // draw the accel string - if ( !accel.empty() ) - { - // menubar items shouldn't have them - wxCHECK_RET( geometryInfo, _T("accel strings only valid for menus") ); - - rect.x = geometryInfo->GetAccelOffset(); - rect.SetRight(geometryInfo->GetSize().x); - - // NB: no accel index here - DrawLabel(dc, accel, rect, flags, wxALIGN_CENTRE_VERTICAL); - } - - // draw the submenu indicator - if ( flags & wxCONTROL_ISSUBMENU ) - { - wxCHECK_RET( geometryInfo, _T("wxCONTROL_ISSUBMENU only valid for menus") ); - - rect.x = geometryInfo->GetSize().x - MENU_RIGHT_MARGIN; - rect.width = MENU_RIGHT_MARGIN; - - DrawArrow(dc, wxRIGHT, rect, flags); - } -} - -void wxGTKRenderer::DrawMenuSeparator(wxDC& dc, - wxCoord y, - const wxMenuGeometryInfo& geomInfo) -{ - DrawHorizontalLine(dc, y + MENU_VERT_MARGIN, 0, geomInfo.GetSize().x); -} - -wxSize wxGTKRenderer::GetMenuBarItemSize(const wxSize& sizeText) const -{ - wxSize size = sizeText; - - // TODO: make this configurable - size.x += 2*MENU_HORZ_MARGIN; - size.y += 2*MENU_VERT_MARGIN; - - return size; -} - -wxMenuGeometryInfo *wxGTKRenderer::GetMenuGeometry(wxWindow *win, - const wxMenu& menu) const -{ - // prepare the dc: for now we draw all the items with the system font - wxClientDC dc(win); - dc.SetFont(wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT)); - - // the height of a normal item - wxCoord heightText = dc.GetCharHeight(); - - // the total height - wxCoord height = 0; - - // the max length of label and accel strings: the menu width is the sum of - // them, even if they're for different items (as the accels should be - // aligned) - // - // the max length of the bitmap is never 0 as Windows always leaves enough - // space for a check mark indicator - wxCoord widthLabelMax = 0, - widthAccelMax = 0, - widthBmpMax = MENU_LEFT_MARGIN; - - for ( wxMenuItemList::compatibility_iterator node = menu.GetMenuItems().GetFirst(); - node; - node = node->GetNext() ) - { - // height of this item - wxCoord h; - - wxMenuItem *item = node->GetData(); - if ( item->IsSeparator() ) - { - h = MENU_SEPARATOR_HEIGHT; - } - else // not separator - { - h = heightText; - - wxCoord widthLabel; - dc.GetTextExtent(item->GetLabel(), &widthLabel, NULL); - if ( widthLabel > widthLabelMax ) - { - widthLabelMax = widthLabel; - } - - wxCoord widthAccel; - dc.GetTextExtent(item->GetAccelString(), &widthAccel, NULL); - if ( widthAccel > widthAccelMax ) - { - widthAccelMax = widthAccel; - } - - const wxBitmap& bmp = item->GetBitmap(); - if ( bmp.Ok() ) - { - wxCoord widthBmp = bmp.GetWidth(); - if ( widthBmp > widthBmpMax ) - widthBmpMax = widthBmp; - } - //else if ( item->IsCheckable() ): no need to check for this as - // MENU_LEFT_MARGIN is big enough to show the check mark - } - - h += 2*MENU_VERT_MARGIN; - - // remember the item position and height - item->SetGeometry(height, h); - - height += h; - } - - // bundle the metrics into a struct and return it - wxGTKMenuGeometryInfo *gi = new wxGTKMenuGeometryInfo; - - gi->m_ofsLabel = widthBmpMax + 2*MENU_BMP_MARGIN; - gi->m_ofsAccel = gi->m_ofsLabel + widthLabelMax; - if ( widthAccelMax > 0 ) - { - // if we actually have any accesl, add a margin - gi->m_ofsAccel += MENU_ACCEL_MARGIN; - } - - gi->m_heightItem = heightText + 2*MENU_VERT_MARGIN; - - gi->m_size.x = gi->m_ofsAccel + widthAccelMax + MENU_RIGHT_MARGIN; - gi->m_size.y = height; - - return gi; -} - -#endif // wxUSE_MENUS - -// ---------------------------------------------------------------------------- -// combobox -// ---------------------------------------------------------------------------- - -void wxGTKRenderer::InitComboBitmaps() -{ - wxSize sizeArrow = m_sizeScrollbarArrow; - sizeArrow.x -= 2; - sizeArrow.y -= 2; - - size_t n; - - for ( n = ComboState_Normal; n < ComboState_Max; n++ ) - { - m_bitmapsCombo[n].Create(sizeArrow.x, sizeArrow.y); - } - - static const int comboButtonFlags[ComboState_Max] = - { - 0, - wxCONTROL_CURRENT, - wxCONTROL_PRESSED, - wxCONTROL_DISABLED, - }; - - wxRect rect(sizeArrow); - - wxMemoryDC dc; - for ( n = ComboState_Normal; n < ComboState_Max; n++ ) - { - int flags = comboButtonFlags[n]; - - dc.SelectObject(m_bitmapsCombo[n]); - DrawSolidRect(dc, GetBackgroundColour(flags), rect); - DrawArrow(dc, wxDOWN, rect, flags); - } -} - -void wxGTKRenderer::GetComboBitmaps(wxBitmap *bmpNormal, - wxBitmap *bmpFocus, - wxBitmap *bmpPressed, - wxBitmap *bmpDisabled) -{ - if ( !m_bitmapsCombo[ComboState_Normal].Ok() ) - { - InitComboBitmaps(); - } - - if ( bmpNormal ) - *bmpNormal = m_bitmapsCombo[ComboState_Normal]; - if ( bmpFocus ) - *bmpFocus = m_bitmapsCombo[ComboState_Focus]; - if ( bmpPressed ) - *bmpPressed = m_bitmapsCombo[ComboState_Pressed]; - if ( bmpDisabled ) - *bmpDisabled = m_bitmapsCombo[ComboState_Disabled]; -} - -// ---------------------------------------------------------------------------- -// scrollbar -// ---------------------------------------------------------------------------- - -void wxGTKRenderer::DrawArrowBorder(wxDC& dc, - wxRect *rect, - wxDirection dir) -{ - static const wxDirection sides[] = - { - wxUP, wxLEFT, wxRIGHT, wxDOWN - }; - - wxRect rect1, rect2, rectInner; - rect1 = - rect2 = - rectInner = *rect; - - rect2.Inflate(-1); - rectInner.Inflate(-2); - - DrawSolidRect(dc, wxSCHEME_COLOUR(m_scheme, SCROLLBAR), *rect); - - // find the side not to draw and also adjust the rectangles to compensate - // for it - wxDirection sideToOmit; - switch ( dir ) - { - case wxUP: - sideToOmit = wxDOWN; - rect2.height += 1; - rectInner.height += 1; - break; - - case wxDOWN: - sideToOmit = wxUP; - rect2.y -= 1; - rect2.height += 1; - rectInner.y -= 2; - rectInner.height += 1; - break; - - case wxLEFT: - sideToOmit = wxRIGHT; - rect2.width += 1; - rectInner.width += 1; - break; - - case wxRIGHT: - sideToOmit = wxLEFT; - rect2.x -= 1; - rect2.width += 1; - rectInner.x -= 2; - rectInner.width += 1; - break; - - default: - wxFAIL_MSG(_T("unknown arrow direction")); - return; - } - - // the outer rect first - size_t n; - for ( n = 0; n < WXSIZEOF(sides); n++ ) - { - wxDirection side = sides[n]; - if ( side == sideToOmit ) - continue; - - DrawAntiShadedRectSide(dc, rect1, m_penDarkGrey, m_penHighlight, side); - } - - // and then the inner one - for ( n = 0; n < WXSIZEOF(sides); n++ ) - { - wxDirection side = sides[n]; - if ( side == sideToOmit ) - continue; - - DrawAntiShadedRectSide(dc, rect2, m_penBlack, m_penGrey, side); - } - - *rect = rectInner; -} - -void wxGTKRenderer::DrawScrollbarArrow(wxDC& dc, - wxDirection dir, - const wxRect& rectArrow, - int flags) -{ - // first of all, draw the border around it - but we don't want the border - // on the side opposite to the arrow point - wxRect rect = rectArrow; - DrawArrowBorder(dc, &rect, dir); - - // then the arrow itself - DrawArrow(dc, dir, rect, flags); -} - -// gtk_default_draw_arrow() takes ~350 lines and we can't do much better here -// these people are just crazy :-( -void wxGTKRenderer::DrawArrow(wxDC& dc, - wxDirection dir, - const wxRect& rect, - int flags) -{ - enum - { - Point_First, - Point_Second, - Point_Third, - Point_Max - }; - - wxPoint ptArrow[Point_Max]; - - wxColour colInside = GetBackgroundColour(flags); - wxPen penShadow[4]; - if ( flags & wxCONTROL_DISABLED ) - { - penShadow[0] = m_penDarkGrey; - penShadow[1] = m_penDarkGrey; - penShadow[2] = wxNullPen; - penShadow[3] = wxNullPen; - } - else if ( flags & wxCONTROL_PRESSED ) - { - penShadow[0] = m_penDarkGrey; - penShadow[1] = m_penHighlight; - penShadow[2] = wxNullPen; - penShadow[3] = m_penBlack; - } - else // normal arrow - { - penShadow[0] = m_penHighlight; - penShadow[1] = m_penBlack; - penShadow[2] = m_penDarkGrey; - penShadow[3] = wxNullPen; - } - - wxCoord middle; - if ( dir == wxUP || dir == wxDOWN ) - { - // horz middle - middle = (rect.GetRight() + rect.GetLeft() + 1) / 2; - } - else // horz arrow - { - middle = (rect.GetTop() + rect.GetBottom() + 1) / 2; - } - - // draw the arrow interior - dc.SetPen(*wxTRANSPARENT_PEN); - dc.SetBrush(colInside); - - switch ( dir ) - { - case wxUP: - ptArrow[Point_First].x = rect.GetLeft(); - ptArrow[Point_First].y = rect.GetBottom(); - ptArrow[Point_Second].x = middle; - ptArrow[Point_Second].y = rect.GetTop(); - ptArrow[Point_Third].x = rect.GetRight(); - ptArrow[Point_Third].y = rect.GetBottom(); - break; - - case wxDOWN: - ptArrow[Point_First] = rect.GetPosition(); - ptArrow[Point_Second].x = middle; - ptArrow[Point_Second].y = rect.GetBottom(); - ptArrow[Point_Third].x = rect.GetRight(); - ptArrow[Point_Third].y = rect.GetTop(); - break; - - case wxLEFT: - ptArrow[Point_First].x = rect.GetRight(); - ptArrow[Point_First].y = rect.GetTop(); - ptArrow[Point_Second].x = rect.GetLeft(); - ptArrow[Point_Second].y = middle; - ptArrow[Point_Third].x = rect.GetRight(); - ptArrow[Point_Third].y = rect.GetBottom(); - break; - - case wxRIGHT: - ptArrow[Point_First] = rect.GetPosition(); - ptArrow[Point_Second].x = rect.GetRight(); - ptArrow[Point_Second].y = middle; - ptArrow[Point_Third].x = rect.GetLeft(); - ptArrow[Point_Third].y = rect.GetBottom(); - break; - - default: - wxFAIL_MSG(_T("unknown arrow direction")); - } - - dc.DrawPolygon(WXSIZEOF(ptArrow), ptArrow); - - // draw the arrow border - dc.SetPen(penShadow[0]); - switch ( dir ) - { - case wxUP: - dc.DrawLine(ptArrow[Point_Second], ptArrow[Point_First]); - dc.DrawPoint(ptArrow[Point_First]); - if ( penShadow[3].Ok() ) - { - dc.SetPen(penShadow[3]); - dc.DrawLine(ptArrow[Point_First].x + 1, ptArrow[Point_First].y, - ptArrow[Point_Second].x, ptArrow[Point_Second].y); - } - dc.SetPen(penShadow[1]); - dc.DrawLine(ptArrow[Point_Second].x + 1, ptArrow[Point_Second].y + 1, - ptArrow[Point_Third].x, ptArrow[Point_Third].y); - dc.DrawPoint(ptArrow[Point_Third]); - dc.DrawLine(ptArrow[Point_Third].x - 2, ptArrow[Point_Third].y, - ptArrow[Point_First].x + 1, ptArrow[Point_First].y); - if ( penShadow[2].Ok() ) - { - dc.SetPen(penShadow[2]); - dc.DrawLine(ptArrow[Point_Third].x - 1, ptArrow[Point_Third].y, - ptArrow[Point_Second].x, ptArrow[Point_Second].y + 1); - dc.DrawLine(ptArrow[Point_Third].x - 1, ptArrow[Point_Third].y - 1, - ptArrow[Point_First].x + 2, ptArrow[Point_First].y - 1); - } - break; - - case wxDOWN: - dc.DrawLine(ptArrow[Point_First], ptArrow[Point_Second]); - dc.DrawLine(ptArrow[Point_First].x + 2, ptArrow[Point_First].y, - ptArrow[Point_Third].x - 1, ptArrow[Point_Third].y); - if ( penShadow[2].Ok() ) - { - dc.SetPen(penShadow[2]); - dc.DrawLine(ptArrow[Point_Second].x, ptArrow[Point_Second].y - 1, - ptArrow[Point_Third].x - 1, ptArrow[Point_Third].y - 1); - } - dc.SetPen(penShadow[1]); - dc.DrawLine(ptArrow[Point_Second], ptArrow[Point_Third]); - dc.DrawPoint(ptArrow[Point_Third]); - break; - - case wxLEFT: - dc.DrawLine(ptArrow[Point_Second], ptArrow[Point_First]); - dc.DrawPoint(ptArrow[Point_First]); - if ( penShadow[2].Ok() ) - { - dc.SetPen(penShadow[2]); - dc.DrawLine(ptArrow[Point_Third].x - 1, ptArrow[Point_Third].y, - ptArrow[Point_First].x - 1, ptArrow[Point_First].y + 2); - dc.DrawLine(ptArrow[Point_Third].x, ptArrow[Point_Third].y, - ptArrow[Point_Second].x + 2, ptArrow[Point_Second].y + 1); - } - dc.SetPen(penShadow[1]); - dc.DrawLine(ptArrow[Point_Third].x, ptArrow[Point_Third].y, - ptArrow[Point_First].x, ptArrow[Point_First].y + 1); - dc.DrawLine(ptArrow[Point_Second].x + 1, ptArrow[Point_Second].y + 1, - ptArrow[Point_Third].x - 1, ptArrow[Point_Third].y); - break; - - case wxRIGHT: - dc.DrawLine(ptArrow[Point_First], ptArrow[Point_Third]); - dc.DrawLine(ptArrow[Point_First].x + 2, ptArrow[Point_First].y + 1, - ptArrow[Point_Second].x, ptArrow[Point_Second].y); - dc.SetPen(penShadow[1]); - dc.DrawLine(ptArrow[Point_Second], ptArrow[Point_Third]); - dc.DrawPoint(ptArrow[Point_Third]); - break; - - default: - wxFAIL_MSG(_T("unknown arrow direction")); - return; - } -} - -void wxGTKRenderer::DrawThumbBorder(wxDC& dc, - wxRect *rect, - wxOrientation orient) -{ - if ( orient == wxVERTICAL ) - { - DrawAntiShadedRectSide(dc, *rect, m_penDarkGrey, m_penHighlight, - wxLEFT); - DrawAntiShadedRectSide(dc, *rect, m_penDarkGrey, m_penHighlight, - wxRIGHT); - rect->Inflate(-1, 0); - - DrawAntiShadedRectSide(dc, *rect, m_penBlack, m_penGrey, - wxLEFT); - DrawAntiShadedRectSide(dc, *rect, m_penBlack, m_penGrey, - wxRIGHT); - rect->Inflate(-1, 0); - } - else - { - DrawAntiShadedRectSide(dc, *rect, m_penDarkGrey, m_penHighlight, - wxUP); - DrawAntiShadedRectSide(dc, *rect, m_penDarkGrey, m_penHighlight, - wxDOWN); - rect->Inflate(0, -1); - - DrawAntiShadedRectSide(dc, *rect, m_penBlack, m_penGrey, - wxUP); - DrawAntiShadedRectSide(dc, *rect, m_penBlack, m_penGrey, - wxDOWN); - rect->Inflate(0, -1); - } -} - -void wxGTKRenderer::DrawScrollbarThumb(wxDC& dc, - wxOrientation orient, - const wxRect& rect, - int flags) -{ - // the thumb is never pressed never has focus border under GTK and the - // scrollbar background never changes at all - int flagsThumb = flags & ~(wxCONTROL_PRESSED | wxCONTROL_FOCUSED); - - // we don't want the border in the direction of the scrollbar movement - wxRect rectThumb = rect; - DrawThumbBorder(dc, &rectThumb, orient); - - DrawButtonBorder(dc, rectThumb, flagsThumb, &rectThumb); - DrawBackground(dc, wxNullColour, rectThumb, flagsThumb); -} - -void wxGTKRenderer::DrawScrollbarShaft(wxDC& dc, - wxOrientation orient, - const wxRect& rect, - int WXUNUSED(flags)) -{ - wxRect rectBar = rect; - DrawThumbBorder(dc, &rectBar, orient); - DrawSolidRect(dc, wxSCHEME_COLOUR(m_scheme, SCROLLBAR), rectBar); -} - -// ---------------------------------------------------------------------------- -// size adjustments -// ---------------------------------------------------------------------------- - -void wxGTKRenderer::AdjustSize(wxSize *size, const wxWindow *window) -{ -#if wxUSE_BMPBUTTON - if ( wxDynamicCast(window, wxBitmapButton) ) - { - size->x += 4; - size->y += 4; - } else -#endif // wxUSE_BMPBUTTON -#if wxUSE_BUTTON || wxUSE_TOGGLEBTN - if ( 0 -# if wxUSE_BUTTON - || wxDynamicCast(window, wxButton) -# endif // wxUSE_BUTTON -# if wxUSE_TOGGLEBTN - || wxDynamicCast(window, wxToggleButton) -# endif // wxUSE_TOGGLEBTN - ) - { - if ( !(window->GetWindowStyle() & wxBU_EXACTFIT) ) - { - // TODO: this is ad hoc... - size->x += 3*window->GetCharWidth(); - wxCoord minBtnHeight = 18; - if ( size->y < minBtnHeight ) - size->y = minBtnHeight; - - // button border width - size->y += 4; - } - } else -#endif // wxUSE_BUTTON || wxUSE_TOGGLEBTN -#if wxUSE_SCROLLBAR - if ( wxDynamicCast(window, wxScrollBar) ) - { - // we only set the width of vert scrollbars and height of the - // horizontal ones - if ( window->GetWindowStyle() & wxSB_HORIZONTAL ) - size->y = m_sizeScrollbarArrow.x; - else - size->x = m_sizeScrollbarArrow.x; - } - else -#endif // wxUSE_SCROLLBAR - { - // take into account the border width - wxStdRenderer::AdjustSize(size, window); - } -} - -// ---------------------------------------------------------------------------- -// standard icons -// ---------------------------------------------------------------------------- - -/* Copyright (c) Julian Smart */ -static const char *error_xpm[] = { -/* columns rows colors chars-per-pixel */ -"48 48 4 1", -" c None", -"X c #242424", -"o c #DCDF00", -". c #C00000", -/* pixels */ -" ", -" ", -" ", -" ", -" ", -" ..... ", -" ............. ", -" ................. ", -" ................... ", -" ....................... ", -" ......................... ", -" ........................... ", -" ...........................X ", -" .............................X ", -" ............................... ", -" ...............................X ", -" .................................X ", -" .................................X ", -" .................................XX ", -" ...ooooooooooooooooooooooooooo...XX ", -" ....ooooooooooooooooooooooooooo....X ", -" ....ooooooooooooooooooooooooooo....X ", -" ....ooooooooooooooooooooooooooo....XX ", -" ....ooooooooooooooooooooooooooo....XX ", -" ....ooooooooooooooooooooooooooo....XX ", -" ...ooooooooooooooooooooooooooo...XXX ", -" ...ooooooooooooooooooooooooooo...XXX ", -" .................................XX ", -" .................................XX ", -" ...............................XXX ", -" ...............................XXX ", -" .............................XXX ", -" ...........................XXXX ", -" ...........................XXX ", -" .........................XXX ", -" .......................XXXX ", -" X...................XXXXX ", -" X.................XXXXX ", -" X.............XXXXX ", -" XXXX.....XXXXXXXX ", -" XXXXXXXXXXXXX ", -" XXXXX ", -" ", -" ", -" ", -" ", -" ", -" " -}; - -/* Copyright (c) Julian Smart */ -static const char *info_xpm[] = { -/* columns rows colors chars-per-pixel */ -"48 48 9 1", -"$ c Black", -"O c #FFFFFF", -"@ c #808080", -"+ c #000080", -"o c #E8EB01", -" c None", -"X c #FFFF40", -"# c #C0C0C0", -". c #ABAD01", -/* pixels */ -" ", -" ", -" ", -" ", -" ", -" ", -" ", -" ", -" ", -" ..... ", -" ..XXXXX.. ", -" ..XXXXXXXXo.. ", -" .XXXOXXXXXXXoo. ", -" .XOOXXX+XXXXXo. ", -" .XOOOXX+++XXXXoo. ", -" .XOOXXX+++XXXXXo. ", -" .XOOOXXX+++XXXXXXo. ", -" .XOOXXXX+++XXXXXXo. ", -" .XXXXXXX+++XXXXXXX. ", -" .XXXXXXX+++XXXXXXo. ", -" .XXXXXXX+++XXXXXoo. ", -" .XXXXXX+++XXXXXo. ", -" .XXXXXXX+XXXXXXo. ", -" .XXXXXXXXXXXXo. ", -" .XXXXX+++XXXoo. ", -" .XXXX+++XXoo. ", -" .XXXXXXXXo. ", -" ..XXXXXXo.. ", -" .XXXXXo.. ", -" @#######@ ", -" @@@@@@@@@ ", -" @#######@ ", -" @@@@@@@@@ ", -" @#######@ ", -" @@@@@@@ ", -" ### ", -" $$$ ", -" ", -" ", -" ", -" ", -" ", -" ", -" ", -" ", -" ", -" ", -" " -}; - -/* Copyright (c) Julian Smart */ -static const char *warning_xpm[] = { -/* columns rows colors chars-per-pixel */ -"48 48 9 1", -"@ c Black", -"o c #A6A800", -"+ c #8A8C00", -"$ c #B8BA00", -" c None", -"O c #6E7000", -"X c #DCDF00", -". c #C00000", -"# c #373800", -/* pixels */ -" ", -" ", -" ", -" ", -" ", -" ", -" ", -" . ", -" ... ", -" ... ", -" ..... ", -" ...X.. ", -" ..XXX.. ", -" ...XXX... ", -" ..XXXXX.. ", -" ..XXXXXX... ", -" ...XXoO+XX.. ", -" ..XXXO@#XXX.. ", -" ..XXXXO@#XXX... ", -" ...XXXXO@#XXXX.. ", -" ..XXXXXO@#XXXX... ", -" ...XXXXXo@OXXXXX.. ", -" ...XXXXXXo@OXXXXXX.. ", -" ..XXXXXXX$@OXXXXXX... ", -" ...XXXXXXXX@XXXXXXXX.. ", -" ...XXXXXXXXXXXXXXXXXX... ", -" ..XXXXXXXXXXOXXXXXXXXX.. ", -" ...XXXXXXXXXO@#XXXXXXXXX.. ", -" ..XXXXXXXXXXX#XXXXXXXXXX... ", -" ...XXXXXXXXXXXXXXXXXXXXXXX.. ", -" ...XXXXXXXXXXXXXXXXXXXXXXXX... ", -" .............................. ", -" .............................. ", -" ", -" ", -" ", -" ", -" ", -" ", -" ", -" ", -" ", -" ", -" ", -" ", -" ", -" ", -" " -}; - -/* Copyright (c) Julian Smart */ -static const char *question_xpm[] = { -/* columns rows colors chars-per-pixel */ -"48 48 21 1", -". c Black", -"> c #696969", -"O c #1F1F00", -"+ c #181818", -"o c #F6F900", -"; c #3F3F00", -"$ c #111111", -" c None", -"& c #202020", -"X c #AAAA00", -"@ c #949400", -": c #303030", -"1 c #383838", -"% c #2A2A00", -", c #404040", -"= c #B4B400", -"- c #484848", -"# c #151500", -"< c #9F9F00", -"2 c #6A6A00", -"* c #353500", -/* pixels */ -" ", -" ", -" ", -" ", -" ......... ", -" ...XXXXXXX.. ", -" ..XXXXoooooXXXO+ ", -" ..XXooooooooooooX@.. ", -" ..XoooooooooooooooXX#. ", -" $%XoooooooooooooooooXX#. ", -" &.XoooooooXXXXXXooooooXX.. ", -" .XooooooXX.$...$XXoooooX*. ", -" $.XoooooX%.$ .*oooooo=.. ", -" .XooooooX.. -.XoooooX.. ", -" .XoooooX..+ .XoooooX;. ", -" ...XXXX..: .XoooooX;. ", -" ........ >.XoooooX;. ", -" +.XoooooX.. ", -" ,.Xoooooo<.. ", -" 1#XooooooXO.. ", -" &#XooooooX2.. ", -" $%XooooooXX.. ", -" $%XooooooXX.. ", -" $%XooooooXX.. ", -" &.XooooooXX.. ", -" .XooooooXX.. ", -" &.XoooooXX.. ", -" ..XooooXX.. ", -" ..XooooX... ", -" ..XXooXX..& ", -" ...XXXXX.. ", -" ........ ", -" ", -" ", -" ....... ", -" ..XXXXX.. ", -" ..XXoooXX.. ", -" ..XoooooX.. ", -" ..XoooooX.. ", -" ..XXoooXX.. ", -" ..XXXXX.. ", -" ....... ", -" ", -" ", -" ", -" ", -" ", -" " -}; - -wxBitmap wxGTKArtProvider::CreateBitmap(const wxArtID& id, - const wxArtClient& WXUNUSED(client), - const wxSize& WXUNUSED(size)) -{ - if ( id == wxART_INFORMATION ) - return wxBitmap(info_xpm); - if ( id == wxART_ERROR ) - return wxBitmap(error_xpm); - if ( id == wxART_WARNING ) - return wxBitmap(warning_xpm); - if ( id == wxART_QUESTION ) - return wxBitmap(question_xpm); - return wxNullBitmap; -} - - -// ============================================================================ -// wxInputHandler -// ============================================================================ - -// ---------------------------------------------------------------------------- -// wxGTKInputHandler -// ---------------------------------------------------------------------------- - -bool wxGTKInputHandler::HandleKey(wxInputConsumer * WXUNUSED(control), - const wxKeyEvent& WXUNUSED(event), - bool WXUNUSED(pressed)) -{ - return false; -} - -bool wxGTKInputHandler::HandleMouse(wxInputConsumer *control, - const wxMouseEvent& event) -{ - // clicking on the control gives it focus - if ( event.ButtonDown() && wxWindow::FindFocus() != control->GetInputWindow() ) - { - control->GetInputWindow()->SetFocus(); - - return true; - } - - return false; -} - -bool wxGTKInputHandler::HandleMouseMove(wxInputConsumer *control, - const wxMouseEvent& event) -{ - if ( event.Entering() ) - { - control->GetInputWindow()->SetCurrent(true); - } - else if ( event.Leaving() ) - { - control->GetInputWindow()->SetCurrent(false); - } - else - { - return false; - } - - return true; -} - -#if wxUSE_CHECKBOX - -// ---------------------------------------------------------------------------- -// wxGTKCheckboxInputHandler -// ---------------------------------------------------------------------------- - -bool wxGTKCheckboxInputHandler::HandleKey(wxInputConsumer *control, - const wxKeyEvent& event, - bool pressed) -{ - if ( pressed ) - { - int keycode = event.GetKeyCode(); - if ( keycode == WXK_SPACE || keycode == WXK_RETURN ) - { - control->PerformAction(wxACTION_CHECKBOX_TOGGLE); - - return true; - } - } - - return false; -} - -#endif // wxUSE_CHECKBOX - -#if wxUSE_TEXTCTRL - -// ---------------------------------------------------------------------------- -// wxGTKTextCtrlInputHandler -// ---------------------------------------------------------------------------- - -bool wxGTKTextCtrlInputHandler::HandleKey(wxInputConsumer *control, - const wxKeyEvent& event, - bool pressed) -{ - // handle only GTK-specific text bindings here, the others are handled in - // the base class - if ( pressed ) - { - wxControlAction action; - int keycode = event.GetKeyCode(); - if ( event.ControlDown() ) - { - switch ( keycode ) - { - case 'A': - action = wxACTION_TEXT_HOME; - break; - - case 'B': - action = wxACTION_TEXT_LEFT; - break; - - case 'D': - action << wxACTION_TEXT_PREFIX_DEL << wxACTION_TEXT_RIGHT; - break; - - case 'E': - action = wxACTION_TEXT_END; - break; - - case 'F': - action = wxACTION_TEXT_RIGHT; - break; - - case 'H': - action << wxACTION_TEXT_PREFIX_DEL << wxACTION_TEXT_LEFT; - break; - - case 'K': - action << wxACTION_TEXT_PREFIX_DEL << wxACTION_TEXT_END; - break; - - case 'N': - action = wxACTION_TEXT_DOWN; - break; - - case 'P': - action = wxACTION_TEXT_UP; - break; - - case 'U': - //delete the entire line - control->PerformAction(wxACTION_TEXT_HOME); - action << wxACTION_TEXT_PREFIX_DEL << wxACTION_TEXT_END; - break; - - case 'W': - action << wxACTION_TEXT_PREFIX_DEL << wxACTION_TEXT_WORD_LEFT; - break; - } - } - else if ( event.AltDown() ) - { - switch ( keycode ) - { - case 'B': - action = wxACTION_TEXT_WORD_LEFT; - break; - - case 'D': - action << wxACTION_TEXT_PREFIX_DEL << wxACTION_TEXT_WORD_RIGHT; - break; - - case 'F': - action = wxACTION_TEXT_WORD_RIGHT; - break; - } - } - - if ( action != wxACTION_NONE ) - { - control->PerformAction(action); - - return true; - } - } - - return wxStdInputHandler::HandleKey(control, event, pressed); -} - -#endif // wxUSE_TEXTCTRL - -#endif // wxUSE_THEME_GTK diff --git a/wxWidgets/src/univ/themes/metal.cpp b/wxWidgets/src/univ/themes/metal.cpp deleted file mode 100644 index 4b6042a5b5..0000000000 --- a/wxWidgets/src/univ/themes/metal.cpp +++ /dev/null @@ -1,548 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: src/univ/themes/metal.cpp -// Purpose: wxUniversal theme implementing Win32-like LNF -// Author: Vadim Zeitlin, Robert Roebling -// Modified by: -// Created: 06.08.00 -// RCS-ID: $Id: metal.cpp 42455 2006-10-26 15:33:10Z VS $ -// Copyright: (c) 2000 SciTech Software, Inc. (www.scitechsoft.com) -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -// =========================================================================== -// declarations -// =========================================================================== - -// --------------------------------------------------------------------------- -// headers -// --------------------------------------------------------------------------- - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#include "wx/univ/theme.h" - -#if wxUSE_THEME_METAL - -#ifndef WX_PRECOMP - #include "wx/timer.h" - #include "wx/intl.h" - #include "wx/dc.h" - #include "wx/window.h" - - #include "wx/dcmemory.h" - - #include "wx/button.h" - #include "wx/listbox.h" - #include "wx/checklst.h" - #include "wx/combobox.h" - #include "wx/scrolbar.h" - #include "wx/slider.h" - #include "wx/textctrl.h" - #include "wx/toolbar.h" - - #include "wx/menu.h" - #include "wx/settings.h" - #include "wx/toplevel.h" -#endif // WX_PRECOMP - -#include "wx/notebook.h" -#include "wx/spinbutt.h" -#include "wx/artprov.h" - -#include "wx/univ/scrtimer.h" -#include "wx/univ/renderer.h" -#include "wx/univ/inpcons.h" -#include "wx/univ/inphand.h" -#include "wx/univ/colschem.h" - -// ---------------------------------------------------------------------------- -// wxMetalRenderer: draw the GUI elements in Metal style -// ---------------------------------------------------------------------------- - -class wxMetalRenderer : public wxDelegateRenderer -{ - // FIXME cut'n'paste from Win32 - enum wxArrowDirection - { - Arrow_Left, - Arrow_Right, - Arrow_Up, - Arrow_Down, - Arrow_Max - }; - - enum wxArrowStyle - { - Arrow_Normal, - Arrow_Disabled, - Arrow_Pressed, - Arrow_Inverted, - Arrow_InvertedDisabled, - Arrow_StateMax - }; -public: - wxMetalRenderer(wxRenderer *renderer, wxColourScheme* scheme); - - virtual void DrawButtonSurface(wxDC& dc, - const wxColour& WXUNUSED(col), - const wxRect& rect, - int WXUNUSED(flags)) - { DrawMetal(dc, rect); } - - virtual void DrawScrollbarThumb(wxDC& dc, - wxOrientation orient, - const wxRect& rect, - int flags); - - virtual void DrawScrollbarShaft(wxDC& dc, - wxOrientation orient, - const wxRect& rectBar, - int flags); - - virtual void GetComboBitmaps(wxBitmap *bmpNormal, - wxBitmap *bmpFocus, - wxBitmap *bmpPressed, - wxBitmap *bmpDisabled); - - virtual void DrawArrow(wxDC& dc, - wxDirection dir, - const wxRect& rect, - int flags = 0); -protected: - void DrawArrowButton(wxDC& dc, - const wxRect& rectAll, - wxArrowDirection arrowDir, - wxArrowStyle arrowStyle); - - void DrawRect(wxDC& dc, wxRect *rect, const wxPen& pen); - - void DrawShadedRect(wxDC& dc, wxRect *rect, - const wxPen& pen1, const wxPen& pen2); - - void DrawArrowBorder(wxDC& dc, wxRect *rect, bool isPressed = false); - - void DrawArrow(wxDC& dc, const wxRect& rect, - wxArrowDirection arrowDir, wxArrowStyle arrowStyle); - - void DrawMetal(wxDC &dc, const wxRect &rect ); -private: - wxPen m_penBlack, - m_penDarkGrey, - m_penLightGrey, - m_penHighlight; - - wxBitmap m_bmpArrows[Arrow_StateMax][Arrow_Max]; -}; - -// ---------------------------------------------------------------------------- -// wxMetalTheme -// ---------------------------------------------------------------------------- - -class wxMetalTheme : public wxDelegateTheme -{ -public: - wxMetalTheme() : wxDelegateTheme(_T("win32")), m_renderer(NULL) {} - ~wxMetalTheme() { delete m_renderer; } - -protected: - virtual wxRenderer *GetRenderer() - { - if ( !m_renderer ) - { - m_renderer = new wxMetalRenderer(m_theme->GetRenderer(), - GetColourScheme()); - } - - return m_renderer; - } - - wxRenderer *m_renderer; - - WX_DECLARE_THEME(Metal) -}; - -WX_IMPLEMENT_THEME(wxMetalTheme, Metal, wxTRANSLATE("Metal theme")); - - -// ============================================================================ -// implementation -// ============================================================================ - -// ---------------------------------------------------------------------------- -// wxMetalRenderer -// ---------------------------------------------------------------------------- - -wxMetalRenderer::wxMetalRenderer(wxRenderer *renderer, wxColourScheme *scheme) - : wxDelegateRenderer(renderer) -{ - // init colours and pens - m_penBlack = wxPen(wxSCHEME_COLOUR(scheme, SHADOW_DARK), 0, wxSOLID); - m_penDarkGrey = wxPen(wxSCHEME_COLOUR(scheme, SHADOW_OUT), 0, wxSOLID); - m_penLightGrey = wxPen(wxSCHEME_COLOUR(scheme, SHADOW_IN), 0, wxSOLID); - m_penHighlight = wxPen(wxSCHEME_COLOUR(scheme, SHADOW_HIGHLIGHT), 0, wxSOLID); - - // init the arrow bitmaps - static const size_t ARROW_WIDTH = 7; - static const size_t ARROW_LENGTH = 4; - - wxMask *mask; - wxMemoryDC dcNormal, - dcDisabled, - dcInverse; - for ( size_t n = 0; n < Arrow_Max; n++ ) - { - bool isVertical = n > Arrow_Right; - int w, h; - if ( isVertical ) - { - w = ARROW_WIDTH; - h = ARROW_LENGTH; - } - else - { - h = ARROW_WIDTH; - w = ARROW_LENGTH; - } - - // disabled arrow is larger because of the shadow - m_bmpArrows[Arrow_Normal][n].Create(w, h); - m_bmpArrows[Arrow_Disabled][n].Create(w + 1, h + 1); - - dcNormal.SelectObject(m_bmpArrows[Arrow_Normal][n]); - dcDisabled.SelectObject(m_bmpArrows[Arrow_Disabled][n]); - - dcNormal.SetBackground(*wxWHITE_BRUSH); - dcDisabled.SetBackground(*wxWHITE_BRUSH); - dcNormal.Clear(); - dcDisabled.Clear(); - - dcNormal.SetPen(m_penBlack); - dcDisabled.SetPen(m_penDarkGrey); - - // calculate the position of the point of the arrow - wxCoord x1, y1; - if ( isVertical ) - { - x1 = (ARROW_WIDTH - 1)/2; - y1 = n == Arrow_Up ? 0 : ARROW_LENGTH - 1; - } - else // horizontal - { - x1 = n == Arrow_Left ? 0 : ARROW_LENGTH - 1; - y1 = (ARROW_WIDTH - 1)/2; - } - - wxCoord x2 = x1, - y2 = y1; - - if ( isVertical ) - x2++; - else - y2++; - - for ( size_t i = 0; i < ARROW_LENGTH; i++ ) - { - dcNormal.DrawLine(x1, y1, x2, y2); - dcDisabled.DrawLine(x1, y1, x2, y2); - - if ( isVertical ) - { - x1--; - x2++; - - if ( n == Arrow_Up ) - { - y1++; - y2++; - } - else // down arrow - { - y1--; - y2--; - } - } - else // left or right arrow - { - y1--; - y2++; - - if ( n == Arrow_Left ) - { - x1++; - x2++; - } - else - { - x1--; - x2--; - } - } - } - - // draw the shadow for the disabled one - dcDisabled.SetPen(m_penHighlight); - switch ( n ) - { - case Arrow_Left: - y1 += 2; - dcDisabled.DrawLine(x1, y1, x2, y2); - break; - - case Arrow_Right: - x1 = ARROW_LENGTH - 1; - y1 = (ARROW_WIDTH - 1)/2 + 1; - x2 = 0; - y2 = ARROW_WIDTH; - dcDisabled.DrawLine(x1, y1, x2, y2); - dcDisabled.DrawLine(++x1, y1, x2, ++y2); - break; - - case Arrow_Up: - x1 += 2; - dcDisabled.DrawLine(x1, y1, x2, y2); - break; - - case Arrow_Down: - x1 = ARROW_WIDTH - 1; - y1 = 1; - x2 = (ARROW_WIDTH - 1)/2; - y2 = ARROW_LENGTH; - dcDisabled.DrawLine(x1, y1, x2, y2); - dcDisabled.DrawLine(++x1, y1, x2, ++y2); - break; - - } - - // create the inverted bitmap but only for the right arrow as we only - // use it for the menus - if ( n == Arrow_Right ) - { - m_bmpArrows[Arrow_Inverted][n].Create(w, h); - dcInverse.SelectObject(m_bmpArrows[Arrow_Inverted][n]); - dcInverse.Clear(); - dcInverse.Blit(0, 0, w, h, - &dcNormal, 0, 0, - wxXOR); - dcInverse.SelectObject(wxNullBitmap); - - mask = new wxMask(m_bmpArrows[Arrow_Inverted][n], *wxBLACK); - m_bmpArrows[Arrow_Inverted][n].SetMask(mask); - - m_bmpArrows[Arrow_InvertedDisabled][n].Create(w, h); - dcInverse.SelectObject(m_bmpArrows[Arrow_InvertedDisabled][n]); - dcInverse.Clear(); - dcInverse.Blit(0, 0, w, h, - &dcDisabled, 0, 0, - wxXOR); - dcInverse.SelectObject(wxNullBitmap); - - mask = new wxMask(m_bmpArrows[Arrow_InvertedDisabled][n], *wxBLACK); - m_bmpArrows[Arrow_InvertedDisabled][n].SetMask(mask); - } - - dcNormal.SelectObject(wxNullBitmap); - dcDisabled.SelectObject(wxNullBitmap); - - mask = new wxMask(m_bmpArrows[Arrow_Normal][n], *wxWHITE); - m_bmpArrows[Arrow_Normal][n].SetMask(mask); - mask = new wxMask(m_bmpArrows[Arrow_Disabled][n], *wxWHITE); - m_bmpArrows[Arrow_Disabled][n].SetMask(mask); - - m_bmpArrows[Arrow_Pressed][n] = m_bmpArrows[Arrow_Normal][n]; - } -} - -void wxMetalRenderer::DrawScrollbarThumb(wxDC& dc, - wxOrientation WXUNUSED(orient), - const wxRect& rect, - int WXUNUSED(flags)) -{ - // we don't use the flags, the thumb never changes appearance - wxRect rectThumb = rect; - DrawArrowBorder(dc, &rectThumb); - DrawMetal(dc, rectThumb); -} - -void wxMetalRenderer::DrawScrollbarShaft(wxDC& dc, - wxOrientation WXUNUSED(orient), - const wxRect& rectBar, - int WXUNUSED(flags)) -{ - DrawMetal(dc, rectBar); -} - -void wxMetalRenderer::GetComboBitmaps(wxBitmap *bmpNormal, - wxBitmap * WXUNUSED(bmpFocus), - wxBitmap *bmpPressed, - wxBitmap *bmpDisabled) -{ - static const wxCoord widthCombo = 16; - static const wxCoord heightCombo = 17; - - wxMemoryDC dcMem; - - if ( bmpNormal ) - { - bmpNormal->Create(widthCombo, heightCombo); - dcMem.SelectObject(*bmpNormal); - DrawArrowButton(dcMem, wxRect(0, 0, widthCombo, heightCombo), - Arrow_Down, Arrow_Normal); - } - - if ( bmpPressed ) - { - bmpPressed->Create(widthCombo, heightCombo); - dcMem.SelectObject(*bmpPressed); - DrawArrowButton(dcMem, wxRect(0, 0, widthCombo, heightCombo), - Arrow_Down, Arrow_Pressed); - } - - if ( bmpDisabled ) - { - bmpDisabled->Create(widthCombo, heightCombo); - dcMem.SelectObject(*bmpDisabled); - DrawArrowButton(dcMem, wxRect(0, 0, widthCombo, heightCombo), - Arrow_Down, Arrow_Disabled); - } -} - -void wxMetalRenderer::DrawArrow(wxDC& dc, - wxDirection dir, - const wxRect& rect, - int flags) -{ - // get the bitmap for this arrow - wxArrowDirection arrowDir; - switch ( dir ) - { - case wxLEFT: arrowDir = Arrow_Left; break; - case wxRIGHT: arrowDir = Arrow_Right; break; - case wxUP: arrowDir = Arrow_Up; break; - case wxDOWN: arrowDir = Arrow_Down; break; - - default: - wxFAIL_MSG(_T("unknown arrow direction")); - return; - } - - wxArrowStyle arrowStyle; - if ( flags & wxCONTROL_PRESSED ) - { - // can't be pressed and disabled - arrowStyle = Arrow_Pressed; - } - else - { - arrowStyle = flags & wxCONTROL_DISABLED ? Arrow_Disabled : Arrow_Normal; - } - - DrawArrowButton(dc, rect, arrowDir, arrowStyle); -} - -// -// protected functions -// - -void wxMetalRenderer::DrawArrowButton(wxDC& dc, - const wxRect& rectAll, - wxArrowDirection arrowDir, - wxArrowStyle arrowStyle) -{ - wxRect rect = rectAll; - DrawMetal( dc, rect ); - DrawArrowBorder(dc, &rect, arrowStyle == Arrow_Pressed); - DrawArrow(dc, rect, arrowDir, arrowStyle); -} - -void wxMetalRenderer::DrawRect(wxDC& dc, wxRect *rect, const wxPen& pen) -{ - // draw - dc.SetPen(pen); - dc.SetBrush(*wxTRANSPARENT_BRUSH); - dc.DrawRectangle(*rect); - - // adjust the rect - rect->Inflate(-1); -} - -void wxMetalRenderer::DrawShadedRect(wxDC& dc, wxRect *rect, - const wxPen& pen1, const wxPen& pen2) -{ - // draw the rectangle - dc.SetPen(pen1); - dc.DrawLine(rect->GetLeft(), rect->GetTop(), - rect->GetLeft(), rect->GetBottom()); - dc.DrawLine(rect->GetLeft() + 1, rect->GetTop(), - rect->GetRight(), rect->GetTop()); - dc.SetPen(pen2); - dc.DrawLine(rect->GetRight(), rect->GetTop(), - rect->GetRight(), rect->GetBottom()); - dc.DrawLine(rect->GetLeft(), rect->GetBottom(), - rect->GetRight() + 1, rect->GetBottom()); - - // adjust the rect - rect->Inflate(-1); -} - -void wxMetalRenderer::DrawArrowBorder(wxDC& dc, wxRect *rect, bool isPressed) -{ - if ( isPressed ) - { - DrawRect(dc, rect, m_penDarkGrey); - - // the arrow is usually drawn inside border of width 2 and is offset by - // another pixel in both directions when it's pressed - as the border - // in this case is more narrow as well, we have to adjust rect like - // this: - rect->Inflate(-1); - rect->x++; - rect->y++; - } - else - { - DrawShadedRect(dc, rect, m_penLightGrey, m_penBlack); - DrawShadedRect(dc, rect, m_penHighlight, m_penDarkGrey); - } -} - -void wxMetalRenderer::DrawArrow(wxDC& dc, - const wxRect& rect, - wxArrowDirection arrowDir, - wxArrowStyle arrowStyle) -{ - const wxBitmap& bmp = m_bmpArrows[arrowStyle][arrowDir]; - - // under Windows the arrows always have the same size so just centre it in - // the provided rectangle - wxCoord x = rect.x + (rect.width - bmp.GetWidth()) / 2, - y = rect.y + (rect.height - bmp.GetHeight()) / 2; - - // Windows does it like this... - if ( arrowDir == Arrow_Left ) - x--; - - // draw it - dc.DrawBitmap(bmp, x, y, true /* use mask */); -} - -// ---------------------------------------------------------------------------- -// metal gradient -// ---------------------------------------------------------------------------- - -void wxMetalRenderer::DrawMetal(wxDC &dc, const wxRect &rect ) -{ - dc.SetPen(*wxTRANSPARENT_PEN); - for (int y = rect.y; y < rect.height+rect.y; y++) - { - unsigned char intens = (unsigned char)(230 + 80 * (rect.y-y) / rect.height); - dc.SetBrush( wxBrush( wxColour(intens,intens,intens), wxSOLID ) ); - dc.DrawRectangle( rect.x, y, rect.width, 1 ); - } -} - -#endif // wxUSE_THEME_METAL diff --git a/wxWidgets/src/univ/themes/mono.cpp b/wxWidgets/src/univ/themes/mono.cpp deleted file mode 100644 index 95304d917b..0000000000 --- a/wxWidgets/src/univ/themes/mono.cpp +++ /dev/null @@ -1,1104 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: src/univ/themes/mono.cpp -// Purpose: wxUniversal theme for monochrome displays -// Author: Vadim Zeitlin -// Modified by: -// Created: 2006-08-27 -// RCS-ID: $Id: mono.cpp 54496 2008-07-05 18:25:33Z SN $ -// Copyright: (c) 2006 REA Elektronik GmbH -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -// =========================================================================== -// declarations -// =========================================================================== - -// --------------------------------------------------------------------------- -// headers -// --------------------------------------------------------------------------- - -// for compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#include "wx/univ/theme.h" - -#if wxUSE_THEME_MONO - -#ifndef WX_PRECOMP - #include "wx/window.h" - #include "wx/dc.h" -#endif // WX_PRECOMP - -#include "wx/artprov.h" -#include "wx/univ/stdrend.h" -#include "wx/univ/inphand.h" -#include "wx/univ/colschem.h" - -class wxMonoColourScheme; - -#define wxMONO_BG_COL (*wxWHITE) -#define wxMONO_FG_COL (*wxBLACK) - -// ---------------------------------------------------------------------------- -// wxMonoRenderer: draw the GUI elements in simplest possible way -// ---------------------------------------------------------------------------- - -// Warning: many of the methods here are not implemented, the code won't work -// if any but a few wxUSE_XXXs are on -class wxMonoRenderer : public wxStdRenderer -{ -public: - wxMonoRenderer(const wxColourScheme *scheme); - - virtual void DrawButtonLabel(wxDC& dc, - const wxString& label, - const wxBitmap& image, - const wxRect& rect, - int flags = 0, - int alignment = wxALIGN_LEFT | wxALIGN_TOP, - int indexAccel = -1, - wxRect *rectBounds = NULL); - - virtual void DrawFocusRect(wxDC& dc, const wxRect& rect, int flags = 0); - - virtual void DrawButtonBorder(wxDC& dc, - const wxRect& rect, - int flags = 0, - wxRect *rectIn = NULL); - - virtual void DrawHorizontalLine(wxDC& dc, - wxCoord y, wxCoord x1, wxCoord x2); - - virtual void DrawVerticalLine(wxDC& dc, - wxCoord x, wxCoord y1, wxCoord y2); - - virtual void DrawArrow(wxDC& dc, - wxDirection dir, - const wxRect& rect, - int flags = 0); - virtual void DrawScrollbarThumb(wxDC& dc, - wxOrientation orient, - const wxRect& rect, - int flags = 0); - virtual void DrawScrollbarShaft(wxDC& dc, - wxOrientation orient, - const wxRect& rect, - int flags = 0); - -#if wxUSE_TOOLBAR - virtual void DrawToolBarButton(wxDC& dc, - const wxString& label, - const wxBitmap& bitmap, - const wxRect& rect, - int flags = 0, - long style = 0, - int tbarStyle = 0); -#endif // wxUSE_TOOLBAR - -#if wxUSE_NOTEBOOK - virtual void DrawTab(wxDC& dc, - const wxRect& rect, - wxDirection dir, - const wxString& label, - const wxBitmap& bitmap = wxNullBitmap, - int flags = 0, - int indexAccel = -1); -#endif // wxUSE_NOTEBOOK - -#if wxUSE_SLIDER - virtual void DrawSliderShaft(wxDC& dc, - const wxRect& rect, - int lenThumb, - wxOrientation orient, - int flags = 0, - long style = 0, - wxRect *rectShaft = NULL); - - virtual void DrawSliderThumb(wxDC& dc, - const wxRect& rect, - wxOrientation orient, - int flags = 0, - long style = 0); - - virtual void DrawSliderTicks(wxDC& dc, - const wxRect& rect, - int lenThumb, - wxOrientation orient, - int start, - int end, - int step = 1, - int flags = 0, - long style = 0); -#endif // wxUSE_SLIDER - -#if wxUSE_MENUS - virtual void DrawMenuBarItem(wxDC& dc, - const wxRect& rect, - const wxString& label, - int flags = 0, - int indexAccel = -1); - - virtual void DrawMenuItem(wxDC& dc, - wxCoord y, - const wxMenuGeometryInfo& geometryInfo, - const wxString& label, - const wxString& accel, - const wxBitmap& bitmap = wxNullBitmap, - int flags = 0, - int indexAccel = -1); - - virtual void DrawMenuSeparator(wxDC& dc, - wxCoord y, - const wxMenuGeometryInfo& geomInfo); -#endif // wxUSE_MENUS - -#if wxUSE_COMBOBOX - virtual void GetComboBitmaps(wxBitmap *bmpNormal, - wxBitmap *bmpFocus, - wxBitmap *bmpPressed, - wxBitmap *bmpDisabled); -#endif // wxUSE_COMBOBOX - - - virtual wxRect GetBorderDimensions(wxBorder border) const; - -#if wxUSE_SCROLLBAR - virtual wxSize GetScrollbarArrowSize() const { return GetStdBmpSize(); } -#endif // wxUSE_SCROLLBAR - - virtual wxSize GetCheckBitmapSize() const { return GetStdBmpSize(); } - virtual wxSize GetRadioBitmapSize() const { return GetStdBmpSize(); } - -#if wxUSE_TOOLBAR - virtual wxSize GetToolBarButtonSize(wxCoord *separator) const; - - virtual wxSize GetToolBarMargin() const; -#endif // wxUSE_TOOLBAR - -#if wxUSE_NOTEBOOK - virtual wxSize GetTabIndent() const; - - virtual wxSize GetTabPadding() const; -#endif // wxUSE_NOTEBOOK - -#if wxUSE_SLIDER - virtual wxCoord GetSliderDim() const; - - virtual wxCoord GetSliderTickLen() const; - - virtual wxRect GetSliderShaftRect(const wxRect& rect, - int lenThumb, - wxOrientation orient, - long style = 0) const; - - virtual wxSize GetSliderThumbSize(const wxRect& rect, - int lenThumb, - wxOrientation orient) const; -#endif // wxUSE_SLIDER - - virtual wxSize GetProgressBarStep() const; - -#if wxUSE_MENUS - virtual wxSize GetMenuBarItemSize(const wxSize& sizeText) const; - - virtual wxMenuGeometryInfo *GetMenuGeometry(wxWindow *win, - const wxMenu& menu) const; -#endif // wxUSE_MENUS - -#if wxUSE_STATUSBAR - virtual wxCoord GetStatusBarBorderBetweenFields() const; - - virtual wxSize GetStatusBarFieldMargins() const; -#endif // wxUSE_STATUSBAR - -protected: - // override base class border drawing routines: we always draw just a - // single simple border - void DrawSimpleBorder(wxDC& dc, wxRect *rect) - { DrawRect(dc, rect, m_penFg); } - - virtual void DrawRaisedBorder(wxDC& dc, wxRect *rect) - { DrawSimpleBorder(dc, rect); } - virtual void DrawSunkenBorder(wxDC& dc, wxRect *rect) - { DrawSimpleBorder(dc, rect); } - virtual void DrawAntiSunkenBorder(wxDC& dc, wxRect *rect) - { DrawSimpleBorder(dc, rect); } - virtual void DrawBoxBorder(wxDC& dc, wxRect *rect) - { DrawSimpleBorder(dc, rect); } - virtual void DrawStaticBorder(wxDC& dc, wxRect *rect) - { DrawSimpleBorder(dc, rect); } - virtual void DrawExtraBorder(wxDC& WXUNUSED(dc), wxRect * WXUNUSED(rect)) - { /* no extra borders for us */ } - - // all our XPMs are of this size - static wxSize GetStdBmpSize() { return wxSize(8, 8); } - - wxBitmap GetIndicator(IndicatorType indType, int flags); - virtual wxBitmap GetCheckBitmap(int flags) - { return GetIndicator(IndicatorType_Check, flags); } - virtual wxBitmap GetRadioBitmap(int flags) - { return GetIndicator(IndicatorType_Radio, flags); } - - virtual wxBitmap GetFrameButtonBitmap(FrameButtonType type); - virtual int GetFrameBorderWidth(int flags) const; - -private: - // the bitmaps returned by GetIndicator() - wxBitmap m_bmpIndicators[IndicatorType_MaxCtrl] - [IndicatorState_MaxCtrl] - [IndicatorStatus_Max]; - - static const char **ms_xpmIndicators[IndicatorType_MaxCtrl] - [IndicatorState_MaxCtrl] - [IndicatorStatus_Max]; - - // the arrow bitmaps used by DrawArrow() - wxBitmap m_bmpArrows[Arrow_Max]; - - static const char **ms_xpmArrows[Arrow_Max]; - - // the close bitmap for the frame for GetFrameButtonBitmap() - wxBitmap m_bmpFrameClose; - - // pen used for foreground drawing - wxPen m_penFg; -}; - -// ---------------------------------------------------------------------------- -// standard bitmaps -// ---------------------------------------------------------------------------- - -static const char *xpmUnchecked[] = { -/* columns rows colors chars-per-pixel */ -"8 8 2 1", -" c white", -"X c black", -/* pixels */ -"XXXXXXXX", -"X X", -"X X", -"X X", -"X X", -"X X", -"X X", -"XXXXXXXX", -}; - -static const char *xpmChecked[] = { -/* columns rows colors chars-per-pixel */ -"8 8 2 1", -" c white", -"X c black", -/* pixels */ -"XXXXXXXX", -"X X", -"X X X X", -"X XX X", -"X XX X", -"X X X X", -"X X", -"XXXXXXXX", -}; - -static const char *xpmUndeterminate[] = { -/* columns rows colors chars-per-pixel */ -"8 8 2 1", -" c white", -"X c black", -/* pixels */ -"XXXXXXXX", -"X X X XX", -"XX X X X", -"X X X XX", -"XX X X X", -"X X X XX", -"XX X X X", -"XXXXXXXX", -}; - -static const char *xpmRadioUnchecked[] = { -/* columns rows colors chars-per-pixel */ -"8 8 2 1", -" c white", -"X c black", -/* pixels */ -"XXXXXXXX", -"X X", -"X XX X", -"X X X X", -"X X X X", -"X XX X", -"X X", -"XXXXXXXX", -}; - -static const char *xpmRadioChecked[] = { -/* columns rows colors chars-per-pixel */ -"8 8 2 1", -" c white", -"X c black", -/* pixels */ -"XXXXXXXX", -"X X", -"X XX X", -"X XXXX X", -"X XXXX X", -"X XX X", -"X X", -"XXXXXXXX", -}; - -const char **wxMonoRenderer::ms_xpmIndicators[IndicatorType_MaxCtrl] - [IndicatorState_MaxCtrl] - [IndicatorStatus_Max] = -{ - // checkboxes first - { - // normal state - { xpmChecked, xpmUnchecked, xpmUndeterminate }, - - // pressed state - { xpmUndeterminate, xpmUndeterminate, xpmUndeterminate }, - - // disabled state - { xpmUndeterminate, xpmUndeterminate, xpmUndeterminate }, - }, - - // radio - { - // normal state - { xpmRadioChecked, xpmRadioUnchecked, xpmUndeterminate }, - - // pressed state - { xpmUndeterminate, xpmUndeterminate, xpmUndeterminate }, - - // disabled state - { xpmUndeterminate, xpmUndeterminate, xpmUndeterminate }, - }, -}; - -static const char *xpmLeftArrow[] = { -/* columns rows colors chars-per-pixel */ -"8 8 2 1", -" c white", -"X c black", -/* pixels */ -" X ", -" XX ", -" XXX ", -"XXXX ", -"XXXX ", -" XXX ", -" XX ", -" X ", -}; - -static const char *xpmRightArrow[] = { -/* columns rows colors chars-per-pixel */ -"8 8 2 1", -" c white", -"X c black", -/* pixels */ -" X ", -" XX ", -" XXX ", -" XXXX", -" XXXX", -" XXX ", -" XX ", -" X ", -}; - -static const char *xpmUpArrow[] = { -/* columns rows colors chars-per-pixel */ -"8 8 2 1", -" c white", -"X c black", -/* pixels */ -" ", -" XX ", -" XXXX ", -" XXXXXX ", -"XXXXXXXX", -" ", -" ", -" ", -}; - -static const char *xpmDownArrow[] = { -/* columns rows colors chars-per-pixel */ -"8 8 2 1", -" c white", -"X c black", -/* pixels */ -" ", -" ", -" ", -"XXXXXXXX", -" XXXXXX ", -" XXXX ", -" XX ", -" ", -}; - -const char **wxMonoRenderer::ms_xpmArrows[Arrow_Max] = -{ - xpmLeftArrow, xpmRightArrow, xpmUpArrow, xpmDownArrow, -}; - -// ---------------------------------------------------------------------------- -// wxMonoColourScheme: uses just white and black -// ---------------------------------------------------------------------------- - -class wxMonoColourScheme : public wxColourScheme -{ -public: - // we use only 2 colours, white and black, but we avoid referring to them - // like this, instead use the functions below - wxColour GetFg() const { return wxMONO_FG_COL; } - wxColour GetBg() const { return wxMONO_BG_COL; } - - // implement base class pure virtuals - virtual wxColour Get(StdColour col) const; - virtual wxColour GetBackground(wxWindow *win) const; -}; - -// ---------------------------------------------------------------------------- -// wxMonoArtProvider -// ---------------------------------------------------------------------------- - -class wxMonoArtProvider : public wxArtProvider -{ -protected: - virtual wxBitmap CreateBitmap(const wxArtID& id, - const wxArtClient& client, - const wxSize& size); -}; - -// ---------------------------------------------------------------------------- -// wxMonoTheme -// ---------------------------------------------------------------------------- - -class wxMonoTheme : public wxTheme -{ -public: - wxMonoTheme(); - virtual ~wxMonoTheme(); - - virtual wxRenderer *GetRenderer(); - virtual wxArtProvider *GetArtProvider(); - virtual wxInputHandler *GetInputHandler(const wxString& control, - wxInputConsumer *consumer); - virtual wxColourScheme *GetColourScheme(); - -private: - wxMonoRenderer *m_renderer; - wxMonoArtProvider *m_artProvider; - wxMonoColourScheme *m_scheme; - - WX_DECLARE_THEME(mono) -}; - -// ============================================================================ -// implementation -// ============================================================================ - -WX_IMPLEMENT_THEME(wxMonoTheme, mono, wxTRANSLATE("Simple monochrome theme")); - -// ---------------------------------------------------------------------------- -// wxMonoTheme -// ---------------------------------------------------------------------------- - -wxMonoTheme::wxMonoTheme() -{ - m_scheme = NULL; - m_renderer = NULL; - m_artProvider = NULL; -} - -wxMonoTheme::~wxMonoTheme() -{ - delete m_renderer; - delete m_scheme; - delete m_artProvider; -} - -wxRenderer *wxMonoTheme::GetRenderer() -{ - if ( !m_renderer ) - { - m_renderer = new wxMonoRenderer(GetColourScheme()); - } - - return m_renderer; -} - -wxArtProvider *wxMonoTheme::GetArtProvider() -{ - if ( !m_artProvider ) - { - m_artProvider = new wxMonoArtProvider; - } - - return m_artProvider; -} - -wxColourScheme *wxMonoTheme::GetColourScheme() -{ - if ( !m_scheme ) - { - m_scheme = new wxMonoColourScheme; - } - - return m_scheme; -} - -wxInputHandler *wxMonoTheme::GetInputHandler(const wxString& WXUNUSED(control), - wxInputConsumer *consumer) -{ - // no special input handlers so far - return consumer->DoGetStdInputHandler(NULL); -} - -// ============================================================================ -// wxMonoColourScheme -// ============================================================================ - -wxColour wxMonoColourScheme::GetBackground(wxWindow *win) const -{ - wxColour col; - if ( win->UseBgCol() ) - { - // use the user specified colour - col = win->GetBackgroundColour(); - } - - // doesn't depend on the state - if ( !col.Ok() ) - { - col = GetBg(); - } - - return col; -} - -wxColour wxMonoColourScheme::Get(wxMonoColourScheme::StdColour col) const -{ - switch ( col ) - { - case WINDOW: - case CONTROL: - case CONTROL_PRESSED: - case CONTROL_CURRENT: - case SCROLLBAR: - case SCROLLBAR_PRESSED: - case GAUGE: - case TITLEBAR: - case TITLEBAR_ACTIVE: - case HIGHLIGHT_TEXT: - case DESKTOP: - case FRAME: - return GetBg(); - - case MAX: - default: - wxFAIL_MSG(_T("invalid standard colour")); - // fall through - - case SHADOW_DARK: - case SHADOW_HIGHLIGHT: - case SHADOW_IN: - case SHADOW_OUT: - case CONTROL_TEXT: - case CONTROL_TEXT_DISABLED: - case CONTROL_TEXT_DISABLED_SHADOW: - case TITLEBAR_TEXT: - case TITLEBAR_ACTIVE_TEXT: - case HIGHLIGHT: - return GetFg(); - - } -} - -// ============================================================================ -// wxMonoRenderer -// ============================================================================ - -// ---------------------------------------------------------------------------- -// construction -// ---------------------------------------------------------------------------- - -wxMonoRenderer::wxMonoRenderer(const wxColourScheme *scheme) - : wxStdRenderer(scheme) -{ - m_penFg = wxPen(wxMONO_FG_COL); -} - -// ---------------------------------------------------------------------------- -// borders -// ---------------------------------------------------------------------------- - -wxRect wxMonoRenderer::GetBorderDimensions(wxBorder border) const -{ - wxCoord width; - switch ( border ) - { - case wxBORDER_SIMPLE: - case wxBORDER_STATIC: - case wxBORDER_RAISED: - case wxBORDER_SUNKEN: - width = 1; - break; - - case wxBORDER_DOUBLE: - width = 2; - break; - - default: - wxFAIL_MSG(_T("unknown border type")); - // fall through - - case wxBORDER_DEFAULT: - case wxBORDER_NONE: - width = 0; - break; - } - - wxRect rect; - rect.x = - rect.y = - rect.width = - rect.height = width; - - return rect; -} - -void wxMonoRenderer::DrawButtonBorder(wxDC& dc, - const wxRect& rect, - int flags, - wxRect *rectIn) -{ - DrawBorder(dc, wxBORDER_SIMPLE, rect, flags, rectIn); -} - -// ---------------------------------------------------------------------------- -// lines and frames -// ---------------------------------------------------------------------------- - -void -wxMonoRenderer::DrawHorizontalLine(wxDC& dc, wxCoord y, wxCoord x1, wxCoord x2) -{ - dc.SetPen(m_penFg); - dc.DrawLine(x1, y, x2 + 1, y); -} - -void -wxMonoRenderer::DrawVerticalLine(wxDC& dc, wxCoord x, wxCoord y1, wxCoord y2) -{ - dc.SetPen(m_penFg); - dc.DrawLine(x, y1, x, y2 + 1); -} - -void wxMonoRenderer::DrawFocusRect(wxDC& dc, const wxRect& rect, int flags) -{ - // no need to draw the focus rect for selected items, it would be invisible - // anyhow - if ( !(flags & wxCONTROL_SELECTED) ) - { - dc.SetPen(m_penFg); - dc.SetBrush(*wxTRANSPARENT_BRUSH); - dc.DrawRectangle(rect); - } -} - -// ---------------------------------------------------------------------------- -// label -// ---------------------------------------------------------------------------- - -void wxMonoRenderer::DrawButtonLabel(wxDC& dc, - const wxString& label, - const wxBitmap& image, - const wxRect& rect, - int flags, - int alignment, - int indexAccel, - wxRect *rectBounds) -{ - dc.DrawLabel(label, image, rect, alignment, indexAccel, rectBounds); - - if ( flags & wxCONTROL_DISABLED ) - { - // this is ugly but I don't know how to show disabled button visually - // in monochrome theme otherwise, so cross it out - dc.SetPen(m_penFg); - dc.DrawLine(rect.GetTopLeft(), rect.GetBottomRight()); - dc.DrawLine(rect.GetTopRight(), rect.GetBottomLeft()); - } -} - -// ---------------------------------------------------------------------------- -// bitmaps -// ---------------------------------------------------------------------------- - -wxBitmap wxMonoRenderer::GetIndicator(IndicatorType indType, int flags) -{ - IndicatorState indState; - IndicatorStatus indStatus; - GetIndicatorsFromFlags(flags, indState, indStatus); - - wxBitmap& bmp = m_bmpIndicators[indType][indState][indStatus]; - if ( !bmp.Ok() ) - { - const char **xpm = ms_xpmIndicators[indType][indState][indStatus]; - if ( xpm ) - { - // create and cache it - bmp = wxBitmap(xpm); - } - } - - return bmp; -} - -wxBitmap wxMonoRenderer::GetFrameButtonBitmap(FrameButtonType type) -{ - if ( type == FrameButton_Close ) - { - if ( !m_bmpFrameClose.Ok() ) - { - static const char *xpmFrameClose[] = { - /* columns rows colors chars-per-pixel */ - "8 8 2 1", - " c white", - "X c black", - /* pixels */ - " ", - " XX XX ", - " X X ", - " XX ", - " XX ", - " X X ", - " XX XX ", - " ", - }; - - m_bmpFrameClose = wxBitmap(xpmFrameClose); - } - - return m_bmpFrameClose; - } - - // we don't show any other buttons than close - return wxNullBitmap; -} - -// ---------------------------------------------------------------------------- -// toolbar -// ---------------------------------------------------------------------------- - -#if wxUSE_TOOLBAR - -void wxMonoRenderer::DrawToolBarButton(wxDC& WXUNUSED(dc), - const wxString& WXUNUSED(label), - const wxBitmap& WXUNUSED(bitmap), - const wxRect& WXUNUSED(rect), - int WXUNUSED(flags), - long WXUNUSED(style), - int WXUNUSED(tbarStyle)) -{ - wxFAIL_MSG(_T("TODO")); -} - -wxSize wxMonoRenderer::GetToolBarButtonSize(wxCoord *WXUNUSED(separator)) const -{ - wxFAIL_MSG(_T("TODO")); - - return wxSize(); -} - -wxSize wxMonoRenderer::GetToolBarMargin() const -{ - wxFAIL_MSG(_T("TODO")); - - return wxSize(); -} - -#endif // wxUSE_TOOLBAR - -// ---------------------------------------------------------------------------- -// notebook -// ---------------------------------------------------------------------------- - -#if wxUSE_NOTEBOOK - -void wxMonoRenderer::DrawTab(wxDC& WXUNUSED(dc), - const wxRect& WXUNUSED(rect), - wxDirection WXUNUSED(dir), - const wxString& WXUNUSED(label), - const wxBitmap& WXUNUSED(bitmap), - int WXUNUSED(flags), - int WXUNUSED(indexAccel)) -{ - wxFAIL_MSG(_T("TODO")); -} - -wxSize wxMonoRenderer::GetTabIndent() const -{ - wxFAIL_MSG(_T("TODO")); - - return wxSize(); -} - -wxSize wxMonoRenderer::GetTabPadding() const -{ - wxFAIL_MSG(_T("TODO")); - - return wxSize(); -} - -#endif // wxUSE_NOTEBOOK - -// ---------------------------------------------------------------------------- -// combobox -// ---------------------------------------------------------------------------- - -#if wxUSE_COMBOBOX - -void wxMonoRenderer::GetComboBitmaps(wxBitmap *WXUNUSED(bmpNormal), - wxBitmap *WXUNUSED(bmpFocus), - wxBitmap *WXUNUSED(bmpPressed), - wxBitmap *WXUNUSED(bmpDisabled)) -{ - wxFAIL_MSG(_T("TODO")); -} - -#endif // wxUSE_COMBOBOX - -// ---------------------------------------------------------------------------- -// menus -// ---------------------------------------------------------------------------- - -#if wxUSE_MENUS - -void wxMonoRenderer::DrawMenuBarItem(wxDC& WXUNUSED(dc), - const wxRect& WXUNUSED(rect), - const wxString& WXUNUSED(label), - int WXUNUSED(flags), - int WXUNUSED(indexAccel)) -{ - wxFAIL_MSG(_T("TODO")); -} - -void wxMonoRenderer::DrawMenuItem(wxDC& WXUNUSED(dc), - wxCoord WXUNUSED(y), - const wxMenuGeometryInfo& WXUNUSED(geometryInfo), - const wxString& WXUNUSED(label), - const wxString& WXUNUSED(accel), - const wxBitmap& WXUNUSED(bitmap), - int WXUNUSED(flags), - int WXUNUSED(indexAccel)) -{ - wxFAIL_MSG(_T("TODO")); -} - -void wxMonoRenderer::DrawMenuSeparator(wxDC& WXUNUSED(dc), - wxCoord WXUNUSED(y), - const wxMenuGeometryInfo& WXUNUSED(geomInfo)) -{ - wxFAIL_MSG(_T("TODO")); -} - -wxSize wxMonoRenderer::GetMenuBarItemSize(const wxSize& WXUNUSED(sizeText)) const -{ - wxFAIL_MSG(_T("TODO")); - - return wxSize(); -} - -wxMenuGeometryInfo *wxMonoRenderer::GetMenuGeometry(wxWindow *WXUNUSED(win), - const wxMenu& WXUNUSED(menu)) const -{ - wxFAIL_MSG(_T("TODO")); - - return NULL; -} - -#endif // wxUSE_MENUS - -// ---------------------------------------------------------------------------- -// slider -// ---------------------------------------------------------------------------- - -#if wxUSE_SLIDER - -void wxMonoRenderer::DrawSliderShaft(wxDC& WXUNUSED(dc), - const wxRect& WXUNUSED(rect), - int WXUNUSED(lenThumb), - wxOrientation WXUNUSED(orient), - int WXUNUSED(flags), - long WXUNUSED(style), - wxRect *WXUNUSED(rectShaft)) -{ - wxFAIL_MSG(_T("TODO")); -} - - -void wxMonoRenderer::DrawSliderThumb(wxDC& WXUNUSED(dc), - const wxRect& WXUNUSED(rect), - wxOrientation WXUNUSED(orient), - int WXUNUSED(flags), - long WXUNUSED(style)) -{ - wxFAIL_MSG(_T("TODO")); -} - -void wxMonoRenderer::DrawSliderTicks(wxDC& WXUNUSED(dc), - const wxRect& WXUNUSED(rect), - int WXUNUSED(lenThumb), - wxOrientation WXUNUSED(orient), - int WXUNUSED(start), - int WXUNUSED(end), - int WXUNUSED(step), - int WXUNUSED(flags), - long WXUNUSED(style)) -{ - wxFAIL_MSG(_T("TODO")); -} - -wxCoord wxMonoRenderer::GetSliderDim() const -{ - wxFAIL_MSG(_T("TODO")); - - return 0; -} - -wxCoord wxMonoRenderer::GetSliderTickLen() const -{ - wxFAIL_MSG(_T("TODO")); - - return 0; -} - - -wxRect wxMonoRenderer::GetSliderShaftRect(const wxRect& WXUNUSED(rect), - int WXUNUSED(lenThumb), - wxOrientation WXUNUSED(orient), - long WXUNUSED(style)) const -{ - wxFAIL_MSG(_T("TODO")); - - return wxRect(); -} - -wxSize wxMonoRenderer::GetSliderThumbSize(const wxRect& WXUNUSED(rect), - int WXUNUSED(lenThumb), - wxOrientation WXUNUSED(orient)) const -{ - wxFAIL_MSG(_T("TODO")); - - return wxSize(); -} - -#endif // wxUSE_SLIDER - -wxSize wxMonoRenderer::GetProgressBarStep() const -{ - wxFAIL_MSG(_T("TODO")); - - return wxSize(); -} - - -// ---------------------------------------------------------------------------- -// scrollbar -// ---------------------------------------------------------------------------- - -void wxMonoRenderer::DrawArrow(wxDC& dc, - wxDirection dir, - const wxRect& rect, - int WXUNUSED(flags)) -{ - ArrowDirection arrowDir = GetArrowDirection(dir); - wxCHECK_RET( arrowDir != Arrow_Max, _T("invalid arrow direction") ); - - wxBitmap& bmp = m_bmpArrows[arrowDir]; - if ( !bmp.Ok() ) - { - bmp = wxBitmap(ms_xpmArrows[arrowDir]); - } - - wxRect rectArrow(0, 0, bmp.GetWidth(), bmp.GetHeight()); - dc.DrawBitmap(bmp, rectArrow.CentreIn(rect).GetPosition(), true /* use mask */); -} - -void wxMonoRenderer::DrawScrollbarThumb(wxDC& dc, - wxOrientation WXUNUSED(orient), - const wxRect& rect, - int WXUNUSED(flags)) -{ - DrawSolidRect(dc, wxMONO_BG_COL, rect); - - // manually draw stipple pattern (wxDFB doesn't implement the wxSTIPPLE - // brush style): - dc.SetPen(m_penFg); - for ( wxCoord y = rect.GetTop(); y <= rect.GetBottom(); y++ ) - { - for ( wxCoord x = rect.GetLeft() + (y % 2); x <= rect.GetRight(); x+=2 ) - { - dc.DrawPoint(x, y); - } - } -} - -void wxMonoRenderer::DrawScrollbarShaft(wxDC& dc, - wxOrientation WXUNUSED(orient), - const wxRect& rect, - int WXUNUSED(flags)) -{ - DrawSolidRect(dc, wxMONO_BG_COL, rect); -} - -// ---------------------------------------------------------------------------- -// status bar -// ---------------------------------------------------------------------------- - -#if wxUSE_STATUSBAR - -wxCoord wxMonoRenderer::GetStatusBarBorderBetweenFields() const -{ - return 1; -} - -wxSize wxMonoRenderer::GetStatusBarFieldMargins() const -{ - return wxSize(1, 1); -} - -#endif // wxUSE_STATUSBAR - -// ---------------------------------------------------------------------------- -// top level windows -// ---------------------------------------------------------------------------- - -int wxMonoRenderer::GetFrameBorderWidth(int WXUNUSED(flags)) const -{ - // all our borders are simple - return 1; -} - -// ---------------------------------------------------------------------------- -// wxMonoArtProvider -// ---------------------------------------------------------------------------- - -wxBitmap wxMonoArtProvider::CreateBitmap(const wxArtID& WXUNUSED(id), - const wxArtClient& WXUNUSED(client), - const wxSize& WXUNUSED(size)) -{ - return wxNullBitmap; -} - -#endif // wxUSE_THEME_MONO diff --git a/wxWidgets/src/univ/themes/win32.cpp b/wxWidgets/src/univ/themes/win32.cpp deleted file mode 100644 index 085ba32451..0000000000 --- a/wxWidgets/src/univ/themes/win32.cpp +++ /dev/null @@ -1,3779 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: src/univ/themes/win32.cpp -// Purpose: wxUniversal theme implementing Win32-like LNF -// Author: Vadim Zeitlin -// Modified by: -// Created: 06.08.00 -// RCS-ID: $Id: win32.cpp 44058 2006-12-24 19:06:39Z VS $ -// Copyright: (c) 2000 SciTech Software, Inc. (www.scitechsoft.com) -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -// =========================================================================== -// declarations -// =========================================================================== - -// --------------------------------------------------------------------------- -// headers -// --------------------------------------------------------------------------- - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#include "wx/univ/theme.h" - -#if wxUSE_THEME_WIN32 - -#ifndef WX_PRECOMP - #include "wx/timer.h" - #include "wx/intl.h" - #include "wx/dc.h" - #include "wx/window.h" - - #include "wx/dcmemory.h" - - #include "wx/button.h" - #include "wx/bmpbuttn.h" - #include "wx/listbox.h" - #include "wx/checklst.h" - #include "wx/combobox.h" - #include "wx/scrolbar.h" - #include "wx/slider.h" - #include "wx/textctrl.h" - #include "wx/toolbar.h" - #include "wx/statusbr.h" - - #ifdef __WXMSW__ - // for COLOR_* constants - #include "wx/msw/private.h" - #endif - #include "wx/menu.h" - #include "wx/settings.h" - #include "wx/toplevel.h" - #include "wx/image.h" -#endif // WX_PRECOMP - -#include "wx/notebook.h" -#include "wx/spinbutt.h" -#include "wx/artprov.h" -#ifdef wxUSE_TOGGLEBTN -#include "wx/tglbtn.h" -#endif // wxUSE_TOGGLEBTN - -#include "wx/univ/scrtimer.h" -#include "wx/univ/stdrend.h" -#include "wx/univ/inpcons.h" -#include "wx/univ/inphand.h" -#include "wx/univ/colschem.h" - -// ---------------------------------------------------------------------------- -// constants -// ---------------------------------------------------------------------------- - -static const int BORDER_THICKNESS = 2; - -static const size_t NUM_STATUSBAR_GRIP_BANDS = 3; -static const size_t WIDTH_STATUSBAR_GRIP_BAND = 4; -static const size_t STATUSBAR_GRIP_SIZE = - WIDTH_STATUSBAR_GRIP_BAND*NUM_STATUSBAR_GRIP_BANDS; - -static const wxCoord SLIDER_MARGIN = 6; // margin around slider -static const wxCoord SLIDER_THUMB_LENGTH = 18; -static const wxCoord SLIDER_TICK_LENGTH = 6; - -// wxWin32Renderer: draw the GUI elements in Win32 style -// ---------------------------------------------------------------------------- - -class wxWin32Renderer : public wxStdRenderer -{ -public: - // ctor - wxWin32Renderer(const wxColourScheme *scheme); - - // reimplement the renderer methods which are different for this theme - virtual void DrawLabel(wxDC& dc, - const wxString& label, - const wxRect& rect, - int flags = 0, - int alignment = wxALIGN_LEFT | wxALIGN_TOP, - int indexAccel = -1, - wxRect *rectBounds = NULL); - virtual void DrawButtonLabel(wxDC& dc, - const wxString& label, - const wxBitmap& image, - const wxRect& rect, - int flags = 0, - int alignment = wxALIGN_LEFT | wxALIGN_TOP, - int indexAccel = -1, - wxRect *rectBounds = NULL); - virtual void DrawButtonBorder(wxDC& dc, - const wxRect& rect, - int flags = 0, - wxRect *rectIn = NULL); - - virtual void DrawArrow(wxDC& dc, - wxDirection dir, - const wxRect& rect, - int flags = 0); - virtual void DrawScrollbarThumb(wxDC& dc, - wxOrientation orient, - const wxRect& rect, - int flags = 0); - virtual void DrawScrollbarShaft(wxDC& dc, - wxOrientation orient, - const wxRect& rect, - int flags = 0); - -#if wxUSE_TOOLBAR - virtual void DrawToolBarButton(wxDC& dc, - const wxString& label, - const wxBitmap& bitmap, - const wxRect& rect, - int flags = 0, - long style = 0, - int tbarStyle = 0); -#endif // wxUSE_TOOLBAR - -#if wxUSE_NOTEBOOK - virtual void DrawTab(wxDC& dc, - const wxRect& rect, - wxDirection dir, - const wxString& label, - const wxBitmap& bitmap = wxNullBitmap, - int flags = 0, - int indexAccel = -1); -#endif // wxUSE_NOTEBOOK - -#if wxUSE_SLIDER - virtual void DrawSliderShaft(wxDC& dc, - const wxRect& rect, - int lenThumb, - wxOrientation orient, - int flags = 0, - long style = 0, - wxRect *rectShaft = NULL); - virtual void DrawSliderThumb(wxDC& dc, - const wxRect& rect, - wxOrientation orient, - int flags = 0, - long style = 0); - virtual void DrawSliderTicks(wxDC& dc, - const wxRect& rect, - int lenThumb, - wxOrientation orient, - int start, - int end, - int step = 1, - int flags = 0, - long style = 0); -#endif // wxUSE_SLIDER - -#if wxUSE_MENUS - virtual void DrawMenuBarItem(wxDC& dc, - const wxRect& rect, - const wxString& label, - int flags = 0, - int indexAccel = -1); - virtual void DrawMenuItem(wxDC& dc, - wxCoord y, - const wxMenuGeometryInfo& geometryInfo, - const wxString& label, - const wxString& accel, - const wxBitmap& bitmap = wxNullBitmap, - int flags = 0, - int indexAccel = -1); - virtual void DrawMenuSeparator(wxDC& dc, - wxCoord y, - const wxMenuGeometryInfo& geomInfo); -#endif // wxUSE_MENUS - -#if wxUSE_STATUSBAR - virtual void DrawStatusField(wxDC& dc, - const wxRect& rect, - const wxString& label, - int flags = 0, int style = 0); -#endif // wxUSE_STATUSBAR - - virtual void GetComboBitmaps(wxBitmap *bmpNormal, - wxBitmap *bmpFocus, - wxBitmap *bmpPressed, - wxBitmap *bmpDisabled); - - virtual void AdjustSize(wxSize *size, const wxWindow *window); - virtual bool AreScrollbarsInsideBorder() const; - - virtual wxSize GetScrollbarArrowSize() const - { return m_sizeScrollbarArrow; } - - virtual wxSize GetCheckBitmapSize() const - { return wxSize(13, 13); } - virtual wxSize GetRadioBitmapSize() const - { return wxSize(12, 12); } - virtual wxCoord GetCheckItemMargin() const - { return 0; } - -#if wxUSE_TOOLBAR - virtual wxSize GetToolBarButtonSize(wxCoord *separator) const - { if ( separator ) *separator = 5; return wxSize(16, 15); } - virtual wxSize GetToolBarMargin() const - { return wxSize(4, 4); } -#endif // wxUSE_TOOLBAR - -#if wxUSE_TEXTCTRL - virtual wxRect GetTextTotalArea(const wxTextCtrl *text, - const wxRect& rect) const; - virtual wxRect GetTextClientArea(const wxTextCtrl *text, - const wxRect& rect, - wxCoord *extraSpaceBeyond) const; -#endif // wxUSE_TEXTCTRL - -#if wxUSE_NOTEBOOK - virtual wxSize GetTabIndent() const { return wxSize(2, 2); } - virtual wxSize GetTabPadding() const { return wxSize(6, 5); } -#endif // wxUSE_NOTEBOOK - -#if wxUSE_SLIDER - - virtual wxCoord GetSliderDim() const { return SLIDER_THUMB_LENGTH + 2*BORDER_THICKNESS; } - virtual wxCoord GetSliderTickLen() const { return SLIDER_TICK_LENGTH; } - virtual wxRect GetSliderShaftRect(const wxRect& rect, - int lenThumb, - wxOrientation orient, - long style = 0) const; - virtual wxSize GetSliderThumbSize(const wxRect& rect, - int lenThumb, - wxOrientation orient) const; -#endif // wxUSE_SLIDER - - virtual wxSize GetProgressBarStep() const { return wxSize(16, 32); } - -#if wxUSE_MENUS - virtual wxSize GetMenuBarItemSize(const wxSize& sizeText) const; - virtual wxMenuGeometryInfo *GetMenuGeometry(wxWindow *win, - const wxMenu& menu) const; -#endif // wxUSE_MENUS - -protected: - // overridden wxStdRenderer methods - virtual void DrawFrameWithLabel(wxDC& dc, - const wxString& label, - const wxRect& rectFrame, - const wxRect& rectText, - int flags, - int alignment, - int indexAccel); - - virtual void DrawCheckItemBitmap(wxDC& dc, - const wxBitmap& bitmap, - const wxRect& rect, - int flags); - - - // draw the border used for scrollbar arrows - void DrawArrowBorder(wxDC& dc, wxRect *rect, bool isPressed = false); - - // public DrawArrow()s helper - void DrawArrow(wxDC& dc, const wxRect& rect, - ArrowDirection arrowDir, ArrowStyle arrowStyle); - - // DrawArrowButton is used by DrawScrollbar and DrawComboButton - void DrawArrowButton(wxDC& dc, const wxRect& rect, - ArrowDirection arrowDir, - ArrowStyle arrowStyle); - - // draw a normal or transposed line (useful for using the same code fo both - // horizontal and vertical widgets) - void DrawLine(wxDC& dc, - wxCoord x1, wxCoord y1, - wxCoord x2, wxCoord y2, - bool transpose = false) - { - if ( transpose ) - dc.DrawLine(y1, x1, y2, x2); - else - dc.DrawLine(x1, y1, x2, y2); - } - - // get the standard check/radio button bitmap - wxBitmap GetIndicator(IndicatorType indType, int flags); - virtual wxBitmap GetCheckBitmap(int flags) - { return GetIndicator(IndicatorType_Check, flags); } - virtual wxBitmap GetRadioBitmap(int flags) - { return GetIndicator(IndicatorType_Radio, flags); } - - virtual wxBitmap GetFrameButtonBitmap(FrameButtonType type); - -private: - // the sizing parameters (TODO make them changeable) - wxSize m_sizeScrollbarArrow; - - // the checked and unchecked bitmaps for DrawCheckItemBitmap() - wxBitmap m_bmpCheckBitmaps[IndicatorStatus_Max]; - - // the bitmaps returned by GetIndicator() - wxBitmap m_bmpIndicators[IndicatorType_Max] - [IndicatorState_MaxMenu] - [IndicatorStatus_Max]; - - // titlebar icons: - wxBitmap m_bmpFrameButtons[FrameButton_Max]; - - // standard defaults for the above bitmaps - static const char **ms_xpmChecked[IndicatorStatus_Max]; - static const char **ms_xpmIndicators[IndicatorType_Max] - [IndicatorState_MaxMenu] - [IndicatorStatus_Max]; - static const char **ms_xpmFrameButtons[FrameButton_Max]; - - // first row is for the normal state, second - for the disabled - wxBitmap m_bmpArrows[Arrow_StateMax][Arrow_Max]; -}; - -// ---------------------------------------------------------------------------- -// wxWin32InputHandler and derived classes: process the keyboard and mouse -// messages according to Windows standards -// ---------------------------------------------------------------------------- - -class wxWin32InputHandler : public wxInputHandler -{ -public: - wxWin32InputHandler() { } - - virtual bool HandleKey(wxInputConsumer *control, - const wxKeyEvent& event, - bool pressed); - virtual bool HandleMouse(wxInputConsumer *control, - const wxMouseEvent& event); -}; - -#if wxUSE_SCROLLBAR -class wxWin32ScrollBarInputHandler : public wxStdScrollBarInputHandler -{ -public: - wxWin32ScrollBarInputHandler(wxRenderer *renderer, - wxInputHandler *handler); - - virtual bool HandleMouse(wxInputConsumer *control, - const wxMouseEvent& event); - virtual bool HandleMouseMove(wxInputConsumer *control, - const wxMouseEvent& event); - - virtual bool OnScrollTimer(wxScrollBar *scrollbar, - const wxControlAction& action); - -protected: - virtual void Highlight(wxScrollBar * WXUNUSED(scrollbar), - bool WXUNUSED(doIt)) - { - // we don't highlight anything - } - - // the first and last event which caused the thumb to move - wxMouseEvent m_eventStartDrag, - m_eventLastDrag; - - // have we paused the scrolling because the mouse moved? - bool m_scrollPaused; - - // we remember the interval of the timer to be able to restart it - int m_interval; -}; -#endif // wxUSE_SCROLLBAR - -#if wxUSE_CHECKBOX -class wxWin32CheckboxInputHandler : public wxStdInputHandler -{ -public: - wxWin32CheckboxInputHandler(wxInputHandler *handler) - : wxStdInputHandler(handler) { } - - virtual bool HandleKey(wxInputConsumer *control, - const wxKeyEvent& event, - bool pressed); -}; -#endif // wxUSE_CHECKBOX - -#if wxUSE_TEXTCTRL -class wxWin32TextCtrlInputHandler : public wxStdInputHandler -{ -public: - wxWin32TextCtrlInputHandler(wxInputHandler *handler) - : wxStdInputHandler(handler) { } - - virtual bool HandleKey(wxInputConsumer *control, - const wxKeyEvent& event, - bool pressed); -}; -#endif // wxUSE_TEXTCTRL - -class wxWin32StatusBarInputHandler : public wxStdInputHandler -{ -public: - wxWin32StatusBarInputHandler(wxInputHandler *handler); - - virtual bool HandleMouse(wxInputConsumer *consumer, - const wxMouseEvent& event); - - virtual bool HandleMouseMove(wxInputConsumer *consumer, - const wxMouseEvent& event); - -protected: - // is the given point over the statusbar grip? - bool IsOnGrip(wxWindow *statbar, const wxPoint& pt) const; - -private: - // the cursor we had replaced with the resize one - wxCursor m_cursorOld; - - // was the mouse over the grip last time we checked? - bool m_isOnGrip; -}; - -class wxWin32SystemMenuEvtHandler; - -class wxWin32FrameInputHandler : public wxStdInputHandler -{ -public: - wxWin32FrameInputHandler(wxInputHandler *handler); - virtual ~wxWin32FrameInputHandler(); - - virtual bool HandleMouse(wxInputConsumer *control, - const wxMouseEvent& event); - - virtual bool HandleActivation(wxInputConsumer *consumer, bool activated); - -#if wxUSE_MENUS - void PopupSystemMenu(wxTopLevelWindow *window) const; -#endif // wxUSE_MENUS - -private: - // was the mouse over the grip last time we checked? - wxWin32SystemMenuEvtHandler *m_menuHandler; -}; - -// ---------------------------------------------------------------------------- -// wxWin32ColourScheme: uses (default) Win32 colours -// ---------------------------------------------------------------------------- - -class wxWin32ColourScheme : public wxColourScheme -{ -public: - virtual wxColour Get(StdColour col) const; - virtual wxColour GetBackground(wxWindow *win) const; -}; - -// ---------------------------------------------------------------------------- -// wxWin32ArtProvider -// ---------------------------------------------------------------------------- - -class wxWin32ArtProvider : public wxArtProvider -{ -protected: - virtual wxBitmap CreateBitmap(const wxArtID& id, - const wxArtClient& client, - const wxSize& size); -}; - -// ---------------------------------------------------------------------------- -// wxWin32Theme -// ---------------------------------------------------------------------------- - -WX_DEFINE_ARRAY_PTR(wxInputHandler *, wxArrayHandlers); - -class wxWin32Theme : public wxTheme -{ -public: - wxWin32Theme(); - virtual ~wxWin32Theme(); - - virtual wxRenderer *GetRenderer(); - virtual wxArtProvider *GetArtProvider(); - virtual wxInputHandler *GetInputHandler(const wxString& control, - wxInputConsumer *consumer); - virtual wxColourScheme *GetColourScheme(); - -private: - wxWin32Renderer *m_renderer; - - wxWin32ArtProvider *m_artProvider; - - // the names of the already created handlers and the handlers themselves - // (these arrays are synchronized) - wxSortedArrayString m_handlerNames; - wxArrayHandlers m_handlers; - - wxWin32ColourScheme *m_scheme; - - WX_DECLARE_THEME(win32) -}; - -// ---------------------------------------------------------------------------- -// standard bitmaps -// ---------------------------------------------------------------------------- - -// frame buttons bitmaps -static const char *frame_button_close_xpm[] = { -"12 10 2 1", -" c None", -"X c black", -" ", -" XX XX ", -" XX XX ", -" XXXX ", -" XX ", -" XXXX ", -" XX XX ", -" XX XX ", -" ", -" "}; - -static const char *frame_button_help_xpm[] = { -"12 10 2 1", -" c None", -"X c #000000", -" XXXX ", -" XX XX ", -" XX XX ", -" XX ", -" XX ", -" XX ", -" ", -" XX ", -" XX ", -" "}; - -static const char *frame_button_maximize_xpm[] = { -"12 10 2 1", -" c None", -"X c #000000", -" XXXXXXXXX ", -" XXXXXXXXX ", -" X X ", -" X X ", -" X X ", -" X X ", -" X X ", -" X X ", -" XXXXXXXXX ", -" "}; - -static const char *frame_button_minimize_xpm[] = { -"12 10 2 1", -" c None", -"X c #000000", -" ", -" ", -" ", -" ", -" ", -" ", -" ", -" XXXXXX ", -" XXXXXX ", -" "}; - -static const char *frame_button_restore_xpm[] = { -"12 10 2 1", -" c None", -"X c #000000", -" XXXXXX ", -" XXXXXX ", -" X X ", -" XXXXXX X ", -" XXXXXX X ", -" X XXX ", -" X X ", -" X X ", -" XXXXXX ", -" "}; - -const char **wxWin32Renderer::ms_xpmFrameButtons[FrameButton_Max] = -{ - frame_button_close_xpm, - frame_button_minimize_xpm, - frame_button_maximize_xpm, - frame_button_restore_xpm, - frame_button_help_xpm, -}; - -// menu bitmaps - -static const char *checked_menu_xpm[] = { -/* columns rows colors chars-per-pixel */ -"9 9 2 1", -"w c None", -"b c black", -/* pixels */ -"wwwwwwwww", -"wwwwwwwbw", -"wwwwwwbbw", -"wbwwwbbbw", -"wbbwbbbww", -"wbbbbbwww", -"wwbbbwwww", -"wwwbwwwww", -"wwwwwwwww" -}; - -static const char *selected_checked_menu_xpm[] = { -/* columns rows colors chars-per-pixel */ -"9 9 2 1", -"w c None", -"b c white", -/* pixels */ -"wwwwwwwww", -"wwwwwwwbw", -"wwwwwwbbw", -"wbwwwbbbw", -"wbbwbbbww", -"wbbbbbwww", -"wwbbbwwww", -"wwwbwwwww", -"wwwwwwwww" -}; - -static const char *disabled_checked_menu_xpm[] = { -/* columns rows colors chars-per-pixel */ -"9 9 3 1", -"w c None", -"b c #7f7f7f", -"W c #e0e0e0", -/* pixels */ -"wwwwwwwww", -"wwwwwwwbw", -"wwwwwwbbW", -"wbwwwbbbW", -"wbbwbbbWW", -"wbbbbbWWw", -"wwbbbWWww", -"wwwbWWwww", -"wwwwWwwww" -}; - -static const char *selected_disabled_checked_menu_xpm[] = { -/* columns rows colors chars-per-pixel */ -"9 9 2 1", -"w c None", -"b c #7f7f7f", -/* pixels */ -"wwwwwwwww", -"wwwwwwwbw", -"wwwwwwbbw", -"wbwwwbbbw", -"wbbwbbbww", -"wbbbbbwww", -"wwbbbwwww", -"wwwbwwwww", -"wwwwwwwww" -}; - -// checkbox and radiobox bitmaps below - -static const char *checked_xpm[] = { -/* columns rows colors chars-per-pixel */ -"13 13 5 1", -"w c white", -"b c black", -"d c #7f7f7f", -"g c #c0c0c0", -"h c #e0e0e0", -/* pixels */ -"ddddddddddddh", -"dbbbbbbbbbbgh", -"dbwwwwwwwwwgh", -"dbwwwwwwwbwgh", -"dbwwwwwwbbwgh", -"dbwbwwwbbbwgh", -"dbwbbwbbbwwgh", -"dbwbbbbbwwwgh", -"dbwwbbbwwwwgh", -"dbwwwbwwwwwgh", -"dbwwwwwwwwwgh", -"dgggggggggggh", -"hhhhhhhhhhhhh" -}; - -static const char *pressed_checked_xpm[] = { -/* columns rows colors chars-per-pixel */ -"13 13 4 1", -"b c black", -"d c #7f7f7f", -"g c #c0c0c0", -"h c #e0e0e0", -/* pixels */ -"ddddddddddddh", -"dbbbbbbbbbbgh", -"dbggggggggggh", -"dbgggggggbggh", -"dbggggggbbggh", -"dbgbgggbbbggh", -"dbgbbgbbbgggh", -"dbgbbbbbggggh", -"dbggbbbgggggh", -"dbgggbggggggh", -"dbggggggggggh", -"dgggggggggggh", -"hhhhhhhhhhhhh" -}; - -static const char *pressed_disabled_checked_xpm[] = { -/* columns rows colors chars-per-pixel */ -"13 13 4 1", -"b c black", -"d c #7f7f7f", -"g c #c0c0c0", -"h c #e0e0e0", -/* pixels */ -"ddddddddddddh", -"dbbbbbbbbbbgh", -"dbggggggggggh", -"dbgggggggdggh", -"dbggggggddggh", -"dbgdgggdddggh", -"dbgddgdddgggh", -"dbgdddddggggh", -"dbggdddgggggh", -"dbgggdggggggh", -"dbggggggggggh", -"dgggggggggggh", -"hhhhhhhhhhhhh" -}; - -static const char *checked_item_xpm[] = { -/* columns rows colors chars-per-pixel */ -"13 13 3 1", -"w c white", -"b c black", -"d c #808080", -/* pixels */ -"wwwwwwwwwwwww", -"wdddddddddddw", -"wdwwwwwwwwwdw", -"wdwwwwwwwbwdw", -"wdwwwwwwbbwdw", -"wdwbwwwbbbwdw", -"wdwbbwbbbwwdw", -"wdwbbbbbwwwdw", -"wdwwbbbwwwwdw", -"wdwwwbwwwwwdw", -"wdwwwwwwwwwdw", -"wdddddddddddw", -"wwwwwwwwwwwww" -}; - -static const char *unchecked_xpm[] = { -/* columns rows colors chars-per-pixel */ -"13 13 5 1", -"w c white", -"b c black", -"d c #7f7f7f", -"g c #c0c0c0", -"h c #e0e0e0", -/* pixels */ -"ddddddddddddh", -"dbbbbbbbbbbgh", -"dbwwwwwwwwwgh", -"dbwwwwwwwwwgh", -"dbwwwwwwwwwgh", -"dbwwwwwwwwwgh", -"dbwwwwwwwwwgh", -"dbwwwwwwwwwgh", -"dbwwwwwwwwwgh", -"dbwwwwwwwwwgh", -"dbwwwwwwwwwgh", -"dgggggggggggh", -"hhhhhhhhhhhhh" -}; - -static const char *pressed_unchecked_xpm[] = { -/* columns rows colors chars-per-pixel */ -"13 13 4 1", -"b c black", -"d c #7f7f7f", -"g c #c0c0c0", -"h c #e0e0e0", -/* pixels */ -"ddddddddddddh", -"dbbbbbbbbbbgh", -"dbggggggggggh", -"dbggggggggggh", -"dbggggggggggh", -"dbggggggggggh", -"dbggggggggggh", -"dbggggggggggh", -"dbggggggggggh", -"dbggggggggggh", -"dbggggggggggh", -"dbggggggggggh", -"hhhhhhhhhhhhh" -}; - -static const char *unchecked_item_xpm[] = { -/* columns rows colors chars-per-pixel */ -"13 13 2 1", -"w c white", -"d c #808080", -/* pixels */ -"wwwwwwwwwwwww", -"wdddddddddddw", -"wdwwwwwwwwwdw", -"wdwwwwwwwwwdw", -"wdwwwwwwwwwdw", -"wdwwwwwwwwwdw", -"wdwwwwwwwwwdw", -"wdwwwwwwwwwdw", -"wdwwwwwwwwwdw", -"wdwwwwwwwwwdw", -"wdwwwwwwwwwdw", -"wdddddddddddw", -"wwwwwwwwwwwww" -}; - -static const char *undetermined_xpm[] = { -/* columns rows colors chars-per-pixel */ -"13 13 5 1", -"A c #030303", -"B c #838383", -"C c #C3C3C3", -"D c #FBFBFB", -"E c #DBDBDB", -/* pixels */ -"BBBBBBBBBBBBD", -"BAAAAAAAAAAED", -"BACDCDCDCDCED", -"BADCDCDCDBDED", -"BACDCDCDBBCED", -"BADBDCEBBBDED", -"BACBBDBBBDCED", -"BADBBBBBDCDED", -"BACDBBBDCDCED", -"BADCDBDCDCDED", -"BACDCDCDCDCED", -"BEEEEEEEEEEED", -"DDDDDDDDDDDDD" -}; - -static const char *pressed_undetermined_xpm[] = { -/* columns rows colors chars-per-pixel */ -"13 13 5 1", -"A c #040404", -"B c #848484", -"C c #C4C4C4", -"D c #FCFCFC", -"E c #DCDCDC", -/* pixels */ -"BBBBBBBBBBBBD", -"BAAAAAAAAAAED", -"BACCCCCCCCCCD", -"BACCCCCCCACED", -"BACCCCCCAACED", -"BACACCCAAACED", -"BACAACAAACCED", -"BACAAAAACCCED", -"BACCAAACCCCCD", -"BACCCACCCCCED", -"BACCCCCCCCCED", -"BEEEEEEEEEEED", -"DDDDDDDDDDDDD" -}; - -static const char *checked_radio_xpm[] = { -/* columns rows colors chars-per-pixel */ -"12 12 6 1", -" c None", -"w c white", -"b c black", -"d c #7f7f7f", -"g c #c0c0c0", -"h c #e0e0e0", -/* pixels */ -" dddd ", -" ddbbbbdd ", -" dbbwwwwbbh ", -" dbwwwwwwgh ", -"dbwwwbbwwwgh", -"dbwwbbbbwwgh", -"dbwwbbbbwwgh", -"dbwwwbbwwwgh", -" dbwwwwwwgh ", -" dggwwwwggh ", -" hhgggghh ", -" hhhh " -}; - -static const char *pressed_checked_radio_xpm[] = { -/* columns rows colors chars-per-pixel */ -"12 12 6 1", -" c None", -"w c white", -"b c black", -"d c #7f7f7f", -"g c #c0c0c0", -"h c #e0e0e0", -/* pixels */ -" dddd ", -" ddbbbbdd ", -" dbbggggbbh ", -" dbgggggggh ", -"dbgggbbggggh", -"dbggbbbbgggh", -"dbggbbbbgggh", -"dbgggbbggggh", -" dbgggggggh ", -" dggggggggh ", -" hhgggghh ", -" hhhh " -}; - -static const char *pressed_disabled_checked_radio_xpm[] = { -/* columns rows colors chars-per-pixel */ -"12 12 6 1", -" c None", -"w c white", -"b c black", -"d c #7f7f7f", -"g c #c0c0c0", -"h c #e0e0e0", -/* pixels */ -" dddd ", -" ddbbbbdd ", -" dbbggggbbh ", -" dbgggggggh ", -"dbgggddggggh", -"dbggddddgggh", -"dbggddddgggh", -"dbgggddggggh", -" dbgggggggh ", -" dggggggggh ", -" hhgggghh ", -" hhhh ", -}; - -static const char *unchecked_radio_xpm[] = { -/* columns rows colors chars-per-pixel */ -"12 12 6 1", -" c None", -"w c white", -"b c black", -"d c #7f7f7f", -"g c #c0c0c0", -"h c #e0e0e0", -/* pixels */ -" dddd ", -" ddbbbbdd ", -" dbbwwwwbbh ", -" dbwwwwwwgh ", -"dbwwwwwwwwgh", -"dbwwwwwwwwgh", -"dbwwwwwwwwgh", -"dbwwwwwwwwgh", -" dbwwwwwwgh ", -" dggwwwwggh ", -" hhgggghh ", -" hhhh " -}; - -static const char *pressed_unchecked_radio_xpm[] = { -/* columns rows colors chars-per-pixel */ -"12 12 6 1", -" c None", -"w c white", -"b c black", -"d c #7f7f7f", -"g c #c0c0c0", -"h c #e0e0e0", -/* pixels */ -" dddd ", -" ddbbbbdd ", -" dbbggggbbh ", -" dbgggggggh ", -"dbgggggggggh", -"dbgggggggggh", -"dbgggggggggh", -"dbgggggggggh", -" dbgggggggh ", -" dggggggggh ", -" hhgggghh ", -" hhhh " -}; - -const char **wxWin32Renderer::ms_xpmIndicators[IndicatorType_Max] - [IndicatorState_MaxMenu] - [IndicatorStatus_Max] = -{ - // checkboxes first - { - // normal state - { checked_xpm, unchecked_xpm, undetermined_xpm }, - - // pressed state - { pressed_checked_xpm, pressed_unchecked_xpm, pressed_undetermined_xpm }, - - // disabled state - { pressed_disabled_checked_xpm, pressed_unchecked_xpm, pressed_disabled_checked_xpm }, - }, - - // radio - { - // normal state - { checked_radio_xpm, unchecked_radio_xpm, NULL }, - - // pressed state - { pressed_checked_radio_xpm, pressed_unchecked_radio_xpm, NULL }, - - // disabled state - { pressed_disabled_checked_radio_xpm, pressed_unchecked_radio_xpm, NULL }, - }, - - // menu - { - // normal state - { checked_menu_xpm, NULL, NULL }, - - // selected state - { selected_checked_menu_xpm, NULL, NULL }, - - // disabled state - { disabled_checked_menu_xpm, NULL, NULL }, - - // disabled selected state - { selected_disabled_checked_menu_xpm, NULL, NULL }, - } -}; - -const char **wxWin32Renderer::ms_xpmChecked[IndicatorStatus_Max] = -{ - checked_item_xpm, - unchecked_item_xpm -}; - -// ============================================================================ -// implementation -// ============================================================================ - -WX_IMPLEMENT_THEME(wxWin32Theme, win32, wxTRANSLATE("Win32 theme")); - -// ---------------------------------------------------------------------------- -// wxWin32Theme -// ---------------------------------------------------------------------------- - -wxWin32Theme::wxWin32Theme() -{ - m_scheme = NULL; - m_renderer = NULL; - m_artProvider = NULL; -} - -wxWin32Theme::~wxWin32Theme() -{ - delete m_renderer; - delete m_scheme; - delete m_artProvider; -} - -wxRenderer *wxWin32Theme::GetRenderer() -{ - if ( !m_renderer ) - { - m_renderer = new wxWin32Renderer(GetColourScheme()); - } - - return m_renderer; -} - -wxArtProvider *wxWin32Theme::GetArtProvider() -{ - if ( !m_artProvider ) - { - m_artProvider = new wxWin32ArtProvider; - } - - return m_artProvider; -} - -wxInputHandler * -wxWin32Theme::GetInputHandler(const wxString& control, - wxInputConsumer *consumer) -{ - wxInputHandler *handler = NULL; - int n = m_handlerNames.Index(control); - if ( n == wxNOT_FOUND ) - { - static wxWin32InputHandler s_handlerDef; - - wxInputHandler * const - handlerStd = consumer->DoGetStdInputHandler(&s_handlerDef); - - // create a new handler - if ( control == wxINP_HANDLER_TOPLEVEL ) - { - static wxWin32FrameInputHandler s_handler(handlerStd); - - handler = &s_handler; - } -#if wxUSE_CHECKBOX - else if ( control == wxINP_HANDLER_CHECKBOX ) - { - static wxWin32CheckboxInputHandler s_handler(handlerStd); - - handler = &s_handler; - } -#endif // wxUSE_CHECKBOX -#if wxUSE_SCROLLBAR - else if ( control == wxINP_HANDLER_SCROLLBAR ) - { - static wxWin32ScrollBarInputHandler - s_handler(GetRenderer(), handlerStd); - - handler = &s_handler; - } -#endif // wxUSE_SCROLLBAR -#if wxUSE_STATUSBAR - else if ( control == wxINP_HANDLER_STATUSBAR ) - { - static wxWin32StatusBarInputHandler s_handler(handlerStd); - - handler = &s_handler; - } -#endif // wxUSE_STATUSBAR -#if wxUSE_TEXTCTRL - else if ( control == wxINP_HANDLER_TEXTCTRL ) - { - static wxWin32TextCtrlInputHandler s_handler(handlerStd); - - handler = &s_handler; - } -#endif // wxUSE_TEXTCTRL - else // no special handler for this control - { - handler = handlerStd; - } - - n = m_handlerNames.Add(control); - m_handlers.Insert(handler, n); - } - else // we already have it - { - handler = m_handlers[n]; - } - - return handler; -} - -wxColourScheme *wxWin32Theme::GetColourScheme() -{ - if ( !m_scheme ) - { - m_scheme = new wxWin32ColourScheme; - } - return m_scheme; -} - -// ============================================================================ -// wxWin32ColourScheme -// ============================================================================ - -wxColour wxWin32ColourScheme::GetBackground(wxWindow *win) const -{ - wxColour col; - if ( win->UseBgCol() ) - { - // use the user specified colour - col = win->GetBackgroundColour(); - } - - if ( !win->ShouldInheritColours() ) - { -#if wxUSE_TEXTCTRL - wxTextCtrl *text = wxDynamicCast(win, wxTextCtrl); -#endif // wxUSE_TEXTCTRL -#if wxUSE_LISTBOX - wxListBox* listBox = wxDynamicCast(win, wxListBox); -#endif // wxUSE_LISTBOX - -#if wxUSE_TEXTCTRL - if ( text -#if wxUSE_LISTBOX - || listBox -#endif - ) - { - if ( !win->IsEnabled() ) // not IsEditable() - col = Get(CONTROL); - else - { - if ( !col.Ok() ) - { - // doesn't depend on the state - col = Get(WINDOW); - } - } - } -#endif // wxUSE_TEXTCTRL - - if (!col.Ok()) - col = Get(CONTROL); // Most controls should be this colour, not WINDOW - } - else - { - int flags = win->GetStateFlags(); - - // the colour set by the user should be used for the normal state - // and for the states for which we don't have any specific colours - if ( !col.Ok() || (flags & wxCONTROL_PRESSED) != 0 ) - { -#if wxUSE_SCROLLBAR - if ( wxDynamicCast(win, wxScrollBar) ) - col = Get(flags & wxCONTROL_PRESSED ? SCROLLBAR_PRESSED - : SCROLLBAR); - else -#endif // wxUSE_SCROLLBAR - col = Get(CONTROL); - } - } - - return col; -} - -wxColour wxWin32ColourScheme::Get(wxWin32ColourScheme::StdColour col) const -{ - switch ( col ) - { - // use the system colours under Windows -#if defined(__WXMSW__) - case WINDOW: return wxColour(GetSysColor(COLOR_WINDOW)); - - case CONTROL_PRESSED: - case CONTROL_CURRENT: - case CONTROL: return wxColour(GetSysColor(COLOR_BTNFACE)); - - case CONTROL_TEXT: return wxColour(GetSysColor(COLOR_BTNTEXT)); - -#if defined(COLOR_3DLIGHT) - case SCROLLBAR: return wxColour(GetSysColor(COLOR_3DLIGHT)); -#else - case SCROLLBAR: return wxColour(0xe0e0e0); -#endif - case SCROLLBAR_PRESSED: return wxColour(GetSysColor(COLOR_BTNTEXT)); - - case HIGHLIGHT: return wxColour(GetSysColor(COLOR_HIGHLIGHT)); - case HIGHLIGHT_TEXT: return wxColour(GetSysColor(COLOR_HIGHLIGHTTEXT)); - -#if defined(COLOR_3DDKSHADOW) - case SHADOW_DARK: return wxColour(GetSysColor(COLOR_3DDKSHADOW)); -#else - case SHADOW_DARK: return wxColour(GetSysColor(COLOR_3DHADOW)); -#endif - - case CONTROL_TEXT_DISABLED: - case SHADOW_HIGHLIGHT: return wxColour(GetSysColor(COLOR_BTNHIGHLIGHT)); - - case SHADOW_IN: return wxColour(GetSysColor(COLOR_BTNFACE)); - - case CONTROL_TEXT_DISABLED_SHADOW: - case SHADOW_OUT: return wxColour(GetSysColor(COLOR_BTNSHADOW)); - - case TITLEBAR: return wxColour(GetSysColor(COLOR_INACTIVECAPTION)); - case TITLEBAR_ACTIVE: return wxColour(GetSysColor(COLOR_ACTIVECAPTION)); - case TITLEBAR_TEXT: return wxColour(GetSysColor(COLOR_INACTIVECAPTIONTEXT)); - case TITLEBAR_ACTIVE_TEXT: return wxColour(GetSysColor(COLOR_CAPTIONTEXT)); - - case DESKTOP: return wxColour(0x808000); - case FRAME: return wxColour(GetSysColor(COLOR_APPWORKSPACE)); -#else // !__WXMSW__ - // use the standard Windows colours elsewhere - case WINDOW: return *wxWHITE; - - case CONTROL_PRESSED: - case CONTROL_CURRENT: - case CONTROL: return wxColour(0xc0c0c0); - - case CONTROL_TEXT: return *wxBLACK; - - case SCROLLBAR: return wxColour(0xe0e0e0); - case SCROLLBAR_PRESSED: return *wxBLACK; - - case HIGHLIGHT: return wxColour(0x800000); - case HIGHLIGHT_TEXT: return wxColour(0xffffff); - - case SHADOW_DARK: return *wxBLACK; - - case CONTROL_TEXT_DISABLED:return wxColour(0xe0e0e0); - case SHADOW_HIGHLIGHT: return wxColour(0xffffff); - - case SHADOW_IN: return wxColour(0xc0c0c0); - - case CONTROL_TEXT_DISABLED_SHADOW: - case SHADOW_OUT: return wxColour(0x7f7f7f); - - case TITLEBAR: return wxColour(0xaeaaae); - case TITLEBAR_ACTIVE: return wxColour(0x820300); - case TITLEBAR_TEXT: return wxColour(0xc0c0c0); - case TITLEBAR_ACTIVE_TEXT:return *wxWHITE; - - case DESKTOP: return wxColour(0x808000); - case FRAME: return wxColour(0x808080); -#endif // __WXMSW__ - - case GAUGE: return Get(HIGHLIGHT); - - case MAX: - default: - wxFAIL_MSG(_T("invalid standard colour")); - return *wxBLACK; - } -} - -// ============================================================================ -// wxWin32Renderer -// ============================================================================ - -// ---------------------------------------------------------------------------- -// construction -// ---------------------------------------------------------------------------- - -wxWin32Renderer::wxWin32Renderer(const wxColourScheme *scheme) - : wxStdRenderer(scheme) -{ - // init data - m_sizeScrollbarArrow = wxSize(16, 16); - - // init the arrow bitmaps - static const size_t ARROW_WIDTH = 7; - static const size_t ARROW_LENGTH = 4; - - wxMask *mask; - wxMemoryDC dcNormal, - dcDisabled, - dcInverse; - for ( size_t n = 0; n < Arrow_Max; n++ ) - { - bool isVertical = n > Arrow_Right; - int w, h; - if ( isVertical ) - { - w = ARROW_WIDTH; - h = ARROW_LENGTH; - } - else - { - h = ARROW_WIDTH; - w = ARROW_LENGTH; - } - - // disabled arrow is larger because of the shadow - m_bmpArrows[Arrow_Normal][n].Create(w, h); - m_bmpArrows[Arrow_Disabled][n].Create(w + 1, h + 1); - - dcNormal.SelectObject(m_bmpArrows[Arrow_Normal][n]); - dcDisabled.SelectObject(m_bmpArrows[Arrow_Disabled][n]); - - dcNormal.SetBackground(*wxWHITE_BRUSH); - dcDisabled.SetBackground(*wxWHITE_BRUSH); - dcNormal.Clear(); - dcDisabled.Clear(); - - dcNormal.SetPen(m_penBlack); - dcDisabled.SetPen(m_penDarkGrey); - - // calculate the position of the point of the arrow - wxCoord x1, y1; - if ( isVertical ) - { - x1 = (ARROW_WIDTH - 1)/2; - y1 = n == Arrow_Up ? 0 : ARROW_LENGTH - 1; - } - else // horizontal - { - x1 = n == Arrow_Left ? 0 : ARROW_LENGTH - 1; - y1 = (ARROW_WIDTH - 1)/2; - } - - wxCoord x2 = x1, - y2 = y1; - - if ( isVertical ) - x2++; - else - y2++; - - for ( size_t i = 0; i < ARROW_LENGTH; i++ ) - { - dcNormal.DrawLine(x1, y1, x2, y2); - dcDisabled.DrawLine(x1, y1, x2, y2); - - if ( isVertical ) - { - x1--; - x2++; - - if ( n == Arrow_Up ) - { - y1++; - y2++; - } - else // down arrow - { - y1--; - y2--; - } - } - else // left or right arrow - { - y1--; - y2++; - - if ( n == Arrow_Left ) - { - x1++; - x2++; - } - else - { - x1--; - x2--; - } - } - } - - // draw the shadow for the disabled one - dcDisabled.SetPen(m_penHighlight); - switch ( n ) - { - case Arrow_Left: - y1 += 2; - dcDisabled.DrawLine(x1, y1, x2, y2); - break; - - case Arrow_Right: - x1 = ARROW_LENGTH - 1; - y1 = (ARROW_WIDTH - 1)/2 + 1; - x2 = 0; - y2 = ARROW_WIDTH; - dcDisabled.DrawLine(x1, y1, x2, y2); - dcDisabled.DrawLine(++x1, y1, x2, ++y2); - break; - - case Arrow_Up: - x1 += 2; - dcDisabled.DrawLine(x1, y1, x2, y2); - break; - - case Arrow_Down: - x1 = ARROW_WIDTH - 1; - y1 = 1; - x2 = (ARROW_WIDTH - 1)/2; - y2 = ARROW_LENGTH; - dcDisabled.DrawLine(x1, y1, x2, y2); - dcDisabled.DrawLine(++x1, y1, x2, ++y2); - break; - - } - - // create the inverted bitmap but only for the right arrow as we only - // use it for the menus - if ( n == Arrow_Right ) - { - m_bmpArrows[Arrow_Inverted][n].Create(w, h); - dcInverse.SelectObject(m_bmpArrows[Arrow_Inverted][n]); - dcInverse.Clear(); - dcInverse.Blit(0, 0, w, h, - &dcNormal, 0, 0, - wxXOR); - dcInverse.SelectObject(wxNullBitmap); - - mask = new wxMask(m_bmpArrows[Arrow_Inverted][n], *wxBLACK); - m_bmpArrows[Arrow_Inverted][n].SetMask(mask); - - m_bmpArrows[Arrow_InvertedDisabled][n].Create(w, h); - dcInverse.SelectObject(m_bmpArrows[Arrow_InvertedDisabled][n]); - dcInverse.Clear(); - dcInverse.Blit(0, 0, w, h, - &dcDisabled, 0, 0, - wxXOR); - dcInverse.SelectObject(wxNullBitmap); - - mask = new wxMask(m_bmpArrows[Arrow_InvertedDisabled][n], *wxBLACK); - m_bmpArrows[Arrow_InvertedDisabled][n].SetMask(mask); - } - - dcNormal.SelectObject(wxNullBitmap); - dcDisabled.SelectObject(wxNullBitmap); - - mask = new wxMask(m_bmpArrows[Arrow_Normal][n], *wxWHITE); - m_bmpArrows[Arrow_Normal][n].SetMask(mask); - mask = new wxMask(m_bmpArrows[Arrow_Disabled][n], *wxWHITE); - m_bmpArrows[Arrow_Disabled][n].SetMask(mask); - - m_bmpArrows[Arrow_Pressed][n] = m_bmpArrows[Arrow_Normal][n]; - } -} - -bool wxWin32Renderer::AreScrollbarsInsideBorder() const -{ - return true; -} - -// ---------------------------------------------------------------------------- -// label -// ---------------------------------------------------------------------------- - -void wxWin32Renderer::DrawLabel(wxDC& dc, - const wxString& label, - const wxRect& rect, - int flags, - int alignment, - int indexAccel, - wxRect *rectBounds) -{ - // the underscores are not drawn for focused controls in wxMSW - if ( flags & wxCONTROL_FOCUSED ) - { - indexAccel = -1; - } - - if ( flags & wxCONTROL_DISABLED ) - { - // the combination of wxCONTROL_SELECTED and wxCONTROL_DISABLED - // currently only can happen for a menu item and it seems that Windows - // doesn't draw the shadow in this case, so we don't do it neither - if ( flags & wxCONTROL_SELECTED ) - { - // just make the label text greyed out - dc.SetTextForeground(m_penDarkGrey.GetColour()); - - flags &= ~wxCONTROL_DISABLED; - } - } - - wxStdRenderer::DrawLabel(dc, label, rect, flags, alignment, - indexAccel, rectBounds); -} - -void wxWin32Renderer::DrawFrameWithLabel(wxDC& dc, - const wxString& label, - const wxRect& rectFrame, - const wxRect& rectText, - int flags, - int alignment, - int indexAccel) -{ - wxString label2; - label2 << _T(' ') << label << _T(' '); - if ( indexAccel != -1 ) - { - // adjust it as we prepended a space - indexAccel++; - } - - wxStdRenderer::DrawFrameWithLabel(dc, label2, rectFrame, rectText, - flags, alignment, indexAccel); -} - -void wxWin32Renderer::DrawButtonLabel(wxDC& dc, - const wxString& label, - const wxBitmap& image, - const wxRect& rect, - int flags, - int alignment, - int indexAccel, - wxRect *rectBounds) -{ - // the underscores are not drawn for focused controls in wxMSW - if ( flags & wxCONTROL_PRESSED ) - { - indexAccel = -1; - } - - wxStdRenderer::DrawButtonLabel(dc, label, image, rect, flags, alignment, - indexAccel, rectBounds); -} - -void wxWin32Renderer::DrawButtonBorder(wxDC& dc, - const wxRect& rectTotal, - int flags, - wxRect *rectIn) -{ - wxRect rect = rectTotal; - - wxPen penOut(*wxBLACK); - if ( flags & wxCONTROL_PRESSED ) - { - // button pressed: draw a double border around it - DrawRect(dc, &rect, penOut); - DrawRect(dc, &rect, m_penDarkGrey); - } - else // button not pressed - { - if ( flags & (wxCONTROL_FOCUSED | wxCONTROL_ISDEFAULT) ) - { - // button either default or focused (or both): add an extra border - // around it - DrawRect(dc, &rect, penOut); - } - - // now draw a normal button border - DrawRaisedBorder(dc, &rect); - } - - if ( rectIn ) - *rectIn = rect; -} - -// ---------------------------------------------------------------------------- -// (check)listbox items -// ---------------------------------------------------------------------------- - -void wxWin32Renderer::DrawCheckItemBitmap(wxDC& dc, - const wxBitmap& bitmap, - const wxRect& rect, - int flags) -{ - wxBitmap bmp; - if ( bitmap.Ok() ) - { - bmp = bitmap; - } - else // use default bitmap - { - IndicatorStatus i = flags & wxCONTROL_CHECKED - ? IndicatorStatus_Checked - : IndicatorStatus_Unchecked; - - if ( !m_bmpCheckBitmaps[i].Ok() ) - { - m_bmpCheckBitmaps[i] = wxBitmap(ms_xpmChecked[i]); - } - - bmp = m_bmpCheckBitmaps[i]; - } - - dc.DrawBitmap(bmp, rect.x, rect.y + (rect.height - bmp.GetHeight()) / 2 - 1, - true /* use mask */); -} - -// ---------------------------------------------------------------------------- -// check/radio buttons -// ---------------------------------------------------------------------------- - -wxBitmap wxWin32Renderer::GetIndicator(IndicatorType indType, int flags) -{ - IndicatorState indState; - IndicatorStatus indStatus; - GetIndicatorsFromFlags(flags, indState, indStatus); - - wxBitmap& bmp = m_bmpIndicators[indType][indState][indStatus]; - if ( !bmp.Ok() ) - { - const char **xpm = ms_xpmIndicators[indType][indState][indStatus]; - if ( xpm ) - { - // create and cache it - bmp = wxBitmap(xpm); - } - } - - return bmp; -} - -// ---------------------------------------------------------------------------- -// toolbar stuff -// ---------------------------------------------------------------------------- - -#if wxUSE_TOOLBAR -void wxWin32Renderer::DrawToolBarButton(wxDC& dc, - const wxString& label, - const wxBitmap& bitmap, - const wxRect& rectOrig, - int flags, - long style, - int tbarStyle) -{ - if (style == wxTOOL_STYLE_BUTTON) - { - wxRect rect = rectOrig; - rect.Deflate(BORDER_THICKNESS); - - if ( flags & wxCONTROL_PRESSED ) - { - DrawBorder(dc, wxBORDER_SUNKEN, rect, flags); - } - else if ( flags & wxCONTROL_CURRENT ) - { - DrawBorder(dc, wxBORDER_RAISED, rect, flags); - } - - if(tbarStyle & wxTB_TEXT) - { - if(tbarStyle & wxTB_HORIZONTAL) - { - dc.DrawLabel(label, bitmap, rect, wxALIGN_CENTRE); - } - else - { - dc.DrawLabel(label, bitmap, rect, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL); - } - } - else - { - int xpoint = (rect.GetLeft() + rect.GetRight() + 1 - bitmap.GetWidth()) / 2; - int ypoint = (rect.GetTop() + rect.GetBottom() + 1 - bitmap.GetHeight()) / 2; - dc.DrawBitmap(bitmap, xpoint, ypoint, bitmap.GetMask() != NULL); - } - } - else if (style == wxTOOL_STYLE_SEPARATOR) - { - // leave a small gap aroudn the line, also account for the toolbar - // border itself - if(rectOrig.height > rectOrig.width) - { - // horizontal - DrawVerticalLine(dc, rectOrig.x + rectOrig.width/2, - rectOrig.y + 2*BORDER_THICKNESS, - rectOrig.GetBottom() - BORDER_THICKNESS); - } - else - { - // vertical - DrawHorizontalLine(dc, rectOrig.y + rectOrig.height/2, - rectOrig.x + 2*BORDER_THICKNESS, - rectOrig.GetRight() - BORDER_THICKNESS); - } - } - // don't draw wxTOOL_STYLE_CONTROL -} -#endif // wxUSE_TOOLBAR - -// ---------------------------------------------------------------------------- -// notebook -// ---------------------------------------------------------------------------- - -#if wxUSE_NOTEBOOK - -void wxWin32Renderer::DrawTab(wxDC& dc, - const wxRect& rectOrig, - wxDirection dir, - const wxString& label, - const wxBitmap& bitmap, - int flags, - int indexAccel) -{ - #define SELECT_FOR_VERTICAL(X,Y) ( isVertical ? Y : X ) - #define REVERSE_FOR_VERTICAL(X,Y) \ - SELECT_FOR_VERTICAL(X,Y) \ - , \ - SELECT_FOR_VERTICAL(Y,X) - - wxRect rect = rectOrig; - - bool isVertical = ( dir == wxLEFT ) || ( dir == wxRIGHT ); - - // the current tab is drawn indented (to the top for default case) and - // bigger than the other ones - const wxSize indent = GetTabIndent(); - if ( flags & wxCONTROL_SELECTED ) - { - rect.Inflate( SELECT_FOR_VERTICAL( indent.x , 0), - SELECT_FOR_VERTICAL( 0, indent.y )); - switch ( dir ) - { - default: - wxFAIL_MSG(_T("invaild notebook tab orientation")); - // fall through - - case wxTOP: - rect.y -= indent.y; - // fall through - case wxBOTTOM: - rect.height += indent.y; - break; - - case wxLEFT: - rect.x -= indent.x; - // fall through - case wxRIGHT: - rect.width += indent.x; - break; - } - } - - // draw the text, image and the focus around them (if necessary) - wxRect rectLabel( REVERSE_FOR_VERTICAL(rect.x,rect.y), - REVERSE_FOR_VERTICAL(rect.width,rect.height) - ); - rectLabel.Deflate(1, 1); - if ( isVertical ) - { - // draw it horizontally into memory and rotate for screen - wxMemoryDC dcMem; - wxBitmap bitmapRotated, - bitmapMem( rectLabel.x + rectLabel.width, - rectLabel.y + rectLabel.height ); - dcMem.SelectObject(bitmapMem); - dcMem.SetBackground(dc.GetBackground()); - dcMem.SetFont(dc.GetFont()); - dcMem.SetTextForeground(dc.GetTextForeground()); - dcMem.Clear(); - bitmapRotated = -#if wxUSE_IMAGE - wxBitmap( wxImage( bitmap.ConvertToImage() ).Rotate90(dir==wxLEFT) ) -#else - bitmap -#endif // wxUSE_IMAGE - ; - DrawButtonLabel(dcMem, label, bitmapRotated, rectLabel, - flags, wxALIGN_CENTRE, indexAccel); - dcMem.SelectObject(wxNullBitmap); - bitmapMem = bitmapMem.GetSubBitmap(rectLabel); -#if wxUSE_IMAGE - bitmapMem = wxBitmap(wxImage(bitmapMem.ConvertToImage()).Rotate90(dir==wxRIGHT)); -#endif // wxUSE_IMAGE - dc.DrawBitmap(bitmapMem, rectLabel.y, rectLabel.x, false); - } - else - { - DrawButtonLabel(dc, label, bitmap, rectLabel, - flags, wxALIGN_CENTRE, indexAccel); - } - - // now draw the tab border itself (maybe use DrawRoundedRectangle()?) - static const wxCoord CUTOFF = 2; // radius of the rounded corner - wxCoord x = SELECT_FOR_VERTICAL(rect.x,rect.y), - y = SELECT_FOR_VERTICAL(rect.y,rect.x), - x2 = SELECT_FOR_VERTICAL(rect.GetRight(),rect.GetBottom()), - y2 = SELECT_FOR_VERTICAL(rect.GetBottom(),rect.GetRight()); - - // FIXME: all this code will break if the tab indent or the border width, - // it is tied to the fact that both of them are equal to 2 - switch ( dir ) - { - default: - // default is top - case wxLEFT: - // left orientation looks like top but IsVertical makes x and y reversed - case wxTOP: - // top is not vertical so use coordinates in written order - dc.SetPen(m_penHighlight); - dc.DrawLine(REVERSE_FOR_VERTICAL(x, y2), - REVERSE_FOR_VERTICAL(x, y + CUTOFF)); - dc.DrawLine(REVERSE_FOR_VERTICAL(x, y + CUTOFF), - REVERSE_FOR_VERTICAL(x + CUTOFF, y)); - dc.DrawLine(REVERSE_FOR_VERTICAL(x + CUTOFF, y), - REVERSE_FOR_VERTICAL(x2 - CUTOFF + 1, y)); - - dc.SetPen(m_penBlack); - dc.DrawLine(REVERSE_FOR_VERTICAL(x2, y2), - REVERSE_FOR_VERTICAL(x2, y + CUTOFF)); - dc.DrawLine(REVERSE_FOR_VERTICAL(x2, y + CUTOFF), - REVERSE_FOR_VERTICAL(x2 - CUTOFF, y)); - - dc.SetPen(m_penDarkGrey); - dc.DrawLine(REVERSE_FOR_VERTICAL(x2 - 1, y2), - REVERSE_FOR_VERTICAL(x2 - 1, y + CUTOFF - 1)); - - if ( flags & wxCONTROL_SELECTED ) - { - dc.SetPen(m_penLightGrey); - - // overwrite the part of the border below this tab - dc.DrawLine(REVERSE_FOR_VERTICAL(x + 1, y2 + 1), - REVERSE_FOR_VERTICAL(x2 - 1, y2 + 1)); - - // and the shadow of the tab to the left of us - dc.DrawLine(REVERSE_FOR_VERTICAL(x + 1, y + CUTOFF + 1), - REVERSE_FOR_VERTICAL(x + 1, y2 + 1)); - } - break; - - case wxRIGHT: - // right orientation looks like bottom but IsVertical makes x and y reversed - case wxBOTTOM: - // bottom is not vertical so use coordinates in written order - dc.SetPen(m_penHighlight); - // we need to continue one pixel further to overwrite the corner of - // the border for the selected tab - dc.DrawLine(REVERSE_FOR_VERTICAL(x, y - (flags & wxCONTROL_SELECTED ? 1 : 0)), - REVERSE_FOR_VERTICAL(x, y2 - CUTOFF)); - dc.DrawLine(REVERSE_FOR_VERTICAL(x, y2 - CUTOFF), - REVERSE_FOR_VERTICAL(x + CUTOFF, y2)); - - dc.SetPen(m_penBlack); - dc.DrawLine(REVERSE_FOR_VERTICAL(x + CUTOFF, y2), - REVERSE_FOR_VERTICAL(x2 - CUTOFF + 1, y2)); - dc.DrawLine(REVERSE_FOR_VERTICAL(x2, y), - REVERSE_FOR_VERTICAL(x2, y2 - CUTOFF)); - dc.DrawLine(REVERSE_FOR_VERTICAL(x2, y2 - CUTOFF), - REVERSE_FOR_VERTICAL(x2 - CUTOFF, y2)); - - dc.SetPen(m_penDarkGrey); - dc.DrawLine(REVERSE_FOR_VERTICAL(x + CUTOFF, y2 - 1), - REVERSE_FOR_VERTICAL(x2 - CUTOFF + 1, y2 - 1)); - dc.DrawLine(REVERSE_FOR_VERTICAL(x2 - 1, y), - REVERSE_FOR_VERTICAL(x2 - 1, y2 - CUTOFF + 1)); - - if ( flags & wxCONTROL_SELECTED ) - { - dc.SetPen(m_penLightGrey); - - // overwrite the part of the (double!) border above this tab - dc.DrawLine(REVERSE_FOR_VERTICAL(x + 1, y - 1), - REVERSE_FOR_VERTICAL(x2 - 1, y - 1)); - dc.DrawLine(REVERSE_FOR_VERTICAL(x + 1, y - 2), - REVERSE_FOR_VERTICAL(x2 - 1, y - 2)); - - // and the shadow of the tab to the left of us - dc.DrawLine(REVERSE_FOR_VERTICAL(x + 1, y2 - CUTOFF), - REVERSE_FOR_VERTICAL(x + 1, y - 1)); - } - break; - } - - #undef SELECT_FOR_VERTICAL - #undef REVERSE_FOR_VERTICAL -} - -#endif // wxUSE_NOTEBOOK - -#if wxUSE_SLIDER - -// ---------------------------------------------------------------------------- -// slider -// ---------------------------------------------------------------------------- - -wxSize -wxWin32Renderer::GetSliderThumbSize(const wxRect& WXUNUSED(rect), - int lenThumb, - wxOrientation orient) const -{ - wxSize size; - wxCoord width = wxMax (lenThumb, SLIDER_THUMB_LENGTH) / 2; - wxCoord height = wxMax (lenThumb, SLIDER_THUMB_LENGTH); - - if (orient == wxHORIZONTAL) - { - size.x = width; - size.y = height; - } - else - { // == wxVERTICAL - size.x = height; - size.y = width; - } - - return size; -} - -wxRect wxWin32Renderer::GetSliderShaftRect(const wxRect& rectOrig, - int lenThumb, - wxOrientation orient, - long style) const -{ - bool transpose = (orient == wxVERTICAL); - bool left = ((style & wxSL_AUTOTICKS) != 0) & - (((style & wxSL_TOP) != 0) & !transpose | - ((style & wxSL_LEFT) != 0) & transpose | - ((style & wxSL_BOTH) != 0)); - bool right = ((style & wxSL_AUTOTICKS) != 0) & - (((style & wxSL_BOTTOM) != 0) & !transpose | - ((style & wxSL_RIGHT) != 0) & transpose | - ((style & wxSL_BOTH) != 0)); - - wxRect rect = rectOrig; - - wxSize sizeThumb = GetSliderThumbSize (rect, lenThumb, orient); - - if (orient == wxHORIZONTAL) { - rect.x += SLIDER_MARGIN; - if (left & right) - { - rect.y += wxMax ((rect.height - 2*BORDER_THICKNESS) / 2, sizeThumb.y/2); - } - else if (left) - { - rect.y += wxMax ((rect.height - 2*BORDER_THICKNESS - sizeThumb.y/2), sizeThumb.y/2); - } - else - { - rect.y += sizeThumb.y/2; - } - rect.width -= 2*SLIDER_MARGIN; - rect.height = 2*BORDER_THICKNESS; - } - else - { // == wxVERTICAL - rect.y += SLIDER_MARGIN; - if (left & right) - { - rect.x += wxMax ((rect.width - 2*BORDER_THICKNESS) / 2, sizeThumb.x/2); - } - else if (left) - { - rect.x += wxMax ((rect.width - 2*BORDER_THICKNESS - sizeThumb.x/2), sizeThumb.x/2); - } - else - { - rect.x += sizeThumb.x/2; - } - rect.width = 2*BORDER_THICKNESS; - rect.height -= 2*SLIDER_MARGIN; - } - - return rect; -} - -void wxWin32Renderer::DrawSliderShaft(wxDC& dc, - const wxRect& rectOrig, - int lenThumb, - wxOrientation orient, - int flags, - long style, - wxRect *rectShaft) -{ - /* show shaft geometry - - shaft - +-------------+ - | | - | XXX | <-- x1 - | XXX | - | XXX | - | XXX | - | XXX | <-- x2 - | | - +-------------+ - - ^ ^ - | | - y1 y2 - */ - - if (flags & wxCONTROL_FOCUSED) { - DrawFocusRect(dc, rectOrig); - } - - wxRect rect = GetSliderShaftRect(rectOrig, lenThumb, orient, style); - - if (rectShaft) *rectShaft = rect; - - DrawSunkenBorder(dc, &rect); -} - -void wxWin32Renderer::DrawSliderThumb(wxDC& dc, - const wxRect& rect, - wxOrientation orient, - int flags, - long style) -{ - /* show thumb geometry - - H <--- y1 - H H B - H H B - H H B <--- y3 - H D B - H D B - H D B - H D B where H is highlight colour - H D B D dark grey - H D B B black - H D B - H D B - H D B <--- y4 - H D B - H D B - B <--- y2 - - ^ ^ ^ - | | | - x1 x3 x2 - - The interior of this shape is filled with the hatched brush if the thumb - is pressed. - */ - - DrawBackground(dc, wxNullColour, rect, flags); - - bool transpose = (orient == wxVERTICAL); - bool left = ((style & wxSL_AUTOTICKS) != 0) & - (((style & wxSL_TOP) != 0) & !transpose | - ((style & wxSL_LEFT) != 0) & transpose) & - ((style & wxSL_BOTH) == 0); - bool right = ((style & wxSL_AUTOTICKS) != 0) & - (((style & wxSL_BOTTOM) != 0) & !transpose | - ((style & wxSL_RIGHT) != 0) & transpose) & - ((style & wxSL_BOTH) == 0); - - wxCoord sizeArrow = (transpose ? rect.height : rect.width) / 2; - wxCoord c = ((transpose ? rect.height : rect.width) - 2*sizeArrow); - - wxCoord x1, x2, x3, y1, y2, y3, y4; - x1 = (transpose ? rect.y : rect.x); - x2 = (transpose ? rect.GetBottom() : rect.GetRight()); - x3 = (x1-1+c) + sizeArrow; - y1 = (transpose ? rect.x : rect.y); - y2 = (transpose ? rect.GetRight() : rect.GetBottom()); - y3 = (left ? (y1-1+c) + sizeArrow : y1); - y4 = (right ? (y2+1-c) - sizeArrow : y2); - - dc.SetPen(m_penBlack); - if (left) { - DrawLine(dc, x3+1-c, y1, x2, y3, transpose); - } - DrawLine(dc, x2, y3, x2, y4, transpose); - if (right) - { - DrawLine(dc, x3+1-c, y2, x2, y4, transpose); - } - else - { - DrawLine(dc, x1, y2, x2, y2, transpose); - } - - dc.SetPen(m_penDarkGrey); - DrawLine(dc, x2-1, y3+1, x2-1, y4-1, transpose); - if (right) { - DrawLine(dc, x3+1-c, y2-1, x2-1, y4, transpose); - } - else - { - DrawLine(dc, x1+1, y2-1, x2-1, y2-1, transpose); - } - - dc.SetPen(m_penHighlight); - if (left) - { - DrawLine(dc, x1, y3, x3, y1, transpose); - DrawLine(dc, x3+1-c, y1+1, x2-1, y3, transpose); - } - else - { - DrawLine(dc, x1, y1, x2, y1, transpose); - } - DrawLine(dc, x1, y3, x1, y4, transpose); - if (right) - { - DrawLine(dc, x1, y4, x3+c, y2+c, transpose); - } - - if (flags & wxCONTROL_PRESSED) { - // TODO: MSW fills the entire area inside, not just the rect - wxRect rectInt = rect; - if ( transpose ) - { - rectInt.SetLeft(y3); - rectInt.SetRight(y4); - } - else - { - rectInt.SetTop(y3); - rectInt.SetBottom(y4); - } - rectInt.Deflate(2); - -#if !defined(__WXMGL__) - static const char *stipple_xpm[] = { - /* columns rows colors chars-per-pixel */ - "2 2 2 1", - " c None", - "w c white", - /* pixels */ - "w ", - " w", - }; -#else - // VS: MGL can only do 8x8 stipple brushes - static const char *stipple_xpm[] = { - /* columns rows colors chars-per-pixel */ - "8 8 2 1", - " c None", - "w c white", - /* pixels */ - "w w w w ", - " w w w w", - "w w w w ", - " w w w w", - "w w w w ", - " w w w w", - "w w w w ", - " w w w w", - }; -#endif - dc.SetBrush(wxBrush(stipple_xpm)); - - dc.SetTextForeground(wxSCHEME_COLOUR(m_scheme, SHADOW_HIGHLIGHT)); - dc.SetTextBackground(wxSCHEME_COLOUR(m_scheme, CONTROL)); - dc.SetPen(*wxTRANSPARENT_PEN); - dc.DrawRectangle(rectInt); - } -} - -void wxWin32Renderer::DrawSliderTicks(wxDC& dc, - const wxRect& rect, - int lenThumb, - wxOrientation orient, - int start, - int end, - int step, - int WXUNUSED(flags), - long style) -{ - /* show ticks geometry - - left right - ticks shaft ticks - ---- XX ---- <-- x1 - ---- XX ---- - ---- XX ---- - ---- XX ---- <-- x2 - - ^ ^ ^ ^ - | | | | - y3 y1 y2 y4 - */ - - // empty slider? - if (end == start) return; - - bool transpose = (orient == wxVERTICAL); - bool left = ((style & wxSL_AUTOTICKS) != 0) & - (((style & wxSL_TOP) != 0) & !transpose | - ((style & wxSL_LEFT) != 0) & transpose | - ((style & wxSL_BOTH) != 0)); - bool right = ((style & wxSL_AUTOTICKS) != 0) & - (((style & wxSL_BOTTOM) != 0) & !transpose | - ((style & wxSL_RIGHT) != 0) & transpose | - ((style & wxSL_BOTH) != 0)); - - // default thumb size - wxSize sizeThumb = GetSliderThumbSize (rect, 0, orient); - wxCoord defaultLen = (transpose ? sizeThumb.x : sizeThumb.y); - - // normal thumb size - sizeThumb = GetSliderThumbSize (rect, lenThumb, orient); - wxCoord widthThumb = (transpose ? sizeThumb.y : sizeThumb.x); - - wxRect rectShaft = GetSliderShaftRect (rect, lenThumb, orient, style); - - wxCoord x1, x2, y1, y2, y3, y4 , len; - x1 = (transpose ? rectShaft.y : rectShaft.x) + widthThumb/2; - x2 = (transpose ? rectShaft.GetBottom() : rectShaft.GetRight()) - widthThumb/2; - y1 = (transpose ? rectShaft.x : rectShaft.y) - defaultLen/2; - y2 = (transpose ? rectShaft.GetRight() : rectShaft.GetBottom()) + defaultLen/2; - y3 = (transpose ? rect.x : rect.y); - y4 = (transpose ? rect.GetRight() : rect.GetBottom()); - len = x2 - x1; - - dc.SetPen(m_penBlack); - - int range = end - start; - for ( int n = 0; n < range; n += step ) { - wxCoord x = x1 + (len*n) / range; - - if (left & (y1 > y3)) { - DrawLine(dc, x, y1, x, y3, orient == wxVERTICAL); - } - if (right & (y4 > y2)) { - DrawLine(dc, x, y2, x, y4, orient == wxVERTICAL); - } - } - // always draw the line at the end position - if (left & (y1 > y3)) { - DrawLine(dc, x2, y1, x2, y3, orient == wxVERTICAL); - } - if (right & (y4 > y2)) { - DrawLine(dc, x2, y2, x2, y4, orient == wxVERTICAL); - } -} - -#endif // wxUSE_SLIDER - -#if wxUSE_MENUS - -// ---------------------------------------------------------------------------- -// menu and menubar -// ---------------------------------------------------------------------------- - -// wxWin32MenuGeometryInfo: the wxMenuGeometryInfo used by wxWin32Renderer -class WXDLLEXPORT wxWin32MenuGeometryInfo : public wxMenuGeometryInfo -{ -public: - virtual wxSize GetSize() const { return m_size; } - - wxCoord GetLabelOffset() const { return m_ofsLabel; } - wxCoord GetAccelOffset() const { return m_ofsAccel; } - - wxCoord GetItemHeight() const { return m_heightItem; } - -private: - // the total size of the menu - wxSize m_size; - - // the offset of the start of the menu item label - wxCoord m_ofsLabel; - - // the offset of the start of the accel label - wxCoord m_ofsAccel; - - // the height of a normal (not separator) item - wxCoord m_heightItem; - - friend wxMenuGeometryInfo * - wxWin32Renderer::GetMenuGeometry(wxWindow *, const wxMenu&) const; -}; - -// FIXME: all constants are hardcoded but shouldn't be -static const wxCoord MENU_LEFT_MARGIN = 9; -static const wxCoord MENU_RIGHT_MARGIN = 18; -static const wxCoord MENU_VERT_MARGIN = 3; - -// the margin around bitmap/check marks (on each side) -static const wxCoord MENU_BMP_MARGIN = 2; - -// the margin between the labels and accel strings -static const wxCoord MENU_ACCEL_MARGIN = 8; - -// the separator height in pixels: in fact, strangely enough, the real height -// is 2 but Windows adds one extra pixel in the bottom margin, so take it into -// account here -static const wxCoord MENU_SEPARATOR_HEIGHT = 3; - -// the size of the standard checkmark bitmap -static const wxCoord MENU_CHECK_SIZE = 9; - -void wxWin32Renderer::DrawMenuBarItem(wxDC& dc, - const wxRect& rectOrig, - const wxString& label, - int flags, - int indexAccel) -{ - wxRect rect = rectOrig; - rect.height--; - - wxDCTextColourChanger colChanger(dc); - - if ( flags & wxCONTROL_SELECTED ) - { - colChanger.Set(wxSCHEME_COLOUR(m_scheme, HIGHLIGHT_TEXT)); - - const wxColour colBg = wxSCHEME_COLOUR(m_scheme, HIGHLIGHT); - dc.SetBrush(colBg); - dc.SetPen(colBg); - dc.DrawRectangle(rect); - } - - // don't draw the focus rect around menu bar items - DrawLabel(dc, label, rect, flags & ~wxCONTROL_FOCUSED, - wxALIGN_CENTRE, indexAccel); -} - -void wxWin32Renderer::DrawMenuItem(wxDC& dc, - wxCoord y, - const wxMenuGeometryInfo& gi, - const wxString& label, - const wxString& accel, - const wxBitmap& bitmap, - int flags, - int indexAccel) -{ - const wxWin32MenuGeometryInfo& geometryInfo = - (const wxWin32MenuGeometryInfo&)gi; - - wxRect rect; - rect.x = 0; - rect.y = y; - rect.width = geometryInfo.GetSize().x; - rect.height = geometryInfo.GetItemHeight(); - - // draw the selected item specially - wxDCTextColourChanger colChanger(dc); - if ( flags & wxCONTROL_SELECTED ) - { - colChanger.Set(wxSCHEME_COLOUR(m_scheme, HIGHLIGHT_TEXT)); - - const wxColour colBg = wxSCHEME_COLOUR(m_scheme, HIGHLIGHT); - dc.SetBrush(colBg); - dc.SetPen(colBg); - dc.DrawRectangle(rect); - } - - // draw the bitmap: use the bitmap provided or the standard checkmark for - // the checkable items - wxBitmap bmp = bitmap; - if ( !bmp.Ok() && (flags & wxCONTROL_CHECKED) ) - { - bmp = GetIndicator(IndicatorType_Menu, flags); - } - - if ( bmp.Ok() ) - { - rect.SetRight(geometryInfo.GetLabelOffset()); - wxControlRenderer::DrawBitmap(dc, bmp, rect); - } - - // draw the label - rect.x = geometryInfo.GetLabelOffset(); - rect.SetRight(geometryInfo.GetAccelOffset()); - - DrawLabel(dc, label, rect, flags, wxALIGN_CENTRE_VERTICAL, indexAccel); - - // draw the accel string - rect.x = geometryInfo.GetAccelOffset(); - rect.SetRight(geometryInfo.GetSize().x); - - // NB: no accel index here - DrawLabel(dc, accel, rect, flags, wxALIGN_CENTRE_VERTICAL); - - // draw the submenu indicator - if ( flags & wxCONTROL_ISSUBMENU ) - { - rect.x = geometryInfo.GetSize().x - MENU_RIGHT_MARGIN; - rect.width = MENU_RIGHT_MARGIN; - - ArrowStyle arrowStyle; - if ( flags & wxCONTROL_DISABLED ) - arrowStyle = flags & wxCONTROL_SELECTED ? Arrow_InvertedDisabled - : Arrow_Disabled; - else if ( flags & wxCONTROL_SELECTED ) - arrowStyle = Arrow_Inverted; - else - arrowStyle = Arrow_Normal; - - DrawArrow(dc, rect, Arrow_Right, arrowStyle); - } -} - -void wxWin32Renderer::DrawMenuSeparator(wxDC& dc, - wxCoord y, - const wxMenuGeometryInfo& geomInfo) -{ - DrawHorizontalLine(dc, y + MENU_VERT_MARGIN, 0, geomInfo.GetSize().x); -} - -wxSize wxWin32Renderer::GetMenuBarItemSize(const wxSize& sizeText) const -{ - wxSize size = sizeText; - - // FIXME: menubar height is configurable under Windows - size.x += 12; - size.y += 6; - - return size; -} - -wxMenuGeometryInfo *wxWin32Renderer::GetMenuGeometry(wxWindow *win, - const wxMenu& menu) const -{ - // prepare the dc: for now we draw all the items with the system font - wxClientDC dc(win); - dc.SetFont(wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT)); - - // the height of a normal item - wxCoord heightText = dc.GetCharHeight(); - - // the total height - wxCoord height = 0; - - // the max length of label and accel strings: the menu width is the sum of - // them, even if they're for different items (as the accels should be - // aligned) - // - // the max length of the bitmap is never 0 as Windows always leaves enough - // space for a check mark indicator - wxCoord widthLabelMax = 0, - widthAccelMax = 0, - widthBmpMax = MENU_LEFT_MARGIN; - - for ( wxMenuItemList::compatibility_iterator node = menu.GetMenuItems().GetFirst(); - node; - node = node->GetNext() ) - { - // height of this item - wxCoord h; - - wxMenuItem *item = node->GetData(); - if ( item->IsSeparator() ) - { - h = MENU_SEPARATOR_HEIGHT; - } - else // not separator - { - h = heightText; - - wxCoord widthLabel; - dc.GetTextExtent(item->GetLabel(), &widthLabel, NULL); - if ( widthLabel > widthLabelMax ) - { - widthLabelMax = widthLabel; - } - - wxCoord widthAccel; - dc.GetTextExtent(item->GetAccelString(), &widthAccel, NULL); - if ( widthAccel > widthAccelMax ) - { - widthAccelMax = widthAccel; - } - - const wxBitmap& bmp = item->GetBitmap(); - if ( bmp.Ok() ) - { - wxCoord widthBmp = bmp.GetWidth(); - if ( widthBmp > widthBmpMax ) - widthBmpMax = widthBmp; - } - //else if ( item->IsCheckable() ): no need to check for this as - // MENU_LEFT_MARGIN is big enough to show the check mark - } - - h += 2*MENU_VERT_MARGIN; - - // remember the item position and height - item->SetGeometry(height, h); - - height += h; - } - - // bundle the metrics into a struct and return it - wxWin32MenuGeometryInfo *gi = new wxWin32MenuGeometryInfo; - - gi->m_ofsLabel = widthBmpMax + 2*MENU_BMP_MARGIN; - gi->m_ofsAccel = gi->m_ofsLabel + widthLabelMax; - if ( widthAccelMax > 0 ) - { - // if we actually have any accesl, add a margin - gi->m_ofsAccel += MENU_ACCEL_MARGIN; - } - - gi->m_heightItem = heightText + 2*MENU_VERT_MARGIN; - - gi->m_size.x = gi->m_ofsAccel + widthAccelMax + MENU_RIGHT_MARGIN; - gi->m_size.y = height; - - return gi; -} - -#endif // wxUSE_MENUS - -#if wxUSE_STATUSBAR - -// ---------------------------------------------------------------------------- -// status bar -// ---------------------------------------------------------------------------- - -void wxWin32Renderer::DrawStatusField(wxDC& dc, - const wxRect& rect, - const wxString& label, - int flags, - int style) -{ - wxRect rectIn; - - if ( flags & wxCONTROL_SIZEGRIP ) - { - // draw the size grip: it is a normal rect except that in the lower - // right corner we have several bands which may be used for dragging - // the status bar corner - // - // each band consists of 4 stripes: m_penHighlight, double - // m_penDarkGrey and transparent one - wxCoord x2 = rect.GetRight(), - y2 = rect.GetBottom(); - - // draw the upper left part of the rect normally - if (style != wxSB_FLAT) - { - if (style == wxSB_RAISED) - dc.SetPen(m_penHighlight); - else - dc.SetPen(m_penDarkGrey); - dc.DrawLine(rect.GetLeft(), rect.GetTop(), rect.GetLeft(), y2); - dc.DrawLine(rect.GetLeft() + 1, rect.GetTop(), x2, rect.GetTop()); - } - - // draw the grey stripes of the grip - size_t n; - wxCoord ofs = WIDTH_STATUSBAR_GRIP_BAND - 1; - for ( n = 0; n < NUM_STATUSBAR_GRIP_BANDS; n++, ofs += WIDTH_STATUSBAR_GRIP_BAND ) - { - dc.DrawLine(x2 - ofs + 1, y2 - 1, x2, y2 - ofs); - dc.DrawLine(x2 - ofs, y2 - 1, x2, y2 - ofs - 1); - } - - // draw the white stripes - dc.SetPen(m_penHighlight); - ofs = WIDTH_STATUSBAR_GRIP_BAND + 1; - for ( n = 0; n < NUM_STATUSBAR_GRIP_BANDS; n++, ofs += WIDTH_STATUSBAR_GRIP_BAND ) - { - dc.DrawLine(x2 - ofs + 1, y2 - 1, x2, y2 - ofs); - } - - // draw the remaining rect boundaries - if (style != wxSB_FLAT) - { - if (style == wxSB_RAISED) - dc.SetPen(m_penDarkGrey); - else - dc.SetPen(m_penHighlight); - ofs -= WIDTH_STATUSBAR_GRIP_BAND; - dc.DrawLine(x2, rect.GetTop(), x2, y2 - ofs + 1); - dc.DrawLine(rect.GetLeft(), y2, x2 - ofs + 1, y2); - } - - rectIn = rect; - rectIn.Deflate(1); - - rectIn.width -= STATUSBAR_GRIP_SIZE; - - // this will prevent the standard version from drawing any borders - style = wxSB_FLAT; - } - - wxStdRenderer::DrawStatusField(dc, rect, label, flags, style); -} - -#endif // wxUSE_STATUSBAR - -// ---------------------------------------------------------------------------- -// combobox -// ---------------------------------------------------------------------------- - -void wxWin32Renderer::GetComboBitmaps(wxBitmap *bmpNormal, - wxBitmap * WXUNUSED(bmpFocus), - wxBitmap *bmpPressed, - wxBitmap *bmpDisabled) -{ - static const wxCoord widthCombo = 16; - static const wxCoord heightCombo = 17; - - wxMemoryDC dcMem; - - if ( bmpNormal ) - { - bmpNormal->Create(widthCombo, heightCombo); - dcMem.SelectObject(*bmpNormal); - DrawArrowButton(dcMem, wxRect(0, 0, widthCombo, heightCombo), - Arrow_Down, Arrow_Normal); - } - - if ( bmpPressed ) - { - bmpPressed->Create(widthCombo, heightCombo); - dcMem.SelectObject(*bmpPressed); - DrawArrowButton(dcMem, wxRect(0, 0, widthCombo, heightCombo), - Arrow_Down, Arrow_Pressed); - } - - if ( bmpDisabled ) - { - bmpDisabled->Create(widthCombo, heightCombo); - dcMem.SelectObject(*bmpDisabled); - DrawArrowButton(dcMem, wxRect(0, 0, widthCombo, heightCombo), - Arrow_Down, Arrow_Disabled); - } -} - -// ---------------------------------------------------------------------------- -// scrollbar -// ---------------------------------------------------------------------------- - -void wxWin32Renderer::DrawArrowBorder(wxDC& dc, wxRect *rect, bool isPressed) -{ - if ( isPressed ) - { - DrawRect(dc, rect, m_penDarkGrey); - - // the arrow is usually drawn inside border of width 2 and is offset by - // another pixel in both directions when it's pressed - as the border - // in this case is more narrow as well, we have to adjust rect like - // this: - rect->Inflate(-1); - rect->x++; - rect->y++; - } - else // !pressed - { - DrawAntiSunkenBorder(dc, rect); - } -} - -void wxWin32Renderer::DrawArrow(wxDC& dc, - wxDirection dir, - const wxRect& rect, - int flags) -{ - ArrowStyle arrowStyle; - if ( flags & wxCONTROL_PRESSED ) - { - // can't be pressed and disabled - arrowStyle = Arrow_Pressed; - } - else - { - arrowStyle = flags & wxCONTROL_DISABLED ? Arrow_Disabled : Arrow_Normal; - } - - DrawArrowButton(dc, rect, GetArrowDirection(dir), arrowStyle); -} - -void wxWin32Renderer::DrawArrow(wxDC& dc, - const wxRect& rect, - ArrowDirection arrowDir, - ArrowStyle arrowStyle) -{ - const wxBitmap& bmp = m_bmpArrows[arrowStyle][arrowDir]; - - // under Windows the arrows always have the same size so just centre it in - // the provided rectangle - wxCoord x = rect.x + (rect.width - bmp.GetWidth()) / 2, - y = rect.y + (rect.height - bmp.GetHeight()) / 2; - - // Windows does it like this... - if ( arrowDir == Arrow_Left ) - x--; - - // draw it - dc.DrawBitmap(bmp, x, y, true /* use mask */); -} - -void wxWin32Renderer::DrawArrowButton(wxDC& dc, - const wxRect& rectAll, - ArrowDirection arrowDir, - ArrowStyle arrowStyle) -{ - wxRect rect = rectAll; - DrawBackground(dc, wxSCHEME_COLOUR(m_scheme, CONTROL), rect); - DrawArrowBorder(dc, &rect, arrowStyle == Arrow_Pressed); - DrawArrow(dc, rect, arrowDir, arrowStyle); -} - -void wxWin32Renderer::DrawScrollbarThumb(wxDC& dc, - wxOrientation WXUNUSED(orient), - const wxRect& rect, - int WXUNUSED(flags)) -{ - // we don't use the flags, the thumb never changes appearance - wxRect rectThumb = rect; - DrawArrowBorder(dc, &rectThumb); - DrawBackground(dc, wxNullColour, rectThumb); -} - -void wxWin32Renderer::DrawScrollbarShaft(wxDC& dc, - wxOrientation WXUNUSED(orient), - const wxRect& rectBar, - int flags) -{ - wxColourScheme::StdColour col = flags & wxCONTROL_PRESSED - ? wxColourScheme::SCROLLBAR_PRESSED - : wxColourScheme::SCROLLBAR; - DrawBackground(dc, m_scheme->Get(col), rectBar); -} - -// ---------------------------------------------------------------------------- -// standard icons -// ---------------------------------------------------------------------------- - -/* Copyright (c) Julian Smart */ -static char *error_xpm[]={ -/* columns rows colors chars-per-pixel */ -"32 32 70 1", -"- c #BF0101", -"b c #361F1F", -"& c #C08484", -"X c #BF3333", -"# c #C08181", -"% c #C01111", -"d c #C51515", -"s c #551818", -"O c #C07E7E", -": c #C00E0E", -"u c #E28A8A", -"2 c #C81F1F", -"8 c #FFFFFF", -"p c #E59494", -"< c #BB0101", -"y c #DA6A6A", -"A c #4C4C4C", -"9 c #F7DFDF", -"@ c #BF5353", -"w c #FAE9E9", -"F c #272727", -"5 c #D24A4A", -". c #C06363", -"n c #BF8282", -"7 c #F2C9C9", -"t c #C09292", -"M c #3E3E3E", -"x c #4D4D4D", -"4 c #CA2A2A", -"h c #E79F9F", -"* c #C05454", -"D c #711212", -"V c #737373", -"$ c #BF3232", -"N c #900B0B", -"6 c #BD0303", -"3 c #DF7F7F", -"K c #6F1212", -"C c #BD0000", -"m c #950909", -"P c #8A8A8A", -"j c #D75F5F", -" c None", -"e c #F4D4D4", -"S c #BF2020", -"L c #747474", -"G c #842C2C", -"c c #ECB4B4", -"l c #2E2121", -"g c #BF7E7E", -"k c #9B0808", -"= c #BF0505", -"a c #B10303", -"q c #7E2020", -"1 c #642222", -"J c #676767", -"B c #322020", -"; c #C00303", -"i c #242424", -"o c #C00000", -"> c #BF1F1F", -", c #842B2B", -"f c #701212", -"0 c #BE0000", -"r c #960909", -"H c #686868", -"v c #BC0000", -"Z c #671414", -"+ c #C02020", -"z c #CD3535", -/* pixels */ -" ", -" ", -" .XoooOO ", -" .+ooooooooo@# ", -" $oooooooooooo%& ", -" *=-ooooooooooooo;: ", -" *oooooooooooooooooo> ", -" =ooooooooooooooooooo, ", -" $-ooooooooooooooooooo<1 ", -" .oooooo2334ooo533oooooo6 ", -" +ooooooo789oo2883oooooo0q ", -" oooooooo2w83o78eoooooooor ", -" toooooooooy88u884oooooooori ", -" Xooooooooooe888poooooooooas ", -" ooooooooooo4889doooooooooof ", -" ooooooooooo588w2oooooooooofi ", -" oooooooooodw8887oooooooooofi ", -" goooooooooh8w588jooooooookli ", -" tooooooooz885op8wdooooooorix ", -" oooooood98cood98cooooooori ", -" @oooooop8w2ooo5885ooooovbi ", -" n%ooooooooooooooooooooomiM ", -" &;oooooooooooooooooooNBiV ", -" :ooooooooooooooooooCZiA ", -" nSooooooooooooooooCDiF ", -" nG c #2D32F5", -"o c #CBCCFD", -"# c #0309F3", -"@ c #8C8FFA", -"$ c #EAEBFE", -/* pixels */ -" ....... ", -" ...XXXXXXX... ", -" ..XXXXXXXXXXXXX.. ", -" .XXXXXXXXXXXXXXXXX. ", -" .XXXXXXXXoO+XXXXXXXX. ", -" .XXXXXXXXX@#OXXXXXXXXX. ", -" .XXXXXXXXXX$@oXXXXXXXXXX. ", -" .XXXXXXXXXXXXXXXXXXXXXXX.% ", -" .XXXXXXXXX&*=-XXXXXXXXXX.%% ", -".XXXXXXXXXX;:#>XXXXXXXXXXX.% ", -".XXXXXXXXXXX;#+XXXXXXXXXXX.% ", -".XXXXXXXXXXX;#+XXXXXXXXXXX.%% ", -" .XXXXXXXXXX;#+XXXXXXXXXX.%%% ", -" .XXXXXXXXXX;#+XXXXXXXXXX.%%% ", -" .XXXXXXXXXX;#+XXXXXXXXXX.%% ", -" .XXXXXXXX*-##+XXXXXXXX.%%% ", -" .XXXXXXXXXXXXXXXXXXX.%%%% ", -" .XXXXXXXXXXXXXXXXX.%%%% ", -" ..XXXXXXXXXXXXX..%%%% ", -" %...XXXXXXXX..%%%%% ", -" %%%..XXXXXX.%%%%% ", -" %%%.XXXXX.%%% ", -" %.XXXX.%% ", -" .XXX.%% ", -" .XX.%% ", -" .X.%% ", -" ..%% ", -" .%% ", -" %% ", -" % ", -" ", -" " -}; - -/* Copyright (c) Julian Smart */ -static char *question_xpm[]={ -/* columns rows colors chars-per-pixel */ -"32 32 16 1", -"O c #A3A3FF", -"X c #FFFFFF", -"% c #CACAFF", -"- c #4141FF", -"= c #6060FF", -"* c #2B2BFF", -"@ c #B5B5FF", -" c None", -"# c #1616FF", -"+ c #8181FF", -"$ c #0000FF", -". c #C0C0C0", -"; c #5555FF", -": c #242424", -"o c #E7E7FF", -"& c #7575FF", -/* pixels */ -" ....... ", -" ...XXXXXXX... ", -" ..XXXXXXXXXXXXX.. ", -" .XXXXXXoO++@XXXXXX. ", -" .XXXXXXO#$$$$#%XXXXX. ", -" .XXXXXX@$$#&&#$#oXXXXX. ", -" .XXXXXXX*$$%XX%$$=XXXXXX. ", -" .XXXXXXX+-;XXXX$$-XXXXXX.: ", -" .XXXXXXXXXXXXX+$$&XXXXXX.:: ", -".XXXXXXXXXXXXo;$$*oXXXXXXX.: ", -".XXXXXXXXXXXo*$$*oXXXXXXXX.: ", -".XXXXXXXXXXX+$$*oXXXXXXXXX.:: ", -" .XXXXXXXXXX-$$oXXXXXXXXX.::: ", -" .XXXXXXXXXXX--XXXXXXXXXX.::: ", -" .XXXXXXXXXXXXXXXXXXXXXXX.:: ", -" .XXXXXXXXX-$$XXXXXXXXX.::: ", -" .XXXXXXXX-$$XXXXXXXX.:::: ", -" .XXXXXXXO++XXXXXXX.:::: ", -" ..XXXXXXXXXXXXX..:::: ", -" :...XXXXXXXX..::::: ", -" :::..XXXXXX.::::: ", -" :::.XXXXX.::: ", -" :.XXXX.:: ", -" .XXX.:: ", -" .XX.:: ", -" .X.:: ", -" ..:: ", -" .:: ", -" :: ", -" : ", -" ", -" " -}; - -/* Copyright (c) Julian Smart */ -static char *warning_xpm[]={ -/* columns rows colors chars-per-pixel */ -"32 32 9 1", -"@ c Black", -"o c #A6A800", -"+ c #8A8C00", -"$ c #B8BA00", -" c None", -"O c #6E7000", -"X c #DCDF00", -". c #C00000", -"# c #373800", -/* pixels */ -" ", -" ", -" ", -" . ", -" ... ", -" ... ", -" ..... ", -" ...X.. ", -" ..XXX.. ", -" ...XXX... ", -" ..XXXXX.. ", -" ..XXXXXX... ", -" ...XXoO+XX.. ", -" ..XXXO@#XXX.. ", -" ..XXXXO@#XXX... ", -" ...XXXXO@#XXXX.. ", -" ..XXXXXO@#XXXX... ", -" ...XXXXXo@OXXXXX.. ", -" ...XXXXXXo@OXXXXXX.. ", -" ..XXXXXXX$@OXXXXXX... ", -" ...XXXXXXXX@XXXXXXXX.. ", -" ...XXXXXXXXXXXXXXXXXX... ", -" ..XXXXXXXXXXOXXXXXXXXX.. ", -" ...XXXXXXXXXO@#XXXXXXXXX.. ", -" ..XXXXXXXXXXX#XXXXXXXXXX... ", -" ...XXXXXXXXXXXXXXXXXXXXXXX.. ", -" ...XXXXXXXXXXXXXXXXXXXXXXXX... ", -" .............................. ", -" .............................. ", -" ", -" ", -" " -}; - - -wxBitmap wxWin32ArtProvider::CreateBitmap(const wxArtID& id, - const wxArtClient& WXUNUSED(client), - const wxSize& WXUNUSED(size)) -{ - if ( id == wxART_INFORMATION ) - return wxBitmap(info_xpm); - if ( id == wxART_ERROR ) - return wxBitmap(error_xpm); - if ( id == wxART_WARNING ) - return wxBitmap(warning_xpm); - if ( id == wxART_QUESTION ) - return wxBitmap(question_xpm); - return wxNullBitmap; -} - - -#if wxUSE_TEXTCTRL - -// ---------------------------------------------------------------------------- -// text control geometry -// ---------------------------------------------------------------------------- - -wxRect -wxWin32Renderer::GetTextTotalArea(const wxTextCtrl *text, - const wxRect& rect) const -{ - wxRect rectTotal = wxStdRenderer::GetTextTotalArea(text, rect); - - // this is strange but it's what Windows does - rectTotal.height++; - - return rectTotal; -} - -wxRect -wxWin32Renderer::GetTextClientArea(const wxTextCtrl *text, - const wxRect& rect, - wxCoord *extraSpaceBeyond) const -{ - wxRect rectText = rect; - - // undo GetTextTotalArea() - if ( rectText.height > 0 ) - rectText.height--; - - return wxStdRenderer::GetTextClientArea(text, rect, extraSpaceBeyond); -} - -#endif // wxUSE_TEXTCTRL - -// ---------------------------------------------------------------------------- -// size adjustments -// ---------------------------------------------------------------------------- - -void wxWin32Renderer::AdjustSize(wxSize *size, const wxWindow *window) -{ -#if wxUSE_SCROLLBAR - if ( wxDynamicCast(window, wxScrollBar) ) - { - // we only set the width of vert scrollbars and height of the - // horizontal ones - if ( window->GetWindowStyle() & wxSB_HORIZONTAL ) - size->y = m_sizeScrollbarArrow.y; - else - size->x = m_sizeScrollbarArrow.x; - - // skip border width adjustments, they don't make sense for us - return; - } -#endif // wxUSE_SCROLLBAR - -#if wxUSE_BMPBUTTON - if ( wxDynamicCast(window, wxBitmapButton) ) - { - // do nothing - } else -#endif // wxUSE_BMPBUTTON -#if wxUSE_BUTTON || wxUSE_TOGGLEBTN - if ( 0 -# if wxUSE_BUTTON - || wxDynamicCast(window, wxButton) -# endif // wxUSE_BUTTON -# if wxUSE_TOGGLEBTN - || wxDynamicCast(window, wxToggleButton) -# endif // wxUSE_TOGGLEBTN - ) - { - if ( !(window->GetWindowStyle() & wxBU_EXACTFIT) ) - { - // TODO: don't harcode all this - size->x += 3*window->GetCharWidth(); - - wxCoord heightBtn = (11*(window->GetCharHeight() + 8))/10; - if ( size->y < heightBtn - 8 ) - size->y = heightBtn; - else - size->y += 9; - } - - // for compatibility with other ports, the buttons default size is never - // less than the standard one, but not when display not PDAs. - if (wxSystemSettings::GetScreenType() > wxSYS_SCREEN_PDA) - { - if ( !(window->GetWindowStyle() & wxBU_EXACTFIT) ) - { - wxSize szDef = wxButton::GetDefaultSize(); - if ( size->x < szDef.x ) - size->x = szDef.x; - } - } - - // no border width adjustments for buttons - return; - } -#endif // wxUSE_BUTTON || wxUSE_TOGGLEBTN - - wxStdRenderer::AdjustSize(size, window); -} - -wxBitmap wxWin32Renderer::GetFrameButtonBitmap(FrameButtonType type) -{ - wxBitmap& bmp = m_bmpFrameButtons[type]; - if ( !bmp.Ok() ) - { - bmp = wxBitmap(ms_xpmFrameButtons[type]); - } - - return bmp; -} - -// ============================================================================ -// wxInputHandler -// ============================================================================ - -// ---------------------------------------------------------------------------- -// wxWin32InputHandler -// ---------------------------------------------------------------------------- - -bool wxWin32InputHandler::HandleKey(wxInputConsumer * WXUNUSED(control), - const wxKeyEvent& WXUNUSED(event), - bool WXUNUSED(pressed)) -{ - return false; -} - -bool wxWin32InputHandler::HandleMouse(wxInputConsumer *control, - const wxMouseEvent& event) -{ - // clicking on the control gives it focus - if ( event.ButtonDown() ) - { - wxWindow *win = control->GetInputWindow(); - - if ( (wxWindow::FindFocus() != control->GetInputWindow()) && - win->AcceptsFocus() ) - { - win->SetFocus(); - - return true; - } - } - - return false; -} - -#if wxUSE_SCROLLBAR - -// ---------------------------------------------------------------------------- -// wxWin32ScrollBarInputHandler -// ---------------------------------------------------------------------------- - -wxWin32ScrollBarInputHandler:: -wxWin32ScrollBarInputHandler(wxRenderer *renderer, wxInputHandler *handler) - : wxStdScrollBarInputHandler(renderer, handler) -{ - m_scrollPaused = false; - m_interval = 0; -} - -bool wxWin32ScrollBarInputHandler::OnScrollTimer(wxScrollBar *scrollbar, - const wxControlAction& action) -{ - // stop if went beyond the position of the original click (this can only - // happen when we scroll by pages) - bool stop = false; - if ( action == wxACTION_SCROLL_PAGE_DOWN ) - { - stop = scrollbar->HitTestBar(m_ptStartScrolling) != wxHT_SCROLLBAR_BAR_2; - } - else if ( action == wxACTION_SCROLL_PAGE_UP ) - { - stop = scrollbar->HitTestBar(m_ptStartScrolling) != wxHT_SCROLLBAR_BAR_1; - } - - if ( stop ) - { - StopScrolling(scrollbar); - - scrollbar->Refresh(); - - return false; - } - - return wxStdScrollBarInputHandler::OnScrollTimer(scrollbar, action); -} - -bool wxWin32ScrollBarInputHandler::HandleMouse(wxInputConsumer *control, - const wxMouseEvent& event) -{ - // remember the current state - bool wasDraggingThumb = m_htLast == wxHT_SCROLLBAR_THUMB; - - // do process the message - bool rc = wxStdScrollBarInputHandler::HandleMouse(control, event); - - // analyse the changes - if ( !wasDraggingThumb && (m_htLast == wxHT_SCROLLBAR_THUMB) ) - { - // we just started dragging the thumb, remember its initial position to - // be able to restore it if the drag is cancelled later - m_eventStartDrag = event; - } - - return rc; -} - -bool wxWin32ScrollBarInputHandler::HandleMouseMove(wxInputConsumer *control, - const wxMouseEvent& event) -{ - // we don't highlight scrollbar elements, so there is no need to process - // mouse move events normally - only do it while mouse is captured (i.e. - // when we're dragging the thumb or pressing on something) - if ( !m_winCapture ) - return false; - - if ( event.Entering() ) - { - // we're not interested in this at all - return false; - } - - wxScrollBar *scrollbar = wxStaticCast(control->GetInputWindow(), wxScrollBar); - wxHitTest ht; - if ( m_scrollPaused ) - { - // check if the mouse returned to its original location - - if ( event.Leaving() ) - { - // it surely didn't - return false; - } - - ht = scrollbar->HitTestBar(event.GetPosition()); - if ( ht == m_htLast ) - { - // yes it did, resume scrolling - m_scrollPaused = false; - if ( m_timerScroll ) - { - // we were scrolling by line/page, restart timer - m_timerScroll->Start(m_interval); - - Press(scrollbar, true); - } - else // we were dragging the thumb - { - // restore its last location - HandleThumbMove(scrollbar, m_eventLastDrag); - } - - return true; - } - } - else // normal case, scrolling hasn't been paused - { - // if we're scrolling the scrollbar because the arrow or the shaft was - // pressed, check that the mouse stays on the same scrollbar element - -#if 0 - // Always let thumb jump back if we leave the scrollbar - if ( event.Moving() ) - { - ht = scrollbar->HitTestBar(event.GetPosition()); - } - else // event.Leaving() - { - ht = wxHT_NOWHERE; - } -#else - // Jump back only if we get far away from it - wxPoint pos = event.GetPosition(); - if (scrollbar->HasFlag( wxVERTICAL )) - { - if (pos.x > -40 && pos.x < scrollbar->GetSize().x+40) - pos.x = 5; - } - else - { - if (pos.y > -40 && pos.y < scrollbar->GetSize().y+40) - pos.y = 5; - } - ht = scrollbar->HitTestBar(pos); -#endif - - // if we're dragging the thumb and the mouse stays in the scrollbar, it - // is still ok - we only want to catch the case when the mouse leaves - // the scrollbar here - if ( m_htLast == wxHT_SCROLLBAR_THUMB && ht != wxHT_NOWHERE ) - { - ht = wxHT_SCROLLBAR_THUMB; - } - - if ( ht != m_htLast ) - { - // what were we doing? 2 possibilities: either an arrow/shaft was - // pressed in which case we have a timer and so we just stop it or - // we were dragging the thumb - if ( m_timerScroll ) - { - // pause scrolling - m_interval = m_timerScroll->GetInterval(); - m_timerScroll->Stop(); - m_scrollPaused = true; - - // unpress the arrow - Press(scrollbar, false); - } - else // we were dragging the thumb - { - // remember the current thumb position to be able to restore it - // if the mouse returns to it later - m_eventLastDrag = event; - - // and restore the original position (before dragging) of the - // thumb for now - HandleThumbMove(scrollbar, m_eventStartDrag); - } - - return true; - } - } - - return wxStdInputHandler::HandleMouseMove(control, event); -} - -#endif // wxUSE_SCROLLBAR - -#if wxUSE_CHECKBOX - -// ---------------------------------------------------------------------------- -// wxWin32CheckboxInputHandler -// ---------------------------------------------------------------------------- - -bool wxWin32CheckboxInputHandler::HandleKey(wxInputConsumer *control, - const wxKeyEvent& event, - bool pressed) -{ - if ( pressed ) - { - wxControlAction action; - int keycode = event.GetKeyCode(); - switch ( keycode ) - { - case WXK_SPACE: - action = wxACTION_CHECKBOX_TOGGLE; - break; - - case WXK_SUBTRACT: - case WXK_NUMPAD_SUBTRACT: - action = wxACTION_CHECKBOX_CHECK; - break; - - case WXK_ADD: - case WXK_NUMPAD_ADD: - case WXK_NUMPAD_EQUAL: - action = wxACTION_CHECKBOX_CLEAR; - break; - } - - if ( !action.IsEmpty() ) - { - control->PerformAction(action); - - return true; - } - } - - return false; -} - -#endif // wxUSE_CHECKBOX - -#if wxUSE_TEXTCTRL - -// ---------------------------------------------------------------------------- -// wxWin32TextCtrlInputHandler -// ---------------------------------------------------------------------------- - -bool wxWin32TextCtrlInputHandler::HandleKey(wxInputConsumer *control, - const wxKeyEvent& event, - bool pressed) -{ - // handle only MSW-specific text bindings here, the others are handled in - // the base class - if ( pressed ) - { - int keycode = event.GetKeyCode(); - - wxControlAction action; - if ( keycode == WXK_DELETE && event.ShiftDown() ) - { - action = wxACTION_TEXT_CUT; - } - else if ( keycode == WXK_INSERT ) - { - if ( event.ControlDown() ) - action = wxACTION_TEXT_COPY; - else if ( event.ShiftDown() ) - action = wxACTION_TEXT_PASTE; - } - - if ( action != wxACTION_NONE ) - { - control->PerformAction(action); - - return true; - } - } - - return wxStdInputHandler::HandleKey(control, event, pressed); -} - -#endif // wxUSE_TEXTCTRL - -#if wxUSE_STATUSBAR - -// ---------------------------------------------------------------------------- -// wxWin32StatusBarInputHandler -// ---------------------------------------------------------------------------- - -wxWin32StatusBarInputHandler:: -wxWin32StatusBarInputHandler(wxInputHandler *handler) - : wxStdInputHandler(handler) -{ - m_isOnGrip = false; -} - -bool wxWin32StatusBarInputHandler::IsOnGrip(wxWindow *statbar, - const wxPoint& pt) const -{ - if ( statbar->HasFlag(wxST_SIZEGRIP) && - statbar->GetParent()->HasFlag(wxRESIZE_BORDER) ) - { - wxTopLevelWindow * - parentTLW = wxDynamicCast(statbar->GetParent(), wxTopLevelWindow); - - wxCHECK_MSG( parentTLW, false, - _T("the status bar should be a child of a TLW") ); - - // a maximized window can't be resized anyhow - if ( !parentTLW->IsMaximized() ) - { - // VZ: I think that the standard Windows behaviour is to only - // show the resizing cursor when the mouse is on top of the - // grip itself but apparently different Windows versions behave - // differently (?) and it seems a better UI to allow resizing - // the status bar even when the mouse is above the grip - wxSize sizeSbar = statbar->GetSize(); - - int diff = sizeSbar.x - pt.x; - return diff >= 0 && diff < (wxCoord)STATUSBAR_GRIP_SIZE; - } - } - - return false; -} - -bool wxWin32StatusBarInputHandler::HandleMouse(wxInputConsumer *consumer, - const wxMouseEvent& event) -{ - if ( event.Button(1) ) - { - if ( event.ButtonDown(1) ) - { - wxWindow *statbar = consumer->GetInputWindow(); - - if ( IsOnGrip(statbar, event.GetPosition()) ) - { - wxTopLevelWindow *tlw = wxDynamicCast(statbar->GetParent(), - wxTopLevelWindow); - if ( tlw ) - { - tlw->PerformAction(wxACTION_TOPLEVEL_RESIZE, - wxHT_TOPLEVEL_BORDER_SE); - - statbar->SetCursor(m_cursorOld); - - return true; - } - } - } - } - - return wxStdInputHandler::HandleMouse(consumer, event); -} - -bool wxWin32StatusBarInputHandler::HandleMouseMove(wxInputConsumer *consumer, - const wxMouseEvent& event) -{ - wxWindow *statbar = consumer->GetInputWindow(); - - bool isOnGrip = IsOnGrip(statbar, event.GetPosition()); - if ( isOnGrip != m_isOnGrip ) - { - m_isOnGrip = isOnGrip; - if ( isOnGrip ) - { - m_cursorOld = statbar->GetCursor(); - statbar->SetCursor(wxCURSOR_SIZENWSE); - } - else - { - statbar->SetCursor(m_cursorOld); - } - } - - return wxStdInputHandler::HandleMouseMove(consumer, event); -} - -#endif // wxUSE_STATUSBAR - -// ---------------------------------------------------------------------------- -// wxWin32FrameInputHandler -// ---------------------------------------------------------------------------- - -class wxWin32SystemMenuEvtHandler : public wxEvtHandler -{ -public: - wxWin32SystemMenuEvtHandler(wxWin32FrameInputHandler *handler); - - void Attach(wxInputConsumer *consumer); - void Detach(); - -private: - DECLARE_EVENT_TABLE() - void OnSystemMenu(wxCommandEvent &event); - void OnCloseFrame(wxCommandEvent &event); - void OnClose(wxCloseEvent &event); - - wxWin32FrameInputHandler *m_inputHnd; - wxTopLevelWindow *m_wnd; -#if wxUSE_ACCEL - wxAcceleratorTable m_oldAccelTable; -#endif -}; - -wxWin32SystemMenuEvtHandler:: -wxWin32SystemMenuEvtHandler(wxWin32FrameInputHandler *handler) -{ - m_inputHnd = handler; - m_wnd = NULL; -} - -void wxWin32SystemMenuEvtHandler::Attach(wxInputConsumer *consumer) -{ - wxASSERT_MSG( m_wnd == NULL, _T("can't attach the handler twice!") ); - - m_wnd = wxStaticCast(consumer->GetInputWindow(), wxTopLevelWindow); - m_wnd->PushEventHandler(this); - -#if wxUSE_ACCEL - // VS: This code relies on using generic implementation of - // wxAcceleratorTable in wxUniv! - wxAcceleratorTable table = *m_wnd->GetAcceleratorTable(); - m_oldAccelTable = table; - table.Add(wxAcceleratorEntry(wxACCEL_ALT, WXK_SPACE, wxID_SYSTEM_MENU)); - table.Add(wxAcceleratorEntry(wxACCEL_ALT, WXK_F4, wxID_CLOSE_FRAME)); - m_wnd->SetAcceleratorTable(table); -#endif -} - -void wxWin32SystemMenuEvtHandler::Detach() -{ - if ( m_wnd ) - { -#if wxUSE_ACCEL - m_wnd->SetAcceleratorTable(m_oldAccelTable); -#endif - m_wnd->RemoveEventHandler(this); - m_wnd = NULL; - } -} - -BEGIN_EVENT_TABLE(wxWin32SystemMenuEvtHandler, wxEvtHandler) - EVT_MENU(wxID_SYSTEM_MENU, wxWin32SystemMenuEvtHandler::OnSystemMenu) - EVT_MENU(wxID_CLOSE_FRAME, wxWin32SystemMenuEvtHandler::OnCloseFrame) - EVT_CLOSE(wxWin32SystemMenuEvtHandler::OnClose) -END_EVENT_TABLE() - -void wxWin32SystemMenuEvtHandler::OnSystemMenu(wxCommandEvent &WXUNUSED(event)) -{ -#if wxUSE_ACCEL - wxAcceleratorTable table = *m_wnd->GetAcceleratorTable(); - m_wnd->SetAcceleratorTable(wxNullAcceleratorTable); -#endif - -#if wxUSE_MENUS - m_inputHnd->PopupSystemMenu(m_wnd); -#endif // wxUSE_MENUS - -#if wxUSE_ACCEL - m_wnd->SetAcceleratorTable(table); -#endif -} - -void wxWin32SystemMenuEvtHandler::OnCloseFrame(wxCommandEvent &WXUNUSED(event)) -{ - m_wnd->PerformAction(wxACTION_TOPLEVEL_BUTTON_CLICK, - wxTOPLEVEL_BUTTON_CLOSE); -} - -void wxWin32SystemMenuEvtHandler::OnClose(wxCloseEvent &event) -{ - m_wnd = NULL; - event.Skip(); -} - - -wxWin32FrameInputHandler::wxWin32FrameInputHandler(wxInputHandler *handler) - : wxStdInputHandler(handler) -{ - m_menuHandler = new wxWin32SystemMenuEvtHandler(this); -} - -wxWin32FrameInputHandler::~wxWin32FrameInputHandler() -{ - if ( m_menuHandler ) - { - m_menuHandler->Detach(); - delete m_menuHandler; - } -} - -bool wxWin32FrameInputHandler::HandleMouse(wxInputConsumer *consumer, - const wxMouseEvent& event) -{ - if ( event.LeftDClick() || event.LeftDown() || event.RightDown() ) - { - wxTopLevelWindow *tlw = - wxStaticCast(consumer->GetInputWindow(), wxTopLevelWindow); - - long hit = tlw->HitTest(event.GetPosition()); - - if ( event.LeftDClick() && hit == wxHT_TOPLEVEL_TITLEBAR ) - { - tlw->PerformAction(wxACTION_TOPLEVEL_BUTTON_CLICK, - tlw->IsMaximized() ? wxTOPLEVEL_BUTTON_RESTORE - : wxTOPLEVEL_BUTTON_MAXIMIZE); - return true; - } - else if ( tlw->GetWindowStyle() & wxSYSTEM_MENU ) - { - if ( (event.LeftDown() && hit == wxHT_TOPLEVEL_ICON) || - (event.RightDown() && - (hit == wxHT_TOPLEVEL_TITLEBAR || - hit == wxHT_TOPLEVEL_ICON)) ) - { -#if wxUSE_MENUS - PopupSystemMenu(tlw); -#endif // wxUSE_MENUS - return true; - } - } - } - - return wxStdInputHandler::HandleMouse(consumer, event); -} - -#if wxUSE_MENUS - -void wxWin32FrameInputHandler::PopupSystemMenu(wxTopLevelWindow *window) const -{ - wxMenu menu; - - if ( window->GetWindowStyle() & wxMAXIMIZE_BOX ) - menu.Append(wxID_RESTORE_FRAME , _("&Restore")); - menu.Append(wxID_MOVE_FRAME , _("&Move")); - if ( window->GetWindowStyle() & wxRESIZE_BORDER ) - menu.Append(wxID_RESIZE_FRAME , _("&Size")); - if ( wxSystemSettings::HasFeature(wxSYS_CAN_ICONIZE_FRAME) ) - menu.Append(wxID_ICONIZE_FRAME , _("Mi&nimize")); - if ( window->GetWindowStyle() & wxMAXIMIZE_BOX ) - menu.Append(wxID_MAXIMIZE_FRAME , _("Ma&ximize")); - menu.AppendSeparator(); - menu.Append(wxID_CLOSE_FRAME, _("Close\tAlt-F4")); - - if ( window->GetWindowStyle() & wxMAXIMIZE_BOX ) - { - if ( window->IsMaximized() ) - { - menu.Enable(wxID_MAXIMIZE_FRAME, false); - menu.Enable(wxID_MOVE_FRAME, false); - if ( window->GetWindowStyle() & wxRESIZE_BORDER ) - menu.Enable(wxID_RESIZE_FRAME, false); - } - else - menu.Enable(wxID_RESTORE_FRAME, false); - } - - window->PopupMenu(&menu, wxPoint(0, 0)); -} - -#endif // wxUSE_MENUS - -bool wxWin32FrameInputHandler::HandleActivation(wxInputConsumer *consumer, - bool activated) -{ - if ( consumer->GetInputWindow()->GetWindowStyle() & wxSYSTEM_MENU ) - { - // always detach if active frame changed: - m_menuHandler->Detach(); - - if ( activated ) - { - m_menuHandler->Attach(consumer); - } - } - - return wxStdInputHandler::HandleActivation(consumer, activated); -} - -#endif // wxUSE_THEME_WIN32 diff --git a/wxWidgets/src/univ/toolbar.cpp b/wxWidgets/src/univ/toolbar.cpp deleted file mode 100644 index 1271e02fc1..0000000000 --- a/wxWidgets/src/univ/toolbar.cpp +++ /dev/null @@ -1,967 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/univ/toolbar.cpp -// Purpose: implementation of wxToolBar for wxUniversal -// Author: Robert Roebling, Vadim Zeitlin (universalization) -// Modified by: -// Created: 20.02.02 -// Id: $Id: toolbar.cpp 42840 2006-10-31 13:09:08Z VZ $ -// Copyright: (c) 2001 Robert Roebling, -// (c) 2002 SciTech Software, Inc. (www.scitechsoft.com) -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_TOOLBAR - -#include "wx/toolbar.h" - -#ifndef WX_PRECOMP - #include "wx/utils.h" - #include "wx/app.h" - #include "wx/log.h" - #include "wx/frame.h" - #include "wx/dc.h" - #include "wx/image.h" -#endif - -#include "wx/univ/renderer.h" - -// ---------------------------------------------------------------------------- -// wxStdToolbarInputHandler: translates SPACE and ENTER keys and the left mouse -// click into button press/release actions -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxStdToolbarInputHandler : public wxStdInputHandler -{ -public: - wxStdToolbarInputHandler(wxInputHandler *inphand); - - virtual bool HandleKey(wxInputConsumer *consumer, - const wxKeyEvent& event, - bool pressed); - virtual bool HandleMouse(wxInputConsumer *consumer, - const wxMouseEvent& event); - virtual bool HandleMouseMove(wxInputConsumer *consumer, const wxMouseEvent& event); - virtual bool HandleFocus(wxInputConsumer *consumer, const wxFocusEvent& event); - virtual bool HandleActivation(wxInputConsumer *consumer, bool activated); - -private: - wxWindow *m_winCapture; - wxToolBarToolBase *m_toolCapture; - wxToolBarToolBase *m_toolLast; -}; - -// ---------------------------------------------------------------------------- -// constants -// ---------------------------------------------------------------------------- - -// value meaning that m_widthSeparator is not initialized -static const wxCoord INVALID_WIDTH = wxDefaultCoord; - -// ---------------------------------------------------------------------------- -// wxToolBarTool: our implementation of wxToolBarToolBase -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT 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) - : wxToolBarToolBase(tbar, id, label, bmpNormal, bmpDisabled, kind, - clientData, shortHelp, longHelp) - { - // no position yet - m_x = - m_y = wxDefaultCoord; - m_width = - m_height = 0; - - // not pressed yet - m_isInverted = false; - - // mouse not here yet - m_underMouse = false; - } - - wxToolBarTool(wxToolBar *tbar, wxControl *control) - : wxToolBarToolBase(tbar, control) - { - // no position yet - m_x = - m_y = wxDefaultCoord; - m_width = - m_height = 0; - - // not pressed yet - m_isInverted = false; - - // mouse not here yet - m_underMouse = false; - } - - // is this tool pressed, even temporarily? (this is different from being - // permanently toggled which is what IsToggled() returns) - bool IsPressed() const - { return CanBeToggled() ? IsToggled() != m_isInverted : m_isInverted; } - - // are we temporarily pressed/unpressed? - bool IsInverted() const { return m_isInverted; } - - // press the tool temporarily by inverting its toggle state - void Invert() { m_isInverted = !m_isInverted; } - - // Set underMouse - void SetUnderMouse( bool under = true ) { m_underMouse = under; } - bool IsUnderMouse() { return m_underMouse; } - -public: - // the tool position (for controls) - wxCoord m_x; - wxCoord m_y; - wxCoord m_width; - wxCoord m_height; - -private: - // true if the tool is pressed - bool m_isInverted; - - // true if the tool is under the mouse - bool m_underMouse; -}; - -// ============================================================================ -// wxToolBar implementation -// ============================================================================ - -IMPLEMENT_DYNAMIC_CLASS(wxToolBar, wxControl) - -// ---------------------------------------------------------------------------- -// wxToolBar creation -// ---------------------------------------------------------------------------- - -void wxToolBar::Init() -{ - // no tools yet - m_needsLayout = false; - - // unknown widths for the tools and separators - m_widthSeparator = INVALID_WIDTH; - - m_maxWidth = - m_maxHeight = 0; - - wxRenderer *renderer = GetRenderer(); - - SetToolBitmapSize(renderer->GetToolBarButtonSize(&m_widthSeparator)); - SetMargins(renderer->GetToolBarMargin()); -} - -bool wxToolBar::Create(wxWindow *parent, - wxWindowID id, - const wxPoint& pos, - const wxSize& size, - long style, - const wxString& name) -{ - if ( !wxToolBarBase::Create(parent, id, pos, size, style, - wxDefaultValidator, name) ) - { - return false; - } - - FixupStyle(); - - CreateInputHandler(wxINP_HANDLER_TOOLBAR); - - SetInitialSize(size); - - return true; -} - -wxToolBar::~wxToolBar() -{ - // Make sure the toolbar is removed from the parent. - SetSize(0,0); -} - -void wxToolBar::SetMargins(int x, int y) -{ - // This required for similar visual effects under - // native platforms and wxUniv. - wxToolBarBase::SetMargins( x + 3, y + 3 ); -} - -// ---------------------------------------------------------------------------- -// wxToolBar tool-related methods -// ---------------------------------------------------------------------------- - -wxToolBarToolBase *wxToolBar::FindToolForPosition(wxCoord x, wxCoord y) const -{ - // check the "other" direction first: it must be inside the toolbar or we - // don't risk finding anything - if ( IsVertical() ) - { - if ( x < 0 || x > m_maxWidth ) - return NULL; - - // we always use x, even for a vertical toolbar, this makes the code - // below simpler - x = y; - } - else // horizontal - { - if ( y < 0 || y > m_maxHeight ) - return NULL; - } - - for ( wxToolBarToolsList::compatibility_iterator node = m_tools.GetFirst(); - node; - node = node->GetNext() ) - { - wxToolBarToolBase *tool = node->GetData(); - wxRect rectTool = GetToolRect(tool); - - wxCoord startTool, endTool; - GetRectLimits(rectTool, &startTool, &endTool); - - if ( x >= startTool && x <= endTool ) - { - // don't return the separators from here, they don't accept any - // input anyhow - return tool->IsSeparator() ? NULL : tool; - } - } - - return NULL; -} - -void wxToolBar::SetToolShortHelp(int id, const wxString& help) -{ - wxToolBarToolBase *tool = FindById(id); - - wxCHECK_RET( tool, _T("SetToolShortHelp: no such tool") ); - - tool->SetShortHelp(help); -} - -bool wxToolBar::DoInsertTool(size_t WXUNUSED(pos), - wxToolBarToolBase * WXUNUSED(tool)) -{ - // recalculate the toolbar geometry before redrawing it the next time - m_needsLayout = true; - - // and ensure that we indeed are going to redraw - Refresh(); - - return true; -} - -bool wxToolBar::DoDeleteTool(size_t WXUNUSED(pos), - wxToolBarToolBase * WXUNUSED(tool)) -{ - // as above - m_needsLayout = true; - - Refresh(); - - return true; -} - -void wxToolBar::DoEnableTool(wxToolBarToolBase *tool, bool enable) -{ -#if wxUSE_IMAGE - // created disabled-state bitmap on demand - if ( !enable && !tool->GetDisabledBitmap().Ok() ) - { - wxImage image(tool->GetNormalBitmap().ConvertToImage()); - - tool->SetDisabledBitmap(image.ConvertToGreyscale()); - } -#endif // wxUSE_IMAGE - - RefreshTool(tool); -} - -void wxToolBar::DoToggleTool(wxToolBarToolBase *tool, bool WXUNUSED(toggle)) -{ - // note that if we're called the tool did change state (the base class - // checks for it), so it's not necessary to check for this again here - RefreshTool(tool); -} - -void wxToolBar::DoSetToggle(wxToolBarToolBase *tool, bool WXUNUSED(toggle)) -{ - RefreshTool(tool); -} - -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); -} - -// ---------------------------------------------------------------------------- -// wxToolBar geometry -// ---------------------------------------------------------------------------- - -wxRect wxToolBar::GetToolRect(wxToolBarToolBase *toolBase) const -{ - const wxToolBarTool *tool = (wxToolBarTool *)toolBase; - - wxRect rect; - - wxCHECK_MSG( tool, rect, _T("GetToolRect: NULL tool") ); - - // ensure that we always have the valid tool position - if ( m_needsLayout ) - { - wxConstCast(this, wxToolBar)->DoLayout(); - } - - rect.x = tool->m_x - m_xMargin; - rect.y = tool->m_y - m_yMargin; - - if ( IsVertical() ) - { - if (tool->IsButton()) - { - if(!HasFlag(wxTB_TEXT)) - { - rect.width = m_defaultWidth; - rect.height = m_defaultHeight; - } - else - { - rect.width = m_defaultWidth + - GetFont().GetPointSize() * tool->GetLabel().length(); - rect.height = m_defaultHeight; - } - } - else if (tool->IsSeparator()) - { - rect.width = m_defaultWidth; - rect.height = m_widthSeparator; - } - else // control - { - rect.width = tool->m_width; - rect.height = tool->m_height; - } - } - else // horizontal - { - if (tool->IsButton()) - { - if(!HasFlag(wxTB_TEXT)) - { - rect.width = m_defaultWidth; - rect.height = m_defaultHeight; - } - else - { - rect.width = m_defaultWidth + - GetFont().GetPointSize() * tool->GetLabel().length(); - rect.height = m_defaultHeight; - } - } - else if (tool->IsSeparator()) - { - rect.width = m_widthSeparator; - rect.height = m_defaultHeight; - } - else // control - { - rect.width = tool->m_width; - rect.height = tool->m_height; - } - } - - rect.width += 2*m_xMargin; - rect.height += 2*m_yMargin; - - return rect; -} - -bool wxToolBar::Realize() -{ - if ( !wxToolBarBase::Realize() ) - return false; - - m_needsLayout = true; - DoLayout(); - - SetInitialSize(wxDefaultSize); - - return true; -} - -void wxToolBar::SetWindowStyleFlag( long style ) -{ - wxToolBarBase::SetWindowStyleFlag(style); - - m_needsLayout = true; - - Refresh(); -} - -void wxToolBar::DoLayout() -{ - wxASSERT_MSG( m_needsLayout, _T("why are we called?") ); - - m_needsLayout = false; - - wxCoord x = m_xMargin, - y = m_yMargin; - - wxCoord widthTool = 0, maxWidthTool = 0; - wxCoord heightTool = 0, maxHeightTool = 0; - wxCoord margin = IsVertical() ? m_xMargin : m_yMargin; - wxCoord *pCur = IsVertical() ? &y : &x; - - // calculate the positions of all elements - for ( wxToolBarToolsList::compatibility_iterator node = m_tools.GetFirst(); - node; - node = node->GetNext() ) - { - wxToolBarTool *tool = (wxToolBarTool *) node->GetData(); - - tool->m_x = x; - tool->m_y = y; - - // TODO ugly number fiddling - if (tool->IsButton()) - { - if (IsVertical()) - { - widthTool = m_defaultHeight; - heightTool = m_defaultWidth; - if(HasFlag(wxTB_TEXT)) - heightTool += GetFont().GetPointSize() * tool->GetLabel().length(); - } - else - { - widthTool = m_defaultWidth; - if(HasFlag(wxTB_TEXT)) - widthTool += GetFont().GetPointSize() * tool->GetLabel().length(); - - heightTool = m_defaultHeight; - } - - if(widthTool > maxWidthTool) // Record max width of tool - { - maxWidthTool = widthTool; - } - - if(heightTool > maxHeightTool) // Record max width of tool - { - maxHeightTool = heightTool; - } - - *pCur += widthTool; - } - else if (tool->IsSeparator()) - { - *pCur += m_widthSeparator; - } - else if (!IsVertical()) // horizontal control - { - wxControl *control = tool->GetControl(); - wxSize size = control->GetSize(); - tool->m_y += (m_defaultHeight - size.y)/2; - tool->m_width = size.x; - tool->m_height = size.y; - - *pCur += tool->m_width; - } - *pCur += margin; - } - - // calculate the total toolbar size - wxCoord xMin, yMin; - - if(!HasFlag(wxTB_TEXT)) - { - xMin = m_defaultWidth + 2*m_xMargin; - yMin = m_defaultHeight + 2*m_yMargin; - } - else - { - if (IsVertical()) - { - xMin = heightTool + 2*m_xMargin; - yMin = widthTool + 2*m_xMargin; - } - else - { - xMin = maxWidthTool + 2*m_xMargin; - yMin = heightTool + 2*m_xMargin; - } - } - - m_maxWidth = x < xMin ? xMin : x; - m_maxHeight = y < yMin ? yMin : y; -} - -wxSize wxToolBar::DoGetBestClientSize() const -{ - return wxSize(m_maxWidth, m_maxHeight); -} - -void wxToolBar::DoSetSize(int x, int y, int width, int height, int sizeFlags) -{ - int old_width, old_height; - GetSize(&old_width, &old_height); - - wxToolBarBase::DoSetSize(x, y, width, height, sizeFlags); - - // Correct width and height if needed. - if ( width == wxDefaultCoord || height == wxDefaultCoord ) - { - int tmp_width, tmp_height; - GetSize(&tmp_width, &tmp_height); - - if ( width == wxDefaultCoord ) - width = tmp_width; - if ( height == wxDefaultCoord ) - height = tmp_height; - } - - // We must refresh the frame size when the toolbar changes size - // otherwise the toolbar can be shown incorrectly - if ( old_width != width || old_height != height ) - { - // But before we send the size event check it - // we have a frame that is not being deleted. - wxFrame *frame = wxDynamicCast(GetParent(), wxFrame); - if ( frame && !frame->IsBeingDeleted() ) - { - frame->SendSizeEvent(); - } - } -} - -// ---------------------------------------------------------------------------- -// wxToolBar drawing -// ---------------------------------------------------------------------------- - -void wxToolBar::RefreshTool(wxToolBarToolBase *tool) -{ - RefreshRect(GetToolRect(tool)); -} - -void wxToolBar::GetRectLimits(const wxRect& rect, - wxCoord *start, - wxCoord *end) const -{ - wxCHECK_RET( start && end, _T("NULL pointer in GetRectLimits") ); - - if ( IsVertical() ) - { - *start = rect.GetTop(); - *end = rect.GetBottom(); - } - else // horizontal - { - *start = rect.GetLeft(); - *end = rect.GetRight(); - } -} - -void wxToolBar::DoDraw(wxControlRenderer *renderer) -{ - // prepare the variables used below - wxDC& dc = renderer->GetDC(); - wxRenderer *rend = renderer->GetRenderer(); - dc.SetFont(GetFont()); - - // draw the border separating us from the menubar (if there is no menubar - // we probably shouldn't draw it?) - if ( !IsVertical() ) - { - rend->DrawHorizontalLine(dc, 0, 0, GetClientSize().x); - } - - // get the update rect and its limits depending on the orientation - wxRect rectUpdate = GetUpdateClientRect(); - wxCoord start, end; - GetRectLimits(rectUpdate, &start, &end); - - // and redraw all the tools intersecting it - for ( wxToolBarToolsList::compatibility_iterator node = m_tools.GetFirst(); - node; - node = node->GetNext() ) - { - wxToolBarTool *tool = (wxToolBarTool*) node->GetData(); - wxRect rectTool = GetToolRect(tool); - wxCoord startTool, endTool; - GetRectLimits(rectTool, &startTool, &endTool); - - if ( endTool < start ) - { - // we're still to the left of the area to redraw - continue; - } - - if ( startTool > end ) - { - // we're beyond the area to redraw, nothing left to do - break; - } - - if (tool->IsSeparator() && !HasFlag(wxTB_FLAT)) - { - // Draw separators only in flat mode - continue; - } - - // deal with the flags - int flags = 0; - - if ( tool->IsEnabled() ) - { - // The toolbars without wxTB_FLAT don't react to the mouse hovering - if ( !HasFlag(wxTB_FLAT) || tool->IsUnderMouse() ) - flags |= wxCONTROL_CURRENT; - } - else // disabled tool - { - flags |= wxCONTROL_DISABLED; - } - - //if ( tool == m_toolCaptured ) - // flags |= wxCONTROL_FOCUSED; - - if ( tool->IsPressed() ) - flags = wxCONTROL_PRESSED; - - wxString label; - wxBitmap bitmap; - if ( !tool->IsSeparator() ) - { - label = tool->GetLabel(); - bitmap = tool->GetBitmap(); - } - //else: leave both the label and the bitmap invalid to draw a separator - - if ( !tool->IsControl() ) - { - int tbStyle = 0; - if(HasFlag(wxTB_TEXT)) - { - tbStyle |= wxTB_TEXT; - } - - if(HasFlag(wxTB_VERTICAL)) - { - tbStyle |= wxTB_VERTICAL; - } - else - { - tbStyle |= wxTB_HORIZONTAL; - } - rend->DrawToolBarButton(dc, label, bitmap, rectTool, flags, tool->GetStyle(), tbStyle); - } - else // control - { - wxControl *control = tool->GetControl(); - control->Move(tool->m_x, tool->m_y); - } - } -} - -// ---------------------------------------------------------------------------- -// wxToolBar actions -// ---------------------------------------------------------------------------- - -bool wxToolBar::PerformAction(const wxControlAction& action, - long numArg, - const wxString& strArg) -{ - wxToolBarTool *tool = (wxToolBarTool*) FindById(numArg); - if (!tool) - return false; - - if ( action == wxACTION_TOOLBAR_TOGGLE ) - { - PerformAction( wxACTION_BUTTON_RELEASE, numArg ); - - PerformAction( wxACTION_BUTTON_CLICK, numArg ); - - // Write by Danny Raynor to change state again. - // Check button still pressed or not - if ( tool->CanBeToggled() && tool->IsToggled() ) - { - tool->Toggle(false); - } - - if( tool->IsInverted() ) - { - PerformAction( wxACTION_TOOLBAR_RELEASE, numArg ); - } - - // Set mouse leave toolbar button range (If still in the range, - // toolbar button would get focus again - PerformAction( wxACTION_TOOLBAR_LEAVE, numArg ); - } - else if ( action == wxACTION_TOOLBAR_PRESS ) - { - wxLogTrace(_T("toolbar"), _T("Button '%s' pressed."), tool->GetShortHelp().c_str()); - - tool->Invert(); - - RefreshTool( tool ); - } - else if ( action == wxACTION_TOOLBAR_RELEASE ) - { - wxLogTrace(_T("toolbar"), _T("Button '%s' released."), tool->GetShortHelp().c_str()); - - wxASSERT_MSG( tool->IsInverted(), _T("release unpressed button?") ); - - tool->Invert(); - - RefreshTool( tool ); - } - else if ( action == wxACTION_TOOLBAR_CLICK ) - { - bool isToggled; - if ( tool->CanBeToggled() ) - { - tool->Toggle(); - - RefreshTool( tool ); - - isToggled = tool->IsToggled(); - } - else // simple non-checkable tool - { - isToggled = false; - } - OnLeftClick( tool->GetId(), isToggled ); - } - else if ( action == wxACTION_TOOLBAR_ENTER ) - { - wxCHECK_MSG( tool, false, _T("no tool to enter?") ); - - if ( HasFlag(wxTB_FLAT) && tool->IsEnabled() ) - { - tool->SetUnderMouse( true ); - - if ( !tool->IsToggled() ) - RefreshTool( tool ); - } - } - else if ( action == wxACTION_TOOLBAR_LEAVE ) - { - wxCHECK_MSG( tool, false, _T("no tool to leave?") ); - - if ( HasFlag(wxTB_FLAT) && tool->IsEnabled() ) - { - tool->SetUnderMouse( false ); - - if ( !tool->IsToggled() ) - RefreshTool( tool ); - } - } - else - return wxControl::PerformAction(action, numArg, strArg); - - return true; -} - -/* static */ -wxInputHandler *wxToolBar::GetStdInputHandler(wxInputHandler *handlerDef) -{ - static wxStdToolbarInputHandler s_handler(handlerDef); - - return &s_handler; -} - -// ============================================================================ -// wxStdToolbarInputHandler implementation -// ============================================================================ - -wxStdToolbarInputHandler::wxStdToolbarInputHandler(wxInputHandler *handler) - : wxStdInputHandler(handler) -{ - m_winCapture = NULL; - m_toolCapture = NULL; - m_toolLast = NULL; -} - -bool wxStdToolbarInputHandler::HandleKey(wxInputConsumer *consumer, - const wxKeyEvent& event, - bool pressed) -{ - // TODO: when we have a current button we should allow the arrow - // keys to move it - return wxStdInputHandler::HandleKey(consumer, event, pressed); -} - -bool wxStdToolbarInputHandler::HandleMouse(wxInputConsumer *consumer, - const wxMouseEvent& event) -{ - wxToolBar *tbar = wxStaticCast(consumer->GetInputWindow(), wxToolBar); - wxToolBarToolBase *tool = tbar->FindToolForPosition(event.GetX(), event.GetY()); - - if ( event.Button(1) ) - { - - if ( event.LeftDown() || event.LeftDClick() ) - { - if ( !tool || !tool->IsEnabled() ) - return true; - - m_winCapture = tbar; - m_winCapture->CaptureMouse(); - - m_toolCapture = tool; - - consumer->PerformAction( wxACTION_BUTTON_PRESS, tool->GetId() ); - - return true; - } - else if ( event.LeftUp() ) - { - if ( m_winCapture ) - { - m_winCapture->ReleaseMouse(); - m_winCapture = NULL; - } - - if (m_toolCapture) - { - if ( tool == m_toolCapture ) - consumer->PerformAction( wxACTION_BUTTON_TOGGLE, m_toolCapture->GetId() ); - else - consumer->PerformAction( wxACTION_TOOLBAR_LEAVE, m_toolCapture->GetId() ); - } - - m_toolCapture = NULL; - - return true; - } - //else: don't do anything special about the double click - } - - return wxStdInputHandler::HandleMouse(consumer, event); -} - -bool wxStdToolbarInputHandler::HandleMouseMove(wxInputConsumer *consumer, - const wxMouseEvent& event) -{ - if ( !wxStdInputHandler::HandleMouseMove(consumer, event) ) - { - wxToolBar *tbar = wxStaticCast(consumer->GetInputWindow(), wxToolBar); - - wxToolBarTool *tool; - if ( event.Leaving() ) - { - // We cannot possibly be over a tool when - // leaving the toolbar - tool = NULL; - } - else - { - tool = (wxToolBarTool*) tbar->FindToolForPosition( event.GetX(), event.GetY() ); - } - - if (m_toolCapture) - { - // During capture we only care of the captured tool - if (tool && (tool != m_toolCapture)) - tool = NULL; - - if (tool == m_toolLast) - return true; - - if (tool) - consumer->PerformAction( wxACTION_BUTTON_PRESS, m_toolCapture->GetId() ); - else - consumer->PerformAction( wxACTION_BUTTON_RELEASE, m_toolCapture->GetId() ); - - m_toolLast = tool; - } - else - { - if (tool == m_toolLast) - return true; - - if (m_toolLast) - { - // Leave old tool if any - consumer->PerformAction( wxACTION_TOOLBAR_LEAVE, m_toolLast->GetId() ); - } - - if (tool) - { - // Enter new tool if any - consumer->PerformAction( wxACTION_TOOLBAR_ENTER, tool->GetId() ); - } - - m_toolLast = tool; - } - - return true; - } - - return false; -} - -bool wxStdToolbarInputHandler::HandleFocus(wxInputConsumer *consumer, - const wxFocusEvent& WXUNUSED(event)) -{ - if ( m_toolCapture ) - { - // We shouldn't be left with a highlighted button - consumer->PerformAction( wxACTION_TOOLBAR_LEAVE, m_toolCapture->GetId() ); - } - - return true; -} - -bool wxStdToolbarInputHandler::HandleActivation(wxInputConsumer *consumer, - bool activated) -{ - if (m_toolCapture && !activated) - { - // We shouldn't be left with a highlighted button - consumer->PerformAction( wxACTION_TOOLBAR_LEAVE, m_toolCapture->GetId() ); - } - - return true; -} - -#endif // wxUSE_TOOLBAR diff --git a/wxWidgets/src/univ/topluniv.cpp b/wxWidgets/src/univ/topluniv.cpp deleted file mode 100644 index 203ffb79ff..0000000000 --- a/wxWidgets/src/univ/topluniv.cpp +++ /dev/null @@ -1,961 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/univ/topluniv.cpp -// Author: Vaclav Slavik -// Id: $Id: topluniv.cpp 43616 2006-11-23 14:50:42Z VS $ -// Copyright: (c) 2001-2002 SciTech Software, Inc. (www.scitechsoft.com) -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#include "wx/toplevel.h" - -#ifndef WX_PRECOMP - #include "wx/dcclient.h" - #include "wx/settings.h" - #include "wx/bitmap.h" - #include "wx/image.h" - #include "wx/frame.h" -#endif - -#include "wx/univ/renderer.h" -#include "wx/cshelp.h" -#include "wx/evtloop.h" - -// ---------------------------------------------------------------------------- -// wxStdTLWInputHandler: handles focus, resizing and titlebar buttons clicks -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxStdTLWInputHandler : public wxStdInputHandler -{ -public: - wxStdTLWInputHandler(wxInputHandler *inphand); - - virtual bool HandleMouse(wxInputConsumer *consumer, - const wxMouseEvent& event); - virtual bool HandleMouseMove(wxInputConsumer *consumer, const wxMouseEvent& event); - virtual bool HandleActivation(wxInputConsumer *consumer, bool activated); - -private: - // the window (button) which has capture or NULL and the last hittest result - wxTopLevelWindow *m_winCapture; - long m_winHitTest; - long m_winPressed; - bool m_borderCursorOn; - wxCursor m_origCursor; -}; - - -// ---------------------------------------------------------------------------- -// event tables -// ---------------------------------------------------------------------------- - -BEGIN_EVENT_TABLE(wxTopLevelWindow, wxTopLevelWindowNative) - WX_EVENT_TABLE_INPUT_CONSUMER(wxTopLevelWindow) - EVT_NC_PAINT(wxTopLevelWindow::OnNcPaint) - EVT_MENU_RANGE(wxID_CLOSE_FRAME, wxID_RESTORE_FRAME, wxTopLevelWindow::OnSystemMenu) -END_EVENT_TABLE() - -WX_FORWARD_TO_INPUT_CONSUMER(wxTopLevelWindow) - -// ============================================================================ -// implementation -// ============================================================================ - -int wxTopLevelWindow::ms_drawDecorations = -1; -int wxTopLevelWindow::ms_canIconize = -1; - -void wxTopLevelWindow::Init() -{ - // once-only ms_drawDecorations initialization - if ( ms_drawDecorations == -1 ) - { - ms_drawDecorations = - !wxSystemSettings::HasFeature(wxSYS_CAN_DRAW_FRAME_DECORATIONS) || - wxGetEnv(wxT("WXDECOR"), NULL); - } - - m_usingNativeDecorations = ms_drawDecorations == 0; - m_isActive = false; - m_windowStyle = 0; - m_pressedButton = 0; -} - -bool wxTopLevelWindow::Create(wxWindow *parent, - wxWindowID id, - const wxString& title, - const wxPoint& pos, - const wxSize& size, - long style, - const wxString &name) -{ - // init them to avoid compiler warnings - long styleOrig = 0, - exstyleOrig = 0; - - if ( !m_usingNativeDecorations ) - { - CreateInputHandler(wxINP_HANDLER_TOPLEVEL); - - styleOrig = style; - exstyleOrig = GetExtraStyle(); - style &= ~(wxCAPTION | wxMINIMIZE_BOX | wxMAXIMIZE_BOX | - wxSYSTEM_MENU | wxRESIZE_BORDER | wxFRAME_TOOL_WINDOW | - wxRESIZE_BORDER); - style |= wxBORDER_NONE; - SetExtraStyle(exstyleOrig & ~wxWS_EX_CONTEXTHELP); - } - - if ( !wxTopLevelWindowNative::Create(parent, id, title, pos, - size, style, name) ) - return false; - - if ( !m_usingNativeDecorations ) - { - m_windowStyle = styleOrig; - m_exStyle = exstyleOrig; - } - - return true; -} - -bool wxTopLevelWindow::ShowFullScreen(bool show, long style) -{ - if ( show == IsFullScreen() ) return false; - - if ( !m_usingNativeDecorations ) - { - if ( show ) - { - m_fsSavedStyle = m_windowStyle; - if ( style & wxFULLSCREEN_NOBORDER ) - m_windowStyle |= wxSIMPLE_BORDER; - if ( style & wxFULLSCREEN_NOCAPTION ) - m_windowStyle &= ~wxCAPTION; - } - else - { - m_windowStyle = m_fsSavedStyle; - } - } - - return wxTopLevelWindowNative::ShowFullScreen(show, style); -} - -/* static */ -void wxTopLevelWindow::UseNativeDecorationsByDefault(bool native) -{ - ms_drawDecorations = !native; -} - -void wxTopLevelWindow::UseNativeDecorations(bool native) -{ - wxASSERT_MSG( !m_windowStyle, _T("must be called before Create()") ); - - m_usingNativeDecorations = native; -} - -bool wxTopLevelWindow::IsUsingNativeDecorations() const -{ - return m_usingNativeDecorations; -} - -long wxTopLevelWindow::GetDecorationsStyle() const -{ - long style = 0; - - if ( m_windowStyle & wxCAPTION ) - { - if ( ms_canIconize == -1 ) - { - ms_canIconize = wxSystemSettings::HasFeature(wxSYS_CAN_ICONIZE_FRAME); - } - - style |= wxTOPLEVEL_TITLEBAR; - if ( m_windowStyle & wxCLOSE_BOX ) - style |= wxTOPLEVEL_BUTTON_CLOSE; - if ( (m_windowStyle & wxMINIMIZE_BOX) && ms_canIconize ) - style |= wxTOPLEVEL_BUTTON_ICONIZE; - if ( m_windowStyle & wxMAXIMIZE_BOX ) - { - if ( IsMaximized() ) - style |= wxTOPLEVEL_BUTTON_RESTORE; - else - style |= wxTOPLEVEL_BUTTON_MAXIMIZE; - } -#if wxUSE_HELP - if ( m_exStyle & wxWS_EX_CONTEXTHELP) - style |= wxTOPLEVEL_BUTTON_HELP; -#endif - } - if ( (m_windowStyle & (wxSIMPLE_BORDER | wxNO_BORDER)) == 0 ) - style |= wxTOPLEVEL_BORDER; - if ( m_windowStyle & (wxRESIZE_BORDER | wxRESIZE_BORDER) ) - style |= wxTOPLEVEL_RESIZEABLE; - - if ( IsMaximized() ) - style |= wxTOPLEVEL_MAXIMIZED; - if ( GetIcon().Ok() ) - style |= wxTOPLEVEL_ICON; - if ( m_isActive ) - style |= wxTOPLEVEL_ACTIVE; - - return style; -} - -void wxTopLevelWindow::RefreshTitleBar() -{ - wxNcPaintEvent event(GetId()); - event.SetEventObject(this); - GetEventHandler()->ProcessEvent(event); -} - -// ---------------------------------------------------------------------------- -// client area handling -// ---------------------------------------------------------------------------- - -wxPoint wxTopLevelWindow::GetClientAreaOrigin() const -{ - if ( !m_usingNativeDecorations ) - { - int w, h; - wxTopLevelWindowNative::DoGetClientSize(&w, &h); - wxRect rect = wxRect(wxTopLevelWindowNative::GetClientAreaOrigin(), - wxSize(w, h)); - rect = m_renderer->GetFrameClientArea(rect, - GetDecorationsStyle()); - return rect.GetPosition(); - } - else - { - return wxTopLevelWindowNative::GetClientAreaOrigin(); - } -} - -void wxTopLevelWindow::DoGetClientSize(int *width, int *height) const -{ - if ( !m_usingNativeDecorations ) - { - int w, h; - wxTopLevelWindowNative::DoGetClientSize(&w, &h); - wxRect rect = wxRect(wxTopLevelWindowNative::GetClientAreaOrigin(), - wxSize(w, h)); - rect = m_renderer->GetFrameClientArea(rect, - GetDecorationsStyle()); - if ( width ) - *width = rect.width; - if ( height ) - *height = rect.height; - } - else - wxTopLevelWindowNative::DoGetClientSize(width, height); -} - -void wxTopLevelWindow::DoSetClientSize(int width, int height) -{ - if ( !m_usingNativeDecorations ) - { - wxSize size = m_renderer->GetFrameTotalSize(wxSize(width, height), - GetDecorationsStyle()); - wxTopLevelWindowNative::DoSetClientSize(size.x, size.y); - } - else - wxTopLevelWindowNative::DoSetClientSize(width, height); -} - -void wxTopLevelWindow::OnNcPaint(wxNcPaintEvent& event) -{ - if ( m_usingNativeDecorations || !m_renderer ) - { - event.Skip(); - } - else // we're drawing the decorations ourselves - { - // get the window rect - wxRect rect(GetSize()); - - wxWindowDC dc(this); - m_renderer->DrawFrameTitleBar(dc, rect, - GetTitle(), m_titlebarIcon, - GetDecorationsStyle(), - m_pressedButton, - wxCONTROL_PRESSED); - } -} - -long wxTopLevelWindow::HitTest(const wxPoint& pt) const -{ - int w, h; - wxTopLevelWindowNative::DoGetClientSize(&w, &h); - wxRect rect(wxTopLevelWindowNative::GetClientAreaOrigin(), wxSize(w, h)); - - return m_renderer->HitTestFrame(rect, pt+GetClientAreaOrigin(), GetDecorationsStyle()); -} - -wxSize wxTopLevelWindow::GetMinSize() const -{ - wxSize size = wxTopLevelWindowNative::GetMinSize(); - if ( !m_usingNativeDecorations ) - { - size.IncTo(m_renderer->GetFrameMinSize(GetDecorationsStyle())); - } - - return size; -} - -// ---------------------------------------------------------------------------- -// icons -// ---------------------------------------------------------------------------- - -void wxTopLevelWindow::SetIcons(const wxIconBundle& icons) -{ - wxTopLevelWindowNative::SetIcons(icons); - - if ( !m_usingNativeDecorations && m_renderer ) - { - wxSize size = m_renderer->GetFrameIconSize(); - const wxIcon& icon = icons.GetIcon( size ); - - if ( !icon.Ok() || size.x == wxDefaultCoord ) - m_titlebarIcon = icon; - else - { - wxBitmap bmp1; - bmp1.CopyFromIcon(icon); - if ( !bmp1.Ok() ) - m_titlebarIcon = wxNullIcon; - else if ( bmp1.GetWidth() == size.x && bmp1.GetHeight() == size.y ) - m_titlebarIcon = icon; -#if wxUSE_IMAGE - else - { - wxImage img = bmp1.ConvertToImage(); - img.Rescale(size.x, size.y); - m_titlebarIcon.CopyFromBitmap(wxBitmap(img)); - } -#endif // wxUSE_IMAGE - } - } -} - -// ---------------------------------------------------------------------------- -// interactive manipulation -// ---------------------------------------------------------------------------- - - -static bool wxGetResizingCursor(long hitTestResult, wxCursor& cursor) -{ - if ( hitTestResult & wxHT_TOPLEVEL_ANY_BORDER ) - { - switch (hitTestResult) - { - case wxHT_TOPLEVEL_BORDER_N: - case wxHT_TOPLEVEL_BORDER_S: - cursor = wxCursor(wxCURSOR_SIZENS); - break; - case wxHT_TOPLEVEL_BORDER_W: - case wxHT_TOPLEVEL_BORDER_E: - cursor = wxCursor(wxCURSOR_SIZEWE); - break; - case wxHT_TOPLEVEL_BORDER_NE: - case wxHT_TOPLEVEL_BORDER_SW: - cursor = wxCursor(wxCURSOR_SIZENESW); - break; - case wxHT_TOPLEVEL_BORDER_NW: - case wxHT_TOPLEVEL_BORDER_SE: - cursor = wxCursor(wxCURSOR_SIZENWSE); - break; - default: - return false; - } - return true; - } - - return false; -} - -#define wxINTERACTIVE_RESIZE_DIR \ - (wxINTERACTIVE_RESIZE_W | wxINTERACTIVE_RESIZE_E | \ - wxINTERACTIVE_RESIZE_S | wxINTERACTIVE_RESIZE_N) - -struct wxInteractiveMoveData -{ - wxTopLevelWindow *m_window; - wxEventLoop *m_evtLoop; - int m_flags; - wxRect m_rect; - wxRect m_rectOrig; - wxPoint m_pos; - wxSize m_minSize, m_maxSize; - bool m_sizingCursor; -}; - -class wxInteractiveMoveHandler : public wxEvtHandler -{ -public: - wxInteractiveMoveHandler(wxInteractiveMoveData& data) : m_data(data) {} - -private: - DECLARE_EVENT_TABLE() - void OnMouseMove(wxMouseEvent& event); - void OnMouseDown(wxMouseEvent& event); - void OnMouseUp(wxMouseEvent& event); - void OnKeyDown(wxKeyEvent& event); - - wxInteractiveMoveData& m_data; -}; - -BEGIN_EVENT_TABLE(wxInteractiveMoveHandler, wxEvtHandler) - EVT_MOTION(wxInteractiveMoveHandler::OnMouseMove) - EVT_LEFT_DOWN(wxInteractiveMoveHandler::OnMouseDown) - EVT_LEFT_UP(wxInteractiveMoveHandler::OnMouseUp) - EVT_KEY_DOWN(wxInteractiveMoveHandler::OnKeyDown) -END_EVENT_TABLE() - - -static inline LINKAGEMODE -void wxApplyResize(wxInteractiveMoveData& data, const wxPoint& diff) -{ - if ( data.m_flags & wxINTERACTIVE_RESIZE_W ) - { - data.m_rect.x += diff.x; - data.m_rect.width -= diff.x; - } - else if ( data.m_flags & wxINTERACTIVE_RESIZE_E ) - { - data.m_rect.width += diff.x; - } - if ( data.m_flags & wxINTERACTIVE_RESIZE_N ) - { - data.m_rect.y += diff.y; - data.m_rect.height -= diff.y; - } - else if ( data.m_flags & wxINTERACTIVE_RESIZE_S ) - { - data.m_rect.height += diff.y; - } - - if ( data.m_minSize.x != wxDefaultCoord && data.m_rect.width < data.m_minSize.x ) - { - if ( data.m_flags & wxINTERACTIVE_RESIZE_W ) - data.m_rect.x -= data.m_minSize.x - data.m_rect.width; - data.m_rect.width = data.m_minSize.x; - } - if ( data.m_maxSize.x != wxDefaultCoord && data.m_rect.width > data.m_maxSize.x ) - { - if ( data.m_flags & wxINTERACTIVE_RESIZE_W ) - data.m_rect.x -= data.m_minSize.x - data.m_rect.width; - data.m_rect.width = data.m_maxSize.x; - } - if ( data.m_minSize.y != wxDefaultCoord && data.m_rect.height < data.m_minSize.y ) - { - if ( data.m_flags & wxINTERACTIVE_RESIZE_N ) - data.m_rect.y -= data.m_minSize.y - data.m_rect.height; - data.m_rect.height = data.m_minSize.y; - } - if ( data.m_maxSize.y != wxDefaultCoord && data.m_rect.height > data.m_maxSize.y ) - { - if ( data.m_flags & wxINTERACTIVE_RESIZE_N ) - data.m_rect.y -= data.m_minSize.y - data.m_rect.height; - data.m_rect.height = data.m_maxSize.y; - } -} - -void wxInteractiveMoveHandler::OnMouseMove(wxMouseEvent& event) -{ - if ( m_data.m_flags & wxINTERACTIVE_WAIT_FOR_INPUT ) - event.Skip(); - - else if ( m_data.m_flags & wxINTERACTIVE_MOVE ) - { - wxPoint diff = wxGetMousePosition() - m_data.m_pos; - m_data.m_rect = m_data.m_rectOrig; - m_data.m_rect.Offset(diff); - m_data.m_window->Move(m_data.m_rect.GetPosition()); - } - - else if ( m_data.m_flags & wxINTERACTIVE_RESIZE ) - { - wxPoint diff = wxGetMousePosition() - m_data.m_pos; - m_data.m_rect = m_data.m_rectOrig; - wxApplyResize(m_data, diff); - m_data.m_window->SetSize(m_data.m_rect); - } -} - -void wxInteractiveMoveHandler::OnMouseDown(wxMouseEvent& WXUNUSED(event)) -{ - if ( m_data.m_flags & wxINTERACTIVE_WAIT_FOR_INPUT ) - { - m_data.m_evtLoop->Exit(); - } -} - -void wxInteractiveMoveHandler::OnKeyDown(wxKeyEvent& event) -{ - wxPoint diff(wxDefaultCoord,wxDefaultCoord); - - switch ( event.GetKeyCode() ) - { - case WXK_UP: diff = wxPoint(0, -16); break; - case WXK_DOWN: diff = wxPoint(0, 16); break; - case WXK_LEFT: diff = wxPoint(-16, 0); break; - case WXK_RIGHT: diff = wxPoint(16, 0); break; - case WXK_ESCAPE: - m_data.m_window->SetSize(m_data.m_rectOrig); - m_data.m_evtLoop->Exit(); - return; - case WXK_RETURN: - m_data.m_evtLoop->Exit(); - return; - } - - if ( diff.x != wxDefaultCoord ) - { - if ( m_data.m_flags & wxINTERACTIVE_WAIT_FOR_INPUT ) - { - m_data.m_flags &= ~wxINTERACTIVE_WAIT_FOR_INPUT; - if ( m_data.m_sizingCursor ) - { - wxEndBusyCursor(); - m_data.m_sizingCursor = false; - } - - if ( m_data.m_flags & wxINTERACTIVE_MOVE ) - { - m_data.m_pos = m_data.m_window->GetPosition() + - wxPoint(m_data.m_window->GetSize().x/2, 8); - } - } - - wxPoint warp; - bool changeCur = false; - - if ( m_data.m_flags & wxINTERACTIVE_MOVE ) - { - m_data.m_rect.Offset(diff); - m_data.m_window->Move(m_data.m_rect.GetPosition()); - warp = wxPoint(m_data.m_window->GetSize().x/2, 8); - } - else /* wxINTERACTIVE_RESIZE */ - { - if ( !(m_data.m_flags & - (wxINTERACTIVE_RESIZE_N | wxINTERACTIVE_RESIZE_S)) ) - { - if ( diff.y < 0 ) - { - m_data.m_flags |= wxINTERACTIVE_RESIZE_N; - m_data.m_pos.y = m_data.m_window->GetPosition().y; - changeCur = true; - } - else if ( diff.y > 0 ) - { - m_data.m_flags |= wxINTERACTIVE_RESIZE_S; - m_data.m_pos.y = m_data.m_window->GetPosition().y + - m_data.m_window->GetSize().y; - changeCur = true; - } - } - if ( !(m_data.m_flags & - (wxINTERACTIVE_RESIZE_W | wxINTERACTIVE_RESIZE_E)) ) - { - if ( diff.x < 0 ) - { - m_data.m_flags |= wxINTERACTIVE_RESIZE_W; - m_data.m_pos.x = m_data.m_window->GetPosition().x; - changeCur = true; - } - else if ( diff.x > 0 ) - { - m_data.m_flags |= wxINTERACTIVE_RESIZE_E; - m_data.m_pos.x = m_data.m_window->GetPosition().x + - m_data.m_window->GetSize().x; - changeCur = true; - } - } - - wxApplyResize(m_data, diff); - m_data.m_window->SetSize(m_data.m_rect); - - if ( m_data.m_flags & wxINTERACTIVE_RESIZE_W ) - warp.x = 0; - else if ( m_data.m_flags & wxINTERACTIVE_RESIZE_E ) - warp.x = m_data.m_window->GetSize().x-1; - else - warp.x = wxGetMousePosition().x - m_data.m_window->GetPosition().x; - - if ( m_data.m_flags & wxINTERACTIVE_RESIZE_N ) - warp.y = 0; - else if ( m_data.m_flags & wxINTERACTIVE_RESIZE_S ) - warp.y = m_data.m_window->GetSize().y-1; - else - warp.y = wxGetMousePosition().y - m_data.m_window->GetPosition().y; - } - - warp -= m_data.m_window->GetClientAreaOrigin(); - m_data.m_window->WarpPointer(warp.x, warp.y); - - if ( changeCur ) - { - long hit = m_data.m_window->HitTest(warp); - wxCursor cur; - if ( wxGetResizingCursor(hit, cur) ) - { - if ( m_data.m_sizingCursor ) - wxEndBusyCursor(); - wxBeginBusyCursor(&cur); - m_data.m_sizingCursor = true; - } - } - } -} - -void wxInteractiveMoveHandler::OnMouseUp(wxMouseEvent& WXUNUSED(event)) -{ - m_data.m_evtLoop->Exit(); -} - - -void wxTopLevelWindow::InteractiveMove(int flags) -{ - wxASSERT_MSG( !((flags & wxINTERACTIVE_MOVE) && (flags & wxINTERACTIVE_RESIZE)), - wxT("can't move and resize window at the same time") ); - - wxASSERT_MSG( !(flags & wxINTERACTIVE_RESIZE) || - (flags & wxINTERACTIVE_WAIT_FOR_INPUT) || - (flags & wxINTERACTIVE_RESIZE_DIR), - wxT("direction of resizing not specified") ); - - wxInteractiveMoveData data; - wxEventLoop loop; - - SetFocus(); - -#ifndef __WXGTK__ - if ( flags & wxINTERACTIVE_WAIT_FOR_INPUT ) - { - wxCursor sizingCursor(wxCURSOR_SIZING); - wxBeginBusyCursor(&sizingCursor); - data.m_sizingCursor = true; - } - else -#endif - data.m_sizingCursor = false; - - data.m_window = this; - data.m_evtLoop = &loop; - data.m_flags = flags; - data.m_rect = data.m_rectOrig = GetRect(); - data.m_pos = wxGetMousePosition(); - data.m_minSize = wxSize(GetMinWidth(), GetMinHeight()); - data.m_maxSize = wxSize(GetMaxWidth(), GetMaxHeight()); - - wxEvtHandler *handler = new wxInteractiveMoveHandler(data); - this->PushEventHandler(handler); - - CaptureMouse(); - loop.Run(); - ReleaseMouse(); - - this->RemoveEventHandler(handler); - delete handler; - - if ( data.m_sizingCursor ) - wxEndBusyCursor(); -} - -// ---------------------------------------------------------------------------- -// actions -// ---------------------------------------------------------------------------- - -void wxTopLevelWindow::ClickTitleBarButton(long button) -{ - switch ( button ) - { - case wxTOPLEVEL_BUTTON_CLOSE: - Close(); - break; - - case wxTOPLEVEL_BUTTON_ICONIZE: - Iconize(); - break; - - case wxTOPLEVEL_BUTTON_MAXIMIZE: - Maximize(); - break; - - case wxTOPLEVEL_BUTTON_RESTORE: - Restore(); - break; - - case wxTOPLEVEL_BUTTON_HELP: -#if wxUSE_HELP - { - wxContextHelp contextHelp(this); - } -#endif - break; - - default: - wxFAIL_MSG(wxT("incorrect button specification")); - } -} - -bool wxTopLevelWindow::PerformAction(const wxControlAction& action, - long numArg, - const wxString& WXUNUSED(strArg)) -{ - bool isActive = numArg != 0; - - if ( action == wxACTION_TOPLEVEL_ACTIVATE ) - { - if ( m_isActive != isActive ) - { - m_isActive = isActive; - RefreshTitleBar(); - } - return true; - } - - else if ( action == wxACTION_TOPLEVEL_BUTTON_PRESS ) - { - m_pressedButton = numArg; - RefreshTitleBar(); - return true; - } - - else if ( action == wxACTION_TOPLEVEL_BUTTON_RELEASE ) - { - m_pressedButton = 0; - RefreshTitleBar(); - return true; - } - - else if ( action == wxACTION_TOPLEVEL_BUTTON_CLICK ) - { - m_pressedButton = 0; - RefreshTitleBar(); - ClickTitleBarButton(numArg); - return true; - } - - else if ( action == wxACTION_TOPLEVEL_MOVE ) - { - InteractiveMove(wxINTERACTIVE_MOVE); - return true; - } - - else if ( action == wxACTION_TOPLEVEL_RESIZE ) - { - int flags = wxINTERACTIVE_RESIZE; - if ( numArg & wxHT_TOPLEVEL_BORDER_N ) - flags |= wxINTERACTIVE_RESIZE_N; - if ( numArg & wxHT_TOPLEVEL_BORDER_S ) - flags |= wxINTERACTIVE_RESIZE_S; - if ( numArg & wxHT_TOPLEVEL_BORDER_W ) - flags |= wxINTERACTIVE_RESIZE_W; - if ( numArg & wxHT_TOPLEVEL_BORDER_E ) - flags |= wxINTERACTIVE_RESIZE_E; - InteractiveMove(flags); - return true; - } - - else - return false; -} - -void wxTopLevelWindow::OnSystemMenu(wxCommandEvent& event) -{ - bool ret = true; - - switch (event.GetId()) - { - case wxID_CLOSE_FRAME: - ret = PerformAction(wxACTION_TOPLEVEL_BUTTON_CLICK, - wxTOPLEVEL_BUTTON_CLOSE); - break; - case wxID_MOVE_FRAME: - InteractiveMove(wxINTERACTIVE_MOVE | wxINTERACTIVE_WAIT_FOR_INPUT); - break; - case wxID_RESIZE_FRAME: - InteractiveMove(wxINTERACTIVE_RESIZE | wxINTERACTIVE_WAIT_FOR_INPUT); - break; - case wxID_MAXIMIZE_FRAME: - ret = PerformAction(wxACTION_TOPLEVEL_BUTTON_CLICK, - wxTOPLEVEL_BUTTON_MAXIMIZE); - break; - case wxID_ICONIZE_FRAME: - ret = PerformAction(wxACTION_TOPLEVEL_BUTTON_CLICK, - wxTOPLEVEL_BUTTON_ICONIZE); - break; - case wxID_RESTORE_FRAME: - ret = PerformAction(wxACTION_TOPLEVEL_BUTTON_CLICK, - wxTOPLEVEL_BUTTON_RESTORE); - break; - - default: - ret = false; - } - - if ( !ret ) - event.Skip(); -} - -/* static */ -wxInputHandler * -wxTopLevelWindow::GetStdInputHandler(wxInputHandler *handlerDef) -{ - static wxStdTLWInputHandler s_handler(handlerDef); - - return &s_handler; -} - -// ============================================================================ -// wxStdTLWInputHandler: handles focus, resizing and titlebar buttons clicks -// ============================================================================ - -wxStdTLWInputHandler::wxStdTLWInputHandler(wxInputHandler *inphand) - : wxStdInputHandler(inphand) -{ - m_winCapture = NULL; - m_winHitTest = 0; - m_winPressed = 0; - m_borderCursorOn = false; -} - -bool wxStdTLWInputHandler::HandleMouse(wxInputConsumer *consumer, - const wxMouseEvent& event) -{ - // the button has 2 states: pressed and normal with the following - // transitions between them: - // - // normal -> left down -> capture mouse and go to pressed state - // pressed -> left up inside -> generate click -> go to normal - // outside ------------------> - // - // the other mouse buttons are ignored - if ( event.Button(1) ) - { - if ( event.ButtonDown(1) ) - { - wxTopLevelWindow *w = wxStaticCast(consumer->GetInputWindow(), wxTopLevelWindow); - long hit = w->HitTest(event.GetPosition()); - - if ( hit & wxHT_TOPLEVEL_ANY_BUTTON ) - { - m_winCapture = w; - m_winCapture->CaptureMouse(); - m_winHitTest = hit; - m_winPressed = hit; - consumer->PerformAction(wxACTION_TOPLEVEL_BUTTON_PRESS, m_winPressed); - return true; - } - else if ( (hit & wxHT_TOPLEVEL_TITLEBAR) && !w->IsMaximized() ) - { - consumer->PerformAction(wxACTION_TOPLEVEL_MOVE); - return true; - } - else if ( (consumer->GetInputWindow()->GetWindowStyle() & wxRESIZE_BORDER) - && (hit & wxHT_TOPLEVEL_ANY_BORDER) ) - { - consumer->PerformAction(wxACTION_TOPLEVEL_RESIZE, hit); - return true; - } - } - - else // up - { - if ( m_winCapture ) - { - m_winCapture->ReleaseMouse(); - m_winCapture = NULL; - - if ( m_winHitTest == m_winPressed ) - { - consumer->PerformAction(wxACTION_TOPLEVEL_BUTTON_CLICK, m_winPressed); - return true; - } - } - //else: the mouse was released outside the window, this doesn't - // count as a click - } - } - - return wxStdInputHandler::HandleMouse(consumer, event); -} - -bool wxStdTLWInputHandler::HandleMouseMove(wxInputConsumer *consumer, - const wxMouseEvent& event) -{ - if ( event.GetEventObject() == m_winCapture ) - { - long hit = m_winCapture->HitTest(event.GetPosition()); - - if ( hit != m_winHitTest ) - { - if ( hit != m_winPressed ) - consumer->PerformAction(wxACTION_TOPLEVEL_BUTTON_RELEASE, m_winPressed); - else - consumer->PerformAction(wxACTION_TOPLEVEL_BUTTON_PRESS, m_winPressed); - - m_winHitTest = hit; - return true; - } - } - else if ( consumer->GetInputWindow()->GetWindowStyle() & wxRESIZE_BORDER ) - { - wxTopLevelWindow *win = wxStaticCast(consumer->GetInputWindow(), - wxTopLevelWindow); - long hit = win->HitTest(event.GetPosition()); - - if ( hit != m_winHitTest ) - { - m_winHitTest = hit; - - if ( m_borderCursorOn ) - { - m_borderCursorOn = false; - win->SetCursor(m_origCursor); - } - - if ( hit & wxHT_TOPLEVEL_ANY_BORDER ) - { - wxCursor cur; - - m_borderCursorOn = wxGetResizingCursor(hit, cur); - if ( m_borderCursorOn ) - { - m_origCursor = win->GetCursor(); - win->SetCursor(cur); - } - } - } - } - - return wxStdInputHandler::HandleMouseMove(consumer, event); -} - -bool wxStdTLWInputHandler::HandleActivation(wxInputConsumer *consumer, - bool activated) -{ - if ( m_borderCursorOn ) - { - consumer->GetInputWindow()->SetCursor(m_origCursor); - m_borderCursorOn = false; - } - consumer->PerformAction(wxACTION_TOPLEVEL_ACTIVATE, activated); - return false; -} diff --git a/wxWidgets/src/univ/winuniv.cpp b/wxWidgets/src/univ/winuniv.cpp deleted file mode 100644 index 7fcf52ed70..0000000000 --- a/wxWidgets/src/univ/winuniv.cpp +++ /dev/null @@ -1,1449 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: src/univ/window.cpp -// Purpose: implementation of extra wxWindow methods for wxUniv port -// Author: Vadim Zeitlin -// Modified by: -// Created: 06.08.00 -// RCS-ID: $Id: winuniv.cpp 46437 2007-06-13 04:35:23Z SC $ -// Copyright: (c) 2000 SciTech Software, Inc. (www.scitechsoft.com) -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -// =========================================================================== -// declarations -// =========================================================================== - -// --------------------------------------------------------------------------- -// headers -// --------------------------------------------------------------------------- - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#include "wx/window.h" - -#ifndef WX_PRECOMP - #include "wx/app.h" - #include "wx/dcclient.h" - #include "wx/dcmemory.h" - #include "wx/event.h" - #include "wx/scrolbar.h" - #include "wx/menu.h" - #include "wx/frame.h" - #include "wx/log.h" -#endif // WX_PRECOMP - -#include "wx/univ/colschem.h" -#include "wx/univ/renderer.h" -#include "wx/univ/theme.h" - -#if wxUSE_CARET - #include "wx/caret.h" -#endif // wxUSE_CARET - -// turn Refresh() debugging on/off -#define WXDEBUG_REFRESH - -#ifndef __WXDEBUG__ - #undef WXDEBUG_REFRESH -#endif - -#if defined(WXDEBUG_REFRESH) && defined(__WXMSW__) && !defined(__WXMICROWIN__) -#include "wx/msw/private.h" -#endif - -// ============================================================================ -// implementation -// ============================================================================ - -// ---------------------------------------------------------------------------- -// event tables -// ---------------------------------------------------------------------------- - -// we can't use wxWindowNative here as it won't be expanded inside the macro -#if defined(__WXMSW__) - IMPLEMENT_DYNAMIC_CLASS(wxWindow, wxWindowMSW) -#elif defined(__WXGTK__) - IMPLEMENT_DYNAMIC_CLASS(wxWindow, wxWindowGTK) -#elif defined(__WXMGL__) - IMPLEMENT_DYNAMIC_CLASS(wxWindow, wxWindowMGL) -#elif defined(__WXDFB__) - IMPLEMENT_DYNAMIC_CLASS(wxWindow, wxWindowDFB) -#elif defined(__WXX11__) - IMPLEMENT_DYNAMIC_CLASS(wxWindow, wxWindowX11) -#elif defined(__WXPM__) - IMPLEMENT_DYNAMIC_CLASS(wxWindow, wxWindowOS2) -#elif defined(__WXMAC__) - IMPLEMENT_DYNAMIC_CLASS(wxWindow, wxWindowMac) -#endif - -BEGIN_EVENT_TABLE(wxWindow, wxWindowNative) - EVT_SIZE(wxWindow::OnSize) - -#if wxUSE_ACCEL || wxUSE_MENUS - EVT_KEY_DOWN(wxWindow::OnKeyDown) -#endif // wxUSE_ACCEL - -#if wxUSE_MENUS - EVT_CHAR(wxWindow::OnChar) - EVT_KEY_UP(wxWindow::OnKeyUp) -#endif // wxUSE_MENUS - - EVT_PAINT(wxWindow::OnPaint) - EVT_NC_PAINT(wxWindow::OnNcPaint) - EVT_ERASE_BACKGROUND(wxWindow::OnErase) -END_EVENT_TABLE() - -// ---------------------------------------------------------------------------- -// creation -// ---------------------------------------------------------------------------- - -void wxWindow::Init() -{ -#if wxUSE_SCROLLBAR - m_scrollbarVert = - m_scrollbarHorz = (wxScrollBar *)NULL; -#endif // wxUSE_SCROLLBAR - - m_isCurrent = false; - - m_renderer = wxTheme::Get()->GetRenderer(); - - m_oldSize.x = wxDefaultCoord; - m_oldSize.y = wxDefaultCoord; -} - -bool wxWindow::Create(wxWindow *parent, - wxWindowID id, - const wxPoint& pos, - const wxSize& size, - long style, - const wxString& name) -{ - long actualStyle = style; - - // we add wxCLIP_CHILDREN to get the same ("natural") behaviour under MSW - // as under the other platforms - actualStyle |= wxCLIP_CHILDREN; - - actualStyle &= ~wxVSCROLL; - actualStyle &= ~wxHSCROLL; - -#ifdef __WXMSW__ - // without this, borders (non-client areas in general) are not repainted - // correctly when resizing; apparently, native NC areas are fully repainted - // even without this style by MSW, but wxUniv implements client area - // itself, so it doesn't work correctly for us - // - // FIXME: this is very expensive, we need to fix the (commented-out) code - // in OnSize() instead - actualStyle |= wxFULL_REPAINT_ON_RESIZE; -#endif - - if ( !wxWindowNative::Create(parent, id, pos, size, actualStyle, name) ) - return false; - - // Set full style again, including those we didn't want present - // when calling the base window Create(). - wxWindowBase::SetWindowStyleFlag(style); - - // if we allow or should always have a vertical scrollbar, make it - if ( style & wxVSCROLL || style & wxALWAYS_SHOW_SB ) - { -#if wxUSE_TWO_WINDOWS - SetInsertIntoMain( true ); -#endif -#if wxUSE_SCROLLBAR - m_scrollbarVert = new wxScrollBar(this, wxID_ANY, - wxDefaultPosition, wxDefaultSize, - wxSB_VERTICAL); -#endif // wxUSE_SCROLLBAR -#if wxUSE_TWO_WINDOWS - SetInsertIntoMain( false ); -#endif - } - - // if we should allow a horizontal scrollbar, make it - if ( style & wxHSCROLL ) - { -#if wxUSE_TWO_WINDOWS - SetInsertIntoMain( true ); -#endif -#if wxUSE_SCROLLBAR - m_scrollbarHorz = new wxScrollBar(this, wxID_ANY, - wxDefaultPosition, wxDefaultSize, - wxSB_HORIZONTAL); -#endif // wxUSE_SCROLLBAR -#if wxUSE_TWO_WINDOWS - SetInsertIntoMain( false ); -#endif - } - -#if wxUSE_SCROLLBAR - if (m_scrollbarHorz || m_scrollbarVert) - { - // position it/them - PositionScrollbars(); - } -#endif // wxUSE_SCROLLBAR - - return true; -} - -wxWindow::~wxWindow() -{ - m_isBeingDeleted = true; - -#if wxUSE_SCROLLBAR - // clear pointers to scrollbar before deleting the children: they are - // children and so will be deleted by DestroyChildren() call below and if - // any code using the scrollbars would be called in the process or from - // ~wxWindowBase, the app would crash: - m_scrollbarVert = m_scrollbarHorz = NULL; -#endif - - // we have to destroy our children before we're destroyed because our - // children suppose that we're of type wxWindow, not just wxWindowNative, - // and so bad things may happen if they're deleted from the base class dtor - // as by then we're not a wxWindow any longer and wxUniv-specific virtual - // functions can't be called - DestroyChildren(); -} - -// ---------------------------------------------------------------------------- -// background pixmap -// ---------------------------------------------------------------------------- - -void wxWindow::SetBackground(const wxBitmap& bitmap, - int alignment, - wxStretch stretch) -{ - m_bitmapBg = bitmap; - m_alignBgBitmap = alignment; - m_stretchBgBitmap = stretch; -} - -const wxBitmap& wxWindow::GetBackgroundBitmap(int *alignment, - wxStretch *stretch) const -{ - if ( m_bitmapBg.Ok() ) - { - if ( alignment ) - *alignment = m_alignBgBitmap; - if ( stretch ) - *stretch = m_stretchBgBitmap; - } - - return m_bitmapBg; -} - -// ---------------------------------------------------------------------------- -// painting -// ---------------------------------------------------------------------------- - -// the event handlers executed when the window must be repainted -void wxWindow::OnNcPaint(wxNcPaintEvent& WXUNUSED(event)) -{ - if ( m_renderer ) - { - // get the window rect - wxRect rect(GetSize()); - -#if wxUSE_SCROLLBAR - // if the scrollbars are outside the border, we must adjust the rect to - // exclude them - if ( !m_renderer->AreScrollbarsInsideBorder() ) - { - wxScrollBar *scrollbar = GetScrollbar(wxVERTICAL); - if ( scrollbar ) - rect.width -= scrollbar->GetSize().x; - - scrollbar = GetScrollbar(wxHORIZONTAL); - if ( scrollbar ) - rect.height -= scrollbar->GetSize().y; - } -#endif // wxUSE_SCROLLBAR - - // get the DC and draw the border on it - wxWindowDC dc(this); - DoDrawBorder(dc, rect); - } -} - -void wxWindow::OnPaint(wxPaintEvent& event) -{ - if ( !m_renderer ) - { - // it is a native control which paints itself - event.Skip(); - } - else - { - // get the DC to use and create renderer on it - wxPaintDC dc(this); - wxControlRenderer renderer(this, dc, m_renderer); - - // draw the control - DoDraw(&renderer); - } -} - -// the event handler executed when the window background must be painted -void wxWindow::OnErase(wxEraseEvent& event) -{ - if ( !m_renderer ) - { - event.Skip(); - - return; - } - - DoDrawBackground(*event.GetDC()); - -#if wxUSE_SCROLLBAR - // if we have both scrollbars, we also have a square in the corner between - // them which we must paint - if ( m_scrollbarVert && m_scrollbarHorz ) - { - wxSize size = GetSize(); - wxRect rectClient = GetClientRect(), - rectBorder = m_renderer->GetBorderDimensions(GetBorder()); - - wxRect rectCorner; - rectCorner.x = rectClient.GetRight() + 1; - rectCorner.y = rectClient.GetBottom() + 1; - rectCorner.SetRight(size.x - rectBorder.width); - rectCorner.SetBottom(size.y - rectBorder.height); - - if ( GetUpdateRegion().Contains(rectCorner) ) - { - m_renderer->DrawScrollCorner(*event.GetDC(), rectCorner); - } - } -#endif // wxUSE_SCROLLBAR -} - -bool wxWindow::DoDrawBackground(wxDC& dc) -{ - wxRect rect; - - wxSize size = GetSize(); // Why not GetClientSize() ? - rect.x = 0; - rect.y = 0; - rect.width = size.x; - rect.height = size.y; - - wxWindow * const parent = GetParent(); - if ( HasTransparentBackground() && !UseBgCol() && parent ) - { - wxASSERT( !IsTopLevel() ); - - wxPoint pos = GetPosition(); - - AdjustForParentClientOrigin( pos.x, pos.y, 0 ); - - // Adjust DC logical origin - wxCoord org_x, org_y, x, y; - dc.GetLogicalOrigin( &org_x, &org_y ); - x = org_x + pos.x; - y = org_y + pos.y; - dc.SetLogicalOrigin( x, y ); - - // Adjust draw rect - rect.x = pos.x; - rect.y = pos.y; - - // Let parent draw the background - parent->EraseBackground( dc, rect ); - - // Restore DC logical origin - dc.SetLogicalOrigin( org_x, org_y ); - } - else - { - // Draw background ourselves - EraseBackground( dc, rect ); - } - - return true; -} - -void wxWindow::EraseBackground(wxDC& dc, const wxRect& rect) -{ - if ( GetBackgroundBitmap().Ok() ) - { - // Get the bitmap and the flags - int alignment; - wxStretch stretch; - wxBitmap bmp = GetBackgroundBitmap(&alignment, &stretch); - wxControlRenderer::DrawBitmap(dc, bmp, rect, alignment, stretch); - } - else - { - // Just fill it with bg colour if no bitmap - - m_renderer->DrawBackground(dc, wxTHEME_BG_COLOUR(this), - rect, GetStateFlags()); - } -} - -void wxWindow::DoDrawBorder(wxDC& dc, const wxRect& rect) -{ - // draw outline unless the update region is enitrely inside it in which - // case we don't need to do it -#if 0 // doesn't seem to work, why? - if ( wxRegion(rect).Contains(GetUpdateRegion().GetBox()) != wxInRegion ) -#endif - { - m_renderer->DrawBorder(dc, GetBorder(), rect, GetStateFlags()); - } -} - -void wxWindow::DoDraw(wxControlRenderer * WXUNUSED(renderer)) -{ -} - -void wxWindow::Refresh(bool eraseBackground, const wxRect *rect) -{ - wxRect rectClient; // the same rectangle in client coordinates - wxPoint origin = GetClientAreaOrigin(); - - wxSize size = GetClientSize(); - - if ( rect ) - { - // the rectangle passed as argument is in client coordinates - rectClient = *rect; - - // don't refresh anything beyond the client area (scrollbars for - // example) - if ( rectClient.GetRight() > size.x ) - rectClient.SetRight(size.x); - if ( rectClient.GetBottom() > size.y ) - rectClient.SetBottom(size.y); - - } - else // refresh the entire client area - { - // x,y is already set to 0 by default - rectClient.SetSize(size); - } - - // convert refresh rectangle to window coordinates: - wxRect rectWin(rectClient); - rectWin.Offset(origin); - - // debugging helper -#ifdef WXDEBUG_REFRESH - static bool s_refreshDebug = false; - if ( s_refreshDebug ) - { - wxWindowDC dc(this); - dc.SetBrush(*wxCYAN_BRUSH); - dc.SetPen(*wxTRANSPARENT_PEN); - dc.DrawRectangle(rectWin); - - // under Unix we use "--sync" X option for this - #if defined(__WXMSW__) && !defined(__WXMICROWIN__) - ::GdiFlush(); - ::Sleep(200); - #endif // __WXMSW__ - } -#endif // WXDEBUG_REFRESH - - wxWindowNative::Refresh(eraseBackground, &rectWin); - - // Refresh all sub controls if any. - wxWindowList& children = GetChildren(); - for ( wxWindowList::iterator i = children.begin(); i != children.end(); ++i ) - { - wxWindow *child = *i; - // only refresh subcontrols if they are visible: - if ( child->IsTopLevel() || !child->IsShown() || child->IsFrozen() ) - continue; - - // ...and when the subcontrols are in the update region: - wxRect childrect(child->GetRect()); - childrect.Intersect(rectClient); - if ( childrect.IsEmpty() ) - continue; - - // refresh the subcontrol now: - childrect.Offset(-child->GetPosition()); - // NB: We must call wxWindowNative version because we need to refresh - // the entire control, not just its client area, and this is why we - // don't account for child client area origin here neither. Also - // note that we don't pass eraseBackground to the child, but use - // true instead: this is because we can't be sure that - // eraseBackground=false is safe for children as well and not only - // for the parent. - child->wxWindowNative::Refresh(eraseBackground, &childrect); - } -} - -// ---------------------------------------------------------------------------- -// state flags -// ---------------------------------------------------------------------------- - -bool wxWindow::Enable(bool enable) -{ - if ( !wxWindowNative::Enable(enable) ) - return false; - - // disabled window can't keep focus - if ( FindFocus() == this && GetParent() != NULL ) - { - GetParent()->SetFocus(); - } - - if ( m_renderer ) - { - // a window with renderer is drawn by ourselves and it has to be - // refreshed to reflect its new status - Refresh(); - } - - return true; -} - -bool wxWindow::IsFocused() const -{ - return FindFocus() == this; -} - -bool wxWindow::IsPressed() const -{ - return false; -} - -bool wxWindow::IsDefault() const -{ - return false; -} - -bool wxWindow::IsCurrent() const -{ - return m_isCurrent; -} - -bool wxWindow::SetCurrent(bool doit) -{ - if ( doit == m_isCurrent ) - return false; - - m_isCurrent = doit; - - if ( CanBeHighlighted() ) - Refresh(); - - return true; -} - -int wxWindow::GetStateFlags() const -{ - int flags = 0; - if ( !IsEnabled() ) - flags |= wxCONTROL_DISABLED; - - // the following states are only possible if our application is active - if - // it is not, even our default/focused controls shouldn't appear as such - if ( wxTheApp->IsActive() ) - { - if ( IsCurrent() ) - flags |= wxCONTROL_CURRENT; - if ( IsFocused() ) - flags |= wxCONTROL_FOCUSED; - if ( IsPressed() ) - flags |= wxCONTROL_PRESSED; - if ( IsDefault() ) - flags |= wxCONTROL_ISDEFAULT; - } - - return flags; -} - -// ---------------------------------------------------------------------------- -// size -// ---------------------------------------------------------------------------- - -void wxWindow::OnSize(wxSizeEvent& event) -{ - event.Skip(); - -#if wxUSE_SCROLLBAR - if ( m_scrollbarVert || m_scrollbarHorz ) - { - PositionScrollbars(); - } -#endif // wxUSE_SCROLLBAR - -#if 0 // ndef __WXMSW__ - // Refresh the area (strip) previously occupied by the border - - if ( !HasFlag(wxFULL_REPAINT_ON_RESIZE) && IsShown() ) - { - // This code assumes that wxSizeEvent.GetSize() returns - // the area of the entire window, not just the client - // area. - wxSize newSize = event.GetSize(); - - if (m_oldSize.x == wxDefaultCoord && m_oldSize.y == wxDefaultCoord) - { - m_oldSize = newSize; - return; - } - - if (HasFlag( wxSIMPLE_BORDER )) - { - if (newSize.y > m_oldSize.y) - { - wxRect rect; - rect.x = 0; - rect.width = m_oldSize.x; - rect.y = m_oldSize.y-2; - rect.height = 1; - Refresh( true, &rect ); - } - else if (newSize.y < m_oldSize.y) - { - wxRect rect; - rect.y = newSize.y; - rect.x = 0; - rect.height = 1; - rect.width = newSize.x; - wxWindowNative::Refresh( true, &rect ); - } - - if (newSize.x > m_oldSize.x) - { - wxRect rect; - rect.y = 0; - rect.height = m_oldSize.y; - rect.x = m_oldSize.x-2; - rect.width = 1; - Refresh( true, &rect ); - } - else if (newSize.x < m_oldSize.x) - { - wxRect rect; - rect.x = newSize.x; - rect.y = 0; - rect.width = 1; - rect.height = newSize.y; - wxWindowNative::Refresh( true, &rect ); - } - } - else - if (HasFlag( wxSUNKEN_BORDER ) || HasFlag( wxRAISED_BORDER )) - { - if (newSize.y > m_oldSize.y) - { - wxRect rect; - rect.x = 0; - rect.width = m_oldSize.x; - rect.y = m_oldSize.y-4; - rect.height = 2; - Refresh( true, &rect ); - } - else if (newSize.y < m_oldSize.y) - { - wxRect rect; - rect.y = newSize.y; - rect.x = 0; - rect.height = 2; - rect.width = newSize.x; - wxWindowNative::Refresh( true, &rect ); - } - - if (newSize.x > m_oldSize.x) - { - wxRect rect; - rect.y = 0; - rect.height = m_oldSize.y; - rect.x = m_oldSize.x-4; - rect.width = 2; - Refresh( true, &rect ); - } - else if (newSize.x < m_oldSize.x) - { - wxRect rect; - rect.x = newSize.x; - rect.y = 0; - rect.width = 2; - rect.height = newSize.y; - wxWindowNative::Refresh( true, &rect ); - } - } - - m_oldSize = newSize; - } -#endif -} - -wxSize wxWindow::DoGetBestSize() const -{ - return AdjustSize(DoGetBestClientSize()); -} - -wxSize wxWindow::DoGetBestClientSize() const -{ - return wxWindowNative::DoGetBestSize(); -} - -wxSize wxWindow::AdjustSize(const wxSize& size) const -{ - wxSize sz = size; - if ( m_renderer ) - m_renderer->AdjustSize(&sz, this); - return sz; -} - -wxPoint wxWindow::GetClientAreaOrigin() const -{ - wxPoint pt = wxWindowBase::GetClientAreaOrigin(); - -#if wxUSE_TWO_WINDOWS -#else - if ( m_renderer ) - pt += m_renderer->GetBorderDimensions(GetBorder()).GetPosition(); -#endif - - return pt; -} - -void wxWindow::DoGetClientSize(int *width, int *height) const -{ - // if it is a native window, we assume it handles the scrollbars itself - // too - and if it doesn't, there is not much we can do - if ( !m_renderer ) - { - wxWindowNative::DoGetClientSize(width, height); - - return; - } - - int w, h; - wxWindowNative::DoGetClientSize(&w, &h); - - // we assume that the scrollbars are positioned correctly (by a previous - // call to PositionScrollbars()) here - - wxRect rectBorder; - if ( m_renderer ) - rectBorder = m_renderer->GetBorderDimensions(GetBorder()); - - if ( width ) - { -#if wxUSE_SCROLLBAR - // in any case, take account of the scrollbar - if ( m_scrollbarVert ) - w -= m_scrollbarVert->GetSize().x; -#endif // wxUSE_SCROLLBAR - - // account for the left and right borders - *width = w - rectBorder.x - rectBorder.width; - - // we shouldn't return invalid width - if ( *width < 0 ) - *width = 0; - } - - if ( height ) - { -#if wxUSE_SCROLLBAR - if ( m_scrollbarHorz ) - h -= m_scrollbarHorz->GetSize().y; -#endif // wxUSE_SCROLLBAR - - *height = h - rectBorder.y - rectBorder.height; - - // we shouldn't return invalid height - if ( *height < 0 ) - *height = 0; - } -} - -void wxWindow::DoSetClientSize(int width, int height) -{ - // take into account the borders - wxRect rectBorder = m_renderer->GetBorderDimensions(GetBorder()); - width += rectBorder.x; - height += rectBorder.y; - - // and the scrollbars (as they may be offset into the border, use the - // scrollbar position, not size - this supposes that PositionScrollbars() - // had been called before) - wxSize size = GetSize(); -#if wxUSE_SCROLLBAR - if ( m_scrollbarVert ) - width += size.x - m_scrollbarVert->GetPosition().x; -#endif // wxUSE_SCROLLBAR - width += rectBorder.width; - -#if wxUSE_SCROLLBAR - if ( m_scrollbarHorz ) - height += size.y - m_scrollbarHorz->GetPosition().y; -#endif // wxUSE_SCROLLBAR - height += rectBorder.height; - - wxWindowNative::DoSetClientSize(width, height); -} - -wxHitTest wxWindow::DoHitTest(wxCoord x, wxCoord y) const -{ - wxHitTest ht = wxWindowNative::DoHitTest(x, y); - -#if wxUSE_SCROLLBAR - if ( ht == wxHT_WINDOW_INSIDE ) - { - if ( m_scrollbarVert && x >= m_scrollbarVert->GetPosition().x ) - { - // it can still be changed below because it may also be the corner - ht = wxHT_WINDOW_VERT_SCROLLBAR; - } - - if ( m_scrollbarHorz && y >= m_scrollbarHorz->GetPosition().y ) - { - ht = ht == wxHT_WINDOW_VERT_SCROLLBAR ? wxHT_WINDOW_CORNER - : wxHT_WINDOW_HORZ_SCROLLBAR; - } - } -#endif // wxUSE_SCROLLBAR - - return ht; -} - -// ---------------------------------------------------------------------------- -// scrolling: we implement it entirely ourselves except for ScrollWindow() -// function which is supposed to be (efficiently) implemented by the native -// window class -// ---------------------------------------------------------------------------- - -void wxWindow::RefreshScrollbars() -{ -#if wxUSE_SCROLLBAR - if ( m_scrollbarHorz ) - m_scrollbarHorz->Refresh(); - - if ( m_scrollbarVert ) - m_scrollbarVert->Refresh(); -#endif // wxUSE_SCROLLBAR -} - -void wxWindow::PositionScrollbars() -{ -#if wxUSE_SCROLLBAR - // do not use GetClientSize/Rect as it relies on the scrollbars being - // correctly positioned - - wxSize size = GetSize(); - wxBorder border = GetBorder(); - wxRect rectBorder = m_renderer->GetBorderDimensions(border); - bool inside = m_renderer->AreScrollbarsInsideBorder(); - - int height = m_scrollbarHorz ? m_scrollbarHorz->GetSize().y : 0; - int width = m_scrollbarVert ? m_scrollbarVert->GetSize().x : 0; - - wxRect rectBar; - if ( m_scrollbarVert ) - { - rectBar.x = size.x - width; - if ( inside ) - rectBar.x -= rectBorder.width; - rectBar.width = width; - rectBar.y = 0; - if ( inside ) - rectBar.y += rectBorder.y; - rectBar.height = size.y - height; - if ( inside ) - rectBar.height -= rectBorder.y + rectBorder.height; - - m_scrollbarVert->SetSize(rectBar, wxSIZE_NO_ADJUSTMENTS); - } - - if ( m_scrollbarHorz ) - { - rectBar.y = size.y - height; - if ( inside ) - rectBar.y -= rectBorder.height; - rectBar.height = height; - rectBar.x = 0; - if ( inside ) - rectBar.x += rectBorder.x; - rectBar.width = size.x - width; - if ( inside ) - rectBar.width -= rectBorder.x + rectBorder.width; - - m_scrollbarHorz->SetSize(rectBar, wxSIZE_NO_ADJUSTMENTS); - } - - RefreshScrollbars(); -#endif // wxUSE_SCROLLBAR -} - -void wxWindow::SetScrollbar(int orient, - int pos, - int pageSize, - int range, - bool refresh) -{ -#if wxUSE_SCROLLBAR - wxASSERT_MSG( pageSize <= range, - _T("page size can't be greater than range") ); - - bool hasClientSizeChanged = false; - wxScrollBar *scrollbar = GetScrollbar(orient); - if ( range && (pageSize < range) ) - { - if ( !scrollbar ) - { - // create it -#if wxUSE_TWO_WINDOWS - SetInsertIntoMain( true ); -#endif - scrollbar = new wxScrollBar(this, wxID_ANY, - wxDefaultPosition, wxDefaultSize, - orient & wxVERTICAL ? wxSB_VERTICAL - : wxSB_HORIZONTAL); -#if wxUSE_TWO_WINDOWS - SetInsertIntoMain( false ); -#endif - if ( orient & wxVERTICAL ) - m_scrollbarVert = scrollbar; - else - m_scrollbarHorz = scrollbar; - - // the client area diminished as we created a scrollbar - hasClientSizeChanged = true; - - PositionScrollbars(); - } - else if ( GetWindowStyle() & wxALWAYS_SHOW_SB ) - { - // we might have disabled it before - scrollbar->Enable(); - } - - scrollbar->SetScrollbar(pos, pageSize, range, pageSize, refresh); - } - else // no range means no scrollbar - { - if ( scrollbar ) - { - // wxALWAYS_SHOW_SB only applies to the vertical scrollbar - if ( (orient & wxVERTICAL) && (GetWindowStyle() & wxALWAYS_SHOW_SB) ) - { - // just disable the scrollbar - scrollbar->SetScrollbar(pos, pageSize, range, pageSize, refresh); - scrollbar->Disable(); - } - else // really remove the scrollbar - { - delete scrollbar; - - if ( orient & wxVERTICAL ) - m_scrollbarVert = NULL; - else - m_scrollbarHorz = NULL; - - // the client area increased as we removed a scrollbar - hasClientSizeChanged = true; - - // the size of the remaining scrollbar must be adjusted - if ( m_scrollbarHorz || m_scrollbarVert ) - { - PositionScrollbars(); - } - } - } - } - - // give the window a chance to relayout - if ( hasClientSizeChanged ) - { -#if wxUSE_TWO_WINDOWS - wxWindowNative::SetSize( GetSize() ); -#else - wxSizeEvent event(GetSize()); - (void)GetEventHandler()->ProcessEvent(event); -#endif - } -#else - wxUnusedVar(orient); - wxUnusedVar(pos); - wxUnusedVar(pageSize); - wxUnusedVar(range); - wxUnusedVar(refresh); -#endif // wxUSE_SCROLLBAR -} - -void wxWindow::SetScrollPos(int orient, int pos, bool WXUNUSED(refresh)) -{ -#if wxUSE_SCROLLBAR - wxScrollBar *scrollbar = GetScrollbar(orient); - - if (scrollbar) - scrollbar->SetThumbPosition(pos); - - // VZ: I think we can safely ignore this as we always refresh it - // automatically whenever the value chanegs -#if 0 - if ( refresh ) - Refresh(); -#endif -#else - wxUnusedVar(orient); - wxUnusedVar(pos); -#endif // wxUSE_SCROLLBAR -} - -int wxWindow::GetScrollPos(int orient) const -{ -#if wxUSE_SCROLLBAR - wxScrollBar *scrollbar = GetScrollbar(orient); - return scrollbar ? scrollbar->GetThumbPosition() : 0; -#else - wxUnusedVar(orient); - return 0; -#endif // wxUSE_SCROLLBAR -} - -int wxWindow::GetScrollThumb(int orient) const -{ -#if wxUSE_SCROLLBAR - wxScrollBar *scrollbar = GetScrollbar(orient); - return scrollbar ? scrollbar->GetThumbSize() : 0; -#else - wxUnusedVar(orient); - return 0; -#endif // wxUSE_SCROLLBAR -} - -int wxWindow::GetScrollRange(int orient) const -{ -#if wxUSE_SCROLLBAR - wxScrollBar *scrollbar = GetScrollbar(orient); - return scrollbar ? scrollbar->GetRange() : 0; -#else - wxUnusedVar(orient); - return 0; -#endif // wxUSE_SCROLLBAR -} - -void wxWindow::ScrollWindow(int dx, int dy, const wxRect *rect) -{ - // use native scrolling when available and do it in generic way - // otherwise: -#ifdef __WXX11__ - - wxWindowNative::ScrollWindow(dx, dy, rect); - -#else // !wxX11 - - // before scrolling it, ensure that we don't have any unpainted areas - Update(); - - wxRect r; - - if ( dx ) - { - r = ScrollNoRefresh(dx, 0, rect); - Refresh(true /* erase bkgnd */, &r); - } - - if ( dy ) - { - r = ScrollNoRefresh(0, dy, rect); - Refresh(true /* erase bkgnd */, &r); - } - - // scroll children accordingly: - wxPoint offset(dx, dy); - - for (wxWindowList::compatibility_iterator node = GetChildren().GetFirst(); - node; node = node->GetNext()) - { - wxWindow *child = node->GetData(); -#if wxUSE_SCROLLBAR - if ( child == m_scrollbarVert || child == m_scrollbarHorz ) - continue; -#endif // wxUSE_SCROLLBAR - - // VS: Scrolling children has non-trivial semantics. If rect=NULL then - // it is easy: we scroll all children. Otherwise it gets - // complicated: - // 1. if scrolling in one direction only, scroll only - // those children that intersect shaft defined by the rectangle - // and scrolling direction - // 2. if scrolling in both axes, scroll all children - - bool shouldMove = false; - - if ( rect && (dx * dy == 0 /* moving in only one of x, y axis */) ) - { - wxRect childRect = child->GetRect(); - if ( dx == 0 && (childRect.GetLeft() <= rect->GetRight() || - childRect.GetRight() >= rect->GetLeft()) ) - { - shouldMove = true; - } - else if ( dy == 0 && (childRect.GetTop() <= rect->GetBottom() || - childRect.GetBottom() >= rect->GetTop()) ) - { - shouldMove = true; - } - // else: child outside of scrolling shaft, don't move - } - else // scrolling in both axes or rect=NULL - { - shouldMove = true; - } - - if ( shouldMove ) - child->Move(child->GetPosition() + offset, wxSIZE_ALLOW_MINUS_ONE); - } -#endif // wxX11/!wxX11 -} - -wxRect wxWindow::ScrollNoRefresh(int dx, int dy, const wxRect *rectTotal) -{ - wxASSERT_MSG( !dx || !dy, _T("can't be used for diag scrolling") ); - - // the rect to refresh (which we will calculate) - wxRect rect; - - if ( !dx && !dy ) - { - // nothing to do - return rect; - } - - // calculate the part of the window which we can just redraw in the new - // location - wxSize sizeTotal = rectTotal ? rectTotal->GetSize() : GetClientSize(); - - wxLogTrace(_T("scroll"), _T("rect is %dx%d, scroll by %d, %d"), - sizeTotal.x, sizeTotal.y, dx, dy); - - // the initial and end point of the region we move in client coords - wxPoint ptSource, ptDest; - if ( rectTotal ) - { - ptSource = rectTotal->GetPosition(); - ptDest = rectTotal->GetPosition(); - } - - // the size of this region - wxSize size; - size.x = sizeTotal.x - abs(dx); - size.y = sizeTotal.y - abs(dy); - if ( size.x <= 0 || size.y <= 0 ) - { - // just redraw everything as nothing of the displayed image will stay - wxLogTrace(_T("scroll"), _T("refreshing everything")); - - rect = rectTotal ? *rectTotal : wxRect(0, 0, sizeTotal.x, sizeTotal.y); - } - else // move the part which doesn't change to the new location - { - // note that when we scroll the canvas in some direction we move the - // block which doesn't need to be refreshed in the opposite direction - - if ( dx < 0 ) - { - // scroll to the right, move to the left - ptSource.x -= dx; - } - else - { - // scroll to the left, move to the right - ptDest.x += dx; - } - - if ( dy < 0 ) - { - // scroll down, move up - ptSource.y -= dy; - } - else - { - // scroll up, move down - ptDest.y += dy; - } - -#if wxUSE_CARET - // we need to hide the caret before moving or it will erase itself at - // the wrong (old) location - wxCaret *caret = GetCaret(); - if ( caret ) - caret->Hide(); -#endif // wxUSE_CARET - - // do move - wxClientDC dc(this); - wxBitmap bmp(size.x, size.y); - wxMemoryDC dcMem; - dcMem.SelectObject(bmp); - - dcMem.Blit(wxPoint(0,0), size, &dc, ptSource -#if defined(__WXGTK__) && !defined(wxHAS_WORKING_GTK_DC_BLIT) - + GetClientAreaOrigin() -#endif // broken wxGTK wxDC::Blit - ); - dc.Blit(ptDest, size, &dcMem, wxPoint(0,0)); - - wxLogTrace(_T("scroll"), - _T("Blit: (%d, %d) of size %dx%d -> (%d, %d)"), - ptSource.x, ptSource.y, - size.x, size.y, - ptDest.x, ptDest.y); - - // and now repaint the uncovered area - - // FIXME: We repaint the intersection of these rectangles twice - is - // it bad? I don't think so as it is rare to scroll the window - // diagonally anyhow and so adding extra logic to compute - // rectangle intersection is probably not worth the effort - - rect.x = ptSource.x; - rect.y = ptSource.y; - - if ( dx ) - { - if ( dx < 0 ) - { - // refresh the area along the right border - rect.x += size.x + dx; - rect.width = -dx; - } - else - { - // refresh the area along the left border - rect.width = dx; - } - - rect.height = sizeTotal.y; - - wxLogTrace(_T("scroll"), _T("refreshing (%d, %d)-(%d, %d)"), - rect.x, rect.y, - rect.GetRight() + 1, rect.GetBottom() + 1); - } - - if ( dy ) - { - if ( dy < 0 ) - { - // refresh the area along the bottom border - rect.y += size.y + dy; - rect.height = -dy; - } - else - { - // refresh the area along the top border - rect.height = dy; - } - - rect.width = sizeTotal.x; - - wxLogTrace(_T("scroll"), _T("refreshing (%d, %d)-(%d, %d)"), - rect.x, rect.y, - rect.GetRight() + 1, rect.GetBottom() + 1); - } - -#if wxUSE_CARET - if ( caret ) - caret->Show(); -#endif // wxUSE_CARET - } - - return rect; -} - -// ---------------------------------------------------------------------------- -// accelerators and menu hot keys -// ---------------------------------------------------------------------------- - -#if wxUSE_MENUS - // the last window over which Alt was pressed (used by OnKeyUp) - wxWindow *wxWindow::ms_winLastAltPress = NULL; -#endif // wxUSE_MENUS - -#if wxUSE_ACCEL || wxUSE_MENUS - -void wxWindow::OnKeyDown(wxKeyEvent& event) -{ -#if wxUSE_MENUS - int key = event.GetKeyCode(); - if ( !event.ControlDown() && (key == WXK_ALT || key == WXK_F10) ) - { - ms_winLastAltPress = this; - - // it can't be an accel anyhow - return; - } - - ms_winLastAltPress = NULL; -#endif // wxUSE_MENUS - -#if wxUSE_ACCEL - for ( wxWindow *win = this; win; win = win->GetParent() ) - { - int command = win->GetAcceleratorTable()->GetCommand(event); - if ( command != -1 ) - { - wxCommandEvent eventCmd(wxEVT_COMMAND_MENU_SELECTED, command); - if ( win->GetEventHandler()->ProcessEvent(eventCmd) ) - { - // skip "event.Skip()" below - return; - } - } - - if ( win->IsTopLevel() ) - { - // try the frame menu bar -#if wxUSE_MENUS - wxFrame *frame = wxDynamicCast(win, wxFrame); - if ( frame ) - { - wxMenuBar *menubar = frame->GetMenuBar(); - if ( menubar && menubar->ProcessAccelEvent(event) ) - { - // skip "event.Skip()" below - return; - } - } -#endif // wxUSE_MENUS - -#if wxUSE_BUTTON - // if it wasn't in a menu, try to find a button - if ( command != -1 ) - { - wxWindow* child = win->FindWindow(command); - if ( child && wxDynamicCast(child, wxButton) ) - { - wxCommandEvent eventCmd(wxEVT_COMMAND_BUTTON_CLICKED, command); - eventCmd.SetEventObject(child); - if ( child->GetEventHandler()->ProcessEvent(eventCmd) ) - { - // skip "event.Skip()" below - return; - } - } - } -#endif // wxUSE_BUTTON - - // don't propagate accels from the child frame to the parent one - break; - } - } -#endif // wxUSE_ACCEL - - event.Skip(); -} - -#endif // wxUSE_ACCEL - -#if wxUSE_MENUS - -wxMenuBar *wxWindow::GetParentFrameMenuBar() const -{ - for ( const wxWindow *win = this; win; win = win->GetParent() ) - { - if ( win->IsTopLevel() ) - { - wxFrame *frame = wxDynamicCast(win, wxFrame); - if ( frame ) - { - return frame->GetMenuBar(); - } - - // don't look further - we don't want to return the menubar of the - // parent frame - break; - } - } - - return NULL; -} - -void wxWindow::OnChar(wxKeyEvent& event) -{ - if ( event.AltDown() && !event.ControlDown() ) - { - int key = event.GetKeyCode(); - - wxMenuBar *menubar = GetParentFrameMenuBar(); - if ( menubar ) - { - int item = menubar->FindNextItemForAccel(-1, key); - if ( item != -1 ) - { - menubar->PopupMenu((size_t)item); - - // skip "event.Skip()" below - return; - } - } - } - - event.Skip(); -} - -void wxWindow::OnKeyUp(wxKeyEvent& event) -{ - int key = event.GetKeyCode(); - if ( !event.HasModifiers() && (key == WXK_ALT || key == WXK_F10) ) - { - // only process Alt release specially if there were no other key - // presses since Alt had been pressed and if both events happened in - // the same window - if ( ms_winLastAltPress == this ) - { - wxMenuBar *menubar = GetParentFrameMenuBar(); - if ( menubar && this != menubar ) - { - menubar->SelectMenu(0); - } - } - } - else - { - event.Skip(); - } - - // in any case reset it - ms_winLastAltPress = NULL; -} - -#endif // wxUSE_MENUS - -// ---------------------------------------------------------------------------- -// MSW-specific section -// ---------------------------------------------------------------------------- - -#ifdef __WXMSW__ - -#include "wx/msw/private.h" - -WXLRESULT wxWindow::MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lParam) -{ - if ( message == WM_NCHITTEST ) - { - // the windows which contain the other windows should let the mouse - // events through, otherwise a window inside a static box would - // never get any events at all - if ( IsStaticBox() ) - { - return HTTRANSPARENT; - } - } - - return wxWindowNative::MSWWindowProc(message, wParam, lParam); -} - -#endif // __WXMSW__ diff --git a/wxWidgets/src/unix/baseunix.cpp b/wxWidgets/src/unix/baseunix.cpp deleted file mode 100644 index 727f61cab2..0000000000 --- a/wxWidgets/src/unix/baseunix.cpp +++ /dev/null @@ -1,83 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: src/unix/baseunix.cpp -// Purpose: misc stuff only used in console applications under Unix -// Author: Vadim Zeitlin -// Modified by: -// Created: 23.06.2003 -// RCS-ID: $Id: baseunix.cpp 40599 2006-08-13 21:00:32Z VZ $ -// Copyright: (c) 2003 Vadim Zeitlin -// License: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -// for compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#ifndef WX_PRECOMP - #include "wx/log.h" - #include "wx/intl.h" - #include "wx/utils.h" -#endif //WX_PRECOMP - -#include "wx/apptrait.h" -#include "wx/unix/execute.h" - -// for waitpid() -#include -#include - -// ============================================================================ -// wxConsoleAppTraits implementation -// ============================================================================ - -// ---------------------------------------------------------------------------- -// wxExecute support -// ---------------------------------------------------------------------------- - -bool wxConsoleAppTraits::CreateEndProcessPipe(wxExecuteData& WXUNUSED(data)) -{ - // nothing to do, so always ok - return true; -} - -bool -wxConsoleAppTraits::IsWriteFDOfEndProcessPipe(wxExecuteData& WXUNUSED(data), - int WXUNUSED(fd)) -{ - // we don't have any pipe - return false; -} - -void -wxConsoleAppTraits::DetachWriteFDOfEndProcessPipe(wxExecuteData& WXUNUSED(data)) -{ - // nothing to do -} - - -int -wxConsoleAppTraits::WaitForChild(wxExecuteData& execData) -{ - wxASSERT_MSG( execData.flags & wxEXEC_SYNC, - wxT("async execution not supported yet") ); - - int exitcode = 0; - if ( waitpid(execData.pid, &exitcode, 0) == -1 || !WIFEXITED(exitcode) ) - { - wxLogSysError(_("Waiting for subprocess termination failed")); - } - - return exitcode; -} - diff --git a/wxWidgets/src/unix/descrip.mms b/wxWidgets/src/unix/descrip.mms deleted file mode 100644 index 5aabe90bbe..0000000000 --- a/wxWidgets/src/unix/descrip.mms +++ /dev/null @@ -1,120 +0,0 @@ -#***************************************************************************** -# * -# Make file for VMS * -# Author : J.Jansen (joukj@hrem.nano.tudelft.nl) * -# Date : 13 February 2006 * -# * -#***************************************************************************** -.first - define wx [--.include.wx] - -.ifdef __WXMOTIF__ -CXX_DEFINE = /define=(__WXMOTIF__=1)/name=(as_is,short)\ - /assume=(nostdnew,noglobal_array_new) -CC_DEFINE = /define=(__WXMOTIF__=1)/name=(as_is,short) -.else -.ifdef __WXGTK__ -CXX_DEFINE = /define=(__WXGTK__=1)/float=ieee/name=(as_is,short)/ieee=denorm\ - /assume=(nostdnew,noglobal_array_new) -CC_DEFINE = /define=(__WXGTK__=1)/float=ieee/name=(as_is,short)/ieee=denorm -.else -.ifdef __WXGTK2__ -CXX_DEFINE = /define=(__WXGTK__=1,VMS_GTK2)/float=ieee/name=(as_is,short)/ieee=denorm\ - /assume=(nostdnew,noglobal_array_new) -CC_DEFINE = /define=(__WXGTK__=1,VMS_GTK2)/float=ieee/name=(as_is,short)/ieee=denorm -.else -.ifdef __WXX11__ -CXX_DEFINE = /define=(__WXX11__=1,__WXUNIVERSAL__==1)/float=ieee\ - /name=(as_is,short)/assume=(nostdnew,noglobal_array_new) -CC_DEFINE = /define=(__WXX11__=1,__WXUNIVERSAL__==1)/float=ieee\ - /name=(as_is,short) -.else -CXX_DEFINE = -CC_DEFINE = -.endif -.endif -.endif -.endif - -.suffixes : .cpp - -.cpp.obj : - cxx $(CXXFLAGS)$(CXX_DEFINE) $(MMS$TARGET_NAME).cpp -.c.obj : - cc $(CFLAGS)$(CC_DEFINE) $(MMS$TARGET_NAME).c - -OBJECTS = baseunix.obj,\ - dialup.obj,\ - dir.obj,\ - displayx11.obj,\ - dlunix.obj,\ - fontenum.obj,\ - fontutil.obj,\ - gsocket.obj,\ - mimetype.obj,\ - threadpsx.obj,\ - utilsunx.obj,\ - utilsx11.obj,\ - joystick.obj,\ - snglinst.obj,\ - sound.obj,\ - sound_sdl.obj,\ - stdpaths.obj,\ - taskbarx11.obj - -SOURCES = baseunix.cpp,\ - dialup.cpp,\ - dir.cpp,\ - displayx11.cpp,\ - dlunix.cpp,\ - fontenum.cpp,\ - fontutil.cpp,\ - gsocket.cpp,\ - mimetype.cpp,\ - threadpsx.cpp,\ - utilsunx.cpp,\ - utilsx11.cpp,\ - joystick.cpp,\ - snglinst.cpp,\ - sound.cpp,\ - sound_sdl.cpp,\ - stdpaths.cpp,\ - taskbarx11.cpp - -all : $(SOURCES) - $(MMS)$(MMSQUALIFIERS) $(OBJECTS) -.ifdef __WXMOTIF__ - library [--.lib]libwx_motif.olb $(OBJECTS) -.else -.ifdef __WXGTK__ - library [--.lib]libwx_gtk.olb $(OBJECTS) -.else -.ifdef __WXGTK2__ - library [--.lib]libwx_gtk2.olb $(OBJECTS) -.else -.ifdef __WXX11__ - library [--.lib]libwx_x11_univ.olb $(OBJECTS) -.endif -.endif -.endif -.endif - -baseunix.obj : baseunix.cpp -dialup.obj : dialup.cpp -dir.obj : dir.cpp -dlunix.obj : dlunix.cpp -fontenum.obj : fontenum.cpp -fontutil.obj : fontutil.cpp -gsocket.obj : gsocket.cpp - cxx $(CXXFLAGS)$(CXX_DEFINE)/nowarn gsocket.cpp -mimetype.obj : mimetype.cpp -threadpsx.obj : threadpsx.cpp -utilsunx.obj : utilsunx.cpp -utilsx11.obj : utilsx11.cpp -joystick.obj : joystick.cpp -snglinst.obj : snglinst.cpp -sound.obj : sound.cpp -sound_sdl.obj : sound_sdl.cpp -stdpaths.obj : stdpaths.cpp -taskbarx11.obj : taskbarx11.cpp -displayx11.obj : displayx11.cpp diff --git a/wxWidgets/src/unix/dialup.cpp b/wxWidgets/src/unix/dialup.cpp deleted file mode 100644 index f514f18c79..0000000000 --- a/wxWidgets/src/unix/dialup.cpp +++ /dev/null @@ -1,828 +0,0 @@ -// -*- c++ -*- //////////////////////////////////////////////////////////////// -// Name: src/unix/dialup.cpp -// Purpose: Network related wxWidgets classes and functions -// Author: Karsten Ballüder -// Modified by: -// Created: 03.10.99 -// RCS-ID: $Id: dialup.cpp 41020 2006-09-05 20:47:48Z VZ $ -// Copyright: (c) Karsten Ballüder -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -// for compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#if wxUSE_DIALUP_MANAGER - -#include "wx/dialup.h" - -#ifndef WX_PRECOMP - #include "wx/string.h" - #include "wx/intl.h" - #include "wx/log.h" - #include "wx/event.h" - #include "wx/app.h" - #include "wx/utils.h" - #include "wx/timer.h" -#endif // !PCH - -#include "wx/filefn.h" -#include "wx/ffile.h" -#include "wx/process.h" -#include "wx/wxchar.h" - -#include - -#include -#include -#include -#define __STRICT_ANSI__ -#include -#include -#include -#include -#include - -DEFINE_EVENT_TYPE(wxEVT_DIALUP_CONNECTED) -DEFINE_EVENT_TYPE(wxEVT_DIALUP_DISCONNECTED) - -// ---------------------------------------------------------------------------- -// 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(); - virtual ~wxDialUpManagerImpl(); - - /** 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), - bool async); - - // 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 - { - CheckStatus(); - return m_IsOnline == Net_Connected; - } - - // do we have a constant net connection? - virtual bool IsAlwaysOnline() const; - - // returns true if (async) dialing is in progress - virtual bool IsDialing() const - { return m_DialProcess != NULL; } - - // cancel dialing the number initiated with Dial(async = true) - // NB: this won't result in DISCONNECTED event being sent - virtual bool CancelDialing(); - - size_t GetISPNames(class wxArrayString &) const - { return 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 ? Net_Connected : Net_No; } - - // 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: -- Sun CC 4.2 objects to using NetConnection enum as the return -// type if it is declared private - - // the possible results of testing for Online() status - enum NetConnection - { - Net_Unknown = -1, // we couldn't learn anything - Net_No, // no network connection [currently] - Net_Connected // currently connected - }; - - // the possible net connection types - enum NetDeviceType - { - NetDevice_None = 0x0000, // no network devices (authoritative) - NetDevice_Unknown = 0x0001, // test doesn't work on this OS - NetDevice_Modem = 0x0002, // we have a modem - NetDevice_LAN = 0x0004 // a network card - }; - -private: - // the current status - NetConnection m_IsOnline; - - // the connection we have with the network card - NetConnection m_connCard; - - // Can we use ifconfig to list active devices? - int m_CanUseIfconfig; - - // The path to ifconfig - wxString m_IfconfigPath; - - // Can we use ping to find hosts? - int m_CanUsePing; - // The path to ping program - wxString m_PingPath; - - // 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; - - // a wxProcess for dialling in background - class wxDialProcess *m_DialProcess; - // pid of dial process - int m_DialPId; - friend class wxDialProcess; - - // determine status - void CheckStatus(bool fromAsync = false) const; - - // real status check - void CheckStatusInternal(); - - // check /proc/net (Linux only) for ppp/eth interfaces, returns the bit - // mask of NetDeviceType constants - int CheckProcNet(); - - // check output of ifconfig command for PPP/SLIP/PLIP devices, returns the - // bit mask of NetDeviceType constants - int CheckIfconfig(); - - // combines the 2 possible checks for determining the connection status - NetConnection CheckConnectAndPing(); - - // pings a host - NetConnection CheckPing(); - - // check by connecting to host on given port. - NetConnection CheckConnect(); -}; - - -class AutoCheckTimer : public wxTimer -{ -public: - AutoCheckTimer(wxDialUpManagerImpl *dupman) - { - m_dupman = dupman; - } - - virtual void Notify() - { - wxLogTrace(_T("dialup"), wxT("Checking dial up network status.")); - - m_dupman->CheckStatus(); - } - -public: - wxDialUpManagerImpl *m_dupman; -}; - -class wxDialProcess : public wxProcess -{ -public: - wxDialProcess(wxDialUpManagerImpl *dupman) - { - m_DupMan = dupman; - } - void Disconnect() { m_DupMan = NULL; } - virtual void OnTerminate(int WXUNUSED(pid), int WXUNUSED(status)) - { - if(m_DupMan) - { - m_DupMan->m_DialProcess = NULL; - m_DupMan->CheckStatus(true); - } - } -private: - wxDialUpManagerImpl *m_DupMan; -}; - - -wxDialUpManagerImpl::wxDialUpManagerImpl() -{ - m_IsOnline = - m_connCard = Net_Unknown; - m_DialProcess = NULL; - m_timer = NULL; - m_CanUseIfconfig = -1; // unknown - m_CanUsePing = -1; // unknown - m_BeaconHost = WXDIALUP_MANAGER_DEFAULT_BEACONHOST; - m_BeaconPort = 80; - -#ifdef __SGI__ - m_ConnectCommand = _T("/usr/etc/ppp"); -#elif defined(__LINUX__) - // default values for Debian/GNU linux - m_ConnectCommand = _T("pon"); - m_HangUpCommand = _T("poff"); -#endif - - wxChar * dial = wxGetenv(_T("WXDIALUP_DIALCMD")); - wxChar * hup = wxGetenv(_T("WXDIALUP_HUPCMD")); - SetConnectCommand(dial ? wxString(dial) : m_ConnectCommand, - hup ? wxString(hup) : m_HangUpCommand); -} - -wxDialUpManagerImpl::~wxDialUpManagerImpl() -{ - if(m_timer) delete m_timer; - if(m_DialProcess) - { - m_DialProcess->Disconnect(); - m_DialProcess->Detach(); - } -} - -bool -wxDialUpManagerImpl::Dial(const wxString &isp, - const wxString & WXUNUSED(username), - const wxString & WXUNUSED(password), - bool async) -{ - if(m_IsOnline == Net_Connected) - return false; - m_ISPname = isp; - wxString cmd; - if(m_ConnectCommand.Find(wxT("%s"))) - cmd.Printf(m_ConnectCommand,m_ISPname.c_str()); - else - cmd = m_ConnectCommand; - - if ( async ) - { - m_DialProcess = new wxDialProcess(this); - m_DialPId = (int)wxExecute(cmd, false, m_DialProcess); - if(m_DialPId == 0) - { - delete m_DialProcess; - m_DialProcess = NULL; - return false; - } - else - return true; - } - else - return wxExecute(cmd, /* sync */ true) == 0; -} - -bool wxDialUpManagerImpl::HangUp() -{ - if(m_IsOnline == Net_No) - return false; - if(IsDialing()) - { - wxLogError(_("Already dialling ISP.")); - return false; - } - wxString cmd; - if(m_HangUpCommand.Find(wxT("%s"))) - cmd.Printf(m_HangUpCommand,m_ISPname.c_str(), m_DialProcess); - else - cmd = m_HangUpCommand; - return wxExecute(cmd, /* sync */ true) == 0; -} - - -bool wxDialUpManagerImpl::CancelDialing() -{ - if(! IsDialing()) - return false; - return kill(m_DialPId, SIGTERM) > 0; -} - -bool wxDialUpManagerImpl::EnableAutoCheckOnlineStatus(size_t nSeconds) -{ - DisableAutoCheckOnlineStatus(); - 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() -{ - if(m_timer != NULL) - { - m_timer->Stop(); - delete m_timer; - m_timer = NULL; - } -} - - -void wxDialUpManagerImpl::SetWellKnownHost(const wxString& hostname, int portno) -{ - if(hostname.length() == 0) - { - m_BeaconHost = WXDIALUP_MANAGER_DEFAULT_BEACONHOST; - m_BeaconPort = 80; - return; - } - - // does hostname contain a port number? - wxString port = hostname.After(wxT(':')); - if(port.length()) - { - m_BeaconHost = hostname.Before(wxT(':')); - m_BeaconPort = wxAtoi(port); - } - else - { - m_BeaconHost = hostname; - m_BeaconPort = portno; - } -} - - -void wxDialUpManagerImpl::CheckStatus(bool fromAsync) const -{ - // This function calls the CheckStatusInternal() helper function - // which is OS - specific and then sends the events. - - NetConnection oldIsOnline = m_IsOnline; - ( /* non-const */ (wxDialUpManagerImpl *)this)->CheckStatusInternal(); - - // now send the events as appropriate: i.e. if the status changed and - // if we're in defined state - if(m_IsOnline != oldIsOnline - && m_IsOnline != Net_Unknown - && oldIsOnline != Net_Unknown ) - { - wxDialUpEvent event(m_IsOnline == Net_Connected, ! fromAsync); - (void)wxTheApp->ProcessEvent(event); - } -} - -/* - We first try to find out if ppp interface is active. If it is, we assume - that we're online but don't have a permanent connection (this is false if a - networked machine uses modem to connect to somewhere else, but we can't do - anything in this case anyhow). - - If no ppp interface is detected, we check for eth interface. If it is - found, we check that we can, indeed, connect to an Internet host. The logic - here is that connection check should be fast enough in this case and we - don't want to give false positives in a (common) case of a machine on a LAN - which is not connected to the outside. - - If we didn't find either ppp or eth interfaces, we stop here and decide - that we're connected. However, if couldn't check for this, we try to ping a - remote host just in case. - - NB1: Checking for the interface presence can be done in 2 ways - a) reading /proc/net/dev under Linux - b) spawning ifconfig under any OS - - The first method is faster but only works under Linux. - - NB2: pinging, actually, means that we first try to connect "manually" to - a port on remove machine and if it fails, we run ping. -*/ - -void wxDialUpManagerImpl::CheckStatusInternal() -{ - m_IsOnline = Net_Unknown; - - // first do quick checks to determine what kind of network devices do we - // have - int netDeviceType = CheckProcNet(); - if ( netDeviceType == NetDevice_Unknown ) - { - // nothing found, try ifconfig too - netDeviceType = CheckIfconfig(); - } - - switch ( netDeviceType ) - { - case NetDevice_None: - // no network devices, no connection - m_IsOnline = Net_No; - break; - - case NetDevice_LAN: - // we still do ping to confirm that we're connected but we only do - // it once and hope that the purpose of the network card (i.e. - // whether it used for connecting to the Internet or just to a - // LAN) won't change during the program lifetime - if ( m_connCard == Net_Unknown ) - { - m_connCard = CheckConnectAndPing(); - } - m_IsOnline = m_connCard; - break; - - case NetDevice_Unknown: - // try to ping just in case - m_IsOnline = CheckConnectAndPing(); - break; - - case NetDevice_LAN + NetDevice_Modem: - case NetDevice_Modem: - // assume we're connected - m_IsOnline = Net_Connected; - break; - - default: - wxFAIL_MSG(_T("Unexpected netDeviceType")); - } -} - -bool wxDialUpManagerImpl::IsAlwaysOnline() const -{ - wxDialUpManagerImpl *self = wxConstCast(this, wxDialUpManagerImpl); - - int netDeviceType = self->CheckProcNet(); - if ( netDeviceType == NetDevice_Unknown ) - { - // nothing found, try ifconfig too - netDeviceType = self->CheckIfconfig(); - } - - if ( netDeviceType == NetDevice_Unknown ) - { - // this is the only thing we can do unfortunately... - self->HangUp(); - return IsOnline(); - } - else - { - // we are only permanently online if we have a network card - return (netDeviceType & NetDevice_LAN) != 0; - } -} - -wxDialUpManagerImpl::NetConnection wxDialUpManagerImpl::CheckConnectAndPing() -{ - NetConnection conn; - - // first try connecting - faster - conn = CheckConnect(); - if ( conn == Net_Unknown ) - { - // try pinging too - conn = CheckPing(); - } - - return conn; -} - -wxDialUpManagerImpl::NetConnection wxDialUpManagerImpl::CheckConnect() -{ - // second method: try to connect to a well known host: - // This can be used under Win 9x, too! - struct hostent *hp; - struct sockaddr_in serv_addr; - - if((hp = gethostbyname(m_BeaconHost.mb_str())) == NULL) - return Net_No; // 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); - - int sockfd; - if( ( sockfd = socket(hp->h_addrtype, SOCK_STREAM, 0)) < 0) - { - return Net_Unknown; // no info - } - - if( connect(sockfd, (struct sockaddr *) &serv_addr, - sizeof(serv_addr)) >= 0) - { - close(sockfd); - return Net_Connected; // we can connect, so we have a network! - } - else // failed to connect - { -#ifdef ENETUNREACH - if(errno == ENETUNREACH) - return Net_No; // network is unreachable - else -#endif - return Net_Unknown; // connect failed, but don't know why - } -} - - -int -wxDialUpManagerImpl::CheckProcNet() -{ - // assume that the test doesn't work - int netDevice = NetDevice_Unknown; - -#ifdef __LINUX__ - if (wxFileExists(_T("/proc/net/route"))) - { - // cannot use wxFile::Length because file doesn't support seeking, so - // use stdio directly - FILE *f = fopen("/proc/net/route", "rt"); - if (f != NULL) - { - // now we know that we will find all devices we may have - netDevice = NetDevice_None; - - char output[256]; - - while (fgets(output, 256, f) != NULL) - { - if ( strstr(output, "eth") ) // network card - { - netDevice |= NetDevice_LAN; - } - else if (strstr(output,"ppp") // ppp - || strstr(output,"sl") // slip - || strstr(output,"pl")) // plip - { - netDevice |= NetDevice_Modem; - } - } - - fclose(f); - } - } -#endif // __LINUX__ - - return netDevice; -} - - -int -wxDialUpManagerImpl::CheckIfconfig() -{ -#ifdef __VMS - m_CanUseIfconfig = 0; - return -1; -#else - // assume that the test doesn't work - int netDevice = NetDevice_Unknown; - - // first time check for ifconfig location - if ( m_CanUseIfconfig == -1 ) // unknown - { - static const wxChar *ifconfigLocations[] = - { - _T("/sbin"), // Linux, FreeBSD, Darwin - _T("/usr/sbin"), // SunOS, Solaris, AIX, HP-UX - _T("/usr/etc"), // IRIX - _T("/etc"), // AIX 5 - }; - - for ( size_t n = 0; n < WXSIZEOF(ifconfigLocations); n++ ) - { - wxString path(ifconfigLocations[n]); - path << _T("/ifconfig"); - - if ( wxFileExists(path) ) - { - m_IfconfigPath = path; - break; - } - } - } - - if ( m_CanUseIfconfig != 0 ) // unknown or yes - { - wxLogNull ln; // suppress all error messages - - wxASSERT_MSG( m_IfconfigPath.length(), - _T("can't use ifconfig if it wasn't found") ); - - wxString tmpfile = wxGetTempFileName( wxT("_wxdialuptest") ); - wxString cmd = wxT("/bin/sh -c \'"); - cmd << m_IfconfigPath; -#if defined(__AIX__) || \ - defined(__OSF__) || \ - defined(__SOLARIS__) || defined (__SUNOS__) - // need to add -a flag - cmd << wxT(" -a"); -#elif defined(__LINUX__) || defined(__SGI__) - // nothing to be added to ifconfig -#elif defined(__FREEBSD__) || defined(__DARWIN__) - // add -l flag - cmd << wxT(" -l"); -#elif defined(__HPUX__) - // VZ: a wild guess (but without it, ifconfig fails completely) - cmd << wxT(" ppp0"); -#else - #if defined(__GNUG__) - #warning "No ifconfig information for this OS." - #else - #pragma warning "No ifconfig information for this OS." - #endif - - m_CanUseIfconfig = 0; - return -1; -#endif - cmd << wxT(" >") << tmpfile << wxT('\''); - /* 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 ( wxExecute(cmd,true /* sync */) == 0 ) - { - m_CanUseIfconfig = 1; - wxFFile file; - if( file.Open(tmpfile) ) - { - wxString output; - if ( file.ReadAll(&output) ) - { - // FIXME shouldn't we grep for "^ppp"? (VZ) - - bool hasModem = false, - hasLAN = false; - -#if defined(__SOLARIS__) || defined (__SUNOS__) - // dialup device under SunOS/Solaris - hasModem = strstr(output.fn_str(),"ipdptp") != (char *)NULL; - hasLAN = strstr(output.fn_str(), "hme") != (char *)NULL; -#elif defined(__LINUX__) || defined (__FREEBSD__) - hasModem = strstr(output.fn_str(),"ppp") // ppp - || strstr(output.fn_str(),"sl") // slip - || strstr(output.fn_str(),"pl"); // plip - hasLAN = strstr(output.fn_str(), "eth") != NULL; -#elif defined(__SGI__) // IRIX - hasModem = strstr(output.fn_str(), "ppp") != NULL; // PPP -#elif defined(__HPUX__) - // if could run ifconfig on interface, then it exists - hasModem = true; -#endif - - netDevice = NetDevice_None; - if ( hasModem ) - netDevice |= NetDevice_Modem; - if ( hasLAN ) - netDevice |= NetDevice_LAN; - } - //else: error reading the file - } - //else: error opening the file - } - else // could not run ifconfig correctly - { - m_CanUseIfconfig = 0; // don´t try again - } - - (void) wxRemoveFile(tmpfile); - } - - return netDevice; -#endif -} - -wxDialUpManagerImpl::NetConnection wxDialUpManagerImpl::CheckPing() -{ - // First time check for ping location. We only use the variant - // which does not take arguments, a la GNU. - if(m_CanUsePing == -1) // unknown - { -#ifdef __VMS - if (wxFileExists( wxT("SYS$SYSTEM:TCPIP$PING.EXE") )) - m_PingPath = wxT("$SYS$SYSTEM:TCPIP$PING"); -#elif defined(__AIX__) - m_PingPath = _T("/etc/ping"); -#elif defined(__SGI__) - m_PingPath = _T("/usr/etc/ping"); -#else - if (wxFileExists( wxT("/bin/ping") )) - m_PingPath = wxT("/bin/ping"); - else if (wxFileExists( wxT("/usr/sbin/ping") )) - m_PingPath = wxT("/usr/sbin/ping"); -#endif - if (!m_PingPath) - { - m_CanUsePing = 0; - } - } - - if(! m_CanUsePing) - { - // we didn't find ping - return Net_Unknown; - } - - wxLogNull ln; // suppress all error messages - wxASSERT(m_PingPath.length()); - wxString cmd; - cmd << m_PingPath << wxT(' '); -#if defined(__SOLARIS__) || defined (__SUNOS__) - // nothing to add to ping command -#elif defined(__AIX__) || \ - defined (__BSD__) || \ - defined(__LINUX__) || \ - defined(__OSF__) || \ - defined(__SGI__) || \ - defined(__VMS) - cmd << wxT("-c 1 "); // only ping once -#elif defined(__HPUX__) - cmd << wxT("64 1 "); // only ping once (need also specify the packet size) -#else - #if defined(__GNUG__) - #warning "No Ping information for this OS." - #else - #pragma warning "No Ping information for this OS." - #endif - - m_CanUsePing = 0; - return Net_Unknown; -#endif - cmd << m_BeaconHost; - if(wxExecute(cmd, true /* sync */) == 0) - return Net_Connected; - else - return Net_No; -} - -/* static */ -wxDialUpManager *wxDialUpManager::Create() -{ - return new wxDialUpManagerImpl; -} - -#endif // wxUSE_DIALUP_MANAGER diff --git a/wxWidgets/src/unix/dir.cpp b/wxWidgets/src/unix/dir.cpp deleted file mode 100644 index d8e732f390..0000000000 --- a/wxWidgets/src/unix/dir.cpp +++ /dev/null @@ -1,334 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: unix/dir.cpp -// Purpose: wxDir implementation for Unix/POSIX systems -// Author: Vadim Zeitlin -// Modified by: -// Created: 08.12.99 -// RCS-ID: $Id: dir.cpp 56867 2008-11-20 18:12:43Z VZ $ -// Copyright: (c) 1999 Vadim Zeitlin -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -// 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 wxMatchWild - -#include -#include -#include - -#include - -// ---------------------------------------------------------------------------- -// 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(); - - bool IsOk() const { return m_dir != NULL; } - - void SetFileSpec(const wxString& filespec) { m_filespec = filespec; } - void SetFlags(int flags) { m_flags = flags; } - - void Rewind() { rewinddir(m_dir); } - bool Read(wxString *filename); - - const wxString& GetName() const { return m_dirname; } - -private: - DIR *m_dir; - - wxString m_dirname; - wxString m_filespec; - - int m_flags; -}; - -// ============================================================================ -// implementation -// ============================================================================ - -// ---------------------------------------------------------------------------- -// wxDirData -// ---------------------------------------------------------------------------- - -#if !defined( __VMS__ ) || ( __VMS_VER >= 70000000 ) - -wxDirData::wxDirData(const wxString& dirname) - : m_dirname(dirname) -{ - m_dir = NULL; - - // throw away the trailing slashes - size_t n = m_dirname.length(); - wxCHECK_RET( n, _T("empty dir name in wxDir") ); - - while ( n > 0 && m_dirname[--n] == '/' ) - ; - - m_dirname.Truncate(n + 1); - - // do open the dir - m_dir = opendir(m_dirname.fn_str()); -} - -wxDirData::~wxDirData() -{ - if ( m_dir ) - { - if ( closedir(m_dir) != 0 ) - { - wxLogLastError(_T("closedir")); - } - } -} - -bool wxDirData::Read(wxString *filename) -{ - dirent *de = (dirent *)NULL; // just to silence compiler warnings - bool matches = false; - - // speed up string concatenation in the loop a bit - wxString path = m_dirname; - path += _T('/'); - path.reserve(path.length() + 255); - - wxString de_d_name; - - while ( !matches ) - { - de = readdir(m_dir); - if ( !de ) - return false; - -#if wxUSE_UNICODE - de_d_name = wxConvFileName->cMB2WC( de->d_name ); -#else - de_d_name = de->d_name; -#endif - - // don't return "." and ".." unless asked for - if ( de->d_name[0] == '.' && - ((de->d_name[1] == '.' && de->d_name[2] == '\0') || - (de->d_name[1] == '\0')) ) - { - if ( !(m_flags & wxDIR_DOTDOT) ) - continue; - - // we found a valid match - break; - } - - // check the type now - if ( !(m_flags & wxDIR_FILES) && !wxDir::Exists(path + de_d_name) ) - { - // it's a file, but we don't want them - continue; - } - else if ( !(m_flags & wxDIR_DIRS) && wxDir::Exists(path + de_d_name) ) - { - // it's a dir, and we don't want it - continue; - } - - // finally, check the name - if ( m_filespec.empty() ) - { - matches = m_flags & wxDIR_HIDDEN ? true : de->d_name[0] != '.'; - } - else - { - // test against the pattern - matches = wxMatchWild(m_filespec, de_d_name, - !(m_flags & wxDIR_HIDDEN)); - } - } - - *filename = de_d_name; - - return true; -} - -#else // old VMS (TODO) - -wxDirData::wxDirData(const wxString& WXUNUSED(dirname)) -{ - wxFAIL_MSG(_T("not implemented")); -} - -wxDirData::~wxDirData() -{ -} - -bool wxDirData::Read(wxString * WXUNUSED(filename)) -{ - return false; -} - -#endif // not or new VMS/old VMS - -// ---------------------------------------------------------------------------- -// wxDir helpers -// ---------------------------------------------------------------------------- - -/* static */ -bool wxDir::Exists(const wxString& dir) -{ - return wxDirExists(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_DIR->IsOk() ) - { - delete M_DIR; - m_data = NULL; - - return false; - } - - return true; -} - -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() -{ - delete M_DIR; -} - -// ---------------------------------------------------------------------------- -// 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); -} - -bool wxDir::HasSubDirs(const wxString& spec) -{ - wxCHECK_MSG( IsOpened(), false, _T("must wxDir::Open() first") ); - - if ( spec.empty() ) - { - // faster check for presence of any subdirectory: normally each subdir - // has a hard link to the parent directory and so, knowing that there - // are at least "." and "..", we have a subdirectory if and only if - // links number is > 2 - this is just a guess but it works fairly well - // in practice - // - // note that we may guess wrongly in one direction only: i.e. we may - // return true when there are no subdirectories but this is ok as the - // caller will learn it soon enough when it calls GetFirst(wxDIR) - // anyhow - wxStructStat stBuf; - if ( wxStat(M_DIR->GetName().c_str(), &stBuf) == 0 ) - { - switch ( stBuf.st_nlink ) - { - case 2: - // just "." and ".." - return false; - - case 0: - case 1: - // weird filesystem, don't try to guess for it, use dumb - // method below - break; - - default: - // assume we have subdirs - may turn out to be wrong if we - // have other hard links to this directory but it's not - // that bad as explained above - return true; - } - } - } - - // just try to find first directory - wxString s; - return GetFirst(&s, spec, wxDIR_DIRS | wxDIR_HIDDEN); -} - diff --git a/wxWidgets/src/unix/displayx11.cpp b/wxWidgets/src/unix/displayx11.cpp deleted file mode 100644 index f2f148bb73..0000000000 --- a/wxWidgets/src/unix/displayx11.cpp +++ /dev/null @@ -1,426 +0,0 @@ -/////////////////////////////////////////////////////////////////////////// -// Name: src/unix/displayx11.cpp -// Purpose: Unix/X11 implementation of wxDisplay class -// Author: Brian Victor, Vadim Zeitlin -// Modified by: -// Created: 12/05/02 -// RCS-ID: $Id: displayx11.cpp 50143 2007-11-22 02:52:10Z PC $ -// Copyright: (c) wxWidgets team -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_DISPLAY - -#include "wx/display.h" - -#ifndef WX_PRECOMP - #include "wx/dynarray.h" - #include "wx/gdicmn.h" - #include "wx/string.h" - #include "wx/utils.h" - #include "wx/intl.h" - #include "wx/log.h" -#endif /* WX_PRECOMP */ - -#include "wx/display_impl.h" - -/* These must be included after the wx files. Otherwise the Data macro in - * Xlibint.h conflicts with a function declaration in wx/list.h. */ -extern "C" -{ - #include - #include - - #include - #ifdef HAVE_X11_EXTENSIONS_XF86VMODE_H - #include - #endif -} - -// ---------------------------------------------------------------------------- -// helper class to automatically free XineramaQueryScreens() return value -// ---------------------------------------------------------------------------- - -class ScreensInfo -{ -public: - ScreensInfo() - { - m_screens = XineramaQueryScreens((Display *)wxGetDisplay(), &m_num); - } - - ~ScreensInfo() - { - XFree(m_screens); - } - - operator const XineramaScreenInfo *() const { return m_screens; } - - unsigned GetCount() const { return wx_static_cast(unsigned, m_num); } - -private: - XineramaScreenInfo *m_screens; - int m_num; -}; - -// ---------------------------------------------------------------------------- -// display and display factory classes -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxDisplayImplX11 : public wxDisplayImpl -{ -public: - wxDisplayImplX11(unsigned n, const XineramaScreenInfo& info) - : wxDisplayImpl(n), - m_rect(info.x_org, info.y_org, info.width, info.height) - { - } - - virtual wxRect GetGeometry() const { return m_rect; } - virtual wxRect GetClientArea() const - { - // we intentionally don't cache the result here because the client - // display area may change (e.g. the user resized or hid a panel) and - // we don't currently react to its changes - return IsPrimary() ? wxGetClientDisplayRect() : m_rect; - } - - virtual wxString GetName() const { return wxString(); } - - virtual wxArrayVideoModes GetModes(const wxVideoMode& mode) const; - virtual wxVideoMode GetCurrentMode() const; - virtual bool ChangeMode(const wxVideoMode& mode); - -private: - wxRect m_rect; - int m_depth; - - DECLARE_NO_COPY_CLASS(wxDisplayImplX11) -}; - -class wxDisplayFactoryX11 : public wxDisplayFactory -{ -public: - wxDisplayFactoryX11() { } - - virtual wxDisplayImpl *CreateDisplay(unsigned n); - virtual unsigned GetCount(); - virtual int GetFromPoint(const wxPoint& pt); - -protected: - DECLARE_NO_COPY_CLASS(wxDisplayFactoryX11) -}; - -// ============================================================================ -// wxDisplayFactoryX11 implementation -// ============================================================================ - -unsigned wxDisplayFactoryX11::GetCount() -{ - return ScreensInfo().GetCount(); -} - -int wxDisplayFactoryX11::GetFromPoint(const wxPoint& p) -{ - ScreensInfo screens; - - const unsigned numscreens(screens.GetCount()); - for ( unsigned i = 0; i < numscreens; ++i ) - { - const XineramaScreenInfo& s = screens[i]; - if ( p.x >= s.x_org && p.x < s.x_org + s.width && - p.y >= s.y_org && p.y < s.y_org + s.height ) - { - return i; - } - } - - return wxNOT_FOUND; -} - -wxDisplayImpl *wxDisplayFactoryX11::CreateDisplay(unsigned n) -{ - ScreensInfo screens; - - return n < screens.GetCount() ? new wxDisplayImplX11(n, screens[n]) : NULL; -} - -// ============================================================================ -// wxDisplayImplX11 implementation -// ============================================================================ - -#ifdef HAVE_X11_EXTENSIONS_XF86VMODE_H - -// -// See (http://www.xfree86.org/4.2.0/XF86VidModeDeleteModeLine.3.html) for more -// info about xf86 video mode extensions -// - -//free private data common to x (usually s3) servers -#define wxClearXVM(vm) if(vm.privsize) XFree(vm.c_private) - -// Correct res rate from GLFW -#define wxCRR2(v,dc) (int) (((1000.0f * (float) dc) /*PIXELS PER SECOND */) / ((float) v.htotal * v.vtotal /*PIXELS PER FRAME*/) + 0.5f) -#define wxCRR(v) wxCRR2(v,v.dotclock) -#define wxCVM2(v, dc) wxVideoMode(v.hdisplay, v.vdisplay, DefaultDepth((Display*)wxGetDisplay(), DefaultScreen((Display*)wxGetDisplay())), wxCRR2(v,dc)) -#define wxCVM(v) wxCVM2(v, v.dotclock) - -wxArrayVideoModes wxDisplayImplX11::GetModes(const wxVideoMode& mode) const -{ - //Convenience... - Display* pDisplay = (Display*) wxGetDisplay(); //default display - int nScreen = DefaultScreen(pDisplay); //default screen of (default) display... - - //Some variables.. - XF86VidModeModeInfo** ppXModes; //Enumerated Modes (Don't forget XFree() :)) - int nNumModes; //Number of modes enumerated.... - - wxArrayVideoModes Modes; //modes to return... - - if (XF86VidModeGetAllModeLines(pDisplay, nScreen, &nNumModes, &ppXModes) == TRUE) - { - for (int i = 0; i < nNumModes; ++i) - { - if (mode == wxDefaultVideoMode || //According to display.h All modes valid if dafault mode... - mode.Matches(wxCVM((*ppXModes[i]))) ) //...? - { - Modes.Add(wxCVM((*ppXModes[i]))); - } - wxClearXVM((*ppXModes[i])); - // XFree(ppXModes[i]); //supposed to free? - } - XFree(ppXModes); - } - else //OOPS! - { - wxLogSysError(_("Failed to enumerate video modes")); - } - - return Modes; -} - -wxVideoMode wxDisplayImplX11::GetCurrentMode() const -{ - XF86VidModeModeLine VM; - int nDotClock; - XF86VidModeGetModeLine((Display*)wxGetDisplay(), DefaultScreen((Display*)wxGetDisplay()), - &nDotClock, &VM); - wxClearXVM(VM); - return wxCVM2(VM, nDotClock); -} - -bool wxDisplayImplX11::ChangeMode(const wxVideoMode& mode) -{ - XF86VidModeModeInfo** ppXModes; //Enumerated Modes (Don't forget XFree() :)) - int nNumModes; //Number of modes enumerated.... - - if( !XF86VidModeGetAllModeLines((Display*)wxGetDisplay(), DefaultScreen((Display*)wxGetDisplay()), &nNumModes, &ppXModes) ) - { - wxLogSysError(_("Failed to change video mode")); - return false; - } - - bool bRet = false; - if (mode == wxDefaultVideoMode) - { - bRet = XF86VidModeSwitchToMode((Display*)wxGetDisplay(), DefaultScreen((Display*)wxGetDisplay()), - ppXModes[0]) == TRUE; - - for (int i = 0; i < nNumModes; ++i) - { - wxClearXVM((*ppXModes[i])); - // XFree(ppXModes[i]); //supposed to free? - } - } - else - { - for (int i = 0; i < nNumModes; ++i) - { - if (!bRet && - ppXModes[i]->hdisplay == mode.w && - ppXModes[i]->vdisplay == mode.h && - wxCRR((*ppXModes[i])) == mode.refresh) - { - //switch! - bRet = XF86VidModeSwitchToMode((Display*)wxGetDisplay(), DefaultScreen((Display*)wxGetDisplay()), - ppXModes[i]) == TRUE; - } - wxClearXVM((*ppXModes[i])); - // XFree(ppXModes[i]); //supposed to free? - } - } - - XFree(ppXModes); - - return bRet; -} - - -#else // !HAVE_X11_EXTENSIONS_XF86VMODE_H - -wxArrayVideoModes wxDisplayImplX11::GetModes(const wxVideoMode& modeMatch) const -{ - int count_return; - int* depths = XListDepths((Display*)wxGetDisplay(), 0, &count_return); - wxArrayVideoModes modes; - if ( depths ) - { - for ( int x = 0; x < count_return; ++x ) - { - wxVideoMode mode(m_rect.GetWidth(), m_rect.GetHeight(), depths[x]); - if ( mode.Matches(modeMatch) ) - { - modes.Add(modeMatch); - } - } - - XFree(depths); - } - return modes; -} - -wxVideoMode wxDisplayImplX11::GetCurrentMode() const -{ - // Not implemented - return wxVideoMode(); -} - -bool wxDisplayImplX11::ChangeMode(const wxVideoMode& WXUNUSED(mode)) -{ - // Not implemented - return false; -} - -#endif // !HAVE_X11_EXTENSIONS_XF86VMODE_H - -// ============================================================================ -// wxDisplay::CreateFactory() -// ============================================================================ - -/* static */ wxDisplayFactory *wxDisplay::CreateFactory() -{ - if ( XineramaIsActive((Display*)wxGetDisplay()) ) - { - return new wxDisplayFactoryX11; - } - - return new wxDisplayFactorySingle; -} - -#endif /* wxUSE_DISPLAY */ - -#if defined(__WXGTK__) || defined(__X__) - -#include "wx/utils.h" -#include "wx/log.h" - -#include -#include - -// TODO: make this a full-fledged class and move to a public header -class wxX11Ptr -{ -public: - wxX11Ptr(void *ptr = NULL) : m_ptr(ptr) { } - ~wxX11Ptr() { if ( m_ptr ) XFree(m_ptr); } - -private: - void *m_ptr; - - DECLARE_NO_COPY_CLASS(wxX11Ptr) -}; - -// NB: this function is implemented using X11 and not GDK calls as it's shared -// by wxGTK[12], wxX11 and wxMotif ports -void wxClientDisplayRect(int *x, int *y, int *width, int *height) -{ - Display * const dpy = (Display *)wxGetDisplay(); - wxCHECK_RET( dpy, _T("can't be called before initializing the GUI") ); - - const Atom atomWorkArea = XInternAtom(dpy, "_NET_WORKAREA", True); - if ( atomWorkArea ) - { - long *workareas = NULL; - unsigned long numItems; - unsigned long bytesRemaining; - Atom actualType; - int format; - - if ( XGetWindowProperty - ( - dpy, - XDefaultRootWindow(dpy), - atomWorkArea, - 0, // offset of data to retrieve - 4, // number of items to retrieve - False, // don't delete property - XA_CARDINAL, // type of the items to get - &actualType, - &format, - &numItems, - &bytesRemaining, - (unsigned char **)&workareas - ) == Success && workareas ) - { - wxX11Ptr x11ptr(workareas); // ensure it will be freed - - // check that we retrieved the property of the expected type and - // that we did get back 4 longs (32 is the format for long), as - // requested - if ( actualType != XA_CARDINAL || - format != 32 || - numItems != 4 ) - { - wxLogDebug(_T("XGetWindowProperty(\"_NET_WORKAREA\") failed")); - return; - } - - if ( x ) - *x = workareas[0]; - if ( y ) - *y = workareas[1]; - if ( width ) - *width = workareas[2]; - if ( height ) - *height = workareas[3]; - - return; - } - } - - // if we get here, _NET_WORKAREA is not supported so return the entire - // screen size as fall back - if (x) - *x = 0; - if (y) - *y = 0; - wxDisplaySize(width, height); -} - -#else // !(wxGTK or X) - -void wxClientDisplayRect(int *x, int *y, int *width, int *height) -{ - if (x) - *x = 0; - if (y) - *y = 0; - wxDisplaySize(width, height); -} - -#endif // wxGTK or X diff --git a/wxWidgets/src/unix/dlunix.cpp b/wxWidgets/src/unix/dlunix.cpp deleted file mode 100644 index 0b510c3652..0000000000 --- a/wxWidgets/src/unix/dlunix.cpp +++ /dev/null @@ -1,461 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: unix/dlunix.cpp -// Purpose: Unix-specific part of wxDynamicLibrary and related classes -// Author: Vadim Zeitlin -// Modified by: -// Created: 2005-01-16 (extracted from common/dynlib.cpp) -// RCS-ID: $Id: dlunix.cpp 51903 2008-02-19 01:13:48Z DE $ -// Copyright: (c) 2000-2005 Vadim Zeitlin -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_DYNLIB_CLASS - -#include "wx/dynlib.h" -#include "wx/ffile.h" - -#ifndef WX_PRECOMP - #include "wx/intl.h" - #include "wx/log.h" -#endif - -#ifdef HAVE_DLOPEN - #include -#endif - -#ifdef __DARWIN__ - #include -#endif - -// if some flags are not supported, just ignore them -#ifndef RTLD_LAZY - #define RTLD_LAZY 0 -#endif - -#ifndef RTLD_NOW - #define RTLD_NOW 0 -#endif - -#ifndef RTLD_GLOBAL - #define RTLD_GLOBAL 0 -#endif - - -#if defined(HAVE_DLOPEN) || defined(__DARWIN__) - #define USE_POSIX_DL_FUNCS -#elif !defined(HAVE_SHL_LOAD) - #error "Don't know how to load dynamic libraries on this platform!" -#endif - -// ---------------------------------------------------------------------------- -// constants -// ---------------------------------------------------------------------------- - -// standard shared libraries extensions for different Unix versions -#if defined(__HPUX__) - const wxChar *wxDynamicLibrary::ms_dllext = _T(".sl"); -#elif defined(__DARWIN__) - const wxChar *wxDynamicLibrary::ms_dllext = _T(".bundle"); -#else - const wxChar *wxDynamicLibrary::ms_dllext = _T(".so"); -#endif - -// ============================================================================ -// wxDynamicLibrary implementation -// ============================================================================ - -// ---------------------------------------------------------------------------- -// dlxxx() emulation for Darwin -// Only useful if the OS X version could be < 10.3 at runtime -// ---------------------------------------------------------------------------- - -#if defined(__DARWIN__) && (MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_3) -// --------------------------------------------------------------------------- -// For Darwin/Mac OS X -// supply the sun style dlopen functions in terms of Darwin NS* -// --------------------------------------------------------------------------- - -/* Porting notes: - * The dlopen port is a port from dl_next.xs by Anno Siegel. - * dl_next.xs is itself a port from dl_dlopen.xs by Paul Marquess. - * The method used here is just to supply the sun style dlopen etc. - * functions in terms of Darwin NS*. - */ - -#include -#include - -static char dl_last_error[1024]; - -static const char *wx_darwin_dlerror() -{ - return dl_last_error; -} - -static void *wx_darwin_dlopen(const char *path, int WXUNUSED(mode) /* mode is ignored */) -{ - NSObjectFileImage ofile; - NSModule handle = NULL; - - unsigned dyld_result = NSCreateObjectFileImageFromFile(path, &ofile); - if ( dyld_result != NSObjectFileImageSuccess ) - { - handle = NULL; - - static const char *errorStrings[] = - { - "%d: Object Image Load Failure", - "%d: Object Image Load Success", - "%d: Not an recognisable object file", - "%d: No valid architecture", - "%d: Object image has an invalid format", - "%d: Invalid access (permissions?)", - "%d: Unknown error code from NSCreateObjectFileImageFromFile" - }; - - const int index = dyld_result < WXSIZEOF(errorStrings) - ? dyld_result - : WXSIZEOF(errorStrings) - 1; - - // this call to sprintf() is safe as strings above are fixed at - // compile-time and are shorter than WXSIZEOF(dl_last_error) - sprintf(dl_last_error, errorStrings[index], dyld_result); - } - else - { - handle = NSLinkModule - ( - ofile, - path, - NSLINKMODULE_OPTION_BINDNOW | - NSLINKMODULE_OPTION_RETURN_ON_ERROR - ); - - if ( !handle ) - { - NSLinkEditErrors err; - int code; - const char *filename; - const char *errmsg; - - NSLinkEditError(&err, &code, &filename, &errmsg); - strncpy(dl_last_error, errmsg, WXSIZEOF(dl_last_error)-1); - dl_last_error[WXSIZEOF(dl_last_error)-1] = '\0'; - } - } - - - return handle; -} - -static int wx_darwin_dlclose(void *handle) -{ - NSUnLinkModule((NSModule)handle, NSUNLINKMODULE_OPTION_NONE); - return 0; -} - -static void *wx_darwin_dlsym(void *handle, const char *symbol) -{ - // as on many other systems, C symbols have prepended underscores under - // Darwin but unlike the normal dlopen(), NSLookupSymbolInModule() is not - // aware of this - wxCharBuffer buf(strlen(symbol) + 1); - char *p = buf.data(); - p[0] = '_'; - strcpy(p + 1, symbol); - - NSSymbol nsSymbol = NSLookupSymbolInModule((NSModule)handle, p ); - return nsSymbol ? NSAddressOfSymbol(nsSymbol) : NULL; -} - -// Add the weak linking attribute to dlopen's declaration -extern void * dlopen(const char * __path, int __mode) AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER; - -// For all of these methods we test dlopen since all of the dl functions we use were added -// to OS X at the same time. This also ensures we don't dlopen with the real function then -// dlclose with the internal implementation. - -static inline void *wx_dlopen(const char *__path, int __mode) -{ -#ifdef HAVE_DLOPEN - if(&dlopen != NULL) - return dlopen(__path, __mode); - else -#endif - return wx_darwin_dlopen(__path, __mode); -} - -static inline int wx_dlclose(void *__handle) -{ -#ifdef HAVE_DLOPEN - if(&dlopen != NULL) - return dlclose(__handle); - else -#endif - return wx_darwin_dlclose(__handle); -} - -static inline const char *wx_dlerror() -{ -#ifdef HAVE_DLOPEN - if(&dlopen != NULL) - return dlerror(); - else -#endif - return wx_darwin_dlerror(); -} - -static inline void *wx_dlsym(void *__handle, const char *__symbol) -{ -#ifdef HAVE_DLOPEN - if(&dlopen != NULL) - return dlsym(__handle, __symbol); - else -#endif - return wx_darwin_dlsym(__handle, __symbol); -} - -#else // __DARWIN__/!__DARWIN__ - -// Use preprocessor definitions for non-Darwin or OS X >= 10.3 -#define wx_dlopen(__path,__mode) dlopen(__path,__mode) -#define wx_dlclose(__handle) dlclose(__handle) -#define wx_dlerror() dlerror() -#define wx_dlsym(__handle,__symbol) dlsym(__handle,__symbol) - -#endif // defined(__DARWIN__) - -// ---------------------------------------------------------------------------- -// loading/unloading DLLs -// ---------------------------------------------------------------------------- - -wxDllType wxDynamicLibrary::GetProgramHandle() -{ -#ifdef USE_POSIX_DL_FUNCS - return wx_dlopen(0, RTLD_LAZY); -#else - return PROG_HANDLE; -#endif -} - -/* static */ -wxDllType wxDynamicLibrary::RawLoad(const wxString& libname, int flags) -{ - wxASSERT_MSG( !(flags & wxDL_NOW) || !(flags & wxDL_LAZY), - _T("wxDL_LAZY and wxDL_NOW are mutually exclusive.") ); - -#ifdef USE_POSIX_DL_FUNCS - // we need to use either RTLD_NOW or RTLD_LAZY because if we call dlopen() - // with flags == 0 recent versions of glibc just fail the call, so use - // RTLD_NOW even if wxDL_NOW was not specified - int rtldFlags = flags & wxDL_LAZY ? RTLD_LAZY : RTLD_NOW; - - if ( flags & wxDL_GLOBAL ) - rtldFlags |= RTLD_GLOBAL; - - return wx_dlopen(libname.fn_str(), rtldFlags); -#else // !USE_POSIX_DL_FUNCS - int shlFlags = 0; - - if ( flags & wxDL_LAZY ) - { - shlFlags |= BIND_DEFERRED; - } - else if ( flags & wxDL_NOW ) - { - shlFlags |= BIND_IMMEDIATE; - } - - return shl_load(libname.fn_str(), shlFlags, 0); -#endif // USE_POSIX_DL_FUNCS/!USE_POSIX_DL_FUNCS -} - -/* static */ -void wxDynamicLibrary::Unload(wxDllType handle) -{ -#ifdef wxHAVE_DYNLIB_ERROR - int rc = -#endif - -#ifdef USE_POSIX_DL_FUNCS - wx_dlclose(handle); -#else // !USE_POSIX_DL_FUNCS - shl_unload(handle); -#endif // USE_POSIX_DL_FUNCS/!USE_POSIX_DL_FUNCS - -#if defined(USE_POSIX_DL_FUNCS) && defined(wxHAVE_DYNLIB_ERROR) - if ( rc != 0 ) - Error(); -#endif -} - -/* static */ -void *wxDynamicLibrary::RawGetSymbol(wxDllType handle, const wxString& name) -{ - void *symbol; - -#ifdef USE_POSIX_DL_FUNCS - symbol = wx_dlsym(handle, name.fn_str()); -#else // !USE_POSIX_DL_FUNCS - // note that shl_findsym modifies the handle argument to indicate where the - // symbol was found, but it's ok to modify the local handle copy here - if ( shl_findsym(&handle, name.fn_str(), TYPE_UNDEFINED, &symbol) != 0 ) - symbol = 0; -#endif // USE_POSIX_DL_FUNCS/!USE_POSIX_DL_FUNCS - - return symbol; -} - -// ---------------------------------------------------------------------------- -// error handling -// ---------------------------------------------------------------------------- - -#ifdef wxHAVE_DYNLIB_ERROR - -/* static */ -void wxDynamicLibrary::Error() -{ -#if wxUSE_UNICODE - wxWCharBuffer buffer = wxConvLocal.cMB2WC( wx_dlerror() ); - const wxChar *err = buffer; -#else - const wxChar *err = wx_dlerror(); -#endif - - wxLogError(wxT("%s"), err ? err : _("Unknown dynamic library error")); -} - -#endif // wxHAVE_DYNLIB_ERROR - -// ---------------------------------------------------------------------------- -// listing loaded modules -// ---------------------------------------------------------------------------- - -// wxDynamicLibraryDetails declares this class as its friend, so put the code -// initializing new details objects here -class wxDynamicLibraryDetailsCreator -{ -public: - // create a new wxDynamicLibraryDetails from the given data - static wxDynamicLibraryDetails * - New(void *start, void *end, const wxString& path) - { - wxDynamicLibraryDetails *details = new wxDynamicLibraryDetails; - details->m_path = path; - details->m_name = path.AfterLast(_T('/')); - details->m_address = start; - details->m_length = (char *)end - (char *)start; - - // try to extract the library version from its name - const size_t posExt = path.rfind(_T(".so")); - if ( posExt != wxString::npos ) - { - if ( path.c_str()[posExt + 3] == _T('.') ) - { - // assume "libfoo.so.x.y.z" case - details->m_version.assign(path, posExt + 4, wxString::npos); - } - else - { - size_t posDash = path.find_last_of(_T('-'), posExt); - if ( posDash != wxString::npos ) - { - // assume "libbar-x.y.z.so" case - posDash++; - details->m_version.assign(path, posDash, posExt - posDash); - } - } - } - - return details; - } -}; - -/* static */ -wxDynamicLibraryDetailsArray wxDynamicLibrary::ListLoaded() -{ - wxDynamicLibraryDetailsArray dlls; - -#ifdef __LINUX__ - // examine /proc/self/maps to find out what is loaded in our address space - wxFFile file(_T("/proc/self/maps")); - if ( file.IsOpened() ) - { - // details of the module currently being parsed - wxString pathCur; - void *startCur = NULL, - *endCur = NULL; - - char path[1024]; - char buf[1024]; - while ( fgets(buf, WXSIZEOF(buf), file.fp()) ) - { - // format is: "start-end perm offset maj:min inode path", see proc(5) - void *start, - *end; - switch ( sscanf(buf, "%p-%p %*4s %*p %*02x:%*02x %*d %1024s\n", - &start, &end, path) ) - { - case 2: - // there may be no path column - path[0] = '\0'; - break; - - case 3: - // nothing to do, read everything we wanted - break; - - default: - // chop '\n' - buf[strlen(buf) - 1] = '\0'; - wxLogDebug(_T("Failed to parse line \"%s\" in /proc/self/maps."), - buf); - continue; - } - - wxASSERT_MSG( start >= endCur, - _T("overlapping regions in /proc/self/maps?") ); - - wxString pathNew = wxString::FromAscii(path); - if ( pathCur.empty() ) - { - // new module start - pathCur = pathNew; - startCur = start; - endCur = end; - } - else if ( pathCur == pathNew && endCur == end ) - { - // continuation of the same module in the address space - endCur = end; - } - else // end of the current module - { - dlls.Add(wxDynamicLibraryDetailsCreator::New(startCur, - endCur, - pathCur)); - pathCur.clear(); - } - } - } -#endif // __LINUX__ - - return dlls; -} - -#endif // wxUSE_DYNLIB_CLASS - diff --git a/wxWidgets/src/unix/fontenum.cpp b/wxWidgets/src/unix/fontenum.cpp deleted file mode 100644 index 6049ceda27..0000000000 --- a/wxWidgets/src/unix/fontenum.cpp +++ /dev/null @@ -1,362 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/unix/fontenum.cpp -// Purpose: wxFontEnumerator class for X11/GDK -// Author: Vadim Zeitlin -// Modified by: -// Created: 01.10.99 -// RCS-ID: $Id: fontenum.cpp 43727 2006-12-01 10:14:28Z VS $ -// Copyright: (c) Vadim Zeitlin -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -// for compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#include "wx/fontenum.h" - -#ifndef WX_PRECOMP - #include "wx/dynarray.h" - #include "wx/string.h" - #include "wx/app.h" - #include "wx/utils.h" -#endif - -#include "wx/regex.h" -#include "wx/fontmap.h" -#include "wx/fontutil.h" -#include "wx/encinfo.h" - -// ---------------------------------------------------------------------------- -// Pango -// ---------------------------------------------------------------------------- - -#if wxUSE_PANGO - -#include "pango/pango.h" - -#ifdef __WXGTK20__ -#include "gtk/gtk.h" -extern GtkWidget *wxGetRootWindow(); -#endif // __WXGTK20__ - -extern "C" int wxCMPFUNC_CONV -wxCompareFamilies (const void *a, const void *b) -{ - const char *a_name = pango_font_family_get_name (*(PangoFontFamily **)a); - const char *b_name = pango_font_family_get_name (*(PangoFontFamily **)b); - - return g_utf8_collate (a_name, b_name); -} - -bool wxFontEnumerator::EnumerateFacenames(wxFontEncoding encoding, - bool fixedWidthOnly) -{ - if ( encoding != wxFONTENCODING_SYSTEM && encoding != wxFONTENCODING_UTF8 ) - { - // Pango supports only UTF-8 encoding (and system means any, so we - // accept it too) - return false; - } - -#if defined(__WXGTK20__) || !defined(HAVE_PANGO_FONT_FAMILY_IS_MONOSPACE) - if ( fixedWidthOnly -#if defined(__WXGTK24__) - && (gtk_check_version(2,4,0) != NULL) -#endif - ) - { - OnFacename( wxT("monospace") ); - } - else // !fixedWidthOnly -#endif // __WXGTK20__ || !HAVE_PANGO_FONT_FAMILY_IS_MONOSPACE - { - PangoFontFamily **families = NULL; - gint n_families = 0; - pango_context_list_families ( -#ifdef __WXGTK20__ - gtk_widget_get_pango_context( wxGetRootWindow() ), -#else - wxTheApp->GetPangoContext(), -#endif - &families, &n_families ); - qsort (families, n_families, sizeof (PangoFontFamily *), wxCompareFamilies); - - for (int i=0; i -#ifdef __VMS__ -#pragma message enable nosimpint -#endif - -// ---------------------------------------------------------------------------- -// private functions -// ---------------------------------------------------------------------------- - -// create the list of all fonts with the given spacing and encoding -static char **CreateFontList(wxChar spacing, wxFontEncoding encoding, - int *nFonts); - -// extract all font families from the given font list and call our -// OnFacename() for each of them -static bool ProcessFamiliesFromFontList(wxFontEnumerator *This, - char **fonts, - int nFonts); - - -// ---------------------------------------------------------------------------- -// private types -// ---------------------------------------------------------------------------- - -// ============================================================================ -// implementation -// ============================================================================ - -// ---------------------------------------------------------------------------- -// helpers -// ---------------------------------------------------------------------------- - -#if !wxUSE_NANOX -static char **CreateFontList(wxChar spacing, - wxFontEncoding encoding, - int *nFonts) -{ - wxNativeEncodingInfo info; - wxGetNativeFontEncoding(encoding, &info); - -#if wxUSE_FONTMAP - if ( !wxTestFontEncoding(info) ) - { - // ask font mapper for a replacement - (void)wxFontMapper::Get()->GetAltForEncoding(encoding, &info); - } -#endif // wxUSE_FONTMAP - - wxString pattern; - pattern.Printf(wxT("-*-*-*-*-*-*-*-*-*-*-%c-*-%s-%s"), - spacing, - info.xregistry.c_str(), - info.xencoding.c_str()); - - // get the list of all fonts - return XListFonts((Display *)wxGetDisplay(), pattern.mb_str(), 32767, nFonts); -} - -static bool ProcessFamiliesFromFontList(wxFontEnumerator *This, - char **fonts, - int nFonts) -{ -#if wxUSE_REGEX - wxRegEx re(wxT("^(-[^-]*){14}$"), wxRE_NOSUB); -#endif // wxUSE_REGEX - - // extract the list of (unique) font families - wxSortedArrayString families; - for ( int n = 0; n < nFonts; n++ ) - { - char *font = fonts[n]; -#if wxUSE_REGEX - if ( !re.Matches(font) ) -#else // !wxUSE_REGEX - if ( !wxString(font).Matches(wxT("-*-*-*-*-*-*-*-*-*-*-*-*-*-*")) ) -#endif // wxUSE_REGEX/!wxUSE_REGEX - { - // it's not a full font name (probably an alias) - continue; - } - - // coverity[returned_null] - char *dash = strchr(font + 1, '-'); - char *family = dash + 1; - dash = strchr(family, '-'); - *dash = '\0'; // !NULL because Matches() above succeeded - wxString fam(family); - - if ( families.Index(fam) == wxNOT_FOUND ) - { - if ( !This->OnFacename(fam) ) - { - // stop enumerating - return false; - } - - families.Add(fam); - } - //else: already seen - } - - return true; -} -#endif - // wxUSE_NANOX - -// ---------------------------------------------------------------------------- -// wxFontEnumerator -// ---------------------------------------------------------------------------- - -bool wxFontEnumerator::EnumerateFacenames(wxFontEncoding encoding, - bool fixedWidthOnly) -{ -#if wxUSE_NANOX - return false; -#else - int nFonts; - char **fonts; - - if ( fixedWidthOnly ) - { - bool cont = true; - fonts = CreateFontList(wxT('m'), encoding, &nFonts); - if ( fonts ) - { - cont = ProcessFamiliesFromFontList(this, fonts, nFonts); - - XFreeFontNames(fonts); - } - - if ( !cont ) - { - return true; - } - - fonts = CreateFontList(wxT('c'), encoding, &nFonts); - if ( !fonts ) - { - return true; - } - } - else - { - fonts = CreateFontList(wxT('*'), encoding, &nFonts); - - if ( !fonts ) - { - // it's ok if there are no fonts in given encoding - but it's not - // ok if there are no fonts at all - wxASSERT_MSG(encoding != wxFONTENCODING_SYSTEM, - wxT("No fonts at all on this system?")); - - return false; - } - } - - (void)ProcessFamiliesFromFontList(this, fonts, nFonts); - - XFreeFontNames(fonts); - return true; -#endif - // wxUSE_NANOX -} - -bool wxFontEnumerator::EnumerateEncodings(const wxString& family) -{ -#if wxUSE_NANOX - return false; -#else - wxString pattern; - pattern.Printf(wxT("-*-%s-*-*-*-*-*-*-*-*-*-*-*-*"), - family.empty() ? wxT("*") : family.c_str()); - - // get the list of all fonts - int nFonts; - char **fonts = XListFonts((Display *)wxGetDisplay(), pattern.mb_str(), - 32767, &nFonts); - - if ( !fonts ) - { - // unknown family? - return false; - } - - // extract the list of (unique) encodings - wxSortedArrayString encodings; - for ( int n = 0; n < nFonts; n++ ) - { - char *font = fonts[n]; - if ( !wxString(font).Matches(wxT("-*-*-*-*-*-*-*-*-*-*-*-*-*-*")) ) - { - // it's not a full font name (probably an alias) - continue; - } - - // extract the family - char *dash = strchr(font + 1, '-'); - char *familyFont = dash + 1; - dash = strchr(familyFont, '-'); - *dash = '\0'; // !NULL because Matches() above succeeded - - if ( !family.empty() && (family != familyFont) ) - { - // family doesn't match - continue; - } - - // now extract the registry/encoding - char *p = dash + 1; // just after the dash after family - dash = strrchr(p, '-'); - - wxString registry(dash + 1); - *dash = '\0'; - - dash = strrchr(p, '-'); - wxString encoding(dash + 1); - - encoding << wxT('-') << registry; - if ( encodings.Index(encoding) == wxNOT_FOUND ) - { - if ( !OnFontEncoding(familyFont, encoding) ) - { - break; - } - - encodings.Add(encoding); - } - //else: already had this one - } - - XFreeFontNames(fonts); - - return true; -#endif - // wxUSE_NANOX -} - -#endif // !wxUSE_PANGO diff --git a/wxWidgets/src/unix/fontutil.cpp b/wxWidgets/src/unix/fontutil.cpp deleted file mode 100644 index f0f6cbeec5..0000000000 --- a/wxWidgets/src/unix/fontutil.cpp +++ /dev/null @@ -1,1441 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/unix/fontutil.cpp -// Purpose: Font helper functions for X11 (GDK/X) -// Author: Vadim Zeitlin -// Modified by: -// Created: 05.11.99 -// RCS-ID: $Id: fontutil.cpp 42124 2006-10-19 15:25:59Z VZ $ -// Copyright: (c) Vadim Zeitlin -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#include "wx/fontutil.h" - -#ifndef WX_PRECOMP - #include "wx/app.h" - #include "wx/font.h" // wxFont enums - #include "wx/encinfo.h" - #include "wx/hash.h" - #include "wx/utils.h" // for wxGetDisplay() - #include "wx/module.h" -#endif // PCH - -#include "wx/fontmap.h" -#include "wx/tokenzr.h" -#include "wx/fontenum.h" - -#if wxUSE_PANGO - -#include "pango/pango.h" - -#ifdef __WXGTK20__ - #include "wx/gtk/private.h" - extern GtkWidget *wxGetRootWindow(); - - #define wxPANGO_CONV wxGTK_CONV_SYS -#else - #include "wx/x11/private.h" - #include "wx/gtk/private/string.h" - - #define wxPANGO_CONV(s) (wxConvUTF8.cWX2MB((s))) -#endif - -// ---------------------------------------------------------------------------- -// wxNativeFontInfo -// ---------------------------------------------------------------------------- - -void wxNativeFontInfo::Init() -{ - description = NULL; -} - -void -wxNativeFontInfo::Init(const wxNativeFontInfo& info) -{ - if (info.description) - description = pango_font_description_copy(info.description); - else - description = NULL; -} - -void wxNativeFontInfo::Free() -{ - if (description) - pango_font_description_free(description); -} - -int wxNativeFontInfo::GetPointSize() const -{ - return pango_font_description_get_size( description ) / PANGO_SCALE; -} - -wxFontStyle wxNativeFontInfo::GetStyle() const -{ - wxFontStyle m_style = wxFONTSTYLE_NORMAL; - - switch (pango_font_description_get_style( description )) - { - case PANGO_STYLE_NORMAL: - m_style = wxFONTSTYLE_NORMAL; - break; - case PANGO_STYLE_ITALIC: - m_style = wxFONTSTYLE_ITALIC; - break; - case PANGO_STYLE_OBLIQUE: - m_style = wxFONTSTYLE_SLANT; - break; - } - - return m_style; -} - -wxFontWeight wxNativeFontInfo::GetWeight() const -{ -#if 0 - // We seem to currently initialize only by string. - // In that case PANGO_FONT_MASK_WEIGHT is always set. - if (!(pango_font_description_get_set_fields(description) & PANGO_FONT_MASK_WEIGHT)) - return wxFONTWEIGHT_NORMAL; -#endif - - PangoWeight pango_weight = pango_font_description_get_weight( description ); - - // Until the API can be changed the following ranges of weight values are used: - // wxFONTWEIGHT_LIGHT: 100 .. 349 - range of 250 - // wxFONTWEIGHT_NORMAL: 350 .. 599 - range of 250 - // wxFONTWEIGHT_BOLD: 600 .. 900 - range of 301 (600 is "semibold" already) - - if (pango_weight >= 600) - return wxFONTWEIGHT_BOLD; - - if (pango_weight < 350) - return wxFONTWEIGHT_LIGHT; - - return wxFONTWEIGHT_NORMAL; -} - -bool wxNativeFontInfo::GetUnderlined() const -{ - return false; -} - -wxString wxNativeFontInfo::GetFaceName() const -{ - wxString tmp = wxGTK_CONV_BACK( pango_font_description_get_family( description ) ); - - return tmp; -} - -wxFontFamily wxNativeFontInfo::GetFamily() const -{ - wxFontFamily ret = wxFONTFAMILY_DEFAULT; - // note: not passing -1 as the 2nd parameter to g_ascii_strdown to work - // around a bug in the 64-bit glib shipped with solaris 10, -1 causes it - // to try to allocate 2^32 bytes. - const char *family_name = pango_font_description_get_family( description ); - if ( !family_name ) - return ret; - - wxGtkString family_text(g_ascii_strdown(family_name, strlen(family_name))); - - // Check for some common fonts, to salvage what we can from the current win32 centric wxFont API: - if (strncmp( family_text, "monospace", 9 ) == 0) - ret = wxFONTFAMILY_TELETYPE; // begins with "Monospace" - else if (strncmp( family_text, "courier", 7 ) == 0) - ret = wxFONTFAMILY_TELETYPE; // begins with "Courier" -#if defined(__WXGTK24__) || defined(HAVE_PANGO_FONT_FAMILY_IS_MONOSPACE) - else -#ifdef __WXGTK24__ - if (!gtk_check_version(2,4,0)) -#endif - { - PangoFontFamily **families; - PangoFontFamily *family = NULL; - int n_families; - pango_context_list_families( -#ifdef __WXGTK20__ - gtk_widget_get_pango_context( wxGetRootWindow() ), -#else - wxTheApp->GetPangoContext(), -#endif - &families, &n_families); - - for (int i = 0;i < n_families;++i) - { - if (g_ascii_strcasecmp(pango_font_family_get_name( families[i] ), pango_font_description_get_family( description )) == 0 ) - { - family = families[i]; - break; - } - } - - g_free(families); - - // Some gtk+ systems might query for a non-existing font from wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT) - // on initialization, don't assert until wxSystemSettings::GetFont is checked for this - MR - // wxASSERT_MSG( family, wxT("wxNativeFontInfo::GetFamily() - No appropriate PangoFontFamily found for ::description") ); - - //BCI: Cache the wxFontFamily inside the class. Validate cache with - //BCI: g_ascii_strcasecmp(pango_font_description_get_family(description), pango_font_family_get_name(family)) == 0 - - if (family != NULL && pango_font_family_is_monospace( family )) - ret = wxFONTFAMILY_TELETYPE; // is deemed a monospace font by pango - } -#endif // gtk24 || HAVE_PANGO_FONT_FAMILY_IS_MONOSPACE - - if (ret == wxFONTFAMILY_DEFAULT) - { - if (strstr( family_text, "sans" ) != NULL) // checked before serif, so that "* Sans Serif" fonts are detected correctly - ret = wxFONTFAMILY_SWISS; // contains "Sans" - else if (strstr( family_text, "serif" ) != NULL) - ret = wxFONTFAMILY_ROMAN; // contains "Serif" - else if (strncmp( family_text, "times", 5 ) == 0) - ret = wxFONTFAMILY_ROMAN; // begins with "Times" - else if (strncmp( family_text, "old", 3 ) == 0) - ret = wxFONTFAMILY_DECORATIVE; // Begins with "Old" - "Old English", "Old Town" - } - - return ret; -} - -wxFontEncoding wxNativeFontInfo::GetEncoding() const -{ - return wxFONTENCODING_SYSTEM; -} - - -void wxNativeFontInfo::SetPointSize(int pointsize) -{ - pango_font_description_set_size( description, pointsize * PANGO_SCALE ); -} - -void wxNativeFontInfo::SetStyle(wxFontStyle style) -{ - switch (style) - { - case wxFONTSTYLE_ITALIC: - pango_font_description_set_style( description, PANGO_STYLE_ITALIC ); - break; - case wxFONTSTYLE_SLANT: - pango_font_description_set_style( description, PANGO_STYLE_OBLIQUE ); - break; - default: - wxFAIL_MSG( _T("unknown font style") ); - // fall through - case wxFONTSTYLE_NORMAL: - pango_font_description_set_style( description, PANGO_STYLE_NORMAL ); - break; - } -} - -void wxNativeFontInfo::SetWeight(wxFontWeight weight) -{ - switch (weight) - { - case wxFONTWEIGHT_BOLD: - pango_font_description_set_weight(description, PANGO_WEIGHT_BOLD); - break; - case wxFONTWEIGHT_LIGHT: - pango_font_description_set_weight(description, PANGO_WEIGHT_LIGHT); - break; - default: - wxFAIL_MSG( _T("unknown font weight") ); - // fall through - case wxFONTWEIGHT_NORMAL: - pango_font_description_set_weight(description, PANGO_WEIGHT_NORMAL); - } -} - -void wxNativeFontInfo::SetUnderlined(bool WXUNUSED(underlined)) -{ - wxFAIL_MSG( _T("not implemented") ); -} - -bool wxNativeFontInfo::SetFaceName(const wxString& facename) -{ - pango_font_description_set_family(description, wxPANGO_CONV(facename)); - return true; -} - -void wxNativeFontInfo::SetFamily(wxFontFamily WXUNUSED(family)) -{ - wxFAIL_MSG( _T("not implemented") ); -} - -void wxNativeFontInfo::SetEncoding(wxFontEncoding WXUNUSED(encoding)) -{ - wxFAIL_MSG( _T("not implemented") ); -} - - - -bool wxNativeFontInfo::FromString(const wxString& s) -{ - if (description) - pango_font_description_free( description ); - - // there is a bug in at least pango <= 1.13 which makes it (or its backends) - // segfault for very big point sizes and for negative point sizes. - // To workaround that bug for pango <= 1.13 - // (see http://bugzilla.gnome.org/show_bug.cgi?id=340229) - // we do the check on the size here using same (arbitrary) limits used by - // pango > 1.13. Note that the segfault could happen also for pointsize - // smaller than this limit !! - wxString str(s); - const size_t pos = str.find_last_of(_T(" ")); - double size; - if ( pos != wxString::npos && wxString(str, pos + 1).ToDouble(&size) ) - { - wxString sizeStr; - if ( size < 1 ) - sizeStr = _T("1"); - else if ( size >= 1E6 ) - sizeStr = _T("1E6"); - - if ( !sizeStr.empty() ) - { - // replace the old size with the adjusted one - str = wxString(s, 0, pos) + sizeStr; - } - } - - description = pango_font_description_from_string(wxPANGO_CONV(str)); - - // ensure a valid facename is selected - if (!wxFontEnumerator::IsValidFacename(GetFaceName())) - SetFaceName(wxNORMAL_FONT->GetFaceName()); - - return true; -} - -wxString wxNativeFontInfo::ToString() const -{ - wxGtkString str(pango_font_description_to_string( description )); - - return wxGTK_CONV_BACK(str); -} - -bool wxNativeFontInfo::FromUserString(const wxString& s) -{ - return FromString( s ); -} - -wxString wxNativeFontInfo::ToUserString() const -{ - return ToString(); -} - -// ---------------------------------------------------------------------------- -// wxNativeEncodingInfo -// ---------------------------------------------------------------------------- - -bool wxNativeEncodingInfo::FromString(const wxString& WXUNUSED(s)) -{ - return false; -} - -wxString wxNativeEncodingInfo::ToString() const -{ - return wxEmptyString; -} - -bool wxTestFontEncoding(const wxNativeEncodingInfo& WXUNUSED(info)) -{ - return true; -} - -bool wxGetNativeFontEncoding(wxFontEncoding encoding, - wxNativeEncodingInfo *info) -{ - // all encodings are available in GTK+ 2 because we translate text in any - // encoding to UTF-8 internally anyhow - info->facename.clear(); - info->encoding = encoding; - - return true; -} - -#else // GTK+ 1.x - -#ifdef __X__ - #ifdef __VMS__ - #pragma message disable nosimpint - #endif - - #include - - #ifdef __VMS__ - #pragma message enable nosimpint - #endif - -#elif defined(__WXGTK__) - // we have to declare struct tm to avoid problems with first forward - // declaring it in C code (glib.h included from gdk.h does it) and then - // defining it when time.h is included from the headers below - this is - // known not to work at least with Sun CC 6.01 - #include - - #include -#endif - - -// ---------------------------------------------------------------------------- -// private data -// ---------------------------------------------------------------------------- - -static wxHashTable *g_fontHash = (wxHashTable*) NULL; - -// ---------------------------------------------------------------------------- -// private functions -// ---------------------------------------------------------------------------- - -// define the functions to create and destroy native fonts for this toolkit -#ifdef __X__ - wxNativeFont wxLoadFont(const wxString& fontSpec) - { - return XLoadQueryFont((Display *)wxGetDisplay(), fontSpec); - } - - inline void wxFreeFont(wxNativeFont font) - { - XFreeFont((Display *)wxGetDisplay(), (XFontStruct *)font); - } -#elif defined(__WXGTK__) - wxNativeFont wxLoadFont(const wxString& fontSpec) - { - // VZ: we should use gdk_fontset_load() instead of gdk_font_load() - // here to be able to display Japanese fonts correctly (at least - // this is what people report) but unfortunately doing it results - // in tons of warnings when using GTK with "normal" European - // languages and so we can't always do it and I don't know enough - // to determine when should this be done... (FIXME) - return gdk_font_load( wxConvertWX2MB(fontSpec) ); - } - - inline void wxFreeFont(wxNativeFont font) - { - gdk_font_unref(font); - } -#else - #error "Unknown GUI toolkit" -#endif - -static bool wxTestFontSpec(const wxString& fontspec); - -static wxNativeFont wxLoadQueryFont(int pointSize, - int family, - int style, - int weight, - bool underlined, - const wxString& facename, - const wxString& xregistry, - const wxString& xencoding, - wxString* xFontName); - -// ============================================================================ -// implementation -// ============================================================================ - -// ---------------------------------------------------------------------------- -// wxNativeEncodingInfo -// ---------------------------------------------------------------------------- - -// convert to/from the string representation: format is -// encodingid;registry;encoding[;facename] -bool wxNativeEncodingInfo::FromString(const wxString& s) -{ - // use ";", not "-" because it may be part of encoding name - wxStringTokenizer tokenizer(s, _T(";")); - - wxString encid = tokenizer.GetNextToken(); - long enc; - if ( !encid.ToLong(&enc) ) - return false; - encoding = (wxFontEncoding)enc; - - xregistry = tokenizer.GetNextToken(); - if ( !xregistry ) - return false; - - xencoding = tokenizer.GetNextToken(); - if ( !xencoding ) - return false; - - // ok even if empty - facename = tokenizer.GetNextToken(); - - return true; -} - -wxString wxNativeEncodingInfo::ToString() const -{ - wxString s; - s << (long)encoding << _T(';') << xregistry << _T(';') << xencoding; - if ( !facename.empty() ) - { - s << _T(';') << facename; - } - - return s; -} - -// ---------------------------------------------------------------------------- -// wxNativeFontInfo -// ---------------------------------------------------------------------------- - -void wxNativeFontInfo::Init() -{ - m_isDefault = true; -} - -bool wxNativeFontInfo::FromString(const wxString& s) -{ - wxStringTokenizer tokenizer(s, _T(";")); - - // check the version - wxString token = tokenizer.GetNextToken(); - if ( token != _T('0') ) - return false; - - xFontName = tokenizer.GetNextToken(); - - // this should be the end - if ( tokenizer.HasMoreTokens() ) - return false; - - return FromXFontName(xFontName); -} - -wxString wxNativeFontInfo::ToString() const -{ - // 0 is the version - return wxString::Format(_T("%d;%s"), 0, GetXFontName().c_str()); -} - -bool wxNativeFontInfo::FromUserString(const wxString& s) -{ - return FromXFontName(s); -} - -wxString wxNativeFontInfo::ToUserString() const -{ - return GetXFontName(); -} - -bool wxNativeFontInfo::HasElements() const -{ - // we suppose that the foundry is never empty, so if it is it means that we - // had never parsed the XLFD - return !fontElements[0].empty(); -} - -wxString wxNativeFontInfo::GetXFontComponent(wxXLFDField field) const -{ - wxCHECK_MSG( field < wxXLFD_MAX, wxEmptyString, _T("invalid XLFD field") ); - - if ( !HasElements() ) - { - // const_cast - if ( !((wxNativeFontInfo *)this)->FromXFontName(xFontName) ) - return wxEmptyString; - } - - return fontElements[field]; -} - -bool wxNativeFontInfo::FromXFontName(const wxString& fontname) -{ - // TODO: we should be able to handle the font aliases here, but how? - wxStringTokenizer tokenizer(fontname, _T("-")); - - // skip the leading, usually empty field (font name registry) - if ( !tokenizer.HasMoreTokens() ) - return false; - - (void)tokenizer.GetNextToken(); - - for ( size_t n = 0; n < WXSIZEOF(fontElements); n++ ) - { - if ( !tokenizer.HasMoreTokens() ) - { - // not enough elements in the XLFD - or maybe an alias - return false; - } - - wxString field = tokenizer.GetNextToken(); - if ( !field.empty() && field != _T('*') ) - { - // we're really initialized now - m_isDefault = false; - } - - fontElements[n] = field; - } - - // this should be all - if ( tokenizer.HasMoreTokens() ) - return false; - - return true; -} - -wxString wxNativeFontInfo::GetXFontName() const -{ - if ( xFontName.empty() ) - { - for ( size_t n = 0; n < WXSIZEOF(fontElements); n++ ) - { - // replace the non specified elements with '*' except for the - // additional style which is usually just omitted - wxString elt = fontElements[n]; - if ( elt.empty() && n != wxXLFD_ADDSTYLE ) - { - elt = _T('*'); - } - - // const_cast - ((wxNativeFontInfo *)this)->xFontName << _T('-') << elt; - } - } - - return xFontName; -} - -void -wxNativeFontInfo::SetXFontComponent(wxXLFDField field, const wxString& value) -{ - wxCHECK_RET( field < wxXLFD_MAX, _T("invalid XLFD field") ); - - // this class should be initialized with a valid font spec first and only - // then the fields may be modified! - wxASSERT_MSG( !IsDefault(), _T("can't modify an uninitialized XLFD") ); - - if ( !HasElements() ) - { - // const_cast - if ( !((wxNativeFontInfo *)this)->FromXFontName(xFontName) ) - { - wxFAIL_MSG( _T("can't set font element for invalid XLFD") ); - - return; - } - } - - fontElements[field] = value; - - // invalidate the XFLD, it doesn't correspond to the font elements any more - xFontName.clear(); -} - -void wxNativeFontInfo::SetXFontName(const wxString& xFontName_) -{ - // invalidate the font elements, GetXFontComponent() will reparse the XLFD - fontElements[0].clear(); - - xFontName = xFontName_; - - m_isDefault = false; -} - -int wxNativeFontInfo::GetPointSize() const -{ - const wxString s = GetXFontComponent(wxXLFD_POINTSIZE); - - // return -1 to indicate that the size is unknown - long l; - return s.ToLong(&l) ? l : -1; -} - -wxFontStyle wxNativeFontInfo::GetStyle() const -{ - const wxString s = GetXFontComponent(wxXLFD_SLANT); - - if ( s.length() != 1 ) - { - // it is really unknown but we don't have any way to return it from - // here - return wxFONTSTYLE_NORMAL; - } - - switch ( s[0] ) - { - default: - // again, unknown but consider normal by default - - case _T('r'): - return wxFONTSTYLE_NORMAL; - - case _T('i'): - return wxFONTSTYLE_ITALIC; - - case _T('o'): - return wxFONTSTYLE_SLANT; - } -} - -wxFontWeight wxNativeFontInfo::GetWeight() const -{ - const wxString s = GetXFontComponent(wxXLFD_WEIGHT).MakeLower(); - if ( s.find(_T("bold")) != wxString::npos || s == _T("black") ) - return wxFONTWEIGHT_BOLD; - else if ( s == _T("light") ) - return wxFONTWEIGHT_LIGHT; - - return wxFONTWEIGHT_NORMAL; -} - -bool wxNativeFontInfo::GetUnderlined() const -{ - // X fonts are never underlined - return false; -} - -wxString wxNativeFontInfo::GetFaceName() const -{ - // wxWidgets facename probably more accurately corresponds to X family - return GetXFontComponent(wxXLFD_FAMILY); -} - -wxFontFamily wxNativeFontInfo::GetFamily() const -{ - // and wxWidgets family -- to X foundry, but we have to translate it to - // wxFontFamily somehow... - wxFAIL_MSG(_T("not implemented")); // GetXFontComponent(wxXLFD_FOUNDRY); - - return wxFONTFAMILY_DEFAULT; -} - -wxFontEncoding wxNativeFontInfo::GetEncoding() const -{ - // we already have the code for this but need to refactor it first - wxFAIL_MSG( _T("not implemented") ); - - return wxFONTENCODING_MAX; -} - -void wxNativeFontInfo::SetPointSize(int pointsize) -{ - SetXFontComponent(wxXLFD_POINTSIZE, wxString::Format(_T("%d"), pointsize)); -} - -void wxNativeFontInfo::SetStyle(wxFontStyle style) -{ - wxString s; - switch ( style ) - { - case wxFONTSTYLE_ITALIC: - s = _T('i'); - break; - - case wxFONTSTYLE_SLANT: - s = _T('o'); - break; - - case wxFONTSTYLE_NORMAL: - s = _T('r'); - - default: - wxFAIL_MSG( _T("unknown wxFontStyle in wxNativeFontInfo::SetStyle") ); - return; - } - - SetXFontComponent(wxXLFD_SLANT, s); -} - -void wxNativeFontInfo::SetWeight(wxFontWeight weight) -{ - wxString s; - switch ( weight ) - { - case wxFONTWEIGHT_BOLD: - s = _T("bold"); - break; - - case wxFONTWEIGHT_LIGHT: - s = _T("light"); - break; - - case wxFONTWEIGHT_NORMAL: - s = _T("medium"); - break; - - default: - wxFAIL_MSG( _T("unknown wxFontWeight in wxNativeFontInfo::SetWeight") ); - return; - } - - SetXFontComponent(wxXLFD_WEIGHT, s); -} - -void wxNativeFontInfo::SetUnderlined(bool WXUNUSED(underlined)) -{ - // can't do this under X -} - -bool wxNativeFontInfo::SetFaceName(const wxString& facename) -{ - SetXFontComponent(wxXLFD_FAMILY, facename); - return true; -} - -void wxNativeFontInfo::SetFamily(wxFontFamily WXUNUSED(family)) -{ - // wxFontFamily -> X foundry, anyone? - wxFAIL_MSG( _T("not implemented") ); - - // SetXFontComponent(wxXLFD_FOUNDRY, ...); -} - -void wxNativeFontInfo::SetEncoding(wxFontEncoding encoding) -{ - wxNativeEncodingInfo info; - if ( wxGetNativeFontEncoding(encoding, &info) ) - { - SetXFontComponent(wxXLFD_ENCODING, info.xencoding); - SetXFontComponent(wxXLFD_REGISTRY, info.xregistry); - } -} - -// ---------------------------------------------------------------------------- -// common functions -// ---------------------------------------------------------------------------- - -bool wxGetNativeFontEncoding(wxFontEncoding encoding, - wxNativeEncodingInfo *info) -{ - wxCHECK_MSG( info, false, _T("bad pointer in wxGetNativeFontEncoding") ); - - if ( encoding == wxFONTENCODING_DEFAULT ) - { - encoding = wxFont::GetDefaultEncoding(); - } - - switch ( encoding ) - { - case wxFONTENCODING_ISO8859_1: - case wxFONTENCODING_ISO8859_2: - case wxFONTENCODING_ISO8859_3: - case wxFONTENCODING_ISO8859_4: - case wxFONTENCODING_ISO8859_5: - case wxFONTENCODING_ISO8859_6: - case wxFONTENCODING_ISO8859_7: - case wxFONTENCODING_ISO8859_8: - case wxFONTENCODING_ISO8859_9: - case wxFONTENCODING_ISO8859_10: - case wxFONTENCODING_ISO8859_11: - case wxFONTENCODING_ISO8859_12: - case wxFONTENCODING_ISO8859_13: - case wxFONTENCODING_ISO8859_14: - case wxFONTENCODING_ISO8859_15: - { - int cp = encoding - wxFONTENCODING_ISO8859_1 + 1; - info->xregistry = wxT("iso8859"); - info->xencoding.Printf(wxT("%d"), cp); - } - break; - - case wxFONTENCODING_UTF8: - info->xregistry = wxT("iso10646"); - info->xencoding = wxT("*"); - break; - - case wxFONTENCODING_GB2312: - info->xregistry = wxT("GB2312"); // or the otherway round? - info->xencoding = wxT("*"); - break; - - case wxFONTENCODING_KOI8: - case wxFONTENCODING_KOI8_U: - info->xregistry = wxT("koi8"); - - // we don't make distinction between koi8-r, koi8-u and koi8-ru (so far) - info->xencoding = wxT("*"); - break; - - case wxFONTENCODING_CP1250: - case wxFONTENCODING_CP1251: - case wxFONTENCODING_CP1252: - case wxFONTENCODING_CP1253: - case wxFONTENCODING_CP1254: - case wxFONTENCODING_CP1255: - case wxFONTENCODING_CP1256: - case wxFONTENCODING_CP1257: - { - int cp = encoding - wxFONTENCODING_CP1250 + 1250; - info->xregistry = wxT("microsoft"); - info->xencoding.Printf(wxT("cp%d"), cp); - } - break; - - case wxFONTENCODING_EUC_JP: - case wxFONTENCODING_SHIFT_JIS: - info->xregistry = "jis*"; - info->xencoding = "*"; - break; - - case wxFONTENCODING_SYSTEM: - info->xregistry = - info->xencoding = wxT("*"); - break; - - default: - // don't know how to translate this encoding into X fontspec - return false; - } - - info->encoding = encoding; - - return true; -} - -bool wxTestFontEncoding(const wxNativeEncodingInfo& info) -{ - wxString fontspec; - fontspec.Printf(_T("-*-%s-*-*-*-*-*-*-*-*-*-*-%s-%s"), - !info.facename ? _T("*") : info.facename.c_str(), - info.xregistry.c_str(), - info.xencoding.c_str()); - - return wxTestFontSpec(fontspec); -} - -// ---------------------------------------------------------------------------- -// X-specific functions -// ---------------------------------------------------------------------------- - -wxNativeFont wxLoadQueryNearestFont(int pointSize, - int family, - int style, - int weight, - bool underlined, - const wxString &facename, - wxFontEncoding encoding, - wxString* xFontName) -{ - if ( encoding == wxFONTENCODING_DEFAULT ) - { - encoding = wxFont::GetDefaultEncoding(); - } - - // first determine the encoding - if the font doesn't exist at all in this - // encoding, it's useless to do all other approximations (i.e. size, - // family &c don't matter much) - wxNativeEncodingInfo info; - if ( encoding == wxFONTENCODING_SYSTEM ) - { - // This will always work so we don't test to save time - wxGetNativeFontEncoding(wxFONTENCODING_SYSTEM, &info); - } - else - { - if ( !wxGetNativeFontEncoding(encoding, &info) || - !wxTestFontEncoding(info) ) - { -#if wxUSE_FONTMAP - if ( !wxFontMapper::Get()->GetAltForEncoding(encoding, &info) ) -#endif // wxUSE_FONTMAP - { - // unspported encoding - replace it with the default - // - // NB: we can't just return 0 from here because wxGTK code doesn't - // check for it (i.e. it supposes that we'll always succeed), - // so it would provoke a crash - wxGetNativeFontEncoding(wxFONTENCODING_SYSTEM, &info); - } - } - } - - // OK, we have the correct xregistry/xencoding in info structure - wxNativeFont font = 0; - - // if we already have the X font name, try to use it - if( xFontName && !xFontName->empty() ) - { - // - // Make sure point size is correct for scale factor. - // - wxStringTokenizer tokenizer(*xFontName, _T("-"), wxTOKEN_RET_DELIMS); - wxString newFontName; - - for(int i = 0; i < 8; i++) - newFontName += tokenizer.NextToken(); - - (void) tokenizer.NextToken(); - - newFontName += wxString::Format(wxT("%d-"), pointSize); - - while(tokenizer.HasMoreTokens()) - newFontName += tokenizer.GetNextToken(); - - font = wxLoadFont(newFontName); - - if(font) - *xFontName = newFontName; - } - - if ( !font ) - { - // search up and down by stepsize 10 - int max_size = pointSize + 20 * (1 + (pointSize/180)); - int min_size = pointSize - 20 * (1 + (pointSize/180)); - - int i, round; // counters - - // first round: search for equal, then for smaller and for larger size with the given weight and style - int testweight = weight; - int teststyle = style; - - for ( round = 0; round < 3; round++ ) - { - // second round: use normal weight - if ( round == 1 ) - { - if ( testweight != wxNORMAL ) - { - testweight = wxNORMAL; - } - else - { - ++round; // fall through to third round - } - } - - // third round: ... and use normal style - if ( round == 2 ) - { - if ( teststyle != wxNORMAL ) - { - teststyle = wxNORMAL; - } - else - { - break; - } - } - // Search for equal or smaller size (approx.) - for ( i = pointSize; !font && i >= 10 && i >= min_size; i -= 10 ) - { - font = wxLoadQueryFont(i, family, teststyle, testweight, underlined, - facename, info.xregistry, info.xencoding, - xFontName); - } - - // Search for larger size (approx.) - for ( i = pointSize + 10; !font && i <= max_size; i += 10 ) - { - font = wxLoadQueryFont(i, family, teststyle, testweight, underlined, - facename, info.xregistry, info.xencoding, - xFontName); - } - } - - // Try default family - if ( !font && family != wxDEFAULT ) - { - font = wxLoadQueryFont(pointSize, wxDEFAULT, style, weight, - underlined, facename, - info.xregistry, info.xencoding, - xFontName ); - } - - // ignore size, family, style and weight but try to find font with the - // given facename and encoding - if ( !font ) - { - font = wxLoadQueryFont(120, wxDEFAULT, wxNORMAL, wxNORMAL, - underlined, facename, - info.xregistry, info.xencoding, - xFontName); - - // ignore family as well - if ( !font ) - { - font = wxLoadQueryFont(120, wxDEFAULT, wxNORMAL, wxNORMAL, - underlined, wxEmptyString, - info.xregistry, info.xencoding, - xFontName); - - // if it still failed, try to get the font of any size but - // with the requested encoding: this can happen if the - // encoding is only available in one size which happens to be - // different from 120 - if ( !font ) - { - font = wxLoadQueryFont(-1, wxDEFAULT, wxNORMAL, wxNORMAL, - false, wxEmptyString, - info.xregistry, info.xencoding, - xFontName); - - // this should never happen as we had tested for it in the - // very beginning, but if it does, do return something non - // NULL or we'd crash in wxFont code - if ( !font ) - { - wxFAIL_MSG( _T("this encoding should be available!") ); - - font = wxLoadQueryFont(-1, - wxDEFAULT, wxNORMAL, wxNORMAL, - false, wxEmptyString, - _T("*"), _T("*"), - xFontName); - } - } - } - } - } - - return font; -} - -// ---------------------------------------------------------------------------- -// private functions -// ---------------------------------------------------------------------------- - -// returns true if there are any fonts matching this font spec -static bool wxTestFontSpec(const wxString& fontspec) -{ - // some X servers will fail to load this font because there are too many - // matches so we must test explicitly for this - if ( fontspec == _T("-*-*-*-*-*-*-*-*-*-*-*-*-*-*") ) - { - return true; - } - - wxNativeFont test = (wxNativeFont) g_fontHash->Get( fontspec ); - if (test) - { - return true; - } - - test = wxLoadFont(fontspec); - g_fontHash->Put( fontspec, (wxObject*) test ); - - if ( test ) - { - wxFreeFont(test); - - return true; - } - else - { - return false; - } -} - -static wxNativeFont wxLoadQueryFont(int pointSize, - int family, - int style, - int weight, - bool WXUNUSED(underlined), - const wxString& facename, - const wxString& xregistry, - const wxString& xencoding, - wxString* xFontName) -{ - wxString xfamily; - switch (family) - { - case wxDECORATIVE: xfamily = wxT("lucida"); break; - case wxROMAN: xfamily = wxT("times"); break; - case wxMODERN: xfamily = wxT("courier"); break; - case wxSWISS: xfamily = wxT("helvetica"); break; - case wxTELETYPE: xfamily = wxT("lucidatypewriter"); break; - case wxSCRIPT: xfamily = wxT("utopia"); break; - default: xfamily = wxT("*"); - } -#if wxUSE_NANOX - int xweight; - switch (weight) - { - case wxBOLD: - { - xweight = MWLF_WEIGHT_BOLD; - break; - } - case wxLIGHT: - { - xweight = MWLF_WEIGHT_LIGHT; - break; - } - case wxNORMAL: - { - xweight = MWLF_WEIGHT_NORMAL; - break; - } - - default: - { - xweight = MWLF_WEIGHT_DEFAULT; - break; - } - } - GR_SCREEN_INFO screenInfo; - GrGetScreenInfo(& screenInfo); - - int yPixelsPerCM = screenInfo.ydpcm; - - // A point is 1/72 of an inch. - // An inch is 2.541 cm. - // So pixelHeight = (pointSize / 72) (inches) * 2.541 (for cm) * yPixelsPerCM (for pixels) - // In fact pointSize is 10 * the normal point size so - // divide by 10. - - int pixelHeight = (int) ( (((float)pointSize) / 720.0) * 2.541 * (float) yPixelsPerCM) ; - - // An alternative: assume that the screen is 72 dpi. - //int pixelHeight = (int) (((float)pointSize / 720.0) * 72.0) ; - //int pixelHeight = (int) ((float)pointSize / 10.0) ; - - GR_LOGFONT logFont; - logFont.lfHeight = pixelHeight; - logFont.lfWidth = 0; - logFont.lfEscapement = 0; - logFont.lfOrientation = 0; - logFont.lfWeight = xweight; - logFont.lfItalic = (style == wxNORMAL ? 0 : 1) ; - logFont.lfUnderline = 0; - logFont.lfStrikeOut = 0; - logFont.lfCharSet = MWLF_CHARSET_DEFAULT; // TODO: select appropriate one - logFont.lfOutPrecision = MWLF_TYPE_DEFAULT; - logFont.lfClipPrecision = 0; // Not used - logFont.lfRoman = (family == wxROMAN ? 1 : 0) ; - logFont.lfSerif = (family == wxSWISS ? 0 : 1) ; - logFont.lfSansSerif = !logFont.lfSerif ; - logFont.lfModern = (family == wxMODERN ? 1 : 0) ; - logFont.lfProportional = (family == wxTELETYPE ? 0 : 1) ; - logFont.lfOblique = 0; - logFont.lfSmallCaps = 0; - logFont.lfPitch = 0; // 0 = default - strcpy(logFont.lfFaceName, facename.c_str()); - - XFontStruct* fontInfo = (XFontStruct*) malloc(sizeof(XFontStruct)); - fontInfo->fid = GrCreateFont((GR_CHAR*) facename.c_str(), pixelHeight, & logFont); - GrGetFontInfo(fontInfo->fid, & fontInfo->info); - return (wxNativeFont) fontInfo; - -#else - wxString fontSpec; - if (!facename.empty()) - { - fontSpec.Printf(wxT("-*-%s-*-*-normal-*-*-*-*-*-*-*-*-*"), - facename.c_str()); - - if ( wxTestFontSpec(fontSpec) ) - { - xfamily = facename; - } - //else: no such family, use default one instead - } - - wxString xstyle; - switch (style) - { - case wxSLANT: - fontSpec.Printf(wxT("-*-%s-*-o-*-*-*-*-*-*-*-*-*-*"), - xfamily.c_str()); - if ( wxTestFontSpec(fontSpec) ) - { - xstyle = wxT("o"); - break; - } - // fall through - try wxITALIC now - - case wxITALIC: - fontSpec.Printf(wxT("-*-%s-*-i-*-*-*-*-*-*-*-*-*-*"), - xfamily.c_str()); - if ( wxTestFontSpec(fontSpec) ) - { - xstyle = wxT("i"); - } - else if ( style == wxITALIC ) // and not wxSLANT - { - // try wxSLANT - fontSpec.Printf(wxT("-*-%s-*-o-*-*-*-*-*-*-*-*-*-*"), - xfamily.c_str()); - if ( wxTestFontSpec(fontSpec) ) - { - xstyle = wxT("o"); - } - else - { - // no italic, no slant - leave default - xstyle = wxT("*"); - } - } - break; - - default: - wxFAIL_MSG(_T("unknown font style")); - // fall back to normal - - case wxNORMAL: - xstyle = wxT("r"); - break; - } - - wxString xweight; - switch (weight) - { - case wxBOLD: - { - fontSpec.Printf(wxT("-*-%s-bold-*-*-*-*-*-*-*-*-*-*-*"), - xfamily.c_str()); - if ( wxTestFontSpec(fontSpec) ) - { - xweight = wxT("bold"); - break; - } - fontSpec.Printf(wxT("-*-%s-heavy-*-*-*-*-*-*-*-*-*-*-*"), - xfamily.c_str()); - if ( wxTestFontSpec(fontSpec) ) - { - xweight = wxT("heavy"); - break; - } - fontSpec.Printf(wxT("-*-%s-extrabold-*-*-*-*-*-*-*-*-*-*-*"), - xfamily.c_str()); - if ( wxTestFontSpec(fontSpec) ) - { - xweight = wxT("extrabold"); - break; - } - fontSpec.Printf(wxT("-*-%s-demibold-*-*-*-*-*-*-*-*-*-*-*"), - xfamily.c_str()); - if ( wxTestFontSpec(fontSpec) ) - { - xweight = wxT("demibold"); - break; - } - fontSpec.Printf(wxT("-*-%s-black-*-*-*-*-*-*-*-*-*-*-*"), - xfamily.c_str()); - if ( wxTestFontSpec(fontSpec) ) - { - xweight = wxT("black"); - break; - } - fontSpec.Printf(wxT("-*-%s-ultrablack-*-*-*-*-*-*-*-*-*-*-*"), - xfamily.c_str()); - if ( wxTestFontSpec(fontSpec) ) - { - xweight = wxT("ultrablack"); - break; - } - } - break; - case wxLIGHT: - { - fontSpec.Printf(wxT("-*-%s-light-*-*-*-*-*-*-*-*-*-*-*"), - xfamily.c_str()); - if ( wxTestFontSpec(fontSpec) ) - { - xweight = wxT("light"); - break; - } - fontSpec.Printf(wxT("-*-%s-thin-*-*-*-*-*-*-*-*-*-*-*"), - xfamily.c_str()); - if ( wxTestFontSpec(fontSpec) ) - { - xweight = wxT("thin"); - break; - } - } - break; - case wxNORMAL: - { - fontSpec.Printf(wxT("-*-%s-medium-*-*-*-*-*-*-*-*-*-*-*"), - xfamily.c_str()); - if ( wxTestFontSpec(fontSpec) ) - { - xweight = wxT("medium"); - break; - } - fontSpec.Printf(wxT("-*-%s-normal-*-*-*-*-*-*-*-*-*-*-*"), - xfamily.c_str()); - if ( wxTestFontSpec(fontSpec) ) - { - xweight = wxT("normal"); - break; - } - fontSpec.Printf(wxT("-*-%s-regular-*-*-*-*-*-*-*-*-*-*-*"), - xfamily.c_str()); - if ( wxTestFontSpec(fontSpec) ) - { - xweight = wxT("regular"); - break; - } - xweight = wxT("*"); - } - break; - default: xweight = wxT("*"); break; - } - - // if pointSize is -1, don't specify any - wxString sizeSpec; - if ( pointSize == -1 ) - { - sizeSpec = _T('*'); - } - else - { - sizeSpec.Printf(_T("%d"), pointSize); - } - - // construct the X font spec from our data - fontSpec.Printf(wxT("-*-%s-%s-%s-normal-*-*-%s-*-*-*-*-%s-%s"), - xfamily.c_str(), xweight.c_str(), xstyle.c_str(), - sizeSpec.c_str(), xregistry.c_str(), xencoding.c_str()); - - if( xFontName ) - *xFontName = fontSpec; - - return wxLoadFont(fontSpec); -#endif - // wxUSE_NANOX -} - -// ---------------------------------------------------------------------------- -// wxFontModule -// ---------------------------------------------------------------------------- - -class wxFontModule : public wxModule -{ -public: - bool OnInit(); - void OnExit(); - -private: - DECLARE_DYNAMIC_CLASS(wxFontModule) -}; - -IMPLEMENT_DYNAMIC_CLASS(wxFontModule, wxModule) - -bool wxFontModule::OnInit() -{ - g_fontHash = new wxHashTable( wxKEY_STRING ); - - return true; -} - -void wxFontModule::OnExit() -{ - delete g_fontHash; - - g_fontHash = (wxHashTable *)NULL; -} - -#endif // GTK 2.0/1.x diff --git a/wxWidgets/src/unix/gsocket.cpp b/wxWidgets/src/unix/gsocket.cpp deleted file mode 100644 index 110747e395..0000000000 --- a/wxWidgets/src/unix/gsocket.cpp +++ /dev/null @@ -1,2299 +0,0 @@ -/* ------------------------------------------------------------------------- - * Project: GSocket (Generic Socket) for WX - * Name: gsocket.c - * Copyright: (c) Guilhem Lavaux - * Licence: wxWindows Licence - * Authors: David Elliott (C++ conversion, maintainer) - * Guilhem Lavaux, - * Guillermo Rodriguez Garcia - * Purpose: GSocket main Unix and OS/2 file - * Licence: The wxWindows licence - * CVSID: $Id: gsocket.cpp 66982 2011-02-20 11:04:45Z TIK $ - * ------------------------------------------------------------------------- - */ - -#if defined(__WATCOMC__) -#include "wx/wxprec.h" -#include -#include -#endif - -#ifndef __GSOCKET_STANDALONE__ -#include "wx/defs.h" -#endif - -#if defined(__VISAGECPP__) -#define BSD_SELECT /* use Berkeley Sockets select */ -#endif - -#if wxUSE_SOCKETS || defined(__GSOCKET_STANDALONE__) - -#include -#include -#ifdef __VISAGECPP__ -#include -#include -#include -#include -#endif -#include -#include - -#ifdef HAVE_SYS_SELECT_H -# include -#endif - -#ifdef __VMS__ -#include -struct sockaddr_un -{ - u_char sun_len; /* sockaddr len including null */ - u_char sun_family; /* AF_UNIX */ - char sun_path[108]; /* path name (gag) */ -}; -#else -#include -#include -#endif - -#ifndef __VISAGECPP__ -#include -#include -#include -#include -#include -#include -#else -#include -# if __IBMCPP__ < 400 -#include -#include -#include -#include -#include - -#define EBADF SOCEBADF - -# ifdef min -# undef min -# endif -# else -#include -#include -#include - -#define close(a) soclose(a) -#define select(a,b,c,d,e) bsdselect(a,b,c,d,e) -int _System bsdselect(int, - struct fd_set *, - struct fd_set *, - struct fd_set *, - struct timeval *); -int _System soclose(int); -# endif -#endif -#ifdef __EMX__ -#include -#endif - -#include -#include -#include -#include -#ifdef sun -# include -#endif -#ifdef sgi -# include -#endif -#ifdef _AIX -# include -#endif -#include - -#ifndef WX_SOCKLEN_T - -#ifdef VMS -# define WX_SOCKLEN_T unsigned int -#else -# ifdef __GLIBC__ -# if __GLIBC__ == 2 -# define WX_SOCKLEN_T socklen_t -# endif -# elif defined(__WXMAC__) -# define WX_SOCKLEN_T socklen_t -# else -# define WX_SOCKLEN_T int -# endif -#endif - -#endif /* SOCKLEN_T */ - -#ifndef SOCKOPTLEN_T -#define SOCKOPTLEN_T WX_SOCKLEN_T -#endif - -/* - * MSW defines this, Unices don't. - */ -#ifndef INVALID_SOCKET -#define INVALID_SOCKET -1 -#endif - -/* UnixWare reportedly needs this for FIONBIO definition */ -#ifdef __UNIXWARE__ -#include -#endif - -/* - * INADDR_BROADCAST is identical to INADDR_NONE which is not defined - * on all systems. INADDR_BROADCAST should be fine to indicate an error. - */ -#ifndef INADDR_NONE -#define INADDR_NONE INADDR_BROADCAST -#endif - -#if defined(__VISAGECPP__) || defined(__WATCOMC__) - - #define MASK_SIGNAL() { - #define UNMASK_SIGNAL() } - -#else - extern "C" { typedef void (*wxSigHandler)(int); } - - #define MASK_SIGNAL() \ - { \ - wxSigHandler old_handler = signal(SIGPIPE, SIG_IGN); - - #define UNMASK_SIGNAL() \ - signal(SIGPIPE, old_handler); \ - } - -#endif - -/* If a SIGPIPE is issued by a socket call on a remotely closed socket, - the program will "crash" unless it explicitly handles the SIGPIPE. - By using MSG_NOSIGNAL, the SIGPIPE is suppressed. Later, we will - use SO_NOSIGPIPE (if available), the BSD equivalent. */ -#ifdef MSG_NOSIGNAL -# define GSOCKET_MSG_NOSIGNAL MSG_NOSIGNAL -#else /* MSG_NOSIGNAL not available (FreeBSD including OS X) */ -# define GSOCKET_MSG_NOSIGNAL 0 -#endif /* MSG_NOSIGNAL */ - -#ifndef __GSOCKET_STANDALONE__ -# include "wx/unix/gsockunx.h" -# include "wx/unix/private.h" -# include "wx/gsocket.h" -#if wxUSE_THREADS && (defined(HAVE_GETHOSTBYNAME) || defined(HAVE_GETSERVBYNAME)) -# include "wx/thread.h" -#endif -#else -# include "gsockunx.h" -# include "gsocket.h" -# ifndef WXUNUSED -# define WXUNUSED(x) -# endif -#endif /* __GSOCKET_STANDALONE__ */ - -#if defined(HAVE_GETHOSTBYNAME) -static struct hostent * deepCopyHostent(struct hostent *h, - const struct hostent *he, - char *buffer, int size, int *err) -{ - /* copy old structure */ - memcpy(h, he, sizeof(struct hostent)); - - /* copy name */ - int len = strlen(h->h_name); - if (len > size) - { - *err = ENOMEM; - return NULL; - } - memcpy(buffer, h->h_name, len); - buffer[len] = '\0'; - h->h_name = buffer; - - /* track position in the buffer */ - int pos = len + 1; - - /* reuse len to store address length */ - len = h->h_length; - - /* ensure pointer alignment */ - unsigned int misalign = sizeof(char *) - pos%sizeof(char *); - if(misalign < sizeof(char *)) - pos += misalign; - - /* leave space for pointer list */ - char **p = h->h_addr_list, **q; - char **h_addr_list = (char **)(buffer + pos); - while(*(p++) != 0) - pos += sizeof(char *); - - /* copy addresses and fill new pointer list */ - for (p = h->h_addr_list, q = h_addr_list; *p != 0; p++, q++) - { - if (size < pos + len) - { - *err = ENOMEM; - return NULL; - } - memcpy(buffer + pos, *p, len); /* copy content */ - *q = buffer + pos; /* set copied pointer to copied content */ - pos += len; - } - *++q = 0; /* null terminate the pointer list */ - h->h_addr_list = h_addr_list; /* copy pointer to pointers */ - - /* ensure word alignment of pointers */ - misalign = sizeof(char *) - pos%sizeof(char *); - if(misalign < sizeof(char *)) - pos += misalign; - - /* leave space for pointer list */ - p = h->h_aliases; - char **h_aliases = (char **)(buffer + pos); - while(*(p++) != 0) - pos += sizeof(char *); - - /* copy aliases and fill new pointer list */ - for (p = h->h_aliases, q = h_aliases; *p != 0; p++, q++) - { - len = strlen(*p); - if (size <= pos + len) - { - *err = ENOMEM; - return NULL; - } - memcpy(buffer + pos, *p, len); /* copy content */ - buffer[pos + len] = '\0'; - *q = buffer + pos; /* set copied pointer to copied content */ - pos += len + 1; - } - *++q = 0; /* null terminate the pointer list */ - h->h_aliases = h_aliases; /* copy pointer to pointers */ - - return h; -} -#endif - -#if defined(HAVE_GETHOSTBYNAME) && wxUSE_THREADS -static wxMutex nameLock; -#endif -struct hostent * wxGethostbyname_r(const char *hostname, struct hostent *h, - void *buffer, int size, int *err) - -{ - struct hostent *he = NULL; - *err = 0; -#if defined(HAVE_FUNC_GETHOSTBYNAME_R_6) - if (gethostbyname_r(hostname, h, (char*)buffer, size, &he, err)) - he = NULL; -#elif defined(HAVE_FUNC_GETHOSTBYNAME_R_5) - he = gethostbyname_r(hostname, h, (char*)buffer, size, err); -#elif defined(HAVE_FUNC_GETHOSTBYNAME_R_3) - if (gethostbyname_r(hostname, h, (struct hostent_data*) buffer)) - { - he = NULL; - *err = h_errno; - } - else - he = h; -#elif defined(HAVE_GETHOSTBYNAME) -#if wxUSE_THREADS - wxMutexLocker locker(nameLock); -#endif - he = gethostbyname(hostname); - if (!he) - *err = h_errno; - else - he = deepCopyHostent(h, he, (char*)buffer, size, err); -#endif - return he; -} - -#if defined(HAVE_GETHOSTBYNAME) && wxUSE_THREADS -static wxMutex addrLock; -#endif -struct hostent * wxGethostbyaddr_r(const char *addr_buf, int buf_size, - int proto, struct hostent *h, - void *buffer, int size, int *err) -{ - struct hostent *he = NULL; - *err = 0; -#if defined(HAVE_FUNC_GETHOSTBYNAME_R_6) - if (gethostbyaddr_r(addr_buf, buf_size, proto, h, - (char*)buffer, size, &he, err)) - he = NULL; -#elif defined(HAVE_FUNC_GETHOSTBYNAME_R_5) - he = gethostbyaddr_r(addr_buf, buf_size, proto, h, (char*)buffer, size, err); -#elif defined(HAVE_FUNC_GETHOSTBYNAME_R_3) - if (gethostbyaddr_r(addr_buf, buf_size, proto, h, - (struct hostent_data*) buffer)) - { - he = NULL; - *err = h_errno; - } - else - he = h; -#elif defined(HAVE_GETHOSTBYNAME) -#if wxUSE_THREADS - wxMutexLocker locker(addrLock); -#endif - he = gethostbyaddr(addr_buf, buf_size, proto); - if (!he) - *err = h_errno; - else - he = deepCopyHostent(h, he, (char*)buffer, size, err); -#endif - return he; -} - -#if defined(HAVE_GETSERVBYNAME) -static struct servent * deepCopyServent(struct servent *s, - const struct servent *se, - char *buffer, int size) -{ - /* copy plain old structure */ - memcpy(s, se, sizeof(struct servent)); - - /* copy name */ - int len = strlen(s->s_name); - if (len >= size) - { - return NULL; - } - memcpy(buffer, s->s_name, len); - buffer[len] = '\0'; - s->s_name = buffer; - - /* track position in the buffer */ - int pos = len + 1; - - /* copy protocol */ - len = strlen(s->s_proto); - if (pos + len >= size) - { - return NULL; - } - memcpy(buffer + pos, s->s_proto, len); - buffer[pos + len] = '\0'; - s->s_proto = buffer + pos; - - /* track position in the buffer */ - pos += len + 1; - - /* ensure pointer alignment */ - unsigned int misalign = sizeof(char *) - pos%sizeof(char *); - if(misalign < sizeof(char *)) - pos += misalign; - - /* leave space for pointer list */ - char **p = s->s_aliases, **q; - char **s_aliases = (char **)(buffer + pos); - while(*(p++) != 0) - pos += sizeof(char *); - - /* copy addresses and fill new pointer list */ - for (p = s->s_aliases, q = s_aliases; *p != 0; p++, q++){ - len = strlen(*p); - if (size <= pos + len) - { - return NULL; - } - memcpy(buffer + pos, *p, len); /* copy content */ - buffer[pos + len] = '\0'; - *q = buffer + pos; /* set copied pointer to copied content */ - pos += len + 1; - } - *++q = 0; /* null terminate the pointer list */ - s->s_aliases = s_aliases; /* copy pointer to pointers */ - return s; -} -#endif - -#if defined(HAVE_GETSERVBYNAME) && wxUSE_THREADS -static wxMutex servLock; -#endif -struct servent *wxGetservbyname_r(const char *port, const char *protocol, - struct servent *serv, void *buffer, int size) -{ - struct servent *se = NULL; -#if defined(HAVE_FUNC_GETSERVBYNAME_R_6) - if (getservbyname_r(port, protocol, serv, (char*)buffer, size, &se)) - se = NULL; -#elif defined(HAVE_FUNC_GETSERVBYNAME_R_5) - se = getservbyname_r(port, protocol, serv, (char*)buffer, size); -#elif defined(HAVE_FUNC_GETSERVBYNAME_R_4) - if (getservbyname_r(port, protocol, serv, (struct servent_data*) buffer)) - se = NULL; - else - se = serv; -#elif defined(HAVE_GETSERVBYNAME) -#if wxUSE_THREADS - wxMutexLocker locker(servLock); -#endif - se = getservbyname(port, protocol); - if (se) - se = deepCopyServent(serv, se, (char*)buffer, size); -#endif - return se; -} - -/* debugging helpers */ -#ifdef __GSOCKET_DEBUG__ -# define GSocket_Debug(args) printf args -#else -# define GSocket_Debug(args) -#endif /* __GSOCKET_DEBUG__ */ - -/* Table of GUI-related functions. We must call them indirectly because - * of wxBase and GUI separation: */ - -static GSocketGUIFunctionsTable *gs_gui_functions; - -class GSocketGUIFunctionsTableNull: public GSocketGUIFunctionsTable -{ -public: - virtual bool OnInit(); - virtual void OnExit(); - virtual bool CanUseEventLoop(); - virtual bool Init_Socket(GSocket *socket); - virtual void Destroy_Socket(GSocket *socket); - virtual void Install_Callback(GSocket *socket, GSocketEvent event); - virtual void Uninstall_Callback(GSocket *socket, GSocketEvent event); - virtual void Enable_Events(GSocket *socket); - virtual void Disable_Events(GSocket *socket); -}; - -bool GSocketGUIFunctionsTableNull::OnInit() -{ return true; } -void GSocketGUIFunctionsTableNull::OnExit() -{} -bool GSocketGUIFunctionsTableNull::CanUseEventLoop() -{ return false; } -bool GSocketGUIFunctionsTableNull::Init_Socket(GSocket *WXUNUSED(socket)) -{ return true; } -void GSocketGUIFunctionsTableNull::Destroy_Socket(GSocket *WXUNUSED(socket)) -{} -void GSocketGUIFunctionsTableNull::Install_Callback(GSocket *WXUNUSED(socket), GSocketEvent WXUNUSED(event)) -{} -void GSocketGUIFunctionsTableNull::Uninstall_Callback(GSocket *WXUNUSED(socket), GSocketEvent WXUNUSED(event)) -{} -void GSocketGUIFunctionsTableNull::Enable_Events(GSocket *WXUNUSED(socket)) -{} -void GSocketGUIFunctionsTableNull::Disable_Events(GSocket *WXUNUSED(socket)) -{} -/* Global initialisers */ - -void GSocket_SetGUIFunctions(GSocketGUIFunctionsTable *guifunc) -{ - gs_gui_functions = guifunc; -} - -int GSocket_Init(void) -{ - if (!gs_gui_functions) - { - static GSocketGUIFunctionsTableNull table; - gs_gui_functions = &table; - } - if ( !gs_gui_functions->OnInit() ) - return 0; - return 1; -} - -void GSocket_Cleanup(void) -{ - if (gs_gui_functions) - { - gs_gui_functions->OnExit(); - } -} - -/* Constructors / Destructors for GSocket */ - -GSocket::GSocket() -{ - int i; - - m_fd = INVALID_SOCKET; - for (i=0;iInit_Socket(this); -} - -void GSocket::Close() -{ - gs_gui_functions->Disable_Events(this); - - /* When running on OS X, the gsockosx implementation of GSocketGUIFunctionsTable - will close the socket during Disable_Events. However, it will only do this - if it is being used. That is, it won't do it in a console program. To - ensure we get the right behavior, we have gsockosx set m_fd = INVALID_SOCKET - if it has closed the socket which indicates to us (at runtime, instead of - at compile time as this had been before) that the socket has already - been closed. - */ - if(m_fd != INVALID_SOCKET) - close(m_fd); - m_fd = INVALID_SOCKET; -} - -GSocket::~GSocket() -{ - assert(this); - - /* Check that the socket is really shutdowned */ - if (m_fd != INVALID_SOCKET) - Shutdown(); - - /* Per-socket GUI-specific cleanup */ - gs_gui_functions->Destroy_Socket(this); - - /* Destroy private addresses */ - if (m_local) - GAddress_destroy(m_local); - - if (m_peer) - GAddress_destroy(m_peer); -} - -/* GSocket_Shutdown: - * Disallow further read/write operations on this socket, close - * the fd and disable all callbacks. - */ -void GSocket::Shutdown() -{ - int evt; - - assert(this); - - /* Don't allow events to fire after socket has been closed */ - gs_gui_functions->Disable_Events(this); - - /* If socket has been created, shutdown it */ - if (m_fd != INVALID_SOCKET) - { - shutdown(m_fd, 1); - Close(); - } - - /* Disable GUI callbacks */ - for (evt = 0; evt < GSOCK_MAX_EVENT; evt++) - m_cbacks[evt] = NULL; - - m_detected = GSOCK_LOST_FLAG; -} - -/* 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(GAddress *address) -{ - assert(this); - - /* the socket must be initialized, or it must be a server */ - if ((m_fd != INVALID_SOCKET && !m_server)) - { - m_error = GSOCK_INVSOCK; - return GSOCK_INVSOCK; - } - - /* check address */ - if (address == NULL || address->m_family == GSOCK_NOFAMILY) - { - m_error = GSOCK_INVADDR; - return GSOCK_INVADDR; - } - - if (m_local) - GAddress_destroy(m_local); - - m_local = GAddress_copy(address); - - return GSOCK_NOERROR; -} - -GSocketError GSocket::SetPeer(GAddress *address) -{ - assert(this); - - /* check address */ - if (address == NULL || address->m_family == GSOCK_NOFAMILY) - { - m_error = GSOCK_INVADDR; - return GSOCK_INVADDR; - } - - if (m_peer) - GAddress_destroy(m_peer); - - m_peer = GAddress_copy(address); - - return GSOCK_NOERROR; -} - -GAddress *GSocket::GetLocal() -{ - GAddress *address; - struct sockaddr addr; - WX_SOCKLEN_T size = sizeof(addr); - GSocketError err; - - assert(this); - - /* try to get it from the m_local var first */ - if (m_local) - return GAddress_copy(m_local); - - /* else, if the socket is initialized, try getsockname */ - if (m_fd == INVALID_SOCKET) - { - m_error = GSOCK_INVSOCK; - return NULL; - } - - if (getsockname(m_fd, &addr, (WX_SOCKLEN_T *) &size) < 0) - { - m_error = GSOCK_IOERR; - return NULL; - } - - /* got a valid address from getsockname, create a GAddress object */ - address = GAddress_new(); - if (address == NULL) - { - m_error = GSOCK_MEMERR; - return NULL; - } - - err = _GAddress_translate_from(address, &addr, size); - if (err != GSOCK_NOERROR) - { - GAddress_destroy(address); - m_error = err; - return NULL; - } - - return address; -} - -GAddress *GSocket::GetPeer() -{ - assert(this); - - /* try to get it from the m_peer var */ - if (m_peer) - return GAddress_copy(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() -{ - int arg = 1; - - assert(this); - - /* must not be in use */ - if (m_fd != INVALID_SOCKET) - { - m_error = GSOCK_INVSOCK; - return GSOCK_INVSOCK; - } - - /* the local addr must have been set */ - if (!m_local) - { - m_error = GSOCK_INVADDR; - return GSOCK_INVADDR; - } - - /* Initialize all fields */ - m_stream = true; - m_server = true; - - /* Create the socket */ - m_fd = socket(m_local->m_realfamily, SOCK_STREAM, 0); - - if (m_fd == INVALID_SOCKET) - { - m_error = GSOCK_IOERR; - return GSOCK_IOERR; - } - - /* FreeBSD variants can't use MSG_NOSIGNAL, and instead use a socket option */ -#ifdef SO_NOSIGPIPE - setsockopt(m_fd, SOL_SOCKET, SO_NOSIGPIPE, (const char*)&arg, sizeof(arg)); -#endif - - ioctl(m_fd, FIONBIO, &arg); - gs_gui_functions->Enable_Events(this); - - /* allow a socket to re-bind if the socket is in the TIME_WAIT - state after being previously closed. - */ - if (m_reusable) - { - setsockopt(m_fd, SOL_SOCKET, SO_REUSEADDR, (const char*)&arg, sizeof(arg)); -#ifdef SO_REUSEPORT - setsockopt(m_fd, SOL_SOCKET, SO_REUSEPORT, (const char*)&arg, sizeof(arg)); -#endif - } - - /* Bind to the local address, - * retrieve the actual address bound, - * and listen up to 5 connections. - */ - if ((bind(m_fd, m_local->m_addr, m_local->m_len) != 0) || - (getsockname(m_fd, - m_local->m_addr, - (WX_SOCKLEN_T *) &m_local->m_len) != 0) || - (listen(m_fd, 5) != 0)) - { - Close(); - m_error = GSOCK_IOERR; - return GSOCK_IOERR; - } - - 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() -{ - struct sockaddr from; - WX_SOCKLEN_T fromlen = sizeof(from); - GSocket *connection; - GSocketError err; - int arg = 1; - - assert(this); - - /* If the socket has already been created, we exit immediately */ - if (m_fd == INVALID_SOCKET || !m_server) - { - m_error = GSOCK_INVSOCK; - return NULL; - } - - /* Create a GSocket object for the new connection */ - connection = GSocket_new(); - - if (!connection) - { - m_error = GSOCK_MEMERR; - return NULL; - } - - /* Wait for a connection (with timeout) */ - if (Input_Timeout() == GSOCK_TIMEDOUT) - { - delete connection; - /* m_error set by _GSocket_Input_Timeout */ - return NULL; - } - - connection->m_fd = accept(m_fd, &from, (WX_SOCKLEN_T *) &fromlen); - - /* Reenable CONNECTION events */ - Enable(GSOCK_CONNECTION); - - if (connection->m_fd == INVALID_SOCKET) - { - if (errno == EWOULDBLOCK) - m_error = GSOCK_WOULDBLOCK; - else - m_error = GSOCK_IOERR; - - delete connection; - return NULL; - } - - /* Initialize all fields */ - connection->m_server = false; - connection->m_stream = true; - - /* Setup the peer address field */ - connection->m_peer = GAddress_new(); - if (!connection->m_peer) - { - delete connection; - m_error = GSOCK_MEMERR; - return NULL; - } - - err = _GAddress_translate_from(connection->m_peer, &from, fromlen); - if (err != GSOCK_NOERROR) - { - delete connection; - m_error = err; - return NULL; - } - -#if defined(__EMX__) || defined(__VISAGECPP__) - ioctl(connection->m_fd, FIONBIO, (char*)&arg, sizeof(arg)); -#else - ioctl(connection->m_fd, FIONBIO, &arg); -#endif - gs_gui_functions->Enable_Events(connection); - - return connection; -} - -bool GSocket::SetReusable() -{ - /* socket must not be null, and must not be in use/already bound */ - if (this && m_fd == INVALID_SOCKET) - { - m_reusable = true; - - return true; - } - - return false; -} - -/* 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 successfully 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(GSocketStream stream) -{ - int err, ret; - int arg = 1; - - assert(this); - - /* Enable CONNECTION events (needed for nonblocking connections) */ - Enable(GSOCK_CONNECTION); - - if (m_fd != INVALID_SOCKET) - { - m_error = GSOCK_INVSOCK; - return GSOCK_INVSOCK; - } - - if (!m_peer) - { - m_error = GSOCK_INVADDR; - return GSOCK_INVADDR; - } - - /* Streamed or dgram socket? */ - m_stream = (stream == GSOCK_STREAMED); - m_server = false; - m_establishing = false; - - /* Create the socket */ - m_fd = socket(m_peer->m_realfamily, - m_stream? SOCK_STREAM : SOCK_DGRAM, 0); - - if (m_fd == INVALID_SOCKET) - { - m_error = GSOCK_IOERR; - return GSOCK_IOERR; - } - - /* FreeBSD variants can't use MSG_NOSIGNAL, and instead use a socket option */ -#ifdef SO_NOSIGPIPE - setsockopt(m_fd, SOL_SOCKET, SO_NOSIGPIPE, (const char*)&arg, sizeof(arg)); -#endif - -#if defined(__EMX__) || defined(__VISAGECPP__) - ioctl(m_fd, FIONBIO, (char*)&arg, sizeof(arg)); -#else - ioctl(m_fd, FIONBIO, &arg); -#endif - - // If the reuse flag is set, use the applicable socket reuse flags(s) - if (m_reusable) - { - setsockopt(m_fd, SOL_SOCKET, SO_REUSEADDR, (const char*)&arg, sizeof(arg)); -#ifdef SO_REUSEPORT - setsockopt(m_fd, SOL_SOCKET, SO_REUSEPORT, (const char*)&arg, sizeof(arg)); -#endif - } - - // If a local address has been set, then we need to bind to it before calling connect - if (m_local && m_local->m_addr) - { - if (bind(m_fd, m_local->m_addr, m_local->m_len) < 0) - { - Close(); - m_error = GSOCK_IOERR; - return GSOCK_IOERR; - } - } - - /* Connect it to the peer address, with a timeout (see below) */ - ret = connect(m_fd, m_peer->m_addr, m_peer->m_len); - - /* We only call Enable_Events if we know we aren't shutting down the socket. - * NB: Enable_Events needs to be called whether the socket is blocking or - * non-blocking, it just shouldn't be called prior to knowing there is a - * connection _if_ blocking sockets are being used. - * If connect above returns 0, we are already connected and need to make the - * call to Enable_Events now. - */ - - if (m_non_blocking || ret == 0) - gs_gui_functions->Enable_Events(this); - - if (ret == -1) - { - err = errno; - - /* 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 == EINPROGRESS) && (!m_non_blocking)) - { - if (Output_Timeout() == GSOCK_TIMEDOUT) - { - Close(); - /* m_error is set in _GSocket_Output_Timeout */ - return GSOCK_TIMEDOUT; - } - else - { - int error; - SOCKOPTLEN_T len = sizeof(error); - - getsockopt(m_fd, SOL_SOCKET, SO_ERROR, (char*) &error, &len); - - gs_gui_functions->Enable_Events(this); - - 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 == EINPROGRESS) && (m_non_blocking)) - { - m_establishing = true; - m_error = GSOCK_WOULDBLOCK; - return GSOCK_WOULDBLOCK; - } - - /* If connect failed with an error other than EINPROGRESS, - * then the call to GSocket_Connect has failed. - */ - Close(); - m_error = GSOCK_IOERR; - - return GSOCK_IOERR; - } - - return GSOCK_NOERROR; -} - -/* 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() -{ - int arg = 1; - - assert(this); - - if (m_fd != INVALID_SOCKET) - { - m_error = GSOCK_INVSOCK; - return GSOCK_INVSOCK; - } - - if (!m_local) - { - m_error = GSOCK_INVADDR; - return GSOCK_INVADDR; - } - - /* Initialize all fields */ - m_stream = false; - m_server = false; - - /* Create the socket */ - m_fd = socket(m_local->m_realfamily, SOCK_DGRAM, 0); - - if (m_fd == INVALID_SOCKET) - { - m_error = GSOCK_IOERR; - return GSOCK_IOERR; - } -#if defined(__EMX__) || defined(__VISAGECPP__) - ioctl(m_fd, FIONBIO, (char*)&arg, sizeof(arg)); -#else - ioctl(m_fd, FIONBIO, &arg); -#endif - gs_gui_functions->Enable_Events(this); - - if (m_reusable) - { - setsockopt(m_fd, SOL_SOCKET, SO_REUSEADDR, (const char*)&arg, sizeof(arg)); -#ifdef SO_REUSEPORT - setsockopt(m_fd, SOL_SOCKET, SO_REUSEPORT, (const char*)&arg, sizeof(arg)); -#endif - } - - /* Bind to the local address, - * and retrieve the actual address bound. - */ - if ((bind(m_fd, m_local->m_addr, m_local->m_len) != 0) || - (getsockname(m_fd, - m_local->m_addr, - (WX_SOCKLEN_T *) &m_local->m_len) != 0)) - { - Close(); - m_error = GSOCK_IOERR; - return GSOCK_IOERR; - } - - return GSOCK_NOERROR; -} - -/* Generic IO */ - -/* Like recv(), send(), ... */ -int GSocket::Read(char *buffer, int size) -{ - int ret; - - assert(this); - - if (m_fd == INVALID_SOCKET || m_server) - { - m_error = GSOCK_INVSOCK; - return -1; - } - - /* Disable events during query of socket status */ - Disable(GSOCK_INPUT); - - /* If the socket is blocking, wait for data (with a timeout) */ - if (Input_Timeout() == GSOCK_TIMEDOUT) { - m_error = GSOCK_TIMEDOUT; - /* Don't return here immediately, otherwise socket events would not be - * re-enabled! */ - ret = -1; - } - else - { - /* Read the data */ - if (m_stream) - ret = Recv_Stream(buffer, size); - else - ret = Recv_Dgram(buffer, size); - - /* - * If recv returned zero for a TCP socket (if m_stream == NULL, it's an UDP - * socket and empty datagrams are possible), then the connection has been - * gracefully closed. - * - * Otherwise, recv has returned an error (-1), in which case we have lost - * the socket only if errno does _not_ indicate that there may be more data - * to read. - */ - if ((ret == 0) && m_stream) - { - /* Make sure wxSOCKET_LOST event gets sent and shut down the socket */ - m_detected = GSOCK_LOST_FLAG; - Detected_Read(); - return 0; - } - else if (ret == -1) - { - if ((errno == EWOULDBLOCK) || (errno == EAGAIN)) - m_error = GSOCK_WOULDBLOCK; - else - m_error = GSOCK_IOERR; - } - } - - /* Enable events again now that we are done processing */ - Enable(GSOCK_INPUT); - - return ret; -} - -int GSocket::Write(const char *buffer, int size) -{ - int ret; - - assert(this); - - GSocket_Debug(( "GSocket_Write #1, size %d\n", size )); - - if (m_fd == INVALID_SOCKET || m_server) - { - m_error = GSOCK_INVSOCK; - return -1; - } - - GSocket_Debug(( "GSocket_Write #2, size %d\n", size )); - - /* If the socket is blocking, wait for writability (with a timeout) */ - if (Output_Timeout() == GSOCK_TIMEDOUT) - return -1; - - GSocket_Debug(( "GSocket_Write #3, size %d\n", size )); - - /* Write the data */ - if (m_stream) - ret = Send_Stream(buffer, size); - else - ret = Send_Dgram(buffer, size); - - GSocket_Debug(( "GSocket_Write #4, size %d\n", size )); - - if (ret == -1) - { - if ((errno == EWOULDBLOCK) || (errno == EAGAIN)) - { - m_error = GSOCK_WOULDBLOCK; - GSocket_Debug(( "GSocket_Write error WOULDBLOCK\n" )); - } - else - { - m_error = GSOCK_IOERR; - GSocket_Debug(( "GSocket_Write error IOERR\n" )); - } - - /* 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. - */ - Enable(GSOCK_OUTPUT); - - return -1; - } - - GSocket_Debug(( "GSocket_Write #5, size %d ret %d\n", size, ret )); - - 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(GSocketEventFlags flags) -{ - if (!gs_gui_functions->CanUseEventLoop()) - { - - GSocketEventFlags result = 0; - fd_set readfds; - fd_set writefds; - fd_set exceptfds; - struct timeval tv; - - assert(this); - - if (m_fd == -1) - return (GSOCK_LOST_FLAG & flags); - - /* Do not use a static struct, Linux can garble it */ - tv.tv_sec = m_timeout / 1000; - tv.tv_usec = (m_timeout % 1000) * 1000; - - wxFD_ZERO(&readfds); - wxFD_ZERO(&writefds); - wxFD_ZERO(&exceptfds); - wxFD_SET(m_fd, &readfds); - if (flags & GSOCK_OUTPUT_FLAG || flags & GSOCK_CONNECTION_FLAG) - wxFD_SET(m_fd, &writefds); - wxFD_SET(m_fd, &exceptfds); - - /* Check 'sticky' CONNECTION flag first */ - result |= (GSOCK_CONNECTION_FLAG & m_detected); - - /* If we have already detected a LOST event, then don't try - * to do any further processing. - */ - if ((m_detected & GSOCK_LOST_FLAG) != 0) - { - m_establishing = false; - - return (GSOCK_LOST_FLAG & flags); - } - - /* Try select now */ - if (select(m_fd + 1, &readfds, &writefds, &exceptfds, &tv) <= 0) - { - /* What to do here? */ - return (result & flags); - } - - /* Check for exceptions and errors */ - if (wxFD_ISSET(m_fd, &exceptfds)) - { - m_establishing = false; - m_detected = GSOCK_LOST_FLAG; - - /* LOST event: Abort any further processing */ - return (GSOCK_LOST_FLAG & flags); - } - - /* Check for readability */ - if (wxFD_ISSET(m_fd, &readfds)) - { - result |= GSOCK_INPUT_FLAG; - - if (m_server && m_stream) - { - /* This is a TCP server socket that detected a connection. - While the INPUT_FLAG is also set, it doesn't matter on - this kind of sockets, as we can only Accept() from them. */ - result |= GSOCK_CONNECTION_FLAG; - m_detected |= GSOCK_CONNECTION_FLAG; - } - } - - /* Check for writability */ - if (wxFD_ISSET(m_fd, &writefds)) - { - if (m_establishing && !m_server) - { - int error; - SOCKOPTLEN_T len = sizeof(error); - - m_establishing = false; - - getsockopt(m_fd, SOL_SOCKET, SO_ERROR, (char*)&error, &len); - - if (error) - { - m_detected = GSOCK_LOST_FLAG; - - /* LOST event: Abort any further processing */ - return (GSOCK_LOST_FLAG & flags); - } - else - { - result |= GSOCK_CONNECTION_FLAG; - m_detected |= GSOCK_CONNECTION_FLAG; - } - } - else - { - result |= GSOCK_OUTPUT_FLAG; - } - } - - return (result & flags); - - } - else - { - assert(this); - return flags & m_detected; - } -} - -/* Flags */ - -/* GSocket_SetNonBlocking: - * Sets the socket to non-blocking mode. All IO calls will return - * immediately. - */ -void GSocket::SetNonBlocking(bool non_block) -{ - assert(this); - - GSocket_Debug( ("GSocket_SetNonBlocking: %d\n", (int)non_block) ); - - m_non_blocking = non_block; -} - -/* GSocket_SetTimeout: - * Sets the timeout for blocking calls. Time is expressed in - * milliseconds. - */ -void GSocket::SetTimeout(unsigned long millisec) -{ - assert(this); - - m_timeout = millisec; -} - -/* GSocket_GetError: - * Returns the last error occurred for this socket. Note that successful - * operations do not clear this back to GSOCK_NOERROR, so use it only - * after an error. - */ -GSocketError WXDLLIMPEXP_NET GSocket::GetError() -{ - assert(this); - - return 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 successfully 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(GSocketEventFlags flags, - GSocketCallback callback, char *cdata) -{ - int count; - - assert(this); - - for (count = 0; count < GSOCK_MAX_EVENT; count++) - { - if ((flags & (1 << count)) != 0) - { - m_cbacks[count] = callback; - 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(GSocketEventFlags flags) -{ - int count; - - assert(this); - - for (count = 0; count < GSOCK_MAX_EVENT; count++) - { - if ((flags & (1 << count)) != 0) - { - m_cbacks[count] = NULL; - m_data[count] = NULL; - } - } -} - -GSocketError GSocket::GetSockOpt(int level, int optname, - void *optval, int *optlen) -{ - if (getsockopt(m_fd, level, optname, (char*)optval, (SOCKOPTLEN_T*)optlen) == 0) - return GSOCK_NOERROR; - - return GSOCK_OPTERR; -} - -GSocketError GSocket::SetSockOpt(int level, int optname, - const void *optval, int optlen) -{ - if (setsockopt(m_fd, level, optname, (const char*)optval, optlen) == 0) - return GSOCK_NOERROR; - - return GSOCK_OPTERR; -} - -#define CALL_CALLBACK(socket, event) { \ - socket->Disable(event); \ - if (socket->m_cbacks[event]) \ - socket->m_cbacks[event](socket, event, socket->m_data[event]); \ -} - - -void GSocket::Enable(GSocketEvent event) -{ - m_detected &= ~(1 << event); - gs_gui_functions->Install_Callback(this, event); -} - -void GSocket::Disable(GSocketEvent event) -{ - m_detected |= (1 << event); - gs_gui_functions->Uninstall_Callback(this, event); -} - -/* _GSocket_Input_Timeout: - * For blocking sockets, wait until data is available or - * until timeout ellapses. - */ -GSocketError GSocket::Input_Timeout() -{ -#ifdef __WXMAC__ - // This seems to happen under OS X sometimes, see #8904. - if ( m_fd == INVALID_SOCKET ) - { - m_error = GSOCK_TIMEDOUT; - return GSOCK_TIMEDOUT; - } -#endif // __WXMAC__ - - struct timeval tv; - fd_set readfds; - int ret; - - /* Linux select() will overwrite the struct on return */ - tv.tv_sec = (m_timeout / 1000); - tv.tv_usec = (m_timeout % 1000) * 1000; - - if (!m_non_blocking) - { - wxFD_ZERO(&readfds); - wxFD_SET(m_fd, &readfds); - ret = select(m_fd + 1, &readfds, NULL, NULL, &tv); - if (ret == 0) - { - GSocket_Debug(( "GSocket_Input_Timeout, select returned 0\n" )); - m_error = GSOCK_TIMEDOUT; - return GSOCK_TIMEDOUT; - } - - if (ret == -1) - { - GSocket_Debug(( "GSocket_Input_Timeout, select returned -1\n" )); - if (errno == EBADF) { GSocket_Debug(( "Invalid file descriptor\n" )); } - if (errno == EINTR) { GSocket_Debug(( "A non blocked signal was caught\n" )); } - if (errno == EINVAL) { GSocket_Debug(( "The highest number descriptor is negative\n" )); } - if (errno == ENOMEM) { GSocket_Debug(( "Not enough memory\n" )); } - 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() -{ - struct timeval tv; - fd_set writefds; - int ret; - - /* Linux select() will overwrite the struct on return */ - tv.tv_sec = (m_timeout / 1000); - tv.tv_usec = (m_timeout % 1000) * 1000; - - GSocket_Debug( ("m_non_blocking has: %d\n", (int)m_non_blocking) ); - - if (!m_non_blocking) - { - wxFD_ZERO(&writefds); - wxFD_SET(m_fd, &writefds); - ret = select(m_fd + 1, NULL, &writefds, NULL, &tv); - if (ret == 0) - { - GSocket_Debug(( "GSocket_Output_Timeout, select returned 0\n" )); - m_error = GSOCK_TIMEDOUT; - return GSOCK_TIMEDOUT; - } - - if (ret == -1) - { - GSocket_Debug(( "GSocket_Output_Timeout, select returned -1\n" )); - if (errno == EBADF) { GSocket_Debug(( "Invalid file descriptor\n" )); } - if (errno == EINTR) { GSocket_Debug(( "A non blocked signal was caught\n" )); } - if (errno == EINVAL) { GSocket_Debug(( "The highest number descriptor is negative\n" )); } - if (errno == ENOMEM) { GSocket_Debug(( "Not enough memory\n" )); } - m_error = GSOCK_TIMEDOUT; - return GSOCK_TIMEDOUT; - } - - if ( ! wxFD_ISSET(m_fd, &writefds) ) - { - GSocket_Debug(( "GSocket_Output_Timeout is buggy!\n" )); - } - else - { - GSocket_Debug(( "GSocket_Output_Timeout seems correct\n" )); - } - } - else - { - GSocket_Debug(( "GSocket_Output_Timeout, didn't try select!\n" )); - } - - return GSOCK_NOERROR; -} - -int GSocket::Recv_Stream(char *buffer, int size) -{ - int ret; - do - { - ret = recv(m_fd, buffer, size, GSOCKET_MSG_NOSIGNAL); - } - while (ret == -1 && errno == EINTR); /* Loop until not interrupted */ - - return ret; -} - -int GSocket::Recv_Dgram(char *buffer, int size) -{ - struct sockaddr from; - WX_SOCKLEN_T fromlen = sizeof(from); - int ret; - GSocketError err; - - fromlen = sizeof(from); - - do - { - ret = recvfrom(m_fd, buffer, size, 0, &from, (WX_SOCKLEN_T *) &fromlen); - } - while (ret == -1 && errno == EINTR); /* Loop until not interrupted */ - - if (ret == -1) - return -1; - - /* Translate a system address into a GSocket address */ - if (!m_peer) - { - m_peer = GAddress_new(); - if (!m_peer) - { - m_error = GSOCK_MEMERR; - return -1; - } - } - - err = _GAddress_translate_from(m_peer, &from, fromlen); - if (err != GSOCK_NOERROR) - { - GAddress_destroy(m_peer); - m_peer = NULL; - m_error = err; - return -1; - } - - return ret; -} - -int GSocket::Send_Stream(const char *buffer, int size) -{ - int ret; - - MASK_SIGNAL(); - - do - { - ret = send(m_fd, (char *)buffer, size, GSOCKET_MSG_NOSIGNAL); - } - while (ret == -1 && errno == EINTR); /* Loop until not interrupted */ - - UNMASK_SIGNAL(); - - return ret; -} - -int GSocket::Send_Dgram(const char *buffer, int size) -{ - struct sockaddr *addr; - int len, ret; - GSocketError err; - - if (!m_peer) - { - m_error = GSOCK_INVADDR; - return -1; - } - - err = _GAddress_translate_to(m_peer, &addr, &len); - if (err != GSOCK_NOERROR) - { - m_error = err; - return -1; - } - - MASK_SIGNAL(); - - do - { - ret = sendto(m_fd, (char *)buffer, size, 0, addr, len); - } - while (ret == -1 && errno == EINTR); /* Loop until not interrupted */ - - UNMASK_SIGNAL(); - - /* Frees memory allocated from _GAddress_translate_to */ - free(addr); - - return ret; -} - -void GSocket::Detected_Read() -{ - char c; - - /* Safeguard against straggling call to Detected_Read */ - if (m_fd == INVALID_SOCKET) - { - return; - } - - /* If we have already detected a LOST event, then don't try - * to do any further processing. - */ - if ((m_detected & GSOCK_LOST_FLAG) != 0) - { - m_establishing = false; - - CALL_CALLBACK(this, GSOCK_LOST); - Shutdown(); - return; - } - - int num = recv(m_fd, &c, 1, MSG_PEEK | GSOCKET_MSG_NOSIGNAL); - - if (num > 0) - { - CALL_CALLBACK(this, GSOCK_INPUT); - } - else - { - if (m_server && m_stream) - { - CALL_CALLBACK(this, GSOCK_CONNECTION); - } - else if (num == 0) - { - if (m_stream) - { - /* graceful shutdown */ - CALL_CALLBACK(this, GSOCK_LOST); - Shutdown(); - } - else - { - /* Empty datagram received */ - CALL_CALLBACK(this, GSOCK_INPUT); - } - } - else - { - /* Do not throw a lost event in cases where the socket isn't really lost */ - if ((errno == EWOULDBLOCK) || (errno == EAGAIN) || (errno == EINTR)) - { - CALL_CALLBACK(this, GSOCK_INPUT); - } - else - { - CALL_CALLBACK(this, GSOCK_LOST); - Shutdown(); - } - } - } -} - -void GSocket::Detected_Write() -{ - /* If we have already detected a LOST event, then don't try - * to do any further processing. - */ - if ((m_detected & GSOCK_LOST_FLAG) != 0) - { - m_establishing = false; - - CALL_CALLBACK(this, GSOCK_LOST); - Shutdown(); - return; - } - - if (m_establishing && !m_server) - { - int error; - SOCKOPTLEN_T len = sizeof(error); - - m_establishing = false; - - getsockopt(m_fd, SOL_SOCKET, SO_ERROR, (char*)&error, &len); - - if (error) - { - CALL_CALLBACK(this, GSOCK_LOST); - Shutdown(); - } - else - { - CALL_CALLBACK(this, GSOCK_CONNECTION); - /* We have to fire this event by hand because CONNECTION (for clients) - * and OUTPUT are internally the same and we just disabled CONNECTION - * events with the above macro. - */ - CALL_CALLBACK(this, GSOCK_OUTPUT); - } - } - else - { - CALL_CALLBACK(this, GSOCK_OUTPUT); - } -} - -/* Compatibility functions for GSocket */ -GSocket *GSocket_new(void) -{ - GSocket *newsocket = new GSocket(); - if (newsocket->IsOk()) - return newsocket; - - delete newsocket; - - return NULL; -} - -/* - * ------------------------------------------------------------------------- - * GAddress - * ------------------------------------------------------------------------- - */ - -/* CHECK_ADDRESS verifies that the current address family is either - * GSOCK_NOFAMILY or GSOCK_*family*, and if it is GSOCK_NOFAMILY, it - * initalizes it to be a GSOCK_*family*. In other cases, it returns - * an appropiate error code. - * - * CHECK_ADDRESS_RETVAL does the same but returning 'retval' on error. - */ -#define CHECK_ADDRESS(address, family) \ -{ \ - 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 GSOCK_INVADDR; \ - } \ -} - -#define CHECK_ADDRESS_RETVAL(address, family, retval) \ -{ \ - if (address->m_family == GSOCK_NOFAMILY) \ - if (_GAddress_Init_##family(address) != GSOCK_NOERROR) \ - return retval; \ - if (address->m_family != GSOCK_##family) \ - { \ - address->m_error = GSOCK_INVADDR; \ - return retval; \ - } \ -} - - -GAddress *GAddress_new(void) -{ - GAddress *address; - - if ((address = (GAddress *) malloc(sizeof(GAddress))) == NULL) - return NULL; - - address->m_family = GSOCK_NOFAMILY; - address->m_addr = NULL; - address->m_len = 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)); - - if (address->m_addr && address->m_len > 0) - { - addr2->m_addr = (struct sockaddr *)malloc(addr2->m_len); - if (addr2->m_addr == NULL) - { - free(addr2); - return NULL; - } - memcpy(addr2->m_addr, address->m_addr, addr2->m_len); - } - - return addr2; -} - -void GAddress_destroy(GAddress *address) -{ - assert(address != NULL); - - if (address->m_addr) - free(address->m_addr); - - 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, - struct sockaddr *addr, int len) -{ - address->m_realfamily = addr->sa_family; - switch (addr->sa_family) - { - case AF_INET: - address->m_family = GSOCK_INET; - break; - case AF_UNIX: - address->m_family = GSOCK_UNIX; - break; -#ifdef AF_INET6 - case AF_INET6: - address->m_family = GSOCK_INET6; - break; -#endif - default: - { - address->m_error = GSOCK_INVOP; - return GSOCK_INVOP; - } - } - - if (address->m_addr) - free(address->m_addr); - - address->m_len = len; - address->m_addr = (struct sockaddr *)malloc(len); - - if (address->m_addr == NULL) - { - address->m_error = GSOCK_MEMERR; - return GSOCK_MEMERR; - } - - memcpy(address->m_addr, addr, len); - - return GSOCK_NOERROR; -} - -GSocketError _GAddress_translate_to(GAddress *address, - struct sockaddr **addr, int *len) -{ - if (!address->m_addr) - { - address->m_error = GSOCK_INVADDR; - return GSOCK_INVADDR; - } - - *len = address->m_len; - *addr = (struct sockaddr *)malloc(address->m_len); - if (*addr == NULL) - { - address->m_error = GSOCK_MEMERR; - return GSOCK_MEMERR; - } - - memcpy(*addr, address->m_addr, address->m_len); - return GSOCK_NOERROR; -} - -/* - * ------------------------------------------------------------------------- - * Internet address family - * ------------------------------------------------------------------------- - */ - -GSocketError _GAddress_Init_INET(GAddress *address) -{ - address->m_len = sizeof(struct sockaddr_in); - address->m_addr = (struct sockaddr *) malloc(address->m_len); - if (address->m_addr == NULL) - { - address->m_error = GSOCK_MEMERR; - return GSOCK_MEMERR; - } - - address->m_family = GSOCK_INET; - address->m_realfamily = PF_INET; - ((struct sockaddr_in *)address->m_addr)->sin_family = AF_INET; - ((struct sockaddr_in *)address->m_addr)->sin_addr.s_addr = INADDR_ANY; - - return GSOCK_NOERROR; -} - -GSocketError GAddress_INET_SetHostName(GAddress *address, const char *hostname) -{ - struct hostent *he; - struct in_addr *addr; - - assert(address != NULL); - - CHECK_ADDRESS(address, INET); - - addr = &(((struct sockaddr_in *)address->m_addr)->sin_addr); - - /* If it is a numeric host name, convert it now */ -#if defined(HAVE_INET_ATON) - if (inet_aton(hostname, addr) == 0) - { -#elif defined(HAVE_INET_ADDR) - if ( (addr->s_addr = inet_addr(hostname)) == (unsigned)-1 ) - { -#else - /* Use gethostbyname by default */ -#ifndef __WXMAC__ - int val = 1; /* VA doesn't like constants in conditional expressions */ - if (val) -#endif - { -#endif - struct in_addr *array_addr; - - /* It is a real name, we solve it */ - struct hostent h; -#if defined(HAVE_FUNC_GETHOSTBYNAME_R_3) - struct hostent_data buffer; - memset(&buffer, 0, sizeof(buffer)); -#else - char buffer[1024]; -#endif - int err; - he = wxGethostbyname_r(hostname, &h, (void*)&buffer, sizeof(buffer), &err); - if (he == NULL) - { - /* Reset to invalid address */ - addr->s_addr = INADDR_NONE; - address->m_error = GSOCK_NOHOST; - return GSOCK_NOHOST; - } - - array_addr = (struct in_addr *) *(he->h_addr_list); - addr->s_addr = array_addr[0].s_addr; - } - - 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) -{ - struct in_addr *addr; - - assert(address != NULL); - - CHECK_ADDRESS(address, INET); - - addr = &(((struct sockaddr_in *)address->m_addr)->sin_addr); - addr->s_addr = htonl(hostaddr); - - return GSOCK_NOERROR; -} - -GSocketError GAddress_INET_SetPortName(GAddress *address, const char *port, - const char *protocol) -{ - struct servent *se; - struct sockaddr_in *addr; - - assert(address != NULL); - CHECK_ADDRESS(address, INET); - - if (!port) - { - address->m_error = GSOCK_INVPORT; - return GSOCK_INVPORT; - } - -#if defined(HAVE_FUNC_GETSERVBYNAME_R_4) - struct servent_data buffer; - memset(&buffer, 0, sizeof(buffer)); -#else - char buffer[1024]; -#endif - struct servent serv; - se = wxGetservbyname_r(port, protocol, &serv, - (void*)&buffer, sizeof(buffer)); - if (!se) - { - /* the cast to int suppresses compiler warnings about subscript having the - type char */ - if (isdigit((int)port[0])) - { - int port_int; - - port_int = atoi(port); - addr = (struct sockaddr_in *)address->m_addr; - addr->sin_port = htons(port_int); - return GSOCK_NOERROR; - } - - address->m_error = GSOCK_INVPORT; - return GSOCK_INVPORT; - } - - addr = (struct sockaddr_in *)address->m_addr; - addr->sin_port = se->s_port; - - return GSOCK_NOERROR; -} - -GSocketError GAddress_INET_SetPort(GAddress *address, unsigned short port) -{ - struct sockaddr_in *addr; - - assert(address != NULL); - CHECK_ADDRESS(address, INET); - - addr = (struct sockaddr_in *)address->m_addr; - addr->sin_port = htons(port); - - return GSOCK_NOERROR; -} - -GSocketError GAddress_INET_GetHostName(GAddress *address, char *hostname, size_t sbuf) -{ - struct hostent *he; - char *addr_buf; - struct sockaddr_in *addr; - - assert(address != NULL); - CHECK_ADDRESS(address, INET); - - addr = (struct sockaddr_in *)address->m_addr; - addr_buf = (char *)&(addr->sin_addr); - - struct hostent temphost; -#if defined(HAVE_FUNC_GETHOSTBYNAME_R_3) - struct hostent_data buffer; - memset(&buffer, 0, sizeof(buffer)); -#else - char buffer[1024]; -#endif - int err; - he = wxGethostbyaddr_r(addr_buf, sizeof(addr->sin_addr), AF_INET, &temphost, - (void*)&buffer, sizeof(buffer), &err); - if (he == NULL) - { - address->m_error = GSOCK_NOHOST; - return GSOCK_NOHOST; - } - - strncpy(hostname, he->h_name, sbuf); - - return GSOCK_NOERROR; -} - -unsigned long GAddress_INET_GetHostAddress(GAddress *address) -{ - struct sockaddr_in *addr; - - assert(address != NULL); - CHECK_ADDRESS_RETVAL(address, INET, 0); - - addr = (struct sockaddr_in *)address->m_addr; - - return ntohl(addr->sin_addr.s_addr); -} - -unsigned short GAddress_INET_GetPort(GAddress *address) -{ - struct sockaddr_in *addr; - - assert(address != NULL); - CHECK_ADDRESS_RETVAL(address, INET, 0); - - addr = (struct sockaddr_in *)address->m_addr; - return ntohs(addr->sin_port); -} - -/* - * ------------------------------------------------------------------------- - * Unix address family - * ------------------------------------------------------------------------- - */ - -#ifndef __VISAGECPP__ -GSocketError _GAddress_Init_UNIX(GAddress *address) -{ - address->m_len = sizeof(struct sockaddr_un); - address->m_addr = (struct sockaddr *)malloc(address->m_len); - if (address->m_addr == NULL) - { - address->m_error = GSOCK_MEMERR; - return GSOCK_MEMERR; - } - - address->m_family = GSOCK_UNIX; - address->m_realfamily = PF_UNIX; - ((struct sockaddr_un *)address->m_addr)->sun_family = AF_UNIX; - ((struct sockaddr_un *)address->m_addr)->sun_path[0] = 0; - - return GSOCK_NOERROR; -} - -#define UNIX_SOCK_PATHLEN (sizeof(addr->sun_path)/sizeof(addr->sun_path[0])) - -GSocketError GAddress_UNIX_SetPath(GAddress *address, const char *path) -{ - struct sockaddr_un *addr; - - assert(address != NULL); - - CHECK_ADDRESS(address, UNIX); - - addr = ((struct sockaddr_un *)address->m_addr); - strncpy(addr->sun_path, path, UNIX_SOCK_PATHLEN); - addr->sun_path[UNIX_SOCK_PATHLEN - 1] = '\0'; - - return GSOCK_NOERROR; -} - -GSocketError GAddress_UNIX_GetPath(GAddress *address, char *path, size_t sbuf) -{ - struct sockaddr_un *addr; - - assert(address != NULL); - CHECK_ADDRESS(address, UNIX); - - addr = (struct sockaddr_un *)address->m_addr; - - strncpy(path, addr->sun_path, sbuf); - - return GSOCK_NOERROR; -} -#endif /* !defined(__VISAGECPP__) */ -#endif /* wxUSE_SOCKETS || defined(__GSOCKET_STANDALONE__) */ diff --git a/wxWidgets/src/unix/joystick.cpp b/wxWidgets/src/unix/joystick.cpp deleted file mode 100644 index 411f96a19a..0000000000 --- a/wxWidgets/src/unix/joystick.cpp +++ /dev/null @@ -1,496 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/unix/joystick.cpp -// Purpose: wxJoystick class -// Author: Ported to Linux by Guilhem Lavaux -// Modified by: -// Created: 05/23/98 -// RCS-ID: $Id: joystick.cpp 40530 2006-08-09 11:18:24Z MW $ -// Copyright: (c) Guilhem Lavaux -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// for compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#if wxUSE_JOYSTICK - -#include "wx/joystick.h" - -#ifndef WX_PRECOMP - #include "wx/event.h" - #include "wx/window.h" -#endif //WX_PRECOMP - -#include -#include -#include -#include -#include -#include -#include - -#ifdef HAVE_SYS_SELECT_H -# include -#endif - -#include "wx/unix/private.h" - -enum { - wxJS_AXIS_X = 0, - wxJS_AXIS_Y, - wxJS_AXIS_Z, - wxJS_AXIS_RUDDER, - wxJS_AXIS_U, - wxJS_AXIS_V, - - wxJS_AXIS_MAX = 32767, - wxJS_AXIS_MIN = -32767 -}; - - -IMPLEMENT_DYNAMIC_CLASS(wxJoystick, wxObject) - - -//////////////////////////////////////////////////////////////////////////// -// Background thread for reading the joystick device -//////////////////////////////////////////////////////////////////////////// - -class wxJoystickThread : public wxThread -{ -public: - wxJoystickThread(int device, int joystick); - void* Entry(); - -private: - int m_device; - int m_joystick; - wxPoint m_lastposition; - int m_axe[15]; - int m_buttons; - wxWindow* m_catchwin; - int m_polling; - - friend class wxJoystick; -}; - - -wxJoystickThread::wxJoystickThread(int device, int joystick) - : m_device(device), - m_joystick(joystick), - m_lastposition(wxDefaultPosition), - m_buttons(0), - m_catchwin(NULL), - m_polling(0) -{ - for (int i=0; i<15; i++) - m_axe[i] = 0; -} - - -void* wxJoystickThread::Entry() -{ - struct js_event j_evt; - fd_set read_fds; - struct timeval time_out = {0, 0}; - - wxFD_ZERO(&read_fds); - while (true) - { - if (TestDestroy()) - break; - - // We use select when either polling or 'blocking' as even in the - // blocking case we need to check TestDestroy periodically - if (m_polling) - time_out.tv_usec = m_polling * 1000; - else - time_out.tv_usec = 10 * 1000; // check at least every 10 msec in blocking case - - wxFD_SET(m_device, &read_fds); - select(m_device+1, &read_fds, NULL, NULL, &time_out); - if (wxFD_ISSET(m_device, &read_fds)) - { - memset(&j_evt, 0, sizeof(j_evt)); - read(m_device, &j_evt, sizeof(j_evt)); - - //printf("time: %d\t value: %d\t type: %d\t number: %d\n", - // j_evt.time, j_evt.value, j_evt.type, j_evt.number); - - wxJoystickEvent jwx_event; - - if (j_evt.type & JS_EVENT_AXIS) - { - m_axe[j_evt.number] = j_evt.value; - - switch (j_evt.number) - { - case wxJS_AXIS_X: - m_lastposition.x = j_evt.value; - jwx_event.SetEventType(wxEVT_JOY_MOVE); - break; - case wxJS_AXIS_Y: - m_lastposition.y = j_evt.value; - jwx_event.SetEventType(wxEVT_JOY_MOVE); - break; - case wxJS_AXIS_Z: - jwx_event.SetEventType(wxEVT_JOY_ZMOVE); - break; - default: - jwx_event.SetEventType(wxEVT_JOY_MOVE); - // TODO: There should be a way to indicate that the event - // is for some other axes. - break; - } - } - - if (j_evt.type & JS_EVENT_BUTTON) - { - if (j_evt.value) - { - m_buttons |= (1 << j_evt.number); - jwx_event.SetEventType(wxEVT_JOY_BUTTON_DOWN); - } - else - { - m_buttons &= ~(1 << j_evt.number); - jwx_event.SetEventType(wxEVT_JOY_BUTTON_UP); - } - - jwx_event.SetButtonChange(j_evt.number); - - jwx_event.SetTimestamp(j_evt.time); - jwx_event.SetJoystick(m_joystick); - jwx_event.SetButtonState(m_buttons); - jwx_event.SetPosition(m_lastposition); - jwx_event.SetZPosition(m_axe[3]); - jwx_event.SetEventObject(m_catchwin); - - if (m_catchwin) - m_catchwin->AddPendingEvent(jwx_event); - } - } - } - - close(m_device); - return NULL; -} - - -//////////////////////////////////////////////////////////////////////////// - -wxJoystick::wxJoystick(int joystick) - : m_device(-1), - m_joystick(joystick), - m_thread(NULL) -{ - wxString dev_name; - - // old /dev structure - dev_name.Printf( wxT("/dev/js%d"), joystick); - m_device = open(dev_name.fn_str(), O_RDONLY); - - // new /dev structure with "input" subdirectory - if (m_device == -1) - { - dev_name.Printf( wxT("/dev/input/js%d"), joystick); - m_device = open(dev_name.fn_str(), O_RDONLY); - } - - if (m_device != -1) - { - m_thread = new wxJoystickThread(m_device, m_joystick); - m_thread->Create(); - m_thread->Run(); - } -} - - -wxJoystick::~wxJoystick() -{ - ReleaseCapture(); - if (m_thread) - m_thread->Delete(); // It's detached so it will delete itself - m_device = -1; -} - - -//////////////////////////////////////////////////////////////////////////// -// State -//////////////////////////////////////////////////////////////////////////// - -wxPoint wxJoystick::GetPosition() const -{ - wxPoint pos(wxDefaultPosition); - if (m_thread) pos = m_thread->m_lastposition; - return pos; -} - -int wxJoystick::GetZPosition() const -{ - if (m_thread) - return m_thread->m_axe[wxJS_AXIS_Z]; - return 0; -} - -int wxJoystick::GetButtonState() const -{ - if (m_thread) - return m_thread->m_buttons; - return 0; -} - -int wxJoystick::GetPOVPosition() const -{ - return -1; -} - -int wxJoystick::GetPOVCTSPosition() const -{ - return -1; -} - -int wxJoystick::GetRudderPosition() const -{ - if (m_thread) - return m_thread->m_axe[wxJS_AXIS_RUDDER]; - return 0; -} - -int wxJoystick::GetUPosition() const -{ - if (m_thread) - return m_thread->m_axe[wxJS_AXIS_U]; - return 0; -} - -int wxJoystick::GetVPosition() const -{ - if (m_thread) - return m_thread->m_axe[wxJS_AXIS_V]; - return 0; -} - -int wxJoystick::GetMovementThreshold() const -{ - return 0; -} - -void wxJoystick::SetMovementThreshold(int threshold) -{ -} - -//////////////////////////////////////////////////////////////////////////// -// Capabilities -//////////////////////////////////////////////////////////////////////////// - -bool wxJoystick::IsOk() const -{ - return (m_device != -1); -} - -int wxJoystick::GetNumberJoysticks() -{ - wxString dev_name; - int fd, j; - - for (j=0; j<4; j++) { - dev_name.Printf(wxT("/dev/js%d"), j); - fd = open(dev_name.fn_str(), O_RDONLY); - if (fd == -1) - break; - close(fd); - } - - if (j == 0) { - for (j=0; j<4; j++) { - dev_name.Printf(wxT("/dev/input/js%d"), j); - fd = open(dev_name.fn_str(), O_RDONLY); - if (fd == -1) - return j; - close(fd); - } - } - - return j; -} - -int wxJoystick::GetManufacturerId() const -{ - return 0; -} - -int wxJoystick::GetProductId() const -{ - return 0; -} - -wxString wxJoystick::GetProductName() const -{ - char name[128]; - - if (ioctl(m_device, JSIOCGNAME(sizeof(name)), name) < 0) - strcpy(name, "Unknown"); - return wxString(name, wxConvLibc); -} - -int wxJoystick::GetXMin() const -{ - return wxJS_AXIS_MIN; -} - -int wxJoystick::GetYMin() const -{ - return wxJS_AXIS_MIN; -} - -int wxJoystick::GetZMin() const -{ - return wxJS_AXIS_MIN; -} - -int wxJoystick::GetXMax() const -{ - return wxJS_AXIS_MAX; -} - -int wxJoystick::GetYMax() const -{ - return wxJS_AXIS_MAX; -} - -int wxJoystick::GetZMax() const -{ - return wxJS_AXIS_MAX; -} - -int wxJoystick::GetNumberButtons() const -{ - char nb=0; - - if (m_device != -1) - ioctl(m_device, JSIOCGBUTTONS, &nb); - - return nb; -} - -int wxJoystick::GetNumberAxes() const -{ - char nb=0; - - if (m_device != -1) - ioctl(m_device, JSIOCGAXES, &nb); - - return nb; -} - -int wxJoystick::GetMaxButtons() const -{ - return 15; // internal -} - -int wxJoystick::GetMaxAxes() const -{ - return 15; // internal -} - -int wxJoystick::GetPollingMin() const -{ - return 10; -} - -int wxJoystick::GetPollingMax() const -{ - return 1000; -} - -int wxJoystick::GetRudderMin() const -{ - return wxJS_AXIS_MIN; -} - -int wxJoystick::GetRudderMax() const -{ - return wxJS_AXIS_MAX; -} - -int wxJoystick::GetUMin() const -{ - return wxJS_AXIS_MIN; -} - -int wxJoystick::GetUMax() const -{ - return wxJS_AXIS_MAX; -} - -int wxJoystick::GetVMin() const -{ - return wxJS_AXIS_MIN; -} - -int wxJoystick::GetVMax() const -{ - return wxJS_AXIS_MAX; -} - -bool wxJoystick::HasRudder() const -{ - return GetNumberAxes() >= wxJS_AXIS_RUDDER; -} - -bool wxJoystick::HasZ() const -{ - return GetNumberAxes() >= wxJS_AXIS_Z; -} - -bool wxJoystick::HasU() const -{ - return GetNumberAxes() >= wxJS_AXIS_U; -} - -bool wxJoystick::HasV() const -{ - return GetNumberAxes() >= wxJS_AXIS_V; -} - -bool wxJoystick::HasPOV() const -{ - return false; -} - -bool wxJoystick::HasPOV4Dir() const -{ - return false; -} - -bool wxJoystick::HasPOVCTS() const -{ - return false; -} - -//////////////////////////////////////////////////////////////////////////// -// Operations -//////////////////////////////////////////////////////////////////////////// - -bool wxJoystick::SetCapture(wxWindow* win, int pollingFreq) -{ - if (m_thread) - { - m_thread->m_catchwin = win; - m_thread->m_polling = pollingFreq; - return true; - } - return false; -} - -bool wxJoystick::ReleaseCapture() -{ - if (m_thread) - { - m_thread->m_catchwin = NULL; - m_thread->m_polling = 0; - return true; - } - return false; -} -#endif // wxUSE_JOYSTICK diff --git a/wxWidgets/src/unix/mediactrl.cpp b/wxWidgets/src/unix/mediactrl.cpp deleted file mode 100644 index e30e0584ef..0000000000 --- a/wxWidgets/src/unix/mediactrl.cpp +++ /dev/null @@ -1,1607 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/unix/mediactrl.cpp -// Purpose: GStreamer backend for Unix -// Author: Ryan Norton -// Modified by: -// Created: 02/04/05 -// RCS-ID: $Id: mediactrl.cpp 49496 2007-10-27 21:16:54Z VZ $ -// Copyright: (c) 2004-2005 Ryan Norton -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#if wxUSE_MEDIACTRL - -#include "wx/mediactrl.h" - -#if wxUSE_GSTREAMER - -#include // main gstreamer header - -// xoverlay/video stuff, gst-gconf for 0.8 -#if GST_VERSION_MAJOR > 0 || GST_VERSION_MINOR >= 10 -# include -#else -# include -# include // gstreamer glib configuration -#endif - -#ifndef WX_PRECOMP - #include "wx/log.h" // wxLogDebug/wxLogSysError/wxLogTrace - #include "wx/app.h" // wxTheApp->argc, wxTheApp->argv - #include "wx/timer.h" // wxTimer -#endif - -#include "wx/thread.h" // wxMutex/wxMutexLocker - -#ifdef __WXGTK__ -# include "wx/gtk/win_gtk.h" -# include // for GDK_WINDOW_XWINDOW -#endif - -//----------------------------------------------------------------------------- -// Discussion of internals -//----------------------------------------------------------------------------- - -/* - This is the GStreamer backend for unix. Currently we require 0.8 or - 0.10. Here we use the "playbin" GstElement for ease of use. - - Note that now we compare state change functions to GST_STATE_FAILURE - now rather than GST_STATE_SUCCESS as newer gstreamer versions return - non-success values for returns that are otherwise successful but not - immediate. - - Also this probably doesn't work with anything other than wxGTK at the - moment but with a tad bit of work it could theorectically work in - straight wxX11 et al. - - One last note is that resuming from pausing/seeking can result - in erratic video playback (GStreamer-based bug, happens in totem as well) - - this is better in 0.10, however. One thing that might make it worse - here is that we don't preserve the aspect ratio of the video and stretch - it to the whole window. - - Note that there are some things used here that could be undocumented - - for reference see the media player Kiss and Totem as well as some - other sources. There was a backend for a kde media player as well - that attempted thread-safety... - - Then there is the issue of m_asynclock. This serves several purposes: - 1) It prevents the C callbacks from sending wx state change events - so that we don't get duplicate ones in 0.8 - 2) It makes the sync and async handlers in 0.10 not drop any - messages so that while we are polling it we get the messages in - SyncStateChange instead of the queue. - 3) Keeps the pausing in Stop() synchronous - - RN: Note that I've tried to follow the wxGTK conventions here as close - as possible. In the implementation the C Callbacks come first, then - the internal functions, then the public ones. Set your vi to 80 - characters people :). -*/ - -//============================================================================= -// Declarations -//============================================================================= - -//----------------------------------------------------------------------------- -// GStreamer (most version compatability) macros -//----------------------------------------------------------------------------- - -// In 0.9 there was a HUGE change to GstQuery and the -// gst_element_query function changed dramatically and split off -// into two seperate ones -#if GST_VERSION_MAJOR == 0 && GST_VERSION_MINOR <= 8 -# define wxGst_element_query_duration(e, f, p) \ - gst_element_query(e, GST_QUERY_TOTAL, f, p) -# define wxGst_element_query_position(e, f, p) \ - gst_element_query(e, GST_QUERY_POSITION, f, p) -#elif GST_VERSION_MAJOR == 0 && GST_VERSION_MINOR == 9 -// However, the actual 0.9 version has a slightly different definition -// and instead of gst_element_query_duration it has two parameters to -// gst_element_query_position instead -# define wxGst_element_query_duration(e, f, p) \ - gst_element_query_position(e, f, 0, p) -# define wxGst_element_query_position(e, f, p) \ - gst_element_query_position(e, f, p, 0) -#else -# define wxGst_element_query_duration \ - gst_element_query_duration -# define wxGst_element_query_position \ - gst_element_query_position -#endif - -// Other 0.10 macros -#if GST_VERSION_MAJOR > 0 || GST_VERSION_MINOR >= 10 -# define GST_STATE_FAILURE GST_STATE_CHANGE_FAILURE -# define GST_STATE_SUCCESS GST_STATE_CHANGE_SUCCESS -# define GstElementState GstState -# define gst_gconf_get_default_video_sink() \ - gst_element_factory_make ("gconfvideosink", "video-sink"); -# define gst_gconf_get_default_audio_sink() \ - gst_element_factory_make ("gconfaudiosink", "audio-sink"); -#endif - -// Max wait time for element state waiting - GST_CLOCK_TIME_NONE for inf -#define wxGSTREAMER_TIMEOUT (100 * GST_MSECOND) // Max 100 milliseconds - -//----------------------------------------------------------------------------- -// wxGTK Debugging and idle stuff -//----------------------------------------------------------------------------- -#ifdef __WXGTK__ - -# ifdef __WXDEBUG__ -# if wxUSE_THREADS -# define DEBUG_MAIN_THREAD \ - if (wxThread::IsMain() && g_mainThreadLocked) \ - wxPrintf(wxT("gui reentrance")); -# else -# define DEBUG_MAIN_THREAD -# endif -# else -# define DEBUG_MAIN_THREAD -# endif // Debug - -extern void wxapp_install_idle_handler(); -extern bool g_isIdle; -extern bool g_mainThreadLocked; -#endif // wxGTK - -//----------------------------------------------------------------------------- -// wxLogTrace mask string -//----------------------------------------------------------------------------- -#define wxTRACE_GStreamer wxT("GStreamer") - -//----------------------------------------------------------------------------- -// -// wxGStreamerMediaBackend -// -//----------------------------------------------------------------------------- -class WXDLLIMPEXP_MEDIA - wxGStreamerMediaBackend : public wxMediaBackendCommonBase -{ -public: - - wxGStreamerMediaBackend(); - virtual ~wxGStreamerMediaBackend(); - - virtual bool CreateControl(wxControl* ctrl, wxWindow* parent, - wxWindowID id, - const wxPoint& pos, - const wxSize& size, - long style, - const wxValidator& validator, - const wxString& name); - - virtual bool Play(); - virtual bool Pause(); - virtual bool Stop(); - - virtual bool Load(const wxString& fileName); - virtual bool Load(const wxURI& location); - - virtual wxMediaState GetState(); - - virtual bool SetPosition(wxLongLong where); - virtual wxLongLong GetPosition(); - virtual wxLongLong GetDuration(); - - virtual void Move(int x, int y, int w, int h); - wxSize GetVideoSize() const; - - virtual double GetPlaybackRate(); - virtual bool SetPlaybackRate(double dRate); - - virtual wxLongLong GetDownloadProgress(); - virtual wxLongLong GetDownloadTotal(); - - virtual bool SetVolume(double dVolume); - virtual double GetVolume(); - - //------------implementation from now on----------------------------------- - bool DoLoad(const wxString& locstring); - wxMediaCtrl* GetControl() { return m_ctrl; } // for C Callbacks - void HandleStateChange(GstElementState oldstate, GstElementState newstate); - bool QueryVideoSizeFromElement(GstElement* element); - bool QueryVideoSizeFromPad(GstPad* caps); - void SetupXOverlay(); - bool SyncStateChange(GstElement* element, GstElementState state, - gint64 llTimeout = wxGSTREAMER_TIMEOUT); - bool TryAudioSink(GstElement* audiosink); - bool TryVideoSink(GstElement* videosink); - - GstElement* m_playbin; // GStreamer media element - wxSize m_videoSize; // Cached actual video size - double m_dRate; // Current playback rate - - // see GetPlaybackRate for notes - wxLongLong m_llPausedPos; // Paused position - see Pause() - GstXOverlay* m_xoverlay; // X Overlay that contains the GST video - wxMutex m_asynclock; // See "discussion of internals" - class wxGStreamerMediaEventHandler* m_eventHandler; // see below - - friend class wxGStreamerMediaEventHandler; - friend class wxGStreamerLoadWaitTimer; - DECLARE_DYNAMIC_CLASS(wxGStreamerMediaBackend); -}; - -//----------------------------------------------------------------------------- -// wxGStreamerMediaEventHandler -// -// OK, this will take an explanation - basically gstreamer callbacks -// are issued in a seperate thread, and in this thread we may not set -// the state of the playbin, so we need to send a wx event in that -// callback so that we set the state of the media and other stuff -// like GUI calls. -//----------------------------------------------------------------------------- -class wxGStreamerMediaEventHandler : public wxEvtHandler -{ - public: - wxGStreamerMediaEventHandler(wxGStreamerMediaBackend* be) : m_be(be) - { - this->Connect(wxID_ANY, wxEVT_MEDIA_FINISHED, - wxMediaEventHandler(wxGStreamerMediaEventHandler::OnMediaFinish)); - } - - void OnMediaFinish(wxMediaEvent& event); - - wxGStreamerMediaBackend* m_be; -}; - -//============================================================================= -// Implementation -//============================================================================= - -IMPLEMENT_DYNAMIC_CLASS(wxGStreamerMediaBackend, wxMediaBackend) - -//----------------------------------------------------------------------------- -// -// C Callbacks -// -//----------------------------------------------------------------------------- - -//----------------------------------------------------------------------------- -// "expose_event" from m_ctrl->m_wxwindow -// -// Handle GTK expose event from our window - here we hopefully -// redraw the video in the case of pausing and other instances... -// (Returns TRUE to pass to other handlers, FALSE if not) -// -// TODO: Do a DEBUG_MAIN_THREAD/install_idle_handler here? -//----------------------------------------------------------------------------- -#ifdef __WXGTK__ -extern "C" { -static gboolean gtk_window_expose_callback(GtkWidget *widget, - GdkEventExpose *event, - wxGStreamerMediaBackend *be) -{ - if(event->count > 0) - return FALSE; - - GdkWindow *window = GTK_PIZZA(be->GetControl()->m_wxwindow)->bin_window; - - // I've seen this reccommended somewhere... - // TODO: Is this needed? Maybe it is just cruft... - // gst_x_overlay_set_xwindow_id( GST_X_OVERLAY(be->m_xoverlay), - // GDK_WINDOW_XWINDOW( window ) ); - - // If we have actual video..... - if(!(be->m_videoSize.x==0&&be->m_videoSize.y==0) && - GST_STATE(be->m_playbin) >= GST_STATE_PAUSED) - { - // GST Doesn't redraw automatically while paused - // Plus, the video sometimes doesn't redraw when it looses focus - // or is painted over so we just tell it to redraw... - gst_x_overlay_expose(be->m_xoverlay); - } - else - { - // draw a black background like some other backends do.... - gdk_draw_rectangle (window, widget->style->black_gc, TRUE, 0, 0, - widget->allocation.width, - widget->allocation.height); - } - - return FALSE; -} -} -#endif // wxGTK - -//----------------------------------------------------------------------------- -// "realize" from m_ctrl->m_wxwindow -// -// If the window wasn't realized when Load was called, this is the -// callback for when it is - the purpose of which is to tell -// GStreamer to play the video in our control -//----------------------------------------------------------------------------- -#ifdef __WXGTK__ -extern "C" { -static gint gtk_window_realize_callback(GtkWidget* theWidget, - wxGStreamerMediaBackend* be) -{ - DEBUG_MAIN_THREAD // TODO: Is this neccessary? - - if (g_isIdle) // FIXME: Why is needed? For wxYield? ?? - wxapp_install_idle_handler(); - - wxYield(); // FIXME: RN: X Server gets an error/crash if I don't do - // this or a messagebox beforehand?!?!?? - - GdkWindow *window = GTK_PIZZA(theWidget)->bin_window; - wxASSERT(window); - - gst_x_overlay_set_xwindow_id( GST_X_OVERLAY(be->m_xoverlay), - GDK_WINDOW_XWINDOW( window ) - ); - g_signal_connect (be->GetControl()->m_wxwindow, - "expose_event", - G_CALLBACK(gtk_window_expose_callback), be); - return 0; -} -} -#endif // wxGTK - -//----------------------------------------------------------------------------- -// "state-change" from m_playbin/GST_MESSAGE_STATE_CHANGE -// -// Called by gstreamer when the state changes - here we -// send the appropriate corresponding wx event. -// -// 0.8 only as HandleStateChange does this in both versions -//----------------------------------------------------------------------------- -#if GST_VERSION_MAJOR == 0 && GST_VERSION_MINOR < 10 -extern "C" { -static void gst_state_change_callback(GstElement *play, - GstElementState oldstate, - GstElementState newstate, - wxGStreamerMediaBackend* be) -{ - if(be->m_asynclock.TryLock() == wxMUTEX_NO_ERROR) - { - be->HandleStateChange(oldstate, newstate); - be->m_asynclock.Unlock(); - } -} -} -#endif // <0.10 - -//----------------------------------------------------------------------------- -// "eos" from m_playbin/GST_MESSAGE_EOS -// -// Called by gstreamer when the media is done playing ("end of stream") -//----------------------------------------------------------------------------- -extern "C" { -static void gst_finish_callback(GstElement *play, - wxGStreamerMediaBackend* be) -{ - wxLogTrace(wxTRACE_GStreamer, wxT("gst_finish_callback")); - wxMediaEvent event(wxEVT_MEDIA_FINISHED); - be->m_eventHandler->AddPendingEvent(event); -} -} - -//----------------------------------------------------------------------------- -// "error" from m_playbin/GST_MESSAGE_ERROR -// -// Called by gstreamer when an error is encountered playing the media - -// We call wxLogTrace in addition wxLogSysError so that we can get it -// on the command line as well for those who want extra traces. -//----------------------------------------------------------------------------- -extern "C" { -static void gst_error_callback(GstElement *play, - GstElement *src, - GError *err, - gchar *debug, - wxGStreamerMediaBackend* be) -{ - wxString sError; - sError.Printf(wxT("gst_error_callback\n") - wxT("Error Message:%s\nDebug:%s\n"), - (const wxChar*)wxConvUTF8.cMB2WX(err->message), - (const wxChar*)wxConvUTF8.cMB2WX(debug)); - wxLogTrace(wxTRACE_GStreamer, sError); - wxLogSysError(sError); -} -} - -//----------------------------------------------------------------------------- -// "notify::caps" from the videopad inside "stream-info" of m_playbin -// -// Called by gstreamer when the video caps for the media is ready - currently -// we use the caps to get the natural size of the video -// -// (Undocumented?) -//----------------------------------------------------------------------------- -extern "C" { -static void gst_notify_caps_callback(GstPad* pad, - GParamSpec* pspec, - wxGStreamerMediaBackend* be) -{ - wxLogTrace(wxTRACE_GStreamer, wxT("gst_notify_caps_callback")); - be->QueryVideoSizeFromPad(pad); -} -} - -//----------------------------------------------------------------------------- -// "notify::stream-info" from m_playbin -// -// Run through the stuff in "stream-info" of m_playbin for a valid -// video pad, and then attempt to query the video size from it - if not -// set up an event to do so when ready. -// -// Currently unused - now we just query it directly using -// QueryVideoSizeFromElement. -// -// (Undocumented?) -//----------------------------------------------------------------------------- -#if GST_VERSION_MAJOR > 0 || GST_VERSION_MINOR >= 10 -extern "C" { -static void gst_notify_stream_info_callback(GstElement* element, - GParamSpec* pspec, - wxGStreamerMediaBackend* be) -{ - wxLogTrace(wxTRACE_GStreamer, wxT("gst_notify_stream_info_callback")); - be->QueryVideoSizeFromElement(be->m_playbin); -} -} -#endif - -//----------------------------------------------------------------------------- -// "desired-size-changed" from m_xoverlay -// -// 0.8-specific this provides us with the video size when it changes - -// even though we get the caps as well this seems to come before the -// caps notification does... -// -// Note it will return 16,16 for an early-bird value or for audio -//----------------------------------------------------------------------------- -#if GST_VERSION_MAJOR == 0 && GST_VERSION_MINOR < 10 -extern "C" { -static void gst_desired_size_changed_callback(GstElement * play, - guint width, guint height, - wxGStreamerMediaBackend* be) -{ - if(!(width == 16 && height == 16)) - { - be->m_videoSize.x = width; - be->m_videoSize.y = height; - } - else - be->QueryVideoSizeFromElement(be->m_playbin); -} -} -#endif - -//----------------------------------------------------------------------------- -// gst_bus_async_callback [static] -// gst_bus_sync_callback [static] -// -// Called by m_playbin for notifications such as end-of-stream in 0.10 - -// in previous versions g_signal notifications were used. Because everything -// in centered in one switch statement though it reminds one of old WinAPI -// stuff. -// -// gst_bus_sync_callback is that sync version that is called on the main GUI -// thread before the async version that we use to set the xwindow id of the -// XOverlay (NB: This isn't currently used - see CreateControl()). -//----------------------------------------------------------------------------- -#if GST_VERSION_MAJOR > 0 || GST_VERSION_MINOR >= 10 -extern "C" { -static gboolean gst_bus_async_callback(GstBus* bus, - GstMessage* message, - wxGStreamerMediaBackend* be) -{ - if(((GstElement*)GST_MESSAGE_SRC(message)) != be->m_playbin) - return TRUE; - if(be->m_asynclock.TryLock() != wxMUTEX_NO_ERROR) - return TRUE; - - switch(GST_MESSAGE_TYPE(message)) - { - case GST_MESSAGE_STATE_CHANGED: - { - GstState oldstate, newstate, pendingstate; - gst_message_parse_state_changed(message, &oldstate, - &newstate, &pendingstate); - be->HandleStateChange(oldstate, newstate); - break; - } - case GST_MESSAGE_EOS: - { - gst_finish_callback(NULL, be); - break; - } - case GST_MESSAGE_ERROR: - { - GError* error; - gchar* debug; - gst_message_parse_error(message, &error, &debug); - gst_error_callback(NULL, NULL, error, debug, be); - break; - } - default: - break; - } - - be->m_asynclock.Unlock(); - return FALSE; // remove the message from Z queue -} - -static GstBusSyncReply gst_bus_sync_callback(GstBus* bus, - GstMessage* message, - wxGStreamerMediaBackend* be) -{ - // Pass a non-xwindowid-setting event on to the async handler where it - // belongs - if (GST_MESSAGE_TYPE (message) != GST_MESSAGE_ELEMENT || - !gst_structure_has_name (message->structure, "prepare-xwindow-id")) - { - // - // NB: Unfortunately, the async callback can be quite - // buggy at times and often doesn't get called at all, - // so here we are processing it right here in the calling - // thread instead of the GUI one... - // - if(gst_bus_async_callback(bus, message, be)) - return GST_BUS_PASS; - else - return GST_BUS_DROP; - } - - wxLogTrace(wxTRACE_GStreamer, wxT("Got prepare-xwindow-id")); - be->SetupXOverlay(); - return GST_BUS_DROP; // We handled this message - drop from the queue -} -} -#endif - -//----------------------------------------------------------------------------- -// -// Private (although not in the C++ sense) methods -// -//----------------------------------------------------------------------------- - -//----------------------------------------------------------------------------- -// wxGStreamerMediaBackend::HandleStateChange -// -// Handles a state change event from our C Callback for "state-change" or -// the async queue in 0.10. (Mostly this is here to avoid locking the -// the mutex twice...) -//----------------------------------------------------------------------------- -void wxGStreamerMediaBackend::HandleStateChange(GstElementState oldstate, - GstElementState newstate) -{ - switch(newstate) - { - case GST_STATE_PLAYING: - wxLogTrace(wxTRACE_GStreamer, wxT("Play event")); - QueuePlayEvent(); - break; - case GST_STATE_PAUSED: - // For some reason .10 sends a lot of oldstate == newstate - // messages - most likely for pending ones - also - // !next) - { - GObject *info = (GObject *) list->data; - gint type; - GParamSpec *pspec; - GEnumValue *val; - GstPad *pad = NULL; - - g_object_get (info, "type", &type, NULL); - pspec = g_object_class_find_property ( - G_OBJECT_GET_CLASS (info), "type"); - val = g_enum_get_value (G_PARAM_SPEC_ENUM (pspec)->enum_class, type); - - if (!strncasecmp(val->value_name, "video", 5) || - !strncmp(val->value_name, "GST_STREAM_TYPE_VIDEO", 21)) - { - // Newer gstreamer 0.8+ plugins are SUPPOSED to have "object"... - // but a lot of old plugins still use "pad" :) - pspec = g_object_class_find_property ( - G_OBJECT_GET_CLASS (info), "object"); - - if (!pspec) - g_object_get (info, "pad", &pad, NULL); - else - g_object_get (info, "object", &pad, NULL); - -#if GST_VERSION_MAJOR == 0 && GST_VERSION_MINOR <= 8 - // Killed in 0.9, presumely because events and such - // should be pushed on pads regardless of whether they - // are currently linked - pad = (GstPad *) GST_PAD_REALIZE (pad); - wxASSERT(pad); -#endif - - if(!QueryVideoSizeFromPad(pad)) - { - // wait for those caps to get ready - g_signal_connect( - pad, - "notify::caps", - G_CALLBACK(gst_notify_caps_callback), - this); - } - break; - }// end if video - }// end searching through info list - - // no video (or extremely delayed stream-info) - if(list == NULL) - { - m_videoSize = wxSize(0,0); - return false; - } - - return true; -} - -//----------------------------------------------------------------------------- -// wxGStreamerMediaBackend::QueryVideoSizeFromPad -// -// Gets the size of our video (in wxSize) from a GstPad -//----------------------------------------------------------------------------- -bool wxGStreamerMediaBackend::QueryVideoSizeFromPad(GstPad* pad) -{ - const GstCaps* caps = GST_PAD_CAPS(pad); - if ( caps ) - { - const GstStructure *s = gst_caps_get_structure (caps, 0); - wxASSERT(s); - - gst_structure_get_int (s, "width", &m_videoSize.x); - gst_structure_get_int (s, "height", &m_videoSize.y); - - const GValue *par; - par = gst_structure_get_value (s, "pixel-aspect-ratio"); - - if (par) - { - wxLogTrace(wxTRACE_GStreamer, - wxT("pixel-aspect-ratio found in pad")); - int num = par->data[0].v_int, - den = par->data[1].v_int; - - // TODO: maybe better fraction normalization... - if (num > den) - m_videoSize.x = (int) ((float) num * m_videoSize.x / den); - else - m_videoSize.y = (int) ((float) den * m_videoSize.y / num); - } - - wxLogTrace(wxTRACE_GStreamer, wxT("Adjusted video size: [%i,%i]"), - m_videoSize.x, m_videoSize.y); - return true; - } // end if caps - - return false; // not ready/massive failure -} - -//----------------------------------------------------------------------------- -// wxGStreamerMediaBackend::SetupXOverlay -// -// Attempts to set the XWindow id of our GstXOverlay to tell it which -// window to play video in. -//----------------------------------------------------------------------------- -void wxGStreamerMediaBackend::SetupXOverlay() -{ - // Use the xoverlay extension to tell gstreamer to play in our window -#ifdef __WXGTK__ - if(!GTK_WIDGET_REALIZED(m_ctrl->m_wxwindow)) - { - // Not realized yet - set to connect at realization time - g_signal_connect (m_ctrl->m_wxwindow, - "realize", - G_CALLBACK (gtk_window_realize_callback), - this); - } - else - { - wxYield(); // see realize callback... - GdkWindow *window = GTK_PIZZA(m_ctrl->m_wxwindow)->bin_window; - wxASSERT(window); -#endif - - gst_x_overlay_set_xwindow_id( GST_X_OVERLAY(m_xoverlay), -#ifdef __WXGTK__ - GDK_WINDOW_XWINDOW( window ) -#else - ctrl->GetHandle() -#endif - ); - -#ifdef __WXGTK__ - g_signal_connect (m_ctrl->m_wxwindow, - // m_ctrl->m_wxwindow/*m_ctrl->m_widget*/, - "expose_event", - G_CALLBACK(gtk_window_expose_callback), this); - } // end if GtkPizza realized -#endif -} - -//----------------------------------------------------------------------------- -// wxGStreamerMediaBackend::SyncStateChange -// -// This function is rather complex - basically the idea is that we -// poll the GstBus of m_playbin until it has reached desiredstate, an error -// is reached, or there are no more messages left in the GstBus queue. -// -// Returns true if there are no messages left in the queue or -// the current state reaches the disired state. -// -// PRECONDITION: Assumes m_asynclock is Lock()ed -//----------------------------------------------------------------------------- -#if GST_VERSION_MAJOR > 0 || GST_VERSION_MINOR >= 10 -bool wxGStreamerMediaBackend::SyncStateChange(GstElement* element, - GstElementState desiredstate, - gint64 llTimeout) -{ - GstBus* bus = gst_element_get_bus(element); - GstMessage* message; - bool bBreak = false, - bSuccess = false; - gint64 llTimeWaited = 0; - - do - { -#if 1 - // NB: The GStreamer gst_bus_poll is unfortunately broken and - // throws silly critical internal errors (for instance - // "message != NULL" when the whole point of it is to - // poll for the message in the first place!) so we implement - // our own "waiting mechinism" - if(gst_bus_have_pending(bus) == FALSE) - { - if(llTimeWaited >= llTimeout) - return true; // Reached timeout... assume success - llTimeWaited += 10*GST_MSECOND; - wxMilliSleep(10); - continue; - } - - message = gst_bus_pop(bus); -#else - message = gst_bus_poll(bus, (GstMessageType) - (GST_MESSAGE_STATE_CHANGED | - GST_MESSAGE_ERROR | - GST_MESSAGE_EOS), llTimeout); - if(!message) - return true; -#endif - if(((GstElement*)GST_MESSAGE_SRC(message)) == element) - { - switch(GST_MESSAGE_TYPE(message)) - { - case GST_MESSAGE_STATE_CHANGED: - { - GstState oldstate, newstate, pendingstate; - gst_message_parse_state_changed(message, &oldstate, - &newstate, &pendingstate); - if(newstate == desiredstate) - { - bSuccess = bBreak = true; - } - break; - } - case GST_MESSAGE_ERROR: - { - GError* error; - gchar* debug; - gst_message_parse_error(message, &error, &debug); - gst_error_callback(NULL, NULL, error, debug, this); - bBreak = true; - break; - } - case GST_MESSAGE_EOS: - wxLogSysError(wxT("Reached end of stream prematurely")); - bBreak = true; - break; - default: - break; // not handled - } - } - - gst_message_unref(message); - }while(!bBreak); - - return bSuccess; -} -#else // 0.8 implementation -bool wxGStreamerMediaBackend::SyncStateChange(GstElement* element, - GstElementState desiredstate, - gint64 llTimeout) -{ - gint64 llTimeWaited = 0; - while(GST_STATE(element) != desiredstate) - { - if(llTimeWaited >= llTimeout) - break; - llTimeWaited += 10*GST_MSECOND; - wxMilliSleep(10); - } - - return llTimeWaited != llTimeout; -} -#endif - -//----------------------------------------------------------------------------- -// wxGStreamerMediaBackend::TryAudioSink -// wxGStreamerMediaBackend::TryVideoSink -// -// Uses various means to determine whether a passed in video/audio sink -// if suitable for us - if it is not we return false and unref the -// inappropriate sink. -//----------------------------------------------------------------------------- -bool wxGStreamerMediaBackend::TryAudioSink(GstElement* audiosink) -{ - if( !GST_IS_ELEMENT(audiosink) ) - { - if(G_IS_OBJECT(audiosink)) - g_object_unref(audiosink); - return false; - } - - return true; -} - -bool wxGStreamerMediaBackend::TryVideoSink(GstElement* videosink) -{ - // Check if the video sink either is an xoverlay or might contain one... - if( !GST_IS_BIN(videosink) && !GST_IS_X_OVERLAY(videosink) ) - { - if(G_IS_OBJECT(videosink)) - g_object_unref(videosink); - return false; - } - - // Make our video sink and make sure it supports the x overlay interface - // the x overlay enables us to put the video in our control window - // (i.e. we NEED it!) - also connect to the natural video size change event - if( GST_IS_BIN(videosink) ) - m_xoverlay = (GstXOverlay*) - gst_bin_get_by_interface (GST_BIN (videosink), - GST_TYPE_X_OVERLAY); - else - m_xoverlay = (GstXOverlay*) videosink; - - if ( !GST_IS_X_OVERLAY(m_xoverlay) ) - { - g_object_unref(videosink); - return false; - } - - return true; -} - -//----------------------------------------------------------------------------- -// wxGStreamerMediaEventHandler::OnMediaFinish -// -// Called when the media is about to stop -//----------------------------------------------------------------------------- -void wxGStreamerMediaEventHandler::OnMediaFinish(wxMediaEvent& WXUNUSED(event)) -{ - // (RN - I have no idea why I thought this was good behaviour.... - // maybe it made sense for streaming/nonseeking data but - // generally it seems like a really bad idea) - - if(m_be->SendStopEvent()) - { - // Stop the media (we need to set it back to paused - // so that people can get the duration et al. - // and send the finish event (luckily we can "Sync" it out... LOL!) - // (We don't check return values here because we can't really do - // anything...) - wxMutexLocker lock(m_be->m_asynclock); - - // Set element to ready+sync it - gst_element_set_state (m_be->m_playbin, GST_STATE_READY); - m_be->SyncStateChange(m_be->m_playbin, GST_STATE_READY); - - // Now set it to paused + update pause pos to 0 and - // Sync that as well (note that we don't call Stop() here - // due to mutex issues) - gst_element_set_state (m_be->m_playbin, GST_STATE_PAUSED); - m_be->SyncStateChange(m_be->m_playbin, GST_STATE_PAUSED); - m_be->m_llPausedPos = 0; - - // Finally, queue the finish event - m_be->QueueFinishEvent(); - } -} - -//----------------------------------------------------------------------------- -// -// Public methods -// -//----------------------------------------------------------------------------- - -//----------------------------------------------------------------------------- -// wxGStreamerMediaBackend Constructor -// -// Sets m_playbin to NULL signifying we havn't loaded anything yet -//----------------------------------------------------------------------------- -wxGStreamerMediaBackend::wxGStreamerMediaBackend() - : m_playbin(NULL), - m_eventHandler(NULL) -{ -} - -//----------------------------------------------------------------------------- -// wxGStreamerMediaBackend Destructor -// -// Stops/cleans up memory -// -// NB: This could trigger a critical warning but doing a SyncStateChange -// here is just going to slow down quitting of the app, which is bad. -//----------------------------------------------------------------------------- -wxGStreamerMediaBackend::~wxGStreamerMediaBackend() -{ - // Dispose of the main player and related objects - if(m_playbin) - { - wxASSERT( GST_IS_OBJECT(m_playbin) ); - gst_element_set_state (m_playbin, GST_STATE_NULL); - gst_object_unref (GST_OBJECT (m_playbin)); - delete m_eventHandler; - } -} - -//----------------------------------------------------------------------------- -// wxGStreamerMediaBackend::CreateControl -// -// Initializes GStreamer and creates the wx side of our media control -//----------------------------------------------------------------------------- -bool wxGStreamerMediaBackend::CreateControl(wxControl* ctrl, wxWindow* parent, - wxWindowID id, - const wxPoint& pos, - const wxSize& size, - long style, - const wxValidator& validator, - const wxString& name) -{ - // - //init gstreamer - // - - //Convert arguments to unicode if enabled -#if wxUSE_UNICODE - int i; - char **argvGST = new char*[wxTheApp->argc + 1]; - for ( i = 0; i < wxTheApp->argc; i++ ) - { - argvGST[i] = wxStrdupA(wxConvUTF8.cWX2MB(wxTheApp->argv[i])); - } - - argvGST[wxTheApp->argc] = NULL; - - int argcGST = wxTheApp->argc; -#else -#define argcGST wxTheApp->argc -#define argvGST wxTheApp->argv -#endif - - //Really init gstreamer - gboolean bInited; - GError* error = NULL; -#if GST_VERSION_MAJOR > 0 || GST_VERSION_MINOR >= 10 - bInited = gst_init_check(&argcGST, &argvGST, &error); -#else - bInited = gst_init_check(&argcGST, &argvGST); -#endif - - // Cleanup arguments for unicode case -#if wxUSE_UNICODE - for ( i = 0; i < argcGST; i++ ) - { - free(argvGST[i]); - } - - delete [] argvGST; -#endif - - if(!bInited) //gst_init_check fail? - { - if(error) - { - wxLogSysError(wxT("Could not initialize GStreamer\n") - wxT("Error Message:%s"), - (const wxChar*) wxConvUTF8.cMB2WX(error->message) - ); - g_error_free(error); - } - else - wxLogSysError(wxT("Could not initialize GStreamer")); - - return false; - } - - // - // wxControl creation - // - m_ctrl = wxStaticCast(ctrl, wxMediaCtrl); - -#ifdef __WXGTK__ - // We handle our own GTK expose events - m_ctrl->m_noExpose = true; -#endif - - if( !m_ctrl->wxControl::Create(parent, id, pos, size, - style, // TODO: remove borders??? - validator, name) ) - { - wxFAIL_MSG(wxT("Could not create wxControl!!!")); - return false; - } - -#ifdef __WXGTK__ - // Turn off double-buffering so that - // so it doesn't draw over the video and cause sporadic - // disappearances of the video - gtk_widget_set_double_buffered(m_ctrl->m_wxwindow, FALSE); -#endif - - // don't erase the background of our control window - // so that resizing is a bit smoother - m_ctrl->SetBackgroundStyle(wxBG_STYLE_CUSTOM); - - // Create our playbin object - m_playbin = gst_element_factory_make ("playbin", "play"); - if (!GST_IS_ELEMENT(m_playbin)) - { - if(G_IS_OBJECT(m_playbin)) - g_object_unref(m_playbin); - wxLogSysError(wxT("Got an invalid playbin")); - return false; - } - -#if GST_VERSION_MAJOR == 0 && GST_VERSION_MINOR < 10 - // Connect the glib events/callbacks we want to our playbin - g_signal_connect(m_playbin, "eos", - G_CALLBACK(gst_finish_callback), this); - g_signal_connect(m_playbin, "error", - G_CALLBACK(gst_error_callback), this); - g_signal_connect(m_playbin, "state-change", - G_CALLBACK(gst_state_change_callback), this); -#else - // GStreamer 0.10+ uses GstBus for this now, connect to the sync - // handler as well so we can set the X window id of our xoverlay - gst_bus_add_watch (gst_element_get_bus(m_playbin), - (GstBusFunc) gst_bus_async_callback, this); - gst_bus_set_sync_handler(gst_element_get_bus(m_playbin), - (GstBusSyncHandler) gst_bus_sync_callback, this); - g_signal_connect(m_playbin, "notify::stream-info", - G_CALLBACK(gst_notify_stream_info_callback), this); -#endif - - // Get the audio sink - GstElement* audiosink = gst_gconf_get_default_audio_sink(); - if( !TryAudioSink(audiosink) ) - { - // fallback to autodetection, then alsa, then oss as a stopgap - audiosink = gst_element_factory_make ("autoaudiosink", "audio-sink"); - if( !TryAudioSink(audiosink) ) - { - audiosink = gst_element_factory_make ("alsasink", "alsa-output"); - if( !TryAudioSink(audiosink) ) - { - audiosink = gst_element_factory_make ("osssink", "play_audio"); - if( !TryAudioSink(audiosink) ) - { - wxLogSysError(wxT("Could not find a valid audiosink")); - return false; - } - } - } - } - - // Setup video sink - first try gconf, then auto, then xvimage and - // then finally plain ximage - GstElement* videosink = gst_gconf_get_default_video_sink(); - if( !TryVideoSink(videosink) ) - { - videosink = gst_element_factory_make ("autovideosink", "video-sink"); - if( !TryVideoSink(videosink) ) - { - videosink = gst_element_factory_make ("xvimagesink", "video-sink"); - if( !TryVideoSink(videosink) ) - { - // finally, do a final fallback to ximagesink - videosink = - gst_element_factory_make ("ximagesink", "video-sink"); - if( !TryVideoSink(videosink) ) - { - g_object_unref(audiosink); - wxLogSysError(wxT("Could not find a suitable video sink")); - return false; - } - } - } - } - -#if GST_VERSION_MAJOR == 0 && GST_VERSION_MINOR < 10 - // Not on 0.10... called when video size changes - g_signal_connect(m_xoverlay, "desired-size-changed", - G_CALLBACK(gst_desired_size_changed_callback), this); -#endif - // Tell GStreamer which window to draw to in 0.8 - 0.10 - // sometimes needs this too... - SetupXOverlay(); - - // Now that we know (or, rather think) our video and audio sink - // are valid set our playbin to use them - g_object_set (G_OBJECT (m_playbin), - "video-sink", videosink, - "audio-sink", audiosink, - NULL); - - m_eventHandler = new wxGStreamerMediaEventHandler(this); - return true; -} - -//----------------------------------------------------------------------------- -// wxGStreamerMediaBackend::Load (File version) -// -// Just calls DoLoad() with a prepended file scheme -//----------------------------------------------------------------------------- -bool wxGStreamerMediaBackend::Load(const wxString& fileName) -{ - return DoLoad(wxString( wxT("file://") ) + fileName); -} - -//----------------------------------------------------------------------------- -// wxGStreamerMediaBackend::Load (URI version) -// -// In the case of a file URI passes it unencoded - -// also, as of 0.10.3 and earlier GstURI (the uri parser for gstreamer) -// is sort of broken and only accepts uris with at least two slashes -// after the scheme (i.e. file: == not ok, file:// == ok) -//----------------------------------------------------------------------------- -bool wxGStreamerMediaBackend::Load(const wxURI& location) -{ - if(location.GetScheme().CmpNoCase(wxT("file")) == 0) - { - wxString uristring = location.BuildUnescapedURI(); - - //Workaround GstURI leading "//" problem and make sure it leads - //with that - return DoLoad(wxString(wxT("file://")) + - uristring.Right(uristring.length() - 5) - ); - } - else - return DoLoad(location.BuildURI()); -} - -//----------------------------------------------------------------------------- -// wxGStreamerMediaBackend::DoLoad -// -// Loads the media -// 1) Reset member variables and set playbin back to ready state -// 2) Check URI for validity and then tell the playbin to load it -// 3) Set the playbin to the pause state -// -// NB: Even after this function is over with we probably don't have the -// video size or duration - no amount of clever hacking is going to get -// around that, unfortunately. -//----------------------------------------------------------------------------- -bool wxGStreamerMediaBackend::DoLoad(const wxString& locstring) -{ - wxMutexLocker lock(m_asynclock); // lock state events and async callbacks - - // Reset positions & rate - m_llPausedPos = 0; - m_dRate = 1.0; - m_videoSize = wxSize(0,0); - - // Set playbin to ready to stop the current media... - if( gst_element_set_state (m_playbin, - GST_STATE_READY) == GST_STATE_FAILURE || - !SyncStateChange(m_playbin, GST_STATE_READY)) - { - wxLogSysError(wxT("wxGStreamerMediaBackend::Load - ") - wxT("Could not set initial state to ready")); - return false; - } - - // free current media resources - gst_element_set_state (m_playbin, GST_STATE_NULL); - - // Make sure the passed URI is valid and tell playbin to load it - // non-file uris are encoded - wxASSERT(gst_uri_protocol_is_valid("file")); - wxASSERT(gst_uri_is_valid(locstring.mb_str())); - - g_object_set (G_OBJECT (m_playbin), "uri", - (const char*)locstring.mb_str(), NULL); - - // Try to pause media as gstreamer won't let us query attributes - // such as video size unless it is paused or playing - if( gst_element_set_state (m_playbin, - GST_STATE_PAUSED) == GST_STATE_FAILURE || - !SyncStateChange(m_playbin, GST_STATE_PAUSED)) - { - return false; // no real error message needed here as this is - // generic failure 99% of the time (i.e. no - // source etc.) and has an error message - } - - - NotifyMovieLoaded(); // Notify the user - all we can do for now - return true; -} - - -//----------------------------------------------------------------------------- -// wxGStreamerMediaBackend::Play -// -// Sets the stream to a playing state -// -// THREAD-UNSAFE in 0.8, maybe in 0.10 as well -//----------------------------------------------------------------------------- -bool wxGStreamerMediaBackend::Play() -{ - if (gst_element_set_state (m_playbin, - GST_STATE_PLAYING) == GST_STATE_FAILURE) - return false; - return true; -} - -//----------------------------------------------------------------------------- -// wxGStreamerMediaBackend::Pause -// -// Marks where we paused and pauses the stream -// -// THREAD-UNSAFE in 0.8, maybe in 0.10 as well -//----------------------------------------------------------------------------- -bool wxGStreamerMediaBackend::Pause() -{ - m_llPausedPos = wxGStreamerMediaBackend::GetPosition(); - if (gst_element_set_state (m_playbin, - GST_STATE_PAUSED) == GST_STATE_FAILURE) - return false; - return true; -} - -//----------------------------------------------------------------------------- -// wxGStreamerMediaBackend::Stop -// -// Pauses the stream and sets the position to 0. Note that this is -// synchronous (!) pausing. -// -// Due to the mutex locking this is probably thread-safe actually. -//----------------------------------------------------------------------------- -bool wxGStreamerMediaBackend::Stop() -{ - { // begin state lock - wxMutexLocker lock(m_asynclock); - if(gst_element_set_state (m_playbin, - GST_STATE_PAUSED) == GST_STATE_FAILURE || - !SyncStateChange(m_playbin, GST_STATE_PAUSED)) - { - wxLogSysError(wxT("Could not set state to paused for Stop()")); - return false; - } - } // end state lock - - bool bSeekedOK = wxGStreamerMediaBackend::SetPosition(0); - - if(!bSeekedOK) - { - wxLogSysError(wxT("Could not seek to initial position in Stop()")); - return false; - } - - QueueStopEvent(); // Success - return true; -} - -//----------------------------------------------------------------------------- -// wxGStreamerMediaBackend::GetState -// -// Gets the state of the media -//----------------------------------------------------------------------------- -wxMediaState wxGStreamerMediaBackend::GetState() -{ - switch(GST_STATE(m_playbin)) - { - case GST_STATE_PLAYING: - return wxMEDIASTATE_PLAYING; - case GST_STATE_PAUSED: - if (m_llPausedPos == 0) - return wxMEDIASTATE_STOPPED; - else - return wxMEDIASTATE_PAUSED; - default://case GST_STATE_READY: - return wxMEDIASTATE_STOPPED; - } -} - -//----------------------------------------------------------------------------- -// wxGStreamerMediaBackend::GetPosition -// -// If paused, returns our marked position - otherwise it queries the -// GStreamer playbin for the position and returns that -// -// NB: -// NB: At least in 0.8, when you pause and seek gstreamer -// NB: doesn't update the position sometimes, so we need to keep track of -// NB: whether we have paused or not and keep track of the time after the -// NB: pause and whenever the user seeks while paused -// NB: -// -// THREAD-UNSAFE, at least if not paused. Requires media to be at least paused. -//----------------------------------------------------------------------------- -wxLongLong wxGStreamerMediaBackend::GetPosition() -{ - if(GetState() != wxMEDIASTATE_PLAYING) - return m_llPausedPos; - else - { - gint64 pos; - GstFormat fmtTime = GST_FORMAT_TIME; - - if (!wxGst_element_query_position(m_playbin, &fmtTime, &pos) || - fmtTime != GST_FORMAT_TIME || pos == -1) - return 0; - return pos / GST_MSECOND ; - } -} - -//----------------------------------------------------------------------------- -// wxGStreamerMediaBackend::SetPosition -// -// Sets the position of the stream -// Note that GST_MSECOND is 1000000 (GStreamer uses nanoseconds - so -// there is 1000000 nanoseconds in a millisecond) -// -// If we are paused we update the cached pause position. -// -// This is also an exceedingly ugly function due to the three implementations -// (or, rather two plus one implementation without a seek function). -// -// This is asynchronous and thread-safe on both 0.8 and 0.10. -// -// NB: This fires both a stop and play event if the media was previously -// playing... which in some ways makes sense. And yes, this makes the video -// go all haywire at times - a gstreamer bug... -//----------------------------------------------------------------------------- -bool wxGStreamerMediaBackend::SetPosition(wxLongLong where) -{ -#if GST_VERSION_MAJOR == 0 && GST_VERSION_MINOR == 8 \ - && GST_VERSION_MICRO == 0 - // 0.8.0 has no gst_element_seek according to official docs!!! - wxLogSysError(wxT("GStreamer 0.8.0 does not have gst_element_seek") - wxT(" according to official docs")); - return false; -#else // != 0.8.0 - -# if GST_VERSION_MAJOR > 0 || GST_VERSION_MINOR >= 10 - gst_element_seek (m_playbin, m_dRate, GST_FORMAT_TIME, - (GstSeekFlags)(GST_SEEK_FLAG_FLUSH | GST_SEEK_FLAG_KEY_UNIT), - GST_SEEK_TYPE_SET, where.GetValue() * GST_MSECOND, - GST_SEEK_TYPE_NONE, GST_CLOCK_TIME_NONE ); -# else - // NB: Some gstreamer versions return false basically all the time - // here - even totem doesn't bother to check the return value here - // so I guess we'll just assume it worked - - // TODO: maybe check the gst error callback??? - gst_element_seek (m_playbin, (GstSeekType) (GST_SEEK_METHOD_SET | - GST_FORMAT_TIME | GST_SEEK_FLAG_FLUSH), - where.GetValue() * GST_MSECOND ); - -# endif // GST_VERSION_MAJOR > 0 || GST_VERSION_MINOR >= 10 - - { - m_llPausedPos = where; - return true; - } - return true; -#endif //== 0.8.0 -} - -//----------------------------------------------------------------------------- -// wxGStreamerMediaBackend::GetDuration -// -// Obtains the total time of our stream -// THREAD-UNSAFE, requires media to be paused or playing -//----------------------------------------------------------------------------- -wxLongLong wxGStreamerMediaBackend::GetDuration() -{ - gint64 length; - GstFormat fmtTime = GST_FORMAT_TIME; - - if(!wxGst_element_query_duration(m_playbin, &fmtTime, &length) || - fmtTime != GST_FORMAT_TIME || length == -1) - return 0; - return length / GST_MSECOND ; -} - -//----------------------------------------------------------------------------- -// wxGStreamerMediaBackend::Move -// -// Called when the window is moved - GStreamer takes care of this -// for us so nothing is needed -//----------------------------------------------------------------------------- -void wxGStreamerMediaBackend::Move(int x, int y, int w, int h) -{ -} - -//----------------------------------------------------------------------------- -// wxGStreamerMediaBackend::GetVideoSize -// -// Returns our cached video size from Load/gst_notify_caps_callback -// gst_x_overlay_get_desired_size also does this in 0.8... -//----------------------------------------------------------------------------- -wxSize wxGStreamerMediaBackend::GetVideoSize() const -{ - return m_videoSize; -} - -//----------------------------------------------------------------------------- -// wxGStreamerMediaBackend::GetPlaybackRate -// wxGStreamerMediaBackend::SetPlaybackRate -// -// Obtains/Sets the playback rate of the stream -// -//TODO: PlaybackRate not currently supported via playbin directly - -//TODO: Ronald S. Bultje noted on gstreamer-devel: -//TODO: -//TODO: Like "play at twice normal speed"? Or "play at 25 fps and 44,1 kHz"? As -//TODO: for the first, yes, we have elements for that, btu they"re not part of -//TODO: playbin. You can create a bin (with a ghost pad) containing the actual -//TODO: video/audiosink and the speed-changing element for this, and set that -//TODO: element as video-sink or audio-sink property in playbin. The -//TODO: audio-element is called "speed", the video-element is called "videodrop" -//TODO: (although that appears to be deprecated in favour of "videorate", which -//TODO: again cannot do this, so this may not work at all in the end). For -//TODO: forcing frame/samplerates, see audioscale and videorate. Audioscale is -//TODO: part of playbin. -// -// In 0.10 GStreamer has new gst_element_seek API that might -// support this - and I've got an attempt to do so but it is untested -// but it would appear to work... -//----------------------------------------------------------------------------- -double wxGStreamerMediaBackend::GetPlaybackRate() -{ - return m_dRate; // Could use GST_QUERY_RATE but the API doesn't seem - // final on that yet and there may not be any actual - // plugins that support it... -} - -bool wxGStreamerMediaBackend::SetPlaybackRate(double dRate) -{ -#if GST_VERSION_MAJOR > 0 || GST_VERSION_MINOR >= 10 -#if 0 // not tested enough - if( gst_element_seek (m_playbin, dRate, GST_FORMAT_TIME, - (GstSeekFlags)(GST_SEEK_FLAG_FLUSH | GST_SEEK_FLAG_KEY_UNIT), - GST_SEEK_TYPE_CUR, 0, - GST_SEEK_TYPE_NONE, GST_CLOCK_TIME_NONE ) ) - { - m_dRate = dRate; - return true; - } -#endif -#endif - - // failure - return false; -} - -//----------------------------------------------------------------------------- -// wxGStreamerMediaBackend::GetDownloadProgress -// -// Not really outwardly possible - have been suggested that one could -// get the information from the component that "downloads" -//----------------------------------------------------------------------------- -wxLongLong wxGStreamerMediaBackend::GetDownloadProgress() -{ - return 0; -} - -//----------------------------------------------------------------------------- -// wxGStreamerMediaBackend::GetDownloadTotal -// -// TODO: Cache this? -// NB: The length changes every call for some reason due to -// GStreamer implementation issues -// THREAD-UNSAFE, requires media to be paused or playing -//----------------------------------------------------------------------------- -wxLongLong wxGStreamerMediaBackend::GetDownloadTotal() -{ - gint64 length; - GstFormat fmtBytes = GST_FORMAT_BYTES; - - if (!wxGst_element_query_duration(m_playbin, &fmtBytes, &length) || - fmtBytes != GST_FORMAT_BYTES || length == -1) - return 0; - return length; -} - -//----------------------------------------------------------------------------- -// wxGStreamerMediaBackend::SetVolume -// wxGStreamerMediaBackend::GetVolume -// -// Sets/Gets the volume through the playbin object. -// Note that this requires a relatively recent gst-plugins so we -// check at runtime to see whether it is available or not otherwise -// GST spits out an error on the command line -//----------------------------------------------------------------------------- -bool wxGStreamerMediaBackend::SetVolume(double dVolume) -{ - if(g_object_class_find_property( - G_OBJECT_GET_CLASS(G_OBJECT(m_playbin)), - "volume") != NULL) - { - g_object_set(G_OBJECT(m_playbin), "volume", dVolume, NULL); - return true; - } - else - { - wxLogTrace(wxTRACE_GStreamer, - wxT("SetVolume: volume prop not found - 0.8.5 of ") - wxT("gst-plugins probably needed")); - return false; - } -} - -double wxGStreamerMediaBackend::GetVolume() -{ - double dVolume = 1.0; - - if(g_object_class_find_property( - G_OBJECT_GET_CLASS(G_OBJECT(m_playbin)), - "volume") != NULL) - { - g_object_get(G_OBJECT(m_playbin), "volume", &dVolume, NULL); - } - else - { - wxLogTrace(wxTRACE_GStreamer, - wxT("GetVolume: volume prop not found - 0.8.5 of ") - wxT("gst-plugins probably needed")); - } - - return dVolume; -} - -#endif //wxUSE_GSTREAMER - -// Force link into main library so this backend can be loaded -#include "wx/html/forcelnk.h" -FORCE_LINK_ME(basewxmediabackends) - -#endif //wxUSE_MEDIACTRL diff --git a/wxWidgets/src/unix/mimetype.cpp b/wxWidgets/src/unix/mimetype.cpp deleted file mode 100644 index cff4ebfeae..0000000000 --- a/wxWidgets/src/unix/mimetype.cpp +++ /dev/null @@ -1,3011 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/unix/mimetype.cpp -// Purpose: classes and functions to manage MIME types -// Author: Vadim Zeitlin -// Modified by: -// Created: 23.09.98 -// RCS-ID: $Id: mimetype.cpp 63971 2010-04-14 00:10:21Z VZ $ -// Copyright: (c) 1998 Vadim Zeitlin -// Licence: wxWindows licence (part of wxExtra library) -///////////////////////////////////////////////////////////////////////////// - -// known bugs; there may be others!! chris elliott, biol75@york.ac.uk 27 Mar 01 - -// 1) .mailcap and .mimetypes can be either in a netscape or metamail format -// and entries may get confused during writing (I've tried to fix this; please let me know -// any files that fail) -// 2) KDE and Gnome do not yet fully support international read/write -// 3) Gnome key lines like open.latex."LaTeX this file"=latex %f will have odd results -// 4) writing to files comments out the existing data; I hope this avoids losing -// any data which we could not read, and data which we did not store like test= -// 5) results from reading files with multiple entries (especially matches with type/* ) -// may (or may not) work for getXXX commands -// 6) Loading the png icons in Gnome doesn't work for me... -// 7) In Gnome, if keys.mime exists but keys.users does not, there is -// an error message in debug mode, but the file is still written OK -// 8) Deleting entries is only allowed from the user file; sytem wide entries -// will be preserved during unassociate -// 9) KDE does not yet handle multiple actions; Netscape mode never will - -// TODO: this file is a mess, we need to split it and review everything (VZ) - -// for compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_MIMETYPE && wxUSE_FILE && wxUSE_TEXTFILE - -#include "wx/unix/mimetype.h" - -#ifndef WX_PRECOMP - #include "wx/dynarray.h" - #include "wx/string.h" - #include "wx/intl.h" - #include "wx/log.h" - #include "wx/utils.h" -#endif - -#include "wx/file.h" -#include "wx/confbase.h" - -#include "wx/ffile.h" -#include "wx/textfile.h" -#include "wx/dir.h" -#include "wx/tokenzr.h" -#include "wx/iconloc.h" -#include "wx/filename.h" -#include "wx/app.h" -#include "wx/apptrait.h" - -#if wxUSE_LIBGNOMEVFS - // Not GUI dependent - #include "wx/gtk/gnome/gvfs.h" -#endif - -// other standard headers -#include - -// this class is a wxTextFile specialization for dealing with files storing -// various MIME-related information -// -// it should be used instead of wxTextFile even if none of its additional -// methods are used just because it handles files with mixed encodings (often -// the case for MIME files which contain strings for different languages) -// correctly, see OnRead() -class wxMimeTextFile : public wxTextFile -{ -public: - // constructors - wxMimeTextFile () : wxTextFile () { } - wxMimeTextFile(const wxString& strFile) : wxTextFile(strFile) { } - - int pIndexOf(const wxString& sSearch, - bool bIncludeComments = false, - int iStart = 0) - { - wxString sTest = sSearch; - sTest.MakeLower(); - for(size_t i = iStart; i < GetLineCount(); i++) - { - wxString sLine = GetLine(i).Trim(false); - if(bIncludeComments || ! sLine.StartsWith(wxT("#"))) - { - sLine.MakeLower(); - if(sLine.StartsWith(sTest)) - return (int)i; - } - } - return wxNOT_FOUND; - } - - bool CommentLine(int nIndex) - { - if (nIndex < 0) - return false; - if (nIndex >= (int)GetLineCount() ) - return false; - - GetLine(nIndex) = GetLine(nIndex).Prepend(wxT("#")); - return true; - } - - bool CommentLine(const wxString & sTest) - { - int nIndex = pIndexOf(sTest); - if (nIndex < 0) - return false; - if (nIndex >= (int)GetLineCount() ) - return false; - - GetLine(nIndex) = GetLine(nIndex).Prepend(wxT("#")); - return true; - } - - wxString GetVerb(size_t i) - { - if (i > GetLineCount() ) - return wxEmptyString; - - wxString sTmp = GetLine(i).BeforeFirst(wxT('=')); - return sTmp; - } - - wxString GetCmd(size_t i) - { - if (i > GetLineCount() ) - return wxEmptyString; - - wxString sTmp = GetLine(i).AfterFirst(wxT('=')); - return sTmp; - } - - // Get line number of line starting with sSearch followed by = and return - // the string after the = - int GetCmd(const wxString& sSearch, wxString &cmd) - { - const size_t len = sSearch.Len(); - - for(size_t i = 0; i < GetLineCount(); i++) - { - wxString& sLine = GetLine(i); - sLine.Trim(false); - if (sLine.StartsWith(wxT("#"))) - continue; - if (sLine.Len() <= len) - continue; - - if (sLine[len] != '=') - continue; - - if (sLine.Left(len).CmpNoCase(sSearch)) - continue; - - cmd = sLine.Mid(len + 1); - return (int)i; - } - - return wxNOT_FOUND; - } - -protected: - // we override this virtual method because we want to always use UTF-8 - // conversion allowing for invalid characters as MIME information files - // often contain lines in different encodings and can't be read using any - // single conversion in Unicode build, so we just try to read what we can - // suing the most common encoding (UTF-8 is almost ubiquitous nowadays) and - // ignore the rest - virtual bool OnRead(const wxMBConv& WXUNUSED(conv)) - { - return wxTextFile::OnRead( -#if wxUSE_WCHAR_T - wxMBConvUTF8(wxMBConvUTF8::MAP_INVALID_UTF8_TO_PUA) -#else - wxMBConv() -#endif // wxUSE_WCHAR_T/!wxUSE_WCHAR_T - ); - } -}; - -// in case we're compiling in non-GUI mode -class WXDLLEXPORT wxIcon; - -// ---------------------------------------------------------------------------- -// constants -// ---------------------------------------------------------------------------- - -// MIME code tracing mask -#define TRACE_MIME wxT("mime") - -// give trace messages about the results of mailcap tests -#define TRACE_MIME_TEST wxT("mimetest") - -// ---------------------------------------------------------------------------- -// private functions -// ---------------------------------------------------------------------------- - -// there are some fields which we don't understand but for which we don't give -// warnings as we know that they're not important - this function is used to -// test for them -static bool IsKnownUnimportantField(const wxString& field); - -// ---------------------------------------------------------------------------- -// private classes -// ---------------------------------------------------------------------------- - - -// This class uses both mailcap and mime.types to gather information about file -// types. -// -// The information about mailcap file was extracted from metamail(1) sources -// and documentation and subsequently revised when I found the RFC 1524 -// describing it. -// -// Format of mailcap file: spaces are ignored, each line is either a comment -// (starts with '#') or a line of the form ;;...;. -// A backslash can be used to quote semicolons and newlines (and, in fact, -// anything else including itself). -// -// The first field is always the MIME type in the form of type/subtype (see RFC -// 822) where subtype may be '*' meaning "any". Following metamail, we accept -// "type" which means the same as "type/*", although I'm not sure whether this -// is standard. -// -// The second field is always the command to run. It is subject to -// parameter/filename expansion described below. -// -// All the following fields are optional and may not be present at all. If -// they're present they may appear in any order, although each of them should -// appear only once. The optional fields are the following: -// * notes=xxx is an uninterpreted string which is silently ignored -// * test=xxx is the command to be used to determine whether this mailcap line -// applies to our data or not. The RHS of this field goes through the -// parameter/filename expansion (as the 2nd field) and the resulting string -// is executed. The line applies only if the command succeeds, i.e. returns 0 -// exit code. -// * print=xxx is the command to be used to print (and not view) the data of -// this type (parameter/filename expansion is done here too) -// * edit=xxx is the command to open/edit the data of this type -// * needsterminal means that a new interactive console must be created for -// the viewer -// * copiousoutput means that the viewer doesn't interact with the user but -// produces (possibly) a lof of lines of output on stdout (i.e. "cat" is a -// good example), thus it might be a good idea to use some kind of paging -// mechanism. -// * textualnewlines means not to perform CR/LF translation (not honored) -// * compose and composetyped fields are used to determine the program to be -// called to create a new message pert in the specified format (unused). -// -// Parameter/filename expansion: -// * %s is replaced with the (full) file name -// * %t is replaced with MIME type/subtype of the entry -// * for multipart type only %n is replaced with the nnumber of parts and %F is -// replaced by an array of (content-type, temporary file name) pairs for all -// message parts (TODO) -// * %{parameter} is replaced with the value of parameter taken from -// Content-type header line of the message. -// -// -// There are 2 possible formats for mime.types file, one entry per line (used -// for global mime.types and called Mosaic format) and "expanded" format where -// an entry takes multiple lines (used for users mime.types and called -// Netscape format). -// -// For both formats spaces are ignored and lines starting with a '#' are -// comments. Each record has one of two following forms: -// a) for "brief" format: -// -// b) for "expanded" format: -// type= BACKSLASH -// desc="" BACKSLASH -// exts="" -// -// (where BACKSLASH is a literal '\\' which we can't put here because cpp -// misinterprets it) -// -// We try to autodetect the format of mime.types: if a non-comment line starts -// with "type=" we assume the second format, otherwise the first one. - -// there may be more than one entry for one and the same mime type, to -// choose the right one we have to run the command specified in the test -// field on our data. - -// ---------------------------------------------------------------------------- -// wxGNOME -// ---------------------------------------------------------------------------- - -// GNOME stores the info we're interested in in several locations: -// 1. xxx.keys files under /usr/share/mime-info -// 2. xxx.keys files under ~/.gnome/mime-info -// -// Update (Chris Elliott): apparently there may be an optional "[lang]" prefix -// just before the field name. - - -void wxMimeTypesManagerImpl::LoadGnomeDataFromKeyFile(const wxString& filename, - const wxArrayString& dirs) -{ - wxMimeTextFile textfile(filename); - if ( !textfile.Open() ) - return; - - wxLogTrace(TRACE_MIME, wxT("--- Opened Gnome file %s ---"), - filename.c_str()); - - wxArrayString search_dirs( dirs ); - - // values for the entry being parsed - wxString curMimeType, curIconFile; - wxMimeTypeCommands * entry = new wxMimeTypeCommands; - - wxArrayString strExtensions; - wxString strDesc; - - const wxChar *pc; - size_t nLineCount = textfile.GetLineCount(); - size_t nLine = 0; - while ( nLine < nLineCount ) - { - pc = textfile[nLine].c_str(); - if ( *pc != wxT('#') ) - { - - wxLogTrace(TRACE_MIME, wxT("--- Reading from Gnome file %s '%s' ---"), - filename.c_str(), pc); - - // trim trailing space and tab - while ((*pc == wxT(' ')) || (*pc == wxT('\t'))) - pc++; - - wxString sTmp(pc); - int equal_pos = sTmp.Find( wxT('=') ); - if (equal_pos > 0) - { - wxString left_of_equal = sTmp.Left( equal_pos ); - const wxChar *right_of_equal = pc; - right_of_equal += equal_pos+1; - - if (left_of_equal == wxT("icon_filename")) - { - // GNOME 2: - curIconFile = right_of_equal; - - wxFileName newFile( curIconFile ); - if (newFile.IsRelative() || newFile.FileExists()) - { - size_t nDirs = search_dirs.GetCount(); - - for (size_t nDir = 0; nDir < nDirs; nDir++) - { - newFile.SetPath( search_dirs[nDir] ); - newFile.AppendDir( wxT("pixmaps") ); - newFile.AppendDir( wxT("document-icons") ); - newFile.SetExt( wxT("png") ); - if (newFile.FileExists()) - { - curIconFile = newFile.GetFullPath(); - // reorder search_dirs for speedup (fewer - // calls to FileExist() required) - if (nDir != 0) - { - const wxString &tmp = search_dirs[nDir]; - search_dirs.RemoveAt( nDir ); - search_dirs.Insert( tmp, 0 ); - } - break; - } - } - } - } - else if (left_of_equal == wxT("open")) - { - sTmp = right_of_equal; - sTmp.Replace( wxT("%f"), wxT("%s") ); - sTmp.Prepend( wxT("open=") ); - entry->Add(sTmp); - } - else if (left_of_equal == wxT("view")) - { - sTmp = right_of_equal; - sTmp.Replace( wxT("%f"), wxT("%s") ); - sTmp.Prepend( wxT("view=") ); - entry->Add(sTmp); - } - else if (left_of_equal == wxT("print")) - { - sTmp = right_of_equal; - sTmp.Replace( wxT("%f"), wxT("%s") ); - sTmp.Prepend( wxT("print=") ); - entry->Add(sTmp); - } - else if (left_of_equal == wxT("description")) - { - strDesc = right_of_equal; - } - else if (left_of_equal == wxT("short_list_application_ids_for_novice_user_level")) - { - sTmp = right_of_equal; - if (sTmp.Contains( wxT(",") )) - sTmp = sTmp.BeforeFirst( wxT(',') ); - sTmp.Prepend( wxT("open=") ); - sTmp.Append( wxT(" %s") ); - entry->Add(sTmp); - } - - } // emd of has an equals sign - else - { - // not a comment and not an equals sign - if (sTmp.Contains(wxT('/'))) - { - // this is the start of the new mimetype - // overwrite any existing data - if (! curMimeType.empty()) - { - AddToMimeData( curMimeType, curIconFile, entry, strExtensions, strDesc ); - - // now get ready for next bit - entry = new wxMimeTypeCommands; - } - - curMimeType = sTmp.BeforeFirst(wxT(':')); - } - } - } // end of not a comment - - // ignore blank lines - nLine++; - } // end of while, save any data - - if ( curMimeType.empty() ) - delete entry; - else - AddToMimeData( curMimeType, curIconFile, entry, strExtensions, strDesc); -} - -void wxMimeTypesManagerImpl::LoadGnomeMimeTypesFromMimeFile(const wxString& filename) -{ - wxMimeTextFile textfile(filename); - if ( !textfile.Open() ) - return; - - wxLogTrace(TRACE_MIME, - wxT("--- Opened Gnome file %s ---"), - filename.c_str()); - - // values for the entry being parsed - wxString curMimeType, curExtList; - - const wxChar *pc; - size_t nLineCount = textfile.GetLineCount(); - for ( size_t nLine = 0; /* nothing */; nLine++ ) - { - if ( nLine < nLineCount ) - { - pc = textfile[nLine].c_str(); - if ( *pc == wxT('#') ) - { - // skip comments - continue; - } - } - else - { - // so that we will fall into the "if" below - pc = NULL; - } - - if ( !pc || !*pc ) - { - // end of the entry - if ( !curMimeType.empty() && !curExtList.empty() ) - { - wxLogTrace(TRACE_MIME, - wxT("--- At end of Gnome file finding mimetype %s ---"), - curMimeType.c_str()); - - AddMimeTypeInfo(curMimeType, curExtList, wxEmptyString); - } - - if ( !pc ) - { - // the end: this can only happen if nLine == nLineCount - break; - } - - curExtList.Empty(); - - continue; - } - - // what do we have here? - if ( *pc == wxT('\t') ) - { - // this is a field=value ling - pc++; // skip leading TAB - - static const int lenField = 5; // strlen("ext: ") - if ( wxStrncmp(pc, wxT("ext: "), lenField) == 0 ) - { - // skip it and take everything left until the end of line - curExtList = pc + lenField; - } - //else: some other field, we don't care - } - else - { - // this is the start of the new section - wxLogTrace(TRACE_MIME, - wxT("--- In Gnome file finding mimetype %s ---"), - curMimeType.c_str()); - - if (! curMimeType.empty()) - AddMimeTypeInfo(curMimeType, curExtList, wxEmptyString); - - curMimeType.Empty(); - - while ( *pc != wxT(':') && *pc != wxT('\0') ) - { - curMimeType += *pc++; - } - } - } -} - - -void wxMimeTypesManagerImpl::LoadGnomeMimeFilesFromDir( - const wxString& dirbase, const wxArrayString& dirs) -{ - wxASSERT_MSG( !dirbase.empty() && !wxEndsWithPathSeparator(dirbase), - wxT("base directory shouldn't end with a slash") ); - - wxString dirname = dirbase; - dirname << wxT("/mime-info"); - - // Don't complain if we don't have permissions to read - it confuses users - wxLogNull logNull; - - if ( !wxDir::Exists(dirname) ) - return; - - wxDir dir(dirname); - if ( !dir.IsOpened() ) - return; - - // we will concatenate it with filename to get the full path below - dirname += wxT('/'); - - wxString filename; - bool cont; - - cont = dir.GetFirst(&filename, wxT("*.mime"), wxDIR_FILES); - while ( cont ) - { - LoadGnomeMimeTypesFromMimeFile(dirname + filename); - - cont = dir.GetNext(&filename); - } - - cont = dir.GetFirst(&filename, wxT("*.keys"), wxDIR_FILES); - while ( cont ) - { - LoadGnomeDataFromKeyFile(dirname + filename, dirs); - - cont = dir.GetNext(&filename); - } - - // FIXME: Hack alert: We scan all icons and deduce the - // mime-type from the file name. - dirname = dirbase; - dirname << wxT("/pixmaps/document-icons"); - - // these are always empty in this file - wxArrayString strExtensions; - wxString strDesc; - - if ( !wxDir::Exists(dirname) ) - { - // Just test for default GPE dir also - dirname = wxT("/usr/share/gpe/pixmaps/default/filemanager/document-icons"); - - if ( !wxDir::Exists(dirname) ) - return; - } - - wxDir dir2( dirname ); - - cont = dir2.GetFirst(&filename, wxT("gnome-*.png"), wxDIR_FILES); - while ( cont ) - { - wxString mimeType = filename; - mimeType.Remove( 0, 6 ); // remove "gnome-" - mimeType.Remove( mimeType.Len() - 4, 4 ); // remove ".png" - int pos = mimeType.Find( wxT("-") ); - if (pos != wxNOT_FOUND) - { - mimeType.SetChar( pos, wxT('/') ); - wxString iconFile = dirname; - iconFile << wxT("/"); - iconFile << filename; - AddToMimeData( mimeType, iconFile, NULL, strExtensions, strDesc, true ); - } - - cont = dir2.GetNext(&filename); - } -} - -void wxMimeTypesManagerImpl::GetGnomeMimeInfo(const wxString& sExtraDir) -{ - wxArrayString dirs; - - wxString gnomedir = wxGetenv( wxT("GNOMEDIR") ); - if (!gnomedir.empty()) - { - gnomedir << wxT("/share"); - dirs.Add( gnomedir ); - } - - dirs.Add(wxT("/usr/share")); - dirs.Add(wxT("/usr/local/share")); - - gnomedir = wxGetHomeDir(); - gnomedir << wxT("/.gnome"); - dirs.Add( gnomedir ); - - if (!sExtraDir.empty()) - dirs.Add( sExtraDir ); - - size_t nDirs = dirs.GetCount(); - for ( size_t nDir = 0; nDir < nDirs; nDir++ ) - { - LoadGnomeMimeFilesFromDir(dirs[nDir], dirs); - } -} - -// ---------------------------------------------------------------------------- -// KDE -// ---------------------------------------------------------------------------- - - -// KDE stores the icon info in its .kdelnk files. The file for mimetype/subtype -// may be found in either of the following locations -// -// 1. $KDEDIR/share/mimelnk/mimetype/subtype.kdelnk -// 2. ~/.kde/share/mimelnk/mimetype/subtype.kdelnk -// -// The format of a .kdelnk file is almost the same as the one used by -// wxFileConfig, i.e. there are groups, comments and entries. The icon is the -// value for the entry "Type" - -// kde writing; see http://webcvs.kde.org/cgi-bin/cvsweb.cgi/~checkout~/kdelibs/kio/DESKTOP_ENTRY_STANDARD -// for now write to .kdelnk but should eventually do .desktop instead (in preference??) - -bool wxMimeTypesManagerImpl::CheckKDEDirsExist( const wxString &sOK, const wxString &sTest ) -{ - if (sTest.empty()) - { - return wxDir::Exists(sOK); - } - else - { - wxString sStart = sOK + wxT("/") + sTest.BeforeFirst(wxT('/')); - if (!wxDir::Exists(sStart)) - wxMkdir(sStart); - wxString sEnd = sTest.AfterFirst(wxT('/')); - return CheckKDEDirsExist(sStart, sEnd); - } -} - -bool wxMimeTypesManagerImpl::WriteKDEMimeFile(int index, bool delete_index) -{ - wxMimeTextFile appoutfile, mimeoutfile; - wxString sHome = wxGetHomeDir(); - wxString sTmp = wxT(".kde/share/mimelnk/"); - wxString sMime = m_aTypes[index]; - CheckKDEDirsExist(sHome, sTmp + sMime.BeforeFirst(wxT('/')) ); - sTmp = sHome + wxT('/') + sTmp + sMime + wxT(".kdelnk"); - - bool bTemp; - bool bMimeExists = mimeoutfile.Open(sTmp); - if (!bMimeExists) - { - bTemp = mimeoutfile.Create(sTmp); - // some unknown error eg out of disk space - if (!bTemp) - return false; - } - - sTmp = wxT(".kde/share/applnk/"); - CheckKDEDirsExist(sHome, sTmp + sMime.AfterFirst(wxT('/')) ); - sTmp = sHome + wxT('/') + sTmp + sMime.AfterFirst(wxT('/')) + wxT(".kdelnk"); - - bool bAppExists; - bAppExists = appoutfile.Open(sTmp); - if (!bAppExists) - { - bTemp = appoutfile.Create(sTmp); - // some unknown error eg out of disk space - if (!bTemp) - return false; - } - - // fixed data; write if new file - if (!bMimeExists) - { - mimeoutfile.AddLine(wxT("#KDE Config File")); - mimeoutfile.AddLine(wxT("[KDE Desktop Entry]")); - mimeoutfile.AddLine(wxT("Version=1.0")); - mimeoutfile.AddLine(wxT("Type=MimeType")); - mimeoutfile.AddLine(wxT("MimeType=") + sMime); - } - - if (!bAppExists) - { - mimeoutfile.AddLine(wxT("#KDE Config File")); - mimeoutfile.AddLine(wxT("[KDE Desktop Entry]")); - appoutfile.AddLine(wxT("Version=1.0")); - appoutfile.AddLine(wxT("Type=Application")); - appoutfile.AddLine(wxT("MimeType=") + sMime + wxT(';')); - } - - // variable data - // ignore locale - mimeoutfile.CommentLine(wxT("Comment=")); - if (!delete_index) - mimeoutfile.AddLine(wxT("Comment=") + m_aDescriptions[index]); - appoutfile.CommentLine(wxT("Name=")); - if (!delete_index) - appoutfile.AddLine(wxT("Comment=") + m_aDescriptions[index]); - - sTmp = m_aIcons[index]; - // we can either give the full path, or the shortfilename if its in - // one of the directories we search - mimeoutfile.CommentLine(wxT("Icon=") ); - if (!delete_index) - mimeoutfile.AddLine(wxT("Icon=") + sTmp ); - appoutfile.CommentLine(wxT("Icon=") ); - if (!delete_index) - appoutfile.AddLine(wxT("Icon=") + sTmp ); - - sTmp = wxT(" ") + m_aExtensions[index]; - - wxStringTokenizer tokenizer(sTmp, wxT(" ")); - sTmp = wxT("Patterns="); - mimeoutfile.CommentLine(sTmp); - while ( tokenizer.HasMoreTokens() ) - { - // holds an extension; need to change it to *.ext; - wxString e = wxT("*.") + tokenizer.GetNextToken() + wxT(";"); - sTmp += e; - } - - if (!delete_index) - mimeoutfile.AddLine(sTmp); - - wxMimeTypeCommands * entries = m_aEntries[index]; - // if we don't find open just have an empty string ... FIX this - sTmp = entries->GetCommandForVerb(wxT("open")); - sTmp.Replace( wxT("%s"), wxT("%f") ); - - mimeoutfile.CommentLine(wxT("DefaultApp=") ); - if (!delete_index) - mimeoutfile.AddLine(wxT("DefaultApp=") + sTmp); - - sTmp.Replace( wxT("%f"), wxT("") ); - appoutfile.CommentLine(wxT("Exec=")); - if (!delete_index) - appoutfile.AddLine(wxT("Exec=") + sTmp); - - if (entries->GetCount() > 1) - { - //other actions as well as open - } - - bTemp = false; - if (mimeoutfile.Write()) - bTemp = true; - mimeoutfile.Close(); - if (appoutfile.Write()) - bTemp = true; - appoutfile.Close(); - - return bTemp; -} - -void wxMimeTypesManagerImpl::LoadKDELinksForMimeSubtype(const wxString& dirbase, - const wxString& subdir, - const wxString& filename, - const wxArrayString& icondirs) -{ - wxFileName fullname(dirbase, filename); - wxLogTrace(TRACE_MIME, wxT("loading KDE file %s"), - fullname.GetFullPath().c_str()); - - wxMimeTextFile file; - if ( !file.Open(fullname.GetFullPath()) ) - return; - - wxMimeTypeCommands * entry = new wxMimeTypeCommands; - wxArrayString sExts; - wxString mimetype, mime_desc, strIcon; - - - int nIndex = file.GetCmd( wxT("MimeType"), mimetype ); - if (nIndex == wxNOT_FOUND) - { - // construct mimetype from the directory name and the basename of the - // file (it always has .kdelnk extension) - mimetype << subdir << wxT('/') << filename.BeforeLast( wxT('.') ); - } - - // first find the description string: it is the value in either "Comment=" - // line or "Comment[]=" one - nIndex = wxNOT_FOUND; - - wxString comment; - -#if wxUSE_INTL - wxLocale *locale = wxGetLocale(); - if ( locale ) - { - // try "Comment[locale name]" first - comment << wxT("Comment[") + locale->GetName() + wxT("]"); - nIndex = file.GetCmd(comment, mime_desc); - } -#endif - - if ( nIndex == wxNOT_FOUND ) - file.GetCmd(wxT("Comment"), mime_desc); - - //else: no description - - // next find the extensions - wxString mime_extension; - - wxString exts; - nIndex = file.GetCmd(wxT("Patterns"), exts); - if ( nIndex != wxNOT_FOUND ) - { - wxStringTokenizer tokenizer(exts, wxT(";")); - while ( tokenizer.HasMoreTokens() ) - { - wxString e = tokenizer.GetNextToken(); - - // don't support too difficult patterns - if ( e.Left(2) != wxT("*.") ) - continue; - - if ( !mime_extension.empty() ) - { - // separate from the previous ext - mime_extension << wxT(' '); - } - - mime_extension << e.Mid(2); - } - } - - sExts.Add(mime_extension); - - // ok, now we can take care of icon: - - nIndex = file.GetCmd(wxT("Icon"), strIcon); - if ( nIndex != wxNOT_FOUND ) - { - wxLogTrace(TRACE_MIME, wxT(" icon %s"), strIcon.c_str()); - - // it could be the real path, but more often a short name - if (!wxFileExists(strIcon)) - { - // icon is just the short name - if ( !strIcon.empty() ) - { - // we must check if the file exists because it may be stored - // in many locations, at least ~/.kde and $KDEDIR - size_t nDir, nDirs = icondirs.GetCount(); - for ( nDir = 0; nDir < nDirs; nDir++ ) - { - wxFileName fnameIcon( strIcon ); - wxFileName fname( icondirs[nDir], fnameIcon.GetName() ); - fname.SetExt( wxT("png") ); - if (fname.FileExists()) - { - strIcon = fname.GetFullPath(); - wxLogTrace(TRACE_MIME, wxT(" iconfile %s"), strIcon.c_str()); - break; - } - } - } - } - } - - // now look for lines which know about the application - // exec= or DefaultApp= - - wxString sTmp; - nIndex = file.GetCmd(wxT("DefaultApp"), sTmp); - - if ( nIndex == wxNOT_FOUND ) - { - // no entry try exec - nIndex = file.GetCmd(wxT("Exec"), sTmp); - } - - if ( nIndex != wxNOT_FOUND ) - { - // we expect %f; others including %F and %U and %u are possible - if (0 == sTmp.Replace( wxT("%f"), wxT("%s") )) - sTmp += wxT(" %s"); - entry->AddOrReplaceVerb(wxString(wxT("open")), sTmp ); - } - - AddToMimeData(mimetype, strIcon, entry, sExts, mime_desc); -} - -void wxMimeTypesManagerImpl::LoadKDELinksForMimeType(const wxString& dirbase, - const wxString& subdir, - const wxArrayString& icondirs) -{ - wxFileName dirname(dirbase, wxEmptyString); - dirname.AppendDir(subdir); - - // Don't complain if we don't have permissions to read - it confuses users - wxLogNull logNull; - - wxDir dir(dirname.GetPath()); - if(! dir.IsOpened()) - return; - - wxLogTrace(TRACE_MIME, wxT("--- Loading from KDE directory %s ---"), - dirname.GetPath().c_str()); - - wxString filename; - bool cont = dir.GetFirst(&filename, wxT("*.kdelnk"), wxDIR_FILES); - while(cont) { - LoadKDELinksForMimeSubtype(dirname.GetPath(), subdir, - filename, icondirs); - cont = dir.GetNext(&filename); - } - - // new standard for Gnome and KDE - cont = dir.GetFirst(&filename, wxT("*.desktop"), wxDIR_FILES); - while(cont) { - LoadKDELinksForMimeSubtype(dirname.GetPath(), subdir, - filename, icondirs); - cont = dir.GetNext(&filename); - } -} - -void wxMimeTypesManagerImpl::LoadKDELinkFilesFromDir(const wxString& dirname, - const wxArrayString& icondirs) -{ - // Don't complain if we don't have permissions to read - it confuses users - wxLogNull logNull; - - if(! wxDir::Exists(dirname)) - return; - - wxDir dir(dirname); - if ( !dir.IsOpened() ) - return; - - wxString subdir; - bool cont = dir.GetFirst(&subdir, wxEmptyString, wxDIR_DIRS); - while ( cont ) - { - LoadKDELinksForMimeType(dirname, subdir, icondirs); - - cont = dir.GetNext(&subdir); - } -} - -// Read a KDE .desktop file of type 'Application' -void wxMimeTypesManagerImpl::LoadKDEApp(const wxString& filename) -{ - wxLogTrace(TRACE_MIME, wxT("loading KDE file %s"), filename.c_str()); - - wxMimeTextFile file; - if ( !file.Open(filename) ) - return; - - // Here, only type 'Application' should be considered. - wxString type; - int nIndex = file.GetCmd( wxT("Type"), type); - if (nIndex != wxNOT_FOUND && - type.CmpNoCase(wxT("application"))) - return; - - // The hidden entry specifies a file to be ignored. - wxString hidden; - nIndex = file.GetCmd( wxT("Hidden"), hidden); - if (nIndex != wxNOT_FOUND && !hidden.CmpNoCase(wxT("true"))) - return; - - // Semicolon separated list of mime types handled by the application. - wxString mimetypes; - nIndex = file.GetCmd( wxT("MimeType"), mimetypes ); - if (nIndex == wxNOT_FOUND) - return; - - // Name of the application - wxString nameapp; - nIndex = wxNOT_FOUND; -#if wxUSE_INTL // try "Name[locale name]" first - wxLocale *locale = wxGetLocale(); - if ( locale ) - nIndex = file.GetCmd(_T("Name[")+locale->GetName()+_T("]"), nameapp); -#endif // wxUSE_INTL - if(nIndex == wxNOT_FOUND) - nIndex = file.GetCmd( wxT("Name"), nameapp); - - // Icon of the application. - wxString icon; - wxString nameicon, namemini; - nIndex = wxNOT_FOUND; -#if wxUSE_INTL // try "Icon[locale name]" first - if ( locale ) - nIndex = file.GetCmd(_T("Icon[")+locale->GetName()+_T("]"), icon); -#endif // wxUSE_INTL - if(nIndex == wxNOT_FOUND) - nIndex = file.GetCmd( wxT("Icon"), icon); - if(nIndex != wxNOT_FOUND) { - nameicon = wxString(wxT("--icon ")) + icon; - namemini = wxString(wxT("--miniicon ")) + icon; - } - - // Replace some of the field code in the 'Exec' entry. - // TODO: deal with %d, %D, %n, %N, %k and %v (but last one is deprecated) - wxString sCmd; - nIndex = file.GetCmd( wxT("Exec"), sCmd ); - if (nIndex == wxNOT_FOUND) - return; - // we expect %f; others including %F and %U and %u are possible - sCmd.Replace(wxT("%F"), wxT("%f")); - sCmd.Replace(wxT("%U"), wxT("%f")); - sCmd.Replace(wxT("%u"), wxT("%f")); - if (0 == sCmd.Replace ( wxT("%f"), wxT("%s") )) - sCmd = sCmd + wxT(" %s"); - sCmd.Replace(wxT("%c"), nameapp); - sCmd.Replace(wxT("%i"), nameicon); - sCmd.Replace(wxT("%m"), namemini); - - wxStringTokenizer tokenizer(mimetypes, _T(";")); - while(tokenizer.HasMoreTokens()) { - wxString mimetype = tokenizer.GetNextToken().Lower(); - int nIndex = m_aTypes.Index(mimetype); - if(nIndex != wxNOT_FOUND) { // is this a known MIME type? - wxMimeTypeCommands* entry = m_aEntries[nIndex]; - entry->AddOrReplaceVerb(wxT("open"), sCmd); - } - } -} - -void wxMimeTypesManagerImpl::LoadKDEAppsFilesFromDir(const wxString& dirname) -{ - // Don't complain if we don't have permissions to read - it confuses users - wxLogNull logNull; - - if(! wxDir::Exists(dirname)) - return; - wxDir dir(dirname); - if ( !dir.IsOpened() ) - return; - - wxString filename; - // Look into .desktop files - bool cont = dir.GetFirst(&filename, _T("*.desktop"), wxDIR_FILES); - while(cont) { - wxFileName p(dirname, filename); - LoadKDEApp( p.GetFullPath() ); - cont = dir.GetNext(&filename); - } - // Look recursively into subdirs - cont = dir.GetFirst(&filename, wxEmptyString, wxDIR_DIRS); - while(cont) { - wxFileName p(dirname, wxEmptyString); - p.AppendDir(filename); - LoadKDEAppsFilesFromDir( p.GetPath() ); - cont = dir.GetNext(&filename); - } -} - -// Return base KDE directories. -// 1) Environment variable $KDEHOME, or "~/.kde" if not set. -// 2) List of directories in colon separated environment variable $KDEDIRS. -// 3) Environment variable $KDEDIR in case $KDEDIRS is not set. -// Notice at least the local kde directory is added to the list. If it is the -// only one, use later the application 'kde-config' to get additional paths. -static void GetKDEBaseDirs(wxArrayString& basedirs) -{ - wxString env = wxGetenv( wxT("KDEHOME") ); - if(env.IsEmpty()) - env = wxGetHomeDir() + wxT("/.kde"); - basedirs.Add(env); - - env = wxGetenv( wxT("KDEDIRS") ); - if(env.IsEmpty()) { - env = wxGetenv( wxT("KDEDIR") ); - if(! env.IsEmpty()) - basedirs.Add(env); - } else { - wxStringTokenizer tokenizer(env, wxT(":")); - while(tokenizer.HasMoreTokens()) - basedirs.Add( tokenizer.GetNextToken() ); - } -} - -static wxString ReadPathFromKDEConfig(const wxString& request) -{ - wxString str; - wxArrayString output; - if(wxExecute(wxT("kde-config --path ")+request, output) == 0 && - output.Count() > 0) - str = output.Item(0); - return str; -} - -// Try to find the "Theme" entry in the configuration file, provided it exists. -static wxString GetKDEThemeInFile(const wxFileName& filename) -{ - wxString theme; - wxMimeTextFile config; - if ( filename.FileExists() && config.Open(filename.GetFullPath()) ) - { - size_t cnt = config.GetLineCount(); - for ( size_t i = 0; i < cnt; i++ ) - { - if ( config[i].StartsWith(wxT("Theme="), &theme) ) - break; - } - } - - return theme; -} - -// Try to find a file "kdeglobals" in one of the directories and read the -// "Theme" entry there. -static wxString GetKDETheme(const wxArrayString& basedirs) -{ - wxString theme; - for(size_t i = 0; i < basedirs.Count(); i++) { - wxFileName filename(basedirs.Item(i), wxEmptyString); - filename.AppendDir( wxT("share") ); - filename.AppendDir( wxT("config") ); - filename.SetName( wxT("kdeglobals") ); - theme = GetKDEThemeInFile(filename); - if(! theme.IsEmpty()) - return theme; - } - // If $KDEDIRS and $KDEDIR were set, we try nothing more. Otherwise, we - // try to get the configuration file with 'kde-config'. - if(basedirs.Count() > 1) - return theme; - wxString paths = ReadPathFromKDEConfig(wxT("config")); - if(! paths.IsEmpty()) { - wxStringTokenizer tokenizer(paths, wxT(":")); - while( tokenizer.HasMoreTokens() ) { - wxFileName filename(tokenizer.GetNextToken(), wxT("kdeglobals")); - theme = GetKDEThemeInFile(filename); - if(! theme.IsEmpty()) - return theme; - } - } - return theme; -} - -// Get list of directories of icons. -static void GetKDEIconDirs(const wxArrayString& basedirs, - wxArrayString& icondirs) -{ - wxString theme = GetKDETheme(basedirs); - if(theme.IsEmpty()) - theme = wxT("default.kde"); - - for(size_t i = 0; i < basedirs.Count(); i++) { - wxFileName dirname(basedirs.Item(i), wxEmptyString); - dirname.AppendDir( wxT("share") ); - dirname.AppendDir( wxT("icons") ); - dirname.AppendDir(theme); - dirname.AppendDir( wxT("32x32") ); - dirname.AppendDir( wxT("mimetypes") ); - if( wxDir::Exists( dirname.GetPath() ) ) - icondirs.Add( dirname.GetPath() ); - } - - // If $KDEDIRS and $KDEDIR were not set, use 'kde-config' - if(basedirs.Count() > 1) - return; - wxString paths = ReadPathFromKDEConfig(wxT("icon")); - if(! paths.IsEmpty()) { - wxStringTokenizer tokenizer(paths, wxT(":")); - while( tokenizer.HasMoreTokens() ) { - wxFileName dirname(tokenizer.GetNextToken(), wxEmptyString); - dirname.AppendDir(theme); - dirname.AppendDir( wxT("32x32") ); - dirname.AppendDir( wxT("mimetypes") ); - if(icondirs.Index(dirname.GetPath()) == wxNOT_FOUND && - wxDir::Exists( dirname.GetPath() ) ) - icondirs.Add( dirname.GetPath() ); - } - } -} - -// Get list of directories of mime types. -static void GetKDEMimeDirs(const wxArrayString& basedirs, - wxArrayString& mimedirs) -{ - for(size_t i = 0; i < basedirs.Count(); i++) { - wxFileName dirname(basedirs.Item(i), wxEmptyString); - dirname.AppendDir( wxT("share") ); - dirname.AppendDir( wxT("mimelnk") ); - if( wxDir::Exists( dirname.GetPath() ) ) - mimedirs.Add( dirname.GetPath() ); - } - - // If $KDEDIRS and $KDEDIR were not set, use 'kde-config' - if(basedirs.Count() > 1) - return; - wxString paths = ReadPathFromKDEConfig(wxT("mime")); - if(! paths.IsEmpty()) { - wxStringTokenizer tokenizer(paths, wxT(":")); - while( tokenizer.HasMoreTokens() ) { - wxFileName p(tokenizer.GetNextToken(), wxEmptyString); - wxString dirname = p.GetPath(); // To remove possible trailing '/' - if(mimedirs.Index(dirname) == wxNOT_FOUND && - wxDir::Exists(dirname) ) - mimedirs.Add(dirname); - } - } -} - -// Get list of directories of application desktop files. -static void GetKDEAppsDirs(const wxArrayString& basedirs, - wxArrayString& appsdirs) -{ - for(size_t i = 0; i < basedirs.Count(); i++) { - wxFileName dirname(basedirs.Item(i), wxEmptyString); - dirname.AppendDir( wxT("share") ); - dirname.AppendDir( wxT("applnk") ); - if( wxDir::Exists( dirname.GetPath() ) ) - appsdirs.Add( dirname.GetPath() ); - } - - // If $KDEDIRS and $KDEDIR were not set, use 'kde-config' - if(basedirs.Count() > 1) - return; - wxString paths = ReadPathFromKDEConfig(wxT("apps")); - if(! paths.IsEmpty()) { - wxStringTokenizer tokenizer(paths, wxT(":")); - while( tokenizer.HasMoreTokens() ) { - wxFileName p(tokenizer.GetNextToken(), wxEmptyString); - wxString dirname = p.GetPath(); // To remove possible trailing '/' - if(appsdirs.Index(dirname) == wxNOT_FOUND && - wxDir::Exists(dirname) ) - appsdirs.Add(dirname); - } - } - paths = ReadPathFromKDEConfig(wxT("xdgdata-apps")); - if(! paths.IsEmpty()) { - wxStringTokenizer tokenizer(paths, wxT(":")); - while( tokenizer.HasMoreTokens() ) { - wxFileName p(tokenizer.GetNextToken(), wxEmptyString); - wxString dirname = p.GetPath(); // To remove possible trailing '/' - if(appsdirs.Index(dirname) == wxNOT_FOUND && - wxDir::Exists(dirname) ) - appsdirs.Add(dirname); - } - } -} - -// Fill database with all mime types. -void wxMimeTypesManagerImpl::GetKDEMimeInfo(const wxString& sExtraDir) -{ - wxArrayString basedirs; - GetKDEBaseDirs(basedirs); - - wxArrayString icondirs; - GetKDEIconDirs(basedirs, icondirs); - wxArrayString mimedirs; - GetKDEMimeDirs(basedirs, mimedirs); - wxArrayString appsdirs; - GetKDEAppsDirs(basedirs, appsdirs); - - if(! sExtraDir.IsEmpty()) { - icondirs.Add(sExtraDir + wxT("/icons")); - mimedirs.Add(sExtraDir + wxT("/mimelnk")); - appsdirs.Add(sExtraDir + wxT("/applnk")); - } - - // Load mime types - size_t nDirs = mimedirs.GetCount(), nDir; - for(nDir = 0; nDir < nDirs; nDir++) - LoadKDELinkFilesFromDir(mimedirs[nDir], icondirs); - - // Load application files and associate them to corresponding mime types. - nDirs = appsdirs.GetCount(); - for(nDir = 0; nDir < nDirs; nDir++) - LoadKDEAppsFilesFromDir(appsdirs[nDir]); -} - -// ---------------------------------------------------------------------------- -// wxFileTypeImpl (Unix) -// ---------------------------------------------------------------------------- - -wxString wxFileTypeImpl::GetExpandedCommand(const wxString & verb, const wxFileType::MessageParameters& params) const -{ - wxString sTmp; - size_t i = 0; - while ( (i < m_index.GetCount() ) && sTmp.empty() ) - { - sTmp = m_manager->GetCommand( verb, m_index[i] ); - i++; - } - - return wxFileType::ExpandCommand(sTmp, params); -} - -bool wxFileTypeImpl::GetIcon(wxIconLocation *iconLoc) const -{ - wxString sTmp; - size_t i = 0; - while ( (i < m_index.GetCount() ) && sTmp.empty() ) - { - sTmp = m_manager->m_aIcons[m_index[i]]; - i++; - } - - if ( sTmp.empty() ) - return false; - - if ( iconLoc ) - { - iconLoc->SetFileName(sTmp); - } - - return true; -} - -bool wxFileTypeImpl::GetMimeTypes(wxArrayString& mimeTypes) const -{ - mimeTypes.Clear(); - size_t nCount = m_index.GetCount(); - for (size_t i = 0; i < nCount; i++) - mimeTypes.Add(m_manager->m_aTypes[m_index[i]]); - - return true; -} - -size_t wxFileTypeImpl::GetAllCommands(wxArrayString *verbs, - wxArrayString *commands, - const wxFileType::MessageParameters& params) const -{ - wxString vrb, cmd, sTmp; - size_t count = 0; - wxMimeTypeCommands * sPairs; - - // verbs and commands have been cleared already in mimecmn.cpp... - // if we find no entries in the exact match, try the inexact match - for (size_t n = 0; ((count == 0) && (n < m_index.GetCount())); n++) - { - // list of verb = command pairs for this mimetype - sPairs = m_manager->m_aEntries [m_index[n]]; - size_t i; - for ( i = 0; i < sPairs->GetCount(); i++ ) - { - vrb = sPairs->GetVerb(i); - // some gnome entries have "." inside - vrb = vrb.AfterLast(wxT('.')); - cmd = sPairs->GetCmd(i); - if (! cmd.empty() ) - { - cmd = wxFileType::ExpandCommand(cmd, params); - count++; - if ( vrb.IsSameAs(wxT("open"))) - { - if ( verbs ) - verbs->Insert(vrb, 0u); - if ( commands ) - commands ->Insert(cmd, 0u); - } - else - { - if ( verbs ) - verbs->Add(vrb); - if ( commands ) - commands->Add(cmd); - } - } - } - } - - return count; -} - -bool wxFileTypeImpl::GetExtensions(wxArrayString& extensions) -{ - wxString strExtensions = m_manager->GetExtension(m_index[0]); - extensions.Empty(); - - // one extension in the space or comma-delimited list - wxString strExt; - for ( const wxChar *p = strExtensions; /* nothing */; p++ ) - { - if ( *p == wxT(' ') || *p == wxT(',') || *p == wxT('\0') ) - { - if ( !strExt.empty() ) - { - extensions.Add(strExt); - strExt.Empty(); - } - //else: repeated spaces - // (shouldn't happen, but it's not that important if it does happen) - - if ( *p == wxT('\0') ) - break; - } - else if ( *p == wxT('.') ) - { - // remove the dot from extension (but only if it's the first char) - if ( !strExt.empty() ) - { - strExt += wxT('.'); - } - //else: no, don't append it - } - else - { - strExt += *p; - } - } - - return true; -} - -// set an arbitrary command: -// could adjust the code to ask confirmation if it already exists and -// overwriteprompt is true, but this is currently ignored as *Associate* has -// no overwrite prompt -bool -wxFileTypeImpl::SetCommand(const wxString& cmd, - const wxString& verb, - bool WXUNUSED(overwriteprompt)) -{ - wxArrayString strExtensions; - wxString strDesc, strIcon; - - wxArrayString strTypes; - GetMimeTypes(strTypes); - if ( strTypes.IsEmpty() ) - return false; - - wxMimeTypeCommands *entry = new wxMimeTypeCommands(); - entry->Add(verb + wxT("=") + cmd + wxT(" %s ")); - - bool ok = true; - size_t nCount = strTypes.GetCount(); - for ( size_t i = 0; i < nCount; i++ ) - { - if (!m_manager->DoAssociation(strTypes[i], strIcon, entry, strExtensions, strDesc)) - ok = false; - } - - return ok; -} - -// ignore index on the grounds that we only have one icon in a Unix file -bool wxFileTypeImpl::SetDefaultIcon(const wxString& strIcon, int WXUNUSED(index)) -{ - if (strIcon.empty()) - return false; - - wxArrayString strExtensions; - wxString strDesc; - - wxArrayString strTypes; - GetMimeTypes(strTypes); - if ( strTypes.IsEmpty() ) - return false; - - wxMimeTypeCommands *entry = new wxMimeTypeCommands(); - bool ok = true; - size_t nCount = strTypes.GetCount(); - for ( size_t i = 0; i < nCount; i++ ) - { - if ( !m_manager->DoAssociation - ( - strTypes[i], - strIcon, - entry, - strExtensions, - strDesc - ) ) - { - ok = false; - } - } - - return ok; -} - -// ---------------------------------------------------------------------------- -// wxMimeTypesManagerImpl (Unix) -// ---------------------------------------------------------------------------- - -wxMimeTypesManagerImpl::wxMimeTypesManagerImpl() -{ - m_initialized = false; - m_mailcapStylesInited = 0; -} - -void wxMimeTypesManagerImpl::InitIfNeeded() -{ - if ( !m_initialized ) - { - // set the flag first to prevent recursion - m_initialized = true; - - int mailcapStyles = wxMAILCAP_ALL; - if ( wxAppTraits * const traits = wxTheApp ? wxTheApp->GetTraits() - : NULL ) - { - wxString wm = traits->GetDesktopEnvironment(); - - if ( wm == wxT("KDE") ) - mailcapStyles = wxMAILCAP_KDE; - else if ( wm == wxT("GNOME") ) - mailcapStyles = wxMAILCAP_GNOME; - //else: unknown, use the default - } - - Initialize(mailcapStyles); - } -} - -// read system and user mailcaps and other files -void wxMimeTypesManagerImpl::Initialize(int mailcapStyles, - const wxString& sExtraDir) -{ - // read mimecap amd mime.types - if ( (mailcapStyles & wxMAILCAP_NETSCAPE) || - (mailcapStyles & wxMAILCAP_STANDARD) ) - GetMimeInfo(sExtraDir); - - // read GNOME tables - if (mailcapStyles & wxMAILCAP_GNOME) - GetGnomeMimeInfo(sExtraDir); - - // read KDE tables which are never installed on OpenVMS -#ifndef __VMS - if (mailcapStyles & wxMAILCAP_KDE) - GetKDEMimeInfo(sExtraDir); -#endif - - // Load desktop files for Gnome, and then override them with the Gnome defaults. - // We will override them one desktop file at a time, rather - // than one mime type at a time, but it should be a reasonable - // heuristic. - if (mailcapStyles & wxMAILCAP_GNOME) - { - wxString xdgDataHome = wxGetenv(wxT("XDG_DATA_HOME")); - if ( xdgDataHome.empty() ) - xdgDataHome = wxGetHomeDir() + wxT("/.local/share"); - wxString xdgDataDirs = wxGetenv(wxT("XDG_DATA_DIRS")); - if ( xdgDataDirs.empty() ) - xdgDataDirs = wxT("/usr/local/share:/usr/share:/usr/share/gnome"); - wxArrayString dirs; - - wxStringTokenizer tokenizer(xdgDataDirs, wxT(":")); - while ( tokenizer.HasMoreTokens() ) - { - wxString p = tokenizer.GetNextToken(); - dirs.Add(p); - } - dirs.insert(dirs.begin(), xdgDataHome); - - wxString defaultsList; - size_t i; - for (i = 0; i < dirs.GetCount(); i++) - { - wxString f(dirs[i] + wxT("/applications/defaults.list")); - if (wxFileExists(f)) - { - defaultsList = f; - break; - } - } - - // Load application files and associate them to corresponding mime types. - size_t nDirs = dirs.GetCount(); - for (size_t nDir = 0; nDir < nDirs; nDir++) - { - wxString dirStr(dirs[nDir] + wxT("/applications")); - LoadKDEAppsFilesFromDir(dirStr); - } - - if (!defaultsList.IsEmpty()) - { - wxArrayString deskTopFilesSeen; - - wxMimeTextFile textfile(defaultsList); - if ( textfile.Open() ) - { - int nIndex = textfile.pIndexOf( wxT("[Default Applications]") ); - if (nIndex != wxNOT_FOUND) - { - for (i = nIndex+1; i < textfile.GetLineCount(); i++) - { - if (textfile[i].Find(wxT("=")) != wxNOT_FOUND) - { - wxString mimeType = textfile.GetVerb(i); - wxString desktopFile = textfile.GetCmd(i); - - if (deskTopFilesSeen.Index(desktopFile) == wxNOT_FOUND) - { - deskTopFilesSeen.Add(desktopFile); - size_t j; - for (j = 0; j < dirs.GetCount(); j++) - { - wxString desktopPath(dirs[j] + wxT("/applications/") + desktopFile); - if (wxFileExists(desktopPath)) - { - LoadKDEApp(desktopPath); - } - } - } - } - } - } - } - } - } - - m_mailcapStylesInited |= mailcapStyles; -} - -// clear data so you can read another group of WM files -void wxMimeTypesManagerImpl::ClearData() -{ - m_aTypes.Clear(); - m_aIcons.Clear(); - m_aExtensions.Clear(); - m_aDescriptions.Clear(); - - WX_CLEAR_ARRAY(m_aEntries); - m_aEntries.Empty(); - - m_mailcapStylesInited = 0; -} - -wxMimeTypesManagerImpl::~wxMimeTypesManagerImpl() -{ - ClearData(); -} - -void wxMimeTypesManagerImpl::GetMimeInfo(const wxString& sExtraDir) -{ - // read this for netscape or Metamail formats - - // directories where we look for mailcap and mime.types by default - // used by netscape and pine and other mailers, using 2 different formats! - - // (taken from metamail(1) sources) - // - // although RFC 1524 specifies the search path of - // /etc/:/usr/etc:/usr/local/etc only, it doesn't hurt to search in more - // places - OTOH, the RFC also says that this path can be changed with - // MAILCAPS environment variable (containing the colon separated full - // filenames to try) which is not done yet (TODO?) - - wxString strHome = wxGetenv(wxT("HOME")); - - wxArrayString dirs; - dirs.Add( strHome + wxT("/.") ); - dirs.Add( wxT("/etc/") ); - dirs.Add( wxT("/usr/etc/") ); - dirs.Add( wxT("/usr/local/etc/") ); - dirs.Add( wxT("/etc/mail/") ); - dirs.Add( wxT("/usr/public/lib/") ); - if (!sExtraDir.empty()) - dirs.Add( sExtraDir + wxT("/") ); - - wxString file; - size_t nDirs = dirs.GetCount(); - for ( size_t nDir = 0; nDir < nDirs; nDir++ ) - { - file = dirs[nDir]; - file += wxT("mailcap"); - if ( wxFile::Exists(file) ) - { - ReadMailcap(file); - } - - file = dirs[nDir]; - file += wxT("mime.types"); - if ( wxFile::Exists(file) ) - ReadMimeTypes(file); - } -} - -bool wxMimeTypesManagerImpl::WriteToMimeTypes(int index, bool delete_index) -{ - // check we have the right manager - if (! ( m_mailcapStylesInited & wxMAILCAP_STANDARD) ) - return false; - - bool bTemp; - wxString strHome = wxGetenv(wxT("HOME")); - - // and now the users mailcap - wxString strUserMailcap = strHome + wxT("/.mime.types"); - - wxMimeTextFile file; - if ( wxFile::Exists(strUserMailcap) ) - { - bTemp = file.Open(strUserMailcap); - } - else - { - if (delete_index) - return false; - - bTemp = file.Create(strUserMailcap); - } - - if (bTemp) - { - int nIndex; - // test for netscape's header and return false if its found - nIndex = file.pIndexOf(wxT("#--Netscape")); - if (nIndex != wxNOT_FOUND) - { - wxFAIL_MSG(wxT("Error in .mime.types\nTrying to mix Netscape and Metamail formats\nFile not modified")); - return false; - } - - // write it in alternative format - // get rid of unwanted entries - wxString strType = m_aTypes[index]; - nIndex = file.pIndexOf(strType); - - // get rid of all the unwanted entries... - if (nIndex != wxNOT_FOUND) - file.CommentLine(nIndex); - - if (!delete_index) - { - // add the new entries in - wxString sTmp = strType.Append( wxT(' '), 40 - strType.Len() ); - sTmp += m_aExtensions[index]; - file.AddLine(sTmp); - } - - bTemp = file.Write(); - file.Close(); - } - - return bTemp; -} - -bool wxMimeTypesManagerImpl::WriteToNSMimeTypes(int index, bool delete_index) -{ - //check we have the right managers - if (! ( m_mailcapStylesInited & wxMAILCAP_NETSCAPE) ) - return false; - - bool bTemp; - wxString strHome = wxGetenv(wxT("HOME")); - - // and now the users mailcap - wxString strUserMailcap = strHome + wxT("/.mime.types"); - - wxMimeTextFile file; - if ( wxFile::Exists(strUserMailcap) ) - { - bTemp = file.Open(strUserMailcap); - } - else - { - if (delete_index) - return false; - - bTemp = file.Create(strUserMailcap); - } - - if (bTemp) - { - // write it in the format that Netscape uses - int nIndex; - // test for netscape's header and insert if required... - // this is a comment so use true - nIndex = file.pIndexOf(wxT("#--Netscape"), true); - if (nIndex == wxNOT_FOUND) - { - // either empty file or metamail format - // at present we can't cope with mixed formats, so exit to preseve - // metamail entreies - if (file.GetLineCount() > 0) - { - wxFAIL_MSG(wxT(".mime.types File not in Netscape format\nNo entries written to\n.mime.types or to .mailcap")); - return false; - } - - file.InsertLine(wxT( "#--Netscape Communications Corporation MIME Information" ), 0); - nIndex = 0; - } - - wxString strType = wxT("type=") + m_aTypes[index]; - nIndex = file.pIndexOf(strType); - - // get rid of all the unwanted entries... - if (nIndex != wxNOT_FOUND) - { - wxString sOld = file[nIndex]; - while ( (sOld.Contains(wxT("\\"))) && (nIndex < (int) file.GetLineCount()) ) - { - file.CommentLine(nIndex); - sOld = file[nIndex]; - - wxLogTrace(TRACE_MIME, wxT("--- Deleting from mime.types line '%d %s' ---"), nIndex, sOld.c_str()); - - nIndex++; - } - - if (nIndex < (int) file.GetLineCount()) - file.CommentLine(nIndex); - } - else - nIndex = (int) file.GetLineCount(); - - wxString sTmp = strType + wxT(" \\"); - if (!delete_index) - file.InsertLine(sTmp, nIndex); - - if ( ! m_aDescriptions.Item(index).empty() ) - { - sTmp = wxT("desc=\"") + m_aDescriptions[index]+ wxT("\" \\"); //.trim ?? - if (!delete_index) - { - nIndex++; - file.InsertLine(sTmp, nIndex); - } - } - - wxString sExts = m_aExtensions.Item(index); - sTmp = wxT("exts=\"") + sExts.Trim(false).Trim() + wxT("\""); - if (!delete_index) - { - nIndex++; - file.InsertLine(sTmp, nIndex); - } - - bTemp = file.Write(); - file.Close(); - } - - return bTemp; -} - -bool wxMimeTypesManagerImpl::WriteToMailCap(int index, bool delete_index) -{ - //check we have the right managers - if ( !( ( m_mailcapStylesInited & wxMAILCAP_NETSCAPE) || - ( m_mailcapStylesInited & wxMAILCAP_STANDARD) ) ) - return false; - - bool bTemp = false; - wxString strHome = wxGetenv(wxT("HOME")); - - // and now the users mailcap - wxString strUserMailcap = strHome + wxT("/.mailcap"); - - wxMimeTextFile file; - if ( wxFile::Exists(strUserMailcap) ) - { - bTemp = file.Open(strUserMailcap); - } - else - { - if (delete_index) - return false; - - bTemp = file.Create(strUserMailcap); - } - - if (bTemp) - { - // now got a file we can write to .... - wxMimeTypeCommands * entries = m_aEntries[index]; - size_t iOpen; - wxString sCmd = entries->GetCommandForVerb(wxT("open"), &iOpen); - wxString sTmp; - - sTmp = m_aTypes[index]; - wxString sOld; - int nIndex = file.pIndexOf(sTmp); - - // get rid of all the unwanted entries... - if (nIndex == wxNOT_FOUND) - { - nIndex = (int) file.GetLineCount(); - } - else - { - sOld = file[nIndex]; - wxLogTrace(TRACE_MIME, wxT("--- Deleting from mailcap line '%d' ---"), nIndex); - - while ( (sOld.Contains(wxT("\\"))) && (nIndex < (int) file.GetLineCount()) ) - { - file.CommentLine(nIndex); - if (nIndex < (int) file.GetLineCount()) - sOld = sOld + file[nIndex]; - } - - if (nIndex < (int) - file.GetLineCount()) file.CommentLine(nIndex); - } - - sTmp += wxT(";") + sCmd; //includes wxT(" %s "); - - // write it in the format that Netscape uses (default) - if (! ( m_mailcapStylesInited & wxMAILCAP_STANDARD ) ) - { - if (! delete_index) - file.InsertLine(sTmp, nIndex); - nIndex++; - } - else - { - // write extended format - - // TODO - FIX this code: - // ii) lost entries - // sOld holds all the entries, but our data store only has some - // eg test= is not stored - - // so far we have written the mimetype and command out - wxStringTokenizer sT(sOld, wxT(";\\")); - if (sT.CountTokens() > 2) - { - // first one mimetype; second one command, rest unknown... - wxString s; - s = sT.GetNextToken(); - s = sT.GetNextToken(); - - // first unknown - s = sT.GetNextToken(); - while ( ! s.empty() ) - { - bool bKnownToken = false; - if (s.Contains(wxT("description="))) - bKnownToken = true; - if (s.Contains(wxT("x11-bitmap="))) - bKnownToken = true; - - size_t i; - size_t nCount = entries->GetCount(); - for (i=0; i < nCount; i++) - { - if (s.Contains(entries->GetVerb(i))) - bKnownToken = true; - } - - if (!bKnownToken) - { - sTmp += wxT("; \\"); - file.InsertLine(sTmp, nIndex); - sTmp = s; - } - - s = sT.GetNextToken(); - } - } - - if (! m_aDescriptions[index].empty() ) - { - sTmp += wxT("; \\"); - file.InsertLine(sTmp, nIndex); - nIndex++; - sTmp = wxT(" description=\"") + m_aDescriptions[index] + wxT("\""); - } - - if (! m_aIcons[index].empty() ) - { - sTmp += wxT("; \\"); - file.InsertLine(sTmp, nIndex); - nIndex++; - sTmp = wxT(" x11-bitmap=\"") + m_aIcons[index] + wxT("\""); - } - - if ( entries->GetCount() > 1 ) - { - size_t i; - for (i=0; i < entries->GetCount(); i++) - if ( i != iOpen ) - { - sTmp += wxT("; \\"); - file.InsertLine(sTmp, nIndex); - nIndex++; - sTmp = wxT(" ") + entries->GetVerbCmd(i); - } - } - - file.InsertLine(sTmp, nIndex); - nIndex++; - } - - bTemp = file.Write(); - file.Close(); - } - - return bTemp; -} - -wxFileType * wxMimeTypesManagerImpl::Associate(const wxFileTypeInfo& ftInfo) -{ - InitIfNeeded(); - - wxString strType = ftInfo.GetMimeType(); - wxString strDesc = ftInfo.GetDescription(); - wxString strIcon = ftInfo.GetIconFile(); - - wxMimeTypeCommands *entry = new wxMimeTypeCommands(); - - if ( ! ftInfo.GetOpenCommand().empty()) - entry->Add(wxT("open=") + ftInfo.GetOpenCommand() + wxT(" %s ")); - if ( ! ftInfo.GetPrintCommand().empty()) - entry->Add(wxT("print=") + ftInfo.GetPrintCommand() + wxT(" %s ")); - - // now find where these extensions are in the data store and remove them - wxArrayString sA_Exts = ftInfo.GetExtensions(); - wxString sExt, sExtStore; - size_t i, nIndex; - size_t nExtCount = sA_Exts.GetCount(); - for (i=0; i < nExtCount; i++) - { - sExt = sA_Exts.Item(i); - - // clean up to just a space before and after - sExt.Trim().Trim(false); - sExt = wxT(' ') + sExt + wxT(' '); - size_t nCount = m_aExtensions.GetCount(); - for (nIndex = 0; nIndex < nCount; nIndex++) - { - sExtStore = m_aExtensions.Item(nIndex); - if (sExtStore.Replace(sExt, wxT(" ") ) > 0) - m_aExtensions.Item(nIndex) = sExtStore; - } - } - - if ( !DoAssociation(strType, strIcon, entry, sA_Exts, strDesc) ) - return NULL; - - return GetFileTypeFromMimeType(strType); -} - -bool wxMimeTypesManagerImpl::DoAssociation(const wxString& strType, - const wxString& strIcon, - wxMimeTypeCommands *entry, - const wxArrayString& strExtensions, - const wxString& strDesc) -{ - int nIndex = AddToMimeData(strType, strIcon, entry, strExtensions, strDesc, true); - - if ( nIndex == wxNOT_FOUND ) - return false; - - return WriteMimeInfo(nIndex, false); -} - -bool wxMimeTypesManagerImpl::WriteMimeInfo(int nIndex, bool delete_mime ) -{ - bool ok = true; - - if ( m_mailcapStylesInited & wxMAILCAP_STANDARD ) - { - // write in metamail format; - if (WriteToMimeTypes(nIndex, delete_mime) ) - if ( WriteToMailCap(nIndex, delete_mime) ) - ok = false; - } - - if ( m_mailcapStylesInited & wxMAILCAP_NETSCAPE ) - { - // write in netsacpe format; - if (WriteToNSMimeTypes(nIndex, delete_mime) ) - if ( WriteToMailCap(nIndex, delete_mime) ) - ok = false; - } - - // Don't write GNOME files here as this is not - // allowed and simply doesn't work - - if (m_mailcapStylesInited & wxMAILCAP_KDE) - { - // write in KDE format; - if (WriteKDEMimeFile(nIndex, delete_mime) ) - ok = false; - } - - return ok; -} - -int wxMimeTypesManagerImpl::AddToMimeData(const wxString& strType, - const wxString& strIcon, - wxMimeTypeCommands *entry, - const wxArrayString& strExtensions, - const wxString& strDesc, - bool replaceExisting) -{ - InitIfNeeded(); - - // ensure mimetype is always lower case - wxString mimeType = strType.Lower(); - - // is this a known MIME type? - int nIndex = m_aTypes.Index(mimeType); - if ( nIndex == wxNOT_FOUND ) - { - // new file type - m_aTypes.Add(mimeType); - m_aIcons.Add(strIcon); - m_aEntries.Add(entry ? entry : new wxMimeTypeCommands); - - // change nIndex so we can use it below to add the extensions - m_aExtensions.Add(wxEmptyString); - nIndex = m_aExtensions.size() - 1; - - m_aDescriptions.Add(strDesc); - } - else // yes, we already have it - { - if ( replaceExisting ) - { - // if new description change it - if ( !strDesc.empty()) - m_aDescriptions[nIndex] = strDesc; - - // if new icon change it - if ( !strIcon.empty()) - m_aIcons[nIndex] = strIcon; - - if ( entry ) - { - delete m_aEntries[nIndex]; - m_aEntries[nIndex] = entry; - } - } - else // add data we don't already have ... - { - // if new description add only if none - if ( m_aDescriptions[nIndex].empty() ) - m_aDescriptions[nIndex] = strDesc; - - // if new icon and no existing icon - if ( m_aIcons[nIndex].empty() ) - m_aIcons[nIndex] = strIcon; - - // add any new entries... - if ( entry ) - { - wxMimeTypeCommands *entryOld = m_aEntries[nIndex]; - - size_t count = entry->GetCount(); - for ( size_t i = 0; i < count; i++ ) - { - const wxString& verb = entry->GetVerb(i); - if ( !entryOld->HasVerb(verb) ) - { - entryOld->AddOrReplaceVerb(verb, entry->GetCmd(i)); - } - } - - // as we don't store it anywhere, it won't be deleted later as - // usual -- do it immediately instead - delete entry; - } - } - } - - // always add the extensions to this mimetype - wxString& exts = m_aExtensions[nIndex]; - - // add all extensions we don't have yet - wxString ext; - size_t count = strExtensions.GetCount(); - for ( size_t i = 0; i < count; i++ ) - { - ext = strExtensions[i]; - ext += wxT(' '); - - if ( exts.Find(ext) == wxNOT_FOUND ) - { - exts += ext; - } - } - - // check data integrity - wxASSERT( m_aTypes.Count() == m_aEntries.Count() && - m_aTypes.Count() == m_aExtensions.Count() && - m_aTypes.Count() == m_aIcons.Count() && - m_aTypes.Count() == m_aDescriptions.Count() ); - - return nIndex; -} - -wxFileType * wxMimeTypesManagerImpl::GetFileTypeFromExtension(const wxString& ext) -{ - if (ext.empty() ) - return NULL; - - InitIfNeeded(); - - size_t count = m_aExtensions.GetCount(); - for ( size_t n = 0; n < count; n++ ) - { - wxStringTokenizer tk(m_aExtensions[n], wxT(' ')); - - while ( tk.HasMoreTokens() ) - { - // consider extensions as not being case-sensitive - if ( tk.GetNextToken().IsSameAs(ext, false /* no case */) ) - { - // found - wxFileType *fileType = new wxFileType; - fileType->m_impl->Init(this, n); - - return fileType; - } - } - } - - return NULL; -} - -wxFileType * wxMimeTypesManagerImpl::GetFileTypeFromMimeType(const wxString& mimeType) -{ - InitIfNeeded(); - - wxFileType * fileType = NULL; - // mime types are not case-sensitive - wxString mimetype(mimeType); - mimetype.MakeLower(); - - // first look for an exact match - int index = m_aTypes.Index(mimetype); - if ( index != wxNOT_FOUND ) - { - fileType = new wxFileType; - fileType->m_impl->Init(this, index); - } - - // then try to find "text/*" as match for "text/plain" (for example) - // NB: if mimeType doesn't contain '/' at all, BeforeFirst() will return - // the whole string - ok. - - index = wxNOT_FOUND; - wxString strCategory = mimetype.BeforeFirst(wxT('/')); - - size_t nCount = m_aTypes.Count(); - for ( size_t n = 0; n < nCount; n++ ) - { - if ( (m_aTypes[n].BeforeFirst(wxT('/')) == strCategory ) && - m_aTypes[n].AfterFirst(wxT('/')) == wxT("*") ) - { - index = n; - break; - } - } - - if ( index != wxNOT_FOUND ) - { - // don't throw away fileType that was already found - if (!fileType) - fileType = new wxFileType; - fileType->m_impl->Init(this, index); - } - - return fileType; -} - -wxString wxMimeTypesManagerImpl::GetCommand(const wxString & verb, size_t nIndex) const -{ - wxString command, testcmd, sV, sTmp; - sV = verb + wxT("="); - - // list of verb = command pairs for this mimetype - wxMimeTypeCommands * sPairs = m_aEntries [nIndex]; - - size_t i; - size_t nCount = sPairs->GetCount(); - for ( i = 0; i < nCount; i++ ) - { - sTmp = sPairs->GetVerbCmd (i); - if ( sTmp.Contains(sV) ) - command = sTmp.AfterFirst(wxT('=')); - } - - return command; -} - -void wxMimeTypesManagerImpl::AddFallback(const wxFileTypeInfo& filetype) -{ - InitIfNeeded(); - - wxString extensions; - const wxArrayString& exts = filetype.GetExtensions(); - size_t nExts = exts.GetCount(); - for ( size_t nExt = 0; nExt < nExts; nExt++ ) - { - if ( nExt > 0 ) - extensions += wxT(' '); - - extensions += exts[nExt]; - } - - AddMimeTypeInfo(filetype.GetMimeType(), - extensions, - filetype.GetDescription()); - - AddMailcapInfo(filetype.GetMimeType(), - filetype.GetOpenCommand(), - filetype.GetPrintCommand(), - wxT(""), - filetype.GetDescription()); -} - -void wxMimeTypesManagerImpl::AddMimeTypeInfo(const wxString& strMimeType, - const wxString& strExtensions, - const wxString& strDesc) -{ - // reading mailcap may find image/* , while - // reading mime.types finds image/gif and no match is made - // this means all the get functions don't work fix this - wxString strIcon; - wxString sTmp = strExtensions; - - wxArrayString sExts; - sTmp.Trim().Trim(false); - - while (!sTmp.empty()) - { - sExts.Add(sTmp.AfterLast(wxT(' '))); - sTmp = sTmp.BeforeLast(wxT(' ')); - } - - AddToMimeData(strMimeType, strIcon, NULL, sExts, strDesc, true); -} - -void wxMimeTypesManagerImpl::AddMailcapInfo(const wxString& strType, - const wxString& strOpenCmd, - const wxString& strPrintCmd, - const wxString& strTest, - const wxString& strDesc) -{ - InitIfNeeded(); - - wxMimeTypeCommands *entry = new wxMimeTypeCommands; - entry->Add(wxT("open=") + strOpenCmd); - entry->Add(wxT("print=") + strPrintCmd); - entry->Add(wxT("test=") + strTest); - - wxString strIcon; - wxArrayString strExtensions; - - AddToMimeData(strType, strIcon, entry, strExtensions, strDesc, true); -} - -bool wxMimeTypesManagerImpl::ReadMimeTypes(const wxString& strFileName) -{ - wxLogTrace(TRACE_MIME, wxT("--- Parsing mime.types file '%s' ---"), - strFileName.c_str()); - - wxMimeTextFile file(strFileName); - if ( !file.Open() ) - return false; - - // the information we extract - wxString strMimeType, strDesc, strExtensions; - - size_t nLineCount = file.GetLineCount(); - const wxChar *pc = NULL; - for ( size_t nLine = 0; nLine < nLineCount; nLine++ ) - { - if ( pc == NULL ) - { - // now we're at the start of the line - pc = file[nLine].c_str(); - } - else - { - // we didn't finish with the previous line yet - nLine--; - } - - // skip whitespace - while ( wxIsspace(*pc) ) - pc++; - - // comment or blank line? - if ( *pc == wxT('#') || !*pc ) - { - // skip the whole line - pc = NULL; - continue; - } - - // detect file format - const wxChar *pEqualSign = wxStrchr(pc, wxT('=')); - if ( pEqualSign == NULL ) - { - // brief format - // ------------ - - // first field is mime type - for ( strMimeType.Empty(); !wxIsspace(*pc) && *pc != wxT('\0'); pc++ ) - { - strMimeType += *pc; - } - - // skip whitespace - while ( wxIsspace(*pc) ) - pc++; - - // take all the rest of the string - strExtensions = pc; - - // no description... - strDesc.Empty(); - } - else - { - // expanded format - // --------------- - - // the string on the left of '=' is the field name - wxString strLHS(pc, pEqualSign - pc); - - // eat whitespace - for ( pc = pEqualSign + 1; wxIsspace(*pc); pc++ ) - ; - - const wxChar *pEnd; - if ( *pc == wxT('"') ) - { - // the string is quoted and ends at the matching quote - pEnd = wxStrchr(++pc, wxT('"')); - if ( pEnd == NULL ) - { - wxLogWarning(wxT("Mime.types file %s, line %lu: unterminated quoted string."), - strFileName.c_str(), nLine + 1L); - } - } - else - { - // unquoted string ends at the first space or at the end of - // line - for ( pEnd = pc; *pEnd && !wxIsspace(*pEnd); pEnd++ ) - ; - } - - // now we have the RHS (field value) - wxString strRHS(pc, pEnd - pc); - - // check what follows this entry - if ( *pEnd == wxT('"') ) - { - // skip this quote - pEnd++; - } - - for ( pc = pEnd; wxIsspace(*pc); pc++ ) - ; - - // if there is something left, it may be either a '\\' to continue - // the line or the next field of the same entry - bool entryEnded = *pc == wxT('\0'); - bool nextFieldOnSameLine = false; - if ( !entryEnded ) - { - nextFieldOnSameLine = ((*pc != wxT('\\')) || (pc[1] != wxT('\0'))); - } - - // now see what we got - if ( strLHS == wxT("type") ) - { - strMimeType = strRHS; - } - else if ( strLHS.StartsWith(wxT("desc")) ) - { - strDesc = strRHS; - } - else if ( strLHS == wxT("exts") ) - { - strExtensions = strRHS; - } - else if ( strLHS == wxT("icon") ) - { - // this one is simply ignored: it usually refers to Netscape - // built in icons which are useless for us anyhow - } - else if ( !strLHS.StartsWith(wxT("x-")) ) - { - // we suppose that all fields starting with "X-" are - // unregistered extensions according to the standard practice, - // but it may be worth telling the user about other junk in - // his mime.types file - wxLogWarning(wxT("Unknown field in file %s, line %lu: '%s'."), - strFileName.c_str(), nLine + 1L, strLHS.c_str()); - } - - if ( !entryEnded ) - { - if ( !nextFieldOnSameLine ) - pc = NULL; - //else: don't reset it - - // as we don't reset strMimeType, the next field in this entry - // will be interpreted correctly. - - continue; - } - } - - // depending on the format (Mosaic or Netscape) either space or comma - // is used to separate the extensions - strExtensions.Replace(wxT(","), wxT(" ")); - - // also deal with the leading dot - if ( !strExtensions.empty() && strExtensions[0u] == wxT('.') ) - { - strExtensions.erase(0, 1); - } - - wxLogTrace(TRACE_MIME, wxT("mime.types: '%s' => '%s' (%s)"), - strExtensions.c_str(), - strMimeType.c_str(), - strDesc.c_str()); - - AddMimeTypeInfo(strMimeType, strExtensions, strDesc); - - // finished with this line - pc = NULL; - } - - return true; -} - -// ---------------------------------------------------------------------------- -// UNIX mailcap files parsing -// ---------------------------------------------------------------------------- - -// the data for a single MIME type -struct MailcapLineData -{ - // field values - wxString type, - cmdOpen, - test, - icon, - desc; - - wxArrayString verbs, - commands; - - // flags - bool testfailed, - needsterminal, - copiousoutput; - - MailcapLineData() { testfailed = needsterminal = copiousoutput = false; } -}; - -// process a non-standard (i.e. not the first or second one) mailcap field -bool -wxMimeTypesManagerImpl::ProcessOtherMailcapField(MailcapLineData& data, - const wxString& curField) -{ - if ( curField.empty() ) - { - // we don't care - return true; - } - - // is this something of the form foo=bar? - const wxChar *pEq = wxStrchr(curField, wxT('=')); - if ( pEq != NULL ) - { - // split "LHS = RHS" in 2 - wxString lhs = curField.BeforeFirst(wxT('=')), - rhs = curField.AfterFirst(wxT('=')); - - lhs.Trim(true); // from right - rhs.Trim(false); // from left - - // it might be quoted - if ( !rhs.empty() && rhs[0u] == wxT('"') && rhs.Last() == wxT('"') ) - { - rhs = rhs.Mid(1, rhs.length() - 2); - } - - // is it a command verb or something else? - if ( lhs == wxT("test") ) - { - if ( wxSystem(rhs) == 0 ) - { - // ok, test passed - wxLogTrace(TRACE_MIME_TEST, - wxT("Test '%s' for mime type '%s' succeeded."), - rhs.c_str(), data.type.c_str()); - } - else - { - wxLogTrace(TRACE_MIME_TEST, - wxT("Test '%s' for mime type '%s' failed, skipping."), - rhs.c_str(), data.type.c_str()); - - data.testfailed = true; - } - } - else if ( lhs == wxT("desc") ) - { - data.desc = rhs; - } - else if ( lhs == wxT("x11-bitmap") ) - { - data.icon = rhs; - } - else if ( lhs == wxT("notes") ) - { - // ignore - } - else // not a (recognized) special case, must be a verb (e.g. "print") - { - data.verbs.Add(lhs); - data.commands.Add(rhs); - } - } - else // '=' not found - { - // so it must be a simple flag - if ( curField == wxT("needsterminal") ) - { - data.needsterminal = true; - } - else if ( curField == wxT("copiousoutput")) - { - // copiousoutput impies that the viewer is a console program - data.needsterminal = - data.copiousoutput = true; - } - else if ( !IsKnownUnimportantField(curField) ) - { - return false; - } - } - - return true; -} - -bool wxMimeTypesManagerImpl::ReadMailcap(const wxString& strFileName, - bool fallback) -{ - wxLogTrace(TRACE_MIME, wxT("--- Parsing mailcap file '%s' ---"), - strFileName.c_str()); - - wxMimeTextFile file(strFileName); - if ( !file.Open() ) - return false; - - // indices of MIME types (in m_aTypes) we already found in this file - // - // (see the comments near the end of function for the reason we need this) - wxArrayInt aIndicesSeenHere; - - // accumulator for the current field - wxString curField; - curField.reserve(1024); - - const wxChar *pPagerEnv = wxGetenv(wxT("PAGER")); - - const wxArrayString empty_extensions_list; - - size_t nLineCount = file.GetLineCount(); - for ( size_t nLine = 0; nLine < nLineCount; nLine++ ) - { - // now we're at the start of the line - const wxChar *pc = file[nLine].c_str(); - - // skip whitespace - while ( wxIsspace(*pc) ) - pc++; - - // comment or empty string? - if ( *pc == wxT('#') || *pc == wxT('\0') ) - continue; - - // no, do parse - // ------------ - - // what field are we currently in? The first 2 are fixed and there may - // be an arbitrary number of other fields parsed by - // ProcessOtherMailcapField() - // - // the first field is the MIME type - enum - { - Field_Type, - Field_OpenCmd, - Field_Other - } - currentToken = Field_Type; - - // the flags and field values on the current line - MailcapLineData data; - - bool cont = true; - while ( cont ) - { - switch ( *pc ) - { - case wxT('\\'): - // interpret the next character literally (notice that - // backslash can be used for line continuation) - if ( *++pc == wxT('\0') ) - { - // fetch the next line if there is one - if ( nLine == nLineCount - 1 ) - { - // something is wrong, bail out - cont = false; - - wxLogDebug(wxT("Mailcap file %s, line %lu: '\\' on the end of the last line ignored."), - strFileName.c_str(), - nLine + 1L); - } - else - { - // pass to the beginning of the next line - pc = file[++nLine].c_str(); - - // skip pc++ at the end of the loop - continue; - } - } - else - { - // just a normal character - curField += *pc; - } - break; - - case wxT('\0'): - cont = false; // end of line reached, exit the loop - - // fall through to still process this field - - case wxT(';'): - // trim whitespaces from both sides - curField.Trim(true).Trim(false); - - switch ( currentToken ) - { - case Field_Type: - data.type = curField.Lower(); - if ( data.type.empty() ) - { - // I don't think that this is a valid mailcap - // entry, but try to interpret it somehow - data.type = wxT('*'); - } - - if ( data.type.Find(wxT('/')) == wxNOT_FOUND ) - { - // we interpret "type" as "type/*" - data.type += wxT("/*"); - } - - currentToken = Field_OpenCmd; - break; - - case Field_OpenCmd: - data.cmdOpen = curField; - - currentToken = Field_Other; - break; - - case Field_Other: - if ( !ProcessOtherMailcapField(data, curField) ) - { - // don't flood the user with error messages if - // we don't understand something in his - // mailcap, but give them in debug mode because - // this might be useful for the programmer - wxLogDebug - ( - wxT("Mailcap file %s, line %lu: unknown field '%s' for the MIME type '%s' ignored."), - strFileName.c_str(), - nLine + 1L, - curField.c_str(), - data.type.c_str() - ); - } - else if ( data.testfailed ) - { - // skip this entry entirely - cont = false; - } - - // it already has this value - //currentToken = Field_Other; - break; - - default: - wxFAIL_MSG(wxT("unknown field type in mailcap")); - } - - // next token starts immediately after ';' - curField.Empty(); - break; - - default: - curField += *pc; - } - - // continue in the same line - pc++; - } - - // we read the entire entry, check what have we got - // ------------------------------------------------ - - // check that we really read something reasonable - if ( currentToken < Field_Other ) - { - wxLogWarning(wxT("Mailcap file %s, line %lu: incomplete entry ignored."), - strFileName.c_str(), nLine + 1L); - - continue; - } - - // if the test command failed, it's as if the entry were not there at all - if ( data.testfailed ) - { - continue; - } - - // support for flags: - // 1. create an xterm for 'needsterminal' - // 2. append "| $PAGER" for 'copiousoutput' - // - // Note that the RFC says that having both needsterminal and - // copiousoutput is probably a mistake, so it seems that running - // programs with copiousoutput inside an xterm as it is done now - // is a bad idea (FIXME) - if ( data.copiousoutput ) - { - data.cmdOpen << wxT(" | ") << (pPagerEnv ? pPagerEnv : wxT("more")); - } - - if ( data.needsterminal ) - { - data.cmdOpen.insert(0, wxT("xterm -e sh -c '")); - data.cmdOpen.append(wxT("'")); - } - - if ( !data.cmdOpen.empty() ) - { - data.verbs.Insert(wxT("open"), 0); - data.commands.Insert(data.cmdOpen, 0); - } - - // we have to decide whether the new entry should replace any entries - // for the same MIME type we had previously found or not - bool overwrite; - - // the fall back entries have the lowest priority, by definition - if ( fallback ) - { - overwrite = false; - } - else - { - // have we seen this one before? - int nIndex = m_aTypes.Index(data.type); - - // and if we have, was it in this file? if not, we should - // overwrite the previously seen one - overwrite = nIndex == wxNOT_FOUND || - aIndicesSeenHere.Index(nIndex) == wxNOT_FOUND; - } - - wxLogTrace(TRACE_MIME, wxT("mailcap %s: %s [%s]"), - data.type.c_str(), data.cmdOpen.c_str(), - overwrite ? wxT("replace") : wxT("add")); - - int n = AddToMimeData - ( - data.type, - data.icon, - new wxMimeTypeCommands(data.verbs, data.commands), - empty_extensions_list, - data.desc, - overwrite - ); - - if ( overwrite ) - { - aIndicesSeenHere.Add(n); - } - } - - return true; -} - -size_t wxMimeTypesManagerImpl::EnumAllFileTypes(wxArrayString& mimetypes) -{ - InitIfNeeded(); - - mimetypes.Empty(); - - size_t count = m_aTypes.GetCount(); - for ( size_t n = 0; n < count; n++ ) - { - // don't return template types from here (i.e. anything containg '*') - const wxString &type = m_aTypes[n]; - if ( type.Find(wxT('*')) == wxNOT_FOUND ) - { - mimetypes.Add(type); - } - } - - return mimetypes.GetCount(); -} - -// ---------------------------------------------------------------------------- -// writing to MIME type files -// ---------------------------------------------------------------------------- - -bool wxMimeTypesManagerImpl::Unassociate(wxFileType *ft) -{ - InitIfNeeded(); - - wxArrayString sMimeTypes; - ft->GetMimeTypes(sMimeTypes); - - size_t i; - size_t nCount = sMimeTypes.GetCount(); - for (i = 0; i < nCount; i ++) - { - const wxString &sMime = sMimeTypes.Item(i); - int nIndex = m_aTypes.Index(sMime); - if ( nIndex == wxNOT_FOUND) - { - // error if we get here ?? - return false; - } - else - { - WriteMimeInfo(nIndex, true); - m_aTypes.RemoveAt(nIndex); - m_aEntries.RemoveAt(nIndex); - m_aExtensions.RemoveAt(nIndex); - m_aDescriptions.RemoveAt(nIndex); - m_aIcons.RemoveAt(nIndex); - } - } - // check data integrity - wxASSERT( m_aTypes.Count() == m_aEntries.Count() && - m_aTypes.Count() == m_aExtensions.Count() && - m_aTypes.Count() == m_aIcons.Count() && - m_aTypes.Count() == m_aDescriptions.Count() ); - - return true; -} - -// ---------------------------------------------------------------------------- -// private functions -// ---------------------------------------------------------------------------- - -static bool IsKnownUnimportantField(const wxString& fieldAll) -{ - static const wxChar * const knownFields[] = - { - wxT("x-mozilla-flags"), - wxT("nametemplate"), - wxT("textualnewlines"), - }; - - wxString field = fieldAll.BeforeFirst(wxT('=')); - for ( size_t n = 0; n < WXSIZEOF(knownFields); n++ ) - { - if ( field.CmpNoCase(knownFields[n]) == 0 ) - return true; - } - - return false; -} - -#endif - // wxUSE_MIMETYPE && wxUSE_FILE && wxUSE_TEXTFILE diff --git a/wxWidgets/src/unix/snglinst.cpp b/wxWidgets/src/unix/snglinst.cpp deleted file mode 100644 index 4d8ceb5825..0000000000 --- a/wxWidgets/src/unix/snglinst.cpp +++ /dev/null @@ -1,398 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: src/unix/snglinst.cpp -// Purpose: implements wxSingleInstanceChecker class for Unix using -// lock files with fcntl(2) or flock(2) -// Author: Vadim Zeitlin -// Modified by: -// Created: 09.06.01 -// RCS-ID: $Id: snglinst.cpp 55833 2008-09-24 13:47:41Z VZ $ -// Copyright: (c) 2001 Vadim Zeitlin -// License: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_SNGLINST_CHECKER - -#ifndef WX_PRECOMP - #include "wx/string.h" - #include "wx/log.h" - #include "wx/intl.h" - #include "wx/utils.h" // wxGetHomeDir() -#endif //WX_PRECOMP - -#include "wx/file.h" - -#include "wx/snglinst.h" - -#include -#include -#include // for S_I[RW]USR -#include // for kill() -#include - -#ifdef HAVE_FCNTL - #include -#elif defined(HAVE_FLOCK) - #include -#else - // normally, wxUSE_SNGLINST_CHECKER must have been reset by configure - #error "wxSingleInstanceChecker can't be compiled on this platform" -#endif // fcntl()/flock() - -// ---------------------------------------------------------------------------- -// constants -// ---------------------------------------------------------------------------- - -// argument of wxLockFile() -enum LockOperation -{ - LOCK, - UNLOCK -}; - -// return value of CreateLockFile() -enum LockResult -{ - LOCK_ERROR = -1, - LOCK_EXISTS, - LOCK_CREATED -}; - -// ---------------------------------------------------------------------------- -// private functions: (exclusively) lock/unlock the file -// ---------------------------------------------------------------------------- - -#ifdef HAVE_FCNTL - -static int wxLockFile(int fd, LockOperation lock) -{ - // init the flock parameter struct - struct flock fl; - fl.l_type = lock == LOCK ? F_WRLCK : F_UNLCK; - - // lock the entire file - fl.l_start = - fl.l_len = - fl.l_whence = 0; - - // is this needed? - fl.l_pid = getpid(); - - return fcntl(fd, F_SETLK, &fl); -} - -#else // HAVE_FLOCK - -static int wxLockFile(int fd, LockOperation lock) -{ - return flock(fd, lock == LOCK ? LOCK_EX | LOCK_NB : LOCK_UN); -} - -#endif // fcntl()/flock() - -// ---------------------------------------------------------------------------- -// wxSingleInstanceCheckerImpl: the real implementation class -// ---------------------------------------------------------------------------- - -class wxSingleInstanceCheckerImpl -{ -public: - wxSingleInstanceCheckerImpl() - { - m_fdLock = -1; - m_pidLocker = 0; - } - - bool Create(const wxString& name); - - pid_t GetLockerPID() const { return m_pidLocker; } - - ~wxSingleInstanceCheckerImpl() { Unlock(); } - -private: - // try to create and lock the file - LockResult CreateLockFile(); - - // unlock and remove the lock file - void Unlock(); - - // the descriptor of our lock file, -1 if none - int m_fdLock; - - // pid of the process owning the lock file - pid_t m_pidLocker; - - // the name of the lock file - wxString m_nameLock; -}; - -// ============================================================================ -// wxSingleInstanceCheckerImpl implementation -// ============================================================================ - -LockResult wxSingleInstanceCheckerImpl::CreateLockFile() -{ - // try to open the file - m_fdLock = open(m_nameLock.fn_str(), - O_WRONLY | O_CREAT | O_EXCL, - S_IRUSR | S_IWUSR); - - if ( m_fdLock != -1 ) - { - // try to lock it - if ( wxLockFile(m_fdLock, LOCK) == 0 ) - { - // fine, we have the exclusive lock to the file, write our PID - // into it - m_pidLocker = getpid(); - - // use char here, not wxChar! - char buf[256]; // enough for any PID size - int len = sprintf(buf, "%d", (int)m_pidLocker) + 1; - - if ( write(m_fdLock, buf, len) != len ) - { - wxLogSysError(_("Failed to write to lock file '%s'"), - m_nameLock.c_str()); - - Unlock(); - - return LOCK_ERROR; - } - - fsync(m_fdLock); - - // change file's permission so that only this user can access it: - if ( chmod(m_nameLock.fn_str(), S_IRUSR | S_IWUSR) != 0 ) - { - wxLogSysError(_("Failed to set permissions on lock file '%s'"), - m_nameLock.c_str()); - - Unlock(); - - return LOCK_ERROR; - } - - return LOCK_CREATED; - } - else // failure: see what exactly happened - { - close(m_fdLock); - m_fdLock = -1; - - if ( errno != EACCES && errno != EAGAIN ) - { - wxLogSysError(_("Failed to lock the lock file '%s'"), - m_nameLock.c_str()); - - unlink(m_nameLock.fn_str()); - - return LOCK_ERROR; - } - //else: couldn't lock because the lock is held by another process: - // this might have happened because of a race condition: - // maybe another instance opened and locked the file between - // our calls to open() and flock(), so don't give an error - } - } - - // we didn't create and lock the file - return LOCK_EXISTS; -} - -bool wxSingleInstanceCheckerImpl::Create(const wxString& name) -{ - m_nameLock = name; - - switch ( CreateLockFile() ) - { - case LOCK_EXISTS: - // there is a lock file, check below if it is still valid - break; - - case LOCK_CREATED: - // nothing more to do - return true; - - case LOCK_ERROR: - // oops... - return false; - } - - // Check if the file is owned by current user and has 0600 permissions. - // If it doesn't, it's a fake file, possibly meant as a DoS attack, and - // so we refuse to touch it: - wxStructStat stats; - if ( wxStat(name, &stats) != 0 ) - { - wxLogSysError(_("Failed to inspect the lock file '%s'"), name.c_str()); - return false; - } - if ( stats.st_uid != getuid() ) - { - wxLogError(_("Lock file '%s' has incorrect owner."), name.c_str()); - return false; - } - if ( stats.st_mode != (S_IFREG | S_IRUSR | S_IWUSR) ) - { - wxLogError(_("Lock file '%s' has incorrect permissions."), name.c_str()); - return false; - } - - // try to open the file for reading and get the PID of the process - // which has it - wxFile file(name, wxFile::read); - if ( !file.IsOpened() ) - { - // well, this is really weird - file doesn't exist and we can't - // create it - // - // normally, this just means that we don't have write access to - // the directory where we try to create it, so return failure, - // even it might also be a rare case of a race condition when - // another process managed to open and lock the file and terminate - // (erasing it) before we got here, but this should happen so - // rarely in practice that we don't care - wxLogError(_("Failed to access lock file.")); - - return false; - } - - char buf[256]; - ssize_t count = file.Read(buf, WXSIZEOF(buf)); - if ( count == wxInvalidOffset ) - { - wxLogError(_("Failed to read PID from lock file.")); - } - else - { - if ( sscanf(buf, "%d", (int *)&m_pidLocker) == 1 ) - { - if ( kill(m_pidLocker, 0) != 0 ) - { - if ( unlink(name.fn_str()) != 0 ) - { - wxLogError(_("Failed to remove stale lock file '%s'."), - name.c_str()); - - // return true in this case for now... - } - else - { - wxLogMessage(_("Deleted stale lock file '%s'."), - name.c_str()); - - // retry now - (void)CreateLockFile(); - } - } - //else: the other process is running - } - else - { - wxLogWarning(_("Invalid lock file '%s'."), name.c_str()); - } - } - - // return true if we could get the PID of the process owning the lock file - // (whether it is still running or not), FALSE otherwise as it is - // unexpected - return m_pidLocker != 0; -} - -void wxSingleInstanceCheckerImpl::Unlock() -{ - if ( m_fdLock != -1 ) - { - if ( unlink(m_nameLock.fn_str()) != 0 ) - { - wxLogSysError(_("Failed to remove lock file '%s'"), - m_nameLock.c_str()); - } - - if ( wxLockFile(m_fdLock, UNLOCK) != 0 ) - { - wxLogSysError(_("Failed to unlock lock file '%s'"), - m_nameLock.c_str()); - } - - if ( close(m_fdLock) != 0 ) - { - wxLogSysError(_("Failed to close lock file '%s'"), - m_nameLock.c_str()); - } - } - - m_pidLocker = 0; -} - -// ============================================================================ -// wxSingleInstanceChecker implementation -// ============================================================================ - -bool wxSingleInstanceChecker::Create(const wxString& name, - const wxString& path) -{ - wxASSERT_MSG( !m_impl, - _T("calling wxSingleInstanceChecker::Create() twice?") ); - - // must have the file name to create a lock file - wxASSERT_MSG( !name.empty(), _T("lock file name can't be empty") ); - - m_impl = new wxSingleInstanceCheckerImpl; - - wxString fullname = path; - if ( fullname.empty() ) - { - fullname = wxGetHomeDir(); - } - - if ( fullname.Last() != _T('/') ) - { - fullname += _T('/'); - } - - fullname << name; - - return m_impl->Create(fullname); -} - -bool wxSingleInstanceChecker::IsAnotherRunning() const -{ - wxCHECK_MSG( m_impl, false, _T("must call Create() first") ); - - const pid_t lockerPid = m_impl->GetLockerPID(); - - if ( !lockerPid ) - { - // we failed to open the lock file, return false as we're definitely - // not sure that another our process is running and so it's better not - // to prevent this one from starting up - return false; - } - - // if another instance is running, it must own the lock file - otherwise - // we have it and the locker PID is ours one - return lockerPid != getpid(); -} - -wxSingleInstanceChecker::~wxSingleInstanceChecker() -{ - delete m_impl; -} - -#endif // wxUSE_SNGLINST_CHECKER diff --git a/wxWidgets/src/unix/sound.cpp b/wxWidgets/src/unix/sound.cpp deleted file mode 100644 index 947b01e587..0000000000 --- a/wxWidgets/src/unix/sound.cpp +++ /dev/null @@ -1,722 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/unix/sound.cpp -// Purpose: wxSound -// Author: Marcel Rasche, Vaclav Slavik -// Modified by: -// Created: 25/10/98 -// RCS-ID: $Id: sound.cpp 41020 2006-09-05 20:47:48Z VZ $ -// Copyright: (c) Julian Smart, Open Source Applications Foundation -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// for compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#if defined(__BORLANDC__) - #pragma hdrstop -#endif - -#if wxUSE_SOUND - -#include -#include -#include -#include - -#ifdef HAVE_SYS_SOUNDCARD_H -#include -#endif - -#ifndef WX_PRECOMP - #include "wx/event.h" - #include "wx/intl.h" - #include "wx/log.h" - #include "wx/module.h" -#endif - -#include "wx/thread.h" -#include "wx/file.h" -#include "wx/sound.h" -#include "wx/dynlib.h" - - -#if wxUSE_THREADS -// mutex for all wxSound's synchronization -static wxMutex gs_soundMutex; -#endif - -// ---------------------------------------------------------------------------- -// wxSoundData -// ---------------------------------------------------------------------------- - -void wxSoundData::IncRef() -{ -#if wxUSE_THREADS - wxMutexLocker locker(gs_soundMutex); -#endif - m_refCnt++; -} - -void wxSoundData::DecRef() -{ -#if wxUSE_THREADS - wxMutexLocker locker(gs_soundMutex); -#endif - if (--m_refCnt == 0) - delete this; -} - -wxSoundData::~wxSoundData() -{ - delete[] m_dataWithHeader; -} - - -// ---------------------------------------------------------------------------- -// wxSoundBackendNull, used in absence of audio API or card -// ---------------------------------------------------------------------------- - -class wxSoundBackendNull : public wxSoundBackend -{ -public: - wxString GetName() const { return _("No sound"); } - int GetPriority() const { return 0; } - bool IsAvailable() const { return true; } - bool HasNativeAsyncPlayback() const { return true; } - bool Play(wxSoundData *WXUNUSED(data), unsigned WXUNUSED(flags), - volatile wxSoundPlaybackStatus *WXUNUSED(status)) - { return true; } - void Stop() {} - bool IsPlaying() const { return false; } -}; - - -// ---------------------------------------------------------------------------- -// wxSoundBackendOSS, for Linux -// ---------------------------------------------------------------------------- - -#ifdef HAVE_SYS_SOUNDCARD_H - -#ifndef AUDIODEV -#define AUDIODEV "/dev/dsp" // Default path for audio device -#endif - -class wxSoundBackendOSS : public wxSoundBackend -{ -public: - wxString GetName() const { return _T("Open Sound System"); } - int GetPriority() const { return 10; } - bool IsAvailable() const; - bool HasNativeAsyncPlayback() const { return false; } - bool Play(wxSoundData *data, unsigned flags, - volatile wxSoundPlaybackStatus *status); - void Stop() {} - bool IsPlaying() const { return false; } - -private: - int OpenDSP(const wxSoundData *data); - bool InitDSP(int dev, const wxSoundData *data); - - int m_DSPblkSize; // Size of the DSP buffer - bool m_needConversion; -}; - -bool wxSoundBackendOSS::IsAvailable() const -{ - int fd; - fd = open(AUDIODEV, O_WRONLY | O_NONBLOCK); - if (fd < 0) - return false; - close(fd); - return true; -} - -bool wxSoundBackendOSS::Play(wxSoundData *data, unsigned flags, - volatile wxSoundPlaybackStatus *status) -{ - int dev = OpenDSP(data); - - if (dev < 0) - return false; - - ioctl(dev, SNDCTL_DSP_SYNC, 0); - - do - { - bool play = true; - int i; - unsigned l = 0; - size_t datasize = data->m_dataBytes; - - do - { - if (status->m_stopRequested) - { - wxLogTrace(_T("sound"), _T("playback stopped")); - close(dev); - return true; - } - - i= (int)((l + m_DSPblkSize) < datasize ? - m_DSPblkSize : (datasize - l)); - if (write(dev, &data->m_data[l], i) != i) - { - play = false; - } - l += i; - } while (play && l < datasize); - } while (flags & wxSOUND_LOOP); - - close(dev); - return true; -} - -int wxSoundBackendOSS::OpenDSP(const wxSoundData *data) -{ - int dev = -1; - - if ((dev = open(AUDIODEV, O_WRONLY, 0)) <0) - return -1; - - if (!InitDSP(dev, data) || m_needConversion) - { - close(dev); - return -1; - } - - return dev; -} - - -bool wxSoundBackendOSS::InitDSP(int dev, const wxSoundData *data) -{ - unsigned tmp; - - // Reset the dsp - if (ioctl(dev, SNDCTL_DSP_RESET, 0) < 0) - { - wxLogTrace(_T("sound"), _T("unable to reset dsp")); - return false; - } - - m_needConversion = false; - - tmp = data->m_bitsPerSample; - if (ioctl(dev, SNDCTL_DSP_SAMPLESIZE, &tmp) < 0) - { - wxLogTrace(_T("sound"), _T("IOCTL failure (SNDCTL_DSP_SAMPLESIZE)")); - return false; - } - if (tmp != data->m_bitsPerSample) - { - wxLogTrace(_T("sound"), - _T("Unable to set DSP sample size to %d (wants %d)"), - data->m_bitsPerSample, tmp); - m_needConversion = true; - } - - unsigned stereo = data->m_channels == 1 ? 0 : 1; - tmp = stereo; - if (ioctl(dev, SNDCTL_DSP_STEREO, &tmp) < 0) - { - wxLogTrace(_T("sound"), _T("IOCTL failure (SNDCTL_DSP_STEREO)")); - return false; - } - if (tmp != stereo) - { - wxLogTrace(_T("sound"), _T("Unable to set DSP to %s."), stereo? _T("stereo"):_T("mono")); - m_needConversion = true; - } - - tmp = data->m_samplingRate; - if (ioctl(dev, SNDCTL_DSP_SPEED, &tmp) < 0) - { - wxLogTrace(_T("sound"), _T("IOCTL failure (SNDCTL_DSP_SPEED)")); - return false; - } - if (tmp != data->m_samplingRate) - { - // If the rate the sound card is using is not within 1% of what the - // data specified then override the data setting. The only reason not - // to always override this is because of clock-rounding - // problems. Sound cards will sometimes use things like 44101 when you - // ask for 44100. No need overriding this and having strange output - // file rates for something that we can't hear anyways. - if (data->m_samplingRate - tmp > (tmp * .01) || - tmp - data->m_samplingRate > (tmp * .01)) { - wxLogTrace(_T("sound"), - _T("Unable to set DSP sampling rate to %d (wants %d)"), - data->m_samplingRate, tmp); - m_needConversion = true; - } - } - - // Do this last because some drivers can adjust the buffer sized based on - // the sampling rate, etc. - if (ioctl(dev, SNDCTL_DSP_GETBLKSIZE, &m_DSPblkSize) < 0) - { - wxLogTrace(_T("sound"), _T("IOCTL failure (SNDCTL_DSP_GETBLKSIZE)")); - return false; - } - return true; -} - -#endif // HAVE_SYS_SOUNDCARD_H - -// ---------------------------------------------------------------------------- -// wxSoundSyncOnlyAdaptor -// ---------------------------------------------------------------------------- - -#if wxUSE_THREADS - -class wxSoundSyncOnlyAdaptor; - -// this class manages asynchronous playback of audio if the backend doesn't -// support it natively (e.g. OSS backend) -class wxSoundAsyncPlaybackThread : public wxThread -{ -public: - wxSoundAsyncPlaybackThread(wxSoundSyncOnlyAdaptor *adaptor, - wxSoundData *data, unsigned flags) - : wxThread(), m_adapt(adaptor), m_data(data), m_flags(flags) {} - virtual ExitCode Entry(); - -protected: - wxSoundSyncOnlyAdaptor *m_adapt; - wxSoundData *m_data; - unsigned m_flags; -}; - -#endif // wxUSE_THREADS - -// This class turns wxSoundBackend that doesn't support asynchronous playback -// into one that does -class wxSoundSyncOnlyAdaptor : public wxSoundBackend -{ -public: - wxSoundSyncOnlyAdaptor(wxSoundBackend *backend) - : m_backend(backend), m_playing(false) {} - virtual ~wxSoundSyncOnlyAdaptor() - { - delete m_backend; - } - wxString GetName() const - { - return m_backend->GetName(); - } - int GetPriority() const - { - return m_backend->GetPriority(); - } - bool IsAvailable() const - { - return m_backend->IsAvailable(); - } - bool HasNativeAsyncPlayback() const - { - return true; - } - bool Play(wxSoundData *data, unsigned flags, - volatile wxSoundPlaybackStatus *status); - void Stop(); - bool IsPlaying() const; - -private: - friend class wxSoundAsyncPlaybackThread; - - wxSoundBackend *m_backend; - bool m_playing; -#if wxUSE_THREADS - // player thread holds this mutex and releases it after it finishes - // playing, so that the main thread knows when it can play sound - wxMutex m_mutexRightToPlay; - wxSoundPlaybackStatus m_status; -#endif -}; - - -#if wxUSE_THREADS -wxThread::ExitCode wxSoundAsyncPlaybackThread::Entry() -{ - m_adapt->m_backend->Play(m_data, m_flags & ~wxSOUND_ASYNC, - &m_adapt->m_status); - - m_data->DecRef(); - m_adapt->m_playing = false; - m_adapt->m_mutexRightToPlay.Unlock(); - wxLogTrace(_T("sound"), _T("terminated async playback thread")); - return 0; -} -#endif - -bool wxSoundSyncOnlyAdaptor::Play(wxSoundData *data, unsigned flags, - volatile wxSoundPlaybackStatus *status) -{ - Stop(); - if (flags & wxSOUND_ASYNC) - { -#if wxUSE_THREADS - m_mutexRightToPlay.Lock(); - m_status.m_playing = true; - m_status.m_stopRequested = false; - data->IncRef(); - wxThread *th = new wxSoundAsyncPlaybackThread(this, data, flags); - th->Create(); - th->Run(); - wxLogTrace(_T("sound"), _T("launched async playback thread")); - return true; -#else - wxLogError(_("Unable to play sound asynchronously.")); - return false; -#endif - } - else - { -#if wxUSE_THREADS - m_mutexRightToPlay.Lock(); -#endif - bool rv = m_backend->Play(data, flags, status); -#if wxUSE_THREADS - m_mutexRightToPlay.Unlock(); -#endif - return rv; - } -} - -void wxSoundSyncOnlyAdaptor::Stop() -{ - wxLogTrace(_T("sound"), _T("asking audio to stop")); - -#if wxUSE_THREADS - // tell the player thread (if running) to stop playback ASAP: - m_status.m_stopRequested = true; - - // acquire the mutex to be sure no sound is being played, then - // release it because we don't need it for anything (the effect of this - // is that calling thread will wait until playback thread reacts to - // our request to interrupt playback): - m_mutexRightToPlay.Lock(); - m_mutexRightToPlay.Unlock(); - wxLogTrace(_T("sound"), _T("audio was stopped")); -#endif -} - -bool wxSoundSyncOnlyAdaptor::IsPlaying() const -{ -#if wxUSE_THREADS - return m_status.m_playing; -#else - return false; -#endif -} - - -// ---------------------------------------------------------------------------- -// wxSound -// ---------------------------------------------------------------------------- - -wxSoundBackend *wxSound::ms_backend = NULL; - -// FIXME - temporary, until we have plugins architecture -#if wxUSE_LIBSDL - #if wxUSE_PLUGINS - wxDynamicLibrary *wxSound::ms_backendSDL = NULL; - #else - extern "C" wxSoundBackend *wxCreateSoundBackendSDL(); - #endif -#endif - -wxSound::wxSound() : m_data(NULL) -{ -} - -wxSound::wxSound(const wxString& sFileName, bool isResource) : m_data(NULL) -{ - Create(sFileName, isResource); -} - -wxSound::wxSound(int size, const wxByte* data) : m_data(NULL) -{ - Create(size, data); -} - -wxSound::~wxSound() -{ - Free(); -} - -bool wxSound::Create(const wxString& fileName, - bool WXUNUSED_UNLESS_DEBUG(isResource)) -{ - wxASSERT_MSG( !isResource, - _T("Loading sound from resources is only supported on Windows") ); - - Free(); - - wxFile fileWave; - if (!fileWave.Open(fileName, wxFile::read)) - { - return false; - } - - wxFileOffset lenOrig = fileWave.Length(); - if ( lenOrig == wxInvalidOffset ) - return false; - - size_t len = wx_truncate_cast(size_t, lenOrig); - wxUint8 *data = new wxUint8[len]; - if ( fileWave.Read(data, len) != lenOrig ) - { - delete [] data; - wxLogError(_("Couldn't load sound data from '%s'."), fileName.c_str()); - return false; - } - - if (!LoadWAV(data, len, false)) - { - delete [] data; - wxLogError(_("Sound file '%s' is in unsupported format."), - fileName.c_str()); - return false; - } - - return true; -} - -bool wxSound::Create(int size, const wxByte* data) -{ - wxASSERT( data != NULL ); - - Free(); - if (!LoadWAV(data, size, true)) - { - wxLogError(_("Sound data are in unsupported format.")); - return false; - } - return true; -} - -/*static*/ void wxSound::EnsureBackend() -{ - if (!ms_backend) - { - // FIXME -- make this fully dynamic when plugins architecture is in - // place -#if wxUSE_LIBSDL - //if (!ms_backend) - { -#if !wxUSE_PLUGINS - ms_backend = wxCreateSoundBackendSDL(); -#else - wxString dllname; - dllname.Printf(_T("%s/%s"), - wxDynamicLibrary::GetPluginsDirectory().c_str(), - wxDynamicLibrary::CanonicalizePluginName( - _T("sound_sdl"), wxDL_PLUGIN_BASE).c_str()); - wxLogTrace(_T("sound"), - _T("trying to load SDL plugin from '%s'..."), - dllname.c_str()); - wxLogNull null; - ms_backendSDL = new wxDynamicLibrary(dllname, wxDL_NOW); - if (!ms_backendSDL->IsLoaded()) - { - wxDELETE(ms_backendSDL); - } - else - { - typedef wxSoundBackend *(*wxCreateSoundBackend_t)(); - wxDYNLIB_FUNCTION(wxCreateSoundBackend_t, - wxCreateSoundBackendSDL, *ms_backendSDL); - if (pfnwxCreateSoundBackendSDL) - { - ms_backend = (*pfnwxCreateSoundBackendSDL)(); - } - } -#endif - if (ms_backend && !ms_backend->IsAvailable()) - { - wxDELETE(ms_backend); - } - } -#endif - -#ifdef HAVE_SYS_SOUNDCARD_H - if (!ms_backend) - { - ms_backend = new wxSoundBackendOSS(); - if (!ms_backend->IsAvailable()) - { - wxDELETE(ms_backend); - } - } -#endif - - if (!ms_backend) - ms_backend = new wxSoundBackendNull(); - - if (!ms_backend->HasNativeAsyncPlayback()) - ms_backend = new wxSoundSyncOnlyAdaptor(ms_backend); - - wxLogTrace(_T("sound"), - _T("using backend '%s'"), ms_backend->GetName().c_str()); - } -} - -/*static*/ void wxSound::UnloadBackend() -{ - if (ms_backend) - { - wxLogTrace(_T("sound"), _T("unloading backend")); - - Stop(); - - delete ms_backend; - ms_backend = NULL; -#if wxUSE_LIBSDL && wxUSE_PLUGINS - delete ms_backendSDL; -#endif - } -} - -bool wxSound::DoPlay(unsigned flags) const -{ - wxCHECK_MSG( IsOk(), false, _T("Attempt to play invalid wave data") ); - - EnsureBackend(); - wxSoundPlaybackStatus status; - status.m_playing = true; - status.m_stopRequested = false; - return ms_backend->Play(m_data, flags, &status); -} - -/*static*/ void wxSound::Stop() -{ - if (ms_backend) - ms_backend->Stop(); -} - -/*static*/ bool wxSound::IsPlaying() -{ - if (ms_backend) - return ms_backend->IsPlaying(); - else - return false; -} - -void wxSound::Free() -{ - if (m_data) - m_data->DecRef(); -} - -typedef struct -{ - wxUint32 uiSize; - wxUint16 uiFormatTag; - wxUint16 uiChannels; - wxUint32 ulSamplesPerSec; - wxUint32 ulAvgBytesPerSec; - wxUint16 uiBlockAlign; - wxUint16 uiBitsPerSample; -} WAVEFORMAT; - -#define WAVE_FORMAT_PCM 1 -#define WAVE_INDEX 8 -#define FMT_INDEX 12 - -bool wxSound::LoadWAV(const wxUint8 *data, size_t length, bool copyData) -{ - // the simplest wave file header consists of 44 bytes: - // - // 0 "RIFF" - // 4 file size - 8 - // 8 "WAVE" - // - // 12 "fmt " - // 16 chunk size | - // 20 format tag | - // 22 number of channels | - // 24 sample rate | WAVEFORMAT - // 28 average bytes per second | - // 32 bytes per frame | - // 34 bits per sample | - // - // 36 "data" - // 40 number of data bytes - // 44 (wave signal) data - // - // so check that we have at least as much - if ( length < 44 ) - return false; - - WAVEFORMAT waveformat; - memcpy(&waveformat, &data[FMT_INDEX + 4], sizeof(WAVEFORMAT)); - waveformat.uiSize = wxUINT32_SWAP_ON_BE(waveformat.uiSize); - waveformat.uiFormatTag = wxUINT16_SWAP_ON_BE(waveformat.uiFormatTag); - waveformat.uiChannels = wxUINT16_SWAP_ON_BE(waveformat.uiChannels); - waveformat.ulSamplesPerSec = wxUINT32_SWAP_ON_BE(waveformat.ulSamplesPerSec); - waveformat.ulAvgBytesPerSec = wxUINT32_SWAP_ON_BE(waveformat.ulAvgBytesPerSec); - waveformat.uiBlockAlign = wxUINT16_SWAP_ON_BE(waveformat.uiBlockAlign); - waveformat.uiBitsPerSample = wxUINT16_SWAP_ON_BE(waveformat.uiBitsPerSample); - - // get the sound data size - wxUint32 ul; - memcpy(&ul, &data[FMT_INDEX + waveformat.uiSize + 12], 4); - ul = wxUINT32_SWAP_ON_BE(ul); - - if ( length < ul + FMT_INDEX + waveformat.uiSize + 16 ) - return false; - - if (memcmp(data, "RIFF", 4) != 0) - return false; - if (memcmp(&data[WAVE_INDEX], "WAVE", 4) != 0) - return false; - if (memcmp(&data[FMT_INDEX], "fmt ", 4) != 0) - return false; - if (memcmp(&data[FMT_INDEX + waveformat.uiSize + 8], "data", 4) != 0) - return false; - - if (waveformat.uiFormatTag != WAVE_FORMAT_PCM) - return false; - - if (waveformat.ulSamplesPerSec != - waveformat.ulAvgBytesPerSec / waveformat.uiBlockAlign) - return false; - - m_data = new wxSoundData; - m_data->m_channels = waveformat.uiChannels; - m_data->m_samplingRate = waveformat.ulSamplesPerSec; - m_data->m_bitsPerSample = waveformat.uiBitsPerSample; - m_data->m_samples = ul / (m_data->m_channels * m_data->m_bitsPerSample / 8); - m_data->m_dataBytes = ul; - - if (copyData) - { - m_data->m_dataWithHeader = new wxUint8[length]; - memcpy(m_data->m_dataWithHeader, data, length); - } - else - m_data->m_dataWithHeader = (wxUint8*)data; - - m_data->m_data = - (&m_data->m_dataWithHeader[FMT_INDEX + waveformat.uiSize + 8]); - - return true; -} - - -// ---------------------------------------------------------------------------- -// wxSoundCleanupModule -// ---------------------------------------------------------------------------- - -class wxSoundCleanupModule: public wxModule -{ -public: - bool OnInit() { return true; } - void OnExit() { wxSound::UnloadBackend(); } - DECLARE_DYNAMIC_CLASS(wxSoundCleanupModule) -}; - -IMPLEMENT_DYNAMIC_CLASS(wxSoundCleanupModule, wxModule) - -#endif diff --git a/wxWidgets/src/unix/sound_sdl.cpp b/wxWidgets/src/unix/sound_sdl.cpp deleted file mode 100644 index db9c7a1320..0000000000 --- a/wxWidgets/src/unix/sound_sdl.cpp +++ /dev/null @@ -1,335 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/unix/sound_sdl.cpp -// Purpose: wxSound backend using SDL -// Author: Vaclav Slavik -// Modified by: -// Created: 2004/01/31 -// RCS-ID: $Id: sound_sdl.cpp 40943 2006-08-31 19:31:43Z ABX $ -// Copyright: (c) 2004, Open Source Applications Foundation -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// for compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#if defined(__BORLANDC__) - #pragma hdrstop -#endif - -#if wxUSE_SOUND && wxUSE_LIBSDL - -#include - -#ifndef WX_PRECOMP - #include "wx/event.h" - #include "wx/intl.h" - #include "wx/log.h" - #include "wx/utils.h" - #include "wx/module.h" -#endif - -#include "wx/thread.h" -#include "wx/sound.h" - -// ---------------------------------------------------------------------------- -// wxSoundBackendSDL, for Unix with libSDL -// ---------------------------------------------------------------------------- - -class wxSoundBackendSDLNotification : public wxEvent -{ -public: - DECLARE_DYNAMIC_CLASS(wxSoundBackendSDLNotification) - wxSoundBackendSDLNotification(); - wxEvent *Clone() const { return new wxSoundBackendSDLNotification(*this); } -}; - -typedef void (wxEvtHandler::*wxSoundBackendSDLNotificationFunction) - (wxSoundBackendSDLNotification&); - -BEGIN_DECLARE_EVENT_TYPES() - DECLARE_LOCAL_EVENT_TYPE(wxEVT_SOUND_BACKEND_SDL_NOTIFICATION, -1) -END_DECLARE_EVENT_TYPES() - -#define EVT_SOUND_BACKEND_SDL_NOTIFICATON(func) \ - DECLARE_EVENT_TABLE_ENTRY(wxEVT_SOUND_BACKEND_SDL_NOTIFICATION, \ - -1, \ - -1, \ - (wxObjectEventFunction) wxStaticCastEvent( wxSoundBackendSDLNotificationFunction, & func ), \ - (wxObject *) NULL ), - -IMPLEMENT_DYNAMIC_CLASS(wxSoundBackendSDLNotification, wxEvtHandler) -DEFINE_EVENT_TYPE(wxEVT_SOUND_BACKEND_SDL_NOTIFICATION) - -wxSoundBackendSDLNotification::wxSoundBackendSDLNotification() -{ - SetEventType(wxEVT_SOUND_BACKEND_SDL_NOTIFICATION); -} - -class wxSoundBackendSDLEvtHandler; - -class wxSoundBackendSDL : public wxSoundBackend -{ -public: - wxSoundBackendSDL() - : m_initialized(false), m_playing(false), m_audioOpen(false), - m_data(NULL), m_evtHandler(NULL) {} - virtual ~wxSoundBackendSDL(); - - wxString GetName() const { return _T("Simple DirectMedia Layer"); } - int GetPriority() const { return 9; } - bool IsAvailable() const; - bool HasNativeAsyncPlayback() const { return true; } - bool Play(wxSoundData *data, unsigned flags, - volatile wxSoundPlaybackStatus *status); - - void FillAudioBuffer(Uint8 *stream, int len); - void FinishedPlayback(); - - void Stop(); - bool IsPlaying() const { return m_playing; } - -private: - bool OpenAudio(); - void CloseAudio(); - - bool m_initialized; - bool m_playing, m_audioOpen; - // playback information: - wxSoundData *m_data; - unsigned m_pos; - SDL_AudioSpec m_spec; - bool m_loop; - - wxSoundBackendSDLEvtHandler *m_evtHandler; -}; - -class wxSoundBackendSDLEvtHandler : public wxEvtHandler -{ -public: - wxSoundBackendSDLEvtHandler(wxSoundBackendSDL *bk) : m_backend(bk) {} - -private: - void OnNotify(wxSoundBackendSDLNotification& WXUNUSED(event)) - { - wxLogTrace(_T("sound"), - _T("received playback status change notification")); - m_backend->FinishedPlayback(); - } - wxSoundBackendSDL *m_backend; - - DECLARE_EVENT_TABLE() -}; - -BEGIN_EVENT_TABLE(wxSoundBackendSDLEvtHandler, wxEvtHandler) - EVT_SOUND_BACKEND_SDL_NOTIFICATON(wxSoundBackendSDLEvtHandler::OnNotify) -END_EVENT_TABLE() - -wxSoundBackendSDL::~wxSoundBackendSDL() -{ - Stop(); - CloseAudio(); - delete m_evtHandler; -} - -bool wxSoundBackendSDL::IsAvailable() const -{ - if (m_initialized) - return true; - if (SDL_WasInit(SDL_INIT_AUDIO) != SDL_INIT_AUDIO) - { - if (SDL_Init(SDL_INIT_AUDIO | SDL_INIT_NOPARACHUTE) == -1) - return false; - } - wxConstCast(this, wxSoundBackendSDL)->m_initialized = true; - wxLogTrace(_T("sound"), _T("initialized SDL audio subsystem")); - return true; -} - -extern "C" void wx_sdl_audio_callback(void *userdata, Uint8 *stream, int len) -{ - wxSoundBackendSDL *bk = (wxSoundBackendSDL*)userdata; - bk->FillAudioBuffer(stream, len); -} - -void wxSoundBackendSDL::FillAudioBuffer(Uint8 *stream, int len) -{ - if (m_playing) - { - // finished playing the sample - if (m_pos == m_data->m_dataBytes) - { - m_playing = false; - wxSoundBackendSDLNotification event; - m_evtHandler->AddPendingEvent(event); - } - // still something to play - else - { - unsigned size = ((len + m_pos) < m_data->m_dataBytes) ? - len : - (m_data->m_dataBytes - m_pos); - memcpy(stream, m_data->m_data + m_pos, size); - m_pos += size; - len -= size; - stream += size; - } - } - // the sample doesn't play, fill the buffer with silence and wait for - // the main thread to shut the playback down: - if (len > 0) - { - if (m_loop) - { - m_pos = 0; - FillAudioBuffer(stream, len); - return; - } - else - { - memset(stream, m_spec.silence, len); - } - } -} - -void wxSoundBackendSDL::FinishedPlayback() -{ - if (!m_playing) - Stop(); -} - -bool wxSoundBackendSDL::OpenAudio() -{ - if (!m_audioOpen) - { - if (!m_evtHandler) - m_evtHandler = new wxSoundBackendSDLEvtHandler(this); - - m_spec.silence = 0; - m_spec.samples = 4096; - m_spec.size = 0; - m_spec.callback = wx_sdl_audio_callback; - m_spec.userdata = (void*)this; - - wxLogTrace(_T("sound"), _T("opening SDL audio...")); - if (SDL_OpenAudio(&m_spec, NULL) >= 0) - { -#if wxUSE_LOG_DEBUG - char driver[256]; - SDL_AudioDriverName(driver, 256); - wxLogTrace(_T("sound"), _T("opened audio, driver '%s'"), - wxString(driver, wxConvLocal).c_str()); -#endif - m_audioOpen = true; - return true; - } - else - { - wxString err(SDL_GetError(), wxConvLocal); - wxLogError(_("Couldn't open audio: %s"), err.c_str()); - return false; - } - } - return true; -} - -void wxSoundBackendSDL::CloseAudio() -{ - if (m_audioOpen) - { - SDL_CloseAudio(); - wxLogTrace(_T("sound"), _T("closed audio")); - m_audioOpen = false; - } -} - -bool wxSoundBackendSDL::Play(wxSoundData *data, unsigned flags, - volatile wxSoundPlaybackStatus *WXUNUSED(status)) -{ - Stop(); - - int format; - if (data->m_bitsPerSample == 8) - format = AUDIO_U8; - else if (data->m_bitsPerSample == 16) - format = AUDIO_S16LSB; - else - return false; - - bool needsOpen = true; - if (m_audioOpen) - { - if (format == m_spec.format && - m_spec.freq == (int)data->m_samplingRate && - m_spec.channels == data->m_channels) - { - needsOpen = false; - } - else - { - CloseAudio(); - } - } - - if (needsOpen) - { - m_spec.format = format; - m_spec.freq = data->m_samplingRate; - m_spec.channels = data->m_channels; - if (!OpenAudio()) - return false; - } - - SDL_LockAudio(); - wxLogTrace(_T("sound"), _T("playing new sound")); - m_playing = true; - m_pos = 0; - m_loop = (flags & wxSOUND_LOOP); - m_data = data; - data->IncRef(); - SDL_UnlockAudio(); - - SDL_PauseAudio(0); - - // wait until playback finishes if called in sync mode: - if (!(flags & wxSOUND_ASYNC)) - { - wxLogTrace(_T("sound"), _T("waiting for sample to finish")); - while (m_playing && m_data == data) - { -#if wxUSE_THREADS - // give the playback thread a chance to add event to pending - // events queue, release GUI lock temporarily: - if (wxThread::IsMain()) - wxMutexGuiLeave(); -#endif - wxMilliSleep(10); -#if wxUSE_THREADS - if (wxThread::IsMain()) - wxMutexGuiEnter(); -#endif - } - wxLogTrace(_T("sound"), _T("sample finished")); - } - - return true; -} - -void wxSoundBackendSDL::Stop() -{ - SDL_LockAudio(); - SDL_PauseAudio(1); - m_playing = false; - if (m_data) - { - m_data->DecRef(); - m_data = NULL; - } - SDL_UnlockAudio(); -} - -extern "C" wxSoundBackend *wxCreateSoundBackendSDL() -{ - return new wxSoundBackendSDL(); -} - -#endif // wxUSE_SOUND && wxUSE_LIBSDL diff --git a/wxWidgets/src/unix/stackwalk.cpp b/wxWidgets/src/unix/stackwalk.cpp deleted file mode 100644 index 8717a5f3a8..0000000000 --- a/wxWidgets/src/unix/stackwalk.cpp +++ /dev/null @@ -1,309 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: msw/stackwalk.cpp -// Purpose: wxStackWalker implementation for Unix/glibc -// Author: Vadim Zeitlin -// Modified by: -// Created: 2005-01-18 -// RCS-ID: $Id: stackwalk.cpp 43965 2006-12-13 13:04:44Z VZ $ -// Copyright: (c) 2005 Vadim Zeitlin -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_STACKWALKER - -#ifndef WX_PRECOMP - #include "wx/string.h" - #include "wx/app.h" - #include "wx/log.h" - #include "wx/utils.h" -#endif - -#include "wx/stackwalk.h" -#include "wx/stdpaths.h" - -#include - -#ifdef HAVE_CXA_DEMANGLE - #include -#endif // HAVE_CXA_DEMANGLE - -// ---------------------------------------------------------------------------- -// tiny helper wrapper around popen/pclose() -// ---------------------------------------------------------------------------- - -class wxStdioPipe -{ -public: - // ctor parameters are passed to popen() - wxStdioPipe(const char *command, const char *type) - { - m_fp = popen(command, type); - } - - // conversion to stdio FILE - operator FILE *() const { return m_fp; } - - // dtor closes the pipe - ~wxStdioPipe() - { - if ( m_fp ) - pclose(m_fp); - } - -private: - FILE *m_fp; - - DECLARE_NO_COPY_CLASS(wxStdioPipe) -}; - -// ============================================================================ -// implementation -// ============================================================================ - -// ---------------------------------------------------------------------------- -// wxStackFrame -// ---------------------------------------------------------------------------- - -void wxStackFrame::OnGetName() -{ - if ( !m_name.empty() ) - return; - - // we already tried addr2line in wxStackWalker::InitFrames: it always - // gives us demangled names (even if __cxa_demangle is not available) when - // the function is part of the ELF (when it's in a shared object addr2line - // will give "??") and because it seems less error-prone. - // when it works, backtrace_symbols() sometimes returns incorrect results - - // format is: "module(funcname+offset) [address]" but the part in - // parentheses can be not present - wxString syminfo = wxString::FromAscii(m_syminfo); - const size_t posOpen = syminfo.find(_T('(')); - if ( posOpen != wxString::npos ) - { - const size_t posPlus = syminfo.find(_T('+'), posOpen + 1); - if ( posPlus != wxString::npos ) - { - const size_t posClose = syminfo.find(_T(')'), posPlus + 1); - if ( posClose != wxString::npos ) - { - if ( m_name.empty() ) - { - m_name.assign(syminfo, posOpen + 1, posPlus - posOpen - 1); - -#ifdef HAVE_CXA_DEMANGLE - int rc = -1; - char *cppfunc = __cxxabiv1::__cxa_demangle - ( - m_name.mb_str(), - NULL, // output buffer (none, alloc it) - NULL, // [out] len of output buffer - &rc - ); - if ( rc == 0 ) - m_name = wxString::FromAscii(cppfunc); - - free(cppfunc); -#endif // HAVE_CXA_DEMANGLE - } - - unsigned long ofs; - if ( wxString(syminfo, posPlus + 1, posClose - posPlus - 1). - ToULong(&ofs, 0) ) - m_offset = ofs; - } - } - - m_module.assign(syminfo, posOpen); - } - else // not in "module(funcname+offset)" format - { - m_module = syminfo; - } -} - - -// ---------------------------------------------------------------------------- -// wxStackWalker -// ---------------------------------------------------------------------------- - -// that many frames should be enough for everyone -#define MAX_FRAMES 200 - -// we need a char buffer big enough to contain a call to addr2line with -// up to MAX_FRAMES addresses ! -// NB: %p specifier will print the pointer in hexadecimal form -// and thus will require 2 chars for each byte + 3 for the -// " 0x" prefix -#define CHARS_PER_FRAME (sizeof(void*) * 2 + 3) - -// BUFSIZE will be 2250 for 32 bit machines -#define BUFSIZE (50 + MAX_FRAMES*CHARS_PER_FRAME) - -// static data -void *wxStackWalker::ms_addresses[MAX_FRAMES]; -char **wxStackWalker::ms_symbols = NULL; -int wxStackWalker::m_depth = 0; -wxString wxStackWalker::ms_exepath; -static char g_buf[BUFSIZE]; - - -void wxStackWalker::SaveStack(size_t maxDepth) -{ - // read all frames required - maxDepth = wxMin(WXSIZEOF(ms_addresses)/sizeof(void*), maxDepth); - m_depth = backtrace(ms_addresses, maxDepth*sizeof(void*)); - if ( !m_depth ) - return; - - ms_symbols = backtrace_symbols(ms_addresses, m_depth); -} - -void wxStackWalker::ProcessFrames(size_t skip) -{ - wxStackFrame frames[MAX_FRAMES]; - - if (!ms_symbols || !m_depth) - return; - - // we have 3 more "intermediate" frames which the calling code doesn't know - // about, account for them - skip += 3; - - // call addr2line only once since this call may be very slow - // (it has to load in memory the entire EXE of this app which may be quite - // big, especially if it contains debug info and is compiled statically!) - int towalk = InitFrames(frames, m_depth - skip, &ms_addresses[skip], &ms_symbols[skip]); - - // now do user-defined operations on each frame - for ( int n = 0; n < towalk - (int)skip; n++ ) - OnStackFrame(frames[n]); -} - -void wxStackWalker::FreeStack() -{ - // ms_symbols has been allocated by backtrace_symbols() and it's the responsibility - // of the caller, i.e. us, to free that pointer - if (ms_symbols) - free( ms_symbols ); - ms_symbols = NULL; - m_depth = 0; -} - -int wxStackWalker::InitFrames(wxStackFrame *arr, size_t n, void **addresses, char **syminfo) -{ - // we need to launch addr2line tool to get this information and we need to - // have the program name for this - wxString exepath = wxStackWalker::GetExePath(); - if ( exepath.empty() ) - { - exepath = wxStandardPaths::Get().GetExecutablePath(); - if ( exepath.empty() ) - { - wxLogDebug(wxT("Cannot parse stack frame because the executable ") - wxT("path could not be detected")); - return 0; - } - } - - // build the (long) command line for executing addr2line in an optimized way - // (e.g. use always chars, even in Unicode build: popen() always takes chars) - int len = snprintf(g_buf, BUFSIZE, "addr2line -C -f -e \"%s\"", (const char*) exepath.mb_str()); - len = (len <= 0) ? strlen(g_buf) : len; // in case snprintf() is broken - for (size_t i=0; i -// License: wxWindows license -/////////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -// for compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_STDPATHS - -#include "wx/stdpaths.h" - -#ifndef WX_PRECOMP - #include "wx/utils.h" -#endif //WX_PRECOMP - -#include "wx/filename.h" - -#if defined( __LINUX__ ) || defined( __VMS ) - #include -#endif - -// ============================================================================ -// common VMS/Unix part of wxStandardPaths implementation -// ============================================================================ - -void wxStandardPaths::SetInstallPrefix(const wxString& prefix) -{ - m_prefix = prefix; -} - -wxString wxStandardPaths::GetUserConfigDir() const -{ - return wxFileName::GetHomeDir(); -} - -// ============================================================================ -// wxStandardPaths implementation for VMS -// ============================================================================ - -#ifdef __VMS - -wxString wxStandardPaths::GetInstallPrefix() const -{ - if ( m_prefix.empty() ) - { - wx_const_cast(wxStandardPaths *, this)->m_prefix = wxT("/sys$system"); - } - - return m_prefix; -} - -wxString wxStandardPaths::GetConfigDir() const -{ - return _T("/sys$manager"); -} - -wxString wxStandardPaths::GetDataDir() const -{ - return AppendAppName(GetInstallPrefix() + _T("/sys$share")); -} - -wxString wxStandardPaths::GetLocalDataDir() const -{ - return AppendAppName(_T("/sys$manager")); -} - -wxString wxStandardPaths::GetUserDataDir() const -{ - return wxFileName::GetHomeDir(); -} - -wxString wxStandardPaths::GetPluginsDir() const -{ - return wxString(); // TODO: this is wrong, it should return something -} - -wxString -wxStandardPaths::GetLocalizedResourcesDir(const wxChar *lang, - ResourceCat category) const -{ - return wxStandardPathsBase::GetLocalizedResourcesDir(lang, category); -} - -wxString wxStandardPaths::GetExecutablePath() const -{ - return wxStandardPathsBase::GetExecutablePath(); -} - -#else // !__VMS - -// ============================================================================ -// wxStandardPaths implementation for Unix -// ============================================================================ - -wxString wxStandardPaths::GetExecutablePath() const -{ -#ifdef __LINUX__ - wxString exeStr; - - char buf[4096]; - int result = readlink("/proc/self/exe", buf, WXSIZEOF(buf) - sizeof(char)); - if ( result != -1 ) - { - buf[result] = '\0'; // readlink() doesn't NUL-terminate the buffer - - // if the /proc/self/exe symlink has been dropped by the kernel for - // some reason, then readlink() could also return success but - // "(deleted)" as link destination... - if ( strcmp(buf, "(deleted)") != 0 ) - exeStr = wxString(buf, wxConvLibc); - } - - if ( exeStr.empty() ) - { - // UPX-specific hack: when using UPX on linux, the kernel will drop the - // /proc/self/exe link; in this case we try to look for a special - // environment variable called " " which is created by UPX to save - // /proc/self/exe contents. See - // http://sf.net/tracker/?func=detail&atid=309863&aid=1565357&group_id=9863 - // for more information about this issue. - wxGetEnv(wxT(" "), &exeStr); - } - - if ( !exeStr.empty() ) - return exeStr; -#endif // __LINUX__ - - return wxStandardPathsBase::GetExecutablePath(); -} - -void wxStandardPaths::DetectPrefix() -{ - // we can try to infer the prefix from the location of the executable - wxString exeStr = GetExecutablePath(); - if ( !exeStr.empty() ) - { - // consider that we're in the last "bin" subdirectory of our prefix - size_t pos = exeStr.rfind(wxT("/bin/")); - if ( pos != wxString::npos ) - m_prefix.assign(exeStr, 0, pos); - } - - if ( m_prefix.empty() ) - { - m_prefix = wxT("/usr/local"); - } -} - -wxString wxStandardPaths::GetInstallPrefix() const -{ - if ( m_prefix.empty() ) - { - wxStandardPaths *pathPtr = wx_const_cast(wxStandardPaths *, this); - pathPtr->DetectPrefix(); - } - - return m_prefix; -} - -// ---------------------------------------------------------------------------- -// public functions -// ---------------------------------------------------------------------------- - -wxString wxStandardPaths::GetConfigDir() const -{ - return _T("/etc"); -} - -wxString wxStandardPaths::GetDataDir() const -{ - return AppendAppName(GetInstallPrefix() + _T("/share")); -} - -wxString wxStandardPaths::GetLocalDataDir() const -{ - return AppendAppName(_T("/etc")); -} - -wxString wxStandardPaths::GetUserDataDir() const -{ - return AppendAppName(wxFileName::GetHomeDir() + _T("/.")); -} - -wxString wxStandardPaths::GetPluginsDir() const -{ - return AppendAppName(GetInstallPrefix() + _T("/lib")); -} - -wxString -wxStandardPaths::GetLocalizedResourcesDir(const wxChar *lang, - ResourceCat category) const -{ - if ( category != ResourceCat_Messages ) - return wxStandardPathsBase::GetLocalizedResourcesDir(lang, category); - - return GetInstallPrefix() + _T("/share/locale/") + lang + _T("/LC_MESSAGES"); -} - -#endif // __VMS/!__VMS - -#endif // wxUSE_STDPATHS diff --git a/wxWidgets/src/unix/taskbarx11.cpp b/wxWidgets/src/unix/taskbarx11.cpp deleted file mode 100644 index 48996cf26d..0000000000 --- a/wxWidgets/src/unix/taskbarx11.cpp +++ /dev/null @@ -1,346 +0,0 @@ -///////////////////////////////////////////////////////////////////////// -// File: src/unix/taskbarx11.cpp -// Purpose: wxTaskBarIcon class for common Unix desktops -// Author: Vaclav Slavik -// Modified by: -// Created: 04/04/2003 -// RCS-ID: $Id: taskbarx11.cpp 53582 2008-05-12 23:54:34Z RD $ -// Copyright: (c) Vaclav Slavik, 2003 -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////// - -// NB: This implementation does *not* work with every X11 window manager. -// Currently only GNOME 1.2 and KDE 1,2,3 methods are implemented here. -// Freedesktop.org's System Tray specification is implemented in -// src/gtk/taskbar.cpp and used from here under wxGTK. -// -// Thanks to Ian Campbell, author of XMMS Status Docklet, for publishing -// KDE and GNOME 1.2 methods. - - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef wxHAS_TASK_BAR_ICON - -#include "wx/taskbar.h" - -#ifndef WX_PRECOMP - #include "wx/log.h" - #include "wx/frame.h" - #include "wx/dcclient.h" - #include "wx/statbmp.h" - #include "wx/sizer.h" - #include "wx/bitmap.h" - #include "wx/image.h" -#endif - -#ifdef __VMS -#pragma message disable nosimpint -#endif -#include -#include -#ifdef __VMS -#pragma message enable nosimpint -#endif - -// ---------------------------------------------------------------------------- -// base class that implements toolkit-specific method: -// ---------------------------------------------------------------------------- - -#ifdef __WXGTK20__ - #include - #if GTK_CHECK_VERSION(2,1,0) - #include "wx/gtk/taskbarpriv.h" - #define TASKBAR_ICON_AREA_BASE_INCLUDED - #endif -#endif - -#ifndef TASKBAR_ICON_AREA_BASE_INCLUDED - class WXDLLIMPEXP_ADV wxTaskBarIconAreaBase : public wxFrame - { - public: - wxTaskBarIconAreaBase() - : wxFrame(NULL, wxID_ANY, _T("systray icon"), - wxDefaultPosition, wxDefaultSize, - wxDEFAULT_FRAME_STYLE | wxFRAME_NO_TASKBAR | - wxSIMPLE_BORDER | wxFRAME_SHAPED) {} - - bool IsProtocolSupported() const { return false; } - }; -#endif - - -// ---------------------------------------------------------------------------- -// toolkit dependent methods to set properties on helper window: -// ---------------------------------------------------------------------------- - -#if defined(__WXGTK__) - #include - #include - #include - #define GetDisplay() GDK_DISPLAY() - #define GetXWindow(wxwin) GDK_WINDOW_XWINDOW((wxwin)->m_widget->window) -#elif defined(__WXX11__) || defined(__WXMOTIF__) - #include "wx/x11/privx.h" - #define GetDisplay() ((Display*)wxGlobalDisplay()) - #define GetXWindow(wxwin) ((Window)(wxwin)->GetHandle()) -#else - #error "You must define X11 accessors for this port!" -#endif - - -// ---------------------------------------------------------------------------- -// wxTaskBarIconArea is the real window that shows the icon: -// ---------------------------------------------------------------------------- - -class WXDLLIMPEXP_ADV wxTaskBarIconArea : public wxTaskBarIconAreaBase -{ -public: - wxTaskBarIconArea(wxTaskBarIcon *icon, const wxBitmap &bmp); - void SetTrayIcon(const wxBitmap& bmp); - bool IsOk() { return true; } - -protected: - void SetLegacyWMProperties(); - - void OnSizeChange(wxSizeEvent& event); - void OnPaint(wxPaintEvent& evt); - void OnMouseEvent(wxMouseEvent& event); - void OnMenuEvent(wxCommandEvent& event); - - wxTaskBarIcon *m_icon; - wxPoint m_pos; - wxBitmap m_bmp; - - DECLARE_EVENT_TABLE() -}; - -BEGIN_EVENT_TABLE(wxTaskBarIconArea, wxTaskBarIconAreaBase) - EVT_SIZE(wxTaskBarIconArea::OnSizeChange) - EVT_MOUSE_EVENTS(wxTaskBarIconArea::OnMouseEvent) - EVT_MENU(wxID_ANY, wxTaskBarIconArea::OnMenuEvent) - EVT_PAINT(wxTaskBarIconArea::OnPaint) -END_EVENT_TABLE() - -wxTaskBarIconArea::wxTaskBarIconArea(wxTaskBarIcon *icon, const wxBitmap &bmp) - : wxTaskBarIconAreaBase(), m_icon(icon), m_pos(0,0) -{ -#if defined(__WXGTK20__) && defined(TASKBAR_ICON_AREA_BASE_INCLUDED) - m_invokingWindow = icon; -#endif - - // Set initial size to bitmap size (tray manager may and often will - // change it): - SetClientSize(wxSize(bmp.GetWidth(), bmp.GetHeight())); - - SetTrayIcon(bmp); - - if (!IsProtocolSupported()) - { - wxLogTrace(_T("systray"), - _T("using legacy KDE1,2 and GNOME 1.2 methods")); - SetLegacyWMProperties(); - } -} - -void wxTaskBarIconArea::SetTrayIcon(const wxBitmap& bmp) -{ - m_bmp = bmp; - - // determine suitable bitmap size: - wxSize winsize(GetClientSize()); - wxSize bmpsize(m_bmp.GetWidth(), m_bmp.GetHeight()); - wxSize iconsize(wxMin(winsize.x, bmpsize.x), wxMin(winsize.y, bmpsize.y)); - - // rescale the bitmap to fit into the tray icon window: - if (bmpsize != iconsize) - { - wxImage img = m_bmp.ConvertToImage(); - img.Rescale(iconsize.x, iconsize.y); - m_bmp = wxBitmap(img); - } - - wxRegion region; - region.Union(m_bmp); - - // if the bitmap is smaller than the window, offset it: - if (winsize != iconsize) - { - m_pos.x = (winsize.x - iconsize.x) / 2; - m_pos.y = (winsize.y - iconsize.y) / 2; - region.Offset(m_pos.x, m_pos.y); - } - - // set frame's shape to correct value and redraw: - SetShape(region); - Refresh(); -} - -void wxTaskBarIconArea::SetLegacyWMProperties() -{ -#ifdef __WXGTK__ - gtk_widget_realize(m_widget); -#endif - - long data[1]; - - // KDE 2 & KDE 3: - Atom _KDE_NET_WM_SYSTEM_TRAY_WINDOW_FOR = - XInternAtom(GetDisplay(), "_KDE_NET_WM_SYSTEM_TRAY_WINDOW_FOR", False); - data[0] = 0; - XChangeProperty(GetDisplay(), GetXWindow(this), - _KDE_NET_WM_SYSTEM_TRAY_WINDOW_FOR, - XA_WINDOW, 32, - PropModeReplace, (unsigned char*)data, 1); - - // GNOME 1.2 & KDE 1: - Atom KWM_DOCKWINDOW = - XInternAtom(GetDisplay(), "KWM_DOCKWINDOW", False); - data[0] = 1; - XChangeProperty(GetDisplay(), GetXWindow(this), - KWM_DOCKWINDOW, - KWM_DOCKWINDOW, 32, - PropModeReplace, (unsigned char*)data, 1); -} - -void wxTaskBarIconArea::OnSizeChange(wxSizeEvent& WXUNUSED(event)) -{ - wxLogTrace(_T("systray"), _T("icon size changed to %i x %i"), - GetSize().x, GetSize().y); - // rescale or reposition the icon as needed: - wxBitmap bmp(m_bmp); - SetTrayIcon(bmp); -} - -void wxTaskBarIconArea::OnPaint(wxPaintEvent& WXUNUSED(event)) -{ - wxPaintDC dc(this); - dc.DrawBitmap(m_bmp, m_pos.x, m_pos.y, true); -} - -void wxTaskBarIconArea::OnMouseEvent(wxMouseEvent& event) -{ - wxEventType type = 0; - wxEventType mtype = event.GetEventType(); - - if (mtype == wxEVT_LEFT_DOWN) - type = wxEVT_TASKBAR_LEFT_DOWN; - else if (mtype == wxEVT_LEFT_UP) - type = wxEVT_TASKBAR_LEFT_UP; - else if (mtype == wxEVT_LEFT_DCLICK) - type = wxEVT_TASKBAR_LEFT_DCLICK; - else if (mtype == wxEVT_RIGHT_DOWN) - type = wxEVT_TASKBAR_RIGHT_DOWN; - else if (mtype == wxEVT_RIGHT_UP) - type = wxEVT_TASKBAR_RIGHT_UP; - else if (mtype == wxEVT_RIGHT_DCLICK) - type = wxEVT_TASKBAR_RIGHT_DCLICK; - else if (mtype == wxEVT_MOTION) - type = wxEVT_TASKBAR_MOVE; - else - return; - - wxTaskBarIconEvent e(type, m_icon); - m_icon->ProcessEvent(e); -} - -void wxTaskBarIconArea::OnMenuEvent(wxCommandEvent& event) -{ - m_icon->ProcessEvent(event); -} - -// ---------------------------------------------------------------------------- -// wxTaskBarIcon class: -// ---------------------------------------------------------------------------- - -IMPLEMENT_DYNAMIC_CLASS(wxTaskBarIcon, wxEvtHandler) - -wxTaskBarIcon::wxTaskBarIcon() : m_iconWnd(NULL) -{ -} - -wxTaskBarIcon::~wxTaskBarIcon() -{ - if (m_iconWnd) - { - m_iconWnd->Disconnect(wxEVT_DESTROY, (wxObjectEventFunction)NULL, - (wxObject*)NULL, this); - RemoveIcon(); - } -} - -bool wxTaskBarIcon::IsOk() const -{ - return true; -} - -bool wxTaskBarIcon::IsIconInstalled() const -{ - return m_iconWnd != NULL; -} - -// Destroy event from wxTaskBarIconArea -void wxTaskBarIcon::OnDestroy(wxWindowDestroyEvent&) -{ - // prevent crash if wxTaskBarIconArea is destroyed by something else, - // for example if panel/kicker is killed - m_iconWnd = NULL; -} - -bool wxTaskBarIcon::SetIcon(const wxIcon& icon, const wxString& tooltip) -{ - wxBitmap bmp; - bmp.CopyFromIcon(icon); - - if (!m_iconWnd) - { - m_iconWnd = new wxTaskBarIconArea(this, bmp); - if (m_iconWnd->IsOk()) - { - m_iconWnd->Connect(wxEVT_DESTROY, - wxWindowDestroyEventHandler(wxTaskBarIcon::OnDestroy), - NULL, this); - m_iconWnd->Show(); - } - else - { - m_iconWnd->Destroy(); - m_iconWnd = NULL; - return false; - } - } - else - { - m_iconWnd->SetTrayIcon(bmp); - } - -#if wxUSE_TOOLTIPS - if (!tooltip.empty()) - m_iconWnd->SetToolTip(tooltip); - else - m_iconWnd->SetToolTip(NULL); -#else - wxUnusedVar(tooltip); -#endif - return true; -} - -bool wxTaskBarIcon::RemoveIcon() -{ - if (!m_iconWnd) - return false; - m_iconWnd->Destroy(); - m_iconWnd = NULL; - return true; -} - -bool wxTaskBarIcon::PopupMenu(wxMenu *menu) -{ - if (!m_iconWnd) - return false; - m_iconWnd->PopupMenu(menu); - return true; -} - -#endif // wxHAS_TASK_BAR_ICON diff --git a/wxWidgets/src/unix/threadpsx.cpp b/wxWidgets/src/unix/threadpsx.cpp deleted file mode 100644 index c857cdad32..0000000000 --- a/wxWidgets/src/unix/threadpsx.cpp +++ /dev/null @@ -1,1746 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/unix/threadpsx.cpp -// Purpose: wxThread (Posix) Implementation -// Author: Original from Wolfram Gloger/Guilhem Lavaux -// Modified by: K. S. Sreeram (2002): POSIXified wxCondition, added wxSemaphore -// Created: 04/22/98 -// RCS-ID: $Id: threadpsx.cpp 48537 2007-09-03 22:52:38Z VZ $ -// Copyright: (c) Wolfram Gloger (1996, 1997) -// Guilhem Lavaux (1998) -// Vadim Zeitlin (1999-2002) -// Robert Roebling (1999) -// K. S. Sreeram (2002) -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declaration -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -// for compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#if wxUSE_THREADS - -#include "wx/thread.h" - -#ifndef WX_PRECOMP - #include "wx/dynarray.h" - #include "wx/intl.h" - #include "wx/log.h" - #include "wx/utils.h" - #include "wx/timer.h" - #include "wx/stopwatch.h" - #include "wx/module.h" -#endif - -#include -#include -#include -#include -#include -#ifdef HAVE_SCHED_H - #include -#endif - -#ifdef HAVE_THR_SETCONCURRENCY - #include -#endif - -// we use wxFFile under Linux in GetCPUCount() -#ifdef __LINUX__ - #include "wx/ffile.h" - // For setpriority. - #include - #include -#endif - -#ifdef __VMS - #define THR_ID(thr) ((long long)(thr)->GetId()) -#else - #define THR_ID(thr) ((long)(thr)->GetId()) -#endif - -// ---------------------------------------------------------------------------- -// constants -// ---------------------------------------------------------------------------- - -// the possible states of the thread and transitions from them -enum wxThreadState -{ - STATE_NEW, // didn't start execution yet (=> RUNNING) - STATE_RUNNING, // running (=> PAUSED or EXITED) - STATE_PAUSED, // suspended (=> RUNNING or EXITED) - STATE_EXITED // thread doesn't exist any more -}; - -// the exit value of a thread which has been cancelled -static const wxThread::ExitCode EXITCODE_CANCELLED = (wxThread::ExitCode)-1; - -// trace mask for wxThread operations -#define TRACE_THREADS _T("thread") - -// you can get additional debugging messages for the semaphore operations -#define TRACE_SEMA _T("semaphore") - -// ---------------------------------------------------------------------------- -// private functions -// ---------------------------------------------------------------------------- - -static void ScheduleThreadForDeletion(); -static void DeleteThread(wxThread *This); - -// ---------------------------------------------------------------------------- -// private classes -// ---------------------------------------------------------------------------- - -// an (non owning) array of pointers to threads -WX_DEFINE_ARRAY_PTR(wxThread *, wxArrayThread); - -// an entry for a thread we can wait for - -// ----------------------------------------------------------------------------- -// global data -// ----------------------------------------------------------------------------- - -// we keep the list of all threads created by the application to be able to -// terminate them on exit if there are some left - otherwise the process would -// be left in memory -static wxArrayThread gs_allThreads; - -// a mutex to protect gs_allThreads -static wxMutex *gs_mutexAllThreads = NULL; - -// the id of the main thread -static pthread_t gs_tidMain = (pthread_t)-1; - -// the key for the pointer to the associated wxThread object -static pthread_key_t gs_keySelf; - -// the number of threads which are being deleted - the program won't exit -// until there are any left -static size_t gs_nThreadsBeingDeleted = 0; - -// a mutex to protect gs_nThreadsBeingDeleted -static wxMutex *gs_mutexDeleteThread = (wxMutex *)NULL; - -// and a condition variable which will be signaled when all -// gs_nThreadsBeingDeleted will have been deleted -static wxCondition *gs_condAllDeleted = (wxCondition *)NULL; - -// this mutex must be acquired before any call to a GUI function -// (it's not inside #if wxUSE_GUI because this file is compiled as part -// of wxBase) -static wxMutex *gs_mutexGui = NULL; - -// when we wait for a thread to exit, we're blocking on a condition which the -// thread signals in its SignalExit() method -- but this condition can't be a -// member of the thread itself as a detached thread may delete itself at any -// moment and accessing the condition member of the thread after this would -// result in a disaster -// -// so instead we maintain a global list of the structs below for the threads -// we're interested in waiting on - -// ============================================================================ -// wxMutex implementation -// ============================================================================ - -// ---------------------------------------------------------------------------- -// wxMutexInternal -// ---------------------------------------------------------------------------- - -// this is a simple wrapper around pthread_mutex_t which provides error -// checking -class wxMutexInternal -{ -public: - wxMutexInternal(wxMutexType mutexType); - ~wxMutexInternal(); - - wxMutexError Lock(); - wxMutexError TryLock(); - wxMutexError Unlock(); - - bool IsOk() const { return m_isOk; } - -private: - pthread_mutex_t m_mutex; - bool m_isOk; - - // wxConditionInternal uses our m_mutex - friend class wxConditionInternal; -}; - -#if defined(HAVE_PTHREAD_MUTEXATTR_T) && \ - wxUSE_UNIX && !defined(HAVE_PTHREAD_MUTEXATTR_SETTYPE_DECL) -// on some systems pthread_mutexattr_settype() is not in the headers (but it is -// in the library, otherwise we wouldn't compile this code at all) -extern "C" int pthread_mutexattr_settype(pthread_mutexattr_t *, int); -#endif - -wxMutexInternal::wxMutexInternal(wxMutexType mutexType) -{ - int err; - switch ( mutexType ) - { - case wxMUTEX_RECURSIVE: - // support recursive locks like Win32, i.e. a thread can lock a - // mutex which it had itself already locked - // - // unfortunately initialization of recursive mutexes is non - // portable, so try several methods -#ifdef HAVE_PTHREAD_MUTEXATTR_T - { - pthread_mutexattr_t attr; - pthread_mutexattr_init(&attr); - pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE); - - err = pthread_mutex_init(&m_mutex, &attr); - } -#elif defined(HAVE_PTHREAD_RECURSIVE_MUTEX_INITIALIZER) - // we can use this only as initializer so we have to assign it - // first to a temp var - assigning directly to m_mutex wouldn't - // even compile - { - pthread_mutex_t mutex = PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP; - m_mutex = mutex; - } -#else // no recursive mutexes - err = EINVAL; -#endif // HAVE_PTHREAD_MUTEXATTR_T/... - break; - - default: - wxFAIL_MSG( _T("unknown mutex type") ); - // fall through - - case wxMUTEX_DEFAULT: - err = pthread_mutex_init(&m_mutex, NULL); - break; - } - - m_isOk = err == 0; - if ( !m_isOk ) - { - wxLogApiError( wxT("pthread_mutex_init()"), err); - } -} - -wxMutexInternal::~wxMutexInternal() -{ - if ( m_isOk ) - { - int err = pthread_mutex_destroy(&m_mutex); - if ( err != 0 ) - { - wxLogApiError( wxT("pthread_mutex_destroy()"), err); - } - } -} - -wxMutexError wxMutexInternal::Lock() -{ - int err = pthread_mutex_lock(&m_mutex); - switch ( err ) - { - case EDEADLK: - // only error checking mutexes return this value and so it's an - // unexpected situation -- hence use assert, not wxLogDebug - wxFAIL_MSG( _T("mutex deadlock prevented") ); - return wxMUTEX_DEAD_LOCK; - - case EINVAL: - wxLogDebug(_T("pthread_mutex_lock(): mutex not initialized.")); - break; - - case 0: - return wxMUTEX_NO_ERROR; - - default: - wxLogApiError(_T("pthread_mutex_lock()"), err); - } - - return wxMUTEX_MISC_ERROR; -} - -wxMutexError wxMutexInternal::TryLock() -{ - int err = pthread_mutex_trylock(&m_mutex); - switch ( err ) - { - case EBUSY: - // not an error: mutex is already locked, but we're prepared for - // this - return wxMUTEX_BUSY; - - case EINVAL: - wxLogDebug(_T("pthread_mutex_trylock(): mutex not initialized.")); - break; - - case 0: - return wxMUTEX_NO_ERROR; - - default: - wxLogApiError(_T("pthread_mutex_trylock()"), err); - } - - return wxMUTEX_MISC_ERROR; -} - -wxMutexError wxMutexInternal::Unlock() -{ - int err = pthread_mutex_unlock(&m_mutex); - switch ( err ) - { - case EPERM: - // we don't own the mutex - return wxMUTEX_UNLOCKED; - - case EINVAL: - wxLogDebug(_T("pthread_mutex_unlock(): mutex not initialized.")); - break; - - case 0: - return wxMUTEX_NO_ERROR; - - default: - wxLogApiError(_T("pthread_mutex_unlock()"), err); - } - - return wxMUTEX_MISC_ERROR; -} - -// =========================================================================== -// wxCondition implementation -// =========================================================================== - -// --------------------------------------------------------------------------- -// wxConditionInternal -// --------------------------------------------------------------------------- - -// this is a wrapper around pthread_cond_t associated with a wxMutex (and hence -// with a pthread_mutex_t) -class wxConditionInternal -{ -public: - wxConditionInternal(wxMutex& mutex); - ~wxConditionInternal(); - - bool IsOk() const { return m_isOk && m_mutex.IsOk(); } - - wxCondError Wait(); - wxCondError WaitTimeout(unsigned long milliseconds); - - wxCondError Signal(); - wxCondError Broadcast(); - -private: - // get the POSIX mutex associated with us - pthread_mutex_t *GetPMutex() const { return &m_mutex.m_internal->m_mutex; } - - wxMutex& m_mutex; - pthread_cond_t m_cond; - - bool m_isOk; -}; - -wxConditionInternal::wxConditionInternal(wxMutex& mutex) - : m_mutex(mutex) -{ - int err = pthread_cond_init(&m_cond, NULL /* default attributes */); - - m_isOk = err == 0; - - if ( !m_isOk ) - { - wxLogApiError(_T("pthread_cond_init()"), err); - } -} - -wxConditionInternal::~wxConditionInternal() -{ - if ( m_isOk ) - { - int err = pthread_cond_destroy(&m_cond); - if ( err != 0 ) - { - wxLogApiError(_T("pthread_cond_destroy()"), err); - } - } -} - -wxCondError wxConditionInternal::Wait() -{ - int err = pthread_cond_wait(&m_cond, GetPMutex()); - if ( err != 0 ) - { - wxLogApiError(_T("pthread_cond_wait()"), err); - - return wxCOND_MISC_ERROR; - } - - return wxCOND_NO_ERROR; -} - -wxCondError wxConditionInternal::WaitTimeout(unsigned long milliseconds) -{ - wxLongLong curtime = wxGetLocalTimeMillis(); - curtime += milliseconds; - wxLongLong temp = curtime / 1000; - int sec = temp.GetLo(); - temp *= 1000; - temp = curtime - temp; - int millis = temp.GetLo(); - - timespec tspec; - - tspec.tv_sec = sec; - tspec.tv_nsec = millis * 1000L * 1000L; - - int err = pthread_cond_timedwait( &m_cond, GetPMutex(), &tspec ); - switch ( err ) - { - case ETIMEDOUT: - return wxCOND_TIMEOUT; - - case 0: - return wxCOND_NO_ERROR; - - default: - wxLogApiError(_T("pthread_cond_timedwait()"), err); - } - - return wxCOND_MISC_ERROR; -} - -wxCondError wxConditionInternal::Signal() -{ - int err = pthread_cond_signal(&m_cond); - if ( err != 0 ) - { - wxLogApiError(_T("pthread_cond_signal()"), err); - - return wxCOND_MISC_ERROR; - } - - return wxCOND_NO_ERROR; -} - -wxCondError wxConditionInternal::Broadcast() -{ - int err = pthread_cond_broadcast(&m_cond); - if ( err != 0 ) - { - wxLogApiError(_T("pthread_cond_broadcast()"), err); - - return wxCOND_MISC_ERROR; - } - - return wxCOND_NO_ERROR; -} - -// =========================================================================== -// wxSemaphore implementation -// =========================================================================== - -// --------------------------------------------------------------------------- -// wxSemaphoreInternal -// --------------------------------------------------------------------------- - -// we implement the semaphores using mutexes and conditions instead of using -// the sem_xxx() POSIX functions because they're not widely available and also -// because it's impossible to implement WaitTimeout() using them -class wxSemaphoreInternal -{ -public: - wxSemaphoreInternal(int initialcount, int maxcount); - - bool IsOk() const { return m_isOk; } - - wxSemaError Wait(); - wxSemaError TryWait(); - wxSemaError WaitTimeout(unsigned long milliseconds); - - wxSemaError Post(); - -private: - wxMutex m_mutex; - wxCondition m_cond; - - size_t m_count, - m_maxcount; - - bool m_isOk; -}; - -wxSemaphoreInternal::wxSemaphoreInternal(int initialcount, int maxcount) - : m_cond(m_mutex) -{ - - if ( (initialcount < 0 || maxcount < 0) || - ((maxcount > 0) && (initialcount > maxcount)) ) - { - wxFAIL_MSG( _T("wxSemaphore: invalid initial or maximal count") ); - - m_isOk = false; - } - else - { - m_maxcount = (size_t)maxcount; - m_count = (size_t)initialcount; - } - - m_isOk = m_mutex.IsOk() && m_cond.IsOk(); -} - -wxSemaError wxSemaphoreInternal::Wait() -{ - wxMutexLocker locker(m_mutex); - - while ( m_count == 0 ) - { - wxLogTrace(TRACE_SEMA, - _T("Thread %ld waiting for semaphore to become signalled"), - wxThread::GetCurrentId()); - - if ( m_cond.Wait() != wxCOND_NO_ERROR ) - return wxSEMA_MISC_ERROR; - - wxLogTrace(TRACE_SEMA, - _T("Thread %ld finished waiting for semaphore, count = %lu"), - wxThread::GetCurrentId(), (unsigned long)m_count); - } - - m_count--; - - return wxSEMA_NO_ERROR; -} - -wxSemaError wxSemaphoreInternal::TryWait() -{ - wxMutexLocker locker(m_mutex); - - if ( m_count == 0 ) - return wxSEMA_BUSY; - - m_count--; - - return wxSEMA_NO_ERROR; -} - -wxSemaError wxSemaphoreInternal::WaitTimeout(unsigned long milliseconds) -{ - wxMutexLocker locker(m_mutex); - - wxLongLong startTime = wxGetLocalTimeMillis(); - - while ( m_count == 0 ) - { - wxLongLong elapsed = wxGetLocalTimeMillis() - startTime; - long remainingTime = (long)milliseconds - (long)elapsed.GetLo(); - if ( remainingTime <= 0 ) - { - // timeout - return wxSEMA_TIMEOUT; - } - - switch ( m_cond.WaitTimeout(remainingTime) ) - { - case wxCOND_TIMEOUT: - return wxSEMA_TIMEOUT; - - default: - return wxSEMA_MISC_ERROR; - - case wxCOND_NO_ERROR: - ; - } - } - - m_count--; - - return wxSEMA_NO_ERROR; -} - -wxSemaError wxSemaphoreInternal::Post() -{ - wxMutexLocker locker(m_mutex); - - if ( m_maxcount > 0 && m_count == m_maxcount ) - { - return wxSEMA_OVERFLOW; - } - - m_count++; - - wxLogTrace(TRACE_SEMA, - _T("Thread %ld about to signal semaphore, count = %lu"), - wxThread::GetCurrentId(), (unsigned long)m_count); - - return m_cond.Signal() == wxCOND_NO_ERROR ? wxSEMA_NO_ERROR - : wxSEMA_MISC_ERROR; -} - -// =========================================================================== -// wxThread implementation -// =========================================================================== - -// the thread callback functions must have the C linkage -extern "C" -{ - -#ifdef wxHAVE_PTHREAD_CLEANUP - // thread exit function - void wxPthreadCleanup(void *ptr); -#endif // wxHAVE_PTHREAD_CLEANUP - -void *wxPthreadStart(void *ptr); - -} // extern "C" - -// ---------------------------------------------------------------------------- -// wxThreadInternal -// ---------------------------------------------------------------------------- - -class wxThreadInternal -{ -public: - wxThreadInternal(); - ~wxThreadInternal(); - - // thread entry function - static void *PthreadStart(wxThread *thread); - - // thread actions - // start the thread - wxThreadError Run(); - // unblock the thread allowing it to run - void SignalRun() { m_semRun.Post(); } - // ask the thread to terminate - void Wait(); - // go to sleep until Resume() is called - void Pause(); - // resume the thread - void Resume(); - - // accessors - // priority - int GetPriority() const { return m_prio; } - void SetPriority(int prio) { m_prio = prio; } - // state - wxThreadState GetState() const { return m_state; } - void SetState(wxThreadState state) - { -#ifdef __WXDEBUG__ - static const wxChar *stateNames[] = - { - _T("NEW"), - _T("RUNNING"), - _T("PAUSED"), - _T("EXITED"), - }; - - wxLogTrace(TRACE_THREADS, _T("Thread %ld: %s => %s."), - (long)GetId(), stateNames[m_state], stateNames[state]); -#endif // __WXDEBUG__ - - m_state = state; - } - // id - pthread_t GetId() const { return m_threadId; } - pthread_t *GetIdPtr() { return &m_threadId; } - // "cancelled" flag - void SetCancelFlag() { m_cancelled = true; } - bool WasCancelled() const { return m_cancelled; } - // exit code - void SetExitCode(wxThread::ExitCode exitcode) { m_exitcode = exitcode; } - wxThread::ExitCode GetExitCode() const { return m_exitcode; } - - // the pause flag - void SetReallyPaused(bool paused) { m_isPaused = paused; } - bool IsReallyPaused() const { return m_isPaused; } - - // tell the thread that it is a detached one - void Detach() - { - wxCriticalSectionLocker lock(m_csJoinFlag); - - m_shouldBeJoined = false; - m_isDetached = true; - } - -#ifdef wxHAVE_PTHREAD_CLEANUP - // this is used by wxPthreadCleanup() only - static void Cleanup(wxThread *thread); -#endif // wxHAVE_PTHREAD_CLEANUP - -private: - pthread_t m_threadId; // id of the thread - wxThreadState m_state; // see wxThreadState enum - int m_prio; // in wxWidgets units: from 0 to 100 - - // this flag is set when the thread should terminate - bool m_cancelled; - - // this flag is set when the thread is blocking on m_semSuspend - bool m_isPaused; - - // the thread exit code - only used for joinable (!detached) threads and - // is only valid after the thread termination - wxThread::ExitCode m_exitcode; - - // many threads may call Wait(), but only one of them should call - // pthread_join(), so we have to keep track of this - wxCriticalSection m_csJoinFlag; - bool m_shouldBeJoined; - bool m_isDetached; - - // this semaphore is posted by Run() and the threads Entry() is not - // called before it is done - wxSemaphore m_semRun; - - // this one is signaled when the thread should resume after having been - // Pause()d - wxSemaphore m_semSuspend; -}; - -// ---------------------------------------------------------------------------- -// thread startup and exit functions -// ---------------------------------------------------------------------------- - -void *wxPthreadStart(void *ptr) -{ - return wxThreadInternal::PthreadStart((wxThread *)ptr); -} - -void *wxThreadInternal::PthreadStart(wxThread *thread) -{ - wxThreadInternal *pthread = thread->m_internal; - - wxLogTrace(TRACE_THREADS, _T("Thread %ld started."), THR_ID(pthread)); - - // associate the thread pointer with the newly created thread so that - // wxThread::This() will work - int rc = pthread_setspecific(gs_keySelf, thread); - if ( rc != 0 ) - { - wxLogSysError(rc, _("Cannot start thread: error writing TLS")); - - return (void *)-1; - } - - // have to declare this before pthread_cleanup_push() which defines a - // block! - bool dontRunAtAll; - -#ifdef wxHAVE_PTHREAD_CLEANUP - // install the cleanup handler which will be called if the thread is - // cancelled - pthread_cleanup_push(wxPthreadCleanup, thread); -#endif // wxHAVE_PTHREAD_CLEANUP - - // wait for the semaphore to be posted from Run() - pthread->m_semRun.Wait(); - - // test whether we should run the run at all - may be it was deleted - // before it started to Run()? - { - wxCriticalSectionLocker lock(thread->m_critsect); - - dontRunAtAll = pthread->GetState() == STATE_NEW && - pthread->WasCancelled(); - } - - if ( !dontRunAtAll ) - { - // call the main entry - wxLogTrace(TRACE_THREADS, - _T("Thread %ld about to enter its Entry()."), - THR_ID(pthread)); - - pthread->m_exitcode = thread->Entry(); - - wxLogTrace(TRACE_THREADS, - _T("Thread %ld Entry() returned %lu."), - THR_ID(pthread), wxPtrToUInt(pthread->m_exitcode)); - - { - wxCriticalSectionLocker lock(thread->m_critsect); - - // change the state of the thread to "exited" so that - // wxPthreadCleanup handler won't do anything from now (if it's - // called before we do pthread_cleanup_pop below) - pthread->SetState(STATE_EXITED); - } - } - - // NB: pthread_cleanup_push/pop() are macros and pop contains the matching - // '}' for the '{' in push, so they must be used in the same block! -#ifdef wxHAVE_PTHREAD_CLEANUP - #ifdef __DECCXX - // under Tru64 we get a warning from macro expansion - #pragma message save - #pragma message disable(declbutnotref) - #endif - - // remove the cleanup handler without executing it - pthread_cleanup_pop(FALSE); - - #ifdef __DECCXX - #pragma message restore - #endif -#endif // wxHAVE_PTHREAD_CLEANUP - - if ( dontRunAtAll ) - { - // FIXME: deleting a possibly joinable thread here??? - delete thread; - - return EXITCODE_CANCELLED; - } - else - { - // terminate the thread - thread->Exit(pthread->m_exitcode); - - wxFAIL_MSG(wxT("wxThread::Exit() can't return.")); - - return NULL; - } -} - -#ifdef wxHAVE_PTHREAD_CLEANUP - -// this handler is called when the thread is cancelled -extern "C" void wxPthreadCleanup(void *ptr) -{ - wxThreadInternal::Cleanup((wxThread *)ptr); -} - -void wxThreadInternal::Cleanup(wxThread *thread) -{ - if (pthread_getspecific(gs_keySelf) == 0) return; - { - wxCriticalSectionLocker lock(thread->m_critsect); - if ( thread->m_internal->GetState() == STATE_EXITED ) - { - // thread is already considered as finished. - return; - } - } - - // exit the thread gracefully - thread->Exit(EXITCODE_CANCELLED); -} - -#endif // wxHAVE_PTHREAD_CLEANUP - -// ---------------------------------------------------------------------------- -// wxThreadInternal -// ---------------------------------------------------------------------------- - -wxThreadInternal::wxThreadInternal() -{ - m_state = STATE_NEW; - m_cancelled = false; - m_prio = WXTHREAD_DEFAULT_PRIORITY; - m_threadId = 0; - m_exitcode = 0; - - // set to true only when the thread starts waiting on m_semSuspend - m_isPaused = false; - - // defaults for joinable threads - m_shouldBeJoined = true; - m_isDetached = false; -} - -wxThreadInternal::~wxThreadInternal() -{ -} - -wxThreadError wxThreadInternal::Run() -{ - wxCHECK_MSG( GetState() == STATE_NEW, wxTHREAD_RUNNING, - wxT("thread may only be started once after Create()") ); - - SetState(STATE_RUNNING); - - // wake up threads waiting for our start - SignalRun(); - - return wxTHREAD_NO_ERROR; -} - -void wxThreadInternal::Wait() -{ - wxCHECK_RET( !m_isDetached, _T("can't wait for a detached thread") ); - - // if the thread we're waiting for is waiting for the GUI mutex, we will - // deadlock so make sure we release it temporarily - if ( wxThread::IsMain() ) - wxMutexGuiLeave(); - - wxLogTrace(TRACE_THREADS, - _T("Starting to wait for thread %ld to exit."), - THR_ID(this)); - - // to avoid memory leaks we should call pthread_join(), but it must only be - // done once so use a critical section to serialize the code below - { - wxCriticalSectionLocker lock(m_csJoinFlag); - - if ( m_shouldBeJoined ) - { - // FIXME shouldn't we set cancellation type to DISABLED here? If - // we're cancelled inside pthread_join(), things will almost - // certainly break - but if we disable the cancellation, we - // might deadlock - if ( pthread_join(GetId(), &m_exitcode) != 0 ) - { - // this is a serious problem, so use wxLogError and not - // wxLogDebug: it is possible to bring the system to its knees - // by creating too many threads and not joining them quite - // easily - wxLogError(_("Failed to join a thread, potential memory leak detected - please restart the program")); - } - - m_shouldBeJoined = false; - } - } - - // reacquire GUI mutex - if ( wxThread::IsMain() ) - wxMutexGuiEnter(); -} - -void wxThreadInternal::Pause() -{ - // the state is set from the thread which pauses us first, this function - // is called later so the state should have been already set - wxCHECK_RET( m_state == STATE_PAUSED, - wxT("thread must first be paused with wxThread::Pause().") ); - - wxLogTrace(TRACE_THREADS, - _T("Thread %ld goes to sleep."), THR_ID(this)); - - // wait until the semaphore is Post()ed from Resume() - m_semSuspend.Wait(); -} - -void wxThreadInternal::Resume() -{ - wxCHECK_RET( m_state == STATE_PAUSED, - wxT("can't resume thread which is not suspended.") ); - - // the thread might be not actually paused yet - if there were no call to - // TestDestroy() since the last call to Pause() for example - if ( IsReallyPaused() ) - { - wxLogTrace(TRACE_THREADS, - _T("Waking up thread %ld"), THR_ID(this)); - - // wake up Pause() - m_semSuspend.Post(); - - // reset the flag - SetReallyPaused(false); - } - else - { - wxLogTrace(TRACE_THREADS, - _T("Thread %ld is not yet really paused"), THR_ID(this)); - } - - SetState(STATE_RUNNING); -} - -// ----------------------------------------------------------------------------- -// wxThread static functions -// ----------------------------------------------------------------------------- - -wxThread *wxThread::This() -{ - return (wxThread *)pthread_getspecific(gs_keySelf); -} - -bool wxThread::IsMain() -{ - return (bool)pthread_equal(pthread_self(), gs_tidMain) || gs_tidMain == (pthread_t)-1; -} - -void wxThread::Yield() -{ -#ifdef HAVE_SCHED_YIELD - sched_yield(); -#endif -} - -void wxThread::Sleep(unsigned long milliseconds) -{ - wxMilliSleep(milliseconds); -} - -int wxThread::GetCPUCount() -{ -#if defined(_SC_NPROCESSORS_ONLN) - // this works for Solaris and Linux 2.6 - int rc = sysconf(_SC_NPROCESSORS_ONLN); - if ( rc != -1 ) - { - return rc; - } -#elif defined(__LINUX__) && wxUSE_FFILE - // read from proc (can't use wxTextFile here because it's a special file: - // it has 0 size but still can be read from) - wxLogNull nolog; - - wxFFile file(_T("/proc/cpuinfo")); - if ( file.IsOpened() ) - { - // slurp the whole file - wxString s; - if ( file.ReadAll(&s) ) - { - // (ab)use Replace() to find the number of "processor: num" strings - size_t count = s.Replace(_T("processor\t:"), _T("")); - if ( count > 0 ) - { - return count; - } - - wxLogDebug(_T("failed to parse /proc/cpuinfo")); - } - else - { - wxLogDebug(_T("failed to read /proc/cpuinfo")); - } - } -#endif // different ways to get number of CPUs - - // unknown - return -1; -} - -// VMS is a 64 bit system and threads have 64 bit pointers. -// FIXME: also needed for other systems???? -#ifdef __VMS -unsigned long long wxThread::GetCurrentId() -{ - return (unsigned long long)pthread_self(); -} - -#else // !__VMS - -unsigned long wxThread::GetCurrentId() -{ - return (unsigned long)pthread_self(); -} - -#endif // __VMS/!__VMS - - -bool wxThread::SetConcurrency(size_t level) -{ -#ifdef HAVE_THR_SETCONCURRENCY - int rc = thr_setconcurrency(level); - if ( rc != 0 ) - { - wxLogSysError(rc, _T("thr_setconcurrency() failed")); - } - - return rc == 0; -#else // !HAVE_THR_SETCONCURRENCY - // ok only for the default value - return level == 0; -#endif // HAVE_THR_SETCONCURRENCY/!HAVE_THR_SETCONCURRENCY -} - -// ----------------------------------------------------------------------------- -// creating thread -// ----------------------------------------------------------------------------- - -wxThread::wxThread(wxThreadKind kind) -{ - // add this thread to the global list of all threads - { - wxMutexLocker lock(*gs_mutexAllThreads); - - gs_allThreads.Add(this); - } - - m_internal = new wxThreadInternal(); - - m_isDetached = kind == wxTHREAD_DETACHED; -} - -#ifdef HAVE_PTHREAD_ATTR_SETSTACKSIZE - #define WXUNUSED_STACKSIZE(identifier) identifier -#else - #define WXUNUSED_STACKSIZE(identifier) WXUNUSED(identifier) -#endif - -wxThreadError wxThread::Create(unsigned int WXUNUSED_STACKSIZE(stackSize)) -{ - if ( m_internal->GetState() != STATE_NEW ) - { - // don't recreate thread - return wxTHREAD_RUNNING; - } - - // set up the thread attribute: right now, we only set thread priority - pthread_attr_t attr; - pthread_attr_init(&attr); - -#ifdef HAVE_PTHREAD_ATTR_SETSTACKSIZE - if (stackSize) - pthread_attr_setstacksize(&attr, stackSize); -#endif - -#ifdef HAVE_THREAD_PRIORITY_FUNCTIONS - int policy; - if ( pthread_attr_getschedpolicy(&attr, &policy) != 0 ) - { - wxLogError(_("Cannot retrieve thread scheduling policy.")); - } - -#ifdef __VMS__ - /* the pthread.h contains too many spaces. This is a work-around */ -# undef sched_get_priority_max -#undef sched_get_priority_min -#define sched_get_priority_max(_pol_) \ - (_pol_ == SCHED_OTHER ? PRI_FG_MAX_NP : PRI_FIFO_MAX) -#define sched_get_priority_min(_pol_) \ - (_pol_ == SCHED_OTHER ? PRI_FG_MIN_NP : PRI_FIFO_MIN) -#endif - - int max_prio = sched_get_priority_max(policy), - min_prio = sched_get_priority_min(policy), - prio = m_internal->GetPriority(); - - if ( min_prio == -1 || max_prio == -1 ) - { - wxLogError(_("Cannot get priority range for scheduling policy %d."), - policy); - } - else if ( max_prio == min_prio ) - { - if ( prio != WXTHREAD_DEFAULT_PRIORITY ) - { - // notify the programmer that this doesn't work here - wxLogWarning(_("Thread priority setting is ignored.")); - } - //else: we have default priority, so don't complain - - // anyhow, don't do anything because priority is just ignored - } - else - { - struct sched_param sp; - if ( pthread_attr_getschedparam(&attr, &sp) != 0 ) - { - wxFAIL_MSG(_T("pthread_attr_getschedparam() failed")); - } - - sp.sched_priority = min_prio + (prio*(max_prio - min_prio))/100; - - if ( pthread_attr_setschedparam(&attr, &sp) != 0 ) - { - wxFAIL_MSG(_T("pthread_attr_setschedparam(priority) failed")); - } - } -#endif // HAVE_THREAD_PRIORITY_FUNCTIONS - -#ifdef HAVE_PTHREAD_ATTR_SETSCOPE - // this will make the threads created by this process really concurrent - if ( pthread_attr_setscope(&attr, PTHREAD_SCOPE_SYSTEM) != 0 ) - { - wxFAIL_MSG(_T("pthread_attr_setscope(PTHREAD_SCOPE_SYSTEM) failed")); - } -#endif // HAVE_PTHREAD_ATTR_SETSCOPE - - // VZ: assume that this one is always available (it's rather fundamental), - // if this function is ever missing we should try to use - // pthread_detach() instead (after thread creation) - if ( m_isDetached ) - { - if ( pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED) != 0 ) - { - wxFAIL_MSG(_T("pthread_attr_setdetachstate(DETACHED) failed")); - } - - // never try to join detached threads - m_internal->Detach(); - } - //else: threads are created joinable by default, it's ok - - // create the new OS thread object - int rc = pthread_create - ( - m_internal->GetIdPtr(), - &attr, - wxPthreadStart, - (void *)this - ); - - if ( pthread_attr_destroy(&attr) != 0 ) - { - wxFAIL_MSG(_T("pthread_attr_destroy() failed")); - } - - if ( rc != 0 ) - { - m_internal->SetState(STATE_EXITED); - - return wxTHREAD_NO_RESOURCE; - } - - return wxTHREAD_NO_ERROR; -} - -wxThreadError wxThread::Run() -{ - wxCriticalSectionLocker lock(m_critsect); - - wxCHECK_MSG( m_internal->GetId(), wxTHREAD_MISC_ERROR, - wxT("must call wxThread::Create() first") ); - - return m_internal->Run(); -} - -// ----------------------------------------------------------------------------- -// misc accessors -// ----------------------------------------------------------------------------- - -void wxThread::SetPriority(unsigned int prio) -{ - wxCHECK_RET( ((int)WXTHREAD_MIN_PRIORITY <= (int)prio) && - ((int)prio <= (int)WXTHREAD_MAX_PRIORITY), - wxT("invalid thread priority") ); - - wxCriticalSectionLocker lock(m_critsect); - - switch ( m_internal->GetState() ) - { - case STATE_NEW: - // thread not yet started, priority will be set when it is - m_internal->SetPriority(prio); - break; - - case STATE_RUNNING: - case STATE_PAUSED: -#ifdef HAVE_THREAD_PRIORITY_FUNCTIONS -#if defined(__LINUX__) - // On Linux, pthread_setschedparam with SCHED_OTHER does not allow - // a priority other than 0. Instead, we use the BSD setpriority - // which alllows us to set a 'nice' value between 20 to -20. Only - // super user can set a value less than zero (more negative yields - // higher priority). setpriority set the static priority of a - // process, but this is OK since Linux is configured as a thread - // per process. - // - // FIXME this is not true for 2.6!! - - // map wx priorites WXTHREAD_MIN_PRIORITY..WXTHREAD_MAX_PRIORITY - // to Unix priorities 20..-20 - if ( setpriority(PRIO_PROCESS, 0, -(2*(int)prio)/5 + 20) == -1 ) - { - wxLogError(_("Failed to set thread priority %d."), prio); - } -#else // __LINUX__ - { - struct sched_param sparam; - sparam.sched_priority = prio; - - if ( pthread_setschedparam(m_internal->GetId(), - SCHED_OTHER, &sparam) != 0 ) - { - wxLogError(_("Failed to set thread priority %d."), prio); - } - } -#endif // __LINUX__ -#endif // HAVE_THREAD_PRIORITY_FUNCTIONS - break; - - case STATE_EXITED: - default: - wxFAIL_MSG(wxT("impossible to set thread priority in this state")); - } -} - -unsigned int wxThread::GetPriority() const -{ - wxCriticalSectionLocker lock((wxCriticalSection &)m_critsect); - - return m_internal->GetPriority(); -} - -wxThreadIdType wxThread::GetId() const -{ - return (wxThreadIdType) m_internal->GetId(); -} - -// ----------------------------------------------------------------------------- -// pause/resume -// ----------------------------------------------------------------------------- - -wxThreadError wxThread::Pause() -{ - wxCHECK_MSG( This() != this, wxTHREAD_MISC_ERROR, - _T("a thread can't pause itself") ); - - wxCriticalSectionLocker lock(m_critsect); - - if ( m_internal->GetState() != STATE_RUNNING ) - { - wxLogDebug(wxT("Can't pause thread which is not running.")); - - return wxTHREAD_NOT_RUNNING; - } - - // just set a flag, the thread will be really paused only during the next - // call to TestDestroy() - m_internal->SetState(STATE_PAUSED); - - return wxTHREAD_NO_ERROR; -} - -wxThreadError wxThread::Resume() -{ - wxCHECK_MSG( This() != this, wxTHREAD_MISC_ERROR, - _T("a thread can't resume itself") ); - - wxCriticalSectionLocker lock(m_critsect); - - wxThreadState state = m_internal->GetState(); - - switch ( state ) - { - case STATE_PAUSED: - wxLogTrace(TRACE_THREADS, _T("Thread %ld suspended, resuming."), - GetId()); - - m_internal->Resume(); - - return wxTHREAD_NO_ERROR; - - case STATE_EXITED: - wxLogTrace(TRACE_THREADS, _T("Thread %ld exited, won't resume."), - GetId()); - return wxTHREAD_NO_ERROR; - - default: - wxLogDebug(_T("Attempt to resume a thread which is not paused.")); - - return wxTHREAD_MISC_ERROR; - } -} - -// ----------------------------------------------------------------------------- -// exiting thread -// ----------------------------------------------------------------------------- - -wxThread::ExitCode wxThread::Wait() -{ - wxCHECK_MSG( This() != this, (ExitCode)-1, - _T("a thread can't wait for itself") ); - - wxCHECK_MSG( !m_isDetached, (ExitCode)-1, - _T("can't wait for detached thread") ); - - m_internal->Wait(); - - return m_internal->GetExitCode(); -} - -wxThreadError wxThread::Delete(ExitCode *rc) -{ - wxCHECK_MSG( This() != this, wxTHREAD_MISC_ERROR, - _T("a thread can't delete itself") ); - - bool isDetached = m_isDetached; - - m_critsect.Enter(); - wxThreadState state = m_internal->GetState(); - - // ask the thread to stop - m_internal->SetCancelFlag(); - - m_critsect.Leave(); - - switch ( state ) - { - case STATE_NEW: - // we need to wake up the thread so that PthreadStart() will - // terminate - right now it's blocking on run semaphore in - // PthreadStart() - m_internal->SignalRun(); - - // fall through - - case STATE_EXITED: - // nothing to do - break; - - case STATE_PAUSED: - // resume the thread first - m_internal->Resume(); - - // fall through - - default: - if ( !isDetached ) - { - // wait until the thread stops - m_internal->Wait(); - - if ( rc ) - { - // return the exit code of the thread - *rc = m_internal->GetExitCode(); - } - } - //else: can't wait for detached threads - } - - return wxTHREAD_NO_ERROR; -} - -wxThreadError wxThread::Kill() -{ - wxCHECK_MSG( This() != this, wxTHREAD_MISC_ERROR, - _T("a thread can't kill itself") ); - - switch ( m_internal->GetState() ) - { - case STATE_NEW: - case STATE_EXITED: - return wxTHREAD_NOT_RUNNING; - - case STATE_PAUSED: - // resume the thread first - Resume(); - - // fall through - - default: -#ifdef HAVE_PTHREAD_CANCEL - if ( pthread_cancel(m_internal->GetId()) != 0 ) -#endif // HAVE_PTHREAD_CANCEL - { - wxLogError(_("Failed to terminate a thread.")); - - return wxTHREAD_MISC_ERROR; - } - -#ifdef HAVE_PTHREAD_CANCEL - if ( m_isDetached ) - { - // if we use cleanup function, this will be done from - // wxPthreadCleanup() -#ifndef wxHAVE_PTHREAD_CLEANUP - ScheduleThreadForDeletion(); - - // don't call OnExit() here, it can only be called in the - // threads context and we're in the context of another thread - - DeleteThread(this); -#endif // wxHAVE_PTHREAD_CLEANUP - } - else - { - m_internal->SetExitCode(EXITCODE_CANCELLED); - } - - return wxTHREAD_NO_ERROR; -#endif // HAVE_PTHREAD_CANCEL - } -} - -void wxThread::Exit(ExitCode status) -{ - wxASSERT_MSG( This() == this, - _T("wxThread::Exit() can only be called in the context of the same thread") ); - - if ( m_isDetached ) - { - // from the moment we call OnExit(), the main program may terminate at - // any moment, so mark this thread as being already in process of being - // deleted or wxThreadModule::OnExit() will try to delete it again - ScheduleThreadForDeletion(); - } - - // don't enter m_critsect before calling OnExit() because the user code - // might deadlock if, for example, it signals a condition in OnExit() (a - // common case) while the main thread calls any of functions entering - // m_critsect on us (almost all of them do) - OnExit(); - - // delete C++ thread object if this is a detached thread - user is - // responsible for doing this for joinable ones - if ( m_isDetached ) - { - // FIXME I'm feeling bad about it - what if another thread function is - // called (in another thread context) now? It will try to access - // half destroyed object which will probably result in something - // very bad - but we can't protect this by a crit section unless - // we make it a global object, but this would mean that we can - // only call one thread function at a time :-( - DeleteThread(this); - pthread_setspecific(gs_keySelf, 0); - } - else - { - m_critsect.Enter(); - m_internal->SetState(STATE_EXITED); - m_critsect.Leave(); - } - - // terminate the thread (pthread_exit() never returns) - pthread_exit(status); - - wxFAIL_MSG(_T("pthread_exit() failed")); -} - -// also test whether we were paused -bool wxThread::TestDestroy() -{ - wxASSERT_MSG( This() == this, - _T("wxThread::TestDestroy() can only be called in the context of the same thread") ); - - m_critsect.Enter(); - - if ( m_internal->GetState() == STATE_PAUSED ) - { - m_internal->SetReallyPaused(true); - - // leave the crit section or the other threads will stop too if they - // try to call any of (seemingly harmless) IsXXX() functions while we - // sleep - m_critsect.Leave(); - - m_internal->Pause(); - } - else - { - // thread wasn't requested to pause, nothing to do - m_critsect.Leave(); - } - - return m_internal->WasCancelled(); -} - -wxThread::~wxThread() -{ -#ifdef __WXDEBUG__ - m_critsect.Enter(); - - // check that the thread either exited or couldn't be created - if ( m_internal->GetState() != STATE_EXITED && - m_internal->GetState() != STATE_NEW ) - { - wxLogDebug(_T("The thread %ld is being destroyed although it is still running! The application may crash."), - (long)GetId()); - } - - m_critsect.Leave(); -#endif // __WXDEBUG__ - - delete m_internal; - - // remove this thread from the global array - { - wxMutexLocker lock(*gs_mutexAllThreads); - - gs_allThreads.Remove(this); - } -} - -// ----------------------------------------------------------------------------- -// state tests -// ----------------------------------------------------------------------------- - -bool wxThread::IsRunning() const -{ - wxCriticalSectionLocker lock((wxCriticalSection &)m_critsect); - - return m_internal->GetState() == STATE_RUNNING; -} - -bool wxThread::IsAlive() const -{ - wxCriticalSectionLocker lock((wxCriticalSection&)m_critsect); - - switch ( m_internal->GetState() ) - { - case STATE_RUNNING: - case STATE_PAUSED: - return true; - - default: - return false; - } -} - -bool wxThread::IsPaused() const -{ - wxCriticalSectionLocker lock((wxCriticalSection&)m_critsect); - - return (m_internal->GetState() == STATE_PAUSED); -} - -//-------------------------------------------------------------------- -// wxThreadModule -//-------------------------------------------------------------------- - -class wxThreadModule : public wxModule -{ -public: - virtual bool OnInit(); - virtual void OnExit(); - -private: - DECLARE_DYNAMIC_CLASS(wxThreadModule) -}; - -IMPLEMENT_DYNAMIC_CLASS(wxThreadModule, wxModule) - -bool wxThreadModule::OnInit() -{ - int rc = pthread_key_create(&gs_keySelf, NULL /* dtor function */); - if ( rc != 0 ) - { - wxLogSysError(rc, _("Thread module initialization failed: failed to create thread key")); - - return false; - } - - gs_tidMain = pthread_self(); - - gs_mutexAllThreads = new wxMutex(); - - gs_mutexGui = new wxMutex(); - gs_mutexGui->Lock(); - - gs_mutexDeleteThread = new wxMutex(); - gs_condAllDeleted = new wxCondition(*gs_mutexDeleteThread); - - return true; -} - -void wxThreadModule::OnExit() -{ - wxASSERT_MSG( wxThread::IsMain(), wxT("only main thread can be here") ); - - // are there any threads left which are being deleted right now? - size_t nThreadsBeingDeleted; - - { - wxMutexLocker lock( *gs_mutexDeleteThread ); - nThreadsBeingDeleted = gs_nThreadsBeingDeleted; - - if ( nThreadsBeingDeleted > 0 ) - { - wxLogTrace(TRACE_THREADS, - _T("Waiting for %lu threads to disappear"), - (unsigned long)nThreadsBeingDeleted); - - // have to wait until all of them disappear - gs_condAllDeleted->Wait(); - } - } - - size_t count; - - { - wxMutexLocker lock(*gs_mutexAllThreads); - - // terminate any threads left - count = gs_allThreads.GetCount(); - if ( count != 0u ) - { - wxLogDebug(wxT("%lu threads were not terminated by the application."), - (unsigned long)count); - } - } // unlock mutex before deleting the threads as they lock it in their dtor - - for ( size_t n = 0u; n < count; n++ ) - { - // Delete calls the destructor which removes the current entry. We - // should only delete the first one each time. - gs_allThreads[0]->Delete(); - } - - delete gs_mutexAllThreads; - - // destroy GUI mutex - gs_mutexGui->Unlock(); - delete gs_mutexGui; - - // and free TLD slot - (void)pthread_key_delete(gs_keySelf); - - delete gs_condAllDeleted; - delete gs_mutexDeleteThread; -} - -// ---------------------------------------------------------------------------- -// global functions -// ---------------------------------------------------------------------------- - -static void ScheduleThreadForDeletion() -{ - wxMutexLocker lock( *gs_mutexDeleteThread ); - - gs_nThreadsBeingDeleted++; - - wxLogTrace(TRACE_THREADS, _T("%lu thread%s waiting to be deleted"), - (unsigned long)gs_nThreadsBeingDeleted, - gs_nThreadsBeingDeleted == 1 ? _T("") : _T("s")); -} - -static void DeleteThread(wxThread *This) -{ - // gs_mutexDeleteThread should be unlocked before signalling the condition - // or wxThreadModule::OnExit() would deadlock - wxMutexLocker locker( *gs_mutexDeleteThread ); - - wxLogTrace(TRACE_THREADS, _T("Thread %ld auto deletes."), This->GetId()); - - delete This; - - wxCHECK_RET( gs_nThreadsBeingDeleted > 0, - _T("no threads scheduled for deletion, yet we delete one?") ); - - wxLogTrace(TRACE_THREADS, _T("%lu scheduled for deletion threads left."), - (unsigned long)gs_nThreadsBeingDeleted - 1); - - if ( !--gs_nThreadsBeingDeleted ) - { - // no more threads left, signal it - gs_condAllDeleted->Signal(); - } -} - -void wxMutexGuiEnter() -{ - gs_mutexGui->Lock(); -} - -void wxMutexGuiLeave() -{ - gs_mutexGui->Unlock(); -} - -// ---------------------------------------------------------------------------- -// include common implementation code -// ---------------------------------------------------------------------------- - -#include "wx/thrimpl.cpp" - -#endif // wxUSE_THREADS diff --git a/wxWidgets/src/unix/utilsunx.cpp b/wxWidgets/src/unix/utilsunx.cpp deleted file mode 100644 index cc1e7188b9..0000000000 --- a/wxWidgets/src/unix/utilsunx.cpp +++ /dev/null @@ -1,1362 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/unix/utilsunx.cpp -// Purpose: generic Unix implementation of many wx functions -// Author: Vadim Zeitlin -// Id: $Id: utilsunx.cpp 49239 2007-10-19 03:10:31Z DE $ -// Copyright: (c) 1998 Robert Roebling, Vadim Zeitlin -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -// for compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#include "wx/utils.h" - -#ifndef WX_PRECOMP - #include "wx/string.h" - #include "wx/intl.h" - #include "wx/log.h" - #include "wx/app.h" -#endif - -#include "wx/apptrait.h" - -#include "wx/process.h" -#include "wx/thread.h" - -#include "wx/wfstream.h" - -#include "wx/unix/execute.h" -#include "wx/unix/private.h" - -#include - -#ifdef HAVE_SYS_SELECT_H -# include -#endif - -#define HAS_PIPE_INPUT_STREAM (wxUSE_STREAMS && wxUSE_FILE) - -#if HAS_PIPE_INPUT_STREAM - -// define this to let wxexec.cpp know that we know what we're doing -#define _WX_USED_BY_WXEXECUTE_ -#include "../common/execcmn.cpp" - -#endif // HAS_PIPE_INPUT_STREAM - -#if wxUSE_BASE - -#if defined(__MWERKS__) && defined(__MACH__) - #ifndef WXWIN_OS_DESCRIPTION - #define WXWIN_OS_DESCRIPTION "MacOS X" - #endif - #ifndef HAVE_NANOSLEEP - #define HAVE_NANOSLEEP - #endif - #ifndef HAVE_UNAME - #define HAVE_UNAME - #endif - - // our configure test believes we can use sigaction() if the function is - // available but Metrowekrs with MSL run-time does have the function but - // doesn't have sigaction struct so finally we can't use it... - #ifdef __MSL__ - #undef wxUSE_ON_FATAL_EXCEPTION - #define wxUSE_ON_FATAL_EXCEPTION 0 - #endif -#endif - -// not only the statfs syscall is called differently depending on platform, but -// one of its incarnations, statvfs(), takes different arguments under -// different platforms and even different versions of the same system (Solaris -// 7 and 8): if you want to test for this, don't forget that the problems only -// appear if the large files support is enabled -#ifdef HAVE_STATFS - #ifdef __BSD__ - #include - #include - #else // !__BSD__ - #include - #endif // __BSD__/!__BSD__ - - #define wxStatfs statfs - - #ifndef HAVE_STATFS_DECL - // some systems lack statfs() prototype in the system headers (AIX 4) - extern "C" int statfs(const char *path, struct statfs *buf); - #endif -#endif // HAVE_STATFS - -#ifdef HAVE_STATVFS - #include - - #define wxStatfs statvfs -#endif // HAVE_STATVFS - -#if defined(HAVE_STATFS) || defined(HAVE_STATVFS) - // WX_STATFS_T is detected by configure - #define wxStatfs_t WX_STATFS_T -#endif - -// SGI signal.h defines signal handler arguments differently depending on -// whether _LANGUAGE_C_PLUS_PLUS is set or not - do set it -#if defined(__SGI__) && !defined(_LANGUAGE_C_PLUS_PLUS) - #define _LANGUAGE_C_PLUS_PLUS 1 -#endif // SGI hack - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include // for O_WRONLY and friends -#include // nanosleep() and/or usleep() -#include // isspace() -#include // needed for FD_SETSIZE - -#ifdef HAVE_UNAME - #include // for uname() -#endif // HAVE_UNAME - -// Used by wxGetFreeMemory(). -#ifdef __SGI__ - #include - #include // for SAGET and MINFO structures -#endif - -// ---------------------------------------------------------------------------- -// conditional compilation -// ---------------------------------------------------------------------------- - -// many versions of Unices have this function, but it is not defined in system -// headers - please add your system here if it is the case for your OS. -// SunOS < 5.6 (i.e. Solaris < 2.6) and DG-UX are like this. -#if !defined(HAVE_USLEEP) && \ - ((defined(__SUN__) && !defined(__SunOs_5_6) && \ - !defined(__SunOs_5_7) && !defined(__SUNPRO_CC)) || \ - defined(__osf__) || defined(__EMX__)) - extern "C" - { - #ifdef __EMX__ - /* I copied this from the XFree86 diffs. AV. */ - #define INCL_DOSPROCESS - #include - inline void usleep(unsigned long delay) - { - DosSleep(delay ? (delay/1000l) : 1l); - } - #else // Unix - int usleep(unsigned int usec); - #endif // __EMX__/Unix - }; - - #define HAVE_USLEEP 1 -#endif // Unices without usleep() - -// ============================================================================ -// implementation -// ============================================================================ - -// ---------------------------------------------------------------------------- -// sleeping -// ---------------------------------------------------------------------------- - -void wxSleep(int nSecs) -{ - sleep(nSecs); -} - -void wxMicroSleep(unsigned long microseconds) -{ -#if defined(HAVE_NANOSLEEP) - timespec tmReq; - tmReq.tv_sec = (time_t)(microseconds / 1000000); - tmReq.tv_nsec = (microseconds % 1000000) * 1000; - - // we're not interested in remaining time nor in return value - (void)nanosleep(&tmReq, (timespec *)NULL); -#elif defined(HAVE_USLEEP) - // uncomment this if you feel brave or if you are sure that your version - // of Solaris has a safe usleep() function but please notice that usleep() - // is known to lead to crashes in MT programs in Solaris 2.[67] and is not - // documented as MT-Safe - #if defined(__SUN__) && wxUSE_THREADS - #error "usleep() cannot be used in MT programs under Solaris." - #endif // Sun - - usleep(microseconds); -#elif defined(HAVE_SLEEP) - // under BeOS sleep() takes seconds (what about other platforms, if any?) - sleep(microseconds * 1000000); -#else // !sleep function - #error "usleep() or nanosleep() function required for wxMicroSleep" -#endif // sleep function -} - -void wxMilliSleep(unsigned long milliseconds) -{ - wxMicroSleep(milliseconds*1000); -} - -// ---------------------------------------------------------------------------- -// process management -// ---------------------------------------------------------------------------- - -int wxKill(long pid, wxSignal sig, wxKillError *rc, int flags) -{ - int err = kill((pid_t) (flags & wxKILL_CHILDREN) ? -pid : pid, (int)sig); - if ( rc ) - { - switch ( err ? errno : 0 ) - { - case 0: - *rc = wxKILL_OK; - break; - - case EINVAL: - *rc = wxKILL_BAD_SIGNAL; - break; - - case EPERM: - *rc = wxKILL_ACCESS_DENIED; - break; - - case ESRCH: - *rc = wxKILL_NO_PROCESS; - break; - - default: - // this goes against Unix98 docs so log it - wxLogDebug(_T("unexpected kill(2) return value %d"), err); - - // something else... - *rc = wxKILL_ERROR; - } - } - - return err; -} - -#define WXEXECUTE_NARGS 127 - -#if defined(__DARWIN__) -long wxMacExecute(wxChar **argv, - int flags, - wxProcess *process); -#endif - -long wxExecute( const wxString& command, int flags, wxProcess *process ) -{ - wxCHECK_MSG( !command.empty(), 0, wxT("can't exec empty command") ); - - wxLogTrace(wxT("exec"), wxT("Executing \"%s\""), command.c_str()); - -#if wxUSE_THREADS - // fork() doesn't mix well with POSIX threads: on many systems the program - // deadlocks or crashes for some reason. Probably our code is buggy and - // doesn't do something which must be done to allow this to work, but I - // don't know what yet, so for now just warn the user (this is the least we - // can do) about it - wxASSERT_MSG( wxThread::IsMain(), - _T("wxExecute() can be called only from the main thread") ); -#endif // wxUSE_THREADS - - int argc = 0; - wxChar *argv[WXEXECUTE_NARGS]; - wxString argument; - const wxChar *cptr = command.c_str(); - wxChar quotechar = wxT('\0'); // is arg quoted? - bool escaped = false; - - // split the command line in arguments - do - { - argument = wxEmptyString; - quotechar = wxT('\0'); - - // eat leading whitespace: - while ( wxIsspace(*cptr) ) - cptr++; - - if ( *cptr == wxT('\'') || *cptr == wxT('"') ) - quotechar = *cptr++; - - do - { - if ( *cptr == wxT('\\') && ! escaped ) - { - escaped = true; - cptr++; - continue; - } - - // all other characters: - argument += *cptr++; - escaped = false; - - // have we reached the end of the argument? - if ( (*cptr == quotechar && ! escaped) - || (quotechar == wxT('\0') && wxIsspace(*cptr)) - || *cptr == wxT('\0') ) - { - wxASSERT_MSG( argc < WXEXECUTE_NARGS, - wxT("too many arguments in wxExecute") ); - - argv[argc] = new wxChar[argument.length() + 1]; - wxStrcpy(argv[argc], argument.c_str()); - argc++; - - // if not at end of buffer, swallow last character: - if(*cptr) - cptr++; - - break; // done with this one, start over - } - } while(*cptr); - } while(*cptr); - argv[argc] = NULL; - - long lRc; -#if defined(__DARWIN__) - // wxMacExecute only executes app bundles. - // It returns an error code if the target is not an app bundle, thus falling - // through to the regular wxExecute for non app bundles. - lRc = wxMacExecute(argv, flags, process); - if( lRc != ((flags & wxEXEC_SYNC) ? -1 : 0)) - return lRc; -#endif - - // do execute the command - lRc = wxExecute(argv, flags, process); - - // clean up - argc = 0; - while( argv[argc] ) - delete [] argv[argc++]; - - return lRc; -} - -// ---------------------------------------------------------------------------- -// wxShell -// ---------------------------------------------------------------------------- - -static wxString wxMakeShellCommand(const wxString& command) -{ - wxString cmd; - if ( !command ) - { - // just an interactive shell - cmd = _T("xterm"); - } - else - { - // execute command in a shell - cmd << _T("/bin/sh -c '") << command << _T('\''); - } - - return cmd; -} - -bool wxShell(const wxString& command) -{ - return wxExecute(wxMakeShellCommand(command), wxEXEC_SYNC) == 0; -} - -bool wxShell(const wxString& command, wxArrayString& output) -{ - wxCHECK_MSG( !command.empty(), false, _T("can't exec shell non interactively") ); - - return wxExecute(wxMakeShellCommand(command), output); -} - -// Shutdown or reboot the PC -bool wxShutdown(wxShutdownFlags wFlags) -{ - wxChar level; - switch ( wFlags ) - { - case wxSHUTDOWN_POWEROFF: - level = _T('0'); - break; - - case wxSHUTDOWN_REBOOT: - level = _T('6'); - break; - - default: - wxFAIL_MSG( _T("unknown wxShutdown() flag") ); - return false; - } - - return system(wxString::Format(_T("init %c"), level).mb_str()) == 0; -} - -// ---------------------------------------------------------------------------- -// wxStream classes to support IO redirection in wxExecute -// ---------------------------------------------------------------------------- - -#if HAS_PIPE_INPUT_STREAM - -bool wxPipeInputStream::CanRead() const -{ - if ( m_lasterror == wxSTREAM_EOF ) - return false; - - // check if there is any input available - struct timeval tv; - tv.tv_sec = 0; - tv.tv_usec = 0; - - const int fd = m_file->fd(); - - fd_set readfds; - - wxFD_ZERO(&readfds); - wxFD_SET(fd, &readfds); - - switch ( select(fd + 1, &readfds, NULL, NULL, &tv) ) - { - case -1: - wxLogSysError(_("Impossible to get child process input")); - // fall through - - case 0: - return false; - - default: - wxFAIL_MSG(_T("unexpected select() return value")); - // still fall through - - case 1: - // input available -- or maybe not, as select() returns 1 when a - // read() will complete without delay, but it could still not read - // anything - return !Eof(); - } -} - -#endif // HAS_PIPE_INPUT_STREAM - -// ---------------------------------------------------------------------------- -// wxExecute: the real worker function -// ---------------------------------------------------------------------------- - -long wxExecute(wxChar **argv, int flags, wxProcess *process) -{ - // for the sync execution, we return -1 to indicate failure, but for async - // case we return 0 which is never a valid PID - // - // we define this as a macro, not a variable, to avoid compiler warnings - // about "ERROR_RETURN_CODE value may be clobbered by fork()" - #define ERROR_RETURN_CODE ((flags & wxEXEC_SYNC) ? -1 : 0) - - wxCHECK_MSG( *argv, ERROR_RETURN_CODE, wxT("can't exec empty command") ); - -#if wxUSE_UNICODE - int mb_argc = 0; - char *mb_argv[WXEXECUTE_NARGS]; - - while (argv[mb_argc]) - { - wxWX2MBbuf mb_arg = wxSafeConvertWX2MB(argv[mb_argc]); - mb_argv[mb_argc] = strdup(mb_arg); - mb_argc++; - } - mb_argv[mb_argc] = (char *) NULL; - - // this macro will free memory we used above - #define ARGS_CLEANUP \ - for ( mb_argc = 0; mb_argv[mb_argc]; mb_argc++ ) \ - free(mb_argv[mb_argc]) -#else // ANSI - // no need for cleanup - #define ARGS_CLEANUP - - wxChar **mb_argv = argv; -#endif // Unicode/ANSI - - // we want this function to work even if there is no wxApp so ensure that - // we have a valid traits pointer - wxConsoleAppTraits traitsConsole; - wxAppTraits *traits = wxTheApp ? wxTheApp->GetTraits() : NULL; - if ( !traits ) - traits = &traitsConsole; - - // this struct contains all information which we pass to and from - // wxAppTraits methods - wxExecuteData execData; - execData.flags = flags; - execData.process = process; - - // create pipes - if ( !traits->CreateEndProcessPipe(execData) ) - { - wxLogError( _("Failed to execute '%s'\n"), *argv ); - - ARGS_CLEANUP; - - return ERROR_RETURN_CODE; - } - - // pipes for inter process communication - wxPipe pipeIn, // stdin - pipeOut, // stdout - pipeErr; // stderr - - if ( process && process->IsRedirected() ) - { - if ( !pipeIn.Create() || !pipeOut.Create() || !pipeErr.Create() ) - { - wxLogError( _("Failed to execute '%s'\n"), *argv ); - - ARGS_CLEANUP; - - return ERROR_RETURN_CODE; - } - } - - // fork the process - // - // NB: do *not* use vfork() here, it completely breaks this code for some - // reason under Solaris (and maybe others, although not under Linux) - // But on OpenVMS we do not have fork so we have to use vfork and - // cross our fingers that it works. -#ifdef __VMS - pid_t pid = vfork(); -#else - pid_t pid = fork(); -#endif - if ( pid == -1 ) // error? - { - wxLogSysError( _("Fork failed") ); - - ARGS_CLEANUP; - - return ERROR_RETURN_CODE; - } - else if ( pid == 0 ) // we're in child - { - // These lines close the open file descriptors to to avoid any - // input/output which might block the process or irritate the user. If - // one wants proper IO for the subprocess, the right thing to do is to - // start an xterm executing it. - if ( !(flags & wxEXEC_SYNC) ) - { - // FD_SETSIZE is unsigned under BSD, signed under other platforms - // so we need a cast to avoid warnings on all platforms - for ( int fd = 0; fd < (int)FD_SETSIZE; fd++ ) - { - if ( fd == pipeIn[wxPipe::Read] - || fd == pipeOut[wxPipe::Write] - || fd == pipeErr[wxPipe::Write] - || traits->IsWriteFDOfEndProcessPipe(execData, fd) ) - { - // don't close this one, we still need it - continue; - } - - // leave stderr opened too, it won't do any harm - if ( fd != STDERR_FILENO ) - close(fd); - } - } - -#if !defined(__VMS) && !defined(__EMX__) - if ( flags & wxEXEC_MAKE_GROUP_LEADER ) - { - // Set process group to child process' pid. Then killing -pid - // of the parent will kill the process and all of its children. - setsid(); - } -#endif // !__VMS - - // reading side can be safely closed but we should keep the write one - // opened - traits->DetachWriteFDOfEndProcessPipe(execData); - - // redirect stdin, stdout and stderr - if ( pipeIn.IsOk() ) - { - if ( dup2(pipeIn[wxPipe::Read], STDIN_FILENO) == -1 || - dup2(pipeOut[wxPipe::Write], STDOUT_FILENO) == -1 || - dup2(pipeErr[wxPipe::Write], STDERR_FILENO) == -1 ) - { - wxLogSysError(_("Failed to redirect child process input/output")); - } - - pipeIn.Close(); - pipeOut.Close(); - pipeErr.Close(); - } - - execvp (*mb_argv, mb_argv); - - fprintf(stderr, "execvp("); - // CS changed ppc to ppc_ as ppc is not available under mac os CW Mach-O - for ( char **ppc_ = mb_argv; *ppc_; ppc_++ ) - fprintf(stderr, "%s%s", ppc_ == mb_argv ? "" : ", ", *ppc_); - fprintf(stderr, ") failed with error %d!\n", errno); - - // there is no return after successful exec() - _exit(-1); - - // some compilers complain about missing return - of course, they - // should know that exit() doesn't return but what else can we do if - // they don't? - // - // and, sure enough, other compilers complain about unreachable code - // after exit() call, so we can just always have return here... -#if defined(__VMS) || defined(__INTEL_COMPILER) - return 0; -#endif - } - else // we're in parent - { - ARGS_CLEANUP; - - // save it for WaitForChild() use - execData.pid = pid; - - // prepare for IO redirection - -#if HAS_PIPE_INPUT_STREAM - // the input buffer bufOut is connected to stdout, this is why it is - // called bufOut and not bufIn - wxStreamTempInputBuffer bufOut, - bufErr; -#endif // HAS_PIPE_INPUT_STREAM - - if ( process && process->IsRedirected() ) - { -#if HAS_PIPE_INPUT_STREAM - wxOutputStream *inStream = - new wxFileOutputStream(pipeIn.Detach(wxPipe::Write)); - - wxPipeInputStream *outStream = - new wxPipeInputStream(pipeOut.Detach(wxPipe::Read)); - - wxPipeInputStream *errStream = - new wxPipeInputStream(pipeErr.Detach(wxPipe::Read)); - - process->SetPipeStreams(outStream, inStream, errStream); - - bufOut.Init(outStream); - bufErr.Init(errStream); - - execData.bufOut = &bufOut; - execData.bufErr = &bufErr; -#endif // HAS_PIPE_INPUT_STREAM - } - - if ( pipeIn.IsOk() ) - { - pipeIn.Close(); - pipeOut.Close(); - pipeErr.Close(); - } - - return traits->WaitForChild(execData); - } - -#if !defined(__VMS) && !defined(__INTEL_COMPILER) - return ERROR_RETURN_CODE; -#endif -} - -#undef ERROR_RETURN_CODE -#undef ARGS_CLEANUP - -// ---------------------------------------------------------------------------- -// file and directory functions -// ---------------------------------------------------------------------------- - -const wxChar* wxGetHomeDir( wxString *home ) -{ - *home = wxGetUserHome( wxEmptyString ); - wxString tmp; - if ( home->empty() ) - *home = wxT("/"); -#ifdef __VMS - tmp = *home; - if ( tmp.Last() != wxT(']')) - if ( tmp.Last() != wxT('/')) *home << wxT('/'); -#endif - return home->c_str(); -} - -#if wxUSE_UNICODE -const wxMB2WXbuf wxGetUserHome( const wxString &user ) -#else // just for binary compatibility -- there is no 'const' here -char *wxGetUserHome( const wxString &user ) -#endif -{ - struct passwd *who = (struct passwd *) NULL; - - if ( !user ) - { - wxChar *ptr; - - if ((ptr = wxGetenv(wxT("HOME"))) != NULL) - { -#if wxUSE_UNICODE - wxWCharBuffer buffer( ptr ); - return buffer; -#else - return ptr; -#endif - } - if ((ptr = wxGetenv(wxT("USER"))) != NULL || (ptr = wxGetenv(wxT("LOGNAME"))) != NULL) - { - who = getpwnam(wxSafeConvertWX2MB(ptr)); - } - - // We now make sure the the user exists! - if (who == NULL) - { - who = getpwuid(getuid()); - } - } - else - { - who = getpwnam (user.mb_str()); - } - - return wxSafeConvertMB2WX(who ? who->pw_dir : 0); -} - -// ---------------------------------------------------------------------------- -// network and user id routines -// ---------------------------------------------------------------------------- - -// private utility function which returns output of the given command, removing -// the trailing newline -static wxString wxGetCommandOutput(const wxString &cmd) -{ - FILE *f = popen(cmd.ToAscii(), "r"); - if ( !f ) - { - wxLogSysError(_T("Executing \"%s\" failed"), cmd.c_str()); - return wxEmptyString; - } - - wxString s; - char buf[256]; - while ( !feof(f) ) - { - if ( !fgets(buf, sizeof(buf), f) ) - break; - - s += wxString::FromAscii(buf); - } - - pclose(f); - - if ( !s.empty() && s.Last() == _T('\n') ) - s.RemoveLast(); - - return s; -} - -// retrieve either the hostname or FQDN depending on platform (caller must -// check whether it's one or the other, this is why this function is for -// private use only) -static bool wxGetHostNameInternal(wxChar *buf, int sz) -{ - wxCHECK_MSG( buf, false, wxT("NULL pointer in wxGetHostNameInternal") ); - - *buf = wxT('\0'); - - // we're using uname() which is POSIX instead of less standard sysinfo() -#if defined(HAVE_UNAME) - struct utsname uts; - bool ok = uname(&uts) != -1; - if ( ok ) - { - wxStrncpy(buf, wxSafeConvertMB2WX(uts.nodename), sz - 1); - buf[sz] = wxT('\0'); - } -#elif defined(HAVE_GETHOSTNAME) - char cbuf[sz]; - bool ok = gethostname(cbuf, sz) != -1; - if ( ok ) - { - wxStrncpy(buf, wxSafeConvertMB2WX(cbuf), sz - 1); - buf[sz] = wxT('\0'); - } -#else // no uname, no gethostname - wxFAIL_MSG(wxT("don't know host name for this machine")); - - bool ok = false; -#endif // uname/gethostname - - if ( !ok ) - { - wxLogSysError(_("Cannot get the hostname")); - } - - return ok; -} - -bool wxGetHostName(wxChar *buf, int sz) -{ - bool ok = wxGetHostNameInternal(buf, sz); - - if ( ok ) - { - // BSD systems return the FQDN, we only want the hostname, so extract - // it (we consider that dots are domain separators) - wxChar *dot = wxStrchr(buf, wxT('.')); - if ( dot ) - { - // nuke it - *dot = wxT('\0'); - } - } - - return ok; -} - -bool wxGetFullHostName(wxChar *buf, int sz) -{ - bool ok = wxGetHostNameInternal(buf, sz); - - if ( ok ) - { - if ( !wxStrchr(buf, wxT('.')) ) - { - struct hostent *host = gethostbyname(wxSafeConvertWX2MB(buf)); - if ( !host ) - { - wxLogSysError(_("Cannot get the official hostname")); - - ok = false; - } - else - { - // the canonical name - wxStrncpy(buf, wxSafeConvertMB2WX(host->h_name), sz); - } - } - //else: it's already a FQDN (BSD behaves this way) - } - - return ok; -} - -bool wxGetUserId(wxChar *buf, int sz) -{ - struct passwd *who; - - *buf = wxT('\0'); - if ((who = getpwuid(getuid ())) != NULL) - { - wxStrncpy (buf, wxSafeConvertMB2WX(who->pw_name), sz - 1); - return true; - } - - return false; -} - -bool wxGetUserName(wxChar *buf, int sz) -{ -#ifdef HAVE_PW_GECOS - struct passwd *who; - - *buf = wxT('\0'); - if ((who = getpwuid (getuid ())) != NULL) - { - char *comma = strchr(who->pw_gecos, ','); - if (comma) - *comma = '\0'; // cut off non-name comment fields - wxStrncpy (buf, wxSafeConvertMB2WX(who->pw_gecos), sz - 1); - return true; - } - - return false; -#else // !HAVE_PW_GECOS - return wxGetUserId(buf, sz); -#endif // HAVE_PW_GECOS/!HAVE_PW_GECOS -} - -bool wxIsPlatform64Bit() -{ - const wxString machine = wxGetCommandOutput(wxT("uname -m")); - - // the test for "64" is obviously not 100% reliable but seems to work fine - // in practice - return machine.Contains(wxT("64")) || - machine.Contains(wxT("alpha")); -} - -// these functions are in mac/utils.cpp for wxMac -#ifndef __WXMAC__ - -wxOperatingSystemId wxGetOsVersion(int *verMaj, int *verMin) -{ - // get OS version - int major, minor; - wxString release = wxGetCommandOutput(wxT("uname -r")); - if ( !release.empty() && wxSscanf(release, wxT("%d.%d"), &major, &minor) != 2 ) - { - // unrecognized uname string format - major = - minor = -1; - } - - if ( verMaj ) - *verMaj = major; - if ( verMin ) - *verMin = minor; - - // try to understand which OS are we running - wxString kernel = wxGetCommandOutput(wxT("uname -s")); - if ( kernel.empty() ) - kernel = wxGetCommandOutput(wxT("uname -o")); - - if ( kernel.empty() ) - return wxOS_UNKNOWN; - - return wxPlatformInfo::GetOperatingSystemId(kernel); -} - -wxString wxGetOsDescription() -{ - return wxGetCommandOutput(wxT("uname -s -r -m")); -} - -#endif // !__WXMAC__ - -unsigned long wxGetProcessId() -{ - return (unsigned long)getpid(); -} - -wxMemorySize wxGetFreeMemory() -{ -#if defined(__LINUX__) - // get it from /proc/meminfo - FILE *fp = fopen("/proc/meminfo", "r"); - if ( fp ) - { - long memFree = -1; - - char buf[1024]; - if ( fgets(buf, WXSIZEOF(buf), fp) && fgets(buf, WXSIZEOF(buf), fp) ) - { - // /proc/meminfo changed its format in kernel 2.6 - if ( wxPlatformInfo().CheckOSVersion(2, 6) ) - { - unsigned long cached, buffers; - sscanf(buf, "MemFree: %ld", &memFree); - - fgets(buf, WXSIZEOF(buf), fp); - sscanf(buf, "Buffers: %lu", &buffers); - - fgets(buf, WXSIZEOF(buf), fp); - sscanf(buf, "Cached: %lu", &cached); - - // add to "MemFree" also the "Buffers" and "Cached" values as - // free(1) does as otherwise the value never makes sense: for - // kernel 2.6 it's always almost 0 - memFree += buffers + cached; - - // values here are always expressed in kB and we want bytes - memFree *= 1024; - } - else // Linux 2.4 (or < 2.6, anyhow) - { - long memTotal, memUsed; - sscanf(buf, "Mem: %ld %ld %ld", &memTotal, &memUsed, &memFree); - } - } - - fclose(fp); - - return (wxMemorySize)memFree; - } -#elif defined(__SUN__) && defined(_SC_AVPHYS_PAGES) - return (wxMemorySize)(sysconf(_SC_AVPHYS_PAGES)*sysconf(_SC_PAGESIZE)); -#elif defined(__SGI__) - struct rminfo realmem; - if ( sysmp(MP_SAGET, MPSA_RMINFO, &realmem, sizeof realmem) == 0 ) - return ((wxMemorySize)realmem.physmem * sysconf(_SC_PAGESIZE)); -//#elif defined(__FREEBSD__) -- might use sysctl() to find it out, probably -#endif - - // can't find it out - return -1; -} - -bool wxGetDiskSpace(const wxString& path, wxDiskspaceSize_t *pTotal, wxDiskspaceSize_t *pFree) -{ -#if defined(HAVE_STATFS) || defined(HAVE_STATVFS) - // the case to "char *" is needed for AIX 4.3 - wxStatfs_t fs; - if ( wxStatfs((char *)(const char*)path.fn_str(), &fs) != 0 ) - { - wxLogSysError( wxT("Failed to get file system statistics") ); - - return false; - } - - // under Solaris we also have to use f_frsize field instead of f_bsize - // which is in general a multiple of f_frsize -#ifdef HAVE_STATVFS - wxDiskspaceSize_t blockSize = fs.f_frsize; -#else // HAVE_STATFS - wxDiskspaceSize_t blockSize = fs.f_bsize; -#endif // HAVE_STATVFS/HAVE_STATFS - - if ( pTotal ) - { - *pTotal = wxDiskspaceSize_t(fs.f_blocks) * blockSize; - } - - if ( pFree ) - { - *pFree = wxDiskspaceSize_t(fs.f_bavail) * blockSize; - } - - return true; -#else // !HAVE_STATFS && !HAVE_STATVFS - return false; -#endif // HAVE_STATFS -} - -// ---------------------------------------------------------------------------- -// env vars -// ---------------------------------------------------------------------------- - -bool wxGetEnv(const wxString& var, wxString *value) -{ - // wxGetenv is defined as getenv() - wxChar *p = wxGetenv(var); - if ( !p ) - return false; - - if ( value ) - { - *value = p; - } - - return true; -} - -bool wxSetEnv(const wxString& variable, const wxChar *value) -{ -#if defined(HAVE_SETENV) - if ( !value ) - { -#ifdef HAVE_UNSETENV - // don't test unsetenv() return value: it's void on some systems (at - // least Darwin) - unsetenv(variable.mb_str()); - return true; -#else - value = _T(""); // we can't pass NULL to setenv() -#endif - } - - return setenv(variable.mb_str(), - wxString(value).mb_str(), - 1 /* overwrite */) == 0; -#elif defined(HAVE_PUTENV) - wxString s = variable; - if ( value ) - s << _T('=') << value; - - // transform to ANSI - const wxWX2MBbuf p = s.mb_str(); - - // the string will be free()d by libc - char *buf = (char *)malloc(strlen(p) + 1); - strcpy(buf, p); - - return putenv(buf) == 0; -#else // no way to set an env var - return false; -#endif -} - -// ---------------------------------------------------------------------------- -// signal handling -// ---------------------------------------------------------------------------- - -#if wxUSE_ON_FATAL_EXCEPTION - -#include - -extern "C" void wxFatalSignalHandler(wxTYPE_SA_HANDLER) -{ - if ( wxTheApp ) - { - // give the user a chance to do something special about this - wxTheApp->OnFatalException(); - } - - abort(); -} - -bool wxHandleFatalExceptions(bool doit) -{ - // old sig handlers - static bool s_savedHandlers = false; - static struct sigaction s_handlerFPE, - s_handlerILL, - s_handlerBUS, - s_handlerSEGV; - - bool ok = true; - if ( doit && !s_savedHandlers ) - { - // install the signal handler - struct sigaction act; - - // some systems extend it with non std fields, so zero everything - memset(&act, 0, sizeof(act)); - - act.sa_handler = wxFatalSignalHandler; - sigemptyset(&act.sa_mask); - act.sa_flags = 0; - - ok &= sigaction(SIGFPE, &act, &s_handlerFPE) == 0; - ok &= sigaction(SIGILL, &act, &s_handlerILL) == 0; - ok &= sigaction(SIGBUS, &act, &s_handlerBUS) == 0; - ok &= sigaction(SIGSEGV, &act, &s_handlerSEGV) == 0; - if ( !ok ) - { - wxLogDebug(_T("Failed to install our signal handler.")); - } - - s_savedHandlers = true; - } - else if ( s_savedHandlers ) - { - // uninstall the signal handler - ok &= sigaction(SIGFPE, &s_handlerFPE, NULL) == 0; - ok &= sigaction(SIGILL, &s_handlerILL, NULL) == 0; - ok &= sigaction(SIGBUS, &s_handlerBUS, NULL) == 0; - ok &= sigaction(SIGSEGV, &s_handlerSEGV, NULL) == 0; - if ( !ok ) - { - wxLogDebug(_T("Failed to uninstall our signal handler.")); - } - - s_savedHandlers = false; - } - //else: nothing to do - - return ok; -} - -#endif // wxUSE_ON_FATAL_EXCEPTION - -#endif // wxUSE_BASE - -#if wxUSE_GUI - -#ifdef __DARWIN__ - #include -#endif -// ---------------------------------------------------------------------------- -// wxExecute support -// ---------------------------------------------------------------------------- - -/* - NOTE: The original code shipped in 2.8 used __DARWIN__ && __WXMAC__ to wrap - the wxGUIAppTraits differences but __DARWIN__ && (__WXMAC__ || __WXCOCOA__) - to decide whether to call wxAddProcessCallbackForPid instead of - wxAddProcessCallback. This define normalizes things so the two match. - - Since wxCocoa was already creating the pipes in its wxGUIAppTraits I - decided to leave that as is and implement wxAddProcessCallback in the - utilsexec_cf.cpp file. I didn't see a reason to wrap that in a __WXCOCOA__ - check since it's valid for both wxMac and wxCocoa. - - Since the existing code is working for wxMac I've left it as is although - do note that the old task_for_pid method still used on PPC machines is - expected to fail in Leopard PPC and theoretically already fails if you run - your PPC app under Rosetta. - - You thus have two choices if you find end process detect broken: - 1) Change the define below such that the new code is used for wxMac. - This is theoretically ABI compatible since the old code still remains - in utilsexec_cf.cpp it's just no longer used by this code. - 2) Change the USE_POLLING define in utilsexc_cf.cpp to 1 unconditionally - This is theoretically not compatible since it removes the - wxMAC_MachPortEndProcessDetect helper function. Though in practice - this shouldn't be a problem since it wasn't prototyped anywhere. - */ -#define USE_OLD_DARWIN_END_PROCESS_DETECT (defined(__DARWIN__) && defined(__WXMAC__)) -// #define USE_OLD_DARWIN_END_PROCESS_DETECT 0 - -// wxMac doesn't use the same process end detection mechanisms so we don't -// need wxExecute-related helpers for it. -#if !USE_OLD_DARWIN_END_PROCESS_DETECT - -bool wxGUIAppTraits::CreateEndProcessPipe(wxExecuteData& execData) -{ - return execData.pipeEndProcDetect.Create(); -} - -bool wxGUIAppTraits::IsWriteFDOfEndProcessPipe(wxExecuteData& execData, int fd) -{ - return fd == (execData.pipeEndProcDetect)[wxPipe::Write]; -} - -void wxGUIAppTraits::DetachWriteFDOfEndProcessPipe(wxExecuteData& execData) -{ - execData.pipeEndProcDetect.Detach(wxPipe::Write); - execData.pipeEndProcDetect.Close(); -} - -#else // !Darwin - -bool wxGUIAppTraits::CreateEndProcessPipe(wxExecuteData& WXUNUSED(execData)) -{ - return true; -} - -bool -wxGUIAppTraits::IsWriteFDOfEndProcessPipe(wxExecuteData& WXUNUSED(execData), - int WXUNUSED(fd)) -{ - return false; -} - -void -wxGUIAppTraits::DetachWriteFDOfEndProcessPipe(wxExecuteData& WXUNUSED(execData)) -{ - // nothing to do here, we don't use the pipe -} - -#endif // !Darwin/Darwin - -int wxGUIAppTraits::WaitForChild(wxExecuteData& execData) -{ - wxEndProcessData *endProcData = new wxEndProcessData; - - const int flags = execData.flags; - - // wxAddProcessCallback is now (with DARWIN) allowed to call the - // callback function directly if the process terminates before - // the callback can be added to the run loop. Set up the endProcData. - if ( flags & wxEXEC_SYNC ) - { - // we may have process for capturing the program output, but it's - // not used in wxEndProcessData in the case of sync execution - endProcData->process = NULL; - - // sync execution: indicate it by negating the pid - endProcData->pid = -execData.pid; - } - else - { - // async execution, nothing special to do -- caller will be - // notified about the process termination if process != NULL, endProcData - // will be deleted in GTK_EndProcessDetector - endProcData->process = execData.process; - endProcData->pid = execData.pid; - } - - -#if USE_OLD_DARWIN_END_PROCESS_DETECT - endProcData->tag = wxAddProcessCallbackForPid(endProcData, execData.pid); -#else - endProcData->tag = wxAddProcessCallback - ( - endProcData, - execData.pipeEndProcDetect.Detach(wxPipe::Read) - ); - - execData.pipeEndProcDetect.Close(); -#endif // USE_OLD_DARWIN_END_PROCESS_DETECT - - if ( flags & wxEXEC_SYNC ) - { - wxBusyCursor bc; - wxWindowDisabler *wd = flags & wxEXEC_NODISABLE ? NULL - : new wxWindowDisabler; - - // endProcData->pid will be set to 0 from GTK_EndProcessDetector when the - // process terminates - while ( endProcData->pid != 0 ) - { - bool idle = true; - -#if HAS_PIPE_INPUT_STREAM - if ( execData.bufOut ) - { - execData.bufOut->Update(); - idle = false; - } - - if ( execData.bufErr ) - { - execData.bufErr->Update(); - idle = false; - } -#endif // HAS_PIPE_INPUT_STREAM - - // don't consume 100% of the CPU while we're sitting in this - // loop - if ( idle ) - wxMilliSleep(1); - - // give GTK+ a chance to call GTK_EndProcessDetector here and - // also repaint the GUI - wxYield(); - } - - int exitcode = endProcData->exitcode; - - delete wd; - delete endProcData; - - return exitcode; - } - else // async execution - { - return execData.pid; - } -} - -#endif // wxUSE_GUI -#if wxUSE_BASE - -void wxHandleProcessTermination(wxEndProcessData *proc_data) -{ - // notify user about termination if required - if ( proc_data->process ) - { - proc_data->process->OnTerminate(proc_data->pid, proc_data->exitcode); - } - - // clean up - if ( proc_data->pid > 0 ) - { - delete proc_data; - } - else - { - // let wxExecute() know that the process has terminated - proc_data->pid = 0; - } -} - -#endif // wxUSE_BASE diff --git a/wxWidgets/src/unix/utilsx11.cpp b/wxWidgets/src/unix/utilsx11.cpp deleted file mode 100644 index 65ab839044..0000000000 --- a/wxWidgets/src/unix/utilsx11.cpp +++ /dev/null @@ -1,847 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/unix/utilsx11.cpp -// Purpose: Miscellaneous X11 functions -// Author: Mattia Barbon, Vaclav Slavik, Robert Roebling -// Modified by: -// Created: 25.03.02 -// RCS-ID: $Id: utilsx11.cpp 44895 2007-03-18 17:49:06Z VZ $ -// Copyright: (c) wxWidgets team -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#if defined(__WXX11__) || defined(__WXGTK__) || defined(__WXMOTIF__) - -// for compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#include "wx/unix/utilsx11.h" - -#ifndef WX_PRECOMP - #include "wx/log.h" - #include "wx/app.h" - #include "wx/icon.h" - #include "wx/image.h" -#endif - -#include "wx/iconbndl.h" - -#ifdef __VMS -#pragma message disable nosimpint -#endif -#include -#include -#include -#ifdef __VMS -#pragma message enable nosimpint -#endif - -#ifdef __WXGTK__ -#include -#include -#endif - -// Various X11 Atoms used in this file: -static Atom _NET_WM_ICON = 0; -static Atom _NET_WM_STATE = 0; -static Atom _NET_WM_STATE_FULLSCREEN = 0; -static Atom _NET_WM_STATE_STAYS_ON_TOP = 0; -static Atom _NET_WM_WINDOW_TYPE = 0; -static Atom _NET_WM_WINDOW_TYPE_NORMAL = 0; -static Atom _KDE_NET_WM_WINDOW_TYPE_OVERRIDE = 0; -static Atom _WIN_LAYER = 0; -static Atom KWIN_RUNNING = 0; -#ifndef __WXGTK20__ -static Atom _NET_SUPPORTING_WM_CHECK = 0; -static Atom _NET_SUPPORTED = 0; -#endif - -#define wxMAKE_ATOM(name, display) \ - if (name == 0) name = XInternAtom((display), #name, False) - - -// X11 Window is an int type, so use the macro to suppress warnings when -// converting to it -#define WindowCast(w) (Window)(wxPtrToUInt(w)) - -// Is the window mapped? -static bool IsMapped(Display *display, Window window) -{ - XWindowAttributes attr; - XGetWindowAttributes(display, window, &attr); - return (attr.map_state != IsUnmapped); -} - - - -// Suspends X11 errors. Used when we expect errors but they are not fatal -// for us. -extern "C" -{ - typedef int (*wxX11ErrorHandler)(Display *, XErrorEvent *); - - static int wxX11ErrorsSuspender_handler(Display*, XErrorEvent*) { return 0; } -} - -class wxX11ErrorsSuspender -{ -public: - wxX11ErrorsSuspender(Display *d) : m_display(d) - { - m_old = XSetErrorHandler(wxX11ErrorsSuspender_handler); - } - ~wxX11ErrorsSuspender() - { - XFlush(m_display); - XSetErrorHandler(m_old); - } - -private: - Display *m_display; - wxX11ErrorHandler m_old; -}; - - - -// ---------------------------------------------------------------------------- -// Setting icons for window manager: -// ---------------------------------------------------------------------------- - -void wxSetIconsX11( WXDisplay* display, WXWindow window, - const wxIconBundle& ib ) -{ -#if !wxUSE_NANOX - size_t size = 0; - size_t i, max = ib.m_icons.GetCount(); - - for( i = 0; i < max; ++i ) - if( ib.m_icons[i].Ok() ) - size += 2 + ib.m_icons[i].GetWidth() * ib.m_icons[i].GetHeight(); - - wxMAKE_ATOM(_NET_WM_ICON, (Display*)display); - - if( size > 0 ) - { -// The code below is correct for 64-bit machines also. -// wxUint32* data = new wxUint32[size]; -// wxUint32* ptr = data; - unsigned long* data = new unsigned long[size]; - unsigned long* ptr = data; - - for( i = 0; i < max; ++i ) - { - const wxImage image = ib.m_icons[i].ConvertToImage(); - int width = image.GetWidth(), height = image.GetHeight(); - unsigned char* imageData = image.GetData(); - unsigned char* imageDataEnd = imageData + ( width * height * 3 ); - bool hasMask = image.HasMask(); - unsigned char rMask, gMask, bMask; - unsigned char r, g, b, a; - - if( hasMask ) - { - rMask = image.GetMaskRed(); - gMask = image.GetMaskGreen(); - bMask = image.GetMaskBlue(); - } - else // no mask, but still init the variables to avoid warnings - { - rMask = - gMask = - bMask = 0; - } - - *ptr++ = width; - *ptr++ = height; - - while( imageData < imageDataEnd ) { - r = imageData[0]; - g = imageData[1]; - b = imageData[2]; - if( hasMask && r == rMask && g == gMask && b == bMask ) - a = 0; - else - a = 255; - - *ptr++ = ( a << 24 ) | ( r << 16 ) | ( g << 8 ) | b; - - imageData += 3; - } - } - - XChangeProperty( (Display*)display, - WindowCast(window), - _NET_WM_ICON, - XA_CARDINAL, 32, - PropModeReplace, - (unsigned char*)data, size ); - delete[] data; - } - else - { - XDeleteProperty( (Display*)display, - WindowCast(window), - _NET_WM_ICON ); - } -#endif // !wxUSE_NANOX -} - - -// ---------------------------------------------------------------------------- -// Fullscreen mode: -// ---------------------------------------------------------------------------- - -// NB: Setting fullscreen mode under X11 is a complicated matter. There was -// no standard way of doing it until recently. ICCCM doesn't know the -// concept of fullscreen windows and the only way to make a window -// fullscreen is to remove decorations, resize it to cover entire screen -// and set WIN_LAYER_ABOVE_DOCK. -// -// This doesn't always work, though. Specifically, at least kwin from -// KDE 3 ignores the hint. The only way to make kwin accept our request -// is to emulate the way Qt does it. That is, unmap the window, set -// _NET_WM_WINDOW_TYPE to _KDE_NET_WM_WINDOW_TYPE_OVERRIDE (KDE extension), -// add _NET_WM_STATE_STAYS_ON_TOP (ditto) to _NET_WM_STATE and map -// the window again. -// -// Version 1.2 of Window Manager Specification (aka wm-spec aka -// Extended Window Manager Hints) introduced _NET_WM_STATE_FULLSCREEN -// window state which provides cleanest and simplest possible way of -// making a window fullscreen. WM-spec is a de-facto standard adopted -// by GNOME and KDE folks, but _NET_WM_STATE_FULLSCREEN isn't yet widely -// supported. As of January 2003, only GNOME 2's default WM Metacity -// implements, KDE will support it from version 3.2. At toolkits level, -// GTK+ >= 2.1.2 uses it as the only method of making windows fullscreen -// (that's why wxGTK will *not* switch to using gtk_window_fullscreen -// unless it has better compatibility with older WMs). -// -// -// This is what wxWidgets does in wxSetFullScreenStateX11: -// 1) if _NET_WM_STATE_FULLSCREEN is supported, use it -// 2) otherwise try WM-specific hacks (KDE, IceWM) -// 3) use _WIN_LAYER and hope that the WM will recognize it -// The code was tested with: -// twm, IceWM, WindowMaker, Metacity, kwin, sawfish, lesstif-mwm - - -#define WIN_LAYER_NORMAL 4 -#define WIN_LAYER_ABOVE_DOCK 10 - -static void wxWinHintsSetLayer(Display *display, Window rootWnd, - Window window, int layer) -{ - wxX11ErrorsSuspender noerrors(display); - - XEvent xev; - - wxMAKE_ATOM( _WIN_LAYER, display ); - - if (IsMapped(display, window)) - { - xev.type = ClientMessage; - xev.xclient.type = ClientMessage; - xev.xclient.window = window; - xev.xclient.message_type = _WIN_LAYER; - xev.xclient.format = 32; - xev.xclient.data.l[0] = (long)layer; - xev.xclient.data.l[1] = CurrentTime; - - XSendEvent(display, rootWnd, False, - SubstructureNotifyMask, (XEvent*) &xev); - } - else - { - long data[1]; - - data[0] = layer; - XChangeProperty(display, window, - _WIN_LAYER, XA_CARDINAL, 32, - PropModeReplace, (unsigned char *)data, 1); - } -} - - - -#ifdef __WXGTK20__ -static bool wxQueryWMspecSupport(Display* WXUNUSED(display), - Window WXUNUSED(rootWnd), - Atom (feature)) -{ - GdkAtom gatom = gdk_x11_xatom_to_atom(feature); - return gdk_net_wm_supports(gatom); -} -#else -static bool wxQueryWMspecSupport(Display *display, Window rootWnd, Atom feature) -{ - wxMAKE_ATOM(_NET_SUPPORTING_WM_CHECK, display); - wxMAKE_ATOM(_NET_SUPPORTED, display); - - // FIXME: We may want to cache these checks. Note that we can't simply - // remember the results in global variable because the WM may go - // away and be replaced by another one! One possible approach - // would be invalidate the case every 15 seconds or so. Since this - // code is currently only used by wxTopLevelWindow::ShowFullScreen, - // it is not important that it is not optimized. - // - // If the WM supports ICCCM (i.e. the root window has - // _NET_SUPPORTING_WM_CHECK property that points to a WM-owned - // window), we could watch for DestroyNotify event on the window - // and invalidate our cache when the windows goes away (= WM - // is replaced by another one). This is what GTK+ 2 does. - // Let's do it only if it is needed, it requires changes to - // the event loop. - - Atom type; - Window *wins; - Atom *atoms; - int format; - unsigned long after; - unsigned long nwins, natoms; - - // Is the WM ICCCM supporting? - XGetWindowProperty(display, rootWnd, - _NET_SUPPORTING_WM_CHECK, 0, LONG_MAX, - False, XA_WINDOW, &type, &format, &nwins, - &after, (unsigned char **)&wins); - if ( type != XA_WINDOW || nwins <= 0 || wins[0] == None ) - return false; - XFree(wins); - - // Query for supported features: - XGetWindowProperty(display, rootWnd, - _NET_SUPPORTED, 0, LONG_MAX, - False, XA_ATOM, &type, &format, &natoms, - &after, (unsigned char **)&atoms); - if ( type != XA_ATOM || atoms == NULL ) - return false; - - // Lookup the feature we want: - for (unsigned i = 0; i < natoms; i++) - { - if ( atoms[i] == feature ) - { - XFree(atoms); - return true; - } - } - XFree(atoms); - return false; -} -#endif - - -#define _NET_WM_STATE_REMOVE 0 -#define _NET_WM_STATE_ADD 1 - -static void wxWMspecSetState(Display *display, Window rootWnd, - Window window, int operation, Atom state) -{ - wxMAKE_ATOM(_NET_WM_STATE, display); - - if ( IsMapped(display, window) ) - { - XEvent xev; - xev.type = ClientMessage; - xev.xclient.type = ClientMessage; - xev.xclient.serial = 0; - xev.xclient.send_event = True; - xev.xclient.display = display; - xev.xclient.window = window; - xev.xclient.message_type = _NET_WM_STATE; - xev.xclient.format = 32; - xev.xclient.data.l[0] = operation; - xev.xclient.data.l[1] = state; - xev.xclient.data.l[2] = None; - - XSendEvent(display, rootWnd, - False, - SubstructureRedirectMask | SubstructureNotifyMask, - &xev); - } - // FIXME - must modify _NET_WM_STATE property list if the window - // wasn't mapped! -} - -static void wxWMspecSetFullscreen(Display *display, Window rootWnd, - Window window, bool fullscreen) -{ - wxMAKE_ATOM(_NET_WM_STATE_FULLSCREEN, display); - wxWMspecSetState(display, rootWnd, - window, - fullscreen ? _NET_WM_STATE_ADD : _NET_WM_STATE_REMOVE, - _NET_WM_STATE_FULLSCREEN); -} - - -// Is the user running KDE's kwin window manager? At least kwin from KDE 3 -// sets KWIN_RUNNING property on the root window. -static bool wxKwinRunning(Display *display, Window rootWnd) -{ - wxMAKE_ATOM(KWIN_RUNNING, display); - - long *data; - Atom type; - int format; - unsigned long nitems, after; - if (XGetWindowProperty(display, rootWnd, - KWIN_RUNNING, 0, 1, False, KWIN_RUNNING, - &type, &format, &nitems, &after, - (unsigned char**)&data) != Success) - { - return false; - } - - bool retval = (type == KWIN_RUNNING && - nitems == 1 && data && data[0] == 1); - XFree(data); - return retval; -} - -// KDE's kwin is Qt-centric so much than no normal method of fullscreen -// mode will work with it. We have to carefully emulate the Qt way. -static void wxSetKDEFullscreen(Display *display, Window rootWnd, - Window w, bool fullscreen, wxRect *origRect) -{ - long data[2]; - unsigned lng; - - wxMAKE_ATOM(_NET_WM_WINDOW_TYPE, display); - wxMAKE_ATOM(_NET_WM_WINDOW_TYPE_NORMAL, display); - wxMAKE_ATOM(_KDE_NET_WM_WINDOW_TYPE_OVERRIDE, display); - wxMAKE_ATOM(_NET_WM_STATE_STAYS_ON_TOP, display); - - if (fullscreen) - { - data[0] = _KDE_NET_WM_WINDOW_TYPE_OVERRIDE; - data[1] = _NET_WM_WINDOW_TYPE_NORMAL; - lng = 2; - } - else - { - data[0] = _NET_WM_WINDOW_TYPE_NORMAL; - data[1] = None; - lng = 1; - } - - // it is necessary to unmap the window, otherwise kwin will ignore us: - XSync(display, False); - - bool wasMapped = IsMapped(display, w); - if (wasMapped) - { - XUnmapWindow(display, w); - XSync(display, False); - } - - XChangeProperty(display, w, _NET_WM_WINDOW_TYPE, XA_ATOM, 32, - PropModeReplace, (unsigned char *) &data[0], lng); - XSync(display, False); - - if (wasMapped) - { - XMapRaised(display, w); - XSync(display, False); - } - - wxWMspecSetState(display, rootWnd, w, - fullscreen ? _NET_WM_STATE_ADD : _NET_WM_STATE_REMOVE, - _NET_WM_STATE_STAYS_ON_TOP); - XSync(display, False); - - if (!fullscreen) - { - // NB: like many other WMs, kwin ignores the first request for a window - // position change after the window was mapped. This additional - // move+resize event will ensure that the window is restored in - // exactly the same position as before it was made fullscreen - // (because wxTopLevelWindow::ShowFullScreen will call SetSize, thus - // setting the position for the second time). - XMoveResizeWindow(display, w, - origRect->x, origRect->y, - origRect->width, origRect->height); - XSync(display, False); - } -} - - -wxX11FullScreenMethod wxGetFullScreenMethodX11(WXDisplay* display, - WXWindow rootWindow) -{ - Window root = WindowCast(rootWindow); - Display *disp = (Display*)display; - - // if WM supports _NET_WM_STATE_FULLSCREEN from wm-spec 1.2, use it: - wxMAKE_ATOM(_NET_WM_STATE_FULLSCREEN, disp); - if (wxQueryWMspecSupport(disp, root, _NET_WM_STATE_FULLSCREEN)) - { - wxLogTrace(_T("fullscreen"), - _T("detected _NET_WM_STATE_FULLSCREEN support")); - return wxX11_FS_WMSPEC; - } - - // if the user is running KDE's kwin WM, use a legacy hack because - // kwin doesn't understand any other method: - if (wxKwinRunning(disp, root)) - { - wxLogTrace(_T("fullscreen"), _T("detected kwin")); - return wxX11_FS_KDE; - } - - // finally, fall back to ICCCM heuristic method: - wxLogTrace(_T("fullscreen"), _T("unknown WM, using _WIN_LAYER")); - return wxX11_FS_GENERIC; -} - - -void wxSetFullScreenStateX11(WXDisplay* display, WXWindow rootWindow, - WXWindow window, bool show, - wxRect *origRect, - wxX11FullScreenMethod method) -{ - // NB: please see the comment under "Fullscreen mode:" title above - // for implications of changing this code. - - Window wnd = WindowCast(window); - Window root = WindowCast(rootWindow); - Display *disp = (Display*)display; - - if (method == wxX11_FS_AUTODETECT) - method = wxGetFullScreenMethodX11(display, rootWindow); - - switch (method) - { - case wxX11_FS_WMSPEC: - wxWMspecSetFullscreen(disp, root, wnd, show); - break; - case wxX11_FS_KDE: - wxSetKDEFullscreen(disp, root, wnd, show, origRect); - break; - default: - wxWinHintsSetLayer(disp, root, wnd, - show ? WIN_LAYER_ABOVE_DOCK : WIN_LAYER_NORMAL); - break; - } -} - - - -// ---------------------------------------------------------------------------- -// keycode translations -// ---------------------------------------------------------------------------- - -#include - -// FIXME what about tables?? - -int wxCharCodeXToWX(KeySym keySym) -{ - int id; - switch (keySym) - { - case XK_Shift_L: - case XK_Shift_R: - id = WXK_SHIFT; break; - case XK_Control_L: - case XK_Control_R: - id = WXK_CONTROL; break; - case XK_Meta_L: - case XK_Meta_R: - id = WXK_ALT; break; - case XK_Caps_Lock: - id = WXK_CAPITAL; break; - case XK_BackSpace: - id = WXK_BACK; break; - case XK_Delete: - id = WXK_DELETE; break; - case XK_Clear: - id = WXK_CLEAR; break; - case XK_Tab: - id = WXK_TAB; break; - case XK_numbersign: - id = '#'; break; - case XK_Return: - id = WXK_RETURN; break; - case XK_Escape: - id = WXK_ESCAPE; break; - case XK_Pause: - case XK_Break: - id = WXK_PAUSE; break; - case XK_Num_Lock: - id = WXK_NUMLOCK; break; - case XK_Scroll_Lock: - id = WXK_SCROLL; break; - - case XK_Home: - id = WXK_HOME; break; - case XK_End: - id = WXK_END; break; - case XK_Left: - id = WXK_LEFT; break; - case XK_Right: - id = WXK_RIGHT; break; - case XK_Up: - id = WXK_UP; break; - case XK_Down: - id = WXK_DOWN; break; - case XK_Next: - id = WXK_PAGEDOWN; break; - case XK_Prior: - id = WXK_PAGEUP; break; - case XK_Menu: - id = WXK_MENU; break; - case XK_Select: - id = WXK_SELECT; break; - case XK_Cancel: - id = WXK_CANCEL; break; - case XK_Print: - id = WXK_PRINT; break; - case XK_Execute: - id = WXK_EXECUTE; break; - case XK_Insert: - id = WXK_INSERT; break; - case XK_Help: - id = WXK_HELP; break; - - case XK_KP_Multiply: - id = WXK_NUMPAD_MULTIPLY; break; - case XK_KP_Add: - id = WXK_NUMPAD_ADD; break; - case XK_KP_Subtract: - id = WXK_NUMPAD_SUBTRACT; break; - case XK_KP_Divide: - id = WXK_NUMPAD_DIVIDE; break; - case XK_KP_Decimal: - id = WXK_NUMPAD_DECIMAL; break; - case XK_KP_Equal: - id = WXK_NUMPAD_EQUAL; break; - case XK_KP_Space: - id = WXK_NUMPAD_SPACE; break; - case XK_KP_Tab: - id = WXK_NUMPAD_TAB; break; - case XK_KP_Enter: - id = WXK_NUMPAD_ENTER; break; - case XK_KP_0: - id = WXK_NUMPAD0; break; - case XK_KP_1: - id = WXK_NUMPAD1; break; - case XK_KP_2: - id = WXK_NUMPAD2; break; - case XK_KP_3: - id = WXK_NUMPAD3; break; - case XK_KP_4: - id = WXK_NUMPAD4; break; - case XK_KP_5: - id = WXK_NUMPAD5; break; - case XK_KP_6: - id = WXK_NUMPAD6; break; - case XK_KP_7: - id = WXK_NUMPAD7; break; - case XK_KP_8: - id = WXK_NUMPAD8; break; - case XK_KP_9: - id = WXK_NUMPAD9; break; - case XK_KP_Insert: - id = WXK_NUMPAD_INSERT; break; - case XK_KP_End: - id = WXK_NUMPAD_END; break; - case XK_KP_Down: - id = WXK_NUMPAD_DOWN; break; - case XK_KP_Page_Down: - id = WXK_NUMPAD_PAGEDOWN; break; - case XK_KP_Left: - id = WXK_NUMPAD_LEFT; break; - case XK_KP_Right: - id = WXK_NUMPAD_RIGHT; break; - case XK_KP_Home: - id = WXK_NUMPAD_HOME; break; - case XK_KP_Up: - id = WXK_NUMPAD_UP; break; - case XK_KP_Page_Up: - id = WXK_NUMPAD_PAGEUP; break; - case XK_F1: - id = WXK_F1; break; - case XK_F2: - id = WXK_F2; break; - case XK_F3: - id = WXK_F3; break; - case XK_F4: - id = WXK_F4; break; - case XK_F5: - id = WXK_F5; break; - case XK_F6: - id = WXK_F6; break; - case XK_F7: - id = WXK_F7; break; - case XK_F8: - id = WXK_F8; break; - case XK_F9: - id = WXK_F9; break; - case XK_F10: - id = WXK_F10; break; - case XK_F11: - id = WXK_F11; break; - case XK_F12: - id = WXK_F12; break; - case XK_F13: - id = WXK_F13; break; - case XK_F14: - id = WXK_F14; break; - case XK_F15: - id = WXK_F15; break; - case XK_F16: - id = WXK_F16; break; - case XK_F17: - id = WXK_F17; break; - case XK_F18: - id = WXK_F18; break; - case XK_F19: - id = WXK_F19; break; - case XK_F20: - id = WXK_F20; break; - case XK_F21: - id = WXK_F21; break; - case XK_F22: - id = WXK_F22; break; - case XK_F23: - id = WXK_F23; break; - case XK_F24: - id = WXK_F24; break; - default: - id = (keySym <= 255) ? (int)keySym : -1; - } - - return id; -} - -KeySym wxCharCodeWXToX(int id) -{ - KeySym keySym; - - switch (id) - { - case WXK_CANCEL: keySym = XK_Cancel; break; - case WXK_BACK: keySym = XK_BackSpace; break; - case WXK_TAB: keySym = XK_Tab; break; - case WXK_CLEAR: keySym = XK_Clear; break; - case WXK_RETURN: keySym = XK_Return; break; - case WXK_SHIFT: keySym = XK_Shift_L; break; - case WXK_CONTROL: keySym = XK_Control_L; break; - case WXK_ALT: keySym = XK_Meta_L; break; - case WXK_CAPITAL: keySym = XK_Caps_Lock; break; - case WXK_MENU : keySym = XK_Menu; break; - case WXK_PAUSE: keySym = XK_Pause; break; - case WXK_ESCAPE: keySym = XK_Escape; break; - case WXK_SPACE: keySym = ' '; break; - case WXK_PAGEUP: keySym = XK_Prior; break; - case WXK_PAGEDOWN: keySym = XK_Next; break; - case WXK_END: keySym = XK_End; break; - case WXK_HOME : keySym = XK_Home; break; - case WXK_LEFT : keySym = XK_Left; break; - case WXK_UP: keySym = XK_Up; break; - case WXK_RIGHT: keySym = XK_Right; break; - case WXK_DOWN : keySym = XK_Down; break; - case WXK_SELECT: keySym = XK_Select; break; - case WXK_PRINT: keySym = XK_Print; break; - case WXK_EXECUTE: keySym = XK_Execute; break; - case WXK_INSERT: keySym = XK_Insert; break; - case WXK_DELETE: keySym = XK_Delete; break; - case WXK_HELP : keySym = XK_Help; break; - case WXK_NUMPAD0: keySym = XK_KP_0; break; case WXK_NUMPAD_INSERT: keySym = XK_KP_Insert; break; - case WXK_NUMPAD1: keySym = XK_KP_1; break; case WXK_NUMPAD_END: keySym = XK_KP_End; break; - case WXK_NUMPAD2: keySym = XK_KP_2; break; case WXK_NUMPAD_DOWN: keySym = XK_KP_Down; break; - case WXK_NUMPAD3: keySym = XK_KP_3; break; case WXK_NUMPAD_PAGEDOWN: keySym = XK_KP_Page_Down; break; - case WXK_NUMPAD4: keySym = XK_KP_4; break; case WXK_NUMPAD_LEFT: keySym = XK_KP_Left; break; - case WXK_NUMPAD5: keySym = XK_KP_5; break; - case WXK_NUMPAD6: keySym = XK_KP_6; break; case WXK_NUMPAD_RIGHT: keySym = XK_KP_Right; break; - case WXK_NUMPAD7: keySym = XK_KP_7; break; case WXK_NUMPAD_HOME: keySym = XK_KP_Home; break; - case WXK_NUMPAD8: keySym = XK_KP_8; break; case WXK_NUMPAD_UP: keySym = XK_KP_Up; break; - case WXK_NUMPAD9: keySym = XK_KP_9; break; case WXK_NUMPAD_PAGEUP: keySym = XK_KP_Page_Up; break; - case WXK_NUMPAD_DECIMAL: keySym = XK_KP_Decimal; break; case WXK_NUMPAD_DELETE: keySym = XK_KP_Delete; break; - case WXK_NUMPAD_MULTIPLY: keySym = XK_KP_Multiply; break; - case WXK_NUMPAD_ADD: keySym = XK_KP_Add; break; - case WXK_NUMPAD_SUBTRACT: keySym = XK_KP_Subtract; break; - case WXK_NUMPAD_DIVIDE: keySym = XK_KP_Divide; break; - case WXK_NUMPAD_ENTER: keySym = XK_KP_Enter; break; - case WXK_NUMPAD_SEPARATOR: keySym = XK_KP_Separator; break; - case WXK_F1: keySym = XK_F1; break; - case WXK_F2: keySym = XK_F2; break; - case WXK_F3: keySym = XK_F3; break; - case WXK_F4: keySym = XK_F4; break; - case WXK_F5: keySym = XK_F5; break; - case WXK_F6: keySym = XK_F6; break; - case WXK_F7: keySym = XK_F7; break; - case WXK_F8: keySym = XK_F8; break; - case WXK_F9: keySym = XK_F9; break; - case WXK_F10: keySym = XK_F10; break; - case WXK_F11: keySym = XK_F11; break; - case WXK_F12: keySym = XK_F12; break; - case WXK_F13: keySym = XK_F13; break; - case WXK_F14: keySym = XK_F14; break; - case WXK_F15: keySym = XK_F15; break; - case WXK_F16: keySym = XK_F16; break; - case WXK_F17: keySym = XK_F17; break; - case WXK_F18: keySym = XK_F18; break; - case WXK_F19: keySym = XK_F19; break; - case WXK_F20: keySym = XK_F20; break; - case WXK_F21: keySym = XK_F21; break; - case WXK_F22: keySym = XK_F22; break; - case WXK_F23: keySym = XK_F23; break; - case WXK_F24: keySym = XK_F24; break; - case WXK_NUMLOCK: keySym = XK_Num_Lock; break; - case WXK_SCROLL: keySym = XK_Scroll_Lock; break; - default: keySym = id <= 255 ? (KeySym)id : 0; - } - - return keySym; -} - - -// ---------------------------------------------------------------------------- -// check current state of a key -// ---------------------------------------------------------------------------- - -bool wxGetKeyState(wxKeyCode key) -{ - wxASSERT_MSG(key != WXK_LBUTTON && key != WXK_RBUTTON && key != - WXK_MBUTTON, wxT("can't use wxGetKeyState() for mouse buttons")); - - Display *pDisplay = (Display*) wxGetDisplay(); - - int iKey = wxCharCodeWXToX(key); - int iKeyMask = 0; - Window wDummy1, wDummy2; - int iDummy3, iDummy4, iDummy5, iDummy6; - unsigned int iMask; - KeyCode keyCode = XKeysymToKeycode(pDisplay,iKey); - if (keyCode == NoSymbol) - return false; - - if ( IsModifierKey(iKey) ) // If iKey is a modifier key, use a different method - { - XModifierKeymap *map = XGetModifierMapping(pDisplay); - wxCHECK_MSG( map, false, _T("failed to get X11 modifiers map") ); - - for (int i = 0; i < 8; ++i) - { - if ( map->modifiermap[map->max_keypermod * i] == keyCode) - { - iKeyMask = 1 << i; - } - } - - XQueryPointer(pDisplay, DefaultRootWindow(pDisplay), &wDummy1, &wDummy2, - &iDummy3, &iDummy4, &iDummy5, &iDummy6, &iMask ); - XFreeModifiermap(map); - return (iMask & iKeyMask) != 0; - } - - // From the XLib manual: - // The XQueryKeymap() function returns a bit vector for the logical state of the keyboard, - // where each bit set to 1 indicates that the corresponding key is currently pressed down. - // The vector is represented as 32 bytes. Byte N (from 0) contains the bits for keys 8N to 8N + 7 - // with the least-significant bit in the byte representing key 8N. - char key_vector[32]; - XQueryKeymap(pDisplay, key_vector); - return key_vector[keyCode >> 3] & (1 << (keyCode & 7)); -} - -#endif // __WXX11__ || __WXGTK__ || __WXMOTIF__ diff --git a/wxWidgets/src/version.mak b/wxWidgets/src/version.mak deleted file mode 100644 index 52ccbb9b47..0000000000 --- a/wxWidgets/src/version.mak +++ /dev/null @@ -1,24 +0,0 @@ -############################################################################## -# Name: src/version.mak -# Purpose: file defining wxWindows version used by all other makefiles -# Author: Vadim Zeitlin -# Modified by: -# Created: 25.02.03 -# RCS-ID: $Id: version.mak 23584 2003-09-14 19:39:34Z JS $ -# Copyright: (c) 2003 Vadim Zeitlin -# Licence: wxWindows license -############################################################################## - -wxMAJOR_VERSION=2 -wxMINOR_VERSION=5 -wxRELEASE_NUMBER=1 - -# release number if used in the DLL file names only for the unstable branch as -# for the stable branches the micro releases are supposed to be backwards -# compatible and so should have the same name or otherwise it would be -# impossible to use them without recompiling the applications (which is the -# whole goal of keeping them backwards compatible in the first place) -# -# as 2.5 is an unstable branch, wxRELEASE_NUMBER_IFUNSTABLE should be set -# (but when we go to 2.6, it should become empty) -wxRELEASE_NUMBER_IFUNSTABLE=$(wxRELEASE_NUMBER) diff --git a/wxWidgets/src/wxJpeg.icc b/wxWidgets/src/wxJpeg.icc deleted file mode 100644 index 1a9c4c7bdf..0000000000 --- a/wxWidgets/src/wxJpeg.icc +++ /dev/null @@ -1,59 +0,0 @@ -option ProjectOptions = gen(arch, "pentium2"), opt(tune, "pentium2"), - define("__WXPM__", ), define("__VISAGECPP__", ), define("OS232", ), define("JPEGLOCAL", ), - incl(searchpath, "..\\src"), incl(searchpath, "..\\Include"), report(level, "E"), - file(genobject, "..\\src\\jpeg\\dbgos240\\") -{ - perform - { - run before '-mkdir ' '..\\src\\jpeg\\dbgos240' - } - target "..\\lib\\os2jpeg.lib" - { - source type("c") "JPEG\\JCAPIMIN.C" - source type("c") "JPEG\\JCAPISTD.C" - source type("c") "JPEG\\JCCOEFCT.C" - source type("c") "JPEG\\JCCOLOR.C" - source type("c") "JPEG\\JCDCTMGR.C" - source type("c") "JPEG\\JCHUFF.C" - source type("c") "JPEG\\JCINIT.C" - source type("c") "JPEG\\JCMAINCT.C" - source type("c") "JPEG\\JCMARKER.C" - source type("c") "JPEG\\JCMASTER.C" - source type("c") "JPEG\\JCOMAPI.C" - source type("c") "JPEG\\JCPARAM.C" - source type("c") "JPEG\\JCPHUFF.C" - source type("c") "JPEG\\JCPREPCT.C" - source type("c") "JPEG\\JCSAMPLE.C" - source type("c") "JPEG\\JCTRANS.C" - source type("c") "JPEG\\JDAPIMIN.C" - source type("c") "JPEG\\JDAPISTD.C" - source type("c") "JPEG\\JDATADST.C" - source type("c") "JPEG\\JDATASRC.C" - source type("c") "JPEG\\JDCOEFCT.C" - source type("c") "JPEG\\JDCOLOR.C" - source type("c") "JPEG\\JDDCTMGR.C" - source type("c") "JPEG\\JDHUFF.C" - source type("c") "JPEG\\JDINPUT.C" - source type("c") "JPEG\\JDMAINCT.C" - source type("c") "JPEG\\JDMARKER.C" - source type("c") "JPEG\\JDMASTER.C" - source type("c") "JPEG\\JDMERGE.C" - source type("c") "JPEG\\JDPHUFF.C" - source type("c") "JPEG\\JDPOSTCT.C" - source type("c") "JPEG\\JDSAMPLE.C" - source type("c") "JPEG\\JDTRANS.C" - source type("c") "JPEG\\JERROR.C" - source type("c") "JPEG\\JFDCTFLT.C" - source type("c") "JPEG\\JFDCTFST.C" - source type("c") "JPEG\\JFDCTINT.C" - source type("c") "JPEG\\JIDCTFLT.C" - source type("c") "JPEG\\JIDCTFST.C" - source type("c") "JPEG\\JIDCTINT.C" - source type("c") "JPEG\\JIDCTRED.C" - source type("c") "JPEG\\JMEMMGR.C" - source type("c") "JPEG\\JMEMNOBS.C" - source type("c") "JPEG\\JQUANT1.C" - source type("c") "JPEG\\JQUANT2.C" - source type("c") "JPEG\\JUTILS.C" - } -} diff --git a/wxWidgets/src/wxPng.icc b/wxWidgets/src/wxPng.icc deleted file mode 100644 index b8d7a7b447..0000000000 --- a/wxWidgets/src/wxPng.icc +++ /dev/null @@ -1,28 +0,0 @@ -option ProjectOptions = gen(arch, "pentium2"), opt(tune, "pentium2"), - define("__WXPM__", ), define("__VISAGECPP__", ), - incl(searchpath, "..\\src\\png"), incl(searchpath, "..\\src\\zlib"), report(level, "E"), - file(genobject, "..\\src\\png\\dbgos240\\") -{ - perform - { - run before '-mkdir ' '..\\src\\png\\dbgos240' - } - target type(lib) "..\\lib\\os2png.lib" - { - source type("c") "PNG\\PNG.C" - source type("c") "PNG\\PNGERROR.C" - source type("c") "PNG\\PNGGET.C" - source type("c") "PNG\\PNGMEM.C" - source type("c") "PNG\\PNGPREAD.C" - source type("c") "PNG\\PNGREAD.C" - source type("c") "PNG\\PNGRTRAN.C" - source type("c") "PNG\\PNGRUTIL.C" - source type("c") "PNG\\PNGSET.C" - source type("c") "PNG\\PNGTRANS.C" - source type("c") "PNG\\PNGWRITE.C" - source type("c") "PNG\\PNGWTRAN.C" - source type("c") "PNG\\PNGWUTIL.C" - source type("c") "PNG\\PNGRIO.C" - source type("c") "PNG\\PNGWIO.C" - } -} diff --git a/wxWidgets/src/wxTiff.icc b/wxWidgets/src/wxTiff.icc deleted file mode 100644 index 4842ad81ce..0000000000 --- a/wxWidgets/src/wxTiff.icc +++ /dev/null @@ -1,47 +0,0 @@ -option ProjectOptions = gen(arch, "pentium2"), opt(tune, "pentium2"), - define("__WXPM__", ), define("__VISAGECPP__", ), define("OS2_32", ), - incl(searchpath, "..\\src"), incl(searchpath, "..\\Include"), report(level, "E"), - file(genobject, "..\\src\\tiff\\dbgos240\\") -{ - perform - { - run before '-mkdir ' '..\\src\\tiff\\dbgos240' - } - target "..\\lib\\os2tiff.lib" - { - source type("c") "TIFF\\TIF_AUX.C" - source type("c") "TIFF\\TIF_CLOSE.C" - source type("c") "TIFF\\TIF_CODEC.C" - source type("c") "TIFF\\TIF_COMPRESS.C" - source type("c") "TIFF\\TIF_DIR.C" - source type("c") "TIFF\\TIF_DIRINFO.C" - source type("c") "TIFF\\TIF_DIRREAD.C" - source type("c") "TIFF\\TIF_DIRWRITE.C" - source type("c") "TIFF\\TIF_DUMPMODE.C" - source type("c") "TIFF\\TIF_ERROR.C" - source type("c") "TIFF\\TIF_FAX3.C" - source type("c") "TIFF\\TIF_FAX3SM.C" - source type("c") "TIFF\\TIF_FLUSH.C" - source type("c") "TIFF\\TIF_GETIMAGE.C" - source type("c") "TIFF\\TIF_JPEG.C" - source type("c") "TIFF\\TIF_LUV.C" - source type("c") "TIFF\\TIF_LZW.C" - source type("c") "TIFF\\TIF_NEXT.C" - source type("c") "TIFF\\TIF_OPEN.C" - source type("c") "TIFF\\TIF_OS2.C" - source type("c") "TIFF\\TIF_PACKBITS.C" - source type("c") "TIFF\\TIF_PIXARLOG.C" - source type("c") "TIFF\\TIF_PREDICT.C" - source type("c") "TIFF\\TIF_PRINT.C" - source type("c") "TIFF\\TIF_READ.C" - source type("c") "TIFF\\TIF_STRIP.C" - source type("c") "TIFF\\TIF_SWAB.C" - source type("c") "TIFF\\TIF_THUNDER.C" - source type("c") "TIFF\\TIF_TILE.C" - source type("c") "TIFF\\TIF_VERSION.C" - source type("c") "TIFF\\TIF_WARNING.C" - source type("c") "TIFF\\TIF_WRITE.C" - source type("c") "TIFF\\TIF_ZIP.C" - } -} - diff --git a/wxWidgets/src/wxWin.icc b/wxWidgets/src/wxWin.icc deleted file mode 100644 index a2deca02f6..0000000000 --- a/wxWidgets/src/wxWin.icc +++ /dev/null @@ -1,281 +0,0 @@ -option ProjectOptions = gen(arch, "pentium2"), lang(longlong, "yes"), gen(manglelinkagekeywordonlyfuncs, "no"), lang(allowtypedefasclassname, "yes"), - opt(tune, "pentium2"), define("__WXPM__", ), define("__VISAGECPP__", ), incl(searchpath, "..\\src\\png"), incl(searchpath, "..\\src\\jpeg"), - lang(templatedefimpls, "dontparse"), lang(compatmath, "yes"), - lang(nokeyword, "const_cast"), lang(nokeyword, "explicit"), lang(nokeyword, "export"), lang(nokeyword, "false"), - lang(nokeyword, "mutable"), - lang(nokeyword, "true"), lang(nokeyword, "typename"), - lang(trailingenumcommas, "no"), lang(universalcharacternames, "no"), link(debug, "yes"), link(linkwithmultithreadlib, "yes"), - link(linkwithsharedlib, "yes"), link(defaultlibs, "no"), link(extdictionary, "no"), opt(inline, "yes"), - incl(searchpath, "..\\src\\xpm"), incl(searchpath, "..\\src\\zlib"), incl(searchpath, "..\\Include"), macros(redefine, "yes"), - file(genobject, "..\\src\\common\\dbgos240\\"), - file(usepch, "No"), debug(maxerrors, 100), info(cmp, "yes"), info(cnd, "yes"), info(cns, "yes"), info(cnv, "yes"), - info(cpy, "yes"), info(dcl, "yes"), info(eff, "yes"), info(enu, "yes"), info(ext, "yes"), info(ini, "yes"), - info(ord, "yes"), info(par, "yes"), info(rea, "yes"), info(trd, "yes"), info(tru, "yes"), info(uni, "yes"), - info(use, "yes") -{ - perform - { - run before '-mkdir ' '..\\src\\common\\dbgos240' - run before 'copy ' '..\\src\common\\dosyacc.c ' '..\\src\\common\\y_tab.c' - run before 'copy ' '..\\src\common\\doslex.c ' '..\\src\\common\\lex_yy.c' - } - target type("lib") "..\\LIB\\wx40.lib" - { - source "COMMON\\appcmn.cpp" - source "COMMON\\choiccmn.cpp" - source "COMMON\\clipcmn.cpp" - source "COMMON\\cmdline.cpp" - source "COMMON\\cmndata.cpp" - source "COMMON\\config.cpp" - source "COMMON\\ctrlcmn.cpp" - source "COMMON\\ctrlsub.cpp" - source "COMMON\\datetime.cpp" - source "COMMON\\datstrm.cpp" - source "COMMON\\db.cpp" - source "COMMON\\dbtable.cpp" - source "COMMON\\dcbase.cpp" - source "COMMON\\dircmn.cpp" - source "COMMON\\dlgcmn.cpp" - source "COMMON\\dndcmn.cpp" - source "COMMON\\dobjcmn.cpp" - source "COMMON\\docmdi.cpp" - source "COMMON\\docview.cpp" - source "COMMON\\dynarray.cpp" - source "COMMON\\dynlib.cpp" - source "COMMON\\encconv.cpp" - source "COMMON\\event.cpp" - option report(level, "W") - { - source type("c") "COMMON\\EXTENDED.C" - } - source "COMMON\\ffile.cpp" - source "COMMON\\file.cpp" - source "COMMON\\fileconf.cpp" - source "COMMON\\filefn.cpp" - source "COMMON\\filename.cpp" - source "COMMON\\filesys.cpp" - source "COMMON\\fontcmn.cpp" - source "COMMON\\fontmap.cpp" - source "COMMON\\framecmn.cpp" - source "COMMON\\fs_inet.cpp" - source "COMMON\\fs_mem.cpp" - source "COMMON\\fs_zip.cpp" - source "COMMON\\ftp.cpp" - source "COMMON\\gdicmn.cpp" - source "COMMON\\geometry.cpp" - source "COMMON\\gifdecod.cpp" - source "COMMON\\hash.cpp" - source "COMMON\\helpbase.cpp" - source "COMMON\\http.cpp" - source "COMMON\\imagall.cpp" - source "COMMON\\imagbmp.cpp" - source "COMMON\\image.cpp" - source "COMMON\\imaggif.cpp" - source "COMMON\\imagjpeg.cpp" - source "COMMON\\imagpcx.cpp" - source "COMMON\\imagpng.cpp" - source "COMMON\\imagpnm.cpp" - source "COMMON\\imagtiff.cpp" - source "COMMON\\imagxpm.cpp" - source "COMMON\\intl.cpp" - source "COMMON\\ipcbase.cpp" - source "COMMON\\layout.cpp" - source "COMMON\\lboxcmn.cpp" - source "COMMON\\list.cpp" - source "COMMON\\log.cpp" - source "COMMON\\matrix.cpp" - source "COMMON\\memory.cpp" - source "COMMON\\menucmn.cpp" - source "COMMON\\mimecmn.cpp" - source "COMMON\\module.cpp" - source "COMMON\\mstream.cpp" - source "COMMON\\object.cpp" - source "COMMON\\objstrm.cpp" - source "COMMON\\odbc.cpp" - source "COMMON\\paper.cpp" - source "COMMON\\prntbase.cpp" - source "COMMON\\process.cpp" - source "COMMON\\protocol.cpp" - source "COMMON\\quantize.cpp" - source "COMMON\\resource.cpp" - source "COMMON\\sckaddr.cpp" - source "COMMON\\sckfile.cpp" - source "COMMON\\sckipc.cpp" - source "COMMON\\sckstrm.cpp" - source "COMMON\\serbase.cpp" - source "COMMON\\sizer.cpp" - source "COMMON\\socket.cpp" - source "COMMON\\strconv.cpp" - source "COMMON\\stream.cpp" - source "COMMON\\string.cpp" - source "COMMON\\tbarbase.cpp" - source "COMMON\\textcmn.cpp" - source "COMMON\\textfile.cpp" - source "COMMON\\timercmn.cpp" - source "COMMON\\tokenzr.cpp" - source "COMMON\\treelist.cpp" - source "COMMON\\txtstrm.cpp" - option report(level, "E") - { - source type("c") "COMMON\\UNZIP.C" - } - source "COMMON\\url.cpp" - source "COMMON\\utilscmn.cpp" - source "COMMON\\valgen.cpp" - source "COMMON\\validate.cpp" - source "COMMON\\valtext.cpp" - source "COMMON\\variant.cpp" - source "COMMON\\wincmn.cpp" - source "COMMON\\wxchar.cpp" - source "COMMON\\wxexpr.cpp" - source "COMMON\\wfstream.cpp" - option report(level, "E") - { - source type("c") "COMMON\\Y_TAB.C" - } - source "COMMON\\zipstrm.cpp" - source "COMMON\\zstream.cpp" - source "GENERIC\\BUSYINFO.CPP" - source "GENERIC\\CALCTRL.CPP" - source "GENERIC\\CARET.CPP" - source "GENERIC\\CHOICDGG.CPP" - source "GENERIC\\COLRDLGG.CPP" - source "GENERIC\\DCPSG.CPP" - source "GENERIC\\DRAGIMGG.CPP" - source "GENERIC\\FONTDLGG.CPP" - source "GENERIC\\GRID.CPP" - source "GENERIC\\GRIDCTRL.CPP" - source "GENERIC\\GRIDSEL.CPP" - source "GENERIC\\HELPEXT.CPP" - source "GENERIC\\HELPHTML.CPP" - source "GENERIC\\HELPWXHT.CPP" - source "GENERIC\\HELPXLP.CPP" - source "GENERIC\\IMAGLIST.CPP" - source "GENERIC\\LAYWIN.CPP" - source "GENERIC\\LISTCTRL.CPP" - source "GENERIC\\LOGG.CPP" - source "GENERIC\\NUMDLGG.CPP" - source "GENERIC\\PANELG.CPP" - source "GENERIC\\PLOT.CPP" - source "GENERIC\\PRINTPS.CPP" - source "GENERIC\\PRNTDLGG.CPP" - source "GENERIC\\PROGDLGG.CPP" - source "GENERIC\\PROP.CPP" - source "GENERIC\\PROPFORM.CPP" - source "GENERIC\\PROPLIST.CPP" - source "GENERIC\\SASHWIN.CPP" - source "GENERIC\\SCROLWIN.CPP" - source "GENERIC\\SPLITTER.CPP" - source "GENERIC\\STATUSBR.CPP" - source "GENERIC\\TABG.CPP" - source "GENERIC\\TBARSMPL.CPP" - source "GENERIC\\TEXTDLGG.CPP" - source "GENERIC\\TIPDLG.CPP" - source "GENERIC\\TREECTRL.CPP" - source "GENERIC\\TREELAY.CPP" - source "GENERIC\\WIZARD.CPP" - source "HTML\\helpctrl.cpp" - source "HTML\\helpdata.cpp" - source "HTML\\helpfrm.cpp" - source "HTML\\htmlcell.cpp" - source "HTML\\htmlfilt.cpp" - source "HTML\\htmlpars.cpp" - source "HTML\\htmltag.cpp" - source "HTML\\htmlwin.cpp" - source "HTML\\htmprint.cpp" - source "HTML\\m_dflist.cpp" - source "HTML\\m_fonts.cpp" - source "HTML\\m_hline.cpp" - source "HTML\\m_image.cpp" - source "HTML\\m_layout.cpp" - source "HTML\\m_links.cpp" - source "HTML\\m_list.cpp" - source "HTML\\m_meta.cpp" - source "HTML\\m_pre.cpp" - source "HTML\\m_tables.cpp" - source "HTML\\winpars.cpp" - source "OS2\\ACCEL.CPP" - source "OS2\\APP.CPP" - source "OS2\\BITMAP.CPP" - source "OS2\\BMPBUTTN.CPP" - source "OS2\\BRUSH.CPP" - source "OS2\\BUTTON.CPP" - source "OS2\\CHECKBOX.CPP" - source "OS2\\CHECKLST.CPP" - source "OS2\\CHOICE.CPP" - source "OS2\\CLIPBRD.CPP" - source "OS2\\COLOUR.CPP" - source "OS2\\COMBOBOX.CPP" - source "OS2\\CONTROL.CPP" - source "OS2\\CURSOR.CPP" - source "OS2\\DATA.CPP" - source "OS2\\DATAOBJ.CPP" - source "OS2\\DC.CPP" - source "OS2\\DCCLIENT.CPP" - source "OS2\\DCMEMORY.CPP" - source "OS2\\DCPRINT.CPP" - source "OS2\\DCSCREEN.CPP" - source "OS2\\DIALOG.CPP" - source "OS2\\DIRDLG.CPP" - source "OS2\\DND.CPP" - source "OS2\\FILEDLG.CPP" - source "OS2\\FONT.CPP" - source "OS2\\FONTDLG.CPP" - source "OS2\\FONTENUM.CPP" - source "OS2\\FONTUTIL.CPP" - source "OS2\\FRAME.CPP" - source "OS2\\GAUGE.CPP" - source "OS2\\GDIIMAGE.CPP" - source "OS2\\GDIOBJ.CPP" - option report(level, "E") - { - source type("c") "OS2\\GSOCKET.C" - } - option report(level, "E") - { - source type("c") "OS2\\GSOCKPM.C" - } - source "OS2\\HELPWIN.CPP" - source "OS2\\ICON.CPP" - source "OS2\\INICONF.CPP" - source "OS2\\JOYSTICK.CPP" - source "OS2\\LISTBOX.CPP" - source "OS2\\MAIN.CPP" - source "OS2\\MDI.CPP" - source "OS2\\MENU.CPP" - source "OS2\\MENUITEM.CPP" - source "OS2\\METAFILE.CPP" - source "OS2\\MIMETYPE.CPP" - source "OS2\\MINIFRAM.CPP" - source "OS2\\MSGDLG.CPP" - source "OS2\\NATIVDLG.CPP" - source "OS2\\NOTEBOOK.CPP" - source "OS2\\OWNERDRW.CPP" - source "OS2\\PALETTE.CPP" - source "OS2\\PEN.CPP" - source "OS2\\PRINT.CPP" - source "OS2\\RADIOBOX.CPP" - source "OS2\\RADIOBUT.CPP" - source "OS2\\REGION.CPP" - source "OS2\\SCROLBAR.CPP" - source "OS2\\SETTINGS.CPP" - source "OS2\\SLIDER.CPP" - source "OS2\\SPINBUTT.CPP" - source "OS2\\SPINCTRL.CPP" - source "OS2\\STATBMP.CPP" - source "OS2\\STATBOX.CPP" - source "OS2\\STATLINE.CPP" - source "OS2\\STATTEXT.CPP" - source "OS2\\TABCTRL.CPP" - source "OS2\\TASKBAR.CPP" - source "OS2\\TEXTCTRL.CPP" - source "OS2\\THREAD.CPP" - source "OS2\\TIMER.CPP" - source "OS2\\TOOLBAR.CPP" - source "OS2\\TOOLTIP.CPP" - source "OS2\\UTILS.CPP" - source "OS2\\UTILSEXC.CPP" - source "OS2\\WAVE.CPP" - source "OS2\\WINDOW.CPP" - } -} diff --git a/wxWidgets/src/wxWindowsClassicM8.xml b/wxWidgets/src/wxWindowsClassicM8.xml deleted file mode 100644 index 4707b75b8c..0000000000 --- a/wxWidgets/src/wxWindowsClassicM8.xml +++ /dev/null @@ -1,39547 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -]> - - - - - wxlib PPC debug - - - - UserSourceTrees - - - AlwaysSearchUserPathstrue - InterpretDOSAndUnixPathstrue - RequireFrameworkStyleIncludesfalse - UserSearchPaths - - SearchPath - Path::include: - PathFormatMacOS - PathRootProject - - Recursivefalse - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path::art: - PathFormatMacOS - PathRootProject - - Recursivefalse - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:generic: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:mac:classic: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:regex: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:common: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:zlib: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:png: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:jpeg: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:iodbc: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:tiff: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:html: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Pathxml - PathFormatUnix - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Pathexpat/lib - PathFormatUnix - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SystemSearchPaths - - SearchPath - Path:MSL: - PathFormatMacOS - PathRootCodeWarrior - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:MacOS Support: - PathFormatMacOS - PathRootCodeWarrior - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - - - MWRuntimeSettings_WorkingDirectory - MWRuntimeSettings_CommandLine - MWRuntimeSettings_HostApplication - Path - PathFormatGeneric - PathRootAbsolute - - MWRuntimeSettings_EnvVars - - - LinkerMacOS PPC Linker - PreLinker - PostLinker - Targetnamewxlib PPC debug - OutputDirectory - Path::lib: - PathFormatMacOS - PathRootProject - - SaveEntriesUsingRelativePathstrue - - - FileMappings - - FileTypeAPPL - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypeAppl - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypeMMLB - FileExtension - CompilerLib Import PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeMPLF - FileExtension - CompilerLib Import PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeMWCD - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypeRSRC - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.bh - CompilerBalloon Help - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.c - CompilerMW C/C++ PPC - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.c++ - CompilerMW C/C++ PPC - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.cc - CompilerMW C/C++ PPC - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.cp - CompilerMW C/C++ PPC - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.cpp - CompilerMW C/C++ PPC - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.exp - Compiler - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.h - CompilerMW C/C++ PPC - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMaketrue - - - FileTypeTEXT - FileExtension.p - CompilerMW Pascal PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.pas - CompilerMW Pascal PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.pch - CompilerMW C/C++ PPC - EditLanguageC/C++ - Precompiletrue - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.pch++ - CompilerMW C/C++ PPC - EditLanguageC/C++ - Precompiletrue - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.ppu - CompilerMW Pascal PPC - EditLanguage - Precompiletrue - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.r - CompilerRez - EditLanguageRez - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.s - CompilerPPCAsm - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeXCOF - FileExtension - CompilerXCOFF Import PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeXPM - FileExtension.xpm - CompilerMW C/C++ PPC - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypedocu - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypersrc - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypeshlb - FileExtension - CompilerPEF Import PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypestub - FileExtension - CompilerPEF Import PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileExtension.doc - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFilefalse - IgnoredByMaketrue - - - FileExtension.o - CompilerXCOFF Import PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileExtension.ppob - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileExtension.rsrc - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - - - CacheModDatestrue - DumpBrowserInfofalse - CacheSubprojectstrue - UseThirdPartyDebuggerfalse - BrowserGenerator1 - DebuggerAppPath - Path - PathFormatGeneric - PathRootAbsolute - - DebuggerCmdLineArgs - DebuggerWorkingDir - Path - PathFormatGeneric - PathRootAbsolute - - CodeCompletionPrefixFileNameMacHeaders.c - CodeCompletionMacroFileNameMacOS_Carbon_C++_Macros.h - - - ConsoleEncoding0 - LogSystemMessagestrue - AutoTargetDLLsfalse - StopAtWatchpointstrue - PauseWhileRunningfalse - PauseInterval5 - PauseUIFlags0 - AltExePath - Path - PathFormatGeneric - PathRootAbsolute - - StopAtTempBPOnLaunchtrue - CacheSymbolicstrue - TempBPFunctionNamemain - TempBPType0 - - - Enabledfalse - ConnectionName - DownloadPath - LaunchRemoteAppfalse - RemoteAppPath - CoreID0 - JTAGClockSpeed8000 - IsMultiCorefalse - OSDownloadfalse - UseGlobalOSDownloadfalse - OSDownloadConnectionName - OSDownloadPath - AltDownloadfalse - AltDownloadConnectionName - - - OtherExecutables - - - CustomColor1 - Red0 - Green32767 - Blue0 - - CustomColor2 - Red0 - Green32767 - Blue0 - - CustomColor3 - Red0 - Green32767 - Blue0 - - CustomColor4 - Red0 - Green32767 - Blue0 - - - - MWFrontEnd_C_cplusplus0 - MWFrontEnd_C_checkprotos0 - MWFrontEnd_C_arm0 - MWFrontEnd_C_trigraphs0 - MWFrontEnd_C_onlystdkeywords0 - MWFrontEnd_C_enumsalwaysint0 - MWFrontEnd_C_mpwpointerstyle1 - MWFrontEnd_C_prefixnamewx/wx_cw_d.h - MWFrontEnd_C_ansistrict0 - MWFrontEnd_C_mpwcnewline0 - MWFrontEnd_C_wchar_type1 - MWFrontEnd_C_enableexceptions1 - MWFrontEnd_C_dontreusestrings0 - MWFrontEnd_C_poolstrings0 - MWFrontEnd_C_dontinline0 - MWFrontEnd_C_useRTTI1 - MWFrontEnd_C_multibyteaware0 - MWFrontEnd_C_unsignedchars1 - MWFrontEnd_C_autoinline0 - MWFrontEnd_C_booltruefalse1 - MWFrontEnd_C_inlinelevel0 - MWFrontEnd_C_ecplusplus0 - MWFrontEnd_C_objective_c0 - MWFrontEnd_C_defer_codegen0 - MWFrontEnd_C_templateparser0 - MWFrontEnd_C_c990 - MWFrontEnd_C_bottomupinline1 - - - MWWarning_C_warn_illpragma1 - MWWarning_C_warn_emptydecl0 - MWWarning_C_warn_possunwant0 - MWWarning_C_warn_unusedvar0 - MWWarning_C_warn_unusedarg0 - MWWarning_C_warn_extracomma0 - MWWarning_C_pedantic1 - MWWarning_C_warningerrors0 - MWWarning_C_warn_hidevirtual1 - MWWarning_C_warn_implicitconv0 - MWWarning_C_warn_notinlined0 - MWWarning_C_warn_structclass1 - - - MWFTP_Post_hostName - MWFTP_Post_username - MWFTP_Post_password0ÿÄ@ž–@)t - MWFTP_Post_remoteDir - MWFTP_Post_ftp_PathVersion1 - MWFTP_Post_ftp_PathType0 - MWFTP_Post_ftp_PathFormat0 - MWFTP_Post_ftp_tree - MWFTP_Post_uploadDir - MWFTP_Post_ftp_port21 - MWFTP_Post_SendBin1 - MWFTP_Post_ShouldLog1 - - - MWCommandLine_Java_clsName - MWCommandLine_Java_args - - - MWVJavaDebugging_Protocol1 - MWVJavaDebugging_JDKVersion1 - MWVJavaDebugging_TimeOut10 - MWVJavaDebugging_SupportSlowDevicesfalse - MWVJavaDebugging_UseRemoteLaunchAgentfalse - MWVJavaDebugging_LaunchVMasServerfalse - - - MWJava_Language_optimizefalse - MWJava_Language_warnDeprecatedfalse - MWJava_Language_emitMapfalse - MWJava_Language_strictFileNamesfalse - MWJava_Language_strictFileHierarchyfalse - MWJava_Language_1_1_Compatiblefalse - MWJava_Language_emitHeaders0 - MWJava_Language_headerTypeJNINativeHeaders - MWJava_Language_packageFilter - MWJava_Language_genCommentstrue - MWJava_Language_genHeadersfalse - MWJava_Language_enableAssertsfalse - MWJava_Language_targetVM1.1 - - - Manifest-JAD Attributes - - AttributeMain-Class - ValueAuto-Generated - - - - - MWJava_MRJAppBuilder_outFileMRJApplication - MWJava_MRJAppBuilder_mergefalse - MWJava_MRJAppBuilder_quitMenutrue - MWJava_MRJAppBuilder_growfalse - MWJava_MRJAppBuilder_stdoutTypeConsole - MWJava_MRJAppBuilder_stderrTypeConsole - MWJava_MRJAppBuilder_stdinTypeConsole - MWJava_MRJAppBuilder_appIconPVersion0 - MWJava_MRJAppBuilder_appIconPType0 - MWJava_MRJAppBuilder_appIconPFormat0 - MWJava_MRJAppBuilder_appIconPTree - MWJava_MRJAppBuilder_appIconFile - MWJava_MRJAppBuilder_splashScreenPVersion0 - MWJava_MRJAppBuilder_splashScreenPType0 - MWJava_MRJAppBuilder_splashScreenPFormat0 - MWJava_MRJAppBuilder_splashScreenPTree - MWJava_MRJAppBuilder_splashScreenPICTFile - MWJava_MRJAppBuilder_aboutName - MWJava_MRJAppBuilder_stdoutPVersion0 - MWJava_MRJAppBuilder_stdoutPType0 - MWJava_MRJAppBuilder_stdoutPFormat0 - MWJava_MRJAppBuilder_stdoutPTree - MWJava_MRJAppBuilder_stdoutFile - MWJava_MRJAppBuilder_stdoutAppendfalse - MWJava_MRJAppBuilder_stderrPType0 - MWJava_MRJAppBuilder_stderrPFormat0 - MWJava_MRJAppBuilder_stderrPTree - MWJava_MRJAppBuilder_stderrFile - MWJava_MRJAppBuilder_stderrAppendfalse - MWJava_MRJAppBuilder_stdinPType0 - MWJava_MRJAppBuilder_stdinPFormat0 - MWJava_MRJAppBuilder_stdinPTree - MWJava_MRJAppBuilder_stdinFile - - - MWJava_Output_outputtypeJarFile - MWJava_Output_outfileJavaClasses.jar - MWJava_Output_ftype1514754080 - MWJava_Output_fcreator1297570384 - MWJava_Output_compress0 - MWJava_Output_genManifest0 - MWJava_Output_trunctypeFront - MWJava_Output_deleteClasses0 - MWJava_Output_consoleApp1 - MWJava_Output_preverify0 - MWJava_Output_genJad0 - MWJava_Output_obfuscate0 - - - MWJava_Proj_projtypeApplet - MWJava_Proj_mainClassName - MWJava_Proj_HTMLAppCreator1145457748 - MWJava_Proj_HTMLAppNameMetrowerks Java - MWJava_Proj_PathVersion1 - MWJava_Proj_PathType0 - MWJava_Proj_PathFormat0 - MWJava_Proj_tree - MWJava_Proj_HTMLAppWin32NameInternet Explorer - MWJava_Proj_compress0 - MWJava_Proj_simulator0 - MWJava_Proj_useVM\000\000macosx - MWJava_Proj_vmarguments - MWJava_Proj_vmName - MWJava_Proj_simPropFile - - - MWJavaDoc_Proj_Version1 - MWJavaDoc_Proj_Deprecated1 - MWJavaDoc_Proj_Author1 - MWJavaDoc_Proj_Index1 - MWJavaDoc_Proj_Tree1 - MWJavaDoc_Proj_SunResolveToSame0 - MWJavaDoc_Proj_Shortnames1 - MWJavaDoc_Proj_Folder0 - MWJavaDoc_Proj_GenerateAPILinks0 - MWJavaDoc_Proj_scopePublic - MWJavaDoc_Proj_fcreator1297303877 - MWJavaDoc_Proj_encodingName - MWJavaDoc_Proj_decodingName - MWJavaDoc_Proj_javaPackagePathhttp://java.sun.com/products/jdk/1.1/docs/api/ - - - MWMerge_MacOS_projectTypeApplication - MWMerge_MacOS_outputNameMerge Out - MWMerge_MacOS_outputCreator???? - MWMerge_MacOS_outputTypeAPPL - MWMerge_MacOS_suppressWarning0 - MWMerge_MacOS_copyFragments1 - MWMerge_MacOS_copyResources1 - MWMerge_MacOS_flattenResource0 - MWMerge_MacOS_flatFileNamea.rsrc - MWMerge_MacOS_flatFileOutputPath - Path: - PathFormatMacOS - PathRootProject - - MWMerge_MacOS_skipResources - DLGX - ckid - Proj - WSPC - - - - FileLockedfalse - ResourcesMapIsReadOnlyfalse - PrinterDriverIsMultiFinderCompatiblefalse - Invisiblefalse - HasBundlefalse - NameLockedfalse - Stationeryfalse - HasCustomIconfalse - Sharedfalse - HasBeenInitedfalse - Label0 - Comments - - - MWMacOSPackager_UsePackager0 - MWMacOSPackager_FolderToPackage - Path - PathFormatMacOS - PathRootAbsolute - - MWMacOSPackager_CreateClassicAlias0 - MWMacOSPackager_ClassicAliasMethodUseTargetOutput - MWMacOSPackager_ClassicAliasPath - Path - PathFormatMacOS - PathRootAbsolute - - MWMacOSPackager_CreatePkgInfo0 - MWMacOSPackager_PkgCreatorType???? - MWMacOSPackager_PkgFileTypeAPPL - - - MWCodeGen_PPC_structalignmentPPC_mw - MWCodeGen_PPC_tracebacktablesInline - MWCodeGen_PPC_processorGeneric - MWCodeGen_PPC_function_align4 - MWCodeGen_PPC_tocdata1 - MWCodeGen_PPC_largetoc0 - MWCodeGen_PPC_profiler0 - MWCodeGen_PPC_vectortocdata0 - MWCodeGen_PPC_poolconst0 - MWCodeGen_PPC_peephole1 - MWCodeGen_PPC_readonlystrings0 - MWCodeGen_PPC_linkerpoolsstrings0 - MWCodeGen_PPC_volatileasm0 - MWCodeGen_PPC_schedule0 - MWCodeGen_PPC_altivec0 - MWCodeGen_PPC_altivec_move_block0 - MWCodeGen_PPC_strictIEEEfp0 - MWCodeGen_PPC_fpcontract1 - MWCodeGen_PPC_genfsel0 - MWCodeGen_PPC_orderedfpcmp0 - - - MWCodeGen_MachO_structalignmentPPC_mw - MWCodeGen_MachO_profiler_enumOff - MWCodeGen_MachO_processorGeneric - MWCodeGen_MachO_function_align4 - MWCodeGen_MachO_common0 - MWCodeGen_MachO_peephole1 - MWCodeGen_MachO_readonlystrings0 - MWCodeGen_MachO_linkerpoolsstrings1 - MWCodeGen_MachO_volatileasm0 - MWCodeGen_MachO_schedule0 - MWCodeGen_MachO_altivec0 - MWCodeGen_MachO_vecmove0 - MWCodeGen_MachO_fp_ieee_strict0 - MWCodeGen_MachO_fpcontract1 - MWCodeGen_MachO_genfsel0 - MWCodeGen_MachO_fp_cmps_ordered0 - - - MWDisassembler_PPC_showcode1 - MWDisassembler_PPC_extended1 - MWDisassembler_PPC_mix0 - MWDisassembler_PPC_nohex0 - MWDisassembler_PPC_showdata1 - MWDisassembler_PPC_showexceptions1 - MWDisassembler_PPC_showsym1 - MWDisassembler_PPC_shownames1 - - - GlobalOptimizer_PPC_optimizationlevelLevel0 - GlobalOptimizer_PPC_optforSpeed - - - MWLinker_PPC_linksym1 - MWLinker_PPC_symfullpath1 - MWLinker_PPC_linkmap0 - MWLinker_PPC_nolinkwarnings0 - MWLinker_PPC_dontdeadstripinitcode1 - MWLinker_PPC_permitmultdefs0 - MWLinker_PPC_linkmodeFast - MWLinker_PPC_initname - MWLinker_PPC_mainname__start - MWLinker_PPC_termname - - - MWLinker_MacOSX_linksym0 - MWLinker_MacOSX_symfullpath0 - MWLinker_MacOSX_nolinkwarnings0 - MWLinker_MacOSX_linkmap0 - MWLinker_MacOSX_dontdeadstripinitcode0 - MWLinker_MacOSX_permitmultdefs1 - MWLinker_MacOSX_use_objectivec_semantics0 - MWLinker_MacOSX_strip_debug_symbols0 - MWLinker_MacOSX_split_segs0 - MWLinker_MacOSX_report_msl_overloads0 - MWLinker_MacOSX_objects_follow_linkorder0 - MWLinker_MacOSX_linkmodeFast - MWLinker_MacOSX_exportsReferencedGlobals - MWLinker_MacOSX_sortcodeNone - MWLinker_MacOSX_mainnamestart - - - MWProject_MacOSX_typeLibrary - MWProject_MacOSX_outfilewx_PPC_d.lib - MWProject_MacOSX_filecreator???? - MWProject_MacOSX_filetype???? - MWProject_MacOSX_vmaddress0 - MWProject_MacOSX_usedefaultvmaddr1 - MWProject_MacOSX_flatrsrc0 - MWProject_MacOSX_flatrsrcfilename - MWProject_MacOSX_flatrsrcoutputdir - Path: - PathFormatMacOS - PathRootProject - - MWProject_MacOSX_installpath./ - MWProject_MacOSX_dont_prebind0 - MWProject_MacOSX_flat_namespace0 - MWProject_MacOSX_frameworkversionA - MWProject_MacOSX_currentversion0 - MWProject_MacOSX_flat_oldimpversion0 - - - MWLinker_MachO_exportsNone - MWLinker_MachO_mainnamestart - MWLinker_MachO_currentversion0 - MWLinker_MachO_compatibleversion0 - MWLinker_MachO_symfullpath0 - MWLinker_MachO_supresswarnings0 - MWLinker_MachO_multisymerror0 - MWLinker_MachO_prebind1 - MWLinker_MachO_deadstrip1 - MWLinker_MachO_objectivecsemantics0 - MWLinker_MachO_whichfileloaded0 - MWLinker_MachO_whyfileloaded0 - MWLinker_MachO_readonlyrelocsErrors - MWLinker_MachO_undefinedsymbolsErrors - MWLinker_MachO_twolevelnamespace1 - MWLinker_MachO_stripdebugsymbols0 - - - MWProject_MachO_typeExecutable - MWProject_MachO_outfilea.exe - MWProject_MachO_filecreator???? - MWProject_MachO_filetypeMEXE - MWProject_MachO_vmaddress4096 - MWProject_MachO_flatrsrc1 - MWProject_MachO_flatrsrcfilenamea.rsrc - MWProject_MachO_flatrsrcoutputdir - Path: - PathFormatMacOS - PathRootProject - - MWProject_MachO_installpath./ - MWProject_MachO_frameworkversion - - - MWPEF_exportsAll - MWPEF_libfolder0 - MWPEF_sortcodeNone - MWPEF_expandbss0 - MWPEF_sharedata0 - MWPEF_olddefversion0 - MWPEF_oldimpversion0 - MWPEF_currentversion0 - MWPEF_fragmentnamewxwin - MWPEF_collapsereloads0 - - - MWProject_PPC_typeLibrary - MWProject_PPC_outfilewx_PPC_d.lib - MWProject_PPC_filecreator???? - MWProject_PPC_filetype???? - MWProject_PPC_size0 - MWProject_PPC_minsize0 - MWProject_PPC_stacksize0 - MWProject_PPC_flags0 - MWProject_PPC_symfilename - MWProject_PPC_rsrcname - MWProject_PPC_rsrcheaderNative - MWProject_PPC_rsrctype???? - MWProject_PPC_rsrcid0 - MWProject_PPC_rsrcflags0 - MWProject_PPC_rsrcstore0 - MWProject_PPC_rsrcmerge0 - MWProject_PPC_flatrsrc0 - MWProject_PPC_flatrsrcoutputdir - Path: - PathFormatMacOS - PathRootProject - - MWProject_PPC_flatrsrcfilename - - - MWAssembler_PPC_auxheader0 - MWAssembler_PPC_symmodeMac - MWAssembler_PPC_dialectPPC - MWAssembler_PPC_prefixfile - MWAssembler_PPC_typecheck0 - MWAssembler_PPC_warnings0 - MWAssembler_PPC_casesensitive0 - - - PList_OutputTypeFile - PList_OutputEncodingUTF-8 - PList_Prefix - PList_FileFilenameInfo.plist - PList_FileDirectory - Path: - PathFormatMacOS - PathRootProject - - PList_ResourceTypeplst - PList_ResourceID0 - PList_ResourceName - - - MWRez_Language_maxwidth80 - MWRez_Language_scriptRoman - MWRez_Language_alignmentAlign1 - MWRez_Language_filtermodeFilterSkip - MWRez_Language_suppresswarnings0 - MWRez_Language_escapecontrolchars1 - MWRez_Language_prefixname - MWRez_Language_filteredtypes'CODE' 'DATA' 'PICT' - - - MWWinRC_prefixname - - - MWCodeGen_X86_processorGeneric - MWCodeGen_X86_alignmentbytes8 - MWCodeGen_X86_exceptionsZeroOverhead - MWCodeGen_X86_name_manglingMWWin32 - MWCodeGen_X86_use_extinst0 - MWCodeGen_X86_extinst_mmx0 - MWCodeGen_X86_extinst_3dnow0 - MWCodeGen_X86_use_mmx_3dnow_convention0 - MWCodeGen_X86_extinst_cmov0 - MWCodeGen_X86_extinst_sse0 - MWCodeGen_X86_extinst_sse20 - MWCodeGen_X86_intrinsics0 - MWCodeGen_X86_optimizeasm0 - MWCodeGen_X86_disableopts0 - MWCodeGen_X86_profile0 - MWLinker_X86_runtimeCustom - MWCodeGen_X86_readonlystrings0 - - - MWLinker_X86_subsysmajorid4 - MWLinker_X86_subsysminorid0 - MWCOFF_X86_opsysmajorid4 - MWCOFF_X86_opsysminorid0 - MWLinker_X86_usrmajorid0 - MWLinker_X86_usrminorid0 - MWProject_X86_maxstacksize1024 - MWProject_X86_minstacksize4 - MWProject_X86_size1024 - MWProject_X86_minsize4 - MWCOFF_X86_coff_flags0 - MWCOFF_X86_dll_flags0 - MWProject_X86_baseaddress4194304 - MWCOFF_X86_filealign512 - MWCOFF_X86_sectionalign4096 - - - PDisasmX86_showHeaderstrue - PDisasmX86_showSectHeaderstrue - PDisasmX86_showSymTabtrue - PDisasmX86_showCodetrue - PDisasmX86_showDatatrue - PDisasmX86_showDebugfalse - PDisasmX86_showExceptionsfalse - PDisasmX86_showRawfalse - PDisasmX86_showAllRawfalse - PDisasmX86_showSourcefalse - PDisasmX86_showRelocationtrue - PDisasmX86_showHextrue - PDisasmX86_showCommentsfalse - PDisasmX86_showSymDefstrue - PDisasmX86_unmangletrue - PDisasmX86_verbosetrue - PDisasmX86_resolveRelocstrue - PDisasmX86_resolveLocalsfalse - - - MWDebugger_X86_Exceptions - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - - - - GlobalOptimizer_X86_optimizationlevelLevel0 - GlobalOptimizer_X86_optforSpeed - - - MWLinker_X86_entrypointusageDefault - MWLinker_X86_entrypoint - MWLinker_X86_subsystemWinGUI - MWLinker_X86_commandfile - MWLinker_X86_generatemap0 - MWLinker_X86_linksym1 - MWLinker_X86_linkCV1 - MWLinker_X86_symfullpathfalse - MWLinker_X86_linkdebugtrue - MWLinker_X86_checksumfalse - MWLinker_X86_zero_init_bssfalse - MWLinker_X86_mergedatafalse - MWLinker_X86_usedefaultlibsfalse - MWLinker_X86_adddefaultlibsfalse - MWLinker_X86_nowarningsfalse - MWLinker_X86_verbosefalse - - - MWProject_X86_typeLibrary - MWProject_X86_outfilewx_x86_d.lib - MWProject_X86_importlib - MWProject_X86_setimportlibdirfalse - MWProject_X86_dontgenerateimportlibfalse - MWProject_X86_oldformatlibfalse - MWProject_X86_replaceobjextensionfalse - MWProject_X86_copyallfilesfalse - - - - PathRelative - Project - ::include: - :wx_cw_d.pch - MacOS - Text - Debug - - - PathRelative - Project - ::include: - :wx_cw_d.pch++ - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :accel.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :app.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :bitmap.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :bmpbuttn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :brush.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :button.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :checkbox.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :checklst.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :choice.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :clipbrd.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :colordlg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :colour.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :combobox.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :control.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :cursor.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :data.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :dc.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :dcclient.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :dcmemory.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :dcscreen.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :dialog.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :dirdlg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :filedlg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :font.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :fontdlg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :frame.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :gauge.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :gdiobj.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :icon.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :joystick.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :listbox.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :main.cpp - MacOS - Text - - - - PathRelative - Project - :mac:classic: - :mdi.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :menu.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :menuitem.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :minifram.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :msgdlg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :palette.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :pen.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :printdlg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :radiobox.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :radiobut.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :region.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :scrolbar.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :settings.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :slider.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :spinbutt.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :statbmp.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :statbox.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :stattext.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :tabctrl.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :textctrl.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :thread.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :timer.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :toolbar.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :utils.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :utilsexc.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :sound.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :window.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :pnghand.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :printmac.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :dcprint.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :uma.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :sckipc.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :matrix.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :tbarbase.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :imagjpeg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :longlong.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :docmdi.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :appcmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :utilscmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :dynlib.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :extended.c - MacOS - Text - Debug - - - PathRelative - Project - :common: - :unzip.c - MacOS - Text - Debug - - - PathRelative - Project - :common: - :sckstrm.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :zstream.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :process.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :docview.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :sizer.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :imagall.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :imaggif.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :imagpcx.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :cmndata.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :ftp.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :menucmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :string.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :wfstream.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :stream.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :gdicmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :protocol.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :layout.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :valgen.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :intl.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :list.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :socket.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :hash.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :dlgcmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :gifdecod.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :filefn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :wincmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :wxchar.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :memory.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :mstream.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :lboxcmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :fs_inet.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :event.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :image.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :ipcbase.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :tokenzr.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :txtstrm.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :filesys.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :url.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :fs_zip.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :prntbase.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :dcbase.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :object.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :http.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :module.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :validate.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :file.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :config.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :fileconf.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :timercmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :framecmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :textfile.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :dynarray.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :choiccmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :helpbase.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :ctrlsub.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :ctrlcmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :strconv.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :sckfile.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :valtext.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :datstrm.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :sckaddr.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :variant.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :dbtable.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :fontcmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :ffile.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :paper.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :clipcmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :imagpnm.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :imagpng.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :imagbmp.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :zipstrm.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :log.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :textcmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :laywin.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :busyinfo.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :listctrl.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :textdlgg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :tipdlg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :numdlgg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :sashwin.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :dcpsg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :panelg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :imaglist.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :tabg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :choicdgg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :wizard.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :progdlgg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :caret.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :statusbr.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :logg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :fontdlgg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :splitter.cpp - MacOS - Text - Debug - - - Name - db.cpp - MacOS - Text - Debug - - - Name - dobjcmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :fontmap.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :geometry.cpp - MacOS - Text - Debug - - - Name - colrdlgg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :fontutil.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :dataobj.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :m_list.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :m_tables.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :htmlwin.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :m_pre.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :m_image.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :htmprint.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :htmlfilt.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :htmlpars.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :htmltag.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :m_hline.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :winpars.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :htmlcell.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :m_layout.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :m_fonts.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :m_links.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :fontenum.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :datetime.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :encconv.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :mimecmn.cpp - MacOS - Text - Debug - - - Name - metafile.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :gsocket.c - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :macnotfy.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :statbrma.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :tooltip.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :statlmac.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :imagtiff.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :treectlg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :notebmac.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :m_dflist.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :treebase.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :cshelp.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :dirmac.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :mimetmac.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :filename.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :spinctrl.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :glcanvas.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :xpmdecod.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :imagxpm.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :dirctrlg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :helpctrl.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :helpfrm.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :helpdata.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :tipwin.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :radiocmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :nbkbase.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :scrlwing.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :gaugecmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :containr.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :quantize.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :toplvcmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :toplevel.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :morefile:DirectoryCopy.c - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :morefile:Search.c - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :morefile:MoreFilesExtras.c - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :morefile:MoreFiles.c - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :morefile:MoreDesktopMgr.c - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :morefile:IterateDirectory.c - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :morefile:FullPath.c - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :morefile:FSpCompat.c - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :morefile:FileCopy.c - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :gridsel.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :grid.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :statbar.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :clntdata.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :textbuf.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :dragimgg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :calctrl.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :bmpbase.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :cmdline.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :cmdproc.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :dndcmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :dnd.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :dbgrid.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :dircmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :dseldlg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :dynload.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :effects.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :fddlgcmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :fs_mem.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :regex.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :sysopt.cpp - MacOS - Text - Debug - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:PPCLibraries:CursorDevicesGlue.o - MacOS - Library - Debug - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:PPCLibraries:OpenTptATalkPPC.o - MacOS - Library - Debug - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:PPCLibraries:CarbonAccessors.o - MacOS - Library - Debug - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:PPCLibraries:OpenTransportAppPPC.o - MacOS - Library - Debug - - - PathRelative - CodeWarrior - :MacOS Support: - :Libraries:Sources:PLStringFuncs:Libs:PLStringFuncsPPC.lib - MacOS - Library - Debug - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:PPCLibraries:OpenTptInetPPC.o - MacOS - Library - Debug - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:NavigationLib - MacOS - Library - Debug - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:ControlsLib - MacOS - Library - Debug - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:DialogsLib - MacOS - Library - Debug - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:WindowsLib - MacOS - Library - Debug - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:MenusLib - MacOS - Library - Debug - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:InterfaceLib - MacOS - Library - Debug - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:MathLib - MacOS - Library - Debug - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:AppearanceLib - MacOS - Library - Debug - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:InternetConfigLib - MacOS - Library - Debug - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:ThreadsLib - MacOS - Library - Debug - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:OpenTransportLib - MacOS - Library - Debug - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:OpenTptAppleTalkLib - MacOS - Library - Debug - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:OpenTptInternetLib - MacOS - Library - Debug - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:UTCUtils - MacOS - Library - Debug - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:TextCommon - MacOS - Library - Debug - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:Textension - MacOS - Library - Debug, WeakImport - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:ATSUnicodeLib - MacOS - Library - Debug - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:UnicodeConverter - MacOS - Library - Debug - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:TextEncodingConverter - MacOS - Library - Debug - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:DragLib - MacOS - Library - Debug - - - PathRelative - Project - :common: - :imagiff.cpp - MacOS - Text - Debug - - - PathRelative - CodeWarrior - :MacOS Support: - :Libraries:Runtime:Libs:MSL_All_PPC_D.Lib - MacOS - Library - Debug - - - PathRelative - Project - :generic: - :splash.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :fdrepdlg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :gridctrl.cpp - MacOS - Text - Debug - - - PathRelative - CodeWarrior - :MacOS Support: - :OpenGL:Libraries:OpenGLLibraryStub - MacOS - Library - Debug - - - PathRelative - Project - :html: - :m_style.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :hashmap.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :dirdlgg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :iconbndl.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :artprov.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :artstd.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :imagfill.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :msgout.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :settcmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :popupcmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :printps.cpp - MacOS - Text - Debug - - - PathRelative - Project - :jpeg: - jpegM8.mcp - Unix - Project - - - - PathRelative - Project - :png: - pngM8.mcp - Unix - Project - - - - PathRelative - Project - :zlib: - zlibM8.mcp - Unix - Project - - - - PathRelative - Project - :tiff: - tiffM8.mcp - Unix - Project - - - - FileRelative - ../../lib/jpeg_PPC.lib - Unix - - PathRelative - Project - :jpeg: - jpegM8.mcp - Unix - - Library - Debug, TargetOutputFile - - - FileRelative - ../../lib/png_PPC.lib - Unix - - PathRelative - Project - :png: - pngM8.mcp - Unix - - Library - Debug, TargetOutputFile - - - FileRelative - ../../lib/zlib_PPC.lib - Unix - - PathRelative - Project - :zlib: - zlibM8.mcp - Unix - - Library - Debug, TargetOutputFile - - - FileRelative - ../../lib/tif_PPC.lib - Unix - - PathRelative - Project - :tiff: - tiffM8.mcp - Unix - - Library - Debug, TargetOutputFile - - - PathRelative - Project - :regex: - regexM8.mcp - Unix - Project - - - - FileRelative - ../../lib/regex_PPC.lib - Unix - - PathRelative - Project - :regex: - regexM8.mcp - Unix - - Library - Debug, TargetOutputFile - - - PathRelative - CodeWarrior - :MSL: - MSL_C/MSL_MacOS/Src/console.stubs.c - Unix - Text - Debug - - - PathRelative - Project - :common: - datacmn.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - rgncmn.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - accesscmn.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - dpycmn.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - taskbarcmn.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - fldlgcmn.cpp - Unix - Text - Debug - - - PathRelative - Project - :generic: - :selstore.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - appbase.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - fmapbase.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - stopwatch.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - init.cpp - Unix - Text - Debug - - - PathRelative - Project - :generic: - renderg.cpp - Unix - Text - Debug - - - PathRelative - Project - :mac:classic: - renderer.cpp - Unix - Text - Debug - - - PathRelative - Project - xml - xml.cpp - Unix - Text - Debug - - - PathRelative - Project - expat/lib - xmlparse.c - Unix - Text - Debug - - - PathRelative - Project - expat/lib - xmlrole.c - Unix - Text - Debug - - - PathRelative - Project - expat/lib - xmltok.c - Unix - Text - Debug - - - PathRelative - Project - :common: - rendcmn.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - bookctrl.cpp - Unix - Text - Debug - - - - - FileRelative - ../../lib/regex_PPC.lib - Unix - - PathRelative - Project - :regex: - regexM8.mcp - Unix - - - - FileRelative - ../../lib/tif_PPC.lib - Unix - - PathRelative - Project - :tiff: - tiffM8.mcp - Unix - - - - FileRelative - ../../lib/zlib_PPC.lib - Unix - - PathRelative - Project - :zlib: - zlibM8.mcp - Unix - - - - FileRelative - ../../lib/png_PPC.lib - Unix - - PathRelative - Project - :png: - pngM8.mcp - Unix - - - - FileRelative - ../../lib/jpeg_PPC.lib - Unix - - PathRelative - Project - :jpeg: - jpegM8.mcp - Unix - - - - PathRelative - Project - ::include: - :wx_cw_d.pch - MacOS - - - PathRelative - Project - ::include: - :wx_cw_d.pch++ - MacOS - - - PathRelative - Project - :mac:classic: - :accel.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :app.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :bitmap.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :bmpbuttn.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :brush.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :button.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :checkbox.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :checklst.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :choice.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :clipbrd.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :colordlg.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :colour.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :combobox.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :control.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :cursor.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :data.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :dc.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :dcclient.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :dcmemory.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :dcscreen.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :dialog.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :dirdlg.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :filedlg.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :font.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :fontdlg.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :frame.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :gauge.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :gdiobj.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :icon.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :joystick.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :listbox.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :main.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :mdi.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :menu.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :menuitem.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :minifram.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :msgdlg.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :palette.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :pen.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :printdlg.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :radiobox.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :radiobut.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :region.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :scrolbar.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :settings.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :slider.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :spinbutt.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :statbmp.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :statbox.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :stattext.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :tabctrl.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :textctrl.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :thread.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :timer.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :toolbar.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :utils.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :utilsexc.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :sound.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :window.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :pnghand.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :printmac.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :dcprint.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :uma.cpp - MacOS - - - PathRelative - Project - :common: - :sckipc.cpp - MacOS - - - PathRelative - Project - :common: - :matrix.cpp - MacOS - - - PathRelative - Project - :common: - :tbarbase.cpp - MacOS - - - PathRelative - Project - :common: - :imagjpeg.cpp - MacOS - - - PathRelative - Project - :common: - :longlong.cpp - MacOS - - - PathRelative - Project - :common: - :docmdi.cpp - MacOS - - - PathRelative - Project - :common: - :appcmn.cpp - MacOS - - - PathRelative - Project - :common: - :utilscmn.cpp - MacOS - - - PathRelative - Project - :common: - :dynlib.cpp - MacOS - - - PathRelative - Project - :common: - :extended.c - MacOS - - - PathRelative - Project - :common: - :unzip.c - MacOS - - - PathRelative - Project - :common: - :sckstrm.cpp - MacOS - - - PathRelative - Project - :common: - :zstream.cpp - MacOS - - - PathRelative - Project - :common: - :process.cpp - MacOS - - - PathRelative - Project - :common: - :docview.cpp - MacOS - - - PathRelative - Project - :common: - :sizer.cpp - MacOS - - - PathRelative - Project - :common: - :imagall.cpp - MacOS - - - PathRelative - Project - :common: - :imaggif.cpp - MacOS - - - PathRelative - Project - :common: - :imagpcx.cpp - MacOS - - - PathRelative - Project - :common: - :cmndata.cpp - MacOS - - - PathRelative - Project - :common: - :ftp.cpp - MacOS - - - PathRelative - Project - :common: - :menucmn.cpp - MacOS - - - PathRelative - Project - :common: - :string.cpp - MacOS - - - PathRelative - Project - :common: - :wfstream.cpp - MacOS - - - PathRelative - Project - :common: - :stream.cpp - MacOS - - - PathRelative - Project - :common: - :gdicmn.cpp - MacOS - - - PathRelative - Project - :common: - :protocol.cpp - MacOS - - - PathRelative - Project - :common: - :layout.cpp - MacOS - - - PathRelative - Project - :common: - :valgen.cpp - MacOS - - - PathRelative - Project - :common: - :intl.cpp - MacOS - - - PathRelative - Project - :common: - :list.cpp - MacOS - - - PathRelative - Project - :common: - :socket.cpp - MacOS - - - PathRelative - Project - :common: - :hash.cpp - MacOS - - - PathRelative - Project - :common: - :dlgcmn.cpp - MacOS - - - PathRelative - Project - :common: - :gifdecod.cpp - MacOS - - - PathRelative - Project - :common: - :filefn.cpp - MacOS - - - PathRelative - Project - :common: - :wincmn.cpp - MacOS - - - PathRelative - Project - :common: - :wxchar.cpp - MacOS - - - PathRelative - Project - :common: - :memory.cpp - MacOS - - - PathRelative - Project - :common: - :mstream.cpp - MacOS - - - PathRelative - Project - :common: - :lboxcmn.cpp - MacOS - - - PathRelative - Project - :common: - :fs_inet.cpp - MacOS - - - PathRelative - Project - :common: - :event.cpp - MacOS - - - PathRelative - Project - :common: - :image.cpp - MacOS - - - PathRelative - Project - :common: - :ipcbase.cpp - MacOS - - - PathRelative - Project - :common: - :tokenzr.cpp - MacOS - - - PathRelative - Project - :common: - :txtstrm.cpp - MacOS - - - PathRelative - Project - :common: - :filesys.cpp - MacOS - - - PathRelative - Project - :common: - :url.cpp - MacOS - - - PathRelative - Project - :common: - :fs_zip.cpp - MacOS - - - PathRelative - Project - :common: - :prntbase.cpp - MacOS - - - PathRelative - Project - :common: - :dcbase.cpp - MacOS - - - PathRelative - Project - :common: - :object.cpp - MacOS - - - PathRelative - Project - :common: - :http.cpp - MacOS - - - PathRelative - Project - :common: - :module.cpp - MacOS - - - PathRelative - Project - :common: - :validate.cpp - MacOS - - - PathRelative - Project - :common: - :file.cpp - MacOS - - - PathRelative - Project - :common: - :config.cpp - MacOS - - - PathRelative - Project - :common: - :fileconf.cpp - MacOS - - - PathRelative - Project - :common: - :timercmn.cpp - MacOS - - - PathRelative - Project - :common: - :framecmn.cpp - MacOS - - - PathRelative - Project - :common: - :textfile.cpp - MacOS - - - PathRelative - Project - :common: - :dynarray.cpp - MacOS - - - PathRelative - Project - :common: - :choiccmn.cpp - MacOS - - - PathRelative - Project - :common: - :helpbase.cpp - MacOS - - - PathRelative - Project - :common: - :ctrlsub.cpp - MacOS - - - PathRelative - Project - :common: - :ctrlcmn.cpp - MacOS - - - PathRelative - Project - :common: - :strconv.cpp - MacOS - - - PathRelative - Project - :common: - :sckfile.cpp - MacOS - - - PathRelative - Project - :common: - :valtext.cpp - MacOS - - - PathRelative - Project - :common: - :datstrm.cpp - MacOS - - - PathRelative - Project - :common: - :sckaddr.cpp - MacOS - - - PathRelative - Project - :common: - :variant.cpp - MacOS - - - PathRelative - Project - :common: - :dbtable.cpp - MacOS - - - PathRelative - Project - :common: - :fontcmn.cpp - MacOS - - - PathRelative - Project - :common: - :ffile.cpp - MacOS - - - PathRelative - Project - :common: - :paper.cpp - MacOS - - - PathRelative - Project - :common: - :clipcmn.cpp - MacOS - - - PathRelative - Project - :common: - :imagpnm.cpp - MacOS - - - PathRelative - Project - :common: - :imagpng.cpp - MacOS - - - PathRelative - Project - :common: - :imagbmp.cpp - MacOS - - - PathRelative - Project - :common: - :zipstrm.cpp - MacOS - - - PathRelative - Project - :common: - :log.cpp - MacOS - - - PathRelative - Project - :common: - :textcmn.cpp - MacOS - - - PathRelative - Project - :generic: - :laywin.cpp - MacOS - - - PathRelative - Project - :generic: - :busyinfo.cpp - MacOS - - - PathRelative - Project - :generic: - :listctrl.cpp - MacOS - - - PathRelative - Project - :generic: - :textdlgg.cpp - MacOS - - - PathRelative - Project - :generic: - :tipdlg.cpp - MacOS - - - PathRelative - Project - :generic: - :numdlgg.cpp - MacOS - - - PathRelative - Project - :generic: - :sashwin.cpp - MacOS - - - PathRelative - Project - :generic: - :dcpsg.cpp - MacOS - - - PathRelative - Project - :generic: - :panelg.cpp - MacOS - - - PathRelative - Project - :generic: - :imaglist.cpp - MacOS - - - PathRelative - Project - :generic: - :tabg.cpp - MacOS - - - PathRelative - Project - :generic: - :choicdgg.cpp - MacOS - - - PathRelative - Project - :generic: - :wizard.cpp - MacOS - - - PathRelative - Project - :generic: - :progdlgg.cpp - MacOS - - - PathRelative - Project - :generic: - :caret.cpp - MacOS - - - PathRelative - Project - :generic: - :statusbr.cpp - MacOS - - - PathRelative - Project - :generic: - :logg.cpp - MacOS - - - PathRelative - Project - :generic: - :fontdlgg.cpp - MacOS - - - PathRelative - Project - :generic: - :splitter.cpp - MacOS - - - Name - db.cpp - MacOS - - - Name - dobjcmn.cpp - MacOS - - - PathRelative - Project - :common: - :fontmap.cpp - MacOS - - - PathRelative - Project - :common: - :geometry.cpp - MacOS - - - Name - colrdlgg.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :fontutil.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :dataobj.cpp - MacOS - - - PathRelative - Project - :html: - :m_list.cpp - MacOS - - - PathRelative - Project - :html: - :m_tables.cpp - MacOS - - - PathRelative - Project - :html: - :htmlwin.cpp - MacOS - - - PathRelative - Project - :html: - :m_pre.cpp - MacOS - - - PathRelative - Project - :html: - :m_image.cpp - MacOS - - - PathRelative - Project - :html: - :htmprint.cpp - MacOS - - - PathRelative - Project - :html: - :htmlfilt.cpp - MacOS - - - PathRelative - Project - :html: - :htmlpars.cpp - MacOS - - - PathRelative - Project - :html: - :htmltag.cpp - MacOS - - - PathRelative - Project - :html: - :m_hline.cpp - MacOS - - - PathRelative - Project - :html: - :winpars.cpp - MacOS - - - PathRelative - Project - :html: - :htmlcell.cpp - MacOS - - - PathRelative - Project - :html: - :m_layout.cpp - MacOS - - - PathRelative - Project - :html: - :m_fonts.cpp - MacOS - - - PathRelative - Project - :html: - :m_links.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :fontenum.cpp - MacOS - - - PathRelative - Project - :common: - :datetime.cpp - MacOS - - - PathRelative - Project - :common: - :encconv.cpp - MacOS - - - PathRelative - Project - :common: - :mimecmn.cpp - MacOS - - - Name - metafile.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :gsocket.c - MacOS - - - PathRelative - Project - :mac:classic: - :macnotfy.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :statbrma.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :tooltip.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :statlmac.cpp - MacOS - - - PathRelative - Project - :common: - :imagtiff.cpp - MacOS - - - PathRelative - Project - :generic: - :treectlg.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :notebmac.cpp - MacOS - - - PathRelative - Project - :html: - :m_dflist.cpp - MacOS - - - PathRelative - Project - :common: - :treebase.cpp - MacOS - - - PathRelative - Project - :common: - :cshelp.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :dirmac.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :mimetmac.cpp - MacOS - - - PathRelative - Project - :common: - :filename.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :spinctrl.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :glcanvas.cpp - MacOS - - - PathRelative - Project - :common: - :xpmdecod.cpp - MacOS - - - PathRelative - Project - :common: - :imagxpm.cpp - MacOS - - - PathRelative - Project - :generic: - :dirctrlg.cpp - MacOS - - - PathRelative - Project - :html: - :helpctrl.cpp - MacOS - - - PathRelative - Project - :html: - :helpfrm.cpp - MacOS - - - PathRelative - Project - :html: - :helpdata.cpp - MacOS - - - PathRelative - Project - :generic: - :tipwin.cpp - MacOS - - - PathRelative - Project - :common: - :radiocmn.cpp - MacOS - - - PathRelative - Project - :common: - :nbkbase.cpp - MacOS - - - PathRelative - Project - :generic: - :scrlwing.cpp - MacOS - - - PathRelative - Project - :common: - :gaugecmn.cpp - MacOS - - - PathRelative - Project - :common: - :containr.cpp - MacOS - - - PathRelative - Project - :common: - :quantize.cpp - MacOS - - - PathRelative - Project - :common: - :toplvcmn.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :toplevel.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :morefile:DirectoryCopy.c - MacOS - - - PathRelative - Project - :mac:classic: - :morefile:Search.c - MacOS - - - PathRelative - Project - :mac:classic: - :morefile:MoreFilesExtras.c - MacOS - - - PathRelative - Project - :mac:classic: - :morefile:MoreFiles.c - MacOS - - - PathRelative - Project - :mac:classic: - :morefile:MoreDesktopMgr.c - MacOS - - - PathRelative - Project - :mac:classic: - :morefile:IterateDirectory.c - MacOS - - - PathRelative - Project - :mac:classic: - :morefile:FullPath.c - MacOS - - - PathRelative - Project - :mac:classic: - :morefile:FSpCompat.c - MacOS - - - PathRelative - Project - :mac:classic: - :morefile:FileCopy.c - MacOS - - - PathRelative - Project - :generic: - :gridsel.cpp - MacOS - - - PathRelative - Project - :generic: - :grid.cpp - MacOS - - - PathRelative - Project - :common: - :statbar.cpp - MacOS - - - PathRelative - Project - :common: - :clntdata.cpp - MacOS - - - PathRelative - Project - :common: - :textbuf.cpp - MacOS - - - PathRelative - Project - :generic: - :dragimgg.cpp - MacOS - - - PathRelative - Project - :generic: - :calctrl.cpp - MacOS - - - PathRelative - Project - :common: - :bmpbase.cpp - MacOS - - - PathRelative - Project - :common: - :cmdline.cpp - MacOS - - - PathRelative - Project - :common: - :cmdproc.cpp - MacOS - - - PathRelative - Project - :common: - :dndcmn.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :dnd.cpp - MacOS - - - PathRelative - Project - :common: - :dbgrid.cpp - MacOS - - - PathRelative - Project - :common: - :dircmn.cpp - MacOS - - - PathRelative - Project - :common: - :dseldlg.cpp - MacOS - - - PathRelative - Project - :common: - :dynload.cpp - MacOS - - - PathRelative - Project - :common: - :effects.cpp - MacOS - - - PathRelative - Project - :common: - :fddlgcmn.cpp - MacOS - - - PathRelative - Project - :common: - :fs_mem.cpp - MacOS - - - PathRelative - Project - :common: - :regex.cpp - MacOS - - - PathRelative - Project - :common: - :sysopt.cpp - MacOS - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:PPCLibraries:CursorDevicesGlue.o - MacOS - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:PPCLibraries:OpenTptATalkPPC.o - MacOS - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:PPCLibraries:CarbonAccessors.o - MacOS - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:PPCLibraries:OpenTransportAppPPC.o - MacOS - - - PathRelative - CodeWarrior - :MacOS Support: - :Libraries:Sources:PLStringFuncs:Libs:PLStringFuncsPPC.lib - MacOS - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:PPCLibraries:OpenTptInetPPC.o - MacOS - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:NavigationLib - MacOS - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:ControlsLib - MacOS - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:DialogsLib - MacOS - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:WindowsLib - MacOS - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:MenusLib - MacOS - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:InterfaceLib - MacOS - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:MathLib - MacOS - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:AppearanceLib - MacOS - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:InternetConfigLib - MacOS - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:ThreadsLib - MacOS - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:OpenTransportLib - MacOS - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:OpenTptAppleTalkLib - MacOS - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:OpenTptInternetLib - MacOS - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:UTCUtils - MacOS - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:TextCommon - MacOS - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:Textension - MacOS - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:ATSUnicodeLib - MacOS - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:UnicodeConverter - MacOS - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:TextEncodingConverter - MacOS - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:DragLib - MacOS - - - PathRelative - Project - :common: - :imagiff.cpp - MacOS - - - PathRelative - Project - :html: - :m_style.cpp - MacOS - - - PathRelative - CodeWarrior - :MSL: - MSL_C/MSL_MacOS/Src/console.stubs.c - Unix - - - PathRelative - CodeWarrior - :MacOS Support: - :Libraries:Runtime:Libs:MSL_All_PPC_D.Lib - MacOS - - - PathRelative - Project - :generic: - :fdrepdlg.cpp - MacOS - - - PathRelative - Project - :generic: - :gridctrl.cpp - MacOS - - - PathRelative - CodeWarrior - :MacOS Support: - :OpenGL:Libraries:OpenGLLibraryStub - MacOS - - - PathRelative - Project - :common: - :hashmap.cpp - MacOS - - - PathRelative - Project - :generic: - :dirdlgg.cpp - MacOS - - - PathRelative - Project - :common: - :iconbndl.cpp - MacOS - - - PathRelative - Project - :common: - :artprov.cpp - MacOS - - - PathRelative - Project - :common: - :artstd.cpp - MacOS - - - PathRelative - Project - :common: - :msgout.cpp - MacOS - - - PathRelative - Project - :generic: - :splash.cpp - MacOS - - - PathRelative - Project - :common: - :settcmn.cpp - MacOS - - - PathRelative - Project - :common: - :popupcmn.cpp - MacOS - - - PathRelative - Project - :generic: - :printps.cpp - MacOS - - - PathRelative - Project - :common: - :imagfill.cpp - MacOS - - - PathRelative - Project - :common: - datacmn.cpp - Unix - - - PathRelative - Project - :common: - rgncmn.cpp - Unix - - - PathRelative - Project - :common: - accesscmn.cpp - Unix - - - PathRelative - Project - :common: - dpycmn.cpp - Unix - - - PathRelative - Project - :common: - taskbarcmn.cpp - Unix - - - PathRelative - Project - :common: - fldlgcmn.cpp - Unix - - - PathRelative - Project - :generic: - :selstore.cpp - MacOS - - - PathRelative - Project - :common: - appbase.cpp - Unix - - - PathRelative - Project - :common: - fmapbase.cpp - Unix - - - PathRelative - Project - :common: - stopwatch.cpp - Unix - - - PathRelative - Project - :common: - init.cpp - Unix - - - PathRelative - Project - :generic: - renderg.cpp - Unix - - - PathRelative - Project - :mac:classic: - renderer.cpp - Unix - - - PathRelative - Project - xml - xml.cpp - Unix - - - PathRelative - Project - expat/lib - xmlparse.c - Unix - - - PathRelative - Project - expat/lib - xmlrole.c - Unix - - - PathRelative - Project - expat/lib - xmltok.c - Unix - - - PathRelative - Project - :common: - rendcmn.cpp - Unix - - - PathRelative - Project - :common: - bookctrl.cpp - Unix - - - - - - PathRelative - Project - :jpeg: - jpegM8.mcp - Unix - - - - PPC - LinkAgainst - - FileRelative - ../../lib/jpeg_PPC.lib - Unix - - PathRelative - Project - :jpeg: - jpegM8.mcp - Unix - - - - - - - - PathRelative - Project - :png: - pngM8.mcp - Unix - - - - PPC - LinkAgainst - - FileRelative - ../../lib/png_PPC.lib - Unix - - PathRelative - Project - :png: - pngM8.mcp - Unix - - - - - - - - PathRelative - Project - :zlib: - zlibM8.mcp - Unix - - - - PPC - LinkAgainst - - FileRelative - ../../lib/zlib_PPC.lib - Unix - - PathRelative - Project - :zlib: - zlibM8.mcp - Unix - - - - - - - - PathRelative - Project - :tiff: - tiffM8.mcp - Unix - - - - PPC - LinkAgainst - - FileRelative - ../../lib/tif_PPC.lib - Unix - - PathRelative - Project - :tiff: - tiffM8.mcp - Unix - - - - - - - - PathRelative - Project - :regex: - regexM8.mcp - Unix - - - - PPC - LinkAgainst - - FileRelative - ../../lib/regex_PPC.lib - Unix - - PathRelative - Project - :regex: - regexM8.mcp - Unix - - - - - - - - - wxlib PPC release - - - - UserSourceTrees - - - AlwaysSearchUserPathstrue - InterpretDOSAndUnixPathstrue - RequireFrameworkStyleIncludesfalse - UserSearchPaths - - SearchPath - Path::include: - PathFormatMacOS - PathRootProject - - Recursivefalse - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path::art: - PathFormatMacOS - PathRootProject - - Recursivefalse - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:generic: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:mac:classic: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:regex: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:common: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:zlib: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:png: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:jpeg: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:iodbc: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:html: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:tiff: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Pathxml - PathFormatUnix - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Pathexpat/lib - PathFormatUnix - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SystemSearchPaths - - SearchPath - Path:MSL: - PathFormatMacOS - PathRootCodeWarrior - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:MacOS Support: - PathFormatMacOS - PathRootCodeWarrior - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - - - MWRuntimeSettings_WorkingDirectory - MWRuntimeSettings_CommandLine - MWRuntimeSettings_HostApplication - Path - PathFormatGeneric - PathRootAbsolute - - MWRuntimeSettings_EnvVars - - - LinkerMacOS PPC Linker - PreLinker - PostLinker - Targetnamewxlib PPC release - OutputDirectory - Path::lib: - PathFormatMacOS - PathRootProject - - SaveEntriesUsingRelativePathstrue - - - FileMappings - - FileTypeAPPL - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypeAppl - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypeMMLB - FileExtension - CompilerLib Import PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeMPLF - FileExtension - CompilerLib Import PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeMWCD - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypeRSRC - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.bh - CompilerBalloon Help - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.c - CompilerMW C/C++ PPC - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.c++ - CompilerMW C/C++ PPC - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.cc - CompilerMW C/C++ PPC - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.cp - CompilerMW C/C++ PPC - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.cpp - CompilerMW C/C++ PPC - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.exp - Compiler - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.h - CompilerMW C/C++ PPC - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMaketrue - - - FileTypeTEXT - FileExtension.p - CompilerMW Pascal PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.pas - CompilerMW Pascal PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.pch - CompilerMW C/C++ PPC - EditLanguageC/C++ - Precompiletrue - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.pch++ - CompilerMW C/C++ PPC - EditLanguageC/C++ - Precompiletrue - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.ppu - CompilerMW Pascal PPC - EditLanguage - Precompiletrue - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.r - CompilerRez - EditLanguageRez - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.s - CompilerPPCAsm - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeXCOF - FileExtension - CompilerXCOFF Import PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypedocu - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypersrc - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypeshlb - FileExtension - CompilerPEF Import PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypestub - FileExtension - CompilerPEF Import PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileExtension.doc - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFilefalse - IgnoredByMaketrue - - - FileExtension.o - CompilerXCOFF Import PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileExtension.ppob - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileExtension.rsrc - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - - - CacheModDatestrue - DumpBrowserInfofalse - CacheSubprojectstrue - UseThirdPartyDebuggerfalse - BrowserGenerator1 - DebuggerAppPath - Path - PathFormatGeneric - PathRootAbsolute - - DebuggerCmdLineArgs - DebuggerWorkingDir - Path - PathFormatGeneric - PathRootAbsolute - - CodeCompletionPrefixFileNameMacHeaders.c - CodeCompletionMacroFileNameMacOS_Carbon_C++_Macros.h - - - ConsoleEncoding0 - LogSystemMessagestrue - AutoTargetDLLsfalse - StopAtWatchpointstrue - PauseWhileRunningfalse - PauseInterval5 - PauseUIFlags0 - AltExePath - Path - PathFormatGeneric - PathRootAbsolute - - StopAtTempBPOnLaunchtrue - CacheSymbolicstrue - TempBPFunctionNamemain - TempBPType0 - - - Enabledfalse - ConnectionName - DownloadPath - LaunchRemoteAppfalse - RemoteAppPath - CoreID0 - JTAGClockSpeed8000 - IsMultiCorefalse - OSDownloadfalse - UseGlobalOSDownloadfalse - OSDownloadConnectionName - OSDownloadPath - AltDownloadfalse - AltDownloadConnectionName - - - OtherExecutables - - - CustomColor1 - Red0 - Green32767 - Blue0 - - CustomColor2 - Red0 - Green32767 - Blue0 - - CustomColor3 - Red0 - Green32767 - Blue0 - - CustomColor4 - Red0 - Green32767 - Blue0 - - - - MWFrontEnd_C_cplusplus0 - MWFrontEnd_C_checkprotos0 - MWFrontEnd_C_arm0 - MWFrontEnd_C_trigraphs0 - MWFrontEnd_C_onlystdkeywords0 - MWFrontEnd_C_enumsalwaysint0 - MWFrontEnd_C_mpwpointerstyle1 - MWFrontEnd_C_prefixnamewx/wx_cw.h - MWFrontEnd_C_ansistrict0 - MWFrontEnd_C_mpwcnewline0 - MWFrontEnd_C_wchar_type1 - MWFrontEnd_C_enableexceptions1 - MWFrontEnd_C_dontreusestrings0 - MWFrontEnd_C_poolstrings0 - MWFrontEnd_C_dontinline0 - MWFrontEnd_C_useRTTI1 - MWFrontEnd_C_multibyteaware0 - MWFrontEnd_C_unsignedchars0 - MWFrontEnd_C_autoinline0 - MWFrontEnd_C_booltruefalse1 - MWFrontEnd_C_inlinelevel0 - MWFrontEnd_C_ecplusplus0 - MWFrontEnd_C_objective_c0 - MWFrontEnd_C_defer_codegen0 - MWFrontEnd_C_templateparser0 - MWFrontEnd_C_c990 - MWFrontEnd_C_bottomupinline1 - - - MWWarning_C_warn_illpragma0 - MWWarning_C_warn_emptydecl0 - MWWarning_C_warn_possunwant0 - MWWarning_C_warn_unusedvar0 - MWWarning_C_warn_unusedarg0 - MWWarning_C_warn_extracomma0 - MWWarning_C_pedantic0 - MWWarning_C_warningerrors0 - MWWarning_C_warn_hidevirtual0 - MWWarning_C_warn_implicitconv0 - MWWarning_C_warn_notinlined0 - MWWarning_C_warn_structclass0 - - - MWFTP_Post_hostName - MWFTP_Post_username - MWFTP_Post_password0ÿÄ@ž–@)t - MWFTP_Post_remoteDir - MWFTP_Post_ftp_PathVersion1 - MWFTP_Post_ftp_PathType0 - MWFTP_Post_ftp_PathFormat0 - MWFTP_Post_ftp_tree - MWFTP_Post_uploadDir - MWFTP_Post_ftp_port21 - MWFTP_Post_SendBin1 - MWFTP_Post_ShouldLog1 - - - MWCommandLine_Java_clsName - MWCommandLine_Java_args - - - MWVJavaDebugging_Protocol1 - MWVJavaDebugging_JDKVersion1 - MWVJavaDebugging_TimeOut10 - MWVJavaDebugging_SupportSlowDevicesfalse - MWVJavaDebugging_UseRemoteLaunchAgentfalse - MWVJavaDebugging_LaunchVMasServerfalse - - - MWJava_Language_optimizefalse - MWJava_Language_warnDeprecatedfalse - MWJava_Language_emitMapfalse - MWJava_Language_strictFileNamesfalse - MWJava_Language_strictFileHierarchyfalse - MWJava_Language_1_1_Compatiblefalse - MWJava_Language_emitHeaders0 - MWJava_Language_headerTypeJNINativeHeaders - MWJava_Language_packageFilter - MWJava_Language_genCommentstrue - MWJava_Language_genHeadersfalse - MWJava_Language_enableAssertsfalse - MWJava_Language_targetVM1.1 - - - Manifest-JAD Attributes - - AttributeMain-Class - ValueAuto-Generated - - - - - MWJava_MRJAppBuilder_outFileMRJApplication - MWJava_MRJAppBuilder_mergefalse - MWJava_MRJAppBuilder_quitMenutrue - MWJava_MRJAppBuilder_growfalse - MWJava_MRJAppBuilder_stdoutTypeConsole - MWJava_MRJAppBuilder_stderrTypeConsole - MWJava_MRJAppBuilder_stdinTypeConsole - MWJava_MRJAppBuilder_appIconPVersion0 - MWJava_MRJAppBuilder_appIconPType0 - MWJava_MRJAppBuilder_appIconPFormat0 - MWJava_MRJAppBuilder_appIconPTree - MWJava_MRJAppBuilder_appIconFile - MWJava_MRJAppBuilder_splashScreenPVersion0 - MWJava_MRJAppBuilder_splashScreenPType0 - MWJava_MRJAppBuilder_splashScreenPFormat0 - MWJava_MRJAppBuilder_splashScreenPTree - MWJava_MRJAppBuilder_splashScreenPICTFile - MWJava_MRJAppBuilder_aboutName - MWJava_MRJAppBuilder_stdoutPVersion0 - MWJava_MRJAppBuilder_stdoutPType0 - MWJava_MRJAppBuilder_stdoutPFormat0 - MWJava_MRJAppBuilder_stdoutPTree - MWJava_MRJAppBuilder_stdoutFile - MWJava_MRJAppBuilder_stdoutAppendfalse - MWJava_MRJAppBuilder_stderrPType0 - MWJava_MRJAppBuilder_stderrPFormat0 - MWJava_MRJAppBuilder_stderrPTree - MWJava_MRJAppBuilder_stderrFile - MWJava_MRJAppBuilder_stderrAppendfalse - MWJava_MRJAppBuilder_stdinPType0 - MWJava_MRJAppBuilder_stdinPFormat0 - MWJava_MRJAppBuilder_stdinPTree - MWJava_MRJAppBuilder_stdinFile - - - MWJava_Output_outputtypeJarFile - MWJava_Output_outfileJavaClasses.jar - MWJava_Output_ftype1514754080 - MWJava_Output_fcreator1297570384 - MWJava_Output_compress0 - MWJava_Output_genManifest0 - MWJava_Output_trunctypeFront - MWJava_Output_deleteClasses0 - MWJava_Output_consoleApp1 - MWJava_Output_preverify0 - MWJava_Output_genJad0 - MWJava_Output_obfuscate0 - - - MWJava_Proj_projtypeApplet - MWJava_Proj_mainClassName - MWJava_Proj_HTMLAppCreator1145457748 - MWJava_Proj_HTMLAppNameMetrowerks Java - MWJava_Proj_PathVersion1 - MWJava_Proj_PathType0 - MWJava_Proj_PathFormat0 - MWJava_Proj_tree - MWJava_Proj_HTMLAppWin32NameInternet Explorer - MWJava_Proj_compress0 - MWJava_Proj_simulator0 - MWJava_Proj_useVM\000\000macosx - MWJava_Proj_vmarguments - MWJava_Proj_vmName - MWJava_Proj_simPropFile - - - MWJavaDoc_Proj_Version1 - MWJavaDoc_Proj_Deprecated1 - MWJavaDoc_Proj_Author1 - MWJavaDoc_Proj_Index1 - MWJavaDoc_Proj_Tree1 - MWJavaDoc_Proj_SunResolveToSame0 - MWJavaDoc_Proj_Shortnames1 - MWJavaDoc_Proj_Folder0 - MWJavaDoc_Proj_GenerateAPILinks0 - MWJavaDoc_Proj_scopePublic - MWJavaDoc_Proj_fcreator1297303877 - MWJavaDoc_Proj_encodingName - MWJavaDoc_Proj_decodingName - MWJavaDoc_Proj_javaPackagePathhttp://java.sun.com/products/jdk/1.1/docs/api/ - - - MWMerge_MacOS_projectTypeApplication - MWMerge_MacOS_outputNameMerge Out - MWMerge_MacOS_outputCreator???? - MWMerge_MacOS_outputTypeAPPL - MWMerge_MacOS_suppressWarning0 - MWMerge_MacOS_copyFragments1 - MWMerge_MacOS_copyResources1 - MWMerge_MacOS_flattenResource0 - MWMerge_MacOS_flatFileNamea.rsrc - MWMerge_MacOS_flatFileOutputPath - Path: - PathFormatMacOS - PathRootProject - - MWMerge_MacOS_skipResources - DLGX - ckid - Proj - WSPC - - - - FileLockedfalse - ResourcesMapIsReadOnlyfalse - PrinterDriverIsMultiFinderCompatiblefalse - Invisiblefalse - HasBundlefalse - NameLockedfalse - Stationeryfalse - HasCustomIconfalse - Sharedfalse - HasBeenInitedfalse - Label0 - Comments - - - MWMacOSPackager_UsePackager0 - MWMacOSPackager_FolderToPackage - Path - PathFormatMacOS - PathRootAbsolute - - MWMacOSPackager_CreateClassicAlias0 - MWMacOSPackager_ClassicAliasMethodUseTargetOutput - MWMacOSPackager_ClassicAliasPath - Path - PathFormatMacOS - PathRootAbsolute - - MWMacOSPackager_CreatePkgInfo0 - MWMacOSPackager_PkgCreatorType???? - MWMacOSPackager_PkgFileTypeAPPL - - - MWCodeGen_PPC_structalignmentPPC_mw - MWCodeGen_PPC_tracebacktablesInline - MWCodeGen_PPC_processorGeneric - MWCodeGen_PPC_function_align4 - MWCodeGen_PPC_tocdata1 - MWCodeGen_PPC_largetoc0 - MWCodeGen_PPC_profiler0 - MWCodeGen_PPC_vectortocdata0 - MWCodeGen_PPC_poolconst0 - MWCodeGen_PPC_peephole1 - MWCodeGen_PPC_readonlystrings0 - MWCodeGen_PPC_linkerpoolsstrings0 - MWCodeGen_PPC_volatileasm0 - MWCodeGen_PPC_schedule0 - MWCodeGen_PPC_altivec0 - MWCodeGen_PPC_altivec_move_block0 - MWCodeGen_PPC_strictIEEEfp0 - MWCodeGen_PPC_fpcontract1 - MWCodeGen_PPC_genfsel0 - MWCodeGen_PPC_orderedfpcmp0 - - - MWCodeGen_MachO_structalignmentPPC_mw - MWCodeGen_MachO_profiler_enumOff - MWCodeGen_MachO_processorGeneric - MWCodeGen_MachO_function_align4 - MWCodeGen_MachO_common0 - MWCodeGen_MachO_peephole1 - MWCodeGen_MachO_readonlystrings0 - MWCodeGen_MachO_linkerpoolsstrings1 - MWCodeGen_MachO_volatileasm0 - MWCodeGen_MachO_schedule0 - MWCodeGen_MachO_altivec0 - MWCodeGen_MachO_vecmove0 - MWCodeGen_MachO_fp_ieee_strict0 - MWCodeGen_MachO_fpcontract1 - MWCodeGen_MachO_genfsel0 - MWCodeGen_MachO_fp_cmps_ordered0 - - - MWDisassembler_PPC_showcode1 - MWDisassembler_PPC_extended1 - MWDisassembler_PPC_mix0 - MWDisassembler_PPC_nohex0 - MWDisassembler_PPC_showdata1 - MWDisassembler_PPC_showexceptions1 - MWDisassembler_PPC_showsym0 - MWDisassembler_PPC_shownames1 - - - GlobalOptimizer_PPC_optimizationlevelLevel2 - GlobalOptimizer_PPC_optforSpeed - - - MWLinker_PPC_linksym1 - MWLinker_PPC_symfullpath1 - MWLinker_PPC_linkmap0 - MWLinker_PPC_nolinkwarnings0 - MWLinker_PPC_dontdeadstripinitcode1 - MWLinker_PPC_permitmultdefs0 - MWLinker_PPC_linkmodeFast - MWLinker_PPC_initname - MWLinker_PPC_mainname__start - MWLinker_PPC_termname - - - MWLinker_MacOSX_linksym0 - MWLinker_MacOSX_symfullpath0 - MWLinker_MacOSX_nolinkwarnings0 - MWLinker_MacOSX_linkmap0 - MWLinker_MacOSX_dontdeadstripinitcode0 - MWLinker_MacOSX_permitmultdefs1 - MWLinker_MacOSX_use_objectivec_semantics0 - MWLinker_MacOSX_strip_debug_symbols0 - MWLinker_MacOSX_split_segs0 - MWLinker_MacOSX_report_msl_overloads0 - MWLinker_MacOSX_objects_follow_linkorder0 - MWLinker_MacOSX_linkmodeFast - MWLinker_MacOSX_exportsReferencedGlobals - MWLinker_MacOSX_sortcodeNone - MWLinker_MacOSX_mainnamestart - - - MWProject_MacOSX_typeLibrary - MWProject_MacOSX_outfilewx_PPC.lib - MWProject_MacOSX_filecreator???? - MWProject_MacOSX_filetype???? - MWProject_MacOSX_vmaddress0 - MWProject_MacOSX_usedefaultvmaddr1 - MWProject_MacOSX_flatrsrc0 - MWProject_MacOSX_flatrsrcfilename - MWProject_MacOSX_flatrsrcoutputdir - Path: - PathFormatMacOS - PathRootProject - - MWProject_MacOSX_installpath./ - MWProject_MacOSX_dont_prebind0 - MWProject_MacOSX_flat_namespace0 - MWProject_MacOSX_frameworkversionA - MWProject_MacOSX_currentversion0 - MWProject_MacOSX_flat_oldimpversion0 - - - MWLinker_MachO_exportsNone - MWLinker_MachO_mainnamestart - MWLinker_MachO_currentversion0 - MWLinker_MachO_compatibleversion0 - MWLinker_MachO_symfullpath0 - MWLinker_MachO_supresswarnings0 - MWLinker_MachO_multisymerror0 - MWLinker_MachO_prebind1 - MWLinker_MachO_deadstrip1 - MWLinker_MachO_objectivecsemantics0 - MWLinker_MachO_whichfileloaded0 - MWLinker_MachO_whyfileloaded0 - MWLinker_MachO_readonlyrelocsErrors - MWLinker_MachO_undefinedsymbolsErrors - MWLinker_MachO_twolevelnamespace1 - MWLinker_MachO_stripdebugsymbols0 - - - MWProject_MachO_typeExecutable - MWProject_MachO_outfilea.exe - MWProject_MachO_filecreator???? - MWProject_MachO_filetypeMEXE - MWProject_MachO_vmaddress4096 - MWProject_MachO_flatrsrc1 - MWProject_MachO_flatrsrcfilenamea.rsrc - MWProject_MachO_flatrsrcoutputdir - Path: - PathFormatMacOS - PathRootProject - - MWProject_MachO_installpath./ - MWProject_MachO_frameworkversion - - - MWPEF_exportsAll - MWPEF_libfolder0 - MWPEF_sortcodeNone - MWPEF_expandbss0 - MWPEF_sharedata0 - MWPEF_olddefversion0 - MWPEF_oldimpversion0 - MWPEF_currentversion0 - MWPEF_fragmentnamewxwin - MWPEF_collapsereloads0 - - - MWProject_PPC_typeLibrary - MWProject_PPC_outfilewx_PPC.lib - MWProject_PPC_filecreator???? - MWProject_PPC_filetype???? - MWProject_PPC_size0 - MWProject_PPC_minsize0 - MWProject_PPC_stacksize0 - MWProject_PPC_flags0 - MWProject_PPC_symfilename - MWProject_PPC_rsrcname - MWProject_PPC_rsrcheaderNative - MWProject_PPC_rsrctype???? - MWProject_PPC_rsrcid0 - MWProject_PPC_rsrcflags0 - MWProject_PPC_rsrcstore0 - MWProject_PPC_rsrcmerge0 - MWProject_PPC_flatrsrc0 - MWProject_PPC_flatrsrcoutputdir - Path: - PathFormatMacOS - PathRootProject - - MWProject_PPC_flatrsrcfilename - - - MWAssembler_PPC_auxheader0 - MWAssembler_PPC_symmodeMac - MWAssembler_PPC_dialectPPC - MWAssembler_PPC_prefixfile - MWAssembler_PPC_typecheck0 - MWAssembler_PPC_warnings0 - MWAssembler_PPC_casesensitive0 - - - PList_OutputTypeFile - PList_OutputEncodingUTF-8 - PList_Prefix - PList_FileFilenameInfo.plist - PList_FileDirectory - Path: - PathFormatMacOS - PathRootProject - - PList_ResourceTypeplst - PList_ResourceID0 - PList_ResourceName - - - MWRez_Language_maxwidth80 - MWRez_Language_scriptRoman - MWRez_Language_alignmentAlign1 - MWRez_Language_filtermodeFilterSkip - MWRez_Language_suppresswarnings0 - MWRez_Language_escapecontrolchars1 - MWRez_Language_prefixname - MWRez_Language_filteredtypes'CODE' 'DATA' 'PICT' - - - MWWinRC_prefixname - - - MWCodeGen_X86_processorGeneric - MWCodeGen_X86_alignmentbytes8 - MWCodeGen_X86_exceptionsZeroOverhead - MWCodeGen_X86_name_manglingMWWin32 - MWCodeGen_X86_use_extinst0 - MWCodeGen_X86_extinst_mmx0 - MWCodeGen_X86_extinst_3dnow0 - MWCodeGen_X86_use_mmx_3dnow_convention0 - MWCodeGen_X86_extinst_cmov0 - MWCodeGen_X86_extinst_sse0 - MWCodeGen_X86_extinst_sse20 - MWCodeGen_X86_intrinsics0 - MWCodeGen_X86_optimizeasm0 - MWCodeGen_X86_disableopts0 - MWCodeGen_X86_profile0 - MWLinker_X86_runtimeCustom - MWCodeGen_X86_readonlystrings0 - - - MWLinker_X86_subsysmajorid4 - MWLinker_X86_subsysminorid0 - MWCOFF_X86_opsysmajorid4 - MWCOFF_X86_opsysminorid0 - MWLinker_X86_usrmajorid0 - MWLinker_X86_usrminorid0 - MWProject_X86_maxstacksize1024 - MWProject_X86_minstacksize4 - MWProject_X86_size1024 - MWProject_X86_minsize4 - MWCOFF_X86_coff_flags0 - MWCOFF_X86_dll_flags0 - MWProject_X86_baseaddress4194304 - MWCOFF_X86_filealign512 - MWCOFF_X86_sectionalign4096 - - - PDisasmX86_showHeaderstrue - PDisasmX86_showSectHeaderstrue - PDisasmX86_showSymTabtrue - PDisasmX86_showCodetrue - PDisasmX86_showDatatrue - PDisasmX86_showDebugfalse - PDisasmX86_showExceptionsfalse - PDisasmX86_showRawfalse - PDisasmX86_showAllRawfalse - PDisasmX86_showSourcefalse - PDisasmX86_showRelocationtrue - PDisasmX86_showHextrue - PDisasmX86_showCommentsfalse - PDisasmX86_showSymDefstrue - PDisasmX86_unmangletrue - PDisasmX86_verbosetrue - PDisasmX86_resolveRelocstrue - PDisasmX86_resolveLocalsfalse - - - MWDebugger_X86_Exceptions - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - - - - GlobalOptimizer_X86_optimizationlevelLevel0 - GlobalOptimizer_X86_optforSpeed - - - MWLinker_X86_entrypointusageDefault - MWLinker_X86_entrypoint - MWLinker_X86_subsystemWinGUI - MWLinker_X86_commandfile - MWLinker_X86_generatemap0 - MWLinker_X86_linksym1 - MWLinker_X86_linkCV1 - MWLinker_X86_symfullpathfalse - MWLinker_X86_linkdebugtrue - MWLinker_X86_checksumfalse - MWLinker_X86_zero_init_bssfalse - MWLinker_X86_mergedatafalse - MWLinker_X86_usedefaultlibsfalse - MWLinker_X86_adddefaultlibsfalse - MWLinker_X86_nowarningsfalse - MWLinker_X86_verbosefalse - - - MWProject_X86_typeLibrary - MWProject_X86_outfilewx_x86_d.lib - MWProject_X86_importlib - MWProject_X86_setimportlibdirfalse - MWProject_X86_dontgenerateimportlibfalse - MWProject_X86_oldformatlibfalse - MWProject_X86_replaceobjextensionfalse - MWProject_X86_copyallfilesfalse - - - - PathRelative - Project - :mac:classic: - :accel.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :app.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :bitmap.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :bmpbuttn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :brush.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :button.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :checkbox.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :checklst.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :choice.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :clipbrd.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :colordlg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :colour.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :combobox.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :control.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :cursor.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :data.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :dc.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :dcclient.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :dcmemory.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :dcscreen.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :dialog.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :dirdlg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :filedlg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :font.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :fontdlg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :frame.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :gauge.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :gdiobj.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :icon.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :joystick.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :listbox.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :main.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :mdi.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :menu.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :menuitem.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :minifram.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :msgdlg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :palette.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :pen.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :printdlg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :radiobox.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :radiobut.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :region.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :scrolbar.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :settings.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :slider.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :spinbutt.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :statbmp.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :statbox.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :stattext.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :tabctrl.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :textctrl.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :thread.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :timer.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :toolbar.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :utils.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :utilsexc.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :sound.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :window.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :pnghand.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :printmac.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :dcprint.cpp - MacOS - Text - - - - PathRelative - Project - :mac:classic: - :uma.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :sckipc.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :matrix.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :tbarbase.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :imagjpeg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :longlong.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :docmdi.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :appcmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :utilscmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :dynlib.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :extended.c - MacOS - Text - Debug - - - PathRelative - Project - :common: - :unzip.c - MacOS - Text - Debug - - - PathRelative - Project - :common: - :sckstrm.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :zstream.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :process.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :docview.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :sizer.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :dobjcmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :imagall.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :imaggif.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :imagpcx.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :cmndata.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :ftp.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :menucmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :string.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :wfstream.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :stream.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :gdicmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :protocol.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :layout.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :valgen.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :intl.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :list.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :socket.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :hash.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :dlgcmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :gifdecod.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :filefn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :wincmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :wxchar.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :memory.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :mstream.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :lboxcmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :fs_inet.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :event.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :image.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :ipcbase.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :tokenzr.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :txtstrm.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :filesys.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :url.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :fs_zip.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :prntbase.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :dcbase.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :object.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :http.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :module.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :validate.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :file.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :config.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :fileconf.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :timercmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :framecmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :textfile.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :dynarray.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :choiccmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :helpbase.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :db.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :ctrlsub.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :ctrlcmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :strconv.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :sckfile.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :valtext.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :datstrm.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :sckaddr.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :variant.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :dbtable.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :fontcmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :ffile.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :paper.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :clipcmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :imagpnm.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :imagpng.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :imagbmp.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :zipstrm.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :log.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :textcmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :laywin.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :busyinfo.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :listctrl.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :textdlgg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :numdlgg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :sashwin.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :dcpsg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :panelg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :imaglist.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :tabg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :choicdgg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :wizard.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :progdlgg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :caret.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :statusbr.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :logg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :fontdlgg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :splitter.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :fontmap.cpp - MacOS - Text - Debug - - - Name - tipdlg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :geometry.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :fontutil.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :dataobj.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :m_list.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :m_tables.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :htmlwin.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :m_pre.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :m_image.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :htmprint.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :htmlfilt.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :htmlpars.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :htmltag.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :m_hline.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :winpars.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :htmlcell.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :m_layout.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :m_fonts.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :m_links.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :fontenum.cpp - MacOS - Text - Debug - - - Name - colrdlgg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :datetime.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :encconv.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :mimecmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :gsocket.c - MacOS - Text - Debug - - - Name - metafile.cpp - MacOS - Text - Debug - - - Name - wx_cw.pch - MacOS - Text - Debug - - - Name - wx_cw.pch++ - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :macnotfy.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :statbrma.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :tooltip.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :statlmac.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :imagtiff.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :treectlg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :notebmac.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :m_dflist.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :treebase.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :cshelp.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :dirmac.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :mimetmac.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :filename.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :spinctrl.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :glcanvas.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :xpmdecod.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :imagxpm.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :dirctrlg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :helpctrl.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :helpfrm.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :helpdata.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :tipwin.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :radiocmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :nbkbase.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :scrlwing.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :gaugecmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :containr.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :quantize.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :toplvcmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :toplevel.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :morefile:DirectoryCopy.c - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :morefile:Search.c - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :morefile:MoreFilesExtras.c - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :morefile:MoreFiles.c - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :morefile:MoreDesktopMgr.c - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :morefile:IterateDirectory.c - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :morefile:FullPath.c - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :morefile:FSpCompat.c - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :morefile:FileCopy.c - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :gridsel.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :grid.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :statbar.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :clntdata.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :textbuf.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :dragimgg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :calctrl.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :bmpbase.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :cmdline.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :cmdproc.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :dndcmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :dnd.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :dbgrid.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :dircmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :dseldlg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :dynload.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :effects.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :fddlgcmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :fs_mem.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :regex.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :sysopt.cpp - MacOS - Text - Debug - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:PPCLibraries:CursorDevicesGlue.o - MacOS - Library - Debug - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:PPCLibraries:OpenTptATalkPPC.o - MacOS - Library - Debug - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:PPCLibraries:CarbonAccessors.o - MacOS - Library - Debug - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:PPCLibraries:OpenTransportAppPPC.o - MacOS - Library - Debug - - - PathRelative - CodeWarrior - :MacOS Support: - :Libraries:Sources:PLStringFuncs:Libs:PLStringFuncsPPC.lib - MacOS - Library - Debug - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:PPCLibraries:OpenTptInetPPC.o - MacOS - Library - Debug - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:NavigationLib - MacOS - Library - Debug - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:ControlsLib - MacOS - Library - Debug - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:DialogsLib - MacOS - Library - Debug - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:WindowsLib - MacOS - Library - Debug - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:MenusLib - MacOS - Library - Debug - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:InterfaceLib - MacOS - Library - Debug - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:MathLib - MacOS - Library - Debug - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:AppearanceLib - MacOS - Library - Debug - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:InternetConfigLib - MacOS - Library - Debug - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:ThreadsLib - MacOS - Library - Debug - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:OpenTransportLib - MacOS - Library - Debug - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:OpenTptAppleTalkLib - MacOS - Library - Debug - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:OpenTptInternetLib - MacOS - Library - Debug - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:UTCUtils - MacOS - Library - Debug - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:TextCommon - MacOS - Library - Debug - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:Textension - MacOS - Library - Debug, WeakImport - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:ATSUnicodeLib - MacOS - Library - Debug - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:UnicodeConverter - MacOS - Library - Debug - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:TextEncodingConverter - MacOS - Library - Debug - - - PathRelative - CodeWarrior - :MacOS Support: - :Libraries:Runtime:Libs:MSL_All_PPC.Lib - MacOS - Library - Debug - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:DragLib - MacOS - Library - Debug - - - PathRelative - CodeWarrior - :MacOS Support: - :OpenGL:Libraries:OpenGLLibraryStub - MacOS - Library - Debug - - - PathRelative - Project - :common: - :imagiff.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :splash.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :fdrepdlg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :gridctrl.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :m_style.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :hashmap.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :dirdlgg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :iconbndl.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :artprov.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :artstd.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :imagfill.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :msgout.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :settcmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :popupcmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :printps.cpp - MacOS - Text - Debug - - - PathRelative - Project - :jpeg: - jpegM8.mcp - Unix - Project - - - - PathRelative - Project - :png: - pngM8.mcp - Unix - Project - - - - PathRelative - Project - :zlib: - zlibM8.mcp - Unix - Project - - - - PathRelative - Project - :tiff: - tiffM8.mcp - Unix - Project - - - - FileRelative - ../../lib/jpeg_PPC.lib - Unix - - PathRelative - Project - :jpeg: - jpegM8.mcp - Unix - - Library - Debug, TargetOutputFile - - - FileRelative - ../../lib/zlib_PPC.lib - Unix - - PathRelative - Project - :zlib: - zlibM8.mcp - Unix - - Library - Debug, TargetOutputFile - - - FileRelative - ../../lib/tif_PPC.lib - Unix - - PathRelative - Project - :tiff: - tiffM8.mcp - Unix - - Library - Debug, TargetOutputFile - - - PathRelative - Project - :regex: - regexM8.mcp - Unix - Project - - - - FileRelative - ../../lib/regex_PPC.lib - Unix - - PathRelative - Project - :regex: - regexM8.mcp - Unix - - Library - Debug, TargetOutputFile - - - FileRelative - ../../lib/png_PPC.lib - Unix - - PathRelative - Project - :png: - pngM8.mcp - Unix - - Library - Debug, TargetOutputFile - - - PathRelative - CodeWarrior - :MSL: - MSL_C/MSL_MacOS/Src/console.stubs.c - Unix - Text - Debug - - - PathRelative - Project - :common: - datacmn.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - rgncmn.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - accesscmn.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - dpycmn.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - taskbarcmn.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - fldlgcmn.cpp - Unix - Text - Debug - - - PathRelative - Project - :generic: - :selstore.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - appbase.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - fmapbase.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - stopwatch.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - init.cpp - Unix - Text - Debug - - - PathRelative - Project - :generic: - renderg.cpp - Unix - Text - Debug - - - PathRelative - Project - :mac:classic: - renderer.cpp - Unix - Text - Debug - - - PathRelative - Project - xml - xml.cpp - Unix - Text - Debug - - - PathRelative - Project - expat/lib - xmlparse.c - Unix - Text - Debug - - - PathRelative - Project - expat/lib - xmlrole.c - Unix - Text - Debug - - - PathRelative - Project - expat/lib - xmltok.c - Unix - Text - Debug - - - PathRelative - Project - :common: - rendcmn.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - bookctrl.cpp - Unix - Text - Debug - - - - - FileRelative - ../../lib/png_PPC.lib - Unix - - PathRelative - Project - :png: - pngM8.mcp - Unix - - - - FileRelative - ../../lib/regex_PPC.lib - Unix - - PathRelative - Project - :regex: - regexM8.mcp - Unix - - - - FileRelative - ../../lib/tif_PPC.lib - Unix - - PathRelative - Project - :tiff: - tiffM8.mcp - Unix - - - - FileRelative - ../../lib/zlib_PPC.lib - Unix - - PathRelative - Project - :zlib: - zlibM8.mcp - Unix - - - - FileRelative - ../../lib/jpeg_PPC.lib - Unix - - PathRelative - Project - :jpeg: - jpegM8.mcp - Unix - - - - PathRelative - Project - :mac:classic: - :accel.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :app.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :bitmap.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :bmpbuttn.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :brush.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :button.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :checkbox.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :checklst.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :choice.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :clipbrd.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :colordlg.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :colour.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :combobox.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :control.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :cursor.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :data.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :dc.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :dcclient.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :dcmemory.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :dcscreen.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :dialog.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :dirdlg.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :filedlg.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :font.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :fontdlg.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :frame.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :gauge.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :gdiobj.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :icon.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :joystick.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :listbox.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :main.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :mdi.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :menu.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :menuitem.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :minifram.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :msgdlg.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :palette.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :pen.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :printdlg.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :radiobox.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :radiobut.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :region.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :scrolbar.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :settings.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :slider.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :spinbutt.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :statbmp.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :statbox.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :stattext.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :tabctrl.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :textctrl.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :thread.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :timer.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :toolbar.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :utils.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :utilsexc.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :sound.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :window.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :pnghand.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :printmac.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :dcprint.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :uma.cpp - MacOS - - - PathRelative - Project - :common: - :sckipc.cpp - MacOS - - - PathRelative - Project - :common: - :matrix.cpp - MacOS - - - PathRelative - Project - :common: - :tbarbase.cpp - MacOS - - - PathRelative - Project - :common: - :imagjpeg.cpp - MacOS - - - PathRelative - Project - :common: - :longlong.cpp - MacOS - - - PathRelative - Project - :common: - :docmdi.cpp - MacOS - - - PathRelative - Project - :common: - :appcmn.cpp - MacOS - - - PathRelative - Project - :common: - :utilscmn.cpp - MacOS - - - PathRelative - Project - :common: - :dynlib.cpp - MacOS - - - PathRelative - Project - :common: - :extended.c - MacOS - - - PathRelative - Project - :common: - :unzip.c - MacOS - - - PathRelative - Project - :common: - :sckstrm.cpp - MacOS - - - PathRelative - Project - :common: - :zstream.cpp - MacOS - - - PathRelative - Project - :common: - :process.cpp - MacOS - - - PathRelative - Project - :common: - :docview.cpp - MacOS - - - PathRelative - Project - :common: - :sizer.cpp - MacOS - - - PathRelative - Project - :common: - :dobjcmn.cpp - MacOS - - - PathRelative - Project - :common: - :imagall.cpp - MacOS - - - PathRelative - Project - :common: - :imaggif.cpp - MacOS - - - PathRelative - Project - :common: - :imagpcx.cpp - MacOS - - - PathRelative - Project - :common: - :cmndata.cpp - MacOS - - - PathRelative - Project - :common: - :ftp.cpp - MacOS - - - PathRelative - Project - :common: - :menucmn.cpp - MacOS - - - PathRelative - Project - :common: - :string.cpp - MacOS - - - PathRelative - Project - :common: - :wfstream.cpp - MacOS - - - PathRelative - Project - :common: - :stream.cpp - MacOS - - - PathRelative - Project - :common: - :gdicmn.cpp - MacOS - - - PathRelative - Project - :common: - :protocol.cpp - MacOS - - - PathRelative - Project - :common: - :layout.cpp - MacOS - - - PathRelative - Project - :common: - :valgen.cpp - MacOS - - - PathRelative - Project - :common: - :intl.cpp - MacOS - - - PathRelative - Project - :common: - :list.cpp - MacOS - - - PathRelative - Project - :common: - :socket.cpp - MacOS - - - PathRelative - Project - :common: - :hash.cpp - MacOS - - - PathRelative - Project - :common: - :dlgcmn.cpp - MacOS - - - PathRelative - Project - :common: - :gifdecod.cpp - MacOS - - - PathRelative - Project - :common: - :filefn.cpp - MacOS - - - PathRelative - Project - :common: - :wincmn.cpp - MacOS - - - PathRelative - Project - :common: - :wxchar.cpp - MacOS - - - PathRelative - Project - :common: - :memory.cpp - MacOS - - - PathRelative - Project - :common: - :mstream.cpp - MacOS - - - PathRelative - Project - :common: - :lboxcmn.cpp - MacOS - - - PathRelative - Project - :common: - :fs_inet.cpp - MacOS - - - PathRelative - Project - :common: - :event.cpp - MacOS - - - PathRelative - Project - :common: - :image.cpp - MacOS - - - PathRelative - Project - :common: - :ipcbase.cpp - MacOS - - - PathRelative - Project - :common: - :tokenzr.cpp - MacOS - - - PathRelative - Project - :common: - :txtstrm.cpp - MacOS - - - PathRelative - Project - :common: - :filesys.cpp - MacOS - - - PathRelative - Project - :common: - :url.cpp - MacOS - - - PathRelative - Project - :common: - :fs_zip.cpp - MacOS - - - PathRelative - Project - :common: - :prntbase.cpp - MacOS - - - PathRelative - Project - :common: - :dcbase.cpp - MacOS - - - PathRelative - Project - :common: - :object.cpp - MacOS - - - PathRelative - Project - :common: - :http.cpp - MacOS - - - PathRelative - Project - :common: - :module.cpp - MacOS - - - PathRelative - Project - :common: - :validate.cpp - MacOS - - - PathRelative - Project - :common: - :file.cpp - MacOS - - - PathRelative - Project - :common: - :config.cpp - MacOS - - - PathRelative - Project - :common: - :fileconf.cpp - MacOS - - - PathRelative - Project - :common: - :timercmn.cpp - MacOS - - - PathRelative - Project - :common: - :framecmn.cpp - MacOS - - - PathRelative - Project - :common: - :textfile.cpp - MacOS - - - PathRelative - Project - :common: - :dynarray.cpp - MacOS - - - PathRelative - Project - :common: - :choiccmn.cpp - MacOS - - - PathRelative - Project - :common: - :helpbase.cpp - MacOS - - - PathRelative - Project - :common: - :db.cpp - MacOS - - - PathRelative - Project - :common: - :ctrlsub.cpp - MacOS - - - PathRelative - Project - :common: - :ctrlcmn.cpp - MacOS - - - PathRelative - Project - :common: - :strconv.cpp - MacOS - - - PathRelative - Project - :common: - :sckfile.cpp - MacOS - - - PathRelative - Project - :common: - :valtext.cpp - MacOS - - - PathRelative - Project - :common: - :datstrm.cpp - MacOS - - - PathRelative - Project - :common: - :sckaddr.cpp - MacOS - - - PathRelative - Project - :common: - :variant.cpp - MacOS - - - PathRelative - Project - :common: - :dbtable.cpp - MacOS - - - PathRelative - Project - :common: - :fontcmn.cpp - MacOS - - - PathRelative - Project - :common: - :ffile.cpp - MacOS - - - PathRelative - Project - :common: - :paper.cpp - MacOS - - - PathRelative - Project - :common: - :clipcmn.cpp - MacOS - - - PathRelative - Project - :common: - :imagpnm.cpp - MacOS - - - PathRelative - Project - :common: - :imagpng.cpp - MacOS - - - PathRelative - Project - :common: - :imagbmp.cpp - MacOS - - - PathRelative - Project - :common: - :zipstrm.cpp - MacOS - - - PathRelative - Project - :common: - :log.cpp - MacOS - - - PathRelative - Project - :common: - :textcmn.cpp - MacOS - - - PathRelative - Project - :generic: - :laywin.cpp - MacOS - - - PathRelative - Project - :generic: - :busyinfo.cpp - MacOS - - - PathRelative - Project - :generic: - :listctrl.cpp - MacOS - - - PathRelative - Project - :generic: - :textdlgg.cpp - MacOS - - - PathRelative - Project - :generic: - :numdlgg.cpp - MacOS - - - PathRelative - Project - :generic: - :sashwin.cpp - MacOS - - - PathRelative - Project - :generic: - :dcpsg.cpp - MacOS - - - PathRelative - Project - :generic: - :panelg.cpp - MacOS - - - PathRelative - Project - :generic: - :imaglist.cpp - MacOS - - - PathRelative - Project - :generic: - :tabg.cpp - MacOS - - - PathRelative - Project - :generic: - :choicdgg.cpp - MacOS - - - PathRelative - Project - :generic: - :wizard.cpp - MacOS - - - PathRelative - Project - :generic: - :progdlgg.cpp - MacOS - - - PathRelative - Project - :generic: - :caret.cpp - MacOS - - - PathRelative - Project - :generic: - :statusbr.cpp - MacOS - - - PathRelative - Project - :generic: - :logg.cpp - MacOS - - - PathRelative - Project - :generic: - :fontdlgg.cpp - MacOS - - - PathRelative - Project - :generic: - :splitter.cpp - MacOS - - - PathRelative - Project - :common: - :fontmap.cpp - MacOS - - - Name - tipdlg.cpp - MacOS - - - PathRelative - Project - :common: - :geometry.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :fontutil.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :dataobj.cpp - MacOS - - - PathRelative - Project - :html: - :m_list.cpp - MacOS - - - PathRelative - Project - :html: - :m_tables.cpp - MacOS - - - PathRelative - Project - :html: - :htmlwin.cpp - MacOS - - - PathRelative - Project - :html: - :m_pre.cpp - MacOS - - - PathRelative - Project - :html: - :m_image.cpp - MacOS - - - PathRelative - Project - :html: - :htmprint.cpp - MacOS - - - PathRelative - Project - :html: - :htmlfilt.cpp - MacOS - - - PathRelative - Project - :html: - :htmlpars.cpp - MacOS - - - PathRelative - Project - :html: - :htmltag.cpp - MacOS - - - PathRelative - Project - :html: - :m_hline.cpp - MacOS - - - PathRelative - Project - :html: - :winpars.cpp - MacOS - - - PathRelative - Project - :html: - :htmlcell.cpp - MacOS - - - PathRelative - Project - :html: - :m_layout.cpp - MacOS - - - PathRelative - Project - :html: - :m_fonts.cpp - MacOS - - - PathRelative - Project - :html: - :m_links.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :fontenum.cpp - MacOS - - - Name - colrdlgg.cpp - MacOS - - - PathRelative - Project - :common: - :datetime.cpp - MacOS - - - PathRelative - Project - :common: - :encconv.cpp - MacOS - - - PathRelative - Project - :common: - :mimecmn.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :gsocket.c - MacOS - - - Name - metafile.cpp - MacOS - - - Name - wx_cw.pch - MacOS - - - Name - wx_cw.pch++ - MacOS - - - PathRelative - Project - :mac:classic: - :macnotfy.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :statbrma.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :tooltip.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :statlmac.cpp - MacOS - - - PathRelative - Project - :common: - :imagtiff.cpp - MacOS - - - PathRelative - Project - :generic: - :treectlg.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :notebmac.cpp - MacOS - - - PathRelative - Project - :html: - :m_dflist.cpp - MacOS - - - PathRelative - Project - :common: - :treebase.cpp - MacOS - - - PathRelative - Project - :common: - :cshelp.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :dirmac.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :mimetmac.cpp - MacOS - - - PathRelative - Project - :common: - :filename.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :spinctrl.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :glcanvas.cpp - MacOS - - - PathRelative - Project - :common: - :xpmdecod.cpp - MacOS - - - PathRelative - Project - :common: - :imagxpm.cpp - MacOS - - - PathRelative - Project - :generic: - :dirctrlg.cpp - MacOS - - - PathRelative - Project - :html: - :helpctrl.cpp - MacOS - - - PathRelative - Project - :html: - :helpfrm.cpp - MacOS - - - PathRelative - Project - :html: - :helpdata.cpp - MacOS - - - PathRelative - Project - :generic: - :tipwin.cpp - MacOS - - - PathRelative - Project - :common: - :radiocmn.cpp - MacOS - - - PathRelative - Project - :common: - :nbkbase.cpp - MacOS - - - PathRelative - Project - :generic: - :scrlwing.cpp - MacOS - - - PathRelative - Project - :common: - :gaugecmn.cpp - MacOS - - - PathRelative - Project - :common: - :containr.cpp - MacOS - - - PathRelative - Project - :common: - :quantize.cpp - MacOS - - - PathRelative - Project - :common: - :toplvcmn.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :toplevel.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :morefile:DirectoryCopy.c - MacOS - - - PathRelative - Project - :mac:classic: - :morefile:Search.c - MacOS - - - PathRelative - Project - :mac:classic: - :morefile:MoreFilesExtras.c - MacOS - - - PathRelative - Project - :mac:classic: - :morefile:MoreFiles.c - MacOS - - - PathRelative - Project - :mac:classic: - :morefile:MoreDesktopMgr.c - MacOS - - - PathRelative - Project - :mac:classic: - :morefile:IterateDirectory.c - MacOS - - - PathRelative - Project - :mac:classic: - :morefile:FullPath.c - MacOS - - - PathRelative - Project - :mac:classic: - :morefile:FSpCompat.c - MacOS - - - PathRelative - Project - :mac:classic: - :morefile:FileCopy.c - MacOS - - - PathRelative - Project - :generic: - :gridsel.cpp - MacOS - - - PathRelative - Project - :generic: - :grid.cpp - MacOS - - - PathRelative - Project - :common: - :statbar.cpp - MacOS - - - PathRelative - Project - :common: - :clntdata.cpp - MacOS - - - PathRelative - Project - :common: - :textbuf.cpp - MacOS - - - PathRelative - Project - :generic: - :dragimgg.cpp - MacOS - - - PathRelative - Project - :generic: - :calctrl.cpp - MacOS - - - PathRelative - Project - :common: - :bmpbase.cpp - MacOS - - - PathRelative - Project - :common: - :cmdline.cpp - MacOS - - - PathRelative - Project - :common: - :cmdproc.cpp - MacOS - - - PathRelative - Project - :common: - :dndcmn.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :dnd.cpp - MacOS - - - PathRelative - Project - :common: - :dbgrid.cpp - MacOS - - - PathRelative - Project - :common: - :dircmn.cpp - MacOS - - - PathRelative - Project - :common: - :dseldlg.cpp - MacOS - - - PathRelative - Project - :common: - :dynload.cpp - MacOS - - - PathRelative - Project - :common: - :effects.cpp - MacOS - - - PathRelative - Project - :common: - :fddlgcmn.cpp - MacOS - - - PathRelative - Project - :common: - :fs_mem.cpp - MacOS - - - PathRelative - Project - :common: - :regex.cpp - MacOS - - - PathRelative - Project - :common: - :sysopt.cpp - MacOS - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:PPCLibraries:CursorDevicesGlue.o - MacOS - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:PPCLibraries:OpenTptATalkPPC.o - MacOS - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:PPCLibraries:CarbonAccessors.o - MacOS - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:PPCLibraries:OpenTransportAppPPC.o - MacOS - - - PathRelative - CodeWarrior - :MacOS Support: - :Libraries:Sources:PLStringFuncs:Libs:PLStringFuncsPPC.lib - MacOS - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:PPCLibraries:OpenTptInetPPC.o - MacOS - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:NavigationLib - MacOS - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:ControlsLib - MacOS - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:DialogsLib - MacOS - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:WindowsLib - MacOS - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:MenusLib - MacOS - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:InterfaceLib - MacOS - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:MathLib - MacOS - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:AppearanceLib - MacOS - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:InternetConfigLib - MacOS - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:ThreadsLib - MacOS - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:OpenTransportLib - MacOS - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:OpenTptAppleTalkLib - MacOS - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:OpenTptInternetLib - MacOS - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:UTCUtils - MacOS - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:TextCommon - MacOS - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:Textension - MacOS - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:ATSUnicodeLib - MacOS - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:UnicodeConverter - MacOS - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:TextEncodingConverter - MacOS - - - PathRelative - CodeWarrior - :MSL: - MSL_C/MSL_MacOS/Src/console.stubs.c - Unix - - - PathRelative - CodeWarrior - :MacOS Support: - :Libraries:Runtime:Libs:MSL_All_PPC.Lib - MacOS - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:DragLib - MacOS - - - PathRelative - CodeWarrior - :MacOS Support: - :OpenGL:Libraries:OpenGLLibraryStub - MacOS - - - PathRelative - Project - :common: - :imagiff.cpp - MacOS - - - PathRelative - Project - :generic: - :splash.cpp - MacOS - - - PathRelative - Project - :generic: - :fdrepdlg.cpp - MacOS - - - PathRelative - Project - :generic: - :gridctrl.cpp - MacOS - - - PathRelative - Project - :html: - :m_style.cpp - MacOS - - - PathRelative - Project - :common: - :hashmap.cpp - MacOS - - - PathRelative - Project - :generic: - :dirdlgg.cpp - MacOS - - - PathRelative - Project - :common: - :iconbndl.cpp - MacOS - - - PathRelative - Project - :common: - :artprov.cpp - MacOS - - - PathRelative - Project - :common: - :artstd.cpp - MacOS - - - PathRelative - Project - :common: - :imagfill.cpp - MacOS - - - PathRelative - Project - :common: - :msgout.cpp - MacOS - - - PathRelative - Project - :common: - :settcmn.cpp - MacOS - - - PathRelative - Project - :common: - :popupcmn.cpp - MacOS - - - PathRelative - Project - :generic: - :printps.cpp - MacOS - - - PathRelative - Project - :common: - datacmn.cpp - Unix - - - PathRelative - Project - :common: - rgncmn.cpp - Unix - - - PathRelative - Project - :common: - accesscmn.cpp - Unix - - - PathRelative - Project - :common: - dpycmn.cpp - Unix - - - PathRelative - Project - :common: - taskbarcmn.cpp - Unix - - - PathRelative - Project - :common: - fldlgcmn.cpp - Unix - - - PathRelative - Project - :generic: - :selstore.cpp - MacOS - - - PathRelative - Project - :common: - appbase.cpp - Unix - - - PathRelative - Project - :common: - fmapbase.cpp - Unix - - - PathRelative - Project - :common: - stopwatch.cpp - Unix - - - PathRelative - Project - :common: - init.cpp - Unix - - - PathRelative - Project - :generic: - renderg.cpp - Unix - - - PathRelative - Project - :mac:classic: - renderer.cpp - Unix - - - PathRelative - Project - xml - xml.cpp - Unix - - - PathRelative - Project - expat/lib - xmlparse.c - Unix - - - PathRelative - Project - expat/lib - xmlrole.c - Unix - - - PathRelative - Project - expat/lib - xmltok.c - Unix - - - PathRelative - Project - :common: - rendcmn.cpp - Unix - - - PathRelative - Project - :common: - bookctrl.cpp - Unix - - - - - - PathRelative - Project - :jpeg: - jpegM8.mcp - Unix - - - - PPC - LinkAgainst - - FileRelative - ../../lib/jpeg_PPC.lib - Unix - - PathRelative - Project - :jpeg: - jpegM8.mcp - Unix - - - - - - - - PathRelative - Project - :png: - pngM8.mcp - Unix - - - - PPC - LinkAgainst - - FileRelative - ../../lib/png_PPC.lib - Unix - - PathRelative - Project - :png: - pngM8.mcp - Unix - - - - - - - - PathRelative - Project - :zlib: - zlibM8.mcp - Unix - - - - PPC - LinkAgainst - - FileRelative - ../../lib/zlib_PPC.lib - Unix - - PathRelative - Project - :zlib: - zlibM8.mcp - Unix - - - - - - - - PathRelative - Project - :tiff: - tiffM8.mcp - Unix - - - - PPC - LinkAgainst - - FileRelative - ../../lib/tif_PPC.lib - Unix - - PathRelative - Project - :tiff: - tiffM8.mcp - Unix - - - - - - - - PathRelative - Project - :regex: - regexM8.mcp - Unix - - - - PPC - LinkAgainst - - FileRelative - ../../lib/regex_PPC.lib - Unix - - PathRelative - Project - :regex: - regexM8.mcp - Unix - - - - - - - - - all targets - - - - UserSourceTrees - - - AlwaysSearchUserPathsfalse - InterpretDOSAndUnixPathsfalse - RequireFrameworkStyleIncludesfalse - UserSearchPaths - - SearchPath - Path: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SystemSearchPaths - - SearchPath - Path: - PathFormatMacOS - PathRootCodeWarrior - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - - - MWRuntimeSettings_WorkingDirectory - MWRuntimeSettings_CommandLine - MWRuntimeSettings_HostApplication - Path - PathFormatGeneric - PathRootAbsolute - - MWRuntimeSettings_EnvVars - - - LinkerNone - PreLinker - PostLinker - Targetnameall targets - OutputDirectory - Path: - PathFormatMacOS - PathRootProject - - SaveEntriesUsingRelativePathsfalse - - - FileMappings - - FileTypeMMPr - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFilefalse - IgnoredByMakefalse - - - - - CacheModDatestrue - DumpBrowserInfofalse - CacheSubprojectstrue - UseThirdPartyDebuggerfalse - BrowserGenerator1 - DebuggerAppPath - Path - PathFormatGeneric - PathRootAbsolute - - DebuggerCmdLineArgs - DebuggerWorkingDir - Path - PathFormatGeneric - PathRootAbsolute - - CodeCompletionPrefixFileName - CodeCompletionMacroFileName - - - ConsoleEncoding0 - LogSystemMessagestrue - AutoTargetDLLsfalse - StopAtWatchpointstrue - PauseWhileRunningfalse - PauseInterval5 - PauseUIFlags0 - AltExePath - Path - PathFormatGeneric - PathRootAbsolute - - StopAtTempBPOnLaunchtrue - CacheSymbolicstrue - TempBPFunctionNamemain - TempBPType0 - - - Enabledfalse - ConnectionName - DownloadPath - LaunchRemoteAppfalse - RemoteAppPath - CoreID0 - JTAGClockSpeed8000 - IsMultiCorefalse - OSDownloadfalse - UseGlobalOSDownloadfalse - OSDownloadConnectionName - OSDownloadPath - AltDownloadfalse - AltDownloadConnectionName - - - OtherExecutables - - - CustomColor1 - Red0 - Green32767 - Blue0 - - CustomColor2 - Red0 - Green32767 - Blue0 - - CustomColor3 - Red0 - Green32767 - Blue0 - - CustomColor4 - Red0 - Green32767 - Blue0 - - - - MWFrontEnd_C_cplusplus0 - MWFrontEnd_C_checkprotos0 - MWFrontEnd_C_arm0 - MWFrontEnd_C_trigraphs0 - MWFrontEnd_C_onlystdkeywords0 - MWFrontEnd_C_enumsalwaysint0 - MWFrontEnd_C_mpwpointerstyle0 - MWFrontEnd_C_prefixname - MWFrontEnd_C_ansistrict0 - MWFrontEnd_C_mpwcnewline0 - MWFrontEnd_C_wchar_type1 - MWFrontEnd_C_enableexceptions1 - MWFrontEnd_C_dontreusestrings0 - MWFrontEnd_C_poolstrings0 - MWFrontEnd_C_dontinline0 - MWFrontEnd_C_useRTTI1 - MWFrontEnd_C_multibyteaware0 - MWFrontEnd_C_unsignedchars0 - MWFrontEnd_C_autoinline0 - MWFrontEnd_C_booltruefalse1 - MWFrontEnd_C_inlinelevel0 - MWFrontEnd_C_ecplusplus0 - MWFrontEnd_C_objective_c0 - MWFrontEnd_C_defer_codegen0 - MWFrontEnd_C_templateparser0 - MWFrontEnd_C_c990 - MWFrontEnd_C_bottomupinline1 - - - MWWarning_C_warn_illpragma0 - MWWarning_C_warn_emptydecl0 - MWWarning_C_warn_possunwant0 - MWWarning_C_warn_unusedvar0 - MWWarning_C_warn_unusedarg0 - MWWarning_C_warn_extracomma0 - MWWarning_C_pedantic0 - MWWarning_C_warningerrors0 - MWWarning_C_warn_hidevirtual0 - MWWarning_C_warn_implicitconv0 - MWWarning_C_warn_notinlined0 - MWWarning_C_warn_structclass0 - - - MWFTP_Post_hostName - MWFTP_Post_username - MWFTP_Post_password0ÿÄ@ž–@)t - MWFTP_Post_remoteDir - MWFTP_Post_ftp_PathVersion1 - MWFTP_Post_ftp_PathType0 - MWFTP_Post_ftp_PathFormat0 - MWFTP_Post_ftp_tree - MWFTP_Post_uploadDir - MWFTP_Post_ftp_port21 - MWFTP_Post_SendBin1 - MWFTP_Post_ShouldLog1 - - - MWCommandLine_Java_clsName - MWCommandLine_Java_args - - - MWVJavaDebugging_Protocol1 - MWVJavaDebugging_JDKVersion1 - MWVJavaDebugging_TimeOut10 - MWVJavaDebugging_SupportSlowDevicesfalse - MWVJavaDebugging_UseRemoteLaunchAgentfalse - MWVJavaDebugging_LaunchVMasServerfalse - - - MWJava_Language_optimizefalse - MWJava_Language_warnDeprecatedfalse - MWJava_Language_emitMapfalse - MWJava_Language_strictFileNamesfalse - MWJava_Language_strictFileHierarchyfalse - MWJava_Language_1_1_Compatiblefalse - MWJava_Language_emitHeaders0 - MWJava_Language_headerTypeJNINativeHeaders - MWJava_Language_packageFilter - MWJava_Language_genCommentstrue - MWJava_Language_genHeadersfalse - MWJava_Language_enableAssertsfalse - MWJava_Language_targetVM1.1 - - - Manifest-JAD Attributes - - AttributeMain-Class - ValueAuto-Generated - - - - - MWJava_MRJAppBuilder_outFileMRJApplication - MWJava_MRJAppBuilder_mergefalse - MWJava_MRJAppBuilder_quitMenutrue - MWJava_MRJAppBuilder_growfalse - MWJava_MRJAppBuilder_stdoutTypeConsole - MWJava_MRJAppBuilder_stderrTypeConsole - MWJava_MRJAppBuilder_stdinTypeConsole - MWJava_MRJAppBuilder_appIconPVersion0 - MWJava_MRJAppBuilder_appIconPType0 - MWJava_MRJAppBuilder_appIconPFormat0 - MWJava_MRJAppBuilder_appIconPTree - MWJava_MRJAppBuilder_appIconFile - MWJava_MRJAppBuilder_splashScreenPVersion0 - MWJava_MRJAppBuilder_splashScreenPType0 - MWJava_MRJAppBuilder_splashScreenPFormat0 - MWJava_MRJAppBuilder_splashScreenPTree - MWJava_MRJAppBuilder_splashScreenPICTFile - MWJava_MRJAppBuilder_aboutName - MWJava_MRJAppBuilder_stdoutPVersion0 - MWJava_MRJAppBuilder_stdoutPType0 - MWJava_MRJAppBuilder_stdoutPFormat0 - MWJava_MRJAppBuilder_stdoutPTree - MWJava_MRJAppBuilder_stdoutFile - MWJava_MRJAppBuilder_stdoutAppendfalse - MWJava_MRJAppBuilder_stderrPType0 - MWJava_MRJAppBuilder_stderrPFormat0 - MWJava_MRJAppBuilder_stderrPTree - MWJava_MRJAppBuilder_stderrFile - MWJava_MRJAppBuilder_stderrAppendfalse - MWJava_MRJAppBuilder_stdinPType0 - MWJava_MRJAppBuilder_stdinPFormat0 - MWJava_MRJAppBuilder_stdinPTree - MWJava_MRJAppBuilder_stdinFile - - - MWJava_Output_outputtypeJarFile - MWJava_Output_outfileJavaClasses.jar - MWJava_Output_ftype1514754080 - MWJava_Output_fcreator1297570384 - MWJava_Output_compress0 - MWJava_Output_genManifest0 - MWJava_Output_trunctypeFront - MWJava_Output_deleteClasses0 - MWJava_Output_consoleApp1 - MWJava_Output_preverify0 - MWJava_Output_genJad0 - MWJava_Output_obfuscate0 - - - MWJava_Proj_projtypeApplet - MWJava_Proj_mainClassName - MWJava_Proj_HTMLAppCreator1145457748 - MWJava_Proj_HTMLAppNameMetrowerks Java - MWJava_Proj_PathVersion1 - MWJava_Proj_PathType0 - MWJava_Proj_PathFormat0 - MWJava_Proj_tree - MWJava_Proj_HTMLAppWin32NameInternet Explorer - MWJava_Proj_compress0 - MWJava_Proj_simulator0 - MWJava_Proj_useVM\000\000macosx - MWJava_Proj_vmarguments - MWJava_Proj_vmName - MWJava_Proj_simPropFile - - - MWJavaDoc_Proj_Version1 - MWJavaDoc_Proj_Deprecated1 - MWJavaDoc_Proj_Author1 - MWJavaDoc_Proj_Index1 - MWJavaDoc_Proj_Tree1 - MWJavaDoc_Proj_SunResolveToSame0 - MWJavaDoc_Proj_Shortnames1 - MWJavaDoc_Proj_Folder0 - MWJavaDoc_Proj_GenerateAPILinks0 - MWJavaDoc_Proj_scopePublic - MWJavaDoc_Proj_fcreator1297303877 - MWJavaDoc_Proj_encodingName - MWJavaDoc_Proj_decodingName - MWJavaDoc_Proj_javaPackagePathhttp://java.sun.com/products/jdk/1.1/docs/api/ - - - MWMerge_MacOS_projectTypeApplication - MWMerge_MacOS_outputNameMerge Out - MWMerge_MacOS_outputCreator???? - MWMerge_MacOS_outputTypeAPPL - MWMerge_MacOS_suppressWarning0 - MWMerge_MacOS_copyFragments1 - MWMerge_MacOS_copyResources1 - MWMerge_MacOS_flattenResource0 - MWMerge_MacOS_flatFileNamea.rsrc - MWMerge_MacOS_flatFileOutputPath - Path: - PathFormatMacOS - PathRootProject - - MWMerge_MacOS_skipResources - DLGX - ckid - Proj - WSPC - - - - FileLockedfalse - ResourcesMapIsReadOnlyfalse - PrinterDriverIsMultiFinderCompatiblefalse - Invisiblefalse - HasBundlefalse - NameLockedfalse - Stationeryfalse - HasCustomIconfalse - Sharedfalse - HasBeenInitedfalse - Label0 - Comments - - - MWMacOSPackager_UsePackager0 - MWMacOSPackager_FolderToPackage - Path - PathFormatMacOS - PathRootAbsolute - - MWMacOSPackager_CreateClassicAlias0 - MWMacOSPackager_ClassicAliasMethodUseTargetOutput - MWMacOSPackager_ClassicAliasPath - Path - PathFormatGeneric - PathRootAbsolute - - MWMacOSPackager_CreatePkgInfo0 - MWMacOSPackager_PkgCreatorType???? - MWMacOSPackager_PkgFileTypeAPPL - - - MWCodeGen_PPC_structalignmentMC68K - MWCodeGen_PPC_tracebacktablesNone - MWCodeGen_PPC_processorGeneric - MWCodeGen_PPC_function_align4 - MWCodeGen_PPC_tocdata1 - MWCodeGen_PPC_largetoc0 - MWCodeGen_PPC_profiler0 - MWCodeGen_PPC_vectortocdata0 - MWCodeGen_PPC_poolconst0 - MWCodeGen_PPC_peephole1 - MWCodeGen_PPC_readonlystrings0 - MWCodeGen_PPC_linkerpoolsstrings0 - MWCodeGen_PPC_volatileasm0 - MWCodeGen_PPC_schedule0 - MWCodeGen_PPC_altivec0 - MWCodeGen_PPC_altivec_move_block0 - MWCodeGen_PPC_strictIEEEfp0 - MWCodeGen_PPC_fpcontract1 - MWCodeGen_PPC_genfsel0 - MWCodeGen_PPC_orderedfpcmp0 - - - MWCodeGen_MachO_structalignmentPPC_mw - MWCodeGen_MachO_profiler_enumOff - MWCodeGen_MachO_processorGeneric - MWCodeGen_MachO_function_align4 - MWCodeGen_MachO_common0 - MWCodeGen_MachO_peephole1 - MWCodeGen_MachO_readonlystrings0 - MWCodeGen_MachO_linkerpoolsstrings1 - MWCodeGen_MachO_volatileasm0 - MWCodeGen_MachO_schedule0 - MWCodeGen_MachO_altivec0 - MWCodeGen_MachO_vecmove0 - MWCodeGen_MachO_fp_ieee_strict0 - MWCodeGen_MachO_fpcontract1 - MWCodeGen_MachO_genfsel0 - MWCodeGen_MachO_fp_cmps_ordered0 - - - MWDisassembler_PPC_showcode1 - MWDisassembler_PPC_extended1 - MWDisassembler_PPC_mix0 - MWDisassembler_PPC_nohex0 - MWDisassembler_PPC_showdata1 - MWDisassembler_PPC_showexceptions1 - MWDisassembler_PPC_showsym0 - MWDisassembler_PPC_shownames1 - - - GlobalOptimizer_PPC_optimizationlevelLevel0 - GlobalOptimizer_PPC_optforSpeed - - - MWLinker_PPC_linksym1 - MWLinker_PPC_symfullpath1 - MWLinker_PPC_linkmap0 - MWLinker_PPC_nolinkwarnings0 - MWLinker_PPC_dontdeadstripinitcode0 - MWLinker_PPC_permitmultdefs0 - MWLinker_PPC_linkmodeFast - MWLinker_PPC_initname - MWLinker_PPC_mainname__start - MWLinker_PPC_termname - - - MWLinker_MacOSX_linksym0 - MWLinker_MacOSX_symfullpath0 - MWLinker_MacOSX_nolinkwarnings0 - MWLinker_MacOSX_linkmap0 - MWLinker_MacOSX_dontdeadstripinitcode0 - MWLinker_MacOSX_permitmultdefs1 - MWLinker_MacOSX_use_objectivec_semantics0 - MWLinker_MacOSX_strip_debug_symbols0 - MWLinker_MacOSX_split_segs0 - MWLinker_MacOSX_report_msl_overloads0 - MWLinker_MacOSX_objects_follow_linkorder0 - MWLinker_MacOSX_linkmodeFast - MWLinker_MacOSX_exportsReferencedGlobals - MWLinker_MacOSX_sortcodeNone - MWLinker_MacOSX_mainnamestart - - - MWProject_MacOSX_typeExecutable - MWProject_MacOSX_outfile - MWProject_MacOSX_filecreator???? - MWProject_MacOSX_filetypeMEXE - MWProject_MacOSX_vmaddress4096 - MWProject_MacOSX_usedefaultvmaddr1 - MWProject_MacOSX_flatrsrc0 - MWProject_MacOSX_flatrsrcfilename - MWProject_MacOSX_flatrsrcoutputdir - Path: - PathFormatMacOS - PathRootProject - - MWProject_MacOSX_installpath./ - MWProject_MacOSX_dont_prebind0 - MWProject_MacOSX_flat_namespace0 - MWProject_MacOSX_frameworkversionA - MWProject_MacOSX_currentversion0 - MWProject_MacOSX_flat_oldimpversion0 - - - MWLinker_MachO_exportsNone - MWLinker_MachO_mainnamestart - MWLinker_MachO_currentversion0 - MWLinker_MachO_compatibleversion0 - MWLinker_MachO_symfullpath0 - MWLinker_MachO_supresswarnings0 - MWLinker_MachO_multisymerror0 - MWLinker_MachO_prebind1 - MWLinker_MachO_deadstrip1 - MWLinker_MachO_objectivecsemantics0 - MWLinker_MachO_whichfileloaded0 - MWLinker_MachO_whyfileloaded0 - MWLinker_MachO_readonlyrelocsErrors - MWLinker_MachO_undefinedsymbolsErrors - MWLinker_MachO_twolevelnamespace1 - MWLinker_MachO_stripdebugsymbols0 - - - MWProject_MachO_typeExecutable - MWProject_MachO_outfilea.exe - MWProject_MachO_filecreator???? - MWProject_MachO_filetypeMEXE - MWProject_MachO_vmaddress4096 - MWProject_MachO_flatrsrc1 - MWProject_MachO_flatrsrcfilenamea.rsrc - MWProject_MachO_flatrsrcoutputdir - Path: - PathFormatMacOS - PathRootProject - - MWProject_MachO_installpath./ - MWProject_MachO_frameworkversion - - - MWPEF_exportsNone - MWPEF_libfolder0 - MWPEF_sortcodeNone - MWPEF_expandbss0 - MWPEF_sharedata0 - MWPEF_olddefversion0 - MWPEF_oldimpversion0 - MWPEF_currentversion0 - MWPEF_fragmentname - MWPEF_collapsereloads0 - - - MWProject_PPC_typeApplication - MWProject_PPC_outfilea.out - MWProject_PPC_filecreator???? - MWProject_PPC_filetypeAPPL - MWProject_PPC_size384 - MWProject_PPC_minsize384 - MWProject_PPC_stacksize64 - MWProject_PPC_flags22720 - MWProject_PPC_symfilename - MWProject_PPC_rsrcname - MWProject_PPC_rsrcheaderNative - MWProject_PPC_rsrctype???? - MWProject_PPC_rsrcid0 - MWProject_PPC_rsrcflags0 - MWProject_PPC_rsrcstore0 - MWProject_PPC_rsrcmerge0 - MWProject_PPC_flatrsrc0 - MWProject_PPC_flatrsrcoutputdir - Path: - PathFormatMacOS - PathRootProject - - MWProject_PPC_flatrsrcfilename - - - MWAssembler_PPC_auxheader0 - MWAssembler_PPC_symmodeMac - MWAssembler_PPC_dialectPPC - MWAssembler_PPC_prefixfile - MWAssembler_PPC_typecheck0 - MWAssembler_PPC_warnings0 - MWAssembler_PPC_casesensitive0 - - - PList_OutputTypeFile - PList_OutputEncodingUTF-8 - PList_Prefix - PList_FileFilenameInfo.plist - PList_FileDirectory - Path: - PathFormatMacOS - PathRootProject - - PList_ResourceTypeplst - PList_ResourceID0 - PList_ResourceName - - - MWRez_Language_maxwidth80 - MWRez_Language_scriptRoman - MWRez_Language_alignmentAlign1 - MWRez_Language_filtermodeFilterSkip - MWRez_Language_suppresswarnings0 - MWRez_Language_escapecontrolchars1 - MWRez_Language_prefixname - MWRez_Language_filteredtypes'CODE' 'DATA' 'PICT' - - - MWWinRC_prefixname - - - MWCodeGen_X86_processorGeneric - MWCodeGen_X86_alignmentbytes8 - MWCodeGen_X86_exceptionsZeroOverhead - MWCodeGen_X86_name_manglingMWWin32 - MWCodeGen_X86_use_extinst0 - MWCodeGen_X86_extinst_mmx0 - MWCodeGen_X86_extinst_3dnow0 - MWCodeGen_X86_use_mmx_3dnow_convention0 - MWCodeGen_X86_extinst_cmov0 - MWCodeGen_X86_extinst_sse0 - MWCodeGen_X86_extinst_sse20 - MWCodeGen_X86_intrinsics0 - MWCodeGen_X86_optimizeasm0 - MWCodeGen_X86_disableopts0 - MWCodeGen_X86_profile0 - MWLinker_X86_runtimeCustom - MWCodeGen_X86_readonlystrings0 - - - MWLinker_X86_subsysmajorid4 - MWLinker_X86_subsysminorid0 - MWCOFF_X86_opsysmajorid4 - MWCOFF_X86_opsysminorid0 - MWLinker_X86_usrmajorid0 - MWLinker_X86_usrminorid0 - MWProject_X86_maxstacksize1024 - MWProject_X86_minstacksize4 - MWProject_X86_size1024 - MWProject_X86_minsize4 - MWCOFF_X86_coff_flags0 - MWCOFF_X86_dll_flags0 - MWProject_X86_baseaddress4194304 - MWCOFF_X86_filealign512 - MWCOFF_X86_sectionalign4096 - - - PDisasmX86_showHeaderstrue - PDisasmX86_showSectHeaderstrue - PDisasmX86_showSymTabtrue - PDisasmX86_showCodetrue - PDisasmX86_showDatatrue - PDisasmX86_showDebugfalse - PDisasmX86_showExceptionsfalse - PDisasmX86_showRawfalse - PDisasmX86_showAllRawfalse - PDisasmX86_showSourcefalse - PDisasmX86_showRelocationtrue - PDisasmX86_showHextrue - PDisasmX86_showCommentsfalse - PDisasmX86_showSymDefstrue - PDisasmX86_unmangletrue - PDisasmX86_verbosetrue - PDisasmX86_resolveRelocstrue - PDisasmX86_resolveLocalsfalse - - - MWDebugger_X86_Exceptions - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - - - - GlobalOptimizer_X86_optimizationlevelLevel0 - GlobalOptimizer_X86_optforSpeed - - - MWLinker_X86_entrypointusageDefault - MWLinker_X86_entrypoint - MWLinker_X86_subsystemWinGUI - MWLinker_X86_commandfile - MWLinker_X86_generatemap0 - MWLinker_X86_linksym0 - MWLinker_X86_linkCV1 - MWLinker_X86_symfullpathfalse - MWLinker_X86_linkdebugtrue - MWLinker_X86_checksumfalse - MWLinker_X86_zero_init_bssfalse - MWLinker_X86_mergedatafalse - MWLinker_X86_usedefaultlibsfalse - MWLinker_X86_adddefaultlibsfalse - MWLinker_X86_nowarningsfalse - MWLinker_X86_verbosefalse - - - MWProject_X86_typeApplication - MWProject_X86_outfileNONAME.EXE - MWProject_X86_importlib - MWProject_X86_setimportlibdirfalse - MWProject_X86_dontgenerateimportlibfalse - MWProject_X86_oldformatlibfalse - MWProject_X86_replaceobjextensionfalse - MWProject_X86_copyallfilesfalse - - - - - - - - wxlib PPC release - - - wxlib PPC debug - - - wxlib PPC resources - - - wxlib PPC profile - - - wxshlb PPC release - - - wxshlb PPC debug - - - wxshlba PPC debug - - - wxshlba PPC release - - - - - wxlib PPC resources - - - - UserSourceTrees - - - AlwaysSearchUserPathsfalse - InterpretDOSAndUnixPathsfalse - RequireFrameworkStyleIncludesfalse - UserSearchPaths - - SearchPath - Pathmac/classic - PathFormatUnix - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path::lib: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SystemSearchPaths - - SearchPath - Path:MacOS Support: - PathFormatMacOS - PathRootCodeWarrior - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - - - MWRuntimeSettings_WorkingDirectory - MWRuntimeSettings_CommandLine - MWRuntimeSettings_HostApplication - Path - PathFormatGeneric - PathRootAbsolute - - MWRuntimeSettings_EnvVars - - - LinkerMacOS Merge - PreLinker - PostLinker - Targetnamewxlib PPC resources - OutputDirectory - Path::lib: - PathFormatMacOS - PathRootProject - - SaveEntriesUsingRelativePathsfalse - - - FileMappings - - FileTypeAPPL - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypeAppl - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypeRSRC - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.bh - CompilerBalloon Help - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.r - CompilerRez - EditLanguageRez - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypersrc - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypeshlb - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - - - CacheModDatestrue - DumpBrowserInfofalse - CacheSubprojectstrue - UseThirdPartyDebuggerfalse - BrowserGenerator1 - DebuggerAppPath - Path - PathFormatGeneric - PathRootAbsolute - - DebuggerCmdLineArgs - DebuggerWorkingDir - Path - PathFormatGeneric - PathRootAbsolute - - CodeCompletionPrefixFileName - CodeCompletionMacroFileName - - - ConsoleEncoding0 - LogSystemMessagestrue - AutoTargetDLLsfalse - StopAtWatchpointstrue - PauseWhileRunningfalse - PauseInterval5 - PauseUIFlags0 - AltExePath - Path - PathFormatGeneric - PathRootAbsolute - - StopAtTempBPOnLaunchtrue - CacheSymbolicstrue - TempBPFunctionNamemain - TempBPType0 - - - Enabledfalse - ConnectionName - DownloadPath - LaunchRemoteAppfalse - RemoteAppPath - CoreID0 - JTAGClockSpeed8000 - IsMultiCorefalse - OSDownloadfalse - UseGlobalOSDownloadfalse - OSDownloadConnectionName - OSDownloadPath - AltDownloadfalse - AltDownloadConnectionName - - - OtherExecutables - - - CustomColor1 - Red0 - Green32767 - Blue0 - - CustomColor2 - Red0 - Green32767 - Blue0 - - CustomColor3 - Red0 - Green32767 - Blue0 - - CustomColor4 - Red0 - Green32767 - Blue0 - - - - MWFrontEnd_C_cplusplus0 - MWFrontEnd_C_checkprotos0 - MWFrontEnd_C_arm0 - MWFrontEnd_C_trigraphs0 - MWFrontEnd_C_onlystdkeywords0 - MWFrontEnd_C_enumsalwaysint0 - MWFrontEnd_C_mpwpointerstyle0 - MWFrontEnd_C_prefixname - MWFrontEnd_C_ansistrict0 - MWFrontEnd_C_mpwcnewline0 - MWFrontEnd_C_wchar_type1 - MWFrontEnd_C_enableexceptions1 - MWFrontEnd_C_dontreusestrings0 - MWFrontEnd_C_poolstrings0 - MWFrontEnd_C_dontinline0 - MWFrontEnd_C_useRTTI1 - MWFrontEnd_C_multibyteaware0 - MWFrontEnd_C_unsignedchars0 - MWFrontEnd_C_autoinline0 - MWFrontEnd_C_booltruefalse1 - MWFrontEnd_C_inlinelevel0 - MWFrontEnd_C_ecplusplus0 - MWFrontEnd_C_objective_c0 - MWFrontEnd_C_defer_codegen0 - MWFrontEnd_C_templateparser0 - MWFrontEnd_C_c990 - MWFrontEnd_C_bottomupinline1 - - - MWWarning_C_warn_illpragma0 - MWWarning_C_warn_emptydecl0 - MWWarning_C_warn_possunwant0 - MWWarning_C_warn_unusedvar0 - MWWarning_C_warn_unusedarg0 - MWWarning_C_warn_extracomma0 - MWWarning_C_pedantic0 - MWWarning_C_warningerrors0 - MWWarning_C_warn_hidevirtual0 - MWWarning_C_warn_implicitconv0 - MWWarning_C_warn_notinlined0 - MWWarning_C_warn_structclass0 - - - MWFTP_Post_hostName - MWFTP_Post_username - MWFTP_Post_password0ÿÄ@ž–@)t - MWFTP_Post_remoteDir - MWFTP_Post_ftp_PathVersion1 - MWFTP_Post_ftp_PathType0 - MWFTP_Post_ftp_PathFormat0 - MWFTP_Post_ftp_tree - MWFTP_Post_uploadDir - MWFTP_Post_ftp_port21 - MWFTP_Post_SendBin1 - MWFTP_Post_ShouldLog1 - - - MWCommandLine_Java_clsName - MWCommandLine_Java_args - - - MWVJavaDebugging_Protocol1 - MWVJavaDebugging_JDKVersion1 - MWVJavaDebugging_TimeOut10 - MWVJavaDebugging_SupportSlowDevicesfalse - MWVJavaDebugging_UseRemoteLaunchAgentfalse - MWVJavaDebugging_LaunchVMasServerfalse - - - MWJava_Language_optimizefalse - MWJava_Language_warnDeprecatedfalse - MWJava_Language_emitMapfalse - MWJava_Language_strictFileNamesfalse - MWJava_Language_strictFileHierarchyfalse - MWJava_Language_1_1_Compatiblefalse - MWJava_Language_emitHeaders0 - MWJava_Language_headerTypeJNINativeHeaders - MWJava_Language_packageFilter - MWJava_Language_genCommentstrue - MWJava_Language_genHeadersfalse - MWJava_Language_enableAssertsfalse - MWJava_Language_targetVM1.1 - - - Manifest-JAD Attributes - - AttributeMain-Class - ValueAuto-Generated - - - - - MWJava_MRJAppBuilder_outFileMRJApplication - MWJava_MRJAppBuilder_mergefalse - MWJava_MRJAppBuilder_quitMenutrue - MWJava_MRJAppBuilder_growfalse - MWJava_MRJAppBuilder_stdoutTypeConsole - MWJava_MRJAppBuilder_stderrTypeConsole - MWJava_MRJAppBuilder_stdinTypeConsole - MWJava_MRJAppBuilder_appIconPVersion0 - MWJava_MRJAppBuilder_appIconPType0 - MWJava_MRJAppBuilder_appIconPFormat0 - MWJava_MRJAppBuilder_appIconPTree - MWJava_MRJAppBuilder_appIconFile - MWJava_MRJAppBuilder_splashScreenPVersion0 - MWJava_MRJAppBuilder_splashScreenPType0 - MWJava_MRJAppBuilder_splashScreenPFormat0 - MWJava_MRJAppBuilder_splashScreenPTree - MWJava_MRJAppBuilder_splashScreenPICTFile - MWJava_MRJAppBuilder_aboutName - MWJava_MRJAppBuilder_stdoutPVersion0 - MWJava_MRJAppBuilder_stdoutPType0 - MWJava_MRJAppBuilder_stdoutPFormat0 - MWJava_MRJAppBuilder_stdoutPTree - MWJava_MRJAppBuilder_stdoutFile - MWJava_MRJAppBuilder_stdoutAppendfalse - MWJava_MRJAppBuilder_stderrPType0 - MWJava_MRJAppBuilder_stderrPFormat0 - MWJava_MRJAppBuilder_stderrPTree - MWJava_MRJAppBuilder_stderrFile - MWJava_MRJAppBuilder_stderrAppendfalse - MWJava_MRJAppBuilder_stdinPType0 - MWJava_MRJAppBuilder_stdinPFormat0 - MWJava_MRJAppBuilder_stdinPTree - MWJava_MRJAppBuilder_stdinFile - - - MWJava_Output_outputtypeJarFile - MWJava_Output_outfileJavaClasses.jar - MWJava_Output_ftype1514754080 - MWJava_Output_fcreator1297570384 - MWJava_Output_compress0 - MWJava_Output_genManifest0 - MWJava_Output_trunctypeFront - MWJava_Output_deleteClasses0 - MWJava_Output_consoleApp1 - MWJava_Output_preverify0 - MWJava_Output_genJad0 - MWJava_Output_obfuscate0 - - - MWJava_Proj_projtypeApplet - MWJava_Proj_mainClassName - MWJava_Proj_HTMLAppCreator1145457748 - MWJava_Proj_HTMLAppNameMetrowerks Java - MWJava_Proj_PathVersion1 - MWJava_Proj_PathType0 - MWJava_Proj_PathFormat0 - MWJava_Proj_tree - MWJava_Proj_HTMLAppWin32NameInternet Explorer - MWJava_Proj_compress0 - MWJava_Proj_simulator0 - MWJava_Proj_useVM\000\000macosx - MWJava_Proj_vmarguments - MWJava_Proj_vmName - MWJava_Proj_simPropFile - - - MWJavaDoc_Proj_Version1 - MWJavaDoc_Proj_Deprecated1 - MWJavaDoc_Proj_Author1 - MWJavaDoc_Proj_Index1 - MWJavaDoc_Proj_Tree1 - MWJavaDoc_Proj_SunResolveToSame0 - MWJavaDoc_Proj_Shortnames1 - MWJavaDoc_Proj_Folder0 - MWJavaDoc_Proj_GenerateAPILinks0 - MWJavaDoc_Proj_scopePublic - MWJavaDoc_Proj_fcreator1297303877 - MWJavaDoc_Proj_encodingName - MWJavaDoc_Proj_decodingName - MWJavaDoc_Proj_javaPackagePathhttp://java.sun.com/products/jdk/1.1/docs/api/ - - - MWMerge_MacOS_projectTypeApplication - MWMerge_MacOS_outputNamewx_PPC.rsrc - MWMerge_MacOS_outputCreatorRSED - MWMerge_MacOS_outputTypersrc - MWMerge_MacOS_suppressWarning0 - MWMerge_MacOS_copyFragments1 - MWMerge_MacOS_copyResources1 - MWMerge_MacOS_flattenResource0 - MWMerge_MacOS_flatFileNamea.rsrc - MWMerge_MacOS_flatFileOutputPath - Path: - PathFormatMacOS - PathRootProject - - MWMerge_MacOS_skipResources - DLGX - ckid - Proj - WSPC - - - - FileLockedfalse - ResourcesMapIsReadOnlyfalse - PrinterDriverIsMultiFinderCompatiblefalse - Invisiblefalse - HasBundlefalse - NameLockedfalse - Stationeryfalse - HasCustomIconfalse - Sharedfalse - HasBeenInitedfalse - Label0 - Comments - - - MWMacOSPackager_UsePackager0 - MWMacOSPackager_FolderToPackage - Path - PathFormatMacOS - PathRootAbsolute - - MWMacOSPackager_CreateClassicAlias0 - MWMacOSPackager_ClassicAliasMethodUseTargetOutput - MWMacOSPackager_ClassicAliasPath - Path - PathFormatGeneric - PathRootAbsolute - - MWMacOSPackager_CreatePkgInfo0 - MWMacOSPackager_PkgCreatorType???? - MWMacOSPackager_PkgFileTypeAPPL - - - MWCodeGen_PPC_structalignmentMC68K - MWCodeGen_PPC_tracebacktablesNone - MWCodeGen_PPC_processorGeneric - MWCodeGen_PPC_function_align4 - MWCodeGen_PPC_tocdata1 - MWCodeGen_PPC_largetoc0 - MWCodeGen_PPC_profiler0 - MWCodeGen_PPC_vectortocdata0 - MWCodeGen_PPC_poolconst0 - MWCodeGen_PPC_peephole1 - MWCodeGen_PPC_readonlystrings0 - MWCodeGen_PPC_linkerpoolsstrings0 - MWCodeGen_PPC_volatileasm0 - MWCodeGen_PPC_schedule0 - MWCodeGen_PPC_altivec0 - MWCodeGen_PPC_altivec_move_block0 - MWCodeGen_PPC_strictIEEEfp0 - MWCodeGen_PPC_fpcontract1 - MWCodeGen_PPC_genfsel0 - MWCodeGen_PPC_orderedfpcmp0 - - - MWCodeGen_MachO_structalignmentPPC_mw - MWCodeGen_MachO_profiler_enumOff - MWCodeGen_MachO_processorGeneric - MWCodeGen_MachO_function_align4 - MWCodeGen_MachO_common0 - MWCodeGen_MachO_peephole1 - MWCodeGen_MachO_readonlystrings0 - MWCodeGen_MachO_linkerpoolsstrings1 - MWCodeGen_MachO_volatileasm0 - MWCodeGen_MachO_schedule0 - MWCodeGen_MachO_altivec0 - MWCodeGen_MachO_vecmove0 - MWCodeGen_MachO_fp_ieee_strict0 - MWCodeGen_MachO_fpcontract1 - MWCodeGen_MachO_genfsel0 - MWCodeGen_MachO_fp_cmps_ordered0 - - - MWDisassembler_PPC_showcode1 - MWDisassembler_PPC_extended1 - MWDisassembler_PPC_mix0 - MWDisassembler_PPC_nohex0 - MWDisassembler_PPC_showdata1 - MWDisassembler_PPC_showexceptions1 - MWDisassembler_PPC_showsym0 - MWDisassembler_PPC_shownames1 - - - GlobalOptimizer_PPC_optimizationlevelLevel0 - GlobalOptimizer_PPC_optforSpeed - - - MWLinker_PPC_linksym1 - MWLinker_PPC_symfullpath1 - MWLinker_PPC_linkmap0 - MWLinker_PPC_nolinkwarnings0 - MWLinker_PPC_dontdeadstripinitcode0 - MWLinker_PPC_permitmultdefs0 - MWLinker_PPC_linkmodeFast - MWLinker_PPC_initname - MWLinker_PPC_mainname__start - MWLinker_PPC_termname - - - MWLinker_MacOSX_linksym0 - MWLinker_MacOSX_symfullpath0 - MWLinker_MacOSX_nolinkwarnings0 - MWLinker_MacOSX_linkmap0 - MWLinker_MacOSX_dontdeadstripinitcode0 - MWLinker_MacOSX_permitmultdefs1 - MWLinker_MacOSX_use_objectivec_semantics0 - MWLinker_MacOSX_strip_debug_symbols0 - MWLinker_MacOSX_split_segs0 - MWLinker_MacOSX_report_msl_overloads0 - MWLinker_MacOSX_objects_follow_linkorder0 - MWLinker_MacOSX_linkmodeFast - MWLinker_MacOSX_exportsReferencedGlobals - MWLinker_MacOSX_sortcodeNone - MWLinker_MacOSX_mainnamestart - - - MWProject_MacOSX_typeExecutable - MWProject_MacOSX_outfile - MWProject_MacOSX_filecreator???? - MWProject_MacOSX_filetypeMEXE - MWProject_MacOSX_vmaddress4096 - MWProject_MacOSX_usedefaultvmaddr1 - MWProject_MacOSX_flatrsrc0 - MWProject_MacOSX_flatrsrcfilename - MWProject_MacOSX_flatrsrcoutputdir - Path: - PathFormatMacOS - PathRootProject - - MWProject_MacOSX_installpath./ - MWProject_MacOSX_dont_prebind0 - MWProject_MacOSX_flat_namespace0 - MWProject_MacOSX_frameworkversionA - MWProject_MacOSX_currentversion0 - MWProject_MacOSX_flat_oldimpversion0 - - - MWLinker_MachO_exportsNone - MWLinker_MachO_mainnamestart - MWLinker_MachO_currentversion0 - MWLinker_MachO_compatibleversion0 - MWLinker_MachO_symfullpath0 - MWLinker_MachO_supresswarnings0 - MWLinker_MachO_multisymerror0 - MWLinker_MachO_prebind1 - MWLinker_MachO_deadstrip1 - MWLinker_MachO_objectivecsemantics0 - MWLinker_MachO_whichfileloaded0 - MWLinker_MachO_whyfileloaded0 - MWLinker_MachO_readonlyrelocsErrors - MWLinker_MachO_undefinedsymbolsErrors - MWLinker_MachO_twolevelnamespace1 - MWLinker_MachO_stripdebugsymbols0 - - - MWProject_MachO_typeExecutable - MWProject_MachO_outfilea.exe - MWProject_MachO_filecreator???? - MWProject_MachO_filetypeMEXE - MWProject_MachO_vmaddress4096 - MWProject_MachO_flatrsrc1 - MWProject_MachO_flatrsrcfilenamea.rsrc - MWProject_MachO_flatrsrcoutputdir - Path: - PathFormatMacOS - PathRootProject - - MWProject_MachO_installpath./ - MWProject_MachO_frameworkversion - - - MWPEF_exportsNone - MWPEF_libfolder0 - MWPEF_sortcodeNone - MWPEF_expandbss0 - MWPEF_sharedata0 - MWPEF_olddefversion0 - MWPEF_oldimpversion0 - MWPEF_currentversion0 - MWPEF_fragmentname - MWPEF_collapsereloads0 - - - MWProject_PPC_typeApplication - MWProject_PPC_outfilea.out - MWProject_PPC_filecreator???? - MWProject_PPC_filetypeAPPL - MWProject_PPC_size384 - MWProject_PPC_minsize384 - MWProject_PPC_stacksize64 - MWProject_PPC_flags22720 - MWProject_PPC_symfilename - MWProject_PPC_rsrcname - MWProject_PPC_rsrcheaderNative - MWProject_PPC_rsrctype???? - MWProject_PPC_rsrcid0 - MWProject_PPC_rsrcflags0 - MWProject_PPC_rsrcstore0 - MWProject_PPC_rsrcmerge0 - MWProject_PPC_flatrsrc0 - MWProject_PPC_flatrsrcoutputdir - Path: - PathFormatMacOS - PathRootProject - - MWProject_PPC_flatrsrcfilename - - - MWAssembler_PPC_auxheader0 - MWAssembler_PPC_symmodeMac - MWAssembler_PPC_dialectPPC - MWAssembler_PPC_prefixfile - MWAssembler_PPC_typecheck0 - MWAssembler_PPC_warnings0 - MWAssembler_PPC_casesensitive0 - - - PList_OutputTypeFile - PList_OutputEncodingUTF-8 - PList_Prefix - PList_FileFilenameInfo.plist - PList_FileDirectory - Path: - PathFormatMacOS - PathRootProject - - PList_ResourceTypeplst - PList_ResourceID0 - PList_ResourceName - - - MWRez_Language_maxwidth80 - MWRez_Language_scriptRoman - MWRez_Language_alignmentAlign1 - MWRez_Language_filtermodeFilterSkip - MWRez_Language_suppresswarnings0 - MWRez_Language_escapecontrolchars1 - MWRez_Language_prefixname - MWRez_Language_filteredtypes'CODE' 'DATA' 'PICT' - - - MWWinRC_prefixname - - - MWCodeGen_X86_processorGeneric - MWCodeGen_X86_alignmentbytes8 - MWCodeGen_X86_exceptionsZeroOverhead - MWCodeGen_X86_name_manglingMWWin32 - MWCodeGen_X86_use_extinst0 - MWCodeGen_X86_extinst_mmx0 - MWCodeGen_X86_extinst_3dnow0 - MWCodeGen_X86_use_mmx_3dnow_convention0 - MWCodeGen_X86_extinst_cmov0 - MWCodeGen_X86_extinst_sse0 - MWCodeGen_X86_extinst_sse20 - MWCodeGen_X86_intrinsics0 - MWCodeGen_X86_optimizeasm0 - MWCodeGen_X86_disableopts0 - MWCodeGen_X86_profile0 - MWLinker_X86_runtimeCustom - MWCodeGen_X86_readonlystrings0 - - - MWLinker_X86_subsysmajorid4 - MWLinker_X86_subsysminorid0 - MWCOFF_X86_opsysmajorid4 - MWCOFF_X86_opsysminorid0 - MWLinker_X86_usrmajorid0 - MWLinker_X86_usrminorid0 - MWProject_X86_maxstacksize1024 - MWProject_X86_minstacksize4 - MWProject_X86_size1024 - MWProject_X86_minsize4 - MWCOFF_X86_coff_flags0 - MWCOFF_X86_dll_flags0 - MWProject_X86_baseaddress4194304 - MWCOFF_X86_filealign512 - MWCOFF_X86_sectionalign4096 - - - PDisasmX86_showHeaderstrue - PDisasmX86_showSectHeaderstrue - PDisasmX86_showSymTabtrue - PDisasmX86_showCodetrue - PDisasmX86_showDatatrue - PDisasmX86_showDebugfalse - PDisasmX86_showExceptionsfalse - PDisasmX86_showRawfalse - PDisasmX86_showAllRawfalse - PDisasmX86_showSourcefalse - PDisasmX86_showRelocationtrue - PDisasmX86_showHextrue - PDisasmX86_showCommentsfalse - PDisasmX86_showSymDefstrue - PDisasmX86_unmanglefalse - PDisasmX86_verbosefalse - PDisasmX86_resolveRelocstrue - PDisasmX86_resolveLocalsfalse - - - MWDebugger_X86_Exceptions - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - - - - GlobalOptimizer_X86_optimizationlevelLevel0 - GlobalOptimizer_X86_optforSpeed - - - MWLinker_X86_entrypointusageDefault - MWLinker_X86_entrypoint - MWLinker_X86_subsystemWinGUI - MWLinker_X86_commandfile - MWLinker_X86_generatemap0 - MWLinker_X86_linksym0 - MWLinker_X86_linkCV1 - MWLinker_X86_symfullpathfalse - MWLinker_X86_linkdebugtrue - MWLinker_X86_checksumfalse - MWLinker_X86_zero_init_bssfalse - MWLinker_X86_mergedatafalse - MWLinker_X86_usedefaultlibsfalse - MWLinker_X86_adddefaultlibsfalse - MWLinker_X86_nowarningsfalse - MWLinker_X86_verbosefalse - - - MWProject_X86_typeApplication - MWProject_X86_outfileNONAME.EXE - MWProject_X86_importlib - MWProject_X86_setimportlibdirfalse - MWProject_X86_dontgenerateimportlibfalse - MWProject_X86_oldformatlibfalse - MWProject_X86_replaceobjextensionfalse - MWProject_X86_copyallfilesfalse - - - - Name - apprsrc.r - MacOS - Text - Debug - - - Name - corersrc.r - MacOS - Text - Debug - - - - - Name - apprsrc.r - MacOS - - - Name - corersrc.r - MacOS - - - - - wxlib PPC profile - - - - UserSourceTrees - - - AlwaysSearchUserPathstrue - InterpretDOSAndUnixPathstrue - RequireFrameworkStyleIncludesfalse - UserSearchPaths - - SearchPath - Path::include: - PathFormatMacOS - PathRootProject - - Recursivefalse - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path::art: - PathFormatMacOS - PathRootProject - - Recursivefalse - FrameworkPathfalse - HostFlagsAll - MacOS - - - SearchPath - Path:generic: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:mac:classic: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:common: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:regex: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:zlib: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:png: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:jpeg: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:iodbc: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:tiff: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:html: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Pathxml - PathFormatUnix - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Pathexpat/lib - PathFormatUnix - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SystemSearchPaths - - SearchPath - Path:MSL: - PathFormatMacOS - PathRootCodeWarrior - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:MacOS Support: - PathFormatMacOS - PathRootCodeWarrior - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - - - MWRuntimeSettings_WorkingDirectory - MWRuntimeSettings_CommandLine - MWRuntimeSettings_HostApplication - Path - PathFormatGeneric - PathRootAbsolute - - MWRuntimeSettings_EnvVars - - - LinkerMacOS PPC Linker - PreLinker - PostLinker - Targetnamewxlib PPC profile - OutputDirectory - Path::lib: - PathFormatMacOS - PathRootProject - - SaveEntriesUsingRelativePathstrue - - - FileMappings - - FileTypeAPPL - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypeAppl - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypeMMLB - FileExtension - CompilerLib Import PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeMPLF - FileExtension - CompilerLib Import PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeMWCD - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypeRSRC - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.bh - CompilerBalloon Help - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.c - CompilerMW C/C++ PPC - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.c++ - CompilerMW C/C++ PPC - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.cc - CompilerMW C/C++ PPC - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.cp - CompilerMW C/C++ PPC - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.cpp - CompilerMW C/C++ PPC - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.exp - Compiler - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.h - CompilerMW C/C++ PPC - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMaketrue - - - FileTypeTEXT - FileExtension.p - CompilerMW Pascal PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.pas - CompilerMW Pascal PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.pch - CompilerMW C/C++ PPC - EditLanguageC/C++ - Precompiletrue - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.pch++ - CompilerMW C/C++ PPC - EditLanguageC/C++ - Precompiletrue - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.ppu - CompilerMW Pascal PPC - EditLanguage - Precompiletrue - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.r - CompilerRez - EditLanguageRez - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.s - CompilerPPCAsm - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeXCOF - FileExtension - CompilerXCOFF Import PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypedocu - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypersrc - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypeshlb - FileExtension - CompilerPEF Import PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypestub - FileExtension - CompilerPEF Import PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileExtension.doc - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFilefalse - IgnoredByMaketrue - - - FileExtension.o - CompilerXCOFF Import PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileExtension.ppob - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileExtension.rsrc - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - - - CacheModDatestrue - DumpBrowserInfofalse - CacheSubprojectstrue - UseThirdPartyDebuggerfalse - BrowserGenerator1 - DebuggerAppPath - Path - PathFormatGeneric - PathRootAbsolute - - DebuggerCmdLineArgs - DebuggerWorkingDir - Path - PathFormatGeneric - PathRootAbsolute - - CodeCompletionPrefixFileNameMacHeaders.c - CodeCompletionMacroFileNameMacOS_Carbon_C++_Macros.h - - - ConsoleEncoding0 - LogSystemMessagestrue - AutoTargetDLLsfalse - StopAtWatchpointstrue - PauseWhileRunningfalse - PauseInterval5 - PauseUIFlags0 - AltExePath - Path - PathFormatGeneric - PathRootAbsolute - - StopAtTempBPOnLaunchtrue - CacheSymbolicstrue - TempBPFunctionNamemain - TempBPType0 - - - Enabledfalse - ConnectionName - DownloadPath - LaunchRemoteAppfalse - RemoteAppPath - CoreID0 - JTAGClockSpeed8000 - IsMultiCorefalse - OSDownloadfalse - UseGlobalOSDownloadfalse - OSDownloadConnectionName - OSDownloadPath - AltDownloadfalse - AltDownloadConnectionName - - - OtherExecutables - - - CustomColor1 - Red0 - Green32767 - Blue0 - - CustomColor2 - Red0 - Green32767 - Blue0 - - CustomColor3 - Red0 - Green32767 - Blue0 - - CustomColor4 - Red0 - Green32767 - Blue0 - - - - MWFrontEnd_C_cplusplus0 - MWFrontEnd_C_checkprotos0 - MWFrontEnd_C_arm0 - MWFrontEnd_C_trigraphs0 - MWFrontEnd_C_onlystdkeywords0 - MWFrontEnd_C_enumsalwaysint0 - MWFrontEnd_C_mpwpointerstyle1 - MWFrontEnd_C_prefixnamewx/wx_cw.h - MWFrontEnd_C_ansistrict0 - MWFrontEnd_C_mpwcnewline0 - MWFrontEnd_C_wchar_type1 - MWFrontEnd_C_enableexceptions1 - MWFrontEnd_C_dontreusestrings0 - MWFrontEnd_C_poolstrings0 - MWFrontEnd_C_dontinline0 - MWFrontEnd_C_useRTTI1 - MWFrontEnd_C_multibyteaware0 - MWFrontEnd_C_unsignedchars0 - MWFrontEnd_C_autoinline0 - MWFrontEnd_C_booltruefalse1 - MWFrontEnd_C_inlinelevel0 - MWFrontEnd_C_ecplusplus0 - MWFrontEnd_C_objective_c0 - MWFrontEnd_C_defer_codegen0 - MWFrontEnd_C_templateparser0 - MWFrontEnd_C_c990 - MWFrontEnd_C_bottomupinline1 - - - MWWarning_C_warn_illpragma0 - MWWarning_C_warn_emptydecl0 - MWWarning_C_warn_possunwant0 - MWWarning_C_warn_unusedvar0 - MWWarning_C_warn_unusedarg0 - MWWarning_C_warn_extracomma0 - MWWarning_C_pedantic0 - MWWarning_C_warningerrors0 - MWWarning_C_warn_hidevirtual0 - MWWarning_C_warn_implicitconv0 - MWWarning_C_warn_notinlined0 - MWWarning_C_warn_structclass0 - - - MWFTP_Post_hostName - MWFTP_Post_username - MWFTP_Post_password0ÿÄ@ž–@)t - MWFTP_Post_remoteDir - MWFTP_Post_ftp_PathVersion1 - MWFTP_Post_ftp_PathType0 - MWFTP_Post_ftp_PathFormat0 - MWFTP_Post_ftp_tree - MWFTP_Post_uploadDir - MWFTP_Post_ftp_port21 - MWFTP_Post_SendBin1 - MWFTP_Post_ShouldLog1 - - - MWCommandLine_Java_clsName - MWCommandLine_Java_args - - - MWVJavaDebugging_Protocol1 - MWVJavaDebugging_JDKVersion1 - MWVJavaDebugging_TimeOut10 - MWVJavaDebugging_SupportSlowDevicesfalse - MWVJavaDebugging_UseRemoteLaunchAgentfalse - MWVJavaDebugging_LaunchVMasServerfalse - - - MWJava_Language_optimizefalse - MWJava_Language_warnDeprecatedfalse - MWJava_Language_emitMapfalse - MWJava_Language_strictFileNamesfalse - MWJava_Language_strictFileHierarchyfalse - MWJava_Language_1_1_Compatiblefalse - MWJava_Language_emitHeaders0 - MWJava_Language_headerTypeJNINativeHeaders - MWJava_Language_packageFilter - MWJava_Language_genCommentstrue - MWJava_Language_genHeadersfalse - MWJava_Language_enableAssertsfalse - MWJava_Language_targetVM1.1 - - - Manifest-JAD Attributes - - AttributeMain-Class - ValueAuto-Generated - - - - - MWJava_MRJAppBuilder_outFileMRJApplication - MWJava_MRJAppBuilder_mergefalse - MWJava_MRJAppBuilder_quitMenutrue - MWJava_MRJAppBuilder_growfalse - MWJava_MRJAppBuilder_stdoutTypeConsole - MWJava_MRJAppBuilder_stderrTypeConsole - MWJava_MRJAppBuilder_stdinTypeConsole - MWJava_MRJAppBuilder_appIconPVersion0 - MWJava_MRJAppBuilder_appIconPType0 - MWJava_MRJAppBuilder_appIconPFormat0 - MWJava_MRJAppBuilder_appIconPTree - MWJava_MRJAppBuilder_appIconFile - MWJava_MRJAppBuilder_splashScreenPVersion0 - MWJava_MRJAppBuilder_splashScreenPType0 - MWJava_MRJAppBuilder_splashScreenPFormat0 - MWJava_MRJAppBuilder_splashScreenPTree - MWJava_MRJAppBuilder_splashScreenPICTFile - MWJava_MRJAppBuilder_aboutName - MWJava_MRJAppBuilder_stdoutPVersion0 - MWJava_MRJAppBuilder_stdoutPType0 - MWJava_MRJAppBuilder_stdoutPFormat0 - MWJava_MRJAppBuilder_stdoutPTree - MWJava_MRJAppBuilder_stdoutFile - MWJava_MRJAppBuilder_stdoutAppendfalse - MWJava_MRJAppBuilder_stderrPType0 - MWJava_MRJAppBuilder_stderrPFormat0 - MWJava_MRJAppBuilder_stderrPTree - MWJava_MRJAppBuilder_stderrFile - MWJava_MRJAppBuilder_stderrAppendfalse - MWJava_MRJAppBuilder_stdinPType0 - MWJava_MRJAppBuilder_stdinPFormat0 - MWJava_MRJAppBuilder_stdinPTree - MWJava_MRJAppBuilder_stdinFile - - - MWJava_Output_outputtypeJarFile - MWJava_Output_outfileJavaClasses.jar - MWJava_Output_ftype1514754080 - MWJava_Output_fcreator1297570384 - MWJava_Output_compress0 - MWJava_Output_genManifest0 - MWJava_Output_trunctypeFront - MWJava_Output_deleteClasses0 - MWJava_Output_consoleApp1 - MWJava_Output_preverify0 - MWJava_Output_genJad0 - MWJava_Output_obfuscate0 - - - MWJava_Proj_projtypeApplet - MWJava_Proj_mainClassName - MWJava_Proj_HTMLAppCreator1145457748 - MWJava_Proj_HTMLAppNameMetrowerks Java - MWJava_Proj_PathVersion1 - MWJava_Proj_PathType0 - MWJava_Proj_PathFormat0 - MWJava_Proj_tree - MWJava_Proj_HTMLAppWin32NameInternet Explorer - MWJava_Proj_compress0 - MWJava_Proj_simulator0 - MWJava_Proj_useVM\000\000macosx - MWJava_Proj_vmarguments - MWJava_Proj_vmName - MWJava_Proj_simPropFile - - - MWJavaDoc_Proj_Version1 - MWJavaDoc_Proj_Deprecated1 - MWJavaDoc_Proj_Author1 - MWJavaDoc_Proj_Index1 - MWJavaDoc_Proj_Tree1 - MWJavaDoc_Proj_SunResolveToSame0 - MWJavaDoc_Proj_Shortnames1 - MWJavaDoc_Proj_Folder0 - MWJavaDoc_Proj_GenerateAPILinks0 - MWJavaDoc_Proj_scopePublic - MWJavaDoc_Proj_fcreator1297303877 - MWJavaDoc_Proj_encodingName - MWJavaDoc_Proj_decodingName - MWJavaDoc_Proj_javaPackagePathhttp://java.sun.com/products/jdk/1.1/docs/api/ - - - MWMerge_MacOS_projectTypeApplication - MWMerge_MacOS_outputNameMerge Out - MWMerge_MacOS_outputCreator???? - MWMerge_MacOS_outputTypeAPPL - MWMerge_MacOS_suppressWarning0 - MWMerge_MacOS_copyFragments1 - MWMerge_MacOS_copyResources1 - MWMerge_MacOS_flattenResource0 - MWMerge_MacOS_flatFileNamea.rsrc - MWMerge_MacOS_flatFileOutputPath - Path: - PathFormatMacOS - PathRootProject - - MWMerge_MacOS_skipResources - DLGX - ckid - Proj - WSPC - - - - FileLockedfalse - ResourcesMapIsReadOnlyfalse - PrinterDriverIsMultiFinderCompatiblefalse - Invisiblefalse - HasBundlefalse - NameLockedfalse - Stationeryfalse - HasCustomIconfalse - Sharedfalse - HasBeenInitedfalse - Label0 - Comments - - - MWMacOSPackager_UsePackager0 - MWMacOSPackager_FolderToPackage - Path - PathFormatMacOS - PathRootAbsolute - - MWMacOSPackager_CreateClassicAlias0 - MWMacOSPackager_ClassicAliasMethodUseTargetOutput - MWMacOSPackager_ClassicAliasPath - Path - PathFormatMacOS - PathRootAbsolute - - MWMacOSPackager_CreatePkgInfo0 - MWMacOSPackager_PkgCreatorType???? - MWMacOSPackager_PkgFileTypeAPPL - - - MWCodeGen_PPC_structalignmentPPC_mw - MWCodeGen_PPC_tracebacktablesInline - MWCodeGen_PPC_processorGeneric - MWCodeGen_PPC_function_align4 - MWCodeGen_PPC_tocdata1 - MWCodeGen_PPC_largetoc0 - MWCodeGen_PPC_profiler1 - MWCodeGen_PPC_vectortocdata0 - MWCodeGen_PPC_poolconst0 - MWCodeGen_PPC_peephole1 - MWCodeGen_PPC_readonlystrings0 - MWCodeGen_PPC_linkerpoolsstrings0 - MWCodeGen_PPC_volatileasm0 - MWCodeGen_PPC_schedule0 - MWCodeGen_PPC_altivec0 - MWCodeGen_PPC_altivec_move_block0 - MWCodeGen_PPC_strictIEEEfp0 - MWCodeGen_PPC_fpcontract1 - MWCodeGen_PPC_genfsel0 - MWCodeGen_PPC_orderedfpcmp0 - - - MWCodeGen_MachO_structalignmentPPC_mw - MWCodeGen_MachO_profiler_enumOff - MWCodeGen_MachO_processorGeneric - MWCodeGen_MachO_function_align4 - MWCodeGen_MachO_common0 - MWCodeGen_MachO_peephole1 - MWCodeGen_MachO_readonlystrings0 - MWCodeGen_MachO_linkerpoolsstrings1 - MWCodeGen_MachO_volatileasm0 - MWCodeGen_MachO_schedule0 - MWCodeGen_MachO_altivec0 - MWCodeGen_MachO_vecmove0 - MWCodeGen_MachO_fp_ieee_strict0 - MWCodeGen_MachO_fpcontract1 - MWCodeGen_MachO_genfsel0 - MWCodeGen_MachO_fp_cmps_ordered0 - - - MWDisassembler_PPC_showcode1 - MWDisassembler_PPC_extended1 - MWDisassembler_PPC_mix0 - MWDisassembler_PPC_nohex0 - MWDisassembler_PPC_showdata1 - MWDisassembler_PPC_showexceptions1 - MWDisassembler_PPC_showsym0 - MWDisassembler_PPC_shownames1 - - - GlobalOptimizer_PPC_optimizationlevelLevel2 - GlobalOptimizer_PPC_optforSpeed - - - MWLinker_PPC_linksym1 - MWLinker_PPC_symfullpath1 - MWLinker_PPC_linkmap0 - MWLinker_PPC_nolinkwarnings0 - MWLinker_PPC_dontdeadstripinitcode1 - MWLinker_PPC_permitmultdefs0 - MWLinker_PPC_linkmodeFast - MWLinker_PPC_initname - MWLinker_PPC_mainname__start - MWLinker_PPC_termname - - - MWLinker_MacOSX_linksym0 - MWLinker_MacOSX_symfullpath0 - MWLinker_MacOSX_nolinkwarnings0 - MWLinker_MacOSX_linkmap0 - MWLinker_MacOSX_dontdeadstripinitcode0 - MWLinker_MacOSX_permitmultdefs1 - MWLinker_MacOSX_use_objectivec_semantics0 - MWLinker_MacOSX_strip_debug_symbols0 - MWLinker_MacOSX_split_segs0 - MWLinker_MacOSX_report_msl_overloads0 - MWLinker_MacOSX_objects_follow_linkorder0 - MWLinker_MacOSX_linkmodeFast - MWLinker_MacOSX_exportsReferencedGlobals - MWLinker_MacOSX_sortcodeNone - MWLinker_MacOSX_mainnamestart - - - MWProject_MacOSX_typeLibrary - MWProject_MacOSX_outfilewx_PPC_prof.lib - MWProject_MacOSX_filecreator???? - MWProject_MacOSX_filetype???? - MWProject_MacOSX_vmaddress0 - MWProject_MacOSX_usedefaultvmaddr1 - MWProject_MacOSX_flatrsrc0 - MWProject_MacOSX_flatrsrcfilename - MWProject_MacOSX_flatrsrcoutputdir - Path: - PathFormatMacOS - PathRootProject - - MWProject_MacOSX_installpath./ - MWProject_MacOSX_dont_prebind0 - MWProject_MacOSX_flat_namespace0 - MWProject_MacOSX_frameworkversionA - MWProject_MacOSX_currentversion0 - MWProject_MacOSX_flat_oldimpversion0 - - - MWLinker_MachO_exportsNone - MWLinker_MachO_mainnamestart - MWLinker_MachO_currentversion0 - MWLinker_MachO_compatibleversion0 - MWLinker_MachO_symfullpath0 - MWLinker_MachO_supresswarnings0 - MWLinker_MachO_multisymerror0 - MWLinker_MachO_prebind1 - MWLinker_MachO_deadstrip1 - MWLinker_MachO_objectivecsemantics0 - MWLinker_MachO_whichfileloaded0 - MWLinker_MachO_whyfileloaded0 - MWLinker_MachO_readonlyrelocsErrors - MWLinker_MachO_undefinedsymbolsErrors - MWLinker_MachO_twolevelnamespace1 - MWLinker_MachO_stripdebugsymbols0 - - - MWProject_MachO_typeExecutable - MWProject_MachO_outfilea.exe - MWProject_MachO_filecreator???? - MWProject_MachO_filetypeMEXE - MWProject_MachO_vmaddress4096 - MWProject_MachO_flatrsrc1 - MWProject_MachO_flatrsrcfilenamea.rsrc - MWProject_MachO_flatrsrcoutputdir - Path: - PathFormatMacOS - PathRootProject - - MWProject_MachO_installpath./ - MWProject_MachO_frameworkversion - - - MWPEF_exportsAll - MWPEF_libfolder0 - MWPEF_sortcodeNone - MWPEF_expandbss0 - MWPEF_sharedata0 - MWPEF_olddefversion0 - MWPEF_oldimpversion0 - MWPEF_currentversion0 - MWPEF_fragmentnamewxwin - MWPEF_collapsereloads0 - - - MWProject_PPC_typeLibrary - MWProject_PPC_outfilewx_PPC_prof.lib - MWProject_PPC_filecreator???? - MWProject_PPC_filetype???? - MWProject_PPC_size0 - MWProject_PPC_minsize0 - MWProject_PPC_stacksize0 - MWProject_PPC_flags0 - MWProject_PPC_symfilename - MWProject_PPC_rsrcname - MWProject_PPC_rsrcheaderNative - MWProject_PPC_rsrctype???? - MWProject_PPC_rsrcid0 - MWProject_PPC_rsrcflags0 - MWProject_PPC_rsrcstore0 - MWProject_PPC_rsrcmerge0 - MWProject_PPC_flatrsrc0 - MWProject_PPC_flatrsrcoutputdir - Path: - PathFormatMacOS - PathRootProject - - MWProject_PPC_flatrsrcfilename - - - MWAssembler_PPC_auxheader0 - MWAssembler_PPC_symmodeMac - MWAssembler_PPC_dialectPPC - MWAssembler_PPC_prefixfile - MWAssembler_PPC_typecheck0 - MWAssembler_PPC_warnings0 - MWAssembler_PPC_casesensitive0 - - - PList_OutputTypeFile - PList_OutputEncodingUTF-8 - PList_Prefix - PList_FileFilenameInfo.plist - PList_FileDirectory - Path: - PathFormatMacOS - PathRootProject - - PList_ResourceTypeplst - PList_ResourceID0 - PList_ResourceName - - - MWRez_Language_maxwidth80 - MWRez_Language_scriptRoman - MWRez_Language_alignmentAlign1 - MWRez_Language_filtermodeFilterSkip - MWRez_Language_suppresswarnings0 - MWRez_Language_escapecontrolchars1 - MWRez_Language_prefixname - MWRez_Language_filteredtypes'CODE' 'DATA' 'PICT' - - - MWWinRC_prefixname - - - MWCodeGen_X86_processorGeneric - MWCodeGen_X86_alignmentbytes8 - MWCodeGen_X86_exceptionsZeroOverhead - MWCodeGen_X86_name_manglingMWWin32 - MWCodeGen_X86_use_extinst0 - MWCodeGen_X86_extinst_mmx0 - MWCodeGen_X86_extinst_3dnow0 - MWCodeGen_X86_use_mmx_3dnow_convention0 - MWCodeGen_X86_extinst_cmov0 - MWCodeGen_X86_extinst_sse0 - MWCodeGen_X86_extinst_sse20 - MWCodeGen_X86_intrinsics0 - MWCodeGen_X86_optimizeasm0 - MWCodeGen_X86_disableopts0 - MWCodeGen_X86_profile0 - MWLinker_X86_runtimeCustom - MWCodeGen_X86_readonlystrings0 - - - MWLinker_X86_subsysmajorid4 - MWLinker_X86_subsysminorid0 - MWCOFF_X86_opsysmajorid4 - MWCOFF_X86_opsysminorid0 - MWLinker_X86_usrmajorid0 - MWLinker_X86_usrminorid0 - MWProject_X86_maxstacksize1024 - MWProject_X86_minstacksize4 - MWProject_X86_size1024 - MWProject_X86_minsize4 - MWCOFF_X86_coff_flags0 - MWCOFF_X86_dll_flags0 - MWProject_X86_baseaddress4194304 - MWCOFF_X86_filealign512 - MWCOFF_X86_sectionalign4096 - - - PDisasmX86_showHeaderstrue - PDisasmX86_showSectHeaderstrue - PDisasmX86_showSymTabtrue - PDisasmX86_showCodetrue - PDisasmX86_showDatatrue - PDisasmX86_showDebugfalse - PDisasmX86_showExceptionsfalse - PDisasmX86_showRawfalse - PDisasmX86_showAllRawfalse - PDisasmX86_showSourcefalse - PDisasmX86_showRelocationtrue - PDisasmX86_showHextrue - PDisasmX86_showCommentsfalse - PDisasmX86_showSymDefstrue - PDisasmX86_unmangletrue - PDisasmX86_verbosetrue - PDisasmX86_resolveRelocstrue - PDisasmX86_resolveLocalsfalse - - - MWDebugger_X86_Exceptions - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - - - - GlobalOptimizer_X86_optimizationlevelLevel0 - GlobalOptimizer_X86_optforSpeed - - - MWLinker_X86_entrypointusageDefault - MWLinker_X86_entrypoint - MWLinker_X86_subsystemWinGUI - MWLinker_X86_commandfile - MWLinker_X86_generatemap0 - MWLinker_X86_linksym1 - MWLinker_X86_linkCV1 - MWLinker_X86_symfullpathfalse - MWLinker_X86_linkdebugtrue - MWLinker_X86_checksumfalse - MWLinker_X86_zero_init_bssfalse - MWLinker_X86_mergedatafalse - MWLinker_X86_usedefaultlibsfalse - MWLinker_X86_adddefaultlibsfalse - MWLinker_X86_nowarningsfalse - MWLinker_X86_verbosefalse - - - MWProject_X86_typeLibrary - MWProject_X86_outfilewx_x86_d.lib - MWProject_X86_importlib - MWProject_X86_setimportlibdirfalse - MWProject_X86_dontgenerateimportlibfalse - MWProject_X86_oldformatlibfalse - MWProject_X86_replaceobjextensionfalse - MWProject_X86_copyallfilesfalse - - - - PathRelative - Project - :mac:classic: - :accel.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :app.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :bitmap.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :bmpbuttn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :brush.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :button.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :checkbox.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :checklst.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :choice.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :clipbrd.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :colordlg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :colour.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :combobox.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :control.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :cursor.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :data.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :dc.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :dcclient.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :dcmemory.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :dcscreen.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :dialog.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :dirdlg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :filedlg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :font.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :fontdlg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :frame.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :gauge.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :gdiobj.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :icon.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :joystick.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :listbox.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :main.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :mdi.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :menu.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :menuitem.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :metafile.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :minifram.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :msgdlg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :palette.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :pen.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :printdlg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :radiobox.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :radiobut.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :region.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :scrolbar.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :settings.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :slider.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :spinbutt.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :statbmp.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :statbox.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :stattext.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :tabctrl.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :textctrl.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :thread.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :timer.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :toolbar.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :utils.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :utilsexc.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :sound.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :window.cpp - MacOS - Text - Debug - - - PathRelative - Project - ::include: - :wx_cw.pch++ - MacOS - Text - Debug - - - PathRelative - Project - ::include: - :wx_cw.pch - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :pnghand.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :printmac.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :dcprint.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :uma.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :sckipc.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :matrix.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :tbarbase.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :imagjpeg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :longlong.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :docmdi.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :appcmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :utilscmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :dynlib.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :extended.c - MacOS - Text - Debug - - - PathRelative - Project - :common: - :unzip.c - MacOS - Text - Debug - - - PathRelative - Project - :common: - :sckstrm.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :zstream.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :process.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :docview.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :sizer.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :dobjcmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :imagall.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :imaggif.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :imagpcx.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :cmndata.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :ftp.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :menucmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :string.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :wfstream.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :stream.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :gdicmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :protocol.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :layout.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :valgen.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :intl.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :list.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :socket.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :hash.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :dlgcmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :gifdecod.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :filefn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :wincmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :wxchar.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :memory.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :mstream.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :lboxcmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :fs_inet.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :event.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :image.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :ipcbase.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :tokenzr.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :txtstrm.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :filesys.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :url.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :fs_zip.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :prntbase.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :dcbase.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :object.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :http.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :module.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :validate.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :file.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :config.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :fileconf.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :timercmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :framecmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :textfile.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :dynarray.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :choiccmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :helpbase.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :ctrlsub.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :ctrlcmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :strconv.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :sckfile.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :valtext.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :datstrm.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :sckaddr.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :variant.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :fontcmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :ffile.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :paper.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :clipcmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :imagpnm.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :imagpng.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :imagbmp.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :zipstrm.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :log.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :textcmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :laywin.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :busyinfo.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :listctrl.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :textdlgg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :colrdlgg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :tipdlg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :numdlgg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :sashwin.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :dcpsg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :panelg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :imaglist.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :tabg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :choicdgg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :wizard.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :progdlgg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :caret.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :statusbr.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :logg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :fontdlgg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :splitter.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :fontmap.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :geometry.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :fontutil.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :dataobj.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :m_list.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :m_tables.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :htmlwin.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :m_pre.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :m_image.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :htmprint.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :htmlfilt.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :htmlpars.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :htmltag.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :m_hline.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :winpars.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :htmlcell.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :m_layout.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :m_fonts.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :m_links.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :fontenum.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :datetime.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :encconv.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :mimecmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :gsocket.c - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :macnotfy.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :statbrma.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :tooltip.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :statlmac.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :imagtiff.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :treectlg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :notebmac.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :m_dflist.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :treebase.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :cshelp.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :dirmac.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :mimetmac.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :filename.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :spinctrl.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :glcanvas.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :xpmdecod.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :imagxpm.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :dirctrlg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :helpctrl.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :helpfrm.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :helpdata.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :tipwin.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :radiocmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :nbkbase.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :scrlwing.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :gaugecmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :containr.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :quantize.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :toplvcmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :toplevel.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :morefile:DirectoryCopy.c - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :morefile:Search.c - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :morefile:MoreFilesExtras.c - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :morefile:MoreFiles.c - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :morefile:MoreDesktopMgr.c - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :morefile:IterateDirectory.c - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :morefile:FullPath.c - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :morefile:FSpCompat.c - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :morefile:FileCopy.c - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :gridsel.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :grid.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :statbar.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :clntdata.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :textbuf.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :dragimgg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :calctrl.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :bmpbase.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :cmdline.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :cmdproc.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :dndcmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :dnd.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :dbgrid.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :dircmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :dseldlg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :dynload.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :effects.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :fddlgcmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :fs_mem.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :regex.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :sysopt.cpp - MacOS - Text - Debug - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:PPCLibraries:CursorDevicesGlue.o - MacOS - Library - Debug - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:PPCLibraries:OpenTptATalkPPC.o - MacOS - Library - Debug - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:PPCLibraries:CarbonAccessors.o - MacOS - Library - Debug - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:PPCLibraries:OpenTransportAppPPC.o - MacOS - Library - Debug - - - PathRelative - CodeWarrior - :MacOS Support: - :Libraries:Sources:PLStringFuncs:Libs:PLStringFuncsPPC.lib - MacOS - Library - Debug - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:PPCLibraries:OpenTptInetPPC.o - MacOS - Library - Debug - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:NavigationLib - MacOS - Library - Debug - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:ControlsLib - MacOS - Library - Debug - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:DialogsLib - MacOS - Library - Debug - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:WindowsLib - MacOS - Library - Debug - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:MenusLib - MacOS - Library - Debug - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:InterfaceLib - MacOS - Library - Debug - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:MathLib - MacOS - Library - Debug - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:AppearanceLib - MacOS - Library - Debug - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:InternetConfigLib - MacOS - Library - Debug - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:ThreadsLib - MacOS - Library - Debug - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:OpenTransportLib - MacOS - Library - Debug - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:OpenTptAppleTalkLib - MacOS - Library - Debug - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:OpenTptInternetLib - MacOS - Library - Debug - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:UTCUtils - MacOS - Library - Debug - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:TextCommon - MacOS - Library - Debug - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:Textension - MacOS - Library - Debug - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:ATSUnicodeLib - MacOS - Library - Debug - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:UnicodeConverter - MacOS - Library - Debug - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:TextEncodingConverter - MacOS - Library - Debug - - - PathRelative - CodeWarrior - :MacOS Support: - :Libraries:Runtime:Libs:MSL_All_PPC.Lib - MacOS - Library - Debug - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:DragLib - MacOS - Library - Debug - - - PathRelative - CodeWarrior - :MacOS Support: - :OpenGL:Libraries:OpenGLLibraryStub - MacOS - Library - Debug - - - PathRelative - Project - :common: - :imagiff.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :splash.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :fdrepdlg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :gridctrl.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :m_style.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :hashmap.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :dirdlgg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :iconbndl.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :artprov.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :artstd.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :imagfill.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :msgout.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :settcmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :popupcmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :printps.cpp - MacOS - Text - Debug - - - PathRelative - Project - :jpeg: - jpegM8.mcp - Unix - Project - - - - PathRelative - Project - :png: - pngM8.mcp - Unix - Project - - - - PathRelative - Project - :zlib: - zlibM8.mcp - Unix - Project - - - - PathRelative - Project - :tiff: - tiffM8.mcp - Unix - Project - - - - FileRelative - ../../lib/jpeg_PPC.lib - Unix - - PathRelative - Project - :jpeg: - jpegM8.mcp - Unix - - Library - Debug, TargetOutputFile - - - FileRelative - ../../lib/tif_PPC.lib - Unix - - PathRelative - Project - :tiff: - tiffM8.mcp - Unix - - Library - Debug, TargetOutputFile - - - FileRelative - ../../lib/zlib_PPC.lib - Unix - - PathRelative - Project - :zlib: - zlibM8.mcp - Unix - - Library - Debug, TargetOutputFile - - - FileRelative - ../../lib/png_PPC.lib - Unix - - PathRelative - Project - :png: - pngM8.mcp - Unix - - Library - Debug, TargetOutputFile - - - PathRelative - Project - :regex: - regexM8.mcp - Unix - Project - - - - FileRelative - ../../lib/regex_PPC.lib - Unix - - PathRelative - Project - :regex: - regexM8.mcp - Unix - - Library - Debug, TargetOutputFile - - - PathRelative - CodeWarrior - :MSL: - MSL_C/MSL_MacOS/Src/console.stubs.c - Unix - Text - Debug - - - PathRelative - Project - :common: - datacmn.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - rgncmn.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - accesscmn.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - dpycmn.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - taskbarcmn.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - fldlgcmn.cpp - Unix - Text - Debug - - - PathRelative - Project - :generic: - :selstore.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - appbase.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - fmapbase.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - stopwatch.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - init.cpp - Unix - Text - Debug - - - PathRelative - Project - :generic: - renderg.cpp - Unix - Text - Debug - - - PathRelative - Project - :mac:classic: - renderer.cpp - Unix - Text - Debug - - - PathRelative - Project - xml - xml.cpp - Unix - Text - Debug - - - PathRelative - Project - expat/lib - xmlparse.c - Unix - Text - Debug - - - PathRelative - Project - expat/lib - xmlrole.c - Unix - Text - Debug - - - PathRelative - Project - expat/lib - xmltok.c - Unix - Text - Debug - - - PathRelative - Project - :common: - rendcmn.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - bookctrl.cpp - Unix - Text - Debug - - - - - FileRelative - ../../lib/regex_PPC.lib - Unix - - PathRelative - Project - :regex: - regexM8.mcp - Unix - - - - FileRelative - ../../lib/png_PPC.lib - Unix - - PathRelative - Project - :png: - pngM8.mcp - Unix - - - - FileRelative - ../../lib/zlib_PPC.lib - Unix - - PathRelative - Project - :zlib: - zlibM8.mcp - Unix - - - - FileRelative - ../../lib/tif_PPC.lib - Unix - - PathRelative - Project - :tiff: - tiffM8.mcp - Unix - - - - FileRelative - ../../lib/jpeg_PPC.lib - Unix - - PathRelative - Project - :jpeg: - jpegM8.mcp - Unix - - - - PathRelative - Project - :mac:classic: - :accel.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :app.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :bitmap.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :bmpbuttn.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :brush.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :button.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :checkbox.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :checklst.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :choice.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :clipbrd.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :colordlg.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :colour.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :combobox.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :control.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :cursor.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :data.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :dc.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :dcclient.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :dcmemory.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :dcscreen.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :dialog.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :dirdlg.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :filedlg.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :font.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :fontdlg.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :frame.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :gauge.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :gdiobj.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :icon.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :joystick.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :listbox.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :main.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :mdi.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :menu.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :menuitem.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :metafile.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :minifram.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :msgdlg.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :palette.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :pen.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :printdlg.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :radiobox.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :radiobut.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :region.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :scrolbar.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :settings.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :slider.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :spinbutt.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :statbmp.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :statbox.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :stattext.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :tabctrl.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :textctrl.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :thread.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :timer.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :toolbar.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :utils.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :utilsexc.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :sound.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :window.cpp - MacOS - - - PathRelative - Project - ::include: - :wx_cw.pch++ - MacOS - - - PathRelative - Project - ::include: - :wx_cw.pch - MacOS - - - PathRelative - Project - :mac:classic: - :pnghand.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :printmac.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :dcprint.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :uma.cpp - MacOS - - - PathRelative - Project - :common: - :sckipc.cpp - MacOS - - - PathRelative - Project - :common: - :matrix.cpp - MacOS - - - PathRelative - Project - :common: - :tbarbase.cpp - MacOS - - - PathRelative - Project - :common: - :imagjpeg.cpp - MacOS - - - PathRelative - Project - :common: - :longlong.cpp - MacOS - - - PathRelative - Project - :common: - :docmdi.cpp - MacOS - - - PathRelative - Project - :common: - :appcmn.cpp - MacOS - - - PathRelative - Project - :common: - :utilscmn.cpp - MacOS - - - PathRelative - Project - :common: - :dynlib.cpp - MacOS - - - PathRelative - Project - :common: - :extended.c - MacOS - - - PathRelative - Project - :common: - :unzip.c - MacOS - - - PathRelative - Project - :common: - :sckstrm.cpp - MacOS - - - PathRelative - Project - :common: - :zstream.cpp - MacOS - - - PathRelative - Project - :common: - :process.cpp - MacOS - - - PathRelative - Project - :common: - :docview.cpp - MacOS - - - PathRelative - Project - :common: - :sizer.cpp - MacOS - - - PathRelative - Project - :common: - :dobjcmn.cpp - MacOS - - - PathRelative - Project - :common: - :imagall.cpp - MacOS - - - PathRelative - Project - :common: - :imaggif.cpp - MacOS - - - PathRelative - Project - :common: - :imagpcx.cpp - MacOS - - - PathRelative - Project - :common: - :cmndata.cpp - MacOS - - - PathRelative - Project - :common: - :ftp.cpp - MacOS - - - PathRelative - Project - :common: - :menucmn.cpp - MacOS - - - PathRelative - Project - :common: - :string.cpp - MacOS - - - PathRelative - Project - :common: - :wfstream.cpp - MacOS - - - PathRelative - Project - :common: - :stream.cpp - MacOS - - - PathRelative - Project - :common: - :gdicmn.cpp - MacOS - - - PathRelative - Project - :common: - :protocol.cpp - MacOS - - - PathRelative - Project - :common: - :layout.cpp - MacOS - - - PathRelative - Project - :common: - :valgen.cpp - MacOS - - - PathRelative - Project - :common: - :intl.cpp - MacOS - - - PathRelative - Project - :common: - :list.cpp - MacOS - - - PathRelative - Project - :common: - :socket.cpp - MacOS - - - PathRelative - Project - :common: - :hash.cpp - MacOS - - - PathRelative - Project - :common: - :dlgcmn.cpp - MacOS - - - PathRelative - Project - :common: - :gifdecod.cpp - MacOS - - - PathRelative - Project - :common: - :filefn.cpp - MacOS - - - PathRelative - Project - :common: - :wincmn.cpp - MacOS - - - PathRelative - Project - :common: - :wxchar.cpp - MacOS - - - PathRelative - Project - :common: - :memory.cpp - MacOS - - - PathRelative - Project - :common: - :mstream.cpp - MacOS - - - PathRelative - Project - :common: - :lboxcmn.cpp - MacOS - - - PathRelative - Project - :common: - :fs_inet.cpp - MacOS - - - PathRelative - Project - :common: - :event.cpp - MacOS - - - PathRelative - Project - :common: - :image.cpp - MacOS - - - PathRelative - Project - :common: - :ipcbase.cpp - MacOS - - - PathRelative - Project - :common: - :tokenzr.cpp - MacOS - - - PathRelative - Project - :common: - :txtstrm.cpp - MacOS - - - PathRelative - Project - :common: - :filesys.cpp - MacOS - - - PathRelative - Project - :common: - :url.cpp - MacOS - - - PathRelative - Project - :common: - :fs_zip.cpp - MacOS - - - PathRelative - Project - :common: - :prntbase.cpp - MacOS - - - PathRelative - Project - :common: - :dcbase.cpp - MacOS - - - PathRelative - Project - :common: - :object.cpp - MacOS - - - PathRelative - Project - :common: - :http.cpp - MacOS - - - PathRelative - Project - :common: - :module.cpp - MacOS - - - PathRelative - Project - :common: - :validate.cpp - MacOS - - - PathRelative - Project - :common: - :file.cpp - MacOS - - - PathRelative - Project - :common: - :config.cpp - MacOS - - - PathRelative - Project - :common: - :fileconf.cpp - MacOS - - - PathRelative - Project - :common: - :timercmn.cpp - MacOS - - - PathRelative - Project - :common: - :framecmn.cpp - MacOS - - - PathRelative - Project - :common: - :textfile.cpp - MacOS - - - PathRelative - Project - :common: - :dynarray.cpp - MacOS - - - PathRelative - Project - :common: - :choiccmn.cpp - MacOS - - - PathRelative - Project - :common: - :helpbase.cpp - MacOS - - - PathRelative - Project - :common: - :ctrlsub.cpp - MacOS - - - PathRelative - Project - :common: - :ctrlcmn.cpp - MacOS - - - PathRelative - Project - :common: - :strconv.cpp - MacOS - - - PathRelative - Project - :common: - :sckfile.cpp - MacOS - - - PathRelative - Project - :common: - :valtext.cpp - MacOS - - - PathRelative - Project - :common: - :datstrm.cpp - MacOS - - - PathRelative - Project - :common: - :sckaddr.cpp - MacOS - - - PathRelative - Project - :common: - :variant.cpp - MacOS - - - PathRelative - Project - :common: - :fontcmn.cpp - MacOS - - - PathRelative - Project - :common: - :ffile.cpp - MacOS - - - PathRelative - Project - :common: - :paper.cpp - MacOS - - - PathRelative - Project - :common: - :clipcmn.cpp - MacOS - - - PathRelative - Project - :common: - :imagpnm.cpp - MacOS - - - PathRelative - Project - :common: - :imagpng.cpp - MacOS - - - PathRelative - Project - :common: - :imagbmp.cpp - MacOS - - - PathRelative - Project - :common: - :zipstrm.cpp - MacOS - - - PathRelative - Project - :common: - :log.cpp - MacOS - - - PathRelative - Project - :common: - :textcmn.cpp - MacOS - - - PathRelative - Project - :generic: - :laywin.cpp - MacOS - - - PathRelative - Project - :generic: - :busyinfo.cpp - MacOS - - - PathRelative - Project - :generic: - :listctrl.cpp - MacOS - - - PathRelative - Project - :generic: - :textdlgg.cpp - MacOS - - - PathRelative - Project - :generic: - :colrdlgg.cpp - MacOS - - - PathRelative - Project - :generic: - :tipdlg.cpp - MacOS - - - PathRelative - Project - :generic: - :numdlgg.cpp - MacOS - - - PathRelative - Project - :generic: - :sashwin.cpp - MacOS - - - PathRelative - Project - :generic: - :dcpsg.cpp - MacOS - - - PathRelative - Project - :generic: - :panelg.cpp - MacOS - - - PathRelative - Project - :generic: - :imaglist.cpp - MacOS - - - PathRelative - Project - :generic: - :tabg.cpp - MacOS - - - PathRelative - Project - :generic: - :choicdgg.cpp - MacOS - - - PathRelative - Project - :generic: - :wizard.cpp - MacOS - - - PathRelative - Project - :generic: - :progdlgg.cpp - MacOS - - - PathRelative - Project - :generic: - :caret.cpp - MacOS - - - PathRelative - Project - :generic: - :statusbr.cpp - MacOS - - - PathRelative - Project - :generic: - :logg.cpp - MacOS - - - PathRelative - Project - :generic: - :fontdlgg.cpp - MacOS - - - PathRelative - Project - :generic: - :splitter.cpp - MacOS - - - PathRelative - Project - :common: - :fontmap.cpp - MacOS - - - PathRelative - Project - :common: - :geometry.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :fontutil.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :dataobj.cpp - MacOS - - - PathRelative - Project - :html: - :m_list.cpp - MacOS - - - PathRelative - Project - :html: - :m_tables.cpp - MacOS - - - PathRelative - Project - :html: - :htmlwin.cpp - MacOS - - - PathRelative - Project - :html: - :m_pre.cpp - MacOS - - - PathRelative - Project - :html: - :m_image.cpp - MacOS - - - PathRelative - Project - :html: - :htmprint.cpp - MacOS - - - PathRelative - Project - :html: - :htmlfilt.cpp - MacOS - - - PathRelative - Project - :html: - :htmlpars.cpp - MacOS - - - PathRelative - Project - :html: - :htmltag.cpp - MacOS - - - PathRelative - Project - :html: - :m_hline.cpp - MacOS - - - PathRelative - Project - :html: - :winpars.cpp - MacOS - - - PathRelative - Project - :html: - :htmlcell.cpp - MacOS - - - PathRelative - Project - :html: - :m_layout.cpp - MacOS - - - PathRelative - Project - :html: - :m_fonts.cpp - MacOS - - - PathRelative - Project - :html: - :m_links.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :fontenum.cpp - MacOS - - - PathRelative - Project - :common: - :datetime.cpp - MacOS - - - PathRelative - Project - :common: - :encconv.cpp - MacOS - - - PathRelative - Project - :common: - :mimecmn.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :gsocket.c - MacOS - - - PathRelative - Project - :mac:classic: - :macnotfy.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :statbrma.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :tooltip.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :statlmac.cpp - MacOS - - - PathRelative - Project - :common: - :imagtiff.cpp - MacOS - - - PathRelative - Project - :generic: - :treectlg.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :notebmac.cpp - MacOS - - - PathRelative - Project - :html: - :m_dflist.cpp - MacOS - - - PathRelative - Project - :common: - :treebase.cpp - MacOS - - - PathRelative - Project - :common: - :cshelp.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :dirmac.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :mimetmac.cpp - MacOS - - - PathRelative - Project - :common: - :filename.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :spinctrl.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :glcanvas.cpp - MacOS - - - PathRelative - Project - :common: - :xpmdecod.cpp - MacOS - - - PathRelative - Project - :common: - :imagxpm.cpp - MacOS - - - PathRelative - Project - :generic: - :dirctrlg.cpp - MacOS - - - PathRelative - Project - :html: - :helpctrl.cpp - MacOS - - - PathRelative - Project - :html: - :helpfrm.cpp - MacOS - - - PathRelative - Project - :html: - :helpdata.cpp - MacOS - - - PathRelative - Project - :generic: - :tipwin.cpp - MacOS - - - PathRelative - Project - :common: - :radiocmn.cpp - MacOS - - - PathRelative - Project - :common: - :nbkbase.cpp - MacOS - - - PathRelative - Project - :generic: - :scrlwing.cpp - MacOS - - - PathRelative - Project - :common: - :gaugecmn.cpp - MacOS - - - PathRelative - Project - :common: - :containr.cpp - MacOS - - - PathRelative - Project - :common: - :quantize.cpp - MacOS - - - PathRelative - Project - :common: - :toplvcmn.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :toplevel.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :morefile:DirectoryCopy.c - MacOS - - - PathRelative - Project - :mac:classic: - :morefile:Search.c - MacOS - - - PathRelative - Project - :mac:classic: - :morefile:MoreFilesExtras.c - MacOS - - - PathRelative - Project - :mac:classic: - :morefile:MoreFiles.c - MacOS - - - PathRelative - Project - :mac:classic: - :morefile:MoreDesktopMgr.c - MacOS - - - PathRelative - Project - :mac:classic: - :morefile:IterateDirectory.c - MacOS - - - PathRelative - Project - :mac:classic: - :morefile:FullPath.c - MacOS - - - PathRelative - Project - :mac:classic: - :morefile:FSpCompat.c - MacOS - - - PathRelative - Project - :mac:classic: - :morefile:FileCopy.c - MacOS - - - PathRelative - Project - :generic: - :gridsel.cpp - MacOS - - - PathRelative - Project - :generic: - :grid.cpp - MacOS - - - PathRelative - Project - :common: - :statbar.cpp - MacOS - - - PathRelative - Project - :common: - :clntdata.cpp - MacOS - - - PathRelative - Project - :common: - :textbuf.cpp - MacOS - - - PathRelative - Project - :generic: - :dragimgg.cpp - MacOS - - - PathRelative - Project - :generic: - :calctrl.cpp - MacOS - - - PathRelative - Project - :common: - :bmpbase.cpp - MacOS - - - PathRelative - Project - :common: - :cmdline.cpp - MacOS - - - PathRelative - Project - :common: - :cmdproc.cpp - MacOS - - - PathRelative - Project - :common: - :dndcmn.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :dnd.cpp - MacOS - - - PathRelative - Project - :common: - :dbgrid.cpp - MacOS - - - PathRelative - Project - :common: - :dircmn.cpp - MacOS - - - PathRelative - Project - :common: - :dseldlg.cpp - MacOS - - - PathRelative - Project - :common: - :dynload.cpp - MacOS - - - PathRelative - Project - :common: - :effects.cpp - MacOS - - - PathRelative - Project - :common: - :fddlgcmn.cpp - MacOS - - - PathRelative - Project - :common: - :fs_mem.cpp - MacOS - - - PathRelative - Project - :common: - :regex.cpp - MacOS - - - PathRelative - Project - :common: - :sysopt.cpp - MacOS - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:PPCLibraries:CursorDevicesGlue.o - MacOS - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:PPCLibraries:OpenTptATalkPPC.o - MacOS - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:PPCLibraries:CarbonAccessors.o - MacOS - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:PPCLibraries:OpenTransportAppPPC.o - MacOS - - - PathRelative - CodeWarrior - :MacOS Support: - :Libraries:Sources:PLStringFuncs:Libs:PLStringFuncsPPC.lib - MacOS - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:PPCLibraries:OpenTptInetPPC.o - MacOS - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:NavigationLib - MacOS - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:ControlsLib - MacOS - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:DialogsLib - MacOS - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:WindowsLib - MacOS - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:MenusLib - MacOS - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:InterfaceLib - MacOS - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:MathLib - MacOS - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:AppearanceLib - MacOS - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:InternetConfigLib - MacOS - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:ThreadsLib - MacOS - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:OpenTransportLib - MacOS - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:OpenTptAppleTalkLib - MacOS - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:OpenTptInternetLib - MacOS - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:UTCUtils - MacOS - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:TextCommon - MacOS - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:Textension - MacOS - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:ATSUnicodeLib - MacOS - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:UnicodeConverter - MacOS - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:TextEncodingConverter - MacOS - - - PathRelative - CodeWarrior - :MSL: - MSL_C/MSL_MacOS/Src/console.stubs.c - Unix - - - PathRelative - CodeWarrior - :MacOS Support: - :Libraries:Runtime:Libs:MSL_All_PPC.Lib - MacOS - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:DragLib - MacOS - - - PathRelative - CodeWarrior - :MacOS Support: - :OpenGL:Libraries:OpenGLLibraryStub - MacOS - - - PathRelative - Project - :common: - :imagiff.cpp - MacOS - - - PathRelative - Project - :generic: - :splash.cpp - MacOS - - - PathRelative - Project - :generic: - :fdrepdlg.cpp - MacOS - - - PathRelative - Project - :generic: - :gridctrl.cpp - MacOS - - - PathRelative - Project - :html: - :m_style.cpp - MacOS - - - PathRelative - Project - :common: - :hashmap.cpp - MacOS - - - PathRelative - Project - :generic: - :dirdlgg.cpp - MacOS - - - PathRelative - Project - :common: - :iconbndl.cpp - MacOS - - - PathRelative - Project - :common: - :artprov.cpp - MacOS - - - PathRelative - Project - :common: - :artstd.cpp - MacOS - - - PathRelative - Project - :common: - :msgout.cpp - MacOS - - - PathRelative - Project - :common: - :settcmn.cpp - MacOS - - - PathRelative - Project - :common: - :popupcmn.cpp - MacOS - - - PathRelative - Project - :generic: - :printps.cpp - MacOS - - - PathRelative - Project - :common: - :imagfill.cpp - MacOS - - - PathRelative - Project - :common: - datacmn.cpp - Unix - - - PathRelative - Project - :common: - rgncmn.cpp - Unix - - - PathRelative - Project - :common: - accesscmn.cpp - Unix - - - PathRelative - Project - :common: - dpycmn.cpp - Unix - - - PathRelative - Project - :common: - taskbarcmn.cpp - Unix - - - PathRelative - Project - :common: - fldlgcmn.cpp - Unix - - - PathRelative - Project - :generic: - :selstore.cpp - MacOS - - - PathRelative - Project - :common: - appbase.cpp - Unix - - - PathRelative - Project - :common: - fmapbase.cpp - Unix - - - PathRelative - Project - :common: - stopwatch.cpp - Unix - - - PathRelative - Project - :common: - init.cpp - Unix - - - PathRelative - Project - :generic: - renderg.cpp - Unix - - - PathRelative - Project - :mac:classic: - renderer.cpp - Unix - - - PathRelative - Project - xml - xml.cpp - Unix - - - PathRelative - Project - expat/lib - xmlparse.c - Unix - - - PathRelative - Project - expat/lib - xmlrole.c - Unix - - - PathRelative - Project - expat/lib - xmltok.c - Unix - - - PathRelative - Project - :common: - rendcmn.cpp - Unix - - - PathRelative - Project - :common: - bookctrl.cpp - Unix - - - - - - PathRelative - Project - :jpeg: - jpegM8.mcp - Unix - - - - PPC - LinkAgainst - - FileRelative - ../../lib/jpeg_PPC.lib - Unix - - PathRelative - Project - :jpeg: - jpegM8.mcp - Unix - - - - - - - - PathRelative - Project - :png: - pngM8.mcp - Unix - - - - PPC - LinkAgainst - - FileRelative - ../../lib/png_PPC.lib - Unix - - PathRelative - Project - :png: - pngM8.mcp - Unix - - - - - - - - PathRelative - Project - :zlib: - zlibM8.mcp - Unix - - - - PPC - LinkAgainst - - FileRelative - ../../lib/zlib_PPC.lib - Unix - - PathRelative - Project - :zlib: - zlibM8.mcp - Unix - - - - - - - - PathRelative - Project - :tiff: - tiffM8.mcp - Unix - - - - PPC - LinkAgainst - - FileRelative - ../../lib/tif_PPC.lib - Unix - - PathRelative - Project - :tiff: - tiffM8.mcp - Unix - - - - - - - - PathRelative - Project - :regex: - regexM8.mcp - Unix - - - - PPC - LinkAgainst - - FileRelative - ../../lib/regex_PPC.lib - Unix - - PathRelative - Project - :regex: - regexM8.mcp - Unix - - - - - - - - - wxshlb PPC debug - - - - UserSourceTrees - - - AlwaysSearchUserPathstrue - InterpretDOSAndUnixPathstrue - RequireFrameworkStyleIncludesfalse - UserSearchPaths - - SearchPath - Path::include: - PathFormatMacOS - PathRootProject - - Recursivefalse - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path::art: - PathFormatMacOS - PathRootProject - - Recursivefalse - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:generic: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:mac:classic: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:common: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:regex: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:zlib: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:png: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:jpeg: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:iodbc: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:tiff: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:html: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Pathxml - PathFormatUnix - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Pathexpat/lib - PathFormatUnix - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SystemSearchPaths - - SearchPath - Path:MSL: - PathFormatMacOS - PathRootCodeWarrior - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:MacOS Support: - PathFormatMacOS - PathRootCodeWarrior - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - - - MWRuntimeSettings_WorkingDirectory - MWRuntimeSettings_CommandLine - MWRuntimeSettings_HostApplication - Path - PathFormatGeneric - PathRootAbsolute - - MWRuntimeSettings_EnvVars - - - LinkerMacOS PPC Linker - PreLinker - PostLinker - Targetnamewxshlb PPC debug - OutputDirectory - Path::lib: - PathFormatMacOS - PathRootProject - - SaveEntriesUsingRelativePathstrue - - - FileMappings - - FileTypeAPPL - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypeAppl - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypeMMLB - FileExtension - CompilerLib Import PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeMPLF - FileExtension - CompilerLib Import PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeMWCD - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypeRSRC - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.bh - CompilerBalloon Help - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.c - CompilerMW C/C++ PPC - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.c++ - CompilerMW C/C++ PPC - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.cc - CompilerMW C/C++ PPC - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.cp - CompilerMW C/C++ PPC - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.cpp - CompilerMW C/C++ PPC - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.exp - Compiler - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.h - CompilerMW C/C++ PPC - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMaketrue - - - FileTypeTEXT - FileExtension.p - CompilerMW Pascal PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.pas - CompilerMW Pascal PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.pch - CompilerMW C/C++ PPC - EditLanguageC/C++ - Precompiletrue - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.pch++ - CompilerMW C/C++ PPC - EditLanguageC/C++ - Precompiletrue - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.ppu - CompilerMW Pascal PPC - EditLanguage - Precompiletrue - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.r - CompilerRez - EditLanguageRez - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.s - CompilerPPCAsm - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeXCOF - FileExtension - CompilerXCOFF Import PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeXPM - FileExtension.xpm - CompilerMW C/C++ PPC - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypedocu - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypersrc - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypeshlb - FileExtension - CompilerPEF Import PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypestub - FileExtension - CompilerPEF Import PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileExtension.doc - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFilefalse - IgnoredByMaketrue - - - FileExtension.o - CompilerXCOFF Import PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileExtension.ppob - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileExtension.rsrc - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - - - CacheModDatestrue - DumpBrowserInfofalse - CacheSubprojectstrue - UseThirdPartyDebuggerfalse - BrowserGenerator1 - DebuggerAppPath - Path - PathFormatGeneric - PathRootAbsolute - - DebuggerCmdLineArgs - DebuggerWorkingDir - Path - PathFormatGeneric - PathRootAbsolute - - CodeCompletionPrefixFileNameMacHeaders.c - CodeCompletionMacroFileNameMacOS_Carbon_C++_Macros.h - - - ConsoleEncoding0 - LogSystemMessagestrue - AutoTargetDLLsfalse - StopAtWatchpointstrue - PauseWhileRunningfalse - PauseInterval5 - PauseUIFlags0 - AltExePath - Path - PathFormatGeneric - PathRootAbsolute - - StopAtTempBPOnLaunchtrue - CacheSymbolicstrue - TempBPFunctionNamemain - TempBPType0 - - - Enabledfalse - ConnectionName - DownloadPath - LaunchRemoteAppfalse - RemoteAppPath - CoreID0 - JTAGClockSpeed8000 - IsMultiCorefalse - OSDownloadfalse - UseGlobalOSDownloadfalse - OSDownloadConnectionName - OSDownloadPath - AltDownloadfalse - AltDownloadConnectionName - - - OtherExecutables - - - CustomColor1 - Red0 - Green32767 - Blue0 - - CustomColor2 - Red0 - Green32767 - Blue0 - - CustomColor3 - Red0 - Green32767 - Blue0 - - CustomColor4 - Red0 - Green32767 - Blue0 - - - - MWFrontEnd_C_cplusplus0 - MWFrontEnd_C_checkprotos0 - MWFrontEnd_C_arm0 - MWFrontEnd_C_trigraphs0 - MWFrontEnd_C_onlystdkeywords0 - MWFrontEnd_C_enumsalwaysint0 - MWFrontEnd_C_mpwpointerstyle1 - MWFrontEnd_C_prefixnamewx/wxshlb_cw_d.h - MWFrontEnd_C_ansistrict0 - MWFrontEnd_C_mpwcnewline0 - MWFrontEnd_C_wchar_type1 - MWFrontEnd_C_enableexceptions1 - MWFrontEnd_C_dontreusestrings0 - MWFrontEnd_C_poolstrings0 - MWFrontEnd_C_dontinline0 - MWFrontEnd_C_useRTTI1 - MWFrontEnd_C_multibyteaware0 - MWFrontEnd_C_unsignedchars1 - MWFrontEnd_C_autoinline0 - MWFrontEnd_C_booltruefalse1 - MWFrontEnd_C_inlinelevel0 - MWFrontEnd_C_ecplusplus0 - MWFrontEnd_C_objective_c0 - MWFrontEnd_C_defer_codegen0 - MWFrontEnd_C_templateparser0 - MWFrontEnd_C_c990 - MWFrontEnd_C_bottomupinline1 - - - MWWarning_C_warn_illpragma1 - MWWarning_C_warn_emptydecl0 - MWWarning_C_warn_possunwant0 - MWWarning_C_warn_unusedvar0 - MWWarning_C_warn_unusedarg0 - MWWarning_C_warn_extracomma0 - MWWarning_C_pedantic1 - MWWarning_C_warningerrors0 - MWWarning_C_warn_hidevirtual1 - MWWarning_C_warn_implicitconv0 - MWWarning_C_warn_notinlined0 - MWWarning_C_warn_structclass1 - - - MWFTP_Post_hostName - MWFTP_Post_username - MWFTP_Post_password0ÿÄ@ž–@)t - MWFTP_Post_remoteDir - MWFTP_Post_ftp_PathVersion1 - MWFTP_Post_ftp_PathType0 - MWFTP_Post_ftp_PathFormat0 - MWFTP_Post_ftp_tree - MWFTP_Post_uploadDir - MWFTP_Post_ftp_port21 - MWFTP_Post_SendBin1 - MWFTP_Post_ShouldLog1 - - - MWCommandLine_Java_clsName - MWCommandLine_Java_args - - - MWVJavaDebugging_Protocol1 - MWVJavaDebugging_JDKVersion1 - MWVJavaDebugging_TimeOut10 - MWVJavaDebugging_SupportSlowDevicesfalse - MWVJavaDebugging_UseRemoteLaunchAgentfalse - MWVJavaDebugging_LaunchVMasServerfalse - - - MWJava_Language_optimizefalse - MWJava_Language_warnDeprecatedfalse - MWJava_Language_emitMapfalse - MWJava_Language_strictFileNamesfalse - MWJava_Language_strictFileHierarchyfalse - MWJava_Language_1_1_Compatiblefalse - MWJava_Language_emitHeaders0 - MWJava_Language_headerTypeJNINativeHeaders - MWJava_Language_packageFilter - MWJava_Language_genCommentstrue - MWJava_Language_genHeadersfalse - MWJava_Language_enableAssertsfalse - MWJava_Language_targetVM1.1 - - - Manifest-JAD Attributes - - AttributeMain-Class - ValueAuto-Generated - - - - - MWJava_MRJAppBuilder_outFileMRJApplication - MWJava_MRJAppBuilder_mergefalse - MWJava_MRJAppBuilder_quitMenutrue - MWJava_MRJAppBuilder_growfalse - MWJava_MRJAppBuilder_stdoutTypeConsole - MWJava_MRJAppBuilder_stderrTypeConsole - MWJava_MRJAppBuilder_stdinTypeConsole - MWJava_MRJAppBuilder_appIconPVersion0 - MWJava_MRJAppBuilder_appIconPType0 - MWJava_MRJAppBuilder_appIconPFormat0 - MWJava_MRJAppBuilder_appIconPTree - MWJava_MRJAppBuilder_appIconFile - MWJava_MRJAppBuilder_splashScreenPVersion0 - MWJava_MRJAppBuilder_splashScreenPType0 - MWJava_MRJAppBuilder_splashScreenPFormat0 - MWJava_MRJAppBuilder_splashScreenPTree - MWJava_MRJAppBuilder_splashScreenPICTFile - MWJava_MRJAppBuilder_aboutName - MWJava_MRJAppBuilder_stdoutPVersion0 - MWJava_MRJAppBuilder_stdoutPType0 - MWJava_MRJAppBuilder_stdoutPFormat0 - MWJava_MRJAppBuilder_stdoutPTree - MWJava_MRJAppBuilder_stdoutFile - MWJava_MRJAppBuilder_stdoutAppendfalse - MWJava_MRJAppBuilder_stderrPType0 - MWJava_MRJAppBuilder_stderrPFormat0 - MWJava_MRJAppBuilder_stderrPTree - MWJava_MRJAppBuilder_stderrFile - MWJava_MRJAppBuilder_stderrAppendfalse - MWJava_MRJAppBuilder_stdinPType0 - MWJava_MRJAppBuilder_stdinPFormat0 - MWJava_MRJAppBuilder_stdinPTree - MWJava_MRJAppBuilder_stdinFile - - - MWJava_Output_outputtypeJarFile - MWJava_Output_outfileJavaClasses.jar - MWJava_Output_ftype1514754080 - MWJava_Output_fcreator1297570384 - MWJava_Output_compress0 - MWJava_Output_genManifest0 - MWJava_Output_trunctypeFront - MWJava_Output_deleteClasses0 - MWJava_Output_consoleApp1 - MWJava_Output_preverify0 - MWJava_Output_genJad0 - MWJava_Output_obfuscate0 - - - MWJava_Proj_projtypeApplet - MWJava_Proj_mainClassName - MWJava_Proj_HTMLAppCreator1145457748 - MWJava_Proj_HTMLAppNameMetrowerks Java - MWJava_Proj_PathVersion1 - MWJava_Proj_PathType0 - MWJava_Proj_PathFormat0 - MWJava_Proj_tree - MWJava_Proj_HTMLAppWin32NameInternet Explorer - MWJava_Proj_compress0 - MWJava_Proj_simulator0 - MWJava_Proj_useVM\000\000macosx - MWJava_Proj_vmarguments - MWJava_Proj_vmName - MWJava_Proj_simPropFile - - - MWJavaDoc_Proj_Version1 - MWJavaDoc_Proj_Deprecated1 - MWJavaDoc_Proj_Author1 - MWJavaDoc_Proj_Index1 - MWJavaDoc_Proj_Tree1 - MWJavaDoc_Proj_SunResolveToSame0 - MWJavaDoc_Proj_Shortnames1 - MWJavaDoc_Proj_Folder0 - MWJavaDoc_Proj_GenerateAPILinks0 - MWJavaDoc_Proj_scopePublic - MWJavaDoc_Proj_fcreator1297303877 - MWJavaDoc_Proj_encodingName - MWJavaDoc_Proj_decodingName - MWJavaDoc_Proj_javaPackagePathhttp://java.sun.com/products/jdk/1.1/docs/api/ - - - MWMerge_MacOS_projectTypeApplication - MWMerge_MacOS_outputNameMerge Out - MWMerge_MacOS_outputCreator???? - MWMerge_MacOS_outputTypeAPPL - MWMerge_MacOS_suppressWarning0 - MWMerge_MacOS_copyFragments1 - MWMerge_MacOS_copyResources1 - MWMerge_MacOS_flattenResource0 - MWMerge_MacOS_flatFileNamea.rsrc - MWMerge_MacOS_flatFileOutputPath - Path: - PathFormatMacOS - PathRootProject - - MWMerge_MacOS_skipResources - DLGX - ckid - Proj - WSPC - - - - FileLockedfalse - ResourcesMapIsReadOnlyfalse - PrinterDriverIsMultiFinderCompatiblefalse - Invisiblefalse - HasBundlefalse - NameLockedfalse - Stationeryfalse - HasCustomIconfalse - Sharedfalse - HasBeenInitedfalse - Label0 - Comments - - - MWMacOSPackager_UsePackager0 - MWMacOSPackager_FolderToPackage - Path - PathFormatMacOS - PathRootAbsolute - - MWMacOSPackager_CreateClassicAlias0 - MWMacOSPackager_ClassicAliasMethodUseTargetOutput - MWMacOSPackager_ClassicAliasPath - Path - PathFormatMacOS - PathRootAbsolute - - MWMacOSPackager_CreatePkgInfo0 - MWMacOSPackager_PkgCreatorType???? - MWMacOSPackager_PkgFileTypeAPPL - - - MWCodeGen_PPC_structalignmentPPC_mw - MWCodeGen_PPC_tracebacktablesInline - MWCodeGen_PPC_processorGeneric - MWCodeGen_PPC_function_align4 - MWCodeGen_PPC_tocdata1 - MWCodeGen_PPC_largetoc0 - MWCodeGen_PPC_profiler0 - MWCodeGen_PPC_vectortocdata0 - MWCodeGen_PPC_poolconst0 - MWCodeGen_PPC_peephole1 - MWCodeGen_PPC_readonlystrings0 - MWCodeGen_PPC_linkerpoolsstrings0 - MWCodeGen_PPC_volatileasm0 - MWCodeGen_PPC_schedule0 - MWCodeGen_PPC_altivec0 - MWCodeGen_PPC_altivec_move_block0 - MWCodeGen_PPC_strictIEEEfp0 - MWCodeGen_PPC_fpcontract1 - MWCodeGen_PPC_genfsel0 - MWCodeGen_PPC_orderedfpcmp0 - - - MWCodeGen_MachO_structalignmentPPC_mw - MWCodeGen_MachO_profiler_enumOff - MWCodeGen_MachO_processorGeneric - MWCodeGen_MachO_function_align4 - MWCodeGen_MachO_common0 - MWCodeGen_MachO_peephole1 - MWCodeGen_MachO_readonlystrings0 - MWCodeGen_MachO_linkerpoolsstrings1 - MWCodeGen_MachO_volatileasm0 - MWCodeGen_MachO_schedule0 - MWCodeGen_MachO_altivec0 - MWCodeGen_MachO_vecmove0 - MWCodeGen_MachO_fp_ieee_strict0 - MWCodeGen_MachO_fpcontract1 - MWCodeGen_MachO_genfsel0 - MWCodeGen_MachO_fp_cmps_ordered0 - - - MWDisassembler_PPC_showcode1 - MWDisassembler_PPC_extended1 - MWDisassembler_PPC_mix0 - MWDisassembler_PPC_nohex0 - MWDisassembler_PPC_showdata1 - MWDisassembler_PPC_showexceptions1 - MWDisassembler_PPC_showsym1 - MWDisassembler_PPC_shownames1 - - - GlobalOptimizer_PPC_optimizationlevelLevel0 - GlobalOptimizer_PPC_optforSpeed - - - MWLinker_PPC_linksym1 - MWLinker_PPC_symfullpath1 - MWLinker_PPC_linkmap0 - MWLinker_PPC_nolinkwarnings0 - MWLinker_PPC_dontdeadstripinitcode0 - MWLinker_PPC_permitmultdefs0 - MWLinker_PPC_linkmodeFast - MWLinker_PPC_initname__initialize - MWLinker_PPC_mainname - MWLinker_PPC_termname__terminate - - - MWLinker_MacOSX_linksym0 - MWLinker_MacOSX_symfullpath0 - MWLinker_MacOSX_nolinkwarnings0 - MWLinker_MacOSX_linkmap0 - MWLinker_MacOSX_dontdeadstripinitcode0 - MWLinker_MacOSX_permitmultdefs1 - MWLinker_MacOSX_use_objectivec_semantics0 - MWLinker_MacOSX_strip_debug_symbols0 - MWLinker_MacOSX_split_segs0 - MWLinker_MacOSX_report_msl_overloads0 - MWLinker_MacOSX_objects_follow_linkorder0 - MWLinker_MacOSX_linkmodeFast - MWLinker_MacOSX_exportsReferencedGlobals - MWLinker_MacOSX_sortcodeNone - MWLinker_MacOSX_mainnamestart - - - MWProject_MacOSX_typeSharedLibrary - MWProject_MacOSX_outfilewx_PPC_d.shlb - MWProject_MacOSX_filecreator???? - MWProject_MacOSX_filetypeshlb - MWProject_MacOSX_vmaddress4096 - MWProject_MacOSX_usedefaultvmaddr1 - MWProject_MacOSX_flatrsrc0 - MWProject_MacOSX_flatrsrcfilename - MWProject_MacOSX_flatrsrcoutputdir - Path: - PathFormatMacOS - PathRootProject - - MWProject_MacOSX_installpath./ - MWProject_MacOSX_dont_prebind0 - MWProject_MacOSX_flat_namespace0 - MWProject_MacOSX_frameworkversionA - MWProject_MacOSX_currentversion0 - MWProject_MacOSX_flat_oldimpversion0 - - - MWLinker_MachO_exportsNone - MWLinker_MachO_mainnamestart - MWLinker_MachO_currentversion0 - MWLinker_MachO_compatibleversion0 - MWLinker_MachO_symfullpath0 - MWLinker_MachO_supresswarnings0 - MWLinker_MachO_multisymerror0 - MWLinker_MachO_prebind1 - MWLinker_MachO_deadstrip1 - MWLinker_MachO_objectivecsemantics0 - MWLinker_MachO_whichfileloaded0 - MWLinker_MachO_whyfileloaded0 - MWLinker_MachO_readonlyrelocsErrors - MWLinker_MachO_undefinedsymbolsErrors - MWLinker_MachO_twolevelnamespace1 - MWLinker_MachO_stripdebugsymbols0 - - - MWProject_MachO_typeExecutable - MWProject_MachO_outfilea.exe - MWProject_MachO_filecreator???? - MWProject_MachO_filetypeMEXE - MWProject_MachO_vmaddress4096 - MWProject_MachO_flatrsrc1 - MWProject_MachO_flatrsrcfilenamea.rsrc - MWProject_MachO_flatrsrcoutputdir - Path: - PathFormatMacOS - PathRootProject - - MWProject_MachO_installpath./ - MWProject_MachO_frameworkversion - - - MWPEF_exportsPragma - MWPEF_libfolder0 - MWPEF_sortcodeNone - MWPEF_expandbss0 - MWPEF_sharedata0 - MWPEF_olddefversion0 - MWPEF_oldimpversion0 - MWPEF_currentversion0 - MWPEF_fragmentname - MWPEF_collapsereloads0 - - - MWProject_PPC_typeSharedLibrary - MWProject_PPC_outfilewx_PPC_d.shlb - MWProject_PPC_filecreator???? - MWProject_PPC_filetypeshlb - MWProject_PPC_size0 - MWProject_PPC_minsize0 - MWProject_PPC_stacksize0 - MWProject_PPC_flags0 - MWProject_PPC_symfilename - MWProject_PPC_rsrcname - MWProject_PPC_rsrcheaderNative - MWProject_PPC_rsrctype???? - MWProject_PPC_rsrcid0 - MWProject_PPC_rsrcflags0 - MWProject_PPC_rsrcstore0 - MWProject_PPC_rsrcmerge0 - MWProject_PPC_flatrsrc0 - MWProject_PPC_flatrsrcoutputdir - Path: - PathFormatMacOS - PathRootProject - - MWProject_PPC_flatrsrcfilename - - - MWAssembler_PPC_auxheader0 - MWAssembler_PPC_symmodeMac - MWAssembler_PPC_dialectPPC - MWAssembler_PPC_prefixfile - MWAssembler_PPC_typecheck0 - MWAssembler_PPC_warnings0 - MWAssembler_PPC_casesensitive0 - - - PList_OutputTypeFile - PList_OutputEncodingUTF-8 - PList_Prefix - PList_FileFilenameInfo.plist - PList_FileDirectory - Path: - PathFormatMacOS - PathRootProject - - PList_ResourceTypeplst - PList_ResourceID0 - PList_ResourceName - - - MWRez_Language_maxwidth80 - MWRez_Language_scriptRoman - MWRez_Language_alignmentAlign1 - MWRez_Language_filtermodeFilterSkip - MWRez_Language_suppresswarnings0 - MWRez_Language_escapecontrolchars1 - MWRez_Language_prefixname - MWRez_Language_filteredtypes'CODE' 'DATA' 'PICT' - - - MWWinRC_prefixname - - - MWCodeGen_X86_processorGeneric - MWCodeGen_X86_alignmentbytes8 - MWCodeGen_X86_exceptionsZeroOverhead - MWCodeGen_X86_name_manglingMWWin32 - MWCodeGen_X86_use_extinst0 - MWCodeGen_X86_extinst_mmx0 - MWCodeGen_X86_extinst_3dnow0 - MWCodeGen_X86_use_mmx_3dnow_convention0 - MWCodeGen_X86_extinst_cmov0 - MWCodeGen_X86_extinst_sse0 - MWCodeGen_X86_extinst_sse20 - MWCodeGen_X86_intrinsics0 - MWCodeGen_X86_optimizeasm0 - MWCodeGen_X86_disableopts0 - MWCodeGen_X86_profile0 - MWLinker_X86_runtimeCustom - MWCodeGen_X86_readonlystrings0 - - - MWLinker_X86_subsysmajorid4 - MWLinker_X86_subsysminorid0 - MWCOFF_X86_opsysmajorid4 - MWCOFF_X86_opsysminorid0 - MWLinker_X86_usrmajorid0 - MWLinker_X86_usrminorid0 - MWProject_X86_maxstacksize1024 - MWProject_X86_minstacksize4 - MWProject_X86_size1024 - MWProject_X86_minsize4 - MWCOFF_X86_coff_flags0 - MWCOFF_X86_dll_flags0 - MWProject_X86_baseaddress4194304 - MWCOFF_X86_filealign512 - MWCOFF_X86_sectionalign4096 - - - PDisasmX86_showHeaderstrue - PDisasmX86_showSectHeaderstrue - PDisasmX86_showSymTabtrue - PDisasmX86_showCodetrue - PDisasmX86_showDatatrue - PDisasmX86_showDebugfalse - PDisasmX86_showExceptionsfalse - PDisasmX86_showRawfalse - PDisasmX86_showAllRawfalse - PDisasmX86_showSourcefalse - PDisasmX86_showRelocationtrue - PDisasmX86_showHextrue - PDisasmX86_showCommentsfalse - PDisasmX86_showSymDefstrue - PDisasmX86_unmangletrue - PDisasmX86_verbosetrue - PDisasmX86_resolveRelocstrue - PDisasmX86_resolveLocalsfalse - - - MWDebugger_X86_Exceptions - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - - - - GlobalOptimizer_X86_optimizationlevelLevel0 - GlobalOptimizer_X86_optforSpeed - - - MWLinker_X86_entrypointusageDefault - MWLinker_X86_entrypoint - MWLinker_X86_subsystemWinGUI - MWLinker_X86_commandfile - MWLinker_X86_generatemap0 - MWLinker_X86_linksym1 - MWLinker_X86_linkCV1 - MWLinker_X86_symfullpathfalse - MWLinker_X86_linkdebugtrue - MWLinker_X86_checksumfalse - MWLinker_X86_zero_init_bssfalse - MWLinker_X86_mergedatafalse - MWLinker_X86_usedefaultlibsfalse - MWLinker_X86_adddefaultlibsfalse - MWLinker_X86_nowarningsfalse - MWLinker_X86_verbosefalse - - - MWProject_X86_typeLibrary - MWProject_X86_outfilewx_x86_d.lib - MWProject_X86_importlib - MWProject_X86_setimportlibdirfalse - MWProject_X86_dontgenerateimportlibfalse - MWProject_X86_oldformatlibfalse - MWProject_X86_replaceobjextensionfalse - MWProject_X86_copyallfilesfalse - - - - PathRelative - Project - :mac:classic: - :accel.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :app.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :bitmap.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :bmpbuttn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :brush.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :button.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :checkbox.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :checklst.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :choice.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :clipbrd.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :colordlg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :colour.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :combobox.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :control.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :cursor.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :data.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :dc.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :dcclient.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :dcmemory.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :dcscreen.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :dialog.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :dirdlg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :filedlg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :font.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :fontdlg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :frame.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :gauge.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :gdiobj.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :icon.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :joystick.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :listbox.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :main.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :mdi.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :menu.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :menuitem.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :minifram.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :msgdlg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :palette.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :pen.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :printdlg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :radiobox.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :radiobut.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :region.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :scrolbar.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :settings.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :slider.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :spinbutt.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :statbmp.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :statbox.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :stattext.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :tabctrl.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :textctrl.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :thread.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :timer.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :toolbar.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :utils.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :utilsexc.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :sound.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :window.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :printmac.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :dcprint.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :uma.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :sckipc.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :matrix.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :tbarbase.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :imagjpeg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :longlong.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :docmdi.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :appcmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :utilscmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :dynlib.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :extended.c - MacOS - Text - Debug - - - PathRelative - Project - :common: - :unzip.c - MacOS - Text - Debug - - - PathRelative - Project - :common: - :sckstrm.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :zstream.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :process.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :sizer.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :imagall.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :imaggif.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :imagpcx.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :cmndata.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :ftp.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :menucmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :string.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :wfstream.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :stream.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :gdicmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :protocol.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :layout.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :valgen.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :intl.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :list.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :socket.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :hash.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :dlgcmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :gifdecod.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :filefn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :wincmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :wxchar.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :memory.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :mstream.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :lboxcmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :fs_inet.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :event.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :image.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :ipcbase.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :tokenzr.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :txtstrm.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :filesys.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :url.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :fs_zip.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :prntbase.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :dcbase.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :object.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :http.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :module.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :validate.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :file.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :config.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :fileconf.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :timercmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :framecmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :textfile.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :dynarray.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :choiccmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :helpbase.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :ctrlsub.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :ctrlcmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :strconv.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :sckfile.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :valtext.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :datstrm.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :sckaddr.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :variant.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :dbtable.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :fontcmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :ffile.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :paper.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :clipcmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :imagpnm.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :imagpng.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :imagbmp.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :zipstrm.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :log.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :textcmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :laywin.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :busyinfo.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :listctrl.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :textdlgg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :tipdlg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :numdlgg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :sashwin.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :dcpsg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :panelg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :imaglist.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :tabg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :choicdgg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :wizard.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :progdlgg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :caret.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :statusbr.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :logg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :fontdlgg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :splitter.cpp - MacOS - Text - Debug - - - Name - db.cpp - MacOS - Text - Debug - - - Name - dobjcmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :fontmap.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :geometry.cpp - MacOS - Text - Debug - - - Name - colrdlgg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :fontutil.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :dataobj.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :m_list.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :m_tables.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :htmlwin.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :m_pre.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :m_image.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :htmprint.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :htmlfilt.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :htmlpars.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :htmltag.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :m_hline.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :winpars.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :htmlcell.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :m_layout.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :m_fonts.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :m_links.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :fontenum.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :datetime.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :encconv.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :mimecmn.cpp - MacOS - Text - Debug - - - Name - metafile.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :gsocket.c - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :macnotfy.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :statbrma.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :tooltip.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :statlmac.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :imagtiff.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :treectlg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :notebmac.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :m_dflist.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :treebase.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :cshelp.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :dirmac.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :mimetmac.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :filename.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :spinctrl.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :glcanvas.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :xpmdecod.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :imagxpm.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :dirctrlg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :helpctrl.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :helpfrm.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :helpdata.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :tipwin.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :radiocmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :nbkbase.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :scrlwing.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :gaugecmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :containr.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :quantize.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :toplvcmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :toplevel.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :morefile:DirectoryCopy.c - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :morefile:Search.c - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :morefile:MoreFilesExtras.c - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :morefile:MoreFiles.c - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :morefile:MoreDesktopMgr.c - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :morefile:IterateDirectory.c - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :morefile:FullPath.c - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :morefile:FSpCompat.c - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :morefile:FileCopy.c - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :gridsel.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :grid.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :statbar.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :clntdata.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :textbuf.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :dragimgg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :calctrl.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :bmpbase.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :cmdline.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :cmdproc.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :dndcmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :dnd.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :dbgrid.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :dircmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :dseldlg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :dynload.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :effects.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :fddlgcmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :fs_mem.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :regex.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :sysopt.cpp - MacOS - Text - Debug - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:PPCLibraries:CursorDevicesGlue.o - MacOS - Library - Debug - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:PPCLibraries:OpenTptATalkPPC.o - MacOS - Library - Debug - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:PPCLibraries:CarbonAccessors.o - MacOS - Library - Debug - - - PathRelative - CodeWarrior - :MacOS Support: - :Libraries:Sources:PLStringFuncs:Libs:PLStringFuncsPPC.lib - MacOS - Library - Debug - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:PPCLibraries:OpenTptInetPPC.o - MacOS - Library - Debug - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:NavigationLib - MacOS - Library - Debug - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:ControlsLib - MacOS - Library - Debug - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:DialogsLib - MacOS - Library - Debug - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:WindowsLib - MacOS - Library - Debug - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:MenusLib - MacOS - Library - Debug - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:InterfaceLib - MacOS - Library - Debug - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:MathLib - MacOS - Library - Debug - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:AppearanceLib - MacOS - Library - Debug - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:InternetConfigLib - MacOS - Library - Debug - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:ThreadsLib - MacOS - Library - Debug - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:OpenTransportLib - MacOS - Library - Debug - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:OpenTptAppleTalkLib - MacOS - Library - Debug - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:OpenTptInternetLib - MacOS - Library - Debug - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:UTCUtils - MacOS - Library - Debug - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:TextCommon - MacOS - Library - Debug - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:Textension - MacOS - Library - Debug - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:ATSUnicodeLib - MacOS - Library - Debug - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:UnicodeConverter - MacOS - Library - Debug - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:TextEncodingConverter - MacOS - Library - Debug - - - PathRelative - Project - ::include: - :wxshlb_cw_d.pch++ - MacOS - Text - Debug - - - PathRelative - Project - ::include: - :wxshlb_cw_d.pch - MacOS - Text - Debug - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:DragLib - MacOS - Library - Debug - - - PathRelative - CodeWarrior - :MacOS Support: - :OpenGL:Libraries:OpenGLLibraryStub - MacOS - Library - Debug - - - PathRelative - Project - :common: - :imagiff.cpp - MacOS - Text - Debug - - - PathRelative - CodeWarrior - :MacOS Support: - :Libraries:Runtime:Libs:MSL_ShLibRuntime_PPC_D.Lib - MacOS - Library - Debug - - - PathRelative - CodeWarrior - :MacOS Support: - :Libraries:Runtime:Libs:MSL_All_PPC_D.Shlb - MacOS - Library - Debug - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:PPCLibraries:OpenTransportExtnPPC.o - MacOS - Library - Debug - - - PathRelative - Project - :mac:classic: - :pnghand.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :docview.cpp - MacOS - Text - Debug - - - PathRelative - CodeWarrior - :MSL: - :MSL_C++:MSL_MacOS:Lib:PPC:MSL_C++_PPC_D.Lib - MacOS - Library - Debug - - - PathRelative - Project - :generic: - :splash.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :fdrepdlg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :gridctrl.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :m_style.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :hashmap.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :dirdlgg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :iconbndl.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :artprov.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :artstd.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :imagfill.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :msgout.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :settcmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :popupcmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :printps.cpp - MacOS - Text - Debug - - - PathRelative - Project - :jpeg: - jpegM8.mcp - Unix - Project - - - - PathRelative - Project - :png: - pngM8.mcp - Unix - Project - - - - PathRelative - Project - :zlib: - zlibM8.mcp - Unix - Project - - - - PathRelative - Project - :tiff: - tiffM8.mcp - Unix - Project - - - - FileRelative - ../../lib/jpeg_PPC.lib - Unix - - PathRelative - Project - :jpeg: - jpegM8.mcp - Unix - - Library - Debug, TargetOutputFile - - - FileRelative - ../../lib/png_PPC.lib - Unix - - PathRelative - Project - :png: - pngM8.mcp - Unix - - Library - Debug, TargetOutputFile - - - FileRelative - ../../lib/zlib_PPC.lib - Unix - - PathRelative - Project - :zlib: - zlibM8.mcp - Unix - - Library - Debug, TargetOutputFile - - - FileRelative - ../../lib/tif_PPC.lib - Unix - - PathRelative - Project - :tiff: - tiffM8.mcp - Unix - - Library - Debug, TargetOutputFile - - - PathRelative - Project - :regex: - regexM8.mcp - Unix - Project - - - - FileRelative - ../../lib/regex_PPC.lib - Unix - - PathRelative - Project - :regex: - regexM8.mcp - Unix - - Library - Debug, TargetOutputFile - - - PathRelative - CodeWarrior - :MSL: - MSL_C/MSL_MacOS/Src/console.stubs.c - Unix - Text - Debug - - - PathRelative - Project - :common: - datacmn.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - rgncmn.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - accesscmn.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - dpycmn.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - taskbarcmn.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - fldlgcmn.cpp - Unix - Text - Debug - - - PathRelative - Project - :generic: - :selstore.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - appbase.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - fmapbase.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - stopwatch.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - init.cpp - Unix - Text - Debug - - - PathRelative - Project - :generic: - renderg.cpp - Unix - Text - Debug - - - PathRelative - Project - :mac:classic: - renderer.cpp - Unix - Text - Debug - - - PathRelative - Project - xml - xml.cpp - Unix - Text - Debug - - - PathRelative - Project - expat/lib - xmlparse.c - Unix - Text - Debug - - - PathRelative - Project - expat/lib - xmlrole.c - Unix - Text - Debug - - - PathRelative - Project - expat/lib - xmltok.c - Unix - Text - Debug - - - PathRelative - Project - :common: - rendcmn.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - bookctrl.cpp - Unix - Text - Debug - - - - - FileRelative - ../../lib/regex_PPC.lib - Unix - - PathRelative - Project - :regex: - regexM8.mcp - Unix - - - - FileRelative - ../../lib/tif_PPC.lib - Unix - - PathRelative - Project - :tiff: - tiffM8.mcp - Unix - - - - FileRelative - ../../lib/zlib_PPC.lib - Unix - - PathRelative - Project - :zlib: - zlibM8.mcp - Unix - - - - FileRelative - ../../lib/png_PPC.lib - Unix - - PathRelative - Project - :png: - pngM8.mcp - Unix - - - - FileRelative - ../../lib/jpeg_PPC.lib - Unix - - PathRelative - Project - :jpeg: - jpegM8.mcp - Unix - - - - PathRelative - CodeWarrior - :MacOS Support: - :Libraries:Runtime:Libs:MSL_ShLibRuntime_PPC_D.Lib - MacOS - - - PathRelative - Project - :mac:classic: - :accel.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :app.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :bitmap.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :bmpbuttn.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :brush.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :button.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :checkbox.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :checklst.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :choice.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :clipbrd.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :colordlg.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :colour.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :combobox.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :control.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :cursor.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :data.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :dc.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :dcclient.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :dcmemory.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :dcscreen.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :dialog.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :dirdlg.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :filedlg.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :font.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :fontdlg.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :frame.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :gauge.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :gdiobj.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :icon.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :joystick.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :listbox.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :main.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :mdi.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :menu.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :menuitem.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :minifram.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :msgdlg.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :palette.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :pen.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :printdlg.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :radiobox.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :radiobut.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :region.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :scrolbar.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :settings.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :slider.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :spinbutt.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :statbmp.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :statbox.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :stattext.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :tabctrl.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :textctrl.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :thread.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :timer.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :toolbar.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :utils.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :utilsexc.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :sound.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :window.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :printmac.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :dcprint.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :uma.cpp - MacOS - - - PathRelative - Project - :common: - :sckipc.cpp - MacOS - - - PathRelative - Project - :common: - :matrix.cpp - MacOS - - - PathRelative - Project - :common: - :tbarbase.cpp - MacOS - - - PathRelative - Project - :common: - :imagjpeg.cpp - MacOS - - - PathRelative - Project - :common: - :longlong.cpp - MacOS - - - PathRelative - Project - :common: - :docmdi.cpp - MacOS - - - PathRelative - Project - :common: - :appcmn.cpp - MacOS - - - PathRelative - Project - :common: - :utilscmn.cpp - MacOS - - - PathRelative - Project - :common: - :dynlib.cpp - MacOS - - - PathRelative - Project - :common: - :extended.c - MacOS - - - PathRelative - Project - :common: - :unzip.c - MacOS - - - PathRelative - Project - :common: - :sckstrm.cpp - MacOS - - - PathRelative - Project - :common: - :zstream.cpp - MacOS - - - PathRelative - Project - :common: - :process.cpp - MacOS - - - PathRelative - Project - :common: - :sizer.cpp - MacOS - - - PathRelative - Project - :common: - :imagall.cpp - MacOS - - - PathRelative - Project - :common: - :imaggif.cpp - MacOS - - - PathRelative - Project - :common: - :imagpcx.cpp - MacOS - - - PathRelative - Project - :common: - :cmndata.cpp - MacOS - - - PathRelative - Project - :common: - :ftp.cpp - MacOS - - - PathRelative - Project - :common: - :menucmn.cpp - MacOS - - - PathRelative - Project - :common: - :string.cpp - MacOS - - - PathRelative - Project - :common: - :wfstream.cpp - MacOS - - - PathRelative - Project - :common: - :stream.cpp - MacOS - - - PathRelative - Project - :common: - :gdicmn.cpp - MacOS - - - PathRelative - Project - :common: - :protocol.cpp - MacOS - - - PathRelative - Project - :common: - :layout.cpp - MacOS - - - PathRelative - Project - :common: - :valgen.cpp - MacOS - - - PathRelative - Project - :common: - :intl.cpp - MacOS - - - PathRelative - Project - :common: - :list.cpp - MacOS - - - PathRelative - Project - :common: - :socket.cpp - MacOS - - - PathRelative - Project - :common: - :hash.cpp - MacOS - - - PathRelative - Project - :common: - :dlgcmn.cpp - MacOS - - - PathRelative - Project - :common: - :gifdecod.cpp - MacOS - - - PathRelative - Project - :common: - :filefn.cpp - MacOS - - - PathRelative - Project - :common: - :wincmn.cpp - MacOS - - - PathRelative - Project - :common: - :wxchar.cpp - MacOS - - - PathRelative - Project - :common: - :memory.cpp - MacOS - - - PathRelative - Project - :common: - :mstream.cpp - MacOS - - - PathRelative - Project - :common: - :lboxcmn.cpp - MacOS - - - PathRelative - Project - :common: - :fs_inet.cpp - MacOS - - - PathRelative - Project - :common: - :event.cpp - MacOS - - - PathRelative - Project - :common: - :image.cpp - MacOS - - - PathRelative - Project - :common: - :ipcbase.cpp - MacOS - - - PathRelative - Project - :common: - :tokenzr.cpp - MacOS - - - PathRelative - Project - :common: - :txtstrm.cpp - MacOS - - - PathRelative - Project - :common: - :filesys.cpp - MacOS - - - PathRelative - Project - :common: - :url.cpp - MacOS - - - PathRelative - Project - :common: - :fs_zip.cpp - MacOS - - - PathRelative - Project - :common: - :prntbase.cpp - MacOS - - - PathRelative - Project - :common: - :dcbase.cpp - MacOS - - - PathRelative - Project - :common: - :object.cpp - MacOS - - - PathRelative - Project - :common: - :http.cpp - MacOS - - - PathRelative - Project - :common: - :module.cpp - MacOS - - - PathRelative - Project - :common: - :validate.cpp - MacOS - - - PathRelative - Project - :common: - :file.cpp - MacOS - - - PathRelative - Project - :common: - :config.cpp - MacOS - - - PathRelative - Project - :common: - :fileconf.cpp - MacOS - - - PathRelative - Project - :common: - :timercmn.cpp - MacOS - - - PathRelative - Project - :common: - :framecmn.cpp - MacOS - - - PathRelative - Project - :common: - :textfile.cpp - MacOS - - - PathRelative - Project - :common: - :dynarray.cpp - MacOS - - - PathRelative - Project - :common: - :choiccmn.cpp - MacOS - - - PathRelative - Project - :common: - :helpbase.cpp - MacOS - - - PathRelative - Project - :common: - :ctrlsub.cpp - MacOS - - - PathRelative - Project - :common: - :ctrlcmn.cpp - MacOS - - - PathRelative - Project - :common: - :strconv.cpp - MacOS - - - PathRelative - Project - :common: - :sckfile.cpp - MacOS - - - PathRelative - Project - :common: - :valtext.cpp - MacOS - - - PathRelative - Project - :common: - :datstrm.cpp - MacOS - - - PathRelative - Project - :common: - :sckaddr.cpp - MacOS - - - PathRelative - Project - :common: - :variant.cpp - MacOS - - - PathRelative - Project - :common: - :dbtable.cpp - MacOS - - - PathRelative - Project - :common: - :fontcmn.cpp - MacOS - - - PathRelative - Project - :common: - :ffile.cpp - MacOS - - - PathRelative - Project - :common: - :paper.cpp - MacOS - - - PathRelative - Project - :common: - :clipcmn.cpp - MacOS - - - PathRelative - Project - :common: - :imagpnm.cpp - MacOS - - - PathRelative - Project - :common: - :imagpng.cpp - MacOS - - - PathRelative - Project - :common: - :imagbmp.cpp - MacOS - - - PathRelative - Project - :common: - :zipstrm.cpp - MacOS - - - PathRelative - Project - :common: - :log.cpp - MacOS - - - PathRelative - Project - :common: - :textcmn.cpp - MacOS - - - PathRelative - Project - :generic: - :laywin.cpp - MacOS - - - PathRelative - Project - :generic: - :busyinfo.cpp - MacOS - - - PathRelative - Project - :generic: - :listctrl.cpp - MacOS - - - PathRelative - Project - :generic: - :textdlgg.cpp - MacOS - - - PathRelative - Project - :generic: - :tipdlg.cpp - MacOS - - - PathRelative - Project - :generic: - :numdlgg.cpp - MacOS - - - PathRelative - Project - :generic: - :sashwin.cpp - MacOS - - - PathRelative - Project - :generic: - :dcpsg.cpp - MacOS - - - PathRelative - Project - :generic: - :panelg.cpp - MacOS - - - PathRelative - Project - :generic: - :imaglist.cpp - MacOS - - - PathRelative - Project - :generic: - :tabg.cpp - MacOS - - - PathRelative - Project - :generic: - :choicdgg.cpp - MacOS - - - PathRelative - Project - :generic: - :wizard.cpp - MacOS - - - PathRelative - Project - :generic: - :progdlgg.cpp - MacOS - - - PathRelative - Project - :generic: - :caret.cpp - MacOS - - - PathRelative - Project - :generic: - :statusbr.cpp - MacOS - - - PathRelative - Project - :generic: - :logg.cpp - MacOS - - - PathRelative - Project - :generic: - :fontdlgg.cpp - MacOS - - - PathRelative - Project - :generic: - :splitter.cpp - MacOS - - - Name - db.cpp - MacOS - - - Name - dobjcmn.cpp - MacOS - - - PathRelative - Project - :common: - :fontmap.cpp - MacOS - - - PathRelative - Project - :common: - :geometry.cpp - MacOS - - - Name - colrdlgg.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :fontutil.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :dataobj.cpp - MacOS - - - PathRelative - Project - :html: - :m_list.cpp - MacOS - - - PathRelative - Project - :html: - :m_tables.cpp - MacOS - - - PathRelative - Project - :html: - :htmlwin.cpp - MacOS - - - PathRelative - Project - :html: - :m_pre.cpp - MacOS - - - PathRelative - Project - :html: - :m_image.cpp - MacOS - - - PathRelative - Project - :html: - :htmprint.cpp - MacOS - - - PathRelative - Project - :html: - :htmlfilt.cpp - MacOS - - - PathRelative - Project - :html: - :htmlpars.cpp - MacOS - - - PathRelative - Project - :html: - :htmltag.cpp - MacOS - - - PathRelative - Project - :html: - :m_hline.cpp - MacOS - - - PathRelative - Project - :html: - :winpars.cpp - MacOS - - - PathRelative - Project - :html: - :htmlcell.cpp - MacOS - - - PathRelative - Project - :html: - :m_layout.cpp - MacOS - - - PathRelative - Project - :html: - :m_fonts.cpp - MacOS - - - PathRelative - Project - :html: - :m_links.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :fontenum.cpp - MacOS - - - PathRelative - Project - :common: - :datetime.cpp - MacOS - - - PathRelative - Project - :common: - :encconv.cpp - MacOS - - - PathRelative - Project - :common: - :mimecmn.cpp - MacOS - - - Name - metafile.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :gsocket.c - MacOS - - - PathRelative - Project - :mac:classic: - :macnotfy.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :statbrma.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :tooltip.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :statlmac.cpp - MacOS - - - PathRelative - Project - :common: - :imagtiff.cpp - MacOS - - - PathRelative - Project - :generic: - :treectlg.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :notebmac.cpp - MacOS - - - PathRelative - Project - :html: - :m_dflist.cpp - MacOS - - - PathRelative - Project - :common: - :treebase.cpp - MacOS - - - PathRelative - Project - :common: - :cshelp.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :dirmac.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :mimetmac.cpp - MacOS - - - PathRelative - Project - :common: - :filename.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :spinctrl.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :glcanvas.cpp - MacOS - - - PathRelative - Project - :common: - :xpmdecod.cpp - MacOS - - - PathRelative - Project - :common: - :imagxpm.cpp - MacOS - - - PathRelative - Project - :generic: - :dirctrlg.cpp - MacOS - - - PathRelative - Project - :html: - :helpctrl.cpp - MacOS - - - PathRelative - Project - :html: - :helpfrm.cpp - MacOS - - - PathRelative - Project - :html: - :helpdata.cpp - MacOS - - - PathRelative - Project - :generic: - :tipwin.cpp - MacOS - - - PathRelative - Project - :common: - :radiocmn.cpp - MacOS - - - PathRelative - Project - :common: - :nbkbase.cpp - MacOS - - - PathRelative - Project - :generic: - :scrlwing.cpp - MacOS - - - PathRelative - Project - :common: - :gaugecmn.cpp - MacOS - - - PathRelative - Project - :common: - :containr.cpp - MacOS - - - PathRelative - Project - :common: - :quantize.cpp - MacOS - - - PathRelative - Project - :common: - :toplvcmn.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :toplevel.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :morefile:DirectoryCopy.c - MacOS - - - PathRelative - Project - :mac:classic: - :morefile:Search.c - MacOS - - - PathRelative - Project - :mac:classic: - :morefile:MoreFilesExtras.c - MacOS - - - PathRelative - Project - :mac:classic: - :morefile:MoreFiles.c - MacOS - - - PathRelative - Project - :mac:classic: - :morefile:MoreDesktopMgr.c - MacOS - - - PathRelative - Project - :mac:classic: - :morefile:IterateDirectory.c - MacOS - - - PathRelative - Project - :mac:classic: - :morefile:FullPath.c - MacOS - - - PathRelative - Project - :mac:classic: - :morefile:FSpCompat.c - MacOS - - - PathRelative - Project - :mac:classic: - :morefile:FileCopy.c - MacOS - - - PathRelative - Project - :generic: - :gridsel.cpp - MacOS - - - PathRelative - Project - :generic: - :grid.cpp - MacOS - - - PathRelative - Project - :common: - :statbar.cpp - MacOS - - - PathRelative - Project - :common: - :clntdata.cpp - MacOS - - - PathRelative - Project - :common: - :textbuf.cpp - MacOS - - - PathRelative - Project - :generic: - :dragimgg.cpp - MacOS - - - PathRelative - Project - :generic: - :calctrl.cpp - MacOS - - - PathRelative - Project - :common: - :bmpbase.cpp - MacOS - - - PathRelative - Project - :common: - :cmdline.cpp - MacOS - - - PathRelative - Project - :common: - :cmdproc.cpp - MacOS - - - PathRelative - Project - :common: - :dndcmn.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :dnd.cpp - MacOS - - - PathRelative - Project - :common: - :dbgrid.cpp - MacOS - - - PathRelative - Project - :common: - :dircmn.cpp - MacOS - - - PathRelative - Project - :common: - :dseldlg.cpp - MacOS - - - PathRelative - Project - :common: - :dynload.cpp - MacOS - - - PathRelative - Project - :common: - :effects.cpp - MacOS - - - PathRelative - Project - :common: - :fddlgcmn.cpp - MacOS - - - PathRelative - Project - :common: - :fs_mem.cpp - MacOS - - - PathRelative - Project - :common: - :regex.cpp - MacOS - - - PathRelative - Project - :common: - :sysopt.cpp - MacOS - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:PPCLibraries:CursorDevicesGlue.o - MacOS - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:PPCLibraries:OpenTptATalkPPC.o - MacOS - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:PPCLibraries:CarbonAccessors.o - MacOS - - - PathRelative - CodeWarrior - :MacOS Support: - :Libraries:Sources:PLStringFuncs:Libs:PLStringFuncsPPC.lib - MacOS - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:PPCLibraries:OpenTptInetPPC.o - MacOS - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:NavigationLib - MacOS - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:ControlsLib - MacOS - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:DialogsLib - MacOS - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:WindowsLib - MacOS - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:MenusLib - MacOS - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:InterfaceLib - MacOS - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:MathLib - MacOS - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:AppearanceLib - MacOS - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:InternetConfigLib - MacOS - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:ThreadsLib - MacOS - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:OpenTransportLib - MacOS - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:OpenTptAppleTalkLib - MacOS - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:OpenTptInternetLib - MacOS - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:UTCUtils - MacOS - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:TextCommon - MacOS - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:Textension - MacOS - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:ATSUnicodeLib - MacOS - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:UnicodeConverter - MacOS - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:TextEncodingConverter - MacOS - - - PathRelative - Project - :common: - :docview.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :pnghand.cpp - MacOS - - - PathRelative - CodeWarrior - :MSL: - MSL_C/MSL_MacOS/Src/console.stubs.c - Unix - - - PathRelative - CodeWarrior - :MacOS Support: - :Libraries:Runtime:Libs:MSL_All_PPC_D.Shlb - MacOS - - - PathRelative - Project - ::include: - :wxshlb_cw_d.pch++ - MacOS - - - PathRelative - Project - ::include: - :wxshlb_cw_d.pch - MacOS - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:DragLib - MacOS - - - PathRelative - CodeWarrior - :MacOS Support: - :OpenGL:Libraries:OpenGLLibraryStub - MacOS - - - PathRelative - Project - :common: - :imagiff.cpp - MacOS - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:PPCLibraries:OpenTransportExtnPPC.o - MacOS - - - PathRelative - CodeWarrior - :MSL: - :MSL_C++:MSL_MacOS:Lib:PPC:MSL_C++_PPC_D.Lib - MacOS - - - PathRelative - Project - :generic: - :splash.cpp - MacOS - - - PathRelative - Project - :generic: - :fdrepdlg.cpp - MacOS - - - PathRelative - Project - :generic: - :gridctrl.cpp - MacOS - - - PathRelative - Project - :html: - :m_style.cpp - MacOS - - - PathRelative - Project - :common: - :hashmap.cpp - MacOS - - - PathRelative - Project - :generic: - :dirdlgg.cpp - MacOS - - - PathRelative - Project - :common: - :iconbndl.cpp - MacOS - - - PathRelative - Project - :common: - :artprov.cpp - MacOS - - - PathRelative - Project - :common: - :artstd.cpp - MacOS - - - PathRelative - Project - :common: - :imagfill.cpp - MacOS - - - PathRelative - Project - :common: - :msgout.cpp - MacOS - - - PathRelative - Project - :common: - :settcmn.cpp - MacOS - - - PathRelative - Project - :common: - :popupcmn.cpp - MacOS - - - PathRelative - Project - :generic: - :printps.cpp - MacOS - - - PathRelative - Project - :common: - datacmn.cpp - Unix - - - PathRelative - Project - :common: - rgncmn.cpp - Unix - - - PathRelative - Project - :common: - accesscmn.cpp - Unix - - - PathRelative - Project - :common: - dpycmn.cpp - Unix - - - PathRelative - Project - :common: - taskbarcmn.cpp - Unix - - - PathRelative - Project - :common: - fldlgcmn.cpp - Unix - - - PathRelative - Project - :generic: - :selstore.cpp - MacOS - - - PathRelative - Project - :common: - appbase.cpp - Unix - - - PathRelative - Project - :common: - fmapbase.cpp - Unix - - - PathRelative - Project - :common: - stopwatch.cpp - Unix - - - PathRelative - Project - :common: - init.cpp - Unix - - - PathRelative - Project - :generic: - renderg.cpp - Unix - - - PathRelative - Project - :mac:classic: - renderer.cpp - Unix - - - PathRelative - Project - xml - xml.cpp - Unix - - - PathRelative - Project - expat/lib - xmlparse.c - Unix - - - PathRelative - Project - expat/lib - xmlrole.c - Unix - - - PathRelative - Project - expat/lib - xmltok.c - Unix - - - PathRelative - Project - :common: - rendcmn.cpp - Unix - - - PathRelative - Project - :common: - bookctrl.cpp - Unix - - - - - - PathRelative - Project - :jpeg: - jpegM8.mcp - Unix - - - - PPC - LinkAgainst - - FileRelative - ../../lib/jpeg_PPC.lib - Unix - - PathRelative - Project - :jpeg: - jpegM8.mcp - Unix - - - - - - - - PathRelative - Project - :png: - pngM8.mcp - Unix - - - - PPC - LinkAgainst - - FileRelative - ../../lib/png_PPC.lib - Unix - - PathRelative - Project - :png: - pngM8.mcp - Unix - - - - - - - - PathRelative - Project - :zlib: - zlibM8.mcp - Unix - - - - PPC - LinkAgainst - - FileRelative - ../../lib/zlib_PPC.lib - Unix - - PathRelative - Project - :zlib: - zlibM8.mcp - Unix - - - - - - - - PathRelative - Project - :tiff: - tiffM8.mcp - Unix - - - - PPC - LinkAgainst - - FileRelative - ../../lib/tif_PPC.lib - Unix - - PathRelative - Project - :tiff: - tiffM8.mcp - Unix - - - - - - - - PathRelative - Project - :regex: - regexM8.mcp - Unix - - - - PPC - LinkAgainst - - FileRelative - ../../lib/regex_PPC.lib - Unix - - PathRelative - Project - :regex: - regexM8.mcp - Unix - - - - - - - - - wxshlba PPC debug - - - - UserSourceTrees - - - AlwaysSearchUserPathstrue - InterpretDOSAndUnixPathstrue - RequireFrameworkStyleIncludesfalse - UserSearchPaths - - SearchPath - Path::include: - PathFormatMacOS - PathRootProject - - Recursivefalse - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path::art: - PathFormatMacOS - PathRootProject - - Recursivefalse - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:generic: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:mac:classic: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:common: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:regex: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:zlib: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:png: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:jpeg: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:iodbc: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:tiff: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:html: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path::lib: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SystemSearchPaths - - SearchPath - Path:MSL: - PathFormatMacOS - PathRootCodeWarrior - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:MacOS Support: - PathFormatMacOS - PathRootCodeWarrior - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - - - MWRuntimeSettings_WorkingDirectory - MWRuntimeSettings_CommandLine - MWRuntimeSettings_HostApplication - Path - PathFormatGeneric - PathRootAbsolute - - MWRuntimeSettings_EnvVars - - - LinkerMacOS PPC Linker - PreLinker - PostLinker - Targetnamewxshlba PPC debug - OutputDirectory - Path::lib: - PathFormatMacOS - PathRootProject - - SaveEntriesUsingRelativePathstrue - - - FileMappings - - FileTypeAPPL - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypeAppl - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypeMMLB - FileExtension - CompilerLib Import PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeMPLF - FileExtension - CompilerLib Import PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeMWCD - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypeRSRC - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.bh - CompilerBalloon Help - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.c - CompilerMW C/C++ PPC - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.c++ - CompilerMW C/C++ PPC - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.cc - CompilerMW C/C++ PPC - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.cp - CompilerMW C/C++ PPC - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.cpp - CompilerMW C/C++ PPC - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.exp - Compiler - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.h - CompilerMW C/C++ PPC - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMaketrue - - - FileTypeTEXT - FileExtension.p - CompilerMW Pascal PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.pas - CompilerMW Pascal PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.pch - CompilerMW C/C++ PPC - EditLanguageC/C++ - Precompiletrue - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.pch++ - CompilerMW C/C++ PPC - EditLanguageC/C++ - Precompiletrue - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.ppu - CompilerMW Pascal PPC - EditLanguage - Precompiletrue - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.r - CompilerRez - EditLanguageRez - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.s - CompilerPPCAsm - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeXCOF - FileExtension - CompilerXCOFF Import PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeXPM - FileExtension.xpm - CompilerMW C/C++ PPC - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypedocu - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypersrc - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypeshlb - FileExtension - CompilerPEF Import PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypestub - FileExtension - CompilerPEF Import PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileExtension.doc - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFilefalse - IgnoredByMaketrue - - - FileExtension.o - CompilerXCOFF Import PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileExtension.ppob - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileExtension.rsrc - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - - - CacheModDatestrue - DumpBrowserInfofalse - CacheSubprojectstrue - UseThirdPartyDebuggerfalse - BrowserGenerator1 - DebuggerAppPath - Path - PathFormatGeneric - PathRootAbsolute - - DebuggerCmdLineArgs - DebuggerWorkingDir - Path - PathFormatGeneric - PathRootAbsolute - - CodeCompletionPrefixFileNameMacHeaders.c - CodeCompletionMacroFileNameMacOS_Carbon_C++_Macros.h - - - ConsoleEncoding0 - LogSystemMessagestrue - AutoTargetDLLsfalse - StopAtWatchpointstrue - PauseWhileRunningfalse - PauseInterval5 - PauseUIFlags0 - AltExePath - Path - PathFormatGeneric - PathRootAbsolute - - StopAtTempBPOnLaunchtrue - CacheSymbolicstrue - TempBPFunctionNamemain - TempBPType0 - - - Enabledfalse - ConnectionName - DownloadPath - LaunchRemoteAppfalse - RemoteAppPath - CoreID0 - JTAGClockSpeed8000 - IsMultiCorefalse - OSDownloadfalse - UseGlobalOSDownloadfalse - OSDownloadConnectionName - OSDownloadPath - AltDownloadfalse - AltDownloadConnectionName - - - OtherExecutables - - - CustomColor1 - Red0 - Green32767 - Blue0 - - CustomColor2 - Red0 - Green32767 - Blue0 - - CustomColor3 - Red0 - Green32767 - Blue0 - - CustomColor4 - Red0 - Green32767 - Blue0 - - - - MWFrontEnd_C_cplusplus0 - MWFrontEnd_C_checkprotos0 - MWFrontEnd_C_arm0 - MWFrontEnd_C_trigraphs0 - MWFrontEnd_C_onlystdkeywords0 - MWFrontEnd_C_enumsalwaysint0 - MWFrontEnd_C_mpwpointerstyle1 - MWFrontEnd_C_prefixnamewx/wxshlb_cw_d.h - MWFrontEnd_C_ansistrict0 - MWFrontEnd_C_mpwcnewline0 - MWFrontEnd_C_wchar_type1 - MWFrontEnd_C_enableexceptions1 - MWFrontEnd_C_dontreusestrings0 - MWFrontEnd_C_poolstrings0 - MWFrontEnd_C_dontinline0 - MWFrontEnd_C_useRTTI1 - MWFrontEnd_C_multibyteaware0 - MWFrontEnd_C_unsignedchars1 - MWFrontEnd_C_autoinline0 - MWFrontEnd_C_booltruefalse1 - MWFrontEnd_C_inlinelevel0 - MWFrontEnd_C_ecplusplus0 - MWFrontEnd_C_objective_c0 - MWFrontEnd_C_defer_codegen0 - MWFrontEnd_C_templateparser0 - MWFrontEnd_C_c990 - MWFrontEnd_C_bottomupinline1 - - - MWWarning_C_warn_illpragma1 - MWWarning_C_warn_emptydecl0 - MWWarning_C_warn_possunwant0 - MWWarning_C_warn_unusedvar0 - MWWarning_C_warn_unusedarg0 - MWWarning_C_warn_extracomma0 - MWWarning_C_pedantic1 - MWWarning_C_warningerrors0 - MWWarning_C_warn_hidevirtual1 - MWWarning_C_warn_implicitconv0 - MWWarning_C_warn_notinlined0 - MWWarning_C_warn_structclass1 - - - MWFTP_Post_hostName - MWFTP_Post_username - MWFTP_Post_password0ÿÄ@ž–@)t - MWFTP_Post_remoteDir - MWFTP_Post_ftp_PathVersion1 - MWFTP_Post_ftp_PathType0 - MWFTP_Post_ftp_PathFormat0 - MWFTP_Post_ftp_tree - MWFTP_Post_uploadDir - MWFTP_Post_ftp_port21 - MWFTP_Post_SendBin1 - MWFTP_Post_ShouldLog1 - - - MWCommandLine_Java_clsName - MWCommandLine_Java_args - - - MWVJavaDebugging_Protocol1 - MWVJavaDebugging_JDKVersion1 - MWVJavaDebugging_TimeOut10 - MWVJavaDebugging_SupportSlowDevicesfalse - MWVJavaDebugging_UseRemoteLaunchAgentfalse - MWVJavaDebugging_LaunchVMasServerfalse - - - MWJava_Language_optimizefalse - MWJava_Language_warnDeprecatedfalse - MWJava_Language_emitMapfalse - MWJava_Language_strictFileNamesfalse - MWJava_Language_strictFileHierarchyfalse - MWJava_Language_1_1_Compatiblefalse - MWJava_Language_emitHeaders0 - MWJava_Language_headerTypeJNINativeHeaders - MWJava_Language_packageFilter - MWJava_Language_genCommentstrue - MWJava_Language_genHeadersfalse - MWJava_Language_enableAssertsfalse - MWJava_Language_targetVM1.1 - - - Manifest-JAD Attributes - - AttributeMain-Class - ValueAuto-Generated - - - - - MWJava_MRJAppBuilder_outFileMRJApplication - MWJava_MRJAppBuilder_mergefalse - MWJava_MRJAppBuilder_quitMenutrue - MWJava_MRJAppBuilder_growfalse - MWJava_MRJAppBuilder_stdoutTypeConsole - MWJava_MRJAppBuilder_stderrTypeConsole - MWJava_MRJAppBuilder_stdinTypeConsole - MWJava_MRJAppBuilder_appIconPVersion0 - MWJava_MRJAppBuilder_appIconPType0 - MWJava_MRJAppBuilder_appIconPFormat0 - MWJava_MRJAppBuilder_appIconPTree - MWJava_MRJAppBuilder_appIconFile - MWJava_MRJAppBuilder_splashScreenPVersion0 - MWJava_MRJAppBuilder_splashScreenPType0 - MWJava_MRJAppBuilder_splashScreenPFormat0 - MWJava_MRJAppBuilder_splashScreenPTree - MWJava_MRJAppBuilder_splashScreenPICTFile - MWJava_MRJAppBuilder_aboutName - MWJava_MRJAppBuilder_stdoutPVersion0 - MWJava_MRJAppBuilder_stdoutPType0 - MWJava_MRJAppBuilder_stdoutPFormat0 - MWJava_MRJAppBuilder_stdoutPTree - MWJava_MRJAppBuilder_stdoutFile - MWJava_MRJAppBuilder_stdoutAppendfalse - MWJava_MRJAppBuilder_stderrPType0 - MWJava_MRJAppBuilder_stderrPFormat0 - MWJava_MRJAppBuilder_stderrPTree - MWJava_MRJAppBuilder_stderrFile - MWJava_MRJAppBuilder_stderrAppendfalse - MWJava_MRJAppBuilder_stdinPType0 - MWJava_MRJAppBuilder_stdinPFormat0 - MWJava_MRJAppBuilder_stdinPTree - MWJava_MRJAppBuilder_stdinFile - - - MWJava_Output_outputtypeJarFile - MWJava_Output_outfileJavaClasses.jar - MWJava_Output_ftype1514754080 - MWJava_Output_fcreator1297570384 - MWJava_Output_compress0 - MWJava_Output_genManifest0 - MWJava_Output_trunctypeFront - MWJava_Output_deleteClasses0 - MWJava_Output_consoleApp1 - MWJava_Output_preverify0 - MWJava_Output_genJad0 - MWJava_Output_obfuscate0 - - - MWJava_Proj_projtypeApplet - MWJava_Proj_mainClassName - MWJava_Proj_HTMLAppCreator1145457748 - MWJava_Proj_HTMLAppNameMetrowerks Java - MWJava_Proj_PathVersion1 - MWJava_Proj_PathType0 - MWJava_Proj_PathFormat0 - MWJava_Proj_tree - MWJava_Proj_HTMLAppWin32NameInternet Explorer - MWJava_Proj_compress0 - MWJava_Proj_simulator0 - MWJava_Proj_useVM\000\000macosx - MWJava_Proj_vmarguments - MWJava_Proj_vmName - MWJava_Proj_simPropFile - - - MWJavaDoc_Proj_Version1 - MWJavaDoc_Proj_Deprecated1 - MWJavaDoc_Proj_Author1 - MWJavaDoc_Proj_Index1 - MWJavaDoc_Proj_Tree1 - MWJavaDoc_Proj_SunResolveToSame0 - MWJavaDoc_Proj_Shortnames1 - MWJavaDoc_Proj_Folder0 - MWJavaDoc_Proj_GenerateAPILinks0 - MWJavaDoc_Proj_scopePublic - MWJavaDoc_Proj_fcreator1297303877 - MWJavaDoc_Proj_encodingName - MWJavaDoc_Proj_decodingName - MWJavaDoc_Proj_javaPackagePathhttp://java.sun.com/products/jdk/1.1/docs/api/ - - - MWMerge_MacOS_projectTypeApplication - MWMerge_MacOS_outputNameMerge Out - MWMerge_MacOS_outputCreator???? - MWMerge_MacOS_outputTypeAPPL - MWMerge_MacOS_suppressWarning0 - MWMerge_MacOS_copyFragments1 - MWMerge_MacOS_copyResources1 - MWMerge_MacOS_flattenResource0 - MWMerge_MacOS_flatFileNamea.rsrc - MWMerge_MacOS_flatFileOutputPath - Path: - PathFormatMacOS - PathRootProject - - MWMerge_MacOS_skipResources - DLGX - ckid - Proj - WSPC - - - - FileLockedfalse - ResourcesMapIsReadOnlyfalse - PrinterDriverIsMultiFinderCompatiblefalse - Invisiblefalse - HasBundlefalse - NameLockedfalse - Stationeryfalse - HasCustomIconfalse - Sharedfalse - HasBeenInitedfalse - Label0 - Comments - - - MWMacOSPackager_UsePackager0 - MWMacOSPackager_FolderToPackage - Path - PathFormatMacOS - PathRootAbsolute - - MWMacOSPackager_CreateClassicAlias0 - MWMacOSPackager_ClassicAliasMethodUseTargetOutput - MWMacOSPackager_ClassicAliasPath - Path - PathFormatMacOS - PathRootAbsolute - - MWMacOSPackager_CreatePkgInfo0 - MWMacOSPackager_PkgCreatorType???? - MWMacOSPackager_PkgFileTypeAPPL - - - MWCodeGen_PPC_structalignmentPPC_mw - MWCodeGen_PPC_tracebacktablesInline - MWCodeGen_PPC_processorGeneric - MWCodeGen_PPC_function_align4 - MWCodeGen_PPC_tocdata1 - MWCodeGen_PPC_largetoc0 - MWCodeGen_PPC_profiler0 - MWCodeGen_PPC_vectortocdata0 - MWCodeGen_PPC_poolconst0 - MWCodeGen_PPC_peephole1 - MWCodeGen_PPC_readonlystrings0 - MWCodeGen_PPC_linkerpoolsstrings0 - MWCodeGen_PPC_volatileasm0 - MWCodeGen_PPC_schedule0 - MWCodeGen_PPC_altivec0 - MWCodeGen_PPC_altivec_move_block0 - MWCodeGen_PPC_strictIEEEfp0 - MWCodeGen_PPC_fpcontract1 - MWCodeGen_PPC_genfsel0 - MWCodeGen_PPC_orderedfpcmp0 - - - MWCodeGen_MachO_structalignmentPPC_mw - MWCodeGen_MachO_profiler_enumOff - MWCodeGen_MachO_processorGeneric - MWCodeGen_MachO_function_align4 - MWCodeGen_MachO_common0 - MWCodeGen_MachO_peephole1 - MWCodeGen_MachO_readonlystrings0 - MWCodeGen_MachO_linkerpoolsstrings1 - MWCodeGen_MachO_volatileasm0 - MWCodeGen_MachO_schedule0 - MWCodeGen_MachO_altivec0 - MWCodeGen_MachO_vecmove0 - MWCodeGen_MachO_fp_ieee_strict0 - MWCodeGen_MachO_fpcontract1 - MWCodeGen_MachO_genfsel0 - MWCodeGen_MachO_fp_cmps_ordered0 - - - MWDisassembler_PPC_showcode1 - MWDisassembler_PPC_extended1 - MWDisassembler_PPC_mix0 - MWDisassembler_PPC_nohex0 - MWDisassembler_PPC_showdata1 - MWDisassembler_PPC_showexceptions1 - MWDisassembler_PPC_showsym1 - MWDisassembler_PPC_shownames1 - - - GlobalOptimizer_PPC_optimizationlevelLevel0 - GlobalOptimizer_PPC_optforSpeed - - - MWLinker_PPC_linksym0 - MWLinker_PPC_symfullpath1 - MWLinker_PPC_linkmap0 - MWLinker_PPC_nolinkwarnings0 - MWLinker_PPC_dontdeadstripinitcode0 - MWLinker_PPC_permitmultdefs0 - MWLinker_PPC_linkmodeFast - MWLinker_PPC_initname - MWLinker_PPC_mainname - MWLinker_PPC_termname - - - MWLinker_MacOSX_linksym0 - MWLinker_MacOSX_symfullpath0 - MWLinker_MacOSX_nolinkwarnings0 - MWLinker_MacOSX_linkmap0 - MWLinker_MacOSX_dontdeadstripinitcode0 - MWLinker_MacOSX_permitmultdefs1 - MWLinker_MacOSX_use_objectivec_semantics0 - MWLinker_MacOSX_strip_debug_symbols0 - MWLinker_MacOSX_split_segs0 - MWLinker_MacOSX_report_msl_overloads0 - MWLinker_MacOSX_objects_follow_linkorder0 - MWLinker_MacOSX_linkmodeFast - MWLinker_MacOSX_exportsReferencedGlobals - MWLinker_MacOSX_sortcodeNone - MWLinker_MacOSX_mainnamestart - - - MWProject_MacOSX_typeExecutable - MWProject_MacOSX_outfilewx_PPC_d.shlba - MWProject_MacOSX_filecreator???? - MWProject_MacOSX_filetypestub - MWProject_MacOSX_vmaddress4096 - MWProject_MacOSX_usedefaultvmaddr1 - MWProject_MacOSX_flatrsrc0 - MWProject_MacOSX_flatrsrcfilename - MWProject_MacOSX_flatrsrcoutputdir - Path: - PathFormatMacOS - PathRootProject - - MWProject_MacOSX_installpath./ - MWProject_MacOSX_dont_prebind0 - MWProject_MacOSX_flat_namespace0 - MWProject_MacOSX_frameworkversionA - MWProject_MacOSX_currentversion0 - MWProject_MacOSX_flat_oldimpversion0 - - - MWLinker_MachO_exportsNone - MWLinker_MachO_mainnamestart - MWLinker_MachO_currentversion0 - MWLinker_MachO_compatibleversion0 - MWLinker_MachO_symfullpath0 - MWLinker_MachO_supresswarnings0 - MWLinker_MachO_multisymerror0 - MWLinker_MachO_prebind1 - MWLinker_MachO_deadstrip1 - MWLinker_MachO_objectivecsemantics0 - MWLinker_MachO_whichfileloaded0 - MWLinker_MachO_whyfileloaded0 - MWLinker_MachO_readonlyrelocsErrors - MWLinker_MachO_undefinedsymbolsErrors - MWLinker_MachO_twolevelnamespace1 - MWLinker_MachO_stripdebugsymbols0 - - - MWProject_MachO_typeExecutable - MWProject_MachO_outfilea.exe - MWProject_MachO_filecreator???? - MWProject_MachO_filetypeMEXE - MWProject_MachO_vmaddress4096 - MWProject_MachO_flatrsrc1 - MWProject_MachO_flatrsrcfilenamea.rsrc - MWProject_MachO_flatrsrcoutputdir - Path: - PathFormatMacOS - PathRootProject - - MWProject_MachO_installpath./ - MWProject_MachO_frameworkversion - - - MWPEF_exportsPragma - MWPEF_libfolder0 - MWPEF_sortcodeNone - MWPEF_expandbss0 - MWPEF_sharedata0 - MWPEF_olddefversion0 - MWPEF_oldimpversion0 - MWPEF_currentversion0 - MWPEF_fragmentname - MWPEF_collapsereloads0 - - - MWProject_PPC_typeStubLibrary - MWProject_PPC_outfilewx_PPC_d.shlba - MWProject_PPC_filecreator???? - MWProject_PPC_filetypestub - MWProject_PPC_size0 - MWProject_PPC_minsize0 - MWProject_PPC_stacksize0 - MWProject_PPC_flags0 - MWProject_PPC_symfilename - MWProject_PPC_rsrcname - MWProject_PPC_rsrcheaderNative - MWProject_PPC_rsrctype???? - MWProject_PPC_rsrcid0 - MWProject_PPC_rsrcflags0 - MWProject_PPC_rsrcstore0 - MWProject_PPC_rsrcmerge0 - MWProject_PPC_flatrsrc0 - MWProject_PPC_flatrsrcoutputdir - Path: - PathFormatMacOS - PathRootProject - - MWProject_PPC_flatrsrcfilename - - - MWAssembler_PPC_auxheader0 - MWAssembler_PPC_symmodeMac - MWAssembler_PPC_dialectPPC - MWAssembler_PPC_prefixfile - MWAssembler_PPC_typecheck0 - MWAssembler_PPC_warnings0 - MWAssembler_PPC_casesensitive0 - - - PList_OutputTypeFile - PList_OutputEncodingUTF-8 - PList_Prefix - PList_FileFilenameInfo.plist - PList_FileDirectory - Path: - PathFormatMacOS - PathRootProject - - PList_ResourceTypeplst - PList_ResourceID0 - PList_ResourceName - - - MWRez_Language_maxwidth80 - MWRez_Language_scriptRoman - MWRez_Language_alignmentAlign1 - MWRez_Language_filtermodeFilterSkip - MWRez_Language_suppresswarnings0 - MWRez_Language_escapecontrolchars1 - MWRez_Language_prefixname - MWRez_Language_filteredtypes'CODE' 'DATA' 'PICT' - - - MWWinRC_prefixname - - - MWCodeGen_X86_processorGeneric - MWCodeGen_X86_alignmentbytes8 - MWCodeGen_X86_exceptionsZeroOverhead - MWCodeGen_X86_name_manglingMWWin32 - MWCodeGen_X86_use_extinst0 - MWCodeGen_X86_extinst_mmx0 - MWCodeGen_X86_extinst_3dnow0 - MWCodeGen_X86_use_mmx_3dnow_convention0 - MWCodeGen_X86_extinst_cmov0 - MWCodeGen_X86_extinst_sse0 - MWCodeGen_X86_extinst_sse20 - MWCodeGen_X86_intrinsics0 - MWCodeGen_X86_optimizeasm0 - MWCodeGen_X86_disableopts0 - MWCodeGen_X86_profile0 - MWLinker_X86_runtimeCustom - MWCodeGen_X86_readonlystrings0 - - - MWLinker_X86_subsysmajorid4 - MWLinker_X86_subsysminorid0 - MWCOFF_X86_opsysmajorid4 - MWCOFF_X86_opsysminorid0 - MWLinker_X86_usrmajorid0 - MWLinker_X86_usrminorid0 - MWProject_X86_maxstacksize1024 - MWProject_X86_minstacksize4 - MWProject_X86_size1024 - MWProject_X86_minsize4 - MWCOFF_X86_coff_flags0 - MWCOFF_X86_dll_flags0 - MWProject_X86_baseaddress4194304 - MWCOFF_X86_filealign512 - MWCOFF_X86_sectionalign4096 - - - PDisasmX86_showHeaderstrue - PDisasmX86_showSectHeaderstrue - PDisasmX86_showSymTabtrue - PDisasmX86_showCodetrue - PDisasmX86_showDatatrue - PDisasmX86_showDebugfalse - PDisasmX86_showExceptionsfalse - PDisasmX86_showRawfalse - PDisasmX86_showAllRawfalse - PDisasmX86_showSourcefalse - PDisasmX86_showRelocationtrue - PDisasmX86_showHextrue - PDisasmX86_showCommentsfalse - PDisasmX86_showSymDefstrue - PDisasmX86_unmangletrue - PDisasmX86_verbosetrue - PDisasmX86_resolveRelocstrue - PDisasmX86_resolveLocalsfalse - - - MWDebugger_X86_Exceptions - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - - - - GlobalOptimizer_X86_optimizationlevelLevel0 - GlobalOptimizer_X86_optforSpeed - - - MWLinker_X86_entrypointusageDefault - MWLinker_X86_entrypoint - MWLinker_X86_subsystemWinGUI - MWLinker_X86_commandfile - MWLinker_X86_generatemap0 - MWLinker_X86_linksym1 - MWLinker_X86_linkCV1 - MWLinker_X86_symfullpathfalse - MWLinker_X86_linkdebugtrue - MWLinker_X86_checksumfalse - MWLinker_X86_zero_init_bssfalse - MWLinker_X86_mergedatafalse - MWLinker_X86_usedefaultlibsfalse - MWLinker_X86_adddefaultlibsfalse - MWLinker_X86_nowarningsfalse - MWLinker_X86_verbosefalse - - - MWProject_X86_typeLibrary - MWProject_X86_outfilewx_x86_d.lib - MWProject_X86_importlib - MWProject_X86_setimportlibdirfalse - MWProject_X86_dontgenerateimportlibfalse - MWProject_X86_oldformatlibfalse - MWProject_X86_replaceobjextensionfalse - MWProject_X86_copyallfilesfalse - - - - PathRelative - Project - ::include: - :wxshlba_cw_d.pch++ - MacOS - Text - Debug - - - PathRelative - Project - ::include: - :wxshlba_cw_d.pch - MacOS - Text - Debug - - - - - PathRelative - Project - ::include: - :wxshlba_cw_d.pch++ - MacOS - - - PathRelative - Project - ::include: - :wxshlba_cw_d.pch - MacOS - - - - - wxshlb PPC release - - - - UserSourceTrees - - - AlwaysSearchUserPathstrue - InterpretDOSAndUnixPathstrue - RequireFrameworkStyleIncludesfalse - UserSearchPaths - - SearchPath - Path::include: - PathFormatMacOS - PathRootProject - - Recursivefalse - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path::art: - PathFormatMacOS - PathRootProject - - Recursivefalse - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:generic: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:mac:classic: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:common: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:regex: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:zlib: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:png: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:jpeg: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:iodbc: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:tiff: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:html: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Pathxml - PathFormatUnix - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Pathexpat/lib - PathFormatUnix - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SystemSearchPaths - - SearchPath - Path:MSL: - PathFormatMacOS - PathRootCodeWarrior - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:MacOS Support: - PathFormatMacOS - PathRootCodeWarrior - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - - - MWRuntimeSettings_WorkingDirectory - MWRuntimeSettings_CommandLine - MWRuntimeSettings_HostApplication - Path - PathFormatGeneric - PathRootAbsolute - - MWRuntimeSettings_EnvVars - - - LinkerMacOS PPC Linker - PreLinker - PostLinker - Targetnamewxshlb PPC release - OutputDirectory - Path::lib: - PathFormatMacOS - PathRootProject - - SaveEntriesUsingRelativePathstrue - - - FileMappings - - FileTypeAPPL - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypeAppl - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypeMMLB - FileExtension - CompilerLib Import PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeMPLF - FileExtension - CompilerLib Import PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeMWCD - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypeRSRC - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.bh - CompilerBalloon Help - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.c - CompilerMW C/C++ PPC - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.c++ - CompilerMW C/C++ PPC - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.cc - CompilerMW C/C++ PPC - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.cp - CompilerMW C/C++ PPC - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.cpp - CompilerMW C/C++ PPC - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.exp - Compiler - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.h - CompilerMW C/C++ PPC - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMaketrue - - - FileTypeTEXT - FileExtension.p - CompilerMW Pascal PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.pas - CompilerMW Pascal PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.pch - CompilerMW C/C++ PPC - EditLanguageC/C++ - Precompiletrue - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.pch++ - CompilerMW C/C++ PPC - EditLanguageC/C++ - Precompiletrue - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.ppu - CompilerMW Pascal PPC - EditLanguage - Precompiletrue - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.r - CompilerRez - EditLanguageRez - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.s - CompilerPPCAsm - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeXCOF - FileExtension - CompilerXCOFF Import PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeXPM - FileExtension.xpm - CompilerMW C/C++ PPC - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypedocu - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypersrc - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypeshlb - FileExtension - CompilerPEF Import PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypestub - FileExtension - CompilerPEF Import PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileExtension.doc - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFilefalse - IgnoredByMaketrue - - - FileExtension.o - CompilerXCOFF Import PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileExtension.ppob - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileExtension.rsrc - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - - - CacheModDatestrue - DumpBrowserInfofalse - CacheSubprojectstrue - UseThirdPartyDebuggerfalse - BrowserGenerator1 - DebuggerAppPath - Path - PathFormatGeneric - PathRootAbsolute - - DebuggerCmdLineArgs - DebuggerWorkingDir - Path - PathFormatGeneric - PathRootAbsolute - - CodeCompletionPrefixFileNameMacHeaders.c - CodeCompletionMacroFileNameMacOS_Carbon_C++_Macros.h - - - ConsoleEncoding0 - LogSystemMessagestrue - AutoTargetDLLsfalse - StopAtWatchpointstrue - PauseWhileRunningfalse - PauseInterval5 - PauseUIFlags0 - AltExePath - Path - PathFormatGeneric - PathRootAbsolute - - StopAtTempBPOnLaunchtrue - CacheSymbolicstrue - TempBPFunctionNamemain - TempBPType0 - - - Enabledfalse - ConnectionName - DownloadPath - LaunchRemoteAppfalse - RemoteAppPath - CoreID0 - JTAGClockSpeed8000 - IsMultiCorefalse - OSDownloadfalse - UseGlobalOSDownloadfalse - OSDownloadConnectionName - OSDownloadPath - AltDownloadfalse - AltDownloadConnectionName - - - OtherExecutables - - - CustomColor1 - Red0 - Green32767 - Blue0 - - CustomColor2 - Red0 - Green32767 - Blue0 - - CustomColor3 - Red0 - Green32767 - Blue0 - - CustomColor4 - Red0 - Green32767 - Blue0 - - - - MWFrontEnd_C_cplusplus0 - MWFrontEnd_C_checkprotos0 - MWFrontEnd_C_arm0 - MWFrontEnd_C_trigraphs0 - MWFrontEnd_C_onlystdkeywords0 - MWFrontEnd_C_enumsalwaysint0 - MWFrontEnd_C_mpwpointerstyle1 - MWFrontEnd_C_prefixnamewx/wxshlb_cw.h - MWFrontEnd_C_ansistrict0 - MWFrontEnd_C_mpwcnewline0 - MWFrontEnd_C_wchar_type1 - MWFrontEnd_C_enableexceptions1 - MWFrontEnd_C_dontreusestrings0 - MWFrontEnd_C_poolstrings0 - MWFrontEnd_C_dontinline0 - MWFrontEnd_C_useRTTI1 - MWFrontEnd_C_multibyteaware0 - MWFrontEnd_C_unsignedchars1 - MWFrontEnd_C_autoinline0 - MWFrontEnd_C_booltruefalse1 - MWFrontEnd_C_inlinelevel0 - MWFrontEnd_C_ecplusplus0 - MWFrontEnd_C_objective_c0 - MWFrontEnd_C_defer_codegen0 - MWFrontEnd_C_templateparser0 - MWFrontEnd_C_c990 - MWFrontEnd_C_bottomupinline1 - - - MWWarning_C_warn_illpragma1 - MWWarning_C_warn_emptydecl0 - MWWarning_C_warn_possunwant0 - MWWarning_C_warn_unusedvar0 - MWWarning_C_warn_unusedarg0 - MWWarning_C_warn_extracomma0 - MWWarning_C_pedantic1 - MWWarning_C_warningerrors0 - MWWarning_C_warn_hidevirtual1 - MWWarning_C_warn_implicitconv0 - MWWarning_C_warn_notinlined0 - MWWarning_C_warn_structclass1 - - - MWFTP_Post_hostName - MWFTP_Post_username - MWFTP_Post_password0ÿÄ@ž–@)t - MWFTP_Post_remoteDir - MWFTP_Post_ftp_PathVersion1 - MWFTP_Post_ftp_PathType0 - MWFTP_Post_ftp_PathFormat0 - MWFTP_Post_ftp_tree - MWFTP_Post_uploadDir - MWFTP_Post_ftp_port21 - MWFTP_Post_SendBin1 - MWFTP_Post_ShouldLog1 - - - MWCommandLine_Java_clsName - MWCommandLine_Java_args - - - MWVJavaDebugging_Protocol1 - MWVJavaDebugging_JDKVersion1 - MWVJavaDebugging_TimeOut10 - MWVJavaDebugging_SupportSlowDevicesfalse - MWVJavaDebugging_UseRemoteLaunchAgentfalse - MWVJavaDebugging_LaunchVMasServerfalse - - - MWJava_Language_optimizefalse - MWJava_Language_warnDeprecatedfalse - MWJava_Language_emitMapfalse - MWJava_Language_strictFileNamesfalse - MWJava_Language_strictFileHierarchyfalse - MWJava_Language_1_1_Compatiblefalse - MWJava_Language_emitHeaders0 - MWJava_Language_headerTypeJNINativeHeaders - MWJava_Language_packageFilter - MWJava_Language_genCommentstrue - MWJava_Language_genHeadersfalse - MWJava_Language_enableAssertsfalse - MWJava_Language_targetVM1.1 - - - Manifest-JAD Attributes - - AttributeMain-Class - ValueAuto-Generated - - - - - MWJava_MRJAppBuilder_outFileMRJApplication - MWJava_MRJAppBuilder_mergefalse - MWJava_MRJAppBuilder_quitMenutrue - MWJava_MRJAppBuilder_growfalse - MWJava_MRJAppBuilder_stdoutTypeConsole - MWJava_MRJAppBuilder_stderrTypeConsole - MWJava_MRJAppBuilder_stdinTypeConsole - MWJava_MRJAppBuilder_appIconPVersion0 - MWJava_MRJAppBuilder_appIconPType0 - MWJava_MRJAppBuilder_appIconPFormat0 - MWJava_MRJAppBuilder_appIconPTree - MWJava_MRJAppBuilder_appIconFile - MWJava_MRJAppBuilder_splashScreenPVersion0 - MWJava_MRJAppBuilder_splashScreenPType0 - MWJava_MRJAppBuilder_splashScreenPFormat0 - MWJava_MRJAppBuilder_splashScreenPTree - MWJava_MRJAppBuilder_splashScreenPICTFile - MWJava_MRJAppBuilder_aboutName - MWJava_MRJAppBuilder_stdoutPVersion0 - MWJava_MRJAppBuilder_stdoutPType0 - MWJava_MRJAppBuilder_stdoutPFormat0 - MWJava_MRJAppBuilder_stdoutPTree - MWJava_MRJAppBuilder_stdoutFile - MWJava_MRJAppBuilder_stdoutAppendfalse - MWJava_MRJAppBuilder_stderrPType0 - MWJava_MRJAppBuilder_stderrPFormat0 - MWJava_MRJAppBuilder_stderrPTree - MWJava_MRJAppBuilder_stderrFile - MWJava_MRJAppBuilder_stderrAppendfalse - MWJava_MRJAppBuilder_stdinPType0 - MWJava_MRJAppBuilder_stdinPFormat0 - MWJava_MRJAppBuilder_stdinPTree - MWJava_MRJAppBuilder_stdinFile - - - MWJava_Output_outputtypeJarFile - MWJava_Output_outfileJavaClasses.jar - MWJava_Output_ftype1514754080 - MWJava_Output_fcreator1297570384 - MWJava_Output_compress0 - MWJava_Output_genManifest0 - MWJava_Output_trunctypeFront - MWJava_Output_deleteClasses0 - MWJava_Output_consoleApp1 - MWJava_Output_preverify0 - MWJava_Output_genJad0 - MWJava_Output_obfuscate0 - - - MWJava_Proj_projtypeApplet - MWJava_Proj_mainClassName - MWJava_Proj_HTMLAppCreator1145457748 - MWJava_Proj_HTMLAppNameMetrowerks Java - MWJava_Proj_PathVersion1 - MWJava_Proj_PathType0 - MWJava_Proj_PathFormat0 - MWJava_Proj_tree - MWJava_Proj_HTMLAppWin32NameInternet Explorer - MWJava_Proj_compress0 - MWJava_Proj_simulator0 - MWJava_Proj_useVM\000\000macosx - MWJava_Proj_vmarguments - MWJava_Proj_vmName - MWJava_Proj_simPropFile - - - MWJavaDoc_Proj_Version1 - MWJavaDoc_Proj_Deprecated1 - MWJavaDoc_Proj_Author1 - MWJavaDoc_Proj_Index1 - MWJavaDoc_Proj_Tree1 - MWJavaDoc_Proj_SunResolveToSame0 - MWJavaDoc_Proj_Shortnames1 - MWJavaDoc_Proj_Folder0 - MWJavaDoc_Proj_GenerateAPILinks0 - MWJavaDoc_Proj_scopePublic - MWJavaDoc_Proj_fcreator1297303877 - MWJavaDoc_Proj_encodingName - MWJavaDoc_Proj_decodingName - MWJavaDoc_Proj_javaPackagePathhttp://java.sun.com/products/jdk/1.1/docs/api/ - - - MWMerge_MacOS_projectTypeApplication - MWMerge_MacOS_outputNameMerge Out - MWMerge_MacOS_outputCreator???? - MWMerge_MacOS_outputTypeAPPL - MWMerge_MacOS_suppressWarning0 - MWMerge_MacOS_copyFragments1 - MWMerge_MacOS_copyResources1 - MWMerge_MacOS_flattenResource0 - MWMerge_MacOS_flatFileNamea.rsrc - MWMerge_MacOS_flatFileOutputPath - Path: - PathFormatMacOS - PathRootProject - - MWMerge_MacOS_skipResources - DLGX - ckid - Proj - WSPC - - - - FileLockedfalse - ResourcesMapIsReadOnlyfalse - PrinterDriverIsMultiFinderCompatiblefalse - Invisiblefalse - HasBundlefalse - NameLockedfalse - Stationeryfalse - HasCustomIconfalse - Sharedfalse - HasBeenInitedfalse - Label0 - Comments - - - MWMacOSPackager_UsePackager0 - MWMacOSPackager_FolderToPackage - Path - PathFormatMacOS - PathRootAbsolute - - MWMacOSPackager_CreateClassicAlias0 - MWMacOSPackager_ClassicAliasMethodUseTargetOutput - MWMacOSPackager_ClassicAliasPath - Path - PathFormatMacOS - PathRootAbsolute - - MWMacOSPackager_CreatePkgInfo0 - MWMacOSPackager_PkgCreatorType???? - MWMacOSPackager_PkgFileTypeAPPL - - - MWCodeGen_PPC_structalignmentPPC_mw - MWCodeGen_PPC_tracebacktablesInline - MWCodeGen_PPC_processorGeneric - MWCodeGen_PPC_function_align4 - MWCodeGen_PPC_tocdata1 - MWCodeGen_PPC_largetoc0 - MWCodeGen_PPC_profiler0 - MWCodeGen_PPC_vectortocdata0 - MWCodeGen_PPC_poolconst0 - MWCodeGen_PPC_peephole1 - MWCodeGen_PPC_readonlystrings0 - MWCodeGen_PPC_linkerpoolsstrings0 - MWCodeGen_PPC_volatileasm0 - MWCodeGen_PPC_schedule0 - MWCodeGen_PPC_altivec0 - MWCodeGen_PPC_altivec_move_block0 - MWCodeGen_PPC_strictIEEEfp0 - MWCodeGen_PPC_fpcontract1 - MWCodeGen_PPC_genfsel0 - MWCodeGen_PPC_orderedfpcmp0 - - - MWCodeGen_MachO_structalignmentPPC_mw - MWCodeGen_MachO_profiler_enumOff - MWCodeGen_MachO_processorGeneric - MWCodeGen_MachO_function_align4 - MWCodeGen_MachO_common0 - MWCodeGen_MachO_peephole1 - MWCodeGen_MachO_readonlystrings0 - MWCodeGen_MachO_linkerpoolsstrings1 - MWCodeGen_MachO_volatileasm0 - MWCodeGen_MachO_schedule0 - MWCodeGen_MachO_altivec0 - MWCodeGen_MachO_vecmove0 - MWCodeGen_MachO_fp_ieee_strict0 - MWCodeGen_MachO_fpcontract1 - MWCodeGen_MachO_genfsel0 - MWCodeGen_MachO_fp_cmps_ordered0 - - - MWDisassembler_PPC_showcode1 - MWDisassembler_PPC_extended1 - MWDisassembler_PPC_mix0 - MWDisassembler_PPC_nohex0 - MWDisassembler_PPC_showdata1 - MWDisassembler_PPC_showexceptions1 - MWDisassembler_PPC_showsym1 - MWDisassembler_PPC_shownames1 - - - GlobalOptimizer_PPC_optimizationlevelLevel0 - GlobalOptimizer_PPC_optforSpeed - - - MWLinker_PPC_linksym1 - MWLinker_PPC_symfullpath1 - MWLinker_PPC_linkmap0 - MWLinker_PPC_nolinkwarnings0 - MWLinker_PPC_dontdeadstripinitcode0 - MWLinker_PPC_permitmultdefs0 - MWLinker_PPC_linkmodeFast - MWLinker_PPC_initname__initialize - MWLinker_PPC_mainname - MWLinker_PPC_termname__terminate - - - MWLinker_MacOSX_linksym0 - MWLinker_MacOSX_symfullpath0 - MWLinker_MacOSX_nolinkwarnings0 - MWLinker_MacOSX_linkmap0 - MWLinker_MacOSX_dontdeadstripinitcode0 - MWLinker_MacOSX_permitmultdefs1 - MWLinker_MacOSX_use_objectivec_semantics0 - MWLinker_MacOSX_strip_debug_symbols0 - MWLinker_MacOSX_split_segs0 - MWLinker_MacOSX_report_msl_overloads0 - MWLinker_MacOSX_objects_follow_linkorder0 - MWLinker_MacOSX_linkmodeFast - MWLinker_MacOSX_exportsReferencedGlobals - MWLinker_MacOSX_sortcodeNone - MWLinker_MacOSX_mainnamestart - - - MWProject_MacOSX_typeSharedLibrary - MWProject_MacOSX_outfilewx_PPC.shlb - MWProject_MacOSX_filecreator???? - MWProject_MacOSX_filetypeshlb - MWProject_MacOSX_vmaddress4096 - MWProject_MacOSX_usedefaultvmaddr1 - MWProject_MacOSX_flatrsrc0 - MWProject_MacOSX_flatrsrcfilename - MWProject_MacOSX_flatrsrcoutputdir - Path: - PathFormatMacOS - PathRootProject - - MWProject_MacOSX_installpath./ - MWProject_MacOSX_dont_prebind0 - MWProject_MacOSX_flat_namespace0 - MWProject_MacOSX_frameworkversionA - MWProject_MacOSX_currentversion0 - MWProject_MacOSX_flat_oldimpversion0 - - - MWLinker_MachO_exportsNone - MWLinker_MachO_mainnamestart - MWLinker_MachO_currentversion0 - MWLinker_MachO_compatibleversion0 - MWLinker_MachO_symfullpath0 - MWLinker_MachO_supresswarnings0 - MWLinker_MachO_multisymerror0 - MWLinker_MachO_prebind1 - MWLinker_MachO_deadstrip1 - MWLinker_MachO_objectivecsemantics0 - MWLinker_MachO_whichfileloaded0 - MWLinker_MachO_whyfileloaded0 - MWLinker_MachO_readonlyrelocsErrors - MWLinker_MachO_undefinedsymbolsErrors - MWLinker_MachO_twolevelnamespace1 - MWLinker_MachO_stripdebugsymbols0 - - - MWProject_MachO_typeExecutable - MWProject_MachO_outfilea.exe - MWProject_MachO_filecreator???? - MWProject_MachO_filetypeMEXE - MWProject_MachO_vmaddress4096 - MWProject_MachO_flatrsrc1 - MWProject_MachO_flatrsrcfilenamea.rsrc - MWProject_MachO_flatrsrcoutputdir - Path: - PathFormatMacOS - PathRootProject - - MWProject_MachO_installpath./ - MWProject_MachO_frameworkversion - - - MWPEF_exportsPragma - MWPEF_libfolder0 - MWPEF_sortcodeNone - MWPEF_expandbss0 - MWPEF_sharedata0 - MWPEF_olddefversion0 - MWPEF_oldimpversion0 - MWPEF_currentversion0 - MWPEF_fragmentname - MWPEF_collapsereloads0 - - - MWProject_PPC_typeSharedLibrary - MWProject_PPC_outfilewx_PPC.shlb - MWProject_PPC_filecreator???? - MWProject_PPC_filetypeshlb - MWProject_PPC_size0 - MWProject_PPC_minsize0 - MWProject_PPC_stacksize0 - MWProject_PPC_flags0 - MWProject_PPC_symfilename - MWProject_PPC_rsrcname - MWProject_PPC_rsrcheaderNative - MWProject_PPC_rsrctype???? - MWProject_PPC_rsrcid0 - MWProject_PPC_rsrcflags0 - MWProject_PPC_rsrcstore0 - MWProject_PPC_rsrcmerge0 - MWProject_PPC_flatrsrc0 - MWProject_PPC_flatrsrcoutputdir - Path: - PathFormatMacOS - PathRootProject - - MWProject_PPC_flatrsrcfilename - - - MWAssembler_PPC_auxheader0 - MWAssembler_PPC_symmodeMac - MWAssembler_PPC_dialectPPC - MWAssembler_PPC_prefixfile - MWAssembler_PPC_typecheck0 - MWAssembler_PPC_warnings0 - MWAssembler_PPC_casesensitive0 - - - PList_OutputTypeFile - PList_OutputEncodingUTF-8 - PList_Prefix - PList_FileFilenameInfo.plist - PList_FileDirectory - Path: - PathFormatMacOS - PathRootProject - - PList_ResourceTypeplst - PList_ResourceID0 - PList_ResourceName - - - MWRez_Language_maxwidth80 - MWRez_Language_scriptRoman - MWRez_Language_alignmentAlign1 - MWRez_Language_filtermodeFilterSkip - MWRez_Language_suppresswarnings0 - MWRez_Language_escapecontrolchars1 - MWRez_Language_prefixname - MWRez_Language_filteredtypes'CODE' 'DATA' 'PICT' - - - MWWinRC_prefixname - - - MWCodeGen_X86_processorGeneric - MWCodeGen_X86_alignmentbytes8 - MWCodeGen_X86_exceptionsZeroOverhead - MWCodeGen_X86_name_manglingMWWin32 - MWCodeGen_X86_use_extinst0 - MWCodeGen_X86_extinst_mmx0 - MWCodeGen_X86_extinst_3dnow0 - MWCodeGen_X86_use_mmx_3dnow_convention0 - MWCodeGen_X86_extinst_cmov0 - MWCodeGen_X86_extinst_sse0 - MWCodeGen_X86_extinst_sse20 - MWCodeGen_X86_intrinsics0 - MWCodeGen_X86_optimizeasm0 - MWCodeGen_X86_disableopts0 - MWCodeGen_X86_profile0 - MWLinker_X86_runtimeCustom - MWCodeGen_X86_readonlystrings0 - - - MWLinker_X86_subsysmajorid4 - MWLinker_X86_subsysminorid0 - MWCOFF_X86_opsysmajorid4 - MWCOFF_X86_opsysminorid0 - MWLinker_X86_usrmajorid0 - MWLinker_X86_usrminorid0 - MWProject_X86_maxstacksize1024 - MWProject_X86_minstacksize4 - MWProject_X86_size1024 - MWProject_X86_minsize4 - MWCOFF_X86_coff_flags0 - MWCOFF_X86_dll_flags0 - MWProject_X86_baseaddress4194304 - MWCOFF_X86_filealign512 - MWCOFF_X86_sectionalign4096 - - - PDisasmX86_showHeaderstrue - PDisasmX86_showSectHeaderstrue - PDisasmX86_showSymTabtrue - PDisasmX86_showCodetrue - PDisasmX86_showDatatrue - PDisasmX86_showDebugfalse - PDisasmX86_showExceptionsfalse - PDisasmX86_showRawfalse - PDisasmX86_showAllRawfalse - PDisasmX86_showSourcefalse - PDisasmX86_showRelocationtrue - PDisasmX86_showHextrue - PDisasmX86_showCommentsfalse - PDisasmX86_showSymDefstrue - PDisasmX86_unmangletrue - PDisasmX86_verbosetrue - PDisasmX86_resolveRelocstrue - PDisasmX86_resolveLocalsfalse - - - MWDebugger_X86_Exceptions - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - - - - GlobalOptimizer_X86_optimizationlevelLevel0 - GlobalOptimizer_X86_optforSpeed - - - MWLinker_X86_entrypointusageDefault - MWLinker_X86_entrypoint - MWLinker_X86_subsystemWinGUI - MWLinker_X86_commandfile - MWLinker_X86_generatemap0 - MWLinker_X86_linksym1 - MWLinker_X86_linkCV1 - MWLinker_X86_symfullpathfalse - MWLinker_X86_linkdebugtrue - MWLinker_X86_checksumfalse - MWLinker_X86_zero_init_bssfalse - MWLinker_X86_mergedatafalse - MWLinker_X86_usedefaultlibsfalse - MWLinker_X86_adddefaultlibsfalse - MWLinker_X86_nowarningsfalse - MWLinker_X86_verbosefalse - - - MWProject_X86_typeLibrary - MWProject_X86_outfilewx_x86_d.lib - MWProject_X86_importlib - MWProject_X86_setimportlibdirfalse - MWProject_X86_dontgenerateimportlibfalse - MWProject_X86_oldformatlibfalse - MWProject_X86_replaceobjextensionfalse - MWProject_X86_copyallfilesfalse - - - - PathRelative - Project - :mac:classic: - :accel.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :app.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :bitmap.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :bmpbuttn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :brush.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :button.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :checkbox.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :checklst.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :choice.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :clipbrd.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :colordlg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :colour.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :combobox.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :control.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :cursor.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :data.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :dc.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :dcclient.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :dcmemory.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :dcscreen.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :dialog.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :dirdlg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :filedlg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :font.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :fontdlg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :frame.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :gauge.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :gdiobj.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :icon.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :joystick.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :listbox.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :main.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :mdi.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :menu.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :menuitem.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :minifram.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :msgdlg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :palette.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :pen.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :printdlg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :radiobox.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :radiobut.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :region.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :scrolbar.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :settings.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :slider.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :spinbutt.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :statbmp.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :statbox.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :stattext.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :tabctrl.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :textctrl.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :thread.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :timer.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :toolbar.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :utils.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :utilsexc.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :sound.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :window.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :printmac.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :dcprint.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :uma.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :sckipc.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :matrix.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :tbarbase.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :imagjpeg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :longlong.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :docmdi.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :appcmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :utilscmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :dynlib.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :extended.c - MacOS - Text - Debug - - - PathRelative - Project - :common: - :unzip.c - MacOS - Text - Debug - - - PathRelative - Project - :common: - :sckstrm.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :zstream.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :process.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :sizer.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :imagall.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :imaggif.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :imagpcx.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :cmndata.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :ftp.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :menucmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :string.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :wfstream.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :stream.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :gdicmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :protocol.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :layout.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :valgen.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :intl.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :list.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :socket.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :hash.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :dlgcmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :gifdecod.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :filefn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :wincmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :wxchar.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :memory.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :mstream.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :lboxcmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :fs_inet.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :event.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :image.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :ipcbase.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :tokenzr.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :txtstrm.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :filesys.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :url.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :fs_zip.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :prntbase.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :dcbase.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :object.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :http.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :module.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :validate.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :file.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :config.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :fileconf.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :timercmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :framecmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :textfile.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :dynarray.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :choiccmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :helpbase.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :ctrlsub.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :ctrlcmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :strconv.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :sckfile.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :valtext.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :datstrm.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :sckaddr.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :variant.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :dbtable.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :fontcmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :ffile.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :paper.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :clipcmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :imagpnm.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :imagpng.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :imagbmp.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :zipstrm.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :log.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :textcmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :laywin.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :busyinfo.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :listctrl.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :textdlgg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :tipdlg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :numdlgg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :sashwin.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :dcpsg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :panelg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :imaglist.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :tabg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :choicdgg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :wizard.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :progdlgg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :caret.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :statusbr.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :logg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :fontdlgg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :splitter.cpp - MacOS - Text - Debug - - - Name - db.cpp - MacOS - Text - Debug - - - Name - dobjcmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :fontmap.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :geometry.cpp - MacOS - Text - Debug - - - Name - colrdlgg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :fontutil.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :dataobj.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :m_list.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :m_tables.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :htmlwin.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :m_pre.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :m_image.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :htmprint.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :htmlfilt.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :htmlpars.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :htmltag.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :m_hline.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :winpars.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :htmlcell.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :m_layout.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :m_fonts.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :m_links.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :fontenum.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :datetime.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :encconv.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :mimecmn.cpp - MacOS - Text - Debug - - - Name - metafile.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :gsocket.c - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :macnotfy.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :statbrma.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :tooltip.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :statlmac.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :imagtiff.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :treectlg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :notebmac.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :m_dflist.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :treebase.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :cshelp.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :dirmac.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :mimetmac.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :filename.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :spinctrl.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :glcanvas.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :xpmdecod.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :imagxpm.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :dirctrlg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :helpctrl.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :helpfrm.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :helpdata.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :tipwin.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :radiocmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :nbkbase.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :scrlwing.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :gaugecmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :containr.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :quantize.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :toplvcmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :toplevel.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :morefile:DirectoryCopy.c - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :morefile:Search.c - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :morefile:MoreFilesExtras.c - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :morefile:MoreFiles.c - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :morefile:MoreDesktopMgr.c - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :morefile:IterateDirectory.c - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :morefile:FullPath.c - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :morefile:FSpCompat.c - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :morefile:FileCopy.c - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :gridsel.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :grid.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :statbar.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :clntdata.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :textbuf.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :dragimgg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :calctrl.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :bmpbase.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :cmdline.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :cmdproc.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :dndcmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:classic: - :dnd.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :dbgrid.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :dircmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :dseldlg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :dynload.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :effects.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :fddlgcmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :fs_mem.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :regex.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :sysopt.cpp - MacOS - Text - Debug - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:PPCLibraries:CursorDevicesGlue.o - MacOS - Library - Debug - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:PPCLibraries:OpenTptATalkPPC.o - MacOS - Library - Debug - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:PPCLibraries:CarbonAccessors.o - MacOS - Library - Debug - - - PathRelative - CodeWarrior - :MacOS Support: - :Libraries:Sources:PLStringFuncs:Libs:PLStringFuncsPPC.lib - MacOS - Library - Debug - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:PPCLibraries:OpenTptInetPPC.o - MacOS - Library - Debug - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:NavigationLib - MacOS - Library - Debug - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:ControlsLib - MacOS - Library - Debug - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:DialogsLib - MacOS - Library - Debug - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:WindowsLib - MacOS - Library - Debug - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:MenusLib - MacOS - Library - Debug - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:InterfaceLib - MacOS - Library - Debug - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:MathLib - MacOS - Library - Debug - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:AppearanceLib - MacOS - Library - Debug - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:InternetConfigLib - MacOS - Library - Debug - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:ThreadsLib - MacOS - Library - Debug - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:OpenTransportLib - MacOS - Library - Debug - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:OpenTptAppleTalkLib - MacOS - Library - Debug - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:OpenTptInternetLib - MacOS - Library - Debug - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:UTCUtils - MacOS - Library - Debug - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:TextCommon - MacOS - Library - Debug - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:Textension - MacOS - Library - Debug - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:ATSUnicodeLib - MacOS - Library - Debug - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:UnicodeConverter - MacOS - Library - Debug - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:TextEncodingConverter - MacOS - Library - Debug - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:DragLib - MacOS - Library - Debug - - - PathRelative - CodeWarrior - :MacOS Support: - :OpenGL:Libraries:OpenGLLibraryStub - MacOS - Library - Debug - - - PathRelative - Project - :common: - :imagiff.cpp - MacOS - Text - Debug - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:PPCLibraries:OpenTransportExtnPPC.o - MacOS - Library - Debug - - - PathRelative - Project - :mac:classic: - :pnghand.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :docview.cpp - MacOS - Text - Debug - - - PathRelative - Project - ::include: - :wxshlb_cw.pch - MacOS - Text - Debug - - - PathRelative - Project - ::include: - :wxshlb_cw.pch++ - MacOS - Text - Debug - - - PathRelative - CodeWarrior - :MacOS Support: - :Libraries:Runtime:Libs:MSL_ShLibRuntime_PPC.Lib - MacOS - Library - Debug - - - PathRelative - CodeWarrior - :MacOS Support: - :Libraries:Runtime:Libs:MSL_All_PPC.Shlb - MacOS - Library - Debug - - - PathRelative - CodeWarrior - :MSL: - :MSL_C++:MSL_MacOS:Lib:PPC:MSL_C++_PPC.Lib - MacOS - Library - Debug - - - PathRelative - Project - :generic: - :splash.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :fdrepdlg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :gridctrl.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :m_style.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :hashmap.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :dirdlgg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :iconbndl.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :artprov.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :artstd.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :imagfill.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :msgout.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :settcmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :popupcmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :printps.cpp - MacOS - Text - Debug - - - PathRelative - Project - :jpeg: - jpegM8.mcp - Unix - Project - - - - PathRelative - Project - :png: - pngM8.mcp - Unix - Project - - - - PathRelative - Project - :zlib: - zlibM8.mcp - Unix - Project - - - - PathRelative - Project - :tiff: - tiffM8.mcp - Unix - Project - - - - FileRelative - ../../lib/tif_PPC.lib - Unix - - PathRelative - Project - :tiff: - tiffM8.mcp - Unix - - Library - Debug, TargetOutputFile - - - FileRelative - ../../lib/zlib_PPC.lib - Unix - - PathRelative - Project - :zlib: - zlibM8.mcp - Unix - - Library - Debug, TargetOutputFile - - - FileRelative - ../../lib/png_PPC.lib - Unix - - PathRelative - Project - :png: - pngM8.mcp - Unix - - Library - Debug, TargetOutputFile - - - FileRelative - ../../lib/jpeg_PPC.lib - Unix - - PathRelative - Project - :jpeg: - jpegM8.mcp - Unix - - Library - Debug, TargetOutputFile - - - PathRelative - Project - :regex: - regexM8.mcp - Unix - Project - - - - FileRelative - ../../lib/regex_PPC.lib - Unix - - PathRelative - Project - :regex: - regexM8.mcp - Unix - - Library - Debug, TargetOutputFile - - - PathRelative - CodeWarrior - :MSL: - MSL_C/MSL_MacOS/Src/console.stubs.c - Unix - Text - Debug - - - PathRelative - Project - :common: - datacmn.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - rgncmn.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - accesscmn.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - dpycmn.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - taskbarcmn.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - fldlgcmn.cpp - Unix - Text - Debug - - - PathRelative - Project - :generic: - :selstore.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - appbase.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - fmapbase.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - stopwatch.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - init.cpp - Unix - Text - Debug - - - PathRelative - Project - :generic: - renderg.cpp - Unix - Text - Debug - - - PathRelative - Project - :mac:classic: - renderer.cpp - Unix - Text - Debug - - - PathRelative - Project - xml - xml.cpp - Unix - Text - Debug - - - PathRelative - Project - expat/lib - xmlparse.c - Unix - Text - Debug - - - PathRelative - Project - expat/lib - xmlrole.c - Unix - Text - Debug - - - PathRelative - Project - expat/lib - xmltok.c - Unix - Text - Debug - - - PathRelative - Project - :common: - rendcmn.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - bookctrl.cpp - Unix - Text - Debug - - - - - FileRelative - ../../lib/regex_PPC.lib - Unix - - PathRelative - Project - :regex: - regexM8.mcp - Unix - - - - FileRelative - ../../lib/jpeg_PPC.lib - Unix - - PathRelative - Project - :jpeg: - jpegM8.mcp - Unix - - - - FileRelative - ../../lib/png_PPC.lib - Unix - - PathRelative - Project - :png: - pngM8.mcp - Unix - - - - FileRelative - ../../lib/zlib_PPC.lib - Unix - - PathRelative - Project - :zlib: - zlibM8.mcp - Unix - - - - FileRelative - ../../lib/tif_PPC.lib - Unix - - PathRelative - Project - :tiff: - tiffM8.mcp - Unix - - - - PathRelative - Project - :mac:classic: - :accel.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :app.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :bitmap.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :bmpbuttn.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :brush.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :button.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :checkbox.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :checklst.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :choice.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :clipbrd.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :colordlg.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :colour.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :combobox.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :control.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :cursor.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :data.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :dc.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :dcclient.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :dcmemory.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :dcscreen.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :dialog.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :dirdlg.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :filedlg.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :font.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :fontdlg.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :frame.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :gauge.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :gdiobj.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :icon.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :joystick.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :listbox.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :main.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :mdi.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :menu.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :menuitem.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :minifram.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :msgdlg.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :palette.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :pen.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :printdlg.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :radiobox.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :radiobut.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :region.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :scrolbar.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :settings.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :slider.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :spinbutt.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :statbmp.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :statbox.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :stattext.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :tabctrl.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :textctrl.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :thread.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :timer.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :toolbar.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :utils.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :utilsexc.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :sound.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :window.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :printmac.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :dcprint.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :uma.cpp - MacOS - - - PathRelative - Project - :common: - :sckipc.cpp - MacOS - - - PathRelative - Project - :common: - :matrix.cpp - MacOS - - - PathRelative - Project - :common: - :tbarbase.cpp - MacOS - - - PathRelative - Project - :common: - :imagjpeg.cpp - MacOS - - - PathRelative - Project - :common: - :longlong.cpp - MacOS - - - PathRelative - Project - :common: - :docmdi.cpp - MacOS - - - PathRelative - Project - :common: - :appcmn.cpp - MacOS - - - PathRelative - Project - :common: - :utilscmn.cpp - MacOS - - - PathRelative - Project - :common: - :dynlib.cpp - MacOS - - - PathRelative - Project - :common: - :extended.c - MacOS - - - PathRelative - Project - :common: - :unzip.c - MacOS - - - PathRelative - Project - :common: - :sckstrm.cpp - MacOS - - - PathRelative - Project - :common: - :zstream.cpp - MacOS - - - PathRelative - Project - :common: - :process.cpp - MacOS - - - PathRelative - Project - :common: - :sizer.cpp - MacOS - - - PathRelative - Project - :common: - :imagall.cpp - MacOS - - - PathRelative - Project - :common: - :imaggif.cpp - MacOS - - - PathRelative - Project - :common: - :imagpcx.cpp - MacOS - - - PathRelative - Project - :common: - :cmndata.cpp - MacOS - - - PathRelative - Project - :common: - :ftp.cpp - MacOS - - - PathRelative - Project - :common: - :menucmn.cpp - MacOS - - - PathRelative - Project - :common: - :string.cpp - MacOS - - - PathRelative - Project - :common: - :wfstream.cpp - MacOS - - - PathRelative - Project - :common: - :stream.cpp - MacOS - - - PathRelative - Project - :common: - :gdicmn.cpp - MacOS - - - PathRelative - Project - :common: - :protocol.cpp - MacOS - - - PathRelative - Project - :common: - :layout.cpp - MacOS - - - PathRelative - Project - :common: - :valgen.cpp - MacOS - - - PathRelative - Project - :common: - :intl.cpp - MacOS - - - PathRelative - Project - :common: - :list.cpp - MacOS - - - PathRelative - Project - :common: - :socket.cpp - MacOS - - - PathRelative - Project - :common: - :hash.cpp - MacOS - - - PathRelative - Project - :common: - :dlgcmn.cpp - MacOS - - - PathRelative - Project - :common: - :gifdecod.cpp - MacOS - - - PathRelative - Project - :common: - :filefn.cpp - MacOS - - - PathRelative - Project - :common: - :wincmn.cpp - MacOS - - - PathRelative - Project - :common: - :wxchar.cpp - MacOS - - - PathRelative - Project - :common: - :memory.cpp - MacOS - - - PathRelative - Project - :common: - :mstream.cpp - MacOS - - - PathRelative - Project - :common: - :lboxcmn.cpp - MacOS - - - PathRelative - Project - :common: - :fs_inet.cpp - MacOS - - - PathRelative - Project - :common: - :event.cpp - MacOS - - - PathRelative - Project - :common: - :image.cpp - MacOS - - - PathRelative - Project - :common: - :ipcbase.cpp - MacOS - - - PathRelative - Project - :common: - :tokenzr.cpp - MacOS - - - PathRelative - Project - :common: - :txtstrm.cpp - MacOS - - - PathRelative - Project - :common: - :filesys.cpp - MacOS - - - PathRelative - Project - :common: - :url.cpp - MacOS - - - PathRelative - Project - :common: - :fs_zip.cpp - MacOS - - - PathRelative - Project - :common: - :prntbase.cpp - MacOS - - - PathRelative - Project - :common: - :dcbase.cpp - MacOS - - - PathRelative - Project - :common: - :object.cpp - MacOS - - - PathRelative - Project - :common: - :http.cpp - MacOS - - - PathRelative - Project - :common: - :module.cpp - MacOS - - - PathRelative - Project - :common: - :validate.cpp - MacOS - - - PathRelative - Project - :common: - :file.cpp - MacOS - - - PathRelative - Project - :common: - :config.cpp - MacOS - - - PathRelative - Project - :common: - :fileconf.cpp - MacOS - - - PathRelative - Project - :common: - :timercmn.cpp - MacOS - - - PathRelative - Project - :common: - :framecmn.cpp - MacOS - - - PathRelative - Project - :common: - :textfile.cpp - MacOS - - - PathRelative - Project - :common: - :dynarray.cpp - MacOS - - - PathRelative - Project - :common: - :choiccmn.cpp - MacOS - - - PathRelative - Project - :common: - :helpbase.cpp - MacOS - - - PathRelative - Project - :common: - :ctrlsub.cpp - MacOS - - - PathRelative - Project - :common: - :ctrlcmn.cpp - MacOS - - - PathRelative - Project - :common: - :strconv.cpp - MacOS - - - PathRelative - Project - :common: - :sckfile.cpp - MacOS - - - PathRelative - Project - :common: - :valtext.cpp - MacOS - - - PathRelative - Project - :common: - :datstrm.cpp - MacOS - - - PathRelative - Project - :common: - :sckaddr.cpp - MacOS - - - PathRelative - Project - :common: - :variant.cpp - MacOS - - - PathRelative - Project - :common: - :dbtable.cpp - MacOS - - - PathRelative - Project - :common: - :fontcmn.cpp - MacOS - - - PathRelative - Project - :common: - :ffile.cpp - MacOS - - - PathRelative - Project - :common: - :paper.cpp - MacOS - - - PathRelative - Project - :common: - :clipcmn.cpp - MacOS - - - PathRelative - Project - :common: - :imagpnm.cpp - MacOS - - - PathRelative - Project - :common: - :imagpng.cpp - MacOS - - - PathRelative - Project - :common: - :imagbmp.cpp - MacOS - - - PathRelative - Project - :common: - :zipstrm.cpp - MacOS - - - PathRelative - Project - :common: - :log.cpp - MacOS - - - PathRelative - Project - :common: - :textcmn.cpp - MacOS - - - PathRelative - Project - :generic: - :laywin.cpp - MacOS - - - PathRelative - Project - :generic: - :busyinfo.cpp - MacOS - - - PathRelative - Project - :generic: - :listctrl.cpp - MacOS - - - PathRelative - Project - :generic: - :textdlgg.cpp - MacOS - - - PathRelative - Project - :generic: - :tipdlg.cpp - MacOS - - - PathRelative - Project - :generic: - :numdlgg.cpp - MacOS - - - PathRelative - Project - :generic: - :sashwin.cpp - MacOS - - - PathRelative - Project - :generic: - :dcpsg.cpp - MacOS - - - PathRelative - Project - :generic: - :panelg.cpp - MacOS - - - PathRelative - Project - :generic: - :imaglist.cpp - MacOS - - - PathRelative - Project - :generic: - :tabg.cpp - MacOS - - - PathRelative - Project - :generic: - :choicdgg.cpp - MacOS - - - PathRelative - Project - :generic: - :wizard.cpp - MacOS - - - PathRelative - Project - :generic: - :progdlgg.cpp - MacOS - - - PathRelative - Project - :generic: - :caret.cpp - MacOS - - - PathRelative - Project - :generic: - :statusbr.cpp - MacOS - - - PathRelative - Project - :generic: - :logg.cpp - MacOS - - - PathRelative - Project - :generic: - :fontdlgg.cpp - MacOS - - - PathRelative - Project - :generic: - :splitter.cpp - MacOS - - - Name - db.cpp - MacOS - - - Name - dobjcmn.cpp - MacOS - - - PathRelative - Project - :common: - :fontmap.cpp - MacOS - - - PathRelative - Project - :common: - :geometry.cpp - MacOS - - - Name - colrdlgg.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :fontutil.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :dataobj.cpp - MacOS - - - PathRelative - Project - :html: - :m_list.cpp - MacOS - - - PathRelative - Project - :html: - :m_tables.cpp - MacOS - - - PathRelative - Project - :html: - :htmlwin.cpp - MacOS - - - PathRelative - Project - :html: - :m_pre.cpp - MacOS - - - PathRelative - Project - :html: - :m_image.cpp - MacOS - - - PathRelative - Project - :html: - :htmprint.cpp - MacOS - - - PathRelative - Project - :html: - :htmlfilt.cpp - MacOS - - - PathRelative - Project - :html: - :htmlpars.cpp - MacOS - - - PathRelative - Project - :html: - :htmltag.cpp - MacOS - - - PathRelative - Project - :html: - :m_hline.cpp - MacOS - - - PathRelative - Project - :html: - :winpars.cpp - MacOS - - - PathRelative - Project - :html: - :htmlcell.cpp - MacOS - - - PathRelative - Project - :html: - :m_layout.cpp - MacOS - - - PathRelative - Project - :html: - :m_fonts.cpp - MacOS - - - PathRelative - Project - :html: - :m_links.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :fontenum.cpp - MacOS - - - PathRelative - Project - :common: - :datetime.cpp - MacOS - - - PathRelative - Project - :common: - :encconv.cpp - MacOS - - - PathRelative - Project - :common: - :mimecmn.cpp - MacOS - - - Name - metafile.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :gsocket.c - MacOS - - - PathRelative - Project - :mac:classic: - :macnotfy.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :statbrma.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :tooltip.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :statlmac.cpp - MacOS - - - PathRelative - Project - :common: - :imagtiff.cpp - MacOS - - - PathRelative - Project - :generic: - :treectlg.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :notebmac.cpp - MacOS - - - PathRelative - Project - :html: - :m_dflist.cpp - MacOS - - - PathRelative - Project - :common: - :treebase.cpp - MacOS - - - PathRelative - Project - :common: - :cshelp.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :dirmac.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :mimetmac.cpp - MacOS - - - PathRelative - Project - :common: - :filename.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :spinctrl.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :glcanvas.cpp - MacOS - - - PathRelative - Project - :common: - :xpmdecod.cpp - MacOS - - - PathRelative - Project - :common: - :imagxpm.cpp - MacOS - - - PathRelative - Project - :generic: - :dirctrlg.cpp - MacOS - - - PathRelative - Project - :html: - :helpctrl.cpp - MacOS - - - PathRelative - Project - :html: - :helpfrm.cpp - MacOS - - - PathRelative - Project - :html: - :helpdata.cpp - MacOS - - - PathRelative - Project - :generic: - :tipwin.cpp - MacOS - - - PathRelative - Project - :common: - :radiocmn.cpp - MacOS - - - PathRelative - Project - :common: - :nbkbase.cpp - MacOS - - - PathRelative - Project - :generic: - :scrlwing.cpp - MacOS - - - PathRelative - Project - :common: - :gaugecmn.cpp - MacOS - - - PathRelative - Project - :common: - :containr.cpp - MacOS - - - PathRelative - Project - :common: - :quantize.cpp - MacOS - - - PathRelative - Project - :common: - :toplvcmn.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :toplevel.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :morefile:DirectoryCopy.c - MacOS - - - PathRelative - Project - :mac:classic: - :morefile:Search.c - MacOS - - - PathRelative - Project - :mac:classic: - :morefile:MoreFilesExtras.c - MacOS - - - PathRelative - Project - :mac:classic: - :morefile:MoreFiles.c - MacOS - - - PathRelative - Project - :mac:classic: - :morefile:MoreDesktopMgr.c - MacOS - - - PathRelative - Project - :mac:classic: - :morefile:IterateDirectory.c - MacOS - - - PathRelative - Project - :mac:classic: - :morefile:FullPath.c - MacOS - - - PathRelative - Project - :mac:classic: - :morefile:FSpCompat.c - MacOS - - - PathRelative - Project - :mac:classic: - :morefile:FileCopy.c - MacOS - - - PathRelative - Project - :generic: - :gridsel.cpp - MacOS - - - PathRelative - Project - :generic: - :grid.cpp - MacOS - - - PathRelative - Project - :common: - :statbar.cpp - MacOS - - - PathRelative - Project - :common: - :clntdata.cpp - MacOS - - - PathRelative - Project - :common: - :textbuf.cpp - MacOS - - - PathRelative - Project - :generic: - :dragimgg.cpp - MacOS - - - PathRelative - Project - :generic: - :calctrl.cpp - MacOS - - - PathRelative - Project - :common: - :bmpbase.cpp - MacOS - - - PathRelative - Project - :common: - :cmdline.cpp - MacOS - - - PathRelative - Project - :common: - :cmdproc.cpp - MacOS - - - PathRelative - Project - :common: - :dndcmn.cpp - MacOS - - - PathRelative - Project - :mac:classic: - :dnd.cpp - MacOS - - - PathRelative - Project - :common: - :dbgrid.cpp - MacOS - - - PathRelative - Project - :common: - :dircmn.cpp - MacOS - - - PathRelative - Project - :common: - :dseldlg.cpp - MacOS - - - PathRelative - Project - :common: - :dynload.cpp - MacOS - - - PathRelative - Project - :common: - :effects.cpp - MacOS - - - PathRelative - Project - :common: - :fddlgcmn.cpp - MacOS - - - PathRelative - Project - :common: - :fs_mem.cpp - MacOS - - - PathRelative - Project - :common: - :regex.cpp - MacOS - - - PathRelative - Project - :common: - :sysopt.cpp - MacOS - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:PPCLibraries:CursorDevicesGlue.o - MacOS - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:PPCLibraries:OpenTptATalkPPC.o - MacOS - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:PPCLibraries:CarbonAccessors.o - MacOS - - - PathRelative - CodeWarrior - :MacOS Support: - :Libraries:Sources:PLStringFuncs:Libs:PLStringFuncsPPC.lib - MacOS - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:PPCLibraries:OpenTptInetPPC.o - MacOS - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:NavigationLib - MacOS - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:ControlsLib - MacOS - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:DialogsLib - MacOS - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:WindowsLib - MacOS - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:MenusLib - MacOS - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:InterfaceLib - MacOS - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:MathLib - MacOS - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:AppearanceLib - MacOS - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:InternetConfigLib - MacOS - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:ThreadsLib - MacOS - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:OpenTransportLib - MacOS - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:OpenTptAppleTalkLib - MacOS - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:OpenTptInternetLib - MacOS - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:UTCUtils - MacOS - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:TextCommon - MacOS - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:Textension - MacOS - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:ATSUnicodeLib - MacOS - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:UnicodeConverter - MacOS - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:TextEncodingConverter - MacOS - - - PathRelative - CodeWarrior - :MacOS Support: - :OpenGL:Libraries:OpenGLLibraryStub - MacOS - - - PathRelative - Project - :common: - :imagiff.cpp - MacOS - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:PPCLibraries:OpenTransportExtnPPC.o - MacOS - - - PathRelative - Project - :mac:classic: - :pnghand.cpp - MacOS - - - PathRelative - Project - :common: - :docview.cpp - MacOS - - - PathRelative - Project - ::include: - :wxshlb_cw.pch - MacOS - - - PathRelative - Project - ::include: - :wxshlb_cw.pch++ - MacOS - - - PathRelative - CodeWarrior - :MSL: - MSL_C/MSL_MacOS/Src/console.stubs.c - Unix - - - PathRelative - CodeWarrior - :MacOS Support: - :Libraries:Runtime:Libs:MSL_ShLibRuntime_PPC.Lib - MacOS - - - PathRelative - CodeWarrior - :MacOS Support: - :Libraries:Runtime:Libs:MSL_All_PPC.Shlb - MacOS - - - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:DragLib - MacOS - - - PathRelative - CodeWarrior - :MSL: - :MSL_C++:MSL_MacOS:Lib:PPC:MSL_C++_PPC.Lib - MacOS - - - PathRelative - Project - :generic: - :splash.cpp - MacOS - - - PathRelative - Project - :generic: - :fdrepdlg.cpp - MacOS - - - PathRelative - Project - :generic: - :gridctrl.cpp - MacOS - - - PathRelative - Project - :html: - :m_style.cpp - MacOS - - - PathRelative - Project - :common: - :hashmap.cpp - MacOS - - - PathRelative - Project - :generic: - :dirdlgg.cpp - MacOS - - - PathRelative - Project - :common: - :iconbndl.cpp - MacOS - - - PathRelative - Project - :common: - :artprov.cpp - MacOS - - - PathRelative - Project - :common: - :artstd.cpp - MacOS - - - PathRelative - Project - :common: - :imagfill.cpp - MacOS - - - PathRelative - Project - :common: - :msgout.cpp - MacOS - - - PathRelative - Project - :common: - :settcmn.cpp - MacOS - - - PathRelative - Project - :common: - :popupcmn.cpp - MacOS - - - PathRelative - Project - :generic: - :printps.cpp - MacOS - - - PathRelative - Project - :common: - datacmn.cpp - Unix - - - PathRelative - Project - :common: - rgncmn.cpp - Unix - - - PathRelative - Project - :common: - accesscmn.cpp - Unix - - - PathRelative - Project - :common: - dpycmn.cpp - Unix - - - PathRelative - Project - :common: - taskbarcmn.cpp - Unix - - - PathRelative - Project - :common: - fldlgcmn.cpp - Unix - - - PathRelative - Project - :generic: - :selstore.cpp - MacOS - - - PathRelative - Project - :common: - appbase.cpp - Unix - - - PathRelative - Project - :common: - fmapbase.cpp - Unix - - - PathRelative - Project - :common: - stopwatch.cpp - Unix - - - PathRelative - Project - :common: - init.cpp - Unix - - - PathRelative - Project - :generic: - renderg.cpp - Unix - - - PathRelative - Project - :mac:classic: - renderer.cpp - Unix - - - PathRelative - Project - xml - xml.cpp - Unix - - - PathRelative - Project - expat/lib - xmlparse.c - Unix - - - PathRelative - Project - expat/lib - xmlrole.c - Unix - - - PathRelative - Project - expat/lib - xmltok.c - Unix - - - PathRelative - Project - :common: - rendcmn.cpp - Unix - - - PathRelative - Project - :common: - bookctrl.cpp - Unix - - - - - - PathRelative - Project - :jpeg: - jpegM8.mcp - Unix - - - - PPC - LinkAgainst - - FileRelative - ../../lib/jpeg_PPC.lib - Unix - - PathRelative - Project - :jpeg: - jpegM8.mcp - Unix - - - - - - - - PathRelative - Project - :png: - pngM8.mcp - Unix - - - - PPC - LinkAgainst - - FileRelative - ../../lib/png_PPC.lib - Unix - - PathRelative - Project - :png: - pngM8.mcp - Unix - - - - - - - - PathRelative - Project - :zlib: - zlibM8.mcp - Unix - - - - PPC - LinkAgainst - - FileRelative - ../../lib/zlib_PPC.lib - Unix - - PathRelative - Project - :zlib: - zlibM8.mcp - Unix - - - - - - - - PathRelative - Project - :tiff: - tiffM8.mcp - Unix - - - - PPC - LinkAgainst - - FileRelative - ../../lib/tif_PPC.lib - Unix - - PathRelative - Project - :tiff: - tiffM8.mcp - Unix - - - - - - - - PathRelative - Project - :regex: - regexM8.mcp - Unix - - - - PPC - LinkAgainst - - FileRelative - ../../lib/regex_PPC.lib - Unix - - PathRelative - Project - :regex: - regexM8.mcp - Unix - - - - - - - - - wxshlba PPC release - - - - UserSourceTrees - - - AlwaysSearchUserPathstrue - InterpretDOSAndUnixPathstrue - RequireFrameworkStyleIncludesfalse - UserSearchPaths - - SearchPath - Path::include: - PathFormatMacOS - PathRootProject - - Recursivefalse - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path::art: - PathFormatMacOS - PathRootProject - - Recursivefalse - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:generic: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:mac:classic: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:common: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:regex: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:zlib: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:png: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:jpeg: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:iodbc: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:tiff: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:html: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path::lib: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SystemSearchPaths - - SearchPath - Path:MSL: - PathFormatMacOS - PathRootCodeWarrior - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:MacOS Support: - PathFormatMacOS - PathRootCodeWarrior - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - - - MWRuntimeSettings_WorkingDirectory - MWRuntimeSettings_CommandLine - MWRuntimeSettings_HostApplication - Path - PathFormatGeneric - PathRootAbsolute - - MWRuntimeSettings_EnvVars - - - LinkerMacOS PPC Linker - PreLinker - PostLinker - Targetnamewxshlba PPC release - OutputDirectory - Path::lib: - PathFormatMacOS - PathRootProject - - SaveEntriesUsingRelativePathstrue - - - FileMappings - - FileTypeAPPL - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypeAppl - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypeMMLB - FileExtension - CompilerLib Import PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeMPLF - FileExtension - CompilerLib Import PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeMWCD - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypeRSRC - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.bh - CompilerBalloon Help - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.c - CompilerMW C/C++ PPC - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.c++ - CompilerMW C/C++ PPC - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.cc - CompilerMW C/C++ PPC - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.cp - CompilerMW C/C++ PPC - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.cpp - CompilerMW C/C++ PPC - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.exp - Compiler - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.h - CompilerMW C/C++ PPC - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMaketrue - - - FileTypeTEXT - FileExtension.p - CompilerMW Pascal PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.pas - CompilerMW Pascal PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.pch - CompilerMW C/C++ PPC - EditLanguageC/C++ - Precompiletrue - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.pch++ - CompilerMW C/C++ PPC - EditLanguageC/C++ - Precompiletrue - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.ppu - CompilerMW Pascal PPC - EditLanguage - Precompiletrue - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.r - CompilerRez - EditLanguageRez - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.s - CompilerPPCAsm - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeXCOF - FileExtension - CompilerXCOFF Import PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeXPM - FileExtension.xpm - CompilerMW C/C++ PPC - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypedocu - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypersrc - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypeshlb - FileExtension - CompilerPEF Import PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypestub - FileExtension - CompilerPEF Import PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileExtension.doc - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFilefalse - IgnoredByMaketrue - - - FileExtension.o - CompilerXCOFF Import PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileExtension.ppob - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileExtension.rsrc - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - - - CacheModDatestrue - DumpBrowserInfofalse - CacheSubprojectstrue - UseThirdPartyDebuggerfalse - BrowserGenerator1 - DebuggerAppPath - Path - PathFormatGeneric - PathRootAbsolute - - DebuggerCmdLineArgs - DebuggerWorkingDir - Path - PathFormatGeneric - PathRootAbsolute - - CodeCompletionPrefixFileNameMacHeaders.c - CodeCompletionMacroFileNameMacOS_Carbon_C++_Macros.h - - - ConsoleEncoding0 - LogSystemMessagestrue - AutoTargetDLLsfalse - StopAtWatchpointstrue - PauseWhileRunningfalse - PauseInterval5 - PauseUIFlags0 - AltExePath - Path - PathFormatGeneric - PathRootAbsolute - - StopAtTempBPOnLaunchtrue - CacheSymbolicstrue - TempBPFunctionNamemain - TempBPType0 - - - Enabledfalse - ConnectionName - DownloadPath - LaunchRemoteAppfalse - RemoteAppPath - CoreID0 - JTAGClockSpeed8000 - IsMultiCorefalse - OSDownloadfalse - UseGlobalOSDownloadfalse - OSDownloadConnectionName - OSDownloadPath - AltDownloadfalse - AltDownloadConnectionName - - - OtherExecutables - - - CustomColor1 - Red0 - Green32767 - Blue0 - - CustomColor2 - Red0 - Green32767 - Blue0 - - CustomColor3 - Red0 - Green32767 - Blue0 - - CustomColor4 - Red0 - Green32767 - Blue0 - - - - MWFrontEnd_C_cplusplus0 - MWFrontEnd_C_checkprotos0 - MWFrontEnd_C_arm0 - MWFrontEnd_C_trigraphs0 - MWFrontEnd_C_onlystdkeywords0 - MWFrontEnd_C_enumsalwaysint0 - MWFrontEnd_C_mpwpointerstyle1 - MWFrontEnd_C_prefixnamewx/wxshlb_cw_d.h - MWFrontEnd_C_ansistrict0 - MWFrontEnd_C_mpwcnewline0 - MWFrontEnd_C_wchar_type1 - MWFrontEnd_C_enableexceptions1 - MWFrontEnd_C_dontreusestrings0 - MWFrontEnd_C_poolstrings0 - MWFrontEnd_C_dontinline0 - MWFrontEnd_C_useRTTI1 - MWFrontEnd_C_multibyteaware0 - MWFrontEnd_C_unsignedchars1 - MWFrontEnd_C_autoinline0 - MWFrontEnd_C_booltruefalse1 - MWFrontEnd_C_inlinelevel0 - MWFrontEnd_C_ecplusplus0 - MWFrontEnd_C_objective_c0 - MWFrontEnd_C_defer_codegen0 - MWFrontEnd_C_templateparser0 - MWFrontEnd_C_c990 - MWFrontEnd_C_bottomupinline1 - - - MWWarning_C_warn_illpragma1 - MWWarning_C_warn_emptydecl0 - MWWarning_C_warn_possunwant0 - MWWarning_C_warn_unusedvar0 - MWWarning_C_warn_unusedarg0 - MWWarning_C_warn_extracomma0 - MWWarning_C_pedantic1 - MWWarning_C_warningerrors0 - MWWarning_C_warn_hidevirtual1 - MWWarning_C_warn_implicitconv0 - MWWarning_C_warn_notinlined0 - MWWarning_C_warn_structclass1 - - - MWFTP_Post_hostName - MWFTP_Post_username - MWFTP_Post_password0ÿÄ@ž–@)t - MWFTP_Post_remoteDir - MWFTP_Post_ftp_PathVersion1 - MWFTP_Post_ftp_PathType0 - MWFTP_Post_ftp_PathFormat0 - MWFTP_Post_ftp_tree - MWFTP_Post_uploadDir - MWFTP_Post_ftp_port21 - MWFTP_Post_SendBin1 - MWFTP_Post_ShouldLog1 - - - MWCommandLine_Java_clsName - MWCommandLine_Java_args - - - MWVJavaDebugging_Protocol1 - MWVJavaDebugging_JDKVersion1 - MWVJavaDebugging_TimeOut10 - MWVJavaDebugging_SupportSlowDevicesfalse - MWVJavaDebugging_UseRemoteLaunchAgentfalse - MWVJavaDebugging_LaunchVMasServerfalse - - - MWJava_Language_optimizefalse - MWJava_Language_warnDeprecatedfalse - MWJava_Language_emitMapfalse - MWJava_Language_strictFileNamesfalse - MWJava_Language_strictFileHierarchyfalse - MWJava_Language_1_1_Compatiblefalse - MWJava_Language_emitHeaders0 - MWJava_Language_headerTypeJNINativeHeaders - MWJava_Language_packageFilter - MWJava_Language_genCommentstrue - MWJava_Language_genHeadersfalse - MWJava_Language_enableAssertsfalse - MWJava_Language_targetVM1.1 - - - Manifest-JAD Attributes - - AttributeMain-Class - ValueAuto-Generated - - - - - MWJava_MRJAppBuilder_outFileMRJApplication - MWJava_MRJAppBuilder_mergefalse - MWJava_MRJAppBuilder_quitMenutrue - MWJava_MRJAppBuilder_growfalse - MWJava_MRJAppBuilder_stdoutTypeConsole - MWJava_MRJAppBuilder_stderrTypeConsole - MWJava_MRJAppBuilder_stdinTypeConsole - MWJava_MRJAppBuilder_appIconPVersion0 - MWJava_MRJAppBuilder_appIconPType0 - MWJava_MRJAppBuilder_appIconPFormat0 - MWJava_MRJAppBuilder_appIconPTree - MWJava_MRJAppBuilder_appIconFile - MWJava_MRJAppBuilder_splashScreenPVersion0 - MWJava_MRJAppBuilder_splashScreenPType0 - MWJava_MRJAppBuilder_splashScreenPFormat0 - MWJava_MRJAppBuilder_splashScreenPTree - MWJava_MRJAppBuilder_splashScreenPICTFile - MWJava_MRJAppBuilder_aboutName - MWJava_MRJAppBuilder_stdoutPVersion0 - MWJava_MRJAppBuilder_stdoutPType0 - MWJava_MRJAppBuilder_stdoutPFormat0 - MWJava_MRJAppBuilder_stdoutPTree - MWJava_MRJAppBuilder_stdoutFile - MWJava_MRJAppBuilder_stdoutAppendfalse - MWJava_MRJAppBuilder_stderrPType0 - MWJava_MRJAppBuilder_stderrPFormat0 - MWJava_MRJAppBuilder_stderrPTree - MWJava_MRJAppBuilder_stderrFile - MWJava_MRJAppBuilder_stderrAppendfalse - MWJava_MRJAppBuilder_stdinPType0 - MWJava_MRJAppBuilder_stdinPFormat0 - MWJava_MRJAppBuilder_stdinPTree - MWJava_MRJAppBuilder_stdinFile - - - MWJava_Output_outputtypeJarFile - MWJava_Output_outfileJavaClasses.jar - MWJava_Output_ftype1514754080 - MWJava_Output_fcreator1297570384 - MWJava_Output_compress0 - MWJava_Output_genManifest0 - MWJava_Output_trunctypeFront - MWJava_Output_deleteClasses0 - MWJava_Output_consoleApp1 - MWJava_Output_preverify0 - MWJava_Output_genJad0 - MWJava_Output_obfuscate0 - - - MWJava_Proj_projtypeApplet - MWJava_Proj_mainClassName - MWJava_Proj_HTMLAppCreator1145457748 - MWJava_Proj_HTMLAppNameMetrowerks Java - MWJava_Proj_PathVersion1 - MWJava_Proj_PathType0 - MWJava_Proj_PathFormat0 - MWJava_Proj_tree - MWJava_Proj_HTMLAppWin32NameInternet Explorer - MWJava_Proj_compress0 - MWJava_Proj_simulator0 - MWJava_Proj_useVM\000\000macosx - MWJava_Proj_vmarguments - MWJava_Proj_vmName - MWJava_Proj_simPropFile - - - MWJavaDoc_Proj_Version1 - MWJavaDoc_Proj_Deprecated1 - MWJavaDoc_Proj_Author1 - MWJavaDoc_Proj_Index1 - MWJavaDoc_Proj_Tree1 - MWJavaDoc_Proj_SunResolveToSame0 - MWJavaDoc_Proj_Shortnames1 - MWJavaDoc_Proj_Folder0 - MWJavaDoc_Proj_GenerateAPILinks0 - MWJavaDoc_Proj_scopePublic - MWJavaDoc_Proj_fcreator1297303877 - MWJavaDoc_Proj_encodingName - MWJavaDoc_Proj_decodingName - MWJavaDoc_Proj_javaPackagePathhttp://java.sun.com/products/jdk/1.1/docs/api/ - - - MWMerge_MacOS_projectTypeApplication - MWMerge_MacOS_outputNameMerge Out - MWMerge_MacOS_outputCreator???? - MWMerge_MacOS_outputTypeAPPL - MWMerge_MacOS_suppressWarning0 - MWMerge_MacOS_copyFragments1 - MWMerge_MacOS_copyResources1 - MWMerge_MacOS_flattenResource0 - MWMerge_MacOS_flatFileNamea.rsrc - MWMerge_MacOS_flatFileOutputPath - Path: - PathFormatMacOS - PathRootProject - - MWMerge_MacOS_skipResources - DLGX - ckid - Proj - WSPC - - - - FileLockedfalse - ResourcesMapIsReadOnlyfalse - PrinterDriverIsMultiFinderCompatiblefalse - Invisiblefalse - HasBundlefalse - NameLockedfalse - Stationeryfalse - HasCustomIconfalse - Sharedfalse - HasBeenInitedfalse - Label0 - Comments - - - MWMacOSPackager_UsePackager0 - MWMacOSPackager_FolderToPackage - Path - PathFormatMacOS - PathRootAbsolute - - MWMacOSPackager_CreateClassicAlias0 - MWMacOSPackager_ClassicAliasMethodUseTargetOutput - MWMacOSPackager_ClassicAliasPath - Path - PathFormatMacOS - PathRootAbsolute - - MWMacOSPackager_CreatePkgInfo0 - MWMacOSPackager_PkgCreatorType???? - MWMacOSPackager_PkgFileTypeAPPL - - - MWCodeGen_PPC_structalignmentPPC_mw - MWCodeGen_PPC_tracebacktablesInline - MWCodeGen_PPC_processorGeneric - MWCodeGen_PPC_function_align4 - MWCodeGen_PPC_tocdata1 - MWCodeGen_PPC_largetoc0 - MWCodeGen_PPC_profiler0 - MWCodeGen_PPC_vectortocdata0 - MWCodeGen_PPC_poolconst0 - MWCodeGen_PPC_peephole1 - MWCodeGen_PPC_readonlystrings0 - MWCodeGen_PPC_linkerpoolsstrings0 - MWCodeGen_PPC_volatileasm0 - MWCodeGen_PPC_schedule0 - MWCodeGen_PPC_altivec0 - MWCodeGen_PPC_altivec_move_block0 - MWCodeGen_PPC_strictIEEEfp0 - MWCodeGen_PPC_fpcontract1 - MWCodeGen_PPC_genfsel0 - MWCodeGen_PPC_orderedfpcmp0 - - - MWCodeGen_MachO_structalignmentPPC_mw - MWCodeGen_MachO_profiler_enumOff - MWCodeGen_MachO_processorGeneric - MWCodeGen_MachO_function_align4 - MWCodeGen_MachO_common0 - MWCodeGen_MachO_peephole1 - MWCodeGen_MachO_readonlystrings0 - MWCodeGen_MachO_linkerpoolsstrings1 - MWCodeGen_MachO_volatileasm0 - MWCodeGen_MachO_schedule0 - MWCodeGen_MachO_altivec0 - MWCodeGen_MachO_vecmove0 - MWCodeGen_MachO_fp_ieee_strict0 - MWCodeGen_MachO_fpcontract1 - MWCodeGen_MachO_genfsel0 - MWCodeGen_MachO_fp_cmps_ordered0 - - - MWDisassembler_PPC_showcode1 - MWDisassembler_PPC_extended1 - MWDisassembler_PPC_mix0 - MWDisassembler_PPC_nohex0 - MWDisassembler_PPC_showdata1 - MWDisassembler_PPC_showexceptions1 - MWDisassembler_PPC_showsym1 - MWDisassembler_PPC_shownames1 - - - GlobalOptimizer_PPC_optimizationlevelLevel0 - GlobalOptimizer_PPC_optforSpeed - - - MWLinker_PPC_linksym0 - MWLinker_PPC_symfullpath1 - MWLinker_PPC_linkmap0 - MWLinker_PPC_nolinkwarnings0 - MWLinker_PPC_dontdeadstripinitcode0 - MWLinker_PPC_permitmultdefs0 - MWLinker_PPC_linkmodeFast - MWLinker_PPC_initname - MWLinker_PPC_mainname - MWLinker_PPC_termname - - - MWLinker_MacOSX_linksym0 - MWLinker_MacOSX_symfullpath0 - MWLinker_MacOSX_nolinkwarnings0 - MWLinker_MacOSX_linkmap0 - MWLinker_MacOSX_dontdeadstripinitcode0 - MWLinker_MacOSX_permitmultdefs1 - MWLinker_MacOSX_use_objectivec_semantics0 - MWLinker_MacOSX_strip_debug_symbols0 - MWLinker_MacOSX_split_segs0 - MWLinker_MacOSX_report_msl_overloads0 - MWLinker_MacOSX_objects_follow_linkorder0 - MWLinker_MacOSX_linkmodeFast - MWLinker_MacOSX_exportsReferencedGlobals - MWLinker_MacOSX_sortcodeNone - MWLinker_MacOSX_mainnamestart - - - MWProject_MacOSX_typeExecutable - MWProject_MacOSX_outfilewx_PPC_d.shlba - MWProject_MacOSX_filecreator???? - MWProject_MacOSX_filetypestub - MWProject_MacOSX_vmaddress4096 - MWProject_MacOSX_usedefaultvmaddr1 - MWProject_MacOSX_flatrsrc0 - MWProject_MacOSX_flatrsrcfilename - MWProject_MacOSX_flatrsrcoutputdir - Path: - PathFormatMacOS - PathRootProject - - MWProject_MacOSX_installpath./ - MWProject_MacOSX_dont_prebind0 - MWProject_MacOSX_flat_namespace0 - MWProject_MacOSX_frameworkversionA - MWProject_MacOSX_currentversion0 - MWProject_MacOSX_flat_oldimpversion0 - - - MWLinker_MachO_exportsNone - MWLinker_MachO_mainnamestart - MWLinker_MachO_currentversion0 - MWLinker_MachO_compatibleversion0 - MWLinker_MachO_symfullpath0 - MWLinker_MachO_supresswarnings0 - MWLinker_MachO_multisymerror0 - MWLinker_MachO_prebind1 - MWLinker_MachO_deadstrip1 - MWLinker_MachO_objectivecsemantics0 - MWLinker_MachO_whichfileloaded0 - MWLinker_MachO_whyfileloaded0 - MWLinker_MachO_readonlyrelocsErrors - MWLinker_MachO_undefinedsymbolsErrors - MWLinker_MachO_twolevelnamespace1 - MWLinker_MachO_stripdebugsymbols0 - - - MWProject_MachO_typeExecutable - MWProject_MachO_outfilea.exe - MWProject_MachO_filecreator???? - MWProject_MachO_filetypeMEXE - MWProject_MachO_vmaddress4096 - MWProject_MachO_flatrsrc1 - MWProject_MachO_flatrsrcfilenamea.rsrc - MWProject_MachO_flatrsrcoutputdir - Path: - PathFormatMacOS - PathRootProject - - MWProject_MachO_installpath./ - MWProject_MachO_frameworkversion - - - MWPEF_exportsPragma - MWPEF_libfolder0 - MWPEF_sortcodeNone - MWPEF_expandbss0 - MWPEF_sharedata0 - MWPEF_olddefversion0 - MWPEF_oldimpversion0 - MWPEF_currentversion0 - MWPEF_fragmentname - MWPEF_collapsereloads0 - - - MWProject_PPC_typeStubLibrary - MWProject_PPC_outfilewx_PPC_d.shlba - MWProject_PPC_filecreator???? - MWProject_PPC_filetypestub - MWProject_PPC_size0 - MWProject_PPC_minsize0 - MWProject_PPC_stacksize0 - MWProject_PPC_flags0 - MWProject_PPC_symfilename - MWProject_PPC_rsrcname - MWProject_PPC_rsrcheaderNative - MWProject_PPC_rsrctype???? - MWProject_PPC_rsrcid0 - MWProject_PPC_rsrcflags0 - MWProject_PPC_rsrcstore0 - MWProject_PPC_rsrcmerge0 - MWProject_PPC_flatrsrc0 - MWProject_PPC_flatrsrcoutputdir - Path: - PathFormatMacOS - PathRootProject - - MWProject_PPC_flatrsrcfilename - - - MWAssembler_PPC_auxheader0 - MWAssembler_PPC_symmodeMac - MWAssembler_PPC_dialectPPC - MWAssembler_PPC_prefixfile - MWAssembler_PPC_typecheck0 - MWAssembler_PPC_warnings0 - MWAssembler_PPC_casesensitive0 - - - PList_OutputTypeFile - PList_OutputEncodingUTF-8 - PList_Prefix - PList_FileFilenameInfo.plist - PList_FileDirectory - Path: - PathFormatMacOS - PathRootProject - - PList_ResourceTypeplst - PList_ResourceID0 - PList_ResourceName - - - MWRez_Language_maxwidth80 - MWRez_Language_scriptRoman - MWRez_Language_alignmentAlign1 - MWRez_Language_filtermodeFilterSkip - MWRez_Language_suppresswarnings0 - MWRez_Language_escapecontrolchars1 - MWRez_Language_prefixname - MWRez_Language_filteredtypes'CODE' 'DATA' 'PICT' - - - MWWinRC_prefixname - - - MWCodeGen_X86_processorGeneric - MWCodeGen_X86_alignmentbytes8 - MWCodeGen_X86_exceptionsZeroOverhead - MWCodeGen_X86_name_manglingMWWin32 - MWCodeGen_X86_use_extinst0 - MWCodeGen_X86_extinst_mmx0 - MWCodeGen_X86_extinst_3dnow0 - MWCodeGen_X86_use_mmx_3dnow_convention0 - MWCodeGen_X86_extinst_cmov0 - MWCodeGen_X86_extinst_sse0 - MWCodeGen_X86_extinst_sse20 - MWCodeGen_X86_intrinsics0 - MWCodeGen_X86_optimizeasm0 - MWCodeGen_X86_disableopts0 - MWCodeGen_X86_profile0 - MWLinker_X86_runtimeCustom - MWCodeGen_X86_readonlystrings0 - - - MWLinker_X86_subsysmajorid4 - MWLinker_X86_subsysminorid0 - MWCOFF_X86_opsysmajorid4 - MWCOFF_X86_opsysminorid0 - MWLinker_X86_usrmajorid0 - MWLinker_X86_usrminorid0 - MWProject_X86_maxstacksize1024 - MWProject_X86_minstacksize4 - MWProject_X86_size1024 - MWProject_X86_minsize4 - MWCOFF_X86_coff_flags0 - MWCOFF_X86_dll_flags0 - MWProject_X86_baseaddress4194304 - MWCOFF_X86_filealign512 - MWCOFF_X86_sectionalign4096 - - - PDisasmX86_showHeaderstrue - PDisasmX86_showSectHeaderstrue - PDisasmX86_showSymTabtrue - PDisasmX86_showCodetrue - PDisasmX86_showDatatrue - PDisasmX86_showDebugfalse - PDisasmX86_showExceptionsfalse - PDisasmX86_showRawfalse - PDisasmX86_showAllRawfalse - PDisasmX86_showSourcefalse - PDisasmX86_showRelocationtrue - PDisasmX86_showHextrue - PDisasmX86_showCommentsfalse - PDisasmX86_showSymDefstrue - PDisasmX86_unmangletrue - PDisasmX86_verbosetrue - PDisasmX86_resolveRelocstrue - PDisasmX86_resolveLocalsfalse - - - MWDebugger_X86_Exceptions - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - - - - GlobalOptimizer_X86_optimizationlevelLevel0 - GlobalOptimizer_X86_optforSpeed - - - MWLinker_X86_entrypointusageDefault - MWLinker_X86_entrypoint - MWLinker_X86_subsystemWinGUI - MWLinker_X86_commandfile - MWLinker_X86_generatemap0 - MWLinker_X86_linksym1 - MWLinker_X86_linkCV1 - MWLinker_X86_symfullpathfalse - MWLinker_X86_linkdebugtrue - MWLinker_X86_checksumfalse - MWLinker_X86_zero_init_bssfalse - MWLinker_X86_mergedatafalse - MWLinker_X86_usedefaultlibsfalse - MWLinker_X86_adddefaultlibsfalse - MWLinker_X86_nowarningsfalse - MWLinker_X86_verbosefalse - - - MWProject_X86_typeLibrary - MWProject_X86_outfilewx_x86_d.lib - MWProject_X86_importlib - MWProject_X86_setimportlibdirfalse - MWProject_X86_dontgenerateimportlibfalse - MWProject_X86_oldformatlibfalse - MWProject_X86_replaceobjextensionfalse - MWProject_X86_copyallfilesfalse - - - - PathRelative - Project - ::include: - :wxshlba_cw.pch - MacOS - Text - Debug - - - PathRelative - Project - ::include: - :wxshlba_cw.pch++ - MacOS - Text - Debug - - - - - PathRelative - Project - ::include: - :wxshlba_cw.pch - MacOS - - - PathRelative - Project - ::include: - :wxshlba_cw.pch++ - MacOS - - - - - - - wxlib PPC debug - wxlib PPC release - wxlib PPC resources - wxlib PPC profile - wxshlb PPC debug - wxshlb PPC release - wxshlba PPC debug - wxshlba PPC release - all targets - - - - common - - wxlib PPC debug - PathRelative - Project - :common: - accesscmn.cpp - Unix - - - wxlib PPC debug - PathRelative - Project - :common: - appbase.cpp - Unix - - - wxlib PPC debug - PathRelative - Project - :common: - :appcmn.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :common: - :artprov.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :common: - :artstd.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :common: - :bmpbase.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :common: - bookctrl.cpp - Unix - - - wxlib PPC debug - PathRelative - Project - :common: - :choiccmn.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :common: - :clipcmn.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :common: - :clntdata.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :common: - :cmdline.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :common: - :cmdproc.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :common: - :cmndata.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :common: - :config.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :common: - :containr.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :common: - :cshelp.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :common: - :ctrlcmn.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :common: - :ctrlsub.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :common: - datacmn.cpp - Unix - - - wxlib PPC debug - PathRelative - Project - :common: - :datetime.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :common: - :datstrm.cpp - MacOS - - - wxlib PPC debug - Name - db.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :common: - :dbgrid.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :common: - :dbtable.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :common: - :dcbase.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :common: - :dircmn.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :common: - :dlgcmn.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :common: - :dndcmn.cpp - MacOS - - - wxlib PPC debug - Name - dobjcmn.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :common: - :docmdi.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :common: - :docview.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :common: - dpycmn.cpp - Unix - - - wxlib PPC debug - PathRelative - Project - :common: - :dseldlg.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :common: - :dynarray.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :common: - :dynlib.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :common: - :dynload.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :common: - :effects.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :common: - :encconv.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :common: - :event.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :common: - :extended.c - MacOS - - - wxlib PPC debug - PathRelative - Project - :common: - :fddlgcmn.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :common: - :ffile.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :common: - :file.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :common: - :fileconf.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :common: - :filefn.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :common: - :filename.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :common: - :filesys.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :common: - fldlgcmn.cpp - Unix - - - wxlib PPC debug - PathRelative - Project - :common: - fmapbase.cpp - Unix - - - wxlib PPC debug - PathRelative - Project - :common: - :fontcmn.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :common: - :fontmap.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :common: - :framecmn.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :common: - :fs_inet.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :common: - :fs_mem.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :common: - :fs_zip.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :common: - :ftp.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :common: - :gaugecmn.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :common: - :gdicmn.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :common: - :geometry.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :common: - :gifdecod.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :common: - :hash.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :common: - :hashmap.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :common: - :helpbase.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :common: - :http.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :common: - :iconbndl.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :common: - :imagall.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :common: - :imagbmp.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :common: - :image.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :common: - :imagfill.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :common: - :imaggif.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :common: - :imagiff.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :common: - :imagjpeg.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :common: - :imagpcx.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :common: - :imagpng.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :common: - :imagpnm.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :common: - :imagtiff.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :common: - :imagxpm.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :common: - init.cpp - Unix - - - wxlib PPC debug - PathRelative - Project - :common: - :intl.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :common: - :ipcbase.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :common: - :layout.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :common: - :lboxcmn.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :common: - :list.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :common: - :log.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :common: - :longlong.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :common: - :matrix.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :common: - :memory.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :common: - :menucmn.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :common: - :mimecmn.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :common: - :module.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :common: - :msgout.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :common: - :mstream.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :common: - :nbkbase.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :common: - :object.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :common: - :paper.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :common: - :popupcmn.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :common: - :prntbase.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :common: - :process.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :common: - :protocol.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :common: - :quantize.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :common: - :radiocmn.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :common: - :regex.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :common: - rendcmn.cpp - Unix - - - wxlib PPC debug - PathRelative - Project - :common: - rgncmn.cpp - Unix - - - wxlib PPC debug - PathRelative - Project - :common: - :sckaddr.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :common: - :sckfile.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :common: - :sckipc.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :common: - :sckstrm.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :common: - :settcmn.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :common: - :sizer.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :common: - :socket.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :common: - :statbar.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :common: - stopwatch.cpp - Unix - - - wxlib PPC debug - PathRelative - Project - :common: - :strconv.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :common: - :stream.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :common: - :string.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :common: - :sysopt.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :common: - taskbarcmn.cpp - Unix - - - wxlib PPC debug - PathRelative - Project - :common: - :tbarbase.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :common: - :textbuf.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :common: - :textcmn.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :common: - :textfile.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :common: - :timercmn.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :common: - :tokenzr.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :common: - :toplvcmn.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :common: - :treebase.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :common: - :txtstrm.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :common: - :unzip.c - MacOS - - - wxlib PPC debug - PathRelative - Project - :common: - :url.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :common: - :utilscmn.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :common: - :valgen.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :common: - :validate.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :common: - :valtext.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :common: - :variant.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :common: - :wfstream.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :common: - :wincmn.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :common: - :wxchar.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :common: - :xpmdecod.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :common: - :zipstrm.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :common: - :zstream.cpp - MacOS - - - generic - - wxlib PPC debug - PathRelative - Project - :generic: - :busyinfo.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :generic: - :calctrl.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :generic: - :caret.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :generic: - :choicdgg.cpp - MacOS - - - wxlib PPC debug - Name - colrdlgg.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :generic: - :dcpsg.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :generic: - :dirctrlg.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :generic: - :dirdlgg.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :generic: - :dragimgg.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :generic: - :fdrepdlg.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :generic: - :fontdlgg.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :generic: - :grid.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :generic: - :gridctrl.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :generic: - :gridsel.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :generic: - :imaglist.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :generic: - :laywin.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :generic: - :listctrl.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :generic: - :logg.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :generic: - :numdlgg.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :generic: - :panelg.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :generic: - :printps.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :generic: - :progdlgg.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :generic: - renderg.cpp - Unix - - - wxlib PPC debug - PathRelative - Project - :generic: - :sashwin.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :generic: - :scrlwing.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :generic: - :selstore.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :generic: - :splash.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :generic: - :splitter.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :generic: - :statusbr.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :generic: - :tabg.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :generic: - :textdlgg.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :generic: - :tipdlg.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :generic: - :tipwin.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :generic: - :treectlg.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :generic: - :wizard.cpp - MacOS - - - headers - - wxlib PPC release - Name - wx_cw.pch - MacOS - - - wxlib PPC release - Name - wx_cw.pch++ - MacOS - - - wxlib PPC debug - PathRelative - Project - ::include: - :wx_cw_d.pch - MacOS - - - wxlib PPC debug - PathRelative - Project - ::include: - :wx_cw_d.pch++ - MacOS - - - wxshlb PPC release - PathRelative - Project - ::include: - :wxshlb_cw.pch - MacOS - - - wxshlb PPC release - PathRelative - Project - ::include: - :wxshlb_cw.pch++ - MacOS - - - wxshlb PPC debug - PathRelative - Project - ::include: - :wxshlb_cw_d.pch - MacOS - - - wxshlb PPC debug - PathRelative - Project - ::include: - :wxshlb_cw_d.pch++ - MacOS - - - wxshlba PPC release - PathRelative - Project - ::include: - :wxshlba_cw.pch - MacOS - - - wxshlba PPC release - PathRelative - Project - ::include: - :wxshlba_cw.pch++ - MacOS - - - wxshlba PPC debug - PathRelative - Project - ::include: - :wxshlba_cw_d.pch++ - MacOS - - - wxshlba PPC debug - PathRelative - Project - ::include: - :wxshlba_cw_d.pch - MacOS - - - html - - wxlib PPC debug - PathRelative - Project - :html: - :helpctrl.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :html: - :helpdata.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :html: - :helpfrm.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :html: - :htmlcell.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :html: - :htmlfilt.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :html: - :htmlpars.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :html: - :htmltag.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :html: - :htmlwin.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :html: - :htmprint.cpp - MacOS - - modules - - wxlib PPC debug - PathRelative - Project - :html: - :m_style.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :html: - :m_dflist.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :html: - :m_fonts.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :html: - :m_hline.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :html: - :m_image.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :html: - :m_layout.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :html: - :m_links.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :html: - :m_list.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :html: - :m_pre.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :html: - :m_tables.cpp - MacOS - - - - wxlib PPC debug - PathRelative - Project - :html: - :winpars.cpp - MacOS - - - unix - - xml - - wxlib PPC debug - PathRelative - Project - xml - xml.cpp - Unix - - - wxlib PPC debug - PathRelative - Project - expat/lib - xmlparse.c - Unix - - - wxlib PPC debug - PathRelative - Project - expat/lib - xmlrole.c - Unix - - - wxlib PPC debug - PathRelative - Project - expat/lib - xmltok.c - Unix - - - mac - - wxlib PPC debug - PathRelative - Project - :mac:classic: - :accel.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :mac:classic: - :app.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :mac:classic: - :bitmap.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :mac:classic: - :bmpbuttn.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :mac:classic: - :brush.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :mac:classic: - :button.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :mac:classic: - :checkbox.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :mac:classic: - :checklst.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :mac:classic: - :choice.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :mac:classic: - :clipbrd.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :mac:classic: - :colordlg.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :mac:classic: - :colour.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :mac:classic: - :combobox.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :mac:classic: - :control.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :mac:classic: - :cursor.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :mac:classic: - :data.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :mac:classic: - :dataobj.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :mac:classic: - :dc.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :mac:classic: - :dcclient.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :mac:classic: - :dcmemory.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :mac:classic: - :dcprint.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :mac:classic: - :dcscreen.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :mac:classic: - :dialog.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :mac:classic: - :dirdlg.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :mac:classic: - :dirmac.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :mac:classic: - :dnd.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :mac:classic: - :filedlg.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :mac:classic: - :font.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :mac:classic: - :fontdlg.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :mac:classic: - :fontenum.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :mac:classic: - :fontutil.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :mac:classic: - :frame.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :mac:classic: - :gauge.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :mac:classic: - :gdiobj.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :mac:classic: - :glcanvas.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :mac:classic: - :gsocket.c - MacOS - - - wxlib PPC debug - PathRelative - Project - :mac:classic: - :icon.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :mac:classic: - :joystick.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :mac:classic: - :listbox.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :mac:classic: - :macnotfy.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :mac:classic: - :main.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :mac:classic: - :mdi.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :mac:classic: - :menu.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :mac:classic: - :menuitem.cpp - MacOS - - - wxlib PPC debug - Name - metafile.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :mac:classic: - :mimetmac.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :mac:classic: - :minifram.cpp - MacOS - - morefile - - wxlib PPC debug - PathRelative - Project - :mac:classic: - :morefile:DirectoryCopy.c - MacOS - - - wxlib PPC debug - PathRelative - Project - :mac:classic: - :morefile:FileCopy.c - MacOS - - - wxlib PPC debug - PathRelative - Project - :mac:classic: - :morefile:FSpCompat.c - MacOS - - - wxlib PPC debug - PathRelative - Project - :mac:classic: - :morefile:FullPath.c - MacOS - - - wxlib PPC debug - PathRelative - Project - :mac:classic: - :morefile:IterateDirectory.c - MacOS - - - wxlib PPC debug - PathRelative - Project - :mac:classic: - :morefile:MoreDesktopMgr.c - MacOS - - - wxlib PPC debug - PathRelative - Project - :mac:classic: - :morefile:MoreFiles.c - MacOS - - - wxlib PPC debug - PathRelative - Project - :mac:classic: - :morefile:MoreFilesExtras.c - MacOS - - - wxlib PPC debug - PathRelative - Project - :mac:classic: - :morefile:Search.c - MacOS - - - morefilex - - - wxlib PPC debug - PathRelative - Project - :mac:classic: - :msgdlg.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :mac:classic: - :notebmac.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :mac:classic: - :palette.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :mac:classic: - :pen.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :mac:classic: - :pnghand.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :mac:classic: - :printdlg.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :mac:classic: - :printmac.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :mac:classic: - :radiobox.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :mac:classic: - :radiobut.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :mac:classic: - :region.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :mac:classic: - renderer.cpp - Unix - - - wxlib PPC debug - PathRelative - Project - :mac:classic: - :scrolbar.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :mac:classic: - :settings.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :mac:classic: - :slider.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :mac:classic: - :spinbutt.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :mac:classic: - :spinctrl.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :mac:classic: - :statbmp.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :mac:classic: - :statbox.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :mac:classic: - :statbrma.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :mac:classic: - :statlmac.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :mac:classic: - :stattext.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :mac:classic: - :tabctrl.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :mac:classic: - :textctrl.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :mac:classic: - :thread.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :mac:classic: - :timer.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :mac:classic: - :toolbar.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :mac:classic: - :tooltip.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :mac:classic: - :toplevel.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :mac:classic: - :uma.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :mac:classic: - :utils.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :mac:classic: - :utilsexc.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :mac:classic: - :sound.cpp - MacOS - - - wxlib PPC debug - PathRelative - Project - :mac:classic: - :window.cpp - MacOS - - - mac resources - - wxlib PPC resources - Name - apprsrc.r - MacOS - - - wxlib PPC resources - Name - corersrc.r - MacOS - - - wx-addon libraries - - wxlib PPC debug - PathRelative - Project - :jpeg: - jpegM8.mcp - Unix - - - wxlib PPC debug - PathRelative - Project - :png: - pngM8.mcp - Unix - - - wxlib PPC debug - PathRelative - Project - :tiff: - tiffM8.mcp - Unix - - - wxlib PPC debug - PathRelative - Project - :zlib: - zlibM8.mcp - Unix - - - wxlib PPC debug - PathRelative - Project - :regex: - regexM8.mcp - Unix - - - mac libraries - common - - wxlib PPC debug - PathRelative - CodeWarrior - :MacOS Support: - :OpenGL:Libraries:OpenGLLibraryStub - MacOS - - - classic - - wxlib PPC debug - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:PPCLibraries:CursorDevicesGlue.o - MacOS - - - wxlib PPC debug - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:PPCLibraries:OpenTptATalkPPC.o - MacOS - - - wxlib PPC debug - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:PPCLibraries:CarbonAccessors.o - MacOS - - - wxlib PPC debug - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:PPCLibraries:OpenTransportAppPPC.o - MacOS - - - wxshlb PPC debug - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:PPCLibraries:OpenTransportExtnPPC.o - MacOS - - - wxlib PPC debug - PathRelative - CodeWarrior - :MacOS Support: - :Libraries:Sources:PLStringFuncs:Libs:PLStringFuncsPPC.lib - MacOS - - - wxlib PPC debug - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:PPCLibraries:OpenTptInetPPC.o - MacOS - - - wxlib PPC debug - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:NavigationLib - MacOS - - - wxlib PPC debug - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:ControlsLib - MacOS - - - wxlib PPC debug - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:DialogsLib - MacOS - - - wxlib PPC debug - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:DragLib - MacOS - - - wxlib PPC debug - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:WindowsLib - MacOS - - - wxlib PPC debug - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:MenusLib - MacOS - - - wxlib PPC debug - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:InterfaceLib - MacOS - - - wxlib PPC debug - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:MathLib - MacOS - - - wxlib PPC debug - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:AppearanceLib - MacOS - - - wxlib PPC debug - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:InternetConfigLib - MacOS - - - wxlib PPC debug - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:ThreadsLib - MacOS - - - wxlib PPC debug - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:OpenTransportLib - MacOS - - - wxlib PPC debug - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:OpenTptInternetLib - MacOS - - - wxlib PPC debug - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:OpenTptAppleTalkLib - MacOS - - - wxlib PPC debug - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:UTCUtils - MacOS - - - wxlib PPC debug - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:TextCommon - MacOS - - - wxlib PPC debug - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:ATSUnicodeLib - MacOS - - - wxlib PPC debug - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:UnicodeConverter - MacOS - - - wxlib PPC debug - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:TextEncodingConverter - MacOS - - - wxlib PPC debug - PathRelative - CodeWarrior - :MacOS Support: - :Universal:Libraries:StubLibraries:Textension - MacOS - - - carbon - - - msl libraries - - wxlib PPC debug - PathRelative - CodeWarrior - :MSL: - MSL_C/MSL_MacOS/Src/console.stubs.c - Unix - - - wxshlb PPC debug - PathRelative - CodeWarrior - :MacOS Support: - :Libraries:Runtime:Libs:MSL_ShLibRuntime_PPC_D.Lib - MacOS - - - wxshlb PPC release - PathRelative - CodeWarrior - :MacOS Support: - :Libraries:Runtime:Libs:MSL_ShLibRuntime_PPC.Lib - MacOS - - - wxlib PPC debug - PathRelative - CodeWarrior - :MacOS Support: - :Libraries:Runtime:Libs:MSL_All_PPC_D.Lib - MacOS - - - wxshlb PPC debug - PathRelative - CodeWarrior - :MacOS Support: - :Libraries:Runtime:Libs:MSL_All_PPC_D.Shlb - MacOS - - - wxlib PPC release - PathRelative - CodeWarrior - :MacOS Support: - :Libraries:Runtime:Libs:MSL_All_PPC.Lib - MacOS - - - wxshlb PPC release - PathRelative - CodeWarrior - :MacOS Support: - :Libraries:Runtime:Libs:MSL_All_PPC.Shlb - MacOS - - - wxshlb PPC debug - PathRelative - CodeWarrior - :MSL: - :MSL_C++:MSL_MacOS:Lib:PPC:MSL_C++_PPC_D.Lib - MacOS - - - wxshlb PPC release - PathRelative - CodeWarrior - :MSL: - :MSL_C++:MSL_MacOS:Lib:PPC:MSL_C++_PPC.Lib - MacOS - - - - wxlib PPC debug - FileRelative - ../../lib/jpeg_PPC.lib - Unix - - PathRelative - Project - :jpeg: - jpegM8.mcp - Unix - - - - wxlib PPC debug - FileRelative - ../../lib/png_PPC.lib - Unix - - PathRelative - Project - :png: - pngM8.mcp - Unix - - - - wxlib PPC debug - FileRelative - ../../lib/zlib_PPC.lib - Unix - - PathRelative - Project - :zlib: - zlibM8.mcp - Unix - - - - wxlib PPC debug - FileRelative - ../../lib/tif_PPC.lib - Unix - - PathRelative - Project - :tiff: - tiffM8.mcp - Unix - - - - wxlib PPC debug - FileRelative - ../../lib/regex_PPC.lib - Unix - - PathRelative - Project - :regex: - regexM8.mcp - Unix - - - - - diff --git a/wxWidgets/src/wxWindowsM8.xml b/wxWidgets/src/wxWindowsM8.xml deleted file mode 100644 index 0f4aee3699..0000000000 --- a/wxWidgets/src/wxWindowsM8.xml +++ /dev/null @@ -1,66645 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -]> - - - - - wxshlb Mach-O debug - - - - UserSourceTrees - - - AlwaysSearchUserPathsfalse - InterpretDOSAndUnixPathstrue - RequireFrameworkStyleIncludesfalse - UserSearchPaths - - SearchPath - Path::include: - PathFormatMacOS - PathRootProject - - Recursivefalse - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path::art: - PathFormatMacOS - PathRootProject - - Recursivefalse - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:generic: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:mac:carbon: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:common: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:zlib: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:png: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:jpeg: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:iodbc: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:tiff: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:html: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Pathunix - PathFormatUnix - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path../lib - PathFormatUnix - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Pathxml - PathFormatUnix - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Pathexpat/lib - PathFormatUnix - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Pathxrc - PathFormatUnix - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Pathmac/corefoundation - PathFormatUnix - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SystemSearchPaths - - SearchPath - PathMacOS X Support/Headers/(wchar_t Support fix) - PathFormatUnix - PathRootCodeWarrior - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - PathMacOS X Support - PathFormatUnix - PathRootCodeWarrior - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:regex: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Pathusr/include - PathFormatUnix - PathRootOS X Volume - - Recursivefalse - FrameworkPathfalse - HostFlagsAll - - - SearchPath - PathMSL/MSL_C - PathFormatUnix - PathRootCodeWarrior - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - PathMSL/MSL_C++ - PathFormatUnix - PathRootCodeWarrior - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Pathusr/lib - PathFormatUnix - PathRootOS X Volume - - Recursivefalse - FrameworkPathfalse - HostFlagsAll - - - SearchPath - PathSystem/Library/Frameworks - PathFormatUnix - PathRootOS X Volume - - Recursivefalse - FrameworkPathtrue - HostFlagsAll - - - - - MWRuntimeSettings_WorkingDirectory - MWRuntimeSettings_CommandLine - MWRuntimeSettings_HostApplication - Path - PathFormatGeneric - PathRootAbsolute - - MWRuntimeSettings_EnvVars - - - LinkerMacOS X PPC Linker - PreLinker - PostLinker - Targetnamewxshlb Mach-O debug - OutputDirectory - Path::lib: - PathFormatMacOS - PathRootProject - - SaveEntriesUsingRelativePathstrue - - - FileMappings - - FileTypeAPPL - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypeAppl - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypeMDYL - FileExtension - CompilerMachO Importer - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeMLIB - FileExtension - CompilerMachO Importer - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeMMLB - FileExtension - CompilerMachO Importer - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeMPLF - FileExtension - CompilerMachO Importer - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeMWCD - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypeRSRC - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.arr - Compiler - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.axp - Compiler - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.c - CompilerMW C/C++ PPC Mac OS X - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.c++ - CompilerMW C/C++ PPC Mac OS X - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.cc - CompilerMW C/C++ PPC Mac OS X - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.cp - CompilerMW C/C++ PPC Mac OS X - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.cpp - CompilerMW C/C++ PPC Mac OS X - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.exp - Compiler - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.h - CompilerMW C/C++ PPC Mac OS X - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMaketrue - - - FileTypeTEXT - FileExtension.h++ - CompilerMW C/C++ PPC Mac OS X - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMaketrue - - - FileTypeTEXT - FileExtension.hpp - CompilerMW C/C++ PPC Mac OS X - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMaketrue - - - FileTypeTEXT - FileExtension.lcf - Compiler - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.m - CompilerMW C/C++ PPC Mac OS X - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.mm - CompilerMW C/C++ PPC Mac OS X - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.pch - CompilerMW C/C++ PPC Mac OS X - EditLanguageC/C++ - Precompiletrue - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.pch++ - CompilerMW C/C++ PPC Mac OS X - EditLanguageC/C++ - Precompiletrue - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.pchm - CompilerMW C/C++ PPC Mac OS X - EditLanguageC/C++ - Precompiletrue - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.pchmm - CompilerMW C/C++ PPC Mac OS X - EditLanguageC/C++ - Precompiletrue - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.plc - CompilerProperty List Compiler - EditLanguageProperty List - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.ploc - CompilerProperty List Compiler - EditLanguageProperty List - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.r - CompilerRez - EditLanguageRez - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.wke - Compiler - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypedocu - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypersrc - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileExtension.a - CompilerMachO Importer - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileExtension.doc - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFilefalse - IgnoredByMaketrue - - - FileExtension.dylib - CompilerMachO Importer - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileExtension.gif - CompilerCopy To Package - EditLanguage - Precompilefalse - Launchabletrue - ResourceFilefalse - IgnoredByMaketrue - - - FileExtension.icns - CompilerCopy To Package - EditLanguage - Precompilefalse - Launchabletrue - ResourceFilefalse - IgnoredByMaketrue - - - FileExtension.jpg - CompilerCopy To Package - EditLanguage - Precompilefalse - Launchabletrue - ResourceFilefalse - IgnoredByMaketrue - - - FileExtension.lib - CompilerMachO Importer - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileExtension.nib - CompilerCopy To Package - EditLanguage - Precompilefalse - Launchabletrue - ResourceFilefalse - IgnoredByMaketrue - - - FileExtension.pl - CompilerPerl Tool - EditLanguagePerl - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileExtension.plist - CompilerCopy To Package - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMaketrue - - - FileExtension.ppob - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileExtension.psh - CompilerShell Tool - EditLanguage - Precompiletrue - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileExtension.rsrc - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileExtension.sh - CompilerShell Tool - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileExtension.strings - CompilerCopy To Package - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMaketrue - - - FileExtension.tiff - CompilerCopy To Package - EditLanguage - Precompilefalse - Launchabletrue - ResourceFilefalse - IgnoredByMaketrue - - - - - CacheModDatestrue - DumpBrowserInfofalse - CacheSubprojectstrue - UseThirdPartyDebuggerfalse - BrowserGenerator1 - DebuggerAppPath - Path - PathFormatGeneric - PathRootAbsolute - - DebuggerCmdLineArgs - DebuggerWorkingDir - Path - PathFormatGeneric - PathRootAbsolute - - CodeCompletionPrefixFileNameMacHeaders.c - CodeCompletionMacroFileNameMacOS_Carbon_C++_Macros.h - - - ConsoleEncoding0 - LogSystemMessagestrue - AutoTargetDLLsfalse - StopAtWatchpointstrue - PauseWhileRunningfalse - PauseInterval5 - PauseUIFlags0 - AltExePath - Path - PathFormatGeneric - PathRootAbsolute - - StopAtTempBPOnLaunchtrue - CacheSymbolicstrue - TempBPFunctionNamemain - TempBPType0 - - - Enabledfalse - ConnectionName - DownloadPath - LaunchRemoteAppfalse - RemoteAppPath - CoreID0 - JTAGClockSpeed8000 - IsMultiCorefalse - OSDownloadfalse - UseGlobalOSDownloadfalse - OSDownloadConnectionName - OSDownloadPath - AltDownloadfalse - AltDownloadConnectionName - - - OtherExecutables - - - CustomColor1 - Red0 - Green32767 - Blue0 - - CustomColor2 - Red0 - Green32767 - Blue0 - - CustomColor3 - Red0 - Green32767 - Blue0 - - CustomColor4 - Red0 - Green32767 - Blue0 - - - - MWFrontEnd_C_cplusplus0 - MWFrontEnd_C_checkprotos0 - MWFrontEnd_C_arm0 - MWFrontEnd_C_trigraphs0 - MWFrontEnd_C_onlystdkeywords0 - MWFrontEnd_C_enumsalwaysint0 - MWFrontEnd_C_mpwpointerstyle0 - MWFrontEnd_C_prefixnamewx/wxshlb_cwc_d.h - MWFrontEnd_C_ansistrict0 - MWFrontEnd_C_mpwcnewline0 - MWFrontEnd_C_wchar_type1 - MWFrontEnd_C_enableexceptions1 - MWFrontEnd_C_dontreusestrings0 - MWFrontEnd_C_poolstrings0 - MWFrontEnd_C_dontinline1 - MWFrontEnd_C_useRTTI1 - MWFrontEnd_C_multibyteaware0 - MWFrontEnd_C_unsignedchars1 - MWFrontEnd_C_autoinline0 - MWFrontEnd_C_booltruefalse1 - MWFrontEnd_C_inlinelevel0 - MWFrontEnd_C_ecplusplus0 - MWFrontEnd_C_objective_c0 - MWFrontEnd_C_defer_codegen0 - MWFrontEnd_C_templateparser0 - MWFrontEnd_C_c990 - MWFrontEnd_C_bottomupinline1 - - - MWWarning_C_warn_illpragma1 - MWWarning_C_warn_emptydecl0 - MWWarning_C_warn_possunwant0 - MWWarning_C_warn_unusedvar0 - MWWarning_C_warn_unusedarg0 - MWWarning_C_warn_extracomma0 - MWWarning_C_pedantic1 - MWWarning_C_warningerrors0 - MWWarning_C_warn_hidevirtual1 - MWWarning_C_warn_implicitconv0 - MWWarning_C_warn_notinlined0 - MWWarning_C_warn_structclass1 - - - MWFTP_Post_hostName - MWFTP_Post_username - MWFTP_Post_password0ÿÂà -ž0¼,šì - MWFTP_Post_remoteDir - MWFTP_Post_ftp_PathVersion1 - MWFTP_Post_ftp_PathType0 - MWFTP_Post_ftp_PathFormat0 - MWFTP_Post_ftp_tree - MWFTP_Post_uploadDir - MWFTP_Post_ftp_port21 - MWFTP_Post_SendBin1 - MWFTP_Post_ShouldLog1 - - - MWCommandLine_Java_clsName - MWCommandLine_Java_args - - - MWVJavaDebugging_Protocol1 - MWVJavaDebugging_JDKVersion1 - MWVJavaDebugging_TimeOut10 - MWVJavaDebugging_SupportSlowDevicesfalse - MWVJavaDebugging_UseRemoteLaunchAgentfalse - MWVJavaDebugging_LaunchVMasServerfalse - - - MWJava_Language_optimizefalse - MWJava_Language_warnDeprecatedfalse - MWJava_Language_emitMapfalse - MWJava_Language_strictFileNamesfalse - MWJava_Language_strictFileHierarchyfalse - MWJava_Language_1_1_Compatiblefalse - MWJava_Language_emitHeaders0 - MWJava_Language_headerTypeJNINativeHeaders - MWJava_Language_packageFilter - MWJava_Language_genCommentstrue - MWJava_Language_genHeadersfalse - MWJava_Language_enableAssertsfalse - MWJava_Language_targetVM1.1 - - - Manifest-JAD Attributes - - AttributeMain-Class - ValueAuto-Generated - - - - - MWJava_MRJAppBuilder_outFileMRJApplication - MWJava_MRJAppBuilder_mergefalse - MWJava_MRJAppBuilder_quitMenutrue - MWJava_MRJAppBuilder_growfalse - MWJava_MRJAppBuilder_stdoutTypeConsole - MWJava_MRJAppBuilder_stderrTypeConsole - MWJava_MRJAppBuilder_stdinTypeConsole - MWJava_MRJAppBuilder_appIconPVersion0 - MWJava_MRJAppBuilder_appIconPType0 - MWJava_MRJAppBuilder_appIconPFormat0 - MWJava_MRJAppBuilder_appIconPTree - MWJava_MRJAppBuilder_appIconFile - MWJava_MRJAppBuilder_splashScreenPVersion0 - MWJava_MRJAppBuilder_splashScreenPType0 - MWJava_MRJAppBuilder_splashScreenPFormat0 - MWJava_MRJAppBuilder_splashScreenPTree - MWJava_MRJAppBuilder_splashScreenPICTFile - MWJava_MRJAppBuilder_aboutName - MWJava_MRJAppBuilder_stdoutPVersion0 - MWJava_MRJAppBuilder_stdoutPType0 - MWJava_MRJAppBuilder_stdoutPFormat0 - MWJava_MRJAppBuilder_stdoutPTree - MWJava_MRJAppBuilder_stdoutFile - MWJava_MRJAppBuilder_stdoutAppendfalse - MWJava_MRJAppBuilder_stderrPType0 - MWJava_MRJAppBuilder_stderrPFormat0 - MWJava_MRJAppBuilder_stderrPTree - MWJava_MRJAppBuilder_stderrFile - MWJava_MRJAppBuilder_stderrAppendfalse - MWJava_MRJAppBuilder_stdinPType0 - MWJava_MRJAppBuilder_stdinPFormat0 - MWJava_MRJAppBuilder_stdinPTree - MWJava_MRJAppBuilder_stdinFile - - - MWJava_Output_outputtypeJarFile - MWJava_Output_outfileJavaClasses.jar - MWJava_Output_ftype1514754080 - MWJava_Output_fcreator1297570384 - MWJava_Output_compress0 - MWJava_Output_genManifest0 - MWJava_Output_trunctypeFront - MWJava_Output_deleteClasses0 - MWJava_Output_consoleApp1 - MWJava_Output_preverify0 - MWJava_Output_genJad0 - MWJava_Output_obfuscate0 - - - MWJava_Proj_projtypeApplet - MWJava_Proj_mainClassName - MWJava_Proj_HTMLAppCreator1145457748 - MWJava_Proj_HTMLAppNameMetrowerks Java - MWJava_Proj_PathVersion1 - MWJava_Proj_PathType0 - MWJava_Proj_PathFormat0 - MWJava_Proj_tree - MWJava_Proj_HTMLAppWin32NameInternet Explorer - MWJava_Proj_compress0 - MWJava_Proj_simulator0 - MWJava_Proj_useVM\000\000macosx - MWJava_Proj_vmarguments - MWJava_Proj_vmName - MWJava_Proj_simPropFile - - - MWJavaDoc_Proj_Version1 - MWJavaDoc_Proj_Deprecated1 - MWJavaDoc_Proj_Author1 - MWJavaDoc_Proj_Index1 - MWJavaDoc_Proj_Tree1 - MWJavaDoc_Proj_SunResolveToSame0 - MWJavaDoc_Proj_Shortnames1 - MWJavaDoc_Proj_Folder0 - MWJavaDoc_Proj_GenerateAPILinks0 - MWJavaDoc_Proj_scopePublic - MWJavaDoc_Proj_fcreator1297303877 - MWJavaDoc_Proj_encodingName - MWJavaDoc_Proj_decodingName - MWJavaDoc_Proj_javaPackagePathhttp://java.sun.com/products/jdk/1.1/docs/api/ - - - MWMerge_MacOS_projectTypeApplication - MWMerge_MacOS_outputNameMerge Out - MWMerge_MacOS_outputCreator???? - MWMerge_MacOS_outputTypeAPPL - MWMerge_MacOS_suppressWarning0 - MWMerge_MacOS_copyFragments1 - MWMerge_MacOS_copyResources1 - MWMerge_MacOS_flattenResource0 - MWMerge_MacOS_flatFileNamea.rsrc - MWMerge_MacOS_flatFileOutputPath - Path: - PathFormatMacOS - PathRootProject - - MWMerge_MacOS_skipResources - DLGX - ckid - Proj - WSPC - - - - FileLockedfalse - ResourcesMapIsReadOnlyfalse - PrinterDriverIsMultiFinderCompatiblefalse - Invisiblefalse - HasBundlefalse - NameLockedfalse - Stationeryfalse - HasCustomIconfalse - Sharedfalse - HasBeenInitedfalse - Label0 - Comments - - - MWMacOSPackager_UsePackager0 - MWMacOSPackager_FolderToPackage - Path - PathFormatMacOS - PathRootAbsolute - - MWMacOSPackager_CreateClassicAlias0 - MWMacOSPackager_ClassicAliasMethodUseTargetOutput - MWMacOSPackager_ClassicAliasPath - Path - PathFormatGeneric - PathRootAbsolute - - MWMacOSPackager_CreatePkgInfo0 - MWMacOSPackager_PkgCreatorType???? - MWMacOSPackager_PkgFileTypeAPPL - - - MWCodeGen_PPC_structalignmentPPC_mw - MWCodeGen_PPC_tracebacktablesOutOfLine - MWCodeGen_PPC_processorGeneric - MWCodeGen_PPC_function_align4 - MWCodeGen_PPC_tocdata1 - MWCodeGen_PPC_largetoc0 - MWCodeGen_PPC_profiler0 - MWCodeGen_PPC_vectortocdata0 - MWCodeGen_PPC_poolconst0 - MWCodeGen_PPC_peephole1 - MWCodeGen_PPC_readonlystrings0 - MWCodeGen_PPC_linkerpoolsstrings0 - MWCodeGen_PPC_volatileasm0 - MWCodeGen_PPC_schedule0 - MWCodeGen_PPC_altivec0 - MWCodeGen_PPC_altivec_move_block0 - MWCodeGen_PPC_strictIEEEfp0 - MWCodeGen_PPC_fpcontract1 - MWCodeGen_PPC_genfsel0 - MWCodeGen_PPC_orderedfpcmp0 - - - MWCodeGen_MachO_structalignmentPPC_mw - MWCodeGen_MachO_profiler_enumOff - MWCodeGen_MachO_processorGeneric - MWCodeGen_MachO_function_align4 - MWCodeGen_MachO_common0 - MWCodeGen_MachO_peephole1 - MWCodeGen_MachO_readonlystrings0 - MWCodeGen_MachO_linkerpoolsstrings1 - MWCodeGen_MachO_volatileasm0 - MWCodeGen_MachO_schedule0 - MWCodeGen_MachO_altivec0 - MWCodeGen_MachO_vecmove0 - MWCodeGen_MachO_fp_ieee_strict0 - MWCodeGen_MachO_fpcontract1 - MWCodeGen_MachO_genfsel0 - MWCodeGen_MachO_fp_cmps_ordered0 - - - MWDisassembler_PPC_showcode1 - MWDisassembler_PPC_extended1 - MWDisassembler_PPC_mix0 - MWDisassembler_PPC_nohex0 - MWDisassembler_PPC_showdata1 - MWDisassembler_PPC_showexceptions1 - MWDisassembler_PPC_showsym1 - MWDisassembler_PPC_shownames1 - - - GlobalOptimizer_PPC_optimizationlevelLevel0 - GlobalOptimizer_PPC_optforSpeed - - - MWLinker_PPC_linksym1 - MWLinker_PPC_symfullpath1 - MWLinker_PPC_linkmap0 - MWLinker_PPC_nolinkwarnings0 - MWLinker_PPC_dontdeadstripinitcode1 - MWLinker_PPC_permitmultdefs0 - MWLinker_PPC_linkmodeFast - MWLinker_PPC_initname - MWLinker_PPC_mainname__start - MWLinker_PPC_termname - - - MWLinker_MacOSX_linksym1 - MWLinker_MacOSX_symfullpath1 - MWLinker_MacOSX_nolinkwarnings0 - MWLinker_MacOSX_linkmap0 - MWLinker_MacOSX_dontdeadstripinitcode0 - MWLinker_MacOSX_permitmultdefs0 - MWLinker_MacOSX_use_objectivec_semantics0 - MWLinker_MacOSX_strip_debug_symbols0 - MWLinker_MacOSX_split_segs0 - MWLinker_MacOSX_report_msl_overloads0 - MWLinker_MacOSX_objects_follow_linkorder0 - MWLinker_MacOSX_linkmodeFast - MWLinker_MacOSX_exportsPragma - MWLinker_MacOSX_sortcodeNone - MWLinker_MacOSX_mainname - - - MWProject_MacOSX_typeSharedLibrary - MWProject_MacOSX_outfilewx_MACH_d.dylib - MWProject_MacOSX_filecreator???? - MWProject_MacOSX_filetypeMDYL - MWProject_MacOSX_vmaddress0 - MWProject_MacOSX_usedefaultvmaddr1 - MWProject_MacOSX_flatrsrc1 - MWProject_MacOSX_flatrsrcfilenamewx_MACH_d.rsrc - MWProject_MacOSX_flatrsrcoutputdir - Path../lib - PathFormatUnix - PathRootProject - - MWProject_MacOSX_installpath@executable_path/../Frameworks/ - MWProject_MacOSX_dont_prebind1 - MWProject_MacOSX_flat_namespace0 - MWProject_MacOSX_frameworkversionA - MWProject_MacOSX_currentversion0 - MWProject_MacOSX_flat_oldimpversion0 - - - MWLinker_MachO_exportsNone - MWLinker_MachO_mainnamestart - MWLinker_MachO_currentversion0 - MWLinker_MachO_compatibleversion0 - MWLinker_MachO_symfullpath0 - MWLinker_MachO_supresswarnings0 - MWLinker_MachO_multisymerror0 - MWLinker_MachO_prebind1 - MWLinker_MachO_deadstrip1 - MWLinker_MachO_objectivecsemantics0 - MWLinker_MachO_whichfileloaded0 - MWLinker_MachO_whyfileloaded0 - MWLinker_MachO_readonlyrelocsErrors - MWLinker_MachO_undefinedsymbolsErrors - MWLinker_MachO_twolevelnamespace1 - MWLinker_MachO_stripdebugsymbols0 - - - MWProject_MachO_typeExecutable - MWProject_MachO_outfilea.exe - MWProject_MachO_filecreator???? - MWProject_MachO_filetypeMEXE - MWProject_MachO_vmaddress4096 - MWProject_MachO_flatrsrc1 - MWProject_MachO_flatrsrcfilenamea.rsrc - MWProject_MachO_flatrsrcoutputdir - Path: - PathFormatMacOS - PathRootProject - - MWProject_MachO_installpath./ - MWProject_MachO_frameworkversion - - - MWPEF_exportsAll - MWPEF_libfolder0 - MWPEF_sortcodeNone - MWPEF_expandbss0 - MWPEF_sharedata0 - MWPEF_olddefversion0 - MWPEF_oldimpversion0 - MWPEF_currentversion0 - MWPEF_fragmentnamewxwin - MWPEF_collapsereloads0 - - - MWProject_PPC_typeLibrary - MWProject_PPC_outfilewx_CARBON_d.lib - MWProject_PPC_filecreator???? - MWProject_PPC_filetype???? - MWProject_PPC_size0 - MWProject_PPC_minsize0 - MWProject_PPC_stacksize0 - MWProject_PPC_flags0 - MWProject_PPC_symfilename - MWProject_PPC_rsrcname - MWProject_PPC_rsrcheaderNative - MWProject_PPC_rsrctype???? - MWProject_PPC_rsrcid0 - MWProject_PPC_rsrcflags0 - MWProject_PPC_rsrcstore0 - MWProject_PPC_rsrcmerge0 - MWProject_PPC_flatrsrc0 - MWProject_PPC_flatrsrcoutputdir - Path: - PathFormatMacOS - PathRootProject - - MWProject_PPC_flatrsrcfilename - - - MWAssembler_PPC_auxheader0 - MWAssembler_PPC_symmodeMac - MWAssembler_PPC_dialectPPC - MWAssembler_PPC_prefixfile - MWAssembler_PPC_typecheck0 - MWAssembler_PPC_warnings0 - MWAssembler_PPC_casesensitive0 - - - PList_OutputTypeFile - PList_OutputEncodingUTF-8 - PList_Prefix - PList_FileFilenameInfo.plist - PList_FileDirectory - Path: - PathFormatMacOS - PathRootProject - - PList_ResourceTypeplst - PList_ResourceID0 - PList_ResourceName - - - MWRez_Language_maxwidth80 - MWRez_Language_scriptRoman - MWRez_Language_alignmentAlign1 - MWRez_Language_filtermodeFilterSkip - MWRez_Language_suppresswarnings0 - MWRez_Language_escapecontrolchars1 - MWRez_Language_prefixname - MWRez_Language_filteredtypes'CODE' 'DATA' 'PICT' - - - MWWinRC_prefixname - - - MWCodeGen_X86_processorGeneric - MWCodeGen_X86_alignmentbytes8 - MWCodeGen_X86_exceptionsZeroOverhead - MWCodeGen_X86_name_manglingMWWin32 - MWCodeGen_X86_use_extinst0 - MWCodeGen_X86_extinst_mmx0 - MWCodeGen_X86_extinst_3dnow0 - MWCodeGen_X86_use_mmx_3dnow_convention0 - MWCodeGen_X86_extinst_cmov0 - MWCodeGen_X86_extinst_sse0 - MWCodeGen_X86_extinst_sse20 - MWCodeGen_X86_intrinsics0 - MWCodeGen_X86_optimizeasm0 - MWCodeGen_X86_disableopts0 - MWCodeGen_X86_profile0 - MWLinker_X86_runtimeCustom - MWCodeGen_X86_readonlystrings0 - - - MWLinker_X86_subsysmajorid4 - MWLinker_X86_subsysminorid0 - MWCOFF_X86_opsysmajorid4 - MWCOFF_X86_opsysminorid0 - MWLinker_X86_usrmajorid0 - MWLinker_X86_usrminorid0 - MWProject_X86_maxstacksize1024 - MWProject_X86_minstacksize4 - MWProject_X86_size1024 - MWProject_X86_minsize4 - MWCOFF_X86_coff_flags0 - MWCOFF_X86_dll_flags0 - MWProject_X86_baseaddress4194304 - MWCOFF_X86_filealign512 - MWCOFF_X86_sectionalign4096 - - - PDisasmX86_showHeaderstrue - PDisasmX86_showSectHeaderstrue - PDisasmX86_showSymTabtrue - PDisasmX86_showCodetrue - PDisasmX86_showDatatrue - PDisasmX86_showDebugfalse - PDisasmX86_showExceptionsfalse - PDisasmX86_showRawfalse - PDisasmX86_showAllRawfalse - PDisasmX86_showSourcefalse - PDisasmX86_showRelocationtrue - PDisasmX86_showHextrue - PDisasmX86_showCommentsfalse - PDisasmX86_showSymDefstrue - PDisasmX86_unmanglefalse - PDisasmX86_verbosefalse - PDisasmX86_resolveRelocstrue - PDisasmX86_resolveLocalsfalse - - - MWDebugger_X86_Exceptions - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - - - - GlobalOptimizer_X86_optimizationlevelLevel0 - GlobalOptimizer_X86_optforSpeed - - - MWLinker_X86_entrypointusageDefault - MWLinker_X86_entrypoint - MWLinker_X86_subsystemWinGUI - MWLinker_X86_commandfile - MWLinker_X86_generatemap0 - MWLinker_X86_linksym1 - MWLinker_X86_linkCV1 - MWLinker_X86_symfullpathfalse - MWLinker_X86_linkdebugtrue - MWLinker_X86_checksumfalse - MWLinker_X86_zero_init_bssfalse - MWLinker_X86_mergedatafalse - MWLinker_X86_usedefaultlibsfalse - MWLinker_X86_adddefaultlibsfalse - MWLinker_X86_nowarningsfalse - MWLinker_X86_verbosefalse - - - MWProject_X86_typeLibrary - MWProject_X86_outfilewx_x86_d.lib - MWProject_X86_importlib - MWProject_X86_setimportlibdirfalse - MWProject_X86_dontgenerateimportlibfalse - MWProject_X86_oldformatlibfalse - MWProject_X86_replaceobjextensionfalse - MWProject_X86_copyallfilesfalse - - - - PathRelative - Project - :mac:carbon: - :accel.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :app.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :bitmap.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :bmpbuttn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :brush.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :button.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :checkbox.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :checklst.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :choice.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :clipbrd.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :colordlg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :colour.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :combobox.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :control.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :cursor.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :data.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :dc.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :dcclient.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :dcmemory.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :dcscreen.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :dialog.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :dirdlg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :filedlg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :font.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :fontdlg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :frame.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :gauge.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :gdiobj.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :icon.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :joystick.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :listbox.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :main.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :mdi.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :menu.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :menuitem.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :minifram.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :msgdlg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :palette.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :pen.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :printdlg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :radiobox.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :radiobut.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :region.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :scrolbar.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :settings.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :slider.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :spinbutt.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :statbmp.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :statbox.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :stattext.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :tabctrl.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :textctrl.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :thread.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :timer.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :toolbar.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :utils.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :sound.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :window.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :printmac.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :dcprint.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :uma.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :fontutil.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :dataobj.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :m_list.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :m_tables.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :htmlwin.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :m_pre.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :m_image.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :htmprint.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :htmlfilt.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :htmlpars.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :htmltag.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :m_hline.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :winpars.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :htmlcell.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :m_layout.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :m_fonts.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :m_links.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :fontenum.cpp - MacOS - Text - Debug - - - Name - metafile.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :macnotfy.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :statbrma.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :tooltip.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :statlmac.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :notebmac.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :m_dflist.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :dirmac.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :mimetmac.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :spinctrl.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :glcanvas.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :helpctrl.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :helpfrm.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :helpdata.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :toplevel.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :dnd.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :m_style.cpp - MacOS - Text - Debug - - - PathRelative - Project - :jpeg: - jpegM8.mcp - Unix - Project - - - - PathRelative - Project - :png: - pngM8.mcp - Unix - Project - - - - PathRelative - Project - :zlib: - zlibM8.mcp - Unix - Project - - - - PathRelative - Project - :tiff: - tiffM8.mcp - Unix - Project - - - - PathRelative - Project - :regex: - regexM8.mcp - Unix - Project - - - - PathRelative - Project - unix - utilsunx.cpp - Unix - Text - Debug - - - PathRelative - CodeWarrior - MSL/MSL_C - MSL_MacOS/Src/console_OS_X.c - Unix - Text - Debug - - - FileRelative - ../../lib/jpeg_MACH.lib - Unix - - PathRelative - Project - :jpeg: - jpegM8.mcp - Unix - - Library - Debug, TargetOutputFile - - - FileRelative - ../../lib/png_MACH.lib - Unix - - PathRelative - Project - :png: - pngM8.mcp - Unix - - Library - Debug, TargetOutputFile - - - FileRelative - ../../lib/zlib_MACH.lib - Unix - - PathRelative - Project - :zlib: - zlibM8.mcp - Unix - - Library - Debug, TargetOutputFile - - - PathRelative - Project - :mac:carbon: - morefilex/MoreFilesX.cpp - Unix - Text - Debug - - - FileRelative - ../../lib/tif_MACH.lib - Unix - - PathRelative - Project - :tiff: - tiffM8.mcp - Unix - - Library - Debug, TargetOutputFile - - - FileRelative - ../../lib/regex_MACH.lib - Unix - - PathRelative - Project - :regex: - regexM8.mcp - Unix - - Library - Debug, TargetOutputFile - - - PathRelative - Project - unix - baseunix.cpp - Unix - Text - Debug - - - PathRelative - Project - :mac:carbon: - renderer.cpp - Unix - Text - Debug - - - PathRelative - Project - xml - xml.cpp - Unix - Text - Debug - - - PathRelative - Project - expat/lib - xmlparse.c - Unix - Text - Debug - - - PathRelative - Project - expat/lib - xmlrole.c - Unix - Text - Debug - - - PathRelative - Project - expat/lib - xmltok.c - Unix - Text - Debug - - - PathRelative - Project - ::include: - wxshlb_cwc_d.pch - Unix - Text - Debug - - - PathRelative - Project - ::include: - wxshlb_cwc_d.pch++ - Unix - Text - Debug - - - PathRelative - Project - :mac:carbon: - drawer.cpp - Unix - Text - Debug - - - PathRelative - Project - :mac:carbon: - taskbar.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_bmp.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_bmpbt.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_bttn.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_cald.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_chckb.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_chckl.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_choic.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_combo.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_dlg.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_frame.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_gauge.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_gdctl.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_html.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_listb.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_listc.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_menu.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_notbk.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_panel.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_radbt.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_radbx.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_scrol.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_scwin.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_sizer.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_slidr.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_spin.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_split.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_statbar.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_stbmp.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_stbox.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_stlin.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_sttxt.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_text.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_tglbtn.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_toolb.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_tree.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_unkwn.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_wizrd.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xmlres.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xmlrsall.cpp - Unix - Text - Debug - - - PathRelative - Project - unix - gsocket.cpp - Unix - Text - Debug - - - PathRelative - Project - mac/corefoundation - cfstring.cpp - Unix - Text - Debug - - - PathRelative - Project - mac/corefoundation - utilsexc_cf.cpp - Unix - Text - Debug - - - PathRelative - Project - mac/corefoundation - stdpaths_cf.cpp - Unix - Text - Debug - - - PathRelative - Project - mac/corefoundation - gsockosx.cpp - Unix - Text - Debug - - - PathRelative - Project - :mac:carbon: - display.cpp - Unix - Text - Debug - - - PathRelative - Project - unix - stdpaths.cpp - Unix - Text - Debug - - - PathRelative - Project - :mac:carbon: - imaglist.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_choicbk.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_datectrl.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_listbk.cpp - Unix - Text - Debug - - - PathRelative - Project - unix - dlunix.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - accesscmn.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - appbase.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - appcmn.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - archive.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - artprov.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - artstd.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - bmpbase.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - bookctrl.cpp - Unix - Text - Debug - - - PathRelative - Project - :generic: - choicbkg.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - choiccmn.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - clipcmn.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - clntdata.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - cmdline.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - cmdproc.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - cmndata.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - config.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - containr.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - cshelp.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - ctrlcmn.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - ctrlsub.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - datacmn.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - datetime.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - datstrm.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - db.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - dbgrid.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - dbtable.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - dcbase.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - dircmn.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - dlgcmn.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - dndcmn.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - dobjcmn.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - docmdi.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - docview.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - dpycmn.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - dseldlg.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - dynarray.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - dynlib.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - dynload.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - effects.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - encconv.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - event.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - extended.c - Unix - Text - Debug - - - PathRelative - Project - :common: - fddlgcmn.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - ffile.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - file.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - fileconf.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - filefn.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - filename.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - filesys.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - fldlgcmn.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - fmapbase.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - fontcmn.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - fontmap.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - framecmn.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - fs_inet.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - fs_mem.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - fs_zip.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - ftp.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - gaugecmn.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - gbsizer.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - gdicmn.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - geometry.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - gifdecod.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - hash.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - hashmap.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - helpbase.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - http.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - iconbndl.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - imagall.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - imagbmp.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - image.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - imagfill.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - imaggif.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - imagiff.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - imagjpeg.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - imagpcx.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - imagpng.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - imagpnm.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - imagtiff.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - imagxpm.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - init.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - intl.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - ipcbase.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - layout.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - lboxcmn.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - list.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - log.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - longlong.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - matrix.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - memory.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - menucmn.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - mimecmn.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - module.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - msgout.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - mstream.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - nbkbase.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - object.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - paper.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - popupcmn.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - prntbase.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - process.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - protocol.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - quantize.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - radiocmn.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - regex.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - rendcmn.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - rgncmn.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - sckaddr.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - sckfile.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - sckipc.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - sckstrm.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - settcmn.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - sizer.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - socket.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - statbar.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - stdpbase.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - stockitem.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - stopwatch.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - strconv.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - stream.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - string.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - sysopt.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - taskbarcmn.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - tbarbase.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - textbuf.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - textcmn.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - textfile.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - timercmn.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - tokenzr.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - toplvcmn.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - treebase.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - txtstrm.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - uri.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - url.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - utilscmn.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - valgen.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - validate.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - valtext.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - variant.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - wfstream.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - wincmn.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - wxchar.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - xpmdecod.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - zipstrm.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - zstream.cpp - Unix - Text - Debug - - - PathRelative - Project - :generic: - busyinfo.cpp - Unix - Text - Debug - - - PathRelative - Project - :generic: - calctrl.cpp - Unix - Text - Debug - - - PathRelative - Project - :generic: - caret.cpp - Unix - Text - Debug - - - PathRelative - Project - :generic: - choicdgg.cpp - Unix - Text - Debug - - - PathRelative - Project - :generic: - colrdlgg.cpp - Unix - Text - Debug - - - PathRelative - Project - :generic: - datectlg.cpp - Unix - Text - Debug - - - PathRelative - Project - :generic: - dcpsg.cpp - Unix - Text - Debug - - - PathRelative - Project - :generic: - dirctrlg.cpp - Unix - Text - Debug - - - PathRelative - Project - :generic: - dirdlgg.cpp - Unix - Text - Debug - - - PathRelative - Project - :generic: - dragimgg.cpp - Unix - Text - Debug - - - PathRelative - Project - :generic: - fdrepdlg.cpp - Unix - Text - Debug - - - PathRelative - Project - :generic: - fontdlgg.cpp - Unix - Text - Debug - - - PathRelative - Project - :generic: - grid.cpp - Unix - Text - Debug - - - PathRelative - Project - :generic: - gridctrl.cpp - Unix - Text - Debug - - - PathRelative - Project - :generic: - gridsel.cpp - Unix - Text - Debug - - - PathRelative - Project - :generic: - laywin.cpp - Unix - Text - Debug - - - PathRelative - Project - :generic: - listbkg.cpp - Unix - Text - Debug - - - PathRelative - Project - :generic: - listctrl.cpp - Unix - Text - Debug - - - PathRelative - Project - :generic: - logg.cpp - Unix - Text - Debug - - - PathRelative - Project - :generic: - numdlgg.cpp - Unix - Text - Debug - - - PathRelative - Project - :generic: - panelg.cpp - Unix - Text - Debug - - - PathRelative - Project - :generic: - printps.cpp - Unix - Text - Debug - - - PathRelative - Project - :generic: - progdlgg.cpp - Unix - Text - Debug - - - PathRelative - Project - :generic: - renderg.cpp - Unix - Text - Debug - - - PathRelative - Project - :generic: - sashwin.cpp - Unix - Text - Debug - - - PathRelative - Project - :generic: - scrlwing.cpp - Unix - Text - Debug - - - PathRelative - Project - :generic: - selstore.cpp - Unix - Text - Debug - - - PathRelative - Project - :generic: - splash.cpp - Unix - Text - Debug - - - PathRelative - Project - :generic: - splitter.cpp - Unix - Text - Debug - - - PathRelative - Project - :generic: - statusbr.cpp - Unix - Text - Debug - - - PathRelative - Project - :generic: - tabg.cpp - Unix - Text - Debug - - - PathRelative - Project - :generic: - textdlgg.cpp - Unix - Text - Debug - - - PathRelative - Project - :generic: - tipdlg.cpp - Unix - Text - Debug - - - PathRelative - Project - :generic: - tipwin.cpp - Unix - Text - Debug - - - PathRelative - Project - :generic: - treectlg.cpp - Unix - Text - Debug - - - PathRelative - Project - :generic: - wizard.cpp - Unix - Text - Debug - - - PathRelative - CodeWarrior - MacOS X Support - Libraries/Startup/dylib1.o - Unix - Library - Debug - - - PathRelative - Project - :common: - debugrpt.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_mdi.cpp - Unix - Text - Debug - - - PathRelative - CodeWarrior - MacOS X Support - Libraries/Runtime/Libs/MSL_Runtime_Mach-O_D.a - Unix - Library - Debug - - - - - FileRelative - ../../lib/regex_MACH.lib - Unix - - PathRelative - Project - :regex: - regexM8.mcp - Unix - - - - FileRelative - ../../lib/tif_MACH.lib - Unix - - PathRelative - Project - :tiff: - tiffM8.mcp - Unix - - - - FileRelative - ../../lib/zlib_MACH.lib - Unix - - PathRelative - Project - :zlib: - zlibM8.mcp - Unix - - - - FileRelative - ../../lib/png_MACH.lib - Unix - - PathRelative - Project - :png: - pngM8.mcp - Unix - - - - PathRelative - Project - :mac:carbon: - :accel.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :app.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :bitmap.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :bmpbuttn.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :brush.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :button.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :checkbox.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :checklst.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :choice.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :clipbrd.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :colordlg.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :colour.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :combobox.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :control.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :cursor.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :data.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :dc.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :dcclient.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :dcmemory.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :dcscreen.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :dialog.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :dirdlg.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :filedlg.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :font.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :fontdlg.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :frame.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :gauge.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :gdiobj.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :icon.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :joystick.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :listbox.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :main.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :mdi.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :menu.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :menuitem.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :minifram.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :msgdlg.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :palette.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :pen.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :printdlg.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :radiobox.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :radiobut.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :region.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :scrolbar.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :settings.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :slider.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :spinbutt.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :statbmp.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :statbox.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :stattext.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :tabctrl.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :textctrl.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :thread.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :timer.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :toolbar.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :utils.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :sound.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :window.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :printmac.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :dcprint.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :uma.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :fontutil.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :dataobj.cpp - MacOS - - - PathRelative - Project - :html: - :m_list.cpp - MacOS - - - PathRelative - Project - :html: - :m_tables.cpp - MacOS - - - PathRelative - Project - :html: - :htmlwin.cpp - MacOS - - - PathRelative - Project - :html: - :m_pre.cpp - MacOS - - - PathRelative - Project - :html: - :m_image.cpp - MacOS - - - PathRelative - Project - :html: - :htmprint.cpp - MacOS - - - PathRelative - Project - :html: - :htmlfilt.cpp - MacOS - - - PathRelative - Project - :html: - :htmlpars.cpp - MacOS - - - PathRelative - Project - :html: - :htmltag.cpp - MacOS - - - PathRelative - Project - :html: - :m_hline.cpp - MacOS - - - PathRelative - Project - :html: - :winpars.cpp - MacOS - - - PathRelative - Project - :html: - :htmlcell.cpp - MacOS - - - PathRelative - Project - :html: - :m_layout.cpp - MacOS - - - PathRelative - Project - :html: - :m_fonts.cpp - MacOS - - - PathRelative - Project - :html: - :m_links.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :fontenum.cpp - MacOS - - - Name - metafile.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :macnotfy.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :statbrma.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :tooltip.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :statlmac.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :notebmac.cpp - MacOS - - - PathRelative - Project - :html: - :m_dflist.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :dirmac.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :mimetmac.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :spinctrl.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :glcanvas.cpp - MacOS - - - PathRelative - Project - :html: - :helpctrl.cpp - MacOS - - - PathRelative - Project - :html: - :helpfrm.cpp - MacOS - - - PathRelative - Project - :html: - :helpdata.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :toplevel.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :dnd.cpp - MacOS - - - PathRelative - Project - :html: - :m_style.cpp - MacOS - - - PathRelative - Project - unix - utilsunx.cpp - Unix - - - PathRelative - CodeWarrior - MSL/MSL_C - MSL_MacOS/Src/console_OS_X.c - Unix - - - FileRelative - ../../lib/jpeg_MACH.lib - Unix - - PathRelative - Project - :jpeg: - jpegM8.mcp - Unix - - - - PathRelative - Project - :mac:carbon: - morefilex/MoreFilesX.cpp - Unix - - - PathRelative - Project - unix - baseunix.cpp - Unix - - - PathRelative - Project - :mac:carbon: - renderer.cpp - Unix - - - PathRelative - Project - xml - xml.cpp - Unix - - - PathRelative - Project - expat/lib - xmlparse.c - Unix - - - PathRelative - Project - expat/lib - xmlrole.c - Unix - - - PathRelative - Project - expat/lib - xmltok.c - Unix - - - PathRelative - Project - ::include: - wxshlb_cwc_d.pch - Unix - - - PathRelative - Project - ::include: - wxshlb_cwc_d.pch++ - Unix - - - PathRelative - Project - :mac:carbon: - drawer.cpp - Unix - - - PathRelative - Project - :mac:carbon: - taskbar.cpp - Unix - - - PathRelative - Project - xrc - xh_bmp.cpp - Unix - - - PathRelative - Project - xrc - xh_bmpbt.cpp - Unix - - - PathRelative - Project - xrc - xh_bttn.cpp - Unix - - - PathRelative - Project - xrc - xh_cald.cpp - Unix - - - PathRelative - Project - xrc - xh_chckb.cpp - Unix - - - PathRelative - Project - xrc - xh_chckl.cpp - Unix - - - PathRelative - Project - xrc - xh_choic.cpp - Unix - - - PathRelative - Project - xrc - xh_combo.cpp - Unix - - - PathRelative - Project - xrc - xh_dlg.cpp - Unix - - - PathRelative - Project - xrc - xh_frame.cpp - Unix - - - PathRelative - Project - xrc - xh_gauge.cpp - Unix - - - PathRelative - Project - xrc - xh_gdctl.cpp - Unix - - - PathRelative - Project - xrc - xh_html.cpp - Unix - - - PathRelative - Project - xrc - xh_listb.cpp - Unix - - - PathRelative - Project - xrc - xh_listc.cpp - Unix - - - PathRelative - Project - xrc - xh_menu.cpp - Unix - - - PathRelative - Project - xrc - xh_notbk.cpp - Unix - - - PathRelative - Project - xrc - xh_panel.cpp - Unix - - - PathRelative - Project - xrc - xh_radbt.cpp - Unix - - - PathRelative - Project - xrc - xh_radbx.cpp - Unix - - - PathRelative - Project - xrc - xh_scrol.cpp - Unix - - - PathRelative - Project - xrc - xh_scwin.cpp - Unix - - - PathRelative - Project - xrc - xh_sizer.cpp - Unix - - - PathRelative - Project - xrc - xh_slidr.cpp - Unix - - - PathRelative - Project - xrc - xh_spin.cpp - Unix - - - PathRelative - Project - xrc - xh_split.cpp - Unix - - - PathRelative - Project - xrc - xh_statbar.cpp - Unix - - - PathRelative - Project - xrc - xh_stbmp.cpp - Unix - - - PathRelative - Project - xrc - xh_stbox.cpp - Unix - - - PathRelative - Project - xrc - xh_stlin.cpp - Unix - - - PathRelative - Project - xrc - xh_sttxt.cpp - Unix - - - PathRelative - Project - xrc - xh_text.cpp - Unix - - - PathRelative - Project - xrc - xh_tglbtn.cpp - Unix - - - PathRelative - Project - xrc - xh_toolb.cpp - Unix - - - PathRelative - Project - xrc - xh_tree.cpp - Unix - - - PathRelative - Project - xrc - xh_unkwn.cpp - Unix - - - PathRelative - Project - xrc - xh_wizrd.cpp - Unix - - - PathRelative - Project - xrc - xmlres.cpp - Unix - - - PathRelative - Project - xrc - xmlrsall.cpp - Unix - - - PathRelative - Project - unix - gsocket.cpp - Unix - - - PathRelative - Project - mac/corefoundation - cfstring.cpp - Unix - - - PathRelative - Project - mac/corefoundation - utilsexc_cf.cpp - Unix - - - PathRelative - Project - mac/corefoundation - stdpaths_cf.cpp - Unix - - - PathRelative - Project - mac/corefoundation - gsockosx.cpp - Unix - - - PathRelative - Project - :mac:carbon: - display.cpp - Unix - - - PathRelative - Project - unix - stdpaths.cpp - Unix - - - PathRelative - Project - :mac:carbon: - imaglist.cpp - Unix - - - PathRelative - Project - xrc - xh_choicbk.cpp - Unix - - - PathRelative - Project - xrc - xh_datectrl.cpp - Unix - - - PathRelative - Project - xrc - xh_listbk.cpp - Unix - - - PathRelative - Project - unix - dlunix.cpp - Unix - - - PathRelative - Project - :common: - accesscmn.cpp - Unix - - - PathRelative - Project - :common: - appbase.cpp - Unix - - - PathRelative - Project - :common: - appcmn.cpp - Unix - - - PathRelative - Project - :common: - archive.cpp - Unix - - - PathRelative - Project - :common: - artprov.cpp - Unix - - - PathRelative - Project - :common: - artstd.cpp - Unix - - - PathRelative - Project - :common: - bmpbase.cpp - Unix - - - PathRelative - Project - :common: - bookctrl.cpp - Unix - - - PathRelative - Project - :generic: - choicbkg.cpp - Unix - - - PathRelative - Project - :common: - choiccmn.cpp - Unix - - - PathRelative - Project - :common: - clipcmn.cpp - Unix - - - PathRelative - Project - :common: - clntdata.cpp - Unix - - - PathRelative - Project - :common: - cmdline.cpp - Unix - - - PathRelative - Project - :common: - cmdproc.cpp - Unix - - - PathRelative - Project - :common: - cmndata.cpp - Unix - - - PathRelative - Project - :common: - config.cpp - Unix - - - PathRelative - Project - :common: - containr.cpp - Unix - - - PathRelative - Project - :common: - cshelp.cpp - Unix - - - PathRelative - Project - :common: - ctrlcmn.cpp - Unix - - - PathRelative - Project - :common: - ctrlsub.cpp - Unix - - - PathRelative - Project - :common: - datacmn.cpp - Unix - - - PathRelative - Project - :common: - datetime.cpp - Unix - - - PathRelative - Project - :common: - datstrm.cpp - Unix - - - PathRelative - Project - :common: - db.cpp - Unix - - - PathRelative - Project - :common: - dbgrid.cpp - Unix - - - PathRelative - Project - :common: - dbtable.cpp - Unix - - - PathRelative - Project - :common: - dcbase.cpp - Unix - - - PathRelative - Project - :common: - dircmn.cpp - Unix - - - PathRelative - Project - :common: - dlgcmn.cpp - Unix - - - PathRelative - Project - :common: - dndcmn.cpp - Unix - - - PathRelative - Project - :common: - dobjcmn.cpp - Unix - - - PathRelative - Project - :common: - docmdi.cpp - Unix - - - PathRelative - Project - :common: - docview.cpp - Unix - - - PathRelative - Project - :common: - dpycmn.cpp - Unix - - - PathRelative - Project - :common: - dseldlg.cpp - Unix - - - PathRelative - Project - :common: - dynarray.cpp - Unix - - - PathRelative - Project - :common: - dynlib.cpp - Unix - - - PathRelative - Project - :common: - dynload.cpp - Unix - - - PathRelative - Project - :common: - effects.cpp - Unix - - - PathRelative - Project - :common: - encconv.cpp - Unix - - - PathRelative - Project - :common: - event.cpp - Unix - - - PathRelative - Project - :common: - extended.c - Unix - - - PathRelative - Project - :common: - fddlgcmn.cpp - Unix - - - PathRelative - Project - :common: - ffile.cpp - Unix - - - PathRelative - Project - :common: - file.cpp - Unix - - - PathRelative - Project - :common: - fileconf.cpp - Unix - - - PathRelative - Project - :common: - filefn.cpp - Unix - - - PathRelative - Project - :common: - filename.cpp - Unix - - - PathRelative - Project - :common: - filesys.cpp - Unix - - - PathRelative - Project - :common: - fldlgcmn.cpp - Unix - - - PathRelative - Project - :common: - fmapbase.cpp - Unix - - - PathRelative - Project - :common: - fontcmn.cpp - Unix - - - PathRelative - Project - :common: - fontmap.cpp - Unix - - - PathRelative - Project - :common: - framecmn.cpp - Unix - - - PathRelative - Project - :common: - fs_inet.cpp - Unix - - - PathRelative - Project - :common: - fs_mem.cpp - Unix - - - PathRelative - Project - :common: - fs_zip.cpp - Unix - - - PathRelative - Project - :common: - ftp.cpp - Unix - - - PathRelative - Project - :common: - gaugecmn.cpp - Unix - - - PathRelative - Project - :common: - gbsizer.cpp - Unix - - - PathRelative - Project - :common: - gdicmn.cpp - Unix - - - PathRelative - Project - :common: - geometry.cpp - Unix - - - PathRelative - Project - :common: - gifdecod.cpp - Unix - - - PathRelative - Project - :common: - hash.cpp - Unix - - - PathRelative - Project - :common: - hashmap.cpp - Unix - - - PathRelative - Project - :common: - helpbase.cpp - Unix - - - PathRelative - Project - :common: - http.cpp - Unix - - - PathRelative - Project - :common: - iconbndl.cpp - Unix - - - PathRelative - Project - :common: - imagall.cpp - Unix - - - PathRelative - Project - :common: - imagbmp.cpp - Unix - - - PathRelative - Project - :common: - image.cpp - Unix - - - PathRelative - Project - :common: - imagfill.cpp - Unix - - - PathRelative - Project - :common: - imaggif.cpp - Unix - - - PathRelative - Project - :common: - imagiff.cpp - Unix - - - PathRelative - Project - :common: - imagjpeg.cpp - Unix - - - PathRelative - Project - :common: - imagpcx.cpp - Unix - - - PathRelative - Project - :common: - imagpng.cpp - Unix - - - PathRelative - Project - :common: - imagpnm.cpp - Unix - - - PathRelative - Project - :common: - imagtiff.cpp - Unix - - - PathRelative - Project - :common: - imagxpm.cpp - Unix - - - PathRelative - Project - :common: - init.cpp - Unix - - - PathRelative - Project - :common: - intl.cpp - Unix - - - PathRelative - Project - :common: - ipcbase.cpp - Unix - - - PathRelative - Project - :common: - layout.cpp - Unix - - - PathRelative - Project - :common: - lboxcmn.cpp - Unix - - - PathRelative - Project - :common: - list.cpp - Unix - - - PathRelative - Project - :common: - log.cpp - Unix - - - PathRelative - Project - :common: - longlong.cpp - Unix - - - PathRelative - Project - :common: - matrix.cpp - Unix - - - PathRelative - Project - :common: - memory.cpp - Unix - - - PathRelative - Project - :common: - menucmn.cpp - Unix - - - PathRelative - Project - :common: - mimecmn.cpp - Unix - - - PathRelative - Project - :common: - module.cpp - Unix - - - PathRelative - Project - :common: - msgout.cpp - Unix - - - PathRelative - Project - :common: - mstream.cpp - Unix - - - PathRelative - Project - :common: - nbkbase.cpp - Unix - - - PathRelative - Project - :common: - object.cpp - Unix - - - PathRelative - Project - :common: - paper.cpp - Unix - - - PathRelative - Project - :common: - popupcmn.cpp - Unix - - - PathRelative - Project - :common: - prntbase.cpp - Unix - - - PathRelative - Project - :common: - process.cpp - Unix - - - PathRelative - Project - :common: - protocol.cpp - Unix - - - PathRelative - Project - :common: - quantize.cpp - Unix - - - PathRelative - Project - :common: - radiocmn.cpp - Unix - - - PathRelative - Project - :common: - regex.cpp - Unix - - - PathRelative - Project - :common: - rendcmn.cpp - Unix - - - PathRelative - Project - :common: - rgncmn.cpp - Unix - - - PathRelative - Project - :common: - sckaddr.cpp - Unix - - - PathRelative - Project - :common: - sckfile.cpp - Unix - - - PathRelative - Project - :common: - sckipc.cpp - Unix - - - PathRelative - Project - :common: - sckstrm.cpp - Unix - - - PathRelative - Project - :common: - settcmn.cpp - Unix - - - PathRelative - Project - :common: - sizer.cpp - Unix - - - PathRelative - Project - :common: - socket.cpp - Unix - - - PathRelative - Project - :common: - statbar.cpp - Unix - - - PathRelative - Project - :common: - stdpbase.cpp - Unix - - - PathRelative - Project - :common: - stockitem.cpp - Unix - - - PathRelative - Project - :common: - stopwatch.cpp - Unix - - - PathRelative - Project - :common: - strconv.cpp - Unix - - - PathRelative - Project - :common: - stream.cpp - Unix - - - PathRelative - Project - :common: - string.cpp - Unix - - - PathRelative - Project - :common: - sysopt.cpp - Unix - - - PathRelative - Project - :common: - taskbarcmn.cpp - Unix - - - PathRelative - Project - :common: - tbarbase.cpp - Unix - - - PathRelative - Project - :common: - textbuf.cpp - Unix - - - PathRelative - Project - :common: - textcmn.cpp - Unix - - - PathRelative - Project - :common: - textfile.cpp - Unix - - - PathRelative - Project - :common: - timercmn.cpp - Unix - - - PathRelative - Project - :common: - tokenzr.cpp - Unix - - - PathRelative - Project - :common: - toplvcmn.cpp - Unix - - - PathRelative - Project - :common: - treebase.cpp - Unix - - - PathRelative - Project - :common: - txtstrm.cpp - Unix - - - PathRelative - Project - :common: - uri.cpp - Unix - - - PathRelative - Project - :common: - url.cpp - Unix - - - PathRelative - Project - :common: - utilscmn.cpp - Unix - - - PathRelative - Project - :common: - valgen.cpp - Unix - - - PathRelative - Project - :common: - validate.cpp - Unix - - - PathRelative - Project - :common: - valtext.cpp - Unix - - - PathRelative - Project - :common: - variant.cpp - Unix - - - PathRelative - Project - :common: - wfstream.cpp - Unix - - - PathRelative - Project - :common: - wincmn.cpp - Unix - - - PathRelative - Project - :common: - wxchar.cpp - Unix - - - PathRelative - Project - :common: - xpmdecod.cpp - Unix - - - PathRelative - Project - :common: - zipstrm.cpp - Unix - - - PathRelative - Project - :common: - zstream.cpp - Unix - - - PathRelative - Project - :generic: - busyinfo.cpp - Unix - - - PathRelative - Project - :generic: - calctrl.cpp - Unix - - - PathRelative - Project - :generic: - caret.cpp - Unix - - - PathRelative - Project - :generic: - choicdgg.cpp - Unix - - - PathRelative - Project - :generic: - colrdlgg.cpp - Unix - - - PathRelative - Project - :generic: - datectlg.cpp - Unix - - - PathRelative - Project - :generic: - dcpsg.cpp - Unix - - - PathRelative - Project - :generic: - dirctrlg.cpp - Unix - - - PathRelative - Project - :generic: - dirdlgg.cpp - Unix - - - PathRelative - Project - :generic: - dragimgg.cpp - Unix - - - PathRelative - Project - :generic: - fdrepdlg.cpp - Unix - - - PathRelative - Project - :generic: - fontdlgg.cpp - Unix - - - PathRelative - Project - :generic: - grid.cpp - Unix - - - PathRelative - Project - :generic: - gridctrl.cpp - Unix - - - PathRelative - Project - :generic: - gridsel.cpp - Unix - - - PathRelative - Project - :generic: - laywin.cpp - Unix - - - PathRelative - Project - :generic: - listbkg.cpp - Unix - - - PathRelative - Project - :generic: - listctrl.cpp - Unix - - - PathRelative - Project - :generic: - logg.cpp - Unix - - - PathRelative - Project - :generic: - numdlgg.cpp - Unix - - - PathRelative - Project - :generic: - panelg.cpp - Unix - - - PathRelative - Project - :generic: - printps.cpp - Unix - - - PathRelative - Project - :generic: - progdlgg.cpp - Unix - - - PathRelative - Project - :generic: - renderg.cpp - Unix - - - PathRelative - Project - :generic: - sashwin.cpp - Unix - - - PathRelative - Project - :generic: - scrlwing.cpp - Unix - - - PathRelative - Project - :generic: - selstore.cpp - Unix - - - PathRelative - Project - :generic: - splash.cpp - Unix - - - PathRelative - Project - :generic: - splitter.cpp - Unix - - - PathRelative - Project - :generic: - statusbr.cpp - Unix - - - PathRelative - Project - :generic: - tabg.cpp - Unix - - - PathRelative - Project - :generic: - textdlgg.cpp - Unix - - - PathRelative - Project - :generic: - tipdlg.cpp - Unix - - - PathRelative - Project - :generic: - tipwin.cpp - Unix - - - PathRelative - Project - :generic: - treectlg.cpp - Unix - - - PathRelative - Project - :generic: - wizard.cpp - Unix - - - PathRelative - CodeWarrior - MacOS X Support - Libraries/Startup/dylib1.o - Unix - - - PathRelative - Project - :common: - debugrpt.cpp - Unix - - - PathRelative - Project - xrc - xh_mdi.cpp - Unix - - - PathRelative - CodeWarrior - MacOS X Support - Libraries/Runtime/Libs/MSL_Runtime_Mach-O_D.a - Unix - - - - - - PathRelative - Project - :jpeg: - jpegM8.mcp - Unix - - - - Mach-O - Build, LinkAgainst - - FileRelative - ../../lib/jpeg_MACH.lib - Unix - - PathRelative - Project - :jpeg: - jpegM8.mcp - Unix - - - - - - - - PathRelative - Project - :png: - pngM8.mcp - Unix - - - - Mach-O - Build, LinkAgainst - - FileRelative - ../../lib/png_MACH.lib - Unix - - PathRelative - Project - :png: - pngM8.mcp - Unix - - - - - - - - PathRelative - Project - :zlib: - zlibM8.mcp - Unix - - - - Mach-O - Build, LinkAgainst - - FileRelative - ../../lib/zlib_MACH.lib - Unix - - PathRelative - Project - :zlib: - zlibM8.mcp - Unix - - - - - - - - PathRelative - Project - :tiff: - tiffM8.mcp - Unix - - - - Mach-O - Build, LinkAgainst - - FileRelative - ../../lib/tif_MACH.lib - Unix - - PathRelative - Project - :tiff: - tiffM8.mcp - Unix - - - - - - - - PathRelative - Project - :regex: - regexM8.mcp - Unix - - - - Mach-O - Build, LinkAgainst - - FileRelative - ../../lib/regex_MACH.lib - Unix - - PathRelative - Project - :regex: - regexM8.mcp - Unix - - - - - - - - - - PathRelative - OS X Volume - System/Library/Frameworks - Carbon.framework - Unix - - Carbon - - - - PathRelative - OS X Volume - System/Library/Frameworks - System.framework - Unix - - System - - - - PathRelative - OS X Volume - System/Library/Frameworks - QuickTime.framework - Unix - - QuickTime - - - - PathRelative - OS X Volume - System/Library/Frameworks - IOKit.framework - Unix - - IOKit - - - - - wxshlb Mach-O release - - - - UserSourceTrees - - - AlwaysSearchUserPathsfalse - InterpretDOSAndUnixPathstrue - RequireFrameworkStyleIncludesfalse - UserSearchPaths - - SearchPath - Path::include: - PathFormatMacOS - PathRootProject - - Recursivefalse - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path::art: - PathFormatMacOS - PathRootProject - - Recursivefalse - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:generic: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:mac:carbon: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:common: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:zlib: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:png: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:jpeg: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:iodbc: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:tiff: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:html: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Pathunix - PathFormatUnix - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path../lib - PathFormatUnix - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Pathxml - PathFormatUnix - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Pathexpat/lib - PathFormatUnix - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Pathxrc - PathFormatUnix - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Pathmac/corefoundation - PathFormatUnix - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SystemSearchPaths - - SearchPath - PathMacOS X Support/Headers/(wchar_t Support fix) - PathFormatUnix - PathRootCodeWarrior - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - PathMacOS X Support - PathFormatUnix - PathRootCodeWarrior - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:regex: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Pathusr/include - PathFormatUnix - PathRootOS X Volume - - Recursivefalse - FrameworkPathfalse - HostFlagsAll - - - SearchPath - PathMSL/MSL_C - PathFormatUnix - PathRootCodeWarrior - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - PathMSL/MSL_C++ - PathFormatUnix - PathRootCodeWarrior - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Pathusr/lib - PathFormatUnix - PathRootOS X Volume - - Recursivefalse - FrameworkPathfalse - HostFlagsAll - - - SearchPath - PathSystem/Library/Frameworks - PathFormatUnix - PathRootOS X Volume - - Recursivefalse - FrameworkPathtrue - HostFlagsAll - - - - - MWRuntimeSettings_WorkingDirectory - MWRuntimeSettings_CommandLine - MWRuntimeSettings_HostApplication - Path - PathFormatGeneric - PathRootAbsolute - - MWRuntimeSettings_EnvVars - - - LinkerMacOS X PPC Linker - PreLinker - PostLinker - Targetnamewxshlb Mach-O release - OutputDirectory - Path::lib: - PathFormatMacOS - PathRootProject - - SaveEntriesUsingRelativePathstrue - - - FileMappings - - FileTypeAPPL - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypeAppl - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypeMDYL - FileExtension - CompilerMachO Importer - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeMLIB - FileExtension - CompilerMachO Importer - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeMMLB - FileExtension - CompilerMachO Importer - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeMPLF - FileExtension - CompilerMachO Importer - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeMWCD - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypeRSRC - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.arr - Compiler - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.axp - Compiler - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.c - CompilerMW C/C++ PPC Mac OS X - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.c++ - CompilerMW C/C++ PPC Mac OS X - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.cc - CompilerMW C/C++ PPC Mac OS X - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.cp - CompilerMW C/C++ PPC Mac OS X - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.cpp - CompilerMW C/C++ PPC Mac OS X - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.exp - Compiler - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.h - CompilerMW C/C++ PPC Mac OS X - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMaketrue - - - FileTypeTEXT - FileExtension.h++ - CompilerMW C/C++ PPC Mac OS X - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMaketrue - - - FileTypeTEXT - FileExtension.hpp - CompilerMW C/C++ PPC Mac OS X - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMaketrue - - - FileTypeTEXT - FileExtension.lcf - Compiler - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.m - CompilerMW C/C++ PPC Mac OS X - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.mm - CompilerMW C/C++ PPC Mac OS X - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.pch - CompilerMW C/C++ PPC Mac OS X - EditLanguageC/C++ - Precompiletrue - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.pch++ - CompilerMW C/C++ PPC Mac OS X - EditLanguageC/C++ - Precompiletrue - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.pchm - CompilerMW C/C++ PPC Mac OS X - EditLanguageC/C++ - Precompiletrue - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.pchmm - CompilerMW C/C++ PPC Mac OS X - EditLanguageC/C++ - Precompiletrue - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.plc - CompilerProperty List Compiler - EditLanguageProperty List - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.ploc - CompilerProperty List Compiler - EditLanguageProperty List - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.r - CompilerRez - EditLanguageRez - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.wke - Compiler - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypedocu - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypersrc - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileExtension.a - CompilerMachO Importer - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileExtension.doc - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFilefalse - IgnoredByMaketrue - - - FileExtension.dylib - CompilerMachO Importer - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileExtension.gif - CompilerCopy To Package - EditLanguage - Precompilefalse - Launchabletrue - ResourceFilefalse - IgnoredByMaketrue - - - FileExtension.icns - CompilerCopy To Package - EditLanguage - Precompilefalse - Launchabletrue - ResourceFilefalse - IgnoredByMaketrue - - - FileExtension.jpg - CompilerCopy To Package - EditLanguage - Precompilefalse - Launchabletrue - ResourceFilefalse - IgnoredByMaketrue - - - FileExtension.lib - CompilerMachO Importer - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileExtension.nib - CompilerCopy To Package - EditLanguage - Precompilefalse - Launchabletrue - ResourceFilefalse - IgnoredByMaketrue - - - FileExtension.pl - CompilerPerl Tool - EditLanguagePerl - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileExtension.plist - CompilerCopy To Package - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMaketrue - - - FileExtension.ppob - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileExtension.psh - CompilerShell Tool - EditLanguage - Precompiletrue - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileExtension.rsrc - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileExtension.sh - CompilerShell Tool - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileExtension.strings - CompilerCopy To Package - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMaketrue - - - FileExtension.tiff - CompilerCopy To Package - EditLanguage - Precompilefalse - Launchabletrue - ResourceFilefalse - IgnoredByMaketrue - - - - - CacheModDatestrue - DumpBrowserInfofalse - CacheSubprojectstrue - UseThirdPartyDebuggerfalse - BrowserGenerator0 - DebuggerAppPath - Path - PathFormatGeneric - PathRootAbsolute - - DebuggerCmdLineArgs - DebuggerWorkingDir - Path - PathFormatGeneric - PathRootAbsolute - - CodeCompletionPrefixFileNameMacHeaders.c - CodeCompletionMacroFileNameMacOS_Carbon_C++_Macros.h - - - ConsoleEncoding0 - LogSystemMessagestrue - AutoTargetDLLsfalse - StopAtWatchpointstrue - PauseWhileRunningfalse - PauseInterval5 - PauseUIFlags0 - AltExePath - Path - PathFormatGeneric - PathRootAbsolute - - StopAtTempBPOnLaunchtrue - CacheSymbolicstrue - TempBPFunctionNamemain - TempBPType0 - - - Enabledfalse - ConnectionName - DownloadPath - LaunchRemoteAppfalse - RemoteAppPath - CoreID0 - JTAGClockSpeed8000 - IsMultiCorefalse - OSDownloadfalse - UseGlobalOSDownloadfalse - OSDownloadConnectionName - OSDownloadPath - AltDownloadfalse - AltDownloadConnectionName - - - OtherExecutables - - - CustomColor1 - Red0 - Green32767 - Blue0 - - CustomColor2 - Red0 - Green32767 - Blue0 - - CustomColor3 - Red0 - Green32767 - Blue0 - - CustomColor4 - Red0 - Green32767 - Blue0 - - - - MWFrontEnd_C_cplusplus0 - MWFrontEnd_C_checkprotos0 - MWFrontEnd_C_arm0 - MWFrontEnd_C_trigraphs0 - MWFrontEnd_C_onlystdkeywords0 - MWFrontEnd_C_enumsalwaysint0 - MWFrontEnd_C_mpwpointerstyle0 - MWFrontEnd_C_prefixnamewx/wxshlb_cwc.h - MWFrontEnd_C_ansistrict0 - MWFrontEnd_C_mpwcnewline0 - MWFrontEnd_C_wchar_type1 - MWFrontEnd_C_enableexceptions1 - MWFrontEnd_C_dontreusestrings0 - MWFrontEnd_C_poolstrings0 - MWFrontEnd_C_dontinline1 - MWFrontEnd_C_useRTTI1 - MWFrontEnd_C_multibyteaware0 - MWFrontEnd_C_unsignedchars1 - MWFrontEnd_C_autoinline0 - MWFrontEnd_C_booltruefalse1 - MWFrontEnd_C_inlinelevel0 - MWFrontEnd_C_ecplusplus0 - MWFrontEnd_C_objective_c0 - MWFrontEnd_C_defer_codegen0 - MWFrontEnd_C_templateparser0 - MWFrontEnd_C_c990 - MWFrontEnd_C_bottomupinline1 - - - MWWarning_C_warn_illpragma1 - MWWarning_C_warn_emptydecl0 - MWWarning_C_warn_possunwant0 - MWWarning_C_warn_unusedvar0 - MWWarning_C_warn_unusedarg0 - MWWarning_C_warn_extracomma0 - MWWarning_C_pedantic1 - MWWarning_C_warningerrors0 - MWWarning_C_warn_hidevirtual1 - MWWarning_C_warn_implicitconv0 - MWWarning_C_warn_notinlined0 - MWWarning_C_warn_structclass1 - - - MWFTP_Post_hostName - MWFTP_Post_username - MWFTP_Post_password0ÿÂà -ž0¼,šì - MWFTP_Post_remoteDir - MWFTP_Post_ftp_PathVersion1 - MWFTP_Post_ftp_PathType0 - MWFTP_Post_ftp_PathFormat0 - MWFTP_Post_ftp_tree - MWFTP_Post_uploadDir - MWFTP_Post_ftp_port21 - MWFTP_Post_SendBin1 - MWFTP_Post_ShouldLog1 - - - MWCommandLine_Java_clsName - MWCommandLine_Java_args - - - MWVJavaDebugging_Protocol1 - MWVJavaDebugging_JDKVersion1 - MWVJavaDebugging_TimeOut10 - MWVJavaDebugging_SupportSlowDevicesfalse - MWVJavaDebugging_UseRemoteLaunchAgentfalse - MWVJavaDebugging_LaunchVMasServerfalse - - - MWJava_Language_optimizefalse - MWJava_Language_warnDeprecatedfalse - MWJava_Language_emitMapfalse - MWJava_Language_strictFileNamesfalse - MWJava_Language_strictFileHierarchyfalse - MWJava_Language_1_1_Compatiblefalse - MWJava_Language_emitHeaders0 - MWJava_Language_headerTypeJNINativeHeaders - MWJava_Language_packageFilter - MWJava_Language_genCommentstrue - MWJava_Language_genHeadersfalse - MWJava_Language_enableAssertsfalse - MWJava_Language_targetVM1.1 - - - Manifest-JAD Attributes - - AttributeMain-Class - ValueAuto-Generated - - - - - MWJava_MRJAppBuilder_outFileMRJApplication - MWJava_MRJAppBuilder_mergefalse - MWJava_MRJAppBuilder_quitMenutrue - MWJava_MRJAppBuilder_growfalse - MWJava_MRJAppBuilder_stdoutTypeConsole - MWJava_MRJAppBuilder_stderrTypeConsole - MWJava_MRJAppBuilder_stdinTypeConsole - MWJava_MRJAppBuilder_appIconPVersion0 - MWJava_MRJAppBuilder_appIconPType0 - MWJava_MRJAppBuilder_appIconPFormat0 - MWJava_MRJAppBuilder_appIconPTree - MWJava_MRJAppBuilder_appIconFile - MWJava_MRJAppBuilder_splashScreenPVersion0 - MWJava_MRJAppBuilder_splashScreenPType0 - MWJava_MRJAppBuilder_splashScreenPFormat0 - MWJava_MRJAppBuilder_splashScreenPTree - MWJava_MRJAppBuilder_splashScreenPICTFile - MWJava_MRJAppBuilder_aboutName - MWJava_MRJAppBuilder_stdoutPVersion0 - MWJava_MRJAppBuilder_stdoutPType0 - MWJava_MRJAppBuilder_stdoutPFormat0 - MWJava_MRJAppBuilder_stdoutPTree - MWJava_MRJAppBuilder_stdoutFile - MWJava_MRJAppBuilder_stdoutAppendfalse - MWJava_MRJAppBuilder_stderrPType0 - MWJava_MRJAppBuilder_stderrPFormat0 - MWJava_MRJAppBuilder_stderrPTree - MWJava_MRJAppBuilder_stderrFile - MWJava_MRJAppBuilder_stderrAppendfalse - MWJava_MRJAppBuilder_stdinPType0 - MWJava_MRJAppBuilder_stdinPFormat0 - MWJava_MRJAppBuilder_stdinPTree - MWJava_MRJAppBuilder_stdinFile - - - MWJava_Output_outputtypeJarFile - MWJava_Output_outfileJavaClasses.jar - MWJava_Output_ftype1514754080 - MWJava_Output_fcreator1297570384 - MWJava_Output_compress0 - MWJava_Output_genManifest0 - MWJava_Output_trunctypeFront - MWJava_Output_deleteClasses0 - MWJava_Output_consoleApp1 - MWJava_Output_preverify0 - MWJava_Output_genJad0 - MWJava_Output_obfuscate0 - - - MWJava_Proj_projtypeApplet - MWJava_Proj_mainClassName - MWJava_Proj_HTMLAppCreator1145457748 - MWJava_Proj_HTMLAppNameMetrowerks Java - MWJava_Proj_PathVersion1 - MWJava_Proj_PathType0 - MWJava_Proj_PathFormat0 - MWJava_Proj_tree - MWJava_Proj_HTMLAppWin32NameInternet Explorer - MWJava_Proj_compress0 - MWJava_Proj_simulator0 - MWJava_Proj_useVM\000\000macosx - MWJava_Proj_vmarguments - MWJava_Proj_vmName - MWJava_Proj_simPropFile - - - MWJavaDoc_Proj_Version1 - MWJavaDoc_Proj_Deprecated1 - MWJavaDoc_Proj_Author1 - MWJavaDoc_Proj_Index1 - MWJavaDoc_Proj_Tree1 - MWJavaDoc_Proj_SunResolveToSame0 - MWJavaDoc_Proj_Shortnames1 - MWJavaDoc_Proj_Folder0 - MWJavaDoc_Proj_GenerateAPILinks0 - MWJavaDoc_Proj_scopePublic - MWJavaDoc_Proj_fcreator1297303877 - MWJavaDoc_Proj_encodingName - MWJavaDoc_Proj_decodingName - MWJavaDoc_Proj_javaPackagePathhttp://java.sun.com/products/jdk/1.1/docs/api/ - - - MWMerge_MacOS_projectTypeApplication - MWMerge_MacOS_outputNameMerge Out - MWMerge_MacOS_outputCreator???? - MWMerge_MacOS_outputTypeAPPL - MWMerge_MacOS_suppressWarning0 - MWMerge_MacOS_copyFragments1 - MWMerge_MacOS_copyResources1 - MWMerge_MacOS_flattenResource0 - MWMerge_MacOS_flatFileNamea.rsrc - MWMerge_MacOS_flatFileOutputPath - Path: - PathFormatMacOS - PathRootProject - - MWMerge_MacOS_skipResources - DLGX - ckid - Proj - WSPC - - - - FileLockedfalse - ResourcesMapIsReadOnlyfalse - PrinterDriverIsMultiFinderCompatiblefalse - Invisiblefalse - HasBundlefalse - NameLockedfalse - Stationeryfalse - HasCustomIconfalse - Sharedfalse - HasBeenInitedfalse - Label0 - Comments - - - MWMacOSPackager_UsePackager0 - MWMacOSPackager_FolderToPackage - Path - PathFormatMacOS - PathRootAbsolute - - MWMacOSPackager_CreateClassicAlias0 - MWMacOSPackager_ClassicAliasMethodUseTargetOutput - MWMacOSPackager_ClassicAliasPath - Path - PathFormatGeneric - PathRootAbsolute - - MWMacOSPackager_CreatePkgInfo0 - MWMacOSPackager_PkgCreatorType???? - MWMacOSPackager_PkgFileTypeAPPL - - - MWCodeGen_PPC_structalignmentPPC_mw - MWCodeGen_PPC_tracebacktablesOutOfLine - MWCodeGen_PPC_processorGeneric - MWCodeGen_PPC_function_align4 - MWCodeGen_PPC_tocdata1 - MWCodeGen_PPC_largetoc0 - MWCodeGen_PPC_profiler0 - MWCodeGen_PPC_vectortocdata0 - MWCodeGen_PPC_poolconst0 - MWCodeGen_PPC_peephole1 - MWCodeGen_PPC_readonlystrings0 - MWCodeGen_PPC_linkerpoolsstrings0 - MWCodeGen_PPC_volatileasm0 - MWCodeGen_PPC_schedule0 - MWCodeGen_PPC_altivec0 - MWCodeGen_PPC_altivec_move_block0 - MWCodeGen_PPC_strictIEEEfp0 - MWCodeGen_PPC_fpcontract1 - MWCodeGen_PPC_genfsel0 - MWCodeGen_PPC_orderedfpcmp0 - - - MWCodeGen_MachO_structalignmentPPC_mw - MWCodeGen_MachO_profiler_enumOff - MWCodeGen_MachO_processorP750 - MWCodeGen_MachO_function_align4 - MWCodeGen_MachO_common0 - MWCodeGen_MachO_peephole1 - MWCodeGen_MachO_readonlystrings1 - MWCodeGen_MachO_linkerpoolsstrings1 - MWCodeGen_MachO_volatileasm0 - MWCodeGen_MachO_schedule0 - MWCodeGen_MachO_altivec0 - MWCodeGen_MachO_vecmove0 - MWCodeGen_MachO_fp_ieee_strict0 - MWCodeGen_MachO_fpcontract1 - MWCodeGen_MachO_genfsel0 - MWCodeGen_MachO_fp_cmps_ordered0 - - - MWDisassembler_PPC_showcode1 - MWDisassembler_PPC_extended1 - MWDisassembler_PPC_mix0 - MWDisassembler_PPC_nohex0 - MWDisassembler_PPC_showdata1 - MWDisassembler_PPC_showexceptions1 - MWDisassembler_PPC_showsym1 - MWDisassembler_PPC_shownames1 - - - GlobalOptimizer_PPC_optimizationlevelLevel4 - GlobalOptimizer_PPC_optforSpeed - - - MWLinker_PPC_linksym1 - MWLinker_PPC_symfullpath1 - MWLinker_PPC_linkmap0 - MWLinker_PPC_nolinkwarnings0 - MWLinker_PPC_dontdeadstripinitcode1 - MWLinker_PPC_permitmultdefs0 - MWLinker_PPC_linkmodeFast - MWLinker_PPC_initname - MWLinker_PPC_mainname__start - MWLinker_PPC_termname - - - MWLinker_MacOSX_linksym0 - MWLinker_MacOSX_symfullpath1 - MWLinker_MacOSX_nolinkwarnings0 - MWLinker_MacOSX_linkmap0 - MWLinker_MacOSX_dontdeadstripinitcode0 - MWLinker_MacOSX_permitmultdefs0 - MWLinker_MacOSX_use_objectivec_semantics0 - MWLinker_MacOSX_strip_debug_symbols0 - MWLinker_MacOSX_split_segs0 - MWLinker_MacOSX_report_msl_overloads0 - MWLinker_MacOSX_objects_follow_linkorder0 - MWLinker_MacOSX_linkmodeFast - MWLinker_MacOSX_exportsPragma - MWLinker_MacOSX_sortcodeNone - MWLinker_MacOSX_mainname - - - MWProject_MacOSX_typeSharedLibrary - MWProject_MacOSX_outfilewx_MACH.dylib - MWProject_MacOSX_filecreator???? - MWProject_MacOSX_filetypeMDYL - MWProject_MacOSX_vmaddress0 - MWProject_MacOSX_usedefaultvmaddr1 - MWProject_MacOSX_flatrsrc1 - MWProject_MacOSX_flatrsrcfilenamewx_MACH.rsrc - MWProject_MacOSX_flatrsrcoutputdir - Path../lib - PathFormatUnix - PathRootProject - - MWProject_MacOSX_installpath@executable_path/../Frameworks/ - MWProject_MacOSX_dont_prebind0 - MWProject_MacOSX_flat_namespace0 - MWProject_MacOSX_frameworkversionA - MWProject_MacOSX_currentversion0 - MWProject_MacOSX_flat_oldimpversion0 - - - MWLinker_MachO_exportsNone - MWLinker_MachO_mainnamestart - MWLinker_MachO_currentversion0 - MWLinker_MachO_compatibleversion0 - MWLinker_MachO_symfullpath0 - MWLinker_MachO_supresswarnings0 - MWLinker_MachO_multisymerror0 - MWLinker_MachO_prebind1 - MWLinker_MachO_deadstrip1 - MWLinker_MachO_objectivecsemantics0 - MWLinker_MachO_whichfileloaded0 - MWLinker_MachO_whyfileloaded0 - MWLinker_MachO_readonlyrelocsErrors - MWLinker_MachO_undefinedsymbolsErrors - MWLinker_MachO_twolevelnamespace1 - MWLinker_MachO_stripdebugsymbols0 - - - MWProject_MachO_typeExecutable - MWProject_MachO_outfilea.exe - MWProject_MachO_filecreator???? - MWProject_MachO_filetypeMEXE - MWProject_MachO_vmaddress4096 - MWProject_MachO_flatrsrc1 - MWProject_MachO_flatrsrcfilenamea.rsrc - MWProject_MachO_flatrsrcoutputdir - Path: - PathFormatMacOS - PathRootProject - - MWProject_MachO_installpath./ - MWProject_MachO_frameworkversion - - - MWPEF_exportsAll - MWPEF_libfolder0 - MWPEF_sortcodeNone - MWPEF_expandbss0 - MWPEF_sharedata0 - MWPEF_olddefversion0 - MWPEF_oldimpversion0 - MWPEF_currentversion0 - MWPEF_fragmentnamewxwin - MWPEF_collapsereloads0 - - - MWProject_PPC_typeLibrary - MWProject_PPC_outfilewx_CARBON_d.lib - MWProject_PPC_filecreator???? - MWProject_PPC_filetype???? - MWProject_PPC_size0 - MWProject_PPC_minsize0 - MWProject_PPC_stacksize0 - MWProject_PPC_flags0 - MWProject_PPC_symfilename - MWProject_PPC_rsrcname - MWProject_PPC_rsrcheaderNative - MWProject_PPC_rsrctype???? - MWProject_PPC_rsrcid0 - MWProject_PPC_rsrcflags0 - MWProject_PPC_rsrcstore0 - MWProject_PPC_rsrcmerge0 - MWProject_PPC_flatrsrc0 - MWProject_PPC_flatrsrcoutputdir - Path: - PathFormatMacOS - PathRootProject - - MWProject_PPC_flatrsrcfilename - - - MWAssembler_PPC_auxheader0 - MWAssembler_PPC_symmodeMac - MWAssembler_PPC_dialectPPC - MWAssembler_PPC_prefixfile - MWAssembler_PPC_typecheck0 - MWAssembler_PPC_warnings0 - MWAssembler_PPC_casesensitive0 - - - PList_OutputTypeFile - PList_OutputEncodingUTF-8 - PList_Prefix - PList_FileFilenameInfo.plist - PList_FileDirectory - Path: - PathFormatMacOS - PathRootProject - - PList_ResourceTypeplst - PList_ResourceID0 - PList_ResourceName - - - MWRez_Language_maxwidth80 - MWRez_Language_scriptRoman - MWRez_Language_alignmentAlign1 - MWRez_Language_filtermodeFilterSkip - MWRez_Language_suppresswarnings0 - MWRez_Language_escapecontrolchars1 - MWRez_Language_prefixname - MWRez_Language_filteredtypes'CODE' 'DATA' 'PICT' - - - MWWinRC_prefixname - - - MWCodeGen_X86_processorGeneric - MWCodeGen_X86_alignmentbytes8 - MWCodeGen_X86_exceptionsZeroOverhead - MWCodeGen_X86_name_manglingMWWin32 - MWCodeGen_X86_use_extinst0 - MWCodeGen_X86_extinst_mmx0 - MWCodeGen_X86_extinst_3dnow0 - MWCodeGen_X86_use_mmx_3dnow_convention0 - MWCodeGen_X86_extinst_cmov0 - MWCodeGen_X86_extinst_sse0 - MWCodeGen_X86_extinst_sse20 - MWCodeGen_X86_intrinsics0 - MWCodeGen_X86_optimizeasm0 - MWCodeGen_X86_disableopts0 - MWCodeGen_X86_profile0 - MWLinker_X86_runtimeCustom - MWCodeGen_X86_readonlystrings0 - - - MWLinker_X86_subsysmajorid4 - MWLinker_X86_subsysminorid0 - MWCOFF_X86_opsysmajorid4 - MWCOFF_X86_opsysminorid0 - MWLinker_X86_usrmajorid0 - MWLinker_X86_usrminorid0 - MWProject_X86_maxstacksize1024 - MWProject_X86_minstacksize4 - MWProject_X86_size1024 - MWProject_X86_minsize4 - MWCOFF_X86_coff_flags0 - MWCOFF_X86_dll_flags0 - MWProject_X86_baseaddress4194304 - MWCOFF_X86_filealign512 - MWCOFF_X86_sectionalign4096 - - - PDisasmX86_showHeaderstrue - PDisasmX86_showSectHeaderstrue - PDisasmX86_showSymTabtrue - PDisasmX86_showCodetrue - PDisasmX86_showDatatrue - PDisasmX86_showDebugfalse - PDisasmX86_showExceptionsfalse - PDisasmX86_showRawfalse - PDisasmX86_showAllRawfalse - PDisasmX86_showSourcefalse - PDisasmX86_showRelocationtrue - PDisasmX86_showHextrue - PDisasmX86_showCommentsfalse - PDisasmX86_showSymDefstrue - PDisasmX86_unmanglefalse - PDisasmX86_verbosefalse - PDisasmX86_resolveRelocstrue - PDisasmX86_resolveLocalsfalse - - - MWDebugger_X86_Exceptions - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - - - - GlobalOptimizer_X86_optimizationlevelLevel0 - GlobalOptimizer_X86_optforSpeed - - - MWLinker_X86_entrypointusageDefault - MWLinker_X86_entrypoint - MWLinker_X86_subsystemWinGUI - MWLinker_X86_commandfile - MWLinker_X86_generatemap0 - MWLinker_X86_linksym1 - MWLinker_X86_linkCV1 - MWLinker_X86_symfullpathfalse - MWLinker_X86_linkdebugtrue - MWLinker_X86_checksumfalse - MWLinker_X86_zero_init_bssfalse - MWLinker_X86_mergedatafalse - MWLinker_X86_usedefaultlibsfalse - MWLinker_X86_adddefaultlibsfalse - MWLinker_X86_nowarningsfalse - MWLinker_X86_verbosefalse - - - MWProject_X86_typeLibrary - MWProject_X86_outfilewx_x86_d.lib - MWProject_X86_importlib - MWProject_X86_setimportlibdirfalse - MWProject_X86_dontgenerateimportlibfalse - MWProject_X86_oldformatlibfalse - MWProject_X86_replaceobjextensionfalse - MWProject_X86_copyallfilesfalse - - - - PathRelative - Project - :mac:carbon: - :accel.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :app.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :bitmap.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :bmpbuttn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :brush.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :button.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :checkbox.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :checklst.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :choice.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :clipbrd.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :colordlg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :colour.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :combobox.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :control.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :cursor.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :data.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :dc.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :dcclient.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :dcmemory.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :dcscreen.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :dialog.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :dirdlg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :filedlg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :font.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :fontdlg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :frame.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :gauge.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :gdiobj.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :icon.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :joystick.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :listbox.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :main.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :mdi.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :menu.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :menuitem.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :minifram.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :msgdlg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :palette.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :pen.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :printdlg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :radiobox.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :radiobut.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :region.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :scrolbar.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :settings.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :slider.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :spinbutt.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :statbmp.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :statbox.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :stattext.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :tabctrl.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :textctrl.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :thread.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :timer.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :toolbar.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :utils.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :sound.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :window.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :printmac.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :dcprint.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :uma.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :sckipc.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :matrix.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :tbarbase.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :imagjpeg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :longlong.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :docmdi.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :appcmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :utilscmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :dynlib.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :extended.c - MacOS - Text - Debug - - - PathRelative - Project - :common: - :sckstrm.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :zstream.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :process.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :docview.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :sizer.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :imagall.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :imaggif.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :imagpcx.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :cmndata.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :ftp.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :menucmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :string.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :wfstream.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :stream.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :gdicmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :protocol.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :layout.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :valgen.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :intl.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :list.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :socket.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :hash.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :dlgcmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :gifdecod.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :filefn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :wincmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :wxchar.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :memory.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :mstream.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :lboxcmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :fs_inet.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :event.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :image.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :ipcbase.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :tokenzr.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :txtstrm.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :filesys.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :url.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :fs_zip.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :prntbase.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :dcbase.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :object.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :http.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :module.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :validate.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :file.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :config.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :fileconf.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :timercmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :framecmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :textfile.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :dynarray.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :choiccmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :helpbase.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :ctrlsub.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :ctrlcmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :strconv.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :sckfile.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :valtext.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :datstrm.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :sckaddr.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :variant.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :dbtable.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :fontcmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :ffile.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :paper.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :clipcmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :imagpnm.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :imagpng.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :imagbmp.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :zipstrm.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :log.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :textcmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :laywin.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :busyinfo.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :listctrl.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :textdlgg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :tipdlg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :numdlgg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :sashwin.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :dcpsg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :panelg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :tabg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :choicdgg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :wizard.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :progdlgg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :caret.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :statusbr.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :logg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :fontdlgg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :splitter.cpp - MacOS - Text - Debug - - - Name - db.cpp - MacOS - Text - Debug - - - Name - dobjcmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :fontmap.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :geometry.cpp - MacOS - Text - Debug - - - Name - colrdlgg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :fontutil.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :dataobj.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :m_list.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :m_tables.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :htmlwin.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :m_pre.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :m_image.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :htmprint.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :htmlfilt.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :htmlpars.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :htmltag.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :m_hline.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :winpars.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :htmlcell.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :m_layout.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :m_fonts.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :m_links.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :fontenum.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :datetime.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :encconv.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :mimecmn.cpp - MacOS - Text - Debug - - - Name - metafile.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :macnotfy.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :statbrma.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :tooltip.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :statlmac.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :imagtiff.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :treectlg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :notebmac.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :m_dflist.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :treebase.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :cshelp.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :dirmac.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :mimetmac.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :filename.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :spinctrl.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :glcanvas.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :xpmdecod.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :imagxpm.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :dirctrlg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :helpctrl.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :helpfrm.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :helpdata.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :tipwin.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :radiocmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :nbkbase.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :scrlwing.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :gaugecmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :containr.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :quantize.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :toplvcmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :toplevel.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :gridsel.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :grid.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :statbar.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :clntdata.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :textbuf.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :dragimgg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :calctrl.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :bmpbase.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :cmdline.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :cmdproc.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :dndcmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :dnd.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :dbgrid.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :dircmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :dseldlg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :dynload.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :effects.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :fddlgcmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :fs_mem.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :regex.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :sysopt.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :imagiff.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :splash.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :fdrepdlg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :gridctrl.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :m_style.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :hashmap.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :dirdlgg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :iconbndl.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :artprov.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :artstd.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :imagfill.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :msgout.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :settcmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :popupcmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :printps.cpp - MacOS - Text - Debug - - - PathRelative - Project - :jpeg: - jpegM8.mcp - Unix - Project - - - - PathRelative - Project - :png: - pngM8.mcp - Unix - Project - - - - PathRelative - Project - :zlib: - zlibM8.mcp - Unix - Project - - - - PathRelative - Project - :tiff: - tiffM8.mcp - Unix - Project - - - - PathRelative - Project - :regex: - regexM8.mcp - Unix - Project - - - - PathRelative - Project - unix - utilsunx.cpp - Unix - Text - Debug - - - PathRelative - CodeWarrior - MSL/MSL_C - MSL_MacOS/Src/console_OS_X.c - Unix - Text - Debug - - - FileRelative - ../../lib/jpeg_MACH.lib - Unix - - PathRelative - Project - :jpeg: - jpegM8.mcp - Unix - - Library - Debug, TargetOutputFile - - - FileRelative - ../../lib/png_MACH.lib - Unix - - PathRelative - Project - :png: - pngM8.mcp - Unix - - Library - Debug, TargetOutputFile - - - FileRelative - ../../lib/zlib_MACH.lib - Unix - - PathRelative - Project - :zlib: - zlibM8.mcp - Unix - - Library - Debug, TargetOutputFile - - - PathRelative - Project - :mac:carbon: - morefilex/MoreFilesX.cpp - Unix - Text - Debug - - - FileRelative - ../../lib/tif_MACH.lib - Unix - - PathRelative - Project - :tiff: - tiffM8.mcp - Unix - - Library - Debug, TargetOutputFile - - - FileRelative - ../../lib/regex_MACH.lib - Unix - - PathRelative - Project - :regex: - regexM8.mcp - Unix - - Library - Debug, TargetOutputFile - - - PathRelative - Project - :common: - datacmn.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - rgncmn.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - accesscmn.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - dpycmn.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - taskbarcmn.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - fldlgcmn.cpp - Unix - Text - Debug - - - PathRelative - Project - :generic: - :selstore.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - appbase.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - fmapbase.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - stopwatch.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - init.cpp - Unix - Text - Debug - - - PathRelative - Project - unix - baseunix.cpp - Unix - Text - Debug - - - PathRelative - Project - :generic: - renderg.cpp - Unix - Text - Debug - - - PathRelative - Project - :mac:carbon: - renderer.cpp - Unix - Text - Debug - - - PathRelative - Project - xml - xml.cpp - Unix - Text - Debug - - - PathRelative - Project - expat/lib - xmlparse.c - Unix - Text - Debug - - - PathRelative - Project - expat/lib - xmlrole.c - Unix - Text - Debug - - - PathRelative - Project - expat/lib - xmltok.c - Unix - Text - Debug - - - PathRelative - Project - :common: - rendcmn.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - bookctrl.cpp - Unix - Text - Debug - - - PathRelative - Project - ::include: - wxshlb_cwc.pch - Unix - Text - Debug - - - PathRelative - Project - ::include: - wxshlb_cwc.pch++ - Unix - Text - Debug - - - PathRelative - CodeWarrior - MacOS X Support - Libraries/Runtime/Libs/MSL_Runtime_Mach-O.a - Unix - Library - Debug - - - PathRelative - Project - :mac:carbon: - drawer.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - stockitem.cpp - Unix - Text - Debug - - - PathRelative - Project - :mac:carbon: - taskbar.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_bmp.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_bmpbt.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_bttn.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_cald.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_chckb.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_chckl.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_choic.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_combo.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_dlg.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_frame.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_gauge.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_gdctl.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_html.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_listb.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_listc.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_menu.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_notbk.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_panel.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_radbt.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_radbx.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_scrol.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_scwin.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_sizer.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_slidr.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_spin.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_split.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_statbar.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_stbmp.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_stbox.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_stlin.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_sttxt.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_text.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_tglbtn.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_toolb.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_tree.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_unkwn.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_wizrd.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xmlres.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xmlrsall.cpp - Unix - Text - Debug - - - PathRelative - Project - unix - gsocket.cpp - Unix - Text - Debug - - - PathRelative - Project - mac/corefoundation - cfstring.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - uri.cpp - Unix - Text - Debug - - - PathRelative - Project - mac/corefoundation - utilsexc_cf.cpp - Unix - Text - Debug - - - PathRelative - Project - mac/corefoundation - stdpaths_cf.cpp - Unix - Text - Debug - - - PathRelative - Project - mac/corefoundation - gsockosx.cpp - Unix - Text - Debug - - - PathRelative - Project - :mac:carbon: - display.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - archive.cpp - Unix - Text - Debug - - - PathRelative - Project - :generic: - datectlg.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - stdpbase.cpp - Unix - Text - Debug - - - PathRelative - Project - unix - stdpaths.cpp - Unix - Text - Debug - - - PathRelative - Project - :mac:carbon: - imaglist.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_choicbk.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_datectrl.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_listbk.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - gbsizer.cpp - Unix - Text - Debug - - - PathRelative - Project - :generic: - choicbkg.cpp - Unix - Text - Debug - - - PathRelative - Project - :generic: - listbkg.cpp - Unix - Text - Debug - - - PathRelative - Project - unix - dlunix.cpp - Unix - Text - Debug - - - PathRelative - CodeWarrior - MacOS X Support - Libraries/Startup/dylib1.o - Unix - Library - Debug - - - PathRelative - Project - :common: - debugrpt.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_mdi.cpp - Unix - Text - Debug - - - - - FileRelative - ../../lib/regex_MACH.lib - Unix - - PathRelative - Project - :regex: - regexM8.mcp - Unix - - - - FileRelative - ../../lib/tif_MACH.lib - Unix - - PathRelative - Project - :tiff: - tiffM8.mcp - Unix - - - - FileRelative - ../../lib/zlib_MACH.lib - Unix - - PathRelative - Project - :zlib: - zlibM8.mcp - Unix - - - - FileRelative - ../../lib/png_MACH.lib - Unix - - PathRelative - Project - :png: - pngM8.mcp - Unix - - - - PathRelative - Project - :mac:carbon: - :accel.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :app.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :bitmap.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :bmpbuttn.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :brush.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :button.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :checkbox.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :checklst.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :choice.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :clipbrd.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :colordlg.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :colour.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :combobox.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :control.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :cursor.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :data.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :dc.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :dcclient.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :dcmemory.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :dcscreen.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :dialog.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :dirdlg.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :filedlg.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :font.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :fontdlg.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :frame.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :gauge.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :gdiobj.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :icon.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :joystick.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :listbox.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :main.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :mdi.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :menu.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :menuitem.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :minifram.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :msgdlg.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :palette.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :pen.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :printdlg.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :radiobox.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :radiobut.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :region.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :scrolbar.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :settings.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :slider.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :spinbutt.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :statbmp.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :statbox.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :stattext.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :tabctrl.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :textctrl.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :thread.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :timer.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :toolbar.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :utils.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :sound.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :window.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :printmac.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :dcprint.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :uma.cpp - MacOS - - - PathRelative - Project - :common: - :sckipc.cpp - MacOS - - - PathRelative - Project - :common: - :matrix.cpp - MacOS - - - PathRelative - Project - :common: - :tbarbase.cpp - MacOS - - - PathRelative - Project - :common: - :imagjpeg.cpp - MacOS - - - PathRelative - Project - :common: - :longlong.cpp - MacOS - - - PathRelative - Project - :common: - :docmdi.cpp - MacOS - - - PathRelative - Project - :common: - :appcmn.cpp - MacOS - - - PathRelative - Project - :common: - :utilscmn.cpp - MacOS - - - PathRelative - Project - :common: - :dynlib.cpp - MacOS - - - PathRelative - Project - :common: - :extended.c - MacOS - - - PathRelative - Project - :common: - :sckstrm.cpp - MacOS - - - PathRelative - Project - :common: - :zstream.cpp - MacOS - - - PathRelative - Project - :common: - :process.cpp - MacOS - - - PathRelative - Project - :common: - :docview.cpp - MacOS - - - PathRelative - Project - :common: - :sizer.cpp - MacOS - - - PathRelative - Project - :common: - :imagall.cpp - MacOS - - - PathRelative - Project - :common: - :imaggif.cpp - MacOS - - - PathRelative - Project - :common: - :imagpcx.cpp - MacOS - - - PathRelative - Project - :common: - :cmndata.cpp - MacOS - - - PathRelative - Project - :common: - :ftp.cpp - MacOS - - - PathRelative - Project - :common: - :menucmn.cpp - MacOS - - - PathRelative - Project - :common: - :string.cpp - MacOS - - - PathRelative - Project - :common: - :wfstream.cpp - MacOS - - - PathRelative - Project - :common: - :stream.cpp - MacOS - - - PathRelative - Project - :common: - :gdicmn.cpp - MacOS - - - PathRelative - Project - :common: - :protocol.cpp - MacOS - - - PathRelative - Project - :common: - :layout.cpp - MacOS - - - PathRelative - Project - :common: - :valgen.cpp - MacOS - - - PathRelative - Project - :common: - :intl.cpp - MacOS - - - PathRelative - Project - :common: - :list.cpp - MacOS - - - PathRelative - Project - :common: - :socket.cpp - MacOS - - - PathRelative - Project - :common: - :hash.cpp - MacOS - - - PathRelative - Project - :common: - :dlgcmn.cpp - MacOS - - - PathRelative - Project - :common: - :gifdecod.cpp - MacOS - - - PathRelative - Project - :common: - :filefn.cpp - MacOS - - - PathRelative - Project - :common: - :wincmn.cpp - MacOS - - - PathRelative - Project - :common: - :wxchar.cpp - MacOS - - - PathRelative - Project - :common: - :memory.cpp - MacOS - - - PathRelative - Project - :common: - :mstream.cpp - MacOS - - - PathRelative - Project - :common: - :lboxcmn.cpp - MacOS - - - PathRelative - Project - :common: - :fs_inet.cpp - MacOS - - - PathRelative - Project - :common: - :event.cpp - MacOS - - - PathRelative - Project - :common: - :image.cpp - MacOS - - - PathRelative - Project - :common: - :ipcbase.cpp - MacOS - - - PathRelative - Project - :common: - :tokenzr.cpp - MacOS - - - PathRelative - Project - :common: - :txtstrm.cpp - MacOS - - - PathRelative - Project - :common: - :filesys.cpp - MacOS - - - PathRelative - Project - :common: - :url.cpp - MacOS - - - PathRelative - Project - :common: - :fs_zip.cpp - MacOS - - - PathRelative - Project - :common: - :prntbase.cpp - MacOS - - - PathRelative - Project - :common: - :dcbase.cpp - MacOS - - - PathRelative - Project - :common: - :object.cpp - MacOS - - - PathRelative - Project - :common: - :http.cpp - MacOS - - - PathRelative - Project - :common: - :module.cpp - MacOS - - - PathRelative - Project - :common: - :validate.cpp - MacOS - - - PathRelative - Project - :common: - :file.cpp - MacOS - - - PathRelative - Project - :common: - :config.cpp - MacOS - - - PathRelative - Project - :common: - :fileconf.cpp - MacOS - - - PathRelative - Project - :common: - :timercmn.cpp - MacOS - - - PathRelative - Project - :common: - :framecmn.cpp - MacOS - - - PathRelative - Project - :common: - :textfile.cpp - MacOS - - - PathRelative - Project - :common: - :dynarray.cpp - MacOS - - - PathRelative - Project - :common: - :choiccmn.cpp - MacOS - - - PathRelative - Project - :common: - :helpbase.cpp - MacOS - - - PathRelative - Project - :common: - :ctrlsub.cpp - MacOS - - - PathRelative - Project - :common: - :ctrlcmn.cpp - MacOS - - - PathRelative - Project - :common: - :strconv.cpp - MacOS - - - PathRelative - Project - :common: - :sckfile.cpp - MacOS - - - PathRelative - Project - :common: - :valtext.cpp - MacOS - - - PathRelative - Project - :common: - :datstrm.cpp - MacOS - - - PathRelative - Project - :common: - :sckaddr.cpp - MacOS - - - PathRelative - Project - :common: - :variant.cpp - MacOS - - - PathRelative - Project - :common: - :dbtable.cpp - MacOS - - - PathRelative - Project - :common: - :fontcmn.cpp - MacOS - - - PathRelative - Project - :common: - :ffile.cpp - MacOS - - - PathRelative - Project - :common: - :paper.cpp - MacOS - - - PathRelative - Project - :common: - :clipcmn.cpp - MacOS - - - PathRelative - Project - :common: - :imagpnm.cpp - MacOS - - - PathRelative - Project - :common: - :imagpng.cpp - MacOS - - - PathRelative - Project - :common: - :imagbmp.cpp - MacOS - - - PathRelative - Project - :common: - :zipstrm.cpp - MacOS - - - PathRelative - Project - :common: - :log.cpp - MacOS - - - PathRelative - Project - :common: - :textcmn.cpp - MacOS - - - PathRelative - Project - :generic: - :laywin.cpp - MacOS - - - PathRelative - Project - :generic: - :busyinfo.cpp - MacOS - - - PathRelative - Project - :generic: - :listctrl.cpp - MacOS - - - PathRelative - Project - :generic: - :textdlgg.cpp - MacOS - - - PathRelative - Project - :generic: - :tipdlg.cpp - MacOS - - - PathRelative - Project - :generic: - :numdlgg.cpp - MacOS - - - PathRelative - Project - :generic: - :sashwin.cpp - MacOS - - - PathRelative - Project - :generic: - :dcpsg.cpp - MacOS - - - PathRelative - Project - :generic: - :panelg.cpp - MacOS - - - PathRelative - Project - :generic: - :tabg.cpp - MacOS - - - PathRelative - Project - :generic: - :choicdgg.cpp - MacOS - - - PathRelative - Project - :generic: - :wizard.cpp - MacOS - - - PathRelative - Project - :generic: - :progdlgg.cpp - MacOS - - - PathRelative - Project - :generic: - :caret.cpp - MacOS - - - PathRelative - Project - :generic: - :statusbr.cpp - MacOS - - - PathRelative - Project - :generic: - :logg.cpp - MacOS - - - PathRelative - Project - :generic: - :fontdlgg.cpp - MacOS - - - PathRelative - Project - :generic: - :splitter.cpp - MacOS - - - Name - db.cpp - MacOS - - - Name - dobjcmn.cpp - MacOS - - - PathRelative - Project - :common: - :fontmap.cpp - MacOS - - - PathRelative - Project - :common: - :geometry.cpp - MacOS - - - Name - colrdlgg.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :fontutil.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :dataobj.cpp - MacOS - - - PathRelative - Project - :html: - :m_list.cpp - MacOS - - - PathRelative - Project - :html: - :m_tables.cpp - MacOS - - - PathRelative - Project - :html: - :htmlwin.cpp - MacOS - - - PathRelative - Project - :html: - :m_pre.cpp - MacOS - - - PathRelative - Project - :html: - :m_image.cpp - MacOS - - - PathRelative - Project - :html: - :htmprint.cpp - MacOS - - - PathRelative - Project - :html: - :htmlfilt.cpp - MacOS - - - PathRelative - Project - :html: - :htmlpars.cpp - MacOS - - - PathRelative - Project - :html: - :htmltag.cpp - MacOS - - - PathRelative - Project - :html: - :m_hline.cpp - MacOS - - - PathRelative - Project - :html: - :winpars.cpp - MacOS - - - PathRelative - Project - :html: - :htmlcell.cpp - MacOS - - - PathRelative - Project - :html: - :m_layout.cpp - MacOS - - - PathRelative - Project - :html: - :m_fonts.cpp - MacOS - - - PathRelative - Project - :html: - :m_links.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :fontenum.cpp - MacOS - - - PathRelative - Project - :common: - :datetime.cpp - MacOS - - - PathRelative - Project - :common: - :encconv.cpp - MacOS - - - PathRelative - Project - :common: - :mimecmn.cpp - MacOS - - - Name - metafile.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :macnotfy.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :statbrma.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :tooltip.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :statlmac.cpp - MacOS - - - PathRelative - Project - :common: - :imagtiff.cpp - MacOS - - - PathRelative - Project - :generic: - :treectlg.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :notebmac.cpp - MacOS - - - PathRelative - Project - :html: - :m_dflist.cpp - MacOS - - - PathRelative - Project - :common: - :treebase.cpp - MacOS - - - PathRelative - Project - :common: - :cshelp.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :dirmac.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :mimetmac.cpp - MacOS - - - PathRelative - Project - :common: - :filename.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :spinctrl.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :glcanvas.cpp - MacOS - - - PathRelative - Project - :common: - :xpmdecod.cpp - MacOS - - - PathRelative - Project - :common: - :imagxpm.cpp - MacOS - - - PathRelative - Project - :generic: - :dirctrlg.cpp - MacOS - - - PathRelative - Project - :html: - :helpctrl.cpp - MacOS - - - PathRelative - Project - :html: - :helpfrm.cpp - MacOS - - - PathRelative - Project - :html: - :helpdata.cpp - MacOS - - - PathRelative - Project - :generic: - :tipwin.cpp - MacOS - - - PathRelative - Project - :common: - :radiocmn.cpp - MacOS - - - PathRelative - Project - :common: - :nbkbase.cpp - MacOS - - - PathRelative - Project - :generic: - :scrlwing.cpp - MacOS - - - PathRelative - Project - :common: - :gaugecmn.cpp - MacOS - - - PathRelative - Project - :common: - :containr.cpp - MacOS - - - PathRelative - Project - :common: - :quantize.cpp - MacOS - - - PathRelative - Project - :common: - :toplvcmn.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :toplevel.cpp - MacOS - - - PathRelative - Project - :generic: - :gridsel.cpp - MacOS - - - PathRelative - Project - :generic: - :grid.cpp - MacOS - - - PathRelative - Project - :common: - :statbar.cpp - MacOS - - - PathRelative - Project - :common: - :clntdata.cpp - MacOS - - - PathRelative - Project - :common: - :textbuf.cpp - MacOS - - - PathRelative - Project - :generic: - :dragimgg.cpp - MacOS - - - PathRelative - Project - :generic: - :calctrl.cpp - MacOS - - - PathRelative - Project - :common: - :bmpbase.cpp - MacOS - - - PathRelative - Project - :common: - :cmdline.cpp - MacOS - - - PathRelative - Project - :common: - :cmdproc.cpp - MacOS - - - PathRelative - Project - :common: - :dndcmn.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :dnd.cpp - MacOS - - - PathRelative - Project - :common: - :dbgrid.cpp - MacOS - - - PathRelative - Project - :common: - :dircmn.cpp - MacOS - - - PathRelative - Project - :common: - :dseldlg.cpp - MacOS - - - PathRelative - Project - :common: - :dynload.cpp - MacOS - - - PathRelative - Project - :common: - :effects.cpp - MacOS - - - PathRelative - Project - :common: - :fddlgcmn.cpp - MacOS - - - PathRelative - Project - :common: - :fs_mem.cpp - MacOS - - - PathRelative - Project - :common: - :regex.cpp - MacOS - - - PathRelative - Project - :common: - :sysopt.cpp - MacOS - - - PathRelative - Project - :common: - :imagiff.cpp - MacOS - - - PathRelative - Project - :generic: - :splash.cpp - MacOS - - - PathRelative - Project - :generic: - :fdrepdlg.cpp - MacOS - - - PathRelative - Project - :generic: - :gridctrl.cpp - MacOS - - - PathRelative - Project - :html: - :m_style.cpp - MacOS - - - PathRelative - Project - :common: - :hashmap.cpp - MacOS - - - PathRelative - Project - :generic: - :dirdlgg.cpp - MacOS - - - PathRelative - Project - :common: - :iconbndl.cpp - MacOS - - - PathRelative - Project - :common: - :artprov.cpp - MacOS - - - PathRelative - Project - :common: - :artstd.cpp - MacOS - - - PathRelative - Project - :common: - :imagfill.cpp - MacOS - - - PathRelative - Project - :common: - :msgout.cpp - MacOS - - - PathRelative - Project - :common: - :settcmn.cpp - MacOS - - - PathRelative - Project - :common: - :popupcmn.cpp - MacOS - - - PathRelative - Project - :generic: - :printps.cpp - MacOS - - - PathRelative - Project - unix - utilsunx.cpp - Unix - - - PathRelative - CodeWarrior - MSL/MSL_C - MSL_MacOS/Src/console_OS_X.c - Unix - - - FileRelative - ../../lib/jpeg_MACH.lib - Unix - - PathRelative - Project - :jpeg: - jpegM8.mcp - Unix - - - - PathRelative - Project - :mac:carbon: - morefilex/MoreFilesX.cpp - Unix - - - PathRelative - Project - :common: - datacmn.cpp - Unix - - - PathRelative - Project - :common: - rgncmn.cpp - Unix - - - PathRelative - Project - :common: - accesscmn.cpp - Unix - - - PathRelative - Project - :common: - dpycmn.cpp - Unix - - - PathRelative - Project - :common: - taskbarcmn.cpp - Unix - - - PathRelative - Project - :common: - fldlgcmn.cpp - Unix - - - PathRelative - Project - :generic: - :selstore.cpp - MacOS - - - PathRelative - Project - :common: - appbase.cpp - Unix - - - PathRelative - Project - :common: - fmapbase.cpp - Unix - - - PathRelative - Project - :common: - stopwatch.cpp - Unix - - - PathRelative - Project - :common: - init.cpp - Unix - - - PathRelative - Project - unix - baseunix.cpp - Unix - - - PathRelative - Project - :generic: - renderg.cpp - Unix - - - PathRelative - Project - :mac:carbon: - renderer.cpp - Unix - - - PathRelative - Project - xml - xml.cpp - Unix - - - PathRelative - Project - expat/lib - xmlparse.c - Unix - - - PathRelative - Project - expat/lib - xmlrole.c - Unix - - - PathRelative - Project - expat/lib - xmltok.c - Unix - - - PathRelative - Project - :common: - rendcmn.cpp - Unix - - - PathRelative - Project - :common: - bookctrl.cpp - Unix - - - PathRelative - Project - ::include: - wxshlb_cwc.pch - Unix - - - PathRelative - Project - ::include: - wxshlb_cwc.pch++ - Unix - - - PathRelative - CodeWarrior - MacOS X Support - Libraries/Runtime/Libs/MSL_Runtime_Mach-O.a - Unix - - - PathRelative - Project - :mac:carbon: - drawer.cpp - Unix - - - PathRelative - Project - :common: - stockitem.cpp - Unix - - - PathRelative - Project - :mac:carbon: - taskbar.cpp - Unix - - - PathRelative - Project - xrc - xh_bmp.cpp - Unix - - - PathRelative - Project - xrc - xh_bmpbt.cpp - Unix - - - PathRelative - Project - xrc - xh_bttn.cpp - Unix - - - PathRelative - Project - xrc - xh_cald.cpp - Unix - - - PathRelative - Project - xrc - xh_chckb.cpp - Unix - - - PathRelative - Project - xrc - xh_chckl.cpp - Unix - - - PathRelative - Project - xrc - xh_choic.cpp - Unix - - - PathRelative - Project - xrc - xh_combo.cpp - Unix - - - PathRelative - Project - xrc - xh_dlg.cpp - Unix - - - PathRelative - Project - xrc - xh_frame.cpp - Unix - - - PathRelative - Project - xrc - xh_gauge.cpp - Unix - - - PathRelative - Project - xrc - xh_gdctl.cpp - Unix - - - PathRelative - Project - xrc - xh_html.cpp - Unix - - - PathRelative - Project - xrc - xh_listb.cpp - Unix - - - PathRelative - Project - xrc - xh_listc.cpp - Unix - - - PathRelative - Project - xrc - xh_menu.cpp - Unix - - - PathRelative - Project - xrc - xh_notbk.cpp - Unix - - - PathRelative - Project - xrc - xh_panel.cpp - Unix - - - PathRelative - Project - xrc - xh_radbt.cpp - Unix - - - PathRelative - Project - xrc - xh_radbx.cpp - Unix - - - PathRelative - Project - xrc - xh_scrol.cpp - Unix - - - PathRelative - Project - xrc - xh_scwin.cpp - Unix - - - PathRelative - Project - xrc - xh_sizer.cpp - Unix - - - PathRelative - Project - xrc - xh_slidr.cpp - Unix - - - PathRelative - Project - xrc - xh_spin.cpp - Unix - - - PathRelative - Project - xrc - xh_split.cpp - Unix - - - PathRelative - Project - xrc - xh_statbar.cpp - Unix - - - PathRelative - Project - xrc - xh_stbmp.cpp - Unix - - - PathRelative - Project - xrc - xh_stbox.cpp - Unix - - - PathRelative - Project - xrc - xh_stlin.cpp - Unix - - - PathRelative - Project - xrc - xh_sttxt.cpp - Unix - - - PathRelative - Project - xrc - xh_text.cpp - Unix - - - PathRelative - Project - xrc - xh_tglbtn.cpp - Unix - - - PathRelative - Project - xrc - xh_toolb.cpp - Unix - - - PathRelative - Project - xrc - xh_tree.cpp - Unix - - - PathRelative - Project - xrc - xh_unkwn.cpp - Unix - - - PathRelative - Project - xrc - xh_wizrd.cpp - Unix - - - PathRelative - Project - xrc - xmlres.cpp - Unix - - - PathRelative - Project - xrc - xmlrsall.cpp - Unix - - - PathRelative - Project - unix - gsocket.cpp - Unix - - - PathRelative - Project - mac/corefoundation - cfstring.cpp - Unix - - - PathRelative - Project - :common: - uri.cpp - Unix - - - PathRelative - Project - mac/corefoundation - utilsexc_cf.cpp - Unix - - - PathRelative - Project - mac/corefoundation - stdpaths_cf.cpp - Unix - - - PathRelative - Project - mac/corefoundation - gsockosx.cpp - Unix - - - PathRelative - Project - :mac:carbon: - display.cpp - Unix - - - PathRelative - Project - :common: - archive.cpp - Unix - - - PathRelative - Project - :generic: - datectlg.cpp - Unix - - - PathRelative - Project - :common: - stdpbase.cpp - Unix - - - PathRelative - Project - unix - stdpaths.cpp - Unix - - - PathRelative - Project - :mac:carbon: - imaglist.cpp - Unix - - - PathRelative - Project - xrc - xh_choicbk.cpp - Unix - - - PathRelative - Project - xrc - xh_datectrl.cpp - Unix - - - PathRelative - Project - xrc - xh_listbk.cpp - Unix - - - PathRelative - Project - :common: - gbsizer.cpp - Unix - - - PathRelative - Project - :generic: - choicbkg.cpp - Unix - - - PathRelative - Project - :generic: - listbkg.cpp - Unix - - - PathRelative - Project - unix - dlunix.cpp - Unix - - - PathRelative - CodeWarrior - MacOS X Support - Libraries/Startup/dylib1.o - Unix - - - PathRelative - Project - :common: - debugrpt.cpp - Unix - - - PathRelative - Project - xrc - xh_mdi.cpp - Unix - - - - - - PathRelative - Project - :jpeg: - jpegM8.mcp - Unix - - - - Mach-O - Build, LinkAgainst - - FileRelative - ../../lib/jpeg_MACH.lib - Unix - - PathRelative - Project - :jpeg: - jpegM8.mcp - Unix - - - - - - - - PathRelative - Project - :png: - pngM8.mcp - Unix - - - - Mach-O - Build, LinkAgainst - - FileRelative - ../../lib/png_MACH.lib - Unix - - PathRelative - Project - :png: - pngM8.mcp - Unix - - - - - - - - PathRelative - Project - :zlib: - zlibM8.mcp - Unix - - - - Mach-O - Build, LinkAgainst - - FileRelative - ../../lib/zlib_MACH.lib - Unix - - PathRelative - Project - :zlib: - zlibM8.mcp - Unix - - - - - - - - PathRelative - Project - :tiff: - tiffM8.mcp - Unix - - - - Mach-O - Build, LinkAgainst - - FileRelative - ../../lib/tif_MACH.lib - Unix - - PathRelative - Project - :tiff: - tiffM8.mcp - Unix - - - - - - - - PathRelative - Project - :regex: - regexM8.mcp - Unix - - - - Mach-O - Build, LinkAgainst - - FileRelative - ../../lib/regex_MACH.lib - Unix - - PathRelative - Project - :regex: - regexM8.mcp - Unix - - - - - - - - - - PathRelative - OS X Volume - System/Library/Frameworks - Carbon.framework - Unix - - Carbon - - - - PathRelative - OS X Volume - System/Library/Frameworks - System.framework - Unix - - System - - - - PathRelative - OS X Volume - System/Library/Frameworks - QuickTime.framework - Unix - - QuickTime - - - - PathRelative - OS X Volume - System/Library/Frameworks - IOKit.framework - Unix - - IOKit - - - - - all targets - - - - UserSourceTrees - - - AlwaysSearchUserPathsfalse - InterpretDOSAndUnixPathsfalse - RequireFrameworkStyleIncludesfalse - UserSearchPaths - - SearchPath - Path: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SystemSearchPaths - - SearchPath - Path: - PathFormatMacOS - PathRootCodeWarrior - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - - - MWRuntimeSettings_WorkingDirectory - MWRuntimeSettings_CommandLine - MWRuntimeSettings_HostApplication - Path - PathFormatGeneric - PathRootAbsolute - - MWRuntimeSettings_EnvVars - - - LinkerNone - PreLinker - PostLinker - Targetnameall targets - OutputDirectory - Path: - PathFormatMacOS - PathRootProject - - SaveEntriesUsingRelativePathsfalse - - - FileMappings - - FileTypeMMPr - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFilefalse - IgnoredByMakefalse - - - - - CacheModDatestrue - DumpBrowserInfofalse - CacheSubprojectstrue - UseThirdPartyDebuggerfalse - BrowserGenerator1 - DebuggerAppPath - Path - PathFormatGeneric - PathRootAbsolute - - DebuggerCmdLineArgs - DebuggerWorkingDir - Path - PathFormatGeneric - PathRootAbsolute - - CodeCompletionPrefixFileName - CodeCompletionMacroFileName - - - ConsoleEncoding0 - LogSystemMessagestrue - AutoTargetDLLsfalse - StopAtWatchpointstrue - PauseWhileRunningfalse - PauseInterval5 - PauseUIFlags0 - AltExePath - Path - PathFormatGeneric - PathRootAbsolute - - StopAtTempBPOnLaunchtrue - CacheSymbolicstrue - TempBPFunctionNamemain - TempBPType0 - - - Enabledfalse - ConnectionName - DownloadPath - LaunchRemoteAppfalse - RemoteAppPath - CoreID0 - JTAGClockSpeed8000 - IsMultiCorefalse - OSDownloadfalse - UseGlobalOSDownloadfalse - OSDownloadConnectionName - OSDownloadPath - AltDownloadfalse - AltDownloadConnectionName - - - OtherExecutables - - - CustomColor1 - Red0 - Green32767 - Blue0 - - CustomColor2 - Red0 - Green32767 - Blue0 - - CustomColor3 - Red0 - Green32767 - Blue0 - - CustomColor4 - Red0 - Green32767 - Blue0 - - - - MWFrontEnd_C_cplusplus0 - MWFrontEnd_C_checkprotos0 - MWFrontEnd_C_arm0 - MWFrontEnd_C_trigraphs0 - MWFrontEnd_C_onlystdkeywords0 - MWFrontEnd_C_enumsalwaysint0 - MWFrontEnd_C_mpwpointerstyle0 - MWFrontEnd_C_prefixname - MWFrontEnd_C_ansistrict0 - MWFrontEnd_C_mpwcnewline0 - MWFrontEnd_C_wchar_type1 - MWFrontEnd_C_enableexceptions1 - MWFrontEnd_C_dontreusestrings0 - MWFrontEnd_C_poolstrings0 - MWFrontEnd_C_dontinline0 - MWFrontEnd_C_useRTTI1 - MWFrontEnd_C_multibyteaware0 - MWFrontEnd_C_unsignedchars0 - MWFrontEnd_C_autoinline0 - MWFrontEnd_C_booltruefalse1 - MWFrontEnd_C_inlinelevel0 - MWFrontEnd_C_ecplusplus0 - MWFrontEnd_C_objective_c0 - MWFrontEnd_C_defer_codegen0 - MWFrontEnd_C_templateparser0 - MWFrontEnd_C_c990 - MWFrontEnd_C_bottomupinline1 - - - MWWarning_C_warn_illpragma0 - MWWarning_C_warn_emptydecl0 - MWWarning_C_warn_possunwant0 - MWWarning_C_warn_unusedvar0 - MWWarning_C_warn_unusedarg0 - MWWarning_C_warn_extracomma0 - MWWarning_C_pedantic0 - MWWarning_C_warningerrors0 - MWWarning_C_warn_hidevirtual0 - MWWarning_C_warn_implicitconv0 - MWWarning_C_warn_notinlined0 - MWWarning_C_warn_structclass0 - - - MWFTP_Post_hostName - MWFTP_Post_username - MWFTP_Post_password0ÿÂà -ž0¼,šì - MWFTP_Post_remoteDir - MWFTP_Post_ftp_PathVersion1 - MWFTP_Post_ftp_PathType0 - MWFTP_Post_ftp_PathFormat0 - MWFTP_Post_ftp_tree - MWFTP_Post_uploadDir - MWFTP_Post_ftp_port21 - MWFTP_Post_SendBin1 - MWFTP_Post_ShouldLog1 - - - MWCommandLine_Java_clsName - MWCommandLine_Java_args - - - MWVJavaDebugging_Protocol1 - MWVJavaDebugging_JDKVersion1 - MWVJavaDebugging_TimeOut10 - MWVJavaDebugging_SupportSlowDevicesfalse - MWVJavaDebugging_UseRemoteLaunchAgentfalse - MWVJavaDebugging_LaunchVMasServerfalse - - - MWJava_Language_optimizefalse - MWJava_Language_warnDeprecatedfalse - MWJava_Language_emitMapfalse - MWJava_Language_strictFileNamesfalse - MWJava_Language_strictFileHierarchyfalse - MWJava_Language_1_1_Compatiblefalse - MWJava_Language_emitHeaders0 - MWJava_Language_headerTypeJNINativeHeaders - MWJava_Language_packageFilter - MWJava_Language_genCommentstrue - MWJava_Language_genHeadersfalse - MWJava_Language_enableAssertsfalse - MWJava_Language_targetVM1.1 - - - Manifest-JAD Attributes - - AttributeMain-Class - ValueAuto-Generated - - - - - MWJava_MRJAppBuilder_outFileMRJApplication - MWJava_MRJAppBuilder_mergefalse - MWJava_MRJAppBuilder_quitMenutrue - MWJava_MRJAppBuilder_growfalse - MWJava_MRJAppBuilder_stdoutTypeConsole - MWJava_MRJAppBuilder_stderrTypeConsole - MWJava_MRJAppBuilder_stdinTypeConsole - MWJava_MRJAppBuilder_appIconPVersion0 - MWJava_MRJAppBuilder_appIconPType0 - MWJava_MRJAppBuilder_appIconPFormat0 - MWJava_MRJAppBuilder_appIconPTree - MWJava_MRJAppBuilder_appIconFile - MWJava_MRJAppBuilder_splashScreenPVersion0 - MWJava_MRJAppBuilder_splashScreenPType0 - MWJava_MRJAppBuilder_splashScreenPFormat0 - MWJava_MRJAppBuilder_splashScreenPTree - MWJava_MRJAppBuilder_splashScreenPICTFile - MWJava_MRJAppBuilder_aboutName - MWJava_MRJAppBuilder_stdoutPVersion0 - MWJava_MRJAppBuilder_stdoutPType0 - MWJava_MRJAppBuilder_stdoutPFormat0 - MWJava_MRJAppBuilder_stdoutPTree - MWJava_MRJAppBuilder_stdoutFile - MWJava_MRJAppBuilder_stdoutAppendfalse - MWJava_MRJAppBuilder_stderrPType0 - MWJava_MRJAppBuilder_stderrPFormat0 - MWJava_MRJAppBuilder_stderrPTree - MWJava_MRJAppBuilder_stderrFile - MWJava_MRJAppBuilder_stderrAppendfalse - MWJava_MRJAppBuilder_stdinPType0 - MWJava_MRJAppBuilder_stdinPFormat0 - MWJava_MRJAppBuilder_stdinPTree - MWJava_MRJAppBuilder_stdinFile - - - MWJava_Output_outputtypeJarFile - MWJava_Output_outfileJavaClasses.jar - MWJava_Output_ftype1514754080 - MWJava_Output_fcreator1297570384 - MWJava_Output_compress0 - MWJava_Output_genManifest0 - MWJava_Output_trunctypeFront - MWJava_Output_deleteClasses0 - MWJava_Output_consoleApp1 - MWJava_Output_preverify0 - MWJava_Output_genJad0 - MWJava_Output_obfuscate0 - - - MWJava_Proj_projtypeApplet - MWJava_Proj_mainClassName - MWJava_Proj_HTMLAppCreator1145457748 - MWJava_Proj_HTMLAppNameMetrowerks Java - MWJava_Proj_PathVersion1 - MWJava_Proj_PathType0 - MWJava_Proj_PathFormat0 - MWJava_Proj_tree - MWJava_Proj_HTMLAppWin32NameInternet Explorer - MWJava_Proj_compress0 - MWJava_Proj_simulator0 - MWJava_Proj_useVM\000\000macosx - MWJava_Proj_vmarguments - MWJava_Proj_vmName - MWJava_Proj_simPropFile - - - MWJavaDoc_Proj_Version1 - MWJavaDoc_Proj_Deprecated1 - MWJavaDoc_Proj_Author1 - MWJavaDoc_Proj_Index1 - MWJavaDoc_Proj_Tree1 - MWJavaDoc_Proj_SunResolveToSame0 - MWJavaDoc_Proj_Shortnames1 - MWJavaDoc_Proj_Folder0 - MWJavaDoc_Proj_GenerateAPILinks0 - MWJavaDoc_Proj_scopePublic - MWJavaDoc_Proj_fcreator1297303877 - MWJavaDoc_Proj_encodingName - MWJavaDoc_Proj_decodingName - MWJavaDoc_Proj_javaPackagePathhttp://java.sun.com/products/jdk/1.1/docs/api/ - - - MWMerge_MacOS_projectTypeApplication - MWMerge_MacOS_outputNameMerge Out - MWMerge_MacOS_outputCreator???? - MWMerge_MacOS_outputTypeAPPL - MWMerge_MacOS_suppressWarning0 - MWMerge_MacOS_copyFragments1 - MWMerge_MacOS_copyResources1 - MWMerge_MacOS_flattenResource0 - MWMerge_MacOS_flatFileNamea.rsrc - MWMerge_MacOS_flatFileOutputPath - Path: - PathFormatMacOS - PathRootProject - - MWMerge_MacOS_skipResources - DLGX - ckid - Proj - WSPC - - - - FileLockedfalse - ResourcesMapIsReadOnlyfalse - PrinterDriverIsMultiFinderCompatiblefalse - Invisiblefalse - HasBundlefalse - NameLockedfalse - Stationeryfalse - HasCustomIconfalse - Sharedfalse - HasBeenInitedfalse - Label0 - Comments - - - MWMacOSPackager_UsePackager0 - MWMacOSPackager_FolderToPackage - Path - PathFormatMacOS - PathRootAbsolute - - MWMacOSPackager_CreateClassicAlias0 - MWMacOSPackager_ClassicAliasMethodUseTargetOutput - MWMacOSPackager_ClassicAliasPath - Path - PathFormatGeneric - PathRootAbsolute - - MWMacOSPackager_CreatePkgInfo0 - MWMacOSPackager_PkgCreatorType???? - MWMacOSPackager_PkgFileTypeAPPL - - - MWCodeGen_PPC_structalignmentMC68K - MWCodeGen_PPC_tracebacktablesNone - MWCodeGen_PPC_processorGeneric - MWCodeGen_PPC_function_align4 - MWCodeGen_PPC_tocdata1 - MWCodeGen_PPC_largetoc0 - MWCodeGen_PPC_profiler0 - MWCodeGen_PPC_vectortocdata0 - MWCodeGen_PPC_poolconst0 - MWCodeGen_PPC_peephole1 - MWCodeGen_PPC_readonlystrings0 - MWCodeGen_PPC_linkerpoolsstrings0 - MWCodeGen_PPC_volatileasm0 - MWCodeGen_PPC_schedule0 - MWCodeGen_PPC_altivec0 - MWCodeGen_PPC_altivec_move_block0 - MWCodeGen_PPC_strictIEEEfp0 - MWCodeGen_PPC_fpcontract1 - MWCodeGen_PPC_genfsel0 - MWCodeGen_PPC_orderedfpcmp0 - - - MWCodeGen_MachO_structalignmentPPC_mw - MWCodeGen_MachO_profiler_enumOff - MWCodeGen_MachO_processorGeneric - MWCodeGen_MachO_function_align4 - MWCodeGen_MachO_common0 - MWCodeGen_MachO_peephole1 - MWCodeGen_MachO_readonlystrings0 - MWCodeGen_MachO_linkerpoolsstrings1 - MWCodeGen_MachO_volatileasm0 - MWCodeGen_MachO_schedule0 - MWCodeGen_MachO_altivec0 - MWCodeGen_MachO_vecmove0 - MWCodeGen_MachO_fp_ieee_strict0 - MWCodeGen_MachO_fpcontract1 - MWCodeGen_MachO_genfsel0 - MWCodeGen_MachO_fp_cmps_ordered0 - - - MWDisassembler_PPC_showcode1 - MWDisassembler_PPC_extended1 - MWDisassembler_PPC_mix0 - MWDisassembler_PPC_nohex0 - MWDisassembler_PPC_showdata1 - MWDisassembler_PPC_showexceptions1 - MWDisassembler_PPC_showsym0 - MWDisassembler_PPC_shownames1 - - - GlobalOptimizer_PPC_optimizationlevelLevel0 - GlobalOptimizer_PPC_optforSpeed - - - MWLinker_PPC_linksym1 - MWLinker_PPC_symfullpath1 - MWLinker_PPC_linkmap0 - MWLinker_PPC_nolinkwarnings0 - MWLinker_PPC_dontdeadstripinitcode0 - MWLinker_PPC_permitmultdefs0 - MWLinker_PPC_linkmodeFast - MWLinker_PPC_initname - MWLinker_PPC_mainname__start - MWLinker_PPC_termname - - - MWLinker_MacOSX_linksym0 - MWLinker_MacOSX_symfullpath0 - MWLinker_MacOSX_nolinkwarnings0 - MWLinker_MacOSX_linkmap0 - MWLinker_MacOSX_dontdeadstripinitcode0 - MWLinker_MacOSX_permitmultdefs1 - MWLinker_MacOSX_use_objectivec_semantics0 - MWLinker_MacOSX_strip_debug_symbols0 - MWLinker_MacOSX_split_segs0 - MWLinker_MacOSX_report_msl_overloads0 - MWLinker_MacOSX_objects_follow_linkorder0 - MWLinker_MacOSX_linkmodeFast - MWLinker_MacOSX_exportsReferencedGlobals - MWLinker_MacOSX_sortcodeNone - MWLinker_MacOSX_mainnamestart - - - MWProject_MacOSX_typeExecutable - MWProject_MacOSX_outfile - MWProject_MacOSX_filecreator???? - MWProject_MacOSX_filetypeMEXE - MWProject_MacOSX_vmaddress4096 - MWProject_MacOSX_usedefaultvmaddr1 - MWProject_MacOSX_flatrsrc0 - MWProject_MacOSX_flatrsrcfilename - MWProject_MacOSX_flatrsrcoutputdir - Path: - PathFormatMacOS - PathRootProject - - MWProject_MacOSX_installpath./ - MWProject_MacOSX_dont_prebind0 - MWProject_MacOSX_flat_namespace0 - MWProject_MacOSX_frameworkversionA - MWProject_MacOSX_currentversion0 - MWProject_MacOSX_flat_oldimpversion0 - - - MWLinker_MachO_exportsNone - MWLinker_MachO_mainnamestart - MWLinker_MachO_currentversion0 - MWLinker_MachO_compatibleversion0 - MWLinker_MachO_symfullpath0 - MWLinker_MachO_supresswarnings0 - MWLinker_MachO_multisymerror0 - MWLinker_MachO_prebind1 - MWLinker_MachO_deadstrip1 - MWLinker_MachO_objectivecsemantics0 - MWLinker_MachO_whichfileloaded0 - MWLinker_MachO_whyfileloaded0 - MWLinker_MachO_readonlyrelocsErrors - MWLinker_MachO_undefinedsymbolsErrors - MWLinker_MachO_twolevelnamespace1 - MWLinker_MachO_stripdebugsymbols0 - - - MWProject_MachO_typeExecutable - MWProject_MachO_outfilea.exe - MWProject_MachO_filecreator???? - MWProject_MachO_filetypeMEXE - MWProject_MachO_vmaddress4096 - MWProject_MachO_flatrsrc1 - MWProject_MachO_flatrsrcfilenamea.rsrc - MWProject_MachO_flatrsrcoutputdir - Path: - PathFormatMacOS - PathRootProject - - MWProject_MachO_installpath./ - MWProject_MachO_frameworkversion - - - MWPEF_exportsNone - MWPEF_libfolder0 - MWPEF_sortcodeNone - MWPEF_expandbss0 - MWPEF_sharedata0 - MWPEF_olddefversion0 - MWPEF_oldimpversion0 - MWPEF_currentversion0 - MWPEF_fragmentname - MWPEF_collapsereloads0 - - - MWProject_PPC_typeApplication - MWProject_PPC_outfilea.out - MWProject_PPC_filecreator???? - MWProject_PPC_filetypeAPPL - MWProject_PPC_size384 - MWProject_PPC_minsize384 - MWProject_PPC_stacksize64 - MWProject_PPC_flags22720 - MWProject_PPC_symfilename - MWProject_PPC_rsrcname - MWProject_PPC_rsrcheaderNative - MWProject_PPC_rsrctype???? - MWProject_PPC_rsrcid0 - MWProject_PPC_rsrcflags0 - MWProject_PPC_rsrcstore0 - MWProject_PPC_rsrcmerge0 - MWProject_PPC_flatrsrc0 - MWProject_PPC_flatrsrcoutputdir - Path: - PathFormatMacOS - PathRootProject - - MWProject_PPC_flatrsrcfilename - - - MWAssembler_PPC_auxheader0 - MWAssembler_PPC_symmodeMac - MWAssembler_PPC_dialectPPC - MWAssembler_PPC_prefixfile - MWAssembler_PPC_typecheck0 - MWAssembler_PPC_warnings0 - MWAssembler_PPC_casesensitive0 - - - PList_OutputTypeFile - PList_OutputEncodingUTF-8 - PList_Prefix - PList_FileFilenameInfo.plist - PList_FileDirectory - Path: - PathFormatMacOS - PathRootProject - - PList_ResourceTypeplst - PList_ResourceID0 - PList_ResourceName - - - MWRez_Language_maxwidth80 - MWRez_Language_scriptRoman - MWRez_Language_alignmentAlign1 - MWRez_Language_filtermodeFilterSkip - MWRez_Language_suppresswarnings0 - MWRez_Language_escapecontrolchars1 - MWRez_Language_prefixname - MWRez_Language_filteredtypes'CODE' 'DATA' 'PICT' - - - MWWinRC_prefixname - - - MWCodeGen_X86_processorGeneric - MWCodeGen_X86_alignmentbytes8 - MWCodeGen_X86_exceptionsZeroOverhead - MWCodeGen_X86_name_manglingMWWin32 - MWCodeGen_X86_use_extinst0 - MWCodeGen_X86_extinst_mmx0 - MWCodeGen_X86_extinst_3dnow0 - MWCodeGen_X86_use_mmx_3dnow_convention0 - MWCodeGen_X86_extinst_cmov0 - MWCodeGen_X86_extinst_sse0 - MWCodeGen_X86_extinst_sse20 - MWCodeGen_X86_intrinsics0 - MWCodeGen_X86_optimizeasm0 - MWCodeGen_X86_disableopts0 - MWCodeGen_X86_profile0 - MWLinker_X86_runtimeCustom - MWCodeGen_X86_readonlystrings0 - - - MWLinker_X86_subsysmajorid4 - MWLinker_X86_subsysminorid0 - MWCOFF_X86_opsysmajorid4 - MWCOFF_X86_opsysminorid0 - MWLinker_X86_usrmajorid0 - MWLinker_X86_usrminorid0 - MWProject_X86_maxstacksize1024 - MWProject_X86_minstacksize4 - MWProject_X86_size1024 - MWProject_X86_minsize4 - MWCOFF_X86_coff_flags0 - MWCOFF_X86_dll_flags0 - MWProject_X86_baseaddress4194304 - MWCOFF_X86_filealign512 - MWCOFF_X86_sectionalign4096 - - - PDisasmX86_showHeaderstrue - PDisasmX86_showSectHeaderstrue - PDisasmX86_showSymTabtrue - PDisasmX86_showCodetrue - PDisasmX86_showDatatrue - PDisasmX86_showDebugfalse - PDisasmX86_showExceptionsfalse - PDisasmX86_showRawfalse - PDisasmX86_showAllRawfalse - PDisasmX86_showSourcefalse - PDisasmX86_showRelocationtrue - PDisasmX86_showHextrue - PDisasmX86_showCommentsfalse - PDisasmX86_showSymDefstrue - PDisasmX86_unmangletrue - PDisasmX86_verbosetrue - PDisasmX86_resolveRelocstrue - PDisasmX86_resolveLocalsfalse - - - MWDebugger_X86_Exceptions - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - - - - GlobalOptimizer_X86_optimizationlevelLevel0 - GlobalOptimizer_X86_optforSpeed - - - MWLinker_X86_entrypointusageDefault - MWLinker_X86_entrypoint - MWLinker_X86_subsystemWinGUI - MWLinker_X86_commandfile - MWLinker_X86_generatemap0 - MWLinker_X86_linksym0 - MWLinker_X86_linkCV1 - MWLinker_X86_symfullpathfalse - MWLinker_X86_linkdebugtrue - MWLinker_X86_checksumfalse - MWLinker_X86_zero_init_bssfalse - MWLinker_X86_mergedatafalse - MWLinker_X86_usedefaultlibsfalse - MWLinker_X86_adddefaultlibsfalse - MWLinker_X86_nowarningsfalse - MWLinker_X86_verbosefalse - - - MWProject_X86_typeApplication - MWProject_X86_outfileNONAME.EXE - MWProject_X86_importlib - MWProject_X86_setimportlibdirfalse - MWProject_X86_dontgenerateimportlibfalse - MWProject_X86_oldformatlibfalse - MWProject_X86_replaceobjextensionfalse - MWProject_X86_copyallfilesfalse - - - - - - - - wxlib Carbon debug - - - wxlib Carbon release - - - wxlib Carbon resources - - - wxshlb Carbon debug - - - wxshlb Carbon release - - - wxshlba Carbon debug - - - wxshlba Carbon release - - - wxlib Mach-O debug - - - wxlib Mach-O release - - - wxshlb Mach-O debug - - - wxshlb Mach-O release - - - wxshlba Mach-O debug - - - wxshlba Mach-O release - - - - - wxshlba Mach-O debug - - - - UserSourceTrees - - - AlwaysSearchUserPathsfalse - InterpretDOSAndUnixPathstrue - RequireFrameworkStyleIncludesfalse - UserSearchPaths - - SearchPath - Path::include: - PathFormatMacOS - PathRootProject - - Recursivefalse - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path::art: - PathFormatMacOS - PathRootProject - - Recursivefalse - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:generic: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:mac:carbon: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:common: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:zlib: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:png: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:jpeg: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:iodbc: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:tiff: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:html: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Pathunix - PathFormatUnix - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path../lib - PathFormatUnix - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Pathxml - PathFormatUnix - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Pathexpat/lib - PathFormatUnix - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Pathmac/corefoundation - PathFormatUnix - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Pathxrc - PathFormatUnix - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SystemSearchPaths - - SearchPath - PathMacOS X Support/Headers/(wchar_t Support fix) - PathFormatUnix - PathRootCodeWarrior - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:regex: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Pathusr/include - PathFormatUnix - PathRootOS X Volume - - Recursivefalse - FrameworkPathfalse - HostFlagsAll - - - SearchPath - PathMSL/MSL_C - PathFormatUnix - PathRootCodeWarrior - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - PathMSL/MSL_C++ - PathFormatUnix - PathRootCodeWarrior - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - PathMacOS X Support - PathFormatUnix - PathRootCodeWarrior - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Pathusr/lib - PathFormatUnix - PathRootOS X Volume - - Recursivefalse - FrameworkPathfalse - HostFlagsAll - - - SearchPath - PathSystem/Library/Frameworks - PathFormatUnix - PathRootOS X Volume - - Recursivefalse - FrameworkPathtrue - HostFlagsAll - - - - - MWRuntimeSettings_WorkingDirectory - MWRuntimeSettings_CommandLine - MWRuntimeSettings_HostApplication - Path - PathFormatGeneric - PathRootAbsolute - - MWRuntimeSettings_EnvVars - - - LinkerMacOS X PPC Linker - PreLinker - PostLinker - Targetnamewxshlba Mach-O debug - OutputDirectory - Path::lib: - PathFormatMacOS - PathRootProject - - SaveEntriesUsingRelativePathstrue - - - FileMappings - - FileTypeAPPL - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypeAppl - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypeMDYL - FileExtension - CompilerMachO Importer - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeMLIB - FileExtension - CompilerMachO Importer - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeMMLB - FileExtension - CompilerMachO Importer - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeMPLF - FileExtension - CompilerMachO Importer - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeMWCD - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypeRSRC - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.arr - Compiler - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.axp - Compiler - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.c - CompilerMW C/C++ PPC Mac OS X - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.c++ - CompilerMW C/C++ PPC Mac OS X - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.cc - CompilerMW C/C++ PPC Mac OS X - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.cp - CompilerMW C/C++ PPC Mac OS X - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.cpp - CompilerMW C/C++ PPC Mac OS X - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.exp - Compiler - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.h - CompilerMW C/C++ PPC Mac OS X - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMaketrue - - - FileTypeTEXT - FileExtension.h++ - CompilerMW C/C++ PPC Mac OS X - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMaketrue - - - FileTypeTEXT - FileExtension.hpp - CompilerMW C/C++ PPC Mac OS X - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMaketrue - - - FileTypeTEXT - FileExtension.lcf - Compiler - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.m - CompilerMW C/C++ PPC Mac OS X - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.mm - CompilerMW C/C++ PPC Mac OS X - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.pch - CompilerMW C/C++ PPC Mac OS X - EditLanguageC/C++ - Precompiletrue - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.pch++ - CompilerMW C/C++ PPC Mac OS X - EditLanguageC/C++ - Precompiletrue - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.pchm - CompilerMW C/C++ PPC Mac OS X - EditLanguageC/C++ - Precompiletrue - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.pchmm - CompilerMW C/C++ PPC Mac OS X - EditLanguageC/C++ - Precompiletrue - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.plc - CompilerProperty List Compiler - EditLanguageProperty List - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.ploc - CompilerProperty List Compiler - EditLanguageProperty List - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.r - CompilerRez - EditLanguageRez - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.wke - Compiler - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypedocu - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypersrc - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileExtension.a - CompilerMachO Importer - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileExtension.doc - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFilefalse - IgnoredByMaketrue - - - FileExtension.dylib - CompilerMachO Importer - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileExtension.gif - CompilerCopy To Package - EditLanguage - Precompilefalse - Launchabletrue - ResourceFilefalse - IgnoredByMaketrue - - - FileExtension.icns - CompilerCopy To Package - EditLanguage - Precompilefalse - Launchabletrue - ResourceFilefalse - IgnoredByMaketrue - - - FileExtension.jpg - CompilerCopy To Package - EditLanguage - Precompilefalse - Launchabletrue - ResourceFilefalse - IgnoredByMaketrue - - - FileExtension.lib - CompilerMachO Importer - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileExtension.nib - CompilerCopy To Package - EditLanguage - Precompilefalse - Launchabletrue - ResourceFilefalse - IgnoredByMaketrue - - - FileExtension.pl - CompilerPerl Tool - EditLanguagePerl - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileExtension.plist - CompilerCopy To Package - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMaketrue - - - FileExtension.ppob - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileExtension.psh - CompilerShell Tool - EditLanguage - Precompiletrue - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileExtension.rsrc - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileExtension.sh - CompilerShell Tool - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileExtension.strings - CompilerCopy To Package - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMaketrue - - - FileExtension.tiff - CompilerCopy To Package - EditLanguage - Precompilefalse - Launchabletrue - ResourceFilefalse - IgnoredByMaketrue - - - - - CacheModDatestrue - DumpBrowserInfofalse - CacheSubprojectstrue - UseThirdPartyDebuggerfalse - BrowserGenerator1 - DebuggerAppPath - Path - PathFormatGeneric - PathRootAbsolute - - DebuggerCmdLineArgs - DebuggerWorkingDir - Path - PathFormatGeneric - PathRootAbsolute - - CodeCompletionPrefixFileNameMacHeaders.c - CodeCompletionMacroFileNameMacOS_Carbon_C++_Macros.h - - - ConsoleEncoding0 - LogSystemMessagestrue - AutoTargetDLLsfalse - StopAtWatchpointstrue - PauseWhileRunningfalse - PauseInterval5 - PauseUIFlags0 - AltExePath - Path - PathFormatGeneric - PathRootAbsolute - - StopAtTempBPOnLaunchtrue - CacheSymbolicstrue - TempBPFunctionNamemain - TempBPType0 - - - Enabledfalse - ConnectionName - DownloadPath - LaunchRemoteAppfalse - RemoteAppPath - CoreID0 - JTAGClockSpeed8000 - IsMultiCorefalse - OSDownloadfalse - UseGlobalOSDownloadfalse - OSDownloadConnectionName - OSDownloadPath - AltDownloadfalse - AltDownloadConnectionName - - - OtherExecutables - - - CustomColor1 - Red0 - Green32767 - Blue0 - - CustomColor2 - Red0 - Green32767 - Blue0 - - CustomColor3 - Red0 - Green32767 - Blue0 - - CustomColor4 - Red0 - Green32767 - Blue0 - - - - MWFrontEnd_C_cplusplus0 - MWFrontEnd_C_checkprotos0 - MWFrontEnd_C_arm0 - MWFrontEnd_C_trigraphs0 - MWFrontEnd_C_onlystdkeywords0 - MWFrontEnd_C_enumsalwaysint0 - MWFrontEnd_C_mpwpointerstyle0 - MWFrontEnd_C_prefixnamewx/wxshlba_cwc_d.h - MWFrontEnd_C_ansistrict0 - MWFrontEnd_C_mpwcnewline0 - MWFrontEnd_C_wchar_type1 - MWFrontEnd_C_enableexceptions1 - MWFrontEnd_C_dontreusestrings0 - MWFrontEnd_C_poolstrings0 - MWFrontEnd_C_dontinline1 - MWFrontEnd_C_useRTTI1 - MWFrontEnd_C_multibyteaware0 - MWFrontEnd_C_unsignedchars1 - MWFrontEnd_C_autoinline0 - MWFrontEnd_C_booltruefalse1 - MWFrontEnd_C_inlinelevel0 - MWFrontEnd_C_ecplusplus0 - MWFrontEnd_C_objective_c0 - MWFrontEnd_C_defer_codegen0 - MWFrontEnd_C_templateparser0 - MWFrontEnd_C_c990 - MWFrontEnd_C_bottomupinline1 - - - MWWarning_C_warn_illpragma1 - MWWarning_C_warn_emptydecl0 - MWWarning_C_warn_possunwant0 - MWWarning_C_warn_unusedvar0 - MWWarning_C_warn_unusedarg0 - MWWarning_C_warn_extracomma0 - MWWarning_C_pedantic1 - MWWarning_C_warningerrors0 - MWWarning_C_warn_hidevirtual1 - MWWarning_C_warn_implicitconv0 - MWWarning_C_warn_notinlined0 - MWWarning_C_warn_structclass1 - - - MWFTP_Post_hostName - MWFTP_Post_username - MWFTP_Post_password0ÿÂà -ž0¼,šì - MWFTP_Post_remoteDir - MWFTP_Post_ftp_PathVersion1 - MWFTP_Post_ftp_PathType0 - MWFTP_Post_ftp_PathFormat0 - MWFTP_Post_ftp_tree - MWFTP_Post_uploadDir - MWFTP_Post_ftp_port21 - MWFTP_Post_SendBin1 - MWFTP_Post_ShouldLog1 - - - MWCommandLine_Java_clsName - MWCommandLine_Java_args - - - MWVJavaDebugging_Protocol1 - MWVJavaDebugging_JDKVersion1 - MWVJavaDebugging_TimeOut10 - MWVJavaDebugging_SupportSlowDevicesfalse - MWVJavaDebugging_UseRemoteLaunchAgentfalse - MWVJavaDebugging_LaunchVMasServerfalse - - - MWJava_Language_optimizefalse - MWJava_Language_warnDeprecatedfalse - MWJava_Language_emitMapfalse - MWJava_Language_strictFileNamesfalse - MWJava_Language_strictFileHierarchyfalse - MWJava_Language_1_1_Compatiblefalse - MWJava_Language_emitHeaders0 - MWJava_Language_headerTypeJNINativeHeaders - MWJava_Language_packageFilter - MWJava_Language_genCommentstrue - MWJava_Language_genHeadersfalse - MWJava_Language_enableAssertsfalse - MWJava_Language_targetVM1.1 - - - Manifest-JAD Attributes - - AttributeMain-Class - ValueAuto-Generated - - - - - MWJava_MRJAppBuilder_outFileMRJApplication - MWJava_MRJAppBuilder_mergefalse - MWJava_MRJAppBuilder_quitMenutrue - MWJava_MRJAppBuilder_growfalse - MWJava_MRJAppBuilder_stdoutTypeConsole - MWJava_MRJAppBuilder_stderrTypeConsole - MWJava_MRJAppBuilder_stdinTypeConsole - MWJava_MRJAppBuilder_appIconPVersion0 - MWJava_MRJAppBuilder_appIconPType0 - MWJava_MRJAppBuilder_appIconPFormat0 - MWJava_MRJAppBuilder_appIconPTree - MWJava_MRJAppBuilder_appIconFile - MWJava_MRJAppBuilder_splashScreenPVersion0 - MWJava_MRJAppBuilder_splashScreenPType0 - MWJava_MRJAppBuilder_splashScreenPFormat0 - MWJava_MRJAppBuilder_splashScreenPTree - MWJava_MRJAppBuilder_splashScreenPICTFile - MWJava_MRJAppBuilder_aboutName - MWJava_MRJAppBuilder_stdoutPVersion0 - MWJava_MRJAppBuilder_stdoutPType0 - MWJava_MRJAppBuilder_stdoutPFormat0 - MWJava_MRJAppBuilder_stdoutPTree - MWJava_MRJAppBuilder_stdoutFile - MWJava_MRJAppBuilder_stdoutAppendfalse - MWJava_MRJAppBuilder_stderrPType0 - MWJava_MRJAppBuilder_stderrPFormat0 - MWJava_MRJAppBuilder_stderrPTree - MWJava_MRJAppBuilder_stderrFile - MWJava_MRJAppBuilder_stderrAppendfalse - MWJava_MRJAppBuilder_stdinPType0 - MWJava_MRJAppBuilder_stdinPFormat0 - MWJava_MRJAppBuilder_stdinPTree - MWJava_MRJAppBuilder_stdinFile - - - MWJava_Output_outputtypeJarFile - MWJava_Output_outfileJavaClasses.jar - MWJava_Output_ftype1514754080 - MWJava_Output_fcreator1297570384 - MWJava_Output_compress0 - MWJava_Output_genManifest0 - MWJava_Output_trunctypeFront - MWJava_Output_deleteClasses0 - MWJava_Output_consoleApp1 - MWJava_Output_preverify0 - MWJava_Output_genJad0 - MWJava_Output_obfuscate0 - - - MWJava_Proj_projtypeApplet - MWJava_Proj_mainClassName - MWJava_Proj_HTMLAppCreator1145457748 - MWJava_Proj_HTMLAppNameMetrowerks Java - MWJava_Proj_PathVersion1 - MWJava_Proj_PathType0 - MWJava_Proj_PathFormat0 - MWJava_Proj_tree - MWJava_Proj_HTMLAppWin32NameInternet Explorer - MWJava_Proj_compress0 - MWJava_Proj_simulator0 - MWJava_Proj_useVM\000\000macosx - MWJava_Proj_vmarguments - MWJava_Proj_vmName - MWJava_Proj_simPropFile - - - MWJavaDoc_Proj_Version1 - MWJavaDoc_Proj_Deprecated1 - MWJavaDoc_Proj_Author1 - MWJavaDoc_Proj_Index1 - MWJavaDoc_Proj_Tree1 - MWJavaDoc_Proj_SunResolveToSame0 - MWJavaDoc_Proj_Shortnames1 - MWJavaDoc_Proj_Folder0 - MWJavaDoc_Proj_GenerateAPILinks0 - MWJavaDoc_Proj_scopePublic - MWJavaDoc_Proj_fcreator1297303877 - MWJavaDoc_Proj_encodingName - MWJavaDoc_Proj_decodingName - MWJavaDoc_Proj_javaPackagePathhttp://java.sun.com/products/jdk/1.1/docs/api/ - - - MWMerge_MacOS_projectTypeApplication - MWMerge_MacOS_outputNameMerge Out - MWMerge_MacOS_outputCreator???? - MWMerge_MacOS_outputTypeAPPL - MWMerge_MacOS_suppressWarning0 - MWMerge_MacOS_copyFragments1 - MWMerge_MacOS_copyResources1 - MWMerge_MacOS_flattenResource0 - MWMerge_MacOS_flatFileNamea.rsrc - MWMerge_MacOS_flatFileOutputPath - Path: - PathFormatMacOS - PathRootProject - - MWMerge_MacOS_skipResources - DLGX - ckid - Proj - WSPC - - - - FileLockedfalse - ResourcesMapIsReadOnlyfalse - PrinterDriverIsMultiFinderCompatiblefalse - Invisiblefalse - HasBundlefalse - NameLockedfalse - Stationeryfalse - HasCustomIconfalse - Sharedfalse - HasBeenInitedfalse - Label0 - Comments - - - MWMacOSPackager_UsePackager0 - MWMacOSPackager_FolderToPackage - Path - PathFormatMacOS - PathRootAbsolute - - MWMacOSPackager_CreateClassicAlias0 - MWMacOSPackager_ClassicAliasMethodUseTargetOutput - MWMacOSPackager_ClassicAliasPath - Path - PathFormatGeneric - PathRootAbsolute - - MWMacOSPackager_CreatePkgInfo0 - MWMacOSPackager_PkgCreatorType???? - MWMacOSPackager_PkgFileTypeAPPL - - - MWCodeGen_PPC_structalignmentPPC_mw - MWCodeGen_PPC_tracebacktablesOutOfLine - MWCodeGen_PPC_processorGeneric - MWCodeGen_PPC_function_align4 - MWCodeGen_PPC_tocdata1 - MWCodeGen_PPC_largetoc0 - MWCodeGen_PPC_profiler0 - MWCodeGen_PPC_vectortocdata0 - MWCodeGen_PPC_poolconst0 - MWCodeGen_PPC_peephole1 - MWCodeGen_PPC_readonlystrings0 - MWCodeGen_PPC_linkerpoolsstrings0 - MWCodeGen_PPC_volatileasm0 - MWCodeGen_PPC_schedule0 - MWCodeGen_PPC_altivec0 - MWCodeGen_PPC_altivec_move_block0 - MWCodeGen_PPC_strictIEEEfp0 - MWCodeGen_PPC_fpcontract1 - MWCodeGen_PPC_genfsel0 - MWCodeGen_PPC_orderedfpcmp0 - - - MWCodeGen_MachO_structalignmentPPC_mw - MWCodeGen_MachO_profiler_enumOff - MWCodeGen_MachO_processorGeneric - MWCodeGen_MachO_function_align4 - MWCodeGen_MachO_common0 - MWCodeGen_MachO_peephole1 - MWCodeGen_MachO_readonlystrings0 - MWCodeGen_MachO_linkerpoolsstrings1 - MWCodeGen_MachO_volatileasm0 - MWCodeGen_MachO_schedule0 - MWCodeGen_MachO_altivec0 - MWCodeGen_MachO_vecmove0 - MWCodeGen_MachO_fp_ieee_strict0 - MWCodeGen_MachO_fpcontract1 - MWCodeGen_MachO_genfsel0 - MWCodeGen_MachO_fp_cmps_ordered0 - - - MWDisassembler_PPC_showcode1 - MWDisassembler_PPC_extended1 - MWDisassembler_PPC_mix0 - MWDisassembler_PPC_nohex0 - MWDisassembler_PPC_showdata1 - MWDisassembler_PPC_showexceptions1 - MWDisassembler_PPC_showsym1 - MWDisassembler_PPC_shownames1 - - - GlobalOptimizer_PPC_optimizationlevelLevel0 - GlobalOptimizer_PPC_optforSpeed - - - MWLinker_PPC_linksym1 - MWLinker_PPC_symfullpath1 - MWLinker_PPC_linkmap0 - MWLinker_PPC_nolinkwarnings0 - MWLinker_PPC_dontdeadstripinitcode1 - MWLinker_PPC_permitmultdefs0 - MWLinker_PPC_linkmodeFast - MWLinker_PPC_initname - MWLinker_PPC_mainname__start - MWLinker_PPC_termname - - - MWLinker_MacOSX_linksym1 - MWLinker_MacOSX_symfullpath1 - MWLinker_MacOSX_nolinkwarnings0 - MWLinker_MacOSX_linkmap0 - MWLinker_MacOSX_dontdeadstripinitcode0 - MWLinker_MacOSX_permitmultdefs1 - MWLinker_MacOSX_use_objectivec_semantics0 - MWLinker_MacOSX_strip_debug_symbols0 - MWLinker_MacOSX_split_segs0 - MWLinker_MacOSX_report_msl_overloads0 - MWLinker_MacOSX_objects_follow_linkorder0 - MWLinker_MacOSX_linkmodeFast - MWLinker_MacOSX_exportsPragma - MWLinker_MacOSX_sortcodeNone - MWLinker_MacOSX_mainname - - - MWProject_MacOSX_typeLibrary - MWProject_MacOSX_outfilewxshlba_Mach_d.lib - MWProject_MacOSX_filecreatorCWIE - MWProject_MacOSX_filetypeMLIB - MWProject_MacOSX_vmaddress0 - MWProject_MacOSX_usedefaultvmaddr1 - MWProject_MacOSX_flatrsrc0 - MWProject_MacOSX_flatrsrcfilename - MWProject_MacOSX_flatrsrcoutputdir - Path: - PathFormatMacOS - PathRootProject - - MWProject_MacOSX_installpath./ - MWProject_MacOSX_dont_prebind0 - MWProject_MacOSX_flat_namespace0 - MWProject_MacOSX_frameworkversionA - MWProject_MacOSX_currentversion0 - MWProject_MacOSX_flat_oldimpversion0 - - - MWLinker_MachO_exportsNone - MWLinker_MachO_mainnamestart - MWLinker_MachO_currentversion0 - MWLinker_MachO_compatibleversion0 - MWLinker_MachO_symfullpath0 - MWLinker_MachO_supresswarnings0 - MWLinker_MachO_multisymerror0 - MWLinker_MachO_prebind1 - MWLinker_MachO_deadstrip1 - MWLinker_MachO_objectivecsemantics0 - MWLinker_MachO_whichfileloaded0 - MWLinker_MachO_whyfileloaded0 - MWLinker_MachO_readonlyrelocsErrors - MWLinker_MachO_undefinedsymbolsErrors - MWLinker_MachO_twolevelnamespace1 - MWLinker_MachO_stripdebugsymbols0 - - - MWProject_MachO_typeExecutable - MWProject_MachO_outfilea.exe - MWProject_MachO_filecreator???? - MWProject_MachO_filetypeMEXE - MWProject_MachO_vmaddress4096 - MWProject_MachO_flatrsrc1 - MWProject_MachO_flatrsrcfilenamea.rsrc - MWProject_MachO_flatrsrcoutputdir - Path: - PathFormatMacOS - PathRootProject - - MWProject_MachO_installpath./ - MWProject_MachO_frameworkversion - - - MWPEF_exportsAll - MWPEF_libfolder0 - MWPEF_sortcodeNone - MWPEF_expandbss0 - MWPEF_sharedata0 - MWPEF_olddefversion0 - MWPEF_oldimpversion0 - MWPEF_currentversion0 - MWPEF_fragmentnamewxwin - MWPEF_collapsereloads0 - - - MWProject_PPC_typeLibrary - MWProject_PPC_outfilewx_CARBON_d.lib - MWProject_PPC_filecreator???? - MWProject_PPC_filetype???? - MWProject_PPC_size0 - MWProject_PPC_minsize0 - MWProject_PPC_stacksize0 - MWProject_PPC_flags0 - MWProject_PPC_symfilename - MWProject_PPC_rsrcname - MWProject_PPC_rsrcheaderNative - MWProject_PPC_rsrctype???? - MWProject_PPC_rsrcid0 - MWProject_PPC_rsrcflags0 - MWProject_PPC_rsrcstore0 - MWProject_PPC_rsrcmerge0 - MWProject_PPC_flatrsrc0 - MWProject_PPC_flatrsrcoutputdir - Path: - PathFormatMacOS - PathRootProject - - MWProject_PPC_flatrsrcfilename - - - MWAssembler_PPC_auxheader0 - MWAssembler_PPC_symmodeMac - MWAssembler_PPC_dialectPPC - MWAssembler_PPC_prefixfile - MWAssembler_PPC_typecheck0 - MWAssembler_PPC_warnings0 - MWAssembler_PPC_casesensitive0 - - - PList_OutputTypeFile - PList_OutputEncodingUTF-8 - PList_Prefix - PList_FileFilenameInfo.plist - PList_FileDirectory - Path: - PathFormatMacOS - PathRootProject - - PList_ResourceTypeplst - PList_ResourceID0 - PList_ResourceName - - - MWRez_Language_maxwidth80 - MWRez_Language_scriptRoman - MWRez_Language_alignmentAlign1 - MWRez_Language_filtermodeFilterSkip - MWRez_Language_suppresswarnings0 - MWRez_Language_escapecontrolchars1 - MWRez_Language_prefixname - MWRez_Language_filteredtypes'CODE' 'DATA' 'PICT' - - - MWWinRC_prefixname - - - MWCodeGen_X86_processorGeneric - MWCodeGen_X86_alignmentbytes8 - MWCodeGen_X86_exceptionsZeroOverhead - MWCodeGen_X86_name_manglingMWWin32 - MWCodeGen_X86_use_extinst0 - MWCodeGen_X86_extinst_mmx0 - MWCodeGen_X86_extinst_3dnow0 - MWCodeGen_X86_use_mmx_3dnow_convention0 - MWCodeGen_X86_extinst_cmov0 - MWCodeGen_X86_extinst_sse0 - MWCodeGen_X86_extinst_sse20 - MWCodeGen_X86_intrinsics0 - MWCodeGen_X86_optimizeasm0 - MWCodeGen_X86_disableopts0 - MWCodeGen_X86_profile0 - MWLinker_X86_runtimeCustom - MWCodeGen_X86_readonlystrings0 - - - MWLinker_X86_subsysmajorid4 - MWLinker_X86_subsysminorid0 - MWCOFF_X86_opsysmajorid4 - MWCOFF_X86_opsysminorid0 - MWLinker_X86_usrmajorid0 - MWLinker_X86_usrminorid0 - MWProject_X86_maxstacksize1024 - MWProject_X86_minstacksize4 - MWProject_X86_size1024 - MWProject_X86_minsize4 - MWCOFF_X86_coff_flags0 - MWCOFF_X86_dll_flags0 - MWProject_X86_baseaddress4194304 - MWCOFF_X86_filealign512 - MWCOFF_X86_sectionalign4096 - - - PDisasmX86_showHeaderstrue - PDisasmX86_showSectHeaderstrue - PDisasmX86_showSymTabtrue - PDisasmX86_showCodetrue - PDisasmX86_showDatatrue - PDisasmX86_showDebugfalse - PDisasmX86_showExceptionsfalse - PDisasmX86_showRawfalse - PDisasmX86_showAllRawfalse - PDisasmX86_showSourcefalse - PDisasmX86_showRelocationtrue - PDisasmX86_showHextrue - PDisasmX86_showCommentsfalse - PDisasmX86_showSymDefstrue - PDisasmX86_unmanglefalse - PDisasmX86_verbosefalse - PDisasmX86_resolveRelocstrue - PDisasmX86_resolveLocalsfalse - - - MWDebugger_X86_Exceptions - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - - - - GlobalOptimizer_X86_optimizationlevelLevel0 - GlobalOptimizer_X86_optforSpeed - - - MWLinker_X86_entrypointusageDefault - MWLinker_X86_entrypoint - MWLinker_X86_subsystemWinGUI - MWLinker_X86_commandfile - MWLinker_X86_generatemap0 - MWLinker_X86_linksym1 - MWLinker_X86_linkCV1 - MWLinker_X86_symfullpathfalse - MWLinker_X86_linkdebugtrue - MWLinker_X86_checksumfalse - MWLinker_X86_zero_init_bssfalse - MWLinker_X86_mergedatafalse - MWLinker_X86_usedefaultlibsfalse - MWLinker_X86_adddefaultlibsfalse - MWLinker_X86_nowarningsfalse - MWLinker_X86_verbosefalse - - - MWProject_X86_typeLibrary - MWProject_X86_outfilewx_x86_d.lib - MWProject_X86_importlib - MWProject_X86_setimportlibdirfalse - MWProject_X86_dontgenerateimportlibfalse - MWProject_X86_oldformatlibfalse - MWProject_X86_replaceobjextensionfalse - MWProject_X86_copyallfilesfalse - - - - PathRelative - Project - ::include: - wxshlba_cwc_d.pch - Unix - Text - Debug - - - PathRelative - Project - ::include: - wxshlba_cwc_d.pch++ - Unix - Text - Debug - - - - - PathRelative - Project - ::include: - wxshlba_cwc_d.pch - Unix - - - PathRelative - Project - ::include: - wxshlba_cwc_d.pch++ - Unix - - - - - - PathRelative - OS X Volume - System/Library/Frameworks - Carbon.framework - Unix - - Carbon - - - - PathRelative - OS X Volume - System/Library/Frameworks - System.framework - Unix - - System - - - - - wxlib Carbon debug - - - - UserSourceTrees - - - AlwaysSearchUserPathsfalse - InterpretDOSAndUnixPathstrue - RequireFrameworkStyleIncludesfalse - UserSearchPaths - - SearchPath - Path::include: - PathFormatMacOS - PathRootProject - - Recursivefalse - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path::art: - PathFormatMacOS - PathRootProject - - Recursivefalse - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:generic: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:mac:carbon: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:common: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:zlib: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:png: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:jpeg: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:iodbc: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:tiff: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:html: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Pathxml - PathFormatUnix - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Pathexpat/lib - PathFormatUnix - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Pathxrc - PathFormatUnix - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Pathmac/corefoundation - PathFormatUnix - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SystemSearchPaths - - SearchPath - Path:MSL: - PathFormatMacOS - PathRootCodeWarrior - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:MacOS Support: - PathFormatMacOS - PathRootCodeWarrior - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:regex: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - - - MWRuntimeSettings_WorkingDirectory - MWRuntimeSettings_CommandLine - MWRuntimeSettings_HostApplication - Path - PathFormatGeneric - PathRootAbsolute - - MWRuntimeSettings_EnvVars - - - LinkerMacOS PPC Linker - PreLinker - PostLinker - Targetnamewxlib Carbon debug - OutputDirectory - Path::lib: - PathFormatMacOS - PathRootProject - - SaveEntriesUsingRelativePathstrue - - - FileMappings - - FileTypeAPPL - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypeAppl - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypeMMLB - FileExtension - CompilerLib Import PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeMPLF - FileExtension - CompilerLib Import PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeMWCD - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypeRSRC - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.bh - CompilerBalloon Help - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.c - CompilerMW C/C++ PPC - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.c++ - CompilerMW C/C++ PPC - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.cc - CompilerMW C/C++ PPC - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.cp - CompilerMW C/C++ PPC - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.cpp - CompilerMW C/C++ PPC - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.exp - Compiler - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.h - CompilerMW C/C++ PPC - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMaketrue - - - FileTypeTEXT - FileExtension.p - CompilerMW Pascal PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.pas - CompilerMW Pascal PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.pch - CompilerMW C/C++ PPC - EditLanguageC/C++ - Precompiletrue - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.pch++ - CompilerMW C/C++ PPC - EditLanguageC/C++ - Precompiletrue - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.ppu - CompilerMW Pascal PPC - EditLanguage - Precompiletrue - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.r - CompilerRez - EditLanguageRez - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.s - CompilerPPCAsm - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeXCOF - FileExtension - CompilerXCOFF Import PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypedocu - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypersrc - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypeshlb - FileExtension - CompilerPEF Import PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypestub - FileExtension - CompilerPEF Import PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileExtension.doc - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFilefalse - IgnoredByMaketrue - - - FileExtension.o - CompilerXCOFF Import PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileExtension.ppob - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileExtension.rsrc - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - - - CacheModDatestrue - DumpBrowserInfofalse - CacheSubprojectstrue - UseThirdPartyDebuggerfalse - BrowserGenerator1 - DebuggerAppPath - Path - PathFormatGeneric - PathRootAbsolute - - DebuggerCmdLineArgs - DebuggerWorkingDir - Path - PathFormatGeneric - PathRootAbsolute - - CodeCompletionPrefixFileNameMacHeaders.c - CodeCompletionMacroFileNameMacOS_Carbon_C++_Macros.h - - - ConsoleEncoding0 - LogSystemMessagestrue - AutoTargetDLLsfalse - StopAtWatchpointstrue - PauseWhileRunningfalse - PauseInterval5 - PauseUIFlags0 - AltExePath - Path - PathFormatGeneric - PathRootAbsolute - - StopAtTempBPOnLaunchtrue - CacheSymbolicstrue - TempBPFunctionNamemain - TempBPType0 - - - Enabledfalse - ConnectionName - DownloadPath - LaunchRemoteAppfalse - RemoteAppPath - CoreID0 - JTAGClockSpeed8000 - IsMultiCorefalse - OSDownloadfalse - UseGlobalOSDownloadfalse - OSDownloadConnectionName - OSDownloadPath - AltDownloadfalse - AltDownloadConnectionName - - - OtherExecutables - - - CustomColor1 - Red0 - Green32767 - Blue0 - - CustomColor2 - Red0 - Green32767 - Blue0 - - CustomColor3 - Red0 - Green32767 - Blue0 - - CustomColor4 - Red0 - Green32767 - Blue0 - - - - MWFrontEnd_C_cplusplus0 - MWFrontEnd_C_checkprotos0 - MWFrontEnd_C_arm0 - MWFrontEnd_C_trigraphs0 - MWFrontEnd_C_onlystdkeywords0 - MWFrontEnd_C_enumsalwaysint0 - MWFrontEnd_C_mpwpointerstyle0 - MWFrontEnd_C_prefixnamewx/wx_cwc_d.h - MWFrontEnd_C_ansistrict0 - MWFrontEnd_C_mpwcnewline0 - MWFrontEnd_C_wchar_type1 - MWFrontEnd_C_enableexceptions1 - MWFrontEnd_C_dontreusestrings0 - MWFrontEnd_C_poolstrings0 - MWFrontEnd_C_dontinline0 - MWFrontEnd_C_useRTTI1 - MWFrontEnd_C_multibyteaware0 - MWFrontEnd_C_unsignedchars1 - MWFrontEnd_C_autoinline0 - MWFrontEnd_C_booltruefalse1 - MWFrontEnd_C_inlinelevel0 - MWFrontEnd_C_ecplusplus0 - MWFrontEnd_C_objective_c0 - MWFrontEnd_C_defer_codegen0 - MWFrontEnd_C_templateparser0 - MWFrontEnd_C_c990 - MWFrontEnd_C_bottomupinline1 - - - MWWarning_C_warn_illpragma1 - MWWarning_C_warn_emptydecl0 - MWWarning_C_warn_possunwant0 - MWWarning_C_warn_unusedvar0 - MWWarning_C_warn_unusedarg0 - MWWarning_C_warn_extracomma0 - MWWarning_C_pedantic1 - MWWarning_C_warningerrors0 - MWWarning_C_warn_hidevirtual1 - MWWarning_C_warn_implicitconv0 - MWWarning_C_warn_notinlined0 - MWWarning_C_warn_structclass1 - - - MWFTP_Post_hostName - MWFTP_Post_username - MWFTP_Post_password0ÿÂà -ž0¼,šì - MWFTP_Post_remoteDir - MWFTP_Post_ftp_PathVersion1 - MWFTP_Post_ftp_PathType0 - MWFTP_Post_ftp_PathFormat0 - MWFTP_Post_ftp_tree - MWFTP_Post_uploadDir - MWFTP_Post_ftp_port21 - MWFTP_Post_SendBin1 - MWFTP_Post_ShouldLog1 - - - MWCommandLine_Java_clsName - MWCommandLine_Java_args - - - MWVJavaDebugging_Protocol1 - MWVJavaDebugging_JDKVersion1 - MWVJavaDebugging_TimeOut10 - MWVJavaDebugging_SupportSlowDevicesfalse - MWVJavaDebugging_UseRemoteLaunchAgentfalse - MWVJavaDebugging_LaunchVMasServerfalse - - - MWJava_Language_optimizefalse - MWJava_Language_warnDeprecatedfalse - MWJava_Language_emitMapfalse - MWJava_Language_strictFileNamesfalse - MWJava_Language_strictFileHierarchyfalse - MWJava_Language_1_1_Compatiblefalse - MWJava_Language_emitHeaders0 - MWJava_Language_headerTypeJNINativeHeaders - MWJava_Language_packageFilter - MWJava_Language_genCommentstrue - MWJava_Language_genHeadersfalse - MWJava_Language_enableAssertsfalse - MWJava_Language_targetVM1.1 - - - Manifest-JAD Attributes - - AttributeMain-Class - ValueAuto-Generated - - - - - MWJava_MRJAppBuilder_outFileMRJApplication - MWJava_MRJAppBuilder_mergefalse - MWJava_MRJAppBuilder_quitMenutrue - MWJava_MRJAppBuilder_growfalse - MWJava_MRJAppBuilder_stdoutTypeConsole - MWJava_MRJAppBuilder_stderrTypeConsole - MWJava_MRJAppBuilder_stdinTypeConsole - MWJava_MRJAppBuilder_appIconPVersion0 - MWJava_MRJAppBuilder_appIconPType0 - MWJava_MRJAppBuilder_appIconPFormat0 - MWJava_MRJAppBuilder_appIconPTree - MWJava_MRJAppBuilder_appIconFile - MWJava_MRJAppBuilder_splashScreenPVersion0 - MWJava_MRJAppBuilder_splashScreenPType0 - MWJava_MRJAppBuilder_splashScreenPFormat0 - MWJava_MRJAppBuilder_splashScreenPTree - MWJava_MRJAppBuilder_splashScreenPICTFile - MWJava_MRJAppBuilder_aboutName - MWJava_MRJAppBuilder_stdoutPVersion0 - MWJava_MRJAppBuilder_stdoutPType0 - MWJava_MRJAppBuilder_stdoutPFormat0 - MWJava_MRJAppBuilder_stdoutPTree - MWJava_MRJAppBuilder_stdoutFile - MWJava_MRJAppBuilder_stdoutAppendfalse - MWJava_MRJAppBuilder_stderrPType0 - MWJava_MRJAppBuilder_stderrPFormat0 - MWJava_MRJAppBuilder_stderrPTree - MWJava_MRJAppBuilder_stderrFile - MWJava_MRJAppBuilder_stderrAppendfalse - MWJava_MRJAppBuilder_stdinPType0 - MWJava_MRJAppBuilder_stdinPFormat0 - MWJava_MRJAppBuilder_stdinPTree - MWJava_MRJAppBuilder_stdinFile - - - MWJava_Output_outputtypeJarFile - MWJava_Output_outfileJavaClasses.jar - MWJava_Output_ftype1514754080 - MWJava_Output_fcreator1297570384 - MWJava_Output_compress0 - MWJava_Output_genManifest0 - MWJava_Output_trunctypeFront - MWJava_Output_deleteClasses0 - MWJava_Output_consoleApp1 - MWJava_Output_preverify0 - MWJava_Output_genJad0 - MWJava_Output_obfuscate0 - - - MWJava_Proj_projtypeApplet - MWJava_Proj_mainClassName - MWJava_Proj_HTMLAppCreator1145457748 - MWJava_Proj_HTMLAppNameMetrowerks Java - MWJava_Proj_PathVersion1 - MWJava_Proj_PathType0 - MWJava_Proj_PathFormat0 - MWJava_Proj_tree - MWJava_Proj_HTMLAppWin32NameInternet Explorer - MWJava_Proj_compress0 - MWJava_Proj_simulator0 - MWJava_Proj_useVM\000\000macosx - MWJava_Proj_vmarguments - MWJava_Proj_vmName - MWJava_Proj_simPropFile - - - MWJavaDoc_Proj_Version1 - MWJavaDoc_Proj_Deprecated1 - MWJavaDoc_Proj_Author1 - MWJavaDoc_Proj_Index1 - MWJavaDoc_Proj_Tree1 - MWJavaDoc_Proj_SunResolveToSame0 - MWJavaDoc_Proj_Shortnames1 - MWJavaDoc_Proj_Folder0 - MWJavaDoc_Proj_GenerateAPILinks0 - MWJavaDoc_Proj_scopePublic - MWJavaDoc_Proj_fcreator1297303877 - MWJavaDoc_Proj_encodingName - MWJavaDoc_Proj_decodingName - MWJavaDoc_Proj_javaPackagePathhttp://java.sun.com/products/jdk/1.1/docs/api/ - - - MWMerge_MacOS_projectTypeApplication - MWMerge_MacOS_outputNameMerge Out - MWMerge_MacOS_outputCreator???? - MWMerge_MacOS_outputTypeAPPL - MWMerge_MacOS_suppressWarning0 - MWMerge_MacOS_copyFragments1 - MWMerge_MacOS_copyResources1 - MWMerge_MacOS_flattenResource0 - MWMerge_MacOS_flatFileNamea.rsrc - MWMerge_MacOS_flatFileOutputPath - Path: - PathFormatMacOS - PathRootProject - - MWMerge_MacOS_skipResources - DLGX - ckid - Proj - WSPC - - - - FileLockedfalse - ResourcesMapIsReadOnlyfalse - PrinterDriverIsMultiFinderCompatiblefalse - Invisiblefalse - HasBundlefalse - NameLockedfalse - Stationeryfalse - HasCustomIconfalse - Sharedfalse - HasBeenInitedfalse - Label0 - Comments - - - MWMacOSPackager_UsePackager0 - MWMacOSPackager_FolderToPackage - Path - PathFormatMacOS - PathRootAbsolute - - MWMacOSPackager_CreateClassicAlias0 - MWMacOSPackager_ClassicAliasMethodUseTargetOutput - MWMacOSPackager_ClassicAliasPath - Path - PathFormatGeneric - PathRootAbsolute - - MWMacOSPackager_CreatePkgInfo0 - MWMacOSPackager_PkgCreatorType???? - MWMacOSPackager_PkgFileTypeAPPL - - - MWCodeGen_PPC_structalignmentPPC_mw - MWCodeGen_PPC_tracebacktablesOutOfLine - MWCodeGen_PPC_processorGeneric - MWCodeGen_PPC_function_align4 - MWCodeGen_PPC_tocdata1 - MWCodeGen_PPC_largetoc0 - MWCodeGen_PPC_profiler0 - MWCodeGen_PPC_vectortocdata0 - MWCodeGen_PPC_poolconst0 - MWCodeGen_PPC_peephole1 - MWCodeGen_PPC_readonlystrings0 - MWCodeGen_PPC_linkerpoolsstrings0 - MWCodeGen_PPC_volatileasm0 - MWCodeGen_PPC_schedule0 - MWCodeGen_PPC_altivec0 - MWCodeGen_PPC_altivec_move_block0 - MWCodeGen_PPC_strictIEEEfp0 - MWCodeGen_PPC_fpcontract1 - MWCodeGen_PPC_genfsel0 - MWCodeGen_PPC_orderedfpcmp0 - - - MWCodeGen_MachO_structalignmentPPC_mw - MWCodeGen_MachO_profiler_enumOff - MWCodeGen_MachO_processorGeneric - MWCodeGen_MachO_function_align4 - MWCodeGen_MachO_common0 - MWCodeGen_MachO_peephole1 - MWCodeGen_MachO_readonlystrings0 - MWCodeGen_MachO_linkerpoolsstrings1 - MWCodeGen_MachO_volatileasm0 - MWCodeGen_MachO_schedule0 - MWCodeGen_MachO_altivec0 - MWCodeGen_MachO_vecmove0 - MWCodeGen_MachO_fp_ieee_strict0 - MWCodeGen_MachO_fpcontract1 - MWCodeGen_MachO_genfsel0 - MWCodeGen_MachO_fp_cmps_ordered0 - - - MWDisassembler_PPC_showcode1 - MWDisassembler_PPC_extended1 - MWDisassembler_PPC_mix0 - MWDisassembler_PPC_nohex0 - MWDisassembler_PPC_showdata1 - MWDisassembler_PPC_showexceptions1 - MWDisassembler_PPC_showsym1 - MWDisassembler_PPC_shownames1 - - - GlobalOptimizer_PPC_optimizationlevelLevel0 - GlobalOptimizer_PPC_optforSpeed - - - MWLinker_PPC_linksym1 - MWLinker_PPC_symfullpath1 - MWLinker_PPC_linkmap0 - MWLinker_PPC_nolinkwarnings0 - MWLinker_PPC_dontdeadstripinitcode1 - MWLinker_PPC_permitmultdefs0 - MWLinker_PPC_linkmodeFast - MWLinker_PPC_initname - MWLinker_PPC_mainname__start - MWLinker_PPC_termname - - - MWLinker_MacOSX_linksym0 - MWLinker_MacOSX_symfullpath0 - MWLinker_MacOSX_nolinkwarnings0 - MWLinker_MacOSX_linkmap0 - MWLinker_MacOSX_dontdeadstripinitcode0 - MWLinker_MacOSX_permitmultdefs1 - MWLinker_MacOSX_use_objectivec_semantics0 - MWLinker_MacOSX_strip_debug_symbols0 - MWLinker_MacOSX_split_segs0 - MWLinker_MacOSX_report_msl_overloads0 - MWLinker_MacOSX_objects_follow_linkorder0 - MWLinker_MacOSX_linkmodeFast - MWLinker_MacOSX_exportsReferencedGlobals - MWLinker_MacOSX_sortcodeNone - MWLinker_MacOSX_mainnamestart - - - MWProject_MacOSX_typeLibrary - MWProject_MacOSX_outfilewx_CARBON_d.lib - MWProject_MacOSX_filecreator???? - MWProject_MacOSX_filetype???? - MWProject_MacOSX_vmaddress0 - MWProject_MacOSX_usedefaultvmaddr1 - MWProject_MacOSX_flatrsrc0 - MWProject_MacOSX_flatrsrcfilename - MWProject_MacOSX_flatrsrcoutputdir - Path: - PathFormatMacOS - PathRootProject - - MWProject_MacOSX_installpath./ - MWProject_MacOSX_dont_prebind0 - MWProject_MacOSX_flat_namespace0 - MWProject_MacOSX_frameworkversionA - MWProject_MacOSX_currentversion0 - MWProject_MacOSX_flat_oldimpversion0 - - - MWLinker_MachO_exportsNone - MWLinker_MachO_mainnamestart - MWLinker_MachO_currentversion0 - MWLinker_MachO_compatibleversion0 - MWLinker_MachO_symfullpath0 - MWLinker_MachO_supresswarnings0 - MWLinker_MachO_multisymerror0 - MWLinker_MachO_prebind1 - MWLinker_MachO_deadstrip1 - MWLinker_MachO_objectivecsemantics0 - MWLinker_MachO_whichfileloaded0 - MWLinker_MachO_whyfileloaded0 - MWLinker_MachO_readonlyrelocsErrors - MWLinker_MachO_undefinedsymbolsErrors - MWLinker_MachO_twolevelnamespace1 - MWLinker_MachO_stripdebugsymbols0 - - - MWProject_MachO_typeExecutable - MWProject_MachO_outfilea.exe - MWProject_MachO_filecreator???? - MWProject_MachO_filetypeMEXE - MWProject_MachO_vmaddress4096 - MWProject_MachO_flatrsrc1 - MWProject_MachO_flatrsrcfilenamea.rsrc - MWProject_MachO_flatrsrcoutputdir - Path: - PathFormatMacOS - PathRootProject - - MWProject_MachO_installpath./ - MWProject_MachO_frameworkversion - - - MWPEF_exportsAll - MWPEF_libfolder0 - MWPEF_sortcodeNone - MWPEF_expandbss0 - MWPEF_sharedata0 - MWPEF_olddefversion0 - MWPEF_oldimpversion0 - MWPEF_currentversion0 - MWPEF_fragmentnamewxwin - MWPEF_collapsereloads0 - - - MWProject_PPC_typeLibrary - MWProject_PPC_outfilewx_CARBON_d.lib - MWProject_PPC_filecreator???? - MWProject_PPC_filetype???? - MWProject_PPC_size0 - MWProject_PPC_minsize0 - MWProject_PPC_stacksize0 - MWProject_PPC_flags0 - MWProject_PPC_symfilename - MWProject_PPC_rsrcname - MWProject_PPC_rsrcheaderNative - MWProject_PPC_rsrctype???? - MWProject_PPC_rsrcid0 - MWProject_PPC_rsrcflags0 - MWProject_PPC_rsrcstore0 - MWProject_PPC_rsrcmerge0 - MWProject_PPC_flatrsrc0 - MWProject_PPC_flatrsrcoutputdir - Path: - PathFormatMacOS - PathRootProject - - MWProject_PPC_flatrsrcfilename - - - MWAssembler_PPC_auxheader0 - MWAssembler_PPC_symmodeMac - MWAssembler_PPC_dialectPPC - MWAssembler_PPC_prefixfile - MWAssembler_PPC_typecheck0 - MWAssembler_PPC_warnings0 - MWAssembler_PPC_casesensitive0 - - - PList_OutputTypeFile - PList_OutputEncodingUTF-8 - PList_Prefix - PList_FileFilenameInfo.plist - PList_FileDirectory - Path: - PathFormatMacOS - PathRootProject - - PList_ResourceTypeplst - PList_ResourceID0 - PList_ResourceName - - - MWRez_Language_maxwidth80 - MWRez_Language_scriptRoman - MWRez_Language_alignmentAlign1 - MWRez_Language_filtermodeFilterSkip - MWRez_Language_suppresswarnings0 - MWRez_Language_escapecontrolchars1 - MWRez_Language_prefixname - MWRez_Language_filteredtypes'CODE' 'DATA' 'PICT' - - - MWWinRC_prefixname - - - MWCodeGen_X86_processorGeneric - MWCodeGen_X86_alignmentbytes8 - MWCodeGen_X86_exceptionsZeroOverhead - MWCodeGen_X86_name_manglingMWWin32 - MWCodeGen_X86_use_extinst0 - MWCodeGen_X86_extinst_mmx0 - MWCodeGen_X86_extinst_3dnow0 - MWCodeGen_X86_use_mmx_3dnow_convention0 - MWCodeGen_X86_extinst_cmov0 - MWCodeGen_X86_extinst_sse0 - MWCodeGen_X86_extinst_sse20 - MWCodeGen_X86_intrinsics0 - MWCodeGen_X86_optimizeasm0 - MWCodeGen_X86_disableopts0 - MWCodeGen_X86_profile0 - MWLinker_X86_runtimeCustom - MWCodeGen_X86_readonlystrings0 - - - MWLinker_X86_subsysmajorid4 - MWLinker_X86_subsysminorid0 - MWCOFF_X86_opsysmajorid4 - MWCOFF_X86_opsysminorid0 - MWLinker_X86_usrmajorid0 - MWLinker_X86_usrminorid0 - MWProject_X86_maxstacksize1024 - MWProject_X86_minstacksize4 - MWProject_X86_size1024 - MWProject_X86_minsize4 - MWCOFF_X86_coff_flags0 - MWCOFF_X86_dll_flags0 - MWProject_X86_baseaddress4194304 - MWCOFF_X86_filealign512 - MWCOFF_X86_sectionalign4096 - - - PDisasmX86_showHeaderstrue - PDisasmX86_showSectHeaderstrue - PDisasmX86_showSymTabtrue - PDisasmX86_showCodetrue - PDisasmX86_showDatatrue - PDisasmX86_showDebugfalse - PDisasmX86_showExceptionsfalse - PDisasmX86_showRawfalse - PDisasmX86_showAllRawfalse - PDisasmX86_showSourcefalse - PDisasmX86_showRelocationtrue - PDisasmX86_showHextrue - PDisasmX86_showCommentsfalse - PDisasmX86_showSymDefstrue - PDisasmX86_unmanglefalse - PDisasmX86_verbosefalse - PDisasmX86_resolveRelocstrue - PDisasmX86_resolveLocalsfalse - - - MWDebugger_X86_Exceptions - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - - - - GlobalOptimizer_X86_optimizationlevelLevel0 - GlobalOptimizer_X86_optforSpeed - - - MWLinker_X86_entrypointusageDefault - MWLinker_X86_entrypoint - MWLinker_X86_subsystemWinGUI - MWLinker_X86_commandfile - MWLinker_X86_generatemap0 - MWLinker_X86_linksym1 - MWLinker_X86_linkCV1 - MWLinker_X86_symfullpathfalse - MWLinker_X86_linkdebugtrue - MWLinker_X86_checksumfalse - MWLinker_X86_zero_init_bssfalse - MWLinker_X86_mergedatafalse - MWLinker_X86_usedefaultlibsfalse - MWLinker_X86_adddefaultlibsfalse - MWLinker_X86_nowarningsfalse - MWLinker_X86_verbosefalse - - - MWProject_X86_typeLibrary - MWProject_X86_outfilewx_x86_d.lib - MWProject_X86_importlib - MWProject_X86_setimportlibdirfalse - MWProject_X86_dontgenerateimportlibfalse - MWProject_X86_oldformatlibfalse - MWProject_X86_replaceobjextensionfalse - MWProject_X86_copyallfilesfalse - - - - PathRelative - Project - :mac:carbon: - :accel.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :app.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :bitmap.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :bmpbuttn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :brush.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :button.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :checkbox.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :checklst.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :choice.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :clipbrd.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :colordlg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :colour.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :combobox.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :control.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :cursor.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :data.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :dc.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :dcclient.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :dcmemory.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :dcscreen.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :dialog.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :dirdlg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :filedlg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :font.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :fontdlg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :frame.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :gauge.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :gdiobj.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :icon.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :joystick.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :listbox.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :main.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :mdi.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :menu.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :menuitem.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :minifram.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :msgdlg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :palette.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :pen.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :printdlg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :radiobox.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :radiobut.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :region.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :scrolbar.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :settings.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :slider.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :spinbutt.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :statbmp.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :statbox.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :stattext.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :tabctrl.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :textctrl.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :thread.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :timer.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :toolbar.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :utils.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :utilsexc.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :sound.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :window.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :printmac.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :dcprint.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :uma.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :fontutil.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :dataobj.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :m_list.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :m_tables.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :htmlwin.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :m_pre.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :m_image.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :htmprint.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :htmlfilt.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :htmlpars.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :htmltag.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :m_hline.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :winpars.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :htmlcell.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :m_layout.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :m_fonts.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :m_links.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :fontenum.cpp - MacOS - Text - Debug - - - Name - metafile.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :macnotfy.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :statbrma.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :tooltip.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :statlmac.cpp - MacOS - Text - Debug - - - PathRelative - Project - ::include: - :wx_cwc_d.pch - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :notebmac.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :m_dflist.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :dirmac.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :mimetmac.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :spinctrl.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :glcanvas.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :helpctrl.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :helpfrm.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :helpdata.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :toplevel.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :dnd.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :m_style.cpp - MacOS - Text - Debug - - - PathRelative - Project - :jpeg: - jpegM8.mcp - Unix - Project - - - - PathRelative - Project - :png: - pngM8.mcp - Unix - Project - - - - PathRelative - Project - :zlib: - zlibM8.mcp - Unix - Project - - - - PathRelative - Project - :tiff: - tiffM8.mcp - Unix - Project - - - - FileRelative - ../../lib/jpeg_PPC.lib - Unix - - PathRelative - Project - :jpeg: - jpegM8.mcp - Unix - - Library - Debug, TargetOutputFile - - - FileRelative - ../../lib/png_PPC.lib - Unix - - PathRelative - Project - :png: - pngM8.mcp - Unix - - Library - Debug, TargetOutputFile - - - FileRelative - ../../lib/zlib_PPC.lib - Unix - - PathRelative - Project - :zlib: - zlibM8.mcp - Unix - - Library - Debug, TargetOutputFile - - - FileRelative - ../../lib/tif_PPC.lib - Unix - - PathRelative - Project - :tiff: - tiffM8.mcp - Unix - - Library - Debug, TargetOutputFile - - - PathRelative - Project - :regex: - regexM8.mcp - Unix - Project - - - - FileRelative - ../../lib/regex_PPC.lib - Unix - - PathRelative - Project - :regex: - regexM8.mcp - Unix - - Library - Debug, TargetOutputFile - - - PathRelative - CodeWarrior - :MacOS Support: - Universal/Libraries/StubLibraries/CarbonFrameworkLib - Unix - Library - Debug - - - PathRelative - CodeWarrior - :MacOS Support: - Universal/Libraries/StubLibraries/CarbonLib - Unix - Library - Debug - - - PathRelative - CodeWarrior - :MacOS Support: - MetroNub Utilities/MNU Carbon.Lib - Unix - Library - Debug - - - PathRelative - Project - :mac:carbon: - renderer.cpp - Unix - Text - Debug - - - PathRelative - Project - xml - xml.cpp - Unix - Text - Debug - - - PathRelative - Project - expat/lib - xmlparse.c - Unix - Text - Debug - - - PathRelative - Project - expat/lib - xmlrole.c - Unix - Text - Debug - - - PathRelative - Project - expat/lib - xmltok.c - Unix - Text - Debug - - - PathRelative - Project - ::include: - wx_cwc_d.pch++ - Unix - Text - Debug - - - PathRelative - Project - :common: - accesscmn.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - appbase.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - appcmn.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - artprov.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - artstd.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - bmpbase.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - bookctrl.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - choiccmn.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - clipcmn.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - clntdata.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - cmdline.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - cmdproc.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - cmndata.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - config.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - containr.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - cshelp.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - ctrlcmn.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - ctrlsub.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - datacmn.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - datetime.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - datstrm.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - db.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - dbgrid.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - dbtable.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - dcbase.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - dircmn.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - dlgcmn.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - dndcmn.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - dobjcmn.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - docmdi.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - docview.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - dpycmn.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - dseldlg.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - dynarray.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - dynlib.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - dynload.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - effects.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - encconv.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - event.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - extended.c - Unix - Text - Debug - - - PathRelative - Project - :common: - fddlgcmn.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - ffile.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - file.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - fileconf.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - filefn.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - filename.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - filesys.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - fldlgcmn.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - fmapbase.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - fontcmn.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - fontmap.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - framecmn.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - fs_inet.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - fs_mem.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - fs_zip.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - ftp.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - gaugecmn.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - gdicmn.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - geometry.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - gifdecod.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - hash.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - hashmap.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - helpbase.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - http.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - iconbndl.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - imagall.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - imagbmp.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - image.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - imagfill.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - imaggif.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - imagiff.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - imagjpeg.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - imagpcx.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - imagpng.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - imagpnm.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - imagtiff.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - imagxpm.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - init.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - intl.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - ipcbase.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - layout.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - lboxcmn.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - list.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - log.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - longlong.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - matrix.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - memory.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - menucmn.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - mimecmn.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - module.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - msgout.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - mstream.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - nbkbase.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - object.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - paper.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - popupcmn.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - prntbase.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - process.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - protocol.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - quantize.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - radiocmn.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - regex.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - rendcmn.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - rgncmn.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - sckaddr.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - sckfile.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - sckipc.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - sckstrm.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - settcmn.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - sizer.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - socket.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - statbar.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - stopwatch.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - strconv.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - stream.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - string.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - sysopt.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - taskbarcmn.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - tbarbase.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - textbuf.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - textcmn.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - textfile.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - timercmn.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - tokenzr.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - toplvcmn.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - treebase.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - txtstrm.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - url.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - utilscmn.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - valgen.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - validate.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - valtext.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - variant.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - wfstream.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - wincmn.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - wxchar.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - xpmdecod.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - zipstrm.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - zstream.cpp - Unix - Text - Debug - - - PathRelative - Project - :generic: - busyinfo.cpp - Unix - Text - Debug - - - PathRelative - Project - :generic: - calctrl.cpp - Unix - Text - Debug - - - PathRelative - Project - :generic: - caret.cpp - Unix - Text - Debug - - - PathRelative - Project - :generic: - choicdgg.cpp - Unix - Text - Debug - - - PathRelative - Project - :generic: - colrdlgg.cpp - Unix - Text - Debug - - - PathRelative - Project - :generic: - dcpsg.cpp - Unix - Text - Debug - - - PathRelative - Project - :generic: - dirctrlg.cpp - Unix - Text - Debug - - - PathRelative - Project - :generic: - dirdlgg.cpp - Unix - Text - Debug - - - PathRelative - Project - :generic: - dragimgg.cpp - Unix - Text - Debug - - - PathRelative - Project - :generic: - fdrepdlg.cpp - Unix - Text - Debug - - - PathRelative - Project - :generic: - fontdlgg.cpp - Unix - Text - Debug - - - PathRelative - Project - :generic: - grid.cpp - Unix - Text - Debug - - - PathRelative - Project - :generic: - gridctrl.cpp - Unix - Text - Debug - - - PathRelative - Project - :generic: - gridsel.cpp - Unix - Text - Debug - - - PathRelative - Project - :generic: - laywin.cpp - Unix - Text - Debug - - - PathRelative - Project - :generic: - listctrl.cpp - Unix - Text - Debug - - - PathRelative - Project - :generic: - logg.cpp - Unix - Text - Debug - - - PathRelative - Project - :generic: - numdlgg.cpp - Unix - Text - Debug - - - PathRelative - Project - :generic: - panelg.cpp - Unix - Text - Debug - - - PathRelative - Project - :generic: - printps.cpp - Unix - Text - Debug - - - PathRelative - Project - :generic: - progdlgg.cpp - Unix - Text - Debug - - - PathRelative - Project - :generic: - renderg.cpp - Unix - Text - Debug - - - PathRelative - Project - :generic: - sashwin.cpp - Unix - Text - Debug - - - PathRelative - Project - :generic: - scrlwing.cpp - Unix - Text - Debug - - - PathRelative - Project - :generic: - selstore.cpp - Unix - Text - Debug - - - PathRelative - Project - :generic: - splash.cpp - Unix - Text - Debug - - - PathRelative - Project - :generic: - splitter.cpp - Unix - Text - Debug - - - PathRelative - Project - :generic: - statusbr.cpp - Unix - Text - Debug - - - PathRelative - Project - :generic: - tabg.cpp - Unix - Text - Debug - - - PathRelative - Project - :generic: - textdlgg.cpp - Unix - Text - Debug - - - PathRelative - Project - :generic: - tipdlg.cpp - Unix - Text - Debug - - - PathRelative - Project - :generic: - tipwin.cpp - Unix - Text - Debug - - - PathRelative - Project - :generic: - treectlg.cpp - Unix - Text - Debug - - - PathRelative - Project - :generic: - wizard.cpp - Unix - Text - Debug - - - PathRelative - Project - :mac:carbon: - gsocket.cpp - Unix - Text - Debug - - - PathRelative - Project - :mac:carbon: - morefilex/MoreFilesX.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - stockitem.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_bmp.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_bmpbt.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_bttn.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_cald.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_chckb.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_chckl.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_choic.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_combo.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_dlg.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_frame.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_gauge.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_gdctl.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_html.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_listb.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_listc.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_menu.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_notbk.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_panel.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_radbt.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_radbx.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_scrol.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_scwin.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_sizer.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_slidr.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_spin.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_split.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_statbar.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_stbmp.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_stbox.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_stlin.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_sttxt.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_text.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_tglbtn.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_toolb.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_tree.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_unkwn.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_wizrd.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xmlres.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xmlrsall.cpp - Unix - Text - Debug - - - PathRelative - Project - mac/corefoundation - cfstring.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - uri.cpp - Unix - Text - Debug - - - PathRelative - Project - :mac:carbon: - display.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - archive.cpp - Unix - Text - Debug - - - PathRelative - Project - :generic: - datectlg.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - stdpbase.cpp - Unix - Text - Debug - - - PathRelative - Project - mac/corefoundation - stdpaths_cf.cpp - Unix - Text - Debug - - - PathRelative - Project - :mac:carbon: - imaglist.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_choicbk.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_datectrl.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_listbk.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - gbsizer.cpp - Unix - Text - Debug - - - PathRelative - Project - :generic: - choicbkg.cpp - Unix - Text - Debug - - - PathRelative - Project - :generic: - listbkg.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - debugrpt.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_mdi.cpp - Unix - Text - Debug - - - - - FileRelative - ../../lib/regex_PPC.lib - Unix - - PathRelative - Project - :regex: - regexM8.mcp - Unix - - - - FileRelative - ../../lib/tif_PPC.lib - Unix - - PathRelative - Project - :tiff: - tiffM8.mcp - Unix - - - - FileRelative - ../../lib/zlib_PPC.lib - Unix - - PathRelative - Project - :zlib: - zlibM8.mcp - Unix - - - - FileRelative - ../../lib/png_PPC.lib - Unix - - PathRelative - Project - :png: - pngM8.mcp - Unix - - - - FileRelative - ../../lib/jpeg_PPC.lib - Unix - - PathRelative - Project - :jpeg: - jpegM8.mcp - Unix - - - - PathRelative - Project - :mac:carbon: - :accel.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :app.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :bitmap.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :bmpbuttn.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :brush.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :button.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :checkbox.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :checklst.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :choice.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :clipbrd.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :colordlg.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :colour.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :combobox.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :control.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :cursor.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :data.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :dc.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :dcclient.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :dcmemory.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :dcscreen.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :dialog.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :dirdlg.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :filedlg.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :font.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :fontdlg.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :frame.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :gauge.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :gdiobj.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :icon.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :joystick.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :listbox.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :main.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :mdi.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :menu.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :menuitem.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :minifram.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :msgdlg.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :palette.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :pen.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :printdlg.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :radiobox.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :radiobut.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :region.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :scrolbar.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :settings.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :slider.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :spinbutt.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :statbmp.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :statbox.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :stattext.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :tabctrl.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :textctrl.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :thread.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :timer.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :toolbar.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :utils.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :utilsexc.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :sound.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :window.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :printmac.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :dcprint.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :uma.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :fontutil.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :dataobj.cpp - MacOS - - - PathRelative - Project - :html: - :m_list.cpp - MacOS - - - PathRelative - Project - :html: - :m_tables.cpp - MacOS - - - PathRelative - Project - :html: - :htmlwin.cpp - MacOS - - - PathRelative - Project - :html: - :m_pre.cpp - MacOS - - - PathRelative - Project - :html: - :m_image.cpp - MacOS - - - PathRelative - Project - :html: - :htmprint.cpp - MacOS - - - PathRelative - Project - :html: - :htmlfilt.cpp - MacOS - - - PathRelative - Project - :html: - :htmlpars.cpp - MacOS - - - PathRelative - Project - :html: - :htmltag.cpp - MacOS - - - PathRelative - Project - :html: - :m_hline.cpp - MacOS - - - PathRelative - Project - :html: - :winpars.cpp - MacOS - - - PathRelative - Project - :html: - :htmlcell.cpp - MacOS - - - PathRelative - Project - :html: - :m_layout.cpp - MacOS - - - PathRelative - Project - :html: - :m_fonts.cpp - MacOS - - - PathRelative - Project - :html: - :m_links.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :fontenum.cpp - MacOS - - - Name - metafile.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :macnotfy.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :statbrma.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :tooltip.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :statlmac.cpp - MacOS - - - PathRelative - Project - ::include: - :wx_cwc_d.pch - MacOS - - - PathRelative - Project - :mac:carbon: - :notebmac.cpp - MacOS - - - PathRelative - Project - :html: - :m_dflist.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :dirmac.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :mimetmac.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :spinctrl.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :glcanvas.cpp - MacOS - - - PathRelative - Project - :html: - :helpctrl.cpp - MacOS - - - PathRelative - Project - :html: - :helpfrm.cpp - MacOS - - - PathRelative - Project - :html: - :helpdata.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :toplevel.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :dnd.cpp - MacOS - - - PathRelative - Project - :html: - :m_style.cpp - MacOS - - - PathRelative - CodeWarrior - :MacOS Support: - Universal/Libraries/StubLibraries/CarbonFrameworkLib - Unix - - - PathRelative - CodeWarrior - :MacOS Support: - Universal/Libraries/StubLibraries/CarbonLib - Unix - - - PathRelative - CodeWarrior - :MacOS Support: - MetroNub Utilities/MNU Carbon.Lib - Unix - - - PathRelative - Project - :mac:carbon: - renderer.cpp - Unix - - - PathRelative - Project - xml - xml.cpp - Unix - - - PathRelative - Project - expat/lib - xmlparse.c - Unix - - - PathRelative - Project - expat/lib - xmlrole.c - Unix - - - PathRelative - Project - expat/lib - xmltok.c - Unix - - - PathRelative - Project - ::include: - wx_cwc_d.pch++ - Unix - - - PathRelative - Project - :common: - accesscmn.cpp - Unix - - - PathRelative - Project - :common: - appbase.cpp - Unix - - - PathRelative - Project - :common: - appcmn.cpp - Unix - - - PathRelative - Project - :common: - artprov.cpp - Unix - - - PathRelative - Project - :common: - artstd.cpp - Unix - - - PathRelative - Project - :common: - bmpbase.cpp - Unix - - - PathRelative - Project - :common: - bookctrl.cpp - Unix - - - PathRelative - Project - :common: - choiccmn.cpp - Unix - - - PathRelative - Project - :common: - clipcmn.cpp - Unix - - - PathRelative - Project - :common: - clntdata.cpp - Unix - - - PathRelative - Project - :common: - cmdline.cpp - Unix - - - PathRelative - Project - :common: - cmdproc.cpp - Unix - - - PathRelative - Project - :common: - cmndata.cpp - Unix - - - PathRelative - Project - :common: - config.cpp - Unix - - - PathRelative - Project - :common: - containr.cpp - Unix - - - PathRelative - Project - :common: - cshelp.cpp - Unix - - - PathRelative - Project - :common: - ctrlcmn.cpp - Unix - - - PathRelative - Project - :common: - ctrlsub.cpp - Unix - - - PathRelative - Project - :common: - datacmn.cpp - Unix - - - PathRelative - Project - :common: - datetime.cpp - Unix - - - PathRelative - Project - :common: - datstrm.cpp - Unix - - - PathRelative - Project - :common: - db.cpp - Unix - - - PathRelative - Project - :common: - dbgrid.cpp - Unix - - - PathRelative - Project - :common: - dbtable.cpp - Unix - - - PathRelative - Project - :common: - dcbase.cpp - Unix - - - PathRelative - Project - :common: - dircmn.cpp - Unix - - - PathRelative - Project - :common: - dlgcmn.cpp - Unix - - - PathRelative - Project - :common: - dndcmn.cpp - Unix - - - PathRelative - Project - :common: - dobjcmn.cpp - Unix - - - PathRelative - Project - :common: - docmdi.cpp - Unix - - - PathRelative - Project - :common: - docview.cpp - Unix - - - PathRelative - Project - :common: - dpycmn.cpp - Unix - - - PathRelative - Project - :common: - dseldlg.cpp - Unix - - - PathRelative - Project - :common: - dynarray.cpp - Unix - - - PathRelative - Project - :common: - dynlib.cpp - Unix - - - PathRelative - Project - :common: - dynload.cpp - Unix - - - PathRelative - Project - :common: - effects.cpp - Unix - - - PathRelative - Project - :common: - encconv.cpp - Unix - - - PathRelative - Project - :common: - event.cpp - Unix - - - PathRelative - Project - :common: - extended.c - Unix - - - PathRelative - Project - :common: - fddlgcmn.cpp - Unix - - - PathRelative - Project - :common: - ffile.cpp - Unix - - - PathRelative - Project - :common: - file.cpp - Unix - - - PathRelative - Project - :common: - fileconf.cpp - Unix - - - PathRelative - Project - :common: - filefn.cpp - Unix - - - PathRelative - Project - :common: - filename.cpp - Unix - - - PathRelative - Project - :common: - filesys.cpp - Unix - - - PathRelative - Project - :common: - fldlgcmn.cpp - Unix - - - PathRelative - Project - :common: - fmapbase.cpp - Unix - - - PathRelative - Project - :common: - fontcmn.cpp - Unix - - - PathRelative - Project - :common: - fontmap.cpp - Unix - - - PathRelative - Project - :common: - framecmn.cpp - Unix - - - PathRelative - Project - :common: - fs_inet.cpp - Unix - - - PathRelative - Project - :common: - fs_mem.cpp - Unix - - - PathRelative - Project - :common: - fs_zip.cpp - Unix - - - PathRelative - Project - :common: - ftp.cpp - Unix - - - PathRelative - Project - :common: - gaugecmn.cpp - Unix - - - PathRelative - Project - :common: - gdicmn.cpp - Unix - - - PathRelative - Project - :common: - geometry.cpp - Unix - - - PathRelative - Project - :common: - gifdecod.cpp - Unix - - - PathRelative - Project - :common: - hash.cpp - Unix - - - PathRelative - Project - :common: - hashmap.cpp - Unix - - - PathRelative - Project - :common: - helpbase.cpp - Unix - - - PathRelative - Project - :common: - http.cpp - Unix - - - PathRelative - Project - :common: - iconbndl.cpp - Unix - - - PathRelative - Project - :common: - imagall.cpp - Unix - - - PathRelative - Project - :common: - imagbmp.cpp - Unix - - - PathRelative - Project - :common: - image.cpp - Unix - - - PathRelative - Project - :common: - imagfill.cpp - Unix - - - PathRelative - Project - :common: - imaggif.cpp - Unix - - - PathRelative - Project - :common: - imagiff.cpp - Unix - - - PathRelative - Project - :common: - imagjpeg.cpp - Unix - - - PathRelative - Project - :common: - imagpcx.cpp - Unix - - - PathRelative - Project - :common: - imagpng.cpp - Unix - - - PathRelative - Project - :common: - imagpnm.cpp - Unix - - - PathRelative - Project - :common: - imagtiff.cpp - Unix - - - PathRelative - Project - :common: - imagxpm.cpp - Unix - - - PathRelative - Project - :common: - init.cpp - Unix - - - PathRelative - Project - :common: - intl.cpp - Unix - - - PathRelative - Project - :common: - ipcbase.cpp - Unix - - - PathRelative - Project - :common: - layout.cpp - Unix - - - PathRelative - Project - :common: - lboxcmn.cpp - Unix - - - PathRelative - Project - :common: - list.cpp - Unix - - - PathRelative - Project - :common: - log.cpp - Unix - - - PathRelative - Project - :common: - longlong.cpp - Unix - - - PathRelative - Project - :common: - matrix.cpp - Unix - - - PathRelative - Project - :common: - memory.cpp - Unix - - - PathRelative - Project - :common: - menucmn.cpp - Unix - - - PathRelative - Project - :common: - mimecmn.cpp - Unix - - - PathRelative - Project - :common: - module.cpp - Unix - - - PathRelative - Project - :common: - msgout.cpp - Unix - - - PathRelative - Project - :common: - mstream.cpp - Unix - - - PathRelative - Project - :common: - nbkbase.cpp - Unix - - - PathRelative - Project - :common: - object.cpp - Unix - - - PathRelative - Project - :common: - paper.cpp - Unix - - - PathRelative - Project - :common: - popupcmn.cpp - Unix - - - PathRelative - Project - :common: - prntbase.cpp - Unix - - - PathRelative - Project - :common: - process.cpp - Unix - - - PathRelative - Project - :common: - protocol.cpp - Unix - - - PathRelative - Project - :common: - quantize.cpp - Unix - - - PathRelative - Project - :common: - radiocmn.cpp - Unix - - - PathRelative - Project - :common: - regex.cpp - Unix - - - PathRelative - Project - :common: - rendcmn.cpp - Unix - - - PathRelative - Project - :common: - rgncmn.cpp - Unix - - - PathRelative - Project - :common: - sckaddr.cpp - Unix - - - PathRelative - Project - :common: - sckfile.cpp - Unix - - - PathRelative - Project - :common: - sckipc.cpp - Unix - - - PathRelative - Project - :common: - sckstrm.cpp - Unix - - - PathRelative - Project - :common: - settcmn.cpp - Unix - - - PathRelative - Project - :common: - sizer.cpp - Unix - - - PathRelative - Project - :common: - socket.cpp - Unix - - - PathRelative - Project - :common: - statbar.cpp - Unix - - - PathRelative - Project - :common: - stopwatch.cpp - Unix - - - PathRelative - Project - :common: - strconv.cpp - Unix - - - PathRelative - Project - :common: - stream.cpp - Unix - - - PathRelative - Project - :common: - string.cpp - Unix - - - PathRelative - Project - :common: - sysopt.cpp - Unix - - - PathRelative - Project - :common: - taskbarcmn.cpp - Unix - - - PathRelative - Project - :common: - tbarbase.cpp - Unix - - - PathRelative - Project - :common: - textbuf.cpp - Unix - - - PathRelative - Project - :common: - textcmn.cpp - Unix - - - PathRelative - Project - :common: - textfile.cpp - Unix - - - PathRelative - Project - :common: - timercmn.cpp - Unix - - - PathRelative - Project - :common: - tokenzr.cpp - Unix - - - PathRelative - Project - :common: - toplvcmn.cpp - Unix - - - PathRelative - Project - :common: - treebase.cpp - Unix - - - PathRelative - Project - :common: - txtstrm.cpp - Unix - - - PathRelative - Project - :common: - url.cpp - Unix - - - PathRelative - Project - :common: - utilscmn.cpp - Unix - - - PathRelative - Project - :common: - valgen.cpp - Unix - - - PathRelative - Project - :common: - validate.cpp - Unix - - - PathRelative - Project - :common: - valtext.cpp - Unix - - - PathRelative - Project - :common: - variant.cpp - Unix - - - PathRelative - Project - :common: - wfstream.cpp - Unix - - - PathRelative - Project - :common: - wincmn.cpp - Unix - - - PathRelative - Project - :common: - wxchar.cpp - Unix - - - PathRelative - Project - :common: - xpmdecod.cpp - Unix - - - PathRelative - Project - :common: - zipstrm.cpp - Unix - - - PathRelative - Project - :common: - zstream.cpp - Unix - - - PathRelative - Project - :generic: - busyinfo.cpp - Unix - - - PathRelative - Project - :generic: - calctrl.cpp - Unix - - - PathRelative - Project - :generic: - caret.cpp - Unix - - - PathRelative - Project - :generic: - choicdgg.cpp - Unix - - - PathRelative - Project - :generic: - colrdlgg.cpp - Unix - - - PathRelative - Project - :generic: - dcpsg.cpp - Unix - - - PathRelative - Project - :generic: - dirctrlg.cpp - Unix - - - PathRelative - Project - :generic: - dirdlgg.cpp - Unix - - - PathRelative - Project - :generic: - dragimgg.cpp - Unix - - - PathRelative - Project - :generic: - fdrepdlg.cpp - Unix - - - PathRelative - Project - :generic: - fontdlgg.cpp - Unix - - - PathRelative - Project - :generic: - grid.cpp - Unix - - - PathRelative - Project - :generic: - gridctrl.cpp - Unix - - - PathRelative - Project - :generic: - gridsel.cpp - Unix - - - PathRelative - Project - :generic: - laywin.cpp - Unix - - - PathRelative - Project - :generic: - listctrl.cpp - Unix - - - PathRelative - Project - :generic: - logg.cpp - Unix - - - PathRelative - Project - :generic: - numdlgg.cpp - Unix - - - PathRelative - Project - :generic: - panelg.cpp - Unix - - - PathRelative - Project - :generic: - printps.cpp - Unix - - - PathRelative - Project - :generic: - progdlgg.cpp - Unix - - - PathRelative - Project - :generic: - renderg.cpp - Unix - - - PathRelative - Project - :generic: - sashwin.cpp - Unix - - - PathRelative - Project - :generic: - scrlwing.cpp - Unix - - - PathRelative - Project - :generic: - selstore.cpp - Unix - - - PathRelative - Project - :generic: - splash.cpp - Unix - - - PathRelative - Project - :generic: - splitter.cpp - Unix - - - PathRelative - Project - :generic: - statusbr.cpp - Unix - - - PathRelative - Project - :generic: - tabg.cpp - Unix - - - PathRelative - Project - :generic: - textdlgg.cpp - Unix - - - PathRelative - Project - :generic: - tipdlg.cpp - Unix - - - PathRelative - Project - :generic: - tipwin.cpp - Unix - - - PathRelative - Project - :generic: - treectlg.cpp - Unix - - - PathRelative - Project - :generic: - wizard.cpp - Unix - - - PathRelative - Project - :mac:carbon: - gsocket.cpp - Unix - - - PathRelative - Project - :mac:carbon: - morefilex/MoreFilesX.cpp - Unix - - - PathRelative - Project - :common: - stockitem.cpp - Unix - - - PathRelative - Project - xrc - xh_bmp.cpp - Unix - - - PathRelative - Project - xrc - xh_bmpbt.cpp - Unix - - - PathRelative - Project - xrc - xh_bttn.cpp - Unix - - - PathRelative - Project - xrc - xh_cald.cpp - Unix - - - PathRelative - Project - xrc - xh_chckb.cpp - Unix - - - PathRelative - Project - xrc - xh_chckl.cpp - Unix - - - PathRelative - Project - xrc - xh_choic.cpp - Unix - - - PathRelative - Project - xrc - xh_combo.cpp - Unix - - - PathRelative - Project - xrc - xh_dlg.cpp - Unix - - - PathRelative - Project - xrc - xh_frame.cpp - Unix - - - PathRelative - Project - xrc - xh_gauge.cpp - Unix - - - PathRelative - Project - xrc - xh_gdctl.cpp - Unix - - - PathRelative - Project - xrc - xh_html.cpp - Unix - - - PathRelative - Project - xrc - xh_listb.cpp - Unix - - - PathRelative - Project - xrc - xh_listc.cpp - Unix - - - PathRelative - Project - xrc - xh_menu.cpp - Unix - - - PathRelative - Project - xrc - xh_notbk.cpp - Unix - - - PathRelative - Project - xrc - xh_panel.cpp - Unix - - - PathRelative - Project - xrc - xh_radbt.cpp - Unix - - - PathRelative - Project - xrc - xh_radbx.cpp - Unix - - - PathRelative - Project - xrc - xh_scrol.cpp - Unix - - - PathRelative - Project - xrc - xh_scwin.cpp - Unix - - - PathRelative - Project - xrc - xh_sizer.cpp - Unix - - - PathRelative - Project - xrc - xh_slidr.cpp - Unix - - - PathRelative - Project - xrc - xh_spin.cpp - Unix - - - PathRelative - Project - xrc - xh_split.cpp - Unix - - - PathRelative - Project - xrc - xh_statbar.cpp - Unix - - - PathRelative - Project - xrc - xh_stbmp.cpp - Unix - - - PathRelative - Project - xrc - xh_stbox.cpp - Unix - - - PathRelative - Project - xrc - xh_stlin.cpp - Unix - - - PathRelative - Project - xrc - xh_sttxt.cpp - Unix - - - PathRelative - Project - xrc - xh_text.cpp - Unix - - - PathRelative - Project - xrc - xh_tglbtn.cpp - Unix - - - PathRelative - Project - xrc - xh_toolb.cpp - Unix - - - PathRelative - Project - xrc - xh_tree.cpp - Unix - - - PathRelative - Project - xrc - xh_unkwn.cpp - Unix - - - PathRelative - Project - xrc - xh_wizrd.cpp - Unix - - - PathRelative - Project - xrc - xmlres.cpp - Unix - - - PathRelative - Project - xrc - xmlrsall.cpp - Unix - - - PathRelative - Project - mac/corefoundation - cfstring.cpp - Unix - - - PathRelative - Project - :common: - uri.cpp - Unix - - - PathRelative - Project - :mac:carbon: - display.cpp - Unix - - - PathRelative - Project - :common: - archive.cpp - Unix - - - PathRelative - Project - :generic: - datectlg.cpp - Unix - - - PathRelative - Project - :common: - stdpbase.cpp - Unix - - - PathRelative - Project - mac/corefoundation - stdpaths_cf.cpp - Unix - - - PathRelative - Project - :mac:carbon: - imaglist.cpp - Unix - - - PathRelative - Project - xrc - xh_choicbk.cpp - Unix - - - PathRelative - Project - xrc - xh_datectrl.cpp - Unix - - - PathRelative - Project - xrc - xh_listbk.cpp - Unix - - - PathRelative - Project - :common: - gbsizer.cpp - Unix - - - PathRelative - Project - :generic: - choicbkg.cpp - Unix - - - PathRelative - Project - :generic: - listbkg.cpp - Unix - - - PathRelative - Project - :common: - debugrpt.cpp - Unix - - - PathRelative - Project - xrc - xh_mdi.cpp - Unix - - - - - - PathRelative - Project - :jpeg: - jpegM8.mcp - Unix - - - - PPC - Build, LinkAgainst - - FileRelative - ../../lib/jpeg_PPC.lib - Unix - - PathRelative - Project - :jpeg: - jpegM8.mcp - Unix - - - - - - - - PathRelative - Project - :png: - pngM8.mcp - Unix - - - - PPC - Build, LinkAgainst - - FileRelative - ../../lib/png_PPC.lib - Unix - - PathRelative - Project - :png: - pngM8.mcp - Unix - - - - - - - - PathRelative - Project - :zlib: - zlibM8.mcp - Unix - - - - PPC - Build, LinkAgainst - - FileRelative - ../../lib/zlib_PPC.lib - Unix - - PathRelative - Project - :zlib: - zlibM8.mcp - Unix - - - - - - - - PathRelative - Project - :tiff: - tiffM8.mcp - Unix - - - - PPC - Build, LinkAgainst - - FileRelative - ../../lib/tif_PPC.lib - Unix - - PathRelative - Project - :tiff: - tiffM8.mcp - Unix - - - - - - - - PathRelative - Project - :regex: - regexM8.mcp - Unix - - - - PPC - Build, LinkAgainst - - FileRelative - ../../lib/regex_PPC.lib - Unix - - PathRelative - Project - :regex: - regexM8.mcp - Unix - - - - - - - - - wxlib Carbon release - - - - UserSourceTrees - - - AlwaysSearchUserPathsfalse - InterpretDOSAndUnixPathstrue - RequireFrameworkStyleIncludesfalse - UserSearchPaths - - SearchPath - Path::include: - PathFormatMacOS - PathRootProject - - Recursivefalse - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path::art: - PathFormatMacOS - PathRootProject - - Recursivefalse - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:generic: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:mac:carbon: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:common: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:zlib: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:png: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:jpeg: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:iodbc: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:tiff: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:html: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Pathxml - PathFormatUnix - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Pathexpat/lib - PathFormatUnix - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Pathunix - PathFormatUnix - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Pathxrc - PathFormatUnix - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Pathmac/corefoundation - PathFormatUnix - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SystemSearchPaths - - SearchPath - Path:MSL: - PathFormatMacOS - PathRootCodeWarrior - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:MacOS Support: - PathFormatMacOS - PathRootCodeWarrior - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:regex: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - - - MWRuntimeSettings_WorkingDirectory - MWRuntimeSettings_CommandLine - MWRuntimeSettings_HostApplication - Path - PathFormatGeneric - PathRootAbsolute - - MWRuntimeSettings_EnvVars - - - LinkerMacOS PPC Linker - PreLinker - PostLinker - Targetnamewxlib Carbon release - OutputDirectory - Path::lib: - PathFormatMacOS - PathRootProject - - SaveEntriesUsingRelativePathstrue - - - FileMappings - - FileTypeAPPL - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypeAppl - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypeMMLB - FileExtension - CompilerLib Import PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeMPLF - FileExtension - CompilerLib Import PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeMWCD - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypeRSRC - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.bh - CompilerBalloon Help - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.c - CompilerMW C/C++ PPC - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.c++ - CompilerMW C/C++ PPC - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.cc - CompilerMW C/C++ PPC - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.cp - CompilerMW C/C++ PPC - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.cpp - CompilerMW C/C++ PPC - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.exp - Compiler - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.h - CompilerMW C/C++ PPC - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMaketrue - - - FileTypeTEXT - FileExtension.p - CompilerMW Pascal PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.pas - CompilerMW Pascal PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.pch - CompilerMW C/C++ PPC - EditLanguageC/C++ - Precompiletrue - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.pch++ - CompilerMW C/C++ PPC - EditLanguageC/C++ - Precompiletrue - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.ppu - CompilerMW Pascal PPC - EditLanguage - Precompiletrue - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.r - CompilerRez - EditLanguageRez - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.s - CompilerPPCAsm - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeXCOF - FileExtension - CompilerXCOFF Import PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypedocu - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypersrc - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypeshlb - FileExtension - CompilerPEF Import PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypestub - FileExtension - CompilerPEF Import PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileExtension.doc - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFilefalse - IgnoredByMaketrue - - - FileExtension.o - CompilerXCOFF Import PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileExtension.ppob - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileExtension.rsrc - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - - - CacheModDatestrue - DumpBrowserInfofalse - CacheSubprojectstrue - UseThirdPartyDebuggerfalse - BrowserGenerator0 - DebuggerAppPath - Path - PathFormatGeneric - PathRootAbsolute - - DebuggerCmdLineArgs - DebuggerWorkingDir - Path - PathFormatGeneric - PathRootAbsolute - - CodeCompletionPrefixFileNameMacHeaders.c - CodeCompletionMacroFileNameMacOS_Carbon_C++_Macros.h - - - ConsoleEncoding0 - LogSystemMessagestrue - AutoTargetDLLsfalse - StopAtWatchpointstrue - PauseWhileRunningfalse - PauseInterval5 - PauseUIFlags0 - AltExePath - Path - PathFormatGeneric - PathRootAbsolute - - StopAtTempBPOnLaunchtrue - CacheSymbolicstrue - TempBPFunctionNamemain - TempBPType0 - - - Enabledfalse - ConnectionName - DownloadPath - LaunchRemoteAppfalse - RemoteAppPath - CoreID0 - JTAGClockSpeed8000 - IsMultiCorefalse - OSDownloadfalse - UseGlobalOSDownloadfalse - OSDownloadConnectionName - OSDownloadPath - AltDownloadfalse - AltDownloadConnectionName - - - OtherExecutables - - - CustomColor1 - Red0 - Green32767 - Blue0 - - CustomColor2 - Red0 - Green32767 - Blue0 - - CustomColor3 - Red0 - Green32767 - Blue0 - - CustomColor4 - Red0 - Green32767 - Blue0 - - - - MWFrontEnd_C_cplusplus0 - MWFrontEnd_C_checkprotos0 - MWFrontEnd_C_arm0 - MWFrontEnd_C_trigraphs0 - MWFrontEnd_C_onlystdkeywords0 - MWFrontEnd_C_enumsalwaysint0 - MWFrontEnd_C_mpwpointerstyle0 - MWFrontEnd_C_prefixnamewx/wx_cwc.h - MWFrontEnd_C_ansistrict0 - MWFrontEnd_C_mpwcnewline0 - MWFrontEnd_C_wchar_type1 - MWFrontEnd_C_enableexceptions1 - MWFrontEnd_C_dontreusestrings0 - MWFrontEnd_C_poolstrings0 - MWFrontEnd_C_dontinline0 - MWFrontEnd_C_useRTTI1 - MWFrontEnd_C_multibyteaware0 - MWFrontEnd_C_unsignedchars1 - MWFrontEnd_C_autoinline1 - MWFrontEnd_C_booltruefalse1 - MWFrontEnd_C_inlinelevel0 - MWFrontEnd_C_ecplusplus0 - MWFrontEnd_C_objective_c0 - MWFrontEnd_C_defer_codegen0 - MWFrontEnd_C_templateparser0 - MWFrontEnd_C_c990 - MWFrontEnd_C_bottomupinline1 - - - MWWarning_C_warn_illpragma0 - MWWarning_C_warn_emptydecl0 - MWWarning_C_warn_possunwant0 - MWWarning_C_warn_unusedvar0 - MWWarning_C_warn_unusedarg0 - MWWarning_C_warn_extracomma0 - MWWarning_C_pedantic0 - MWWarning_C_warningerrors0 - MWWarning_C_warn_hidevirtual0 - MWWarning_C_warn_implicitconv0 - MWWarning_C_warn_notinlined0 - MWWarning_C_warn_structclass0 - - - MWFTP_Post_hostName - MWFTP_Post_username - MWFTP_Post_password0ÿÂà -ž0¼,šì - MWFTP_Post_remoteDir - MWFTP_Post_ftp_PathVersion1 - MWFTP_Post_ftp_PathType0 - MWFTP_Post_ftp_PathFormat0 - MWFTP_Post_ftp_tree - MWFTP_Post_uploadDir - MWFTP_Post_ftp_port21 - MWFTP_Post_SendBin1 - MWFTP_Post_ShouldLog1 - - - MWCommandLine_Java_clsName - MWCommandLine_Java_args - - - MWVJavaDebugging_Protocol1 - MWVJavaDebugging_JDKVersion1 - MWVJavaDebugging_TimeOut10 - MWVJavaDebugging_SupportSlowDevicesfalse - MWVJavaDebugging_UseRemoteLaunchAgentfalse - MWVJavaDebugging_LaunchVMasServerfalse - - - MWJava_Language_optimizefalse - MWJava_Language_warnDeprecatedfalse - MWJava_Language_emitMapfalse - MWJava_Language_strictFileNamesfalse - MWJava_Language_strictFileHierarchyfalse - MWJava_Language_1_1_Compatiblefalse - MWJava_Language_emitHeaders0 - MWJava_Language_headerTypeJNINativeHeaders - MWJava_Language_packageFilter - MWJava_Language_genCommentstrue - MWJava_Language_genHeadersfalse - MWJava_Language_enableAssertsfalse - MWJava_Language_targetVM1.1 - - - Manifest-JAD Attributes - - AttributeMain-Class - ValueAuto-Generated - - - - - MWJava_MRJAppBuilder_outFileMRJApplication - MWJava_MRJAppBuilder_mergefalse - MWJava_MRJAppBuilder_quitMenutrue - MWJava_MRJAppBuilder_growfalse - MWJava_MRJAppBuilder_stdoutTypeConsole - MWJava_MRJAppBuilder_stderrTypeConsole - MWJava_MRJAppBuilder_stdinTypeConsole - MWJava_MRJAppBuilder_appIconPVersion0 - MWJava_MRJAppBuilder_appIconPType0 - MWJava_MRJAppBuilder_appIconPFormat0 - MWJava_MRJAppBuilder_appIconPTree - MWJava_MRJAppBuilder_appIconFile - MWJava_MRJAppBuilder_splashScreenPVersion0 - MWJava_MRJAppBuilder_splashScreenPType0 - MWJava_MRJAppBuilder_splashScreenPFormat0 - MWJava_MRJAppBuilder_splashScreenPTree - MWJava_MRJAppBuilder_splashScreenPICTFile - MWJava_MRJAppBuilder_aboutName - MWJava_MRJAppBuilder_stdoutPVersion0 - MWJava_MRJAppBuilder_stdoutPType0 - MWJava_MRJAppBuilder_stdoutPFormat0 - MWJava_MRJAppBuilder_stdoutPTree - MWJava_MRJAppBuilder_stdoutFile - MWJava_MRJAppBuilder_stdoutAppendfalse - MWJava_MRJAppBuilder_stderrPType0 - MWJava_MRJAppBuilder_stderrPFormat0 - MWJava_MRJAppBuilder_stderrPTree - MWJava_MRJAppBuilder_stderrFile - MWJava_MRJAppBuilder_stderrAppendfalse - MWJava_MRJAppBuilder_stdinPType0 - MWJava_MRJAppBuilder_stdinPFormat0 - MWJava_MRJAppBuilder_stdinPTree - MWJava_MRJAppBuilder_stdinFile - - - MWJava_Output_outputtypeJarFile - MWJava_Output_outfileJavaClasses.jar - MWJava_Output_ftype1514754080 - MWJava_Output_fcreator1297570384 - MWJava_Output_compress0 - MWJava_Output_genManifest0 - MWJava_Output_trunctypeFront - MWJava_Output_deleteClasses0 - MWJava_Output_consoleApp1 - MWJava_Output_preverify0 - MWJava_Output_genJad0 - MWJava_Output_obfuscate0 - - - MWJava_Proj_projtypeApplet - MWJava_Proj_mainClassName - MWJava_Proj_HTMLAppCreator1145457748 - MWJava_Proj_HTMLAppNameMetrowerks Java - MWJava_Proj_PathVersion1 - MWJava_Proj_PathType0 - MWJava_Proj_PathFormat0 - MWJava_Proj_tree - MWJava_Proj_HTMLAppWin32NameInternet Explorer - MWJava_Proj_compress0 - MWJava_Proj_simulator0 - MWJava_Proj_useVM\000\000macosx - MWJava_Proj_vmarguments - MWJava_Proj_vmName - MWJava_Proj_simPropFile - - - MWJavaDoc_Proj_Version1 - MWJavaDoc_Proj_Deprecated1 - MWJavaDoc_Proj_Author1 - MWJavaDoc_Proj_Index1 - MWJavaDoc_Proj_Tree1 - MWJavaDoc_Proj_SunResolveToSame0 - MWJavaDoc_Proj_Shortnames1 - MWJavaDoc_Proj_Folder0 - MWJavaDoc_Proj_GenerateAPILinks0 - MWJavaDoc_Proj_scopePublic - MWJavaDoc_Proj_fcreator1297303877 - MWJavaDoc_Proj_encodingName - MWJavaDoc_Proj_decodingName - MWJavaDoc_Proj_javaPackagePathhttp://java.sun.com/products/jdk/1.1/docs/api/ - - - MWMerge_MacOS_projectTypeApplication - MWMerge_MacOS_outputNameMerge Out - MWMerge_MacOS_outputCreator???? - MWMerge_MacOS_outputTypeAPPL - MWMerge_MacOS_suppressWarning0 - MWMerge_MacOS_copyFragments1 - MWMerge_MacOS_copyResources1 - MWMerge_MacOS_flattenResource0 - MWMerge_MacOS_flatFileNamea.rsrc - MWMerge_MacOS_flatFileOutputPath - Path: - PathFormatMacOS - PathRootProject - - MWMerge_MacOS_skipResources - DLGX - ckid - Proj - WSPC - - - - FileLockedfalse - ResourcesMapIsReadOnlyfalse - PrinterDriverIsMultiFinderCompatiblefalse - Invisiblefalse - HasBundlefalse - NameLockedfalse - Stationeryfalse - HasCustomIconfalse - Sharedfalse - HasBeenInitedfalse - Label0 - Comments - - - MWMacOSPackager_UsePackager0 - MWMacOSPackager_FolderToPackage - Path - PathFormatMacOS - PathRootAbsolute - - MWMacOSPackager_CreateClassicAlias0 - MWMacOSPackager_ClassicAliasMethodUseTargetOutput - MWMacOSPackager_ClassicAliasPath - Path - PathFormatMacOS - PathRootAbsolute - - MWMacOSPackager_CreatePkgInfo0 - MWMacOSPackager_PkgCreatorType???? - MWMacOSPackager_PkgFileTypeAPPL - - - MWCodeGen_PPC_structalignmentPPC_mw - MWCodeGen_PPC_tracebacktablesInline - MWCodeGen_PPC_processorGeneric - MWCodeGen_PPC_function_align4 - MWCodeGen_PPC_tocdata1 - MWCodeGen_PPC_largetoc0 - MWCodeGen_PPC_profiler0 - MWCodeGen_PPC_vectortocdata0 - MWCodeGen_PPC_poolconst0 - MWCodeGen_PPC_peephole1 - MWCodeGen_PPC_readonlystrings0 - MWCodeGen_PPC_linkerpoolsstrings0 - MWCodeGen_PPC_volatileasm0 - MWCodeGen_PPC_schedule0 - MWCodeGen_PPC_altivec0 - MWCodeGen_PPC_altivec_move_block0 - MWCodeGen_PPC_strictIEEEfp0 - MWCodeGen_PPC_fpcontract1 - MWCodeGen_PPC_genfsel0 - MWCodeGen_PPC_orderedfpcmp0 - - - MWCodeGen_MachO_structalignmentPPC_mw - MWCodeGen_MachO_profiler_enumOff - MWCodeGen_MachO_processorGeneric - MWCodeGen_MachO_function_align4 - MWCodeGen_MachO_common0 - MWCodeGen_MachO_peephole1 - MWCodeGen_MachO_readonlystrings0 - MWCodeGen_MachO_linkerpoolsstrings1 - MWCodeGen_MachO_volatileasm0 - MWCodeGen_MachO_schedule0 - MWCodeGen_MachO_altivec0 - MWCodeGen_MachO_vecmove0 - MWCodeGen_MachO_fp_ieee_strict0 - MWCodeGen_MachO_fpcontract1 - MWCodeGen_MachO_genfsel0 - MWCodeGen_MachO_fp_cmps_ordered0 - - - MWDisassembler_PPC_showcode1 - MWDisassembler_PPC_extended1 - MWDisassembler_PPC_mix0 - MWDisassembler_PPC_nohex0 - MWDisassembler_PPC_showdata1 - MWDisassembler_PPC_showexceptions1 - MWDisassembler_PPC_showsym0 - MWDisassembler_PPC_shownames1 - - - GlobalOptimizer_PPC_optimizationlevelLevel4 - GlobalOptimizer_PPC_optforSpeed - - - MWLinker_PPC_linksym0 - MWLinker_PPC_symfullpath1 - MWLinker_PPC_linkmap0 - MWLinker_PPC_nolinkwarnings0 - MWLinker_PPC_dontdeadstripinitcode1 - MWLinker_PPC_permitmultdefs0 - MWLinker_PPC_linkmodeFast - MWLinker_PPC_initname - MWLinker_PPC_mainname__start - MWLinker_PPC_termname - - - MWLinker_MacOSX_linksym0 - MWLinker_MacOSX_symfullpath0 - MWLinker_MacOSX_nolinkwarnings0 - MWLinker_MacOSX_linkmap0 - MWLinker_MacOSX_dontdeadstripinitcode0 - MWLinker_MacOSX_permitmultdefs1 - MWLinker_MacOSX_use_objectivec_semantics0 - MWLinker_MacOSX_strip_debug_symbols0 - MWLinker_MacOSX_split_segs0 - MWLinker_MacOSX_report_msl_overloads0 - MWLinker_MacOSX_objects_follow_linkorder0 - MWLinker_MacOSX_linkmodeFast - MWLinker_MacOSX_exportsReferencedGlobals - MWLinker_MacOSX_sortcodeNone - MWLinker_MacOSX_mainnamestart - - - MWProject_MacOSX_typeLibrary - MWProject_MacOSX_outfilewx_CARBON.lib - MWProject_MacOSX_filecreator???? - MWProject_MacOSX_filetype???? - MWProject_MacOSX_vmaddress0 - MWProject_MacOSX_usedefaultvmaddr1 - MWProject_MacOSX_flatrsrc0 - MWProject_MacOSX_flatrsrcfilename - MWProject_MacOSX_flatrsrcoutputdir - Path: - PathFormatMacOS - PathRootProject - - MWProject_MacOSX_installpath./ - MWProject_MacOSX_dont_prebind0 - MWProject_MacOSX_flat_namespace0 - MWProject_MacOSX_frameworkversionA - MWProject_MacOSX_currentversion0 - MWProject_MacOSX_flat_oldimpversion0 - - - MWLinker_MachO_exportsNone - MWLinker_MachO_mainnamestart - MWLinker_MachO_currentversion0 - MWLinker_MachO_compatibleversion0 - MWLinker_MachO_symfullpath0 - MWLinker_MachO_supresswarnings0 - MWLinker_MachO_multisymerror0 - MWLinker_MachO_prebind1 - MWLinker_MachO_deadstrip1 - MWLinker_MachO_objectivecsemantics0 - MWLinker_MachO_whichfileloaded0 - MWLinker_MachO_whyfileloaded0 - MWLinker_MachO_readonlyrelocsErrors - MWLinker_MachO_undefinedsymbolsErrors - MWLinker_MachO_twolevelnamespace1 - MWLinker_MachO_stripdebugsymbols0 - - - MWProject_MachO_typeExecutable - MWProject_MachO_outfilea.exe - MWProject_MachO_filecreator???? - MWProject_MachO_filetypeMEXE - MWProject_MachO_vmaddress4096 - MWProject_MachO_flatrsrc1 - MWProject_MachO_flatrsrcfilenamea.rsrc - MWProject_MachO_flatrsrcoutputdir - Path: - PathFormatMacOS - PathRootProject - - MWProject_MachO_installpath./ - MWProject_MachO_frameworkversion - - - MWPEF_exportsAll - MWPEF_libfolder0 - MWPEF_sortcodeNone - MWPEF_expandbss0 - MWPEF_sharedata0 - MWPEF_olddefversion0 - MWPEF_oldimpversion0 - MWPEF_currentversion0 - MWPEF_fragmentnamewxwin - MWPEF_collapsereloads0 - - - MWProject_PPC_typeLibrary - MWProject_PPC_outfilewx_CARBON.lib - MWProject_PPC_filecreator???? - MWProject_PPC_filetype???? - MWProject_PPC_size0 - MWProject_PPC_minsize0 - MWProject_PPC_stacksize0 - MWProject_PPC_flags0 - MWProject_PPC_symfilename - MWProject_PPC_rsrcname - MWProject_PPC_rsrcheaderNative - MWProject_PPC_rsrctype???? - MWProject_PPC_rsrcid0 - MWProject_PPC_rsrcflags0 - MWProject_PPC_rsrcstore0 - MWProject_PPC_rsrcmerge0 - MWProject_PPC_flatrsrc0 - MWProject_PPC_flatrsrcoutputdir - Path: - PathFormatMacOS - PathRootProject - - MWProject_PPC_flatrsrcfilename - - - MWAssembler_PPC_auxheader0 - MWAssembler_PPC_symmodeMac - MWAssembler_PPC_dialectPPC - MWAssembler_PPC_prefixfile - MWAssembler_PPC_typecheck0 - MWAssembler_PPC_warnings0 - MWAssembler_PPC_casesensitive0 - - - PList_OutputTypeFile - PList_OutputEncodingUTF-8 - PList_Prefix - PList_FileFilenameInfo.plist - PList_FileDirectory - Path: - PathFormatMacOS - PathRootProject - - PList_ResourceTypeplst - PList_ResourceID0 - PList_ResourceName - - - MWRez_Language_maxwidth80 - MWRez_Language_scriptRoman - MWRez_Language_alignmentAlign1 - MWRez_Language_filtermodeFilterSkip - MWRez_Language_suppresswarnings0 - MWRez_Language_escapecontrolchars1 - MWRez_Language_prefixname - MWRez_Language_filteredtypes'CODE' 'DATA' 'PICT' - - - MWWinRC_prefixname - - - MWCodeGen_X86_processorGeneric - MWCodeGen_X86_alignmentbytes8 - MWCodeGen_X86_exceptionsZeroOverhead - MWCodeGen_X86_name_manglingMWWin32 - MWCodeGen_X86_use_extinst0 - MWCodeGen_X86_extinst_mmx0 - MWCodeGen_X86_extinst_3dnow0 - MWCodeGen_X86_use_mmx_3dnow_convention0 - MWCodeGen_X86_extinst_cmov0 - MWCodeGen_X86_extinst_sse0 - MWCodeGen_X86_extinst_sse20 - MWCodeGen_X86_intrinsics0 - MWCodeGen_X86_optimizeasm0 - MWCodeGen_X86_disableopts0 - MWCodeGen_X86_profile0 - MWLinker_X86_runtimeCustom - MWCodeGen_X86_readonlystrings0 - - - MWLinker_X86_subsysmajorid4 - MWLinker_X86_subsysminorid0 - MWCOFF_X86_opsysmajorid4 - MWCOFF_X86_opsysminorid0 - MWLinker_X86_usrmajorid0 - MWLinker_X86_usrminorid0 - MWProject_X86_maxstacksize1024 - MWProject_X86_minstacksize4 - MWProject_X86_size1024 - MWProject_X86_minsize4 - MWCOFF_X86_coff_flags0 - MWCOFF_X86_dll_flags0 - MWProject_X86_baseaddress4194304 - MWCOFF_X86_filealign512 - MWCOFF_X86_sectionalign4096 - - - PDisasmX86_showHeaderstrue - PDisasmX86_showSectHeaderstrue - PDisasmX86_showSymTabtrue - PDisasmX86_showCodetrue - PDisasmX86_showDatatrue - PDisasmX86_showDebugfalse - PDisasmX86_showExceptionsfalse - PDisasmX86_showRawfalse - PDisasmX86_showAllRawfalse - PDisasmX86_showSourcefalse - PDisasmX86_showRelocationtrue - PDisasmX86_showHextrue - PDisasmX86_showCommentsfalse - PDisasmX86_showSymDefstrue - PDisasmX86_unmanglefalse - PDisasmX86_verbosefalse - PDisasmX86_resolveRelocstrue - PDisasmX86_resolveLocalsfalse - - - MWDebugger_X86_Exceptions - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - - - - GlobalOptimizer_X86_optimizationlevelLevel0 - GlobalOptimizer_X86_optforSpeed - - - MWLinker_X86_entrypointusageDefault - MWLinker_X86_entrypoint - MWLinker_X86_subsystemWinGUI - MWLinker_X86_commandfile - MWLinker_X86_generatemap0 - MWLinker_X86_linksym1 - MWLinker_X86_linkCV1 - MWLinker_X86_symfullpathfalse - MWLinker_X86_linkdebugtrue - MWLinker_X86_checksumfalse - MWLinker_X86_zero_init_bssfalse - MWLinker_X86_mergedatafalse - MWLinker_X86_usedefaultlibsfalse - MWLinker_X86_adddefaultlibsfalse - MWLinker_X86_nowarningsfalse - MWLinker_X86_verbosefalse - - - MWProject_X86_typeLibrary - MWProject_X86_outfilewx_x86_d.lib - MWProject_X86_importlib - MWProject_X86_setimportlibdirfalse - MWProject_X86_dontgenerateimportlibfalse - MWProject_X86_oldformatlibfalse - MWProject_X86_replaceobjextensionfalse - MWProject_X86_copyallfilesfalse - - - - PathRelative - Project - :mac:carbon: - :accel.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :app.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :bitmap.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :bmpbuttn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :brush.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :button.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :checkbox.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :checklst.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :choice.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :clipbrd.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :colordlg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :colour.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :combobox.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :control.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :cursor.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :data.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :dc.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :dcclient.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :dcmemory.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :dcscreen.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :dialog.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :dirdlg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :filedlg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :font.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :fontdlg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :frame.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :gauge.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :gdiobj.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :icon.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :joystick.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :listbox.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :main.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :mdi.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :menu.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :menuitem.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :minifram.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :msgdlg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :palette.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :pen.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :printdlg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :radiobox.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :radiobut.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :region.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :scrolbar.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :settings.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :slider.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :spinbutt.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :statbmp.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :statbox.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :stattext.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :tabctrl.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :textctrl.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :thread.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :timer.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :toolbar.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :utils.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :utilsexc.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :sound.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :window.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :printmac.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :dcprint.cpp - MacOS - Text - - - - PathRelative - Project - :mac:carbon: - :uma.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :sckipc.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :matrix.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :tbarbase.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :imagjpeg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :longlong.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :docmdi.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :appcmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :utilscmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :dynlib.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :extended.c - MacOS - Text - Debug - - - PathRelative - Project - :common: - :sckstrm.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :zstream.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :process.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :docview.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :sizer.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :dobjcmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :imagall.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :imaggif.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :imagpcx.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :cmndata.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :ftp.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :menucmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :string.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :wfstream.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :stream.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :gdicmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :protocol.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :layout.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :valgen.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :intl.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :list.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :socket.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :hash.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :dlgcmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :gifdecod.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :filefn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :wincmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :wxchar.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :memory.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :mstream.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :lboxcmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :fs_inet.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :event.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :image.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :ipcbase.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :tokenzr.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :txtstrm.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :filesys.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :url.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :fs_zip.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :prntbase.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :dcbase.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :object.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :http.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :module.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :validate.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :file.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :config.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :fileconf.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :timercmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :framecmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :textfile.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :dynarray.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :choiccmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :helpbase.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :db.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :ctrlsub.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :ctrlcmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :strconv.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :sckfile.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :valtext.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :datstrm.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :sckaddr.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :variant.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :dbtable.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :fontcmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :ffile.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :paper.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :clipcmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :imagpnm.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :imagpng.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :imagbmp.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :zipstrm.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :log.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :textcmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :laywin.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :busyinfo.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :listctrl.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :textdlgg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :numdlgg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :sashwin.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :dcpsg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :panelg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :tabg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :choicdgg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :wizard.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :progdlgg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :caret.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :statusbr.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :logg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :fontdlgg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :splitter.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :fontmap.cpp - MacOS - Text - Debug - - - Name - tipdlg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :geometry.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :fontutil.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :dataobj.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :m_list.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :m_tables.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :htmlwin.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :m_pre.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :m_image.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :htmprint.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :htmlfilt.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :htmlpars.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :htmltag.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :m_hline.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :winpars.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :htmlcell.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :m_layout.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :m_fonts.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :m_links.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :fontenum.cpp - MacOS - Text - Debug - - - Name - colrdlgg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :datetime.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :encconv.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :mimecmn.cpp - MacOS - Text - Debug - - - Name - metafile.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :macnotfy.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :statbrma.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :tooltip.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :statlmac.cpp - MacOS - Text - Debug - - - PathRelative - Project - ::include: - :wx_cwc.pch++ - MacOS - Text - Debug - - - PathRelative - Project - ::include: - :wx_cwc.pch - MacOS - Text - Debug - - - PathRelative - Project - :common: - :imagtiff.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :treectlg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :notebmac.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :m_dflist.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :treebase.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :cshelp.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :dirmac.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :mimetmac.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :filename.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :spinctrl.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :glcanvas.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :xpmdecod.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :imagxpm.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :dirctrlg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :helpctrl.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :helpfrm.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :helpdata.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :tipwin.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :radiocmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :nbkbase.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :scrlwing.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :gaugecmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :containr.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :quantize.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :toplvcmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :toplevel.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :gridsel.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :grid.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :statbar.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :clntdata.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :textbuf.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :dragimgg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :calctrl.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :bmpbase.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :cmdline.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :cmdproc.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :dndcmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :dnd.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :dbgrid.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :dircmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :dseldlg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :dynload.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :effects.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :fddlgcmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :fs_mem.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :regex.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :sysopt.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :imagiff.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :splash.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :fdrepdlg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :gridctrl.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :m_style.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :hashmap.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :dirdlgg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :iconbndl.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :artprov.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :artstd.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :imagfill.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :msgout.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :settcmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :popupcmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :printps.cpp - MacOS - Text - Debug - - - PathRelative - Project - :jpeg: - jpegM8.mcp - Unix - Project - - - - PathRelative - Project - :png: - pngM8.mcp - Unix - Project - - - - PathRelative - Project - :tiff: - tiffM8.mcp - Unix - Project - - - - PathRelative - Project - :zlib: - zlibM8.mcp - Unix - Project - - - - FileRelative - ../../lib/jpeg_PPC.lib - Unix - - PathRelative - Project - :jpeg: - jpegM8.mcp - Unix - - Library - Debug, TargetOutputFile - - - FileRelative - ../../lib/png_PPC.lib - Unix - - PathRelative - Project - :png: - pngM8.mcp - Unix - - Library - Debug, TargetOutputFile - - - FileRelative - ../../lib/tif_PPC.lib - Unix - - PathRelative - Project - :tiff: - tiffM8.mcp - Unix - - Library - Debug, TargetOutputFile - - - FileRelative - ../../lib/zlib_PPC.lib - Unix - - PathRelative - Project - :zlib: - zlibM8.mcp - Unix - - Library - Debug, TargetOutputFile - - - PathRelative - Project - :regex: - regexM8.mcp - Unix - Project - - - - FileRelative - ../../lib/regex_PPC.lib - Unix - - PathRelative - Project - :regex: - regexM8.mcp - Unix - - Library - Debug, TargetOutputFile - - - PathRelative - Project - :common: - datacmn.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - rgncmn.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - accesscmn.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - dpycmn.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - taskbarcmn.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - fldlgcmn.cpp - Unix - Text - Debug - - - PathRelative - Project - :generic: - :selstore.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - appbase.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - fmapbase.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - stopwatch.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - init.cpp - Unix - Text - Debug - - - PathRelative - CodeWarrior - :MacOS Support: - Universal/Libraries/StubLibraries/CarbonFrameworkLib - Unix - Library - Debug - - - PathRelative - CodeWarrior - :MacOS Support: - Universal/Libraries/StubLibraries/CarbonLib - Unix - Library - Debug - - - PathRelative - Project - :generic: - renderg.cpp - Unix - Text - Debug - - - PathRelative - Project - :mac:carbon: - renderer.cpp - Unix - Text - Debug - - - PathRelative - Project - xml - xml.cpp - Unix - Text - Debug - - - PathRelative - Project - expat/lib - xmlparse.c - Unix - Text - Debug - - - PathRelative - Project - expat/lib - xmlrole.c - Unix - Text - Debug - - - PathRelative - Project - expat/lib - xmltok.c - Unix - Text - Debug - - - PathRelative - Project - :common: - rendcmn.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - bookctrl.cpp - Unix - Text - Debug - - - PathRelative - Project - :mac:carbon: - gsocket.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - stockitem.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_bmp.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_bmpbt.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_bttn.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_cald.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_chckb.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_chckl.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_choic.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_combo.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_dlg.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_frame.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_gauge.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_gdctl.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_html.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_listb.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_listc.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_menu.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_notbk.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_panel.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_radbt.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_radbx.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_scrol.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_scwin.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_sizer.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_slidr.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_spin.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_split.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_statbar.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_stbmp.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_stbox.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_stlin.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_sttxt.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_text.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_tglbtn.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_toolb.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_tree.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_unkwn.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_wizrd.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xmlres.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xmlrsall.cpp - Unix - Text - Debug - - - PathRelative - Project - mac/corefoundation - cfstring.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - uri.cpp - Unix - Text - Debug - - - PathRelative - Project - :mac:carbon: - display.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - archive.cpp - Unix - Text - Debug - - - PathRelative - Project - :generic: - datectlg.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - stdpbase.cpp - Unix - Text - Debug - - - PathRelative - Project - mac/corefoundation - stdpaths_cf.cpp - Unix - Text - Debug - - - PathRelative - Project - :mac:carbon: - imaglist.cpp - Unix - Text - Debug - - - PathRelative - Project - :mac:carbon: - morefilex/MoreFilesX.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_choicbk.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_datectrl.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_listbk.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - gbsizer.cpp - Unix - Text - Debug - - - PathRelative - Project - :generic: - choicbkg.cpp - Unix - Text - Debug - - - PathRelative - Project - :generic: - listbkg.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - debugrpt.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_mdi.cpp - Unix - Text - Debug - - - - - FileRelative - ../../lib/regex_PPC.lib - Unix - - PathRelative - Project - :regex: - regexM8.mcp - Unix - - - - FileRelative - ../../lib/zlib_PPC.lib - Unix - - PathRelative - Project - :zlib: - zlibM8.mcp - Unix - - - - FileRelative - ../../lib/tif_PPC.lib - Unix - - PathRelative - Project - :tiff: - tiffM8.mcp - Unix - - - - FileRelative - ../../lib/png_PPC.lib - Unix - - PathRelative - Project - :png: - pngM8.mcp - Unix - - - - FileRelative - ../../lib/jpeg_PPC.lib - Unix - - PathRelative - Project - :jpeg: - jpegM8.mcp - Unix - - - - PathRelative - Project - :mac:carbon: - :accel.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :app.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :bitmap.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :bmpbuttn.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :brush.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :button.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :checkbox.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :checklst.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :choice.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :clipbrd.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :colordlg.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :colour.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :combobox.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :control.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :cursor.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :data.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :dc.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :dcclient.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :dcmemory.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :dcscreen.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :dialog.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :dirdlg.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :filedlg.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :font.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :fontdlg.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :frame.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :gauge.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :gdiobj.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :icon.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :joystick.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :listbox.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :main.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :mdi.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :menu.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :menuitem.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :minifram.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :msgdlg.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :palette.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :pen.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :printdlg.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :radiobox.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :radiobut.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :region.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :scrolbar.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :settings.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :slider.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :spinbutt.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :statbmp.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :statbox.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :stattext.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :tabctrl.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :textctrl.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :thread.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :timer.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :toolbar.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :utils.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :utilsexc.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :sound.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :window.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :printmac.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :dcprint.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :uma.cpp - MacOS - - - PathRelative - Project - :common: - :sckipc.cpp - MacOS - - - PathRelative - Project - :common: - :matrix.cpp - MacOS - - - PathRelative - Project - :common: - :tbarbase.cpp - MacOS - - - PathRelative - Project - :common: - :imagjpeg.cpp - MacOS - - - PathRelative - Project - :common: - :longlong.cpp - MacOS - - - PathRelative - Project - :common: - :docmdi.cpp - MacOS - - - PathRelative - Project - :common: - :appcmn.cpp - MacOS - - - PathRelative - Project - :common: - :utilscmn.cpp - MacOS - - - PathRelative - Project - :common: - :dynlib.cpp - MacOS - - - PathRelative - Project - :common: - :extended.c - MacOS - - - PathRelative - Project - :common: - :sckstrm.cpp - MacOS - - - PathRelative - Project - :common: - :zstream.cpp - MacOS - - - PathRelative - Project - :common: - :process.cpp - MacOS - - - PathRelative - Project - :common: - :docview.cpp - MacOS - - - PathRelative - Project - :common: - :sizer.cpp - MacOS - - - PathRelative - Project - :common: - :dobjcmn.cpp - MacOS - - - PathRelative - Project - :common: - :imagall.cpp - MacOS - - - PathRelative - Project - :common: - :imaggif.cpp - MacOS - - - PathRelative - Project - :common: - :imagpcx.cpp - MacOS - - - PathRelative - Project - :common: - :cmndata.cpp - MacOS - - - PathRelative - Project - :common: - :ftp.cpp - MacOS - - - PathRelative - Project - :common: - :menucmn.cpp - MacOS - - - PathRelative - Project - :common: - :string.cpp - MacOS - - - PathRelative - Project - :common: - :wfstream.cpp - MacOS - - - PathRelative - Project - :common: - :stream.cpp - MacOS - - - PathRelative - Project - :common: - :gdicmn.cpp - MacOS - - - PathRelative - Project - :common: - :protocol.cpp - MacOS - - - PathRelative - Project - :common: - :layout.cpp - MacOS - - - PathRelative - Project - :common: - :valgen.cpp - MacOS - - - PathRelative - Project - :common: - :intl.cpp - MacOS - - - PathRelative - Project - :common: - :list.cpp - MacOS - - - PathRelative - Project - :common: - :socket.cpp - MacOS - - - PathRelative - Project - :common: - :hash.cpp - MacOS - - - PathRelative - Project - :common: - :dlgcmn.cpp - MacOS - - - PathRelative - Project - :common: - :gifdecod.cpp - MacOS - - - PathRelative - Project - :common: - :filefn.cpp - MacOS - - - PathRelative - Project - :common: - :wincmn.cpp - MacOS - - - PathRelative - Project - :common: - :wxchar.cpp - MacOS - - - PathRelative - Project - :common: - :memory.cpp - MacOS - - - PathRelative - Project - :common: - :mstream.cpp - MacOS - - - PathRelative - Project - :common: - :lboxcmn.cpp - MacOS - - - PathRelative - Project - :common: - :fs_inet.cpp - MacOS - - - PathRelative - Project - :common: - :event.cpp - MacOS - - - PathRelative - Project - :common: - :image.cpp - MacOS - - - PathRelative - Project - :common: - :ipcbase.cpp - MacOS - - - PathRelative - Project - :common: - :tokenzr.cpp - MacOS - - - PathRelative - Project - :common: - :txtstrm.cpp - MacOS - - - PathRelative - Project - :common: - :filesys.cpp - MacOS - - - PathRelative - Project - :common: - :url.cpp - MacOS - - - PathRelative - Project - :common: - :fs_zip.cpp - MacOS - - - PathRelative - Project - :common: - :prntbase.cpp - MacOS - - - PathRelative - Project - :common: - :dcbase.cpp - MacOS - - - PathRelative - Project - :common: - :object.cpp - MacOS - - - PathRelative - Project - :common: - :http.cpp - MacOS - - - PathRelative - Project - :common: - :module.cpp - MacOS - - - PathRelative - Project - :common: - :validate.cpp - MacOS - - - PathRelative - Project - :common: - :file.cpp - MacOS - - - PathRelative - Project - :common: - :config.cpp - MacOS - - - PathRelative - Project - :common: - :fileconf.cpp - MacOS - - - PathRelative - Project - :common: - :timercmn.cpp - MacOS - - - PathRelative - Project - :common: - :framecmn.cpp - MacOS - - - PathRelative - Project - :common: - :textfile.cpp - MacOS - - - PathRelative - Project - :common: - :dynarray.cpp - MacOS - - - PathRelative - Project - :common: - :choiccmn.cpp - MacOS - - - PathRelative - Project - :common: - :helpbase.cpp - MacOS - - - PathRelative - Project - :common: - :db.cpp - MacOS - - - PathRelative - Project - :common: - :ctrlsub.cpp - MacOS - - - PathRelative - Project - :common: - :ctrlcmn.cpp - MacOS - - - PathRelative - Project - :common: - :strconv.cpp - MacOS - - - PathRelative - Project - :common: - :sckfile.cpp - MacOS - - - PathRelative - Project - :common: - :valtext.cpp - MacOS - - - PathRelative - Project - :common: - :datstrm.cpp - MacOS - - - PathRelative - Project - :common: - :sckaddr.cpp - MacOS - - - PathRelative - Project - :common: - :variant.cpp - MacOS - - - PathRelative - Project - :common: - :dbtable.cpp - MacOS - - - PathRelative - Project - :common: - :fontcmn.cpp - MacOS - - - PathRelative - Project - :common: - :ffile.cpp - MacOS - - - PathRelative - Project - :common: - :paper.cpp - MacOS - - - PathRelative - Project - :common: - :clipcmn.cpp - MacOS - - - PathRelative - Project - :common: - :imagpnm.cpp - MacOS - - - PathRelative - Project - :common: - :imagpng.cpp - MacOS - - - PathRelative - Project - :common: - :imagbmp.cpp - MacOS - - - PathRelative - Project - :common: - :zipstrm.cpp - MacOS - - - PathRelative - Project - :common: - :log.cpp - MacOS - - - PathRelative - Project - :common: - :textcmn.cpp - MacOS - - - PathRelative - Project - :generic: - :laywin.cpp - MacOS - - - PathRelative - Project - :generic: - :busyinfo.cpp - MacOS - - - PathRelative - Project - :generic: - :listctrl.cpp - MacOS - - - PathRelative - Project - :generic: - :textdlgg.cpp - MacOS - - - PathRelative - Project - :generic: - :numdlgg.cpp - MacOS - - - PathRelative - Project - :generic: - :sashwin.cpp - MacOS - - - PathRelative - Project - :generic: - :dcpsg.cpp - MacOS - - - PathRelative - Project - :generic: - :panelg.cpp - MacOS - - - PathRelative - Project - :generic: - :tabg.cpp - MacOS - - - PathRelative - Project - :generic: - :choicdgg.cpp - MacOS - - - PathRelative - Project - :generic: - :wizard.cpp - MacOS - - - PathRelative - Project - :generic: - :progdlgg.cpp - MacOS - - - PathRelative - Project - :generic: - :caret.cpp - MacOS - - - PathRelative - Project - :generic: - :statusbr.cpp - MacOS - - - PathRelative - Project - :generic: - :logg.cpp - MacOS - - - PathRelative - Project - :generic: - :fontdlgg.cpp - MacOS - - - PathRelative - Project - :generic: - :splitter.cpp - MacOS - - - PathRelative - Project - :common: - :fontmap.cpp - MacOS - - - Name - tipdlg.cpp - MacOS - - - PathRelative - Project - :common: - :geometry.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :fontutil.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :dataobj.cpp - MacOS - - - PathRelative - Project - :html: - :m_list.cpp - MacOS - - - PathRelative - Project - :html: - :m_tables.cpp - MacOS - - - PathRelative - Project - :html: - :htmlwin.cpp - MacOS - - - PathRelative - Project - :html: - :m_pre.cpp - MacOS - - - PathRelative - Project - :html: - :m_image.cpp - MacOS - - - PathRelative - Project - :html: - :htmprint.cpp - MacOS - - - PathRelative - Project - :html: - :htmlfilt.cpp - MacOS - - - PathRelative - Project - :html: - :htmlpars.cpp - MacOS - - - PathRelative - Project - :html: - :htmltag.cpp - MacOS - - - PathRelative - Project - :html: - :m_hline.cpp - MacOS - - - PathRelative - Project - :html: - :winpars.cpp - MacOS - - - PathRelative - Project - :html: - :htmlcell.cpp - MacOS - - - PathRelative - Project - :html: - :m_layout.cpp - MacOS - - - PathRelative - Project - :html: - :m_fonts.cpp - MacOS - - - PathRelative - Project - :html: - :m_links.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :fontenum.cpp - MacOS - - - Name - colrdlgg.cpp - MacOS - - - PathRelative - Project - :common: - :datetime.cpp - MacOS - - - PathRelative - Project - :common: - :encconv.cpp - MacOS - - - PathRelative - Project - :common: - :mimecmn.cpp - MacOS - - - Name - metafile.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :macnotfy.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :statbrma.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :tooltip.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :statlmac.cpp - MacOS - - - PathRelative - Project - ::include: - :wx_cwc.pch++ - MacOS - - - PathRelative - Project - ::include: - :wx_cwc.pch - MacOS - - - PathRelative - Project - :common: - :imagtiff.cpp - MacOS - - - PathRelative - Project - :generic: - :treectlg.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :notebmac.cpp - MacOS - - - PathRelative - Project - :html: - :m_dflist.cpp - MacOS - - - PathRelative - Project - :common: - :treebase.cpp - MacOS - - - PathRelative - Project - :common: - :cshelp.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :dirmac.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :mimetmac.cpp - MacOS - - - PathRelative - Project - :common: - :filename.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :spinctrl.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :glcanvas.cpp - MacOS - - - PathRelative - Project - :common: - :xpmdecod.cpp - MacOS - - - PathRelative - Project - :common: - :imagxpm.cpp - MacOS - - - PathRelative - Project - :generic: - :dirctrlg.cpp - MacOS - - - PathRelative - Project - :html: - :helpctrl.cpp - MacOS - - - PathRelative - Project - :html: - :helpfrm.cpp - MacOS - - - PathRelative - Project - :html: - :helpdata.cpp - MacOS - - - PathRelative - Project - :generic: - :tipwin.cpp - MacOS - - - PathRelative - Project - :common: - :radiocmn.cpp - MacOS - - - PathRelative - Project - :common: - :nbkbase.cpp - MacOS - - - PathRelative - Project - :generic: - :scrlwing.cpp - MacOS - - - PathRelative - Project - :common: - :gaugecmn.cpp - MacOS - - - PathRelative - Project - :common: - :containr.cpp - MacOS - - - PathRelative - Project - :common: - :quantize.cpp - MacOS - - - PathRelative - Project - :common: - :toplvcmn.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :toplevel.cpp - MacOS - - - PathRelative - Project - :generic: - :gridsel.cpp - MacOS - - - PathRelative - Project - :generic: - :grid.cpp - MacOS - - - PathRelative - Project - :common: - :statbar.cpp - MacOS - - - PathRelative - Project - :common: - :clntdata.cpp - MacOS - - - PathRelative - Project - :common: - :textbuf.cpp - MacOS - - - PathRelative - Project - :generic: - :dragimgg.cpp - MacOS - - - PathRelative - Project - :generic: - :calctrl.cpp - MacOS - - - PathRelative - Project - :common: - :bmpbase.cpp - MacOS - - - PathRelative - Project - :common: - :cmdline.cpp - MacOS - - - PathRelative - Project - :common: - :cmdproc.cpp - MacOS - - - PathRelative - Project - :common: - :dndcmn.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :dnd.cpp - MacOS - - - PathRelative - Project - :common: - :dbgrid.cpp - MacOS - - - PathRelative - Project - :common: - :dircmn.cpp - MacOS - - - PathRelative - Project - :common: - :dseldlg.cpp - MacOS - - - PathRelative - Project - :common: - :dynload.cpp - MacOS - - - PathRelative - Project - :common: - :effects.cpp - MacOS - - - PathRelative - Project - :common: - :fddlgcmn.cpp - MacOS - - - PathRelative - Project - :common: - :fs_mem.cpp - MacOS - - - PathRelative - Project - :common: - :regex.cpp - MacOS - - - PathRelative - Project - :common: - :sysopt.cpp - MacOS - - - PathRelative - Project - :common: - :imagiff.cpp - MacOS - - - PathRelative - Project - :generic: - :splash.cpp - MacOS - - - PathRelative - Project - :generic: - :fdrepdlg.cpp - MacOS - - - PathRelative - Project - :generic: - :gridctrl.cpp - MacOS - - - PathRelative - Project - :html: - :m_style.cpp - MacOS - - - PathRelative - Project - :common: - :hashmap.cpp - MacOS - - - PathRelative - Project - :generic: - :dirdlgg.cpp - MacOS - - - PathRelative - Project - :common: - :iconbndl.cpp - MacOS - - - PathRelative - Project - :common: - :artprov.cpp - MacOS - - - PathRelative - Project - :common: - :artstd.cpp - MacOS - - - PathRelative - Project - :common: - :imagfill.cpp - MacOS - - - PathRelative - Project - :common: - :msgout.cpp - MacOS - - - PathRelative - Project - :common: - :settcmn.cpp - MacOS - - - PathRelative - Project - :common: - :popupcmn.cpp - MacOS - - - PathRelative - Project - :generic: - :printps.cpp - MacOS - - - PathRelative - Project - :common: - datacmn.cpp - Unix - - - PathRelative - Project - :common: - rgncmn.cpp - Unix - - - PathRelative - Project - :common: - accesscmn.cpp - Unix - - - PathRelative - Project - :common: - dpycmn.cpp - Unix - - - PathRelative - Project - :common: - taskbarcmn.cpp - Unix - - - PathRelative - Project - :common: - fldlgcmn.cpp - Unix - - - PathRelative - Project - :generic: - :selstore.cpp - MacOS - - - PathRelative - Project - :common: - appbase.cpp - Unix - - - PathRelative - Project - :common: - fmapbase.cpp - Unix - - - PathRelative - Project - :common: - stopwatch.cpp - Unix - - - PathRelative - Project - :common: - init.cpp - Unix - - - PathRelative - CodeWarrior - :MacOS Support: - Universal/Libraries/StubLibraries/CarbonFrameworkLib - Unix - - - PathRelative - CodeWarrior - :MacOS Support: - Universal/Libraries/StubLibraries/CarbonLib - Unix - - - PathRelative - Project - :generic: - renderg.cpp - Unix - - - PathRelative - Project - :mac:carbon: - renderer.cpp - Unix - - - PathRelative - Project - xml - xml.cpp - Unix - - - PathRelative - Project - expat/lib - xmlparse.c - Unix - - - PathRelative - Project - expat/lib - xmlrole.c - Unix - - - PathRelative - Project - expat/lib - xmltok.c - Unix - - - PathRelative - Project - :common: - rendcmn.cpp - Unix - - - PathRelative - Project - :common: - bookctrl.cpp - Unix - - - PathRelative - Project - :mac:carbon: - gsocket.cpp - Unix - - - PathRelative - Project - :common: - stockitem.cpp - Unix - - - PathRelative - Project - xrc - xh_bmp.cpp - Unix - - - PathRelative - Project - xrc - xh_bmpbt.cpp - Unix - - - PathRelative - Project - xrc - xh_bttn.cpp - Unix - - - PathRelative - Project - xrc - xh_cald.cpp - Unix - - - PathRelative - Project - xrc - xh_chckb.cpp - Unix - - - PathRelative - Project - xrc - xh_chckl.cpp - Unix - - - PathRelative - Project - xrc - xh_choic.cpp - Unix - - - PathRelative - Project - xrc - xh_combo.cpp - Unix - - - PathRelative - Project - xrc - xh_dlg.cpp - Unix - - - PathRelative - Project - xrc - xh_frame.cpp - Unix - - - PathRelative - Project - xrc - xh_gauge.cpp - Unix - - - PathRelative - Project - xrc - xh_gdctl.cpp - Unix - - - PathRelative - Project - xrc - xh_html.cpp - Unix - - - PathRelative - Project - xrc - xh_listb.cpp - Unix - - - PathRelative - Project - xrc - xh_listc.cpp - Unix - - - PathRelative - Project - xrc - xh_menu.cpp - Unix - - - PathRelative - Project - xrc - xh_notbk.cpp - Unix - - - PathRelative - Project - xrc - xh_panel.cpp - Unix - - - PathRelative - Project - xrc - xh_radbt.cpp - Unix - - - PathRelative - Project - xrc - xh_radbx.cpp - Unix - - - PathRelative - Project - xrc - xh_scrol.cpp - Unix - - - PathRelative - Project - xrc - xh_scwin.cpp - Unix - - - PathRelative - Project - xrc - xh_sizer.cpp - Unix - - - PathRelative - Project - xrc - xh_slidr.cpp - Unix - - - PathRelative - Project - xrc - xh_spin.cpp - Unix - - - PathRelative - Project - xrc - xh_split.cpp - Unix - - - PathRelative - Project - xrc - xh_statbar.cpp - Unix - - - PathRelative - Project - xrc - xh_stbmp.cpp - Unix - - - PathRelative - Project - xrc - xh_stbox.cpp - Unix - - - PathRelative - Project - xrc - xh_stlin.cpp - Unix - - - PathRelative - Project - xrc - xh_sttxt.cpp - Unix - - - PathRelative - Project - xrc - xh_text.cpp - Unix - - - PathRelative - Project - xrc - xh_tglbtn.cpp - Unix - - - PathRelative - Project - xrc - xh_toolb.cpp - Unix - - - PathRelative - Project - xrc - xh_tree.cpp - Unix - - - PathRelative - Project - xrc - xh_unkwn.cpp - Unix - - - PathRelative - Project - xrc - xh_wizrd.cpp - Unix - - - PathRelative - Project - xrc - xmlres.cpp - Unix - - - PathRelative - Project - xrc - xmlrsall.cpp - Unix - - - PathRelative - Project - mac/corefoundation - cfstring.cpp - Unix - - - PathRelative - Project - :common: - uri.cpp - Unix - - - PathRelative - Project - :mac:carbon: - display.cpp - Unix - - - PathRelative - Project - :common: - archive.cpp - Unix - - - PathRelative - Project - :generic: - datectlg.cpp - Unix - - - PathRelative - Project - :common: - stdpbase.cpp - Unix - - - PathRelative - Project - mac/corefoundation - stdpaths_cf.cpp - Unix - - - PathRelative - Project - :mac:carbon: - imaglist.cpp - Unix - - - PathRelative - Project - :mac:carbon: - morefilex/MoreFilesX.cpp - Unix - - - PathRelative - Project - xrc - xh_choicbk.cpp - Unix - - - PathRelative - Project - xrc - xh_datectrl.cpp - Unix - - - PathRelative - Project - xrc - xh_listbk.cpp - Unix - - - PathRelative - Project - :common: - gbsizer.cpp - Unix - - - PathRelative - Project - :generic: - choicbkg.cpp - Unix - - - PathRelative - Project - :generic: - listbkg.cpp - Unix - - - PathRelative - Project - :common: - debugrpt.cpp - Unix - - - PathRelative - Project - xrc - xh_mdi.cpp - Unix - - - - - - PathRelative - Project - :jpeg: - jpegM8.mcp - Unix - - - - PPC - Build, LinkAgainst - - FileRelative - ../../lib/jpeg_PPC.lib - Unix - - PathRelative - Project - :jpeg: - jpegM8.mcp - Unix - - - - - - - - PathRelative - Project - :png: - pngM8.mcp - Unix - - - - PPC - Build, LinkAgainst - - FileRelative - ../../lib/png_PPC.lib - Unix - - PathRelative - Project - :png: - pngM8.mcp - Unix - - - - - - - - PathRelative - Project - :tiff: - tiffM8.mcp - Unix - - - - PPC - Build, LinkAgainst - - FileRelative - ../../lib/tif_PPC.lib - Unix - - PathRelative - Project - :tiff: - tiffM8.mcp - Unix - - - - - - - - PathRelative - Project - :zlib: - zlibM8.mcp - Unix - - - - PPC - Build, LinkAgainst - - FileRelative - ../../lib/zlib_PPC.lib - Unix - - PathRelative - Project - :zlib: - zlibM8.mcp - Unix - - - - - - - - PathRelative - Project - :regex: - regexM8.mcp - Unix - - - - PPC - Build, LinkAgainst - - FileRelative - ../../lib/regex_PPC.lib - Unix - - PathRelative - Project - :regex: - regexM8.mcp - Unix - - - - - - - - - wxlib Carbon resources - - - - UserSourceTrees - - - AlwaysSearchUserPathsfalse - InterpretDOSAndUnixPathsfalse - RequireFrameworkStyleIncludesfalse - UserSearchPaths - - SearchPath - Pathmac/carbon - PathFormatUnix - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path::lib: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SystemSearchPaths - - SearchPath - Path:MacOS Support: - PathFormatMacOS - PathRootCodeWarrior - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - - - MWRuntimeSettings_WorkingDirectory - MWRuntimeSettings_CommandLine - MWRuntimeSettings_HostApplication - Path - PathFormatGeneric - PathRootAbsolute - - MWRuntimeSettings_EnvVars - - - LinkerMacOS Merge - PreLinker - PostLinker - Targetnamewxlib Carbon resources - OutputDirectory - Path::lib: - PathFormatMacOS - PathRootProject - - SaveEntriesUsingRelativePathsfalse - - - FileMappings - - FileTypeAPPL - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypeAppl - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypeRSRC - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.bh - CompilerBalloon Help - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.r - CompilerRez - EditLanguageRez - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypersrc - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypeshlb - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - - - CacheModDatestrue - DumpBrowserInfofalse - CacheSubprojectstrue - UseThirdPartyDebuggerfalse - BrowserGenerator0 - DebuggerAppPath - Path - PathFormatGeneric - PathRootAbsolute - - DebuggerCmdLineArgs - DebuggerWorkingDir - Path - PathFormatGeneric - PathRootAbsolute - - CodeCompletionPrefixFileName - CodeCompletionMacroFileName - - - ConsoleEncoding0 - LogSystemMessagestrue - AutoTargetDLLsfalse - StopAtWatchpointstrue - PauseWhileRunningfalse - PauseInterval5 - PauseUIFlags0 - AltExePath - Path - PathFormatUnix - PathRootAbsolute - - StopAtTempBPOnLaunchtrue - CacheSymbolicstrue - TempBPFunctionNamemain - TempBPType0 - - - Enabledfalse - ConnectionName - DownloadPath - LaunchRemoteAppfalse - RemoteAppPath - CoreID0 - JTAGClockSpeed8000 - IsMultiCorefalse - OSDownloadfalse - UseGlobalOSDownloadfalse - OSDownloadConnectionName - OSDownloadPath - AltDownloadfalse - AltDownloadConnectionName - - - OtherExecutables - - - CustomColor1 - Red0 - Green32767 - Blue0 - - CustomColor2 - Red0 - Green32767 - Blue0 - - CustomColor3 - Red0 - Green32767 - Blue0 - - CustomColor4 - Red0 - Green32767 - Blue0 - - - - MWFrontEnd_C_cplusplus0 - MWFrontEnd_C_checkprotos0 - MWFrontEnd_C_arm0 - MWFrontEnd_C_trigraphs0 - MWFrontEnd_C_onlystdkeywords0 - MWFrontEnd_C_enumsalwaysint0 - MWFrontEnd_C_mpwpointerstyle0 - MWFrontEnd_C_prefixname - MWFrontEnd_C_ansistrict0 - MWFrontEnd_C_mpwcnewline0 - MWFrontEnd_C_wchar_type1 - MWFrontEnd_C_enableexceptions1 - MWFrontEnd_C_dontreusestrings0 - MWFrontEnd_C_poolstrings0 - MWFrontEnd_C_dontinline0 - MWFrontEnd_C_useRTTI1 - MWFrontEnd_C_multibyteaware0 - MWFrontEnd_C_unsignedchars0 - MWFrontEnd_C_autoinline0 - MWFrontEnd_C_booltruefalse1 - MWFrontEnd_C_inlinelevel0 - MWFrontEnd_C_ecplusplus0 - MWFrontEnd_C_objective_c0 - MWFrontEnd_C_defer_codegen0 - MWFrontEnd_C_templateparser0 - MWFrontEnd_C_c990 - MWFrontEnd_C_bottomupinline1 - - - MWWarning_C_warn_illpragma0 - MWWarning_C_warn_emptydecl0 - MWWarning_C_warn_possunwant0 - MWWarning_C_warn_unusedvar0 - MWWarning_C_warn_unusedarg0 - MWWarning_C_warn_extracomma0 - MWWarning_C_pedantic0 - MWWarning_C_warningerrors0 - MWWarning_C_warn_hidevirtual0 - MWWarning_C_warn_implicitconv0 - MWWarning_C_warn_notinlined0 - MWWarning_C_warn_structclass0 - - - MWFTP_Post_hostName - MWFTP_Post_username - MWFTP_Post_password0ÿÂà -ž0¼,šì - MWFTP_Post_remoteDir - MWFTP_Post_ftp_PathVersion1 - MWFTP_Post_ftp_PathType0 - MWFTP_Post_ftp_PathFormat0 - MWFTP_Post_ftp_tree - MWFTP_Post_uploadDir - MWFTP_Post_ftp_port21 - MWFTP_Post_SendBin1 - MWFTP_Post_ShouldLog1 - - - MWCommandLine_Java_clsName - MWCommandLine_Java_args - - - MWVJavaDebugging_Protocol1 - MWVJavaDebugging_JDKVersion1 - MWVJavaDebugging_TimeOut10 - MWVJavaDebugging_SupportSlowDevicesfalse - MWVJavaDebugging_UseRemoteLaunchAgentfalse - MWVJavaDebugging_LaunchVMasServerfalse - - - MWJava_Language_optimizefalse - MWJava_Language_warnDeprecatedfalse - MWJava_Language_emitMapfalse - MWJava_Language_strictFileNamesfalse - MWJava_Language_strictFileHierarchyfalse - MWJava_Language_1_1_Compatiblefalse - MWJava_Language_emitHeaders0 - MWJava_Language_headerTypeJNINativeHeaders - MWJava_Language_packageFilter - MWJava_Language_genCommentstrue - MWJava_Language_genHeadersfalse - MWJava_Language_enableAssertsfalse - MWJava_Language_targetVM1.1 - - - Manifest-JAD Attributes - - AttributeMain-Class - ValueAuto-Generated - - - - - MWJava_MRJAppBuilder_outFileMRJApplication - MWJava_MRJAppBuilder_mergefalse - MWJava_MRJAppBuilder_quitMenutrue - MWJava_MRJAppBuilder_growfalse - MWJava_MRJAppBuilder_stdoutTypeConsole - MWJava_MRJAppBuilder_stderrTypeConsole - MWJava_MRJAppBuilder_stdinTypeConsole - MWJava_MRJAppBuilder_appIconPVersion0 - MWJava_MRJAppBuilder_appIconPType0 - MWJava_MRJAppBuilder_appIconPFormat0 - MWJava_MRJAppBuilder_appIconPTree - MWJava_MRJAppBuilder_appIconFile - MWJava_MRJAppBuilder_splashScreenPVersion0 - MWJava_MRJAppBuilder_splashScreenPType0 - MWJava_MRJAppBuilder_splashScreenPFormat0 - MWJava_MRJAppBuilder_splashScreenPTree - MWJava_MRJAppBuilder_splashScreenPICTFile - MWJava_MRJAppBuilder_aboutName - MWJava_MRJAppBuilder_stdoutPVersion0 - MWJava_MRJAppBuilder_stdoutPType0 - MWJava_MRJAppBuilder_stdoutPFormat0 - MWJava_MRJAppBuilder_stdoutPTree - MWJava_MRJAppBuilder_stdoutFile - MWJava_MRJAppBuilder_stdoutAppendfalse - MWJava_MRJAppBuilder_stderrPType0 - MWJava_MRJAppBuilder_stderrPFormat0 - MWJava_MRJAppBuilder_stderrPTree - MWJava_MRJAppBuilder_stderrFile - MWJava_MRJAppBuilder_stderrAppendfalse - MWJava_MRJAppBuilder_stdinPType0 - MWJava_MRJAppBuilder_stdinPFormat0 - MWJava_MRJAppBuilder_stdinPTree - MWJava_MRJAppBuilder_stdinFile - - - MWJava_Output_outputtypeJarFile - MWJava_Output_outfileJavaClasses.jar - MWJava_Output_ftype1514754080 - MWJava_Output_fcreator1297570384 - MWJava_Output_compress0 - MWJava_Output_genManifest0 - MWJava_Output_trunctypeFront - MWJava_Output_deleteClasses0 - MWJava_Output_consoleApp1 - MWJava_Output_preverify0 - MWJava_Output_genJad0 - MWJava_Output_obfuscate0 - - - MWJava_Proj_projtypeApplet - MWJava_Proj_mainClassName - MWJava_Proj_HTMLAppCreator1145457748 - MWJava_Proj_HTMLAppNameMetrowerks Java - MWJava_Proj_PathVersion1 - MWJava_Proj_PathType0 - MWJava_Proj_PathFormat0 - MWJava_Proj_tree - MWJava_Proj_HTMLAppWin32NameInternet Explorer - MWJava_Proj_compress0 - MWJava_Proj_simulator0 - MWJava_Proj_useVM\000\000macosx - MWJava_Proj_vmarguments - MWJava_Proj_vmName - MWJava_Proj_simPropFile - - - MWJavaDoc_Proj_Version1 - MWJavaDoc_Proj_Deprecated1 - MWJavaDoc_Proj_Author1 - MWJavaDoc_Proj_Index1 - MWJavaDoc_Proj_Tree1 - MWJavaDoc_Proj_SunResolveToSame0 - MWJavaDoc_Proj_Shortnames1 - MWJavaDoc_Proj_Folder0 - MWJavaDoc_Proj_GenerateAPILinks0 - MWJavaDoc_Proj_scopePublic - MWJavaDoc_Proj_fcreator1297303877 - MWJavaDoc_Proj_encodingName - MWJavaDoc_Proj_decodingName - MWJavaDoc_Proj_javaPackagePathhttp://java.sun.com/products/jdk/1.1/docs/api/ - - - MWMerge_MacOS_projectTypeApplication - MWMerge_MacOS_outputNamewx_CARBON.rsrc - MWMerge_MacOS_outputCreatorRSED - MWMerge_MacOS_outputTypersrc - MWMerge_MacOS_suppressWarning0 - MWMerge_MacOS_copyFragments1 - MWMerge_MacOS_copyResources1 - MWMerge_MacOS_flattenResource0 - MWMerge_MacOS_flatFileNamea.rsrc - MWMerge_MacOS_flatFileOutputPath - Path: - PathFormatMacOS - PathRootProject - - MWMerge_MacOS_skipResources - DLGX - ckid - Proj - WSPC - - - - FileLockedfalse - ResourcesMapIsReadOnlyfalse - PrinterDriverIsMultiFinderCompatiblefalse - Invisiblefalse - HasBundlefalse - NameLockedfalse - Stationeryfalse - HasCustomIconfalse - Sharedfalse - HasBeenInitedfalse - Label0 - Comments - - - MWMacOSPackager_UsePackager0 - MWMacOSPackager_FolderToPackage - Path - PathFormatMacOS - PathRootAbsolute - - MWMacOSPackager_CreateClassicAlias0 - MWMacOSPackager_ClassicAliasMethodUseTargetOutput - MWMacOSPackager_ClassicAliasPath - Path - PathFormatMacOS - PathRootAbsolute - - MWMacOSPackager_CreatePkgInfo0 - MWMacOSPackager_PkgCreatorType???? - MWMacOSPackager_PkgFileTypeAPPL - - - MWCodeGen_PPC_structalignmentMC68K - MWCodeGen_PPC_tracebacktablesNone - MWCodeGen_PPC_processorGeneric - MWCodeGen_PPC_function_align4 - MWCodeGen_PPC_tocdata1 - MWCodeGen_PPC_largetoc0 - MWCodeGen_PPC_profiler0 - MWCodeGen_PPC_vectortocdata0 - MWCodeGen_PPC_poolconst0 - MWCodeGen_PPC_peephole1 - MWCodeGen_PPC_readonlystrings0 - MWCodeGen_PPC_linkerpoolsstrings0 - MWCodeGen_PPC_volatileasm0 - MWCodeGen_PPC_schedule0 - MWCodeGen_PPC_altivec0 - MWCodeGen_PPC_altivec_move_block0 - MWCodeGen_PPC_strictIEEEfp0 - MWCodeGen_PPC_fpcontract1 - MWCodeGen_PPC_genfsel0 - MWCodeGen_PPC_orderedfpcmp0 - - - MWCodeGen_MachO_structalignmentPPC_mw - MWCodeGen_MachO_profiler_enumOff - MWCodeGen_MachO_processorGeneric - MWCodeGen_MachO_function_align4 - MWCodeGen_MachO_common0 - MWCodeGen_MachO_peephole1 - MWCodeGen_MachO_readonlystrings0 - MWCodeGen_MachO_linkerpoolsstrings1 - MWCodeGen_MachO_volatileasm0 - MWCodeGen_MachO_schedule0 - MWCodeGen_MachO_altivec0 - MWCodeGen_MachO_vecmove0 - MWCodeGen_MachO_fp_ieee_strict0 - MWCodeGen_MachO_fpcontract1 - MWCodeGen_MachO_genfsel0 - MWCodeGen_MachO_fp_cmps_ordered0 - - - MWDisassembler_PPC_showcode1 - MWDisassembler_PPC_extended1 - MWDisassembler_PPC_mix0 - MWDisassembler_PPC_nohex0 - MWDisassembler_PPC_showdata1 - MWDisassembler_PPC_showexceptions1 - MWDisassembler_PPC_showsym0 - MWDisassembler_PPC_shownames1 - - - GlobalOptimizer_PPC_optimizationlevelLevel0 - GlobalOptimizer_PPC_optforSpeed - - - MWLinker_PPC_linksym1 - MWLinker_PPC_symfullpath1 - MWLinker_PPC_linkmap0 - MWLinker_PPC_nolinkwarnings0 - MWLinker_PPC_dontdeadstripinitcode0 - MWLinker_PPC_permitmultdefs0 - MWLinker_PPC_linkmodeFast - MWLinker_PPC_initname - MWLinker_PPC_mainname__start - MWLinker_PPC_termname - - - MWLinker_MacOSX_linksym0 - MWLinker_MacOSX_symfullpath0 - MWLinker_MacOSX_nolinkwarnings0 - MWLinker_MacOSX_linkmap0 - MWLinker_MacOSX_dontdeadstripinitcode0 - MWLinker_MacOSX_permitmultdefs1 - MWLinker_MacOSX_use_objectivec_semantics0 - MWLinker_MacOSX_strip_debug_symbols0 - MWLinker_MacOSX_split_segs0 - MWLinker_MacOSX_report_msl_overloads0 - MWLinker_MacOSX_objects_follow_linkorder0 - MWLinker_MacOSX_linkmodeFast - MWLinker_MacOSX_exportsReferencedGlobals - MWLinker_MacOSX_sortcodeNone - MWLinker_MacOSX_mainnamestart - - - MWProject_MacOSX_typeExecutable - MWProject_MacOSX_outfile - MWProject_MacOSX_filecreator???? - MWProject_MacOSX_filetypeMEXE - MWProject_MacOSX_vmaddress4096 - MWProject_MacOSX_usedefaultvmaddr1 - MWProject_MacOSX_flatrsrc0 - MWProject_MacOSX_flatrsrcfilename - MWProject_MacOSX_flatrsrcoutputdir - Path: - PathFormatMacOS - PathRootProject - - MWProject_MacOSX_installpath./ - MWProject_MacOSX_dont_prebind0 - MWProject_MacOSX_flat_namespace0 - MWProject_MacOSX_frameworkversionA - MWProject_MacOSX_currentversion0 - MWProject_MacOSX_flat_oldimpversion0 - - - MWLinker_MachO_exportsNone - MWLinker_MachO_mainnamestart - MWLinker_MachO_currentversion0 - MWLinker_MachO_compatibleversion0 - MWLinker_MachO_symfullpath0 - MWLinker_MachO_supresswarnings0 - MWLinker_MachO_multisymerror0 - MWLinker_MachO_prebind1 - MWLinker_MachO_deadstrip1 - MWLinker_MachO_objectivecsemantics0 - MWLinker_MachO_whichfileloaded0 - MWLinker_MachO_whyfileloaded0 - MWLinker_MachO_readonlyrelocsErrors - MWLinker_MachO_undefinedsymbolsErrors - MWLinker_MachO_twolevelnamespace1 - MWLinker_MachO_stripdebugsymbols0 - - - MWProject_MachO_typeExecutable - MWProject_MachO_outfilea.exe - MWProject_MachO_filecreator???? - MWProject_MachO_filetypeMEXE - MWProject_MachO_vmaddress4096 - MWProject_MachO_flatrsrc1 - MWProject_MachO_flatrsrcfilenamea.rsrc - MWProject_MachO_flatrsrcoutputdir - Path: - PathFormatMacOS - PathRootProject - - MWProject_MachO_installpath./ - MWProject_MachO_frameworkversion - - - MWPEF_exportsNone - MWPEF_libfolder0 - MWPEF_sortcodeNone - MWPEF_expandbss0 - MWPEF_sharedata0 - MWPEF_olddefversion0 - MWPEF_oldimpversion0 - MWPEF_currentversion0 - MWPEF_fragmentname - MWPEF_collapsereloads0 - - - MWProject_PPC_typeApplication - MWProject_PPC_outfilea.out - MWProject_PPC_filecreator???? - MWProject_PPC_filetypeAPPL - MWProject_PPC_size384 - MWProject_PPC_minsize384 - MWProject_PPC_stacksize64 - MWProject_PPC_flags22720 - MWProject_PPC_symfilename - MWProject_PPC_rsrcname - MWProject_PPC_rsrcheaderNative - MWProject_PPC_rsrctype???? - MWProject_PPC_rsrcid0 - MWProject_PPC_rsrcflags0 - MWProject_PPC_rsrcstore0 - MWProject_PPC_rsrcmerge0 - MWProject_PPC_flatrsrc0 - MWProject_PPC_flatrsrcoutputdir - Path: - PathFormatMacOS - PathRootProject - - MWProject_PPC_flatrsrcfilename - - - MWAssembler_PPC_auxheader0 - MWAssembler_PPC_symmodeMac - MWAssembler_PPC_dialectPPC - MWAssembler_PPC_prefixfile - MWAssembler_PPC_typecheck0 - MWAssembler_PPC_warnings0 - MWAssembler_PPC_casesensitive0 - - - PList_OutputTypeFile - PList_OutputEncodingUTF-8 - PList_Prefix - PList_FileFilenameInfo.plist - PList_FileDirectory - Path: - PathFormatMacOS - PathRootProject - - PList_ResourceTypeplst - PList_ResourceID0 - PList_ResourceName - - - MWRez_Language_maxwidth80 - MWRez_Language_scriptRoman - MWRez_Language_alignmentAlign1 - MWRez_Language_filtermodeFilterSkip - MWRez_Language_suppresswarnings0 - MWRez_Language_escapecontrolchars1 - MWRez_Language_prefixname - MWRez_Language_filteredtypes'CODE' 'DATA' 'PICT' - - - MWWinRC_prefixname - - - MWCodeGen_X86_processorGeneric - MWCodeGen_X86_alignmentbytes8 - MWCodeGen_X86_exceptionsZeroOverhead - MWCodeGen_X86_name_manglingMWWin32 - MWCodeGen_X86_use_extinst0 - MWCodeGen_X86_extinst_mmx0 - MWCodeGen_X86_extinst_3dnow0 - MWCodeGen_X86_use_mmx_3dnow_convention0 - MWCodeGen_X86_extinst_cmov0 - MWCodeGen_X86_extinst_sse0 - MWCodeGen_X86_extinst_sse20 - MWCodeGen_X86_intrinsics0 - MWCodeGen_X86_optimizeasm0 - MWCodeGen_X86_disableopts0 - MWCodeGen_X86_profile0 - MWLinker_X86_runtimeCustom - MWCodeGen_X86_readonlystrings0 - - - MWLinker_X86_subsysmajorid4 - MWLinker_X86_subsysminorid0 - MWCOFF_X86_opsysmajorid4 - MWCOFF_X86_opsysminorid0 - MWLinker_X86_usrmajorid0 - MWLinker_X86_usrminorid0 - MWProject_X86_maxstacksize1024 - MWProject_X86_minstacksize4 - MWProject_X86_size1024 - MWProject_X86_minsize4 - MWCOFF_X86_coff_flags0 - MWCOFF_X86_dll_flags0 - MWProject_X86_baseaddress4194304 - MWCOFF_X86_filealign512 - MWCOFF_X86_sectionalign4096 - - - PDisasmX86_showHeaderstrue - PDisasmX86_showSectHeaderstrue - PDisasmX86_showSymTabtrue - PDisasmX86_showCodetrue - PDisasmX86_showDatatrue - PDisasmX86_showDebugfalse - PDisasmX86_showExceptionsfalse - PDisasmX86_showRawfalse - PDisasmX86_showAllRawfalse - PDisasmX86_showSourcefalse - PDisasmX86_showRelocationtrue - PDisasmX86_showHextrue - PDisasmX86_showCommentsfalse - PDisasmX86_showSymDefstrue - PDisasmX86_unmangletrue - PDisasmX86_verbosetrue - PDisasmX86_resolveRelocstrue - PDisasmX86_resolveLocalsfalse - - - MWDebugger_X86_Exceptions - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - - - - GlobalOptimizer_X86_optimizationlevelLevel0 - GlobalOptimizer_X86_optforSpeed - - - MWLinker_X86_entrypointusageDefault - MWLinker_X86_entrypoint - MWLinker_X86_subsystemWinGUI - MWLinker_X86_commandfile - MWLinker_X86_generatemap0 - MWLinker_X86_linksym0 - MWLinker_X86_linkCV1 - MWLinker_X86_symfullpathfalse - MWLinker_X86_linkdebugtrue - MWLinker_X86_checksumfalse - MWLinker_X86_zero_init_bssfalse - MWLinker_X86_mergedatafalse - MWLinker_X86_usedefaultlibsfalse - MWLinker_X86_adddefaultlibsfalse - MWLinker_X86_nowarningsfalse - MWLinker_X86_verbosefalse - - - MWProject_X86_typeApplication - MWProject_X86_outfileNONAME.EXE - MWProject_X86_importlib - MWProject_X86_setimportlibdirfalse - MWProject_X86_dontgenerateimportlibfalse - MWProject_X86_oldformatlibfalse - MWProject_X86_replaceobjextensionfalse - MWProject_X86_copyallfilesfalse - - - - Name - apprsrc.r - MacOS - Text - Debug - - - Name - corersrc.r - MacOS - Text - Debug - - - Name - carbrsrc.r - MacOS - Text - - - - - - Name - apprsrc.r - MacOS - - - Name - corersrc.r - MacOS - - - Name - carbrsrc.r - MacOS - - - - - wxshlb Carbon debug - - - - UserSourceTrees - - - AlwaysSearchUserPathsfalse - InterpretDOSAndUnixPathstrue - RequireFrameworkStyleIncludesfalse - UserSearchPaths - - SearchPath - Path::include: - PathFormatMacOS - PathRootProject - - Recursivefalse - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path::art: - PathFormatMacOS - PathRootProject - - Recursivefalse - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:generic: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:mac:carbon: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:common: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:zlib: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:png: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:jpeg: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:iodbc: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:tiff: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:html: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Pathxml - PathFormatUnix - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Pathexpat/lib - PathFormatUnix - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Pathxrc - PathFormatUnix - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Pathmac/corefoundation - PathFormatUnix - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SystemSearchPaths - - SearchPath - Path:MSL: - PathFormatMacOS - PathRootCodeWarrior - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:MacOS Support: - PathFormatMacOS - PathRootCodeWarrior - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:regex: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - - - MWRuntimeSettings_WorkingDirectory - MWRuntimeSettings_CommandLine - MWRuntimeSettings_HostApplication - Path - PathFormatGeneric - PathRootAbsolute - - MWRuntimeSettings_EnvVars - - - LinkerMacOS PPC Linker - PreLinker - PostLinker - Targetnamewxshlb Carbon debug - OutputDirectory - Path::lib: - PathFormatMacOS - PathRootProject - - SaveEntriesUsingRelativePathstrue - - - FileMappings - - FileTypeAPPL - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypeAppl - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypeMMLB - FileExtension - CompilerLib Import PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeMPLF - FileExtension - CompilerLib Import PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeMWCD - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypeRSRC - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.bh - CompilerBalloon Help - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.c - CompilerMW C/C++ PPC - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.c++ - CompilerMW C/C++ PPC - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.cc - CompilerMW C/C++ PPC - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.cp - CompilerMW C/C++ PPC - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.cpp - CompilerMW C/C++ PPC - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.exp - Compiler - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.h - CompilerMW C/C++ PPC - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMaketrue - - - FileTypeTEXT - FileExtension.p - CompilerMW Pascal PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.pas - CompilerMW Pascal PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.pch - CompilerMW C/C++ PPC - EditLanguageC/C++ - Precompiletrue - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.pch++ - CompilerMW C/C++ PPC - EditLanguageC/C++ - Precompiletrue - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.ppu - CompilerMW Pascal PPC - EditLanguage - Precompiletrue - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.r - CompilerRez - EditLanguageRez - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.s - CompilerPPCAsm - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeXCOF - FileExtension - CompilerXCOFF Import PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeXPM - FileExtension.xpm - CompilerMW C/C++ PPC - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypedocu - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypersrc - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypeshlb - FileExtension - CompilerPEF Import PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypestub - FileExtension - CompilerPEF Import PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileExtension.doc - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFilefalse - IgnoredByMaketrue - - - FileExtension.o - CompilerXCOFF Import PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileExtension.ppob - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileExtension.rsrc - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - - - CacheModDatestrue - DumpBrowserInfofalse - CacheSubprojectstrue - UseThirdPartyDebuggerfalse - BrowserGenerator1 - DebuggerAppPath - Path - PathFormatGeneric - PathRootAbsolute - - DebuggerCmdLineArgs - DebuggerWorkingDir - Path - PathFormatGeneric - PathRootAbsolute - - CodeCompletionPrefixFileNameMacHeaders.c - CodeCompletionMacroFileNameMacOS_Carbon_C++_Macros.h - - - ConsoleEncoding0 - LogSystemMessagestrue - AutoTargetDLLsfalse - StopAtWatchpointstrue - PauseWhileRunningfalse - PauseInterval5 - PauseUIFlags0 - AltExePath - Path - PathFormatGeneric - PathRootAbsolute - - StopAtTempBPOnLaunchtrue - CacheSymbolicstrue - TempBPFunctionNamemain - TempBPType0 - - - Enabledfalse - ConnectionName - DownloadPath - LaunchRemoteAppfalse - RemoteAppPath - CoreID0 - JTAGClockSpeed8000 - IsMultiCorefalse - OSDownloadfalse - UseGlobalOSDownloadfalse - OSDownloadConnectionName - OSDownloadPath - AltDownloadfalse - AltDownloadConnectionName - - - OtherExecutables - - - CustomColor1 - Red0 - Green32767 - Blue0 - - CustomColor2 - Red0 - Green32767 - Blue0 - - CustomColor3 - Red0 - Green32767 - Blue0 - - CustomColor4 - Red0 - Green32767 - Blue0 - - - - MWFrontEnd_C_cplusplus0 - MWFrontEnd_C_checkprotos0 - MWFrontEnd_C_arm0 - MWFrontEnd_C_trigraphs0 - MWFrontEnd_C_onlystdkeywords0 - MWFrontEnd_C_enumsalwaysint0 - MWFrontEnd_C_mpwpointerstyle0 - MWFrontEnd_C_prefixnamewx/wxshlb_cwc_d.h - MWFrontEnd_C_ansistrict0 - MWFrontEnd_C_mpwcnewline0 - MWFrontEnd_C_wchar_type1 - MWFrontEnd_C_enableexceptions1 - MWFrontEnd_C_dontreusestrings0 - MWFrontEnd_C_poolstrings0 - MWFrontEnd_C_dontinline0 - MWFrontEnd_C_useRTTI1 - MWFrontEnd_C_multibyteaware0 - MWFrontEnd_C_unsignedchars1 - MWFrontEnd_C_autoinline0 - MWFrontEnd_C_booltruefalse1 - MWFrontEnd_C_inlinelevel0 - MWFrontEnd_C_ecplusplus0 - MWFrontEnd_C_objective_c0 - MWFrontEnd_C_defer_codegen0 - MWFrontEnd_C_templateparser0 - MWFrontEnd_C_c990 - MWFrontEnd_C_bottomupinline1 - - - MWWarning_C_warn_illpragma1 - MWWarning_C_warn_emptydecl0 - MWWarning_C_warn_possunwant0 - MWWarning_C_warn_unusedvar0 - MWWarning_C_warn_unusedarg0 - MWWarning_C_warn_extracomma0 - MWWarning_C_pedantic1 - MWWarning_C_warningerrors0 - MWWarning_C_warn_hidevirtual1 - MWWarning_C_warn_implicitconv0 - MWWarning_C_warn_notinlined0 - MWWarning_C_warn_structclass1 - - - MWFTP_Post_hostName - MWFTP_Post_username - MWFTP_Post_password0ÿÂà -ž0¼,šì - MWFTP_Post_remoteDir - MWFTP_Post_ftp_PathVersion1 - MWFTP_Post_ftp_PathType0 - MWFTP_Post_ftp_PathFormat0 - MWFTP_Post_ftp_tree - MWFTP_Post_uploadDir - MWFTP_Post_ftp_port21 - MWFTP_Post_SendBin1 - MWFTP_Post_ShouldLog1 - - - MWCommandLine_Java_clsName - MWCommandLine_Java_args - - - MWVJavaDebugging_Protocol1 - MWVJavaDebugging_JDKVersion1 - MWVJavaDebugging_TimeOut10 - MWVJavaDebugging_SupportSlowDevicesfalse - MWVJavaDebugging_UseRemoteLaunchAgentfalse - MWVJavaDebugging_LaunchVMasServerfalse - - - MWJava_Language_optimizefalse - MWJava_Language_warnDeprecatedfalse - MWJava_Language_emitMapfalse - MWJava_Language_strictFileNamesfalse - MWJava_Language_strictFileHierarchyfalse - MWJava_Language_1_1_Compatiblefalse - MWJava_Language_emitHeaders0 - MWJava_Language_headerTypeJNINativeHeaders - MWJava_Language_packageFilter - MWJava_Language_genCommentstrue - MWJava_Language_genHeadersfalse - MWJava_Language_enableAssertsfalse - MWJava_Language_targetVM1.1 - - - Manifest-JAD Attributes - - AttributeMain-Class - ValueAuto-Generated - - - - - MWJava_MRJAppBuilder_outFileMRJApplication - MWJava_MRJAppBuilder_mergefalse - MWJava_MRJAppBuilder_quitMenutrue - MWJava_MRJAppBuilder_growfalse - MWJava_MRJAppBuilder_stdoutTypeConsole - MWJava_MRJAppBuilder_stderrTypeConsole - MWJava_MRJAppBuilder_stdinTypeConsole - MWJava_MRJAppBuilder_appIconPVersion0 - MWJava_MRJAppBuilder_appIconPType0 - MWJava_MRJAppBuilder_appIconPFormat0 - MWJava_MRJAppBuilder_appIconPTree - MWJava_MRJAppBuilder_appIconFile - MWJava_MRJAppBuilder_splashScreenPVersion0 - MWJava_MRJAppBuilder_splashScreenPType0 - MWJava_MRJAppBuilder_splashScreenPFormat0 - MWJava_MRJAppBuilder_splashScreenPTree - MWJava_MRJAppBuilder_splashScreenPICTFile - MWJava_MRJAppBuilder_aboutName - MWJava_MRJAppBuilder_stdoutPVersion0 - MWJava_MRJAppBuilder_stdoutPType0 - MWJava_MRJAppBuilder_stdoutPFormat0 - MWJava_MRJAppBuilder_stdoutPTree - MWJava_MRJAppBuilder_stdoutFile - MWJava_MRJAppBuilder_stdoutAppendfalse - MWJava_MRJAppBuilder_stderrPType0 - MWJava_MRJAppBuilder_stderrPFormat0 - MWJava_MRJAppBuilder_stderrPTree - MWJava_MRJAppBuilder_stderrFile - MWJava_MRJAppBuilder_stderrAppendfalse - MWJava_MRJAppBuilder_stdinPType0 - MWJava_MRJAppBuilder_stdinPFormat0 - MWJava_MRJAppBuilder_stdinPTree - MWJava_MRJAppBuilder_stdinFile - - - MWJava_Output_outputtypeJarFile - MWJava_Output_outfileJavaClasses.jar - MWJava_Output_ftype1514754080 - MWJava_Output_fcreator1297570384 - MWJava_Output_compress0 - MWJava_Output_genManifest0 - MWJava_Output_trunctypeFront - MWJava_Output_deleteClasses0 - MWJava_Output_consoleApp1 - MWJava_Output_preverify0 - MWJava_Output_genJad0 - MWJava_Output_obfuscate0 - - - MWJava_Proj_projtypeApplet - MWJava_Proj_mainClassName - MWJava_Proj_HTMLAppCreator1145457748 - MWJava_Proj_HTMLAppNameMetrowerks Java - MWJava_Proj_PathVersion1 - MWJava_Proj_PathType0 - MWJava_Proj_PathFormat0 - MWJava_Proj_tree - MWJava_Proj_HTMLAppWin32NameInternet Explorer - MWJava_Proj_compress0 - MWJava_Proj_simulator0 - MWJava_Proj_useVM\000\000macosx - MWJava_Proj_vmarguments - MWJava_Proj_vmName - MWJava_Proj_simPropFile - - - MWJavaDoc_Proj_Version1 - MWJavaDoc_Proj_Deprecated1 - MWJavaDoc_Proj_Author1 - MWJavaDoc_Proj_Index1 - MWJavaDoc_Proj_Tree1 - MWJavaDoc_Proj_SunResolveToSame0 - MWJavaDoc_Proj_Shortnames1 - MWJavaDoc_Proj_Folder0 - MWJavaDoc_Proj_GenerateAPILinks0 - MWJavaDoc_Proj_scopePublic - MWJavaDoc_Proj_fcreator1297303877 - MWJavaDoc_Proj_encodingName - MWJavaDoc_Proj_decodingName - MWJavaDoc_Proj_javaPackagePathhttp://java.sun.com/products/jdk/1.1/docs/api/ - - - MWMerge_MacOS_projectTypeApplication - MWMerge_MacOS_outputNameMerge Out - MWMerge_MacOS_outputCreator???? - MWMerge_MacOS_outputTypeAPPL - MWMerge_MacOS_suppressWarning0 - MWMerge_MacOS_copyFragments1 - MWMerge_MacOS_copyResources1 - MWMerge_MacOS_flattenResource0 - MWMerge_MacOS_flatFileNamea.rsrc - MWMerge_MacOS_flatFileOutputPath - Path: - PathFormatMacOS - PathRootProject - - MWMerge_MacOS_skipResources - DLGX - ckid - Proj - WSPC - - - - FileLockedfalse - ResourcesMapIsReadOnlyfalse - PrinterDriverIsMultiFinderCompatiblefalse - Invisiblefalse - HasBundlefalse - NameLockedfalse - Stationeryfalse - HasCustomIconfalse - Sharedfalse - HasBeenInitedfalse - Label0 - Comments - - - MWMacOSPackager_UsePackager0 - MWMacOSPackager_FolderToPackage - Path - PathFormatMacOS - PathRootAbsolute - - MWMacOSPackager_CreateClassicAlias0 - MWMacOSPackager_ClassicAliasMethodUseTargetOutput - MWMacOSPackager_ClassicAliasPath - Path - PathFormatMacOS - PathRootAbsolute - - MWMacOSPackager_CreatePkgInfo0 - MWMacOSPackager_PkgCreatorType???? - MWMacOSPackager_PkgFileTypeAPPL - - - MWCodeGen_PPC_structalignmentPPC_mw - MWCodeGen_PPC_tracebacktablesInline - MWCodeGen_PPC_processorGeneric - MWCodeGen_PPC_function_align4 - MWCodeGen_PPC_tocdata1 - MWCodeGen_PPC_largetoc0 - MWCodeGen_PPC_profiler0 - MWCodeGen_PPC_vectortocdata0 - MWCodeGen_PPC_poolconst0 - MWCodeGen_PPC_peephole1 - MWCodeGen_PPC_readonlystrings0 - MWCodeGen_PPC_linkerpoolsstrings0 - MWCodeGen_PPC_volatileasm0 - MWCodeGen_PPC_schedule0 - MWCodeGen_PPC_altivec0 - MWCodeGen_PPC_altivec_move_block0 - MWCodeGen_PPC_strictIEEEfp0 - MWCodeGen_PPC_fpcontract1 - MWCodeGen_PPC_genfsel0 - MWCodeGen_PPC_orderedfpcmp0 - - - MWCodeGen_MachO_structalignmentPPC_mw - MWCodeGen_MachO_profiler_enumOff - MWCodeGen_MachO_processorGeneric - MWCodeGen_MachO_function_align4 - MWCodeGen_MachO_common0 - MWCodeGen_MachO_peephole1 - MWCodeGen_MachO_readonlystrings0 - MWCodeGen_MachO_linkerpoolsstrings1 - MWCodeGen_MachO_volatileasm0 - MWCodeGen_MachO_schedule0 - MWCodeGen_MachO_altivec0 - MWCodeGen_MachO_vecmove0 - MWCodeGen_MachO_fp_ieee_strict0 - MWCodeGen_MachO_fpcontract1 - MWCodeGen_MachO_genfsel0 - MWCodeGen_MachO_fp_cmps_ordered0 - - - MWDisassembler_PPC_showcode1 - MWDisassembler_PPC_extended1 - MWDisassembler_PPC_mix0 - MWDisassembler_PPC_nohex0 - MWDisassembler_PPC_showdata1 - MWDisassembler_PPC_showexceptions1 - MWDisassembler_PPC_showsym1 - MWDisassembler_PPC_shownames1 - - - GlobalOptimizer_PPC_optimizationlevelLevel0 - GlobalOptimizer_PPC_optforSpeed - - - MWLinker_PPC_linksym1 - MWLinker_PPC_symfullpath1 - MWLinker_PPC_linkmap0 - MWLinker_PPC_nolinkwarnings0 - MWLinker_PPC_dontdeadstripinitcode0 - MWLinker_PPC_permitmultdefs0 - MWLinker_PPC_linkmodeFast - MWLinker_PPC_initname__initialize - MWLinker_PPC_mainname - MWLinker_PPC_termname__terminate - - - MWLinker_MacOSX_linksym0 - MWLinker_MacOSX_symfullpath0 - MWLinker_MacOSX_nolinkwarnings0 - MWLinker_MacOSX_linkmap0 - MWLinker_MacOSX_dontdeadstripinitcode0 - MWLinker_MacOSX_permitmultdefs1 - MWLinker_MacOSX_use_objectivec_semantics0 - MWLinker_MacOSX_strip_debug_symbols0 - MWLinker_MacOSX_split_segs0 - MWLinker_MacOSX_report_msl_overloads0 - MWLinker_MacOSX_objects_follow_linkorder0 - MWLinker_MacOSX_linkmodeFast - MWLinker_MacOSX_exportsReferencedGlobals - MWLinker_MacOSX_sortcodeNone - MWLinker_MacOSX_mainnamestart - - - MWProject_MacOSX_typeSharedLibrary - MWProject_MacOSX_outfilewx_Carbon_d.shlb - MWProject_MacOSX_filecreator???? - MWProject_MacOSX_filetypeshlb - MWProject_MacOSX_vmaddress4096 - MWProject_MacOSX_usedefaultvmaddr1 - MWProject_MacOSX_flatrsrc0 - MWProject_MacOSX_flatrsrcfilename - MWProject_MacOSX_flatrsrcoutputdir - Path: - PathFormatMacOS - PathRootProject - - MWProject_MacOSX_installpath./ - MWProject_MacOSX_dont_prebind0 - MWProject_MacOSX_flat_namespace0 - MWProject_MacOSX_frameworkversionA - MWProject_MacOSX_currentversion0 - MWProject_MacOSX_flat_oldimpversion0 - - - MWLinker_MachO_exportsNone - MWLinker_MachO_mainnamestart - MWLinker_MachO_currentversion0 - MWLinker_MachO_compatibleversion0 - MWLinker_MachO_symfullpath0 - MWLinker_MachO_supresswarnings0 - MWLinker_MachO_multisymerror0 - MWLinker_MachO_prebind1 - MWLinker_MachO_deadstrip1 - MWLinker_MachO_objectivecsemantics0 - MWLinker_MachO_whichfileloaded0 - MWLinker_MachO_whyfileloaded0 - MWLinker_MachO_readonlyrelocsErrors - MWLinker_MachO_undefinedsymbolsErrors - MWLinker_MachO_twolevelnamespace1 - MWLinker_MachO_stripdebugsymbols0 - - - MWProject_MachO_typeExecutable - MWProject_MachO_outfilea.exe - MWProject_MachO_filecreator???? - MWProject_MachO_filetypeMEXE - MWProject_MachO_vmaddress4096 - MWProject_MachO_flatrsrc1 - MWProject_MachO_flatrsrcfilenamea.rsrc - MWProject_MachO_flatrsrcoutputdir - Path: - PathFormatMacOS - PathRootProject - - MWProject_MachO_installpath./ - MWProject_MachO_frameworkversion - - - MWPEF_exportsPragma - MWPEF_libfolder0 - MWPEF_sortcodeNone - MWPEF_expandbss0 - MWPEF_sharedata0 - MWPEF_olddefversion0 - MWPEF_oldimpversion0 - MWPEF_currentversion0 - MWPEF_fragmentname - MWPEF_collapsereloads0 - - - MWProject_PPC_typeSharedLibrary - MWProject_PPC_outfilewx_Carbon_d.shlb - MWProject_PPC_filecreator???? - MWProject_PPC_filetypeshlb - MWProject_PPC_size0 - MWProject_PPC_minsize0 - MWProject_PPC_stacksize0 - MWProject_PPC_flags0 - MWProject_PPC_symfilename - MWProject_PPC_rsrcname - MWProject_PPC_rsrcheaderNative - MWProject_PPC_rsrctype???? - MWProject_PPC_rsrcid0 - MWProject_PPC_rsrcflags0 - MWProject_PPC_rsrcstore0 - MWProject_PPC_rsrcmerge0 - MWProject_PPC_flatrsrc0 - MWProject_PPC_flatrsrcoutputdir - Path: - PathFormatMacOS - PathRootProject - - MWProject_PPC_flatrsrcfilename - - - MWAssembler_PPC_auxheader0 - MWAssembler_PPC_symmodeMac - MWAssembler_PPC_dialectPPC - MWAssembler_PPC_prefixfile - MWAssembler_PPC_typecheck0 - MWAssembler_PPC_warnings0 - MWAssembler_PPC_casesensitive0 - - - PList_OutputTypeFile - PList_OutputEncodingUTF-8 - PList_Prefix - PList_FileFilenameInfo.plist - PList_FileDirectory - Path: - PathFormatMacOS - PathRootProject - - PList_ResourceTypeplst - PList_ResourceID0 - PList_ResourceName - - - MWRez_Language_maxwidth80 - MWRez_Language_scriptRoman - MWRez_Language_alignmentAlign1 - MWRez_Language_filtermodeFilterSkip - MWRez_Language_suppresswarnings0 - MWRez_Language_escapecontrolchars1 - MWRez_Language_prefixname - MWRez_Language_filteredtypes'CODE' 'DATA' 'PICT' - - - MWWinRC_prefixname - - - MWCodeGen_X86_processorGeneric - MWCodeGen_X86_alignmentbytes8 - MWCodeGen_X86_exceptionsZeroOverhead - MWCodeGen_X86_name_manglingMWWin32 - MWCodeGen_X86_use_extinst0 - MWCodeGen_X86_extinst_mmx0 - MWCodeGen_X86_extinst_3dnow0 - MWCodeGen_X86_use_mmx_3dnow_convention0 - MWCodeGen_X86_extinst_cmov0 - MWCodeGen_X86_extinst_sse0 - MWCodeGen_X86_extinst_sse20 - MWCodeGen_X86_intrinsics0 - MWCodeGen_X86_optimizeasm0 - MWCodeGen_X86_disableopts0 - MWCodeGen_X86_profile0 - MWLinker_X86_runtimeCustom - MWCodeGen_X86_readonlystrings0 - - - MWLinker_X86_subsysmajorid4 - MWLinker_X86_subsysminorid0 - MWCOFF_X86_opsysmajorid4 - MWCOFF_X86_opsysminorid0 - MWLinker_X86_usrmajorid0 - MWLinker_X86_usrminorid0 - MWProject_X86_maxstacksize1024 - MWProject_X86_minstacksize4 - MWProject_X86_size1024 - MWProject_X86_minsize4 - MWCOFF_X86_coff_flags0 - MWCOFF_X86_dll_flags0 - MWProject_X86_baseaddress4194304 - MWCOFF_X86_filealign512 - MWCOFF_X86_sectionalign4096 - - - PDisasmX86_showHeaderstrue - PDisasmX86_showSectHeaderstrue - PDisasmX86_showSymTabtrue - PDisasmX86_showCodetrue - PDisasmX86_showDatatrue - PDisasmX86_showDebugfalse - PDisasmX86_showExceptionsfalse - PDisasmX86_showRawfalse - PDisasmX86_showAllRawfalse - PDisasmX86_showSourcefalse - PDisasmX86_showRelocationtrue - PDisasmX86_showHextrue - PDisasmX86_showCommentsfalse - PDisasmX86_showSymDefstrue - PDisasmX86_unmangletrue - PDisasmX86_verbosetrue - PDisasmX86_resolveRelocstrue - PDisasmX86_resolveLocalsfalse - - - MWDebugger_X86_Exceptions - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - - - - GlobalOptimizer_X86_optimizationlevelLevel0 - GlobalOptimizer_X86_optforSpeed - - - MWLinker_X86_entrypointusageDefault - MWLinker_X86_entrypoint - MWLinker_X86_subsystemWinGUI - MWLinker_X86_commandfile - MWLinker_X86_generatemap0 - MWLinker_X86_linksym1 - MWLinker_X86_linkCV1 - MWLinker_X86_symfullpathfalse - MWLinker_X86_linkdebugtrue - MWLinker_X86_checksumfalse - MWLinker_X86_zero_init_bssfalse - MWLinker_X86_mergedatafalse - MWLinker_X86_usedefaultlibsfalse - MWLinker_X86_adddefaultlibsfalse - MWLinker_X86_nowarningsfalse - MWLinker_X86_verbosefalse - - - MWProject_X86_typeLibrary - MWProject_X86_outfilewx_x86_d.lib - MWProject_X86_importlib - MWProject_X86_setimportlibdirfalse - MWProject_X86_dontgenerateimportlibfalse - MWProject_X86_oldformatlibfalse - MWProject_X86_replaceobjextensionfalse - MWProject_X86_copyallfilesfalse - - - - PathRelative - Project - :mac:carbon: - :accel.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :app.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :bitmap.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :bmpbuttn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :brush.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :button.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :checkbox.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :checklst.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :choice.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :clipbrd.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :colordlg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :colour.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :combobox.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :control.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :cursor.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :data.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :dc.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :dcclient.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :dcmemory.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :dcscreen.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :dialog.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :dirdlg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :filedlg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :font.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :fontdlg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :frame.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :gauge.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :gdiobj.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :icon.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :joystick.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :listbox.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :main.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :mdi.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :menu.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :menuitem.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :minifram.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :msgdlg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :palette.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :pen.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :printdlg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :radiobox.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :radiobut.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :region.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :scrolbar.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :settings.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :slider.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :spinbutt.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :statbmp.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :statbox.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :stattext.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :tabctrl.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :textctrl.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :thread.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :timer.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :toolbar.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :utils.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :utilsexc.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :sound.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :window.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :printmac.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :dcprint.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :uma.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :sckipc.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :matrix.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :tbarbase.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :imagjpeg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :longlong.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :docmdi.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :appcmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :utilscmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :dynlib.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :extended.c - MacOS - Text - Debug - - - PathRelative - Project - :common: - :sckstrm.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :zstream.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :process.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :sizer.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :imagall.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :imaggif.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :imagpcx.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :cmndata.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :ftp.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :menucmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :string.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :wfstream.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :stream.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :gdicmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :protocol.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :layout.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :valgen.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :intl.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :list.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :socket.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :hash.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :dlgcmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :gifdecod.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :filefn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :wincmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :wxchar.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :memory.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :mstream.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :lboxcmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :fs_inet.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :event.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :image.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :ipcbase.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :tokenzr.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :txtstrm.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :filesys.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :url.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :fs_zip.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :prntbase.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :dcbase.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :object.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :http.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :module.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :validate.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :file.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :config.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :fileconf.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :timercmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :framecmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :textfile.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :dynarray.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :choiccmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :helpbase.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :ctrlsub.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :ctrlcmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :strconv.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :sckfile.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :valtext.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :datstrm.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :sckaddr.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :variant.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :dbtable.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :fontcmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :ffile.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :paper.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :clipcmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :imagpnm.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :imagpng.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :imagbmp.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :zipstrm.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :log.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :textcmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :laywin.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :busyinfo.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :listctrl.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :textdlgg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :tipdlg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :numdlgg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :sashwin.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :dcpsg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :panelg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :tabg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :choicdgg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :wizard.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :progdlgg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :caret.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :statusbr.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :logg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :fontdlgg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :splitter.cpp - MacOS - Text - Debug - - - Name - db.cpp - MacOS - Text - Debug - - - Name - dobjcmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :fontmap.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :geometry.cpp - MacOS - Text - Debug - - - Name - colrdlgg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :fontutil.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :dataobj.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :m_list.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :m_tables.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :htmlwin.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :m_pre.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :m_image.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :htmprint.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :htmlfilt.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :htmlpars.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :htmltag.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :m_hline.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :winpars.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :htmlcell.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :m_layout.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :m_fonts.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :m_links.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :fontenum.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :datetime.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :encconv.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :mimecmn.cpp - MacOS - Text - Debug - - - Name - metafile.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :macnotfy.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :statbrma.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :tooltip.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :statlmac.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :imagtiff.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :treectlg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :notebmac.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :m_dflist.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :treebase.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :cshelp.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :dirmac.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :mimetmac.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :filename.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :spinctrl.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :glcanvas.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :xpmdecod.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :imagxpm.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :dirctrlg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :helpctrl.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :helpfrm.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :helpdata.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :tipwin.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :radiocmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :nbkbase.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :scrlwing.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :gaugecmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :containr.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :quantize.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :toplvcmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :toplevel.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :gridsel.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :grid.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :statbar.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :clntdata.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :textbuf.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :dragimgg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :calctrl.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :bmpbase.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :cmdline.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :cmdproc.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :dndcmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :dnd.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :dbgrid.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :dircmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :dseldlg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :dynload.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :effects.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :fddlgcmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :fs_mem.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :regex.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :sysopt.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :imagiff.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :docview.cpp - MacOS - Text - Debug - - - PathRelative - Project - ::include: - :wxshlb_cwc_d.pch - MacOS - Text - Debug - - - PathRelative - Project - ::include: - :wxshlb_cwc_d.pch++ - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :splash.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :fdrepdlg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :gridctrl.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :m_style.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :hashmap.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :dirdlgg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :iconbndl.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :artprov.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :artstd.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :imagfill.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :msgout.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :settcmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :popupcmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :printps.cpp - MacOS - Text - Debug - - - PathRelative - Project - :jpeg: - jpegM8.mcp - Unix - Project - - - - PathRelative - Project - :png: - pngM8.mcp - Unix - Project - - - - PathRelative - Project - :zlib: - zlibM8.mcp - Unix - Project - - - - PathRelative - Project - :tiff: - tiffM8.mcp - Unix - Project - - - - FileRelative - ../../lib/jpeg_PPC.lib - Unix - - PathRelative - Project - :jpeg: - jpegM8.mcp - Unix - - Library - Debug, TargetOutputFile - - - FileRelative - ../../lib/png_PPC.lib - Unix - - PathRelative - Project - :png: - pngM8.mcp - Unix - - Library - Debug, TargetOutputFile - - - FileRelative - ../../lib/zlib_PPC.lib - Unix - - PathRelative - Project - :zlib: - zlibM8.mcp - Unix - - Library - Debug, TargetOutputFile - - - FileRelative - ../../lib/tif_PPC.lib - Unix - - PathRelative - Project - :tiff: - tiffM8.mcp - Unix - - Library - Debug, TargetOutputFile - - - PathRelative - Project - :regex: - regexM8.mcp - Unix - Project - - - - FileRelative - ../../lib/regex_PPC.lib - Unix - - PathRelative - Project - :regex: - regexM8.mcp - Unix - - Library - Debug, TargetOutputFile - - - PathRelative - Project - :common: - datacmn.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - rgncmn.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - accesscmn.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - dpycmn.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - taskbarcmn.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - fldlgcmn.cpp - Unix - Text - Debug - - - PathRelative - Project - :generic: - :selstore.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - appbase.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - fmapbase.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - stopwatch.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - init.cpp - Unix - Text - Debug - - - PathRelative - CodeWarrior - :MacOS Support: - Universal/Libraries/StubLibraries/CarbonFrameworkLib - Unix - Library - Debug - - - PathRelative - CodeWarrior - :MacOS Support: - Universal/Libraries/StubLibraries/CarbonLib - Unix - Library - Debug - - - PathRelative - CodeWarrior - :MacOS Support: - MetroNub Utilities/MNU Carbon.Lib - Unix - Library - Debug - - - PathRelative - Project - :generic: - renderg.cpp - Unix - Text - Debug - - - PathRelative - Project - :mac:carbon: - renderer.cpp - Unix - Text - Debug - - - PathRelative - Project - xml - xml.cpp - Unix - Text - Debug - - - PathRelative - Project - expat/lib - xmlparse.c - Unix - Text - Debug - - - PathRelative - Project - expat/lib - xmlrole.c - Unix - Text - Debug - - - PathRelative - Project - expat/lib - xmltok.c - Unix - Text - Debug - - - PathRelative - Project - :common: - rendcmn.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - bookctrl.cpp - Unix - Text - Debug - - - PathRelative - Project - :mac:carbon: - gsocket.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - stockitem.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_bmp.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_bmpbt.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_bttn.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_cald.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_chckb.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_chckl.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_choic.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_combo.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_dlg.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_frame.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_gauge.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_gdctl.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_html.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_listb.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_listc.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_menu.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_notbk.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_panel.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_radbt.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_radbx.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_scrol.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_scwin.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_sizer.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_slidr.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_spin.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_split.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_statbar.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_stbmp.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_stbox.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_stlin.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_sttxt.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_text.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_tglbtn.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_toolb.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_tree.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_unkwn.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_wizrd.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xmlres.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xmlrsall.cpp - Unix - Text - Debug - - - PathRelative - Project - mac/corefoundation - cfstring.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - uri.cpp - Unix - Text - Debug - - - PathRelative - Project - :mac:carbon: - display.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - archive.cpp - Unix - Text - Debug - - - PathRelative - Project - :generic: - datectlg.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - stdpbase.cpp - Unix - Text - Debug - - - PathRelative - Project - :mac:carbon: - imaglist.cpp - Unix - Text - Debug - - - PathRelative - Project - mac/corefoundation - stdpaths_cf.cpp - Unix - Text - Debug - - - PathRelative - Project - :mac:carbon: - morefilex/MoreFilesX.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_choicbk.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_datectrl.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_listbk.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - gbsizer.cpp - Unix - Text - Debug - - - PathRelative - Project - :generic: - choicbkg.cpp - Unix - Text - Debug - - - PathRelative - Project - :generic: - listbkg.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - debugrpt.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_mdi.cpp - Unix - Text - Debug - - - PathRelative - CodeWarrior - :MacOS Support: - Libraries/Runtime/Libs/MSL_All_Carbon_D.Shlb - Unix - Library - Debug - - - PathRelative - CodeWarrior - :MacOS Support: - Libraries/Runtime/Libs/MSL_ShLibRuntime_PPC_D.Lib - Unix - Library - Debug - - - - - PathRelative - CodeWarrior - :MacOS Support: - Libraries/Runtime/Libs/MSL_All_Carbon_D.Shlb - Unix - - - FileRelative - ../../lib/regex_PPC.lib - Unix - - PathRelative - Project - :regex: - regexM8.mcp - Unix - - - - FileRelative - ../../lib/tif_PPC.lib - Unix - - PathRelative - Project - :tiff: - tiffM8.mcp - Unix - - - - FileRelative - ../../lib/zlib_PPC.lib - Unix - - PathRelative - Project - :zlib: - zlibM8.mcp - Unix - - - - FileRelative - ../../lib/png_PPC.lib - Unix - - PathRelative - Project - :png: - pngM8.mcp - Unix - - - - FileRelative - ../../lib/jpeg_PPC.lib - Unix - - PathRelative - Project - :jpeg: - jpegM8.mcp - Unix - - - - PathRelative - Project - :common: - :object.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :accel.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :app.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :bitmap.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :bmpbuttn.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :brush.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :button.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :checkbox.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :checklst.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :choice.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :clipbrd.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :colordlg.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :colour.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :combobox.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :control.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :cursor.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :data.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :dc.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :dcclient.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :dcmemory.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :dcscreen.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :dialog.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :dirdlg.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :filedlg.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :font.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :fontdlg.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :frame.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :gauge.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :gdiobj.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :icon.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :joystick.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :listbox.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :main.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :mdi.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :menu.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :menuitem.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :minifram.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :msgdlg.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :palette.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :pen.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :printdlg.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :radiobox.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :radiobut.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :region.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :scrolbar.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :settings.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :slider.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :spinbutt.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :statbmp.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :statbox.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :stattext.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :tabctrl.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :textctrl.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :thread.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :timer.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :toolbar.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :utils.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :utilsexc.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :sound.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :window.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :printmac.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :dcprint.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :uma.cpp - MacOS - - - PathRelative - Project - :common: - :sckipc.cpp - MacOS - - - PathRelative - Project - :common: - :matrix.cpp - MacOS - - - PathRelative - Project - :common: - :tbarbase.cpp - MacOS - - - PathRelative - Project - :common: - :imagjpeg.cpp - MacOS - - - PathRelative - Project - :common: - :longlong.cpp - MacOS - - - PathRelative - Project - :common: - :docmdi.cpp - MacOS - - - PathRelative - Project - :common: - :appcmn.cpp - MacOS - - - PathRelative - Project - :common: - :utilscmn.cpp - MacOS - - - PathRelative - Project - :common: - :dynlib.cpp - MacOS - - - PathRelative - Project - :common: - :extended.c - MacOS - - - PathRelative - Project - :common: - :sckstrm.cpp - MacOS - - - PathRelative - Project - :common: - :zstream.cpp - MacOS - - - PathRelative - Project - :common: - :process.cpp - MacOS - - - PathRelative - Project - :common: - :sizer.cpp - MacOS - - - PathRelative - Project - :common: - :imagall.cpp - MacOS - - - PathRelative - Project - :common: - :imaggif.cpp - MacOS - - - PathRelative - Project - :common: - :imagpcx.cpp - MacOS - - - PathRelative - Project - :common: - :cmndata.cpp - MacOS - - - PathRelative - Project - :common: - :ftp.cpp - MacOS - - - PathRelative - Project - :common: - :menucmn.cpp - MacOS - - - PathRelative - Project - :common: - :string.cpp - MacOS - - - PathRelative - Project - :common: - :wfstream.cpp - MacOS - - - PathRelative - Project - :common: - :stream.cpp - MacOS - - - PathRelative - Project - :common: - :gdicmn.cpp - MacOS - - - PathRelative - Project - :common: - :protocol.cpp - MacOS - - - PathRelative - Project - :common: - :layout.cpp - MacOS - - - PathRelative - Project - :common: - :valgen.cpp - MacOS - - - PathRelative - Project - :common: - :intl.cpp - MacOS - - - PathRelative - Project - :common: - :list.cpp - MacOS - - - PathRelative - Project - :common: - :socket.cpp - MacOS - - - PathRelative - Project - :common: - :hash.cpp - MacOS - - - PathRelative - Project - :common: - :dlgcmn.cpp - MacOS - - - PathRelative - Project - :common: - :gifdecod.cpp - MacOS - - - PathRelative - Project - :common: - :filefn.cpp - MacOS - - - PathRelative - Project - :common: - :wincmn.cpp - MacOS - - - PathRelative - Project - :common: - :wxchar.cpp - MacOS - - - PathRelative - Project - :common: - :memory.cpp - MacOS - - - PathRelative - Project - :common: - :mstream.cpp - MacOS - - - PathRelative - Project - :common: - :lboxcmn.cpp - MacOS - - - PathRelative - Project - :common: - :fs_inet.cpp - MacOS - - - PathRelative - Project - :common: - :event.cpp - MacOS - - - PathRelative - Project - :common: - :image.cpp - MacOS - - - PathRelative - Project - :common: - :ipcbase.cpp - MacOS - - - PathRelative - Project - :common: - :tokenzr.cpp - MacOS - - - PathRelative - Project - :common: - :txtstrm.cpp - MacOS - - - PathRelative - Project - :common: - :filesys.cpp - MacOS - - - PathRelative - Project - :common: - :url.cpp - MacOS - - - PathRelative - Project - :common: - :fs_zip.cpp - MacOS - - - PathRelative - Project - :common: - :prntbase.cpp - MacOS - - - PathRelative - Project - :common: - :dcbase.cpp - MacOS - - - PathRelative - Project - :common: - :http.cpp - MacOS - - - PathRelative - Project - :common: - :module.cpp - MacOS - - - PathRelative - Project - :common: - :validate.cpp - MacOS - - - PathRelative - Project - :common: - :file.cpp - MacOS - - - PathRelative - Project - :common: - :config.cpp - MacOS - - - PathRelative - Project - :common: - :fileconf.cpp - MacOS - - - PathRelative - Project - :common: - :timercmn.cpp - MacOS - - - PathRelative - Project - :common: - :framecmn.cpp - MacOS - - - PathRelative - Project - :common: - :textfile.cpp - MacOS - - - PathRelative - Project - :common: - :dynarray.cpp - MacOS - - - PathRelative - Project - :common: - :choiccmn.cpp - MacOS - - - PathRelative - Project - :common: - :helpbase.cpp - MacOS - - - PathRelative - Project - :common: - :ctrlsub.cpp - MacOS - - - PathRelative - Project - :common: - :ctrlcmn.cpp - MacOS - - - PathRelative - Project - :common: - :strconv.cpp - MacOS - - - PathRelative - Project - :common: - :sckfile.cpp - MacOS - - - PathRelative - Project - :common: - :valtext.cpp - MacOS - - - PathRelative - Project - :common: - :datstrm.cpp - MacOS - - - PathRelative - Project - :common: - :sckaddr.cpp - MacOS - - - PathRelative - Project - :common: - :variant.cpp - MacOS - - - PathRelative - Project - :common: - :dbtable.cpp - MacOS - - - PathRelative - Project - :common: - :fontcmn.cpp - MacOS - - - PathRelative - Project - :common: - :ffile.cpp - MacOS - - - PathRelative - Project - :common: - :paper.cpp - MacOS - - - PathRelative - Project - :common: - :clipcmn.cpp - MacOS - - - PathRelative - Project - :common: - :imagpnm.cpp - MacOS - - - PathRelative - Project - :common: - :imagpng.cpp - MacOS - - - PathRelative - Project - :common: - :imagbmp.cpp - MacOS - - - PathRelative - Project - :common: - :zipstrm.cpp - MacOS - - - PathRelative - Project - :common: - :log.cpp - MacOS - - - PathRelative - Project - :common: - :textcmn.cpp - MacOS - - - PathRelative - Project - :generic: - :laywin.cpp - MacOS - - - PathRelative - Project - :generic: - :busyinfo.cpp - MacOS - - - PathRelative - Project - :generic: - :listctrl.cpp - MacOS - - - PathRelative - Project - :generic: - :textdlgg.cpp - MacOS - - - PathRelative - Project - :generic: - :tipdlg.cpp - MacOS - - - PathRelative - Project - :generic: - :numdlgg.cpp - MacOS - - - PathRelative - Project - :generic: - :sashwin.cpp - MacOS - - - PathRelative - Project - :generic: - :dcpsg.cpp - MacOS - - - PathRelative - Project - :generic: - :panelg.cpp - MacOS - - - PathRelative - Project - :generic: - :tabg.cpp - MacOS - - - PathRelative - Project - :generic: - :choicdgg.cpp - MacOS - - - PathRelative - Project - :generic: - :wizard.cpp - MacOS - - - PathRelative - Project - :generic: - :progdlgg.cpp - MacOS - - - PathRelative - Project - :generic: - :caret.cpp - MacOS - - - PathRelative - Project - :generic: - :statusbr.cpp - MacOS - - - PathRelative - Project - :generic: - :logg.cpp - MacOS - - - PathRelative - Project - :generic: - :fontdlgg.cpp - MacOS - - - PathRelative - Project - :generic: - :splitter.cpp - MacOS - - - Name - db.cpp - MacOS - - - Name - dobjcmn.cpp - MacOS - - - PathRelative - Project - :common: - :fontmap.cpp - MacOS - - - PathRelative - Project - :common: - :geometry.cpp - MacOS - - - Name - colrdlgg.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :fontutil.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :dataobj.cpp - MacOS - - - PathRelative - Project - :html: - :m_list.cpp - MacOS - - - PathRelative - Project - :html: - :m_tables.cpp - MacOS - - - PathRelative - Project - :html: - :htmlwin.cpp - MacOS - - - PathRelative - Project - :html: - :m_pre.cpp - MacOS - - - PathRelative - Project - :html: - :m_image.cpp - MacOS - - - PathRelative - Project - :html: - :htmprint.cpp - MacOS - - - PathRelative - Project - :html: - :htmlfilt.cpp - MacOS - - - PathRelative - Project - :html: - :htmlpars.cpp - MacOS - - - PathRelative - Project - :html: - :htmltag.cpp - MacOS - - - PathRelative - Project - :html: - :m_hline.cpp - MacOS - - - PathRelative - Project - :html: - :winpars.cpp - MacOS - - - PathRelative - Project - :html: - :htmlcell.cpp - MacOS - - - PathRelative - Project - :html: - :m_layout.cpp - MacOS - - - PathRelative - Project - :html: - :m_fonts.cpp - MacOS - - - PathRelative - Project - :html: - :m_links.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :fontenum.cpp - MacOS - - - PathRelative - Project - :common: - :datetime.cpp - MacOS - - - PathRelative - Project - :common: - :encconv.cpp - MacOS - - - PathRelative - Project - :common: - :mimecmn.cpp - MacOS - - - Name - metafile.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :macnotfy.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :statbrma.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :tooltip.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :statlmac.cpp - MacOS - - - PathRelative - Project - :common: - :imagtiff.cpp - MacOS - - - PathRelative - Project - :generic: - :treectlg.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :notebmac.cpp - MacOS - - - PathRelative - Project - :html: - :m_dflist.cpp - MacOS - - - PathRelative - Project - :common: - :treebase.cpp - MacOS - - - PathRelative - Project - :common: - :cshelp.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :dirmac.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :mimetmac.cpp - MacOS - - - PathRelative - Project - :common: - :filename.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :spinctrl.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :glcanvas.cpp - MacOS - - - PathRelative - Project - :common: - :xpmdecod.cpp - MacOS - - - PathRelative - Project - :common: - :imagxpm.cpp - MacOS - - - PathRelative - Project - :generic: - :dirctrlg.cpp - MacOS - - - PathRelative - Project - :html: - :helpctrl.cpp - MacOS - - - PathRelative - Project - :html: - :helpfrm.cpp - MacOS - - - PathRelative - Project - :html: - :helpdata.cpp - MacOS - - - PathRelative - Project - :generic: - :tipwin.cpp - MacOS - - - PathRelative - Project - :common: - :radiocmn.cpp - MacOS - - - PathRelative - Project - :common: - :nbkbase.cpp - MacOS - - - PathRelative - Project - :generic: - :scrlwing.cpp - MacOS - - - PathRelative - Project - :common: - :gaugecmn.cpp - MacOS - - - PathRelative - Project - :common: - :containr.cpp - MacOS - - - PathRelative - Project - :common: - :quantize.cpp - MacOS - - - PathRelative - Project - :common: - :toplvcmn.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :toplevel.cpp - MacOS - - - PathRelative - Project - :generic: - :gridsel.cpp - MacOS - - - PathRelative - Project - :generic: - :grid.cpp - MacOS - - - PathRelative - Project - :common: - :statbar.cpp - MacOS - - - PathRelative - Project - :common: - :clntdata.cpp - MacOS - - - PathRelative - Project - :common: - :textbuf.cpp - MacOS - - - PathRelative - Project - :generic: - :dragimgg.cpp - MacOS - - - PathRelative - Project - :generic: - :calctrl.cpp - MacOS - - - PathRelative - Project - :common: - :bmpbase.cpp - MacOS - - - PathRelative - Project - :common: - :cmdline.cpp - MacOS - - - PathRelative - Project - :common: - :cmdproc.cpp - MacOS - - - PathRelative - Project - :common: - :dndcmn.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :dnd.cpp - MacOS - - - PathRelative - Project - :common: - :dbgrid.cpp - MacOS - - - PathRelative - Project - :common: - :dircmn.cpp - MacOS - - - PathRelative - Project - :common: - :dseldlg.cpp - MacOS - - - PathRelative - Project - :common: - :dynload.cpp - MacOS - - - PathRelative - Project - :common: - :effects.cpp - MacOS - - - PathRelative - Project - :common: - :fddlgcmn.cpp - MacOS - - - PathRelative - Project - :common: - :fs_mem.cpp - MacOS - - - PathRelative - Project - :common: - :regex.cpp - MacOS - - - PathRelative - Project - :common: - :sysopt.cpp - MacOS - - - PathRelative - Project - :common: - :imagiff.cpp - MacOS - - - PathRelative - Project - :common: - :docview.cpp - MacOS - - - PathRelative - Project - ::include: - :wxshlb_cwc_d.pch - MacOS - - - PathRelative - Project - ::include: - :wxshlb_cwc_d.pch++ - MacOS - - - PathRelative - Project - :generic: - :splash.cpp - MacOS - - - PathRelative - Project - :generic: - :fdrepdlg.cpp - MacOS - - - PathRelative - Project - :generic: - :gridctrl.cpp - MacOS - - - PathRelative - Project - :html: - :m_style.cpp - MacOS - - - PathRelative - Project - :common: - :hashmap.cpp - MacOS - - - PathRelative - Project - :generic: - :dirdlgg.cpp - MacOS - - - PathRelative - Project - :common: - :iconbndl.cpp - MacOS - - - PathRelative - Project - :common: - :artprov.cpp - MacOS - - - PathRelative - Project - :common: - :artstd.cpp - MacOS - - - PathRelative - Project - :common: - :imagfill.cpp - MacOS - - - PathRelative - Project - :common: - :msgout.cpp - MacOS - - - PathRelative - Project - :common: - :settcmn.cpp - MacOS - - - PathRelative - Project - :common: - :popupcmn.cpp - MacOS - - - PathRelative - Project - :generic: - :printps.cpp - MacOS - - - PathRelative - Project - :common: - datacmn.cpp - Unix - - - PathRelative - Project - :common: - rgncmn.cpp - Unix - - - PathRelative - Project - :common: - accesscmn.cpp - Unix - - - PathRelative - Project - :common: - dpycmn.cpp - Unix - - - PathRelative - Project - :common: - taskbarcmn.cpp - Unix - - - PathRelative - Project - :common: - fldlgcmn.cpp - Unix - - - PathRelative - Project - :generic: - :selstore.cpp - MacOS - - - PathRelative - Project - :common: - appbase.cpp - Unix - - - PathRelative - Project - :common: - fmapbase.cpp - Unix - - - PathRelative - Project - :common: - stopwatch.cpp - Unix - - - PathRelative - Project - :common: - init.cpp - Unix - - - PathRelative - CodeWarrior - :MacOS Support: - Universal/Libraries/StubLibraries/CarbonFrameworkLib - Unix - - - PathRelative - CodeWarrior - :MacOS Support: - Universal/Libraries/StubLibraries/CarbonLib - Unix - - - PathRelative - CodeWarrior - :MacOS Support: - MetroNub Utilities/MNU Carbon.Lib - Unix - - - PathRelative - Project - :generic: - renderg.cpp - Unix - - - PathRelative - Project - :mac:carbon: - renderer.cpp - Unix - - - PathRelative - Project - xml - xml.cpp - Unix - - - PathRelative - Project - expat/lib - xmlparse.c - Unix - - - PathRelative - Project - expat/lib - xmlrole.c - Unix - - - PathRelative - Project - expat/lib - xmltok.c - Unix - - - PathRelative - Project - :common: - rendcmn.cpp - Unix - - - PathRelative - Project - :common: - bookctrl.cpp - Unix - - - PathRelative - Project - :mac:carbon: - gsocket.cpp - Unix - - - PathRelative - Project - :common: - stockitem.cpp - Unix - - - PathRelative - Project - xrc - xh_bmp.cpp - Unix - - - PathRelative - Project - xrc - xh_bmpbt.cpp - Unix - - - PathRelative - Project - xrc - xh_bttn.cpp - Unix - - - PathRelative - Project - xrc - xh_cald.cpp - Unix - - - PathRelative - Project - xrc - xh_chckb.cpp - Unix - - - PathRelative - Project - xrc - xh_chckl.cpp - Unix - - - PathRelative - Project - xrc - xh_choic.cpp - Unix - - - PathRelative - Project - xrc - xh_combo.cpp - Unix - - - PathRelative - Project - xrc - xh_dlg.cpp - Unix - - - PathRelative - Project - xrc - xh_frame.cpp - Unix - - - PathRelative - Project - xrc - xh_gauge.cpp - Unix - - - PathRelative - Project - xrc - xh_gdctl.cpp - Unix - - - PathRelative - Project - xrc - xh_html.cpp - Unix - - - PathRelative - Project - xrc - xh_listb.cpp - Unix - - - PathRelative - Project - xrc - xh_listc.cpp - Unix - - - PathRelative - Project - xrc - xh_menu.cpp - Unix - - - PathRelative - Project - xrc - xh_notbk.cpp - Unix - - - PathRelative - Project - xrc - xh_panel.cpp - Unix - - - PathRelative - Project - xrc - xh_radbt.cpp - Unix - - - PathRelative - Project - xrc - xh_radbx.cpp - Unix - - - PathRelative - Project - xrc - xh_scrol.cpp - Unix - - - PathRelative - Project - xrc - xh_scwin.cpp - Unix - - - PathRelative - Project - xrc - xh_sizer.cpp - Unix - - - PathRelative - Project - xrc - xh_slidr.cpp - Unix - - - PathRelative - Project - xrc - xh_spin.cpp - Unix - - - PathRelative - Project - xrc - xh_split.cpp - Unix - - - PathRelative - Project - xrc - xh_statbar.cpp - Unix - - - PathRelative - Project - xrc - xh_stbmp.cpp - Unix - - - PathRelative - Project - xrc - xh_stbox.cpp - Unix - - - PathRelative - Project - xrc - xh_stlin.cpp - Unix - - - PathRelative - Project - xrc - xh_sttxt.cpp - Unix - - - PathRelative - Project - xrc - xh_text.cpp - Unix - - - PathRelative - Project - xrc - xh_tglbtn.cpp - Unix - - - PathRelative - Project - xrc - xh_toolb.cpp - Unix - - - PathRelative - Project - xrc - xh_tree.cpp - Unix - - - PathRelative - Project - xrc - xh_unkwn.cpp - Unix - - - PathRelative - Project - xrc - xh_wizrd.cpp - Unix - - - PathRelative - Project - xrc - xmlres.cpp - Unix - - - PathRelative - Project - xrc - xmlrsall.cpp - Unix - - - PathRelative - Project - mac/corefoundation - cfstring.cpp - Unix - - - PathRelative - Project - :common: - uri.cpp - Unix - - - PathRelative - Project - :mac:carbon: - display.cpp - Unix - - - PathRelative - Project - :common: - archive.cpp - Unix - - - PathRelative - Project - :generic: - datectlg.cpp - Unix - - - PathRelative - Project - :common: - stdpbase.cpp - Unix - - - PathRelative - Project - :mac:carbon: - imaglist.cpp - Unix - - - PathRelative - Project - mac/corefoundation - stdpaths_cf.cpp - Unix - - - PathRelative - Project - :mac:carbon: - morefilex/MoreFilesX.cpp - Unix - - - PathRelative - Project - xrc - xh_choicbk.cpp - Unix - - - PathRelative - Project - xrc - xh_datectrl.cpp - Unix - - - PathRelative - Project - xrc - xh_listbk.cpp - Unix - - - PathRelative - Project - :common: - gbsizer.cpp - Unix - - - PathRelative - Project - :generic: - choicbkg.cpp - Unix - - - PathRelative - Project - :generic: - listbkg.cpp - Unix - - - PathRelative - Project - :common: - debugrpt.cpp - Unix - - - PathRelative - Project - xrc - xh_mdi.cpp - Unix - - - PathRelative - CodeWarrior - :MacOS Support: - Libraries/Runtime/Libs/MSL_ShLibRuntime_PPC_D.Lib - Unix - - - - - - PathRelative - Project - :jpeg: - jpegM8.mcp - Unix - - - - PPC - Build, LinkAgainst - - FileRelative - ../../lib/jpeg_PPC.lib - Unix - - PathRelative - Project - :jpeg: - jpegM8.mcp - Unix - - - - - - - - PathRelative - Project - :png: - pngM8.mcp - Unix - - - - PPC - Build, LinkAgainst - - FileRelative - ../../lib/png_PPC.lib - Unix - - PathRelative - Project - :png: - pngM8.mcp - Unix - - - - - - - - PathRelative - Project - :zlib: - zlibM8.mcp - Unix - - - - PPC - Build, LinkAgainst - - FileRelative - ../../lib/zlib_PPC.lib - Unix - - PathRelative - Project - :zlib: - zlibM8.mcp - Unix - - - - - - - - PathRelative - Project - :tiff: - tiffM8.mcp - Unix - - - - PPC - Build, LinkAgainst - - FileRelative - ../../lib/tif_PPC.lib - Unix - - PathRelative - Project - :tiff: - tiffM8.mcp - Unix - - - - - - - - PathRelative - Project - :regex: - regexM8.mcp - Unix - - - - PPC - Build, LinkAgainst - - FileRelative - ../../lib/regex_PPC.lib - Unix - - PathRelative - Project - :regex: - regexM8.mcp - Unix - - - - - - - - - wxshlb Carbon release - - - - UserSourceTrees - - - AlwaysSearchUserPathsfalse - InterpretDOSAndUnixPathstrue - RequireFrameworkStyleIncludesfalse - UserSearchPaths - - SearchPath - Path::include: - PathFormatMacOS - PathRootProject - - Recursivefalse - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path::art: - PathFormatMacOS - PathRootProject - - Recursivefalse - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:generic: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:mac:carbon: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:common: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:zlib: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:png: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:jpeg: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:iodbc: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:tiff: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:html: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Pathxml - PathFormatUnix - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Pathexpat/lib - PathFormatUnix - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Pathxrc - PathFormatUnix - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Pathmac/corefoundation - PathFormatUnix - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SystemSearchPaths - - SearchPath - Path:MSL: - PathFormatMacOS - PathRootCodeWarrior - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:MacOS Support: - PathFormatMacOS - PathRootCodeWarrior - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:regex: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - - - MWRuntimeSettings_WorkingDirectory - MWRuntimeSettings_CommandLine - MWRuntimeSettings_HostApplication - Path - PathFormatGeneric - PathRootAbsolute - - MWRuntimeSettings_EnvVars - - - LinkerMacOS PPC Linker - PreLinker - PostLinker - Targetnamewxshlb Carbon release - OutputDirectory - Path::lib: - PathFormatMacOS - PathRootProject - - SaveEntriesUsingRelativePathstrue - - - FileMappings - - FileTypeAPPL - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypeAppl - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypeMMLB - FileExtension - CompilerLib Import PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeMPLF - FileExtension - CompilerLib Import PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeMWCD - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypeRSRC - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.bh - CompilerBalloon Help - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.c - CompilerMW C/C++ PPC - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.c++ - CompilerMW C/C++ PPC - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.cc - CompilerMW C/C++ PPC - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.cp - CompilerMW C/C++ PPC - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.cpp - CompilerMW C/C++ PPC - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.exp - Compiler - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.h - CompilerMW C/C++ PPC - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMaketrue - - - FileTypeTEXT - FileExtension.p - CompilerMW Pascal PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.pas - CompilerMW Pascal PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.pch - CompilerMW C/C++ PPC - EditLanguageC/C++ - Precompiletrue - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.pch++ - CompilerMW C/C++ PPC - EditLanguageC/C++ - Precompiletrue - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.ppu - CompilerMW Pascal PPC - EditLanguage - Precompiletrue - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.r - CompilerRez - EditLanguageRez - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.s - CompilerPPCAsm - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeXCOF - FileExtension - CompilerXCOFF Import PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeXPM - FileExtension.xpm - CompilerMW C/C++ PPC - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypedocu - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypersrc - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypeshlb - FileExtension - CompilerPEF Import PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypestub - FileExtension - CompilerPEF Import PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileExtension.doc - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFilefalse - IgnoredByMaketrue - - - FileExtension.o - CompilerXCOFF Import PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileExtension.ppob - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileExtension.rsrc - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - - - CacheModDatestrue - DumpBrowserInfofalse - CacheSubprojectstrue - UseThirdPartyDebuggerfalse - BrowserGenerator0 - DebuggerAppPath - Path - PathFormatGeneric - PathRootAbsolute - - DebuggerCmdLineArgs - DebuggerWorkingDir - Path - PathFormatGeneric - PathRootAbsolute - - CodeCompletionPrefixFileNameMacHeaders.c - CodeCompletionMacroFileNameMacOS_Carbon_C++_Macros.h - - - ConsoleEncoding0 - LogSystemMessagestrue - AutoTargetDLLsfalse - StopAtWatchpointstrue - PauseWhileRunningfalse - PauseInterval5 - PauseUIFlags0 - AltExePath - Path - PathFormatGeneric - PathRootAbsolute - - StopAtTempBPOnLaunchtrue - CacheSymbolicstrue - TempBPFunctionNamemain - TempBPType0 - - - Enabledfalse - ConnectionName - DownloadPath - LaunchRemoteAppfalse - RemoteAppPath - CoreID0 - JTAGClockSpeed8000 - IsMultiCorefalse - OSDownloadfalse - UseGlobalOSDownloadfalse - OSDownloadConnectionName - OSDownloadPath - AltDownloadfalse - AltDownloadConnectionName - - - OtherExecutables - - - CustomColor1 - Red0 - Green32767 - Blue0 - - CustomColor2 - Red0 - Green32767 - Blue0 - - CustomColor3 - Red0 - Green32767 - Blue0 - - CustomColor4 - Red0 - Green32767 - Blue0 - - - - MWFrontEnd_C_cplusplus0 - MWFrontEnd_C_checkprotos0 - MWFrontEnd_C_arm0 - MWFrontEnd_C_trigraphs0 - MWFrontEnd_C_onlystdkeywords0 - MWFrontEnd_C_enumsalwaysint0 - MWFrontEnd_C_mpwpointerstyle0 - MWFrontEnd_C_prefixnamewx/wxshlb_cwc.h - MWFrontEnd_C_ansistrict0 - MWFrontEnd_C_mpwcnewline0 - MWFrontEnd_C_wchar_type1 - MWFrontEnd_C_enableexceptions1 - MWFrontEnd_C_dontreusestrings0 - MWFrontEnd_C_poolstrings0 - MWFrontEnd_C_dontinline0 - MWFrontEnd_C_useRTTI1 - MWFrontEnd_C_multibyteaware0 - MWFrontEnd_C_unsignedchars1 - MWFrontEnd_C_autoinline1 - MWFrontEnd_C_booltruefalse1 - MWFrontEnd_C_inlinelevel0 - MWFrontEnd_C_ecplusplus0 - MWFrontEnd_C_objective_c0 - MWFrontEnd_C_defer_codegen0 - MWFrontEnd_C_templateparser0 - MWFrontEnd_C_c990 - MWFrontEnd_C_bottomupinline1 - - - MWWarning_C_warn_illpragma1 - MWWarning_C_warn_emptydecl0 - MWWarning_C_warn_possunwant0 - MWWarning_C_warn_unusedvar0 - MWWarning_C_warn_unusedarg0 - MWWarning_C_warn_extracomma0 - MWWarning_C_pedantic1 - MWWarning_C_warningerrors0 - MWWarning_C_warn_hidevirtual1 - MWWarning_C_warn_implicitconv0 - MWWarning_C_warn_notinlined0 - MWWarning_C_warn_structclass1 - - - MWFTP_Post_hostName - MWFTP_Post_username - MWFTP_Post_password0ÿÂà -ž0¼,šì - MWFTP_Post_remoteDir - MWFTP_Post_ftp_PathVersion1 - MWFTP_Post_ftp_PathType0 - MWFTP_Post_ftp_PathFormat0 - MWFTP_Post_ftp_tree - MWFTP_Post_uploadDir - MWFTP_Post_ftp_port21 - MWFTP_Post_SendBin1 - MWFTP_Post_ShouldLog1 - - - MWCommandLine_Java_clsName - MWCommandLine_Java_args - - - MWVJavaDebugging_Protocol1 - MWVJavaDebugging_JDKVersion1 - MWVJavaDebugging_TimeOut10 - MWVJavaDebugging_SupportSlowDevicesfalse - MWVJavaDebugging_UseRemoteLaunchAgentfalse - MWVJavaDebugging_LaunchVMasServerfalse - - - MWJava_Language_optimizefalse - MWJava_Language_warnDeprecatedfalse - MWJava_Language_emitMapfalse - MWJava_Language_strictFileNamesfalse - MWJava_Language_strictFileHierarchyfalse - MWJava_Language_1_1_Compatiblefalse - MWJava_Language_emitHeaders0 - MWJava_Language_headerTypeJNINativeHeaders - MWJava_Language_packageFilter - MWJava_Language_genCommentstrue - MWJava_Language_genHeadersfalse - MWJava_Language_enableAssertsfalse - MWJava_Language_targetVM1.1 - - - Manifest-JAD Attributes - - AttributeMain-Class - ValueAuto-Generated - - - - - MWJava_MRJAppBuilder_outFileMRJApplication - MWJava_MRJAppBuilder_mergefalse - MWJava_MRJAppBuilder_quitMenutrue - MWJava_MRJAppBuilder_growfalse - MWJava_MRJAppBuilder_stdoutTypeConsole - MWJava_MRJAppBuilder_stderrTypeConsole - MWJava_MRJAppBuilder_stdinTypeConsole - MWJava_MRJAppBuilder_appIconPVersion0 - MWJava_MRJAppBuilder_appIconPType0 - MWJava_MRJAppBuilder_appIconPFormat0 - MWJava_MRJAppBuilder_appIconPTree - MWJava_MRJAppBuilder_appIconFile - MWJava_MRJAppBuilder_splashScreenPVersion0 - MWJava_MRJAppBuilder_splashScreenPType0 - MWJava_MRJAppBuilder_splashScreenPFormat0 - MWJava_MRJAppBuilder_splashScreenPTree - MWJava_MRJAppBuilder_splashScreenPICTFile - MWJava_MRJAppBuilder_aboutName - MWJava_MRJAppBuilder_stdoutPVersion0 - MWJava_MRJAppBuilder_stdoutPType0 - MWJava_MRJAppBuilder_stdoutPFormat0 - MWJava_MRJAppBuilder_stdoutPTree - MWJava_MRJAppBuilder_stdoutFile - MWJava_MRJAppBuilder_stdoutAppendfalse - MWJava_MRJAppBuilder_stderrPType0 - MWJava_MRJAppBuilder_stderrPFormat0 - MWJava_MRJAppBuilder_stderrPTree - MWJava_MRJAppBuilder_stderrFile - MWJava_MRJAppBuilder_stderrAppendfalse - MWJava_MRJAppBuilder_stdinPType0 - MWJava_MRJAppBuilder_stdinPFormat0 - MWJava_MRJAppBuilder_stdinPTree - MWJava_MRJAppBuilder_stdinFile - - - MWJava_Output_outputtypeJarFile - MWJava_Output_outfileJavaClasses.jar - MWJava_Output_ftype1514754080 - MWJava_Output_fcreator1297570384 - MWJava_Output_compress0 - MWJava_Output_genManifest0 - MWJava_Output_trunctypeFront - MWJava_Output_deleteClasses0 - MWJava_Output_consoleApp1 - MWJava_Output_preverify0 - MWJava_Output_genJad0 - MWJava_Output_obfuscate0 - - - MWJava_Proj_projtypeApplet - MWJava_Proj_mainClassName - MWJava_Proj_HTMLAppCreator1145457748 - MWJava_Proj_HTMLAppNameMetrowerks Java - MWJava_Proj_PathVersion1 - MWJava_Proj_PathType0 - MWJava_Proj_PathFormat0 - MWJava_Proj_tree - MWJava_Proj_HTMLAppWin32NameInternet Explorer - MWJava_Proj_compress0 - MWJava_Proj_simulator0 - MWJava_Proj_useVM\000\000macosx - MWJava_Proj_vmarguments - MWJava_Proj_vmName - MWJava_Proj_simPropFile - - - MWJavaDoc_Proj_Version1 - MWJavaDoc_Proj_Deprecated1 - MWJavaDoc_Proj_Author1 - MWJavaDoc_Proj_Index1 - MWJavaDoc_Proj_Tree1 - MWJavaDoc_Proj_SunResolveToSame0 - MWJavaDoc_Proj_Shortnames1 - MWJavaDoc_Proj_Folder0 - MWJavaDoc_Proj_GenerateAPILinks0 - MWJavaDoc_Proj_scopePublic - MWJavaDoc_Proj_fcreator1297303877 - MWJavaDoc_Proj_encodingName - MWJavaDoc_Proj_decodingName - MWJavaDoc_Proj_javaPackagePathhttp://java.sun.com/products/jdk/1.1/docs/api/ - - - MWMerge_MacOS_projectTypeApplication - MWMerge_MacOS_outputNameMerge Out - MWMerge_MacOS_outputCreator???? - MWMerge_MacOS_outputTypeAPPL - MWMerge_MacOS_suppressWarning0 - MWMerge_MacOS_copyFragments1 - MWMerge_MacOS_copyResources1 - MWMerge_MacOS_flattenResource0 - MWMerge_MacOS_flatFileNamea.rsrc - MWMerge_MacOS_flatFileOutputPath - Path: - PathFormatMacOS - PathRootProject - - MWMerge_MacOS_skipResources - DLGX - ckid - Proj - WSPC - - - - FileLockedfalse - ResourcesMapIsReadOnlyfalse - PrinterDriverIsMultiFinderCompatiblefalse - Invisiblefalse - HasBundlefalse - NameLockedfalse - Stationeryfalse - HasCustomIconfalse - Sharedfalse - HasBeenInitedfalse - Label0 - Comments - - - MWMacOSPackager_UsePackager0 - MWMacOSPackager_FolderToPackage - Path - PathFormatMacOS - PathRootAbsolute - - MWMacOSPackager_CreateClassicAlias0 - MWMacOSPackager_ClassicAliasMethodUseTargetOutput - MWMacOSPackager_ClassicAliasPath - Path - PathFormatMacOS - PathRootAbsolute - - MWMacOSPackager_CreatePkgInfo0 - MWMacOSPackager_PkgCreatorType???? - MWMacOSPackager_PkgFileTypeAPPL - - - MWCodeGen_PPC_structalignmentPPC_mw - MWCodeGen_PPC_tracebacktablesInline - MWCodeGen_PPC_processorGeneric - MWCodeGen_PPC_function_align4 - MWCodeGen_PPC_tocdata1 - MWCodeGen_PPC_largetoc0 - MWCodeGen_PPC_profiler0 - MWCodeGen_PPC_vectortocdata0 - MWCodeGen_PPC_poolconst0 - MWCodeGen_PPC_peephole1 - MWCodeGen_PPC_readonlystrings0 - MWCodeGen_PPC_linkerpoolsstrings0 - MWCodeGen_PPC_volatileasm0 - MWCodeGen_PPC_schedule0 - MWCodeGen_PPC_altivec0 - MWCodeGen_PPC_altivec_move_block0 - MWCodeGen_PPC_strictIEEEfp0 - MWCodeGen_PPC_fpcontract1 - MWCodeGen_PPC_genfsel0 - MWCodeGen_PPC_orderedfpcmp0 - - - MWCodeGen_MachO_structalignmentPPC_mw - MWCodeGen_MachO_profiler_enumOff - MWCodeGen_MachO_processorGeneric - MWCodeGen_MachO_function_align4 - MWCodeGen_MachO_common0 - MWCodeGen_MachO_peephole1 - MWCodeGen_MachO_readonlystrings0 - MWCodeGen_MachO_linkerpoolsstrings1 - MWCodeGen_MachO_volatileasm0 - MWCodeGen_MachO_schedule0 - MWCodeGen_MachO_altivec0 - MWCodeGen_MachO_vecmove0 - MWCodeGen_MachO_fp_ieee_strict0 - MWCodeGen_MachO_fpcontract1 - MWCodeGen_MachO_genfsel0 - MWCodeGen_MachO_fp_cmps_ordered0 - - - MWDisassembler_PPC_showcode1 - MWDisassembler_PPC_extended1 - MWDisassembler_PPC_mix0 - MWDisassembler_PPC_nohex0 - MWDisassembler_PPC_showdata1 - MWDisassembler_PPC_showexceptions1 - MWDisassembler_PPC_showsym1 - MWDisassembler_PPC_shownames1 - - - GlobalOptimizer_PPC_optimizationlevelLevel4 - GlobalOptimizer_PPC_optforSpeed - - - MWLinker_PPC_linksym0 - MWLinker_PPC_symfullpath1 - MWLinker_PPC_linkmap0 - MWLinker_PPC_nolinkwarnings0 - MWLinker_PPC_dontdeadstripinitcode0 - MWLinker_PPC_permitmultdefs0 - MWLinker_PPC_linkmodeFast - MWLinker_PPC_initname__wxinitialize - MWLinker_PPC_mainname - MWLinker_PPC_termname__wxterminate - - - MWLinker_MacOSX_linksym0 - MWLinker_MacOSX_symfullpath0 - MWLinker_MacOSX_nolinkwarnings0 - MWLinker_MacOSX_linkmap0 - MWLinker_MacOSX_dontdeadstripinitcode0 - MWLinker_MacOSX_permitmultdefs1 - MWLinker_MacOSX_use_objectivec_semantics0 - MWLinker_MacOSX_strip_debug_symbols0 - MWLinker_MacOSX_split_segs0 - MWLinker_MacOSX_report_msl_overloads0 - MWLinker_MacOSX_objects_follow_linkorder0 - MWLinker_MacOSX_linkmodeFast - MWLinker_MacOSX_exportsReferencedGlobals - MWLinker_MacOSX_sortcodeNone - MWLinker_MacOSX_mainnamestart - - - MWProject_MacOSX_typeSharedLibrary - MWProject_MacOSX_outfilewx_Carbon.shlb - MWProject_MacOSX_filecreator???? - MWProject_MacOSX_filetypeshlb - MWProject_MacOSX_vmaddress4096 - MWProject_MacOSX_usedefaultvmaddr1 - MWProject_MacOSX_flatrsrc0 - MWProject_MacOSX_flatrsrcfilename - MWProject_MacOSX_flatrsrcoutputdir - Path: - PathFormatMacOS - PathRootProject - - MWProject_MacOSX_installpath./ - MWProject_MacOSX_dont_prebind0 - MWProject_MacOSX_flat_namespace0 - MWProject_MacOSX_frameworkversionA - MWProject_MacOSX_currentversion0 - MWProject_MacOSX_flat_oldimpversion0 - - - MWLinker_MachO_exportsNone - MWLinker_MachO_mainnamestart - MWLinker_MachO_currentversion0 - MWLinker_MachO_compatibleversion0 - MWLinker_MachO_symfullpath0 - MWLinker_MachO_supresswarnings0 - MWLinker_MachO_multisymerror0 - MWLinker_MachO_prebind1 - MWLinker_MachO_deadstrip1 - MWLinker_MachO_objectivecsemantics0 - MWLinker_MachO_whichfileloaded0 - MWLinker_MachO_whyfileloaded0 - MWLinker_MachO_readonlyrelocsErrors - MWLinker_MachO_undefinedsymbolsErrors - MWLinker_MachO_twolevelnamespace1 - MWLinker_MachO_stripdebugsymbols0 - - - MWProject_MachO_typeExecutable - MWProject_MachO_outfilea.exe - MWProject_MachO_filecreator???? - MWProject_MachO_filetypeMEXE - MWProject_MachO_vmaddress4096 - MWProject_MachO_flatrsrc1 - MWProject_MachO_flatrsrcfilenamea.rsrc - MWProject_MachO_flatrsrcoutputdir - Path: - PathFormatMacOS - PathRootProject - - MWProject_MachO_installpath./ - MWProject_MachO_frameworkversion - - - MWPEF_exportsPragma - MWPEF_libfolder0 - MWPEF_sortcodeNone - MWPEF_expandbss0 - MWPEF_sharedata0 - MWPEF_olddefversion0 - MWPEF_oldimpversion0 - MWPEF_currentversion0 - MWPEF_fragmentname - MWPEF_collapsereloads0 - - - MWProject_PPC_typeSharedLibrary - MWProject_PPC_outfilewx_Carbon.shlb - MWProject_PPC_filecreatorcfmg - MWProject_PPC_filetypeshlb - MWProject_PPC_size0 - MWProject_PPC_minsize0 - MWProject_PPC_stacksize0 - MWProject_PPC_flags0 - MWProject_PPC_symfilename - MWProject_PPC_rsrcname - MWProject_PPC_rsrcheaderNative - MWProject_PPC_rsrctype???? - MWProject_PPC_rsrcid0 - MWProject_PPC_rsrcflags0 - MWProject_PPC_rsrcstore0 - MWProject_PPC_rsrcmerge0 - MWProject_PPC_flatrsrc0 - MWProject_PPC_flatrsrcoutputdir - Path: - PathFormatMacOS - PathRootProject - - MWProject_PPC_flatrsrcfilename - - - MWAssembler_PPC_auxheader0 - MWAssembler_PPC_symmodeMac - MWAssembler_PPC_dialectPPC - MWAssembler_PPC_prefixfile - MWAssembler_PPC_typecheck0 - MWAssembler_PPC_warnings0 - MWAssembler_PPC_casesensitive0 - - - PList_OutputTypeFile - PList_OutputEncodingUTF-8 - PList_Prefix - PList_FileFilenameInfo.plist - PList_FileDirectory - Path: - PathFormatMacOS - PathRootProject - - PList_ResourceTypeplst - PList_ResourceID0 - PList_ResourceName - - - MWRez_Language_maxwidth80 - MWRez_Language_scriptRoman - MWRez_Language_alignmentAlign1 - MWRez_Language_filtermodeFilterSkip - MWRez_Language_suppresswarnings0 - MWRez_Language_escapecontrolchars1 - MWRez_Language_prefixname - MWRez_Language_filteredtypes'CODE' 'DATA' 'PICT' - - - MWWinRC_prefixname - - - MWCodeGen_X86_processorGeneric - MWCodeGen_X86_alignmentbytes8 - MWCodeGen_X86_exceptionsZeroOverhead - MWCodeGen_X86_name_manglingMWWin32 - MWCodeGen_X86_use_extinst0 - MWCodeGen_X86_extinst_mmx0 - MWCodeGen_X86_extinst_3dnow0 - MWCodeGen_X86_use_mmx_3dnow_convention0 - MWCodeGen_X86_extinst_cmov0 - MWCodeGen_X86_extinst_sse0 - MWCodeGen_X86_extinst_sse20 - MWCodeGen_X86_intrinsics0 - MWCodeGen_X86_optimizeasm0 - MWCodeGen_X86_disableopts0 - MWCodeGen_X86_profile0 - MWLinker_X86_runtimeCustom - MWCodeGen_X86_readonlystrings0 - - - MWLinker_X86_subsysmajorid4 - MWLinker_X86_subsysminorid0 - MWCOFF_X86_opsysmajorid4 - MWCOFF_X86_opsysminorid0 - MWLinker_X86_usrmajorid0 - MWLinker_X86_usrminorid0 - MWProject_X86_maxstacksize1024 - MWProject_X86_minstacksize4 - MWProject_X86_size1024 - MWProject_X86_minsize4 - MWCOFF_X86_coff_flags0 - MWCOFF_X86_dll_flags0 - MWProject_X86_baseaddress4194304 - MWCOFF_X86_filealign512 - MWCOFF_X86_sectionalign4096 - - - PDisasmX86_showHeaderstrue - PDisasmX86_showSectHeaderstrue - PDisasmX86_showSymTabtrue - PDisasmX86_showCodetrue - PDisasmX86_showDatatrue - PDisasmX86_showDebugfalse - PDisasmX86_showExceptionsfalse - PDisasmX86_showRawfalse - PDisasmX86_showAllRawfalse - PDisasmX86_showSourcefalse - PDisasmX86_showRelocationtrue - PDisasmX86_showHextrue - PDisasmX86_showCommentsfalse - PDisasmX86_showSymDefstrue - PDisasmX86_unmangletrue - PDisasmX86_verbosetrue - PDisasmX86_resolveRelocstrue - PDisasmX86_resolveLocalsfalse - - - MWDebugger_X86_Exceptions - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - - - - GlobalOptimizer_X86_optimizationlevelLevel0 - GlobalOptimizer_X86_optforSpeed - - - MWLinker_X86_entrypointusageDefault - MWLinker_X86_entrypoint - MWLinker_X86_subsystemWinGUI - MWLinker_X86_commandfile - MWLinker_X86_generatemap0 - MWLinker_X86_linksym1 - MWLinker_X86_linkCV1 - MWLinker_X86_symfullpathfalse - MWLinker_X86_linkdebugtrue - MWLinker_X86_checksumfalse - MWLinker_X86_zero_init_bssfalse - MWLinker_X86_mergedatafalse - MWLinker_X86_usedefaultlibsfalse - MWLinker_X86_adddefaultlibsfalse - MWLinker_X86_nowarningsfalse - MWLinker_X86_verbosefalse - - - MWProject_X86_typeLibrary - MWProject_X86_outfilewx_x86_d.lib - MWProject_X86_importlib - MWProject_X86_setimportlibdirfalse - MWProject_X86_dontgenerateimportlibfalse - MWProject_X86_oldformatlibfalse - MWProject_X86_replaceobjextensionfalse - MWProject_X86_copyallfilesfalse - - - - PathRelative - Project - :mac:carbon: - :accel.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :app.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :bitmap.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :bmpbuttn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :brush.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :button.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :checkbox.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :checklst.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :choice.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :clipbrd.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :colordlg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :colour.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :combobox.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :control.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :cursor.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :data.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :dc.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :dcclient.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :dcmemory.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :dcscreen.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :dialog.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :dirdlg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :filedlg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :font.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :fontdlg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :frame.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :gauge.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :gdiobj.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :icon.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :joystick.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :listbox.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :main.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :mdi.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :menu.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :menuitem.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :minifram.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :msgdlg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :palette.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :pen.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :printdlg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :radiobox.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :radiobut.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :region.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :scrolbar.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :settings.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :slider.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :spinbutt.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :statbmp.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :statbox.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :stattext.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :tabctrl.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :textctrl.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :thread.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :timer.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :toolbar.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :utils.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :utilsexc.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :sound.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :window.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :printmac.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :dcprint.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :uma.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :sckipc.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :matrix.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :tbarbase.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :imagjpeg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :longlong.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :docmdi.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :appcmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :utilscmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :dynlib.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :extended.c - MacOS - Text - Debug - - - PathRelative - Project - :common: - :sckstrm.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :zstream.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :process.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :sizer.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :imagall.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :imaggif.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :imagpcx.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :cmndata.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :ftp.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :menucmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :string.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :wfstream.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :stream.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :gdicmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :protocol.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :layout.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :valgen.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :intl.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :list.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :socket.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :hash.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :dlgcmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :gifdecod.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :filefn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :wincmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :wxchar.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :memory.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :mstream.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :lboxcmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :fs_inet.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :event.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :image.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :ipcbase.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :tokenzr.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :txtstrm.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :filesys.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :url.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :fs_zip.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :prntbase.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :dcbase.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :object.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :http.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :module.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :validate.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :file.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :config.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :fileconf.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :timercmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :framecmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :textfile.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :dynarray.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :choiccmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :helpbase.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :ctrlsub.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :ctrlcmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :strconv.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :sckfile.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :valtext.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :datstrm.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :sckaddr.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :variant.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :dbtable.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :fontcmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :ffile.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :paper.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :clipcmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :imagpnm.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :imagpng.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :imagbmp.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :zipstrm.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :log.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :textcmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :laywin.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :busyinfo.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :listctrl.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :textdlgg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :tipdlg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :numdlgg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :sashwin.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :dcpsg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :panelg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :tabg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :choicdgg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :wizard.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :progdlgg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :caret.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :statusbr.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :logg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :fontdlgg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :splitter.cpp - MacOS - Text - Debug - - - Name - db.cpp - MacOS - Text - Debug - - - Name - dobjcmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :fontmap.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :geometry.cpp - MacOS - Text - Debug - - - Name - colrdlgg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :fontutil.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :dataobj.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :m_list.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :m_tables.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :htmlwin.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :m_pre.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :m_image.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :htmprint.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :htmlfilt.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :htmlpars.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :htmltag.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :m_hline.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :winpars.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :htmlcell.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :m_layout.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :m_fonts.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :m_links.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :fontenum.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :datetime.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :encconv.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :mimecmn.cpp - MacOS - Text - Debug - - - Name - metafile.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :macnotfy.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :statbrma.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :tooltip.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :statlmac.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :imagtiff.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :treectlg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :notebmac.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :m_dflist.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :treebase.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :cshelp.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :dirmac.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :mimetmac.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :filename.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :spinctrl.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :glcanvas.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :xpmdecod.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :imagxpm.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :dirctrlg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :helpctrl.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :helpfrm.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :helpdata.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :tipwin.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :radiocmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :nbkbase.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :scrlwing.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :gaugecmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :containr.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :quantize.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :toplvcmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :toplevel.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :gridsel.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :grid.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :statbar.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :clntdata.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :textbuf.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :dragimgg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :calctrl.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :bmpbase.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :cmdline.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :cmdproc.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :dndcmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :dnd.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :dbgrid.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :dircmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :dseldlg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :dynload.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :effects.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :fddlgcmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :fs_mem.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :regex.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :sysopt.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :imagiff.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :docview.cpp - MacOS - Text - Debug - - - PathRelative - Project - ::include: - :wxshlb_cwc.pch - MacOS - Text - Debug - - - PathRelative - Project - ::include: - :wxshlb_cwc.pch++ - MacOS - Text - Debug - - - PathRelative - CodeWarrior - :MacOS Support: - :Libraries:Runtime:Libs:MSL_ShLibRuntime_PPC.Lib - MacOS - Library - Debug - - - PathRelative - Project - :generic: - :splash.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :fdrepdlg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :gridctrl.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :m_style.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :hashmap.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :dirdlgg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :iconbndl.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :artprov.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :artstd.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :imagfill.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :msgout.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :settcmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :popupcmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :printps.cpp - MacOS - Text - Debug - - - PathRelative - Project - :jpeg: - jpegM8.mcp - Unix - Project - - - - PathRelative - Project - :png: - pngM8.mcp - Unix - Project - - - - PathRelative - Project - :zlib: - zlibM8.mcp - Unix - Project - - - - PathRelative - Project - :tiff: - tiffM8.mcp - Unix - Project - - - - FileRelative - ../../lib/jpeg_PPC.lib - Unix - - PathRelative - Project - :jpeg: - jpegM8.mcp - Unix - - Library - Debug, TargetOutputFile - - - FileRelative - ../../lib/png_PPC.lib - Unix - - PathRelative - Project - :png: - pngM8.mcp - Unix - - Library - Debug, TargetOutputFile - - - FileRelative - ../../lib/zlib_PPC.lib - Unix - - PathRelative - Project - :zlib: - zlibM8.mcp - Unix - - Library - Debug, TargetOutputFile - - - FileRelative - ../../lib/tif_PPC.lib - Unix - - PathRelative - Project - :tiff: - tiffM8.mcp - Unix - - Library - Debug, TargetOutputFile - - - PathRelative - Project - :regex: - regexM8.mcp - Unix - Project - - - - FileRelative - ../../lib/regex_PPC.lib - Unix - - PathRelative - Project - :regex: - regexM8.mcp - Unix - - Library - Debug, TargetOutputFile - - - PathRelative - CodeWarrior - :MSL: - MSL_C/MSL_MacOS/Src/console.stubs.c - Unix - Text - Debug - - - PathRelative - Project - :common: - datacmn.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - rgncmn.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - accesscmn.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - dpycmn.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - taskbarcmn.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - fldlgcmn.cpp - Unix - Text - Debug - - - PathRelative - Project - :generic: - :selstore.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - appbase.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - fmapbase.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - stopwatch.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - init.cpp - Unix - Text - Debug - - - PathRelative - CodeWarrior - :MacOS Support: - Universal/Libraries/StubLibraries/CarbonFrameworkLib - Unix - Library - Debug - - - PathRelative - CodeWarrior - :MacOS Support: - Universal/Libraries/StubLibraries/CarbonLib - Unix - Library - Debug - - - PathRelative - Project - :generic: - renderg.cpp - Unix - Text - Debug - - - PathRelative - Project - :mac:carbon: - renderer.cpp - Unix - Text - Debug - - - PathRelative - Project - xml - xml.cpp - Unix - Text - Debug - - - PathRelative - Project - expat/lib - xmlparse.c - Unix - Text - Debug - - - PathRelative - Project - expat/lib - xmlrole.c - Unix - Text - Debug - - - PathRelative - Project - expat/lib - xmltok.c - Unix - Text - Debug - - - PathRelative - Project - :common: - rendcmn.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - bookctrl.cpp - Unix - Text - Debug - - - PathRelative - CodeWarrior - :MacOS Support: - MetroNub Utilities/MNU Carbon.Lib - Unix - Library - Debug - - - PathRelative - Project - :mac:carbon: - gsocket.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - stockitem.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_bmp.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_bmpbt.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_bttn.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_cald.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_chckb.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_chckl.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_choic.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_combo.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_dlg.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_frame.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_gauge.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_gdctl.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_html.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_listb.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_listc.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_menu.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_notbk.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_panel.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_radbt.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_radbx.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_scrol.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_scwin.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_sizer.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_slidr.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_spin.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_split.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_statbar.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_stbmp.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_stbox.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_stlin.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_sttxt.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_text.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_tglbtn.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_toolb.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_tree.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_unkwn.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_wizrd.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xmlres.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xmlrsall.cpp - Unix - Text - Debug - - - PathRelative - Project - mac/corefoundation - cfstring.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - uri.cpp - Unix - Text - Debug - - - PathRelative - Project - :mac:carbon: - display.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - archive.cpp - Unix - Text - Debug - - - PathRelative - Project - :generic: - datectlg.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - stdpbase.cpp - Unix - Text - Debug - - - PathRelative - Project - :mac:carbon: - imaglist.cpp - Unix - Text - Debug - - - PathRelative - Project - mac/corefoundation - stdpaths_cf.cpp - Unix - Text - Debug - - - PathRelative - Project - :mac:carbon: - morefilex/MoreFilesX.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_choicbk.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_datectrl.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_listbk.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - gbsizer.cpp - Unix - Text - Debug - - - PathRelative - Project - :generic: - choicbkg.cpp - Unix - Text - Debug - - - PathRelative - Project - :generic: - listbkg.cpp - Unix - Text - Debug - - - PathRelative - CodeWarrior - :MacOS Support: - Libraries/Runtime/Libs/MSL_All_Carbon.Shlb - Unix - Library - Debug - - - PathRelative - Project - :common: - debugrpt.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_mdi.cpp - Unix - Text - Debug - - - PathRelative - CodeWarrior - :MacOS Support: - Libraries/Runtime/Libs/MSL_ShLibRuntime_PPC_D.Lib - Unix - Library - Debug - - - - - FileRelative - ../../lib/regex_PPC.lib - Unix - - PathRelative - Project - :regex: - regexM8.mcp - Unix - - - - FileRelative - ../../lib/tif_PPC.lib - Unix - - PathRelative - Project - :tiff: - tiffM8.mcp - Unix - - - - FileRelative - ../../lib/zlib_PPC.lib - Unix - - PathRelative - Project - :zlib: - zlibM8.mcp - Unix - - - - FileRelative - ../../lib/png_PPC.lib - Unix - - PathRelative - Project - :png: - pngM8.mcp - Unix - - - - FileRelative - ../../lib/jpeg_PPC.lib - Unix - - PathRelative - Project - :jpeg: - jpegM8.mcp - Unix - - - - PathRelative - Project - :mac:carbon: - :accel.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :app.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :bitmap.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :bmpbuttn.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :brush.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :button.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :checkbox.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :checklst.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :choice.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :clipbrd.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :colordlg.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :colour.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :combobox.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :control.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :cursor.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :data.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :dc.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :dcclient.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :dcmemory.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :dcscreen.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :dialog.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :dirdlg.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :filedlg.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :font.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :fontdlg.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :frame.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :gauge.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :gdiobj.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :icon.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :joystick.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :listbox.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :main.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :mdi.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :menu.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :menuitem.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :minifram.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :msgdlg.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :palette.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :pen.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :printdlg.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :radiobox.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :radiobut.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :region.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :scrolbar.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :settings.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :slider.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :spinbutt.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :statbmp.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :statbox.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :stattext.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :tabctrl.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :textctrl.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :thread.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :timer.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :toolbar.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :utils.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :utilsexc.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :sound.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :window.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :printmac.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :dcprint.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :uma.cpp - MacOS - - - PathRelative - Project - :common: - :sckipc.cpp - MacOS - - - PathRelative - Project - :common: - :matrix.cpp - MacOS - - - PathRelative - Project - :common: - :tbarbase.cpp - MacOS - - - PathRelative - Project - :common: - :imagjpeg.cpp - MacOS - - - PathRelative - Project - :common: - :longlong.cpp - MacOS - - - PathRelative - Project - :common: - :docmdi.cpp - MacOS - - - PathRelative - Project - :common: - :appcmn.cpp - MacOS - - - PathRelative - Project - :common: - :utilscmn.cpp - MacOS - - - PathRelative - Project - :common: - :dynlib.cpp - MacOS - - - PathRelative - Project - :common: - :extended.c - MacOS - - - PathRelative - Project - :common: - :sckstrm.cpp - MacOS - - - PathRelative - Project - :common: - :zstream.cpp - MacOS - - - PathRelative - Project - :common: - :process.cpp - MacOS - - - PathRelative - Project - :common: - :sizer.cpp - MacOS - - - PathRelative - Project - :common: - :imagall.cpp - MacOS - - - PathRelative - Project - :common: - :imaggif.cpp - MacOS - - - PathRelative - Project - :common: - :imagpcx.cpp - MacOS - - - PathRelative - Project - :common: - :cmndata.cpp - MacOS - - - PathRelative - Project - :common: - :ftp.cpp - MacOS - - - PathRelative - Project - :common: - :menucmn.cpp - MacOS - - - PathRelative - Project - :common: - :string.cpp - MacOS - - - PathRelative - Project - :common: - :wfstream.cpp - MacOS - - - PathRelative - Project - :common: - :stream.cpp - MacOS - - - PathRelative - Project - :common: - :gdicmn.cpp - MacOS - - - PathRelative - Project - :common: - :protocol.cpp - MacOS - - - PathRelative - Project - :common: - :layout.cpp - MacOS - - - PathRelative - Project - :common: - :valgen.cpp - MacOS - - - PathRelative - Project - :common: - :intl.cpp - MacOS - - - PathRelative - Project - :common: - :list.cpp - MacOS - - - PathRelative - Project - :common: - :socket.cpp - MacOS - - - PathRelative - Project - :common: - :hash.cpp - MacOS - - - PathRelative - Project - :common: - :dlgcmn.cpp - MacOS - - - PathRelative - Project - :common: - :gifdecod.cpp - MacOS - - - PathRelative - Project - :common: - :filefn.cpp - MacOS - - - PathRelative - Project - :common: - :wincmn.cpp - MacOS - - - PathRelative - Project - :common: - :wxchar.cpp - MacOS - - - PathRelative - Project - :common: - :memory.cpp - MacOS - - - PathRelative - Project - :common: - :mstream.cpp - MacOS - - - PathRelative - Project - :common: - :lboxcmn.cpp - MacOS - - - PathRelative - Project - :common: - :fs_inet.cpp - MacOS - - - PathRelative - Project - :common: - :event.cpp - MacOS - - - PathRelative - Project - :common: - :image.cpp - MacOS - - - PathRelative - Project - :common: - :ipcbase.cpp - MacOS - - - PathRelative - Project - :common: - :tokenzr.cpp - MacOS - - - PathRelative - Project - :common: - :txtstrm.cpp - MacOS - - - PathRelative - Project - :common: - :filesys.cpp - MacOS - - - PathRelative - Project - :common: - :url.cpp - MacOS - - - PathRelative - Project - :common: - :fs_zip.cpp - MacOS - - - PathRelative - Project - :common: - :prntbase.cpp - MacOS - - - PathRelative - Project - :common: - :dcbase.cpp - MacOS - - - PathRelative - Project - :common: - :object.cpp - MacOS - - - PathRelative - Project - :common: - :http.cpp - MacOS - - - PathRelative - Project - :common: - :module.cpp - MacOS - - - PathRelative - Project - :common: - :validate.cpp - MacOS - - - PathRelative - Project - :common: - :file.cpp - MacOS - - - PathRelative - Project - :common: - :config.cpp - MacOS - - - PathRelative - Project - :common: - :fileconf.cpp - MacOS - - - PathRelative - Project - :common: - :timercmn.cpp - MacOS - - - PathRelative - Project - :common: - :framecmn.cpp - MacOS - - - PathRelative - Project - :common: - :textfile.cpp - MacOS - - - PathRelative - Project - :common: - :dynarray.cpp - MacOS - - - PathRelative - Project - :common: - :choiccmn.cpp - MacOS - - - PathRelative - Project - :common: - :helpbase.cpp - MacOS - - - PathRelative - Project - :common: - :ctrlsub.cpp - MacOS - - - PathRelative - Project - :common: - :ctrlcmn.cpp - MacOS - - - PathRelative - Project - :common: - :strconv.cpp - MacOS - - - PathRelative - Project - :common: - :sckfile.cpp - MacOS - - - PathRelative - Project - :common: - :valtext.cpp - MacOS - - - PathRelative - Project - :common: - :datstrm.cpp - MacOS - - - PathRelative - Project - :common: - :sckaddr.cpp - MacOS - - - PathRelative - Project - :common: - :variant.cpp - MacOS - - - PathRelative - Project - :common: - :dbtable.cpp - MacOS - - - PathRelative - Project - :common: - :fontcmn.cpp - MacOS - - - PathRelative - Project - :common: - :ffile.cpp - MacOS - - - PathRelative - Project - :common: - :paper.cpp - MacOS - - - PathRelative - Project - :common: - :clipcmn.cpp - MacOS - - - PathRelative - Project - :common: - :imagpnm.cpp - MacOS - - - PathRelative - Project - :common: - :imagpng.cpp - MacOS - - - PathRelative - Project - :common: - :imagbmp.cpp - MacOS - - - PathRelative - Project - :common: - :zipstrm.cpp - MacOS - - - PathRelative - Project - :common: - :log.cpp - MacOS - - - PathRelative - Project - :common: - :textcmn.cpp - MacOS - - - PathRelative - Project - :generic: - :laywin.cpp - MacOS - - - PathRelative - Project - :generic: - :busyinfo.cpp - MacOS - - - PathRelative - Project - :generic: - :listctrl.cpp - MacOS - - - PathRelative - Project - :generic: - :textdlgg.cpp - MacOS - - - PathRelative - Project - :generic: - :tipdlg.cpp - MacOS - - - PathRelative - Project - :generic: - :numdlgg.cpp - MacOS - - - PathRelative - Project - :generic: - :sashwin.cpp - MacOS - - - PathRelative - Project - :generic: - :dcpsg.cpp - MacOS - - - PathRelative - Project - :generic: - :panelg.cpp - MacOS - - - PathRelative - Project - :generic: - :tabg.cpp - MacOS - - - PathRelative - Project - :generic: - :choicdgg.cpp - MacOS - - - PathRelative - Project - :generic: - :wizard.cpp - MacOS - - - PathRelative - Project - :generic: - :progdlgg.cpp - MacOS - - - PathRelative - Project - :generic: - :caret.cpp - MacOS - - - PathRelative - Project - :generic: - :statusbr.cpp - MacOS - - - PathRelative - Project - :generic: - :logg.cpp - MacOS - - - PathRelative - Project - :generic: - :fontdlgg.cpp - MacOS - - - PathRelative - Project - :generic: - :splitter.cpp - MacOS - - - Name - db.cpp - MacOS - - - Name - dobjcmn.cpp - MacOS - - - PathRelative - Project - :common: - :fontmap.cpp - MacOS - - - PathRelative - Project - :common: - :geometry.cpp - MacOS - - - Name - colrdlgg.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :fontutil.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :dataobj.cpp - MacOS - - - PathRelative - Project - :html: - :m_list.cpp - MacOS - - - PathRelative - Project - :html: - :m_tables.cpp - MacOS - - - PathRelative - Project - :html: - :htmlwin.cpp - MacOS - - - PathRelative - Project - :html: - :m_pre.cpp - MacOS - - - PathRelative - Project - :html: - :m_image.cpp - MacOS - - - PathRelative - Project - :html: - :htmprint.cpp - MacOS - - - PathRelative - Project - :html: - :htmlfilt.cpp - MacOS - - - PathRelative - Project - :html: - :htmlpars.cpp - MacOS - - - PathRelative - Project - :html: - :htmltag.cpp - MacOS - - - PathRelative - Project - :html: - :m_hline.cpp - MacOS - - - PathRelative - Project - :html: - :winpars.cpp - MacOS - - - PathRelative - Project - :html: - :htmlcell.cpp - MacOS - - - PathRelative - Project - :html: - :m_layout.cpp - MacOS - - - PathRelative - Project - :html: - :m_fonts.cpp - MacOS - - - PathRelative - Project - :html: - :m_links.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :fontenum.cpp - MacOS - - - PathRelative - Project - :common: - :datetime.cpp - MacOS - - - PathRelative - Project - :common: - :encconv.cpp - MacOS - - - PathRelative - Project - :common: - :mimecmn.cpp - MacOS - - - Name - metafile.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :macnotfy.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :statbrma.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :tooltip.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :statlmac.cpp - MacOS - - - PathRelative - Project - :common: - :imagtiff.cpp - MacOS - - - PathRelative - Project - :generic: - :treectlg.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :notebmac.cpp - MacOS - - - PathRelative - Project - :html: - :m_dflist.cpp - MacOS - - - PathRelative - Project - :common: - :treebase.cpp - MacOS - - - PathRelative - Project - :common: - :cshelp.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :dirmac.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :mimetmac.cpp - MacOS - - - PathRelative - Project - :common: - :filename.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :spinctrl.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :glcanvas.cpp - MacOS - - - PathRelative - Project - :common: - :xpmdecod.cpp - MacOS - - - PathRelative - Project - :common: - :imagxpm.cpp - MacOS - - - PathRelative - Project - :generic: - :dirctrlg.cpp - MacOS - - - PathRelative - Project - :html: - :helpctrl.cpp - MacOS - - - PathRelative - Project - :html: - :helpfrm.cpp - MacOS - - - PathRelative - Project - :html: - :helpdata.cpp - MacOS - - - PathRelative - Project - :generic: - :tipwin.cpp - MacOS - - - PathRelative - Project - :common: - :radiocmn.cpp - MacOS - - - PathRelative - Project - :common: - :nbkbase.cpp - MacOS - - - PathRelative - Project - :generic: - :scrlwing.cpp - MacOS - - - PathRelative - Project - :common: - :gaugecmn.cpp - MacOS - - - PathRelative - Project - :common: - :containr.cpp - MacOS - - - PathRelative - Project - :common: - :quantize.cpp - MacOS - - - PathRelative - Project - :common: - :toplvcmn.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :toplevel.cpp - MacOS - - - PathRelative - Project - :generic: - :gridsel.cpp - MacOS - - - PathRelative - Project - :generic: - :grid.cpp - MacOS - - - PathRelative - Project - :common: - :statbar.cpp - MacOS - - - PathRelative - Project - :common: - :clntdata.cpp - MacOS - - - PathRelative - Project - :common: - :textbuf.cpp - MacOS - - - PathRelative - Project - :generic: - :dragimgg.cpp - MacOS - - - PathRelative - Project - :generic: - :calctrl.cpp - MacOS - - - PathRelative - Project - :common: - :bmpbase.cpp - MacOS - - - PathRelative - Project - :common: - :cmdline.cpp - MacOS - - - PathRelative - Project - :common: - :cmdproc.cpp - MacOS - - - PathRelative - Project - :common: - :dndcmn.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :dnd.cpp - MacOS - - - PathRelative - Project - :common: - :dbgrid.cpp - MacOS - - - PathRelative - Project - :common: - :dircmn.cpp - MacOS - - - PathRelative - Project - :common: - :dseldlg.cpp - MacOS - - - PathRelative - Project - :common: - :dynload.cpp - MacOS - - - PathRelative - Project - :common: - :effects.cpp - MacOS - - - PathRelative - Project - :common: - :fddlgcmn.cpp - MacOS - - - PathRelative - Project - :common: - :fs_mem.cpp - MacOS - - - PathRelative - Project - :common: - :regex.cpp - MacOS - - - PathRelative - Project - :common: - :sysopt.cpp - MacOS - - - PathRelative - Project - :common: - :imagiff.cpp - MacOS - - - PathRelative - Project - :common: - :docview.cpp - MacOS - - - PathRelative - Project - ::include: - :wxshlb_cwc.pch - MacOS - - - PathRelative - Project - ::include: - :wxshlb_cwc.pch++ - MacOS - - - PathRelative - CodeWarrior - :MacOS Support: - :Libraries:Runtime:Libs:MSL_ShLibRuntime_PPC.Lib - MacOS - - - PathRelative - CodeWarrior - :MSL: - MSL_C/MSL_MacOS/Src/console.stubs.c - Unix - - - PathRelative - Project - :generic: - :splash.cpp - MacOS - - - PathRelative - Project - :generic: - :fdrepdlg.cpp - MacOS - - - PathRelative - Project - :generic: - :gridctrl.cpp - MacOS - - - PathRelative - Project - :html: - :m_style.cpp - MacOS - - - PathRelative - Project - :common: - :hashmap.cpp - MacOS - - - PathRelative - Project - :generic: - :dirdlgg.cpp - MacOS - - - PathRelative - Project - :common: - :iconbndl.cpp - MacOS - - - PathRelative - Project - :common: - :artprov.cpp - MacOS - - - PathRelative - Project - :common: - :artstd.cpp - MacOS - - - PathRelative - Project - :common: - :imagfill.cpp - MacOS - - - PathRelative - Project - :common: - :msgout.cpp - MacOS - - - PathRelative - Project - :common: - :settcmn.cpp - MacOS - - - PathRelative - Project - :common: - :popupcmn.cpp - MacOS - - - PathRelative - Project - :generic: - :printps.cpp - MacOS - - - PathRelative - Project - :common: - datacmn.cpp - Unix - - - PathRelative - Project - :common: - rgncmn.cpp - Unix - - - PathRelative - Project - :common: - accesscmn.cpp - Unix - - - PathRelative - Project - :common: - dpycmn.cpp - Unix - - - PathRelative - Project - :common: - taskbarcmn.cpp - Unix - - - PathRelative - Project - :common: - fldlgcmn.cpp - Unix - - - PathRelative - Project - :generic: - :selstore.cpp - MacOS - - - PathRelative - Project - :common: - appbase.cpp - Unix - - - PathRelative - Project - :common: - fmapbase.cpp - Unix - - - PathRelative - Project - :common: - stopwatch.cpp - Unix - - - PathRelative - Project - :common: - init.cpp - Unix - - - PathRelative - CodeWarrior - :MacOS Support: - Universal/Libraries/StubLibraries/CarbonFrameworkLib - Unix - - - PathRelative - CodeWarrior - :MacOS Support: - Universal/Libraries/StubLibraries/CarbonLib - Unix - - - PathRelative - Project - :generic: - renderg.cpp - Unix - - - PathRelative - Project - :mac:carbon: - renderer.cpp - Unix - - - PathRelative - Project - xml - xml.cpp - Unix - - - PathRelative - Project - expat/lib - xmlparse.c - Unix - - - PathRelative - Project - expat/lib - xmlrole.c - Unix - - - PathRelative - Project - expat/lib - xmltok.c - Unix - - - PathRelative - Project - :common: - rendcmn.cpp - Unix - - - PathRelative - Project - :common: - bookctrl.cpp - Unix - - - PathRelative - CodeWarrior - :MacOS Support: - MetroNub Utilities/MNU Carbon.Lib - Unix - - - PathRelative - Project - :mac:carbon: - gsocket.cpp - Unix - - - PathRelative - Project - :common: - stockitem.cpp - Unix - - - PathRelative - Project - xrc - xh_bmp.cpp - Unix - - - PathRelative - Project - xrc - xh_bmpbt.cpp - Unix - - - PathRelative - Project - xrc - xh_bttn.cpp - Unix - - - PathRelative - Project - xrc - xh_cald.cpp - Unix - - - PathRelative - Project - xrc - xh_chckb.cpp - Unix - - - PathRelative - Project - xrc - xh_chckl.cpp - Unix - - - PathRelative - Project - xrc - xh_choic.cpp - Unix - - - PathRelative - Project - xrc - xh_combo.cpp - Unix - - - PathRelative - Project - xrc - xh_dlg.cpp - Unix - - - PathRelative - Project - xrc - xh_frame.cpp - Unix - - - PathRelative - Project - xrc - xh_gauge.cpp - Unix - - - PathRelative - Project - xrc - xh_gdctl.cpp - Unix - - - PathRelative - Project - xrc - xh_html.cpp - Unix - - - PathRelative - Project - xrc - xh_listb.cpp - Unix - - - PathRelative - Project - xrc - xh_listc.cpp - Unix - - - PathRelative - Project - xrc - xh_menu.cpp - Unix - - - PathRelative - Project - xrc - xh_notbk.cpp - Unix - - - PathRelative - Project - xrc - xh_panel.cpp - Unix - - - PathRelative - Project - xrc - xh_radbt.cpp - Unix - - - PathRelative - Project - xrc - xh_radbx.cpp - Unix - - - PathRelative - Project - xrc - xh_scrol.cpp - Unix - - - PathRelative - Project - xrc - xh_scwin.cpp - Unix - - - PathRelative - Project - xrc - xh_sizer.cpp - Unix - - - PathRelative - Project - xrc - xh_slidr.cpp - Unix - - - PathRelative - Project - xrc - xh_spin.cpp - Unix - - - PathRelative - Project - xrc - xh_split.cpp - Unix - - - PathRelative - Project - xrc - xh_statbar.cpp - Unix - - - PathRelative - Project - xrc - xh_stbmp.cpp - Unix - - - PathRelative - Project - xrc - xh_stbox.cpp - Unix - - - PathRelative - Project - xrc - xh_stlin.cpp - Unix - - - PathRelative - Project - xrc - xh_sttxt.cpp - Unix - - - PathRelative - Project - xrc - xh_text.cpp - Unix - - - PathRelative - Project - xrc - xh_tglbtn.cpp - Unix - - - PathRelative - Project - xrc - xh_toolb.cpp - Unix - - - PathRelative - Project - xrc - xh_tree.cpp - Unix - - - PathRelative - Project - xrc - xh_unkwn.cpp - Unix - - - PathRelative - Project - xrc - xh_wizrd.cpp - Unix - - - PathRelative - Project - xrc - xmlres.cpp - Unix - - - PathRelative - Project - xrc - xmlrsall.cpp - Unix - - - PathRelative - Project - mac/corefoundation - cfstring.cpp - Unix - - - PathRelative - Project - :common: - uri.cpp - Unix - - - PathRelative - Project - :mac:carbon: - display.cpp - Unix - - - PathRelative - Project - :common: - archive.cpp - Unix - - - PathRelative - Project - :generic: - datectlg.cpp - Unix - - - PathRelative - Project - :common: - stdpbase.cpp - Unix - - - PathRelative - Project - :mac:carbon: - imaglist.cpp - Unix - - - PathRelative - Project - mac/corefoundation - stdpaths_cf.cpp - Unix - - - PathRelative - Project - :mac:carbon: - morefilex/MoreFilesX.cpp - Unix - - - PathRelative - Project - xrc - xh_choicbk.cpp - Unix - - - PathRelative - Project - xrc - xh_datectrl.cpp - Unix - - - PathRelative - Project - xrc - xh_listbk.cpp - Unix - - - PathRelative - Project - :common: - gbsizer.cpp - Unix - - - PathRelative - Project - :generic: - choicbkg.cpp - Unix - - - PathRelative - Project - :generic: - listbkg.cpp - Unix - - - PathRelative - CodeWarrior - :MacOS Support: - Libraries/Runtime/Libs/MSL_All_Carbon.Shlb - Unix - - - PathRelative - Project - :common: - debugrpt.cpp - Unix - - - PathRelative - Project - xrc - xh_mdi.cpp - Unix - - - PathRelative - CodeWarrior - :MacOS Support: - Libraries/Runtime/Libs/MSL_ShLibRuntime_PPC_D.Lib - Unix - - - - - - PathRelative - Project - :jpeg: - jpegM8.mcp - Unix - - - - PPC - Build, LinkAgainst - - FileRelative - ../../lib/jpeg_PPC.lib - Unix - - PathRelative - Project - :jpeg: - jpegM8.mcp - Unix - - - - - - - - PathRelative - Project - :png: - pngM8.mcp - Unix - - - - PPC - Build, LinkAgainst - - FileRelative - ../../lib/png_PPC.lib - Unix - - PathRelative - Project - :png: - pngM8.mcp - Unix - - - - - - - - PathRelative - Project - :zlib: - zlibM8.mcp - Unix - - - - PPC - Build, LinkAgainst - - FileRelative - ../../lib/zlib_PPC.lib - Unix - - PathRelative - Project - :zlib: - zlibM8.mcp - Unix - - - - - - - - PathRelative - Project - :tiff: - tiffM8.mcp - Unix - - - - PPC - Build, LinkAgainst - - FileRelative - ../../lib/tif_PPC.lib - Unix - - PathRelative - Project - :tiff: - tiffM8.mcp - Unix - - - - - - - - PathRelative - Project - :regex: - regexM8.mcp - Unix - - - - PPC - Build, LinkAgainst - - FileRelative - ../../lib/regex_PPC.lib - Unix - - PathRelative - Project - :regex: - regexM8.mcp - Unix - - - - - - - - - wxshlba Carbon release - - - - UserSourceTrees - - - AlwaysSearchUserPathsfalse - InterpretDOSAndUnixPathstrue - RequireFrameworkStyleIncludesfalse - UserSearchPaths - - SearchPath - Path::include: - PathFormatMacOS - PathRootProject - - Recursivefalse - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path::art: - PathFormatMacOS - PathRootProject - - Recursivefalse - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:generic: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:mac:carbon: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:common: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:zlib: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:png: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:jpeg: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:iodbc: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:tiff: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:html: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path::lib: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Pathmac/corefoundation - PathFormatUnix - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Pathxml - PathFormatUnix - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Pathexpat/lib - PathFormatUnix - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Pathxrc - PathFormatUnix - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SystemSearchPaths - - SearchPath - Path:MSL: - PathFormatMacOS - PathRootCodeWarrior - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:MacOS Support: - PathFormatMacOS - PathRootCodeWarrior - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:regex: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - - - MWRuntimeSettings_WorkingDirectory - MWRuntimeSettings_CommandLine - MWRuntimeSettings_HostApplication - Path - PathFormatGeneric - PathRootAbsolute - - MWRuntimeSettings_EnvVars - - - LinkerMacOS PPC Linker - PreLinker - PostLinker - Targetnamewxshlba Carbon release - OutputDirectory - Path::lib: - PathFormatMacOS - PathRootProject - - SaveEntriesUsingRelativePathstrue - - - FileMappings - - FileTypeAPPL - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypeAppl - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypeMMLB - FileExtension - CompilerLib Import PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeMPLF - FileExtension - CompilerLib Import PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeMWCD - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypeRSRC - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.bh - CompilerBalloon Help - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.c - CompilerMW C/C++ PPC - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.c++ - CompilerMW C/C++ PPC - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.cc - CompilerMW C/C++ PPC - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.cp - CompilerMW C/C++ PPC - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.cpp - CompilerMW C/C++ PPC - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.exp - Compiler - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.h - CompilerMW C/C++ PPC - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMaketrue - - - FileTypeTEXT - FileExtension.p - CompilerMW Pascal PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.pas - CompilerMW Pascal PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.pch - CompilerMW C/C++ PPC - EditLanguageC/C++ - Precompiletrue - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.pch++ - CompilerMW C/C++ PPC - EditLanguageC/C++ - Precompiletrue - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.ppu - CompilerMW Pascal PPC - EditLanguage - Precompiletrue - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.r - CompilerRez - EditLanguageRez - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.s - CompilerPPCAsm - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeXCOF - FileExtension - CompilerXCOFF Import PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeXPM - FileExtension.xpm - CompilerMW C/C++ PPC - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypedocu - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypersrc - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypeshlb - FileExtension - CompilerPEF Import PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypestub - FileExtension - CompilerPEF Import PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileExtension.doc - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFilefalse - IgnoredByMaketrue - - - FileExtension.o - CompilerXCOFF Import PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileExtension.ppob - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileExtension.rsrc - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - - - CacheModDatestrue - DumpBrowserInfofalse - CacheSubprojectstrue - UseThirdPartyDebuggerfalse - BrowserGenerator1 - DebuggerAppPath - Path - PathFormatGeneric - PathRootAbsolute - - DebuggerCmdLineArgs - DebuggerWorkingDir - Path - PathFormatGeneric - PathRootAbsolute - - CodeCompletionPrefixFileNameMacHeaders.c - CodeCompletionMacroFileNameMacOS_Carbon_C++_Macros.h - - - ConsoleEncoding0 - LogSystemMessagestrue - AutoTargetDLLsfalse - StopAtWatchpointstrue - PauseWhileRunningfalse - PauseInterval5 - PauseUIFlags0 - AltExePath - Path - PathFormatGeneric - PathRootAbsolute - - StopAtTempBPOnLaunchtrue - CacheSymbolicstrue - TempBPFunctionNamemain - TempBPType0 - - - Enabledfalse - ConnectionName - DownloadPath - LaunchRemoteAppfalse - RemoteAppPath - CoreID0 - JTAGClockSpeed8000 - IsMultiCorefalse - OSDownloadfalse - UseGlobalOSDownloadfalse - OSDownloadConnectionName - OSDownloadPath - AltDownloadfalse - AltDownloadConnectionName - - - OtherExecutables - - - CustomColor1 - Red0 - Green32767 - Blue0 - - CustomColor2 - Red0 - Green32767 - Blue0 - - CustomColor3 - Red0 - Green32767 - Blue0 - - CustomColor4 - Red0 - Green32767 - Blue0 - - - - MWFrontEnd_C_cplusplus0 - MWFrontEnd_C_checkprotos0 - MWFrontEnd_C_arm0 - MWFrontEnd_C_trigraphs0 - MWFrontEnd_C_onlystdkeywords0 - MWFrontEnd_C_enumsalwaysint0 - MWFrontEnd_C_mpwpointerstyle0 - MWFrontEnd_C_prefixnamewx/wxshlba_cwc.h - MWFrontEnd_C_ansistrict0 - MWFrontEnd_C_mpwcnewline0 - MWFrontEnd_C_wchar_type1 - MWFrontEnd_C_enableexceptions1 - MWFrontEnd_C_dontreusestrings0 - MWFrontEnd_C_poolstrings0 - MWFrontEnd_C_dontinline0 - MWFrontEnd_C_useRTTI1 - MWFrontEnd_C_multibyteaware0 - MWFrontEnd_C_unsignedchars1 - MWFrontEnd_C_autoinline1 - MWFrontEnd_C_booltruefalse1 - MWFrontEnd_C_inlinelevel0 - MWFrontEnd_C_ecplusplus0 - MWFrontEnd_C_objective_c0 - MWFrontEnd_C_defer_codegen0 - MWFrontEnd_C_templateparser0 - MWFrontEnd_C_c990 - MWFrontEnd_C_bottomupinline1 - - - MWWarning_C_warn_illpragma1 - MWWarning_C_warn_emptydecl0 - MWWarning_C_warn_possunwant0 - MWWarning_C_warn_unusedvar0 - MWWarning_C_warn_unusedarg0 - MWWarning_C_warn_extracomma0 - MWWarning_C_pedantic1 - MWWarning_C_warningerrors0 - MWWarning_C_warn_hidevirtual1 - MWWarning_C_warn_implicitconv0 - MWWarning_C_warn_notinlined0 - MWWarning_C_warn_structclass1 - - - MWFTP_Post_hostName - MWFTP_Post_username - MWFTP_Post_password0ÿÂà -ž0¼,šì - MWFTP_Post_remoteDir - MWFTP_Post_ftp_PathVersion1 - MWFTP_Post_ftp_PathType0 - MWFTP_Post_ftp_PathFormat0 - MWFTP_Post_ftp_tree - MWFTP_Post_uploadDir - MWFTP_Post_ftp_port21 - MWFTP_Post_SendBin1 - MWFTP_Post_ShouldLog1 - - - MWCommandLine_Java_clsName - MWCommandLine_Java_args - - - MWVJavaDebugging_Protocol1 - MWVJavaDebugging_JDKVersion1 - MWVJavaDebugging_TimeOut10 - MWVJavaDebugging_SupportSlowDevicesfalse - MWVJavaDebugging_UseRemoteLaunchAgentfalse - MWVJavaDebugging_LaunchVMasServerfalse - - - MWJava_Language_optimizefalse - MWJava_Language_warnDeprecatedfalse - MWJava_Language_emitMapfalse - MWJava_Language_strictFileNamesfalse - MWJava_Language_strictFileHierarchyfalse - MWJava_Language_1_1_Compatiblefalse - MWJava_Language_emitHeaders0 - MWJava_Language_headerTypeJNINativeHeaders - MWJava_Language_packageFilter - MWJava_Language_genCommentstrue - MWJava_Language_genHeadersfalse - MWJava_Language_enableAssertsfalse - MWJava_Language_targetVM1.1 - - - Manifest-JAD Attributes - - AttributeMain-Class - ValueAuto-Generated - - - - - MWJava_MRJAppBuilder_outFileMRJApplication - MWJava_MRJAppBuilder_mergefalse - MWJava_MRJAppBuilder_quitMenutrue - MWJava_MRJAppBuilder_growfalse - MWJava_MRJAppBuilder_stdoutTypeConsole - MWJava_MRJAppBuilder_stderrTypeConsole - MWJava_MRJAppBuilder_stdinTypeConsole - MWJava_MRJAppBuilder_appIconPVersion0 - MWJava_MRJAppBuilder_appIconPType0 - MWJava_MRJAppBuilder_appIconPFormat0 - MWJava_MRJAppBuilder_appIconPTree - MWJava_MRJAppBuilder_appIconFile - MWJava_MRJAppBuilder_splashScreenPVersion0 - MWJava_MRJAppBuilder_splashScreenPType0 - MWJava_MRJAppBuilder_splashScreenPFormat0 - MWJava_MRJAppBuilder_splashScreenPTree - MWJava_MRJAppBuilder_splashScreenPICTFile - MWJava_MRJAppBuilder_aboutName - MWJava_MRJAppBuilder_stdoutPVersion0 - MWJava_MRJAppBuilder_stdoutPType0 - MWJava_MRJAppBuilder_stdoutPFormat0 - MWJava_MRJAppBuilder_stdoutPTree - MWJava_MRJAppBuilder_stdoutFile - MWJava_MRJAppBuilder_stdoutAppendfalse - MWJava_MRJAppBuilder_stderrPType0 - MWJava_MRJAppBuilder_stderrPFormat0 - MWJava_MRJAppBuilder_stderrPTree - MWJava_MRJAppBuilder_stderrFile - MWJava_MRJAppBuilder_stderrAppendfalse - MWJava_MRJAppBuilder_stdinPType0 - MWJava_MRJAppBuilder_stdinPFormat0 - MWJava_MRJAppBuilder_stdinPTree - MWJava_MRJAppBuilder_stdinFile - - - MWJava_Output_outputtypeJarFile - MWJava_Output_outfileJavaClasses.jar - MWJava_Output_ftype1514754080 - MWJava_Output_fcreator1297570384 - MWJava_Output_compress0 - MWJava_Output_genManifest0 - MWJava_Output_trunctypeFront - MWJava_Output_deleteClasses0 - MWJava_Output_consoleApp1 - MWJava_Output_preverify0 - MWJava_Output_genJad0 - MWJava_Output_obfuscate0 - - - MWJava_Proj_projtypeApplet - MWJava_Proj_mainClassName - MWJava_Proj_HTMLAppCreator1145457748 - MWJava_Proj_HTMLAppNameMetrowerks Java - MWJava_Proj_PathVersion1 - MWJava_Proj_PathType0 - MWJava_Proj_PathFormat0 - MWJava_Proj_tree - MWJava_Proj_HTMLAppWin32NameInternet Explorer - MWJava_Proj_compress0 - MWJava_Proj_simulator0 - MWJava_Proj_useVM\000\000macosx - MWJava_Proj_vmarguments - MWJava_Proj_vmName - MWJava_Proj_simPropFile - - - MWJavaDoc_Proj_Version1 - MWJavaDoc_Proj_Deprecated1 - MWJavaDoc_Proj_Author1 - MWJavaDoc_Proj_Index1 - MWJavaDoc_Proj_Tree1 - MWJavaDoc_Proj_SunResolveToSame0 - MWJavaDoc_Proj_Shortnames1 - MWJavaDoc_Proj_Folder0 - MWJavaDoc_Proj_GenerateAPILinks0 - MWJavaDoc_Proj_scopePublic - MWJavaDoc_Proj_fcreator1297303877 - MWJavaDoc_Proj_encodingName - MWJavaDoc_Proj_decodingName - MWJavaDoc_Proj_javaPackagePathhttp://java.sun.com/products/jdk/1.1/docs/api/ - - - MWMerge_MacOS_projectTypeApplication - MWMerge_MacOS_outputNameMerge Out - MWMerge_MacOS_outputCreator???? - MWMerge_MacOS_outputTypeAPPL - MWMerge_MacOS_suppressWarning0 - MWMerge_MacOS_copyFragments1 - MWMerge_MacOS_copyResources1 - MWMerge_MacOS_flattenResource0 - MWMerge_MacOS_flatFileNamea.rsrc - MWMerge_MacOS_flatFileOutputPath - Path: - PathFormatMacOS - PathRootProject - - MWMerge_MacOS_skipResources - DLGX - ckid - Proj - WSPC - - - - FileLockedfalse - ResourcesMapIsReadOnlyfalse - PrinterDriverIsMultiFinderCompatiblefalse - Invisiblefalse - HasBundlefalse - NameLockedfalse - Stationeryfalse - HasCustomIconfalse - Sharedfalse - HasBeenInitedfalse - Label0 - Comments - - - MWMacOSPackager_UsePackager0 - MWMacOSPackager_FolderToPackage - Path - PathFormatMacOS - PathRootAbsolute - - MWMacOSPackager_CreateClassicAlias0 - MWMacOSPackager_ClassicAliasMethodUseTargetOutput - MWMacOSPackager_ClassicAliasPath - Path - PathFormatMacOS - PathRootAbsolute - - MWMacOSPackager_CreatePkgInfo0 - MWMacOSPackager_PkgCreatorType???? - MWMacOSPackager_PkgFileTypeAPPL - - - MWCodeGen_PPC_structalignmentPPC_mw - MWCodeGen_PPC_tracebacktablesInline - MWCodeGen_PPC_processorGeneric - MWCodeGen_PPC_function_align4 - MWCodeGen_PPC_tocdata1 - MWCodeGen_PPC_largetoc0 - MWCodeGen_PPC_profiler0 - MWCodeGen_PPC_vectortocdata0 - MWCodeGen_PPC_poolconst0 - MWCodeGen_PPC_peephole1 - MWCodeGen_PPC_readonlystrings0 - MWCodeGen_PPC_linkerpoolsstrings0 - MWCodeGen_PPC_volatileasm0 - MWCodeGen_PPC_schedule0 - MWCodeGen_PPC_altivec0 - MWCodeGen_PPC_altivec_move_block0 - MWCodeGen_PPC_strictIEEEfp0 - MWCodeGen_PPC_fpcontract1 - MWCodeGen_PPC_genfsel0 - MWCodeGen_PPC_orderedfpcmp0 - - - MWCodeGen_MachO_structalignmentPPC_mw - MWCodeGen_MachO_profiler_enumOff - MWCodeGen_MachO_processorGeneric - MWCodeGen_MachO_function_align4 - MWCodeGen_MachO_common0 - MWCodeGen_MachO_peephole1 - MWCodeGen_MachO_readonlystrings0 - MWCodeGen_MachO_linkerpoolsstrings1 - MWCodeGen_MachO_volatileasm0 - MWCodeGen_MachO_schedule0 - MWCodeGen_MachO_altivec0 - MWCodeGen_MachO_vecmove0 - MWCodeGen_MachO_fp_ieee_strict0 - MWCodeGen_MachO_fpcontract1 - MWCodeGen_MachO_genfsel0 - MWCodeGen_MachO_fp_cmps_ordered0 - - - MWDisassembler_PPC_showcode1 - MWDisassembler_PPC_extended1 - MWDisassembler_PPC_mix0 - MWDisassembler_PPC_nohex0 - MWDisassembler_PPC_showdata1 - MWDisassembler_PPC_showexceptions1 - MWDisassembler_PPC_showsym1 - MWDisassembler_PPC_shownames1 - - - GlobalOptimizer_PPC_optimizationlevelLevel4 - GlobalOptimizer_PPC_optforSpeed - - - MWLinker_PPC_linksym0 - MWLinker_PPC_symfullpath1 - MWLinker_PPC_linkmap0 - MWLinker_PPC_nolinkwarnings0 - MWLinker_PPC_dontdeadstripinitcode0 - MWLinker_PPC_permitmultdefs0 - MWLinker_PPC_linkmodeFast - MWLinker_PPC_initname - MWLinker_PPC_mainname - MWLinker_PPC_termname - - - MWLinker_MacOSX_linksym0 - MWLinker_MacOSX_symfullpath0 - MWLinker_MacOSX_nolinkwarnings0 - MWLinker_MacOSX_linkmap0 - MWLinker_MacOSX_dontdeadstripinitcode0 - MWLinker_MacOSX_permitmultdefs1 - MWLinker_MacOSX_use_objectivec_semantics0 - MWLinker_MacOSX_strip_debug_symbols0 - MWLinker_MacOSX_split_segs0 - MWLinker_MacOSX_report_msl_overloads0 - MWLinker_MacOSX_objects_follow_linkorder0 - MWLinker_MacOSX_linkmodeFast - MWLinker_MacOSX_exportsReferencedGlobals - MWLinker_MacOSX_sortcodeNone - MWLinker_MacOSX_mainnamestart - - - MWProject_MacOSX_typeExecutable - MWProject_MacOSX_outfilewx_PPC_d.shlba - MWProject_MacOSX_filecreator???? - MWProject_MacOSX_filetypestub - MWProject_MacOSX_vmaddress4096 - MWProject_MacOSX_usedefaultvmaddr1 - MWProject_MacOSX_flatrsrc0 - MWProject_MacOSX_flatrsrcfilename - MWProject_MacOSX_flatrsrcoutputdir - Path: - PathFormatMacOS - PathRootProject - - MWProject_MacOSX_installpath./ - MWProject_MacOSX_dont_prebind0 - MWProject_MacOSX_flat_namespace0 - MWProject_MacOSX_frameworkversionA - MWProject_MacOSX_currentversion0 - MWProject_MacOSX_flat_oldimpversion0 - - - MWLinker_MachO_exportsNone - MWLinker_MachO_mainnamestart - MWLinker_MachO_currentversion0 - MWLinker_MachO_compatibleversion0 - MWLinker_MachO_symfullpath0 - MWLinker_MachO_supresswarnings0 - MWLinker_MachO_multisymerror0 - MWLinker_MachO_prebind1 - MWLinker_MachO_deadstrip1 - MWLinker_MachO_objectivecsemantics0 - MWLinker_MachO_whichfileloaded0 - MWLinker_MachO_whyfileloaded0 - MWLinker_MachO_readonlyrelocsErrors - MWLinker_MachO_undefinedsymbolsErrors - MWLinker_MachO_twolevelnamespace1 - MWLinker_MachO_stripdebugsymbols0 - - - MWProject_MachO_typeExecutable - MWProject_MachO_outfilea.exe - MWProject_MachO_filecreator???? - MWProject_MachO_filetypeMEXE - MWProject_MachO_vmaddress4096 - MWProject_MachO_flatrsrc1 - MWProject_MachO_flatrsrcfilenamea.rsrc - MWProject_MachO_flatrsrcoutputdir - Path: - PathFormatMacOS - PathRootProject - - MWProject_MachO_installpath./ - MWProject_MachO_frameworkversion - - - MWPEF_exportsPragma - MWPEF_libfolder0 - MWPEF_sortcodeNone - MWPEF_expandbss0 - MWPEF_sharedata0 - MWPEF_olddefversion0 - MWPEF_oldimpversion0 - MWPEF_currentversion0 - MWPEF_fragmentname - MWPEF_collapsereloads0 - - - MWProject_PPC_typeStubLibrary - MWProject_PPC_outfilewx_PPC_d.shlba - MWProject_PPC_filecreator???? - MWProject_PPC_filetypestub - MWProject_PPC_size0 - MWProject_PPC_minsize0 - MWProject_PPC_stacksize0 - MWProject_PPC_flags0 - MWProject_PPC_symfilename - MWProject_PPC_rsrcname - MWProject_PPC_rsrcheaderNative - MWProject_PPC_rsrctype???? - MWProject_PPC_rsrcid0 - MWProject_PPC_rsrcflags0 - MWProject_PPC_rsrcstore0 - MWProject_PPC_rsrcmerge0 - MWProject_PPC_flatrsrc0 - MWProject_PPC_flatrsrcoutputdir - Path: - PathFormatMacOS - PathRootProject - - MWProject_PPC_flatrsrcfilename - - - MWAssembler_PPC_auxheader0 - MWAssembler_PPC_symmodeMac - MWAssembler_PPC_dialectPPC - MWAssembler_PPC_prefixfile - MWAssembler_PPC_typecheck0 - MWAssembler_PPC_warnings0 - MWAssembler_PPC_casesensitive0 - - - PList_OutputTypeFile - PList_OutputEncodingUTF-8 - PList_Prefix - PList_FileFilenameInfo.plist - PList_FileDirectory - Path: - PathFormatMacOS - PathRootProject - - PList_ResourceTypeplst - PList_ResourceID0 - PList_ResourceName - - - MWRez_Language_maxwidth80 - MWRez_Language_scriptRoman - MWRez_Language_alignmentAlign1 - MWRez_Language_filtermodeFilterSkip - MWRez_Language_suppresswarnings0 - MWRez_Language_escapecontrolchars1 - MWRez_Language_prefixname - MWRez_Language_filteredtypes'CODE' 'DATA' 'PICT' - - - MWWinRC_prefixname - - - MWCodeGen_X86_processorGeneric - MWCodeGen_X86_alignmentbytes8 - MWCodeGen_X86_exceptionsZeroOverhead - MWCodeGen_X86_name_manglingMWWin32 - MWCodeGen_X86_use_extinst0 - MWCodeGen_X86_extinst_mmx0 - MWCodeGen_X86_extinst_3dnow0 - MWCodeGen_X86_use_mmx_3dnow_convention0 - MWCodeGen_X86_extinst_cmov0 - MWCodeGen_X86_extinst_sse0 - MWCodeGen_X86_extinst_sse20 - MWCodeGen_X86_intrinsics0 - MWCodeGen_X86_optimizeasm0 - MWCodeGen_X86_disableopts0 - MWCodeGen_X86_profile0 - MWLinker_X86_runtimeCustom - MWCodeGen_X86_readonlystrings0 - - - MWLinker_X86_subsysmajorid4 - MWLinker_X86_subsysminorid0 - MWCOFF_X86_opsysmajorid4 - MWCOFF_X86_opsysminorid0 - MWLinker_X86_usrmajorid0 - MWLinker_X86_usrminorid0 - MWProject_X86_maxstacksize1024 - MWProject_X86_minstacksize4 - MWProject_X86_size1024 - MWProject_X86_minsize4 - MWCOFF_X86_coff_flags0 - MWCOFF_X86_dll_flags0 - MWProject_X86_baseaddress4194304 - MWCOFF_X86_filealign512 - MWCOFF_X86_sectionalign4096 - - - PDisasmX86_showHeaderstrue - PDisasmX86_showSectHeaderstrue - PDisasmX86_showSymTabtrue - PDisasmX86_showCodetrue - PDisasmX86_showDatatrue - PDisasmX86_showDebugfalse - PDisasmX86_showExceptionsfalse - PDisasmX86_showRawfalse - PDisasmX86_showAllRawfalse - PDisasmX86_showSourcefalse - PDisasmX86_showRelocationtrue - PDisasmX86_showHextrue - PDisasmX86_showCommentsfalse - PDisasmX86_showSymDefstrue - PDisasmX86_unmangletrue - PDisasmX86_verbosetrue - PDisasmX86_resolveRelocstrue - PDisasmX86_resolveLocalsfalse - - - MWDebugger_X86_Exceptions - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - - - - GlobalOptimizer_X86_optimizationlevelLevel0 - GlobalOptimizer_X86_optforSpeed - - - MWLinker_X86_entrypointusageDefault - MWLinker_X86_entrypoint - MWLinker_X86_subsystemWinGUI - MWLinker_X86_commandfile - MWLinker_X86_generatemap0 - MWLinker_X86_linksym1 - MWLinker_X86_linkCV1 - MWLinker_X86_symfullpathfalse - MWLinker_X86_linkdebugtrue - MWLinker_X86_checksumfalse - MWLinker_X86_zero_init_bssfalse - MWLinker_X86_mergedatafalse - MWLinker_X86_usedefaultlibsfalse - MWLinker_X86_adddefaultlibsfalse - MWLinker_X86_nowarningsfalse - MWLinker_X86_verbosefalse - - - MWProject_X86_typeLibrary - MWProject_X86_outfilewx_x86_d.lib - MWProject_X86_importlib - MWProject_X86_setimportlibdirfalse - MWProject_X86_dontgenerateimportlibfalse - MWProject_X86_oldformatlibfalse - MWProject_X86_replaceobjextensionfalse - MWProject_X86_copyallfilesfalse - - - - PathRelative - Project - ::include: - :wxshlba_cwc.pch - MacOS - Text - Debug - - - PathRelative - Project - ::include: - :wxshlba_cwc.pch++ - MacOS - Text - Debug - - - - - PathRelative - Project - ::include: - :wxshlba_cwc.pch - MacOS - - - PathRelative - Project - ::include: - :wxshlba_cwc.pch++ - MacOS - - - - - wxshlba Carbon debug - - - - UserSourceTrees - - - AlwaysSearchUserPathsfalse - InterpretDOSAndUnixPathstrue - RequireFrameworkStyleIncludesfalse - UserSearchPaths - - SearchPath - Path::include: - PathFormatMacOS - PathRootProject - - Recursivefalse - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path::art: - PathFormatMacOS - PathRootProject - - Recursivefalse - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:generic: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:mac:carbon: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:common: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:zlib: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:png: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:jpeg: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:iodbc: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:tiff: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:html: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path::lib: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Pathmac/corefoundation - PathFormatUnix - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Pathxml - PathFormatUnix - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Pathexpat/lib - PathFormatUnix - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Pathxrc - PathFormatUnix - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SystemSearchPaths - - SearchPath - Path:MSL: - PathFormatMacOS - PathRootCodeWarrior - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:MacOS Support: - PathFormatMacOS - PathRootCodeWarrior - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:regex: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - - - MWRuntimeSettings_WorkingDirectory - MWRuntimeSettings_CommandLine - MWRuntimeSettings_HostApplication - Path - PathFormatGeneric - PathRootAbsolute - - MWRuntimeSettings_EnvVars - - - LinkerMacOS PPC Linker - PreLinker - PostLinker - Targetnamewxshlba Carbon debug - OutputDirectory - Path::lib: - PathFormatMacOS - PathRootProject - - SaveEntriesUsingRelativePathstrue - - - FileMappings - - FileTypeAPPL - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypeAppl - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypeMMLB - FileExtension - CompilerLib Import PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeMPLF - FileExtension - CompilerLib Import PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeMWCD - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypeRSRC - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.bh - CompilerBalloon Help - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.c - CompilerMW C/C++ PPC - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.c++ - CompilerMW C/C++ PPC - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.cc - CompilerMW C/C++ PPC - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.cp - CompilerMW C/C++ PPC - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.cpp - CompilerMW C/C++ PPC - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.exp - Compiler - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.h - CompilerMW C/C++ PPC - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMaketrue - - - FileTypeTEXT - FileExtension.p - CompilerMW Pascal PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.pas - CompilerMW Pascal PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.pch - CompilerMW C/C++ PPC - EditLanguageC/C++ - Precompiletrue - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.pch++ - CompilerMW C/C++ PPC - EditLanguageC/C++ - Precompiletrue - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.ppu - CompilerMW Pascal PPC - EditLanguage - Precompiletrue - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.r - CompilerRez - EditLanguageRez - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.s - CompilerPPCAsm - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeXCOF - FileExtension - CompilerXCOFF Import PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeXPM - FileExtension.xpm - CompilerMW C/C++ PPC - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypedocu - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypersrc - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypeshlb - FileExtension - CompilerPEF Import PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypestub - FileExtension - CompilerPEF Import PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileExtension.doc - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFilefalse - IgnoredByMaketrue - - - FileExtension.o - CompilerXCOFF Import PPC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileExtension.ppob - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileExtension.rsrc - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - - - CacheModDatestrue - DumpBrowserInfofalse - CacheSubprojectstrue - UseThirdPartyDebuggerfalse - BrowserGenerator0 - DebuggerAppPath - Path - PathFormatGeneric - PathRootAbsolute - - DebuggerCmdLineArgs - DebuggerWorkingDir - Path - PathFormatGeneric - PathRootAbsolute - - CodeCompletionPrefixFileNameMacHeaders.c - CodeCompletionMacroFileNameMacOS_Carbon_C++_Macros.h - - - ConsoleEncoding0 - LogSystemMessagestrue - AutoTargetDLLsfalse - StopAtWatchpointstrue - PauseWhileRunningfalse - PauseInterval5 - PauseUIFlags0 - AltExePath - Path - PathFormatGeneric - PathRootAbsolute - - StopAtTempBPOnLaunchtrue - CacheSymbolicstrue - TempBPFunctionNamemain - TempBPType0 - - - Enabledfalse - ConnectionName - DownloadPath - LaunchRemoteAppfalse - RemoteAppPath - CoreID0 - JTAGClockSpeed8000 - IsMultiCorefalse - OSDownloadfalse - UseGlobalOSDownloadfalse - OSDownloadConnectionName - OSDownloadPath - AltDownloadfalse - AltDownloadConnectionName - - - OtherExecutables - - - CustomColor1 - Red0 - Green32767 - Blue0 - - CustomColor2 - Red0 - Green32767 - Blue0 - - CustomColor3 - Red0 - Green32767 - Blue0 - - CustomColor4 - Red0 - Green32767 - Blue0 - - - - MWFrontEnd_C_cplusplus0 - MWFrontEnd_C_checkprotos0 - MWFrontEnd_C_arm0 - MWFrontEnd_C_trigraphs0 - MWFrontEnd_C_onlystdkeywords0 - MWFrontEnd_C_enumsalwaysint0 - MWFrontEnd_C_mpwpointerstyle0 - MWFrontEnd_C_prefixnamewx/wxshlba_cwc_d.h - MWFrontEnd_C_ansistrict0 - MWFrontEnd_C_mpwcnewline0 - MWFrontEnd_C_wchar_type1 - MWFrontEnd_C_enableexceptions1 - MWFrontEnd_C_dontreusestrings0 - MWFrontEnd_C_poolstrings0 - MWFrontEnd_C_dontinline0 - MWFrontEnd_C_useRTTI1 - MWFrontEnd_C_multibyteaware0 - MWFrontEnd_C_unsignedchars1 - MWFrontEnd_C_autoinline0 - MWFrontEnd_C_booltruefalse1 - MWFrontEnd_C_inlinelevel0 - MWFrontEnd_C_ecplusplus0 - MWFrontEnd_C_objective_c0 - MWFrontEnd_C_defer_codegen0 - MWFrontEnd_C_templateparser0 - MWFrontEnd_C_c990 - MWFrontEnd_C_bottomupinline1 - - - MWWarning_C_warn_illpragma1 - MWWarning_C_warn_emptydecl0 - MWWarning_C_warn_possunwant0 - MWWarning_C_warn_unusedvar0 - MWWarning_C_warn_unusedarg0 - MWWarning_C_warn_extracomma0 - MWWarning_C_pedantic1 - MWWarning_C_warningerrors0 - MWWarning_C_warn_hidevirtual1 - MWWarning_C_warn_implicitconv0 - MWWarning_C_warn_notinlined0 - MWWarning_C_warn_structclass1 - - - MWFTP_Post_hostName - MWFTP_Post_username - MWFTP_Post_password0ÿÂà -ž0¼,šì - MWFTP_Post_remoteDir - MWFTP_Post_ftp_PathVersion1 - MWFTP_Post_ftp_PathType0 - MWFTP_Post_ftp_PathFormat0 - MWFTP_Post_ftp_tree - MWFTP_Post_uploadDir - MWFTP_Post_ftp_port21 - MWFTP_Post_SendBin1 - MWFTP_Post_ShouldLog1 - - - MWCommandLine_Java_clsName - MWCommandLine_Java_args - - - MWVJavaDebugging_Protocol1 - MWVJavaDebugging_JDKVersion1 - MWVJavaDebugging_TimeOut10 - MWVJavaDebugging_SupportSlowDevicesfalse - MWVJavaDebugging_UseRemoteLaunchAgentfalse - MWVJavaDebugging_LaunchVMasServerfalse - - - MWJava_Language_optimizefalse - MWJava_Language_warnDeprecatedfalse - MWJava_Language_emitMapfalse - MWJava_Language_strictFileNamesfalse - MWJava_Language_strictFileHierarchyfalse - MWJava_Language_1_1_Compatiblefalse - MWJava_Language_emitHeaders0 - MWJava_Language_headerTypeJNINativeHeaders - MWJava_Language_packageFilter - MWJava_Language_genCommentstrue - MWJava_Language_genHeadersfalse - MWJava_Language_enableAssertsfalse - MWJava_Language_targetVM1.1 - - - Manifest-JAD Attributes - - AttributeMain-Class - ValueAuto-Generated - - - - - MWJava_MRJAppBuilder_outFileMRJApplication - MWJava_MRJAppBuilder_mergefalse - MWJava_MRJAppBuilder_quitMenutrue - MWJava_MRJAppBuilder_growfalse - MWJava_MRJAppBuilder_stdoutTypeConsole - MWJava_MRJAppBuilder_stderrTypeConsole - MWJava_MRJAppBuilder_stdinTypeConsole - MWJava_MRJAppBuilder_appIconPVersion0 - MWJava_MRJAppBuilder_appIconPType0 - MWJava_MRJAppBuilder_appIconPFormat0 - MWJava_MRJAppBuilder_appIconPTree - MWJava_MRJAppBuilder_appIconFile - MWJava_MRJAppBuilder_splashScreenPVersion0 - MWJava_MRJAppBuilder_splashScreenPType0 - MWJava_MRJAppBuilder_splashScreenPFormat0 - MWJava_MRJAppBuilder_splashScreenPTree - MWJava_MRJAppBuilder_splashScreenPICTFile - MWJava_MRJAppBuilder_aboutName - MWJava_MRJAppBuilder_stdoutPVersion0 - MWJava_MRJAppBuilder_stdoutPType0 - MWJava_MRJAppBuilder_stdoutPFormat0 - MWJava_MRJAppBuilder_stdoutPTree - MWJava_MRJAppBuilder_stdoutFile - MWJava_MRJAppBuilder_stdoutAppendfalse - MWJava_MRJAppBuilder_stderrPType0 - MWJava_MRJAppBuilder_stderrPFormat0 - MWJava_MRJAppBuilder_stderrPTree - MWJava_MRJAppBuilder_stderrFile - MWJava_MRJAppBuilder_stderrAppendfalse - MWJava_MRJAppBuilder_stdinPType0 - MWJava_MRJAppBuilder_stdinPFormat0 - MWJava_MRJAppBuilder_stdinPTree - MWJava_MRJAppBuilder_stdinFile - - - MWJava_Output_outputtypeJarFile - MWJava_Output_outfileJavaClasses.jar - MWJava_Output_ftype1514754080 - MWJava_Output_fcreator1297570384 - MWJava_Output_compress0 - MWJava_Output_genManifest0 - MWJava_Output_trunctypeFront - MWJava_Output_deleteClasses0 - MWJava_Output_consoleApp1 - MWJava_Output_preverify0 - MWJava_Output_genJad0 - MWJava_Output_obfuscate0 - - - MWJava_Proj_projtypeApplet - MWJava_Proj_mainClassName - MWJava_Proj_HTMLAppCreator1145457748 - MWJava_Proj_HTMLAppNameMetrowerks Java - MWJava_Proj_PathVersion1 - MWJava_Proj_PathType0 - MWJava_Proj_PathFormat0 - MWJava_Proj_tree - MWJava_Proj_HTMLAppWin32NameInternet Explorer - MWJava_Proj_compress0 - MWJava_Proj_simulator0 - MWJava_Proj_useVM\000\000macosx - MWJava_Proj_vmarguments - MWJava_Proj_vmName - MWJava_Proj_simPropFile - - - MWJavaDoc_Proj_Version1 - MWJavaDoc_Proj_Deprecated1 - MWJavaDoc_Proj_Author1 - MWJavaDoc_Proj_Index1 - MWJavaDoc_Proj_Tree1 - MWJavaDoc_Proj_SunResolveToSame0 - MWJavaDoc_Proj_Shortnames1 - MWJavaDoc_Proj_Folder0 - MWJavaDoc_Proj_GenerateAPILinks0 - MWJavaDoc_Proj_scopePublic - MWJavaDoc_Proj_fcreator1297303877 - MWJavaDoc_Proj_encodingName - MWJavaDoc_Proj_decodingName - MWJavaDoc_Proj_javaPackagePathhttp://java.sun.com/products/jdk/1.1/docs/api/ - - - MWMerge_MacOS_projectTypeApplication - MWMerge_MacOS_outputNameMerge Out - MWMerge_MacOS_outputCreator???? - MWMerge_MacOS_outputTypeAPPL - MWMerge_MacOS_suppressWarning0 - MWMerge_MacOS_copyFragments1 - MWMerge_MacOS_copyResources1 - MWMerge_MacOS_flattenResource0 - MWMerge_MacOS_flatFileNamea.rsrc - MWMerge_MacOS_flatFileOutputPath - Path: - PathFormatMacOS - PathRootProject - - MWMerge_MacOS_skipResources - DLGX - ckid - Proj - WSPC - - - - FileLockedfalse - ResourcesMapIsReadOnlyfalse - PrinterDriverIsMultiFinderCompatiblefalse - Invisiblefalse - HasBundlefalse - NameLockedfalse - Stationeryfalse - HasCustomIconfalse - Sharedfalse - HasBeenInitedfalse - Label0 - Comments - - - MWMacOSPackager_UsePackager0 - MWMacOSPackager_FolderToPackage - Path - PathFormatMacOS - PathRootAbsolute - - MWMacOSPackager_CreateClassicAlias0 - MWMacOSPackager_ClassicAliasMethodUseTargetOutput - MWMacOSPackager_ClassicAliasPath - Path - PathFormatMacOS - PathRootAbsolute - - MWMacOSPackager_CreatePkgInfo0 - MWMacOSPackager_PkgCreatorType???? - MWMacOSPackager_PkgFileTypeAPPL - - - MWCodeGen_PPC_structalignmentPPC_mw - MWCodeGen_PPC_tracebacktablesInline - MWCodeGen_PPC_processorGeneric - MWCodeGen_PPC_function_align4 - MWCodeGen_PPC_tocdata1 - MWCodeGen_PPC_largetoc0 - MWCodeGen_PPC_profiler0 - MWCodeGen_PPC_vectortocdata0 - MWCodeGen_PPC_poolconst0 - MWCodeGen_PPC_peephole1 - MWCodeGen_PPC_readonlystrings0 - MWCodeGen_PPC_linkerpoolsstrings0 - MWCodeGen_PPC_volatileasm0 - MWCodeGen_PPC_schedule0 - MWCodeGen_PPC_altivec0 - MWCodeGen_PPC_altivec_move_block0 - MWCodeGen_PPC_strictIEEEfp0 - MWCodeGen_PPC_fpcontract1 - MWCodeGen_PPC_genfsel0 - MWCodeGen_PPC_orderedfpcmp0 - - - MWCodeGen_MachO_structalignmentPPC_mw - MWCodeGen_MachO_profiler_enumOff - MWCodeGen_MachO_processorGeneric - MWCodeGen_MachO_function_align4 - MWCodeGen_MachO_common0 - MWCodeGen_MachO_peephole1 - MWCodeGen_MachO_readonlystrings0 - MWCodeGen_MachO_linkerpoolsstrings1 - MWCodeGen_MachO_volatileasm0 - MWCodeGen_MachO_schedule0 - MWCodeGen_MachO_altivec0 - MWCodeGen_MachO_vecmove0 - MWCodeGen_MachO_fp_ieee_strict0 - MWCodeGen_MachO_fpcontract1 - MWCodeGen_MachO_genfsel0 - MWCodeGen_MachO_fp_cmps_ordered0 - - - MWDisassembler_PPC_showcode1 - MWDisassembler_PPC_extended1 - MWDisassembler_PPC_mix0 - MWDisassembler_PPC_nohex0 - MWDisassembler_PPC_showdata1 - MWDisassembler_PPC_showexceptions1 - MWDisassembler_PPC_showsym1 - MWDisassembler_PPC_shownames1 - - - GlobalOptimizer_PPC_optimizationlevelLevel0 - GlobalOptimizer_PPC_optforSpeed - - - MWLinker_PPC_linksym0 - MWLinker_PPC_symfullpath1 - MWLinker_PPC_linkmap0 - MWLinker_PPC_nolinkwarnings0 - MWLinker_PPC_dontdeadstripinitcode0 - MWLinker_PPC_permitmultdefs0 - MWLinker_PPC_linkmodeFast - MWLinker_PPC_initname - MWLinker_PPC_mainname - MWLinker_PPC_termname - - - MWLinker_MacOSX_linksym0 - MWLinker_MacOSX_symfullpath0 - MWLinker_MacOSX_nolinkwarnings0 - MWLinker_MacOSX_linkmap0 - MWLinker_MacOSX_dontdeadstripinitcode0 - MWLinker_MacOSX_permitmultdefs1 - MWLinker_MacOSX_use_objectivec_semantics0 - MWLinker_MacOSX_strip_debug_symbols0 - MWLinker_MacOSX_split_segs0 - MWLinker_MacOSX_report_msl_overloads0 - MWLinker_MacOSX_objects_follow_linkorder0 - MWLinker_MacOSX_linkmodeFast - MWLinker_MacOSX_exportsReferencedGlobals - MWLinker_MacOSX_sortcodeNone - MWLinker_MacOSX_mainnamestart - - - MWProject_MacOSX_typeExecutable - MWProject_MacOSX_outfilewx_PPC_d.shlba - MWProject_MacOSX_filecreator???? - MWProject_MacOSX_filetypestub - MWProject_MacOSX_vmaddress4096 - MWProject_MacOSX_usedefaultvmaddr1 - MWProject_MacOSX_flatrsrc0 - MWProject_MacOSX_flatrsrcfilename - MWProject_MacOSX_flatrsrcoutputdir - Path: - PathFormatMacOS - PathRootProject - - MWProject_MacOSX_installpath./ - MWProject_MacOSX_dont_prebind0 - MWProject_MacOSX_flat_namespace0 - MWProject_MacOSX_frameworkversionA - MWProject_MacOSX_currentversion0 - MWProject_MacOSX_flat_oldimpversion0 - - - MWLinker_MachO_exportsNone - MWLinker_MachO_mainnamestart - MWLinker_MachO_currentversion0 - MWLinker_MachO_compatibleversion0 - MWLinker_MachO_symfullpath0 - MWLinker_MachO_supresswarnings0 - MWLinker_MachO_multisymerror0 - MWLinker_MachO_prebind1 - MWLinker_MachO_deadstrip1 - MWLinker_MachO_objectivecsemantics0 - MWLinker_MachO_whichfileloaded0 - MWLinker_MachO_whyfileloaded0 - MWLinker_MachO_readonlyrelocsErrors - MWLinker_MachO_undefinedsymbolsErrors - MWLinker_MachO_twolevelnamespace1 - MWLinker_MachO_stripdebugsymbols0 - - - MWProject_MachO_typeExecutable - MWProject_MachO_outfilea.exe - MWProject_MachO_filecreator???? - MWProject_MachO_filetypeMEXE - MWProject_MachO_vmaddress4096 - MWProject_MachO_flatrsrc1 - MWProject_MachO_flatrsrcfilenamea.rsrc - MWProject_MachO_flatrsrcoutputdir - Path: - PathFormatMacOS - PathRootProject - - MWProject_MachO_installpath./ - MWProject_MachO_frameworkversion - - - MWPEF_exportsPragma - MWPEF_libfolder0 - MWPEF_sortcodeNone - MWPEF_expandbss0 - MWPEF_sharedata0 - MWPEF_olddefversion0 - MWPEF_oldimpversion0 - MWPEF_currentversion0 - MWPEF_fragmentname - MWPEF_collapsereloads0 - - - MWProject_PPC_typeStubLibrary - MWProject_PPC_outfilewx_PPC_d.shlba - MWProject_PPC_filecreator???? - MWProject_PPC_filetypestub - MWProject_PPC_size0 - MWProject_PPC_minsize0 - MWProject_PPC_stacksize0 - MWProject_PPC_flags0 - MWProject_PPC_symfilename - MWProject_PPC_rsrcname - MWProject_PPC_rsrcheaderNative - MWProject_PPC_rsrctype???? - MWProject_PPC_rsrcid0 - MWProject_PPC_rsrcflags0 - MWProject_PPC_rsrcstore0 - MWProject_PPC_rsrcmerge0 - MWProject_PPC_flatrsrc0 - MWProject_PPC_flatrsrcoutputdir - Path: - PathFormatMacOS - PathRootProject - - MWProject_PPC_flatrsrcfilename - - - MWAssembler_PPC_auxheader0 - MWAssembler_PPC_symmodeMac - MWAssembler_PPC_dialectPPC - MWAssembler_PPC_prefixfile - MWAssembler_PPC_typecheck0 - MWAssembler_PPC_warnings0 - MWAssembler_PPC_casesensitive0 - - - PList_OutputTypeFile - PList_OutputEncodingUTF-8 - PList_Prefix - PList_FileFilenameInfo.plist - PList_FileDirectory - Path: - PathFormatMacOS - PathRootProject - - PList_ResourceTypeplst - PList_ResourceID0 - PList_ResourceName - - - MWRez_Language_maxwidth80 - MWRez_Language_scriptRoman - MWRez_Language_alignmentAlign1 - MWRez_Language_filtermodeFilterSkip - MWRez_Language_suppresswarnings0 - MWRez_Language_escapecontrolchars1 - MWRez_Language_prefixname - MWRez_Language_filteredtypes'CODE' 'DATA' 'PICT' - - - MWWinRC_prefixname - - - MWCodeGen_X86_processorGeneric - MWCodeGen_X86_alignmentbytes8 - MWCodeGen_X86_exceptionsZeroOverhead - MWCodeGen_X86_name_manglingMWWin32 - MWCodeGen_X86_use_extinst0 - MWCodeGen_X86_extinst_mmx0 - MWCodeGen_X86_extinst_3dnow0 - MWCodeGen_X86_use_mmx_3dnow_convention0 - MWCodeGen_X86_extinst_cmov0 - MWCodeGen_X86_extinst_sse0 - MWCodeGen_X86_extinst_sse20 - MWCodeGen_X86_intrinsics0 - MWCodeGen_X86_optimizeasm0 - MWCodeGen_X86_disableopts0 - MWCodeGen_X86_profile0 - MWLinker_X86_runtimeCustom - MWCodeGen_X86_readonlystrings0 - - - MWLinker_X86_subsysmajorid4 - MWLinker_X86_subsysminorid0 - MWCOFF_X86_opsysmajorid4 - MWCOFF_X86_opsysminorid0 - MWLinker_X86_usrmajorid0 - MWLinker_X86_usrminorid0 - MWProject_X86_maxstacksize1024 - MWProject_X86_minstacksize4 - MWProject_X86_size1024 - MWProject_X86_minsize4 - MWCOFF_X86_coff_flags0 - MWCOFF_X86_dll_flags0 - MWProject_X86_baseaddress4194304 - MWCOFF_X86_filealign512 - MWCOFF_X86_sectionalign4096 - - - PDisasmX86_showHeaderstrue - PDisasmX86_showSectHeaderstrue - PDisasmX86_showSymTabtrue - PDisasmX86_showCodetrue - PDisasmX86_showDatatrue - PDisasmX86_showDebugfalse - PDisasmX86_showExceptionsfalse - PDisasmX86_showRawfalse - PDisasmX86_showAllRawfalse - PDisasmX86_showSourcefalse - PDisasmX86_showRelocationtrue - PDisasmX86_showHextrue - PDisasmX86_showCommentsfalse - PDisasmX86_showSymDefstrue - PDisasmX86_unmangletrue - PDisasmX86_verbosetrue - PDisasmX86_resolveRelocstrue - PDisasmX86_resolveLocalsfalse - - - MWDebugger_X86_Exceptions - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - - - - GlobalOptimizer_X86_optimizationlevelLevel0 - GlobalOptimizer_X86_optforSpeed - - - MWLinker_X86_entrypointusageDefault - MWLinker_X86_entrypoint - MWLinker_X86_subsystemWinGUI - MWLinker_X86_commandfile - MWLinker_X86_generatemap0 - MWLinker_X86_linksym1 - MWLinker_X86_linkCV1 - MWLinker_X86_symfullpathfalse - MWLinker_X86_linkdebugtrue - MWLinker_X86_checksumfalse - MWLinker_X86_zero_init_bssfalse - MWLinker_X86_mergedatafalse - MWLinker_X86_usedefaultlibsfalse - MWLinker_X86_adddefaultlibsfalse - MWLinker_X86_nowarningsfalse - MWLinker_X86_verbosefalse - - - MWProject_X86_typeLibrary - MWProject_X86_outfilewx_x86_d.lib - MWProject_X86_importlib - MWProject_X86_setimportlibdirfalse - MWProject_X86_dontgenerateimportlibfalse - MWProject_X86_oldformatlibfalse - MWProject_X86_replaceobjextensionfalse - MWProject_X86_copyallfilesfalse - - - - PathRelative - Project - ::include: - :wxshlba_cwc_d.pch - MacOS - Text - Debug - - - PathRelative - Project - ::include: - :wxshlba_cwc_d.pch++ - MacOS - Text - Debug - - - - - PathRelative - Project - ::include: - :wxshlba_cwc_d.pch - MacOS - - - PathRelative - Project - ::include: - :wxshlba_cwc_d.pch++ - MacOS - - - - - wxlib Mach-O debug - - - - UserSourceTrees - - - AlwaysSearchUserPathsfalse - InterpretDOSAndUnixPathstrue - RequireFrameworkStyleIncludesfalse - UserSearchPaths - - SearchPath - Path::include: - PathFormatMacOS - PathRootProject - - Recursivefalse - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path::art: - PathFormatMacOS - PathRootProject - - Recursivefalse - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:generic: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:mac:carbon: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:common: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:zlib: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:png: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:jpeg: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:iodbc: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:tiff: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:html: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Pathunix - PathFormatUnix - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path../lib - PathFormatUnix - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Pathxml - PathFormatUnix - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Pathexpat/lib - PathFormatUnix - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Pathxrc - PathFormatUnix - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Pathmac/corefoundation - PathFormatUnix - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SystemSearchPaths - - SearchPath - PathMacOS X Support/Headers/(wchar_t Support fix) - PathFormatUnix - PathRootCodeWarrior - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:regex: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Pathusr/include - PathFormatUnix - PathRootOS X Volume - - Recursivefalse - FrameworkPathfalse - HostFlagsAll - - - SearchPath - PathMSL/MSL_C - PathFormatUnix - PathRootCodeWarrior - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - PathMSL/MSL_C++ - PathFormatUnix - PathRootCodeWarrior - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - PathMacOS X Support - PathFormatUnix - PathRootCodeWarrior - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Pathusr/lib - PathFormatUnix - PathRootOS X Volume - - Recursivefalse - FrameworkPathfalse - HostFlagsAll - - - SearchPath - PathSystem/Library/Frameworks - PathFormatUnix - PathRootOS X Volume - - Recursivefalse - FrameworkPathtrue - HostFlagsAll - - - - - MWRuntimeSettings_WorkingDirectory - MWRuntimeSettings_CommandLine - MWRuntimeSettings_HostApplication - Path - PathFormatGeneric - PathRootAbsolute - - MWRuntimeSettings_EnvVars - - - LinkerMacOS X PPC Linker - PreLinker - PostLinker - Targetnamewxlib Mach-O debug - OutputDirectory - Path::lib: - PathFormatMacOS - PathRootProject - - SaveEntriesUsingRelativePathstrue - - - FileMappings - - FileTypeAPPL - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypeAppl - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypeMDYL - FileExtension - CompilerMachO Importer - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeMLIB - FileExtension - CompilerMachO Importer - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeMMLB - FileExtension - CompilerMachO Importer - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeMPLF - FileExtension - CompilerMachO Importer - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeMWCD - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypeRSRC - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.arr - Compiler - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.axp - Compiler - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.c - CompilerMW C/C++ PPC Mac OS X - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.c++ - CompilerMW C/C++ PPC Mac OS X - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.cc - CompilerMW C/C++ PPC Mac OS X - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.cp - CompilerMW C/C++ PPC Mac OS X - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.cpp - CompilerMW C/C++ PPC Mac OS X - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.exp - Compiler - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.h - CompilerMW C/C++ PPC Mac OS X - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMaketrue - - - FileTypeTEXT - FileExtension.h++ - CompilerMW C/C++ PPC Mac OS X - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMaketrue - - - FileTypeTEXT - FileExtension.hpp - CompilerMW C/C++ PPC Mac OS X - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMaketrue - - - FileTypeTEXT - FileExtension.lcf - Compiler - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.m - CompilerMW C/C++ PPC Mac OS X - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.mm - CompilerMW C/C++ PPC Mac OS X - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.pch - CompilerMW C/C++ PPC Mac OS X - EditLanguageC/C++ - Precompiletrue - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.pch++ - CompilerMW C/C++ PPC Mac OS X - EditLanguageC/C++ - Precompiletrue - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.pchm - CompilerMW C/C++ PPC Mac OS X - EditLanguageC/C++ - Precompiletrue - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.pchmm - CompilerMW C/C++ PPC Mac OS X - EditLanguageC/C++ - Precompiletrue - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.plc - CompilerProperty List Compiler - EditLanguageProperty List - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.ploc - CompilerProperty List Compiler - EditLanguageProperty List - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.r - CompilerRez - EditLanguageRez - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.wke - Compiler - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypedocu - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypersrc - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileExtension.a - CompilerMachO Importer - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileExtension.doc - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFilefalse - IgnoredByMaketrue - - - FileExtension.dylib - CompilerMachO Importer - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileExtension.gif - CompilerCopy To Package - EditLanguage - Precompilefalse - Launchabletrue - ResourceFilefalse - IgnoredByMaketrue - - - FileExtension.icns - CompilerCopy To Package - EditLanguage - Precompilefalse - Launchabletrue - ResourceFilefalse - IgnoredByMaketrue - - - FileExtension.jpg - CompilerCopy To Package - EditLanguage - Precompilefalse - Launchabletrue - ResourceFilefalse - IgnoredByMaketrue - - - FileExtension.lib - CompilerMachO Importer - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileExtension.nib - CompilerCopy To Package - EditLanguage - Precompilefalse - Launchabletrue - ResourceFilefalse - IgnoredByMaketrue - - - FileExtension.pl - CompilerPerl Tool - EditLanguagePerl - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileExtension.plist - CompilerCopy To Package - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMaketrue - - - FileExtension.ppob - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileExtension.psh - CompilerShell Tool - EditLanguage - Precompiletrue - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileExtension.rsrc - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileExtension.sh - CompilerShell Tool - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileExtension.strings - CompilerCopy To Package - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMaketrue - - - FileExtension.tiff - CompilerCopy To Package - EditLanguage - Precompilefalse - Launchabletrue - ResourceFilefalse - IgnoredByMaketrue - - - - - CacheModDatestrue - DumpBrowserInfofalse - CacheSubprojectstrue - UseThirdPartyDebuggerfalse - BrowserGenerator1 - DebuggerAppPath - Path - PathFormatGeneric - PathRootAbsolute - - DebuggerCmdLineArgs - DebuggerWorkingDir - Path - PathFormatGeneric - PathRootAbsolute - - CodeCompletionPrefixFileNameMacHeaders.c - CodeCompletionMacroFileNameMacOS_Carbon_C++_Macros.h - - - ConsoleEncoding0 - LogSystemMessagestrue - AutoTargetDLLsfalse - StopAtWatchpointstrue - PauseWhileRunningfalse - PauseInterval5 - PauseUIFlags0 - AltExePath - Path - PathFormatGeneric - PathRootAbsolute - - StopAtTempBPOnLaunchtrue - CacheSymbolicstrue - TempBPFunctionNamemain - TempBPType0 - - - Enabledfalse - ConnectionName - DownloadPath - LaunchRemoteAppfalse - RemoteAppPath - CoreID0 - JTAGClockSpeed8000 - IsMultiCorefalse - OSDownloadfalse - UseGlobalOSDownloadfalse - OSDownloadConnectionName - OSDownloadPath - AltDownloadfalse - AltDownloadConnectionName - - - OtherExecutables - - - CustomColor1 - Red0 - Green32767 - Blue0 - - CustomColor2 - Red0 - Green32767 - Blue0 - - CustomColor3 - Red0 - Green32767 - Blue0 - - CustomColor4 - Red0 - Green32767 - Blue0 - - - - MWFrontEnd_C_cplusplus0 - MWFrontEnd_C_checkprotos0 - MWFrontEnd_C_arm0 - MWFrontEnd_C_trigraphs0 - MWFrontEnd_C_onlystdkeywords0 - MWFrontEnd_C_enumsalwaysint0 - MWFrontEnd_C_mpwpointerstyle0 - MWFrontEnd_C_prefixnamewx/wx_cwc_d.h - MWFrontEnd_C_ansistrict0 - MWFrontEnd_C_mpwcnewline0 - MWFrontEnd_C_wchar_type1 - MWFrontEnd_C_enableexceptions1 - MWFrontEnd_C_dontreusestrings0 - MWFrontEnd_C_poolstrings0 - MWFrontEnd_C_dontinline1 - MWFrontEnd_C_useRTTI1 - MWFrontEnd_C_multibyteaware0 - MWFrontEnd_C_unsignedchars1 - MWFrontEnd_C_autoinline0 - MWFrontEnd_C_booltruefalse1 - MWFrontEnd_C_inlinelevel0 - MWFrontEnd_C_ecplusplus0 - MWFrontEnd_C_objective_c0 - MWFrontEnd_C_defer_codegen0 - MWFrontEnd_C_templateparser0 - MWFrontEnd_C_c990 - MWFrontEnd_C_bottomupinline1 - - - MWWarning_C_warn_illpragma1 - MWWarning_C_warn_emptydecl0 - MWWarning_C_warn_possunwant0 - MWWarning_C_warn_unusedvar0 - MWWarning_C_warn_unusedarg0 - MWWarning_C_warn_extracomma0 - MWWarning_C_pedantic1 - MWWarning_C_warningerrors0 - MWWarning_C_warn_hidevirtual1 - MWWarning_C_warn_implicitconv0 - MWWarning_C_warn_notinlined0 - MWWarning_C_warn_structclass1 - - - MWFTP_Post_hostName - MWFTP_Post_username - MWFTP_Post_password0ÿÂà -ž0¼,šì - MWFTP_Post_remoteDir - MWFTP_Post_ftp_PathVersion1 - MWFTP_Post_ftp_PathType0 - MWFTP_Post_ftp_PathFormat0 - MWFTP_Post_ftp_tree - MWFTP_Post_uploadDir - MWFTP_Post_ftp_port21 - MWFTP_Post_SendBin1 - MWFTP_Post_ShouldLog1 - - - MWCommandLine_Java_clsName - MWCommandLine_Java_args - - - MWVJavaDebugging_Protocol1 - MWVJavaDebugging_JDKVersion1 - MWVJavaDebugging_TimeOut10 - MWVJavaDebugging_SupportSlowDevicesfalse - MWVJavaDebugging_UseRemoteLaunchAgentfalse - MWVJavaDebugging_LaunchVMasServerfalse - - - MWJava_Language_optimizefalse - MWJava_Language_warnDeprecatedfalse - MWJava_Language_emitMapfalse - MWJava_Language_strictFileNamesfalse - MWJava_Language_strictFileHierarchyfalse - MWJava_Language_1_1_Compatiblefalse - MWJava_Language_emitHeaders0 - MWJava_Language_headerTypeJNINativeHeaders - MWJava_Language_packageFilter - MWJava_Language_genCommentstrue - MWJava_Language_genHeadersfalse - MWJava_Language_enableAssertsfalse - MWJava_Language_targetVM1.1 - - - Manifest-JAD Attributes - - AttributeMain-Class - ValueAuto-Generated - - - - - MWJava_MRJAppBuilder_outFileMRJApplication - MWJava_MRJAppBuilder_mergefalse - MWJava_MRJAppBuilder_quitMenutrue - MWJava_MRJAppBuilder_growfalse - MWJava_MRJAppBuilder_stdoutTypeConsole - MWJava_MRJAppBuilder_stderrTypeConsole - MWJava_MRJAppBuilder_stdinTypeConsole - MWJava_MRJAppBuilder_appIconPVersion0 - MWJava_MRJAppBuilder_appIconPType0 - MWJava_MRJAppBuilder_appIconPFormat0 - MWJava_MRJAppBuilder_appIconPTree - MWJava_MRJAppBuilder_appIconFile - MWJava_MRJAppBuilder_splashScreenPVersion0 - MWJava_MRJAppBuilder_splashScreenPType0 - MWJava_MRJAppBuilder_splashScreenPFormat0 - MWJava_MRJAppBuilder_splashScreenPTree - MWJava_MRJAppBuilder_splashScreenPICTFile - MWJava_MRJAppBuilder_aboutName - MWJava_MRJAppBuilder_stdoutPVersion0 - MWJava_MRJAppBuilder_stdoutPType0 - MWJava_MRJAppBuilder_stdoutPFormat0 - MWJava_MRJAppBuilder_stdoutPTree - MWJava_MRJAppBuilder_stdoutFile - MWJava_MRJAppBuilder_stdoutAppendfalse - MWJava_MRJAppBuilder_stderrPType0 - MWJava_MRJAppBuilder_stderrPFormat0 - MWJava_MRJAppBuilder_stderrPTree - MWJava_MRJAppBuilder_stderrFile - MWJava_MRJAppBuilder_stderrAppendfalse - MWJava_MRJAppBuilder_stdinPType0 - MWJava_MRJAppBuilder_stdinPFormat0 - MWJava_MRJAppBuilder_stdinPTree - MWJava_MRJAppBuilder_stdinFile - - - MWJava_Output_outputtypeJarFile - MWJava_Output_outfileJavaClasses.jar - MWJava_Output_ftype1514754080 - MWJava_Output_fcreator1297570384 - MWJava_Output_compress0 - MWJava_Output_genManifest0 - MWJava_Output_trunctypeFront - MWJava_Output_deleteClasses0 - MWJava_Output_consoleApp1 - MWJava_Output_preverify0 - MWJava_Output_genJad0 - MWJava_Output_obfuscate0 - - - MWJava_Proj_projtypeApplet - MWJava_Proj_mainClassName - MWJava_Proj_HTMLAppCreator1145457748 - MWJava_Proj_HTMLAppNameMetrowerks Java - MWJava_Proj_PathVersion1 - MWJava_Proj_PathType0 - MWJava_Proj_PathFormat0 - MWJava_Proj_tree - MWJava_Proj_HTMLAppWin32NameInternet Explorer - MWJava_Proj_compress0 - MWJava_Proj_simulator0 - MWJava_Proj_useVM\000\000macosx - MWJava_Proj_vmarguments - MWJava_Proj_vmName - MWJava_Proj_simPropFile - - - MWJavaDoc_Proj_Version1 - MWJavaDoc_Proj_Deprecated1 - MWJavaDoc_Proj_Author1 - MWJavaDoc_Proj_Index1 - MWJavaDoc_Proj_Tree1 - MWJavaDoc_Proj_SunResolveToSame0 - MWJavaDoc_Proj_Shortnames1 - MWJavaDoc_Proj_Folder0 - MWJavaDoc_Proj_GenerateAPILinks0 - MWJavaDoc_Proj_scopePublic - MWJavaDoc_Proj_fcreator1297303877 - MWJavaDoc_Proj_encodingName - MWJavaDoc_Proj_decodingName - MWJavaDoc_Proj_javaPackagePathhttp://java.sun.com/products/jdk/1.1/docs/api/ - - - MWMerge_MacOS_projectTypeApplication - MWMerge_MacOS_outputNameMerge Out - MWMerge_MacOS_outputCreator???? - MWMerge_MacOS_outputTypeAPPL - MWMerge_MacOS_suppressWarning0 - MWMerge_MacOS_copyFragments1 - MWMerge_MacOS_copyResources1 - MWMerge_MacOS_flattenResource0 - MWMerge_MacOS_flatFileNamea.rsrc - MWMerge_MacOS_flatFileOutputPath - Path: - PathFormatMacOS - PathRootProject - - MWMerge_MacOS_skipResources - DLGX - ckid - Proj - WSPC - - - - FileLockedfalse - ResourcesMapIsReadOnlyfalse - PrinterDriverIsMultiFinderCompatiblefalse - Invisiblefalse - HasBundlefalse - NameLockedfalse - Stationeryfalse - HasCustomIconfalse - Sharedfalse - HasBeenInitedfalse - Label0 - Comments - - - MWMacOSPackager_UsePackager0 - MWMacOSPackager_FolderToPackage - Path - PathFormatMacOS - PathRootAbsolute - - MWMacOSPackager_CreateClassicAlias0 - MWMacOSPackager_ClassicAliasMethodUseTargetOutput - MWMacOSPackager_ClassicAliasPath - Path - PathFormatGeneric - PathRootAbsolute - - MWMacOSPackager_CreatePkgInfo0 - MWMacOSPackager_PkgCreatorType???? - MWMacOSPackager_PkgFileTypeAPPL - - - MWCodeGen_PPC_structalignmentPPC_mw - MWCodeGen_PPC_tracebacktablesOutOfLine - MWCodeGen_PPC_processorGeneric - MWCodeGen_PPC_function_align4 - MWCodeGen_PPC_tocdata1 - MWCodeGen_PPC_largetoc0 - MWCodeGen_PPC_profiler0 - MWCodeGen_PPC_vectortocdata0 - MWCodeGen_PPC_poolconst0 - MWCodeGen_PPC_peephole1 - MWCodeGen_PPC_readonlystrings0 - MWCodeGen_PPC_linkerpoolsstrings0 - MWCodeGen_PPC_volatileasm0 - MWCodeGen_PPC_schedule0 - MWCodeGen_PPC_altivec0 - MWCodeGen_PPC_altivec_move_block0 - MWCodeGen_PPC_strictIEEEfp0 - MWCodeGen_PPC_fpcontract1 - MWCodeGen_PPC_genfsel0 - MWCodeGen_PPC_orderedfpcmp0 - - - MWCodeGen_MachO_structalignmentPPC_mw - MWCodeGen_MachO_profiler_enumOff - MWCodeGen_MachO_processorGeneric - MWCodeGen_MachO_function_align4 - MWCodeGen_MachO_common0 - MWCodeGen_MachO_peephole1 - MWCodeGen_MachO_readonlystrings0 - MWCodeGen_MachO_linkerpoolsstrings1 - MWCodeGen_MachO_volatileasm0 - MWCodeGen_MachO_schedule0 - MWCodeGen_MachO_altivec0 - MWCodeGen_MachO_vecmove0 - MWCodeGen_MachO_fp_ieee_strict0 - MWCodeGen_MachO_fpcontract1 - MWCodeGen_MachO_genfsel0 - MWCodeGen_MachO_fp_cmps_ordered0 - - - MWDisassembler_PPC_showcode1 - MWDisassembler_PPC_extended1 - MWDisassembler_PPC_mix0 - MWDisassembler_PPC_nohex0 - MWDisassembler_PPC_showdata1 - MWDisassembler_PPC_showexceptions1 - MWDisassembler_PPC_showsym1 - MWDisassembler_PPC_shownames1 - - - GlobalOptimizer_PPC_optimizationlevelLevel0 - GlobalOptimizer_PPC_optforSpeed - - - MWLinker_PPC_linksym1 - MWLinker_PPC_symfullpath1 - MWLinker_PPC_linkmap0 - MWLinker_PPC_nolinkwarnings0 - MWLinker_PPC_dontdeadstripinitcode1 - MWLinker_PPC_permitmultdefs0 - MWLinker_PPC_linkmodeFast - MWLinker_PPC_initname - MWLinker_PPC_mainname__start - MWLinker_PPC_termname - - - MWLinker_MacOSX_linksym1 - MWLinker_MacOSX_symfullpath1 - MWLinker_MacOSX_nolinkwarnings0 - MWLinker_MacOSX_linkmap0 - MWLinker_MacOSX_dontdeadstripinitcode0 - MWLinker_MacOSX_permitmultdefs1 - MWLinker_MacOSX_use_objectivec_semantics0 - MWLinker_MacOSX_strip_debug_symbols0 - MWLinker_MacOSX_split_segs0 - MWLinker_MacOSX_report_msl_overloads0 - MWLinker_MacOSX_objects_follow_linkorder0 - MWLinker_MacOSX_linkmodeFast - MWLinker_MacOSX_exportsReferencedGlobals - MWLinker_MacOSX_sortcodeNone - MWLinker_MacOSX_mainnamestart - - - MWProject_MacOSX_typeLibrary - MWProject_MacOSX_outfilewx_MACH_d.lib - MWProject_MacOSX_filecreator???? - MWProject_MacOSX_filetype???? - MWProject_MacOSX_vmaddress0 - MWProject_MacOSX_usedefaultvmaddr1 - MWProject_MacOSX_flatrsrc0 - MWProject_MacOSX_flatrsrcfilename - MWProject_MacOSX_flatrsrcoutputdir - Path: - PathFormatMacOS - PathRootProject - - MWProject_MacOSX_installpath./ - MWProject_MacOSX_dont_prebind0 - MWProject_MacOSX_flat_namespace0 - MWProject_MacOSX_frameworkversionA - MWProject_MacOSX_currentversion0 - MWProject_MacOSX_flat_oldimpversion0 - - - MWLinker_MachO_exportsNone - MWLinker_MachO_mainnamestart - MWLinker_MachO_currentversion0 - MWLinker_MachO_compatibleversion0 - MWLinker_MachO_symfullpath0 - MWLinker_MachO_supresswarnings0 - MWLinker_MachO_multisymerror0 - MWLinker_MachO_prebind1 - MWLinker_MachO_deadstrip1 - MWLinker_MachO_objectivecsemantics0 - MWLinker_MachO_whichfileloaded0 - MWLinker_MachO_whyfileloaded0 - MWLinker_MachO_readonlyrelocsErrors - MWLinker_MachO_undefinedsymbolsErrors - MWLinker_MachO_twolevelnamespace1 - MWLinker_MachO_stripdebugsymbols0 - - - MWProject_MachO_typeExecutable - MWProject_MachO_outfilea.exe - MWProject_MachO_filecreator???? - MWProject_MachO_filetypeMEXE - MWProject_MachO_vmaddress4096 - MWProject_MachO_flatrsrc1 - MWProject_MachO_flatrsrcfilenamea.rsrc - MWProject_MachO_flatrsrcoutputdir - Path: - PathFormatMacOS - PathRootProject - - MWProject_MachO_installpath./ - MWProject_MachO_frameworkversion - - - MWPEF_exportsAll - MWPEF_libfolder0 - MWPEF_sortcodeNone - MWPEF_expandbss0 - MWPEF_sharedata0 - MWPEF_olddefversion0 - MWPEF_oldimpversion0 - MWPEF_currentversion0 - MWPEF_fragmentnamewxwin - MWPEF_collapsereloads0 - - - MWProject_PPC_typeLibrary - MWProject_PPC_outfilewx_CARBON_d.lib - MWProject_PPC_filecreator???? - MWProject_PPC_filetype???? - MWProject_PPC_size0 - MWProject_PPC_minsize0 - MWProject_PPC_stacksize0 - MWProject_PPC_flags0 - MWProject_PPC_symfilename - MWProject_PPC_rsrcname - MWProject_PPC_rsrcheaderNative - MWProject_PPC_rsrctype???? - MWProject_PPC_rsrcid0 - MWProject_PPC_rsrcflags0 - MWProject_PPC_rsrcstore0 - MWProject_PPC_rsrcmerge0 - MWProject_PPC_flatrsrc0 - MWProject_PPC_flatrsrcoutputdir - Path: - PathFormatMacOS - PathRootProject - - MWProject_PPC_flatrsrcfilename - - - MWAssembler_PPC_auxheader0 - MWAssembler_PPC_symmodeMac - MWAssembler_PPC_dialectPPC - MWAssembler_PPC_prefixfile - MWAssembler_PPC_typecheck0 - MWAssembler_PPC_warnings0 - MWAssembler_PPC_casesensitive0 - - - PList_OutputTypeFile - PList_OutputEncodingUTF-8 - PList_Prefix - PList_FileFilenameInfo.plist - PList_FileDirectory - Path: - PathFormatMacOS - PathRootProject - - PList_ResourceTypeplst - PList_ResourceID0 - PList_ResourceName - - - MWRez_Language_maxwidth80 - MWRez_Language_scriptRoman - MWRez_Language_alignmentAlign1 - MWRez_Language_filtermodeFilterSkip - MWRez_Language_suppresswarnings0 - MWRez_Language_escapecontrolchars1 - MWRez_Language_prefixname - MWRez_Language_filteredtypes'CODE' 'DATA' 'PICT' - - - MWWinRC_prefixname - - - MWCodeGen_X86_processorGeneric - MWCodeGen_X86_alignmentbytes8 - MWCodeGen_X86_exceptionsZeroOverhead - MWCodeGen_X86_name_manglingMWWin32 - MWCodeGen_X86_use_extinst0 - MWCodeGen_X86_extinst_mmx0 - MWCodeGen_X86_extinst_3dnow0 - MWCodeGen_X86_use_mmx_3dnow_convention0 - MWCodeGen_X86_extinst_cmov0 - MWCodeGen_X86_extinst_sse0 - MWCodeGen_X86_extinst_sse20 - MWCodeGen_X86_intrinsics0 - MWCodeGen_X86_optimizeasm0 - MWCodeGen_X86_disableopts0 - MWCodeGen_X86_profile0 - MWLinker_X86_runtimeCustom - MWCodeGen_X86_readonlystrings0 - - - MWLinker_X86_subsysmajorid4 - MWLinker_X86_subsysminorid0 - MWCOFF_X86_opsysmajorid4 - MWCOFF_X86_opsysminorid0 - MWLinker_X86_usrmajorid0 - MWLinker_X86_usrminorid0 - MWProject_X86_maxstacksize1024 - MWProject_X86_minstacksize4 - MWProject_X86_size1024 - MWProject_X86_minsize4 - MWCOFF_X86_coff_flags0 - MWCOFF_X86_dll_flags0 - MWProject_X86_baseaddress4194304 - MWCOFF_X86_filealign512 - MWCOFF_X86_sectionalign4096 - - - PDisasmX86_showHeaderstrue - PDisasmX86_showSectHeaderstrue - PDisasmX86_showSymTabtrue - PDisasmX86_showCodetrue - PDisasmX86_showDatatrue - PDisasmX86_showDebugfalse - PDisasmX86_showExceptionsfalse - PDisasmX86_showRawfalse - PDisasmX86_showAllRawfalse - PDisasmX86_showSourcefalse - PDisasmX86_showRelocationtrue - PDisasmX86_showHextrue - PDisasmX86_showCommentsfalse - PDisasmX86_showSymDefstrue - PDisasmX86_unmanglefalse - PDisasmX86_verbosefalse - PDisasmX86_resolveRelocstrue - PDisasmX86_resolveLocalsfalse - - - MWDebugger_X86_Exceptions - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - - - - GlobalOptimizer_X86_optimizationlevelLevel0 - GlobalOptimizer_X86_optforSpeed - - - MWLinker_X86_entrypointusageDefault - MWLinker_X86_entrypoint - MWLinker_X86_subsystemWinGUI - MWLinker_X86_commandfile - MWLinker_X86_generatemap0 - MWLinker_X86_linksym1 - MWLinker_X86_linkCV1 - MWLinker_X86_symfullpathfalse - MWLinker_X86_linkdebugtrue - MWLinker_X86_checksumfalse - MWLinker_X86_zero_init_bssfalse - MWLinker_X86_mergedatafalse - MWLinker_X86_usedefaultlibsfalse - MWLinker_X86_adddefaultlibsfalse - MWLinker_X86_nowarningsfalse - MWLinker_X86_verbosefalse - - - MWProject_X86_typeLibrary - MWProject_X86_outfilewx_x86_d.lib - MWProject_X86_importlib - MWProject_X86_setimportlibdirfalse - MWProject_X86_dontgenerateimportlibfalse - MWProject_X86_oldformatlibfalse - MWProject_X86_replaceobjextensionfalse - MWProject_X86_copyallfilesfalse - - - - PathRelative - Project - :mac:carbon: - :accel.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :app.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :bitmap.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :bmpbuttn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :brush.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :button.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :checkbox.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :checklst.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :choice.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :clipbrd.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :colordlg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :colour.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :combobox.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :control.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :cursor.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :data.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :dc.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :dcclient.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :dcmemory.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :dcscreen.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :dialog.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :dirdlg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :filedlg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :font.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :fontdlg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :frame.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :gauge.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :gdiobj.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :icon.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :joystick.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :listbox.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :main.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :mdi.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :menu.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :menuitem.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :minifram.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :msgdlg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :palette.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :pen.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :printdlg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :radiobox.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :radiobut.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :region.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :scrolbar.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :settings.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :slider.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :spinbutt.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :statbmp.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :statbox.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :stattext.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :tabctrl.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :textctrl.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :thread.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :timer.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :toolbar.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :utils.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :sound.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :window.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :printmac.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :dcprint.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :uma.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :sckipc.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :matrix.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :tbarbase.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :imagjpeg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :longlong.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :docmdi.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :appcmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :utilscmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :dynlib.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :extended.c - MacOS - Text - Debug - - - PathRelative - Project - :common: - :sckstrm.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :zstream.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :process.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :docview.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :sizer.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :imagall.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :imaggif.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :imagpcx.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :cmndata.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :ftp.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :menucmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :string.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :wfstream.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :stream.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :gdicmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :protocol.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :layout.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :valgen.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :intl.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :list.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :socket.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :hash.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :dlgcmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :gifdecod.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :filefn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :wincmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :wxchar.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :memory.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :mstream.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :lboxcmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :fs_inet.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :event.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :image.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :ipcbase.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :tokenzr.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :txtstrm.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :filesys.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :url.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :fs_zip.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :prntbase.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :dcbase.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :object.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :http.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :module.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :validate.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :file.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :config.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :fileconf.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :timercmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :framecmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :textfile.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :dynarray.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :choiccmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :helpbase.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :ctrlsub.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :ctrlcmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :strconv.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :sckfile.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :valtext.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :datstrm.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :sckaddr.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :variant.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :dbtable.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :fontcmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :ffile.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :paper.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :clipcmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :imagpnm.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :imagpng.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :imagbmp.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :zipstrm.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :log.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :textcmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :laywin.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :busyinfo.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :listctrl.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :textdlgg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :tipdlg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :numdlgg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :sashwin.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :dcpsg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :panelg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :tabg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :choicdgg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :wizard.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :progdlgg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :caret.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :statusbr.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :logg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :fontdlgg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :splitter.cpp - MacOS - Text - Debug - - - Name - db.cpp - MacOS - Text - Debug - - - Name - dobjcmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :fontmap.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :geometry.cpp - MacOS - Text - Debug - - - Name - colrdlgg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :fontutil.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :dataobj.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :m_list.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :m_tables.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :htmlwin.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :m_pre.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :m_image.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :htmprint.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :htmlfilt.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :htmlpars.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :htmltag.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :m_hline.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :winpars.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :htmlcell.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :m_layout.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :m_fonts.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :m_links.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :fontenum.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :datetime.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :encconv.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :mimecmn.cpp - MacOS - Text - Debug - - - Name - metafile.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :macnotfy.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :statbrma.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :tooltip.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :statlmac.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :imagtiff.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :treectlg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :notebmac.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :m_dflist.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :treebase.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :cshelp.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :dirmac.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :mimetmac.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :filename.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :spinctrl.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :glcanvas.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :xpmdecod.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :imagxpm.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :dirctrlg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :helpctrl.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :helpfrm.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :helpdata.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :tipwin.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :radiocmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :nbkbase.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :scrlwing.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :gaugecmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :containr.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :quantize.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :toplvcmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :toplevel.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :gridsel.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :grid.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :statbar.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :clntdata.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :textbuf.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :dragimgg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :calctrl.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :bmpbase.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :cmdline.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :cmdproc.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :dndcmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :dnd.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :dbgrid.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :dircmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :dseldlg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :dynload.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :effects.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :fddlgcmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :fs_mem.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :regex.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :sysopt.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :imagiff.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :splash.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :fdrepdlg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :gridctrl.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :m_style.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :hashmap.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :dirdlgg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :iconbndl.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :artprov.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :artstd.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :imagfill.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :msgout.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :settcmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :popupcmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :printps.cpp - MacOS - Text - Debug - - - PathRelative - Project - :jpeg: - jpegM8.mcp - Unix - Project - - - - PathRelative - Project - :png: - pngM8.mcp - Unix - Project - - - - PathRelative - Project - :zlib: - zlibM8.mcp - Unix - Project - - - - PathRelative - Project - :tiff: - tiffM8.mcp - Unix - Project - - - - PathRelative - Project - :regex: - regexM8.mcp - Unix - Project - - - - PathRelative - Project - unix - utilsunx.cpp - Unix - Text - Debug - - - PathRelative - CodeWarrior - MSL/MSL_C - MSL_MacOS/Src/console_OS_X.c - Unix - Text - Debug - - - PathRelative - CodeWarrior - MacOS X Support - Libraries/Runtime/Libs/MSL_Runtime_Mach-O_D.a - Unix - Library - Debug - - - FileRelative - ../../lib/jpeg_MACH.lib - Unix - - PathRelative - Project - :jpeg: - jpegM8.mcp - Unix - - Library - Debug, TargetOutputFile - - - FileRelative - ../../lib/png_MACH.lib - Unix - - PathRelative - Project - :png: - pngM8.mcp - Unix - - Library - Debug, TargetOutputFile - - - FileRelative - ../../lib/zlib_MACH.lib - Unix - - PathRelative - Project - :zlib: - zlibM8.mcp - Unix - - Library - Debug, TargetOutputFile - - - PathRelative - Project - :mac:carbon: - morefilex/MoreFilesX.cpp - Unix - Text - Debug - - - FileRelative - ../../lib/tif_MACH.lib - Unix - - PathRelative - Project - :tiff: - tiffM8.mcp - Unix - - Library - Debug, TargetOutputFile - - - FileRelative - ../../lib/regex_MACH.lib - Unix - - PathRelative - Project - :regex: - regexM8.mcp - Unix - - Library - Debug, TargetOutputFile - - - PathRelative - Project - ::include: - wx_cwc_d.pch - Unix - Text - Debug - - - PathRelative - Project - ::include: - wx_cwc_d.pch++ - Unix - Text - Debug - - - PathRelative - Project - :common: - datacmn.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - rgncmn.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - accesscmn.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - dpycmn.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - taskbarcmn.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - fldlgcmn.cpp - Unix - Text - Debug - - - PathRelative - Project - :generic: - :selstore.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - appbase.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - fmapbase.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - stopwatch.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - init.cpp - Unix - Text - Debug - - - PathRelative - Project - unix - baseunix.cpp - Unix - Text - Debug - - - PathRelative - Project - :generic: - renderg.cpp - Unix - Text - Debug - - - PathRelative - Project - :mac:carbon: - renderer.cpp - Unix - Text - Debug - - - PathRelative - Project - xml - xml.cpp - Unix - Text - Debug - - - PathRelative - Project - expat/lib - xmlparse.c - Unix - Text - Debug - - - PathRelative - Project - expat/lib - xmlrole.c - Unix - Text - Debug - - - PathRelative - Project - expat/lib - xmltok.c - Unix - Text - Debug - - - PathRelative - Project - :common: - rendcmn.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - bookctrl.cpp - Unix - Text - Debug - - - PathRelative - Project - :mac:carbon: - drawer.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - stockitem.cpp - Unix - Text - Debug - - - PathRelative - Project - :mac:carbon: - taskbar.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_bmp.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_bmpbt.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_bttn.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_cald.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_chckb.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_chckl.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_choic.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_combo.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_dlg.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_frame.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_gauge.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_gdctl.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_html.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_listb.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_listc.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_menu.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_notbk.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_panel.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_radbt.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_radbx.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_scrol.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_scwin.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_sizer.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_slidr.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_spin.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_split.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_statbar.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_stbmp.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_stbox.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_stlin.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_sttxt.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_text.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_tglbtn.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_toolb.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_tree.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_unkwn.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_wizrd.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xmlres.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xmlrsall.cpp - Unix - Text - Debug - - - PathRelative - Project - unix - gsocket.cpp - Unix - Text - Debug - - - PathRelative - Project - mac/corefoundation - cfstring.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - uri.cpp - Unix - Text - Debug - - - PathRelative - Project - mac/corefoundation - stdpaths_cf.cpp - Unix - Text - Debug - - - PathRelative - Project - mac/corefoundation - gsockosx.cpp - Unix - Text - Debug - - - PathRelative - Project - :mac:carbon: - display.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - archive.cpp - Unix - Text - Debug - - - PathRelative - Project - :generic: - datectlg.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - stdpbase.cpp - Unix - Text - Debug - - - PathRelative - Project - mac/corefoundation - utilsexc_cf.cpp - Unix - Text - Debug - - - PathRelative - Project - unix - stdpaths.cpp - Unix - Text - Debug - - - PathRelative - Project - :mac:carbon: - imaglist.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_choicbk.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_datectrl.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_listbk.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - gbsizer.cpp - Unix - Text - Debug - - - PathRelative - Project - :generic: - choicbkg.cpp - Unix - Text - Debug - - - PathRelative - Project - :generic: - listbkg.cpp - Unix - Text - Debug - - - PathRelative - Project - unix - dlunix.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - debugrpt.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_mdi.cpp - Unix - Text - Debug - - - - - FileRelative - ../../lib/regex_MACH.lib - Unix - - PathRelative - Project - :regex: - regexM8.mcp - Unix - - - - FileRelative - ../../lib/tif_MACH.lib - Unix - - PathRelative - Project - :tiff: - tiffM8.mcp - Unix - - - - FileRelative - ../../lib/zlib_MACH.lib - Unix - - PathRelative - Project - :zlib: - zlibM8.mcp - Unix - - - - FileRelative - ../../lib/png_MACH.lib - Unix - - PathRelative - Project - :png: - pngM8.mcp - Unix - - - - PathRelative - Project - :mac:carbon: - :accel.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :app.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :bitmap.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :bmpbuttn.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :brush.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :button.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :checkbox.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :checklst.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :choice.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :clipbrd.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :colordlg.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :colour.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :combobox.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :control.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :cursor.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :data.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :dc.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :dcclient.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :dcmemory.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :dcscreen.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :dialog.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :dirdlg.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :filedlg.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :font.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :fontdlg.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :frame.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :gauge.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :gdiobj.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :icon.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :joystick.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :listbox.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :main.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :mdi.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :menu.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :menuitem.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :minifram.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :msgdlg.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :palette.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :pen.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :printdlg.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :radiobox.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :radiobut.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :region.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :scrolbar.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :settings.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :slider.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :spinbutt.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :statbmp.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :statbox.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :stattext.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :tabctrl.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :textctrl.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :thread.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :timer.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :toolbar.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :utils.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :sound.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :window.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :printmac.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :dcprint.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :uma.cpp - MacOS - - - PathRelative - Project - :common: - :sckipc.cpp - MacOS - - - PathRelative - Project - :common: - :matrix.cpp - MacOS - - - PathRelative - Project - :common: - :tbarbase.cpp - MacOS - - - PathRelative - Project - :common: - :imagjpeg.cpp - MacOS - - - PathRelative - Project - :common: - :longlong.cpp - MacOS - - - PathRelative - Project - :common: - :docmdi.cpp - MacOS - - - PathRelative - Project - :common: - :appcmn.cpp - MacOS - - - PathRelative - Project - :common: - :utilscmn.cpp - MacOS - - - PathRelative - Project - :common: - :dynlib.cpp - MacOS - - - PathRelative - Project - :common: - :extended.c - MacOS - - - PathRelative - Project - :common: - :sckstrm.cpp - MacOS - - - PathRelative - Project - :common: - :zstream.cpp - MacOS - - - PathRelative - Project - :common: - :process.cpp - MacOS - - - PathRelative - Project - :common: - :docview.cpp - MacOS - - - PathRelative - Project - :common: - :sizer.cpp - MacOS - - - PathRelative - Project - :common: - :imagall.cpp - MacOS - - - PathRelative - Project - :common: - :imaggif.cpp - MacOS - - - PathRelative - Project - :common: - :imagpcx.cpp - MacOS - - - PathRelative - Project - :common: - :cmndata.cpp - MacOS - - - PathRelative - Project - :common: - :ftp.cpp - MacOS - - - PathRelative - Project - :common: - :menucmn.cpp - MacOS - - - PathRelative - Project - :common: - :string.cpp - MacOS - - - PathRelative - Project - :common: - :wfstream.cpp - MacOS - - - PathRelative - Project - :common: - :stream.cpp - MacOS - - - PathRelative - Project - :common: - :gdicmn.cpp - MacOS - - - PathRelative - Project - :common: - :protocol.cpp - MacOS - - - PathRelative - Project - :common: - :layout.cpp - MacOS - - - PathRelative - Project - :common: - :valgen.cpp - MacOS - - - PathRelative - Project - :common: - :intl.cpp - MacOS - - - PathRelative - Project - :common: - :list.cpp - MacOS - - - PathRelative - Project - :common: - :socket.cpp - MacOS - - - PathRelative - Project - :common: - :hash.cpp - MacOS - - - PathRelative - Project - :common: - :dlgcmn.cpp - MacOS - - - PathRelative - Project - :common: - :gifdecod.cpp - MacOS - - - PathRelative - Project - :common: - :filefn.cpp - MacOS - - - PathRelative - Project - :common: - :wincmn.cpp - MacOS - - - PathRelative - Project - :common: - :wxchar.cpp - MacOS - - - PathRelative - Project - :common: - :memory.cpp - MacOS - - - PathRelative - Project - :common: - :mstream.cpp - MacOS - - - PathRelative - Project - :common: - :lboxcmn.cpp - MacOS - - - PathRelative - Project - :common: - :fs_inet.cpp - MacOS - - - PathRelative - Project - :common: - :event.cpp - MacOS - - - PathRelative - Project - :common: - :image.cpp - MacOS - - - PathRelative - Project - :common: - :ipcbase.cpp - MacOS - - - PathRelative - Project - :common: - :tokenzr.cpp - MacOS - - - PathRelative - Project - :common: - :txtstrm.cpp - MacOS - - - PathRelative - Project - :common: - :filesys.cpp - MacOS - - - PathRelative - Project - :common: - :url.cpp - MacOS - - - PathRelative - Project - :common: - :fs_zip.cpp - MacOS - - - PathRelative - Project - :common: - :prntbase.cpp - MacOS - - - PathRelative - Project - :common: - :dcbase.cpp - MacOS - - - PathRelative - Project - :common: - :object.cpp - MacOS - - - PathRelative - Project - :common: - :http.cpp - MacOS - - - PathRelative - Project - :common: - :module.cpp - MacOS - - - PathRelative - Project - :common: - :validate.cpp - MacOS - - - PathRelative - Project - :common: - :file.cpp - MacOS - - - PathRelative - Project - :common: - :config.cpp - MacOS - - - PathRelative - Project - :common: - :fileconf.cpp - MacOS - - - PathRelative - Project - :common: - :timercmn.cpp - MacOS - - - PathRelative - Project - :common: - :framecmn.cpp - MacOS - - - PathRelative - Project - :common: - :textfile.cpp - MacOS - - - PathRelative - Project - :common: - :dynarray.cpp - MacOS - - - PathRelative - Project - :common: - :choiccmn.cpp - MacOS - - - PathRelative - Project - :common: - :helpbase.cpp - MacOS - - - PathRelative - Project - :common: - :ctrlsub.cpp - MacOS - - - PathRelative - Project - :common: - :ctrlcmn.cpp - MacOS - - - PathRelative - Project - :common: - :strconv.cpp - MacOS - - - PathRelative - Project - :common: - :sckfile.cpp - MacOS - - - PathRelative - Project - :common: - :valtext.cpp - MacOS - - - PathRelative - Project - :common: - :datstrm.cpp - MacOS - - - PathRelative - Project - :common: - :sckaddr.cpp - MacOS - - - PathRelative - Project - :common: - :variant.cpp - MacOS - - - PathRelative - Project - :common: - :dbtable.cpp - MacOS - - - PathRelative - Project - :common: - :fontcmn.cpp - MacOS - - - PathRelative - Project - :common: - :ffile.cpp - MacOS - - - PathRelative - Project - :common: - :paper.cpp - MacOS - - - PathRelative - Project - :common: - :clipcmn.cpp - MacOS - - - PathRelative - Project - :common: - :imagpnm.cpp - MacOS - - - PathRelative - Project - :common: - :imagpng.cpp - MacOS - - - PathRelative - Project - :common: - :imagbmp.cpp - MacOS - - - PathRelative - Project - :common: - :zipstrm.cpp - MacOS - - - PathRelative - Project - :common: - :log.cpp - MacOS - - - PathRelative - Project - :common: - :textcmn.cpp - MacOS - - - PathRelative - Project - :generic: - :laywin.cpp - MacOS - - - PathRelative - Project - :generic: - :busyinfo.cpp - MacOS - - - PathRelative - Project - :generic: - :listctrl.cpp - MacOS - - - PathRelative - Project - :generic: - :textdlgg.cpp - MacOS - - - PathRelative - Project - :generic: - :tipdlg.cpp - MacOS - - - PathRelative - Project - :generic: - :numdlgg.cpp - MacOS - - - PathRelative - Project - :generic: - :sashwin.cpp - MacOS - - - PathRelative - Project - :generic: - :dcpsg.cpp - MacOS - - - PathRelative - Project - :generic: - :panelg.cpp - MacOS - - - PathRelative - Project - :generic: - :tabg.cpp - MacOS - - - PathRelative - Project - :generic: - :choicdgg.cpp - MacOS - - - PathRelative - Project - :generic: - :wizard.cpp - MacOS - - - PathRelative - Project - :generic: - :progdlgg.cpp - MacOS - - - PathRelative - Project - :generic: - :caret.cpp - MacOS - - - PathRelative - Project - :generic: - :statusbr.cpp - MacOS - - - PathRelative - Project - :generic: - :logg.cpp - MacOS - - - PathRelative - Project - :generic: - :fontdlgg.cpp - MacOS - - - PathRelative - Project - :generic: - :splitter.cpp - MacOS - - - Name - db.cpp - MacOS - - - Name - dobjcmn.cpp - MacOS - - - PathRelative - Project - :common: - :fontmap.cpp - MacOS - - - PathRelative - Project - :common: - :geometry.cpp - MacOS - - - Name - colrdlgg.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :fontutil.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :dataobj.cpp - MacOS - - - PathRelative - Project - :html: - :m_list.cpp - MacOS - - - PathRelative - Project - :html: - :m_tables.cpp - MacOS - - - PathRelative - Project - :html: - :htmlwin.cpp - MacOS - - - PathRelative - Project - :html: - :m_pre.cpp - MacOS - - - PathRelative - Project - :html: - :m_image.cpp - MacOS - - - PathRelative - Project - :html: - :htmprint.cpp - MacOS - - - PathRelative - Project - :html: - :htmlfilt.cpp - MacOS - - - PathRelative - Project - :html: - :htmlpars.cpp - MacOS - - - PathRelative - Project - :html: - :htmltag.cpp - MacOS - - - PathRelative - Project - :html: - :m_hline.cpp - MacOS - - - PathRelative - Project - :html: - :winpars.cpp - MacOS - - - PathRelative - Project - :html: - :htmlcell.cpp - MacOS - - - PathRelative - Project - :html: - :m_layout.cpp - MacOS - - - PathRelative - Project - :html: - :m_fonts.cpp - MacOS - - - PathRelative - Project - :html: - :m_links.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :fontenum.cpp - MacOS - - - PathRelative - Project - :common: - :datetime.cpp - MacOS - - - PathRelative - Project - :common: - :encconv.cpp - MacOS - - - PathRelative - Project - :common: - :mimecmn.cpp - MacOS - - - Name - metafile.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :macnotfy.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :statbrma.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :tooltip.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :statlmac.cpp - MacOS - - - PathRelative - Project - :common: - :imagtiff.cpp - MacOS - - - PathRelative - Project - :generic: - :treectlg.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :notebmac.cpp - MacOS - - - PathRelative - Project - :html: - :m_dflist.cpp - MacOS - - - PathRelative - Project - :common: - :treebase.cpp - MacOS - - - PathRelative - Project - :common: - :cshelp.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :dirmac.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :mimetmac.cpp - MacOS - - - PathRelative - Project - :common: - :filename.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :spinctrl.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :glcanvas.cpp - MacOS - - - PathRelative - Project - :common: - :xpmdecod.cpp - MacOS - - - PathRelative - Project - :common: - :imagxpm.cpp - MacOS - - - PathRelative - Project - :generic: - :dirctrlg.cpp - MacOS - - - PathRelative - Project - :html: - :helpctrl.cpp - MacOS - - - PathRelative - Project - :html: - :helpfrm.cpp - MacOS - - - PathRelative - Project - :html: - :helpdata.cpp - MacOS - - - PathRelative - Project - :generic: - :tipwin.cpp - MacOS - - - PathRelative - Project - :common: - :radiocmn.cpp - MacOS - - - PathRelative - Project - :common: - :nbkbase.cpp - MacOS - - - PathRelative - Project - :generic: - :scrlwing.cpp - MacOS - - - PathRelative - Project - :common: - :gaugecmn.cpp - MacOS - - - PathRelative - Project - :common: - :containr.cpp - MacOS - - - PathRelative - Project - :common: - :quantize.cpp - MacOS - - - PathRelative - Project - :common: - :toplvcmn.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :toplevel.cpp - MacOS - - - PathRelative - Project - :generic: - :gridsel.cpp - MacOS - - - PathRelative - Project - :generic: - :grid.cpp - MacOS - - - PathRelative - Project - :common: - :statbar.cpp - MacOS - - - PathRelative - Project - :common: - :clntdata.cpp - MacOS - - - PathRelative - Project - :common: - :textbuf.cpp - MacOS - - - PathRelative - Project - :generic: - :dragimgg.cpp - MacOS - - - PathRelative - Project - :generic: - :calctrl.cpp - MacOS - - - PathRelative - Project - :common: - :bmpbase.cpp - MacOS - - - PathRelative - Project - :common: - :cmdline.cpp - MacOS - - - PathRelative - Project - :common: - :cmdproc.cpp - MacOS - - - PathRelative - Project - :common: - :dndcmn.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :dnd.cpp - MacOS - - - PathRelative - Project - :common: - :dbgrid.cpp - MacOS - - - PathRelative - Project - :common: - :dircmn.cpp - MacOS - - - PathRelative - Project - :common: - :dseldlg.cpp - MacOS - - - PathRelative - Project - :common: - :dynload.cpp - MacOS - - - PathRelative - Project - :common: - :effects.cpp - MacOS - - - PathRelative - Project - :common: - :fddlgcmn.cpp - MacOS - - - PathRelative - Project - :common: - :fs_mem.cpp - MacOS - - - PathRelative - Project - :common: - :regex.cpp - MacOS - - - PathRelative - Project - :common: - :sysopt.cpp - MacOS - - - PathRelative - Project - :common: - :imagiff.cpp - MacOS - - - PathRelative - Project - :generic: - :splash.cpp - MacOS - - - PathRelative - Project - :generic: - :fdrepdlg.cpp - MacOS - - - PathRelative - Project - :generic: - :gridctrl.cpp - MacOS - - - PathRelative - Project - :html: - :m_style.cpp - MacOS - - - PathRelative - Project - :common: - :hashmap.cpp - MacOS - - - PathRelative - Project - :generic: - :dirdlgg.cpp - MacOS - - - PathRelative - Project - :common: - :iconbndl.cpp - MacOS - - - PathRelative - Project - :common: - :artprov.cpp - MacOS - - - PathRelative - Project - :common: - :artstd.cpp - MacOS - - - PathRelative - Project - :common: - :imagfill.cpp - MacOS - - - PathRelative - Project - :common: - :msgout.cpp - MacOS - - - PathRelative - Project - :common: - :settcmn.cpp - MacOS - - - PathRelative - Project - :common: - :popupcmn.cpp - MacOS - - - PathRelative - Project - :generic: - :printps.cpp - MacOS - - - PathRelative - Project - unix - utilsunx.cpp - Unix - - - PathRelative - CodeWarrior - MSL/MSL_C - MSL_MacOS/Src/console_OS_X.c - Unix - - - PathRelative - CodeWarrior - MacOS X Support - Libraries/Runtime/Libs/MSL_Runtime_Mach-O_D.a - Unix - - - FileRelative - ../../lib/jpeg_MACH.lib - Unix - - PathRelative - Project - :jpeg: - jpegM8.mcp - Unix - - - - PathRelative - Project - :mac:carbon: - morefilex/MoreFilesX.cpp - Unix - - - PathRelative - Project - ::include: - wx_cwc_d.pch - Unix - - - PathRelative - Project - ::include: - wx_cwc_d.pch++ - Unix - - - PathRelative - Project - :common: - datacmn.cpp - Unix - - - PathRelative - Project - :common: - rgncmn.cpp - Unix - - - PathRelative - Project - :common: - accesscmn.cpp - Unix - - - PathRelative - Project - :common: - dpycmn.cpp - Unix - - - PathRelative - Project - :common: - taskbarcmn.cpp - Unix - - - PathRelative - Project - :common: - fldlgcmn.cpp - Unix - - - PathRelative - Project - :generic: - :selstore.cpp - MacOS - - - PathRelative - Project - :common: - appbase.cpp - Unix - - - PathRelative - Project - :common: - fmapbase.cpp - Unix - - - PathRelative - Project - :common: - stopwatch.cpp - Unix - - - PathRelative - Project - :common: - init.cpp - Unix - - - PathRelative - Project - unix - baseunix.cpp - Unix - - - PathRelative - Project - :generic: - renderg.cpp - Unix - - - PathRelative - Project - :mac:carbon: - renderer.cpp - Unix - - - PathRelative - Project - xml - xml.cpp - Unix - - - PathRelative - Project - expat/lib - xmlparse.c - Unix - - - PathRelative - Project - expat/lib - xmlrole.c - Unix - - - PathRelative - Project - expat/lib - xmltok.c - Unix - - - PathRelative - Project - :common: - rendcmn.cpp - Unix - - - PathRelative - Project - :common: - bookctrl.cpp - Unix - - - PathRelative - Project - :mac:carbon: - drawer.cpp - Unix - - - PathRelative - Project - :common: - stockitem.cpp - Unix - - - PathRelative - Project - :mac:carbon: - taskbar.cpp - Unix - - - PathRelative - Project - xrc - xh_bmp.cpp - Unix - - - PathRelative - Project - xrc - xh_bmpbt.cpp - Unix - - - PathRelative - Project - xrc - xh_bttn.cpp - Unix - - - PathRelative - Project - xrc - xh_cald.cpp - Unix - - - PathRelative - Project - xrc - xh_chckb.cpp - Unix - - - PathRelative - Project - xrc - xh_chckl.cpp - Unix - - - PathRelative - Project - xrc - xh_choic.cpp - Unix - - - PathRelative - Project - xrc - xh_combo.cpp - Unix - - - PathRelative - Project - xrc - xh_dlg.cpp - Unix - - - PathRelative - Project - xrc - xh_frame.cpp - Unix - - - PathRelative - Project - xrc - xh_gauge.cpp - Unix - - - PathRelative - Project - xrc - xh_gdctl.cpp - Unix - - - PathRelative - Project - xrc - xh_html.cpp - Unix - - - PathRelative - Project - xrc - xh_listb.cpp - Unix - - - PathRelative - Project - xrc - xh_listc.cpp - Unix - - - PathRelative - Project - xrc - xh_menu.cpp - Unix - - - PathRelative - Project - xrc - xh_notbk.cpp - Unix - - - PathRelative - Project - xrc - xh_panel.cpp - Unix - - - PathRelative - Project - xrc - xh_radbt.cpp - Unix - - - PathRelative - Project - xrc - xh_radbx.cpp - Unix - - - PathRelative - Project - xrc - xh_scrol.cpp - Unix - - - PathRelative - Project - xrc - xh_scwin.cpp - Unix - - - PathRelative - Project - xrc - xh_sizer.cpp - Unix - - - PathRelative - Project - xrc - xh_slidr.cpp - Unix - - - PathRelative - Project - xrc - xh_spin.cpp - Unix - - - PathRelative - Project - xrc - xh_split.cpp - Unix - - - PathRelative - Project - xrc - xh_statbar.cpp - Unix - - - PathRelative - Project - xrc - xh_stbmp.cpp - Unix - - - PathRelative - Project - xrc - xh_stbox.cpp - Unix - - - PathRelative - Project - xrc - xh_stlin.cpp - Unix - - - PathRelative - Project - xrc - xh_sttxt.cpp - Unix - - - PathRelative - Project - xrc - xh_text.cpp - Unix - - - PathRelative - Project - xrc - xh_tglbtn.cpp - Unix - - - PathRelative - Project - xrc - xh_toolb.cpp - Unix - - - PathRelative - Project - xrc - xh_tree.cpp - Unix - - - PathRelative - Project - xrc - xh_unkwn.cpp - Unix - - - PathRelative - Project - xrc - xh_wizrd.cpp - Unix - - - PathRelative - Project - xrc - xmlres.cpp - Unix - - - PathRelative - Project - xrc - xmlrsall.cpp - Unix - - - PathRelative - Project - unix - gsocket.cpp - Unix - - - PathRelative - Project - mac/corefoundation - cfstring.cpp - Unix - - - PathRelative - Project - :common: - uri.cpp - Unix - - - PathRelative - Project - mac/corefoundation - stdpaths_cf.cpp - Unix - - - PathRelative - Project - mac/corefoundation - gsockosx.cpp - Unix - - - PathRelative - Project - :mac:carbon: - display.cpp - Unix - - - PathRelative - Project - :common: - archive.cpp - Unix - - - PathRelative - Project - :generic: - datectlg.cpp - Unix - - - PathRelative - Project - :common: - stdpbase.cpp - Unix - - - PathRelative - Project - mac/corefoundation - utilsexc_cf.cpp - Unix - - - PathRelative - Project - unix - stdpaths.cpp - Unix - - - PathRelative - Project - :mac:carbon: - imaglist.cpp - Unix - - - PathRelative - Project - xrc - xh_choicbk.cpp - Unix - - - PathRelative - Project - xrc - xh_datectrl.cpp - Unix - - - PathRelative - Project - xrc - xh_listbk.cpp - Unix - - - PathRelative - Project - :common: - gbsizer.cpp - Unix - - - PathRelative - Project - :generic: - choicbkg.cpp - Unix - - - PathRelative - Project - :generic: - listbkg.cpp - Unix - - - PathRelative - Project - unix - dlunix.cpp - Unix - - - PathRelative - Project - :common: - debugrpt.cpp - Unix - - - PathRelative - Project - xrc - xh_mdi.cpp - Unix - - - - - - PathRelative - Project - :jpeg: - jpegM8.mcp - Unix - - - - Mach-O - Build, LinkAgainst - - FileRelative - ../../lib/jpeg_MACH.lib - Unix - - PathRelative - Project - :jpeg: - jpegM8.mcp - Unix - - - - - - - - PathRelative - Project - :png: - pngM8.mcp - Unix - - - - Mach-O - Build, LinkAgainst - - FileRelative - ../../lib/png_MACH.lib - Unix - - PathRelative - Project - :png: - pngM8.mcp - Unix - - - - - - - - PathRelative - Project - :zlib: - zlibM8.mcp - Unix - - - - Mach-O - Build, LinkAgainst - - FileRelative - ../../lib/zlib_MACH.lib - Unix - - PathRelative - Project - :zlib: - zlibM8.mcp - Unix - - - - - - - - PathRelative - Project - :tiff: - tiffM8.mcp - Unix - - - - Mach-O - Build, LinkAgainst - - FileRelative - ../../lib/tif_MACH.lib - Unix - - PathRelative - Project - :tiff: - tiffM8.mcp - Unix - - - - - - - - PathRelative - Project - :regex: - regexM8.mcp - Unix - - - - Mach-O - Build, LinkAgainst - - FileRelative - ../../lib/regex_MACH.lib - Unix - - PathRelative - Project - :regex: - regexM8.mcp - Unix - - - - - - - - - - PathRelative - OS X Volume - System/Library/Frameworks - Carbon.framework - Unix - - Carbon - - - - PathRelative - OS X Volume - System/Library/Frameworks - System.framework - Unix - - System - - - - - wxlib Mach-O release - - - - UserSourceTrees - - - AlwaysSearchUserPathsfalse - InterpretDOSAndUnixPathstrue - RequireFrameworkStyleIncludesfalse - UserSearchPaths - - SearchPath - Path::include: - PathFormatMacOS - PathRootProject - - Recursivefalse - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path::art: - PathFormatMacOS - PathRootProject - - Recursivefalse - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:generic: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:mac:carbon: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:common: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:zlib: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:png: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:jpeg: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:iodbc: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:tiff: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:html: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Pathunix - PathFormatUnix - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path../lib - PathFormatUnix - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Pathxml - PathFormatUnix - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Pathexpat/lib - PathFormatUnix - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Pathxrc - PathFormatUnix - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Pathmac/corefoundation - PathFormatUnix - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SystemSearchPaths - - SearchPath - PathMacOS X Support/Headers/(wchar_t Support fix) - PathFormatUnix - PathRootCodeWarrior - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:regex: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Pathusr/include - PathFormatUnix - PathRootOS X Volume - - Recursivefalse - FrameworkPathfalse - HostFlagsAll - - - SearchPath - PathMSL/MSL_C - PathFormatUnix - PathRootCodeWarrior - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - PathMSL/MSL_C++ - PathFormatUnix - PathRootCodeWarrior - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - PathMacOS X Support - PathFormatUnix - PathRootCodeWarrior - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Pathusr/lib - PathFormatUnix - PathRootOS X Volume - - Recursivefalse - FrameworkPathfalse - HostFlagsAll - - - SearchPath - PathSystem/Library/Frameworks - PathFormatUnix - PathRootOS X Volume - - Recursivefalse - FrameworkPathtrue - HostFlagsAll - - - - - MWRuntimeSettings_WorkingDirectory - MWRuntimeSettings_CommandLine - MWRuntimeSettings_HostApplication - Path - PathFormatGeneric - PathRootAbsolute - - MWRuntimeSettings_EnvVars - - - LinkerMacOS X PPC Linker - PreLinker - PostLinker - Targetnamewxlib Mach-O release - OutputDirectory - Path::lib: - PathFormatMacOS - PathRootProject - - SaveEntriesUsingRelativePathstrue - - - FileMappings - - FileTypeAPPL - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypeAppl - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypeMDYL - FileExtension - CompilerMachO Importer - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeMLIB - FileExtension - CompilerMachO Importer - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeMMLB - FileExtension - CompilerMachO Importer - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeMPLF - FileExtension - CompilerMachO Importer - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeMWCD - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypeRSRC - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.arr - Compiler - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.axp - Compiler - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.c - CompilerMW C/C++ PPC Mac OS X - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.c++ - CompilerMW C/C++ PPC Mac OS X - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.cc - CompilerMW C/C++ PPC Mac OS X - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.cp - CompilerMW C/C++ PPC Mac OS X - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.cpp - CompilerMW C/C++ PPC Mac OS X - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.exp - Compiler - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.h - CompilerMW C/C++ PPC Mac OS X - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMaketrue - - - FileTypeTEXT - FileExtension.h++ - CompilerMW C/C++ PPC Mac OS X - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMaketrue - - - FileTypeTEXT - FileExtension.hpp - CompilerMW C/C++ PPC Mac OS X - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMaketrue - - - FileTypeTEXT - FileExtension.lcf - Compiler - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.m - CompilerMW C/C++ PPC Mac OS X - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.mm - CompilerMW C/C++ PPC Mac OS X - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.pch - CompilerMW C/C++ PPC Mac OS X - EditLanguageC/C++ - Precompiletrue - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.pch++ - CompilerMW C/C++ PPC Mac OS X - EditLanguageC/C++ - Precompiletrue - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.pchm - CompilerMW C/C++ PPC Mac OS X - EditLanguageC/C++ - Precompiletrue - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.pchmm - CompilerMW C/C++ PPC Mac OS X - EditLanguageC/C++ - Precompiletrue - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.plc - CompilerProperty List Compiler - EditLanguageProperty List - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.ploc - CompilerProperty List Compiler - EditLanguageProperty List - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.r - CompilerRez - EditLanguageRez - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.wke - Compiler - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypedocu - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypersrc - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileExtension.a - CompilerMachO Importer - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileExtension.doc - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFilefalse - IgnoredByMaketrue - - - FileExtension.dylib - CompilerMachO Importer - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileExtension.gif - CompilerCopy To Package - EditLanguage - Precompilefalse - Launchabletrue - ResourceFilefalse - IgnoredByMaketrue - - - FileExtension.icns - CompilerCopy To Package - EditLanguage - Precompilefalse - Launchabletrue - ResourceFilefalse - IgnoredByMaketrue - - - FileExtension.jpg - CompilerCopy To Package - EditLanguage - Precompilefalse - Launchabletrue - ResourceFilefalse - IgnoredByMaketrue - - - FileExtension.lib - CompilerMachO Importer - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileExtension.nib - CompilerCopy To Package - EditLanguage - Precompilefalse - Launchabletrue - ResourceFilefalse - IgnoredByMaketrue - - - FileExtension.pl - CompilerPerl Tool - EditLanguagePerl - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileExtension.plist - CompilerCopy To Package - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMaketrue - - - FileExtension.ppob - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileExtension.psh - CompilerShell Tool - EditLanguage - Precompiletrue - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileExtension.rsrc - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileExtension.sh - CompilerShell Tool - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileExtension.strings - CompilerCopy To Package - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMaketrue - - - FileExtension.tiff - CompilerCopy To Package - EditLanguage - Precompilefalse - Launchabletrue - ResourceFilefalse - IgnoredByMaketrue - - - - - CacheModDatestrue - DumpBrowserInfofalse - CacheSubprojectstrue - UseThirdPartyDebuggerfalse - BrowserGenerator0 - DebuggerAppPath - Path - PathFormatGeneric - PathRootAbsolute - - DebuggerCmdLineArgs - DebuggerWorkingDir - Path - PathFormatGeneric - PathRootAbsolute - - CodeCompletionPrefixFileNameMacHeaders.c - CodeCompletionMacroFileNameMacOS_Carbon_C++_Macros.h - - - ConsoleEncoding0 - LogSystemMessagestrue - AutoTargetDLLsfalse - StopAtWatchpointstrue - PauseWhileRunningfalse - PauseInterval5 - PauseUIFlags0 - AltExePath - Path - PathFormatGeneric - PathRootAbsolute - - StopAtTempBPOnLaunchtrue - CacheSymbolicstrue - TempBPFunctionNamemain - TempBPType0 - - - Enabledfalse - ConnectionName - DownloadPath - LaunchRemoteAppfalse - RemoteAppPath - CoreID0 - JTAGClockSpeed8000 - IsMultiCorefalse - OSDownloadfalse - UseGlobalOSDownloadfalse - OSDownloadConnectionName - OSDownloadPath - AltDownloadfalse - AltDownloadConnectionName - - - OtherExecutables - - - CustomColor1 - Red0 - Green32767 - Blue0 - - CustomColor2 - Red0 - Green32767 - Blue0 - - CustomColor3 - Red0 - Green32767 - Blue0 - - CustomColor4 - Red0 - Green32767 - Blue0 - - - - MWFrontEnd_C_cplusplus0 - MWFrontEnd_C_checkprotos0 - MWFrontEnd_C_arm0 - MWFrontEnd_C_trigraphs0 - MWFrontEnd_C_onlystdkeywords0 - MWFrontEnd_C_enumsalwaysint0 - MWFrontEnd_C_mpwpointerstyle0 - MWFrontEnd_C_prefixnamewx/wx_cwc.h - MWFrontEnd_C_ansistrict0 - MWFrontEnd_C_mpwcnewline0 - MWFrontEnd_C_wchar_type1 - MWFrontEnd_C_enableexceptions1 - MWFrontEnd_C_dontreusestrings0 - MWFrontEnd_C_poolstrings0 - MWFrontEnd_C_dontinline1 - MWFrontEnd_C_useRTTI1 - MWFrontEnd_C_multibyteaware0 - MWFrontEnd_C_unsignedchars1 - MWFrontEnd_C_autoinline0 - MWFrontEnd_C_booltruefalse1 - MWFrontEnd_C_inlinelevel0 - MWFrontEnd_C_ecplusplus0 - MWFrontEnd_C_objective_c0 - MWFrontEnd_C_defer_codegen0 - MWFrontEnd_C_templateparser0 - MWFrontEnd_C_c990 - MWFrontEnd_C_bottomupinline1 - - - MWWarning_C_warn_illpragma1 - MWWarning_C_warn_emptydecl0 - MWWarning_C_warn_possunwant0 - MWWarning_C_warn_unusedvar0 - MWWarning_C_warn_unusedarg0 - MWWarning_C_warn_extracomma0 - MWWarning_C_pedantic1 - MWWarning_C_warningerrors0 - MWWarning_C_warn_hidevirtual1 - MWWarning_C_warn_implicitconv0 - MWWarning_C_warn_notinlined0 - MWWarning_C_warn_structclass1 - - - MWFTP_Post_hostName - MWFTP_Post_username - MWFTP_Post_password0ÿÂà -ž0¼,šì - MWFTP_Post_remoteDir - MWFTP_Post_ftp_PathVersion1 - MWFTP_Post_ftp_PathType0 - MWFTP_Post_ftp_PathFormat0 - MWFTP_Post_ftp_tree - MWFTP_Post_uploadDir - MWFTP_Post_ftp_port21 - MWFTP_Post_SendBin1 - MWFTP_Post_ShouldLog1 - - - MWCommandLine_Java_clsName - MWCommandLine_Java_args - - - MWVJavaDebugging_Protocol1 - MWVJavaDebugging_JDKVersion1 - MWVJavaDebugging_TimeOut10 - MWVJavaDebugging_SupportSlowDevicesfalse - MWVJavaDebugging_UseRemoteLaunchAgentfalse - MWVJavaDebugging_LaunchVMasServerfalse - - - MWJava_Language_optimizefalse - MWJava_Language_warnDeprecatedfalse - MWJava_Language_emitMapfalse - MWJava_Language_strictFileNamesfalse - MWJava_Language_strictFileHierarchyfalse - MWJava_Language_1_1_Compatiblefalse - MWJava_Language_emitHeaders0 - MWJava_Language_headerTypeJNINativeHeaders - MWJava_Language_packageFilter - MWJava_Language_genCommentstrue - MWJava_Language_genHeadersfalse - MWJava_Language_enableAssertsfalse - MWJava_Language_targetVM1.1 - - - Manifest-JAD Attributes - - AttributeMain-Class - ValueAuto-Generated - - - - - MWJava_MRJAppBuilder_outFileMRJApplication - MWJava_MRJAppBuilder_mergefalse - MWJava_MRJAppBuilder_quitMenutrue - MWJava_MRJAppBuilder_growfalse - MWJava_MRJAppBuilder_stdoutTypeConsole - MWJava_MRJAppBuilder_stderrTypeConsole - MWJava_MRJAppBuilder_stdinTypeConsole - MWJava_MRJAppBuilder_appIconPVersion0 - MWJava_MRJAppBuilder_appIconPType0 - MWJava_MRJAppBuilder_appIconPFormat0 - MWJava_MRJAppBuilder_appIconPTree - MWJava_MRJAppBuilder_appIconFile - MWJava_MRJAppBuilder_splashScreenPVersion0 - MWJava_MRJAppBuilder_splashScreenPType0 - MWJava_MRJAppBuilder_splashScreenPFormat0 - MWJava_MRJAppBuilder_splashScreenPTree - MWJava_MRJAppBuilder_splashScreenPICTFile - MWJava_MRJAppBuilder_aboutName - MWJava_MRJAppBuilder_stdoutPVersion0 - MWJava_MRJAppBuilder_stdoutPType0 - MWJava_MRJAppBuilder_stdoutPFormat0 - MWJava_MRJAppBuilder_stdoutPTree - MWJava_MRJAppBuilder_stdoutFile - MWJava_MRJAppBuilder_stdoutAppendfalse - MWJava_MRJAppBuilder_stderrPType0 - MWJava_MRJAppBuilder_stderrPFormat0 - MWJava_MRJAppBuilder_stderrPTree - MWJava_MRJAppBuilder_stderrFile - MWJava_MRJAppBuilder_stderrAppendfalse - MWJava_MRJAppBuilder_stdinPType0 - MWJava_MRJAppBuilder_stdinPFormat0 - MWJava_MRJAppBuilder_stdinPTree - MWJava_MRJAppBuilder_stdinFile - - - MWJava_Output_outputtypeJarFile - MWJava_Output_outfileJavaClasses.jar - MWJava_Output_ftype1514754080 - MWJava_Output_fcreator1297570384 - MWJava_Output_compress0 - MWJava_Output_genManifest0 - MWJava_Output_trunctypeFront - MWJava_Output_deleteClasses0 - MWJava_Output_consoleApp1 - MWJava_Output_preverify0 - MWJava_Output_genJad0 - MWJava_Output_obfuscate0 - - - MWJava_Proj_projtypeApplet - MWJava_Proj_mainClassName - MWJava_Proj_HTMLAppCreator1145457748 - MWJava_Proj_HTMLAppNameMetrowerks Java - MWJava_Proj_PathVersion1 - MWJava_Proj_PathType0 - MWJava_Proj_PathFormat0 - MWJava_Proj_tree - MWJava_Proj_HTMLAppWin32NameInternet Explorer - MWJava_Proj_compress0 - MWJava_Proj_simulator0 - MWJava_Proj_useVM\000\000macosx - MWJava_Proj_vmarguments - MWJava_Proj_vmName - MWJava_Proj_simPropFile - - - MWJavaDoc_Proj_Version1 - MWJavaDoc_Proj_Deprecated1 - MWJavaDoc_Proj_Author1 - MWJavaDoc_Proj_Index1 - MWJavaDoc_Proj_Tree1 - MWJavaDoc_Proj_SunResolveToSame0 - MWJavaDoc_Proj_Shortnames1 - MWJavaDoc_Proj_Folder0 - MWJavaDoc_Proj_GenerateAPILinks0 - MWJavaDoc_Proj_scopePublic - MWJavaDoc_Proj_fcreator1297303877 - MWJavaDoc_Proj_encodingName - MWJavaDoc_Proj_decodingName - MWJavaDoc_Proj_javaPackagePathhttp://java.sun.com/products/jdk/1.1/docs/api/ - - - MWMerge_MacOS_projectTypeApplication - MWMerge_MacOS_outputNameMerge Out - MWMerge_MacOS_outputCreator???? - MWMerge_MacOS_outputTypeAPPL - MWMerge_MacOS_suppressWarning0 - MWMerge_MacOS_copyFragments1 - MWMerge_MacOS_copyResources1 - MWMerge_MacOS_flattenResource0 - MWMerge_MacOS_flatFileNamea.rsrc - MWMerge_MacOS_flatFileOutputPath - Path: - PathFormatMacOS - PathRootProject - - MWMerge_MacOS_skipResources - DLGX - ckid - Proj - WSPC - - - - FileLockedfalse - ResourcesMapIsReadOnlyfalse - PrinterDriverIsMultiFinderCompatiblefalse - Invisiblefalse - HasBundlefalse - NameLockedfalse - Stationeryfalse - HasCustomIconfalse - Sharedfalse - HasBeenInitedfalse - Label0 - Comments - - - MWMacOSPackager_UsePackager0 - MWMacOSPackager_FolderToPackage - Path - PathFormatMacOS - PathRootAbsolute - - MWMacOSPackager_CreateClassicAlias0 - MWMacOSPackager_ClassicAliasMethodUseTargetOutput - MWMacOSPackager_ClassicAliasPath - Path - PathFormatGeneric - PathRootAbsolute - - MWMacOSPackager_CreatePkgInfo0 - MWMacOSPackager_PkgCreatorType???? - MWMacOSPackager_PkgFileTypeAPPL - - - MWCodeGen_PPC_structalignmentPPC_mw - MWCodeGen_PPC_tracebacktablesOutOfLine - MWCodeGen_PPC_processorGeneric - MWCodeGen_PPC_function_align4 - MWCodeGen_PPC_tocdata1 - MWCodeGen_PPC_largetoc0 - MWCodeGen_PPC_profiler0 - MWCodeGen_PPC_vectortocdata0 - MWCodeGen_PPC_poolconst0 - MWCodeGen_PPC_peephole1 - MWCodeGen_PPC_readonlystrings0 - MWCodeGen_PPC_linkerpoolsstrings0 - MWCodeGen_PPC_volatileasm0 - MWCodeGen_PPC_schedule0 - MWCodeGen_PPC_altivec0 - MWCodeGen_PPC_altivec_move_block0 - MWCodeGen_PPC_strictIEEEfp0 - MWCodeGen_PPC_fpcontract1 - MWCodeGen_PPC_genfsel0 - MWCodeGen_PPC_orderedfpcmp0 - - - MWCodeGen_MachO_structalignmentPPC_mw - MWCodeGen_MachO_profiler_enumOff - MWCodeGen_MachO_processorGeneric - MWCodeGen_MachO_function_align4 - MWCodeGen_MachO_common0 - MWCodeGen_MachO_peephole1 - MWCodeGen_MachO_readonlystrings0 - MWCodeGen_MachO_linkerpoolsstrings1 - MWCodeGen_MachO_volatileasm0 - MWCodeGen_MachO_schedule0 - MWCodeGen_MachO_altivec0 - MWCodeGen_MachO_vecmove0 - MWCodeGen_MachO_fp_ieee_strict0 - MWCodeGen_MachO_fpcontract1 - MWCodeGen_MachO_genfsel0 - MWCodeGen_MachO_fp_cmps_ordered0 - - - MWDisassembler_PPC_showcode1 - MWDisassembler_PPC_extended1 - MWDisassembler_PPC_mix0 - MWDisassembler_PPC_nohex0 - MWDisassembler_PPC_showdata1 - MWDisassembler_PPC_showexceptions1 - MWDisassembler_PPC_showsym1 - MWDisassembler_PPC_shownames1 - - - GlobalOptimizer_PPC_optimizationlevelLevel4 - GlobalOptimizer_PPC_optforSpeed - - - MWLinker_PPC_linksym1 - MWLinker_PPC_symfullpath1 - MWLinker_PPC_linkmap0 - MWLinker_PPC_nolinkwarnings0 - MWLinker_PPC_dontdeadstripinitcode1 - MWLinker_PPC_permitmultdefs0 - MWLinker_PPC_linkmodeFast - MWLinker_PPC_initname - MWLinker_PPC_mainname__start - MWLinker_PPC_termname - - - MWLinker_MacOSX_linksym0 - MWLinker_MacOSX_symfullpath0 - MWLinker_MacOSX_nolinkwarnings0 - MWLinker_MacOSX_linkmap0 - MWLinker_MacOSX_dontdeadstripinitcode0 - MWLinker_MacOSX_permitmultdefs1 - MWLinker_MacOSX_use_objectivec_semantics0 - MWLinker_MacOSX_strip_debug_symbols0 - MWLinker_MacOSX_split_segs0 - MWLinker_MacOSX_report_msl_overloads0 - MWLinker_MacOSX_objects_follow_linkorder0 - MWLinker_MacOSX_linkmodeFast - MWLinker_MacOSX_exportsReferencedGlobals - MWLinker_MacOSX_sortcodeNone - MWLinker_MacOSX_mainnamestart - - - MWProject_MacOSX_typeLibrary - MWProject_MacOSX_outfilewx_MACH.lib - MWProject_MacOSX_filecreator???? - MWProject_MacOSX_filetype???? - MWProject_MacOSX_vmaddress0 - MWProject_MacOSX_usedefaultvmaddr1 - MWProject_MacOSX_flatrsrc0 - MWProject_MacOSX_flatrsrcfilename - MWProject_MacOSX_flatrsrcoutputdir - Path: - PathFormatMacOS - PathRootProject - - MWProject_MacOSX_installpath./ - MWProject_MacOSX_dont_prebind0 - MWProject_MacOSX_flat_namespace0 - MWProject_MacOSX_frameworkversionA - MWProject_MacOSX_currentversion0 - MWProject_MacOSX_flat_oldimpversion0 - - - MWLinker_MachO_exportsNone - MWLinker_MachO_mainnamestart - MWLinker_MachO_currentversion0 - MWLinker_MachO_compatibleversion0 - MWLinker_MachO_symfullpath0 - MWLinker_MachO_supresswarnings0 - MWLinker_MachO_multisymerror0 - MWLinker_MachO_prebind1 - MWLinker_MachO_deadstrip1 - MWLinker_MachO_objectivecsemantics0 - MWLinker_MachO_whichfileloaded0 - MWLinker_MachO_whyfileloaded0 - MWLinker_MachO_readonlyrelocsErrors - MWLinker_MachO_undefinedsymbolsErrors - MWLinker_MachO_twolevelnamespace1 - MWLinker_MachO_stripdebugsymbols0 - - - MWProject_MachO_typeExecutable - MWProject_MachO_outfilea.exe - MWProject_MachO_filecreator???? - MWProject_MachO_filetypeMEXE - MWProject_MachO_vmaddress4096 - MWProject_MachO_flatrsrc1 - MWProject_MachO_flatrsrcfilenamea.rsrc - MWProject_MachO_flatrsrcoutputdir - Path: - PathFormatMacOS - PathRootProject - - MWProject_MachO_installpath./ - MWProject_MachO_frameworkversion - - - MWPEF_exportsAll - MWPEF_libfolder0 - MWPEF_sortcodeNone - MWPEF_expandbss0 - MWPEF_sharedata0 - MWPEF_olddefversion0 - MWPEF_oldimpversion0 - MWPEF_currentversion0 - MWPEF_fragmentnamewxwin - MWPEF_collapsereloads0 - - - MWProject_PPC_typeLibrary - MWProject_PPC_outfilewx_CARBON_d.lib - MWProject_PPC_filecreator???? - MWProject_PPC_filetype???? - MWProject_PPC_size0 - MWProject_PPC_minsize0 - MWProject_PPC_stacksize0 - MWProject_PPC_flags0 - MWProject_PPC_symfilename - MWProject_PPC_rsrcname - MWProject_PPC_rsrcheaderNative - MWProject_PPC_rsrctype???? - MWProject_PPC_rsrcid0 - MWProject_PPC_rsrcflags0 - MWProject_PPC_rsrcstore0 - MWProject_PPC_rsrcmerge0 - MWProject_PPC_flatrsrc0 - MWProject_PPC_flatrsrcoutputdir - Path: - PathFormatMacOS - PathRootProject - - MWProject_PPC_flatrsrcfilename - - - MWAssembler_PPC_auxheader0 - MWAssembler_PPC_symmodeMac - MWAssembler_PPC_dialectPPC - MWAssembler_PPC_prefixfile - MWAssembler_PPC_typecheck0 - MWAssembler_PPC_warnings0 - MWAssembler_PPC_casesensitive0 - - - PList_OutputTypeFile - PList_OutputEncodingUTF-8 - PList_Prefix - PList_FileFilenameInfo.plist - PList_FileDirectory - Path: - PathFormatMacOS - PathRootProject - - PList_ResourceTypeplst - PList_ResourceID0 - PList_ResourceName - - - MWRez_Language_maxwidth80 - MWRez_Language_scriptRoman - MWRez_Language_alignmentAlign1 - MWRez_Language_filtermodeFilterSkip - MWRez_Language_suppresswarnings0 - MWRez_Language_escapecontrolchars1 - MWRez_Language_prefixname - MWRez_Language_filteredtypes'CODE' 'DATA' 'PICT' - - - MWWinRC_prefixname - - - MWCodeGen_X86_processorGeneric - MWCodeGen_X86_alignmentbytes8 - MWCodeGen_X86_exceptionsZeroOverhead - MWCodeGen_X86_name_manglingMWWin32 - MWCodeGen_X86_use_extinst0 - MWCodeGen_X86_extinst_mmx0 - MWCodeGen_X86_extinst_3dnow0 - MWCodeGen_X86_use_mmx_3dnow_convention0 - MWCodeGen_X86_extinst_cmov0 - MWCodeGen_X86_extinst_sse0 - MWCodeGen_X86_extinst_sse20 - MWCodeGen_X86_intrinsics0 - MWCodeGen_X86_optimizeasm0 - MWCodeGen_X86_disableopts0 - MWCodeGen_X86_profile0 - MWLinker_X86_runtimeCustom - MWCodeGen_X86_readonlystrings0 - - - MWLinker_X86_subsysmajorid4 - MWLinker_X86_subsysminorid0 - MWCOFF_X86_opsysmajorid4 - MWCOFF_X86_opsysminorid0 - MWLinker_X86_usrmajorid0 - MWLinker_X86_usrminorid0 - MWProject_X86_maxstacksize1024 - MWProject_X86_minstacksize4 - MWProject_X86_size1024 - MWProject_X86_minsize4 - MWCOFF_X86_coff_flags0 - MWCOFF_X86_dll_flags0 - MWProject_X86_baseaddress4194304 - MWCOFF_X86_filealign512 - MWCOFF_X86_sectionalign4096 - - - PDisasmX86_showHeaderstrue - PDisasmX86_showSectHeaderstrue - PDisasmX86_showSymTabtrue - PDisasmX86_showCodetrue - PDisasmX86_showDatatrue - PDisasmX86_showDebugfalse - PDisasmX86_showExceptionsfalse - PDisasmX86_showRawfalse - PDisasmX86_showAllRawfalse - PDisasmX86_showSourcefalse - PDisasmX86_showRelocationtrue - PDisasmX86_showHextrue - PDisasmX86_showCommentsfalse - PDisasmX86_showSymDefstrue - PDisasmX86_unmanglefalse - PDisasmX86_verbosefalse - PDisasmX86_resolveRelocstrue - PDisasmX86_resolveLocalsfalse - - - MWDebugger_X86_Exceptions - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - - - - GlobalOptimizer_X86_optimizationlevelLevel0 - GlobalOptimizer_X86_optforSpeed - - - MWLinker_X86_entrypointusageDefault - MWLinker_X86_entrypoint - MWLinker_X86_subsystemWinGUI - MWLinker_X86_commandfile - MWLinker_X86_generatemap0 - MWLinker_X86_linksym1 - MWLinker_X86_linkCV1 - MWLinker_X86_symfullpathfalse - MWLinker_X86_linkdebugtrue - MWLinker_X86_checksumfalse - MWLinker_X86_zero_init_bssfalse - MWLinker_X86_mergedatafalse - MWLinker_X86_usedefaultlibsfalse - MWLinker_X86_adddefaultlibsfalse - MWLinker_X86_nowarningsfalse - MWLinker_X86_verbosefalse - - - MWProject_X86_typeLibrary - MWProject_X86_outfilewx_x86_d.lib - MWProject_X86_importlib - MWProject_X86_setimportlibdirfalse - MWProject_X86_dontgenerateimportlibfalse - MWProject_X86_oldformatlibfalse - MWProject_X86_replaceobjextensionfalse - MWProject_X86_copyallfilesfalse - - - - PathRelative - Project - :mac:carbon: - :accel.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :app.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :bitmap.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :bmpbuttn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :brush.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :button.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :checkbox.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :checklst.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :choice.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :clipbrd.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :colordlg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :colour.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :combobox.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :control.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :cursor.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :data.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :dc.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :dcclient.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :dcmemory.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :dcscreen.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :dialog.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :dirdlg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :filedlg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :font.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :fontdlg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :frame.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :gauge.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :gdiobj.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :icon.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :joystick.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :listbox.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :main.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :mdi.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :menu.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :menuitem.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :minifram.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :msgdlg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :palette.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :pen.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :printdlg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :radiobox.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :radiobut.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :region.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :scrolbar.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :settings.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :slider.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :spinbutt.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :statbmp.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :statbox.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :stattext.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :tabctrl.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :textctrl.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :thread.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :timer.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :toolbar.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :utils.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :sound.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :window.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :printmac.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :dcprint.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :uma.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :sckipc.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :matrix.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :tbarbase.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :imagjpeg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :longlong.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :docmdi.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :appcmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :utilscmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :dynlib.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :extended.c - MacOS - Text - Debug - - - PathRelative - Project - :common: - :sckstrm.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :zstream.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :process.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :docview.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :sizer.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :imagall.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :imaggif.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :imagpcx.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :cmndata.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :ftp.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :menucmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :string.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :wfstream.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :stream.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :gdicmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :protocol.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :layout.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :valgen.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :intl.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :list.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :socket.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :hash.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :dlgcmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :gifdecod.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :filefn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :wincmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :wxchar.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :memory.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :mstream.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :lboxcmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :fs_inet.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :event.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :image.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :ipcbase.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :tokenzr.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :txtstrm.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :filesys.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :url.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :fs_zip.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :prntbase.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :dcbase.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :object.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :http.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :module.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :validate.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :file.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :config.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :fileconf.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :timercmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :framecmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :textfile.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :dynarray.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :choiccmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :helpbase.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :ctrlsub.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :ctrlcmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :strconv.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :sckfile.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :valtext.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :datstrm.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :sckaddr.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :variant.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :dbtable.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :fontcmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :ffile.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :paper.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :clipcmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :imagpnm.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :imagpng.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :imagbmp.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :zipstrm.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :log.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :textcmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :laywin.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :busyinfo.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :listctrl.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :textdlgg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :tipdlg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :numdlgg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :sashwin.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :dcpsg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :panelg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :tabg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :choicdgg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :wizard.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :progdlgg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :caret.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :statusbr.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :logg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :fontdlgg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :splitter.cpp - MacOS - Text - Debug - - - Name - db.cpp - MacOS - Text - Debug - - - Name - dobjcmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :fontmap.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :geometry.cpp - MacOS - Text - Debug - - - Name - colrdlgg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :fontutil.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :dataobj.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :m_list.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :m_tables.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :htmlwin.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :m_pre.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :m_image.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :htmprint.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :htmlfilt.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :htmlpars.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :htmltag.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :m_hline.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :winpars.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :htmlcell.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :m_layout.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :m_fonts.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :m_links.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :fontenum.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :datetime.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :encconv.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :mimecmn.cpp - MacOS - Text - Debug - - - Name - metafile.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :macnotfy.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :statbrma.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :tooltip.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :statlmac.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :imagtiff.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :treectlg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :notebmac.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :m_dflist.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :treebase.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :cshelp.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :dirmac.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :mimetmac.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :filename.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :spinctrl.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :glcanvas.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :xpmdecod.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :imagxpm.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :dirctrlg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :helpctrl.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :helpfrm.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :helpdata.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :tipwin.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :radiocmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :nbkbase.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :scrlwing.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :gaugecmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :containr.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :quantize.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :toplvcmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :toplevel.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :gridsel.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :grid.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :statbar.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :clntdata.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :textbuf.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :dragimgg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :calctrl.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :bmpbase.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :cmdline.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :cmdproc.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :dndcmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :mac:carbon: - :dnd.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :dbgrid.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :dircmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :dseldlg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :dynload.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :effects.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :fddlgcmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :fs_mem.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :regex.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :sysopt.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :imagiff.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :splash.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :fdrepdlg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :gridctrl.cpp - MacOS - Text - Debug - - - PathRelative - Project - :html: - :m_style.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :hashmap.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :dirdlgg.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :iconbndl.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :artprov.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :artstd.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :imagfill.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :msgout.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :settcmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - :popupcmn.cpp - MacOS - Text - Debug - - - PathRelative - Project - :generic: - :printps.cpp - MacOS - Text - Debug - - - PathRelative - Project - :jpeg: - jpegM8.mcp - Unix - Project - - - - PathRelative - Project - :png: - pngM8.mcp - Unix - Project - - - - PathRelative - Project - :zlib: - zlibM8.mcp - Unix - Project - - - - PathRelative - Project - :tiff: - tiffM8.mcp - Unix - Project - - - - PathRelative - Project - :regex: - regexM8.mcp - Unix - Project - - - - PathRelative - Project - unix - utilsunx.cpp - Unix - Text - Debug - - - PathRelative - CodeWarrior - MSL/MSL_C - MSL_MacOS/Src/console_OS_X.c - Unix - Text - Debug - - - PathRelative - CodeWarrior - MacOS X Support - Libraries/Runtime/Libs/MSL_Runtime_Mach-O_D.a - Unix - Library - Debug - - - FileRelative - ../../lib/jpeg_MACH.lib - Unix - - PathRelative - Project - :jpeg: - jpegM8.mcp - Unix - - Library - Debug, TargetOutputFile - - - FileRelative - ../../lib/png_MACH.lib - Unix - - PathRelative - Project - :png: - pngM8.mcp - Unix - - Library - Debug, TargetOutputFile - - - FileRelative - ../../lib/zlib_MACH.lib - Unix - - PathRelative - Project - :zlib: - zlibM8.mcp - Unix - - Library - Debug, TargetOutputFile - - - PathRelative - Project - :mac:carbon: - morefilex/MoreFilesX.cpp - Unix - Text - Debug - - - FileRelative - ../../lib/tif_MACH.lib - Unix - - PathRelative - Project - :tiff: - tiffM8.mcp - Unix - - Library - Debug, TargetOutputFile - - - FileRelative - ../../lib/regex_MACH.lib - Unix - - PathRelative - Project - :regex: - regexM8.mcp - Unix - - Library - Debug, TargetOutputFile - - - PathRelative - Project - ::include: - wx_cwc.pch - Unix - Text - Debug - - - PathRelative - Project - ::include: - wx_cwc.pch++ - Unix - Text - Debug - - - PathRelative - Project - :common: - datacmn.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - rgncmn.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - accesscmn.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - dpycmn.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - taskbarcmn.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - fldlgcmn.cpp - Unix - Text - Debug - - - PathRelative - Project - :generic: - :selstore.cpp - MacOS - Text - Debug - - - PathRelative - Project - :common: - appbase.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - fmapbase.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - stopwatch.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - init.cpp - Unix - Text - Debug - - - PathRelative - Project - unix - baseunix.cpp - Unix - Text - Debug - - - PathRelative - Project - :generic: - renderg.cpp - Unix - Text - Debug - - - PathRelative - Project - :mac:carbon: - renderer.cpp - Unix - Text - Debug - - - PathRelative - Project - xml - xml.cpp - Unix - Text - Debug - - - PathRelative - Project - expat/lib - xmlparse.c - Unix - Text - Debug - - - PathRelative - Project - expat/lib - xmlrole.c - Unix - Text - Debug - - - PathRelative - Project - expat/lib - xmltok.c - Unix - Text - Debug - - - PathRelative - Project - :common: - rendcmn.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - bookctrl.cpp - Unix - Text - Debug - - - PathRelative - Project - :mac:carbon: - drawer.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - stockitem.cpp - Unix - Text - Debug - - - PathRelative - Project - :mac:carbon: - taskbar.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_bmp.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_bmpbt.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_bttn.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_cald.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_chckb.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_chckl.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_choic.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_combo.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_dlg.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_frame.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_gauge.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_gdctl.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_html.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_listb.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_listc.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_menu.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_notbk.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_panel.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_radbt.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_radbx.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_scrol.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_scwin.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_sizer.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_slidr.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_spin.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_split.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_statbar.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_stbmp.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_stbox.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_stlin.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_sttxt.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_text.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_tglbtn.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_toolb.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_tree.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_unkwn.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_wizrd.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xmlres.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xmlrsall.cpp - Unix - Text - Debug - - - PathRelative - Project - unix - gsocket.cpp - Unix - Text - Debug - - - PathRelative - Project - mac/corefoundation - cfstring.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - uri.cpp - Unix - Text - Debug - - - PathRelative - Project - mac/corefoundation - utilsexc_cf.cpp - Unix - Text - Debug - - - PathRelative - Project - mac/corefoundation - stdpaths_cf.cpp - Unix - Text - Debug - - - PathRelative - Project - mac/corefoundation - gsockosx.cpp - Unix - Text - Debug - - - PathRelative - Project - :mac:carbon: - display.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - archive.cpp - Unix - Text - Debug - - - PathRelative - Project - :generic: - datectlg.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - stdpbase.cpp - Unix - Text - Debug - - - PathRelative - Project - unix - stdpaths.cpp - Unix - Text - Debug - - - PathRelative - Project - :mac:carbon: - imaglist.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_choicbk.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_datectrl.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_listbk.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - gbsizer.cpp - Unix - Text - Debug - - - PathRelative - Project - :generic: - choicbkg.cpp - Unix - Text - Debug - - - PathRelative - Project - :generic: - listbkg.cpp - Unix - Text - Debug - - - PathRelative - Project - unix - dlunix.cpp - Unix - Text - Debug - - - PathRelative - Project - :common: - debugrpt.cpp - Unix - Text - Debug - - - PathRelative - Project - xrc - xh_mdi.cpp - Unix - Text - Debug - - - - - FileRelative - ../../lib/regex_MACH.lib - Unix - - PathRelative - Project - :regex: - regexM8.mcp - Unix - - - - FileRelative - ../../lib/tif_MACH.lib - Unix - - PathRelative - Project - :tiff: - tiffM8.mcp - Unix - - - - FileRelative - ../../lib/zlib_MACH.lib - Unix - - PathRelative - Project - :zlib: - zlibM8.mcp - Unix - - - - FileRelative - ../../lib/png_MACH.lib - Unix - - PathRelative - Project - :png: - pngM8.mcp - Unix - - - - PathRelative - Project - :mac:carbon: - :accel.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :app.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :bitmap.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :bmpbuttn.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :brush.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :button.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :checkbox.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :checklst.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :choice.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :clipbrd.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :colordlg.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :colour.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :combobox.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :control.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :cursor.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :data.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :dc.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :dcclient.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :dcmemory.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :dcscreen.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :dialog.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :dirdlg.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :filedlg.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :font.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :fontdlg.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :frame.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :gauge.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :gdiobj.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :icon.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :joystick.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :listbox.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :main.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :mdi.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :menu.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :menuitem.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :minifram.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :msgdlg.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :palette.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :pen.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :printdlg.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :radiobox.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :radiobut.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :region.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :scrolbar.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :settings.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :slider.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :spinbutt.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :statbmp.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :statbox.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :stattext.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :tabctrl.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :textctrl.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :thread.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :timer.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :toolbar.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :utils.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :sound.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :window.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :printmac.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :dcprint.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :uma.cpp - MacOS - - - PathRelative - Project - :common: - :sckipc.cpp - MacOS - - - PathRelative - Project - :common: - :matrix.cpp - MacOS - - - PathRelative - Project - :common: - :tbarbase.cpp - MacOS - - - PathRelative - Project - :common: - :imagjpeg.cpp - MacOS - - - PathRelative - Project - :common: - :longlong.cpp - MacOS - - - PathRelative - Project - :common: - :docmdi.cpp - MacOS - - - PathRelative - Project - :common: - :appcmn.cpp - MacOS - - - PathRelative - Project - :common: - :utilscmn.cpp - MacOS - - - PathRelative - Project - :common: - :dynlib.cpp - MacOS - - - PathRelative - Project - :common: - :extended.c - MacOS - - - PathRelative - Project - :common: - :sckstrm.cpp - MacOS - - - PathRelative - Project - :common: - :zstream.cpp - MacOS - - - PathRelative - Project - :common: - :process.cpp - MacOS - - - PathRelative - Project - :common: - :docview.cpp - MacOS - - - PathRelative - Project - :common: - :sizer.cpp - MacOS - - - PathRelative - Project - :common: - :imagall.cpp - MacOS - - - PathRelative - Project - :common: - :imaggif.cpp - MacOS - - - PathRelative - Project - :common: - :imagpcx.cpp - MacOS - - - PathRelative - Project - :common: - :cmndata.cpp - MacOS - - - PathRelative - Project - :common: - :ftp.cpp - MacOS - - - PathRelative - Project - :common: - :menucmn.cpp - MacOS - - - PathRelative - Project - :common: - :string.cpp - MacOS - - - PathRelative - Project - :common: - :wfstream.cpp - MacOS - - - PathRelative - Project - :common: - :stream.cpp - MacOS - - - PathRelative - Project - :common: - :gdicmn.cpp - MacOS - - - PathRelative - Project - :common: - :protocol.cpp - MacOS - - - PathRelative - Project - :common: - :layout.cpp - MacOS - - - PathRelative - Project - :common: - :valgen.cpp - MacOS - - - PathRelative - Project - :common: - :intl.cpp - MacOS - - - PathRelative - Project - :common: - :list.cpp - MacOS - - - PathRelative - Project - :common: - :socket.cpp - MacOS - - - PathRelative - Project - :common: - :hash.cpp - MacOS - - - PathRelative - Project - :common: - :dlgcmn.cpp - MacOS - - - PathRelative - Project - :common: - :gifdecod.cpp - MacOS - - - PathRelative - Project - :common: - :filefn.cpp - MacOS - - - PathRelative - Project - :common: - :wincmn.cpp - MacOS - - - PathRelative - Project - :common: - :wxchar.cpp - MacOS - - - PathRelative - Project - :common: - :memory.cpp - MacOS - - - PathRelative - Project - :common: - :mstream.cpp - MacOS - - - PathRelative - Project - :common: - :lboxcmn.cpp - MacOS - - - PathRelative - Project - :common: - :fs_inet.cpp - MacOS - - - PathRelative - Project - :common: - :event.cpp - MacOS - - - PathRelative - Project - :common: - :image.cpp - MacOS - - - PathRelative - Project - :common: - :ipcbase.cpp - MacOS - - - PathRelative - Project - :common: - :tokenzr.cpp - MacOS - - - PathRelative - Project - :common: - :txtstrm.cpp - MacOS - - - PathRelative - Project - :common: - :filesys.cpp - MacOS - - - PathRelative - Project - :common: - :url.cpp - MacOS - - - PathRelative - Project - :common: - :fs_zip.cpp - MacOS - - - PathRelative - Project - :common: - :prntbase.cpp - MacOS - - - PathRelative - Project - :common: - :dcbase.cpp - MacOS - - - PathRelative - Project - :common: - :object.cpp - MacOS - - - PathRelative - Project - :common: - :http.cpp - MacOS - - - PathRelative - Project - :common: - :module.cpp - MacOS - - - PathRelative - Project - :common: - :validate.cpp - MacOS - - - PathRelative - Project - :common: - :file.cpp - MacOS - - - PathRelative - Project - :common: - :config.cpp - MacOS - - - PathRelative - Project - :common: - :fileconf.cpp - MacOS - - - PathRelative - Project - :common: - :timercmn.cpp - MacOS - - - PathRelative - Project - :common: - :framecmn.cpp - MacOS - - - PathRelative - Project - :common: - :textfile.cpp - MacOS - - - PathRelative - Project - :common: - :dynarray.cpp - MacOS - - - PathRelative - Project - :common: - :choiccmn.cpp - MacOS - - - PathRelative - Project - :common: - :helpbase.cpp - MacOS - - - PathRelative - Project - :common: - :ctrlsub.cpp - MacOS - - - PathRelative - Project - :common: - :ctrlcmn.cpp - MacOS - - - PathRelative - Project - :common: - :strconv.cpp - MacOS - - - PathRelative - Project - :common: - :sckfile.cpp - MacOS - - - PathRelative - Project - :common: - :valtext.cpp - MacOS - - - PathRelative - Project - :common: - :datstrm.cpp - MacOS - - - PathRelative - Project - :common: - :sckaddr.cpp - MacOS - - - PathRelative - Project - :common: - :variant.cpp - MacOS - - - PathRelative - Project - :common: - :dbtable.cpp - MacOS - - - PathRelative - Project - :common: - :fontcmn.cpp - MacOS - - - PathRelative - Project - :common: - :ffile.cpp - MacOS - - - PathRelative - Project - :common: - :paper.cpp - MacOS - - - PathRelative - Project - :common: - :clipcmn.cpp - MacOS - - - PathRelative - Project - :common: - :imagpnm.cpp - MacOS - - - PathRelative - Project - :common: - :imagpng.cpp - MacOS - - - PathRelative - Project - :common: - :imagbmp.cpp - MacOS - - - PathRelative - Project - :common: - :zipstrm.cpp - MacOS - - - PathRelative - Project - :common: - :log.cpp - MacOS - - - PathRelative - Project - :common: - :textcmn.cpp - MacOS - - - PathRelative - Project - :generic: - :laywin.cpp - MacOS - - - PathRelative - Project - :generic: - :busyinfo.cpp - MacOS - - - PathRelative - Project - :generic: - :listctrl.cpp - MacOS - - - PathRelative - Project - :generic: - :textdlgg.cpp - MacOS - - - PathRelative - Project - :generic: - :tipdlg.cpp - MacOS - - - PathRelative - Project - :generic: - :numdlgg.cpp - MacOS - - - PathRelative - Project - :generic: - :sashwin.cpp - MacOS - - - PathRelative - Project - :generic: - :dcpsg.cpp - MacOS - - - PathRelative - Project - :generic: - :panelg.cpp - MacOS - - - PathRelative - Project - :generic: - :tabg.cpp - MacOS - - - PathRelative - Project - :generic: - :choicdgg.cpp - MacOS - - - PathRelative - Project - :generic: - :wizard.cpp - MacOS - - - PathRelative - Project - :generic: - :progdlgg.cpp - MacOS - - - PathRelative - Project - :generic: - :caret.cpp - MacOS - - - PathRelative - Project - :generic: - :statusbr.cpp - MacOS - - - PathRelative - Project - :generic: - :logg.cpp - MacOS - - - PathRelative - Project - :generic: - :fontdlgg.cpp - MacOS - - - PathRelative - Project - :generic: - :splitter.cpp - MacOS - - - Name - db.cpp - MacOS - - - Name - dobjcmn.cpp - MacOS - - - PathRelative - Project - :common: - :fontmap.cpp - MacOS - - - PathRelative - Project - :common: - :geometry.cpp - MacOS - - - Name - colrdlgg.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :fontutil.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :dataobj.cpp - MacOS - - - PathRelative - Project - :html: - :m_list.cpp - MacOS - - - PathRelative - Project - :html: - :m_tables.cpp - MacOS - - - PathRelative - Project - :html: - :htmlwin.cpp - MacOS - - - PathRelative - Project - :html: - :m_pre.cpp - MacOS - - - PathRelative - Project - :html: - :m_image.cpp - MacOS - - - PathRelative - Project - :html: - :htmprint.cpp - MacOS - - - PathRelative - Project - :html: - :htmlfilt.cpp - MacOS - - - PathRelative - Project - :html: - :htmlpars.cpp - MacOS - - - PathRelative - Project - :html: - :htmltag.cpp - MacOS - - - PathRelative - Project - :html: - :m_hline.cpp - MacOS - - - PathRelative - Project - :html: - :winpars.cpp - MacOS - - - PathRelative - Project - :html: - :htmlcell.cpp - MacOS - - - PathRelative - Project - :html: - :m_layout.cpp - MacOS - - - PathRelative - Project - :html: - :m_fonts.cpp - MacOS - - - PathRelative - Project - :html: - :m_links.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :fontenum.cpp - MacOS - - - PathRelative - Project - :common: - :datetime.cpp - MacOS - - - PathRelative - Project - :common: - :encconv.cpp - MacOS - - - PathRelative - Project - :common: - :mimecmn.cpp - MacOS - - - Name - metafile.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :macnotfy.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :statbrma.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :tooltip.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :statlmac.cpp - MacOS - - - PathRelative - Project - :common: - :imagtiff.cpp - MacOS - - - PathRelative - Project - :generic: - :treectlg.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :notebmac.cpp - MacOS - - - PathRelative - Project - :html: - :m_dflist.cpp - MacOS - - - PathRelative - Project - :common: - :treebase.cpp - MacOS - - - PathRelative - Project - :common: - :cshelp.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :dirmac.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :mimetmac.cpp - MacOS - - - PathRelative - Project - :common: - :filename.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :spinctrl.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :glcanvas.cpp - MacOS - - - PathRelative - Project - :common: - :xpmdecod.cpp - MacOS - - - PathRelative - Project - :common: - :imagxpm.cpp - MacOS - - - PathRelative - Project - :generic: - :dirctrlg.cpp - MacOS - - - PathRelative - Project - :html: - :helpctrl.cpp - MacOS - - - PathRelative - Project - :html: - :helpfrm.cpp - MacOS - - - PathRelative - Project - :html: - :helpdata.cpp - MacOS - - - PathRelative - Project - :generic: - :tipwin.cpp - MacOS - - - PathRelative - Project - :common: - :radiocmn.cpp - MacOS - - - PathRelative - Project - :common: - :nbkbase.cpp - MacOS - - - PathRelative - Project - :generic: - :scrlwing.cpp - MacOS - - - PathRelative - Project - :common: - :gaugecmn.cpp - MacOS - - - PathRelative - Project - :common: - :containr.cpp - MacOS - - - PathRelative - Project - :common: - :quantize.cpp - MacOS - - - PathRelative - Project - :common: - :toplvcmn.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :toplevel.cpp - MacOS - - - PathRelative - Project - :generic: - :gridsel.cpp - MacOS - - - PathRelative - Project - :generic: - :grid.cpp - MacOS - - - PathRelative - Project - :common: - :statbar.cpp - MacOS - - - PathRelative - Project - :common: - :clntdata.cpp - MacOS - - - PathRelative - Project - :common: - :textbuf.cpp - MacOS - - - PathRelative - Project - :generic: - :dragimgg.cpp - MacOS - - - PathRelative - Project - :generic: - :calctrl.cpp - MacOS - - - PathRelative - Project - :common: - :bmpbase.cpp - MacOS - - - PathRelative - Project - :common: - :cmdline.cpp - MacOS - - - PathRelative - Project - :common: - :cmdproc.cpp - MacOS - - - PathRelative - Project - :common: - :dndcmn.cpp - MacOS - - - PathRelative - Project - :mac:carbon: - :dnd.cpp - MacOS - - - PathRelative - Project - :common: - :dbgrid.cpp - MacOS - - - PathRelative - Project - :common: - :dircmn.cpp - MacOS - - - PathRelative - Project - :common: - :dseldlg.cpp - MacOS - - - PathRelative - Project - :common: - :dynload.cpp - MacOS - - - PathRelative - Project - :common: - :effects.cpp - MacOS - - - PathRelative - Project - :common: - :fddlgcmn.cpp - MacOS - - - PathRelative - Project - :common: - :fs_mem.cpp - MacOS - - - PathRelative - Project - :common: - :regex.cpp - MacOS - - - PathRelative - Project - :common: - :sysopt.cpp - MacOS - - - PathRelative - Project - :common: - :imagiff.cpp - MacOS - - - PathRelative - Project - :generic: - :splash.cpp - MacOS - - - PathRelative - Project - :generic: - :fdrepdlg.cpp - MacOS - - - PathRelative - Project - :generic: - :gridctrl.cpp - MacOS - - - PathRelative - Project - :html: - :m_style.cpp - MacOS - - - PathRelative - Project - :common: - :hashmap.cpp - MacOS - - - PathRelative - Project - :generic: - :dirdlgg.cpp - MacOS - - - PathRelative - Project - :common: - :iconbndl.cpp - MacOS - - - PathRelative - Project - :common: - :artprov.cpp - MacOS - - - PathRelative - Project - :common: - :artstd.cpp - MacOS - - - PathRelative - Project - :common: - :imagfill.cpp - MacOS - - - PathRelative - Project - :common: - :msgout.cpp - MacOS - - - PathRelative - Project - :common: - :settcmn.cpp - MacOS - - - PathRelative - Project - :common: - :popupcmn.cpp - MacOS - - - PathRelative - Project - :generic: - :printps.cpp - MacOS - - - PathRelative - Project - unix - utilsunx.cpp - Unix - - - PathRelative - CodeWarrior - MSL/MSL_C - MSL_MacOS/Src/console_OS_X.c - Unix - - - PathRelative - CodeWarrior - MacOS X Support - Libraries/Runtime/Libs/MSL_Runtime_Mach-O_D.a - Unix - - - FileRelative - ../../lib/jpeg_MACH.lib - Unix - - PathRelative - Project - :jpeg: - jpegM8.mcp - Unix - - - - PathRelative - Project - :mac:carbon: - morefilex/MoreFilesX.cpp - Unix - - - PathRelative - Project - ::include: - wx_cwc.pch - Unix - - - PathRelative - Project - ::include: - wx_cwc.pch++ - Unix - - - PathRelative - Project - :common: - datacmn.cpp - Unix - - - PathRelative - Project - :common: - rgncmn.cpp - Unix - - - PathRelative - Project - :common: - accesscmn.cpp - Unix - - - PathRelative - Project - :common: - dpycmn.cpp - Unix - - - PathRelative - Project - :common: - taskbarcmn.cpp - Unix - - - PathRelative - Project - :common: - fldlgcmn.cpp - Unix - - - PathRelative - Project - :generic: - :selstore.cpp - MacOS - - - PathRelative - Project - :common: - appbase.cpp - Unix - - - PathRelative - Project - :common: - fmapbase.cpp - Unix - - - PathRelative - Project - :common: - stopwatch.cpp - Unix - - - PathRelative - Project - :common: - init.cpp - Unix - - - PathRelative - Project - unix - baseunix.cpp - Unix - - - PathRelative - Project - :generic: - renderg.cpp - Unix - - - PathRelative - Project - :mac:carbon: - renderer.cpp - Unix - - - PathRelative - Project - xml - xml.cpp - Unix - - - PathRelative - Project - expat/lib - xmlparse.c - Unix - - - PathRelative - Project - expat/lib - xmlrole.c - Unix - - - PathRelative - Project - expat/lib - xmltok.c - Unix - - - PathRelative - Project - :common: - rendcmn.cpp - Unix - - - PathRelative - Project - :common: - bookctrl.cpp - Unix - - - PathRelative - Project - :mac:carbon: - drawer.cpp - Unix - - - PathRelative - Project - :common: - stockitem.cpp - Unix - - - PathRelative - Project - :mac:carbon: - taskbar.cpp - Unix - - - PathRelative - Project - xrc - xh_bmp.cpp - Unix - - - PathRelative - Project - xrc - xh_bmpbt.cpp - Unix - - - PathRelative - Project - xrc - xh_bttn.cpp - Unix - - - PathRelative - Project - xrc - xh_cald.cpp - Unix - - - PathRelative - Project - xrc - xh_chckb.cpp - Unix - - - PathRelative - Project - xrc - xh_chckl.cpp - Unix - - - PathRelative - Project - xrc - xh_choic.cpp - Unix - - - PathRelative - Project - xrc - xh_combo.cpp - Unix - - - PathRelative - Project - xrc - xh_dlg.cpp - Unix - - - PathRelative - Project - xrc - xh_frame.cpp - Unix - - - PathRelative - Project - xrc - xh_gauge.cpp - Unix - - - PathRelative - Project - xrc - xh_gdctl.cpp - Unix - - - PathRelative - Project - xrc - xh_html.cpp - Unix - - - PathRelative - Project - xrc - xh_listb.cpp - Unix - - - PathRelative - Project - xrc - xh_listc.cpp - Unix - - - PathRelative - Project - xrc - xh_menu.cpp - Unix - - - PathRelative - Project - xrc - xh_notbk.cpp - Unix - - - PathRelative - Project - xrc - xh_panel.cpp - Unix - - - PathRelative - Project - xrc - xh_radbt.cpp - Unix - - - PathRelative - Project - xrc - xh_radbx.cpp - Unix - - - PathRelative - Project - xrc - xh_scrol.cpp - Unix - - - PathRelative - Project - xrc - xh_scwin.cpp - Unix - - - PathRelative - Project - xrc - xh_sizer.cpp - Unix - - - PathRelative - Project - xrc - xh_slidr.cpp - Unix - - - PathRelative - Project - xrc - xh_spin.cpp - Unix - - - PathRelative - Project - xrc - xh_split.cpp - Unix - - - PathRelative - Project - xrc - xh_statbar.cpp - Unix - - - PathRelative - Project - xrc - xh_stbmp.cpp - Unix - - - PathRelative - Project - xrc - xh_stbox.cpp - Unix - - - PathRelative - Project - xrc - xh_stlin.cpp - Unix - - - PathRelative - Project - xrc - xh_sttxt.cpp - Unix - - - PathRelative - Project - xrc - xh_text.cpp - Unix - - - PathRelative - Project - xrc - xh_tglbtn.cpp - Unix - - - PathRelative - Project - xrc - xh_toolb.cpp - Unix - - - PathRelative - Project - xrc - xh_tree.cpp - Unix - - - PathRelative - Project - xrc - xh_unkwn.cpp - Unix - - - PathRelative - Project - xrc - xh_wizrd.cpp - Unix - - - PathRelative - Project - xrc - xmlres.cpp - Unix - - - PathRelative - Project - xrc - xmlrsall.cpp - Unix - - - PathRelative - Project - unix - gsocket.cpp - Unix - - - PathRelative - Project - mac/corefoundation - cfstring.cpp - Unix - - - PathRelative - Project - :common: - uri.cpp - Unix - - - PathRelative - Project - mac/corefoundation - utilsexc_cf.cpp - Unix - - - PathRelative - Project - mac/corefoundation - stdpaths_cf.cpp - Unix - - - PathRelative - Project - mac/corefoundation - gsockosx.cpp - Unix - - - PathRelative - Project - :mac:carbon: - display.cpp - Unix - - - PathRelative - Project - :common: - archive.cpp - Unix - - - PathRelative - Project - :generic: - datectlg.cpp - Unix - - - PathRelative - Project - :common: - stdpbase.cpp - Unix - - - PathRelative - Project - unix - stdpaths.cpp - Unix - - - PathRelative - Project - :mac:carbon: - imaglist.cpp - Unix - - - PathRelative - Project - xrc - xh_choicbk.cpp - Unix - - - PathRelative - Project - xrc - xh_datectrl.cpp - Unix - - - PathRelative - Project - xrc - xh_listbk.cpp - Unix - - - PathRelative - Project - :common: - gbsizer.cpp - Unix - - - PathRelative - Project - :generic: - choicbkg.cpp - Unix - - - PathRelative - Project - :generic: - listbkg.cpp - Unix - - - PathRelative - Project - unix - dlunix.cpp - Unix - - - PathRelative - Project - :common: - debugrpt.cpp - Unix - - - PathRelative - Project - xrc - xh_mdi.cpp - Unix - - - - - - PathRelative - Project - :jpeg: - jpegM8.mcp - Unix - - - - Mach-O - Build, LinkAgainst - - FileRelative - ../../lib/jpeg_MACH.lib - Unix - - PathRelative - Project - :jpeg: - jpegM8.mcp - Unix - - - - - - - - PathRelative - Project - :png: - pngM8.mcp - Unix - - - - Mach-O - Build, LinkAgainst - - FileRelative - ../../lib/png_MACH.lib - Unix - - PathRelative - Project - :png: - pngM8.mcp - Unix - - - - - - - - PathRelative - Project - :zlib: - zlibM8.mcp - Unix - - - - Mach-O - Build, LinkAgainst - - FileRelative - ../../lib/zlib_MACH.lib - Unix - - PathRelative - Project - :zlib: - zlibM8.mcp - Unix - - - - - - - - PathRelative - Project - :tiff: - tiffM8.mcp - Unix - - - - Mach-O - Build, LinkAgainst - - FileRelative - ../../lib/tif_MACH.lib - Unix - - PathRelative - Project - :tiff: - tiffM8.mcp - Unix - - - - - - - - PathRelative - Project - :regex: - regexM8.mcp - Unix - - - - Mach-O - Build, LinkAgainst - - FileRelative - ../../lib/regex_MACH.lib - Unix - - PathRelative - Project - :regex: - regexM8.mcp - Unix - - - - - - - - - - PathRelative - OS X Volume - System/Library/Frameworks - Carbon.framework - Unix - - Carbon - - - - PathRelative - OS X Volume - System/Library/Frameworks - System.framework - Unix - - System - - - - - wxshlba Mach-O release - - - - UserSourceTrees - - - AlwaysSearchUserPathstrue - InterpretDOSAndUnixPathstrue - RequireFrameworkStyleIncludesfalse - UserSearchPaths - - SearchPath - Path::include: - PathFormatMacOS - PathRootProject - - Recursivefalse - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path::art: - PathFormatMacOS - PathRootProject - - Recursivefalse - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:generic: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:mac:carbon: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:common: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:zlib: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:png: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:jpeg: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:iodbc: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:tiff: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:html: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path:regex: - PathFormatMacOS - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Pathunix - PathFormatUnix - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path../lib - PathFormatUnix - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Pathxml - PathFormatUnix - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Pathexpat/lib - PathFormatUnix - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Pathmac/corefoundation - PathFormatUnix - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Pathxrc - PathFormatUnix - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SystemSearchPaths - - SearchPath - PathMacOS X Support/Headers/(wchar_t Support fix) - PathFormatUnix - PathRootCodeWarrior - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Pathusr/include - PathFormatUnix - PathRootOS X Volume - - Recursivefalse - FrameworkPathfalse - HostFlagsAll - - - SearchPath - PathMSL/MSL_C - PathFormatUnix - PathRootCodeWarrior - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - PathMSL/MSL_C++ - PathFormatUnix - PathRootCodeWarrior - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - PathMacOS X Support - PathFormatUnix - PathRootCodeWarrior - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Pathusr/lib - PathFormatUnix - PathRootOS X Volume - - Recursivefalse - FrameworkPathfalse - HostFlagsAll - - - SearchPath - PathSystem/Library/Frameworks - PathFormatUnix - PathRootOS X Volume - - Recursivefalse - FrameworkPathtrue - HostFlagsAll - - - - - MWRuntimeSettings_WorkingDirectory - MWRuntimeSettings_CommandLine - MWRuntimeSettings_HostApplication - Path - PathFormatGeneric - PathRootAbsolute - - MWRuntimeSettings_EnvVars - - - LinkerMacOS X PPC Linker - PreLinker - PostLinker - Targetnamewxshlba Mach-O release - OutputDirectory - Path::lib: - PathFormatMacOS - PathRootProject - - SaveEntriesUsingRelativePathstrue - - - FileMappings - - FileTypeAPPL - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypeAppl - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypeMDYL - FileExtension - CompilerMachO Importer - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeMLIB - FileExtension - CompilerMachO Importer - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeMMLB - FileExtension - CompilerMachO Importer - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeMPLF - FileExtension - CompilerMachO Importer - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeMWCD - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypeRSRC - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.arr - Compiler - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.axp - Compiler - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.c - CompilerMW C/C++ PPC Mac OS X - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.c++ - CompilerMW C/C++ PPC Mac OS X - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.cc - CompilerMW C/C++ PPC Mac OS X - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.cp - CompilerMW C/C++ PPC Mac OS X - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.cpp - CompilerMW C/C++ PPC Mac OS X - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.exp - Compiler - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.h - CompilerMW C/C++ PPC Mac OS X - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMaketrue - - - FileTypeTEXT - FileExtension.h++ - CompilerMW C/C++ PPC Mac OS X - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMaketrue - - - FileTypeTEXT - FileExtension.hpp - CompilerMW C/C++ PPC Mac OS X - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMaketrue - - - FileTypeTEXT - FileExtension.lcf - Compiler - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.m - CompilerMW C/C++ PPC Mac OS X - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.mm - CompilerMW C/C++ PPC Mac OS X - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.pch - CompilerMW C/C++ PPC Mac OS X - EditLanguageC/C++ - Precompiletrue - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.pch++ - CompilerMW C/C++ PPC Mac OS X - EditLanguageC/C++ - Precompiletrue - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.pchm - CompilerMW C/C++ PPC Mac OS X - EditLanguageC/C++ - Precompiletrue - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.pchmm - CompilerMW C/C++ PPC Mac OS X - EditLanguageC/C++ - Precompiletrue - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.plc - CompilerProperty List Compiler - EditLanguageProperty List - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.ploc - CompilerProperty List Compiler - EditLanguageProperty List - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.r - CompilerRez - EditLanguageRez - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.wke - Compiler - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypedocu - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileTypersrc - FileExtension - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileExtension.a - CompilerMachO Importer - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileExtension.doc - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFilefalse - IgnoredByMaketrue - - - FileExtension.dylib - CompilerMachO Importer - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileExtension.gif - CompilerCopy To Package - EditLanguage - Precompilefalse - Launchabletrue - ResourceFilefalse - IgnoredByMaketrue - - - FileExtension.icns - CompilerCopy To Package - EditLanguage - Precompilefalse - Launchabletrue - ResourceFilefalse - IgnoredByMaketrue - - - FileExtension.jpg - CompilerCopy To Package - EditLanguage - Precompilefalse - Launchabletrue - ResourceFilefalse - IgnoredByMaketrue - - - FileExtension.lib - CompilerMachO Importer - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileExtension.nib - CompilerCopy To Package - EditLanguage - Precompilefalse - Launchabletrue - ResourceFilefalse - IgnoredByMaketrue - - - FileExtension.pl - CompilerPerl Tool - EditLanguagePerl - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileExtension.plist - CompilerCopy To Package - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMaketrue - - - FileExtension.ppob - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileExtension.psh - CompilerShell Tool - EditLanguage - Precompiletrue - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileExtension.rsrc - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFiletrue - IgnoredByMakefalse - - - FileExtension.sh - CompilerShell Tool - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileExtension.strings - CompilerCopy To Package - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMaketrue - - - FileExtension.tiff - CompilerCopy To Package - EditLanguage - Precompilefalse - Launchabletrue - ResourceFilefalse - IgnoredByMaketrue - - - - - CacheModDatestrue - DumpBrowserInfofalse - CacheSubprojectstrue - UseThirdPartyDebuggerfalse - BrowserGenerator0 - DebuggerAppPath - Path - PathFormatGeneric - PathRootAbsolute - - DebuggerCmdLineArgs - DebuggerWorkingDir - Path - PathFormatGeneric - PathRootAbsolute - - CodeCompletionPrefixFileNameMacHeaders.c - CodeCompletionMacroFileNameMacOS_Carbon_C++_Macros.h - - - ConsoleEncoding0 - LogSystemMessagestrue - AutoTargetDLLsfalse - StopAtWatchpointstrue - PauseWhileRunningfalse - PauseInterval5 - PauseUIFlags0 - AltExePath - Path - PathFormatGeneric - PathRootAbsolute - - StopAtTempBPOnLaunchtrue - CacheSymbolicstrue - TempBPFunctionNamemain - TempBPType0 - - - Enabledfalse - ConnectionName - DownloadPath - LaunchRemoteAppfalse - RemoteAppPath - CoreID0 - JTAGClockSpeed8000 - IsMultiCorefalse - OSDownloadfalse - UseGlobalOSDownloadfalse - OSDownloadConnectionName - OSDownloadPath - AltDownloadfalse - AltDownloadConnectionName - - - OtherExecutables - - - CustomColor1 - Red0 - Green32767 - Blue0 - - CustomColor2 - Red0 - Green32767 - Blue0 - - CustomColor3 - Red0 - Green32767 - Blue0 - - CustomColor4 - Red0 - Green32767 - Blue0 - - - - MWFrontEnd_C_cplusplus0 - MWFrontEnd_C_checkprotos0 - MWFrontEnd_C_arm0 - MWFrontEnd_C_trigraphs0 - MWFrontEnd_C_onlystdkeywords0 - MWFrontEnd_C_enumsalwaysint0 - MWFrontEnd_C_mpwpointerstyle0 - MWFrontEnd_C_prefixnamewx/wxshlba_cwc.h - MWFrontEnd_C_ansistrict0 - MWFrontEnd_C_mpwcnewline0 - MWFrontEnd_C_wchar_type1 - MWFrontEnd_C_enableexceptions1 - MWFrontEnd_C_dontreusestrings0 - MWFrontEnd_C_poolstrings0 - MWFrontEnd_C_dontinline0 - MWFrontEnd_C_useRTTI1 - MWFrontEnd_C_multibyteaware0 - MWFrontEnd_C_unsignedchars1 - MWFrontEnd_C_autoinline1 - MWFrontEnd_C_booltruefalse1 - MWFrontEnd_C_inlinelevel0 - MWFrontEnd_C_ecplusplus0 - MWFrontEnd_C_objective_c0 - MWFrontEnd_C_defer_codegen0 - MWFrontEnd_C_templateparser0 - MWFrontEnd_C_c990 - MWFrontEnd_C_bottomupinline1 - - - MWWarning_C_warn_illpragma1 - MWWarning_C_warn_emptydecl0 - MWWarning_C_warn_possunwant0 - MWWarning_C_warn_unusedvar0 - MWWarning_C_warn_unusedarg0 - MWWarning_C_warn_extracomma0 - MWWarning_C_pedantic1 - MWWarning_C_warningerrors0 - MWWarning_C_warn_hidevirtual1 - MWWarning_C_warn_implicitconv0 - MWWarning_C_warn_notinlined0 - MWWarning_C_warn_structclass1 - - - MWFTP_Post_hostName - MWFTP_Post_username - MWFTP_Post_password0ÿÂà -ž0¼,šì - MWFTP_Post_remoteDir - MWFTP_Post_ftp_PathVersion1 - MWFTP_Post_ftp_PathType0 - MWFTP_Post_ftp_PathFormat0 - MWFTP_Post_ftp_tree - MWFTP_Post_uploadDir - MWFTP_Post_ftp_port21 - MWFTP_Post_SendBin1 - MWFTP_Post_ShouldLog1 - - - MWCommandLine_Java_clsName - MWCommandLine_Java_args - - - MWVJavaDebugging_Protocol1 - MWVJavaDebugging_JDKVersion1 - MWVJavaDebugging_TimeOut10 - MWVJavaDebugging_SupportSlowDevicesfalse - MWVJavaDebugging_UseRemoteLaunchAgentfalse - MWVJavaDebugging_LaunchVMasServerfalse - - - MWJava_Language_optimizefalse - MWJava_Language_warnDeprecatedfalse - MWJava_Language_emitMapfalse - MWJava_Language_strictFileNamesfalse - MWJava_Language_strictFileHierarchyfalse - MWJava_Language_1_1_Compatiblefalse - MWJava_Language_emitHeaders0 - MWJava_Language_headerTypeJNINativeHeaders - MWJava_Language_packageFilter - MWJava_Language_genCommentstrue - MWJava_Language_genHeadersfalse - MWJava_Language_enableAssertsfalse - MWJava_Language_targetVM1.1 - - - Manifest-JAD Attributes - - AttributeMain-Class - ValueAuto-Generated - - - - - MWJava_MRJAppBuilder_outFileMRJApplication - MWJava_MRJAppBuilder_mergefalse - MWJava_MRJAppBuilder_quitMenutrue - MWJava_MRJAppBuilder_growfalse - MWJava_MRJAppBuilder_stdoutTypeConsole - MWJava_MRJAppBuilder_stderrTypeConsole - MWJava_MRJAppBuilder_stdinTypeConsole - MWJava_MRJAppBuilder_appIconPVersion0 - MWJava_MRJAppBuilder_appIconPType0 - MWJava_MRJAppBuilder_appIconPFormat0 - MWJava_MRJAppBuilder_appIconPTree - MWJava_MRJAppBuilder_appIconFile - MWJava_MRJAppBuilder_splashScreenPVersion0 - MWJava_MRJAppBuilder_splashScreenPType0 - MWJava_MRJAppBuilder_splashScreenPFormat0 - MWJava_MRJAppBuilder_splashScreenPTree - MWJava_MRJAppBuilder_splashScreenPICTFile - MWJava_MRJAppBuilder_aboutName - MWJava_MRJAppBuilder_stdoutPVersion0 - MWJava_MRJAppBuilder_stdoutPType0 - MWJava_MRJAppBuilder_stdoutPFormat0 - MWJava_MRJAppBuilder_stdoutPTree - MWJava_MRJAppBuilder_stdoutFile - MWJava_MRJAppBuilder_stdoutAppendfalse - MWJava_MRJAppBuilder_stderrPType0 - MWJava_MRJAppBuilder_stderrPFormat0 - MWJava_MRJAppBuilder_stderrPTree - MWJava_MRJAppBuilder_stderrFile - MWJava_MRJAppBuilder_stderrAppendfalse - MWJava_MRJAppBuilder_stdinPType0 - MWJava_MRJAppBuilder_stdinPFormat0 - MWJava_MRJAppBuilder_stdinPTree - MWJava_MRJAppBuilder_stdinFile - - - MWJava_Output_outputtypeJarFile - MWJava_Output_outfileJavaClasses.jar - MWJava_Output_ftype1514754080 - MWJava_Output_fcreator1297570384 - MWJava_Output_compress0 - MWJava_Output_genManifest0 - MWJava_Output_trunctypeFront - MWJava_Output_deleteClasses0 - MWJava_Output_consoleApp1 - MWJava_Output_preverify0 - MWJava_Output_genJad0 - MWJava_Output_obfuscate0 - - - MWJava_Proj_projtypeApplet - MWJava_Proj_mainClassName - MWJava_Proj_HTMLAppCreator1145457748 - MWJava_Proj_HTMLAppNameMetrowerks Java - MWJava_Proj_PathVersion1 - MWJava_Proj_PathType0 - MWJava_Proj_PathFormat0 - MWJava_Proj_tree - MWJava_Proj_HTMLAppWin32NameInternet Explorer - MWJava_Proj_compress0 - MWJava_Proj_simulator0 - MWJava_Proj_useVM\000\000macosx - MWJava_Proj_vmarguments - MWJava_Proj_vmName - MWJava_Proj_simPropFile - - - MWJavaDoc_Proj_Version1 - MWJavaDoc_Proj_Deprecated1 - MWJavaDoc_Proj_Author1 - MWJavaDoc_Proj_Index1 - MWJavaDoc_Proj_Tree1 - MWJavaDoc_Proj_SunResolveToSame0 - MWJavaDoc_Proj_Shortnames1 - MWJavaDoc_Proj_Folder0 - MWJavaDoc_Proj_GenerateAPILinks0 - MWJavaDoc_Proj_scopePublic - MWJavaDoc_Proj_fcreator1297303877 - MWJavaDoc_Proj_encodingName - MWJavaDoc_Proj_decodingName - MWJavaDoc_Proj_javaPackagePathhttp://java.sun.com/products/jdk/1.1/docs/api/ - - - MWMerge_MacOS_projectTypeApplication - MWMerge_MacOS_outputNameMerge Out - MWMerge_MacOS_outputCreator???? - MWMerge_MacOS_outputTypeAPPL - MWMerge_MacOS_suppressWarning0 - MWMerge_MacOS_copyFragments1 - MWMerge_MacOS_copyResources1 - MWMerge_MacOS_flattenResource0 - MWMerge_MacOS_flatFileNamea.rsrc - MWMerge_MacOS_flatFileOutputPath - Path: - PathFormatMacOS - PathRootProject - - MWMerge_MacOS_skipResources - DLGX - ckid - Proj - WSPC - - - - FileLockedfalse - ResourcesMapIsReadOnlyfalse - PrinterDriverIsMultiFinderCompatiblefalse - Invisiblefalse - HasBundlefalse - NameLockedfalse - Stationeryfalse - HasCustomIconfalse - Sharedfalse - HasBeenInitedfalse - Label0 - Comments - - - MWMacOSPackager_UsePackager0 - MWMacOSPackager_FolderToPackage - Path - PathFormatMacOS - PathRootAbsolute - - MWMacOSPackager_CreateClassicAlias0 - MWMacOSPackager_ClassicAliasMethodUseTargetOutput - MWMacOSPackager_ClassicAliasPath - Path - PathFormatGeneric - PathRootAbsolute - - MWMacOSPackager_CreatePkgInfo0 - MWMacOSPackager_PkgCreatorType???? - MWMacOSPackager_PkgFileTypeAPPL - - - MWCodeGen_PPC_structalignmentPPC_mw - MWCodeGen_PPC_tracebacktablesOutOfLine - MWCodeGen_PPC_processorGeneric - MWCodeGen_PPC_function_align4 - MWCodeGen_PPC_tocdata1 - MWCodeGen_PPC_largetoc0 - MWCodeGen_PPC_profiler0 - MWCodeGen_PPC_vectortocdata0 - MWCodeGen_PPC_poolconst0 - MWCodeGen_PPC_peephole1 - MWCodeGen_PPC_readonlystrings0 - MWCodeGen_PPC_linkerpoolsstrings0 - MWCodeGen_PPC_volatileasm0 - MWCodeGen_PPC_schedule0 - MWCodeGen_PPC_altivec0 - MWCodeGen_PPC_altivec_move_block0 - MWCodeGen_PPC_strictIEEEfp0 - MWCodeGen_PPC_fpcontract1 - MWCodeGen_PPC_genfsel0 - MWCodeGen_PPC_orderedfpcmp0 - - - MWCodeGen_MachO_structalignmentPPC_mw - MWCodeGen_MachO_profiler_enumOff - MWCodeGen_MachO_processorGeneric - MWCodeGen_MachO_function_align4 - MWCodeGen_MachO_common0 - MWCodeGen_MachO_peephole1 - MWCodeGen_MachO_readonlystrings0 - MWCodeGen_MachO_linkerpoolsstrings1 - MWCodeGen_MachO_volatileasm0 - MWCodeGen_MachO_schedule0 - MWCodeGen_MachO_altivec0 - MWCodeGen_MachO_vecmove0 - MWCodeGen_MachO_fp_ieee_strict0 - MWCodeGen_MachO_fpcontract1 - MWCodeGen_MachO_genfsel0 - MWCodeGen_MachO_fp_cmps_ordered0 - - - MWDisassembler_PPC_showcode1 - MWDisassembler_PPC_extended1 - MWDisassembler_PPC_mix0 - MWDisassembler_PPC_nohex0 - MWDisassembler_PPC_showdata1 - MWDisassembler_PPC_showexceptions1 - MWDisassembler_PPC_showsym1 - MWDisassembler_PPC_shownames1 - - - GlobalOptimizer_PPC_optimizationlevelLevel4 - GlobalOptimizer_PPC_optforSpeed - - - MWLinker_PPC_linksym1 - MWLinker_PPC_symfullpath1 - MWLinker_PPC_linkmap0 - MWLinker_PPC_nolinkwarnings0 - MWLinker_PPC_dontdeadstripinitcode1 - MWLinker_PPC_permitmultdefs0 - MWLinker_PPC_linkmodeFast - MWLinker_PPC_initname - MWLinker_PPC_mainname__start - MWLinker_PPC_termname - - - MWLinker_MacOSX_linksym0 - MWLinker_MacOSX_symfullpath1 - MWLinker_MacOSX_nolinkwarnings0 - MWLinker_MacOSX_linkmap0 - MWLinker_MacOSX_dontdeadstripinitcode0 - MWLinker_MacOSX_permitmultdefs1 - MWLinker_MacOSX_use_objectivec_semantics0 - MWLinker_MacOSX_strip_debug_symbols0 - MWLinker_MacOSX_split_segs0 - MWLinker_MacOSX_report_msl_overloads0 - MWLinker_MacOSX_objects_follow_linkorder0 - MWLinker_MacOSX_linkmodeFast - MWLinker_MacOSX_exportsPragma - MWLinker_MacOSX_sortcodeNone - MWLinker_MacOSX_mainname - - - MWProject_MacOSX_typeLibrary - MWProject_MacOSX_outfilewxshlba_Mach.lib - MWProject_MacOSX_filecreatorCWIE - MWProject_MacOSX_filetypeMLIB - MWProject_MacOSX_vmaddress0 - MWProject_MacOSX_usedefaultvmaddr1 - MWProject_MacOSX_flatrsrc0 - MWProject_MacOSX_flatrsrcfilename - MWProject_MacOSX_flatrsrcoutputdir - Path: - PathFormatMacOS - PathRootProject - - MWProject_MacOSX_installpath./ - MWProject_MacOSX_dont_prebind0 - MWProject_MacOSX_flat_namespace0 - MWProject_MacOSX_frameworkversionA - MWProject_MacOSX_currentversion0 - MWProject_MacOSX_flat_oldimpversion0 - - - MWLinker_MachO_exportsNone - MWLinker_MachO_mainnamestart - MWLinker_MachO_currentversion0 - MWLinker_MachO_compatibleversion0 - MWLinker_MachO_symfullpath0 - MWLinker_MachO_supresswarnings0 - MWLinker_MachO_multisymerror0 - MWLinker_MachO_prebind1 - MWLinker_MachO_deadstrip1 - MWLinker_MachO_objectivecsemantics0 - MWLinker_MachO_whichfileloaded0 - MWLinker_MachO_whyfileloaded0 - MWLinker_MachO_readonlyrelocsErrors - MWLinker_MachO_undefinedsymbolsErrors - MWLinker_MachO_twolevelnamespace1 - MWLinker_MachO_stripdebugsymbols0 - - - MWProject_MachO_typeExecutable - MWProject_MachO_outfilea.exe - MWProject_MachO_filecreator???? - MWProject_MachO_filetypeMEXE - MWProject_MachO_vmaddress4096 - MWProject_MachO_flatrsrc1 - MWProject_MachO_flatrsrcfilenamea.rsrc - MWProject_MachO_flatrsrcoutputdir - Path: - PathFormatMacOS - PathRootProject - - MWProject_MachO_installpath./ - MWProject_MachO_frameworkversion - - - MWPEF_exportsAll - MWPEF_libfolder0 - MWPEF_sortcodeNone - MWPEF_expandbss0 - MWPEF_sharedata0 - MWPEF_olddefversion0 - MWPEF_oldimpversion0 - MWPEF_currentversion0 - MWPEF_fragmentnamewxwin - MWPEF_collapsereloads0 - - - MWProject_PPC_typeLibrary - MWProject_PPC_outfilewx_CARBON_d.lib - MWProject_PPC_filecreator???? - MWProject_PPC_filetype???? - MWProject_PPC_size0 - MWProject_PPC_minsize0 - MWProject_PPC_stacksize0 - MWProject_PPC_flags0 - MWProject_PPC_symfilename - MWProject_PPC_rsrcname - MWProject_PPC_rsrcheaderNative - MWProject_PPC_rsrctype???? - MWProject_PPC_rsrcid0 - MWProject_PPC_rsrcflags0 - MWProject_PPC_rsrcstore0 - MWProject_PPC_rsrcmerge0 - MWProject_PPC_flatrsrc0 - MWProject_PPC_flatrsrcoutputdir - Path: - PathFormatMacOS - PathRootProject - - MWProject_PPC_flatrsrcfilename - - - MWAssembler_PPC_auxheader0 - MWAssembler_PPC_symmodeMac - MWAssembler_PPC_dialectPPC - MWAssembler_PPC_prefixfile - MWAssembler_PPC_typecheck0 - MWAssembler_PPC_warnings0 - MWAssembler_PPC_casesensitive0 - - - PList_OutputTypeFile - PList_OutputEncodingUTF-8 - PList_Prefix - PList_FileFilenameInfo.plist - PList_FileDirectory - Path: - PathFormatMacOS - PathRootProject - - PList_ResourceTypeplst - PList_ResourceID0 - PList_ResourceName - - - MWRez_Language_maxwidth80 - MWRez_Language_scriptRoman - MWRez_Language_alignmentAlign1 - MWRez_Language_filtermodeFilterSkip - MWRez_Language_suppresswarnings0 - MWRez_Language_escapecontrolchars1 - MWRez_Language_prefixname - MWRez_Language_filteredtypes'CODE' 'DATA' 'PICT' - - - MWWinRC_prefixname - - - MWCodeGen_X86_processorGeneric - MWCodeGen_X86_alignmentbytes8 - MWCodeGen_X86_exceptionsZeroOverhead - MWCodeGen_X86_name_manglingMWWin32 - MWCodeGen_X86_use_extinst0 - MWCodeGen_X86_extinst_mmx0 - MWCodeGen_X86_extinst_3dnow0 - MWCodeGen_X86_use_mmx_3dnow_convention0 - MWCodeGen_X86_extinst_cmov0 - MWCodeGen_X86_extinst_sse0 - MWCodeGen_X86_extinst_sse20 - MWCodeGen_X86_intrinsics0 - MWCodeGen_X86_optimizeasm0 - MWCodeGen_X86_disableopts0 - MWCodeGen_X86_profile0 - MWLinker_X86_runtimeCustom - MWCodeGen_X86_readonlystrings0 - - - MWLinker_X86_subsysmajorid4 - MWLinker_X86_subsysminorid0 - MWCOFF_X86_opsysmajorid4 - MWCOFF_X86_opsysminorid0 - MWLinker_X86_usrmajorid0 - MWLinker_X86_usrminorid0 - MWProject_X86_maxstacksize1024 - MWProject_X86_minstacksize4 - MWProject_X86_size1024 - MWProject_X86_minsize4 - MWCOFF_X86_coff_flags0 - MWCOFF_X86_dll_flags0 - MWProject_X86_baseaddress4194304 - MWCOFF_X86_filealign512 - MWCOFF_X86_sectionalign4096 - - - PDisasmX86_showHeaderstrue - PDisasmX86_showSectHeaderstrue - PDisasmX86_showSymTabtrue - PDisasmX86_showCodetrue - PDisasmX86_showDatatrue - PDisasmX86_showDebugfalse - PDisasmX86_showExceptionsfalse - PDisasmX86_showRawfalse - PDisasmX86_showAllRawfalse - PDisasmX86_showSourcefalse - PDisasmX86_showRelocationtrue - PDisasmX86_showHextrue - PDisasmX86_showCommentsfalse - PDisasmX86_showSymDefstrue - PDisasmX86_unmanglefalse - PDisasmX86_verbosefalse - PDisasmX86_resolveRelocstrue - PDisasmX86_resolveLocalsfalse - - - MWDebugger_X86_Exceptions - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - - - - GlobalOptimizer_X86_optimizationlevelLevel0 - GlobalOptimizer_X86_optforSpeed - - - MWLinker_X86_entrypointusageDefault - MWLinker_X86_entrypoint - MWLinker_X86_subsystemWinGUI - MWLinker_X86_commandfile - MWLinker_X86_generatemap0 - MWLinker_X86_linksym1 - MWLinker_X86_linkCV1 - MWLinker_X86_symfullpathfalse - MWLinker_X86_linkdebugtrue - MWLinker_X86_checksumfalse - MWLinker_X86_zero_init_bssfalse - MWLinker_X86_mergedatafalse - MWLinker_X86_usedefaultlibsfalse - MWLinker_X86_adddefaultlibsfalse - MWLinker_X86_nowarningsfalse - MWLinker_X86_verbosefalse - - - MWProject_X86_typeLibrary - MWProject_X86_outfilewx_x86_d.lib - MWProject_X86_importlib - MWProject_X86_setimportlibdirfalse - MWProject_X86_dontgenerateimportlibfalse - MWProject_X86_oldformatlibfalse - MWProject_X86_replaceobjextensionfalse - MWProject_X86_copyallfilesfalse - - - - PathRelative - Project - ::include: - wxshlba_cwc.pch++ - Unix - Text - Debug - - - PathRelative - Project - ::include: - wxshlba_cwc.pch - Unix - Text - Debug - - - - - PathRelative - Project - ::include: - wxshlba_cwc.pch++ - Unix - - - PathRelative - Project - ::include: - wxshlba_cwc.pch - Unix - - - - - - PathRelative - OS X Volume - System/Library/Frameworks - Carbon.framework - Unix - - Carbon - - - - PathRelative - OS X Volume - System/Library/Frameworks - System.framework - Unix - - System - - - - - - - wxlib Carbon debug - wxlib Carbon release - wxlib Carbon resources - wxshlb Carbon debug - wxshlb Carbon release - wxshlba Carbon debug - wxshlba Carbon release - wxlib Mach-O debug - wxlib Mach-O release - wxshlb Mach-O debug - wxshlb Mach-O release - wxshlba Mach-O debug - wxshlba Mach-O release - all targets - - - - common - - wxshlb Mach-O debug - PathRelative - Project - :common: - accesscmn.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :common: - appbase.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :common: - appcmn.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :common: - archive.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :common: - artprov.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :common: - artstd.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :common: - bmpbase.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :common: - bookctrl.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :generic: - choicbkg.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :common: - choiccmn.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :common: - clipcmn.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :common: - clntdata.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :common: - cmdline.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :common: - cmdproc.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :common: - cmndata.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :common: - config.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :common: - containr.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :common: - cshelp.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :common: - ctrlcmn.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :common: - ctrlsub.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :common: - datacmn.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :common: - datetime.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :common: - datstrm.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :common: - db.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :common: - dbgrid.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :common: - dbtable.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :common: - dcbase.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :common: - debugrpt.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :common: - dircmn.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :common: - dlgcmn.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :common: - dndcmn.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :common: - dobjcmn.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :common: - docmdi.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :common: - docview.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :common: - dpycmn.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :common: - dseldlg.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :common: - dynarray.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :common: - dynlib.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :common: - dynload.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :common: - effects.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :common: - encconv.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :common: - event.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :common: - extended.c - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :common: - fddlgcmn.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :common: - ffile.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :common: - file.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :common: - fileconf.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :common: - filefn.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :common: - filename.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :common: - filesys.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :common: - fldlgcmn.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :common: - fmapbase.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :common: - fontcmn.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :common: - fontmap.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :common: - framecmn.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :common: - fs_inet.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :common: - fs_mem.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :common: - fs_zip.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :common: - ftp.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :common: - gaugecmn.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :common: - gbsizer.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :common: - gdicmn.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :common: - geometry.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :common: - gifdecod.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :common: - hash.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :common: - hashmap.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :common: - helpbase.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :common: - http.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :common: - iconbndl.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :common: - imagall.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :common: - imagbmp.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :common: - image.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :common: - imagfill.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :common: - imaggif.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :common: - imagiff.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :common: - imagjpeg.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :common: - imagpcx.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :common: - imagpng.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :common: - imagpnm.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :common: - imagtiff.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :common: - imagxpm.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :common: - init.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :common: - intl.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :common: - ipcbase.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :common: - layout.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :common: - lboxcmn.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :common: - list.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :common: - log.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :common: - longlong.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :common: - matrix.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :common: - memory.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :common: - menucmn.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :common: - mimecmn.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :common: - module.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :common: - msgout.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :common: - mstream.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :common: - nbkbase.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :common: - object.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :common: - paper.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :common: - popupcmn.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :common: - prntbase.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :common: - process.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :common: - protocol.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :common: - quantize.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :common: - radiocmn.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :common: - regex.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :common: - rendcmn.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :common: - rgncmn.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :common: - sckaddr.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :common: - sckfile.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :common: - sckipc.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :common: - sckstrm.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :common: - settcmn.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :common: - sizer.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :common: - socket.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :common: - statbar.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :common: - stdpbase.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :common: - stockitem.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :common: - stopwatch.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :common: - strconv.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :common: - stream.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :common: - string.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :common: - sysopt.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :common: - taskbarcmn.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :common: - tbarbase.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :common: - textbuf.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :common: - textcmn.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :common: - textfile.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :common: - timercmn.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :common: - tokenzr.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :common: - toplvcmn.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :common: - treebase.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :common: - txtstrm.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :common: - uri.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :common: - url.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :common: - utilscmn.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :common: - valgen.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :common: - validate.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :common: - valtext.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :common: - variant.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :common: - wfstream.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :common: - wincmn.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :common: - wxchar.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :common: - xpmdecod.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :common: - zipstrm.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :common: - zstream.cpp - Unix - - - generic - - wxshlb Mach-O debug - PathRelative - Project - :generic: - busyinfo.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :generic: - calctrl.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :generic: - caret.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :generic: - choicdgg.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :generic: - colrdlgg.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :generic: - datectlg.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :generic: - dcpsg.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :generic: - dirctrlg.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :generic: - dirdlgg.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :generic: - dragimgg.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :generic: - fdrepdlg.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :generic: - fontdlgg.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :generic: - grid.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :generic: - gridctrl.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :generic: - gridsel.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :generic: - laywin.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :generic: - listbkg.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :generic: - listctrl.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :generic: - logg.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :generic: - numdlgg.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :generic: - panelg.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :generic: - printps.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :generic: - progdlgg.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :generic: - renderg.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :generic: - sashwin.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :generic: - scrlwing.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :generic: - selstore.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :generic: - splash.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :generic: - splitter.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :generic: - statusbr.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :generic: - tabg.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :generic: - textdlgg.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :generic: - tipdlg.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :generic: - tipwin.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :generic: - treectlg.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :generic: - wizard.cpp - Unix - - - headers - - wxlib Carbon release - PathRelative - Project - ::include: - :wx_cwc.pch - MacOS - - - wxlib Carbon release - PathRelative - Project - ::include: - :wx_cwc.pch++ - MacOS - - - wxlib Carbon debug - PathRelative - Project - ::include: - :wx_cwc_d.pch - MacOS - - - wxlib Carbon debug - PathRelative - Project - ::include: - wx_cwc_d.pch++ - Unix - - - wxshlb Mach-O release - PathRelative - Project - ::include: - wxshlb_cwc.pch - Unix - - - wxshlb Mach-O release - PathRelative - Project - ::include: - wxshlb_cwc.pch++ - Unix - - - wxshlb Mach-O debug - PathRelative - Project - ::include: - wxshlb_cwc_d.pch - Unix - - - wxshlb Mach-O debug - PathRelative - Project - ::include: - wxshlb_cwc_d.pch++ - Unix - - - wxshlba Carbon release - PathRelative - Project - ::include: - :wxshlba_cwc.pch - MacOS - - - wxshlba Carbon release - PathRelative - Project - ::include: - :wxshlba_cwc.pch++ - MacOS - - - wxshlba Mach-O debug - PathRelative - Project - ::include: - wxshlba_cwc_d.pch - Unix - - - wxshlba Mach-O debug - PathRelative - Project - ::include: - wxshlba_cwc_d.pch++ - Unix - - - html - - wxshlb Mach-O debug - PathRelative - Project - :html: - :helpctrl.cpp - MacOS - - - wxshlb Mach-O debug - PathRelative - Project - :html: - :helpdata.cpp - MacOS - - - wxshlb Mach-O debug - PathRelative - Project - :html: - :helpfrm.cpp - MacOS - - - wxshlb Mach-O debug - PathRelative - Project - :html: - :htmlcell.cpp - MacOS - - - wxshlb Mach-O debug - PathRelative - Project - :html: - :htmlfilt.cpp - MacOS - - - wxshlb Mach-O debug - PathRelative - Project - :html: - :htmlpars.cpp - MacOS - - - wxshlb Mach-O debug - PathRelative - Project - :html: - :htmltag.cpp - MacOS - - - wxshlb Mach-O debug - PathRelative - Project - :html: - :htmlwin.cpp - MacOS - - - wxshlb Mach-O debug - PathRelative - Project - :html: - :htmprint.cpp - MacOS - - modules - - wxshlb Mach-O debug - PathRelative - Project - :html: - :m_style.cpp - MacOS - - - wxshlb Mach-O debug - PathRelative - Project - :html: - :m_dflist.cpp - MacOS - - - wxshlb Mach-O debug - PathRelative - Project - :html: - :m_fonts.cpp - MacOS - - - wxshlb Mach-O debug - PathRelative - Project - :html: - :m_hline.cpp - MacOS - - - wxshlb Mach-O debug - PathRelative - Project - :html: - :m_image.cpp - MacOS - - - wxshlb Mach-O debug - PathRelative - Project - :html: - :m_layout.cpp - MacOS - - - wxshlb Mach-O debug - PathRelative - Project - :html: - :m_links.cpp - MacOS - - - wxshlb Mach-O debug - PathRelative - Project - :html: - :m_list.cpp - MacOS - - - wxshlb Mach-O debug - PathRelative - Project - :html: - :m_pre.cpp - MacOS - - - wxshlb Mach-O debug - PathRelative - Project - :html: - :m_tables.cpp - MacOS - - - - wxshlb Mach-O debug - PathRelative - Project - :html: - :winpars.cpp - MacOS - - - unix - - wxshlb Mach-O debug - PathRelative - Project - unix - baseunix.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - unix - dlunix.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - unix - gsocket.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - unix - stdpaths.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - unix - utilsunx.cpp - Unix - - - xml - - wxshlb Mach-O debug - PathRelative - Project - xml - xml.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - expat/lib - xmlparse.c - Unix - - - wxshlb Mach-O debug - PathRelative - Project - expat/lib - xmlrole.c - Unix - - - wxshlb Mach-O debug - PathRelative - Project - expat/lib - xmltok.c - Unix - - - xrc - - wxshlb Mach-O debug - PathRelative - Project - xrc - xh_bmp.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - xrc - xh_bmpbt.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - xrc - xh_bttn.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - xrc - xh_cald.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - xrc - xh_chckb.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - xrc - xh_chckl.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - xrc - xh_choic.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - xrc - xh_choicbk.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - xrc - xh_combo.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - xrc - xh_datectrl.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - xrc - xh_dlg.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - xrc - xh_frame.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - xrc - xh_gauge.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - xrc - xh_gdctl.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - xrc - xh_html.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - xrc - xh_listb.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - xrc - xh_listbk.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - xrc - xh_listc.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - xrc - xh_mdi.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - xrc - xh_menu.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - xrc - xh_notbk.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - xrc - xh_panel.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - xrc - xh_radbt.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - xrc - xh_radbx.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - xrc - xh_scrol.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - xrc - xh_scwin.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - xrc - xh_sizer.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - xrc - xh_slidr.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - xrc - xh_spin.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - xrc - xh_split.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - xrc - xh_statbar.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - xrc - xh_stbmp.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - xrc - xh_stbox.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - xrc - xh_stlin.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - xrc - xh_sttxt.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - xrc - xh_text.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - xrc - xh_tglbtn.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - xrc - xh_toolb.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - xrc - xh_tree.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - xrc - xh_unkwn.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - xrc - xh_wizrd.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - xrc - xmlres.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - xrc - xmlrsall.cpp - Unix - - - mac - corefoundation - - wxshlb Mach-O debug - PathRelative - Project - mac/corefoundation - cfstring.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - mac/corefoundation - gsockosx.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - mac/corefoundation - stdpaths_cf.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - mac/corefoundation - utilsexc_cf.cpp - Unix - - - - wxshlb Mach-O debug - PathRelative - Project - :mac:carbon: - :accel.cpp - MacOS - - - wxshlb Mach-O debug - PathRelative - Project - :mac:carbon: - :app.cpp - MacOS - - - wxshlb Mach-O debug - PathRelative - Project - :mac:carbon: - :bitmap.cpp - MacOS - - - wxshlb Mach-O debug - PathRelative - Project - :mac:carbon: - :bmpbuttn.cpp - MacOS - - - wxshlb Mach-O debug - PathRelative - Project - :mac:carbon: - :brush.cpp - MacOS - - - wxshlb Mach-O debug - PathRelative - Project - :mac:carbon: - :button.cpp - MacOS - - - wxshlb Mach-O debug - PathRelative - Project - :mac:carbon: - :checkbox.cpp - MacOS - - - wxshlb Mach-O debug - PathRelative - Project - :mac:carbon: - :checklst.cpp - MacOS - - - wxshlb Mach-O debug - PathRelative - Project - :mac:carbon: - :choice.cpp - MacOS - - - wxshlb Mach-O debug - PathRelative - Project - :mac:carbon: - :clipbrd.cpp - MacOS - - - wxshlb Mach-O debug - PathRelative - Project - :mac:carbon: - :colordlg.cpp - MacOS - - - wxshlb Mach-O debug - PathRelative - Project - :mac:carbon: - :colour.cpp - MacOS - - - wxshlb Mach-O debug - PathRelative - Project - :mac:carbon: - :combobox.cpp - MacOS - - - wxshlb Mach-O debug - PathRelative - Project - :mac:carbon: - :control.cpp - MacOS - - - wxshlb Mach-O debug - PathRelative - Project - :mac:carbon: - :cursor.cpp - MacOS - - - wxshlb Mach-O debug - PathRelative - Project - :mac:carbon: - :data.cpp - MacOS - - - wxshlb Mach-O debug - PathRelative - Project - :mac:carbon: - :dataobj.cpp - MacOS - - - wxshlb Mach-O debug - PathRelative - Project - :mac:carbon: - :dc.cpp - MacOS - - - wxshlb Mach-O debug - PathRelative - Project - :mac:carbon: - :dcclient.cpp - MacOS - - - wxshlb Mach-O debug - PathRelative - Project - :mac:carbon: - :dcmemory.cpp - MacOS - - - wxshlb Mach-O debug - PathRelative - Project - :mac:carbon: - :dcprint.cpp - MacOS - - - wxshlb Mach-O debug - PathRelative - Project - :mac:carbon: - :dcscreen.cpp - MacOS - - - wxshlb Mach-O debug - PathRelative - Project - :mac:carbon: - :dialog.cpp - MacOS - - - wxshlb Mach-O debug - PathRelative - Project - :mac:carbon: - :dirdlg.cpp - MacOS - - - wxshlb Mach-O debug - PathRelative - Project - :mac:carbon: - :dirmac.cpp - MacOS - - - wxshlb Mach-O debug - PathRelative - Project - :mac:carbon: - display.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :mac:carbon: - :dnd.cpp - MacOS - - - wxshlb Mach-O debug - PathRelative - Project - :mac:carbon: - drawer.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :mac:carbon: - :filedlg.cpp - MacOS - - - wxshlb Mach-O debug - PathRelative - Project - :mac:carbon: - :font.cpp - MacOS - - - wxshlb Mach-O debug - PathRelative - Project - :mac:carbon: - :fontdlg.cpp - MacOS - - - wxshlb Mach-O debug - PathRelative - Project - :mac:carbon: - :fontenum.cpp - MacOS - - - wxshlb Mach-O debug - PathRelative - Project - :mac:carbon: - :fontutil.cpp - MacOS - - - wxshlb Mach-O debug - PathRelative - Project - :mac:carbon: - :frame.cpp - MacOS - - - wxshlb Mach-O debug - PathRelative - Project - :mac:carbon: - :gauge.cpp - MacOS - - - wxshlb Mach-O debug - PathRelative - Project - :mac:carbon: - :gdiobj.cpp - MacOS - - - wxshlb Mach-O debug - PathRelative - Project - :mac:carbon: - :glcanvas.cpp - MacOS - - - wxlib Carbon debug - PathRelative - Project - :mac:carbon: - gsocket.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :mac:carbon: - :icon.cpp - MacOS - - - wxshlb Mach-O debug - PathRelative - Project - :mac:carbon: - imaglist.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :mac:carbon: - :joystick.cpp - MacOS - - - wxshlb Mach-O debug - PathRelative - Project - :mac:carbon: - :listbox.cpp - MacOS - - - wxshlb Mach-O debug - PathRelative - Project - :mac:carbon: - :macnotfy.cpp - MacOS - - - wxshlb Mach-O debug - PathRelative - Project - :mac:carbon: - :main.cpp - MacOS - - - wxshlb Mach-O debug - PathRelative - Project - :mac:carbon: - :mdi.cpp - MacOS - - - wxshlb Mach-O debug - PathRelative - Project - :mac:carbon: - :menu.cpp - MacOS - - - wxshlb Mach-O debug - PathRelative - Project - :mac:carbon: - :menuitem.cpp - MacOS - - - wxshlb Mach-O debug - Name - metafile.cpp - MacOS - - - wxshlb Mach-O debug - PathRelative - Project - :mac:carbon: - :mimetmac.cpp - MacOS - - - wxshlb Mach-O debug - PathRelative - Project - :mac:carbon: - :minifram.cpp - MacOS - - morefilex - - wxshlb Mach-O debug - PathRelative - Project - :mac:carbon: - morefilex/MoreFilesX.cpp - Unix - - - - wxshlb Mach-O debug - PathRelative - Project - :mac:carbon: - :msgdlg.cpp - MacOS - - - wxshlb Mach-O debug - PathRelative - Project - :mac:carbon: - :notebmac.cpp - MacOS - - - wxshlb Mach-O debug - PathRelative - Project - :mac:carbon: - :palette.cpp - MacOS - - - wxshlb Mach-O debug - PathRelative - Project - :mac:carbon: - :pen.cpp - MacOS - - - wxshlb Mach-O debug - PathRelative - Project - :mac:carbon: - :printdlg.cpp - MacOS - - - wxshlb Mach-O debug - PathRelative - Project - :mac:carbon: - :printmac.cpp - MacOS - - - wxshlb Mach-O debug - PathRelative - Project - :mac:carbon: - :radiobox.cpp - MacOS - - - wxshlb Mach-O debug - PathRelative - Project - :mac:carbon: - :radiobut.cpp - MacOS - - - wxshlb Mach-O debug - PathRelative - Project - :mac:carbon: - :region.cpp - MacOS - - - wxshlb Mach-O debug - PathRelative - Project - :mac:carbon: - renderer.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :mac:carbon: - :scrolbar.cpp - MacOS - - - wxshlb Mach-O debug - PathRelative - Project - :mac:carbon: - :settings.cpp - MacOS - - - wxshlb Mach-O debug - PathRelative - Project - :mac:carbon: - :slider.cpp - MacOS - - - wxshlb Mach-O debug - PathRelative - Project - :mac:carbon: - :spinbutt.cpp - MacOS - - - wxshlb Mach-O debug - PathRelative - Project - :mac:carbon: - :spinctrl.cpp - MacOS - - - wxshlb Mach-O debug - PathRelative - Project - :mac:carbon: - :statbmp.cpp - MacOS - - - wxshlb Mach-O debug - PathRelative - Project - :mac:carbon: - :statbox.cpp - MacOS - - - wxshlb Mach-O debug - PathRelative - Project - :mac:carbon: - :statbrma.cpp - MacOS - - - wxshlb Mach-O debug - PathRelative - Project - :mac:carbon: - :statlmac.cpp - MacOS - - - wxshlb Mach-O debug - PathRelative - Project - :mac:carbon: - :stattext.cpp - MacOS - - - wxshlb Mach-O debug - PathRelative - Project - :mac:carbon: - :tabctrl.cpp - MacOS - - - wxshlb Mach-O debug - PathRelative - Project - :mac:carbon: - taskbar.cpp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :mac:carbon: - :textctrl.cpp - MacOS - - - wxshlb Mach-O debug - PathRelative - Project - :mac:carbon: - :thread.cpp - MacOS - - - wxshlb Mach-O debug - PathRelative - Project - :mac:carbon: - :timer.cpp - MacOS - - - wxshlb Mach-O debug - PathRelative - Project - :mac:carbon: - :toolbar.cpp - MacOS - - - wxshlb Mach-O debug - PathRelative - Project - :mac:carbon: - :tooltip.cpp - MacOS - - - wxshlb Mach-O debug - PathRelative - Project - :mac:carbon: - :toplevel.cpp - MacOS - - - wxshlb Mach-O debug - PathRelative - Project - :mac:carbon: - :uma.cpp - MacOS - - - wxshlb Mach-O debug - PathRelative - Project - :mac:carbon: - :utils.cpp - MacOS - - - wxlib Carbon debug - PathRelative - Project - :mac:carbon: - :utilsexc.cpp - MacOS - - - wxshlb Mach-O debug - PathRelative - Project - :mac:carbon: - :sound.cpp - MacOS - - - wxshlb Mach-O debug - PathRelative - Project - :mac:carbon: - :window.cpp - MacOS - - - mac resources - - wxlib Carbon resources - Name - apprsrc.r - MacOS - - - wxlib Carbon resources - Name - carbrsrc.r - MacOS - - - wxlib Carbon resources - Name - corersrc.r - MacOS - - - wx-addon libraries - - wxshlb Mach-O debug - PathRelative - Project - :jpeg: - jpegM8.mcp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :png: - pngM8.mcp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :tiff: - tiffM8.mcp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :zlib: - zlibM8.mcp - Unix - - - wxshlb Mach-O debug - PathRelative - Project - :regex: - regexM8.mcp - Unix - - - mac libraries - carbon - - wxlib Carbon debug - PathRelative - CodeWarrior - :MacOS Support: - Universal/Libraries/StubLibraries/CarbonFrameworkLib - Unix - - - wxlib Carbon debug - PathRelative - CodeWarrior - :MacOS Support: - Universal/Libraries/StubLibraries/CarbonLib - Unix - - - wxlib Carbon debug - PathRelative - CodeWarrior - :MacOS Support: - MetroNub Utilities/MNU Carbon.Lib - Unix - - - - libraries - - wxshlb Mach-O debug - PathRelative - CodeWarrior - MacOS X Support - Libraries/Startup/dylib1.o - Unix - - - wxshlb Carbon release - PathRelative - CodeWarrior - :MSL: - MSL_C/MSL_MacOS/Src/console.stubs.c - Unix - - - wxshlb Mach-O debug - PathRelative - CodeWarrior - MSL/MSL_C - MSL_MacOS/Src/console_OS_X.c - Unix - - - wxshlb Carbon debug - PathRelative - CodeWarrior - :MacOS Support: - Libraries/Runtime/Libs/MSL_ShLibRuntime_PPC_D.Lib - Unix - - - wxshlb Carbon release - PathRelative - CodeWarrior - :MacOS Support: - :Libraries:Runtime:Libs:MSL_ShLibRuntime_PPC.Lib - MacOS - - - wxshlb Carbon release - PathRelative - CodeWarrior - :MacOS Support: - Libraries/Runtime/Libs/MSL_All_Carbon.Shlb - Unix - - - wxshlb Carbon debug - PathRelative - CodeWarrior - :MacOS Support: - Libraries/Runtime/Libs/MSL_All_Carbon_D.Shlb - Unix - - - wxshlb Mach-O release - PathRelative - CodeWarrior - MacOS X Support - Libraries/Runtime/Libs/MSL_Runtime_Mach-O.a - Unix - - - wxshlb Mach-O debug - PathRelative - CodeWarrior - MacOS X Support - Libraries/Runtime/Libs/MSL_Runtime_Mach-O_D.a - Unix - - - - wxlib Carbon debug - FileRelative - ../../lib/jpeg_PPC.lib - Unix - - PathRelative - Project - :jpeg: - jpegM8.mcp - Unix - - - - wxlib Carbon debug - FileRelative - ../../lib/png_PPC.lib - Unix - - PathRelative - Project - :png: - pngM8.mcp - Unix - - - - wxlib Carbon debug - FileRelative - ../../lib/zlib_PPC.lib - Unix - - PathRelative - Project - :zlib: - zlibM8.mcp - Unix - - - - wxlib Carbon debug - FileRelative - ../../lib/tif_PPC.lib - Unix - - PathRelative - Project - :tiff: - tiffM8.mcp - Unix - - - - wxlib Carbon debug - FileRelative - ../../lib/regex_PPC.lib - Unix - - PathRelative - Project - :regex: - regexM8.mcp - Unix - - - - wxshlb Mach-O debug - FileRelative - ../../lib/jpeg_MACH.lib - Unix - - PathRelative - Project - :jpeg: - jpegM8.mcp - Unix - - - - wxshlb Mach-O debug - FileRelative - ../../lib/png_MACH.lib - Unix - - PathRelative - Project - :png: - pngM8.mcp - Unix - - - - wxshlb Mach-O debug - FileRelative - ../../lib/zlib_MACH.lib - Unix - - PathRelative - Project - :zlib: - zlibM8.mcp - Unix - - - - wxshlb Mach-O debug - FileRelative - ../../lib/tif_MACH.lib - Unix - - PathRelative - Project - :tiff: - tiffM8.mcp - Unix - - - - wxshlb Mach-O debug - FileRelative - ../../lib/regex_MACH.lib - Unix - - PathRelative - Project - :regex: - regexM8.mcp - Unix - - - - - diff --git a/wxWidgets/src/wxWindowsW7.xml b/wxWidgets/src/wxWindowsW7.xml deleted file mode 100644 index 32e46d784d..0000000000 --- a/wxWidgets/src/wxWindowsW7.xml +++ /dev/null @@ -1,20334 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -]> - - - - - wxlib Win32 debug - - - - UserSourceTrees - - - AlwaysSearchUserPathstrue - InterpretDOSAndUnixPathsfalse - RequireFrameworkStyleIncludesfalse - UserSearchPaths - - SearchPath - Path..\lib\cw7mswd\include - PathFormatWindows - PathRootProject - - Recursivefalse - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path..\include - PathFormatWindows - PathRootProject - - Recursivefalse - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Pathgeneric - PathFormatWindows - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Pathmsw - PathFormatWindows - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Pathcommon - PathFormatWindows - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Pathzlib - PathFormatWindows - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Pathpng - PathFormatWindows - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Pathjpeg - PathFormatWindows - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Pathtiff - PathFormatWindows - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Pathhtml - PathFormatWindows - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Pathregex - PathFormatWindows - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SystemSearchPaths - - SearchPath - PathMSL - PathFormatWindows - PathRootCodeWarrior - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - PathWin32-x86 Support - PathFormatWindows - PathRootCodeWarrior - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - - - MWRuntimeSettings_WorkingDirectory - MWRuntimeSettings_CommandLine - MWRuntimeSettings_HostApplication - Path - PathFormatGeneric - PathRootAbsolute - - MWRuntimeSettings_EnvVars - - - LinkerWin32 x86 Linker - PreLinker - PostLinker - Targetnamewxlib Win32 debug - OutputDirectory - Path..\lib - PathFormatWindows - PathRootProject - - SaveEntriesUsingRelativePathstrue - - - FileMappings - - FileTypeTEXT - FileExtension.c - CompilerMW C/C++ x86 - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.c++ - CompilerMW C/C++ x86 - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.cc - CompilerMW C/C++ x86 - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.cp - CompilerMW C/C++ x86 - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.cpp - CompilerMW C/C++ x86 - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.def - Compiler - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.h - CompilerMW C/C++ x86 - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMaketrue - - - FileTypeTEXT - FileExtension.h++ - CompilerMW C/C++ x86 - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMaketrue - - - FileTypeTEXT - FileExtension.hpp - CompilerMW C/C++ x86 - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMaketrue - - - FileTypeTEXT - FileExtension.ord - Compiler - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.pch - CompilerMW C/C++ x86 - EditLanguageC/C++ - Precompiletrue - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.pch++ - CompilerMW C/C++ x86 - EditLanguageC/C++ - Precompiletrue - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.pl - CompilerMW Perl - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.rc - CompilerMW WinRC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeiLIB - FileExtension - CompilerLib Import x86 - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeiOBJ - FileExtension - CompilerObj Import x86 - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileExtension.a - CompilerLib Import x86 - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileExtension.doc - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFilefalse - IgnoredByMaketrue - - - FileExtension.lib - CompilerLib Import x86 - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileExtension.o - CompilerObj Import x86 - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileExtension.obj - CompilerObj Import x86 - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileExtension.res - CompilerWinRes Import - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - - - CacheModDatestrue - ActivateBrowsertrue - DumpBrowserInfofalse - CacheSubprojectstrue - UseThirdPartyDebuggerfalse - DebuggerAppPath - Path - PathFormatGeneric - PathRootAbsolute - - DebuggerCmdLineArgs - DebuggerWorkingDir - Path - PathFormatGeneric - PathRootAbsolute - - - - LogSystemMessagestrue - AutoTargetDLLstrue - StopAtWatchpointstrue - PauseWhileRunningfalse - PauseInterval5 - PauseUIFlags0 - AltExePath - Path - PathFormatGeneric - PathRootAbsolute - - StopAtTempBPOnLaunchtrue - CacheSymbolicstrue - TempBPFunctionNamemain - TempBPType0 - - - Enabledfalse - ConnectionName - DownloadPath - LaunchRemoteAppfalse - RemoteAppPath - - - OtherExecutables - - - CustomColor1 - Red0 - Green32767 - Blue0 - - CustomColor2 - Red0 - Green32767 - Blue0 - - CustomColor3 - Red0 - Green32767 - Blue0 - - CustomColor4 - Red0 - Green32767 - Blue0 - - - - Perl_Prefix_Filename - - - MWCodeGen_PPC_structalignmentMC68K - MWCodeGen_PPC_tracebacktablesNone - MWCodeGen_PPC_processorGeneric - MWCodeGen_PPC_readonlystrings0 - MWCodeGen_PPC_tocdata1 - MWCodeGen_PPC_profiler0 - MWCodeGen_PPC_fpcontract1 - MWCodeGen_PPC_schedule0 - MWCodeGen_PPC_peephole1 - MWCodeGen_PPC_processorspecific0 - MWCodeGen_PPC_altivec0 - MWCodeGen_PPC_vectortocdata1 - MWCodeGen_PPC_vrsave1 - - - MWCodeGen_X86_processorPentiumII - MWCodeGen_X86_alignmentbytes8 - MWCodeGen_X86_exceptionsZeroOverhead - MWCodeGen_X86_extinst_mmx0 - MWCodeGen_X86_extinst_3dnow0 - MWCodeGen_X86_use_mmx_3dnow_convention0 - MWCodeGen_X86_machinecodelisting0 - MWCodeGen_X86_intrinsics0 - MWCodeGen_X86_syminfo0 - MWCodeGen_X86_codeviewinfo1 - MWCodeGen_X86_extinst_cmov_fcomi0 - MWCodeGen_X86_extinst_sse0 - - - MWDebugger_X86_Exceptions - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - - - - PDisasmX86_showHeaderstrue - PDisasmX86_showSymTabtrue - PDisasmX86_showCodetrue - PDisasmX86_showSourcefalse - PDisasmX86_showHextrue - PDisasmX86_showRelocationtrue - PDisasmX86_showCommentsfalse - PDisasmX86_showDebugfalse - PDisasmX86_showExceptionsfalse - PDisasmX86_showDatatrue - PDisasmX86_showRawfalse - PDisasmX86_verbosetrue - - - MWDisassembler_PPC_showcode1 - MWDisassembler_PPC_extended1 - MWDisassembler_PPC_mix0 - MWDisassembler_PPC_nohex0 - MWDisassembler_PPC_showdata1 - MWDisassembler_PPC_showexceptions1 - MWDisassembler_PPC_showsym0 - MWDisassembler_PPC_shownames1 - - - MWFrontEnd_C_cplusplus0 - MWFrontEnd_C_checkprotos0 - MWFrontEnd_C_arm0 - MWFrontEnd_C_trigraphs0 - MWFrontEnd_C_onlystdkeywords0 - MWFrontEnd_C_enumsalwaysint0 - MWFrontEnd_C_mpwpointerstyle1 - MWFrontEnd_C_prefixname/wx/wx_cw_d.h - MWFrontEnd_C_ansistrict0 - MWFrontEnd_C_mpwcnewline0 - MWFrontEnd_C_wchar_type1 - MWFrontEnd_C_enableexceptions1 - MWFrontEnd_C_dontreusestrings0 - MWFrontEnd_C_poolstrings0 - MWFrontEnd_C_dontinline0 - MWFrontEnd_C_useRTTI1 - MWFrontEnd_C_multibyteaware0 - MWFrontEnd_C_unsignedchars0 - MWFrontEnd_C_autoinline0 - MWFrontEnd_C_booltruefalse1 - MWFrontEnd_C_direct_to_som0 - MWFrontEnd_C_som_env_check0 - MWFrontEnd_C_alwaysinline0 - MWFrontEnd_C_inlinelevel8 - MWFrontEnd_C_ecplusplus0 - MWFrontEnd_C_objective_c0 - MWFrontEnd_C_defer_codegen0 - - - MWFTP_Post_hostName - MWFTP_Post_username - MWFTP_Post_password0 - MWFTP_Post_remoteDir - MWFTP_Post_ftp_PathVersion0 - MWFTP_Post_ftp_PathType0 - MWFTP_Post_ftp_PathFormat0 - MWFTP_Post_ftp_tree - MWFTP_Post_uploadDir - MWFTP_Post_ftp_port21 - MWFTP_Post_SendBin1 - MWFTP_Post_ShouldLog1 - - - MWCommandLine_Java_clsName - MWCommandLine_Java_args - - - MWVJavaDebugging_Protocol1 - MWVJavaDebugging_JDKVersion1 - MWVJavaDebugging_TimeOut25 - MWVJavaDebugging_SupportSlowDevicesfalse - - - MWJavaDoc_Proj_Version1 - MWJavaDoc_Proj_Depricated1 - MWJavaDoc_Proj_Author1 - MWJavaDoc_Proj_Index1 - MWJavaDoc_Proj_Tree1 - MWJavaDoc_Proj_SunResolveToSame0 - MWJavaDoc_Proj_Shortnames0 - MWJavaDoc_Proj_Folder0 - MWJavaDoc_Proj_GenerateAPILinks0 - MWJavaDoc_Proj_scopePublic - MWJavaDoc_Proj_encodingName - MWJavaDoc_Proj_decodingName - MWJavaDoc_Proj_javaPackagePathhttp://java.sun.com/products/jdk/1.1/docs/api/ - - - MWJava_Language_optimizefalse - MWJava_Language_warnDeprecatedfalse - MWJava_Language_emitMapfalse - MWJava_Language_strictFileNamesfalse - MWJava_Language_strictFileHierarchyfalse - MWJava_Language_1_1_Compatiblefalse - MWJava_Language_emitHeaders0 - MWJava_Language_headerTypeJNINativeHeaders - MWJava_Language_packageFilter - MWJava_Language_genCommentstrue - MWJava_Language_genHeadersfalse - - - MWJava_Output_outputtypeJarFile - MWJava_Output_outfileJavaClasses.jar - MWJava_Output_ftype1514754080 - MWJava_Output_fcreator1297570384 - MWJava_Output_compress0 - MWJava_Output_genManifest0 - MWJava_Output_trunctypeFront - MWJava_Output_deleteClasses0 - MWJava_Output_consoleApp1 - - - MWJava_Proj_projtypeApplet - MWJava_Proj_mainClassName - MWJava_Proj_HTMLAppCreator1463898714 - MWJava_Proj_HTMLAppName - MWJava_Proj_PathVersion0 - MWJava_Proj_PathType0 - MWJava_Proj_PathFormat0 - MWJava_Proj_tree - MWJava_Proj_HTMLAppWin32Name - MWJava_Proj_compress0 - MWJava_Proj_useVM1 - MWJava_Proj_vmarguments - MWJava_Proj_vmName - MWJava_Proj_simPropFile - MWJava_Proj_useJCVM1 - MWJava_Proj_aidData - - - MWLinker_PPC_linksym1 - MWLinker_PPC_symfullpath1 - MWLinker_PPC_linkmap0 - MWLinker_PPC_nolinkwarnings0 - MWLinker_PPC_dontdeadstripinitcode0 - MWLinker_PPC_permitmultdefs0 - MWLinker_PPC_linkmodeFast - MWLinker_PPC_initname - MWLinker_PPC_mainname__start - MWLinker_PPC_termname - - - MWLinker_X86_entrypointusageDefault - MWLinker_X86_entrypoint - MWLinker_X86_subsystemWinGUI - MWLinker_X86_subsysmajorid4 - MWLinker_X86_subsysminorid0 - MWLinker_X86_usrmajorid0 - MWLinker_X86_usrminorid0 - MWLinker_X86_commandfile - MWLinker_X86_generatemap0 - MWLinker_X86_linksym0 - MWLinker_X86_linkCV1 - - - MWMerge_MacOS_projectTypeApplication - MWMerge_MacOS_outputNameMerge Out - MWMerge_MacOS_outputCreator???? - MWMerge_MacOS_outputTypeAPPL - MWMerge_MacOS_suppressWarning0 - MWMerge_MacOS_copyFragments1 - MWMerge_MacOS_copyResources1 - MWMerge_MacOS_flattenResource0 - MWMerge_MacOS_flatFileNamea.rsrc - MWMerge_MacOS_flatFileOutputPath - Path: - PathFormatMacOS - PathRootProject - - MWMerge_MacOS_skipResources - DGLX - ckid - Proj - WSPC - mcvs - - - - MWMacOSPackager_UsePackager0 - MWMacOSPackager_FolderToPackage - Path: - PathFormatMacOS - PathRootProject - - MWMacOSPackager_CreateClassicAlias0 - MWMacOSPackager_ClassicAliasMethodUseTargetOutput - MWMacOSPackager_ClassicAliasPath - Path: - PathFormatMacOS - PathRootProject - - MWMacOSPackager_CreatePkgInfo0 - MWMacOSPackager_PkgCreatorType???? - MWMacOSPackager_PkgFileTypeLPPA - - - MWPEF_exportsNone - MWPEF_libfolder0 - MWPEF_sortcodeNone - MWPEF_expandbss0 - MWPEF_sharedata0 - MWPEF_olddefversion0 - MWPEF_oldimpversion0 - MWPEF_currentversion0 - MWPEF_fragmentname - MWPEF_collapsereloads0 - - - MWAssembler_PPC_auxheader0 - MWAssembler_PPC_symmodeMac - MWAssembler_PPC_dialectPPC - MWAssembler_PPC_prefixfile - MWAssembler_PPC_typecheck0 - MWAssembler_PPC_warnings0 - MWAssembler_PPC_casesensitive0 - - - GlobalOptimizer_PPC_optimizationlevelLevel0 - GlobalOptimizer_PPC_optforSpeed - - - MWProject_PPC_typeApplication - MWProject_PPC_outfilea.out - MWProject_PPC_filecreator???? - MWProject_PPC_filetypeAPPL - MWProject_PPC_size384 - MWProject_PPC_minsize384 - MWProject_PPC_stacksize64 - MWProject_PPC_flags22720 - MWProject_PPC_symfilename - MWProject_PPC_rsrcname - MWProject_PPC_rsrcheaderNative - MWProject_PPC_rsrctype???? - MWProject_PPC_rsrcid0 - MWProject_PPC_rsrcflags0 - MWProject_PPC_rsrcstore0 - MWProject_PPC_rsrcmerge0 - MWProject_PPC_flatrsrc0 - MWProject_PPC_flatrsrcoutputdir - Path: - PathFormatMacOS - PathRootProject - - MWProject_PPC_flatrsrcfilename - - - MWProject_X86_typeLibrary - MWProject_X86_outfilewx_x86_d.lib - MWProject_X86_baseaddress4194304 - MWProject_X86_maxstacksize1024 - MWProject_X86_minstacksize4 - MWProject_X86_size1024 - MWProject_X86_minsize4 - MWProject_X86_importlib - Resource Flattener Panel - 0100000000000000000000000000000000000000000000000000000000000000 - 0000074F75742E62696E00000000000000000000000000000000000000000000 - 0000 - - - - MWRez_Language_maxwidth80 - MWRez_Language_scriptRoman - MWRez_Language_alignmentAlign1 - MWRez_Language_filtermodeFilterSkip - MWRez_Language_suppresswarnings0 - MWRez_Language_escapecontrolchars1 - MWRez_Language_prefixname - MWRez_Language_filteredtypes'CODE' 'DATA' 'PICT' - - - MWWarning_C_warn_illpragma1 - MWWarning_C_warn_emptydecl0 - MWWarning_C_warn_possunwant0 - MWWarning_C_warn_unusedvar0 - MWWarning_C_warn_unusedarg0 - MWWarning_C_warn_extracomma0 - MWWarning_C_pedantic1 - MWWarning_C_warningerrors0 - MWWarning_C_warn_hidevirtual1 - MWWarning_C_warn_implicitconv0 - MWWarning_C_warn_notinlined0 - MWWarning_C_warn_structclass0 - - - MWWinRC_prefixname - - - GlobalOptimizer_X86__optimizationlevelLevel0 - GlobalOptimizer_X86__optforSpeed - - - - PathRelative - Project - common - ftp.cpp - Windows - Text - Debug - - - PathRelative - Project - common - artprov.cpp - Windows - Text - Debug - - - PathRelative - Project - common - artstd.cpp - Windows - Text - Debug - - - PathRelative - Project - common - choiccmn.cpp - Windows - Text - Debug - - - PathRelative - Project - common - clipcmn.cpp - Windows - Text - Debug - - - PathRelative - Project - common - clntdata.cpp - Windows - Text - Debug - - - PathRelative - Project - common - cmdline.cpp - Windows - Text - Debug - - - PathRelative - Project - common - cmdproc.cpp - Windows - Text - Debug - - - PathRelative - Project - common - cmndata.cpp - Windows - Text - Debug - - - PathRelative - Project - common - config.cpp - Windows - Text - Debug - - - PathRelative - Project - common - containr.cpp - Windows - Text - Debug - - - PathRelative - Project - common - cshelp.cpp - Windows - Text - Debug - - - PathRelative - Project - common - ctrlcmn.cpp - Windows - Text - Debug - - - PathRelative - Project - common - ctrlsub.cpp - Windows - Text - Debug - - - PathRelative - Project - common - datetime.cpp - Windows - Text - Debug - - - PathRelative - Project - common - datstrm.cpp - Windows - Text - Debug - - - PathRelative - Project - common - db.cpp - Windows - Text - Debug - - - PathRelative - Project - common - dbgrid.cpp - Windows - Text - Debug - - - PathRelative - Project - common - dbtable.cpp - Windows - Text - Debug - - - PathRelative - Project - common - dcbase.cpp - Windows - Text - Debug - - - PathRelative - Project - common - dircmn.cpp - Windows - Text - Debug - - - PathRelative - Project - common - dlgcmn.cpp - Windows - Text - Debug - - - PathRelative - Project - common - dndcmn.cpp - Windows - Text - Debug - - - PathRelative - Project - common - dobjcmn.cpp - Windows - Text - Debug - - - PathRelative - Project - common - docmdi.cpp - Windows - Text - Debug - - - PathRelative - Project - common - docview.cpp - Windows - Text - Debug - - - PathRelative - Project - common - dseldlg.cpp - Windows - Text - Debug - - - PathRelative - Project - common - dynarray.cpp - Windows - Text - Debug - - - PathRelative - Project - common - dynlib.cpp - Windows - Text - Debug - - - PathRelative - Project - common - dynload.cpp - Windows - Text - Debug - - - PathRelative - Project - common - effects.cpp - Windows - Text - Debug - - - PathRelative - Project - common - encconv.cpp - Windows - Text - Debug - - - PathRelative - Project - common - event.cpp - Windows - Text - Debug - - - PathRelative - Project - common - extended.c - Windows - Text - Debug - - - PathRelative - Project - common - fddlgcmn.cpp - Windows - Text - Debug - - - PathRelative - Project - common - ffile.cpp - Windows - Text - Debug - - - PathRelative - Project - common - file.cpp - Windows - Text - Debug - - - PathRelative - Project - common - fileconf.cpp - Windows - Text - Debug - - - PathRelative - Project - common - filefn.cpp - Windows - Text - Debug - - - PathRelative - Project - common - filename.cpp - Windows - Text - Debug - - - PathRelative - Project - common - filesys.cpp - Windows - Text - Debug - - - PathRelative - Project - common - fontcmn.cpp - Windows - Text - Debug - - - PathRelative - Project - common - fontmap.cpp - Windows - Text - Debug - - - PathRelative - Project - common - framecmn.cpp - Windows - Text - Debug - - - PathRelative - Project - common - fs_inet.cpp - Windows - Text - Debug - - - PathRelative - Project - common - fs_mem.cpp - Windows - Text - Debug - - - PathRelative - Project - common - fs_zip.cpp - Windows - Text - Debug - - - PathRelative - Project - common - appcmn.cpp - Windows - Text - Debug - - - PathRelative - Project - common - gaugecmn.cpp - Windows - Text - Debug - - - PathRelative - Project - common - gdicmn.cpp - Windows - Text - Debug - - - PathRelative - Project - common - geometry.cpp - Windows - Text - Debug - - - PathRelative - Project - common - gifdecod.cpp - Windows - Text - Debug - - - PathRelative - Project - common - hash.cpp - Windows - Text - Debug - - - PathRelative - Project - common - hashmap.cpp - Windows - Text - Debug - - - PathRelative - Project - common - helpbase.cpp - Windows - Text - Debug - - - PathRelative - Project - common - http.cpp - Windows - Text - Debug - - - PathRelative - Project - common - iconbndl.cpp - Windows - Text - Debug - - - PathRelative - Project - common - imagall.cpp - Windows - Text - Debug - - - PathRelative - Project - common - imagbmp.cpp - Windows - Text - Debug - - - PathRelative - Project - common - image.cpp - Windows - Text - Debug - - - PathRelative - Project - common - imagfill.cpp - Windows - Text - Debug - - - PathRelative - Project - common - imaggif.cpp - Windows - Text - Debug - - - PathRelative - Project - common - imagiff.cpp - Windows - Text - Debug - - - PathRelative - Project - common - imagjpeg.cpp - Windows - Text - Debug - - - PathRelative - Project - common - imagpcx.cpp - Windows - Text - Debug - - - PathRelative - Project - common - imagpng.cpp - Windows - Text - Debug - - - PathRelative - Project - common - imagpnm.cpp - Windows - Text - Debug - - - PathRelative - Project - common - imagtiff.cpp - Windows - Text - Debug - - - PathRelative - Project - common - imagxpm.cpp - Windows - Text - Debug - - - PathRelative - Project - common - intl.cpp - Windows - Text - Debug - - - PathRelative - Project - common - ipcbase.cpp - Windows - Text - Debug - - - PathRelative - Project - common - layout.cpp - Windows - Text - Debug - - - PathRelative - Project - common - lboxcmn.cpp - Windows - Text - Debug - - - PathRelative - Project - common - list.cpp - Windows - Text - Debug - - - PathRelative - Project - common - log.cpp - Windows - Text - Debug - - - PathRelative - Project - common - longlong.cpp - Windows - Text - Debug - - - PathRelative - Project - common - matrix.cpp - Windows - Text - Debug - - - PathRelative - Project - common - memory.cpp - Windows - Text - Debug - - - PathRelative - Project - common - menucmn.cpp - Windows - Text - Debug - - - PathRelative - Project - common - mimecmn.cpp - Windows - Text - Debug - - - PathRelative - Project - common - module.cpp - Windows - Text - Debug - - - PathRelative - Project - common - mstream.cpp - Windows - Text - Debug - - - PathRelative - Project - common - nbkbase.cpp - Windows - Text - Debug - - - PathRelative - Project - common - object.cpp - Windows - Text - Debug - - - PathRelative - Project - common - odbc.cpp - Windows - Text - Debug - - - PathRelative - Project - common - paper.cpp - Windows - Text - Debug - - - PathRelative - Project - common - popupcmn.cpp - Windows - Text - Debug - - - PathRelative - Project - common - prntbase.cpp - Windows - Text - Debug - - - PathRelative - Project - common - process.cpp - Windows - Text - Debug - - - PathRelative - Project - common - protocol.cpp - Windows - Text - Debug - - - PathRelative - Project - common - quantize.cpp - Windows - Text - Debug - - - PathRelative - Project - common - radiocmn.cpp - Windows - Text - Debug - - - PathRelative - Project - common - regex.cpp - Windows - Text - Debug - - - PathRelative - Project - common - resource.cpp - Windows - Text - Debug - - - PathRelative - Project - common - sckaddr.cpp - Windows - Text - Debug - - - PathRelative - Project - common - sckfile.cpp - Windows - Text - Debug - - - PathRelative - Project - common - sckipc.cpp - Windows - Text - Debug - - - PathRelative - Project - common - sckstrm.cpp - Windows - Text - Debug - - - PathRelative - Project - common - sizer.cpp - Windows - Text - Debug - - - PathRelative - Project - common - socket.cpp - Windows - Text - Debug - - - PathRelative - Project - common - statbar.cpp - Windows - Text - Debug - - - PathRelative - Project - common - strconv.cpp - Windows - Text - Debug - - - PathRelative - Project - common - stream.cpp - Windows - Text - Debug - - - PathRelative - Project - common - string.cpp - Windows - Text - Debug - - - PathRelative - Project - common - sysopt.cpp - Windows - Text - Debug - - - PathRelative - Project - common - tbarbase.cpp - Windows - Text - Debug - - - PathRelative - Project - common - textbuf.cpp - Windows - Text - Debug - - - PathRelative - Project - common - textcmn.cpp - Windows - Text - Debug - - - PathRelative - Project - common - textfile.cpp - Windows - Text - Debug - - - PathRelative - Project - common - timercmn.cpp - Windows - Text - Debug - - - PathRelative - Project - common - tokenzr.cpp - Windows - Text - Debug - - - PathRelative - Project - common - toplvcmn.cpp - Windows - Text - Debug - - - PathRelative - Project - common - treebase.cpp - Windows - Text - Debug - - - PathRelative - Project - common - txtstrm.cpp - Windows - Text - Debug - - - PathRelative - Project - common - unzip.c - Windows - Text - Debug - - - PathRelative - Project - common - url.cpp - Windows - Text - Debug - - - PathRelative - Project - common - utilscmn.cpp - Windows - Text - Debug - - - PathRelative - Project - common - valgen.cpp - Windows - Text - Debug - - - PathRelative - Project - common - validate.cpp - Windows - Text - Debug - - - PathRelative - Project - common - valtext.cpp - Windows - Text - Debug - - - PathRelative - Project - common - variant.cpp - Windows - Text - Debug - - - PathRelative - Project - common - wfstream.cpp - Windows - Text - Debug - - - PathRelative - Project - common - wincmn.cpp - Windows - Text - Debug - - - PathRelative - Project - common - wxchar.cpp - Windows - Text - Debug - - - PathRelative - Project - common - wxexpr.cpp - Windows - Text - Debug - - - PathRelative - Project - common - xpmdecod.cpp - Windows - Text - Debug - - - PathRelative - Project - common - zipstrm.cpp - Windows - Text - Debug - - - PathRelative - Project - common - zstream.cpp - Windows - Text - Debug - - - PathRelative - Project - generic - busyinfo.cpp - Windows - Text - Debug - - - PathRelative - Project - generic - calctrl.cpp - Windows - Text - Debug - - - PathRelative - Project - generic - choicdgg.cpp - Windows - Text - Debug - - - PathRelative - Project - generic - dcbuffer.cpp - Windows - Text - Debug - - - PathRelative - Project - generic - dcpsg.cpp - Windows - Text - Debug - - - PathRelative - Project - generic - dirctrlg.cpp - Windows - Text - Debug - - - PathRelative - Project - generic - dragimgg.cpp - Windows - Text - Debug - - - PathRelative - Project - generic - grid.cpp - Windows - Text - Debug - - - PathRelative - Project - generic - gridctrl.cpp - Windows - Text - Debug - - - PathRelative - Project - generic - gridsel.cpp - Windows - Text - Debug - - - PathRelative - Project - generic - laywin.cpp - Windows - Text - Debug - - - PathRelative - Project - generic - logg.cpp - Windows - Text - Debug - - - PathRelative - Project - generic - numdlgg.cpp - Windows - Text - Debug - - - PathRelative - Project - generic - panelg.cpp - Windows - Text - Debug - - - PathRelative - Project - generic - prntdlgg.cpp - Windows - Text - Debug - - - PathRelative - Project - generic - progdlgg.cpp - Windows - Text - Debug - - - PathRelative - Project - generic - prop.cpp - Windows - Text - Debug - - - PathRelative - Project - generic - propform.cpp - Windows - Text - Debug - - - PathRelative - Project - generic - proplist.cpp - Windows - Text - Debug - - - PathRelative - Project - generic - sashwin.cpp - Windows - Text - Debug - - - PathRelative - Project - generic - scrlwing.cpp - Windows - Text - Debug - - - PathRelative - Project - generic - spinctlg.cpp - Windows - Text - Debug - - - PathRelative - Project - generic - splash.cpp - Windows - Text - Debug - - - PathRelative - Project - generic - splitter.cpp - Windows - Text - Debug - - - PathRelative - Project - generic - statusbr.cpp - Windows - Text - Debug - - - PathRelative - Project - generic - tbarsmpl.cpp - Windows - Text - Debug - - - PathRelative - Project - generic - textdlgg.cpp - Windows - Text - Debug - - - PathRelative - Project - generic - tipdlg.cpp - Windows - Text - Debug - - - PathRelative - Project - generic - tipwin.cpp - Windows - Text - Debug - - - PathRelative - Project - generic - treectlg.cpp - Windows - Text - Debug - - - PathRelative - Project - generic - treelay.cpp - Windows - Text - Debug - - - PathRelative - Project - generic - wizard.cpp - Windows - Text - Debug - - - PathRelative - Project - ..\include - wx_cw_d.pch - Windows - Text - Debug - - - PathRelative - Project - ..\include - wx_cw_d.pch++ - Windows - Text - Debug - - - PathRelative - Project - html - helpctrl.cpp - Windows - Text - Debug - - - PathRelative - Project - html - helpdata.cpp - Windows - Text - Debug - - - PathRelative - Project - html - helpfrm.cpp - Windows - Text - Debug - - - PathRelative - Project - html - htmlcell.cpp - Windows - Text - Debug - - - PathRelative - Project - html - htmlfilt.cpp - Windows - Text - Debug - - - PathRelative - Project - html - htmlpars.cpp - Windows - Text - Debug - - - PathRelative - Project - html - htmltag.cpp - Windows - Text - Debug - - - PathRelative - Project - html - htmlwin.cpp - Windows - Text - Debug - - - PathRelative - Project - html - htmprint.cpp - Windows - Text - Debug - - - PathRelative - Project - html - m_dflist.cpp - Windows - Text - Debug - - - PathRelative - Project - html - m_fonts.cpp - Windows - Text - Debug - - - PathRelative - Project - html - m_hline.cpp - Windows - Text - Debug - - - PathRelative - Project - html - m_image.cpp - Windows - Text - Debug - - - PathRelative - Project - html - m_layout.cpp - Windows - Text - Debug - - - PathRelative - Project - html - m_links.cpp - Windows - Text - Debug - - - PathRelative - Project - html - m_list.cpp - Windows - Text - Debug - - - PathRelative - Project - html - m_pre.cpp - Windows - Text - Debug - - - PathRelative - Project - html - m_style.cpp - Windows - Text - Debug - - - PathRelative - Project - html - m_tables.cpp - Windows - Text - Debug - - - PathRelative - Project - html - winpars.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - volume.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - app.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - bitmap.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - bmpbuttn.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - brush.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - button.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - caret.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - checkbox.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - checklst.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - choice.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - clipbrd.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - colordlg.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - colour.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - combobox.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - control.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - curico.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - cursor.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - data.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - dc.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - dcclient.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - dcmemory.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - dcprint.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - dcscreen.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - dde.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - dialog.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - dialup.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - dib.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - dibutils.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - dir.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - dirdlg.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - dragimag.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - enhmeta.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - evtloop.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - fdrepdlg.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - filedlg.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - font.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - fontdlg.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - fontenum.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - fontutil.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - frame.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - gauge95.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - gdiimage.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - gdiobj.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - glcanvas.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - gsocket.c - Windows - Text - Debug - - - PathRelative - Project - msw - gsockmsw.c - Windows - Text - Debug - - - PathRelative - Project - msw - helpbest.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - helpchm.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - helpwin.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - icon.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - imaglist.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - iniconf.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - joystick.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - listbox.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - listctrl.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - main.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - mdi.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - menu.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - menuitem.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - metafile.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - mimetype.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - minifram.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - msgdlg.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - mslu.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - nativdlg.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - notebook.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - ownerdrw.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - palette.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - pen.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - penwin.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - printdlg.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - printwin.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - radiobox.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - radiobut.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - regconf.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - region.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - registry.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - scrolbar.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - settings.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - slider95.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - snglinst.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - spinbutt.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - spinctrl.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - statbmp.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - statbox.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - statbr95.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - statline.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - stattext.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - tabctrl.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - taskbar.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - tbar95.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - textctrl.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - tglbtn.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - thread.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - timer.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - tooltip.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - toplevel.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - treectrl.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - utils.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - utilsexc.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - accel.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - wave.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - window.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - ole\automtn.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - ole\dataobj.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - ole\dropsrc.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - ole\droptgt.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - ole\oleutils.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - ole\uuid.cpp - Windows - Text - Debug - - - RootRelative - Project - ..\lib\jpeg.lib - Windows - Library - Debug, TargetOutputFile - - - RootRelative - Project - ..\lib\png.lib - Windows - Library - Debug, TargetOutputFile - - - RootRelative - Project - ..\lib\tiff.lib - Windows - Library - Debug, TargetOutputFile - - - RootRelative - Project - ..\lib\zlib.lib - Windows - Library - Debug, TargetOutputFile - - - PathRelative - Project - msw - popupwin.cpp - Windows - Text - Debug - - - PathRelative - Project - common - msgout.cpp - Windows - Text - Debug - - - PathRelative - Project - common - settcmn.cpp - Windows - Text - Debug - - - - - PathRelative - Project - ..\include - wx_cw_d.pch - Windows - - - PathRelative - Project - ..\include - wx_cw_d.pch++ - Windows - - - PathRelative - Project - common - ftp.cpp - Windows - - - PathRelative - Project - common - artprov.cpp - Windows - - - PathRelative - Project - common - artstd.cpp - Windows - - - PathRelative - Project - common - choiccmn.cpp - Windows - - - PathRelative - Project - common - clipcmn.cpp - Windows - - - PathRelative - Project - common - clntdata.cpp - Windows - - - PathRelative - Project - common - cmdline.cpp - Windows - - - PathRelative - Project - common - cmdproc.cpp - Windows - - - PathRelative - Project - common - cmndata.cpp - Windows - - - PathRelative - Project - common - config.cpp - Windows - - - PathRelative - Project - common - containr.cpp - Windows - - - PathRelative - Project - common - cshelp.cpp - Windows - - - PathRelative - Project - common - ctrlcmn.cpp - Windows - - - PathRelative - Project - common - ctrlsub.cpp - Windows - - - PathRelative - Project - common - datetime.cpp - Windows - - - PathRelative - Project - common - datstrm.cpp - Windows - - - PathRelative - Project - common - db.cpp - Windows - - - PathRelative - Project - common - dbgrid.cpp - Windows - - - PathRelative - Project - common - dbtable.cpp - Windows - - - PathRelative - Project - common - dcbase.cpp - Windows - - - PathRelative - Project - common - dircmn.cpp - Windows - - - PathRelative - Project - common - dlgcmn.cpp - Windows - - - PathRelative - Project - common - dndcmn.cpp - Windows - - - PathRelative - Project - common - dobjcmn.cpp - Windows - - - PathRelative - Project - common - docmdi.cpp - Windows - - - PathRelative - Project - common - docview.cpp - Windows - - - PathRelative - Project - common - dseldlg.cpp - Windows - - - PathRelative - Project - common - dynarray.cpp - Windows - - - PathRelative - Project - common - dynlib.cpp - Windows - - - PathRelative - Project - common - dynload.cpp - Windows - - - PathRelative - Project - common - effects.cpp - Windows - - - PathRelative - Project - common - encconv.cpp - Windows - - - PathRelative - Project - common - event.cpp - Windows - - - PathRelative - Project - common - extended.c - Windows - - - PathRelative - Project - common - fddlgcmn.cpp - Windows - - - PathRelative - Project - common - ffile.cpp - Windows - - - PathRelative - Project - common - file.cpp - Windows - - - PathRelative - Project - common - fileconf.cpp - Windows - - - PathRelative - Project - common - filefn.cpp - Windows - - - PathRelative - Project - common - filename.cpp - Windows - - - PathRelative - Project - common - filesys.cpp - Windows - - - PathRelative - Project - common - fontcmn.cpp - Windows - - - PathRelative - Project - common - fontmap.cpp - Windows - - - PathRelative - Project - common - framecmn.cpp - Windows - - - PathRelative - Project - common - fs_inet.cpp - Windows - - - PathRelative - Project - common - fs_mem.cpp - Windows - - - PathRelative - Project - common - fs_zip.cpp - Windows - - - PathRelative - Project - common - appcmn.cpp - Windows - - - PathRelative - Project - common - gaugecmn.cpp - Windows - - - PathRelative - Project - common - gdicmn.cpp - Windows - - - PathRelative - Project - common - geometry.cpp - Windows - - - PathRelative - Project - common - gifdecod.cpp - Windows - - - PathRelative - Project - common - hash.cpp - Windows - - - PathRelative - Project - common - hashmap.cpp - Windows - - - PathRelative - Project - common - helpbase.cpp - Windows - - - PathRelative - Project - common - http.cpp - Windows - - - PathRelative - Project - common - iconbndl.cpp - Windows - - - PathRelative - Project - common - imagall.cpp - Windows - - - PathRelative - Project - common - imagbmp.cpp - Windows - - - PathRelative - Project - common - image.cpp - Windows - - - PathRelative - Project - common - imagfill.cpp - Windows - - - PathRelative - Project - common - imaggif.cpp - Windows - - - PathRelative - Project - common - imagiff.cpp - Windows - - - PathRelative - Project - common - imagjpeg.cpp - Windows - - - PathRelative - Project - common - imagpcx.cpp - Windows - - - PathRelative - Project - common - imagpng.cpp - Windows - - - PathRelative - Project - common - imagpnm.cpp - Windows - - - PathRelative - Project - common - imagtiff.cpp - Windows - - - PathRelative - Project - common - imagxpm.cpp - Windows - - - PathRelative - Project - common - intl.cpp - Windows - - - PathRelative - Project - common - ipcbase.cpp - Windows - - - PathRelative - Project - common - layout.cpp - Windows - - - PathRelative - Project - common - lboxcmn.cpp - Windows - - - PathRelative - Project - common - list.cpp - Windows - - - PathRelative - Project - common - log.cpp - Windows - - - PathRelative - Project - common - longlong.cpp - Windows - - - PathRelative - Project - common - matrix.cpp - Windows - - - PathRelative - Project - common - memory.cpp - Windows - - - PathRelative - Project - common - menucmn.cpp - Windows - - - PathRelative - Project - common - mimecmn.cpp - Windows - - - PathRelative - Project - common - module.cpp - Windows - - - PathRelative - Project - common - mstream.cpp - Windows - - - PathRelative - Project - common - nbkbase.cpp - Windows - - - PathRelative - Project - common - object.cpp - Windows - - - PathRelative - Project - common - odbc.cpp - Windows - - - PathRelative - Project - common - paper.cpp - Windows - - - PathRelative - Project - common - popupcmn.cpp - Windows - - - PathRelative - Project - common - prntbase.cpp - Windows - - - PathRelative - Project - common - process.cpp - Windows - - - PathRelative - Project - common - protocol.cpp - Windows - - - PathRelative - Project - common - quantize.cpp - Windows - - - PathRelative - Project - common - radiocmn.cpp - Windows - - - PathRelative - Project - common - regex.cpp - Windows - - - PathRelative - Project - common - resource.cpp - Windows - - - PathRelative - Project - common - sckaddr.cpp - Windows - - - PathRelative - Project - common - sckfile.cpp - Windows - - - PathRelative - Project - common - sckipc.cpp - Windows - - - PathRelative - Project - common - sckstrm.cpp - Windows - - - PathRelative - Project - common - settcmn.cpp - Windows - - - PathRelative - Project - common - sizer.cpp - Windows - - - PathRelative - Project - common - socket.cpp - Windows - - - PathRelative - Project - common - statbar.cpp - Windows - - - PathRelative - Project - common - strconv.cpp - Windows - - - PathRelative - Project - common - stream.cpp - Windows - - - PathRelative - Project - common - string.cpp - Windows - - - PathRelative - Project - common - sysopt.cpp - Windows - - - PathRelative - Project - common - tbarbase.cpp - Windows - - - PathRelative - Project - common - textbuf.cpp - Windows - - - PathRelative - Project - common - textcmn.cpp - Windows - - - PathRelative - Project - common - textfile.cpp - Windows - - - PathRelative - Project - common - timercmn.cpp - Windows - - - PathRelative - Project - common - tokenzr.cpp - Windows - - - PathRelative - Project - common - toplvcmn.cpp - Windows - - - PathRelative - Project - common - treebase.cpp - Windows - - - PathRelative - Project - common - txtstrm.cpp - Windows - - - PathRelative - Project - common - unzip.c - Windows - - - PathRelative - Project - common - url.cpp - Windows - - - PathRelative - Project - common - utilscmn.cpp - Windows - - - PathRelative - Project - common - valgen.cpp - Windows - - - PathRelative - Project - common - validate.cpp - Windows - - - PathRelative - Project - common - valtext.cpp - Windows - - - PathRelative - Project - common - variant.cpp - Windows - - - PathRelative - Project - common - wfstream.cpp - Windows - - - PathRelative - Project - common - wincmn.cpp - Windows - - - PathRelative - Project - common - wxchar.cpp - Windows - - - PathRelative - Project - common - wxexpr.cpp - Windows - - - PathRelative - Project - common - xpmdecod.cpp - Windows - - - PathRelative - Project - common - zipstrm.cpp - Windows - - - PathRelative - Project - common - zstream.cpp - Windows - - - PathRelative - Project - generic - busyinfo.cpp - Windows - - - PathRelative - Project - generic - calctrl.cpp - Windows - - - PathRelative - Project - generic - choicdgg.cpp - Windows - - - PathRelative - Project - generic - dcbuffer.cpp - Windows - - - PathRelative - Project - generic - dcpsg.cpp - Windows - - - PathRelative - Project - generic - dirctrlg.cpp - Windows - - - PathRelative - Project - generic - dragimgg.cpp - Windows - - - PathRelative - Project - generic - grid.cpp - Windows - - - PathRelative - Project - generic - gridctrl.cpp - Windows - - - PathRelative - Project - generic - gridsel.cpp - Windows - - - PathRelative - Project - generic - laywin.cpp - Windows - - - PathRelative - Project - generic - logg.cpp - Windows - - - PathRelative - Project - generic - numdlgg.cpp - Windows - - - PathRelative - Project - generic - panelg.cpp - Windows - - - PathRelative - Project - generic - prntdlgg.cpp - Windows - - - PathRelative - Project - generic - progdlgg.cpp - Windows - - - PathRelative - Project - generic - prop.cpp - Windows - - - PathRelative - Project - generic - propform.cpp - Windows - - - PathRelative - Project - generic - proplist.cpp - Windows - - - PathRelative - Project - generic - sashwin.cpp - Windows - - - PathRelative - Project - generic - scrlwing.cpp - Windows - - - PathRelative - Project - generic - spinctlg.cpp - Windows - - - PathRelative - Project - generic - splash.cpp - Windows - - - PathRelative - Project - generic - splitter.cpp - Windows - - - PathRelative - Project - generic - statusbr.cpp - Windows - - - PathRelative - Project - generic - tbarsmpl.cpp - Windows - - - PathRelative - Project - generic - textdlgg.cpp - Windows - - - PathRelative - Project - generic - tipdlg.cpp - Windows - - - PathRelative - Project - generic - tipwin.cpp - Windows - - - PathRelative - Project - generic - treectlg.cpp - Windows - - - PathRelative - Project - generic - treelay.cpp - Windows - - - PathRelative - Project - generic - wizard.cpp - Windows - - - PathRelative - Project - html - helpctrl.cpp - Windows - - - PathRelative - Project - html - helpdata.cpp - Windows - - - PathRelative - Project - html - helpfrm.cpp - Windows - - - PathRelative - Project - html - htmlcell.cpp - Windows - - - PathRelative - Project - html - htmlfilt.cpp - Windows - - - PathRelative - Project - html - htmlpars.cpp - Windows - - - PathRelative - Project - html - htmltag.cpp - Windows - - - PathRelative - Project - html - htmlwin.cpp - Windows - - - PathRelative - Project - html - htmprint.cpp - Windows - - - PathRelative - Project - html - m_dflist.cpp - Windows - - - PathRelative - Project - html - m_fonts.cpp - Windows - - - PathRelative - Project - html - m_hline.cpp - Windows - - - PathRelative - Project - html - m_image.cpp - Windows - - - PathRelative - Project - html - m_layout.cpp - Windows - - - PathRelative - Project - html - m_links.cpp - Windows - - - PathRelative - Project - html - m_list.cpp - Windows - - - PathRelative - Project - html - m_pre.cpp - Windows - - - PathRelative - Project - html - m_style.cpp - Windows - - - PathRelative - Project - html - m_tables.cpp - Windows - - - PathRelative - Project - html - winpars.cpp - Windows - - - PathRelative - Project - msw - volume.cpp - Windows - - - PathRelative - Project - msw - app.cpp - Windows - - - PathRelative - Project - msw - bitmap.cpp - Windows - - - PathRelative - Project - msw - bmpbuttn.cpp - Windows - - - PathRelative - Project - msw - brush.cpp - Windows - - - PathRelative - Project - msw - button.cpp - Windows - - - PathRelative - Project - msw - caret.cpp - Windows - - - PathRelative - Project - msw - checkbox.cpp - Windows - - - PathRelative - Project - msw - checklst.cpp - Windows - - - PathRelative - Project - msw - choice.cpp - Windows - - - PathRelative - Project - msw - clipbrd.cpp - Windows - - - PathRelative - Project - msw - colordlg.cpp - Windows - - - PathRelative - Project - msw - colour.cpp - Windows - - - PathRelative - Project - msw - combobox.cpp - Windows - - - PathRelative - Project - msw - control.cpp - Windows - - - PathRelative - Project - msw - curico.cpp - Windows - - - PathRelative - Project - msw - cursor.cpp - Windows - - - PathRelative - Project - msw - data.cpp - Windows - - - PathRelative - Project - msw - dc.cpp - Windows - - - PathRelative - Project - msw - dcclient.cpp - Windows - - - PathRelative - Project - msw - dcmemory.cpp - Windows - - - PathRelative - Project - msw - dcprint.cpp - Windows - - - PathRelative - Project - msw - dcscreen.cpp - Windows - - - PathRelative - Project - msw - dde.cpp - Windows - - - PathRelative - Project - msw - dialog.cpp - Windows - - - PathRelative - Project - msw - dialup.cpp - Windows - - - PathRelative - Project - msw - dib.cpp - Windows - - - PathRelative - Project - msw - dibutils.cpp - Windows - - - PathRelative - Project - msw - dir.cpp - Windows - - - PathRelative - Project - msw - dirdlg.cpp - Windows - - - PathRelative - Project - msw - dragimag.cpp - Windows - - - PathRelative - Project - msw - enhmeta.cpp - Windows - - - PathRelative - Project - msw - evtloop.cpp - Windows - - - PathRelative - Project - msw - fdrepdlg.cpp - Windows - - - PathRelative - Project - msw - filedlg.cpp - Windows - - - PathRelative - Project - msw - font.cpp - Windows - - - PathRelative - Project - msw - fontdlg.cpp - Windows - - - PathRelative - Project - msw - fontenum.cpp - Windows - - - PathRelative - Project - msw - fontutil.cpp - Windows - - - PathRelative - Project - msw - frame.cpp - Windows - - - PathRelative - Project - msw - gauge95.cpp - Windows - - - PathRelative - Project - msw - gdiimage.cpp - Windows - - - PathRelative - Project - msw - gdiobj.cpp - Windows - - - PathRelative - Project - msw - glcanvas.cpp - Windows - - - PathRelative - Project - msw - gsocket.c - Windows - - - PathRelative - Project - msw - gsockmsw.c - Windows - - - PathRelative - Project - msw - helpbest.cpp - Windows - - - PathRelative - Project - msw - helpchm.cpp - Windows - - - PathRelative - Project - msw - helpwin.cpp - Windows - - - PathRelative - Project - msw - icon.cpp - Windows - - - PathRelative - Project - msw - imaglist.cpp - Windows - - - PathRelative - Project - msw - iniconf.cpp - Windows - - - PathRelative - Project - msw - joystick.cpp - Windows - - - PathRelative - Project - msw - listbox.cpp - Windows - - - PathRelative - Project - msw - listctrl.cpp - Windows - - - PathRelative - Project - msw - main.cpp - Windows - - - PathRelative - Project - msw - mdi.cpp - Windows - - - PathRelative - Project - msw - menu.cpp - Windows - - - PathRelative - Project - msw - menuitem.cpp - Windows - - - PathRelative - Project - msw - metafile.cpp - Windows - - - PathRelative - Project - msw - mimetype.cpp - Windows - - - PathRelative - Project - msw - minifram.cpp - Windows - - - PathRelative - Project - msw - msgdlg.cpp - Windows - - - PathRelative - Project - msw - mslu.cpp - Windows - - - PathRelative - Project - msw - nativdlg.cpp - Windows - - - PathRelative - Project - msw - notebook.cpp - Windows - - - PathRelative - Project - msw - ownerdrw.cpp - Windows - - - PathRelative - Project - msw - palette.cpp - Windows - - - PathRelative - Project - msw - pen.cpp - Windows - - - PathRelative - Project - msw - penwin.cpp - Windows - - - PathRelative - Project - msw - printdlg.cpp - Windows - - - PathRelative - Project - msw - printwin.cpp - Windows - - - PathRelative - Project - msw - radiobox.cpp - Windows - - - PathRelative - Project - msw - radiobut.cpp - Windows - - - PathRelative - Project - msw - regconf.cpp - Windows - - - PathRelative - Project - msw - region.cpp - Windows - - - PathRelative - Project - msw - registry.cpp - Windows - - - PathRelative - Project - msw - scrolbar.cpp - Windows - - - PathRelative - Project - msw - settings.cpp - Windows - - - PathRelative - Project - msw - slider95.cpp - Windows - - - PathRelative - Project - msw - snglinst.cpp - Windows - - - PathRelative - Project - msw - spinbutt.cpp - Windows - - - PathRelative - Project - msw - spinctrl.cpp - Windows - - - PathRelative - Project - msw - statbmp.cpp - Windows - - - PathRelative - Project - msw - statbox.cpp - Windows - - - PathRelative - Project - msw - statbr95.cpp - Windows - - - PathRelative - Project - msw - statline.cpp - Windows - - - PathRelative - Project - msw - stattext.cpp - Windows - - - PathRelative - Project - msw - tabctrl.cpp - Windows - - - PathRelative - Project - msw - taskbar.cpp - Windows - - - PathRelative - Project - msw - tbar95.cpp - Windows - - - PathRelative - Project - msw - textctrl.cpp - Windows - - - PathRelative - Project - msw - tglbtn.cpp - Windows - - - PathRelative - Project - msw - thread.cpp - Windows - - - PathRelative - Project - msw - timer.cpp - Windows - - - PathRelative - Project - msw - tooltip.cpp - Windows - - - PathRelative - Project - msw - toplevel.cpp - Windows - - - PathRelative - Project - msw - treectrl.cpp - Windows - - - PathRelative - Project - msw - utils.cpp - Windows - - - PathRelative - Project - msw - utilsexc.cpp - Windows - - - PathRelative - Project - msw - accel.cpp - Windows - - - PathRelative - Project - msw - wave.cpp - Windows - - - PathRelative - Project - msw - window.cpp - Windows - - - PathRelative - Project - msw - ole\automtn.cpp - Windows - - - PathRelative - Project - msw - ole\dataobj.cpp - Windows - - - PathRelative - Project - msw - ole\dropsrc.cpp - Windows - - - PathRelative - Project - msw - ole\droptgt.cpp - Windows - - - PathRelative - Project - msw - ole\oleutils.cpp - Windows - - - PathRelative - Project - msw - ole\uuid.cpp - Windows - - - PathRelative - Project - msw - popupwin.cpp - Windows - - - PathRelative - Project - common - msgout.cpp - Windows - - - RootRelative - Project - ..\lib\zlib.lib - Windows - - - RootRelative - Project - ..\lib\tiff.lib - Windows - - - RootRelative - Project - ..\lib\png.lib - Windows - - - RootRelative - Project - ..\lib\jpeg.lib - Windows - - - - - copySetupDebug - - - jpeg - LinkAgainst - - RootRelative - Project - ..\lib\jpeg.lib - Windows - - - - png - LinkAgainst - - RootRelative - Project - ..\lib\png.lib - Windows - - - - tiff - LinkAgainst - - RootRelative - Project - ..\lib\tiff.lib - Windows - - - - zlib - LinkAgainst - - RootRelative - Project - ..\lib\zlib.lib - Windows - - - - - - jpeg - - - - UserSourceTrees - - - AlwaysSearchUserPathstrue - InterpretDOSAndUnixPathsfalse - RequireFrameworkStyleIncludesfalse - UserSearchPaths - - SearchPath - Path..\lib\cw7msw\include - PathFormatWindows - PathRootProject - - Recursivefalse - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path..\include - PathFormatWindows - PathRootProject - - Recursivefalse - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path - PathFormatWindows - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SystemSearchPaths - - SearchPath - PathMSL - PathFormatWindows - PathRootCodeWarrior - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - PathWin32-x86 Support - PathFormatWindows - PathRootCodeWarrior - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - - - MWRuntimeSettings_WorkingDirectory - MWRuntimeSettings_CommandLine - MWRuntimeSettings_HostApplication - Path - PathFormatGeneric - PathRootAbsolute - - MWRuntimeSettings_EnvVars - - - LinkerWin32 x86 Linker - PreLinker - PostLinker - Targetnamejpeg - OutputDirectory - Path..\lib - PathFormatWindows - PathRootProject - - SaveEntriesUsingRelativePathstrue - - - FileMappings - - FileTypeTEXT - FileExtension.c - CompilerMW C/C++ x86 - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.c++ - CompilerMW C/C++ x86 - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.cc - CompilerMW C/C++ x86 - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.cp - CompilerMW C/C++ x86 - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.cpp - CompilerMW C/C++ x86 - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.def - Compiler - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.h - CompilerMW C/C++ x86 - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMaketrue - - - FileTypeTEXT - FileExtension.h++ - CompilerMW C/C++ x86 - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMaketrue - - - FileTypeTEXT - FileExtension.hpp - CompilerMW C/C++ x86 - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMaketrue - - - FileTypeTEXT - FileExtension.ord - Compiler - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.pch - CompilerMW C/C++ x86 - EditLanguageC/C++ - Precompiletrue - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.pch++ - CompilerMW C/C++ x86 - EditLanguageC/C++ - Precompiletrue - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.pl - CompilerMW Perl - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.rc - CompilerMW WinRC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeiLIB - FileExtension - CompilerLib Import x86 - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeiOBJ - FileExtension - CompilerObj Import x86 - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileExtension.a - CompilerLib Import x86 - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileExtension.doc - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFilefalse - IgnoredByMaketrue - - - FileExtension.lib - CompilerLib Import x86 - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileExtension.o - CompilerObj Import x86 - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileExtension.obj - CompilerObj Import x86 - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileExtension.res - CompilerWinRes Import - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - - - CacheModDatestrue - ActivateBrowsertrue - DumpBrowserInfofalse - CacheSubprojectstrue - UseThirdPartyDebuggerfalse - DebuggerAppPath - Path - PathFormatGeneric - PathRootAbsolute - - DebuggerCmdLineArgs - DebuggerWorkingDir - Path - PathFormatGeneric - PathRootAbsolute - - - - LogSystemMessagestrue - AutoTargetDLLstrue - StopAtWatchpointstrue - PauseWhileRunningfalse - PauseInterval5 - PauseUIFlags0 - AltExePath - Path - PathFormatGeneric - PathRootAbsolute - - StopAtTempBPOnLaunchtrue - CacheSymbolicstrue - TempBPFunctionNamemain - TempBPType0 - - - Enabledfalse - ConnectionName - DownloadPath - LaunchRemoteAppfalse - RemoteAppPath - - - OtherExecutables - - - CustomColor1 - Red0 - Green32767 - Blue0 - - CustomColor2 - Red0 - Green32767 - Blue0 - - CustomColor3 - Red0 - Green32767 - Blue0 - - CustomColor4 - Red0 - Green32767 - Blue0 - - - - Perl_Prefix_Filename - - - MWCodeGen_PPC_structalignmentMC68K - MWCodeGen_PPC_tracebacktablesNone - MWCodeGen_PPC_processorGeneric - MWCodeGen_PPC_readonlystrings0 - MWCodeGen_PPC_tocdata1 - MWCodeGen_PPC_profiler0 - MWCodeGen_PPC_fpcontract1 - MWCodeGen_PPC_schedule0 - MWCodeGen_PPC_peephole1 - MWCodeGen_PPC_processorspecific0 - MWCodeGen_PPC_altivec0 - MWCodeGen_PPC_vectortocdata1 - MWCodeGen_PPC_vrsave1 - - - MWCodeGen_X86_processorPentiumII - MWCodeGen_X86_alignmentbytes8 - MWCodeGen_X86_exceptionsZeroOverhead - MWCodeGen_X86_extinst_mmx0 - MWCodeGen_X86_extinst_3dnow0 - MWCodeGen_X86_use_mmx_3dnow_convention0 - MWCodeGen_X86_machinecodelisting0 - MWCodeGen_X86_intrinsics0 - MWCodeGen_X86_syminfo0 - MWCodeGen_X86_codeviewinfo0 - MWCodeGen_X86_extinst_cmov_fcomi0 - MWCodeGen_X86_extinst_sse0 - - - MWDebugger_X86_Exceptions - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - - - - PDisasmX86_showHeaderstrue - PDisasmX86_showSymTabtrue - PDisasmX86_showCodetrue - PDisasmX86_showSourcefalse - PDisasmX86_showHextrue - PDisasmX86_showRelocationtrue - PDisasmX86_showCommentsfalse - PDisasmX86_showDebugfalse - PDisasmX86_showExceptionsfalse - PDisasmX86_showDatatrue - PDisasmX86_showRawfalse - PDisasmX86_verbosetrue - - - MWDisassembler_PPC_showcode1 - MWDisassembler_PPC_extended1 - MWDisassembler_PPC_mix0 - MWDisassembler_PPC_nohex0 - MWDisassembler_PPC_showdata1 - MWDisassembler_PPC_showexceptions1 - MWDisassembler_PPC_showsym0 - MWDisassembler_PPC_shownames1 - - - MWFrontEnd_C_cplusplus0 - MWFrontEnd_C_checkprotos0 - MWFrontEnd_C_arm0 - MWFrontEnd_C_trigraphs0 - MWFrontEnd_C_onlystdkeywords0 - MWFrontEnd_C_enumsalwaysint0 - MWFrontEnd_C_mpwpointerstyle0 - MWFrontEnd_C_prefixnamejpeg_CW_Prefix.h - MWFrontEnd_C_ansistrict0 - MWFrontEnd_C_mpwcnewline0 - MWFrontEnd_C_wchar_type1 - MWFrontEnd_C_enableexceptions1 - MWFrontEnd_C_dontreusestrings0 - MWFrontEnd_C_poolstrings0 - MWFrontEnd_C_dontinline0 - MWFrontEnd_C_useRTTI1 - MWFrontEnd_C_multibyteaware0 - MWFrontEnd_C_unsignedchars0 - MWFrontEnd_C_autoinline0 - MWFrontEnd_C_booltruefalse1 - MWFrontEnd_C_direct_to_som0 - MWFrontEnd_C_som_env_check0 - MWFrontEnd_C_alwaysinline0 - MWFrontEnd_C_inlinelevel0 - MWFrontEnd_C_ecplusplus0 - MWFrontEnd_C_objective_c0 - MWFrontEnd_C_defer_codegen1 - - - MWFTP_Post_hostName - MWFTP_Post_username - MWFTP_Post_password0 - MWFTP_Post_remoteDir - MWFTP_Post_ftp_PathVersion0 - MWFTP_Post_ftp_PathType0 - MWFTP_Post_ftp_PathFormat0 - MWFTP_Post_ftp_tree - MWFTP_Post_uploadDir - MWFTP_Post_ftp_port21 - MWFTP_Post_SendBin1 - MWFTP_Post_ShouldLog1 - - - MWCommandLine_Java_clsName - MWCommandLine_Java_args - - - MWVJavaDebugging_Protocol1 - MWVJavaDebugging_JDKVersion1 - MWVJavaDebugging_TimeOut25 - MWVJavaDebugging_SupportSlowDevicesfalse - - - MWJavaDoc_Proj_Version1 - MWJavaDoc_Proj_Depricated1 - MWJavaDoc_Proj_Author1 - MWJavaDoc_Proj_Index1 - MWJavaDoc_Proj_Tree1 - MWJavaDoc_Proj_SunResolveToSame0 - MWJavaDoc_Proj_Shortnames0 - MWJavaDoc_Proj_Folder0 - MWJavaDoc_Proj_GenerateAPILinks0 - MWJavaDoc_Proj_scopePublic - MWJavaDoc_Proj_encodingName - MWJavaDoc_Proj_decodingName - MWJavaDoc_Proj_javaPackagePathhttp://java.sun.com/products/jdk/1.1/docs/api/ - - - MWJava_Language_optimizefalse - MWJava_Language_warnDeprecatedfalse - MWJava_Language_emitMapfalse - MWJava_Language_strictFileNamesfalse - MWJava_Language_strictFileHierarchyfalse - MWJava_Language_1_1_Compatiblefalse - MWJava_Language_emitHeaders0 - MWJava_Language_headerTypeJNINativeHeaders - MWJava_Language_packageFilter - MWJava_Language_genCommentstrue - MWJava_Language_genHeadersfalse - - - MWJava_Output_outputtypeJarFile - MWJava_Output_outfileJavaClasses.jar - MWJava_Output_ftype1514754080 - MWJava_Output_fcreator1297570384 - MWJava_Output_compress0 - MWJava_Output_genManifest0 - MWJava_Output_trunctypeFront - MWJava_Output_deleteClasses0 - MWJava_Output_consoleApp1 - - - MWJava_Proj_projtypeApplet - MWJava_Proj_mainClassName - MWJava_Proj_HTMLAppCreator1463898714 - MWJava_Proj_HTMLAppName - MWJava_Proj_PathVersion0 - MWJava_Proj_PathType0 - MWJava_Proj_PathFormat0 - MWJava_Proj_tree - MWJava_Proj_HTMLAppWin32Name - MWJava_Proj_compress0 - MWJava_Proj_useVM1 - MWJava_Proj_vmarguments - MWJava_Proj_vmName - MWJava_Proj_simPropFile - MWJava_Proj_useJCVM1 - MWJava_Proj_aidData - - - MWLinker_PPC_linksym1 - MWLinker_PPC_symfullpath1 - MWLinker_PPC_linkmap0 - MWLinker_PPC_nolinkwarnings0 - MWLinker_PPC_dontdeadstripinitcode0 - MWLinker_PPC_permitmultdefs0 - MWLinker_PPC_linkmodeFast - MWLinker_PPC_initname - MWLinker_PPC_mainname__start - MWLinker_PPC_termname - - - MWLinker_X86_entrypointusageDefault - MWLinker_X86_entrypoint - MWLinker_X86_subsystemWinGUI - MWLinker_X86_subsysmajorid4 - MWLinker_X86_subsysminorid0 - MWLinker_X86_usrmajorid0 - MWLinker_X86_usrminorid0 - MWLinker_X86_commandfile - MWLinker_X86_generatemap0 - MWLinker_X86_linksym0 - MWLinker_X86_linkCV0 - - - MWMerge_MacOS_projectTypeApplication - MWMerge_MacOS_outputNameMerge Out - MWMerge_MacOS_outputCreator???? - MWMerge_MacOS_outputTypeAPPL - MWMerge_MacOS_suppressWarning0 - MWMerge_MacOS_copyFragments1 - MWMerge_MacOS_copyResources1 - MWMerge_MacOS_flattenResource0 - MWMerge_MacOS_flatFileNamea.rsrc - MWMerge_MacOS_flatFileOutputPath - Path: - PathFormatMacOS - PathRootProject - - MWMerge_MacOS_skipResources - DGLX - ckid - Proj - WSPC - mcvs - - - - MWMacOSPackager_UsePackager0 - MWMacOSPackager_FolderToPackage - Path: - PathFormatMacOS - PathRootProject - - MWMacOSPackager_CreateClassicAlias0 - MWMacOSPackager_ClassicAliasMethodUseTargetOutput - MWMacOSPackager_ClassicAliasPath - Path: - PathFormatMacOS - PathRootProject - - MWMacOSPackager_CreatePkgInfo0 - MWMacOSPackager_PkgCreatorType???? - MWMacOSPackager_PkgFileTypeLPPA - - - MWPEF_exportsNone - MWPEF_libfolder0 - MWPEF_sortcodeNone - MWPEF_expandbss0 - MWPEF_sharedata0 - MWPEF_olddefversion0 - MWPEF_oldimpversion0 - MWPEF_currentversion0 - MWPEF_fragmentname - MWPEF_collapsereloads0 - - - MWAssembler_PPC_auxheader0 - MWAssembler_PPC_symmodeMac - MWAssembler_PPC_dialectPPC - MWAssembler_PPC_prefixfile - MWAssembler_PPC_typecheck0 - MWAssembler_PPC_warnings0 - MWAssembler_PPC_casesensitive0 - - - GlobalOptimizer_PPC_optimizationlevelLevel0 - GlobalOptimizer_PPC_optforSpeed - - - MWProject_PPC_typeApplication - MWProject_PPC_outfilea.out - MWProject_PPC_filecreator???? - MWProject_PPC_filetypeAPPL - MWProject_PPC_size384 - MWProject_PPC_minsize384 - MWProject_PPC_stacksize64 - MWProject_PPC_flags22720 - MWProject_PPC_symfilename - MWProject_PPC_rsrcname - MWProject_PPC_rsrcheaderNative - MWProject_PPC_rsrctype???? - MWProject_PPC_rsrcid0 - MWProject_PPC_rsrcflags0 - MWProject_PPC_rsrcstore0 - MWProject_PPC_rsrcmerge0 - MWProject_PPC_flatrsrc0 - MWProject_PPC_flatrsrcoutputdir - Path: - PathFormatMacOS - PathRootProject - - MWProject_PPC_flatrsrcfilename - - - MWProject_X86_typeLibrary - MWProject_X86_outfilejpeg.lib - MWProject_X86_baseaddress4194304 - MWProject_X86_maxstacksize1024 - MWProject_X86_minstacksize4 - MWProject_X86_size1024 - MWProject_X86_minsize4 - MWProject_X86_importlib - Resource Flattener Panel - 0100000000000000000000000000000000000000000000000000000000000000 - 0000074F75742E62696E00000000000000000000000000000000000000000000 - 0000 - - - - MWRez_Language_maxwidth80 - MWRez_Language_scriptRoman - MWRez_Language_alignmentAlign1 - MWRez_Language_filtermodeFilterSkip - MWRez_Language_suppresswarnings0 - MWRez_Language_escapecontrolchars1 - MWRez_Language_prefixname - MWRez_Language_filteredtypes'CODE' 'DATA' 'PICT' - - - MWWarning_C_warn_illpragma0 - MWWarning_C_warn_emptydecl0 - MWWarning_C_warn_possunwant0 - MWWarning_C_warn_unusedvar0 - MWWarning_C_warn_unusedarg0 - MWWarning_C_warn_extracomma0 - MWWarning_C_pedantic0 - MWWarning_C_warningerrors0 - MWWarning_C_warn_hidevirtual0 - MWWarning_C_warn_implicitconv0 - MWWarning_C_warn_notinlined0 - MWWarning_C_warn_structclass0 - - - MWWinRC_prefixname - - - GlobalOptimizer_X86__optimizationlevelLevel4 - GlobalOptimizer_X86__optforSpeed - - - - PathRelative - Project - - jpeg\jdphuff.c - Windows - Text - - - - PathRelative - Project - - jpeg\jcapistd.c - Windows - Text - - - - PathRelative - Project - - jpeg\jccoefct.c - Windows - Text - - - - PathRelative - Project - - jpeg\jccolor.c - Windows - Text - - - - PathRelative - Project - - jpeg\jcdctmgr.c - Windows - Text - - - - PathRelative - Project - - jpeg\jchuff.c - Windows - Text - - - - PathRelative - Project - - jpeg\jcinit.c - Windows - Text - - - - PathRelative - Project - - jpeg\jcmainct.c - Windows - Text - - - - PathRelative - Project - - jpeg\jcmarker.c - Windows - Text - - - - PathRelative - Project - - jpeg\jcmaster.c - Windows - Text - - - - PathRelative - Project - - jpeg\jcomapi.c - Windows - Text - - - - PathRelative - Project - - jpeg\jcparam.c - Windows - Text - - - - PathRelative - Project - - jpeg\jcphuff.c - Windows - Text - - - - PathRelative - Project - - jpeg\jcprepct.c - Windows - Text - - - - PathRelative - Project - - jpeg\jcsample.c - Windows - Text - - - - PathRelative - Project - - jpeg\jctrans.c - Windows - Text - - - - PathRelative - Project - - jpeg\jdapimin.c - Windows - Text - - - - PathRelative - Project - - jpeg\jdapistd.c - Windows - Text - - - - PathRelative - Project - - jpeg\jdatadst.c - Windows - Text - - - - PathRelative - Project - - jpeg\jdatasrc.c - Windows - Text - - - - PathRelative - Project - - jpeg\jdcoefct.c - Windows - Text - - - - PathRelative - Project - - jpeg\jdcolor.c - Windows - Text - - - - PathRelative - Project - - jpeg\jddctmgr.c - Windows - Text - - - - PathRelative - Project - - jpeg\jdhuff.c - Windows - Text - - - - PathRelative - Project - - jpeg\jdinput.c - Windows - Text - - - - PathRelative - Project - - jpeg\jdmainct.c - Windows - Text - - - - PathRelative - Project - - jpeg\jdmarker.c - Windows - Text - - - - PathRelative - Project - - jpeg\jdmaster.c - Windows - Text - - - - PathRelative - Project - - jpeg\jdmerge.c - Windows - Text - - - - PathRelative - Project - - jpeg\jcapimin.c - Windows - Text - - - - PathRelative - Project - - jpeg\jdpostct.c - Windows - Text - - - - PathRelative - Project - - jpeg\jdsample.c - Windows - Text - - - - PathRelative - Project - - jpeg\jdtrans.c - Windows - Text - - - - PathRelative - Project - - jpeg\jerror.c - Windows - Text - - - - PathRelative - Project - - jpeg\jfdctflt.c - Windows - Text - - - - PathRelative - Project - - jpeg\jfdctfst.c - Windows - Text - - - - PathRelative - Project - - jpeg\jfdctint.c - Windows - Text - - - - PathRelative - Project - - jpeg\jidctflt.c - Windows - Text - - - - PathRelative - Project - - jpeg\jidctfst.c - Windows - Text - - - - PathRelative - Project - - jpeg\jidctint.c - Windows - Text - - - - PathRelative - Project - - jpeg\jidctred.c - Windows - Text - - - - PathRelative - Project - - jpeg\jmemansi.c - Windows - Text - - - - PathRelative - Project - - jpeg\jmemmgr.c - Windows - Text - - - - PathRelative - Project - - jpeg\jquant1.c - Windows - Text - - - - PathRelative - Project - - jpeg\jquant2.c - Windows - Text - - - - PathRelative - Project - - jpeg\jutils.c - Windows - Text - - - - - - PathRelative - Project - - jpeg\jdphuff.c - Windows - - - PathRelative - Project - - jpeg\jcapistd.c - Windows - - - PathRelative - Project - - jpeg\jccoefct.c - Windows - - - PathRelative - Project - - jpeg\jccolor.c - Windows - - - PathRelative - Project - - jpeg\jcdctmgr.c - Windows - - - PathRelative - Project - - jpeg\jchuff.c - Windows - - - PathRelative - Project - - jpeg\jcinit.c - Windows - - - PathRelative - Project - - jpeg\jcmainct.c - Windows - - - PathRelative - Project - - jpeg\jcmarker.c - Windows - - - PathRelative - Project - - jpeg\jcmaster.c - Windows - - - PathRelative - Project - - jpeg\jcomapi.c - Windows - - - PathRelative - Project - - jpeg\jcparam.c - Windows - - - PathRelative - Project - - jpeg\jcphuff.c - Windows - - - PathRelative - Project - - jpeg\jcprepct.c - Windows - - - PathRelative - Project - - jpeg\jcsample.c - Windows - - - PathRelative - Project - - jpeg\jctrans.c - Windows - - - PathRelative - Project - - jpeg\jdapimin.c - Windows - - - PathRelative - Project - - jpeg\jdapistd.c - Windows - - - PathRelative - Project - - jpeg\jdatadst.c - Windows - - - PathRelative - Project - - jpeg\jdatasrc.c - Windows - - - PathRelative - Project - - jpeg\jdcoefct.c - Windows - - - PathRelative - Project - - jpeg\jdcolor.c - Windows - - - PathRelative - Project - - jpeg\jddctmgr.c - Windows - - - PathRelative - Project - - jpeg\jdhuff.c - Windows - - - PathRelative - Project - - jpeg\jdinput.c - Windows - - - PathRelative - Project - - jpeg\jdmainct.c - Windows - - - PathRelative - Project - - jpeg\jdmarker.c - Windows - - - PathRelative - Project - - jpeg\jdmaster.c - Windows - - - PathRelative - Project - - jpeg\jdmerge.c - Windows - - - PathRelative - Project - - jpeg\jcapimin.c - Windows - - - PathRelative - Project - - jpeg\jdpostct.c - Windows - - - PathRelative - Project - - jpeg\jdsample.c - Windows - - - PathRelative - Project - - jpeg\jdtrans.c - Windows - - - PathRelative - Project - - jpeg\jerror.c - Windows - - - PathRelative - Project - - jpeg\jfdctflt.c - Windows - - - PathRelative - Project - - jpeg\jfdctfst.c - Windows - - - PathRelative - Project - - jpeg\jfdctint.c - Windows - - - PathRelative - Project - - jpeg\jidctflt.c - Windows - - - PathRelative - Project - - jpeg\jidctfst.c - Windows - - - PathRelative - Project - - jpeg\jidctint.c - Windows - - - PathRelative - Project - - jpeg\jidctred.c - Windows - - - PathRelative - Project - - jpeg\jmemansi.c - Windows - - - PathRelative - Project - - jpeg\jmemmgr.c - Windows - - - PathRelative - Project - - jpeg\jquant1.c - Windows - - - PathRelative - Project - - jpeg\jquant2.c - Windows - - - PathRelative - Project - - jpeg\jutils.c - Windows - - - - - copySetupRelease - - - - - png - - - - UserSourceTrees - - - AlwaysSearchUserPathstrue - InterpretDOSAndUnixPathsfalse - RequireFrameworkStyleIncludesfalse - UserSearchPaths - - SearchPath - Path..\lib\cw7msw\include - PathFormatWindows - PathRootProject - - Recursivefalse - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path..\include - PathFormatWindows - PathRootProject - - Recursivefalse - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path - PathFormatWindows - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SystemSearchPaths - - SearchPath - PathMSL - PathFormatWindows - PathRootCodeWarrior - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - PathWin32-x86 Support - PathFormatWindows - PathRootCodeWarrior - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - - - MWRuntimeSettings_WorkingDirectory - MWRuntimeSettings_CommandLine - MWRuntimeSettings_HostApplication - Path - PathFormatGeneric - PathRootAbsolute - - MWRuntimeSettings_EnvVars - - - LinkerWin32 x86 Linker - PreLinker - PostLinker - Targetnamepng - OutputDirectory - Path..\lib - PathFormatWindows - PathRootProject - - SaveEntriesUsingRelativePathstrue - - - FileMappings - - FileTypeTEXT - FileExtension.c - CompilerMW C/C++ x86 - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.c++ - CompilerMW C/C++ x86 - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.cc - CompilerMW C/C++ x86 - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.cp - CompilerMW C/C++ x86 - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.cpp - CompilerMW C/C++ x86 - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.def - Compiler - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.h - CompilerMW C/C++ x86 - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMaketrue - - - FileTypeTEXT - FileExtension.h++ - CompilerMW C/C++ x86 - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMaketrue - - - FileTypeTEXT - FileExtension.hpp - CompilerMW C/C++ x86 - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMaketrue - - - FileTypeTEXT - FileExtension.ord - Compiler - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.pch - CompilerMW C/C++ x86 - EditLanguageC/C++ - Precompiletrue - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.pch++ - CompilerMW C/C++ x86 - EditLanguageC/C++ - Precompiletrue - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.pl - CompilerMW Perl - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.rc - CompilerMW WinRC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeiLIB - FileExtension - CompilerLib Import x86 - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeiOBJ - FileExtension - CompilerObj Import x86 - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileExtension.a - CompilerLib Import x86 - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileExtension.doc - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFilefalse - IgnoredByMaketrue - - - FileExtension.lib - CompilerLib Import x86 - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileExtension.o - CompilerObj Import x86 - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileExtension.obj - CompilerObj Import x86 - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileExtension.res - CompilerWinRes Import - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - - - CacheModDatestrue - ActivateBrowsertrue - DumpBrowserInfofalse - CacheSubprojectstrue - UseThirdPartyDebuggerfalse - DebuggerAppPath - Path - PathFormatGeneric - PathRootAbsolute - - DebuggerCmdLineArgs - DebuggerWorkingDir - Path - PathFormatGeneric - PathRootAbsolute - - - - LogSystemMessagestrue - AutoTargetDLLstrue - StopAtWatchpointstrue - PauseWhileRunningfalse - PauseInterval5 - PauseUIFlags0 - AltExePath - Path - PathFormatGeneric - PathRootAbsolute - - StopAtTempBPOnLaunchtrue - CacheSymbolicstrue - TempBPFunctionNamemain - TempBPType0 - - - Enabledfalse - ConnectionName - DownloadPath - LaunchRemoteAppfalse - RemoteAppPath - - - OtherExecutables - - - CustomColor1 - Red0 - Green32767 - Blue0 - - CustomColor2 - Red0 - Green32767 - Blue0 - - CustomColor3 - Red0 - Green32767 - Blue0 - - CustomColor4 - Red0 - Green32767 - Blue0 - - - - Perl_Prefix_Filename - - - MWCodeGen_PPC_structalignmentMC68K - MWCodeGen_PPC_tracebacktablesNone - MWCodeGen_PPC_processorGeneric - MWCodeGen_PPC_readonlystrings0 - MWCodeGen_PPC_tocdata1 - MWCodeGen_PPC_profiler0 - MWCodeGen_PPC_fpcontract1 - MWCodeGen_PPC_schedule0 - MWCodeGen_PPC_peephole1 - MWCodeGen_PPC_processorspecific0 - MWCodeGen_PPC_altivec0 - MWCodeGen_PPC_vectortocdata1 - MWCodeGen_PPC_vrsave1 - - - MWCodeGen_X86_processorPentiumII - MWCodeGen_X86_alignmentbytes8 - MWCodeGen_X86_exceptionsZeroOverhead - MWCodeGen_X86_extinst_mmx0 - MWCodeGen_X86_extinst_3dnow0 - MWCodeGen_X86_use_mmx_3dnow_convention0 - MWCodeGen_X86_machinecodelisting0 - MWCodeGen_X86_intrinsics0 - MWCodeGen_X86_syminfo0 - MWCodeGen_X86_codeviewinfo0 - MWCodeGen_X86_extinst_cmov_fcomi0 - MWCodeGen_X86_extinst_sse0 - - - MWDebugger_X86_Exceptions - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - - - - PDisasmX86_showHeaderstrue - PDisasmX86_showSymTabtrue - PDisasmX86_showCodetrue - PDisasmX86_showSourcefalse - PDisasmX86_showHextrue - PDisasmX86_showRelocationtrue - PDisasmX86_showCommentsfalse - PDisasmX86_showDebugfalse - PDisasmX86_showExceptionsfalse - PDisasmX86_showDatatrue - PDisasmX86_showRawfalse - PDisasmX86_verbosetrue - - - MWDisassembler_PPC_showcode1 - MWDisassembler_PPC_extended1 - MWDisassembler_PPC_mix0 - MWDisassembler_PPC_nohex0 - MWDisassembler_PPC_showdata1 - MWDisassembler_PPC_showexceptions1 - MWDisassembler_PPC_showsym0 - MWDisassembler_PPC_shownames1 - - - MWFrontEnd_C_cplusplus0 - MWFrontEnd_C_checkprotos0 - MWFrontEnd_C_arm0 - MWFrontEnd_C_trigraphs0 - MWFrontEnd_C_onlystdkeywords0 - MWFrontEnd_C_enumsalwaysint0 - MWFrontEnd_C_mpwpointerstyle0 - MWFrontEnd_C_prefixname - MWFrontEnd_C_ansistrict0 - MWFrontEnd_C_mpwcnewline0 - MWFrontEnd_C_wchar_type1 - MWFrontEnd_C_enableexceptions1 - MWFrontEnd_C_dontreusestrings0 - MWFrontEnd_C_poolstrings0 - MWFrontEnd_C_dontinline0 - MWFrontEnd_C_useRTTI1 - MWFrontEnd_C_multibyteaware0 - MWFrontEnd_C_unsignedchars0 - MWFrontEnd_C_autoinline0 - MWFrontEnd_C_booltruefalse1 - MWFrontEnd_C_direct_to_som0 - MWFrontEnd_C_som_env_check0 - MWFrontEnd_C_alwaysinline0 - MWFrontEnd_C_inlinelevel0 - MWFrontEnd_C_ecplusplus0 - MWFrontEnd_C_objective_c0 - MWFrontEnd_C_defer_codegen1 - - - MWFTP_Post_hostName - MWFTP_Post_username - MWFTP_Post_password0 - MWFTP_Post_remoteDir - MWFTP_Post_ftp_PathVersion0 - MWFTP_Post_ftp_PathType0 - MWFTP_Post_ftp_PathFormat0 - MWFTP_Post_ftp_tree - MWFTP_Post_uploadDir - MWFTP_Post_ftp_port21 - MWFTP_Post_SendBin1 - MWFTP_Post_ShouldLog1 - - - MWCommandLine_Java_clsName - MWCommandLine_Java_args - - - MWVJavaDebugging_Protocol1 - MWVJavaDebugging_JDKVersion1 - MWVJavaDebugging_TimeOut25 - MWVJavaDebugging_SupportSlowDevicesfalse - - - MWJavaDoc_Proj_Version1 - MWJavaDoc_Proj_Depricated1 - MWJavaDoc_Proj_Author1 - MWJavaDoc_Proj_Index1 - MWJavaDoc_Proj_Tree1 - MWJavaDoc_Proj_SunResolveToSame0 - MWJavaDoc_Proj_Shortnames0 - MWJavaDoc_Proj_Folder0 - MWJavaDoc_Proj_GenerateAPILinks0 - MWJavaDoc_Proj_scopePublic - MWJavaDoc_Proj_encodingName - MWJavaDoc_Proj_decodingName - MWJavaDoc_Proj_javaPackagePathhttp://java.sun.com/products/jdk/1.1/docs/api/ - - - MWJava_Language_optimizefalse - MWJava_Language_warnDeprecatedfalse - MWJava_Language_emitMapfalse - MWJava_Language_strictFileNamesfalse - MWJava_Language_strictFileHierarchyfalse - MWJava_Language_1_1_Compatiblefalse - MWJava_Language_emitHeaders0 - MWJava_Language_headerTypeJNINativeHeaders - MWJava_Language_packageFilter - MWJava_Language_genCommentstrue - MWJava_Language_genHeadersfalse - - - MWJava_Output_outputtypeJarFile - MWJava_Output_outfileJavaClasses.jar - MWJava_Output_ftype1514754080 - MWJava_Output_fcreator1297570384 - MWJava_Output_compress0 - MWJava_Output_genManifest0 - MWJava_Output_trunctypeFront - MWJava_Output_deleteClasses0 - MWJava_Output_consoleApp1 - - - MWJava_Proj_projtypeApplet - MWJava_Proj_mainClassName - MWJava_Proj_HTMLAppCreator1463898714 - MWJava_Proj_HTMLAppName - MWJava_Proj_PathVersion0 - MWJava_Proj_PathType0 - MWJava_Proj_PathFormat0 - MWJava_Proj_tree - MWJava_Proj_HTMLAppWin32Name - MWJava_Proj_compress0 - MWJava_Proj_useVM1 - MWJava_Proj_vmarguments - MWJava_Proj_vmName - MWJava_Proj_simPropFile - MWJava_Proj_useJCVM1 - MWJava_Proj_aidData - - - MWLinker_PPC_linksym1 - MWLinker_PPC_symfullpath1 - MWLinker_PPC_linkmap0 - MWLinker_PPC_nolinkwarnings0 - MWLinker_PPC_dontdeadstripinitcode0 - MWLinker_PPC_permitmultdefs0 - MWLinker_PPC_linkmodeFast - MWLinker_PPC_initname - MWLinker_PPC_mainname__start - MWLinker_PPC_termname - - - MWLinker_X86_entrypointusageDefault - MWLinker_X86_entrypoint - MWLinker_X86_subsystemWinGUI - MWLinker_X86_subsysmajorid4 - MWLinker_X86_subsysminorid0 - MWLinker_X86_usrmajorid0 - MWLinker_X86_usrminorid0 - MWLinker_X86_commandfile - MWLinker_X86_generatemap0 - MWLinker_X86_linksym0 - MWLinker_X86_linkCV0 - - - MWMerge_MacOS_projectTypeApplication - MWMerge_MacOS_outputNameMerge Out - MWMerge_MacOS_outputCreator???? - MWMerge_MacOS_outputTypeAPPL - MWMerge_MacOS_suppressWarning0 - MWMerge_MacOS_copyFragments1 - MWMerge_MacOS_copyResources1 - MWMerge_MacOS_flattenResource0 - MWMerge_MacOS_flatFileNamea.rsrc - MWMerge_MacOS_flatFileOutputPath - Path: - PathFormatMacOS - PathRootProject - - MWMerge_MacOS_skipResources - DGLX - ckid - Proj - WSPC - mcvs - - - - MWMacOSPackager_UsePackager0 - MWMacOSPackager_FolderToPackage - Path: - PathFormatMacOS - PathRootProject - - MWMacOSPackager_CreateClassicAlias0 - MWMacOSPackager_ClassicAliasMethodUseTargetOutput - MWMacOSPackager_ClassicAliasPath - Path: - PathFormatMacOS - PathRootProject - - MWMacOSPackager_CreatePkgInfo0 - MWMacOSPackager_PkgCreatorType???? - MWMacOSPackager_PkgFileTypeLPPA - - - MWPEF_exportsNone - MWPEF_libfolder0 - MWPEF_sortcodeNone - MWPEF_expandbss0 - MWPEF_sharedata0 - MWPEF_olddefversion0 - MWPEF_oldimpversion0 - MWPEF_currentversion0 - MWPEF_fragmentname - MWPEF_collapsereloads0 - - - MWAssembler_PPC_auxheader0 - MWAssembler_PPC_symmodeMac - MWAssembler_PPC_dialectPPC - MWAssembler_PPC_prefixfile - MWAssembler_PPC_typecheck0 - MWAssembler_PPC_warnings0 - MWAssembler_PPC_casesensitive0 - - - GlobalOptimizer_PPC_optimizationlevelLevel0 - GlobalOptimizer_PPC_optforSpeed - - - MWProject_PPC_typeApplication - MWProject_PPC_outfilea.out - MWProject_PPC_filecreator???? - MWProject_PPC_filetypeAPPL - MWProject_PPC_size384 - MWProject_PPC_minsize384 - MWProject_PPC_stacksize64 - MWProject_PPC_flags22720 - MWProject_PPC_symfilename - MWProject_PPC_rsrcname - MWProject_PPC_rsrcheaderNative - MWProject_PPC_rsrctype???? - MWProject_PPC_rsrcid0 - MWProject_PPC_rsrcflags0 - MWProject_PPC_rsrcstore0 - MWProject_PPC_rsrcmerge0 - MWProject_PPC_flatrsrc0 - MWProject_PPC_flatrsrcoutputdir - Path: - PathFormatMacOS - PathRootProject - - MWProject_PPC_flatrsrcfilename - - - MWProject_X86_typeLibrary - MWProject_X86_outfilepng.lib - MWProject_X86_baseaddress4194304 - MWProject_X86_maxstacksize1024 - MWProject_X86_minstacksize4 - MWProject_X86_size1024 - MWProject_X86_minsize4 - MWProject_X86_importlib - Resource Flattener Panel - 0100000000000000000000000000000000000000000000000000000000000000 - 0000074F75742E62696E00000000000000000000000000000000000000000000 - 0000 - - - - MWRez_Language_maxwidth80 - MWRez_Language_scriptRoman - MWRez_Language_alignmentAlign1 - MWRez_Language_filtermodeFilterSkip - MWRez_Language_suppresswarnings0 - MWRez_Language_escapecontrolchars1 - MWRez_Language_prefixname - MWRez_Language_filteredtypes'CODE' 'DATA' 'PICT' - - - MWWarning_C_warn_illpragma0 - MWWarning_C_warn_emptydecl0 - MWWarning_C_warn_possunwant0 - MWWarning_C_warn_unusedvar0 - MWWarning_C_warn_unusedarg0 - MWWarning_C_warn_extracomma0 - MWWarning_C_pedantic0 - MWWarning_C_warningerrors0 - MWWarning_C_warn_hidevirtual0 - MWWarning_C_warn_implicitconv0 - MWWarning_C_warn_notinlined0 - MWWarning_C_warn_structclass0 - - - MWWinRC_prefixname - - - GlobalOptimizer_X86__optimizationlevelLevel4 - GlobalOptimizer_X86__optforSpeed - - - - PathRelative - Project - - png\pngtrans.c - Windows - Text - - - - PathRelative - Project - - png\pngerror.c - Windows - Text - - - - PathRelative - Project - - png\pngget.c - Windows - Text - - - - PathRelative - Project - - png\pngmem.c - Windows - Text - - - - PathRelative - Project - - png\pngpread.c - Windows - Text - - - - PathRelative - Project - - png\pngread.c - Windows - Text - - - - PathRelative - Project - - png\pngrio.c - Windows - Text - - - - PathRelative - Project - - png\pngrtran.c - Windows - Text - - - - PathRelative - Project - - png\pngrutil.c - Windows - Text - - - - PathRelative - Project - - png\pngset.c - Windows - Text - - - - PathRelative - Project - - png\png.c - Windows - Text - - - - PathRelative - Project - - png\pngwio.c - Windows - Text - - - - PathRelative - Project - - png\pngwrite.c - Windows - Text - - - - PathRelative - Project - - png\pngwtran.c - Windows - Text - - - - PathRelative - Project - - png\pngwutil.c - Windows - Text - - - - - - PathRelative - Project - - png\pngtrans.c - Windows - - - PathRelative - Project - - png\pngerror.c - Windows - - - PathRelative - Project - - png\pngget.c - Windows - - - PathRelative - Project - - png\pngmem.c - Windows - - - PathRelative - Project - - png\pngpread.c - Windows - - - PathRelative - Project - - png\pngread.c - Windows - - - PathRelative - Project - - png\pngrio.c - Windows - - - PathRelative - Project - - png\pngrtran.c - Windows - - - PathRelative - Project - - png\pngrutil.c - Windows - - - PathRelative - Project - - png\pngset.c - Windows - - - PathRelative - Project - - png\png.c - Windows - - - PathRelative - Project - - png\pngwio.c - Windows - - - PathRelative - Project - - png\pngwrite.c - Windows - - - PathRelative - Project - - png\pngwtran.c - Windows - - - PathRelative - Project - - png\pngwutil.c - Windows - - - - - copySetupRelease - - - - - tiff - - - - UserSourceTrees - - - AlwaysSearchUserPathstrue - InterpretDOSAndUnixPathsfalse - RequireFrameworkStyleIncludesfalse - UserSearchPaths - - SearchPath - Path..\lib\cw7msw\include - PathFormatWindows - PathRootProject - - Recursivefalse - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path..\include - PathFormatWindows - PathRootProject - - Recursivefalse - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path - PathFormatWindows - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SystemSearchPaths - - SearchPath - PathMSL - PathFormatWindows - PathRootCodeWarrior - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - PathWin32-x86 Support - PathFormatWindows - PathRootCodeWarrior - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - - - MWRuntimeSettings_WorkingDirectory - MWRuntimeSettings_CommandLine - MWRuntimeSettings_HostApplication - Path - PathFormatGeneric - PathRootAbsolute - - MWRuntimeSettings_EnvVars - - - LinkerWin32 x86 Linker - PreLinker - PostLinker - Targetnametiff - OutputDirectory - Path..\lib - PathFormatWindows - PathRootProject - - SaveEntriesUsingRelativePathstrue - - - FileMappings - - FileTypeTEXT - FileExtension.c - CompilerMW C/C++ x86 - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.c++ - CompilerMW C/C++ x86 - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.cc - CompilerMW C/C++ x86 - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.cp - CompilerMW C/C++ x86 - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.cpp - CompilerMW C/C++ x86 - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.def - Compiler - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.h - CompilerMW C/C++ x86 - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMaketrue - - - FileTypeTEXT - FileExtension.h++ - CompilerMW C/C++ x86 - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMaketrue - - - FileTypeTEXT - FileExtension.hpp - CompilerMW C/C++ x86 - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMaketrue - - - FileTypeTEXT - FileExtension.ord - Compiler - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.pch - CompilerMW C/C++ x86 - EditLanguageC/C++ - Precompiletrue - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.pch++ - CompilerMW C/C++ x86 - EditLanguageC/C++ - Precompiletrue - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.pl - CompilerMW Perl - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.rc - CompilerMW WinRC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeiLIB - FileExtension - CompilerLib Import x86 - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeiOBJ - FileExtension - CompilerObj Import x86 - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileExtension.a - CompilerLib Import x86 - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileExtension.doc - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFilefalse - IgnoredByMaketrue - - - FileExtension.lib - CompilerLib Import x86 - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileExtension.o - CompilerObj Import x86 - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileExtension.obj - CompilerObj Import x86 - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileExtension.res - CompilerWinRes Import - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - - - CacheModDatestrue - ActivateBrowsertrue - DumpBrowserInfofalse - CacheSubprojectstrue - UseThirdPartyDebuggerfalse - DebuggerAppPath - Path - PathFormatGeneric - PathRootAbsolute - - DebuggerCmdLineArgs - DebuggerWorkingDir - Path - PathFormatGeneric - PathRootAbsolute - - - - LogSystemMessagestrue - AutoTargetDLLstrue - StopAtWatchpointstrue - PauseWhileRunningfalse - PauseInterval5 - PauseUIFlags0 - AltExePath - Path - PathFormatGeneric - PathRootAbsolute - - StopAtTempBPOnLaunchtrue - CacheSymbolicstrue - TempBPFunctionNamemain - TempBPType0 - - - Enabledfalse - ConnectionName - DownloadPath - LaunchRemoteAppfalse - RemoteAppPath - - - OtherExecutables - - - CustomColor1 - Red0 - Green32767 - Blue0 - - CustomColor2 - Red0 - Green32767 - Blue0 - - CustomColor3 - Red0 - Green32767 - Blue0 - - CustomColor4 - Red0 - Green32767 - Blue0 - - - - Perl_Prefix_Filename - - - MWCodeGen_PPC_structalignmentMC68K - MWCodeGen_PPC_tracebacktablesNone - MWCodeGen_PPC_processorGeneric - MWCodeGen_PPC_readonlystrings0 - MWCodeGen_PPC_tocdata1 - MWCodeGen_PPC_profiler0 - MWCodeGen_PPC_fpcontract1 - MWCodeGen_PPC_schedule0 - MWCodeGen_PPC_peephole1 - MWCodeGen_PPC_processorspecific0 - MWCodeGen_PPC_altivec0 - MWCodeGen_PPC_vectortocdata1 - MWCodeGen_PPC_vrsave1 - - - MWCodeGen_X86_processorPentiumII - MWCodeGen_X86_alignmentbytes8 - MWCodeGen_X86_exceptionsZeroOverhead - MWCodeGen_X86_extinst_mmx0 - MWCodeGen_X86_extinst_3dnow0 - MWCodeGen_X86_use_mmx_3dnow_convention0 - MWCodeGen_X86_machinecodelisting0 - MWCodeGen_X86_intrinsics0 - MWCodeGen_X86_syminfo0 - MWCodeGen_X86_codeviewinfo0 - MWCodeGen_X86_extinst_cmov_fcomi0 - MWCodeGen_X86_extinst_sse0 - - - MWDebugger_X86_Exceptions - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - - - - PDisasmX86_showHeaderstrue - PDisasmX86_showSymTabtrue - PDisasmX86_showCodetrue - PDisasmX86_showSourcefalse - PDisasmX86_showHextrue - PDisasmX86_showRelocationtrue - PDisasmX86_showCommentsfalse - PDisasmX86_showDebugfalse - PDisasmX86_showExceptionsfalse - PDisasmX86_showDatatrue - PDisasmX86_showRawfalse - PDisasmX86_verbosetrue - - - MWDisassembler_PPC_showcode1 - MWDisassembler_PPC_extended1 - MWDisassembler_PPC_mix0 - MWDisassembler_PPC_nohex0 - MWDisassembler_PPC_showdata1 - MWDisassembler_PPC_showexceptions1 - MWDisassembler_PPC_showsym0 - MWDisassembler_PPC_shownames1 - - - MWFrontEnd_C_cplusplus0 - MWFrontEnd_C_checkprotos0 - MWFrontEnd_C_arm0 - MWFrontEnd_C_trigraphs0 - MWFrontEnd_C_onlystdkeywords0 - MWFrontEnd_C_enumsalwaysint0 - MWFrontEnd_C_mpwpointerstyle0 - MWFrontEnd_C_prefixnametiff_CW_Prefix.h - MWFrontEnd_C_ansistrict0 - MWFrontEnd_C_mpwcnewline0 - MWFrontEnd_C_wchar_type1 - MWFrontEnd_C_enableexceptions1 - MWFrontEnd_C_dontreusestrings0 - MWFrontEnd_C_poolstrings0 - MWFrontEnd_C_dontinline0 - MWFrontEnd_C_useRTTI1 - MWFrontEnd_C_multibyteaware0 - MWFrontEnd_C_unsignedchars0 - MWFrontEnd_C_autoinline0 - MWFrontEnd_C_booltruefalse1 - MWFrontEnd_C_direct_to_som0 - MWFrontEnd_C_som_env_check0 - MWFrontEnd_C_alwaysinline0 - MWFrontEnd_C_inlinelevel0 - MWFrontEnd_C_ecplusplus0 - MWFrontEnd_C_objective_c0 - MWFrontEnd_C_defer_codegen1 - - - MWFTP_Post_hostName - MWFTP_Post_username - MWFTP_Post_password0 - MWFTP_Post_remoteDir - MWFTP_Post_ftp_PathVersion0 - MWFTP_Post_ftp_PathType0 - MWFTP_Post_ftp_PathFormat0 - MWFTP_Post_ftp_tree - MWFTP_Post_uploadDir - MWFTP_Post_ftp_port21 - MWFTP_Post_SendBin1 - MWFTP_Post_ShouldLog1 - - - MWCommandLine_Java_clsName - MWCommandLine_Java_args - - - MWVJavaDebugging_Protocol1 - MWVJavaDebugging_JDKVersion1 - MWVJavaDebugging_TimeOut25 - MWVJavaDebugging_SupportSlowDevicesfalse - - - MWJavaDoc_Proj_Version1 - MWJavaDoc_Proj_Depricated1 - MWJavaDoc_Proj_Author1 - MWJavaDoc_Proj_Index1 - MWJavaDoc_Proj_Tree1 - MWJavaDoc_Proj_SunResolveToSame0 - MWJavaDoc_Proj_Shortnames0 - MWJavaDoc_Proj_Folder0 - MWJavaDoc_Proj_GenerateAPILinks0 - MWJavaDoc_Proj_scopePublic - MWJavaDoc_Proj_encodingName - MWJavaDoc_Proj_decodingName - MWJavaDoc_Proj_javaPackagePathhttp://java.sun.com/products/jdk/1.1/docs/api/ - - - MWJava_Language_optimizefalse - MWJava_Language_warnDeprecatedfalse - MWJava_Language_emitMapfalse - MWJava_Language_strictFileNamesfalse - MWJava_Language_strictFileHierarchyfalse - MWJava_Language_1_1_Compatiblefalse - MWJava_Language_emitHeaders0 - MWJava_Language_headerTypeJNINativeHeaders - MWJava_Language_packageFilter - MWJava_Language_genCommentstrue - MWJava_Language_genHeadersfalse - - - MWJava_Output_outputtypeJarFile - MWJava_Output_outfileJavaClasses.jar - MWJava_Output_ftype1514754080 - MWJava_Output_fcreator1297570384 - MWJava_Output_compress0 - MWJava_Output_genManifest0 - MWJava_Output_trunctypeFront - MWJava_Output_deleteClasses0 - MWJava_Output_consoleApp1 - - - MWJava_Proj_projtypeApplet - MWJava_Proj_mainClassName - MWJava_Proj_HTMLAppCreator1463898714 - MWJava_Proj_HTMLAppName - MWJava_Proj_PathVersion0 - MWJava_Proj_PathType0 - MWJava_Proj_PathFormat0 - MWJava_Proj_tree - MWJava_Proj_HTMLAppWin32Name - MWJava_Proj_compress0 - MWJava_Proj_useVM1 - MWJava_Proj_vmarguments - MWJava_Proj_vmName - MWJava_Proj_simPropFile - MWJava_Proj_useJCVM1 - MWJava_Proj_aidData - - - MWLinker_PPC_linksym1 - MWLinker_PPC_symfullpath1 - MWLinker_PPC_linkmap0 - MWLinker_PPC_nolinkwarnings0 - MWLinker_PPC_dontdeadstripinitcode0 - MWLinker_PPC_permitmultdefs0 - MWLinker_PPC_linkmodeFast - MWLinker_PPC_initname - MWLinker_PPC_mainname__start - MWLinker_PPC_termname - - - MWLinker_X86_entrypointusageDefault - MWLinker_X86_entrypoint - MWLinker_X86_subsystemWinGUI - MWLinker_X86_subsysmajorid4 - MWLinker_X86_subsysminorid0 - MWLinker_X86_usrmajorid0 - MWLinker_X86_usrminorid0 - MWLinker_X86_commandfile - MWLinker_X86_generatemap0 - MWLinker_X86_linksym0 - MWLinker_X86_linkCV0 - - - MWMerge_MacOS_projectTypeApplication - MWMerge_MacOS_outputNameMerge Out - MWMerge_MacOS_outputCreator???? - MWMerge_MacOS_outputTypeAPPL - MWMerge_MacOS_suppressWarning0 - MWMerge_MacOS_copyFragments1 - MWMerge_MacOS_copyResources1 - MWMerge_MacOS_flattenResource0 - MWMerge_MacOS_flatFileNamea.rsrc - MWMerge_MacOS_flatFileOutputPath - Path: - PathFormatMacOS - PathRootProject - - MWMerge_MacOS_skipResources - DGLX - ckid - Proj - WSPC - mcvs - - - - MWMacOSPackager_UsePackager0 - MWMacOSPackager_FolderToPackage - Path: - PathFormatMacOS - PathRootProject - - MWMacOSPackager_CreateClassicAlias0 - MWMacOSPackager_ClassicAliasMethodUseTargetOutput - MWMacOSPackager_ClassicAliasPath - Path: - PathFormatMacOS - PathRootProject - - MWMacOSPackager_CreatePkgInfo0 - MWMacOSPackager_PkgCreatorType???? - MWMacOSPackager_PkgFileTypeLPPA - - - MWPEF_exportsNone - MWPEF_libfolder0 - MWPEF_sortcodeNone - MWPEF_expandbss0 - MWPEF_sharedata0 - MWPEF_olddefversion0 - MWPEF_oldimpversion0 - MWPEF_currentversion0 - MWPEF_fragmentname - MWPEF_collapsereloads0 - - - MWAssembler_PPC_auxheader0 - MWAssembler_PPC_symmodeMac - MWAssembler_PPC_dialectPPC - MWAssembler_PPC_prefixfile - MWAssembler_PPC_typecheck0 - MWAssembler_PPC_warnings0 - MWAssembler_PPC_casesensitive0 - - - GlobalOptimizer_PPC_optimizationlevelLevel0 - GlobalOptimizer_PPC_optforSpeed - - - MWProject_PPC_typeApplication - MWProject_PPC_outfilea.out - MWProject_PPC_filecreator???? - MWProject_PPC_filetypeAPPL - MWProject_PPC_size384 - MWProject_PPC_minsize384 - MWProject_PPC_stacksize64 - MWProject_PPC_flags22720 - MWProject_PPC_symfilename - MWProject_PPC_rsrcname - MWProject_PPC_rsrcheaderNative - MWProject_PPC_rsrctype???? - MWProject_PPC_rsrcid0 - MWProject_PPC_rsrcflags0 - MWProject_PPC_rsrcstore0 - MWProject_PPC_rsrcmerge0 - MWProject_PPC_flatrsrc0 - MWProject_PPC_flatrsrcoutputdir - Path: - PathFormatMacOS - PathRootProject - - MWProject_PPC_flatrsrcfilename - - - MWProject_X86_typeLibrary - MWProject_X86_outfiletiff.lib - MWProject_X86_baseaddress4194304 - MWProject_X86_maxstacksize1024 - MWProject_X86_minstacksize4 - MWProject_X86_size1024 - MWProject_X86_minsize4 - MWProject_X86_importlib - Resource Flattener Panel - 0100000000000000000000000000000000000000000000000000000000000000 - 0000074F75742E62696E00000000000000000000000000000000000000000000 - 0000 - - - - MWRez_Language_maxwidth80 - MWRez_Language_scriptRoman - MWRez_Language_alignmentAlign1 - MWRez_Language_filtermodeFilterSkip - MWRez_Language_suppresswarnings0 - MWRez_Language_escapecontrolchars1 - MWRez_Language_prefixname - MWRez_Language_filteredtypes'CODE' 'DATA' 'PICT' - - - MWWarning_C_warn_illpragma0 - MWWarning_C_warn_emptydecl0 - MWWarning_C_warn_possunwant0 - MWWarning_C_warn_unusedvar0 - MWWarning_C_warn_unusedarg0 - MWWarning_C_warn_extracomma0 - MWWarning_C_pedantic0 - MWWarning_C_warningerrors0 - MWWarning_C_warn_hidevirtual0 - MWWarning_C_warn_implicitconv0 - MWWarning_C_warn_notinlined0 - MWWarning_C_warn_structclass0 - - - MWWinRC_prefixname - - - GlobalOptimizer_X86__optimizationlevelLevel4 - GlobalOptimizer_X86__optforSpeed - - - - PathRelative - Project - - tiff\tif_next.c - Windows - Text - - - - PathRelative - Project - - tiff\tif_close.c - Windows - Text - - - - PathRelative - Project - - tiff\tif_codec.c - Windows - Text - - - - PathRelative - Project - - tiff\tif_compress.c - Windows - Text - - - - PathRelative - Project - - tiff\tif_dir.c - Windows - Text - - - - PathRelative - Project - - tiff\tif_dirinfo.c - Windows - Text - - - - PathRelative - Project - - tiff\tif_dirread.c - Windows - Text - - - - PathRelative - Project - - tiff\tif_dirwrite.c - Windows - Text - - - - PathRelative - Project - - tiff\tif_dumpmode.c - Windows - Text - - - - PathRelative - Project - - tiff\tif_error.c - Windows - Text - - - - PathRelative - Project - - tiff\tif_fax3.c - Windows - Text - - - - PathRelative - Project - - tiff\tif_fax3sm.c - Windows - Text - - - - PathRelative - Project - - tiff\tif_flush.c - Windows - Text - - - - PathRelative - Project - - tiff\tif_getimage.c - Windows - Text - - - - PathRelative - Project - - tiff\tif_jpeg.c - Windows - Text - - - - PathRelative - Project - - tiff\tif_luv.c - Windows - Text - - - - PathRelative - Project - - tiff\tif_lzw.c - Windows - Text - - - - PathRelative - Project - - tiff\tif_aux.c - Windows - Text - - - - PathRelative - Project - - tiff\tif_open.c - Windows - Text - - - - PathRelative - Project - - tiff\tif_packbits.c - Windows - Text - - - - PathRelative - Project - - tiff\tif_pixarlog.c - Windows - Text - - - - PathRelative - Project - - tiff\tif_predict.c - Windows - Text - - - - PathRelative - Project - - tiff\tif_print.c - Windows - Text - - - - PathRelative - Project - - tiff\tif_read.c - Windows - Text - - - - PathRelative - Project - - tiff\tif_strip.c - Windows - Text - - - - PathRelative - Project - - tiff\tif_swab.c - Windows - Text - - - - PathRelative - Project - - tiff\tif_thunder.c - Windows - Text - - - - PathRelative - Project - - tiff\tif_tile.c - Windows - Text - - - - PathRelative - Project - - tiff\tif_version.c - Windows - Text - - - - PathRelative - Project - - tiff\tif_warning.c - Windows - Text - - - - PathRelative - Project - - tiff\tif_win32.c - Windows - Text - - - - PathRelative - Project - - tiff\tif_write.c - Windows - Text - - - - PathRelative - Project - - tiff\tif_zip.c - Windows - Text - - - - - - PathRelative - Project - - tiff\tif_next.c - Windows - - - PathRelative - Project - - tiff\tif_close.c - Windows - - - PathRelative - Project - - tiff\tif_codec.c - Windows - - - PathRelative - Project - - tiff\tif_compress.c - Windows - - - PathRelative - Project - - tiff\tif_dir.c - Windows - - - PathRelative - Project - - tiff\tif_dirinfo.c - Windows - - - PathRelative - Project - - tiff\tif_dirread.c - Windows - - - PathRelative - Project - - tiff\tif_dirwrite.c - Windows - - - PathRelative - Project - - tiff\tif_dumpmode.c - Windows - - - PathRelative - Project - - tiff\tif_error.c - Windows - - - PathRelative - Project - - tiff\tif_fax3.c - Windows - - - PathRelative - Project - - tiff\tif_fax3sm.c - Windows - - - PathRelative - Project - - tiff\tif_flush.c - Windows - - - PathRelative - Project - - tiff\tif_getimage.c - Windows - - - PathRelative - Project - - tiff\tif_jpeg.c - Windows - - - PathRelative - Project - - tiff\tif_luv.c - Windows - - - PathRelative - Project - - tiff\tif_lzw.c - Windows - - - PathRelative - Project - - tiff\tif_aux.c - Windows - - - PathRelative - Project - - tiff\tif_open.c - Windows - - - PathRelative - Project - - tiff\tif_packbits.c - Windows - - - PathRelative - Project - - tiff\tif_pixarlog.c - Windows - - - PathRelative - Project - - tiff\tif_predict.c - Windows - - - PathRelative - Project - - tiff\tif_print.c - Windows - - - PathRelative - Project - - tiff\tif_read.c - Windows - - - PathRelative - Project - - tiff\tif_strip.c - Windows - - - PathRelative - Project - - tiff\tif_swab.c - Windows - - - PathRelative - Project - - tiff\tif_thunder.c - Windows - - - PathRelative - Project - - tiff\tif_tile.c - Windows - - - PathRelative - Project - - tiff\tif_version.c - Windows - - - PathRelative - Project - - tiff\tif_warning.c - Windows - - - PathRelative - Project - - tiff\tif_win32.c - Windows - - - PathRelative - Project - - tiff\tif_write.c - Windows - - - PathRelative - Project - - tiff\tif_zip.c - Windows - - - - - copySetupRelease - - - - - zlib - - - - UserSourceTrees - - - AlwaysSearchUserPathstrue - InterpretDOSAndUnixPathsfalse - RequireFrameworkStyleIncludesfalse - UserSearchPaths - - SearchPath - Path..\lib\cw7msw\include - PathFormatWindows - PathRootProject - - Recursivefalse - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path..\include - PathFormatWindows - PathRootProject - - Recursivefalse - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path - PathFormatWindows - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SystemSearchPaths - - SearchPath - PathMSL - PathFormatWindows - PathRootCodeWarrior - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - PathWin32-x86 Support - PathFormatWindows - PathRootCodeWarrior - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - - - MWRuntimeSettings_WorkingDirectory - MWRuntimeSettings_CommandLine - MWRuntimeSettings_HostApplication - Path - PathFormatGeneric - PathRootAbsolute - - MWRuntimeSettings_EnvVars - - - LinkerWin32 x86 Linker - PreLinker - PostLinker - Targetnamezlib - OutputDirectory - Path..\lib - PathFormatWindows - PathRootProject - - SaveEntriesUsingRelativePathstrue - - - FileMappings - - FileTypeTEXT - FileExtension.c - CompilerMW C/C++ x86 - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.c++ - CompilerMW C/C++ x86 - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.cc - CompilerMW C/C++ x86 - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.cp - CompilerMW C/C++ x86 - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.cpp - CompilerMW C/C++ x86 - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.def - Compiler - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.h - CompilerMW C/C++ x86 - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMaketrue - - - FileTypeTEXT - FileExtension.h++ - CompilerMW C/C++ x86 - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMaketrue - - - FileTypeTEXT - FileExtension.hpp - CompilerMW C/C++ x86 - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMaketrue - - - FileTypeTEXT - FileExtension.ord - Compiler - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.pch - CompilerMW C/C++ x86 - EditLanguageC/C++ - Precompiletrue - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.pch++ - CompilerMW C/C++ x86 - EditLanguageC/C++ - Precompiletrue - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.pl - CompilerMW Perl - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.rc - CompilerMW WinRC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeiLIB - FileExtension - CompilerLib Import x86 - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeiOBJ - FileExtension - CompilerObj Import x86 - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileExtension.a - CompilerLib Import x86 - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileExtension.doc - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFilefalse - IgnoredByMaketrue - - - FileExtension.lib - CompilerLib Import x86 - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileExtension.o - CompilerObj Import x86 - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileExtension.obj - CompilerObj Import x86 - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileExtension.res - CompilerWinRes Import - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - - - CacheModDatestrue - ActivateBrowsertrue - DumpBrowserInfofalse - CacheSubprojectstrue - UseThirdPartyDebuggerfalse - DebuggerAppPath - Path - PathFormatGeneric - PathRootAbsolute - - DebuggerCmdLineArgs - DebuggerWorkingDir - Path - PathFormatGeneric - PathRootAbsolute - - - - LogSystemMessagestrue - AutoTargetDLLstrue - StopAtWatchpointstrue - PauseWhileRunningfalse - PauseInterval5 - PauseUIFlags0 - AltExePath - Path - PathFormatGeneric - PathRootAbsolute - - StopAtTempBPOnLaunchtrue - CacheSymbolicstrue - TempBPFunctionNamemain - TempBPType0 - - - Enabledfalse - ConnectionName - DownloadPath - LaunchRemoteAppfalse - RemoteAppPath - - - OtherExecutables - - - CustomColor1 - Red0 - Green32767 - Blue0 - - CustomColor2 - Red0 - Green32767 - Blue0 - - CustomColor3 - Red0 - Green32767 - Blue0 - - CustomColor4 - Red0 - Green32767 - Blue0 - - - - Perl_Prefix_Filename - - - MWCodeGen_PPC_structalignmentMC68K - MWCodeGen_PPC_tracebacktablesNone - MWCodeGen_PPC_processorGeneric - MWCodeGen_PPC_readonlystrings0 - MWCodeGen_PPC_tocdata1 - MWCodeGen_PPC_profiler0 - MWCodeGen_PPC_fpcontract1 - MWCodeGen_PPC_schedule0 - MWCodeGen_PPC_peephole1 - MWCodeGen_PPC_processorspecific0 - MWCodeGen_PPC_altivec0 - MWCodeGen_PPC_vectortocdata1 - MWCodeGen_PPC_vrsave1 - - - MWCodeGen_X86_processorPentiumII - MWCodeGen_X86_alignmentbytes8 - MWCodeGen_X86_exceptionsZeroOverhead - MWCodeGen_X86_extinst_mmx0 - MWCodeGen_X86_extinst_3dnow0 - MWCodeGen_X86_use_mmx_3dnow_convention0 - MWCodeGen_X86_machinecodelisting0 - MWCodeGen_X86_intrinsics0 - MWCodeGen_X86_syminfo0 - MWCodeGen_X86_codeviewinfo0 - MWCodeGen_X86_extinst_cmov_fcomi0 - MWCodeGen_X86_extinst_sse0 - - - MWDebugger_X86_Exceptions - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - - - - PDisasmX86_showHeaderstrue - PDisasmX86_showSymTabtrue - PDisasmX86_showCodetrue - PDisasmX86_showSourcefalse - PDisasmX86_showHextrue - PDisasmX86_showRelocationtrue - PDisasmX86_showCommentsfalse - PDisasmX86_showDebugfalse - PDisasmX86_showExceptionsfalse - PDisasmX86_showDatatrue - PDisasmX86_showRawfalse - PDisasmX86_verbosetrue - - - MWDisassembler_PPC_showcode1 - MWDisassembler_PPC_extended1 - MWDisassembler_PPC_mix0 - MWDisassembler_PPC_nohex0 - MWDisassembler_PPC_showdata1 - MWDisassembler_PPC_showexceptions1 - MWDisassembler_PPC_showsym0 - MWDisassembler_PPC_shownames1 - - - MWFrontEnd_C_cplusplus0 - MWFrontEnd_C_checkprotos0 - MWFrontEnd_C_arm0 - MWFrontEnd_C_trigraphs0 - MWFrontEnd_C_onlystdkeywords0 - MWFrontEnd_C_enumsalwaysint0 - MWFrontEnd_C_mpwpointerstyle0 - MWFrontEnd_C_prefixname - MWFrontEnd_C_ansistrict0 - MWFrontEnd_C_mpwcnewline0 - MWFrontEnd_C_wchar_type1 - MWFrontEnd_C_enableexceptions1 - MWFrontEnd_C_dontreusestrings0 - MWFrontEnd_C_poolstrings0 - MWFrontEnd_C_dontinline0 - MWFrontEnd_C_useRTTI1 - MWFrontEnd_C_multibyteaware0 - MWFrontEnd_C_unsignedchars0 - MWFrontEnd_C_autoinline0 - MWFrontEnd_C_booltruefalse1 - MWFrontEnd_C_direct_to_som0 - MWFrontEnd_C_som_env_check0 - MWFrontEnd_C_alwaysinline0 - MWFrontEnd_C_inlinelevel0 - MWFrontEnd_C_ecplusplus0 - MWFrontEnd_C_objective_c0 - MWFrontEnd_C_defer_codegen1 - - - MWFTP_Post_hostName - MWFTP_Post_username - MWFTP_Post_password0 - MWFTP_Post_remoteDir - MWFTP_Post_ftp_PathVersion0 - MWFTP_Post_ftp_PathType0 - MWFTP_Post_ftp_PathFormat0 - MWFTP_Post_ftp_tree - MWFTP_Post_uploadDir - MWFTP_Post_ftp_port21 - MWFTP_Post_SendBin1 - MWFTP_Post_ShouldLog1 - - - MWCommandLine_Java_clsName - MWCommandLine_Java_args - - - MWVJavaDebugging_Protocol1 - MWVJavaDebugging_JDKVersion1 - MWVJavaDebugging_TimeOut25 - MWVJavaDebugging_SupportSlowDevicesfalse - - - MWJavaDoc_Proj_Version1 - MWJavaDoc_Proj_Depricated1 - MWJavaDoc_Proj_Author1 - MWJavaDoc_Proj_Index1 - MWJavaDoc_Proj_Tree1 - MWJavaDoc_Proj_SunResolveToSame0 - MWJavaDoc_Proj_Shortnames0 - MWJavaDoc_Proj_Folder0 - MWJavaDoc_Proj_GenerateAPILinks0 - MWJavaDoc_Proj_scopePublic - MWJavaDoc_Proj_encodingName - MWJavaDoc_Proj_decodingName - MWJavaDoc_Proj_javaPackagePathhttp://java.sun.com/products/jdk/1.1/docs/api/ - - - MWJava_Language_optimizefalse - MWJava_Language_warnDeprecatedfalse - MWJava_Language_emitMapfalse - MWJava_Language_strictFileNamesfalse - MWJava_Language_strictFileHierarchyfalse - MWJava_Language_1_1_Compatiblefalse - MWJava_Language_emitHeaders0 - MWJava_Language_headerTypeJNINativeHeaders - MWJava_Language_packageFilter - MWJava_Language_genCommentstrue - MWJava_Language_genHeadersfalse - - - MWJava_Output_outputtypeJarFile - MWJava_Output_outfileJavaClasses.jar - MWJava_Output_ftype1514754080 - MWJava_Output_fcreator1297570384 - MWJava_Output_compress0 - MWJava_Output_genManifest0 - MWJava_Output_trunctypeFront - MWJava_Output_deleteClasses0 - MWJava_Output_consoleApp1 - - - MWJava_Proj_projtypeApplet - MWJava_Proj_mainClassName - MWJava_Proj_HTMLAppCreator1463898714 - MWJava_Proj_HTMLAppName - MWJava_Proj_PathVersion0 - MWJava_Proj_PathType0 - MWJava_Proj_PathFormat0 - MWJava_Proj_tree - MWJava_Proj_HTMLAppWin32Name - MWJava_Proj_compress0 - MWJava_Proj_useVM1 - MWJava_Proj_vmarguments - MWJava_Proj_vmName - MWJava_Proj_simPropFile - MWJava_Proj_useJCVM1 - MWJava_Proj_aidData - - - MWLinker_PPC_linksym1 - MWLinker_PPC_symfullpath1 - MWLinker_PPC_linkmap0 - MWLinker_PPC_nolinkwarnings0 - MWLinker_PPC_dontdeadstripinitcode0 - MWLinker_PPC_permitmultdefs0 - MWLinker_PPC_linkmodeFast - MWLinker_PPC_initname - MWLinker_PPC_mainname__start - MWLinker_PPC_termname - - - MWLinker_X86_entrypointusageDefault - MWLinker_X86_entrypoint - MWLinker_X86_subsystemWinGUI - MWLinker_X86_subsysmajorid4 - MWLinker_X86_subsysminorid0 - MWLinker_X86_usrmajorid0 - MWLinker_X86_usrminorid0 - MWLinker_X86_commandfile - MWLinker_X86_generatemap0 - MWLinker_X86_linksym0 - MWLinker_X86_linkCV0 - - - MWMerge_MacOS_projectTypeApplication - MWMerge_MacOS_outputNameMerge Out - MWMerge_MacOS_outputCreator???? - MWMerge_MacOS_outputTypeAPPL - MWMerge_MacOS_suppressWarning0 - MWMerge_MacOS_copyFragments1 - MWMerge_MacOS_copyResources1 - MWMerge_MacOS_flattenResource0 - MWMerge_MacOS_flatFileNamea.rsrc - MWMerge_MacOS_flatFileOutputPath - Path: - PathFormatMacOS - PathRootProject - - MWMerge_MacOS_skipResources - DGLX - ckid - Proj - WSPC - mcvs - - - - MWMacOSPackager_UsePackager0 - MWMacOSPackager_FolderToPackage - Path: - PathFormatMacOS - PathRootProject - - MWMacOSPackager_CreateClassicAlias0 - MWMacOSPackager_ClassicAliasMethodUseTargetOutput - MWMacOSPackager_ClassicAliasPath - Path: - PathFormatMacOS - PathRootProject - - MWMacOSPackager_CreatePkgInfo0 - MWMacOSPackager_PkgCreatorType???? - MWMacOSPackager_PkgFileTypeLPPA - - - MWPEF_exportsNone - MWPEF_libfolder0 - MWPEF_sortcodeNone - MWPEF_expandbss0 - MWPEF_sharedata0 - MWPEF_olddefversion0 - MWPEF_oldimpversion0 - MWPEF_currentversion0 - MWPEF_fragmentname - MWPEF_collapsereloads0 - - - MWAssembler_PPC_auxheader0 - MWAssembler_PPC_symmodeMac - MWAssembler_PPC_dialectPPC - MWAssembler_PPC_prefixfile - MWAssembler_PPC_typecheck0 - MWAssembler_PPC_warnings0 - MWAssembler_PPC_casesensitive0 - - - GlobalOptimizer_PPC_optimizationlevelLevel0 - GlobalOptimizer_PPC_optforSpeed - - - MWProject_PPC_typeApplication - MWProject_PPC_outfilea.out - MWProject_PPC_filecreator???? - MWProject_PPC_filetypeAPPL - MWProject_PPC_size384 - MWProject_PPC_minsize384 - MWProject_PPC_stacksize64 - MWProject_PPC_flags22720 - MWProject_PPC_symfilename - MWProject_PPC_rsrcname - MWProject_PPC_rsrcheaderNative - MWProject_PPC_rsrctype???? - MWProject_PPC_rsrcid0 - MWProject_PPC_rsrcflags0 - MWProject_PPC_rsrcstore0 - MWProject_PPC_rsrcmerge0 - MWProject_PPC_flatrsrc0 - MWProject_PPC_flatrsrcoutputdir - Path: - PathFormatMacOS - PathRootProject - - MWProject_PPC_flatrsrcfilename - - - MWProject_X86_typeLibrary - MWProject_X86_outfilezlib.lib - MWProject_X86_baseaddress4194304 - MWProject_X86_maxstacksize1024 - MWProject_X86_minstacksize4 - MWProject_X86_size1024 - MWProject_X86_minsize4 - MWProject_X86_importlib - Resource Flattener Panel - 0100000000000000000000000000000000000000000000000000000000000000 - 0000074F75742E62696E00000000000000000000000000000000000000000000 - 0000 - - - - MWRez_Language_maxwidth80 - MWRez_Language_scriptRoman - MWRez_Language_alignmentAlign1 - MWRez_Language_filtermodeFilterSkip - MWRez_Language_suppresswarnings0 - MWRez_Language_escapecontrolchars1 - MWRez_Language_prefixname - MWRez_Language_filteredtypes'CODE' 'DATA' 'PICT' - - - MWWarning_C_warn_illpragma0 - MWWarning_C_warn_emptydecl0 - MWWarning_C_warn_possunwant0 - MWWarning_C_warn_unusedvar0 - MWWarning_C_warn_unusedarg0 - MWWarning_C_warn_extracomma0 - MWWarning_C_pedantic0 - MWWarning_C_warningerrors0 - MWWarning_C_warn_hidevirtual0 - MWWarning_C_warn_implicitconv0 - MWWarning_C_warn_notinlined0 - MWWarning_C_warn_structclass0 - - - MWWinRC_prefixname - - - GlobalOptimizer_X86__optimizationlevelLevel4 - GlobalOptimizer_X86__optforSpeed - - - - PathRelative - Project - - zlib\compress.c - Windows - Text - - - - PathRelative - Project - - zlib\crc32.c - Windows - Text - - - - PathRelative - Project - - zlib\gzio.c - Windows - Text - - - - PathRelative - Project - - zlib\infblock.c - Windows - Text - - - - PathRelative - Project - - zlib\infcodes.c - Windows - Text - - - - PathRelative - Project - - zlib\inffast.c - Windows - Text - - - - PathRelative - Project - - zlib\inflate.c - Windows - Text - - - - PathRelative - Project - - zlib\inftrees.c - Windows - Text - - - - PathRelative - Project - - zlib\infutil.c - Windows - Text - - - - PathRelative - Project - - zlib\adler32.c - Windows - Text - - - - PathRelative - Project - - zlib\trees.c - Windows - Text - - - - PathRelative - Project - - zlib\uncompr.c - Windows - Text - - - - PathRelative - Project - - zlib\zutil.c - Windows - Text - - - - PathRelative - Project - - zlib\deflate.c - Windows - Text - - - - - - PathRelative - Project - - zlib\compress.c - Windows - - - PathRelative - Project - - zlib\crc32.c - Windows - - - PathRelative - Project - - zlib\gzio.c - Windows - - - PathRelative - Project - - zlib\infblock.c - Windows - - - PathRelative - Project - - zlib\infcodes.c - Windows - - - PathRelative - Project - - zlib\inffast.c - Windows - - - PathRelative - Project - - zlib\inflate.c - Windows - - - PathRelative - Project - - zlib\inftrees.c - Windows - - - PathRelative - Project - - zlib\infutil.c - Windows - - - PathRelative - Project - - zlib\adler32.c - Windows - - - PathRelative - Project - - zlib\trees.c - Windows - - - PathRelative - Project - - zlib\uncompr.c - Windows - - - PathRelative - Project - - zlib\zutil.c - Windows - - - PathRelative - Project - - zlib\deflate.c - Windows - - - - - copySetupRelease - - - - - wxlib Win32 release - - - - UserSourceTrees - - - AlwaysSearchUserPathstrue - InterpretDOSAndUnixPathsfalse - RequireFrameworkStyleIncludesfalse - UserSearchPaths - - SearchPath - Path..\lib\cw7msw\include - PathFormatWindows - PathRootProject - - Recursivefalse - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Path..\include - PathFormatWindows - PathRootProject - - Recursivefalse - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Pathgeneric - PathFormatWindows - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Pathmsw - PathFormatWindows - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Pathcommon - PathFormatWindows - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Pathzlib - PathFormatWindows - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Pathpng - PathFormatWindows - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Pathjpeg - PathFormatWindows - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Pathtiff - PathFormatWindows - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Pathhtml - PathFormatWindows - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - Pathregex - PathFormatWindows - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SystemSearchPaths - - SearchPath - PathMSL - PathFormatWindows - PathRootCodeWarrior - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SearchPath - PathWin32-x86 Support - PathFormatWindows - PathRootCodeWarrior - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - - - MWRuntimeSettings_WorkingDirectory - MWRuntimeSettings_CommandLine - MWRuntimeSettings_HostApplication - Path - PathFormatGeneric - PathRootAbsolute - - MWRuntimeSettings_EnvVars - - - LinkerWin32 x86 Linker - PreLinker - PostLinker - Targetnamewxlib Win32 release - OutputDirectory - Path..\lib - PathFormatWindows - PathRootProject - - SaveEntriesUsingRelativePathstrue - - - FileMappings - - FileTypeTEXT - FileExtension.c - CompilerMW C/C++ x86 - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.c++ - CompilerMW C/C++ x86 - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.cc - CompilerMW C/C++ x86 - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.cp - CompilerMW C/C++ x86 - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.cpp - CompilerMW C/C++ x86 - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.def - Compiler - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.h - CompilerMW C/C++ x86 - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMaketrue - - - FileTypeTEXT - FileExtension.h++ - CompilerMW C/C++ x86 - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMaketrue - - - FileTypeTEXT - FileExtension.hpp - CompilerMW C/C++ x86 - EditLanguageC/C++ - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMaketrue - - - FileTypeTEXT - FileExtension.ord - Compiler - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.pch - CompilerMW C/C++ x86 - EditLanguageC/C++ - Precompiletrue - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.pch++ - CompilerMW C/C++ x86 - EditLanguageC/C++ - Precompiletrue - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.pl - CompilerMW Perl - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.rc - CompilerMW WinRC - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeiLIB - FileExtension - CompilerLib Import x86 - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeiOBJ - FileExtension - CompilerObj Import x86 - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileExtension.a - CompilerLib Import x86 - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileExtension.doc - Compiler - EditLanguage - Precompilefalse - Launchabletrue - ResourceFilefalse - IgnoredByMaketrue - - - FileExtension.lib - CompilerLib Import x86 - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileExtension.o - CompilerObj Import x86 - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileExtension.obj - CompilerObj Import x86 - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileExtension.res - CompilerWinRes Import - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - - - CacheModDatestrue - ActivateBrowsertrue - DumpBrowserInfofalse - CacheSubprojectstrue - UseThirdPartyDebuggerfalse - DebuggerAppPath - Path - PathFormatGeneric - PathRootAbsolute - - DebuggerCmdLineArgs - DebuggerWorkingDir - Path - PathFormatGeneric - PathRootAbsolute - - - - LogSystemMessagestrue - AutoTargetDLLstrue - StopAtWatchpointstrue - PauseWhileRunningfalse - PauseInterval5 - PauseUIFlags0 - AltExePath - Path - PathFormatGeneric - PathRootAbsolute - - StopAtTempBPOnLaunchtrue - CacheSymbolicstrue - TempBPFunctionNamemain - TempBPType0 - - - Enabledfalse - ConnectionName - DownloadPath - LaunchRemoteAppfalse - RemoteAppPath - - - OtherExecutables - - - CustomColor1 - Red0 - Green32767 - Blue0 - - CustomColor2 - Red0 - Green32767 - Blue0 - - CustomColor3 - Red0 - Green32767 - Blue0 - - CustomColor4 - Red0 - Green32767 - Blue0 - - - - Perl_Prefix_Filename - - - MWCodeGen_PPC_structalignmentMC68K - MWCodeGen_PPC_tracebacktablesNone - MWCodeGen_PPC_processorGeneric - MWCodeGen_PPC_readonlystrings0 - MWCodeGen_PPC_tocdata1 - MWCodeGen_PPC_profiler0 - MWCodeGen_PPC_fpcontract1 - MWCodeGen_PPC_schedule0 - MWCodeGen_PPC_peephole1 - MWCodeGen_PPC_processorspecific0 - MWCodeGen_PPC_altivec0 - MWCodeGen_PPC_vectortocdata1 - MWCodeGen_PPC_vrsave1 - - - MWCodeGen_X86_processorPentiumII - MWCodeGen_X86_alignmentbytes8 - MWCodeGen_X86_exceptionsZeroOverhead - MWCodeGen_X86_extinst_mmx0 - MWCodeGen_X86_extinst_3dnow0 - MWCodeGen_X86_use_mmx_3dnow_convention0 - MWCodeGen_X86_machinecodelisting0 - MWCodeGen_X86_intrinsics0 - MWCodeGen_X86_syminfo0 - MWCodeGen_X86_codeviewinfo0 - MWCodeGen_X86_extinst_cmov_fcomi0 - MWCodeGen_X86_extinst_sse0 - - - MWDebugger_X86_Exceptions - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - - - - PDisasmX86_showHeaderstrue - PDisasmX86_showSymTabtrue - PDisasmX86_showCodetrue - PDisasmX86_showSourcefalse - PDisasmX86_showHextrue - PDisasmX86_showRelocationtrue - PDisasmX86_showCommentsfalse - PDisasmX86_showDebugfalse - PDisasmX86_showExceptionsfalse - PDisasmX86_showDatatrue - PDisasmX86_showRawfalse - PDisasmX86_verbosetrue - - - MWDisassembler_PPC_showcode1 - MWDisassembler_PPC_extended1 - MWDisassembler_PPC_mix0 - MWDisassembler_PPC_nohex0 - MWDisassembler_PPC_showdata1 - MWDisassembler_PPC_showexceptions1 - MWDisassembler_PPC_showsym0 - MWDisassembler_PPC_shownames1 - - - MWFrontEnd_C_cplusplus0 - MWFrontEnd_C_checkprotos0 - MWFrontEnd_C_arm0 - MWFrontEnd_C_trigraphs0 - MWFrontEnd_C_onlystdkeywords0 - MWFrontEnd_C_enumsalwaysint0 - MWFrontEnd_C_mpwpointerstyle1 - MWFrontEnd_C_prefixname/wx/wx_cw.h - MWFrontEnd_C_ansistrict0 - MWFrontEnd_C_mpwcnewline0 - MWFrontEnd_C_wchar_type1 - MWFrontEnd_C_enableexceptions1 - MWFrontEnd_C_dontreusestrings0 - MWFrontEnd_C_poolstrings0 - MWFrontEnd_C_dontinline0 - MWFrontEnd_C_useRTTI1 - MWFrontEnd_C_multibyteaware0 - MWFrontEnd_C_unsignedchars0 - MWFrontEnd_C_autoinline0 - MWFrontEnd_C_booltruefalse1 - MWFrontEnd_C_direct_to_som0 - MWFrontEnd_C_som_env_check0 - MWFrontEnd_C_alwaysinline0 - MWFrontEnd_C_inlinelevel8 - MWFrontEnd_C_ecplusplus0 - MWFrontEnd_C_objective_c0 - MWFrontEnd_C_defer_codegen0 - - - MWFTP_Post_hostName - MWFTP_Post_username - MWFTP_Post_password0 - MWFTP_Post_remoteDir - MWFTP_Post_ftp_PathVersion0 - MWFTP_Post_ftp_PathType0 - MWFTP_Post_ftp_PathFormat0 - MWFTP_Post_ftp_tree - MWFTP_Post_uploadDir - MWFTP_Post_ftp_port21 - MWFTP_Post_SendBin1 - MWFTP_Post_ShouldLog1 - - - MWCommandLine_Java_clsName - MWCommandLine_Java_args - - - MWVJavaDebugging_Protocol1 - MWVJavaDebugging_JDKVersion1 - MWVJavaDebugging_TimeOut25 - MWVJavaDebugging_SupportSlowDevicesfalse - - - MWJavaDoc_Proj_Version1 - MWJavaDoc_Proj_Depricated1 - MWJavaDoc_Proj_Author1 - MWJavaDoc_Proj_Index1 - MWJavaDoc_Proj_Tree1 - MWJavaDoc_Proj_SunResolveToSame0 - MWJavaDoc_Proj_Shortnames0 - MWJavaDoc_Proj_Folder0 - MWJavaDoc_Proj_GenerateAPILinks0 - MWJavaDoc_Proj_scopePublic - MWJavaDoc_Proj_encodingName - MWJavaDoc_Proj_decodingName - MWJavaDoc_Proj_javaPackagePathhttp://java.sun.com/products/jdk/1.1/docs/api/ - - - MWJava_Language_optimizefalse - MWJava_Language_warnDeprecatedfalse - MWJava_Language_emitMapfalse - MWJava_Language_strictFileNamesfalse - MWJava_Language_strictFileHierarchyfalse - MWJava_Language_1_1_Compatiblefalse - MWJava_Language_emitHeaders0 - MWJava_Language_headerTypeJNINativeHeaders - MWJava_Language_packageFilter - MWJava_Language_genCommentstrue - MWJava_Language_genHeadersfalse - - - MWJava_Output_outputtypeJarFile - MWJava_Output_outfileJavaClasses.jar - MWJava_Output_ftype1514754080 - MWJava_Output_fcreator1297570384 - MWJava_Output_compress0 - MWJava_Output_genManifest0 - MWJava_Output_trunctypeFront - MWJava_Output_deleteClasses0 - MWJava_Output_consoleApp1 - - - MWJava_Proj_projtypeApplet - MWJava_Proj_mainClassName - MWJava_Proj_HTMLAppCreator1463898714 - MWJava_Proj_HTMLAppName - MWJava_Proj_PathVersion0 - MWJava_Proj_PathType0 - MWJava_Proj_PathFormat0 - MWJava_Proj_tree - MWJava_Proj_HTMLAppWin32Name - MWJava_Proj_compress0 - MWJava_Proj_useVM1 - MWJava_Proj_vmarguments - MWJava_Proj_vmName - MWJava_Proj_simPropFile - MWJava_Proj_useJCVM1 - MWJava_Proj_aidData - - - MWLinker_PPC_linksym1 - MWLinker_PPC_symfullpath1 - MWLinker_PPC_linkmap0 - MWLinker_PPC_nolinkwarnings0 - MWLinker_PPC_dontdeadstripinitcode0 - MWLinker_PPC_permitmultdefs0 - MWLinker_PPC_linkmodeFast - MWLinker_PPC_initname - MWLinker_PPC_mainname__start - MWLinker_PPC_termname - - - MWLinker_X86_entrypointusageDefault - MWLinker_X86_entrypoint - MWLinker_X86_subsystemWinGUI - MWLinker_X86_subsysmajorid4 - MWLinker_X86_subsysminorid0 - MWLinker_X86_usrmajorid0 - MWLinker_X86_usrminorid0 - MWLinker_X86_commandfile - MWLinker_X86_generatemap0 - MWLinker_X86_linksym0 - MWLinker_X86_linkCV0 - - - MWMerge_MacOS_projectTypeApplication - MWMerge_MacOS_outputNameMerge Out - MWMerge_MacOS_outputCreator???? - MWMerge_MacOS_outputTypeAPPL - MWMerge_MacOS_suppressWarning0 - MWMerge_MacOS_copyFragments1 - MWMerge_MacOS_copyResources1 - MWMerge_MacOS_flattenResource0 - MWMerge_MacOS_flatFileNamea.rsrc - MWMerge_MacOS_flatFileOutputPath - Path: - PathFormatMacOS - PathRootProject - - MWMerge_MacOS_skipResources - DGLX - ckid - Proj - WSPC - mcvs - - - - MWMacOSPackager_UsePackager0 - MWMacOSPackager_FolderToPackage - Path: - PathFormatMacOS - PathRootProject - - MWMacOSPackager_CreateClassicAlias0 - MWMacOSPackager_ClassicAliasMethodUseTargetOutput - MWMacOSPackager_ClassicAliasPath - Path: - PathFormatMacOS - PathRootProject - - MWMacOSPackager_CreatePkgInfo0 - MWMacOSPackager_PkgCreatorType???? - MWMacOSPackager_PkgFileTypeLPPA - - - MWPEF_exportsNone - MWPEF_libfolder0 - MWPEF_sortcodeNone - MWPEF_expandbss0 - MWPEF_sharedata0 - MWPEF_olddefversion0 - MWPEF_oldimpversion0 - MWPEF_currentversion0 - MWPEF_fragmentname - MWPEF_collapsereloads0 - - - MWAssembler_PPC_auxheader0 - MWAssembler_PPC_symmodeMac - MWAssembler_PPC_dialectPPC - MWAssembler_PPC_prefixfile - MWAssembler_PPC_typecheck0 - MWAssembler_PPC_warnings0 - MWAssembler_PPC_casesensitive0 - - - GlobalOptimizer_PPC_optimizationlevelLevel0 - GlobalOptimizer_PPC_optforSpeed - - - MWProject_PPC_typeApplication - MWProject_PPC_outfilea.out - MWProject_PPC_filecreator???? - MWProject_PPC_filetypeAPPL - MWProject_PPC_size384 - MWProject_PPC_minsize384 - MWProject_PPC_stacksize64 - MWProject_PPC_flags22720 - MWProject_PPC_symfilename - MWProject_PPC_rsrcname - MWProject_PPC_rsrcheaderNative - MWProject_PPC_rsrctype???? - MWProject_PPC_rsrcid0 - MWProject_PPC_rsrcflags0 - MWProject_PPC_rsrcstore0 - MWProject_PPC_rsrcmerge0 - MWProject_PPC_flatrsrc0 - MWProject_PPC_flatrsrcoutputdir - Path: - PathFormatMacOS - PathRootProject - - MWProject_PPC_flatrsrcfilename - - - MWProject_X86_typeLibrary - MWProject_X86_outfilewx_x86.lib - MWProject_X86_baseaddress4194304 - MWProject_X86_maxstacksize1024 - MWProject_X86_minstacksize4 - MWProject_X86_size1024 - MWProject_X86_minsize4 - MWProject_X86_importlib - Resource Flattener Panel - 0100000000000000000000000000000000000000000000000000000000000000 - 0000074F75742E62696E00000000000000000000000000000000000000000000 - 0000 - - - - MWRez_Language_maxwidth80 - MWRez_Language_scriptRoman - MWRez_Language_alignmentAlign1 - MWRez_Language_filtermodeFilterSkip - MWRez_Language_suppresswarnings0 - MWRez_Language_escapecontrolchars1 - MWRez_Language_prefixname - MWRez_Language_filteredtypes'CODE' 'DATA' 'PICT' - - - MWWarning_C_warn_illpragma0 - MWWarning_C_warn_emptydecl0 - MWWarning_C_warn_possunwant0 - MWWarning_C_warn_unusedvar0 - MWWarning_C_warn_unusedarg0 - MWWarning_C_warn_extracomma0 - MWWarning_C_pedantic0 - MWWarning_C_warningerrors0 - MWWarning_C_warn_hidevirtual0 - MWWarning_C_warn_implicitconv0 - MWWarning_C_warn_notinlined0 - MWWarning_C_warn_structclass0 - - - MWWinRC_prefixname - - - GlobalOptimizer_X86__optimizationlevelLevel4 - GlobalOptimizer_X86__optforSpeed - - - - PathRelative - Project - common - ftp.cpp - Windows - Text - Debug - - - PathRelative - Project - common - artprov.cpp - Windows - Text - Debug - - - PathRelative - Project - common - artstd.cpp - Windows - Text - Debug - - - PathRelative - Project - common - choiccmn.cpp - Windows - Text - Debug - - - PathRelative - Project - common - clipcmn.cpp - Windows - Text - Debug - - - PathRelative - Project - common - clntdata.cpp - Windows - Text - Debug - - - PathRelative - Project - common - cmdline.cpp - Windows - Text - Debug - - - PathRelative - Project - common - cmdproc.cpp - Windows - Text - Debug - - - PathRelative - Project - common - cmndata.cpp - Windows - Text - Debug - - - PathRelative - Project - common - config.cpp - Windows - Text - Debug - - - PathRelative - Project - common - containr.cpp - Windows - Text - Debug - - - PathRelative - Project - common - cshelp.cpp - Windows - Text - Debug - - - PathRelative - Project - common - ctrlcmn.cpp - Windows - Text - Debug - - - PathRelative - Project - common - ctrlsub.cpp - Windows - Text - Debug - - - PathRelative - Project - common - datetime.cpp - Windows - Text - Debug - - - PathRelative - Project - common - datstrm.cpp - Windows - Text - Debug - - - PathRelative - Project - common - db.cpp - Windows - Text - Debug - - - PathRelative - Project - common - dbgrid.cpp - Windows - Text - Debug - - - PathRelative - Project - common - dbtable.cpp - Windows - Text - Debug - - - PathRelative - Project - common - dcbase.cpp - Windows - Text - Debug - - - PathRelative - Project - common - dircmn.cpp - Windows - Text - Debug - - - PathRelative - Project - common - dlgcmn.cpp - Windows - Text - Debug - - - PathRelative - Project - common - dndcmn.cpp - Windows - Text - Debug - - - PathRelative - Project - common - dobjcmn.cpp - Windows - Text - Debug - - - PathRelative - Project - common - docmdi.cpp - Windows - Text - Debug - - - PathRelative - Project - common - docview.cpp - Windows - Text - Debug - - - PathRelative - Project - common - dseldlg.cpp - Windows - Text - Debug - - - PathRelative - Project - common - dynarray.cpp - Windows - Text - Debug - - - PathRelative - Project - common - dynlib.cpp - Windows - Text - Debug - - - PathRelative - Project - common - dynload.cpp - Windows - Text - Debug - - - PathRelative - Project - common - effects.cpp - Windows - Text - Debug - - - PathRelative - Project - common - encconv.cpp - Windows - Text - Debug - - - PathRelative - Project - common - event.cpp - Windows - Text - Debug - - - PathRelative - Project - common - extended.c - Windows - Text - Debug - - - PathRelative - Project - common - fddlgcmn.cpp - Windows - Text - Debug - - - PathRelative - Project - common - ffile.cpp - Windows - Text - Debug - - - PathRelative - Project - common - file.cpp - Windows - Text - Debug - - - PathRelative - Project - common - fileconf.cpp - Windows - Text - Debug - - - PathRelative - Project - common - filefn.cpp - Windows - Text - Debug - - - PathRelative - Project - common - filename.cpp - Windows - Text - Debug - - - PathRelative - Project - common - filesys.cpp - Windows - Text - Debug - - - PathRelative - Project - common - fontcmn.cpp - Windows - Text - Debug - - - PathRelative - Project - common - fontmap.cpp - Windows - Text - Debug - - - PathRelative - Project - common - framecmn.cpp - Windows - Text - Debug - - - PathRelative - Project - common - fs_inet.cpp - Windows - Text - Debug - - - PathRelative - Project - common - fs_mem.cpp - Windows - Text - Debug - - - PathRelative - Project - common - fs_zip.cpp - Windows - Text - Debug - - - PathRelative - Project - common - appcmn.cpp - Windows - Text - Debug - - - PathRelative - Project - common - gaugecmn.cpp - Windows - Text - Debug - - - PathRelative - Project - common - gdicmn.cpp - Windows - Text - Debug - - - PathRelative - Project - common - geometry.cpp - Windows - Text - Debug - - - PathRelative - Project - common - gifdecod.cpp - Windows - Text - Debug - - - PathRelative - Project - common - hash.cpp - Windows - Text - Debug - - - PathRelative - Project - common - hashmap.cpp - Windows - Text - Debug - - - PathRelative - Project - common - helpbase.cpp - Windows - Text - Debug - - - PathRelative - Project - common - http.cpp - Windows - Text - Debug - - - PathRelative - Project - common - iconbndl.cpp - Windows - Text - Debug - - - PathRelative - Project - common - imagall.cpp - Windows - Text - Debug - - - PathRelative - Project - common - imagbmp.cpp - Windows - Text - Debug - - - PathRelative - Project - common - image.cpp - Windows - Text - Debug - - - PathRelative - Project - common - imagfill.cpp - Windows - Text - Debug - - - PathRelative - Project - common - imaggif.cpp - Windows - Text - Debug - - - PathRelative - Project - common - imagiff.cpp - Windows - Text - Debug - - - PathRelative - Project - common - imagjpeg.cpp - Windows - Text - Debug - - - PathRelative - Project - common - imagpcx.cpp - Windows - Text - Debug - - - PathRelative - Project - common - imagpng.cpp - Windows - Text - Debug - - - PathRelative - Project - common - imagpnm.cpp - Windows - Text - Debug - - - PathRelative - Project - common - imagtiff.cpp - Windows - Text - Debug - - - PathRelative - Project - common - imagxpm.cpp - Windows - Text - Debug - - - PathRelative - Project - common - intl.cpp - Windows - Text - Debug - - - PathRelative - Project - common - ipcbase.cpp - Windows - Text - Debug - - - PathRelative - Project - common - layout.cpp - Windows - Text - Debug - - - PathRelative - Project - common - lboxcmn.cpp - Windows - Text - Debug - - - PathRelative - Project - common - list.cpp - Windows - Text - Debug - - - PathRelative - Project - common - log.cpp - Windows - Text - Debug - - - PathRelative - Project - common - longlong.cpp - Windows - Text - Debug - - - PathRelative - Project - common - matrix.cpp - Windows - Text - Debug - - - PathRelative - Project - common - memory.cpp - Windows - Text - Debug - - - PathRelative - Project - common - menucmn.cpp - Windows - Text - Debug - - - PathRelative - Project - common - mimecmn.cpp - Windows - Text - Debug - - - PathRelative - Project - common - module.cpp - Windows - Text - Debug - - - PathRelative - Project - common - mstream.cpp - Windows - Text - Debug - - - PathRelative - Project - common - nbkbase.cpp - Windows - Text - Debug - - - PathRelative - Project - common - object.cpp - Windows - Text - Debug - - - PathRelative - Project - common - odbc.cpp - Windows - Text - Debug - - - PathRelative - Project - common - paper.cpp - Windows - Text - Debug - - - PathRelative - Project - common - popupcmn.cpp - Windows - Text - Debug - - - PathRelative - Project - common - prntbase.cpp - Windows - Text - Debug - - - PathRelative - Project - common - process.cpp - Windows - Text - Debug - - - PathRelative - Project - common - protocol.cpp - Windows - Text - Debug - - - PathRelative - Project - common - quantize.cpp - Windows - Text - Debug - - - PathRelative - Project - common - radiocmn.cpp - Windows - Text - Debug - - - PathRelative - Project - common - regex.cpp - Windows - Text - Debug - - - PathRelative - Project - common - resource.cpp - Windows - Text - Debug - - - PathRelative - Project - common - sckaddr.cpp - Windows - Text - Debug - - - PathRelative - Project - common - sckfile.cpp - Windows - Text - Debug - - - PathRelative - Project - common - sckipc.cpp - Windows - Text - Debug - - - PathRelative - Project - common - sckstrm.cpp - Windows - Text - Debug - - - PathRelative - Project - common - sizer.cpp - Windows - Text - Debug - - - PathRelative - Project - common - socket.cpp - Windows - Text - Debug - - - PathRelative - Project - common - statbar.cpp - Windows - Text - Debug - - - PathRelative - Project - common - strconv.cpp - Windows - Text - Debug - - - PathRelative - Project - common - stream.cpp - Windows - Text - Debug - - - PathRelative - Project - common - string.cpp - Windows - Text - Debug - - - PathRelative - Project - common - sysopt.cpp - Windows - Text - Debug - - - PathRelative - Project - common - tbarbase.cpp - Windows - Text - Debug - - - PathRelative - Project - common - textbuf.cpp - Windows - Text - Debug - - - PathRelative - Project - common - textcmn.cpp - Windows - Text - Debug - - - PathRelative - Project - common - textfile.cpp - Windows - Text - Debug - - - PathRelative - Project - common - timercmn.cpp - Windows - Text - Debug - - - PathRelative - Project - common - tokenzr.cpp - Windows - Text - Debug - - - PathRelative - Project - common - toplvcmn.cpp - Windows - Text - Debug - - - PathRelative - Project - common - treebase.cpp - Windows - Text - Debug - - - PathRelative - Project - common - txtstrm.cpp - Windows - Text - Debug - - - PathRelative - Project - common - unzip.c - Windows - Text - Debug - - - PathRelative - Project - common - url.cpp - Windows - Text - Debug - - - PathRelative - Project - common - utilscmn.cpp - Windows - Text - Debug - - - PathRelative - Project - common - valgen.cpp - Windows - Text - Debug - - - PathRelative - Project - common - validate.cpp - Windows - Text - Debug - - - PathRelative - Project - common - valtext.cpp - Windows - Text - Debug - - - PathRelative - Project - common - variant.cpp - Windows - Text - Debug - - - PathRelative - Project - common - wfstream.cpp - Windows - Text - Debug - - - PathRelative - Project - common - wincmn.cpp - Windows - Text - Debug - - - PathRelative - Project - common - wxchar.cpp - Windows - Text - Debug - - - PathRelative - Project - common - wxexpr.cpp - Windows - Text - Debug - - - PathRelative - Project - common - xpmdecod.cpp - Windows - Text - Debug - - - PathRelative - Project - common - zipstrm.cpp - Windows - Text - Debug - - - PathRelative - Project - common - zstream.cpp - Windows - Text - Debug - - - PathRelative - Project - generic - busyinfo.cpp - Windows - Text - Debug - - - PathRelative - Project - generic - calctrl.cpp - Windows - Text - Debug - - - PathRelative - Project - generic - choicdgg.cpp - Windows - Text - Debug - - - PathRelative - Project - generic - dcbuffer.cpp - Windows - Text - Debug - - - PathRelative - Project - generic - dcpsg.cpp - Windows - Text - Debug - - - PathRelative - Project - generic - dirctrlg.cpp - Windows - Text - Debug - - - PathRelative - Project - generic - dragimgg.cpp - Windows - Text - Debug - - - PathRelative - Project - generic - grid.cpp - Windows - Text - Debug - - - PathRelative - Project - generic - gridctrl.cpp - Windows - Text - Debug - - - PathRelative - Project - generic - gridsel.cpp - Windows - Text - Debug - - - PathRelative - Project - generic - laywin.cpp - Windows - Text - Debug - - - PathRelative - Project - generic - logg.cpp - Windows - Text - Debug - - - PathRelative - Project - generic - numdlgg.cpp - Windows - Text - Debug - - - PathRelative - Project - generic - panelg.cpp - Windows - Text - Debug - - - PathRelative - Project - generic - prntdlgg.cpp - Windows - Text - Debug - - - PathRelative - Project - generic - progdlgg.cpp - Windows - Text - Debug - - - PathRelative - Project - generic - prop.cpp - Windows - Text - Debug - - - PathRelative - Project - generic - propform.cpp - Windows - Text - Debug - - - PathRelative - Project - generic - proplist.cpp - Windows - Text - Debug - - - PathRelative - Project - generic - sashwin.cpp - Windows - Text - Debug - - - PathRelative - Project - generic - scrlwing.cpp - Windows - Text - Debug - - - PathRelative - Project - generic - spinctlg.cpp - Windows - Text - Debug - - - PathRelative - Project - generic - splash.cpp - Windows - Text - Debug - - - PathRelative - Project - generic - splitter.cpp - Windows - Text - Debug - - - PathRelative - Project - generic - statusbr.cpp - Windows - Text - Debug - - - PathRelative - Project - generic - tbarsmpl.cpp - Windows - Text - Debug - - - PathRelative - Project - generic - textdlgg.cpp - Windows - Text - Debug - - - PathRelative - Project - generic - tipdlg.cpp - Windows - Text - Debug - - - PathRelative - Project - generic - tipwin.cpp - Windows - Text - Debug - - - PathRelative - Project - generic - treectlg.cpp - Windows - Text - Debug - - - PathRelative - Project - generic - treelay.cpp - Windows - Text - Debug - - - PathRelative - Project - generic - wizard.cpp - Windows - Text - Debug - - - PathRelative - Project - html - helpctrl.cpp - Windows - Text - Debug - - - PathRelative - Project - html - helpdata.cpp - Windows - Text - Debug - - - PathRelative - Project - html - helpfrm.cpp - Windows - Text - Debug - - - PathRelative - Project - html - htmlcell.cpp - Windows - Text - Debug - - - PathRelative - Project - html - htmlfilt.cpp - Windows - Text - Debug - - - PathRelative - Project - html - htmlpars.cpp - Windows - Text - Debug - - - PathRelative - Project - html - htmltag.cpp - Windows - Text - Debug - - - PathRelative - Project - html - htmlwin.cpp - Windows - Text - Debug - - - PathRelative - Project - html - htmprint.cpp - Windows - Text - Debug - - - PathRelative - Project - html - m_dflist.cpp - Windows - Text - Debug - - - PathRelative - Project - html - m_fonts.cpp - Windows - Text - Debug - - - PathRelative - Project - html - m_hline.cpp - Windows - Text - Debug - - - PathRelative - Project - html - m_image.cpp - Windows - Text - Debug - - - PathRelative - Project - html - m_layout.cpp - Windows - Text - Debug - - - PathRelative - Project - html - m_links.cpp - Windows - Text - Debug - - - PathRelative - Project - html - m_list.cpp - Windows - Text - Debug - - - PathRelative - Project - html - m_pre.cpp - Windows - Text - Debug - - - PathRelative - Project - html - m_style.cpp - Windows - Text - Debug - - - PathRelative - Project - html - m_tables.cpp - Windows - Text - Debug - - - PathRelative - Project - html - winpars.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - volume.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - app.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - bitmap.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - bmpbuttn.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - brush.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - button.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - caret.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - checkbox.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - checklst.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - choice.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - clipbrd.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - colordlg.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - colour.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - combobox.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - control.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - curico.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - cursor.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - data.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - dc.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - dcclient.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - dcmemory.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - dcprint.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - dcscreen.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - dde.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - dialog.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - dialup.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - dib.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - dibutils.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - dir.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - dirdlg.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - dragimag.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - enhmeta.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - evtloop.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - fdrepdlg.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - filedlg.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - font.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - fontdlg.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - fontenum.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - fontutil.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - frame.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - gauge95.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - gdiimage.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - gdiobj.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - glcanvas.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - gsocket.c - Windows - Text - Debug - - - PathRelative - Project - msw - gsockmsw.c - Windows - Text - Debug - - - PathRelative - Project - msw - helpbest.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - helpchm.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - helpwin.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - icon.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - imaglist.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - iniconf.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - joystick.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - listbox.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - listctrl.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - main.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - mdi.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - menu.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - menuitem.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - metafile.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - mimetype.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - minifram.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - msgdlg.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - mslu.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - nativdlg.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - notebook.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - ownerdrw.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - palette.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - pen.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - penwin.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - printdlg.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - printwin.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - radiobox.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - radiobut.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - regconf.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - region.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - registry.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - scrolbar.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - settings.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - slider95.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - snglinst.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - spinbutt.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - spinctrl.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - statbmp.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - statbox.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - statbr95.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - statline.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - stattext.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - tabctrl.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - taskbar.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - tbar95.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - textctrl.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - tglbtn.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - thread.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - timer.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - tooltip.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - toplevel.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - treectrl.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - utils.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - utilsexc.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - accel.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - wave.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - window.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - ole\automtn.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - ole\dataobj.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - ole\dropsrc.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - ole\droptgt.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - ole\oleutils.cpp - Windows - Text - Debug - - - PathRelative - Project - msw - ole\uuid.cpp - Windows - Text - Debug - - - RootRelative - Project - ..\lib\jpeg.lib - Windows - Library - Debug, TargetOutputFile - - - RootRelative - Project - ..\lib\png.lib - Windows - Library - Debug, TargetOutputFile - - - RootRelative - Project - ..\lib\tiff.lib - Windows - Library - Debug, TargetOutputFile - - - RootRelative - Project - ..\lib\zlib.lib - Windows - Library - Debug, TargetOutputFile - - - PathRelative - Project - ..\include - wx_cw.pch - Windows - Text - Debug - - - PathRelative - Project - ..\include - wx_cw.pch++ - Windows - Text - Debug - - - PathRelative - Project - msw - popupwin.cpp - Windows - Text - Debug - - - PathRelative - Project - common - msgout.cpp - Windows - Text - Debug - - - PathRelative - Project - common - settcmn.cpp - Windows - Text - Debug - - - - - PathRelative - Project - ..\include - wx_cw.pch - Windows - - - PathRelative - Project - ..\include - wx_cw.pch++ - Windows - - - PathRelative - Project - common - ftp.cpp - Windows - - - PathRelative - Project - common - artprov.cpp - Windows - - - PathRelative - Project - common - artstd.cpp - Windows - - - PathRelative - Project - common - choiccmn.cpp - Windows - - - PathRelative - Project - common - clipcmn.cpp - Windows - - - PathRelative - Project - common - clntdata.cpp - Windows - - - PathRelative - Project - common - cmdline.cpp - Windows - - - PathRelative - Project - common - cmdproc.cpp - Windows - - - PathRelative - Project - common - cmndata.cpp - Windows - - - PathRelative - Project - common - config.cpp - Windows - - - PathRelative - Project - common - containr.cpp - Windows - - - PathRelative - Project - common - cshelp.cpp - Windows - - - PathRelative - Project - common - ctrlcmn.cpp - Windows - - - PathRelative - Project - common - ctrlsub.cpp - Windows - - - PathRelative - Project - common - datetime.cpp - Windows - - - PathRelative - Project - common - datstrm.cpp - Windows - - - PathRelative - Project - common - db.cpp - Windows - - - PathRelative - Project - common - dbgrid.cpp - Windows - - - PathRelative - Project - common - dbtable.cpp - Windows - - - PathRelative - Project - common - dcbase.cpp - Windows - - - PathRelative - Project - common - dircmn.cpp - Windows - - - PathRelative - Project - common - dlgcmn.cpp - Windows - - - PathRelative - Project - common - dndcmn.cpp - Windows - - - PathRelative - Project - common - dobjcmn.cpp - Windows - - - PathRelative - Project - common - docmdi.cpp - Windows - - - PathRelative - Project - common - docview.cpp - Windows - - - PathRelative - Project - common - dseldlg.cpp - Windows - - - PathRelative - Project - common - dynarray.cpp - Windows - - - PathRelative - Project - common - dynlib.cpp - Windows - - - PathRelative - Project - common - dynload.cpp - Windows - - - PathRelative - Project - common - effects.cpp - Windows - - - PathRelative - Project - common - encconv.cpp - Windows - - - PathRelative - Project - common - event.cpp - Windows - - - PathRelative - Project - common - extended.c - Windows - - - PathRelative - Project - common - fddlgcmn.cpp - Windows - - - PathRelative - Project - common - ffile.cpp - Windows - - - PathRelative - Project - common - file.cpp - Windows - - - PathRelative - Project - common - fileconf.cpp - Windows - - - PathRelative - Project - common - filefn.cpp - Windows - - - PathRelative - Project - common - filename.cpp - Windows - - - PathRelative - Project - common - filesys.cpp - Windows - - - PathRelative - Project - common - fontcmn.cpp - Windows - - - PathRelative - Project - common - fontmap.cpp - Windows - - - PathRelative - Project - common - framecmn.cpp - Windows - - - PathRelative - Project - common - fs_inet.cpp - Windows - - - PathRelative - Project - common - fs_mem.cpp - Windows - - - PathRelative - Project - common - fs_zip.cpp - Windows - - - PathRelative - Project - common - appcmn.cpp - Windows - - - PathRelative - Project - common - gaugecmn.cpp - Windows - - - PathRelative - Project - common - gdicmn.cpp - Windows - - - PathRelative - Project - common - geometry.cpp - Windows - - - PathRelative - Project - common - gifdecod.cpp - Windows - - - PathRelative - Project - common - hash.cpp - Windows - - - PathRelative - Project - common - hashmap.cpp - Windows - - - PathRelative - Project - common - helpbase.cpp - Windows - - - PathRelative - Project - common - http.cpp - Windows - - - PathRelative - Project - common - iconbndl.cpp - Windows - - - PathRelative - Project - common - imagall.cpp - Windows - - - PathRelative - Project - common - imagbmp.cpp - Windows - - - PathRelative - Project - common - image.cpp - Windows - - - PathRelative - Project - common - imagfill.cpp - Windows - - - PathRelative - Project - common - imaggif.cpp - Windows - - - PathRelative - Project - common - imagiff.cpp - Windows - - - PathRelative - Project - common - imagjpeg.cpp - Windows - - - PathRelative - Project - common - imagpcx.cpp - Windows - - - PathRelative - Project - common - imagpng.cpp - Windows - - - PathRelative - Project - common - imagpnm.cpp - Windows - - - PathRelative - Project - common - imagtiff.cpp - Windows - - - PathRelative - Project - common - imagxpm.cpp - Windows - - - PathRelative - Project - common - intl.cpp - Windows - - - PathRelative - Project - common - ipcbase.cpp - Windows - - - PathRelative - Project - common - layout.cpp - Windows - - - PathRelative - Project - common - lboxcmn.cpp - Windows - - - PathRelative - Project - common - list.cpp - Windows - - - PathRelative - Project - common - log.cpp - Windows - - - PathRelative - Project - common - longlong.cpp - Windows - - - PathRelative - Project - common - matrix.cpp - Windows - - - PathRelative - Project - common - memory.cpp - Windows - - - PathRelative - Project - common - menucmn.cpp - Windows - - - PathRelative - Project - common - mimecmn.cpp - Windows - - - PathRelative - Project - common - module.cpp - Windows - - - PathRelative - Project - common - mstream.cpp - Windows - - - PathRelative - Project - common - nbkbase.cpp - Windows - - - PathRelative - Project - common - object.cpp - Windows - - - PathRelative - Project - common - odbc.cpp - Windows - - - PathRelative - Project - common - paper.cpp - Windows - - - PathRelative - Project - common - popupcmn.cpp - Windows - - - PathRelative - Project - common - prntbase.cpp - Windows - - - PathRelative - Project - common - process.cpp - Windows - - - PathRelative - Project - common - protocol.cpp - Windows - - - PathRelative - Project - common - quantize.cpp - Windows - - - PathRelative - Project - common - radiocmn.cpp - Windows - - - PathRelative - Project - common - regex.cpp - Windows - - - PathRelative - Project - common - resource.cpp - Windows - - - PathRelative - Project - common - sckaddr.cpp - Windows - - - PathRelative - Project - common - sckfile.cpp - Windows - - - PathRelative - Project - common - sckipc.cpp - Windows - - - PathRelative - Project - common - sckstrm.cpp - Windows - - - PathRelative - Project - common - settcmn.cpp - Windows - - - PathRelative - Project - common - sizer.cpp - Windows - - - PathRelative - Project - common - socket.cpp - Windows - - - PathRelative - Project - common - statbar.cpp - Windows - - - PathRelative - Project - common - strconv.cpp - Windows - - - PathRelative - Project - common - stream.cpp - Windows - - - PathRelative - Project - common - string.cpp - Windows - - - PathRelative - Project - common - sysopt.cpp - Windows - - - PathRelative - Project - common - tbarbase.cpp - Windows - - - PathRelative - Project - common - textbuf.cpp - Windows - - - PathRelative - Project - common - textcmn.cpp - Windows - - - PathRelative - Project - common - textfile.cpp - Windows - - - PathRelative - Project - common - timercmn.cpp - Windows - - - PathRelative - Project - common - tokenzr.cpp - Windows - - - PathRelative - Project - common - toplvcmn.cpp - Windows - - - PathRelative - Project - common - treebase.cpp - Windows - - - PathRelative - Project - common - txtstrm.cpp - Windows - - - PathRelative - Project - common - unzip.c - Windows - - - PathRelative - Project - common - url.cpp - Windows - - - PathRelative - Project - common - utilscmn.cpp - Windows - - - PathRelative - Project - common - valgen.cpp - Windows - - - PathRelative - Project - common - validate.cpp - Windows - - - PathRelative - Project - common - valtext.cpp - Windows - - - PathRelative - Project - common - variant.cpp - Windows - - - PathRelative - Project - common - wfstream.cpp - Windows - - - PathRelative - Project - common - wincmn.cpp - Windows - - - PathRelative - Project - common - wxchar.cpp - Windows - - - PathRelative - Project - common - wxexpr.cpp - Windows - - - PathRelative - Project - common - xpmdecod.cpp - Windows - - - PathRelative - Project - common - zipstrm.cpp - Windows - - - PathRelative - Project - common - zstream.cpp - Windows - - - PathRelative - Project - generic - busyinfo.cpp - Windows - - - PathRelative - Project - generic - calctrl.cpp - Windows - - - PathRelative - Project - generic - choicdgg.cpp - Windows - - - PathRelative - Project - generic - dcbuffer.cpp - Windows - - - PathRelative - Project - generic - dcpsg.cpp - Windows - - - PathRelative - Project - generic - dirctrlg.cpp - Windows - - - PathRelative - Project - generic - dragimgg.cpp - Windows - - - PathRelative - Project - generic - grid.cpp - Windows - - - PathRelative - Project - generic - gridctrl.cpp - Windows - - - PathRelative - Project - generic - gridsel.cpp - Windows - - - PathRelative - Project - generic - laywin.cpp - Windows - - - PathRelative - Project - generic - logg.cpp - Windows - - - PathRelative - Project - generic - numdlgg.cpp - Windows - - - PathRelative - Project - generic - panelg.cpp - Windows - - - PathRelative - Project - generic - prntdlgg.cpp - Windows - - - PathRelative - Project - generic - progdlgg.cpp - Windows - - - PathRelative - Project - generic - prop.cpp - Windows - - - PathRelative - Project - generic - propform.cpp - Windows - - - PathRelative - Project - generic - proplist.cpp - Windows - - - PathRelative - Project - generic - sashwin.cpp - Windows - - - PathRelative - Project - generic - scrlwing.cpp - Windows - - - PathRelative - Project - generic - spinctlg.cpp - Windows - - - PathRelative - Project - generic - splash.cpp - Windows - - - PathRelative - Project - generic - splitter.cpp - Windows - - - PathRelative - Project - generic - statusbr.cpp - Windows - - - PathRelative - Project - generic - tbarsmpl.cpp - Windows - - - PathRelative - Project - generic - textdlgg.cpp - Windows - - - PathRelative - Project - generic - tipdlg.cpp - Windows - - - PathRelative - Project - generic - tipwin.cpp - Windows - - - PathRelative - Project - generic - treectlg.cpp - Windows - - - PathRelative - Project - generic - treelay.cpp - Windows - - - PathRelative - Project - generic - wizard.cpp - Windows - - - PathRelative - Project - html - helpctrl.cpp - Windows - - - PathRelative - Project - html - helpdata.cpp - Windows - - - PathRelative - Project - html - helpfrm.cpp - Windows - - - PathRelative - Project - html - htmlcell.cpp - Windows - - - PathRelative - Project - html - htmlfilt.cpp - Windows - - - PathRelative - Project - html - htmlpars.cpp - Windows - - - PathRelative - Project - html - htmltag.cpp - Windows - - - PathRelative - Project - html - htmlwin.cpp - Windows - - - PathRelative - Project - html - htmprint.cpp - Windows - - - PathRelative - Project - html - m_dflist.cpp - Windows - - - PathRelative - Project - html - m_fonts.cpp - Windows - - - PathRelative - Project - html - m_hline.cpp - Windows - - - PathRelative - Project - html - m_image.cpp - Windows - - - PathRelative - Project - html - m_layout.cpp - Windows - - - PathRelative - Project - html - m_links.cpp - Windows - - - PathRelative - Project - html - m_list.cpp - Windows - - - PathRelative - Project - html - m_pre.cpp - Windows - - - PathRelative - Project - html - m_style.cpp - Windows - - - PathRelative - Project - html - m_tables.cpp - Windows - - - PathRelative - Project - html - winpars.cpp - Windows - - - PathRelative - Project - msw - volume.cpp - Windows - - - PathRelative - Project - msw - app.cpp - Windows - - - PathRelative - Project - msw - bitmap.cpp - Windows - - - PathRelative - Project - msw - bmpbuttn.cpp - Windows - - - PathRelative - Project - msw - brush.cpp - Windows - - - PathRelative - Project - msw - button.cpp - Windows - - - PathRelative - Project - msw - caret.cpp - Windows - - - PathRelative - Project - msw - checkbox.cpp - Windows - - - PathRelative - Project - msw - checklst.cpp - Windows - - - PathRelative - Project - msw - choice.cpp - Windows - - - PathRelative - Project - msw - clipbrd.cpp - Windows - - - PathRelative - Project - msw - colordlg.cpp - Windows - - - PathRelative - Project - msw - colour.cpp - Windows - - - PathRelative - Project - msw - combobox.cpp - Windows - - - PathRelative - Project - msw - control.cpp - Windows - - - PathRelative - Project - msw - curico.cpp - Windows - - - PathRelative - Project - msw - cursor.cpp - Windows - - - PathRelative - Project - msw - data.cpp - Windows - - - PathRelative - Project - msw - dc.cpp - Windows - - - PathRelative - Project - msw - dcclient.cpp - Windows - - - PathRelative - Project - msw - dcmemory.cpp - Windows - - - PathRelative - Project - msw - dcprint.cpp - Windows - - - PathRelative - Project - msw - dcscreen.cpp - Windows - - - PathRelative - Project - msw - dde.cpp - Windows - - - PathRelative - Project - msw - dialog.cpp - Windows - - - PathRelative - Project - msw - dialup.cpp - Windows - - - PathRelative - Project - msw - dib.cpp - Windows - - - PathRelative - Project - msw - dibutils.cpp - Windows - - - PathRelative - Project - msw - dir.cpp - Windows - - - PathRelative - Project - msw - dirdlg.cpp - Windows - - - PathRelative - Project - msw - dragimag.cpp - Windows - - - PathRelative - Project - msw - enhmeta.cpp - Windows - - - PathRelative - Project - msw - evtloop.cpp - Windows - - - PathRelative - Project - msw - fdrepdlg.cpp - Windows - - - PathRelative - Project - msw - filedlg.cpp - Windows - - - PathRelative - Project - msw - font.cpp - Windows - - - PathRelative - Project - msw - fontdlg.cpp - Windows - - - PathRelative - Project - msw - fontenum.cpp - Windows - - - PathRelative - Project - msw - fontutil.cpp - Windows - - - PathRelative - Project - msw - frame.cpp - Windows - - - PathRelative - Project - msw - gauge95.cpp - Windows - - - PathRelative - Project - msw - gdiimage.cpp - Windows - - - PathRelative - Project - msw - gdiobj.cpp - Windows - - - PathRelative - Project - msw - glcanvas.cpp - Windows - - - PathRelative - Project - msw - gsocket.c - Windows - - - PathRelative - Project - msw - gsockmsw.c - Windows - - - PathRelative - Project - msw - helpbest.cpp - Windows - - - PathRelative - Project - msw - helpchm.cpp - Windows - - - PathRelative - Project - msw - helpwin.cpp - Windows - - - PathRelative - Project - msw - icon.cpp - Windows - - - PathRelative - Project - msw - imaglist.cpp - Windows - - - PathRelative - Project - msw - iniconf.cpp - Windows - - - PathRelative - Project - msw - joystick.cpp - Windows - - - PathRelative - Project - msw - listbox.cpp - Windows - - - PathRelative - Project - msw - listctrl.cpp - Windows - - - PathRelative - Project - msw - main.cpp - Windows - - - PathRelative - Project - msw - mdi.cpp - Windows - - - PathRelative - Project - msw - menu.cpp - Windows - - - PathRelative - Project - msw - menuitem.cpp - Windows - - - PathRelative - Project - msw - metafile.cpp - Windows - - - PathRelative - Project - msw - mimetype.cpp - Windows - - - PathRelative - Project - msw - minifram.cpp - Windows - - - PathRelative - Project - msw - msgdlg.cpp - Windows - - - PathRelative - Project - msw - mslu.cpp - Windows - - - PathRelative - Project - msw - nativdlg.cpp - Windows - - - PathRelative - Project - msw - notebook.cpp - Windows - - - PathRelative - Project - msw - ownerdrw.cpp - Windows - - - PathRelative - Project - msw - palette.cpp - Windows - - - PathRelative - Project - msw - pen.cpp - Windows - - - PathRelative - Project - msw - penwin.cpp - Windows - - - PathRelative - Project - msw - printdlg.cpp - Windows - - - PathRelative - Project - msw - printwin.cpp - Windows - - - PathRelative - Project - msw - radiobox.cpp - Windows - - - PathRelative - Project - msw - radiobut.cpp - Windows - - - PathRelative - Project - msw - regconf.cpp - Windows - - - PathRelative - Project - msw - region.cpp - Windows - - - PathRelative - Project - msw - registry.cpp - Windows - - - PathRelative - Project - msw - scrolbar.cpp - Windows - - - PathRelative - Project - msw - settings.cpp - Windows - - - PathRelative - Project - msw - slider95.cpp - Windows - - - PathRelative - Project - msw - snglinst.cpp - Windows - - - PathRelative - Project - msw - spinbutt.cpp - Windows - - - PathRelative - Project - msw - spinctrl.cpp - Windows - - - PathRelative - Project - msw - statbmp.cpp - Windows - - - PathRelative - Project - msw - statbox.cpp - Windows - - - PathRelative - Project - msw - statbr95.cpp - Windows - - - PathRelative - Project - msw - statline.cpp - Windows - - - PathRelative - Project - msw - stattext.cpp - Windows - - - PathRelative - Project - msw - tabctrl.cpp - Windows - - - PathRelative - Project - msw - taskbar.cpp - Windows - - - PathRelative - Project - msw - tbar95.cpp - Windows - - - PathRelative - Project - msw - textctrl.cpp - Windows - - - PathRelative - Project - msw - tglbtn.cpp - Windows - - - PathRelative - Project - msw - thread.cpp - Windows - - - PathRelative - Project - msw - timer.cpp - Windows - - - PathRelative - Project - msw - tooltip.cpp - Windows - - - PathRelative - Project - msw - toplevel.cpp - Windows - - - PathRelative - Project - msw - treectrl.cpp - Windows - - - PathRelative - Project - msw - utils.cpp - Windows - - - PathRelative - Project - msw - utilsexc.cpp - Windows - - - PathRelative - Project - msw - accel.cpp - Windows - - - PathRelative - Project - msw - wave.cpp - Windows - - - PathRelative - Project - msw - window.cpp - Windows - - - PathRelative - Project - msw - ole\automtn.cpp - Windows - - - PathRelative - Project - msw - ole\dataobj.cpp - Windows - - - PathRelative - Project - msw - ole\dropsrc.cpp - Windows - - - PathRelative - Project - msw - ole\droptgt.cpp - Windows - - - PathRelative - Project - msw - ole\oleutils.cpp - Windows - - - PathRelative - Project - msw - ole\uuid.cpp - Windows - - - PathRelative - Project - msw - popupwin.cpp - Windows - - - PathRelative - Project - common - msgout.cpp - Windows - - - RootRelative - Project - ..\lib\zlib.lib - Windows - - - RootRelative - Project - ..\lib\tiff.lib - Windows - - - RootRelative - Project - ..\lib\png.lib - Windows - - - RootRelative - Project - ..\lib\jpeg.lib - Windows - - - - - copySetupRelease - - - jpeg - LinkAgainst - - RootRelative - Project - ..\lib\jpeg.lib - Windows - - - - png - LinkAgainst - - RootRelative - Project - ..\lib\png.lib - Windows - - - - tiff - LinkAgainst - - RootRelative - Project - ..\lib\tiff.lib - Windows - - - - zlib - LinkAgainst - - RootRelative - Project - ..\lib\zlib.lib - Windows - - - - - - copySetupDebug - - - - UserSourceTrees - - - AlwaysSearchUserPathsfalse - InterpretDOSAndUnixPathsfalse - RequireFrameworkStyleIncludesfalse - UserSearchPaths - - SearchPath - Path: - PathFormatWindows - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SystemSearchPaths - - SearchPath - Path: - PathFormatWindows - PathRootCodeWarrior - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - - - MWRuntimeSettings_WorkingDirectory - MWRuntimeSettings_CommandLine - MWRuntimeSettings_HostApplication - Path - PathFormatGeneric - PathRootAbsolute - - MWRuntimeSettings_EnvVars - - - LinkerNone - PreLinker - PostLinkerBatch File Runner - TargetnamecopySetupDebug - OutputDirectory - Path - PathFormatWindows - PathRootProject - - SaveEntriesUsingRelativePathsfalse - - - FileMappings - - FileTypeTEXT - FileExtension.bat - Compiler - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.pl - CompilerMW Perl - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - - - CacheModDatestrue - ActivateBrowsertrue - DumpBrowserInfofalse - CacheSubprojectstrue - UseThirdPartyDebuggerfalse - DebuggerAppPath - Path - PathFormatGeneric - PathRootAbsolute - - DebuggerCmdLineArgs - DebuggerWorkingDir - Path - PathFormatGeneric - PathRootAbsolute - - - - LogSystemMessagestrue - AutoTargetDLLsfalse - StopAtWatchpointstrue - PauseWhileRunningfalse - PauseInterval5 - PauseUIFlags0 - AltExePath - Path - PathFormatGeneric - PathRootAbsolute - - StopAtTempBPOnLaunchtrue - CacheSymbolicstrue - TempBPFunctionNamemain - TempBPType0 - - - Enabledfalse - ConnectionName - DownloadPath - LaunchRemoteAppfalse - RemoteAppPath - - - OtherExecutables - - - CustomColor1 - Red0 - Green32767 - Blue0 - - CustomColor2 - Red0 - Green32767 - Blue0 - - CustomColor3 - Red0 - Green32767 - Blue0 - - CustomColor4 - Red0 - Green32767 - Blue0 - - - - Perl_Prefix_Filename - - - MWCodeGen_PPC_structalignmentMC68K - MWCodeGen_PPC_tracebacktablesNone - MWCodeGen_PPC_processorGeneric - MWCodeGen_PPC_readonlystrings0 - MWCodeGen_PPC_tocdata1 - MWCodeGen_PPC_profiler0 - MWCodeGen_PPC_fpcontract1 - MWCodeGen_PPC_schedule0 - MWCodeGen_PPC_peephole1 - MWCodeGen_PPC_processorspecific0 - MWCodeGen_PPC_altivec0 - MWCodeGen_PPC_vectortocdata1 - MWCodeGen_PPC_vrsave1 - - - MWCodeGen_X86_processorGeneric - MWCodeGen_X86_alignmentbytes8 - MWCodeGen_X86_exceptionsZeroOverhead - MWCodeGen_X86_extinst_mmx0 - MWCodeGen_X86_extinst_3dnow0 - MWCodeGen_X86_use_mmx_3dnow_convention0 - MWCodeGen_X86_machinecodelisting0 - MWCodeGen_X86_intrinsics0 - MWCodeGen_X86_syminfo0 - MWCodeGen_X86_codeviewinfo1 - MWCodeGen_X86_extinst_cmov_fcomi0 - MWCodeGen_X86_extinst_sse0 - - - MWDebugger_X86_Exceptions - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - - - - PDisasmX86_showHeaderstrue - PDisasmX86_showSymTabtrue - PDisasmX86_showCodetrue - PDisasmX86_showSourcefalse - PDisasmX86_showHextrue - PDisasmX86_showRelocationtrue - PDisasmX86_showCommentsfalse - PDisasmX86_showDebugfalse - PDisasmX86_showExceptionsfalse - PDisasmX86_showDatatrue - PDisasmX86_showRawfalse - PDisasmX86_verbosefalse - - - MWDisassembler_PPC_showcode1 - MWDisassembler_PPC_extended1 - MWDisassembler_PPC_mix0 - MWDisassembler_PPC_nohex0 - MWDisassembler_PPC_showdata1 - MWDisassembler_PPC_showexceptions1 - MWDisassembler_PPC_showsym0 - MWDisassembler_PPC_shownames1 - - - MWFrontEnd_C_cplusplus0 - MWFrontEnd_C_checkprotos0 - MWFrontEnd_C_arm0 - MWFrontEnd_C_trigraphs0 - MWFrontEnd_C_onlystdkeywords0 - MWFrontEnd_C_enumsalwaysint0 - MWFrontEnd_C_mpwpointerstyle0 - MWFrontEnd_C_prefixname - MWFrontEnd_C_ansistrict0 - MWFrontEnd_C_mpwcnewline0 - MWFrontEnd_C_wchar_type1 - MWFrontEnd_C_enableexceptions1 - MWFrontEnd_C_dontreusestrings0 - MWFrontEnd_C_poolstrings0 - MWFrontEnd_C_dontinline0 - MWFrontEnd_C_useRTTI1 - MWFrontEnd_C_multibyteaware0 - MWFrontEnd_C_unsignedchars0 - MWFrontEnd_C_autoinline0 - MWFrontEnd_C_booltruefalse1 - MWFrontEnd_C_direct_to_som0 - MWFrontEnd_C_som_env_check0 - MWFrontEnd_C_alwaysinline0 - MWFrontEnd_C_inlinelevel0 - MWFrontEnd_C_ecplusplus0 - MWFrontEnd_C_objective_c0 - MWFrontEnd_C_defer_codegen0 - - - MWFTP_Post_hostName - MWFTP_Post_username - MWFTP_Post_password0 - MWFTP_Post_remoteDir - MWFTP_Post_ftp_PathVersion0 - MWFTP_Post_ftp_PathType0 - MWFTP_Post_ftp_PathFormat0 - MWFTP_Post_ftp_tree - MWFTP_Post_uploadDir - MWFTP_Post_ftp_port21 - MWFTP_Post_SendBin1 - MWFTP_Post_ShouldLog1 - - - MWCommandLine_Java_clsName - MWCommandLine_Java_args - - - MWVJavaDebugging_Protocol1 - MWVJavaDebugging_JDKVersion1 - MWVJavaDebugging_TimeOut25 - MWVJavaDebugging_SupportSlowDevicesfalse - - - MWJavaDoc_Proj_Version1 - MWJavaDoc_Proj_Depricated1 - MWJavaDoc_Proj_Author1 - MWJavaDoc_Proj_Index1 - MWJavaDoc_Proj_Tree1 - MWJavaDoc_Proj_SunResolveToSame0 - MWJavaDoc_Proj_Shortnames0 - MWJavaDoc_Proj_Folder0 - MWJavaDoc_Proj_GenerateAPILinks0 - MWJavaDoc_Proj_scopePublic - MWJavaDoc_Proj_encodingName - MWJavaDoc_Proj_decodingName - MWJavaDoc_Proj_javaPackagePathhttp://java.sun.com/products/jdk/1.1/docs/api/ - - - MWJava_Language_optimizefalse - MWJava_Language_warnDeprecatedfalse - MWJava_Language_emitMapfalse - MWJava_Language_strictFileNamesfalse - MWJava_Language_strictFileHierarchyfalse - MWJava_Language_1_1_Compatiblefalse - MWJava_Language_emitHeaders0 - MWJava_Language_headerTypeJNINativeHeaders - MWJava_Language_packageFilter - MWJava_Language_genCommentstrue - MWJava_Language_genHeadersfalse - - - MWJava_Output_outputtypeJarFile - MWJava_Output_outfileJavaClasses.jar - MWJava_Output_ftype1514754080 - MWJava_Output_fcreator1297570384 - MWJava_Output_compress0 - MWJava_Output_genManifest0 - MWJava_Output_trunctypeFront - MWJava_Output_deleteClasses0 - MWJava_Output_consoleApp1 - - - MWJava_Proj_projtypeApplet - MWJava_Proj_mainClassName - MWJava_Proj_HTMLAppCreator1463898714 - MWJava_Proj_HTMLAppName - MWJava_Proj_PathVersion0 - MWJava_Proj_PathType0 - MWJava_Proj_PathFormat0 - MWJava_Proj_tree - MWJava_Proj_HTMLAppWin32Name - MWJava_Proj_compress0 - MWJava_Proj_useVM1 - MWJava_Proj_vmarguments - MWJava_Proj_vmName - MWJava_Proj_simPropFile - MWJava_Proj_useJCVM1 - MWJava_Proj_aidData - - - MWLinker_PPC_linksym1 - MWLinker_PPC_symfullpath1 - MWLinker_PPC_linkmap0 - MWLinker_PPC_nolinkwarnings0 - MWLinker_PPC_dontdeadstripinitcode0 - MWLinker_PPC_permitmultdefs0 - MWLinker_PPC_linkmodeFast - MWLinker_PPC_initname - MWLinker_PPC_mainname__start - MWLinker_PPC_termname - - - MWLinker_X86_entrypointusageDefault - MWLinker_X86_entrypoint - MWLinker_X86_subsystemWinGUI - MWLinker_X86_subsysmajorid4 - MWLinker_X86_subsysminorid0 - MWLinker_X86_usrmajorid0 - MWLinker_X86_usrminorid0 - MWLinker_X86_commandfile - MWLinker_X86_generatemap0 - MWLinker_X86_linksym0 - MWLinker_X86_linkCV1 - - - MWMerge_MacOS_projectTypeApplication - MWMerge_MacOS_outputNameMerge Out - MWMerge_MacOS_outputCreator???? - MWMerge_MacOS_outputTypeAPPL - MWMerge_MacOS_suppressWarning0 - MWMerge_MacOS_copyFragments1 - MWMerge_MacOS_copyResources1 - MWMerge_MacOS_flattenResource0 - MWMerge_MacOS_flatFileNamea.rsrc - MWMerge_MacOS_flatFileOutputPath - Path: - PathFormatMacOS - PathRootProject - - MWMerge_MacOS_skipResources - DGLX - ckid - Proj - WSPC - mcvs - - - - MWMacOSPackager_UsePackager0 - MWMacOSPackager_FolderToPackage - Path: - PathFormatMacOS - PathRootProject - - MWMacOSPackager_CreateClassicAlias0 - MWMacOSPackager_ClassicAliasMethodUseTargetOutput - MWMacOSPackager_ClassicAliasPath - Path: - PathFormatMacOS - PathRootProject - - MWMacOSPackager_CreatePkgInfo0 - MWMacOSPackager_PkgCreatorType???? - MWMacOSPackager_PkgFileTypeLPPA - - - MWPEF_exportsNone - MWPEF_libfolder0 - MWPEF_sortcodeNone - MWPEF_expandbss0 - MWPEF_sharedata0 - MWPEF_olddefversion0 - MWPEF_oldimpversion0 - MWPEF_currentversion0 - MWPEF_fragmentname - MWPEF_collapsereloads0 - - - MWAssembler_PPC_auxheader0 - MWAssembler_PPC_symmodeMac - MWAssembler_PPC_dialectPPC - MWAssembler_PPC_prefixfile - MWAssembler_PPC_typecheck0 - MWAssembler_PPC_warnings0 - MWAssembler_PPC_casesensitive0 - - - GlobalOptimizer_PPC_optimizationlevelLevel0 - GlobalOptimizer_PPC_optforSpeed - - - MWProject_PPC_typeApplication - MWProject_PPC_outfilea.out - MWProject_PPC_filecreator???? - MWProject_PPC_filetypeAPPL - MWProject_PPC_size384 - MWProject_PPC_minsize384 - MWProject_PPC_stacksize64 - MWProject_PPC_flags22720 - MWProject_PPC_symfilename - MWProject_PPC_rsrcname - MWProject_PPC_rsrcheaderNative - MWProject_PPC_rsrctype???? - MWProject_PPC_rsrcid0 - MWProject_PPC_rsrcflags0 - MWProject_PPC_rsrcstore0 - MWProject_PPC_rsrcmerge0 - MWProject_PPC_flatrsrc0 - MWProject_PPC_flatrsrcoutputdir - Path: - PathFormatMacOS - PathRootProject - - MWProject_PPC_flatrsrcfilename - - - MWProject_X86_typeApplication - MWProject_X86_outfilenoname.exe - MWProject_X86_baseaddress4194304 - MWProject_X86_maxstacksize1024 - MWProject_X86_minstacksize4 - MWProject_X86_size1024 - MWProject_X86_minsize4 - MWProject_X86_importlib - Resource Flattener Panel - 0100000000000000000000000000000000000000000000000000000000000000 - 0000074F75742E62696E00000000000000000000000000000000000000000000 - 0000 - - - - MWRez_Language_maxwidth80 - MWRez_Language_scriptRoman - MWRez_Language_alignmentAlign1 - MWRez_Language_filtermodeFilterSkip - MWRez_Language_suppresswarnings0 - MWRez_Language_escapecontrolchars1 - MWRez_Language_prefixname - MWRez_Language_filteredtypes'CODE' 'DATA' 'PICT' - - - MWWarning_C_warn_illpragma0 - MWWarning_C_warn_emptydecl0 - MWWarning_C_warn_possunwant0 - MWWarning_C_warn_unusedvar0 - MWWarning_C_warn_unusedarg0 - MWWarning_C_warn_extracomma0 - MWWarning_C_pedantic0 - MWWarning_C_warningerrors0 - MWWarning_C_warn_hidevirtual0 - MWWarning_C_warn_implicitconv0 - MWWarning_C_warn_notinlined0 - MWWarning_C_warn_structclass0 - - - MWWinRC_prefixname - - - GlobalOptimizer_X86__optimizationlevelLevel0 - GlobalOptimizer_X86__optforSpeed - - - - Name - cwdcopysetup.bat - Windows - Text - Debug - - - - - Name - cwdcopysetup.bat - Windows - - - - - copySetupRelease - - - - UserSourceTrees - - - AlwaysSearchUserPathsfalse - InterpretDOSAndUnixPathsfalse - RequireFrameworkStyleIncludesfalse - UserSearchPaths - - SearchPath - Path: - PathFormatWindows - PathRootProject - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - SystemSearchPaths - - SearchPath - Path: - PathFormatWindows - PathRootCodeWarrior - - Recursivetrue - FrameworkPathfalse - HostFlagsAll - - - - - MWRuntimeSettings_WorkingDirectory - MWRuntimeSettings_CommandLine - MWRuntimeSettings_HostApplication - Path - PathFormatGeneric - PathRootAbsolute - - MWRuntimeSettings_EnvVars - - - LinkerNone - PreLinker - PostLinkerBatch File Runner - TargetnamecopySetupRelease - OutputDirectory - Path - PathFormatWindows - PathRootProject - - SaveEntriesUsingRelativePathsfalse - - - FileMappings - - FileTypeTEXT - FileExtension.bat - Compiler - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - FileTypeTEXT - FileExtension.pl - CompilerMW Perl - EditLanguage - Precompilefalse - Launchablefalse - ResourceFilefalse - IgnoredByMakefalse - - - - - CacheModDatestrue - ActivateBrowsertrue - DumpBrowserInfofalse - CacheSubprojectstrue - UseThirdPartyDebuggerfalse - DebuggerAppPath - Path - PathFormatGeneric - PathRootAbsolute - - DebuggerCmdLineArgs - DebuggerWorkingDir - Path - PathFormatGeneric - PathRootAbsolute - - - - LogSystemMessagestrue - AutoTargetDLLsfalse - StopAtWatchpointstrue - PauseWhileRunningfalse - PauseInterval5 - PauseUIFlags0 - AltExePath - Path - PathFormatGeneric - PathRootAbsolute - - StopAtTempBPOnLaunchtrue - CacheSymbolicstrue - TempBPFunctionNamemain - TempBPType0 - - - Enabledfalse - ConnectionName - DownloadPath - LaunchRemoteAppfalse - RemoteAppPath - - - OtherExecutables - - - CustomColor1 - Red0 - Green32767 - Blue0 - - CustomColor2 - Red0 - Green32767 - Blue0 - - CustomColor3 - Red0 - Green32767 - Blue0 - - CustomColor4 - Red0 - Green32767 - Blue0 - - - - Perl_Prefix_Filename - - - MWCodeGen_PPC_structalignmentMC68K - MWCodeGen_PPC_tracebacktablesNone - MWCodeGen_PPC_processorGeneric - MWCodeGen_PPC_readonlystrings0 - MWCodeGen_PPC_tocdata1 - MWCodeGen_PPC_profiler0 - MWCodeGen_PPC_fpcontract1 - MWCodeGen_PPC_schedule0 - MWCodeGen_PPC_peephole1 - MWCodeGen_PPC_processorspecific0 - MWCodeGen_PPC_altivec0 - MWCodeGen_PPC_vectortocdata1 - MWCodeGen_PPC_vrsave1 - - - MWCodeGen_X86_processorGeneric - MWCodeGen_X86_alignmentbytes8 - MWCodeGen_X86_exceptionsZeroOverhead - MWCodeGen_X86_extinst_mmx0 - MWCodeGen_X86_extinst_3dnow0 - MWCodeGen_X86_use_mmx_3dnow_convention0 - MWCodeGen_X86_machinecodelisting0 - MWCodeGen_X86_intrinsics0 - MWCodeGen_X86_syminfo0 - MWCodeGen_X86_codeviewinfo1 - MWCodeGen_X86_extinst_cmov_fcomi0 - MWCodeGen_X86_extinst_sse0 - - - MWDebugger_X86_Exceptions - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - - - - PDisasmX86_showHeaderstrue - PDisasmX86_showSymTabtrue - PDisasmX86_showCodetrue - PDisasmX86_showSourcefalse - PDisasmX86_showHextrue - PDisasmX86_showRelocationtrue - PDisasmX86_showCommentsfalse - PDisasmX86_showDebugfalse - PDisasmX86_showExceptionsfalse - PDisasmX86_showDatatrue - PDisasmX86_showRawfalse - PDisasmX86_verbosefalse - - - MWDisassembler_PPC_showcode1 - MWDisassembler_PPC_extended1 - MWDisassembler_PPC_mix0 - MWDisassembler_PPC_nohex0 - MWDisassembler_PPC_showdata1 - MWDisassembler_PPC_showexceptions1 - MWDisassembler_PPC_showsym0 - MWDisassembler_PPC_shownames1 - - - MWFrontEnd_C_cplusplus0 - MWFrontEnd_C_checkprotos0 - MWFrontEnd_C_arm0 - MWFrontEnd_C_trigraphs0 - MWFrontEnd_C_onlystdkeywords0 - MWFrontEnd_C_enumsalwaysint0 - MWFrontEnd_C_mpwpointerstyle0 - MWFrontEnd_C_prefixname - MWFrontEnd_C_ansistrict0 - MWFrontEnd_C_mpwcnewline0 - MWFrontEnd_C_wchar_type1 - MWFrontEnd_C_enableexceptions1 - MWFrontEnd_C_dontreusestrings0 - MWFrontEnd_C_poolstrings0 - MWFrontEnd_C_dontinline0 - MWFrontEnd_C_useRTTI1 - MWFrontEnd_C_multibyteaware0 - MWFrontEnd_C_unsignedchars0 - MWFrontEnd_C_autoinline0 - MWFrontEnd_C_booltruefalse1 - MWFrontEnd_C_direct_to_som0 - MWFrontEnd_C_som_env_check0 - MWFrontEnd_C_alwaysinline0 - MWFrontEnd_C_inlinelevel0 - MWFrontEnd_C_ecplusplus0 - MWFrontEnd_C_objective_c0 - MWFrontEnd_C_defer_codegen0 - - - MWFTP_Post_hostName - MWFTP_Post_username - MWFTP_Post_password0 - MWFTP_Post_remoteDir - MWFTP_Post_ftp_PathVersion0 - MWFTP_Post_ftp_PathType0 - MWFTP_Post_ftp_PathFormat0 - MWFTP_Post_ftp_tree - MWFTP_Post_uploadDir - MWFTP_Post_ftp_port21 - MWFTP_Post_SendBin1 - MWFTP_Post_ShouldLog1 - - - MWCommandLine_Java_clsName - MWCommandLine_Java_args - - - MWVJavaDebugging_Protocol1 - MWVJavaDebugging_JDKVersion1 - MWVJavaDebugging_TimeOut25 - MWVJavaDebugging_SupportSlowDevicesfalse - - - MWJavaDoc_Proj_Version1 - MWJavaDoc_Proj_Depricated1 - MWJavaDoc_Proj_Author1 - MWJavaDoc_Proj_Index1 - MWJavaDoc_Proj_Tree1 - MWJavaDoc_Proj_SunResolveToSame0 - MWJavaDoc_Proj_Shortnames0 - MWJavaDoc_Proj_Folder0 - MWJavaDoc_Proj_GenerateAPILinks0 - MWJavaDoc_Proj_scopePublic - MWJavaDoc_Proj_encodingName - MWJavaDoc_Proj_decodingName - MWJavaDoc_Proj_javaPackagePathhttp://java.sun.com/products/jdk/1.1/docs/api/ - - - MWJava_Language_optimizefalse - MWJava_Language_warnDeprecatedfalse - MWJava_Language_emitMapfalse - MWJava_Language_strictFileNamesfalse - MWJava_Language_strictFileHierarchyfalse - MWJava_Language_1_1_Compatiblefalse - MWJava_Language_emitHeaders0 - MWJava_Language_headerTypeJNINativeHeaders - MWJava_Language_packageFilter - MWJava_Language_genCommentstrue - MWJava_Language_genHeadersfalse - - - MWJava_Output_outputtypeJarFile - MWJava_Output_outfileJavaClasses.jar - MWJava_Output_ftype1514754080 - MWJava_Output_fcreator1297570384 - MWJava_Output_compress0 - MWJava_Output_genManifest0 - MWJava_Output_trunctypeFront - MWJava_Output_deleteClasses0 - MWJava_Output_consoleApp1 - - - MWJava_Proj_projtypeApplet - MWJava_Proj_mainClassName - MWJava_Proj_HTMLAppCreator1463898714 - MWJava_Proj_HTMLAppName - MWJava_Proj_PathVersion0 - MWJava_Proj_PathType0 - MWJava_Proj_PathFormat0 - MWJava_Proj_tree - MWJava_Proj_HTMLAppWin32Name - MWJava_Proj_compress0 - MWJava_Proj_useVM1 - MWJava_Proj_vmarguments - MWJava_Proj_vmName - MWJava_Proj_simPropFile - MWJava_Proj_useJCVM1 - MWJava_Proj_aidData - - - MWLinker_PPC_linksym1 - MWLinker_PPC_symfullpath1 - MWLinker_PPC_linkmap0 - MWLinker_PPC_nolinkwarnings0 - MWLinker_PPC_dontdeadstripinitcode0 - MWLinker_PPC_permitmultdefs0 - MWLinker_PPC_linkmodeFast - MWLinker_PPC_initname - MWLinker_PPC_mainname__start - MWLinker_PPC_termname - - - MWLinker_X86_entrypointusageDefault - MWLinker_X86_entrypoint - MWLinker_X86_subsystemWinGUI - MWLinker_X86_subsysmajorid4 - MWLinker_X86_subsysminorid0 - MWLinker_X86_usrmajorid0 - MWLinker_X86_usrminorid0 - MWLinker_X86_commandfile - MWLinker_X86_generatemap0 - MWLinker_X86_linksym0 - MWLinker_X86_linkCV1 - - - MWMerge_MacOS_projectTypeApplication - MWMerge_MacOS_outputNameMerge Out - MWMerge_MacOS_outputCreator???? - MWMerge_MacOS_outputTypeAPPL - MWMerge_MacOS_suppressWarning0 - MWMerge_MacOS_copyFragments1 - MWMerge_MacOS_copyResources1 - MWMerge_MacOS_flattenResource0 - MWMerge_MacOS_flatFileNamea.rsrc - MWMerge_MacOS_flatFileOutputPath - Path: - PathFormatMacOS - PathRootProject - - MWMerge_MacOS_skipResources - DGLX - ckid - Proj - WSPC - mcvs - - - - MWMacOSPackager_UsePackager0 - MWMacOSPackager_FolderToPackage - Path: - PathFormatMacOS - PathRootProject - - MWMacOSPackager_CreateClassicAlias0 - MWMacOSPackager_ClassicAliasMethodUseTargetOutput - MWMacOSPackager_ClassicAliasPath - Path: - PathFormatMacOS - PathRootProject - - MWMacOSPackager_CreatePkgInfo0 - MWMacOSPackager_PkgCreatorType???? - MWMacOSPackager_PkgFileTypeLPPA - - - MWPEF_exportsNone - MWPEF_libfolder0 - MWPEF_sortcodeNone - MWPEF_expandbss0 - MWPEF_sharedata0 - MWPEF_olddefversion0 - MWPEF_oldimpversion0 - MWPEF_currentversion0 - MWPEF_fragmentname - MWPEF_collapsereloads0 - - - MWAssembler_PPC_auxheader0 - MWAssembler_PPC_symmodeMac - MWAssembler_PPC_dialectPPC - MWAssembler_PPC_prefixfile - MWAssembler_PPC_typecheck0 - MWAssembler_PPC_warnings0 - MWAssembler_PPC_casesensitive0 - - - GlobalOptimizer_PPC_optimizationlevelLevel0 - GlobalOptimizer_PPC_optforSpeed - - - MWProject_PPC_typeApplication - MWProject_PPC_outfilea.out - MWProject_PPC_filecreator???? - MWProject_PPC_filetypeAPPL - MWProject_PPC_size384 - MWProject_PPC_minsize384 - MWProject_PPC_stacksize64 - MWProject_PPC_flags22720 - MWProject_PPC_symfilename - MWProject_PPC_rsrcname - MWProject_PPC_rsrcheaderNative - MWProject_PPC_rsrctype???? - MWProject_PPC_rsrcid0 - MWProject_PPC_rsrcflags0 - MWProject_PPC_rsrcstore0 - MWProject_PPC_rsrcmerge0 - MWProject_PPC_flatrsrc0 - MWProject_PPC_flatrsrcoutputdir - Path: - PathFormatMacOS - PathRootProject - - MWProject_PPC_flatrsrcfilename - - - MWProject_X86_typeApplication - MWProject_X86_outfilenoname.exe - MWProject_X86_baseaddress4194304 - MWProject_X86_maxstacksize1024 - MWProject_X86_minstacksize4 - MWProject_X86_size1024 - MWProject_X86_minsize4 - MWProject_X86_importlib - Resource Flattener Panel - 0100000000000000000000000000000000000000000000000000000000000000 - 0000074F75742E62696E00000000000000000000000000000000000000000000 - 0000 - - - - MWRez_Language_maxwidth80 - MWRez_Language_scriptRoman - MWRez_Language_alignmentAlign1 - MWRez_Language_filtermodeFilterSkip - MWRez_Language_suppresswarnings0 - MWRez_Language_escapecontrolchars1 - MWRez_Language_prefixname - MWRez_Language_filteredtypes'CODE' 'DATA' 'PICT' - - - MWWarning_C_warn_illpragma0 - MWWarning_C_warn_emptydecl0 - MWWarning_C_warn_possunwant0 - MWWarning_C_warn_unusedvar0 - MWWarning_C_warn_unusedarg0 - MWWarning_C_warn_extracomma0 - MWWarning_C_pedantic0 - MWWarning_C_warningerrors0 - MWWarning_C_warn_hidevirtual0 - MWWarning_C_warn_implicitconv0 - MWWarning_C_warn_notinlined0 - MWWarning_C_warn_structclass0 - - - MWWinRC_prefixname - - - GlobalOptimizer_X86__optimizationlevelLevel0 - GlobalOptimizer_X86__optforSpeed - - - - Name - cwcopysetup.bat - Windows - Text - Debug - - - - - Name - cwcopysetup.bat - Windows - - - - - - - wxlib Win32 debug - wxlib Win32 release - jpeg - png - tiff - zlib - copySetupDebug - copySetupRelease - - - - batch files - - copySetupRelease - Name - cwcopysetup.bat - Windows - - - copySetupDebug - Name - cwdcopysetup.bat - Windows - - - common - - wxlib Win32 debug - PathRelative - Project - common - appcmn.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - common - artprov.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - common - artstd.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - common - choiccmn.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - common - clipcmn.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - common - clntdata.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - common - cmdline.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - common - cmdproc.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - common - cmndata.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - common - config.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - common - containr.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - common - cshelp.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - common - ctrlcmn.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - common - ctrlsub.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - common - datetime.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - common - datstrm.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - common - db.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - common - dbgrid.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - common - dbtable.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - common - dcbase.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - common - dircmn.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - common - dlgcmn.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - common - dndcmn.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - common - dobjcmn.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - common - docmdi.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - common - docview.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - common - dseldlg.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - common - dynarray.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - common - dynlib.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - common - dynload.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - common - effects.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - common - encconv.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - common - event.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - common - extended.c - Windows - - - wxlib Win32 debug - PathRelative - Project - common - fddlgcmn.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - common - ffile.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - common - file.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - common - fileconf.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - common - filefn.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - common - filename.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - common - filesys.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - common - fontcmn.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - common - fontmap.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - common - framecmn.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - common - fs_inet.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - common - fs_mem.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - common - fs_zip.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - common - ftp.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - common - gaugecmn.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - common - gdicmn.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - common - geometry.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - common - gifdecod.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - common - hash.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - common - hashmap.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - common - helpbase.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - common - http.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - common - iconbndl.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - common - imagall.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - common - imagbmp.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - common - image.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - common - imagfill.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - common - imaggif.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - common - imagiff.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - common - imagjpeg.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - common - imagpcx.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - common - imagpng.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - common - imagpnm.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - common - imagtiff.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - common - imagxpm.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - common - intl.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - common - ipcbase.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - common - layout.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - common - lboxcmn.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - common - list.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - common - log.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - common - longlong.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - common - matrix.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - common - memory.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - common - menucmn.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - common - mimecmn.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - common - module.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - common - msgout.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - common - mstream.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - common - nbkbase.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - common - object.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - common - odbc.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - common - paper.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - common - popupcmn.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - common - prntbase.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - common - process.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - common - protocol.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - common - quantize.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - common - radiocmn.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - common - regex.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - common - resource.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - common - sckaddr.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - common - sckfile.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - common - sckipc.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - common - sckstrm.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - common - settcmn.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - common - sizer.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - common - socket.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - common - statbar.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - common - strconv.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - common - stream.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - common - string.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - common - sysopt.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - common - tbarbase.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - common - textbuf.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - common - textcmn.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - common - textfile.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - common - timercmn.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - common - tokenzr.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - common - toplvcmn.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - common - treebase.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - common - txtstrm.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - common - unzip.c - Windows - - - wxlib Win32 debug - PathRelative - Project - common - url.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - common - utilscmn.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - common - valgen.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - common - validate.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - common - valtext.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - common - variant.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - common - wfstream.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - common - wincmn.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - common - wxchar.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - common - wxexpr.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - common - xpmdecod.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - common - zipstrm.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - common - zstream.cpp - Windows - - - generic - - wxlib Win32 debug - PathRelative - Project - generic - busyinfo.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - generic - calctrl.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - generic - choicdgg.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - generic - dcbuffer.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - generic - dcpsg.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - generic - dirctrlg.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - generic - dragimgg.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - generic - grid.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - generic - gridctrl.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - generic - gridsel.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - generic - laywin.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - generic - logg.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - generic - numdlgg.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - generic - panelg.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - generic - prntdlgg.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - generic - progdlgg.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - generic - prop.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - generic - propform.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - generic - proplist.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - generic - sashwin.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - generic - scrlwing.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - generic - spinctlg.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - generic - splash.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - generic - splitter.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - generic - statusbr.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - generic - tbarsmpl.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - generic - textdlgg.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - generic - tipdlg.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - generic - tipwin.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - generic - treectlg.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - generic - treelay.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - generic - wizard.cpp - Windows - - - headers - - wxlib Win32 release - PathRelative - Project - ..\include - wx_cw.pch - Windows - - - wxlib Win32 release - PathRelative - Project - ..\include - wx_cw.pch++ - Windows - - - wxlib Win32 debug - PathRelative - Project - ..\include - wx_cw_d.pch - Windows - - - wxlib Win32 debug - PathRelative - Project - ..\include - wx_cw_d.pch++ - Windows - - - html - - wxlib Win32 debug - PathRelative - Project - html - helpctrl.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - html - helpdata.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - html - helpfrm.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - html - htmlcell.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - html - htmlfilt.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - html - htmlpars.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - html - htmltag.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - html - htmlwin.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - html - htmprint.cpp - Windows - - modules - - wxlib Win32 debug - PathRelative - Project - html - m_dflist.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - html - m_fonts.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - html - m_hline.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - html - m_image.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - html - m_layout.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - html - m_links.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - html - m_list.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - html - m_pre.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - html - m_style.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - html - m_tables.cpp - Windows - - - - wxlib Win32 debug - PathRelative - Project - html - winpars.cpp - Windows - - - msw - - wxlib Win32 debug - PathRelative - Project - msw - accel.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - msw - app.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - msw - ole\automtn.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - msw - bitmap.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - msw - bmpbuttn.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - msw - brush.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - msw - button.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - msw - caret.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - msw - checkbox.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - msw - checklst.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - msw - choice.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - msw - clipbrd.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - msw - colordlg.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - msw - colour.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - msw - combobox.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - msw - control.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - msw - curico.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - msw - cursor.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - msw - data.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - msw - ole\dataobj.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - msw - dc.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - msw - dcclient.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - msw - dcmemory.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - msw - dcprint.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - msw - dcscreen.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - msw - dde.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - msw - dialog.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - msw - dialup.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - msw - dib.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - msw - dibutils.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - msw - dir.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - msw - dirdlg.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - msw - dragimag.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - msw - ole\dropsrc.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - msw - ole\droptgt.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - msw - enhmeta.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - msw - evtloop.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - msw - fdrepdlg.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - msw - filedlg.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - msw - font.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - msw - fontdlg.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - msw - fontenum.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - msw - fontutil.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - msw - frame.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - msw - gauge95.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - msw - gdiimage.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - msw - gdiobj.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - msw - glcanvas.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - msw - gsocket.c - Windows - - - wxlib Win32 debug - PathRelative - Project - msw - gsockmsw.c - Windows - - - wxlib Win32 debug - PathRelative - Project - msw - helpbest.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - msw - helpchm.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - msw - helpwin.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - msw - icon.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - msw - imaglist.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - msw - iniconf.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - msw - joystick.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - msw - listbox.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - msw - listctrl.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - msw - main.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - msw - mdi.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - msw - menu.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - msw - menuitem.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - msw - metafile.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - msw - mimetype.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - msw - minifram.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - msw - msgdlg.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - msw - mslu.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - msw - nativdlg.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - msw - notebook.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - msw - ole\oleutils.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - msw - ownerdrw.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - msw - palette.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - msw - pen.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - msw - penwin.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - msw - popupwin.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - msw - printdlg.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - msw - printwin.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - msw - radiobox.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - msw - radiobut.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - msw - regconf.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - msw - region.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - msw - registry.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - msw - scrolbar.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - msw - settings.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - msw - slider95.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - msw - snglinst.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - msw - spinbutt.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - msw - spinctrl.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - msw - statbmp.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - msw - statbox.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - msw - statbr95.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - msw - statline.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - msw - stattext.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - msw - tabctrl.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - msw - taskbar.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - msw - tbar95.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - msw - textctrl.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - msw - tglbtn.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - msw - thread.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - msw - timer.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - msw - tooltip.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - msw - toplevel.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - msw - treectrl.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - msw - utils.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - msw - utilsexc.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - msw - ole\uuid.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - msw - volume.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - msw - wave.cpp - Windows - - - wxlib Win32 debug - PathRelative - Project - msw - window.cpp - Windows - - - wx-addon libraries - jpeg - - jpeg - PathRelative - Project - - jpeg\jcapimin.c - Windows - - - jpeg - PathRelative - Project - - jpeg\jcapistd.c - Windows - - - jpeg - PathRelative - Project - - jpeg\jccoefct.c - Windows - - - jpeg - PathRelative - Project - - jpeg\jccolor.c - Windows - - - jpeg - PathRelative - Project - - jpeg\jcdctmgr.c - Windows - - - jpeg - PathRelative - Project - - jpeg\jchuff.c - Windows - - - jpeg - PathRelative - Project - - jpeg\jcinit.c - Windows - - - jpeg - PathRelative - Project - - jpeg\jcmainct.c - Windows - - - jpeg - PathRelative - Project - - jpeg\jcmarker.c - Windows - - - jpeg - PathRelative - Project - - jpeg\jcmaster.c - Windows - - - jpeg - PathRelative - Project - - jpeg\jcomapi.c - Windows - - - jpeg - PathRelative - Project - - jpeg\jcparam.c - Windows - - - jpeg - PathRelative - Project - - jpeg\jcphuff.c - Windows - - - jpeg - PathRelative - Project - - jpeg\jcprepct.c - Windows - - - jpeg - PathRelative - Project - - jpeg\jcsample.c - Windows - - - jpeg - PathRelative - Project - - jpeg\jctrans.c - Windows - - - jpeg - PathRelative - Project - - jpeg\jdapimin.c - Windows - - - jpeg - PathRelative - Project - - jpeg\jdapistd.c - Windows - - - jpeg - PathRelative - Project - - jpeg\jdatadst.c - Windows - - - jpeg - PathRelative - Project - - jpeg\jdatasrc.c - Windows - - - jpeg - PathRelative - Project - - jpeg\jdcoefct.c - Windows - - - jpeg - PathRelative - Project - - jpeg\jdcolor.c - Windows - - - jpeg - PathRelative - Project - - jpeg\jddctmgr.c - Windows - - - jpeg - PathRelative - Project - - jpeg\jdhuff.c - Windows - - - jpeg - PathRelative - Project - - jpeg\jdinput.c - Windows - - - jpeg - PathRelative - Project - - jpeg\jdmainct.c - Windows - - - jpeg - PathRelative - Project - - jpeg\jdmarker.c - Windows - - - jpeg - PathRelative - Project - - jpeg\jdmaster.c - Windows - - - jpeg - PathRelative - Project - - jpeg\jdmerge.c - Windows - - - jpeg - PathRelative - Project - - jpeg\jdphuff.c - Windows - - - jpeg - PathRelative - Project - - jpeg\jdpostct.c - Windows - - - jpeg - PathRelative - Project - - jpeg\jdsample.c - Windows - - - jpeg - PathRelative - Project - - jpeg\jdtrans.c - Windows - - - jpeg - PathRelative - Project - - jpeg\jerror.c - Windows - - - jpeg - PathRelative - Project - - jpeg\jfdctflt.c - Windows - - - jpeg - PathRelative - Project - - jpeg\jfdctfst.c - Windows - - - jpeg - PathRelative - Project - - jpeg\jfdctint.c - Windows - - - jpeg - PathRelative - Project - - jpeg\jidctflt.c - Windows - - - jpeg - PathRelative - Project - - jpeg\jidctfst.c - Windows - - - jpeg - PathRelative - Project - - jpeg\jidctint.c - Windows - - - jpeg - PathRelative - Project - - jpeg\jidctred.c - Windows - - - jpeg - PathRelative - Project - - jpeg\jmemansi.c - Windows - - - jpeg - PathRelative - Project - - jpeg\jmemmgr.c - Windows - - - jpeg - PathRelative - Project - - jpeg\jquant1.c - Windows - - - jpeg - PathRelative - Project - - jpeg\jquant2.c - Windows - - - jpeg - PathRelative - Project - - jpeg\jutils.c - Windows - - - tiff - - tiff - PathRelative - Project - - tiff\tif_aux.c - Windows - - - tiff - PathRelative - Project - - tiff\tif_close.c - Windows - - - tiff - PathRelative - Project - - tiff\tif_codec.c - Windows - - - tiff - PathRelative - Project - - tiff\tif_compress.c - Windows - - - tiff - PathRelative - Project - - tiff\tif_dir.c - Windows - - - tiff - PathRelative - Project - - tiff\tif_dirinfo.c - Windows - - - tiff - PathRelative - Project - - tiff\tif_dirread.c - Windows - - - tiff - PathRelative - Project - - tiff\tif_dirwrite.c - Windows - - - tiff - PathRelative - Project - - tiff\tif_dumpmode.c - Windows - - - tiff - PathRelative - Project - - tiff\tif_error.c - Windows - - - tiff - PathRelative - Project - - tiff\tif_fax3.c - Windows - - - tiff - PathRelative - Project - - tiff\tif_fax3sm.c - Windows - - - tiff - PathRelative - Project - - tiff\tif_flush.c - Windows - - - tiff - PathRelative - Project - - tiff\tif_getimage.c - Windows - - - tiff - PathRelative - Project - - tiff\tif_jpeg.c - Windows - - - tiff - PathRelative - Project - - tiff\tif_luv.c - Windows - - - tiff - PathRelative - Project - - tiff\tif_lzw.c - Windows - - - tiff - PathRelative - Project - - tiff\tif_next.c - Windows - - - tiff - PathRelative - Project - - tiff\tif_open.c - Windows - - - tiff - PathRelative - Project - - tiff\tif_packbits.c - Windows - - - tiff - PathRelative - Project - - tiff\tif_pixarlog.c - Windows - - - tiff - PathRelative - Project - - tiff\tif_predict.c - Windows - - - tiff - PathRelative - Project - - tiff\tif_print.c - Windows - - - tiff - PathRelative - Project - - tiff\tif_read.c - Windows - - - tiff - PathRelative - Project - - tiff\tif_strip.c - Windows - - - tiff - PathRelative - Project - - tiff\tif_swab.c - Windows - - - tiff - PathRelative - Project - - tiff\tif_thunder.c - Windows - - - tiff - PathRelative - Project - - tiff\tif_tile.c - Windows - - - tiff - PathRelative - Project - - tiff\tif_version.c - Windows - - - tiff - PathRelative - Project - - tiff\tif_warning.c - Windows - - - tiff - PathRelative - Project - - tiff\tif_win32.c - Windows - - - tiff - PathRelative - Project - - tiff\tif_write.c - Windows - - - tiff - PathRelative - Project - - tiff\tif_zip.c - Windows - - - png - - png - PathRelative - Project - - png\png.c - Windows - - - png - PathRelative - Project - - png\pngerror.c - Windows - - - png - PathRelative - Project - - png\pngget.c - Windows - - - png - PathRelative - Project - - png\pngmem.c - Windows - - - png - PathRelative - Project - - png\pngpread.c - Windows - - - png - PathRelative - Project - - png\pngread.c - Windows - - - png - PathRelative - Project - - png\pngrio.c - Windows - - - png - PathRelative - Project - - png\pngrtran.c - Windows - - - png - PathRelative - Project - - png\pngrutil.c - Windows - - - png - PathRelative - Project - - png\pngset.c - Windows - - - png - PathRelative - Project - - png\pngtrans.c - Windows - - - png - PathRelative - Project - - png\pngwio.c - Windows - - - png - PathRelative - Project - - png\pngwrite.c - Windows - - - png - PathRelative - Project - - png\pngwtran.c - Windows - - - png - PathRelative - Project - - png\pngwutil.c - Windows - - - zlib - - zlib - PathRelative - Project - - zlib\adler32.c - Windows - - - zlib - PathRelative - Project - - zlib\compress.c - Windows - - - zlib - PathRelative - Project - - zlib\crc32.c - Windows - - - zlib - PathRelative - Project - - zlib\deflate.c - Windows - - - zlib - PathRelative - Project - - zlib\gzio.c - Windows - - - zlib - PathRelative - Project - - zlib\infblock.c - Windows - - - zlib - PathRelative - Project - - zlib\infcodes.c - Windows - - - zlib - PathRelative - Project - - zlib\inffast.c - Windows - - - zlib - PathRelative - Project - - zlib\inflate.c - Windows - - - zlib - PathRelative - Project - - zlib\inftrees.c - Windows - - - zlib - PathRelative - Project - - zlib\infutil.c - Windows - - - zlib - PathRelative - Project - - zlib\trees.c - Windows - - - zlib - PathRelative - Project - - zlib\uncompr.c - Windows - - - zlib - PathRelative - Project - - zlib\zutil.c - Windows - - - - wxlib Win32 debug - RootRelative - Project - ..\lib\jpeg.lib - Windows - - - wxlib Win32 debug - RootRelative - Project - ..\lib\png.lib - Windows - - - wxlib Win32 debug - RootRelative - Project - ..\lib\tiff.lib - Windows - - - wxlib Win32 debug - RootRelative - Project - ..\lib\zlib.lib - Windows - - - - - diff --git a/wxWidgets/src/wxXpm.icc b/wxWidgets/src/wxXpm.icc deleted file mode 100644 index 0aebe1c81e..0000000000 --- a/wxWidgets/src/wxXpm.icc +++ /dev/null @@ -1,32 +0,0 @@ -option ProjectOptions = gen(arch, "pentium2"), opt(tune, "pentium2"), - define("__WXPM__", ), define("__VISAGECPP__", ), define("wx_pm", ), - incl(searchpath, "..\\src\\xpm"), report(level, "E"), - file(genobject, "..\\src\\xpm\\dbgos240\\") -{ - perform - { - run before '-mkdir ' '..\\src\\xpm\\dbgos240' - } - target "..\\lib\\os2xpm.lib" - { - source type("c") "XPM\\ATTRIB.C" - source type("c") "XPM\\CRBUFFRI.C" - source type("c") "XPM\\CRDATFRI.C" - source type("c") "XPM\\CREATE.C" - source type("c") "XPM\\CRIFRBUF.C" - source type("c") "XPM\\CRIFRDAT.C" - source type("c") "XPM\\DATA.C" - source type("c") "XPM\\HASHTAB.C" - source type("c") "XPM\\IMAGE.C" - source type("c") "XPM\\INFO.C" - source type("c") "XPM\\MISC.C" - source type("c") "XPM\\PARSE.C" - source type("c") "XPM\\RDFTODAT.C" - source type("c") "XPM\\RDFTOI.C" - source type("c") "XPM\\RGB.C" - source type("c") "XPM\\SCAN.C" - source type("c") "XPM\\SIMX.C" - source type("c") "XPM\\WRFFRDAT.C" - source type("c") "XPM\\WRFFRI.C" - } -} diff --git a/wxWidgets/src/wxZlib.icc b/wxWidgets/src/wxZlib.icc deleted file mode 100644 index 16b26a6c64..0000000000 --- a/wxWidgets/src/wxZlib.icc +++ /dev/null @@ -1,26 +0,0 @@ -option ProjectOptions = gen(arch, "pentium2"), opt(tune, "pentium2"), - report(level, "E"), file(genobject, "..\\src\\zlib\\dbgos240\\") -{ - - perform - { - run before '-mkdir ' '..\\src\\zlib\\dbgos240' - } - target "..\\lib\\os2zlib.lib" - { - source type("c") "ZLIB\\ADLER32.C" - source type("c") "ZLIB\\COMPRESS.C" - source type("c") "ZLIB\\CRC32.C" - source type("c") "ZLIB\\DEFLATE.C" - source type("c") "ZLIB\\GZIO.C" - source type("c") "ZLIB\\INFBLOCK.C" - source type("c") "ZLIB\\INFCODES.C" - source type("c") "ZLIB\\INFFAST.C" - source type("c") "ZLIB\\INFLATE.C" - source type("c") "ZLIB\\INFTREES.C" - source type("c") "ZLIB\\INFUTIL.C" - source type("c") "ZLIB\\TREES.C" - source type("c") "ZLIB\\UNCOMPR.C" - source type("c") "ZLIB\\ZUTIL.C" - } -} diff --git a/wxWidgets/src/xml/descrip.mms b/wxWidgets/src/xml/descrip.mms deleted file mode 100644 index f79bab55cb..0000000000 --- a/wxWidgets/src/xml/descrip.mms +++ /dev/null @@ -1,68 +0,0 @@ -#***************************************************************************** -# * -# Make file for VMS * -# Author : J.Jansen (joukj@hrem.nano.tudelft.nl) * -# Date : 13 February 2006 * -# * -#***************************************************************************** -.first - define wx [--.include.wx] - -.ifdef __WXMOTIF__ -CXX_DEFINE = /define=(__WXMOTIF__=1)/name=(as_is,short)\ - /assume=(nostdnew,noglobal_array_new) -CC_DEFINE = /define=(__WXMOTIF__=1)/name=(as_is,short) -.else -.ifdef __WXGTK__ -CXX_DEFINE = /define=(__WXGTK__=1)/float=ieee/name=(as_is,short)/ieee=denorm\ - /assume=(nostdnew,noglobal_array_new) -CC_DEFINE = /define=(__WXGTK__=1)/float=ieee/name=(as_is,short)/ieee=denorm -.else -.ifdef __WXGTK2__ -CXX_DEFINE = /define=(__WXGTK__=1,VMS_GTK2)/float=ieee/name=(as_is,short)/ieee=denorm\ - /assume=(nostdnew,noglobal_array_new) -CC_DEFINE = /define=(__WXGTK__=1,VMS_GTK2)/float=ieee/name=(as_is,short)/ieee=denorm -.else -.ifdef __WXX11__ -CXX_DEFINE = /define=(__WXX11__=1,__WXUNIVERSAL__==1)/float=ieee\ - /name=(as_is,short)/assume=(nostdnew,noglobal_array_new) -CC_DEFINE = /define=(__WXX11__=1,__WXUNIVERSAL__==1)/float=ieee\ - /name=(as_is,short) -.else -CXX_DEFINE = -CC_DEFINE = -.endif -.endif -.endif -.endif - -.suffixes : .cpp - -.cpp.obj : - cxx $(CXXFLAGS)$(CXX_DEFINE) $(MMS$TARGET_NAME).cpp -.c.obj : - cc $(CFLAGS)$(CC_DEFINE) $(MMS$TARGET_NAME).c - -OBJECTS = xml.obj\ - -SOURCES = xml.cpp\ - -all : $(SOURCES) - $(MMS)$(MMSQUALIFIERS) $(OBJECTS) -.ifdef __WXMOTIF__ - library [--.lib]libwx_motif.olb $(OBJECTS) -.else -.ifdef __WXGTK__ - library [--.lib]libwx_gtk.olb $(OBJECTS) -.else -.ifdef __WXGTK2__ - library [--.lib]libwx_gtk2.olb $(OBJECTS) -.else -.ifdef __WXX11__ - library [--.lib]libwx_x11_univ.olb $(OBJECTS) -.endif -.endif -.endif -.endif - -xml.obj : xml.cpp diff --git a/wxWidgets/src/xml/xml.cpp b/wxWidgets/src/xml/xml.cpp deleted file mode 100644 index 712b2f3e87..0000000000 --- a/wxWidgets/src/xml/xml.cpp +++ /dev/null @@ -1,960 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/xml/xml.cpp -// Purpose: wxXmlDocument - XML parser & data holder class -// Author: Vaclav Slavik -// Created: 2000/03/05 -// RCS-ID: $Id: xml.cpp 65726 2010-10-02 15:47:41Z TIK $ -// Copyright: (c) 2000 Vaclav Slavik -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_XML - -#include "wx/xml/xml.h" - -#ifndef WX_PRECOMP - #include "wx/intl.h" - #include "wx/log.h" - #include "wx/app.h" -#endif - -#include "wx/wfstream.h" -#include "wx/datstrm.h" -#include "wx/zstream.h" -#include "wx/strconv.h" - -#include "expat.h" // from Expat - -// DLL options compatibility check: -WX_CHECK_BUILD_OPTIONS("wxXML") - - -IMPLEMENT_CLASS(wxXmlDocument, wxObject) - - -// a private utility used by wxXML -static bool wxIsWhiteOnly(const wxChar *buf); - - -//----------------------------------------------------------------------------- -// wxXmlNode -//----------------------------------------------------------------------------- - -wxXmlNode::wxXmlNode(wxXmlNode *parent,wxXmlNodeType type, - const wxString& name, const wxString& content, - wxXmlProperty *props, wxXmlNode *next) - : m_type(type), m_name(name), m_content(content), - m_properties(props), m_parent(parent), - m_children(NULL), m_next(next) -{ - if (m_parent) - { - if (m_parent->m_children) - { - m_next = m_parent->m_children; - m_parent->m_children = this; - } - else - m_parent->m_children = this; - } -} - -wxXmlNode::wxXmlNode(wxXmlNodeType type, const wxString& name, - const wxString& content) - : m_type(type), m_name(name), m_content(content), - m_properties(NULL), m_parent(NULL), - m_children(NULL), m_next(NULL) -{} - -wxXmlNode::wxXmlNode(const wxXmlNode& node) -{ - m_next = NULL; - m_parent = NULL; - DoCopy(node); -} - -wxXmlNode::~wxXmlNode() -{ - wxXmlNode *c, *c2; - for (c = m_children; c; c = c2) - { - c2 = c->m_next; - delete c; - } - - wxXmlProperty *p, *p2; - for (p = m_properties; p; p = p2) - { - p2 = p->GetNext(); - delete p; - } -} - -wxXmlNode& wxXmlNode::operator=(const wxXmlNode& node) -{ - wxDELETE(m_properties); - wxDELETE(m_children); - DoCopy(node); - return *this; -} - -void wxXmlNode::DoCopy(const wxXmlNode& node) -{ - m_type = node.m_type; - m_name = node.m_name; - m_content = node.m_content; - m_children = NULL; - - wxXmlNode *n = node.m_children; - while (n) - { - AddChild(new wxXmlNode(*n)); - n = n->GetNext(); - } - - m_properties = NULL; - wxXmlProperty *p = node.m_properties; - while (p) - { - AddProperty(p->GetName(), p->GetValue()); - p = p->GetNext(); - } -} - -bool wxXmlNode::HasProp(const wxString& propName) const -{ - wxXmlProperty *prop = GetProperties(); - - while (prop) - { - if (prop->GetName() == propName) return true; - prop = prop->GetNext(); - } - - return false; -} - -bool wxXmlNode::GetPropVal(const wxString& propName, wxString *value) const -{ - wxCHECK_MSG( value, false, wxT("value argument must not be NULL") ); - - wxXmlProperty *prop = GetProperties(); - - while (prop) - { - if (prop->GetName() == propName) - { - *value = prop->GetValue(); - return true; - } - prop = prop->GetNext(); - } - - return false; -} - -wxString wxXmlNode::GetPropVal(const wxString& propName, const wxString& defaultVal) const -{ - wxString tmp; - if (GetPropVal(propName, &tmp)) - return tmp; - - return defaultVal; -} - -void wxXmlNode::AddChild(wxXmlNode *child) -{ - if (m_children == NULL) - m_children = child; - else - { - wxXmlNode *ch = m_children; - while (ch->m_next) ch = ch->m_next; - ch->m_next = child; - } - child->m_next = NULL; - child->m_parent = this; -} - -bool wxXmlNode::InsertChild(wxXmlNode *child, wxXmlNode *before_node) -{ - wxCHECK_MSG(before_node == NULL || before_node->GetParent() == this, false, - wxT("wxXmlNode::InsertChild - the node has incorrect parent")); - wxCHECK_MSG(child, false, wxT("Cannot insert a NULL pointer!")); - - if (m_children == before_node) - m_children = child; - else if (m_children == NULL) - { - if (before_node != NULL) - return false; // we have no children so we don't need to search - m_children = child; - } - else if (before_node == NULL) - { - // prepend child - child->m_parent = this; - child->m_next = m_children; - m_children = child; - return true; - } - else - { - wxXmlNode *ch = m_children; - while (ch && ch->m_next != before_node) ch = ch->m_next; - if (!ch) - return false; // before_node not found - ch->m_next = child; - } - - child->m_parent = this; - child->m_next = before_node; - return true; -} - -// inserts a new node right after 'precedingNode' -bool wxXmlNode::InsertChildAfter(wxXmlNode *child, wxXmlNode *precedingNode) -{ - wxCHECK_MSG( child, false, wxT("cannot insert a NULL node!") ); - wxCHECK_MSG( child->m_parent == NULL, false, wxT("node already has a parent") ); - wxCHECK_MSG( child->m_next == NULL, false, wxT("node already has m_next") ); - wxCHECK_MSG( precedingNode == NULL || precedingNode->m_parent == this, false, - wxT("precedingNode has wrong parent") ); - - if ( precedingNode ) - { - child->m_next = precedingNode->m_next; - precedingNode->m_next = child; - } - else // precedingNode == NULL - { - wxCHECK_MSG( m_children == NULL, false, - wxT("NULL precedingNode only makes sense when there are no children") ); - - child->m_next = m_children; - m_children = child; - } - - child->m_parent = this; - return true; -} - - -bool wxXmlNode::RemoveChild(wxXmlNode *child) -{ - if (m_children == NULL) - return false; - else if (m_children == child) - { - m_children = child->m_next; - child->m_parent = NULL; - child->m_next = NULL; - return true; - } - else - { - wxXmlNode *ch = m_children; - while (ch->m_next) - { - if (ch->m_next == child) - { - ch->m_next = child->m_next; - child->m_parent = NULL; - child->m_next = NULL; - return true; - } - ch = ch->m_next; - } - return false; - } -} - -void wxXmlNode::AddProperty(const wxString& name, const wxString& value) -{ - AddProperty(new wxXmlProperty(name, value, NULL)); -} - -void wxXmlNode::AddProperty(wxXmlProperty *prop) -{ - if (m_properties == NULL) - m_properties = prop; - else - { - wxXmlProperty *p = m_properties; - while (p->GetNext()) p = p->GetNext(); - p->SetNext(prop); - } -} - -bool wxXmlNode::DeleteProperty(const wxString& name) -{ - wxXmlProperty *prop; - - if (m_properties == NULL) - return false; - - else if (m_properties->GetName() == name) - { - prop = m_properties; - m_properties = prop->GetNext(); - prop->SetNext(NULL); - delete prop; - return true; - } - - else - { - wxXmlProperty *p = m_properties; - while (p->GetNext()) - { - if (p->GetNext()->GetName() == name) - { - prop = p->GetNext(); - p->SetNext(prop->GetNext()); - prop->SetNext(NULL); - delete prop; - return true; - } - p = p->GetNext(); - } - return false; - } -} - -wxString wxXmlNode::GetNodeContent() const -{ - wxXmlNode *n = GetChildren(); - - while (n) - { - if (n->GetType() == wxXML_TEXT_NODE || - n->GetType() == wxXML_CDATA_SECTION_NODE) - return n->GetContent(); - n = n->GetNext(); - } - return wxEmptyString; -} - -int wxXmlNode::GetDepth(wxXmlNode *grandparent) const -{ - const wxXmlNode *n = this; - int ret = -1; - - do - { - ret++; - n = n->GetParent(); - if (n == grandparent) - return ret; - - } while (n); - - return wxNOT_FOUND; -} - -bool wxXmlNode::IsWhitespaceOnly() const -{ - return wxIsWhiteOnly(m_content); -} - - - -//----------------------------------------------------------------------------- -// wxXmlDocument -//----------------------------------------------------------------------------- - -wxXmlDocument::wxXmlDocument() - : m_version(wxT("1.0")), m_fileEncoding(wxT("utf-8")), m_root(NULL) -{ -#if !wxUSE_UNICODE - m_encoding = wxT("UTF-8"); -#endif -} - -wxXmlDocument::wxXmlDocument(const wxString& filename, const wxString& encoding) - :wxObject(), m_root(NULL) -{ - if ( !Load(filename, encoding) ) - { - wxDELETE(m_root); - } -} - -wxXmlDocument::wxXmlDocument(wxInputStream& stream, const wxString& encoding) - :wxObject(), m_root(NULL) -{ - if ( !Load(stream, encoding) ) - { - wxDELETE(m_root); - } -} - -wxXmlDocument::wxXmlDocument(const wxXmlDocument& doc) - :wxObject() -{ - DoCopy(doc); -} - -wxXmlDocument& wxXmlDocument::operator=(const wxXmlDocument& doc) -{ - wxDELETE(m_root); - DoCopy(doc); - return *this; -} - -void wxXmlDocument::DoCopy(const wxXmlDocument& doc) -{ - m_version = doc.m_version; -#if !wxUSE_UNICODE - m_encoding = doc.m_encoding; -#endif - m_fileEncoding = doc.m_fileEncoding; - - if (doc.m_root) - m_root = new wxXmlNode(*doc.m_root); - else - m_root = NULL; -} - -bool wxXmlDocument::Load(const wxString& filename, const wxString& encoding, int flags) -{ - wxFileInputStream stream(filename); - if (!stream.Ok()) - return false; - return Load(stream, encoding, flags); -} - -bool wxXmlDocument::Save(const wxString& filename, int indentstep) const -{ - wxFileOutputStream stream(filename); - if (!stream.Ok()) - return false; - return Save(stream, indentstep); -} - - - -//----------------------------------------------------------------------------- -// wxXmlDocument loading routines -//----------------------------------------------------------------------------- - -// converts Expat-produced string in UTF-8 into wxString using the specified -// conv or keep in UTF-8 if conv is NULL -static wxString CharToString(wxMBConv *conv, - const char *s, size_t len = wxString::npos) -{ -#if wxUSE_UNICODE - wxUnusedVar(conv); - - return wxString(s, wxConvUTF8, len); -#else // !wxUSE_UNICODE - if ( conv ) - { - // there can be no embedded NULs in this string so we don't need the - // output length, it will be NUL-terminated - const wxWCharBuffer wbuf( - wxConvUTF8.cMB2WC(s, len == wxString::npos ? wxNO_LEN : len, NULL)); - - return wxString(wbuf, *conv); - } - else // already in UTF-8, no conversion needed - { - return wxString(s, len != wxString::npos ? len : strlen(s)); - } -#endif // wxUSE_UNICODE/!wxUSE_UNICODE -} - -// returns true if the given string contains only whitespaces -bool wxIsWhiteOnly(const wxChar *buf) -{ - for (const wxChar *c = buf; *c != wxT('\0'); c++) - if (*c != wxT(' ') && *c != wxT('\t') && *c != wxT('\n') && *c != wxT('\r')) - return false; - return true; -} - - -struct wxXmlParsingContext -{ - wxXmlParsingContext() - : conv(NULL), - root(NULL), - node(NULL), - lastChild(NULL), - lastAsText(NULL), - removeWhiteOnlyNodes(false) - {} - - wxMBConv *conv; - wxXmlNode *root; - wxXmlNode *node; // the node being parsed - wxXmlNode *lastChild; // the last child of "node" - wxXmlNode *lastAsText; // the last _text_ child of "node" - wxString encoding; - wxString version; - bool removeWhiteOnlyNodes; -}; - -// checks that ctx->lastChild is in consistent state -#define ASSERT_LAST_CHILD_OK(ctx) \ - wxASSERT( ctx->lastChild == NULL || \ - ctx->lastChild->GetNext() == NULL ); \ - wxASSERT( ctx->lastChild == NULL || \ - ctx->lastChild->GetParent() == ctx->node ) - -extern "C" { -static void StartElementHnd(void *userData, const char *name, const char **atts) -{ - wxXmlParsingContext *ctx = (wxXmlParsingContext*)userData; - wxXmlNode *node = new wxXmlNode(wxXML_ELEMENT_NODE, CharToString(ctx->conv, name)); - const char **a = atts; - while (*a) - { - node->AddProperty(CharToString(ctx->conv, a[0]), CharToString(ctx->conv, a[1])); - a += 2; - } - if (ctx->root == NULL) - { - ctx->root = node; - } - else - { - ASSERT_LAST_CHILD_OK(ctx); - ctx->node->InsertChildAfter(node, ctx->lastChild); - } - - ctx->lastAsText = NULL; - ctx->lastChild = NULL; // our new node "node" has no children yet - - ctx->node = node; -} -} - -extern "C" { -static void EndElementHnd(void *userData, const char* WXUNUSED(name)) -{ - wxXmlParsingContext *ctx = (wxXmlParsingContext*)userData; - - // we're exiting the last children of ctx->node->GetParent() and going - // back one level up, so current value of ctx->node points to the last - // child of ctx->node->GetParent() - ctx->lastChild = ctx->node; - - ctx->node = ctx->node->GetParent(); - ctx->lastAsText = NULL; -} -} - -extern "C" { -static void TextHnd(void *userData, const char *s, int len) -{ - wxXmlParsingContext *ctx = (wxXmlParsingContext*)userData; - wxString str = CharToString(ctx->conv, s, len); - - if (ctx->lastAsText) - { - ctx->lastAsText->SetContent(ctx->lastAsText->GetContent() + str); - } - else - { - bool whiteOnly = false; - if (ctx->removeWhiteOnlyNodes) - whiteOnly = wxIsWhiteOnly(str); - - if (!whiteOnly) - { - wxXmlNode *textnode = - new wxXmlNode(wxXML_TEXT_NODE, wxT("text"), str); - - ASSERT_LAST_CHILD_OK(ctx); - ctx->node->InsertChildAfter(textnode, ctx->lastChild); - ctx->lastChild= ctx->lastAsText = textnode; - } - } -} -} - -extern "C" { -static void StartCdataHnd(void *userData) -{ - wxXmlParsingContext *ctx = (wxXmlParsingContext*)userData; - - wxXmlNode *textnode = - new wxXmlNode(wxXML_CDATA_SECTION_NODE, wxT("cdata"),wxT("")); - - ASSERT_LAST_CHILD_OK(ctx); - ctx->node->InsertChildAfter(textnode, ctx->lastChild); - ctx->lastChild= ctx->lastAsText = textnode; -} -} - -extern "C" { -static void CommentHnd(void *userData, const char *data) -{ - wxXmlParsingContext *ctx = (wxXmlParsingContext*)userData; - - if (ctx->node) - { - // VS: ctx->node == NULL happens if there is a comment before - // the root element (e.g. wxDesigner's output). We ignore such - // comments, no big deal... - wxXmlNode *commentnode = - new wxXmlNode(wxXML_COMMENT_NODE, - wxT("comment"), CharToString(ctx->conv, data)); - ASSERT_LAST_CHILD_OK(ctx); - ctx->node->InsertChildAfter(commentnode, ctx->lastChild); - ctx->lastChild = commentnode; - } - ctx->lastAsText = NULL; -} -} - -extern "C" { -static void DefaultHnd(void *userData, const char *s, int len) -{ - // XML header: - if (len > 6 && memcmp(s, "conv, s, (size_t)len); - int pos; - pos = buf.Find(wxT("encoding=")); - if (pos != wxNOT_FOUND) - ctx->encoding = buf.Mid(pos + 10).BeforeFirst(buf[(size_t)pos+9]); - pos = buf.Find(wxT("version=")); - if (pos != wxNOT_FOUND) - ctx->version = buf.Mid(pos + 9).BeforeFirst(buf[(size_t)pos+8]); - } -} -} - -extern "C" { -static int UnknownEncodingHnd(void * WXUNUSED(encodingHandlerData), - const XML_Char *name, XML_Encoding *info) -{ - // We must build conversion table for expat. The easiest way to do so - // is to let wxCSConv convert as string containing all characters to - // wide character representation: - wxString str(name, wxConvLibc); - wxCSConv conv(str); - char mbBuf[2]; - wchar_t wcBuf[10]; - size_t i; - - mbBuf[1] = 0; - info->map[0] = 0; - for (i = 0; i < 255; i++) - { - mbBuf[0] = (char)(i+1); - if (conv.MB2WC(wcBuf, mbBuf, 2) == (size_t)-1) - { - // invalid/undefined byte in the encoding: - info->map[i+1] = -1; - } - info->map[i+1] = (int)wcBuf[0]; - } - - info->data = NULL; - info->convert = NULL; - info->release = NULL; - - return 1; -} -} - -bool wxXmlDocument::Load(wxInputStream& stream, const wxString& encoding, int flags) -{ -#if wxUSE_UNICODE - (void)encoding; -#else - m_encoding = encoding; -#endif - - const size_t BUFSIZE = 1024; - char buf[BUFSIZE]; - wxXmlParsingContext ctx; - bool done; - XML_Parser parser = XML_ParserCreate(NULL); - - ctx.root = ctx.node = NULL; - ctx.encoding = wxT("UTF-8"); // default in absence of encoding="" - ctx.conv = NULL; -#if !wxUSE_UNICODE - if ( encoding.CmpNoCase(wxT("UTF-8")) != 0 ) - ctx.conv = new wxCSConv(encoding); -#endif - ctx.removeWhiteOnlyNodes = (flags & wxXMLDOC_KEEP_WHITESPACE_NODES) == 0; - - XML_SetUserData(parser, (void*)&ctx); - XML_SetElementHandler(parser, StartElementHnd, EndElementHnd); - XML_SetCharacterDataHandler(parser, TextHnd); - XML_SetStartCdataSectionHandler(parser, StartCdataHnd); - XML_SetCommentHandler(parser, CommentHnd); - XML_SetDefaultHandler(parser, DefaultHnd); - XML_SetUnknownEncodingHandler(parser, UnknownEncodingHnd, NULL); - - bool ok = true; - do - { - size_t len = stream.Read(buf, BUFSIZE).LastRead(); - done = (len < BUFSIZE); - if (!XML_Parse(parser, buf, len, done)) - { - wxString error(XML_ErrorString(XML_GetErrorCode(parser)), - *wxConvCurrent); - wxLogError(_("XML parsing error: '%s' at line %d"), - error.c_str(), - XML_GetCurrentLineNumber(parser)); - ok = false; - break; - } - } while (!done); - - if (ok) - { - if (!ctx.version.empty()) - SetVersion(ctx.version); - if (!ctx.encoding.empty()) - SetFileEncoding(ctx.encoding); - SetRoot(ctx.root); - } - else - { - delete ctx.root; - } - - XML_ParserFree(parser); -#if !wxUSE_UNICODE - if ( ctx.conv ) - delete ctx.conv; -#endif - - return ok; - -} - - - -//----------------------------------------------------------------------------- -// wxXmlDocument saving routines -//----------------------------------------------------------------------------- - -// write string to output: -inline static void OutputString(wxOutputStream& stream, const wxString& str, - wxMBConv *convMem = NULL, - wxMBConv *convFile = NULL) -{ - if (str.empty()) - return; - -#if wxUSE_UNICODE - wxUnusedVar(convMem); - - const wxWX2MBbuf buf(str.mb_str(*(convFile ? convFile : &wxConvUTF8))); - if ( !buf ) - return; - stream.Write((const char*)buf, strlen((const char*)buf)); -#else // !wxUSE_UNICODE - if ( convFile && convMem ) - { - wxString str2(str.wc_str(*convMem), *convFile); - stream.Write(str2.mb_str(), str2.Len()); - } - else // no conversions to do - { - stream.Write(str.mb_str(), str.Len()); - } -#endif // wxUSE_UNICODE/!wxUSE_UNICODE -} - - -enum EscapingMode -{ - Escape_Text, - Escape_Attribute -}; - -// Same as above, but create entities first. -// Translates '<' to "<", '>' to ">" and so on, according to the spec: -// http://www.w3.org/TR/2000/WD-xml-c14n-20000119.html#charescaping -static void OutputEscapedString(wxOutputStream& stream, - const wxString& str, - wxMBConv *convMem, - wxMBConv *convFile, - EscapingMode mode) -{ - const size_t len = str.Len(); - - wxString escaped; - escaped.reserve( len ); - - for (size_t i = 0; i < len; i++) - { - const wxChar c = str.GetChar(i); - - switch ( c ) - { - case '<': - escaped.append(wxT("<")); - break; - case '>': - escaped.append(wxT(">")); - break; - case '&': - escaped.append(wxT("&")); - break; - case '\r': - escaped.append(wxT(" ")); - break; - default: - if ( mode == Escape_Attribute ) - { - switch ( c ) - { - case '"': - escaped.append(wxT(""")); - break; - case '\t': - escaped.append(wxT(" ")); - break; - case '\n': - escaped.append(wxT(" ")); - break; - default: - escaped.append(c); - } - } - else - { - escaped.append(c); - } - } - } - OutputString(stream, escaped, convMem, convFile); -} - -inline static void OutputIndentation(wxOutputStream& stream, int indent) -{ - wxString str = wxT("\n"); - for (int i = 0; i < indent; i++) - str << wxT(' ') << wxT(' '); - OutputString(stream, str); -} - -static void OutputNode(wxOutputStream& stream, wxXmlNode *node, int indent, - wxMBConv *convMem, wxMBConv *convFile, int indentstep) -{ - wxXmlNode *n, *prev; - wxXmlProperty *prop; - - switch (node->GetType()) - { - case wxXML_CDATA_SECTION_NODE: - OutputString( stream, wxT("GetContent() ); - OutputString( stream, wxT("]]>") ); - break; - - case wxXML_TEXT_NODE: - OutputEscapedString(stream, node->GetContent(), - convMem, convFile, - Escape_Text); - break; - - case wxXML_ELEMENT_NODE: - OutputString(stream, wxT("<")); - OutputString(stream, node->GetName()); - - prop = node->GetProperties(); - while (prop) - { - OutputString(stream, wxT(" ") + prop->GetName() + wxT("=\"")); - OutputEscapedString(stream, prop->GetValue(), - convMem, convFile, - Escape_Attribute); - OutputString(stream, wxT("\"")); - prop = prop->GetNext(); - } - - if (node->GetChildren()) - { - OutputString(stream, wxT(">")); - prev = NULL; - n = node->GetChildren(); - while (n) - { - if (indentstep >= 0 && n && n->GetType() != wxXML_TEXT_NODE) - OutputIndentation(stream, indent + indentstep); - OutputNode(stream, n, indent + indentstep, convMem, convFile, indentstep); - prev = n; - n = n->GetNext(); - } - if (indentstep >= 0 && prev && prev->GetType() != wxXML_TEXT_NODE) - OutputIndentation(stream, indent); - OutputString(stream, wxT("GetName()); - OutputString(stream, wxT(">")); - } - else - OutputString(stream, wxT("/>")); - break; - - case wxXML_COMMENT_NODE: - OutputString(stream, wxT("")); - break; - - default: - wxFAIL_MSG(wxT("unsupported node type")); - } -} - -bool wxXmlDocument::Save(wxOutputStream& stream, int indentstep) const -{ - if ( !IsOk() ) - return false; - - wxString s; - - wxMBConv *convMem = NULL, - *convFile; - -#if wxUSE_UNICODE - convFile = new wxCSConv(GetFileEncoding()); - convMem = NULL; -#else - if ( GetFileEncoding().CmpNoCase(GetEncoding()) != 0 ) - { - convFile = new wxCSConv(GetFileEncoding()); - convMem = new wxCSConv(GetEncoding()); - } - else // file and in-memory encodings are the same, no conversion needed - { - convFile = - convMem = NULL; - } -#endif - - s.Printf(wxT("\n"), - GetVersion().c_str(), GetFileEncoding().c_str()); - OutputString(stream, s); - - OutputNode(stream, GetRoot(), 0, convMem, convFile, indentstep); - OutputString(stream, wxT("\n")); - - delete convFile; - delete convMem; - - return true; -} - -#endif // wxUSE_XML diff --git a/wxWidgets/src/xrc/descrip.mms b/wxWidgets/src/xrc/descrip.mms deleted file mode 100644 index 0b3cc126e0..0000000000 --- a/wxWidgets/src/xrc/descrip.mms +++ /dev/null @@ -1,144 +0,0 @@ -#***************************************************************************** -# * -# Make file for VMS * -# Author : J.Jansen (joukj@hrem.nano.tudelft.nl) * -# Date : 9 November 2006 * -# * -#***************************************************************************** -.first - define wx [--.include.wx] - -.ifdef __WXMOTIF__ -CXX_DEFINE = /define=(__WXMOTIF__=1)/name=(as_is,short)\ - /assume=(nostdnew,noglobal_array_new) -CC_DEFINE = /define=(__WXMOTIF__=1)/name=(as_is,short) -.else -.ifdef __WXGTK__ -CXX_DEFINE = /define=(__WXGTK__=1)/float=ieee/name=(as_is,short)/ieee=denorm\ - /assume=(nostdnew,noglobal_array_new) -CC_DEFINE = /define=(__WXGTK__=1)/float=ieee/name=(as_is,short)/ieee=denorm -.else -.ifdef __WXGTK2__ -CXX_DEFINE = /define=(__WXGTK__=1,VMS_GTK2=1)/float=ieee/name=(as_is,short)/ieee=denorm\ - /assume=(nostdnew,noglobal_array_new) -CC_DEFINE = /define=(__WXGTK__=1,VMS_GTK2=1)/float=ieee/name=(as_is,short)/ieee=denorm -.else -.ifdef __WXX11__ -CXX_DEFINE = /define=(__WXX11__=1,__WXUNIVERSAL__==1)/float=ieee\ - /name=(as_is,short)/assume=(nostdnew,noglobal_array_new) -CC_DEFINE = /define=(__WXX11__=1,__WXUNIVERSAL__==1)/float=ieee\ - /name=(as_is,short) -.else -CXX_DEFINE = -CC_DEFINE = -.endif -.endif -.endif -.endif - -.suffixes : .cpp - -.cpp.obj : - cxx $(CXXFLAGS)$(CXX_DEFINE) $(MMS$TARGET_NAME).cpp -.c.obj : - cc $(CFLAGS)$(CC_DEFINE) $(MMS$TARGET_NAME).c - -OBJECTS=xh_bmp.obj,xh_bmpbt.obj,xh_bttn.obj,xh_cald.obj,xh_chckb.obj,\ - xh_chckl.obj,xh_choic.obj,xh_combo.obj,xh_dlg.obj,xh_frame.obj,\ - xh_gauge.obj,xh_gdctl.obj,xh_html.obj,xh_listb.obj,xh_listc.obj,\ - xh_menu.obj,xh_notbk.obj,xh_panel.obj,xh_radbt.obj,xh_radbx.obj,\ - xh_scrol.obj,xh_scwin.obj,xh_sizer.obj,xh_slidr.obj,xh_spin.obj,\ - xh_split.obj,xh_statbar.obj,xh_stbmp.obj,xh_stbox.obj,xh_stlin.obj,\ - xh_sttxt.obj,xh_text.obj,xh_tglbtn.obj,xh_toolb.obj,xh_tree.obj,\ - xh_unkwn.obj,xh_wizrd.obj,xmlres.obj,xmlrsall.obj,xh_listbk.obj,\ - xh_choicbk.obj,xh_dirpicker.obj,xh_hyperlink.obj,xh_filepicker.obj,\ - xh_fontpicker.obj,xh_clrpicker.obj,xh_odcombo.obj,xh_mdi.obj,\ - xh_grid.obj,xh_datectrl.obj,xh_treebk.obj,xh_bmpcbox.obj,\ - xh_animatctrl.obj,xh_htmllbox.obj,xh_collpane.obj - -SOURCES =xh_bmp.cpp,xh_bmpbt.cpp,xh_bttn.cpp,xh_cald.cpp,xh_chckb.cpp,\ - xh_chckl.cpp,xh_choic.cpp,xh_combo.cpp,xh_dlg.cpp,xh_frame.cpp,\ - xh_gauge.cpp,xh_gdctl.cpp,xh_html.cpp,xh_listb.cpp,xh_listc.cpp,\ - xh_menu.cpp,xh_notbk.cpp,xh_panel.cpp,xh_radbt.cpp,xh_radbx.cpp,\ - xh_scrol.cpp,xh_scwin.cpp,xh_sizer.cpp,xh_slidr.cpp,xh_spin.cpp,\ - xh_split.cpp,xh_statbar.cpp,xh_stbmp.cpp,xh_stbox.cpp,xh_stlin.cpp,\ - xh_sttxt.cpp,xh_text.cpp,xh_tglbtn.cpp,xh_toolb.cpp,xh_tree.cpp,\ - xh_unkwn.cpp,xh_wizrd.cpp,xmlres.cpp,xmlrsall.cpp,xh_listbk.cpp,\ - xh_choicbk.cpp,xh_dirpicker.cpp,xh_hyperlink.cpp,xh_filepicker.cpp,\ - xh_fontpicker.cpp,xh_clrpicker.cpp,xh_odcombo.cpp,xh_mdi.cpp,\ - xh_grid.cpp,xh_datectrl.cpp,xh_treebk.cpp,xh_bmpcbox.cpp,\ - xh_animatctrl.cpp,xh_htmllbox.cpp,xh_collpane.cpp - -all : $(SOURCES) - $(MMS)$(MMSQUALIFIERS) $(OBJECTS) -.ifdef __WXMOTIF__ - library [--.lib]libwx_motif.olb $(OBJECTS) -.else -.ifdef __WXGTK__ - library [--.lib]libwx_gtk.olb $(OBJECTS) -.else -.ifdef __WXGTK2__ - library [--.lib]libwx_gtk2.olb $(OBJECTS) -.else -.ifdef __WXX11__ - library [--.lib]libwx_x11_univ.olb $(OBJECTS) -.endif -.endif -.endif -.endif - -xh_bmp.obj : xh_bmp.cpp -xh_bmpbt.obj : xh_bmpbt.cpp -xh_bttn.obj : xh_bttn.cpp -xh_cald.obj : xh_cald.cpp -xh_chckb.obj : xh_chckb.cpp -xh_chckl.obj : xh_chckl.cpp -xh_choic.obj : xh_choic.cpp -xh_combo.obj : xh_combo.cpp -xh_dlg.obj : xh_dlg.cpp -xh_frame.obj : xh_frame.cpp -xh_gauge.obj : xh_gauge.cpp -xh_gdctl.obj : xh_gdctl.cpp -xh_html.obj : xh_html.cpp -xh_listb.obj : xh_listb.cpp -xh_listc.obj : xh_listc.cpp -xh_menu.obj : xh_menu.cpp -xh_notbk.obj : xh_notbk.cpp -xh_panel.obj : xh_panel.cpp -xh_radbt.obj : xh_radbt.cpp -xh_radbx.obj : xh_radbx.cpp -xh_scrol.obj : xh_scrol.cpp -xh_scwin.obj : xh_scwin.cpp -xh_sizer.obj : xh_sizer.cpp -xh_slidr.obj : xh_slidr.cpp -xh_spin.obj : xh_spin.cpp -xh_split.obj : xh_split.cpp -xh_statbar.obj : xh_statbar.cpp -xh_stbmp.obj : xh_stbmp.cpp -xh_stbox.obj : xh_stbox.cpp -xh_stlin.obj : xh_stlin.cpp -xh_sttxt.obj : xh_sttxt.cpp -xh_text.obj : xh_text.cpp -xh_tglbtn.obj : xh_tglbtn.cpp -xh_toolb.obj : xh_toolb.cpp -xh_tree.obj : xh_tree.cpp -xh_unkwn.obj : xh_unkwn.cpp -xh_wizrd.obj : xh_wizrd.cpp -xmlres.obj : xmlres.cpp -xmlrsall.obj : xmlrsall.cpp -xh_listbk.obj : xh_listbk.cpp -xh_choicbk.obj : xh_choicbk.cpp -xh_dirpicker.obj : xh_dirpicker.cpp -xh_hyperlink.obj : xh_hyperlink.cpp -xh_filepicker.obj : xh_filepicker.cpp -xh_fontpicker.obj : xh_fontpicker.cpp -xh_clrpicker.obj : xh_clrpicker.cpp -xh_odcombo.obj : xh_odcombo.cpp -xh_mdi.obj : xh_mdi.cpp -xh_grid.obj : xh_grid.cpp -xh_datectrl.obj : xh_datectrl.cpp -xh_treebk.obj : xh_treebk.cpp -xh_bmpcbox.obj : xh_bmpcbox.cpp -xh_animatctrl.obj : xh_animatctrl.cpp -xh_htmllbox.obj : xh_htmllbox.cpp -xh_collpane.obj : xh_collpane.cpp diff --git a/wxWidgets/src/xrc/xh_animatctrl.cpp b/wxWidgets/src/xrc/xh_animatctrl.cpp deleted file mode 100644 index 15cbcb4ea4..0000000000 --- a/wxWidgets/src/xrc/xh_animatctrl.cpp +++ /dev/null @@ -1,57 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/xrc/xh_animatctrl.cpp -// Purpose: XML resource handler for wxAnimationCtrl -// Author: Francesco Montorsi -// Created: 2006-10-15 -// RCS-ID: $Id: xh_animatctrl.cpp 42196 2006-10-21 13:59:25Z RR $ -// Copyright: (c) 2006 Francesco Montorsi -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_XRC && wxUSE_ANIMATIONCTRL - -#include "wx/xrc/xh_animatctrl.h" -#include "wx/animate.h" - -IMPLEMENT_DYNAMIC_CLASS(wxAnimationCtrlXmlHandler, wxXmlResourceHandler) - -wxAnimationCtrlXmlHandler::wxAnimationCtrlXmlHandler() : wxXmlResourceHandler() -{ - XRC_ADD_STYLE(wxAC_NO_AUTORESIZE); - XRC_ADD_STYLE(wxAC_DEFAULT_STYLE); - AddWindowStyles(); -} - -wxObject *wxAnimationCtrlXmlHandler::DoCreateResource() -{ - XRC_MAKE_INSTANCE(ctrl, wxAnimationCtrl) - - ctrl->Create(m_parentAsWindow, - GetID(), - GetAnimation(wxT("animation")), - GetPosition(), GetSize(), - GetStyle(_T("style"), wxAC_DEFAULT_STYLE), - GetName()); - - // if no inactive-bitmap has been provided, GetBitmap() will return wxNullBitmap - // which just tells wxAnimationCtrl to use the default for inactive status - ctrl->SetInactiveBitmap(GetBitmap(wxT("inactive-bitmap"))); - - SetupWindow(ctrl); - - return ctrl; -} - -bool wxAnimationCtrlXmlHandler::CanHandle(wxXmlNode *node) -{ - return IsOfClass(node, wxT("wxAnimationCtrl")); -} - -#endif // wxUSE_XRC && wxUSE_ANIMATIONCTRL diff --git a/wxWidgets/src/xrc/xh_bmp.cpp b/wxWidgets/src/xrc/xh_bmp.cpp deleted file mode 100644 index 3148ba118b..0000000000 --- a/wxWidgets/src/xrc/xh_bmp.cpp +++ /dev/null @@ -1,64 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/xrc/xh_bmp.cpp -// Purpose: XRC resource for wxBitmap and wxIcon -// Author: Vaclav Slavik -// Created: 2000/09/09 -// RCS-ID: $Id: xh_bmp.cpp 39710 2006-06-14 10:02:19Z ABX $ -// Copyright: (c) 2000 Vaclav Slavik -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_XRC - -#include "wx/xrc/xh_bmp.h" - -#ifndef WX_PRECOMP - #include "wx/bitmap.h" -#endif - -IMPLEMENT_DYNAMIC_CLASS(wxBitmapXmlHandler, wxXmlResourceHandler) - -wxBitmapXmlHandler::wxBitmapXmlHandler() - :wxXmlResourceHandler() -{ -} - -wxObject *wxBitmapXmlHandler::DoCreateResource() -{ - // NB: empty parameter name means "take directly from this node's next - // instead of from subnode with given name" - return new wxBitmap(GetBitmap(wxEmptyString)); -} - -bool wxBitmapXmlHandler::CanHandle(wxXmlNode *node) -{ - return IsOfClass(node, wxT("wxBitmap")); -} - -IMPLEMENT_DYNAMIC_CLASS(wxIconXmlHandler, wxXmlResourceHandler) - -wxIconXmlHandler::wxIconXmlHandler() -: wxXmlResourceHandler() -{ -} - -wxObject *wxIconXmlHandler::DoCreateResource() -{ - // NB: empty parameter name means "take directly from this node's next - // instead of from subnode with given name" - return new wxIcon(GetIcon(wxEmptyString)); -} - -bool wxIconXmlHandler::CanHandle(wxXmlNode *node) -{ - return IsOfClass(node, wxT("wxIcon")); -} - -#endif // wxUSE_XRC diff --git a/wxWidgets/src/xrc/xh_bmpbt.cpp b/wxWidgets/src/xrc/xh_bmpbt.cpp deleted file mode 100644 index c8c6fd14cd..0000000000 --- a/wxWidgets/src/xrc/xh_bmpbt.cpp +++ /dev/null @@ -1,72 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/xrc/xh_bmpbt.cpp -// Purpose: XRC resource for bitmap buttons -// Author: Brian Gavin -// Created: 2000/09/09 -// RCS-ID: $Id: xh_bmpbt.cpp 44510 2007-02-16 08:16:37Z JS $ -// Copyright: (c) 2000 Brian Gavin -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_XRC && wxUSE_BMPBUTTON - -#include "wx/xrc/xh_bmpbt.h" - -#ifndef WX_PRECOMP - #include "wx/bmpbuttn.h" -#endif - -IMPLEMENT_DYNAMIC_CLASS(wxBitmapButtonXmlHandler, wxXmlResourceHandler) - -wxBitmapButtonXmlHandler::wxBitmapButtonXmlHandler() -: wxXmlResourceHandler() -{ - XRC_ADD_STYLE(wxBU_AUTODRAW); - XRC_ADD_STYLE(wxBU_LEFT); - XRC_ADD_STYLE(wxBU_RIGHT); - XRC_ADD_STYLE(wxBU_TOP); - XRC_ADD_STYLE(wxBU_BOTTOM); - XRC_ADD_STYLE(wxBU_EXACTFIT); - AddWindowStyles(); -} - -wxObject *wxBitmapButtonXmlHandler::DoCreateResource() -{ - XRC_MAKE_INSTANCE(button, wxBitmapButton) - - button->Create(m_parentAsWindow, - GetID(), - GetBitmap(wxT("bitmap"), wxART_BUTTON), - GetPosition(), GetSize(), - GetStyle(wxT("style"), wxBU_AUTODRAW), - wxDefaultValidator, - GetName()); - if (GetBool(wxT("default"), 0)) - button->SetDefault(); - SetupWindow(button); - - if (GetParamNode(wxT("selected"))) - button->SetBitmapSelected(GetBitmap(wxT("selected"))); - if (GetParamNode(wxT("focus"))) - button->SetBitmapFocus(GetBitmap(wxT("focus"))); - if (GetParamNode(wxT("disabled"))) - button->SetBitmapDisabled(GetBitmap(wxT("disabled"))); - if (GetParamNode(wxT("hover"))) - button->SetBitmapHover(GetBitmap(wxT("hover"))); - - return button; -} - -bool wxBitmapButtonXmlHandler::CanHandle(wxXmlNode *node) -{ - return IsOfClass(node, wxT("wxBitmapButton")); -} - -#endif // wxUSE_XRC && wxUSE_BMPBUTTON diff --git a/wxWidgets/src/xrc/xh_bmpcbox.cpp b/wxWidgets/src/xrc/xh_bmpcbox.cpp deleted file mode 100644 index ee87500dea..0000000000 --- a/wxWidgets/src/xrc/xh_bmpcbox.cpp +++ /dev/null @@ -1,103 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/xrc/xh_bmpcbox.cpp -// Purpose: XRC resource for wxBitmapComboBox -// Author: Jaakko Salli -// Created: Sep-10-2006 -// RCS-ID: $Id: xh_bmpcbox.cpp 55963 2008-09-29 19:52:58Z VS $ -// Copyright: (c) 2006 Jaakko Salli -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_XRC && wxUSE_BITMAPCOMBOBOX - -#include "wx/xrc/xh_bmpcbox.h" - -#ifndef WX_PRECOMP - #include "wx/intl.h" -#endif - -#include "wx/bmpcbox.h" - -IMPLEMENT_DYNAMIC_CLASS(wxBitmapComboBoxXmlHandler, wxXmlResourceHandler) - -wxBitmapComboBoxXmlHandler::wxBitmapComboBoxXmlHandler() - :wxXmlResourceHandler() - ,m_combobox(NULL) - ,m_isInside(false) -{ - XRC_ADD_STYLE(wxCB_SORT); - XRC_ADD_STYLE(wxCB_READONLY); - AddWindowStyles(); -} - -wxObject *wxBitmapComboBoxXmlHandler::DoCreateResource() -{ - if (m_class == wxT("ownerdrawnitem")) - { - wxCHECK_MSG(m_combobox, NULL, wxT("Incorrect syntax of XRC resource: ownerdrawnitem not within a bitmapcombobox!")); - - m_combobox->Append(GetText(wxT("text")), - GetBitmap(wxT("bitmap"))); - - return m_combobox; - } - else /*if( m_class == wxT("wxBitmapComboBox"))*/ - { - // find the selection - long selection = GetLong( wxT("selection"), -1 ); - - XRC_MAKE_INSTANCE(control, wxBitmapComboBox) - - control->Create(m_parentAsWindow, - GetID(), - GetText(wxT("value")), - GetPosition(), GetSize(), - 0, - NULL, - GetStyle(), - wxDefaultValidator, - GetName()); - - m_isInside = true; - m_combobox = control; - - wxXmlNode *children_node = GetParamNode(wxT("object")); - - wxXmlNode *n = children_node; - - while (n) - { - if ((n->GetType() == wxXML_ELEMENT_NODE) && - (n->GetName() == wxT("object"))) - { - CreateResFromNode(n, control, NULL); - } - n = n->GetNext(); - } - - m_isInside = false; - m_combobox = NULL; - - if (selection != -1) - control->SetSelection(selection); - - SetupWindow(control); - - return control; - } -} - -bool wxBitmapComboBoxXmlHandler::CanHandle(wxXmlNode *node) -{ - return ((!m_isInside && IsOfClass(node, wxT("wxBitmapComboBox"))) || - (m_isInside && IsOfClass(node, wxT("ownerdrawnitem")))); -} - -#endif // wxUSE_XRC && wxUSE_BITMAPCOMBOBOX diff --git a/wxWidgets/src/xrc/xh_bttn.cpp b/wxWidgets/src/xrc/xh_bttn.cpp deleted file mode 100644 index 98e783460e..0000000000 --- a/wxWidgets/src/xrc/xh_bttn.cpp +++ /dev/null @@ -1,63 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/xrc/xh_bttn.cpp -// Purpose: XRC resource for buttons -// Author: Vaclav Slavik -// Created: 2000/03/05 -// RCS-ID: $Id: xh_bttn.cpp 41590 2006-10-03 14:53:40Z VZ $ -// Copyright: (c) 2000 Vaclav Slavik -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_XRC && wxUSE_BUTTON - -#include "wx/xrc/xh_bttn.h" - -#ifndef WX_PRECOMP - #include "wx/button.h" -#endif - -IMPLEMENT_DYNAMIC_CLASS(wxButtonXmlHandler, wxXmlResourceHandler) - -wxButtonXmlHandler::wxButtonXmlHandler() -: wxXmlResourceHandler() -{ - XRC_ADD_STYLE(wxBU_LEFT); - XRC_ADD_STYLE(wxBU_RIGHT); - XRC_ADD_STYLE(wxBU_TOP); - XRC_ADD_STYLE(wxBU_BOTTOM); - XRC_ADD_STYLE(wxBU_EXACTFIT); - AddWindowStyles(); -} - -wxObject *wxButtonXmlHandler::DoCreateResource() -{ - XRC_MAKE_INSTANCE(button, wxButton) - - button->Create(m_parentAsWindow, - GetID(), - GetText(wxT("label")), - GetPosition(), GetSize(), - GetStyle(), - wxDefaultValidator, - GetName()); - - if (GetBool(wxT("default"), 0)) - button->SetDefault(); - SetupWindow(button); - - return button; -} - -bool wxButtonXmlHandler::CanHandle(wxXmlNode *node) -{ - return IsOfClass(node, wxT("wxButton")); -} - -#endif // wxUSE_XRC && wxUSE_BUTTON diff --git a/wxWidgets/src/xrc/xh_cald.cpp b/wxWidgets/src/xrc/xh_cald.cpp deleted file mode 100644 index 0a95f371e9..0000000000 --- a/wxWidgets/src/xrc/xh_cald.cpp +++ /dev/null @@ -1,67 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/xrc/xh_cald.cpp -// Purpose: XRC resource for wxCalendarCtrl -// Author: Brian Gavin -// Created: 2000/09/09 -// RCS-ID: $Id: xh_cald.cpp 38939 2006-04-27 12:47:14Z ABX $ -// Copyright: (c) 2000 Brian Gavin -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_XRC && wxUSE_CALENDARCTRL - -#include "wx/xrc/xh_cald.h" - -#ifndef WX_PRECOMP - #include "wx/event.h" -#endif //WX_PRECOMP - -#include "wx/calctrl.h" - -IMPLEMENT_DYNAMIC_CLASS(wxCalendarCtrlXmlHandler, wxXmlResourceHandler) - -wxCalendarCtrlXmlHandler::wxCalendarCtrlXmlHandler() -: wxXmlResourceHandler() -{ - XRC_ADD_STYLE(wxCAL_SUNDAY_FIRST); - XRC_ADD_STYLE(wxCAL_MONDAY_FIRST); - XRC_ADD_STYLE(wxCAL_SHOW_HOLIDAYS); - XRC_ADD_STYLE(wxCAL_NO_YEAR_CHANGE); - XRC_ADD_STYLE(wxCAL_NO_MONTH_CHANGE); - XRC_ADD_STYLE(wxCAL_SEQUENTIAL_MONTH_SELECTION); - XRC_ADD_STYLE(wxCAL_SHOW_SURROUNDING_WEEKS); - - AddWindowStyles(); -} - - -wxObject *wxCalendarCtrlXmlHandler::DoCreateResource() -{ - XRC_MAKE_INSTANCE(calendar, wxCalendarCtrl); - - calendar->Create(m_parentAsWindow, - GetID(), - wxDefaultDateTime, - /*TODO: take it from resource*/ - GetPosition(), GetSize(), - GetStyle(), - GetName()); - - SetupWindow(calendar); - - return calendar; -} - -bool wxCalendarCtrlXmlHandler::CanHandle(wxXmlNode *node) -{ - return IsOfClass(node, wxT("wxCalendarCtrl")); -} - -#endif // wxUSE_XRC && wxUSE_CALENDARCTRL diff --git a/wxWidgets/src/xrc/xh_chckb.cpp b/wxWidgets/src/xrc/xh_chckb.cpp deleted file mode 100644 index 19c5cc7d92..0000000000 --- a/wxWidgets/src/xrc/xh_chckb.cpp +++ /dev/null @@ -1,61 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/xrc/xh_chckb.cpp -// Purpose: XRC resource for wxCheckBox -// Author: Bob Mitchell -// Created: 2000/03/21 -// RCS-ID: $Id: xh_chckb.cpp 39428 2006-05-29 08:13:19Z ABX $ -// Copyright: (c) 2000 Bob Mitchell and Verant Interactive -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_XRC && wxUSE_CHECKBOX - -#include "wx/xrc/xh_chckb.h" - -#ifndef WX_PRECOMP - #include "wx/checkbox.h" -#endif - -IMPLEMENT_DYNAMIC_CLASS(wxCheckBoxXmlHandler, wxXmlResourceHandler) - -wxCheckBoxXmlHandler::wxCheckBoxXmlHandler() -: wxXmlResourceHandler() -{ - XRC_ADD_STYLE(wxCHK_2STATE); - XRC_ADD_STYLE(wxCHK_3STATE); - XRC_ADD_STYLE(wxCHK_ALLOW_3RD_STATE_FOR_USER); - XRC_ADD_STYLE(wxALIGN_RIGHT); - AddWindowStyles(); -} - -wxObject *wxCheckBoxXmlHandler::DoCreateResource() -{ - XRC_MAKE_INSTANCE(control, wxCheckBox) - - control->Create(m_parentAsWindow, - GetID(), - GetText(wxT("label")), - GetPosition(), GetSize(), - GetStyle(), - wxDefaultValidator, - GetName()); - - control->SetValue(GetBool( wxT("checked"))); - SetupWindow(control); - - return control; -} - -bool wxCheckBoxXmlHandler::CanHandle(wxXmlNode *node) -{ - return IsOfClass(node, wxT("wxCheckBox")); -} - -#endif // wxUSE_XRC && wxUSE_CHECKBOX diff --git a/wxWidgets/src/xrc/xh_chckl.cpp b/wxWidgets/src/xrc/xh_chckl.cpp deleted file mode 100644 index 3a58987cfd..0000000000 --- a/wxWidgets/src/xrc/xh_chckl.cpp +++ /dev/null @@ -1,121 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/xrc/xh_chckl.cpp -// Purpose: XRC resource for wxCheckListBox -// Author: Bob Mitchell -// Created: 2000/03/21 -// RCS-ID: $Id: xh_chckl.cpp 42258 2006-10-22 22:12:32Z VZ $ -// Copyright: (c) 2000 Bob Mitchell and Verant Interactive -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_XRC && wxUSE_CHECKLISTBOX - -#include "wx/xrc/xh_chckl.h" - -#ifndef WX_PRECOMP - #include "wx/intl.h" - #include "wx/log.h" - #include "wx/checklst.h" -#endif - -IMPLEMENT_DYNAMIC_CLASS(wxCheckListBoxXmlHandler, wxXmlResourceHandler) - -wxCheckListBoxXmlHandler::wxCheckListBoxXmlHandler() -: wxXmlResourceHandler(), m_insideBox(false) -{ - // wxListBox styles: - XRC_ADD_STYLE(wxLB_SINGLE); - XRC_ADD_STYLE(wxLB_MULTIPLE); - XRC_ADD_STYLE(wxLB_EXTENDED); - XRC_ADD_STYLE(wxLB_HSCROLL); - XRC_ADD_STYLE(wxLB_ALWAYS_SB); - XRC_ADD_STYLE(wxLB_NEEDED_SB); - XRC_ADD_STYLE(wxLB_SORT); - - AddWindowStyles(); -} - -wxObject *wxCheckListBoxXmlHandler::DoCreateResource() -{ - if (m_class == wxT("wxCheckListBox") -#if WXWIN_COMPATIBILITY_2_4 - || m_class == wxT("wxCheckList") -#endif - ) - { -#if WXWIN_COMPATIBILITY_2_4 - if (m_class == wxT("wxCheckList")) - wxLogDebug(wxT("'wxCheckList' name is deprecated, use 'wxCheckListBox' instead.")); -#endif - // need to build the list of strings from children - m_insideBox = true; - CreateChildrenPrivately(NULL, GetParamNode(wxT("content"))); - - XRC_MAKE_INSTANCE(control, wxCheckListBox) - - control->Create(m_parentAsWindow, - GetID(), - GetPosition(), GetSize(), - strList, - GetStyle(), - wxDefaultValidator, - GetName()); - - // step through children myself (again.) - wxXmlNode *n = GetParamNode(wxT("content")); - if (n) - n = n->GetChildren(); - int i = 0; - while (n) - { - if (n->GetType() != wxXML_ELEMENT_NODE || - n->GetName() != wxT("item")) - { n = n->GetNext(); continue; } - - // checking boolean is a bit ugly here (see GetBool() ) - wxString v = n->GetPropVal(wxT("checked"), wxEmptyString); - v.MakeLower(); - if (v && v == wxT("1")) - control->Check( i, true ); - - i++; - n = n->GetNext(); - } - - SetupWindow(control); - - strList.Clear(); // dump the strings - - return control; - } - else - { - // on the inside now. - // handle Label - - // add to the list - wxString str = GetNodeContent(m_node); - if (m_resource->GetFlags() & wxXRC_USE_LOCALE) - str = wxGetTranslation(str, m_resource->GetDomain()); - strList.Add(str); - return NULL; - } -} - -bool wxCheckListBoxXmlHandler::CanHandle(wxXmlNode *node) -{ - return (IsOfClass(node, wxT("wxCheckListBox")) || -#if WXWIN_COMPATIBILITY_2_4 - IsOfClass(node, wxT("wxCheckList")) || -#endif - (m_insideBox && node->GetName() == wxT("item"))); -} - -#endif // wxUSE_XRC && wxUSE_CHECKLISTBOX diff --git a/wxWidgets/src/xrc/xh_choic.cpp b/wxWidgets/src/xrc/xh_choic.cpp deleted file mode 100644 index d8cd466d33..0000000000 --- a/wxWidgets/src/xrc/xh_choic.cpp +++ /dev/null @@ -1,87 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/xrc/xh_choic.cpp -// Purpose: XRC resource for wxChoice -// Author: Bob Mitchell -// Created: 2000/03/21 -// RCS-ID: $Id: xh_choic.cpp 42258 2006-10-22 22:12:32Z VZ $ -// Copyright: (c) 2000 Bob Mitchell and Verant Interactive -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_XRC && wxUSE_CHOICE - -#include "wx/xrc/xh_choic.h" - -#ifndef WX_PRECOMP - #include "wx/intl.h" - #include "wx/choice.h" -#endif - -IMPLEMENT_DYNAMIC_CLASS(wxChoiceXmlHandler, wxXmlResourceHandler) - -wxChoiceXmlHandler::wxChoiceXmlHandler() -: wxXmlResourceHandler() , m_insideBox(false) -{ - XRC_ADD_STYLE(wxCB_SORT); - AddWindowStyles(); -} - -wxObject *wxChoiceXmlHandler::DoCreateResource() -{ - if( m_class == wxT("wxChoice")) - { - // find the selection - long selection = GetLong(wxT("selection"), -1); - - // need to build the list of strings from children - m_insideBox = true; - CreateChildrenPrivately(NULL, GetParamNode(wxT("content"))); - - XRC_MAKE_INSTANCE(control, wxChoice) - - control->Create(m_parentAsWindow, - GetID(), - GetPosition(), GetSize(), - strList, - GetStyle(), - wxDefaultValidator, - GetName()); - - if (selection != -1) - control->SetSelection(selection); - - SetupWindow(control); - - strList.Clear(); // dump the strings - - return control; - } - else - { - // on the inside now. - // handle Label - - // add to the list - wxString str = GetNodeContent(m_node); - if (m_resource->GetFlags() & wxXRC_USE_LOCALE) - str = wxGetTranslation(str, m_resource->GetDomain()); - strList.Add(str); - - return NULL; - } -} - -bool wxChoiceXmlHandler::CanHandle(wxXmlNode *node) -{ - return (IsOfClass(node, wxT("wxChoice")) || - (m_insideBox && node->GetName() == wxT("item"))); -} - -#endif // wxUSE_XRC && wxUSE_CHOICE diff --git a/wxWidgets/src/xrc/xh_choicbk.cpp b/wxWidgets/src/xrc/xh_choicbk.cpp deleted file mode 100644 index aa954af2d5..0000000000 --- a/wxWidgets/src/xrc/xh_choicbk.cpp +++ /dev/null @@ -1,127 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/xrc/xh_choicbk.cpp -// Purpose: XRC resource for wxChoicebook -// Author: Vaclav Slavik -// Created: 2000/03/21 -// RCS-ID: $Id: xh_choicbk.cpp 39627 2006-06-08 06:57:39Z ABX $ -// Copyright: (c) 2000 Vaclav Slavik -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_XRC && wxUSE_CHOICEBOOK - -#include "wx/xrc/xh_choicbk.h" - -#ifndef WX_PRECOMP - #include "wx/log.h" - #include "wx/sizer.h" -#endif - -#include "wx/choicebk.h" -#include "wx/imaglist.h" - -IMPLEMENT_DYNAMIC_CLASS(wxChoicebookXmlHandler, wxXmlResourceHandler) - -wxChoicebookXmlHandler::wxChoicebookXmlHandler() - :wxXmlResourceHandler(), - m_isInside(false), - m_choicebook(NULL) -{ - XRC_ADD_STYLE(wxBK_DEFAULT); - XRC_ADD_STYLE(wxBK_LEFT); - XRC_ADD_STYLE(wxBK_RIGHT); - XRC_ADD_STYLE(wxBK_TOP); - XRC_ADD_STYLE(wxBK_BOTTOM); - -#if WXWIN_COMPATIBILITY_2_6 - XRC_ADD_STYLE(wxCHB_DEFAULT); - XRC_ADD_STYLE(wxCHB_LEFT); - XRC_ADD_STYLE(wxCHB_RIGHT); - XRC_ADD_STYLE(wxCHB_TOP); - XRC_ADD_STYLE(wxCHB_BOTTOM); -#endif - - AddWindowStyles(); -} - -wxObject *wxChoicebookXmlHandler::DoCreateResource() -{ - if (m_class == wxT("choicebookpage")) - { - wxXmlNode *n = GetParamNode(wxT("object")); - - if ( !n ) - n = GetParamNode(wxT("object_ref")); - - if (n) - { - bool old_ins = m_isInside; - m_isInside = false; - wxObject *item = CreateResFromNode(n, m_choicebook, NULL); - m_isInside = old_ins; - wxWindow *wnd = wxDynamicCast(item, wxWindow); - - if (wnd) - { - m_choicebook->AddPage(wnd, GetText(wxT("label")), - GetBool(wxT("selected"))); - if ( HasParam(wxT("bitmap")) ) - { - wxBitmap bmp = GetBitmap(wxT("bitmap"), wxART_OTHER); - wxImageList *imgList = m_choicebook->GetImageList(); - if ( imgList == NULL ) - { - imgList = new wxImageList( bmp.GetWidth(), bmp.GetHeight() ); - m_choicebook->AssignImageList( imgList ); - } - int imgIndex = imgList->Add(bmp); - m_choicebook->SetPageImage(m_choicebook->GetPageCount()-1, imgIndex ); - } - } - else - wxLogError(wxT("Error in resource.")); - return wnd; - } - else - { - wxLogError(wxT("Error in resource: no control within choicebook's tag.")); - return NULL; - } - } - - else - { - XRC_MAKE_INSTANCE(nb, wxChoicebook) - - nb->Create(m_parentAsWindow, - GetID(), - GetPosition(), GetSize(), - GetStyle(wxT("style")), - GetName()); - - wxChoicebook *old_par = m_choicebook; - m_choicebook = nb; - bool old_ins = m_isInside; - m_isInside = true; - CreateChildren(m_choicebook, true/*only this handler*/); - m_isInside = old_ins; - m_choicebook = old_par; - - return nb; - } -} - -bool wxChoicebookXmlHandler::CanHandle(wxXmlNode *node) -{ - return ((!m_isInside && IsOfClass(node, wxT("wxChoicebook"))) || - (m_isInside && IsOfClass(node, wxT("choicebookpage")))); -} - -#endif // wxUSE_XRC && wxUSE_CHOICEBOOK diff --git a/wxWidgets/src/xrc/xh_clrpicker.cpp b/wxWidgets/src/xrc/xh_clrpicker.cpp deleted file mode 100644 index 11bf132ce2..0000000000 --- a/wxWidgets/src/xrc/xh_clrpicker.cpp +++ /dev/null @@ -1,55 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/xrc/xh_clrpicker.cpp -// Purpose: XML resource handler for wxColourPickerCtrl -// Author: Francesco Montorsi -// Created: 2006-04-17 -// RCS-ID: $Id: xh_clrpicker.cpp 40103 2006-07-15 15:34:34Z VS $ -// Copyright: (c) 2006 Francesco Montorsi -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_XRC && wxUSE_COLOURPICKERCTRL - -#include "wx/xrc/xh_clrpicker.h" -#include "wx/clrpicker.h" - -IMPLEMENT_DYNAMIC_CLASS(wxColourPickerCtrlXmlHandler, wxXmlResourceHandler) - -wxColourPickerCtrlXmlHandler::wxColourPickerCtrlXmlHandler() : wxXmlResourceHandler() -{ - XRC_ADD_STYLE(wxCLRP_USE_TEXTCTRL); - XRC_ADD_STYLE(wxCLRP_SHOW_LABEL); - XRC_ADD_STYLE(wxCLRP_DEFAULT_STYLE); - AddWindowStyles(); -} - -wxObject *wxColourPickerCtrlXmlHandler::DoCreateResource() -{ - XRC_MAKE_INSTANCE(picker, wxColourPickerCtrl) - - picker->Create(m_parentAsWindow, - GetID(), - GetColour(wxT("value"), *wxBLACK), - GetPosition(), GetSize(), - GetStyle(_T("style"), wxCLRP_DEFAULT_STYLE), - wxDefaultValidator, - GetName()); - - SetupWindow(picker); - - return picker; -} - -bool wxColourPickerCtrlXmlHandler::CanHandle(wxXmlNode *node) -{ - return IsOfClass(node, wxT("wxColourPickerCtrl")); -} - -#endif // wxUSE_XRC && wxUSE_COLOURPICKERCTRL diff --git a/wxWidgets/src/xrc/xh_collpane.cpp b/wxWidgets/src/xrc/xh_collpane.cpp deleted file mode 100644 index effd136b62..0000000000 --- a/wxWidgets/src/xrc/xh_collpane.cpp +++ /dev/null @@ -1,101 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/xrc/xh_collpane.cpp -// Purpose: XML resource handler for wxCollapsiblePane -// Author: Francesco Montorsi -// Created: 2006-10-27 -// RCS-ID: $Id: xh_collpane.cpp 43434 2006-11-15 19:00:16Z RR $ -// Copyright: (c) 2006 Francesco Montorsi -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_XRC && wxUSE_COLLPANE - -#ifndef WX_PRECOMP - #include "wx/log.h" -#endif - -#include "wx/collpane.h" -#include "wx/xrc/xh_collpane.h" - -IMPLEMENT_DYNAMIC_CLASS(wxCollapsiblePaneXmlHandler, wxXmlResourceHandler) - -wxCollapsiblePaneXmlHandler::wxCollapsiblePaneXmlHandler() -: wxXmlResourceHandler(), m_isInside(false) -{ - XRC_ADD_STYLE(wxCP_NO_TLW_RESIZE); - XRC_ADD_STYLE(wxCP_DEFAULT_STYLE); - AddWindowStyles(); -} - -wxObject *wxCollapsiblePaneXmlHandler::DoCreateResource() -{ - if (m_class == wxT("panewindow")) // read the XRC for the pane window - { - wxXmlNode *n = GetParamNode(wxT("object")); - - if ( !n ) - n = GetParamNode(wxT("object_ref")); - - if (n) - { - bool old_ins = m_isInside; - m_isInside = false; - wxObject *item = CreateResFromNode(n, m_collpane->GetPane(), NULL); - m_isInside = old_ins; - - return item; - } - else - { - wxLogError(wxT("Error in resource: no control within collapsible pane's tag.")); - return NULL; - } - } - else - { - XRC_MAKE_INSTANCE(ctrl, wxCollapsiblePane) - - wxString label = GetParamValue(wxT("label")); - if (label.empty()) - { - wxLogError(wxT("Error in resource: empty label for wxCollapsiblePane")); - return NULL; - } - - ctrl->Create(m_parentAsWindow, - GetID(), - label, - GetPosition(), GetSize(), - GetStyle(_T("style"), wxCP_DEFAULT_STYLE), - wxDefaultValidator, - GetName()); - - ctrl->Collapse(GetBool(_T("collapsed"))); - SetupWindow(ctrl); - - wxCollapsiblePane *old_par = m_collpane; - m_collpane = ctrl; - bool old_ins = m_isInside; - m_isInside = true; - CreateChildren(m_collpane, true/*only this handler*/); - m_isInside = old_ins; - m_collpane = old_par; - - return ctrl; - } -} - -bool wxCollapsiblePaneXmlHandler::CanHandle(wxXmlNode *node) -{ - return IsOfClass(node, wxT("wxCollapsiblePane")) || - (m_isInside && IsOfClass(node, wxT("panewindow"))); -} - -#endif // wxUSE_XRC && wxUSE_COLLPANE diff --git a/wxWidgets/src/xrc/xh_combo.cpp b/wxWidgets/src/xrc/xh_combo.cpp deleted file mode 100644 index 7d3ae40c4f..0000000000 --- a/wxWidgets/src/xrc/xh_combo.cpp +++ /dev/null @@ -1,94 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/xrc/xh_combo.cpp -// Purpose: XRC resource for wxComboBox -// Author: Bob Mitchell -// Created: 2000/03/21 -// RCS-ID: $Id: xh_combo.cpp 56715 2008-11-09 12:40:07Z VZ $ -// Copyright: (c) 2000 Bob Mitchell and Verant Interactive -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_XRC && wxUSE_COMBOBOX - -#include "wx/xrc/xh_combo.h" - -#ifndef WX_PRECOMP - #include "wx/intl.h" - #include "wx/combobox.h" - #include "wx/textctrl.h" // for wxTE_PROCESS_ENTER -#endif - -IMPLEMENT_DYNAMIC_CLASS(wxComboBoxXmlHandler, wxXmlResourceHandler) - -wxComboBoxXmlHandler::wxComboBoxXmlHandler() - :wxXmlResourceHandler() - ,m_insideBox(false) -{ - XRC_ADD_STYLE(wxCB_SIMPLE); - XRC_ADD_STYLE(wxCB_SORT); - XRC_ADD_STYLE(wxCB_READONLY); - XRC_ADD_STYLE(wxCB_DROPDOWN); - XRC_ADD_STYLE(wxTE_PROCESS_ENTER); - AddWindowStyles(); -} - -wxObject *wxComboBoxXmlHandler::DoCreateResource() -{ - if( m_class == wxT("wxComboBox")) - { - // find the selection - long selection = GetLong( wxT("selection"), -1 ); - - // need to build the list of strings from children - m_insideBox = true; - CreateChildrenPrivately(NULL, GetParamNode(wxT("content"))); - - XRC_MAKE_INSTANCE(control, wxComboBox) - - control->Create(m_parentAsWindow, - GetID(), - GetText(wxT("value")), - GetPosition(), GetSize(), - strList, - GetStyle(), - wxDefaultValidator, - GetName()); - - if (selection != -1) - control->SetSelection(selection); - - SetupWindow(control); - - strList.Clear(); // dump the strings - - return control; - } - else - { - // on the inside now. - // handle Label - - // add to the list - wxString str = GetNodeContent(m_node); - if (m_resource->GetFlags() & wxXRC_USE_LOCALE) - str = wxGetTranslation(str, m_resource->GetDomain()); - strList.Add(str); - - return NULL; - } -} - -bool wxComboBoxXmlHandler::CanHandle(wxXmlNode *node) -{ - return (IsOfClass(node, wxT("wxComboBox")) || - (m_insideBox && node->GetName() == wxT("item"))); -} - -#endif // wxUSE_XRC && wxUSE_COMBOBOX diff --git a/wxWidgets/src/xrc/xh_datectrl.cpp b/wxWidgets/src/xrc/xh_datectrl.cpp deleted file mode 100644 index f39d8bfda7..0000000000 --- a/wxWidgets/src/xrc/xh_datectrl.cpp +++ /dev/null @@ -1,57 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: xh_datectrl.cpp -// Purpose: XML resource handler for wxDatePickerCtrl -// Author: Vaclav Slavik -// Created: 2005-02-07 -// RCS-ID: $Id: xh_datectrl.cpp 35650 2005-09-23 12:56:45Z MR $ -// Copyright: (c) 2005 Vaclav Slavik -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_XRC && wxUSE_DATEPICKCTRL - -#include "wx/xrc/xh_datectrl.h" -#include "wx/datectrl.h" - -IMPLEMENT_DYNAMIC_CLASS(wxDateCtrlXmlHandler, wxXmlResourceHandler) - -wxDateCtrlXmlHandler::wxDateCtrlXmlHandler() : wxXmlResourceHandler() -{ - XRC_ADD_STYLE(wxDP_DEFAULT); - XRC_ADD_STYLE(wxDP_SPIN); - XRC_ADD_STYLE(wxDP_DROPDOWN); - XRC_ADD_STYLE(wxDP_ALLOWNONE); - XRC_ADD_STYLE(wxDP_SHOWCENTURY); - AddWindowStyles(); -} - -wxObject *wxDateCtrlXmlHandler::DoCreateResource() -{ - XRC_MAKE_INSTANCE(picker, wxDatePickerCtrl) - - picker->Create(m_parentAsWindow, - GetID(), - wxDefaultDateTime, - GetPosition(), GetSize(), - GetStyle(_T("style"), wxDP_DEFAULT | wxDP_SHOWCENTURY), - wxDefaultValidator, - GetName()); - - SetupWindow(picker); - - return picker; -} - -bool wxDateCtrlXmlHandler::CanHandle(wxXmlNode *node) -{ - return IsOfClass(node, wxT("wxDatePickerCtrl")); -} - -#endif // wxUSE_XRC && wxUSE_DATEPICKCTRL diff --git a/wxWidgets/src/xrc/xh_dirpicker.cpp b/wxWidgets/src/xrc/xh_dirpicker.cpp deleted file mode 100644 index 3d24f29ce6..0000000000 --- a/wxWidgets/src/xrc/xh_dirpicker.cpp +++ /dev/null @@ -1,57 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/xrc/xh_dirpicker.cpp -// Purpose: XML resource handler for wxDirPickerCtrl -// Author: Francesco Montorsi -// Created: 2006-04-17 -// RCS-ID: $Id: xh_dirpicker.cpp 55531 2008-09-09 19:36:41Z VS $ -// Copyright: (c) 2006 Francesco Montorsi -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_XRC && wxUSE_DIRPICKERCTRL - -#include "wx/xrc/xh_dirpicker.h" -#include "wx/filepicker.h" - -IMPLEMENT_DYNAMIC_CLASS(wxDirPickerCtrlXmlHandler, wxXmlResourceHandler) - -wxDirPickerCtrlXmlHandler::wxDirPickerCtrlXmlHandler() : wxXmlResourceHandler() -{ - XRC_ADD_STYLE(wxDIRP_USE_TEXTCTRL); - XRC_ADD_STYLE(wxDIRP_DIR_MUST_EXIST); - XRC_ADD_STYLE(wxDIRP_CHANGE_DIR); - XRC_ADD_STYLE(wxDIRP_DEFAULT_STYLE); - AddWindowStyles(); -} - -wxObject *wxDirPickerCtrlXmlHandler::DoCreateResource() -{ - XRC_MAKE_INSTANCE(picker, wxDirPickerCtrl) - - picker->Create(m_parentAsWindow, - GetID(), - GetParamValue(wxT("value")), - GetText(wxT("message")), - GetPosition(), GetSize(), - GetStyle(_T("style"), wxDIRP_DEFAULT_STYLE), - wxDefaultValidator, - GetName()); - - SetupWindow(picker); - - return picker; -} - -bool wxDirPickerCtrlXmlHandler::CanHandle(wxXmlNode *node) -{ - return IsOfClass(node, wxT("wxDirPickerCtrl")); -} - -#endif // wxUSE_XRC && wxUSE_DIRPICKERCTRL diff --git a/wxWidgets/src/xrc/xh_dlg.cpp b/wxWidgets/src/xrc/xh_dlg.cpp deleted file mode 100644 index 8a7085b701..0000000000 --- a/wxWidgets/src/xrc/xh_dlg.cpp +++ /dev/null @@ -1,93 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/xrc/xh_dlg.cpp -// Purpose: XRC resource for dialogs -// Author: Vaclav Slavik -// Created: 2000/03/05 -// RCS-ID: $Id: xh_dlg.cpp 39273 2006-05-22 20:54:04Z ABX $ -// Copyright: (c) 2000 Vaclav Slavik -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_XRC - -#include "wx/xrc/xh_dlg.h" - -#ifndef WX_PRECOMP - #include "wx/intl.h" - #include "wx/log.h" - #include "wx/frame.h" - #include "wx/dialog.h" -#endif - -IMPLEMENT_DYNAMIC_CLASS(wxDialogXmlHandler, wxXmlResourceHandler) - -wxDialogXmlHandler::wxDialogXmlHandler() : wxXmlResourceHandler() -{ - XRC_ADD_STYLE(wxSTAY_ON_TOP); - XRC_ADD_STYLE(wxCAPTION); - XRC_ADD_STYLE(wxDEFAULT_DIALOG_STYLE); - XRC_ADD_STYLE(wxSYSTEM_MENU); - XRC_ADD_STYLE(wxRESIZE_BORDER); - XRC_ADD_STYLE(wxCLOSE_BOX); - XRC_ADD_STYLE(wxDIALOG_NO_PARENT); - - XRC_ADD_STYLE(wxTAB_TRAVERSAL); - XRC_ADD_STYLE(wxWS_EX_VALIDATE_RECURSIVELY); - XRC_ADD_STYLE(wxDIALOG_EX_METAL); - XRC_ADD_STYLE(wxMAXIMIZE_BOX); - XRC_ADD_STYLE(wxMINIMIZE_BOX); - XRC_ADD_STYLE(wxFRAME_SHAPED); - XRC_ADD_STYLE(wxDIALOG_EX_CONTEXTHELP); - -#if WXWIN_COMPATIBILITY_2_6 - XRC_ADD_STYLE(wxDIALOG_MODAL); - XRC_ADD_STYLE(wxTHICK_FRAME); - XRC_ADD_STYLE(wxRESIZE_BOX); - XRC_ADD_STYLE(wxDIALOG_MODELESS); - XRC_ADD_STYLE(wxNO_3D); -#endif // WXWIN_COMPATIBILITY_2_6 - - AddWindowStyles(); -} - -wxObject *wxDialogXmlHandler::DoCreateResource() -{ - XRC_MAKE_INSTANCE(dlg, wxDialog); - - dlg->Create(m_parentAsWindow, - GetID(), - GetText(wxT("title")), - wxDefaultPosition, wxDefaultSize, - GetStyle(wxT("style"), wxDEFAULT_DIALOG_STYLE), - GetName()); - - if (HasParam(wxT("size"))) - dlg->SetClientSize(GetSize(wxT("size"), dlg)); - if (HasParam(wxT("pos"))) - dlg->Move(GetPosition()); - if (HasParam(wxT("icon"))) - dlg->SetIcon(GetIcon(wxT("icon"), wxART_FRAME_ICON)); - - SetupWindow(dlg); - - CreateChildren(dlg); - - if (GetBool(wxT("centered"), false)) - dlg->Centre(); - - return dlg; -} - -bool wxDialogXmlHandler::CanHandle(wxXmlNode *node) -{ - return IsOfClass(node, wxT("wxDialog")); -} - -#endif // wxUSE_XRC diff --git a/wxWidgets/src/xrc/xh_filepicker.cpp b/wxWidgets/src/xrc/xh_filepicker.cpp deleted file mode 100644 index 96496b2ff8..0000000000 --- a/wxWidgets/src/xrc/xh_filepicker.cpp +++ /dev/null @@ -1,60 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/xrc/xh_filepicker.cpp -// Purpose: XML resource handler for wxFilePickerCtrl -// Author: Francesco Montorsi -// Created: 2006-04-17 -// RCS-ID: $Id: xh_filepicker.cpp 55531 2008-09-09 19:36:41Z VS $ -// Copyright: (c) 2006 Francesco Montorsi -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_XRC && wxUSE_FILEPICKERCTRL - -#include "wx/xrc/xh_filepicker.h" -#include "wx/filepicker.h" - -IMPLEMENT_DYNAMIC_CLASS(wxFilePickerCtrlXmlHandler, wxXmlResourceHandler) - -wxFilePickerCtrlXmlHandler::wxFilePickerCtrlXmlHandler() : wxXmlResourceHandler() -{ - XRC_ADD_STYLE(wxFLP_OPEN); - XRC_ADD_STYLE(wxFLP_SAVE); - XRC_ADD_STYLE(wxFLP_OVERWRITE_PROMPT); - XRC_ADD_STYLE(wxFLP_FILE_MUST_EXIST); - XRC_ADD_STYLE(wxFLP_CHANGE_DIR); - XRC_ADD_STYLE(wxFLP_DEFAULT_STYLE); - XRC_ADD_STYLE(wxFLP_USE_TEXTCTRL); - AddWindowStyles(); -} - -wxObject *wxFilePickerCtrlXmlHandler::DoCreateResource() -{ - XRC_MAKE_INSTANCE(picker, wxFilePickerCtrl) - - picker->Create(m_parentAsWindow, - GetID(), - GetParamValue(wxT("value")), - GetText(wxT("message")), - GetParamValue(wxT("wildcard")), - GetPosition(), GetSize(), - GetStyle(_T("style"), wxFLP_DEFAULT_STYLE), - wxDefaultValidator, - GetName()); - - SetupWindow(picker); - return picker; -} - -bool wxFilePickerCtrlXmlHandler::CanHandle(wxXmlNode *node) -{ - return IsOfClass(node, wxT("wxFilePickerCtrl")); -} - -#endif // wxUSE_XRC && wxUSE_FILEPICKERCTRL diff --git a/wxWidgets/src/xrc/xh_fontpicker.cpp b/wxWidgets/src/xrc/xh_fontpicker.cpp deleted file mode 100644 index 2277960b16..0000000000 --- a/wxWidgets/src/xrc/xh_fontpicker.cpp +++ /dev/null @@ -1,60 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/xrc/xh_fontpicker.cpp -// Purpose: XML resource handler for wxFontPickerCtrl -// Author: Francesco Montorsi -// Created: 2006-04-17 -// RCS-ID: $Id: xh_fontpicker.cpp 40101 2006-07-15 15:21:25Z VS $ -// Copyright: (c) 2006 Francesco Montorsi -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_XRC && wxUSE_FONTPICKERCTRL - -#include "wx/xrc/xh_fontpicker.h" -#include "wx/fontpicker.h" - -IMPLEMENT_DYNAMIC_CLASS(wxFontPickerCtrlXmlHandler, wxXmlResourceHandler) - -wxFontPickerCtrlXmlHandler::wxFontPickerCtrlXmlHandler() : wxXmlResourceHandler() -{ - XRC_ADD_STYLE(wxFNTP_USE_TEXTCTRL); - XRC_ADD_STYLE(wxFNTP_FONTDESC_AS_LABEL); - XRC_ADD_STYLE(wxFNTP_USEFONT_FOR_LABEL); - XRC_ADD_STYLE(wxFNTP_DEFAULT_STYLE); - AddWindowStyles(); -} - -wxObject *wxFontPickerCtrlXmlHandler::DoCreateResource() -{ - XRC_MAKE_INSTANCE(picker, wxFontPickerCtrl) - - wxFont f = *wxNORMAL_FONT; - if (HasParam(wxT("value"))) - f = GetFont(wxT("value")); - - picker->Create(m_parentAsWindow, - GetID(), - f, - GetPosition(), GetSize(), - GetStyle(_T("style"), wxFNTP_DEFAULT_STYLE), - wxDefaultValidator, - GetName()); - - SetupWindow(picker); - - return picker; -} - -bool wxFontPickerCtrlXmlHandler::CanHandle(wxXmlNode *node) -{ - return IsOfClass(node, wxT("wxFontPickerCtrl")); -} - -#endif // wxUSE_XRC && wxUSE_FONTPICKERCTRL diff --git a/wxWidgets/src/xrc/xh_frame.cpp b/wxWidgets/src/xrc/xh_frame.cpp deleted file mode 100644 index 6de9699ac7..0000000000 --- a/wxWidgets/src/xrc/xh_frame.cpp +++ /dev/null @@ -1,99 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/xrc/xh_frame.cpp -// Purpose: XRC resource for dialogs -// Author: Vaclav Slavik & Aleks. -// Created: 2000/03/05 -// RCS-ID: $Id: xh_frame.cpp 39273 2006-05-22 20:54:04Z ABX $ -// Copyright: (c) 2000 Vaclav Slavik -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_XRC - -#include "wx/xrc/xh_frame.h" - -#ifndef WX_PRECOMP - #include "wx/intl.h" - #include "wx/log.h" - #include "wx/frame.h" - #include "wx/dialog.h" // to get wxDEFAULT_DIALOG_STYLE -#endif - -IMPLEMENT_DYNAMIC_CLASS(wxFrameXmlHandler, wxXmlResourceHandler) - -wxFrameXmlHandler::wxFrameXmlHandler() : wxXmlResourceHandler() -{ - XRC_ADD_STYLE(wxSTAY_ON_TOP); - XRC_ADD_STYLE(wxCAPTION); - XRC_ADD_STYLE(wxDEFAULT_DIALOG_STYLE); - XRC_ADD_STYLE(wxDEFAULT_FRAME_STYLE); -#if WXWIN_COMPATIBILITY_2_6 - XRC_ADD_STYLE(wxTHICK_FRAME); -#endif // WXWIN_COMPATIBILITY_2_6 - XRC_ADD_STYLE(wxSYSTEM_MENU); - XRC_ADD_STYLE(wxRESIZE_BORDER); -#if WXWIN_COMPATIBILITY_2_6 - XRC_ADD_STYLE(wxRESIZE_BOX); -#endif // WXWIN_COMPATIBILITY_2_6 - XRC_ADD_STYLE(wxCLOSE_BOX); - - XRC_ADD_STYLE(wxFRAME_NO_TASKBAR); - XRC_ADD_STYLE(wxFRAME_SHAPED); - XRC_ADD_STYLE(wxFRAME_TOOL_WINDOW); - XRC_ADD_STYLE(wxFRAME_FLOAT_ON_PARENT); - XRC_ADD_STYLE(wxMAXIMIZE_BOX); - XRC_ADD_STYLE(wxMINIMIZE_BOX); - XRC_ADD_STYLE(wxSTAY_ON_TOP); - -#if WXWIN_COMPATIBILITY_2_6 - XRC_ADD_STYLE(wxNO_3D); -#endif // WXWIN_COMPATIBILITY_2_6 - XRC_ADD_STYLE(wxTAB_TRAVERSAL); - XRC_ADD_STYLE(wxWS_EX_VALIDATE_RECURSIVELY); - XRC_ADD_STYLE(wxFRAME_EX_METAL); - XRC_ADD_STYLE(wxFRAME_EX_CONTEXTHELP); - - AddWindowStyles(); -} - -wxObject *wxFrameXmlHandler::DoCreateResource() -{ - XRC_MAKE_INSTANCE(frame, wxFrame); - - frame->Create(m_parentAsWindow, - GetID(), - GetText(wxT("title")), - wxDefaultPosition, wxDefaultSize, - GetStyle(wxT("style"), wxDEFAULT_FRAME_STYLE), - GetName()); - - if (HasParam(wxT("size"))) - frame->SetClientSize(GetSize(wxT("size"), frame)); - if (HasParam(wxT("pos"))) - frame->Move(GetPosition()); - if (HasParam(wxT("icon"))) - frame->SetIcon(GetIcon(wxT("icon"), wxART_FRAME_ICON)); - - SetupWindow(frame); - - CreateChildren(frame); - - if (GetBool(wxT("centered"), false)) - frame->Centre(); - - return frame; -} - -bool wxFrameXmlHandler::CanHandle(wxXmlNode *node) -{ - return IsOfClass(node, wxT("wxFrame")); -} - -#endif // wxUSE_XRC diff --git a/wxWidgets/src/xrc/xh_gauge.cpp b/wxWidgets/src/xrc/xh_gauge.cpp deleted file mode 100644 index 92c5447b93..0000000000 --- a/wxWidgets/src/xrc/xh_gauge.cpp +++ /dev/null @@ -1,75 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/xrc/xh_gauge.cpp -// Purpose: XRC resource for wxGauge -// Author: Bob Mitchell -// Created: 2000/03/21 -// RCS-ID: $Id: xh_gauge.cpp 39607 2006-06-06 22:02:01Z ABX $ -// Copyright: (c) 2000 Bob Mitchell and Verant Interactive -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_XRC && wxUSE_GAUGE - -#include "wx/xrc/xh_gauge.h" - -#ifndef WX_PRECOMP - #include "wx/gauge.h" -#endif - -IMPLEMENT_DYNAMIC_CLASS(wxGaugeXmlHandler, wxXmlResourceHandler) - -wxGaugeXmlHandler::wxGaugeXmlHandler() - :wxXmlResourceHandler() -{ - XRC_ADD_STYLE(wxGA_HORIZONTAL); - XRC_ADD_STYLE(wxGA_VERTICAL); -#if WXWIN_COMPATIBILITY_2_6 - XRC_ADD_STYLE(wxGA_PROGRESSBAR); -#endif // WXWIN_COMPATIBILITY_2_6 - XRC_ADD_STYLE(wxGA_SMOOTH); // windows only - AddWindowStyles(); -} - -wxObject *wxGaugeXmlHandler::DoCreateResource() -{ - XRC_MAKE_INSTANCE(control, wxGauge) - - control->Create(m_parentAsWindow, - GetID(), - GetLong(wxT("range"), wxGAUGE_DEFAULT_RANGE), - GetPosition(), GetSize(), - GetStyle(), - wxDefaultValidator, - GetName()); - - if( HasParam(wxT("value"))) - { - control->SetValue(GetLong(wxT("value"))); - } - if( HasParam(wxT("shadow"))) - { - control->SetShadowWidth(GetDimension(wxT("shadow"))); - } - if( HasParam(wxT("bezel"))) - { - control->SetBezelFace(GetDimension(wxT("bezel"))); - } - - SetupWindow(control); - - return control; -} - -bool wxGaugeXmlHandler::CanHandle(wxXmlNode *node) -{ - return IsOfClass(node, wxT("wxGauge")); -} - -#endif // wxUSE_XRC && wxUSE_GAUGE diff --git a/wxWidgets/src/xrc/xh_gdctl.cpp b/wxWidgets/src/xrc/xh_gdctl.cpp deleted file mode 100644 index 3aeb7492b9..0000000000 --- a/wxWidgets/src/xrc/xh_gdctl.cpp +++ /dev/null @@ -1,64 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/xrc/xh_gdctl.cpp -// Purpose: XRC resource for wxGenericDirCtrl -// Author: Markus Greither -// Created: 2002/01/20 -// RCS-ID: $Id: xh_gdctl.cpp 44726 2007-03-10 17:23:26Z VZ $ -// Copyright: (c) 2002 Markus Greither -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_XRC && wxUSE_DIRDLG - -#include "wx/xrc/xh_gdctl.h" - -#ifndef WX_PRECOMP - #include "wx/textctrl.h" -#endif - -#include "wx/dirctrl.h" - -IMPLEMENT_DYNAMIC_CLASS(wxGenericDirCtrlXmlHandler, wxXmlResourceHandler) - -wxGenericDirCtrlXmlHandler::wxGenericDirCtrlXmlHandler() -: wxXmlResourceHandler() -{ - XRC_ADD_STYLE(wxDIRCTRL_DIR_ONLY); - XRC_ADD_STYLE(wxDIRCTRL_3D_INTERNAL); - XRC_ADD_STYLE(wxDIRCTRL_SELECT_FIRST); - XRC_ADD_STYLE(wxDIRCTRL_SHOW_FILTERS); - XRC_ADD_STYLE(wxDIRCTRL_EDIT_LABELS); - AddWindowStyles(); -} - -wxObject *wxGenericDirCtrlXmlHandler::DoCreateResource() -{ - XRC_MAKE_INSTANCE(ctrl, wxGenericDirCtrl) - - ctrl->Create(m_parentAsWindow, - GetID(), - GetText(wxT("defaultfolder")), - GetPosition(), GetSize(), - GetStyle(), - GetText(wxT("filter")), - (int)GetLong(wxT("defaultfilter")), - GetName()); - - SetupWindow(ctrl); - - return ctrl; -} - -bool wxGenericDirCtrlXmlHandler::CanHandle(wxXmlNode *node) -{ - return IsOfClass(node, wxT("wxGenericDirCtrl")); -} - -#endif // wxUSE_XRC && wxUSE_DIRDLG diff --git a/wxWidgets/src/xrc/xh_grid.cpp b/wxWidgets/src/xrc/xh_grid.cpp deleted file mode 100644 index 2f5b92b181..0000000000 --- a/wxWidgets/src/xrc/xh_grid.cpp +++ /dev/null @@ -1,51 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: xh_grid.h -// Purpose: XML resource handler for the grid control -// Author: Agron Selimaj -// Created: 2005/08/11 -// RCS-ID: $Id: xh_grid.cpp 36278 2005-11-29 00:54:02Z VZ $ -// Copyright: (c) 2005 Agron Selimaj, Freepour Controls Inc. -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_XRC && wxUSE_GRID - -#include "wx/xrc/xh_grid.h" -#include "wx/grid.h" - -IMPLEMENT_DYNAMIC_CLASS(wxGridXmlHandler, wxXmlResourceHandler) - -wxGridXmlHandler::wxGridXmlHandler() - : wxXmlResourceHandler() -{ - AddWindowStyles(); -} - -wxObject *wxGridXmlHandler::DoCreateResource() -{ - XRC_MAKE_INSTANCE(grid, wxGrid) - - grid->Create(m_parentAsWindow, - GetID(), - GetPosition(), GetSize(), - GetStyle(wxT("style")), - GetName()); - - SetupWindow( grid); - - return grid; -} - -bool wxGridXmlHandler::CanHandle(wxXmlNode *node) -{ - return IsOfClass(node, wxT("wxGrid")); -} - -#endif // wxUSE_XRC && wxUSE_GRID diff --git a/wxWidgets/src/xrc/xh_html.cpp b/wxWidgets/src/xrc/xh_html.cpp deleted file mode 100644 index 45745c8ca9..0000000000 --- a/wxWidgets/src/xrc/xh_html.cpp +++ /dev/null @@ -1,81 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: xh_html.cpp -// Purpose: XRC resource for wxHtmlWindow -// Author: Bob Mitchell -// Created: 2000/03/21 -// RCS-ID: $Id: xh_html.cpp 35650 2005-09-23 12:56:45Z MR $ -// Copyright: (c) 2000 Bob Mitchell and Verant Interactive -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_XRC && wxUSE_HTML - -#include "wx/xrc/xh_html.h" - -#include "wx/html/htmlwin.h" -#include "wx/filesys.h" - -IMPLEMENT_DYNAMIC_CLASS(wxHtmlWindowXmlHandler, wxXmlResourceHandler) - -wxHtmlWindowXmlHandler::wxHtmlWindowXmlHandler() -: wxXmlResourceHandler() -{ - XRC_ADD_STYLE(wxHW_SCROLLBAR_NEVER); - XRC_ADD_STYLE(wxHW_SCROLLBAR_AUTO); - XRC_ADD_STYLE(wxHW_NO_SELECTION); - AddWindowStyles(); -} - -wxObject *wxHtmlWindowXmlHandler::DoCreateResource() -{ - XRC_MAKE_INSTANCE(control, wxHtmlWindow) - - control->Create(m_parentAsWindow, - GetID(), - GetPosition(), GetSize(), - GetStyle(wxT("style"), wxHW_SCROLLBAR_AUTO), - GetName()); - - if (HasParam(wxT("borders"))) - { - control->SetBorders(GetDimension(wxT("borders"))); - } - - if (HasParam(wxT("url"))) - { - wxString url = GetParamValue(wxT("url")); - wxFileSystem& fsys = GetCurFileSystem(); - - wxFSFile *f = fsys.OpenFile(url); - if (f) - { - control->LoadPage(f->GetLocation()); - delete f; - } - else - control->LoadPage(url); - } - - else if (HasParam(wxT("htmlcode"))) - { - control->SetPage(GetText(wxT("htmlcode"))); - } - - SetupWindow(control); - - return control; -} - -bool wxHtmlWindowXmlHandler::CanHandle(wxXmlNode *node) -{ - return IsOfClass(node, wxT("wxHtmlWindow")); -} - -#endif // wxUSE_XRC && wxUSE_HTML diff --git a/wxWidgets/src/xrc/xh_htmllbox.cpp b/wxWidgets/src/xrc/xh_htmllbox.cpp deleted file mode 100644 index 952f72c9b9..0000000000 --- a/wxWidgets/src/xrc/xh_htmllbox.cpp +++ /dev/null @@ -1,86 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: xh_simplehtmllbox.cpp -// Purpose: XML resource handler for wxSimpleHtmlListBox -// Author: Francesco Montorsi -// Created: 2006/10/21 -// RCS-ID: $Id: xh_htmllbox.cpp 42257 2006-10-22 22:09:16Z VZ $ -// Copyright: (c) 2006 Francesco Montorsi -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_XRC && wxUSE_HTML - -#include "wx/xrc/xh_htmllbox.h" - -#include "wx/htmllbox.h" -#include "wx/filesys.h" - -IMPLEMENT_DYNAMIC_CLASS(wxSimpleHtmlListBoxXmlHandler, wxXmlResourceHandler) - -wxSimpleHtmlListBoxXmlHandler::wxSimpleHtmlListBoxXmlHandler() -: wxXmlResourceHandler(), m_insideBox(false) -{ - XRC_ADD_STYLE(wxHLB_DEFAULT_STYLE); - XRC_ADD_STYLE(wxHLB_MULTIPLE); - AddWindowStyles(); -} - -wxObject *wxSimpleHtmlListBoxXmlHandler::DoCreateResource() -{ - if ( m_class == wxT("wxSimpleHtmlListBox")) - { - // find the selection - long selection = GetLong(wxT("selection"), -1); - - // need to build the list of strings from children - m_insideBox = true; - CreateChildrenPrivately(NULL, GetParamNode(wxT("content"))); - m_insideBox = false; - - XRC_MAKE_INSTANCE(control, wxSimpleHtmlListBox) - - control->Create(m_parentAsWindow, - GetID(), - GetPosition(), GetSize(), - strList, - GetStyle(_T("style"), wxHLB_DEFAULT_STYLE), - wxDefaultValidator, - GetName()); - - if (selection != -1) - control->SetSelection(selection); - - SetupWindow(control); - strList.Clear(); // dump the strings - - return control; - } - else - { - // on the inside now. - // handle Label - - // add to the list - wxString str = GetNodeContent(m_node); - if (m_resource->GetFlags() & wxXRC_USE_LOCALE) - str = wxGetTranslation(str, m_resource->GetDomain()); - strList.Add(str); - - return NULL; - } -} - -bool wxSimpleHtmlListBoxXmlHandler::CanHandle(wxXmlNode *node) -{ - return (IsOfClass(node, wxT("wxSimpleHtmlListBox")) || - (m_insideBox && node->GetName() == wxT("item"))); -} - -#endif // wxUSE_XRC && wxUSE_HTML diff --git a/wxWidgets/src/xrc/xh_hyperlink.cpp b/wxWidgets/src/xrc/xh_hyperlink.cpp deleted file mode 100644 index c81e1073b6..0000000000 --- a/wxWidgets/src/xrc/xh_hyperlink.cpp +++ /dev/null @@ -1,88 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/xrc/xh_hyperlink.cpp -// Purpose: Hyperlink control -// Author: David Norris -// Modified by: Ryan Norton, Francesco Montorsi -// Created: 04/02/2005 -// RCS-ID: $Id: xh_hyperlink.cpp 54563 2008-07-09 14:02:19Z VZ $ -// Copyright: (c) 2005 David Norris -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -//=========================================================================== -// Declarations -//=========================================================================== - -//--------------------------------------------------------------------------- -// Pre-compiled header stuff -//--------------------------------------------------------------------------- - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ -#pragma hdrstop -#endif - -#if wxUSE_XRC && wxUSE_HYPERLINKCTRL - -//--------------------------------------------------------------------------- -// Includes -//--------------------------------------------------------------------------- - -#include "wx/xrc/xh_hyperlink.h" - -#ifndef WX_PRECOMP -#endif - -#include "wx/hyperlink.h" -#include "wx/xrc/xmlres.h" - -//=========================================================================== -// Implementation -//=========================================================================== - -//--------------------------------------------------------------------------- -// wxHyperlinkCtrlXmlHandler -//--------------------------------------------------------------------------- - -// Register with wxWindows' dynamic class subsystem. -IMPLEMENT_DYNAMIC_CLASS(wxHyperlinkCtrlXmlHandler, wxXmlResourceHandler) - -wxHyperlinkCtrlXmlHandler::wxHyperlinkCtrlXmlHandler() -{ - XRC_ADD_STYLE(wxHL_CONTEXTMENU); - XRC_ADD_STYLE(wxHL_ALIGN_LEFT); - XRC_ADD_STYLE(wxHL_ALIGN_RIGHT); - XRC_ADD_STYLE(wxHL_ALIGN_CENTRE); - XRC_ADD_STYLE(wxHL_DEFAULT_STYLE); - - AddWindowStyles(); -} - -wxObject *wxHyperlinkCtrlXmlHandler::DoCreateResource() -{ - XRC_MAKE_INSTANCE(control, wxHyperlinkCtrl) - - control->Create - ( - m_parentAsWindow, - GetID(), - GetText(wxT("label")), - GetParamValue(wxT("url")), - GetPosition(), GetSize(), - GetStyle(wxT("style"), wxHL_DEFAULT_STYLE), - GetName() - ); - - SetupWindow(control); - - return control; -} - -bool wxHyperlinkCtrlXmlHandler::CanHandle(wxXmlNode *node) -{ - return IsOfClass(node, wxT("wxHyperlinkCtrl")); -} - -#endif // wxUSE_XRC && wxUSE_HYPERLINKCTRL diff --git a/wxWidgets/src/xrc/xh_listb.cpp b/wxWidgets/src/xrc/xh_listb.cpp deleted file mode 100644 index 018fc2b15a..0000000000 --- a/wxWidgets/src/xrc/xh_listb.cpp +++ /dev/null @@ -1,94 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/xrc/xh_listb.cpp -// Purpose: XRC resource for wxListBox -// Author: Bob Mitchell & Vaclav Slavik -// Created: 2000/07/29 -// RCS-ID: $Id: xh_listb.cpp 42258 2006-10-22 22:12:32Z VZ $ -// Copyright: (c) 2000 Bob Mitchell and Verant Interactive -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_XRC && wxUSE_LISTBOX - -#include "wx/xrc/xh_listb.h" - -#ifndef WX_PRECOMP - #include "wx/intl.h" - #include "wx/listbox.h" -#endif - -IMPLEMENT_DYNAMIC_CLASS(wxListBoxXmlHandler, wxXmlResourceHandler) - -wxListBoxXmlHandler::wxListBoxXmlHandler() - : wxXmlResourceHandler(), - m_insideBox(false) -{ - XRC_ADD_STYLE(wxLB_SINGLE); - XRC_ADD_STYLE(wxLB_MULTIPLE); - XRC_ADD_STYLE(wxLB_EXTENDED); - XRC_ADD_STYLE(wxLB_HSCROLL); - XRC_ADD_STYLE(wxLB_ALWAYS_SB); - XRC_ADD_STYLE(wxLB_NEEDED_SB); - XRC_ADD_STYLE(wxLB_SORT); - AddWindowStyles(); -} - -wxObject *wxListBoxXmlHandler::DoCreateResource() -{ - if ( m_class == wxT("wxListBox")) - { - // find the selection - long selection = GetLong(wxT("selection"), -1); - - // need to build the list of strings from children - m_insideBox = true; - CreateChildrenPrivately(NULL, GetParamNode(wxT("content"))); - m_insideBox = false; - - XRC_MAKE_INSTANCE(control, wxListBox) - - control->Create(m_parentAsWindow, - GetID(), - GetPosition(), GetSize(), - strList, - GetStyle(), - wxDefaultValidator, - GetName()); - - if (selection != -1) - control->SetSelection(selection); - - SetupWindow(control); - strList.Clear(); // dump the strings - - return control; - } - else - { - // on the inside now. - // handle Label - - // add to the list - wxString str = GetNodeContent(m_node); - if (m_resource->GetFlags() & wxXRC_USE_LOCALE) - str = wxGetTranslation(str, m_resource->GetDomain()); - strList.Add(str); - - return NULL; - } -} - -bool wxListBoxXmlHandler::CanHandle(wxXmlNode *node) -{ - return (IsOfClass(node, wxT("wxListBox")) || - (m_insideBox && node->GetName() == wxT("item"))); -} - -#endif // wxUSE_XRC && wxUSE_LISTBOX diff --git a/wxWidgets/src/xrc/xh_listbk.cpp b/wxWidgets/src/xrc/xh_listbk.cpp deleted file mode 100644 index cb12d20332..0000000000 --- a/wxWidgets/src/xrc/xh_listbk.cpp +++ /dev/null @@ -1,127 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/xrc/xh_listbk.cpp -// Purpose: XRC resource for wxListbook -// Author: Vaclav Slavik -// Created: 2000/03/21 -// RCS-ID: $Id: xh_listbk.cpp 39627 2006-06-08 06:57:39Z ABX $ -// Copyright: (c) 2000 Vaclav Slavik -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_XRC && wxUSE_LISTBOOK - -#include "wx/xrc/xh_listbk.h" - -#ifndef WX_PRECOMP - #include "wx/log.h" - #include "wx/sizer.h" -#endif - -#include "wx/listbook.h" -#include "wx/imaglist.h" - -IMPLEMENT_DYNAMIC_CLASS(wxListbookXmlHandler, wxXmlResourceHandler) - -wxListbookXmlHandler::wxListbookXmlHandler() - :wxXmlResourceHandler(), - m_isInside(false), - m_listbook(NULL) -{ - XRC_ADD_STYLE(wxBK_DEFAULT); - XRC_ADD_STYLE(wxBK_LEFT); - XRC_ADD_STYLE(wxBK_RIGHT); - XRC_ADD_STYLE(wxBK_TOP); - XRC_ADD_STYLE(wxBK_BOTTOM); - -#if WXWIN_COMPATIBILITY_2_6 - XRC_ADD_STYLE(wxLB_DEFAULT); - XRC_ADD_STYLE(wxLB_LEFT); - XRC_ADD_STYLE(wxLB_RIGHT); - XRC_ADD_STYLE(wxLB_TOP); - XRC_ADD_STYLE(wxLB_BOTTOM); -#endif - - AddWindowStyles(); -} - -wxObject *wxListbookXmlHandler::DoCreateResource() -{ - if (m_class == wxT("listbookpage")) - { - wxXmlNode *n = GetParamNode(wxT("object")); - - if ( !n ) - n = GetParamNode(wxT("object_ref")); - - if (n) - { - bool old_ins = m_isInside; - m_isInside = false; - wxObject *item = CreateResFromNode(n, m_listbook, NULL); - m_isInside = old_ins; - wxWindow *wnd = wxDynamicCast(item, wxWindow); - - if (wnd) - { - m_listbook->AddPage(wnd, GetText(wxT("label")), - GetBool(wxT("selected"))); - if ( HasParam(wxT("bitmap")) ) - { - wxBitmap bmp = GetBitmap(wxT("bitmap"), wxART_OTHER); - wxImageList *imgList = m_listbook->GetImageList(); - if ( imgList == NULL ) - { - imgList = new wxImageList( bmp.GetWidth(), bmp.GetHeight() ); - m_listbook->AssignImageList( imgList ); - } - int imgIndex = imgList->Add(bmp); - m_listbook->SetPageImage(m_listbook->GetPageCount()-1, imgIndex ); - } - } - else - wxLogError(wxT("Error in resource.")); - return wnd; - } - else - { - wxLogError(wxT("Error in resource: no control within listbook's tag.")); - return NULL; - } - } - - else - { - XRC_MAKE_INSTANCE(nb, wxListbook) - - nb->Create(m_parentAsWindow, - GetID(), - GetPosition(), GetSize(), - GetStyle(wxT("style")), - GetName()); - - wxListbook *old_par = m_listbook; - m_listbook = nb; - bool old_ins = m_isInside; - m_isInside = true; - CreateChildren(m_listbook, true/*only this handler*/); - m_isInside = old_ins; - m_listbook = old_par; - - return nb; - } -} - -bool wxListbookXmlHandler::CanHandle(wxXmlNode *node) -{ - return ((!m_isInside && IsOfClass(node, wxT("wxListbook"))) || - (m_isInside && IsOfClass(node, wxT("listbookpage")))); -} - -#endif // wxUSE_XRC && wxUSE_LISTBOOK diff --git a/wxWidgets/src/xrc/xh_listc.cpp b/wxWidgets/src/xrc/xh_listc.cpp deleted file mode 100644 index d558a9524a..0000000000 --- a/wxWidgets/src/xrc/xh_listc.cpp +++ /dev/null @@ -1,77 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/xrc/xh_listc.cpp -// Purpose: XRC resource for wxListCtrl -// Author: Brian Gavin -// Created: 2000/09/09 -// RCS-ID: $Id: xh_listc.cpp 39583 2006-06-06 07:23:19Z ABX $ -// Copyright: (c) 2000 Brian Gavin -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_XRC && wxUSE_LISTCTRL - -#include "wx/xrc/xh_listc.h" - -#ifndef WX_PRECOMP - #include "wx/textctrl.h" -#endif - -#include "wx/listctrl.h" - - -IMPLEMENT_DYNAMIC_CLASS(wxListCtrlXmlHandler, wxXmlResourceHandler) - -wxListCtrlXmlHandler::wxListCtrlXmlHandler() -: wxXmlResourceHandler() -{ - XRC_ADD_STYLE(wxLC_LIST); - XRC_ADD_STYLE(wxLC_REPORT); - XRC_ADD_STYLE(wxLC_ICON); - XRC_ADD_STYLE(wxLC_SMALL_ICON); - XRC_ADD_STYLE(wxLC_ALIGN_TOP); - XRC_ADD_STYLE(wxLC_ALIGN_LEFT); - XRC_ADD_STYLE(wxLC_AUTOARRANGE); - XRC_ADD_STYLE(wxLC_USER_TEXT); - XRC_ADD_STYLE(wxLC_EDIT_LABELS); - XRC_ADD_STYLE(wxLC_NO_HEADER); - XRC_ADD_STYLE(wxLC_SINGLE_SEL); - XRC_ADD_STYLE(wxLC_SORT_ASCENDING); - XRC_ADD_STYLE(wxLC_SORT_DESCENDING); - XRC_ADD_STYLE(wxLC_VIRTUAL); - XRC_ADD_STYLE(wxLC_HRULES); - XRC_ADD_STYLE(wxLC_VRULES); - XRC_ADD_STYLE(wxLC_NO_SORT_HEADER); - AddWindowStyles(); -} - -wxObject *wxListCtrlXmlHandler::DoCreateResource() -{ - XRC_MAKE_INSTANCE(list, wxListCtrl) - - list->Create(m_parentAsWindow, - GetID(), - GetPosition(), GetSize(), - GetStyle(), - wxDefaultValidator, - GetName()); - - // FIXME: add columns definition - - SetupWindow(list); - - return list; -} - -bool wxListCtrlXmlHandler::CanHandle(wxXmlNode *node) -{ - return IsOfClass(node, wxT("wxListCtrl")); -} - -#endif // wxUSE_XRC && wxUSE_LISTCTRL diff --git a/wxWidgets/src/xrc/xh_mdi.cpp b/wxWidgets/src/xrc/xh_mdi.cpp deleted file mode 100644 index 09d0cd8328..0000000000 --- a/wxWidgets/src/xrc/xh_mdi.cpp +++ /dev/null @@ -1,139 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/xrc/xh_mdi.cpp -// Purpose: XRC resource for wxMDI -// Author: David M. Falkinder & Vaclav Slavik -// Created: 14/02/2005 -// RCS-ID: $Id: xh_mdi.cpp 41590 2006-10-03 14:53:40Z VZ $ -// Copyright: (c) 2005 Vaclav Slavik -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_XRC && wxUSE_MDI - -#include "wx/xrc/xh_mdi.h" - -#ifndef WX_PRECOMP - #include "wx/intl.h" - #include "wx/log.h" - #include "wx/dialog.h" // to get wxDEFAULT_DIALOG_STYLE - #include "wx/mdi.h" -#endif - -IMPLEMENT_DYNAMIC_CLASS(wxMdiXmlHandler, wxXmlResourceHandler) - -wxMdiXmlHandler::wxMdiXmlHandler() : wxXmlResourceHandler() -{ - XRC_ADD_STYLE(wxSTAY_ON_TOP); - XRC_ADD_STYLE(wxCAPTION); - XRC_ADD_STYLE(wxDEFAULT_DIALOG_STYLE); - XRC_ADD_STYLE(wxDEFAULT_FRAME_STYLE); -#if WXWIN_COMPATIBILITY_2_6 - XRC_ADD_STYLE(wxTHICK_FRAME); -#endif // WXWIN_COMPATIBILITY_2_6 - XRC_ADD_STYLE(wxSYSTEM_MENU); - XRC_ADD_STYLE(wxRESIZE_BORDER); -#if WXWIN_COMPATIBILITY_2_6 - XRC_ADD_STYLE(wxRESIZE_BOX); -#endif // WXWIN_COMPATIBILITY_2_6 - XRC_ADD_STYLE(wxCLOSE_BOX); - - XRC_ADD_STYLE(wxFRAME_NO_TASKBAR); - XRC_ADD_STYLE(wxFRAME_SHAPED); - XRC_ADD_STYLE(wxFRAME_TOOL_WINDOW); - XRC_ADD_STYLE(wxFRAME_FLOAT_ON_PARENT); - XRC_ADD_STYLE(wxMAXIMIZE_BOX); - XRC_ADD_STYLE(wxMINIMIZE_BOX); - XRC_ADD_STYLE(wxSTAY_ON_TOP); - -#if WXWIN_COMPATIBILITY_2_6 - XRC_ADD_STYLE(wxNO_3D); -#endif // WXWIN_COMPATIBILITY_2_6 - XRC_ADD_STYLE(wxTAB_TRAVERSAL); - XRC_ADD_STYLE(wxWS_EX_VALIDATE_RECURSIVELY); - XRC_ADD_STYLE(wxFRAME_EX_METAL); - - XRC_ADD_STYLE(wxHSCROLL); - XRC_ADD_STYLE(wxVSCROLL); - XRC_ADD_STYLE(wxMAXIMIZE); - XRC_ADD_STYLE(wxFRAME_NO_WINDOW_MENU); - - AddWindowStyles(); -} - -wxWindow *wxMdiXmlHandler::CreateFrame() -{ - if (m_class == wxT("wxMDIParentFrame")) - { - XRC_MAKE_INSTANCE(frame, wxMDIParentFrame); - - frame->Create(m_parentAsWindow, - GetID(), - GetText(wxT("title")), - wxDefaultPosition, wxDefaultSize, - GetStyle(wxT("style"), - wxDEFAULT_FRAME_STYLE | wxVSCROLL | wxHSCROLL), - GetName()); - return frame; - } - else // wxMDIChildFrame - { - wxMDIParentFrame *mdiParent = wxDynamicCast(m_parent, wxMDIParentFrame); - - if ( !mdiParent ) - { - wxLogError(wxT("Parent of wxMDIParentFrame must be wxMDIParentFrame.")); - return NULL; - } - - XRC_MAKE_INSTANCE(frame, wxMDIChildFrame); - - frame->Create(mdiParent, - GetID(), - GetText(wxT("title")), - wxDefaultPosition, wxDefaultSize, - GetStyle(wxT("style"), wxDEFAULT_FRAME_STYLE), - GetName()); - - return frame; - } -} - -wxObject *wxMdiXmlHandler::DoCreateResource() -{ - wxWindow *frame = CreateFrame(); - - if (HasParam(wxT("size"))) - frame->SetClientSize(GetSize()); - if (HasParam(wxT("pos"))) - frame->Move(GetPosition()); - if (HasParam(wxT("icon"))) - { - wxFrame* f = wxDynamicCast(frame, wxFrame); - if (f) - f->SetIcon(GetIcon(wxT("icon"), wxART_FRAME_ICON)); - } - - SetupWindow(frame); - - CreateChildren(frame); - - if (GetBool(wxT("centered"), false)) - frame->Centre(); - - return frame; -} - -bool wxMdiXmlHandler::CanHandle(wxXmlNode *node) -{ - return (IsOfClass(node, wxT("wxMDIParentFrame")) || - IsOfClass(node, wxT("wxMDIChildFrame"))); -} - -#endif // wxUSE_XRC && wxUSE_MDI diff --git a/wxWidgets/src/xrc/xh_menu.cpp b/wxWidgets/src/xrc/xh_menu.cpp deleted file mode 100644 index ed5eb10dc9..0000000000 --- a/wxWidgets/src/xrc/xh_menu.cpp +++ /dev/null @@ -1,162 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/xrc/xh_menu.cpp -// Purpose: XRC resource for menus and menubars -// Author: Vaclav Slavik -// Created: 2000/03/05 -// RCS-ID: $Id: xh_menu.cpp 63466 2010-02-11 12:47:17Z VS $ -// Copyright: (c) 2000 Vaclav Slavik -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ - #pragma hdrstop -#endif - -#if wxUSE_XRC && wxUSE_MENUS - -#include "wx/xrc/xh_menu.h" - -#ifndef WX_PRECOMP - #include "wx/frame.h" - #include "wx/menu.h" -#endif - -IMPLEMENT_DYNAMIC_CLASS(wxMenuXmlHandler, wxXmlResourceHandler) - -wxMenuXmlHandler::wxMenuXmlHandler() : - wxXmlResourceHandler(), m_insideMenu(false) -{ - XRC_ADD_STYLE(wxMENU_TEAROFF); -} - -wxObject *wxMenuXmlHandler::DoCreateResource() -{ - if (m_class == wxT("wxMenu")) - { - wxMenu *menu = m_instance ? wxStaticCast(m_instance, wxMenu) - : new wxMenu(GetStyle()); - - wxString title = GetText(wxT("label")); - wxString help = GetText(wxT("help")); - - bool oldins = m_insideMenu; - m_insideMenu = true; - CreateChildren(menu, true/*only this handler*/); - m_insideMenu = oldins; - - wxMenuBar *p_bar = wxDynamicCast(m_parent, wxMenuBar); - if (p_bar) - { - p_bar->Append(menu, title); - } - else - { - wxMenu *p_menu = wxDynamicCast(m_parent, wxMenu); - if (p_menu) - { - p_menu->Append(GetID(), title, menu, help); - if (HasParam(wxT("enabled"))) - p_menu->Enable(GetID(), GetBool(wxT("enabled"))); - } - } - - return menu; - } - - else - { - wxMenu *p_menu = wxDynamicCast(m_parent, wxMenu); - - if (m_class == wxT("separator")) - p_menu->AppendSeparator(); - else if (m_class == wxT("break")) - p_menu->Break(); - else /*wxMenuItem*/ - { - int id = GetID(); - wxString label = GetText(wxT("label")); - wxString accel = GetText(wxT("accel"), false); - wxString fullLabel = label; - if (!accel.empty()) - fullLabel << wxT("\t") << accel; - - wxItemKind kind = wxITEM_NORMAL; - if (GetBool(wxT("radio"))) - kind = wxITEM_RADIO; - if (GetBool(wxT("checkable"))) - { - wxASSERT_MSG( kind == wxITEM_NORMAL, _T("can't have both checkable and radion button at once") ); - kind = wxITEM_CHECK; - } - - wxMenuItem *mitem = new wxMenuItem(p_menu, id, fullLabel, - GetText(wxT("help")), kind); - -#if (!defined(__WXMSW__) && !defined(__WXPM__)) || wxUSE_OWNER_DRAWN - if (HasParam(wxT("bitmap"))) - mitem->SetBitmap(GetBitmap(wxT("bitmap"), wxART_MENU)); -#endif - p_menu->Append(mitem); - mitem->Enable(GetBool(wxT("enabled"), true)); - if (kind == wxITEM_CHECK) - mitem->Check(GetBool(wxT("checked"))); - } - return NULL; - } -} - - - -bool wxMenuXmlHandler::CanHandle(wxXmlNode *node) -{ - return IsOfClass(node, wxT("wxMenu")) || - (m_insideMenu && - (IsOfClass(node, wxT("wxMenuItem")) || - IsOfClass(node, wxT("break")) || - IsOfClass(node, wxT("separator"))) - ); -} - -IMPLEMENT_DYNAMIC_CLASS(wxMenuBarXmlHandler, wxXmlResourceHandler) - -wxMenuBarXmlHandler::wxMenuBarXmlHandler() : wxXmlResourceHandler() -{ - XRC_ADD_STYLE(wxMB_DOCKABLE); -} - -wxObject *wxMenuBarXmlHandler::DoCreateResource() -{ - wxMenuBar *menubar = NULL; - - const int style = GetStyle(); - wxASSERT_MSG(!style || !m_instance, - wxT("cannot use